From: Andrea Amorese Date: Fri, 3 Dec 2021 14:33:23 +0000 (+0100) Subject: Built motion from commit 9e2f92ed.|2.5.40 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%22%7B%7Blicense.mail?a=commitdiff_plain;h=d6cebe878dca3dfd10fec5566f644d547a41c0dc;p=motion2.git Built motion from commit 9e2f92ed.|2.5.40 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index a386bb1..18b90a8 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-03T10:52:32.419Z", + "time": "2021-12-03T14:08:13.428Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index e4c7239..fd2f6aa 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-12-03T10:52:32.419Z", + "time": "2021-12-03T14:08:13.428Z", "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 027a36a..90e797f 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 _0x2a0d=['urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports','VIRTUAL','action','STRING','contactManager','integration','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'];(function(_0x53ec91,_0x7eb7bb){var _0x36d102=function(_0x279d65){while(--_0x279d65){_0x53ec91['push'](_0x53ec91['shift']());}};_0x36d102(++_0x7eb7bb);}(_0x2a0d,0x1c4));var _0xd2a0=function(_0x2d5b09,_0x3cdc73){_0x2d5b09=_0x2d5b09-0x0;var _0x3e106b=_0x2a0d[_0x2d5b09];return _0x3e106b;};'use strict';var Sequelize=require(_0xd2a0('0x0'));module[_0xd2a0('0x1')]={'name':{'type':Sequelize[_0xd2a0('0x2')],'get':function(_0x136dad){return this['getDataValue'](_0xd2a0('0x3'));}},'action':{'type':Sequelize[_0xd2a0('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0xd2a0('0x5'),_0xd2a0('0x6'),'motionbar',_0xd2a0('0x7'),_0xd2a0('0x8'),_0xd2a0('0x9'),_0xd2a0('0xa'),_0xd2a0('0xb')]],'msg':_0xd2a0('0xc')}},'comment':_0xd2a0('0xc')},'data1':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comment':_0xd2a0('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xd2a0('0xe')},'data4':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xd2a0('0x4')](0x1000),'comments':_0xd2a0('0xf')},'data6':{'type':Sequelize[_0xd2a0('0x4')],'comments':_0xd2a0('0x10')},'data7':{'type':Sequelize['TEXT'],'comments':_0xd2a0('0x11')}}; \ No newline at end of file +var _0x76a6=['exports','getDataValue','action','STRING','integration','motionbar','jscripty','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x76a6,0x18b));var _0x676a=function(_0x50af9c,_0xf03b1e){_0x50af9c=_0x50af9c-0x0;var _0x5b5e5a=_0x76a6[_0x50af9c];return _0x5b5e5a;};'use strict';var Sequelize=require(_0x676a('0x0'));module[_0x676a('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0xf9a7f3){return this[_0x676a('0x2')](_0x676a('0x3'));}},'action':{'type':Sequelize[_0x676a('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x676a('0x5'),_0x676a('0x6'),_0x676a('0x7'),'urlForward',_0x676a('0x8'),_0x676a('0x9'),_0x676a('0xa')]],'msg':_0x676a('0xb')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xc')},'data2':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xd')},'data3':{'type':Sequelize[_0x676a('0x4')](0x1000),'comment':_0x676a('0xe')},'data4':{'type':Sequelize[_0x676a('0x4')](0x1000),'comments':_0x676a('0xf')},'data5':{'type':Sequelize[_0x676a('0x4')](0x1000),'comments':_0x676a('0x10')},'data6':{'type':Sequelize[_0x676a('0x4')],'comments':_0x676a('0x11')},'data7':{'type':Sequelize['TEXT'],'comments':'urlForward[body]'}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index c795a77..39a7d60 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 _0x5650=['mustache','path','sox','to-csv','fs-extra','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','body','find','catch','Action','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x1a9e78,_0x180720){var _0x113e06=function(_0x229c64){while(--_0x229c64){_0x1a9e78['push'](_0x1a9e78['shift']());}};_0x113e06(++_0x180720);}(_0x5650,0x1c6));var _0x0565=function(_0x1083f0,_0x190add){_0x1083f0=_0x1083f0-0x0;var _0x3e671f=_0x5650[_0x1083f0];return _0x3e671f;};'use strict';var emlformat=require(_0x0565('0x0'));var rimraf=require(_0x0565('0x1'));var zipdir=require(_0x0565('0x2'));var jsonpatch=require(_0x0565('0x3'));var rp=require(_0x0565('0x4'));var moment=require('moment');var BPromise=require(_0x0565('0x5'));var Mustache=require(_0x0565('0x6'));var util=require('util');var path=require(_0x0565('0x7'));var sox=require(_0x0565('0x8'));var csv=require(_0x0565('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0565('0xa'));var _=require('lodash');var squel=require(_0x0565('0xb'));var crypto=require('crypto');var jsforce=require(_0x0565('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0565('0x9'));var querystring=require(_0x0565('0xd'));var Papa=require('papaparse');var Redis=require(_0x0565('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x0565('0xf'));var as=require(_0x0565('0x10'));var hardwareService=require(_0x0565('0x11'));var logger=require('../../config/logger')(_0x0565('0x12'));var utils=require(_0x0565('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x0565('0x14'));var db=require(_0x0565('0x15'))['db'];function respondWithStatusCode(_0x9862cf,_0x27731b){_0x27731b=_0x27731b||0xcc;return function(_0x4eb259){if(_0x4eb259){return _0x9862cf[_0x0565('0x16')](_0x27731b);}return _0x9862cf[_0x0565('0x17')](_0x27731b)[_0x0565('0x18')]();};}function respondWithResult(_0x337014,_0x4fa192){_0x4fa192=_0x4fa192||0xc8;return function(_0x1f6759){if(_0x1f6759){return _0x337014[_0x0565('0x17')](_0x4fa192)[_0x0565('0x19')](_0x1f6759);}};}function respondWithFilteredResult(_0x5ef9f2,_0x586e8c){return function(_0x1324dd){if(_0x1324dd){var _0x25e44a=typeof _0x586e8c['offset']===_0x0565('0x1a')&&typeof _0x586e8c[_0x0565('0x1b')]===_0x0565('0x1a');var _0x3134e7=_0x1324dd[_0x0565('0x1c')];var _0x54660c=_0x25e44a?0x0:_0x586e8c[_0x0565('0x1d')];var _0x4f3031=_0x25e44a?_0x1324dd[_0x0565('0x1c')]:_0x586e8c[_0x0565('0x1d')]+_0x586e8c['limit'];var _0x38ce77;if(_0x4f3031>=_0x3134e7){_0x4f3031=_0x3134e7;_0x38ce77=0xc8;}else{_0x38ce77=0xce;}_0x5ef9f2['status'](_0x38ce77);return _0x5ef9f2[_0x0565('0x1e')](_0x0565('0x1f'),_0x54660c+'-'+_0x4f3031+'/'+_0x3134e7)[_0x0565('0x19')](_0x1324dd);}return null;};}function patchUpdates(_0x15d63c){return function(_0x534783){try{jsonpatch[_0x0565('0x20')](_0x534783,_0x15d63c,!![]);}catch(_0x4e5f52){return BPromise[_0x0565('0x21')](_0x4e5f52);}return _0x534783[_0x0565('0x22')]();};}function saveUpdates(_0x475504,_0x19b7cc){return function(_0x2fe5db){if(_0x2fe5db){return _0x2fe5db[_0x0565('0x23')](_0x475504)[_0x0565('0x24')](function(_0x45b586){return _0x45b586;});}return null;};}function removeEntity(_0x4e93b7,_0x20ef1f){return function(_0x29de05){if(_0x29de05){return _0x29de05[_0x0565('0x25')]()[_0x0565('0x24')](function(){_0x4e93b7[_0x0565('0x17')](0xcc)[_0x0565('0x18')]();});}};}function handleEntityNotFound(_0x3783f7,_0x2bda5d){return function(_0x3ec8bf){if(!_0x3ec8bf){_0x3783f7[_0x0565('0x16')](0x194);}return _0x3ec8bf;};}function handleError(_0x338187,_0x55e898){_0x55e898=_0x55e898||0x1f4;return function(_0xacfa74){logger[_0x0565('0x26')](_0xacfa74[_0x0565('0x27')]);if(_0xacfa74[_0x0565('0x28')]){delete _0xacfa74['name'];}_0x338187['status'](_0x55e898)['send'](_0xacfa74);};}exports['update']=function(_0x26372a,_0xd02001){if(_0x26372a[_0x0565('0x29')]['id']){delete _0x26372a['body']['id'];}return db['Action'][_0x0565('0x2a')]({'where':{'id':_0x26372a['params']['id']}})[_0x0565('0x24')](handleEntityNotFound(_0xd02001,null))['then'](saveUpdates(_0x26372a[_0x0565('0x29')],null))[_0x0565('0x24')](respondWithResult(_0xd02001,null))[_0x0565('0x2b')](handleError(_0xd02001,null));};exports['destroy']=function(_0x1952d8,_0xc73060){return db[_0x0565('0x2c')]['find']({'where':{'id':_0x1952d8[_0x0565('0x2d')]['id']}})[_0x0565('0x24')](handleEntityNotFound(_0xc73060,null))[_0x0565('0x24')](removeEntity(_0xc73060,null))['catch'](handleError(_0xc73060,null));}; \ No newline at end of file +var _0xaedf=['fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','end','error','stack','name','find','then','body','catch','Action','params','rimraf','zip-dir'];(function(_0x4487b4,_0x1a719f){var _0x15fa42=function(_0x2fcbee){while(--_0x2fcbee){_0x4487b4['push'](_0x4487b4['shift']());}};_0x15fa42(++_0x1a719f);}(_0xaedf,0x132));var _0xfaed=function(_0xd1ef6b,_0x11e678){_0xd1ef6b=_0xd1ef6b-0x0;var _0x21a1fe=_0xaedf[_0xd1ef6b];return _0x21a1fe;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfaed('0x0'));var zipdir=require(_0xfaed('0x1'));var jsonpatch=require(_0xfaed('0x2'));var rp=require('request-promise');var moment=require(_0xfaed('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xfaed('0x4'));var util=require(_0xfaed('0x5'));var path=require(_0xfaed('0x6'));var sox=require(_0xfaed('0x7'));var csv=require('to-csv');var ejs=require(_0xfaed('0x8'));var fs=require('fs');var fs_extra=require(_0xfaed('0x9'));var _=require(_0xfaed('0xa'));var squel=require(_0xfaed('0xb'));var crypto=require('crypto');var jsforce=require(_0xfaed('0xc'));var deskjs=require(_0xfaed('0xd'));var toCsv=require(_0xfaed('0xe'));var querystring=require(_0xfaed('0xf'));var Papa=require(_0xfaed('0x10'));var Redis=require(_0xfaed('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfaed('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfaed('0x13'));var logger=require('../../config/logger')(_0xfaed('0x14'));var utils=require(_0xfaed('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xfaed('0x16'))['db'];function respondWithStatusCode(_0x56659f,_0xc8d341){_0xc8d341=_0xc8d341||0xcc;return function(_0x130d24){if(_0x130d24){return _0x56659f[_0xfaed('0x17')](_0xc8d341);}return _0x56659f[_0xfaed('0x18')](_0xc8d341)['end']();};}function respondWithResult(_0x1d4557,_0x593974){_0x593974=_0x593974||0xc8;return function(_0x5aa84c){if(_0x5aa84c){return _0x1d4557['status'](_0x593974)[_0xfaed('0x19')](_0x5aa84c);}};}function respondWithFilteredResult(_0x4878fc,_0x158e7b){return function(_0x19d9de){if(_0x19d9de){var _0x307ac0=typeof _0x158e7b[_0xfaed('0x1a')]===_0xfaed('0x1b')&&typeof _0x158e7b[_0xfaed('0x1c')]===_0xfaed('0x1b');var _0x515705=_0x19d9de[_0xfaed('0x1d')];var _0x2525f8=_0x307ac0?0x0:_0x158e7b[_0xfaed('0x1a')];var _0x45f8ff=_0x307ac0?_0x19d9de[_0xfaed('0x1d')]:_0x158e7b[_0xfaed('0x1a')]+_0x158e7b[_0xfaed('0x1c')];var _0x56dde5;if(_0x45f8ff>=_0x515705){_0x45f8ff=_0x515705;_0x56dde5=0xc8;}else{_0x56dde5=0xce;}_0x4878fc[_0xfaed('0x18')](_0x56dde5);return _0x4878fc[_0xfaed('0x1e')](_0xfaed('0x1f'),_0x2525f8+'-'+_0x45f8ff+'/'+_0x515705)['json'](_0x19d9de);}return null;};}function patchUpdates(_0x366469){return function(_0x11da66){try{jsonpatch['apply'](_0x11da66,_0x366469,!![]);}catch(_0xc0b1db){return BPromise['reject'](_0xc0b1db);}return _0x11da66[_0xfaed('0x20')]();};}function saveUpdates(_0x2c0683,_0x3d2e1b){return function(_0x3ec6b9){if(_0x3ec6b9){return _0x3ec6b9[_0xfaed('0x21')](_0x2c0683)['then'](function(_0x4a3dbc){return _0x4a3dbc;});}return null;};}function removeEntity(_0x27a0e6,_0x1e7fcf){return function(_0x4aa310){if(_0x4aa310){return _0x4aa310['destroy']()['then'](function(){_0x27a0e6[_0xfaed('0x18')](0xcc)[_0xfaed('0x22')]();});}};}function handleEntityNotFound(_0xce1ac1,_0x293632){return function(_0xa1ec81){if(!_0xa1ec81){_0xce1ac1[_0xfaed('0x17')](0x194);}return _0xa1ec81;};}function handleError(_0x1dfed0,_0x39754b){_0x39754b=_0x39754b||0x1f4;return function(_0x29dd79){logger[_0xfaed('0x23')](_0x29dd79[_0xfaed('0x24')]);if(_0x29dd79[_0xfaed('0x25')]){delete _0x29dd79[_0xfaed('0x25')];}_0x1dfed0[_0xfaed('0x18')](_0x39754b)['send'](_0x29dd79);};}exports[_0xfaed('0x21')]=function(_0x54dee5,_0x288a16){if(_0x54dee5['body']['id']){delete _0x54dee5['body']['id'];}return db['Action'][_0xfaed('0x26')]({'where':{'id':_0x54dee5['params']['id']}})['then'](handleEntityNotFound(_0x288a16,null))[_0xfaed('0x27')](saveUpdates(_0x54dee5[_0xfaed('0x28')],null))[_0xfaed('0x27')](respondWithResult(_0x288a16,null))[_0xfaed('0x29')](handleError(_0x288a16,null));};exports['destroy']=function(_0x21152c,_0x3a4383){return db[_0xfaed('0x2a')]['find']({'where':{'id':_0x21152c[_0xfaed('0x2b')]['id']}})[_0xfaed('0x27')](handleEntityNotFound(_0x3a4383,null))[_0xfaed('0x27')](removeEntity(_0x3a4383,null))['catch'](handleError(_0x3a4383,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 2f20b4c..475a0dc 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 _0x91d3=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util'];(function(_0x3f5639,_0x2861c5){var _0x226cad=function(_0x1b3397){while(--_0x1b3397){_0x3f5639['push'](_0x3f5639['shift']());}};_0x226cad(++_0x2861c5);}(_0x91d3,0x113));var _0x391d=function(_0x5f4c64,_0x31e2ac){_0x5f4c64=_0x5f4c64-0x0;var _0x3da86e=_0x91d3[_0x5f4c64];return _0x3da86e;};'use strict';var _=require('lodash');var util=require(_0x391d('0x0'));var logger=require(_0x391d('0x1'))('api');var moment=require('moment');var BPromise=require(_0x391d('0x2'));var rp=require(_0x391d('0x3'));var fs=require('fs');var path=require(_0x391d('0x4'));var rimraf=require(_0x391d('0x5'));var config=require(_0x391d('0x6'));var attributes=require(_0x391d('0x7'));module[_0x391d('0x8')]=function(_0x16101f,_0x13fe66){return _0x16101f[_0x391d('0x9')](_0x391d('0xa'),attributes,{'tableName':_0x391d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6a3=['request-promise','path','../../config/environment','./action.attributes','exports','Action','lodash','util','../../config/logger','api'];(function(_0x9a79e7,_0x427dbd){var _0x9516b2=function(_0x1c396f){while(--_0x1c396f){_0x9a79e7['push'](_0x9a79e7['shift']());}};_0x9516b2(++_0x427dbd);}(_0xe6a3,0x11e));var _0x3e6a=function(_0x5a1a51,_0x144c79){_0x5a1a51=_0x5a1a51-0x0;var _0x47edd7=_0xe6a3[_0x5a1a51];return _0x47edd7;};'use strict';var _=require(_0x3e6a('0x0'));var util=require(_0x3e6a('0x1'));var logger=require(_0x3e6a('0x2'))(_0x3e6a('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x3e6a('0x4'));var fs=require('fs');var path=require(_0x3e6a('0x5'));var rimraf=require('rimraf');var config=require(_0x3e6a('0x6'));var attributes=require(_0x3e6a('0x7'));module[_0x3e6a('0x8')]=function(_0x511667,_0x28bb64){return _0x511667['define'](_0x3e6a('0x9'),attributes,{'tableName':'tools_actions','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 6c2c7b9..8c3a515 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0x814b,0x1a2));var _0xb814=function(_0x4e9d3c,_0x1f4b98){_0x4e9d3c=_0x4e9d3c-0x0;var _0x2d0825=_0x814b[_0x4e9d3c];return _0x2d0825;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b0829,_0x2e6272,_0x5c8539){return new BPromise(function(_0x271af9,_0x2913a6){return client[_0xb814('0xc')](_0x3b0829,_0x5c8539)[_0xb814('0xd')](function(_0x1fea33){logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));logger[_0xb814('0x11')](_0xb814('0x12'),_0x2e6272,_0xb814('0x10'),JSON['stringify'](_0x1fea33));if(_0x1fea33[_0xb814('0x13')]){if(_0x1fea33['error'][_0xb814('0x14')]===0x1f4){logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x2913a6(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}logger[_0xb814('0x13')](_0xb814('0xf'),_0x2e6272,_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);return _0x271af9(_0x1fea33[_0xb814('0x13')][_0xb814('0x15')]);}else{logger[_0xb814('0xe')](_0xb814('0xf'),_0x2e6272,_0xb814('0x10'));_0x271af9(_0x1fea33[_0xb814('0x16')][_0xb814('0x15')]);}})[_0xb814('0x17')](function(_0x21b73f){logger[_0xb814('0x13')]('Action,\x20%s,\x20%s',_0x2e6272,_0x21b73f);_0x2913a6(_0x21b73f);});});} \ No newline at end of file +var _0x53ec=['error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','stringify','code'];(function(_0x39c734,_0x2f3e06){var _0xb2a2f9=function(_0x502f3f){while(--_0x502f3f){_0x39c734['push'](_0x39c734['shift']());}};_0xb2a2f9(++_0x2f3e06);}(_0x53ec,0x192));var _0xc53e=function(_0x39304b,_0x30a033){_0x39304b=_0x39304b-0x0;var _0x21160c=_0x53ec[_0x39304b];return _0x21160c;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var moment=require(_0xc53e('0x2'));var BPromise=require(_0xc53e('0x3'));var rs=require(_0xc53e('0x4'));var fs=require('fs');var Redis=require(_0xc53e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc53e('0x6'));var logger=require('../../config/logger')(_0xc53e('0x7'));var config=require(_0xc53e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc53e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a9e8,_0x2de88b,_0x5d3b28){return new BPromise(function(_0x1616ac,_0x1ac6c0){return client[_0xc53e('0xa')](_0x41a9e8,_0x5d3b28)[_0xc53e('0xb')](function(_0xd9612){logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));logger[_0xc53e('0xf')]('Action,\x20%s,\x20%s,\x20%s',_0x2de88b,'request\x20sent',JSON[_0xc53e('0x10')](_0xd9612));if(_0xd9612['error']){if(_0xd9612['error'][_0xc53e('0x11')]===0x1f4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')]['message']);return _0x1ac6c0(_0xd9612['error'][_0xc53e('0x13')]);}logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);return _0x1616ac(_0xd9612[_0xc53e('0x12')][_0xc53e('0x13')]);}else{logger[_0xc53e('0xc')](_0xc53e('0xd'),_0x2de88b,_0xc53e('0xe'));_0x1616ac(_0xd9612['result'][_0xc53e('0x13')]);}})[_0xc53e('0x14')](function(_0x535cd4){logger[_0xc53e('0x12')](_0xc53e('0xd'),_0x2de88b,_0x535cd4);_0x1ac6c0(_0x535cd4);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index be3c5ea..248f953 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 _0x5a05=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x14152d,_0x252ee7){var _0x47f6c3=function(_0x446679){while(--_0x446679){_0x14152d['push'](_0x14152d['shift']());}};_0x47f6c3(++_0x252ee7);}(_0x5a05,0x1a3));var _0x55a0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5a05[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x55a0('0x0'));var util=require(_0x55a0('0x1'));var path=require(_0x55a0('0x2'));var timeout=require(_0x55a0('0x3'));var express=require(_0x55a0('0x4'));var router=express[_0x55a0('0x5')]();var fs_extra=require(_0x55a0('0x6'));var auth=require(_0x55a0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x55a0('0x8'));var controller=require(_0x55a0('0x9'));router[_0x55a0('0xa')](_0x55a0('0xb'),auth[_0x55a0('0xc')](),controller['update']);router[_0x55a0('0xd')]('/:id',auth[_0x55a0('0xc')](),controller[_0x55a0('0xe')]);module[_0x55a0('0xf')]=router; \ No newline at end of file +var _0x4b44=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./action.controller','isAuthenticated','delete','/:id','destroy','exports','multer','util'];(function(_0x119b96,_0x587acd){var _0x516cbf=function(_0x5d4b36){while(--_0x5d4b36){_0x119b96['push'](_0x119b96['shift']());}};_0x516cbf(++_0x587acd);}(_0x4b44,0x1cc));var _0x44b4=function(_0x57c789,_0x1a1755){_0x57c789=_0x57c789-0x0;var _0x348157=_0x4b44[_0x57c789];return _0x348157;};'use strict';var multer=require(_0x44b4('0x0'));var util=require(_0x44b4('0x1'));var path=require('path');var timeout=require(_0x44b4('0x2'));var express=require(_0x44b4('0x3'));var router=express[_0x44b4('0x4')]();var fs_extra=require(_0x44b4('0x5'));var auth=require(_0x44b4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x44b4('0x7'));var controller=require(_0x44b4('0x8'));router['put']('/:id',auth[_0x44b4('0x9')](),controller['update']);router[_0x44b4('0xa')](_0x44b4('0xb'),auth[_0x44b4('0x9')](),controller[_0x44b4('0xc')]);module[_0x44b4('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 24ec2c9..465b695 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 _0x7c09=['exports','STRING','TEXT'];(function(_0x3f7e9f,_0x5d8b0a){var _0x32236b=function(_0x13dca4){while(--_0x13dca4){_0x3f7e9f['push'](_0x3f7e9f['shift']());}};_0x32236b(++_0x5d8b0a);}(_0x7c09,0x102));var _0x97c0=function(_0x553dd8,_0x105301){_0x553dd8=_0x553dd8-0x0;var _0x348035=_0x7c09[_0x553dd8];return _0x348035;};'use strict';var Sequelize=require('sequelize');module[_0x97c0('0x0')]={'name':{'type':Sequelize[_0x97c0('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x97c0('0x1')]},'table':{'type':Sequelize[_0x97c0('0x1')]},'conditions':{'type':Sequelize[_0x97c0('0x2')]},'joins':{'type':Sequelize[_0x97c0('0x2')]}}; \ No newline at end of file +var _0xb4c7=['STRING','TEXT','sequelize','exports'];(function(_0x4b3e49,_0x9e566c){var _0x57e339=function(_0x1430e9){while(--_0x1430e9){_0x4b3e49['push'](_0x4b3e49['shift']());}};_0x57e339(++_0x9e566c);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x36757d,_0x3ed0a8){_0x36757d=_0x36757d-0x0;var _0x426b80=_0xb4c7[_0x36757d];return _0x426b80;};'use strict';var Sequelize=require(_0x7b4c('0x0'));module[_0x7b4c('0x1')]={'name':{'type':Sequelize[_0x7b4c('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x7b4c('0x2')]},'parent':{'type':Sequelize[_0x7b4c('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7b4c('0x3')]},'joins':{'type':Sequelize[_0x7b4c('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index a13557c..2509c7d 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 _0x7dbb=['findAll','rows','catch','show','params','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','autoAssociation','error','preview','join','left_join','right_join','cross_join','COUNT(%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','MIN(%s)','HOUR(%s)','ROUND(%s)','value','order','alias','web','fullPath','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','SELECT','run','runReport','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','CustomReports','UserProfileResource','then','sendStatus','stack','name','index','map','AnalyticCustomReport','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x1550ee,_0x475605){var _0x2faee8=function(_0x38dbea){while(--_0x38dbea){_0x1550ee['push'](_0x1550ee['shift']());}};_0x2faee8(++_0x475605);}(_0x7dbb,0x1ac));var _0xb7db=function(_0x2a1034,_0x1076d2){_0x2a1034=_0x2a1034-0x0;var _0x2afdf9=_0x7dbb[_0x2a1034];return _0x2afdf9;};'use strict';var emlformat=require(_0xb7db('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb7db('0x1'));var jsonpatch=require(_0xb7db('0x2'));var rp=require(_0xb7db('0x3'));var moment=require(_0xb7db('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb7db('0x5'));var util=require(_0xb7db('0x6'));var path=require(_0xb7db('0x7'));var sox=require('sox');var csv=require(_0xb7db('0x8'));var ejs=require(_0xb7db('0x9'));var fs=require('fs');var fs_extra=require(_0xb7db('0xa'));var _=require(_0xb7db('0xb'));var squel=require('squel');var crypto=require(_0xb7db('0xc'));var jsforce=require(_0xb7db('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb7db('0x8'));var querystring=require(_0xb7db('0xe'));var Papa=require(_0xb7db('0xf'));var Redis=require(_0xb7db('0x10'));var authService=require(_0xb7db('0x11'));var qs=require(_0xb7db('0x12'));var as=require(_0xb7db('0x13'));var hardwareService=require(_0xb7db('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb7db('0x15'));var licenseUtil=require(_0xb7db('0x16'));var db=require(_0xb7db('0x17'))['db'];var dbH=require(_0xb7db('0x17'))[_0xb7db('0x18')];function respondWithStatusCode(_0x130e94,_0x16d848){_0x16d848=_0x16d848||0xcc;return function(_0x1b8902){if(_0x1b8902){return _0x130e94['sendStatus'](_0x16d848);}return _0x130e94[_0xb7db('0x19')](_0x16d848)[_0xb7db('0x1a')]();};}function respondWithResult(_0x2da35c,_0x542493){_0x542493=_0x542493||0xc8;return function(_0x2e0ba5){if(_0x2e0ba5){return _0x2da35c[_0xb7db('0x19')](_0x542493)[_0xb7db('0x1b')](_0x2e0ba5);}};}function respondWithFilteredResult(_0x299a29,_0x3f8a2e){return function(_0x2b233d){if(_0x2b233d){var _0x474839=typeof _0x3f8a2e[_0xb7db('0x1c')]===_0xb7db('0x1d')&&typeof _0x3f8a2e[_0xb7db('0x1e')]===_0xb7db('0x1d');var _0x2e6deb=_0x2b233d['count'];var _0x2717eb=_0x474839?0x0:_0x3f8a2e[_0xb7db('0x1c')];var _0x2af235=_0x474839?_0x2b233d[_0xb7db('0x1f')]:_0x3f8a2e['offset']+_0x3f8a2e[_0xb7db('0x1e')];var _0x5c47bb;if(_0x2af235>=_0x2e6deb){_0x2af235=_0x2e6deb;_0x5c47bb=0xc8;}else{_0x5c47bb=0xce;}_0x299a29['status'](_0x5c47bb);return _0x299a29[_0xb7db('0x20')](_0xb7db('0x21'),_0x2717eb+'-'+_0x2af235+'/'+_0x2e6deb)['json'](_0x2b233d);}return null;};}function patchUpdates(_0x397ffe){return function(_0x3be73f){try{jsonpatch[_0xb7db('0x22')](_0x3be73f,_0x397ffe,!![]);}catch(_0x566579){return BPromise['reject'](_0x566579);}return _0x3be73f[_0xb7db('0x23')]();};}function saveUpdates(_0x183d01,_0x177860){return function(_0x3c54f7){if(_0x3c54f7){return _0x3c54f7[_0xb7db('0x24')](_0x183d01)['then'](function(_0x286778){return _0x286778;});}return null;};}function removeEntity(_0x84ad76,_0x57a2f0){return function(_0x3af32d){if(_0x3af32d){return _0x3af32d[_0xb7db('0x25')]()['then'](function(){var _0x465e19=_0x3af32d['get']({'plain':!![]});var _0x157998=_0xb7db('0x26');return db[_0xb7db('0x27')][_0xb7db('0x25')]({'where':{'type':_0x157998,'resourceId':_0x465e19['id']}})['then'](function(){return _0x3af32d;});})[_0xb7db('0x28')](function(){_0x84ad76['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a661b,_0x13022a){return function(_0x346fa){if(!_0x346fa){_0x2a661b[_0xb7db('0x29')](0x194);}return _0x346fa;};}function handleError(_0x21dc11,_0xdd1c53){_0xdd1c53=_0xdd1c53||0x1f4;return function(_0x1a4798){logger['error'](_0x1a4798[_0xb7db('0x2a')]);if(_0x1a4798[_0xb7db('0x2b')]){delete _0x1a4798['name'];}_0x21dc11[_0xb7db('0x19')](_0xdd1c53)['send'](_0x1a4798);};}exports[_0xb7db('0x2c')]=function(_0xd2aa5e,_0x36691f){var _0x25b1b3={},_0x541cea={},_0x2a7734={'count':0x0,'rows':[]};var _0x163326=_[_0xb7db('0x2d')](db[_0xb7db('0x2e')][_0xb7db('0x2f')],function(_0x2fd48d){return{'name':_0x2fd48d['fieldName'],'type':_0x2fd48d[_0xb7db('0x30')][_0xb7db('0x31')]};});_0x541cea['model']=_[_0xb7db('0x2d')](_0x163326,_0xb7db('0x2b'));_0x541cea[_0xb7db('0x32')]=_[_0xb7db('0x33')](_0xd2aa5e[_0xb7db('0x32')]);_0x541cea[_0xb7db('0x34')]=_[_0xb7db('0x35')](_0x541cea[_0xb7db('0x36')],_0x541cea[_0xb7db('0x32')]);_0x25b1b3['attributes']=_['intersection'](_0x541cea[_0xb7db('0x36')],qs[_0xb7db('0x37')](_0xd2aa5e['query'][_0xb7db('0x37')]));_0x25b1b3[_0xb7db('0x38')]=_0x25b1b3[_0xb7db('0x38')]['length']?_0x25b1b3[_0xb7db('0x38')]:_0x541cea[_0xb7db('0x36')];if(!_0xd2aa5e[_0xb7db('0x32')]['hasOwnProperty'](_0xb7db('0x39'))){_0x25b1b3[_0xb7db('0x1e')]=qs['limit'](_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x1e')]);_0x25b1b3[_0xb7db('0x1c')]=qs['offset'](_0xd2aa5e[_0xb7db('0x32')]['offset']);}_0x25b1b3['order']=qs[_0xb7db('0x3a')](_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x3a')]);_0x25b1b3[_0xb7db('0x3b')]=qs[_0xb7db('0x34')](_[_0xb7db('0x3c')](_0xd2aa5e[_0xb7db('0x32')],_0x541cea[_0xb7db('0x34')]),_0x163326);if(_0xd2aa5e['query'][_0xb7db('0x3d')]){_0x25b1b3['where']=_[_0xb7db('0x3e')](_0x25b1b3[_0xb7db('0x3b')],{'$or':_[_0xb7db('0x2d')](_0x163326,function(_0xbad4f9){if(_0xbad4f9[_0xb7db('0x30')]!==_0xb7db('0x3f')){var _0x39fe80={};_0x39fe80[_0xbad4f9[_0xb7db('0x2b')]]={'$like':'%'+_0xd2aa5e['query'][_0xb7db('0x3d')]+'%'};return _0x39fe80;}})});}_0x25b1b3=_['merge']({},_0x25b1b3,_0xd2aa5e[_0xb7db('0x40')]);var _0x50b048={'where':_0x25b1b3[_0xb7db('0x3b')]};return db['AnalyticCustomReport']['count'](_0x50b048)['then'](function(_0x126d9c){_0x2a7734['count']=_0x126d9c;if(_0xd2aa5e[_0xb7db('0x32')][_0xb7db('0x41')]){_0x25b1b3[_0xb7db('0x42')]=[{'all':!![]}];}return db[_0xb7db('0x2e')][_0xb7db('0x43')](_0x25b1b3);})[_0xb7db('0x28')](function(_0x34bd40){_0x2a7734[_0xb7db('0x44')]=_0x34bd40;return _0x2a7734;})[_0xb7db('0x28')](respondWithFilteredResult(_0x36691f,_0x25b1b3))[_0xb7db('0x45')](handleError(_0x36691f,null));};exports[_0xb7db('0x46')]=function(_0x958ed6,_0x163716){var _0x291e01={'raw':![],'where':{'id':_0x958ed6[_0xb7db('0x47')]['id']}},_0x1e9fcd={};_0x1e9fcd['model']=_[_0xb7db('0x33')](db[_0xb7db('0x2e')][_0xb7db('0x2f')]);_0x1e9fcd['query']=_['keys'](_0x958ed6[_0xb7db('0x32')]);_0x1e9fcd[_0xb7db('0x34')]=_['intersection'](_0x1e9fcd[_0xb7db('0x36')],_0x1e9fcd[_0xb7db('0x32')]);_0x291e01[_0xb7db('0x38')]=_[_0xb7db('0x35')](_0x1e9fcd['model'],qs[_0xb7db('0x37')](_0x958ed6[_0xb7db('0x32')][_0xb7db('0x37')]));_0x291e01[_0xb7db('0x38')]=_0x291e01[_0xb7db('0x38')][_0xb7db('0x48')]?_0x291e01[_0xb7db('0x38')]:_0x1e9fcd[_0xb7db('0x36')];if(_0x958ed6[_0xb7db('0x32')]['includeAll']){_0x291e01[_0xb7db('0x42')]=[{'all':!![]}];}_0x291e01=_[_0xb7db('0x3e')]({},_0x291e01,_0x958ed6[_0xb7db('0x40')]);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x291e01)['then'](handleEntityNotFound(_0x163716,null))[_0xb7db('0x28')](respondWithResult(_0x163716,null))[_0xb7db('0x45')](handleError(_0x163716,null));};exports[_0xb7db('0x4a')]=function(_0x5c0d0a,_0x3ee52b){return db['AnalyticCustomReport'][_0xb7db('0x4a')](_0x5c0d0a[_0xb7db('0x4b')],{})[_0xb7db('0x28')](function(_0x5356a7){var _0x4754cd=_0x5c0d0a['user'][_0xb7db('0x4c')]({'plain':!![]});if(!_0x4754cd)throw new Error(_0xb7db('0x4d'));if(_0x4754cd[_0xb7db('0x4e')]===_0xb7db('0x4f')){var _0xc21a47=_0x5356a7[_0xb7db('0x4c')]({'plain':!![]});var _0x859064=_0xb7db('0x50');return db['UserProfileSection'][_0xb7db('0x49')]({'where':{'name':_0x859064,'userProfileId':_0x4754cd['userProfileId']},'raw':!![]})[_0xb7db('0x28')](function(_0x507a70){if(_0x507a70&&_0x507a70[_0xb7db('0x51')]===0x0){return db['UserProfileResource'][_0xb7db('0x4a')]({'name':_0xc21a47[_0xb7db('0x2b')],'resourceId':_0xc21a47['id'],'type':'CustomReports','sectionId':_0x507a70['id']},{})['then'](function(){return _0x5356a7;});}else{return _0x5356a7;}})[_0xb7db('0x45')](function(_0x1b5a8a){logger[_0xb7db('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1b5a8a);throw _0x1b5a8a;});}return _0x5356a7;})[_0xb7db('0x28')](respondWithResult(_0x3ee52b,0xc9))['catch'](handleError(_0x3ee52b,null));};exports['update']=function(_0x359550,_0x268760){if(_0x359550['body']['id']){delete _0x359550[_0xb7db('0x4b')]['id'];}return db['AnalyticCustomReport'][_0xb7db('0x49')]({'where':{'id':_0x359550[_0xb7db('0x47')]['id']}})['then'](handleEntityNotFound(_0x268760,null))[_0xb7db('0x28')](saveUpdates(_0x359550[_0xb7db('0x4b')],null))[_0xb7db('0x28')](respondWithResult(_0x268760,null))[_0xb7db('0x45')](handleError(_0x268760,null));};exports[_0xb7db('0x25')]=function(_0x50e828,_0x38e441){return db[_0xb7db('0x2e')][_0xb7db('0x49')]({'where':{'id':_0x50e828[_0xb7db('0x47')]['id']}})['then'](handleEntityNotFound(_0x38e441,null))[_0xb7db('0x28')](removeEntity(_0x38e441,null))['catch'](handleError(_0x38e441,null));};exports[_0xb7db('0x53')]=function(_0x2c6d6e,_0x15baf4){var _0x74e133=0xa;var _0x56aa41=[_0xb7db('0x54'),_0xb7db('0x55'),_0xb7db('0x56'),_0xb7db('0x57')];var _0x11fe23={'SUM':'SUM(%s)','COUNT':_0xb7db('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb7db('0x59'),'MIN':'MIN(%s)','AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':_0xb7db('0x5c'),'GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x4b2cde={'SEC_TO_TIME':_0xb7db('0x5e'),'DATE':_0xb7db('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xb7db('0x60')};var _0x1a4e1a=function(_0x5defd9){return!_[_0xb7db('0x61')]([_0xb7db('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb7db('0x63')],_0x5defd9);};var _0x256557=function(_0xddfd5e){if(!_0xddfd5e||!_0xddfd5e['rules'][_0xb7db('0x48')]){return'';}for(var _0x1dcb12='(',_0x29e52f=0x0;_0x29e52f<_0xddfd5e[_0xb7db('0x64')][_0xb7db('0x48')];_0x29e52f+=0x1){_0x29e52f>0x0&&(_0x1dcb12+='\x20'+_0xddfd5e[_0xb7db('0x65')]+'\x20');_0x1dcb12+=_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x66')]?_0x256557(_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x66')]):_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x67')]+'\x20'+_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x68')]+(_0x1a4e1a(_0xddfd5e[_0xb7db('0x64')][_0x29e52f][_0xb7db('0x68')])?'\x20'+_0xddfd5e['rules'][_0x29e52f]['value']:'');}return _0x1dcb12+')';};var _0x22c998={'where':{'id':_0x2c6d6e[_0xb7db('0x47')]['id']}},_0x22ab0b,_0x26e97b,_0x4742a0,_0x3b09bd,_0x2fe519;_0x22c998=_[_0xb7db('0x3e')]({},_0x22c998,_0x2c6d6e[_0xb7db('0x40')]);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x22c998)[_0xb7db('0x28')](function(_0x2738ac){if(_0x2738ac){_0x22ab0b=_0x2738ac;return _0x2738ac[_0xb7db('0x69')]();}return null;})['then'](function(_0x586416){if(_0x586416){if(!_0x586416[_0xb7db('0x48')]){throw new db[(_0xb7db('0x6a'))][(_0xb7db('0x6b'))](_0xb7db('0x6c'),0x193);}_0x26e97b=_0x586416;return db[_0xb7db('0x6d')][_0xb7db('0x43')]({'raw':!![]});}return null;})[_0xb7db('0x28')](function(_0xf98bfb){if(_0xf98bfb){_0x4742a0=_[_0xb7db('0x6e')](_0xf98bfb,'id');var _0x1a202e;var _0x1aed69=squel[_0xb7db('0x6f')]();_0x1aed69[_0xb7db('0x70')](_0x22ab0b[_0xb7db('0x71')]);for(var _0xb09e1a=0x0;_0xb09e1a<_0x26e97b[_0xb7db('0x48')];_0xb09e1a+=0x1){_0x1a202e=_0x26e97b[_0xb09e1a]['MetricId']?_0x4742a0[_0x26e97b[_0xb09e1a][_0xb7db('0x72')]][_0xb7db('0x73')]:_0x26e97b[_0xb09e1a][_0xb7db('0x67')];_0x1a202e=_0x26e97b[_0xb09e1a][_0xb7db('0x74')]?_[_0xb7db('0x75')](_0x11fe23[_0x26e97b[_0xb09e1a][_0xb7db('0x74')]],'%s',_0x1a202e):_0x1a202e;_0x1a202e=_0x26e97b[_0xb09e1a][_0xb7db('0x76')]?_[_0xb7db('0x75')](_0x4b2cde[_0x26e97b[_0xb09e1a][_0xb7db('0x76')]],'%s',_0x1a202e):_0x1a202e;if(_0x26e97b[_0xb09e1a][_0xb7db('0x77')]){_0x1aed69[_0xb7db('0x66')](_0x1a202e);}_0x26e97b[_0xb09e1a][_0xb7db('0x78')]&&_0x1aed69['order'](_0x1a202e,_0x26e97b[_0xb09e1a][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x1aed69[_0xb7db('0x67')](_0x1a202e,_0x26e97b[_0xb09e1a]['alias']||_0x1a202e);}if(_0x22ab0b['joins']){_0x22ab0b[_0xb7db('0x7a')]=JSON[_0xb7db('0x7b')](_0x22ab0b[_0xb7db('0x7a')]);for(var _0x84bfc7=0x0;_0x84bfc7<_0x22ab0b[_0xb7db('0x7a')][_0xb7db('0x48')];_0x84bfc7+=0x1){if(_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x30')]&&_[_0xb7db('0x61')](_0x56aa41,_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x30')])&&_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7c')]&&_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7d')]&&_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7e')]){_0x1aed69[_0x22ab0b['joins'][_0x84bfc7]['type']](_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x22ab0b[_0xb7db('0x71')],_0x22ab0b['joins'][_0x84bfc7][_0xb7db('0x7c')],_0x22ab0b[_0xb7db('0x7a')][_0x84bfc7][_0xb7db('0x7d')],_0x22ab0b['joins'][_0x84bfc7]['foreignKey']));}}}if(_0x22ab0b['conditions']){_0x22ab0b[_0xb7db('0x80')]=JSON[_0xb7db('0x7b')](_0x22ab0b[_0xb7db('0x80')]);_0x1aed69[_0xb7db('0x3b')](_0x256557(_0x22ab0b[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x2fe519=_0x1aed69[_0xb7db('0x81')]();_0x1aed69[_0xb7db('0x1e')](_0x74e133);_0x1aed69[_0xb7db('0x1c')](0x0);logger[_0xb7db('0x82')](_0xb7db('0x83'),_0x1aed69[_0xb7db('0x84')]());return dbH['sequelize'][_0xb7db('0x32')](_0x1aed69[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')]['SELECT']});}})[_0xb7db('0x28')](respondWithResult(_0x15baf4,null))[_0xb7db('0x45')](handleError(_0x15baf4,null));};function runReport(_0x328b54,_0x20e038,_0xe7828d){var _0x1b8cb3=_0x20e038[_0xb7db('0x2b')];var _0x419e7d=0xa;var _0x5ca584=[_0xb7db('0x54'),_0xb7db('0x55'),_0xb7db('0x56'),_0xb7db('0x57')];var _0x19dcc3={'SUM':_0xb7db('0x87'),'COUNT':_0xb7db('0x58'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb7db('0x59'),'MIN':_0xb7db('0x88'),'AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x5138b4={'SEC_TO_TIME':_0xb7db('0x5e'),'DATE':'DATE(%s)','HOUR':_0xb7db('0x89'),'ROUND':_0xb7db('0x8a'),'UNIX_TIMESTAMP':_0xb7db('0x60')};var _0x56ad55=function(_0x140bfb){return!_['includes']([_0xb7db('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xb7db('0x63')],_0x140bfb);};var _0x198de9=function(_0x33178c){if(!_0x33178c||!_0x33178c[_0xb7db('0x64')]['length']){return'';}for(var _0xaa19e4='(',_0x4d3786=0x0;_0x4d3786<_0x33178c[_0xb7db('0x64')][_0xb7db('0x48')];_0x4d3786+=0x1){_0x4d3786>0x0&&(_0xaa19e4+='\x20'+_0x33178c[_0xb7db('0x65')]+'\x20');_0xaa19e4+=_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x66')]?_0x198de9(_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x66')]):_0x33178c[_0xb7db('0x64')][_0x4d3786][_0xb7db('0x67')]+'\x20'+_0x33178c['rules'][_0x4d3786][_0xb7db('0x68')]+(_0x56ad55(_0x33178c[_0xb7db('0x64')][_0x4d3786]['condition'])?'\x20'+_0x33178c['rules'][_0x4d3786][_0xb7db('0x8b')]:'');}return _0xaa19e4+')';};var _0x3260f2={'where':{'id':_0x328b54['id']}},_0x143217,_0x26f465,_0xa9b976,_0x50b0ae,_0x4d5138;_0x3260f2=_[_0xb7db('0x3e')]({},_0x3260f2,_0xe7828d);return db[_0xb7db('0x2e')][_0xb7db('0x49')](_0x3260f2)[_0xb7db('0x28')](function(_0x5068e9){if(_0x5068e9){_0x143217=_0x5068e9;return _0x5068e9[_0xb7db('0x69')]();}return null;})['then'](function(_0x21945a){if(_0x21945a){if(!_0x21945a['length']){throw new db[(_0xb7db('0x6a'))]['ValidationErrorItem'](_0xb7db('0x6c'),0x193);}_0x26f465=_0x21945a;return db['AnalyticMetric'][_0xb7db('0x43')]({'raw':!![]});}return null;})[_0xb7db('0x28')](function(_0x37808e){if(_0x37808e){_0xa9b976=_['keyBy'](_0x37808e,'id');var _0x22f27b;var _0x5bf3eb=squel[_0xb7db('0x6f')]();_0x5bf3eb[_0xb7db('0x70')](_0x143217[_0xb7db('0x71')]);for(var _0xc85814=0x0;_0xc85814<_0x26f465[_0xb7db('0x48')];_0xc85814+=0x1){_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x72')]?_0xa9b976[_0x26f465[_0xc85814][_0xb7db('0x72')]]['metric']:_0x26f465[_0xc85814]['field'];_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x74')]?_['replace'](_0x19dcc3[_0x26f465[_0xc85814][_0xb7db('0x74')]],'%s',_0x22f27b):_0x22f27b;_0x22f27b=_0x26f465[_0xc85814][_0xb7db('0x76')]?_[_0xb7db('0x75')](_0x5138b4[_0x26f465[_0xc85814][_0xb7db('0x76')]],'%s',_0x22f27b):_0x22f27b;if(_0x26f465[_0xc85814][_0xb7db('0x77')]){_0x5bf3eb[_0xb7db('0x66')](_0x22f27b);}_0x26f465[_0xc85814]['orderBy']&&_0x5bf3eb[_0xb7db('0x8c')](_0x22f27b,_0x26f465[_0xc85814][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x5bf3eb['field'](_0x22f27b,_0x26f465[_0xc85814][_0xb7db('0x8d')]||_0x22f27b);}if(_0x143217[_0xb7db('0x7a')]){_0x143217['joins']=JSON[_0xb7db('0x7b')](_0x143217[_0xb7db('0x7a')]);for(var _0x114bb0=0x0;_0x114bb0<_0x143217['joins'][_0xb7db('0x48')];_0x114bb0+=0x1){if(_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x30')]&&_[_0xb7db('0x61')](_0x5ca584,_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x30')])&&_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7c')]&&_0x143217['joins'][_0x114bb0][_0xb7db('0x7d')]&&_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7e')]){_0x5bf3eb[_0x143217[_0xb7db('0x7a')][_0x114bb0]['type']](_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x143217[_0xb7db('0x71')],_0x143217['joins'][_0x114bb0][_0xb7db('0x7c')],_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7d')],_0x143217[_0xb7db('0x7a')][_0x114bb0][_0xb7db('0x7e')]));}}}if(_0x143217[_0xb7db('0x80')]){_0x143217['conditions']=JSON['parse'](_0x143217[_0xb7db('0x80')]);_0x5bf3eb[_0xb7db('0x3b')](_0x198de9(_0x143217[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x4d5138=_0x5bf3eb[_0xb7db('0x81')]();_0x5bf3eb[_0xb7db('0x1e')](_0x419e7d);_0x5bf3eb[_0xb7db('0x1c')](0x0);return;}})[_0xb7db('0x28')](function(){if(_0x20e038['output']===_0xb7db('0x8e')){return null;}var _0x54ef0e=_['merge'](_0x20e038,{'name':_0x20e038[_0xb7db('0x8f')]||_0x20e038[_0xb7db('0x2b')]||_0x143217[_0xb7db('0x2b')],'basename':_0x1b8cb3,'savename':util[_0xb7db('0x76')](_0xb7db('0x90'),_0x20e038[_0xb7db('0x2b')]||_0x143217[_0xb7db('0x2b')],require('randomstring')[_0xb7db('0x91')](0x4),_0x20e038[_0xb7db('0x92')]||_0xb7db('0x93')),'reportId':_0x143217['id'],'reportType':_0xb7db('0x94')});return db[_0xb7db('0x95')][_0xb7db('0x4a')](_0x54ef0e,{'raw':!![]});})['then'](function(_0x37f369){if(_0x143217['table']===_0xb7db('0x96')){_0x4d5138['where'](_0x143217['table']+_0xb7db('0x97'),_0x20e038[_0xb7db('0x98')],_0x20e038[_0xb7db('0x99')]);}else{_0x4d5138[_0xb7db('0x3b')](_0x143217[_0xb7db('0x71')]+_0xb7db('0x9a'),_0x20e038[_0xb7db('0x98')],_0x20e038[_0xb7db('0x99')]);}if(_0x37f369){logger[_0xb7db('0x9b')]('Run\x20Query:',_0x4d5138['toString']());require(_0xb7db('0x9c'))['fork'](path[_0xb7db('0x54')](__dirname,_0xb7db('0x9d'),_0x37f369[_0xb7db('0x92')]),[_0x37f369['id'],_0x4d5138[_0xb7db('0x84')](),path['join'](__dirname,_0xb7db('0x9e'),_0x37f369['savename']),_0x1b8cb3]);return _0x37f369;}else{var _0x1bf7f0=squel[_0xb7db('0x6f')]();_0x1bf7f0[_0xb7db('0x70')]('('+_0x4d5138[_0xb7db('0x84')]()+')','countTable');_0x1bf7f0[_0xb7db('0x67')]('COUNT(*)',_0xb7db('0x1f'));_0x4d5138[_0xb7db('0x1e')](_0x20e038['limit']||_0x419e7d);_0x4d5138['offset'](_0x20e038[_0xb7db('0x1c')]||0x0);return dbH['sequelize'][_0xb7db('0x32')](_0x1bf7f0[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')][_0xb7db('0x9f')]})[_0xb7db('0x28')](function(_0x8ee0a7){if(!_0x8ee0a7[_0xb7db('0x48')]){_0x50b0ae=0x0;}else{_0x50b0ae=_0x8ee0a7[0x0][_0xb7db('0x1f')]||0x0;}return dbH[_0xb7db('0x85')]['query'](_0x4d5138[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')]['SELECT']});})[_0xb7db('0x28')](function(_0x8526ec){return{'rows':_0x8526ec||[],'count':_0x50b0ae};});}});}exports[_0xb7db('0xa0')]=function(_0x259806,_0x1508d7){return runReport(_0x259806[_0xb7db('0x47')],_0x259806[_0xb7db('0x32')],_0x259806[_0xb7db('0x40')])['then'](respondWithResult(_0x1508d7,null))['catch'](handleError(_0x1508d7,null));};exports[_0xb7db('0xa1')]=runReport;exports[_0xb7db('0x32')]=function(_0x154baa,_0x244c78){var _0x499273=0xa;var _0x3e5ba1=['join',_0xb7db('0x55'),'right_join','cross_join'];var _0x1e3310={'SUM':_0xb7db('0x87'),'COUNT':_0xb7db('0x58'),'COUNT DISTINCT':_0xb7db('0xa2'),'MAX':_0xb7db('0x59'),'MIN':_0xb7db('0x88'),'AVG':_0xb7db('0x5a'),'GROUP_CONCAT':_0xb7db('0x5b'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xb7db('0x5d')};var _0x333c25={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xb7db('0x89'),'ROUND':_0xb7db('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xf5cae=function(_0x4cd16b){return!_[_0xb7db('0x61')]([_0xb7db('0x62'),_0xb7db('0xa3'),_0xb7db('0xa4'),'IS\x20NOT\x20EMPTY'],_0x4cd16b);};var _0x3b2a82=function(_0x2bb688){if(!_0x2bb688||!_0x2bb688['rules'][_0xb7db('0x48')]){return'';}for(var _0x30ab84='(',_0x25ae74=0x0;_0x25ae74<_0x2bb688[_0xb7db('0x64')][_0xb7db('0x48')];_0x25ae74+=0x1){_0x25ae74>0x0&&(_0x30ab84+='\x20'+_0x2bb688[_0xb7db('0x65')]+'\x20');_0x30ab84+=_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x66')]?_0x3b2a82(_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x66')]):_0x2bb688[_0xb7db('0x64')][_0x25ae74]['field']+'\x20'+_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x68')]+(_0xf5cae(_0x2bb688['rules'][_0x25ae74][_0xb7db('0x68')])?'\x20'+_0x2bb688[_0xb7db('0x64')][_0x25ae74][_0xb7db('0x8b')]:'');}return _0x30ab84+')';};var _0x58215d={'where':{'id':_0x154baa[_0xb7db('0x47')]['id']}},_0x54f775,_0x157f80,_0x296e4b,_0x140491,_0x4608c6;_0x58215d=_['merge']({},_0x58215d,_0x154baa['options']);return db[_0xb7db('0x2e')]['find'](_0x58215d)['then'](function(_0x32aa7c){if(_0x32aa7c){_0x54f775=_0x32aa7c;return _0x32aa7c[_0xb7db('0x69')]();}return null;})[_0xb7db('0x28')](function(_0x52278a){if(_0x52278a){if(!_0x52278a['length']){throw new db[(_0xb7db('0x6a'))][(_0xb7db('0x6b'))](_0xb7db('0x6c'),0x193);}_0x157f80=_0x52278a;return db[_0xb7db('0x6d')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4260fa){if(_0x4260fa){_0x296e4b=_['keyBy'](_0x4260fa,'id');var _0x199424;var _0x937325=squel[_0xb7db('0x6f')]();_0x937325[_0xb7db('0x70')](_0x54f775[_0xb7db('0x71')]);for(var _0xc18a1c=0x0;_0xc18a1c<_0x157f80['length'];_0xc18a1c+=0x1){_0x199424=_0x157f80[_0xc18a1c]['MetricId']?_0x296e4b[_0x157f80[_0xc18a1c][_0xb7db('0x72')]][_0xb7db('0x73')]:_0x157f80[_0xc18a1c][_0xb7db('0x67')];_0x199424=_0x157f80[_0xc18a1c][_0xb7db('0x74')]?_[_0xb7db('0x75')](_0x1e3310[_0x157f80[_0xc18a1c]['function']],'%s',_0x199424):_0x199424;_0x199424=_0x157f80[_0xc18a1c][_0xb7db('0x76')]?_['replace'](_0x333c25[_0x157f80[_0xc18a1c]['format']],'%s',_0x199424):_0x199424;if(_0x157f80[_0xc18a1c]['groupBy']){_0x937325[_0xb7db('0x66')](_0x199424);}_0x157f80[_0xc18a1c][_0xb7db('0x78')]&&_0x937325[_0xb7db('0x8c')](_0x199424,_0x157f80[_0xc18a1c][_0xb7db('0x78')]===_0xb7db('0x79')?![]:!![]);_0x937325[_0xb7db('0x67')](_0x199424,_0x157f80[_0xc18a1c][_0xb7db('0x8d')]||_0x199424);}if(_0x54f775[_0xb7db('0x7a')]){_0x54f775['joins']=JSON[_0xb7db('0x7b')](_0x54f775[_0xb7db('0x7a')]);for(var _0x55d56=0x0;_0x55d56<_0x54f775['joins'][_0xb7db('0x48')];_0x55d56+=0x1){if(_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x30')]&&_['includes'](_0x3e5ba1,_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x30')])&&_0x54f775['joins'][_0x55d56][_0xb7db('0x7c')]&&_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7d')]&&_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7e')]){_0x937325[_0x54f775['joins'][_0x55d56]['type']](_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7d')],null,util[_0xb7db('0x76')](_0xb7db('0x7f'),_0x54f775[_0xb7db('0x71')],_0x54f775[_0xb7db('0x7a')][_0x55d56][_0xb7db('0x7c')],_0x54f775['joins'][_0x55d56][_0xb7db('0x7d')],_0x54f775[_0xb7db('0x7a')][_0x55d56]['foreignKey']));}}}if(_0x54f775[_0xb7db('0x80')]){_0x54f775[_0xb7db('0x80')]=JSON[_0xb7db('0x7b')](_0x54f775[_0xb7db('0x80')]);_0x937325[_0xb7db('0x3b')](_0x3b2a82(_0x54f775[_0xb7db('0x80')][_0xb7db('0x66')]));}_0x4608c6=_0x937325['clone']();_0x937325['limit'](_0x499273);_0x937325[_0xb7db('0x1c')](0x0);logger['debug'](_0xb7db('0x83'),_0x937325['toString']());return dbH[_0xb7db('0x85')][_0xb7db('0x32')](_0x937325[_0xb7db('0x84')](),{'type':dbH[_0xb7db('0x85')][_0xb7db('0x86')][_0xb7db('0x9f')]});}})[_0xb7db('0x28')](function(){return{'sql':_0x4608c6[_0xb7db('0x84')]()};})['then'](respondWithResult(_0x244c78,null))[_0xb7db('0x45')](handleError(_0x244c78,null));}; \ No newline at end of file +var _0xc422=['sequelize','QueryTypes','SELECT','cross_join','AVG(%s)','ROUND(%s)','Sequelize','metric','DESC','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','child_process','fork','savename','countTable','run','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','UserProfileSection','userProfileId','join','left_join','right_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','replace','function','format','groupBy','orderBy','alias','joins','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','parse','clone','debug','Limited\x20Query:','toString'];(function(_0x3d8502,_0x5b23b4){var _0x2e8073=function(_0x57820e){while(--_0x57820e){_0x3d8502['push'](_0x3d8502['shift']());}};_0x2e8073(++_0x5b23b4);}(_0xc422,0x157));var _0x2c42=function(_0x3f6d90,_0x1cf673){_0x3f6d90=_0x3f6d90-0x0;var _0x4981ea=_0xc422[_0x3f6d90];return _0x4981ea;};'use strict';var emlformat=require(_0x2c42('0x0'));var rimraf=require(_0x2c42('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2c42('0x2'));var rp=require(_0x2c42('0x3'));var moment=require(_0x2c42('0x4'));var BPromise=require(_0x2c42('0x5'));var Mustache=require('mustache');var util=require(_0x2c42('0x6'));var path=require(_0x2c42('0x7'));var sox=require('sox');var csv=require(_0x2c42('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c42('0x9'));var _=require(_0x2c42('0xa'));var squel=require(_0x2c42('0xb'));var crypto=require('crypto');var jsforce=require(_0x2c42('0xc'));var deskjs=require(_0x2c42('0xd'));var toCsv=require(_0x2c42('0x8'));var querystring=require(_0x2c42('0xe'));var Papa=require(_0x2c42('0xf'));var Redis=require('ioredis');var authService=require(_0x2c42('0x10'));var qs=require(_0x2c42('0x11'));var as=require(_0x2c42('0x12'));var hardwareService=require(_0x2c42('0x13'));var logger=require('../../config/logger')(_0x2c42('0x14'));var utils=require(_0x2c42('0x15'));var config=require(_0x2c42('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c42('0x17'))['db'];var dbH=require('../../mysqldb')['dbH'];function respondWithStatusCode(_0x5611b3,_0x3a31f5){_0x3a31f5=_0x3a31f5||0xcc;return function(_0x5005d3){if(_0x5005d3){return _0x5611b3[_0x2c42('0x18')](_0x3a31f5);}return _0x5611b3['status'](_0x3a31f5)['end']();};}function respondWithResult(_0x4acbc2,_0x3f8271){_0x3f8271=_0x3f8271||0xc8;return function(_0x38c0a6){if(_0x38c0a6){return _0x4acbc2[_0x2c42('0x19')](_0x3f8271)[_0x2c42('0x1a')](_0x38c0a6);}};}function respondWithFilteredResult(_0x412c35,_0x37a854){return function(_0x113af5){if(_0x113af5){var _0x895138=typeof _0x37a854[_0x2c42('0x1b')]==='undefined'&&typeof _0x37a854['limit']===_0x2c42('0x1c');var _0x3383f9=_0x113af5[_0x2c42('0x1d')];var _0x5583ec=_0x895138?0x0:_0x37a854[_0x2c42('0x1b')];var _0x5f1cea=_0x895138?_0x113af5[_0x2c42('0x1d')]:_0x37a854[_0x2c42('0x1b')]+_0x37a854[_0x2c42('0x1e')];var _0x12f1e4;if(_0x5f1cea>=_0x3383f9){_0x5f1cea=_0x3383f9;_0x12f1e4=0xc8;}else{_0x12f1e4=0xce;}_0x412c35[_0x2c42('0x19')](_0x12f1e4);return _0x412c35[_0x2c42('0x1f')]('Content-Range',_0x5583ec+'-'+_0x5f1cea+'/'+_0x3383f9)['json'](_0x113af5);}return null;};}function patchUpdates(_0x446be){return function(_0x2c43ba){try{jsonpatch[_0x2c42('0x20')](_0x2c43ba,_0x446be,!![]);}catch(_0x5d9b19){return BPromise['reject'](_0x5d9b19);}return _0x2c43ba[_0x2c42('0x21')]();};}function saveUpdates(_0x16a64f,_0x138e6b){return function(_0xa3ce8b){if(_0xa3ce8b){return _0xa3ce8b[_0x2c42('0x22')](_0x16a64f)[_0x2c42('0x23')](function(_0x2c9d36){return _0x2c9d36;});}return null;};}function removeEntity(_0x5bb0b9,_0x141be8){return function(_0x280b3c){if(_0x280b3c){return _0x280b3c[_0x2c42('0x24')]()[_0x2c42('0x23')](function(){var _0x361c48=_0x280b3c[_0x2c42('0x25')]({'plain':!![]});var _0x6b041d=_0x2c42('0x26');return db[_0x2c42('0x27')][_0x2c42('0x24')]({'where':{'type':_0x6b041d,'resourceId':_0x361c48['id']}})[_0x2c42('0x23')](function(){return _0x280b3c;});})[_0x2c42('0x23')](function(){_0x5bb0b9[_0x2c42('0x19')](0xcc)[_0x2c42('0x28')]();});}};}function handleEntityNotFound(_0x29129a,_0x189993){return function(_0x138652){if(!_0x138652){_0x29129a['sendStatus'](0x194);}return _0x138652;};}function handleError(_0x47d1e1,_0x3666e1){_0x3666e1=_0x3666e1||0x1f4;return function(_0x1bee66){logger[_0x2c42('0x29')](_0x1bee66[_0x2c42('0x2a')]);if(_0x1bee66[_0x2c42('0x2b')]){delete _0x1bee66[_0x2c42('0x2b')];}_0x47d1e1[_0x2c42('0x19')](_0x3666e1)[_0x2c42('0x2c')](_0x1bee66);};}exports[_0x2c42('0x2d')]=function(_0x3f65a7,_0x38e966){var _0x59c1b5={},_0x2d047c={},_0x510edf={'count':0x0,'rows':[]};var _0x462d19=_[_0x2c42('0x2e')](db[_0x2c42('0x2f')][_0x2c42('0x30')],function(_0x3d572d){return{'name':_0x3d572d[_0x2c42('0x31')],'type':_0x3d572d[_0x2c42('0x32')][_0x2c42('0x33')]};});_0x2d047c[_0x2c42('0x34')]=_[_0x2c42('0x2e')](_0x462d19,_0x2c42('0x2b'));_0x2d047c[_0x2c42('0x35')]=_[_0x2c42('0x36')](_0x3f65a7['query']);_0x2d047c[_0x2c42('0x37')]=_[_0x2c42('0x38')](_0x2d047c[_0x2c42('0x34')],_0x2d047c[_0x2c42('0x35')]);_0x59c1b5['attributes']=_[_0x2c42('0x38')](_0x2d047c[_0x2c42('0x34')],qs['fields'](_0x3f65a7['query'][_0x2c42('0x39')]));_0x59c1b5['attributes']=_0x59c1b5[_0x2c42('0x3a')][_0x2c42('0x3b')]?_0x59c1b5[_0x2c42('0x3a')]:_0x2d047c[_0x2c42('0x34')];if(!_0x3f65a7[_0x2c42('0x35')]['hasOwnProperty'](_0x2c42('0x3c'))){_0x59c1b5[_0x2c42('0x1e')]=qs[_0x2c42('0x1e')](_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x1e')]);_0x59c1b5['offset']=qs[_0x2c42('0x1b')](_0x3f65a7[_0x2c42('0x35')]['offset']);}_0x59c1b5[_0x2c42('0x3d')]=qs[_0x2c42('0x3e')](_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x3e')]);_0x59c1b5[_0x2c42('0x3f')]=qs[_0x2c42('0x37')](_[_0x2c42('0x40')](_0x3f65a7[_0x2c42('0x35')],_0x2d047c[_0x2c42('0x37')]),_0x462d19);if(_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x41')]){_0x59c1b5[_0x2c42('0x3f')]=_[_0x2c42('0x42')](_0x59c1b5[_0x2c42('0x3f')],{'$or':_[_0x2c42('0x2e')](_0x462d19,function(_0x5891d5){if(_0x5891d5[_0x2c42('0x32')]!=='VIRTUAL'){var _0x3726df={};_0x3726df[_0x5891d5['name']]={'$like':'%'+_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x41')]+'%'};return _0x3726df;}})});}_0x59c1b5=_[_0x2c42('0x42')]({},_0x59c1b5,_0x3f65a7[_0x2c42('0x43')]);var _0xd6533a={'where':_0x59c1b5['where']};return db[_0x2c42('0x2f')]['count'](_0xd6533a)[_0x2c42('0x23')](function(_0x2ee8aa){_0x510edf[_0x2c42('0x1d')]=_0x2ee8aa;if(_0x3f65a7[_0x2c42('0x35')][_0x2c42('0x44')]){_0x59c1b5[_0x2c42('0x45')]=[{'all':!![]}];}return db[_0x2c42('0x2f')][_0x2c42('0x46')](_0x59c1b5);})[_0x2c42('0x23')](function(_0x342571){_0x510edf['rows']=_0x342571;return _0x510edf;})[_0x2c42('0x23')](respondWithFilteredResult(_0x38e966,_0x59c1b5))[_0x2c42('0x47')](handleError(_0x38e966,null));};exports['show']=function(_0x54540e,_0x302aa1){var _0x40cf84={'raw':![],'where':{'id':_0x54540e[_0x2c42('0x48')]['id']}},_0x3128e0={};_0x3128e0[_0x2c42('0x34')]=_[_0x2c42('0x36')](db[_0x2c42('0x2f')]['rawAttributes']);_0x3128e0[_0x2c42('0x35')]=_['keys'](_0x54540e[_0x2c42('0x35')]);_0x3128e0[_0x2c42('0x37')]=_[_0x2c42('0x38')](_0x3128e0[_0x2c42('0x34')],_0x3128e0[_0x2c42('0x35')]);_0x40cf84[_0x2c42('0x3a')]=_[_0x2c42('0x38')](_0x3128e0['model'],qs[_0x2c42('0x39')](_0x54540e[_0x2c42('0x35')][_0x2c42('0x39')]));_0x40cf84[_0x2c42('0x3a')]=_0x40cf84[_0x2c42('0x3a')][_0x2c42('0x3b')]?_0x40cf84['attributes']:_0x3128e0[_0x2c42('0x34')];if(_0x54540e['query'][_0x2c42('0x44')]){_0x40cf84[_0x2c42('0x45')]=[{'all':!![]}];}_0x40cf84=_[_0x2c42('0x42')]({},_0x40cf84,_0x54540e[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x40cf84)[_0x2c42('0x23')](handleEntityNotFound(_0x302aa1,null))[_0x2c42('0x23')](respondWithResult(_0x302aa1,null))['catch'](handleError(_0x302aa1,null));};exports[_0x2c42('0x4a')]=function(_0x473abd,_0x38e5a7){return db[_0x2c42('0x2f')][_0x2c42('0x4a')](_0x473abd[_0x2c42('0x4b')],{})[_0x2c42('0x23')](function(_0x1d09a5){var _0x1e25f6=_0x473abd[_0x2c42('0x4c')]['get']({'plain':!![]});if(!_0x1e25f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1e25f6['role']===_0x2c42('0x4c')){var _0x338182=_0x1d09a5[_0x2c42('0x25')]({'plain':!![]});var _0x53c12e='Reports';return db[_0x2c42('0x4d')][_0x2c42('0x49')]({'where':{'name':_0x53c12e,'userProfileId':_0x1e25f6[_0x2c42('0x4e')]},'raw':!![]})[_0x2c42('0x23')](function(_0x2b4f3a){if(_0x2b4f3a&&_0x2b4f3a['autoAssociation']===0x0){return db[_0x2c42('0x27')][_0x2c42('0x4a')]({'name':_0x338182['name'],'resourceId':_0x338182['id'],'type':_0x2c42('0x26'),'sectionId':_0x2b4f3a['id']},{})['then'](function(){return _0x1d09a5;});}else{return _0x1d09a5;}})[_0x2c42('0x47')](function(_0x5186e8){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5186e8);throw _0x5186e8;});}return _0x1d09a5;})[_0x2c42('0x23')](respondWithResult(_0x38e5a7,0xc9))[_0x2c42('0x47')](handleError(_0x38e5a7,null));};exports['update']=function(_0x1b5137,_0x14d31c){if(_0x1b5137[_0x2c42('0x4b')]['id']){delete _0x1b5137['body']['id'];}return db[_0x2c42('0x2f')][_0x2c42('0x49')]({'where':{'id':_0x1b5137[_0x2c42('0x48')]['id']}})[_0x2c42('0x23')](handleEntityNotFound(_0x14d31c,null))[_0x2c42('0x23')](saveUpdates(_0x1b5137[_0x2c42('0x4b')],null))[_0x2c42('0x23')](respondWithResult(_0x14d31c,null))['catch'](handleError(_0x14d31c,null));};exports[_0x2c42('0x24')]=function(_0x15574f,_0x25a5b4){return db['AnalyticCustomReport'][_0x2c42('0x49')]({'where':{'id':_0x15574f['params']['id']}})['then'](handleEntityNotFound(_0x25a5b4,null))[_0x2c42('0x23')](removeEntity(_0x25a5b4,null))[_0x2c42('0x47')](handleError(_0x25a5b4,null));};exports['preview']=function(_0x47b6ef,_0x4564f0){var _0xd7a844=0xa;var _0x256753=[_0x2c42('0x4f'),_0x2c42('0x50'),_0x2c42('0x51'),'cross_join'];var _0x525275={'SUM':_0x2c42('0x52'),'COUNT':_0x2c42('0x53'),'COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':_0x2c42('0x59')};var _0x1fa40a={'SEC_TO_TIME':_0x2c42('0x5a'),'DATE':_0x2c42('0x5b'),'HOUR':_0x2c42('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x2c42('0x5d')};var _0xde2832=function(_0x1ffc64){return!_[_0x2c42('0x5e')]([_0x2c42('0x5f'),_0x2c42('0x60'),_0x2c42('0x61'),_0x2c42('0x62')],_0x1ffc64);};var _0x23b8b5=function(_0x157e73){if(!_0x157e73||!_0x157e73[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x5b2d8a='(',_0x26a65f=0x0;_0x26a65f<_0x157e73[_0x2c42('0x63')][_0x2c42('0x3b')];_0x26a65f+=0x1){_0x26a65f>0x0&&(_0x5b2d8a+='\x20'+_0x157e73[_0x2c42('0x64')]+'\x20');_0x5b2d8a+=_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x65')]?_0x23b8b5(_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x65')]):_0x157e73['rules'][_0x26a65f][_0x2c42('0x66')]+'\x20'+_0x157e73[_0x2c42('0x63')][_0x26a65f]['condition']+(_0xde2832(_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x67')])?'\x20'+_0x157e73[_0x2c42('0x63')][_0x26a65f][_0x2c42('0x68')]:'');}return _0x5b2d8a+')';};var _0x606413={'where':{'id':_0x47b6ef[_0x2c42('0x48')]['id']}},_0x508eed,_0x529ffd,_0x1cd4a8,_0x410028,_0x358b4e;_0x606413=_['merge']({},_0x606413,_0x47b6ef[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x606413)['then'](function(_0x2de41c){if(_0x2de41c){_0x508eed=_0x2de41c;return _0x2de41c[_0x2c42('0x69')]();}return null;})['then'](function(_0x1d5a62){if(_0x1d5a62){if(!_0x1d5a62[_0x2c42('0x3b')]){throw new db['Sequelize'][(_0x2c42('0x6a'))](_0x2c42('0x6b'),0x193);}_0x529ffd=_0x1d5a62;return db[_0x2c42('0x6c')][_0x2c42('0x46')]({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x3f7409){if(_0x3f7409){_0x1cd4a8=_[_0x2c42('0x6d')](_0x3f7409,'id');var _0xfc73ab;var _0x23af6b=squel[_0x2c42('0x6e')]();_0x23af6b[_0x2c42('0x6f')](_0x508eed[_0x2c42('0x70')]);for(var _0x30a692=0x0;_0x30a692<_0x529ffd[_0x2c42('0x3b')];_0x30a692+=0x1){_0xfc73ab=_0x529ffd[_0x30a692]['MetricId']?_0x1cd4a8[_0x529ffd[_0x30a692][_0x2c42('0x71')]]['metric']:_0x529ffd[_0x30a692][_0x2c42('0x66')];_0xfc73ab=_0x529ffd[_0x30a692]['function']?_[_0x2c42('0x72')](_0x525275[_0x529ffd[_0x30a692][_0x2c42('0x73')]],'%s',_0xfc73ab):_0xfc73ab;_0xfc73ab=_0x529ffd[_0x30a692][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x1fa40a[_0x529ffd[_0x30a692]['format']],'%s',_0xfc73ab):_0xfc73ab;if(_0x529ffd[_0x30a692][_0x2c42('0x75')]){_0x23af6b[_0x2c42('0x65')](_0xfc73ab);}_0x529ffd[_0x30a692][_0x2c42('0x76')]&&_0x23af6b[_0x2c42('0x3d')](_0xfc73ab,_0x529ffd[_0x30a692]['orderBy']==='DESC'?![]:!![]);_0x23af6b['field'](_0xfc73ab,_0x529ffd[_0x30a692][_0x2c42('0x77')]||_0xfc73ab);}if(_0x508eed['joins']){_0x508eed[_0x2c42('0x78')]=JSON['parse'](_0x508eed[_0x2c42('0x78')]);for(var _0x2229c4=0x0;_0x2229c4<_0x508eed[_0x2c42('0x78')]['length'];_0x2229c4+=0x1){if(_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x32')]&&_['includes'](_0x256753,_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x32')])&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x79')]&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')]&&_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7b')]){_0x23af6b[_0x508eed['joins'][_0x2229c4][_0x2c42('0x32')]](_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')],null,util[_0x2c42('0x74')](_0x2c42('0x7c'),_0x508eed[_0x2c42('0x70')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x79')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7a')],_0x508eed[_0x2c42('0x78')][_0x2229c4][_0x2c42('0x7b')]));}}}if(_0x508eed[_0x2c42('0x7d')]){_0x508eed[_0x2c42('0x7d')]=JSON[_0x2c42('0x7e')](_0x508eed[_0x2c42('0x7d')]);_0x23af6b['where'](_0x23b8b5(_0x508eed['conditions'][_0x2c42('0x65')]));}_0x358b4e=_0x23af6b[_0x2c42('0x7f')]();_0x23af6b[_0x2c42('0x1e')](_0xd7a844);_0x23af6b[_0x2c42('0x1b')](0x0);logger[_0x2c42('0x80')](_0x2c42('0x81'),_0x23af6b[_0x2c42('0x82')]());return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x23af6b[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]});}})[_0x2c42('0x23')](respondWithResult(_0x4564f0,null))[_0x2c42('0x47')](handleError(_0x4564f0,null));};function runReport(_0x345ebf,_0x1cbf9a,_0x50975e){var _0x114f01=_0x1cbf9a[_0x2c42('0x2b')];var _0x5dcc93=0xa;var _0x46e21c=[_0x2c42('0x4f'),'left_join',_0x2c42('0x51'),_0x2c42('0x86')];var _0x1ac7be={'SUM':_0x2c42('0x52'),'COUNT':_0x2c42('0x53'),'COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':_0x2c42('0x87'),'GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':_0x2c42('0x59')};var _0x3663c5={'SEC_TO_TIME':_0x2c42('0x5a'),'DATE':'DATE(%s)','HOUR':_0x2c42('0x5c'),'ROUND':_0x2c42('0x88'),'UNIX_TIMESTAMP':_0x2c42('0x5d')};var _0x55c9ef=function(_0x4bbf51){return!_['includes']([_0x2c42('0x5f'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x2c42('0x62')],_0x4bbf51);};var _0x5028f0=function(_0x19254d){if(!_0x19254d||!_0x19254d[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x4ae6c1='(',_0x543179=0x0;_0x543179<_0x19254d[_0x2c42('0x63')][_0x2c42('0x3b')];_0x543179+=0x1){_0x543179>0x0&&(_0x4ae6c1+='\x20'+_0x19254d[_0x2c42('0x64')]+'\x20');_0x4ae6c1+=_0x19254d['rules'][_0x543179]['group']?_0x5028f0(_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x65')]):_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x66')]+'\x20'+_0x19254d['rules'][_0x543179]['condition']+(_0x55c9ef(_0x19254d[_0x2c42('0x63')][_0x543179][_0x2c42('0x67')])?'\x20'+_0x19254d[_0x2c42('0x63')][_0x543179]['value']:'');}return _0x4ae6c1+')';};var _0x38d1ca={'where':{'id':_0x345ebf['id']}},_0x33e96e,_0x47085f,_0x1816df,_0x459d6d,_0xbf72b5;_0x38d1ca=_[_0x2c42('0x42')]({},_0x38d1ca,_0x50975e);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x38d1ca)[_0x2c42('0x23')](function(_0x452808){if(_0x452808){_0x33e96e=_0x452808;return _0x452808['getFields']();}return null;})[_0x2c42('0x23')](function(_0x5b45e9){if(_0x5b45e9){if(!_0x5b45e9[_0x2c42('0x3b')]){throw new db[(_0x2c42('0x89'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x47085f=_0x5b45e9;return db[_0x2c42('0x6c')]['findAll']({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x4e1644){if(_0x4e1644){_0x1816df=_[_0x2c42('0x6d')](_0x4e1644,'id');var _0x259738;var _0x313297=squel[_0x2c42('0x6e')]();_0x313297[_0x2c42('0x6f')](_0x33e96e[_0x2c42('0x70')]);for(var _0x40d997=0x0;_0x40d997<_0x47085f['length'];_0x40d997+=0x1){_0x259738=_0x47085f[_0x40d997]['MetricId']?_0x1816df[_0x47085f[_0x40d997][_0x2c42('0x71')]][_0x2c42('0x8a')]:_0x47085f[_0x40d997]['field'];_0x259738=_0x47085f[_0x40d997][_0x2c42('0x73')]?_['replace'](_0x1ac7be[_0x47085f[_0x40d997]['function']],'%s',_0x259738):_0x259738;_0x259738=_0x47085f[_0x40d997][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x3663c5[_0x47085f[_0x40d997][_0x2c42('0x74')]],'%s',_0x259738):_0x259738;if(_0x47085f[_0x40d997][_0x2c42('0x75')]){_0x313297[_0x2c42('0x65')](_0x259738);}_0x47085f[_0x40d997]['orderBy']&&_0x313297['order'](_0x259738,_0x47085f[_0x40d997][_0x2c42('0x76')]===_0x2c42('0x8b')?![]:!![]);_0x313297['field'](_0x259738,_0x47085f[_0x40d997]['alias']||_0x259738);}if(_0x33e96e[_0x2c42('0x78')]){_0x33e96e[_0x2c42('0x78')]=JSON[_0x2c42('0x7e')](_0x33e96e[_0x2c42('0x78')]);for(var _0x29991c=0x0;_0x29991c<_0x33e96e['joins'][_0x2c42('0x3b')];_0x29991c+=0x1){if(_0x33e96e['joins'][_0x29991c][_0x2c42('0x32')]&&_[_0x2c42('0x5e')](_0x46e21c,_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x32')])&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x79')]&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7a')]&&_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7b')]){_0x313297[_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x32')]](_0x33e96e[_0x2c42('0x78')][_0x29991c]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x33e96e['table'],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x79')],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7a')],_0x33e96e[_0x2c42('0x78')][_0x29991c][_0x2c42('0x7b')]));}}}if(_0x33e96e[_0x2c42('0x7d')]){_0x33e96e[_0x2c42('0x7d')]=JSON['parse'](_0x33e96e[_0x2c42('0x7d')]);_0x313297[_0x2c42('0x3f')](_0x5028f0(_0x33e96e['conditions'][_0x2c42('0x65')]));}_0xbf72b5=_0x313297['clone']();_0x313297[_0x2c42('0x1e')](_0x5dcc93);_0x313297[_0x2c42('0x1b')](0x0);return;}})[_0x2c42('0x23')](function(){if(_0x1cbf9a[_0x2c42('0x8c')]==='web'){return null;}var _0x3ade95=_['merge'](_0x1cbf9a,{'name':_0x1cbf9a[_0x2c42('0x8d')]||_0x1cbf9a[_0x2c42('0x2b')]||_0x33e96e[_0x2c42('0x2b')],'basename':_0x114f01,'savename':util[_0x2c42('0x74')](_0x2c42('0x8e'),_0x1cbf9a['name']||_0x33e96e[_0x2c42('0x2b')],require(_0x2c42('0x8f'))[_0x2c42('0x90')](0x4),_0x1cbf9a[_0x2c42('0x8c')]||_0x2c42('0x91')),'reportId':_0x33e96e['id'],'reportType':_0x2c42('0x92')});return db[_0x2c42('0x93')][_0x2c42('0x4a')](_0x3ade95,{'raw':!![]});})['then'](function(_0x2268a2){if(_0x33e96e[_0x2c42('0x70')]===_0x2c42('0x94')){_0xbf72b5[_0x2c42('0x3f')](_0x33e96e[_0x2c42('0x70')]+_0x2c42('0x95'),_0x1cbf9a[_0x2c42('0x96')],_0x1cbf9a[_0x2c42('0x97')]);}else{_0xbf72b5[_0x2c42('0x3f')](_0x33e96e[_0x2c42('0x70')]+_0x2c42('0x98'),_0x1cbf9a[_0x2c42('0x96')],_0x1cbf9a[_0x2c42('0x97')]);}if(_0x2268a2){logger['info']('Run\x20Query:',_0xbf72b5[_0x2c42('0x82')]());require(_0x2c42('0x99'))[_0x2c42('0x9a')](path[_0x2c42('0x4f')](__dirname,'../../components/export/',_0x2268a2[_0x2c42('0x8c')]),[_0x2268a2['id'],_0xbf72b5[_0x2c42('0x82')](),path[_0x2c42('0x4f')](__dirname,'../../files/reports',_0x2268a2[_0x2c42('0x9b')]),_0x114f01]);return _0x2268a2;}else{var _0x34801c=squel['select']();_0x34801c[_0x2c42('0x6f')]('('+_0xbf72b5[_0x2c42('0x82')]()+')',_0x2c42('0x9c'));_0x34801c['field']('COUNT(*)',_0x2c42('0x1d'));_0xbf72b5[_0x2c42('0x1e')](_0x1cbf9a[_0x2c42('0x1e')]||_0x5dcc93);_0xbf72b5[_0x2c42('0x1b')](_0x1cbf9a[_0x2c42('0x1b')]||0x0);return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x34801c[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]})['then'](function(_0x2d6b54){if(!_0x2d6b54[_0x2c42('0x3b')]){_0x459d6d=0x0;}else{_0x459d6d=_0x2d6b54[0x0][_0x2c42('0x1d')]||0x0;}return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0xbf72b5[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')][_0x2c42('0x85')]});})[_0x2c42('0x23')](function(_0x3c813e){return{'rows':_0x3c813e||[],'count':_0x459d6d};});}});}exports[_0x2c42('0x9d')]=function(_0x16b503,_0x30f956){return runReport(_0x16b503[_0x2c42('0x48')],_0x16b503[_0x2c42('0x35')],_0x16b503[_0x2c42('0x43')])[_0x2c42('0x23')](respondWithResult(_0x30f956,null))[_0x2c42('0x47')](handleError(_0x30f956,null));};exports['runReport']=runReport;exports[_0x2c42('0x35')]=function(_0x37fa48,_0x13434a){var _0x2ea083=0xa;var _0x4776e9=[_0x2c42('0x4f'),'left_join','right_join',_0x2c42('0x86')];var _0x3c52ea={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x2c42('0x54'),'MAX':_0x2c42('0x55'),'MIN':_0x2c42('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x2c42('0x57'),'GROUP_CONCAT ASC':_0x2c42('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x538ee6={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x2c42('0x5b'),'HOUR':_0x2c42('0x5c'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4b8e07=function(_0x31130a){return!_[_0x2c42('0x5e')]([_0x2c42('0x5f'),_0x2c42('0x60'),_0x2c42('0x61'),'IS\x20NOT\x20EMPTY'],_0x31130a);};var _0x18eb63=function(_0x45aa8d){if(!_0x45aa8d||!_0x45aa8d[_0x2c42('0x63')][_0x2c42('0x3b')]){return'';}for(var _0x4bbe0b='(',_0x299b10=0x0;_0x299b10<_0x45aa8d[_0x2c42('0x63')][_0x2c42('0x3b')];_0x299b10+=0x1){_0x299b10>0x0&&(_0x4bbe0b+='\x20'+_0x45aa8d['operator']+'\x20');_0x4bbe0b+=_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x65')]?_0x18eb63(_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x65')]):_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x66')]+'\x20'+_0x45aa8d['rules'][_0x299b10][_0x2c42('0x67')]+(_0x4b8e07(_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x67')])?'\x20'+_0x45aa8d[_0x2c42('0x63')][_0x299b10][_0x2c42('0x68')]:'');}return _0x4bbe0b+')';};var _0x58eaa7={'where':{'id':_0x37fa48[_0x2c42('0x48')]['id']}},_0x525b36,_0xcdd411,_0x3112e6,_0x37c7f3,_0x6fe97;_0x58eaa7=_[_0x2c42('0x42')]({},_0x58eaa7,_0x37fa48[_0x2c42('0x43')]);return db[_0x2c42('0x2f')][_0x2c42('0x49')](_0x58eaa7)[_0x2c42('0x23')](function(_0x210486){if(_0x210486){_0x525b36=_0x210486;return _0x210486['getFields']();}return null;})[_0x2c42('0x23')](function(_0x35909f){if(_0x35909f){if(!_0x35909f['length']){throw new db[(_0x2c42('0x89'))][(_0x2c42('0x6a'))](_0x2c42('0x6b'),0x193);}_0xcdd411=_0x35909f;return db[_0x2c42('0x6c')][_0x2c42('0x46')]({'raw':!![]});}return null;})[_0x2c42('0x23')](function(_0x4eeaca){if(_0x4eeaca){_0x3112e6=_['keyBy'](_0x4eeaca,'id');var _0x55a694;var _0x326abe=squel[_0x2c42('0x6e')]();_0x326abe[_0x2c42('0x6f')](_0x525b36['table']);for(var _0x340cb1=0x0;_0x340cb1<_0xcdd411[_0x2c42('0x3b')];_0x340cb1+=0x1){_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x71')]?_0x3112e6[_0xcdd411[_0x340cb1]['MetricId']][_0x2c42('0x8a')]:_0xcdd411[_0x340cb1][_0x2c42('0x66')];_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x73')]?_[_0x2c42('0x72')](_0x3c52ea[_0xcdd411[_0x340cb1][_0x2c42('0x73')]],'%s',_0x55a694):_0x55a694;_0x55a694=_0xcdd411[_0x340cb1][_0x2c42('0x74')]?_[_0x2c42('0x72')](_0x538ee6[_0xcdd411[_0x340cb1]['format']],'%s',_0x55a694):_0x55a694;if(_0xcdd411[_0x340cb1][_0x2c42('0x75')]){_0x326abe['group'](_0x55a694);}_0xcdd411[_0x340cb1]['orderBy']&&_0x326abe[_0x2c42('0x3d')](_0x55a694,_0xcdd411[_0x340cb1][_0x2c42('0x76')]===_0x2c42('0x8b')?![]:!![]);_0x326abe[_0x2c42('0x66')](_0x55a694,_0xcdd411[_0x340cb1][_0x2c42('0x77')]||_0x55a694);}if(_0x525b36['joins']){_0x525b36['joins']=JSON[_0x2c42('0x7e')](_0x525b36[_0x2c42('0x78')]);for(var _0x6a83b=0x0;_0x6a83b<_0x525b36[_0x2c42('0x78')]['length'];_0x6a83b+=0x1){if(_0x525b36[_0x2c42('0x78')][_0x6a83b]['type']&&_[_0x2c42('0x5e')](_0x4776e9,_0x525b36[_0x2c42('0x78')][_0x6a83b]['type'])&&_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x79')]&&_0x525b36['joins'][_0x6a83b][_0x2c42('0x7a')]&&_0x525b36['joins'][_0x6a83b][_0x2c42('0x7b')]){_0x326abe[_0x525b36['joins'][_0x6a83b][_0x2c42('0x32')]](_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x525b36['table'],_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x79')],_0x525b36[_0x2c42('0x78')][_0x6a83b][_0x2c42('0x7a')],_0x525b36['joins'][_0x6a83b][_0x2c42('0x7b')]));}}}if(_0x525b36[_0x2c42('0x7d')]){_0x525b36[_0x2c42('0x7d')]=JSON[_0x2c42('0x7e')](_0x525b36[_0x2c42('0x7d')]);_0x326abe[_0x2c42('0x3f')](_0x18eb63(_0x525b36[_0x2c42('0x7d')][_0x2c42('0x65')]));}_0x6fe97=_0x326abe[_0x2c42('0x7f')]();_0x326abe[_0x2c42('0x1e')](_0x2ea083);_0x326abe[_0x2c42('0x1b')](0x0);logger['debug'](_0x2c42('0x81'),_0x326abe['toString']());return dbH[_0x2c42('0x83')][_0x2c42('0x35')](_0x326abe[_0x2c42('0x82')](),{'type':dbH[_0x2c42('0x83')][_0x2c42('0x84')]['SELECT']});}})[_0x2c42('0x23')](function(){return{'sql':_0x6fe97[_0x2c42('0x82')]()};})[_0x2c42('0x23')](respondWithResult(_0x13434a,null))[_0x2c42('0x47')](handleError(_0x13434a,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 5de139e..99c2098 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 _0x2710=['api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x2ffa8f,_0x196569){var _0xac60a5=function(_0x53b51b){while(--_0x53b51b){_0x2ffa8f['push'](_0x2ffa8f['shift']());}};_0xac60a5(++_0x196569);}(_0x2710,0x72));var _0x0271=function(_0x333683,_0x2e51dc){_0x333683=_0x333683-0x0;var _0x570c76=_0x2710[_0x333683];return _0x570c76;};'use strict';var _=require(_0x0271('0x0'));var util=require(_0x0271('0x1'));var logger=require(_0x0271('0x2'))(_0x0271('0x3'));var moment=require('moment');var BPromise=require(_0x0271('0x4'));var rp=require(_0x0271('0x5'));var fs=require('fs');var path=require(_0x0271('0x6'));var rimraf=require(_0x0271('0x7'));var config=require(_0x0271('0x8'));var attributes=require(_0x0271('0x9'));module[_0x0271('0xa')]=function(_0x146a13,_0x42dc30){return _0x146a13['define'](_0x0271('0xb'),attributes,{'tableName':_0x0271('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa816=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','define','analytics_custom_reports'];(function(_0x4609b7,_0x4148b3){var _0x4332b6=function(_0x4ef6b5){while(--_0x4ef6b5){_0x4609b7['push'](_0x4609b7['shift']());}};_0x4332b6(++_0x4148b3);}(_0xa816,0x1e4));var _0x6a81=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0xa816[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x6a81('0x0'));var util=require('util');var logger=require(_0x6a81('0x1'))(_0x6a81('0x2'));var moment=require(_0x6a81('0x3'));var BPromise=require(_0x6a81('0x4'));var rp=require(_0x6a81('0x5'));var fs=require('fs');var path=require(_0x6a81('0x6'));var rimraf=require(_0x6a81('0x7'));var config=require('../../config/environment');var attributes=require(_0x6a81('0x8'));module['exports']=function(_0x1667b4,_0x54f2f8){return _0x1667b4[_0x6a81('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x6a81('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index 7262ca4..886d59a 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 _0xd407=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4706a6,_0x5a1c63){var _0x1bb705=function(_0x484ebb){while(--_0x484ebb){_0x4706a6['push'](_0x4706a6['shift']());}};_0x1bb705(++_0x5a1c63);}(_0xd407,0x19c));var _0x7d40=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd407[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7d40('0x0'));var util=require(_0x7d40('0x1'));var moment=require('moment');var BPromise=require(_0x7d40('0x2'));var rs=require(_0x7d40('0x3'));var fs=require('fs');var Redis=require(_0x7d40('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7d40('0x5'));var logger=require(_0x7d40('0x6'))(_0x7d40('0x7'));var config=require(_0x7d40('0x8'));var jayson=require(_0x7d40('0x9'));var client=jayson['client'][_0x7d40('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf705e7,_0xef9379,_0x597d51){return new BPromise(function(_0x1c8e44,_0x4db825){return client[_0x7d40('0xb')](_0xf705e7,_0x597d51)[_0x7d40('0xc')](function(_0x438448){logger[_0x7d40('0xd')](_0x7d40('0xe'),_0xef9379,_0x7d40('0xf'));logger[_0x7d40('0x10')](_0x7d40('0x11'),_0xef9379,'request\x20sent',JSON['stringify'](_0x438448));if(_0x438448[_0x7d40('0x12')]){if(_0x438448[_0x7d40('0x12')][_0x7d40('0x13')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xef9379,_0x438448[_0x7d40('0x12')][_0x7d40('0x14')]);return _0x4db825(_0x438448[_0x7d40('0x12')][_0x7d40('0x14')]);}logger['error'](_0x7d40('0xe'),_0xef9379,_0x438448[_0x7d40('0x12')]['message']);return _0x1c8e44(_0x438448['error']['message']);}else{logger[_0x7d40('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0xef9379,_0x7d40('0xf'));_0x1c8e44(_0x438448['result'][_0x7d40('0x14')]);}})[_0x7d40('0x15')](function(_0x2c0dc3){logger[_0x7d40('0x12')](_0x7d40('0xe'),_0xef9379,_0x2c0dc3);_0x4db825(_0x2c0dc3);});});} \ No newline at end of file +var _0x08b3=['request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x40642c,_0x3d3961){var _0x68f27a=function(_0xf59c13){while(--_0xf59c13){_0x40642c['push'](_0x40642c['shift']());}};_0x68f27a(++_0x3d3961);}(_0x08b3,0x96));var _0x308b=function(_0x59fce9,_0x8999e6){_0x59fce9=_0x59fce9-0x0;var _0x4e9034=_0x08b3[_0x59fce9];return _0x4e9034;};'use strict';var _=require('lodash');var util=require(_0x308b('0x0'));var moment=require(_0x308b('0x1'));var BPromise=require(_0x308b('0x2'));var rs=require(_0x308b('0x3'));var fs=require('fs');var Redis=require(_0x308b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x308b('0x5'))(_0x308b('0x6'));var config=require(_0x308b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x308b('0x8')][_0x308b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xbd6cca,_0x237810,_0x46209d){return new BPromise(function(_0x3ec41f,_0xd2acf2){return client[_0x308b('0xa')](_0xbd6cca,_0x46209d)['then'](function(_0x3b0787){logger[_0x308b('0xb')](_0x308b('0xc'),_0x237810,_0x308b('0xd'));logger['debug'](_0x308b('0xe'),_0x237810,_0x308b('0xd'),JSON[_0x308b('0xf')](_0x3b0787));if(_0x3b0787[_0x308b('0x10')]){if(_0x3b0787['error'][_0x308b('0x11')]===0x1f4){logger['error'](_0x308b('0xc'),_0x237810,_0x3b0787[_0x308b('0x10')]['message']);return _0xd2acf2(_0x3b0787[_0x308b('0x10')]['message']);}logger['error'](_0x308b('0xc'),_0x237810,_0x3b0787[_0x308b('0x10')][_0x308b('0x12')]);return _0x3ec41f(_0x3b0787[_0x308b('0x10')][_0x308b('0x12')]);}else{logger[_0x308b('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x237810,'request\x20sent');_0x3ec41f(_0x3b0787['result'][_0x308b('0x12')]);}})[_0x308b('0x13')](function(_0x5232f7){logger[_0x308b('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x237810,_0x5232f7);_0xd2acf2(_0x5232f7);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1acfd7a..2270b6e 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 _0x4616=['/:id/run','run','/:id/query','put','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview'];(function(_0x56efbe,_0x32c151){var _0x1056da=function(_0x1754a9){while(--_0x1754a9){_0x56efbe['push'](_0x56efbe['shift']());}};_0x1056da(++_0x32c151);}(_0x4616,0x8c));var _0x6461=function(_0x2f297d,_0x24d632){_0x2f297d=_0x2f297d-0x0;var _0x372daa=_0x4616[_0x2f297d];return _0x372daa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6461('0x0'));var timeout=require(_0x6461('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6461('0x2'));var auth=require(_0x6461('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6461('0x4'));router[_0x6461('0x5')]('/',auth[_0x6461('0x6')](),controller[_0x6461('0x7')]);router[_0x6461('0x5')](_0x6461('0x8'),auth['isAuthenticated'](),controller[_0x6461('0x9')]);router['get'](_0x6461('0xa'),auth['isAuthenticated'](),controller[_0x6461('0xb')]);router[_0x6461('0x5')](_0x6461('0xc'),auth[_0x6461('0x6')](),controller[_0x6461('0xd')]);router['get'](_0x6461('0xe'),auth[_0x6461('0x6')](),controller['query']);router['post']('/',auth[_0x6461('0x6')](),controller['create']);router[_0x6461('0xf')](_0x6461('0x8'),auth[_0x6461('0x6')](),controller['update']);router[_0x6461('0x10')](_0x6461('0x8'),auth[_0x6461('0x6')](),controller[_0x6461('0x11')]);module[_0x6461('0x12')]=router; \ No newline at end of file +var _0x1a3e=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','/:id/query','post','create','put','destroy'];(function(_0x56bc9e,_0x3f8519){var _0x652193=function(_0x24415b){while(--_0x24415b){_0x56bc9e['push'](_0x56bc9e['shift']());}};_0x652193(++_0x3f8519);}(_0x1a3e,0xe7));var _0xe1a3=function(_0x3fe253,_0xcca7e7){_0x3fe253=_0x3fe253-0x0;var _0x1a345e=_0x1a3e[_0x3fe253];return _0x1a345e;};'use strict';var multer=require(_0xe1a3('0x0'));var util=require(_0xe1a3('0x1'));var path=require(_0xe1a3('0x2'));var timeout=require(_0xe1a3('0x3'));var express=require(_0xe1a3('0x4'));var router=express[_0xe1a3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xe1a3('0x6'));var interaction=require(_0xe1a3('0x7'));var config=require(_0xe1a3('0x8'));var controller=require('./analyticCustomReport.controller');router[_0xe1a3('0x9')]('/',auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xb')]);router['get'](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xd')]);router[_0xe1a3('0x9')](_0xe1a3('0xe'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0xf')]);router[_0xe1a3('0x9')](_0xe1a3('0x10'),auth[_0xe1a3('0xa')](),controller['run']);router[_0xe1a3('0x9')](_0xe1a3('0x11'),auth[_0xe1a3('0xa')](),controller['query']);router[_0xe1a3('0x12')]('/',auth['isAuthenticated'](),controller[_0xe1a3('0x13')]);router[_0xe1a3('0x14')](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller['update']);router['delete'](_0xe1a3('0xc'),auth[_0xe1a3('0xa')](),controller[_0xe1a3('0x15')]);module[_0xe1a3('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index f732884..62d7965 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 _0xac9d=['TEXT','sequelize','exports','STRING'];(function(_0x31523e,_0x3ce635){var _0x195270=function(_0x12df4e){while(--_0x12df4e){_0x31523e['push'](_0x31523e['shift']());}};_0x195270(++_0x3ce635);}(_0xac9d,0x14d));var _0xdac9=function(_0x2330cf,_0x5add9f){_0x2330cf=_0x2330cf-0x0;var _0x5e230f=_0xac9d[_0x2330cf];return _0x5e230f;};'use strict';var Sequelize=require(_0xdac9('0x0'));module[_0xdac9('0x1')]={'name':{'type':Sequelize[_0xdac9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdac9('0x2')]},'parent':{'type':Sequelize[_0xdac9('0x2')]},'table':{'type':Sequelize[_0xdac9('0x2')]},'conditions':{'type':Sequelize[_0xdac9('0x3')]},'joins':{'type':Sequelize[_0xdac9('0x3')]}}; \ No newline at end of file +var _0x24ca=['sequelize','STRING','TEXT'];(function(_0x4d6554,_0x24a2bf){var _0xd9f05b=function(_0x679c5e){while(--_0x679c5e){_0x4d6554['push'](_0x4d6554['shift']());}};_0xd9f05b(++_0x24a2bf);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0x24ca[_0x2d994d];return _0xd54be4;};'use strict';var Sequelize=require(_0xa24c('0x0'));module['exports']={'name':{'type':Sequelize[_0xa24c('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa24c('0x1')]},'parent':{'type':Sequelize[_0xa24c('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0xa24c('0x2')]},'joins':{'type':Sequelize[_0xa24c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4fd6f6a..aa9df8c 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 _0x1cb9=['runReport','left_join','SEC_TO_TIME(%s)','IS\x20NULL','clone','debug','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','json','offset','limit','undefined','count','status','set','apply','reject','then','destroy','get','UserProfileResource','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','body','user','role','autoAssociation','create','DefaultReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','preview','join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','COUNT(%s)','GROUP_CONCAT(%s)','HOUR(%s)','value','groupBy','alias','output','fullPath','%s-%s.%s','randomstring','generate','csv','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)'];(function(_0x131af9,_0x4c62e1){var _0x211521=function(_0x1e696e){while(--_0x1e696e){_0x131af9['push'](_0x131af9['shift']());}};_0x211521(++_0x4c62e1);}(_0x1cb9,0x14e));var _0x91cb=function(_0x21ab49,_0x207310){_0x21ab49=_0x21ab49-0x0;var _0x486c37=_0x1cb9[_0x21ab49];return _0x486c37;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];var dbH=require(_0x91cb('0x18'))['dbH'];function respondWithStatusCode(_0x20e6e0,_0x3ea707){_0x3ea707=_0x3ea707||0xcc;return function(_0x44f2e9){if(_0x44f2e9){return _0x20e6e0[_0x91cb('0x19')](_0x3ea707);}return _0x20e6e0['status'](_0x3ea707)['end']();};}function respondWithResult(_0x4aae25,_0x3d22b7){_0x3d22b7=_0x3d22b7||0xc8;return function(_0x585470){if(_0x585470){return _0x4aae25['status'](_0x3d22b7)[_0x91cb('0x1a')](_0x585470);}};}function respondWithFilteredResult(_0xc3629e,_0x347980){return function(_0x5ea796){if(_0x5ea796){var _0x238f11=typeof _0x347980[_0x91cb('0x1b')]==='undefined'&&typeof _0x347980[_0x91cb('0x1c')]===_0x91cb('0x1d');var _0x1cd34b=_0x5ea796[_0x91cb('0x1e')];var _0x5cc1c3=_0x238f11?0x0:_0x347980[_0x91cb('0x1b')];var _0x7dcf60=_0x238f11?_0x5ea796['count']:_0x347980[_0x91cb('0x1b')]+_0x347980['limit'];var _0x55042a;if(_0x7dcf60>=_0x1cd34b){_0x7dcf60=_0x1cd34b;_0x55042a=0xc8;}else{_0x55042a=0xce;}_0xc3629e[_0x91cb('0x1f')](_0x55042a);return _0xc3629e[_0x91cb('0x20')]('Content-Range',_0x5cc1c3+'-'+_0x7dcf60+'/'+_0x1cd34b)['json'](_0x5ea796);}return null;};}function patchUpdates(_0x5b385a){return function(_0x438162){try{jsonpatch[_0x91cb('0x21')](_0x438162,_0x5b385a,!![]);}catch(_0x20aff5){return BPromise[_0x91cb('0x22')](_0x20aff5);}return _0x438162['save']();};}function saveUpdates(_0x45c4b3,_0x43881c){return function(_0x1fa837){if(_0x1fa837){return _0x1fa837['update'](_0x45c4b3)[_0x91cb('0x23')](function(_0x1a7a54){return _0x1a7a54;});}return null;};}function removeEntity(_0x2447e7,_0x422d14){return function(_0x3ca500){if(_0x3ca500){return _0x3ca500[_0x91cb('0x24')]()[_0x91cb('0x23')](function(){var _0x423c4f=_0x3ca500[_0x91cb('0x25')]({'plain':!![]});var _0x4c8438='DefaultReports';return db[_0x91cb('0x26')]['destroy']({'where':{'type':_0x4c8438,'resourceId':_0x423c4f['id']}})[_0x91cb('0x23')](function(){return _0x3ca500;});})[_0x91cb('0x23')](function(){_0x2447e7[_0x91cb('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9b26a6,_0x4f5a7b){return function(_0x4572f6){if(!_0x4572f6){_0x9b26a6[_0x91cb('0x19')](0x194);}return _0x4572f6;};}function handleError(_0x3b3ee6,_0x2fb473){_0x2fb473=_0x2fb473||0x1f4;return function(_0x468908){logger['error'](_0x468908[_0x91cb('0x27')]);if(_0x468908['name']){delete _0x468908[_0x91cb('0x28')];}_0x3b3ee6[_0x91cb('0x1f')](_0x2fb473)[_0x91cb('0x29')](_0x468908);};}exports['index']=function(_0x775c25,_0x146e1f){var _0x25bbf9={},_0x361e4c={},_0xf296bc={'count':0x0,'rows':[]};var _0x3dab18=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')][_0x91cb('0x2c')],function(_0x5e6ed3){return{'name':_0x5e6ed3[_0x91cb('0x2d')],'type':_0x5e6ed3[_0x91cb('0x2e')][_0x91cb('0x2f')]};});_0x361e4c[_0x91cb('0x30')]=_[_0x91cb('0x2a')](_0x3dab18,'name');_0x361e4c[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x775c25[_0x91cb('0x31')]);_0x361e4c[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0x361e4c['model'],_0x361e4c[_0x91cb('0x31')]);_0x25bbf9['attributes']=_['intersection'](_0x361e4c['model'],qs[_0x91cb('0x35')](_0x775c25['query'][_0x91cb('0x35')]));_0x25bbf9['attributes']=_0x25bbf9['attributes'][_0x91cb('0x36')]?_0x25bbf9[_0x91cb('0x37')]:_0x361e4c[_0x91cb('0x30')];if(!_0x775c25[_0x91cb('0x31')][_0x91cb('0x38')]('nolimit')){_0x25bbf9[_0x91cb('0x1c')]=qs[_0x91cb('0x1c')](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1c')]);_0x25bbf9['offset']=qs['offset'](_0x775c25[_0x91cb('0x31')][_0x91cb('0x1b')]);}_0x25bbf9['order']=qs[_0x91cb('0x39')](_0x775c25[_0x91cb('0x31')]['sort']);_0x25bbf9[_0x91cb('0x3a')]=qs[_0x91cb('0x33')](_['pick'](_0x775c25[_0x91cb('0x31')],_0x361e4c['filters']),_0x3dab18);if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3b')]){_0x25bbf9[_0x91cb('0x3a')]=_[_0x91cb('0x3c')](_0x25bbf9[_0x91cb('0x3a')],{'$or':_[_0x91cb('0x2a')](_0x3dab18,function(_0x5d0e37){if(_0x5d0e37[_0x91cb('0x2e')]!==_0x91cb('0x3d')){var _0x4e5b4b={};_0x4e5b4b[_0x5d0e37[_0x91cb('0x28')]]={'$like':'%'+_0x775c25['query'][_0x91cb('0x3b')]+'%'};return _0x4e5b4b;}})});}_0x25bbf9=_[_0x91cb('0x3c')]({},_0x25bbf9,_0x775c25[_0x91cb('0x3e')]);var _0x174794={'where':_0x25bbf9['where']};return db[_0x91cb('0x2b')][_0x91cb('0x1e')](_0x174794)[_0x91cb('0x23')](function(_0x37e777){_0xf296bc[_0x91cb('0x1e')]=_0x37e777;if(_0x775c25[_0x91cb('0x31')][_0x91cb('0x3f')]){_0x25bbf9[_0x91cb('0x40')]=[{'all':!![]}];}return db[_0x91cb('0x2b')][_0x91cb('0x41')](_0x25bbf9);})['then'](function(_0x16993f){_0xf296bc['rows']=_0x16993f;return _0xf296bc;})[_0x91cb('0x23')](respondWithFilteredResult(_0x146e1f,_0x25bbf9))['catch'](handleError(_0x146e1f,null));};exports[_0x91cb('0x42')]=function(_0x52e82c,_0x138f48){var _0x477131={'raw':!![],'where':{'id':_0x52e82c[_0x91cb('0x43')]['id']}},_0xba99ce={};_0xba99ce['model']=_[_0x91cb('0x32')](db[_0x91cb('0x2b')]['rawAttributes']);_0xba99ce[_0x91cb('0x31')]=_[_0x91cb('0x32')](_0x52e82c[_0x91cb('0x31')]);_0xba99ce[_0x91cb('0x33')]=_[_0x91cb('0x34')](_0xba99ce[_0x91cb('0x30')],_0xba99ce[_0x91cb('0x31')]);_0x477131[_0x91cb('0x37')]=_[_0x91cb('0x34')](_0xba99ce['model'],qs[_0x91cb('0x35')](_0x52e82c[_0x91cb('0x31')][_0x91cb('0x35')]));_0x477131[_0x91cb('0x37')]=_0x477131[_0x91cb('0x37')][_0x91cb('0x36')]?_0x477131[_0x91cb('0x37')]:_0xba99ce[_0x91cb('0x30')];if(_0x52e82c['query'][_0x91cb('0x3f')]){_0x477131[_0x91cb('0x40')]=[{'all':!![]}];}_0x477131=_[_0x91cb('0x3c')]({},_0x477131,_0x52e82c[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x477131)[_0x91cb('0x23')](handleEntityNotFound(_0x138f48,null))['then'](respondWithResult(_0x138f48,null))[_0x91cb('0x45')](handleError(_0x138f48,null));};exports['create']=function(_0x2c419b,_0x4c0acd){return db['AnalyticDefaultReport']['create'](_0x2c419b[_0x91cb('0x46')],{})[_0x91cb('0x23')](function(_0x3d62c4){var _0x2f8384=_0x2c419b[_0x91cb('0x47')]['get']({'plain':!![]});if(!_0x2f8384)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2f8384[_0x91cb('0x48')]===_0x91cb('0x47')){var _0x140994=_0x3d62c4[_0x91cb('0x25')]({'plain':!![]});var _0x57adff='Reports';return db['UserProfileSection'][_0x91cb('0x44')]({'where':{'name':_0x57adff,'userProfileId':_0x2f8384['userProfileId']},'raw':!![]})[_0x91cb('0x23')](function(_0x4aa670){if(_0x4aa670&&_0x4aa670[_0x91cb('0x49')]===0x0){return db[_0x91cb('0x26')][_0x91cb('0x4a')]({'name':_0x140994[_0x91cb('0x28')],'resourceId':_0x140994['id'],'type':_0x91cb('0x4b'),'sectionId':_0x4aa670['id']},{})[_0x91cb('0x23')](function(){return _0x3d62c4;});}else{return _0x3d62c4;}})[_0x91cb('0x45')](function(_0x30fd4e){logger[_0x91cb('0x4c')](_0x91cb('0x4d'),_0x30fd4e);throw _0x30fd4e;});}return _0x3d62c4;})[_0x91cb('0x23')](respondWithResult(_0x4c0acd,0xc9))['catch'](handleError(_0x4c0acd,null));};exports[_0x91cb('0x4e')]=function(_0x1fa45a,_0x4d7a34){if(_0x1fa45a[_0x91cb('0x46')]['id']){delete _0x1fa45a[_0x91cb('0x46')]['id'];}return db['AnalyticDefaultReport'][_0x91cb('0x44')]({'where':{'id':_0x1fa45a[_0x91cb('0x43')]['id']}})[_0x91cb('0x23')](handleEntityNotFound(_0x4d7a34,null))[_0x91cb('0x23')](saveUpdates(_0x1fa45a[_0x91cb('0x46')],null))[_0x91cb('0x23')](respondWithResult(_0x4d7a34,null))[_0x91cb('0x45')](handleError(_0x4d7a34,null));};exports[_0x91cb('0x24')]=function(_0x3320bd,_0x93ef52){return db[_0x91cb('0x2b')]['find']({'where':{'id':_0x3320bd[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x93ef52,null))[_0x91cb('0x23')](removeEntity(_0x93ef52,null))['catch'](handleError(_0x93ef52,null));};exports[_0x91cb('0x4f')]=function(_0x1b2fec,_0x1986d7){var _0x47a6cd=0xa;var _0xe49d42=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),_0x91cb('0x52')];var _0x365afd={'SUM':_0x91cb('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x5c2c01={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x91cb('0x5a'),'HOUR':'HOUR(%s)','ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':_0x91cb('0x5c')};var _0x5ae0d2=function(_0x4f19c8){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4f19c8);};var _0x551836=function(_0x22fea8){if(!_0x22fea8||!_0x22fea8['rules'][_0x91cb('0x36')]){return'';}for(var _0xe08233='(',_0xd7be15=0x0;_0xd7be15<_0x22fea8[_0x91cb('0x61')]['length'];_0xd7be15+=0x1){_0xd7be15>0x0&&(_0xe08233+='\x20'+_0x22fea8[_0x91cb('0x62')]+'\x20');_0xe08233+=_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]?_0x551836(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x63')]):_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x64')]+'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')]+(_0x5ae0d2(_0x22fea8[_0x91cb('0x61')][_0xd7be15][_0x91cb('0x65')])?'\x20'+_0x22fea8[_0x91cb('0x61')][_0xd7be15]['value']:'');}return _0xe08233+')';};var _0x2cf4d0={'where':{'id':_0x1b2fec[_0x91cb('0x43')]['id']}},_0x2e301a,_0x474682,_0x51ab8a,_0x21c890,_0xca33a2;_0x2cf4d0=_['merge']({},_0x2cf4d0,_0x1b2fec[_0x91cb('0x3e')]);return db['AnalyticDefaultReport'][_0x91cb('0x44')](_0x2cf4d0)[_0x91cb('0x23')](function(_0x80fcc6){if(_0x80fcc6){_0x2e301a=_0x80fcc6;return _0x80fcc6[_0x91cb('0x66')]();}return null;})['then'](function(_0x1c0b66){if(_0x1c0b66){if(!_0x1c0b66[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x474682=_0x1c0b66;return db[_0x91cb('0x6a')]['findAll']({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x28bfe5){if(_0x28bfe5){_0x51ab8a=_[_0x91cb('0x6b')](_0x28bfe5,'id');var _0x1f0ba2;var _0x891569=squel[_0x91cb('0x6c')]();_0x891569[_0x91cb('0x6d')](_0x2e301a[_0x91cb('0x6e')]);for(var _0x43629b=0x0;_0x43629b<_0x474682[_0x91cb('0x36')];_0x43629b+=0x1){_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x6f')]?_0x51ab8a[_0x474682[_0x43629b][_0x91cb('0x6f')]][_0x91cb('0x70')]:_0x474682[_0x43629b][_0x91cb('0x64')];_0x1f0ba2=_0x474682[_0x43629b][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x365afd[_0x474682[_0x43629b][_0x91cb('0x71')]],'%s',_0x1f0ba2):_0x1f0ba2;_0x1f0ba2=_0x474682[_0x43629b]['format']?_[_0x91cb('0x72')](_0x5c2c01[_0x474682[_0x43629b][_0x91cb('0x73')]],'%s',_0x1f0ba2):_0x1f0ba2;if(_0x474682[_0x43629b]['groupBy']){_0x891569[_0x91cb('0x63')](_0x1f0ba2);}_0x474682[_0x43629b][_0x91cb('0x74')]&&_0x891569[_0x91cb('0x75')](_0x1f0ba2,_0x474682[_0x43629b]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x891569[_0x91cb('0x64')](_0x1f0ba2,_0x474682[_0x43629b]['alias']||_0x1f0ba2);}if(_0x2e301a['joins']){_0x2e301a[_0x91cb('0x77')]=JSON['parse'](_0x2e301a[_0x91cb('0x77')]);for(var _0x376f56=0x0;_0x376f56<_0x2e301a['joins'][_0x91cb('0x36')];_0x376f56+=0x1){if(_0x2e301a['joins'][_0x376f56][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0xe49d42,_0x2e301a['joins'][_0x376f56]['type'])&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')]&&_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignTable']&&_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x79')]){_0x891569[_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x2e')]](_0x2e301a['joins'][_0x376f56][_0x91cb('0x7a')],null,util['format'](_0x91cb('0x7b'),_0x2e301a[_0x91cb('0x6e')],_0x2e301a[_0x91cb('0x77')][_0x376f56][_0x91cb('0x78')],_0x2e301a['joins'][_0x376f56]['foreignTable'],_0x2e301a[_0x91cb('0x77')][_0x376f56]['foreignKey']));}}}if(_0x2e301a[_0x91cb('0x7c')]){_0x2e301a[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2e301a[_0x91cb('0x7c')]);_0x891569[_0x91cb('0x3a')](_0x551836(_0x2e301a[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0xca33a2=_0x891569['clone']();_0x891569[_0x91cb('0x1c')](_0x47a6cd);_0x891569[_0x91cb('0x1b')](0x0);logger['debug'](_0x91cb('0x7e'),_0x891569['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x891569[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});}})[_0x91cb('0x23')](respondWithResult(_0x1986d7,null))[_0x91cb('0x45')](handleError(_0x1986d7,null));};function runReport(_0x23380a,_0x14cad8,_0x20a64f){var _0x11411d=_0x14cad8[_0x91cb('0x28')];var _0x14882d=0xa;var _0x22ba54=[_0x91cb('0x50'),'left_join',_0x91cb('0x51'),'cross_join'];var _0x1235c0={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':_0x91cb('0x84'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x91cb('0x59')};var _0xdee7f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x91cb('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x95f2de=function(_0x4d777a){return!_[_0x91cb('0x5d')](['IS\x20NULL',_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d777a);};var _0x443c01=function(_0x4e899c){if(!_0x4e899c||!_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x42d07b='(',_0x427afd=0x0;_0x427afd<_0x4e899c[_0x91cb('0x61')][_0x91cb('0x36')];_0x427afd+=0x1){_0x427afd>0x0&&(_0x42d07b+='\x20'+_0x4e899c[_0x91cb('0x62')]+'\x20');_0x42d07b+=_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]?_0x443c01(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x63')]):_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x64')]+'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')]+(_0x95f2de(_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x65')])?'\x20'+_0x4e899c[_0x91cb('0x61')][_0x427afd][_0x91cb('0x86')]:'');}return _0x42d07b+')';};var _0x39b5bd={'where':{'id':_0x23380a['id']}},_0x315518,_0x3d944d,_0x43b96c,_0xe4d946,_0x32d426;_0x39b5bd=_['merge']({},_0x39b5bd,_0x20a64f);return db[_0x91cb('0x2b')][_0x91cb('0x44')](_0x39b5bd)[_0x91cb('0x23')](function(_0x1a654b){if(_0x1a654b){_0x315518=_0x1a654b;return _0x1a654b[_0x91cb('0x66')]();}return null;})[_0x91cb('0x23')](function(_0x404457){if(_0x404457){if(!_0x404457[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))][(_0x91cb('0x68'))](_0x91cb('0x69'),0x193);}_0x3d944d=_0x404457;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5689ea){if(_0x5689ea){_0x43b96c=_[_0x91cb('0x6b')](_0x5689ea,'id');var _0x265ffb;var _0x4f66f=squel[_0x91cb('0x6c')]();_0x4f66f[_0x91cb('0x6d')](_0x315518[_0x91cb('0x6e')]);for(var _0x210b46=0x0;_0x210b46<_0x3d944d[_0x91cb('0x36')];_0x210b46+=0x1){_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x6f')]?_0x43b96c[_0x3d944d[_0x210b46][_0x91cb('0x6f')]]['metric']:_0x3d944d[_0x210b46][_0x91cb('0x64')];_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x71')]?_['replace'](_0x1235c0[_0x3d944d[_0x210b46][_0x91cb('0x71')]],'%s',_0x265ffb):_0x265ffb;_0x265ffb=_0x3d944d[_0x210b46][_0x91cb('0x73')]?_['replace'](_0xdee7f[_0x3d944d[_0x210b46][_0x91cb('0x73')]],'%s',_0x265ffb):_0x265ffb;if(_0x3d944d[_0x210b46][_0x91cb('0x87')]){_0x4f66f[_0x91cb('0x63')](_0x265ffb);}_0x3d944d[_0x210b46][_0x91cb('0x74')]&&_0x4f66f[_0x91cb('0x75')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x74')]===_0x91cb('0x76')?![]:!![]);_0x4f66f[_0x91cb('0x64')](_0x265ffb,_0x3d944d[_0x210b46][_0x91cb('0x88')]||_0x265ffb);}if(_0x315518[_0x91cb('0x77')]){_0x315518[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x315518['joins']);for(var _0x5c0725=0x0;_0x5c0725<_0x315518[_0x91cb('0x77')][_0x91cb('0x36')];_0x5c0725+=0x1){if(_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]&&_[_0x91cb('0x5d')](_0x22ba54,_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')])&&_0x315518['joins'][_0x5c0725][_0x91cb('0x78')]&&_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')]&&_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]){_0x4f66f[_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x2e')]](_0x315518['joins'][_0x5c0725][_0x91cb('0x7a')],null,util[_0x91cb('0x73')](_0x91cb('0x7b'),_0x315518[_0x91cb('0x6e')],_0x315518[_0x91cb('0x77')][_0x5c0725]['parentKey'],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x7a')],_0x315518[_0x91cb('0x77')][_0x5c0725][_0x91cb('0x79')]));}}}if(_0x315518['conditions']){_0x315518['conditions']=JSON['parse'](_0x315518[_0x91cb('0x7c')]);_0x4f66f[_0x91cb('0x3a')](_0x443c01(_0x315518[_0x91cb('0x7c')][_0x91cb('0x63')]));}_0x32d426=_0x4f66f['clone']();_0x4f66f[_0x91cb('0x1c')](_0x14882d);_0x4f66f[_0x91cb('0x1b')](0x0);return;}})[_0x91cb('0x23')](function(){if(_0x14cad8[_0x91cb('0x89')]==='web'){return null;}var _0x4bf7c7=_[_0x91cb('0x3c')](_0x14cad8,{'name':_0x14cad8[_0x91cb('0x8a')]||_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],'basename':_0x11411d,'savename':util[_0x91cb('0x73')](_0x91cb('0x8b'),_0x14cad8[_0x91cb('0x28')]||_0x315518[_0x91cb('0x28')],require(_0x91cb('0x8c'))[_0x91cb('0x8d')](0x4),_0x14cad8[_0x91cb('0x89')]||_0x91cb('0x8e')),'reportId':_0x315518['id'],'reportType':_0x91cb('0x8f')});return db['AnalyticExtractedReport']['create'](_0x4bf7c7,{'raw':!![]});})[_0x91cb('0x23')](function(_0x48a910){if(_0x315518[_0x91cb('0x6e')]===_0x91cb('0x90')){_0x32d426[_0x91cb('0x3a')](_0x315518[_0x91cb('0x6e')]+_0x91cb('0x91'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}else{_0x32d426[_0x91cb('0x3a')](_0x315518['table']+_0x91cb('0x94'),_0x14cad8[_0x91cb('0x92')],_0x14cad8[_0x91cb('0x93')]);}if(_0x48a910){logger[_0x91cb('0x95')](_0x91cb('0x96'),_0x32d426['toString']());require(_0x91cb('0x97'))[_0x91cb('0x98')](path[_0x91cb('0x50')](__dirname,_0x91cb('0x99'),_0x48a910[_0x91cb('0x89')]),[_0x48a910['id'],_0x32d426['toString'](),path[_0x91cb('0x50')](__dirname,_0x91cb('0x9a'),_0x48a910[_0x91cb('0x9b')]),_0x11411d]);return _0x48a910;}else{var _0x22b6d3=squel[_0x91cb('0x6c')]();_0x22b6d3[_0x91cb('0x6d')]('('+_0x32d426[_0x91cb('0x80')]()+')',_0x91cb('0x9c'));_0x22b6d3[_0x91cb('0x64')](_0x91cb('0x9d'),_0x91cb('0x1e'));_0x32d426[_0x91cb('0x1c')](_0x14cad8[_0x91cb('0x1c')]||_0x14882d);_0x32d426[_0x91cb('0x1b')](_0x14cad8[_0x91cb('0x1b')]||0x0);return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x22b6d3[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]})[_0x91cb('0x23')](function(_0x275c80){if(!_0x275c80[_0x91cb('0x36')]){_0xe4d946=0x0;}else{_0xe4d946=_0x275c80[0x0][_0x91cb('0x1e')]||0x0;}return dbH[_0x91cb('0x7f')]['query'](_0x32d426[_0x91cb('0x80')](),{'type':dbH[_0x91cb('0x7f')][_0x91cb('0x81')][_0x91cb('0x82')]});})[_0x91cb('0x23')](function(_0x5ca377){return{'rows':_0x5ca377||[],'count':_0xe4d946};});}});}exports['run']=function(_0x552490,_0x5174ac){return runReport(_0x552490['params'],_0x552490[_0x91cb('0x31')],_0x552490[_0x91cb('0x3e')])[_0x91cb('0x23')](respondWithResult(_0x5174ac,null))[_0x91cb('0x45')](handleError(_0x5174ac,null));};exports[_0x91cb('0x9e')]=runReport;exports[_0x91cb('0x31')]=function(_0x3462c5,_0x146346){var _0xe3d97f=0xa;var _0x3b93c3=['join',_0x91cb('0x9f'),_0x91cb('0x51'),'cross_join'];var _0x154e6a={'SUM':_0x91cb('0x53'),'COUNT':_0x91cb('0x83'),'COUNT DISTINCT':_0x91cb('0x54'),'MAX':_0x91cb('0x55'),'MIN':_0x91cb('0x56'),'AVG':_0x91cb('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x91cb('0x58'),'GROUP_CONCAT DESC':_0x91cb('0x59')};var _0x2a05af={'SEC_TO_TIME':_0x91cb('0xa0'),'DATE':_0x91cb('0x5a'),'HOUR':_0x91cb('0x85'),'ROUND':_0x91cb('0x5b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x34c1f2=function(_0x4d82b4){return!_[_0x91cb('0x5d')]([_0x91cb('0xa1'),_0x91cb('0x5e'),_0x91cb('0x5f'),_0x91cb('0x60')],_0x4d82b4);};var _0x432099=function(_0x344c95){if(!_0x344c95||!_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')]){return'';}for(var _0x570cf0='(',_0xb3a6c4=0x0;_0xb3a6c4<_0x344c95[_0x91cb('0x61')][_0x91cb('0x36')];_0xb3a6c4+=0x1){_0xb3a6c4>0x0&&(_0x570cf0+='\x20'+_0x344c95[_0x91cb('0x62')]+'\x20');_0x570cf0+=_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]?_0x432099(_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x63')]):_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x64')]+'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4][_0x91cb('0x65')]+(_0x34c1f2(_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['condition'])?'\x20'+_0x344c95[_0x91cb('0x61')][_0xb3a6c4]['value']:'');}return _0x570cf0+')';};var _0x39ba62={'where':{'id':_0x3462c5[_0x91cb('0x43')]['id']}},_0x2ab5a3,_0x10a9f6,_0x43ad75,_0x1382ba,_0x12da14;_0x39ba62=_[_0x91cb('0x3c')]({},_0x39ba62,_0x3462c5['options']);return db[_0x91cb('0x2b')]['find'](_0x39ba62)[_0x91cb('0x23')](function(_0x2f7387){if(_0x2f7387){_0x2ab5a3=_0x2f7387;return _0x2f7387[_0x91cb('0x66')]();}return null;})['then'](function(_0x1f2ef8){if(_0x1f2ef8){if(!_0x1f2ef8[_0x91cb('0x36')]){throw new db[(_0x91cb('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x10a9f6=_0x1f2ef8;return db['AnalyticMetric'][_0x91cb('0x41')]({'raw':!![]});}return null;})[_0x91cb('0x23')](function(_0x3ac830){if(_0x3ac830){_0x43ad75=_['keyBy'](_0x3ac830,'id');var _0x469e62;var _0x1e9441=squel[_0x91cb('0x6c')]();_0x1e9441[_0x91cb('0x6d')](_0x2ab5a3[_0x91cb('0x6e')]);for(var _0x416390=0x0;_0x416390<_0x10a9f6[_0x91cb('0x36')];_0x416390+=0x1){_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x6f')]?_0x43ad75[_0x10a9f6[_0x416390]['MetricId']][_0x91cb('0x70')]:_0x10a9f6[_0x416390][_0x91cb('0x64')];_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x71')]?_[_0x91cb('0x72')](_0x154e6a[_0x10a9f6[_0x416390]['function']],'%s',_0x469e62):_0x469e62;_0x469e62=_0x10a9f6[_0x416390][_0x91cb('0x73')]?_['replace'](_0x2a05af[_0x10a9f6[_0x416390][_0x91cb('0x73')]],'%s',_0x469e62):_0x469e62;if(_0x10a9f6[_0x416390][_0x91cb('0x87')]){_0x1e9441[_0x91cb('0x63')](_0x469e62);}_0x10a9f6[_0x416390][_0x91cb('0x74')]&&_0x1e9441[_0x91cb('0x75')](_0x469e62,_0x10a9f6[_0x416390]['orderBy']===_0x91cb('0x76')?![]:!![]);_0x1e9441['field'](_0x469e62,_0x10a9f6[_0x416390]['alias']||_0x469e62);}if(_0x2ab5a3[_0x91cb('0x77')]){_0x2ab5a3[_0x91cb('0x77')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x77')]);for(var _0x286ed7=0x0;_0x286ed7<_0x2ab5a3[_0x91cb('0x77')][_0x91cb('0x36')];_0x286ed7+=0x1){if(_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['type']&&_[_0x91cb('0x5d')](_0x3b93c3,_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x2e')])&&_0x2ab5a3['joins'][_0x286ed7]['parentKey']&&_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x7a')]&&_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x79')]){_0x1e9441[_0x2ab5a3['joins'][_0x286ed7][_0x91cb('0x2e')]](_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],null,util[_0x91cb('0x73')]('%s.%s\x20=\x20%s.%s',_0x2ab5a3[_0x91cb('0x6e')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x78')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7][_0x91cb('0x7a')],_0x2ab5a3[_0x91cb('0x77')][_0x286ed7]['foreignKey']));}}}if(_0x2ab5a3[_0x91cb('0x7c')]){_0x2ab5a3[_0x91cb('0x7c')]=JSON[_0x91cb('0x7d')](_0x2ab5a3[_0x91cb('0x7c')]);_0x1e9441[_0x91cb('0x3a')](_0x432099(_0x2ab5a3['conditions'][_0x91cb('0x63')]));}_0x12da14=_0x1e9441[_0x91cb('0xa2')]();_0x1e9441[_0x91cb('0x1c')](_0xe3d97f);_0x1e9441[_0x91cb('0x1b')](0x0);logger[_0x91cb('0xa3')](_0x91cb('0x7e'),_0x1e9441['toString']());return dbH[_0x91cb('0x7f')][_0x91cb('0x31')](_0x1e9441[_0x91cb('0x80')](),{'type':dbH['sequelize'][_0x91cb('0x81')]['SELECT']});}})[_0x91cb('0x23')](function(){return{'sql':_0x12da14[_0x91cb('0x80')]()};})[_0x91cb('0x23')](respondWithResult(_0x146346,null))[_0x91cb('0x45')](handleError(_0x146346,null));}; \ No newline at end of file +var _0x2ef3=['Sequelize','from','foreignKey','output','web','fullPath','generate','csv','cdr','startDate','endDate','info','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','runReport','IS\x20NULL','IS\x20NOT\x20EMPTY','metric','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','offset','undefined','count','limit','set','Content-Range','apply','save','then','destroy','get','DefaultReports','UserProfileResource','end','error','stack','name','send','index','map','rawAttributes','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','AnalyticDefaultReport','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','autoAssociation','update','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20EMPTY','operator','rules','group','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','conditions','parse','clone','debug','toString','sequelize','QueryTypes','SELECT','join','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x2ef3,0xba));var _0x32ef=function(_0x1b5771,_0x116da0){_0x1b5771=_0x1b5771-0x0;var _0x320539=_0x2ef3[_0x1b5771];return _0x320539;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];var dbH=require(_0x32ef('0x18'))['dbH'];function respondWithStatusCode(_0x3e98df,_0x1ef1ae){_0x1ef1ae=_0x1ef1ae||0xcc;return function(_0x5c3eb9){if(_0x5c3eb9){return _0x3e98df['sendStatus'](_0x1ef1ae);}return _0x3e98df[_0x32ef('0x19')](_0x1ef1ae)['end']();};}function respondWithResult(_0x326fce,_0x40a6e6){_0x40a6e6=_0x40a6e6||0xc8;return function(_0x93d492){if(_0x93d492){return _0x326fce[_0x32ef('0x19')](_0x40a6e6)['json'](_0x93d492);}};}function respondWithFilteredResult(_0x55bf0b,_0x531e30){return function(_0x13db1a){if(_0x13db1a){var _0x3950e6=typeof _0x531e30[_0x32ef('0x1a')]==='undefined'&&typeof _0x531e30['limit']===_0x32ef('0x1b');var _0x1a9476=_0x13db1a[_0x32ef('0x1c')];var _0x57863c=_0x3950e6?0x0:_0x531e30[_0x32ef('0x1a')];var _0x33e230=_0x3950e6?_0x13db1a['count']:_0x531e30[_0x32ef('0x1a')]+_0x531e30[_0x32ef('0x1d')];var _0x26aff3;if(_0x33e230>=_0x1a9476){_0x33e230=_0x1a9476;_0x26aff3=0xc8;}else{_0x26aff3=0xce;}_0x55bf0b[_0x32ef('0x19')](_0x26aff3);return _0x55bf0b[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57863c+'-'+_0x33e230+'/'+_0x1a9476)['json'](_0x13db1a);}return null;};}function patchUpdates(_0x3c5b78){return function(_0x5cc3ef){try{jsonpatch[_0x32ef('0x20')](_0x5cc3ef,_0x3c5b78,!![]);}catch(_0x3a20ca){return BPromise['reject'](_0x3a20ca);}return _0x5cc3ef[_0x32ef('0x21')]();};}function saveUpdates(_0x97780,_0x5e8898){return function(_0x55f7f2){if(_0x55f7f2){return _0x55f7f2['update'](_0x97780)[_0x32ef('0x22')](function(_0xb30fab){return _0xb30fab;});}return null;};}function removeEntity(_0x225feb,_0x478bef){return function(_0x59585f){if(_0x59585f){return _0x59585f[_0x32ef('0x23')]()['then'](function(){var _0x51a412=_0x59585f[_0x32ef('0x24')]({'plain':!![]});var _0x14d4b3=_0x32ef('0x25');return db[_0x32ef('0x26')][_0x32ef('0x23')]({'where':{'type':_0x14d4b3,'resourceId':_0x51a412['id']}})[_0x32ef('0x22')](function(){return _0x59585f;});})[_0x32ef('0x22')](function(){_0x225feb[_0x32ef('0x19')](0xcc)[_0x32ef('0x27')]();});}};}function handleEntityNotFound(_0x2f52d7,_0x1335e2){return function(_0xba4b3f){if(!_0xba4b3f){_0x2f52d7['sendStatus'](0x194);}return _0xba4b3f;};}function handleError(_0xd65fde,_0x2f5d06){_0x2f5d06=_0x2f5d06||0x1f4;return function(_0x5a04cd){logger[_0x32ef('0x28')](_0x5a04cd[_0x32ef('0x29')]);if(_0x5a04cd[_0x32ef('0x2a')]){delete _0x5a04cd[_0x32ef('0x2a')];}_0xd65fde['status'](_0x2f5d06)[_0x32ef('0x2b')](_0x5a04cd);};}exports[_0x32ef('0x2c')]=function(_0x31dbc3,_0x2ac686){var _0x1b668a={},_0x1a6ed2={},_0x1a122d={'count':0x0,'rows':[]};var _0x575f3e=_[_0x32ef('0x2d')](db['AnalyticDefaultReport'][_0x32ef('0x2e')],function(_0x2b6c6a){return{'name':_0x2b6c6a['fieldName'],'type':_0x2b6c6a[_0x32ef('0x2f')][_0x32ef('0x30')]};});_0x1a6ed2[_0x32ef('0x31')]=_[_0x32ef('0x2d')](_0x575f3e,_0x32ef('0x2a'));_0x1a6ed2['query']=_['keys'](_0x31dbc3[_0x32ef('0x32')]);_0x1a6ed2['filters']=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],_0x1a6ed2[_0x32ef('0x32')]);_0x1b668a[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x1a6ed2[_0x32ef('0x31')],qs['fields'](_0x31dbc3['query']['fields']));_0x1b668a[_0x32ef('0x34')]=_0x1b668a[_0x32ef('0x34')][_0x32ef('0x35')]?_0x1b668a['attributes']:_0x1a6ed2['model'];if(!_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x36')](_0x32ef('0x37'))){_0x1b668a['limit']=qs['limit'](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1d')]);_0x1b668a[_0x32ef('0x1a')]=qs[_0x32ef('0x1a')](_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x1a')]);}_0x1b668a[_0x32ef('0x38')]=qs[_0x32ef('0x39')](_0x31dbc3[_0x32ef('0x32')]['sort']);_0x1b668a[_0x32ef('0x3a')]=qs[_0x32ef('0x3b')](_[_0x32ef('0x3c')](_0x31dbc3['query'],_0x1a6ed2[_0x32ef('0x3b')]),_0x575f3e);if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x3d')]){_0x1b668a[_0x32ef('0x3a')]=_[_0x32ef('0x3e')](_0x1b668a[_0x32ef('0x3a')],{'$or':_[_0x32ef('0x2d')](_0x575f3e,function(_0x1cebed){if(_0x1cebed[_0x32ef('0x2f')]!==_0x32ef('0x3f')){var _0xb4db74={};_0xb4db74[_0x1cebed[_0x32ef('0x2a')]]={'$like':'%'+_0x31dbc3['query'][_0x32ef('0x3d')]+'%'};return _0xb4db74;}})});}_0x1b668a=_[_0x32ef('0x3e')]({},_0x1b668a,_0x31dbc3[_0x32ef('0x40')]);var _0x1733e3={'where':_0x1b668a[_0x32ef('0x3a')]};return db[_0x32ef('0x41')][_0x32ef('0x1c')](_0x1733e3)['then'](function(_0x538758){_0x1a122d[_0x32ef('0x1c')]=_0x538758;if(_0x31dbc3[_0x32ef('0x32')][_0x32ef('0x42')]){_0x1b668a[_0x32ef('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x32ef('0x44')](_0x1b668a);})[_0x32ef('0x22')](function(_0x5d2f06){_0x1a122d[_0x32ef('0x45')]=_0x5d2f06;return _0x1a122d;})['then'](respondWithFilteredResult(_0x2ac686,_0x1b668a))[_0x32ef('0x46')](handleError(_0x2ac686,null));};exports[_0x32ef('0x47')]=function(_0x37a497,_0x3be46d){var _0x2c2b62={'raw':!![],'where':{'id':_0x37a497[_0x32ef('0x48')]['id']}},_0x2310ae={};_0x2310ae[_0x32ef('0x31')]=_[_0x32ef('0x49')](db[_0x32ef('0x41')]['rawAttributes']);_0x2310ae[_0x32ef('0x32')]=_['keys'](_0x37a497[_0x32ef('0x32')]);_0x2310ae[_0x32ef('0x3b')]=_[_0x32ef('0x33')](_0x2310ae['model'],_0x2310ae[_0x32ef('0x32')]);_0x2c2b62[_0x32ef('0x34')]=_[_0x32ef('0x33')](_0x2310ae[_0x32ef('0x31')],qs[_0x32ef('0x4a')](_0x37a497[_0x32ef('0x32')][_0x32ef('0x4a')]));_0x2c2b62['attributes']=_0x2c2b62['attributes'][_0x32ef('0x35')]?_0x2c2b62[_0x32ef('0x34')]:_0x2310ae[_0x32ef('0x31')];if(_0x37a497[_0x32ef('0x32')][_0x32ef('0x42')]){_0x2c2b62[_0x32ef('0x43')]=[{'all':!![]}];}_0x2c2b62=_[_0x32ef('0x3e')]({},_0x2c2b62,_0x37a497[_0x32ef('0x40')]);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2c2b62)[_0x32ef('0x22')](handleEntityNotFound(_0x3be46d,null))[_0x32ef('0x22')](respondWithResult(_0x3be46d,null))[_0x32ef('0x46')](handleError(_0x3be46d,null));};exports['create']=function(_0x420f00,_0x12fbd7){return db[_0x32ef('0x41')][_0x32ef('0x4c')](_0x420f00[_0x32ef('0x4d')],{})[_0x32ef('0x22')](function(_0x278696){var _0x1acded=_0x420f00[_0x32ef('0x4e')][_0x32ef('0x24')]({'plain':!![]});if(!_0x1acded)throw new Error(_0x32ef('0x4f'));if(_0x1acded[_0x32ef('0x50')]===_0x32ef('0x4e')){var _0x326445=_0x278696[_0x32ef('0x24')]({'plain':!![]});var _0x3fb4d8=_0x32ef('0x51');return db[_0x32ef('0x52')]['find']({'where':{'name':_0x3fb4d8,'userProfileId':_0x1acded['userProfileId']},'raw':!![]})[_0x32ef('0x22')](function(_0x259c32){if(_0x259c32&&_0x259c32[_0x32ef('0x53')]===0x0){return db[_0x32ef('0x26')][_0x32ef('0x4c')]({'name':_0x326445[_0x32ef('0x2a')],'resourceId':_0x326445['id'],'type':_0x32ef('0x25'),'sectionId':_0x259c32['id']},{})[_0x32ef('0x22')](function(){return _0x278696;});}else{return _0x278696;}})[_0x32ef('0x46')](function(_0x368bf1){logger[_0x32ef('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x368bf1);throw _0x368bf1;});}return _0x278696;})[_0x32ef('0x22')](respondWithResult(_0x12fbd7,0xc9))[_0x32ef('0x46')](handleError(_0x12fbd7,null));};exports[_0x32ef('0x54')]=function(_0x3fe01f,_0x38314a){if(_0x3fe01f[_0x32ef('0x4d')]['id']){delete _0x3fe01f['body']['id'];}return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x3fe01f[_0x32ef('0x48')]['id']}})['then'](handleEntityNotFound(_0x38314a,null))[_0x32ef('0x22')](saveUpdates(_0x3fe01f['body'],null))[_0x32ef('0x22')](respondWithResult(_0x38314a,null))[_0x32ef('0x46')](handleError(_0x38314a,null));};exports['destroy']=function(_0x206ad5,_0x59e5f9){return db[_0x32ef('0x41')][_0x32ef('0x4b')]({'where':{'id':_0x206ad5[_0x32ef('0x48')]['id']}})[_0x32ef('0x22')](handleEntityNotFound(_0x59e5f9,null))[_0x32ef('0x22')](removeEntity(_0x59e5f9,null))[_0x32ef('0x46')](handleError(_0x59e5f9,null));};exports[_0x32ef('0x55')]=function(_0x56260f,_0x56cc75){var _0xdfa103=0xa;var _0x52232a=['join',_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0x6aae59={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0xbd059e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2ac877=function(_0x3c31d0){return!_[_0x32ef('0x63')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x3c31d0);};var _0x17f447=function(_0x5bb114){if(!_0x5bb114||!_0x5bb114['rules'][_0x32ef('0x35')]){return'';}for(var _0x208989='(',_0x10cb37=0x0;_0x10cb37<_0x5bb114['rules'][_0x32ef('0x35')];_0x10cb37+=0x1){_0x10cb37>0x0&&(_0x208989+='\x20'+_0x5bb114[_0x32ef('0x65')]+'\x20');_0x208989+=_0x5bb114[_0x32ef('0x66')][_0x10cb37]['group']?_0x17f447(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x67')]):_0x5bb114['rules'][_0x10cb37]['field']+'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')]+(_0x2ac877(_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x68')])?'\x20'+_0x5bb114[_0x32ef('0x66')][_0x10cb37][_0x32ef('0x69')]:'');}return _0x208989+')';};var _0x4c89e8={'where':{'id':_0x56260f[_0x32ef('0x48')]['id']}},_0x285330,_0x63b65,_0x25b6d6,_0x36ed97,_0x21e930;_0x4c89e8=_[_0x32ef('0x3e')]({},_0x4c89e8,_0x56260f[_0x32ef('0x40')]);return db[_0x32ef('0x41')]['find'](_0x4c89e8)[_0x32ef('0x22')](function(_0x29ff58){if(_0x29ff58){_0x285330=_0x29ff58;return _0x29ff58[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0x79ae28){if(_0x79ae28){if(!_0x79ae28['length']){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x63b65=_0x79ae28;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x526fb1){if(_0x526fb1){_0x25b6d6=_[_0x32ef('0x6e')](_0x526fb1,'id');var _0x544045;var _0x216e2f=squel[_0x32ef('0x6f')]();_0x216e2f['from'](_0x285330['table']);for(var _0x2c9f7a=0x0;_0x2c9f7a<_0x63b65[_0x32ef('0x35')];_0x2c9f7a+=0x1){_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x70')]?_0x25b6d6[_0x63b65[_0x2c9f7a]['MetricId']]['metric']:_0x63b65[_0x2c9f7a][_0x32ef('0x71')];_0x544045=_0x63b65[_0x2c9f7a][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x6aae59[_0x63b65[_0x2c9f7a][_0x32ef('0x72')]],'%s',_0x544045):_0x544045;_0x544045=_0x63b65[_0x2c9f7a]['format']?_[_0x32ef('0x73')](_0xbd059e[_0x63b65[_0x2c9f7a][_0x32ef('0x74')]],'%s',_0x544045):_0x544045;if(_0x63b65[_0x2c9f7a][_0x32ef('0x75')]){_0x216e2f[_0x32ef('0x67')](_0x544045);}_0x63b65[_0x2c9f7a][_0x32ef('0x76')]&&_0x216e2f[_0x32ef('0x38')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x216e2f[_0x32ef('0x71')](_0x544045,_0x63b65[_0x2c9f7a][_0x32ef('0x78')]||_0x544045);}if(_0x285330[_0x32ef('0x79')]){_0x285330[_0x32ef('0x79')]=JSON['parse'](_0x285330['joins']);for(var _0x3a9c97=0x0;_0x3a9c97<_0x285330[_0x32ef('0x79')]['length'];_0x3a9c97+=0x1){if(_0x285330[_0x32ef('0x79')][_0x3a9c97]['type']&&_[_0x32ef('0x63')](_0x52232a,_0x285330[_0x32ef('0x79')][_0x3a9c97][_0x32ef('0x2f')])&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7a')]&&_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')]&&_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']){_0x216e2f[_0x285330['joins'][_0x3a9c97][_0x32ef('0x2f')]](_0x285330['joins'][_0x3a9c97][_0x32ef('0x7b')],null,util['format'](_0x32ef('0x7c'),_0x285330[_0x32ef('0x7d')],_0x285330[_0x32ef('0x79')][_0x3a9c97]['parentKey'],_0x285330['joins'][_0x3a9c97]['foreignTable'],_0x285330[_0x32ef('0x79')][_0x3a9c97]['foreignKey']));}}}if(_0x285330[_0x32ef('0x7e')]){_0x285330[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x285330[_0x32ef('0x7e')]);_0x216e2f[_0x32ef('0x3a')](_0x17f447(_0x285330[_0x32ef('0x7e')]['group']));}_0x21e930=_0x216e2f[_0x32ef('0x80')]();_0x216e2f['limit'](_0xdfa103);_0x216e2f['offset'](0x0);logger[_0x32ef('0x81')]('Limited\x20Query:',_0x216e2f[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')]['query'](_0x216e2f[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')][_0x32ef('0x84')][_0x32ef('0x85')]});}})[_0x32ef('0x22')](respondWithResult(_0x56cc75,null))[_0x32ef('0x46')](handleError(_0x56cc75,null));};function runReport(_0x4b5506,_0x51736f,_0x35b10d){var _0x5e0b55=_0x51736f[_0x32ef('0x2a')];var _0x266688=0xa;var _0x114d8e=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),'cross_join'];var _0x3232ca={'SUM':_0x32ef('0x59'),'COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':_0x32ef('0x88'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x211fb1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0xfb4845=function(_0x21067e){return!_[_0x32ef('0x63')](['IS\x20NULL',_0x32ef('0x8b'),_0x32ef('0x64'),'IS\x20NOT\x20EMPTY'],_0x21067e);};var _0x35653b=function(_0x5ea727){if(!_0x5ea727||!_0x5ea727[_0x32ef('0x66')]['length']){return'';}for(var _0x43f36e='(',_0x39300f=0x0;_0x39300f<_0x5ea727[_0x32ef('0x66')][_0x32ef('0x35')];_0x39300f+=0x1){_0x39300f>0x0&&(_0x43f36e+='\x20'+_0x5ea727['operator']+'\x20');_0x43f36e+=_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x67')]?_0x35653b(_0x5ea727[_0x32ef('0x66')][_0x39300f]['group']):_0x5ea727['rules'][_0x39300f]['field']+'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')]+(_0xfb4845(_0x5ea727[_0x32ef('0x66')][_0x39300f][_0x32ef('0x68')])?'\x20'+_0x5ea727[_0x32ef('0x66')][_0x39300f]['value']:'');}return _0x43f36e+')';};var _0x2678e3={'where':{'id':_0x4b5506['id']}},_0x5b3deb,_0x471de6,_0x7b0ea5,_0xc43e1,_0x4baa7a;_0x2678e3=_[_0x32ef('0x3e')]({},_0x2678e3,_0x35b10d);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x2678e3)[_0x32ef('0x22')](function(_0x28bebb){if(_0x28bebb){_0x5b3deb=_0x28bebb;return _0x28bebb['getFields']();}return null;})[_0x32ef('0x22')](function(_0x484df0){if(_0x484df0){if(!_0x484df0[_0x32ef('0x35')]){throw new db[(_0x32ef('0x8c'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x471de6=_0x484df0;return db[_0x32ef('0x6d')][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x3b9896){if(_0x3b9896){_0x7b0ea5=_['keyBy'](_0x3b9896,'id');var _0x356fd4;var _0x51ca6e=squel['select']();_0x51ca6e[_0x32ef('0x8d')](_0x5b3deb['table']);for(var _0x2237cf=0x0;_0x2237cf<_0x471de6[_0x32ef('0x35')];_0x2237cf+=0x1){_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x70')]?_0x7b0ea5[_0x471de6[_0x2237cf]['MetricId']]['metric']:_0x471de6[_0x2237cf][_0x32ef('0x71')];_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x72')]?_[_0x32ef('0x73')](_0x3232ca[_0x471de6[_0x2237cf][_0x32ef('0x72')]],'%s',_0x356fd4):_0x356fd4;_0x356fd4=_0x471de6[_0x2237cf][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x211fb1[_0x471de6[_0x2237cf][_0x32ef('0x74')]],'%s',_0x356fd4):_0x356fd4;if(_0x471de6[_0x2237cf]['groupBy']){_0x51ca6e[_0x32ef('0x67')](_0x356fd4);}_0x471de6[_0x2237cf][_0x32ef('0x76')]&&_0x51ca6e[_0x32ef('0x38')](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x76')]==='DESC'?![]:!![]);_0x51ca6e['field'](_0x356fd4,_0x471de6[_0x2237cf][_0x32ef('0x78')]||_0x356fd4);}if(_0x5b3deb['joins']){_0x5b3deb[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x5b3deb['joins']);for(var _0x5c7594=0x0;_0x5c7594<_0x5b3deb['joins'][_0x32ef('0x35')];_0x5c7594+=0x1){if(_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x2f')]&&_[_0x32ef('0x63')](_0x114d8e,_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x2f')])&&_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')]&&_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x8e')]){_0x51ca6e[_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['type']](_0x5b3deb['joins'][_0x5c7594][_0x32ef('0x7b')],null,util[_0x32ef('0x74')](_0x32ef('0x7c'),_0x5b3deb[_0x32ef('0x7d')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7a')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594][_0x32ef('0x7b')],_0x5b3deb[_0x32ef('0x79')][_0x5c7594]['foreignKey']));}}}if(_0x5b3deb[_0x32ef('0x7e')]){_0x5b3deb['conditions']=JSON[_0x32ef('0x7f')](_0x5b3deb[_0x32ef('0x7e')]);_0x51ca6e[_0x32ef('0x3a')](_0x35653b(_0x5b3deb[_0x32ef('0x7e')][_0x32ef('0x67')]));}_0x4baa7a=_0x51ca6e['clone']();_0x51ca6e[_0x32ef('0x1d')](_0x266688);_0x51ca6e[_0x32ef('0x1a')](0x0);return;}})[_0x32ef('0x22')](function(){if(_0x51736f[_0x32ef('0x8f')]===_0x32ef('0x90')){return null;}var _0x1cfdd8=_[_0x32ef('0x3e')](_0x51736f,{'name':_0x51736f[_0x32ef('0x91')]||_0x51736f[_0x32ef('0x2a')]||_0x5b3deb['name'],'basename':_0x5e0b55,'savename':util['format']('%s-%s.%s',_0x51736f[_0x32ef('0x2a')]||_0x5b3deb[_0x32ef('0x2a')],require('randomstring')[_0x32ef('0x92')](0x4),_0x51736f['output']||_0x32ef('0x93')),'reportId':_0x5b3deb['id'],'reportType':'default'});return db['AnalyticExtractedReport'][_0x32ef('0x4c')](_0x1cfdd8,{'raw':!![]});})[_0x32ef('0x22')](function(_0x118d2e){if(_0x5b3deb[_0x32ef('0x7d')]===_0x32ef('0x94')){_0x4baa7a['where'](_0x5b3deb[_0x32ef('0x7d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x51736f[_0x32ef('0x95')],_0x51736f['endDate']);}else{_0x4baa7a['where'](_0x5b3deb['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51736f['startDate'],_0x51736f[_0x32ef('0x96')]);}if(_0x118d2e){logger[_0x32ef('0x97')]('Run\x20Query:',_0x4baa7a[_0x32ef('0x82')]());require(_0x32ef('0x98'))[_0x32ef('0x99')](path[_0x32ef('0x86')](__dirname,_0x32ef('0x9a'),_0x118d2e[_0x32ef('0x8f')]),[_0x118d2e['id'],_0x4baa7a['toString'](),path[_0x32ef('0x86')](__dirname,'../../files/reports',_0x118d2e[_0x32ef('0x9b')]),_0x5e0b55]);return _0x118d2e;}else{var _0x1be713=squel['select']();_0x1be713[_0x32ef('0x8d')]('('+_0x4baa7a['toString']()+')',_0x32ef('0x9c'));_0x1be713[_0x32ef('0x71')](_0x32ef('0x9d'),_0x32ef('0x1c'));_0x4baa7a['limit'](_0x51736f[_0x32ef('0x1d')]||_0x266688);_0x4baa7a[_0x32ef('0x1a')](_0x51736f[_0x32ef('0x1a')]||0x0);return dbH[_0x32ef('0x83')]['query'](_0x1be713[_0x32ef('0x82')](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]})[_0x32ef('0x22')](function(_0x28ef17){if(!_0x28ef17[_0x32ef('0x35')]){_0xc43e1=0x0;}else{_0xc43e1=_0x28ef17[0x0][_0x32ef('0x1c')]||0x0;}return dbH['sequelize'][_0x32ef('0x32')](_0x4baa7a['toString'](),{'type':dbH['sequelize'][_0x32ef('0x84')][_0x32ef('0x85')]});})[_0x32ef('0x22')](function(_0x3956e7){return{'rows':_0x3956e7||[],'count':_0xc43e1};});}});}exports['run']=function(_0x8d3b24,_0x642716){return runReport(_0x8d3b24[_0x32ef('0x48')],_0x8d3b24[_0x32ef('0x32')],_0x8d3b24['options'])['then'](respondWithResult(_0x642716,null))['catch'](handleError(_0x642716,null));};exports[_0x32ef('0x9e')]=runReport;exports[_0x32ef('0x32')]=function(_0x4454f3,_0xc92dcc){var _0x3d18b9=0xa;var _0x9233cb=[_0x32ef('0x86'),_0x32ef('0x56'),_0x32ef('0x57'),_0x32ef('0x58')];var _0xa76912={'SUM':'SUM(%s)','COUNT':_0x32ef('0x5a'),'COUNT DISTINCT':_0x32ef('0x5b'),'MAX':_0x32ef('0x5c'),'MIN':_0x32ef('0x5d'),'AVG':_0x32ef('0x5e'),'GROUP_CONCAT':_0x32ef('0x87'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x32ef('0x5f')};var _0x1526a1={'SEC_TO_TIME':_0x32ef('0x89'),'DATE':_0x32ef('0x60'),'HOUR':_0x32ef('0x61'),'ROUND':_0x32ef('0x62'),'UNIX_TIMESTAMP':_0x32ef('0x8a')};var _0x2d4d2f=function(_0x292488){return!_[_0x32ef('0x63')]([_0x32ef('0x9f'),_0x32ef('0x8b'),_0x32ef('0x64'),_0x32ef('0xa0')],_0x292488);};var _0x50b674=function(_0x379d40){if(!_0x379d40||!_0x379d40[_0x32ef('0x66')][_0x32ef('0x35')]){return'';}for(var _0x4b7a4d='(',_0x16525b=0x0;_0x16525b<_0x379d40['rules'][_0x32ef('0x35')];_0x16525b+=0x1){_0x16525b>0x0&&(_0x4b7a4d+='\x20'+_0x379d40[_0x32ef('0x65')]+'\x20');_0x4b7a4d+=_0x379d40[_0x32ef('0x66')][_0x16525b]['group']?_0x50b674(_0x379d40[_0x32ef('0x66')][_0x16525b]['group']):_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x71')]+'\x20'+_0x379d40['rules'][_0x16525b][_0x32ef('0x68')]+(_0x2d4d2f(_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x68')])?'\x20'+_0x379d40[_0x32ef('0x66')][_0x16525b][_0x32ef('0x69')]:'');}return _0x4b7a4d+')';};var _0x264075={'where':{'id':_0x4454f3[_0x32ef('0x48')]['id']}},_0x3798d1,_0x4befa9,_0x493ae9,_0x143d39,_0x497948;_0x264075=_[_0x32ef('0x3e')]({},_0x264075,_0x4454f3['options']);return db[_0x32ef('0x41')][_0x32ef('0x4b')](_0x264075)['then'](function(_0x1200c9){if(_0x1200c9){_0x3798d1=_0x1200c9;return _0x1200c9[_0x32ef('0x6a')]();}return null;})[_0x32ef('0x22')](function(_0xa5f787){if(_0xa5f787){if(!_0xa5f787[_0x32ef('0x35')]){throw new db['Sequelize'][(_0x32ef('0x6b'))](_0x32ef('0x6c'),0x193);}_0x4befa9=_0xa5f787;return db['AnalyticMetric'][_0x32ef('0x44')]({'raw':!![]});}return null;})[_0x32ef('0x22')](function(_0x55ad11){if(_0x55ad11){_0x493ae9=_[_0x32ef('0x6e')](_0x55ad11,'id');var _0x2971a8;var _0x522c22=squel[_0x32ef('0x6f')]();_0x522c22[_0x32ef('0x8d')](_0x3798d1['table']);for(var _0xb41a01=0x0;_0xb41a01<_0x4befa9[_0x32ef('0x35')];_0xb41a01+=0x1){_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x70')]?_0x493ae9[_0x4befa9[_0xb41a01][_0x32ef('0x70')]][_0x32ef('0xa1')]:_0x4befa9[_0xb41a01][_0x32ef('0x71')];_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x72')]?_['replace'](_0xa76912[_0x4befa9[_0xb41a01]['function']],'%s',_0x2971a8):_0x2971a8;_0x2971a8=_0x4befa9[_0xb41a01][_0x32ef('0x74')]?_[_0x32ef('0x73')](_0x1526a1[_0x4befa9[_0xb41a01][_0x32ef('0x74')]],'%s',_0x2971a8):_0x2971a8;if(_0x4befa9[_0xb41a01]['groupBy']){_0x522c22[_0x32ef('0x67')](_0x2971a8);}_0x4befa9[_0xb41a01][_0x32ef('0x76')]&&_0x522c22['order'](_0x2971a8,_0x4befa9[_0xb41a01][_0x32ef('0x76')]===_0x32ef('0x77')?![]:!![]);_0x522c22['field'](_0x2971a8,_0x4befa9[_0xb41a01]['alias']||_0x2971a8);}if(_0x3798d1[_0x32ef('0x79')]){_0x3798d1[_0x32ef('0x79')]=JSON[_0x32ef('0x7f')](_0x3798d1['joins']);for(var _0x5f4eab=0x0;_0x5f4eab<_0x3798d1['joins'][_0x32ef('0x35')];_0x5f4eab+=0x1){if(_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')]&&_['includes'](_0x9233cb,_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x2f')])&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['parentKey']&&_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')]&&_0x3798d1['joins'][_0x5f4eab]['foreignKey']){_0x522c22[_0x3798d1[_0x32ef('0x79')][_0x5f4eab]['type']](_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3798d1[_0x32ef('0x7d')],_0x3798d1['joins'][_0x5f4eab][_0x32ef('0x7a')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x7b')],_0x3798d1[_0x32ef('0x79')][_0x5f4eab][_0x32ef('0x8e')]));}}}if(_0x3798d1[_0x32ef('0x7e')]){_0x3798d1[_0x32ef('0x7e')]=JSON[_0x32ef('0x7f')](_0x3798d1[_0x32ef('0x7e')]);_0x522c22[_0x32ef('0x3a')](_0x50b674(_0x3798d1['conditions']['group']));}_0x497948=_0x522c22[_0x32ef('0x80')]();_0x522c22[_0x32ef('0x1d')](_0x3d18b9);_0x522c22[_0x32ef('0x1a')](0x0);logger[_0x32ef('0x81')](_0x32ef('0xa2'),_0x522c22[_0x32ef('0x82')]());return dbH[_0x32ef('0x83')][_0x32ef('0x32')](_0x522c22[_0x32ef('0x82')](),{'type':dbH[_0x32ef('0x83')]['QueryTypes'][_0x32ef('0x85')]});}})[_0x32ef('0x22')](function(){return{'sql':_0x497948[_0x32ef('0x82')]()};})[_0x32ef('0x22')](respondWithResult(_0xc92dcc,null))[_0x32ef('0x46')](handleError(_0xc92dcc,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 307ac67..4cc0dc8 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 _0xe561=['define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','bluebird','path','rimraf','./analyticDefaultReport.attributes','exports'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0xe561,0x179));var _0x1e56=function(_0x34ad09,_0xba8f16){_0x34ad09=_0x34ad09-0x0;var _0x4c8431=_0xe561[_0x34ad09];return _0x4c8431;};'use strict';var _=require('lodash');var util=require(_0x1e56('0x0'));var logger=require(_0x1e56('0x1'))(_0x1e56('0x2'));var moment=require('moment');var BPromise=require(_0x1e56('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1e56('0x4'));var rimraf=require(_0x1e56('0x5'));var config=require('../../config/environment');var attributes=require(_0x1e56('0x6'));module[_0x1e56('0x7')]=function(_0x4d61fc,_0xc4dcf7){return _0x4d61fc[_0x1e56('0x8')](_0x1e56('0x9'),attributes,{'tableName':_0x1e56('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeac8=['exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x4bbd93,_0x205605){var _0x669c4=function(_0x12a82f){while(--_0x12a82f){_0x4bbd93['push'](_0x4bbd93['shift']());}};_0x669c4(++_0x205605);}(_0xeac8,0x184));var _0x8eac=function(_0x3a2711,_0x5af498){_0x3a2711=_0x3a2711-0x0;var _0x228c51=_0xeac8[_0x3a2711];return _0x228c51;};'use strict';var _=require('lodash');var util=require(_0x8eac('0x0'));var logger=require(_0x8eac('0x1'))(_0x8eac('0x2'));var moment=require(_0x8eac('0x3'));var BPromise=require(_0x8eac('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8eac('0x5'));var config=require(_0x8eac('0x6'));var attributes=require(_0x8eac('0x7'));module[_0x8eac('0x8')]=function(_0x25de97,_0x5ed729){return _0x25de97[_0x8eac('0x9')](_0x8eac('0xa'),attributes,{'tableName':_0x8eac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 1f1f226..091cddd 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 _0x173b=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','message','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x19307c,_0x4a39e5){var _0x917eaa=function(_0x45f13d){while(--_0x45f13d){_0x19307c['push'](_0x19307c['shift']());}};_0x917eaa(++_0x4a39e5);}(_0x173b,0x183));var _0xb173=function(_0x5dd2ca,_0x224bf6){_0x5dd2ca=_0x5dd2ca-0x0;var _0xdac8d9=_0x173b[_0x5dd2ca];return _0xdac8d9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb173('0x0'));var BPromise=require(_0xb173('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb173('0x2'))['db'];var utils=require(_0xb173('0x3'));var logger=require(_0xb173('0x4'))(_0xb173('0x5'));var config=require('../../config/environment');var jayson=require(_0xb173('0x6'));var client=jayson[_0xb173('0x7')][_0xb173('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2d324d,_0x53329b,_0x4af805){return new BPromise(function(_0x15fce1,_0x55999e){return client[_0xb173('0x9')](_0x2d324d,_0x4af805)[_0xb173('0xa')](function(_0x96ed1a){logger[_0xb173('0xb')](_0xb173('0xc'),_0x53329b,_0xb173('0xd'));logger[_0xb173('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x53329b,_0xb173('0xd'),JSON['stringify'](_0x96ed1a));if(_0x96ed1a[_0xb173('0xf')]){if(_0x96ed1a[_0xb173('0xf')]['code']===0x1f4){logger[_0xb173('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53329b,_0x96ed1a['error'][_0xb173('0x10')]);return _0x55999e(_0x96ed1a[_0xb173('0xf')]['message']);}logger[_0xb173('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x53329b,_0x96ed1a['error'][_0xb173('0x10')]);return _0x15fce1(_0x96ed1a[_0xb173('0xf')][_0xb173('0x10')]);}else{logger[_0xb173('0xb')](_0xb173('0xc'),_0x53329b,_0xb173('0xd'));_0x15fce1(_0x96ed1a['result'][_0xb173('0x10')]);}})[_0xb173('0x11')](function(_0x4380e7){logger[_0xb173('0xf')](_0xb173('0xc'),_0x53329b,_0x4380e7);_0x55999e(_0x4380e7);});});} \ No newline at end of file +var _0x06f7=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x275cfd,_0x3183b8){var _0x21e837=function(_0x539df5){while(--_0x539df5){_0x275cfd['push'](_0x275cfd['shift']());}};_0x21e837(++_0x3183b8);}(_0x06f7,0xb3));var _0x706f=function(_0x1ee9a1,_0x5f1434){_0x1ee9a1=_0x1ee9a1-0x0;var _0x21270f=_0x06f7[_0x1ee9a1];return _0x21270f;};'use strict';var _=require(_0x706f('0x0'));var util=require(_0x706f('0x1'));var moment=require(_0x706f('0x2'));var BPromise=require(_0x706f('0x3'));var rs=require(_0x706f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x706f('0x5'))['db'];var utils=require(_0x706f('0x6'));var logger=require(_0x706f('0x7'))(_0x706f('0x8'));var config=require(_0x706f('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x706f('0xa')][_0x706f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb89b6c,_0x5c818a,_0x3491f9){return new BPromise(function(_0x22e8ef,_0x4d247a){return client[_0x706f('0xc')](_0xb89b6c,_0x3491f9)[_0x706f('0xd')](function(_0x4460f4){logger[_0x706f('0xe')](_0x706f('0xf'),_0x5c818a,'request\x20sent');logger[_0x706f('0x10')](_0x706f('0x11'),_0x5c818a,_0x706f('0x12'),JSON[_0x706f('0x13')](_0x4460f4));if(_0x4460f4[_0x706f('0x14')]){if(_0x4460f4[_0x706f('0x14')][_0x706f('0x15')]===0x1f4){logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x4460f4[_0x706f('0x14')]['message']);return _0x4d247a(_0x4460f4[_0x706f('0x14')]['message']);}logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x4460f4[_0x706f('0x14')][_0x706f('0x16')]);return _0x22e8ef(_0x4460f4[_0x706f('0x14')][_0x706f('0x16')]);}else{logger['info'](_0x706f('0xf'),_0x5c818a,_0x706f('0x12'));_0x22e8ef(_0x4460f4[_0x706f('0x17')]['message']);}})[_0x706f('0x18')](function(_0x1699d1){logger[_0x706f('0x14')](_0x706f('0xf'),_0x5c818a,_0x1699d1);_0x4d247a(_0x1699d1);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 4be67f2..da6b4b5 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 _0xa729=['multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','/:id/query','query','create','put','delete','destroy'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0xa729,0x160));var _0x9a72=function(_0x294ee4,_0x3773a9){_0x294ee4=_0x294ee4-0x0;var _0x1a3f59=_0xa729[_0x294ee4];return _0x1a3f59;};'use strict';var multer=require(_0x9a72('0x0'));var util=require(_0x9a72('0x1'));var path=require(_0x9a72('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a72('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9a72('0x4'));var interaction=require(_0x9a72('0x5'));var config=require(_0x9a72('0x6'));var controller=require(_0x9a72('0x7'));router[_0x9a72('0x8')]('/',auth[_0x9a72('0x9')](),controller[_0x9a72('0xa')]);router[_0x9a72('0x8')](_0x9a72('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0x9a72('0xc'),auth[_0x9a72('0x9')](),controller[_0x9a72('0xd')]);router[_0x9a72('0x8')](_0x9a72('0xe'),auth[_0x9a72('0x9')](),controller[_0x9a72('0xf')]);router[_0x9a72('0x8')](_0x9a72('0x10'),auth[_0x9a72('0x9')](),controller[_0x9a72('0x11')]);router['post']('/',auth[_0x9a72('0x9')](),controller[_0x9a72('0x12')]);router[_0x9a72('0x13')]('/:id',auth[_0x9a72('0x9')](),controller['update']);router[_0x9a72('0x14')](_0x9a72('0xb'),auth['isAuthenticated'](),controller[_0x9a72('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8df7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','show','/:id/preview','preview','run','query','post','create','put','/:id','delete','destroy','multer','util'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0x8df7,0xfb));var _0x78df=function(_0x5aa637,_0x4c6695){_0x5aa637=_0x5aa637-0x0;var _0x9df395=_0x8df7[_0x5aa637];return _0x9df395;};'use strict';var multer=require(_0x78df('0x0'));var util=require(_0x78df('0x1'));var path=require(_0x78df('0x2'));var timeout=require(_0x78df('0x3'));var express=require(_0x78df('0x4'));var router=express[_0x78df('0x5')]();var fs_extra=require(_0x78df('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x78df('0x7'));var config=require(_0x78df('0x8'));var controller=require(_0x78df('0x9'));router[_0x78df('0xa')]('/',auth[_0x78df('0xb')](),controller['index']);router[_0x78df('0xa')]('/:id',auth[_0x78df('0xb')](),controller[_0x78df('0xc')]);router['get'](_0x78df('0xd'),auth[_0x78df('0xb')](),controller[_0x78df('0xe')]);router[_0x78df('0xa')]('/:id/run',auth[_0x78df('0xb')](),controller[_0x78df('0xf')]);router['get']('/:id/query',auth[_0x78df('0xb')](),controller[_0x78df('0x10')]);router[_0x78df('0x11')]('/',auth['isAuthenticated'](),controller[_0x78df('0x12')]);router[_0x78df('0x13')](_0x78df('0x14'),auth[_0x78df('0xb')](),controller['update']);router[_0x78df('0x15')](_0x78df('0x14'),auth[_0x78df('0xb')](),controller[_0x78df('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 1912906..14f30d6 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 _0x4e65=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','DATE','manual','INTEGER'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x4e65,0xfb));var _0x54e6=function(_0x5b6cda,_0x1e546c){_0x5b6cda=_0x5b6cda-0x0;var _0x55e5c8=_0x4e65[_0x5b6cda];return _0x55e5c8;};'use strict';var Sequelize=require(_0x54e6('0x0'));var moment=require(_0x54e6('0x1'));module[_0x54e6('0x2')]={'name':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x54e6('0x4')](_0x54e6('0x5'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0x54e6('0x5')},'savename':{'type':Sequelize[_0x54e6('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x54e6('0x6')]},'status':{'type':Sequelize[_0x54e6('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM'](_0x54e6('0x7'),'scheduled'),'allowNull':![],'defaultValue':_0x54e6('0x7')},'reportId':{'type':Sequelize[_0x54e6('0x8')](0xb)[_0x54e6('0x9')]},'reportType':{'type':Sequelize[_0x54e6('0x3')]}}; \ No newline at end of file +var _0x8739=['UNSIGNED','sequelize','moment','exports','STRING','csv','pdf','xlsx','DATE','scheduled','manual','INTEGER'];(function(_0x4c1f6b,_0x5b3e78){var _0x551c7a=function(_0x27234c){while(--_0x27234c){_0x4c1f6b['push'](_0x4c1f6b['shift']());}};_0x551c7a(++_0x5b3e78);}(_0x8739,0xfd));var _0x9873=function(_0x5d0114,_0x2f2cc7){_0x5d0114=_0x5d0114-0x0;var _0x31b6e0=_0x8739[_0x5d0114];return _0x31b6e0;};'use strict';var Sequelize=require(_0x9873('0x0'));var moment=require(_0x9873('0x1'));module[_0x9873('0x2')]={'name':{'type':Sequelize[_0x9873('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x9873('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM'](_0x9873('0x4'),_0x9873('0x5'),_0x9873('0x6')),'allowNull':![],'defaultValue':_0x9873('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x9873('0x7')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize['ENUM']('manual',_0x9873('0x8')),'allowNull':![],'defaultValue':_0x9873('0x9')},'reportId':{'type':Sequelize[_0x9873('0xa')](0xb)[_0x9873('0xb')]},'reportType':{'type':Sequelize[_0x9873('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index f2fd5f1..d47c511 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 _0x55eb=['../../mysqldb','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','destroy','ExtractedReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticExtractedReport','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','params','rawAttributes','find','create','body','user','role','get','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util'];(function(_0x50ad5c,_0x554a69){var _0x56e5f9=function(_0x1c9107){while(--_0x1c9107){_0x50ad5c['push'](_0x50ad5c['shift']());}};_0x56e5f9(++_0x554a69);}(_0x55eb,0xac));var _0xb55e=function(_0x14ad7a,_0x5b826a){_0x14ad7a=_0x14ad7a-0x0;var _0x334dd2=_0x55eb[_0x14ad7a];return _0x334dd2;};'use strict';var emlformat=require(_0xb55e('0x0'));var rimraf=require(_0xb55e('0x1'));var zipdir=require(_0xb55e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb55e('0x3'));var moment=require(_0xb55e('0x4'));var BPromise=require(_0xb55e('0x5'));var Mustache=require('mustache');var util=require(_0xb55e('0x6'));var path=require(_0xb55e('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb55e('0x8'));var fs=require('fs');var fs_extra=require(_0xb55e('0x9'));var _=require(_0xb55e('0xa'));var squel=require('squel');var crypto=require(_0xb55e('0xb'));var jsforce=require(_0xb55e('0xc'));var deskjs=require(_0xb55e('0xd'));var toCsv=require(_0xb55e('0xe'));var querystring=require(_0xb55e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb55e('0x10'));var qs=require(_0xb55e('0x11'));var as=require(_0xb55e('0x12'));var hardwareService=require(_0xb55e('0x13'));var logger=require(_0xb55e('0x14'))(_0xb55e('0x15'));var utils=require('../../config/utils');var config=require(_0xb55e('0x16'));var licenseUtil=require(_0xb55e('0x17'));var db=require(_0xb55e('0x18'))['db'];function respondWithStatusCode(_0x43af48,_0x26d955){_0x26d955=_0x26d955||0xcc;return function(_0x16e7c3){if(_0x16e7c3){return _0x43af48['sendStatus'](_0x26d955);}return _0x43af48['status'](_0x26d955)[_0xb55e('0x19')]();};}function respondWithResult(_0x43becf,_0x33494d){_0x33494d=_0x33494d||0xc8;return function(_0x273710){if(_0x273710){return _0x43becf[_0xb55e('0x1a')](_0x33494d)[_0xb55e('0x1b')](_0x273710);}};}function respondWithFilteredResult(_0x1ac054,_0x4e9aad){return function(_0x43cd4c){if(_0x43cd4c){var _0x42a503=typeof _0x4e9aad[_0xb55e('0x1c')]==='undefined'&&typeof _0x4e9aad[_0xb55e('0x1d')]===_0xb55e('0x1e');var _0x2bc8d3=_0x43cd4c[_0xb55e('0x1f')];var _0x1c5aec=_0x42a503?0x0:_0x4e9aad[_0xb55e('0x1c')];var _0x46932c=_0x42a503?_0x43cd4c[_0xb55e('0x1f')]:_0x4e9aad[_0xb55e('0x1c')]+_0x4e9aad['limit'];var _0x42b4b1;if(_0x46932c>=_0x2bc8d3){_0x46932c=_0x2bc8d3;_0x42b4b1=0xc8;}else{_0x42b4b1=0xce;}_0x1ac054[_0xb55e('0x1a')](_0x42b4b1);return _0x1ac054[_0xb55e('0x20')](_0xb55e('0x21'),_0x1c5aec+'-'+_0x46932c+'/'+_0x2bc8d3)['json'](_0x43cd4c);}return null;};}function patchUpdates(_0x17a5c1){return function(_0x3e2c41){try{jsonpatch[_0xb55e('0x22')](_0x3e2c41,_0x17a5c1,!![]);}catch(_0xd0600c){return BPromise['reject'](_0xd0600c);}return _0x3e2c41[_0xb55e('0x23')]();};}function saveUpdates(_0x30b70f,_0x2a3c60){return function(_0x551fc5){if(_0x551fc5){return _0x551fc5[_0xb55e('0x24')](_0x30b70f)[_0xb55e('0x25')](function(_0x436394){return _0x436394;});}return null;};}function removeEntity(_0xd5c044,_0x33e1f7){return function(_0x37db75){if(_0x37db75){return _0x37db75[_0xb55e('0x26')]()[_0xb55e('0x25')](function(){var _0x4b4b31=_0x37db75['get']({'plain':!![]});var _0x1b5b40=_0xb55e('0x27');return db[_0xb55e('0x28')]['destroy']({'where':{'type':_0x1b5b40,'resourceId':_0x4b4b31['id']}})[_0xb55e('0x25')](function(){return _0x37db75;});})[_0xb55e('0x25')](function(){_0xd5c044[_0xb55e('0x1a')](0xcc)[_0xb55e('0x19')]();});}};}function handleEntityNotFound(_0x40817c,_0x113fe9){return function(_0x5e87fd){if(!_0x5e87fd){_0x40817c[_0xb55e('0x29')](0x194);}return _0x5e87fd;};}function handleError(_0x60daf4,_0x564d85){_0x564d85=_0x564d85||0x1f4;return function(_0x84a3ca){logger[_0xb55e('0x2a')](_0x84a3ca[_0xb55e('0x2b')]);if(_0x84a3ca['name']){delete _0x84a3ca[_0xb55e('0x2c')];}_0x60daf4['status'](_0x564d85)[_0xb55e('0x2d')](_0x84a3ca);};}exports[_0xb55e('0x2e')]=function(_0x53c668,_0x35ee24){var _0x5c328b={},_0x16991d={},_0x213ef5={'count':0x0,'rows':[]};var _0x226b05=_[_0xb55e('0x2f')](db[_0xb55e('0x30')]['rawAttributes'],function(_0x56be4c){return{'name':_0x56be4c['fieldName'],'type':_0x56be4c[_0xb55e('0x31')][_0xb55e('0x32')]};});_0x16991d['model']=_[_0xb55e('0x2f')](_0x226b05,'name');_0x16991d[_0xb55e('0x33')]=_[_0xb55e('0x34')](_0x53c668[_0xb55e('0x33')]);_0x16991d[_0xb55e('0x35')]=_['intersection'](_0x16991d[_0xb55e('0x36')],_0x16991d[_0xb55e('0x33')]);_0x5c328b[_0xb55e('0x37')]=_[_0xb55e('0x38')](_0x16991d[_0xb55e('0x36')],qs['fields'](_0x53c668[_0xb55e('0x33')][_0xb55e('0x39')]));_0x5c328b['attributes']=_0x5c328b['attributes'][_0xb55e('0x3a')]?_0x5c328b[_0xb55e('0x37')]:_0x16991d[_0xb55e('0x36')];if(!_0x53c668[_0xb55e('0x33')][_0xb55e('0x3b')](_0xb55e('0x3c'))){_0x5c328b[_0xb55e('0x1d')]=qs[_0xb55e('0x1d')](_0x53c668[_0xb55e('0x33')][_0xb55e('0x1d')]);_0x5c328b[_0xb55e('0x1c')]=qs[_0xb55e('0x1c')](_0x53c668[_0xb55e('0x33')][_0xb55e('0x1c')]);}_0x5c328b[_0xb55e('0x3d')]=qs[_0xb55e('0x3e')](_0x53c668['query'][_0xb55e('0x3e')]);_0x5c328b[_0xb55e('0x3f')]=qs[_0xb55e('0x35')](_[_0xb55e('0x40')](_0x53c668[_0xb55e('0x33')],_0x16991d[_0xb55e('0x35')]),_0x226b05);if(_0x53c668[_0xb55e('0x33')][_0xb55e('0x41')]){_0x5c328b[_0xb55e('0x3f')]=_[_0xb55e('0x42')](_0x5c328b['where'],{'$or':_[_0xb55e('0x2f')](_0x226b05,function(_0x36776f){if(_0x36776f['type']!==_0xb55e('0x43')){var _0x4c478c={};_0x4c478c[_0x36776f[_0xb55e('0x2c')]]={'$like':'%'+_0x53c668[_0xb55e('0x33')][_0xb55e('0x41')]+'%'};return _0x4c478c;}})});}_0x5c328b=_[_0xb55e('0x42')]({},_0x5c328b,_0x53c668[_0xb55e('0x44')]);var _0x5f3691={'where':_0x5c328b['where']};return db['AnalyticExtractedReport'][_0xb55e('0x1f')](_0x5f3691)[_0xb55e('0x25')](function(_0x5e1743){_0x213ef5[_0xb55e('0x1f')]=_0x5e1743;if(_0x53c668['query'][_0xb55e('0x45')]){_0x5c328b[_0xb55e('0x46')]=[{'all':!![]}];}return db[_0xb55e('0x30')]['findAll'](_0x5c328b);})[_0xb55e('0x25')](function(_0xbf0ebc){_0x213ef5[_0xb55e('0x47')]=_0xbf0ebc;return _0x213ef5;})[_0xb55e('0x25')](respondWithFilteredResult(_0x35ee24,_0x5c328b))['catch'](handleError(_0x35ee24,null));};exports['show']=function(_0x910e4d,_0x28e51f){var _0x5332f8={'raw':!![],'where':{'id':_0x910e4d[_0xb55e('0x48')]['id']}},_0x2994e6={};_0x2994e6['model']=_[_0xb55e('0x34')](db['AnalyticExtractedReport'][_0xb55e('0x49')]);_0x2994e6['query']=_['keys'](_0x910e4d['query']);_0x2994e6[_0xb55e('0x35')]=_['intersection'](_0x2994e6[_0xb55e('0x36')],_0x2994e6[_0xb55e('0x33')]);_0x5332f8[_0xb55e('0x37')]=_[_0xb55e('0x38')](_0x2994e6[_0xb55e('0x36')],qs[_0xb55e('0x39')](_0x910e4d[_0xb55e('0x33')][_0xb55e('0x39')]));_0x5332f8['attributes']=_0x5332f8['attributes'][_0xb55e('0x3a')]?_0x5332f8['attributes']:_0x2994e6[_0xb55e('0x36')];if(_0x910e4d['query'][_0xb55e('0x45')]){_0x5332f8[_0xb55e('0x46')]=[{'all':!![]}];}_0x5332f8=_[_0xb55e('0x42')]({},_0x5332f8,_0x910e4d[_0xb55e('0x44')]);return db[_0xb55e('0x30')][_0xb55e('0x4a')](_0x5332f8)['then'](handleEntityNotFound(_0x28e51f,null))[_0xb55e('0x25')](respondWithResult(_0x28e51f,null))['catch'](handleError(_0x28e51f,null));};exports[_0xb55e('0x4b')]=function(_0x583a67,_0x36d5f9){return db[_0xb55e('0x30')][_0xb55e('0x4b')](_0x583a67[_0xb55e('0x4c')],{})[_0xb55e('0x25')](function(_0x208d39){var _0x4ca605=_0x583a67[_0xb55e('0x4d')]['get']({'plain':!![]});if(!_0x4ca605)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ca605[_0xb55e('0x4e')]==='user'){var _0x5a6fd2=_0x208d39[_0xb55e('0x4f')]({'plain':!![]});var _0x2aed63=_0xb55e('0x27');return db[_0xb55e('0x50')][_0xb55e('0x4a')]({'where':{'name':_0x2aed63,'userProfileId':_0x4ca605[_0xb55e('0x51')]},'raw':!![]})[_0xb55e('0x25')](function(_0x167eb5){if(_0x167eb5&&_0x167eb5[_0xb55e('0x52')]===0x0){return db[_0xb55e('0x28')][_0xb55e('0x4b')]({'name':_0x5a6fd2[_0xb55e('0x2c')],'resourceId':_0x5a6fd2['id'],'type':_0x167eb5[_0xb55e('0x2c')],'sectionId':_0x167eb5['id']},{})[_0xb55e('0x25')](function(){return _0x208d39;});}else{return _0x208d39;}})[_0xb55e('0x53')](function(_0x175219){logger['error'](_0xb55e('0x54'),_0x175219);throw _0x175219;});}return _0x208d39;})[_0xb55e('0x25')](respondWithResult(_0x36d5f9,0xc9))[_0xb55e('0x53')](handleError(_0x36d5f9,null));};exports['update']=function(_0x41c41e,_0x2f5785){if(_0x41c41e[_0xb55e('0x4c')]['id']){delete _0x41c41e[_0xb55e('0x4c')]['id'];}return db[_0xb55e('0x30')][_0xb55e('0x4a')]({'where':{'id':_0x41c41e[_0xb55e('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f5785,null))[_0xb55e('0x25')](saveUpdates(_0x41c41e[_0xb55e('0x4c')],null))[_0xb55e('0x25')](respondWithResult(_0x2f5785,null))['catch'](handleError(_0x2f5785,null));};exports[_0xb55e('0x26')]=function(_0x354d30,_0xacf257){return db[_0xb55e('0x30')][_0xb55e('0x4a')]({'where':{'id':_0x354d30[_0xb55e('0x48')]['id']}})[_0xb55e('0x25')](handleEntityNotFound(_0xacf257,null))[_0xb55e('0x25')](removeEntity(_0xacf257,null))['catch'](handleError(_0xacf257,null));};exports[_0xb55e('0x55')]=function(_0x299a33,_0x32bf4e,_0x260c63){return db['AnalyticExtractedReport'][_0xb55e('0x4a')]({'where':{'id':_0x299a33['params']['id']},'attributes':[_0xb55e('0x2c'),_0xb55e('0x56'),_0xb55e('0x57'),_0xb55e('0x58')],'raw':!![]})[_0xb55e('0x25')](handleEntityNotFound(_0x32bf4e,null))[_0xb55e('0x25')](function(_0x5733c3){if(_0x5733c3){if(!fs[_0xb55e('0x59')](path[_0xb55e('0x5a')](config[_0xb55e('0x5b')],_0xb55e('0x5c'),_0x5733c3[_0xb55e('0x57')]))){throw new db[(_0xb55e('0x5d'))]['ValidationError'](_0xb55e('0x5e'));}if(_0x299a33[_0xb55e('0x33')]['exists']){return _0x32bf4e['sendStatus'](0xc8);}return _0x32bf4e[_0xb55e('0x55')](path[_0xb55e('0x5a')](config['root'],_0xb55e('0x5c'),_0x5733c3['savename']),util[_0xb55e('0x5f')](_0xb55e('0x60'),_0x5733c3['basename']||_0x5733c3['name'],_0x5733c3[_0xb55e('0x58')][_0xb55e('0x61')]()));}})[_0xb55e('0x53')](handleError(_0x32bf4e,null));}; \ No newline at end of file +var _0x1e94=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','update','params','download','basename','output','existsSync','join','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','sendStatus','root','format','%s.%s','toLowerCase','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','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','../../mysqldb','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','destroy','then','get','ExtractedReports','UserProfileResource','error','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','key','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','rows','catch','show','model','find'];(function(_0x30146e,_0x168495){var _0x4fe38d=function(_0x4e353f){while(--_0x4e353f){_0x30146e['push'](_0x30146e['shift']());}};_0x4fe38d(++_0x168495);}(_0x1e94,0xd2));var _0x41e9=function(_0xd25da3,_0x2a7b4f){_0xd25da3=_0xd25da3-0x0;var _0x531cab=_0x1e94[_0xd25da3];return _0x531cab;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x41e9('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x41e9('0x1'));var rp=require(_0x41e9('0x2'));var moment=require(_0x41e9('0x3'));var BPromise=require(_0x41e9('0x4'));var Mustache=require(_0x41e9('0x5'));var util=require(_0x41e9('0x6'));var path=require(_0x41e9('0x7'));var sox=require(_0x41e9('0x8'));var csv=require(_0x41e9('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41e9('0xa'));var squel=require(_0x41e9('0xb'));var crypto=require(_0x41e9('0xc'));var jsforce=require(_0x41e9('0xd'));var deskjs=require(_0x41e9('0xe'));var toCsv=require(_0x41e9('0x9'));var querystring=require(_0x41e9('0xf'));var Papa=require(_0x41e9('0x10'));var Redis=require(_0x41e9('0x11'));var authService=require(_0x41e9('0x12'));var qs=require(_0x41e9('0x13'));var as=require(_0x41e9('0x14'));var hardwareService=require(_0x41e9('0x15'));var logger=require(_0x41e9('0x16'))(_0x41e9('0x17'));var utils=require(_0x41e9('0x18'));var config=require(_0x41e9('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x41e9('0x1a'))['db'];function respondWithStatusCode(_0x3130db,_0x4a11e8){_0x4a11e8=_0x4a11e8||0xcc;return function(_0x597dfd){if(_0x597dfd){return _0x3130db['sendStatus'](_0x4a11e8);}return _0x3130db[_0x41e9('0x1b')](_0x4a11e8)[_0x41e9('0x1c')]();};}function respondWithResult(_0x164200,_0x5cde4e){_0x5cde4e=_0x5cde4e||0xc8;return function(_0xe5196f){if(_0xe5196f){return _0x164200[_0x41e9('0x1b')](_0x5cde4e)[_0x41e9('0x1d')](_0xe5196f);}};}function respondWithFilteredResult(_0x14e025,_0x24493b){return function(_0x3fe45d){if(_0x3fe45d){var _0xfe13=typeof _0x24493b['offset']===_0x41e9('0x1e')&&typeof _0x24493b['limit']==='undefined';var _0x259bc6=_0x3fe45d[_0x41e9('0x1f')];var _0x53e7af=_0xfe13?0x0:_0x24493b[_0x41e9('0x20')];var _0x159d1f=_0xfe13?_0x3fe45d[_0x41e9('0x1f')]:_0x24493b['offset']+_0x24493b[_0x41e9('0x21')];var _0x30c6f9;if(_0x159d1f>=_0x259bc6){_0x159d1f=_0x259bc6;_0x30c6f9=0xc8;}else{_0x30c6f9=0xce;}_0x14e025[_0x41e9('0x1b')](_0x30c6f9);return _0x14e025[_0x41e9('0x22')](_0x41e9('0x23'),_0x53e7af+'-'+_0x159d1f+'/'+_0x259bc6)['json'](_0x3fe45d);}return null;};}function patchUpdates(_0x1e5d5f){return function(_0xe18606){try{jsonpatch[_0x41e9('0x24')](_0xe18606,_0x1e5d5f,!![]);}catch(_0x4a359e){return BPromise[_0x41e9('0x25')](_0x4a359e);}return _0xe18606['save']();};}function saveUpdates(_0x311da1,_0x5a839f){return function(_0x34f2ae){if(_0x34f2ae){return _0x34f2ae['update'](_0x311da1)['then'](function(_0x5881b1){return _0x5881b1;});}return null;};}function removeEntity(_0x1e4e13,_0x39e293){return function(_0x108ae7){if(_0x108ae7){return _0x108ae7[_0x41e9('0x26')]()[_0x41e9('0x27')](function(){var _0xeff6b5=_0x108ae7[_0x41e9('0x28')]({'plain':!![]});var _0x21df56=_0x41e9('0x29');return db[_0x41e9('0x2a')][_0x41e9('0x26')]({'where':{'type':_0x21df56,'resourceId':_0xeff6b5['id']}})['then'](function(){return _0x108ae7;});})[_0x41e9('0x27')](function(){_0x1e4e13[_0x41e9('0x1b')](0xcc)[_0x41e9('0x1c')]();});}};}function handleEntityNotFound(_0x2aa2b7,_0x35cc84){return function(_0x5092c6){if(!_0x5092c6){_0x2aa2b7['sendStatus'](0x194);}return _0x5092c6;};}function handleError(_0x12a8bf,_0x17c518){_0x17c518=_0x17c518||0x1f4;return function(_0x245867){logger[_0x41e9('0x2b')](_0x245867['stack']);if(_0x245867[_0x41e9('0x2c')]){delete _0x245867[_0x41e9('0x2c')];}_0x12a8bf[_0x41e9('0x1b')](_0x17c518)[_0x41e9('0x2d')](_0x245867);};}exports[_0x41e9('0x2e')]=function(_0x34c6f4,_0x252eb1){var _0x384436={},_0x392bdb={},_0x429c97={'count':0x0,'rows':[]};var _0x26d4b5=_['map'](db[_0x41e9('0x2f')][_0x41e9('0x30')],function(_0x1fe23d){return{'name':_0x1fe23d[_0x41e9('0x31')],'type':_0x1fe23d['type'][_0x41e9('0x32')]};});_0x392bdb['model']=_[_0x41e9('0x33')](_0x26d4b5,'name');_0x392bdb[_0x41e9('0x34')]=_[_0x41e9('0x35')](_0x34c6f4[_0x41e9('0x34')]);_0x392bdb['filters']=_[_0x41e9('0x36')](_0x392bdb['model'],_0x392bdb['query']);_0x384436[_0x41e9('0x37')]=_[_0x41e9('0x36')](_0x392bdb['model'],qs[_0x41e9('0x38')](_0x34c6f4['query'][_0x41e9('0x38')]));_0x384436[_0x41e9('0x37')]=_0x384436['attributes'][_0x41e9('0x39')]?_0x384436[_0x41e9('0x37')]:_0x392bdb['model'];if(!_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3a')]('nolimit')){_0x384436[_0x41e9('0x21')]=qs[_0x41e9('0x21')](_0x34c6f4['query']['limit']);_0x384436[_0x41e9('0x20')]=qs[_0x41e9('0x20')](_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x20')]);}_0x384436['order']=qs[_0x41e9('0x3b')](_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3b')]);_0x384436[_0x41e9('0x3c')]=qs[_0x41e9('0x3d')](_[_0x41e9('0x3e')](_0x34c6f4['query'],_0x392bdb[_0x41e9('0x3d')]),_0x26d4b5);if(_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3f')]){_0x384436['where']=_[_0x41e9('0x40')](_0x384436[_0x41e9('0x3c')],{'$or':_['map'](_0x26d4b5,function(_0x288634){if(_0x288634['type']!=='VIRTUAL'){var _0x2ef1de={};_0x2ef1de[_0x288634['name']]={'$like':'%'+_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x3f')]+'%'};return _0x2ef1de;}})});}_0x384436=_[_0x41e9('0x40')]({},_0x384436,_0x34c6f4[_0x41e9('0x41')]);var _0xbae75b={'where':_0x384436[_0x41e9('0x3c')]};return db[_0x41e9('0x2f')][_0x41e9('0x1f')](_0xbae75b)[_0x41e9('0x27')](function(_0x3194b8){_0x429c97[_0x41e9('0x1f')]=_0x3194b8;if(_0x34c6f4[_0x41e9('0x34')][_0x41e9('0x42')]){_0x384436['include']=[{'all':!![]}];}return db[_0x41e9('0x2f')]['findAll'](_0x384436);})['then'](function(_0x19d816){_0x429c97[_0x41e9('0x43')]=_0x19d816;return _0x429c97;})[_0x41e9('0x27')](respondWithFilteredResult(_0x252eb1,_0x384436))[_0x41e9('0x44')](handleError(_0x252eb1,null));};exports[_0x41e9('0x45')]=function(_0x2baab4,_0x41b71a){var _0x1c2b0e={'raw':!![],'where':{'id':_0x2baab4['params']['id']}},_0x1b92a6={};_0x1b92a6[_0x41e9('0x46')]=_[_0x41e9('0x35')](db[_0x41e9('0x2f')]['rawAttributes']);_0x1b92a6[_0x41e9('0x34')]=_[_0x41e9('0x35')](_0x2baab4[_0x41e9('0x34')]);_0x1b92a6[_0x41e9('0x3d')]=_[_0x41e9('0x36')](_0x1b92a6['model'],_0x1b92a6['query']);_0x1c2b0e[_0x41e9('0x37')]=_[_0x41e9('0x36')](_0x1b92a6[_0x41e9('0x46')],qs['fields'](_0x2baab4[_0x41e9('0x34')][_0x41e9('0x38')]));_0x1c2b0e[_0x41e9('0x37')]=_0x1c2b0e[_0x41e9('0x37')][_0x41e9('0x39')]?_0x1c2b0e[_0x41e9('0x37')]:_0x1b92a6['model'];if(_0x2baab4[_0x41e9('0x34')]['includeAll']){_0x1c2b0e['include']=[{'all':!![]}];}_0x1c2b0e=_[_0x41e9('0x40')]({},_0x1c2b0e,_0x2baab4[_0x41e9('0x41')]);return db['AnalyticExtractedReport'][_0x41e9('0x47')](_0x1c2b0e)[_0x41e9('0x27')](handleEntityNotFound(_0x41b71a,null))[_0x41e9('0x27')](respondWithResult(_0x41b71a,null))[_0x41e9('0x44')](handleError(_0x41b71a,null));};exports[_0x41e9('0x48')]=function(_0x4c5744,_0x58ab3c){return db[_0x41e9('0x2f')][_0x41e9('0x48')](_0x4c5744[_0x41e9('0x49')],{})[_0x41e9('0x27')](function(_0x2672f8){var _0x141086=_0x4c5744[_0x41e9('0x4a')][_0x41e9('0x28')]({'plain':!![]});if(!_0x141086)throw new Error(_0x41e9('0x4b'));if(_0x141086[_0x41e9('0x4c')]===_0x41e9('0x4a')){var _0x5797f4=_0x2672f8['get']({'plain':!![]});var _0x18f73b=_0x41e9('0x29');return db['UserProfileSection'][_0x41e9('0x47')]({'where':{'name':_0x18f73b,'userProfileId':_0x141086['userProfileId']},'raw':!![]})[_0x41e9('0x27')](function(_0x443e1){if(_0x443e1&&_0x443e1['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x5797f4[_0x41e9('0x2c')],'resourceId':_0x5797f4['id'],'type':_0x443e1[_0x41e9('0x2c')],'sectionId':_0x443e1['id']},{})['then'](function(){return _0x2672f8;});}else{return _0x2672f8;}})[_0x41e9('0x44')](function(_0x53c702){logger[_0x41e9('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x53c702);throw _0x53c702;});}return _0x2672f8;})[_0x41e9('0x27')](respondWithResult(_0x58ab3c,0xc9))[_0x41e9('0x44')](handleError(_0x58ab3c,null));};exports[_0x41e9('0x4d')]=function(_0x2bb982,_0x28f4b6){if(_0x2bb982[_0x41e9('0x49')]['id']){delete _0x2bb982[_0x41e9('0x49')]['id'];}return db[_0x41e9('0x2f')][_0x41e9('0x47')]({'where':{'id':_0x2bb982[_0x41e9('0x4e')]['id']}})[_0x41e9('0x27')](handleEntityNotFound(_0x28f4b6,null))[_0x41e9('0x27')](saveUpdates(_0x2bb982[_0x41e9('0x49')],null))[_0x41e9('0x27')](respondWithResult(_0x28f4b6,null))[_0x41e9('0x44')](handleError(_0x28f4b6,null));};exports[_0x41e9('0x26')]=function(_0x2e3bef,_0xa1bba8){return db[_0x41e9('0x2f')][_0x41e9('0x47')]({'where':{'id':_0x2e3bef[_0x41e9('0x4e')]['id']}})['then'](handleEntityNotFound(_0xa1bba8,null))[_0x41e9('0x27')](removeEntity(_0xa1bba8,null))['catch'](handleError(_0xa1bba8,null));};exports[_0x41e9('0x4f')]=function(_0x247410,_0x1d18f1,_0x4ba30c){return db[_0x41e9('0x2f')]['find']({'where':{'id':_0x247410[_0x41e9('0x4e')]['id']},'attributes':['name',_0x41e9('0x50'),'savename',_0x41e9('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x1d18f1,null))[_0x41e9('0x27')](function(_0x1c09a0){if(_0x1c09a0){if(!fs[_0x41e9('0x52')](path[_0x41e9('0x53')](config['root'],_0x41e9('0x54'),_0x1c09a0[_0x41e9('0x55')]))){throw new db[(_0x41e9('0x56'))][(_0x41e9('0x57'))](_0x41e9('0x58'));}if(_0x247410[_0x41e9('0x34')]['exists']){return _0x1d18f1[_0x41e9('0x59')](0xc8);}return _0x1d18f1['download'](path[_0x41e9('0x53')](config[_0x41e9('0x5a')],'server/files/reports',_0x1c09a0[_0x41e9('0x55')]),util[_0x41e9('0x5b')](_0x41e9('0x5c'),_0x1c09a0[_0x41e9('0x50')]||_0x1c09a0['name'],_0x1c09a0[_0x41e9('0x51')][_0x41e9('0x5d')]()));}})[_0x41e9('0x44')](handleError(_0x1d18f1,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 451280a..8a9de84 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 _0x7bbb=['lodash','../../config/logger','api','moment','bluebird','path','rimraf','./analyticExtractedReport.attributes','exports','define'];(function(_0xecab6a,_0x3c768a){var _0x40b98b=function(_0x448a28){while(--_0x448a28){_0xecab6a['push'](_0xecab6a['shift']());}};_0x40b98b(++_0x3c768a);}(_0x7bbb,0xaa));var _0xb7bb=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0x7bbb[_0x1b349a];return _0x5d1f7c;};'use strict';var _=require(_0xb7bb('0x0'));var util=require('util');var logger=require(_0xb7bb('0x1'))(_0xb7bb('0x2'));var moment=require(_0xb7bb('0x3'));var BPromise=require(_0xb7bb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7bb('0x5'));var rimraf=require(_0xb7bb('0x6'));var config=require('../../config/environment');var attributes=require(_0xb7bb('0x7'));module[_0xb7bb('0x8')]=function(_0x3d7920,_0x5cb807){return _0x3d7920[_0xb7bb('0x9')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd12=['define','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x5a0d62,_0x746560){var _0x405432=function(_0x14530c){while(--_0x14530c){_0x5a0d62['push'](_0x5a0d62['shift']());}};_0x405432(++_0x746560);}(_0xcd12,0xb5));var _0x2cd1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcd12[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2cd1('0x0'));var util=require(_0x2cd1('0x1'));var logger=require('../../config/logger')(_0x2cd1('0x2'));var moment=require(_0x2cd1('0x3'));var BPromise=require(_0x2cd1('0x4'));var rp=require(_0x2cd1('0x5'));var fs=require('fs');var path=require(_0x2cd1('0x6'));var rimraf=require(_0x2cd1('0x7'));var config=require(_0x2cd1('0x8'));var attributes=require(_0x2cd1('0x9'));module[_0x2cd1('0xa')]=function(_0x514ffb,_0x5d6419){return _0x514ffb[_0x2cd1('0xb')]('AnalyticExtractedReport',attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index 17c2180..33074da 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 _0x4614=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x33430c,_0x4cc99c){var _0x31fcbf=function(_0x1f2d41){while(--_0x1f2d41){_0x33430c['push'](_0x33430c['shift']());}};_0x31fcbf(++_0x4cc99c);}(_0x4614,0x85));var _0x4461=function(_0x508076,_0x1980e6){_0x508076=_0x508076-0x0;var _0x20328a=_0x4614[_0x508076];return _0x20328a;};'use strict';var _=require(_0x4461('0x0'));var util=require(_0x4461('0x1'));var moment=require(_0x4461('0x2'));var BPromise=require(_0x4461('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4461('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4461('0x5'))(_0x4461('0x6'));var config=require(_0x4461('0x7'));var jayson=require(_0x4461('0x8'));var client=jayson[_0x4461('0x9')][_0x4461('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5f96b8,_0xbdf0b4,_0x32d563){return new BPromise(function(_0x1616c0,_0x56e63d){return client[_0x4461('0xb')](_0x5f96b8,_0x32d563)[_0x4461('0xc')](function(_0x48c6bb){logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,_0x4461('0xf'));logger['debug'](_0x4461('0x10'),_0xbdf0b4,_0x4461('0xf'),JSON[_0x4461('0x11')](_0x48c6bb));if(_0x48c6bb['error']){if(_0x48c6bb[_0x4461('0x12')]['code']===0x1f4){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x56e63d(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x48c6bb['error'][_0x4461('0x13')]);return _0x1616c0(_0x48c6bb[_0x4461('0x12')][_0x4461('0x13')]);}else{logger[_0x4461('0xd')](_0x4461('0xe'),_0xbdf0b4,'request\x20sent');_0x1616c0(_0x48c6bb[_0x4461('0x14')][_0x4461('0x13')]);}})['catch'](function(_0x1ce854){logger[_0x4461('0x12')](_0x4461('0xe'),_0xbdf0b4,_0x1ce854);_0x56e63d(_0x1ce854);});});} \ No newline at end of file +var _0x3c6a=['catch','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result'];(function(_0xa2c0a3,_0x5bbac0){var _0x52c618=function(_0x20f7fd){while(--_0x20f7fd){_0xa2c0a3['push'](_0xa2c0a3['shift']());}};_0x52c618(++_0x5bbac0);}(_0x3c6a,0xb5));var _0xa3c6=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0x3c6a[_0x215dc8];return _0x583ea3;};'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')]('AnalyticExtractedReport,\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);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 24fec88..432e13e 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 _0xbe2a=['multer','util','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update','delete','exports'];(function(_0x519dcb,_0x2a11dc){var _0x516618=function(_0x4d0fe3){while(--_0x4d0fe3){_0x519dcb['push'](_0x519dcb['shift']());}};_0x516618(++_0x2a11dc);}(_0xbe2a,0x1e6));var _0xabe2=function(_0x3b8aeb,_0x50899d){_0x3b8aeb=_0x3b8aeb-0x0;var _0x73919d=_0xbe2a[_0x3b8aeb];return _0x73919d;};'use strict';var multer=require(_0xabe2('0x0'));var util=require(_0xabe2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xabe2('0x2'));var auth=require(_0xabe2('0x3'));var interaction=require(_0xabe2('0x4'));var config=require(_0xabe2('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0xabe2('0x6')]('/',auth[_0xabe2('0x7')](),controller[_0xabe2('0x8')]);router['get'](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xa')]);router[_0xabe2('0x6')](_0xabe2('0xb'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xc')]);router[_0xabe2('0xd')]('/',auth['isAuthenticated'](),controller[_0xabe2('0xe')]);router['put'](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller[_0xabe2('0xf')]);router[_0xabe2('0x10')](_0xabe2('0x9'),auth[_0xabe2('0x7')](),controller['destroy']);module[_0xabe2('0x11')]=router; \ No newline at end of file +var _0x90b8=['put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create'];(function(_0x2168f8,_0x407daa){var _0x39f31b=function(_0x2da764){while(--_0x2da764){_0x2168f8['push'](_0x2168f8['shift']());}};_0x39f31b(++_0x407daa);}(_0x90b8,0xeb));var _0x890b=function(_0x4fa0ea,_0x2cd534){_0x4fa0ea=_0x4fa0ea-0x0;var _0x51d027=_0x90b8[_0x4fa0ea];return _0x51d027;};'use strict';var multer=require(_0x890b('0x0'));var util=require(_0x890b('0x1'));var path=require(_0x890b('0x2'));var timeout=require(_0x890b('0x3'));var express=require(_0x890b('0x4'));var router=express[_0x890b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x890b('0x6'));var interaction=require(_0x890b('0x7'));var config=require('../../config/environment');var controller=require(_0x890b('0x8'));router[_0x890b('0x9')]('/',auth[_0x890b('0xa')](),controller['index']);router[_0x890b('0x9')](_0x890b('0xb'),auth[_0x890b('0xa')](),controller[_0x890b('0xc')]);router[_0x890b('0x9')](_0x890b('0xd'),auth[_0x890b('0xa')](),controller[_0x890b('0xe')]);router[_0x890b('0xf')]('/',auth[_0x890b('0xa')](),controller[_0x890b('0x10')]);router[_0x890b('0x11')](_0x890b('0xb'),auth[_0x890b('0xa')](),controller['update']);router[_0x890b('0x12')]('/:id',auth[_0x890b('0xa')](),controller[_0x890b('0x13')]);module[_0x890b('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 b7455e6..de12aa8 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 _0x0dbc=['BOOLEAN','sequelize','exports','STRING'];(function(_0x277fa3,_0x3b2dde){var _0x2e4520=function(_0x209eab){while(--_0x209eab){_0x277fa3['push'](_0x277fa3['shift']());}};_0x2e4520(++_0x3b2dde);}(_0x0dbc,0x1a5));var _0xc0db=function(_0x1f9a85,_0x4bfcdd){_0x1f9a85=_0x1f9a85-0x0;var _0x4e67b3=_0x0dbc[_0x1f9a85];return _0x4e67b3;};'use strict';var Sequelize=require(_0xc0db('0x0'));module[_0xc0db('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0xc0db('0x2')]},'groupBy':{'type':Sequelize[_0xc0db('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0xc0db('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0xc736=['exports','TEXT','BOOLEAN','STRING','sequelize'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xc736,0x149));var _0x6c73=function(_0x2f21e8,_0xbfc604){_0x2f21e8=_0x2f21e8-0x0;var _0x460c1c=_0xc736[_0x2f21e8];return _0x460c1c;};'use strict';var Sequelize=require(_0x6c73('0x0'));module[_0x6c73('0x1')]={'field':{'type':Sequelize[_0x6c73('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize[_0x6c73('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6c73('0x4')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 5d43716..6b0a025 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 _0x8ca7=['intersection','attributes','fields','query','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','params','find','catch','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','sequelize','transaction','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','keys','filters'];(function(_0x451130,_0x595ee2){var _0x68c08e=function(_0x23fe84){while(--_0x23fe84){_0x451130['push'](_0x451130['shift']());}};_0x68c08e(++_0x595ee2);}(_0x8ca7,0x1a2));var _0x78ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ca7[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x78ca('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x78ca('0x1'));var rp=require(_0x78ca('0x2'));var moment=require(_0x78ca('0x3'));var BPromise=require(_0x78ca('0x4'));var Mustache=require(_0x78ca('0x5'));var util=require(_0x78ca('0x6'));var path=require('path');var sox=require(_0x78ca('0x7'));var csv=require(_0x78ca('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x78ca('0x9'));var _=require(_0x78ca('0xa'));var squel=require(_0x78ca('0xb'));var crypto=require('crypto');var jsforce=require(_0x78ca('0xc'));var deskjs=require(_0x78ca('0xd'));var toCsv=require(_0x78ca('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x78ca('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x78ca('0xf'));var as=require(_0x78ca('0x10'));var hardwareService=require(_0x78ca('0x11'));var logger=require(_0x78ca('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x78ca('0x13'));var licenseUtil=require(_0x78ca('0x14'));var db=require(_0x78ca('0x15'))['db'];function respondWithStatusCode(_0x3c8170,_0x14ab4e){_0x14ab4e=_0x14ab4e||0xcc;return function(_0x4badeb){if(_0x4badeb){return _0x3c8170['sendStatus'](_0x14ab4e);}return _0x3c8170[_0x78ca('0x16')](_0x14ab4e)[_0x78ca('0x17')]();};}function respondWithResult(_0x2c7263,_0x4aea60){_0x4aea60=_0x4aea60||0xc8;return function(_0xc701d8){if(_0xc701d8){return _0x2c7263[_0x78ca('0x16')](_0x4aea60)[_0x78ca('0x18')](_0xc701d8);}};}function respondWithFilteredResult(_0x87ee3,_0x408d60){return function(_0xa1d86c){if(_0xa1d86c){var _0x207d51=typeof _0x408d60['offset']===_0x78ca('0x19')&&typeof _0x408d60[_0x78ca('0x1a')]===_0x78ca('0x19');var _0x3ffd41=_0xa1d86c[_0x78ca('0x1b')];var _0x742768=_0x207d51?0x0:_0x408d60[_0x78ca('0x1c')];var _0x17e7df=_0x207d51?_0xa1d86c[_0x78ca('0x1b')]:_0x408d60[_0x78ca('0x1c')]+_0x408d60['limit'];var _0x4dff00;if(_0x17e7df>=_0x3ffd41){_0x17e7df=_0x3ffd41;_0x4dff00=0xc8;}else{_0x4dff00=0xce;}_0x87ee3[_0x78ca('0x16')](_0x4dff00);return _0x87ee3[_0x78ca('0x1d')]('Content-Range',_0x742768+'-'+_0x17e7df+'/'+_0x3ffd41)[_0x78ca('0x18')](_0xa1d86c);}return null;};}function patchUpdates(_0x5006ad){return function(_0x418ae7){try{jsonpatch[_0x78ca('0x1e')](_0x418ae7,_0x5006ad,!![]);}catch(_0x310ae9){return BPromise[_0x78ca('0x1f')](_0x310ae9);}return _0x418ae7[_0x78ca('0x20')]();};}function saveUpdates(_0x5908c7,_0x2fe0a3){return function(_0x16c783){if(_0x16c783){return _0x16c783[_0x78ca('0x21')](_0x5908c7)[_0x78ca('0x22')](function(_0xae2c48){return _0xae2c48;});}return null;};}function removeEntity(_0x3ceae5,_0x19f526){return function(_0x439666){if(_0x439666){return _0x439666[_0x78ca('0x23')]()['then'](function(){_0x3ceae5[_0x78ca('0x16')](0xcc)[_0x78ca('0x17')]();});}};}function handleEntityNotFound(_0x83fe4e,_0x546c7e){return function(_0x2fb721){if(!_0x2fb721){_0x83fe4e[_0x78ca('0x24')](0x194);}return _0x2fb721;};}function handleError(_0x501c8d,_0xb3f8e){_0xb3f8e=_0xb3f8e||0x1f4;return function(_0x588fc6){logger['error'](_0x588fc6[_0x78ca('0x25')]);if(_0x588fc6[_0x78ca('0x26')]){delete _0x588fc6[_0x78ca('0x26')];}_0x501c8d['status'](_0xb3f8e)[_0x78ca('0x27')](_0x588fc6);};}exports[_0x78ca('0x28')]=function(_0x5394ea,_0x53a1f4){var _0x4ab05={},_0xaea698={},_0x2b1dc2={'count':0x0,'rows':[]};var _0x38aad8=_[_0x78ca('0x29')](db[_0x78ca('0x2a')][_0x78ca('0x2b')],function(_0x58debc){return{'name':_0x58debc[_0x78ca('0x2c')],'type':_0x58debc[_0x78ca('0x2d')][_0x78ca('0x2e')]};});_0xaea698[_0x78ca('0x2f')]=_[_0x78ca('0x29')](_0x38aad8,_0x78ca('0x26'));_0xaea698['query']=_[_0x78ca('0x30')](_0x5394ea['query']);_0xaea698[_0x78ca('0x31')]=_[_0x78ca('0x32')](_0xaea698['model'],_0xaea698['query']);_0x4ab05[_0x78ca('0x33')]=_['intersection'](_0xaea698[_0x78ca('0x2f')],qs[_0x78ca('0x34')](_0x5394ea[_0x78ca('0x35')]['fields']));_0x4ab05[_0x78ca('0x33')]=_0x4ab05[_0x78ca('0x33')][_0x78ca('0x36')]?_0x4ab05[_0x78ca('0x33')]:_0xaea698[_0x78ca('0x2f')];if(!_0x5394ea[_0x78ca('0x35')][_0x78ca('0x37')]('nolimit')){_0x4ab05[_0x78ca('0x1a')]=qs[_0x78ca('0x1a')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x1a')]);_0x4ab05['offset']=qs[_0x78ca('0x1c')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x1c')]);}_0x4ab05[_0x78ca('0x38')]=qs[_0x78ca('0x39')](_0x5394ea[_0x78ca('0x35')][_0x78ca('0x39')]);_0x4ab05['where']=qs[_0x78ca('0x31')](_[_0x78ca('0x3a')](_0x5394ea['query'],_0xaea698[_0x78ca('0x31')]),_0x38aad8);if(_0x5394ea[_0x78ca('0x35')][_0x78ca('0x3b')]){_0x4ab05[_0x78ca('0x3c')]=_[_0x78ca('0x3d')](_0x4ab05[_0x78ca('0x3c')],{'$or':_[_0x78ca('0x29')](_0x38aad8,function(_0x1861f6){if(_0x1861f6[_0x78ca('0x2d')]!==_0x78ca('0x3e')){var _0x7c640b={};_0x7c640b[_0x1861f6[_0x78ca('0x26')]]={'$like':'%'+_0x5394ea[_0x78ca('0x35')]['filter']+'%'};return _0x7c640b;}})});}_0x4ab05=_['merge']({},_0x4ab05,_0x5394ea[_0x78ca('0x3f')]);var _0x135d44={'where':_0x4ab05['where']};return db[_0x78ca('0x2a')][_0x78ca('0x1b')](_0x135d44)[_0x78ca('0x22')](function(_0x945687){_0x2b1dc2['count']=_0x945687;if(_0x5394ea[_0x78ca('0x35')][_0x78ca('0x40')]){_0x4ab05[_0x78ca('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x78ca('0x42')](_0x4ab05);})['then'](function(_0x153f1b){_0x2b1dc2['rows']=_0x153f1b;return _0x2b1dc2;})[_0x78ca('0x22')](respondWithFilteredResult(_0x53a1f4,_0x4ab05))['catch'](handleError(_0x53a1f4,null));};exports['show']=function(_0x52ff40,_0x428a4a){var _0x56e17c={'raw':![],'where':{'id':_0x52ff40[_0x78ca('0x43')]['id']}},_0x1555fd={};_0x1555fd[_0x78ca('0x2f')]=_[_0x78ca('0x30')](db[_0x78ca('0x2a')][_0x78ca('0x2b')]);_0x1555fd['query']=_[_0x78ca('0x30')](_0x52ff40['query']);_0x1555fd[_0x78ca('0x31')]=_['intersection'](_0x1555fd[_0x78ca('0x2f')],_0x1555fd[_0x78ca('0x35')]);_0x56e17c[_0x78ca('0x33')]=_['intersection'](_0x1555fd[_0x78ca('0x2f')],qs[_0x78ca('0x34')](_0x52ff40[_0x78ca('0x35')][_0x78ca('0x34')]));_0x56e17c[_0x78ca('0x33')]=_0x56e17c[_0x78ca('0x33')][_0x78ca('0x36')]?_0x56e17c[_0x78ca('0x33')]:_0x1555fd['model'];if(_0x52ff40['query']['includeAll']){_0x56e17c['include']=[{'all':!![]}];}_0x56e17c=_[_0x78ca('0x3d')]({},_0x56e17c,_0x52ff40[_0x78ca('0x3f')]);return db[_0x78ca('0x2a')][_0x78ca('0x44')](_0x56e17c)[_0x78ca('0x22')](handleEntityNotFound(_0x428a4a,null))[_0x78ca('0x22')](respondWithResult(_0x428a4a,null))[_0x78ca('0x45')](handleError(_0x428a4a,null));};exports['create']=function(_0x360141,_0x1e4fff){return db[_0x78ca('0x2a')][_0x78ca('0x46')](_0x360141[_0x78ca('0x47')],{})[_0x78ca('0x22')](respondWithResult(_0x1e4fff,0xc9))['catch'](handleError(_0x1e4fff,null));};exports[_0x78ca('0x48')]=function(_0x32f41c,_0x414603){return db[_0x78ca('0x2a')][_0x78ca('0x48')](_0x32f41c[_0x78ca('0x47')],{'raw':![],'individualHooks':!![]})[_0x78ca('0x22')](respondWithResult(_0x414603,0xc9))[_0x78ca('0x45')](handleError(_0x414603,null));};exports['update']=function(_0x2dfa36,_0x5884f2){if(_0x2dfa36[_0x78ca('0x47')]['id']){delete _0x2dfa36[_0x78ca('0x47')]['id'];}return db[_0x78ca('0x2a')][_0x78ca('0x44')]({'where':{'id':_0x2dfa36[_0x78ca('0x43')]['id']}})[_0x78ca('0x22')](handleEntityNotFound(_0x5884f2,null))[_0x78ca('0x22')](saveUpdates(_0x2dfa36[_0x78ca('0x47')],null))[_0x78ca('0x22')](respondWithResult(_0x5884f2,null))[_0x78ca('0x45')](handleError(_0x5884f2,null));};exports[_0x78ca('0x23')]=function(_0x1a69dd,_0x5a4ae3){return db[_0x78ca('0x2a')]['find']({'where':{'id':_0x1a69dd[_0x78ca('0x43')]['id']}})['then'](handleEntityNotFound(_0x5a4ae3,null))['then'](removeEntity(_0x5a4ae3,null))[_0x78ca('0x45')](handleError(_0x5a4ae3,null));};exports[_0x78ca('0x49')]=function(_0x5881ad,_0x323091){return db[_0x78ca('0x2a')]['destroy']({'where':{'id':_0x5881ad[_0x78ca('0x35')][_0x78ca('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x323091,0xcc))['catch'](handleError(_0x323091,null));};exports['addFields']=function(_0x5898a5,_0x5c008b,_0x1945a3){return db[_0x78ca('0x4b')]['findOne']({'where':{'id':_0x5898a5[_0x78ca('0x43')]['id']}})[_0x78ca('0x22')](handleEntityNotFound(_0x5c008b,null))[_0x78ca('0x22')](function(_0x141607){if(_0x141607){return db[_0x78ca('0x4c')][_0x78ca('0x4d')](function(_0x514753){return db[_0x78ca('0x2a')][_0x78ca('0x23')]({'where':{'CustomReportId':_0x5898a5[_0x78ca('0x43')]['id']},'transaction':_0x514753})[_0x78ca('0x22')](function(_0xefb957){var _0x279583=_[_0x78ca('0x29')](_0x5898a5[_0x78ca('0x47')],function(_0x1da465){delete _0x1da465['id'];_0x1da465['CustomReportId']=_0x5898a5[_0x78ca('0x43')]['id'];return _0x1da465;});return db[_0x78ca('0x2a')][_0x78ca('0x48')](_0x279583,{'transaction':_0x514753});});})[_0x78ca('0x22')](function(){return db[_0x78ca('0x2a')]['findAll']({'where':{'CustomReportId':_0x5898a5[_0x78ca('0x43')]['id']}});});}})['then'](respondWithResult(_0x5c008b,null))[_0x78ca('0x45')](handleError(_0x5c008b,null));}; \ No newline at end of file +var _0x0a0d=['sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','AnalyticFieldReport','include','findAll','rows','show','params','includeAll','merge','options','find','create','body','catch','bulkCreate','destroy','bulkDestroy','ids','addFields','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x2d22dd,_0x9ff970){var _0x260e94=function(_0x234403){while(--_0x234403){_0x2d22dd['push'](_0x2d22dd['shift']());}};_0x260e94(++_0x9ff970);}(_0x0a0d,0x1ce));var _0xd0a0=function(_0x1f44e4,_0x22d9fd){_0x1f44e4=_0x1f44e4-0x0;var _0x591989=_0x0a0d[_0x1f44e4];return _0x591989;};'use strict';var emlformat=require(_0xd0a0('0x0'));var rimraf=require(_0xd0a0('0x1'));var zipdir=require(_0xd0a0('0x2'));var jsonpatch=require(_0xd0a0('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd0a0('0x4'));var Mustache=require(_0xd0a0('0x5'));var util=require(_0xd0a0('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xd0a0('0x7'));var ejs=require(_0xd0a0('0x8'));var fs=require('fs');var fs_extra=require(_0xd0a0('0x9'));var _=require(_0xd0a0('0xa'));var squel=require(_0xd0a0('0xb'));var crypto=require('crypto');var jsforce=require(_0xd0a0('0xc'));var deskjs=require(_0xd0a0('0xd'));var toCsv=require(_0xd0a0('0x7'));var querystring=require(_0xd0a0('0xe'));var Papa=require(_0xd0a0('0xf'));var Redis=require(_0xd0a0('0x10'));var authService=require(_0xd0a0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd0a0('0x12'));var hardwareService=require(_0xd0a0('0x13'));var logger=require(_0xd0a0('0x14'))('api');var utils=require(_0xd0a0('0x15'));var config=require(_0xd0a0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd0a0('0x17'))['db'];function respondWithStatusCode(_0x14add0,_0x4ade9){_0x4ade9=_0x4ade9||0xcc;return function(_0x3f17f1){if(_0x3f17f1){return _0x14add0[_0xd0a0('0x18')](_0x4ade9);}return _0x14add0['status'](_0x4ade9)[_0xd0a0('0x19')]();};}function respondWithResult(_0x22508f,_0x3236cc){_0x3236cc=_0x3236cc||0xc8;return function(_0x3aa034){if(_0x3aa034){return _0x22508f[_0xd0a0('0x1a')](_0x3236cc)[_0xd0a0('0x1b')](_0x3aa034);}};}function respondWithFilteredResult(_0x343e04,_0x20a083){return function(_0x5433ed){if(_0x5433ed){var _0x49b431=typeof _0x20a083[_0xd0a0('0x1c')]==='undefined'&&typeof _0x20a083['limit']===_0xd0a0('0x1d');var _0x4cc53e=_0x5433ed[_0xd0a0('0x1e')];var _0x272399=_0x49b431?0x0:_0x20a083[_0xd0a0('0x1c')];var _0x481f84=_0x49b431?_0x5433ed['count']:_0x20a083[_0xd0a0('0x1c')]+_0x20a083[_0xd0a0('0x1f')];var _0x4f2e69;if(_0x481f84>=_0x4cc53e){_0x481f84=_0x4cc53e;_0x4f2e69=0xc8;}else{_0x4f2e69=0xce;}_0x343e04['status'](_0x4f2e69);return _0x343e04['set'](_0xd0a0('0x20'),_0x272399+'-'+_0x481f84+'/'+_0x4cc53e)[_0xd0a0('0x1b')](_0x5433ed);}return null;};}function patchUpdates(_0x109585){return function(_0x4c2e3d){try{jsonpatch[_0xd0a0('0x21')](_0x4c2e3d,_0x109585,!![]);}catch(_0x332915){return BPromise[_0xd0a0('0x22')](_0x332915);}return _0x4c2e3d[_0xd0a0('0x23')]();};}function saveUpdates(_0x26bfc6,_0x3fc504){return function(_0x228e4e){if(_0x228e4e){return _0x228e4e[_0xd0a0('0x24')](_0x26bfc6)[_0xd0a0('0x25')](function(_0x31d554){return _0x31d554;});}return null;};}function removeEntity(_0x147821,_0x23c008){return function(_0x36893a){if(_0x36893a){return _0x36893a['destroy']()[_0xd0a0('0x25')](function(){_0x147821['status'](0xcc)[_0xd0a0('0x19')]();});}};}function handleEntityNotFound(_0x4d9085,_0x5823c9){return function(_0x466d96){if(!_0x466d96){_0x4d9085[_0xd0a0('0x18')](0x194);}return _0x466d96;};}function handleError(_0x13d557,_0x3ee23f){_0x3ee23f=_0x3ee23f||0x1f4;return function(_0x4400cd){logger[_0xd0a0('0x26')](_0x4400cd[_0xd0a0('0x27')]);if(_0x4400cd[_0xd0a0('0x28')]){delete _0x4400cd[_0xd0a0('0x28')];}_0x13d557[_0xd0a0('0x1a')](_0x3ee23f)[_0xd0a0('0x29')](_0x4400cd);};}exports[_0xd0a0('0x2a')]=function(_0x2edcbc,_0x1580e5){var _0x4df364={},_0x445eaf={},_0x137f13={'count':0x0,'rows':[]};var _0x43041f=_[_0xd0a0('0x2b')](db['AnalyticFieldReport'][_0xd0a0('0x2c')],function(_0x1d1d53){return{'name':_0x1d1d53[_0xd0a0('0x2d')],'type':_0x1d1d53[_0xd0a0('0x2e')]['key']};});_0x445eaf[_0xd0a0('0x2f')]=_[_0xd0a0('0x2b')](_0x43041f,'name');_0x445eaf[_0xd0a0('0x30')]=_[_0xd0a0('0x31')](_0x2edcbc[_0xd0a0('0x30')]);_0x445eaf[_0xd0a0('0x32')]=_[_0xd0a0('0x33')](_0x445eaf[_0xd0a0('0x2f')],_0x445eaf['query']);_0x4df364[_0xd0a0('0x34')]=_[_0xd0a0('0x33')](_0x445eaf[_0xd0a0('0x2f')],qs['fields'](_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x35')]));_0x4df364[_0xd0a0('0x34')]=_0x4df364['attributes']['length']?_0x4df364[_0xd0a0('0x34')]:_0x445eaf[_0xd0a0('0x2f')];if(!_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x36')]('nolimit')){_0x4df364[_0xd0a0('0x1f')]=qs[_0xd0a0('0x1f')](_0x2edcbc['query'][_0xd0a0('0x1f')]);_0x4df364[_0xd0a0('0x1c')]=qs[_0xd0a0('0x1c')](_0x2edcbc['query'][_0xd0a0('0x1c')]);}_0x4df364[_0xd0a0('0x37')]=qs[_0xd0a0('0x38')](_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x38')]);_0x4df364[_0xd0a0('0x39')]=qs['filters'](_[_0xd0a0('0x3a')](_0x2edcbc[_0xd0a0('0x30')],_0x445eaf[_0xd0a0('0x32')]),_0x43041f);if(_0x2edcbc[_0xd0a0('0x30')][_0xd0a0('0x3b')]){_0x4df364[_0xd0a0('0x39')]=_['merge'](_0x4df364[_0xd0a0('0x39')],{'$or':_[_0xd0a0('0x2b')](_0x43041f,function(_0x319c5d){if(_0x319c5d[_0xd0a0('0x2e')]!=='VIRTUAL'){var _0xc90d01={};_0xc90d01[_0x319c5d['name']]={'$like':'%'+_0x2edcbc['query'][_0xd0a0('0x3b')]+'%'};return _0xc90d01;}})});}_0x4df364=_['merge']({},_0x4df364,_0x2edcbc['options']);var _0x59bd8a={'where':_0x4df364[_0xd0a0('0x39')]};return db[_0xd0a0('0x3c')][_0xd0a0('0x1e')](_0x59bd8a)[_0xd0a0('0x25')](function(_0x41e7b9){_0x137f13[_0xd0a0('0x1e')]=_0x41e7b9;if(_0x2edcbc[_0xd0a0('0x30')]['includeAll']){_0x4df364[_0xd0a0('0x3d')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0xd0a0('0x3e')](_0x4df364);})[_0xd0a0('0x25')](function(_0x363a2f){_0x137f13[_0xd0a0('0x3f')]=_0x363a2f;return _0x137f13;})[_0xd0a0('0x25')](respondWithFilteredResult(_0x1580e5,_0x4df364))['catch'](handleError(_0x1580e5,null));};exports[_0xd0a0('0x40')]=function(_0x28c83a,_0xeced8d){var _0x3e03ac={'raw':![],'where':{'id':_0x28c83a[_0xd0a0('0x41')]['id']}},_0x8d66ce={};_0x8d66ce[_0xd0a0('0x2f')]=_[_0xd0a0('0x31')](db[_0xd0a0('0x3c')][_0xd0a0('0x2c')]);_0x8d66ce[_0xd0a0('0x30')]=_[_0xd0a0('0x31')](_0x28c83a['query']);_0x8d66ce['filters']=_[_0xd0a0('0x33')](_0x8d66ce[_0xd0a0('0x2f')],_0x8d66ce['query']);_0x3e03ac[_0xd0a0('0x34')]=_[_0xd0a0('0x33')](_0x8d66ce[_0xd0a0('0x2f')],qs['fields'](_0x28c83a[_0xd0a0('0x30')]['fields']));_0x3e03ac[_0xd0a0('0x34')]=_0x3e03ac[_0xd0a0('0x34')]['length']?_0x3e03ac['attributes']:_0x8d66ce[_0xd0a0('0x2f')];if(_0x28c83a['query'][_0xd0a0('0x42')]){_0x3e03ac[_0xd0a0('0x3d')]=[{'all':!![]}];}_0x3e03ac=_[_0xd0a0('0x43')]({},_0x3e03ac,_0x28c83a[_0xd0a0('0x44')]);return db[_0xd0a0('0x3c')][_0xd0a0('0x45')](_0x3e03ac)[_0xd0a0('0x25')](handleEntityNotFound(_0xeced8d,null))['then'](respondWithResult(_0xeced8d,null))['catch'](handleError(_0xeced8d,null));};exports[_0xd0a0('0x46')]=function(_0x2fffc5,_0x31a259){return db[_0xd0a0('0x3c')][_0xd0a0('0x46')](_0x2fffc5[_0xd0a0('0x47')],{})[_0xd0a0('0x25')](respondWithResult(_0x31a259,0xc9))[_0xd0a0('0x48')](handleError(_0x31a259,null));};exports[_0xd0a0('0x49')]=function(_0x1c0c47,_0x39e4fd){return db[_0xd0a0('0x3c')][_0xd0a0('0x49')](_0x1c0c47[_0xd0a0('0x47')],{'raw':![],'individualHooks':!![]})[_0xd0a0('0x25')](respondWithResult(_0x39e4fd,0xc9))[_0xd0a0('0x48')](handleError(_0x39e4fd,null));};exports[_0xd0a0('0x24')]=function(_0x417f33,_0x349dce){if(_0x417f33[_0xd0a0('0x47')]['id']){delete _0x417f33['body']['id'];}return db[_0xd0a0('0x3c')]['find']({'where':{'id':_0x417f33['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x349dce,null))['then'](saveUpdates(_0x417f33[_0xd0a0('0x47')],null))[_0xd0a0('0x25')](respondWithResult(_0x349dce,null))[_0xd0a0('0x48')](handleError(_0x349dce,null));};exports[_0xd0a0('0x4a')]=function(_0x620a96,_0x266424){return db['AnalyticFieldReport'][_0xd0a0('0x45')]({'where':{'id':_0x620a96['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x266424,null))[_0xd0a0('0x25')](removeEntity(_0x266424,null))[_0xd0a0('0x48')](handleError(_0x266424,null));};exports[_0xd0a0('0x4b')]=function(_0x3d5e4c,_0x967b40){return db['AnalyticFieldReport']['destroy']({'where':{'id':_0x3d5e4c[_0xd0a0('0x30')][_0xd0a0('0x4c')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x967b40,0xcc))['catch'](handleError(_0x967b40,null));};exports[_0xd0a0('0x4d')]=function(_0x169db9,_0x2504cc,_0x14d19d){return db['AnalyticCustomReport']['findOne']({'where':{'id':_0x169db9['params']['id']}})[_0xd0a0('0x25')](handleEntityNotFound(_0x2504cc,null))['then'](function(_0x2deabd){if(_0x2deabd){return db[_0xd0a0('0x4e')][_0xd0a0('0x4f')](function(_0x5c5048){return db[_0xd0a0('0x3c')][_0xd0a0('0x4a')]({'where':{'CustomReportId':_0x169db9[_0xd0a0('0x41')]['id']},'transaction':_0x5c5048})[_0xd0a0('0x25')](function(_0x2fc9ae){var _0x252a67=_['map'](_0x169db9[_0xd0a0('0x47')],function(_0x59c219){delete _0x59c219['id'];_0x59c219[_0xd0a0('0x50')]=_0x169db9['params']['id'];return _0x59c219;});return db[_0xd0a0('0x3c')][_0xd0a0('0x49')](_0x252a67,{'transaction':_0x5c5048});});})[_0xd0a0('0x25')](function(){return db[_0xd0a0('0x3c')][_0xd0a0('0x3e')]({'where':{'CustomReportId':_0x169db9[_0xd0a0('0x41')]['id']}});});}})[_0xd0a0('0x25')](respondWithResult(_0x2504cc,null))[_0xd0a0('0x48')](handleError(_0x2504cc,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fad0012..9fdc516 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 _0x5465=['exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','rimraf','../../config/environment'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x5465,0x1aa));var _0x5546=function(_0x155b18,_0x1b209c){_0x155b18=_0x155b18-0x0;var _0x52aeac=_0x5465[_0x155b18];return _0x52aeac;};'use strict';var _=require(_0x5546('0x0'));var util=require(_0x5546('0x1'));var logger=require(_0x5546('0x2'))('api');var moment=require(_0x5546('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5546('0x4'));var config=require(_0x5546('0x5'));var attributes=require('./analyticFieldReport.attributes');module[_0x5546('0x6')]=function(_0x559dfa,_0xb17308){return _0x559dfa['define'](_0x5546('0x7'),attributes,{'tableName':_0x5546('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8a2b=['bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields','lodash','util','../../config/logger','api','moment'];(function(_0x51cc24,_0x4ff185){var _0x2656b9=function(_0x2438e6){while(--_0x2438e6){_0x51cc24['push'](_0x51cc24['shift']());}};_0x2656b9(++_0x4ff185);}(_0x8a2b,0x140));var _0xb8a2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a2b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb8a2('0x0'));var util=require(_0xb8a2('0x1'));var logger=require(_0xb8a2('0x2'))(_0xb8a2('0x3'));var moment=require(_0xb8a2('0x4'));var BPromise=require(_0xb8a2('0x5'));var rp=require(_0xb8a2('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb8a2('0x7'));var config=require(_0xb8a2('0x8'));var attributes=require(_0xb8a2('0x9'));module[_0xb8a2('0xa')]=function(_0x57418d,_0x3e5d15){return _0x57418d[_0xb8a2('0xb')]('AnalyticFieldReport',attributes,{'tableName':_0xb8a2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 9e88ca6..8ea1ffb 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 _0x3897=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3fa911,_0x4618a6){var _0x1059e5=function(_0x144c36){while(--_0x144c36){_0x3fa911['push'](_0x3fa911['shift']());}};_0x1059e5(++_0x4618a6);}(_0x3897,0x103));var _0x7389=function(_0x5b7788,_0x309ae5){_0x5b7788=_0x5b7788-0x0;var _0x573871=_0x3897[_0x5b7788];return _0x573871;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7389('0x0'));var BPromise=require('bluebird');var rs=require(_0x7389('0x1'));var fs=require('fs');var Redis=require(_0x7389('0x2'));var db=require(_0x7389('0x3'))['db'];var utils=require(_0x7389('0x4'));var logger=require(_0x7389('0x5'))(_0x7389('0x6'));var config=require('../../config/environment');var jayson=require(_0x7389('0x7'));var client=jayson[_0x7389('0x8')][_0x7389('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x174d84,_0x4c7e6c,_0x2ad31c){return new BPromise(function(_0xdd4899,_0x391886){return client[_0x7389('0xa')](_0x174d84,_0x2ad31c)[_0x7389('0xb')](function(_0x2a9ec4){logger[_0x7389('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c7e6c,_0x7389('0xd'));logger[_0x7389('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4c7e6c,'request\x20sent',JSON[_0x7389('0xf')](_0x2a9ec4));if(_0x2a9ec4[_0x7389('0x10')]){if(_0x2a9ec4['error'][_0x7389('0x11')]===0x1f4){logger[_0x7389('0x10')](_0x7389('0x12'),_0x4c7e6c,_0x2a9ec4[_0x7389('0x10')]['message']);return _0x391886(_0x2a9ec4[_0x7389('0x10')][_0x7389('0x13')]);}logger[_0x7389('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c7e6c,_0x2a9ec4[_0x7389('0x10')][_0x7389('0x13')]);return _0xdd4899(_0x2a9ec4['error'][_0x7389('0x13')]);}else{logger[_0x7389('0xc')](_0x7389('0x12'),_0x4c7e6c,_0x7389('0xd'));_0xdd4899(_0x2a9ec4[_0x7389('0x14')]['message']);}})[_0x7389('0x15')](function(_0x46ce7){logger[_0x7389('0x10')](_0x7389('0x12'),_0x4c7e6c,_0x46ce7);_0x391886(_0x46ce7);});});} \ No newline at end of file +var _0x0294=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring'];(function(_0x586a8a,_0x1ed840){var _0x4fb71d=function(_0x311e85){while(--_0x311e85){_0x586a8a['push'](_0x586a8a['shift']());}};_0x4fb71d(++_0x1ed840);}(_0x0294,0x9c));var _0x4029=function(_0x4c4428,_0xf19bb0){_0x4c4428=_0x4c4428-0x0;var _0x275e73=_0x0294[_0x4c4428];return _0x275e73;};'use strict';var _=require(_0x4029('0x0'));var util=require(_0x4029('0x1'));var moment=require(_0x4029('0x2'));var BPromise=require(_0x4029('0x3'));var rs=require(_0x4029('0x4'));var fs=require('fs');var Redis=require(_0x4029('0x5'));var db=require(_0x4029('0x6'))['db'];var utils=require(_0x4029('0x7'));var logger=require('../../config/logger')(_0x4029('0x8'));var config=require(_0x4029('0x9'));var jayson=require(_0x4029('0xa'));var client=jayson[_0x4029('0xb')][_0x4029('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d4f17,_0x163d39,_0x438e98){return new BPromise(function(_0x1a4818,_0x36c43){return client['request'](_0x1d4f17,_0x438e98)[_0x4029('0xd')](function(_0x28f0a0){logger[_0x4029('0xe')](_0x4029('0xf'),_0x163d39,_0x4029('0x10'));logger[_0x4029('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x163d39,_0x4029('0x10'),JSON[_0x4029('0x12')](_0x28f0a0));if(_0x28f0a0[_0x4029('0x13')]){if(_0x28f0a0['error'][_0x4029('0x14')]===0x1f4){logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x28f0a0[_0x4029('0x13')][_0x4029('0x15')]);return _0x36c43(_0x28f0a0[_0x4029('0x13')][_0x4029('0x15')]);}logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x28f0a0['error'][_0x4029('0x15')]);return _0x1a4818(_0x28f0a0[_0x4029('0x13')]['message']);}else{logger[_0x4029('0xe')](_0x4029('0xf'),_0x163d39,'request\x20sent');_0x1a4818(_0x28f0a0[_0x4029('0x16')][_0x4029('0x15')]);}})['catch'](function(_0x25270d){logger[_0x4029('0x13')](_0x4029('0xf'),_0x163d39,_0x25270d);_0x36c43(_0x25270d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 9f227ec..45c9d59 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(_0x108710,_0x382c40){var _0x4d6483=function(_0xbc5a9b){while(--_0xbc5a9b){_0x108710['push'](_0x108710['shift']());}};_0x4d6483(++_0x382c40);}(_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('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(_0x52224b,_0x5d5d40){var _0x25ec5e=function(_0x1aa21c){while(--_0x1aa21c){_0x52224b['push'](_0x52224b['shift']());}};_0x25ec5e(++_0x5d5d40);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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 e374493..28c3f52 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 _0xa571=['STRING','name','TEXT','sequelize','exports'];(function(_0x1d2adf,_0x8b056f){var _0x431bd7=function(_0x2785a7){while(--_0x2785a7){_0x1d2adf['push'](_0x1d2adf['shift']());}};_0x431bd7(++_0x8b056f);}(_0xa571,0x107));var _0x1a57=function(_0x200131,_0x4041e5){_0x200131=_0x200131-0x0;var _0x1f87f2=_0xa571[_0x200131];return _0x1f87f2;};'use strict';var Sequelize=require(_0x1a57('0x0'));module[_0x1a57('0x1')]={'name':{'type':Sequelize[_0x1a57('0x2')],'allowNull':![],'unique':_0x1a57('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x1a57('0x4')]},'description':{'type':Sequelize[_0x1a57('0x2')]}}; \ No newline at end of file +var _0xb9a7=['exports','TEXT'];(function(_0x18c326,_0x42e955){var _0x22eb44=function(_0xc20de9){while(--_0xc20de9){_0x18c326['push'](_0x18c326['shift']());}};_0x22eb44(++_0x42e955);}(_0xb9a7,0x112));var _0x7b9a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xb9a7[_0x342baa];return _0x1208f3;};'use strict';var Sequelize=require('sequelize');module[_0x7b9a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize[_0x7b9a('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 2a4a0a5..e0b45bd 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(_0x13d356,_0x300946){var _0x307728=function(_0xef4834){while(--_0xef4834){_0x13d356['push'](_0x13d356['shift']());}};_0x307728(++_0x300946);}(_0x55ca,0x126));var _0xa55c=function(_0x32f38b,_0x1b4fc7){_0x32f38b=_0x32f38b-0x0;var _0x15ec9b=_0x55ca[_0x32f38b];return _0x15ec9b;};'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 _0x98a8=['../../mysqldb','end','status','json','undefined','count','offset','apply','reject','save','update','then','destroy','get','UserProfileResource','sendStatus','name','send','index','map','AnalyticMetric','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Metrics','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','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(_0x1d082c,_0xe33399){var _0x135ef2=function(_0x239eb5){while(--_0x239eb5){_0x1d082c['push'](_0x1d082c['shift']());}};_0x135ef2(++_0xe33399);}(_0x98a8,0x12c));var _0x898a=function(_0x47138d,_0x444fc8){_0x47138d=_0x47138d-0x0;var _0x486875=_0x98a8[_0x47138d];return _0x486875;};'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'];function respondWithStatusCode(_0x2c76b7,_0x364a23){_0x364a23=_0x364a23||0xcc;return function(_0x5f5e06){if(_0x5f5e06){return _0x2c76b7['sendStatus'](_0x364a23);}return _0x2c76b7['status'](_0x364a23)[_0x898a('0x19')]();};}function respondWithResult(_0x1f5be4,_0xb24335){_0xb24335=_0xb24335||0xc8;return function(_0x116fbe){if(_0x116fbe){return _0x1f5be4[_0x898a('0x1a')](_0xb24335)[_0x898a('0x1b')](_0x116fbe);}};}function respondWithFilteredResult(_0x506023,_0x47033c){return function(_0x53a4b8){if(_0x53a4b8){var _0x3fec7a=typeof _0x47033c['offset']===_0x898a('0x1c')&&typeof _0x47033c['limit']===_0x898a('0x1c');var _0x56f8f9=_0x53a4b8[_0x898a('0x1d')];var _0x3197f7=_0x3fec7a?0x0:_0x47033c[_0x898a('0x1e')];var _0x4ddd4d=_0x3fec7a?_0x53a4b8[_0x898a('0x1d')]:_0x47033c['offset']+_0x47033c['limit'];var _0x3f8af4;if(_0x4ddd4d>=_0x56f8f9){_0x4ddd4d=_0x56f8f9;_0x3f8af4=0xc8;}else{_0x3f8af4=0xce;}_0x506023[_0x898a('0x1a')](_0x3f8af4);return _0x506023['set']('Content-Range',_0x3197f7+'-'+_0x4ddd4d+'/'+_0x56f8f9)[_0x898a('0x1b')](_0x53a4b8);}return null;};}function patchUpdates(_0x26449a){return function(_0x38a8f0){try{jsonpatch[_0x898a('0x1f')](_0x38a8f0,_0x26449a,!![]);}catch(_0x2da52d){return BPromise[_0x898a('0x20')](_0x2da52d);}return _0x38a8f0[_0x898a('0x21')]();};}function saveUpdates(_0x483212,_0x247cfc){return function(_0x50718e){if(_0x50718e){return _0x50718e[_0x898a('0x22')](_0x483212)[_0x898a('0x23')](function(_0x30495a){return _0x30495a;});}return null;};}function removeEntity(_0x310bfa,_0x4e254d){return function(_0x274cdf){if(_0x274cdf){return _0x274cdf[_0x898a('0x24')]()[_0x898a('0x23')](function(){var _0x32eca5=_0x274cdf[_0x898a('0x25')]({'plain':!![]});var _0x1426e3='Metrics';return db[_0x898a('0x26')]['destroy']({'where':{'type':_0x1426e3,'resourceId':_0x32eca5['id']}})['then'](function(){return _0x274cdf;});})['then'](function(){_0x310bfa[_0x898a('0x1a')](0xcc)[_0x898a('0x19')]();});}};}function handleEntityNotFound(_0x420b25,_0x40b3db){return function(_0x28ae6a){if(!_0x28ae6a){_0x420b25[_0x898a('0x27')](0x194);}return _0x28ae6a;};}function handleError(_0x398e98,_0xac1fc4){_0xac1fc4=_0xac1fc4||0x1f4;return function(_0xd31922){logger['error'](_0xd31922['stack']);if(_0xd31922['name']){delete _0xd31922[_0x898a('0x28')];}_0x398e98[_0x898a('0x1a')](_0xac1fc4)[_0x898a('0x29')](_0xd31922);};}exports[_0x898a('0x2a')]=function(_0x34f447,_0x560000){var _0xe3c983={},_0xf74645={},_0x18773a={'count':0x0,'rows':[]};var _0x4287da=_[_0x898a('0x2b')](db[_0x898a('0x2c')]['rawAttributes'],function(_0x7a1eb5){return{'name':_0x7a1eb5[_0x898a('0x2d')],'type':_0x7a1eb5[_0x898a('0x2e')][_0x898a('0x2f')]};});_0xf74645[_0x898a('0x30')]=_['map'](_0x4287da,'name');_0xf74645[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34f447[_0x898a('0x31')]);_0xf74645['filters']=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],_0xf74645[_0x898a('0x31')]);_0xe3c983[_0x898a('0x34')]=_[_0x898a('0x33')](_0xf74645[_0x898a('0x30')],qs[_0x898a('0x35')](_0x34f447[_0x898a('0x31')]['fields']));_0xe3c983[_0x898a('0x34')]=_0xe3c983['attributes']['length']?_0xe3c983[_0x898a('0x34')]:_0xf74645['model'];if(!_0x34f447[_0x898a('0x31')]['hasOwnProperty'](_0x898a('0x36'))){_0xe3c983['limit']=qs[_0x898a('0x37')](_0x34f447[_0x898a('0x31')][_0x898a('0x37')]);_0xe3c983['offset']=qs['offset'](_0x34f447['query'][_0x898a('0x1e')]);}_0xe3c983[_0x898a('0x38')]=qs['sort'](_0x34f447[_0x898a('0x31')][_0x898a('0x39')]);_0xe3c983[_0x898a('0x3a')]=qs[_0x898a('0x3b')](_['pick'](_0x34f447['query'],_0xf74645[_0x898a('0x3b')]),_0x4287da);if(_0x34f447[_0x898a('0x31')]['filter']){_0xe3c983['where']=_[_0x898a('0x3c')](_0xe3c983[_0x898a('0x3a')],{'$or':_[_0x898a('0x2b')](_0x4287da,function(_0xa45405){if(_0xa45405['type']!==_0x898a('0x3d')){var _0x369c02={};_0x369c02[_0xa45405['name']]={'$like':'%'+_0x34f447['query']['filter']+'%'};return _0x369c02;}})});}_0xe3c983=_[_0x898a('0x3c')]({},_0xe3c983,_0x34f447[_0x898a('0x3e')]);var _0x35d767={'where':_0xe3c983[_0x898a('0x3a')]};return db[_0x898a('0x2c')][_0x898a('0x1d')](_0x35d767)[_0x898a('0x23')](function(_0x1432ec){_0x18773a[_0x898a('0x1d')]=_0x1432ec;if(_0x34f447[_0x898a('0x31')][_0x898a('0x3f')]){_0xe3c983[_0x898a('0x40')]=[{'all':!![]}];}return db[_0x898a('0x2c')][_0x898a('0x41')](_0xe3c983);})[_0x898a('0x23')](function(_0x4c8628){_0x18773a[_0x898a('0x42')]=_0x4c8628;return _0x18773a;})[_0x898a('0x23')](respondWithFilteredResult(_0x560000,_0xe3c983))[_0x898a('0x43')](handleError(_0x560000,null));};exports['show']=function(_0x34029e,_0x2e5451){var _0x3a8663={'raw':!![],'where':{'id':_0x34029e[_0x898a('0x44')]['id']}},_0x6ab441={};_0x6ab441[_0x898a('0x30')]=_[_0x898a('0x32')](db[_0x898a('0x2c')]['rawAttributes']);_0x6ab441[_0x898a('0x31')]=_[_0x898a('0x32')](_0x34029e[_0x898a('0x31')]);_0x6ab441[_0x898a('0x3b')]=_['intersection'](_0x6ab441[_0x898a('0x30')],_0x6ab441[_0x898a('0x31')]);_0x3a8663['attributes']=_[_0x898a('0x33')](_0x6ab441['model'],qs[_0x898a('0x35')](_0x34029e['query']['fields']));_0x3a8663[_0x898a('0x34')]=_0x3a8663['attributes'][_0x898a('0x45')]?_0x3a8663[_0x898a('0x34')]:_0x6ab441['model'];if(_0x34029e[_0x898a('0x31')][_0x898a('0x3f')]){_0x3a8663['include']=[{'all':!![]}];}_0x3a8663=_[_0x898a('0x3c')]({},_0x3a8663,_0x34029e[_0x898a('0x3e')]);return db[_0x898a('0x2c')][_0x898a('0x46')](_0x3a8663)['then'](handleEntityNotFound(_0x2e5451,null))[_0x898a('0x23')](respondWithResult(_0x2e5451,null))[_0x898a('0x43')](handleError(_0x2e5451,null));};exports['create']=function(_0x25adcc,_0x1d8c16){return db['AnalyticMetric'][_0x898a('0x47')](_0x25adcc['body'],{})[_0x898a('0x23')](function(_0x41f291){var _0x32ccb9=_0x25adcc['user'][_0x898a('0x25')]({'plain':!![]});if(!_0x32ccb9)throw new Error(_0x898a('0x48'));if(_0x32ccb9[_0x898a('0x49')]===_0x898a('0x4a')){var _0x5a8a2c=_0x41f291[_0x898a('0x25')]({'plain':!![]});var _0x529d7c=_0x898a('0x4b');return db[_0x898a('0x4c')][_0x898a('0x46')]({'where':{'name':_0x529d7c,'userProfileId':_0x32ccb9['userProfileId']},'raw':!![]})[_0x898a('0x23')](function(_0x3c4db0){if(_0x3c4db0&&_0x3c4db0[_0x898a('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x5a8a2c[_0x898a('0x28')],'resourceId':_0x5a8a2c['id'],'type':_0x3c4db0[_0x898a('0x28')],'sectionId':_0x3c4db0['id']},{})[_0x898a('0x23')](function(){return _0x41f291;});}else{return _0x41f291;}})[_0x898a('0x43')](function(_0x28b8c9){logger[_0x898a('0x4e')](_0x898a('0x4f'),_0x28b8c9);throw _0x28b8c9;});}return _0x41f291;})[_0x898a('0x23')](respondWithResult(_0x1d8c16,0xc9))[_0x898a('0x43')](handleError(_0x1d8c16,null));};exports[_0x898a('0x22')]=function(_0x2382a9,_0x5e9329){if(_0x2382a9[_0x898a('0x50')]['id']){delete _0x2382a9[_0x898a('0x50')]['id'];}return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x2382a9['params']['id']}})['then'](handleEntityNotFound(_0x5e9329,null))[_0x898a('0x23')](saveUpdates(_0x2382a9[_0x898a('0x50')],null))[_0x898a('0x23')](respondWithResult(_0x5e9329,null))['catch'](handleError(_0x5e9329,null));};exports['destroy']=function(_0x11a07a,_0x1f5e4b){return db['AnalyticMetric'][_0x898a('0x46')]({'where':{'id':_0x11a07a[_0x898a('0x44')]['id']}})['then'](handleEntityNotFound(_0x1f5e4b,null))[_0x898a('0x23')](removeEntity(_0x1f5e4b,null))[_0x898a('0x43')](handleError(_0x1f5e4b,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 601743f..568050f 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 _0xaf1b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','AnalyticMetric','lodash','util','../../config/logger','api'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0xaf1b,0x11a));var _0xbaf1=function(_0xfad108,_0x1f02b5){_0xfad108=_0xfad108-0x0;var _0x2efce9=_0xaf1b[_0xfad108];return _0x2efce9;};'use strict';var _=require(_0xbaf1('0x0'));var util=require(_0xbaf1('0x1'));var logger=require(_0xbaf1('0x2'))(_0xbaf1('0x3'));var moment=require(_0xbaf1('0x4'));var BPromise=require(_0xbaf1('0x5'));var rp=require(_0xbaf1('0x6'));var fs=require('fs');var path=require(_0xbaf1('0x7'));var rimraf=require(_0xbaf1('0x8'));var config=require(_0xbaf1('0x9'));var attributes=require(_0xbaf1('0xa'));module[_0xbaf1('0xb')]=function(_0x7dd657,_0x2f05ad){return _0x7dd657['define'](_0xbaf1('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90b1=['define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x559702,_0x2fa1a9){var _0x25a86b=function(_0x1fb936){while(--_0x1fb936){_0x559702['push'](_0x559702['shift']());}};_0x25a86b(++_0x2fa1a9);}(_0x90b1,0x1bb));var _0x190b=function(_0x229564,_0x5e5fc6){_0x229564=_0x229564-0x0;var _0x5c8aaf=_0x90b1[_0x229564];return _0x5c8aaf;};'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('./analyticMetric.attributes');module['exports']=function(_0x5da9c1,_0x27ff8c){return _0x5da9c1[_0x190b('0x7')](_0x190b('0x8'),attributes,{'tableName':_0x190b('0x9'),'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 f96418f..a1d89ab 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 _0x0ec1=['http','request','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x0ec1,0x18a));var _0x10ec=function(_0x170504,_0x26d44d){_0x170504=_0x170504-0x0;var _0x848214=_0x0ec1[_0x170504];return _0x848214;};'use strict';var _=require(_0x10ec('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x10ec('0x1'));var rs=require(_0x10ec('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x10ec('0x3'))('rpc');var config=require(_0x10ec('0x4'));var jayson=require(_0x10ec('0x5'));var client=jayson['client'][_0x10ec('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4ef4a3,_0x32b345,_0x14fa91){return new BPromise(function(_0x1ea0fb,_0x88b0fc){return client[_0x10ec('0x7')](_0x4ef4a3,_0x14fa91)[_0x10ec('0x8')](function(_0x5bd0ab){logger[_0x10ec('0x9')](_0x10ec('0xa'),_0x32b345,'request\x20sent');logger[_0x10ec('0xb')](_0x10ec('0xc'),_0x32b345,_0x10ec('0xd'),JSON[_0x10ec('0xe')](_0x5bd0ab));if(_0x5bd0ab[_0x10ec('0xf')]){if(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x10')]===0x1f4){logger[_0x10ec('0xf')](_0x10ec('0xa'),_0x32b345,_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);return _0x88b0fc(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);}logger[_0x10ec('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x32b345,_0x5bd0ab[_0x10ec('0xf')]['message']);return _0x1ea0fb(_0x5bd0ab[_0x10ec('0xf')][_0x10ec('0x11')]);}else{logger[_0x10ec('0x9')](_0x10ec('0xa'),_0x32b345,'request\x20sent');_0x1ea0fb(_0x5bd0ab[_0x10ec('0x12')]['message']);}})[_0x10ec('0x13')](function(_0x23174b){logger[_0x10ec('0xf')](_0x10ec('0xa'),_0x32b345,_0x23174b);_0x88b0fc(_0x23174b);});});} \ No newline at end of file +var _0x5fe7=['../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x23ac72,_0x14386b){var _0xee2497=function(_0x201692){while(--_0x201692){_0x23ac72['push'](_0x23ac72['shift']());}};_0xee2497(++_0x14386b);}(_0x5fe7,0xa8));var _0x75fe=function(_0x454383,_0x9883dc){_0x454383=_0x454383-0x0;var _0x582724=_0x5fe7[_0x454383];return _0x582724;};'use strict';var _=require('lodash');var util=require(_0x75fe('0x0'));var moment=require(_0x75fe('0x1'));var BPromise=require(_0x75fe('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x75fe('0x3'));var logger=require(_0x75fe('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x75fe('0x5'));var client=jayson[_0x75fe('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e19d7,_0x190732,_0x11bf61){return new BPromise(function(_0x243689,_0x4967da){return client[_0x75fe('0x7')](_0x4e19d7,_0x11bf61)[_0x75fe('0x8')](function(_0xfa2f67){logger[_0x75fe('0x9')](_0x75fe('0xa'),_0x190732,_0x75fe('0xb'));logger[_0x75fe('0xc')](_0x75fe('0xd'),_0x190732,_0x75fe('0xb'),JSON[_0x75fe('0xe')](_0xfa2f67));if(_0xfa2f67[_0x75fe('0xf')]){if(_0xfa2f67[_0x75fe('0xf')][_0x75fe('0x10')]===0x1f4){logger[_0x75fe('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x190732,_0xfa2f67[_0x75fe('0xf')]['message']);return _0x4967da(_0xfa2f67['error']['message']);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x190732,_0xfa2f67[_0x75fe('0xf')][_0x75fe('0x11')]);return _0x243689(_0xfa2f67[_0x75fe('0xf')]['message']);}else{logger['info'](_0x75fe('0xa'),_0x190732,_0x75fe('0xb'));_0x243689(_0xfa2f67['result'][_0x75fe('0x11')]);}})[_0x75fe('0x12')](function(_0x3ede77){logger['error'](_0x75fe('0xa'),_0x190732,_0x3ede77);_0x4967da(_0x3ede77);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 1cd23ca..22acfbf 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 _0x5502=['create','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x325688,_0x3a55bd){var _0x588277=function(_0x32b3db){while(--_0x32b3db){_0x325688['push'](_0x325688['shift']());}};_0x588277(++_0x3a55bd);}(_0x5502,0x69));var _0x2550=function(_0x5be9a6,_0x1df31c){_0x5be9a6=_0x5be9a6-0x0;var _0x5dd8e1=_0x5502[_0x5be9a6];return _0x5dd8e1;};'use strict';var multer=require(_0x2550('0x0'));var util=require(_0x2550('0x1'));var path=require(_0x2550('0x2'));var timeout=require(_0x2550('0x3'));var express=require(_0x2550('0x4'));var router=express[_0x2550('0x5')]();var fs_extra=require(_0x2550('0x6'));var auth=require(_0x2550('0x7'));var interaction=require(_0x2550('0x8'));var config=require(_0x2550('0x9'));var controller=require(_0x2550('0xa'));router[_0x2550('0xb')]('/',auth[_0x2550('0xc')](),controller['index']);router[_0x2550('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x2550('0xd')]);router[_0x2550('0xe')]('/',auth['isAuthenticated'](),controller[_0x2550('0xf')]);router['put'](_0x2550('0x10'),auth[_0x2550('0xc')](),controller[_0x2550('0x11')]);router[_0x2550('0x12')](_0x2550('0x10'),auth[_0x2550('0xc')](),controller['destroy']);module[_0x2550('0x13')]=router; \ No newline at end of file +var _0xf698=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8800fa,_0x4c1902){var _0x2e4faf=function(_0xa5da1f){while(--_0xa5da1f){_0x8800fa['push'](_0x8800fa['shift']());}};_0x2e4faf(++_0x4c1902);}(_0xf698,0x1de));var _0x8f69=function(_0x5ad07c,_0x324dcd){_0x5ad07c=_0x5ad07c-0x0;var _0x204bae=_0xf698[_0x5ad07c];return _0x204bae;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var fs_extra=require(_0x8f69('0x4'));var auth=require(_0x8f69('0x5'));var interaction=require(_0x8f69('0x6'));var config=require(_0x8f69('0x7'));var controller=require('./analyticMetric.controller');router[_0x8f69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xb')]);router[_0x8f69('0xc')]('/',auth[_0x8f69('0xa')](),controller[_0x8f69('0xd')]);router[_0x8f69('0xe')](_0x8f69('0x9'),auth[_0x8f69('0xa')](),controller[_0x8f69('0xf')]);router[_0x8f69('0x10')](_0x8f69('0x9'),auth['isAuthenticated'](),controller[_0x8f69('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 25d9ab6..796d033 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 _0x9d4a=['exports','sequelize'];(function(_0x4f8a7b,_0x4f9ea9){var _0x525fd3=function(_0x101c79){while(--_0x101c79){_0x4f8a7b['push'](_0x4f8a7b['shift']());}};_0x525fd3(++_0x4f9ea9);}(_0x9d4a,0x197));var _0xa9d4=function(_0x47f48b,_0x2048d8){_0x47f48b=_0x47f48b-0x0;var _0x19c0ed=_0x9d4a[_0x47f48b];return _0x19c0ed;};'use strict';var Sequelize=require(_0xa9d4('0x0'));module[_0xa9d4('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0xce9d=['sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xce9d,0x1f0));var _0xdce9=function(_0xc39c0c,_0x15827b){_0xc39c0c=_0xc39c0c-0x0;var _0x12cddf=_0xce9d[_0xc39c0c];return _0x12cddf;};'use strict';var Sequelize=require(_0xdce9('0x0'));module[_0xdce9('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 6b5b01e..9ad7136 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 _0xbdae=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','map','AnalyticTreeReport','rawAttributes','fieldName','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','options','find','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js'];(function(_0x38d99c,_0x584720){var _0x58d58e=function(_0x2b15cc){while(--_0x2b15cc){_0x38d99c['push'](_0x38d99c['shift']());}};_0x58d58e(++_0x584720);}(_0xbdae,0x1be));var _0xebda=function(_0x5ded2a,_0x2b3e6a){_0x5ded2a=_0x5ded2a-0x0;var _0x403110=_0xbdae[_0x5ded2a];return _0x403110;};'use strict';var emlformat=require(_0xebda('0x0'));var rimraf=require(_0xebda('0x1'));var zipdir=require(_0xebda('0x2'));var jsonpatch=require(_0xebda('0x3'));var rp=require(_0xebda('0x4'));var moment=require(_0xebda('0x5'));var BPromise=require(_0xebda('0x6'));var Mustache=require(_0xebda('0x7'));var util=require('util');var path=require(_0xebda('0x8'));var sox=require(_0xebda('0x9'));var csv=require(_0xebda('0xa'));var ejs=require(_0xebda('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xebda('0xc'));var squel=require(_0xebda('0xd'));var crypto=require(_0xebda('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xebda('0xf'));var toCsv=require('to-csv');var querystring=require(_0xebda('0x10'));var Papa=require(_0xebda('0x11'));var Redis=require(_0xebda('0x12'));var authService=require(_0xebda('0x13'));var qs=require(_0xebda('0x14'));var as=require(_0xebda('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xebda('0x16'));var utils=require(_0xebda('0x17'));var config=require(_0xebda('0x18'));var licenseUtil=require(_0xebda('0x19'));var db=require(_0xebda('0x1a'))['db'];function respondWithStatusCode(_0x16c772,_0x48db6e){_0x48db6e=_0x48db6e||0xcc;return function(_0x2e6a40){if(_0x2e6a40){return _0x16c772[_0xebda('0x1b')](_0x48db6e);}return _0x16c772[_0xebda('0x1c')](_0x48db6e)['end']();};}function respondWithResult(_0xf24900,_0x428ebd){_0x428ebd=_0x428ebd||0xc8;return function(_0x94d8f0){if(_0x94d8f0){return _0xf24900[_0xebda('0x1c')](_0x428ebd)['json'](_0x94d8f0);}};}function respondWithFilteredResult(_0x6ff14c,_0x8f8d0a){return function(_0x33bae1){if(_0x33bae1){var _0x49fa3b=typeof _0x8f8d0a[_0xebda('0x1d')]===_0xebda('0x1e')&&typeof _0x8f8d0a[_0xebda('0x1f')]===_0xebda('0x1e');var _0x3e1971=_0x33bae1[_0xebda('0x20')];var _0x513501=_0x49fa3b?0x0:_0x8f8d0a[_0xebda('0x1d')];var _0x2beb8e=_0x49fa3b?_0x33bae1[_0xebda('0x20')]:_0x8f8d0a['offset']+_0x8f8d0a[_0xebda('0x1f')];var _0x1e7ed9;if(_0x2beb8e>=_0x3e1971){_0x2beb8e=_0x3e1971;_0x1e7ed9=0xc8;}else{_0x1e7ed9=0xce;}_0x6ff14c[_0xebda('0x1c')](_0x1e7ed9);return _0x6ff14c[_0xebda('0x21')](_0xebda('0x22'),_0x513501+'-'+_0x2beb8e+'/'+_0x3e1971)[_0xebda('0x23')](_0x33bae1);}return null;};}function patchUpdates(_0x1866d0){return function(_0x3b1701){try{jsonpatch[_0xebda('0x24')](_0x3b1701,_0x1866d0,!![]);}catch(_0x426311){return BPromise[_0xebda('0x25')](_0x426311);}return _0x3b1701[_0xebda('0x26')]();};}function saveUpdates(_0x352ea5,_0x25c0b3){return function(_0x5e32ad){if(_0x5e32ad){return _0x5e32ad[_0xebda('0x27')](_0x352ea5)[_0xebda('0x28')](function(_0x1bbb38){return _0x1bbb38;});}return null;};}function removeEntity(_0x26d691,_0x45c6a6){return function(_0x329fae){if(_0x329fae){return _0x329fae[_0xebda('0x29')]()[_0xebda('0x28')](function(){_0x26d691[_0xebda('0x1c')](0xcc)[_0xebda('0x2a')]();});}};}function handleEntityNotFound(_0x23415f,_0x1f6b01){return function(_0x3275c6){if(!_0x3275c6){_0x23415f['sendStatus'](0x194);}return _0x3275c6;};}function handleError(_0x4cd486,_0x568447){_0x568447=_0x568447||0x1f4;return function(_0x48499f){logger[_0xebda('0x2b')](_0x48499f[_0xebda('0x2c')]);if(_0x48499f[_0xebda('0x2d')]){delete _0x48499f[_0xebda('0x2d')];}_0x4cd486['status'](_0x568447)['send'](_0x48499f);};}exports['index']=function(_0x53a2aa,_0x561bbc){var _0x15c65b={},_0x46dd9a={},_0x574c1d={'count':0x0,'rows':[]};var _0x3a0480=_[_0xebda('0x2e')](db[_0xebda('0x2f')][_0xebda('0x30')],function(_0x4e1e9a){return{'name':_0x4e1e9a[_0xebda('0x31')],'type':_0x4e1e9a['type']['key']};});_0x46dd9a[_0xebda('0x32')]=_[_0xebda('0x2e')](_0x3a0480,_0xebda('0x2d'));_0x46dd9a['query']=_[_0xebda('0x33')](_0x53a2aa[_0xebda('0x34')]);_0x46dd9a[_0xebda('0x35')]=_[_0xebda('0x36')](_0x46dd9a[_0xebda('0x32')],_0x46dd9a[_0xebda('0x34')]);_0x15c65b[_0xebda('0x37')]=_[_0xebda('0x36')](_0x46dd9a['model'],qs[_0xebda('0x38')](_0x53a2aa[_0xebda('0x34')][_0xebda('0x38')]));_0x15c65b[_0xebda('0x37')]=_0x15c65b['attributes'][_0xebda('0x39')]?_0x15c65b[_0xebda('0x37')]:_0x46dd9a[_0xebda('0x32')];if(!_0x53a2aa['query']['hasOwnProperty'](_0xebda('0x3a'))){_0x15c65b[_0xebda('0x1f')]=qs['limit'](_0x53a2aa[_0xebda('0x34')][_0xebda('0x1f')]);_0x15c65b[_0xebda('0x1d')]=qs[_0xebda('0x1d')](_0x53a2aa['query'][_0xebda('0x1d')]);}_0x15c65b[_0xebda('0x3b')]=qs[_0xebda('0x3c')](_0x53a2aa[_0xebda('0x34')]['sort']);_0x15c65b[_0xebda('0x3d')]=qs[_0xebda('0x35')](_[_0xebda('0x3e')](_0x53a2aa[_0xebda('0x34')],_0x46dd9a[_0xebda('0x35')]),_0x3a0480);if(_0x53a2aa[_0xebda('0x34')][_0xebda('0x3f')]){_0x15c65b[_0xebda('0x3d')]=_[_0xebda('0x40')](_0x15c65b['where'],{'$or':_[_0xebda('0x2e')](_0x3a0480,function(_0x591f90){if(_0x591f90[_0xebda('0x41')]!==_0xebda('0x42')){var _0x480279={};_0x480279[_0x591f90[_0xebda('0x2d')]]={'$like':'%'+_0x53a2aa[_0xebda('0x34')][_0xebda('0x3f')]+'%'};return _0x480279;}})});}_0x15c65b=_[_0xebda('0x40')]({},_0x15c65b,_0x53a2aa['options']);var _0x1a1fb1={'where':_0x15c65b[_0xebda('0x3d')]};return db[_0xebda('0x2f')][_0xebda('0x20')](_0x1a1fb1)['then'](function(_0x295dc7){_0x574c1d[_0xebda('0x20')]=_0x295dc7;if(_0x53a2aa['query'][_0xebda('0x43')]){_0x15c65b[_0xebda('0x44')]=[{'all':!![]}];}return db[_0xebda('0x2f')][_0xebda('0x45')](_0x15c65b);})[_0xebda('0x28')](function(_0x5064d4){_0x574c1d['rows']=_0x5064d4;return _0x574c1d;})[_0xebda('0x28')](respondWithFilteredResult(_0x561bbc,_0x15c65b))[_0xebda('0x46')](handleError(_0x561bbc,null));};exports[_0xebda('0x47')]=function(_0x10cb5d,_0x4fb218){var _0x4e1b0c={'raw':!![],'where':{'id':_0x10cb5d['params']['id']}},_0x4e9830={};_0x4e9830[_0xebda('0x32')]=_[_0xebda('0x33')](db[_0xebda('0x2f')]['rawAttributes']);_0x4e9830[_0xebda('0x34')]=_['keys'](_0x10cb5d[_0xebda('0x34')]);_0x4e9830[_0xebda('0x35')]=_[_0xebda('0x36')](_0x4e9830[_0xebda('0x32')],_0x4e9830[_0xebda('0x34')]);_0x4e1b0c[_0xebda('0x37')]=_['intersection'](_0x4e9830[_0xebda('0x32')],qs[_0xebda('0x38')](_0x10cb5d['query']['fields']));_0x4e1b0c[_0xebda('0x37')]=_0x4e1b0c[_0xebda('0x37')][_0xebda('0x39')]?_0x4e1b0c[_0xebda('0x37')]:_0x4e9830['model'];if(_0x10cb5d[_0xebda('0x34')][_0xebda('0x43')]){_0x4e1b0c[_0xebda('0x44')]=[{'all':!![]}];}_0x4e1b0c=_['merge']({},_0x4e1b0c,_0x10cb5d[_0xebda('0x48')]);return db[_0xebda('0x2f')][_0xebda('0x49')](_0x4e1b0c)['then'](handleEntityNotFound(_0x4fb218,null))[_0xebda('0x28')](respondWithResult(_0x4fb218,null))[_0xebda('0x46')](handleError(_0x4fb218,null));};exports[_0xebda('0x4a')]=function(_0x3e44d1,_0x31645f){return db[_0xebda('0x2f')][_0xebda('0x4a')](_0x3e44d1[_0xebda('0x4b')],{})[_0xebda('0x28')](respondWithResult(_0x31645f,0xc9))[_0xebda('0x46')](handleError(_0x31645f,null));};exports[_0xebda('0x27')]=function(_0x5ce498,_0x224e30){if(_0x5ce498[_0xebda('0x4b')]['id']){delete _0x5ce498[_0xebda('0x4b')]['id'];}return db[_0xebda('0x2f')]['find']({'where':{'id':_0x5ce498[_0xebda('0x4c')]['id']}})[_0xebda('0x28')](handleEntityNotFound(_0x224e30,null))['then'](saveUpdates(_0x5ce498[_0xebda('0x4b')],null))[_0xebda('0x28')](respondWithResult(_0x224e30,null))[_0xebda('0x46')](handleError(_0x224e30,null));};exports[_0xebda('0x29')]=function(_0x59f396,_0x22d3e1){return db[_0xebda('0x2f')][_0xebda('0x49')]({'where':{'id':_0x59f396[_0xebda('0x4c')]['id']}})[_0xebda('0x28')](handleEntityNotFound(_0x22d3e1,null))[_0xebda('0x28')](removeEntity(_0x22d3e1,null))[_0xebda('0x46')](handleError(_0x22d3e1,null));}; \ No newline at end of file +var _0x9976=['zip-dir','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','apply','reject','save','update','then','destroy','name','send','index','map','AnalyticTreeReport','rawAttributes','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','params','keys','find','create','body','rimraf'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0x9976,0x93));var _0x6997=function(_0x1987b2,_0x420228){_0x1987b2=_0x1987b2-0x0;var _0x4659cb=_0x9976[_0x1987b2];return _0x4659cb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6997('0x0'));var zipdir=require(_0x6997('0x1'));var jsonpatch=require(_0x6997('0x2'));var rp=require(_0x6997('0x3'));var moment=require(_0x6997('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6997('0x5'));var path=require(_0x6997('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6997('0x7'));var fs=require('fs');var fs_extra=require(_0x6997('0x8'));var _=require(_0x6997('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6997('0xa'));var deskjs=require(_0x6997('0xb'));var toCsv=require(_0x6997('0xc'));var querystring=require(_0x6997('0xd'));var Papa=require(_0x6997('0xe'));var Redis=require(_0x6997('0xf'));var authService=require(_0x6997('0x10'));var qs=require(_0x6997('0x11'));var as=require(_0x6997('0x12'));var hardwareService=require(_0x6997('0x13'));var logger=require(_0x6997('0x14'))(_0x6997('0x15'));var utils=require(_0x6997('0x16'));var config=require(_0x6997('0x17'));var licenseUtil=require(_0x6997('0x18'));var db=require(_0x6997('0x19'))['db'];function respondWithStatusCode(_0x3a54aa,_0x3e9527){_0x3e9527=_0x3e9527||0xcc;return function(_0x1644a0){if(_0x1644a0){return _0x3a54aa[_0x6997('0x1a')](_0x3e9527);}return _0x3a54aa['status'](_0x3e9527)[_0x6997('0x1b')]();};}function respondWithResult(_0x383199,_0xafff69){_0xafff69=_0xafff69||0xc8;return function(_0x4569dd){if(_0x4569dd){return _0x383199[_0x6997('0x1c')](_0xafff69)[_0x6997('0x1d')](_0x4569dd);}};}function respondWithFilteredResult(_0x3f2575,_0x4c5882){return function(_0x36b3f2){if(_0x36b3f2){var _0xaf6035=typeof _0x4c5882['offset']===_0x6997('0x1e')&&typeof _0x4c5882['limit']===_0x6997('0x1e');var _0x574736=_0x36b3f2[_0x6997('0x1f')];var _0x2faf1b=_0xaf6035?0x0:_0x4c5882[_0x6997('0x20')];var _0x489f92=_0xaf6035?_0x36b3f2['count']:_0x4c5882['offset']+_0x4c5882['limit'];var _0x49f083;if(_0x489f92>=_0x574736){_0x489f92=_0x574736;_0x49f083=0xc8;}else{_0x49f083=0xce;}_0x3f2575['status'](_0x49f083);return _0x3f2575['set'](_0x6997('0x21'),_0x2faf1b+'-'+_0x489f92+'/'+_0x574736)[_0x6997('0x1d')](_0x36b3f2);}return null;};}function patchUpdates(_0x5d98ec){return function(_0x225f85){try{jsonpatch[_0x6997('0x22')](_0x225f85,_0x5d98ec,!![]);}catch(_0x4199bc){return BPromise[_0x6997('0x23')](_0x4199bc);}return _0x225f85[_0x6997('0x24')]();};}function saveUpdates(_0x1b3195,_0x4be39b){return function(_0x52af9e){if(_0x52af9e){return _0x52af9e[_0x6997('0x25')](_0x1b3195)[_0x6997('0x26')](function(_0x37d6ed){return _0x37d6ed;});}return null;};}function removeEntity(_0x3e05d3,_0x204417){return function(_0x1d6245){if(_0x1d6245){return _0x1d6245[_0x6997('0x27')]()[_0x6997('0x26')](function(){_0x3e05d3[_0x6997('0x1c')](0xcc)[_0x6997('0x1b')]();});}};}function handleEntityNotFound(_0x1d05c8,_0x4ab56f){return function(_0x1a36e3){if(!_0x1a36e3){_0x1d05c8[_0x6997('0x1a')](0x194);}return _0x1a36e3;};}function handleError(_0x42cfd4,_0x5539e2){_0x5539e2=_0x5539e2||0x1f4;return function(_0x2b7a4e){logger['error'](_0x2b7a4e['stack']);if(_0x2b7a4e[_0x6997('0x28')]){delete _0x2b7a4e['name'];}_0x42cfd4[_0x6997('0x1c')](_0x5539e2)[_0x6997('0x29')](_0x2b7a4e);};}exports[_0x6997('0x2a')]=function(_0x5c434b,_0x281b58){var _0xf4f3a2={},_0x1f5d62={},_0x1571db={'count':0x0,'rows':[]};var _0x4e0037=_[_0x6997('0x2b')](db[_0x6997('0x2c')][_0x6997('0x2d')],function(_0x5e0c19){return{'name':_0x5e0c19['fieldName'],'type':_0x5e0c19['type'][_0x6997('0x2e')]};});_0x1f5d62[_0x6997('0x2f')]=_[_0x6997('0x2b')](_0x4e0037,_0x6997('0x28'));_0x1f5d62[_0x6997('0x30')]=_['keys'](_0x5c434b[_0x6997('0x30')]);_0x1f5d62['filters']=_['intersection'](_0x1f5d62[_0x6997('0x2f')],_0x1f5d62[_0x6997('0x30')]);_0xf4f3a2['attributes']=_[_0x6997('0x31')](_0x1f5d62['model'],qs[_0x6997('0x32')](_0x5c434b['query'][_0x6997('0x32')]));_0xf4f3a2['attributes']=_0xf4f3a2[_0x6997('0x33')]['length']?_0xf4f3a2[_0x6997('0x33')]:_0x1f5d62[_0x6997('0x2f')];if(!_0x5c434b[_0x6997('0x30')][_0x6997('0x34')](_0x6997('0x35'))){_0xf4f3a2[_0x6997('0x36')]=qs[_0x6997('0x36')](_0x5c434b[_0x6997('0x30')][_0x6997('0x36')]);_0xf4f3a2[_0x6997('0x20')]=qs[_0x6997('0x20')](_0x5c434b['query'][_0x6997('0x20')]);}_0xf4f3a2[_0x6997('0x37')]=qs[_0x6997('0x38')](_0x5c434b[_0x6997('0x30')]['sort']);_0xf4f3a2[_0x6997('0x39')]=qs[_0x6997('0x3a')](_[_0x6997('0x3b')](_0x5c434b[_0x6997('0x30')],_0x1f5d62['filters']),_0x4e0037);if(_0x5c434b[_0x6997('0x30')]['filter']){_0xf4f3a2[_0x6997('0x39')]=_[_0x6997('0x3c')](_0xf4f3a2[_0x6997('0x39')],{'$or':_[_0x6997('0x2b')](_0x4e0037,function(_0x4a453a){if(_0x4a453a[_0x6997('0x3d')]!==_0x6997('0x3e')){var _0x40fbdb={};_0x40fbdb[_0x4a453a['name']]={'$like':'%'+_0x5c434b['query'][_0x6997('0x3f')]+'%'};return _0x40fbdb;}})});}_0xf4f3a2=_[_0x6997('0x3c')]({},_0xf4f3a2,_0x5c434b[_0x6997('0x40')]);var _0x528b6f={'where':_0xf4f3a2[_0x6997('0x39')]};return db['AnalyticTreeReport'][_0x6997('0x1f')](_0x528b6f)[_0x6997('0x26')](function(_0x52ccae){_0x1571db[_0x6997('0x1f')]=_0x52ccae;if(_0x5c434b['query'][_0x6997('0x41')]){_0xf4f3a2[_0x6997('0x42')]=[{'all':!![]}];}return db[_0x6997('0x2c')]['findAll'](_0xf4f3a2);})[_0x6997('0x26')](function(_0x53f271){_0x1571db['rows']=_0x53f271;return _0x1571db;})['then'](respondWithFilteredResult(_0x281b58,_0xf4f3a2))[_0x6997('0x43')](handleError(_0x281b58,null));};exports[_0x6997('0x44')]=function(_0x42301c,_0x235d8c){var _0x2d6f4b={'raw':!![],'where':{'id':_0x42301c[_0x6997('0x45')]['id']}},_0x3289cf={};_0x3289cf[_0x6997('0x2f')]=_['keys'](db['AnalyticTreeReport']['rawAttributes']);_0x3289cf[_0x6997('0x30')]=_[_0x6997('0x46')](_0x42301c['query']);_0x3289cf['filters']=_['intersection'](_0x3289cf[_0x6997('0x2f')],_0x3289cf['query']);_0x2d6f4b['attributes']=_[_0x6997('0x31')](_0x3289cf[_0x6997('0x2f')],qs[_0x6997('0x32')](_0x42301c['query'][_0x6997('0x32')]));_0x2d6f4b['attributes']=_0x2d6f4b['attributes']['length']?_0x2d6f4b[_0x6997('0x33')]:_0x3289cf[_0x6997('0x2f')];if(_0x42301c[_0x6997('0x30')]['includeAll']){_0x2d6f4b['include']=[{'all':!![]}];}_0x2d6f4b=_[_0x6997('0x3c')]({},_0x2d6f4b,_0x42301c['options']);return db['AnalyticTreeReport'][_0x6997('0x47')](_0x2d6f4b)['then'](handleEntityNotFound(_0x235d8c,null))[_0x6997('0x26')](respondWithResult(_0x235d8c,null))[_0x6997('0x43')](handleError(_0x235d8c,null));};exports[_0x6997('0x48')]=function(_0x3b9a48,_0x1972e0){return db[_0x6997('0x2c')]['create'](_0x3b9a48[_0x6997('0x49')],{})[_0x6997('0x26')](respondWithResult(_0x1972e0,0xc9))[_0x6997('0x43')](handleError(_0x1972e0,null));};exports[_0x6997('0x25')]=function(_0x36498a,_0xd4ba96){if(_0x36498a[_0x6997('0x49')]['id']){delete _0x36498a[_0x6997('0x49')]['id'];}return db[_0x6997('0x2c')][_0x6997('0x47')]({'where':{'id':_0x36498a[_0x6997('0x45')]['id']}})[_0x6997('0x26')](handleEntityNotFound(_0xd4ba96,null))['then'](saveUpdates(_0x36498a[_0x6997('0x49')],null))[_0x6997('0x26')](respondWithResult(_0xd4ba96,null))['catch'](handleError(_0xd4ba96,null));};exports['destroy']=function(_0x2ef2b8,_0x242748){return db[_0x6997('0x2c')][_0x6997('0x47')]({'where':{'id':_0x2ef2b8[_0x6997('0x45')]['id']}})[_0x6997('0x26')](handleEntityNotFound(_0x242748,null))['then'](removeEntity(_0x242748,null))[_0x6997('0x43')](handleError(_0x242748,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 227b261..d818c5d 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 _0x0ab8=['../../config/logger','moment','bluebird','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','analytics_report_trees','lodash','util'];(function(_0x482f12,_0x253849){var _0x2bd90b=function(_0x4632cb){while(--_0x4632cb){_0x482f12['push'](_0x482f12['shift']());}};_0x2bd90b(++_0x253849);}(_0x0ab8,0x134));var _0x80ab=function(_0xdc9d7b,_0x13fa24){_0xdc9d7b=_0xdc9d7b-0x0;var _0x3f59e4=_0x0ab8[_0xdc9d7b];return _0x3f59e4;};'use strict';var _=require(_0x80ab('0x0'));var util=require(_0x80ab('0x1'));var logger=require(_0x80ab('0x2'))('api');var moment=require(_0x80ab('0x3'));var BPromise=require(_0x80ab('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x80ab('0x5'));module[_0x80ab('0x6')]=function(_0x23cba4,_0x52924d){return _0x23cba4[_0x80ab('0x7')](_0x80ab('0x8'),attributes,{'tableName':_0x80ab('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x423d=['define','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x21dd14,_0x23fbef){var _0x4bb93b=function(_0x22762d){while(--_0x22762d){_0x21dd14['push'](_0x21dd14['shift']());}};_0x4bb93b(++_0x23fbef);}(_0x423d,0x87));var _0xd423=function(_0x19c098,_0x1b8383){_0x19c098=_0x19c098-0x0;var _0x39a846=_0x423d[_0x19c098];return _0x39a846;};'use strict';var _=require(_0xd423('0x0'));var util=require('util');var logger=require(_0xd423('0x1'))('api');var moment=require(_0xd423('0x2'));var BPromise=require(_0xd423('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd423('0x4'));var rimraf=require(_0xd423('0x5'));var config=require(_0xd423('0x6'));var attributes=require(_0xd423('0x7'));module['exports']=function(_0x4ea82b,_0x3e2497){return _0x4ea82b[_0xd423('0x8')](_0xd423('0x9'),attributes,{'tableName':_0xd423('0xa'),'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 a439840..85692e9 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js +++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x229f6c,_0x2e0a92){var _0x1712a0=function(_0x4c853d){while(--_0x4c853d){_0x229f6c['push'](_0x229f6c['shift']());}};_0x1712a0(++_0x2e0a92);}(_0x5f2f,0x73));var _0xf5f2=function(_0xd66bb0,_0x4d39ac){_0xd66bb0=_0xd66bb0-0x0;var _0x3f1cd8=_0x5f2f[_0xd66bb0];return _0x3f1cd8;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x19d30d,_0xb5dbf7){_0x19d30d=_0x19d30d-0x0;var _0x2cbc03=_0x7a54[_0x19d30d];return _0x2cbc03;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 62ee193..bfc22f7 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 _0xd253=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x2aecb2,_0x343312){var _0x3ebb80=function(_0x19fab3){while(--_0x19fab3){_0x2aecb2['push'](_0x2aecb2['shift']());}};_0x3ebb80(++_0x343312);}(_0xd253,0x6b));var _0x3d25=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xd253[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x3d25('0x0'));var util=require('util');var path=require(_0x3d25('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x3d25('0x2'));var auth=require(_0x3d25('0x3'));var interaction=require(_0x3d25('0x4'));var config=require(_0x3d25('0x5'));var controller=require(_0x3d25('0x6'));router['get']('/',auth[_0x3d25('0x7')](),controller[_0x3d25('0x8')]);router['get'](_0x3d25('0x9'),auth['isAuthenticated'](),controller[_0x3d25('0xa')]);router[_0x3d25('0xb')]('/',auth[_0x3d25('0x7')](),controller[_0x3d25('0xc')]);router[_0x3d25('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3d25('0xe')]);router[_0x3d25('0xf')](_0x3d25('0x9'),auth[_0x3d25('0x7')](),controller[_0x3d25('0x10')]);module[_0x3d25('0x11')]=router; \ No newline at end of file +var _0xacf6=['update','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xacf6,0x81));var _0x6acf=function(_0x4ceda1,_0x265d30){_0x4ceda1=_0x4ceda1-0x0;var _0x424fbf=_0xacf6[_0x4ceda1];return _0x424fbf;};'use strict';var multer=require('multer');var util=require(_0x6acf('0x0'));var path=require(_0x6acf('0x1'));var timeout=require('connect-timeout');var express=require(_0x6acf('0x2'));var router=express[_0x6acf('0x3')]();var fs_extra=require(_0x6acf('0x4'));var auth=require(_0x6acf('0x5'));var interaction=require(_0x6acf('0x6'));var config=require(_0x6acf('0x7'));var controller=require('./analyticTreeReport.controller');router['get']('/',auth[_0x6acf('0x8')](),controller[_0x6acf('0x9')]);router[_0x6acf('0xa')](_0x6acf('0xb'),auth[_0x6acf('0x8')](),controller['show']);router[_0x6acf('0xc')]('/',auth[_0x6acf('0x8')](),controller[_0x6acf('0xd')]);router[_0x6acf('0xe')](_0x6acf('0xb'),auth['isAuthenticated'](),controller[_0x6acf('0xf')]);router['delete'](_0x6acf('0xb'),auth['isAuthenticated'](),controller[_0x6acf('0x10')]);module[_0x6acf('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 21dd949..3f788e3 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 _0x19ea=['sequelize','STRING'];(function(_0x5d0609,_0x127562){var _0xaa3fd1=function(_0x47f457){while(--_0x47f457){_0x5d0609['push'](_0x5d0609['shift']());}};_0xaa3fd1(++_0x127562);}(_0x19ea,0xfe));var _0xa19e=function(_0x47e549,_0x2e53d6){_0x47e549=_0x47e549-0x0;var _0x251374=_0x19ea[_0x47e549];return _0x251374;};'use strict';var Sequelize=require(_0xa19e('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xa19e('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8a55=['exports','STRING','sequelize'];(function(_0x534754,_0x3b375c){var _0x4069d2=function(_0x30a673){while(--_0x30a673){_0x534754['push'](_0x534754['shift']());}};_0x4069d2(++_0x3b375c);}(_0x8a55,0x185));var _0x58a5=function(_0xf70d01,_0x4d7c0e){_0xf70d01=_0xf70d01-0x0;var _0x17d61c=_0x8a55[_0xf70d01];return _0x17d61c;};'use strict';var Sequelize=require(_0x58a5('0x0'));module[_0x58a5('0x1')]={'name':{'type':Sequelize[_0x58a5('0x2')]},'basename':{'type':Sequelize[_0x58a5('0x2')]},'type':{'type':Sequelize[_0x58a5('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 49a77c2..ae44772 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 _0xcb85=['sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','include','catch','show','find','includeAll','get','omit','createdAt','updatedAt','body','create','params','file','basename','mimetype','download','ChatOfflineMessageId','root','server/files/attachments/','join','rimraf','moment','mustache','util','path','sox','fs-extra','lodash','crypto','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3de7a2,_0x6f2c0f){var _0x512a3c=function(_0x5a5add){while(--_0x5a5add){_0x3de7a2['push'](_0x3de7a2['shift']());}};_0x512a3c(++_0x6f2c0f);}(_0xcb85,0x12f));var _0x5cb8=function(_0x128bef,_0xc7a0af){_0x128bef=_0x128bef-0x0;var _0x1ba862=_0xcb85[_0x128bef];return _0x1ba862;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5cb8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5cb8('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x5cb8('0x2'));var util=require(_0x5cb8('0x3'));var path=require(_0x5cb8('0x4'));var sox=require(_0x5cb8('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5cb8('0x6'));var _=require(_0x5cb8('0x7'));var squel=require('squel');var crypto=require(_0x5cb8('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5cb8('0x9'));var querystring=require(_0x5cb8('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5cb8('0xb'));var qs=require('../../components/parsers/qs');var as=require(_0x5cb8('0xc'));var hardwareService=require(_0x5cb8('0xd'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x5cb8('0xe'));var licenseUtil=require(_0x5cb8('0xf'));var db=require(_0x5cb8('0x10'))['db'];function respondWithStatusCode(_0x3193de,_0x220fa4){_0x220fa4=_0x220fa4||0xcc;return function(_0x1fa9f8){if(_0x1fa9f8){return _0x3193de[_0x5cb8('0x11')](_0x220fa4);}return _0x3193de[_0x5cb8('0x12')](_0x220fa4)['end']();};}function respondWithResult(_0x28edb2,_0x5e45d7){_0x5e45d7=_0x5e45d7||0xc8;return function(_0x897f98){if(_0x897f98){return _0x28edb2[_0x5cb8('0x12')](_0x5e45d7)['json'](_0x897f98);}};}function respondWithFilteredResult(_0x440739,_0x5b7367){return function(_0x2edff6){if(_0x2edff6){var _0xd9dfc1=typeof _0x5b7367[_0x5cb8('0x13')]==='undefined'&&typeof _0x5b7367[_0x5cb8('0x14')]===_0x5cb8('0x15');var _0x16f81f=_0x2edff6[_0x5cb8('0x16')];var _0x50ac64=_0xd9dfc1?0x0:_0x5b7367[_0x5cb8('0x13')];var _0x19d45c=_0xd9dfc1?_0x2edff6[_0x5cb8('0x16')]:_0x5b7367[_0x5cb8('0x13')]+_0x5b7367[_0x5cb8('0x14')];var _0x7ed90;if(_0x19d45c>=_0x16f81f){_0x19d45c=_0x16f81f;_0x7ed90=0xc8;}else{_0x7ed90=0xce;}_0x440739[_0x5cb8('0x12')](_0x7ed90);return _0x440739['set'](_0x5cb8('0x17'),_0x50ac64+'-'+_0x19d45c+'/'+_0x16f81f)[_0x5cb8('0x18')](_0x2edff6);}return null;};}function patchUpdates(_0x294e49){return function(_0x1bd330){try{jsonpatch[_0x5cb8('0x19')](_0x1bd330,_0x294e49,!![]);}catch(_0x2b1fb6){return BPromise[_0x5cb8('0x1a')](_0x2b1fb6);}return _0x1bd330[_0x5cb8('0x1b')]();};}function saveUpdates(_0x8e993e,_0x40d9a5){return function(_0x5835c6){if(_0x5835c6){return _0x5835c6[_0x5cb8('0x1c')](_0x8e993e)[_0x5cb8('0x1d')](function(_0x1b7c03){return _0x1b7c03;});}return null;};}function removeEntity(_0x3907f1,_0x2784b6){return function(_0x26b38f){if(_0x26b38f){return _0x26b38f[_0x5cb8('0x1e')]()[_0x5cb8('0x1d')](function(){_0x3907f1[_0x5cb8('0x12')](0xcc)[_0x5cb8('0x1f')]();});}};}function handleEntityNotFound(_0x4ea123,_0x5f2589){return function(_0x277122){if(!_0x277122){_0x4ea123[_0x5cb8('0x11')](0x194);}return _0x277122;};}function handleError(_0x343fe0,_0x2629a5){_0x2629a5=_0x2629a5||0x1f4;return function(_0x17389f){logger[_0x5cb8('0x20')](_0x17389f[_0x5cb8('0x21')]);if(_0x17389f[_0x5cb8('0x22')]){delete _0x17389f[_0x5cb8('0x22')];}_0x343fe0[_0x5cb8('0x12')](_0x2629a5)[_0x5cb8('0x23')](_0x17389f);};}exports[_0x5cb8('0x24')]=function(_0x5e6b50,_0x19a713){var _0x412b35={},_0xebb2f4={},_0x1137b6={'count':0x0,'rows':[]};var _0x53c46d=_[_0x5cb8('0x25')](db[_0x5cb8('0x26')][_0x5cb8('0x27')],function(_0x3be27e){return{'name':_0x3be27e[_0x5cb8('0x28')],'type':_0x3be27e[_0x5cb8('0x29')][_0x5cb8('0x2a')]};});_0xebb2f4['model']=_[_0x5cb8('0x25')](_0x53c46d,_0x5cb8('0x22'));_0xebb2f4[_0x5cb8('0x2b')]=_[_0x5cb8('0x2c')](_0x5e6b50[_0x5cb8('0x2b')]);_0xebb2f4[_0x5cb8('0x2d')]=_[_0x5cb8('0x2e')](_0xebb2f4[_0x5cb8('0x2f')],_0xebb2f4['query']);_0x412b35[_0x5cb8('0x30')]=_[_0x5cb8('0x2e')](_0xebb2f4[_0x5cb8('0x2f')],qs[_0x5cb8('0x31')](_0x5e6b50['query']['fields']));_0x412b35[_0x5cb8('0x30')]=_0x412b35[_0x5cb8('0x30')][_0x5cb8('0x32')]?_0x412b35[_0x5cb8('0x30')]:_0xebb2f4['model'];if(!_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x33')](_0x5cb8('0x34'))){_0x412b35[_0x5cb8('0x14')]=qs[_0x5cb8('0x14')](_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x14')]);_0x412b35[_0x5cb8('0x13')]=qs[_0x5cb8('0x13')](_0x5e6b50['query'][_0x5cb8('0x13')]);}_0x412b35[_0x5cb8('0x35')]=qs[_0x5cb8('0x36')](_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x36')]);_0x412b35[_0x5cb8('0x37')]=qs[_0x5cb8('0x2d')](_[_0x5cb8('0x38')](_0x5e6b50[_0x5cb8('0x2b')],_0xebb2f4[_0x5cb8('0x2d')]),_0x53c46d);if(_0x5e6b50['query']['filter']){_0x412b35[_0x5cb8('0x37')]=_['merge'](_0x412b35[_0x5cb8('0x37')],{'$or':_['map'](_0x53c46d,function(_0x593b9e){if(_0x593b9e['type']!=='VIRTUAL'){var _0x448091={};_0x448091[_0x593b9e[_0x5cb8('0x22')]]={'$like':'%'+_0x5e6b50[_0x5cb8('0x2b')][_0x5cb8('0x39')]+'%'};return _0x448091;}})});}_0x412b35=_[_0x5cb8('0x3a')]({},_0x412b35,_0x5e6b50[_0x5cb8('0x3b')]);var _0x176648={'where':_0x412b35[_0x5cb8('0x37')]};return db[_0x5cb8('0x26')][_0x5cb8('0x16')](_0x176648)['then'](function(_0x170f40){_0x1137b6[_0x5cb8('0x16')]=_0x170f40;if(_0x5e6b50['query']['includeAll']){_0x412b35[_0x5cb8('0x3c')]=[{'all':!![]}];}return db[_0x5cb8('0x26')]['findAll'](_0x412b35);})[_0x5cb8('0x1d')](function(_0x4b0c59){_0x1137b6['rows']=_0x4b0c59;return _0x1137b6;})[_0x5cb8('0x1d')](respondWithFilteredResult(_0x19a713,_0x412b35))[_0x5cb8('0x3d')](handleError(_0x19a713,null));};exports[_0x5cb8('0x3e')]=function(_0xb02a5a,_0x34ccf5){var _0x555a6e={'raw':!![],'where':{'id':_0xb02a5a['params']['id']}},_0x23e1ea={};_0x23e1ea[_0x5cb8('0x2f')]=_[_0x5cb8('0x2c')](db[_0x5cb8('0x26')][_0x5cb8('0x27')]);_0x23e1ea['query']=_['keys'](_0xb02a5a[_0x5cb8('0x2b')]);_0x23e1ea[_0x5cb8('0x2d')]=_[_0x5cb8('0x2e')](_0x23e1ea[_0x5cb8('0x2f')],_0x23e1ea[_0x5cb8('0x2b')]);_0x555a6e[_0x5cb8('0x30')]=_['intersection'](_0x23e1ea[_0x5cb8('0x2f')],qs['fields'](_0xb02a5a[_0x5cb8('0x2b')][_0x5cb8('0x31')]));_0x555a6e[_0x5cb8('0x30')]=_0x555a6e[_0x5cb8('0x30')][_0x5cb8('0x32')]?_0x555a6e[_0x5cb8('0x30')]:_0x23e1ea[_0x5cb8('0x2f')];if(_0xb02a5a[_0x5cb8('0x2b')]['includeAll']){_0x555a6e[_0x5cb8('0x3c')]=[{'all':!![]}];}_0x555a6e=_[_0x5cb8('0x3a')]({},_0x555a6e,_0xb02a5a[_0x5cb8('0x3b')]);return db[_0x5cb8('0x26')][_0x5cb8('0x3f')](_0x555a6e)[_0x5cb8('0x1d')](handleEntityNotFound(_0x34ccf5,null))[_0x5cb8('0x1d')](respondWithResult(_0x34ccf5,null))[_0x5cb8('0x3d')](handleError(_0x34ccf5,null));};exports['clone']=function(_0x3dbcb2,_0x5b3272){var _0x2124c0={'where':{'id':_0x3dbcb2['params']['id']}},_0x451827={};_0x451827[_0x5cb8('0x2f')]=_[_0x5cb8('0x2c')](db['Attachment'][_0x5cb8('0x27')]);_0x2124c0[_0x5cb8('0x30')]=_[_0x5cb8('0x2e')](_0x451827[_0x5cb8('0x2f')],qs[_0x5cb8('0x31')](_0x3dbcb2['query']['fields']));_0x2124c0[_0x5cb8('0x30')]=_0x2124c0[_0x5cb8('0x30')]['length']?_0x2124c0[_0x5cb8('0x30')]:_0x451827[_0x5cb8('0x2f')];if(_0x3dbcb2[_0x5cb8('0x2b')][_0x5cb8('0x40')]){_0x2124c0[_0x5cb8('0x3c')]=[{'all':!![]}];}_0x2124c0=_[_0x5cb8('0x3a')]({},_0x2124c0,_0x3dbcb2[_0x5cb8('0x3b')]);return db[_0x5cb8('0x26')][_0x5cb8('0x3f')](_0x2124c0)[_0x5cb8('0x1d')](handleEntityNotFound(_0x5b3272,null))['then'](function(_0x323157){if(_0x323157){var _0x41618f=_0x323157[_0x5cb8('0x41')]({'plain':!![]});_0x41618f=qs[_0x5cb8('0x42')](_0x41618f,['id',_0x5cb8('0x43'),_0x5cb8('0x44')]);_0x3dbcb2[_0x5cb8('0x45')]=_[_0x5cb8('0x42')](_0x3dbcb2[_0x5cb8('0x45')],['id',_0x5cb8('0x43'),'updatedAt']);return db[_0x5cb8('0x26')][_0x5cb8('0x46')](_[_0x5cb8('0x3a')](_0x41618f,_0x3dbcb2[_0x5cb8('0x45')]),{'include':_0x3dbcb2[_0x5cb8('0x2b')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x5cb8('0x1d')](respondWithResult(_0x5b3272,0xc9))['catch'](handleError(_0x5b3272,null));};exports[_0x5cb8('0x1c')]=function(_0x2e3da9,_0x3c2a6d){if(_0x2e3da9['body']['id']){delete _0x2e3da9[_0x5cb8('0x45')]['id'];}return db[_0x5cb8('0x26')][_0x5cb8('0x3f')]({'where':{'id':_0x2e3da9[_0x5cb8('0x47')]['id']}})[_0x5cb8('0x1d')](handleEntityNotFound(_0x3c2a6d,null))['then'](saveUpdates(_0x2e3da9[_0x5cb8('0x45')],null))['then'](respondWithResult(_0x3c2a6d,null))[_0x5cb8('0x3d')](handleError(_0x3c2a6d,null));};exports['destroy']=function(_0x16ef08,_0x2b234c){return db[_0x5cb8('0x26')]['find']({'where':{'id':_0x16ef08[_0x5cb8('0x47')]['id']}})[_0x5cb8('0x1d')](handleEntityNotFound(_0x2b234c,null))[_0x5cb8('0x1d')](removeEntity(_0x2b234c,null))[_0x5cb8('0x3d')](handleError(_0x2b234c,null));};exports[_0x5cb8('0x46')]=function(_0x4d804d,_0x3cbce3,_0x445514){_0x4d804d[_0x5cb8('0x45')]['name']=_0x4d804d[_0x5cb8('0x48')]['originalname'];_0x4d804d[_0x5cb8('0x45')][_0x5cb8('0x49')]=_0x4d804d[_0x5cb8('0x48')]['filename'];_0x4d804d[_0x5cb8('0x45')][_0x5cb8('0x29')]=_0x4d804d[_0x5cb8('0x48')][_0x5cb8('0x4a')];return db['Attachment'][_0x5cb8('0x46')](_0x4d804d[_0x5cb8('0x45')])[_0x5cb8('0x1d')](respondWithResult(_0x3cbce3,0xc9))[_0x5cb8('0x3d')](handleError(_0x3cbce3,null));};exports[_0x5cb8('0x4b')]=function(_0x13dd83,_0x22385f,_0x37d678){return db[_0x5cb8('0x26')]['findOne']({'where':{'id':_0x13dd83[_0x5cb8('0x47')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x22385f,null))[_0x5cb8('0x1d')](function(_0x103fb0){if(_0x103fb0){var _0xba7a09=_0x103fb0[_0x5cb8('0x4c')]!==null;var _0x3a32fc=path['join'](config[_0x5cb8('0x4d')],_0x5cb8('0x4e'));if(_0xba7a09){_0x3a32fc=path['join'](_0x3a32fc,'offline-chat/');}var _0x2ada63=path[_0x5cb8('0x4f')](_0x3a32fc,_0x103fb0[_0x5cb8('0x49')]);return _0x22385f[_0x5cb8('0x4b')](_0x2ada63);}})[_0x5cb8('0x3d')](handleError(_0x22385f,null));}; \ No newline at end of file +var _0xffe1=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','clone','params','get','omit','createdAt','updatedAt','body','create','catch','file','originalname','basename','filename','mimetype','ChatOfflineMessageId','root','offline-chat/','join','download','eml-format','zip-dir','fast-json-patch','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'];(function(_0x5c5032,_0x1a6cff){var _0x2855a1=function(_0x3609a5){while(--_0x3609a5){_0x5c5032['push'](_0x5c5032['shift']());}};_0x2855a1(++_0x1a6cff);}(_0xffe1,0x107));var _0x1ffe=function(_0x490d2f,_0x414559){_0x490d2f=_0x490d2f-0x0;var _0x371141=_0xffe1[_0x490d2f];return _0x371141;};'use strict';var emlformat=require(_0x1ffe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ffe('0x1'));var jsonpatch=require(_0x1ffe('0x2'));var rp=require(_0x1ffe('0x3'));var moment=require(_0x1ffe('0x4'));var BPromise=require(_0x1ffe('0x5'));var Mustache=require(_0x1ffe('0x6'));var util=require(_0x1ffe('0x7'));var path=require('path');var sox=require(_0x1ffe('0x8'));var csv=require(_0x1ffe('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ffe('0xa'));var _=require(_0x1ffe('0xb'));var squel=require(_0x1ffe('0xc'));var crypto=require(_0x1ffe('0xd'));var jsforce=require(_0x1ffe('0xe'));var deskjs=require(_0x1ffe('0xf'));var toCsv=require(_0x1ffe('0x9'));var querystring=require(_0x1ffe('0x10'));var Papa=require(_0x1ffe('0x11'));var Redis=require(_0x1ffe('0x12'));var authService=require(_0x1ffe('0x13'));var qs=require(_0x1ffe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ffe('0x15'));var logger=require(_0x1ffe('0x16'))(_0x1ffe('0x17'));var utils=require(_0x1ffe('0x18'));var config=require(_0x1ffe('0x19'));var licenseUtil=require(_0x1ffe('0x1a'));var db=require(_0x1ffe('0x1b'))['db'];function respondWithStatusCode(_0x194dea,_0x1b6593){_0x1b6593=_0x1b6593||0xcc;return function(_0x356cb4){if(_0x356cb4){return _0x194dea[_0x1ffe('0x1c')](_0x1b6593);}return _0x194dea[_0x1ffe('0x1d')](_0x1b6593)[_0x1ffe('0x1e')]();};}function respondWithResult(_0x2f2c2a,_0x51e668){_0x51e668=_0x51e668||0xc8;return function(_0x4caf0b){if(_0x4caf0b){return _0x2f2c2a[_0x1ffe('0x1d')](_0x51e668)[_0x1ffe('0x1f')](_0x4caf0b);}};}function respondWithFilteredResult(_0x2eed11,_0x165b46){return function(_0x30d3c4){if(_0x30d3c4){var _0xd621db=typeof _0x165b46[_0x1ffe('0x20')]===_0x1ffe('0x21')&&typeof _0x165b46['limit']===_0x1ffe('0x21');var _0x2b15b6=_0x30d3c4[_0x1ffe('0x22')];var _0x3f0fad=_0xd621db?0x0:_0x165b46['offset'];var _0x47693e=_0xd621db?_0x30d3c4[_0x1ffe('0x22')]:_0x165b46[_0x1ffe('0x20')]+_0x165b46[_0x1ffe('0x23')];var _0x36a804;if(_0x47693e>=_0x2b15b6){_0x47693e=_0x2b15b6;_0x36a804=0xc8;}else{_0x36a804=0xce;}_0x2eed11['status'](_0x36a804);return _0x2eed11[_0x1ffe('0x24')](_0x1ffe('0x25'),_0x3f0fad+'-'+_0x47693e+'/'+_0x2b15b6)['json'](_0x30d3c4);}return null;};}function patchUpdates(_0x391164){return function(_0x2c2aaf){try{jsonpatch[_0x1ffe('0x26')](_0x2c2aaf,_0x391164,!![]);}catch(_0x36e51b){return BPromise[_0x1ffe('0x27')](_0x36e51b);}return _0x2c2aaf[_0x1ffe('0x28')]();};}function saveUpdates(_0x277b31,_0x58a225){return function(_0x894417){if(_0x894417){return _0x894417['update'](_0x277b31)[_0x1ffe('0x29')](function(_0x349c00){return _0x349c00;});}return null;};}function removeEntity(_0x15063a,_0x458dd9){return function(_0x53f34f){if(_0x53f34f){return _0x53f34f[_0x1ffe('0x2a')]()[_0x1ffe('0x29')](function(){_0x15063a[_0x1ffe('0x1d')](0xcc)[_0x1ffe('0x1e')]();});}};}function handleEntityNotFound(_0x53cd34,_0x3694dc){return function(_0x3d53f2){if(!_0x3d53f2){_0x53cd34[_0x1ffe('0x1c')](0x194);}return _0x3d53f2;};}function handleError(_0x4d62e2,_0x16d608){_0x16d608=_0x16d608||0x1f4;return function(_0x3b2ebe){logger[_0x1ffe('0x2b')](_0x3b2ebe['stack']);if(_0x3b2ebe[_0x1ffe('0x2c')]){delete _0x3b2ebe[_0x1ffe('0x2c')];}_0x4d62e2[_0x1ffe('0x1d')](_0x16d608)[_0x1ffe('0x2d')](_0x3b2ebe);};}exports[_0x1ffe('0x2e')]=function(_0x226fd0,_0x5aaac9){var _0x1b86e0={},_0xbac5dd={},_0x4809c2={'count':0x0,'rows':[]};var _0x431892=_['map'](db[_0x1ffe('0x2f')][_0x1ffe('0x30')],function(_0x2d0292){return{'name':_0x2d0292[_0x1ffe('0x31')],'type':_0x2d0292[_0x1ffe('0x32')][_0x1ffe('0x33')]};});_0xbac5dd[_0x1ffe('0x34')]=_[_0x1ffe('0x35')](_0x431892,'name');_0xbac5dd[_0x1ffe('0x36')]=_[_0x1ffe('0x37')](_0x226fd0[_0x1ffe('0x36')]);_0xbac5dd['filters']=_[_0x1ffe('0x38')](_0xbac5dd['model'],_0xbac5dd[_0x1ffe('0x36')]);_0x1b86e0[_0x1ffe('0x39')]=_['intersection'](_0xbac5dd['model'],qs[_0x1ffe('0x3a')](_0x226fd0['query'][_0x1ffe('0x3a')]));_0x1b86e0[_0x1ffe('0x39')]=_0x1b86e0[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0x1b86e0[_0x1ffe('0x39')]:_0xbac5dd[_0x1ffe('0x34')];if(!_0x226fd0['query'][_0x1ffe('0x3c')](_0x1ffe('0x3d'))){_0x1b86e0[_0x1ffe('0x23')]=qs[_0x1ffe('0x23')](_0x226fd0['query'][_0x1ffe('0x23')]);_0x1b86e0['offset']=qs[_0x1ffe('0x20')](_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x20')]);}_0x1b86e0['order']=qs[_0x1ffe('0x3e')](_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x3e')]);_0x1b86e0[_0x1ffe('0x3f')]=qs[_0x1ffe('0x40')](_[_0x1ffe('0x41')](_0x226fd0[_0x1ffe('0x36')],_0xbac5dd[_0x1ffe('0x40')]),_0x431892);if(_0x226fd0['query'][_0x1ffe('0x42')]){_0x1b86e0[_0x1ffe('0x3f')]=_[_0x1ffe('0x43')](_0x1b86e0[_0x1ffe('0x3f')],{'$or':_[_0x1ffe('0x35')](_0x431892,function(_0x5d16fe){if(_0x5d16fe[_0x1ffe('0x32')]!==_0x1ffe('0x44')){var _0x5a2b43={};_0x5a2b43[_0x5d16fe['name']]={'$like':'%'+_0x226fd0['query']['filter']+'%'};return _0x5a2b43;}})});}_0x1b86e0=_[_0x1ffe('0x43')]({},_0x1b86e0,_0x226fd0[_0x1ffe('0x45')]);var _0x3b10d5={'where':_0x1b86e0[_0x1ffe('0x3f')]};return db[_0x1ffe('0x2f')]['count'](_0x3b10d5)[_0x1ffe('0x29')](function(_0x41962a){_0x4809c2[_0x1ffe('0x22')]=_0x41962a;if(_0x226fd0[_0x1ffe('0x36')][_0x1ffe('0x46')]){_0x1b86e0[_0x1ffe('0x47')]=[{'all':!![]}];}return db[_0x1ffe('0x2f')][_0x1ffe('0x48')](_0x1b86e0);})['then'](function(_0x40bbf5){_0x4809c2[_0x1ffe('0x49')]=_0x40bbf5;return _0x4809c2;})[_0x1ffe('0x29')](respondWithFilteredResult(_0x5aaac9,_0x1b86e0))['catch'](handleError(_0x5aaac9,null));};exports[_0x1ffe('0x4a')]=function(_0x4c17d1,_0x4b4db6){var _0x1efd21={'raw':!![],'where':{'id':_0x4c17d1['params']['id']}},_0x1c4228={};_0x1c4228['model']=_[_0x1ffe('0x37')](db[_0x1ffe('0x2f')][_0x1ffe('0x30')]);_0x1c4228[_0x1ffe('0x36')]=_[_0x1ffe('0x37')](_0x4c17d1[_0x1ffe('0x36')]);_0x1c4228[_0x1ffe('0x40')]=_[_0x1ffe('0x38')](_0x1c4228[_0x1ffe('0x34')],_0x1c4228[_0x1ffe('0x36')]);_0x1efd21[_0x1ffe('0x39')]=_['intersection'](_0x1c4228[_0x1ffe('0x34')],qs[_0x1ffe('0x3a')](_0x4c17d1[_0x1ffe('0x36')][_0x1ffe('0x3a')]));_0x1efd21[_0x1ffe('0x39')]=_0x1efd21[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0x1efd21[_0x1ffe('0x39')]:_0x1c4228[_0x1ffe('0x34')];if(_0x4c17d1[_0x1ffe('0x36')][_0x1ffe('0x46')]){_0x1efd21['include']=[{'all':!![]}];}_0x1efd21=_['merge']({},_0x1efd21,_0x4c17d1[_0x1ffe('0x45')]);return db[_0x1ffe('0x2f')][_0x1ffe('0x4b')](_0x1efd21)['then'](handleEntityNotFound(_0x4b4db6,null))[_0x1ffe('0x29')](respondWithResult(_0x4b4db6,null))['catch'](handleError(_0x4b4db6,null));};exports[_0x1ffe('0x4c')]=function(_0x513291,_0x538d3e){var _0xa4d2e5={'where':{'id':_0x513291[_0x1ffe('0x4d')]['id']}},_0x1cd806={};_0x1cd806['model']=_['keys'](db[_0x1ffe('0x2f')][_0x1ffe('0x30')]);_0xa4d2e5[_0x1ffe('0x39')]=_[_0x1ffe('0x38')](_0x1cd806['model'],qs['fields'](_0x513291[_0x1ffe('0x36')]['fields']));_0xa4d2e5[_0x1ffe('0x39')]=_0xa4d2e5[_0x1ffe('0x39')][_0x1ffe('0x3b')]?_0xa4d2e5[_0x1ffe('0x39')]:_0x1cd806[_0x1ffe('0x34')];if(_0x513291['query'][_0x1ffe('0x46')]){_0xa4d2e5[_0x1ffe('0x47')]=[{'all':!![]}];}_0xa4d2e5=_[_0x1ffe('0x43')]({},_0xa4d2e5,_0x513291[_0x1ffe('0x45')]);return db['Attachment'][_0x1ffe('0x4b')](_0xa4d2e5)[_0x1ffe('0x29')](handleEntityNotFound(_0x538d3e,null))[_0x1ffe('0x29')](function(_0x3a7a23){if(_0x3a7a23){var _0x336c72=_0x3a7a23[_0x1ffe('0x4e')]({'plain':!![]});_0x336c72=qs[_0x1ffe('0x4f')](_0x336c72,['id',_0x1ffe('0x50'),_0x1ffe('0x51')]);_0x513291[_0x1ffe('0x52')]=_[_0x1ffe('0x4f')](_0x513291[_0x1ffe('0x52')],['id','createdAt',_0x1ffe('0x51')]);return db[_0x1ffe('0x2f')][_0x1ffe('0x53')](_[_0x1ffe('0x43')](_0x336c72,_0x513291['body']),{'include':_0x513291[_0x1ffe('0x36')][_0x1ffe('0x46')]?[{'all':!![]}]:undefined});}})[_0x1ffe('0x29')](respondWithResult(_0x538d3e,0xc9))[_0x1ffe('0x54')](handleError(_0x538d3e,null));};exports['update']=function(_0x4d59d1,_0x16d404){if(_0x4d59d1[_0x1ffe('0x52')]['id']){delete _0x4d59d1[_0x1ffe('0x52')]['id'];}return db[_0x1ffe('0x2f')]['find']({'where':{'id':_0x4d59d1[_0x1ffe('0x4d')]['id']}})['then'](handleEntityNotFound(_0x16d404,null))[_0x1ffe('0x29')](saveUpdates(_0x4d59d1[_0x1ffe('0x52')],null))['then'](respondWithResult(_0x16d404,null))[_0x1ffe('0x54')](handleError(_0x16d404,null));};exports[_0x1ffe('0x2a')]=function(_0x3da369,_0x53c884){return db[_0x1ffe('0x2f')][_0x1ffe('0x4b')]({'where':{'id':_0x3da369[_0x1ffe('0x4d')]['id']}})['then'](handleEntityNotFound(_0x53c884,null))[_0x1ffe('0x29')](removeEntity(_0x53c884,null))[_0x1ffe('0x54')](handleError(_0x53c884,null));};exports[_0x1ffe('0x53')]=function(_0x30b772,_0x43fb55,_0x5dc8ca){_0x30b772['body'][_0x1ffe('0x2c')]=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x56')];_0x30b772['body'][_0x1ffe('0x57')]=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x58')];_0x30b772[_0x1ffe('0x52')]['type']=_0x30b772[_0x1ffe('0x55')][_0x1ffe('0x59')];return db[_0x1ffe('0x2f')]['create'](_0x30b772[_0x1ffe('0x52')])[_0x1ffe('0x29')](respondWithResult(_0x43fb55,0xc9))[_0x1ffe('0x54')](handleError(_0x43fb55,null));};exports['download']=function(_0x2ff493,_0x25188a,_0x43851a){return db[_0x1ffe('0x2f')]['findOne']({'where':{'id':_0x2ff493[_0x1ffe('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x25188a,null))[_0x1ffe('0x29')](function(_0x398c9f){if(_0x398c9f){var _0x2b11d8=_0x398c9f[_0x1ffe('0x5a')]!==null;var _0x2d5db5=path['join'](config[_0x1ffe('0x5b')],'server/files/attachments/');if(_0x2b11d8){_0x2d5db5=path['join'](_0x2d5db5,_0x1ffe('0x5c'));}var _0x282947=path[_0x1ffe('0x5d')](_0x2d5db5,_0x398c9f[_0x1ffe('0x57')]);return _0x25188a[_0x1ffe('0x5e')](_0x282947);}})[_0x1ffe('0x54')](handleError(_0x25188a,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 9af5b09..7e05c77 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 _0x4eb8=['bluebird','request-promise','rimraf','../../config/environment','./attachment.attributes','Attachment','util','../../config/logger','api','moment'];(function(_0x2cb419,_0x7f6a47){var _0x484f4b=function(_0x173371){while(--_0x173371){_0x2cb419['push'](_0x2cb419['shift']());}};_0x484f4b(++_0x7f6a47);}(_0x4eb8,0xec));var _0x84eb=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0x4eb8[_0x4017b0];return _0x5ed4f7;};'use strict';var _=require('lodash');var util=require(_0x84eb('0x0'));var logger=require(_0x84eb('0x1'))(_0x84eb('0x2'));var moment=require(_0x84eb('0x3'));var BPromise=require(_0x84eb('0x4'));var rp=require(_0x84eb('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84eb('0x6'));var config=require(_0x84eb('0x7'));var attributes=require(_0x84eb('0x8'));module['exports']=function(_0x34025d,_0x49c14f){return _0x34025d['define'](_0x84eb('0x9'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x16e3=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x16e3,0x117));var _0x316e=function(_0x25a5a6,_0x287847){_0x25a5a6=_0x25a5a6-0x0;var _0x129907=_0x16e3[_0x25a5a6];return _0x129907;};'use strict';var _=require(_0x316e('0x0'));var util=require(_0x316e('0x1'));var logger=require(_0x316e('0x2'))(_0x316e('0x3'));var moment=require('moment');var BPromise=require(_0x316e('0x4'));var rp=require(_0x316e('0x5'));var fs=require('fs');var path=require(_0x316e('0x6'));var rimraf=require('rimraf');var config=require(_0x316e('0x7'));var attributes=require(_0x316e('0x8'));module[_0x316e('0x9')]=function(_0x1d9b31,_0x2be93f){return _0x1d9b31[_0x316e('0xa')](_0x316e('0xb'),attributes,{'tableName':_0x316e('0xc'),'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 25a24e2..2f4eaf4 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 _0xee24=['body','options','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','Attachment,\x20%s,\x20%s','message','info','result','catch','CreateAttachment','Attachment','create'];(function(_0x359d82,_0x3562b2){var _0x1ebefe=function(_0x5a1ade){while(--_0x5a1ade){_0x359d82['push'](_0x359d82['shift']());}};_0x1ebefe(++_0x3562b2);}(_0xee24,0x1a6));var _0x4ee2=function(_0x102402,_0x4eaaf8){_0x102402=_0x102402-0x0;var _0x321b44=_0xee24[_0x102402];return _0x321b44;};'use strict';var _=require('lodash');var util=require(_0x4ee2('0x0'));var moment=require(_0x4ee2('0x1'));var BPromise=require('bluebird');var rs=require(_0x4ee2('0x2'));var fs=require('fs');var Redis=require(_0x4ee2('0x3'));var db=require(_0x4ee2('0x4'))['db'];var utils=require(_0x4ee2('0x5'));var logger=require('../../config/logger')(_0x4ee2('0x6'));var config=require(_0x4ee2('0x7'));var jayson=require(_0x4ee2('0x8'));var client=jayson[_0x4ee2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2e6e11,_0x319d9d,_0xe966eb){return new BPromise(function(_0x9a963c,_0x8d7266){return client[_0x4ee2('0xa')](_0x2e6e11,_0xe966eb)[_0x4ee2('0xb')](function(_0x3b6028){logger['info']('Attachment,\x20%s,\x20%s',_0x319d9d,_0x4ee2('0xc'));logger[_0x4ee2('0xd')](_0x4ee2('0xe'),_0x319d9d,_0x4ee2('0xc'),JSON[_0x4ee2('0xf')](_0x3b6028));if(_0x3b6028['error']){if(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x11')]===0x1f4){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x8d7266(_0x3b6028[_0x4ee2('0x10')][_0x4ee2('0x13')]);}logger[_0x4ee2('0x10')]('Attachment,\x20%s,\x20%s',_0x319d9d,_0x3b6028['error'][_0x4ee2('0x13')]);return _0x9a963c(_0x3b6028[_0x4ee2('0x10')]['message']);}else{logger[_0x4ee2('0x14')](_0x4ee2('0x12'),_0x319d9d,_0x4ee2('0xc'));_0x9a963c(_0x3b6028[_0x4ee2('0x15')][_0x4ee2('0x13')]);}})[_0x4ee2('0x16')](function(_0x5e19f8){logger[_0x4ee2('0x10')](_0x4ee2('0x12'),_0x319d9d,_0x5e19f8);_0x8d7266(_0x5e19f8);});});}exports[_0x4ee2('0x17')]=function(_0x4aba2b){var _0x23df00=this;return new Promise(function(_0xb8e027,_0x3ba412){return db[_0x4ee2('0x18')][_0x4ee2('0x19')](_0x4aba2b[_0x4ee2('0x1a')],{'raw':_0x4aba2b[_0x4ee2('0x1b')]?_0x4aba2b[_0x4ee2('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x33e66e){logger['info'](_0x4ee2('0x17'),_0x4aba2b);logger[_0x4ee2('0xd')](_0x4ee2('0x17'),_0x4aba2b,JSON[_0x4ee2('0xf')](_0x33e66e));_0xb8e027(_0x33e66e);})[_0x4ee2('0x16')](function(_0x53f246){logger[_0x4ee2('0x10')]('CreateAttachment',_0x53f246[_0x4ee2('0x13')],_0x4aba2b);_0x3ba412(_0x23df00[_0x4ee2('0x10')](0x1f4,_0x53f246[_0x4ee2('0x13')]));});});}; \ No newline at end of file +var _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x27dc75,_0x10560b){var _0x316106=function(_0xa01dec){while(--_0xa01dec){_0x27dc75['push'](_0x27dc75['shift']());}};_0x316106(++_0x10560b);}(_0x81d5,0x1ab));var _0x581d=function(_0x534bb8,_0x17fd36){_0x534bb8=_0x534bb8-0x0;var _0x33287c=_0x81d5[_0x534bb8];return _0x33287c;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 9a174aa..3817d58 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x42e6a1,_0x4e436e){var _0x433176=function(_0x5280f7){while(--_0x5280f7){_0x42e6a1['push'](_0x42e6a1['shift']());}};_0x433176(++_0x4e436e);}(_0x2032,0xd9));var _0x2203=function(_0x306fe1,_0x45215b){_0x306fe1=_0x306fe1-0x0;var _0x2777da=_0x2032[_0x306fe1];return _0x2777da;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router; \ No newline at end of file +var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x2bfe2a,_0x1608a3){var _0x1f15cb=function(_0x136b55){while(--_0x136b55){_0x2bfe2a['push'](_0x2bfe2a['shift']());}};_0x1f15cb(++_0x1608a3);}(_0xadb5,0xad));var _0x5adb=function(_0x2721ef,_0x16ed8c){_0x2721ef=_0x2721ef-0x0;var _0x46a995=_0xadb5[_0x2721ef];return _0x46a995;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router; \ No newline at end of file diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js index e614bb3..b6c13ac 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 _0x6909=['clearBlockUser','getLicense','catch','status','message','login','ad-login','signToken','json','online','use','password','User','passport-local','moment','activedirectory2','bluebird','../../mysqldb','../../components/auth/service','../../config/utils','../../config/logger','api','activedirectory','undefined','baseDN','url','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','error','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','salt','role','blocked','blockedAt','agent','name','disabled','blockDuration','add'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x6909,0x1e3));var _0x9690=function(_0x3bbc33,_0x52fc5c){_0x3bbc33=_0x3bbc33-0x0;var _0x20a80f=_0x6909[_0x3bbc33];return _0x20a80f;};'use strict';var passport=require('passport');var LocalStrategy=require(_0x9690('0x0'))['Strategy'];var moment=require(_0x9690('0x1'));var ActiveDirectory=require(_0x9690('0x2'));var BPromise=require(_0x9690('0x3'));var util=require('util');var db=require(_0x9690('0x4'))['db'];var authService=require(_0x9690('0x5'));var utils=require(_0x9690('0x6'));var config=require('../../config/environment');var logger=require(_0x9690('0x7'))(_0x9690('0x8'));function isActiveDirectoryConfigured(_0x184bb1){var _0x75cbcb=![];if(typeof _0x184bb1[_0x9690('0x9')]!==_0x9690('0xa')){_0x75cbcb=_0x184bb1[_0x9690('0x9')][_0x9690('0xb')]&&_0x184bb1[_0x9690('0x9')][_0x9690('0xc')]&&_0x184bb1['activedirectory'][_0x9690('0xd')];}return _0x75cbcb;}function adAuthenticate(_0x2658c6,_0x24eae8,_0x39847f){return new BPromise(function(_0x12b229,_0x4194aa){try{var _0x369cd4=new ActiveDirectory(_0x2658c6);_0x369cd4[_0x9690('0xe')](_0x24eae8,_0x39847f,function(_0x35e041,_0x642f21){if(_0x35e041){logger['error'](_0x9690('0xf'),_0x24eae8,util['inspect'](_0x35e041,{'showHidden':![],'depth':null}));_0x4194aa('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x642f21){logger[_0x9690('0x10')](_0x9690('0x11'),_0x24eae8);_0x4194aa(_0x9690('0x12'));}else{_0x12b229(_0x642f21);}});}catch(_0x1042c5){_0x4194aa(_0x1042c5);}});}function ActiveDirectoryAuthenticate(_0x1ff67c,_0x413c26,_0x2ccb90,_0x2448aa){var _0x850d83,_0x139e3d;if(!isActiveDirectoryConfigured(config)){logger[_0x9690('0x10')](_0x9690('0x13'),_0x413c26);return _0x2448aa(null,![],{'message':_0x9690('0x12')});}return db[_0x9690('0x14')][_0x9690('0x15')]({'where':{'id':0x1},'attributes':[_0x9690('0x16'),'blockDuration'],'raw':!![]})[_0x9690('0x17')](function(_0x38b188){_0x850d83=_0x38b188;if(!_0x850d83[_0x9690('0x16')]){logger[_0x9690('0x10')](_0x9690('0x18'),_0x413c26);throw new Error(_0x9690('0x12'));}return _0x1ff67c[_0x9690('0x15')]({'logging':!![],'attributes':['id','name','password',_0x9690('0x19'),_0x9690('0x1a'),'disabled',_0x9690('0x1b'),_0x9690('0x1c'),'online'],'where':{'name':_0x413c26,'role':{'$or':['admin','user',_0x9690('0x1d')]},'adSsoEnabled':!![]}});})[_0x9690('0x17')](function(_0x5f0c14){if(!_0x5f0c14||_0x5f0c14&&_0x5f0c14[_0x9690('0x1e')]!==_0x413c26){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x139e3d=_0x5f0c14;var _0x33afcd=_0x139e3d[_0x9690('0x1e')]+'@'+config[_0x9690('0x9')][_0x9690('0xd')];return adAuthenticate(config[_0x9690('0x9')],_0x33afcd,_0x2ccb90);})['then'](function(_0x5c64f8){if(_0x139e3d[_0x9690('0x1f')]){throw new Error(_0x9690('0x12'));}if(_0x850d83[_0x9690('0x20')]>0x0){if(_0x139e3d['blocked']){if(moment(_0x139e3d['blockedAt'])[_0x9690('0x21')](_0x850d83['blockDuration'],'minutes')>moment()){throw new Error(_0x9690('0x12'));}return utils[_0x9690('0x22')](_0x139e3d,0x0,![],null)[_0x9690('0x17')](function(){return utils['getLicense'](_0x139e3d);})['then'](function(){return _0x2448aa(null,_0x139e3d);});}else{return utils['getLicense'](_0x139e3d)[_0x9690('0x17')](function(){return _0x2448aa(null,_0x139e3d);});}}else{return utils[_0x9690('0x23')](_0x139e3d)[_0x9690('0x17')](function(){return _0x2448aa(null,_0x139e3d);});}})[_0x9690('0x24')](function(_0x9fd2bb){return _0x2448aa(null,![],_0x9fd2bb);});}function handleError(_0x21b3e3,_0x46ec11,_0x58a895){return _0x21b3e3[_0x9690('0x25')](_0x46ec11||0x1f4)['send']({'message':_0x58a895?_0x58a895[_0x9690('0x26')]||_0x58a895:''});}exports[_0x9690('0x27')]=function(_0x27a4aa,_0x2c90b1,_0x23e48d){passport['authenticate'](_0x9690('0x28'),function(_0x91d164,_0x1fbedf,_0x3e520c){var _0x1c9272=_0x91d164||_0x3e520c;if(_0x1c9272){return handleError(_0x2c90b1,0x191,_0x1c9272);}if(!_0x1fbedf){return handleError(_0x2c90b1,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x354631={'payload':{'id':_0x1fbedf['id'],'role':_0x1fbedf[_0x9690('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0x9690('0x29')](_0x354631)[_0x9690('0x17')](function(_0x28dc84){_0x2c90b1[_0x9690('0x2a')]({'id':_0x1fbedf['id'],'token':_0x28dc84,'statusCall':'','isAlreadyLogged':_0x1fbedf[_0x9690('0x2b')]});});}})(_0x27a4aa,_0x2c90b1,_0x23e48d);};passport[_0x9690('0x2c')](_0x9690('0x28'),new LocalStrategy({'usernameField':'name','passwordField':_0x9690('0x2d')},function(_0x1b8d77,_0x113ffb,_0x15982a){return ActiveDirectoryAuthenticate(db[_0x9690('0x2e')],_0x1b8d77,_0x113ffb,_0x15982a);})); \ No newline at end of file +var _0xb9ca=['undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','then','name','salt','role','disabled','blocked','blockedAt','online','admin','user','agent','blockDuration','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','signToken','json','use','password','passport','Strategy','moment','bluebird','util','../../config/utils','../../config/environment','../../config/logger','api','activedirectory'];(function(_0x5690c9,_0x4af3fa){var _0x4cac4a=function(_0x42aaea){while(--_0x42aaea){_0x5690c9['push'](_0x5690c9['shift']());}};_0x4cac4a(++_0x4af3fa);}(_0xb9ca,0x16e));var _0xab9c=function(_0x2c8d62,_0x29e4b0){_0x2c8d62=_0x2c8d62-0x0;var _0x3bddf8=_0xb9ca[_0x2c8d62];return _0x3bddf8;};'use strict';var passport=require(_0xab9c('0x0'));var LocalStrategy=require('passport-local')[_0xab9c('0x1')];var moment=require(_0xab9c('0x2'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0xab9c('0x3'));var util=require(_0xab9c('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0xab9c('0x5'));var config=require(_0xab9c('0x6'));var logger=require(_0xab9c('0x7'))(_0xab9c('0x8'));function isActiveDirectoryConfigured(_0x405f0c){var _0x136024=![];if(typeof _0x405f0c[_0xab9c('0x9')]!==_0xab9c('0xa')){_0x136024=_0x405f0c[_0xab9c('0x9')][_0xab9c('0xb')]&&_0x405f0c[_0xab9c('0x9')][_0xab9c('0xc')]&&_0x405f0c[_0xab9c('0x9')][_0xab9c('0xd')];}return _0x136024;}function adAuthenticate(_0x55946b,_0x44e411,_0x19d71f){return new BPromise(function(_0x274e59,_0x1267fe){try{var _0xb88cc0=new ActiveDirectory(_0x55946b);_0xb88cc0[_0xab9c('0xe')](_0x44e411,_0x19d71f,function(_0x35394b,_0x249af9){if(_0x35394b){logger[_0xab9c('0xf')](_0xab9c('0x10'),_0x44e411,util['inspect'](_0x35394b,{'showHidden':![],'depth':null}));_0x1267fe(_0xab9c('0x11'));}else if(!_0x249af9){logger[_0xab9c('0xf')](_0xab9c('0x12'),_0x44e411);_0x1267fe(_0xab9c('0x11'));}else{_0x274e59(_0x249af9);}});}catch(_0x441dbb){_0x1267fe(_0x441dbb);}});}function ActiveDirectoryAuthenticate(_0x3293d6,_0x28b10e,_0x2ab4dd,_0x3d4034){var _0x5af598,_0x393d37;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xab9c('0x13'),_0x28b10e);return _0x3d4034(null,![],{'message':_0xab9c('0x11')});}return db[_0xab9c('0x14')][_0xab9c('0x15')]({'where':{'id':0x1},'attributes':[_0xab9c('0x16'),'blockDuration'],'raw':!![]})[_0xab9c('0x17')](function(_0x781dd1){_0x5af598=_0x781dd1;if(!_0x5af598['adSsoEnabled']){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x28b10e);throw new Error(_0xab9c('0x11'));}return _0x3293d6['findOne']({'logging':!![],'attributes':['id',_0xab9c('0x18'),'password',_0xab9c('0x19'),_0xab9c('0x1a'),_0xab9c('0x1b'),_0xab9c('0x1c'),_0xab9c('0x1d'),_0xab9c('0x1e')],'where':{'name':_0x28b10e,'role':{'$or':[_0xab9c('0x1f'),_0xab9c('0x20'),_0xab9c('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x10a9eb){if(!_0x10a9eb||_0x10a9eb&&_0x10a9eb['name']!==_0x28b10e){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x393d37=_0x10a9eb;var _0x399711=_0x393d37[_0xab9c('0x18')]+'@'+config[_0xab9c('0x9')][_0xab9c('0xd')];return adAuthenticate(config[_0xab9c('0x9')],_0x399711,_0x2ab4dd);})['then'](function(_0x292aa5){if(_0x393d37['disabled']){throw new Error(_0xab9c('0x11'));}if(_0x5af598[_0xab9c('0x22')]>0x0){if(_0x393d37[_0xab9c('0x1c')]){if(moment(_0x393d37['blockedAt'])['add'](_0x5af598[_0xab9c('0x22')],_0xab9c('0x23'))>moment()){throw new Error(_0xab9c('0x11'));}return utils[_0xab9c('0x24')](_0x393d37,0x0,![],null)[_0xab9c('0x17')](function(){return utils['getLicense'](_0x393d37);})[_0xab9c('0x17')](function(){return _0x3d4034(null,_0x393d37);});}else{return utils['getLicense'](_0x393d37)[_0xab9c('0x17')](function(){return _0x3d4034(null,_0x393d37);});}}else{return utils[_0xab9c('0x25')](_0x393d37)['then'](function(){return _0x3d4034(null,_0x393d37);});}})[_0xab9c('0x26')](function(_0xf83bdc){return _0x3d4034(null,![],_0xf83bdc);});}function handleError(_0x14f924,_0x58f253,_0x11bba1){return _0x14f924[_0xab9c('0x27')](_0x58f253||0x1f4)[_0xab9c('0x28')]({'message':_0x11bba1?_0x11bba1['message']||_0x11bba1:''});}exports[_0xab9c('0x29')]=function(_0x13fa46,_0x2856f6,_0x444e72){passport[_0xab9c('0xe')](_0xab9c('0x2a'),function(_0x108159,_0x24f078,_0x2d56b7){var _0x4c9b8a=_0x108159||_0x2d56b7;if(_0x4c9b8a){return handleError(_0x2856f6,0x191,_0x4c9b8a);}if(!_0x24f078){return handleError(_0x2856f6,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x38cf3a={'payload':{'id':_0x24f078['id'],'role':_0x24f078[_0xab9c('0x1a')]},'options':{'expiresIn':0x15180}};return authService[_0xab9c('0x2b')](_0x38cf3a)[_0xab9c('0x17')](function(_0x861fe3){_0x2856f6[_0xab9c('0x2c')]({'id':_0x24f078['id'],'token':_0x861fe3,'statusCall':'','isAlreadyLogged':_0x24f078[_0xab9c('0x1e')]});});}})(_0x13fa46,_0x2856f6,_0x444e72);};passport[_0xab9c('0x2d')](_0xab9c('0x2a'),new LocalStrategy({'usernameField':'name','passwordField':_0xab9c('0x2e')},function(_0x2284fd,_0x4a6ba3,_0x4be3e2){return ActiveDirectoryAuthenticate(db['User'],_0x2284fd,_0x4a6ba3,_0x4be3e2);})); \ No newline at end of file diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js index dd56038..6e1a75a 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 _0x16b4=['./authActiveDirectory.controller','post','login','exports','express','Router'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x16b4,0x184));var _0x416b=function(_0x52dad4,_0x10c9c3){_0x52dad4=_0x52dad4-0x0;var _0x50da26=_0x16b4[_0x52dad4];return _0x50da26;};'use strict';var express=require(_0x416b('0x0'));var router=express[_0x416b('0x1')]();var controller=require(_0x416b('0x2'));router[_0x416b('0x3')]('/',controller[_0x416b('0x4')]);module[_0x416b('0x5')]=router; \ No newline at end of file +var _0x330e=['express','post','login','exports'];(function(_0x37c22c,_0x28a70d){var _0x119d79=function(_0x243a13){while(--_0x243a13){_0x37c22c['push'](_0x37c22c['shift']());}};_0x119d79(++_0x28a70d);}(_0x330e,0xb4));var _0xe330=function(_0x4adf25,_0xc1c299){_0x4adf25=_0x4adf25-0x0;var _0x239fdc=_0x330e[_0x4adf25];return _0x239fdc;};'use strict';var express=require(_0xe330('0x0'));var router=express['Router']();var controller=require('./authActiveDirectory.controller');router[_0xe330('0x1')]('/',controller[_0xe330('0x2')]);module[_0xe330('0x3')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index eb76fa4..00cf025 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(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x7a54,0x106));var _0x47a5=function(_0x15456c,_0x4aa841){_0x15456c=_0x15456c-0x0;var _0x3fd34c=_0x7a54[_0x15456c];return _0x3fd34c;};'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 _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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x14d4a0,_0x4f84d4){_0x14d4a0=_0x14d4a0-0x0;var _0x51f46a=_0x7a54[_0x14d4a0];return _0x51f46a;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 50fd3f3..f8703b6 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 _0x9f39=['../user/user.controller.js','../../components/auth/service','login','get','/callback','callback','isMiddleware','exports','express','Router','./authGoogle.controller'];(function(_0x1778e1,_0x3e1727){var _0x2bc4c6=function(_0x359c65){while(--_0x359c65){_0x1778e1['push'](_0x1778e1['shift']());}};_0x2bc4c6(++_0x3e1727);}(_0x9f39,0x152));var _0x99f3=function(_0x80582b,_0x653bda){_0x80582b=_0x80582b-0x0;var _0x7e7b8c=_0x9f39[_0x80582b];return _0x7e7b8c;};'use strict';var express=require(_0x99f3('0x0'));var passport=require('passport');var router=express[_0x99f3('0x1')]();var controller=require(_0x99f3('0x2'));var userController=require(_0x99f3('0x3'));var authService=require(_0x99f3('0x4'));router['get']('/',controller[_0x99f3('0x5')]);router[_0x99f3('0x6')](_0x99f3('0x7'),controller[_0x99f3('0x8')],authService[_0x99f3('0x9')],userController[_0x99f3('0x5')],authService['setTokenCookie']);module[_0x99f3('0xa')]=router; \ No newline at end of file +var _0x20e7=['get','login','/callback','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x20e7,0x178));var _0x720e=function(_0x5d8512,_0x21488a){_0x5d8512=_0x5d8512-0x0;var _0x29e571=_0x20e7[_0x5d8512];return _0x29e571;};'use strict';var express=require(_0x720e('0x0'));var passport=require(_0x720e('0x1'));var router=express['Router']();var controller=require(_0x720e('0x2'));var userController=require(_0x720e('0x3'));var authService=require('../../components/auth/service');router[_0x720e('0x4')]('/',controller[_0x720e('0x5')]);router[_0x720e('0x4')](_0x720e('0x6'),controller[_0x720e('0x7')],authService['isMiddleware'],userController[_0x720e('0x5')],authService[_0x720e('0x8')]);module[_0x720e('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 2b6f285..fb2814e 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 _0x8ecd=['enforcePasswordHistory','passwordHistoryLimit','securePassword','validatePasswordPattern','previousPasswords','save','use','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','clearBlockUser','disabled','getLicense','blocked','catch','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','authentication','pass','format','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','Reset\x20Email\x20sent!','reset','params','token'];(function(_0x1ae121,_0x40a449){var _0x371bdb=function(_0x59f9bf){while(--_0x59f9bf){_0x1ae121['push'](_0x1ae121['shift']());}};_0x371bdb(++_0x40a449);}(_0x8ecd,0xf7));var _0xd8ec=function(_0x393500,_0x1037af){_0x393500=_0x393500-0x0;var _0x120d3b=_0x8ecd[_0x393500];return _0x120d3b;};'use strict';var util=require('util');var passport=require(_0xd8ec('0x0'));var LocalStrategy=require(_0xd8ec('0x1'))[_0xd8ec('0x2')];var jayson=require(_0xd8ec('0x3'));var _=require(_0xd8ec('0x4'));var rs=require(_0xd8ec('0x5'));var moment=require(_0xd8ec('0x6'));var db=require(_0xd8ec('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xd8ec('0x8'));var client=jayson['client'][_0xd8ec('0x9')]({'port':0x232b});function localAuthenticate(_0x395846,_0x5b577b,_0x50c391,_0x2ccf72){var _0x16a29c,_0x53427c;return db[_0xd8ec('0xa')][_0xd8ec('0xb')]({'where':{'id':0x1},'attributes':[_0xd8ec('0xc'),_0xd8ec('0xd')],'raw':!![]})[_0xd8ec('0xe')](function(_0x1f4571){_0x16a29c=_0x1f4571;return _0x395846[_0xd8ec('0xb')]({'attributes':['id',_0xd8ec('0xf'),_0xd8ec('0x10'),_0xd8ec('0x11'),_0xd8ec('0x12'),'disabled','blocked',_0xd8ec('0x13'),'loginAttempts'],'where':{'name':_0x5b577b,'role':{'$or':[_0xd8ec('0x14'),_0xd8ec('0x15'),_0xd8ec('0x16')]}}});})[_0xd8ec('0xe')](function(_0x1732ab){if(!_0x1732ab||_0x1732ab&&_0x1732ab[_0xd8ec('0xf')]!==_0x5b577b){throw new Error(_0xd8ec('0x17'));}else{_0x53427c=_0x1732ab;return _0x53427c;}})[_0xd8ec('0xe')](function(){_0x53427c[_0xd8ec('0x18')](_0x50c391,function(_0x359088,_0x42a6e9){var _0x2769bc=_0x53427c['loginAttempts']+0x1;if(_0x359088){return _0x2ccf72(_0x359088);}else if(!_0x42a6e9){if(_0x53427c['disabled']){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x16a29c[_0xd8ec('0xc')]>0x0){if(_0x53427c['blocked']){if(_0x16a29c[_0xd8ec('0xd')]>0x0){if(moment(_0x53427c[_0xd8ec('0x13')])[_0xd8ec('0x19')](_0x16a29c['blockDuration'],'minutes')>moment()){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else{return utils[_0xd8ec('0x1a')](_0x53427c,_0x2769bc,![],null)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x2769bc>=_0x16a29c[_0xd8ec('0xc')]){return utils[_0xd8ec('0x1a')](_0x53427c,0x0,!![],moment())[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});});}else{return utils[_0xd8ec('0x1a')](_0x53427c,_0x2769bc,![],null)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});});}}}else{return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x53427c[_0xd8ec('0x1b')]){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else if(_0x16a29c[_0xd8ec('0xc')]>0x0){if(_0x53427c['blocked']){if(_0x16a29c['blockDuration']>0x0){if(moment(_0x53427c['blockedAt'])['add'](_0x16a29c['blockDuration'],'minutes')>moment()){return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}else{return utils[_0xd8ec('0x1a')](_0x53427c,0x0,![],null)[_0xd8ec('0xe')](function(){return utils[_0xd8ec('0x1c')](_0x53427c);})['then'](function(){return _0x2ccf72(null,_0x53427c);});}}else{return _0x2ccf72(null,![],{'message':_0xd8ec('0x17')});}}else{return utils['clearBlockUser'](_0x53427c,0x0,![],null)[_0xd8ec('0xe')](function(){return utils['getLicense'](_0x53427c);})[_0xd8ec('0xe')](function(){return _0x2ccf72(null,_0x53427c);})['catch'](function(_0x365579){return _0x2ccf72(null,![],_0x365579);});}}else{if(_0x53427c[_0xd8ec('0x1d')]){return _0x2ccf72(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x53427c)[_0xd8ec('0xe')](function(){return _0x2ccf72(null,_0x53427c);});}}}});})[_0xd8ec('0x1e')](function(_0x2511aa){return _0x2ccf72(null,![],_0x2511aa);});}function sendServiceMail(_0x33a7c1){return db['MailAccount'][_0xd8ec('0x1f')]({'where':{'service':!![]},'attributes':['id',_0xd8ec('0xf'),_0xd8ec('0x20')],'include':[{'model':db[_0xd8ec('0x21')],'as':'Smtp'}]})[_0xd8ec('0xe')](function(_0x240904){if(!_0x240904){throw new Error(_0xd8ec('0x22'));}var _0x3fa272={'tls':{'rejectUnauthorized':![]}};if(_0x240904[_0xd8ec('0x23')][_0xd8ec('0x24')]){_0x3fa272[_0xd8ec('0x24')]=_0x240904[_0xd8ec('0x23')][_0xd8ec('0x24')];}else{_0x3fa272[_0xd8ec('0x25')]=_0x240904[_0xd8ec('0x23')]['host'];_0x3fa272[_0xd8ec('0x26')]=_0x240904[_0xd8ec('0x23')][_0xd8ec('0x26')];_0x3fa272['secure']=_0x240904['Smtp']['secure'];}if(_0x240904[_0xd8ec('0x23')][_0xd8ec('0x27')]){_0x3fa272['auth']={'user':_0x240904[_0xd8ec('0x23')][_0xd8ec('0x15')],'pass':_0x240904['Smtp'][_0xd8ec('0x28')]};}var _0x5b3d3a={'account':_0x3fa272,'message':_['merge']({'from':util[_0xd8ec('0x29')](_0xd8ec('0x2a'),_0x240904[_0xd8ec('0xf')],_0x240904[_0xd8ec('0x20')]||_0x240904[_0xd8ec('0x23')][_0xd8ec('0x15')])},_0x33a7c1)};return client[_0xd8ec('0x2b')]('SendMail',_0x5b3d3a);})[_0xd8ec('0xe')](function(_0x29b12b){if(_0x29b12b[_0xd8ec('0x2c')]){throw new Error(util[_0xd8ec('0x29')](_0xd8ec('0x2d'),_0x29b12b[_0xd8ec('0x2c')][_0xd8ec('0x2e')]||JSON[_0xd8ec('0x2f')](_0x29b12b[_0xd8ec('0x2c')])));}return!![];});}function handleError(_0x227e04,_0x3e5678,_0x1c3616){return _0x227e04[_0xd8ec('0x30')](_0x3e5678||0x1f4)[_0xd8ec('0x31')]({'message':_0x1c3616?_0x1c3616[_0xd8ec('0x2e')]||_0x1c3616:''});}exports[_0xd8ec('0x32')]=function(_0x53f016,_0x2f6fb8,_0x19a380){passport[_0xd8ec('0x18')](_0xd8ec('0x33'),function(_0x112599,_0x13e27d,_0x13ef65){var _0x4b6396=_0x112599||_0x13ef65;if(_0x4b6396){return handleError(_0x2f6fb8,0x191,_0x4b6396);}if(!_0x13e27d){return handleError(_0x2f6fb8,0x194,{'message':_0xd8ec('0x34')});}else{var _0x34f341={'payload':{'id':_0x13e27d['id'],'role':_0x13e27d[_0xd8ec('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x34f341)[_0xd8ec('0xe')](function(_0x289ed9){_0x2f6fb8['json']({'id':_0x13e27d['id'],'token':_0x289ed9,'statusCall':'','isAlreadyLogged':_0x13e27d[_0xd8ec('0x35')]});});}})(_0x53f016,_0x2f6fb8,_0x19a380);};exports[_0xd8ec('0x36')]=function(_0x3a36f3,_0x31d043,_0x21b2c2){if(!_0x3a36f3[_0xd8ec('0x37')][_0xd8ec('0x20')]){return handleError(_0x31d043,0x1f4,{'message':_0xd8ec('0x38')});}var _0x2dddaf=rs[_0xd8ec('0x39')]();_0x3a36f3['body'][_0xd8ec('0x20')]=_0x3a36f3[_0xd8ec('0x37')]['email'][_0xd8ec('0x3a')]()[_0xd8ec('0x3b')]();var _0x1ccee4;return db[_0xd8ec('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xd8ec('0xd')],'raw':!![]})[_0xd8ec('0xe')](function(_0x23f428){_0x1ccee4=_0x23f428;return db['User'][_0xd8ec('0x1f')]({'where':{'email':_0x3a36f3[_0xd8ec('0x37')][_0xd8ec('0x20')]}});})['then'](function(_0x43524c){if(!_0x43524c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x43524c[_0xd8ec('0x1b')]){throw new Error(_0xd8ec('0x3c'));}if(_0x43524c[_0xd8ec('0x1d')]){if(moment(_0x43524c[_0xd8ec('0x13')])['add'](_0x1ccee4[_0xd8ec('0xd')],_0xd8ec('0x3d'))>moment()){throw new Error(_0xd8ec('0x3e'));}else{_0x43524c['blocked']=![];_0x43524c['blockedAt']=null;}}_0x43524c[_0xd8ec('0x3f')]=_0x2dddaf;_0x43524c[_0xd8ec('0x40')]=Date[_0xd8ec('0x41')]()+0x36ee80;return _0x43524c['save']();})[_0xd8ec('0xe')](function(){return sendServiceMail({'to':_0x3a36f3[_0xd8ec('0x37')]['email'],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xd8ec('0x42')+_0xd8ec('0x43')+_0xd8ec('0x44')+_0x3a36f3['headers'][_0xd8ec('0x25')]+'/reset/'+_0x2dddaf+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xd8ec('0xe')](function(){_0x31d043['status'](0xc8)[_0xd8ec('0x31')]({'message':_0xd8ec('0x45')});})[_0xd8ec('0x1e')](function(_0x5a6bb8){return handleError(_0x31d043,0x1f4,_0x5a6bb8);});};exports[_0xd8ec('0x46')]=function(_0x5c484c,_0x3af6cc,_0x14d785){return db['User'][_0xd8ec('0x1f')]({'where':{'resetPasswordToken':_0x5c484c[_0xd8ec('0x47')][_0xd8ec('0x48')],'resetPasswordExpires':{'$gt':Date[_0xd8ec('0x41')]()}}})[_0xd8ec('0xe')](function(_0x38c3f1){if(!_0x38c3f1){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xd8ec('0xa')]['findOne']({'attributes':['id','securePassword',_0xd8ec('0x49'),_0xd8ec('0x4a')]})[_0xd8ec('0xe')](function(_0x36b9ba){if(_0x36b9ba[_0xd8ec('0x4b')])authService[_0xd8ec('0x4c')](_0x5c484c[_0xd8ec('0x37')]['password']);if(!_0x36b9ba['enforcePasswordHistory']||!_0x38c3f1[_0xd8ec('0x4d')])return _0x38c3f1;authService['validatePasswordHistory'](_0x5c484c[_0xd8ec('0x37')][_0xd8ec('0x10')],_0x38c3f1[_0xd8ec('0x4d')],_0x36b9ba[_0xd8ec('0x4a')]);return _0x38c3f1;})[_0xd8ec('0xe')](function(){_0x38c3f1[_0xd8ec('0x10')]=_0x5c484c[_0xd8ec('0x37')][_0xd8ec('0x10')];_0x38c3f1[_0xd8ec('0x3f')]=null;_0x38c3f1[_0xd8ec('0x40')]=null;return _0x38c3f1[_0xd8ec('0x4e')]();});})[_0xd8ec('0xe')](function(){_0x3af6cc['status'](0xc8)[_0xd8ec('0x31')]({'message':'Password\x20reset!'});})[_0xd8ec('0x1e')](function(_0x4f2e0){return handleError(_0x3af6cc,0x1f4,_0x4f2e0);});};passport[_0xd8ec('0x4f')](_0xd8ec('0x33'),new LocalStrategy({'usernameField':_0xd8ec('0xf'),'passwordField':_0xd8ec('0x10')},function(_0x30c25b,_0x2150d1,_0x31c15a){return localAuthenticate(db['User'],_0x30c25b,_0x2150d1,_0x31c15a);})); \ No newline at end of file +var _0x64e1=['name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','then','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','Smtp','service','secure','authentication','auth','user','pass','merge','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','Setting','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','xCally\x20Motion\x20Password\x20Reset','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!','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','enforcePasswordHistory','previousPasswords','resetPasswordExpires','Password\x20reset!','use','util','passport','lodash','randomstring','../../mysqldb','../../components/auth/service','client','http','allowedLoginAttempts','blockDuration','findOne'];(function(_0xc8bf1a,_0x43f6dd){var _0x206e52=function(_0x3d4498){while(--_0x3d4498){_0xc8bf1a['push'](_0xc8bf1a['shift']());}};_0x206e52(++_0x43f6dd);}(_0x64e1,0x9d));var _0x164e=function(_0x231ede,_0x4856bb){_0x231ede=_0x231ede-0x0;var _0x3fdd8a=_0x64e1[_0x231ede];return _0x3fdd8a;};'use strict';var util=require(_0x164e('0x0'));var passport=require(_0x164e('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x164e('0x2'));var rs=require(_0x164e('0x3'));var moment=require('moment');var db=require(_0x164e('0x4'))['db'];var authService=require(_0x164e('0x5'));var utils=require('../../config/utils');var client=jayson[_0x164e('0x6')][_0x164e('0x7')]({'port':0x232b});function localAuthenticate(_0xed8b56,_0x1a5175,_0x430444,_0x18c2c1){var _0x2b519c,_0x1d8d20;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x164e('0x8'),_0x164e('0x9')],'raw':!![]})['then'](function(_0x514a45){_0x2b519c=_0x514a45;return _0xed8b56[_0x164e('0xa')]({'attributes':['id',_0x164e('0xb'),_0x164e('0xc'),_0x164e('0xd'),_0x164e('0xe'),_0x164e('0xf'),_0x164e('0x10'),_0x164e('0x11'),_0x164e('0x12')],'where':{'name':_0x1a5175,'role':{'$or':[_0x164e('0x13'),'user',_0x164e('0x14')]}}});})[_0x164e('0x15')](function(_0x6e6d4c){if(!_0x6e6d4c||_0x6e6d4c&&_0x6e6d4c[_0x164e('0xb')]!==_0x1a5175){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1d8d20=_0x6e6d4c;return _0x1d8d20;}})[_0x164e('0x15')](function(){_0x1d8d20[_0x164e('0x16')](_0x430444,function(_0x2f643c,_0x173ae6){var _0x2fca3d=_0x1d8d20[_0x164e('0x12')]+0x1;if(_0x2f643c){return _0x18c2c1(_0x2f643c);}else if(!_0x173ae6){if(_0x1d8d20[_0x164e('0xf')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else if(_0x2b519c[_0x164e('0x8')]>0x0){if(_0x1d8d20[_0x164e('0x10')]){if(_0x2b519c[_0x164e('0x9')]>0x0){if(moment(_0x1d8d20[_0x164e('0x11')])[_0x164e('0x18')](_0x2b519c[_0x164e('0x9')],_0x164e('0x19'))>moment()){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1a')](_0x1d8d20,_0x2fca3d,![],null)['then'](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{if(_0x2fca3d>=_0x2b519c[_0x164e('0x8')]){return utils['clearBlockUser'](_0x1d8d20,0x0,!![],moment())[_0x164e('0x15')](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}else{return utils[_0x164e('0x1a')](_0x1d8d20,_0x2fca3d,![],null)[_0x164e('0x15')](function(){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});});}}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{if(_0x1d8d20[_0x164e('0xf')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else if(_0x2b519c[_0x164e('0x8')]>0x0){if(_0x1d8d20[_0x164e('0x10')]){if(_0x2b519c['blockDuration']>0x0){if(moment(_0x1d8d20[_0x164e('0x11')])[_0x164e('0x18')](_0x2b519c[_0x164e('0x9')],_0x164e('0x19'))>moment()){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1a')](_0x1d8d20,0x0,![],null)[_0x164e('0x15')](function(){return utils[_0x164e('0x1b')](_0x1d8d20);})[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);});}}else{return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}}else{return utils[_0x164e('0x1a')](_0x1d8d20,0x0,![],null)[_0x164e('0x15')](function(){return utils[_0x164e('0x1b')](_0x1d8d20);})[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);})[_0x164e('0x1c')](function(_0x5155ba){return _0x18c2c1(null,![],_0x5155ba);});}}else{if(_0x1d8d20[_0x164e('0x10')]){return _0x18c2c1(null,![],{'message':_0x164e('0x17')});}else{return utils[_0x164e('0x1b')](_0x1d8d20)[_0x164e('0x15')](function(){return _0x18c2c1(null,_0x1d8d20);});}}}});})['catch'](function(_0x2861b9){return _0x18c2c1(null,![],_0x2861b9);});}function sendServiceMail(_0x171333){return db[_0x164e('0x1d')]['find']({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':_0x164e('0x1e')}]})[_0x164e('0x15')](function(_0x49d8ef){if(!_0x49d8ef){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x81c96a={'tls':{'rejectUnauthorized':![]}};if(_0x49d8ef[_0x164e('0x1e')][_0x164e('0x1f')]){_0x81c96a[_0x164e('0x1f')]=_0x49d8ef[_0x164e('0x1e')][_0x164e('0x1f')];}else{_0x81c96a['host']=_0x49d8ef[_0x164e('0x1e')]['host'];_0x81c96a['port']=_0x49d8ef[_0x164e('0x1e')]['port'];_0x81c96a['secure']=_0x49d8ef[_0x164e('0x1e')][_0x164e('0x20')];}if(_0x49d8ef[_0x164e('0x1e')][_0x164e('0x21')]){_0x81c96a[_0x164e('0x22')]={'user':_0x49d8ef[_0x164e('0x1e')][_0x164e('0x23')],'pass':_0x49d8ef[_0x164e('0x1e')][_0x164e('0x24')]};}var _0x3589ad={'account':_0x81c96a,'message':_[_0x164e('0x25')]({'from':util['format'](_0x164e('0x26'),_0x49d8ef[_0x164e('0xb')],_0x49d8ef[_0x164e('0x27')]||_0x49d8ef[_0x164e('0x1e')]['user'])},_0x171333)};return client[_0x164e('0x28')](_0x164e('0x29'),_0x3589ad);})[_0x164e('0x15')](function(_0x4b6c19){if(_0x4b6c19[_0x164e('0x2a')]){throw new Error(util['format'](_0x164e('0x2b'),_0x4b6c19['error']['message']||JSON[_0x164e('0x2c')](_0x4b6c19[_0x164e('0x2a')])));}return!![];});}function handleError(_0x10f2ba,_0x231b16,_0x20f9cd){return _0x10f2ba[_0x164e('0x2d')](_0x231b16||0x1f4)[_0x164e('0x2e')]({'message':_0x20f9cd?_0x20f9cd['message']||_0x20f9cd:''});}exports[_0x164e('0x2f')]=function(_0x16fdb2,_0x1994e9,_0x387206){passport[_0x164e('0x16')](_0x164e('0x30'),function(_0x2de146,_0x5805e7,_0x8ebf7c){var _0x3562f4=_0x2de146||_0x8ebf7c;if(_0x3562f4){return handleError(_0x1994e9,0x191,_0x3562f4);}if(!_0x5805e7){return handleError(_0x1994e9,0x194,{'message':_0x164e('0x31')});}else{var _0x1d799d={'payload':{'id':_0x5805e7['id'],'role':_0x5805e7[_0x164e('0xe')]},'options':{'expiresIn':0x15180}};return authService[_0x164e('0x32')](_0x1d799d)[_0x164e('0x15')](function(_0x59d30e){_0x1994e9[_0x164e('0x33')]({'id':_0x5805e7['id'],'token':_0x59d30e,'statusCall':'','isAlreadyLogged':_0x5805e7[_0x164e('0x34')]});});}})(_0x16fdb2,_0x1994e9,_0x387206);};exports[_0x164e('0x35')]=function(_0x380c92,_0x11eaca,_0x435c20){if(!_0x380c92['body'][_0x164e('0x27')]){return handleError(_0x11eaca,0x1f4,{'message':_0x164e('0x36')});}var _0x17d55d=rs[_0x164e('0x37')]();_0x380c92['body']['email']=_0x380c92[_0x164e('0x38')][_0x164e('0x27')][_0x164e('0x39')]()[_0x164e('0x3a')]();var _0x2ec6d5;return db[_0x164e('0x3b')]['findOne']({'where':{'id':0x1},'attributes':[_0x164e('0x8'),_0x164e('0x9')],'raw':!![]})[_0x164e('0x15')](function(_0x20fa67){_0x2ec6d5=_0x20fa67;return db[_0x164e('0x3c')][_0x164e('0x3d')]({'where':{'email':_0x380c92[_0x164e('0x38')][_0x164e('0x27')]}});})[_0x164e('0x15')](function(_0x462a8b){if(!_0x462a8b){throw new Error(_0x164e('0x3e'));}if(_0x462a8b['disabled']){throw new Error(_0x164e('0x3f'));}if(_0x462a8b['blocked']){if(moment(_0x462a8b['blockedAt'])[_0x164e('0x18')](_0x2ec6d5[_0x164e('0x9')],'minutes')>moment()){throw new Error(_0x164e('0x40'));}else{_0x462a8b[_0x164e('0x10')]=![];_0x462a8b[_0x164e('0x11')]=null;}}_0x462a8b[_0x164e('0x41')]=_0x17d55d;_0x462a8b['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x462a8b[_0x164e('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x380c92[_0x164e('0x38')][_0x164e('0x27')],'subject':_0x164e('0x43'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x164e('0x44')+_0x164e('0x45')+_0x380c92[_0x164e('0x46')][_0x164e('0x47')]+_0x164e('0x48')+_0x17d55d+'\x0a\x0a'+_0x164e('0x49')});})['then'](function(){_0x11eaca[_0x164e('0x2d')](0xc8)[_0x164e('0x2e')]({'message':_0x164e('0x4a')});})[_0x164e('0x1c')](function(_0x5ba043){return handleError(_0x11eaca,0x1f4,_0x5ba043);});};exports['reset']=function(_0x5e8cc6,_0x2ba370,_0x5cfd8c){return db[_0x164e('0x3c')][_0x164e('0x3d')]({'where':{'resetPasswordToken':_0x5e8cc6['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x164e('0x4b')]()}}})[_0x164e('0x15')](function(_0x2ca490){if(!_0x2ca490){throw new Error(_0x164e('0x4c'));}return db[_0x164e('0x3b')][_0x164e('0xa')]({'attributes':['id',_0x164e('0x4d'),'enforcePasswordHistory',_0x164e('0x4e')]})[_0x164e('0x15')](function(_0x348a50){if(_0x348a50['securePassword'])authService['validatePasswordPattern'](_0x5e8cc6['body']['password']);if(!_0x348a50[_0x164e('0x4f')]||!_0x2ca490[_0x164e('0x50')])return _0x2ca490;authService['validatePasswordHistory'](_0x5e8cc6[_0x164e('0x38')][_0x164e('0xc')],_0x2ca490['previousPasswords'],_0x348a50[_0x164e('0x4e')]);return _0x2ca490;})[_0x164e('0x15')](function(){_0x2ca490['password']=_0x5e8cc6[_0x164e('0x38')][_0x164e('0xc')];_0x2ca490['resetPasswordToken']=null;_0x2ca490[_0x164e('0x51')]=null;return _0x2ca490[_0x164e('0x42')]();});})[_0x164e('0x15')](function(){_0x2ba370['status'](0xc8)['send']({'message':_0x164e('0x52')});})[_0x164e('0x1c')](function(_0x44c03e){return handleError(_0x2ba370,0x1f4,_0x44c03e);});};passport[_0x164e('0x53')](_0x164e('0x30'),new LocalStrategy({'usernameField':_0x164e('0xb'),'passwordField':_0x164e('0xc')},function(_0xe1f9ec,_0xe49dc7,_0x28c2f1){return localAuthenticate(db[_0x164e('0x3c')],_0xe1f9ec,_0xe49dc7,_0x28c2f1);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index d7e9e46..1198bce 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 _0x996d=['forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post','/forgot'];(function(_0xf4bfc4,_0x2972e9){var _0x1e3353=function(_0x495ad3){while(--_0x495ad3){_0xf4bfc4['push'](_0xf4bfc4['shift']());}};_0x1e3353(++_0x2972e9);}(_0x996d,0x9d));var _0xd996=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x996d[_0x17928f];return _0x500b63;};'use strict';var express=require(_0xd996('0x0'));var router=express[_0xd996('0x1')]();var controller=require(_0xd996('0x2'));router['post']('/',controller['login']);router[_0xd996('0x3')](_0xd996('0x4'),controller[_0xd996('0x5')]);router['post'](_0xd996('0x6'),controller[_0xd996('0x7')]);module[_0xd996('0x8')]=router; \ No newline at end of file +var _0x05a8=['./authLocal.controller','post','forgot','/reset/:token','exports','express','Router'];(function(_0x5a1aea,_0x28b3c9){var _0x8e73ce=function(_0x453f6c){while(--_0x453f6c){_0x5a1aea['push'](_0x5a1aea['shift']());}};_0x8e73ce(++_0x28b3c9);}(_0x05a8,0x1e8));var _0x805a=function(_0x2e6267,_0x441579){_0x2e6267=_0x2e6267-0x0;var _0x55c699=_0x05a8[_0x2e6267];return _0x55c699;};'use strict';var express=require(_0x805a('0x0'));var router=express[_0x805a('0x1')]();var controller=require(_0x805a('0x2'));router[_0x805a('0x3')]('/',controller['login']);router[_0x805a('0x3')]('/forgot',controller[_0x805a('0x4')]);router[_0x805a('0x3')](_0x805a('0x5'),controller['reset']);module[_0x805a('0x6')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index ff9c5bb..8f8311d 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 _0xcb4b=['exports','STRING','INTEGER','sequelize'];(function(_0x9537ff,_0x565939){var _0x548a6f=function(_0x52f094){while(--_0x52f094){_0x9537ff['push'](_0x9537ff['shift']());}};_0x548a6f(++_0x565939);}(_0xcb4b,0xab));var _0xbcb4=function(_0xceda8c,_0x42e367){_0xceda8c=_0xceda8c-0x0;var _0x3fa307=_0xcb4b[_0xceda8c];return _0x3fa307;};'use strict';var Sequelize=require(_0xbcb4('0x0'));module[_0xbcb4('0x1')]={'name':{'type':Sequelize[_0xbcb4('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xbcb4('0x2')]},'description':{'type':Sequelize[_0xbcb4('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xbcb4('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x8c58=['STRING','BOOLEAN','sequelize'];(function(_0x30f6ed,_0x417bde){var _0x393e89=function(_0x25eabc){while(--_0x25eabc){_0x30f6ed['push'](_0x30f6ed['shift']());}};_0x393e89(++_0x417bde);}(_0x8c58,0xc2));var _0x88c5=function(_0x4c0622,_0x5dacaf){_0x4c0622=_0x4c0622-0x0;var _0x1799d8=_0x8c58[_0x4c0622];return _0x1799d8;};'use strict';var Sequelize=require(_0x88c5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x88c5('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x88c5('0x2')],'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 963e4e0..d74ed18 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 _0x222e=['getActions','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','map','Automation','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','intersection','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action'];(function(_0x22099d,_0x409006){var _0x10f602=function(_0x2c1f6f){while(--_0x2c1f6f){_0x22099d['push'](_0x22099d['shift']());}};_0x10f602(++_0x409006);}(_0x222e,0x149));var _0xe222=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x222e[_0x3ab51d];return _0x29a04e;};'use strict';var emlformat=require(_0xe222('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe222('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe222('0x2'));var Mustache=require(_0xe222('0x3'));var util=require(_0xe222('0x4'));var path=require(_0xe222('0x5'));var sox=require(_0xe222('0x6'));var csv=require(_0xe222('0x7'));var ejs=require(_0xe222('0x8'));var fs=require('fs');var fs_extra=require(_0xe222('0x9'));var _=require(_0xe222('0xa'));var squel=require(_0xe222('0xb'));var crypto=require(_0xe222('0xc'));var jsforce=require(_0xe222('0xd'));var deskjs=require(_0xe222('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe222('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe222('0x10'));var qs=require(_0xe222('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe222('0x12'))(_0xe222('0x13'));var utils=require(_0xe222('0x14'));var config=require(_0xe222('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x136de2,_0x32fde3){_0x32fde3=_0x32fde3||0xcc;return function(_0x5bab1b){if(_0x5bab1b){return _0x136de2[_0xe222('0x16')](_0x32fde3);}return _0x136de2[_0xe222('0x17')](_0x32fde3)[_0xe222('0x18')]();};}function respondWithResult(_0x46012b,_0x231327){_0x231327=_0x231327||0xc8;return function(_0x67dde){if(_0x67dde){return _0x46012b[_0xe222('0x17')](_0x231327)['json'](_0x67dde);}};}function respondWithFilteredResult(_0x10cb4a,_0x562c2e){return function(_0x4f84d0){if(_0x4f84d0){var _0xdcfbfe=typeof _0x562c2e[_0xe222('0x19')]==='undefined'&&typeof _0x562c2e[_0xe222('0x1a')]===_0xe222('0x1b');var _0x54a8aa=_0x4f84d0[_0xe222('0x1c')];var _0x170bf8=_0xdcfbfe?0x0:_0x562c2e[_0xe222('0x19')];var _0x45393f=_0xdcfbfe?_0x4f84d0[_0xe222('0x1c')]:_0x562c2e[_0xe222('0x19')]+_0x562c2e[_0xe222('0x1a')];var _0x49086e;if(_0x45393f>=_0x54a8aa){_0x45393f=_0x54a8aa;_0x49086e=0xc8;}else{_0x49086e=0xce;}_0x10cb4a['status'](_0x49086e);return _0x10cb4a[_0xe222('0x1d')](_0xe222('0x1e'),_0x170bf8+'-'+_0x45393f+'/'+_0x54a8aa)[_0xe222('0x1f')](_0x4f84d0);}return null;};}function patchUpdates(_0x44d59b){return function(_0x4f21f6){try{jsonpatch[_0xe222('0x20')](_0x4f21f6,_0x44d59b,!![]);}catch(_0x51dade){return BPromise[_0xe222('0x21')](_0x51dade);}return _0x4f21f6[_0xe222('0x22')]();};}function saveUpdates(_0xd04c25,_0x25a7e3){return function(_0x37cca9){if(_0x37cca9){return _0x37cca9[_0xe222('0x23')](_0xd04c25)[_0xe222('0x24')](function(_0x4ac92f){return _0x4ac92f;});}return null;};}function removeEntity(_0x153bfb,_0x3e84e2){return function(_0x2ea778){if(_0x2ea778){return _0x2ea778[_0xe222('0x25')]()['then'](function(){_0x153bfb['status'](0xcc)[_0xe222('0x18')]();});}};}function handleEntityNotFound(_0x19849b,_0x5194ff){return function(_0x98b0be){if(!_0x98b0be){_0x19849b[_0xe222('0x16')](0x194);}return _0x98b0be;};}function handleError(_0x21620a,_0x3c4b3f){_0x3c4b3f=_0x3c4b3f||0x1f4;return function(_0x3520b7){logger['error'](_0x3520b7['stack']);if(_0x3520b7['name']){delete _0x3520b7[_0xe222('0x26')];}_0x21620a[_0xe222('0x17')](_0x3c4b3f)[_0xe222('0x27')](_0x3520b7);};}exports[_0xe222('0x28')]=function(_0x17ef71,_0x3114fa){var _0x40cd1f={},_0x3c6c95={},_0x52dea1={'count':0x0,'rows':[]};var _0x53f8c6=_[_0xe222('0x29')](db[_0xe222('0x2a')][_0xe222('0x2b')],function(_0x3c1779){return{'name':_0x3c1779[_0xe222('0x2c')],'type':_0x3c1779[_0xe222('0x2d')]['key']};});_0x3c6c95[_0xe222('0x2e')]=_[_0xe222('0x29')](_0x53f8c6,_0xe222('0x26'));_0x3c6c95[_0xe222('0x2f')]=_[_0xe222('0x30')](_0x17ef71[_0xe222('0x2f')]);_0x3c6c95[_0xe222('0x31')]=_['intersection'](_0x3c6c95[_0xe222('0x2e')],_0x3c6c95[_0xe222('0x2f')]);_0x40cd1f[_0xe222('0x32')]=_['intersection'](_0x3c6c95[_0xe222('0x2e')],qs[_0xe222('0x33')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x33')]));_0x40cd1f[_0xe222('0x32')]=_0x40cd1f['attributes'][_0xe222('0x34')]?_0x40cd1f[_0xe222('0x32')]:_0x3c6c95[_0xe222('0x2e')];if(!_0x17ef71[_0xe222('0x2f')][_0xe222('0x35')](_0xe222('0x36'))){_0x40cd1f[_0xe222('0x1a')]=qs[_0xe222('0x1a')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x1a')]);_0x40cd1f[_0xe222('0x19')]=qs[_0xe222('0x19')](_0x17ef71[_0xe222('0x2f')][_0xe222('0x19')]);}_0x40cd1f[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x17ef71['query']['sort']);_0x40cd1f[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x17ef71[_0xe222('0x2f')],_0x3c6c95[_0xe222('0x31')]),_0x53f8c6);if(_0x17ef71[_0xe222('0x2f')]['filter']){_0x40cd1f[_0xe222('0x39')]=_[_0xe222('0x3b')](_0x40cd1f[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x53f8c6,function(_0x5c50c2){if(_0x5c50c2[_0xe222('0x2d')]!==_0xe222('0x3c')){var _0xa1a6e9={};_0xa1a6e9[_0x5c50c2[_0xe222('0x26')]]={'$like':'%'+_0x17ef71[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0xa1a6e9;}})});}_0x40cd1f=_[_0xe222('0x3b')]({},_0x40cd1f,_0x17ef71[_0xe222('0x3e')]);var _0x130409={'where':_0x40cd1f[_0xe222('0x39')]};return db[_0xe222('0x2a')][_0xe222('0x1c')](_0x130409)[_0xe222('0x24')](function(_0x2944be){_0x52dea1['count']=_0x2944be;if(_0x17ef71['query'][_0xe222('0x3f')]){_0x40cd1f[_0xe222('0x40')]=[{'all':!![]}];}return db['Automation']['findAll'](_0x40cd1f);})[_0xe222('0x24')](function(_0x379cd0){_0x52dea1[_0xe222('0x41')]=_0x379cd0;return _0x52dea1;})[_0xe222('0x24')](respondWithFilteredResult(_0x3114fa,_0x40cd1f))[_0xe222('0x42')](handleError(_0x3114fa,null));};exports[_0xe222('0x43')]=function(_0x168fe7,_0x309f46){var _0x495800={'raw':![],'where':{'id':_0x168fe7[_0xe222('0x44')]['id']}},_0x1deb7e={};_0x1deb7e[_0xe222('0x2e')]=_['keys'](db[_0xe222('0x2a')][_0xe222('0x2b')]);_0x1deb7e[_0xe222('0x2f')]=_['keys'](_0x168fe7[_0xe222('0x2f')]);_0x1deb7e[_0xe222('0x31')]=_[_0xe222('0x45')](_0x1deb7e[_0xe222('0x2e')],_0x1deb7e[_0xe222('0x2f')]);_0x495800[_0xe222('0x32')]=_[_0xe222('0x45')](_0x1deb7e[_0xe222('0x2e')],qs[_0xe222('0x33')](_0x168fe7[_0xe222('0x2f')][_0xe222('0x33')]));_0x495800[_0xe222('0x32')]=_0x495800[_0xe222('0x32')][_0xe222('0x34')]?_0x495800[_0xe222('0x32')]:_0x1deb7e['model'];if(_0x168fe7[_0xe222('0x2f')]['includeAll']){_0x495800['include']=[{'all':!![]}];}_0x495800=_[_0xe222('0x3b')]({},_0x495800,_0x168fe7['options']);return db[_0xe222('0x2a')]['find'](_0x495800)[_0xe222('0x24')](handleEntityNotFound(_0x309f46,null))['then'](respondWithResult(_0x309f46,null))['catch'](handleError(_0x309f46,null));};exports['create']=function(_0xff65c0,_0x372d7e){return db[_0xe222('0x2a')][_0xe222('0x46')](_0xff65c0[_0xe222('0x47')],{})['then'](respondWithResult(_0x372d7e,0xc9))['catch'](handleError(_0x372d7e,null));};exports[_0xe222('0x23')]=function(_0x43704e,_0x42efe6){if(_0x43704e[_0xe222('0x47')]['id']){delete _0x43704e[_0xe222('0x47')]['id'];}return db[_0xe222('0x2a')]['find']({'where':{'id':_0x43704e[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x42efe6,null))[_0xe222('0x24')](saveUpdates(_0x43704e[_0xe222('0x47')],null))[_0xe222('0x24')](respondWithResult(_0x42efe6,null))[_0xe222('0x42')](handleError(_0x42efe6,null));};exports[_0xe222('0x25')]=function(_0x253eae,_0xccd460){return db[_0xe222('0x2a')][_0xe222('0x48')]({'where':{'id':_0x253eae['params']['id']}})[_0xe222('0x24')](handleEntityNotFound(_0xccd460,null))['then'](removeEntity(_0xccd460,null))[_0xe222('0x42')](handleError(_0xccd460,null));};exports[_0xe222('0x49')]=function(_0xa355ad,_0x11a5ce,_0x1a3c0a){return db[_0xe222('0x4a')][_0xe222('0x48')]({'where':{'id':_0xa355ad[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x11a5ce,null))['then'](function(_0x197690){if(_0x197690){return _0x197690[_0xe222('0x49')](_0xa355ad[_0xe222('0x47')][_0xe222('0x4b')],_[_0xe222('0x4c')](_0xa355ad[_0xe222('0x47')],[_0xe222('0x4b'),'id'])||{});}})[_0xe222('0x24')](respondWithResult(_0x11a5ce,null))[_0xe222('0x42')](handleError(_0x11a5ce,null));};exports[_0xe222('0x4d')]=function(_0x389b36,_0x2673f1,_0x3c0a0c){var _0x19c9ee={};var _0xbc00ee={};var _0x5b24c7;var _0x268a2d;return db[_0xe222('0x2a')][_0xe222('0x4e')]({'where':{'id':_0x389b36[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x2673f1,null))[_0xe222('0x24')](function(_0x327ba9){if(_0x327ba9){_0x5b24c7=_0x327ba9;_0xbc00ee[_0xe222('0x2e')]=_['keys'](db[_0xe222('0x4a')]['rawAttributes']);_0xbc00ee['query']=_[_0xe222('0x30')](_0x389b36[_0xe222('0x2f')]);_0xbc00ee['filters']=_['intersection'](_0xbc00ee[_0xe222('0x2e')],_0xbc00ee[_0xe222('0x2f')]);_0x19c9ee[_0xe222('0x32')]=_['intersection'](_0xbc00ee['model'],qs[_0xe222('0x33')](_0x389b36[_0xe222('0x2f')][_0xe222('0x33')]));_0x19c9ee[_0xe222('0x32')]=_0x19c9ee[_0xe222('0x32')][_0xe222('0x34')]?_0x19c9ee[_0xe222('0x32')]:_0xbc00ee[_0xe222('0x2e')];_0x19c9ee[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x389b36['query']['sort']);_0x19c9ee[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x389b36[_0xe222('0x2f')],_0xbc00ee[_0xe222('0x31')]));if(_0x389b36[_0xe222('0x2f')][_0xe222('0x3d')]){_0x19c9ee['where']=_['merge'](_0x19c9ee[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x19c9ee[_0xe222('0x32')],function(_0x5bc090){var _0x49d46d={};_0x49d46d[_0x5bc090]={'$like':'%'+_0x389b36[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0x49d46d;})});}_0x19c9ee=_[_0xe222('0x3b')]({},_0x19c9ee,_0x389b36[_0xe222('0x3e')]);return _0x5b24c7[_0xe222('0x4d')](_0x19c9ee);}})[_0xe222('0x24')](function(_0x2437bb){if(_0x2437bb){_0x268a2d=_0x2437bb[_0xe222('0x34')];if(!_0x389b36['query'][_0xe222('0x35')](_0xe222('0x36'))){_0x19c9ee['limit']=qs[_0xe222('0x1a')](_0x389b36['query'][_0xe222('0x1a')]);_0x19c9ee[_0xe222('0x19')]=qs['offset'](_0x389b36[_0xe222('0x2f')][_0xe222('0x19')]);}return _0x5b24c7[_0xe222('0x4d')](_0x19c9ee);}})[_0xe222('0x24')](function(_0x1bb8b8){if(_0x1bb8b8){return _0x1bb8b8?{'count':_0x268a2d,'rows':_0x1bb8b8}:null;}})['then'](respondWithResult(_0x2673f1,null))[_0xe222('0x42')](handleError(_0x2673f1,null));};exports[_0xe222('0x4f')]=function(_0x1879c1,_0x21ac31,_0x502feb){return db[_0xe222('0x50')][_0xe222('0x48')]({'where':{'id':_0x1879c1[_0xe222('0x44')]['id']}})[_0xe222('0x24')](handleEntityNotFound(_0x21ac31,null))['then'](function(_0x2e2f36){if(_0x2e2f36){return _0x2e2f36[_0xe222('0x4f')](_0x1879c1[_0xe222('0x47')][_0xe222('0x4b')],_['omit'](_0x1879c1['body'],[_0xe222('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x21ac31,null))[_0xe222('0x42')](handleError(_0x21ac31,null));};exports['getActions']=function(_0x12f36c,_0x5a1ad1,_0x530696){var _0x59775f={};var _0x2745a6={};var _0x2661d6;var _0x35d4eb;return db[_0xe222('0x2a')][_0xe222('0x4e')]({'where':{'id':_0x12f36c[_0xe222('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a1ad1,null))[_0xe222('0x24')](function(_0x1aea78){if(_0x1aea78){_0x2661d6=_0x1aea78;_0x2745a6['model']=_[_0xe222('0x30')](db[_0xe222('0x50')][_0xe222('0x2b')]);_0x2745a6[_0xe222('0x2f')]=_[_0xe222('0x30')](_0x12f36c['query']);_0x2745a6[_0xe222('0x31')]=_[_0xe222('0x45')](_0x2745a6[_0xe222('0x2e')],_0x2745a6[_0xe222('0x2f')]);_0x59775f[_0xe222('0x32')]=_[_0xe222('0x45')](_0x2745a6['model'],qs['fields'](_0x12f36c[_0xe222('0x2f')][_0xe222('0x33')]));_0x59775f['attributes']=_0x59775f[_0xe222('0x32')][_0xe222('0x34')]?_0x59775f[_0xe222('0x32')]:_0x2745a6['model'];_0x59775f[_0xe222('0x37')]=qs[_0xe222('0x38')](_0x12f36c['query'][_0xe222('0x38')]);_0x59775f[_0xe222('0x39')]=qs[_0xe222('0x31')](_[_0xe222('0x3a')](_0x12f36c['query'],_0x2745a6[_0xe222('0x31')]));if(_0x12f36c['query'][_0xe222('0x3d')]){_0x59775f[_0xe222('0x39')]=_[_0xe222('0x3b')](_0x59775f[_0xe222('0x39')],{'$or':_[_0xe222('0x29')](_0x59775f['attributes'],function(_0x4e2b82){var _0x45d6b9={};_0x45d6b9[_0x4e2b82]={'$like':'%'+_0x12f36c[_0xe222('0x2f')][_0xe222('0x3d')]+'%'};return _0x45d6b9;})});}_0x59775f=_['merge']({},_0x59775f,_0x12f36c['options']);return _0x2661d6[_0xe222('0x51')](_0x59775f);}})['then'](function(_0x581265){if(_0x581265){_0x35d4eb=_0x581265['length'];if(!_0x12f36c['query'][_0xe222('0x35')](_0xe222('0x36'))){_0x59775f[_0xe222('0x1a')]=qs[_0xe222('0x1a')](_0x12f36c[_0xe222('0x2f')][_0xe222('0x1a')]);_0x59775f[_0xe222('0x19')]=qs[_0xe222('0x19')](_0x12f36c[_0xe222('0x2f')][_0xe222('0x19')]);}return _0x2661d6[_0xe222('0x51')](_0x59775f);}})['then'](function(_0x162183){if(_0x162183){return _0x162183?{'count':_0x35d4eb,'rows':_0x162183}:null;}})[_0xe222('0x24')](respondWithResult(_0x5a1ad1,null))[_0xe222('0x42')](handleError(_0x5a1ad1,null));}; \ No newline at end of file +var _0x332e=['set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','Automation','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','filter','VIRTUAL','merge','options','includeAll','rows','catch','show','params','include','find','create','body','update','Condition','ids','omit','getConditions','findOne','sort','pick','Action','addActions','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset'];(function(_0x3dd445,_0xaa0173){var _0xfed7d0=function(_0xd4cee1){while(--_0xd4cee1){_0x3dd445['push'](_0x3dd445['shift']());}};_0xfed7d0(++_0xaa0173);}(_0x332e,0x1df));var _0xe332=function(_0x380307,_0x440ccd){_0x380307=_0x380307-0x0;var _0x9ea14b=_0x332e[_0x380307];return _0x9ea14b;};'use strict';var emlformat=require(_0xe332('0x0'));var rimraf=require(_0xe332('0x1'));var zipdir=require(_0xe332('0x2'));var jsonpatch=require(_0xe332('0x3'));var rp=require(_0xe332('0x4'));var moment=require(_0xe332('0x5'));var BPromise=require(_0xe332('0x6'));var Mustache=require('mustache');var util=require(_0xe332('0x7'));var path=require(_0xe332('0x8'));var sox=require('sox');var csv=require(_0xe332('0x9'));var ejs=require(_0xe332('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe332('0xb'));var squel=require(_0xe332('0xc'));var crypto=require('crypto');var jsforce=require(_0xe332('0xd'));var deskjs=require(_0xe332('0xe'));var toCsv=require(_0xe332('0x9'));var querystring=require('querystring');var Papa=require(_0xe332('0xf'));var Redis=require(_0xe332('0x10'));var authService=require(_0xe332('0x11'));var qs=require(_0xe332('0x12'));var as=require(_0xe332('0x13'));var hardwareService=require(_0xe332('0x14'));var logger=require(_0xe332('0x15'))('api');var utils=require(_0xe332('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe332('0x17'));var db=require(_0xe332('0x18'))['db'];function respondWithStatusCode(_0x9b4911,_0x39a73a){_0x39a73a=_0x39a73a||0xcc;return function(_0x1edbf9){if(_0x1edbf9){return _0x9b4911['sendStatus'](_0x39a73a);}return _0x9b4911[_0xe332('0x19')](_0x39a73a)['end']();};}function respondWithResult(_0x5a9bdd,_0x16ce8b){_0x16ce8b=_0x16ce8b||0xc8;return function(_0x240639){if(_0x240639){return _0x5a9bdd[_0xe332('0x19')](_0x16ce8b)[_0xe332('0x1a')](_0x240639);}};}function respondWithFilteredResult(_0xd3979f,_0xde707){return function(_0x335d2d){if(_0x335d2d){var _0x4e5be0=typeof _0xde707['offset']==='undefined'&&typeof _0xde707[_0xe332('0x1b')]===_0xe332('0x1c');var _0x596a49=_0x335d2d[_0xe332('0x1d')];var _0x274971=_0x4e5be0?0x0:_0xde707[_0xe332('0x1e')];var _0x166c04=_0x4e5be0?_0x335d2d[_0xe332('0x1d')]:_0xde707['offset']+_0xde707[_0xe332('0x1b')];var _0x3baf2f;if(_0x166c04>=_0x596a49){_0x166c04=_0x596a49;_0x3baf2f=0xc8;}else{_0x3baf2f=0xce;}_0xd3979f[_0xe332('0x19')](_0x3baf2f);return _0xd3979f[_0xe332('0x1f')](_0xe332('0x20'),_0x274971+'-'+_0x166c04+'/'+_0x596a49)['json'](_0x335d2d);}return null;};}function patchUpdates(_0x17762e){return function(_0x38d81b){try{jsonpatch[_0xe332('0x21')](_0x38d81b,_0x17762e,!![]);}catch(_0x3a4b89){return BPromise[_0xe332('0x22')](_0x3a4b89);}return _0x38d81b[_0xe332('0x23')]();};}function saveUpdates(_0x22beec,_0x40472e){return function(_0x3108f3){if(_0x3108f3){return _0x3108f3['update'](_0x22beec)[_0xe332('0x24')](function(_0xfbc963){return _0xfbc963;});}return null;};}function removeEntity(_0xfc1605,_0x3fe1f9){return function(_0x252c75){if(_0x252c75){return _0x252c75[_0xe332('0x25')]()[_0xe332('0x24')](function(){_0xfc1605['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x276389,_0x1fb14e){return function(_0x53fc1f){if(!_0x53fc1f){_0x276389['sendStatus'](0x194);}return _0x53fc1f;};}function handleError(_0x5e52cd,_0x43dcb3){_0x43dcb3=_0x43dcb3||0x1f4;return function(_0x224b8d){logger[_0xe332('0x26')](_0x224b8d[_0xe332('0x27')]);if(_0x224b8d[_0xe332('0x28')]){delete _0x224b8d[_0xe332('0x28')];}_0x5e52cd[_0xe332('0x19')](_0x43dcb3)[_0xe332('0x29')](_0x224b8d);};}exports[_0xe332('0x2a')]=function(_0x86987c,_0x1f5236){var _0x27e6a8={},_0x46de9f={},_0x5b0935={'count':0x0,'rows':[]};var _0x15c16c=_['map'](db[_0xe332('0x2b')][_0xe332('0x2c')],function(_0x493322){return{'name':_0x493322[_0xe332('0x2d')],'type':_0x493322[_0xe332('0x2e')][_0xe332('0x2f')]};});_0x46de9f['model']=_[_0xe332('0x30')](_0x15c16c,'name');_0x46de9f[_0xe332('0x31')]=_[_0xe332('0x32')](_0x86987c[_0xe332('0x31')]);_0x46de9f['filters']=_[_0xe332('0x33')](_0x46de9f[_0xe332('0x34')],_0x46de9f['query']);_0x27e6a8[_0xe332('0x35')]=_[_0xe332('0x33')](_0x46de9f[_0xe332('0x34')],qs['fields'](_0x86987c['query'][_0xe332('0x36')]));_0x27e6a8[_0xe332('0x35')]=_0x27e6a8[_0xe332('0x35')][_0xe332('0x37')]?_0x27e6a8[_0xe332('0x35')]:_0x46de9f['model'];if(!_0x86987c[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x27e6a8[_0xe332('0x1b')]=qs[_0xe332('0x1b')](_0x86987c[_0xe332('0x31')][_0xe332('0x1b')]);_0x27e6a8[_0xe332('0x1e')]=qs['offset'](_0x86987c[_0xe332('0x31')][_0xe332('0x1e')]);}_0x27e6a8[_0xe332('0x3a')]=qs['sort'](_0x86987c[_0xe332('0x31')]['sort']);_0x27e6a8[_0xe332('0x3b')]=qs[_0xe332('0x3c')](_['pick'](_0x86987c[_0xe332('0x31')],_0x46de9f[_0xe332('0x3c')]),_0x15c16c);if(_0x86987c[_0xe332('0x31')][_0xe332('0x3d')]){_0x27e6a8[_0xe332('0x3b')]=_['merge'](_0x27e6a8[_0xe332('0x3b')],{'$or':_['map'](_0x15c16c,function(_0x398e12){if(_0x398e12[_0xe332('0x2e')]!==_0xe332('0x3e')){var _0x161894={};_0x161894[_0x398e12[_0xe332('0x28')]]={'$like':'%'+_0x86987c[_0xe332('0x31')][_0xe332('0x3d')]+'%'};return _0x161894;}})});}_0x27e6a8=_[_0xe332('0x3f')]({},_0x27e6a8,_0x86987c[_0xe332('0x40')]);var _0x8c4861={'where':_0x27e6a8['where']};return db[_0xe332('0x2b')]['count'](_0x8c4861)[_0xe332('0x24')](function(_0x28baa7){_0x5b0935[_0xe332('0x1d')]=_0x28baa7;if(_0x86987c[_0xe332('0x31')][_0xe332('0x41')]){_0x27e6a8['include']=[{'all':!![]}];}return db[_0xe332('0x2b')]['findAll'](_0x27e6a8);})[_0xe332('0x24')](function(_0x1896e8){_0x5b0935[_0xe332('0x42')]=_0x1896e8;return _0x5b0935;})['then'](respondWithFilteredResult(_0x1f5236,_0x27e6a8))[_0xe332('0x43')](handleError(_0x1f5236,null));};exports[_0xe332('0x44')]=function(_0x117487,_0x37a1f0){var _0x5bd80b={'raw':![],'where':{'id':_0x117487[_0xe332('0x45')]['id']}},_0x48770d={};_0x48770d['model']=_['keys'](db[_0xe332('0x2b')]['rawAttributes']);_0x48770d[_0xe332('0x31')]=_[_0xe332('0x32')](_0x117487[_0xe332('0x31')]);_0x48770d[_0xe332('0x3c')]=_['intersection'](_0x48770d[_0xe332('0x34')],_0x48770d[_0xe332('0x31')]);_0x5bd80b['attributes']=_[_0xe332('0x33')](_0x48770d[_0xe332('0x34')],qs[_0xe332('0x36')](_0x117487[_0xe332('0x31')]['fields']));_0x5bd80b['attributes']=_0x5bd80b[_0xe332('0x35')]['length']?_0x5bd80b[_0xe332('0x35')]:_0x48770d['model'];if(_0x117487[_0xe332('0x31')][_0xe332('0x41')]){_0x5bd80b[_0xe332('0x46')]=[{'all':!![]}];}_0x5bd80b=_[_0xe332('0x3f')]({},_0x5bd80b,_0x117487[_0xe332('0x40')]);return db[_0xe332('0x2b')][_0xe332('0x47')](_0x5bd80b)['then'](handleEntityNotFound(_0x37a1f0,null))[_0xe332('0x24')](respondWithResult(_0x37a1f0,null))[_0xe332('0x43')](handleError(_0x37a1f0,null));};exports[_0xe332('0x48')]=function(_0x34c5db,_0x3ab7ed){return db['Automation']['create'](_0x34c5db[_0xe332('0x49')],{})['then'](respondWithResult(_0x3ab7ed,0xc9))[_0xe332('0x43')](handleError(_0x3ab7ed,null));};exports[_0xe332('0x4a')]=function(_0x23b757,_0x1d5c69){if(_0x23b757[_0xe332('0x49')]['id']){delete _0x23b757[_0xe332('0x49')]['id'];}return db[_0xe332('0x2b')][_0xe332('0x47')]({'where':{'id':_0x23b757['params']['id']}})[_0xe332('0x24')](handleEntityNotFound(_0x1d5c69,null))[_0xe332('0x24')](saveUpdates(_0x23b757['body'],null))[_0xe332('0x24')](respondWithResult(_0x1d5c69,null))[_0xe332('0x43')](handleError(_0x1d5c69,null));};exports[_0xe332('0x25')]=function(_0x590844,_0x4b80d5){return db[_0xe332('0x2b')][_0xe332('0x47')]({'where':{'id':_0x590844[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b80d5,null))[_0xe332('0x24')](removeEntity(_0x4b80d5,null))[_0xe332('0x43')](handleError(_0x4b80d5,null));};exports['addConditions']=function(_0x9ba8c5,_0x33371b,_0x3017e3){return db[_0xe332('0x4b')][_0xe332('0x47')]({'where':{'id':_0x9ba8c5[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x33371b,null))[_0xe332('0x24')](function(_0x31731d){if(_0x31731d){return _0x31731d['addConditions'](_0x9ba8c5['body'][_0xe332('0x4c')],_[_0xe332('0x4d')](_0x9ba8c5[_0xe332('0x49')],[_0xe332('0x4c'),'id'])||{});}})[_0xe332('0x24')](respondWithResult(_0x33371b,null))[_0xe332('0x43')](handleError(_0x33371b,null));};exports[_0xe332('0x4e')]=function(_0x4759c3,_0x1fbeba,_0x12a571){var _0x57b531={};var _0x24ea22={};var _0x1822be;var _0x392ac9;return db[_0xe332('0x2b')][_0xe332('0x4f')]({'where':{'id':_0x4759c3[_0xe332('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fbeba,null))[_0xe332('0x24')](function(_0x4eb0c1){if(_0x4eb0c1){_0x1822be=_0x4eb0c1;_0x24ea22[_0xe332('0x34')]=_[_0xe332('0x32')](db['Condition'][_0xe332('0x2c')]);_0x24ea22['query']=_[_0xe332('0x32')](_0x4759c3[_0xe332('0x31')]);_0x24ea22[_0xe332('0x3c')]=_[_0xe332('0x33')](_0x24ea22[_0xe332('0x34')],_0x24ea22[_0xe332('0x31')]);_0x57b531[_0xe332('0x35')]=_[_0xe332('0x33')](_0x24ea22['model'],qs['fields'](_0x4759c3[_0xe332('0x31')][_0xe332('0x36')]));_0x57b531['attributes']=_0x57b531['attributes']['length']?_0x57b531[_0xe332('0x35')]:_0x24ea22[_0xe332('0x34')];_0x57b531['order']=qs[_0xe332('0x50')](_0x4759c3[_0xe332('0x31')][_0xe332('0x50')]);_0x57b531[_0xe332('0x3b')]=qs[_0xe332('0x3c')](_[_0xe332('0x51')](_0x4759c3[_0xe332('0x31')],_0x24ea22[_0xe332('0x3c')]));if(_0x4759c3['query'][_0xe332('0x3d')]){_0x57b531[_0xe332('0x3b')]=_[_0xe332('0x3f')](_0x57b531[_0xe332('0x3b')],{'$or':_[_0xe332('0x30')](_0x57b531[_0xe332('0x35')],function(_0x522d3e){var _0x30c3c3={};_0x30c3c3[_0x522d3e]={'$like':'%'+_0x4759c3[_0xe332('0x31')]['filter']+'%'};return _0x30c3c3;})});}_0x57b531=_[_0xe332('0x3f')]({},_0x57b531,_0x4759c3['options']);return _0x1822be[_0xe332('0x4e')](_0x57b531);}})[_0xe332('0x24')](function(_0x4d7bd9){if(_0x4d7bd9){_0x392ac9=_0x4d7bd9[_0xe332('0x37')];if(!_0x4759c3[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x57b531[_0xe332('0x1b')]=qs[_0xe332('0x1b')](_0x4759c3[_0xe332('0x31')][_0xe332('0x1b')]);_0x57b531[_0xe332('0x1e')]=qs[_0xe332('0x1e')](_0x4759c3[_0xe332('0x31')][_0xe332('0x1e')]);}return _0x1822be['getConditions'](_0x57b531);}})[_0xe332('0x24')](function(_0x34565b){if(_0x34565b){return _0x34565b?{'count':_0x392ac9,'rows':_0x34565b}:null;}})[_0xe332('0x24')](respondWithResult(_0x1fbeba,null))[_0xe332('0x43')](handleError(_0x1fbeba,null));};exports['addActions']=function(_0x17b3af,_0x469b73,_0x194cad){return db[_0xe332('0x52')][_0xe332('0x47')]({'where':{'id':_0x17b3af['params']['id']}})['then'](handleEntityNotFound(_0x469b73,null))[_0xe332('0x24')](function(_0x416815){if(_0x416815){return _0x416815[_0xe332('0x53')](_0x17b3af[_0xe332('0x49')]['ids'],_[_0xe332('0x4d')](_0x17b3af[_0xe332('0x49')],[_0xe332('0x4c'),'id'])||{});}})['then'](respondWithResult(_0x469b73,null))[_0xe332('0x43')](handleError(_0x469b73,null));};exports[_0xe332('0x54')]=function(_0x36af1a,_0x39e49c,_0x302810){var _0x3ac3e9={};var _0x5e6d9e={};var _0x25f690;var _0x18c1fa;return db[_0xe332('0x2b')][_0xe332('0x4f')]({'where':{'id':_0x36af1a[_0xe332('0x45')]['id']}})[_0xe332('0x24')](handleEntityNotFound(_0x39e49c,null))[_0xe332('0x24')](function(_0x5aea68){if(_0x5aea68){_0x25f690=_0x5aea68;_0x5e6d9e['model']=_[_0xe332('0x32')](db[_0xe332('0x52')][_0xe332('0x2c')]);_0x5e6d9e[_0xe332('0x31')]=_[_0xe332('0x32')](_0x36af1a[_0xe332('0x31')]);_0x5e6d9e[_0xe332('0x3c')]=_[_0xe332('0x33')](_0x5e6d9e[_0xe332('0x34')],_0x5e6d9e['query']);_0x3ac3e9[_0xe332('0x35')]=_[_0xe332('0x33')](_0x5e6d9e[_0xe332('0x34')],qs[_0xe332('0x36')](_0x36af1a[_0xe332('0x31')][_0xe332('0x36')]));_0x3ac3e9[_0xe332('0x35')]=_0x3ac3e9[_0xe332('0x35')][_0xe332('0x37')]?_0x3ac3e9['attributes']:_0x5e6d9e[_0xe332('0x34')];_0x3ac3e9[_0xe332('0x3a')]=qs[_0xe332('0x50')](_0x36af1a['query'][_0xe332('0x50')]);_0x3ac3e9[_0xe332('0x3b')]=qs['filters'](_['pick'](_0x36af1a['query'],_0x5e6d9e[_0xe332('0x3c')]));if(_0x36af1a['query']['filter']){_0x3ac3e9[_0xe332('0x3b')]=_['merge'](_0x3ac3e9[_0xe332('0x3b')],{'$or':_[_0xe332('0x30')](_0x3ac3e9[_0xe332('0x35')],function(_0xff298a){var _0x545534={};_0x545534[_0xff298a]={'$like':'%'+_0x36af1a[_0xe332('0x31')][_0xe332('0x3d')]+'%'};return _0x545534;})});}_0x3ac3e9=_[_0xe332('0x3f')]({},_0x3ac3e9,_0x36af1a[_0xe332('0x40')]);return _0x25f690['getActions'](_0x3ac3e9);}})[_0xe332('0x24')](function(_0x9f2f3){if(_0x9f2f3){_0x18c1fa=_0x9f2f3['length'];if(!_0x36af1a[_0xe332('0x31')][_0xe332('0x38')](_0xe332('0x39'))){_0x3ac3e9['limit']=qs[_0xe332('0x1b')](_0x36af1a[_0xe332('0x31')][_0xe332('0x1b')]);_0x3ac3e9[_0xe332('0x1e')]=qs[_0xe332('0x1e')](_0x36af1a[_0xe332('0x31')][_0xe332('0x1e')]);}return _0x25f690['getActions'](_0x3ac3e9);}})[_0xe332('0x24')](function(_0x1665f3){if(_0x1665f3){return _0x1665f3?{'count':_0x18c1fa,'rows':_0x1665f3}:null;}})[_0xe332('0x24')](respondWithResult(_0x39e49c,null))[_0xe332('0x43')](handleError(_0x39e49c,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 07e81dc..bcdfbd5 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 _0x6c31=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./automation.attributes','Automation','tools_automations','util'];(function(_0x4adcbe,_0x3422e1){var _0x2c4230=function(_0x20c650){while(--_0x20c650){_0x4adcbe['push'](_0x4adcbe['shift']());}};_0x2c4230(++_0x3422e1);}(_0x6c31,0x13e));var _0x16c3=function(_0x470d13,_0x3f22fa){_0x470d13=_0x470d13-0x0;var _0x18cc32=_0x6c31[_0x470d13];return _0x18cc32;};'use strict';var _=require('lodash');var util=require(_0x16c3('0x0'));var logger=require(_0x16c3('0x1'))(_0x16c3('0x2'));var moment=require('moment');var BPromise=require(_0x16c3('0x3'));var rp=require(_0x16c3('0x4'));var fs=require('fs');var path=require(_0x16c3('0x5'));var rimraf=require(_0x16c3('0x6'));var config=require(_0x16c3('0x7'));var attributes=require(_0x16c3('0x8'));module['exports']=function(_0xabc2e2,_0x271fb6){return _0xabc2e2['define'](_0x16c3('0x9'),attributes,{'tableName':_0x16c3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd3b=['../../config/logger','api','bluebird','request-promise','../../config/environment','./automation.attributes','Automation','lodash','util'];(function(_0x6b8d31,_0x5bcae3){var _0x2cd1d7=function(_0x393aef){while(--_0x393aef){_0x6b8d31['push'](_0x6b8d31['shift']());}};_0x2cd1d7(++_0x5bcae3);}(_0xcd3b,0xc4));var _0xbcd3=function(_0x434cca,_0x53d7fc){_0x434cca=_0x434cca-0x0;var _0x17de4c=_0xcd3b[_0x434cca];return _0x17de4c;};'use strict';var _=require(_0xbcd3('0x0'));var util=require(_0xbcd3('0x1'));var logger=require(_0xbcd3('0x2'))(_0xbcd3('0x3'));var moment=require('moment');var BPromise=require(_0xbcd3('0x4'));var rp=require(_0xbcd3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbcd3('0x6'));var attributes=require(_0xbcd3('0x7'));module['exports']=function(_0x56722d,_0x5372fd){return _0x56722d['define'](_0xbcd3('0x8'),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 c45f3ad..5412ead 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 _0xdfdd=['request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','Automation,\x20%s,\x20%s'];(function(_0x14a4d0,_0x4c7068){var _0x18c8ab=function(_0x10bd3b){while(--_0x10bd3b){_0x14a4d0['push'](_0x14a4d0['shift']());}};_0x18c8ab(++_0x4c7068);}(_0xdfdd,0x104));var _0xddfd=function(_0x1972cf,_0x33ce05){_0x1972cf=_0x1972cf-0x0;var _0x570700=_0xdfdd[_0x1972cf];return _0x570700;};'use strict';var _=require(_0xddfd('0x0'));var util=require(_0xddfd('0x1'));var moment=require(_0xddfd('0x2'));var BPromise=require(_0xddfd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xddfd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xddfd('0x5'));var logger=require('../../config/logger')(_0xddfd('0x6'));var config=require(_0xddfd('0x7'));var jayson=require(_0xddfd('0x8'));var client=jayson[_0xddfd('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x25fcbc,_0x485ede,_0x2e8f21){return new BPromise(function(_0x45bdd0,_0xf134d7){return client[_0xddfd('0xa')](_0x25fcbc,_0x2e8f21)[_0xddfd('0xb')](function(_0x2a3b1e){logger['info'](_0xddfd('0xc'),_0x485ede,_0xddfd('0xd'));logger['debug'](_0xddfd('0xe'),_0x485ede,_0xddfd('0xd'),JSON[_0xddfd('0xf')](_0x2a3b1e));if(_0x2a3b1e[_0xddfd('0x10')]){if(_0x2a3b1e[_0xddfd('0x10')]['code']===0x1f4){logger[_0xddfd('0x10')]('Automation,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')]['message']);return _0xf134d7(_0x2a3b1e[_0xddfd('0x10')]['message']);}logger[_0xddfd('0x10')]('Automation,\x20%s,\x20%s',_0x485ede,_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);return _0x45bdd0(_0x2a3b1e[_0xddfd('0x10')][_0xddfd('0x11')]);}else{logger[_0xddfd('0x12')]('Automation,\x20%s,\x20%s',_0x485ede,_0xddfd('0xd'));_0x45bdd0(_0x2a3b1e[_0xddfd('0x13')][_0xddfd('0x11')]);}})[_0xddfd('0x14')](function(_0xa85d01){logger[_0xddfd('0x10')](_0xddfd('0xc'),_0x485ede,_0xa85d01);_0xf134d7(_0xa85d01);});});} \ No newline at end of file +var _0xbc36=['info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0x221fe1,_0x28aef0){var _0x2c8967=function(_0x5f039f){while(--_0x5f039f){_0x221fe1['push'](_0x221fe1['shift']());}};_0x2c8967(++_0x28aef0);}(_0xbc36,0x169));var _0x6bc3=function(_0x656ab4,_0x2edd3f){_0x656ab4=_0x656ab4-0x0;var _0x37758b=_0xbc36[_0x656ab4];return _0x37758b;};'use strict';var _=require(_0x6bc3('0x0'));var util=require('util');var moment=require(_0x6bc3('0x1'));var BPromise=require(_0x6bc3('0x2'));var rs=require(_0x6bc3('0x3'));var fs=require('fs');var Redis=require(_0x6bc3('0x4'));var db=require(_0x6bc3('0x5'))['db'];var utils=require(_0x6bc3('0x6'));var logger=require(_0x6bc3('0x7'))(_0x6bc3('0x8'));var config=require(_0x6bc3('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6bc3('0xa')][_0x6bc3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5584a5,_0x33e11c,_0x1f894a){return new BPromise(function(_0xf07594,_0x4de32d){return client[_0x6bc3('0xc')](_0x5584a5,_0x1f894a)[_0x6bc3('0xd')](function(_0x33e8e0){logger[_0x6bc3('0xe')]('Automation,\x20%s,\x20%s',_0x33e11c,_0x6bc3('0xf'));logger[_0x6bc3('0x10')](_0x6bc3('0x11'),_0x33e11c,_0x6bc3('0xf'),JSON[_0x6bc3('0x12')](_0x33e8e0));if(_0x33e8e0[_0x6bc3('0x13')]){if(_0x33e8e0[_0x6bc3('0x13')][_0x6bc3('0x14')]===0x1f4){logger[_0x6bc3('0x13')]('Automation,\x20%s,\x20%s',_0x33e11c,_0x33e8e0[_0x6bc3('0x13')]['message']);return _0x4de32d(_0x33e8e0[_0x6bc3('0x13')]['message']);}logger[_0x6bc3('0x13')](_0x6bc3('0x15'),_0x33e11c,_0x33e8e0['error'][_0x6bc3('0x16')]);return _0xf07594(_0x33e8e0['error']['message']);}else{logger[_0x6bc3('0xe')](_0x6bc3('0x15'),_0x33e11c,_0x6bc3('0xf'));_0xf07594(_0x33e8e0[_0x6bc3('0x17')][_0x6bc3('0x16')]);}})[_0x6bc3('0x18')](function(_0xa1782){logger['error'](_0x6bc3('0x15'),_0x33e11c,_0xa1782);_0x4de32d(_0xa1782);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 3c34b89..b1d386e 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','./automation.controller','isAuthenticated','index','get','/:id','/:id/conditions','getConditions','getActions','create','addConditions','/:id/actions','put','update','delete','destroy','path','connect-timeout'];(function(_0x29ce6c,_0x4642d5){var _0x27a08c=function(_0x2943a4){while(--_0x2943a4){_0x29ce6c['push'](_0x29ce6c['shift']());}};_0x27a08c(++_0x4642d5);}(_0x9c44,0x178));var _0x49c4=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x9c44[_0x2dea24];return _0x309d58;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x49c4('0x6'));router['get']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0x8')]);router[_0x49c4('0x9')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller['show']);router[_0x49c4('0x9')](_0x49c4('0xb'),auth[_0x49c4('0x7')](),controller[_0x49c4('0xc')]);router['get']('/:id/actions',auth[_0x49c4('0x7')](),controller[_0x49c4('0xd')]);router['post']('/',auth[_0x49c4('0x7')](),controller[_0x49c4('0xe')]);router['post']('/:id/conditions',auth[_0x49c4('0x7')](),controller[_0x49c4('0xf')]);router['post'](_0x49c4('0x10'),auth[_0x49c4('0x7')](),controller['addActions']);router[_0x49c4('0x11')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x12')]);router[_0x49c4('0x13')](_0x49c4('0xa'),auth[_0x49c4('0x7')](),controller[_0x49c4('0x14')]);module['exports']=router; \ No newline at end of file +var _0xc3fe=['delete','destroy','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./automation.controller','index','get','show','/:id/conditions','isAuthenticated','getConditions','getActions','post','create','addConditions','addActions','update'];(function(_0x4b5d06,_0x31c5e1){var _0x4be5ff=function(_0x8954c1){while(--_0x8954c1){_0x4b5d06['push'](_0x4b5d06['shift']());}};_0x4be5ff(++_0x31c5e1);}(_0xc3fe,0xff));var _0xec3f=function(_0x2dc942,_0x583b72){_0x2dc942=_0x2dc942-0x0;var _0x5e89f5=_0xc3fe[_0x2dc942];return _0x5e89f5;};'use strict';var multer=require(_0xec3f('0x0'));var util=require(_0xec3f('0x1'));var path=require(_0xec3f('0x2'));var timeout=require('connect-timeout');var express=require(_0xec3f('0x3'));var router=express[_0xec3f('0x4')]();var fs_extra=require(_0xec3f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xec3f('0x6'));var config=require(_0xec3f('0x7'));var controller=require(_0xec3f('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xec3f('0x9')]);router[_0xec3f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xec3f('0xb')]);router['get'](_0xec3f('0xc'),auth[_0xec3f('0xd')](),controller[_0xec3f('0xe')]);router[_0xec3f('0xa')]('/:id/actions',auth[_0xec3f('0xd')](),controller[_0xec3f('0xf')]);router[_0xec3f('0x10')]('/',auth[_0xec3f('0xd')](),controller[_0xec3f('0x11')]);router[_0xec3f('0x10')]('/:id/conditions',auth[_0xec3f('0xd')](),controller[_0xec3f('0x12')]);router[_0xec3f('0x10')]('/:id/actions',auth['isAuthenticated'](),controller[_0xec3f('0x13')]);router['put']('/:id',auth[_0xec3f('0xd')](),controller[_0xec3f('0x14')]);router[_0xec3f('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xec3f('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 00077d9..47835ca 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 _0xc9a0=['#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#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)','sequelize','exports','name','ENUM','ivr','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length'];(function(_0x340b16,_0x583b62){var _0x5cfc82=function(_0x3de90a){while(--_0x3de90a){_0x340b16['push'](_0x340b16['shift']());}};_0x5cfc82(++_0x583b62);}(_0xc9a0,0x12c));var _0x0c9a=function(_0x59f73b,_0x5d16f8){_0x59f73b=_0x59f73b-0x0;var _0xba25ca=_0xc9a0[_0x59f73b];return _0xba25ca;};'use strict';var Sequelize=require(_0x0c9a('0x0'));module[_0x0c9a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0c9a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0c9a('0x3')](_0x0c9a('0x4')),'allowNull':![],'defaultValue':_0x0c9a('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0c9a('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0c9a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0c9a('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0c9a('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x0c9a('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0c9a('0xe')},'dialTimezone':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':_0x0c9a('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0c9a('0x10'),'never',_0x0c9a('0x11')),'defaultValue':_0x0c9a('0x10')},'dialAMDActive':{'type':Sequelize[_0x0c9a('0x5')],'defaultValue':0x0,'comment':_0x0c9a('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0c9a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0c9a('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0c9a('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c9a('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0c9a('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0c9a('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0c9a('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0c9a('0x19')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0c9a('0x1a')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0c9a('0xa')](0x9)[_0x0c9a('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0c9a('0x1b')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x0c9a('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c9a('0x1c')},'dialCutDigit':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0c9a('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0c9a('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x22')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0c9a('0xa')](0x3)[_0x0c9a('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0c9a('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0c9a('0xa')](0x5)[_0x0c9a('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x4b6f=['BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','ENUM','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr'];(function(_0x2638c7,_0x233cb5){var _0xd9d91d=function(_0x1a82cb){while(--_0x1a82cb){_0x2638c7['push'](_0x2638c7['shift']());}};_0xd9d91d(++_0x233cb5);}(_0x4b6f,0xea));var _0xf4b6=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x4b6f[_0x1035c1];return _0x308d67;};'use strict';var Sequelize=require(_0xf4b6('0x0'));module['exports']={'name':{'type':Sequelize[_0xf4b6('0x1')],'unique':_0xf4b6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xf4b6('0x3')),'allowNull':![],'defaultValue':_0xf4b6('0x3')},'description':{'type':Sequelize[_0xf4b6('0x1')]},'active':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':_0xf4b6('0x5')},'limitCalls':{'type':Sequelize[_0xf4b6('0x6')](0x4)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xf4b6('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xf4b6('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xa')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'comment':_0xf4b6('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf4b6('0xe')},'dialTimezone':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':_0xf4b6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x11'),_0xf4b6('0x12'),_0xf4b6('0x13')),'defaultValue':_0xf4b6('0x11')},'dialAMDActive':{'type':Sequelize[_0xf4b6('0x4')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xf4b6('0x14')},'dialAMDGreeting':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0xf4b6('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf4b6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf4b6('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xf4b6('0x6')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf4b6('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf4b6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xf4b6('0x6')](0x9)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xf4b6('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xf4b6('0x10')](_0xf4b6('0x1a'),_0xf4b6('0x1b')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xf4b6('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf4b6('0x1c')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x1d')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1e')},'dialDropMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)[_0xf4b6('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf4b6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xf4b6('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf4b6('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xf4b6('0x6')](0x5)[_0xf4b6('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index d612c8e..06875ec 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 _0xbe2f=['../../config/license/util','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','then','get','destroy','name','map','Campaign','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','includeAll','findAll','rows','catch','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','body','createdAt','updatedAt','role','IvrCampaigns','UserProfileSection','update','getHoppers','findOne','filter','CmHopper','CmHopperHistory','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','removeBlackLists','rimraf','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x5a27e8,_0x492a2f){var _0x4e38f7=function(_0x2a4048){while(--_0x2a4048){_0x5a27e8['push'](_0x5a27e8['shift']());}};_0x4e38f7(++_0x492a2f);}(_0xbe2f,0xec));var _0xfbe2=function(_0x6c8455,_0x566ea1){_0x6c8455=_0x6c8455-0x0;var _0x2c92f2=_0xbe2f[_0x6c8455];return _0x2c92f2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfbe2('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfbe2('0x1'));var BPromise=require(_0xfbe2('0x2'));var Mustache=require(_0xfbe2('0x3'));var util=require('util');var path=require(_0xfbe2('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfbe2('0x5'));var fs=require('fs');var fs_extra=require(_0xfbe2('0x6'));var _=require(_0xfbe2('0x7'));var squel=require(_0xfbe2('0x8'));var crypto=require(_0xfbe2('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xfbe2('0xa'));var toCsv=require('to-csv');var querystring=require(_0xfbe2('0xb'));var Papa=require(_0xfbe2('0xc'));var Redis=require(_0xfbe2('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfbe2('0xe'));var logger=require('../../config/logger')(_0xfbe2('0xf'));var utils=require(_0xfbe2('0x10'));var config=require(_0xfbe2('0x11'));var licenseUtil=require(_0xfbe2('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x519b0a,_0x321ce4){_0x321ce4=_0x321ce4||0xcc;return function(_0x5548b9){if(_0x5548b9){return _0x519b0a[_0xfbe2('0x13')](_0x321ce4);}return _0x519b0a['status'](_0x321ce4)[_0xfbe2('0x14')]();};}function respondWithResult(_0x4136fe,_0x4dc52b){_0x4dc52b=_0x4dc52b||0xc8;return function(_0x169246){if(_0x169246){return _0x4136fe[_0xfbe2('0x15')](_0x4dc52b)['json'](_0x169246);}};}function respondWithFilteredResult(_0x1f8c5e,_0x397d4d){return function(_0x4d8d57){if(_0x4d8d57){var _0xce708e=typeof _0x397d4d['offset']==='undefined'&&typeof _0x397d4d[_0xfbe2('0x16')]===_0xfbe2('0x17');var _0x34a06d=_0x4d8d57[_0xfbe2('0x18')];var _0x360a9f=_0xce708e?0x0:_0x397d4d[_0xfbe2('0x19')];var _0x3839ba=_0xce708e?_0x4d8d57[_0xfbe2('0x18')]:_0x397d4d[_0xfbe2('0x19')]+_0x397d4d[_0xfbe2('0x16')];var _0x5b3379;if(_0x3839ba>=_0x34a06d){_0x3839ba=_0x34a06d;_0x5b3379=0xc8;}else{_0x5b3379=0xce;}_0x1f8c5e[_0xfbe2('0x15')](_0x5b3379);return _0x1f8c5e[_0xfbe2('0x1a')](_0xfbe2('0x1b'),_0x360a9f+'-'+_0x3839ba+'/'+_0x34a06d)[_0xfbe2('0x1c')](_0x4d8d57);}return null;};}function patchUpdates(_0x594e0d){return function(_0x2e6506){try{jsonpatch[_0xfbe2('0x1d')](_0x2e6506,_0x594e0d,!![]);}catch(_0x49d32c){return BPromise['reject'](_0x49d32c);}return _0x2e6506[_0xfbe2('0x1e')]();};}function saveUpdates(_0x9857b3,_0x1420d5){return function(_0x5ed2a1){if(_0x5ed2a1){return _0x5ed2a1['update'](_0x9857b3)[_0xfbe2('0x1f')](function(_0x507604){return _0x507604;});}return null;};}function removeEntity(_0x3d953b,_0x5a4b67){return function(_0x3acd82){if(_0x3acd82){return _0x3acd82['destroy']()[_0xfbe2('0x1f')](function(){var _0x1352ed=_0x3acd82[_0xfbe2('0x20')]({'plain':!![]});var _0x55c9ff='IvrCampaigns';return db['UserProfileResource'][_0xfbe2('0x21')]({'where':{'type':_0x55c9ff,'resourceId':_0x1352ed['id']}})[_0xfbe2('0x1f')](function(){return _0x3acd82;});})['then'](function(){_0x3d953b[_0xfbe2('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b2563,_0xbface4){return function(_0x3aae23){if(!_0x3aae23){_0x3b2563[_0xfbe2('0x13')](0x194);}return _0x3aae23;};}function handleError(_0x3c2cae,_0x1a09d1){_0x1a09d1=_0x1a09d1||0x1f4;return function(_0x390d0f){logger['error'](_0x390d0f['stack']);if(_0x390d0f[_0xfbe2('0x22')]){delete _0x390d0f[_0xfbe2('0x22')];}_0x3c2cae[_0xfbe2('0x15')](_0x1a09d1)['send'](_0x390d0f);};}exports['index']=function(_0x1d2a70,_0x43e15b){var _0x2e62f0={},_0x32e83a={},_0x34ef5d={'count':0x0,'rows':[]};var _0x29eb39=_[_0xfbe2('0x23')](db[_0xfbe2('0x24')][_0xfbe2('0x25')],function(_0x4995cd){return{'name':_0x4995cd[_0xfbe2('0x26')],'type':_0x4995cd[_0xfbe2('0x27')][_0xfbe2('0x28')]};});_0x32e83a[_0xfbe2('0x29')]=_[_0xfbe2('0x23')](_0x29eb39,'name');_0x32e83a['query']=_[_0xfbe2('0x2a')](_0x1d2a70[_0xfbe2('0x2b')]);_0x32e83a['filters']=_['intersection'](_0x32e83a[_0xfbe2('0x29')],_0x32e83a[_0xfbe2('0x2b')]);_0x2e62f0[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x32e83a['model'],qs[_0xfbe2('0x2e')](_0x1d2a70['query'][_0xfbe2('0x2e')]));_0x2e62f0['attributes']=_0x2e62f0[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x2e62f0[_0xfbe2('0x2c')]:_0x32e83a[_0xfbe2('0x29')];if(!_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x2e62f0['limit']=qs[_0xfbe2('0x16')](_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x2e62f0['offset']=qs[_0xfbe2('0x19')](_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x2e62f0[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x1d2a70['query'][_0xfbe2('0x33')]);_0x2e62f0['where']=qs['filters'](_[_0xfbe2('0x34')](_0x1d2a70['query'],_0x32e83a[_0xfbe2('0x35')]),_0x29eb39);if(_0x1d2a70[_0xfbe2('0x2b')]['filter']){_0x2e62f0[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x2e62f0['where'],{'$or':_[_0xfbe2('0x23')](_0x29eb39,function(_0xc81fc7){if(_0xc81fc7['type']!=='VIRTUAL'){var _0x1773af={};_0x1773af[_0xc81fc7['name']]={'$like':'%'+_0x1d2a70[_0xfbe2('0x2b')]['filter']+'%'};return _0x1773af;}})});}_0x2e62f0=_[_0xfbe2('0x37')]({},_0x2e62f0,_0x1d2a70['options']);var _0x11617e={'where':_0x2e62f0['where']};return db[_0xfbe2('0x24')]['count'](_0x11617e)[_0xfbe2('0x1f')](function(_0x493980){_0x34ef5d[_0xfbe2('0x18')]=_0x493980;if(_0x1d2a70[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x2e62f0['include']=[{'all':!![]}];}return db['Campaign'][_0xfbe2('0x39')](_0x2e62f0);})[_0xfbe2('0x1f')](function(_0x9ca8df){_0x34ef5d[_0xfbe2('0x3a')]=_0x9ca8df;return _0x34ef5d;})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x43e15b,_0x2e62f0))[_0xfbe2('0x3b')](handleError(_0x43e15b,null));};exports[_0xfbe2('0x3c')]=function(_0x45b0ca,_0x388496){var _0x3253a7={'raw':![],'where':{'id':_0x45b0ca['params']['id']}},_0x1dc77e={};_0x1dc77e[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x24')][_0xfbe2('0x25')]);_0x1dc77e[_0xfbe2('0x2b')]=_['keys'](_0x45b0ca[_0xfbe2('0x2b')]);_0x1dc77e[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x1dc77e['model'],_0x1dc77e[_0xfbe2('0x2b')]);_0x3253a7[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x1dc77e[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x45b0ca[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x3253a7[_0xfbe2('0x2c')]=_0x3253a7[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x3253a7[_0xfbe2('0x2c')]:_0x1dc77e['model'];if(_0x45b0ca[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x3253a7[_0xfbe2('0x3d')]=[{'all':!![]}];}_0x3253a7=_[_0xfbe2('0x37')]({},_0x3253a7,_0x45b0ca['options']);return db[_0xfbe2('0x24')][_0xfbe2('0x3e')](_0x3253a7)[_0xfbe2('0x1f')](handleEntityNotFound(_0x388496,null))[_0xfbe2('0x1f')](respondWithResult(_0x388496,null))[_0xfbe2('0x3b')](handleError(_0x388496,null));};exports[_0xfbe2('0x3f')]=function(_0x1b9e8a,_0x3711a3){return db['Campaign'][_0xfbe2('0x3f')](_0x1b9e8a['body'],{})[_0xfbe2('0x1f')](function(_0x258bef){var _0x5032b9=_0x1b9e8a[_0xfbe2('0x40')][_0xfbe2('0x20')]({'plain':!![]});if(!_0x5032b9)throw new Error(_0xfbe2('0x41'));if(_0x5032b9['role']===_0xfbe2('0x40')){var _0x3c0ec7=_0x258bef[_0xfbe2('0x20')]({'plain':!![]});var _0x5f175e='IvrCampaigns';return db['UserProfileSection'][_0xfbe2('0x3e')]({'where':{'name':_0x5f175e,'userProfileId':_0x5032b9[_0xfbe2('0x42')]},'raw':!![]})[_0xfbe2('0x1f')](function(_0x5ef520){if(_0x5ef520&&_0x5ef520['autoAssociation']===0x0){return db[_0xfbe2('0x43')]['create']({'name':_0x3c0ec7['name'],'resourceId':_0x3c0ec7['id'],'type':_0x5ef520['name'],'sectionId':_0x5ef520['id']},{})[_0xfbe2('0x1f')](function(){return _0x258bef;});}else{return _0x258bef;}})['catch'](function(_0x5aab4f){logger['error'](_0xfbe2('0x44'),_0x5aab4f);throw _0x5aab4f;});}return _0x258bef;})['then'](respondWithResult(_0x3711a3,0xc9))[_0xfbe2('0x3b')](handleError(_0x3711a3,null));};exports[_0xfbe2('0x45')]=function(_0x52d5bf,_0x49fbd8){var _0x307cca={'where':{'id':_0x52d5bf[_0xfbe2('0x46')]['id']}},_0x2c942d={};_0x2c942d[_0xfbe2('0x29')]=_['keys'](db[_0xfbe2('0x24')][_0xfbe2('0x25')]);_0x307cca[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x2c942d[_0xfbe2('0x29')],qs['fields'](_0x52d5bf['query']['fields']));_0x307cca[_0xfbe2('0x2c')]=_0x307cca[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x307cca[_0xfbe2('0x2c')]:_0x2c942d['model'];if(_0x52d5bf[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x307cca[_0xfbe2('0x3d')]=[{'all':!![]}];}_0x307cca=_[_0xfbe2('0x37')]({},_0x307cca,_0x52d5bf[_0xfbe2('0x47')]);return db[_0xfbe2('0x24')]['find'](_0x307cca)[_0xfbe2('0x1f')](handleEntityNotFound(_0x49fbd8,null))[_0xfbe2('0x1f')](function(_0x534a55){if(_0x534a55){var _0x2bcfc2=_0x534a55['get']({'plain':!![]});_0x2bcfc2=qs[_0xfbe2('0x48')](_0x2bcfc2,['id','createdAt','updatedAt']);_0x52d5bf[_0xfbe2('0x49')]=_[_0xfbe2('0x48')](_0x52d5bf[_0xfbe2('0x49')],['id',_0xfbe2('0x4a'),_0xfbe2('0x4b')]);return db[_0xfbe2('0x24')][_0xfbe2('0x3f')](_['merge'](_0x2bcfc2,_0x52d5bf['body']),{'include':_0x52d5bf['query'][_0xfbe2('0x38')]?[{'all':!![]}]:undefined})[_0xfbe2('0x1f')](function(_0xc2724d){var _0x19f414=_0x52d5bf[_0xfbe2('0x40')][_0xfbe2('0x20')]({'plain':!![]});if(!_0x19f414)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x19f414[_0xfbe2('0x4c')]===_0xfbe2('0x40')){var _0x51b51b=_0xc2724d['get']({'plain':!![]});var _0x2f0562=_0xfbe2('0x4d');return db[_0xfbe2('0x4e')][_0xfbe2('0x3e')]({'where':{'name':_0x2f0562,'userProfileId':_0x19f414[_0xfbe2('0x42')]},'raw':!![]})[_0xfbe2('0x1f')](function(_0x228ca5){if(_0x228ca5&&_0x228ca5['autoAssociation']===0x0){return db[_0xfbe2('0x43')][_0xfbe2('0x3f')]({'name':_0x51b51b[_0xfbe2('0x22')],'resourceId':_0x51b51b['id'],'type':_0x228ca5[_0xfbe2('0x22')],'sectionId':_0x228ca5['id']},{})[_0xfbe2('0x1f')](function(){return _0xc2724d;});}else{return _0xc2724d;}})['catch'](function(_0x19ee54){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x19ee54);throw _0x19ee54;});}return _0xc2724d;});}})['then'](respondWithResult(_0x49fbd8,0xc9))[_0xfbe2('0x3b')](handleError(_0x49fbd8,null));};exports[_0xfbe2('0x4f')]=function(_0x4aa9b8,_0x58da3c){if(_0x4aa9b8['body']['id']){delete _0x4aa9b8[_0xfbe2('0x49')]['id'];}return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x4aa9b8[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x58da3c,null))[_0xfbe2('0x1f')](saveUpdates(_0x4aa9b8[_0xfbe2('0x49')],null))[_0xfbe2('0x1f')](respondWithResult(_0x58da3c,null))[_0xfbe2('0x3b')](handleError(_0x58da3c,null));};exports[_0xfbe2('0x21')]=function(_0x2a484f,_0xb7af88){return db['Campaign']['find']({'where':{'id':_0x2a484f['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0xb7af88,null))[_0xfbe2('0x1f')](removeEntity(_0xb7af88,null))[_0xfbe2('0x3b')](handleError(_0xb7af88,null));};exports[_0xfbe2('0x50')]=function(_0x3d6609,_0x29e7b2,_0x3a934f){var _0x15f666={'raw':!![],'where':{}};var _0x513810={};var _0x15938c={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x3d6609['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x29e7b2,null))['then'](function(_0x148370){if(_0x148370){_0x513810[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db['CmHopper'][_0xfbe2('0x25')]);_0x513810[_0xfbe2('0x2b')]=_['keys'](_0x3d6609[_0xfbe2('0x2b')]);_0x513810[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x513810[_0xfbe2('0x29')],_0x513810['query']);_0x15f666[_0xfbe2('0x2c')]=_['intersection'](_0x513810[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x15f666[_0xfbe2('0x2c')]=_0x15f666[_0xfbe2('0x2c')]['length']?_0x15f666[_0xfbe2('0x2c')]:_0x513810[_0xfbe2('0x29')];if(!_0x3d6609['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0x15f666[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x15f666[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x15f666['order']=qs[_0xfbe2('0x33')](_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x15f666[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x3d6609['query'],_0x513810[_0xfbe2('0x35')]));_0x15f666[_0xfbe2('0x36')]['CampaignId']=_0x148370['id'];if(_0x3d6609[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0x15f666[_0xfbe2('0x36')]=_['merge'](_0x15f666[_0xfbe2('0x36')],{'$or':_[_0xfbe2('0x23')](_0x15f666[_0xfbe2('0x2c')],function(_0x346106){var _0x20c3df={};_0x20c3df[_0x346106]={'$like':'%'+_0x3d6609['query'][_0xfbe2('0x52')]+'%'};return _0x20c3df;})});}_0x15f666=_[_0xfbe2('0x37')]({},_0x15f666,_0x3d6609[_0xfbe2('0x47')]);return db[_0xfbe2('0x53')][_0xfbe2('0x18')]({'where':_0x15f666['where']})[_0xfbe2('0x1f')](function(_0x3b66e8){_0x15938c[_0xfbe2('0x18')]=_0x3b66e8;if(_0x3d6609[_0xfbe2('0x2b')]['includeAll']){_0x15f666['include']=[{'all':!![]}];}return db[_0xfbe2('0x53')][_0xfbe2('0x39')](_0x15f666);})['then'](function(_0x5b62c3){_0x15938c[_0xfbe2('0x3a')]=_0x5b62c3;return _0x15938c;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x29e7b2,_0x15f666))['catch'](handleError(_0x29e7b2,null));};exports['getHopperHistories']=function(_0x5d1fa5,_0x347a54,_0x2d0342){var _0x5e51c0={'raw':!![],'where':{}};var _0x49c03b={};var _0x194c88={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')]['findOne']({'where':{'id':_0x5d1fa5['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x347a54,null))[_0xfbe2('0x1f')](function(_0x43d1b2){if(_0x43d1b2){_0x49c03b['model']=_[_0xfbe2('0x2a')](db[_0xfbe2('0x54')][_0xfbe2('0x25')]);_0x49c03b[_0xfbe2('0x2b')]=_['keys'](_0x5d1fa5['query']);_0x49c03b[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x49c03b['model'],_0x49c03b[_0xfbe2('0x2b')]);_0x5e51c0[_0xfbe2('0x2c')]=_['intersection'](_0x49c03b[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x5e51c0['attributes']=_0x5e51c0['attributes'][_0xfbe2('0x2f')]?_0x5e51c0[_0xfbe2('0x2c')]:_0x49c03b[_0xfbe2('0x29')];if(!_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x5e51c0[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x5e51c0[_0xfbe2('0x19')]=qs['offset'](_0x5d1fa5[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x5e51c0[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x5d1fa5['query']['sort']);_0x5e51c0['where']=qs['filters'](_[_0xfbe2('0x34')](_0x5d1fa5['query'],_0x49c03b['filters']));_0x5e51c0[_0xfbe2('0x36')]['CampaignId']=_0x43d1b2['id'];if(_0x5d1fa5['query'][_0xfbe2('0x52')]){_0x5e51c0[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x5e51c0[_0xfbe2('0x36')],{'$or':_[_0xfbe2('0x23')](_0x5e51c0['attributes'],function(_0x5ec32a){var _0x2941f9={};_0x2941f9[_0x5ec32a]={'$like':'%'+_0x5d1fa5[_0xfbe2('0x2b')]['filter']+'%'};return _0x2941f9;})});}_0x5e51c0=_[_0xfbe2('0x37')]({},_0x5e51c0,_0x5d1fa5[_0xfbe2('0x47')]);return db['CmHopperHistory'][_0xfbe2('0x18')]({'where':_0x5e51c0[_0xfbe2('0x36')]})['then'](function(_0x1ff861){_0x194c88['count']=_0x1ff861;if(_0x5d1fa5['query'][_0xfbe2('0x38')]){_0x5e51c0[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x54')]['findAll'](_0x5e51c0);})['then'](function(_0x3d77cd){_0x194c88[_0xfbe2('0x3a')]=_0x3d77cd;return _0x194c88;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x347a54,_0x5e51c0))[_0xfbe2('0x3b')](handleError(_0x347a54,null));};exports['getHopperFinals']=function(_0x160619,_0x30d1fe,_0x275602){var _0x193740={'raw':!![],'where':{}};var _0x340a0b={};var _0x39330a={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x160619[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x30d1fe,null))['then'](function(_0x23c092){if(_0x23c092){_0x340a0b[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db['CmHopperFinal'][_0xfbe2('0x25')]);_0x340a0b[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x160619[_0xfbe2('0x2b')]);_0x340a0b[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x340a0b[_0xfbe2('0x29')],_0x340a0b[_0xfbe2('0x2b')]);_0x193740[_0xfbe2('0x2c')]=_[_0xfbe2('0x2d')](_0x340a0b[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x193740['attributes']=_0x193740[_0xfbe2('0x2c')]['length']?_0x193740[_0xfbe2('0x2c')]:_0x340a0b[_0xfbe2('0x29')];if(!_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x30')](_0xfbe2('0x31'))){_0x193740[_0xfbe2('0x16')]=qs['limit'](_0x160619['query'][_0xfbe2('0x16')]);_0x193740[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x193740[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x193740[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x160619['query'],_0x340a0b[_0xfbe2('0x35')]));_0x193740[_0xfbe2('0x36')][_0xfbe2('0x55')]=_0x23c092['id'];if(_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0x193740['where']=_[_0xfbe2('0x37')](_0x193740[_0xfbe2('0x36')],{'$or':_['map'](_0x193740[_0xfbe2('0x2c')],function(_0x28d5cd){var _0x82700e={};_0x82700e[_0x28d5cd]={'$like':'%'+_0x160619['query'][_0xfbe2('0x52')]+'%'};return _0x82700e;})});}_0x193740=_[_0xfbe2('0x37')]({},_0x193740,_0x160619[_0xfbe2('0x47')]);return db[_0xfbe2('0x56')]['count']({'where':_0x193740[_0xfbe2('0x36')]})[_0xfbe2('0x1f')](function(_0x5055cf){_0x39330a[_0xfbe2('0x18')]=_0x5055cf;if(_0x160619[_0xfbe2('0x2b')][_0xfbe2('0x38')]){_0x193740[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x56')]['findAll'](_0x193740);})[_0xfbe2('0x1f')](function(_0x454e35){_0x39330a[_0xfbe2('0x3a')]=_0x454e35;return _0x39330a;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x30d1fe,_0x193740))['catch'](handleError(_0x30d1fe,null));};exports[_0xfbe2('0x57')]=function(_0x5139f1,_0x43b418,_0xe2abe7){var _0x481ecc={'raw':!![],'where':{}};var _0x410fbd={};var _0x69fa11={'count':0x0,'rows':[]};return db[_0xfbe2('0x24')][_0xfbe2('0x51')]({'where':{'id':_0x5139f1[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x43b418,null))[_0xfbe2('0x1f')](function(_0x2362c2){if(_0x2362c2){_0x410fbd[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x58')][_0xfbe2('0x25')]);_0x410fbd[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x5139f1[_0xfbe2('0x2b')]);_0x410fbd[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x410fbd[_0xfbe2('0x29')],_0x410fbd['query']);_0x481ecc[_0xfbe2('0x2c')]=_['intersection'](_0x410fbd['model'],qs['fields'](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0x481ecc['attributes']=_0x481ecc[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0x481ecc[_0xfbe2('0x2c')]:_0x410fbd[_0xfbe2('0x29')];if(!_0x5139f1['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0x481ecc[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x16')]);_0x481ecc[_0xfbe2('0x19')]=qs[_0xfbe2('0x19')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x19')]);}_0x481ecc[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x5139f1[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0x481ecc[_0xfbe2('0x36')]=qs[_0xfbe2('0x35')](_[_0xfbe2('0x34')](_0x5139f1['query'],_0x410fbd['filters']));_0x481ecc[_0xfbe2('0x36')]['CampaignId']=_0x2362c2['id'];if(_0x5139f1[_0xfbe2('0x2b')]['filter']){_0x481ecc[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0x481ecc['where'],{'$or':_[_0xfbe2('0x23')](_0x481ecc[_0xfbe2('0x2c')],function(_0x51d176){var _0x21cd6a={};_0x21cd6a[_0x51d176]={'$like':'%'+_0x5139f1[_0xfbe2('0x2b')]['filter']+'%'};return _0x21cd6a;})});}_0x481ecc=_[_0xfbe2('0x37')]({},_0x481ecc,_0x5139f1['options']);return db['CmHopperBlack'][_0xfbe2('0x18')]({'where':_0x481ecc[_0xfbe2('0x36')]})['then'](function(_0x2be46f){_0x69fa11[_0xfbe2('0x18')]=_0x2be46f;if(_0x5139f1[_0xfbe2('0x2b')]['includeAll']){_0x481ecc[_0xfbe2('0x3d')]=[{'all':!![]}];}return db[_0xfbe2('0x58')][_0xfbe2('0x39')](_0x481ecc);})[_0xfbe2('0x1f')](function(_0xa7b23b){_0x69fa11['rows']=_0xa7b23b;return _0x69fa11;});}})[_0xfbe2('0x1f')](respondWithFilteredResult(_0x43b418,_0x481ecc))[_0xfbe2('0x3b')](handleError(_0x43b418,null));};exports[_0xfbe2('0x59')]=function(_0x572861,_0x2901e5,_0x2e0d5a){var _0xd6b80c={};var _0x4b70e2={};var _0x3e6e7f;var _0x3ed94f;return db[_0xfbe2('0x24')]['findOne']({'where':{'id':_0x572861[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x2901e5,null))[_0xfbe2('0x1f')](function(_0x3d6746){if(_0x3d6746){_0x3e6e7f=_0x3d6746;_0x4b70e2['model']=_[_0xfbe2('0x2a')](db['CmList'][_0xfbe2('0x25')]);_0x4b70e2['query']=_[_0xfbe2('0x2a')](_0x572861[_0xfbe2('0x2b')]);_0x4b70e2['filters']=_['intersection'](_0x4b70e2[_0xfbe2('0x29')],_0x4b70e2[_0xfbe2('0x2b')]);_0xd6b80c['attributes']=_['intersection'](_0x4b70e2[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x572861[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0xd6b80c[_0xfbe2('0x2c')]=_0xd6b80c[_0xfbe2('0x2c')]['length']?_0xd6b80c[_0xfbe2('0x2c')]:_0x4b70e2['model'];_0xd6b80c[_0xfbe2('0x32')]=qs[_0xfbe2('0x33')](_0x572861['query'][_0xfbe2('0x33')]);_0xd6b80c[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x572861[_0xfbe2('0x2b')],_0x4b70e2[_0xfbe2('0x35')]));if(_0x572861[_0xfbe2('0x2b')][_0xfbe2('0x52')]){_0xd6b80c[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0xd6b80c['where'],{'$or':_[_0xfbe2('0x23')](_0xd6b80c[_0xfbe2('0x2c')],function(_0x2c5e35){var _0x16fab3={};_0x16fab3[_0x2c5e35]={'$like':'%'+_0x572861['query'][_0xfbe2('0x52')]+'%'};return _0x16fab3;})});}_0xd6b80c=_['merge']({},_0xd6b80c,_0x572861[_0xfbe2('0x47')]);return _0x3e6e7f[_0xfbe2('0x59')](_0xd6b80c);}})[_0xfbe2('0x1f')](function(_0x50be4c){if(_0x50be4c){_0x3ed94f=_0x50be4c[_0xfbe2('0x2f')];if(!_0x572861['query'][_0xfbe2('0x30')]('nolimit')){_0xd6b80c['limit']=qs[_0xfbe2('0x16')](_0x572861[_0xfbe2('0x2b')]['limit']);_0xd6b80c[_0xfbe2('0x19')]=qs['offset'](_0x572861[_0xfbe2('0x2b')]['offset']);}return _0x3e6e7f[_0xfbe2('0x59')](_0xd6b80c);}})[_0xfbe2('0x1f')](function(_0x5e925f){if(_0x5e925f){return _0x5e925f?{'count':_0x3ed94f,'rows':_0x5e925f}:null;}})[_0xfbe2('0x1f')](respondWithResult(_0x2901e5,null))['catch'](handleError(_0x2901e5,null));};exports[_0xfbe2('0x5a')]=function(_0x45b727,_0x15baf5,_0x17f884){var _0x4e9865,_0x54b673;return db['Campaign'][_0xfbe2('0x3e')]({'where':{'id':_0x45b727[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x15baf5,null))[_0xfbe2('0x1f')](function(_0x26969e){if(_0x26969e){_0x54b673=_0x26969e;return _0x26969e[_0xfbe2('0x5a')](_0x45b727['body'][_0xfbe2('0x5b')],_['omit'](_0x45b727[_0xfbe2('0x49')],[_0xfbe2('0x5b'),'id'])||{});}return null;})[_0xfbe2('0x5c')](function(_0x2f74d2){var _0x20e11f;_0x4e9865=_0x2f74d2||[];var _0x125eeb=[];if(_0x2f74d2){for(var _0x15c0ad=0x0;_0x15c0ad<_0x2f74d2[_0xfbe2('0x2f')];_0x15c0ad+=0x1){var _0x3326a9=_0x2f74d2[_0x15c0ad][_0xfbe2('0x20')]({'plain':!![]});_0x54b673[_0xfbe2('0x5d')]=_0x45b727[_0xfbe2('0x49')][_0xfbe2('0x5d')]?_0x45b727[_0xfbe2('0x49')][_0xfbe2('0x5d')]:_0x54b673[_0xfbe2('0x5d')];switch(_0x54b673['dialCheckDuplicateType']){case _0xfbe2('0x5e'):_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')](_0xfbe2('0x61'))[_0xfbe2('0x62')]([_0xfbe2('0x63'),_0xfbe2('0x64'),_0xfbe2('0x65'),_0xfbe2('0x66'),_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x64'))['field']('id',_0xfbe2('0x65'))['field'](_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')](),'ListId')[_0xfbe2('0x68')](_0x45b727['params']['id'][_0xfbe2('0x6a')](),_0xfbe2('0x55'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x4a'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9['CmListId'][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL')[_0xfbe2('0x36')](_0xfbe2('0x70'),squel['select']()[_0xfbe2('0x68')](_0xfbe2('0x71'))['from'](_0xfbe2('0x72'))[_0xfbe2('0x36')](_0xfbe2('0x73'),_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]()))[_0xfbe2('0x36')](_0xfbe2('0x70'),squel['select']()[_0xfbe2('0x68')]('COALESCE(phone,\x27\x27)')[_0xfbe2('0x6c')](_0xfbe2('0x61'))[_0xfbe2('0x36')]('CampaignId\x20=\x20?',_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]())))[_0xfbe2('0x6a')]();break;case _0xfbe2('0x74'):_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')]('cm_hopper')['fromQuery'](['phone',_0xfbe2('0x64'),_0xfbe2('0x65'),'ListId',_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel[_0xfbe2('0x67')]()['field'](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'scheduledAt')[_0xfbe2('0x68')]('id','ContactId')[_0xfbe2('0x68')](_0x3326a9['CmListId']['toString'](),_0xfbe2('0x66'))['field'](_0x45b727['params']['id']['toString'](),_0xfbe2('0x55'))[_0xfbe2('0x68')]('NOW()',_0xfbe2('0x4a'))[_0xfbe2('0x68')]('NOW()','updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL')['where'](_0xfbe2('0x70'),squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')]('COALESCE(phone,\x27\x27)')[_0xfbe2('0x6c')](_0xfbe2('0x61'))['where'](_0xfbe2('0x73'),_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')]())))[_0xfbe2('0x6a')]();break;default:_0x20e11f=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')]('cm_hopper')[_0xfbe2('0x62')]([_0xfbe2('0x63'),_0xfbe2('0x64'),_0xfbe2('0x65'),_0xfbe2('0x66'),_0xfbe2('0x55'),_0xfbe2('0x4a'),'updatedAt'],squel[_0xfbe2('0x67')]()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),_0xfbe2('0x64'))['field']('id',_0xfbe2('0x65'))[_0xfbe2('0x68')](_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')](),_0xfbe2('0x66'))['field'](_0x45b727[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')](),'CampaignId')['field'](_0xfbe2('0x6b'),_0xfbe2('0x4a'))['field'](_0xfbe2('0x6b'),_0xfbe2('0x4b'))[_0xfbe2('0x6c')]('cm_contacts')[_0xfbe2('0x36')](_0xfbe2('0x6e'))[_0xfbe2('0x36')](_0xfbe2('0x6f'),_0x3326a9[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xfbe2('0x6a')]();}_0x125eeb[_0xfbe2('0x75')](db[_0xfbe2('0x76')][_0xfbe2('0x2b')](_0x20e11f));}return BPromise[_0xfbe2('0x77')](_0x125eeb);}})[_0xfbe2('0x1f')](function(){return _0x4e9865;})[_0xfbe2('0x1f')](respondWithResult(_0x15baf5,null))[_0xfbe2('0x3b')](handleError(_0x15baf5,null));};exports[_0xfbe2('0x78')]=function(_0x3f9c4f,_0x42712b,_0x465450){return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x3f9c4f[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x42712b,null))[_0xfbe2('0x1f')](function(_0x201992){if(_0x201992){return _0x201992[_0xfbe2('0x78')](_0x3f9c4f[_0xfbe2('0x2b')][_0xfbe2('0x5b')]);}})[_0xfbe2('0x1f')](function(_0x593d08){if(_0x593d08){return db[_0xfbe2('0x53')]['destroy']({'where':{'ListId':_0x3f9c4f['query'][_0xfbe2('0x5b')],'CampaignId':_0x3f9c4f[_0xfbe2('0x46')]['id']}})['then'](function(){return _0x593d08;});}})['then'](respondWithStatusCode(_0x42712b,null))[_0xfbe2('0x3b')](handleError(_0x42712b,null));};exports[_0xfbe2('0x79')]=function(_0x55c8ed,_0x44b239,_0x27492e){var _0xcf396d={};var _0x38dd4d={};var _0x955d8e;var _0x1b193f;return db['Campaign'][_0xfbe2('0x51')]({'where':{'id':_0x55c8ed[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x44b239,null))[_0xfbe2('0x1f')](function(_0x3d743f){if(_0x3d743f){_0x955d8e=_0x3d743f;_0x38dd4d[_0xfbe2('0x29')]=_[_0xfbe2('0x2a')](db[_0xfbe2('0x7a')][_0xfbe2('0x25')]);_0x38dd4d[_0xfbe2('0x2b')]=_[_0xfbe2('0x2a')](_0x55c8ed[_0xfbe2('0x2b')]);_0x38dd4d[_0xfbe2('0x35')]=_[_0xfbe2('0x2d')](_0x38dd4d[_0xfbe2('0x29')],_0x38dd4d['query']);_0xcf396d['attributes']=_['intersection'](_0x38dd4d[_0xfbe2('0x29')],qs[_0xfbe2('0x2e')](_0x55c8ed[_0xfbe2('0x2b')][_0xfbe2('0x2e')]));_0xcf396d[_0xfbe2('0x2c')]=_0xcf396d[_0xfbe2('0x2c')][_0xfbe2('0x2f')]?_0xcf396d[_0xfbe2('0x2c')]:_0x38dd4d[_0xfbe2('0x29')];_0xcf396d[_0xfbe2('0x32')]=qs['sort'](_0x55c8ed[_0xfbe2('0x2b')][_0xfbe2('0x33')]);_0xcf396d[_0xfbe2('0x36')]=qs['filters'](_[_0xfbe2('0x34')](_0x55c8ed[_0xfbe2('0x2b')],_0x38dd4d[_0xfbe2('0x35')]));if(_0x55c8ed[_0xfbe2('0x2b')]['filter']){_0xcf396d[_0xfbe2('0x36')]=_[_0xfbe2('0x37')](_0xcf396d[_0xfbe2('0x36')],{'$or':_['map'](_0xcf396d[_0xfbe2('0x2c')],function(_0xe9720f){var _0x1e47c1={};_0x1e47c1[_0xe9720f]={'$like':'%'+_0x55c8ed[_0xfbe2('0x2b')]['filter']+'%'};return _0x1e47c1;})});}_0xcf396d=_['merge']({},_0xcf396d,_0x55c8ed['options']);return _0x955d8e[_0xfbe2('0x79')](_0xcf396d);}})['then'](function(_0x2dd2eb){if(_0x2dd2eb){_0x1b193f=_0x2dd2eb[_0xfbe2('0x2f')];if(!_0x55c8ed['query']['hasOwnProperty'](_0xfbe2('0x31'))){_0xcf396d[_0xfbe2('0x16')]=qs[_0xfbe2('0x16')](_0x55c8ed['query'][_0xfbe2('0x16')]);_0xcf396d['offset']=qs[_0xfbe2('0x19')](_0x55c8ed[_0xfbe2('0x2b')]['offset']);}return _0x955d8e['getBlackLists'](_0xcf396d);}})[_0xfbe2('0x1f')](function(_0x4a7566){if(_0x4a7566){return _0x4a7566?{'count':_0x1b193f,'rows':_0x4a7566}:null;}})[_0xfbe2('0x1f')](respondWithResult(_0x44b239,null))['catch'](handleError(_0x44b239,null));};exports[_0xfbe2('0x7b')]=function(_0x1ab9b8,_0xbcdeec,_0x2cd943){var _0x5e81a2,_0x66073b;return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x1ab9b8['params']['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0xbcdeec,null))[_0xfbe2('0x1f')](function(_0x1eb559){if(_0x1eb559){_0x66073b=_0x1eb559;return _0x1eb559[_0xfbe2('0x7b')](_0x1ab9b8[_0xfbe2('0x49')]['ids'],_[_0xfbe2('0x48')](_0x1ab9b8[_0xfbe2('0x49')],[_0xfbe2('0x5b'),'id'])||{});}return null;})[_0xfbe2('0x5c')](function(_0x2493d4){var _0x1b8064;_0x5e81a2=_0x2493d4||[];var _0x18672d=[];if(_0x2493d4){for(var _0x5d0f58=0x0;_0x5d0f58<_0x2493d4[_0xfbe2('0x2f')];_0x5d0f58+=0x1){var _0x38e3e1=_0x2493d4[_0x5d0f58]['get']({'plain':!![]});_0x1b8064=squel[_0xfbe2('0x5f')]()[_0xfbe2('0x60')](_0xfbe2('0x7c'))[_0xfbe2('0x62')]([_0xfbe2('0x63'),'ContactId','ListId',_0xfbe2('0x55'),_0xfbe2('0x4a'),_0xfbe2('0x4b')],squel['select']()[_0xfbe2('0x68')](_0xfbe2('0x63'),_0xfbe2('0x63'))['field']('id',_0xfbe2('0x65'))[_0xfbe2('0x68')](_0x38e3e1['CmListId'][_0xfbe2('0x6a')](),_0xfbe2('0x66'))[_0xfbe2('0x68')](_0x1ab9b8[_0xfbe2('0x46')]['id'][_0xfbe2('0x6a')](),'CampaignId')[_0xfbe2('0x68')](_0xfbe2('0x6b'),_0xfbe2('0x4a'))[_0xfbe2('0x68')](_0xfbe2('0x6b'),'updatedAt')[_0xfbe2('0x6c')](_0xfbe2('0x6d'))[_0xfbe2('0x36')](_0xfbe2('0x6e'))['where']('ListId\x20=\x20?',_0x38e3e1[_0xfbe2('0x69')][_0xfbe2('0x6a')]())[_0xfbe2('0x36')](_0xfbe2('0x7d')))[_0xfbe2('0x6a')]();_0x18672d['push'](db[_0xfbe2('0x76')]['query'](_0x1b8064));}return BPromise['all'](_0x18672d);}})[_0xfbe2('0x1f')](function(){return _0x5e81a2;})['then'](respondWithResult(_0xbcdeec,null))['catch'](handleError(_0xbcdeec,null));};exports[_0xfbe2('0x7e')]=function(_0x58e3f7,_0x3466da,_0x356d93){return db[_0xfbe2('0x24')][_0xfbe2('0x3e')]({'where':{'id':_0x58e3f7[_0xfbe2('0x46')]['id']}})[_0xfbe2('0x1f')](handleEntityNotFound(_0x3466da,null))[_0xfbe2('0x1f')](function(_0x560764){if(_0x560764){return _0x560764[_0xfbe2('0x7e')](_0x58e3f7['query']['ids']);}})[_0xfbe2('0x1f')](function(_0x7128c7){if(_0x7128c7){return db[_0xfbe2('0x58')]['destroy']({'where':{'ListId':_0x58e3f7['query'][_0xfbe2('0x5b')],'CampaignId':_0x58e3f7['params']['id']}})[_0xfbe2('0x1f')](function(){return _0x7128c7;});}})[_0xfbe2('0x1f')](respondWithStatusCode(_0x3466da,null))[_0xfbe2('0x3b')](handleError(_0x3466da,null));}; \ No newline at end of file +var _0x23b4=['filter','VIRTUAL','include','rows','show','params','length','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','omit','updatedAt','createdAt','role','autoAssociation','getHoppers','CmHopper','findAll','getHopperHistories','findOne','CmHopperHistory','CampaignId','getHopperFinals','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','insert','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','get','IvrCampaigns','error','stack','name','send','index','map','Campaign','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick'];(function(_0x4e52fa,_0x5945ee){var _0x3b2d46=function(_0x216153){while(--_0x216153){_0x4e52fa['push'](_0x4e52fa['shift']());}};_0x3b2d46(++_0x5945ee);}(_0x23b4,0x1da));var _0x423b=function(_0x179b80,_0x440291){_0x179b80=_0x179b80-0x0;var _0x1e8d03=_0x23b4[_0x179b80];return _0x1e8d03;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x423b('0x0'));var jsonpatch=require(_0x423b('0x1'));var rp=require(_0x423b('0x2'));var moment=require(_0x423b('0x3'));var BPromise=require(_0x423b('0x4'));var Mustache=require(_0x423b('0x5'));var util=require(_0x423b('0x6'));var path=require(_0x423b('0x7'));var sox=require('sox');var csv=require(_0x423b('0x8'));var ejs=require(_0x423b('0x9'));var fs=require('fs');var fs_extra=require(_0x423b('0xa'));var _=require(_0x423b('0xb'));var squel=require(_0x423b('0xc'));var crypto=require(_0x423b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x423b('0xe'));var toCsv=require(_0x423b('0x8'));var querystring=require(_0x423b('0xf'));var Papa=require(_0x423b('0x10'));var Redis=require(_0x423b('0x11'));var authService=require(_0x423b('0x12'));var qs=require(_0x423b('0x13'));var as=require(_0x423b('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x423b('0x15'))(_0x423b('0x16'));var utils=require(_0x423b('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x423b('0x18'));var db=require(_0x423b('0x19'))['db'];function respondWithStatusCode(_0x286c56,_0x3a2b93){_0x3a2b93=_0x3a2b93||0xcc;return function(_0x19c823){if(_0x19c823){return _0x286c56[_0x423b('0x1a')](_0x3a2b93);}return _0x286c56['status'](_0x3a2b93)[_0x423b('0x1b')]();};}function respondWithResult(_0x39419a,_0x443941){_0x443941=_0x443941||0xc8;return function(_0x455802){if(_0x455802){return _0x39419a[_0x423b('0x1c')](_0x443941)[_0x423b('0x1d')](_0x455802);}};}function respondWithFilteredResult(_0x16ef5e,_0x4e3689){return function(_0x231e41){if(_0x231e41){var _0x4616be=typeof _0x4e3689[_0x423b('0x1e')]===_0x423b('0x1f')&&typeof _0x4e3689[_0x423b('0x20')]===_0x423b('0x1f');var _0x15eba2=_0x231e41[_0x423b('0x21')];var _0x2b584f=_0x4616be?0x0:_0x4e3689[_0x423b('0x1e')];var _0x5e73bd=_0x4616be?_0x231e41[_0x423b('0x21')]:_0x4e3689[_0x423b('0x1e')]+_0x4e3689[_0x423b('0x20')];var _0x20e844;if(_0x5e73bd>=_0x15eba2){_0x5e73bd=_0x15eba2;_0x20e844=0xc8;}else{_0x20e844=0xce;}_0x16ef5e[_0x423b('0x1c')](_0x20e844);return _0x16ef5e[_0x423b('0x22')](_0x423b('0x23'),_0x2b584f+'-'+_0x5e73bd+'/'+_0x15eba2)['json'](_0x231e41);}return null;};}function patchUpdates(_0x523520){return function(_0x53af19){try{jsonpatch[_0x423b('0x24')](_0x53af19,_0x523520,!![]);}catch(_0x1c6fda){return BPromise[_0x423b('0x25')](_0x1c6fda);}return _0x53af19['save']();};}function saveUpdates(_0x1bef8f,_0xcd07d6){return function(_0x5e1256){if(_0x5e1256){return _0x5e1256[_0x423b('0x26')](_0x1bef8f)[_0x423b('0x27')](function(_0x5bdcb1){return _0x5bdcb1;});}return null;};}function removeEntity(_0x23226c,_0x139885){return function(_0x6b9346){if(_0x6b9346){return _0x6b9346[_0x423b('0x28')]()[_0x423b('0x27')](function(){var _0x3b16f7=_0x6b9346[_0x423b('0x29')]({'plain':!![]});var _0x1cd3e8=_0x423b('0x2a');return db['UserProfileResource'][_0x423b('0x28')]({'where':{'type':_0x1cd3e8,'resourceId':_0x3b16f7['id']}})[_0x423b('0x27')](function(){return _0x6b9346;});})['then'](function(){_0x23226c[_0x423b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf1295,_0x23daf5){return function(_0x4e0bb2){if(!_0x4e0bb2){_0xaf1295[_0x423b('0x1a')](0x194);}return _0x4e0bb2;};}function handleError(_0x28577c,_0x101280){_0x101280=_0x101280||0x1f4;return function(_0x1a5c71){logger[_0x423b('0x2b')](_0x1a5c71[_0x423b('0x2c')]);if(_0x1a5c71[_0x423b('0x2d')]){delete _0x1a5c71[_0x423b('0x2d')];}_0x28577c[_0x423b('0x1c')](_0x101280)[_0x423b('0x2e')](_0x1a5c71);};}exports[_0x423b('0x2f')]=function(_0x5b8b0,_0x3a8fbd){var _0x23d3ca={},_0x5c40c9={},_0x3dc41c={'count':0x0,'rows':[]};var _0x189983=_[_0x423b('0x30')](db[_0x423b('0x31')][_0x423b('0x32')],function(_0x3e8da4){return{'name':_0x3e8da4['fieldName'],'type':_0x3e8da4[_0x423b('0x33')][_0x423b('0x34')]};});_0x5c40c9[_0x423b('0x35')]=_['map'](_0x189983,_0x423b('0x2d'));_0x5c40c9[_0x423b('0x36')]=_[_0x423b('0x37')](_0x5b8b0['query']);_0x5c40c9['filters']=_[_0x423b('0x38')](_0x5c40c9['model'],_0x5c40c9['query']);_0x23d3ca['attributes']=_[_0x423b('0x38')](_0x5c40c9[_0x423b('0x35')],qs[_0x423b('0x39')](_0x5b8b0[_0x423b('0x36')][_0x423b('0x39')]));_0x23d3ca[_0x423b('0x3a')]=_0x23d3ca[_0x423b('0x3a')]['length']?_0x23d3ca[_0x423b('0x3a')]:_0x5c40c9['model'];if(!_0x5b8b0[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x23d3ca[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x5b8b0['query'][_0x423b('0x20')]);_0x23d3ca[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x5b8b0[_0x423b('0x36')]['offset']);}_0x23d3ca[_0x423b('0x3d')]=qs['sort'](_0x5b8b0[_0x423b('0x36')][_0x423b('0x3e')]);_0x23d3ca[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x5b8b0[_0x423b('0x36')],_0x5c40c9[_0x423b('0x40')]),_0x189983);if(_0x5b8b0['query'][_0x423b('0x42')]){_0x23d3ca[_0x423b('0x3f')]=_['merge'](_0x23d3ca['where'],{'$or':_[_0x423b('0x30')](_0x189983,function(_0x46d19b){if(_0x46d19b[_0x423b('0x33')]!==_0x423b('0x43')){var _0x3bab0f={};_0x3bab0f[_0x46d19b[_0x423b('0x2d')]]={'$like':'%'+_0x5b8b0[_0x423b('0x36')]['filter']+'%'};return _0x3bab0f;}})});}_0x23d3ca=_['merge']({},_0x23d3ca,_0x5b8b0['options']);var _0x336b07={'where':_0x23d3ca[_0x423b('0x3f')]};return db['Campaign'][_0x423b('0x21')](_0x336b07)[_0x423b('0x27')](function(_0x1179ec){_0x3dc41c[_0x423b('0x21')]=_0x1179ec;if(_0x5b8b0['query']['includeAll']){_0x23d3ca[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x31')]['findAll'](_0x23d3ca);})[_0x423b('0x27')](function(_0x4346cd){_0x3dc41c[_0x423b('0x45')]=_0x4346cd;return _0x3dc41c;})[_0x423b('0x27')](respondWithFilteredResult(_0x3a8fbd,_0x23d3ca))['catch'](handleError(_0x3a8fbd,null));};exports[_0x423b('0x46')]=function(_0xe1955f,_0x271f40){var _0x3ea839={'raw':![],'where':{'id':_0xe1955f[_0x423b('0x47')]['id']}},_0x47bdcd={};_0x47bdcd[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x31')][_0x423b('0x32')]);_0x47bdcd['query']=_[_0x423b('0x37')](_0xe1955f['query']);_0x47bdcd[_0x423b('0x40')]=_[_0x423b('0x38')](_0x47bdcd[_0x423b('0x35')],_0x47bdcd['query']);_0x3ea839['attributes']=_[_0x423b('0x38')](_0x47bdcd['model'],qs[_0x423b('0x39')](_0xe1955f['query'][_0x423b('0x39')]));_0x3ea839[_0x423b('0x3a')]=_0x3ea839[_0x423b('0x3a')][_0x423b('0x48')]?_0x3ea839[_0x423b('0x3a')]:_0x47bdcd['model'];if(_0xe1955f[_0x423b('0x36')]['includeAll']){_0x3ea839[_0x423b('0x44')]=[{'all':!![]}];}_0x3ea839=_[_0x423b('0x49')]({},_0x3ea839,_0xe1955f[_0x423b('0x4a')]);return db[_0x423b('0x31')][_0x423b('0x4b')](_0x3ea839)['then'](handleEntityNotFound(_0x271f40,null))[_0x423b('0x27')](respondWithResult(_0x271f40,null))[_0x423b('0x4c')](handleError(_0x271f40,null));};exports['create']=function(_0x474206,_0xfb65b8){return db[_0x423b('0x31')][_0x423b('0x4d')](_0x474206[_0x423b('0x4e')],{})[_0x423b('0x27')](function(_0x5e7610){var _0x59cdec=_0x474206[_0x423b('0x4f')]['get']({'plain':!![]});if(!_0x59cdec)throw new Error(_0x423b('0x50'));if(_0x59cdec['role']==='user'){var _0x186435=_0x5e7610[_0x423b('0x29')]({'plain':!![]});var _0x5b0985=_0x423b('0x2a');return db[_0x423b('0x51')][_0x423b('0x4b')]({'where':{'name':_0x5b0985,'userProfileId':_0x59cdec[_0x423b('0x52')]},'raw':!![]})['then'](function(_0x21e564){if(_0x21e564&&_0x21e564['autoAssociation']===0x0){return db['UserProfileResource'][_0x423b('0x4d')]({'name':_0x186435[_0x423b('0x2d')],'resourceId':_0x186435['id'],'type':_0x21e564[_0x423b('0x2d')],'sectionId':_0x21e564['id']},{})[_0x423b('0x27')](function(){return _0x5e7610;});}else{return _0x5e7610;}})[_0x423b('0x4c')](function(_0x5c534f){logger[_0x423b('0x2b')](_0x423b('0x53'),_0x5c534f);throw _0x5c534f;});}return _0x5e7610;})['then'](respondWithResult(_0xfb65b8,0xc9))[_0x423b('0x4c')](handleError(_0xfb65b8,null));};exports[_0x423b('0x54')]=function(_0x316ab7,_0xe341da){var _0xa060e8={'where':{'id':_0x316ab7[_0x423b('0x47')]['id']}},_0x3238c6={};_0x3238c6[_0x423b('0x35')]=_['keys'](db[_0x423b('0x31')]['rawAttributes']);_0xa060e8['attributes']=_[_0x423b('0x38')](_0x3238c6[_0x423b('0x35')],qs[_0x423b('0x39')](_0x316ab7[_0x423b('0x36')][_0x423b('0x39')]));_0xa060e8[_0x423b('0x3a')]=_0xa060e8[_0x423b('0x3a')]['length']?_0xa060e8[_0x423b('0x3a')]:_0x3238c6[_0x423b('0x35')];if(_0x316ab7['query'][_0x423b('0x55')]){_0xa060e8['include']=[{'all':!![]}];}_0xa060e8=_[_0x423b('0x49')]({},_0xa060e8,_0x316ab7[_0x423b('0x4a')]);return db[_0x423b('0x31')][_0x423b('0x4b')](_0xa060e8)['then'](handleEntityNotFound(_0xe341da,null))[_0x423b('0x27')](function(_0x16fa8b){if(_0x16fa8b){var _0x3ab243=_0x16fa8b[_0x423b('0x29')]({'plain':!![]});_0x3ab243=qs[_0x423b('0x56')](_0x3ab243,['id','createdAt',_0x423b('0x57')]);_0x316ab7[_0x423b('0x4e')]=_[_0x423b('0x56')](_0x316ab7[_0x423b('0x4e')],['id',_0x423b('0x58'),_0x423b('0x57')]);return db['Campaign'][_0x423b('0x4d')](_[_0x423b('0x49')](_0x3ab243,_0x316ab7[_0x423b('0x4e')]),{'include':_0x316ab7[_0x423b('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x423b('0x27')](function(_0xfba006){var _0x4db0f3=_0x316ab7[_0x423b('0x4f')][_0x423b('0x29')]({'plain':!![]});if(!_0x4db0f3)throw new Error(_0x423b('0x50'));if(_0x4db0f3[_0x423b('0x59')]===_0x423b('0x4f')){var _0x47da38=_0xfba006[_0x423b('0x29')]({'plain':!![]});var _0xa8c163=_0x423b('0x2a');return db[_0x423b('0x51')]['find']({'where':{'name':_0xa8c163,'userProfileId':_0x4db0f3[_0x423b('0x52')]},'raw':!![]})[_0x423b('0x27')](function(_0x3f7641){if(_0x3f7641&&_0x3f7641[_0x423b('0x5a')]===0x0){return db['UserProfileResource'][_0x423b('0x4d')]({'name':_0x47da38['name'],'resourceId':_0x47da38['id'],'type':_0x3f7641['name'],'sectionId':_0x3f7641['id']},{})[_0x423b('0x27')](function(){return _0xfba006;});}else{return _0xfba006;}})['catch'](function(_0xfcf2d7){logger['error'](_0x423b('0x53'),_0xfcf2d7);throw _0xfcf2d7;});}return _0xfba006;});}})['then'](respondWithResult(_0xe341da,0xc9))[_0x423b('0x4c')](handleError(_0xe341da,null));};exports[_0x423b('0x26')]=function(_0xbbd109,_0x5170d7){if(_0xbbd109[_0x423b('0x4e')]['id']){delete _0xbbd109[_0x423b('0x4e')]['id'];}return db[_0x423b('0x31')]['find']({'where':{'id':_0xbbd109[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x5170d7,null))[_0x423b('0x27')](saveUpdates(_0xbbd109[_0x423b('0x4e')],null))[_0x423b('0x27')](respondWithResult(_0x5170d7,null))[_0x423b('0x4c')](handleError(_0x5170d7,null));};exports[_0x423b('0x28')]=function(_0x15349d,_0x3f3fb6){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x15349d['params']['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x3f3fb6,null))[_0x423b('0x27')](removeEntity(_0x3f3fb6,null))[_0x423b('0x4c')](handleError(_0x3f3fb6,null));};exports[_0x423b('0x5b')]=function(_0x1f57b9,_0x1863c6,_0x1cbb6d){var _0x1c2284={'raw':!![],'where':{}};var _0x5d3b76={};var _0x13b908={'count':0x0,'rows':[]};return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x1f57b9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x1863c6,null))['then'](function(_0x120f55){if(_0x120f55){_0x5d3b76[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x5c')][_0x423b('0x32')]);_0x5d3b76[_0x423b('0x36')]=_[_0x423b('0x37')](_0x1f57b9[_0x423b('0x36')]);_0x5d3b76[_0x423b('0x40')]=_[_0x423b('0x38')](_0x5d3b76[_0x423b('0x35')],_0x5d3b76['query']);_0x1c2284['attributes']=_['intersection'](_0x5d3b76[_0x423b('0x35')],qs[_0x423b('0x39')](_0x1f57b9['query'][_0x423b('0x39')]));_0x1c2284[_0x423b('0x3a')]=_0x1c2284[_0x423b('0x3a')][_0x423b('0x48')]?_0x1c2284[_0x423b('0x3a')]:_0x5d3b76['model'];if(!_0x1f57b9[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x1c2284[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x1f57b9[_0x423b('0x36')]['limit']);_0x1c2284['offset']=qs[_0x423b('0x1e')](_0x1f57b9[_0x423b('0x36')][_0x423b('0x1e')]);}_0x1c2284[_0x423b('0x3d')]=qs['sort'](_0x1f57b9[_0x423b('0x36')][_0x423b('0x3e')]);_0x1c2284['where']=qs[_0x423b('0x40')](_['pick'](_0x1f57b9['query'],_0x5d3b76['filters']));_0x1c2284['where']['CampaignId']=_0x120f55['id'];if(_0x1f57b9[_0x423b('0x36')][_0x423b('0x42')]){_0x1c2284['where']=_[_0x423b('0x49')](_0x1c2284[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x1c2284[_0x423b('0x3a')],function(_0x300416){var _0x2b7697={};_0x2b7697[_0x300416]={'$like':'%'+_0x1f57b9[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x2b7697;})});}_0x1c2284=_['merge']({},_0x1c2284,_0x1f57b9[_0x423b('0x4a')]);return db['CmHopper'][_0x423b('0x21')]({'where':_0x1c2284[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x1233cd){_0x13b908[_0x423b('0x21')]=_0x1233cd;if(_0x1f57b9[_0x423b('0x36')][_0x423b('0x55')]){_0x1c2284[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x5c')][_0x423b('0x5d')](_0x1c2284);})[_0x423b('0x27')](function(_0x7726d3){_0x13b908[_0x423b('0x45')]=_0x7726d3;return _0x13b908;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x1863c6,_0x1c2284))[_0x423b('0x4c')](handleError(_0x1863c6,null));};exports[_0x423b('0x5e')]=function(_0x3efad9,_0x506224,_0x5e2efb){var _0x512c6c={'raw':!![],'where':{}};var _0x118b89={};var _0x512526={'count':0x0,'rows':[]};return db[_0x423b('0x31')][_0x423b('0x5f')]({'where':{'id':_0x3efad9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x506224,null))[_0x423b('0x27')](function(_0x128099){if(_0x128099){_0x118b89[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x60')]['rawAttributes']);_0x118b89[_0x423b('0x36')]=_[_0x423b('0x37')](_0x3efad9['query']);_0x118b89[_0x423b('0x40')]=_['intersection'](_0x118b89[_0x423b('0x35')],_0x118b89[_0x423b('0x36')]);_0x512c6c[_0x423b('0x3a')]=_['intersection'](_0x118b89[_0x423b('0x35')],qs['fields'](_0x3efad9[_0x423b('0x36')][_0x423b('0x39')]));_0x512c6c['attributes']=_0x512c6c[_0x423b('0x3a')]['length']?_0x512c6c[_0x423b('0x3a')]:_0x118b89[_0x423b('0x35')];if(!_0x3efad9[_0x423b('0x36')]['hasOwnProperty']('nolimit')){_0x512c6c[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x3efad9['query'][_0x423b('0x20')]);_0x512c6c['offset']=qs['offset'](_0x3efad9[_0x423b('0x36')][_0x423b('0x1e')]);}_0x512c6c[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x3efad9[_0x423b('0x36')][_0x423b('0x3e')]);_0x512c6c[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x3efad9[_0x423b('0x36')],_0x118b89[_0x423b('0x40')]));_0x512c6c[_0x423b('0x3f')][_0x423b('0x61')]=_0x128099['id'];if(_0x3efad9['query'][_0x423b('0x42')]){_0x512c6c[_0x423b('0x3f')]=_['merge'](_0x512c6c['where'],{'$or':_[_0x423b('0x30')](_0x512c6c[_0x423b('0x3a')],function(_0x1c88a6){var _0xb343f7={};_0xb343f7[_0x1c88a6]={'$like':'%'+_0x3efad9[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0xb343f7;})});}_0x512c6c=_[_0x423b('0x49')]({},_0x512c6c,_0x3efad9[_0x423b('0x4a')]);return db[_0x423b('0x60')][_0x423b('0x21')]({'where':_0x512c6c[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x22855e){_0x512526[_0x423b('0x21')]=_0x22855e;if(_0x3efad9[_0x423b('0x36')][_0x423b('0x55')]){_0x512c6c[_0x423b('0x44')]=[{'all':!![]}];}return db[_0x423b('0x60')][_0x423b('0x5d')](_0x512c6c);})[_0x423b('0x27')](function(_0x273eb7){_0x512526['rows']=_0x273eb7;return _0x512526;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x506224,_0x512c6c))[_0x423b('0x4c')](handleError(_0x506224,null));};exports[_0x423b('0x62')]=function(_0x4238e4,_0x55b16a,_0x4204c6){var _0x41671b={'raw':!![],'where':{}};var _0x17686e={};var _0x55a9aa={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x4238e4[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x55b16a,null))['then'](function(_0xf906b8){if(_0xf906b8){_0x17686e['model']=_['keys'](db['CmHopperFinal'][_0x423b('0x32')]);_0x17686e['query']=_[_0x423b('0x37')](_0x4238e4[_0x423b('0x36')]);_0x17686e[_0x423b('0x40')]=_[_0x423b('0x38')](_0x17686e['model'],_0x17686e[_0x423b('0x36')]);_0x41671b[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x17686e['model'],qs[_0x423b('0x39')](_0x4238e4['query'][_0x423b('0x39')]));_0x41671b[_0x423b('0x3a')]=_0x41671b[_0x423b('0x3a')][_0x423b('0x48')]?_0x41671b['attributes']:_0x17686e['model'];if(!_0x4238e4[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x41671b[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x4238e4[_0x423b('0x36')][_0x423b('0x20')]);_0x41671b['offset']=qs[_0x423b('0x1e')](_0x4238e4['query'][_0x423b('0x1e')]);}_0x41671b[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x4238e4['query'][_0x423b('0x3e')]);_0x41671b[_0x423b('0x3f')]=qs['filters'](_[_0x423b('0x41')](_0x4238e4['query'],_0x17686e[_0x423b('0x40')]));_0x41671b[_0x423b('0x3f')][_0x423b('0x61')]=_0xf906b8['id'];if(_0x4238e4[_0x423b('0x36')][_0x423b('0x42')]){_0x41671b['where']=_[_0x423b('0x49')](_0x41671b[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x41671b[_0x423b('0x3a')],function(_0x25c3c1){var _0x167f50={};_0x167f50[_0x25c3c1]={'$like':'%'+_0x4238e4[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x167f50;})});}_0x41671b=_[_0x423b('0x49')]({},_0x41671b,_0x4238e4[_0x423b('0x4a')]);return db['CmHopperFinal']['count']({'where':_0x41671b[_0x423b('0x3f')]})[_0x423b('0x27')](function(_0x508692){_0x55a9aa[_0x423b('0x21')]=_0x508692;if(_0x4238e4[_0x423b('0x36')][_0x423b('0x55')]){_0x41671b['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x423b('0x5d')](_0x41671b);})[_0x423b('0x27')](function(_0x3934d5){_0x55a9aa['rows']=_0x3934d5;return _0x55a9aa;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x55b16a,_0x41671b))['catch'](handleError(_0x55b16a,null));};exports['getHopperBlacks']=function(_0x2591e8,_0x587514,_0x5b6301){var _0x55485d={'raw':!![],'where':{}};var _0x3224ea={};var _0x1fd284={'count':0x0,'rows':[]};return db[_0x423b('0x31')][_0x423b('0x5f')]({'where':{'id':_0x2591e8[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x587514,null))[_0x423b('0x27')](function(_0x24b74b){if(_0x24b74b){_0x3224ea[_0x423b('0x35')]=_[_0x423b('0x37')](db[_0x423b('0x63')][_0x423b('0x32')]);_0x3224ea[_0x423b('0x36')]=_[_0x423b('0x37')](_0x2591e8[_0x423b('0x36')]);_0x3224ea[_0x423b('0x40')]=_[_0x423b('0x38')](_0x3224ea['model'],_0x3224ea['query']);_0x55485d[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x3224ea[_0x423b('0x35')],qs[_0x423b('0x39')](_0x2591e8[_0x423b('0x36')]['fields']));_0x55485d[_0x423b('0x3a')]=_0x55485d[_0x423b('0x3a')][_0x423b('0x48')]?_0x55485d[_0x423b('0x3a')]:_0x3224ea[_0x423b('0x35')];if(!_0x2591e8[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x55485d[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x2591e8['query'][_0x423b('0x20')]);_0x55485d[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x2591e8[_0x423b('0x36')][_0x423b('0x1e')]);}_0x55485d[_0x423b('0x3d')]=qs[_0x423b('0x3e')](_0x2591e8[_0x423b('0x36')][_0x423b('0x3e')]);_0x55485d[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x2591e8[_0x423b('0x36')],_0x3224ea[_0x423b('0x40')]));_0x55485d['where'][_0x423b('0x61')]=_0x24b74b['id'];if(_0x2591e8[_0x423b('0x36')][_0x423b('0x42')]){_0x55485d[_0x423b('0x3f')]=_[_0x423b('0x49')](_0x55485d['where'],{'$or':_['map'](_0x55485d['attributes'],function(_0x5a9592){var _0x2ed846={};_0x2ed846[_0x5a9592]={'$like':'%'+_0x2591e8[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x2ed846;})});}_0x55485d=_[_0x423b('0x49')]({},_0x55485d,_0x2591e8[_0x423b('0x4a')]);return db[_0x423b('0x63')]['count']({'where':_0x55485d['where']})[_0x423b('0x27')](function(_0x1617c8){_0x1fd284[_0x423b('0x21')]=_0x1617c8;if(_0x2591e8[_0x423b('0x36')]['includeAll']){_0x55485d[_0x423b('0x44')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x423b('0x5d')](_0x55485d);})['then'](function(_0x27cc07){_0x1fd284[_0x423b('0x45')]=_0x27cc07;return _0x1fd284;});}})[_0x423b('0x27')](respondWithFilteredResult(_0x587514,_0x55485d))[_0x423b('0x4c')](handleError(_0x587514,null));};exports['getLists']=function(_0x506581,_0x6876e,_0x511896){var _0x26e25d={};var _0x4ba477={};var _0x2a9845;var _0x12ae73;return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x506581[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x6876e,null))[_0x423b('0x27')](function(_0x4bf9da){if(_0x4bf9da){_0x2a9845=_0x4bf9da;_0x4ba477[_0x423b('0x35')]=_[_0x423b('0x37')](db['CmList']['rawAttributes']);_0x4ba477['query']=_[_0x423b('0x37')](_0x506581[_0x423b('0x36')]);_0x4ba477['filters']=_['intersection'](_0x4ba477[_0x423b('0x35')],_0x4ba477[_0x423b('0x36')]);_0x26e25d[_0x423b('0x3a')]=_[_0x423b('0x38')](_0x4ba477[_0x423b('0x35')],qs['fields'](_0x506581[_0x423b('0x36')][_0x423b('0x39')]));_0x26e25d['attributes']=_0x26e25d['attributes'][_0x423b('0x48')]?_0x26e25d['attributes']:_0x4ba477[_0x423b('0x35')];_0x26e25d[_0x423b('0x3d')]=qs['sort'](_0x506581[_0x423b('0x36')]['sort']);_0x26e25d[_0x423b('0x3f')]=qs[_0x423b('0x40')](_[_0x423b('0x41')](_0x506581[_0x423b('0x36')],_0x4ba477[_0x423b('0x40')]));if(_0x506581[_0x423b('0x36')][_0x423b('0x42')]){_0x26e25d[_0x423b('0x3f')]=_[_0x423b('0x49')](_0x26e25d['where'],{'$or':_['map'](_0x26e25d[_0x423b('0x3a')],function(_0x2b58d7){var _0x3bb518={};_0x3bb518[_0x2b58d7]={'$like':'%'+_0x506581[_0x423b('0x36')][_0x423b('0x42')]+'%'};return _0x3bb518;})});}_0x26e25d=_['merge']({},_0x26e25d,_0x506581[_0x423b('0x4a')]);return _0x2a9845['getLists'](_0x26e25d);}})[_0x423b('0x27')](function(_0x269f85){if(_0x269f85){_0x12ae73=_0x269f85[_0x423b('0x48')];if(!_0x506581[_0x423b('0x36')][_0x423b('0x3b')](_0x423b('0x3c'))){_0x26e25d[_0x423b('0x20')]=qs[_0x423b('0x20')](_0x506581[_0x423b('0x36')]['limit']);_0x26e25d[_0x423b('0x1e')]=qs[_0x423b('0x1e')](_0x506581[_0x423b('0x36')]['offset']);}return _0x2a9845[_0x423b('0x64')](_0x26e25d);}})['then'](function(_0x4a2550){if(_0x4a2550){return _0x4a2550?{'count':_0x12ae73,'rows':_0x4a2550}:null;}})['then'](respondWithResult(_0x6876e,null))['catch'](handleError(_0x6876e,null));};exports[_0x423b('0x65')]=function(_0x2c92d9,_0x31a50e,_0x78fae9){var _0x3ade8c,_0x44ffec;return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x2c92d9[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x31a50e,null))[_0x423b('0x27')](function(_0x2b33b7){if(_0x2b33b7){_0x44ffec=_0x2b33b7;return _0x2b33b7[_0x423b('0x65')](_0x2c92d9['body'][_0x423b('0x66')],_[_0x423b('0x56')](_0x2c92d9[_0x423b('0x4e')],[_0x423b('0x66'),'id'])||{});}return null;})[_0x423b('0x67')](function(_0x5c74ae){var _0x4c7963;_0x3ade8c=_0x5c74ae||[];var _0x48ee22=[];if(_0x5c74ae){for(var _0x2f5c28=0x0;_0x2f5c28<_0x5c74ae['length'];_0x2f5c28+=0x1){var _0x157c05=_0x5c74ae[_0x2f5c28][_0x423b('0x29')]({'plain':!![]});_0x44ffec['dialCheckDuplicateType']=_0x2c92d9[_0x423b('0x4e')][_0x423b('0x68')]?_0x2c92d9[_0x423b('0x4e')][_0x423b('0x68')]:_0x44ffec[_0x423b('0x68')];switch(_0x44ffec[_0x423b('0x68')]){case _0x423b('0x69'):_0x4c7963=squel['insert']()[_0x423b('0x6a')](_0x423b('0x6b'))[_0x423b('0x6c')]([_0x423b('0x6d'),_0x423b('0x6e'),_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),_0x423b('0x6d'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x6e'))[_0x423b('0x72')]('id',_0x423b('0x6f'))[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),'ListId')[_0x423b('0x72')](_0x2c92d9['params']['id'][_0x423b('0x75')](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))['field'](_0x423b('0x73'),_0x423b('0x57'))[_0x423b('0x76')]('cm_contacts')[_0x423b('0x3f')]('deletedAt\x20IS\x20NULL')[_0x423b('0x3f')](_0x423b('0x77'),_0x157c05['CmListId'][_0x423b('0x75')]())[_0x423b('0x3f')]('phone\x20IS\x20NOT\x20NULL')['where'](_0x423b('0x78'),squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x79'))[_0x423b('0x76')]('cm_hopper_final')[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9['params']['id'][_0x423b('0x75')]()))['where'](_0x423b('0x78'),squel[_0x423b('0x71')]()['field']('COALESCE(phone,\x27\x27)')[_0x423b('0x76')]('cm_hopper')[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9[_0x423b('0x47')]['id']['toString']())))[_0x423b('0x75')]();break;case'onlyIfOpen':_0x4c7963=squel['insert']()[_0x423b('0x6a')](_0x423b('0x6b'))[_0x423b('0x6c')](['phone',_0x423b('0x6e'),_0x423b('0x6f'),'ListId',_0x423b('0x61'),_0x423b('0x58'),_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),'phone')['field'](_0x423b('0x73'),'scheduledAt')['field']('id','ContactId')[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))[_0x423b('0x72')]('NOW()',_0x423b('0x57'))[_0x423b('0x76')](_0x423b('0x7b'))[_0x423b('0x3f')](_0x423b('0x7c'))[_0x423b('0x3f')]('ListId\x20=\x20?',_0x157c05[_0x423b('0x74')][_0x423b('0x75')]())[_0x423b('0x3f')](_0x423b('0x7d'))[_0x423b('0x3f')](_0x423b('0x78'),squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x7e'))[_0x423b('0x76')](_0x423b('0x6b'))[_0x423b('0x3f')](_0x423b('0x7a'),_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')]())))['toString']();break;default:_0x4c7963=squel[_0x423b('0x7f')]()[_0x423b('0x6a')]('cm_hopper')[_0x423b('0x6c')](['phone','scheduledAt',_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')]('phone',_0x423b('0x6d'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x6e'))[_0x423b('0x72')]('id',_0x423b('0x6f'))[_0x423b('0x72')](_0x157c05[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x2c92d9[_0x423b('0x47')]['id'][_0x423b('0x75')](),'CampaignId')[_0x423b('0x72')]('NOW()',_0x423b('0x58'))[_0x423b('0x72')]('NOW()',_0x423b('0x57'))[_0x423b('0x76')](_0x423b('0x7b'))['where'](_0x423b('0x7c'))[_0x423b('0x3f')](_0x423b('0x77'),_0x157c05[_0x423b('0x74')][_0x423b('0x75')]())['where'](_0x423b('0x7d')))[_0x423b('0x75')]();}_0x48ee22[_0x423b('0x80')](db[_0x423b('0x81')][_0x423b('0x36')](_0x4c7963));}return BPromise[_0x423b('0x82')](_0x48ee22);}})[_0x423b('0x27')](function(){return _0x3ade8c;})[_0x423b('0x27')](respondWithResult(_0x31a50e,null))[_0x423b('0x4c')](handleError(_0x31a50e,null));};exports[_0x423b('0x83')]=function(_0x5afd01,_0x21d065,_0xfb1e29){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x5afd01[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x21d065,null))['then'](function(_0x4e7222){if(_0x4e7222){return _0x4e7222['removeLists'](_0x5afd01[_0x423b('0x36')][_0x423b('0x66')]);}})[_0x423b('0x27')](function(_0x196804){if(_0x196804){return db[_0x423b('0x5c')][_0x423b('0x28')]({'where':{'ListId':_0x5afd01[_0x423b('0x36')][_0x423b('0x66')],'CampaignId':_0x5afd01[_0x423b('0x47')]['id']}})[_0x423b('0x27')](function(){return _0x196804;});}})[_0x423b('0x27')](respondWithStatusCode(_0x21d065,null))[_0x423b('0x4c')](handleError(_0x21d065,null));};exports[_0x423b('0x84')]=function(_0x2aa4f3,_0x268024,_0x17a900){var _0x57800a={};var _0x719649={};var _0x37a2ad;var _0x145a8c;return db[_0x423b('0x31')]['findOne']({'where':{'id':_0x2aa4f3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x268024,null))[_0x423b('0x27')](function(_0x34b08b){if(_0x34b08b){_0x37a2ad=_0x34b08b;_0x719649[_0x423b('0x35')]=_[_0x423b('0x37')](db['CmList'][_0x423b('0x32')]);_0x719649['query']=_[_0x423b('0x37')](_0x2aa4f3[_0x423b('0x36')]);_0x719649[_0x423b('0x40')]=_[_0x423b('0x38')](_0x719649[_0x423b('0x35')],_0x719649[_0x423b('0x36')]);_0x57800a['attributes']=_[_0x423b('0x38')](_0x719649[_0x423b('0x35')],qs[_0x423b('0x39')](_0x2aa4f3[_0x423b('0x36')][_0x423b('0x39')]));_0x57800a[_0x423b('0x3a')]=_0x57800a[_0x423b('0x3a')][_0x423b('0x48')]?_0x57800a[_0x423b('0x3a')]:_0x719649['model'];_0x57800a[_0x423b('0x3d')]=qs['sort'](_0x2aa4f3[_0x423b('0x36')][_0x423b('0x3e')]);_0x57800a[_0x423b('0x3f')]=qs[_0x423b('0x40')](_['pick'](_0x2aa4f3[_0x423b('0x36')],_0x719649[_0x423b('0x40')]));if(_0x2aa4f3['query'][_0x423b('0x42')]){_0x57800a[_0x423b('0x3f')]=_['merge'](_0x57800a[_0x423b('0x3f')],{'$or':_[_0x423b('0x30')](_0x57800a[_0x423b('0x3a')],function(_0x4d8fe9){var _0x2700af={};_0x2700af[_0x4d8fe9]={'$like':'%'+_0x2aa4f3['query'][_0x423b('0x42')]+'%'};return _0x2700af;})});}_0x57800a=_['merge']({},_0x57800a,_0x2aa4f3[_0x423b('0x4a')]);return _0x37a2ad['getBlackLists'](_0x57800a);}})[_0x423b('0x27')](function(_0x56062d){if(_0x56062d){_0x145a8c=_0x56062d[_0x423b('0x48')];if(!_0x2aa4f3['query'][_0x423b('0x3b')]('nolimit')){_0x57800a['limit']=qs[_0x423b('0x20')](_0x2aa4f3['query'][_0x423b('0x20')]);_0x57800a['offset']=qs[_0x423b('0x1e')](_0x2aa4f3['query']['offset']);}return _0x37a2ad[_0x423b('0x84')](_0x57800a);}})[_0x423b('0x27')](function(_0x1b150c){if(_0x1b150c){return _0x1b150c?{'count':_0x145a8c,'rows':_0x1b150c}:null;}})['then'](respondWithResult(_0x268024,null))[_0x423b('0x4c')](handleError(_0x268024,null));};exports['addBlackLists']=function(_0x34ac0f,_0x149d31,_0x4d362a){var _0x513634,_0xc11d77;return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x34ac0f['params']['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x149d31,null))['then'](function(_0x4480a8){if(_0x4480a8){_0xc11d77=_0x4480a8;return _0x4480a8[_0x423b('0x85')](_0x34ac0f[_0x423b('0x4e')][_0x423b('0x66')],_[_0x423b('0x56')](_0x34ac0f['body'],[_0x423b('0x66'),'id'])||{});}return null;})[_0x423b('0x67')](function(_0x403b9e){var _0x539ef2;_0x513634=_0x403b9e||[];var _0x1a97a8=[];if(_0x403b9e){for(var _0x4fe773=0x0;_0x4fe773<_0x403b9e[_0x423b('0x48')];_0x4fe773+=0x1){var _0x29a581=_0x403b9e[_0x4fe773][_0x423b('0x29')]({'plain':!![]});_0x539ef2=squel['insert']()['into'](_0x423b('0x86'))[_0x423b('0x6c')](['phone',_0x423b('0x6f'),_0x423b('0x70'),_0x423b('0x61'),'createdAt',_0x423b('0x57')],squel[_0x423b('0x71')]()[_0x423b('0x72')](_0x423b('0x6d'),'phone')['field']('id','ContactId')['field'](_0x29a581[_0x423b('0x74')][_0x423b('0x75')](),_0x423b('0x70'))[_0x423b('0x72')](_0x34ac0f[_0x423b('0x47')]['id']['toString'](),_0x423b('0x61'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x58'))[_0x423b('0x72')](_0x423b('0x73'),_0x423b('0x57'))['from'](_0x423b('0x7b'))[_0x423b('0x3f')](_0x423b('0x7c'))['where'](_0x423b('0x77'),_0x29a581[_0x423b('0x74')][_0x423b('0x75')]())[_0x423b('0x3f')](_0x423b('0x7d')))[_0x423b('0x75')]();_0x1a97a8[_0x423b('0x80')](db[_0x423b('0x81')][_0x423b('0x36')](_0x539ef2));}return BPromise[_0x423b('0x82')](_0x1a97a8);}})[_0x423b('0x27')](function(){return _0x513634;})[_0x423b('0x27')](respondWithResult(_0x149d31,null))['catch'](handleError(_0x149d31,null));};exports['removeBlackLists']=function(_0x3aabf3,_0x5e66d9,_0x495db9){return db[_0x423b('0x31')][_0x423b('0x4b')]({'where':{'id':_0x3aabf3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](handleEntityNotFound(_0x5e66d9,null))[_0x423b('0x27')](function(_0x2c13ed){if(_0x2c13ed){return _0x2c13ed['removeBlackLists'](_0x3aabf3['query']['ids']);}})[_0x423b('0x27')](function(_0x39ab2b){if(_0x39ab2b){return db[_0x423b('0x63')][_0x423b('0x28')]({'where':{'ListId':_0x3aabf3[_0x423b('0x36')][_0x423b('0x66')],'CampaignId':_0x3aabf3[_0x423b('0x47')]['id']}})[_0x423b('0x27')](function(){return _0x39ab2b;});}})[_0x423b('0x27')](respondWithStatusCode(_0x5e66d9,null))[_0x423b('0x4c')](handleError(_0x5e66d9,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 5d225d9..68e2fed 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(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_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 _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x494ea5,_0x234211){var _0x3e6800=function(_0x32ae92){while(--_0x32ae92){_0x494ea5['push'](_0x494ea5['shift']());}};_0x3e6800(++_0x234211);}(_0x7a54,0x106));var _0x47a5=function(_0x41cc33,_0x28c426){_0x41cc33=_0x41cc33-0x0;var _0x538099=_0x7a54[_0x41cc33];return _0x538099;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index 0fa8217..c7cc3bd 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 _0x502a=['client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x43c7f7,_0x5777a9){var _0x778627=function(_0x365702){while(--_0x365702){_0x43c7f7['push'](_0x43c7f7['shift']());}};_0x778627(++_0x5777a9);}(_0x502a,0xd8));var _0xa502=function(_0x171ab8,_0x5c0446){_0x171ab8=_0x171ab8-0x0;var _0x3bb207=_0x502a[_0x171ab8];return _0x3bb207;};'use strict';var _=require(_0xa502('0x0'));var util=require(_0xa502('0x1'));var moment=require('moment');var BPromise=require(_0xa502('0x2'));var rs=require(_0xa502('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa502('0x4'));var logger=require('../../config/logger')(_0xa502('0x5'));var config=require(_0xa502('0x6'));var jayson=require(_0xa502('0x7'));var client=jayson[_0xa502('0x8')][_0xa502('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x489407,_0x329022,_0x29fb03){return new BPromise(function(_0x4d30f2,_0x4e4e5d){return client[_0xa502('0xa')](_0x489407,_0x29fb03)[_0xa502('0xb')](function(_0x5251fa){logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));logger['debug'](_0xa502('0xf'),_0x329022,_0xa502('0xe'),JSON[_0xa502('0x10')](_0x5251fa));if(_0x5251fa['error']){if(_0x5251fa[_0xa502('0x11')][_0xa502('0x12')]===0x1f4){logger['error'](_0xa502('0xd'),_0x329022,_0x5251fa[_0xa502('0x11')]['message']);return _0x4e4e5d(_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);}logger[_0xa502('0x11')]('Campaign,\x20%s,\x20%s',_0x329022,_0x5251fa[_0xa502('0x11')][_0xa502('0x13')]);return _0x4d30f2(_0x5251fa[_0xa502('0x11')]['message']);}else{logger[_0xa502('0xc')](_0xa502('0xd'),_0x329022,_0xa502('0xe'));_0x4d30f2(_0x5251fa[_0xa502('0x14')][_0xa502('0x13')]);}})[_0xa502('0x15')](function(_0x3107a0){logger[_0xa502('0x11')](_0xa502('0xd'),_0x329022,_0x3107a0);_0x4e4e5d(_0x3107a0);});});}exports[_0xa502('0x16')]=function(_0x1445ec){var _0x315455=this;return new Promise(function(_0x1d2f3d,_0x166453){return db[_0xa502('0x17')][_0xa502('0x18')]({'raw':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x1445ec['options']?_0x1445ec[_0xa502('0x19')][_0xa502('0x1a')]||null:null,'attributes':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1b')]||null:null,'limit':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1c')]||null:null,'include':_0x1445ec[_0xa502('0x19')]?_0x1445ec[_0xa502('0x19')][_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1445ec['options'][_0xa502('0x1d')],function(_0x1e6c5a){return{'model':db[_0x1e6c5a[_0xa502('0x1f')]],'as':_0x1e6c5a['as'],'attributes':_0x1e6c5a[_0xa502('0x1b')],'include':_0x1e6c5a[_0xa502('0x1d')]?_[_0xa502('0x1e')](_0x1e6c5a[_0xa502('0x1d')],function(_0x55476d){return{'model':db[_0x55476d['model']],'as':_0x55476d['as'],'attributes':_0x55476d[_0xa502('0x1b')],'include':_0x55476d['include']?_[_0xa502('0x1e')](_0x55476d[_0xa502('0x1d')],function(_0x5d04ad){return{'model':db[_0x5d04ad[_0xa502('0x1f')]],'as':_0x5d04ad['as'],'attributes':_0x5d04ad[_0xa502('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xb2c9a0){logger[_0xa502('0xc')](_0xa502('0x16'),_0x1445ec);logger['debug']('GetCampaign',_0x1445ec,JSON['stringify'](_0xb2c9a0));_0x1d2f3d(_0xb2c9a0);})[_0xa502('0x15')](function(_0x34f7fa){logger['error']('GetCampaign',_0x34f7fa[_0xa502('0x13')],_0x1445ec);_0x166453(_0x315455[_0xa502('0x11')](0x1f4,_0x34f7fa['message']));});});}; \ No newline at end of file +var _0x6c6f=['model','GetCampaign','debug','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','Campaign,\x20%s,\x20%s','request\x20sent','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','findAll','options','raw','where','attributes','include','map'];(function(_0x2aa9df,_0x3a0bfa){var _0x9c98c2=function(_0xd1e1c1){while(--_0xd1e1c1){_0x2aa9df['push'](_0x2aa9df['shift']());}};_0x9c98c2(++_0x3a0bfa);}(_0x6c6f,0x17a));var _0xf6c6=function(_0x1cbaed,_0x1ce0cf){_0x1cbaed=_0x1cbaed-0x0;var _0x4ec2de=_0x6c6f[_0x1cbaed];return _0x4ec2de;};'use strict';var _=require(_0xf6c6('0x0'));var util=require(_0xf6c6('0x1'));var moment=require(_0xf6c6('0x2'));var BPromise=require(_0xf6c6('0x3'));var rs=require(_0xf6c6('0x4'));var fs=require('fs');var Redis=require(_0xf6c6('0x5'));var db=require(_0xf6c6('0x6'))['db'];var utils=require(_0xf6c6('0x7'));var logger=require(_0xf6c6('0x8'))(_0xf6c6('0x9'));var config=require(_0xf6c6('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xf6c6('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c27f8,_0x34ea40,_0x5b34df){return new BPromise(function(_0x308c42,_0x296564){return client[_0xf6c6('0xc')](_0x4c27f8,_0x5b34df)[_0xf6c6('0xd')](function(_0x2d2053){logger['info'](_0xf6c6('0xe'),_0x34ea40,_0xf6c6('0xf'));logger['debug'](_0xf6c6('0x10'),_0x34ea40,_0xf6c6('0xf'),JSON[_0xf6c6('0x11')](_0x2d2053));if(_0x2d2053['error']){if(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x13')]===0x1f4){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);return _0x296564(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x2d2053['error'][_0xf6c6('0x14')]);return _0x308c42(_0x2d2053[_0xf6c6('0x12')][_0xf6c6('0x14')]);}else{logger[_0xf6c6('0x15')]('Campaign,\x20%s,\x20%s',_0x34ea40,'request\x20sent');_0x308c42(_0x2d2053[_0xf6c6('0x16')][_0xf6c6('0x14')]);}})['catch'](function(_0x9f633c){logger[_0xf6c6('0x12')](_0xf6c6('0xe'),_0x34ea40,_0x9f633c);_0x296564(_0x9f633c);});});}exports['GetCampaign']=function(_0x8d6718){var _0x1455c5=this;return new Promise(function(_0x57a496,_0x23ed9c){return db['Campaign'][_0xf6c6('0x17')]({'raw':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718['options'][_0xf6c6('0x19')]===undefined?!![]:![]:!![],'where':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1a')]||null:null,'attributes':_0x8d6718['options']?_0x8d6718['options'][_0xf6c6('0x1b')]||null:null,'limit':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')]['limit']||null:null,'include':_0x8d6718[_0xf6c6('0x18')]?_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x8d6718[_0xf6c6('0x18')][_0xf6c6('0x1c')],function(_0x43e074){return{'model':db[_0x43e074[_0xf6c6('0x1e')]],'as':_0x43e074['as'],'attributes':_0x43e074['attributes'],'include':_0x43e074[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x43e074[_0xf6c6('0x1c')],function(_0x37cc28){return{'model':db[_0x37cc28['model']],'as':_0x37cc28['as'],'attributes':_0x37cc28[_0xf6c6('0x1b')],'include':_0x37cc28[_0xf6c6('0x1c')]?_[_0xf6c6('0x1d')](_0x37cc28[_0xf6c6('0x1c')],function(_0x365f43){return{'model':db[_0x365f43[_0xf6c6('0x1e')]],'as':_0x365f43['as'],'attributes':_0x365f43[_0xf6c6('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xf6c6('0xd')](function(_0x3f00ae){logger[_0xf6c6('0x15')](_0xf6c6('0x1f'),_0x8d6718);logger[_0xf6c6('0x20')](_0xf6c6('0x1f'),_0x8d6718,JSON[_0xf6c6('0x11')](_0x3f00ae));_0x57a496(_0x3f00ae);})[_0xf6c6('0x21')](function(_0x4c5a20){logger[_0xf6c6('0x12')](_0xf6c6('0x1f'),_0x4c5a20[_0xf6c6('0x14')],_0x8d6718);_0x23ed9c(_0x1455c5[_0xf6c6('0x12')](0x1f4,_0x4c5a20[_0xf6c6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 0588597..ded3bbd 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 _0xf378=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','multer','path'];(function(_0x59575d,_0x3c389b){var _0x4a6ad4=function(_0x49fe37){while(--_0x49fe37){_0x59575d['push'](_0x59575d['shift']());}};_0x4a6ad4(++_0x3c389b);}(_0xf378,0x18a));var _0x8f37=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xf378[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x8f37('0x0'));var util=require('util');var path=require(_0x8f37('0x1'));var timeout=require(_0x8f37('0x2'));var express=require(_0x8f37('0x3'));var router=express[_0x8f37('0x4')]();var fs_extra=require(_0x8f37('0x5'));var auth=require(_0x8f37('0x6'));var interaction=require(_0x8f37('0x7'));var config=require(_0x8f37('0x8'));var controller=require('./campaign.controller');router[_0x8f37('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x8f37('0xa'),auth[_0x8f37('0xb')](),controller[_0x8f37('0xc')]);router[_0x8f37('0x9')](_0x8f37('0xd'),auth[_0x8f37('0xb')](),controller[_0x8f37('0xe')]);router[_0x8f37('0x9')](_0x8f37('0xf'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x8f37('0x9')](_0x8f37('0x10'),auth['isAuthenticated'](),controller[_0x8f37('0x11')]);router[_0x8f37('0x9')](_0x8f37('0x12'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x13')]);router[_0x8f37('0x9')](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x15')]);router[_0x8f37('0x9')](_0x8f37('0x16'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x17')]);router['post']('/',auth[_0x8f37('0xb')](),controller[_0x8f37('0x18')]);router[_0x8f37('0x19')](_0x8f37('0x1a'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1b')]);router['post'](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1c')]);router[_0x8f37('0x19')](_0x8f37('0x16'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x1d')]);router[_0x8f37('0x1e')](_0x8f37('0xa'),auth[_0x8f37('0xb')](),controller['update']);router[_0x8f37('0x1f')]('/:id',auth[_0x8f37('0xb')](),controller[_0x8f37('0x20')]);router[_0x8f37('0x1f')](_0x8f37('0x14'),auth[_0x8f37('0xb')](),controller[_0x8f37('0x21')]);router['delete']('/:id/blacklists',auth[_0x8f37('0xb')](),controller[_0x8f37('0x22')]);module[_0x8f37('0x23')]=router; \ No newline at end of file +var _0xb00d=['../../components/auth/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','create','post','/:id/clone','clone','addBlackLists','put','/:id','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','multer','util','path','connect-timeout','express','Router'];(function(_0x5c6e52,_0x5297ff){var _0x193919=function(_0x5e5a54){while(--_0x5e5a54){_0x5c6e52['push'](_0x5c6e52['shift']());}};_0x193919(++_0x5297ff);}(_0xb00d,0x19e));var _0xdb00=function(_0x423549,_0x242e63){_0x423549=_0x423549-0x0;var _0xdcb104=_0xb00d[_0x423549];return _0xdcb104;};'use strict';var multer=require(_0xdb00('0x0'));var util=require(_0xdb00('0x1'));var path=require(_0xdb00('0x2'));var timeout=require(_0xdb00('0x3'));var express=require(_0xdb00('0x4'));var router=express[_0xdb00('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xdb00('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdb00('0x7'));var controller=require(_0xdb00('0x8'));router['get']('/',auth[_0xdb00('0x9')](),controller[_0xdb00('0xa')]);router[_0xdb00('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xdb00('0xc')]);router[_0xdb00('0xb')](_0xdb00('0xd'),auth[_0xdb00('0x9')](),controller[_0xdb00('0xe')]);router['get'](_0xdb00('0xf'),auth[_0xdb00('0x9')](),controller[_0xdb00('0x10')]);router[_0xdb00('0xb')]('/:id/hopper_finals',auth[_0xdb00('0x9')](),controller[_0xdb00('0x11')]);router['get'](_0xdb00('0x12'),auth['isAuthenticated'](),controller[_0xdb00('0x13')]);router[_0xdb00('0xb')](_0xdb00('0x14'),auth['isAuthenticated'](),controller[_0xdb00('0x15')]);router[_0xdb00('0xb')]('/:id/blacklists',auth[_0xdb00('0x9')](),controller[_0xdb00('0x16')]);router['post']('/',auth[_0xdb00('0x9')](),controller[_0xdb00('0x17')]);router[_0xdb00('0x18')](_0xdb00('0x19'),auth['isAuthenticated'](),controller[_0xdb00('0x1a')]);router[_0xdb00('0x18')](_0xdb00('0x14'),auth[_0xdb00('0x9')](),controller['addLists']);router[_0xdb00('0x18')]('/:id/blacklists',auth[_0xdb00('0x9')](),controller[_0xdb00('0x1b')]);router[_0xdb00('0x1c')]('/:id',auth[_0xdb00('0x9')](),controller['update']);router['delete'](_0xdb00('0x1d'),auth['isAuthenticated'](),controller[_0xdb00('0x1e')]);router[_0xdb00('0x1f')](_0xdb00('0x14'),auth[_0xdb00('0x9')](),controller[_0xdb00('0x20')]);router[_0xdb00('0x1f')](_0xdb00('0x21'),auth['isAuthenticated'](),controller[_0xdb00('0x22')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index de79f10..5af7505 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 _0x278c=['exports','TEXT','STRING','getDataValue','key','sequelize'];(function(_0x372b79,_0x34ff1c){var _0x1eacc3=function(_0x206347){while(--_0x206347){_0x372b79['push'](_0x372b79['shift']());}};_0x1eacc3(++_0x34ff1c);}(_0x278c,0x18b));var _0xc278=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0x278c[_0x474d97];return _0x1edf25;};'use strict';var Sequelize=require(_0xc278('0x0'));module[_0xc278('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc278('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xc278('0x3')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc278('0x4')](_0xc278('0x5'));}}}; \ No newline at end of file +var _0x0ea2=['getDataValue','key','exports','STRING','TEXT','VIRTUAL'];(function(_0x5f31e9,_0xf44932){var _0x165bed=function(_0xfa0e79){while(--_0xfa0e79){_0x5f31e9['push'](_0x5f31e9['shift']());}};_0x165bed(++_0xf44932);}(_0x0ea2,0x1e2));var _0x20ea=function(_0xbb7389,_0x12b29d){_0xbb7389=_0xbb7389-0x0;var _0x12537b=_0x0ea2[_0xbb7389];return _0x12537b;};'use strict';var Sequelize=require('sequelize');module[_0x20ea('0x0')]={'key':{'type':Sequelize[_0x20ea('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x20ea('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x20ea('0x1')]},'name':{'type':Sequelize[_0x20ea('0x3')],'get':function(){return this[_0x20ea('0x4')](_0x20ea('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b9f7f51..091a42a 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 _0xe181=['The\x20inserted\x20key\x20already\x20exists.','create','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','CannedAnswer','includeAll','include','catch','keys','length','find','params','body','MailAccountId','OpenchannelAccountId','ChatWebsiteId'];(function(_0x4e7c0c,_0x4bcbaa){var _0x15f0a9=function(_0x544d4e){while(--_0x544d4e){_0x4e7c0c['push'](_0x4e7c0c['shift']());}};_0x15f0a9(++_0x4bcbaa);}(_0xe181,0x109));var _0x1e18=function(_0xd49e15,_0x5e34ac){_0xd49e15=_0xd49e15-0x0;var _0x306b6a=_0xe181[_0xd49e15];return _0x306b6a;};'use strict';var emlformat=require(_0x1e18('0x0'));var rimraf=require(_0x1e18('0x1'));var zipdir=require(_0x1e18('0x2'));var jsonpatch=require(_0x1e18('0x3'));var rp=require('request-promise');var moment=require(_0x1e18('0x4'));var BPromise=require(_0x1e18('0x5'));var Mustache=require('mustache');var util=require(_0x1e18('0x6'));var path=require(_0x1e18('0x7'));var sox=require(_0x1e18('0x8'));var csv=require(_0x1e18('0x9'));var ejs=require(_0x1e18('0xa'));var fs=require('fs');var fs_extra=require(_0x1e18('0xb'));var _=require(_0x1e18('0xc'));var squel=require(_0x1e18('0xd'));var crypto=require(_0x1e18('0xe'));var jsforce=require(_0x1e18('0xf'));var deskjs=require(_0x1e18('0x10'));var toCsv=require(_0x1e18('0x9'));var querystring=require('querystring');var Papa=require(_0x1e18('0x11'));var Redis=require('ioredis');var authService=require(_0x1e18('0x12'));var qs=require(_0x1e18('0x13'));var as=require(_0x1e18('0x14'));var hardwareService=require(_0x1e18('0x15'));var logger=require('../../config/logger')(_0x1e18('0x16'));var utils=require(_0x1e18('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1e18('0x18'));var db=require(_0x1e18('0x19'))['db'];function respondWithStatusCode(_0x1bf1f4,_0x240beb){_0x240beb=_0x240beb||0xcc;return function(_0xae8da3){if(_0xae8da3){return _0x1bf1f4['sendStatus'](_0x240beb);}return _0x1bf1f4[_0x1e18('0x1a')](_0x240beb)[_0x1e18('0x1b')]();};}function respondWithResult(_0x355a65,_0x24881c){_0x24881c=_0x24881c||0xc8;return function(_0xf8f007){if(_0xf8f007){return _0x355a65[_0x1e18('0x1a')](_0x24881c)['json'](_0xf8f007);}};}function respondWithFilteredResult(_0x57ff6a,_0x308c6f){return function(_0x4cd8cd){if(_0x4cd8cd){var _0x76612e=typeof _0x308c6f[_0x1e18('0x1c')]===_0x1e18('0x1d')&&typeof _0x308c6f[_0x1e18('0x1e')]===_0x1e18('0x1d');var _0x53e268=_0x4cd8cd[_0x1e18('0x1f')];var _0x42ba39=_0x76612e?0x0:_0x308c6f['offset'];var _0x6512a=_0x76612e?_0x4cd8cd[_0x1e18('0x1f')]:_0x308c6f[_0x1e18('0x1c')]+_0x308c6f[_0x1e18('0x1e')];var _0x11e729;if(_0x6512a>=_0x53e268){_0x6512a=_0x53e268;_0x11e729=0xc8;}else{_0x11e729=0xce;}_0x57ff6a['status'](_0x11e729);return _0x57ff6a[_0x1e18('0x20')](_0x1e18('0x21'),_0x42ba39+'-'+_0x6512a+'/'+_0x53e268)[_0x1e18('0x22')](_0x4cd8cd);}return null;};}function patchUpdates(_0x4f7f97){return function(_0x252829){try{jsonpatch[_0x1e18('0x23')](_0x252829,_0x4f7f97,!![]);}catch(_0xd707c3){return BPromise[_0x1e18('0x24')](_0xd707c3);}return _0x252829['save']();};}function saveUpdates(_0x35c18c,_0x1ecddb){return function(_0x3b7cf0){if(_0x3b7cf0){return _0x3b7cf0[_0x1e18('0x25')](_0x35c18c)[_0x1e18('0x26')](function(_0x12a3c5){return _0x12a3c5;});}return null;};}function removeEntity(_0x4e1796,_0x28238f){return function(_0x225110){if(_0x225110){return _0x225110[_0x1e18('0x27')]()[_0x1e18('0x26')](function(){var _0x4fcba2=_0x225110[_0x1e18('0x28')]({'plain':!![]});var _0x18db1a=_0x1e18('0x29');return db['UserProfileResource'][_0x1e18('0x27')]({'where':{'type':_0x18db1a,'resourceId':_0x4fcba2['id']}})[_0x1e18('0x26')](function(){return _0x225110;});})[_0x1e18('0x26')](function(){_0x4e1796['status'](0xcc)[_0x1e18('0x1b')]();});}};}function handleEntityNotFound(_0x3fcad0,_0x51b9e9){return function(_0x193a2d){if(!_0x193a2d){_0x3fcad0[_0x1e18('0x2a')](0x194);}return _0x193a2d;};}function handleError(_0x50bd61,_0x390730){_0x390730=_0x390730||0x1f4;return function(_0x51530f){logger[_0x1e18('0x2b')](_0x51530f[_0x1e18('0x2c')]);if(_0x51530f[_0x1e18('0x2d')]){delete _0x51530f['name'];}_0x50bd61[_0x1e18('0x1a')](_0x390730)[_0x1e18('0x2e')](_0x51530f);};}exports[_0x1e18('0x2f')]=function(_0x2e8449,_0x2766da){var _0x20ccd0={},_0x845875={},_0x47c054={'count':0x0,'rows':[]};var _0x58e327=_[_0x1e18('0x30')](db['CannedAnswer'][_0x1e18('0x31')],function(_0x1647ed){return{'name':_0x1647ed[_0x1e18('0x32')],'type':_0x1647ed[_0x1e18('0x33')][_0x1e18('0x34')]};});_0x845875[_0x1e18('0x35')]=_[_0x1e18('0x30')](_0x58e327,_0x1e18('0x2d'));_0x845875[_0x1e18('0x36')]=_['keys'](_0x2e8449[_0x1e18('0x36')]);_0x845875['filters']=_[_0x1e18('0x37')](_0x845875[_0x1e18('0x35')],_0x845875['query']);_0x20ccd0[_0x1e18('0x38')]=_['intersection'](_0x845875[_0x1e18('0x35')],qs['fields'](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x39')]));_0x20ccd0[_0x1e18('0x38')]=_0x20ccd0['attributes']['length']?_0x20ccd0[_0x1e18('0x38')]:_0x845875['model'];if(!_0x2e8449['query']['hasOwnProperty'](_0x1e18('0x3a'))){_0x20ccd0[_0x1e18('0x1e')]=qs[_0x1e18('0x1e')](_0x2e8449[_0x1e18('0x36')]['limit']);_0x20ccd0[_0x1e18('0x1c')]=qs['offset'](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x1c')]);}_0x20ccd0[_0x1e18('0x3b')]=qs[_0x1e18('0x3c')](_0x2e8449[_0x1e18('0x36')][_0x1e18('0x3c')]);_0x20ccd0[_0x1e18('0x3d')]=qs[_0x1e18('0x3e')](_[_0x1e18('0x3f')](_0x2e8449['query'],_0x845875[_0x1e18('0x3e')]),_0x58e327);if(_0x2e8449[_0x1e18('0x36')][_0x1e18('0x40')]){_0x20ccd0[_0x1e18('0x3d')]=_[_0x1e18('0x41')](_0x20ccd0[_0x1e18('0x3d')],{'$or':[{'key':{'$like':'%'+_0x2e8449['query']['filter']+'%'}},{'value':{'$like':'%'+_0x2e8449[_0x1e18('0x36')][_0x1e18('0x40')]+'%'}}]});}_0x20ccd0=_['merge']({},_0x20ccd0,_0x2e8449[_0x1e18('0x42')]);var _0x388e01={'where':_0x20ccd0[_0x1e18('0x3d')]};return db[_0x1e18('0x43')][_0x1e18('0x1f')](_0x388e01)['then'](function(_0x250a30){_0x47c054[_0x1e18('0x1f')]=_0x250a30;if(_0x2e8449[_0x1e18('0x36')][_0x1e18('0x44')]){_0x20ccd0[_0x1e18('0x45')]=[{'all':!![]}];}return db[_0x1e18('0x43')]['findAll'](_0x20ccd0);})['then'](function(_0x4eaf90){_0x47c054['rows']=_0x4eaf90;return _0x47c054;})[_0x1e18('0x26')](respondWithFilteredResult(_0x2766da,_0x20ccd0))[_0x1e18('0x46')](handleError(_0x2766da,null));};exports['show']=function(_0x46f218,_0x4287e7){var _0x32b45d={'raw':!![],'where':{'id':_0x46f218['params']['id']}},_0x157519={};_0x157519['model']=_[_0x1e18('0x47')](db[_0x1e18('0x43')][_0x1e18('0x31')]);_0x157519[_0x1e18('0x36')]=_[_0x1e18('0x47')](_0x46f218['query']);_0x157519[_0x1e18('0x3e')]=_['intersection'](_0x157519[_0x1e18('0x35')],_0x157519[_0x1e18('0x36')]);_0x32b45d['attributes']=_['intersection'](_0x157519[_0x1e18('0x35')],qs[_0x1e18('0x39')](_0x46f218[_0x1e18('0x36')][_0x1e18('0x39')]));_0x32b45d['attributes']=_0x32b45d['attributes'][_0x1e18('0x48')]?_0x32b45d['attributes']:_0x157519['model'];if(_0x46f218[_0x1e18('0x36')][_0x1e18('0x44')]){_0x32b45d['include']=[{'all':!![]}];}_0x32b45d=_[_0x1e18('0x41')]({},_0x32b45d,_0x46f218[_0x1e18('0x42')]);return db[_0x1e18('0x43')][_0x1e18('0x49')](_0x32b45d)['then'](handleEntityNotFound(_0x4287e7,null))[_0x1e18('0x26')](respondWithResult(_0x4287e7,null))[_0x1e18('0x46')](handleError(_0x4287e7,null));};exports[_0x1e18('0x25')]=function(_0xeef8a9,_0x42d3f2){if(_0xeef8a9['body']['id']){delete _0xeef8a9['body']['id'];}return db['CannedAnswer'][_0x1e18('0x49')]({'where':{'id':_0xeef8a9[_0x1e18('0x4a')]['id']}})['then'](handleEntityNotFound(_0x42d3f2,null))[_0x1e18('0x26')](saveUpdates(_0xeef8a9[_0x1e18('0x4b')],null))[_0x1e18('0x26')](respondWithResult(_0x42d3f2,null))[_0x1e18('0x46')](handleError(_0x42d3f2,null));};exports[_0x1e18('0x27')]=function(_0x420084,_0x93f745){return db[_0x1e18('0x43')][_0x1e18('0x49')]({'where':{'id':_0x420084[_0x1e18('0x4a')]['id']}})[_0x1e18('0x26')](handleEntityNotFound(_0x93f745,null))['then'](removeEntity(_0x93f745,null))[_0x1e18('0x46')](handleError(_0x93f745,null));};exports['create']=function(_0x4428e0,_0x443f46){var _0x49a573={'key':_0x4428e0[_0x1e18('0x4b')]['key']};if(_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4c')]){_0x49a573['MailAccountId']=_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4c')];}else if(_0x4428e0[_0x1e18('0x4b')]['SmsAccountId']){_0x49a573['SmsAccountId']=_0x4428e0[_0x1e18('0x4b')]['SmsAccountId'];}else if(_0x4428e0['body'][_0x1e18('0x4d')]){_0x49a573[_0x1e18('0x4d')]=_0x4428e0[_0x1e18('0x4b')]['OpenchannelAccountId'];}else if(_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4e')]){_0x49a573['ChatWebsiteId']=_0x4428e0[_0x1e18('0x4b')][_0x1e18('0x4e')];}return db[_0x1e18('0x43')][_0x1e18('0x49')]({'where':_0x49a573})[_0x1e18('0x26')](function(_0x58bf26){if(_0x58bf26){throw new db['Sequelize']['ValidationError'](_0x1e18('0x4f'));}return db['CannedAnswer'][_0x1e18('0x50')](_0x4428e0[_0x1e18('0x4b')]);})[_0x1e18('0x26')](function(_0x2a283f){var _0x3297ac=_0x4428e0[_0x1e18('0x51')][_0x1e18('0x28')]({'plain':!![]});if(!_0x3297ac)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3297ac[_0x1e18('0x52')]==='user'){var _0x4952ee=_0x2a283f[_0x1e18('0x28')]({'plain':!![]});return db[_0x1e18('0x53')][_0x1e18('0x49')]({'where':{'name':_0x1e18('0x29'),'userProfileId':_0x3297ac[_0x1e18('0x54')]},'raw':!![]})[_0x1e18('0x26')](function(_0x2994b3){if(_0x2994b3&&_0x2994b3['autoAssociation']===0x0){return db['UserProfileResource'][_0x1e18('0x50')]({'name':_0x4952ee[_0x1e18('0x2d')],'resourceId':_0x4952ee['id'],'type':_0x2994b3[_0x1e18('0x2d')],'sectionId':_0x2994b3['id']},{})[_0x1e18('0x26')](function(){return _0x2a283f;});}else{return _0x2a283f;}})['catch'](function(_0x22d6f6){logger[_0x1e18('0x2b')](_0x1e18('0x55'),_0x22d6f6);throw _0x22d6f6;});}return _0x2a283f;})[_0x1e18('0x26')](respondWithResult(_0x443f46,0xc9))[_0x1e18('0x46')](handleError(_0x443f46,null));}; \ No newline at end of file +var _0xe8f5=['../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','status','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','CannedAnswer','findAll','rows','catch','params','options','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch'];(function(_0x1d5b27,_0x58e662){var _0xd507df=function(_0x598e2d){while(--_0x598e2d){_0x1d5b27['push'](_0x1d5b27['shift']());}};_0xd507df(++_0x58e662);}(_0xe8f5,0x1a6));var _0x5e8f=function(_0xacc97a,_0x3a0645){_0xacc97a=_0xacc97a-0x0;var _0x3839ff=_0xe8f5[_0xacc97a];return _0x3839ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5e8f('0x0'));var zipdir=require(_0x5e8f('0x1'));var jsonpatch=require(_0x5e8f('0x2'));var rp=require(_0x5e8f('0x3'));var moment=require(_0x5e8f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5e8f('0x5'));var util=require('util');var path=require(_0x5e8f('0x6'));var sox=require(_0x5e8f('0x7'));var csv=require(_0x5e8f('0x8'));var ejs=require(_0x5e8f('0x9'));var fs=require('fs');var fs_extra=require(_0x5e8f('0xa'));var _=require(_0x5e8f('0xb'));var squel=require(_0x5e8f('0xc'));var crypto=require('crypto');var jsforce=require(_0x5e8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x5e8f('0x8'));var querystring=require(_0x5e8f('0xe'));var Papa=require('papaparse');var Redis=require(_0x5e8f('0xf'));var authService=require(_0x5e8f('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x5e8f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5e8f('0x12'));var config=require(_0x5e8f('0x13'));var licenseUtil=require(_0x5e8f('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b553b,_0xc3ba01){_0xc3ba01=_0xc3ba01||0xcc;return function(_0x20f7b9){if(_0x20f7b9){return _0x4b553b[_0x5e8f('0x15')](_0xc3ba01);}return _0x4b553b['status'](_0xc3ba01)[_0x5e8f('0x16')]();};}function respondWithResult(_0x3d25be,_0x1fa68c){_0x1fa68c=_0x1fa68c||0xc8;return function(_0x1020f6){if(_0x1020f6){return _0x3d25be['status'](_0x1fa68c)[_0x5e8f('0x17')](_0x1020f6);}};}function respondWithFilteredResult(_0x184826,_0x26f6f9){return function(_0xe35ada){if(_0xe35ada){var _0x2a5938=typeof _0x26f6f9[_0x5e8f('0x18')]==='undefined'&&typeof _0x26f6f9[_0x5e8f('0x19')]===_0x5e8f('0x1a');var _0x18a4ee=_0xe35ada[_0x5e8f('0x1b')];var _0x1cb31c=_0x2a5938?0x0:_0x26f6f9['offset'];var _0x26b721=_0x2a5938?_0xe35ada[_0x5e8f('0x1b')]:_0x26f6f9[_0x5e8f('0x18')]+_0x26f6f9[_0x5e8f('0x19')];var _0x383381;if(_0x26b721>=_0x18a4ee){_0x26b721=_0x18a4ee;_0x383381=0xc8;}else{_0x383381=0xce;}_0x184826['status'](_0x383381);return _0x184826['set'](_0x5e8f('0x1c'),_0x1cb31c+'-'+_0x26b721+'/'+_0x18a4ee)[_0x5e8f('0x17')](_0xe35ada);}return null;};}function patchUpdates(_0x4aa8c9){return function(_0x28a516){try{jsonpatch[_0x5e8f('0x1d')](_0x28a516,_0x4aa8c9,!![]);}catch(_0x35e564){return BPromise[_0x5e8f('0x1e')](_0x35e564);}return _0x28a516[_0x5e8f('0x1f')]();};}function saveUpdates(_0x10ef0b,_0x1d7202){return function(_0xbc1793){if(_0xbc1793){return _0xbc1793[_0x5e8f('0x20')](_0x10ef0b)[_0x5e8f('0x21')](function(_0x47f0d7){return _0x47f0d7;});}return null;};}function removeEntity(_0x17e301,_0x41ef4c){return function(_0x3c38d7){if(_0x3c38d7){return _0x3c38d7[_0x5e8f('0x22')]()[_0x5e8f('0x21')](function(){var _0x366007=_0x3c38d7[_0x5e8f('0x23')]({'plain':!![]});var _0x53570c=_0x5e8f('0x24');return db[_0x5e8f('0x25')]['destroy']({'where':{'type':_0x53570c,'resourceId':_0x366007['id']}})[_0x5e8f('0x21')](function(){return _0x3c38d7;});})['then'](function(){_0x17e301[_0x5e8f('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6f9cd5,_0x378220){return function(_0x5d67db){if(!_0x5d67db){_0x6f9cd5[_0x5e8f('0x15')](0x194);}return _0x5d67db;};}function handleError(_0x5271fd,_0x5a7f32){_0x5a7f32=_0x5a7f32||0x1f4;return function(_0x745ab2){logger[_0x5e8f('0x27')](_0x745ab2[_0x5e8f('0x28')]);if(_0x745ab2['name']){delete _0x745ab2[_0x5e8f('0x29')];}_0x5271fd[_0x5e8f('0x26')](_0x5a7f32)['send'](_0x745ab2);};}exports[_0x5e8f('0x2a')]=function(_0xd4063d,_0x414397){var _0x4d5682={},_0x30a1c2={},_0x5abe29={'count':0x0,'rows':[]};var _0x5be419=_['map'](db['CannedAnswer'][_0x5e8f('0x2b')],function(_0xc6a068){return{'name':_0xc6a068[_0x5e8f('0x2c')],'type':_0xc6a068[_0x5e8f('0x2d')][_0x5e8f('0x2e')]};});_0x30a1c2[_0x5e8f('0x2f')]=_[_0x5e8f('0x30')](_0x5be419,_0x5e8f('0x29'));_0x30a1c2[_0x5e8f('0x31')]=_[_0x5e8f('0x32')](_0xd4063d['query']);_0x30a1c2[_0x5e8f('0x33')]=_['intersection'](_0x30a1c2[_0x5e8f('0x2f')],_0x30a1c2[_0x5e8f('0x31')]);_0x4d5682[_0x5e8f('0x34')]=_[_0x5e8f('0x35')](_0x30a1c2[_0x5e8f('0x2f')],qs[_0x5e8f('0x36')](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x36')]));_0x4d5682[_0x5e8f('0x34')]=_0x4d5682[_0x5e8f('0x34')][_0x5e8f('0x37')]?_0x4d5682[_0x5e8f('0x34')]:_0x30a1c2[_0x5e8f('0x2f')];if(!_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x38')](_0x5e8f('0x39'))){_0x4d5682[_0x5e8f('0x19')]=qs['limit'](_0xd4063d['query'][_0x5e8f('0x19')]);_0x4d5682[_0x5e8f('0x18')]=qs['offset'](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x18')]);}_0x4d5682[_0x5e8f('0x3a')]=qs[_0x5e8f('0x3b')](_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3b')]);_0x4d5682['where']=qs[_0x5e8f('0x33')](_[_0x5e8f('0x3c')](_0xd4063d['query'],_0x30a1c2[_0x5e8f('0x33')]),_0x5be419);if(_0xd4063d['query'][_0x5e8f('0x3d')]){_0x4d5682[_0x5e8f('0x3e')]=_[_0x5e8f('0x3f')](_0x4d5682[_0x5e8f('0x3e')],{'$or':[{'key':{'$like':'%'+_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3d')]+'%'}},{'value':{'$like':'%'+_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x3d')]+'%'}}]});}_0x4d5682=_['merge']({},_0x4d5682,_0xd4063d['options']);var _0x7be2ed={'where':_0x4d5682[_0x5e8f('0x3e')]};return db['CannedAnswer'][_0x5e8f('0x1b')](_0x7be2ed)['then'](function(_0x3128c3){_0x5abe29[_0x5e8f('0x1b')]=_0x3128c3;if(_0xd4063d[_0x5e8f('0x31')][_0x5e8f('0x40')]){_0x4d5682[_0x5e8f('0x41')]=[{'all':!![]}];}return db[_0x5e8f('0x42')][_0x5e8f('0x43')](_0x4d5682);})[_0x5e8f('0x21')](function(_0x4b0535){_0x5abe29[_0x5e8f('0x44')]=_0x4b0535;return _0x5abe29;})[_0x5e8f('0x21')](respondWithFilteredResult(_0x414397,_0x4d5682))[_0x5e8f('0x45')](handleError(_0x414397,null));};exports['show']=function(_0x1191f4,_0x1d4a81){var _0xb698b5={'raw':!![],'where':{'id':_0x1191f4[_0x5e8f('0x46')]['id']}},_0x4be6a0={};_0x4be6a0[_0x5e8f('0x2f')]=_[_0x5e8f('0x32')](db[_0x5e8f('0x42')]['rawAttributes']);_0x4be6a0[_0x5e8f('0x31')]=_[_0x5e8f('0x32')](_0x1191f4[_0x5e8f('0x31')]);_0x4be6a0[_0x5e8f('0x33')]=_[_0x5e8f('0x35')](_0x4be6a0['model'],_0x4be6a0[_0x5e8f('0x31')]);_0xb698b5[_0x5e8f('0x34')]=_[_0x5e8f('0x35')](_0x4be6a0[_0x5e8f('0x2f')],qs[_0x5e8f('0x36')](_0x1191f4[_0x5e8f('0x31')][_0x5e8f('0x36')]));_0xb698b5['attributes']=_0xb698b5['attributes'][_0x5e8f('0x37')]?_0xb698b5[_0x5e8f('0x34')]:_0x4be6a0['model'];if(_0x1191f4[_0x5e8f('0x31')][_0x5e8f('0x40')]){_0xb698b5[_0x5e8f('0x41')]=[{'all':!![]}];}_0xb698b5=_['merge']({},_0xb698b5,_0x1191f4[_0x5e8f('0x47')]);return db['CannedAnswer'][_0x5e8f('0x48')](_0xb698b5)[_0x5e8f('0x21')](handleEntityNotFound(_0x1d4a81,null))[_0x5e8f('0x21')](respondWithResult(_0x1d4a81,null))[_0x5e8f('0x45')](handleError(_0x1d4a81,null));};exports[_0x5e8f('0x20')]=function(_0xddb137,_0x29c4e4){if(_0xddb137[_0x5e8f('0x49')]['id']){delete _0xddb137['body']['id'];}return db['CannedAnswer']['find']({'where':{'id':_0xddb137[_0x5e8f('0x46')]['id']}})[_0x5e8f('0x21')](handleEntityNotFound(_0x29c4e4,null))[_0x5e8f('0x21')](saveUpdates(_0xddb137[_0x5e8f('0x49')],null))[_0x5e8f('0x21')](respondWithResult(_0x29c4e4,null))[_0x5e8f('0x45')](handleError(_0x29c4e4,null));};exports[_0x5e8f('0x22')]=function(_0x13f7e5,_0x3d7420){return db[_0x5e8f('0x42')][_0x5e8f('0x48')]({'where':{'id':_0x13f7e5[_0x5e8f('0x46')]['id']}})[_0x5e8f('0x21')](handleEntityNotFound(_0x3d7420,null))[_0x5e8f('0x21')](removeEntity(_0x3d7420,null))[_0x5e8f('0x45')](handleError(_0x3d7420,null));};exports[_0x5e8f('0x4a')]=function(_0x5063ce,_0x28e4f3){var _0x58a19c={'key':_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x2e')]};if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4b')]){_0x58a19c[_0x5e8f('0x4b')]=_0x5063ce['body'][_0x5e8f('0x4b')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4c')]){_0x58a19c[_0x5e8f('0x4c')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4c')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4d')]){_0x58a19c[_0x5e8f('0x4d')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4d')];}else if(_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4e')]){_0x58a19c[_0x5e8f('0x4e')]=_0x5063ce[_0x5e8f('0x49')][_0x5e8f('0x4e')];}return db[_0x5e8f('0x42')][_0x5e8f('0x48')]({'where':_0x58a19c})[_0x5e8f('0x21')](function(_0x5b8d78){if(_0x5b8d78){throw new db[(_0x5e8f('0x4f'))]['ValidationError'](_0x5e8f('0x50'));}return db['CannedAnswer'][_0x5e8f('0x4a')](_0x5063ce['body']);})['then'](function(_0x2e0916){var _0x30e720=_0x5063ce[_0x5e8f('0x51')][_0x5e8f('0x23')]({'plain':!![]});if(!_0x30e720)throw new Error(_0x5e8f('0x52'));if(_0x30e720[_0x5e8f('0x53')]===_0x5e8f('0x51')){var _0xb53d86=_0x2e0916[_0x5e8f('0x23')]({'plain':!![]});return db[_0x5e8f('0x54')]['find']({'where':{'name':_0x5e8f('0x24'),'userProfileId':_0x30e720[_0x5e8f('0x55')]},'raw':!![]})[_0x5e8f('0x21')](function(_0x366622){if(_0x366622&&_0x366622[_0x5e8f('0x56')]===0x0){return db[_0x5e8f('0x25')][_0x5e8f('0x4a')]({'name':_0xb53d86['name'],'resourceId':_0xb53d86['id'],'type':_0x366622[_0x5e8f('0x29')],'sectionId':_0x366622['id']},{})[_0x5e8f('0x21')](function(){return _0x2e0916;});}else{return _0x2e0916;}})[_0x5e8f('0x45')](function(_0x1203f4){logger[_0x5e8f('0x27')](_0x5e8f('0x57'),_0x1203f4);throw _0x1203f4;});}return _0x2e0916;})[_0x5e8f('0x21')](respondWithResult(_0x28e4f3,0xc9))[_0x5e8f('0x45')](handleError(_0x28e4f3,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index e131c29..73c975a 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 _0x9f95=['request-promise','path','rimraf','./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0x9f95,0x97));var _0x59f9=function(_0x1093dc,_0xa31577){_0x1093dc=_0x1093dc-0x0;var _0x53bdb3=_0x9f95[_0x1093dc];return _0x53bdb3;};'use strict';var _=require(_0x59f9('0x0'));var util=require('util');var logger=require(_0x59f9('0x1'))(_0x59f9('0x2'));var moment=require(_0x59f9('0x3'));var BPromise=require(_0x59f9('0x4'));var rp=require(_0x59f9('0x5'));var fs=require('fs');var path=require(_0x59f9('0x6'));var rimraf=require(_0x59f9('0x7'));var config=require('../../config/environment');var attributes=require(_0x59f9('0x8'));module['exports']=function(_0x5e5229,_0x58b0d6){return _0x5e5229['define'](_0x59f9('0x9'),attributes,{'tableName':_0x59f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x59f9('0xb'),'collate':_0x59f9('0xc')});}; \ No newline at end of file +var _0x02f9=['bluebird','request-promise','rimraf','../../config/environment','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x223f48,_0x1bb823){var _0x333fe7=function(_0x11ef45){while(--_0x11ef45){_0x223f48['push'](_0x223f48['shift']());}};_0x333fe7(++_0x1bb823);}(_0x02f9,0x1db));var _0x902f=function(_0x395d71,_0x352d8c){_0x395d71=_0x395d71-0x0;var _0x41a8a3=_0x02f9[_0x395d71];return _0x41a8a3;};'use strict';var _=require(_0x902f('0x0'));var util=require(_0x902f('0x1'));var logger=require(_0x902f('0x2'))(_0x902f('0x3'));var moment=require(_0x902f('0x4'));var BPromise=require(_0x902f('0x5'));var rp=require(_0x902f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x902f('0x7'));var config=require(_0x902f('0x8'));var attributes=require(_0x902f('0x9'));module[_0x902f('0xa')]=function(_0x4c1616,_0x4afe9f){return _0x4c1616[_0x902f('0xb')](_0x902f('0xc'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x902f('0xd'),'collate':_0x902f('0xe')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index f0c44a0..1a2f141 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(_0x30455d,_0x2a3f2b){var _0xe88fd6=function(_0x354bc4){while(--_0x354bc4){_0x30455d['push'](_0x30455d['shift']());}};_0xe88fd6(++_0x2a3f2b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +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(_0x59f145,_0x1da9d8){var _0x395b82=function(_0x5ecb7f){while(--_0x5ecb7f){_0x59f145['push'](_0x59f145['shift']());}};_0x395b82(++_0x1da9d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 a6f4820..64866f0 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 _0x2a1a=['create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show'];(function(_0x51df7f,_0x215088){var _0x34d800=function(_0x18ea66){while(--_0x18ea66){_0x51df7f['push'](_0x51df7f['shift']());}};_0x34d800(++_0x215088);}(_0x2a1a,0x75));var _0xa2a1=function(_0x21b7b9,_0x4bb51c){_0x21b7b9=_0x21b7b9-0x0;var _0x432587=_0x2a1a[_0x21b7b9];return _0x432587;};'use strict';var multer=require(_0xa2a1('0x0'));var util=require(_0xa2a1('0x1'));var path=require('path');var timeout=require(_0xa2a1('0x2'));var express=require('express');var router=express[_0xa2a1('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xa2a1('0x4'));var config=require('../../config/environment');var controller=require(_0xa2a1('0x5'));router[_0xa2a1('0x6')]('/',auth[_0xa2a1('0x7')](),controller[_0xa2a1('0x8')]);router[_0xa2a1('0x6')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xa')]);router['post']('/',auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xb')]);router[_0xa2a1('0xc')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller['update']);router[_0xa2a1('0xd')](_0xa2a1('0x9'),auth[_0xa2a1('0x7')](),controller[_0xa2a1('0xe')]);module[_0xa2a1('0xf')]=router; \ No newline at end of file +var _0x6ab8=['create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post'];(function(_0x39ded1,_0xaee436){var _0x2e248e=function(_0x193df3){while(--_0x193df3){_0x39ded1['push'](_0x39ded1['shift']());}};_0x2e248e(++_0xaee436);}(_0x6ab8,0xe2));var _0x86ab=function(_0x4a5327,_0x237970){_0x4a5327=_0x4a5327-0x0;var _0x139a16=_0x6ab8[_0x4a5327];return _0x139a16;};'use strict';var multer=require(_0x86ab('0x0'));var util=require('util');var path=require(_0x86ab('0x1'));var timeout=require(_0x86ab('0x2'));var express=require(_0x86ab('0x3'));var router=express[_0x86ab('0x4')]();var fs_extra=require(_0x86ab('0x5'));var auth=require(_0x86ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x86ab('0x7'));var controller=require('./cannedAnswer.controller');router[_0x86ab('0x8')]('/',auth['isAuthenticated'](),controller[_0x86ab('0x9')]);router[_0x86ab('0x8')](_0x86ab('0xa'),auth[_0x86ab('0xb')](),controller[_0x86ab('0xc')]);router[_0x86ab('0xd')]('/',auth[_0x86ab('0xb')](),controller[_0x86ab('0xe')]);router[_0x86ab('0xf')]('/:id',auth[_0x86ab('0xb')](),controller[_0x86ab('0x10')]);router[_0x86ab('0x11')](_0x86ab('0xa'),auth[_0x86ab('0xb')](),controller[_0x86ab('0x12')]);module[_0x86ab('0x13')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 547588f..dd8ee7e 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 _0xf2fa=['sequelize','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3da693,_0x358562){var _0x321653=function(_0x3cafce){while(--_0x3cafce){_0x3da693['push'](_0x3da693['shift']());}};_0x321653(++_0x358562);}(_0xf2fa,0xd0));var _0xaf2f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf2fa[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xaf2f('0x0'));module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xaf2f('0x1')},'clid':{'type':Sequelize[_0xaf2f('0x2')]},'src':{'type':Sequelize[_0xaf2f('0x2')]},'dst':{'type':Sequelize[_0xaf2f('0x2')]},'dcontext':{'type':Sequelize[_0xaf2f('0x2')]},'channel':{'type':Sequelize[_0xaf2f('0x2')]},'dstchannel':{'type':Sequelize[_0xaf2f('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xaf2f('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xaf2f('0x2')]},'amaflags':{'type':Sequelize[_0xaf2f('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xaf2f('0x2')]},'userfield':{'type':Sequelize[_0xaf2f('0x2')]},'uniqueid':{'type':Sequelize[_0xaf2f('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xaf2f('0x2')]},'tag':{'type':Sequelize[_0xaf2f('0x2')]}}; \ No newline at end of file +var _0x99e9=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x2c6329,_0x598d7c){var _0x23545e=function(_0x46632b){while(--_0x46632b){_0x2c6329['push'](_0x2c6329['shift']());}};_0x23545e(++_0x598d7c);}(_0x99e9,0xb4));var _0x999e=function(_0x3c04ef,_0x9d110c){_0x3c04ef=_0x3c04ef-0x0;var _0x6a3a69=_0x99e9[_0x3c04ef];return _0x6a3a69;};'use strict';var Sequelize=require('sequelize');module[_0x999e('0x0')]={'calldate':{'type':Sequelize[_0x999e('0x1')],'allowNull':![],'defaultValue':_0x999e('0x2')},'clid':{'type':Sequelize[_0x999e('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x999e('0x3')]},'dcontext':{'type':Sequelize[_0x999e('0x3')]},'channel':{'type':Sequelize[_0x999e('0x3')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0x999e('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x999e('0x3')]},'amaflags':{'type':Sequelize[_0x999e('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x999e('0x3')]},'uniqueid':{'type':Sequelize[_0x999e('0x3')]},'linkedid':{'type':Sequelize[_0x999e('0x3')]},'sequence':{'type':Sequelize[_0x999e('0x3')]},'peeraccount':{'type':Sequelize[_0x999e('0x3')]},'type':{'type':Sequelize[_0x999e('0x3')]},'tag':{'type':Sequelize[_0x999e('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index f6700ae..a11efaf 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 _0x0207=['offset','limit','undefined','count','Content-Range','reject','save','update','then','destroy','end','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json'];(function(_0x36fed7,_0x4d0eb4){var _0x13adde=function(_0x219f83){while(--_0x219f83){_0x36fed7['push'](_0x36fed7['shift']());}};_0x13adde(++_0x4d0eb4);}(_0x0207,0x162));var _0x7020=function(_0x420ccc,_0x26959c){_0x420ccc=_0x420ccc-0x0;var _0x7ccd55=_0x0207[_0x420ccc];return _0x7ccd55;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7020('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7020('0x1'));var moment=require(_0x7020('0x2'));var BPromise=require(_0x7020('0x3'));var Mustache=require(_0x7020('0x4'));var util=require(_0x7020('0x5'));var path=require(_0x7020('0x6'));var sox=require(_0x7020('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7020('0x8'));var _=require(_0x7020('0x9'));var squel=require(_0x7020('0xa'));var crypto=require(_0x7020('0xb'));var jsforce=require(_0x7020('0xc'));var deskjs=require(_0x7020('0xd'));var toCsv=require(_0x7020('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7020('0xf'));var authService=require(_0x7020('0x10'));var qs=require(_0x7020('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7020('0x12'));var logger=require(_0x7020('0x13'))('api');var utils=require(_0x7020('0x14'));var config=require(_0x7020('0x15'));var licenseUtil=require(_0x7020('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2d7d79,_0x598198){_0x598198=_0x598198||0xcc;return function(_0xd41aed){if(_0xd41aed){return _0x2d7d79[_0x7020('0x17')](_0x598198);}return _0x2d7d79[_0x7020('0x18')](_0x598198)['end']();};}function respondWithResult(_0x9403e5,_0x5f5872){_0x5f5872=_0x5f5872||0xc8;return function(_0x3b8d60){if(_0x3b8d60){return _0x9403e5[_0x7020('0x18')](_0x5f5872)[_0x7020('0x19')](_0x3b8d60);}};}function respondWithFilteredResult(_0x176190,_0x17260e){return function(_0x308324){if(_0x308324){var _0x55c8b9=typeof _0x17260e[_0x7020('0x1a')]==='undefined'&&typeof _0x17260e[_0x7020('0x1b')]===_0x7020('0x1c');var _0x1a3569=_0x308324[_0x7020('0x1d')];var _0x4fe6f1=_0x55c8b9?0x0:_0x17260e[_0x7020('0x1a')];var _0x3ac2f6=_0x55c8b9?_0x308324[_0x7020('0x1d')]:_0x17260e[_0x7020('0x1a')]+_0x17260e[_0x7020('0x1b')];var _0x1a79fb;if(_0x3ac2f6>=_0x1a3569){_0x3ac2f6=_0x1a3569;_0x1a79fb=0xc8;}else{_0x1a79fb=0xce;}_0x176190['status'](_0x1a79fb);return _0x176190['set'](_0x7020('0x1e'),_0x4fe6f1+'-'+_0x3ac2f6+'/'+_0x1a3569)[_0x7020('0x19')](_0x308324);}return null;};}function patchUpdates(_0x1d1986){return function(_0xb96d30){try{jsonpatch['apply'](_0xb96d30,_0x1d1986,!![]);}catch(_0x382e06){return BPromise[_0x7020('0x1f')](_0x382e06);}return _0xb96d30[_0x7020('0x20')]();};}function saveUpdates(_0x860099,_0x493cc7){return function(_0xcc48f){if(_0xcc48f){return _0xcc48f[_0x7020('0x21')](_0x860099)[_0x7020('0x22')](function(_0x362705){return _0x362705;});}return null;};}function removeEntity(_0x384fe9,_0xe3f4d2){return function(_0x147986){if(_0x147986){return _0x147986[_0x7020('0x23')]()['then'](function(){_0x384fe9[_0x7020('0x18')](0xcc)[_0x7020('0x24')]();});}};}function handleEntityNotFound(_0x35b539,_0x5586f8){return function(_0x28f9f0){if(!_0x28f9f0){_0x35b539['sendStatus'](0x194);}return _0x28f9f0;};}function handleError(_0x496471,_0x50aecb){_0x50aecb=_0x50aecb||0x1f4;return function(_0x178cbd){logger['error'](_0x178cbd[_0x7020('0x25')]);if(_0x178cbd['name']){delete _0x178cbd[_0x7020('0x26')];}_0x496471[_0x7020('0x18')](_0x50aecb)[_0x7020('0x27')](_0x178cbd);};}exports[_0x7020('0x28')]=function(_0xb03bd6,_0x1dff20){var _0x2ba734={},_0x15a1cc={},_0xc51979={'count':0x0,'rows':[]};var _0x2c9c86=_[_0x7020('0x29')](db[_0x7020('0x2a')][_0x7020('0x2b')],function(_0x47a996){return{'name':_0x47a996[_0x7020('0x2c')],'type':_0x47a996[_0x7020('0x2d')][_0x7020('0x2e')]};});_0x15a1cc[_0x7020('0x2f')]=_[_0x7020('0x29')](_0x2c9c86,_0x7020('0x26'));_0x15a1cc[_0x7020('0x30')]=_[_0x7020('0x31')](_0xb03bd6[_0x7020('0x30')]);_0x15a1cc[_0x7020('0x32')]=_[_0x7020('0x33')](_0x15a1cc[_0x7020('0x2f')],_0x15a1cc[_0x7020('0x30')]);_0x2ba734[_0x7020('0x34')]=_['intersection'](_0x15a1cc[_0x7020('0x2f')],qs[_0x7020('0x35')](_0xb03bd6[_0x7020('0x30')][_0x7020('0x35')]));_0x2ba734[_0x7020('0x34')]=_0x2ba734[_0x7020('0x34')][_0x7020('0x36')]?_0x2ba734[_0x7020('0x34')]:_0x15a1cc[_0x7020('0x2f')];if(!_0xb03bd6[_0x7020('0x30')][_0x7020('0x37')](_0x7020('0x38'))){_0x2ba734[_0x7020('0x1b')]=qs[_0x7020('0x1b')](_0xb03bd6['query'][_0x7020('0x1b')]);_0x2ba734[_0x7020('0x1a')]=qs[_0x7020('0x1a')](_0xb03bd6['query'][_0x7020('0x1a')]);}_0x2ba734[_0x7020('0x39')]=qs[_0x7020('0x3a')](_0xb03bd6[_0x7020('0x30')][_0x7020('0x3a')]);_0x2ba734[_0x7020('0x3b')]=qs['filters'](_[_0x7020('0x3c')](_0xb03bd6['query'],_0x15a1cc['filters']),_0x2c9c86);if(_0xb03bd6['query'][_0x7020('0x3d')]){_0x2ba734[_0x7020('0x3b')]=_[_0x7020('0x3e')](_0x2ba734[_0x7020('0x3b')],{'$or':_[_0x7020('0x29')](_0x2c9c86,function(_0x4f1cca){if(_0x4f1cca['type']!==_0x7020('0x3f')){var _0x209d94={};_0x209d94[_0x4f1cca[_0x7020('0x26')]]={'$like':'%'+_0xb03bd6[_0x7020('0x30')]['filter']+'%'};return _0x209d94;}})});}_0x2ba734=_[_0x7020('0x3e')]({},_0x2ba734,_0xb03bd6['options']);var _0x35ebee={'where':_0x2ba734[_0x7020('0x3b')]};return db[_0x7020('0x2a')]['count'](_0x35ebee)['then'](function(_0x19b26a){_0xc51979['count']=_0x19b26a;if(_0xb03bd6[_0x7020('0x30')][_0x7020('0x40')]){_0x2ba734['include']=[{'all':!![]}];}return db[_0x7020('0x2a')][_0x7020('0x41')](_0x2ba734);})[_0x7020('0x22')](function(_0x4b4856){_0xc51979[_0x7020('0x42')]=_0x4b4856;return _0xc51979;})['then'](respondWithFilteredResult(_0x1dff20,_0x2ba734))[_0x7020('0x43')](handleError(_0x1dff20,null));};exports[_0x7020('0x44')]=function(_0xf5320b,_0x4d7dae){var _0x31ba95={'raw':!![],'where':{'id':_0xf5320b[_0x7020('0x45')]['id']}},_0xa389b0={};_0xa389b0[_0x7020('0x2f')]=_[_0x7020('0x31')](db['Cdr'][_0x7020('0x2b')]);_0xa389b0[_0x7020('0x30')]=_[_0x7020('0x31')](_0xf5320b[_0x7020('0x30')]);_0xa389b0['filters']=_[_0x7020('0x33')](_0xa389b0['model'],_0xa389b0['query']);_0x31ba95['attributes']=_[_0x7020('0x33')](_0xa389b0['model'],qs[_0x7020('0x35')](_0xf5320b[_0x7020('0x30')][_0x7020('0x35')]));_0x31ba95['attributes']=_0x31ba95[_0x7020('0x34')]['length']?_0x31ba95[_0x7020('0x34')]:_0xa389b0[_0x7020('0x2f')];if(_0xf5320b[_0x7020('0x30')][_0x7020('0x40')]){_0x31ba95[_0x7020('0x46')]=[{'all':!![]}];}_0x31ba95=_[_0x7020('0x3e')]({},_0x31ba95,_0xf5320b[_0x7020('0x47')]);return db[_0x7020('0x2a')][_0x7020('0x48')](_0x31ba95)[_0x7020('0x22')](handleEntityNotFound(_0x4d7dae,null))[_0x7020('0x22')](respondWithResult(_0x4d7dae,null))[_0x7020('0x43')](handleError(_0x4d7dae,null));};exports[_0x7020('0x49')]=function(_0x3b5fe3,_0x3dcf52){return db[_0x7020('0x2a')][_0x7020('0x49')](_0x3b5fe3[_0x7020('0x4a')],{})['then'](respondWithResult(_0x3dcf52,0xc9))[_0x7020('0x43')](handleError(_0x3dcf52,null));};exports[_0x7020('0x21')]=function(_0x1b8198,_0x2a3344){if(_0x1b8198[_0x7020('0x4a')]['id']){delete _0x1b8198['body']['id'];}return db['Cdr'][_0x7020('0x48')]({'where':{'id':_0x1b8198['params']['id']}})[_0x7020('0x22')](handleEntityNotFound(_0x2a3344,null))[_0x7020('0x22')](saveUpdates(_0x1b8198[_0x7020('0x4a')],null))[_0x7020('0x22')](respondWithResult(_0x2a3344,null))['catch'](handleError(_0x2a3344,null));};exports['destroy']=function(_0xfbd73a,_0x2a4656){return db[_0x7020('0x2a')][_0x7020('0x48')]({'where':{'id':_0xfbd73a[_0x7020('0x45')]['id']}})[_0x7020('0x22')](handleEntityNotFound(_0x2a4656,null))[_0x7020('0x22')](removeEntity(_0x2a4656,null))[_0x7020('0x43')](handleError(_0x2a4656,null));};exports[_0x7020('0x4b')]=function(_0x6ce509,_0x3b583b){return db[_0x7020('0x2a')]['describe']()['then'](respondWithResult(_0x3b583b,null))['catch'](handleError(_0x3b583b,null));}; \ No newline at end of file +var _0xeff8=['include','create','body','find','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','length'];(function(_0x36af89,_0x4529ea){var _0x48f345=function(_0x4639fc){while(--_0x4639fc){_0x36af89['push'](_0x36af89['shift']());}};_0x48f345(++_0x4529ea);}(_0xeff8,0x186));var _0x8eff=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xeff8[_0x4017b0];return _0x5ed4f7;};'use strict';var emlformat=require(_0x8eff('0x0'));var rimraf=require(_0x8eff('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8eff('0x2'));var rp=require(_0x8eff('0x3'));var moment=require(_0x8eff('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8eff('0x5'));var util=require(_0x8eff('0x6'));var path=require(_0x8eff('0x7'));var sox=require(_0x8eff('0x8'));var csv=require('to-csv');var ejs=require(_0x8eff('0x9'));var fs=require('fs');var fs_extra=require(_0x8eff('0xa'));var _=require(_0x8eff('0xb'));var squel=require(_0x8eff('0xc'));var crypto=require('crypto');var jsforce=require(_0x8eff('0xd'));var deskjs=require(_0x8eff('0xe'));var toCsv=require(_0x8eff('0xf'));var querystring=require(_0x8eff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8eff('0x11'));var qs=require(_0x8eff('0x12'));var as=require(_0x8eff('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8eff('0x14'))(_0x8eff('0x15'));var utils=require('../../config/utils');var config=require(_0x8eff('0x16'));var licenseUtil=require(_0x8eff('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a399e,_0x45f280){_0x45f280=_0x45f280||0xcc;return function(_0x43c914){if(_0x43c914){return _0x4a399e[_0x8eff('0x18')](_0x45f280);}return _0x4a399e[_0x8eff('0x19')](_0x45f280)[_0x8eff('0x1a')]();};}function respondWithResult(_0x56efdf,_0x3e7c01){_0x3e7c01=_0x3e7c01||0xc8;return function(_0x212a2e){if(_0x212a2e){return _0x56efdf[_0x8eff('0x19')](_0x3e7c01)[_0x8eff('0x1b')](_0x212a2e);}};}function respondWithFilteredResult(_0x228eb1,_0x4cfc91){return function(_0x16202e){if(_0x16202e){var _0xdbb753=typeof _0x4cfc91[_0x8eff('0x1c')]===_0x8eff('0x1d')&&typeof _0x4cfc91[_0x8eff('0x1e')]==='undefined';var _0x32b791=_0x16202e[_0x8eff('0x1f')];var _0x3cd1dc=_0xdbb753?0x0:_0x4cfc91[_0x8eff('0x1c')];var _0x2cd7c5=_0xdbb753?_0x16202e[_0x8eff('0x1f')]:_0x4cfc91[_0x8eff('0x1c')]+_0x4cfc91[_0x8eff('0x1e')];var _0x1b003c;if(_0x2cd7c5>=_0x32b791){_0x2cd7c5=_0x32b791;_0x1b003c=0xc8;}else{_0x1b003c=0xce;}_0x228eb1[_0x8eff('0x19')](_0x1b003c);return _0x228eb1[_0x8eff('0x20')](_0x8eff('0x21'),_0x3cd1dc+'-'+_0x2cd7c5+'/'+_0x32b791)[_0x8eff('0x1b')](_0x16202e);}return null;};}function patchUpdates(_0x2a7337){return function(_0xdbb7b5){try{jsonpatch[_0x8eff('0x22')](_0xdbb7b5,_0x2a7337,!![]);}catch(_0x5e157c){return BPromise[_0x8eff('0x23')](_0x5e157c);}return _0xdbb7b5[_0x8eff('0x24')]();};}function saveUpdates(_0x5a2492,_0x1c4ad3){return function(_0x5ea31f){if(_0x5ea31f){return _0x5ea31f[_0x8eff('0x25')](_0x5a2492)[_0x8eff('0x26')](function(_0x1ccc79){return _0x1ccc79;});}return null;};}function removeEntity(_0x59cc32,_0x1ee09c){return function(_0x4e891c){if(_0x4e891c){return _0x4e891c[_0x8eff('0x27')]()[_0x8eff('0x26')](function(){_0x59cc32['status'](0xcc)[_0x8eff('0x1a')]();});}};}function handleEntityNotFound(_0x5ec3d7,_0x40404b){return function(_0x3b698b){if(!_0x3b698b){_0x5ec3d7[_0x8eff('0x18')](0x194);}return _0x3b698b;};}function handleError(_0x41324b,_0x6359df){_0x6359df=_0x6359df||0x1f4;return function(_0x2e8067){logger['error'](_0x2e8067[_0x8eff('0x28')]);if(_0x2e8067[_0x8eff('0x29')]){delete _0x2e8067[_0x8eff('0x29')];}_0x41324b[_0x8eff('0x19')](_0x6359df)[_0x8eff('0x2a')](_0x2e8067);};}exports[_0x8eff('0x2b')]=function(_0x4cc146,_0x4ed3b8){var _0x44dcdb={},_0x472b19={},_0x17ff3f={'count':0x0,'rows':[]};var _0x5ce071=_[_0x8eff('0x2c')](db[_0x8eff('0x2d')][_0x8eff('0x2e')],function(_0x1da0fa){return{'name':_0x1da0fa[_0x8eff('0x2f')],'type':_0x1da0fa[_0x8eff('0x30')][_0x8eff('0x31')]};});_0x472b19[_0x8eff('0x32')]=_[_0x8eff('0x2c')](_0x5ce071,_0x8eff('0x29'));_0x472b19[_0x8eff('0x33')]=_[_0x8eff('0x34')](_0x4cc146['query']);_0x472b19[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],_0x472b19[_0x8eff('0x33')]);_0x44dcdb['attributes']=_[_0x8eff('0x36')](_0x472b19[_0x8eff('0x32')],qs['fields'](_0x4cc146['query'][_0x8eff('0x37')]));_0x44dcdb[_0x8eff('0x38')]=_0x44dcdb['attributes']['length']?_0x44dcdb['attributes']:_0x472b19[_0x8eff('0x32')];if(!_0x4cc146['query'][_0x8eff('0x39')]('nolimit')){_0x44dcdb[_0x8eff('0x1e')]=qs[_0x8eff('0x1e')](_0x4cc146[_0x8eff('0x33')][_0x8eff('0x1e')]);_0x44dcdb[_0x8eff('0x1c')]=qs[_0x8eff('0x1c')](_0x4cc146['query'][_0x8eff('0x1c')]);}_0x44dcdb['order']=qs[_0x8eff('0x3a')](_0x4cc146['query'][_0x8eff('0x3a')]);_0x44dcdb[_0x8eff('0x3b')]=qs[_0x8eff('0x35')](_[_0x8eff('0x3c')](_0x4cc146['query'],_0x472b19[_0x8eff('0x35')]),_0x5ce071);if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x3d')]){_0x44dcdb['where']=_[_0x8eff('0x3e')](_0x44dcdb[_0x8eff('0x3b')],{'$or':_[_0x8eff('0x2c')](_0x5ce071,function(_0x345bc7){if(_0x345bc7[_0x8eff('0x30')]!==_0x8eff('0x3f')){var _0x29f68e={};_0x29f68e[_0x345bc7[_0x8eff('0x29')]]={'$like':'%'+_0x4cc146[_0x8eff('0x33')]['filter']+'%'};return _0x29f68e;}})});}_0x44dcdb=_['merge']({},_0x44dcdb,_0x4cc146[_0x8eff('0x40')]);var _0x114f8e={'where':_0x44dcdb[_0x8eff('0x3b')]};return db[_0x8eff('0x2d')][_0x8eff('0x1f')](_0x114f8e)[_0x8eff('0x26')](function(_0x18b132){_0x17ff3f['count']=_0x18b132;if(_0x4cc146[_0x8eff('0x33')][_0x8eff('0x41')]){_0x44dcdb['include']=[{'all':!![]}];}return db[_0x8eff('0x2d')][_0x8eff('0x42')](_0x44dcdb);})[_0x8eff('0x26')](function(_0x18309b){_0x17ff3f[_0x8eff('0x43')]=_0x18309b;return _0x17ff3f;})[_0x8eff('0x26')](respondWithFilteredResult(_0x4ed3b8,_0x44dcdb))[_0x8eff('0x44')](handleError(_0x4ed3b8,null));};exports[_0x8eff('0x45')]=function(_0x6d0568,_0x480c4c){var _0x37f376={'raw':!![],'where':{'id':_0x6d0568[_0x8eff('0x46')]['id']}},_0x27a8c9={};_0x27a8c9[_0x8eff('0x32')]=_[_0x8eff('0x34')](db['Cdr'][_0x8eff('0x2e')]);_0x27a8c9['query']=_[_0x8eff('0x34')](_0x6d0568[_0x8eff('0x33')]);_0x27a8c9[_0x8eff('0x35')]=_[_0x8eff('0x36')](_0x27a8c9['model'],_0x27a8c9[_0x8eff('0x33')]);_0x37f376[_0x8eff('0x38')]=_[_0x8eff('0x36')](_0x27a8c9['model'],qs['fields'](_0x6d0568[_0x8eff('0x33')][_0x8eff('0x37')]));_0x37f376[_0x8eff('0x38')]=_0x37f376[_0x8eff('0x38')][_0x8eff('0x47')]?_0x37f376['attributes']:_0x27a8c9[_0x8eff('0x32')];if(_0x6d0568['query'][_0x8eff('0x41')]){_0x37f376[_0x8eff('0x48')]=[{'all':!![]}];}_0x37f376=_['merge']({},_0x37f376,_0x6d0568['options']);return db['Cdr']['find'](_0x37f376)['then'](handleEntityNotFound(_0x480c4c,null))['then'](respondWithResult(_0x480c4c,null))[_0x8eff('0x44')](handleError(_0x480c4c,null));};exports[_0x8eff('0x49')]=function(_0x33aa8d,_0x1b5fda){return db[_0x8eff('0x2d')][_0x8eff('0x49')](_0x33aa8d[_0x8eff('0x4a')],{})[_0x8eff('0x26')](respondWithResult(_0x1b5fda,0xc9))[_0x8eff('0x44')](handleError(_0x1b5fda,null));};exports[_0x8eff('0x25')]=function(_0x4c7013,_0x11e53c){if(_0x4c7013['body']['id']){delete _0x4c7013[_0x8eff('0x4a')]['id'];}return db[_0x8eff('0x2d')][_0x8eff('0x4b')]({'where':{'id':_0x4c7013[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x11e53c,null))[_0x8eff('0x26')](saveUpdates(_0x4c7013[_0x8eff('0x4a')],null))[_0x8eff('0x26')](respondWithResult(_0x11e53c,null))[_0x8eff('0x44')](handleError(_0x11e53c,null));};exports[_0x8eff('0x27')]=function(_0x2a4dbb,_0x452f7a){return db['Cdr'][_0x8eff('0x4b')]({'where':{'id':_0x2a4dbb[_0x8eff('0x46')]['id']}})[_0x8eff('0x26')](handleEntityNotFound(_0x452f7a,null))[_0x8eff('0x26')](removeEntity(_0x452f7a,null))[_0x8eff('0x44')](handleError(_0x452f7a,null));};exports[_0x8eff('0x4c')]=function(_0x16473d,_0x9eb0b9){return db[_0x8eff('0x2d')]['describe']()['then'](respondWithResult(_0x9eb0b9,null))[_0x8eff('0x44')](handleError(_0x9eb0b9,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 659586f..67d8a53 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x49b6f2,_0x3e9d41){var _0x4d46d8=function(_0x370467){while(--_0x370467){_0x49b6f2['push'](_0x49b6f2['shift']());}};_0x4d46d8(++_0x3e9d41);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0xb4ebab,_0x57c2f0){var _0x58d314=function(_0x19d2f2){while(--_0x19d2f2){_0xb4ebab['push'](_0xb4ebab['shift']());}};_0x58d314(++_0x57c2f0);}(_0x7a54,0x106));var _0x47a5=function(_0x73ad99,_0x5705ea){_0x73ad99=_0x73ad99-0x0;var _0x3a5b36=_0x7a54[_0x73ad99];return _0x3a5b36;};'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 fb9d80e..f81f321 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 _0x693f=['info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','Cdr,\x20%s,\x20%s','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then'];(function(_0x1bd1cf,_0x4f73bb){var _0x253604=function(_0x4211cf){while(--_0x4211cf){_0x1bd1cf['push'](_0x1bd1cf['shift']());}};_0x253604(++_0x4f73bb);}(_0x693f,0x16e));var _0xf693=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x693f[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var moment=require(_0xf693('0x2'));var BPromise=require('bluebird');var rs=require(_0xf693('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf693('0x4'))['db'];var utils=require(_0xf693('0x5'));var logger=require(_0xf693('0x6'))(_0xf693('0x7'));var config=require(_0xf693('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf693('0x9')][_0xf693('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5bfe86,_0x175890,_0x5e4ade){return new BPromise(function(_0x1875de,_0x34a575){return client['request'](_0x5bfe86,_0x5e4ade)[_0xf693('0xb')](function(_0x410dcc){logger[_0xf693('0xc')]('Cdr,\x20%s,\x20%s',_0x175890,_0xf693('0xd'));logger[_0xf693('0xe')](_0xf693('0xf'),_0x175890,_0xf693('0xd'),JSON['stringify'](_0x410dcc));if(_0x410dcc['error']){if(_0x410dcc[_0xf693('0x10')][_0xf693('0x11')]===0x1f4){logger[_0xf693('0x10')]('Cdr,\x20%s,\x20%s',_0x175890,_0x410dcc[_0xf693('0x10')]['message']);return _0x34a575(_0x410dcc[_0xf693('0x10')][_0xf693('0x12')]);}logger['error'](_0xf693('0x13'),_0x175890,_0x410dcc[_0xf693('0x10')][_0xf693('0x12')]);return _0x1875de(_0x410dcc[_0xf693('0x10')]['message']);}else{logger[_0xf693('0xc')](_0xf693('0x13'),_0x175890,_0xf693('0xd'));_0x1875de(_0x410dcc['result'][_0xf693('0x12')]);}})[_0xf693('0x14')](function(_0x2caaa1){logger[_0xf693('0x10')](_0xf693('0x13'),_0x175890,_0x2caaa1);_0x34a575(_0x2caaa1);});});} \ No newline at end of file +var _0x0435=['../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','error','code','Cdr,\x20%s,\x20%s','message','result','catch','randomstring','ioredis','../../mysqldb'];(function(_0x2b4b0b,_0x326eb3){var _0x4316e9=function(_0x37a483){while(--_0x37a483){_0x2b4b0b['push'](_0x2b4b0b['shift']());}};_0x4316e9(++_0x326eb3);}(_0x0435,0x12f));var _0x5043=function(_0xac9bb8,_0x4c1343){_0xac9bb8=_0xac9bb8-0x0;var _0x8c7c24=_0x0435[_0xac9bb8];return _0x8c7c24;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5043('0x0'));var fs=require('fs');var Redis=require(_0x5043('0x1'));var db=require(_0x5043('0x2'))['db'];var utils=require(_0x5043('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x5043('0x4'));var jayson=require(_0x5043('0x5'));var client=jayson[_0x5043('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0xaef61e,_0x3e2bcd,_0x276310){return new BPromise(function(_0x49c459,_0x252527){return client[_0x5043('0x7')](_0xaef61e,_0x276310)[_0x5043('0x8')](function(_0x347627){logger[_0x5043('0x9')]('Cdr,\x20%s,\x20%s',_0x3e2bcd,_0x5043('0xa'));logger['debug'](_0x5043('0xb'),_0x3e2bcd,_0x5043('0xa'),JSON['stringify'](_0x347627));if(_0x347627[_0x5043('0xc')]){if(_0x347627[_0x5043('0xc')][_0x5043('0xd')]===0x1f4){logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x347627[_0x5043('0xc')]['message']);return _0x252527(_0x347627[_0x5043('0xc')][_0x5043('0xf')]);}logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x347627[_0x5043('0xc')][_0x5043('0xf')]);return _0x49c459(_0x347627['error'][_0x5043('0xf')]);}else{logger[_0x5043('0x9')]('Cdr,\x20%s,\x20%s',_0x3e2bcd,'request\x20sent');_0x49c459(_0x347627[_0x5043('0x10')][_0x5043('0xf')]);}})[_0x5043('0x11')](function(_0x1e456d){logger['error'](_0x5043('0xe'),_0x3e2bcd,_0x1e456d);_0x252527(_0x1e456d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 1dbf5ef..3c6ec23 100644 --- a/server/api/cdr/index.js +++ b/server/api/cdr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x48a256,_0x530521){var _0x15c127=function(_0x701eca){while(--_0x701eca){_0x48a256['push'](_0x48a256['shift']());}};_0x15c127(++_0x530521);}(_0xb10b,0x12a));var _0xbb10=function(_0x4cc280,_0x3b77f3){_0x4cc280=_0x4cc280-0x0;var _0x16ed24=_0xb10b[_0x4cc280];return _0x16ed24;};'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(_0x486eff,_0x5cb3b0){var _0x95293b=function(_0x25b947){while(--_0x25b947){_0x486eff['push'](_0x486eff['shift']());}};_0x95293b(++_0x5cb3b0);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6687943..379ebe6 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 _0x7a80=['STRING','noop','*,*,*,*','sequelize','INTEGER'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x7a80,0x125));var _0x07a8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x7a80[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x07a8('0x0'));module['exports']={'priority':{'type':Sequelize[_0x07a8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x07a8('0x2')],'allowNull':![],'defaultValue':_0x07a8('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x07a8('0x2')]},'interval':{'type':Sequelize[_0x07a8('0x2')],'defaultValue':_0x07a8('0x4')}}; \ No newline at end of file +var _0xb30c=['sequelize','exports','INTEGER','noop','*,*,*,*'];(function(_0x4ab2b6,_0x2e4dd5){var _0x3bb690=function(_0x3388e7){while(--_0x3388e7){_0x4ab2b6['push'](_0x4ab2b6['shift']());}};_0x3bb690(++_0x2e4dd5);}(_0xb30c,0x122));var _0xcb30=function(_0xd363e9,_0x41739f){_0xd363e9=_0xd363e9-0x0;var _0x20a0c4=_0xb30c[_0xd363e9];return _0x20a0c4;};'use strict';var Sequelize=require(_0xcb30('0x0'));module[_0xcb30('0x1')]={'priority':{'type':Sequelize[_0xcb30('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xcb30('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcb30('0x4')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index dd78343..f556e4f 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 _0xc2af=['jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','destroy','error','name','send','model','keys','ChatApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','update','params','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel'];(function(_0xf28023,_0x2853f6){var _0x1aa966=function(_0x45fe6c){while(--_0x45fe6c){_0xf28023['push'](_0xf28023['shift']());}};_0x1aa966(++_0x2853f6);}(_0xc2af,0x1bc));var _0xfc2a=function(_0x26b5ab,_0x2e1f9b){_0x26b5ab=_0x26b5ab-0x0;var _0x5d0ce4=_0xc2af[_0x26b5ab];return _0x5d0ce4;};'use strict';var emlformat=require(_0xfc2a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc2a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfc2a('0x2'));var moment=require(_0xfc2a('0x3'));var BPromise=require(_0xfc2a('0x4'));var Mustache=require(_0xfc2a('0x5'));var util=require(_0xfc2a('0x6'));var path=require(_0xfc2a('0x7'));var sox=require(_0xfc2a('0x8'));var csv=require(_0xfc2a('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc2a('0xa'));var _=require('lodash');var squel=require(_0xfc2a('0xb'));var crypto=require('crypto');var jsforce=require(_0xfc2a('0xc'));var deskjs=require(_0xfc2a('0xd'));var toCsv=require(_0xfc2a('0x9'));var querystring=require(_0xfc2a('0xe'));var Papa=require('papaparse');var Redis=require(_0xfc2a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfc2a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc2a('0x11'));var logger=require(_0xfc2a('0x12'))(_0xfc2a('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfc2a('0x14'));var db=require(_0xfc2a('0x15'))['db'];function respondWithStatusCode(_0x771766,_0x41395e){_0x41395e=_0x41395e||0xcc;return function(_0x268993){if(_0x268993){return _0x771766[_0xfc2a('0x16')](_0x41395e);}return _0x771766[_0xfc2a('0x17')](_0x41395e)[_0xfc2a('0x18')]();};}function respondWithResult(_0xe4b058,_0x55574a){_0x55574a=_0x55574a||0xc8;return function(_0x4e6b7e){if(_0x4e6b7e){return _0xe4b058[_0xfc2a('0x17')](_0x55574a)[_0xfc2a('0x19')](_0x4e6b7e);}};}function respondWithFilteredResult(_0x594a59,_0x12dd07){return function(_0x2f311c){if(_0x2f311c){var _0x21654f=typeof _0x12dd07[_0xfc2a('0x1a')]===_0xfc2a('0x1b')&&typeof _0x12dd07[_0xfc2a('0x1c')]===_0xfc2a('0x1b');var _0x678f8d=_0x2f311c[_0xfc2a('0x1d')];var _0x1e1524=_0x21654f?0x0:_0x12dd07[_0xfc2a('0x1a')];var _0x39bcb2=_0x21654f?_0x2f311c[_0xfc2a('0x1d')]:_0x12dd07['offset']+_0x12dd07[_0xfc2a('0x1c')];var _0x15ff6d;if(_0x39bcb2>=_0x678f8d){_0x39bcb2=_0x678f8d;_0x15ff6d=0xc8;}else{_0x15ff6d=0xce;}_0x594a59['status'](_0x15ff6d);return _0x594a59[_0xfc2a('0x1e')]('Content-Range',_0x1e1524+'-'+_0x39bcb2+'/'+_0x678f8d)['json'](_0x2f311c);}return null;};}function patchUpdates(_0x3e88fe){return function(_0x2b7f5c){try{jsonpatch[_0xfc2a('0x1f')](_0x2b7f5c,_0x3e88fe,!![]);}catch(_0x40ed0b){return BPromise[_0xfc2a('0x20')](_0x40ed0b);}return _0x2b7f5c['save']();};}function saveUpdates(_0x722009,_0x4908d7){return function(_0x5432f2){if(_0x5432f2){return _0x5432f2['update'](_0x722009)[_0xfc2a('0x21')](function(_0x57b67c){return _0x57b67c;});}return null;};}function removeEntity(_0x4d6b68,_0x43e237){return function(_0x10396d){if(_0x10396d){return _0x10396d[_0xfc2a('0x22')]()[_0xfc2a('0x21')](function(){_0x4d6b68['status'](0xcc)[_0xfc2a('0x18')]();});}};}function handleEntityNotFound(_0x192f0b,_0x33574a){return function(_0x5ea9f8){if(!_0x5ea9f8){_0x192f0b[_0xfc2a('0x16')](0x194);}return _0x5ea9f8;};}function handleError(_0x24ff4e,_0x542c9e){_0x542c9e=_0x542c9e||0x1f4;return function(_0x55c0bc){logger[_0xfc2a('0x23')](_0x55c0bc['stack']);if(_0x55c0bc[_0xfc2a('0x24')]){delete _0x55c0bc[_0xfc2a('0x24')];}_0x24ff4e[_0xfc2a('0x17')](_0x542c9e)[_0xfc2a('0x25')](_0x55c0bc);};}exports['show']=function(_0x4fe30d,_0x5f4165){var _0x3bf69f={'raw':!![],'where':{'id':_0x4fe30d['params']['id']}},_0x1f91f5={};_0x1f91f5[_0xfc2a('0x26')]=_[_0xfc2a('0x27')](db[_0xfc2a('0x28')][_0xfc2a('0x29')]);_0x1f91f5[_0xfc2a('0x2a')]=_[_0xfc2a('0x27')](_0x4fe30d[_0xfc2a('0x2a')]);_0x1f91f5[_0xfc2a('0x2b')]=_[_0xfc2a('0x2c')](_0x1f91f5['model'],_0x1f91f5[_0xfc2a('0x2a')]);_0x3bf69f[_0xfc2a('0x2d')]=_[_0xfc2a('0x2c')](_0x1f91f5[_0xfc2a('0x26')],qs[_0xfc2a('0x2e')](_0x4fe30d[_0xfc2a('0x2a')][_0xfc2a('0x2e')]));_0x3bf69f[_0xfc2a('0x2d')]=_0x3bf69f[_0xfc2a('0x2d')][_0xfc2a('0x2f')]?_0x3bf69f[_0xfc2a('0x2d')]:_0x1f91f5[_0xfc2a('0x26')];if(_0x4fe30d['query'][_0xfc2a('0x30')]){_0x3bf69f[_0xfc2a('0x31')]=[{'all':!![]}];}_0x3bf69f=_[_0xfc2a('0x32')]({},_0x3bf69f,_0x4fe30d[_0xfc2a('0x33')]);return db['ChatApplication'][_0xfc2a('0x34')](_0x3bf69f)['then'](handleEntityNotFound(_0x5f4165,null))[_0xfc2a('0x21')](respondWithResult(_0x5f4165,null))['catch'](handleError(_0x5f4165,null));};exports[_0xfc2a('0x35')]=function(_0x1a423d,_0x53491a){if(_0x1a423d['body']['id']){delete _0x1a423d['body']['id'];}return db['ChatApplication'][_0xfc2a('0x34')]({'where':{'id':_0x1a423d[_0xfc2a('0x36')]['id']}})['then'](handleEntityNotFound(_0x53491a,null))['then'](saveUpdates(_0x1a423d[_0xfc2a('0x37')],null))[_0xfc2a('0x21')](respondWithResult(_0x53491a,null))[_0xfc2a('0x38')](handleError(_0x53491a,null));};exports[_0xfc2a('0x22')]=function(_0x30a32a,_0x5dde47){return db[_0xfc2a('0x28')][_0xfc2a('0x34')]({'where':{'id':_0x30a32a['params']['id']}})[_0xfc2a('0x21')](handleEntityNotFound(_0x5dde47,null))[_0xfc2a('0x21')](removeEntity(_0x5dde47,null))[_0xfc2a('0x38')](handleError(_0x5dde47,null));}; \ No newline at end of file +var _0xffdc=['attributes','fields','includeAll','options','ChatApplication','body','catch','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','show','params','model','rawAttributes','query','keys','filters','intersection'];(function(_0x56d196,_0x204092){var _0x30a8ee=function(_0x15c46d){while(--_0x15c46d){_0x56d196['push'](_0x56d196['shift']());}};_0x30a8ee(++_0x204092);}(_0xffdc,0x7f));var _0xcffd=function(_0x4a9b3f,_0x158971){_0x4a9b3f=_0x4a9b3f-0x0;var _0x48b4f0=_0xffdc[_0x4a9b3f];return _0x48b4f0;};'use strict';var emlformat=require(_0xcffd('0x0'));var rimraf=require(_0xcffd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcffd('0x2'));var rp=require(_0xcffd('0x3'));var moment=require('moment');var BPromise=require(_0xcffd('0x4'));var Mustache=require(_0xcffd('0x5'));var util=require(_0xcffd('0x6'));var path=require(_0xcffd('0x7'));var sox=require(_0xcffd('0x8'));var csv=require('to-csv');var ejs=require(_0xcffd('0x9'));var fs=require('fs');var fs_extra=require(_0xcffd('0xa'));var _=require(_0xcffd('0xb'));var squel=require(_0xcffd('0xc'));var crypto=require(_0xcffd('0xd'));var jsforce=require(_0xcffd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcffd('0xf'));var querystring=require(_0xcffd('0x10'));var Papa=require('papaparse');var Redis=require(_0xcffd('0x11'));var authService=require(_0xcffd('0x12'));var qs=require(_0xcffd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcffd('0x14'));var logger=require(_0xcffd('0x15'))(_0xcffd('0x16'));var utils=require(_0xcffd('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xcffd('0x18'))['db'];function respondWithStatusCode(_0x187ca8,_0x1340b0){_0x1340b0=_0x1340b0||0xcc;return function(_0x4ec693){if(_0x4ec693){return _0x187ca8[_0xcffd('0x19')](_0x1340b0);}return _0x187ca8['status'](_0x1340b0)['end']();};}function respondWithResult(_0x765795,_0x20e134){_0x20e134=_0x20e134||0xc8;return function(_0x4edde4){if(_0x4edde4){return _0x765795[_0xcffd('0x1a')](_0x20e134)[_0xcffd('0x1b')](_0x4edde4);}};}function respondWithFilteredResult(_0x3d1e6e,_0x32f579){return function(_0x4ec386){if(_0x4ec386){var _0x4921d1=typeof _0x32f579[_0xcffd('0x1c')]===_0xcffd('0x1d')&&typeof _0x32f579[_0xcffd('0x1e')]===_0xcffd('0x1d');var _0x867e85=_0x4ec386['count'];var _0x4216c4=_0x4921d1?0x0:_0x32f579['offset'];var _0x18e9e1=_0x4921d1?_0x4ec386[_0xcffd('0x1f')]:_0x32f579[_0xcffd('0x1c')]+_0x32f579[_0xcffd('0x1e')];var _0x33a27e;if(_0x18e9e1>=_0x867e85){_0x18e9e1=_0x867e85;_0x33a27e=0xc8;}else{_0x33a27e=0xce;}_0x3d1e6e[_0xcffd('0x1a')](_0x33a27e);return _0x3d1e6e[_0xcffd('0x20')](_0xcffd('0x21'),_0x4216c4+'-'+_0x18e9e1+'/'+_0x867e85)['json'](_0x4ec386);}return null;};}function patchUpdates(_0x73d51a){return function(_0x1f36f4){try{jsonpatch[_0xcffd('0x22')](_0x1f36f4,_0x73d51a,!![]);}catch(_0x4029a7){return BPromise[_0xcffd('0x23')](_0x4029a7);}return _0x1f36f4[_0xcffd('0x24')]();};}function saveUpdates(_0x1ad69f,_0x5d2d3c){return function(_0x52fc51){if(_0x52fc51){return _0x52fc51[_0xcffd('0x25')](_0x1ad69f)[_0xcffd('0x26')](function(_0x44f901){return _0x44f901;});}return null;};}function removeEntity(_0x3935ff,_0x3c3839){return function(_0x345a4d){if(_0x345a4d){return _0x345a4d[_0xcffd('0x27')]()[_0xcffd('0x26')](function(){_0x3935ff[_0xcffd('0x1a')](0xcc)[_0xcffd('0x28')]();});}};}function handleEntityNotFound(_0x37185d,_0x1f232a){return function(_0x544ae7){if(!_0x544ae7){_0x37185d[_0xcffd('0x19')](0x194);}return _0x544ae7;};}function handleError(_0x2b5044,_0x2c66a7){_0x2c66a7=_0x2c66a7||0x1f4;return function(_0x547bdb){logger[_0xcffd('0x29')](_0x547bdb[_0xcffd('0x2a')]);if(_0x547bdb[_0xcffd('0x2b')]){delete _0x547bdb['name'];}_0x2b5044['status'](_0x2c66a7)[_0xcffd('0x2c')](_0x547bdb);};}exports[_0xcffd('0x2d')]=function(_0x4b1c7d,_0x3cb0dd){var _0x6641e={'raw':!![],'where':{'id':_0x4b1c7d[_0xcffd('0x2e')]['id']}},_0x5a97cf={};_0x5a97cf[_0xcffd('0x2f')]=_['keys'](db['ChatApplication'][_0xcffd('0x30')]);_0x5a97cf[_0xcffd('0x31')]=_[_0xcffd('0x32')](_0x4b1c7d['query']);_0x5a97cf[_0xcffd('0x33')]=_[_0xcffd('0x34')](_0x5a97cf['model'],_0x5a97cf[_0xcffd('0x31')]);_0x6641e[_0xcffd('0x35')]=_['intersection'](_0x5a97cf[_0xcffd('0x2f')],qs['fields'](_0x4b1c7d[_0xcffd('0x31')][_0xcffd('0x36')]));_0x6641e['attributes']=_0x6641e[_0xcffd('0x35')]['length']?_0x6641e['attributes']:_0x5a97cf[_0xcffd('0x2f')];if(_0x4b1c7d[_0xcffd('0x31')][_0xcffd('0x37')]){_0x6641e['include']=[{'all':!![]}];}_0x6641e=_['merge']({},_0x6641e,_0x4b1c7d[_0xcffd('0x38')]);return db[_0xcffd('0x39')]['find'](_0x6641e)['then'](handleEntityNotFound(_0x3cb0dd,null))[_0xcffd('0x26')](respondWithResult(_0x3cb0dd,null))['catch'](handleError(_0x3cb0dd,null));};exports[_0xcffd('0x25')]=function(_0x19b027,_0x2144bc){if(_0x19b027[_0xcffd('0x3a')]['id']){delete _0x19b027[_0xcffd('0x3a')]['id'];}return db[_0xcffd('0x39')]['find']({'where':{'id':_0x19b027[_0xcffd('0x2e')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x2144bc,null))[_0xcffd('0x26')](saveUpdates(_0x19b027[_0xcffd('0x3a')],null))[_0xcffd('0x26')](respondWithResult(_0x2144bc,null))[_0xcffd('0x3b')](handleError(_0x2144bc,null));};exports['destroy']=function(_0xf81fb3,_0x4b9fc9){return db[_0xcffd('0x39')]['find']({'where':{'id':_0xf81fb3[_0xcffd('0x2e')]['id']}})[_0xcffd('0x26')](handleEntityNotFound(_0x4b9fc9,null))[_0xcffd('0x26')](removeEntity(_0x4b9fc9,null))[_0xcffd('0x3b')](handleError(_0x4b9fc9,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index b2d1004..fb40b0d 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 _0x6cd0=['utf8mb4','utf8mb4_unicode_ci','lodash','api','request-promise','path','../../config/environment','exports','ChatApplication','chat_applications'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x6cd0,0x1ce));var _0x06cd=function(_0x1d30e4,_0x5e44c7){_0x1d30e4=_0x1d30e4-0x0;var _0x416b9e=_0x6cd0[_0x1d30e4];return _0x416b9e;};'use strict';var _=require(_0x06cd('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x06cd('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06cd('0x2'));var fs=require('fs');var path=require(_0x06cd('0x3'));var rimraf=require('rimraf');var config=require(_0x06cd('0x4'));var attributes=require('./chatApplication.attributes');module[_0x06cd('0x5')]=function(_0x1c0f56,_0x4997de){return _0x1c0f56['define'](_0x06cd('0x6'),attributes,{'tableName':_0x06cd('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x06cd('0x8'),'collate':_0x06cd('0x9')});}; \ No newline at end of file +var _0x7884=['../../config/environment','exports','define','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf'];(function(_0x1b9d97,_0x19159b){var _0x1d7a29=function(_0x5456d9){while(--_0x5456d9){_0x1b9d97['push'](_0x1b9d97['shift']());}};_0x1d7a29(++_0x19159b);}(_0x7884,0x10d));var _0x4788=function(_0x29a5ca,_0x35103b){_0x29a5ca=_0x29a5ca-0x0;var _0x4af43f=_0x7884[_0x29a5ca];return _0x4af43f;};'use strict';var _=require(_0x4788('0x0'));var util=require(_0x4788('0x1'));var logger=require(_0x4788('0x2'))('api');var moment=require('moment');var BPromise=require(_0x4788('0x3'));var rp=require(_0x4788('0x4'));var fs=require('fs');var path=require(_0x4788('0x5'));var rimraf=require(_0x4788('0x6'));var config=require(_0x4788('0x7'));var attributes=require('./chatApplication.attributes');module[_0x4788('0x8')]=function(_0x1227fe,_0xaf9370){return _0x1227fe[_0x4788('0x9')]('ChatApplication',attributes,{'tableName':_0x4788('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4788('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 8fe759f..7e61a84 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 _0x34f9=['moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x34f9,0x1cc));var _0x934f=function(_0x39be6d,_0x575466){_0x39be6d=_0x39be6d-0x0;var _0x3bea28=_0x34f9[_0x39be6d];return _0x3bea28;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var moment=require(_0x934f('0x2'));var BPromise=require(_0x934f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x934f('0x4'));var db=require(_0x934f('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x934f('0x6'));var config=require(_0x934f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x934f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x109356,_0xdc5484,_0x50b105){return new BPromise(function(_0x1f2acb,_0x5e6f14){return client['request'](_0x109356,_0x50b105)[_0x934f('0x9')](function(_0x26b4f7){logger[_0x934f('0xa')](_0x934f('0xb'),_0xdc5484,_0x934f('0xc'));logger[_0x934f('0xd')](_0x934f('0xe'),_0xdc5484,_0x934f('0xc'),JSON[_0x934f('0xf')](_0x26b4f7));if(_0x26b4f7[_0x934f('0x10')]){if(_0x26b4f7['error'][_0x934f('0x11')]===0x1f4){logger['error'](_0x934f('0xb'),_0xdc5484,_0x26b4f7[_0x934f('0x10')][_0x934f('0x12')]);return _0x5e6f14(_0x26b4f7[_0x934f('0x10')][_0x934f('0x12')]);}logger[_0x934f('0x10')](_0x934f('0xb'),_0xdc5484,_0x26b4f7[_0x934f('0x10')]['message']);return _0x1f2acb(_0x26b4f7['error'][_0x934f('0x12')]);}else{logger[_0x934f('0xa')]('ChatApplication,\x20%s,\x20%s',_0xdc5484,_0x934f('0xc'));_0x1f2acb(_0x26b4f7[_0x934f('0x13')][_0x934f('0x12')]);}})[_0x934f('0x14')](function(_0x258381){logger[_0x934f('0x10')](_0x934f('0xb'),_0xdc5484,_0x258381);_0x5e6f14(_0x258381);});});} \ No newline at end of file +var _0xe091=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1e32b8,_0x1347a6){var _0x5ab379=function(_0x12b349){while(--_0x12b349){_0x1e32b8['push'](_0x1e32b8['shift']());}};_0x5ab379(++_0x1347a6);}(_0xe091,0xee));var _0x1e09=function(_0x472ad1,_0x5dbfef){_0x472ad1=_0x472ad1-0x0;var _0x416d54=_0xe091[_0x472ad1];return _0x416d54;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1e09('0x0'));var BPromise=require(_0x1e09('0x1'));var rs=require(_0x1e09('0x2'));var fs=require('fs');var Redis=require(_0x1e09('0x3'));var db=require(_0x1e09('0x4'))['db'];var utils=require(_0x1e09('0x5'));var logger=require('../../config/logger')(_0x1e09('0x6'));var config=require(_0x1e09('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x1e09('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3fed96,_0x3c1fdb,_0x189ae6){return new BPromise(function(_0x527da5,_0x191cce){return client[_0x1e09('0x9')](_0x3fed96,_0x189ae6)[_0x1e09('0xa')](function(_0xf42ebf){logger[_0x1e09('0xb')](_0x1e09('0xc'),_0x3c1fdb,_0x1e09('0xd'));logger[_0x1e09('0xe')](_0x1e09('0xf'),_0x3c1fdb,_0x1e09('0xd'),JSON[_0x1e09('0x10')](_0xf42ebf));if(_0xf42ebf['error']){if(_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x12')]===0x1f4){logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x13')]);return _0x191cce(_0xf42ebf[_0x1e09('0x11')][_0x1e09('0x13')]);}logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xf42ebf[_0x1e09('0x11')]['message']);return _0x527da5(_0xf42ebf['error']['message']);}else{logger[_0x1e09('0xb')](_0x1e09('0xc'),_0x3c1fdb,_0x1e09('0xd'));_0x527da5(_0xf42ebf['result'][_0x1e09('0x13')]);}})[_0x1e09('0x14')](function(_0xdd904b){logger[_0x1e09('0x11')](_0x1e09('0xc'),_0x3c1fdb,_0xdd904b);_0x191cce(_0xdd904b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 89a6177..ce9504e 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 _0x1269=['get','/:id','isAuthenticated','show','update','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x48e10a,_0x26461e){var _0x40d048=function(_0x1a9e61){while(--_0x1a9e61){_0x48e10a['push'](_0x48e10a['shift']());}};_0x40d048(++_0x26461e);}(_0x1269,0x1d7));var _0x9126=function(_0x516f52,_0x210b10){_0x516f52=_0x516f52-0x0;var _0x5d06db=_0x1269[_0x516f52];return _0x5d06db;};'use strict';var multer=require(_0x9126('0x0'));var util=require('util');var path=require(_0x9126('0x1'));var timeout=require(_0x9126('0x2'));var express=require(_0x9126('0x3'));var router=express[_0x9126('0x4')]();var fs_extra=require(_0x9126('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x9126('0x6'));var config=require(_0x9126('0x7'));var controller=require(_0x9126('0x8'));router[_0x9126('0x9')](_0x9126('0xa'),auth[_0x9126('0xb')](),controller[_0x9126('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x9126('0xd')]);router['delete'](_0x9126('0xa'),auth['isAuthenticated'](),controller[_0x9126('0xe')]);module[_0x9126('0xf')]=router; \ No newline at end of file +var _0x9deb=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','update'];(function(_0x2c98a0,_0x49f71c){var _0x4e58ac=function(_0x41b3d9){while(--_0x41b3d9){_0x2c98a0['push'](_0x2c98a0['shift']());}};_0x4e58ac(++_0x49f71c);}(_0x9deb,0x18f));var _0xb9de=function(_0x3d951d,_0x1a1aa5){_0x3d951d=_0x3d951d-0x0;var _0x2fa9bf=_0x9deb[_0x3d951d];return _0x2fa9bf;};'use strict';var multer=require(_0xb9de('0x0'));var util=require(_0xb9de('0x1'));var path=require(_0xb9de('0x2'));var timeout=require(_0xb9de('0x3'));var express=require(_0xb9de('0x4'));var router=express[_0xb9de('0x5')]();var fs_extra=require(_0xb9de('0x6'));var auth=require(_0xb9de('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb9de('0x8'));var controller=require(_0xb9de('0x9'));router[_0xb9de('0xa')](_0xb9de('0xb'),auth[_0xb9de('0xc')](),controller[_0xb9de('0xd')]);router['put']('/:id',auth[_0xb9de('0xc')](),controller[_0xb9de('0xe')]);router[_0xb9de('0xf')](_0xb9de('0xb'),auth['isAuthenticated'](),controller[_0xb9de('0x10')]);module[_0xb9de('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 51edb36..9f9bb53 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 _0x377e=['BOOLEAN','sequelize'];(function(_0x2405bc,_0x2f28a1){var _0x5272d4=function(_0x225294){while(--_0x225294){_0x2405bc['push'](_0x2405bc['shift']());}};_0x5272d4(++_0x2f28a1);}(_0x377e,0x1e9));var _0xe377=function(_0x2fc2e4,_0xf15e31){_0x2fc2e4=_0x2fc2e4-0x0;var _0x21d7b3=_0x377e[_0x2fc2e4];return _0x21d7b3;};'use strict';var Sequelize=require(_0xe377('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0xe377('0x1')],'defaultValue':!![]}}; \ No newline at end of file +var _0x16b9=['BOOLEAN','exports','STRING'];(function(_0x34afc1,_0x3dd494){var _0x496f9c=function(_0x4ec5ea){while(--_0x4ec5ea){_0x34afc1['push'](_0x34afc1['shift']());}};_0x496f9c(++_0x3dd494);}(_0x16b9,0xf1));var _0x916b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x16b9[_0x255d5b];return _0x3e141a;};'use strict';var Sequelize=require('sequelize');module[_0x916b('0x0')]={'name':{'type':Sequelize[_0x916b('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x916b('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index ea3656b..1c45e6a 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 _0x2e50=['show','params','rawAttributes','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','findOne','getMembers','removeMembers','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','rimraf','fast-json-patch','request-promise','bluebird','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','then','destroy','stack','name','send','index','ChatGroup','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows'];(function(_0x15f724,_0x2794ef){var _0x49b152=function(_0x561b35){while(--_0x561b35){_0x15f724['push'](_0x15f724['shift']());}};_0x49b152(++_0x2794ef);}(_0x2e50,0x192));var _0x02e5=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x2e50[_0x27d10a];return _0x63302e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02e5('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02e5('0x1'));var rp=require(_0x02e5('0x2'));var moment=require('moment');var BPromise=require(_0x02e5('0x3'));var Mustache=require(_0x02e5('0x4'));var util=require(_0x02e5('0x5'));var path=require(_0x02e5('0x6'));var sox=require(_0x02e5('0x7'));var csv=require(_0x02e5('0x8'));var ejs=require(_0x02e5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02e5('0xa'));var squel=require('squel');var crypto=require(_0x02e5('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x02e5('0xc'));var toCsv=require('to-csv');var querystring=require(_0x02e5('0xd'));var Papa=require(_0x02e5('0xe'));var Redis=require(_0x02e5('0xf'));var authService=require(_0x02e5('0x10'));var qs=require(_0x02e5('0x11'));var as=require(_0x02e5('0x12'));var hardwareService=require(_0x02e5('0x13'));var logger=require(_0x02e5('0x14'))(_0x02e5('0x15'));var utils=require(_0x02e5('0x16'));var config=require(_0x02e5('0x17'));var licenseUtil=require(_0x02e5('0x18'));var db=require(_0x02e5('0x19'))['db'];config['redis']=_['defaults'](config[_0x02e5('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02e5('0x1a')]));require(_0x02e5('0x1b'))[_0x02e5('0x1c')](socket);function respondWithStatusCode(_0x322419,_0x3ce1fd){_0x3ce1fd=_0x3ce1fd||0xcc;return function(_0x1ee7f6){if(_0x1ee7f6){return _0x322419[_0x02e5('0x1d')](_0x3ce1fd);}return _0x322419['status'](_0x3ce1fd)[_0x02e5('0x1e')]();};}function respondWithResult(_0x5b82dd,_0x5c6ee3){_0x5c6ee3=_0x5c6ee3||0xc8;return function(_0x46134b){if(_0x46134b){return _0x5b82dd[_0x02e5('0x1f')](_0x5c6ee3)['json'](_0x46134b);}};}function respondWithFilteredResult(_0x55710a,_0x43e706){return function(_0x1c3fd0){if(_0x1c3fd0){var _0x2829f0=typeof _0x43e706[_0x02e5('0x20')]===_0x02e5('0x21')&&typeof _0x43e706[_0x02e5('0x22')]===_0x02e5('0x21');var _0x128405=_0x1c3fd0[_0x02e5('0x23')];var _0x572bef=_0x2829f0?0x0:_0x43e706[_0x02e5('0x20')];var _0x23892e=_0x2829f0?_0x1c3fd0['count']:_0x43e706[_0x02e5('0x20')]+_0x43e706['limit'];var _0x104293;if(_0x23892e>=_0x128405){_0x23892e=_0x128405;_0x104293=0xc8;}else{_0x104293=0xce;}_0x55710a[_0x02e5('0x1f')](_0x104293);return _0x55710a[_0x02e5('0x24')](_0x02e5('0x25'),_0x572bef+'-'+_0x23892e+'/'+_0x128405)[_0x02e5('0x26')](_0x1c3fd0);}return null;};}function patchUpdates(_0x487831){return function(_0x3b0716){try{jsonpatch[_0x02e5('0x27')](_0x3b0716,_0x487831,!![]);}catch(_0x45e42b){return BPromise[_0x02e5('0x28')](_0x45e42b);}return _0x3b0716['save']();};}function saveUpdates(_0x1c6977,_0x527acc){return function(_0x32a44c){if(_0x32a44c){return _0x32a44c['update'](_0x1c6977)[_0x02e5('0x29')](function(_0x2b0700){return _0x2b0700;});}return null;};}function removeEntity(_0x317985,_0x428ec3){return function(_0x111981){if(_0x111981){return _0x111981[_0x02e5('0x2a')]()[_0x02e5('0x29')](function(){_0x317985['status'](0xcc)[_0x02e5('0x1e')]();});}};}function handleEntityNotFound(_0x225357,_0x55e7c7){return function(_0x14c022){if(!_0x14c022){_0x225357[_0x02e5('0x1d')](0x194);}return _0x14c022;};}function handleError(_0x219c5b,_0x48e19e){_0x48e19e=_0x48e19e||0x1f4;return function(_0x499e66){logger['error'](_0x499e66[_0x02e5('0x2b')]);if(_0x499e66[_0x02e5('0x2c')]){delete _0x499e66[_0x02e5('0x2c')];}_0x219c5b[_0x02e5('0x1f')](_0x48e19e)[_0x02e5('0x2d')](_0x499e66);};}exports[_0x02e5('0x2e')]=function(_0x11e6a0,_0x29e5e6){var _0x61f33c={},_0x361d47={},_0x54ad0b={'count':0x0,'rows':[]};var _0x14ec2c=_['map'](db[_0x02e5('0x2f')]['rawAttributes'],function(_0x4c46e2){return{'name':_0x4c46e2['fieldName'],'type':_0x4c46e2[_0x02e5('0x30')][_0x02e5('0x31')]};});_0x361d47[_0x02e5('0x32')]=_[_0x02e5('0x33')](_0x14ec2c,_0x02e5('0x2c'));_0x361d47[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x11e6a0['query']);_0x361d47[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x361d47[_0x02e5('0x32')],_0x361d47[_0x02e5('0x34')]);_0x61f33c[_0x02e5('0x38')]=_[_0x02e5('0x37')](_0x361d47[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x39')]));_0x61f33c[_0x02e5('0x38')]=_0x61f33c[_0x02e5('0x38')][_0x02e5('0x3a')]?_0x61f33c['attributes']:_0x361d47['model'];if(!_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x3b')](_0x02e5('0x3c'))){_0x61f33c[_0x02e5('0x22')]=qs['limit'](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x22')]);_0x61f33c[_0x02e5('0x20')]=qs[_0x02e5('0x20')](_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x20')]);}_0x61f33c[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x11e6a0['query'][_0x02e5('0x3e')]);_0x61f33c[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_[_0x02e5('0x40')](_0x11e6a0[_0x02e5('0x34')],_0x361d47[_0x02e5('0x36')]),_0x14ec2c);if(_0x11e6a0[_0x02e5('0x34')]['filter']){_0x61f33c[_0x02e5('0x3f')]=_[_0x02e5('0x41')](_0x61f33c[_0x02e5('0x3f')],{'$or':_['map'](_0x14ec2c,function(_0x4c9de3){if(_0x4c9de3[_0x02e5('0x30')]!==_0x02e5('0x42')){var _0x1a80d0={};_0x1a80d0[_0x4c9de3['name']]={'$like':'%'+_0x11e6a0[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x1a80d0;}})});}_0x61f33c=_[_0x02e5('0x41')]({},_0x61f33c,_0x11e6a0[_0x02e5('0x44')]);var _0x58c208={'where':_0x61f33c[_0x02e5('0x3f')]};return db[_0x02e5('0x2f')][_0x02e5('0x23')](_0x58c208)['then'](function(_0x176ae7){_0x54ad0b[_0x02e5('0x23')]=_0x176ae7;if(_0x11e6a0['query'][_0x02e5('0x45')]){_0x61f33c[_0x02e5('0x46')]=[{'all':!![]}];}return db[_0x02e5('0x2f')][_0x02e5('0x47')](_0x61f33c);})[_0x02e5('0x29')](function(_0x1e0a64){_0x54ad0b[_0x02e5('0x48')]=_0x1e0a64;return _0x54ad0b;})[_0x02e5('0x29')](respondWithFilteredResult(_0x29e5e6,_0x61f33c))['catch'](handleError(_0x29e5e6,null));};exports[_0x02e5('0x49')]=function(_0x2272a2,_0x280a4b){var _0x3e2570={'raw':!![],'where':{'id':_0x2272a2[_0x02e5('0x4a')]['id']}},_0x2e2c5a={};_0x2e2c5a[_0x02e5('0x32')]=_[_0x02e5('0x35')](db[_0x02e5('0x2f')][_0x02e5('0x4b')]);_0x2e2c5a[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x2272a2[_0x02e5('0x34')]);_0x2e2c5a[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x2e2c5a[_0x02e5('0x32')],_0x2e2c5a[_0x02e5('0x34')]);_0x3e2570[_0x02e5('0x38')]=_[_0x02e5('0x37')](_0x2e2c5a[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x2272a2['query']['fields']));_0x3e2570[_0x02e5('0x38')]=_0x3e2570[_0x02e5('0x38')]['length']?_0x3e2570[_0x02e5('0x38')]:_0x2e2c5a[_0x02e5('0x32')];if(_0x2272a2[_0x02e5('0x34')][_0x02e5('0x45')]){_0x3e2570['include']=[{'all':!![]}];}_0x3e2570=_[_0x02e5('0x41')]({},_0x3e2570,_0x2272a2[_0x02e5('0x44')]);return db[_0x02e5('0x2f')][_0x02e5('0x4c')](_0x3e2570)[_0x02e5('0x29')](handleEntityNotFound(_0x280a4b,null))[_0x02e5('0x29')](respondWithResult(_0x280a4b,null))[_0x02e5('0x4d')](handleError(_0x280a4b,null));};exports[_0x02e5('0x4e')]=function(_0x5ee6c8,_0x3aa169){return db['ChatGroup'][_0x02e5('0x4e')](_0x5ee6c8[_0x02e5('0x4f')],{})[_0x02e5('0x29')](respondWithResult(_0x3aa169,0xc9))[_0x02e5('0x4d')](handleError(_0x3aa169,null));};exports['update']=function(_0x1c5428,_0x39c894){if(_0x1c5428[_0x02e5('0x4f')]['id']){delete _0x1c5428['body']['id'];}return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x1c5428[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x39c894,null))['then'](saveUpdates(_0x1c5428[_0x02e5('0x4f')],null))[_0x02e5('0x29')](respondWithResult(_0x39c894,null))[_0x02e5('0x4d')](handleError(_0x39c894,null));};exports['destroy']=function(_0x593e50,_0x11b21c){return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x593e50['params']['id']}})['then'](handleEntityNotFound(_0x11b21c,null))['then'](removeEntity(_0x11b21c,null))[_0x02e5('0x4d')](handleError(_0x11b21c,null));};exports[_0x02e5('0x50')]=function(_0x1906fe,_0x34e6c9){return db[_0x02e5('0x2f')]['describe']()['then'](respondWithResult(_0x34e6c9,null))[_0x02e5('0x4d')](handleError(_0x34e6c9,null));};exports[_0x02e5('0x51')]=function(_0x1dc034,_0xfb80bb,_0x30a928){return db[_0x02e5('0x52')]['count']({'where':{'ChatGroupId':_0x1dc034['params']['id'],'ToId':_0x1dc034[_0x02e5('0x53')]['id'],'read':![]}})['then'](function(_0xe089a0){return{'id':_[_0x02e5('0x54')](_0x1dc034[_0x02e5('0x4a')]['id']),'count':_0xe089a0};})[_0x02e5('0x29')](respondWithResult(_0xfb80bb,null))['catch'](handleError(_0xfb80bb,null));};exports[_0x02e5('0x55')]=function(_0x1a2688,_0x23ec58,_0x33300d){return db['ChatGroup'][_0x02e5('0x4c')]({'where':{'id':_0x1a2688['params']['id']}})['then'](handleEntityNotFound(_0x23ec58,null))[_0x02e5('0x29')](function(_0x12cd0d){if(_0x12cd0d){return _0x12cd0d['addMembers'](_0x1a2688[_0x02e5('0x4f')][_0x02e5('0x56')],_['omit'](_0x1a2688[_0x02e5('0x4f')],[_0x02e5('0x56'),'id'])||{});}})[_0x02e5('0x29')](respondWithResult(_0x23ec58,null))[_0x02e5('0x4d')](handleError(_0x23ec58,null));};exports['getMembers']=function(_0x5138ab,_0x1aa671,_0x124e36){var _0x247fed={};var _0x28c532={};var _0x8dccab;var _0x43b0a4;return db[_0x02e5('0x2f')][_0x02e5('0x57')]({'where':{'id':_0x5138ab[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x1aa671,null))[_0x02e5('0x29')](function(_0x56d80b){if(_0x56d80b){_0x8dccab=_0x56d80b;_0x28c532[_0x02e5('0x32')]=_[_0x02e5('0x35')](db['User'][_0x02e5('0x4b')]);_0x28c532[_0x02e5('0x34')]=_[_0x02e5('0x35')](_0x5138ab[_0x02e5('0x34')]);_0x28c532[_0x02e5('0x36')]=_['intersection'](_0x28c532[_0x02e5('0x32')],_0x28c532[_0x02e5('0x34')]);_0x247fed[_0x02e5('0x38')]=_['intersection'](_0x28c532['model'],qs[_0x02e5('0x39')](_0x5138ab['query'][_0x02e5('0x39')]));_0x247fed[_0x02e5('0x38')]=_0x247fed[_0x02e5('0x38')][_0x02e5('0x3a')]?_0x247fed[_0x02e5('0x38')]:_0x28c532['model'];_0x247fed[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x5138ab[_0x02e5('0x34')][_0x02e5('0x3e')]);_0x247fed[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_['pick'](_0x5138ab[_0x02e5('0x34')],_0x28c532['filters']));if(_0x5138ab[_0x02e5('0x34')][_0x02e5('0x43')]){_0x247fed['where']=_[_0x02e5('0x41')](_0x247fed[_0x02e5('0x3f')],{'$or':_[_0x02e5('0x33')](_0x247fed[_0x02e5('0x38')],function(_0xa9c44a){var _0x54e755={};_0x54e755[_0xa9c44a]={'$like':'%'+_0x5138ab[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x54e755;})});}_0x247fed=_[_0x02e5('0x41')]({},_0x247fed,_0x5138ab[_0x02e5('0x44')]);return _0x8dccab[_0x02e5('0x58')](_0x247fed);}})[_0x02e5('0x29')](function(_0x13919a){if(_0x13919a){_0x43b0a4=_0x13919a[_0x02e5('0x3a')];if(!_0x5138ab['query']['hasOwnProperty'](_0x02e5('0x3c'))){_0x247fed[_0x02e5('0x22')]=qs[_0x02e5('0x22')](_0x5138ab[_0x02e5('0x34')][_0x02e5('0x22')]);_0x247fed['offset']=qs[_0x02e5('0x20')](_0x5138ab[_0x02e5('0x34')]['offset']);}return _0x8dccab[_0x02e5('0x58')](_0x247fed);}})[_0x02e5('0x29')](function(_0x50da90){if(_0x50da90){return _0x50da90?{'count':_0x43b0a4,'rows':_0x50da90}:null;}})['then'](respondWithResult(_0x1aa671,null))[_0x02e5('0x4d')](handleError(_0x1aa671,null));};exports[_0x02e5('0x59')]=function(_0x511ebb,_0x4d66a8,_0x71ed2b){return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x511ebb[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x4d66a8,null))[_0x02e5('0x29')](function(_0x4c08a2){if(_0x4c08a2){return _0x4c08a2[_0x02e5('0x59')](_0x511ebb[_0x02e5('0x34')][_0x02e5('0x56')]);}})[_0x02e5('0x29')](respondWithStatusCode(_0x4d66a8,null))[_0x02e5('0x4d')](handleError(_0x4d66a8,null));};exports['addMessage']=function(_0x43994a,_0x4ebf70,_0x27fcd4){if(_0x43994a[_0x02e5('0x4f')]['id']){delete _0x43994a[_0x02e5('0x4f')]['id'];}return db[_0x02e5('0x2f')][_0x02e5('0x4c')]({'where':{'id':_0x43994a[_0x02e5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ebf70,null))[_0x02e5('0x29')](function(_0x344912){if(_0x344912){_0x43994a['body']['ChatGroupId']=_0x344912['id'];return db[_0x02e5('0x52')][_0x02e5('0x4e')](_0x43994a[_0x02e5('0x4f')]);}})[_0x02e5('0x29')](respondWithResult(_0x4ebf70,null))[_0x02e5('0x4d')](handleError(_0x4ebf70,null));};exports['getMessages']=function(_0x3e85f3,_0x148a46,_0x139a39){var _0x4d3276={};var _0x29b7f4={};var _0x4a24d6;var _0x51460b;return db['ChatGroup']['findOne']({'where':{'id':_0x3e85f3[_0x02e5('0x4a')]['id']}})[_0x02e5('0x29')](handleEntityNotFound(_0x148a46,null))['then'](function(_0x256b13){if(_0x256b13){_0x4a24d6=_0x256b13;_0x29b7f4[_0x02e5('0x32')]=_[_0x02e5('0x35')](db['ChatInternalMessage'][_0x02e5('0x4b')]);_0x29b7f4['query']=_[_0x02e5('0x35')](_0x3e85f3[_0x02e5('0x34')]);_0x29b7f4[_0x02e5('0x36')]=_[_0x02e5('0x37')](_0x29b7f4[_0x02e5('0x32')],_0x29b7f4['query']);_0x4d3276[_0x02e5('0x38')]=_['intersection'](_0x29b7f4[_0x02e5('0x32')],qs[_0x02e5('0x39')](_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x39')]));_0x4d3276[_0x02e5('0x38')]=_0x4d3276['attributes'][_0x02e5('0x3a')]?_0x4d3276[_0x02e5('0x38')]:_0x29b7f4[_0x02e5('0x32')];_0x4d3276[_0x02e5('0x3d')]=qs[_0x02e5('0x3e')](_0x3e85f3['query'][_0x02e5('0x3e')]);_0x4d3276[_0x02e5('0x3f')]=qs[_0x02e5('0x36')](_[_0x02e5('0x40')](_0x3e85f3['query'],_0x29b7f4[_0x02e5('0x36')]));if(_0x3e85f3[_0x02e5('0x34')]['filter']){_0x4d3276['where']=_['merge'](_0x4d3276['where'],{'$or':_['map'](_0x4d3276[_0x02e5('0x38')],function(_0x3467c7){var _0x279815={};_0x279815[_0x3467c7]={'$like':'%'+_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x43')]+'%'};return _0x279815;})});}if(_0x3e85f3[_0x02e5('0x34')][_0x02e5('0x5a')]){var _0xda2f2e=_0x3e85f3[_0x02e5('0x34')]['$gte'][_0x02e5('0x5b')](',');var _0x128d32={};_0x128d32[_0xda2f2e[0x0]]={'$gte':moment(_0xda2f2e[0x1])[_0x02e5('0x5c')](_0x02e5('0x5d'))};_0x4d3276[_0x02e5('0x3f')]=_[_0x02e5('0x41')](_0x4d3276[_0x02e5('0x3f')],_0x128d32);}_0x4d3276=_[_0x02e5('0x41')]({},_0x4d3276,_0x3e85f3[_0x02e5('0x44')]);return _0x4a24d6[_0x02e5('0x5e')](_0x4d3276);}})[_0x02e5('0x29')](function(_0x4addcd){if(_0x4addcd){_0x51460b=_0x4addcd[_0x02e5('0x3a')];if(!_0x3e85f3['query'][_0x02e5('0x3b')](_0x02e5('0x3c'))){_0x4d3276[_0x02e5('0x22')]=qs['limit'](_0x3e85f3['query']['limit']);_0x4d3276[_0x02e5('0x20')]=qs[_0x02e5('0x20')](_0x3e85f3[_0x02e5('0x34')]['offset']);}return _0x4a24d6[_0x02e5('0x5e')](_0x4d3276);}})[_0x02e5('0x29')](function(_0x4bbeb0){if(_0x4bbeb0){return _0x4bbeb0?{'count':_0x51460b,'rows':_0x4bbeb0}:null;}})['then'](respondWithResult(_0x148a46,null))['catch'](handleError(_0x148a46,null));}; \ No newline at end of file +var _0xc210=['removeMembers','ChatGroupId','ChatInternalMessage','getMessages','findOne','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','localhost','redis','./chatGroup.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','destroy','then','end','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','find','create','body','update','describe','user','toInteger','addMembers','omit','ids','getMembers','hasOwnProperty'];(function(_0x52f03d,_0x438fa1){var _0x3fdf30=function(_0x5e61bd){while(--_0x5e61bd){_0x52f03d['push'](_0x52f03d['shift']());}};_0x3fdf30(++_0x438fa1);}(_0xc210,0x1e8));var _0x0c21=function(_0x17fd65,_0x556d01){_0x17fd65=_0x17fd65-0x0;var _0x27d033=_0xc210[_0x17fd65];return _0x27d033;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c21('0x0'));var zipdir=require(_0x0c21('0x1'));var jsonpatch=require(_0x0c21('0x2'));var rp=require(_0x0c21('0x3'));var moment=require('moment');var BPromise=require(_0x0c21('0x4'));var Mustache=require(_0x0c21('0x5'));var util=require(_0x0c21('0x6'));var path=require(_0x0c21('0x7'));var sox=require('sox');var csv=require(_0x0c21('0x8'));var ejs=require(_0x0c21('0x9'));var fs=require('fs');var fs_extra=require(_0x0c21('0xa'));var _=require('lodash');var squel=require(_0x0c21('0xb'));var crypto=require(_0x0c21('0xc'));var jsforce=require(_0x0c21('0xd'));var deskjs=require(_0x0c21('0xe'));var toCsv=require(_0x0c21('0x8'));var querystring=require(_0x0c21('0xf'));var Papa=require(_0x0c21('0x10'));var Redis=require(_0x0c21('0x11'));var authService=require(_0x0c21('0x12'));var qs=require(_0x0c21('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0c21('0x14'));var logger=require(_0x0c21('0x15'))(_0x0c21('0x16'));var utils=require(_0x0c21('0x17'));var config=require(_0x0c21('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x0c21('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0x0c21('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0c21('0x1b')]));require(_0x0c21('0x1c'))[_0x0c21('0x1d')](socket);function respondWithStatusCode(_0x1a4e48,_0xdf3079){_0xdf3079=_0xdf3079||0xcc;return function(_0x5ebd29){if(_0x5ebd29){return _0x1a4e48[_0x0c21('0x1e')](_0xdf3079);}return _0x1a4e48[_0x0c21('0x1f')](_0xdf3079)['end']();};}function respondWithResult(_0x3b759f,_0x282f69){_0x282f69=_0x282f69||0xc8;return function(_0x56adfb){if(_0x56adfb){return _0x3b759f[_0x0c21('0x1f')](_0x282f69)[_0x0c21('0x20')](_0x56adfb);}};}function respondWithFilteredResult(_0x4ba416,_0x348989){return function(_0x411f4a){if(_0x411f4a){var _0x214fc8=typeof _0x348989[_0x0c21('0x21')]==='undefined'&&typeof _0x348989['limit']===_0x0c21('0x22');var _0xff65a=_0x411f4a[_0x0c21('0x23')];var _0x374b74=_0x214fc8?0x0:_0x348989[_0x0c21('0x21')];var _0x1a91b6=_0x214fc8?_0x411f4a[_0x0c21('0x23')]:_0x348989[_0x0c21('0x21')]+_0x348989[_0x0c21('0x24')];var _0x4cb6dd;if(_0x1a91b6>=_0xff65a){_0x1a91b6=_0xff65a;_0x4cb6dd=0xc8;}else{_0x4cb6dd=0xce;}_0x4ba416['status'](_0x4cb6dd);return _0x4ba416['set'](_0x0c21('0x25'),_0x374b74+'-'+_0x1a91b6+'/'+_0xff65a)['json'](_0x411f4a);}return null;};}function patchUpdates(_0x29fd87){return function(_0x582329){try{jsonpatch[_0x0c21('0x26')](_0x582329,_0x29fd87,!![]);}catch(_0x1d677d){return BPromise['reject'](_0x1d677d);}return _0x582329[_0x0c21('0x27')]();};}function saveUpdates(_0x349315,_0x38f74d){return function(_0x4ec5a6){if(_0x4ec5a6){return _0x4ec5a6['update'](_0x349315)['then'](function(_0x2be73a){return _0x2be73a;});}return null;};}function removeEntity(_0x5acc85,_0x37cafa){return function(_0x2c3848){if(_0x2c3848){return _0x2c3848[_0x0c21('0x28')]()[_0x0c21('0x29')](function(){_0x5acc85['status'](0xcc)[_0x0c21('0x2a')]();});}};}function handleEntityNotFound(_0x3bf181,_0x11f57d){return function(_0x4fd3cf){if(!_0x4fd3cf){_0x3bf181['sendStatus'](0x194);}return _0x4fd3cf;};}function handleError(_0x3cf7a0,_0x5d5bbd){_0x5d5bbd=_0x5d5bbd||0x1f4;return function(_0xb0ed8){logger['error'](_0xb0ed8[_0x0c21('0x2b')]);if(_0xb0ed8[_0x0c21('0x2c')]){delete _0xb0ed8[_0x0c21('0x2c')];}_0x3cf7a0[_0x0c21('0x1f')](_0x5d5bbd)[_0x0c21('0x2d')](_0xb0ed8);};}exports[_0x0c21('0x2e')]=function(_0x5eb5ed,_0x3b45e4){var _0x368953={},_0x1c18dc={},_0x1ad553={'count':0x0,'rows':[]};var _0x44d32a=_[_0x0c21('0x2f')](db[_0x0c21('0x30')][_0x0c21('0x31')],function(_0x5d1d52){return{'name':_0x5d1d52[_0x0c21('0x32')],'type':_0x5d1d52['type'][_0x0c21('0x33')]};});_0x1c18dc[_0x0c21('0x34')]=_[_0x0c21('0x2f')](_0x44d32a,'name');_0x1c18dc[_0x0c21('0x35')]=_[_0x0c21('0x36')](_0x5eb5ed[_0x0c21('0x35')]);_0x1c18dc[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x1c18dc[_0x0c21('0x34')],_0x1c18dc[_0x0c21('0x35')]);_0x368953[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x1c18dc[_0x0c21('0x34')],qs[_0x0c21('0x3a')](_0x5eb5ed[_0x0c21('0x35')]['fields']));_0x368953[_0x0c21('0x39')]=_0x368953[_0x0c21('0x39')][_0x0c21('0x3b')]?_0x368953['attributes']:_0x1c18dc[_0x0c21('0x34')];if(!_0x5eb5ed[_0x0c21('0x35')]['hasOwnProperty'](_0x0c21('0x3c'))){_0x368953[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0x5eb5ed['query'][_0x0c21('0x24')]);_0x368953['offset']=qs['offset'](_0x5eb5ed['query']['offset']);}_0x368953[_0x0c21('0x3d')]=qs['sort'](_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x3e')]);_0x368953[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_[_0x0c21('0x40')](_0x5eb5ed[_0x0c21('0x35')],_0x1c18dc['filters']),_0x44d32a);if(_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x41')]){_0x368953[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x368953['where'],{'$or':_[_0x0c21('0x2f')](_0x44d32a,function(_0x351566){if(_0x351566[_0x0c21('0x43')]!==_0x0c21('0x44')){var _0x20ff91={};_0x20ff91[_0x351566[_0x0c21('0x2c')]]={'$like':'%'+_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x41')]+'%'};return _0x20ff91;}})});}_0x368953=_[_0x0c21('0x42')]({},_0x368953,_0x5eb5ed[_0x0c21('0x45')]);var _0x418617={'where':_0x368953[_0x0c21('0x3f')]};return db[_0x0c21('0x30')][_0x0c21('0x23')](_0x418617)['then'](function(_0x54e137){_0x1ad553['count']=_0x54e137;if(_0x5eb5ed[_0x0c21('0x35')][_0x0c21('0x46')]){_0x368953['include']=[{'all':!![]}];}return db[_0x0c21('0x30')][_0x0c21('0x47')](_0x368953);})['then'](function(_0x24030f){_0x1ad553[_0x0c21('0x48')]=_0x24030f;return _0x1ad553;})['then'](respondWithFilteredResult(_0x3b45e4,_0x368953))[_0x0c21('0x49')](handleError(_0x3b45e4,null));};exports[_0x0c21('0x4a')]=function(_0x3c4e6a,_0x1a67e7){var _0x91505d={'raw':!![],'where':{'id':_0x3c4e6a[_0x0c21('0x4b')]['id']}},_0x4ba039={};_0x4ba039['model']=_[_0x0c21('0x36')](db['ChatGroup'][_0x0c21('0x31')]);_0x4ba039[_0x0c21('0x35')]=_['keys'](_0x3c4e6a[_0x0c21('0x35')]);_0x4ba039['filters']=_[_0x0c21('0x38')](_0x4ba039[_0x0c21('0x34')],_0x4ba039[_0x0c21('0x35')]);_0x91505d[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x4ba039['model'],qs[_0x0c21('0x3a')](_0x3c4e6a[_0x0c21('0x35')][_0x0c21('0x3a')]));_0x91505d[_0x0c21('0x39')]=_0x91505d[_0x0c21('0x39')][_0x0c21('0x3b')]?_0x91505d['attributes']:_0x4ba039[_0x0c21('0x34')];if(_0x3c4e6a[_0x0c21('0x35')][_0x0c21('0x46')]){_0x91505d['include']=[{'all':!![]}];}_0x91505d=_[_0x0c21('0x42')]({},_0x91505d,_0x3c4e6a[_0x0c21('0x45')]);return db[_0x0c21('0x30')][_0x0c21('0x4c')](_0x91505d)[_0x0c21('0x29')](handleEntityNotFound(_0x1a67e7,null))[_0x0c21('0x29')](respondWithResult(_0x1a67e7,null))[_0x0c21('0x49')](handleError(_0x1a67e7,null));};exports[_0x0c21('0x4d')]=function(_0x1b23ea,_0x4b1f66){return db[_0x0c21('0x30')]['create'](_0x1b23ea[_0x0c21('0x4e')],{})[_0x0c21('0x29')](respondWithResult(_0x4b1f66,0xc9))[_0x0c21('0x49')](handleError(_0x4b1f66,null));};exports[_0x0c21('0x4f')]=function(_0x6275ca,_0x195dbe){if(_0x6275ca['body']['id']){delete _0x6275ca[_0x0c21('0x4e')]['id'];}return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x6275ca[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x195dbe,null))[_0x0c21('0x29')](saveUpdates(_0x6275ca[_0x0c21('0x4e')],null))['then'](respondWithResult(_0x195dbe,null))[_0x0c21('0x49')](handleError(_0x195dbe,null));};exports[_0x0c21('0x28')]=function(_0x141613,_0xcc86f6){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x141613[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0xcc86f6,null))[_0x0c21('0x29')](removeEntity(_0xcc86f6,null))[_0x0c21('0x49')](handleError(_0xcc86f6,null));};exports[_0x0c21('0x50')]=function(_0x1e6827,_0x3eeecd){return db['ChatGroup'][_0x0c21('0x50')]()[_0x0c21('0x29')](respondWithResult(_0x3eeecd,null))[_0x0c21('0x49')](handleError(_0x3eeecd,null));};exports['getUnread']=function(_0x239456,_0x267b11,_0x129070){return db['ChatInternalMessage'][_0x0c21('0x23')]({'where':{'ChatGroupId':_0x239456[_0x0c21('0x4b')]['id'],'ToId':_0x239456[_0x0c21('0x51')]['id'],'read':![]}})[_0x0c21('0x29')](function(_0x1543b0){return{'id':_[_0x0c21('0x52')](_0x239456[_0x0c21('0x4b')]['id']),'count':_0x1543b0};})[_0x0c21('0x29')](respondWithResult(_0x267b11,null))['catch'](handleError(_0x267b11,null));};exports[_0x0c21('0x53')]=function(_0x378598,_0x598376,_0x1a3d1a){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x378598[_0x0c21('0x4b')]['id']}})['then'](handleEntityNotFound(_0x598376,null))[_0x0c21('0x29')](function(_0x243674){if(_0x243674){return _0x243674[_0x0c21('0x53')](_0x378598[_0x0c21('0x4e')]['ids'],_[_0x0c21('0x54')](_0x378598[_0x0c21('0x4e')],[_0x0c21('0x55'),'id'])||{});}})['then'](respondWithResult(_0x598376,null))[_0x0c21('0x49')](handleError(_0x598376,null));};exports[_0x0c21('0x56')]=function(_0x5ba49e,_0x1b88d3,_0x1c0415){var _0x3ac111={};var _0x4ae396={};var _0x32f121;var _0x51b622;return db[_0x0c21('0x30')]['findOne']({'where':{'id':_0x5ba49e[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x1b88d3,null))[_0x0c21('0x29')](function(_0x5e5ce6){if(_0x5e5ce6){_0x32f121=_0x5e5ce6;_0x4ae396[_0x0c21('0x34')]=_[_0x0c21('0x36')](db['User'][_0x0c21('0x31')]);_0x4ae396[_0x0c21('0x35')]=_[_0x0c21('0x36')](_0x5ba49e[_0x0c21('0x35')]);_0x4ae396[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x4ae396[_0x0c21('0x34')],_0x4ae396[_0x0c21('0x35')]);_0x3ac111['attributes']=_['intersection'](_0x4ae396[_0x0c21('0x34')],qs[_0x0c21('0x3a')](_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x3a')]));_0x3ac111[_0x0c21('0x39')]=_0x3ac111[_0x0c21('0x39')]['length']?_0x3ac111[_0x0c21('0x39')]:_0x4ae396[_0x0c21('0x34')];_0x3ac111[_0x0c21('0x3d')]=qs[_0x0c21('0x3e')](_0x5ba49e['query'][_0x0c21('0x3e')]);_0x3ac111[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_['pick'](_0x5ba49e['query'],_0x4ae396[_0x0c21('0x37')]));if(_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x41')]){_0x3ac111[_0x0c21('0x3f')]=_['merge'](_0x3ac111[_0x0c21('0x3f')],{'$or':_[_0x0c21('0x2f')](_0x3ac111[_0x0c21('0x39')],function(_0x342d7b){var _0x4f6e99={};_0x4f6e99[_0x342d7b]={'$like':'%'+_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x41')]+'%'};return _0x4f6e99;})});}_0x3ac111=_['merge']({},_0x3ac111,_0x5ba49e[_0x0c21('0x45')]);return _0x32f121[_0x0c21('0x56')](_0x3ac111);}})[_0x0c21('0x29')](function(_0x2a94c8){if(_0x2a94c8){_0x51b622=_0x2a94c8['length'];if(!_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x57')](_0x0c21('0x3c'))){_0x3ac111[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0x5ba49e[_0x0c21('0x35')][_0x0c21('0x24')]);_0x3ac111['offset']=qs[_0x0c21('0x21')](_0x5ba49e['query'][_0x0c21('0x21')]);}return _0x32f121[_0x0c21('0x56')](_0x3ac111);}})[_0x0c21('0x29')](function(_0x300de5){if(_0x300de5){return _0x300de5?{'count':_0x51b622,'rows':_0x300de5}:null;}})[_0x0c21('0x29')](respondWithResult(_0x1b88d3,null))[_0x0c21('0x49')](handleError(_0x1b88d3,null));};exports[_0x0c21('0x58')]=function(_0x2c12dc,_0x3bacbd,_0x4aad1a){return db[_0x0c21('0x30')][_0x0c21('0x4c')]({'where':{'id':_0x2c12dc[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x3bacbd,null))[_0x0c21('0x29')](function(_0x92d3d1){if(_0x92d3d1){return _0x92d3d1[_0x0c21('0x58')](_0x2c12dc['query'][_0x0c21('0x55')]);}})['then'](respondWithStatusCode(_0x3bacbd,null))[_0x0c21('0x49')](handleError(_0x3bacbd,null));};exports['addMessage']=function(_0x59a4cb,_0x4290c2,_0x5dcbf0){if(_0x59a4cb[_0x0c21('0x4e')]['id']){delete _0x59a4cb[_0x0c21('0x4e')]['id'];}return db['ChatGroup'][_0x0c21('0x4c')]({'where':{'id':_0x59a4cb[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x4290c2,null))[_0x0c21('0x29')](function(_0x50e67a){if(_0x50e67a){_0x59a4cb['body'][_0x0c21('0x59')]=_0x50e67a['id'];return db[_0x0c21('0x5a')]['create'](_0x59a4cb[_0x0c21('0x4e')]);}})[_0x0c21('0x29')](respondWithResult(_0x4290c2,null))[_0x0c21('0x49')](handleError(_0x4290c2,null));};exports[_0x0c21('0x5b')]=function(_0xb03b5b,_0x57de81,_0x2db337){var _0x353e19={};var _0x197a7d={};var _0x2ddcb2;var _0x22a6a2;return db[_0x0c21('0x30')][_0x0c21('0x5c')]({'where':{'id':_0xb03b5b[_0x0c21('0x4b')]['id']}})[_0x0c21('0x29')](handleEntityNotFound(_0x57de81,null))[_0x0c21('0x29')](function(_0x373dee){if(_0x373dee){_0x2ddcb2=_0x373dee;_0x197a7d['model']=_['keys'](db['ChatInternalMessage']['rawAttributes']);_0x197a7d['query']=_['keys'](_0xb03b5b[_0x0c21('0x35')]);_0x197a7d[_0x0c21('0x37')]=_[_0x0c21('0x38')](_0x197a7d[_0x0c21('0x34')],_0x197a7d[_0x0c21('0x35')]);_0x353e19[_0x0c21('0x39')]=_[_0x0c21('0x38')](_0x197a7d[_0x0c21('0x34')],qs['fields'](_0xb03b5b['query'][_0x0c21('0x3a')]));_0x353e19[_0x0c21('0x39')]=_0x353e19[_0x0c21('0x39')]['length']?_0x353e19[_0x0c21('0x39')]:_0x197a7d[_0x0c21('0x34')];_0x353e19['order']=qs[_0x0c21('0x3e')](_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x3e')]);_0x353e19[_0x0c21('0x3f')]=qs[_0x0c21('0x37')](_['pick'](_0xb03b5b[_0x0c21('0x35')],_0x197a7d[_0x0c21('0x37')]));if(_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x41')]){_0x353e19[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x353e19['where'],{'$or':_[_0x0c21('0x2f')](_0x353e19['attributes'],function(_0x5b5330){var _0x3d69c9={};_0x3d69c9[_0x5b5330]={'$like':'%'+_0xb03b5b[_0x0c21('0x35')]['filter']+'%'};return _0x3d69c9;})});}if(_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x5d')]){var _0x1df437=_0xb03b5b['query'][_0x0c21('0x5d')][_0x0c21('0x5e')](',');var _0x2c3180={};_0x2c3180[_0x1df437[0x0]]={'$gte':moment(_0x1df437[0x1])[_0x0c21('0x5f')]('YYYY-MM-DD\x20HH:mm:ss')};_0x353e19[_0x0c21('0x3f')]=_[_0x0c21('0x42')](_0x353e19['where'],_0x2c3180);}_0x353e19=_[_0x0c21('0x42')]({},_0x353e19,_0xb03b5b[_0x0c21('0x45')]);return _0x2ddcb2[_0x0c21('0x5b')](_0x353e19);}})[_0x0c21('0x29')](function(_0x414fd1){if(_0x414fd1){_0x22a6a2=_0x414fd1[_0x0c21('0x3b')];if(!_0xb03b5b['query']['hasOwnProperty'](_0x0c21('0x3c'))){_0x353e19[_0x0c21('0x24')]=qs[_0x0c21('0x24')](_0xb03b5b[_0x0c21('0x35')]['limit']);_0x353e19[_0x0c21('0x21')]=qs[_0x0c21('0x21')](_0xb03b5b[_0x0c21('0x35')][_0x0c21('0x21')]);}return _0x2ddcb2[_0x0c21('0x5b')](_0x353e19);}})[_0x0c21('0x29')](function(_0x103818){if(_0x103818){return _0x103818?{'count':_0x22a6a2,'rows':_0x103818}:null;}})[_0x0c21('0x29')](respondWithResult(_0x57de81,null))[_0x0c21('0x49')](handleError(_0x57de81,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 3ee2b36..aee111d 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 _0x5078=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3836ee,_0x3e61aa){var _0x3c9652=function(_0x3a7eb1){while(--_0x3a7eb1){_0x3836ee['push'](_0x3836ee['shift']());}};_0x3c9652(++_0x3e61aa);}(_0x5078,0x148));var _0x8507=function(_0x211632,_0x378e2e){_0x211632=_0x211632-0x0;var _0x5a1da1=_0x5078[_0x211632];return _0x5a1da1;};'use strict';var EventEmitter=require(_0x8507('0x0'));var ChatGroup=require(_0x8507('0x1'))['db'][_0x8507('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x8507('0x3')](0x0);var events={'afterCreate':_0x8507('0x4'),'afterUpdate':_0x8507('0x5'),'afterDestroy':_0x8507('0x6')};function emitEvent(_0x20608d){return function(_0x1a4930,_0x239a82,_0x2aa379){ChatGroupEvents[_0x8507('0x7')](_0x20608d+':'+_0x1a4930['id'],_0x1a4930);ChatGroupEvents[_0x8507('0x7')](_0x20608d,_0x1a4930);_0x2aa379(null);};}for(var e in events){if(events[_0x8507('0x8')](e)){var event=events[e];ChatGroup[_0x8507('0x9')](e,emitEvent(event));}}module[_0x8507('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x0bb0=['update','remove','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0xea80ce,_0x4ea841){var _0x16c55e=function(_0x50b667){while(--_0x50b667){_0xea80ce['push'](_0xea80ce['shift']());}};_0x16c55e(++_0x4ea841);}(_0x0bb0,0x11e));var _0x00bb=function(_0x20d17c,_0x4e8132){_0x20d17c=_0x20d17c-0x0;var _0x429799=_0x0bb0[_0x20d17c];return _0x429799;};'use strict';var EventEmitter=require(_0x00bb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x00bb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x00bb('0x2')](0x0);var events={'afterCreate':_0x00bb('0x3'),'afterUpdate':_0x00bb('0x4'),'afterDestroy':_0x00bb('0x5')};function emitEvent(_0x4abb06){return function(_0x51369a,_0x506171,_0x5ad1d0){ChatGroupEvents[_0x00bb('0x6')](_0x4abb06+':'+_0x51369a['id'],_0x51369a);ChatGroupEvents[_0x00bb('0x6')](_0x4abb06,_0x51369a);_0x5ad1d0(null);};}for(var e in events){if(events[_0x00bb('0x7')](e)){var event=events[e];ChatGroup[_0x00bb('0x8')](e,emitEvent(event));}}module[_0x00bb('0x9')]=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 7d5fc8f..60ce74f 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 _0x3f85=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatGroup'];(function(_0x1d6a29,_0x1f9cf9){var _0x1d3206=function(_0x314ffd){while(--_0x314ffd){_0x1d6a29['push'](_0x1d6a29['shift']());}};_0x1d3206(++_0x1f9cf9);}(_0x3f85,0x145));var _0x53f8=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3f85[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x53f8('0x0'));var util=require(_0x53f8('0x1'));var logger=require(_0x53f8('0x2'))(_0x53f8('0x3'));var moment=require(_0x53f8('0x4'));var BPromise=require(_0x53f8('0x5'));var rp=require(_0x53f8('0x6'));var fs=require('fs');var path=require(_0x53f8('0x7'));var rimraf=require(_0x53f8('0x8'));var config=require(_0x53f8('0x9'));var attributes=require('./chatGroup.attributes');module[_0x53f8('0xa')]=function(_0x498292,_0xdcbe19){return _0x498292[_0x53f8('0xb')](_0x53f8('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f75=['moment','path','../../config/environment','exports','define','ChatGroup','lodash','util','../../config/logger'];(function(_0x3dc68d,_0x1c1951){var _0xdf7f94=function(_0x339428){while(--_0x339428){_0x3dc68d['push'](_0x3dc68d['shift']());}};_0xdf7f94(++_0x1c1951);}(_0x4f75,0xde));var _0x54f7=function(_0x41637d,_0x2546a2){_0x41637d=_0x41637d-0x0;var _0x3fa9d7=_0x4f75[_0x41637d];return _0x3fa9d7;};'use strict';var _=require(_0x54f7('0x0'));var util=require(_0x54f7('0x1'));var logger=require(_0x54f7('0x2'))('api');var moment=require(_0x54f7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x54f7('0x4'));var rimraf=require('rimraf');var config=require(_0x54f7('0x5'));var attributes=require('./chatGroup.attributes');module[_0x54f7('0x6')]=function(_0x13424b,_0x12846b){return _0x13424b[_0x54f7('0x7')](_0x54f7('0x8'),attributes,{'tableName':'chat_groups','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 ce48d30..4d746a6 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 _0xdb13=['request\x20sent','stringify','error','message','ChatGroup,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x19d873,_0x1b5249){var _0x26be90=function(_0x10fb7f){while(--_0x10fb7f){_0x19d873['push'](_0x19d873['shift']());}};_0x26be90(++_0x1b5249);}(_0xdb13,0x10c));var _0x3db1=function(_0x29539e,_0x30240a){_0x29539e=_0x29539e-0x0;var _0x49f3c7=_0xdb13[_0x29539e];return _0x49f3c7;};'use strict';var _=require('lodash');var util=require(_0x3db1('0x0'));var moment=require(_0x3db1('0x1'));var BPromise=require(_0x3db1('0x2'));var rs=require(_0x3db1('0x3'));var fs=require('fs');var Redis=require(_0x3db1('0x4'));var db=require(_0x3db1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3db1('0x6'))(_0x3db1('0x7'));var config=require(_0x3db1('0x8'));var jayson=require(_0x3db1('0x9'));var client=jayson[_0x3db1('0xa')]['http']({'port':0x232a});config[_0x3db1('0xb')]=_[_0x3db1('0xc')](config[_0x3db1('0xb')],{'host':_0x3db1('0xd'),'port':0x18eb});var socket=require(_0x3db1('0xe'))(new Redis(config[_0x3db1('0xb')]));require(_0x3db1('0xf'))[_0x3db1('0x10')](socket);function respondWithRpcPromise(_0x2261bb,_0xe67f4b,_0x46f340){return new BPromise(function(_0xfd358f,_0x51d421){return client[_0x3db1('0x11')](_0x2261bb,_0x46f340)[_0x3db1('0x12')](function(_0x2bab87){logger[_0x3db1('0x13')]('ChatGroup,\x20%s,\x20%s',_0xe67f4b,'request\x20sent');logger[_0x3db1('0x14')](_0x3db1('0x15'),_0xe67f4b,_0x3db1('0x16'),JSON[_0x3db1('0x17')](_0x2bab87));if(_0x2bab87[_0x3db1('0x18')]){if(_0x2bab87['error']['code']===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0xe67f4b,_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);return _0x51d421(_0x2bab87[_0x3db1('0x18')][_0x3db1('0x19')]);}logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x2bab87['error'][_0x3db1('0x19')]);return _0xfd358f(_0x2bab87[_0x3db1('0x18')]['message']);}else{logger[_0x3db1('0x13')](_0x3db1('0x1a'),_0xe67f4b,'request\x20sent');_0xfd358f(_0x2bab87[_0x3db1('0x1b')]['message']);}})[_0x3db1('0x1c')](function(_0x475208){logger[_0x3db1('0x18')](_0x3db1('0x1a'),_0xe67f4b,_0x475208);_0x51d421(_0x475208);});});} \ No newline at end of file +var _0x4756=['moment','bluebird','../../mysqldb','client','http','redis','localhost','./chatGroup.socket','register','request','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util'];(function(_0x1d6960,_0x11a48a){var _0x278934=function(_0x36dd3d){while(--_0x36dd3d){_0x1d6960['push'](_0x1d6960['shift']());}};_0x278934(++_0x11a48a);}(_0x4756,0xa6));var _0x6475=function(_0x2c57d4,_0x132261){_0x2c57d4=_0x2c57d4-0x0;var _0x5e8b6f=_0x4756[_0x2c57d4];return _0x5e8b6f;};'use strict';var _=require(_0x6475('0x0'));var util=require(_0x6475('0x1'));var moment=require(_0x6475('0x2'));var BPromise=require(_0x6475('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6475('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6475('0x5')][_0x6475('0x6')]({'port':0x232a});config[_0x6475('0x7')]=_['defaults'](config[_0x6475('0x7')],{'host':_0x6475('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6475('0x9'))[_0x6475('0xa')](socket);function respondWithRpcPromise(_0x34c510,_0x263fc5,_0x276fcd){return new BPromise(function(_0x8eced8,_0x3e9391){return client[_0x6475('0xb')](_0x34c510,_0x276fcd)['then'](function(_0x5cbbc3){logger[_0x6475('0xc')](_0x6475('0xd'),_0x263fc5,'request\x20sent');logger['debug'](_0x6475('0xe'),_0x263fc5,_0x6475('0xf'),JSON[_0x6475('0x10')](_0x5cbbc3));if(_0x5cbbc3[_0x6475('0x11')]){if(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x12')]===0x1f4){logger['error'](_0x6475('0xd'),_0x263fc5,_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);return _0x3e9391(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);}logger[_0x6475('0x11')](_0x6475('0xd'),_0x263fc5,_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);return _0x8eced8(_0x5cbbc3[_0x6475('0x11')][_0x6475('0x13')]);}else{logger[_0x6475('0xc')](_0x6475('0xd'),_0x263fc5,_0x6475('0xf'));_0x8eced8(_0x5cbbc3[_0x6475('0x14')][_0x6475('0x13')]);}})['catch'](function(_0x340356){logger[_0x6475('0x11')](_0x6475('0xd'),_0x263fc5,_0x340356);_0x3e9391(_0x340356);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 5394824..aa76710 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 _0x9cdf=['chatGroup:','./chatGroup.events','remove','update','emit','register'];(function(_0xa5e22f,_0x5c90ed){var _0x417561=function(_0xd8d76){while(--_0xd8d76){_0xa5e22f['push'](_0xa5e22f['shift']());}};_0x417561(++_0x5c90ed);}(_0x9cdf,0x1a5));var _0xf9cd=function(_0x252e47,_0x488d2f){_0x252e47=_0x252e47-0x0;var _0x1fbd86=_0x9cdf[_0x252e47];return _0x1fbd86;};'use strict';var ChatGroupEvents=require(_0xf9cd('0x0'));var events=['save',_0xf9cd('0x1'),_0xf9cd('0x2')];function createListener(_0x853dd9,_0x4d11ab){return function(_0x121078){_0x4d11ab[_0xf9cd('0x3')](_0x853dd9,_0x121078);};}function removeListener(_0x3d3b5c,_0x55b41c){return function(){ChatGroupEvents['removeListener'](_0x3d3b5c,_0x55b41c);};}exports[_0xf9cd('0x4')]=function(_0x4c106c){for(var _0x37a08b=0x0,_0x1c5f3f=events['length'];_0x37a08b<_0x1c5f3f;_0x37a08b++){var _0x1ddc47=events[_0x37a08b];var _0x22d3ee=createListener(_0xf9cd('0x5')+_0x1ddc47,_0x4c106c);ChatGroupEvents['on'](_0x1ddc47,_0x22d3ee);}}; \ No newline at end of file +var _0x4f61=['length','chatGroup:','./chatGroup.events','save','remove','update','emit','removeListener','register'];(function(_0x55c9a0,_0x18286f){var _0x51fe89=function(_0x3bc6fe){while(--_0x3bc6fe){_0x55c9a0['push'](_0x55c9a0['shift']());}};_0x51fe89(++_0x18286f);}(_0x4f61,0x16a));var _0x14f6=function(_0x594368,_0x3c7c54){_0x594368=_0x594368-0x0;var _0x5cafbe=_0x4f61[_0x594368];return _0x5cafbe;};'use strict';var ChatGroupEvents=require(_0x14f6('0x0'));var events=[_0x14f6('0x1'),_0x14f6('0x2'),_0x14f6('0x3')];function createListener(_0x303d65,_0x3a7417){return function(_0x14925a){_0x3a7417[_0x14f6('0x4')](_0x303d65,_0x14925a);};}function removeListener(_0x5d17a9,_0xfbc052){return function(){ChatGroupEvents[_0x14f6('0x5')](_0x5d17a9,_0xfbc052);};}exports[_0x14f6('0x6')]=function(_0x1de980){for(var _0x34499d=0x0,_0x200d91=events[_0x14f6('0x7')];_0x34499d<_0x200d91;_0x34499d++){var _0x238ca1=events[_0x34499d];var _0xb18da1=createListener(_0x14f6('0x8')+_0x238ca1,_0x1de980);ChatGroupEvents['on'](_0x238ca1,_0xb18da1);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 4e0629b..3ef22e6 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 _0xfa9a=['/describe','/:id','show','/:id/unread','getMembers','/:id/messages','getMessages','create','addMembers','post','addMessage','put','/:id/members','removeMembers','exports','multer','util','path','express','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x5e1b91,_0x236f17){var _0x59b52f=function(_0x5c05ed){while(--_0x5c05ed){_0x5e1b91['push'](_0x5e1b91['shift']());}};_0x59b52f(++_0x236f17);}(_0xfa9a,0x1a7));var _0xafa9=function(_0x243e8c,_0x5f0894){_0x243e8c=_0x243e8c-0x0;var _0x713314=_0xfa9a[_0x243e8c];return _0x713314;};'use strict';var multer=require(_0xafa9('0x0'));var util=require(_0xafa9('0x1'));var path=require(_0xafa9('0x2'));var timeout=require('connect-timeout');var express=require(_0xafa9('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xafa9('0x4'));var config=require('../../config/environment');var controller=require(_0xafa9('0x5'));router[_0xafa9('0x6')]('/',auth[_0xafa9('0x7')](),controller[_0xafa9('0x8')]);router[_0xafa9('0x6')](_0xafa9('0x9'),auth[_0xafa9('0x7')](),controller['describe']);router[_0xafa9('0x6')](_0xafa9('0xa'),auth[_0xafa9('0x7')](),controller[_0xafa9('0xb')]);router[_0xafa9('0x6')](_0xafa9('0xc'),auth[_0xafa9('0x7')](),controller['getUnread']);router[_0xafa9('0x6')]('/:id/members',auth[_0xafa9('0x7')](),controller[_0xafa9('0xd')]);router[_0xafa9('0x6')](_0xafa9('0xe'),auth['isAuthenticated'](),controller[_0xafa9('0xf')]);router['post']('/',auth[_0xafa9('0x7')](),controller[_0xafa9('0x10')]);router['post']('/:id/members',auth['isAuthenticated'](),controller[_0xafa9('0x11')]);router[_0xafa9('0x12')](_0xafa9('0xe'),auth[_0xafa9('0x7')](),controller[_0xafa9('0x13')]);router[_0xafa9('0x14')](_0xafa9('0xa'),auth[_0xafa9('0x7')](),controller['update']);router['delete'](_0xafa9('0xa'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xafa9('0x15'),auth['isAuthenticated'](),controller[_0xafa9('0x16')]);module[_0xafa9('0x17')]=router; \ No newline at end of file +var _0xd843=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','/:id/messages','post','create','/:id/members','addMembers','put','destroy','exports'];(function(_0x4261c4,_0x47c1f3){var _0x525e7c=function(_0x285a92){while(--_0x285a92){_0x4261c4['push'](_0x4261c4['shift']());}};_0x525e7c(++_0x47c1f3);}(_0xd843,0x1ee));var _0x3d84=function(_0xe8e91,_0x401ca3){_0xe8e91=_0xe8e91-0x0;var _0x1258fe=_0xd843[_0xe8e91];return _0x1258fe;};'use strict';var multer=require(_0x3d84('0x0'));var util=require(_0x3d84('0x1'));var path=require(_0x3d84('0x2'));var timeout=require(_0x3d84('0x3'));var express=require(_0x3d84('0x4'));var router=express[_0x3d84('0x5')]();var fs_extra=require(_0x3d84('0x6'));var auth=require(_0x3d84('0x7'));var interaction=require(_0x3d84('0x8'));var config=require(_0x3d84('0x9'));var controller=require(_0x3d84('0xa'));router[_0x3d84('0xb')]('/',auth[_0x3d84('0xc')](),controller[_0x3d84('0xd')]);router[_0x3d84('0xb')](_0x3d84('0xe'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x3d84('0xf'),auth['isAuthenticated'](),controller[_0x3d84('0x10')]);router['get'](_0x3d84('0x11'),auth[_0x3d84('0xc')](),controller['getUnread']);router[_0x3d84('0xb')]('/:id/members',auth[_0x3d84('0xc')](),controller['getMembers']);router[_0x3d84('0xb')](_0x3d84('0x12'),auth[_0x3d84('0xc')](),controller['getMessages']);router[_0x3d84('0x13')]('/',auth['isAuthenticated'](),controller[_0x3d84('0x14')]);router['post'](_0x3d84('0x15'),auth[_0x3d84('0xc')](),controller[_0x3d84('0x16')]);router[_0x3d84('0x13')](_0x3d84('0x12'),auth[_0x3d84('0xc')](),controller['addMessage']);router[_0x3d84('0x17')]('/:id',auth[_0x3d84('0xc')](),controller['update']);router['delete'](_0x3d84('0xf'),auth[_0x3d84('0xc')](),controller[_0x3d84('0x18')]);router['delete'](_0x3d84('0x15'),auth[_0x3d84('0xc')](),controller['removeMembers']);module[_0x3d84('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 8815cbe..4f30bca 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 _0x282b=['TEXT','STRING','DATE','long','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x282b,0xec));var _0xb282=function(_0x19d0c0,_0xaa15af){_0x19d0c0=_0x19d0c0-0x0;var _0x5551b7=_0x282b[_0x19d0c0];return _0x5551b7;};'use strict';var Sequelize=require(_0xb282('0x0'));module[_0xb282('0x1')]={'closed':{'type':Sequelize[_0xb282('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb282('0x3')]},'ratingType':{'type':Sequelize[_0xb282('0x4')]('star','thumb'),'defaultValue':_0xb282('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0xb282('0x6')]},'mailTranscript':{'type':Sequelize[_0xb282('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb282('0x8')]},'disposition':{'type':Sequelize[_0xb282('0x7')]},'secondDisposition':{'type':Sequelize[_0xb282('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb282('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xb282('0x7')]},'osName':{'type':Sequelize[_0xb282('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0xb282('0x7')]},'deviceVendor':{'type':Sequelize[_0xb282('0x7')]},'deviceType':{'type':Sequelize[_0xb282('0x7')]},'referer':{'type':Sequelize[_0xb282('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0xb282('0x9'))},'read1stAt':{'type':Sequelize[_0xb282('0x8')]},'lastMsgAt':{'type':Sequelize[_0xb282('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xb282('0x4')]('in',_0xb282('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0xb282('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xb282('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x38c9=['long','out','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x10b253,_0x5acad5){var _0x5c08fb=function(_0x443704){while(--_0x443704){_0x10b253['push'](_0x10b253['shift']());}};_0x5c08fb(++_0x5acad5);}(_0x38c9,0x199));var _0x938c=function(_0x14363e,_0x4f0e0d){_0x14363e=_0x14363e-0x0;var _0x17c56d=_0x38c9[_0x14363e];return _0x17c56d;};'use strict';var Sequelize=require(_0x938c('0x0'));module[_0x938c('0x1')]={'closed':{'type':Sequelize[_0x938c('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x938c('0x3')](_0x938c('0x4'),_0x938c('0x5')),'defaultValue':_0x938c('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x938c('0x6')]},'mailTranscript':{'type':Sequelize[_0x938c('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x938c('0x8')]},'disposition':{'type':Sequelize[_0x938c('0x7')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x938c('0x7')]},'note':{'type':Sequelize[_0x938c('0x7')]},'browserName':{'type':Sequelize[_0x938c('0x7')]},'browserVersion':{'type':Sequelize[_0x938c('0x7')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x938c('0x7')]},'deviceVendor':{'type':Sequelize[_0x938c('0x7')]},'deviceType':{'type':Sequelize[_0x938c('0x7')]},'referer':{'type':Sequelize[_0x938c('0x6')]},'customerIp':{'type':Sequelize[_0x938c('0x7')]},'formData':{'type':Sequelize[_0x938c('0x6')](_0x938c('0x9'))},'read1stAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgAt':{'type':Sequelize[_0x938c('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x938c('0x3')]('in',_0x938c('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x938c('0x7')]},'customerPort':{'type':Sequelize[_0x938c('0x7')]},'vidaooSessionId':{'type':Sequelize[_0x938c('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0x938c('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 b1ddbac..1b7db01 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 _0x4665=['defaults','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','end','status','json','offset','limit','undefined','count','apply','reject','save','update','destroy','name','send','render','merge','body','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','answered','unmanaged','abandoned','UserId','closed','talking','disposition','index','ChatInteraction','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','having','operator','$substring','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','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?','group','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','fields','a.key','Account.key','Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','c.fax','o.fullname','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','show','params','includeAll','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','https://api-vidaoo.xcally.com/api/v1/meetings','email','vidaooNote','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','close','server/files/chat/upload/','transcript-%s.txt','ChatMessage','User','format','%s%d','agentAlias','System','customer','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','include','findAll','rows','getMyMessages','includeAgent','setTags','omit','spread','emit','removeTags','download','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','Account','Owner','get','Chat','closedAt','browserName','customerPort','N.A.','Messages','tail','existsSync','createReadStream','pipe','createWriteStream','out','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','unlinkSync','sendStatus','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis'];(function(_0x197c01,_0x469b71){var _0x56fbc0=function(_0x5dcc07){while(--_0x5dcc07){_0x197c01['push'](_0x197c01['shift']());}};_0x56fbc0(++_0x469b71);}(_0x4665,0x122));var _0x5466=function(_0x20a0b7,_0x5becdd){_0x20a0b7=_0x20a0b7-0x0;var _0x455b53=_0x4665[_0x20a0b7];return _0x455b53;};'use strict';var emlformat=require(_0x5466('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5466('0x1'));var jsonpatch=require(_0x5466('0x2'));var rp=require(_0x5466('0x3'));var moment=require(_0x5466('0x4'));var BPromise=require(_0x5466('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5466('0x6'));var sox=require(_0x5466('0x7'));var csv=require(_0x5466('0x8'));var ejs=require(_0x5466('0x9'));var fs=require('fs');var fs_extra=require(_0x5466('0xa'));var _=require(_0x5466('0xb'));var squel=require(_0x5466('0xc'));var crypto=require('crypto');var jsforce=require(_0x5466('0xd'));var deskjs=require(_0x5466('0xe'));var toCsv=require(_0x5466('0x8'));var querystring=require(_0x5466('0xf'));var Papa=require(_0x5466('0x10'));var Redis=require(_0x5466('0x11'));var authService=require(_0x5466('0x12'));var qs=require(_0x5466('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require('../../components/export/pdf');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5466('0x14'))(_0x5466('0x15'));var utils=require(_0x5466('0x16'));var config=require(_0x5466('0x17'));var licenseUtil=require(_0x5466('0x18'));var db=require(_0x5466('0x19'))['db'];config[_0x5466('0x1a')]=_[_0x5466('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5466('0x1a')]));require('./chatInteraction.socket')[_0x5466('0x1c')](socket);var jayson=require(_0x5466('0x1d'));var client=jayson[_0x5466('0x1e')][_0x5466('0x1f')]({'port':0x232b});var client9004=jayson[_0x5466('0x1e')][_0x5466('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0x61ecf2,_0xeda703,_0x4ca0c6,_0xc80850){return new BPromise(function(_0x329331,_0x5752e3){var _0x3049b4=_0xc80850||client;return _0x3049b4[_0x5466('0x20')](_0x61ecf2,_0x4ca0c6)[_0x5466('0x21')](function(_0x4cee58){logger[_0x5466('0x22')](_0x5466('0x23'),_0xeda703,_0x5466('0x24'));logger['debug'](_0x5466('0x25'),_0xeda703,_0x5466('0x24'),JSON[_0x5466('0x26')](_0x4cee58));if(_0x4cee58[_0x5466('0x27')]){if(_0x4cee58[_0x5466('0x27')][_0x5466('0x28')]===0x1f4){logger[_0x5466('0x27')]('ChatInteraction,\x20%s,\x20%s',_0xeda703,_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);return _0x5752e3(_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);}logger[_0x5466('0x27')](_0x5466('0x23'),_0xeda703,_0x4cee58[_0x5466('0x27')][_0x5466('0x29')]);return _0x329331(_0x4cee58['error'][_0x5466('0x29')]);}else{logger[_0x5466('0x22')](_0x5466('0x23'),_0xeda703,_0x5466('0x24'));_0x329331(_0x4cee58[_0x5466('0x2a')][_0x5466('0x29')]);}})[_0x5466('0x2b')](function(_0x543578){logger[_0x5466('0x27')](_0x5466('0x23'),_0xeda703,_0x543578);_0x5752e3(_0x543578);});});}function respondWithStatusCode(_0x4a4d92,_0x53d9fe){_0x53d9fe=_0x53d9fe||0xcc;return function(_0x49b8ba){if(_0x49b8ba){return _0x4a4d92['sendStatus'](_0x53d9fe);}return _0x4a4d92['status'](_0x53d9fe)[_0x5466('0x2c')]();};}function respondWithResult(_0x2f7872,_0x5116da){_0x5116da=_0x5116da||0xc8;return function(_0x549d8e){if(_0x549d8e){return _0x2f7872[_0x5466('0x2d')](_0x5116da)[_0x5466('0x2e')](_0x549d8e);}};}function respondWithFilteredResult(_0x4d4841,_0x35c1bf){return function(_0x3c5939){if(_0x3c5939){var _0x4932f1=typeof _0x35c1bf[_0x5466('0x2f')]==='undefined'&&typeof _0x35c1bf[_0x5466('0x30')]===_0x5466('0x31');var _0x1c621c=_0x3c5939[_0x5466('0x32')];var _0x265f39=_0x4932f1?0x0:_0x35c1bf[_0x5466('0x2f')];var _0x2114b4=_0x4932f1?_0x3c5939[_0x5466('0x32')]:_0x35c1bf[_0x5466('0x2f')]+_0x35c1bf[_0x5466('0x30')];var _0x22faf8;if(_0x2114b4>=_0x1c621c){_0x2114b4=_0x1c621c;_0x22faf8=0xc8;}else{_0x22faf8=0xce;}_0x4d4841[_0x5466('0x2d')](_0x22faf8);return _0x4d4841['set']('Content-Range',_0x265f39+'-'+_0x2114b4+'/'+_0x1c621c)[_0x5466('0x2e')](_0x3c5939);}return null;};}function patchUpdates(_0x4d8ea8){return function(_0xeb5a2e){try{jsonpatch[_0x5466('0x33')](_0xeb5a2e,_0x4d8ea8,!![]);}catch(_0x5b8fa6){return BPromise[_0x5466('0x34')](_0x5b8fa6);}return _0xeb5a2e[_0x5466('0x35')]();};}function saveUpdates(_0x121f78,_0x24be84){return function(_0x2a2995){if(_0x2a2995){return _0x2a2995[_0x5466('0x36')](_0x121f78)[_0x5466('0x21')](function(_0x2008a1){return _0x2008a1;});}return null;};}function removeEntity(_0x5502ad,_0x19fa34){return function(_0x3e033a){if(_0x3e033a){return _0x3e033a[_0x5466('0x37')]()[_0x5466('0x21')](function(){_0x5502ad[_0x5466('0x2d')](0xcc)[_0x5466('0x2c')]();});}};}function handleEntityNotFound(_0xfa8196,_0x276ade){return function(_0x254852){if(!_0x254852){_0xfa8196['sendStatus'](0x194);}return _0x254852;};}function handleError(_0x55c5b5,_0x1eb245){_0x1eb245=_0x1eb245||0x1f4;return function(_0x1d62e9){logger[_0x5466('0x27')](_0x1d62e9['stack']);if(_0x1d62e9[_0x5466('0x38')]){delete _0x1d62e9[_0x5466('0x38')];}_0x55c5b5[_0x5466('0x2d')](_0x1eb245)[_0x5466('0x39')](_0x1d62e9);};}function getMustacheRender(_0x319343,_0x4347a4){return Mustache[_0x5466('0x3a')](_0x319343,_[_0x5466('0x3b')](_0x4347a4[_0x5466('0x3c')],{'contact':_0x4347a4['contact'],'message':_0x4347a4['message'],'agent':_0x4347a4[_0x5466('0x3d')],'interaction':_0x4347a4[_0x5466('0x3e')],'account':_0x4347a4[_0x5466('0x3f')]}))||'';}function getInteractionUsers(_0x4ce5cb,_0x1b213b){return new BPromise(function(_0x4d22fc,_0x119c11){try{if(_0x1b213b[_0x4ce5cb['id']]){_0x4ce5cb[_0x5466('0x40')]=_[_0x5466('0x41')](_0x1b213b[_0x4ce5cb['id']],function(_0x555272){return{'id':_0x555272['id'],'fullname':_0x555272[_0x5466('0x42')]};});}}catch(_0x3c7efd){_0x119c11(_0x3c7efd);}_0x4d22fc(_0x4ce5cb);});}function getInteractionTags(_0x4607be,_0x178d41){return new BPromise(function(_0x484bda,_0x1a498b){try{if(_0x4607be[_0x5466('0x43')]){_0x4607be[_0x5466('0x44')]=[];_0x4607be['TagIds'][_0x5466('0x45')](',')[_0x5466('0x46')](function(_0x34f80e){_0x4607be[_0x5466('0x44')][_0x5466('0x47')](_0x178d41[_0x34f80e]);});}delete _0x4607be['TagIds'];}catch(_0x13d85b){_0x1a498b(_0x13d85b);}_0x484bda(_0x4607be);});}function updateChatInteraction(_0x1b6257,_0x9e34cf,_0x4eecac){return new BPromise(function(_0x1da86c,_0x55d1fb){return getInteractionUsers(_0x1b6257,_0x4eecac)['then'](function(_0x509e9b){return getInteractionTags(_0x509e9b,_0x9e34cf);})[_0x5466('0x21')](function(_0x2ee9d2){return getStateInteraction(_0x2ee9d2);})['then'](function(_0x4e0b0c){_0x1da86c(_0x4e0b0c);})['catch'](function(_0x25a744){_0x55d1fb(_0x25a744);});});}function getStateInteraction(_0x5de7cd){return new BPromise(function(_0x9ff76b){_0x5de7cd[_0x5466('0x48')]=0x0;_0x5de7cd['talking']=0x0;_0x5de7cd[_0x5466('0x49')]=0x0;_0x5de7cd[_0x5466('0x4a')]=0x0;_0x5de7cd[_0x5466('0x4b')]=0x0;_0x5de7cd['total']=0x0;if(!_0x5de7cd['closed']&&!_0x5de7cd[_0x5466('0x4c')]){_0x5de7cd[_0x5466('0x48')]+=0x1;}if(!_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd['UserId']){_0x5de7cd[_0x5466('0x4e')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd[_0x5466('0x48')]-=0x1;}}if(_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd['disposition']===_0x5466('0x4b')){_0x5de7cd[_0x5466('0x4b')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd['waiting']-=0x1;}}else if(_0x5de7cd[_0x5466('0x4d')]&&!_0x5de7cd[_0x5466('0x4c')]&&_0x5de7cd[_0x5466('0x4f')]){_0x5de7cd[_0x5466('0x4a')]+=0x1;if(_0x5de7cd[_0x5466('0x48')]){_0x5de7cd['waiting']-=0x1;}}else if(_0x5de7cd[_0x5466('0x4d')]&&_0x5de7cd[_0x5466('0x4c')]){_0x5de7cd[_0x5466('0x49')]+=0x1;if(_0x5de7cd[_0x5466('0x4e')]){_0x5de7cd[_0x5466('0x4e')]-=0x1;}}_0x5de7cd['total']+=0x1;_0x9ff76b(_0x5de7cd);});}exports[_0x5466('0x50')]=function(_0x5d35cb,_0x42e8cf){var _0x2ae9cb={},_0x2d77a1={},_0x3a2fca={'count':0x0,'rows':[]};var _0x7833d4=_[_0x5466('0x41')](db[_0x5466('0x51')][_0x5466('0x52')],function(_0x121cf3){return{'name':_0x121cf3[_0x5466('0x53')],'type':_0x121cf3['type'][_0x5466('0x54')]};});_0x2d77a1[_0x5466('0x55')]=_[_0x5466('0x41')](_0x7833d4,_0x5466('0x38'));_0x2d77a1[_0x5466('0x56')]=_[_0x5466('0x57')](_0x5d35cb[_0x5466('0x56')]);_0x2d77a1['filters']=_[_0x5466('0x58')](_0x2d77a1[_0x5466('0x55')],_0x2d77a1[_0x5466('0x56')]);_0x2ae9cb[_0x5466('0x59')]=_['intersection'](_0x2d77a1[_0x5466('0x55')],qs['fields'](_0x5d35cb['query']['fields']));_0x2ae9cb[_0x5466('0x59')]=_0x2ae9cb[_0x5466('0x59')][_0x5466('0x5a')]?_0x2ae9cb[_0x5466('0x59')]:_0x2d77a1['model'];if(!_0x5d35cb[_0x5466('0x56')][_0x5466('0x5b')](_0x5466('0x5c'))){_0x2ae9cb[_0x5466('0x30')]=qs['limit'](_0x5d35cb[_0x5466('0x56')][_0x5466('0x30')]);_0x2ae9cb['offset']=qs['offset'](_0x5d35cb[_0x5466('0x56')][_0x5466('0x2f')]);}_0x2ae9cb[_0x5466('0x5d')]=qs[_0x5466('0x5e')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x5e')]);_0x2ae9cb[_0x5466('0x5f')]=qs[_0x5466('0x60')](_['pick'](_0x5d35cb[_0x5466('0x56')],_0x2d77a1[_0x5466('0x60')]),_0x7833d4);var _0x5e9eb0=[];var _0x4f262a=squel[_0x5466('0x61')]()[_0x5466('0x62')]('id')[_0x5466('0x62')]('name')[_0x5466('0x62')](_0x5466('0x63'))[_0x5466('0x64')](_0x5466('0x65'));var _0x3bf705=squel[_0x5466('0x61')]()[_0x5466('0x62')](_0x5466('0x66'))['field']('u.fullname')[_0x5466('0x62')]('ui.ChatInteractionId')[_0x5466('0x64')](_0x5466('0x67'),'ui')['left_join'](_0x5466('0x68'),'u',_0x5466('0x69'));var _0x1fff78=squel[_0x5466('0x61')]()['from'](_0x5466('0x6a'),'i')['left_join']('cm_contacts','c',_0x5466('0x6b'))[_0x5466('0x6c')]('users','o','o.id\x20=\x20i.UserId')[_0x5466('0x6c')](_0x5466('0x6d'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x5466('0x6c')](_0x5466('0x6e'),'me',_0x5466('0x6f'))[_0x5466('0x6c')]('chat_interaction_has_tags','it',_0x5466('0x70'))[_0x5466('0x6c')](_0x5466('0x65'),'t','t.id\x20=\x20it.TagId');var _0x59adb1=squel[_0x5466('0x71')]();var _0x46330f=[];var _0x1c95f8=squel[_0x5466('0x71')]();var _0x342a62;if(_0x5d35cb[_0x5466('0x56')]['search']){_0x342a62=as[_0x5466('0x72')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x73')]);var _0x5897f2=_0x342a62[_0x5466('0x74')];for(var _0x126518=0x0;_0x126518<_0x342a62[_0x5466('0x75')][_0x5466('0x5a')];_0x126518++){var _0x142e78=_0x342a62['conditions'][_0x126518];var _0x33a9e5='i';var _0xf5b805=_[_0x5466('0x76')](_0x7833d4,['name',_0x142e78['field']]);if(!_0xf5b805){switch(_0x142e78['field']){case _0x5466('0x77'):if(_0x142e78['value']==0x1){_0x1fff78[_0x5466('0x78')]('`'+_0x142e78[_0x5466('0x62')]+'`\x20=\x200');}else{_0x1fff78[_0x5466('0x78')]('`'+_0x142e78[_0x5466('0x62')]+'`\x20>\x200');}break;case'Contact':if(_0x142e78[_0x5466('0x79')]===_0x5466('0x7a')){if(_0x142e78['value'][_0x5466('0x45')]('\x20')['length']>0x1){_0x59adb1[_0x5897f2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x5466('0x7b')](_0x142e78[_0x5466('0x7c')]),null);}else{var _0x10c03e='%'+_0x142e78['value']+'%';_0x59adb1[_0x5897f2](_0x5466('0x7d'),_0x10c03e,_0x10c03e,_0x10c03e);}}else{_0xf5b805=_['find'](_0x7833d4,[_0x5466('0x38'),_0x5466('0x7e')]);_0x142e78[_0x5466('0x62')]=_0x5466('0x7e');_0x53ce86=as[_0x5466('0x7f')](_0x33a9e5,_0xf5b805['type'],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86['text'],_0x53ce86['value'][_0x5466('0x80')],_0x53ce86[_0x5466('0x7c')]['end']);}break;case'Tag':var _0x222eae=_0x142e78[_0x5466('0x7c')][_0x5466('0x45')](',')['map'](function(_0x4a7520){return Number(_0x4a7520);});_0x222eae[_0x5466('0x46')](function(_0x3ad76c){_0x1c95f8['or'](_0x5466('0x81'),'%,'+_0x3ad76c+',%');});_0x46330f=_[_0x5466('0x82')](_0x46330f,_0x222eae);break;case'User':if(_0x142e78[_0x5466('0x79')]==='$substring'){_0x59adb1[_0x5897f2](_0x5466('0x83'),'%'+_0x142e78[_0x5466('0x7c')]+'%',null);}else{_0xf5b805=_[_0x5466('0x76')](_0x7833d4,['name',_0x5466('0x4c')]);_0x142e78[_0x5466('0x62')]='UserId';_0x53ce86=as[_0x5466('0x7f')](_0x33a9e5,_0xf5b805[_0x5466('0x84')],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86['text'],_0x53ce86[_0x5466('0x7c')][_0x5466('0x80')],_0x53ce86['value'][_0x5466('0x2c')]);}break;case _0x5466('0x3c'):_0x53ce86=as['buildExpression']('me',null,_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86[_0x5466('0x85')],_0x53ce86[_0x5466('0x7c')][_0x5466('0x80')],_0x53ce86[_0x5466('0x7c')][_0x5466('0x2c')]);break;}}else{var _0x53ce86=as['buildExpression'](_0x33a9e5,_0xf5b805[_0x5466('0x84')],_0x142e78);_0x59adb1[_0x5897f2](_0x53ce86[_0x5466('0x85')],_0x53ce86['value']['start'],_0x53ce86['value'][_0x5466('0x2c')]);}}}else{var _0x93bdb9=_(_0x5d35cb[_0x5466('0x56')])[_0x5466('0x57')]()[_0x5466('0x41')](function(_0x4999f3){return _[_0x5466('0x86')](_0x7833d4,[_0x5466('0x38'),_0x4999f3])?_0x4999f3:undefined;})[_0x5466('0x87')]()['value']();if(!_[_0x5466('0x88')](_0x93bdb9)){_0x93bdb9[_0x5466('0x46')](function(_0x370d1c){if(_0x370d1c===_0x5466('0x89')){_0x1fff78[_0x5466('0x5f')](_0x5466('0x8a'),[][_0x5466('0x8b')](_0x5d35cb[_0x5466('0x56')][_0x370d1c]));}else if(_0x370d1c===_0x5466('0x8c')){var _0x2889b9=JSON[_0x5466('0x8d')](_0x5d35cb[_0x5466('0x56')][_0x370d1c])[_0x5466('0x8e')];var _0x49ca7=JSON['parse'](_0x5d35cb[_0x5466('0x56')][_0x370d1c])[_0x5466('0x8f')];_0x1fff78['where'](_0x5466('0x90'),_0x2889b9,_0x49ca7);}else{if(_0x5d35cb[_0x5466('0x56')][_0x370d1c]===_0x5466('0x91')){_0x1fff78[_0x5466('0x5f')]('i.'+_0x370d1c+'\x20IS\x20NULL');}else{_0x1fff78[_0x5466('0x5f')]('i.'+_0x370d1c+_0x5466('0x92'),_0x5d35cb[_0x5466('0x56')][_0x370d1c]);}}});}if(_0x5d35cb[_0x5466('0x56')]['read']){if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x93')]==0x1){_0x1fff78[_0x5466('0x78')]('`unreadMessages`\x20=\x200');}else{_0x1fff78['having'](_0x5466('0x94'));}}if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]){_0x46330f=_[_0x5466('0x96')](_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')])?_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]:new Array(_0x5d35cb[_0x5466('0x56')][_0x5466('0x95')]);_0x46330f[_0x5466('0x46')](function(_0x53f70f){_0x1c95f8['or'](_0x5466('0x81'),'%,'+_0x53f70f+',%');});}if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x97')]){var _0x38a1fd=_0x5d35cb[_0x5466('0x56')][_0x5466('0x97')]['replace']('\x5c','\x5c\x5c')[_0x5466('0x98')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x38a1fd)){_0x59adb1['or'](_0x5466('0x99'),_0x38a1fd+'%');}else{_0x59adb1['or'](_0x5466('0x9a'),qs[_0x5466('0x7b')](_0x38a1fd))['or'](_0x5466('0x9b'),_0x38a1fd+'%');}}}_0x1fff78[_0x5466('0x5f')](_0x59adb1);_0x1fff78[_0x5466('0x9c')]('i.id');var _0x47fb12={'type':db[_0x5466('0x9d')][_0x5466('0x9e')][_0x5466('0x9f')],'raw':!![]};var _0xe6b78f=_0x1fff78[_0x5466('0xa0')]();_0xe6b78f[_0x5466('0x62')]('i.id');_0xe6b78f['field'](_0x5466('0xa1'),_0x5466('0x77'));if(_0x2ae9cb['order']){_0x2ae9cb[_0x5466('0x5d')]['forEach'](function(_0x20e045){var _0x3d0231=_0x20e045[0x0]===_0x5466('0xa2')?_0x20e045[0x0]:'i.'+_0x20e045[0x0];_0x1fff78[_0x5466('0x5d')](_0x3d0231,_0x20e045[0x1]===_0x5466('0xa3')?![]:!![]);});}if(!_['isEmpty'](_0x46330f)){_0x1fff78[_0x5466('0x78')](_0x1c95f8);_0xe6b78f[_0x5466('0x5f')]('t.id\x20IN\x20?',_0x46330f);}BPromise['resolve']()['then'](function(){if(!_0x342a62){if(_0x5d35cb[_0x5466('0x56')][_0x5466('0x89')])return;_0xe6b78f[_0x5466('0x5f')](_0x5466('0xa4'));_0x1fff78[_0x5466('0x5f')](_0x5466('0xa4'));return;}if(_0x5d35cb[_0x5466('0xa5')][_0x5466('0xa6')]!==_0x5466('0x3d'))return;return _0x5d35cb[_0x5466('0xa5')][_0x5466('0xa7')]({'attributes':['id'],'raw':!![]})[_0x5466('0x21')](function(_0x4f7ae8){if(_[_0x5466('0x88')](_0x4f7ae8)){_0xe6b78f['where'](_0x5466('0xa8'));_0x1fff78[_0x5466('0x5f')](_0x5466('0xa8'));}else{_0xe6b78f['where'](_0x5466('0x8a'),_[_0x5466('0x41')](_0x4f7ae8,'id'));_0x1fff78[_0x5466('0x5f')]('i.ChatWebsiteId\x20IN\x20?',_[_0x5466('0x41')](_0x4f7ae8,'id'));}});})[_0x5466('0x21')](function(){if(_0x5d35cb['user']['role']===_0x5466('0x3d')&&!_0x342a62&&!_0x5d35cb['query'][_0x5466('0x89')])return[];return db[_0x5466('0xa9')][_0x5466('0x56')](_0xe6b78f[_0x5466('0xaa')](),_0x47fb12);})['then'](function(_0x1c16f4){_0x3a2fca[_0x5466('0x32')]=_0x1c16f4[_0x5466('0x5a')];if(_0x3a2fca['count']===0x0)return[];return db[_0x5466('0xa9')][_0x5466('0x56')](_0x4f262a[_0x5466('0xaa')](),_0x47fb12)[_0x5466('0x21')](function(_0x90070){_0x5e9eb0=_['keyBy'](_0x90070,'id');_0x47fb12=_['merge'](_0x47fb12,{'model':db[_0x5466('0x51')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5d35cb['query'][_0x5466('0xab')]){_0x2ae9cb[_0x5466('0x59')][_0x5466('0x46')](function(_0x1beb22){_0x1fff78[_0x5466('0x62')]('i.'+_0x1beb22);});}else{_0x1fff78[_0x5466('0x62')](_0x5466('0xa1'),_0x5466('0x77'));_0x1fff78[_0x5466('0x62')](_0x5466('0xac'),_0x5466('0xad'));_0x1fff78['field']('a.mandatoryDisposition',_0x5466('0xae'));_0x1fff78[_0x5466('0x62')]('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',_0x5466('0xa2'));_0x1fff78['field']('i.*');_0x1fff78[_0x5466('0x62')](_0x5466('0xaf'),_0x5466('0xb0'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb1'),_0x5466('0xb2'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb3'),'Contact.email');_0x1fff78['field']('c.phone',_0x5466('0xb4'));_0x1fff78[_0x5466('0x62')]('c.mobile','Contact.mobile');_0x1fff78[_0x5466('0x62')](_0x5466('0xb5'),'Contact.fax');_0x1fff78['field'](_0x5466('0xb6'),_0x5466('0xb7'));_0x1fff78[_0x5466('0x62')]('o.internal',_0x5466('0xb8'));_0x1fff78[_0x5466('0x62')](_0x5466('0xb9'),_0x5466('0x43'));}if(_0x2ae9cb[_0x5466('0x30')])_0x1fff78[_0x5466('0x30')](_0x2ae9cb[_0x5466('0x30')]);if(_0x2ae9cb['offset'])_0x1fff78[_0x5466('0x2f')](_0x2ae9cb['offset']);return db[_0x5466('0xa9')][_0x5466('0x56')](_0x1fff78[_0x5466('0xaa')](),_0x47fb12);})[_0x5466('0x21')](function(_0xfc6734){if(_0xfc6734[_0x5466('0x5a')]>0x0)_0x3bf705[_0x5466('0x5f')](_0x5466('0xba'),_[_0x5466('0x41')](_0xfc6734,'id'));return db[_0x5466('0xa9')][_0x5466('0x56')](_0x3bf705[_0x5466('0xaa')](),_0x47fb12)['then'](function(_0x11850c){var _0x51197d=_[_0x5466('0xbb')](_0x11850c,_0x5466('0xbc'));var _0x1aa972=[];_0xfc6734['forEach'](function(_0x4f3a2d){_0x1aa972[_0x5466('0x47')](updateChatInteraction(_0x4f3a2d,_0x5e9eb0,_0x51197d));});return BPromise[_0x5466('0xbd')](_0x1aa972);});});})['then'](function(_0xe7411c){_0x3a2fca['rows']=_0xe7411c;return _0x3a2fca;})[_0x5466('0x21')](respondWithFilteredResult(_0x42e8cf,_0x2ae9cb))['catch'](handleError(_0x42e8cf,null));};exports[_0x5466('0xbe')]=function(_0x1773a6,_0x2a0507){var _0x465d68={'raw':![],'where':{'id':_0x1773a6[_0x5466('0xbf')]['id']}},_0x27b7ec={};_0x27b7ec[_0x5466('0x55')]=_[_0x5466('0x57')](db['ChatInteraction'][_0x5466('0x52')]);_0x27b7ec[_0x5466('0x56')]=_[_0x5466('0x57')](_0x1773a6['query']);_0x27b7ec['filters']=_[_0x5466('0x58')](_0x27b7ec['model'],_0x27b7ec[_0x5466('0x56')]);_0x465d68[_0x5466('0x59')]=_[_0x5466('0x58')](_0x27b7ec['model'],qs[_0x5466('0xab')](_0x1773a6[_0x5466('0x56')][_0x5466('0xab')]));_0x465d68['attributes']=_0x465d68[_0x5466('0x59')]['length']?_0x465d68[_0x5466('0x59')]:_0x27b7ec[_0x5466('0x55')];if(_0x1773a6['query'][_0x5466('0xc0')]){_0x465d68['include']=[{'all':!![]}];}_0x465d68=_[_0x5466('0x3b')]({},_0x465d68,_0x1773a6[_0x5466('0xc1')]);return db[_0x5466('0x51')]['find'](_0x465d68)['then'](handleEntityNotFound(_0x2a0507,null))[_0x5466('0x21')](respondWithResult(_0x2a0507,null))['catch'](handleError(_0x2a0507,null));};exports[_0x5466('0xc2')]=function(_0x1df4ff,_0x560d07){return db[_0x5466('0x51')][_0x5466('0xc2')](_0x1df4ff['body'],{})['then'](respondWithResult(_0x560d07,0xc9))[_0x5466('0x2b')](handleError(_0x560d07,null));};exports['update']=function(_0x5e22c9,_0x5be413){if(_0x5e22c9[_0x5466('0x3c')]['id']){delete _0x5e22c9[_0x5466('0x3c')]['id'];}return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x5e22c9[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x5be413,null))['then'](saveUpdates(_0x5e22c9[_0x5466('0x3c')],null))[_0x5466('0x21')](respondWithResult(_0x5be413,null))[_0x5466('0x2b')](handleError(_0x5be413,null));};exports[_0x5466('0x37')]=function(_0x378e5e,_0x106aae){return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x378e5e[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x106aae,null))[_0x5466('0x21')](removeEntity(_0x106aae,null))[_0x5466('0x2b')](handleError(_0x106aae,null));};exports[_0x5466('0xc3')]=function(_0x21ea78,_0x54aabd){return db[_0x5466('0x51')][_0x5466('0xc3')]()[_0x5466('0x21')](respondWithResult(_0x54aabd,null))['catch'](handleError(_0x54aabd,null));};exports[_0x5466('0xc4')]=function(_0x158080,_0x2dda3e){var _0x205f2d=_0x158080[_0x5466('0xbf')]['id'];var _0x3dad05;var _0x8eda1a;var _0x4080af;return db['ChatInteraction'][_0x5466('0xc5')]({'where':{'id':_0x205f2d}})[_0x5466('0x21')](function(_0x2d57f1){_0x3dad05=_0x2d57f1;return db[_0x5466('0xc6')]['findOne']({'where':{'id':_0x2d57f1[_0x5466('0x89')]},'attributes':['id',_0x5466('0xc7'),_0x5466('0xc8'),_0x5466('0xc9'),'vidaooNote',_0x5466('0xca')],'raw':!![]});})[_0x5466('0x21')](function(_0x449c11){if(_0x449c11&&_0x449c11['vidaooApiKey']&&_0x449c11[_0x5466('0xc8')]){_0x8eda1a=_0x449c11;var _0x52c4e3={'interaction':{'id':_0x205f2d},'agent':{'id':_0x158080[_0x5466('0xa5')]['id'],'name':_0x158080['user']['name'],'fullname':_0x158080[_0x5466('0xa5')][_0x5466('0x42')],'email':_0x158080['user']['email']},'contact':_0x158080[_0x5466('0x3c')]['contact'],'account':_0x158080[_0x5466('0x3c')]['account']};var _0x36cba0={'rejectUnauthorized':![],'method':'POST','url':_0x5466('0xcb'),'headers':{'X-APIKEY':_0x449c11[_0x5466('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x158080[_0x5466('0xa5')][_0x5466('0xcc')]],'buttons':null,'topic':_0x8eda1a[_0x5466('0xc9')],'note':_['isNull'](_0x8eda1a['vidaooNote'])?null:getMustacheRender(_0x8eda1a[_0x5466('0xcd')],_0x52c4e3),'metadata':null},'redirect':_0x5466('0xce'),'json':!![]};try{if(!_['isNull'](_0x8eda1a['vidaooMetadata'])){var _0x3cfa53=getMustacheRender(_0x8eda1a[_0x5466('0xca')],_0x52c4e3);var _0x339ee6=JSON['parse'](_0x3cfa53);_0x36cba0[_0x5466('0x3c')][_0x5466('0xcf')]=_0x339ee6;}}catch(_0x2c85f6){throw new db[(_0x5466('0x9d'))][(_0x5466('0xd0'))](_0x5466('0xd1'));}return rp(_0x36cba0);}else{throw new db[(_0x5466('0x9d'))]['ValidationError'](_0x5466('0xd2'));}})['then'](function(_0x658c4c){_0x4080af=_0x658c4c;if(_0x4080af['id']){var _0x2bdfe7={'body':_0x4080af[_0x5466('0xd3')],'ChatWebsiteId':_0x8eda1a['id'],'ChatInteractionId':_0x3dad05['id'],'direction':'out','UserId':_0x158080[_0x5466('0xa5')]['id']};return db['ChatMessage'][_0x5466('0xc2')](_0x2bdfe7,{});}else{throw new db[(_0x5466('0x9d'))][(_0x5466('0xd0'))](_0x5466('0xd4'));}})['then'](function(){return _0x3dad05[_0x5466('0xd5')]({'vidaooSessionId':_0x4080af['id']});})[_0x5466('0x21')](respondWithResult(_0x2dda3e,null))['catch'](handleError(_0x2dda3e,null));};exports['customUpdate']=function(_0x5406a3,_0x216165){if(_0x5406a3[_0x5466('0x3c')]['id']){delete _0x5406a3[_0x5466('0x3c')]['id'];}return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x5406a3[_0x5466('0xbf')]['id']},'include':[{'model':db[_0x5466('0xd6')],'as':_0x5466('0xd7')}]})[_0x5466('0x21')](handleEntityNotFound(_0x216165,null))[_0x5466('0x21')](saveUpdates(_0x5406a3[_0x5466('0x3c')],null))['then'](respondWithResult(_0x216165,null))[_0x5466('0x2b')](handleError(_0x216165,null));};exports['abandon']=function(_0x3bd049,_0x815b91,_0x4ac906){if(_0x3bd049[_0x5466('0x3c')]['id']){delete _0x3bd049['body']['id'];}return db[_0x5466('0x51')]['find']({'where':{'id':_0x3bd049[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](function(_0x1d55b4){if(!_0x1d55b4){logger[_0x5466('0x27')](_0x5466('0xd8'),_0x5466('0xd9'),0x194,_0x5466('0xda'));_0x815b91['sendStatus'](0x194);}else{if(_0x1d55b4['UserId']){throw new db[(_0x5466('0x9d'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1d55b4;})[_0x5466('0x21')](function(_0x240de8){if(_0x240de8){return _0x240de8['update']({'closed':_0x3bd049[_0x5466('0x3c')][_0x5466('0x4d')],'disposition':_0x3bd049['body'][_0x5466('0x4f')]})[_0x5466('0x21')](function(_0x27c68a){return _0x27c68a;});}})[_0x5466('0x21')](function(_0x1cf443){return respondWithRpcPromise(_0x5466('0xdb'),_0x5466('0xd9'),_0x3bd049['body'],client9004);})[_0x5466('0x21')](respondWithResult(_0x815b91,null))[_0x5466('0x2b')](handleError(_0x815b91,null));};exports[_0x5466('0xdc')]=function(_0x1533d6,_0x4f54d4,_0x1a1802){_0x1533d6[_0x5466('0x3c')][_0x5466('0x38')]=_0x1533d6[_0x5466('0xdd')][_0x5466('0xde')];_0x1533d6[_0x5466('0x3c')][_0x5466('0xdf')]=_0x1533d6['file'][_0x5466('0xe0')];_0x1533d6[_0x5466('0x3c')][_0x5466('0x84')]=_0x1533d6[_0x5466('0xdd')][_0x5466('0xe1')];return db[_0x5466('0xe2')]['create'](_0x1533d6[_0x5466('0x3c')])[_0x5466('0x21')](respondWithResult(_0x4f54d4,0xc9))[_0x5466('0x2b')](handleError(_0x4f54d4,null));};exports[_0x5466('0xe3')]=function(_0x55a126,_0x8f2641,_0x585d72){return db[_0x5466('0x51')][_0x5466('0xc5')]({'where':{'id':_0x55a126[_0x5466('0xbf')]['id']},'raw':!![]})[_0x5466('0x21')](handleEntityNotFound(_0x8f2641,null))['then'](function(_0x17f2ca){if(_0x17f2ca){if(_0x17f2ca[_0x5466('0x4d')]){return _0x8f2641['status'](0x193)[_0x5466('0x2e')]({'status':0x193,'message':_0x5466('0xe4')});}return db[_0x5466('0xe2')][_0x5466('0xc5')]({'where':{'id':_0x55a126[_0x5466('0x56')]['attachId']},'raw':!![]})[_0x5466('0x21')](handleEntityNotFound(_0x8f2641,null));}})[_0x5466('0x21')](function(_0x37598f){if(_0x37598f){var _0x237263=_0x37598f[_0x5466('0xe5')]!==null;var _0x50cbb8=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0xe8'));if(_0x237263){_0x50cbb8=path['join'](_0x50cbb8,_0x5466('0xe9'));}var _0x527a9d=path[_0x5466('0xe6')](_0x50cbb8,_0x37598f[_0x5466('0xdf')]);return _0x8f2641['download'](_0x527a9d);}})[_0x5466('0x2b')](handleError(_0x8f2641,null));};exports[_0x5466('0xea')]=function(_0x5d264d,_0x1199b4){var _0x1bdd89=null;var _0x2996ca=null;var _0x4a2cd8=null;var _0x1e082b=null;if(_0x5d264d[_0x5466('0x3c')]['id']){delete _0x5d264d[_0x5466('0x3c')]['id'];}if(_0x5d264d[_0x5466('0x3c')]['mailTranscript']){_0x1e082b=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0xeb'),util['format'](_0x5466('0xec'),Date['now']()));_0x5d264d[_0x5466('0x3c')]['pathTranscript']=_0x1e082b;}return db[_0x5466('0x51')]['find']({'where':{'id':_0x5d264d[_0x5466('0xbf')]['id']},'include':[{'model':db[_0x5466('0xed')],'as':'Messages','include':[{'model':db[_0x5466('0xee')],'as':_0x5466('0xee')}]}]})[_0x5466('0x21')](handleEntityNotFound(_0x1199b4,null))[_0x5466('0x21')](saveUpdates(_0x5d264d[_0x5466('0x3c')],null))['then'](function(_0x15b51f){if(_0x15b51f){_0x1bdd89=_0x15b51f;return db[_0x5466('0xc6')][_0x5466('0x76')]({'where':{'id':_0x1bdd89[_0x5466('0x89')]}});}})[_0x5466('0x21')](function(_0x3b231c){if(_0x3b231c){_0x4a2cd8=_0x3b231c;return db[_0x5466('0xd6')][_0x5466('0x76')]({'where':{'id':_0x1bdd89[_0x5466('0x7e')]}});}})[_0x5466('0x21')](function(_0x5c5f98){if(_0x5c5f98){_0x2996ca=_0x5c5f98;if(_0x1e082b){var _0x5a086f=null;for(var _0x2804cc=0x1;_0x2804cc<_0x1bdd89['Messages'][_0x5466('0x5a')];++_0x2804cc){_0x5a086f=_0x1bdd89['Messages'][_0x2804cc];var _0x245a4b=_0x5a086f[_0x5466('0x4c')]?util[_0x5466('0xef')](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f['UserId']):_0x5466('0xf2');var _0x24cefe=_0x5d264d[_0x5466('0x3c')][_0x5466('0xf3')]||util[_0x5466('0xef')](_0x5466('0xf0'),'Visitor',_0x5a086f['ContactId']);switch(_0x4a2cd8[_0x5466('0xf4')]){case _0x5466('0xf5'):_0x245a4b=_0x5a086f['UserId']?util['format'](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f[_0x5466('0x4c')]):'System';break;case _0x5466('0xf6'):_0x245a4b=_0x5a086f[_0x5466('0x4c')]?_0x5a086f[_0x5466('0xee')][_0x5466('0xf7')]||_0x5a086f['User'][_0x5466('0x42')]:_0x5466('0xf2');break;case'agent_fullname':_0x245a4b=_0x5a086f[_0x5466('0x4c')]?_0x5a086f['User'][_0x5466('0x42')]:_0x5466('0xf2');break;default:_0x245a4b=_0x5a086f['UserId']?util[_0x5466('0xef')](_0x5466('0xf0'),_0x4a2cd8[_0x5466('0xf1')],_0x5a086f[_0x5466('0x4c')]):_0x5466('0xf2');}var _0x3d90d4=util[_0x5466('0xef')](_0x5466('0xf8'),moment(_0x5a086f['createdAt'])[_0x5466('0xef')](_0x5466('0xf9')),_0x5a086f[_0x5466('0xfa')]==='in'?_0x24cefe:_0x245a4b,_0x5a086f['body']);if(!_0x5a086f[_0x5466('0xfb')]){fs[_0x5466('0xfc')](_0x1e082b,_0x3d90d4);}}return db[_0x5466('0xfd')][_0x5466('0xc5')]({'where':{'service':!![]},'include':[{'model':db[_0x5466('0xfe')],'as':_0x5466('0xff'),'raw':!![]}]});}}})[_0x5466('0x21')](function(_0x2a6e4e){if(_0x2a6e4e&&_0x2a6e4e[_0x5466('0xff')]&&_0x5d264d['body']){var _0x20b80b={'tls':{'rejectUnauthorized':![]}};if(_0x2a6e4e[_0x5466('0xff')][_0x5466('0x100')]){_0x20b80b['service']=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x100')];}else{_0x20b80b[_0x5466('0x101')]=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x101')];_0x20b80b[_0x5466('0x102')]=_0x2a6e4e[_0x5466('0xff')]['port'];_0x20b80b[_0x5466('0x103')]=_0x2a6e4e[_0x5466('0xff')][_0x5466('0x103')];}if(_0x2a6e4e['Smtp']['authentication']){_0x20b80b[_0x5466('0x104')]={'user':_0x2a6e4e[_0x5466('0xff')][_0x5466('0xa5')],'pass':_0x2a6e4e[_0x5466('0xff')][_0x5466('0x105')]};}return respondWithRpcPromise(_0x5466('0x106'),_0x5466('0x107'),{'account':_0x20b80b,'message':{'from':util[_0x5466('0xef')](_0x5466('0x108'),_0x2a6e4e[_0x5466('0x38')],_0x2a6e4e[_0x5466('0xcc')]||_0x2a6e4e[_0x5466('0xff')][_0x5466('0xa5')]),'to':_0x5d264d[_0x5466('0x3c')][_0x5466('0x109')],'subject':_0x5466('0x10a'),'text':util[_0x5466('0xef')](_0x5466('0x10b'),_0x5d264d['body'][_0x5466('0x109')]),'attachments':[{'path':_0x1e082b}]}})[_0x5466('0x21')](function(){return _0x1bdd89;})[_0x5466('0x2b')](function(_0x2cc583){console[_0x5466('0x27')](_0x2cc583);});}else{return _0x1bdd89;}})['then'](respondWithStatusCode(_0x1199b4,0xc8))[_0x5466('0x2b')](handleError(_0x1199b4,null));};exports[_0x5466('0x10c')]=function(_0x5939b5,_0x40fddc,_0x2f3672){return db[_0x5466('0xed')][_0x5466('0x76')]({'where':{'id':_0x5939b5[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0x40fddc,null))[_0x5466('0x21')](function(_0x70cace){if(_0x70cace){return _0x70cace[_0x5466('0x10c')](_0x5939b5[_0x5466('0x3c')]['ids'],_['omit'](_0x5939b5[_0x5466('0x3c')],[_0x5466('0x10d'),'id'])||{});}})[_0x5466('0x21')](respondWithResult(_0x40fddc,null))[_0x5466('0x2b')](handleError(_0x40fddc,null));};exports[_0x5466('0x10e')]=function(_0x13181e,_0x3fe4ef,_0x4b8a30){var _0x246223={'raw':![],'where':{}};var _0x419f76={};var _0x17640b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x5466('0xc5')]({'where':{'id':_0x13181e[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x3fe4ef,null))['then'](function(_0x481ad2){if(_0x481ad2){_0x419f76['model']=_[_0x5466('0x57')](db[_0x5466('0xed')][_0x5466('0x52')]);_0x419f76['query']=_[_0x5466('0x57')](_0x13181e[_0x5466('0x56')]);_0x419f76[_0x5466('0x60')]=_[_0x5466('0x58')](_0x419f76['model'],_0x419f76[_0x5466('0x56')]);_0x246223[_0x5466('0x59')]=_[_0x5466('0x58')](_0x419f76[_0x5466('0x55')],qs[_0x5466('0xab')](_0x13181e[_0x5466('0x56')][_0x5466('0xab')]));_0x246223[_0x5466('0x59')]=_0x246223[_0x5466('0x59')]['length']?_0x246223[_0x5466('0x59')]:_0x419f76[_0x5466('0x55')];if(!_0x13181e[_0x5466('0x56')][_0x5466('0x5b')](_0x5466('0x5c'))){_0x246223[_0x5466('0x30')]=qs[_0x5466('0x30')](_0x13181e[_0x5466('0x56')]['limit']);_0x246223[_0x5466('0x2f')]=qs[_0x5466('0x2f')](_0x13181e[_0x5466('0x56')][_0x5466('0x2f')]);}_0x246223[_0x5466('0x5d')]=qs[_0x5466('0x5e')](_0x13181e[_0x5466('0x56')][_0x5466('0x5e')]);_0x246223['where']=qs[_0x5466('0x60')](_[_0x5466('0x10f')](_0x13181e[_0x5466('0x56')],_0x419f76[_0x5466('0x60')]));_0x246223[_0x5466('0x5f')][_0x5466('0xbc')]=_0x481ad2['id'];if(_0x13181e[_0x5466('0x56')]['filter']){_0x246223[_0x5466('0x5f')]=_[_0x5466('0x3b')](_0x246223['where'],{'$or':_[_0x5466('0x41')](_0x246223[_0x5466('0x59')],function(_0x5c23c5){var _0x274e19={};_0x274e19[_0x5c23c5]={'$like':'%'+_0x13181e['query']['filter']+'%'};return _0x274e19;})});}if(_0x13181e[_0x5466('0x56')][_0x5466('0x8e')]){var _0x57eab7=_0x13181e[_0x5466('0x56')][_0x5466('0x8e')][_0x5466('0x45')](',');var _0x45113a={};_0x45113a[_0x57eab7[0x0]]={'$gte':moment(_0x57eab7[0x1])['format'](_0x5466('0x110'))};_0x246223[_0x5466('0x5f')]=_['merge'](_0x246223[_0x5466('0x5f')],_0x45113a);}_0x246223=_[_0x5466('0x3b')]({},_0x246223,_0x13181e[_0x5466('0xc1')]);return db['ChatMessage'][_0x5466('0x32')]({'where':_0x246223['where']})[_0x5466('0x21')](function(_0x373497){_0x17640b[_0x5466('0x32')]=_0x373497;if(_0x13181e['query'][_0x5466('0xc0')]){_0x246223[_0x5466('0x111')]=[{'all':!![]}];}return db['ChatMessage'][_0x5466('0x112')](_0x246223);})[_0x5466('0x21')](function(_0x54c907){_0x17640b[_0x5466('0x113')]=_0x54c907;return _0x17640b;});}})[_0x5466('0x21')](respondWithFilteredResult(_0x3fe4ef,_0x246223))[_0x5466('0x2b')](handleError(_0x3fe4ef,null));};exports[_0x5466('0x114')]=function(_0x59dff3,_0xced3f2,_0x59e5d4){var _0x222ad8={'where':{}},_0x1a86c8={},_0x2109c6={'count':0x0,'rows':[]};return db[_0x5466('0x51')][_0x5466('0xc5')]({'where':{'id':_0x59dff3[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0xced3f2,null))[_0x5466('0x21')](function(_0x589b01){if(_0x589b01){_0x1a86c8[_0x5466('0x55')]=_['keys'](db[_0x5466('0xed')][_0x5466('0x52')]);_0x1a86c8[_0x5466('0x56')]=_[_0x5466('0x57')](_0x59dff3[_0x5466('0x56')]);_0x1a86c8[_0x5466('0x60')]=_[_0x5466('0x58')](_0x1a86c8[_0x5466('0x55')],_0x1a86c8['query']);_0x222ad8[_0x5466('0x59')]=_[_0x5466('0x58')](_0x1a86c8[_0x5466('0x55')],qs[_0x5466('0xab')](_0x59dff3[_0x5466('0x56')][_0x5466('0xab')]));_0x222ad8[_0x5466('0x59')]=_0x222ad8[_0x5466('0x59')]['length']?_0x222ad8[_0x5466('0x59')]:_0x1a86c8['model'];if(!_0x59dff3[_0x5466('0x56')][_0x5466('0x5b')]('nolimit')){_0x222ad8[_0x5466('0x30')]=qs[_0x5466('0x30')](_0x59dff3['query']['limit']);_0x222ad8[_0x5466('0x2f')]=qs[_0x5466('0x2f')](_0x59dff3[_0x5466('0x56')][_0x5466('0x2f')]);}_0x222ad8['order']=qs[_0x5466('0x5e')](_0x59dff3[_0x5466('0x56')]['sort']);_0x222ad8['where']=qs[_0x5466('0x60')](_[_0x5466('0x10f')](_0x59dff3[_0x5466('0x56')],_0x1a86c8[_0x5466('0x60')]));_0x222ad8[_0x5466('0x5f')][_0x5466('0xbc')]=_0x589b01['id'];if(_0x59dff3[_0x5466('0x56')][_0x5466('0x97')]){_0x222ad8['where']=_[_0x5466('0x3b')](_0x222ad8[_0x5466('0x5f')],{'$or':_[_0x5466('0x41')](_0x222ad8[_0x5466('0x59')],function(_0x3616a1){var _0x4e7bd8={};_0x4e7bd8[_0x3616a1]={'$like':'%'+_0x59dff3[_0x5466('0x56')][_0x5466('0x97')]+'%'};return _0x4e7bd8;})});}_0x222ad8[_0x5466('0x5f')][_0x5466('0xfb')]=![];if(_0x59dff3[_0x5466('0x56')]['id']){_0x222ad8[_0x5466('0x5f')]['id']={'$gt':_0x59dff3['query']['id']};}_0x222ad8=_[_0x5466('0x3b')]({},_0x222ad8,_0x59dff3[_0x5466('0xc1')]);return db[_0x5466('0xed')][_0x5466('0x32')]({'where':_0x222ad8[_0x5466('0x5f')]})[_0x5466('0x21')](function(_0x6c108c){_0x2109c6[_0x5466('0x32')]=_0x6c108c;_0x222ad8[_0x5466('0x111')]=[];if(_0x59dff3[_0x5466('0x56')][_0x5466('0x115')]){_0x222ad8['include']['push']({'model':db[_0x5466('0xee')],'as':_0x5466('0xee'),'attributes':['id','fullname',_0x5466('0xf7')]});}if(_0x59dff3[_0x5466('0x56')][_0x5466('0xc0')]){_0x222ad8[_0x5466('0x111')]=[{'all':!![]}];}return db['ChatMessage'][_0x5466('0x112')](_0x222ad8);})[_0x5466('0x21')](function(_0x2998f2){_0x2109c6[_0x5466('0x113')]=_0x2998f2;return _0x2109c6;});}})[_0x5466('0x21')](respondWithFilteredResult(_0xced3f2,_0x222ad8))[_0x5466('0x2b')](handleError(_0xced3f2,null));};exports['addTags']=function(_0x1c9a50,_0x2f4e1c,_0x24b849){return db[_0x5466('0x51')]['find']({'where':{'id':_0x1c9a50[_0x5466('0xbf')]['id']}})[_0x5466('0x21')](handleEntityNotFound(_0x2f4e1c,null))[_0x5466('0x21')](function(_0x47f521){if(_0x47f521){return _0x47f521[_0x5466('0x116')](_0x1c9a50['body'][_0x5466('0x10d')],_[_0x5466('0x117')](_0x1c9a50['body'],[_0x5466('0x10d'),'id'])||{})[_0x5466('0x118')](function(){return db['Tag'][_0x5466('0x112')]({'attributes':['id',_0x5466('0x38'),_0x5466('0x63')],'where':{'id':_0x1c9a50[_0x5466('0x3c')][_0x5466('0x10d')]}});})[_0x5466('0x21')](function(_0x107ba3){socket[_0x5466('0x119')]('chatInteractionTags:save',{'id':Number(_0x1c9a50[_0x5466('0xbf')]['id']),'tags':_0x107ba3||[]});return{'id':Number(_0x1c9a50[_0x5466('0xbf')]['id']),'tags':_0x107ba3||[]};});}})[_0x5466('0x21')](respondWithResult(_0x2f4e1c,null))[_0x5466('0x2b')](handleError(_0x2f4e1c,null));};exports['removeTags']=function(_0x3e0dd4,_0x45a7e2,_0x11ea6b){return db['ChatInteraction'][_0x5466('0x76')]({'where':{'id':_0x3e0dd4[_0x5466('0xbf')]['id']}})['then'](handleEntityNotFound(_0x45a7e2,null))[_0x5466('0x21')](function(_0x408ac7){if(_0x408ac7){return _0x408ac7[_0x5466('0x11a')](_0x3e0dd4[_0x5466('0x56')][_0x5466('0x10d')]);}})[_0x5466('0x21')](respondWithStatusCode(_0x45a7e2,null))[_0x5466('0x2b')](handleError(_0x45a7e2,null));};exports[_0x5466('0x11b')]=function(_0x2921e2,_0x2ef53d){var _0x4a59eb=moment()[_0x5466('0x11c')]()[_0x5466('0xaa')]();var _0x5ec641=path[_0x5466('0xe6')](config[_0x5466('0xe7')],'server',_0x5466('0x11d'),_0x5466('0x11e'));var _0x1fd3b0=path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0x11f'),'files',_0x5466('0x120'));var _0x21dfaf=path[_0x5466('0xe6')](_0x5ec641,_0x4a59eb);var _0x48592a=util[_0x5466('0xef')](_0x5466('0x121'),_0x2921e2['params']['id'],_0x4a59eb);var _0x966d56=path[_0x5466('0xe6')](_0x5ec641,_0x48592a);var _0x4ef839=[];_0x4ef839[_0x5466('0x47')]({'model':db[_0x5466('0xee')],'as':_0x5466('0xee'),'attributes':['id',_0x5466('0x42')],'raw':!![]});_0x4ef839['push']({'model':db[_0x5466('0xd6')],'as':_0x5466('0xd7'),'attributes':['id',_0x5466('0x122'),_0x5466('0x123')],'raw':!![]});if(_0x2921e2[_0x5466('0x56')]['attachments']){_0x4ef839[_0x5466('0x47')]({'model':db['Attachment'],'as':_0x5466('0xe2'),'raw':!![]});}var _0x79707e=[{'model':db[_0x5466('0xed')],'as':'Messages','attributes':['id',_0x5466('0x3c'),'createdAt',_0x5466('0xfa'),'secret',_0x5466('0x93')],'include':_0x4ef839}];_0x79707e[_0x5466('0x47')]({'model':db[_0x5466('0xc6')],'as':_0x5466('0x124'),'attributes':['id',_0x5466('0x38')]});_0x79707e[_0x5466('0x47')]({'model':db['User'],'as':_0x5466('0x125'),'attributes':['id',_0x5466('0x42')]});return db[_0x5466('0x51')][_0x5466('0x76')]({'where':{'id':_0x2921e2[_0x5466('0xbf')]['id']},'include':_0x79707e})[_0x5466('0x21')](handleEntityNotFound(_0x2ef53d,null))[_0x5466('0x21')](function(_0x49e429){if(_0x49e429){var _0x3bae1d=_0x49e429[_0x5466('0x126')]({'plain':!![]});fs['mkdirSync'](_0x21dfaf);var _0x3af2ab={'channel':_0x5466('0x127'),'account':_0x3bae1d[_0x5466('0x124')][_0x5466('0x38')],'agent':_0x3bae1d[_0x5466('0x125')]?_0x3bae1d[_0x5466('0x125')][_0x5466('0x42')]:'N.A.','createdAt':moment(_0x3bae1d[_0x5466('0x8c')])[_0x5466('0xef')](_0x5466('0x110'))[_0x5466('0xaa')](),'closedAt':_0x3bae1d[_0x5466('0x4d')]?moment(_0x3bae1d[_0x5466('0x128')])[_0x5466('0xef')](_0x5466('0x110'))['toString']():'','disposition':_0x3bae1d['disposition'],'chatInfo':{'browser':_0x3bae1d[_0x5466('0x129')],'os':_0x3bae1d['osName'],'referer':_0x3bae1d['referer'],'customerIp':_0x3bae1d['customerIp'],'customerPort':_0x3bae1d['customerPort']?_0x3bae1d[_0x5466('0x12a')]:_0x5466('0x12b')},'messages':_(_0x3bae1d[_0x5466('0x12c')])[_0x5466('0x12d')]()[_0x5466('0x97')]({'secret':![]})[_0x5466('0x41')](function(_0x50f966){if(_0x50f966[_0x5466('0xe2')]){var _0x434bb2=path[_0x5466('0xe6')](_0x1fd3b0,_0x50f966['Attachment'][_0x5466('0xdf')]);if(fs[_0x5466('0x12e')](_0x434bb2)){fs[_0x5466('0x12f')](_0x434bb2)[_0x5466('0x130')](fs[_0x5466('0x131')](path['join'](_0x21dfaf,_0x50f966[_0x5466('0xe2')][_0x5466('0xdf')])));}}return{'date':moment(_0x50f966[_0x5466('0x8c')])[_0x5466('0xef')](_0x5466('0x110'))[_0x5466('0xaa')](),'sender':_0x50f966[_0x5466('0xfa')]===_0x5466('0x132')?_0x50f966[_0x5466('0xee')]?_0x50f966[_0x5466('0xee')][_0x5466('0x42')]:_0x5466('0xf2'):_0x50f966['Contact'][_0x5466('0x122')]+(_0x50f966[_0x5466('0xd7')][_0x5466('0x123')]?'\x20'+_0x50f966[_0x5466('0xd7')][_0x5466('0x123')]:''),'body':_0x50f966[_0x5466('0xe2')]?_0x50f966[_0x5466('0xe2')][_0x5466('0xdf')]:_0x50f966[_0x5466('0x3c')],'direction':_0x50f966[_0x5466('0xfa')]==='out'?'A':'C','secret':_0x50f966[_0x5466('0xfb')],'read':_0x50f966[_0x5466('0x93')],'attachment':_0x50f966[_0x5466('0xe2')]};})['value']()};return ejs[_0x5466('0x133')](path[_0x5466('0xe6')](config[_0x5466('0xe7')],_0x5466('0x11f'),_0x5466('0x134'),_0x5466('0x135')),{'interaction':_0x3af2ab})[_0x5466('0x21')](function(_0x3e3e7b){var _0x56018b=path[_0x5466('0xe6')](_0x21dfaf,_0x5466('0x136')+_0x3bae1d['id']+'-'+_0x4a59eb+_0x5466('0x137'));var _0x50f1e7={'path':_0x56018b,'channel':_0x5466('0x127'),'interactionId':_0x3bae1d['id']};return pdf[_0x5466('0x138')](_0x3e3e7b,_0x50f1e7);})[_0x5466('0x21')](function(){return new BPromise(function(_0x562da7,_0x82554b){zipdir(_0x21dfaf,{'saveTo':_0x966d56},function(_0x47aa4f,_0x19c49a){if(_0x47aa4f)return _0x82554b(_0x47aa4f);return _0x562da7(_0x19c49a);});})[_0x5466('0x21')](function(){return new BPromise(function(_0x50d2e7,_0x3b2f76){rimraf(_0x21dfaf,function(_0x292541){if(_0x292541)_0x3b2f76(_0x292541);return _0x50d2e7();});});})[_0x5466('0x21')](function(){return _0x2ef53d[_0x5466('0x11b')](_0x966d56,_0x48592a,function(_0x20d74c){if(_0x20d74c){console[_0x5466('0x139')](_0x5466('0x13a'),_0x20d74c);}else{fs[_0x5466('0x13b')](_0x966d56);}});});});}else{return _0x2ef53d[_0x5466('0x13c')](0xc8);}})[_0x5466('0x2b')](handleError(_0x2ef53d,null));}; \ No newline at end of file +var _0x5098=['website_alias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','ids','getMessages','pick','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','setTags','omit','Tag','color','emit','chatInteractionTags:save','removeTags','unix','files','tmp','server','attachments','transcript-%d-%s.zip','firstName','lastName','direction','Account','get','mkdirSync','Chat','Owner','closedAt','browserName','osName','referer','customerIp','N.A.','existsSync','pipe','secret','renderFile','views','transcript-','.pdf','createPdfFromHTML','log','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','destroy','stack','name','send','render','merge','body','contact','agent','interaction','Users','map','fullname','TagIds','Tags','split','forEach','push','waiting','talking','answered','unmanaged','abandoned','total','UserId','closed','disposition','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','select','field','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','Sequelize','QueryTypes','SELECT','clone','i.id','contactName','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','user','role','sequelize','toString','keyBy','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','rows','show','params','ChatInteraction','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooEscalation','vidaooTopic','vidaooNote','vidaooApiKey','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','email','isNull','follow','vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','basename','file','filename','Attachment','attachmentDownload','Unauthorized','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','now','pathTranscript','Messages','format','%s%d','agentAlias','System','customer'];(function(_0x4f2be1,_0x23ed0e){var _0x1b8fa3=function(_0x3ee239){while(--_0x3ee239){_0x4f2be1['push'](_0x4f2be1['shift']());}};_0x1b8fa3(++_0x23ed0e);}(_0x5098,0x188));var _0x8509=function(_0x28ecdc,_0x2f4a98){_0x28ecdc=_0x28ecdc-0x0;var _0x3dbdd2=_0x5098[_0x28ecdc];return _0x3dbdd2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8509('0x0'));var zipdir=require(_0x8509('0x1'));var jsonpatch=require(_0x8509('0x2'));var rp=require(_0x8509('0x3'));var moment=require(_0x8509('0x4'));var BPromise=require(_0x8509('0x5'));var Mustache=require(_0x8509('0x6'));var util=require(_0x8509('0x7'));var path=require(_0x8509('0x8'));var sox=require(_0x8509('0x9'));var csv=require(_0x8509('0xa'));var ejs=require(_0x8509('0xb'));var fs=require('fs');var fs_extra=require(_0x8509('0xc'));var _=require(_0x8509('0xd'));var squel=require(_0x8509('0xe'));var crypto=require(_0x8509('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x8509('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8509('0x11'));var Redis=require(_0x8509('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8509('0x13'));var as=require(_0x8509('0x14'));var pdf=require(_0x8509('0x15'));var hardwareService=require(_0x8509('0x16'));var logger=require(_0x8509('0x17'))(_0x8509('0x18'));var utils=require(_0x8509('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0x8509('0x1a'));var db=require(_0x8509('0x1b'))['db'];config[_0x8509('0x1c')]=_[_0x8509('0x1d')](config[_0x8509('0x1c')],{'host':_0x8509('0x1e'),'port':0x18eb});var socket=require(_0x8509('0x1f'))(new Redis(config[_0x8509('0x1c')]));require('./chatInteraction.socket')[_0x8509('0x20')](socket);var jayson=require('jayson/promise');var client=jayson[_0x8509('0x21')][_0x8509('0x22')]({'port':0x232b});var client9004=jayson[_0x8509('0x21')][_0x8509('0x22')]({'port':0x232c});function respondWithRpcPromise(_0x286a12,_0x1e2bd0,_0x4c9f3a,_0x1498c4){return new BPromise(function(_0xc4cd99,_0x583b60){var _0x272a58=_0x1498c4||client;return _0x272a58[_0x8509('0x23')](_0x286a12,_0x4c9f3a)[_0x8509('0x24')](function(_0x572851){logger['info'](_0x8509('0x25'),_0x1e2bd0,_0x8509('0x26'));logger[_0x8509('0x27')](_0x8509('0x28'),_0x1e2bd0,_0x8509('0x26'),JSON[_0x8509('0x29')](_0x572851));if(_0x572851[_0x8509('0x2a')]){if(_0x572851['error'][_0x8509('0x2b')]===0x1f4){logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x572851[_0x8509('0x2a')][_0x8509('0x2c')]);return _0x583b60(_0x572851[_0x8509('0x2a')]['message']);}logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x572851[_0x8509('0x2a')]['message']);return _0xc4cd99(_0x572851[_0x8509('0x2a')][_0x8509('0x2c')]);}else{logger[_0x8509('0x2d')](_0x8509('0x25'),_0x1e2bd0,_0x8509('0x26'));_0xc4cd99(_0x572851[_0x8509('0x2e')]['message']);}})[_0x8509('0x2f')](function(_0x1569fb){logger[_0x8509('0x2a')](_0x8509('0x25'),_0x1e2bd0,_0x1569fb);_0x583b60(_0x1569fb);});});}function respondWithStatusCode(_0x374c8f,_0x1eb6a3){_0x1eb6a3=_0x1eb6a3||0xcc;return function(_0x3bec19){if(_0x3bec19){return _0x374c8f[_0x8509('0x30')](_0x1eb6a3);}return _0x374c8f[_0x8509('0x31')](_0x1eb6a3)[_0x8509('0x32')]();};}function respondWithResult(_0x2fb1a6,_0x100e3c){_0x100e3c=_0x100e3c||0xc8;return function(_0x5c2512){if(_0x5c2512){return _0x2fb1a6[_0x8509('0x31')](_0x100e3c)[_0x8509('0x33')](_0x5c2512);}};}function respondWithFilteredResult(_0x3546d4,_0x42c0cc){return function(_0x16d386){if(_0x16d386){var _0x475318=typeof _0x42c0cc['offset']===_0x8509('0x34')&&typeof _0x42c0cc[_0x8509('0x35')]===_0x8509('0x34');var _0x3621bb=_0x16d386[_0x8509('0x36')];var _0x3f3a67=_0x475318?0x0:_0x42c0cc[_0x8509('0x37')];var _0x3b5d4c=_0x475318?_0x16d386[_0x8509('0x36')]:_0x42c0cc[_0x8509('0x37')]+_0x42c0cc['limit'];var _0x5d183f;if(_0x3b5d4c>=_0x3621bb){_0x3b5d4c=_0x3621bb;_0x5d183f=0xc8;}else{_0x5d183f=0xce;}_0x3546d4['status'](_0x5d183f);return _0x3546d4[_0x8509('0x38')](_0x8509('0x39'),_0x3f3a67+'-'+_0x3b5d4c+'/'+_0x3621bb)[_0x8509('0x33')](_0x16d386);}return null;};}function patchUpdates(_0x1416d1){return function(_0x2f52fb){try{jsonpatch[_0x8509('0x3a')](_0x2f52fb,_0x1416d1,!![]);}catch(_0x509284){return BPromise['reject'](_0x509284);}return _0x2f52fb[_0x8509('0x3b')]();};}function saveUpdates(_0x444bb5,_0x40a072){return function(_0x592472){if(_0x592472){return _0x592472[_0x8509('0x3c')](_0x444bb5)[_0x8509('0x24')](function(_0x252e12){return _0x252e12;});}return null;};}function removeEntity(_0x117fcd,_0xcce101){return function(_0x42298f){if(_0x42298f){return _0x42298f[_0x8509('0x3d')]()[_0x8509('0x24')](function(){_0x117fcd[_0x8509('0x31')](0xcc)[_0x8509('0x32')]();});}};}function handleEntityNotFound(_0x2ee116,_0x5ddf33){return function(_0x2e8e64){if(!_0x2e8e64){_0x2ee116['sendStatus'](0x194);}return _0x2e8e64;};}function handleError(_0x366f7d,_0x1db6c0){_0x1db6c0=_0x1db6c0||0x1f4;return function(_0x237307){logger['error'](_0x237307[_0x8509('0x3e')]);if(_0x237307['name']){delete _0x237307[_0x8509('0x3f')];}_0x366f7d[_0x8509('0x31')](_0x1db6c0)[_0x8509('0x40')](_0x237307);};}function getMustacheRender(_0x24f37f,_0x167f7a){return Mustache[_0x8509('0x41')](_0x24f37f,_[_0x8509('0x42')](_0x167f7a[_0x8509('0x43')],{'contact':_0x167f7a[_0x8509('0x44')],'message':_0x167f7a[_0x8509('0x2c')],'agent':_0x167f7a[_0x8509('0x45')],'interaction':_0x167f7a[_0x8509('0x46')],'account':_0x167f7a['account']}))||'';}function getInteractionUsers(_0x32c80e,_0x570cfd){return new BPromise(function(_0x1d87e9,_0x3f548d){try{if(_0x570cfd[_0x32c80e['id']]){_0x32c80e[_0x8509('0x47')]=_[_0x8509('0x48')](_0x570cfd[_0x32c80e['id']],function(_0x16ec31){return{'id':_0x16ec31['id'],'fullname':_0x16ec31[_0x8509('0x49')]};});}}catch(_0x55af2e){_0x3f548d(_0x55af2e);}_0x1d87e9(_0x32c80e);});}function getInteractionTags(_0x7bb1fc,_0x395b64){return new BPromise(function(_0x45c06d,_0x2b5608){try{if(_0x7bb1fc[_0x8509('0x4a')]){_0x7bb1fc[_0x8509('0x4b')]=[];_0x7bb1fc[_0x8509('0x4a')][_0x8509('0x4c')](',')[_0x8509('0x4d')](function(_0x3a2c69){_0x7bb1fc['Tags'][_0x8509('0x4e')](_0x395b64[_0x3a2c69]);});}delete _0x7bb1fc[_0x8509('0x4a')];}catch(_0x27c43e){_0x2b5608(_0x27c43e);}_0x45c06d(_0x7bb1fc);});}function updateChatInteraction(_0x320545,_0x37af2e,_0x5d21d7){return new BPromise(function(_0x2f0336,_0x8c8f56){return getInteractionUsers(_0x320545,_0x5d21d7)[_0x8509('0x24')](function(_0x4e091c){return getInteractionTags(_0x4e091c,_0x37af2e);})[_0x8509('0x24')](function(_0x2a55da){return getStateInteraction(_0x2a55da);})['then'](function(_0x183e59){_0x2f0336(_0x183e59);})[_0x8509('0x2f')](function(_0x1a0742){_0x8c8f56(_0x1a0742);});});}function getStateInteraction(_0x328dc3){return new BPromise(function(_0x579859){_0x328dc3[_0x8509('0x4f')]=0x0;_0x328dc3[_0x8509('0x50')]=0x0;_0x328dc3[_0x8509('0x51')]=0x0;_0x328dc3[_0x8509('0x52')]=0x0;_0x328dc3[_0x8509('0x53')]=0x0;_0x328dc3[_0x8509('0x54')]=0x0;if(!_0x328dc3['closed']&&!_0x328dc3[_0x8509('0x55')]){_0x328dc3['waiting']+=0x1;}if(!_0x328dc3[_0x8509('0x56')]&&_0x328dc3['UserId']){_0x328dc3[_0x8509('0x50')]+=0x1;if(_0x328dc3[_0x8509('0x4f')]){_0x328dc3[_0x8509('0x4f')]-=0x1;}}if(_0x328dc3[_0x8509('0x56')]&&_0x328dc3[_0x8509('0x57')]===_0x8509('0x53')){_0x328dc3[_0x8509('0x53')]+=0x1;if(_0x328dc3['waiting']){_0x328dc3[_0x8509('0x4f')]-=0x1;}}else if(_0x328dc3[_0x8509('0x56')]&&!_0x328dc3['UserId']&&_0x328dc3[_0x8509('0x57')]){_0x328dc3['unmanaged']+=0x1;if(_0x328dc3[_0x8509('0x4f')]){_0x328dc3[_0x8509('0x4f')]-=0x1;}}else if(_0x328dc3[_0x8509('0x56')]&&_0x328dc3['UserId']){_0x328dc3[_0x8509('0x51')]+=0x1;if(_0x328dc3[_0x8509('0x50')]){_0x328dc3[_0x8509('0x50')]-=0x1;}}_0x328dc3[_0x8509('0x54')]+=0x1;_0x579859(_0x328dc3);});}exports[_0x8509('0x58')]=function(_0x31ab8b,_0x53a905){var _0x1b4a7f={},_0x379c69={},_0x266a60={'count':0x0,'rows':[]};var _0x52e58c=_[_0x8509('0x48')](db['ChatInteraction'][_0x8509('0x59')],function(_0x221d0f){return{'name':_0x221d0f[_0x8509('0x5a')],'type':_0x221d0f[_0x8509('0x5b')][_0x8509('0x5c')]};});_0x379c69[_0x8509('0x5d')]=_[_0x8509('0x48')](_0x52e58c,'name');_0x379c69[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x31ab8b[_0x8509('0x5e')]);_0x379c69[_0x8509('0x60')]=_[_0x8509('0x61')](_0x379c69['model'],_0x379c69[_0x8509('0x5e')]);_0x1b4a7f[_0x8509('0x62')]=_['intersection'](_0x379c69['model'],qs[_0x8509('0x63')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x63')]));_0x1b4a7f[_0x8509('0x62')]=_0x1b4a7f[_0x8509('0x62')]['length']?_0x1b4a7f['attributes']:_0x379c69['model'];if(!_0x31ab8b[_0x8509('0x5e')][_0x8509('0x64')](_0x8509('0x65'))){_0x1b4a7f[_0x8509('0x35')]=qs[_0x8509('0x35')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x35')]);_0x1b4a7f[_0x8509('0x37')]=qs[_0x8509('0x37')](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x37')]);}_0x1b4a7f[_0x8509('0x66')]=qs['sort'](_0x31ab8b[_0x8509('0x5e')][_0x8509('0x67')]);_0x1b4a7f[_0x8509('0x68')]=qs['filters'](_['pick'](_0x31ab8b[_0x8509('0x5e')],_0x379c69[_0x8509('0x60')]),_0x52e58c);var _0x36dee6=[];var _0x46eb32=squel[_0x8509('0x69')]()['field']('id')[_0x8509('0x6a')](_0x8509('0x3f'))[_0x8509('0x6a')]('color')['from']('tools_tags');var _0x3e79cc=squel[_0x8509('0x69')]()[_0x8509('0x6a')]('u.id')[_0x8509('0x6a')](_0x8509('0x6b'))['field'](_0x8509('0x6c'))[_0x8509('0x6d')](_0x8509('0x6e'),'ui')[_0x8509('0x6f')](_0x8509('0x70'),'u',_0x8509('0x71'));var _0x38906d=squel['select']()['from'](_0x8509('0x72'),'i')[_0x8509('0x6f')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8509('0x6f')](_0x8509('0x70'),'o','o.id\x20=\x20i.UserId')[_0x8509('0x6f')](_0x8509('0x73'),'a',_0x8509('0x74'))['left_join'](_0x8509('0x75'),'me',_0x8509('0x76'))['left_join']('chat_interaction_has_tags','it',_0x8509('0x77'))['left_join'](_0x8509('0x78'),'t',_0x8509('0x79'));var _0x4a61d2=squel[_0x8509('0x7a')]();var _0x36765f=[];var _0x230879=squel['expr']();var _0x2ed705;if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x7b')]){_0x2ed705=as[_0x8509('0x7c')](_0x31ab8b[_0x8509('0x5e')]['search']);var _0x23e1e2=_0x2ed705[_0x8509('0x7d')];for(var _0x5772c4=0x0;_0x5772c4<_0x2ed705[_0x8509('0x7e')][_0x8509('0x7f')];_0x5772c4++){var _0xff7c03=_0x2ed705[_0x8509('0x7e')][_0x5772c4];var _0x5e0370='i';var _0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),_0xff7c03['field']]);if(!_0x4e4e7b){switch(_0xff7c03[_0x8509('0x6a')]){case _0x8509('0x81'):if(_0xff7c03[_0x8509('0x82')]==0x1){_0x38906d['having']('`'+_0xff7c03[_0x8509('0x6a')]+'`\x20=\x200');}else{_0x38906d[_0x8509('0x83')]('`'+_0xff7c03[_0x8509('0x6a')]+'`\x20>\x200');}break;case _0x8509('0x84'):if(_0xff7c03['operator']===_0x8509('0x85')){if(_0xff7c03[_0x8509('0x82')]['split']('\x20')['length']>0x1){_0x4a61d2[_0x23e1e2]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8509('0x86')](_0xff7c03[_0x8509('0x82')]),null);}else{var _0x2580c8='%'+_0xff7c03[_0x8509('0x82')]+'%';_0x4a61d2[_0x23e1e2](_0x8509('0x87'),_0x2580c8,_0x2580c8,_0x2580c8);}}else{_0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),'ContactId']);_0xff7c03['field']=_0x8509('0x88');_0xa2c964=as['buildExpression'](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')]['start'],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);}break;case'Tag':var _0x1edde8=_0xff7c03[_0x8509('0x82')][_0x8509('0x4c')](',')[_0x8509('0x48')](function(_0x8d3bd7){return Number(_0x8d3bd7);});_0x1edde8[_0x8509('0x4d')](function(_0xb39de8){_0x230879['or'](_0x8509('0x8a'),'%,'+_0xb39de8+',%');});_0x36765f=_[_0x8509('0x8b')](_0x36765f,_0x1edde8);break;case'User':if(_0xff7c03[_0x8509('0x8c')]==='$substring'){_0x4a61d2[_0x23e1e2](_0x8509('0x8d'),'%'+_0xff7c03['value']+'%',null);}else{_0x4e4e7b=_[_0x8509('0x80')](_0x52e58c,[_0x8509('0x3f'),'UserId']);_0xff7c03['field']=_0x8509('0x55');_0xa2c964=as[_0x8509('0x8e')](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')]['start'],_0xa2c964['value'][_0x8509('0x32')]);}break;case _0x8509('0x43'):_0xa2c964=as['buildExpression']('me',null,_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964['value'][_0x8509('0x8f')],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);break;}}else{var _0xa2c964=as[_0x8509('0x8e')](_0x5e0370,_0x4e4e7b[_0x8509('0x5b')],_0xff7c03);_0x4a61d2[_0x23e1e2](_0xa2c964[_0x8509('0x89')],_0xa2c964[_0x8509('0x82')][_0x8509('0x8f')],_0xa2c964[_0x8509('0x82')][_0x8509('0x32')]);}}}else{var _0x3a3f27=_(_0x31ab8b[_0x8509('0x5e')])['keys']()[_0x8509('0x48')](function(_0x4dd5c9){return _[_0x8509('0x90')](_0x52e58c,[_0x8509('0x3f'),_0x4dd5c9])?_0x4dd5c9:undefined;})[_0x8509('0x91')]()[_0x8509('0x82')]();if(!_[_0x8509('0x92')](_0x3a3f27)){_0x3a3f27[_0x8509('0x4d')](function(_0x5d12db){if(_0x5d12db===_0x8509('0x93')){_0x38906d[_0x8509('0x68')](_0x8509('0x94'),[][_0x8509('0x95')](_0x31ab8b['query'][_0x5d12db]));}else if(_0x5d12db===_0x8509('0x96')){var _0x35a61f=JSON[_0x8509('0x97')](_0x31ab8b[_0x8509('0x5e')][_0x5d12db])[_0x8509('0x98')];var _0x40b27d=JSON[_0x8509('0x97')](_0x31ab8b[_0x8509('0x5e')][_0x5d12db])['$lte'];_0x38906d[_0x8509('0x68')](_0x8509('0x99'),_0x35a61f,_0x40b27d);}else{if(_0x31ab8b[_0x8509('0x5e')][_0x5d12db]===_0x8509('0x9a')){_0x38906d['where']('i.'+_0x5d12db+_0x8509('0x9b'));}else{_0x38906d[_0x8509('0x68')]('i.'+_0x5d12db+'\x20=\x20?',_0x31ab8b['query'][_0x5d12db]);}}});}if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x9c')]){if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x9c')]==0x1){_0x38906d[_0x8509('0x83')]('`unreadMessages`\x20=\x200');}else{_0x38906d[_0x8509('0x83')](_0x8509('0x9d'));}}if(_0x31ab8b[_0x8509('0x5e')]['tag']){_0x36765f=_[_0x8509('0x9e')](_0x31ab8b['query'][_0x8509('0x9f')])?_0x31ab8b['query'][_0x8509('0x9f')]:new Array(_0x31ab8b[_0x8509('0x5e')]['tag']);_0x36765f[_0x8509('0x4d')](function(_0x409c90){_0x230879['or'](_0x8509('0x8a'),'%,'+_0x409c90+',%');});}if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0xa0')]){var _0x1dae05=_0x31ab8b['query'][_0x8509('0xa0')][_0x8509('0xa1')]('\x5c','\x5c\x5c')[_0x8509('0xa1')](/'/g,'\x27\x27');if(qs[_0x8509('0xa2')](_0x1dae05)){_0x4a61d2['or'](_0x8509('0xa3'),_0x1dae05+'%');}else{_0x4a61d2['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8509('0x86')](_0x1dae05))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x1dae05+'%');}}}_0x38906d[_0x8509('0x68')](_0x4a61d2);_0x38906d[_0x8509('0xa4')]('i.id');var _0x226fa3={'type':db[_0x8509('0xa5')][_0x8509('0xa6')][_0x8509('0xa7')],'raw':!![]};var _0x57b2df=_0x38906d[_0x8509('0xa8')]();_0x57b2df[_0x8509('0x6a')](_0x8509('0xa9'));_0x57b2df['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x1b4a7f[_0x8509('0x66')]){_0x1b4a7f[_0x8509('0x66')][_0x8509('0x4d')](function(_0x1b307f){var _0x2428ff=_0x1b307f[0x0]===_0x8509('0xaa')?_0x1b307f[0x0]:'i.'+_0x1b307f[0x0];_0x38906d[_0x8509('0x66')](_0x2428ff,_0x1b307f[0x1]==='DESC'?![]:!![]);});}if(!_[_0x8509('0x92')](_0x36765f)){_0x38906d[_0x8509('0x83')](_0x230879);_0x57b2df[_0x8509('0x68')](_0x8509('0xab'),_0x36765f);}BPromise['resolve']()[_0x8509('0x24')](function(){if(!_0x2ed705){if(_0x31ab8b['query'][_0x8509('0x93')])return;_0x57b2df['where'](_0x8509('0xac'));_0x38906d[_0x8509('0x68')](_0x8509('0xac'));return;}if(_0x31ab8b['user']['role']!==_0x8509('0x45'))return;return _0x31ab8b['user'][_0x8509('0xad')]({'attributes':['id'],'raw':!![]})[_0x8509('0x24')](function(_0x56e81b){if(_[_0x8509('0x92')](_0x56e81b)){_0x57b2df['where'](_0x8509('0xae'));_0x38906d[_0x8509('0x68')](_0x8509('0xae'));}else{_0x57b2df[_0x8509('0x68')](_0x8509('0x94'),_[_0x8509('0x48')](_0x56e81b,'id'));_0x38906d[_0x8509('0x68')](_0x8509('0x94'),_[_0x8509('0x48')](_0x56e81b,'id'));}});})[_0x8509('0x24')](function(){if(_0x31ab8b[_0x8509('0xaf')][_0x8509('0xb0')]===_0x8509('0x45')&&!_0x2ed705&&!_0x31ab8b[_0x8509('0x5e')][_0x8509('0x93')])return[];return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x57b2df['toString'](),_0x226fa3);})[_0x8509('0x24')](function(_0x5352fc){_0x266a60[_0x8509('0x36')]=_0x5352fc[_0x8509('0x7f')];if(_0x266a60['count']===0x0)return[];return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x46eb32[_0x8509('0xb2')](),_0x226fa3)[_0x8509('0x24')](function(_0x3e86d7){_0x36dee6=_[_0x8509('0xb3')](_0x3e86d7,'id');_0x226fa3=_['merge'](_0x226fa3,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x31ab8b[_0x8509('0x5e')][_0x8509('0x63')]){_0x1b4a7f[_0x8509('0x62')][_0x8509('0x4d')](function(_0x59c109){_0x38906d[_0x8509('0x6a')]('i.'+_0x59c109);});}else{_0x38906d[_0x8509('0x6a')](_0x8509('0xb4'),_0x8509('0x81'));_0x38906d['field'](_0x8509('0xb5'),_0x8509('0xb6'));_0x38906d['field'](_0x8509('0xb7'),_0x8509('0xb8'));_0x38906d['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x38906d[_0x8509('0x6a')](_0x8509('0xb9'));_0x38906d[_0x8509('0x6a')](_0x8509('0xba'),_0x8509('0xbb'));_0x38906d[_0x8509('0x6a')](_0x8509('0xbc'),_0x8509('0xbd'));_0x38906d[_0x8509('0x6a')](_0x8509('0xbe'),_0x8509('0xbf'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc0'),'Contact.phone');_0x38906d[_0x8509('0x6a')](_0x8509('0xc1'),_0x8509('0xc2'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc3'),_0x8509('0xc4'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc5'),_0x8509('0xc6'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc7'),_0x8509('0xc8'));_0x38906d[_0x8509('0x6a')](_0x8509('0xc9'),'TagIds');}if(_0x1b4a7f[_0x8509('0x35')])_0x38906d[_0x8509('0x35')](_0x1b4a7f[_0x8509('0x35')]);if(_0x1b4a7f['offset'])_0x38906d[_0x8509('0x37')](_0x1b4a7f[_0x8509('0x37')]);return db[_0x8509('0xb1')][_0x8509('0x5e')](_0x38906d[_0x8509('0xb2')](),_0x226fa3);})[_0x8509('0x24')](function(_0x547b6e){if(_0x547b6e['length']>0x0)_0x3e79cc[_0x8509('0x68')](_0x8509('0xca'),_[_0x8509('0x48')](_0x547b6e,'id'));return db[_0x8509('0xb1')]['query'](_0x3e79cc[_0x8509('0xb2')](),_0x226fa3)[_0x8509('0x24')](function(_0x5d0d88){var _0xe502d=_[_0x8509('0xcb')](_0x5d0d88,_0x8509('0xcc'));var _0x3c5faf=[];_0x547b6e[_0x8509('0x4d')](function(_0x1558bc){_0x3c5faf[_0x8509('0x4e')](updateChatInteraction(_0x1558bc,_0x36dee6,_0xe502d));});return BPromise['all'](_0x3c5faf);});});})[_0x8509('0x24')](function(_0x65998){_0x266a60[_0x8509('0xcd')]=_0x65998;return _0x266a60;})[_0x8509('0x24')](respondWithFilteredResult(_0x53a905,_0x1b4a7f))[_0x8509('0x2f')](handleError(_0x53a905,null));};exports[_0x8509('0xce')]=function(_0x19004d,_0x4463ac){var _0x22b106={'raw':![],'where':{'id':_0x19004d[_0x8509('0xcf')]['id']}},_0x1966c3={};_0x1966c3['model']=_['keys'](db[_0x8509('0xd0')][_0x8509('0x59')]);_0x1966c3[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x19004d['query']);_0x1966c3['filters']=_[_0x8509('0x61')](_0x1966c3['model'],_0x1966c3[_0x8509('0x5e')]);_0x22b106[_0x8509('0x62')]=_[_0x8509('0x61')](_0x1966c3[_0x8509('0x5d')],qs[_0x8509('0x63')](_0x19004d[_0x8509('0x5e')][_0x8509('0x63')]));_0x22b106[_0x8509('0x62')]=_0x22b106[_0x8509('0x62')][_0x8509('0x7f')]?_0x22b106['attributes']:_0x1966c3[_0x8509('0x5d')];if(_0x19004d[_0x8509('0x5e')][_0x8509('0xd1')]){_0x22b106[_0x8509('0xd2')]=[{'all':!![]}];}_0x22b106=_[_0x8509('0x42')]({},_0x22b106,_0x19004d[_0x8509('0xd3')]);return db[_0x8509('0xd0')]['find'](_0x22b106)[_0x8509('0x24')](handleEntityNotFound(_0x4463ac,null))[_0x8509('0x24')](respondWithResult(_0x4463ac,null))[_0x8509('0x2f')](handleError(_0x4463ac,null));};exports[_0x8509('0xd4')]=function(_0xb196b9,_0x4600e6){return db[_0x8509('0xd0')]['create'](_0xb196b9[_0x8509('0x43')],{})[_0x8509('0x24')](respondWithResult(_0x4600e6,0xc9))[_0x8509('0x2f')](handleError(_0x4600e6,null));};exports[_0x8509('0x3c')]=function(_0x398928,_0x4c5175){if(_0x398928[_0x8509('0x43')]['id']){delete _0x398928[_0x8509('0x43')]['id'];}return db['ChatInteraction'][_0x8509('0x80')]({'where':{'id':_0x398928[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x4c5175,null))[_0x8509('0x24')](saveUpdates(_0x398928['body'],null))[_0x8509('0x24')](respondWithResult(_0x4c5175,null))[_0x8509('0x2f')](handleError(_0x4c5175,null));};exports[_0x8509('0x3d')]=function(_0x387c94,_0x5119f9){return db['ChatInteraction'][_0x8509('0x80')]({'where':{'id':_0x387c94['params']['id']}})['then'](handleEntityNotFound(_0x5119f9,null))[_0x8509('0x24')](removeEntity(_0x5119f9,null))[_0x8509('0x2f')](handleError(_0x5119f9,null));};exports['describe']=function(_0x2767ef,_0x55c0a2){return db[_0x8509('0xd0')][_0x8509('0xd5')]()['then'](respondWithResult(_0x55c0a2,null))['catch'](handleError(_0x55c0a2,null));};exports[_0x8509('0xd6')]=function(_0x4a9359,_0x43b9dd){var _0x309bf4=_0x4a9359['params']['id'];var _0x36e41f;var _0x43f7a9;var _0x478a71;return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x309bf4}})['then'](function(_0x58cf2a){_0x36e41f=_0x58cf2a;return db[_0x8509('0xd8')][_0x8509('0xd7')]({'where':{'id':_0x58cf2a['ChatWebsiteId']},'attributes':['id','vidaooApiKey',_0x8509('0xd9'),_0x8509('0xda'),_0x8509('0xdb'),'vidaooMetadata'],'raw':!![]});})[_0x8509('0x24')](function(_0x455218){if(_0x455218&&_0x455218[_0x8509('0xdc')]&&_0x455218[_0x8509('0xd9')]){_0x43f7a9=_0x455218;var _0x4e5535={'interaction':{'id':_0x309bf4},'agent':{'id':_0x4a9359['user']['id'],'name':_0x4a9359[_0x8509('0xaf')][_0x8509('0x3f')],'fullname':_0x4a9359[_0x8509('0xaf')][_0x8509('0x49')],'email':_0x4a9359['user']['email']},'contact':_0x4a9359[_0x8509('0x43')][_0x8509('0x44')],'account':_0x4a9359[_0x8509('0x43')][_0x8509('0xdd')]};var _0x4e05bc={'rejectUnauthorized':![],'method':_0x8509('0xde'),'url':_0x8509('0xdf'),'headers':{'X-APIKEY':_0x455218[_0x8509('0xdc')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4a9359[_0x8509('0xaf')][_0x8509('0xe0')]],'buttons':null,'topic':_0x43f7a9[_0x8509('0xda')],'note':_[_0x8509('0xe1')](_0x43f7a9[_0x8509('0xdb')])?null:getMustacheRender(_0x43f7a9[_0x8509('0xdb')],_0x4e5535),'metadata':null},'redirect':_0x8509('0xe2'),'json':!![]};try{if(!_[_0x8509('0xe1')](_0x43f7a9[_0x8509('0xe3')])){var _0x2afcd0=getMustacheRender(_0x43f7a9['vidaooMetadata'],_0x4e5535);var _0x18749f=JSON[_0x8509('0x97')](_0x2afcd0);_0x4e05bc['body']['metadata']=_0x18749f;}}catch(_0xac5b08){throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x4e05bc);}else{throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))](_0x8509('0xe5'));}})[_0x8509('0x24')](function(_0x5c1838){_0x478a71=_0x5c1838;if(_0x478a71['id']){var _0x4db160={'body':_0x478a71[_0x8509('0xe6')],'ChatWebsiteId':_0x43f7a9['id'],'ChatInteractionId':_0x36e41f['id'],'direction':_0x8509('0xe7'),'UserId':_0x4a9359[_0x8509('0xaf')]['id']};return db['ChatMessage'][_0x8509('0xd4')](_0x4db160,{});}else{throw new db[(_0x8509('0xa5'))][(_0x8509('0xe4'))](_0x8509('0xe8'));}})[_0x8509('0x24')](function(){return _0x36e41f[_0x8509('0xe9')]({'vidaooSessionId':_0x478a71['id']});})[_0x8509('0x24')](respondWithResult(_0x43b9dd,null))[_0x8509('0x2f')](handleError(_0x43b9dd,null));};exports[_0x8509('0xea')]=function(_0xdb9cb0,_0x1d8538){if(_0xdb9cb0['body']['id']){delete _0xdb9cb0[_0x8509('0x43')]['id'];}return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0xdb9cb0[_0x8509('0xcf')]['id']},'include':[{'model':db[_0x8509('0xeb')],'as':'Contact'}]})[_0x8509('0x24')](handleEntityNotFound(_0x1d8538,null))[_0x8509('0x24')](saveUpdates(_0xdb9cb0[_0x8509('0x43')],null))[_0x8509('0x24')](respondWithResult(_0x1d8538,null))[_0x8509('0x2f')](handleError(_0x1d8538,null));};exports[_0x8509('0xec')]=function(_0x5a8011,_0x5f03c3,_0x11601d){if(_0x5a8011[_0x8509('0x43')]['id']){delete _0x5a8011[_0x8509('0x43')]['id'];}return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x5a8011[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](function(_0x235224){if(!_0x235224){logger[_0x8509('0x2a')](_0x8509('0xed'),'abandon',0x194,_0x8509('0xee'));_0x5f03c3['sendStatus'](0x194);}else{if(_0x235224['UserId']){throw new db[(_0x8509('0xa5'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x235224;})[_0x8509('0x24')](function(_0xb78606){if(_0xb78606){return _0xb78606[_0x8509('0x3c')]({'closed':_0x5a8011[_0x8509('0x43')][_0x8509('0x56')],'disposition':_0x5a8011[_0x8509('0x43')][_0x8509('0x57')]})[_0x8509('0x24')](function(_0x14c524){return _0x14c524;});}})[_0x8509('0x24')](function(_0x4f4faf){return respondWithRpcPromise('AbandonInteraction','abandon',_0x5a8011[_0x8509('0x43')],client9004);})[_0x8509('0x24')](respondWithResult(_0x5f03c3,null))['catch'](handleError(_0x5f03c3,null));};exports['attachmentUpload']=function(_0xb73aab,_0x153c79,_0x5252c0){_0xb73aab[_0x8509('0x43')][_0x8509('0x3f')]=_0xb73aab['file']['originalname'];_0xb73aab['body'][_0x8509('0xef')]=_0xb73aab[_0x8509('0xf0')][_0x8509('0xf1')];_0xb73aab[_0x8509('0x43')][_0x8509('0x5b')]=_0xb73aab['file']['mimetype'];return db[_0x8509('0xf2')][_0x8509('0xd4')](_0xb73aab[_0x8509('0x43')])[_0x8509('0x24')](respondWithResult(_0x153c79,0xc9))[_0x8509('0x2f')](handleError(_0x153c79,null));};exports[_0x8509('0xf3')]=function(_0x3c8f00,_0x5d125a,_0x2a9fc9){return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x3c8f00[_0x8509('0xcf')]['id']},'raw':!![]})[_0x8509('0x24')](handleEntityNotFound(_0x5d125a,null))[_0x8509('0x24')](function(_0x344c9e){if(_0x344c9e){if(_0x344c9e[_0x8509('0x56')]){return _0x5d125a[_0x8509('0x31')](0x193)[_0x8509('0x33')]({'status':0x193,'message':_0x8509('0xf4')});}return db[_0x8509('0xf2')]['findOne']({'where':{'id':_0x3c8f00[_0x8509('0x5e')][_0x8509('0xf5')]},'raw':!![]})[_0x8509('0x24')](handleEntityNotFound(_0x5d125a,null));}})[_0x8509('0x24')](function(_0x559399){if(_0x559399){var _0xce28f3=_0x559399['ChatOfflineMessageId']!==null;var _0x34cc0d=path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0xf8'));if(_0xce28f3){_0x34cc0d=path[_0x8509('0xf6')](_0x34cc0d,_0x8509('0xf9'));}var _0xc65ecb=path['join'](_0x34cc0d,_0x559399[_0x8509('0xef')]);return _0x5d125a[_0x8509('0xfa')](_0xc65ecb);}})[_0x8509('0x2f')](handleError(_0x5d125a,null));};exports[_0x8509('0xfb')]=function(_0x38ccee,_0x1573dd){var _0x376d37=null;var _0x342039=null;var _0x3258b0=null;var _0x3f2e8c=null;if(_0x38ccee[_0x8509('0x43')]['id']){delete _0x38ccee[_0x8509('0x43')]['id'];}if(_0x38ccee['body'][_0x8509('0xfc')]){_0x3f2e8c=path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0xfd'),util['format']('transcript-%s.txt',Date[_0x8509('0xfe')]()));_0x38ccee['body'][_0x8509('0xff')]=_0x3f2e8c;}return db[_0x8509('0xd0')]['find']({'where':{'id':_0x38ccee[_0x8509('0xcf')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x8509('0x100'),'include':[{'model':db['User'],'as':'User'}]}]})[_0x8509('0x24')](handleEntityNotFound(_0x1573dd,null))[_0x8509('0x24')](saveUpdates(_0x38ccee[_0x8509('0x43')],null))[_0x8509('0x24')](function(_0x39c7b8){if(_0x39c7b8){_0x376d37=_0x39c7b8;return db[_0x8509('0xd8')][_0x8509('0x80')]({'where':{'id':_0x376d37[_0x8509('0x93')]}});}})[_0x8509('0x24')](function(_0x136b16){if(_0x136b16){_0x3258b0=_0x136b16;return db['CmContact']['find']({'where':{'id':_0x376d37[_0x8509('0x88')]}});}})['then'](function(_0x24c7bf){if(_0x24c7bf){_0x342039=_0x24c7bf;if(_0x3f2e8c){var _0x4fa393=null;for(var _0x3205ac=0x1;_0x3205ac<_0x376d37[_0x8509('0x100')][_0x8509('0x7f')];++_0x3205ac){_0x4fa393=_0x376d37['Messages'][_0x3205ac];var _0x4b7f10=_0x4fa393['UserId']?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0[_0x8509('0x103')],_0x4fa393[_0x8509('0x55')]):_0x8509('0x104');var _0x47d959=_0x38ccee[_0x8509('0x43')][_0x8509('0x105')]||util[_0x8509('0x101')](_0x8509('0x102'),'Visitor',_0x4fa393[_0x8509('0x88')]);switch(_0x3258b0['agentIdentifier']){case _0x8509('0x106'):_0x4b7f10=_0x4fa393[_0x8509('0x55')]?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0['agentAlias'],_0x4fa393['UserId']):_0x8509('0x104');break;case _0x8509('0x107'):_0x4b7f10=_0x4fa393['UserId']?_0x4fa393[_0x8509('0x108')][_0x8509('0x109')]||_0x4fa393['User']['fullname']:_0x8509('0x104');break;case _0x8509('0x10a'):_0x4b7f10=_0x4fa393['UserId']?_0x4fa393[_0x8509('0x108')][_0x8509('0x49')]:_0x8509('0x104');break;default:_0x4b7f10=_0x4fa393[_0x8509('0x55')]?util[_0x8509('0x101')](_0x8509('0x102'),_0x3258b0[_0x8509('0x103')],_0x4fa393[_0x8509('0x55')]):_0x8509('0x104');}var _0x212244=util[_0x8509('0x101')](_0x8509('0x10b'),moment(_0x4fa393[_0x8509('0x96')])[_0x8509('0x101')](_0x8509('0x10c')),_0x4fa393['direction']==='in'?_0x47d959:_0x4b7f10,_0x4fa393[_0x8509('0x43')]);if(!_0x4fa393['secret']){fs[_0x8509('0x10d')](_0x3f2e8c,_0x212244);}}return db[_0x8509('0x10e')][_0x8509('0xd7')]({'where':{'service':!![]},'include':[{'model':db[_0x8509('0x10f')],'as':_0x8509('0x110'),'raw':!![]}]});}}})['then'](function(_0x2df184){if(_0x2df184&&_0x2df184['Smtp']&&_0x38ccee['body']){var _0x571dc7={'tls':{'rejectUnauthorized':![]}};if(_0x2df184[_0x8509('0x110')][_0x8509('0x111')]){_0x571dc7[_0x8509('0x111')]=_0x2df184['Smtp'][_0x8509('0x111')];}else{_0x571dc7['host']=_0x2df184['Smtp'][_0x8509('0x112')];_0x571dc7['port']=_0x2df184[_0x8509('0x110')][_0x8509('0x113')];_0x571dc7['secure']=_0x2df184['Smtp'][_0x8509('0x114')];}if(_0x2df184[_0x8509('0x110')][_0x8509('0x115')]){_0x571dc7['auth']={'user':_0x2df184['Smtp'][_0x8509('0xaf')],'pass':_0x2df184[_0x8509('0x110')]['pass']};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x571dc7,'message':{'from':util[_0x8509('0x101')](_0x8509('0x116'),_0x2df184[_0x8509('0x3f')],_0x2df184['email']||_0x2df184['Smtp'][_0x8509('0xaf')]),'to':_0x38ccee[_0x8509('0x43')][_0x8509('0xfc')],'subject':_0x8509('0x117'),'text':util['format'](_0x8509('0x118'),_0x38ccee['body'][_0x8509('0xfc')]),'attachments':[{'path':_0x3f2e8c}]}})[_0x8509('0x24')](function(){return _0x376d37;})[_0x8509('0x2f')](function(_0x317361){console['error'](_0x317361);});}else{return _0x376d37;}})[_0x8509('0x24')](respondWithStatusCode(_0x1573dd,0xc8))[_0x8509('0x2f')](handleError(_0x1573dd,null));};exports[_0x8509('0x119')]=function(_0xd43254,_0x22d46c,_0x4dafec){return db[_0x8509('0x11a')][_0x8509('0x80')]({'where':{'id':_0xd43254['params']['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x22d46c,null))[_0x8509('0x24')](function(_0x4e8509){if(_0x4e8509){return _0x4e8509['addMessage'](_0xd43254[_0x8509('0x43')][_0x8509('0x11b')],_['omit'](_0xd43254[_0x8509('0x43')],['ids','id'])||{});}})[_0x8509('0x24')](respondWithResult(_0x22d46c,null))[_0x8509('0x2f')](handleError(_0x22d46c,null));};exports[_0x8509('0x11c')]=function(_0x136daf,_0x55e183,_0x1b3d8f){var _0x1f59b9={'raw':![],'where':{}};var _0x54bb7b={};var _0x43fab1={'count':0x0,'rows':[]};return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x136daf[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x55e183,null))[_0x8509('0x24')](function(_0x1bd65e){if(_0x1bd65e){_0x54bb7b[_0x8509('0x5d')]=_[_0x8509('0x5f')](db[_0x8509('0x11a')][_0x8509('0x59')]);_0x54bb7b[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x136daf['query']);_0x54bb7b[_0x8509('0x60')]=_['intersection'](_0x54bb7b[_0x8509('0x5d')],_0x54bb7b[_0x8509('0x5e')]);_0x1f59b9[_0x8509('0x62')]=_[_0x8509('0x61')](_0x54bb7b['model'],qs[_0x8509('0x63')](_0x136daf[_0x8509('0x5e')][_0x8509('0x63')]));_0x1f59b9[_0x8509('0x62')]=_0x1f59b9[_0x8509('0x62')][_0x8509('0x7f')]?_0x1f59b9[_0x8509('0x62')]:_0x54bb7b[_0x8509('0x5d')];if(!_0x136daf['query'][_0x8509('0x64')](_0x8509('0x65'))){_0x1f59b9['limit']=qs[_0x8509('0x35')](_0x136daf['query'][_0x8509('0x35')]);_0x1f59b9[_0x8509('0x37')]=qs[_0x8509('0x37')](_0x136daf[_0x8509('0x5e')]['offset']);}_0x1f59b9[_0x8509('0x66')]=qs[_0x8509('0x67')](_0x136daf[_0x8509('0x5e')]['sort']);_0x1f59b9[_0x8509('0x68')]=qs[_0x8509('0x60')](_[_0x8509('0x11d')](_0x136daf[_0x8509('0x5e')],_0x54bb7b[_0x8509('0x60')]));_0x1f59b9[_0x8509('0x68')][_0x8509('0xcc')]=_0x1bd65e['id'];if(_0x136daf[_0x8509('0x5e')][_0x8509('0xa0')]){_0x1f59b9[_0x8509('0x68')]=_[_0x8509('0x42')](_0x1f59b9['where'],{'$or':_[_0x8509('0x48')](_0x1f59b9[_0x8509('0x62')],function(_0x3fd211){var _0x3ecfb={};_0x3ecfb[_0x3fd211]={'$like':'%'+_0x136daf[_0x8509('0x5e')][_0x8509('0xa0')]+'%'};return _0x3ecfb;})});}if(_0x136daf['query'][_0x8509('0x98')]){var _0x227e53=_0x136daf[_0x8509('0x5e')][_0x8509('0x98')][_0x8509('0x4c')](',');var _0x179476={};_0x179476[_0x227e53[0x0]]={'$gte':moment(_0x227e53[0x1])[_0x8509('0x101')](_0x8509('0x11e'))};_0x1f59b9[_0x8509('0x68')]=_[_0x8509('0x42')](_0x1f59b9[_0x8509('0x68')],_0x179476);}_0x1f59b9=_[_0x8509('0x42')]({},_0x1f59b9,_0x136daf[_0x8509('0xd3')]);return db[_0x8509('0x11a')][_0x8509('0x36')]({'where':_0x1f59b9[_0x8509('0x68')]})[_0x8509('0x24')](function(_0x362986){_0x43fab1[_0x8509('0x36')]=_0x362986;if(_0x136daf[_0x8509('0x5e')][_0x8509('0xd1')]){_0x1f59b9[_0x8509('0xd2')]=[{'all':!![]}];}return db['ChatMessage'][_0x8509('0x11f')](_0x1f59b9);})[_0x8509('0x24')](function(_0xfabfe7){_0x43fab1[_0x8509('0xcd')]=_0xfabfe7;return _0x43fab1;});}})[_0x8509('0x24')](respondWithFilteredResult(_0x55e183,_0x1f59b9))['catch'](handleError(_0x55e183,null));};exports[_0x8509('0x120')]=function(_0x30e414,_0xf596c7,_0xfcab37){var _0x10247c={'where':{}},_0x38e3ab={},_0x46f1d1={'count':0x0,'rows':[]};return db[_0x8509('0xd0')][_0x8509('0xd7')]({'where':{'id':_0x30e414[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0xf596c7,null))[_0x8509('0x24')](function(_0x3437e1){if(_0x3437e1){_0x38e3ab[_0x8509('0x5d')]=_[_0x8509('0x5f')](db[_0x8509('0x11a')]['rawAttributes']);_0x38e3ab[_0x8509('0x5e')]=_[_0x8509('0x5f')](_0x30e414['query']);_0x38e3ab[_0x8509('0x60')]=_[_0x8509('0x61')](_0x38e3ab[_0x8509('0x5d')],_0x38e3ab[_0x8509('0x5e')]);_0x10247c['attributes']=_[_0x8509('0x61')](_0x38e3ab[_0x8509('0x5d')],qs[_0x8509('0x63')](_0x30e414[_0x8509('0x5e')][_0x8509('0x63')]));_0x10247c[_0x8509('0x62')]=_0x10247c[_0x8509('0x62')][_0x8509('0x7f')]?_0x10247c[_0x8509('0x62')]:_0x38e3ab[_0x8509('0x5d')];if(!_0x30e414[_0x8509('0x5e')][_0x8509('0x64')]('nolimit')){_0x10247c[_0x8509('0x35')]=qs[_0x8509('0x35')](_0x30e414[_0x8509('0x5e')][_0x8509('0x35')]);_0x10247c[_0x8509('0x37')]=qs['offset'](_0x30e414[_0x8509('0x5e')][_0x8509('0x37')]);}_0x10247c[_0x8509('0x66')]=qs[_0x8509('0x67')](_0x30e414[_0x8509('0x5e')][_0x8509('0x67')]);_0x10247c['where']=qs['filters'](_[_0x8509('0x11d')](_0x30e414[_0x8509('0x5e')],_0x38e3ab[_0x8509('0x60')]));_0x10247c[_0x8509('0x68')][_0x8509('0xcc')]=_0x3437e1['id'];if(_0x30e414[_0x8509('0x5e')][_0x8509('0xa0')]){_0x10247c[_0x8509('0x68')]=_[_0x8509('0x42')](_0x10247c[_0x8509('0x68')],{'$or':_[_0x8509('0x48')](_0x10247c[_0x8509('0x62')],function(_0x535c6f){var _0x533e5c={};_0x533e5c[_0x535c6f]={'$like':'%'+_0x30e414[_0x8509('0x5e')][_0x8509('0xa0')]+'%'};return _0x533e5c;})});}_0x10247c[_0x8509('0x68')]['secret']=![];if(_0x30e414[_0x8509('0x5e')]['id']){_0x10247c[_0x8509('0x68')]['id']={'$gt':_0x30e414['query']['id']};}_0x10247c=_[_0x8509('0x42')]({},_0x10247c,_0x30e414[_0x8509('0xd3')]);return db[_0x8509('0x11a')][_0x8509('0x36')]({'where':_0x10247c[_0x8509('0x68')]})[_0x8509('0x24')](function(_0x3c343a){_0x46f1d1[_0x8509('0x36')]=_0x3c343a;_0x10247c[_0x8509('0xd2')]=[];if(_0x30e414[_0x8509('0x5e')][_0x8509('0x121')]){_0x10247c[_0x8509('0xd2')][_0x8509('0x4e')]({'model':db[_0x8509('0x108')],'as':_0x8509('0x108'),'attributes':['id',_0x8509('0x49'),_0x8509('0x109')]});}if(_0x30e414[_0x8509('0x5e')]['includeAll']){_0x10247c[_0x8509('0xd2')]=[{'all':!![]}];}return db[_0x8509('0x11a')][_0x8509('0x11f')](_0x10247c);})[_0x8509('0x24')](function(_0x561554){_0x46f1d1['rows']=_0x561554;return _0x46f1d1;});}})[_0x8509('0x24')](respondWithFilteredResult(_0xf596c7,_0x10247c))['catch'](handleError(_0xf596c7,null));};exports['addTags']=function(_0x1d0374,_0x51a546,_0x306133){return db['ChatInteraction']['find']({'where':{'id':_0x1d0374[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0x51a546,null))[_0x8509('0x24')](function(_0x4cabbf){if(_0x4cabbf){return _0x4cabbf[_0x8509('0x122')](_0x1d0374[_0x8509('0x43')][_0x8509('0x11b')],_[_0x8509('0x123')](_0x1d0374[_0x8509('0x43')],[_0x8509('0x11b'),'id'])||{})['spread'](function(){return db[_0x8509('0x124')][_0x8509('0x11f')]({'attributes':['id','name',_0x8509('0x125')],'where':{'id':_0x1d0374[_0x8509('0x43')]['ids']}});})[_0x8509('0x24')](function(_0x55ae6c){socket[_0x8509('0x126')](_0x8509('0x127'),{'id':Number(_0x1d0374[_0x8509('0xcf')]['id']),'tags':_0x55ae6c||[]});return{'id':Number(_0x1d0374['params']['id']),'tags':_0x55ae6c||[]};});}})['then'](respondWithResult(_0x51a546,null))[_0x8509('0x2f')](handleError(_0x51a546,null));};exports['removeTags']=function(_0x533bf4,_0xe40474,_0x5c207b){return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x533bf4[_0x8509('0xcf')]['id']}})[_0x8509('0x24')](handleEntityNotFound(_0xe40474,null))[_0x8509('0x24')](function(_0x5dee05){if(_0x5dee05){return _0x5dee05[_0x8509('0x128')](_0x533bf4[_0x8509('0x5e')][_0x8509('0x11b')]);}})[_0x8509('0x24')](respondWithStatusCode(_0xe40474,null))[_0x8509('0x2f')](handleError(_0xe40474,null));};exports[_0x8509('0xfa')]=function(_0x54b197,_0x48cc5e){var _0x450cbd=moment()[_0x8509('0x129')]()[_0x8509('0xb2')]();var _0x3636a6=path[_0x8509('0xf6')](config[_0x8509('0xf7')],'server',_0x8509('0x12a'),_0x8509('0x12b'));var _0x47022b=path[_0x8509('0xf6')](config['root'],_0x8509('0x12c'),_0x8509('0x12a'),_0x8509('0x12d'));var _0x34ae40=path[_0x8509('0xf6')](_0x3636a6,_0x450cbd);var _0x1a9986=util[_0x8509('0x101')](_0x8509('0x12e'),_0x54b197[_0x8509('0xcf')]['id'],_0x450cbd);var _0x4e75b7=path[_0x8509('0xf6')](_0x3636a6,_0x1a9986);var _0xda7864=[];_0xda7864[_0x8509('0x4e')]({'model':db[_0x8509('0x108')],'as':_0x8509('0x108'),'attributes':['id',_0x8509('0x49')],'raw':!![]});_0xda7864[_0x8509('0x4e')]({'model':db['CmContact'],'as':_0x8509('0x84'),'attributes':['id',_0x8509('0x12f'),_0x8509('0x130')],'raw':!![]});if(_0x54b197[_0x8509('0x5e')][_0x8509('0x12d')]){_0xda7864[_0x8509('0x4e')]({'model':db[_0x8509('0xf2')],'as':_0x8509('0xf2'),'raw':!![]});}var _0x1220a2=[{'model':db[_0x8509('0x11a')],'as':_0x8509('0x100'),'attributes':['id','body',_0x8509('0x96'),_0x8509('0x131'),'secret','read'],'include':_0xda7864}];_0x1220a2['push']({'model':db[_0x8509('0xd8')],'as':_0x8509('0x132'),'attributes':['id',_0x8509('0x3f')]});_0x1220a2['push']({'model':db[_0x8509('0x108')],'as':'Owner','attributes':['id',_0x8509('0x49')]});return db[_0x8509('0xd0')][_0x8509('0x80')]({'where':{'id':_0x54b197[_0x8509('0xcf')]['id']},'include':_0x1220a2})['then'](handleEntityNotFound(_0x48cc5e,null))[_0x8509('0x24')](function(_0x36fc9b){if(_0x36fc9b){var _0x57264c=_0x36fc9b[_0x8509('0x133')]({'plain':!![]});fs[_0x8509('0x134')](_0x34ae40);var _0x1295fd={'channel':_0x8509('0x135'),'account':_0x57264c[_0x8509('0x132')][_0x8509('0x3f')],'agent':_0x57264c[_0x8509('0x136')]?_0x57264c[_0x8509('0x136')]['fullname']:'N.A.','createdAt':moment(_0x57264c[_0x8509('0x96')])[_0x8509('0x101')](_0x8509('0x11e'))[_0x8509('0xb2')](),'closedAt':_0x57264c[_0x8509('0x56')]?moment(_0x57264c[_0x8509('0x137')])[_0x8509('0x101')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8509('0xb2')]():'','disposition':_0x57264c[_0x8509('0x57')],'chatInfo':{'browser':_0x57264c[_0x8509('0x138')],'os':_0x57264c[_0x8509('0x139')],'referer':_0x57264c[_0x8509('0x13a')],'customerIp':_0x57264c[_0x8509('0x13b')],'customerPort':_0x57264c['customerPort']?_0x57264c['customerPort']:_0x8509('0x13c')},'messages':_(_0x57264c['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x287394){if(_0x287394['Attachment']){var _0x2057ce=path[_0x8509('0xf6')](_0x47022b,_0x287394[_0x8509('0xf2')][_0x8509('0xef')]);if(fs[_0x8509('0x13d')](_0x2057ce)){fs['createReadStream'](_0x2057ce)[_0x8509('0x13e')](fs['createWriteStream'](path[_0x8509('0xf6')](_0x34ae40,_0x287394['Attachment'][_0x8509('0xef')])));}}return{'date':moment(_0x287394[_0x8509('0x96')])[_0x8509('0x101')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8509('0xb2')](),'sender':_0x287394[_0x8509('0x131')]==='out'?_0x287394[_0x8509('0x108')]?_0x287394[_0x8509('0x108')][_0x8509('0x49')]:_0x8509('0x104'):_0x287394['Contact']['firstName']+(_0x287394[_0x8509('0x84')][_0x8509('0x130')]?'\x20'+_0x287394[_0x8509('0x84')]['lastName']:''),'body':_0x287394[_0x8509('0xf2')]?_0x287394[_0x8509('0xf2')][_0x8509('0xef')]:_0x287394['body'],'direction':_0x287394[_0x8509('0x131')]===_0x8509('0xe7')?'A':'C','secret':_0x287394[_0x8509('0x13f')],'read':_0x287394[_0x8509('0x9c')],'attachment':_0x287394[_0x8509('0xf2')]};})[_0x8509('0x82')]()};return ejs[_0x8509('0x140')](path[_0x8509('0xf6')](config[_0x8509('0xf7')],_0x8509('0x12c'),_0x8509('0x141'),'downloadInteraction.ejs'),{'interaction':_0x1295fd})[_0x8509('0x24')](function(_0x531879){var _0xcf66ed=path[_0x8509('0xf6')](_0x34ae40,_0x8509('0x142')+_0x57264c['id']+'-'+_0x450cbd+_0x8509('0x143'));var _0x521215={'path':_0xcf66ed,'channel':_0x8509('0x135'),'interactionId':_0x57264c['id']};return pdf[_0x8509('0x144')](_0x531879,_0x521215);})[_0x8509('0x24')](function(){return new BPromise(function(_0x1591fe,_0x3521d5){zipdir(_0x34ae40,{'saveTo':_0x4e75b7},function(_0x4ace75,_0x543262){if(_0x4ace75)return _0x3521d5(_0x4ace75);return _0x1591fe(_0x543262);});})[_0x8509('0x24')](function(){return new BPromise(function(_0x4f3b9f,_0x563abb){rimraf(_0x34ae40,function(_0x4ae528){if(_0x4ae528)_0x563abb(_0x4ae528);return _0x4f3b9f();});});})[_0x8509('0x24')](function(){return _0x48cc5e['download'](_0x4e75b7,_0x1a9986,function(_0x462dbe){if(_0x462dbe){console[_0x8509('0x145')]('err',_0x462dbe);}else{fs[_0x8509('0x146')](_0x4e75b7);}});});});}else{return _0x48cc5e[_0x8509('0x30')](0xc8);}})['catch'](handleError(_0x48cc5e,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 30f55ba..e95d92b 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 _0xa359=['catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','save','update','remove','getUsers','setDataValue','map','findAll','unreadMessages','emit'];(function(_0x162415,_0x252d65){var _0x1c01d9=function(_0x55a444){while(--_0x55a444){_0x162415['push'](_0x162415['shift']());}};_0x1c01d9(++_0x252d65);}(_0xa359,0x6a));var _0x9a35=function(_0x4591fb,_0x578ce3){_0x4591fb=_0x4591fb-0x0;var _0x282347=_0xa359[_0x4591fb];return _0x282347;};'use strict';var EventEmitter=require(_0x9a35('0x0'));var ChatInteraction=require(_0x9a35('0x1'))['db'][_0x9a35('0x2')];var ChatMessage=require(_0x9a35('0x1'))['db'][_0x9a35('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a35('0x4'),'afterUpdate':_0x9a35('0x5'),'afterDestroy':_0x9a35('0x6')};function emitEvent(_0x21883f){return function(_0x5b57b4,_0x2818cf,_0x37520f){_0x5b57b4[_0x9a35('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x8dde62){_0x5b57b4[_0x9a35('0x8')]('Users',_0x8dde62[_0x9a35('0x9')](function(_0x3071a8){return{'id':_0x3071a8['id']};}));return ChatMessage[_0x9a35('0xa')]({'where':{'ChatInteractionId':_0x5b57b4['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x350133){_0x5b57b4[_0x9a35('0x8')](_0x9a35('0xb'),_0x350133['length']);ChatInteractionEvents[_0x9a35('0xc')](_0x21883f+':'+_0x5b57b4['id'],_0x5b57b4);ChatInteractionEvents[_0x9a35('0xc')](_0x21883f,_0x5b57b4);_0x37520f(null);})[_0x9a35('0xd')](_0x37520f(null));};}for(var e in events){if(events[_0x9a35('0xe')](e)){var event=events[e];ChatInteraction[_0x9a35('0xf')](e,emitEvent(event));}}module[_0x9a35('0x10')]=ChatInteractionEvents; \ No newline at end of file +var _0xb16e=['exports','events','../../mysqldb','ChatInteraction','save','update','remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x32add3,_0x251520){var _0x1fea76=function(_0x3f3994){while(--_0x3f3994){_0x32add3['push'](_0x32add3['shift']());}};_0x1fea76(++_0x251520);}(_0xb16e,0x1d5));var _0xeb16=function(_0x46f1a6,_0xc7a582){_0x46f1a6=_0x46f1a6-0x0;var _0x38429a=_0xb16e[_0x46f1a6];return _0x38429a;};'use strict';var EventEmitter=require(_0xeb16('0x0'));var ChatInteraction=require(_0xeb16('0x1'))['db'][_0xeb16('0x2')];var ChatMessage=require(_0xeb16('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb16('0x3'),'afterUpdate':_0xeb16('0x4'),'afterDestroy':_0xeb16('0x5')};function emitEvent(_0x2803c3){return function(_0x151576,_0x31536a,_0x5a2777){_0x151576[_0xeb16('0x6')]({'attributes':['id'],'raw':!![]})[_0xeb16('0x7')](function(_0x4c1845){_0x151576['setDataValue'](_0xeb16('0x8'),_0x4c1845[_0xeb16('0x9')](function(_0x921cb4){return{'id':_0x921cb4['id']};}));return ChatMessage[_0xeb16('0xa')]({'where':{'ChatInteractionId':_0x151576['id'],'direction':'in','read':![]},'raw':!![]});})[_0xeb16('0x7')](function(_0x463845){_0x151576[_0xeb16('0xb')](_0xeb16('0xc'),_0x463845[_0xeb16('0xd')]);ChatInteractionEvents[_0xeb16('0xe')](_0x2803c3+':'+_0x151576['id'],_0x151576);ChatInteractionEvents[_0xeb16('0xe')](_0x2803c3,_0x151576);_0x5a2777(null);})['catch'](_0x5a2777(null));};}for(var e in events){if(events[_0xeb16('0xf')](e)){var event=events[e];ChatInteraction[_0xeb16('0x10')](e,emitEvent(event));}}module[_0xeb16('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 27925fe..cba6abd 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 _0x9e57=['./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment'];(function(_0x1cc59b,_0x2bc730){var _0x739cbd=function(_0x57beee){while(--_0x57beee){_0x1cc59b['push'](_0x1cc59b['shift']());}};_0x739cbd(++_0x2bc730);}(_0x9e57,0xe3));var _0x79e5=function(_0xb5809,_0x103b91){_0xb5809=_0xb5809-0x0;var _0x57b30b=_0x9e57[_0xb5809];return _0x57b30b;};'use strict';var _=require(_0x79e5('0x0'));var util=require('util');var logger=require(_0x79e5('0x1'))(_0x79e5('0x2'));var moment=require('moment');var BPromise=require(_0x79e5('0x3'));var rp=require(_0x79e5('0x4'));var fs=require('fs');var path=require(_0x79e5('0x5'));var rimraf=require('rimraf');var config=require(_0x79e5('0x6'));var attributes=require(_0x79e5('0x7'));module[_0x79e5('0x8')]=function(_0x2e68fb,_0x34cbb5){return _0x2e68fb[_0x79e5('0x9')](_0x79e5('0xa'),attributes,{'tableName':_0x79e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x46ef62,_0x220ee4,_0x45b996){if(_0x46ef62[_0x79e5('0xc')](_0x79e5('0xd'))){_0x46ef62['closedAt']=moment()[_0x79e5('0xe')](_0x79e5('0xf'));}_0x45b996(null,_0x46ef62);}},'charset':_0x79e5('0x10'),'collate':_0x79e5('0x11')});}; \ No newline at end of file +var _0x1730=['ChatInteraction','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','util','moment','bluebird','../../config/environment','exports','define'];(function(_0x490885,_0x50c24d){var _0x135689=function(_0x47e581){while(--_0x47e581){_0x490885['push'](_0x490885['shift']());}};_0x135689(++_0x50c24d);}(_0x1730,0xa1));var _0x0173=function(_0x5191ee,_0x4c65f1){_0x5191ee=_0x5191ee-0x0;var _0x242b20=_0x1730[_0x5191ee];return _0x242b20;};'use strict';var _=require(_0x0173('0x0'));var util=require(_0x0173('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0173('0x2'));var BPromise=require(_0x0173('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x0173('0x4'));var attributes=require('./chatInteraction.attributes');module[_0x0173('0x5')]=function(_0x136a83,_0x11ae14){return _0x136a83[_0x0173('0x6')](_0x0173('0x7'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x139095,_0x51923c,_0x3eb856){if(_0x139095[_0x0173('0x8')](_0x0173('0x9'))){_0x139095[_0x0173('0xa')]=moment()[_0x0173('0xb')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3eb856(null,_0x139095);}},'charset':_0x0173('0xc'),'collate':_0x0173('0xd')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 5733c29..67951cf 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 _0x76c5=['find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatInteraction,\x20%s,\x20%s','result','UpdateChatInteraction','update','body','options','raw','attributes','limit','catch','ChatInteraction'];(function(_0x355488,_0x2424b9){var _0x400a57=function(_0x511a6b){while(--_0x511a6b){_0x355488['push'](_0x355488['shift']());}};_0x400a57(++_0x2424b9);}(_0x76c5,0x166));var _0x576c=function(_0x2d1971,_0x20b764){_0x2d1971=_0x2d1971-0x0;var _0x4d7759=_0x76c5[_0x2d1971];return _0x4d7759;};'use strict';var _=require(_0x576c('0x0'));var util=require('util');var moment=require(_0x576c('0x1'));var BPromise=require(_0x576c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x576c('0x3'))(_0x576c('0x4'));var config=require('../../config/environment');var jayson=require(_0x576c('0x5'));var client=jayson[_0x576c('0x6')]['http']({'port':0x232a});config['redis']=_[_0x576c('0x7')](config[_0x576c('0x8')],{'host':_0x576c('0x9'),'port':0x18eb});var socket=require(_0x576c('0xa'))(new Redis(config[_0x576c('0x8')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x505b08,_0x69d697,_0x391ea4){return new BPromise(function(_0x4b439d,_0x46896e){return client[_0x576c('0xb')](_0x505b08,_0x391ea4)[_0x576c('0xc')](function(_0x44ea24){logger[_0x576c('0xd')]('ChatInteraction,\x20%s,\x20%s',_0x69d697,_0x576c('0xe'));logger[_0x576c('0xf')](_0x576c('0x10'),_0x69d697,'request\x20sent',JSON[_0x576c('0x11')](_0x44ea24));if(_0x44ea24['error']){if(_0x44ea24[_0x576c('0x12')][_0x576c('0x13')]===0x1f4){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x69d697,_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);return _0x46896e(_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);}logger[_0x576c('0x12')](_0x576c('0x15'),_0x69d697,_0x44ea24[_0x576c('0x12')][_0x576c('0x14')]);return _0x4b439d(_0x44ea24[_0x576c('0x12')]['message']);}else{logger[_0x576c('0xd')](_0x576c('0x15'),_0x69d697,_0x576c('0xe'));_0x4b439d(_0x44ea24[_0x576c('0x16')][_0x576c('0x14')]);}})['catch'](function(_0x2ab2b4){logger[_0x576c('0x12')](_0x576c('0x15'),_0x69d697,_0x2ab2b4);_0x46896e(_0x2ab2b4);});});}exports[_0x576c('0x17')]=function(_0x4bbfe6){var _0x5646c9=this;return new Promise(function(_0x46d123,_0x46e297){return db['ChatInteraction'][_0x576c('0x18')](_0x4bbfe6[_0x576c('0x19')],{'raw':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')][_0x576c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')]['where']||null:null,'attributes':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6['options'][_0x576c('0x1c')]||null:null,'limit':_0x4bbfe6[_0x576c('0x1a')]?_0x4bbfe6[_0x576c('0x1a')][_0x576c('0x1d')]||null:null})[_0x576c('0xc')](function(_0x3d4268){logger[_0x576c('0xd')](_0x576c('0x17'),_0x4bbfe6);logger[_0x576c('0xf')](_0x576c('0x17'),_0x4bbfe6,JSON['stringify'](_0x3d4268));_0x46d123(_0x3d4268);})[_0x576c('0x1e')](function(_0x2ae570){logger[_0x576c('0x12')](_0x576c('0x17'),_0x2ae570['message'],_0x4bbfe6);_0x46e297(_0x5646c9['error'](0x1f4,_0x2ae570[_0x576c('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x13c3c5){return new Promise(function(_0x553bfc,_0x535c5e){return db[_0x576c('0x1f')][_0x576c('0x20')]({'where':_0x13c3c5[_0x576c('0x1a')]?_0x13c3c5['options'][_0x576c('0x21')]||null:null})['then'](function(_0x3e708b){if(_0x3e708b){return _0x3e708b[_0x576c('0x22')](_0x13c3c5[_0x576c('0x19')][_0x576c('0x23')],_[_0x576c('0x24')](_0x13c3c5['body'],['ids','id'])||{});}})[_0x576c('0x25')](function(_0x20a499){logger[_0x576c('0xd')](_0x576c('0x26'),_0x13c3c5);logger[_0x576c('0xf')](_0x576c('0x26'),_0x13c3c5,JSON[_0x576c('0x11')](_0x20a499));_0x553bfc(_0x20a499);})[_0x576c('0x1e')](function(_0x4d49ea){logger[_0x576c('0x12')](_0x576c('0x26'),_0x4d49ea[_0x576c('0x14')],_0x13c3c5);_0x535c5e(_this[_0x576c('0x12')](0x1f4,_0x4d49ea[_0x576c('0x14')]));});});}; \ No newline at end of file +var _0xb01f=['defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','UpdateChatInteraction','ChatInteraction','update','body','options','attributes','limit','then','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis'];(function(_0x7870a5,_0x61cb8f){var _0x1e6b33=function(_0x23d075){while(--_0x23d075){_0x7870a5['push'](_0x7870a5['shift']());}};_0x1e6b33(++_0x61cb8f);}(_0xb01f,0x9d));var _0xfb01=function(_0x1d2d6a,_0x556e3e){_0x1d2d6a=_0x1d2d6a-0x0;var _0x4ce5d2=_0xb01f[_0x1d2d6a];return _0x4ce5d2;};'use strict';var _=require('lodash');var util=require(_0xfb01('0x0'));var moment=require(_0xfb01('0x1'));var BPromise=require(_0xfb01('0x2'));var rs=require(_0xfb01('0x3'));var fs=require('fs');var Redis=require(_0xfb01('0x4'));var db=require(_0xfb01('0x5'))['db'];var utils=require(_0xfb01('0x6'));var logger=require('../../config/logger')(_0xfb01('0x7'));var config=require(_0xfb01('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfb01('0x9')]['http']({'port':0x232a});config[_0xfb01('0xa')]=_[_0xfb01('0xb')](config[_0xfb01('0xa')],{'host':_0xfb01('0xc'),'port':0x18eb});var socket=require(_0xfb01('0xd'))(new Redis(config['redis']));require(_0xfb01('0xe'))[_0xfb01('0xf')](socket);function respondWithRpcPromise(_0x253cc0,_0x1e5bc7,_0x5d9cfe){return new BPromise(function(_0x114de4,_0x30d3bc){return client[_0xfb01('0x10')](_0x253cc0,_0x5d9cfe)['then'](function(_0x3b102d){logger['info'](_0xfb01('0x11'),_0x1e5bc7,_0xfb01('0x12'));logger[_0xfb01('0x13')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x1e5bc7,_0xfb01('0x12'),JSON[_0xfb01('0x14')](_0x3b102d));if(_0x3b102d[_0xfb01('0x15')]){if(_0x3b102d[_0xfb01('0x15')][_0xfb01('0x16')]===0x1f4){logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b102d[_0xfb01('0x15')][_0xfb01('0x17')]);return _0x30d3bc(_0x3b102d['error'][_0xfb01('0x17')]);}logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b102d['error']['message']);return _0x114de4(_0x3b102d[_0xfb01('0x15')]['message']);}else{logger[_0xfb01('0x18')](_0xfb01('0x11'),_0x1e5bc7,'request\x20sent');_0x114de4(_0x3b102d['result'][_0xfb01('0x17')]);}})[_0xfb01('0x19')](function(_0x3b2f66){logger[_0xfb01('0x15')](_0xfb01('0x11'),_0x1e5bc7,_0x3b2f66);_0x30d3bc(_0x3b2f66);});});}exports[_0xfb01('0x1a')]=function(_0x4a559c){var _0x6f17f3=this;return new Promise(function(_0x4e58b4,_0x26bef8){return db[_0xfb01('0x1b')][_0xfb01('0x1c')](_0x4a559c[_0xfb01('0x1d')],{'raw':_0x4a559c['options']?_0x4a559c[_0xfb01('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4a559c[_0xfb01('0x1e')]?_0x4a559c['options']['where']||null:null,'attributes':_0x4a559c['options']?_0x4a559c[_0xfb01('0x1e')][_0xfb01('0x1f')]||null:null,'limit':_0x4a559c[_0xfb01('0x1e')]?_0x4a559c[_0xfb01('0x1e')][_0xfb01('0x20')]||null:null})[_0xfb01('0x21')](function(_0x211cdf){logger[_0xfb01('0x18')](_0xfb01('0x1a'),_0x4a559c);logger['debug'](_0xfb01('0x1a'),_0x4a559c,JSON[_0xfb01('0x14')](_0x211cdf));_0x4e58b4(_0x211cdf);})[_0xfb01('0x19')](function(_0x407a20){logger['error']('UpdateChatInteraction',_0x407a20[_0xfb01('0x17')],_0x4a559c);_0x26bef8(_0x6f17f3['error'](0x1f4,_0x407a20['message']));});});};exports[_0xfb01('0x22')]=function(_0x56ce14){return new Promise(function(_0x4a0ece,_0x2bb6cc){return db[_0xfb01('0x1b')][_0xfb01('0x23')]({'where':_0x56ce14['options']?_0x56ce14[_0xfb01('0x1e')][_0xfb01('0x24')]||null:null})['then'](function(_0x45e59a){if(_0x45e59a){return _0x45e59a[_0xfb01('0x25')](_0x56ce14[_0xfb01('0x1d')][_0xfb01('0x26')],_[_0xfb01('0x27')](_0x56ce14[_0xfb01('0x1d')],[_0xfb01('0x26'),'id'])||{});}})[_0xfb01('0x28')](function(_0x456538){logger[_0xfb01('0x18')](_0xfb01('0x29'),_0x56ce14);logger[_0xfb01('0x13')](_0xfb01('0x29'),_0x56ce14,JSON['stringify'](_0x456538));_0x4a0ece(_0x456538);})[_0xfb01('0x19')](function(_0x4a71da){logger[_0xfb01('0x15')](_0xfb01('0x29'),_0x4a71da['message'],_0x56ce14);_0x2bb6cc(_this[_0xfb01('0x15')](0x1f4,_0x4a71da['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 059cf66..308985d 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 _0x6dbb=['register','./chatInteraction.events','emit','removeListener'];(function(_0x10b933,_0x20c508){var _0x464a11=function(_0x26367a){while(--_0x26367a){_0x10b933['push'](_0x10b933['shift']());}};_0x464a11(++_0x20c508);}(_0x6dbb,0x1b5));var _0xb6db=function(_0x1e070f,_0x39661f){_0x1e070f=_0x1e070f-0x0;var _0x38569f=_0x6dbb[_0x1e070f];return _0x38569f;};'use strict';var ChatInteractionEvents=require(_0xb6db('0x0'));var events=['save','remove','update'];function createListener(_0x142a8f,_0x2439f3){return function(_0xee45f6){_0x2439f3[_0xb6db('0x1')](_0x142a8f,_0xee45f6);};}function removeListener(_0x1eae89,_0x24ee75){return function(){ChatInteractionEvents[_0xb6db('0x2')](_0x1eae89,_0x24ee75);};}exports[_0xb6db('0x3')]=function(_0x4473b1){for(var _0x1f2f97=0x0,_0x213839=events['length'];_0x1f2f97<_0x213839;_0x1f2f97++){var _0x49f2b6=events[_0x1f2f97];var _0xfd7e03=createListener('chatInteraction:'+_0x49f2b6,_0x4473b1);ChatInteractionEvents['on'](_0x49f2b6,_0xfd7e03);}}; \ No newline at end of file +var _0xabe6=['save','remove','update','removeListener','register','length','./chatInteraction.events'];(function(_0x636f31,_0x51acfc){var _0x3a394d=function(_0x1a6bf5){while(--_0x1a6bf5){_0x636f31['push'](_0x636f31['shift']());}};_0x3a394d(++_0x51acfc);}(_0xabe6,0x84));var _0x6abe=function(_0xe88d61,_0x56fd65){_0xe88d61=_0xe88d61-0x0;var _0x4f67b3=_0xabe6[_0xe88d61];return _0x4f67b3;};'use strict';var ChatInteractionEvents=require(_0x6abe('0x0'));var events=[_0x6abe('0x1'),_0x6abe('0x2'),_0x6abe('0x3')];function createListener(_0x4726f2,_0x50e90a){return function(_0x4ae16f){_0x50e90a['emit'](_0x4726f2,_0x4ae16f);};}function removeListener(_0x2fa073,_0xf0b0a2){return function(){ChatInteractionEvents[_0x6abe('0x4')](_0x2fa073,_0xf0b0a2);};}exports[_0x6abe('0x5')]=function(_0x4c8755){for(var _0x2f50b8=0x0,_0x3c5b79=events[_0x6abe('0x6')];_0x2f50b8<_0x3c5b79;_0x2f50b8++){var _0x4ae157=events[_0x2f50b8];var _0x1ae025=createListener('chatInteraction:'+_0x4ae157,_0x4c8755);ChatInteractionEvents['on'](_0x4ae157,_0x1ae025);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 8a55c79..f6ba991 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 _0xdf7c=['/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','diskStorage','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','/:id/tags','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show'];(function(_0x3ead6c,_0x52f38c){var _0x211fe8=function(_0x4741ff){while(--_0x4741ff){_0x3ead6c['push'](_0x3ead6c['shift']());}};_0x211fe8(++_0x52f38c);}(_0xdf7c,0xf0));var _0xcdf7=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xdf7c[_0xcfeda9];return _0x4826c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xcdf7('0x0'));var timeout=require(_0xcdf7('0x1'));var express=require(_0xcdf7('0x2'));var router=express[_0xcdf7('0x3')]();var fs_extra=require(_0xcdf7('0x4'));var auth=require(_0xcdf7('0x5'));var interaction=require(_0xcdf7('0x6'));var config=require(_0xcdf7('0x7'));var controller=require(_0xcdf7('0x8'));router[_0xcdf7('0x9')]('/',auth[_0xcdf7('0xa')](),controller[_0xcdf7('0xb')]);router[_0xcdf7('0x9')](_0xcdf7('0xc'),auth[_0xcdf7('0xa')](),controller['describe']);router[_0xcdf7('0x9')]('/:id',auth[_0xcdf7('0xd')](),controller[_0xcdf7('0xe')]);router[_0xcdf7('0x9')](_0xcdf7('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xcdf7('0x9')](_0xcdf7('0x10'),auth['isAuthenticated'](),controller['getMessages']);router[_0xcdf7('0x9')](_0xcdf7('0x11'),auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x12')]);router[_0xcdf7('0x9')](_0xcdf7('0x13'),auth[_0xcdf7('0xa')](),controller[_0xcdf7('0x14')]);router['post']('/',auth[_0xcdf7('0xa')](),controller[_0xcdf7('0x15')]);router[_0xcdf7('0x16')]('/:id/vidaoo',auth[_0xcdf7('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xcdf7('0x17')]({'destination':function(_0x3a3de5,_0x5661cf,_0x19bcce){_0x19bcce(null,path['join'](config[_0xcdf7('0x18')],_0xcdf7('0x19')));},'filename':function(_0x12a3ff,_0x13a9de,_0x2327d5){_0x2327d5(null,util[_0xcdf7('0x1a')]('%s-%s',Date[_0xcdf7('0x1b')](),_0x13a9de[_0xcdf7('0x1c')][_0xcdf7('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xcdf7('0x16')](_0xcdf7('0x1e'),upload[_0xcdf7('0x1f')](_0xcdf7('0x20')),controller[_0xcdf7('0x21')]);router['post']('/:id/messages',auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x22')]);router[_0xcdf7('0x16')]('/:id/tags',auth[_0xcdf7('0xa')](),interaction[_0xcdf7('0x23')](_0xcdf7('0x24'),_0xcdf7('0x25')),controller['addTags']);router[_0xcdf7('0x26')]('/:id',auth[_0xcdf7('0xa')](),interaction[_0xcdf7('0x23')]('chat',_0xcdf7('0x27')),controller[_0xcdf7('0x28')]);router['put'](_0xcdf7('0x29'),controller['customUpdate']);router[_0xcdf7('0x26')](_0xcdf7('0x2a'),auth[_0xcdf7('0xd')](),controller[_0xcdf7('0x2b')]);router[_0xcdf7('0x26')](_0xcdf7('0x2c'),controller[_0xcdf7('0x2d')]);router[_0xcdf7('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0xcdf7('0x23')]('chat',_0xcdf7('0x2f')),controller[_0xcdf7('0x30')]);router[_0xcdf7('0x2e')](_0xcdf7('0x31'),auth['isAuthenticated'](),controller[_0xcdf7('0x32')]);module['exports']=router; \ No newline at end of file +var _0x347d=['delete','chatinteraction:destroy','destroy','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','describe','/:id','show','attachmentDownload','/:id/messages','isAuthenticated','getMessages','isChatInteractionAuthorized','/:id/download','download','post','create','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','single','attachmentUpload','addMessage','/:id/tags','tracked','chatinteraction:addtags','addTags','chat','chatinteraction:update','update','/:id/custom_update','put','/:id/abandon','/:id/close'];(function(_0x17e1f5,_0x1fbee8){var _0x2e4b8a=function(_0x39dbaa){while(--_0x39dbaa){_0x17e1f5['push'](_0x17e1f5['shift']());}};_0x2e4b8a(++_0x1fbee8);}(_0x347d,0x162));var _0xd347=function(_0x22c217,_0x1099b2){_0x22c217=_0x22c217-0x0;var _0x5e3ef1=_0x347d[_0x22c217];return _0x5e3ef1;};'use strict';var multer=require(_0xd347('0x0'));var util=require(_0xd347('0x1'));var path=require(_0xd347('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd347('0x3')]();var fs_extra=require(_0xd347('0x4'));var auth=require(_0xd347('0x5'));var interaction=require(_0xd347('0x6'));var config=require(_0xd347('0x7'));var controller=require(_0xd347('0x8'));router[_0xd347('0x9')]('/',auth['isAuthenticated'](),controller[_0xd347('0xa')]);router[_0xd347('0x9')](_0xd347('0xb'),auth['isAuthenticated'](),controller[_0xd347('0xc')]);router[_0xd347('0x9')](_0xd347('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xd347('0xe')]);router[_0xd347('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0xd347('0xf')]);router[_0xd347('0x9')](_0xd347('0x10'),auth[_0xd347('0x11')](),controller[_0xd347('0x12')]);router['get']('/:id/my_messages',auth[_0xd347('0x13')](),controller['getMyMessages']);router[_0xd347('0x9')](_0xd347('0x14'),auth['isAuthenticated'](),controller[_0xd347('0x15')]);router[_0xd347('0x16')]('/',auth['isAuthenticated'](),controller[_0xd347('0x17')]);router[_0xd347('0x16')](_0xd347('0x18'),auth[_0xd347('0x11')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xd347('0x19')]({'destination':function(_0x1c89f5,_0x4c5324,_0x33dd80){_0x33dd80(null,path[_0xd347('0x1a')](config[_0xd347('0x1b')],_0xd347('0x1c')));},'filename':function(_0x4de946,_0x2fe5ce,_0x2a3df2){_0x2a3df2(null,util[_0xd347('0x1d')]('%s-%s',Date[_0xd347('0x1e')](),_0x2fe5ce[_0xd347('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xd347('0x16')]('/:id/attachment_upload',upload[_0xd347('0x20')]('file'),controller[_0xd347('0x21')]);router[_0xd347('0x16')](_0xd347('0x10'),auth[_0xd347('0x13')](),controller[_0xd347('0x22')]);router[_0xd347('0x16')](_0xd347('0x23'),auth['isAuthenticated'](),interaction[_0xd347('0x24')]('chat',_0xd347('0x25')),controller[_0xd347('0x26')]);router['put'](_0xd347('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xd347('0x27'),_0xd347('0x28')),controller[_0xd347('0x29')]);router['put'](_0xd347('0x2a'),controller['customUpdate']);router[_0xd347('0x2b')](_0xd347('0x2c'),auth[_0xd347('0x13')](),controller['abandon']);router[_0xd347('0x2b')](_0xd347('0x2d'),controller['close']);router[_0xd347('0x2e')](_0xd347('0xd'),auth[_0xd347('0x11')](),interaction[_0xd347('0x24')]('chat',_0xd347('0x2f')),controller[_0xd347('0x30')]);router['delete'](_0xd347('0x23'),auth[_0xd347('0x11')](),controller['removeTags']);module[_0xd347('0x31')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 034e006..2557504 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 _0xdf7e=['sequelize','exports','TEXT','BOOLEAN'];(function(_0x3d4995,_0x3bd75d){var _0x263a2c=function(_0x3ff5e5){while(--_0x3ff5e5){_0x3d4995['push'](_0x3d4995['shift']());}};_0x263a2c(++_0x3bd75d);}(_0xdf7e,0x130));var _0xedf7=function(_0x131b54,_0x2e4c2e){_0x131b54=_0x131b54-0x0;var _0x3e7b7b=_0xdf7e[_0x131b54];return _0x3e7b7b;};'use strict';var Sequelize=require(_0xedf7('0x0'));module[_0xedf7('0x1')]={'body':{'type':Sequelize[_0xedf7('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xedf7('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5e07=['BOOLEAN','sequelize','exports','medium'];(function(_0xa78cbb,_0x1dbfe9){var _0x148223=function(_0x301e36){while(--_0x301e36){_0xa78cbb['push'](_0xa78cbb['shift']());}};_0x148223(++_0x1dbfe9);}(_0x5e07,0xa5));var _0x75e0=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5e07[_0x297fd3];return _0x2af381;};'use strict';var Sequelize=require(_0x75e0('0x0'));module[_0x75e0('0x1')]={'body':{'type':Sequelize['TEXT'](_0x75e0('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x75e0('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 1d9cecb..c822ace 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 _0xf717=['set','Content-Range','apply','reject','save','then','destroy','name','send','index','fieldName','type','key','query','filters','model','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','ChatInternalMessage','includeAll','findAll','params','keys','rawAttributes','length','options','find','catch','create','body','update','describe','get','messages','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','internal','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','resourceId','push','createdAt','FromId','ToId','read','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x256ffb,_0x19f08f){var _0x3c9a19=function(_0x58771c){while(--_0x58771c){_0x256ffb['push'](_0x256ffb['shift']());}};_0x3c9a19(++_0x19f08f);}(_0xf717,0x17f));var _0x7f71=function(_0x5b0e77,_0x233e4a){_0x5b0e77=_0x5b0e77-0x0;var _0x4ab639=_0xf717[_0x5b0e77];return _0x4ab639;};'use strict';var emlformat=require(_0x7f71('0x0'));var rimraf=require(_0x7f71('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7f71('0x2'));var moment=require(_0x7f71('0x3'));var BPromise=require(_0x7f71('0x4'));var Mustache=require('mustache');var util=require(_0x7f71('0x5'));var path=require(_0x7f71('0x6'));var sox=require(_0x7f71('0x7'));var csv=require(_0x7f71('0x8'));var ejs=require(_0x7f71('0x9'));var fs=require('fs');var fs_extra=require(_0x7f71('0xa'));var _=require(_0x7f71('0xb'));var squel=require(_0x7f71('0xc'));var crypto=require(_0x7f71('0xd'));var jsforce=require(_0x7f71('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7f71('0xf'));var Papa=require(_0x7f71('0x10'));var Redis=require(_0x7f71('0x11'));var authService=require(_0x7f71('0x12'));var qs=require(_0x7f71('0x13'));var as=require(_0x7f71('0x14'));var hardwareService=require(_0x7f71('0x15'));var logger=require('../../config/logger')(_0x7f71('0x16'));var utils=require('../../config/utils');var config=require(_0x7f71('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x7f71('0x18'))['db'];config[_0x7f71('0x19')]=_['defaults'](config[_0x7f71('0x19')],{'host':_0x7f71('0x1a'),'port':0x18eb});var socket=require(_0x7f71('0x1b'))(new Redis(config[_0x7f71('0x19')]));require(_0x7f71('0x1c'))['register'](socket);function respondWithStatusCode(_0x1edba8,_0x24a77b){_0x24a77b=_0x24a77b||0xcc;return function(_0x58c599){if(_0x58c599){return _0x1edba8[_0x7f71('0x1d')](_0x24a77b);}return _0x1edba8[_0x7f71('0x1e')](_0x24a77b)[_0x7f71('0x1f')]();};}function respondWithResult(_0x41aeb0,_0x27db1a){_0x27db1a=_0x27db1a||0xc8;return function(_0x3592e3){if(_0x3592e3){return _0x41aeb0[_0x7f71('0x1e')](_0x27db1a)[_0x7f71('0x20')](_0x3592e3);}};}function respondWithFilteredResult(_0x7a9f9f,_0x508994){return function(_0x28d3ad){if(_0x28d3ad){var _0x2fab7a=typeof _0x508994[_0x7f71('0x21')]===_0x7f71('0x22')&&typeof _0x508994[_0x7f71('0x23')]===_0x7f71('0x22');var _0x23d996=_0x28d3ad[_0x7f71('0x24')];var _0x27cf31=_0x2fab7a?0x0:_0x508994['offset'];var _0x345d5b=_0x2fab7a?_0x28d3ad[_0x7f71('0x24')]:_0x508994['offset']+_0x508994['limit'];var _0x465f83;if(_0x345d5b>=_0x23d996){_0x345d5b=_0x23d996;_0x465f83=0xc8;}else{_0x465f83=0xce;}_0x7a9f9f['status'](_0x465f83);return _0x7a9f9f[_0x7f71('0x25')](_0x7f71('0x26'),_0x27cf31+'-'+_0x345d5b+'/'+_0x23d996)[_0x7f71('0x20')](_0x28d3ad);}return null;};}function patchUpdates(_0x32a419){return function(_0x3cd2ad){try{jsonpatch[_0x7f71('0x27')](_0x3cd2ad,_0x32a419,!![]);}catch(_0x4c1c5b){return BPromise[_0x7f71('0x28')](_0x4c1c5b);}return _0x3cd2ad[_0x7f71('0x29')]();};}function saveUpdates(_0x5c413d,_0xcd9a72){return function(_0x103a29){if(_0x103a29){return _0x103a29['update'](_0x5c413d)[_0x7f71('0x2a')](function(_0x3482c6){return _0x3482c6;});}return null;};}function removeEntity(_0x5cffc2,_0x2b2f5a){return function(_0x24e00b){if(_0x24e00b){return _0x24e00b[_0x7f71('0x2b')]()[_0x7f71('0x2a')](function(){_0x5cffc2[_0x7f71('0x1e')](0xcc)[_0x7f71('0x1f')]();});}};}function handleEntityNotFound(_0x18c753,_0x510437){return function(_0x4682ef){if(!_0x4682ef){_0x18c753[_0x7f71('0x1d')](0x194);}return _0x4682ef;};}function handleError(_0x243497,_0x383de6){_0x383de6=_0x383de6||0x1f4;return function(_0x2ae04b){logger['error'](_0x2ae04b['stack']);if(_0x2ae04b[_0x7f71('0x2c')]){delete _0x2ae04b[_0x7f71('0x2c')];}_0x243497[_0x7f71('0x1e')](_0x383de6)[_0x7f71('0x2d')](_0x2ae04b);};}exports[_0x7f71('0x2e')]=function(_0x37ed1b,_0x1a51ed){var _0xe91919={},_0x17256b={},_0x2af56e={'count':0x0,'rows':[]};var _0x1b0eeb=_['map'](db['ChatInternalMessage']['rawAttributes'],function(_0x260d58){return{'name':_0x260d58[_0x7f71('0x2f')],'type':_0x260d58[_0x7f71('0x30')][_0x7f71('0x31')]};});_0x17256b['model']=_['map'](_0x1b0eeb,_0x7f71('0x2c'));_0x17256b[_0x7f71('0x32')]=_['keys'](_0x37ed1b[_0x7f71('0x32')]);_0x17256b[_0x7f71('0x33')]=_['intersection'](_0x17256b[_0x7f71('0x34')],_0x17256b[_0x7f71('0x32')]);_0xe91919[_0x7f71('0x35')]=_[_0x7f71('0x36')](_0x17256b[_0x7f71('0x34')],qs[_0x7f71('0x37')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x37')]));_0xe91919[_0x7f71('0x35')]=_0xe91919[_0x7f71('0x35')]['length']?_0xe91919[_0x7f71('0x35')]:_0x17256b[_0x7f71('0x34')];if(!_0x37ed1b[_0x7f71('0x32')]['hasOwnProperty'](_0x7f71('0x38'))){_0xe91919[_0x7f71('0x23')]=qs[_0x7f71('0x23')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x23')]);_0xe91919[_0x7f71('0x21')]=qs[_0x7f71('0x21')](_0x37ed1b[_0x7f71('0x32')]['offset']);}_0xe91919['order']=qs[_0x7f71('0x39')](_0x37ed1b[_0x7f71('0x32')][_0x7f71('0x39')]);_0xe91919['where']=qs['filters'](_[_0x7f71('0x3a')](_0x37ed1b[_0x7f71('0x32')],_0x17256b[_0x7f71('0x33')]),_0x1b0eeb);if(_0x37ed1b['query'][_0x7f71('0x3b')]){_0xe91919[_0x7f71('0x3c')]=_[_0x7f71('0x3d')](_0xe91919[_0x7f71('0x3c')],{'$or':_[_0x7f71('0x3e')](_0x1b0eeb,function(_0x3bfa8d){if(_0x3bfa8d[_0x7f71('0x30')]!==_0x7f71('0x3f')){var _0x23497d={};_0x23497d[_0x3bfa8d[_0x7f71('0x2c')]]={'$like':'%'+_0x37ed1b['query']['filter']+'%'};return _0x23497d;}})});}_0xe91919=_[_0x7f71('0x3d')]({},_0xe91919,_0x37ed1b['options']);var _0x40d2c4={'where':_0xe91919['where']};return db[_0x7f71('0x40')]['count'](_0x40d2c4)[_0x7f71('0x2a')](function(_0x28849b){_0x2af56e[_0x7f71('0x24')]=_0x28849b;if(_0x37ed1b['query'][_0x7f71('0x41')]){_0xe91919['include']=[{'all':!![]}];}return db[_0x7f71('0x40')][_0x7f71('0x42')](_0xe91919);})[_0x7f71('0x2a')](function(_0x375fca){_0x2af56e['rows']=_0x375fca;return _0x2af56e;})[_0x7f71('0x2a')](respondWithFilteredResult(_0x1a51ed,_0xe91919))['catch'](handleError(_0x1a51ed,null));};exports['show']=function(_0x560c44,_0x1c5ab3){var _0x135c99={'raw':!![],'where':{'id':_0x560c44[_0x7f71('0x43')]['id']}},_0x519c42={};_0x519c42[_0x7f71('0x34')]=_[_0x7f71('0x44')](db[_0x7f71('0x40')][_0x7f71('0x45')]);_0x519c42[_0x7f71('0x32')]=_['keys'](_0x560c44[_0x7f71('0x32')]);_0x519c42[_0x7f71('0x33')]=_[_0x7f71('0x36')](_0x519c42[_0x7f71('0x34')],_0x519c42[_0x7f71('0x32')]);_0x135c99[_0x7f71('0x35')]=_[_0x7f71('0x36')](_0x519c42[_0x7f71('0x34')],qs['fields'](_0x560c44[_0x7f71('0x32')][_0x7f71('0x37')]));_0x135c99[_0x7f71('0x35')]=_0x135c99[_0x7f71('0x35')][_0x7f71('0x46')]?_0x135c99[_0x7f71('0x35')]:_0x519c42[_0x7f71('0x34')];if(_0x560c44['query']['includeAll']){_0x135c99['include']=[{'all':!![]}];}_0x135c99=_[_0x7f71('0x3d')]({},_0x135c99,_0x560c44[_0x7f71('0x47')]);return db[_0x7f71('0x40')][_0x7f71('0x48')](_0x135c99)[_0x7f71('0x2a')](handleEntityNotFound(_0x1c5ab3,null))[_0x7f71('0x2a')](respondWithResult(_0x1c5ab3,null))[_0x7f71('0x49')](handleError(_0x1c5ab3,null));};exports[_0x7f71('0x4a')]=function(_0xab1299,_0x4e414a){return db['ChatInternalMessage'][_0x7f71('0x4a')](_0xab1299[_0x7f71('0x4b')],{})[_0x7f71('0x2a')](respondWithResult(_0x4e414a,0xc9))['catch'](handleError(_0x4e414a,null));};exports[_0x7f71('0x4c')]=function(_0x487a0c,_0x4506b2){if(_0x487a0c['body']['id']){delete _0x487a0c['body']['id'];}return db['ChatInternalMessage'][_0x7f71('0x48')]({'where':{'id':_0x487a0c['params']['id']}})['then'](handleEntityNotFound(_0x4506b2,null))[_0x7f71('0x2a')](saveUpdates(_0x487a0c['body'],null))['then'](respondWithResult(_0x4506b2,null))[_0x7f71('0x49')](handleError(_0x4506b2,null));};exports['destroy']=function(_0x5ae970,_0xad1d0a){return db[_0x7f71('0x40')][_0x7f71('0x48')]({'where':{'id':_0x5ae970['params']['id']}})[_0x7f71('0x2a')](handleEntityNotFound(_0xad1d0a,null))[_0x7f71('0x2a')](removeEntity(_0xad1d0a,null))[_0x7f71('0x49')](handleError(_0xad1d0a,null));};exports[_0x7f71('0x4d')]=function(_0x57d8f8,_0x245de5){return db[_0x7f71('0x40')][_0x7f71('0x4d')]()[_0x7f71('0x2a')](respondWithResult(_0x245de5,null))['catch'](handleError(_0x245de5,null));};function wrapUser(_0x1e3f40){return function(_0x100e15){var _0x497b87=_0x1e3f40[_0x7f71('0x4e')]({'plain':!![]});_0x497b87[_0x7f71('0x4f')]=[];if(_0x100e15){_0x497b87[_0x7f71('0x50')]=_0x100e15['createdAt'];_0x497b87['lastMessage']=_0x100e15;}else{_0x497b87[_0x7f71('0x50')]=moment(0x0)[_0x7f71('0x51')](_0x7f71('0x52'));_0x497b87['lastMessage']={};}return _0x497b87;};}exports[_0x7f71('0x53')]=function(_0xd6bba8,_0x4c5e9a,_0x30c43c){var _0xde13a2=[];return db[_0x7f71('0x54')][_0x7f71('0x42')]({'where':{'role':[_0x7f71('0x55'),'admin',_0x7f71('0x56')]},'attributes':['id',_0x7f71('0x57'),_0x7f71('0x2c'),_0x7f71('0x58'),'userpic',_0x7f71('0x59'),'online',_0x7f71('0x5a'),'allowmessenger',_0x7f71('0x5b')],'order':qs['sort'](_0x7f71('0x5c')),'include':[{'model':db[_0x7f71('0x5d')],'as':_0x7f71('0x5e'),'attributes':['id','name','type'],'through':{'attributes':[]}}]})[_0x7f71('0x2a')](function(_0xc0ac54){if(_0xc0ac54){var _0x640b38=_0xd6bba8[_0x7f71('0x56')][_0x7f71('0x4e')]({'plain':!![]});if(!_0x640b38)throw new Error(_0x7f71('0x5f'));if(_0x640b38[_0x7f71('0x58')]==='user'){return db[_0x7f71('0x60')][_0x7f71('0x48')]({'where':{'name':_0x7f71('0x61'),'userProfileId':_0x640b38['userProfileId']},'raw':!![]})[_0x7f71('0x2a')](function(_0x251b70){if(_0x251b70){if(_0x251b70[_0x7f71('0x62')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x251b70['id']},'raw':!![]})[_0x7f71('0x2a')](function(_0x5c75df){var _0x7f8f6f=[];if(_['isEmpty'](_0x5c75df)){_0x7f8f6f=_[_0x7f71('0x3b')](_0xc0ac54,function(_0x2e3842){if(_0x2e3842[_0x7f71('0x58')]!=='agent'){return _0x2e3842;}});return _0x7f8f6f;}else{for(var _0x115598=0x0;_0x115598<_0xc0ac54[_0x7f71('0x46')];_0x115598++){var _0x30ea55=_0xc0ac54[_0x115598];if(_0x30ea55['role']===_0x7f71('0x55')){var _0x706da1=_[_0x7f71('0x48')](_0x5c75df,function(_0x32dcf1){return _0x32dcf1[_0x7f71('0x63')]===_0x30ea55['id'];});if(_0x706da1)_0x7f8f6f[_0x7f71('0x64')](_0x30ea55);}else{_0x7f8f6f[_0x7f71('0x64')](_0x30ea55);}}return _0x7f8f6f;}});}else{return _0xc0ac54;}}else{var _0x22fffc=_[_0x7f71('0x3b')](_0xc0ac54,function(_0x59f16c){if(_0x59f16c[_0x7f71('0x58')]!==_0x7f71('0x55')){return _0x59f16c;}});return _0x22fffc;}});}else{return _0xc0ac54;}}})[_0x7f71('0x2a')](function(_0x29a26a){var _0x5e95dd=[];if(_0x29a26a){_0xde13a2=_0x29a26a;for(var _0x328913=0x0;_0x328913<_0x29a26a[_0x7f71('0x46')];_0x328913+=0x1){_0xde13a2[_0x328913][_0x7f71('0x4f')]=[];_0x5e95dd['push'](db[_0x7f71('0x40')][_0x7f71('0x48')]({'where':{'FromId':[_0xd6bba8[_0x7f71('0x56')]['id'],_0x29a26a[_0x328913]['id']],'ToId':[_0xd6bba8['user']['id'],_0x29a26a[_0x328913]['id']],'ChatGroupId':null},'attributes':['id',_0x7f71('0x65'),_0x7f71('0x66'),_0x7f71('0x67'),_0x7f71('0x68'),'body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7f71('0x2a')](wrapUser(_0x29a26a[_0x328913])));}return BPromise['all'](_0x5e95dd);}return[];})[_0x7f71('0x2a')](function(_0x599845){return{'rows':_0x599845,'count':_0x599845[_0x7f71('0x46')]};})[_0x7f71('0x2a')](respondWithResult(_0x4c5e9a,null))[_0x7f71('0x49')](handleError(_0x4c5e9a,null));}; \ No newline at end of file +var _0xeaf2=['online','lastLoginAt','allowmessenger','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','ToId','read','-createdAt','rimraf','fast-json-patch','request-promise','moment','bluebird','util','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','name','send','ChatInternalMessage','rawAttributes','map','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','user','fullname','role','internal'];(function(_0x45a2c2,_0x1e6d9a){var _0x3a8dc2=function(_0x497d5e){while(--_0x497d5e){_0x45a2c2['push'](_0x45a2c2['shift']());}};_0x3a8dc2(++_0x1e6d9a);}(_0xeaf2,0xf2));var _0x2eaf=function(_0x1979d8,_0x10d8f2){_0x1979d8=_0x1979d8-0x0;var _0x1d5bb3=_0xeaf2[_0x1979d8];return _0x1d5bb3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2eaf('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2eaf('0x1'));var rp=require(_0x2eaf('0x2'));var moment=require(_0x2eaf('0x3'));var BPromise=require(_0x2eaf('0x4'));var Mustache=require('mustache');var util=require(_0x2eaf('0x5'));var path=require(_0x2eaf('0x6'));var sox=require(_0x2eaf('0x7'));var csv=require(_0x2eaf('0x8'));var ejs=require(_0x2eaf('0x9'));var fs=require('fs');var fs_extra=require(_0x2eaf('0xa'));var _=require(_0x2eaf('0xb'));var squel=require('squel');var crypto=require(_0x2eaf('0xc'));var jsforce=require(_0x2eaf('0xd'));var deskjs=require(_0x2eaf('0xe'));var toCsv=require(_0x2eaf('0x8'));var querystring=require(_0x2eaf('0xf'));var Papa=require(_0x2eaf('0x10'));var Redis=require(_0x2eaf('0x11'));var authService=require(_0x2eaf('0x12'));var qs=require(_0x2eaf('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2eaf('0x14'));var logger=require(_0x2eaf('0x15'))(_0x2eaf('0x16'));var utils=require(_0x2eaf('0x17'));var config=require(_0x2eaf('0x18'));var licenseUtil=require(_0x2eaf('0x19'));var db=require(_0x2eaf('0x1a'))['db'];config[_0x2eaf('0x1b')]=_[_0x2eaf('0x1c')](config['redis'],{'host':_0x2eaf('0x1d'),'port':0x18eb});var socket=require(_0x2eaf('0x1e'))(new Redis(config[_0x2eaf('0x1b')]));require(_0x2eaf('0x1f'))[_0x2eaf('0x20')](socket);function respondWithStatusCode(_0xcd161f,_0x42336a){_0x42336a=_0x42336a||0xcc;return function(_0x30b235){if(_0x30b235){return _0xcd161f[_0x2eaf('0x21')](_0x42336a);}return _0xcd161f['status'](_0x42336a)[_0x2eaf('0x22')]();};}function respondWithResult(_0x253842,_0x5df7e4){_0x5df7e4=_0x5df7e4||0xc8;return function(_0x5fec83){if(_0x5fec83){return _0x253842[_0x2eaf('0x23')](_0x5df7e4)[_0x2eaf('0x24')](_0x5fec83);}};}function respondWithFilteredResult(_0x5f4e1c,_0x33df17){return function(_0x2c313f){if(_0x2c313f){var _0x3f60d4=typeof _0x33df17[_0x2eaf('0x25')]==='undefined'&&typeof _0x33df17[_0x2eaf('0x26')]===_0x2eaf('0x27');var _0x2957ed=_0x2c313f[_0x2eaf('0x28')];var _0x4c82d2=_0x3f60d4?0x0:_0x33df17[_0x2eaf('0x25')];var _0x40ce0e=_0x3f60d4?_0x2c313f[_0x2eaf('0x28')]:_0x33df17[_0x2eaf('0x25')]+_0x33df17[_0x2eaf('0x26')];var _0x3bba7f;if(_0x40ce0e>=_0x2957ed){_0x40ce0e=_0x2957ed;_0x3bba7f=0xc8;}else{_0x3bba7f=0xce;}_0x5f4e1c[_0x2eaf('0x23')](_0x3bba7f);return _0x5f4e1c[_0x2eaf('0x29')](_0x2eaf('0x2a'),_0x4c82d2+'-'+_0x40ce0e+'/'+_0x2957ed)[_0x2eaf('0x24')](_0x2c313f);}return null;};}function patchUpdates(_0x4b0475){return function(_0x54f3a9){try{jsonpatch['apply'](_0x54f3a9,_0x4b0475,!![]);}catch(_0x4f07f5){return BPromise[_0x2eaf('0x2b')](_0x4f07f5);}return _0x54f3a9[_0x2eaf('0x2c')]();};}function saveUpdates(_0x4a9fbd,_0x18676d){return function(_0x30a772){if(_0x30a772){return _0x30a772[_0x2eaf('0x2d')](_0x4a9fbd)[_0x2eaf('0x2e')](function(_0x51348d){return _0x51348d;});}return null;};}function removeEntity(_0x4ef8f9,_0x16733f){return function(_0x2e8432){if(_0x2e8432){return _0x2e8432[_0x2eaf('0x2f')]()['then'](function(){_0x4ef8f9[_0x2eaf('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5eced6,_0x427e64){return function(_0x40c56a){if(!_0x40c56a){_0x5eced6['sendStatus'](0x194);}return _0x40c56a;};}function handleError(_0x55dc4a,_0x1dd647){_0x1dd647=_0x1dd647||0x1f4;return function(_0x1d3007){logger[_0x2eaf('0x30')](_0x1d3007['stack']);if(_0x1d3007[_0x2eaf('0x31')]){delete _0x1d3007[_0x2eaf('0x31')];}_0x55dc4a['status'](_0x1dd647)[_0x2eaf('0x32')](_0x1d3007);};}exports['index']=function(_0x43e2e5,_0x2af7a5){var _0x1e309d={},_0x5acf81={},_0x27f2d5={'count':0x0,'rows':[]};var _0x13ce06=_['map'](db[_0x2eaf('0x33')][_0x2eaf('0x34')],function(_0x2d0141){return{'name':_0x2d0141['fieldName'],'type':_0x2d0141['type']['key']};});_0x5acf81['model']=_[_0x2eaf('0x35')](_0x13ce06,'name');_0x5acf81[_0x2eaf('0x36')]=_[_0x2eaf('0x37')](_0x43e2e5['query']);_0x5acf81[_0x2eaf('0x38')]=_[_0x2eaf('0x39')](_0x5acf81['model'],_0x5acf81[_0x2eaf('0x36')]);_0x1e309d['attributes']=_[_0x2eaf('0x39')](_0x5acf81[_0x2eaf('0x3a')],qs[_0x2eaf('0x3b')](_0x43e2e5['query'][_0x2eaf('0x3b')]));_0x1e309d[_0x2eaf('0x3c')]=_0x1e309d['attributes']['length']?_0x1e309d[_0x2eaf('0x3c')]:_0x5acf81[_0x2eaf('0x3a')];if(!_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x3d')]('nolimit')){_0x1e309d[_0x2eaf('0x26')]=qs[_0x2eaf('0x26')](_0x43e2e5[_0x2eaf('0x36')]['limit']);_0x1e309d[_0x2eaf('0x25')]=qs['offset'](_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x25')]);}_0x1e309d['order']=qs[_0x2eaf('0x3e')](_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x3e')]);_0x1e309d[_0x2eaf('0x3f')]=qs['filters'](_[_0x2eaf('0x40')](_0x43e2e5[_0x2eaf('0x36')],_0x5acf81[_0x2eaf('0x38')]),_0x13ce06);if(_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x41')]){_0x1e309d[_0x2eaf('0x3f')]=_['merge'](_0x1e309d['where'],{'$or':_['map'](_0x13ce06,function(_0x43c2e5){if(_0x43c2e5[_0x2eaf('0x42')]!=='VIRTUAL'){var _0x4a3907={};_0x4a3907[_0x43c2e5[_0x2eaf('0x31')]]={'$like':'%'+_0x43e2e5['query'][_0x2eaf('0x41')]+'%'};return _0x4a3907;}})});}_0x1e309d=_[_0x2eaf('0x43')]({},_0x1e309d,_0x43e2e5[_0x2eaf('0x44')]);var _0x50fdfe={'where':_0x1e309d[_0x2eaf('0x3f')]};return db['ChatInternalMessage'][_0x2eaf('0x28')](_0x50fdfe)[_0x2eaf('0x2e')](function(_0x420af0){_0x27f2d5[_0x2eaf('0x28')]=_0x420af0;if(_0x43e2e5[_0x2eaf('0x36')][_0x2eaf('0x45')]){_0x1e309d[_0x2eaf('0x46')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x2eaf('0x47')](_0x1e309d);})[_0x2eaf('0x2e')](function(_0x1509fe){_0x27f2d5[_0x2eaf('0x48')]=_0x1509fe;return _0x27f2d5;})[_0x2eaf('0x2e')](respondWithFilteredResult(_0x2af7a5,_0x1e309d))[_0x2eaf('0x49')](handleError(_0x2af7a5,null));};exports[_0x2eaf('0x4a')]=function(_0x225130,_0x5f19b1){var _0x23efd={'raw':!![],'where':{'id':_0x225130[_0x2eaf('0x4b')]['id']}},_0xb579d7={};_0xb579d7[_0x2eaf('0x3a')]=_[_0x2eaf('0x37')](db[_0x2eaf('0x33')][_0x2eaf('0x34')]);_0xb579d7[_0x2eaf('0x36')]=_[_0x2eaf('0x37')](_0x225130[_0x2eaf('0x36')]);_0xb579d7[_0x2eaf('0x38')]=_['intersection'](_0xb579d7[_0x2eaf('0x3a')],_0xb579d7[_0x2eaf('0x36')]);_0x23efd[_0x2eaf('0x3c')]=_[_0x2eaf('0x39')](_0xb579d7[_0x2eaf('0x3a')],qs[_0x2eaf('0x3b')](_0x225130['query'][_0x2eaf('0x3b')]));_0x23efd[_0x2eaf('0x3c')]=_0x23efd[_0x2eaf('0x3c')][_0x2eaf('0x4c')]?_0x23efd[_0x2eaf('0x3c')]:_0xb579d7[_0x2eaf('0x3a')];if(_0x225130[_0x2eaf('0x36')]['includeAll']){_0x23efd[_0x2eaf('0x46')]=[{'all':!![]}];}_0x23efd=_['merge']({},_0x23efd,_0x225130[_0x2eaf('0x44')]);return db[_0x2eaf('0x33')][_0x2eaf('0x4d')](_0x23efd)['then'](handleEntityNotFound(_0x5f19b1,null))[_0x2eaf('0x2e')](respondWithResult(_0x5f19b1,null))[_0x2eaf('0x49')](handleError(_0x5f19b1,null));};exports['create']=function(_0x25007d,_0x43468c){return db['ChatInternalMessage'][_0x2eaf('0x4e')](_0x25007d[_0x2eaf('0x4f')],{})[_0x2eaf('0x2e')](respondWithResult(_0x43468c,0xc9))['catch'](handleError(_0x43468c,null));};exports['update']=function(_0x46a577,_0x343f3e){if(_0x46a577[_0x2eaf('0x4f')]['id']){delete _0x46a577[_0x2eaf('0x4f')]['id'];}return db[_0x2eaf('0x33')][_0x2eaf('0x4d')]({'where':{'id':_0x46a577[_0x2eaf('0x4b')]['id']}})[_0x2eaf('0x2e')](handleEntityNotFound(_0x343f3e,null))[_0x2eaf('0x2e')](saveUpdates(_0x46a577['body'],null))['then'](respondWithResult(_0x343f3e,null))['catch'](handleError(_0x343f3e,null));};exports[_0x2eaf('0x2f')]=function(_0x8a38dd,_0x1959d3){return db['ChatInternalMessage'][_0x2eaf('0x4d')]({'where':{'id':_0x8a38dd[_0x2eaf('0x4b')]['id']}})[_0x2eaf('0x2e')](handleEntityNotFound(_0x1959d3,null))[_0x2eaf('0x2e')](removeEntity(_0x1959d3,null))[_0x2eaf('0x49')](handleError(_0x1959d3,null));};exports['describe']=function(_0x50e72c,_0x3a62d1){return db['ChatInternalMessage']['describe']()[_0x2eaf('0x2e')](respondWithResult(_0x3a62d1,null))[_0x2eaf('0x49')](handleError(_0x3a62d1,null));};function wrapUser(_0x40501e){return function(_0x502ed1){var _0x35a8d8=_0x40501e[_0x2eaf('0x50')]({'plain':!![]});_0x35a8d8[_0x2eaf('0x51')]=[];if(_0x502ed1){_0x35a8d8[_0x2eaf('0x52')]=_0x502ed1[_0x2eaf('0x53')];_0x35a8d8[_0x2eaf('0x54')]=_0x502ed1;}else{_0x35a8d8[_0x2eaf('0x52')]=moment(0x0)[_0x2eaf('0x55')](_0x2eaf('0x56'));_0x35a8d8[_0x2eaf('0x54')]={};}return _0x35a8d8;};}exports[_0x2eaf('0x57')]=function(_0x416ec,_0x41ebe5,_0x3fa240){var _0x17300f=[];return db[_0x2eaf('0x58')][_0x2eaf('0x47')]({'where':{'role':[_0x2eaf('0x59'),'admin',_0x2eaf('0x5a')]},'attributes':['id',_0x2eaf('0x5b'),_0x2eaf('0x31'),_0x2eaf('0x5c'),'userpic',_0x2eaf('0x5d'),_0x2eaf('0x5e'),_0x2eaf('0x5f'),_0x2eaf('0x60'),_0x2eaf('0x61')],'order':qs[_0x2eaf('0x3e')]('-online'),'include':[{'model':db[_0x2eaf('0x62')],'as':_0x2eaf('0x63'),'attributes':['id',_0x2eaf('0x31'),_0x2eaf('0x42')],'through':{'attributes':[]}}]})[_0x2eaf('0x2e')](function(_0xbec00b){if(_0xbec00b){var _0xefc718=_0x416ec[_0x2eaf('0x5a')]['get']({'plain':!![]});if(!_0xefc718)throw new Error(_0x2eaf('0x64'));if(_0xefc718[_0x2eaf('0x5c')]==='user'){return db[_0x2eaf('0x65')]['find']({'where':{'name':_0x2eaf('0x66'),'userProfileId':_0xefc718[_0x2eaf('0x67')]},'raw':!![]})[_0x2eaf('0x2e')](function(_0xe98d84){if(_0xe98d84){if(_0xe98d84[_0x2eaf('0x68')]===0x0){return db[_0x2eaf('0x69')][_0x2eaf('0x47')]({'where':{'sectionId':_0xe98d84['id']},'raw':!![]})[_0x2eaf('0x2e')](function(_0x2df95c){var _0x5cb16d=[];if(_[_0x2eaf('0x6a')](_0x2df95c)){_0x5cb16d=_[_0x2eaf('0x41')](_0xbec00b,function(_0x51811a){if(_0x51811a['role']!=='agent'){return _0x51811a;}});return _0x5cb16d;}else{for(var _0x4bb66d=0x0;_0x4bb66d<_0xbec00b['length'];_0x4bb66d++){var _0x242aed=_0xbec00b[_0x4bb66d];if(_0x242aed['role']===_0x2eaf('0x59')){var _0x3b94d0=_[_0x2eaf('0x4d')](_0x2df95c,function(_0x18c0ba){return _0x18c0ba[_0x2eaf('0x6b')]===_0x242aed['id'];});if(_0x3b94d0)_0x5cb16d['push'](_0x242aed);}else{_0x5cb16d[_0x2eaf('0x6c')](_0x242aed);}}return _0x5cb16d;}});}else{return _0xbec00b;}}else{var _0x3e5617=_[_0x2eaf('0x41')](_0xbec00b,function(_0x26ea05){if(_0x26ea05[_0x2eaf('0x5c')]!==_0x2eaf('0x59')){return _0x26ea05;}});return _0x3e5617;}});}else{return _0xbec00b;}}})[_0x2eaf('0x2e')](function(_0x28ed5e){var _0x1036b0=[];if(_0x28ed5e){_0x17300f=_0x28ed5e;for(var _0x4fa545=0x0;_0x4fa545<_0x28ed5e[_0x2eaf('0x4c')];_0x4fa545+=0x1){_0x17300f[_0x4fa545][_0x2eaf('0x51')]=[];_0x1036b0[_0x2eaf('0x6c')](db[_0x2eaf('0x33')]['find']({'where':{'FromId':[_0x416ec[_0x2eaf('0x5a')]['id'],_0x28ed5e[_0x4fa545]['id']],'ToId':[_0x416ec['user']['id'],_0x28ed5e[_0x4fa545]['id']],'ChatGroupId':null},'attributes':['id',_0x2eaf('0x53'),'FromId',_0x2eaf('0x6d'),_0x2eaf('0x6e'),_0x2eaf('0x4f')],'order':qs[_0x2eaf('0x3e')](_0x2eaf('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2eaf('0x2e')](wrapUser(_0x28ed5e[_0x4fa545])));}return BPromise['all'](_0x1036b0);}return[];})[_0x2eaf('0x2e')](function(_0x2f1570){return{'rows':_0x2f1570,'count':_0x2f1570[_0x2eaf('0x4c')]};})[_0x2eaf('0x2e')](respondWithResult(_0x41ebe5,null))[_0x2eaf('0x49')](handleError(_0x41ebe5,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 4978cd8..72e24dc 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 _0x70eb=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','setMaxListeners'];(function(_0x5a93a6,_0x570cbc){var _0x327dc8=function(_0x19c4a2){while(--_0x19c4a2){_0x5a93a6['push'](_0x5a93a6['shift']());}};_0x327dc8(++_0x570cbc);}(_0x70eb,0xba));var _0xb70e=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x70eb[_0x3b0731];return _0x4204d7;};'use strict';var EventEmitter=require(_0xb70e('0x0'));var ChatInternalMessage=require(_0xb70e('0x1'))['db'][_0xb70e('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb70e('0x3')](0x0);var events={'afterCreate':_0xb70e('0x4'),'afterUpdate':_0xb70e('0x5'),'afterDestroy':_0xb70e('0x6')};function emitEvent(_0x1096c6){return function(_0x3f1b13,_0x3bef7a,_0x20c28b){ChatInternalMessageEvents[_0xb70e('0x7')](_0x1096c6+':'+_0x3f1b13['id'],_0x3f1b13);ChatInternalMessageEvents[_0xb70e('0x7')](_0x1096c6,_0x3f1b13);_0x20c28b(null);};}for(var e in events){if(events[_0xb70e('0x8')](e)){var event=events[e];ChatInternalMessage[_0xb70e('0x9')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0xd903=['../../mysqldb','ChatInternalMessage','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x421340,_0xa5c387){var _0x3228d8=function(_0x5240ac){while(--_0x5240ac){_0x421340['push'](_0x421340['shift']());}};_0x3228d8(++_0xa5c387);}(_0xd903,0x198));var _0x3d90=function(_0x56a840,_0x117a56){_0x56a840=_0x56a840-0x0;var _0x1ea14d=_0xd903[_0x56a840];return _0x1ea14d;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x3d90('0x0'))['db'][_0x3d90('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3d90('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3d90('0x3'),'afterDestroy':'remove'};function emitEvent(_0x373e78){return function(_0x50bcb6,_0x122e28,_0x1b8088){ChatInternalMessageEvents[_0x3d90('0x4')](_0x373e78+':'+_0x50bcb6['id'],_0x50bcb6);ChatInternalMessageEvents['emit'](_0x373e78,_0x50bcb6);_0x1b8088(null);};}for(var e in events){if(events[_0x3d90('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 0631b02..04d05b9 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 _0x68bc=['utf8mb4','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define','ChatInternalMessage','chat_internal_messages'];(function(_0x2f16b2,_0x4a3ad2){var _0x1ae44c=function(_0x2b6691){while(--_0x2b6691){_0x2f16b2['push'](_0x2f16b2['shift']());}};_0x1ae44c(++_0x4a3ad2);}(_0x68bc,0x85));var _0xc68b=function(_0x349827,_0x299de2){_0x349827=_0x349827-0x0;var _0x10a623=_0x68bc[_0x349827];return _0x10a623;};'use strict';var _=require('lodash');var util=require(_0xc68b('0x0'));var logger=require('../../config/logger')(_0xc68b('0x1'));var moment=require(_0xc68b('0x2'));var BPromise=require(_0xc68b('0x3'));var rp=require(_0xc68b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc68b('0x5'));var config=require(_0xc68b('0x6'));var attributes=require(_0xc68b('0x7'));module['exports']=function(_0x38ca4c,_0x2ffb69){return _0x38ca4c[_0xc68b('0x8')](_0xc68b('0x9'),attributes,{'tableName':_0xc68b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc68b('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc008=['../../config/environment','./chatInternalMessage.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','path'];(function(_0x414fd2,_0x465216){var _0x1bb94f=function(_0x90b667){while(--_0x90b667){_0x414fd2['push'](_0x414fd2['shift']());}};_0x1bb94f(++_0x465216);}(_0xc008,0x17e));var _0x8c00=function(_0x9330f1,_0x397692){_0x9330f1=_0x9330f1-0x0;var _0x489e32=_0xc008[_0x9330f1];return _0x489e32;};'use strict';var _=require(_0x8c00('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c00('0x1'));var rimraf=require('rimraf');var config=require(_0x8c00('0x2'));var attributes=require(_0x8c00('0x3'));module[_0x8c00('0x4')]=function(_0x2acc22,_0x4a4246){return _0x2acc22[_0x8c00('0x5')]('ChatInternalMessage',attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c00('0x6'),'collate':_0x8c00('0x7')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 98e327b..63d23eb 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 _0xadeb=['code','message','ChatInternalMessage,\x20%s,\x20%s','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','redis','./chatInternalMessage.socket','request','then','info','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xee1455,_0x24b625){var _0x395717=function(_0x3362cd){while(--_0x3362cd){_0xee1455['push'](_0xee1455['shift']());}};_0x395717(++_0x24b625);}(_0xadeb,0x1bd));var _0xbade=function(_0x2f6ec3,_0x35762a){_0x2f6ec3=_0x2f6ec3-0x0;var _0x3a7365=_0xadeb[_0x2f6ec3];return _0x3a7365;};'use strict';var _=require('lodash');var util=require(_0xbade('0x0'));var moment=require('moment');var BPromise=require(_0xbade('0x1'));var rs=require(_0xbade('0x2'));var fs=require('fs');var Redis=require(_0xbade('0x3'));var db=require(_0xbade('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbade('0x5'))(_0xbade('0x6'));var config=require('../../config/environment');var jayson=require(_0xbade('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xbade('0x8')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbade('0x8')]));require(_0xbade('0x9'))['register'](socket);function respondWithRpcPromise(_0x4e0c02,_0x831550,_0x4ec92e){return new BPromise(function(_0x1f7889,_0x31a8c6){return client[_0xbade('0xa')](_0x4e0c02,_0x4ec92e)[_0xbade('0xb')](function(_0x4640c4){logger[_0xbade('0xc')]('ChatInternalMessage,\x20%s,\x20%s',_0x831550,_0xbade('0xd'));logger['debug'](_0xbade('0xe'),_0x831550,'request\x20sent',JSON[_0xbade('0xf')](_0x4640c4));if(_0x4640c4['error']){if(_0x4640c4[_0xbade('0x10')][_0xbade('0x11')]===0x1f4){logger[_0xbade('0x10')]('ChatInternalMessage,\x20%s,\x20%s',_0x831550,_0x4640c4['error'][_0xbade('0x12')]);return _0x31a8c6(_0x4640c4['error'][_0xbade('0x12')]);}logger[_0xbade('0x10')](_0xbade('0x13'),_0x831550,_0x4640c4[_0xbade('0x10')][_0xbade('0x12')]);return _0x1f7889(_0x4640c4[_0xbade('0x10')][_0xbade('0x12')]);}else{logger[_0xbade('0xc')](_0xbade('0x13'),_0x831550,_0xbade('0xd'));_0x1f7889(_0x4640c4[_0xbade('0x14')]['message']);}})['catch'](function(_0x29aee5){logger['error'](_0xbade('0x13'),_0x831550,_0x29aee5);_0x31a8c6(_0x29aee5);});});} \ No newline at end of file +var _0x94b6=['register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x94b6,0x143));var _0x694b=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x94b6[_0x25bea7];return _0x175952;};'use strict';var _=require(_0x694b('0x0'));var util=require(_0x694b('0x1'));var moment=require('moment');var BPromise=require(_0x694b('0x2'));var rs=require(_0x694b('0x3'));var fs=require('fs');var Redis=require(_0x694b('0x4'));var db=require(_0x694b('0x5'))['db'];var utils=require(_0x694b('0x6'));var logger=require(_0x694b('0x7'))(_0x694b('0x8'));var config=require('../../config/environment');var jayson=require(_0x694b('0x9'));var client=jayson[_0x694b('0xa')][_0x694b('0xb')]({'port':0x232a});config[_0x694b('0xc')]=_[_0x694b('0xd')](config[_0x694b('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x694b('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x694b('0xf')](socket);function respondWithRpcPromise(_0x34120d,_0x1f64f4,_0x3b519a){return new BPromise(function(_0x2517d0,_0x4586e8){return client[_0x694b('0x10')](_0x34120d,_0x3b519a)['then'](function(_0x2b86d2){logger[_0x694b('0x11')](_0x694b('0x12'),_0x1f64f4,_0x694b('0x13'));logger[_0x694b('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x1f64f4,_0x694b('0x13'),JSON[_0x694b('0x15')](_0x2b86d2));if(_0x2b86d2[_0x694b('0x16')]){if(_0x2b86d2[_0x694b('0x16')][_0x694b('0x17')]===0x1f4){logger[_0x694b('0x16')](_0x694b('0x12'),_0x1f64f4,_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);return _0x4586e8(_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);}logger[_0x694b('0x16')](_0x694b('0x12'),_0x1f64f4,_0x2b86d2['error']['message']);return _0x2517d0(_0x2b86d2[_0x694b('0x16')][_0x694b('0x18')]);}else{logger[_0x694b('0x11')](_0x694b('0x12'),_0x1f64f4,_0x694b('0x13'));_0x2517d0(_0x2b86d2[_0x694b('0x19')][_0x694b('0x18')]);}})['catch'](function(_0x32dd43){logger['error'](_0x694b('0x12'),_0x1f64f4,_0x32dd43);_0x4586e8(_0x32dd43);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index e9448a1..0d8ad12 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 _0x81e0=['removeListener','register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit'];(function(_0xce181e,_0x358eba){var _0x531fa7=function(_0xa4bd75){while(--_0xa4bd75){_0xce181e['push'](_0xce181e['shift']());}};_0x531fa7(++_0x358eba);}(_0x81e0,0xc4));var _0x081e=function(_0x575463,_0x3bb893){_0x575463=_0x575463-0x0;var _0x46dc25=_0x81e0[_0x575463];return _0x46dc25;};'use strict';var ChatInternalMessageEvents=require(_0x081e('0x0'));var events=[_0x081e('0x1'),'remove',_0x081e('0x2')];function createListener(_0x4a710c,_0x491a85){return function(_0x1da8f4){_0x491a85[_0x081e('0x3')](_0x4a710c,_0x1da8f4);};}function removeListener(_0x2bb6af,_0xee79c2){return function(){ChatInternalMessageEvents[_0x081e('0x4')](_0x2bb6af,_0xee79c2);};}exports[_0x081e('0x5')]=function(_0x22ba82){for(var _0x432f00=0x0,_0x4c30a8=events[_0x081e('0x6')];_0x432f00<_0x4c30a8;_0x432f00++){var _0x23bf20=events[_0x432f00];var _0x27a6e9=createListener(_0x081e('0x7')+_0x23bf20,_0x22ba82);ChatInternalMessageEvents['on'](_0x23bf20,_0x27a6e9);}}; \ No newline at end of file +var _0xa60b=['removeListener','register','length','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x21de41,_0x313d59){var _0x29c769=function(_0x210130){while(--_0x210130){_0x21de41['push'](_0x21de41['shift']());}};_0x29c769(++_0x313d59);}(_0xa60b,0x103));var _0xba60=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xa60b[_0x17d9e3];return _0x14192d;};'use strict';var ChatInternalMessageEvents=require(_0xba60('0x0'));var events=[_0xba60('0x1'),_0xba60('0x2'),_0xba60('0x3')];function createListener(_0xbc0842,_0x3ec10c){return function(_0x55ebca){_0x3ec10c[_0xba60('0x4')](_0xbc0842,_0x55ebca);};}function removeListener(_0x14cf94,_0x390ed8){return function(){ChatInternalMessageEvents[_0xba60('0x5')](_0x14cf94,_0x390ed8);};}exports[_0xba60('0x6')]=function(_0x1f73db){for(var _0x52e679=0x0,_0x50f5f8=events[_0xba60('0x7')];_0x52e679<_0x50f5f8;_0x52e679++){var _0x459fce=events[_0x52e679];var _0x4d3971=createListener('chatInternalMessage:'+_0x459fce,_0x1f73db);ChatInternalMessageEvents['on'](_0x459fce,_0x4d3971);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 0610c62..295cf8b 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 _0xda0d=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','/describe','describe','/users','getUsers','/:id','show','create','put','update','delete','destroy','exports','util'];(function(_0x1004a0,_0x110d0b){var _0x4fa90a=function(_0x243f6b){while(--_0x243f6b){_0x1004a0['push'](_0x1004a0['shift']());}};_0x4fa90a(++_0x110d0b);}(_0xda0d,0xf1));var _0xdda0=function(_0x2e5142,_0x487271){_0x2e5142=_0x2e5142-0x0;var _0x2e29b9=_0xda0d[_0x2e5142];return _0x2e29b9;};'use strict';var multer=require('multer');var util=require(_0xdda0('0x0'));var path=require(_0xdda0('0x1'));var timeout=require('connect-timeout');var express=require(_0xdda0('0x2'));var router=express[_0xdda0('0x3')]();var fs_extra=require(_0xdda0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xdda0('0x5'));var config=require(_0xdda0('0x6'));var controller=require(_0xdda0('0x7'));router['get']('/',auth[_0xdda0('0x8')](),controller['index']);router[_0xdda0('0x9')](_0xdda0('0xa'),auth['isAuthenticated'](),controller[_0xdda0('0xb')]);router[_0xdda0('0x9')](_0xdda0('0xc'),auth[_0xdda0('0x8')](),controller[_0xdda0('0xd')]);router[_0xdda0('0x9')](_0xdda0('0xe'),auth[_0xdda0('0x8')](),controller[_0xdda0('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0xdda0('0x10')]);router[_0xdda0('0x11')]('/:id',controller[_0xdda0('0x12')]);router[_0xdda0('0x13')](_0xdda0('0xe'),auth['isAuthenticated'](),controller[_0xdda0('0x14')]);module[_0xdda0('0x15')]=router; \ No newline at end of file +var _0xfa71=['../../components/interaction/service','./chatInternalMessage.controller','isAuthenticated','get','/users','getUsers','/:id','show','create','update','destroy','exports','path','connect-timeout','express','fs-extra'];(function(_0x39453b,_0x8fa092){var _0x4ad5d3=function(_0x594ffb){while(--_0x594ffb){_0x39453b['push'](_0x39453b['shift']());}};_0x4ad5d3(++_0x8fa092);}(_0xfa71,0x13c));var _0x1fa7=function(_0x4f738c,_0x2059f7){_0x4f738c=_0x4f738c-0x0;var _0x5f0f2f=_0xfa71[_0x4f738c];return _0x5f0f2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1fa7('0x0'));var timeout=require(_0x1fa7('0x1'));var express=require(_0x1fa7('0x2'));var router=express['Router']();var fs_extra=require(_0x1fa7('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1fa7('0x4'));var config=require('../../config/environment');var controller=require(_0x1fa7('0x5'));router['get']('/',auth[_0x1fa7('0x6')](),controller['index']);router[_0x1fa7('0x7')]('/describe',auth[_0x1fa7('0x6')](),controller['describe']);router[_0x1fa7('0x7')](_0x1fa7('0x8'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0x9')]);router[_0x1fa7('0x7')](_0x1fa7('0xa'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xb')]);router['post']('/',auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xc')]);router['put'](_0x1fa7('0xa'),controller[_0x1fa7('0xd')]);router['delete'](_0x1fa7('0xa'),auth[_0x1fa7('0x6')](),controller[_0x1fa7('0xe')]);module[_0x1fa7('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index d09cc48..9ed9a4e 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 _0xb8a0=['STRING','TEXT','medium','BOOLEAN'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xb8a0,0x1d5));var _0x0b8a=function(_0x39d7a3,_0x5b78df){_0x39d7a3=_0x39d7a3-0x0;var _0x3b71da=_0xb8a0[_0x39d7a3];return _0x3b71da;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x0b8a('0x0')](_0x0b8a('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x0b8a('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x0b8a('0x3')]},'providerResponse':{'type':Sequelize[_0x0b8a('0x0')]}}; \ No newline at end of file +var _0x3c8b=['DATE','STRING','TEXT','exports','medium','BOOLEAN','out'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x3c8b,0x18b));var _0xb3c8=function(_0x59c8ee,_0x1390b3){_0x59c8ee=_0x59c8ee-0x0;var _0x3704b4=_0x3c8b[_0x59c8ee];return _0x3704b4;};'use strict';var Sequelize=require('sequelize');module[_0xb3c8('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb3c8('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb3c8('0x2')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb3c8('0x3')),'defaultValue':_0xb3c8('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xb3c8('0x4')]},'providerName':{'type':Sequelize[_0xb3c8('0x5')]},'providerResponse':{'type':Sequelize[_0xb3c8('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3909c27..9353217 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 _0xebd1=['../../config/license/util','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','options','ChatMessage','includeAll','rows','catch','show','params','rawAttributes','keys','include','merge','find','body','describe','../../config/logger','chat-interactions','accept','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteractionId','read1stAt','format','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','manual','SIP/%s','channel','motionChannel','event','EventManager','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','fullname','interface','parse','formData','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x5957dd,_0xecdef9){var _0x5e828e=function(_0x3921a9){while(--_0x3921a9){_0x5957dd['push'](_0x5957dd['shift']());}};_0x5e828e(++_0xecdef9);}(_0xebd1,0x6b));var _0x1ebd=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xebd1[_0xb0de07];return _0x4633d8;};'use strict';var emlformat=require(_0x1ebd('0x0'));var rimraf=require(_0x1ebd('0x1'));var zipdir=require(_0x1ebd('0x2'));var jsonpatch=require(_0x1ebd('0x3'));var rp=require(_0x1ebd('0x4'));var moment=require(_0x1ebd('0x5'));var BPromise=require(_0x1ebd('0x6'));var Mustache=require('mustache');var util=require(_0x1ebd('0x7'));var path=require('path');var sox=require(_0x1ebd('0x8'));var csv=require(_0x1ebd('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ebd('0xa'));var _=require('lodash');var squel=require(_0x1ebd('0xb'));var crypto=require(_0x1ebd('0xc'));var jsforce=require(_0x1ebd('0xd'));var deskjs=require(_0x1ebd('0xe'));var toCsv=require(_0x1ebd('0x9'));var querystring=require(_0x1ebd('0xf'));var Papa=require('papaparse');var Redis=require(_0x1ebd('0x10'));var authService=require(_0x1ebd('0x11'));var qs=require(_0x1ebd('0x12'));var as=require(_0x1ebd('0x13'));var hardwareService=require(_0x1ebd('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1ebd('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1ebd('0x16'));var db=require(_0x1ebd('0x17'))['db'];config[_0x1ebd('0x18')]=_['defaults'](config['redis'],{'host':_0x1ebd('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x1ebd('0x1a'))[_0x1ebd('0x1b')](socket);var jayson=require(_0x1ebd('0x1c'));var client=jayson[_0x1ebd('0x1d')][_0x1ebd('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0x1ebd('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x415fad,_0x4de51a,_0x231dd4,_0xa05858){return new BPromise(function(_0x5d896e,_0x2891f6){var _0x5d4653=_0xa05858||client;return _0x5d4653['request'](_0x415fad,_0x231dd4)[_0x1ebd('0x1f')](function(_0x3b0aef){logger[_0x1ebd('0x20')](_0x1ebd('0x21'),_0x4de51a,_0x1ebd('0x22'));logger['debug'](_0x1ebd('0x23'),_0x4de51a,_0x1ebd('0x22'),JSON[_0x1ebd('0x24')](_0x3b0aef));if(_0x3b0aef['error']){if(_0x3b0aef[_0x1ebd('0x25')]['code']===0x1f4){logger['error'](_0x1ebd('0x21'),_0x4de51a,_0x3b0aef[_0x1ebd('0x25')][_0x1ebd('0x26')]);return _0x2891f6(_0x3b0aef['error']['message']);}logger[_0x1ebd('0x25')](_0x1ebd('0x21'),_0x4de51a,_0x3b0aef['error'][_0x1ebd('0x26')]);return _0x5d896e(_0x3b0aef[_0x1ebd('0x25')][_0x1ebd('0x26')]);}else{logger['info'](_0x1ebd('0x21'),_0x4de51a,_0x1ebd('0x22'));_0x5d896e(_0x3b0aef[_0x1ebd('0x27')]['message']);}})['catch'](function(_0x4b1c3f){logger['error']('ChatMessage,\x20%s,\x20%s',_0x4de51a,_0x4b1c3f);_0x2891f6(_0x4b1c3f);});});}function respondWithStatusCode(_0x52b4c0,_0x331573){_0x331573=_0x331573||0xcc;return function(_0x2b7cff){if(_0x2b7cff){return _0x52b4c0[_0x1ebd('0x28')](_0x331573);}return _0x52b4c0['status'](_0x331573)[_0x1ebd('0x29')]();};}function respondWithResult(_0x373d2a,_0x3625bd){_0x3625bd=_0x3625bd||0xc8;return function(_0x578e0f){if(_0x578e0f){return _0x373d2a['status'](_0x3625bd)[_0x1ebd('0x2a')](_0x578e0f);}};}function respondWithFilteredResult(_0x11700b,_0xb34755){return function(_0x1d5d9d){if(_0x1d5d9d){var _0x57498f=typeof _0xb34755[_0x1ebd('0x2b')]==='undefined'&&typeof _0xb34755[_0x1ebd('0x2c')]===_0x1ebd('0x2d');var _0x27af71=_0x1d5d9d[_0x1ebd('0x2e')];var _0x3e5b13=_0x57498f?0x0:_0xb34755[_0x1ebd('0x2b')];var _0x362410=_0x57498f?_0x1d5d9d[_0x1ebd('0x2e')]:_0xb34755[_0x1ebd('0x2b')]+_0xb34755['limit'];var _0x930012;if(_0x362410>=_0x27af71){_0x362410=_0x27af71;_0x930012=0xc8;}else{_0x930012=0xce;}_0x11700b['status'](_0x930012);return _0x11700b[_0x1ebd('0x2f')](_0x1ebd('0x30'),_0x3e5b13+'-'+_0x362410+'/'+_0x27af71)[_0x1ebd('0x2a')](_0x1d5d9d);}return null;};}function patchUpdates(_0x513578){return function(_0x57d724){try{jsonpatch[_0x1ebd('0x31')](_0x57d724,_0x513578,!![]);}catch(_0x4ef6d1){return BPromise[_0x1ebd('0x32')](_0x4ef6d1);}return _0x57d724[_0x1ebd('0x33')]();};}function saveUpdates(_0x1f30c0,_0x5ee7ce){return function(_0x2f2099){if(_0x2f2099){return _0x2f2099[_0x1ebd('0x34')](_0x1f30c0)[_0x1ebd('0x1f')](function(_0xdca08b){return _0xdca08b;});}return null;};}function removeEntity(_0x1fca12,_0x58b425){return function(_0x5d1d80){if(_0x5d1d80){return _0x5d1d80[_0x1ebd('0x35')]()[_0x1ebd('0x1f')](function(){_0x1fca12[_0x1ebd('0x36')](0xcc)[_0x1ebd('0x29')]();});}};}function handleEntityNotFound(_0x5c5d11,_0x21f59e){return function(_0x987167){if(!_0x987167){_0x5c5d11['sendStatus'](0x194);}return _0x987167;};}function handleError(_0x3cd0ac,_0x19100f){_0x19100f=_0x19100f||0x1f4;return function(_0x2e3ead){logger[_0x1ebd('0x25')](_0x2e3ead[_0x1ebd('0x37')]);if(_0x2e3ead[_0x1ebd('0x38')]){delete _0x2e3ead[_0x1ebd('0x38')];}_0x3cd0ac['status'](_0x19100f)[_0x1ebd('0x39')](_0x2e3ead);};}exports[_0x1ebd('0x3a')]=function(_0x367417,_0x128652){var _0x1faa69={},_0x56bf4d={},_0x37fe25={'count':0x0,'rows':[]};var _0x1cdf1b=_[_0x1ebd('0x3b')](db['ChatMessage']['rawAttributes'],function(_0x16e48e){return{'name':_0x16e48e['fieldName'],'type':_0x16e48e[_0x1ebd('0x3c')][_0x1ebd('0x3d')]};});_0x56bf4d[_0x1ebd('0x3e')]=_[_0x1ebd('0x3b')](_0x1cdf1b,_0x1ebd('0x38'));_0x56bf4d[_0x1ebd('0x3f')]=_['keys'](_0x367417[_0x1ebd('0x3f')]);_0x56bf4d[_0x1ebd('0x40')]=_[_0x1ebd('0x41')](_0x56bf4d[_0x1ebd('0x3e')],_0x56bf4d[_0x1ebd('0x3f')]);_0x1faa69[_0x1ebd('0x42')]=_[_0x1ebd('0x41')](_0x56bf4d[_0x1ebd('0x3e')],qs[_0x1ebd('0x43')](_0x367417['query'][_0x1ebd('0x43')]));_0x1faa69[_0x1ebd('0x42')]=_0x1faa69['attributes'][_0x1ebd('0x44')]?_0x1faa69[_0x1ebd('0x42')]:_0x56bf4d['model'];if(!_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x45')](_0x1ebd('0x46'))){_0x1faa69['limit']=qs[_0x1ebd('0x2c')](_0x367417['query'][_0x1ebd('0x2c')]);_0x1faa69[_0x1ebd('0x2b')]=qs[_0x1ebd('0x2b')](_0x367417[_0x1ebd('0x3f')]['offset']);}_0x1faa69[_0x1ebd('0x47')]=qs[_0x1ebd('0x48')](_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x48')]);_0x1faa69['where']=qs[_0x1ebd('0x40')](_[_0x1ebd('0x49')](_0x367417[_0x1ebd('0x3f')],_0x56bf4d[_0x1ebd('0x40')]),_0x1cdf1b);if(_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x4a')]){_0x1faa69[_0x1ebd('0x4b')]=_['merge'](_0x1faa69[_0x1ebd('0x4b')],{'$or':_[_0x1ebd('0x3b')](_0x1cdf1b,function(_0x49b085){if(_0x49b085[_0x1ebd('0x3c')]!=='VIRTUAL'){var _0x1e2333={};_0x1e2333[_0x49b085[_0x1ebd('0x38')]]={'$like':'%'+_0x367417['query'][_0x1ebd('0x4a')]+'%'};return _0x1e2333;}})});}_0x1faa69=_['merge']({},_0x1faa69,_0x367417[_0x1ebd('0x4c')]);var _0x5668ae={'where':_0x1faa69['where']};return db[_0x1ebd('0x4d')][_0x1ebd('0x2e')](_0x5668ae)[_0x1ebd('0x1f')](function(_0x39b48e){_0x37fe25[_0x1ebd('0x2e')]=_0x39b48e;if(_0x367417[_0x1ebd('0x3f')][_0x1ebd('0x4e')]){_0x1faa69['include']=[{'all':!![]}];}return db[_0x1ebd('0x4d')]['findAll'](_0x1faa69);})[_0x1ebd('0x1f')](function(_0x88cd37){_0x37fe25[_0x1ebd('0x4f')]=_0x88cd37;return _0x37fe25;})[_0x1ebd('0x1f')](respondWithFilteredResult(_0x128652,_0x1faa69))[_0x1ebd('0x50')](handleError(_0x128652,null));};exports[_0x1ebd('0x51')]=function(_0x257e5d,_0xfd14a2){var _0x12dac2={'raw':!![],'where':{'id':_0x257e5d[_0x1ebd('0x52')]['id']}},_0x2995b7={};_0x2995b7[_0x1ebd('0x3e')]=_['keys'](db[_0x1ebd('0x4d')][_0x1ebd('0x53')]);_0x2995b7['query']=_[_0x1ebd('0x54')](_0x257e5d['query']);_0x2995b7[_0x1ebd('0x40')]=_[_0x1ebd('0x41')](_0x2995b7[_0x1ebd('0x3e')],_0x2995b7[_0x1ebd('0x3f')]);_0x12dac2[_0x1ebd('0x42')]=_[_0x1ebd('0x41')](_0x2995b7[_0x1ebd('0x3e')],qs[_0x1ebd('0x43')](_0x257e5d[_0x1ebd('0x3f')][_0x1ebd('0x43')]));_0x12dac2[_0x1ebd('0x42')]=_0x12dac2[_0x1ebd('0x42')][_0x1ebd('0x44')]?_0x12dac2[_0x1ebd('0x42')]:_0x2995b7[_0x1ebd('0x3e')];if(_0x257e5d[_0x1ebd('0x3f')][_0x1ebd('0x4e')]){_0x12dac2[_0x1ebd('0x55')]=[{'all':!![]}];}_0x12dac2=_[_0x1ebd('0x56')]({},_0x12dac2,_0x257e5d[_0x1ebd('0x4c')]);return db[_0x1ebd('0x4d')][_0x1ebd('0x57')](_0x12dac2)[_0x1ebd('0x1f')](handleEntityNotFound(_0xfd14a2,null))[_0x1ebd('0x1f')](respondWithResult(_0xfd14a2,null))[_0x1ebd('0x50')](handleError(_0xfd14a2,null));};exports['create']=function(_0x41911c,_0x1be425){return db['ChatMessage']['create'](_0x41911c[_0x1ebd('0x58')],{})[_0x1ebd('0x1f')](respondWithResult(_0x1be425,0xc9))['catch'](handleError(_0x1be425,null));};exports[_0x1ebd('0x34')]=function(_0x52fcce,_0x5a9a71){if(_0x52fcce[_0x1ebd('0x58')]['id']){delete _0x52fcce[_0x1ebd('0x58')]['id'];}return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x52fcce[_0x1ebd('0x52')]['id']}})['then'](handleEntityNotFound(_0x5a9a71,null))[_0x1ebd('0x1f')](saveUpdates(_0x52fcce[_0x1ebd('0x58')],null))[_0x1ebd('0x1f')](respondWithResult(_0x5a9a71,null))[_0x1ebd('0x50')](handleError(_0x5a9a71,null));};exports[_0x1ebd('0x35')]=function(_0x5c4d67,_0x4459b1){return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x5c4d67[_0x1ebd('0x52')]['id']}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x4459b1,null))[_0x1ebd('0x1f')](removeEntity(_0x4459b1,null))[_0x1ebd('0x50')](handleError(_0x4459b1,null));};exports[_0x1ebd('0x59')]=function(_0xa67472,_0x5cdf07){return db[_0x1ebd('0x4d')][_0x1ebd('0x59')]()['then'](respondWithResult(_0x5cdf07,null))[_0x1ebd('0x50')](handleError(_0x5cdf07,null));};var interaction_log=require(_0x1ebd('0x5a'))(_0x1ebd('0x5b'));exports[_0x1ebd('0x5c')]=function(_0x2a9d2a,_0x1989d4,_0x373725){var _0x34e83b={'agent':{},'channel':'chat'};if(_0x2a9d2a[_0x1ebd('0x58')]['id']){delete _0x2a9d2a[_0x1ebd('0x58')]['id'];}_0x2a9d2a['body'][_0x1ebd('0x5d')]=!![];_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x5e')]=moment()['format'](_0x1ebd('0x5f'));_0x2a9d2a['body'][_0x1ebd('0x60')]=_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')]||_0x2a9d2a[_0x1ebd('0x61')]['id'];_0x34e83b[_0x1ebd('0x62')]['id']=_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')];return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x2a9d2a[_0x1ebd('0x52')]['id'],'UserId':null}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x1989d4,null))[_0x1ebd('0x1f')](saveUpdates(_0x2a9d2a[_0x1ebd('0x58')],null))[_0x1ebd('0x1f')](function(_0x19d095){if(_0x19d095){_0x34e83b[_0x1ebd('0x26')]=_0x19d095[_0x1ebd('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x1ebd('0x57')]({'where':{'id':_0x19d095[_0x1ebd('0x64')]}});}return null;})[_0x1ebd('0x1f')](handleEntityNotFound(_0x1989d4,null))['then'](function(_0x2aca80){if(_0x2aca80){return _0x2aca80[_0x1ebd('0x34')]({'UserId':_0x2a9d2a[_0x1ebd('0x58')]['UserId'],'read1stAt':_['isNil'](_0x2aca80[_0x1ebd('0x65')])?moment()[_0x1ebd('0x66')](_0x1ebd('0x5f')):undefined});}return null;})[_0x1ebd('0x1f')](function(_0x1c6b34){if(_0x1c6b34){_0x34e83b[_0x1ebd('0x67')]=_0x1c6b34[_0x1ebd('0x63')]({'plain':!![]});interaction_log[_0x1ebd('0x20')](_0x1ebd('0x68'),_0x2a9d2a[_0x1ebd('0x61')]['id'],_0x2a9d2a['user']['name'],_0x2a9d2a[_0x1ebd('0x61')][_0x1ebd('0x69')],_0x34e83b[_0x1ebd('0x67')]['id'],_0x2a9d2a[_0x1ebd('0x58')]?JSON[_0x1ebd('0x24')](_0x2a9d2a[_0x1ebd('0x58')]):_0x1ebd('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x1ebd('0x6b'),_0x34e83b);}return null;})[_0x1ebd('0x1f')](function(_0x880145){var _0x583430=_0x1ebd('0x6c')+_0x880145[_0x1ebd('0x26')][_0x1ebd('0x6d')];return db[_0x1ebd('0x6e')][_0x1ebd('0x3f')](_0x583430,{'type':db[_0x1ebd('0x6f')][_0x1ebd('0x70')][_0x1ebd('0x71')],'raw':!![]})[_0x1ebd('0x1f')](function(_0x1eb0a3){return _0x1eb0a3;});})[_0x1ebd('0x1f')](function(_0x40a6d4){if(_0x40a6d4){_0x34e83b['message'][_0x1ebd('0x72')]=_0x40a6d4[0x0];if(!_0x2a9d2a[_0x1ebd('0x58')][_0x1ebd('0x60')])return;return db[_0x1ebd('0x73')][_0x1ebd('0x57')]({'where':{'id':_0x2a9d2a[_0x1ebd('0x58')]['UserId'],'role':_0x1ebd('0x62')},'attributes':['id',_0x1ebd('0x38'),'fullname',_0x1ebd('0x74'),'internal'],'raw':!![]});}return null;})[_0x1ebd('0x1f')](function(_0x2a23aa){if(!_0x2a23aa)return null;_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x62')]=_0x2a23aa;return _0x34e83b;})[_0x1ebd('0x1f')](function(_0x501b2a){if(_0x501b2a){if(_0x2a9d2a['body'][_0x1ebd('0x75')]){_0x34e83b['message']['interface']=util[_0x1ebd('0x66')](_0x1ebd('0x76'),_0x2a9d2a[_0x1ebd('0x61')]['name']);_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x77')]=_0x34e83b[_0x1ebd('0x77')];_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x78')]=_0x34e83b['channel'];_0x34e83b[_0x1ebd('0x26')][_0x1ebd('0x79')]=_0x1ebd('0x5c');return respondWithRpcPromise(_0x1ebd('0x7a'),_0x1ebd('0x7a'),{'event':'acceptmessage','message':_[_0x1ebd('0x56')](_0x34e83b[_0x1ebd('0x26')],JSON['parse'](_0x34e83b[_0x1ebd('0x67')]['formData']))},client9002)[_0x1ebd('0x1f')](function(){return _0x34e83b;});}return _0x34e83b;}return null;})[_0x1ebd('0x1f')](respondWithResult(_0x1989d4,null))[_0x1ebd('0x50')](handleError(_0x1989d4,null));};var interaction_log=require(_0x1ebd('0x5a'))(_0x1ebd('0x5b'));exports['reject']=function(_0x1d69f4,_0x3fb4cd,_0x4c3c7f){var _0x279a4e={'agent':{},'channel':_0x1ebd('0x7b')};if(_0x1d69f4[_0x1ebd('0x58')]['id']){delete _0x1d69f4[_0x1ebd('0x58')]['id'];}_0x1d69f4['body'][_0x1ebd('0x60')]=_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')]||_0x1d69f4[_0x1ebd('0x61')]['id'];_0x279a4e[_0x1ebd('0x62')]['id']=_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')];return db[_0x1ebd('0x4d')][_0x1ebd('0x57')]({'where':{'id':_0x1d69f4[_0x1ebd('0x52')]['id'],'UserId':null}})[_0x1ebd('0x1f')](handleEntityNotFound(_0x3fb4cd,null))[_0x1ebd('0x1f')](function(_0x124f92){if(_0x124f92){_0x279a4e[_0x1ebd('0x26')]=_0x124f92[_0x1ebd('0x63')]({'plain':!![]});return db['ChatInteraction'][_0x1ebd('0x57')]({'where':{'id':_0x124f92[_0x1ebd('0x64')]}});}return null;})[_0x1ebd('0x1f')](handleEntityNotFound(_0x3fb4cd,null))[_0x1ebd('0x1f')](function(_0x2d5b75){if(_0x2d5b75){_0x279a4e[_0x1ebd('0x67')]=_0x2d5b75[_0x1ebd('0x63')]({'plain':!![]});interaction_log[_0x1ebd('0x20')](_0x1ebd('0x7c'),_0x1d69f4['user']['id'],_0x1d69f4[_0x1ebd('0x61')]['name'],_0x1d69f4[_0x1ebd('0x61')][_0x1ebd('0x69')],_0x279a4e[_0x1ebd('0x67')]['id'],_0x1d69f4[_0x1ebd('0x58')]?JSON[_0x1ebd('0x24')](_0x1d69f4[_0x1ebd('0x58')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x279a4e);}return null;})[_0x1ebd('0x1f')](function(_0x2d94ac){var _0x942617=_0x1ebd('0x6c')+_0x2d94ac[_0x1ebd('0x26')]['ContactId'];return db[_0x1ebd('0x6e')][_0x1ebd('0x3f')](_0x942617,{'type':db[_0x1ebd('0x6f')][_0x1ebd('0x70')][_0x1ebd('0x71')],'raw':!![]})[_0x1ebd('0x1f')](function(_0x2c9fa2){return _0x2c9fa2;});})['then'](function(_0x50987c){if(_0x50987c){_0x279a4e['message'][_0x1ebd('0x72')]=_0x50987c[0x0];if(!_0x1d69f4[_0x1ebd('0x58')][_0x1ebd('0x60')])return;return db['User'][_0x1ebd('0x57')]({'where':{'id':_0x1d69f4['body'][_0x1ebd('0x60')],'role':_0x1ebd('0x62')},'attributes':['id',_0x1ebd('0x38'),_0x1ebd('0x7d'),_0x1ebd('0x74'),'internal'],'raw':!![]});}return null;})[_0x1ebd('0x1f')](function(_0xe7b938){if(!_0xe7b938)return null;_0x279a4e[_0x1ebd('0x26')][_0x1ebd('0x62')]=_0xe7b938;return _0x279a4e;})[_0x1ebd('0x1f')](function(_0x18914c){if(_0x18914c){_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x7e')]=util[_0x1ebd('0x66')](_0x1ebd('0x76'),_0x1d69f4[_0x1ebd('0x61')][_0x1ebd('0x38')]);_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x77')]=_0x279a4e['channel'];_0x18914c[_0x1ebd('0x26')][_0x1ebd('0x78')]=_0x279a4e['channel'];_0x18914c[_0x1ebd('0x26')]['event']='reject';respondWithRpcPromise(_0x1ebd('0x7a'),_0x1ebd('0x7a'),{'event':'rejectmessage','message':_[_0x1ebd('0x56')](_0x279a4e[_0x1ebd('0x26')],JSON[_0x1ebd('0x7f')](_0x279a4e['interaction'][_0x1ebd('0x80')]))},client9002);return _0x279a4e;}return null;})[_0x1ebd('0x1f')](respondWithResult(_0x3fb4cd,null))['catch'](handleError(_0x3fb4cd,null));}; \ No newline at end of file +var _0xab26=['client','http','request','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','filters','pick','merge','type','VIRTUAL','options','includeAll','include','findAll','then','rows','show','params','length','find','body','describe','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','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','event','accept','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../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','./chatMessage.socket','register'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xab26,0x174));var _0x6ab2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xab26[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x6ab2('0x0'));var rimraf=require(_0x6ab2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ab2('0x2'));var rp=require(_0x6ab2('0x3'));var moment=require(_0x6ab2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6ab2('0x5'));var path=require(_0x6ab2('0x6'));var sox=require(_0x6ab2('0x7'));var csv=require(_0x6ab2('0x8'));var ejs=require(_0x6ab2('0x9'));var fs=require('fs');var fs_extra=require(_0x6ab2('0xa'));var _=require(_0x6ab2('0xb'));var squel=require(_0x6ab2('0xc'));var crypto=require('crypto');var jsforce=require(_0x6ab2('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6ab2('0x8'));var querystring=require(_0x6ab2('0xe'));var Papa=require(_0x6ab2('0xf'));var Redis=require('ioredis');var authService=require(_0x6ab2('0x10'));var qs=require(_0x6ab2('0x11'));var as=require(_0x6ab2('0x12'));var hardwareService=require(_0x6ab2('0x13'));var logger=require(_0x6ab2('0x14'))(_0x6ab2('0x15'));var utils=require(_0x6ab2('0x16'));var config=require(_0x6ab2('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ab2('0x18'))['db'];config['redis']=_[_0x6ab2('0x19')](config['redis'],{'host':_0x6ab2('0x1a'),'port':0x18eb});var socket=require(_0x6ab2('0x1b'))(new Redis(config['redis']));require(_0x6ab2('0x1c'))[_0x6ab2('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0x6ab2('0x1e')][_0x6ab2('0x1f')]({'port':0x232c});var client9002=jayson[_0x6ab2('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c28d9,_0x5a4ba9,_0xc74f0,_0x507d18){return new BPromise(function(_0x1d0618,_0x2104db){var _0x14fc08=_0x507d18||client;return _0x14fc08[_0x6ab2('0x20')](_0x2c28d9,_0xc74f0)['then'](function(_0x215b5e){logger[_0x6ab2('0x21')](_0x6ab2('0x22'),_0x5a4ba9,'request\x20sent');logger[_0x6ab2('0x23')](_0x6ab2('0x24'),_0x5a4ba9,_0x6ab2('0x25'),JSON[_0x6ab2('0x26')](_0x215b5e));if(_0x215b5e[_0x6ab2('0x27')]){if(_0x215b5e[_0x6ab2('0x27')]['code']===0x1f4){logger['error'](_0x6ab2('0x22'),_0x5a4ba9,_0x215b5e[_0x6ab2('0x27')][_0x6ab2('0x28')]);return _0x2104db(_0x215b5e[_0x6ab2('0x27')]['message']);}logger[_0x6ab2('0x27')](_0x6ab2('0x22'),_0x5a4ba9,_0x215b5e[_0x6ab2('0x27')][_0x6ab2('0x28')]);return _0x1d0618(_0x215b5e['error'][_0x6ab2('0x28')]);}else{logger['info'](_0x6ab2('0x22'),_0x5a4ba9,_0x6ab2('0x25'));_0x1d0618(_0x215b5e['result'][_0x6ab2('0x28')]);}})[_0x6ab2('0x29')](function(_0x5709be){logger[_0x6ab2('0x27')](_0x6ab2('0x22'),_0x5a4ba9,_0x5709be);_0x2104db(_0x5709be);});});}function respondWithStatusCode(_0x468921,_0x2fc40e){_0x2fc40e=_0x2fc40e||0xcc;return function(_0xd704df){if(_0xd704df){return _0x468921['sendStatus'](_0x2fc40e);}return _0x468921[_0x6ab2('0x2a')](_0x2fc40e)['end']();};}function respondWithResult(_0x4ebdef,_0x1af8df){_0x1af8df=_0x1af8df||0xc8;return function(_0x2ccbad){if(_0x2ccbad){return _0x4ebdef[_0x6ab2('0x2a')](_0x1af8df)[_0x6ab2('0x2b')](_0x2ccbad);}};}function respondWithFilteredResult(_0x2f6325,_0x13fc04){return function(_0x4b47d7){if(_0x4b47d7){var _0x4e8c8e=typeof _0x13fc04[_0x6ab2('0x2c')]===_0x6ab2('0x2d')&&typeof _0x13fc04[_0x6ab2('0x2e')]==='undefined';var _0x83fc1f=_0x4b47d7[_0x6ab2('0x2f')];var _0x502d2a=_0x4e8c8e?0x0:_0x13fc04[_0x6ab2('0x2c')];var _0x3740bc=_0x4e8c8e?_0x4b47d7[_0x6ab2('0x2f')]:_0x13fc04[_0x6ab2('0x2c')]+_0x13fc04[_0x6ab2('0x2e')];var _0xa3c627;if(_0x3740bc>=_0x83fc1f){_0x3740bc=_0x83fc1f;_0xa3c627=0xc8;}else{_0xa3c627=0xce;}_0x2f6325[_0x6ab2('0x2a')](_0xa3c627);return _0x2f6325[_0x6ab2('0x30')](_0x6ab2('0x31'),_0x502d2a+'-'+_0x3740bc+'/'+_0x83fc1f)['json'](_0x4b47d7);}return null;};}function patchUpdates(_0x28f815){return function(_0x7646c4){try{jsonpatch['apply'](_0x7646c4,_0x28f815,!![]);}catch(_0x59a399){return BPromise[_0x6ab2('0x32')](_0x59a399);}return _0x7646c4[_0x6ab2('0x33')]();};}function saveUpdates(_0x400a53,_0x222b0e){return function(_0x1f2024){if(_0x1f2024){return _0x1f2024[_0x6ab2('0x34')](_0x400a53)['then'](function(_0x2f91d2){return _0x2f91d2;});}return null;};}function removeEntity(_0x3baffe,_0xf723f9){return function(_0x212562){if(_0x212562){return _0x212562[_0x6ab2('0x35')]()['then'](function(){_0x3baffe[_0x6ab2('0x2a')](0xcc)[_0x6ab2('0x36')]();});}};}function handleEntityNotFound(_0x4346a7,_0x127fe4){return function(_0x4348c7){if(!_0x4348c7){_0x4346a7[_0x6ab2('0x37')](0x194);}return _0x4348c7;};}function handleError(_0x183fad,_0x5bb548){_0x5bb548=_0x5bb548||0x1f4;return function(_0x29c24e){logger['error'](_0x29c24e[_0x6ab2('0x38')]);if(_0x29c24e[_0x6ab2('0x39')]){delete _0x29c24e[_0x6ab2('0x39')];}_0x183fad[_0x6ab2('0x2a')](_0x5bb548)[_0x6ab2('0x3a')](_0x29c24e);};}exports[_0x6ab2('0x3b')]=function(_0x320e0a,_0x27524b){var _0x2c1768={},_0x1b500e={},_0x1fe318={'count':0x0,'rows':[]};var _0x4988dd=_[_0x6ab2('0x3c')](db[_0x6ab2('0x3d')][_0x6ab2('0x3e')],function(_0x584c4b){return{'name':_0x584c4b[_0x6ab2('0x3f')],'type':_0x584c4b['type']['key']};});_0x1b500e['model']=_[_0x6ab2('0x3c')](_0x4988dd,'name');_0x1b500e[_0x6ab2('0x40')]=_[_0x6ab2('0x41')](_0x320e0a[_0x6ab2('0x40')]);_0x1b500e['filters']=_[_0x6ab2('0x42')](_0x1b500e[_0x6ab2('0x43')],_0x1b500e[_0x6ab2('0x40')]);_0x2c1768['attributes']=_[_0x6ab2('0x42')](_0x1b500e[_0x6ab2('0x43')],qs[_0x6ab2('0x44')](_0x320e0a[_0x6ab2('0x40')]['fields']));_0x2c1768[_0x6ab2('0x45')]=_0x2c1768[_0x6ab2('0x45')]['length']?_0x2c1768[_0x6ab2('0x45')]:_0x1b500e[_0x6ab2('0x43')];if(!_0x320e0a[_0x6ab2('0x40')]['hasOwnProperty'](_0x6ab2('0x46'))){_0x2c1768[_0x6ab2('0x2e')]=qs['limit'](_0x320e0a['query'][_0x6ab2('0x2e')]);_0x2c1768[_0x6ab2('0x2c')]=qs[_0x6ab2('0x2c')](_0x320e0a[_0x6ab2('0x40')][_0x6ab2('0x2c')]);}_0x2c1768[_0x6ab2('0x47')]=qs[_0x6ab2('0x48')](_0x320e0a['query'][_0x6ab2('0x48')]);_0x2c1768[_0x6ab2('0x49')]=qs[_0x6ab2('0x4a')](_[_0x6ab2('0x4b')](_0x320e0a[_0x6ab2('0x40')],_0x1b500e['filters']),_0x4988dd);if(_0x320e0a[_0x6ab2('0x40')]['filter']){_0x2c1768[_0x6ab2('0x49')]=_[_0x6ab2('0x4c')](_0x2c1768[_0x6ab2('0x49')],{'$or':_['map'](_0x4988dd,function(_0x203f5f){if(_0x203f5f[_0x6ab2('0x4d')]!==_0x6ab2('0x4e')){var _0x3afae0={};_0x3afae0[_0x203f5f[_0x6ab2('0x39')]]={'$like':'%'+_0x320e0a['query']['filter']+'%'};return _0x3afae0;}})});}_0x2c1768=_[_0x6ab2('0x4c')]({},_0x2c1768,_0x320e0a[_0x6ab2('0x4f')]);var _0x325512={'where':_0x2c1768[_0x6ab2('0x49')]};return db[_0x6ab2('0x3d')]['count'](_0x325512)['then'](function(_0x123f3d){_0x1fe318[_0x6ab2('0x2f')]=_0x123f3d;if(_0x320e0a[_0x6ab2('0x40')][_0x6ab2('0x50')]){_0x2c1768[_0x6ab2('0x51')]=[{'all':!![]}];}return db[_0x6ab2('0x3d')][_0x6ab2('0x52')](_0x2c1768);})[_0x6ab2('0x53')](function(_0x452fe2){_0x1fe318[_0x6ab2('0x54')]=_0x452fe2;return _0x1fe318;})[_0x6ab2('0x53')](respondWithFilteredResult(_0x27524b,_0x2c1768))[_0x6ab2('0x29')](handleError(_0x27524b,null));};exports[_0x6ab2('0x55')]=function(_0x309c2e,_0x3cebca){var _0x19d90c={'raw':!![],'where':{'id':_0x309c2e[_0x6ab2('0x56')]['id']}},_0x3d049d={};_0x3d049d[_0x6ab2('0x43')]=_[_0x6ab2('0x41')](db[_0x6ab2('0x3d')][_0x6ab2('0x3e')]);_0x3d049d['query']=_[_0x6ab2('0x41')](_0x309c2e[_0x6ab2('0x40')]);_0x3d049d[_0x6ab2('0x4a')]=_[_0x6ab2('0x42')](_0x3d049d[_0x6ab2('0x43')],_0x3d049d[_0x6ab2('0x40')]);_0x19d90c[_0x6ab2('0x45')]=_[_0x6ab2('0x42')](_0x3d049d[_0x6ab2('0x43')],qs[_0x6ab2('0x44')](_0x309c2e[_0x6ab2('0x40')][_0x6ab2('0x44')]));_0x19d90c[_0x6ab2('0x45')]=_0x19d90c[_0x6ab2('0x45')][_0x6ab2('0x57')]?_0x19d90c[_0x6ab2('0x45')]:_0x3d049d[_0x6ab2('0x43')];if(_0x309c2e[_0x6ab2('0x40')][_0x6ab2('0x50')]){_0x19d90c[_0x6ab2('0x51')]=[{'all':!![]}];}_0x19d90c=_[_0x6ab2('0x4c')]({},_0x19d90c,_0x309c2e[_0x6ab2('0x4f')]);return db[_0x6ab2('0x3d')][_0x6ab2('0x58')](_0x19d90c)[_0x6ab2('0x53')](handleEntityNotFound(_0x3cebca,null))[_0x6ab2('0x53')](respondWithResult(_0x3cebca,null))[_0x6ab2('0x29')](handleError(_0x3cebca,null));};exports['create']=function(_0x11a348,_0x3a1a74){return db[_0x6ab2('0x3d')]['create'](_0x11a348[_0x6ab2('0x59')],{})['then'](respondWithResult(_0x3a1a74,0xc9))[_0x6ab2('0x29')](handleError(_0x3a1a74,null));};exports['update']=function(_0xfc55cd,_0x4c1c1b){if(_0xfc55cd[_0x6ab2('0x59')]['id']){delete _0xfc55cd[_0x6ab2('0x59')]['id'];}return db[_0x6ab2('0x3d')]['find']({'where':{'id':_0xfc55cd[_0x6ab2('0x56')]['id']}})[_0x6ab2('0x53')](handleEntityNotFound(_0x4c1c1b,null))[_0x6ab2('0x53')](saveUpdates(_0xfc55cd[_0x6ab2('0x59')],null))[_0x6ab2('0x53')](respondWithResult(_0x4c1c1b,null))[_0x6ab2('0x29')](handleError(_0x4c1c1b,null));};exports[_0x6ab2('0x35')]=function(_0x3f249f,_0x494599){return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0x3f249f[_0x6ab2('0x56')]['id']}})[_0x6ab2('0x53')](handleEntityNotFound(_0x494599,null))[_0x6ab2('0x53')](removeEntity(_0x494599,null))['catch'](handleError(_0x494599,null));};exports['describe']=function(_0xa2e360,_0x3094cc){return db[_0x6ab2('0x3d')][_0x6ab2('0x5a')]()['then'](respondWithResult(_0x3094cc,null))['catch'](handleError(_0x3094cc,null));};var interaction_log=require(_0x6ab2('0x14'))(_0x6ab2('0x5b'));exports['accept']=function(_0xe1b095,_0x30338a,_0x23387f){var _0x44f2eb={'agent':{},'channel':_0x6ab2('0x5c')};if(_0xe1b095[_0x6ab2('0x59')]['id']){delete _0xe1b095[_0x6ab2('0x59')]['id'];}_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x5d')]=!![];_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x5e')]=moment()[_0x6ab2('0x5f')](_0x6ab2('0x60'));_0xe1b095['body'][_0x6ab2('0x61')]=_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')]||_0xe1b095['user']['id'];_0x44f2eb[_0x6ab2('0x62')]['id']=_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')];return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0xe1b095[_0x6ab2('0x56')]['id'],'UserId':null}})[_0x6ab2('0x53')](handleEntityNotFound(_0x30338a,null))[_0x6ab2('0x53')](saveUpdates(_0xe1b095[_0x6ab2('0x59')],null))[_0x6ab2('0x53')](function(_0x182f88){if(_0x182f88){_0x44f2eb['message']=_0x182f88[_0x6ab2('0x63')]({'plain':!![]});return db[_0x6ab2('0x64')]['find']({'where':{'id':_0x182f88[_0x6ab2('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x30338a,null))[_0x6ab2('0x53')](function(_0x4a0616){if(_0x4a0616){return _0x4a0616[_0x6ab2('0x34')]({'UserId':_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')],'read1stAt':_[_0x6ab2('0x66')](_0x4a0616[_0x6ab2('0x67')])?moment()['format'](_0x6ab2('0x60')):undefined});}return null;})[_0x6ab2('0x53')](function(_0x23f7c6){if(_0x23f7c6){_0x44f2eb[_0x6ab2('0x68')]=_0x23f7c6['get']({'plain':!![]});interaction_log[_0x6ab2('0x21')](_0x6ab2('0x69'),_0xe1b095[_0x6ab2('0x6a')]['id'],_0xe1b095[_0x6ab2('0x6a')][_0x6ab2('0x39')],_0xe1b095[_0x6ab2('0x6a')]['role'],_0x44f2eb['interaction']['id'],_0xe1b095[_0x6ab2('0x59')]?JSON[_0x6ab2('0x26')](_0xe1b095[_0x6ab2('0x59')]):_0x6ab2('0x6b'));return respondWithRpcPromise(_0x6ab2('0x6c'),'acceptMessage',_0x44f2eb);}return null;})[_0x6ab2('0x53')](function(_0x361c1d){var _0x26f231=_0x6ab2('0x6d')+_0x361c1d[_0x6ab2('0x28')][_0x6ab2('0x6e')];return db[_0x6ab2('0x6f')][_0x6ab2('0x40')](_0x26f231,{'type':db[_0x6ab2('0x70')][_0x6ab2('0x71')][_0x6ab2('0x72')],'raw':!![]})[_0x6ab2('0x53')](function(_0x228c73){return _0x228c73;});})[_0x6ab2('0x53')](function(_0x16db7b){if(_0x16db7b){_0x44f2eb['message'][_0x6ab2('0x73')]=_0x16db7b[0x0];if(!_0xe1b095[_0x6ab2('0x59')]['UserId'])return;return db[_0x6ab2('0x74')][_0x6ab2('0x58')]({'where':{'id':_0xe1b095[_0x6ab2('0x59')][_0x6ab2('0x61')],'role':_0x6ab2('0x62')},'attributes':['id',_0x6ab2('0x39'),_0x6ab2('0x75'),_0x6ab2('0x76'),'internal'],'raw':!![]});}return null;})['then'](function(_0x239a02){if(!_0x239a02)return null;_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x62')]=_0x239a02;return _0x44f2eb;})[_0x6ab2('0x53')](function(_0x2a0fc5){if(_0x2a0fc5){if(_0xe1b095['body'][_0x6ab2('0x77')]){_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x78')]=util[_0x6ab2('0x5f')](_0x6ab2('0x79'),_0xe1b095['user']['name']);_0x44f2eb[_0x6ab2('0x28')]['channel']=_0x44f2eb[_0x6ab2('0x7a')];_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x7b')]=_0x44f2eb['channel'];_0x44f2eb[_0x6ab2('0x28')][_0x6ab2('0x7c')]=_0x6ab2('0x7d');return respondWithRpcPromise(_0x6ab2('0x7e'),'EventManager',{'event':_0x6ab2('0x7f'),'message':_[_0x6ab2('0x4c')](_0x44f2eb[_0x6ab2('0x28')],JSON[_0x6ab2('0x80')](_0x44f2eb[_0x6ab2('0x68')][_0x6ab2('0x81')]))},client9002)[_0x6ab2('0x53')](function(){return _0x44f2eb;});}return _0x44f2eb;}return null;})[_0x6ab2('0x53')](respondWithResult(_0x30338a,null))['catch'](handleError(_0x30338a,null));};var interaction_log=require(_0x6ab2('0x14'))(_0x6ab2('0x5b'));exports[_0x6ab2('0x32')]=function(_0x556e6d,_0x23f662,_0x56bf18){var _0x5af1d6={'agent':{},'channel':_0x6ab2('0x5c')};if(_0x556e6d[_0x6ab2('0x59')]['id']){delete _0x556e6d[_0x6ab2('0x59')]['id'];}_0x556e6d['body'][_0x6ab2('0x61')]=_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')]||_0x556e6d[_0x6ab2('0x6a')]['id'];_0x5af1d6[_0x6ab2('0x62')]['id']=_0x556e6d['body'][_0x6ab2('0x61')];return db[_0x6ab2('0x3d')][_0x6ab2('0x58')]({'where':{'id':_0x556e6d[_0x6ab2('0x56')]['id'],'UserId':null}})[_0x6ab2('0x53')](handleEntityNotFound(_0x23f662,null))['then'](function(_0x15367d){if(_0x15367d){_0x5af1d6[_0x6ab2('0x28')]=_0x15367d['get']({'plain':!![]});return db[_0x6ab2('0x64')][_0x6ab2('0x58')]({'where':{'id':_0x15367d['ChatInteractionId']}});}return null;})[_0x6ab2('0x53')](handleEntityNotFound(_0x23f662,null))[_0x6ab2('0x53')](function(_0x135524){if(_0x135524){_0x5af1d6[_0x6ab2('0x68')]=_0x135524[_0x6ab2('0x63')]({'plain':!![]});interaction_log['info'](_0x6ab2('0x82'),_0x556e6d[_0x6ab2('0x6a')]['id'],_0x556e6d[_0x6ab2('0x6a')]['name'],_0x556e6d[_0x6ab2('0x6a')][_0x6ab2('0x83')],_0x5af1d6[_0x6ab2('0x68')]['id'],_0x556e6d[_0x6ab2('0x59')]?JSON['stringify'](_0x556e6d[_0x6ab2('0x59')]):_0x6ab2('0x6b'));return respondWithRpcPromise(_0x6ab2('0x84'),'rejectMessage',_0x5af1d6);}return null;})[_0x6ab2('0x53')](function(_0x12e844){var _0x329852='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x12e844[_0x6ab2('0x28')][_0x6ab2('0x6e')];return db[_0x6ab2('0x6f')][_0x6ab2('0x40')](_0x329852,{'type':db[_0x6ab2('0x70')][_0x6ab2('0x71')][_0x6ab2('0x72')],'raw':!![]})[_0x6ab2('0x53')](function(_0x4c6764){return _0x4c6764;});})[_0x6ab2('0x53')](function(_0x10abbd){if(_0x10abbd){_0x5af1d6[_0x6ab2('0x28')][_0x6ab2('0x73')]=_0x10abbd[0x0];if(!_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')])return;return db['User'][_0x6ab2('0x58')]({'where':{'id':_0x556e6d[_0x6ab2('0x59')][_0x6ab2('0x61')],'role':_0x6ab2('0x62')},'attributes':['id','name',_0x6ab2('0x75'),'email','internal'],'raw':!![]});}return null;})[_0x6ab2('0x53')](function(_0x380ae9){if(!_0x380ae9)return null;_0x5af1d6[_0x6ab2('0x28')]['agent']=_0x380ae9;return _0x5af1d6;})['then'](function(_0x42fbbc){if(_0x42fbbc){_0x42fbbc[_0x6ab2('0x28')]['interface']=util[_0x6ab2('0x5f')](_0x6ab2('0x79'),_0x556e6d[_0x6ab2('0x6a')][_0x6ab2('0x39')]);_0x42fbbc['message']['channel']=_0x5af1d6[_0x6ab2('0x7a')];_0x42fbbc[_0x6ab2('0x28')][_0x6ab2('0x7b')]=_0x5af1d6[_0x6ab2('0x7a')];_0x42fbbc[_0x6ab2('0x28')][_0x6ab2('0x7c')]='reject';respondWithRpcPromise(_0x6ab2('0x7e'),_0x6ab2('0x7e'),{'event':_0x6ab2('0x85'),'message':_[_0x6ab2('0x4c')](_0x5af1d6['message'],JSON[_0x6ab2('0x80')](_0x5af1d6[_0x6ab2('0x68')][_0x6ab2('0x81')]))},client9002);return _0x5af1d6;}return null;})[_0x6ab2('0x53')](respondWithResult(_0x23f662,null))[_0x6ab2('0x29')](handleError(_0x23f662,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 963be79..c6f203e 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 _0xc0b9=['ChatMessage','save','update','remove','emit','hook','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc0b9,0xfc));var _0x9c0b=function(_0x4f570c,_0xca2743){_0x4f570c=_0x4f570c-0x0;var _0x73ac01=_0xc0b9[_0x4f570c];return _0x73ac01;};'use strict';var EventEmitter=require('events');var ChatMessage=require('../../mysqldb')['db'][_0x9c0b('0x0')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9c0b('0x1'),'afterUpdate':_0x9c0b('0x2'),'afterDestroy':_0x9c0b('0x3')};function emitEvent(_0x2f76a4){return function(_0x4e9db8,_0x46933e,_0x48a10c){ChatMessageEvents[_0x9c0b('0x4')](_0x2f76a4+':'+_0x4e9db8['id'],_0x4e9db8);ChatMessageEvents[_0x9c0b('0x4')](_0x2f76a4,_0x4e9db8);_0x48a10c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x9c0b('0x5')](e,emitEvent(event));}}module[_0x9c0b('0x6')]=ChatMessageEvents; \ No newline at end of file +var _0x5473=['../../mysqldb','ChatMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x521e8d,_0x23a290){var _0x518bbd=function(_0x4241eb){while(--_0x4241eb){_0x521e8d['push'](_0x521e8d['shift']());}};_0x518bbd(++_0x23a290);}(_0x5473,0x1ad));var _0x3547=function(_0x39b316,_0x3def1e){_0x39b316=_0x39b316-0x0;var _0x182ab1=_0x5473[_0x39b316];return _0x182ab1;};'use strict';var EventEmitter=require(_0x3547('0x0'));var ChatMessage=require(_0x3547('0x1'))['db'][_0x3547('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3547('0x3')](0x0);var events={'afterCreate':_0x3547('0x4'),'afterUpdate':_0x3547('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4fbb04){return function(_0x3d1aaf,_0xe225b9,_0x2d038a){ChatMessageEvents[_0x3547('0x6')](_0x4fbb04+':'+_0x3d1aaf['id'],_0x3d1aaf);ChatMessageEvents['emit'](_0x4fbb04,_0x3d1aaf);_0x2d038a(null);};}for(var e in events){if(events[_0x3547('0x7')](e)){var event=events[e];ChatMessage[_0x3547('0x8')](e,emitEvent(event));}}module[_0x3547('0x9')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index da580bb..4a48b98 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 _0x86c9=['findOne','update','createdAt','catch','error','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','out','isNil','ChatInteraction'];(function(_0x144ef5,_0x2246b5){var _0x587f9d=function(_0x4e95cc){while(--_0x4e95cc){_0x144ef5['push'](_0x144ef5['shift']());}};_0x587f9d(++_0x2246b5);}(_0x86c9,0x100));var _0x986c=function(_0x2c9089,_0x11d04b){_0x2c9089=_0x2c9089-0x0;var _0x4e006b=_0x86c9[_0x2c9089];return _0x4e006b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x986c('0x0'))(_0x986c('0x1'));var moment=require(_0x986c('0x2'));var BPromise=require(_0x986c('0x3'));var rp=require(_0x986c('0x4'));var fs=require('fs');var path=require(_0x986c('0x5'));var rimraf=require('rimraf');var config=require(_0x986c('0x6'));var attributes=require(_0x986c('0x7'));module['exports']=function(_0x12ff24,_0x307654){return _0x12ff24['define'](_0x986c('0x8'),attributes,{'tableName':_0x986c('0x9'),'paranoid':![],'indexes':[{'name':_0x986c('0xa'),'fields':[_0x986c('0xb')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1ef5b3,_0x442b34,_0x1e3e3f){var _0x82e6ee=_0x12ff24[_0x986c('0xc')];var _0x81984c=_0x1ef5b3[_0x986c('0xd')]({'plain':!![]});if(_0x81984c[_0x986c('0xe')]['toLowerCase']()==='in'||_0x81984c[_0x986c('0xe')][_0x986c('0xf')]()===_0x986c('0x10')&&!_0x81984c['secret']&&!_[_0x986c('0x11')](_0x81984c['UserId'])){_0x82e6ee[_0x986c('0x12')][_0x986c('0x13')]({'where':{'id':_0x81984c['ChatInteractionId']}})['then'](function(_0x4832cd){if(_0x4832cd){_0x4832cd[_0x986c('0x14')]({'lastMsgAt':_0x81984c[_0x986c('0x15')],'lastMsgDirection':_0x81984c[_0x986c('0xe')][_0x986c('0xf')]()});}})[_0x986c('0x16')](function(_0x4326c8){console[_0x986c('0x17')](_0x4326c8);});}_0x1e3e3f();}},'charset':'utf8mb4','collate':_0x986c('0x18')});}; \ No newline at end of file +var _0xdc25=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','ChatMessage','chat_messages','fti_chat_messages','body','models','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xdc25,0x135));var _0x5dc2=function(_0x3b58b9,_0x486630){_0x3b58b9=_0x3b58b9-0x0;var _0x667ba4=_0xdc25[_0x3b58b9];return _0x667ba4;};'use strict';var _=require(_0x5dc2('0x0'));var util=require('util');var logger=require(_0x5dc2('0x1'))(_0x5dc2('0x2'));var moment=require(_0x5dc2('0x3'));var BPromise=require(_0x5dc2('0x4'));var rp=require(_0x5dc2('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5dc2('0x6'));var config=require(_0x5dc2('0x7'));var attributes=require('./chatMessage.attributes');module[_0x5dc2('0x8')]=function(_0x256670,_0x1bac4f){return _0x256670['define'](_0x5dc2('0x9'),attributes,{'tableName':_0x5dc2('0xa'),'paranoid':![],'indexes':[{'name':_0x5dc2('0xb'),'fields':[_0x5dc2('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3a1590,_0x433717,_0x375356){var _0x352cc2=_0x256670[_0x5dc2('0xd')];var _0x4aa490=_0x3a1590['get']({'plain':!![]});if(_0x4aa490[_0x5dc2('0xe')][_0x5dc2('0xf')]()==='in'||_0x4aa490[_0x5dc2('0xe')]['toLowerCase']()===_0x5dc2('0x10')&&!_0x4aa490['secret']&&!_[_0x5dc2('0x11')](_0x4aa490[_0x5dc2('0x12')])){_0x352cc2['ChatInteraction'][_0x5dc2('0x13')]({'where':{'id':_0x4aa490[_0x5dc2('0x14')]}})[_0x5dc2('0x15')](function(_0x4fd9d7){if(_0x4fd9d7){_0x4fd9d7[_0x5dc2('0x16')]({'lastMsgAt':_0x4aa490[_0x5dc2('0x17')],'lastMsgDirection':_0x4aa490[_0x5dc2('0xe')][_0x5dc2('0xf')]()});}})[_0x5dc2('0x18')](function(_0x2e2d47){console['error'](_0x2e2d47);});}_0x375356();}},'charset':'utf8mb4','collate':_0x5dc2('0x19')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 456eb3a..31b16f9 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 _0xf011=['raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','then','ChatMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateChatMessage','ChatMessage','create','options'];(function(_0x98e896,_0x2292a7){var _0x2448a9=function(_0x26ecbb){while(--_0x26ecbb){_0x98e896['push'](_0x98e896['shift']());}};_0x2448a9(++_0x2292a7);}(_0xf011,0x1ae));var _0x1f01=function(_0x31066b,_0x4d515d){_0x31066b=_0x31066b-0x0;var _0x52e02d=_0xf011[_0x31066b];return _0x52e02d;};'use strict';var _=require(_0x1f01('0x0'));var util=require(_0x1f01('0x1'));var moment=require(_0x1f01('0x2'));var BPromise=require(_0x1f01('0x3'));var rs=require(_0x1f01('0x4'));var fs=require('fs');var Redis=require(_0x1f01('0x5'));var db=require(_0x1f01('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f01('0x7'));var config=require(_0x1f01('0x8'));var jayson=require(_0x1f01('0x9'));var client=jayson[_0x1f01('0xa')][_0x1f01('0xb')]({'port':0x232a});config[_0x1f01('0xc')]=_[_0x1f01('0xd')](config[_0x1f01('0xc')],{'host':_0x1f01('0xe'),'port':0x18eb});var socket=require(_0x1f01('0xf'))(new Redis(config[_0x1f01('0xc')]));require(_0x1f01('0x10'))['register'](socket);function respondWithRpcPromise(_0x3a4e23,_0x4e630d,_0x46cadb){return new BPromise(function(_0x544ae1,_0x2f3f3c){return client['request'](_0x3a4e23,_0x46cadb)[_0x1f01('0x11')](function(_0x4a8d9f){logger['info'](_0x1f01('0x12'),_0x4e630d,'request\x20sent');logger[_0x1f01('0x13')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4e630d,_0x1f01('0x14'),JSON[_0x1f01('0x15')](_0x4a8d9f));if(_0x4a8d9f['error']){if(_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x17')]===0x1f4){logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x4a8d9f['error']['message']);return _0x2f3f3c(_0x4a8d9f[_0x1f01('0x16')]['message']);}logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x18')]);return _0x544ae1(_0x4a8d9f[_0x1f01('0x16')][_0x1f01('0x18')]);}else{logger[_0x1f01('0x19')]('ChatMessage,\x20%s,\x20%s',_0x4e630d,_0x1f01('0x14'));_0x544ae1(_0x4a8d9f[_0x1f01('0x1a')][_0x1f01('0x18')]);}})[_0x1f01('0x1b')](function(_0x1b4af8){logger[_0x1f01('0x16')](_0x1f01('0x12'),_0x4e630d,_0x1b4af8);_0x2f3f3c(_0x1b4af8);});});}exports[_0x1f01('0x1c')]=function(_0x384805){var _0x1b7228=this;return new Promise(function(_0x28bb0d,_0x398be7){return db[_0x1f01('0x1d')][_0x1f01('0x1e')](_0x384805['body'],{'raw':_0x384805[_0x1f01('0x1f')]?_0x384805[_0x1f01('0x1f')][_0x1f01('0x20')]===undefined?!![]:![]:!![]})[_0x1f01('0x11')](function(_0x4e70fa){logger[_0x1f01('0x19')]('CreateChatMessage',_0x384805);logger[_0x1f01('0x13')]('CreateChatMessage',_0x384805,JSON['stringify'](_0x4e70fa));_0x28bb0d(_0x4e70fa);})['catch'](function(_0x757cce){logger['error'](_0x1f01('0x1c'),_0x757cce[_0x1f01('0x18')],_0x384805);_0x398be7(_0x1b7228[_0x1f01('0x16')](0x1f4,_0x757cce[_0x1f01('0x18')]));});});}; \ No newline at end of file +var _0xb754=['result','ChatMessage','create','body','options','raw','CreateChatMessage','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xb754,0x1f2));var _0x4b75=function(_0x2e748c,_0x55ec8e){_0x2e748c=_0x2e748c-0x0;var _0x37e219=_0xb754[_0x2e748c];return _0x37e219;};'use strict';var _=require(_0x4b75('0x0'));var util=require(_0x4b75('0x1'));var moment=require(_0x4b75('0x2'));var BPromise=require(_0x4b75('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4b75('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4b75('0x5'));var logger=require(_0x4b75('0x6'))(_0x4b75('0x7'));var config=require(_0x4b75('0x8'));var jayson=require(_0x4b75('0x9'));var client=jayson[_0x4b75('0xa')]['http']({'port':0x232a});config[_0x4b75('0xb')]=_[_0x4b75('0xc')](config[_0x4b75('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b75('0xd'))(new Redis(config[_0x4b75('0xb')]));require(_0x4b75('0xe'))[_0x4b75('0xf')](socket);function respondWithRpcPromise(_0xd3b609,_0x475745,_0x2b5014){return new BPromise(function(_0x56a253,_0x157598){return client[_0x4b75('0x10')](_0xd3b609,_0x2b5014)[_0x4b75('0x11')](function(_0x455745){logger[_0x4b75('0x12')](_0x4b75('0x13'),_0x475745,_0x4b75('0x14'));logger[_0x4b75('0x15')](_0x4b75('0x16'),_0x475745,_0x4b75('0x14'),JSON[_0x4b75('0x17')](_0x455745));if(_0x455745['error']){if(_0x455745[_0x4b75('0x18')][_0x4b75('0x19')]===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x475745,_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);return _0x157598(_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);}logger[_0x4b75('0x18')](_0x4b75('0x13'),_0x475745,_0x455745[_0x4b75('0x18')][_0x4b75('0x1a')]);return _0x56a253(_0x455745['error'][_0x4b75('0x1a')]);}else{logger[_0x4b75('0x12')](_0x4b75('0x13'),_0x475745,'request\x20sent');_0x56a253(_0x455745[_0x4b75('0x1b')]['message']);}})['catch'](function(_0x528680){logger[_0x4b75('0x18')](_0x4b75('0x13'),_0x475745,_0x528680);_0x157598(_0x528680);});});}exports['CreateChatMessage']=function(_0x1ca56b){var _0x542814=this;return new Promise(function(_0x154f90,_0x2d3d17){return db[_0x4b75('0x1c')][_0x4b75('0x1d')](_0x1ca56b[_0x4b75('0x1e')],{'raw':_0x1ca56b[_0x4b75('0x1f')]?_0x1ca56b[_0x4b75('0x1f')][_0x4b75('0x20')]===undefined?!![]:![]:!![]})[_0x4b75('0x11')](function(_0x42377e){logger[_0x4b75('0x12')](_0x4b75('0x21'),_0x1ca56b);logger['debug'](_0x4b75('0x21'),_0x1ca56b,JSON[_0x4b75('0x17')](_0x42377e));_0x154f90(_0x42377e);})[_0x4b75('0x22')](function(_0x5f08e6){logger[_0x4b75('0x18')](_0x4b75('0x21'),_0x5f08e6['message'],_0x1ca56b);_0x2d3d17(_0x542814[_0x4b75('0x18')](0x1f4,_0x5f08e6[_0x4b75('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 5919015..74d0a46 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 _0xecb2=['chatMessage:','./chatMessage.events','update','emit','removeListener','register','length'];(function(_0x389933,_0x4fbee9){var _0x3f18a8=function(_0x2e7473){while(--_0x2e7473){_0x389933['push'](_0x389933['shift']());}};_0x3f18a8(++_0x4fbee9);}(_0xecb2,0xf6));var _0x2ecb=function(_0x28d19e,_0x4e20a6){_0x28d19e=_0x28d19e-0x0;var _0x1a94c5=_0xecb2[_0x28d19e];return _0x1a94c5;};'use strict';var ChatMessageEvents=require(_0x2ecb('0x0'));var events=['save','remove',_0x2ecb('0x1')];function createListener(_0x548b3c,_0x59d894){return function(_0x1bb230){_0x59d894[_0x2ecb('0x2')](_0x548b3c,_0x1bb230);};}function removeListener(_0x393e7c,_0x2a4fe5){return function(){ChatMessageEvents[_0x2ecb('0x3')](_0x393e7c,_0x2a4fe5);};}exports[_0x2ecb('0x4')]=function(_0x4c169f){for(var _0x51b28c=0x0,_0x49de99=events[_0x2ecb('0x5')];_0x51b28c<_0x49de99;_0x51b28c++){var _0x3df4a0=events[_0x51b28c];var _0x15a959=createListener(_0x2ecb('0x6')+_0x3df4a0,_0x4c169f);ChatMessageEvents['on'](_0x3df4a0,_0x15a959);}}; \ No newline at end of file +var _0x99c9=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','update'];(function(_0x2026cd,_0x2ab9fe){var _0x3ed4b1=function(_0x51e11c){while(--_0x51e11c){_0x2026cd['push'](_0x2026cd['shift']());}};_0x3ed4b1(++_0x2ab9fe);}(_0x99c9,0x13c));var _0x999c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x99c9[_0x57b54c];return _0x59cc19;};'use strict';var ChatMessageEvents=require(_0x999c('0x0'));var events=[_0x999c('0x1'),_0x999c('0x2'),_0x999c('0x3')];function createListener(_0x2bb83d,_0x16a7a3){return function(_0x31e9b1){_0x16a7a3['emit'](_0x2bb83d,_0x31e9b1);};}function removeListener(_0x2a4e06,_0x140cd5){return function(){ChatMessageEvents[_0x999c('0x4')](_0x2a4e06,_0x140cd5);};}exports[_0x999c('0x5')]=function(_0x2bdd73){for(var _0x14df32=0x0,_0x34f100=events[_0x999c('0x6')];_0x14df32<_0x34f100;_0x14df32++){var _0xc8a6b5=events[_0x14df32];var _0xb88ec1=createListener(_0x999c('0x7')+_0xc8a6b5,_0x2bdd73);ChatMessageEvents['on'](_0xc8a6b5,_0xb88ec1);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 61cd0f6..e46c3ae 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 _0x480d=['reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','chat','chatmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x480d,0x148));var _0xd480=function(_0x48f376,_0x206737){_0x48f376=_0x48f376-0x0;var _0x2c176d=_0x480d[_0x48f376];return _0x2c176d;};'use strict';var multer=require(_0xd480('0x0'));var util=require(_0xd480('0x1'));var path=require(_0xd480('0x2'));var timeout=require(_0xd480('0x3'));var express=require(_0xd480('0x4'));var router=express[_0xd480('0x5')]();var fs_extra=require(_0xd480('0x6'));var auth=require(_0xd480('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xd480('0x8'));var controller=require(_0xd480('0x9'));router[_0xd480('0xa')]('/',auth[_0xd480('0xb')](),controller['index']);router[_0xd480('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xd480('0xc')]);router[_0xd480('0xa')](_0xd480('0xd'),auth[_0xd480('0xb')](),controller[_0xd480('0xe')]);router[_0xd480('0xf')]('/',auth[_0xd480('0xb')](),interaction['tracked'](_0xd480('0x10'),_0xd480('0x11')),controller['create']);router[_0xd480('0x12')](_0xd480('0xd'),controller[_0xd480('0x13')]);router[_0xd480('0x12')](_0xd480('0x14'),auth[_0xd480('0xb')](),controller[_0xd480('0x15')]);router[_0xd480('0x12')](_0xd480('0x16'),auth[_0xd480('0xb')](),controller[_0xd480('0x17')]);router[_0xd480('0x18')](_0xd480('0xd'),auth[_0xd480('0xb')](),controller[_0xd480('0x19')]);module[_0xd480('0x1a')]=router; \ No newline at end of file +var _0xe515=['multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','tracked','chatmessage:create','put','update','/:id/accept','accept','reject','destroy','exports'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xe515,0xa8));var _0x5e51=function(_0x257ebc,_0x1980f8){_0x257ebc=_0x257ebc-0x0;var _0x357853=_0xe515[_0x257ebc];return _0x357853;};'use strict';var multer=require(_0x5e51('0x0'));var util=require(_0x5e51('0x1'));var path=require(_0x5e51('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e51('0x3'));var router=express[_0x5e51('0x4')]();var fs_extra=require(_0x5e51('0x5'));var auth=require(_0x5e51('0x6'));var interaction=require(_0x5e51('0x7'));var config=require(_0x5e51('0x8'));var controller=require('./chatMessage.controller');router[_0x5e51('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5e51('0x9')](_0x5e51('0xa'),auth[_0x5e51('0xb')](),controller[_0x5e51('0xc')]);router[_0x5e51('0x9')](_0x5e51('0xd'),auth['isAuthenticated'](),controller[_0x5e51('0xe')]);router['post']('/',auth[_0x5e51('0xb')](),interaction[_0x5e51('0xf')]('chat',_0x5e51('0x10')),controller['create']);router[_0x5e51('0x11')](_0x5e51('0xd'),controller[_0x5e51('0x12')]);router[_0x5e51('0x11')](_0x5e51('0x13'),auth[_0x5e51('0xb')](),controller[_0x5e51('0x14')]);router[_0x5e51('0x11')]('/:id/reject',auth[_0x5e51('0xb')](),controller[_0x5e51('0x15')]);router['delete'](_0x5e51('0xd'),auth[_0x5e51('0xb')](),controller[_0x5e51('0x16')]);module[_0x5e51('0x17')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index a2a8025..e1b7d95 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 _0x4fac=['sequelize','TEXT','medium'];(function(_0x15c43f,_0x27fb5a){var _0x2e39a7=function(_0x39e507){while(--_0x39e507){_0x15c43f['push'](_0x15c43f['shift']());}};_0x2e39a7(++_0x27fb5a);}(_0x4fac,0xed));var _0xc4fa=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4fac[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xc4fa('0x0'));module['exports']={'body':{'type':Sequelize[_0xc4fa('0x1')](_0xc4fa('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0xa547=['exports','medium'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa547,0xb0));var _0x7a54=function(_0x50eca6,_0x12503d){_0x50eca6=_0x50eca6-0x0;var _0x590de9=_0xa547[_0x50eca6];return _0x590de9;};'use strict';var Sequelize=require('sequelize');module[_0x7a54('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7a54('0x1')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 7af67a8..ca5d223 100644 --- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js +++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x7a54,0x106));var _0x47a5=function(_0x43adf0,_0x5821aa){_0x43adf0=_0x43adf0-0x0;var _0x3a3ee4=_0x7a54[_0x43adf0];return _0x3a3ee4;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file +var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x20edab,_0xa37335){var _0x3f761d=function(_0x39a846){while(--_0x39a846){_0x20edab['push'](_0x20edab['shift']());}};_0x3f761d(++_0xa37335);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index f33a4fe..4cf8a8e 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 _0x3ae6=['../../config/environment','exports','chat_offline_messages','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0x1250f1,_0x275ba5){var _0x590580=function(_0x545b73){while(--_0x545b73){_0x1250f1['push'](_0x1250f1['shift']());}};_0x590580(++_0x275ba5);}(_0x3ae6,0x159));var _0x63ae=function(_0x38f106,_0x25bd5b){_0x38f106=_0x38f106-0x0;var _0x3cb829=_0x3ae6[_0x38f106];return _0x3cb829;};'use strict';var _=require(_0x63ae('0x0'));var util=require(_0x63ae('0x1'));var logger=require(_0x63ae('0x2'))('api');var moment=require('moment');var BPromise=require(_0x63ae('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63ae('0x4'));var rimraf=require(_0x63ae('0x5'));var config=require(_0x63ae('0x6'));var attributes=require('./chatOfflineMessage.attributes');module[_0x63ae('0x7')]=function(_0x3d341c,_0x2cadad){return _0x3d341c['define']('ChatOfflineMessage',attributes,{'tableName':_0x63ae('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x20c5=['../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x17f716,_0x4a06c7){var _0x31f0de=function(_0x5476e4){while(--_0x5476e4){_0x17f716['push'](_0x17f716['shift']());}};_0x31f0de(++_0x4a06c7);}(_0x20c5,0xd7));var _0x520c=function(_0x14f8ef,_0x1b1107){_0x14f8ef=_0x14f8ef-0x0;var _0x3b97f6=_0x20c5[_0x14f8ef];return _0x3b97f6;};'use strict';var _=require(_0x520c('0x0'));var util=require(_0x520c('0x1'));var logger=require(_0x520c('0x2'))(_0x520c('0x3'));var moment=require(_0x520c('0x4'));var BPromise=require(_0x520c('0x5'));var rp=require(_0x520c('0x6'));var fs=require('fs');var path=require(_0x520c('0x7'));var rimraf=require(_0x520c('0x8'));var config=require(_0x520c('0x9'));var attributes=require(_0x520c('0xa'));module[_0x520c('0xb')]=function(_0xe079cb,_0x3e175f){return _0xe079cb[_0x520c('0xc')](_0x520c('0xd'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x520c('0xe'),'collate':_0x520c('0xf')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 39c1825..d9fb94b 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 _0xa5e3=['result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xa5e3,0x86));var _0x3a5e=function(_0x5c63c7,_0xa34f6){_0x5c63c7=_0x5c63c7-0x0;var _0x43943e=_0xa5e3[_0x5c63c7];return _0x43943e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3a5e('0x0'));var BPromise=require(_0x3a5e('0x1'));var rs=require(_0x3a5e('0x2'));var fs=require('fs');var Redis=require(_0x3a5e('0x3'));var db=require(_0x3a5e('0x4'))['db'];var utils=require(_0x3a5e('0x5'));var logger=require(_0x3a5e('0x6'))('rpc');var config=require(_0x3a5e('0x7'));var jayson=require(_0x3a5e('0x8'));var client=jayson[_0x3a5e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x34fa64,_0x5ddc7b,_0x4b0e8c){return new BPromise(function(_0x261d14,_0x2da184){return client[_0x3a5e('0xa')](_0x34fa64,_0x4b0e8c)[_0x3a5e('0xb')](function(_0x534bf2){logger[_0x3a5e('0xc')](_0x3a5e('0xd'),_0x5ddc7b,_0x3a5e('0xe'));logger[_0x3a5e('0xf')](_0x3a5e('0x10'),_0x5ddc7b,_0x3a5e('0xe'),JSON['stringify'](_0x534bf2));if(_0x534bf2[_0x3a5e('0x11')]){if(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x12')]===0x1f4){logger['error'](_0x3a5e('0xd'),_0x5ddc7b,_0x534bf2['error']['message']);return _0x2da184(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);}logger[_0x3a5e('0x11')](_0x3a5e('0xd'),_0x5ddc7b,_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);return _0x261d14(_0x534bf2[_0x3a5e('0x11')][_0x3a5e('0x13')]);}else{logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x5ddc7b,_0x3a5e('0xe'));_0x261d14(_0x534bf2[_0x3a5e('0x14')][_0x3a5e('0x13')]);}})[_0x3a5e('0x15')](function(_0x5c975a){logger[_0x3a5e('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x5ddc7b,_0x5c975a);_0x2da184(_0x5c975a);});});} \ No newline at end of file +var _0xbd15=['ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatOfflineMessage,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug'];(function(_0x5213be,_0x431d8d){var _0x2efdfe=function(_0x8048db){while(--_0x8048db){_0x5213be['push'](_0x5213be['shift']());}};_0x2efdfe(++_0x431d8d);}(_0xbd15,0x102));var _0x5bd1=function(_0x32cd29,_0x29f6bb){_0x32cd29=_0x32cd29-0x0;var _0x2f7e6e=_0xbd15[_0x32cd29];return _0x2f7e6e;};'use strict';var _=require(_0x5bd1('0x0'));var util=require(_0x5bd1('0x1'));var moment=require(_0x5bd1('0x2'));var BPromise=require(_0x5bd1('0x3'));var rs=require(_0x5bd1('0x4'));var fs=require('fs');var Redis=require(_0x5bd1('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5bd1('0x6'))(_0x5bd1('0x7'));var config=require(_0x5bd1('0x8'));var jayson=require(_0x5bd1('0x9'));var client=jayson[_0x5bd1('0xa')][_0x5bd1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2c437a,_0x447896,_0x219439){return new BPromise(function(_0x2450e2,_0x3ed881){return client[_0x5bd1('0xc')](_0x2c437a,_0x219439)[_0x5bd1('0xd')](function(_0x2a8df3){logger[_0x5bd1('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x5bd1('0xf'));logger[_0x5bd1('0x10')](_0x5bd1('0x11'),_0x447896,_0x5bd1('0xf'),JSON[_0x5bd1('0x12')](_0x2a8df3));if(_0x2a8df3[_0x5bd1('0x13')]){if(_0x2a8df3['error'][_0x5bd1('0x14')]===0x1f4){logger[_0x5bd1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x2a8df3[_0x5bd1('0x13')]['message']);return _0x3ed881(_0x2a8df3[_0x5bd1('0x13')][_0x5bd1('0x15')]);}logger[_0x5bd1('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x447896,_0x2a8df3['error']['message']);return _0x2450e2(_0x2a8df3[_0x5bd1('0x13')][_0x5bd1('0x15')]);}else{logger[_0x5bd1('0xe')](_0x5bd1('0x16'),_0x447896,_0x5bd1('0xf'));_0x2450e2(_0x2a8df3[_0x5bd1('0x17')]['message']);}})[_0x5bd1('0x18')](function(_0x170d27){logger['error'](_0x5bd1('0x16'),_0x447896,_0x170d27);_0x3ed881(_0x170d27);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 06a3680..3dc2864 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 _0x524e=['create','delete','/:id','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','show'];(function(_0x51601a,_0x47be4e){var _0x35b255=function(_0x44ef4c){while(--_0x44ef4c){_0x51601a['push'](_0x51601a['shift']());}};_0x35b255(++_0x47be4e);}(_0x524e,0x10e));var _0xe524=function(_0x2b059a,_0x289bba){_0x2b059a=_0x2b059a-0x0;var _0x40f05c=_0x524e[_0x2b059a];return _0x40f05c;};'use strict';var multer=require(_0xe524('0x0'));var util=require(_0xe524('0x1'));var path=require(_0xe524('0x2'));var timeout=require('connect-timeout');var express=require(_0xe524('0x3'));var router=express[_0xe524('0x4')]();var fs_extra=require(_0xe524('0x5'));var auth=require(_0xe524('0x6'));var interaction=require(_0xe524('0x7'));var config=require(_0xe524('0x8'));var controller=require(_0xe524('0x9'));router[_0xe524('0xa')]('/',auth[_0xe524('0xb')](),controller[_0xe524('0xc')]);router[_0xe524('0xa')](_0xe524('0xd'),auth[_0xe524('0xb')](),controller['describe']);router[_0xe524('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xe524('0xe')]);router['post']('/',auth[_0xe524('0xb')](),controller[_0xe524('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe524('0x10')](_0xe524('0x11'),auth[_0xe524('0xb')](),controller['destroy']);module[_0xe524('0x12')]=router; \ No newline at end of file +var _0x0aed=['./chatOfflineMessage.controller','get','index','/describe','describe','/:id','isAuthenticated','show','create','put','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x29da7f,_0xf8b1d9){var _0x4f0911=function(_0x4f80ec){while(--_0x4f80ec){_0x29da7f['push'](_0x29da7f['shift']());}};_0x4f0911(++_0xf8b1d9);}(_0x0aed,0x85));var _0xd0ae=function(_0x5296ee,_0x1c060f){_0x5296ee=_0x5296ee-0x0;var _0x374767=_0x0aed[_0x5296ee];return _0x374767;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd0ae('0x0'));var express=require(_0xd0ae('0x1'));var router=express[_0xd0ae('0x2')]();var fs_extra=require(_0xd0ae('0x3'));var auth=require(_0xd0ae('0x4'));var interaction=require(_0xd0ae('0x5'));var config=require(_0xd0ae('0x6'));var controller=require(_0xd0ae('0x7'));router[_0xd0ae('0x8')]('/',auth['isAuthenticated'](),controller[_0xd0ae('0x9')]);router['get'](_0xd0ae('0xa'),auth['isAuthenticated'](),controller[_0xd0ae('0xb')]);router['get'](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller[_0xd0ae('0xe')]);router['post']('/',auth[_0xd0ae('0xd')](),controller[_0xd0ae('0xf')]);router[_0xd0ae('0x10')](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller['update']);router[_0xd0ae('0x11')](_0xd0ae('0xc'),auth[_0xd0ae('0xd')](),controller[_0xd0ae('0x12')]);module[_0xd0ae('0x13')]=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index 060552d..375b7d7 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 _0x3eea=['timeout','INTEGER','sequelize','exports','STRING','mouseOver'];(function(_0x504fb4,_0x3a0bd4){var _0x288e7d=function(_0x31c591){while(--_0x31c591){_0x504fb4['push'](_0x504fb4['shift']());}};_0x288e7d(++_0x3a0bd4);}(_0x3eea,0x152));var _0xa3ee=function(_0x19795,_0x4a2c3f){_0x19795=_0x19795-0x0;var _0x8bfde=_0x3eea[_0x19795];return _0x8bfde;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module[_0xa3ee('0x1')]={'name':{'type':Sequelize[_0xa3ee('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xa3ee('0x3'),_0xa3ee('0x4')),'defaultValue':_0xa3ee('0x3')},'selector':{'type':Sequelize[_0xa3ee('0x2')]},'timeout':{'type':Sequelize[_0xa3ee('0x5')]}}; \ No newline at end of file +var _0x3450=['mouseOver','timeout','INTEGER','sequelize','STRING','ENUM'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x3450,0xe1));var _0x0345=function(_0x4ec0f7,_0xa1106f){_0x4ec0f7=_0x4ec0f7-0x0;var _0x34c64b=_0x3450[_0x4ec0f7];return _0x34c64b;};'use strict';var Sequelize=require(_0x0345('0x0'));module['exports']={'name':{'type':Sequelize[_0x0345('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x0345('0x2')](_0x0345('0x3'),_0x0345('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x0345('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 7d26e3d..fd22e2f 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 _0xf675=['length','includeAll','include','options','ChatProactiveAction','find','catch','create','body','params','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','show','model','keys','rawAttributes','query','filters','attributes','fields'];(function(_0x2234ed,_0x50c353){var _0x5df5b7=function(_0x5d0865){while(--_0x5d0865){_0x2234ed['push'](_0x2234ed['shift']());}};_0x5df5b7(++_0x50c353);}(_0xf675,0x199));var _0x5f67=function(_0x503cd5,_0x57774a){_0x503cd5=_0x503cd5-0x0;var _0x1fdf1e=_0xf675[_0x503cd5];return _0x1fdf1e;};'use strict';var emlformat=require(_0x5f67('0x0'));var rimraf=require(_0x5f67('0x1'));var zipdir=require(_0x5f67('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f67('0x3'));var moment=require('moment');var BPromise=require(_0x5f67('0x4'));var Mustache=require(_0x5f67('0x5'));var util=require(_0x5f67('0x6'));var path=require('path');var sox=require(_0x5f67('0x7'));var csv=require(_0x5f67('0x8'));var ejs=require(_0x5f67('0x9'));var fs=require('fs');var fs_extra=require(_0x5f67('0xa'));var _=require('lodash');var squel=require(_0x5f67('0xb'));var crypto=require(_0x5f67('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5f67('0x8'));var querystring=require(_0x5f67('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x5f67('0xe'));var qs=require(_0x5f67('0xf'));var as=require(_0x5f67('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x5f67('0x11'));var config=require(_0x5f67('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x5f67('0x13'))['db'];function respondWithStatusCode(_0x534d67,_0x4653c7){_0x4653c7=_0x4653c7||0xcc;return function(_0x49e27f){if(_0x49e27f){return _0x534d67[_0x5f67('0x14')](_0x4653c7);}return _0x534d67[_0x5f67('0x15')](_0x4653c7)[_0x5f67('0x16')]();};}function respondWithResult(_0x4ef1c6,_0x121c72){_0x121c72=_0x121c72||0xc8;return function(_0x59b8c6){if(_0x59b8c6){return _0x4ef1c6[_0x5f67('0x15')](_0x121c72)['json'](_0x59b8c6);}};}function respondWithFilteredResult(_0xfe718e,_0x50a146){return function(_0x1d1b15){if(_0x1d1b15){var _0x2ea6ad=typeof _0x50a146[_0x5f67('0x17')]===_0x5f67('0x18')&&typeof _0x50a146[_0x5f67('0x19')]===_0x5f67('0x18');var _0x3e3e2e=_0x1d1b15[_0x5f67('0x1a')];var _0xc539c6=_0x2ea6ad?0x0:_0x50a146[_0x5f67('0x17')];var _0x5275d6=_0x2ea6ad?_0x1d1b15['count']:_0x50a146[_0x5f67('0x17')]+_0x50a146[_0x5f67('0x19')];var _0x4fe826;if(_0x5275d6>=_0x3e3e2e){_0x5275d6=_0x3e3e2e;_0x4fe826=0xc8;}else{_0x4fe826=0xce;}_0xfe718e[_0x5f67('0x15')](_0x4fe826);return _0xfe718e[_0x5f67('0x1b')](_0x5f67('0x1c'),_0xc539c6+'-'+_0x5275d6+'/'+_0x3e3e2e)[_0x5f67('0x1d')](_0x1d1b15);}return null;};}function patchUpdates(_0x3261af){return function(_0x3d487b){try{jsonpatch[_0x5f67('0x1e')](_0x3d487b,_0x3261af,!![]);}catch(_0x3ca7d6){return BPromise[_0x5f67('0x1f')](_0x3ca7d6);}return _0x3d487b[_0x5f67('0x20')]();};}function saveUpdates(_0x412a41,_0x8d876e){return function(_0x531f2e){if(_0x531f2e){return _0x531f2e[_0x5f67('0x21')](_0x412a41)[_0x5f67('0x22')](function(_0x3e1930){return _0x3e1930;});}return null;};}function removeEntity(_0x5bb1de,_0x537b39){return function(_0x217cf9){if(_0x217cf9){return _0x217cf9[_0x5f67('0x23')]()['then'](function(){_0x5bb1de[_0x5f67('0x15')](0xcc)[_0x5f67('0x16')]();});}};}function handleEntityNotFound(_0x241d17,_0x2dc788){return function(_0x4b24de){if(!_0x4b24de){_0x241d17[_0x5f67('0x14')](0x194);}return _0x4b24de;};}function handleError(_0x4fad07,_0x31b02e){_0x31b02e=_0x31b02e||0x1f4;return function(_0x167601){logger['error'](_0x167601[_0x5f67('0x24')]);if(_0x167601[_0x5f67('0x25')]){delete _0x167601['name'];}_0x4fad07['status'](_0x31b02e)[_0x5f67('0x26')](_0x167601);};}exports[_0x5f67('0x27')]=function(_0x32830d,_0x5dd8d7){var _0x3491b0={'raw':!![],'where':{'id':_0x32830d['params']['id']}},_0xd36b79={};_0xd36b79[_0x5f67('0x28')]=_[_0x5f67('0x29')](db['ChatProactiveAction'][_0x5f67('0x2a')]);_0xd36b79['query']=_[_0x5f67('0x29')](_0x32830d[_0x5f67('0x2b')]);_0xd36b79[_0x5f67('0x2c')]=_['intersection'](_0xd36b79['model'],_0xd36b79['query']);_0x3491b0[_0x5f67('0x2d')]=_['intersection'](_0xd36b79[_0x5f67('0x28')],qs[_0x5f67('0x2e')](_0x32830d[_0x5f67('0x2b')][_0x5f67('0x2e')]));_0x3491b0['attributes']=_0x3491b0['attributes'][_0x5f67('0x2f')]?_0x3491b0[_0x5f67('0x2d')]:_0xd36b79[_0x5f67('0x28')];if(_0x32830d[_0x5f67('0x2b')][_0x5f67('0x30')]){_0x3491b0[_0x5f67('0x31')]=[{'all':!![]}];}_0x3491b0=_['merge']({},_0x3491b0,_0x32830d[_0x5f67('0x32')]);return db[_0x5f67('0x33')][_0x5f67('0x34')](_0x3491b0)[_0x5f67('0x22')](handleEntityNotFound(_0x5dd8d7,null))[_0x5f67('0x22')](respondWithResult(_0x5dd8d7,null))[_0x5f67('0x35')](handleError(_0x5dd8d7,null));};exports['create']=function(_0x3fbcc9,_0xdfdb8b){return db['ChatProactiveAction'][_0x5f67('0x36')](_0x3fbcc9[_0x5f67('0x37')],{})[_0x5f67('0x22')](respondWithResult(_0xdfdb8b,0xc9))[_0x5f67('0x35')](handleError(_0xdfdb8b,null));};exports[_0x5f67('0x21')]=function(_0x314d14,_0x2fa4ad){if(_0x314d14[_0x5f67('0x37')]['id']){delete _0x314d14[_0x5f67('0x37')]['id'];}return db[_0x5f67('0x33')][_0x5f67('0x34')]({'where':{'id':_0x314d14['params']['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x2fa4ad,null))[_0x5f67('0x22')](saveUpdates(_0x314d14[_0x5f67('0x37')],null))['then'](respondWithResult(_0x2fa4ad,null))[_0x5f67('0x35')](handleError(_0x2fa4ad,null));};exports[_0x5f67('0x23')]=function(_0x1404d1,_0x2ad244){return db[_0x5f67('0x33')][_0x5f67('0x34')]({'where':{'id':_0x1404d1[_0x5f67('0x38')]['id']}})[_0x5f67('0x22')](handleEntityNotFound(_0x2ad244,null))[_0x5f67('0x22')](removeEntity(_0x2ad244,null))['catch'](handleError(_0x2ad244,null));}; \ No newline at end of file +var _0xf873=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','stack','name','send','show','params','model','keys','ChatProactiveAction','query','filters','attributes','intersection','fields','length','includeAll','include','merge','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2bb276,_0x2a28f1){var _0x1ea21c=function(_0x1153ba){while(--_0x1153ba){_0x2bb276['push'](_0x2bb276['shift']());}};_0x1ea21c(++_0x2a28f1);}(_0xf873,0xb2));var _0x3f87=function(_0x5cc5d7,_0x5da756){_0x5cc5d7=_0x5cc5d7-0x0;var _0x47633f=_0xf873[_0x5cc5d7];return _0x47633f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3f87('0x0'));var zipdir=require(_0x3f87('0x1'));var jsonpatch=require(_0x3f87('0x2'));var rp=require(_0x3f87('0x3'));var moment=require(_0x3f87('0x4'));var BPromise=require(_0x3f87('0x5'));var Mustache=require(_0x3f87('0x6'));var util=require(_0x3f87('0x7'));var path=require(_0x3f87('0x8'));var sox=require('sox');var csv=require(_0x3f87('0x9'));var ejs=require(_0x3f87('0xa'));var fs=require('fs');var fs_extra=require(_0x3f87('0xb'));var _=require('lodash');var squel=require(_0x3f87('0xc'));var crypto=require(_0x3f87('0xd'));var jsforce=require(_0x3f87('0xe'));var deskjs=require(_0x3f87('0xf'));var toCsv=require(_0x3f87('0x9'));var querystring=require(_0x3f87('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f87('0x11'));var authService=require(_0x3f87('0x12'));var qs=require(_0x3f87('0x13'));var as=require(_0x3f87('0x14'));var hardwareService=require(_0x3f87('0x15'));var logger=require(_0x3f87('0x16'))(_0x3f87('0x17'));var utils=require(_0x3f87('0x18'));var config=require(_0x3f87('0x19'));var licenseUtil=require(_0x3f87('0x1a'));var db=require(_0x3f87('0x1b'))['db'];function respondWithStatusCode(_0x593e9,_0xfd5b65){_0xfd5b65=_0xfd5b65||0xcc;return function(_0x160861){if(_0x160861){return _0x593e9['sendStatus'](_0xfd5b65);}return _0x593e9[_0x3f87('0x1c')](_0xfd5b65)[_0x3f87('0x1d')]();};}function respondWithResult(_0x4ea5c1,_0x1cfba3){_0x1cfba3=_0x1cfba3||0xc8;return function(_0x14324f){if(_0x14324f){return _0x4ea5c1[_0x3f87('0x1c')](_0x1cfba3)[_0x3f87('0x1e')](_0x14324f);}};}function respondWithFilteredResult(_0x3f192a,_0x1c8fb0){return function(_0xd6df66){if(_0xd6df66){var _0x2ccf4d=typeof _0x1c8fb0['offset']===_0x3f87('0x1f')&&typeof _0x1c8fb0[_0x3f87('0x20')]===_0x3f87('0x1f');var _0x4e1df8=_0xd6df66[_0x3f87('0x21')];var _0x56d79e=_0x2ccf4d?0x0:_0x1c8fb0[_0x3f87('0x22')];var _0x13550c=_0x2ccf4d?_0xd6df66[_0x3f87('0x21')]:_0x1c8fb0[_0x3f87('0x22')]+_0x1c8fb0[_0x3f87('0x20')];var _0x4fe75c;if(_0x13550c>=_0x4e1df8){_0x13550c=_0x4e1df8;_0x4fe75c=0xc8;}else{_0x4fe75c=0xce;}_0x3f192a[_0x3f87('0x1c')](_0x4fe75c);return _0x3f192a[_0x3f87('0x23')](_0x3f87('0x24'),_0x56d79e+'-'+_0x13550c+'/'+_0x4e1df8)[_0x3f87('0x1e')](_0xd6df66);}return null;};}function patchUpdates(_0x57f7c5){return function(_0x4acd30){try{jsonpatch['apply'](_0x4acd30,_0x57f7c5,!![]);}catch(_0x73aba6){return BPromise[_0x3f87('0x25')](_0x73aba6);}return _0x4acd30[_0x3f87('0x26')]();};}function saveUpdates(_0x5ed5f1,_0x17e411){return function(_0xb01673){if(_0xb01673){return _0xb01673[_0x3f87('0x27')](_0x5ed5f1)[_0x3f87('0x28')](function(_0x15fad7){return _0x15fad7;});}return null;};}function removeEntity(_0x46d773,_0x30b061){return function(_0xea7dda){if(_0xea7dda){return _0xea7dda[_0x3f87('0x29')]()[_0x3f87('0x28')](function(){_0x46d773[_0x3f87('0x1c')](0xcc)[_0x3f87('0x1d')]();});}};}function handleEntityNotFound(_0x5ca13a,_0x3d03d7){return function(_0x9ed827){if(!_0x9ed827){_0x5ca13a[_0x3f87('0x2a')](0x194);}return _0x9ed827;};}function handleError(_0x5922e9,_0x49674f){_0x49674f=_0x49674f||0x1f4;return function(_0x41f9e9){logger[_0x3f87('0x2b')](_0x41f9e9[_0x3f87('0x2c')]);if(_0x41f9e9[_0x3f87('0x2d')]){delete _0x41f9e9[_0x3f87('0x2d')];}_0x5922e9[_0x3f87('0x1c')](_0x49674f)[_0x3f87('0x2e')](_0x41f9e9);};}exports[_0x3f87('0x2f')]=function(_0x113e40,_0x2e18cb){var _0x43576d={'raw':!![],'where':{'id':_0x113e40[_0x3f87('0x30')]['id']}},_0x407828={};_0x407828[_0x3f87('0x31')]=_[_0x3f87('0x32')](db[_0x3f87('0x33')]['rawAttributes']);_0x407828[_0x3f87('0x34')]=_[_0x3f87('0x32')](_0x113e40[_0x3f87('0x34')]);_0x407828[_0x3f87('0x35')]=_['intersection'](_0x407828['model'],_0x407828['query']);_0x43576d[_0x3f87('0x36')]=_[_0x3f87('0x37')](_0x407828[_0x3f87('0x31')],qs[_0x3f87('0x38')](_0x113e40[_0x3f87('0x34')]['fields']));_0x43576d[_0x3f87('0x36')]=_0x43576d['attributes'][_0x3f87('0x39')]?_0x43576d[_0x3f87('0x36')]:_0x407828[_0x3f87('0x31')];if(_0x113e40[_0x3f87('0x34')][_0x3f87('0x3a')]){_0x43576d[_0x3f87('0x3b')]=[{'all':!![]}];}_0x43576d=_[_0x3f87('0x3c')]({},_0x43576d,_0x113e40['options']);return db['ChatProactiveAction'][_0x3f87('0x3d')](_0x43576d)[_0x3f87('0x28')](handleEntityNotFound(_0x2e18cb,null))[_0x3f87('0x28')](respondWithResult(_0x2e18cb,null))[_0x3f87('0x3e')](handleError(_0x2e18cb,null));};exports[_0x3f87('0x3f')]=function(_0x1068c4,_0x24bd09){return db['ChatProactiveAction'][_0x3f87('0x3f')](_0x1068c4['body'],{})[_0x3f87('0x28')](respondWithResult(_0x24bd09,0xc9))[_0x3f87('0x3e')](handleError(_0x24bd09,null));};exports[_0x3f87('0x27')]=function(_0x2d8399,_0x51a33d){if(_0x2d8399[_0x3f87('0x40')]['id']){delete _0x2d8399['body']['id'];}return db[_0x3f87('0x33')][_0x3f87('0x3d')]({'where':{'id':_0x2d8399[_0x3f87('0x30')]['id']}})[_0x3f87('0x28')](handleEntityNotFound(_0x51a33d,null))[_0x3f87('0x28')](saveUpdates(_0x2d8399['body'],null))['then'](respondWithResult(_0x51a33d,null))['catch'](handleError(_0x51a33d,null));};exports[_0x3f87('0x29')]=function(_0x1ca9be,_0x33c9f5){return db[_0x3f87('0x33')][_0x3f87('0x3d')]({'where':{'id':_0x1ca9be[_0x3f87('0x30')]['id']}})['then'](handleEntityNotFound(_0x33c9f5,null))[_0x3f87('0x28')](removeEntity(_0x33c9f5,null))['catch'](handleError(_0x33c9f5,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 7ab5820..c93a8e2 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 _0x9c10=['ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports'];(function(_0x27638d,_0x4094db){var _0x35da35=function(_0x538095){while(--_0x538095){_0x27638d['push'](_0x27638d['shift']());}};_0x35da35(++_0x4094db);}(_0x9c10,0x86));var _0x09c1=function(_0x6a6e6b,_0x2b90fc){_0x6a6e6b=_0x6a6e6b-0x0;var _0x5156a0=_0x9c10[_0x6a6e6b];return _0x5156a0;};'use strict';var _=require('lodash');var util=require(_0x09c1('0x0'));var logger=require(_0x09c1('0x1'))(_0x09c1('0x2'));var moment=require(_0x09c1('0x3'));var BPromise=require(_0x09c1('0x4'));var rp=require(_0x09c1('0x5'));var fs=require('fs');var path=require(_0x09c1('0x6'));var rimraf=require('rimraf');var config=require(_0x09c1('0x7'));var attributes=require(_0x09c1('0x8'));module[_0x09c1('0x9')]=function(_0xac3486,_0x437da9){return _0xac3486['define'](_0x09c1('0xa'),attributes,{'tableName':_0x09c1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb026=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x5b0809,_0x1fda75){var _0x9ad03f=function(_0x1fb3a6){while(--_0x1fb3a6){_0x5b0809['push'](_0x5b0809['shift']());}};_0x9ad03f(++_0x1fda75);}(_0xb026,0xc4));var _0x6b02=function(_0x295bc0,_0x1903af){_0x295bc0=_0x295bc0-0x0;var _0x300115=_0xb026[_0x295bc0];return _0x300115;};'use strict';var _=require(_0x6b02('0x0'));var util=require(_0x6b02('0x1'));var logger=require('../../config/logger')(_0x6b02('0x2'));var moment=require(_0x6b02('0x3'));var BPromise=require(_0x6b02('0x4'));var rp=require(_0x6b02('0x5'));var fs=require('fs');var path=require(_0x6b02('0x6'));var rimraf=require(_0x6b02('0x7'));var config=require(_0x6b02('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x3c9e58,_0x37adf8){return _0x3c9e58['define'](_0x6b02('0x9'),attributes,{'tableName':_0x6b02('0xa'),'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 f6bae02..e1c983f 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 _0x3e05=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x3e05,0xe4));var _0x53e0=function(_0x4d3c56,_0x271236){_0x4d3c56=_0x4d3c56-0x0;var _0x18774d=_0x3e05[_0x4d3c56];return _0x18774d;};'use strict';var _=require(_0x53e0('0x0'));var util=require(_0x53e0('0x1'));var moment=require(_0x53e0('0x2'));var BPromise=require(_0x53e0('0x3'));var rs=require(_0x53e0('0x4'));var fs=require('fs');var Redis=require(_0x53e0('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53e0('0x6'));var logger=require(_0x53e0('0x7'))(_0x53e0('0x8'));var config=require('../../config/environment');var jayson=require(_0x53e0('0x9'));var client=jayson[_0x53e0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x36747,_0x2cf940,_0x2d9c45){return new BPromise(function(_0x5e2b2f,_0x18822e){return client[_0x53e0('0xb')](_0x36747,_0x2d9c45)[_0x53e0('0xc')](function(_0x548a21){logger['info'](_0x53e0('0xd'),_0x2cf940,_0x53e0('0xe'));logger[_0x53e0('0xf')](_0x53e0('0x10'),_0x2cf940,'request\x20sent',JSON[_0x53e0('0x11')](_0x548a21));if(_0x548a21[_0x53e0('0x12')]){if(_0x548a21[_0x53e0('0x12')][_0x53e0('0x13')]===0x1f4){logger['error'](_0x53e0('0xd'),_0x2cf940,_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);return _0x18822e(_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);}logger[_0x53e0('0x12')](_0x53e0('0xd'),_0x2cf940,_0x548a21[_0x53e0('0x12')]['message']);return _0x5e2b2f(_0x548a21[_0x53e0('0x12')][_0x53e0('0x14')]);}else{logger[_0x53e0('0x15')](_0x53e0('0xd'),_0x2cf940,_0x53e0('0xe'));_0x5e2b2f(_0x548a21[_0x53e0('0x16')][_0x53e0('0x14')]);}})[_0x53e0('0x17')](function(_0x2a670f){logger[_0x53e0('0x12')](_0x53e0('0xd'),_0x2cf940,_0x2a670f);_0x18822e(_0x2a670f);});});} \ No newline at end of file +var _0x7d53=['error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3d674e,_0xd9d99d){var _0x176e07=function(_0x5cdd85){while(--_0x5cdd85){_0x3d674e['push'](_0x3d674e['shift']());}};_0x176e07(++_0xd9d99d);}(_0x7d53,0x11d));var _0x37d5=function(_0x64e142,_0x65a222){_0x64e142=_0x64e142-0x0;var _0x604964=_0x7d53[_0x64e142];return _0x604964;};'use strict';var _=require('lodash');var util=require(_0x37d5('0x0'));var moment=require('moment');var BPromise=require(_0x37d5('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x37d5('0x2'));var db=require(_0x37d5('0x3'))['db'];var utils=require(_0x37d5('0x4'));var logger=require(_0x37d5('0x5'))('rpc');var config=require(_0x37d5('0x6'));var jayson=require(_0x37d5('0x7'));var client=jayson[_0x37d5('0x8')][_0x37d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x202fec,_0x29f52e,_0x4fa898){return new BPromise(function(_0x3b103d,_0x471181){return client['request'](_0x202fec,_0x4fa898)['then'](function(_0x248f00){logger[_0x37d5('0xa')](_0x37d5('0xb'),_0x29f52e,_0x37d5('0xc'));logger['debug'](_0x37d5('0xd'),_0x29f52e,'request\x20sent',JSON[_0x37d5('0xe')](_0x248f00));if(_0x248f00['error']){if(_0x248f00[_0x37d5('0xf')][_0x37d5('0x10')]===0x1f4){logger[_0x37d5('0xf')](_0x37d5('0xb'),_0x29f52e,_0x248f00['error']['message']);return _0x471181(_0x248f00['error']['message']);}logger[_0x37d5('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x29f52e,_0x248f00[_0x37d5('0xf')][_0x37d5('0x11')]);return _0x3b103d(_0x248f00[_0x37d5('0xf')]['message']);}else{logger['info'](_0x37d5('0xb'),_0x29f52e,_0x37d5('0xc'));_0x3b103d(_0x248f00[_0x37d5('0x12')][_0x37d5('0x11')]);}})[_0x37d5('0x13')](function(_0x353995){logger[_0x37d5('0xf')](_0x37d5('0xb'),_0x29f52e,_0x353995);_0x471181(_0x353995);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 29dbac7..e4917f7 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 _0x6f47=['show','post','create','put','/:id','update','destroy','util','path','express','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated'];(function(_0x53f7e3,_0x2da312){var _0x278b2e=function(_0x3bca21){while(--_0x3bca21){_0x53f7e3['push'](_0x53f7e3['shift']());}};_0x278b2e(++_0x2da312);}(_0x6f47,0xc7));var _0x76f4=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x6f47[_0x9fd887];return _0x1a54ab;};'use strict';var multer=require('multer');var util=require(_0x76f4('0x0'));var path=require(_0x76f4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76f4('0x2'));var router=express['Router']();var fs_extra=require(_0x76f4('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x76f4('0x4'));var config=require(_0x76f4('0x5'));var controller=require(_0x76f4('0x6'));router[_0x76f4('0x7')]('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0x9')]);router[_0x76f4('0xa')]('/',auth['isAuthenticated'](),controller[_0x76f4('0xb')]);router[_0x76f4('0xc')](_0x76f4('0xd'),auth[_0x76f4('0x8')](),controller[_0x76f4('0xe')]);router['delete']('/:id',auth[_0x76f4('0x8')](),controller[_0x76f4('0xf')]);module['exports']=router; \ No newline at end of file +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(_0x479ab3,_0x764ba){var _0x4e00c3=function(_0x3e3796){while(--_0x3e3796){_0x479ab3['push'](_0x479ab3['shift']());}};_0x4e00c3(++_0x764ba);}(_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 diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index ee71f6c..ba8420c 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 _0xce90=['sequelize','exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xce90,0xcf));var _0x0ce9=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xce90[_0x4a53d];return _0x27410e;};'use strict';var Sequelize=require(_0x0ce9('0x0'));module[_0x0ce9('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0ce9('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0ce9('0x3')]},'timeout':{'type':Sequelize[_0x0ce9('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x0ce9('0x5')](_0x0ce9('0x6'),_0x0ce9('0x7'),_0x0ce9('0x8'))}}; \ No newline at end of file +var _0x4a3e=['rrmemory','roundrobin','exports','STRING','INTEGER'];(function(_0xf7b88a,_0x12c26c){var _0x286494=function(_0x22c311){while(--_0x22c311){_0xf7b88a['push'](_0xf7b88a['shift']());}};_0x286494(++_0x12c26c);}(_0x4a3e,0x1ba));var _0xe4a3=function(_0x156aef,_0x5a1d12){_0x156aef=_0x156aef-0x0;var _0x27e9d8=_0x4a3e[_0x156aef];return _0x27e9d8;};'use strict';var Sequelize=require('sequelize');module[_0xe4a3('0x0')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe4a3('0x1')]},'timeout':{'type':Sequelize[_0xe4a3('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe4a3('0x3'),'beepall',_0xe4a3('0x4'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index df06592..c2ab6a4 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 _0xf44b=['sendStatus','status','json','offset','limit','count','set','apply','save','then','destroy','get','ChatQueues','UserProfileResource','stack','name','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','ChatQueue','findAll','rows','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserChatQueue','hasOwnProperty','nolimit','UserId','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','voicePause','interface','flatMap','Agents','transaction','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','order','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash','squel','crypto','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','socket.io-emitter','./chatQueue.socket','jayson/promise','client','http','request','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x4cf21f,_0x23fb62){var _0x4f9b6=function(_0x5534c7){while(--_0x5534c7){_0x4cf21f['push'](_0x4cf21f['shift']());}};_0x4f9b6(++_0x23fb62);}(_0xf44b,0x196));var _0xbf44=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xf44b[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xbf44('0x0'));var rimraf=require(_0xbf44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf44('0x2'));var rp=require(_0xbf44('0x3'));var moment=require(_0xbf44('0x4'));var BPromise=require(_0xbf44('0x5'));var Mustache=require(_0xbf44('0x6'));var util=require('util');var path=require(_0xbf44('0x7'));var sox=require(_0xbf44('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf44('0x9'));var _=require(_0xbf44('0xa'));var squel=require(_0xbf44('0xb'));var crypto=require(_0xbf44('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbf44('0xd'));var Redis=require(_0xbf44('0xe'));var authService=require(_0xbf44('0xf'));var qs=require(_0xbf44('0x10'));var as=require(_0xbf44('0x11'));var hardwareService=require(_0xbf44('0x12'));var logger=require(_0xbf44('0x13'))(_0xbf44('0x14'));var utils=require(_0xbf44('0x15'));var config=require(_0xbf44('0x16'));var licenseUtil=require(_0xbf44('0x17'));var db=require(_0xbf44('0x18'))['db'];config[_0xbf44('0x19')]=_[_0xbf44('0x1a')](config[_0xbf44('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbf44('0x1b'))(new Redis(config['redis']));require(_0xbf44('0x1c'))['register'](socket);var jayson=require(_0xbf44('0x1d'));var client=jayson[_0xbf44('0x1e')][_0xbf44('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3c61c7,_0x2b5706,_0x190410,_0x3f6590){return new BPromise(function(_0x40474a,_0x53a9cd){var _0x5b58cc=_0x3f6590||client;return _0x5b58cc[_0xbf44('0x20')](_0x3c61c7,_0x190410)['then'](function(_0x31d8e4){logger[_0xbf44('0x21')](_0xbf44('0x22'),_0x2b5706,'request\x20sent');logger[_0xbf44('0x23')](_0xbf44('0x24'),_0x2b5706,_0xbf44('0x25'),JSON[_0xbf44('0x26')](_0x31d8e4));if(_0x31d8e4['error']){if(_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x28')]===0x1f4){logger[_0xbf44('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2b5706,_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);return _0x53a9cd(_0x31d8e4['error'][_0xbf44('0x29')]);}logger[_0xbf44('0x27')](_0xbf44('0x22'),_0x2b5706,_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);return _0x40474a(_0x31d8e4[_0xbf44('0x27')][_0xbf44('0x29')]);}else{logger[_0xbf44('0x21')](_0xbf44('0x22'),_0x2b5706,_0xbf44('0x25'));_0x40474a(_0x31d8e4[_0xbf44('0x2a')]['message']);}})[_0xbf44('0x2b')](function(_0xb2f366){logger[_0xbf44('0x27')](_0xbf44('0x22'),_0x2b5706,_0xb2f366);_0x53a9cd(_0xb2f366);});});}function respondWithStatusCode(_0x1b8798,_0x302a46){_0x302a46=_0x302a46||0xcc;return function(_0x2ca476){if(_0x2ca476){return _0x1b8798[_0xbf44('0x2c')](_0x302a46);}return _0x1b8798['status'](_0x302a46)['end']();};}function respondWithResult(_0x590b1e,_0x1c907e){_0x1c907e=_0x1c907e||0xc8;return function(_0x34f9fd){if(_0x34f9fd){return _0x590b1e[_0xbf44('0x2d')](_0x1c907e)[_0xbf44('0x2e')](_0x34f9fd);}};}function respondWithFilteredResult(_0x40d7cb,_0x36c111){return function(_0x7996aa){if(_0x7996aa){var _0x4f6b6c=typeof _0x36c111[_0xbf44('0x2f')]==='undefined'&&typeof _0x36c111[_0xbf44('0x30')]==='undefined';var _0x4fadf5=_0x7996aa[_0xbf44('0x31')];var _0x2e02c3=_0x4f6b6c?0x0:_0x36c111[_0xbf44('0x2f')];var _0x5839d9=_0x4f6b6c?_0x7996aa[_0xbf44('0x31')]:_0x36c111[_0xbf44('0x2f')]+_0x36c111['limit'];var _0x52de24;if(_0x5839d9>=_0x4fadf5){_0x5839d9=_0x4fadf5;_0x52de24=0xc8;}else{_0x52de24=0xce;}_0x40d7cb[_0xbf44('0x2d')](_0x52de24);return _0x40d7cb[_0xbf44('0x32')]('Content-Range',_0x2e02c3+'-'+_0x5839d9+'/'+_0x4fadf5)[_0xbf44('0x2e')](_0x7996aa);}return null;};}function patchUpdates(_0x3943a5){return function(_0x285827){try{jsonpatch[_0xbf44('0x33')](_0x285827,_0x3943a5,!![]);}catch(_0x3e2ee4){return BPromise['reject'](_0x3e2ee4);}return _0x285827[_0xbf44('0x34')]();};}function saveUpdates(_0x298821,_0x5d5258){return function(_0x700c0a){if(_0x700c0a){return _0x700c0a['update'](_0x298821)[_0xbf44('0x35')](function(_0x47e524){return _0x47e524;});}return null;};}function removeEntity(_0x5c32d9,_0x541907){return function(_0x453153){if(_0x453153){return _0x453153[_0xbf44('0x36')]()[_0xbf44('0x35')](function(){var _0xcbf3d7=_0x453153[_0xbf44('0x37')]({'plain':!![]});var _0x2f4722=_0xbf44('0x38');return db[_0xbf44('0x39')][_0xbf44('0x36')]({'where':{'type':_0x2f4722,'resourceId':_0xcbf3d7['id']}})[_0xbf44('0x35')](function(){return _0x453153;});})[_0xbf44('0x35')](function(){_0x5c32d9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x26f939,_0x181742){return function(_0x376cfb){if(!_0x376cfb){_0x26f939['sendStatus'](0x194);}return _0x376cfb;};}function handleError(_0x2af59a,_0xb0631f){_0xb0631f=_0xb0631f||0x1f4;return function(_0x2b8bb3){logger['error'](_0x2b8bb3[_0xbf44('0x3a')]);if(_0x2b8bb3[_0xbf44('0x3b')]){delete _0x2b8bb3['name'];}_0x2af59a['status'](_0xb0631f)['send'](_0x2b8bb3);};}exports['index']=function(_0x3be2d3,_0x351b70){var _0x342de9={},_0x51d8f5={},_0x23cba8={'count':0x0,'rows':[]};var _0x483e9e=_[_0xbf44('0x3c')](db['ChatQueue'][_0xbf44('0x3d')],function(_0x3a86f7){return{'name':_0x3a86f7[_0xbf44('0x3e')],'type':_0x3a86f7[_0xbf44('0x3f')][_0xbf44('0x40')]};});_0x51d8f5['model']=_[_0xbf44('0x3c')](_0x483e9e,_0xbf44('0x3b'));_0x51d8f5[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x3be2d3[_0xbf44('0x41')]);_0x51d8f5[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x51d8f5[_0xbf44('0x45')],_0x51d8f5[_0xbf44('0x41')]);_0x342de9[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0x51d8f5['model'],qs[_0xbf44('0x47')](_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x47')]));_0x342de9[_0xbf44('0x46')]=_0x342de9['attributes'][_0xbf44('0x48')]?_0x342de9['attributes']:_0x51d8f5[_0xbf44('0x45')];if(!_0x3be2d3['query']['hasOwnProperty']('nolimit')){_0x342de9['limit']=qs[_0xbf44('0x30')](_0x3be2d3['query']['limit']);_0x342de9[_0xbf44('0x2f')]=qs[_0xbf44('0x2f')](_0x3be2d3[_0xbf44('0x41')]['offset']);}_0x342de9['order']=qs['sort'](_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x49')]);_0x342de9[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x3be2d3[_0xbf44('0x41')],_0x51d8f5[_0xbf44('0x43')]),_0x483e9e);if(_0x3be2d3[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x342de9[_0xbf44('0x4a')]=_[_0xbf44('0x4d')](_0x342de9[_0xbf44('0x4a')],{'$or':_['map'](_0x483e9e,function(_0x452b87){if(_0x452b87[_0xbf44('0x3f')]!==_0xbf44('0x4e')){var _0x32b6e3={};_0x32b6e3[_0x452b87['name']]={'$like':'%'+_0x3be2d3[_0xbf44('0x41')]['filter']+'%'};return _0x32b6e3;}})});}_0x342de9=_[_0xbf44('0x4d')]({},_0x342de9,_0x3be2d3[_0xbf44('0x4f')]);var _0xb7842e={'where':_0x342de9[_0xbf44('0x4a')]};return db['ChatQueue'][_0xbf44('0x31')](_0xb7842e)[_0xbf44('0x35')](function(_0x39db69){_0x23cba8['count']=_0x39db69;if(_0x3be2d3['query'][_0xbf44('0x50')]){_0x342de9[_0xbf44('0x51')]=[{'all':!![]}];}return db[_0xbf44('0x52')][_0xbf44('0x53')](_0x342de9);})[_0xbf44('0x35')](function(_0x4ce3b7){_0x23cba8[_0xbf44('0x54')]=_0x4ce3b7;return _0x23cba8;})[_0xbf44('0x35')](respondWithFilteredResult(_0x351b70,_0x342de9))[_0xbf44('0x2b')](handleError(_0x351b70,null));};exports[_0xbf44('0x55')]=function(_0x33e696,_0x34ba1c){var _0x3b71da={'raw':!![],'where':{'id':_0x33e696[_0xbf44('0x56')]['id']}},_0x40d571={};_0x40d571[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x52')][_0xbf44('0x3d')]);_0x40d571[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x33e696[_0xbf44('0x41')]);_0x40d571[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x40d571['model'],_0x40d571[_0xbf44('0x41')]);_0x3b71da['attributes']=_[_0xbf44('0x44')](_0x40d571[_0xbf44('0x45')],qs['fields'](_0x33e696['query'][_0xbf44('0x47')]));_0x3b71da['attributes']=_0x3b71da['attributes']['length']?_0x3b71da[_0xbf44('0x46')]:_0x40d571['model'];if(_0x33e696[_0xbf44('0x41')]['includeAll']){_0x3b71da[_0xbf44('0x51')]=[{'all':!![]}];}_0x3b71da=_[_0xbf44('0x4d')]({},_0x3b71da,_0x33e696['options']);return db[_0xbf44('0x52')][_0xbf44('0x57')](_0x3b71da)['then'](handleEntityNotFound(_0x34ba1c,null))[_0xbf44('0x35')](respondWithResult(_0x34ba1c,null))[_0xbf44('0x2b')](handleError(_0x34ba1c,null));};exports['create']=function(_0x26526a,_0x44958a){return db[_0xbf44('0x52')]['create'](_0x26526a[_0xbf44('0x58')],{})[_0xbf44('0x35')](function(_0x2668c3){var _0x24034b=_0x26526a[_0xbf44('0x59')]['get']({'plain':!![]});if(!_0x24034b)throw new Error(_0xbf44('0x5a'));if(_0x24034b[_0xbf44('0x5b')]==='user'){var _0x281bfa=_0x2668c3[_0xbf44('0x37')]({'plain':!![]});var _0x1e1a61='ChatQueues';return db[_0xbf44('0x5c')][_0xbf44('0x57')]({'where':{'name':_0x1e1a61,'userProfileId':_0x24034b[_0xbf44('0x5d')]},'raw':!![]})['then'](function(_0xb06181){if(_0xb06181&&_0xb06181['autoAssociation']===0x0){return db[_0xbf44('0x39')]['create']({'name':_0x281bfa[_0xbf44('0x3b')],'resourceId':_0x281bfa['id'],'type':_0xb06181['name'],'sectionId':_0xb06181['id']},{})['then'](function(){return _0x2668c3;});}else{return _0x2668c3;}})[_0xbf44('0x2b')](function(_0x1b9a25){logger[_0xbf44('0x27')](_0xbf44('0x5e'),_0x1b9a25);throw _0x1b9a25;});}return _0x2668c3;})[_0xbf44('0x35')](respondWithResult(_0x44958a,0xc9))['catch'](handleError(_0x44958a,null));};exports[_0xbf44('0x5f')]=function(_0x1b1159,_0x37ad9a){if(_0x1b1159['body']['id']){delete _0x1b1159['body']['id'];}return db[_0xbf44('0x52')]['find']({'where':{'id':_0x1b1159[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x37ad9a,null))[_0xbf44('0x35')](saveUpdates(_0x1b1159['body'],null))[_0xbf44('0x35')](respondWithResult(_0x37ad9a,null))[_0xbf44('0x2b')](handleError(_0x37ad9a,null));};exports[_0xbf44('0x36')]=function(_0x438dd1,_0x35e6d3){return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x438dd1['params']['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x35e6d3,null))[_0xbf44('0x35')](removeEntity(_0x35e6d3,null))[_0xbf44('0x2b')](handleError(_0x35e6d3,null));};exports[_0xbf44('0x60')]=function(_0x34d5d5,_0x360edb){return db[_0xbf44('0x52')][_0xbf44('0x60')]()[_0xbf44('0x35')](respondWithResult(_0x360edb,null))['catch'](handleError(_0x360edb,null));};exports['getMembers']=function(_0x23362d,_0x33520f,_0x8f9904){var _0x59d402={'raw':!![],'where':{}},_0x143c16={},_0x3328b2;return db[_0xbf44('0x52')][_0xbf44('0x61')]({'where':{'id':_0x23362d['params']['id']}})['then'](handleEntityNotFound(_0x33520f,null))[_0xbf44('0x35')](function(_0x5440d5){if(_0x5440d5){_0x3328b2=_0x5440d5['get']({'plain':!![]});_0x143c16[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x62')][_0xbf44('0x3d')]);_0x143c16[_0xbf44('0x41')]=_['keys'](_0x23362d[_0xbf44('0x41')]);_0x143c16[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x143c16[_0xbf44('0x45')],_0x143c16['query']);_0x59d402[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0x143c16['model'],qs[_0xbf44('0x47')](_0x23362d['query'][_0xbf44('0x47')]));_0x59d402['attributes']=_0x59d402[_0xbf44('0x46')]['length']?_0x59d402[_0xbf44('0x46')]:_0x143c16[_0xbf44('0x45')];if(!_0x23362d[_0xbf44('0x41')][_0xbf44('0x63')](_0xbf44('0x64'))){_0x59d402[_0xbf44('0x30')]=qs[_0xbf44('0x30')](_0x23362d[_0xbf44('0x41')]['limit']);_0x59d402[_0xbf44('0x2f')]=qs['offset'](_0x23362d[_0xbf44('0x41')][_0xbf44('0x2f')]);}_0x59d402['order']=qs[_0xbf44('0x49')](_0x23362d[_0xbf44('0x41')][_0xbf44('0x49')]);_0x59d402[_0xbf44('0x4a')]=qs[_0xbf44('0x43')](_['pick'](_0x23362d[_0xbf44('0x41')],_0x143c16[_0xbf44('0x43')]));_0x59d402[_0xbf44('0x4a')]['ChatQueueId']=_0x5440d5['id'];if(_0x23362d[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x59d402['where']=_[_0xbf44('0x4d')](_0x59d402[_0xbf44('0x4a')],{'$or':_[_0xbf44('0x3c')](_0x59d402[_0xbf44('0x46')],function(_0x1427c5){var _0x31c6e7={};_0x31c6e7[_0x1427c5]={'$like':'%'+_0x23362d['query'][_0xbf44('0x4c')]+'%'};return _0x31c6e7;})});}_0x59d402=_[_0xbf44('0x4d')]({},_0x59d402,_0x23362d[_0xbf44('0x4f')]);return db['UserChatQueue']['findAll'](_0x59d402);}})['then'](function(_0x4635aa){if(_0x4635aa){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x4635aa,_0xbf44('0x65')),'role':'agent'},'attributes':['id',_0xbf44('0x3b'),_0xbf44('0x66'),_0xbf44('0x67'),_0xbf44('0x68')]});}})['then'](function(_0x396215){if(_0x396215){return{'count':_0x396215[_0xbf44('0x31')],'rows':_['map'](_0x396215[_0xbf44('0x54')],function(_0x882f18){return{'membername':_0x882f18['name'],'UserId':_0x882f18['id'],'queue_name':_0x3328b2['name'],'ChatQueueId':_0x3328b2['id'],'interface':util[_0xbf44('0x69')](_0xbf44('0x6a'),_0xbf44('0x6b'),_0x882f18[_0xbf44('0x3b')]),'penalty':0x0,'paused':_0x882f18['chatPause'],'createdAt':_0x882f18['createdAt'],'updatedAt':_0x882f18[_0xbf44('0x67')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x33520f,_0x59d402))[_0xbf44('0x2b')](handleError(_0x33520f,null));};exports[_0xbf44('0x6c')]=function(_0x37a24d,_0x3cb32f,_0x3d289e){var _0x260f92={};var _0x32eb35={};var _0x1eac4f;var _0x4f13dc;return db[_0xbf44('0x52')]['findOne']({'where':{'id':_0x37a24d[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x3cb32f,null))['then'](function(_0x36ca43){if(_0x36ca43){_0x1eac4f=_0x36ca43;_0x32eb35['model']=_['keys'](db[_0xbf44('0x6d')]['rawAttributes']);_0x32eb35[_0xbf44('0x41')]=_[_0xbf44('0x42')](_0x37a24d[_0xbf44('0x41')]);_0x32eb35[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0x32eb35['model'],_0x32eb35[_0xbf44('0x41')]);_0x260f92[_0xbf44('0x46')]=_['intersection'](_0x32eb35['model'],qs[_0xbf44('0x47')](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x47')]));_0x260f92[_0xbf44('0x46')]=_0x260f92[_0xbf44('0x46')][_0xbf44('0x48')]?_0x260f92['attributes']:_0x32eb35[_0xbf44('0x45')];_0x260f92['order']=qs['sort'](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x49')]);_0x260f92[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x37a24d[_0xbf44('0x41')],_0x32eb35[_0xbf44('0x43')]));if(_0x37a24d['query'][_0xbf44('0x4c')]){_0x260f92['where']=_[_0xbf44('0x4d')](_0x260f92['where'],{'$or':_[_0xbf44('0x3c')](_0x260f92[_0xbf44('0x46')],function(_0x39a4b9){var _0x39f5a0={};_0x39f5a0[_0x39a4b9]={'$like':'%'+_0x37a24d[_0xbf44('0x41')][_0xbf44('0x4c')]+'%'};return _0x39f5a0;})});}_0x260f92=_['merge']({},_0x260f92,_0x37a24d[_0xbf44('0x4f')]);return _0x1eac4f['getTeams'](_0x260f92);}})[_0xbf44('0x35')](function(_0x53d7ba){if(_0x53d7ba){_0x4f13dc=_0x53d7ba[_0xbf44('0x48')];if(!_0x37a24d[_0xbf44('0x41')][_0xbf44('0x63')](_0xbf44('0x64'))){_0x260f92['limit']=qs[_0xbf44('0x30')](_0x37a24d[_0xbf44('0x41')]['limit']);_0x260f92[_0xbf44('0x2f')]=qs[_0xbf44('0x2f')](_0x37a24d[_0xbf44('0x41')][_0xbf44('0x2f')]);}return _0x1eac4f[_0xbf44('0x6c')](_0x260f92);}})[_0xbf44('0x35')](function(_0x568908){if(_0x568908){return _0x568908?{'count':_0x4f13dc,'rows':_0x568908}:null;}})['then'](respondWithResult(_0x3cb32f,null))[_0xbf44('0x2b')](handleError(_0x3cb32f,null));};exports[_0xbf44('0x6e')]=function(_0x332d87,_0x4f1fcf,_0x3e19de){var _0x365579=_0x332d87[_0xbf44('0x58')][_0xbf44('0x6f')];return db[_0xbf44('0x6d')][_0xbf44('0x53')]({'where':{'id':_0x365579},'attributes':['id'],'include':[{'model':db[_0xbf44('0x70')],'as':'Agents','attributes':['id',_0xbf44('0x3b'),'online',_0xbf44('0x71'),_0xbf44('0x72')],'raw':!![]}]})[_0xbf44('0x35')](function(_0x50d361){if(_0x50d361){var _0x177c53=_[_0xbf44('0x73')](_0x50d361,function(_0x189619){var _0x5ed467=_0x189619['get']({'plain':!![]});return _0x5ed467[_0xbf44('0x74')];});return db[_0xbf44('0x52')]['find']({'where':{'id':_0x332d87[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](function(_0x47fa77){return db['sequelize'][_0xbf44('0x75')](function(_0x3c5d15){return _0x47fa77[_0xbf44('0x6e')](_0x365579,{'transaction':_0x3c5d15})[_0xbf44('0x35')](function(){return BPromise[_0xbf44('0x76')](_0x177c53,function(_0x23e209){return db[_0xbf44('0x62')][_0xbf44('0x77')]({'where':{'UserId':_0x23e209['id'],'ChatQueueId':_0x332d87['params']['id']},'transaction':_0x3c5d15});});})[_0xbf44('0x35')](function(){_0x177c53[_0xbf44('0x78')](function(_0x1c3d95){socket[_0xbf44('0x79')]('userChatQueue:save',{'UserId':_0x1c3d95['id'],'ChatQueueId':_0x47fa77['id']});});});});});}})[_0xbf44('0x35')](respondWithStatusCode(_0x4f1fcf,null))[_0xbf44('0x2b')](handleError(_0x4f1fcf,null));};exports[_0xbf44('0x7a')]=function(_0x580597,_0x6970e4,_0x2eb31d){return db[_0xbf44('0x6d')][_0xbf44('0x53')]({'where':{'id':_0x580597[_0xbf44('0x41')][_0xbf44('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xbf44('0x70')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x6970e4,null))[_0xbf44('0x35')](function(_0x3c855b){var _0x29fd73=_['map'](_0x3c855b,'id');var _0xa7b205=[];var _0x3348fd=[];var _0x46952a=squel[_0xbf44('0x7b')]();_0x46952a[_0xbf44('0x7c')](_0xbf44('0x7d'))[_0xbf44('0x7e')](_0xbf44('0x7f'),'tq')[_0xbf44('0x80')](_0xbf44('0x81'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xbf44('0x4a')](_0xbf44('0x82'),_0x580597[_0xbf44('0x56')]['id']);for(var _0x4900e1=0x0;_0x4900e1<_0x3c855b['length'];_0x4900e1+=0x1){let _0x2bb580=_0x3c855b[_0x4900e1];for(var _0x1e1e34=0x0;_0x1e1e34<_0x2bb580[_0xbf44('0x74')][_0xbf44('0x48')];_0x1e1e34+=0x1){let _0xb42d7d=_0x2bb580['Agents'][_0x1e1e34];var _0x4afa2a=_0x46952a[_0xbf44('0x83')]();_0x4afa2a[_0xbf44('0x4a')](_0xbf44('0x84'),_0xb42d7d['id']);_0x3348fd['push'](db['sequelize'][_0xbf44('0x41')](_0x4afa2a[_0xbf44('0x85')](),{'type':db[_0xbf44('0x86')][_0xbf44('0x87')][_0xbf44('0x88')]})['then'](function(_0x550d6d){if(_0x550d6d[_0xbf44('0x48')]===0x1){return _0xb42d7d['id'];}else{var _0xfdaa26=_['every'](_[_0xbf44('0x3c')](_0x550d6d,_0xbf44('0x89')),function(_0x80f1e5){return _[_0xbf44('0x8a')](_0x29fd73,_0x80f1e5);});if(_0xfdaa26){return _0xb42d7d['id'];}}}));}}return BPromise[_0xbf44('0x8b')](_0x3348fd)['then'](function(_0x11d9b3){_0xa7b205=_(_0xa7b205)[_0xbf44('0x8c')](_0x11d9b3)['compact']()['value']();return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x580597['params']['id']}})[_0xbf44('0x35')](function(_0x25c621){return db['sequelize']['transaction'](function(_0x178baf){return _0x25c621[_0xbf44('0x7a')](_0x580597['query'][_0xbf44('0x6f')],{'transaction':_0x178baf})['then'](function(){if(!_['isEmpty'](_0xa7b205)){return _0x25c621[_0xbf44('0x8d')](_0xa7b205,{'transaction':_0x178baf});}})[_0xbf44('0x35')](function(){_0xa7b205[_0xbf44('0x78')](function(_0xea056c){socket['emit']('userChatQueue:remove',{'UserId':_0xea056c,'ChatQueueId':_0x25c621['id']});});});});});});})[_0xbf44('0x35')](respondWithStatusCode(_0x6970e4,null))[_0xbf44('0x2b')](handleError(_0x6970e4,null));};exports[_0xbf44('0x8e')]=function(_0x17ef4b,_0x739938,_0x493fd4){return db[_0xbf44('0x52')][_0xbf44('0x57')]({'where':{'id':_0x17ef4b[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x739938,null))[_0xbf44('0x35')](function(_0x38932d){if(_0x38932d){return _0x38932d[_0xbf44('0x8e')](_0x17ef4b['body'][_0xbf44('0x6f')],_[_0xbf44('0x8f')](_0x17ef4b[_0xbf44('0x58')],[_0xbf44('0x6f'),'id'])||{})[_0xbf44('0x90')](function(_0x1c131b){for(var _0x278d35=0x0;_0x278d35<_0x17ef4b[_0xbf44('0x58')][_0xbf44('0x6f')][_0xbf44('0x48')];_0x278d35+=0x1){socket[_0xbf44('0x79')](_0xbf44('0x91'),{'UserId':Number(_0x17ef4b[_0xbf44('0x58')]['ids'][_0x278d35]),'ChatQueueId':Number(_0x17ef4b[_0xbf44('0x56')]['id'])});}return _0x1c131b;});}})['then'](respondWithResult(_0x739938,null))[_0xbf44('0x2b')](handleError(_0x739938,null));};exports[_0xbf44('0x8d')]=function(_0x310b78,_0x596c74,_0x1e8aca){return db[_0xbf44('0x52')]['find']({'where':{'id':_0x310b78[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x596c74,null))[_0xbf44('0x35')](function(_0x4770ad){if(_0x4770ad){return _0x4770ad[_0xbf44('0x8d')](_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')])[_0xbf44('0x35')](function(){if(_[_0xbf44('0x92')](_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')])){for(var _0x3450c0=0x0;_0x3450c0<_0x310b78[_0xbf44('0x41')]['ids']['length'];_0x3450c0+=0x1){socket[_0xbf44('0x79')](_0xbf44('0x93'),{'UserId':Number(_0x310b78[_0xbf44('0x41')]['ids'][_0x3450c0]),'ChatQueueId':Number(_0x310b78[_0xbf44('0x56')]['id'])});}}else{socket[_0xbf44('0x79')](_0xbf44('0x93'),{'UserId':Number(_0x310b78[_0xbf44('0x41')][_0xbf44('0x6f')]),'ChatQueueId':Number(_0x310b78[_0xbf44('0x56')]['id'])});}});}})[_0xbf44('0x35')](respondWithStatusCode(_0x596c74,null))[_0xbf44('0x2b')](handleError(_0x596c74,null));};exports['getAgents']=function(_0x384e99,_0x123f3a,_0x683219){var _0x16d5cf={};var _0xd40453={};var _0x1a56ce;var _0x53b700;return db[_0xbf44('0x52')]['findOne']({'where':{'id':_0x384e99[_0xbf44('0x56')]['id']}})[_0xbf44('0x35')](handleEntityNotFound(_0x123f3a,null))['then'](function(_0x19617e){if(_0x19617e){_0x1a56ce=_0x19617e;_0xd40453[_0xbf44('0x45')]=_[_0xbf44('0x42')](db[_0xbf44('0x70')][_0xbf44('0x3d')]);_0xd40453['query']=_[_0xbf44('0x42')](_0x384e99[_0xbf44('0x41')]);_0xd40453[_0xbf44('0x43')]=_[_0xbf44('0x44')](_0xd40453[_0xbf44('0x45')],_0xd40453[_0xbf44('0x41')]);_0x16d5cf[_0xbf44('0x46')]=_[_0xbf44('0x44')](_0xd40453[_0xbf44('0x45')],qs[_0xbf44('0x47')](_0x384e99['query'][_0xbf44('0x47')]));_0x16d5cf[_0xbf44('0x46')]=_0x16d5cf[_0xbf44('0x46')][_0xbf44('0x48')]?_0x16d5cf[_0xbf44('0x46')]:_0xd40453[_0xbf44('0x45')];_0x16d5cf[_0xbf44('0x94')]=qs[_0xbf44('0x49')](_0x384e99[_0xbf44('0x41')][_0xbf44('0x49')]);_0x16d5cf[_0xbf44('0x4a')]=qs['filters'](_[_0xbf44('0x4b')](_0x384e99[_0xbf44('0x41')],_0xd40453['filters']));if(_0x384e99[_0xbf44('0x41')][_0xbf44('0x4c')]){_0x16d5cf[_0xbf44('0x4a')]=_['merge'](_0x16d5cf[_0xbf44('0x4a')],{'$or':_[_0xbf44('0x3c')](_0x16d5cf['attributes'],function(_0x59fbbb){var _0x4b5484={};_0x4b5484[_0x59fbbb]={'$like':'%'+_0x384e99[_0xbf44('0x41')][_0xbf44('0x4c')]+'%'};return _0x4b5484;})});}_0x16d5cf=_[_0xbf44('0x4d')]({},_0x16d5cf,_0x384e99[_0xbf44('0x4f')]);return _0x1a56ce['getAgents'](_0x16d5cf);}})[_0xbf44('0x35')](function(_0x25c755){if(_0x25c755){_0x53b700=_0x25c755['length'];if(!_0x384e99[_0xbf44('0x41')]['hasOwnProperty'](_0xbf44('0x64'))){_0x16d5cf[_0xbf44('0x30')]=qs[_0xbf44('0x30')](_0x384e99[_0xbf44('0x41')][_0xbf44('0x30')]);_0x16d5cf['offset']=qs[_0xbf44('0x2f')](_0x384e99['query'][_0xbf44('0x2f')]);}return _0x1a56ce[_0xbf44('0x95')](_0x16d5cf);}})[_0xbf44('0x35')](function(_0x51f3b8){if(_0x51f3b8){return _0x51f3b8?{'count':_0x53b700,'rows':_0x51f3b8}:null;}})[_0xbf44('0x35')](respondWithResult(_0x123f3a,null))[_0xbf44('0x2b')](handleError(_0x123f3a,null));}; \ No newline at end of file +var _0x88f8=['omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./chatQueue.socket','register','jayson/promise','client','http','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','map','ChatQueue','rawAttributes','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','params','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','pick','ChatQueueId','User','findAndCountAll','agent','chatPause','format','%s/%s','createdAt','updatedAt','getTeams','Team','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','toString','SELECT','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userChatQueue:remove'];(function(_0x115683,_0x4a1c36){var _0x5715b0=function(_0x17a343){while(--_0x17a343){_0x115683['push'](_0x115683['shift']());}};_0x5715b0(++_0x4a1c36);}(_0x88f8,0x9d));var _0x888f=function(_0x7afd09,_0x5cd2e1){_0x7afd09=_0x7afd09-0x0;var _0x394a32=_0x88f8[_0x7afd09];return _0x394a32;};'use strict';var emlformat=require(_0x888f('0x0'));var rimraf=require(_0x888f('0x1'));var zipdir=require(_0x888f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x888f('0x3'));var moment=require(_0x888f('0x4'));var BPromise=require(_0x888f('0x5'));var Mustache=require(_0x888f('0x6'));var util=require(_0x888f('0x7'));var path=require(_0x888f('0x8'));var sox=require('sox');var csv=require(_0x888f('0x9'));var ejs=require(_0x888f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x888f('0xb'));var squel=require(_0x888f('0xc'));var crypto=require(_0x888f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x888f('0xe'));var toCsv=require(_0x888f('0x9'));var querystring=require(_0x888f('0xf'));var Papa=require(_0x888f('0x10'));var Redis=require('ioredis');var authService=require(_0x888f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x888f('0x12'));var hardwareService=require(_0x888f('0x13'));var logger=require(_0x888f('0x14'))('api');var utils=require(_0x888f('0x15'));var config=require(_0x888f('0x16'));var licenseUtil=require(_0x888f('0x17'));var db=require(_0x888f('0x18'))['db'];config[_0x888f('0x19')]=_['defaults'](config['redis'],{'host':_0x888f('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x888f('0x19')]));require(_0x888f('0x1b'))[_0x888f('0x1c')](socket);var jayson=require(_0x888f('0x1d'));var client=jayson[_0x888f('0x1e')][_0x888f('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x525959,_0x1f38fc,_0xae9f18,_0x585b47){return new BPromise(function(_0x483704,_0x4f8baf){var _0x44bc09=_0x585b47||client;return _0x44bc09[_0x888f('0x20')](_0x525959,_0xae9f18)[_0x888f('0x21')](function(_0x28e0f9){logger['info'](_0x888f('0x22'),_0x1f38fc,_0x888f('0x23'));logger['debug'](_0x888f('0x24'),_0x1f38fc,_0x888f('0x23'),JSON[_0x888f('0x25')](_0x28e0f9));if(_0x28e0f9['error']){if(_0x28e0f9[_0x888f('0x26')][_0x888f('0x27')]===0x1f4){logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x28e0f9[_0x888f('0x26')][_0x888f('0x28')]);return _0x4f8baf(_0x28e0f9[_0x888f('0x26')]['message']);}logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x28e0f9[_0x888f('0x26')][_0x888f('0x28')]);return _0x483704(_0x28e0f9[_0x888f('0x26')]['message']);}else{logger['info'](_0x888f('0x22'),_0x1f38fc,_0x888f('0x23'));_0x483704(_0x28e0f9[_0x888f('0x29')]['message']);}})['catch'](function(_0x324855){logger[_0x888f('0x26')](_0x888f('0x22'),_0x1f38fc,_0x324855);_0x4f8baf(_0x324855);});});}function respondWithStatusCode(_0x59d377,_0xa86372){_0xa86372=_0xa86372||0xcc;return function(_0x25c9f1){if(_0x25c9f1){return _0x59d377[_0x888f('0x2a')](_0xa86372);}return _0x59d377[_0x888f('0x2b')](_0xa86372)[_0x888f('0x2c')]();};}function respondWithResult(_0x5348fa,_0x1de0f1){_0x1de0f1=_0x1de0f1||0xc8;return function(_0x37e2fb){if(_0x37e2fb){return _0x5348fa[_0x888f('0x2b')](_0x1de0f1)[_0x888f('0x2d')](_0x37e2fb);}};}function respondWithFilteredResult(_0x277128,_0xcb011f){return function(_0x319078){if(_0x319078){var _0x19c693=typeof _0xcb011f[_0x888f('0x2e')]===_0x888f('0x2f')&&typeof _0xcb011f[_0x888f('0x30')]==='undefined';var _0x570b9e=_0x319078[_0x888f('0x31')];var _0x2af6e9=_0x19c693?0x0:_0xcb011f[_0x888f('0x2e')];var _0x2cb774=_0x19c693?_0x319078[_0x888f('0x31')]:_0xcb011f[_0x888f('0x2e')]+_0xcb011f[_0x888f('0x30')];var _0x2b47bd;if(_0x2cb774>=_0x570b9e){_0x2cb774=_0x570b9e;_0x2b47bd=0xc8;}else{_0x2b47bd=0xce;}_0x277128[_0x888f('0x2b')](_0x2b47bd);return _0x277128[_0x888f('0x32')](_0x888f('0x33'),_0x2af6e9+'-'+_0x2cb774+'/'+_0x570b9e)[_0x888f('0x2d')](_0x319078);}return null;};}function patchUpdates(_0x537d72){return function(_0x4fbfe0){try{jsonpatch['apply'](_0x4fbfe0,_0x537d72,!![]);}catch(_0x5b35dd){return BPromise[_0x888f('0x34')](_0x5b35dd);}return _0x4fbfe0[_0x888f('0x35')]();};}function saveUpdates(_0x18bfc6,_0x4c774c){return function(_0x2409c9){if(_0x2409c9){return _0x2409c9[_0x888f('0x36')](_0x18bfc6)[_0x888f('0x21')](function(_0x226f8a){return _0x226f8a;});}return null;};}function removeEntity(_0x6332aa,_0x3d62e4){return function(_0x288f5d){if(_0x288f5d){return _0x288f5d[_0x888f('0x37')]()[_0x888f('0x21')](function(){var _0x58ad1d=_0x288f5d[_0x888f('0x38')]({'plain':!![]});var _0x449ddd=_0x888f('0x39');return db[_0x888f('0x3a')][_0x888f('0x37')]({'where':{'type':_0x449ddd,'resourceId':_0x58ad1d['id']}})[_0x888f('0x21')](function(){return _0x288f5d;});})[_0x888f('0x21')](function(){_0x6332aa[_0x888f('0x2b')](0xcc)[_0x888f('0x2c')]();});}};}function handleEntityNotFound(_0x21f931,_0x3fba76){return function(_0x4b4253){if(!_0x4b4253){_0x21f931['sendStatus'](0x194);}return _0x4b4253;};}function handleError(_0x4b228e,_0x1db45a){_0x1db45a=_0x1db45a||0x1f4;return function(_0x32ec82){logger[_0x888f('0x26')](_0x32ec82[_0x888f('0x3b')]);if(_0x32ec82[_0x888f('0x3c')]){delete _0x32ec82[_0x888f('0x3c')];}_0x4b228e[_0x888f('0x2b')](_0x1db45a)[_0x888f('0x3d')](_0x32ec82);};}exports['index']=function(_0x49fb90,_0x3429cd){var _0x463ee6={},_0x41e127={},_0x568e51={'count':0x0,'rows':[]};var _0x465c17=_[_0x888f('0x3e')](db[_0x888f('0x3f')][_0x888f('0x40')],function(_0x21bbe4){return{'name':_0x21bbe4['fieldName'],'type':_0x21bbe4[_0x888f('0x41')]['key']};});_0x41e127[_0x888f('0x42')]=_[_0x888f('0x3e')](_0x465c17,_0x888f('0x3c'));_0x41e127[_0x888f('0x43')]=_['keys'](_0x49fb90[_0x888f('0x43')]);_0x41e127[_0x888f('0x44')]=_[_0x888f('0x45')](_0x41e127[_0x888f('0x42')],_0x41e127[_0x888f('0x43')]);_0x463ee6[_0x888f('0x46')]=_['intersection'](_0x41e127[_0x888f('0x42')],qs[_0x888f('0x47')](_0x49fb90['query'][_0x888f('0x47')]));_0x463ee6[_0x888f('0x46')]=_0x463ee6[_0x888f('0x46')][_0x888f('0x48')]?_0x463ee6['attributes']:_0x41e127[_0x888f('0x42')];if(!_0x49fb90[_0x888f('0x43')][_0x888f('0x49')](_0x888f('0x4a'))){_0x463ee6[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x49fb90[_0x888f('0x43')][_0x888f('0x30')]);_0x463ee6['offset']=qs['offset'](_0x49fb90[_0x888f('0x43')][_0x888f('0x2e')]);}_0x463ee6[_0x888f('0x4b')]=qs[_0x888f('0x4c')](_0x49fb90['query'][_0x888f('0x4c')]);_0x463ee6[_0x888f('0x4d')]=qs['filters'](_['pick'](_0x49fb90[_0x888f('0x43')],_0x41e127[_0x888f('0x44')]),_0x465c17);if(_0x49fb90[_0x888f('0x43')][_0x888f('0x4e')]){_0x463ee6[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x463ee6[_0x888f('0x4d')],{'$or':_['map'](_0x465c17,function(_0xc2bad1){if(_0xc2bad1[_0x888f('0x41')]!==_0x888f('0x50')){var _0x3b7ce8={};_0x3b7ce8[_0xc2bad1[_0x888f('0x3c')]]={'$like':'%'+_0x49fb90[_0x888f('0x43')][_0x888f('0x4e')]+'%'};return _0x3b7ce8;}})});}_0x463ee6=_[_0x888f('0x4f')]({},_0x463ee6,_0x49fb90[_0x888f('0x51')]);var _0x5387da={'where':_0x463ee6[_0x888f('0x4d')]};return db['ChatQueue']['count'](_0x5387da)['then'](function(_0x1b3e8f){_0x568e51[_0x888f('0x31')]=_0x1b3e8f;if(_0x49fb90['query']['includeAll']){_0x463ee6['include']=[{'all':!![]}];}return db[_0x888f('0x3f')][_0x888f('0x52')](_0x463ee6);})['then'](function(_0x40578e){_0x568e51[_0x888f('0x53')]=_0x40578e;return _0x568e51;})[_0x888f('0x21')](respondWithFilteredResult(_0x3429cd,_0x463ee6))[_0x888f('0x54')](handleError(_0x3429cd,null));};exports['show']=function(_0x46c8e0,_0x2ad8ef){var _0x37c7a7={'raw':!![],'where':{'id':_0x46c8e0[_0x888f('0x55')]['id']}},_0x1eab34={};_0x1eab34[_0x888f('0x42')]=_[_0x888f('0x56')](db[_0x888f('0x3f')][_0x888f('0x40')]);_0x1eab34[_0x888f('0x43')]=_['keys'](_0x46c8e0[_0x888f('0x43')]);_0x1eab34[_0x888f('0x44')]=_[_0x888f('0x45')](_0x1eab34[_0x888f('0x42')],_0x1eab34[_0x888f('0x43')]);_0x37c7a7[_0x888f('0x46')]=_[_0x888f('0x45')](_0x1eab34['model'],qs[_0x888f('0x47')](_0x46c8e0[_0x888f('0x43')]['fields']));_0x37c7a7[_0x888f('0x46')]=_0x37c7a7[_0x888f('0x46')][_0x888f('0x48')]?_0x37c7a7['attributes']:_0x1eab34[_0x888f('0x42')];if(_0x46c8e0[_0x888f('0x43')]['includeAll']){_0x37c7a7[_0x888f('0x57')]=[{'all':!![]}];}_0x37c7a7=_[_0x888f('0x4f')]({},_0x37c7a7,_0x46c8e0['options']);return db[_0x888f('0x3f')][_0x888f('0x58')](_0x37c7a7)['then'](handleEntityNotFound(_0x2ad8ef,null))[_0x888f('0x21')](respondWithResult(_0x2ad8ef,null))[_0x888f('0x54')](handleError(_0x2ad8ef,null));};exports[_0x888f('0x59')]=function(_0x21d194,_0x52003b){return db[_0x888f('0x3f')][_0x888f('0x59')](_0x21d194[_0x888f('0x5a')],{})[_0x888f('0x21')](function(_0x5d327f){var _0x59f627=_0x21d194[_0x888f('0x5b')][_0x888f('0x38')]({'plain':!![]});if(!_0x59f627)throw new Error(_0x888f('0x5c'));if(_0x59f627[_0x888f('0x5d')]==='user'){var _0x497230=_0x5d327f[_0x888f('0x38')]({'plain':!![]});var _0x2a5287='ChatQueues';return db['UserProfileSection'][_0x888f('0x58')]({'where':{'name':_0x2a5287,'userProfileId':_0x59f627[_0x888f('0x5e')]},'raw':!![]})[_0x888f('0x21')](function(_0x5378c6){if(_0x5378c6&&_0x5378c6[_0x888f('0x5f')]===0x0){return db[_0x888f('0x3a')][_0x888f('0x59')]({'name':_0x497230[_0x888f('0x3c')],'resourceId':_0x497230['id'],'type':_0x5378c6[_0x888f('0x3c')],'sectionId':_0x5378c6['id']},{})['then'](function(){return _0x5d327f;});}else{return _0x5d327f;}})[_0x888f('0x54')](function(_0x2ff6ab){logger[_0x888f('0x26')](_0x888f('0x60'),_0x2ff6ab);throw _0x2ff6ab;});}return _0x5d327f;})['then'](respondWithResult(_0x52003b,0xc9))[_0x888f('0x54')](handleError(_0x52003b,null));};exports['update']=function(_0x2f7210,_0x469bee){if(_0x2f7210[_0x888f('0x5a')]['id']){delete _0x2f7210[_0x888f('0x5a')]['id'];}return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x2f7210[_0x888f('0x55')]['id']}})['then'](handleEntityNotFound(_0x469bee,null))[_0x888f('0x21')](saveUpdates(_0x2f7210[_0x888f('0x5a')],null))[_0x888f('0x21')](respondWithResult(_0x469bee,null))['catch'](handleError(_0x469bee,null));};exports['destroy']=function(_0x154fd3,_0x434932){return db[_0x888f('0x3f')][_0x888f('0x58')]({'where':{'id':_0x154fd3[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x434932,null))[_0x888f('0x21')](removeEntity(_0x434932,null))[_0x888f('0x54')](handleError(_0x434932,null));};exports[_0x888f('0x61')]=function(_0x341252,_0x12971d){return db[_0x888f('0x3f')][_0x888f('0x61')]()[_0x888f('0x21')](respondWithResult(_0x12971d,null))[_0x888f('0x54')](handleError(_0x12971d,null));};exports[_0x888f('0x62')]=function(_0x344c50,_0x4390fc,_0x4f25d9){var _0x56197f={'raw':!![],'where':{}},_0x14bd02={},_0x10f41d;return db[_0x888f('0x3f')][_0x888f('0x63')]({'where':{'id':_0x344c50[_0x888f('0x55')]['id']}})['then'](handleEntityNotFound(_0x4390fc,null))['then'](function(_0x3bcf3c){if(_0x3bcf3c){_0x10f41d=_0x3bcf3c[_0x888f('0x38')]({'plain':!![]});_0x14bd02['model']=_[_0x888f('0x56')](db[_0x888f('0x64')]['rawAttributes']);_0x14bd02[_0x888f('0x43')]=_['keys'](_0x344c50[_0x888f('0x43')]);_0x14bd02[_0x888f('0x44')]=_[_0x888f('0x45')](_0x14bd02['model'],_0x14bd02[_0x888f('0x43')]);_0x56197f[_0x888f('0x46')]=_['intersection'](_0x14bd02[_0x888f('0x42')],qs[_0x888f('0x47')](_0x344c50[_0x888f('0x43')]['fields']));_0x56197f[_0x888f('0x46')]=_0x56197f[_0x888f('0x46')][_0x888f('0x48')]?_0x56197f['attributes']:_0x14bd02[_0x888f('0x42')];if(!_0x344c50[_0x888f('0x43')]['hasOwnProperty'](_0x888f('0x4a'))){_0x56197f[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x344c50['query'][_0x888f('0x30')]);_0x56197f['offset']=qs['offset'](_0x344c50['query'][_0x888f('0x2e')]);}_0x56197f[_0x888f('0x4b')]=qs['sort'](_0x344c50[_0x888f('0x43')]['sort']);_0x56197f['where']=qs['filters'](_[_0x888f('0x65')](_0x344c50[_0x888f('0x43')],_0x14bd02[_0x888f('0x44')]));_0x56197f['where'][_0x888f('0x66')]=_0x3bcf3c['id'];if(_0x344c50[_0x888f('0x43')][_0x888f('0x4e')]){_0x56197f['where']=_['merge'](_0x56197f[_0x888f('0x4d')],{'$or':_['map'](_0x56197f[_0x888f('0x46')],function(_0x13efb8){var _0x1bda91={};_0x1bda91[_0x13efb8]={'$like':'%'+_0x344c50['query'][_0x888f('0x4e')]+'%'};return _0x1bda91;})});}_0x56197f=_['merge']({},_0x56197f,_0x344c50['options']);return db[_0x888f('0x64')]['findAll'](_0x56197f);}})[_0x888f('0x21')](function(_0x34b490){if(_0x34b490){return db[_0x888f('0x67')][_0x888f('0x68')]({'where':{'id':_[_0x888f('0x3e')](_0x34b490,'UserId'),'role':_0x888f('0x69')},'attributes':['id',_0x888f('0x3c'),_0x888f('0x6a'),'updatedAt','createdAt']});}})[_0x888f('0x21')](function(_0x4a2280){if(_0x4a2280){return{'count':_0x4a2280[_0x888f('0x31')],'rows':_[_0x888f('0x3e')](_0x4a2280[_0x888f('0x53')],function(_0x53138a){return{'membername':_0x53138a[_0x888f('0x3c')],'UserId':_0x53138a['id'],'queue_name':_0x10f41d[_0x888f('0x3c')],'ChatQueueId':_0x10f41d['id'],'interface':util[_0x888f('0x6b')](_0x888f('0x6c'),'SIP',_0x53138a[_0x888f('0x3c')]),'penalty':0x0,'paused':_0x53138a[_0x888f('0x6a')],'createdAt':_0x53138a[_0x888f('0x6d')],'updatedAt':_0x53138a[_0x888f('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x888f('0x21')](respondWithFilteredResult(_0x4390fc,_0x56197f))[_0x888f('0x54')](handleError(_0x4390fc,null));};exports[_0x888f('0x6f')]=function(_0x2e484c,_0x1d68ab,_0x259676){var _0x16e2f7={};var _0x140b4d={};var _0xf8d411;var _0x49fe2a;return db[_0x888f('0x3f')][_0x888f('0x63')]({'where':{'id':_0x2e484c[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x1d68ab,null))[_0x888f('0x21')](function(_0x26d0db){if(_0x26d0db){_0xf8d411=_0x26d0db;_0x140b4d['model']=_[_0x888f('0x56')](db[_0x888f('0x70')][_0x888f('0x40')]);_0x140b4d[_0x888f('0x43')]=_[_0x888f('0x56')](_0x2e484c['query']);_0x140b4d[_0x888f('0x44')]=_['intersection'](_0x140b4d[_0x888f('0x42')],_0x140b4d[_0x888f('0x43')]);_0x16e2f7[_0x888f('0x46')]=_[_0x888f('0x45')](_0x140b4d[_0x888f('0x42')],qs[_0x888f('0x47')](_0x2e484c['query'][_0x888f('0x47')]));_0x16e2f7[_0x888f('0x46')]=_0x16e2f7[_0x888f('0x46')][_0x888f('0x48')]?_0x16e2f7['attributes']:_0x140b4d['model'];_0x16e2f7[_0x888f('0x4b')]=qs[_0x888f('0x4c')](_0x2e484c[_0x888f('0x43')][_0x888f('0x4c')]);_0x16e2f7['where']=qs[_0x888f('0x44')](_[_0x888f('0x65')](_0x2e484c[_0x888f('0x43')],_0x140b4d['filters']));if(_0x2e484c['query'][_0x888f('0x4e')]){_0x16e2f7[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x16e2f7['where'],{'$or':_[_0x888f('0x3e')](_0x16e2f7[_0x888f('0x46')],function(_0x988a2e){var _0x5293e6={};_0x5293e6[_0x988a2e]={'$like':'%'+_0x2e484c[_0x888f('0x43')][_0x888f('0x4e')]+'%'};return _0x5293e6;})});}_0x16e2f7=_['merge']({},_0x16e2f7,_0x2e484c[_0x888f('0x51')]);return _0xf8d411['getTeams'](_0x16e2f7);}})[_0x888f('0x21')](function(_0x406bf8){if(_0x406bf8){_0x49fe2a=_0x406bf8[_0x888f('0x48')];if(!_0x2e484c[_0x888f('0x43')][_0x888f('0x49')]('nolimit')){_0x16e2f7[_0x888f('0x30')]=qs['limit'](_0x2e484c[_0x888f('0x43')][_0x888f('0x30')]);_0x16e2f7[_0x888f('0x2e')]=qs[_0x888f('0x2e')](_0x2e484c[_0x888f('0x43')][_0x888f('0x2e')]);}return _0xf8d411[_0x888f('0x6f')](_0x16e2f7);}})[_0x888f('0x21')](function(_0x4377fe){if(_0x4377fe){return _0x4377fe?{'count':_0x49fe2a,'rows':_0x4377fe}:null;}})['then'](respondWithResult(_0x1d68ab,null))[_0x888f('0x54')](handleError(_0x1d68ab,null));};exports[_0x888f('0x71')]=function(_0x3d8382,_0x5da014,_0x29ceff){var _0x4014a9=_0x3d8382['body'][_0x888f('0x72')];return db['Team'][_0x888f('0x52')]({'where':{'id':_0x4014a9},'attributes':['id'],'include':[{'model':db[_0x888f('0x67')],'as':'Agents','attributes':['id',_0x888f('0x3c'),_0x888f('0x73'),_0x888f('0x74'),_0x888f('0x75')],'raw':!![]}]})[_0x888f('0x21')](function(_0x150dc5){if(_0x150dc5){var _0x54675a=_[_0x888f('0x76')](_0x150dc5,function(_0x3e580a){var _0x5d6ad8=_0x3e580a[_0x888f('0x38')]({'plain':!![]});return _0x5d6ad8[_0x888f('0x77')];});return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x3d8382[_0x888f('0x55')]['id']}})[_0x888f('0x21')](function(_0x57aea7){return db[_0x888f('0x78')][_0x888f('0x79')](function(_0x2ef194){return _0x57aea7[_0x888f('0x71')](_0x4014a9,{'transaction':_0x2ef194})[_0x888f('0x21')](function(){return BPromise[_0x888f('0x7a')](_0x54675a,function(_0x57f719){return db[_0x888f('0x64')][_0x888f('0x7b')]({'where':{'UserId':_0x57f719['id'],'ChatQueueId':_0x3d8382[_0x888f('0x55')]['id']},'transaction':_0x2ef194});});})[_0x888f('0x21')](function(){_0x54675a[_0x888f('0x7c')](function(_0x235cda){socket[_0x888f('0x7d')](_0x888f('0x7e'),{'UserId':_0x235cda['id'],'ChatQueueId':_0x57aea7['id']});});});});});}})[_0x888f('0x21')](respondWithStatusCode(_0x5da014,null))[_0x888f('0x54')](handleError(_0x5da014,null));};exports[_0x888f('0x7f')]=function(_0x5c6bc4,_0x4f7039,_0x1cc6c8){return db[_0x888f('0x70')][_0x888f('0x52')]({'where':{'id':_0x5c6bc4[_0x888f('0x43')][_0x888f('0x72')]},'attributes':['id'],'include':[{'model':db[_0x888f('0x67')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x888f('0x21')](handleEntityNotFound(_0x4f7039,null))['then'](function(_0x5022d8){var _0x376427=_[_0x888f('0x3e')](_0x5022d8,'id');var _0x5c4259=[];var _0x2d5966=[];var _0x1d223f=squel[_0x888f('0x80')]();_0x1d223f[_0x888f('0x81')](_0x888f('0x82'))[_0x888f('0x83')](_0x888f('0x84'),'tq')[_0x888f('0x85')](_0x888f('0x86'),'ut',_0x888f('0x87'))[_0x888f('0x4d')]('ChatQueueId\x20=\x20?',_0x5c6bc4[_0x888f('0x55')]['id']);for(var _0x4ad190=0x0;_0x4ad190<_0x5022d8[_0x888f('0x48')];_0x4ad190+=0x1){let _0x54a04e=_0x5022d8[_0x4ad190];for(var _0x10be8e=0x0;_0x10be8e<_0x54a04e[_0x888f('0x77')][_0x888f('0x48')];_0x10be8e+=0x1){let _0x39145d=_0x54a04e[_0x888f('0x77')][_0x10be8e];var _0x548da5=_0x1d223f[_0x888f('0x88')]();_0x548da5[_0x888f('0x4d')](_0x888f('0x89'),_0x39145d['id']);_0x2d5966['push'](db[_0x888f('0x78')][_0x888f('0x43')](_0x548da5[_0x888f('0x8a')](),{'type':db[_0x888f('0x78')]['QueryTypes'][_0x888f('0x8b')]})[_0x888f('0x21')](function(_0x33e080){if(_0x33e080[_0x888f('0x48')]===0x1){return _0x39145d['id'];}else{var _0x5a88c2=_[_0x888f('0x8c')](_[_0x888f('0x3e')](_0x33e080,_0x888f('0x8d')),function(_0x21191d){return _[_0x888f('0x8e')](_0x376427,_0x21191d);});if(_0x5a88c2){return _0x39145d['id'];}}}));}}return BPromise[_0x888f('0x8f')](_0x2d5966)[_0x888f('0x21')](function(_0xab2c08){_0x5c4259=_(_0x5c4259)[_0x888f('0x90')](_0xab2c08)['compact']()[_0x888f('0x91')]();return db[_0x888f('0x3f')]['find']({'where':{'id':_0x5c6bc4[_0x888f('0x55')]['id']}})[_0x888f('0x21')](function(_0x3f154a){return db[_0x888f('0x78')][_0x888f('0x79')](function(_0xac67e9){return _0x3f154a['removeTeams'](_0x5c6bc4[_0x888f('0x43')][_0x888f('0x72')],{'transaction':_0xac67e9})[_0x888f('0x21')](function(){if(!_[_0x888f('0x92')](_0x5c4259)){return _0x3f154a[_0x888f('0x93')](_0x5c4259,{'transaction':_0xac67e9});}})[_0x888f('0x21')](function(){_0x5c4259[_0x888f('0x7c')](function(_0x5d7678){socket[_0x888f('0x7d')](_0x888f('0x94'),{'UserId':_0x5d7678,'ChatQueueId':_0x3f154a['id']});});});});});});})[_0x888f('0x21')](respondWithStatusCode(_0x4f7039,null))[_0x888f('0x54')](handleError(_0x4f7039,null));};exports['addAgents']=function(_0x307fe6,_0x24c0cb,_0x46ef84){return db[_0x888f('0x3f')][_0x888f('0x58')]({'where':{'id':_0x307fe6[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x24c0cb,null))['then'](function(_0x936fa8){if(_0x936fa8){return _0x936fa8['addAgents'](_0x307fe6[_0x888f('0x5a')]['ids'],_[_0x888f('0x95')](_0x307fe6[_0x888f('0x5a')],[_0x888f('0x72'),'id'])||{})[_0x888f('0x96')](function(_0x52b551){for(var _0x30c107=0x0;_0x30c107<_0x307fe6['body']['ids'][_0x888f('0x48')];_0x30c107+=0x1){socket[_0x888f('0x7d')](_0x888f('0x7e'),{'UserId':Number(_0x307fe6[_0x888f('0x5a')][_0x888f('0x72')][_0x30c107]),'ChatQueueId':Number(_0x307fe6[_0x888f('0x55')]['id'])});}return _0x52b551;});}})[_0x888f('0x21')](respondWithResult(_0x24c0cb,null))['catch'](handleError(_0x24c0cb,null));};exports['removeAgents']=function(_0x41e0db,_0x1de3f7,_0x285669){return db['ChatQueue'][_0x888f('0x58')]({'where':{'id':_0x41e0db[_0x888f('0x55')]['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x1de3f7,null))['then'](function(_0x1a3770){if(_0x1a3770){return _0x1a3770[_0x888f('0x93')](_0x41e0db[_0x888f('0x43')][_0x888f('0x72')])['then'](function(){if(_[_0x888f('0x97')](_0x41e0db[_0x888f('0x43')][_0x888f('0x72')])){for(var _0x117566=0x0;_0x117566<_0x41e0db['query'][_0x888f('0x72')][_0x888f('0x48')];_0x117566+=0x1){socket[_0x888f('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x41e0db[_0x888f('0x43')][_0x888f('0x72')][_0x117566]),'ChatQueueId':Number(_0x41e0db['params']['id'])});}}else{socket['emit'](_0x888f('0x94'),{'UserId':Number(_0x41e0db['query'][_0x888f('0x72')]),'ChatQueueId':Number(_0x41e0db[_0x888f('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x1de3f7,null))[_0x888f('0x54')](handleError(_0x1de3f7,null));};exports['getAgents']=function(_0x53f3ea,_0x3e9998,_0x1eb665){var _0x51a47={};var _0x57f934={};var _0x148bdd;var _0x50bb58;return db[_0x888f('0x3f')]['findOne']({'where':{'id':_0x53f3ea['params']['id']}})[_0x888f('0x21')](handleEntityNotFound(_0x3e9998,null))[_0x888f('0x21')](function(_0x5cb28b){if(_0x5cb28b){_0x148bdd=_0x5cb28b;_0x57f934[_0x888f('0x42')]=_[_0x888f('0x56')](db[_0x888f('0x67')][_0x888f('0x40')]);_0x57f934[_0x888f('0x43')]=_[_0x888f('0x56')](_0x53f3ea[_0x888f('0x43')]);_0x57f934[_0x888f('0x44')]=_['intersection'](_0x57f934[_0x888f('0x42')],_0x57f934['query']);_0x51a47['attributes']=_[_0x888f('0x45')](_0x57f934[_0x888f('0x42')],qs[_0x888f('0x47')](_0x53f3ea['query'][_0x888f('0x47')]));_0x51a47[_0x888f('0x46')]=_0x51a47['attributes'][_0x888f('0x48')]?_0x51a47[_0x888f('0x46')]:_0x57f934[_0x888f('0x42')];_0x51a47[_0x888f('0x4b')]=qs['sort'](_0x53f3ea[_0x888f('0x43')][_0x888f('0x4c')]);_0x51a47[_0x888f('0x4d')]=qs['filters'](_[_0x888f('0x65')](_0x53f3ea['query'],_0x57f934[_0x888f('0x44')]));if(_0x53f3ea[_0x888f('0x43')][_0x888f('0x4e')]){_0x51a47[_0x888f('0x4d')]=_[_0x888f('0x4f')](_0x51a47['where'],{'$or':_['map'](_0x51a47[_0x888f('0x46')],function(_0x268d15){var _0x1ac909={};_0x1ac909[_0x268d15]={'$like':'%'+_0x53f3ea[_0x888f('0x43')]['filter']+'%'};return _0x1ac909;})});}_0x51a47=_[_0x888f('0x4f')]({},_0x51a47,_0x53f3ea[_0x888f('0x51')]);return _0x148bdd[_0x888f('0x98')](_0x51a47);}})['then'](function(_0x4db185){if(_0x4db185){_0x50bb58=_0x4db185['length'];if(!_0x53f3ea['query'][_0x888f('0x49')](_0x888f('0x4a'))){_0x51a47[_0x888f('0x30')]=qs[_0x888f('0x30')](_0x53f3ea[_0x888f('0x43')][_0x888f('0x30')]);_0x51a47[_0x888f('0x2e')]=qs[_0x888f('0x2e')](_0x53f3ea[_0x888f('0x43')][_0x888f('0x2e')]);}return _0x148bdd[_0x888f('0x98')](_0x51a47);}})[_0x888f('0x21')](function(_0x4dad68){if(_0x4dad68){return _0x4dad68?{'count':_0x50bb58,'rows':_0x4dad68}:null;}})[_0x888f('0x21')](respondWithResult(_0x3e9998,null))[_0x888f('0x54')](handleError(_0x3e9998,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 96a69f7..71561ef 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 _0x4625=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x318fe4,_0x4a75ed){var _0x349083=function(_0x35aba6){while(--_0x35aba6){_0x318fe4['push'](_0x318fe4['shift']());}};_0x349083(++_0x4a75ed);}(_0x4625,0x1c9));var _0x5462=function(_0x1207fb,_0x58d284){_0x1207fb=_0x1207fb-0x0;var _0x4d3333=_0x4625[_0x1207fb];return _0x4d3333;};'use strict';var EventEmitter=require(_0x5462('0x0'));var ChatQueue=require(_0x5462('0x1'))['db'][_0x5462('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5462('0x3')](0x0);var events={'afterCreate':_0x5462('0x4'),'afterUpdate':'update','afterDestroy':_0x5462('0x5')};function emitEvent(_0x47d4a6){return function(_0x3c1db3,_0x5bdfc4,_0x1bc84b){ChatQueueEvents[_0x5462('0x6')](_0x47d4a6+':'+_0x3c1db3['id'],_0x3c1db3);ChatQueueEvents[_0x5462('0x6')](_0x47d4a6,_0x3c1db3);_0x1bc84b(null);};}for(var e in events){if(events[_0x5462('0x7')](e)){var event=events[e];ChatQueue[_0x5462('0x8')](e,emitEvent(event));}}module[_0x5462('0x9')]=ChatQueueEvents; \ No newline at end of file +var _0xf15d=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0xf15d,0x1a9));var _0xdf15=function(_0x4286f2,_0x3b4190){_0x4286f2=_0x4286f2-0x0;var _0x41be11=_0xf15d[_0x4286f2];return _0x41be11;};'use strict';var EventEmitter=require(_0xdf15('0x0'));var ChatQueue=require(_0xdf15('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xdf15('0x2')](0x0);var events={'afterCreate':_0xdf15('0x3'),'afterUpdate':_0xdf15('0x4'),'afterDestroy':_0xdf15('0x5')};function emitEvent(_0x170e0c){return function(_0x1e3fd2,_0x57f3eb,_0x4f14d7){ChatQueueEvents[_0xdf15('0x6')](_0x170e0c+':'+_0x1e3fd2['id'],_0x1e3fd2);ChatQueueEvents['emit'](_0x170e0c,_0x1e3fd2);_0x4f14d7(null);};}for(var e in events){if(events[_0xdf15('0x7')](e)){var event=events[e];ChatQueue[_0xdf15('0x8')](e,emitEvent(event));}}module[_0xdf15('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 0435c77..f5a4b7e 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 _0x3d23=['request-promise','../../config/environment','./chatQueue.attributes','exports','chat_queues','lodash','util','../../config/logger','bluebird'];(function(_0x1be7cb,_0xf14d33){var _0xda7d7c=function(_0x3ec086){while(--_0x3ec086){_0x1be7cb['push'](_0x1be7cb['shift']());}};_0xda7d7c(++_0xf14d33);}(_0x3d23,0x83));var _0x33d2=function(_0x754ab4,_0x56daa7){_0x754ab4=_0x754ab4-0x0;var _0x34079a=_0x3d23[_0x754ab4];return _0x34079a;};'use strict';var _=require(_0x33d2('0x0'));var util=require(_0x33d2('0x1'));var logger=require(_0x33d2('0x2'))('api');var moment=require('moment');var BPromise=require(_0x33d2('0x3'));var rp=require(_0x33d2('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x33d2('0x5'));var attributes=require(_0x33d2('0x6'));module[_0x33d2('0x7')]=function(_0x376e52,_0x5aacde){return _0x376e52['define']('ChatQueue',attributes,{'tableName':_0x33d2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ae4=['./chatQueue.attributes','define','ChatQueue','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3184f5,_0x52b9d4){var _0x462835=function(_0x1d8604){while(--_0x1d8604){_0x3184f5['push'](_0x3184f5['shift']());}};_0x462835(++_0x52b9d4);}(_0x6ae4,0x184));var _0x46ae=function(_0x4cae20,_0x14e79a){_0x4cae20=_0x4cae20-0x0;var _0x22cddd=_0x6ae4[_0x4cae20];return _0x22cddd;};'use strict';var _=require('lodash');var util=require(_0x46ae('0x0'));var logger=require(_0x46ae('0x1'))(_0x46ae('0x2'));var moment=require('moment');var BPromise=require(_0x46ae('0x3'));var rp=require(_0x46ae('0x4'));var fs=require('fs');var path=require(_0x46ae('0x5'));var rimraf=require(_0x46ae('0x6'));var config=require(_0x46ae('0x7'));var attributes=require(_0x46ae('0x8'));module['exports']=function(_0x11fd5b,_0x3ef0db){return _0x11fd5b[_0x46ae('0x9')](_0x46ae('0xa'),attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 4806012..326d10d 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 _0x9458=['debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowChatQueue','raw','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','register','ChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0x9458,0x1b8));var _0x8945=function(_0x26b581,_0x24b7c8){_0x26b581=_0x26b581-0x0;var _0x456ebb=_0x9458[_0x26b581];return _0x456ebb;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8945('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8945('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8945('0x2'));var logger=require(_0x8945('0x3'))(_0x8945('0x4'));var config=require(_0x8945('0x5'));var jayson=require(_0x8945('0x6'));var client=jayson[_0x8945('0x7')][_0x8945('0x8')]({'port':0x232a});config[_0x8945('0x9')]=_[_0x8945('0xa')](config[_0x8945('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x8945('0xb'))(new Redis(config[_0x8945('0x9')]));require(_0x8945('0xc'))[_0x8945('0xd')](socket);function respondWithRpcPromise(_0x30b9c9,_0xf8f04e,_0x5e2319){return new BPromise(function(_0xdef672,_0x27396c){return client['request'](_0x30b9c9,_0x5e2319)['then'](function(_0xd0fcbf){logger['info'](_0x8945('0xe'),_0xf8f04e,_0x8945('0xf'));logger[_0x8945('0x10')](_0x8945('0x11'),_0xf8f04e,_0x8945('0xf'),JSON[_0x8945('0x12')](_0xd0fcbf));if(_0xd0fcbf['error']){if(_0xd0fcbf[_0x8945('0x13')][_0x8945('0x14')]===0x1f4){logger['error'](_0x8945('0xe'),_0xf8f04e,_0xd0fcbf[_0x8945('0x13')][_0x8945('0x15')]);return _0x27396c(_0xd0fcbf[_0x8945('0x13')][_0x8945('0x15')]);}logger[_0x8945('0x13')]('ChatQueue,\x20%s,\x20%s',_0xf8f04e,_0xd0fcbf['error'][_0x8945('0x15')]);return _0xdef672(_0xd0fcbf['error']['message']);}else{logger[_0x8945('0x16')]('ChatQueue,\x20%s,\x20%s',_0xf8f04e,'request\x20sent');_0xdef672(_0xd0fcbf[_0x8945('0x17')][_0x8945('0x15')]);}})[_0x8945('0x18')](function(_0x3b0c40){logger[_0x8945('0x13')](_0x8945('0xe'),_0xf8f04e,_0x3b0c40);_0x27396c(_0x3b0c40);});});}exports[_0x8945('0x19')]=function(_0x1baf28){var _0x323b44=this;return new Promise(function(_0x9174f4,_0x1738e1){return db[_0x8945('0x1a')][_0x8945('0x1b')]({'raw':_0x1baf28[_0x8945('0x1c')]?_0x1baf28['options']['raw']===undefined?!![]:![]:!![],'where':_0x1baf28['options']?_0x1baf28['options'][_0x8945('0x1d')]||null:null,'attributes':_0x1baf28[_0x8945('0x1c')]?_0x1baf28[_0x8945('0x1c')][_0x8945('0x1e')]||null:null,'limit':_0x1baf28[_0x8945('0x1c')]?_0x1baf28[_0x8945('0x1c')][_0x8945('0x1f')]||null:null,'include':_0x1baf28['options']?_0x1baf28[_0x8945('0x1c')][_0x8945('0x20')]?_[_0x8945('0x21')](_0x1baf28[_0x8945('0x1c')][_0x8945('0x20')],function(_0x5a5f0b){return{'model':db[_0x5a5f0b[_0x8945('0x22')]],'as':_0x5a5f0b['as'],'attributes':_0x5a5f0b[_0x8945('0x1e')],'include':_0x5a5f0b[_0x8945('0x20')]?_[_0x8945('0x21')](_0x5a5f0b[_0x8945('0x20')],function(_0x3ff1d6){return{'model':db[_0x3ff1d6['model']],'as':_0x3ff1d6['as'],'attributes':_0x3ff1d6[_0x8945('0x1e')],'include':_0x3ff1d6['include']?_[_0x8945('0x21')](_0x3ff1d6['include'],function(_0xd5f709){return{'model':db[_0xd5f709[_0x8945('0x22')]],'as':_0xd5f709['as'],'attributes':_0xd5f709[_0x8945('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8945('0x23')](function(_0x4cf946){logger[_0x8945('0x16')](_0x8945('0x19'),_0x1baf28);logger[_0x8945('0x10')](_0x8945('0x19'),_0x1baf28,JSON[_0x8945('0x12')](_0x4cf946));_0x9174f4(_0x4cf946);})[_0x8945('0x18')](function(_0x28fe7f){logger[_0x8945('0x13')](_0x8945('0x19'),_0x28fe7f[_0x8945('0x15')],_0x1baf28);_0x1738e1(_0x323b44[_0x8945('0x13')](0x1f4,_0x28fe7f[_0x8945('0x15')]));});});};exports[_0x8945('0x24')]=function(_0x4bf762){var _0x5dc86d=this;return new Promise(function(_0x522e52,_0x1779ee){return db['ChatQueue']['find']({'raw':_0x4bf762[_0x8945('0x1c')]?_0x4bf762[_0x8945('0x1c')][_0x8945('0x25')]===undefined?!![]:![]:!![],'where':_0x4bf762['options']?_0x4bf762[_0x8945('0x1c')][_0x8945('0x1d')]||null:null,'attributes':_0x4bf762['options']?_0x4bf762[_0x8945('0x1c')][_0x8945('0x1e')]||null:null,'include':_0x4bf762[_0x8945('0x1c')]?_0x4bf762['options']['include']?_['map'](_0x4bf762[_0x8945('0x1c')]['include'],function(_0xadcde6){return{'model':db[_0xadcde6[_0x8945('0x22')]],'as':_0xadcde6['as'],'attributes':_0xadcde6[_0x8945('0x1e')],'include':_0xadcde6[_0x8945('0x20')]?_[_0x8945('0x21')](_0xadcde6['include'],function(_0x5fa31){return{'model':db[_0x5fa31['model']],'as':_0x5fa31['as'],'attributes':_0x5fa31[_0x8945('0x1e')],'include':_0x5fa31[_0x8945('0x20')]?_[_0x8945('0x21')](_0x5fa31[_0x8945('0x20')],function(_0x5657d4){return{'model':db[_0x5657d4[_0x8945('0x22')]],'as':_0x5657d4['as'],'attributes':_0x5657d4[_0x8945('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8945('0x23')](function(_0x3da787){logger[_0x8945('0x16')](_0x8945('0x24'),_0x4bf762);logger[_0x8945('0x10')](_0x8945('0x24'),_0x4bf762,JSON[_0x8945('0x12')](_0x3da787));_0x522e52(_0x3da787);})[_0x8945('0x18')](function(_0x6509da){logger[_0x8945('0x13')](_0x8945('0x24'),_0x6509da[_0x8945('0x15')],_0x4bf762);_0x1779ee(_0x5dc86d[_0x8945('0x13')](0x1f4,_0x6509da[_0x8945('0x15')]));});});}; \ No newline at end of file +var _0x0f97=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatQueue,\x20%s,\x20%s','result','GetChatQueue','ChatQueue','findAll','options','where','limit','include','map','model','attributes','find','raw','ShowChatQueue','catch','lodash','util','moment','bluebird'];(function(_0x5bf28c,_0x5e3610){var _0x40a3ab=function(_0x146ad1){while(--_0x146ad1){_0x5bf28c['push'](_0x5bf28c['shift']());}};_0x40a3ab(++_0x5e3610);}(_0x0f97,0x196));var _0x70f9=function(_0x2b305c,_0x5ae303){_0x2b305c=_0x2b305c-0x0;var _0x5d8c85=_0x0f97[_0x2b305c];return _0x5d8c85;};'use strict';var _=require(_0x70f9('0x0'));var util=require(_0x70f9('0x1'));var moment=require(_0x70f9('0x2'));var BPromise=require(_0x70f9('0x3'));var rs=require(_0x70f9('0x4'));var fs=require('fs');var Redis=require(_0x70f9('0x5'));var db=require(_0x70f9('0x6'))['db'];var utils=require(_0x70f9('0x7'));var logger=require(_0x70f9('0x8'))(_0x70f9('0x9'));var config=require(_0x70f9('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x70f9('0xb')]({'port':0x232a});config[_0x70f9('0xc')]=_[_0x70f9('0xd')](config[_0x70f9('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x70f9('0xc')]));require(_0x70f9('0xe'))[_0x70f9('0xf')](socket);function respondWithRpcPromise(_0xa97b2,_0x481fc2,_0x4c8cb4){return new BPromise(function(_0x5de133,_0x50f052){return client[_0x70f9('0x10')](_0xa97b2,_0x4c8cb4)[_0x70f9('0x11')](function(_0x5951be){logger[_0x70f9('0x12')]('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x70f9('0x13'));logger[_0x70f9('0x14')](_0x70f9('0x15'),_0x481fc2,_0x70f9('0x13'),JSON[_0x70f9('0x16')](_0x5951be));if(_0x5951be['error']){if(_0x5951be[_0x70f9('0x17')]['code']===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x481fc2,_0x5951be['error'][_0x70f9('0x18')]);return _0x50f052(_0x5951be['error'][_0x70f9('0x18')]);}logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);return _0x5de133(_0x5951be[_0x70f9('0x17')][_0x70f9('0x18')]);}else{logger[_0x70f9('0x12')](_0x70f9('0x19'),_0x481fc2,'request\x20sent');_0x5de133(_0x5951be[_0x70f9('0x1a')][_0x70f9('0x18')]);}})['catch'](function(_0x35ba0b){logger[_0x70f9('0x17')](_0x70f9('0x19'),_0x481fc2,_0x35ba0b);_0x50f052(_0x35ba0b);});});}exports[_0x70f9('0x1b')]=function(_0x4e7cce){var _0x57caca=this;return new Promise(function(_0x14de5c,_0x24a7f1){return db[_0x70f9('0x1c')][_0x70f9('0x1d')]({'raw':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')]['attributes']||null:null,'limit':_0x4e7cce[_0x70f9('0x1e')]?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x20')]||null:null,'include':_0x4e7cce['options']?_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x4e7cce[_0x70f9('0x1e')][_0x70f9('0x21')],function(_0x49337a){return{'model':db[_0x49337a[_0x70f9('0x23')]],'as':_0x49337a['as'],'attributes':_0x49337a[_0x70f9('0x24')],'include':_0x49337a[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x49337a[_0x70f9('0x21')],function(_0xfe324e){return{'model':db[_0xfe324e['model']],'as':_0xfe324e['as'],'attributes':_0xfe324e[_0x70f9('0x24')],'include':_0xfe324e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0xfe324e[_0x70f9('0x21')],function(_0x35d452){return{'model':db[_0x35d452[_0x70f9('0x23')]],'as':_0x35d452['as'],'attributes':_0x35d452[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x562b72){logger['info'](_0x70f9('0x1b'),_0x4e7cce);logger[_0x70f9('0x14')](_0x70f9('0x1b'),_0x4e7cce,JSON['stringify'](_0x562b72));_0x14de5c(_0x562b72);})['catch'](function(_0x40496a){logger[_0x70f9('0x17')]('GetChatQueue',_0x40496a['message'],_0x4e7cce);_0x24a7f1(_0x57caca[_0x70f9('0x17')](0x1f4,_0x40496a[_0x70f9('0x18')]));});});};exports['ShowChatQueue']=function(_0x2a8cc9){var _0x227845=this;return new Promise(function(_0x47a7d7,_0x8bc855){return db[_0x70f9('0x1c')][_0x70f9('0x25')]({'raw':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x26')]===undefined?!![]:![]:!![],'where':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x1f')]||null:null,'attributes':_0x2a8cc9['options']?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x24')]||null:null,'include':_0x2a8cc9[_0x70f9('0x1e')]?_0x2a8cc9[_0x70f9('0x1e')][_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x2a8cc9[_0x70f9('0x1e')]['include'],function(_0x3a7e9e){return{'model':db[_0x3a7e9e[_0x70f9('0x23')]],'as':_0x3a7e9e['as'],'attributes':_0x3a7e9e[_0x70f9('0x24')],'include':_0x3a7e9e[_0x70f9('0x21')]?_[_0x70f9('0x22')](_0x3a7e9e[_0x70f9('0x21')],function(_0x5adf6e){return{'model':db[_0x5adf6e[_0x70f9('0x23')]],'as':_0x5adf6e['as'],'attributes':_0x5adf6e[_0x70f9('0x24')],'include':_0x5adf6e['include']?_[_0x70f9('0x22')](_0x5adf6e['include'],function(_0x375d84){return{'model':db[_0x375d84['model']],'as':_0x375d84['as'],'attributes':_0x375d84[_0x70f9('0x24')]};}):[]};}):[]};}):[]:[]})[_0x70f9('0x11')](function(_0x38e305){logger[_0x70f9('0x12')](_0x70f9('0x27'),_0x2a8cc9);logger[_0x70f9('0x14')](_0x70f9('0x27'),_0x2a8cc9,JSON[_0x70f9('0x16')](_0x38e305));_0x47a7d7(_0x38e305);})[_0x70f9('0x28')](function(_0x16c40c){logger['error'](_0x70f9('0x27'),_0x16c40c[_0x70f9('0x18')],_0x2a8cc9);_0x8bc855(_0x227845[_0x70f9('0x17')](0x1f4,_0x16c40c[_0x70f9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index f8e3a2f..1b5299c 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 _0xb821=['remove','removeListener','register','length','chatQueue:','save'];(function(_0x32a2ed,_0x3294ac){var _0x48a283=function(_0x1f85e0){while(--_0x1f85e0){_0x32a2ed['push'](_0x32a2ed['shift']());}};_0x48a283(++_0x3294ac);}(_0xb821,0xa7));var _0x1b82=function(_0x34a584,_0x5b98bb){_0x34a584=_0x34a584-0x0;var _0x2420df=_0xb821[_0x34a584];return _0x2420df;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x1b82('0x0'),_0x1b82('0x1'),'update'];function createListener(_0x4a4f81,_0xbab478){return function(_0x578a10){_0xbab478['emit'](_0x4a4f81,_0x578a10);};}function removeListener(_0x3b1d14,_0x1403ab){return function(){ChatQueueEvents[_0x1b82('0x2')](_0x3b1d14,_0x1403ab);};}exports[_0x1b82('0x3')]=function(_0x597ca7){for(var _0x3e27c4=0x0,_0x192434=events[_0x1b82('0x4')];_0x3e27c4<_0x192434;_0x3e27c4++){var _0x3632dd=events[_0x3e27c4];var _0x18f45f=createListener(_0x1b82('0x5')+_0x3632dd,_0x597ca7);ChatQueueEvents['on'](_0x3632dd,_0x18f45f);}}; \ No newline at end of file +var _0x4fdb=['removeListener','length','./chatQueue.events','save','remove','update','emit'];(function(_0x57c029,_0x302ebd){var _0x6b7d44=function(_0x13396a){while(--_0x13396a){_0x57c029['push'](_0x57c029['shift']());}};_0x6b7d44(++_0x302ebd);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x210c1e,_0xf9d47c){_0x210c1e=_0x210c1e-0x0;var _0x252ffd=_0x4fdb[_0x210c1e];return _0x252ffd;};'use strict';var ChatQueueEvents=require(_0xb4fd('0x0'));var events=[_0xb4fd('0x1'),_0xb4fd('0x2'),_0xb4fd('0x3')];function createListener(_0x3b399e,_0xafe34b){return function(_0x260a35){_0xafe34b[_0xb4fd('0x4')](_0x3b399e,_0x260a35);};}function removeListener(_0x1c0b08,_0x5b73bb){return function(){ChatQueueEvents[_0xb4fd('0x5')](_0x1c0b08,_0x5b73bb);};}exports['register']=function(_0x14052b){for(var _0x5d8b39=0x0,_0x53273f=events[_0xb4fd('0x6')];_0x5d8b39<_0x53273f;_0x5d8b39++){var _0x3af8e3=events[_0x5d8b39];var _0x1151b5=createListener('chatQueue:'+_0x3af8e3,_0x14052b);ChatQueueEvents['on'](_0x3af8e3,_0x1151b5);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index e7523a8..a9fedff 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 _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x456fdf,_0x21483e){var _0x27d958=function(_0x36be7a){while(--_0x36be7a){_0x456fdf['push'](_0x456fdf['shift']());}};_0x27d958(++_0x21483e);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3e74,0x175));var _0x43e7=function(_0x401a77,_0x489e10){_0x401a77=_0x401a77-0x0;var _0x3b5456=_0x3e74[_0x401a77];return _0x3b5456;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 191b4d6..e005c0a 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 _0x7f58=['STRING','DATE','sequelize'];(function(_0x391866,_0x50a8c9){var _0x37b7eb=function(_0x960d38){while(--_0x960d38){_0x391866['push'](_0x391866['shift']());}};_0x37b7eb(++_0x50a8c9);}(_0x7f58,0x1ee));var _0x87f5=function(_0x2081c1,_0x25f8d2){_0x2081c1=_0x2081c1-0x0;var _0x5a8693=_0x7f58[_0x2081c1];return _0x5a8693;};'use strict';var moment=require('moment');var Sequelize=require(_0x87f5('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x87f5('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x87f5('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x87f5('0x2')]},'acceptAt':{'type':Sequelize[_0x87f5('0x2')]},'exitAt':{'type':Sequelize[_0x87f5('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x550f=['DATE','STRING'];(function(_0x56b63b,_0x161748){var _0x3f0d77=function(_0x236afb){while(--_0x236afb){_0x56b63b['push'](_0x56b63b['shift']());}};_0x3f0d77(++_0x161748);}(_0x550f,0x6d));var _0xf550=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x550f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xf550('0x0')],'allowNull':![]},'from':{'type':Sequelize[_0xf550('0x0')]},'joinAt':{'type':Sequelize[_0xf550('0x1')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xf550('0x0')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 12d0d6a..2161d15 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 _0xb145=['includeAll','findAll','rows','catch','show','params','include','options','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','ChatQueueReport','rawAttributes','type','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL'];(function(_0x58a823,_0x147dfa){var _0x3967a7=function(_0x4b7534){while(--_0x4b7534){_0x58a823['push'](_0x58a823['shift']());}};_0x3967a7(++_0x147dfa);}(_0xb145,0xa3));var _0x5b14=function(_0x519eec,_0x5d8844){_0x519eec=_0x519eec-0x0;var _0x4e3980=_0xb145[_0x519eec];return _0x4e3980;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5b14('0x0'));var zipdir=require(_0x5b14('0x1'));var jsonpatch=require(_0x5b14('0x2'));var rp=require(_0x5b14('0x3'));var moment=require(_0x5b14('0x4'));var BPromise=require(_0x5b14('0x5'));var Mustache=require(_0x5b14('0x6'));var util=require(_0x5b14('0x7'));var path=require('path');var sox=require(_0x5b14('0x8'));var csv=require(_0x5b14('0x9'));var ejs=require(_0x5b14('0xa'));var fs=require('fs');var fs_extra=require(_0x5b14('0xb'));var _=require('lodash');var squel=require(_0x5b14('0xc'));var crypto=require(_0x5b14('0xd'));var jsforce=require(_0x5b14('0xe'));var deskjs=require(_0x5b14('0xf'));var toCsv=require(_0x5b14('0x9'));var querystring=require('querystring');var Papa=require(_0x5b14('0x10'));var Redis=require(_0x5b14('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b14('0x12'));var as=require(_0x5b14('0x13'));var hardwareService=require(_0x5b14('0x14'));var logger=require(_0x5b14('0x15'))(_0x5b14('0x16'));var utils=require('../../config/utils');var config=require(_0x5b14('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x5b14('0x18'))['db'];function respondWithStatusCode(_0x1903a5,_0xc33723){_0xc33723=_0xc33723||0xcc;return function(_0x1cb56b){if(_0x1cb56b){return _0x1903a5[_0x5b14('0x19')](_0xc33723);}return _0x1903a5[_0x5b14('0x1a')](_0xc33723)['end']();};}function respondWithResult(_0x27b34b,_0x16f2a1){_0x16f2a1=_0x16f2a1||0xc8;return function(_0x35fb8b){if(_0x35fb8b){return _0x27b34b[_0x5b14('0x1a')](_0x16f2a1)[_0x5b14('0x1b')](_0x35fb8b);}};}function respondWithFilteredResult(_0x2a8fe5,_0x68f695){return function(_0xe5af75){if(_0xe5af75){var _0x183b0a=typeof _0x68f695[_0x5b14('0x1c')]===_0x5b14('0x1d')&&typeof _0x68f695[_0x5b14('0x1e')]==='undefined';var _0x24cfd0=_0xe5af75['count'];var _0x48d395=_0x183b0a?0x0:_0x68f695['offset'];var _0x3f397d=_0x183b0a?_0xe5af75[_0x5b14('0x1f')]:_0x68f695[_0x5b14('0x1c')]+_0x68f695[_0x5b14('0x1e')];var _0x3786f7;if(_0x3f397d>=_0x24cfd0){_0x3f397d=_0x24cfd0;_0x3786f7=0xc8;}else{_0x3786f7=0xce;}_0x2a8fe5[_0x5b14('0x1a')](_0x3786f7);return _0x2a8fe5[_0x5b14('0x20')]('Content-Range',_0x48d395+'-'+_0x3f397d+'/'+_0x24cfd0)['json'](_0xe5af75);}return null;};}function patchUpdates(_0x4fa079){return function(_0x4f4717){try{jsonpatch[_0x5b14('0x21')](_0x4f4717,_0x4fa079,!![]);}catch(_0x9a9495){return BPromise[_0x5b14('0x22')](_0x9a9495);}return _0x4f4717['save']();};}function saveUpdates(_0x1018d9,_0x1577f7){return function(_0x4857c7){if(_0x4857c7){return _0x4857c7[_0x5b14('0x23')](_0x1018d9)[_0x5b14('0x24')](function(_0x50951f){return _0x50951f;});}return null;};}function removeEntity(_0x33a293,_0x54073f){return function(_0x59282c){if(_0x59282c){return _0x59282c['destroy']()['then'](function(){_0x33a293[_0x5b14('0x1a')](0xcc)[_0x5b14('0x25')]();});}};}function handleEntityNotFound(_0x153a25,_0x5da505){return function(_0x46f86a){if(!_0x46f86a){_0x153a25[_0x5b14('0x19')](0x194);}return _0x46f86a;};}function handleError(_0x2ac7b0,_0x143648){_0x143648=_0x143648||0x1f4;return function(_0xe6851b){logger[_0x5b14('0x26')](_0xe6851b[_0x5b14('0x27')]);if(_0xe6851b[_0x5b14('0x28')]){delete _0xe6851b[_0x5b14('0x28')];}_0x2ac7b0[_0x5b14('0x1a')](_0x143648)[_0x5b14('0x29')](_0xe6851b);};}exports[_0x5b14('0x2a')]=function(_0x1c3c52,_0x266bbe){var _0x4cfd66={},_0x370fcd={},_0x18a76d={'count':0x0,'rows':[]};var _0x53b13d=_['map'](db[_0x5b14('0x2b')][_0x5b14('0x2c')],function(_0x5dca4f){return{'name':_0x5dca4f['fieldName'],'type':_0x5dca4f[_0x5b14('0x2d')]['key']};});_0x370fcd[_0x5b14('0x2e')]=_[_0x5b14('0x2f')](_0x53b13d,'name');_0x370fcd['query']=_[_0x5b14('0x30')](_0x1c3c52[_0x5b14('0x31')]);_0x370fcd[_0x5b14('0x32')]=_['intersection'](_0x370fcd[_0x5b14('0x2e')],_0x370fcd['query']);_0x4cfd66[_0x5b14('0x33')]=_[_0x5b14('0x34')](_0x370fcd[_0x5b14('0x2e')],qs[_0x5b14('0x35')](_0x1c3c52['query'][_0x5b14('0x35')]));_0x4cfd66[_0x5b14('0x33')]=_0x4cfd66[_0x5b14('0x33')][_0x5b14('0x36')]?_0x4cfd66['attributes']:_0x370fcd[_0x5b14('0x2e')];if(!_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x37')]('nolimit')){_0x4cfd66[_0x5b14('0x1e')]=qs['limit'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x1e')]);_0x4cfd66['offset']=qs[_0x5b14('0x1c')](_0x1c3c52[_0x5b14('0x31')]['offset']);}_0x4cfd66[_0x5b14('0x38')]=qs['sort'](_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x39')]);_0x4cfd66[_0x5b14('0x3a')]=qs[_0x5b14('0x32')](_['pick'](_0x1c3c52[_0x5b14('0x31')],_0x370fcd[_0x5b14('0x32')]),_0x53b13d);if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]){_0x4cfd66[_0x5b14('0x3a')]=_[_0x5b14('0x3c')](_0x4cfd66[_0x5b14('0x3a')],{'$or':_[_0x5b14('0x2f')](_0x53b13d,function(_0x4f647c){if(_0x4f647c[_0x5b14('0x2d')]!==_0x5b14('0x3d')){var _0x3f9d1d={};_0x3f9d1d[_0x4f647c[_0x5b14('0x28')]]={'$like':'%'+_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3b')]+'%'};return _0x3f9d1d;}})});}_0x4cfd66=_[_0x5b14('0x3c')]({},_0x4cfd66,_0x1c3c52['options']);var _0x2ebaa8={'where':_0x4cfd66['where']};return db[_0x5b14('0x2b')][_0x5b14('0x1f')](_0x2ebaa8)['then'](function(_0x4c05ac){_0x18a76d['count']=_0x4c05ac;if(_0x1c3c52[_0x5b14('0x31')][_0x5b14('0x3e')]){_0x4cfd66['include']=[{'all':!![]}];}return db[_0x5b14('0x2b')][_0x5b14('0x3f')](_0x4cfd66);})[_0x5b14('0x24')](function(_0x3d0369){_0x18a76d[_0x5b14('0x40')]=_0x3d0369;return _0x18a76d;})['then'](respondWithFilteredResult(_0x266bbe,_0x4cfd66))[_0x5b14('0x41')](handleError(_0x266bbe,null));};exports[_0x5b14('0x42')]=function(_0x4fb46e,_0x996aee){var _0x985e69={'raw':!![],'where':{'id':_0x4fb46e[_0x5b14('0x43')]['id']}},_0x5cc257={};_0x5cc257['model']=_[_0x5b14('0x30')](db[_0x5b14('0x2b')][_0x5b14('0x2c')]);_0x5cc257[_0x5b14('0x31')]=_['keys'](_0x4fb46e[_0x5b14('0x31')]);_0x5cc257[_0x5b14('0x32')]=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],_0x5cc257['query']);_0x985e69['attributes']=_[_0x5b14('0x34')](_0x5cc257[_0x5b14('0x2e')],qs['fields'](_0x4fb46e[_0x5b14('0x31')]['fields']));_0x985e69[_0x5b14('0x33')]=_0x985e69[_0x5b14('0x33')][_0x5b14('0x36')]?_0x985e69[_0x5b14('0x33')]:_0x5cc257[_0x5b14('0x2e')];if(_0x4fb46e['query'][_0x5b14('0x3e')]){_0x985e69[_0x5b14('0x44')]=[{'all':!![]}];}_0x985e69=_[_0x5b14('0x3c')]({},_0x985e69,_0x4fb46e[_0x5b14('0x45')]);return db[_0x5b14('0x2b')]['find'](_0x985e69)['then'](handleEntityNotFound(_0x996aee,null))[_0x5b14('0x24')](respondWithResult(_0x996aee,null))['catch'](handleError(_0x996aee,null));};exports['create']=function(_0x4825b4,_0x35d00d){return db[_0x5b14('0x2b')][_0x5b14('0x46')](_0x4825b4[_0x5b14('0x47')],{})[_0x5b14('0x24')](respondWithResult(_0x35d00d,0xc9))[_0x5b14('0x41')](handleError(_0x35d00d,null));};exports[_0x5b14('0x23')]=function(_0x4d2bee,_0x548e1c){if(_0x4d2bee['body']['id']){delete _0x4d2bee['body']['id'];}return db['ChatQueueReport'][_0x5b14('0x48')]({'where':{'id':_0x4d2bee[_0x5b14('0x43')]['id']}})[_0x5b14('0x24')](handleEntityNotFound(_0x548e1c,null))[_0x5b14('0x24')](saveUpdates(_0x4d2bee[_0x5b14('0x47')],null))['then'](respondWithResult(_0x548e1c,null))['catch'](handleError(_0x548e1c,null));};exports[_0x5b14('0x49')]=function(_0xd6ea50,_0x58b18e){return db[_0x5b14('0x2b')][_0x5b14('0x48')]({'where':{'id':_0xd6ea50['params']['id']}})['then'](handleEntityNotFound(_0x58b18e,null))[_0x5b14('0x24')](removeEntity(_0x58b18e,null))[_0x5b14('0x41')](handleError(_0x58b18e,null));};exports[_0x5b14('0x4a')]=function(_0x5d3782,_0x1a51d5){return db[_0x5b14('0x2b')][_0x5b14('0x4a')]()[_0x5b14('0x24')](respondWithResult(_0x1a51d5,null))[_0x5b14('0x41')](handleError(_0x1a51d5,null));}; \ No newline at end of file +var _0xe6e9=['where','merge','VIRTUAL','includeAll','include','ChatQueueReport','findAll','catch','show','keys','options','create','body','find','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','rawAttributes','type','model','query','intersection','attributes','fields','length','order','filters','pick','filter'];(function(_0x103314,_0x319d36){var _0x2f0601=function(_0x209a87){while(--_0x209a87){_0x103314['push'](_0x103314['shift']());}};_0x2f0601(++_0x319d36);}(_0xe6e9,0x182));var _0x9e6e=function(_0x15b492,_0x859298){_0x15b492=_0x15b492-0x0;var _0x16a45f=_0xe6e9[_0x15b492];return _0x16a45f;};'use strict';var emlformat=require(_0x9e6e('0x0'));var rimraf=require(_0x9e6e('0x1'));var zipdir=require(_0x9e6e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e6e('0x3'));var moment=require(_0x9e6e('0x4'));var BPromise=require(_0x9e6e('0x5'));var Mustache=require(_0x9e6e('0x6'));var util=require(_0x9e6e('0x7'));var path=require('path');var sox=require(_0x9e6e('0x8'));var csv=require(_0x9e6e('0x9'));var ejs=require(_0x9e6e('0xa'));var fs=require('fs');var fs_extra=require(_0x9e6e('0xb'));var _=require(_0x9e6e('0xc'));var squel=require('squel');var crypto=require(_0x9e6e('0xd'));var jsforce=require(_0x9e6e('0xe'));var deskjs=require(_0x9e6e('0xf'));var toCsv=require(_0x9e6e('0x9'));var querystring=require(_0x9e6e('0x10'));var Papa=require(_0x9e6e('0x11'));var Redis=require('ioredis');var authService=require(_0x9e6e('0x12'));var qs=require(_0x9e6e('0x13'));var as=require(_0x9e6e('0x14'));var hardwareService=require(_0x9e6e('0x15'));var logger=require('../../config/logger')(_0x9e6e('0x16'));var utils=require(_0x9e6e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x9e6e('0x18'));var db=require(_0x9e6e('0x19'))['db'];function respondWithStatusCode(_0x1b85f1,_0x363f0c){_0x363f0c=_0x363f0c||0xcc;return function(_0x5a2cf9){if(_0x5a2cf9){return _0x1b85f1[_0x9e6e('0x1a')](_0x363f0c);}return _0x1b85f1[_0x9e6e('0x1b')](_0x363f0c)[_0x9e6e('0x1c')]();};}function respondWithResult(_0x2981d0,_0x3ade25){_0x3ade25=_0x3ade25||0xc8;return function(_0x38f89c){if(_0x38f89c){return _0x2981d0[_0x9e6e('0x1b')](_0x3ade25)[_0x9e6e('0x1d')](_0x38f89c);}};}function respondWithFilteredResult(_0x3080b1,_0x2dbdba){return function(_0x1941da){if(_0x1941da){var _0x236850=typeof _0x2dbdba[_0x9e6e('0x1e')]===_0x9e6e('0x1f')&&typeof _0x2dbdba[_0x9e6e('0x20')]===_0x9e6e('0x1f');var _0x592ba=_0x1941da[_0x9e6e('0x21')];var _0xfd921e=_0x236850?0x0:_0x2dbdba[_0x9e6e('0x1e')];var _0x2c5876=_0x236850?_0x1941da['count']:_0x2dbdba['offset']+_0x2dbdba['limit'];var _0x14acbd;if(_0x2c5876>=_0x592ba){_0x2c5876=_0x592ba;_0x14acbd=0xc8;}else{_0x14acbd=0xce;}_0x3080b1[_0x9e6e('0x1b')](_0x14acbd);return _0x3080b1[_0x9e6e('0x22')](_0x9e6e('0x23'),_0xfd921e+'-'+_0x2c5876+'/'+_0x592ba)[_0x9e6e('0x1d')](_0x1941da);}return null;};}function patchUpdates(_0x3b9299){return function(_0x195727){try{jsonpatch[_0x9e6e('0x24')](_0x195727,_0x3b9299,!![]);}catch(_0x4e66e3){return BPromise[_0x9e6e('0x25')](_0x4e66e3);}return _0x195727[_0x9e6e('0x26')]();};}function saveUpdates(_0x3b3527,_0x28ae35){return function(_0x1e97c3){if(_0x1e97c3){return _0x1e97c3[_0x9e6e('0x27')](_0x3b3527)[_0x9e6e('0x28')](function(_0x59e00e){return _0x59e00e;});}return null;};}function removeEntity(_0x223fd4,_0x4202cd){return function(_0x3aee5c){if(_0x3aee5c){return _0x3aee5c[_0x9e6e('0x29')]()['then'](function(){_0x223fd4['status'](0xcc)[_0x9e6e('0x1c')]();});}};}function handleEntityNotFound(_0xb7b794,_0x26e0be){return function(_0x4e17b7){if(!_0x4e17b7){_0xb7b794['sendStatus'](0x194);}return _0x4e17b7;};}function handleError(_0x383656,_0x36fef5){_0x36fef5=_0x36fef5||0x1f4;return function(_0x200f78){logger[_0x9e6e('0x2a')](_0x200f78['stack']);if(_0x200f78['name']){delete _0x200f78[_0x9e6e('0x2b')];}_0x383656['status'](_0x36fef5)[_0x9e6e('0x2c')](_0x200f78);};}exports['index']=function(_0x43b1bf,_0x3130b8){var _0x4a0c94={},_0x2511f7={},_0x16f6f7={'count':0x0,'rows':[]};var _0x34f5ff=_[_0x9e6e('0x2d')](db['ChatQueueReport'][_0x9e6e('0x2e')],function(_0x59e4a5){return{'name':_0x59e4a5['fieldName'],'type':_0x59e4a5[_0x9e6e('0x2f')]['key']};});_0x2511f7[_0x9e6e('0x30')]=_[_0x9e6e('0x2d')](_0x34f5ff,_0x9e6e('0x2b'));_0x2511f7[_0x9e6e('0x31')]=_['keys'](_0x43b1bf[_0x9e6e('0x31')]);_0x2511f7['filters']=_[_0x9e6e('0x32')](_0x2511f7['model'],_0x2511f7['query']);_0x4a0c94[_0x9e6e('0x33')]=_[_0x9e6e('0x32')](_0x2511f7[_0x9e6e('0x30')],qs['fields'](_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x34')]));_0x4a0c94[_0x9e6e('0x33')]=_0x4a0c94['attributes'][_0x9e6e('0x35')]?_0x4a0c94[_0x9e6e('0x33')]:_0x2511f7[_0x9e6e('0x30')];if(!_0x43b1bf['query']['hasOwnProperty']('nolimit')){_0x4a0c94[_0x9e6e('0x20')]=qs[_0x9e6e('0x20')](_0x43b1bf['query'][_0x9e6e('0x20')]);_0x4a0c94['offset']=qs['offset'](_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x1e')]);}_0x4a0c94[_0x9e6e('0x36')]=qs['sort'](_0x43b1bf[_0x9e6e('0x31')]['sort']);_0x4a0c94['where']=qs[_0x9e6e('0x37')](_[_0x9e6e('0x38')](_0x43b1bf[_0x9e6e('0x31')],_0x2511f7['filters']),_0x34f5ff);if(_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x39')]){_0x4a0c94[_0x9e6e('0x3a')]=_[_0x9e6e('0x3b')](_0x4a0c94[_0x9e6e('0x3a')],{'$or':_[_0x9e6e('0x2d')](_0x34f5ff,function(_0x511df4){if(_0x511df4[_0x9e6e('0x2f')]!==_0x9e6e('0x3c')){var _0x479318={};_0x479318[_0x511df4[_0x9e6e('0x2b')]]={'$like':'%'+_0x43b1bf[_0x9e6e('0x31')][_0x9e6e('0x39')]+'%'};return _0x479318;}})});}_0x4a0c94=_[_0x9e6e('0x3b')]({},_0x4a0c94,_0x43b1bf['options']);var _0x4d045d={'where':_0x4a0c94[_0x9e6e('0x3a')]};return db['ChatQueueReport']['count'](_0x4d045d)['then'](function(_0x4ebb41){_0x16f6f7['count']=_0x4ebb41;if(_0x43b1bf['query'][_0x9e6e('0x3d')]){_0x4a0c94[_0x9e6e('0x3e')]=[{'all':!![]}];}return db[_0x9e6e('0x3f')][_0x9e6e('0x40')](_0x4a0c94);})[_0x9e6e('0x28')](function(_0x272461){_0x16f6f7['rows']=_0x272461;return _0x16f6f7;})[_0x9e6e('0x28')](respondWithFilteredResult(_0x3130b8,_0x4a0c94))[_0x9e6e('0x41')](handleError(_0x3130b8,null));};exports[_0x9e6e('0x42')]=function(_0x324d1c,_0xbda0d2){var _0x5a7f55={'raw':!![],'where':{'id':_0x324d1c['params']['id']}},_0x5e7bc4={};_0x5e7bc4[_0x9e6e('0x30')]=_[_0x9e6e('0x43')](db[_0x9e6e('0x3f')][_0x9e6e('0x2e')]);_0x5e7bc4[_0x9e6e('0x31')]=_[_0x9e6e('0x43')](_0x324d1c[_0x9e6e('0x31')]);_0x5e7bc4['filters']=_[_0x9e6e('0x32')](_0x5e7bc4[_0x9e6e('0x30')],_0x5e7bc4['query']);_0x5a7f55[_0x9e6e('0x33')]=_[_0x9e6e('0x32')](_0x5e7bc4['model'],qs['fields'](_0x324d1c[_0x9e6e('0x31')][_0x9e6e('0x34')]));_0x5a7f55[_0x9e6e('0x33')]=_0x5a7f55['attributes'][_0x9e6e('0x35')]?_0x5a7f55[_0x9e6e('0x33')]:_0x5e7bc4[_0x9e6e('0x30')];if(_0x324d1c[_0x9e6e('0x31')][_0x9e6e('0x3d')]){_0x5a7f55['include']=[{'all':!![]}];}_0x5a7f55=_['merge']({},_0x5a7f55,_0x324d1c[_0x9e6e('0x44')]);return db[_0x9e6e('0x3f')]['find'](_0x5a7f55)['then'](handleEntityNotFound(_0xbda0d2,null))[_0x9e6e('0x28')](respondWithResult(_0xbda0d2,null))[_0x9e6e('0x41')](handleError(_0xbda0d2,null));};exports['create']=function(_0x22f916,_0x44a54f){return db[_0x9e6e('0x3f')][_0x9e6e('0x45')](_0x22f916[_0x9e6e('0x46')],{})[_0x9e6e('0x28')](respondWithResult(_0x44a54f,0xc9))[_0x9e6e('0x41')](handleError(_0x44a54f,null));};exports[_0x9e6e('0x27')]=function(_0x7d8b61,_0x2c202b){if(_0x7d8b61[_0x9e6e('0x46')]['id']){delete _0x7d8b61[_0x9e6e('0x46')]['id'];}return db[_0x9e6e('0x3f')][_0x9e6e('0x47')]({'where':{'id':_0x7d8b61[_0x9e6e('0x48')]['id']}})[_0x9e6e('0x28')](handleEntityNotFound(_0x2c202b,null))[_0x9e6e('0x28')](saveUpdates(_0x7d8b61[_0x9e6e('0x46')],null))['then'](respondWithResult(_0x2c202b,null))[_0x9e6e('0x41')](handleError(_0x2c202b,null));};exports['destroy']=function(_0x52049c,_0x3c2cb7){return db['ChatQueueReport']['find']({'where':{'id':_0x52049c[_0x9e6e('0x48')]['id']}})[_0x9e6e('0x28')](handleEntityNotFound(_0x3c2cb7,null))[_0x9e6e('0x28')](removeEntity(_0x3c2cb7,null))['catch'](handleError(_0x3c2cb7,null));};exports[_0x9e6e('0x49')]=function(_0x58b478,_0x2391f9){return db['ChatQueueReport'][_0x9e6e('0x49')]()[_0x9e6e('0x28')](respondWithResult(_0x2391f9,null))[_0x9e6e('0x41')](handleError(_0x2391f9,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 73f52b3..73a2f93 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 _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));module[_0x3071('0x8')]=function(_0xabd7b6,_0x41cf76){return _0xabd7b6[_0x3071('0x9')](_0x3071('0xa'),attributes,{'tableName':_0x3071('0xb'),'paranoid':![],'indexes':[{'name':_0x3071('0xc'),'fields':[_0x3071('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x47295c,_0x5e82a6){var _0x4b5d81=function(_0x56aef4){while(--_0x56aef4){_0x47295c['push'](_0x47295c['shift']());}};_0x4b5d81(++_0x5e82a6);}(_0x757a,0xde));var _0xa757=function(_0x1114af,_0x5c0913){_0x1114af=_0x1114af-0x0;var _0x314bb6=_0x757a[_0x1114af];return _0x314bb6;};'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 c749343..08c16a4 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 _0x2b22=['CreateChatQueueReport','create','body','options','raw','debug','catch','ChatQueueReport','update','where','attributes','limit','UpdateChatQueueReport','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result'];(function(_0x1aa3fe,_0x27c5fa){var _0x163cee=function(_0x2a1505){while(--_0x2a1505){_0x1aa3fe['push'](_0x1aa3fe['shift']());}};_0x163cee(++_0x27c5fa);}(_0x2b22,0xf4));var _0x22b2=function(_0x415644,_0x1a1f29){_0x415644=_0x415644-0x0;var _0x435868=_0x2b22[_0x415644];return _0x435868;};'use strict';var _=require(_0x22b2('0x0'));var util=require(_0x22b2('0x1'));var moment=require(_0x22b2('0x2'));var BPromise=require(_0x22b2('0x3'));var rs=require(_0x22b2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22b2('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x22b2('0x6'))('rpc');var config=require(_0x22b2('0x7'));var jayson=require(_0x22b2('0x8'));var client=jayson[_0x22b2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3adb9a,_0x131f2b,_0xad3eed){return new BPromise(function(_0xc2a90b,_0x2ccc96){return client[_0x22b2('0xa')](_0x3adb9a,_0xad3eed)[_0x22b2('0xb')](function(_0x30db3c){logger[_0x22b2('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x131f2b,_0x22b2('0xd'));logger['debug']('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x131f2b,_0x22b2('0xd'),JSON[_0x22b2('0xe')](_0x30db3c));if(_0x30db3c[_0x22b2('0xf')]){if(_0x30db3c['error'][_0x22b2('0x10')]===0x1f4){logger['error'](_0x22b2('0x11'),_0x131f2b,_0x30db3c[_0x22b2('0xf')]['message']);return _0x2ccc96(_0x30db3c[_0x22b2('0xf')][_0x22b2('0x12')]);}logger[_0x22b2('0xf')](_0x22b2('0x11'),_0x131f2b,_0x30db3c[_0x22b2('0xf')][_0x22b2('0x12')]);return _0xc2a90b(_0x30db3c['error'][_0x22b2('0x12')]);}else{logger[_0x22b2('0xc')](_0x22b2('0x11'),_0x131f2b,_0x22b2('0xd'));_0xc2a90b(_0x30db3c[_0x22b2('0x13')][_0x22b2('0x12')]);}})['catch'](function(_0x2418e6){logger[_0x22b2('0xf')](_0x22b2('0x11'),_0x131f2b,_0x2418e6);_0x2ccc96(_0x2418e6);});});}exports[_0x22b2('0x14')]=function(_0x4f1c65){var _0x5792e8=this;return new Promise(function(_0x57bd92,_0x25c211){return db['ChatQueueReport'][_0x22b2('0x15')](_0x4f1c65[_0x22b2('0x16')],{'raw':_0x4f1c65['options']?_0x4f1c65[_0x22b2('0x17')][_0x22b2('0x18')]===undefined?!![]:![]:!![]})[_0x22b2('0xb')](function(_0x57d092){logger[_0x22b2('0xc')](_0x22b2('0x14'),_0x4f1c65);logger[_0x22b2('0x19')](_0x22b2('0x14'),_0x4f1c65,JSON[_0x22b2('0xe')](_0x57d092));_0x57bd92(_0x57d092);})[_0x22b2('0x1a')](function(_0x54beed){logger[_0x22b2('0xf')](_0x22b2('0x14'),_0x54beed[_0x22b2('0x12')],_0x4f1c65);_0x25c211(_0x5792e8[_0x22b2('0xf')](0x1f4,_0x54beed[_0x22b2('0x12')]));});});};exports['UpdateChatQueueReport']=function(_0x353e5f){var _0x831a52=this;return new Promise(function(_0x2464b8,_0x11ff04){return db[_0x22b2('0x1b')][_0x22b2('0x1c')](_0x353e5f['body'],{'raw':_0x353e5f['options']?_0x353e5f[_0x22b2('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353e5f[_0x22b2('0x17')]?_0x353e5f[_0x22b2('0x17')][_0x22b2('0x1d')]||null:null,'attributes':_0x353e5f[_0x22b2('0x17')]?_0x353e5f['options'][_0x22b2('0x1e')]||null:null,'limit':_0x353e5f[_0x22b2('0x17')]?_0x353e5f[_0x22b2('0x17')][_0x22b2('0x1f')]||null:null})['then'](function(_0x1f38a4){logger[_0x22b2('0xc')](_0x22b2('0x20'),_0x353e5f);logger['debug'](_0x22b2('0x20'),_0x353e5f,JSON['stringify'](_0x1f38a4));_0x2464b8(_0x1f38a4);})['catch'](function(_0x530f26){logger[_0x22b2('0xf')](_0x22b2('0x20'),_0x530f26[_0x22b2('0x12')],_0x353e5f);_0x11ff04(_0x831a52[_0x22b2('0xf')](0x1f4,_0x530f26['message']));});});}; \ No newline at end of file +var _0x93d3=['result','catch','CreateChatQueueReport','ChatQueueReport','create','options','UpdateChatQueueReport','update','raw','attributes','limit','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x595a21,_0x24790f){var _0x50df84=function(_0x3c7188){while(--_0x3c7188){_0x595a21['push'](_0x595a21['shift']());}};_0x50df84(++_0x24790f);}(_0x93d3,0x1ec));var _0x393d=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x93d3[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x393d('0x0'));var util=require(_0x393d('0x1'));var moment=require(_0x393d('0x2'));var BPromise=require(_0x393d('0x3'));var rs=require(_0x393d('0x4'));var fs=require('fs');var Redis=require(_0x393d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x393d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x393d('0x7'));var jayson=require(_0x393d('0x8'));var client=jayson[_0x393d('0x9')][_0x393d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5267ac,_0x114d22,_0x5b75ea){return new BPromise(function(_0x53f6a4,_0x38825e){return client[_0x393d('0xb')](_0x5267ac,_0x5b75ea)[_0x393d('0xc')](function(_0x56ea95){logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,'request\x20sent');logger[_0x393d('0xf')](_0x393d('0x10'),_0x114d22,_0x393d('0x11'),JSON['stringify'](_0x56ea95));if(_0x56ea95[_0x393d('0x12')]){if(_0x56ea95[_0x393d('0x12')]['code']===0x1f4){logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95[_0x393d('0x12')][_0x393d('0x13')]);return _0x38825e(_0x56ea95['error']['message']);}logger['error'](_0x393d('0xe'),_0x114d22,_0x56ea95['error']['message']);return _0x53f6a4(_0x56ea95['error'][_0x393d('0x13')]);}else{logger[_0x393d('0xd')](_0x393d('0xe'),_0x114d22,_0x393d('0x11'));_0x53f6a4(_0x56ea95[_0x393d('0x14')][_0x393d('0x13')]);}})[_0x393d('0x15')](function(_0x34ce28){logger[_0x393d('0x12')](_0x393d('0xe'),_0x114d22,_0x34ce28);_0x38825e(_0x34ce28);});});}exports[_0x393d('0x16')]=function(_0x2d4ae5){var _0x1e16cb=this;return new Promise(function(_0x2f3f87,_0x4327fa){return db[_0x393d('0x17')][_0x393d('0x18')](_0x2d4ae5['body'],{'raw':_0x2d4ae5['options']?_0x2d4ae5[_0x393d('0x19')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x28fb9d){logger[_0x393d('0xd')](_0x393d('0x16'),_0x2d4ae5);logger[_0x393d('0xf')](_0x393d('0x16'),_0x2d4ae5,JSON['stringify'](_0x28fb9d));_0x2f3f87(_0x28fb9d);})[_0x393d('0x15')](function(_0x496f54){logger[_0x393d('0x12')](_0x393d('0x16'),_0x496f54[_0x393d('0x13')],_0x2d4ae5);_0x4327fa(_0x1e16cb[_0x393d('0x12')](0x1f4,_0x496f54[_0x393d('0x13')]));});});};exports[_0x393d('0x1a')]=function(_0x564030){var _0x271ec6=this;return new Promise(function(_0x2cfdee,_0x5b01b7){return db['ChatQueueReport'][_0x393d('0x1b')](_0x564030['body'],{'raw':_0x564030['options']?_0x564030['options'][_0x393d('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')]['where']||null:null,'attributes':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')][_0x393d('0x1d')]||null:null,'limit':_0x564030[_0x393d('0x19')]?_0x564030[_0x393d('0x19')][_0x393d('0x1e')]||null:null})['then'](function(_0x2b24dc){logger['info'](_0x393d('0x1a'),_0x564030);logger['debug'](_0x393d('0x1a'),_0x564030,JSON[_0x393d('0x1f')](_0x2b24dc));_0x2cfdee(_0x2b24dc);})[_0x393d('0x15')](function(_0x366ef4){logger['error'](_0x393d('0x1a'),_0x366ef4[_0x393d('0x13')],_0x564030);_0x5b01b7(_0x271ec6[_0x393d('0x12')](0x1f4,_0x366ef4[_0x393d('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 255ae25..95ab337 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 _0x1bcf=['../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra'];(function(_0x265003,_0xf0f023){var _0x33c743=function(_0x326a5d){while(--_0x326a5d){_0x265003['push'](_0x265003['shift']());}};_0x33c743(++_0xf0f023);}(_0x1bcf,0x121));var _0xf1bc=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x1bcf[_0x80d733];return _0x435868;};'use strict';var multer=require(_0xf1bc('0x0'));var util=require(_0xf1bc('0x1'));var path=require('path');var timeout=require(_0xf1bc('0x2'));var express=require('express');var router=express[_0xf1bc('0x3')]();var fs_extra=require(_0xf1bc('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xf1bc('0x5'));var config=require(_0xf1bc('0x6'));var controller=require(_0xf1bc('0x7'));router[_0xf1bc('0x8')]('/',auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xa')]);router[_0xf1bc('0x8')](_0xf1bc('0xb'),auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xc')]);router[_0xf1bc('0x8')](_0xf1bc('0xd'),auth[_0xf1bc('0x9')](),controller[_0xf1bc('0xe')]);router[_0xf1bc('0xf')]('/',auth[_0xf1bc('0x9')](),controller[_0xf1bc('0x10')]);router['put'](_0xf1bc('0xd'),auth['isAuthenticated'](),controller[_0xf1bc('0x11')]);router[_0xf1bc('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xf1bc('0x13')]);module[_0xf1bc('0x14')]=router; \ No newline at end of file +var _0x7a1f=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','index','/describe','describe','post','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x11f780,_0x460e0d){var _0x25fe60=function(_0x4c886c){while(--_0x4c886c){_0x11f780['push'](_0x11f780['shift']());}};_0x25fe60(++_0x460e0d);}(_0x7a1f,0x1e1));var _0xf7a1=function(_0x2e3dfc,_0x454d6c){_0x2e3dfc=_0x2e3dfc-0x0;var _0x4b1245=_0x7a1f[_0x2e3dfc];return _0x4b1245;};'use strict';var multer=require(_0xf7a1('0x0'));var util=require(_0xf7a1('0x1'));var path=require(_0xf7a1('0x2'));var timeout=require(_0xf7a1('0x3'));var express=require(_0xf7a1('0x4'));var router=express[_0xf7a1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf7a1('0x6'));var interaction=require(_0xf7a1('0x7'));var config=require('../../config/environment');var controller=require(_0xf7a1('0x8'));router[_0xf7a1('0x9')]('/',auth['isAuthenticated'](),controller[_0xf7a1('0xa')]);router[_0xf7a1('0x9')](_0xf7a1('0xb'),auth['isAuthenticated'](),controller[_0xf7a1('0xc')]);router[_0xf7a1('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xf7a1('0xd')]('/',auth[_0xf7a1('0xe')](),controller[_0xf7a1('0xf')]);router[_0xf7a1('0x10')](_0xf7a1('0x11'),auth[_0xf7a1('0xe')](),controller[_0xf7a1('0x12')]);router[_0xf7a1('0x13')](_0xf7a1('0x11'),auth[_0xf7a1('0xe')](),controller[_0xf7a1('0x14')]);module[_0xf7a1('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 09f87f4..9b0e8a6 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 _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x37f979,_0x4e2e14){var _0x1f7f9d=function(_0x18277f){while(--_0x18277f){_0x37f979['push'](_0x37f979['shift']());}};_0x1f7f9d(++_0x4e2e14);}(_0x4b84,0x1cc));var _0x44b8=function(_0x2ffc46,_0x35ce3c){_0x2ffc46=_0x2ffc46-0x0;var _0x1eda8f=_0x4b84[_0x2ffc46];return _0x1eda8f;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x9c44,0x178));var _0x49c4=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x9c44[_0x1d1779];return _0x2377e9;};'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 de33c11..fa69cf1 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 _0x9068=['intersection','query','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','ChatTransferReport','includeAll','rows','catch','show','find','create','body','params','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','error','name','rawAttributes','type','key','map','keys','filters'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x9068,0xa4));var _0x8906=function(_0x5e9f84,_0x576552){_0x5e9f84=_0x5e9f84-0x0;var _0x3325ee=_0x9068[_0x5e9f84];return _0x3325ee;};'use strict';var emlformat=require(_0x8906('0x0'));var rimraf=require(_0x8906('0x1'));var zipdir=require(_0x8906('0x2'));var jsonpatch=require(_0x8906('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8906('0x4'));var Mustache=require(_0x8906('0x5'));var util=require('util');var path=require(_0x8906('0x6'));var sox=require(_0x8906('0x7'));var csv=require(_0x8906('0x8'));var ejs=require(_0x8906('0x9'));var fs=require('fs');var fs_extra=require(_0x8906('0xa'));var _=require(_0x8906('0xb'));var squel=require('squel');var crypto=require(_0x8906('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8906('0xd'));var toCsv=require(_0x8906('0x8'));var querystring=require(_0x8906('0xe'));var Papa=require(_0x8906('0xf'));var Redis=require(_0x8906('0x10'));var authService=require(_0x8906('0x11'));var qs=require(_0x8906('0x12'));var as=require(_0x8906('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8906('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8906('0x15'))['db'];function respondWithStatusCode(_0x3c380b,_0x2b5882){_0x2b5882=_0x2b5882||0xcc;return function(_0x672364){if(_0x672364){return _0x3c380b[_0x8906('0x16')](_0x2b5882);}return _0x3c380b[_0x8906('0x17')](_0x2b5882)['end']();};}function respondWithResult(_0x46ab0a,_0x4b02b6){_0x4b02b6=_0x4b02b6||0xc8;return function(_0x212408){if(_0x212408){return _0x46ab0a[_0x8906('0x17')](_0x4b02b6)[_0x8906('0x18')](_0x212408);}};}function respondWithFilteredResult(_0x576b57,_0x2aa690){return function(_0x39886c){if(_0x39886c){var _0x257b11=typeof _0x2aa690[_0x8906('0x19')]==='undefined'&&typeof _0x2aa690[_0x8906('0x1a')]===_0x8906('0x1b');var _0x3d40f6=_0x39886c[_0x8906('0x1c')];var _0xa97320=_0x257b11?0x0:_0x2aa690[_0x8906('0x19')];var _0x5a3d80=_0x257b11?_0x39886c[_0x8906('0x1c')]:_0x2aa690['offset']+_0x2aa690[_0x8906('0x1a')];var _0x286ff2;if(_0x5a3d80>=_0x3d40f6){_0x5a3d80=_0x3d40f6;_0x286ff2=0xc8;}else{_0x286ff2=0xce;}_0x576b57['status'](_0x286ff2);return _0x576b57['set'](_0x8906('0x1d'),_0xa97320+'-'+_0x5a3d80+'/'+_0x3d40f6)[_0x8906('0x18')](_0x39886c);}return null;};}function patchUpdates(_0x314d57){return function(_0x2584ff){try{jsonpatch[_0x8906('0x1e')](_0x2584ff,_0x314d57,!![]);}catch(_0x419242){return BPromise[_0x8906('0x1f')](_0x419242);}return _0x2584ff[_0x8906('0x20')]();};}function saveUpdates(_0x1efc87,_0x2f3b46){return function(_0x5f03c5){if(_0x5f03c5){return _0x5f03c5[_0x8906('0x21')](_0x1efc87)['then'](function(_0x256c79){return _0x256c79;});}return null;};}function removeEntity(_0x3155db,_0x4e37a8){return function(_0x2a35d8){if(_0x2a35d8){return _0x2a35d8['destroy']()[_0x8906('0x22')](function(){_0x3155db[_0x8906('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x340d00,_0x51ab61){return function(_0x60fd2a){if(!_0x60fd2a){_0x340d00[_0x8906('0x16')](0x194);}return _0x60fd2a;};}function handleError(_0x22efb8,_0x245325){_0x245325=_0x245325||0x1f4;return function(_0x40263c){logger[_0x8906('0x23')](_0x40263c['stack']);if(_0x40263c['name']){delete _0x40263c[_0x8906('0x24')];}_0x22efb8[_0x8906('0x17')](_0x245325)['send'](_0x40263c);};}exports['index']=function(_0x1d7ad8,_0x1988e8){var _0x58fbfe={},_0x180b7b={},_0x2903e={'count':0x0,'rows':[]};var _0x3892fd=_['map'](db['ChatTransferReport'][_0x8906('0x25')],function(_0x48e572){return{'name':_0x48e572['fieldName'],'type':_0x48e572[_0x8906('0x26')][_0x8906('0x27')]};});_0x180b7b['model']=_[_0x8906('0x28')](_0x3892fd,_0x8906('0x24'));_0x180b7b['query']=_[_0x8906('0x29')](_0x1d7ad8['query']);_0x180b7b[_0x8906('0x2a')]=_[_0x8906('0x2b')](_0x180b7b['model'],_0x180b7b[_0x8906('0x2c')]);_0x58fbfe[_0x8906('0x2d')]=_[_0x8906('0x2b')](_0x180b7b[_0x8906('0x2e')],qs['fields'](_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x2f')]));_0x58fbfe['attributes']=_0x58fbfe[_0x8906('0x2d')][_0x8906('0x30')]?_0x58fbfe[_0x8906('0x2d')]:_0x180b7b[_0x8906('0x2e')];if(!_0x1d7ad8['query'][_0x8906('0x31')](_0x8906('0x32'))){_0x58fbfe['limit']=qs[_0x8906('0x1a')](_0x1d7ad8['query'][_0x8906('0x1a')]);_0x58fbfe['offset']=qs[_0x8906('0x19')](_0x1d7ad8['query'][_0x8906('0x19')]);}_0x58fbfe[_0x8906('0x33')]=qs[_0x8906('0x34')](_0x1d7ad8[_0x8906('0x2c')]['sort']);_0x58fbfe[_0x8906('0x35')]=qs['filters'](_['pick'](_0x1d7ad8['query'],_0x180b7b['filters']),_0x3892fd);if(_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x36')]){_0x58fbfe[_0x8906('0x35')]=_['merge'](_0x58fbfe['where'],{'$or':_[_0x8906('0x28')](_0x3892fd,function(_0xf6a939){if(_0xf6a939['type']!==_0x8906('0x37')){var _0x23c3ce={};_0x23c3ce[_0xf6a939[_0x8906('0x24')]]={'$like':'%'+_0x1d7ad8[_0x8906('0x2c')][_0x8906('0x36')]+'%'};return _0x23c3ce;}})});}_0x58fbfe=_[_0x8906('0x38')]({},_0x58fbfe,_0x1d7ad8[_0x8906('0x39')]);var _0x5a10ed={'where':_0x58fbfe[_0x8906('0x35')]};return db[_0x8906('0x3a')][_0x8906('0x1c')](_0x5a10ed)[_0x8906('0x22')](function(_0x5508c5){_0x2903e['count']=_0x5508c5;if(_0x1d7ad8['query'][_0x8906('0x3b')]){_0x58fbfe['include']=[{'all':!![]}];}return db[_0x8906('0x3a')]['findAll'](_0x58fbfe);})[_0x8906('0x22')](function(_0x4bbeaf){_0x2903e[_0x8906('0x3c')]=_0x4bbeaf;return _0x2903e;})[_0x8906('0x22')](respondWithFilteredResult(_0x1988e8,_0x58fbfe))[_0x8906('0x3d')](handleError(_0x1988e8,null));};exports[_0x8906('0x3e')]=function(_0xa91b02,_0x377cca){var _0x545a5e={'raw':!![],'where':{'id':_0xa91b02['params']['id']}},_0x343ef3={};_0x343ef3[_0x8906('0x2e')]=_[_0x8906('0x29')](db['ChatTransferReport'][_0x8906('0x25')]);_0x343ef3[_0x8906('0x2c')]=_[_0x8906('0x29')](_0xa91b02[_0x8906('0x2c')]);_0x343ef3[_0x8906('0x2a')]=_[_0x8906('0x2b')](_0x343ef3[_0x8906('0x2e')],_0x343ef3[_0x8906('0x2c')]);_0x545a5e[_0x8906('0x2d')]=_[_0x8906('0x2b')](_0x343ef3[_0x8906('0x2e')],qs[_0x8906('0x2f')](_0xa91b02['query'][_0x8906('0x2f')]));_0x545a5e[_0x8906('0x2d')]=_0x545a5e['attributes'][_0x8906('0x30')]?_0x545a5e[_0x8906('0x2d')]:_0x343ef3['model'];if(_0xa91b02['query'][_0x8906('0x3b')]){_0x545a5e['include']=[{'all':!![]}];}_0x545a5e=_[_0x8906('0x38')]({},_0x545a5e,_0xa91b02[_0x8906('0x39')]);return db[_0x8906('0x3a')][_0x8906('0x3f')](_0x545a5e)[_0x8906('0x22')](handleEntityNotFound(_0x377cca,null))['then'](respondWithResult(_0x377cca,null))[_0x8906('0x3d')](handleError(_0x377cca,null));};exports[_0x8906('0x40')]=function(_0x5ac226,_0x13e10c){return db[_0x8906('0x3a')][_0x8906('0x40')](_0x5ac226[_0x8906('0x41')],{})[_0x8906('0x22')](respondWithResult(_0x13e10c,0xc9))['catch'](handleError(_0x13e10c,null));};exports[_0x8906('0x21')]=function(_0x53c734,_0x1549a9){if(_0x53c734[_0x8906('0x41')]['id']){delete _0x53c734['body']['id'];}return db[_0x8906('0x3a')][_0x8906('0x3f')]({'where':{'id':_0x53c734[_0x8906('0x42')]['id']}})['then'](handleEntityNotFound(_0x1549a9,null))[_0x8906('0x22')](saveUpdates(_0x53c734[_0x8906('0x41')],null))[_0x8906('0x22')](respondWithResult(_0x1549a9,null))['catch'](handleError(_0x1549a9,null));};exports[_0x8906('0x43')]=function(_0x115421,_0x47059c){return db[_0x8906('0x3a')]['find']({'where':{'id':_0x115421[_0x8906('0x42')]['id']}})[_0x8906('0x22')](handleEntityNotFound(_0x47059c,null))[_0x8906('0x22')](removeEntity(_0x47059c,null))[_0x8906('0x3d')](handleError(_0x47059c,null));};exports['describe']=function(_0x1678cb,_0x396f4e){return db[_0x8906('0x3a')][_0x8906('0x44')]()[_0x8906('0x22')](respondWithResult(_0x396f4e,null))[_0x8906('0x3d')](handleError(_0x396f4e,null));}; \ No newline at end of file +var _0x63d9=['show','params','keys','fields','then','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','map','ChatTransferReport','rawAttributes','fieldName','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','merge','filter','options','include','findAll','rows','catch'];(function(_0x357b63,_0x16c0e2){var _0x46b0cd=function(_0x4c1c1b){while(--_0x4c1c1b){_0x357b63['push'](_0x357b63['shift']());}};_0x46b0cd(++_0x16c0e2);}(_0x63d9,0xef));var _0x963d=function(_0x10fc8d,_0x34a157){_0x10fc8d=_0x10fc8d-0x0;var _0x5add3d=_0x63d9[_0x10fc8d];return _0x5add3d;};'use strict';var emlformat=require(_0x963d('0x0'));var rimraf=require(_0x963d('0x1'));var zipdir=require(_0x963d('0x2'));var jsonpatch=require(_0x963d('0x3'));var rp=require(_0x963d('0x4'));var moment=require(_0x963d('0x5'));var BPromise=require(_0x963d('0x6'));var Mustache=require(_0x963d('0x7'));var util=require(_0x963d('0x8'));var path=require(_0x963d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x963d('0xa'));var fs=require('fs');var fs_extra=require(_0x963d('0xb'));var _=require(_0x963d('0xc'));var squel=require(_0x963d('0xd'));var crypto=require(_0x963d('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x963d('0xf'));var toCsv=require(_0x963d('0x10'));var querystring=require('querystring');var Papa=require(_0x963d('0x11'));var Redis=require('ioredis');var authService=require(_0x963d('0x12'));var qs=require(_0x963d('0x13'));var as=require(_0x963d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x963d('0x15'))(_0x963d('0x16'));var utils=require(_0x963d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x963d('0x18'));var db=require(_0x963d('0x19'))['db'];function respondWithStatusCode(_0x3a681c,_0x407380){_0x407380=_0x407380||0xcc;return function(_0x29d1fc){if(_0x29d1fc){return _0x3a681c[_0x963d('0x1a')](_0x407380);}return _0x3a681c[_0x963d('0x1b')](_0x407380)[_0x963d('0x1c')]();};}function respondWithResult(_0x2fd1bf,_0x48a860){_0x48a860=_0x48a860||0xc8;return function(_0x189ee5){if(_0x189ee5){return _0x2fd1bf[_0x963d('0x1b')](_0x48a860)[_0x963d('0x1d')](_0x189ee5);}};}function respondWithFilteredResult(_0x56477e,_0x4f37dc){return function(_0x53b1cd){if(_0x53b1cd){var _0x22f78c=typeof _0x4f37dc['offset']==='undefined'&&typeof _0x4f37dc['limit']===_0x963d('0x1e');var _0x3ea1aa=_0x53b1cd[_0x963d('0x1f')];var _0xd48742=_0x22f78c?0x0:_0x4f37dc['offset'];var _0x3b82eb=_0x22f78c?_0x53b1cd[_0x963d('0x1f')]:_0x4f37dc[_0x963d('0x20')]+_0x4f37dc[_0x963d('0x21')];var _0x3f4730;if(_0x3b82eb>=_0x3ea1aa){_0x3b82eb=_0x3ea1aa;_0x3f4730=0xc8;}else{_0x3f4730=0xce;}_0x56477e['status'](_0x3f4730);return _0x56477e[_0x963d('0x22')](_0x963d('0x23'),_0xd48742+'-'+_0x3b82eb+'/'+_0x3ea1aa)[_0x963d('0x1d')](_0x53b1cd);}return null;};}function patchUpdates(_0x5ea50b){return function(_0x278856){try{jsonpatch[_0x963d('0x24')](_0x278856,_0x5ea50b,!![]);}catch(_0x41d8d2){return BPromise[_0x963d('0x25')](_0x41d8d2);}return _0x278856[_0x963d('0x26')]();};}function saveUpdates(_0x1f115a,_0x196e8e){return function(_0x4989fc){if(_0x4989fc){return _0x4989fc[_0x963d('0x27')](_0x1f115a)['then'](function(_0x5c97ac){return _0x5c97ac;});}return null;};}function removeEntity(_0x479630,_0x4be04a){return function(_0x37da84){if(_0x37da84){return _0x37da84[_0x963d('0x28')]()['then'](function(){_0x479630['status'](0xcc)[_0x963d('0x1c')]();});}};}function handleEntityNotFound(_0x57d0c3,_0x44438f){return function(_0x126d7c){if(!_0x126d7c){_0x57d0c3[_0x963d('0x1a')](0x194);}return _0x126d7c;};}function handleError(_0x1297a0,_0x1a61b1){_0x1a61b1=_0x1a61b1||0x1f4;return function(_0x2b65d1){logger[_0x963d('0x29')](_0x2b65d1[_0x963d('0x2a')]);if(_0x2b65d1[_0x963d('0x2b')]){delete _0x2b65d1['name'];}_0x1297a0[_0x963d('0x1b')](_0x1a61b1)[_0x963d('0x2c')](_0x2b65d1);};}exports['index']=function(_0x15780f,_0x392e90){var _0x10586b={},_0x374068={},_0x5b7b16={'count':0x0,'rows':[]};var _0x4dbfa0=_[_0x963d('0x2d')](db[_0x963d('0x2e')][_0x963d('0x2f')],function(_0x740a6e){return{'name':_0x740a6e[_0x963d('0x30')],'type':_0x740a6e['type'][_0x963d('0x31')]};});_0x374068[_0x963d('0x32')]=_[_0x963d('0x2d')](_0x4dbfa0,_0x963d('0x2b'));_0x374068[_0x963d('0x33')]=_['keys'](_0x15780f['query']);_0x374068['filters']=_[_0x963d('0x34')](_0x374068[_0x963d('0x32')],_0x374068[_0x963d('0x33')]);_0x10586b[_0x963d('0x35')]=_[_0x963d('0x34')](_0x374068[_0x963d('0x32')],qs['fields'](_0x15780f[_0x963d('0x33')]['fields']));_0x10586b[_0x963d('0x35')]=_0x10586b[_0x963d('0x35')][_0x963d('0x36')]?_0x10586b[_0x963d('0x35')]:_0x374068[_0x963d('0x32')];if(!_0x15780f[_0x963d('0x33')][_0x963d('0x37')](_0x963d('0x38'))){_0x10586b[_0x963d('0x21')]=qs['limit'](_0x15780f[_0x963d('0x33')]['limit']);_0x10586b['offset']=qs[_0x963d('0x20')](_0x15780f[_0x963d('0x33')][_0x963d('0x20')]);}_0x10586b[_0x963d('0x39')]=qs[_0x963d('0x3a')](_0x15780f[_0x963d('0x33')][_0x963d('0x3a')]);_0x10586b[_0x963d('0x3b')]=qs['filters'](_[_0x963d('0x3c')](_0x15780f[_0x963d('0x33')],_0x374068[_0x963d('0x3d')]),_0x4dbfa0);if(_0x15780f['query']['filter']){_0x10586b[_0x963d('0x3b')]=_[_0x963d('0x3e')](_0x10586b[_0x963d('0x3b')],{'$or':_['map'](_0x4dbfa0,function(_0x34d0b4){if(_0x34d0b4['type']!=='VIRTUAL'){var _0x9febd={};_0x9febd[_0x34d0b4['name']]={'$like':'%'+_0x15780f[_0x963d('0x33')][_0x963d('0x3f')]+'%'};return _0x9febd;}})});}_0x10586b=_[_0x963d('0x3e')]({},_0x10586b,_0x15780f[_0x963d('0x40')]);var _0x4d6e08={'where':_0x10586b['where']};return db[_0x963d('0x2e')][_0x963d('0x1f')](_0x4d6e08)['then'](function(_0x279545){_0x5b7b16[_0x963d('0x1f')]=_0x279545;if(_0x15780f['query']['includeAll']){_0x10586b[_0x963d('0x41')]=[{'all':!![]}];}return db[_0x963d('0x2e')][_0x963d('0x42')](_0x10586b);})['then'](function(_0x4dc018){_0x5b7b16[_0x963d('0x43')]=_0x4dc018;return _0x5b7b16;})['then'](respondWithFilteredResult(_0x392e90,_0x10586b))[_0x963d('0x44')](handleError(_0x392e90,null));};exports[_0x963d('0x45')]=function(_0xbac0de,_0x5506f4){var _0x490b70={'raw':!![],'where':{'id':_0xbac0de[_0x963d('0x46')]['id']}},_0x115eba={};_0x115eba[_0x963d('0x32')]=_['keys'](db[_0x963d('0x2e')][_0x963d('0x2f')]);_0x115eba[_0x963d('0x33')]=_[_0x963d('0x47')](_0xbac0de[_0x963d('0x33')]);_0x115eba[_0x963d('0x3d')]=_[_0x963d('0x34')](_0x115eba[_0x963d('0x32')],_0x115eba['query']);_0x490b70[_0x963d('0x35')]=_[_0x963d('0x34')](_0x115eba['model'],qs[_0x963d('0x48')](_0xbac0de[_0x963d('0x33')][_0x963d('0x48')]));_0x490b70['attributes']=_0x490b70[_0x963d('0x35')][_0x963d('0x36')]?_0x490b70[_0x963d('0x35')]:_0x115eba[_0x963d('0x32')];if(_0xbac0de[_0x963d('0x33')]['includeAll']){_0x490b70['include']=[{'all':!![]}];}_0x490b70=_[_0x963d('0x3e')]({},_0x490b70,_0xbac0de[_0x963d('0x40')]);return db[_0x963d('0x2e')]['find'](_0x490b70)[_0x963d('0x49')](handleEntityNotFound(_0x5506f4,null))[_0x963d('0x49')](respondWithResult(_0x5506f4,null))[_0x963d('0x44')](handleError(_0x5506f4,null));};exports[_0x963d('0x4a')]=function(_0x8171b5,_0x2ead98){return db['ChatTransferReport'][_0x963d('0x4a')](_0x8171b5[_0x963d('0x4b')],{})[_0x963d('0x49')](respondWithResult(_0x2ead98,0xc9))[_0x963d('0x44')](handleError(_0x2ead98,null));};exports['update']=function(_0x53af9b,_0x5b2d0e){if(_0x53af9b[_0x963d('0x4b')]['id']){delete _0x53af9b[_0x963d('0x4b')]['id'];}return db[_0x963d('0x2e')]['find']({'where':{'id':_0x53af9b[_0x963d('0x46')]['id']}})[_0x963d('0x49')](handleEntityNotFound(_0x5b2d0e,null))[_0x963d('0x49')](saveUpdates(_0x53af9b[_0x963d('0x4b')],null))[_0x963d('0x49')](respondWithResult(_0x5b2d0e,null))[_0x963d('0x44')](handleError(_0x5b2d0e,null));};exports[_0x963d('0x28')]=function(_0x5c11a0,_0x221ee7){return db['ChatTransferReport']['find']({'where':{'id':_0x5c11a0[_0x963d('0x46')]['id']}})[_0x963d('0x49')](handleEntityNotFound(_0x221ee7,null))['then'](removeEntity(_0x221ee7,null))['catch'](handleError(_0x221ee7,null));};exports[_0x963d('0x4c')]=function(_0x179a31,_0x2f4a86){return db[_0x963d('0x2e')][_0x963d('0x4c')]()[_0x963d('0x49')](respondWithResult(_0x2f4a86,null))[_0x963d('0x44')](handleError(_0x2f4a86,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 7ba7807..b76fb69 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 _0x3186=['uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','ChatTransferReport','report_chat_transfer'];(function(_0x2cc44a,_0x456aff){var _0x4d1e91=function(_0x55071c){while(--_0x55071c){_0x2cc44a['push'](_0x2cc44a['shift']());}};_0x4d1e91(++_0x456aff);}(_0x3186,0x91));var _0x6318=function(_0x1e901f,_0x22b283){_0x1e901f=_0x1e901f-0x0;var _0x1f6449=_0x3186[_0x1e901f];return _0x1f6449;};'use strict';var _=require('lodash');var util=require(_0x6318('0x0'));var logger=require(_0x6318('0x1'))(_0x6318('0x2'));var moment=require('moment');var BPromise=require(_0x6318('0x3'));var rp=require(_0x6318('0x4'));var fs=require('fs');var path=require(_0x6318('0x5'));var rimraf=require(_0x6318('0x6'));var config=require(_0x6318('0x7'));var attributes=require(_0x6318('0x8'));module['exports']=function(_0x53d17f,_0x270fe9){return _0x53d17f['define'](_0x6318('0x9'),attributes,{'tableName':_0x6318('0xa'),'paranoid':![],'indexes':[{'name':_0x6318('0xb'),'fields':[_0x6318('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9990=['../../config/environment','./chatTransferReport.attributes','exports','define','uniqueid','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x9990,0x13d));var _0x0999=function(_0x5b79d0,_0x2f0867){_0x5b79d0=_0x5b79d0-0x0;var _0x1950b2=_0x9990[_0x5b79d0];return _0x1950b2;};'use strict';var _=require('lodash');var util=require(_0x0999('0x0'));var logger=require(_0x0999('0x1'))('api');var moment=require(_0x0999('0x2'));var BPromise=require(_0x0999('0x3'));var rp=require(_0x0999('0x4'));var fs=require('fs');var path=require(_0x0999('0x5'));var rimraf=require(_0x0999('0x6'));var config=require(_0x0999('0x7'));var attributes=require(_0x0999('0x8'));module[_0x0999('0x9')]=function(_0x1851a2,_0x5a24b8){return _0x1851a2[_0x0999('0xa')]('ChatTransferReport',attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x0999('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index e19e34c..36953d2 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 _0x7fbd=['debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1297d8,_0x4f7fdb){var _0x1f24b7=function(_0x5245cc){while(--_0x5245cc){_0x1297d8['push'](_0x1297d8['shift']());}};_0x1f24b7(++_0x4f7fdb);}(_0x7fbd,0x194));var _0xd7fb=function(_0x1bd7b7,_0x18e7c4){_0x1bd7b7=_0x1bd7b7-0x0;var _0x46a408=_0x7fbd[_0x1bd7b7];return _0x46a408;};'use strict';var _=require(_0xd7fb('0x0'));var util=require('util');var moment=require(_0xd7fb('0x1'));var BPromise=require(_0xd7fb('0x2'));var rs=require(_0xd7fb('0x3'));var fs=require('fs');var Redis=require(_0xd7fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd7fb('0x5'))(_0xd7fb('0x6'));var config=require(_0xd7fb('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd7fb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46f340,_0x4bae14,_0x21eff5){return new BPromise(function(_0x491c7f,_0x27bb72){return client[_0xd7fb('0x9')](_0x46f340,_0x21eff5)[_0xd7fb('0xa')](function(_0x716a77){logger[_0xd7fb('0xb')](_0xd7fb('0xc'),_0x4bae14,_0xd7fb('0xd'));logger[_0xd7fb('0xe')](_0xd7fb('0xf'),_0x4bae14,'request\x20sent',JSON[_0xd7fb('0x10')](_0x716a77));if(_0x716a77['error']){if(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x12')]===0x1f4){logger[_0xd7fb('0x11')](_0xd7fb('0xc'),_0x4bae14,_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);return _0x27bb72(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);}logger[_0xd7fb('0x11')]('ChatTransferReport,\x20%s,\x20%s',_0x4bae14,_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);return _0x491c7f(_0x716a77[_0xd7fb('0x11')][_0xd7fb('0x13')]);}else{logger['info'](_0xd7fb('0xc'),_0x4bae14,_0xd7fb('0xd'));_0x491c7f(_0x716a77[_0xd7fb('0x14')][_0xd7fb('0x13')]);}})[_0xd7fb('0x15')](function(_0x509971){logger[_0xd7fb('0x11')](_0xd7fb('0xc'),_0x4bae14,_0x509971);_0x27bb72(_0x509971);});});} \ No newline at end of file +var _0xfdec=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','lodash','util'];(function(_0x46f1a6,_0xc7a582){var _0x38429a=function(_0x31adae){while(--_0x31adae){_0x46f1a6['push'](_0x46f1a6['shift']());}};_0x38429a(++_0xc7a582);}(_0xfdec,0x1a0));var _0xcfde=function(_0x4f8ef6,_0x31607b){_0x4f8ef6=_0x4f8ef6-0x0;var _0x4f6880=_0xfdec[_0x4f8ef6];return _0x4f6880;};'use strict';var _=require(_0xcfde('0x0'));var util=require(_0xcfde('0x1'));var moment=require('moment');var BPromise=require(_0xcfde('0x2'));var rs=require(_0xcfde('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcfde('0x4'))['db'];var utils=require(_0xcfde('0x5'));var logger=require(_0xcfde('0x6'))('rpc');var config=require(_0xcfde('0x7'));var jayson=require(_0xcfde('0x8'));var client=jayson[_0xcfde('0x9')][_0xcfde('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x160a69,_0x2f91ae,_0x57ca30){return new BPromise(function(_0x480733,_0x399dd7){return client[_0xcfde('0xb')](_0x160a69,_0x57ca30)[_0xcfde('0xc')](function(_0xec5dd){logger['info'](_0xcfde('0xd'),_0x2f91ae,'request\x20sent');logger[_0xcfde('0xe')](_0xcfde('0xf'),_0x2f91ae,_0xcfde('0x10'),JSON[_0xcfde('0x11')](_0xec5dd));if(_0xec5dd['error']){if(_0xec5dd['error'][_0xcfde('0x12')]===0x1f4){logger[_0xcfde('0x13')](_0xcfde('0xd'),_0x2f91ae,_0xec5dd[_0xcfde('0x13')][_0xcfde('0x14')]);return _0x399dd7(_0xec5dd[_0xcfde('0x13')][_0xcfde('0x14')]);}logger['error'](_0xcfde('0xd'),_0x2f91ae,_0xec5dd[_0xcfde('0x13')]['message']);return _0x480733(_0xec5dd[_0xcfde('0x13')]['message']);}else{logger[_0xcfde('0x15')](_0xcfde('0xd'),_0x2f91ae,_0xcfde('0x10'));_0x480733(_0xec5dd['result']['message']);}})['catch'](function(_0x399fe3){logger['error'](_0xcfde('0xd'),_0x2f91ae,_0x399fe3);_0x399dd7(_0x399fe3);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 5fc0341..69268a2 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 _0x3656=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x34b96a,_0x1a79c7){var _0x11e387=function(_0xe2ec77){while(--_0xe2ec77){_0x34b96a['push'](_0x34b96a['shift']());}};_0x11e387(++_0x1a79c7);}(_0x3656,0x119));var _0x6365=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x3656[_0x59ee6f];return _0x4c0979;};'use strict';var multer=require(_0x6365('0x0'));var util=require(_0x6365('0x1'));var path=require(_0x6365('0x2'));var timeout=require(_0x6365('0x3'));var express=require(_0x6365('0x4'));var router=express[_0x6365('0x5')]();var fs_extra=require(_0x6365('0x6'));var auth=require(_0x6365('0x7'));var interaction=require(_0x6365('0x8'));var config=require(_0x6365('0x9'));var controller=require(_0x6365('0xa'));router[_0x6365('0xb')]('/',auth[_0x6365('0xc')](),controller[_0x6365('0xd')]);router[_0x6365('0xb')](_0x6365('0xe'),auth['isAuthenticated'](),controller[_0x6365('0xf')]);router['get'](_0x6365('0x10'),auth['isAuthenticated'](),controller[_0x6365('0x11')]);router['post']('/',auth[_0x6365('0xc')](),controller[_0x6365('0x12')]);router['put']('/:id',auth[_0x6365('0xc')](),controller[_0x6365('0x13')]);router[_0x6365('0x14')]('/:id',auth[_0x6365('0xc')](),controller[_0x6365('0x15')]);module['exports']=router; \ No newline at end of file +var _0xffb0=['index','/describe','describe','/:id','post','create','update','delete','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x2002d0,_0x391eed){var _0x7bfe39=function(_0x1cf20e){while(--_0x1cf20e){_0x2002d0['push'](_0x2002d0['shift']());}};_0x7bfe39(++_0x391eed);}(_0xffb0,0x1d5));var _0x0ffb=function(_0x2073a8,_0x308660){_0x2073a8=_0x2073a8-0x0;var _0x3a8432=_0xffb0[_0x2073a8];return _0x3a8432;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ffb('0x0'));var timeout=require('connect-timeout');var express=require(_0x0ffb('0x1'));var router=express[_0x0ffb('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x0ffb('0x3'));var interaction=require(_0x0ffb('0x4'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x0ffb('0x5')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0x7')]);router[_0x0ffb('0x5')](_0x0ffb('0x8'),auth['isAuthenticated'](),controller[_0x0ffb('0x9')]);router[_0x0ffb('0x5')](_0x0ffb('0xa'),auth[_0x0ffb('0x6')](),controller['show']);router[_0x0ffb('0xb')]('/',auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xc')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0ffb('0xd')]);router[_0x0ffb('0xe')](_0x0ffb('0xa'),auth[_0x0ffb('0x6')](),controller[_0x0ffb('0xf')]);module[_0x0ffb('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index bfd3026..0c982cc 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 _0x3d91=['Skip','Feedback','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','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','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!'];(function(_0x55dd60,_0x479fb7){var _0x505abb=function(_0x5429c9){while(--_0x5429c9){_0x55dd60['push'](_0x55dd60['shift']());}};_0x505abb(++_0x479fb7);}(_0x3d91,0x1a8));var _0x13d9=function(_0x56b04e,_0x471ebc){_0x56b04e=_0x56b04e-0x0;var _0x4149b9=_0x3d91[_0x56b04e];return _0x4149b9;};'use strict';var Sequelize=require(_0x13d9('0x0'));var rs=require('randomstring');module[_0x13d9('0x1')]={'name':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x13d9('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x4')},'mapKeyOffline':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x4')},'key':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x5')},'customerAlias':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x13d9('0xa')](_0x13d9('0xb'),_0x13d9('0xc')),'defaultValue':_0x13d9('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xd')},'start_chat_button':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xf')},'header_offline':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x11')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x13d9('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x13')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x14')},'noteTitle':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x15')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x16')},'closingMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x17')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0xf')},'skipMessageButton':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x18')},'conditionAgreement':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x19')},'ratingType':{'type':Sequelize[_0x13d9('0xa')](_0x13d9('0x1a'),_0x13d9('0x1b')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':function(){return JSON[_0x13d9('0x1c')]({'items':[{'type':_0x13d9('0x1d'),'variable':null,'config':{'placeholder':_0x13d9('0x1e'),'type':_0x13d9('0x1f'),'required':!![]},'props':{'title':_0x13d9('0x1e'),'helpText':''}},{'type':_0x13d9('0x1d'),'props':{'title':_0x13d9('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x13d9('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x13d9('0x20')](_0x13d9('0x21'))?JSON[_0x13d9('0x22')](this[_0x13d9('0x20')](_0x13d9('0x21'))):{};},'set':function(_0x59bd8b){return this[_0x13d9('0x23')](_0x13d9('0x21'),JSON['stringify'](_0x59bd8b));}},'offlineForm':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':function(){return JSON[_0x13d9('0x1c')]({'items':[{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x13d9('0x4'),'type':_0x13d9('0x4')},'variable':null},{'type':_0x13d9('0x24'),'config':{'placeholder':'Comments'},'props':{'title':_0x13d9('0x25'),'helpText':_0x13d9('0x26')}}],'fromKey':0x0});},'get':function(){return this[_0x13d9('0x20')](_0x13d9('0x27'))?JSON[_0x13d9('0x22')](this[_0x13d9('0x20')]('offlineForm')):{};},'set':function(_0x344b0a){return this[_0x13d9('0x23')](_0x13d9('0x27'),JSON[_0x13d9('0x1c')](_0x344b0a));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x13d9('0x28')]();}},'autoclose':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x13d9('0x2')]},'forwardOffline':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x13d9('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x29')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2a')},'offlineMessageBody':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2b')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x18')},'sendUnmanaged':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0xf')},'enableCustomerAttachment':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x13d9('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x13d9('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x13d9('0x2d');}},'notificationSound':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x13d9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x2f')},'verticalAlignment':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x30')},'messagesAlignment':{'type':Sequelize[_0x13d9('0x2')],'defaultValue':_0x13d9('0x31')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x13d9('0x12')]},'showCustomerAvatar':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x13d9('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':_0x13d9('0x32'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x13d9('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x13d9('0x33')},'systemAvatar':{'type':Sequelize[_0x13d9('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x13d9('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![],'comment':_0x13d9('0x34'),'set':function(_0x333bce){if(!_0x333bce)this[_0x13d9('0x23')](_0x13d9('0x35'),null);this[_0x13d9('0x23')](_0x13d9('0x36'),_0x333bce);}},'vidaooEscalation':{'type':Sequelize[_0x13d9('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x13d9('0x2')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x13d9('0x37');}},'vidaooMetadata':{'type':Sequelize[_0x13d9('0x12')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x13d9('0x12')]}}; \ No newline at end of file +var _0xf616=['mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x31f20a,_0x22c8d9){var _0x5acf6d=function(_0x2e25a3){while(--_0x2e25a3){_0x31f20a['push'](_0x31f20a['shift']());}};_0x5acf6d(++_0x22c8d9);}(_0xf616,0x17a));var _0x6f61=function(_0x4a0139,_0x298519){_0x4a0139=_0x4a0139-0x0;var _0x4fa1fb=_0xf616[_0x4a0139];return _0x4fa1fb;};'use strict';var Sequelize=require(_0x6f61('0x0'));var rs=require(_0x6f61('0x1'));module[_0x6f61('0x2')]={'name':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x6f61('0x3')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x5')},'customerAlias':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f61('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':_0x6f61('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f61('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6f61('0x3')]},'animation':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6f61('0xa')](_0x6f61('0xb'),_0x6f61('0xc')),'defaultValue':_0x6f61('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0xd')},'start_chat_button':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0xf')},'header_offline':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x10')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x11')},'defaultWhiteLabel':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6f61('0x12')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x13')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x14')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x15')},'noteTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xf')},'skipMessageButton':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x16')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6f61('0xa')](_0x6f61('0x17'),_0x6f61('0x18')),'defaultValue':_0x6f61('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return JSON[_0x6f61('0x19')]({'items':[{'type':_0x6f61('0x1a'),'variable':null,'config':{'placeholder':_0x6f61('0x1b'),'type':_0x6f61('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6f61('0x1a'),'props':{'title':_0x6f61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f61('0x4'),'type':_0x6f61('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6f61('0x1d')](_0x6f61('0x1e'))?JSON[_0x6f61('0x1f')](this['getDataValue'](_0x6f61('0x1e'))):{};},'set':function(_0x1e3b47){return this[_0x6f61('0x20')](_0x6f61('0x1e'),JSON['stringify'](_0x1e3b47));}},'offlineForm':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return JSON[_0x6f61('0x19')]({'items':[{'type':_0x6f61('0x1a'),'props':{'title':_0x6f61('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x6f61('0x4')},'variable':null},{'type':_0x6f61('0x21'),'config':{'placeholder':'Comments'},'props':{'title':_0x6f61('0x22'),'helpText':_0x6f61('0x23')}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0x6f61('0x1f')](this[_0x6f61('0x1d')](_0x6f61('0x24'))):{};},'set':function(_0x2afe8b){return this['setDataValue'](_0x6f61('0x24'),JSON[_0x6f61('0x19')](_0x2afe8b));}},'token':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6f61('0x3')]},'waitingTitle':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x25')},'skipUnmanaged':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x16')},'sendUnmanaged':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0xf')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6f61('0x12')]},'showAgentAvatar':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6f61('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6f61('0x12')],'defaultValue':function(){return _0x6f61('0x26');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x27')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x28')},'verticalAlignment':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x29')},'messagesAlignment':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':_0x6f61('0x2a')},'defaultTitle':{'type':Sequelize[_0x6f61('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6f61('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f61('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6f61('0x2b')},'systemAvatar':{'type':Sequelize[_0x6f61('0x12')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f61('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x6f61('0x2c'),'set':function(_0x320e63){if(!_0x320e63)this[_0x6f61('0x20')]('mandatoryDispositionPauseId',null);this[_0x6f61('0x20')](_0x6f61('0x2d'),_0x320e63);}},'vidaooEscalation':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6f61('0x3')]},'vidaooTopic':{'type':Sequelize[_0x6f61('0x3')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x6f61('0x3')],'defaultValue':function(){return _0x6f61('0x2e');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x6f61('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6f61('0x12')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index b8f91c3..781715b 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 _0x9b0d=['online','offlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','ejs','fs-extra','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','localhost','socket.io-emitter','register','client','http','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','info','catch','sendStatus','status','offset','undefined','count','set','json','update','destroy','get','ChatWebsites','end','stack','name','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','VIRTUAL','ChatWebsite','findAll','rows','show','params','includeAll','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','pick','include','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addLogo','sitepic','file','filename','addAvatar','addCustomerAvatar','addSystemAvatar','getLogo','root','../../config/license/util','getLicense','custom','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','isNil','getSystemAvatar','systemAvatar','user-agent-parser','setUA','user-agent','getResult','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','list','orderBy','applications','priority','asc','contact','customerIp','headers','x-forwarded-for','split','firstName','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','forcedOwnership','Start','startRouting','notify','offline','files','no\x20available\x20attributes','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','mimetype','attachments','offline-chat','openNewInteraction','sequelize','Attachment','bulkCreate','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','forwardOfflineAddress','MailAccountId','originalname','subjectOffline','toPairsIn','email','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','virtual','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','transaction','Transaction','READ_COMMITTED','findAndCountAll','finally','addProactiveActions','getFields'];(function(_0x25d2fa,_0x1d35c6){var _0x42d4aa=function(_0x590383){while(--_0x590383){_0x25d2fa['push'](_0x25d2fa['shift']());}};_0x42d4aa(++_0x1d35c6);}(_0x9b0d,0x139));var _0xd9b0=function(_0x2909ad,_0x57ced8){_0x2909ad=_0x2909ad-0x0;var _0x35aa71=_0x9b0d[_0x2909ad];return _0x35aa71;};'use strict';var BPromise=require(_0xd9b0('0x0'));var Mustache=require(_0xd9b0('0x1'));var util=require(_0xd9b0('0x2'));var path=require(_0xd9b0('0x3'));var ejs=require(_0xd9b0('0x4'));var fs=require('fs');var fs_extra=require(_0xd9b0('0x5'));var _=require('lodash');var querystring=require(_0xd9b0('0x6'));var Redis=require(_0xd9b0('0x7'));var qs=require(_0xd9b0('0x8'));var logger=require(_0xd9b0('0x9'))(_0xd9b0('0xa'));var config=require('../../config/environment');var db=require(_0xd9b0('0xb'))['db'];config[_0xd9b0('0xc')]=_['defaults'](config['redis'],{'host':_0xd9b0('0xd'),'port':0x18eb});var socket=require(_0xd9b0('0xe'))(new Redis(config[_0xd9b0('0xc')]));require('./chatWebsite.socket')[_0xd9b0('0xf')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd9b0('0x10')][_0xd9b0('0x11')]({'port':0x232c});var client9002=jayson['client'][_0xd9b0('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0xd9b0('0x10')][_0xd9b0('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x49cb95,_0x4646b3,_0x5c5b64,_0x297b56){return new BPromise(function(_0x48b923,_0x351b42){var _0x2fa5da=_0x297b56||client;return _0x2fa5da['request'](_0x49cb95,_0x5c5b64)[_0xd9b0('0x12')](function(_0x5a5657){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x4646b3,_0xd9b0('0x13'));logger[_0xd9b0('0x14')](_0xd9b0('0x15'),_0x4646b3,_0xd9b0('0x13'),JSON[_0xd9b0('0x16')](_0x5a5657));if(_0x5a5657[_0xd9b0('0x17')]){if(_0x5a5657[_0xd9b0('0x17')]['code']===0x1f4){logger[_0xd9b0('0x17')](_0xd9b0('0x18'),_0x4646b3,_0x5a5657[_0xd9b0('0x17')]['message']);return _0x351b42(_0x5a5657['error']['message']);}logger[_0xd9b0('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x4646b3,_0x5a5657['error'][_0xd9b0('0x19')]);return _0x48b923(_0x5a5657[_0xd9b0('0x17')][_0xd9b0('0x19')]);}else{logger[_0xd9b0('0x1a')](_0xd9b0('0x18'),_0x4646b3,_0xd9b0('0x13'));_0x48b923(_0x5a5657['result']['message']);}})[_0xd9b0('0x1b')](function(_0x39b02e){logger['error'](_0xd9b0('0x18'),_0x4646b3,_0x39b02e);_0x351b42(_0x39b02e);});});}function respondWithStatusCode(_0x4f6ceb,_0x370b09){_0x370b09=_0x370b09||0xcc;return function(_0x5a1071){if(_0x5a1071){return _0x4f6ceb[_0xd9b0('0x1c')](_0x370b09);}return _0x4f6ceb[_0xd9b0('0x1d')](_0x370b09)['end']();};}function respondWithResult(_0x5b99d3,_0x272207){_0x272207=_0x272207||0xc8;return function(_0x545a8f){if(_0x545a8f){return _0x5b99d3[_0xd9b0('0x1d')](_0x272207)['json'](_0x545a8f);}};}function respondWithFilteredResult(_0xed6c2c,_0x223e0d){return function(_0x58cdbe){if(_0x58cdbe){var _0x430732=typeof _0x223e0d[_0xd9b0('0x1e')]===_0xd9b0('0x1f')&&typeof _0x223e0d['limit']===_0xd9b0('0x1f');var _0x4c8237=_0x58cdbe[_0xd9b0('0x20')];var _0x2095d2=_0x430732?0x0:_0x223e0d[_0xd9b0('0x1e')];var _0x16fa45=_0x430732?_0x58cdbe[_0xd9b0('0x20')]:_0x223e0d[_0xd9b0('0x1e')]+_0x223e0d['limit'];var _0x311d96;if(_0x16fa45>=_0x4c8237){_0x16fa45=_0x4c8237;_0x311d96=0xc8;}else{_0x311d96=0xce;}_0xed6c2c[_0xd9b0('0x1d')](_0x311d96);return _0xed6c2c[_0xd9b0('0x21')]('Content-Range',_0x2095d2+'-'+_0x16fa45+'/'+_0x4c8237)[_0xd9b0('0x22')](_0x58cdbe);}return null;};}function saveUpdates(_0xf67095){return function(_0x5badc2){if(_0x5badc2){return _0x5badc2[_0xd9b0('0x23')](_0xf67095)[_0xd9b0('0x12')](function(_0x3d4758){return _0x3d4758;});}return null;};}function removeEntity(_0x10dba4){return function(_0x1c7161){if(_0x1c7161){return _0x1c7161[_0xd9b0('0x24')]()['then'](function(){var _0xc44b13=_0x1c7161[_0xd9b0('0x25')]({'plain':!![]});var _0x4581cc=_0xd9b0('0x26');return db['UserProfileResource'][_0xd9b0('0x24')]({'where':{'type':_0x4581cc,'resourceId':_0xc44b13['id']}})[_0xd9b0('0x12')](function(){return _0x1c7161;});})[_0xd9b0('0x12')](function(){_0x10dba4[_0xd9b0('0x1d')](0xcc)[_0xd9b0('0x27')]();});}};}function handleEntityNotFound(_0x576427){return function(_0x542fb5){if(!_0x542fb5){_0x576427['sendStatus'](0x194);}return _0x542fb5;};}function handleError(_0x220390,_0x22f1be){_0x22f1be=_0x22f1be||0x1f4;return function(_0x51b13c){logger[_0xd9b0('0x17')](_0x51b13c[_0xd9b0('0x28')]);if(_0x51b13c[_0xd9b0('0x29')]){delete _0x51b13c[_0xd9b0('0x29')];}_0x220390[_0xd9b0('0x1d')](_0x22f1be)['send'](_0x51b13c);};}exports['index']=function(_0x9ae8b4,_0x3b899b){var _0x5aee34={'include':[{'model':db[_0xd9b0('0x2a')],'as':_0xd9b0('0x2b')}]},_0x4db1fc={},_0x154715={'count':0x0,'rows':[]};var _0x49dddf=_[_0xd9b0('0x2c')](db['ChatWebsite'][_0xd9b0('0x2d')],function(_0x3d30ca){return{'name':_0x3d30ca[_0xd9b0('0x2e')],'type':_0x3d30ca[_0xd9b0('0x2f')]['key']};});_0x4db1fc[_0xd9b0('0x30')]=_[_0xd9b0('0x2c')](_0x49dddf,_0xd9b0('0x29'));_0x4db1fc[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x9ae8b4[_0xd9b0('0x31')]);_0x4db1fc['filters']=_[_0xd9b0('0x33')](_0x4db1fc[_0xd9b0('0x30')],_0x4db1fc[_0xd9b0('0x31')]);_0x5aee34[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x4db1fc['model'],qs[_0xd9b0('0x35')](_0x9ae8b4['query'][_0xd9b0('0x35')]));_0x5aee34[_0xd9b0('0x34')]=_0x5aee34[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x5aee34[_0xd9b0('0x34')]:_0x4db1fc[_0xd9b0('0x30')];if(!_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x5aee34[_0xd9b0('0x39')]=qs['limit'](_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x5aee34[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x9ae8b4['query'][_0xd9b0('0x1e')]);}_0x5aee34[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x5aee34[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_['pick'](_0x9ae8b4[_0xd9b0('0x31')],_0x4db1fc[_0xd9b0('0x3d')]),_0x49dddf);if(_0x9ae8b4['query'][_0xd9b0('0x3e')]){_0x5aee34[_0xd9b0('0x3c')]=_['merge'](_0x5aee34[_0xd9b0('0x3c')],{'$or':_['map'](_0x49dddf,function(_0x2ed6c5){if(_0x2ed6c5[_0xd9b0('0x2f')]!==_0xd9b0('0x3f')){var _0x422d98={};_0x422d98[_0x2ed6c5['name']]={'$like':'%'+_0x9ae8b4[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x422d98;}})});}_0x5aee34=_['merge']({},_0x5aee34,_0x9ae8b4['options']);var _0x47998a={'where':_0x5aee34['where']};return db[_0xd9b0('0x40')][_0xd9b0('0x20')](_0x47998a)['then'](function(_0x1d6818){_0x154715[_0xd9b0('0x20')]=_0x1d6818;if(_0x9ae8b4[_0xd9b0('0x31')]['includeAll']){_0x5aee34['include']=[{'all':!![]}];}return db['ChatWebsite'][_0xd9b0('0x41')](_0x5aee34);})[_0xd9b0('0x12')](function(_0x2a2a41){_0x154715[_0xd9b0('0x42')]=_0x2a2a41;return _0x154715;})[_0xd9b0('0x12')](respondWithFilteredResult(_0x3b899b,_0x5aee34))['catch'](handleError(_0x3b899b,null));};exports[_0xd9b0('0x43')]=function(_0x461146,_0x10a6f9){var _0x3baa59={'raw':![],'where':{'id':_0x461146[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0x2a')],'as':_0xd9b0('0x2b')}]},_0x4ab5be={};_0x4ab5be[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x40')][_0xd9b0('0x2d')]);_0x4ab5be['query']=_[_0xd9b0('0x32')](_0x461146[_0xd9b0('0x31')]);_0x4ab5be[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x4ab5be['model'],_0x4ab5be['query']);_0x3baa59[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x4ab5be[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x461146[_0xd9b0('0x31')]['fields']));_0x3baa59['attributes']=_0x3baa59[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x3baa59[_0xd9b0('0x34')]:_0x4ab5be[_0xd9b0('0x30')];if(_0x461146[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x3baa59['include']=[{'all':!![]}];}_0x3baa59=_[_0xd9b0('0x46')]({},_0x3baa59,_0x461146[_0xd9b0('0x47')]);return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x3baa59)[_0xd9b0('0x12')](handleEntityNotFound(_0x10a6f9,null))[_0xd9b0('0x12')](respondWithResult(_0x10a6f9,null))[_0xd9b0('0x1b')](handleError(_0x10a6f9,null));};exports[_0xd9b0('0x49')]=function(_0x4f8242,_0x32b981){return db[_0xd9b0('0x40')][_0xd9b0('0x49')](_0x4f8242[_0xd9b0('0x4a')],{})['then'](function(_0x289b0d){var _0x30eda8=_0x4f8242[_0xd9b0('0x4b')][_0xd9b0('0x25')]({'plain':!![]});if(!_0x30eda8)throw new Error(_0xd9b0('0x4c'));if(_0x30eda8[_0xd9b0('0x4d')]===_0xd9b0('0x4b')){var _0x20ddbc=_0x289b0d['get']({'plain':!![]});var _0x3ef40a=_0xd9b0('0x26');return db[_0xd9b0('0x4e')]['find']({'where':{'name':_0x3ef40a,'userProfileId':_0x30eda8[_0xd9b0('0x4f')]},'raw':!![]})[_0xd9b0('0x12')](function(_0x4d70b5){if(_0x4d70b5&&_0x4d70b5[_0xd9b0('0x50')]===0x0){return db[_0xd9b0('0x51')][_0xd9b0('0x49')]({'name':_0x20ddbc['name'],'resourceId':_0x20ddbc['id'],'type':_0x4d70b5[_0xd9b0('0x29')],'sectionId':_0x4d70b5['id']},{})['then'](function(){return _0x289b0d;});}else{return _0x289b0d;}})[_0xd9b0('0x1b')](function(_0x4ee578){logger[_0xd9b0('0x17')](_0xd9b0('0x52'),_0x4ee578);throw _0x4ee578;});}return _0x289b0d;})[_0xd9b0('0x12')](respondWithResult(_0x32b981,0xc9))[_0xd9b0('0x1b')](handleError(_0x32b981,null));};exports[_0xd9b0('0x23')]=function(_0x50832c,_0x5689b6){if(_0x50832c[_0xd9b0('0x4a')]['id']){delete _0x50832c[_0xd9b0('0x4a')]['id'];}return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x50832c[_0xd9b0('0x44')]['id']},'include':[{'model':db['Pause'],'as':_0xd9b0('0x2b')}]})[_0xd9b0('0x12')](handleEntityNotFound(_0x5689b6,null))[_0xd9b0('0x12')](saveUpdates(_0x50832c[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x5689b6,null))['catch'](handleError(_0x5689b6,null));};exports[_0xd9b0('0x24')]=function(_0x522a41,_0x317afa){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x522a41[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x317afa,null))[_0xd9b0('0x12')](removeEntity(_0x317afa,null))['catch'](handleError(_0x317afa,null));};exports[_0xd9b0('0x53')]=function(_0x1c17f6,_0x103f2f){return db[_0xd9b0('0x40')]['describe']()[_0xd9b0('0x12')](respondWithResult(_0x103f2f,null))['catch'](handleError(_0x103f2f,null));};exports[_0xd9b0('0x54')]=function(_0x3af0ab,_0x1e4abc){if(_0x3af0ab['body']['id']){delete _0x3af0ab['body']['id'];}return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x3af0ab[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e4abc,null))['then'](function(_0x2cc7e3){if(_0x2cc7e3){_0x3af0ab['body'][_0xd9b0('0x55')]=_0x2cc7e3['id'];return db['Disposition'][_0xd9b0('0x49')](_0x3af0ab[_0xd9b0('0x4a')]);}})['then'](respondWithResult(_0x1e4abc,null))['catch'](handleError(_0x1e4abc,null));};exports[_0xd9b0('0x56')]=function(_0x1052b5,_0x356996){var _0x295156={'raw':![],'where':{}};var _0x1f09b4={};var _0xce6acc={'count':0x0,'rows':[]};return db[_0xd9b0('0x40')][_0xd9b0('0x57')]({'where':{'id':_0x1052b5[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x356996,null))['then'](function(_0x998c67){if(_0x998c67){_0x1f09b4[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x58')][_0xd9b0('0x2d')]);_0x1f09b4[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x1052b5[_0xd9b0('0x31')]);_0x1f09b4[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x1f09b4[_0xd9b0('0x30')],_0x1f09b4['query']);_0x295156['attributes']=_[_0xd9b0('0x33')](_0x1f09b4[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x1052b5['query'][_0xd9b0('0x35')]));_0x295156[_0xd9b0('0x34')]=_0x295156[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x295156[_0xd9b0('0x34')]:_0x1f09b4[_0xd9b0('0x30')];if(!_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x295156['limit']=qs[_0xd9b0('0x39')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x295156[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}_0x295156[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x295156[_0xd9b0('0x3c')]=qs['filters'](_[_0xd9b0('0x59')](_0x1052b5[_0xd9b0('0x31')],_0x1f09b4[_0xd9b0('0x3d')]));_0x295156['where'][_0xd9b0('0x55')]=_0x998c67['id'];if(_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x295156[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x295156[_0xd9b0('0x3c')],{'$or':_['map'](_0x295156[_0xd9b0('0x34')],function(_0x190dd4){var _0x1f7b3e={};_0x1f7b3e[_0x190dd4]={'$like':'%'+_0x1052b5['query'][_0xd9b0('0x3e')]+'%'};return _0x1f7b3e;})});}_0x295156=_[_0xd9b0('0x46')]({},_0x295156,_0x1052b5[_0xd9b0('0x47')]);return db['Disposition'][_0xd9b0('0x20')]({'where':_0x295156[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x38028a){_0xce6acc[_0xd9b0('0x20')]=_0x38028a;if(_0x1052b5[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x295156[_0xd9b0('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0xd9b0('0x41')](_0x295156);})[_0xd9b0('0x12')](function(_0x558e9e){_0xce6acc['rows']=_0x558e9e;return _0xce6acc;});}})[_0xd9b0('0x12')](respondWithFilteredResult(_0x356996,_0x295156))[_0xd9b0('0x1b')](handleError(_0x356996,null));};exports[_0xd9b0('0x5b')]=function(_0x1fc379,_0x1c6cdf){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x1fc379['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x1c6cdf,null))['then'](function(_0x1bb167){if(_0x1bb167){return _0x1bb167[_0xd9b0('0x5b')](_0x1fc379[_0xd9b0('0x31')][_0xd9b0('0x5c')]);}})[_0xd9b0('0x12')](respondWithStatusCode(_0x1c6cdf,null))[_0xd9b0('0x1b')](handleError(_0x1c6cdf,null));};exports[_0xd9b0('0x5d')]=function(_0x125f3f,_0xdac3d8){if(_0x125f3f[_0xd9b0('0x4a')]['id']){delete _0x125f3f[_0xd9b0('0x4a')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x125f3f['params']['id']}})['then'](handleEntityNotFound(_0xdac3d8,null))['then'](function(_0x1446d7){if(_0x1446d7){_0x125f3f[_0xd9b0('0x4a')][_0xd9b0('0x55')]=_0x1446d7['id'];return db[_0xd9b0('0x5e')][_0xd9b0('0x49')](_0x125f3f['body']);}})[_0xd9b0('0x12')](respondWithResult(_0xdac3d8,null))['catch'](handleError(_0xdac3d8,null));};exports['getAnswers']=function(_0x44afa1,_0x239686){var _0x49ceeb={'raw':![],'where':{}};var _0x5ab6f8={};var _0x180724={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x44afa1[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x239686,null))[_0xd9b0('0x12')](function(_0x232726){if(_0x232726){_0x5ab6f8[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['CannedAnswer']['rawAttributes']);_0x5ab6f8[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x44afa1['query']);_0x5ab6f8['filters']=_[_0xd9b0('0x33')](_0x5ab6f8[_0xd9b0('0x30')],_0x5ab6f8[_0xd9b0('0x31')]);_0x49ceeb[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x5ab6f8[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x35')]));_0x49ceeb[_0xd9b0('0x34')]=_0x49ceeb['attributes'][_0xd9b0('0x36')]?_0x49ceeb['attributes']:_0x5ab6f8[_0xd9b0('0x30')];if(!_0x44afa1[_0xd9b0('0x31')]['hasOwnProperty']('nolimit')){_0x49ceeb['limit']=qs['limit'](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x49ceeb[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x44afa1['query']['offset']);}_0x49ceeb['order']=qs[_0xd9b0('0x3b')](_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x49ceeb[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x44afa1[_0xd9b0('0x31')],_0x5ab6f8['filters']));_0x49ceeb[_0xd9b0('0x3c')][_0xd9b0('0x55')]=_0x232726['id'];if(_0x44afa1['query'][_0xd9b0('0x3e')]){_0x49ceeb[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x49ceeb[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x49ceeb[_0xd9b0('0x34')],function(_0x57d1fc){var _0x1abfcd={};_0x1abfcd[_0x57d1fc]={'$like':'%'+_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1abfcd;})});}_0x49ceeb=_[_0xd9b0('0x46')]({},_0x49ceeb,_0x44afa1[_0xd9b0('0x47')]);return db['CannedAnswer'][_0xd9b0('0x20')]({'where':_0x49ceeb[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x26d249){_0x180724[_0xd9b0('0x20')]=_0x26d249;if(_0x44afa1[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x49ceeb['include']=[{'all':!![]}];}return db[_0xd9b0('0x5e')][_0xd9b0('0x41')](_0x49ceeb);})[_0xd9b0('0x12')](function(_0x8cbf03){_0x180724[_0xd9b0('0x42')]=_0x8cbf03;return _0x180724;});}})[_0xd9b0('0x12')](respondWithFilteredResult(_0x239686,_0x49ceeb))[_0xd9b0('0x1b')](handleError(_0x239686,null));};exports[_0xd9b0('0x5f')]=function(_0x540618,_0x5097c0){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x540618['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x5097c0,null))['then'](function(_0x2a1c3a){if(_0x2a1c3a){return _0x2a1c3a['removeAnswers'](_0x540618[_0xd9b0('0x31')][_0xd9b0('0x5c')]);}})['then'](respondWithStatusCode(_0x5097c0,null))['catch'](handleError(_0x5097c0,null));};exports[_0xd9b0('0x60')]=function(_0x348b05,_0xa081de){_0x348b05[_0xd9b0('0x4a')][_0xd9b0('0x61')]=_0x348b05[_0xd9b0('0x62')][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x348b05[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0xa081de,null))[_0xd9b0('0x12')](saveUpdates(_0x348b05[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0xa081de,null))[_0xd9b0('0x1b')](handleError(_0xa081de,null));};exports[_0xd9b0('0x64')]=function(_0x6603eb,_0x42ee6b){_0x6603eb['body']['agentAvatar']=_0x6603eb[_0xd9b0('0x62')][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x6603eb[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x42ee6b,null))[_0xd9b0('0x12')](saveUpdates(_0x6603eb[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x42ee6b,null))[_0xd9b0('0x1b')](handleError(_0x42ee6b,null));};exports[_0xd9b0('0x65')]=function(_0x1672e2,_0x185a65){_0x1672e2[_0xd9b0('0x4a')]['customerAvatar']=_0x1672e2['file'][_0xd9b0('0x63')];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x1672e2[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x185a65,null))['then'](saveUpdates(_0x1672e2[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x185a65,null))[_0xd9b0('0x1b')](handleError(_0x185a65,null));};exports[_0xd9b0('0x66')]=function(_0x244133,_0x481886){_0x244133[_0xd9b0('0x4a')]['systemAvatar']=_0x244133['file']['filename'];return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x244133[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x481886,null))[_0xd9b0('0x12')](saveUpdates(_0x244133[_0xd9b0('0x4a')],null))[_0xd9b0('0x12')](respondWithResult(_0x481886,null))[_0xd9b0('0x1b')](handleError(_0x481886,null));};exports[_0xd9b0('0x67')]=function(_0x501c31,_0x62f74c){var _0x2364ec=path['join'](config[_0xd9b0('0x68')],'server/files/images/logos/default_logo.svg');var _0x5896a6={'where':{'id':_0x501c31[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x61')],'raw':!![]};var _0x36ddfc=![];return require(_0xd9b0('0x69'))[_0xd9b0('0x6a')]()[_0xd9b0('0x12')](function(_0x1e70a2){if(_0x1e70a2){_0x36ddfc=_0x1e70a2[_0xd9b0('0x6b')];}})[_0xd9b0('0x12')](function(){return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x5896a6);})[_0xd9b0('0x12')](handleEntityNotFound(_0x62f74c,null))[_0xd9b0('0x12')](function(_0x1d1a3a){if(_0x1d1a3a){if(!_['isNil'](_0x1d1a3a[_0xd9b0('0x61')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x6e'),_0x1d1a3a[_0xd9b0('0x61')]))&&_0x36ddfc){_0x2364ec=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x6e'),_0x1d1a3a[_0xd9b0('0x61')]);}}return _0x62f74c[_0xd9b0('0x6f')](_0x2364ec);}})['catch'](handleError(_0x62f74c,null));};exports['getAvatar']=function(_0x69db20,_0x17c30d){var _0x34d64c=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x70'));var _0x51e563={'where':{'id':_0x69db20[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x71')],'raw':!![]};return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x51e563)['then'](handleEntityNotFound(_0x17c30d,null))[_0xd9b0('0x12')](function(_0x20992b){if(_0x20992b){if(!_['isNil'](_0x20992b[_0xd9b0('0x71')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x20992b[_0xd9b0('0x71')]))){_0x34d64c=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/',_0x20992b['agentAvatar']);}}return _0x17c30d[_0xd9b0('0x6f')](_0x34d64c);}})[_0xd9b0('0x1b')](handleError(_0x17c30d,null));};exports[_0xd9b0('0x73')]=function(_0x56a79e,_0x12eee4){var _0x1bd39d=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x74'));var _0x4044dc={'where':{'id':_0x56a79e[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x75'),_0xd9b0('0x76')],'raw':!![]};return db[_0xd9b0('0x40')]['find'](_0x4044dc)[_0xd9b0('0x12')](handleEntityNotFound(_0x12eee4,null))[_0xd9b0('0x12')](function(_0x50fd2d){if(_0x50fd2d){if(!_[_0xd9b0('0x77')](_0x50fd2d[_0xd9b0('0x75')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x50fd2d[_0xd9b0('0x75')]))&&_0x50fd2d[_0xd9b0('0x76')]){_0x1bd39d=path[_0xd9b0('0x6d')](config['root'],_0xd9b0('0x72'),_0x50fd2d[_0xd9b0('0x75')]);}}return _0x12eee4['download'](_0x1bd39d);}})[_0xd9b0('0x1b')](handleError(_0x12eee4,null));};exports[_0xd9b0('0x78')]=function(_0x4eb6b4,_0x2bb5e7){var _0x1137d0=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/system_avatar.png');var _0x388b49={'where':{'id':_0x4eb6b4[_0xd9b0('0x44')]['id']},'attributes':['id',_0xd9b0('0x79')],'raw':!![]};return db[_0xd9b0('0x40')][_0xd9b0('0x48')](_0x388b49)[_0xd9b0('0x12')](handleEntityNotFound(_0x2bb5e7,null))['then'](function(_0x49362b){if(_0x49362b){if(!_['isNil'](_0x49362b[_0xd9b0('0x79')])){if(fs[_0xd9b0('0x6c')](path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],'server/files/images/avatars/',_0x49362b[_0xd9b0('0x79')]))){_0x1137d0=path[_0xd9b0('0x6d')](config[_0xd9b0('0x68')],_0xd9b0('0x72'),_0x49362b[_0xd9b0('0x79')]);}}return _0x2bb5e7['download'](_0x1137d0);}})['catch'](handleError(_0x2bb5e7,null));};exports['notify']=function(_0x4a67e1,_0x107a67){var _0x3af375=require(_0xd9b0('0x7a'));var _0x2acb78=new _0x3af375();var _0x357040=_0x2acb78[_0xd9b0('0x7b')](_0x4a67e1['headers'][_0xd9b0('0x7c')])[_0xd9b0('0x7d')]();var _0x59dad7={'body':_0x4a67e1[_0xd9b0('0x4a')],'channel':'chat'};var _0x3e1951=[];var _0x25a8db=[];var _0x27baa6={};var _0x2ea8c3=![];return db[_0xd9b0('0x7e')][_0xd9b0('0x53')]()['then'](function(_0x544a69){if(!_0x544a69){throw new db[(_0xd9b0('0x7f'))]['ValidationError']('no\x20available\x20attributes');}_0x3e1951=_[_0xd9b0('0x80')](_[_0xd9b0('0x32')](_0x544a69),[_0xd9b0('0x81'),'updatedAt']);_0x25a8db=_['difference'](_[_0xd9b0('0x32')](_0x544a69),[_0xd9b0('0x81'),_0xd9b0('0x82'),_0xd9b0('0x83'),_0xd9b0('0x84')]);if(_0x4a67e1['body']['id']){delete _0x4a67e1['body']['id'];}if(_[_0xd9b0('0x77')](_0x4a67e1['body'][_0xd9b0('0x85')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x87'));}if(_[_0xd9b0('0x77')](_0x4a67e1['body'][_0xd9b0('0x4a')])||_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x4a')]===''){throw new db[(_0xd9b0('0x7f'))]['ValidationError'](_0xd9b0('0x88'));}if(_[_0xd9b0('0x77')](_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x8a')+_0x25a8db);}if(!_[_0xd9b0('0x8b')](_0x25a8db,_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')])){throw new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x8c')+_0x25a8db);}_0x27baa6[_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')]]=_0x4a67e1['body'][_0xd9b0('0x85')];})[_0xd9b0('0x12')](function(){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x4a67e1[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0x8d')],'as':_0xd9b0('0x8e'),'include':[{'model':db[_0xd9b0('0x7e')],'as':_0xd9b0('0x8f'),'where':_0x27baa6,'limit':0x1,'order':[[_0xd9b0('0x82'),_0xd9b0('0x90')]]}]},{'model':db[_0xd9b0('0x91')],'as':_0xd9b0('0x92')}]});})[_0xd9b0('0x12')](handleEntityNotFound(_0x107a67,null))['then'](function(_0x1122ad){if(_0x1122ad&&_0x1122ad[_0xd9b0('0x8e')]){_0x59dad7[_0xd9b0('0x93')]=_0x1122ad;_0x59dad7['applications']=_0x1122ad[_0xd9b0('0x92')];_0x59dad7[_0xd9b0('0x94')]=_0x1122ad[_0xd9b0('0x8e')];_0x59dad7['applications']=_[_0xd9b0('0x95')](_0x59dad7[_0xd9b0('0x96')],[_0xd9b0('0x97')],[_0xd9b0('0x98')]);if(_0x59dad7[_0xd9b0('0x93')]['Applications']){delete _0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x92')];}if(_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')]&&_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')][_0xd9b0('0x8f')]['length']){return _0x59dad7[_0xd9b0('0x93')][_0xd9b0('0x8e')][_0xd9b0('0x8f')][0x0];}var _0x90d219=_['defaults'](_0x4a67e1[_0xd9b0('0x4a')],{'firstName':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x85')],'ListId':_0x1122ad[_0xd9b0('0x84')]});_0x90d219[_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x89')]]=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x85')];return db[_0xd9b0('0x7e')][_0xd9b0('0x49')](_0x90d219,{'fields':_0x3e1951,'raw':!![]});}})[_0xd9b0('0x12')](handleEntityNotFound(_0x107a67,null))[_0xd9b0('0x12')](function(_0x1c949d){_0x59dad7[_0xd9b0('0x99')]=_0x1c949d;var _0x40b567=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0x9a')];if(_0x4a67e1[_0xd9b0('0x9b')]['cf-connecting-ip']){_0x40b567=_0x4a67e1[_0xd9b0('0x9b')]['cf-connecting-ip'];}else if(_0x4a67e1['headers']['x-forwarded-for']){_0x40b567=_['first'](_0x4a67e1[_0xd9b0('0x9b')][_0xd9b0('0x9c')][_0xd9b0('0x9d')](','));}if(_0x1c949d){var _0x4b2b07={'ContactId':_0x1c949d['id'],'ChatWebsiteId':_0x4a67e1['params']['id'],'from':(_0x1c949d[_0xd9b0('0x9e')]||'')+'\x20'+(_0x1c949d[_0xd9b0('0x9f')]||''),'customerIp':_0x40b567,'customerPort':_0x4a67e1[_0xd9b0('0x9b')][_0xd9b0('0xa0')]?_0x4a67e1[_0xd9b0('0x9b')]['x-real-port']:null,'referer':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xa1')],'browserName':_0x357040['browser'][_0xd9b0('0x29')]&&_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]?util[_0xd9b0('0xa4')](_0xd9b0('0xa5'),_0x357040[_0xd9b0('0xa2')]['name'],_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]):'unknown','browserVersion':_0x357040[_0xd9b0('0xa2')][_0xd9b0('0xa3')]||_0xd9b0('0xa6'),'osName':util[_0xd9b0('0xa4')](_0xd9b0('0xa5'),_0x357040['os']['name'],_0x357040['os'][_0xd9b0('0xa3')]),'osVersion':_0x357040['os'][_0xd9b0('0xa3')],'deviceModel':_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x30')]&&_0x357040[_0xd9b0('0xa7')][_0xd9b0('0xa8')]?util[_0xd9b0('0xa4')](_0xd9b0('0xa9'),_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x30')],_0x357040['device']['vendor'],_0x357040['device'][_0xd9b0('0x2f')]):null,'deviceVendor':_0x357040['device'][_0xd9b0('0xa8')],'deviceType':_0x357040[_0xd9b0('0xa7')][_0xd9b0('0x2f')],'formData':JSON[_0xd9b0('0x16')](_0x4a67e1[_0xd9b0('0x4a')])};var _0x5aecdc={'ChatWebsiteId':_0x4a67e1[_0xd9b0('0x44')]['id'],'closed':![]};if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')]){_0x5aecdc[_0xd9b0('0xaa')]=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')];return db[_0xd9b0('0xab')][_0xd9b0('0x48')]({'where':_0x5aecdc})[_0xd9b0('0x12')](function(_0x2bc667){if(_0x2bc667){return[_0x2bc667,![]];}_0x4b2b07['threadId']=_0x4a67e1[_0xd9b0('0x4a')]['threadId'];_0x4b2b07[_0xd9b0('0xac')]=_0x4a67e1['body'][_0xd9b0('0xac')];return db[_0xd9b0('0xab')][_0xd9b0('0x49')](_0x4b2b07)[_0xd9b0('0x12')](function(_0x26c4c4){return[_0x26c4c4,!![]];});});}_0x5aecdc[_0xd9b0('0xad')]=_0x1c949d['id'];if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xae')]&&_0x4a67e1[_0xd9b0('0x4a')]['interaction']['id']){_0x5aecdc['id']=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xae')]['id'];return db['ChatInteraction']['find']({'where':_0x5aecdc})['then'](function(_0x2bd308){if(_0x2bd308){return[_0x2bd308,![]];}return db[_0xd9b0('0xab')]['create'](_0x4b2b07)[_0xd9b0('0x12')](function(_0x5967a5){return[_0x5967a5,!![]];});});}return db[_0xd9b0('0xab')][_0xd9b0('0x49')](_0x4b2b07)[_0xd9b0('0x12')](function(_0x218e3b){return[_0x218e3b,!![]];});}})[_0xd9b0('0xaf')](function(_0x4f7cf2,_0x4f2586){if(_0x4f7cf2){_0x2ea8c3=_0x4f2586;if(!_0x4f2586){var _0x4ed891={'from':(_0x59dad7[_0xd9b0('0x99')]['firstName']||'')+'\x20'+(_0x59dad7[_0xd9b0('0x99')][_0xd9b0('0x9f')]||'')};if(_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xaa')]&&_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')]&&_0x4a67e1[_0xd9b0('0x4a')]['threadId']!=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')]){_0x4ed891['threadId']=_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb0')];}return _0x4f7cf2[_0xd9b0('0x23')](_0x4ed891);}else{return _0x4f7cf2;}}})[_0xd9b0('0x12')](function(_0x2cf9c2){_0x59dad7['interaction']=_0x2cf9c2['get']({'plain':!![]});_0x59dad7['interaction'][_0xd9b0('0xb1')]=_0x2ea8c3;if(_0x59dad7[_0xd9b0('0xae')][_0xd9b0('0xb1')]){if(_0x59dad7[_0xd9b0('0x93')][_0xd9b0('0xb2')]){_0x59dad7[_0xd9b0('0x96')][_0xd9b0('0xb3')]({'id':0x0,'priority':_0x59dad7['applications'][_0xd9b0('0x36')]+0x1,'app':_0xd9b0('0xb4'),'appdata':_0xd9b0('0xb5'),'interval':_0xd9b0('0xb6')});}}return db['ChatMessage'][_0xd9b0('0x49')]({'body':_0x4a67e1[_0xd9b0('0x4a')]['body'],'ChatWebsiteId':_0x4a67e1['params']['id'],'ChatInteractionId':_0x2cf9c2['id'],'direction':'in','ContactId':_0x59dad7[_0xd9b0('0x99')]['id'],'AttachmentId':_0x4a67e1[_0xd9b0('0x4a')][_0xd9b0('0xb7')]});})[_0xd9b0('0x12')](function(_0x513cf1){_0x59dad7['message']=_0x513cf1;if(_0x59dad7[_0xd9b0('0xae')][_0xd9b0('0xb8')]){return db['User'][_0xd9b0('0x48')]({'attributes':['id','name'],'where':{'id':_0x59dad7[_0xd9b0('0xae')]['UserId']}})['then'](function(_0x9dc1ac){if(_0x9dc1ac){_0x59dad7[_0xd9b0('0x96')][_0xd9b0('0xb9')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x9dc1ac[_0xd9b0('0x29')]+','+(_0x59dad7[_0xd9b0('0x93')]['waitForTheAssignedAgent']||0xa),'interval':_0xd9b0('0xb6')});_0x59dad7[_0xd9b0('0xba')]=!![];}return respondWithRpcPromise(_0xd9b0('0xbb'),_0xd9b0('0xbc'),_0x59dad7);});}return respondWithRpcPromise(_0xd9b0('0xbb'),_0xd9b0('0xbc'),_0x59dad7);})[_0xd9b0('0x12')](function(_0x5c7ccc){respondWithRpcPromise('EventManager','EventManager',{'event':_0xd9b0('0xbd'),'message':_0x5c7ccc},client9002);return _0x5c7ccc;})[_0xd9b0('0x12')](respondWithResult(_0x107a67,null))[_0xd9b0('0x1b')](handleError(_0x107a67,null));};exports[_0xd9b0('0xbe')]=function(_0x524866,_0x561c5c){var _0x5b29b7,_0x258141,_0x3807a3;var _0xb3f6fb=[];var _0x2cc125={};var _0x2f1324=_0x524866[_0xd9b0('0xbf')]||[];var _0x32441a=[];var _0x4027d0;return db['CmContact'][_0xd9b0('0x53')]()[_0xd9b0('0x12')](function(_0x36c94b){if(!_0x36c94b){throw new db['Sequelize']['ValidationError'](_0xd9b0('0xc0'));}_0xb3f6fb=_[_0xd9b0('0x80')](_[_0xd9b0('0x32')](_0x36c94b),[_0xd9b0('0x81'),'updatedAt',_0xd9b0('0x83'),_0xd9b0('0x84')]);if(_0x524866['body']['id']){delete _0x524866['body']['id'];}if(_['isNil'](_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x87')));}if(_[_0xd9b0('0x77')](_0x524866['body']['body'])||_0x524866[_0xd9b0('0x4a')]['body']===''){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0x88')));}if(_[_0xd9b0('0x77')](_0x524866[_0xd9b0('0x4a')]['mapKeyOffline'])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0xc2')+_0xb3f6fb));}if(!_[_0xd9b0('0x8b')](_0xb3f6fb,_0x524866[_0xd9b0('0x4a')][_0xd9b0('0xc3')])){throw _0x561c5c[_0xd9b0('0x1d')](0x1f4)[_0xd9b0('0xc1')](new db[(_0xd9b0('0x7f'))][(_0xd9b0('0x86'))](_0xd9b0('0xc4')+_0xb3f6fb));}_0x2cc125[_0x524866[_0xd9b0('0x4a')][_0xd9b0('0xc3')]]=_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')];})[_0xd9b0('0x12')](function(){return db['ChatWebsite'][_0xd9b0('0x48')]({'where':{'id':_0x524866[_0xd9b0('0x44')]['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db['MailAccount'],'as':_0xd9b0('0xc5')}]});})[_0xd9b0('0x12')](handleEntityNotFound(_0x561c5c,null))[_0xd9b0('0x12')](function(_0x11cace){if(_0x11cace&&_0x11cace[_0xd9b0('0x8e')]){_0x258141=_0x11cace;var _0x48dea5=_['defaults'](_0x524866['body'],{'firstName':_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')],'phone':_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')],'ListId':_0x11cace[_0xd9b0('0x84')]});_0x48dea5[_0x524866[_0xd9b0('0x4a')]['mapKeyOffline']]=_0x524866[_0xd9b0('0x4a')][_0xd9b0('0x85')];return db[_0xd9b0('0x7e')][_0xd9b0('0xc6')]({'where':_0x2cc125,'defaults':_0x48dea5});}})[_0xd9b0('0xaf')](function(_0xbc4c0f){if(_0xbc4c0f){_0x3807a3=_0xbc4c0f;var _0x58500b=fs[_0xd9b0('0xc7')](path[_0xd9b0('0x6d')](config['root'],_0xd9b0('0xc8')),'utf8');var _0x537d10=ejs['render'](_0x58500b,{'body':_['toPairs'](_0x524866['body']['body']),'bodyTitle':_0x258141[_0xd9b0('0xc9')]});return db['ChatOfflineMessage'][_0xd9b0('0x49')]({'body':_0x537d10,'ContactId':_0xbc4c0f['id'],'ChatWebsiteId':_0x258141['id']});}})[_0xd9b0('0x12')](function(_0x4f4bad){_0x4027d0=_0x4f4bad;if(_0x2f1324[_0xd9b0('0x36')]){var _0x4848e0=_0x2f1324[_0xd9b0('0x2c')](function(_0x2094b7){return{'name':_0x2094b7['originalname'],'basename':_0x2094b7[_0xd9b0('0x63')],'type':_0x2094b7[_0xd9b0('0xca')],'ChatOfflineMessageId':_0x4f4bad['id']};});_0x32441a=_0x4848e0[_0xd9b0('0x2c')](_0x16bf8b=>{var _0x12c21d={'filename':_0x16bf8b[_0xd9b0('0x29')],'path':path['join'](config[_0xd9b0('0x68')],'server',_0xd9b0('0xbf'),_0xd9b0('0xcb'),_0xd9b0('0xcc'),_0x16bf8b['basename'])};return _0x12c21d;});if(!_0x258141[_0xd9b0('0xcd')]){return db[_0xd9b0('0xce')]['transaction'](function(_0x23badb){return db[_0xd9b0('0xcf')][_0xd9b0('0xd0')](_0x4848e0,{'transaction':_0x23badb});});}}})['then'](function(){if(_0x4027d0){_0x5b29b7=_0x4027d0;return db[_0xd9b0('0xc5')][_0xd9b0('0x57')]({'where':{'active':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9b0('0xd1'),'raw':!![]}]});}})[_0xd9b0('0x12')](function(_0x26e944){if(_0x26e944&&_0x26e944[_0xd9b0('0xd1')]&&_0x258141[_0xd9b0('0xd2')]&&_0x258141['forwardOfflineAddress']){var _0x2b328f={'tls':{'rejectUnauthorized':![]}};if(_0x26e944[_0xd9b0('0xd1')]['service']){_0x2b328f['service']=_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd3')];}else{_0x2b328f['host']=_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd4')];_0x2b328f[_0xd9b0('0xd5')]=_0x26e944[_0xd9b0('0xd1')]['port'];_0x2b328f[_0xd9b0('0xd6')]=_0x26e944[_0xd9b0('0xd1')]['secure'];}if(_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd7')]){_0x2b328f[_0xd9b0('0xd8')]={'user':_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0x4b')],'pass':_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0xd9')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x2b328f,'message':{'from':util[_0xd9b0('0xa4')](_0xd9b0('0xda'),_0x26e944['name'],_0x26e944['email']||_0x26e944[_0xd9b0('0xd1')][_0xd9b0('0x4b')]),'to':_0x258141[_0xd9b0('0xdb')],'subject':_0x258141['offlineMessageSubject'],'html':_0x5b29b7[_0xd9b0('0x4a')],'attachments':_0x32441a}},client9003)[_0xd9b0('0x12')](function(){return _0x5b29b7;})[_0xd9b0('0x1b')](function(_0x17c888){console['error'](_0x17c888);});}})[_0xd9b0('0x12')](function(){if(_0x258141&&_0x258141['openNewInteraction']&&_0x258141[_0xd9b0('0xdc')]){var _0x40defb=[];if(_0x2f1324['length']){_0x40defb=_0x2f1324[_0xd9b0('0x2c')](function(_0x310f11){return{'name':_0x310f11[_0xd9b0('0xdd')],'basename':_0x310f11[_0xd9b0('0x63')],'type':_0x310f11[_0xd9b0('0xca')],'ChatOfflineMessageId':_0x4027d0['id']};});}var _0x40742e;if(!_[_0xd9b0('0x77')](_0x258141[_0xd9b0('0xde')])){var _0xda81c8=_[_0xd9b0('0x2c')](_0x524866['body'],function(_0x461796){return _0x461796;});var _0x5f0f94=_[_0xd9b0('0xdf')](_0xda81c8)[0x0];var _0x33ace1=_['mapValues'](_0x5f0f94,function(_0xb54216){return _0xb54216;});_0x40742e=_0x33ace1[0x1][_0x258141[_0xd9b0('0xde')]];}var _0x472094={'from':_0x3807a3[_0xd9b0('0xe0')],'firstName':_0x3807a3['firstName'],'lastName':_0x3807a3[_0xd9b0('0x9f')],'mapKey':'email','message':{'from':_0x3807a3[_0xd9b0('0xe0')],'to':_0x258141[_0xd9b0('0xc5')]['email'],'cc':'','subject':_[_0xd9b0('0x77')](_0x40742e)?_0x258141[_0xd9b0('0xe1')]:_0x40742e,'messageId':'','sentAt':new Date(),'attach':_0x40defb[_0xd9b0('0x36')],'attachments':_0x40defb,'originChannel':_0xd9b0('0xe2'),'ChatWebsiteId':_0x258141['id'],'ChatOfflineMessageId':_0x5b29b7['id'],'originTo':_0x258141[_0xd9b0('0xc5')]['email']},'body':_0x5b29b7['body']};var _0x167034={'account':{'id':_0x258141[_0xd9b0('0xdc')]},'body':_0x472094,'log':_0xd9b0('0xe3')};return respondWithRpcPromise(_0xd9b0('0xe3'),_0xd9b0('0xe4'),_0x167034,client9001)[_0xd9b0('0x12')](function(){return _0x5b29b7;})[_0xd9b0('0x1b')](function(_0x408aa9){console[_0xd9b0('0x17')](_0x408aa9);});}return;})[_0xd9b0('0x12')](function(){if(_0x5b29b7){return _0x5b29b7;}})[_0xd9b0('0x12')](respondWithResult(_0x561c5c,null))[_0xd9b0('0x1b')](function(_0x51a84a){console['error'](_0xd9b0('0x1b'),_0x51a84a);for(var _0x16a4e0 of _0x2f1324){var _0x486263=path['join'](config[_0xd9b0('0x68')],'server',_0xd9b0('0xbf'),_0xd9b0('0xcb'),_0xd9b0('0xcc'),_0x16a4e0[_0xd9b0('0x63')]);fs_extra[_0xd9b0('0xe5')](_0x486263)[_0xd9b0('0x1b')](function(_0x46d0f6){console[_0xd9b0('0x17')](_0xd9b0('0xe6'),_0x486263,_0x46d0f6);});}});};exports[_0xd9b0('0xe7')]=function(_0x253576,_0x22b178){return db[_0xd9b0('0xab')][_0xd9b0('0x48')]({'where':{'id':_0x253576['params']['id']}})['then'](handleEntityNotFound(_0x22b178,null))[_0xd9b0('0x12')](function(_0x3c811d){if(_0x3c811d){return _0x3c811d[_0xd9b0('0xe7')](_0x253576['body'][_0xd9b0('0x5c')],_[_0xd9b0('0xe8')](_0x253576[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x22b178,null))['catch'](handleError(_0x22b178,null));};exports[_0xd9b0('0xe9')]=function(_0x128525,_0x50762e){var _0x1c4409={'raw':![],'where':{}};var _0x30bd20={};var _0x20deca={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x128525[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x50762e,null))[_0xd9b0('0x12')](function(_0x55369d){if(_0x55369d){_0x30bd20[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0xab')]['rawAttributes']);_0x30bd20[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x128525[_0xd9b0('0x31')]);_0x30bd20[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x30bd20['model'],_0x30bd20[_0xd9b0('0x31')]);_0x1c4409[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x30bd20[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x128525[_0xd9b0('0x31')]['fields']));_0x1c4409[_0xd9b0('0x34')]=_0x1c4409[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x1c4409[_0xd9b0('0x34')]:_0x30bd20[_0xd9b0('0x30')];if(!_0x128525[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x1c4409[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x128525[_0xd9b0('0x31')]['limit']);_0x1c4409[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x128525[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}_0x1c4409[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x128525['query'][_0xd9b0('0x3b')]);_0x1c4409[_0xd9b0('0x3c')]=qs['filters'](_[_0xd9b0('0x59')](_0x128525[_0xd9b0('0x31')],_0x30bd20[_0xd9b0('0x3d')]));_0x1c4409['where'][_0xd9b0('0x55')]=_0x55369d['id'];if(_0x128525[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x1c4409[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x1c4409['where'],{'$or':_[_0xd9b0('0x2c')](_0x1c4409['attributes'],function(_0x304d4a){var _0x1301e9={};_0x1301e9[_0x304d4a]={'$like':'%'+_0x128525[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1301e9;})});}_0x1c4409=_[_0xd9b0('0x46')]({},_0x1c4409,_0x128525['options']);return db[_0xd9b0('0xab')][_0xd9b0('0x20')]({'where':_0x1c4409['where']})[_0xd9b0('0x12')](function(_0x35fb72){_0x20deca[_0xd9b0('0x20')]=_0x35fb72;if(_0x128525[_0xd9b0('0x31')][_0xd9b0('0x45')]){_0x1c4409['include']=[{'model':db['CmContact'],'as':_0xd9b0('0xea'),'required':![]},{'model':db[_0xd9b0('0xeb')],'as':_0xd9b0('0xec'),'attributes':['name',_0xd9b0('0xed'),_0xd9b0('0xee')],'required':![]},{'model':db[_0xd9b0('0xef')],'as':_0xd9b0('0xf0'),'attributes':['id','name',_0xd9b0('0xf1')],'where':_0x128525[_0xd9b0('0x31')][_0xd9b0('0xf2')]?{'id':_0x128525['query'][_0xd9b0('0xf2')]}:undefined,'required':_0x128525[_0xd9b0('0x31')][_0xd9b0('0xf2')]?!![]:![]}];}return db[_0xd9b0('0xab')][_0xd9b0('0x41')](_0x1c4409);})[_0xd9b0('0x12')](function(_0x1bf80f){_0x20deca[_0xd9b0('0x42')]=_0x1bf80f;return _0x20deca;});}})['then'](respondWithFilteredResult(_0x50762e,_0x1c4409))[_0xd9b0('0x1b')](handleError(_0x50762e,null));};function iftimePromise(_0xe20a4e,_0x5cf61f){return respondWithRpcPromise(_0xd9b0('0xf3'),_0xd9b0('0xf4'),{'command':_0x5cf61f[_0xd9b0('0xf5')]?util[_0xd9b0('0xa4')](_0xd9b0('0xf6'),_0xe20a4e[_0xd9b0('0xf7')],_0x5cf61f[_0xd9b0('0xf5')]):util[_0xd9b0('0xa4')](_0xd9b0('0xf8'),_0xe20a4e[_0xd9b0('0xf7')])},client9002)[_0xd9b0('0x12')](function(_0x109de3){var _0x4ad6f9=_0x109de3&&_0x109de3[_0xd9b0('0xf9')](_0xd9b0('0xfa'))>=0x0?!![]:![];logger[_0xd9b0('0x1a')](_0xd9b0('0xfb'),_0x5cf61f['id'],_0xe20a4e['id'],_0xe20a4e[_0xd9b0('0xf7')],_0x4ad6f9?'ONLINE':_0xd9b0('0xfc'),_0x5cf61f[_0xd9b0('0xf5')]?_0x5cf61f[_0xd9b0('0xf5')]:_0xd9b0('0xfd'));return _0x4ad6f9;})[_0xd9b0('0x1b')](function(_0x3098a8){logger[_0xd9b0('0x17')](_0xd9b0('0xfb'),_0x5cf61f['id'],_0xe20a4e['id'],_0xe20a4e['interval'],util[_0xd9b0('0xfe')](_0x3098a8,{'showHidden':![],'depth':null}),_0x5cf61f['timezone']?_0x5cf61f['timezone']:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x8e1ef0,_0x271f45){var _0xc0a90a=0x0;var _0x58d8e7=0x0;var _0x245767=![];var _0x404c4f;var _0x41a4aa;return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x8e1ef0[_0xd9b0('0x44')]['id']},'include':[{'model':db[_0xd9b0('0xff')],'as':_0xd9b0('0xff'),'include':[{'model':db['Interval'],'as':_0xd9b0('0x100'),'attributes':['id',_0xd9b0('0xf7')],'raw':!![]}]}]})[_0xd9b0('0x12')](handleEntityNotFound(_0x271f45,null))['then'](function(_0x5d9a3e){if(_0x5d9a3e){_0x404c4f=_0x5d9a3e;return _0x5d9a3e[_0xd9b0('0x101')]({'raw':!![]});}})[_0xd9b0('0x12')](function(_0x1a0d4a){if(_0x404c4f){if(_0x1a0d4a){_0x41a4aa=_0x1a0d4a;}}return require(_0xd9b0('0x69'))['getLicense']();})[_0xd9b0('0x12')](function(_0x1aa541){if(_0x1aa541){_0x58d8e7=_0x1aa541['virtual'];_0x245767=_0x1aa541[_0xd9b0('0x6b')];}})[_0xd9b0('0x12')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})['then'](function(_0x111909){_0xc0a90a=_0x111909;if(_0x58d8e7&&_0x111909>_0x58d8e7){return db[_0xd9b0('0x102')][_0xd9b0('0x57')]({'where':{'id':0x1}})[_0xd9b0('0x12')](function(_0x448a3c){if(_0x448a3c){_0x448a3c[_0xd9b0('0x103')](_0xd9b0('0x104'));}});}})['then'](function(){if(_0x404c4f['Interval']&&_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')]){var _0x25afab=[];for(var _0x286c19=0x0;_0x286c19<_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')][_0xd9b0('0x36')];_0x286c19++){var _0x312962=_0x404c4f[_0xd9b0('0xff')][_0xd9b0('0x100')][_0x286c19][_0xd9b0('0x25')]({'plain':!![]});_0x25afab[_0xd9b0('0xb3')](iftimePromise(_0x312962,_0x404c4f));}return BPromise[_0xd9b0('0x105')](_0x25afab)[_0xd9b0('0x12')](function(_0x46652d){return _[_0xd9b0('0x106')](_0x46652d);});}else{return!![];}})[_0xd9b0('0x12')](function(_0x2ace15){var _0x566e2c=fs[_0xd9b0('0xc7')](path['join'](config[_0xd9b0('0x68')],_0xd9b0('0x107')),_0xd9b0('0x108'));var _0x262054={'remote':_0x404c4f[_0xd9b0('0x109')],'query':querystring['stringify'](_[_0xd9b0('0x46')](_0x404c4f[_0xd9b0('0x25')]({'plain':!![]}),{'customerIp':_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0x9c')]||_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0x10a')]||_0x8e1ef0[_0xd9b0('0x10b')][_0xd9b0('0x10c')]||_0x8e1ef0['ip'],'referer':_0x8e1ef0[_0xd9b0('0x9b')][_0xd9b0('0xa1')],'openedInteractions':_0xc0a90a,'maxInteractions':_0x58d8e7,'virtual':_0x245767[_0xd9b0('0x10d')],'online':_0x2ace15,'custom':_0x245767}))[_0xd9b0('0x10e')](/'/g,'\x5c\x27')};_0x271f45[_0xd9b0('0xc1')](ejs[_0xd9b0('0x10f')](Mustache[_0xd9b0('0x10f')](_0x566e2c,_0x262054),{'proactiveActions':_0x41a4aa,'alignment':_0x404c4f[_0xd9b0('0x110')],'verticalAlignment':_0x404c4f[_0xd9b0('0x111')],'div_color':_0x404c4f[_0xd9b0('0xf1')],'labelText':_0x404c4f['labelText'],'text_color':_0x404c4f[_0xd9b0('0x112')],'button_color':_0x404c4f[_0xd9b0('0x113')],'background_color':_0x404c4f[_0xd9b0('0x114')]}));})['catch'](handleError(_0x271f45,null));};exports[_0xd9b0('0x115')]=function(_0x21d4d0,_0x3611b2){var _0x332616=_0x21d4d0[_0xd9b0('0x44')]['id'];var _0x53fd8e=_0x21d4d0['body'];var _0x3edd36=0xc8;var _0x40a24e=null;return db[_0xd9b0('0xce')][_0xd9b0('0x116')]({'isolationLevel':db[_0xd9b0('0xce')][_0xd9b0('0x117')]['ISOLATION_LEVELS'][_0xd9b0('0x118')]},function(_0x2e57ab){return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x332616},'transaction':_0x2e57ab})[_0xd9b0('0x12')](function(_0x2b7804){if(_0x2b7804){return db[_0xd9b0('0x91')][_0xd9b0('0x24')]({'where':{'ChatWebsiteId':_0x332616},'transaction':_0x2e57ab})['then'](function(){var _0x38d97d=_[_0xd9b0('0x2c')](_0x53fd8e,function(_0x54a750){_0x54a750[_0xd9b0('0x55')]=_0x332616;return _0x54a750;});return db[_0xd9b0('0x91')][_0xd9b0('0xd0')](_0x38d97d,{'transaction':_0x2e57ab});});}else{_0x3edd36=0x194;_0x40a24e=[];}});})[_0xd9b0('0x12')](function(){if(_0x3edd36!==0x194){return db['ChatApplication'][_0xd9b0('0x119')]({'where':{'ChatWebsiteId':_0x332616},'order':'priority'})[_0xd9b0('0x12')](function(_0x1efc54){_0x40a24e=_0x1efc54;});}})[_0xd9b0('0x1b')](function(_0x405f8a){_0x3edd36=0x1f4;logger[_0xd9b0('0x17')](_0x405f8a[_0xd9b0('0x28')]);if(_0x405f8a[_0xd9b0('0x29')]){delete _0x405f8a[_0xd9b0('0x29')];}_0x40a24e=_0x405f8a;})[_0xd9b0('0x11a')](function(){if(_0x40a24e===null){_0x3611b2['sendStatus'](_0x3edd36);}else{if(_0x3edd36===0x1f4){_0x3611b2[_0xd9b0('0x1d')](_0x3edd36)[_0xd9b0('0xc1')](_0x40a24e);}else{_0x3611b2[_0xd9b0('0x1d')](_0x3edd36)[_0xd9b0('0x22')](_0x40a24e);}}});};exports['getApplications']=function(_0xa2b32e,_0x5e9d74){var _0x50d291={};var _0x3a5f00={};var _0xdc57e1;var _0x115657;return db[_0xd9b0('0x40')][_0xd9b0('0x57')]({'where':{'id':_0xa2b32e['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x5e9d74,null))['then'](function(_0x5db610){if(_0x5db610){_0xdc57e1=_0x5db610;_0x3a5f00[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db[_0xd9b0('0x91')]['rawAttributes']);_0x3a5f00[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0xa2b32e[_0xd9b0('0x31')]);_0x3a5f00[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x3a5f00[_0xd9b0('0x30')],_0x3a5f00['query']);_0x50d291[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x3a5f00[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x35')]));_0x50d291[_0xd9b0('0x34')]=_0x50d291[_0xd9b0('0x34')]['length']?_0x50d291[_0xd9b0('0x34')]:_0x3a5f00[_0xd9b0('0x30')];_0x50d291[_0xd9b0('0x3a')]=qs['sort'](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x50d291['where']=qs['filters'](_[_0xd9b0('0x59')](_0xa2b32e[_0xd9b0('0x31')],_0x3a5f00['filters']));if(_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x50d291[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x50d291['where'],{'$or':_[_0xd9b0('0x2c')](_0x50d291[_0xd9b0('0x34')],function(_0x46194a){var _0x2cc634={};_0x2cc634[_0x46194a]={'$like':'%'+_0xa2b32e['query']['filter']+'%'};return _0x2cc634;})});}_0x50d291=_[_0xd9b0('0x46')]({},_0x50d291,_0xa2b32e[_0xd9b0('0x47')]);return _0xdc57e1['getApplications'](_0x50d291);}})[_0xd9b0('0x12')](function(_0x53c036){if(_0x53c036){_0x115657=_0x53c036[_0xd9b0('0x36')];if(!_0xa2b32e[_0xd9b0('0x31')]['hasOwnProperty'](_0xd9b0('0x38'))){_0x50d291[_0xd9b0('0x39')]=qs['limit'](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x50d291['offset']=qs[_0xd9b0('0x1e')](_0xa2b32e[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0xdc57e1['getApplications'](_0x50d291);}})[_0xd9b0('0x12')](function(_0x44c4f5){if(_0x44c4f5){return _0x44c4f5?{'count':_0x115657,'rows':_0x44c4f5}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x5e9d74,null))[_0xd9b0('0x1b')](handleError(_0x5e9d74,null));};exports[_0xd9b0('0x11b')]=function(_0x2d673b,_0x556731){return db['chatProactiveAction']['find']({'where':{'id':_0x2d673b[_0xd9b0('0x44')]['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x556731,null))['then'](function(_0x35abe4){if(_0x35abe4){return _0x35abe4[_0xd9b0('0x11b')](_0x2d673b[_0xd9b0('0x4a')][_0xd9b0('0x5c')],_['omit'](_0x2d673b[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{});}})[_0xd9b0('0x12')](respondWithResult(_0x556731,null))[_0xd9b0('0x1b')](handleError(_0x556731,null));};exports['getProactiveActions']=function(_0x3727db,_0x3dcb0f){var _0x14fdf7={};var _0x18d430={};var _0x26a2e8;var _0x23c12e;return db['ChatWebsite'][_0xd9b0('0x57')]({'where':{'id':_0x3727db['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x3dcb0f,null))[_0xd9b0('0x12')](function(_0x40e164){if(_0x40e164){_0x26a2e8=_0x40e164;_0x18d430['model']=_[_0xd9b0('0x32')](db['ChatProactiveAction'][_0xd9b0('0x2d')]);_0x18d430[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3727db[_0xd9b0('0x31')]);_0x18d430[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0x18d430['model'],_0x18d430[_0xd9b0('0x31')]);_0x14fdf7[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0x18d430[_0xd9b0('0x30')],qs['fields'](_0x3727db['query'][_0xd9b0('0x35')]));_0x14fdf7[_0xd9b0('0x34')]=_0x14fdf7['attributes'][_0xd9b0('0x36')]?_0x14fdf7[_0xd9b0('0x34')]:_0x18d430[_0xd9b0('0x30')];_0x14fdf7[_0xd9b0('0x3a')]=qs['sort'](_0x3727db[_0xd9b0('0x31')]['sort']);_0x14fdf7[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3727db[_0xd9b0('0x31')],_0x18d430[_0xd9b0('0x3d')]));if(_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x14fdf7[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x14fdf7[_0xd9b0('0x3c')],{'$or':_['map'](_0x14fdf7[_0xd9b0('0x34')],function(_0x4c5226){var _0x136dcd={};_0x136dcd[_0x4c5226]={'$like':'%'+_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x136dcd;})});}_0x14fdf7=_[_0xd9b0('0x46')]({},_0x14fdf7,_0x3727db['options']);return _0x26a2e8[_0xd9b0('0x101')](_0x14fdf7);}})['then'](function(_0x10bf50){if(_0x10bf50){_0x23c12e=_0x10bf50[_0xd9b0('0x36')];if(!_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x14fdf7[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3727db['query'][_0xd9b0('0x39')]);_0x14fdf7[_0xd9b0('0x1e')]=qs['offset'](_0x3727db[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0x26a2e8['getProactiveActions'](_0x14fdf7);}})[_0xd9b0('0x12')](function(_0x56c0c1){if(_0x56c0c1){return _0x56c0c1?{'count':_0x23c12e,'rows':_0x56c0c1}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x3dcb0f,null))[_0xd9b0('0x1b')](handleError(_0x3dcb0f,null));};exports[_0xd9b0('0x11c')]=function(_0x2f1899,_0x27645f){var _0x13e9d9=_0x2f1899[_0xd9b0('0x31')][_0xd9b0('0x11d')]==='false'?_0xd9b0('0x11e'):'onlineForm';return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'attributes':['id',_0x13e9d9],'where':{'id':_0x2f1899[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x27645f,null))[_0xd9b0('0x12')](function(_0x9401f4){if(_0x9401f4){var _0x197905=_0x9401f4[_0x13e9d9];var _0x35b482=_0x197905&&_0x197905['items']?_0x197905[_0xd9b0('0x11f')]:[];_0x27645f['send']({'fromKey':_['isNil'](_0x197905[_0xd9b0('0x120')])?undefined:_0x197905['fromKey'],'count':_0x35b482['length'],'rows':_0x35b482});}})['catch'](handleError(_0x27645f,null));};exports[_0xd9b0('0x121')]=function(_0x3503de,_0x4bf108){var _0x13fc32={'raw':![],'where':{}};var _0xab88e8={};var _0x5d7e9f={'count':0x0,'rows':[]};return db[_0xd9b0('0x40')]['findOne']({'where':{'id':_0x3503de['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x4bf108,null))[_0xd9b0('0x12')](function(_0x245222){if(_0x245222){_0xab88e8[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['ChatOfflineMessage']['rawAttributes']);_0xab88e8[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3503de[_0xd9b0('0x31')]);_0xab88e8[_0xd9b0('0x3d')]=_[_0xd9b0('0x33')](_0xab88e8[_0xd9b0('0x30')],_0xab88e8[_0xd9b0('0x31')]);_0x13fc32[_0xd9b0('0x34')]=_[_0xd9b0('0x33')](_0xab88e8['model'],qs[_0xd9b0('0x35')](_0x3503de['query'][_0xd9b0('0x35')]));_0x13fc32[_0xd9b0('0x34')]=_0x13fc32[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x13fc32[_0xd9b0('0x34')]:_0xab88e8[_0xd9b0('0x30')];if(!_0x3503de['query'][_0xd9b0('0x37')]('nolimit')){_0x13fc32[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3503de[_0xd9b0('0x31')]['limit']);_0x13fc32[_0xd9b0('0x1e')]=qs['offset'](_0x3503de['query'][_0xd9b0('0x1e')]);}_0x13fc32[_0xd9b0('0x3a')]=qs[_0xd9b0('0x3b')](_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3b')]);_0x13fc32[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3503de[_0xd9b0('0x31')],_0xab88e8['filters']));_0x13fc32['where'][_0xd9b0('0x55')]=_0x245222['id'];if(_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x13fc32[_0xd9b0('0x3c')]=_['merge'](_0x13fc32[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x13fc32[_0xd9b0('0x34')],function(_0xc76c71){var _0x1eb07c={};_0x1eb07c[_0xc76c71]={'$like':'%'+_0x3503de[_0xd9b0('0x31')][_0xd9b0('0x3e')]+'%'};return _0x1eb07c;})});}_0x13fc32=_[_0xd9b0('0x46')]({},_0x13fc32,_0x3503de[_0xd9b0('0x47')]);return db[_0xd9b0('0x122')][_0xd9b0('0x20')]({'where':_0x13fc32[_0xd9b0('0x3c')]})[_0xd9b0('0x12')](function(_0x52508b){_0x5d7e9f[_0xd9b0('0x20')]=_0x52508b;if(_0x3503de['query'][_0xd9b0('0x45')]){_0x13fc32['include']=[{'all':!![]}];}else{_0x13fc32[_0xd9b0('0x5a')]=[{'model':db[_0xd9b0('0x7e')],'as':'Contact','required':![]},{'model':db[_0xd9b0('0xcf')],'as':_0xd9b0('0x123'),'required':![]}];}return db[_0xd9b0('0x122')][_0xd9b0('0x41')](_0x13fc32);})[_0xd9b0('0x12')](function(_0x49e33c){_0x5d7e9f[_0xd9b0('0x42')]=_0x49e33c;return _0x5d7e9f;});}})['then'](respondWithFilteredResult(_0x4bf108,_0x13fc32))[_0xd9b0('0x1b')](handleError(_0x4bf108,null));};exports[_0xd9b0('0x124')]=function(_0x1be486,_0x1933db){return db[_0xd9b0('0x40')]['find']({'where':{'id':_0x1be486['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x1933db,null))[_0xd9b0('0x12')](function(_0x6e29ce){if(_0x6e29ce){return _0x6e29ce[_0xd9b0('0x124')](_0x1be486[_0xd9b0('0x4a')][_0xd9b0('0x5c')],_['omit'](_0x1be486[_0xd9b0('0x4a')],[_0xd9b0('0x5c'),'id'])||{})[_0xd9b0('0xaf')](function(_0x370abd){for(var _0x4fa29e=0x0;_0x4fa29e<_0x1be486['body'][_0xd9b0('0x5c')][_0xd9b0('0x36')];_0x4fa29e+=0x1){socket[_0xd9b0('0x125')](_0xd9b0('0x126'),{'UserId':Number(_0x1be486[_0xd9b0('0x4a')][_0xd9b0('0x5c')][_0x4fa29e]),'ChatWebsiteId':Number(_0x1be486[_0xd9b0('0x44')]['id'])});}return _0x370abd;});}})[_0xd9b0('0x12')](respondWithResult(_0x1933db,null))['catch'](handleError(_0x1933db,null));};exports[_0xd9b0('0x127')]=function(_0x539426,_0x45da2c){return db[_0xd9b0('0x40')][_0xd9b0('0x48')]({'where':{'id':_0x539426['params']['id']}})[_0xd9b0('0x12')](handleEntityNotFound(_0x45da2c,null))[_0xd9b0('0x12')](function(_0x2d0401){if(_0x2d0401){return _0x2d0401[_0xd9b0('0x127')](_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')])[_0xd9b0('0x12')](function(){if(_[_0xd9b0('0x128')](_0x539426['query'][_0xd9b0('0x5c')])){for(var _0x1953fd=0x0;_0x1953fd<_0x539426['query'][_0xd9b0('0x5c')][_0xd9b0('0x36')];_0x1953fd+=0x1){socket[_0xd9b0('0x125')](_0xd9b0('0x129'),{'UserId':Number(_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')][_0x1953fd]),'ChatWebsiteId':Number(_0x539426['params']['id'])});}}else{socket[_0xd9b0('0x125')](_0xd9b0('0x129'),{'UserId':Number(_0x539426[_0xd9b0('0x31')][_0xd9b0('0x5c')]),'ChatWebsiteId':Number(_0x539426[_0xd9b0('0x44')]['id'])});}});}})[_0xd9b0('0x12')](respondWithStatusCode(_0x45da2c,null))[_0xd9b0('0x1b')](handleError(_0x45da2c,null));};exports[_0xd9b0('0x12a')]=function(_0x3afe41,_0x1e9466){var _0x45fc56={};var _0x5f0e05={};var _0x37d2df;var _0x586c6b;return db[_0xd9b0('0x40')]['findOne']({'where':{'id':_0x3afe41[_0xd9b0('0x44')]['id']}})['then'](handleEntityNotFound(_0x1e9466,null))[_0xd9b0('0x12')](function(_0x3f2aa1){if(_0x3f2aa1){_0x37d2df=_0x3f2aa1;_0x5f0e05[_0xd9b0('0x30')]=_[_0xd9b0('0x32')](db['User']['rawAttributes']);_0x5f0e05[_0xd9b0('0x31')]=_[_0xd9b0('0x32')](_0x3afe41[_0xd9b0('0x31')]);_0x5f0e05['filters']=_[_0xd9b0('0x33')](_0x5f0e05['model'],_0x5f0e05[_0xd9b0('0x31')]);_0x45fc56[_0xd9b0('0x34')]=_['intersection'](_0x5f0e05[_0xd9b0('0x30')],qs[_0xd9b0('0x35')](_0x3afe41[_0xd9b0('0x31')]['fields']));_0x45fc56[_0xd9b0('0x34')]=_0x45fc56[_0xd9b0('0x34')][_0xd9b0('0x36')]?_0x45fc56[_0xd9b0('0x34')]:_0x5f0e05[_0xd9b0('0x30')];_0x45fc56[_0xd9b0('0x3a')]=qs['sort'](_0x3afe41[_0xd9b0('0x31')]['sort']);_0x45fc56[_0xd9b0('0x3c')]=qs[_0xd9b0('0x3d')](_[_0xd9b0('0x59')](_0x3afe41[_0xd9b0('0x31')],_0x5f0e05[_0xd9b0('0x3d')]));if(_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x3e')]){_0x45fc56[_0xd9b0('0x3c')]=_[_0xd9b0('0x46')](_0x45fc56[_0xd9b0('0x3c')],{'$or':_[_0xd9b0('0x2c')](_0x45fc56[_0xd9b0('0x34')],function(_0x596fcc){var _0x4b15e6={};_0x4b15e6[_0x596fcc]={'$like':'%'+_0x3afe41['query'][_0xd9b0('0x3e')]+'%'};return _0x4b15e6;})});}_0x45fc56=_['merge']({},_0x45fc56,_0x3afe41[_0xd9b0('0x47')]);return _0x37d2df[_0xd9b0('0x12a')](_0x45fc56);}})[_0xd9b0('0x12')](function(_0x225983){if(_0x225983){_0x586c6b=_0x225983[_0xd9b0('0x36')];if(!_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x37')](_0xd9b0('0x38'))){_0x45fc56[_0xd9b0('0x39')]=qs[_0xd9b0('0x39')](_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x39')]);_0x45fc56[_0xd9b0('0x1e')]=qs[_0xd9b0('0x1e')](_0x3afe41[_0xd9b0('0x31')][_0xd9b0('0x1e')]);}return _0x37d2df[_0xd9b0('0x12a')](_0x45fc56);}})[_0xd9b0('0x12')](function(_0x3703f8){if(_0x3703f8){return _0x3703f8?{'count':_0x586c6b,'rows':_0x3703f8}:null;}})[_0xd9b0('0x12')](respondWithResult(_0x1e9466,null))[_0xd9b0('0x1b')](handleError(_0x1e9466,null));}; \ No newline at end of file +var _0x8626=['userProfileId','autoAssociation','UserProfileResource','params','describe','addDisposition','Disposition','getDispositions','findAll','removeDispositions','addAnswer','ChatWebsiteId','findOne','hasOwnProperty','sort','CannedAnswer','removeAnswers','ids','sitepic','file','addAvatar','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','systemAvatar','setUA','headers','user-agent','getResult','CmContact','ValidationError','difference','updatedAt','createdAt','CompanyId','ListId','from','Sequelize','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','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','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','notify','offline','files','no\x20available\x20attributes','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','originalname','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','toPairsIn','subjectOffline','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','No\x20timezone','Interval','getProactiveActions','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','utf8','x-real-ip','connection','replace','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','priority','finally','getApplications','addProactiveActions','omit','getFields','online','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','defaults','redis','socket.io-emitter','register','jayson/promise','client','http','request','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','Content-Range','then','destroy','get','ChatWebsites','sendStatus','stack','send','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','name','query','intersection','attributes','fields','length','nolimit','order','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','show','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x38a855,_0x22fac5){var _0x107430=function(_0x278696){while(--_0x278696){_0x38a855['push'](_0x38a855['shift']());}};_0x107430(++_0x22fac5);}(_0x8626,0xd9));var _0x6862=function(_0x246689,_0x5d5813){_0x246689=_0x246689-0x0;var _0x52516f=_0x8626[_0x246689];return _0x52516f;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x6862('0x0'));var util=require(_0x6862('0x1'));var path=require(_0x6862('0x2'));var ejs=require(_0x6862('0x3'));var fs=require('fs');var fs_extra=require(_0x6862('0x4'));var _=require(_0x6862('0x5'));var querystring=require(_0x6862('0x6'));var Redis=require(_0x6862('0x7'));var qs=require(_0x6862('0x8'));var logger=require('../../config/logger')(_0x6862('0x9'));var config=require(_0x6862('0xa'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x6862('0xb')](config[_0x6862('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6862('0xd'))(new Redis(config[_0x6862('0xc')]));require('./chatWebsite.socket')[_0x6862('0xe')](socket);var jayson=require(_0x6862('0xf'));var client=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x232c});var client9002=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x232a});var client9003=jayson['client']['http']({'port':0x232b});var client9001=jayson[_0x6862('0x10')][_0x6862('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x552332,_0x540510,_0x3ff5f8,_0x244a1a){return new BPromise(function(_0x3dd79a,_0x133957){var _0x346453=_0x244a1a||client;return _0x346453[_0x6862('0x12')](_0x552332,_0x3ff5f8)['then'](function(_0x33bc5){logger[_0x6862('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x540510,'request\x20sent');logger[_0x6862('0x14')](_0x6862('0x15'),_0x540510,'request\x20sent',JSON[_0x6862('0x16')](_0x33bc5));if(_0x33bc5[_0x6862('0x17')]){if(_0x33bc5[_0x6862('0x17')]['code']===0x1f4){logger[_0x6862('0x17')](_0x6862('0x18'),_0x540510,_0x33bc5['error'][_0x6862('0x19')]);return _0x133957(_0x33bc5[_0x6862('0x17')][_0x6862('0x19')]);}logger[_0x6862('0x17')](_0x6862('0x18'),_0x540510,_0x33bc5[_0x6862('0x17')]['message']);return _0x3dd79a(_0x33bc5[_0x6862('0x17')][_0x6862('0x19')]);}else{logger[_0x6862('0x13')](_0x6862('0x18'),_0x540510,'request\x20sent');_0x3dd79a(_0x33bc5[_0x6862('0x1a')][_0x6862('0x19')]);}})[_0x6862('0x1b')](function(_0x4a2d07){logger['error'](_0x6862('0x18'),_0x540510,_0x4a2d07);_0x133957(_0x4a2d07);});});}function respondWithStatusCode(_0x47d582,_0x45f684){_0x45f684=_0x45f684||0xcc;return function(_0x2dd417){if(_0x2dd417){return _0x47d582['sendStatus'](_0x45f684);}return _0x47d582[_0x6862('0x1c')](_0x45f684)[_0x6862('0x1d')]();};}function respondWithResult(_0x2d6602,_0xa3b0e){_0xa3b0e=_0xa3b0e||0xc8;return function(_0x18005f){if(_0x18005f){return _0x2d6602[_0x6862('0x1c')](_0xa3b0e)[_0x6862('0x1e')](_0x18005f);}};}function respondWithFilteredResult(_0x2e7741,_0xcb6b5d){return function(_0x5ecf0a){if(_0x5ecf0a){var _0x17ee25=typeof _0xcb6b5d[_0x6862('0x1f')]===_0x6862('0x20')&&typeof _0xcb6b5d['limit']===_0x6862('0x20');var _0x4981d5=_0x5ecf0a[_0x6862('0x21')];var _0x341275=_0x17ee25?0x0:_0xcb6b5d[_0x6862('0x1f')];var _0x418217=_0x17ee25?_0x5ecf0a[_0x6862('0x21')]:_0xcb6b5d['offset']+_0xcb6b5d[_0x6862('0x22')];var _0x3f7805;if(_0x418217>=_0x4981d5){_0x418217=_0x4981d5;_0x3f7805=0xc8;}else{_0x3f7805=0xce;}_0x2e7741[_0x6862('0x1c')](_0x3f7805);return _0x2e7741['set'](_0x6862('0x23'),_0x341275+'-'+_0x418217+'/'+_0x4981d5)[_0x6862('0x1e')](_0x5ecf0a);}return null;};}function saveUpdates(_0x3bf113){return function(_0x4eebf3){if(_0x4eebf3){return _0x4eebf3['update'](_0x3bf113)[_0x6862('0x24')](function(_0x4cc5a3){return _0x4cc5a3;});}return null;};}function removeEntity(_0xf2bab){return function(_0x59cb12){if(_0x59cb12){return _0x59cb12[_0x6862('0x25')]()[_0x6862('0x24')](function(){var _0x1cbf9=_0x59cb12[_0x6862('0x26')]({'plain':!![]});var _0x211387=_0x6862('0x27');return db['UserProfileResource'][_0x6862('0x25')]({'where':{'type':_0x211387,'resourceId':_0x1cbf9['id']}})[_0x6862('0x24')](function(){return _0x59cb12;});})[_0x6862('0x24')](function(){_0xf2bab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32e069){return function(_0x522517){if(!_0x522517){_0x32e069[_0x6862('0x28')](0x194);}return _0x522517;};}function handleError(_0x20fc1a,_0x1f5d0c){_0x1f5d0c=_0x1f5d0c||0x1f4;return function(_0x35d6ce){logger['error'](_0x35d6ce[_0x6862('0x29')]);if(_0x35d6ce['name']){delete _0x35d6ce['name'];}_0x20fc1a[_0x6862('0x1c')](_0x1f5d0c)[_0x6862('0x2a')](_0x35d6ce);};}exports['index']=function(_0x3b2abd,_0x46e3dc){var _0x194925={'include':[{'model':db[_0x6862('0x2b')],'as':_0x6862('0x2c')}]},_0x28bacc={},_0x36d603={'count':0x0,'rows':[]};var _0x1fd3df=_['map'](db[_0x6862('0x2d')][_0x6862('0x2e')],function(_0x5cfdb2){return{'name':_0x5cfdb2[_0x6862('0x2f')],'type':_0x5cfdb2[_0x6862('0x30')][_0x6862('0x31')]};});_0x28bacc[_0x6862('0x32')]=_[_0x6862('0x33')](_0x1fd3df,_0x6862('0x34'));_0x28bacc[_0x6862('0x35')]=_['keys'](_0x3b2abd[_0x6862('0x35')]);_0x28bacc['filters']=_[_0x6862('0x36')](_0x28bacc['model'],_0x28bacc['query']);_0x194925[_0x6862('0x37')]=_['intersection'](_0x28bacc[_0x6862('0x32')],qs[_0x6862('0x38')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x38')]));_0x194925['attributes']=_0x194925['attributes'][_0x6862('0x39')]?_0x194925[_0x6862('0x37')]:_0x28bacc[_0x6862('0x32')];if(!_0x3b2abd['query']['hasOwnProperty'](_0x6862('0x3a'))){_0x194925[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x22')]);_0x194925[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x3b2abd[_0x6862('0x35')][_0x6862('0x1f')]);}_0x194925[_0x6862('0x3b')]=qs['sort'](_0x3b2abd[_0x6862('0x35')]['sort']);_0x194925['where']=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x3b2abd[_0x6862('0x35')],_0x28bacc['filters']),_0x1fd3df);if(_0x3b2abd['query'][_0x6862('0x3e')]){_0x194925[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x194925[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x1fd3df,function(_0x51c12f){if(_0x51c12f['type']!==_0x6862('0x41')){var _0x5d89d6={};_0x5d89d6[_0x51c12f[_0x6862('0x34')]]={'$like':'%'+_0x3b2abd[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x5d89d6;}})});}_0x194925=_[_0x6862('0x40')]({},_0x194925,_0x3b2abd[_0x6862('0x42')]);var _0x11961f={'where':_0x194925[_0x6862('0x3f')]};return db[_0x6862('0x2d')]['count'](_0x11961f)[_0x6862('0x24')](function(_0x40f853){_0x36d603[_0x6862('0x21')]=_0x40f853;if(_0x3b2abd['query'][_0x6862('0x43')]){_0x194925[_0x6862('0x44')]=[{'all':!![]}];}return db[_0x6862('0x2d')]['findAll'](_0x194925);})[_0x6862('0x24')](function(_0x1c7573){_0x36d603[_0x6862('0x45')]=_0x1c7573;return _0x36d603;})[_0x6862('0x24')](respondWithFilteredResult(_0x46e3dc,_0x194925))[_0x6862('0x1b')](handleError(_0x46e3dc,null));};exports[_0x6862('0x46')]=function(_0x3cffb5,_0x436721){var _0x15f32d={'raw':![],'where':{'id':_0x3cffb5['params']['id']},'include':[{'model':db[_0x6862('0x2b')],'as':'mandatoryDispositionPause'}]},_0x2c3b37={};_0x2c3b37[_0x6862('0x32')]=_['keys'](db['ChatWebsite'][_0x6862('0x2e')]);_0x2c3b37[_0x6862('0x35')]=_[_0x6862('0x47')](_0x3cffb5[_0x6862('0x35')]);_0x2c3b37[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x2c3b37[_0x6862('0x32')],_0x2c3b37[_0x6862('0x35')]);_0x15f32d[_0x6862('0x37')]=_[_0x6862('0x36')](_0x2c3b37[_0x6862('0x32')],qs['fields'](_0x3cffb5['query'][_0x6862('0x38')]));_0x15f32d[_0x6862('0x37')]=_0x15f32d[_0x6862('0x37')][_0x6862('0x39')]?_0x15f32d['attributes']:_0x2c3b37[_0x6862('0x32')];if(_0x3cffb5['query'][_0x6862('0x43')]){_0x15f32d[_0x6862('0x44')]=[{'all':!![]}];}_0x15f32d=_['merge']({},_0x15f32d,_0x3cffb5[_0x6862('0x42')]);return db[_0x6862('0x2d')][_0x6862('0x48')](_0x15f32d)[_0x6862('0x24')](handleEntityNotFound(_0x436721,null))[_0x6862('0x24')](respondWithResult(_0x436721,null))[_0x6862('0x1b')](handleError(_0x436721,null));};exports[_0x6862('0x49')]=function(_0x1ac107,_0x931a56){return db[_0x6862('0x2d')][_0x6862('0x49')](_0x1ac107[_0x6862('0x4a')],{})['then'](function(_0x43bc02){var _0x58ad57=_0x1ac107[_0x6862('0x4b')]['get']({'plain':!![]});if(!_0x58ad57)throw new Error(_0x6862('0x4c'));if(_0x58ad57[_0x6862('0x4d')]==='user'){var _0x846590=_0x43bc02[_0x6862('0x26')]({'plain':!![]});var _0x381869=_0x6862('0x27');return db[_0x6862('0x4e')][_0x6862('0x48')]({'where':{'name':_0x381869,'userProfileId':_0x58ad57[_0x6862('0x4f')]},'raw':!![]})['then'](function(_0x73355e){if(_0x73355e&&_0x73355e[_0x6862('0x50')]===0x0){return db[_0x6862('0x51')]['create']({'name':_0x846590[_0x6862('0x34')],'resourceId':_0x846590['id'],'type':_0x73355e['name'],'sectionId':_0x73355e['id']},{})[_0x6862('0x24')](function(){return _0x43bc02;});}else{return _0x43bc02;}})[_0x6862('0x1b')](function(_0xd70dd4){logger[_0x6862('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xd70dd4);throw _0xd70dd4;});}return _0x43bc02;})[_0x6862('0x24')](respondWithResult(_0x931a56,0xc9))[_0x6862('0x1b')](handleError(_0x931a56,null));};exports['update']=function(_0x1a4511,_0x2d301e){if(_0x1a4511[_0x6862('0x4a')]['id']){delete _0x1a4511[_0x6862('0x4a')]['id'];}return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x1a4511[_0x6862('0x52')]['id']},'include':[{'model':db['Pause'],'as':_0x6862('0x2c')}]})[_0x6862('0x24')](handleEntityNotFound(_0x2d301e,null))[_0x6862('0x24')](saveUpdates(_0x1a4511[_0x6862('0x4a')],null))['then'](respondWithResult(_0x2d301e,null))[_0x6862('0x1b')](handleError(_0x2d301e,null));};exports[_0x6862('0x25')]=function(_0x9d948,_0x23b66c){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x9d948[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x23b66c,null))[_0x6862('0x24')](removeEntity(_0x23b66c,null))[_0x6862('0x1b')](handleError(_0x23b66c,null));};exports[_0x6862('0x53')]=function(_0x13c186,_0x22da2b){return db[_0x6862('0x2d')][_0x6862('0x53')]()[_0x6862('0x24')](respondWithResult(_0x22da2b,null))[_0x6862('0x1b')](handleError(_0x22da2b,null));};exports[_0x6862('0x54')]=function(_0x5001ee,_0x59acc5){if(_0x5001ee[_0x6862('0x4a')]['id']){delete _0x5001ee[_0x6862('0x4a')]['id'];}return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5001ee['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x59acc5,null))[_0x6862('0x24')](function(_0x722d69){if(_0x722d69){_0x5001ee[_0x6862('0x4a')]['ChatWebsiteId']=_0x722d69['id'];return db[_0x6862('0x55')][_0x6862('0x49')](_0x5001ee['body']);}})[_0x6862('0x24')](respondWithResult(_0x59acc5,null))[_0x6862('0x1b')](handleError(_0x59acc5,null));};exports[_0x6862('0x56')]=function(_0x2dd654,_0x3dd695){var _0x46e6e8={'raw':![],'where':{}};var _0x8aa3b0={};var _0x2a7781={'count':0x0,'rows':[]};return db[_0x6862('0x2d')]['findOne']({'where':{'id':_0x2dd654[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x3dd695,null))[_0x6862('0x24')](function(_0x3bbf40){if(_0x3bbf40){_0x8aa3b0[_0x6862('0x32')]=_[_0x6862('0x47')](db[_0x6862('0x55')][_0x6862('0x2e')]);_0x8aa3b0[_0x6862('0x35')]=_[_0x6862('0x47')](_0x2dd654[_0x6862('0x35')]);_0x8aa3b0['filters']=_[_0x6862('0x36')](_0x8aa3b0[_0x6862('0x32')],_0x8aa3b0[_0x6862('0x35')]);_0x46e6e8[_0x6862('0x37')]=_[_0x6862('0x36')](_0x8aa3b0[_0x6862('0x32')],qs[_0x6862('0x38')](_0x2dd654[_0x6862('0x35')][_0x6862('0x38')]));_0x46e6e8['attributes']=_0x46e6e8[_0x6862('0x37')][_0x6862('0x39')]?_0x46e6e8['attributes']:_0x8aa3b0[_0x6862('0x32')];if(!_0x2dd654[_0x6862('0x35')]['hasOwnProperty'](_0x6862('0x3a'))){_0x46e6e8['limit']=qs[_0x6862('0x22')](_0x2dd654['query'][_0x6862('0x22')]);_0x46e6e8[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x2dd654[_0x6862('0x35')][_0x6862('0x1f')]);}_0x46e6e8[_0x6862('0x3b')]=qs['sort'](_0x2dd654[_0x6862('0x35')]['sort']);_0x46e6e8[_0x6862('0x3f')]=qs['filters'](_[_0x6862('0x3d')](_0x2dd654['query'],_0x8aa3b0['filters']));_0x46e6e8[_0x6862('0x3f')]['ChatWebsiteId']=_0x3bbf40['id'];if(_0x2dd654[_0x6862('0x35')][_0x6862('0x3e')]){_0x46e6e8[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x46e6e8[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x46e6e8[_0x6862('0x37')],function(_0x3fa810){var _0x1852c9={};_0x1852c9[_0x3fa810]={'$like':'%'+_0x2dd654['query'][_0x6862('0x3e')]+'%'};return _0x1852c9;})});}_0x46e6e8=_[_0x6862('0x40')]({},_0x46e6e8,_0x2dd654['options']);return db[_0x6862('0x55')][_0x6862('0x21')]({'where':_0x46e6e8[_0x6862('0x3f')]})['then'](function(_0x3f8c1b){_0x2a7781[_0x6862('0x21')]=_0x3f8c1b;if(_0x2dd654['query'][_0x6862('0x43')]){_0x46e6e8[_0x6862('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x6862('0x57')](_0x46e6e8);})[_0x6862('0x24')](function(_0x48d099){_0x2a7781[_0x6862('0x45')]=_0x48d099;return _0x2a7781;});}})['then'](respondWithFilteredResult(_0x3dd695,_0x46e6e8))[_0x6862('0x1b')](handleError(_0x3dd695,null));};exports[_0x6862('0x58')]=function(_0x2355a9,_0x22502a){return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x2355a9[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x22502a,null))[_0x6862('0x24')](function(_0x3f05c1){if(_0x3f05c1){return _0x3f05c1[_0x6862('0x58')](_0x2355a9[_0x6862('0x35')]['ids']);}})[_0x6862('0x24')](respondWithStatusCode(_0x22502a,null))[_0x6862('0x1b')](handleError(_0x22502a,null));};exports[_0x6862('0x59')]=function(_0x4639ee,_0x5e4d15){if(_0x4639ee[_0x6862('0x4a')]['id']){delete _0x4639ee['body']['id'];}return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4639ee[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x5e4d15,null))[_0x6862('0x24')](function(_0x30961e){if(_0x30961e){_0x4639ee['body'][_0x6862('0x5a')]=_0x30961e['id'];return db['CannedAnswer'][_0x6862('0x49')](_0x4639ee['body']);}})[_0x6862('0x24')](respondWithResult(_0x5e4d15,null))[_0x6862('0x1b')](handleError(_0x5e4d15,null));};exports['getAnswers']=function(_0x3db504,_0x436cf1){var _0x31c401={'raw':![],'where':{}};var _0x24844c={};var _0xfb168={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x3db504[_0x6862('0x52')]['id']}})['then'](handleEntityNotFound(_0x436cf1,null))[_0x6862('0x24')](function(_0x3adab6){if(_0x3adab6){_0x24844c[_0x6862('0x32')]=_[_0x6862('0x47')](db['CannedAnswer'][_0x6862('0x2e')]);_0x24844c[_0x6862('0x35')]=_[_0x6862('0x47')](_0x3db504[_0x6862('0x35')]);_0x24844c['filters']=_[_0x6862('0x36')](_0x24844c[_0x6862('0x32')],_0x24844c[_0x6862('0x35')]);_0x31c401[_0x6862('0x37')]=_[_0x6862('0x36')](_0x24844c['model'],qs['fields'](_0x3db504[_0x6862('0x35')]['fields']));_0x31c401[_0x6862('0x37')]=_0x31c401[_0x6862('0x37')][_0x6862('0x39')]?_0x31c401[_0x6862('0x37')]:_0x24844c['model'];if(!_0x3db504[_0x6862('0x35')][_0x6862('0x5c')](_0x6862('0x3a'))){_0x31c401[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x3db504[_0x6862('0x35')][_0x6862('0x22')]);_0x31c401[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x3db504[_0x6862('0x35')][_0x6862('0x1f')]);}_0x31c401[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x3db504['query'][_0x6862('0x5d')]);_0x31c401[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x3db504[_0x6862('0x35')],_0x24844c[_0x6862('0x3c')]));_0x31c401[_0x6862('0x3f')][_0x6862('0x5a')]=_0x3adab6['id'];if(_0x3db504['query']['filter']){_0x31c401[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x31c401['where'],{'$or':_[_0x6862('0x33')](_0x31c401['attributes'],function(_0x107776){var _0x515af9={};_0x515af9[_0x107776]={'$like':'%'+_0x3db504[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x515af9;})});}_0x31c401=_[_0x6862('0x40')]({},_0x31c401,_0x3db504['options']);return db[_0x6862('0x5e')][_0x6862('0x21')]({'where':_0x31c401[_0x6862('0x3f')]})[_0x6862('0x24')](function(_0x4d846f){_0xfb168[_0x6862('0x21')]=_0x4d846f;if(_0x3db504[_0x6862('0x35')][_0x6862('0x43')]){_0x31c401[_0x6862('0x44')]=[{'all':!![]}];}return db[_0x6862('0x5e')][_0x6862('0x57')](_0x31c401);})[_0x6862('0x24')](function(_0x488904){_0xfb168['rows']=_0x488904;return _0xfb168;});}})[_0x6862('0x24')](respondWithFilteredResult(_0x436cf1,_0x31c401))[_0x6862('0x1b')](handleError(_0x436cf1,null));};exports[_0x6862('0x5f')]=function(_0x48939d,_0x1b47ac){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x48939d['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1b47ac,null))['then'](function(_0x332e14){if(_0x332e14){return _0x332e14[_0x6862('0x5f')](_0x48939d['query'][_0x6862('0x60')]);}})[_0x6862('0x24')](respondWithStatusCode(_0x1b47ac,null))[_0x6862('0x1b')](handleError(_0x1b47ac,null));};exports['addLogo']=function(_0x5b95e4,_0x538036){_0x5b95e4[_0x6862('0x4a')][_0x6862('0x61')]=_0x5b95e4[_0x6862('0x62')]['filename'];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5b95e4[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x538036,null))[_0x6862('0x24')](saveUpdates(_0x5b95e4['body'],null))['then'](respondWithResult(_0x538036,null))[_0x6862('0x1b')](handleError(_0x538036,null));};exports[_0x6862('0x63')]=function(_0x401bb2,_0x152542){_0x401bb2[_0x6862('0x4a')]['agentAvatar']=_0x401bb2[_0x6862('0x62')][_0x6862('0x64')];return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0x401bb2[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x152542,null))[_0x6862('0x24')](saveUpdates(_0x401bb2[_0x6862('0x4a')],null))[_0x6862('0x24')](respondWithResult(_0x152542,null))['catch'](handleError(_0x152542,null));};exports[_0x6862('0x65')]=function(_0xd82c98,_0x1b7038){_0xd82c98[_0x6862('0x4a')][_0x6862('0x66')]=_0xd82c98[_0x6862('0x62')][_0x6862('0x64')];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0xd82c98[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1b7038,null))[_0x6862('0x24')](saveUpdates(_0xd82c98[_0x6862('0x4a')],null))[_0x6862('0x24')](respondWithResult(_0x1b7038,null))[_0x6862('0x1b')](handleError(_0x1b7038,null));};exports[_0x6862('0x67')]=function(_0x43d532,_0x3017ae){_0x43d532['body']['systemAvatar']=_0x43d532[_0x6862('0x62')][_0x6862('0x64')];return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x43d532[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x3017ae,null))[_0x6862('0x24')](saveUpdates(_0x43d532[_0x6862('0x4a')],null))['then'](respondWithResult(_0x3017ae,null))[_0x6862('0x1b')](handleError(_0x3017ae,null));};exports['getLogo']=function(_0x3c5402,_0x3e4826){var _0x41a64d=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x6a'));var _0x49487b={'where':{'id':_0x3c5402[_0x6862('0x52')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0xdaf8b1=![];return require(_0x6862('0x6b'))[_0x6862('0x6c')]()['then'](function(_0x59c3e7){if(_0x59c3e7){_0xdaf8b1=_0x59c3e7[_0x6862('0x6d')];}})[_0x6862('0x24')](function(){return db['ChatWebsite'][_0x6862('0x48')](_0x49487b);})[_0x6862('0x24')](handleEntityNotFound(_0x3e4826,null))[_0x6862('0x24')](function(_0x2308e6){if(_0x2308e6){if(!_[_0x6862('0x6e')](_0x2308e6[_0x6862('0x61')])){if(fs[_0x6862('0x6f')](path['join'](config['root'],_0x6862('0x70'),_0x2308e6[_0x6862('0x61')]))&&_0xdaf8b1){_0x41a64d=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x70'),_0x2308e6[_0x6862('0x61')]);}}return _0x3e4826[_0x6862('0x71')](_0x41a64d);}})[_0x6862('0x1b')](handleError(_0x3e4826,null));};exports[_0x6862('0x72')]=function(_0x4da18f,_0x365a5c){var _0x5d6af2=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x73'));var _0x5c26b8={'where':{'id':_0x4da18f['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x5c26b8)[_0x6862('0x24')](handleEntityNotFound(_0x365a5c,null))[_0x6862('0x24')](function(_0x4d7df7){if(_0x4d7df7){if(!_[_0x6862('0x6e')](_0x4d7df7[_0x6862('0x74')])){if(fs['existsSync'](path['join'](config[_0x6862('0x69')],_0x6862('0x75'),_0x4d7df7[_0x6862('0x74')]))){_0x5d6af2=path[_0x6862('0x68')](config['root'],'server/files/images/avatars/',_0x4d7df7['agentAvatar']);}}return _0x365a5c['download'](_0x5d6af2);}})[_0x6862('0x1b')](handleError(_0x365a5c,null));};exports[_0x6862('0x76')]=function(_0x37647b,_0x591454){var _0x41a5b3=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x77'));var _0x388a76={'where':{'id':_0x37647b[_0x6862('0x52')]['id']},'attributes':['id','customerAvatar',_0x6862('0x78')],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x388a76)['then'](handleEntityNotFound(_0x591454,null))['then'](function(_0x345553){if(_0x345553){if(!_[_0x6862('0x6e')](_0x345553[_0x6862('0x66')])){if(fs[_0x6862('0x6f')](path['join'](config[_0x6862('0x69')],'server/files/images/avatars/',_0x345553[_0x6862('0x66')]))&&_0x345553['showCustomerAvatar']){_0x41a5b3=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x345553[_0x6862('0x66')]);}}return _0x591454[_0x6862('0x71')](_0x41a5b3);}})[_0x6862('0x1b')](handleError(_0x591454,null));};exports[_0x6862('0x79')]=function(_0x55fe84,_0x1b85ea){var _0x3d61f0=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x7a'));var _0x1a1d45={'where':{'id':_0x55fe84[_0x6862('0x52')]['id']},'attributes':['id',_0x6862('0x7b')],'raw':!![]};return db[_0x6862('0x2d')]['find'](_0x1a1d45)[_0x6862('0x24')](handleEntityNotFound(_0x1b85ea,null))[_0x6862('0x24')](function(_0x4ae753){if(_0x4ae753){if(!_[_0x6862('0x6e')](_0x4ae753['systemAvatar'])){if(fs[_0x6862('0x6f')](path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x4ae753[_0x6862('0x7b')]))){_0x3d61f0=path[_0x6862('0x68')](config[_0x6862('0x69')],_0x6862('0x75'),_0x4ae753['systemAvatar']);}}return _0x1b85ea[_0x6862('0x71')](_0x3d61f0);}})[_0x6862('0x1b')](handleError(_0x1b85ea,null));};exports['notify']=function(_0x4eafe5,_0x2bbfda){var _0xaa350e=require('user-agent-parser');var _0x569075=new _0xaa350e();var _0x3c8d6b=_0x569075[_0x6862('0x7c')](_0x4eafe5[_0x6862('0x7d')][_0x6862('0x7e')])[_0x6862('0x7f')]();var _0x320a74={'body':_0x4eafe5['body'],'channel':'chat'};var _0x51886c=[];var _0x34541a=[];var _0x49dd59={};var _0x2b27e7=![];return db[_0x6862('0x80')][_0x6862('0x53')]()[_0x6862('0x24')](function(_0x5e697d){if(!_0x5e697d){throw new db['Sequelize'][(_0x6862('0x81'))]('no\x20available\x20attributes');}_0x51886c=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x5e697d),['createdAt',_0x6862('0x83')]);_0x34541a=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x5e697d),[_0x6862('0x84'),_0x6862('0x83'),_0x6862('0x85'),_0x6862('0x86')]);if(_0x4eafe5[_0x6862('0x4a')]['id']){delete _0x4eafe5[_0x6862('0x4a')]['id'];}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')][_0x6862('0x87')])){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))]('from\x20is\x20mandatory');}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')]['body'])||_0x4eafe5['body']['body']===''){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x6862('0x6e')](_0x4eafe5[_0x6862('0x4a')]['mapKey'])){throw new db['Sequelize'][(_0x6862('0x81'))](_0x6862('0x89')+_0x34541a);}if(!_[_0x6862('0x8a')](_0x34541a,_0x4eafe5[_0x6862('0x4a')][_0x6862('0x8b')])){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0x8c')+_0x34541a);}_0x49dd59[_0x4eafe5['body'][_0x6862('0x8b')]]=_0x4eafe5[_0x6862('0x4a')][_0x6862('0x87')];})[_0x6862('0x24')](function(){return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4eafe5[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0x8d')],'as':_0x6862('0x8e'),'include':[{'model':db[_0x6862('0x80')],'as':_0x6862('0x8f'),'where':_0x49dd59,'limit':0x1,'order':[[_0x6862('0x83'),_0x6862('0x90')]]}]},{'model':db[_0x6862('0x91')],'as':_0x6862('0x92')}]});})[_0x6862('0x24')](handleEntityNotFound(_0x2bbfda,null))[_0x6862('0x24')](function(_0xc1d1ac){if(_0xc1d1ac&&_0xc1d1ac[_0x6862('0x8e')]){_0x320a74[_0x6862('0x93')]=_0xc1d1ac;_0x320a74[_0x6862('0x94')]=_0xc1d1ac[_0x6862('0x92')];_0x320a74['list']=_0xc1d1ac[_0x6862('0x8e')];_0x320a74[_0x6862('0x94')]=_[_0x6862('0x95')](_0x320a74[_0x6862('0x94')],['priority'],[_0x6862('0x96')]);if(_0x320a74[_0x6862('0x93')]['Applications']){delete _0x320a74['account']['Applications'];}if(_0x320a74[_0x6862('0x93')]['List']&&_0x320a74[_0x6862('0x93')][_0x6862('0x8e')][_0x6862('0x8f')]['length']){return _0x320a74['account'][_0x6862('0x8e')][_0x6862('0x8f')][0x0];}var _0x25f4f=_[_0x6862('0xb')](_0x4eafe5[_0x6862('0x4a')],{'firstName':_0x4eafe5[_0x6862('0x4a')]['from'],'ListId':_0xc1d1ac[_0x6862('0x86')]});_0x25f4f[_0x4eafe5[_0x6862('0x4a')][_0x6862('0x8b')]]=_0x4eafe5['body']['from'];return db[_0x6862('0x80')]['create'](_0x25f4f,{'fields':_0x51886c,'raw':!![]});}})[_0x6862('0x24')](handleEntityNotFound(_0x2bbfda,null))[_0x6862('0x24')](function(_0x2ec914){_0x320a74[_0x6862('0x97')]=_0x2ec914;var _0x44ab10=_0x4eafe5[_0x6862('0x4a')][_0x6862('0x98')];if(_0x4eafe5[_0x6862('0x7d')][_0x6862('0x99')]){_0x44ab10=_0x4eafe5['headers'][_0x6862('0x99')];}else if(_0x4eafe5[_0x6862('0x7d')][_0x6862('0x9a')]){_0x44ab10=_['first'](_0x4eafe5['headers'][_0x6862('0x9a')][_0x6862('0x9b')](','));}if(_0x2ec914){var _0x245d4f={'ContactId':_0x2ec914['id'],'ChatWebsiteId':_0x4eafe5[_0x6862('0x52')]['id'],'from':(_0x2ec914[_0x6862('0x9c')]||'')+'\x20'+(_0x2ec914[_0x6862('0x9d')]||''),'customerIp':_0x44ab10,'customerPort':_0x4eafe5['headers'][_0x6862('0x9e')]?_0x4eafe5['headers'][_0x6862('0x9e')]:null,'referer':_0x4eafe5['body'][_0x6862('0x9f')],'browserName':_0x3c8d6b[_0x6862('0xa0')][_0x6862('0x34')]&&_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]?util[_0x6862('0xa2')]('%s\x20%s',_0x3c8d6b[_0x6862('0xa0')][_0x6862('0x34')],_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]):_0x6862('0xa3'),'browserVersion':_0x3c8d6b[_0x6862('0xa0')][_0x6862('0xa1')]||_0x6862('0xa3'),'osName':util[_0x6862('0xa2')](_0x6862('0xa4'),_0x3c8d6b['os'][_0x6862('0x34')],_0x3c8d6b['os'][_0x6862('0xa1')]),'osVersion':_0x3c8d6b['os'][_0x6862('0xa1')],'deviceModel':_0x3c8d6b[_0x6862('0xa5')]['model']&&_0x3c8d6b[_0x6862('0xa5')][_0x6862('0xa6')]?util[_0x6862('0xa2')](_0x6862('0xa7'),_0x3c8d6b['device'][_0x6862('0x32')],_0x3c8d6b['device'][_0x6862('0xa6')],_0x3c8d6b['device'][_0x6862('0x30')]):null,'deviceVendor':_0x3c8d6b[_0x6862('0xa5')][_0x6862('0xa6')],'deviceType':_0x3c8d6b[_0x6862('0xa5')]['type'],'formData':JSON[_0x6862('0x16')](_0x4eafe5[_0x6862('0x4a')])};var _0x561f9c={'ChatWebsiteId':_0x4eafe5['params']['id'],'closed':![]};if(_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]){_0x561f9c[_0x6862('0xa8')]=_0x4eafe5['body']['threadId'];return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':_0x561f9c})[_0x6862('0x24')](function(_0x4dcf6e){if(_0x4dcf6e){return[_0x4dcf6e,![]];}_0x245d4f['threadId']=_0x4eafe5['body']['threadId'];_0x245d4f[_0x6862('0xaa')]=_0x4eafe5[_0x6862('0x4a')]['externalUrl'];return db['ChatInteraction']['create'](_0x245d4f)[_0x6862('0x24')](function(_0x3cc4d5){return[_0x3cc4d5,!![]];});});}_0x561f9c['ContactId']=_0x2ec914['id'];if(_0x4eafe5[_0x6862('0x4a')]['interaction']&&_0x4eafe5['body'][_0x6862('0xab')]['id']){_0x561f9c['id']=_0x4eafe5[_0x6862('0x4a')][_0x6862('0xab')]['id'];return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':_0x561f9c})[_0x6862('0x24')](function(_0x414bc2){if(_0x414bc2){return[_0x414bc2,![]];}return db[_0x6862('0xa9')][_0x6862('0x49')](_0x245d4f)[_0x6862('0x24')](function(_0x354671){return[_0x354671,!![]];});});}return db['ChatInteraction'][_0x6862('0x49')](_0x245d4f)[_0x6862('0x24')](function(_0x5f1a93){return[_0x5f1a93,!![]];});}})[_0x6862('0xac')](function(_0x2b9d44,_0x499f95){if(_0x2b9d44){_0x2b27e7=_0x499f95;if(!_0x499f95){var _0x406bfe={'from':(_0x320a74[_0x6862('0x97')]['firstName']||'')+'\x20'+(_0x320a74['contact'][_0x6862('0x9d')]||'')};if(_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]&&_0x4eafe5['body'][_0x6862('0xad')]&&_0x4eafe5[_0x6862('0x4a')][_0x6862('0xa8')]!=_0x4eafe5['body'][_0x6862('0xad')]){_0x406bfe['threadId']=_0x4eafe5[_0x6862('0x4a')][_0x6862('0xad')];}return _0x2b9d44['update'](_0x406bfe);}else{return _0x2b9d44;}}})[_0x6862('0x24')](function(_0x4af3cb){_0x320a74[_0x6862('0xab')]=_0x4af3cb[_0x6862('0x26')]({'plain':!![]});_0x320a74[_0x6862('0xab')]['created']=_0x2b27e7;if(_0x320a74[_0x6862('0xab')][_0x6862('0xae')]){if(_0x320a74['account'][_0x6862('0xaf')]){_0x320a74['applications'][_0x6862('0xb0')]({'id':0x0,'priority':_0x320a74[_0x6862('0x94')][_0x6862('0x39')]+0x1,'app':_0x6862('0xb1'),'appdata':_0x6862('0xb2'),'interval':_0x6862('0xb3')});}}return db[_0x6862('0xb4')][_0x6862('0x49')]({'body':_0x4eafe5['body'][_0x6862('0x4a')],'ChatWebsiteId':_0x4eafe5[_0x6862('0x52')]['id'],'ChatInteractionId':_0x4af3cb['id'],'direction':'in','ContactId':_0x320a74[_0x6862('0x97')]['id'],'AttachmentId':_0x4eafe5[_0x6862('0x4a')][_0x6862('0xb5')]});})[_0x6862('0x24')](function(_0xf2bc45){_0x320a74[_0x6862('0x19')]=_0xf2bc45;if(_0x320a74[_0x6862('0xab')][_0x6862('0xb6')]){return db[_0x6862('0xb7')][_0x6862('0x48')]({'attributes':['id',_0x6862('0x34')],'where':{'id':_0x320a74['interaction']['UserId']}})[_0x6862('0x24')](function(_0x1521f7){if(_0x1521f7){_0x320a74['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x6862('0xb8'),'appdata':_0x1521f7[_0x6862('0x34')]+','+(_0x320a74[_0x6862('0x93')][_0x6862('0xb9')]||0xa),'interval':'*,*,*,*'});_0x320a74['forcedOwnership']=!![];}return respondWithRpcPromise(_0x6862('0xba'),_0x6862('0xbb'),_0x320a74);});}return respondWithRpcPromise(_0x6862('0xba'),_0x6862('0xbb'),_0x320a74);})[_0x6862('0x24')](function(_0x3dd868){respondWithRpcPromise(_0x6862('0xbc'),_0x6862('0xbc'),{'event':_0x6862('0xbd'),'message':_0x3dd868},client9002);return _0x3dd868;})[_0x6862('0x24')](respondWithResult(_0x2bbfda,null))[_0x6862('0x1b')](handleError(_0x2bbfda,null));};exports[_0x6862('0xbe')]=function(_0xa0a51a,_0x2e82fb){var _0x19b0d9,_0x1f6ff5,_0x584640;var _0x270e7c=[];var _0x4006c0={};var _0x3b2c36=_0xa0a51a[_0x6862('0xbf')]||[];var _0x87c3df=[];var _0x69b941;return db[_0x6862('0x80')][_0x6862('0x53')]()['then'](function(_0x3c34cc){if(!_0x3c34cc){throw new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc0'));}_0x270e7c=_[_0x6862('0x82')](_[_0x6862('0x47')](_0x3c34cc),[_0x6862('0x84'),_0x6862('0x83'),_0x6862('0x85'),'ListId']);if(_0xa0a51a[_0x6862('0x4a')]['id']){delete _0xa0a51a[_0x6862('0x4a')]['id'];}if(_[_0x6862('0x6e')](_0xa0a51a['body']['from'])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc1')));}if(_[_0x6862('0x6e')](_0xa0a51a['body'][_0x6862('0x4a')])||_0xa0a51a[_0x6862('0x4a')]['body']===''){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc2')));}if(_['isNil'](_0xa0a51a['body'][_0x6862('0xc3')])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db[(_0x6862('0x88'))][(_0x6862('0x81'))](_0x6862('0xc4')+_0x270e7c));}if(!_['includes'](_0x270e7c,_0xa0a51a[_0x6862('0x4a')][_0x6862('0xc3')])){throw _0x2e82fb[_0x6862('0x1c')](0x1f4)[_0x6862('0x2a')](new db['Sequelize'][(_0x6862('0x81'))](_0x6862('0xc5')+_0x270e7c));}_0x4006c0[_0xa0a51a['body'][_0x6862('0xc3')]]=_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')];})[_0x6862('0x24')](function(){return db['ChatWebsite'][_0x6862('0x48')]({'where':{'id':_0xa0a51a[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0x8d')],'as':'List'},{'model':db[_0x6862('0xc6')],'as':_0x6862('0xc6')}]});})[_0x6862('0x24')](handleEntityNotFound(_0x2e82fb,null))[_0x6862('0x24')](function(_0x36633d){if(_0x36633d&&_0x36633d['List']){_0x1f6ff5=_0x36633d;var _0x105b93=_[_0x6862('0xb')](_0xa0a51a[_0x6862('0x4a')],{'firstName':_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')],'phone':_0xa0a51a[_0x6862('0x4a')][_0x6862('0x87')],'ListId':_0x36633d[_0x6862('0x86')]});_0x105b93[_0xa0a51a[_0x6862('0x4a')][_0x6862('0xc3')]]=_0xa0a51a['body']['from'];return db['CmContact'][_0x6862('0xc7')]({'where':_0x4006c0,'defaults':_0x105b93});}})[_0x6862('0xac')](function(_0x168dd1){if(_0x168dd1){_0x584640=_0x168dd1;var _0x24c10a=fs[_0x6862('0xc8')](path[_0x6862('0x68')](config['root'],_0x6862('0xc9')),'utf8');var _0x101ded=ejs['render'](_0x24c10a,{'body':_[_0x6862('0xca')](_0xa0a51a[_0x6862('0x4a')]['body']),'bodyTitle':_0x1f6ff5[_0x6862('0xcb')]});return db['ChatOfflineMessage']['create']({'body':_0x101ded,'ContactId':_0x168dd1['id'],'ChatWebsiteId':_0x1f6ff5['id']});}})['then'](function(_0x546ed4){_0x69b941=_0x546ed4;if(_0x3b2c36[_0x6862('0x39')]){var _0x453b6d=_0x3b2c36[_0x6862('0x33')](function(_0x5b6431){return{'name':_0x5b6431[_0x6862('0xcc')],'basename':_0x5b6431[_0x6862('0x64')],'type':_0x5b6431['mimetype'],'ChatOfflineMessageId':_0x546ed4['id']};});_0x87c3df=_0x453b6d['map'](_0x91e8ee=>{var _0x439044={'filename':_0x91e8ee[_0x6862('0x34')],'path':path[_0x6862('0x68')](config['root'],_0x6862('0xcd'),_0x6862('0xbf'),_0x6862('0xce'),_0x6862('0xcf'),_0x91e8ee['basename'])};return _0x439044;});if(!_0x1f6ff5[_0x6862('0xd0')]){return db['sequelize'][_0x6862('0xd1')](function(_0x7b2c19){return db[_0x6862('0xd2')][_0x6862('0xd3')](_0x453b6d,{'transaction':_0x7b2c19});});}}})[_0x6862('0x24')](function(){if(_0x69b941){_0x19b0d9=_0x69b941;return db[_0x6862('0xc6')][_0x6862('0x5b')]({'where':{'active':!![]},'include':[{'model':db[_0x6862('0xd4')],'as':_0x6862('0xd5'),'raw':!![]}]});}})[_0x6862('0x24')](function(_0x5a224b){if(_0x5a224b&&_0x5a224b[_0x6862('0xd5')]&&_0x1f6ff5['forwardOffline']&&_0x1f6ff5[_0x6862('0xd6')]){var _0x3234ab={'tls':{'rejectUnauthorized':![]}};if(_0x5a224b['Smtp'][_0x6862('0xd7')]){_0x3234ab['service']=_0x5a224b[_0x6862('0xd5')][_0x6862('0xd7')];}else{_0x3234ab['host']=_0x5a224b[_0x6862('0xd5')][_0x6862('0xd8')];_0x3234ab['port']=_0x5a224b['Smtp'][_0x6862('0xd9')];_0x3234ab[_0x6862('0xda')]=_0x5a224b[_0x6862('0xd5')][_0x6862('0xda')];}if(_0x5a224b[_0x6862('0xd5')][_0x6862('0xdb')]){_0x3234ab[_0x6862('0xdc')]={'user':_0x5a224b[_0x6862('0xd5')][_0x6862('0x4b')],'pass':_0x5a224b['Smtp'][_0x6862('0xdd')]};}return respondWithRpcPromise(_0x6862('0xde'),_0x6862('0xdf'),{'account':_0x3234ab,'message':{'from':util[_0x6862('0xa2')](_0x6862('0xe0'),_0x5a224b['name'],_0x5a224b[_0x6862('0xe1')]||_0x5a224b[_0x6862('0xd5')]['user']),'to':_0x1f6ff5[_0x6862('0xd6')],'subject':_0x1f6ff5[_0x6862('0xe2')],'html':_0x19b0d9[_0x6862('0x4a')],'attachments':_0x87c3df}},client9003)[_0x6862('0x24')](function(){return _0x19b0d9;})[_0x6862('0x1b')](function(_0x1be051){console[_0x6862('0x17')](_0x1be051);});}})[_0x6862('0x24')](function(){if(_0x1f6ff5&&_0x1f6ff5['openNewInteraction']&&_0x1f6ff5[_0x6862('0xe3')]){var _0x5d5690=[];if(_0x3b2c36[_0x6862('0x39')]){_0x5d5690=_0x3b2c36[_0x6862('0x33')](function(_0x3eb71c){return{'name':_0x3eb71c['originalname'],'basename':_0x3eb71c[_0x6862('0x64')],'type':_0x3eb71c['mimetype'],'ChatOfflineMessageId':_0x69b941['id']};});}var _0x42d5d4;if(!_['isNil'](_0x1f6ff5['subjectOffline'])){var _0x43d72e=_['map'](_0xa0a51a[_0x6862('0x4a')],function(_0x431f0b){return _0x431f0b;});var _0x808565=_[_0x6862('0xe4')](_0x43d72e)[0x0];var _0x1e6abb=_['mapValues'](_0x808565,function(_0x1845e8){return _0x1845e8;});_0x42d5d4=_0x1e6abb[0x1][_0x1f6ff5[_0x6862('0xe5')]];}var _0x4c91d4={'from':_0x584640[_0x6862('0xe1')],'firstName':_0x584640[_0x6862('0x9c')],'lastName':_0x584640[_0x6862('0x9d')],'mapKey':_0x6862('0xe1'),'message':{'from':_0x584640[_0x6862('0xe1')],'to':_0x1f6ff5[_0x6862('0xc6')][_0x6862('0xe1')],'cc':'','subject':_[_0x6862('0x6e')](_0x42d5d4)?_0x1f6ff5[_0x6862('0xe2')]:_0x42d5d4,'messageId':'','sentAt':new Date(),'attach':_0x5d5690[_0x6862('0x39')],'attachments':_0x5d5690,'originChannel':_0x6862('0xe6'),'ChatWebsiteId':_0x1f6ff5['id'],'ChatOfflineMessageId':_0x19b0d9['id'],'originTo':_0x1f6ff5[_0x6862('0xc6')][_0x6862('0xe1')]},'body':_0x19b0d9[_0x6862('0x4a')]};var _0x5ea2b9={'account':{'id':_0x1f6ff5['MailAccountId']},'body':_0x4c91d4,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6862('0xe7'),_0x6862('0xe8'),_0x5ea2b9,client9001)[_0x6862('0x24')](function(){return _0x19b0d9;})['catch'](function(_0x4c307b){console[_0x6862('0x17')](_0x4c307b);});}return;})['then'](function(){if(_0x19b0d9){return _0x19b0d9;}})[_0x6862('0x24')](respondWithResult(_0x2e82fb,null))[_0x6862('0x1b')](function(_0x50c96a){console[_0x6862('0x17')]('catch',_0x50c96a);for(var _0x5c661a of _0x3b2c36){var _0x1ad3b1=path['join'](config[_0x6862('0x69')],_0x6862('0xcd'),_0x6862('0xbf'),_0x6862('0xce'),_0x6862('0xcf'),_0x5c661a[_0x6862('0x64')]);fs_extra[_0x6862('0xe9')](_0x1ad3b1)['catch'](function(_0x1d7da3){console[_0x6862('0x17')](_0x6862('0xea'),_0x1ad3b1,_0x1d7da3);});}});};exports[_0x6862('0xeb')]=function(_0x155c29,_0x202fec){return db[_0x6862('0xa9')][_0x6862('0x48')]({'where':{'id':_0x155c29[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x202fec,null))['then'](function(_0xcd98e7){if(_0xcd98e7){return _0xcd98e7['addInteraction'](_0x155c29['body'][_0x6862('0x60')],_['omit'](_0x155c29[_0x6862('0x4a')],[_0x6862('0x60'),'id'])||{});}})[_0x6862('0x24')](respondWithResult(_0x202fec,null))['catch'](handleError(_0x202fec,null));};exports[_0x6862('0xec')]=function(_0x548036,_0x2732ea){var _0x2a3d9e={'raw':![],'where':{}};var _0x593265={};var _0x555294={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x548036[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x2732ea,null))[_0x6862('0x24')](function(_0x46879f){if(_0x46879f){_0x593265[_0x6862('0x32')]=_[_0x6862('0x47')](db['ChatInteraction'][_0x6862('0x2e')]);_0x593265[_0x6862('0x35')]=_[_0x6862('0x47')](_0x548036[_0x6862('0x35')]);_0x593265[_0x6862('0x3c')]=_['intersection'](_0x593265[_0x6862('0x32')],_0x593265['query']);_0x2a3d9e[_0x6862('0x37')]=_['intersection'](_0x593265['model'],qs[_0x6862('0x38')](_0x548036[_0x6862('0x35')][_0x6862('0x38')]));_0x2a3d9e['attributes']=_0x2a3d9e['attributes'][_0x6862('0x39')]?_0x2a3d9e[_0x6862('0x37')]:_0x593265[_0x6862('0x32')];if(!_0x548036[_0x6862('0x35')][_0x6862('0x5c')](_0x6862('0x3a'))){_0x2a3d9e[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x548036[_0x6862('0x35')][_0x6862('0x22')]);_0x2a3d9e[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x548036[_0x6862('0x35')][_0x6862('0x1f')]);}_0x2a3d9e['order']=qs['sort'](_0x548036[_0x6862('0x35')][_0x6862('0x5d')]);_0x2a3d9e[_0x6862('0x3f')]=qs['filters'](_[_0x6862('0x3d')](_0x548036[_0x6862('0x35')],_0x593265[_0x6862('0x3c')]));_0x2a3d9e[_0x6862('0x3f')][_0x6862('0x5a')]=_0x46879f['id'];if(_0x548036[_0x6862('0x35')][_0x6862('0x3e')]){_0x2a3d9e[_0x6862('0x3f')]=_['merge'](_0x2a3d9e[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x2a3d9e['attributes'],function(_0x4d0f8a){var _0x3682fd={};_0x3682fd[_0x4d0f8a]={'$like':'%'+_0x548036[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x3682fd;})});}_0x2a3d9e=_[_0x6862('0x40')]({},_0x2a3d9e,_0x548036['options']);return db[_0x6862('0xa9')][_0x6862('0x21')]({'where':_0x2a3d9e[_0x6862('0x3f')]})['then'](function(_0x3f1656){_0x555294['count']=_0x3f1656;if(_0x548036[_0x6862('0x35')][_0x6862('0x43')]){_0x2a3d9e['include']=[{'model':db[_0x6862('0x80')],'as':_0x6862('0xed'),'required':![]},{'model':db['User'],'as':_0x6862('0xee'),'attributes':[_0x6862('0x34'),_0x6862('0xef'),_0x6862('0xf0')],'required':![]},{'model':db['Tag'],'as':_0x6862('0xf1'),'attributes':['id',_0x6862('0x34'),_0x6862('0xf2')],'where':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]?{'id':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]}:undefined,'required':_0x548036[_0x6862('0x35')][_0x6862('0xf3')]?!![]:![]}];}return db[_0x6862('0xa9')]['findAll'](_0x2a3d9e);})[_0x6862('0x24')](function(_0x5bef90){_0x555294['rows']=_0x5bef90;return _0x555294;});}})['then'](respondWithFilteredResult(_0x2732ea,_0x2a3d9e))[_0x6862('0x1b')](handleError(_0x2732ea,null));};function iftimePromise(_0x3c2ea8,_0x35a440){return respondWithRpcPromise(_0x6862('0xf4'),'getSnippet',{'command':_0x35a440[_0x6862('0xf5')]?util[_0x6862('0xa2')](_0x6862('0xf6'),_0x3c2ea8['interval'],_0x35a440['timezone']):util[_0x6862('0xa2')](_0x6862('0xf7'),_0x3c2ea8[_0x6862('0xf8')])},client9002)[_0x6862('0x24')](function(_0x5641de){var _0x5393f2=_0x5641de&&_0x5641de['indexOf'](_0x6862('0xf9'))>=0x0?!![]:![];logger[_0x6862('0x13')](_0x6862('0xfa'),_0x35a440['id'],_0x3c2ea8['id'],_0x3c2ea8[_0x6862('0xf8')],_0x5393f2?'ONLINE':'OFFLINE',_0x35a440[_0x6862('0xf5')]?_0x35a440[_0x6862('0xf5')]:_0x6862('0xfb'));return _0x5393f2;})[_0x6862('0x1b')](function(_0x5a8b3a){logger[_0x6862('0x17')](_0x6862('0xfa'),_0x35a440['id'],_0x3c2ea8['id'],_0x3c2ea8[_0x6862('0xf8')],util['inspect'](_0x5a8b3a,{'showHidden':![],'depth':null}),_0x35a440[_0x6862('0xf5')]?_0x35a440[_0x6862('0xf5')]:_0x6862('0xfb'));return![];});}exports['getSnippet']=function(_0x1706a1,_0x175354){var _0x25aa2b=0x0;var _0x935373=0x0;var _0x3e3783=![];var _0xa6bb22;var _0x2155ea;return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x1706a1[_0x6862('0x52')]['id']},'include':[{'model':db[_0x6862('0xfc')],'as':'Interval','include':[{'model':db[_0x6862('0xfc')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x6862('0x24')](handleEntityNotFound(_0x175354,null))['then'](function(_0x268830){if(_0x268830){_0xa6bb22=_0x268830;return _0x268830[_0x6862('0xfd')]({'raw':!![]});}})[_0x6862('0x24')](function(_0x432955){if(_0xa6bb22){if(_0x432955){_0x2155ea=_0x432955;}}return require(_0x6862('0x6b'))[_0x6862('0x6c')]();})[_0x6862('0x24')](function(_0x4d222b){if(_0x4d222b){_0x935373=_0x4d222b[_0x6862('0xfe')];_0x3e3783=_0x4d222b[_0x6862('0x6d')];}})[_0x6862('0x24')](function(){return db['ChatInteraction'][_0x6862('0x21')]({'where':{'closed':![]}});})[_0x6862('0x24')](function(_0x424308){_0x25aa2b=_0x424308;if(_0x935373&&_0x424308>_0x935373){return db[_0x6862('0xff')][_0x6862('0x5b')]({'where':{'id':0x1}})[_0x6862('0x24')](function(_0x30d756){if(_0x30d756){_0x30d756[_0x6862('0x100')](_0x6862('0x101'));}});}})['then'](function(){if(_0xa6bb22[_0x6862('0xfc')]&&_0xa6bb22[_0x6862('0xfc')][_0x6862('0x102')]){var _0x478031=[];for(var _0x4c980a=0x0;_0x4c980a<_0xa6bb22[_0x6862('0xfc')]['Intervals'][_0x6862('0x39')];_0x4c980a++){var _0x37ca82=_0xa6bb22[_0x6862('0xfc')][_0x6862('0x102')][_0x4c980a][_0x6862('0x26')]({'plain':!![]});_0x478031[_0x6862('0xb0')](iftimePromise(_0x37ca82,_0xa6bb22));}return BPromise[_0x6862('0x103')](_0x478031)[_0x6862('0x24')](function(_0x588648){return _[_0x6862('0x104')](_0x588648);});}else{return!![];}})[_0x6862('0x24')](function(_0x2c76cf){var _0x2fbc42=fs[_0x6862('0xc8')](path['join'](config[_0x6862('0x69')],_0x6862('0x105')),_0x6862('0x106'));var _0x3c07de={'remote':_0xa6bb22['remote'],'query':querystring['stringify'](_[_0x6862('0x40')](_0xa6bb22[_0x6862('0x26')]({'plain':!![]}),{'customerIp':_0x1706a1[_0x6862('0x7d')]['x-forwarded-for']||_0x1706a1['headers'][_0x6862('0x107')]||_0x1706a1[_0x6862('0x108')]['remoteAddress']||_0x1706a1['ip'],'referer':_0x1706a1[_0x6862('0x7d')][_0x6862('0x9f')],'openedInteractions':_0x25aa2b,'maxInteractions':_0x935373,'virtual':_0x3e3783[_0x6862('0xfe')],'online':_0x2c76cf,'custom':_0x3e3783}))[_0x6862('0x109')](/'/g,'\x5c\x27')};_0x175354['send'](ejs[_0x6862('0x10a')](Mustache[_0x6862('0x10a')](_0x2fbc42,_0x3c07de),{'proactiveActions':_0x2155ea,'alignment':_0xa6bb22[_0x6862('0x10b')],'verticalAlignment':_0xa6bb22[_0x6862('0x10c')],'div_color':_0xa6bb22[_0x6862('0xf2')],'labelText':_0xa6bb22['labelText'],'text_color':_0xa6bb22[_0x6862('0x10d')],'button_color':_0xa6bb22[_0x6862('0x10e')],'background_color':_0xa6bb22[_0x6862('0x10f')]}));})['catch'](handleError(_0x175354,null));};exports[_0x6862('0x110')]=function(_0x4d01de,_0x34e72e){var _0x448fe0=_0x4d01de[_0x6862('0x52')]['id'];var _0x20c696=_0x4d01de[_0x6862('0x4a')];var _0x2cc5f4=0xc8;var _0x56ad86=null;return db[_0x6862('0x111')][_0x6862('0xd1')]({'isolationLevel':db[_0x6862('0x111')][_0x6862('0x112')][_0x6862('0x113')]['READ_COMMITTED']},function(_0x4a2b9e){return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x448fe0},'transaction':_0x4a2b9e})[_0x6862('0x24')](function(_0x2500b2){if(_0x2500b2){return db[_0x6862('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x448fe0},'transaction':_0x4a2b9e})['then'](function(){var _0x110892=_[_0x6862('0x33')](_0x20c696,function(_0x30cea9){_0x30cea9[_0x6862('0x5a')]=_0x448fe0;return _0x30cea9;});return db['ChatApplication'][_0x6862('0xd3')](_0x110892,{'transaction':_0x4a2b9e});});}else{_0x2cc5f4=0x194;_0x56ad86=[];}});})[_0x6862('0x24')](function(){if(_0x2cc5f4!==0x194){return db[_0x6862('0x91')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x448fe0},'order':_0x6862('0x114')})['then'](function(_0x4dc624){_0x56ad86=_0x4dc624;});}})[_0x6862('0x1b')](function(_0x3b261b){_0x2cc5f4=0x1f4;logger[_0x6862('0x17')](_0x3b261b[_0x6862('0x29')]);if(_0x3b261b[_0x6862('0x34')]){delete _0x3b261b[_0x6862('0x34')];}_0x56ad86=_0x3b261b;})[_0x6862('0x115')](function(){if(_0x56ad86===null){_0x34e72e[_0x6862('0x28')](_0x2cc5f4);}else{if(_0x2cc5f4===0x1f4){_0x34e72e['status'](_0x2cc5f4)['send'](_0x56ad86);}else{_0x34e72e['status'](_0x2cc5f4)['json'](_0x56ad86);}}});};exports[_0x6862('0x116')]=function(_0x313c15,_0x408442){var _0xffe37f={};var _0x42b194={};var _0x4e76da;var _0x25645b;return db['ChatWebsite'][_0x6862('0x5b')]({'where':{'id':_0x313c15[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x408442,null))[_0x6862('0x24')](function(_0x1c8885){if(_0x1c8885){_0x4e76da=_0x1c8885;_0x42b194[_0x6862('0x32')]=_['keys'](db[_0x6862('0x91')][_0x6862('0x2e')]);_0x42b194[_0x6862('0x35')]=_['keys'](_0x313c15[_0x6862('0x35')]);_0x42b194[_0x6862('0x3c')]=_['intersection'](_0x42b194[_0x6862('0x32')],_0x42b194['query']);_0xffe37f[_0x6862('0x37')]=_[_0x6862('0x36')](_0x42b194[_0x6862('0x32')],qs[_0x6862('0x38')](_0x313c15[_0x6862('0x35')][_0x6862('0x38')]));_0xffe37f['attributes']=_0xffe37f['attributes']['length']?_0xffe37f[_0x6862('0x37')]:_0x42b194[_0x6862('0x32')];_0xffe37f[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x313c15[_0x6862('0x35')][_0x6862('0x5d')]);_0xffe37f[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x313c15[_0x6862('0x35')],_0x42b194[_0x6862('0x3c')]));if(_0x313c15['query']['filter']){_0xffe37f[_0x6862('0x3f')]=_[_0x6862('0x40')](_0xffe37f[_0x6862('0x3f')],{'$or':_['map'](_0xffe37f['attributes'],function(_0x56ac3a){var _0x37ec2b={};_0x37ec2b[_0x56ac3a]={'$like':'%'+_0x313c15[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x37ec2b;})});}_0xffe37f=_[_0x6862('0x40')]({},_0xffe37f,_0x313c15[_0x6862('0x42')]);return _0x4e76da[_0x6862('0x116')](_0xffe37f);}})[_0x6862('0x24')](function(_0x3473c4){if(_0x3473c4){_0x25645b=_0x3473c4['length'];if(!_0x313c15['query']['hasOwnProperty'](_0x6862('0x3a'))){_0xffe37f[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x313c15[_0x6862('0x35')][_0x6862('0x22')]);_0xffe37f[_0x6862('0x1f')]=qs['offset'](_0x313c15[_0x6862('0x35')][_0x6862('0x1f')]);}return _0x4e76da['getApplications'](_0xffe37f);}})[_0x6862('0x24')](function(_0x253011){if(_0x253011){return _0x253011?{'count':_0x25645b,'rows':_0x253011}:null;}})[_0x6862('0x24')](respondWithResult(_0x408442,null))[_0x6862('0x1b')](handleError(_0x408442,null));};exports[_0x6862('0x117')]=function(_0x21ce05,_0x111d3a){return db['chatProactiveAction'][_0x6862('0x48')]({'where':{'id':_0x21ce05['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x111d3a,null))[_0x6862('0x24')](function(_0x393d33){if(_0x393d33){return _0x393d33[_0x6862('0x117')](_0x21ce05[_0x6862('0x4a')][_0x6862('0x60')],_[_0x6862('0x118')](_0x21ce05[_0x6862('0x4a')],['ids','id'])||{});}})['then'](respondWithResult(_0x111d3a,null))[_0x6862('0x1b')](handleError(_0x111d3a,null));};exports['getProactiveActions']=function(_0x6bf7b3,_0x1fc6e0){var _0x42e5ff={};var _0x3c35ee={};var _0x5ca5d5;var _0x3760f0;return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x6bf7b3[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x1fc6e0,null))[_0x6862('0x24')](function(_0x4c440b){if(_0x4c440b){_0x5ca5d5=_0x4c440b;_0x3c35ee['model']=_[_0x6862('0x47')](db['ChatProactiveAction']['rawAttributes']);_0x3c35ee[_0x6862('0x35')]=_[_0x6862('0x47')](_0x6bf7b3['query']);_0x3c35ee[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x3c35ee[_0x6862('0x32')],_0x3c35ee[_0x6862('0x35')]);_0x42e5ff[_0x6862('0x37')]=_['intersection'](_0x3c35ee[_0x6862('0x32')],qs['fields'](_0x6bf7b3[_0x6862('0x35')][_0x6862('0x38')]));_0x42e5ff['attributes']=_0x42e5ff[_0x6862('0x37')][_0x6862('0x39')]?_0x42e5ff['attributes']:_0x3c35ee['model'];_0x42e5ff[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x6bf7b3['query']['sort']);_0x42e5ff['where']=qs['filters'](_[_0x6862('0x3d')](_0x6bf7b3['query'],_0x3c35ee[_0x6862('0x3c')]));if(_0x6bf7b3['query'][_0x6862('0x3e')]){_0x42e5ff[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x42e5ff[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x42e5ff[_0x6862('0x37')],function(_0x547398){var _0x39236f={};_0x39236f[_0x547398]={'$like':'%'+_0x6bf7b3[_0x6862('0x35')]['filter']+'%'};return _0x39236f;})});}_0x42e5ff=_['merge']({},_0x42e5ff,_0x6bf7b3['options']);return _0x5ca5d5[_0x6862('0xfd')](_0x42e5ff);}})['then'](function(_0x44d32a){if(_0x44d32a){_0x3760f0=_0x44d32a[_0x6862('0x39')];if(!_0x6bf7b3[_0x6862('0x35')][_0x6862('0x5c')]('nolimit')){_0x42e5ff['limit']=qs[_0x6862('0x22')](_0x6bf7b3[_0x6862('0x35')][_0x6862('0x22')]);_0x42e5ff['offset']=qs[_0x6862('0x1f')](_0x6bf7b3['query'][_0x6862('0x1f')]);}return _0x5ca5d5['getProactiveActions'](_0x42e5ff);}})[_0x6862('0x24')](function(_0x4a3eb9){if(_0x4a3eb9){return _0x4a3eb9?{'count':_0x3760f0,'rows':_0x4a3eb9}:null;}})[_0x6862('0x24')](respondWithResult(_0x1fc6e0,null))[_0x6862('0x1b')](handleError(_0x1fc6e0,null));};exports[_0x6862('0x119')]=function(_0x4433c4,_0x2a9ebd){var _0x3c5077=_0x4433c4[_0x6862('0x35')][_0x6862('0x11a')]==='false'?'offlineForm':_0x6862('0x11b');return db['ChatWebsite'][_0x6862('0x48')]({'attributes':['id',_0x3c5077],'where':{'id':_0x4433c4[_0x6862('0x52')]['id']}})['then'](handleEntityNotFound(_0x2a9ebd,null))[_0x6862('0x24')](function(_0x210d08){if(_0x210d08){var _0x429f59=_0x210d08[_0x3c5077];var _0x1fa179=_0x429f59&&_0x429f59[_0x6862('0x11c')]?_0x429f59[_0x6862('0x11c')]:[];_0x2a9ebd[_0x6862('0x2a')]({'fromKey':_[_0x6862('0x6e')](_0x429f59[_0x6862('0x11d')])?undefined:_0x429f59[_0x6862('0x11d')],'count':_0x1fa179['length'],'rows':_0x1fa179});}})[_0x6862('0x1b')](handleError(_0x2a9ebd,null));};exports[_0x6862('0x11e')]=function(_0x392ea3,_0x4adbd9){var _0xacff4b={'raw':![],'where':{}};var _0x37f297={};var _0x55169a={'count':0x0,'rows':[]};return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x392ea3[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x4adbd9,null))[_0x6862('0x24')](function(_0x56228d){if(_0x56228d){_0x37f297[_0x6862('0x32')]=_[_0x6862('0x47')](db[_0x6862('0x11f')][_0x6862('0x2e')]);_0x37f297['query']=_[_0x6862('0x47')](_0x392ea3[_0x6862('0x35')]);_0x37f297[_0x6862('0x3c')]=_[_0x6862('0x36')](_0x37f297[_0x6862('0x32')],_0x37f297['query']);_0xacff4b[_0x6862('0x37')]=_[_0x6862('0x36')](_0x37f297[_0x6862('0x32')],qs['fields'](_0x392ea3[_0x6862('0x35')][_0x6862('0x38')]));_0xacff4b[_0x6862('0x37')]=_0xacff4b[_0x6862('0x37')][_0x6862('0x39')]?_0xacff4b[_0x6862('0x37')]:_0x37f297[_0x6862('0x32')];if(!_0x392ea3[_0x6862('0x35')][_0x6862('0x5c')]('nolimit')){_0xacff4b['limit']=qs[_0x6862('0x22')](_0x392ea3['query']['limit']);_0xacff4b['offset']=qs[_0x6862('0x1f')](_0x392ea3['query'][_0x6862('0x1f')]);}_0xacff4b[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x392ea3['query'][_0x6862('0x5d')]);_0xacff4b[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_[_0x6862('0x3d')](_0x392ea3[_0x6862('0x35')],_0x37f297[_0x6862('0x3c')]));_0xacff4b[_0x6862('0x3f')][_0x6862('0x5a')]=_0x56228d['id'];if(_0x392ea3['query'][_0x6862('0x3e')]){_0xacff4b[_0x6862('0x3f')]=_[_0x6862('0x40')](_0xacff4b[_0x6862('0x3f')],{'$or':_['map'](_0xacff4b['attributes'],function(_0x500b9c){var _0x486bf7={};_0x486bf7[_0x500b9c]={'$like':'%'+_0x392ea3[_0x6862('0x35')]['filter']+'%'};return _0x486bf7;})});}_0xacff4b=_['merge']({},_0xacff4b,_0x392ea3[_0x6862('0x42')]);return db[_0x6862('0x11f')]['count']({'where':_0xacff4b[_0x6862('0x3f')]})[_0x6862('0x24')](function(_0x2708f7){_0x55169a[_0x6862('0x21')]=_0x2708f7;if(_0x392ea3['query'][_0x6862('0x43')]){_0xacff4b['include']=[{'all':!![]}];}else{_0xacff4b[_0x6862('0x44')]=[{'model':db[_0x6862('0x80')],'as':_0x6862('0xed'),'required':![]},{'model':db[_0x6862('0xd2')],'as':_0x6862('0x120'),'required':![]}];}return db[_0x6862('0x11f')][_0x6862('0x57')](_0xacff4b);})[_0x6862('0x24')](function(_0x2b61b2){_0x55169a['rows']=_0x2b61b2;return _0x55169a;});}})[_0x6862('0x24')](respondWithFilteredResult(_0x4adbd9,_0xacff4b))[_0x6862('0x1b')](handleError(_0x4adbd9,null));};exports['addAgents']=function(_0x4033d7,_0x40151d){return db[_0x6862('0x2d')]['find']({'where':{'id':_0x4033d7['params']['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x40151d,null))['then'](function(_0x328bab){if(_0x328bab){return _0x328bab[_0x6862('0x121')](_0x4033d7[_0x6862('0x4a')][_0x6862('0x60')],_[_0x6862('0x118')](_0x4033d7['body'],[_0x6862('0x60'),'id'])||{})['spread'](function(_0xd6561){for(var _0xc651aa=0x0;_0xc651aa<_0x4033d7['body'][_0x6862('0x60')][_0x6862('0x39')];_0xc651aa+=0x1){socket[_0x6862('0x122')](_0x6862('0x123'),{'UserId':Number(_0x4033d7[_0x6862('0x4a')][_0x6862('0x60')][_0xc651aa]),'ChatWebsiteId':Number(_0x4033d7[_0x6862('0x52')]['id'])});}return _0xd6561;});}})[_0x6862('0x24')](respondWithResult(_0x40151d,null))[_0x6862('0x1b')](handleError(_0x40151d,null));};exports[_0x6862('0x124')]=function(_0x5efda4,_0x55dd5d){return db[_0x6862('0x2d')][_0x6862('0x48')]({'where':{'id':_0x5efda4[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x55dd5d,null))[_0x6862('0x24')](function(_0x3787a9){if(_0x3787a9){return _0x3787a9[_0x6862('0x124')](_0x5efda4[_0x6862('0x35')][_0x6862('0x60')])[_0x6862('0x24')](function(){if(_[_0x6862('0x125')](_0x5efda4[_0x6862('0x35')]['ids'])){for(var _0x3f7122=0x0;_0x3f7122<_0x5efda4[_0x6862('0x35')][_0x6862('0x60')]['length'];_0x3f7122+=0x1){socket[_0x6862('0x122')](_0x6862('0x126'),{'UserId':Number(_0x5efda4[_0x6862('0x35')][_0x6862('0x60')][_0x3f7122]),'ChatWebsiteId':Number(_0x5efda4[_0x6862('0x52')]['id'])});}}else{socket[_0x6862('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x5efda4[_0x6862('0x35')]['ids']),'ChatWebsiteId':Number(_0x5efda4[_0x6862('0x52')]['id'])});}});}})[_0x6862('0x24')](respondWithStatusCode(_0x55dd5d,null))['catch'](handleError(_0x55dd5d,null));};exports['getAgents']=function(_0x7ab4ba,_0x4ed80c){var _0x2cf92c={};var _0x213dd6={};var _0x3f2322;var _0x9b2328;return db[_0x6862('0x2d')][_0x6862('0x5b')]({'where':{'id':_0x7ab4ba[_0x6862('0x52')]['id']}})[_0x6862('0x24')](handleEntityNotFound(_0x4ed80c,null))['then'](function(_0x140c31){if(_0x140c31){_0x3f2322=_0x140c31;_0x213dd6[_0x6862('0x32')]=_[_0x6862('0x47')](db['User'][_0x6862('0x2e')]);_0x213dd6[_0x6862('0x35')]=_[_0x6862('0x47')](_0x7ab4ba[_0x6862('0x35')]);_0x213dd6[_0x6862('0x3c')]=_['intersection'](_0x213dd6[_0x6862('0x32')],_0x213dd6['query']);_0x2cf92c[_0x6862('0x37')]=_[_0x6862('0x36')](_0x213dd6[_0x6862('0x32')],qs[_0x6862('0x38')](_0x7ab4ba[_0x6862('0x35')]['fields']));_0x2cf92c[_0x6862('0x37')]=_0x2cf92c[_0x6862('0x37')]['length']?_0x2cf92c[_0x6862('0x37')]:_0x213dd6[_0x6862('0x32')];_0x2cf92c[_0x6862('0x3b')]=qs[_0x6862('0x5d')](_0x7ab4ba[_0x6862('0x35')]['sort']);_0x2cf92c[_0x6862('0x3f')]=qs[_0x6862('0x3c')](_['pick'](_0x7ab4ba[_0x6862('0x35')],_0x213dd6['filters']));if(_0x7ab4ba[_0x6862('0x35')]['filter']){_0x2cf92c[_0x6862('0x3f')]=_[_0x6862('0x40')](_0x2cf92c[_0x6862('0x3f')],{'$or':_[_0x6862('0x33')](_0x2cf92c[_0x6862('0x37')],function(_0x51729e){var _0x25f678={};_0x25f678[_0x51729e]={'$like':'%'+_0x7ab4ba[_0x6862('0x35')][_0x6862('0x3e')]+'%'};return _0x25f678;})});}_0x2cf92c=_['merge']({},_0x2cf92c,_0x7ab4ba[_0x6862('0x42')]);return _0x3f2322[_0x6862('0x127')](_0x2cf92c);}})[_0x6862('0x24')](function(_0x41c9b4){if(_0x41c9b4){_0x9b2328=_0x41c9b4['length'];if(!_0x7ab4ba[_0x6862('0x35')]['hasOwnProperty'](_0x6862('0x3a'))){_0x2cf92c[_0x6862('0x22')]=qs[_0x6862('0x22')](_0x7ab4ba[_0x6862('0x35')][_0x6862('0x22')]);_0x2cf92c[_0x6862('0x1f')]=qs[_0x6862('0x1f')](_0x7ab4ba['query'][_0x6862('0x1f')]);}return _0x3f2322[_0x6862('0x127')](_0x2cf92c);}})['then'](function(_0x2eb484){if(_0x2eb484){return _0x2eb484?{'count':_0x9b2328,'rows':_0x2eb484}:null;}})[_0x6862('0x24')](respondWithResult(_0x4ed80c,null))[_0x6862('0x1b')](handleError(_0x4ed80c,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 3dc05ea..a1e6825 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 _0x106f=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2bd1ec,_0x3fe65f){var _0x2f7577=function(_0x5234fb){while(--_0x5234fb){_0x2bd1ec['push'](_0x2bd1ec['shift']());}};_0x2f7577(++_0x3fe65f);}(_0x106f,0x162));var _0xf106=function(_0x42f44a,_0x2b12e3){_0x42f44a=_0x42f44a-0x0;var _0x578c48=_0x106f[_0x42f44a];return _0x578c48;};'use strict';var EventEmitter=require(_0xf106('0x0'));var ChatWebsite=require(_0xf106('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xf106('0x2')](0x0);var events={'afterCreate':_0xf106('0x3'),'afterUpdate':'update','afterDestroy':_0xf106('0x4')};function emitEvent(_0x4ab04f){return function(_0x1236af,_0x370f6a,_0x1f2919){ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f+':'+_0x1236af['id'],_0x1236af);ChatWebsiteEvents[_0xf106('0x5')](_0x4ab04f,_0x1236af);_0x1f2919(null);};}for(var e in events){if(events[_0xf106('0x6')](e)){var event=events[e];ChatWebsite[_0xf106('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file +var _0x8d9b=['save','hook','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x358a62,_0x222349){var _0x55f1ae=function(_0x5e8c6b){while(--_0x5e8c6b){_0x358a62['push'](_0x358a62['shift']());}};_0x55f1ae(++_0x222349);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0xb8d9('0x0'));var ChatWebsite=require(_0xb8d9('0x1'))['db'][_0xb8d9('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xb8d9('0x3')](0x0);var events={'afterCreate':_0xb8d9('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3f763a){return function(_0x47b650,_0x2192ff,_0x3da7ad){ChatWebsiteEvents['emit'](_0x3f763a+':'+_0x47b650['id'],_0x47b650);ChatWebsiteEvents['emit'](_0x3f763a,_0x47b650);_0x3da7ad(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0xb8d9('0x5')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index e814f70..e47fa42 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 _0xf8c1=['util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatWebsite.attributes','exports','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf8c1,0x185));var _0x1f8c=function(_0x470922,_0x6c3e76){_0x470922=_0x470922-0x0;var _0x3058c8=_0xf8c1[_0x470922];return _0x3058c8;};'use strict';var _=require(_0x1f8c('0x0'));var util=require(_0x1f8c('0x1'));var logger=require(_0x1f8c('0x2'))(_0x1f8c('0x3'));var moment=require(_0x1f8c('0x4'));var BPromise=require('bluebird');var rp=require(_0x1f8c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f8c('0x6'));var config=require(_0x1f8c('0x7'));var attributes=require(_0x1f8c('0x8'));module[_0x1f8c('0x9')]=function(_0x31a4c9,_0x568686){return _0x31a4c9['define']('ChatWebsite',attributes,{'tableName':'chat_websites','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1dbe=['../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1dbe,0x143));var _0xe1db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe1db('0x0'));var util=require('util');var logger=require(_0xe1db('0x1'))(_0xe1db('0x2'));var moment=require('moment');var BPromise=require(_0xe1db('0x3'));var rp=require(_0xe1db('0x4'));var fs=require('fs');var path=require(_0xe1db('0x5'));var rimraf=require(_0xe1db('0x6'));var config=require(_0xe1db('0x7'));var attributes=require(_0xe1db('0x8'));module['exports']=function(_0x51e6c0,_0xa8d6d5){return _0x51e6c0['define'](_0xe1db('0x9'),attributes,{'tableName':_0xe1db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 40cfa4d..22ea641 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 _0x1783=['request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then'];(function(_0x217141,_0x3a8c3f){var _0x181c7f=function(_0x5e5412){while(--_0x5e5412){_0x217141['push'](_0x217141['shift']());}};_0x181c7f(++_0x3a8c3f);}(_0x1783,0x94));var _0x3178=function(_0xcb0b59,_0x3b157f){_0xcb0b59=_0xcb0b59-0x0;var _0xffe629=_0x1783[_0xcb0b59];return _0xffe629;};'use strict';var _=require('lodash');var util=require(_0x3178('0x0'));var moment=require(_0x3178('0x1'));var BPromise=require(_0x3178('0x2'));var rs=require(_0x3178('0x3'));var fs=require('fs');var Redis=require(_0x3178('0x4'));var db=require(_0x3178('0x5'))['db'];var utils=require(_0x3178('0x6'));var logger=require(_0x3178('0x7'))(_0x3178('0x8'));var config=require(_0x3178('0x9'));var jayson=require(_0x3178('0xa'));var client=jayson[_0x3178('0xb')]['http']({'port':0x232a});config[_0x3178('0xc')]=_[_0x3178('0xd')](config[_0x3178('0xc')],{'host':_0x3178('0xe'),'port':0x18eb});var socket=require(_0x3178('0xf'))(new Redis(config[_0x3178('0xc')]));require(_0x3178('0x10'))[_0x3178('0x11')](socket);function respondWithRpcPromise(_0x3b775c,_0x5dd5b9,_0xa35d1){return new BPromise(function(_0x40e73d,_0x301bd8){return client[_0x3178('0x12')](_0x3b775c,_0xa35d1)[_0x3178('0x13')](function(_0x38f5ca){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5dd5b9,_0x3178('0x14'));logger[_0x3178('0x15')](_0x3178('0x16'),_0x5dd5b9,_0x3178('0x14'),JSON[_0x3178('0x17')](_0x38f5ca));if(_0x38f5ca[_0x3178('0x18')]){if(_0x38f5ca[_0x3178('0x18')][_0x3178('0x19')]===0x1f4){logger[_0x3178('0x18')](_0x3178('0x1a'),_0x5dd5b9,_0x38f5ca[_0x3178('0x18')]['message']);return _0x301bd8(_0x38f5ca['error'][_0x3178('0x1b')]);}logger[_0x3178('0x18')](_0x3178('0x1a'),_0x5dd5b9,_0x38f5ca[_0x3178('0x18')][_0x3178('0x1b')]);return _0x40e73d(_0x38f5ca[_0x3178('0x18')][_0x3178('0x1b')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x5dd5b9,_0x3178('0x14'));_0x40e73d(_0x38f5ca['result'][_0x3178('0x1b')]);}})['catch'](function(_0x9c56e8){logger['error'](_0x3178('0x1a'),_0x5dd5b9,_0x9c56e8);_0x301bd8(_0x9c56e8);});});} \ No newline at end of file +var _0x498e=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x351192,_0x57a827){var _0x20ee3a=function(_0x1ad066){while(--_0x1ad066){_0x351192['push'](_0x351192['shift']());}};_0x20ee3a(++_0x57a827);}(_0x498e,0x9c));var _0xe498=function(_0x16f18a,_0x3bef4a){_0x16f18a=_0x16f18a-0x0;var _0x49263d=_0x498e[_0x16f18a];return _0x49263d;};'use strict';var _=require(_0xe498('0x0'));var util=require(_0xe498('0x1'));var moment=require(_0xe498('0x2'));var BPromise=require(_0xe498('0x3'));var rs=require(_0xe498('0x4'));var fs=require('fs');var Redis=require(_0xe498('0x5'));var db=require(_0xe498('0x6'))['db'];var utils=require(_0xe498('0x7'));var logger=require('../../config/logger')(_0xe498('0x8'));var config=require('../../config/environment');var jayson=require(_0xe498('0x9'));var client=jayson[_0xe498('0xa')][_0xe498('0xb')]({'port':0x232a});config[_0xe498('0xc')]=_[_0xe498('0xd')](config[_0xe498('0xc')],{'host':_0xe498('0xe'),'port':0x18eb});var socket=require(_0xe498('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')[_0xe498('0x10')](socket);function respondWithRpcPromise(_0x113318,_0x36d34d,_0x4866b1){return new BPromise(function(_0x53ef83,_0x17bd9c){return client[_0xe498('0x11')](_0x113318,_0x4866b1)[_0xe498('0x12')](function(_0x347c50){logger[_0xe498('0x13')](_0xe498('0x14'),_0x36d34d,'request\x20sent');logger['debug'](_0xe498('0x15'),_0x36d34d,_0xe498('0x16'),JSON['stringify'](_0x347c50));if(_0x347c50[_0xe498('0x17')]){if(_0x347c50[_0xe498('0x17')][_0xe498('0x18')]===0x1f4){logger[_0xe498('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x36d34d,_0x347c50['error'][_0xe498('0x19')]);return _0x17bd9c(_0x347c50[_0xe498('0x17')][_0xe498('0x19')]);}logger['error'](_0xe498('0x14'),_0x36d34d,_0x347c50[_0xe498('0x17')][_0xe498('0x19')]);return _0x53ef83(_0x347c50['error'][_0xe498('0x19')]);}else{logger[_0xe498('0x13')](_0xe498('0x14'),_0x36d34d,'request\x20sent');_0x53ef83(_0x347c50[_0xe498('0x1a')][_0xe498('0x19')]);}})[_0xe498('0x1b')](function(_0x4796c6){logger[_0xe498('0x17')](_0xe498('0x14'),_0x36d34d,_0x4796c6);_0x17bd9c(_0x4796c6);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index de0af5a..d26dbca 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 _0xcbe7=['remove','update','emit','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xcbe7,0x19e));var _0x7cbe=function(_0x4d01c4,_0x4a9db1){_0x4d01c4=_0x4d01c4-0x0;var _0x57219d=_0xcbe7[_0x4d01c4];return _0x57219d;};'use strict';var ChatWebsiteEvents=require(_0x7cbe('0x0'));var events=[_0x7cbe('0x1'),_0x7cbe('0x2'),_0x7cbe('0x3')];function createListener(_0x2589b8,_0x226a2c){return function(_0x2bdd91){_0x226a2c[_0x7cbe('0x4')](_0x2589b8,_0x2bdd91);};}function removeListener(_0x4ee90c,_0x4f9c3b){return function(){ChatWebsiteEvents['removeListener'](_0x4ee90c,_0x4f9c3b);};}exports[_0x7cbe('0x5')]=function(_0x22df24){for(var _0x2d2ee9=0x0,_0x106c2b=events[_0x7cbe('0x6')];_0x2d2ee9<_0x106c2b;_0x2d2ee9++){var _0x25176e=events[_0x2d2ee9];var _0x346837=createListener(_0x7cbe('0x7')+_0x25176e,_0x22df24);ChatWebsiteEvents['on'](_0x25176e,_0x346837);}}; \ No newline at end of file +var _0x3bd4=['./chatWebsite.events','save','remove','update','emit','removeListener','length'];(function(_0x133c58,_0x5d85f2){var _0x5937d5=function(_0x5d27fc){while(--_0x5d27fc){_0x133c58['push'](_0x133c58['shift']());}};_0x5937d5(++_0x5d85f2);}(_0x3bd4,0x69));var _0x43bd=function(_0x3add10,_0x457d16){_0x3add10=_0x3add10-0x0;var _0x2da348=_0x3bd4[_0x3add10];return _0x2da348;};'use strict';var ChatWebsiteEvents=require(_0x43bd('0x0'));var events=[_0x43bd('0x1'),_0x43bd('0x2'),_0x43bd('0x3')];function createListener(_0x23cc4e,_0x11d2da){return function(_0x2ef4dd){_0x11d2da[_0x43bd('0x4')](_0x23cc4e,_0x2ef4dd);};}function removeListener(_0x17761b,_0x25bafb){return function(){ChatWebsiteEvents[_0x43bd('0x5')](_0x17761b,_0x25bafb);};}exports['register']=function(_0x13e914){for(var _0x31d52d=0x0,_0xe8c338=events[_0x43bd('0x6')];_0x31d52d<_0xe8c338;_0x31d52d++){var _0x288c21=events[_0x31d52d];var _0x1ebf06=createListener('chatWebsite:'+_0x288c21,_0x13e914);ChatWebsiteEvents['on'](_0x288c21,_0x1ebf06);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index e511154..2485078 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 _0xc2e6=['/:id/logo','single','file','addLogo','root','server/files/images/avatars/','format','addAvatar','join','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','update','destroy','delete','removeAnswers','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','isAuthenticated','index','get','/describe','getDispositions','/:id/canned_answers','getAnswers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','%s-%s','now','originalname'];(function(_0x54c5c4,_0x3259e2){var _0x237b77=function(_0x22228d){while(--_0x22228d){_0x54c5c4['push'](_0x54c5c4['shift']());}};_0x237b77(++_0x3259e2);}(_0xc2e6,0x13e));var _0x6c2e=function(_0x2df0dd,_0x3f4730){_0x2df0dd=_0x2df0dd-0x0;var _0x4f5de5=_0xc2e6[_0x2df0dd];return _0x4f5de5;};'use strict';var multer=require(_0x6c2e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6c2e('0x1'));var express=require(_0x6c2e('0x2'));var router=express[_0x6c2e('0x3')]();var fs_extra=require(_0x6c2e('0x4'));var auth=require(_0x6c2e('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6c2e('0x6'));router['get']('/',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x8')]);router[_0x6c2e('0x9')](_0x6c2e('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x6c2e('0x7')](),controller['show']);router['get']('/:id/dispositions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0xb')]);router[_0x6c2e('0x9')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0xd')]);router['get']('/:id/logo',controller[_0x6c2e('0xe')]);router[_0x6c2e('0x9')](_0x6c2e('0xf'),controller[_0x6c2e('0x10')]);router['get'](_0x6c2e('0x11'),controller[_0x6c2e('0x12')]);router['get'](_0x6c2e('0x13'),controller[_0x6c2e('0x14')]);router[_0x6c2e('0x9')]('/:id/interactions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x15')]);router[_0x6c2e('0x9')](_0x6c2e('0x16'),controller[_0x6c2e('0x17')]);router[_0x6c2e('0x9')](_0x6c2e('0x18'),auth['isAuthenticated'](),controller[_0x6c2e('0x19')]);router[_0x6c2e('0x9')](_0x6c2e('0x1a'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x1b')]);router['get'](_0x6c2e('0x1c'),controller['getFields']);router['get'](_0x6c2e('0x1d'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x1e')]);router[_0x6c2e('0x9')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x20')]);router[_0x6c2e('0x21')]('/',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x22')]);router[_0x6c2e('0x21')](_0x6c2e('0x23'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x24')]);router[_0x6c2e('0x21')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x25')]);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x2993e0,_0x49e79e,_0x1994b1){_0x1994b1(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x1f6c04,_0x25a657,_0x4a12de){_0x4a12de(null,util['format'](_0x6c2e('0x27'),Date[_0x6c2e('0x28')](),_0x25a657[_0x6c2e('0x29')]));}})});router['post'](_0x6c2e('0x2a'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller[_0x6c2e('0x2d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x684a4,_0x5f06eb,_0x2dd2ed){_0x2dd2ed(null,path['join'](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0x403744,_0x1d1356,_0x7ff6d8){_0x7ff6d8(null,util[_0x6c2e('0x30')](_0x6c2e('0x27'),Date['now'](),_0x1d1356[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0xf'),upload[_0x6c2e('0x2b')]('file'),controller[_0x6c2e('0x31')]);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x101653,_0x27074c,_0x42c01d){_0x42c01d(null,path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0xf66c3b,_0x2550a4,_0x26f6bc){_0x26f6bc(null,util[_0x6c2e('0x30')](_0x6c2e('0x27'),Date[_0x6c2e('0x28')](),_0x2550a4[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0x11'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x12e85a,_0x123bf9,_0x46db39){_0x46db39(null,path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x2f')));},'filename':function(_0x108e4e,_0x8d52cf,_0x812ab6){_0x812ab6(null,util[_0x6c2e('0x30')]('%s-%s',Date[_0x6c2e('0x28')](),_0x8d52cf[_0x6c2e('0x29')]));}})});router[_0x6c2e('0x21')](_0x6c2e('0x13'),upload[_0x6c2e('0x2b')](_0x6c2e('0x2c')),controller['addSystemAvatar']);router[_0x6c2e('0x21')](_0x6c2e('0x33'),controller[_0x6c2e('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0x6c2e('0x26')]({'destination':function(_0x456e27,_0x5b4039,_0x546296){const _0xe9219c=path[_0x6c2e('0x32')](config[_0x6c2e('0x2e')],_0x6c2e('0x35'),_0x6c2e('0x36'),'offline-chat');fs_extra[_0x6c2e('0x37')](_0xe9219c,function(){_0x546296(null,_0xe9219c);});},'filename':function(_0x29508c,_0x381604,_0x437677){const _0x2df178=_0x381604['originalname'][_0x6c2e('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x38f282=path[_0x6c2e('0x39')](_0x2df178);const _0xbac1de=Date['now']()+'-'+_0x2df178[_0x6c2e('0x38')](_0x38f282,'')+_0x38f282;_0x437677(null,_0xbac1de);}})});router[_0x6c2e('0x21')](_0x6c2e('0x3a'),offlineUploadMulter[_0x6c2e('0x3b')](),controller[_0x6c2e('0x3c')]);router[_0x6c2e('0x21')]('/:id/interactions',auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x3d')]);router[_0x6c2e('0x21')](_0x6c2e('0x18'),auth['isAuthenticated'](),controller[_0x6c2e('0x3e')]);router[_0x6c2e('0x21')](_0x6c2e('0x1a'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x3f')]);router[_0x6c2e('0x21')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x40')]);router[_0x6c2e('0x41')](_0x6c2e('0x42'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x43')]);router['delete'](_0x6c2e('0x42'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x44')]);router[_0x6c2e('0x45')]('/:id/dispositions',auth['isAuthenticated'](),controller['removeDispositions']);router[_0x6c2e('0x45')](_0x6c2e('0xc'),auth[_0x6c2e('0x7')](),controller[_0x6c2e('0x46')]);router[_0x6c2e('0x45')](_0x6c2e('0x1f'),auth[_0x6c2e('0x7')](),controller['removeAgents']);module[_0x6c2e('0x47')]=router; \ No newline at end of file +var _0xfc7a=['addAvatar','file','addCustomerAvatar','/:id/notify','notify','server/files','offline-chat','ensureDir','replace','extname','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','update','delete','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','/describe','/:id','show','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','getSnippet','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','server/files/images/avatars/','originalname','single'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfc7a,0x129));var _0xafc7=function(_0x289cf5,_0x501dfc){_0x289cf5=_0x289cf5-0x0;var _0x1f316d=_0xfc7a[_0x289cf5];return _0x1f316d;};'use strict';var multer=require(_0xafc7('0x0'));var util=require(_0xafc7('0x1'));var path=require(_0xafc7('0x2'));var timeout=require(_0xafc7('0x3'));var express=require(_0xafc7('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xafc7('0x5'));var interaction=require(_0xafc7('0x6'));var config=require(_0xafc7('0x7'));var controller=require(_0xafc7('0x8'));router[_0xafc7('0x9')]('/',auth[_0xafc7('0xa')](),controller[_0xafc7('0xb')]);router[_0xafc7('0x9')](_0xafc7('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0xafc7('0x9')](_0xafc7('0xd'),auth[_0xafc7('0xa')](),controller[_0xafc7('0xe')]);router[_0xafc7('0x9')]('/:id/dispositions',auth[_0xafc7('0xa')](),controller[_0xafc7('0xf')]);router[_0xafc7('0x9')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xafc7('0x10')]);router[_0xafc7('0x9')](_0xafc7('0x11'),controller[_0xafc7('0x12')]);router['get'](_0xafc7('0x13'),controller[_0xafc7('0x14')]);router[_0xafc7('0x9')](_0xafc7('0x15'),controller[_0xafc7('0x16')]);router[_0xafc7('0x9')](_0xafc7('0x17'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xafc7('0xa')](),controller[_0xafc7('0x18')]);router[_0xafc7('0x9')]('/:id/snippet',controller[_0xafc7('0x19')]);router[_0xafc7('0x9')]('/:id/applications',auth[_0xafc7('0xa')](),controller['getApplications']);router[_0xafc7('0x9')](_0xafc7('0x1a'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x1b')]);router['get'](_0xafc7('0x1c'),controller[_0xafc7('0x1d')]);router[_0xafc7('0x9')]('/:id/offline_messages',auth[_0xafc7('0xa')](),controller[_0xafc7('0x1e')]);router[_0xafc7('0x9')](_0xafc7('0x1f'),auth['isAuthenticated'](),controller['getAgents']);router[_0xafc7('0x20')]('/',auth[_0xafc7('0xa')](),controller[_0xafc7('0x21')]);router['post'](_0xafc7('0x22'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x23')]);router[_0xafc7('0x20')](_0xafc7('0x24'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x25')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x3e797d,_0x41c9cd,_0x468063){_0x468063(null,path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x29')));},'filename':function(_0x383e3e,_0x4cb759,_0x3d21d2){_0x3d21d2(null,util[_0xafc7('0x2a')](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x4cb759['originalname']));}})});router['post'](_0xafc7('0x11'),upload['single']('file'),controller['addLogo']);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0xb0347a,_0x5f1dd8,_0x4a7488){_0x4a7488(null,path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x2d')));},'filename':function(_0xaf59d7,_0x2ca7ba,_0x2635ea){_0x2635ea(null,util['format'](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x2ca7ba[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')]('/:id/avatar',upload[_0xafc7('0x2f')]('file'),controller[_0xafc7('0x30')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x18b333,_0x17d2ce,_0x493c72){_0x493c72(null,path['join'](config[_0xafc7('0x28')],_0xafc7('0x2d')));},'filename':function(_0x31bf90,_0x2b2755,_0x51a378){_0x51a378(null,util['format'](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x2b2755[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')]('/:id/customer_avatar',upload[_0xafc7('0x2f')](_0xafc7('0x31')),controller[_0xafc7('0x32')]);var upload=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x52e4a2,_0x52a07f,_0x4356fc){_0x4356fc(null,path[_0xafc7('0x27')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x16426d,_0x24b855,_0x44094e){_0x44094e(null,util[_0xafc7('0x2a')](_0xafc7('0x2b'),Date[_0xafc7('0x2c')](),_0x24b855[_0xafc7('0x2e')]));}})});router[_0xafc7('0x20')](_0xafc7('0x17'),upload['single'](_0xafc7('0x31')),controller['addSystemAvatar']);router[_0xafc7('0x20')](_0xafc7('0x33'),controller[_0xafc7('0x34')]);const offlineUploadMulter=multer({'storage':multer[_0xafc7('0x26')]({'destination':function(_0x4ca7a8,_0x4d6784,_0x127f8d){const _0x280723=path[_0xafc7('0x27')](config[_0xafc7('0x28')],_0xafc7('0x35'),'attachments',_0xafc7('0x36'));fs_extra[_0xafc7('0x37')](_0x280723,function(){_0x127f8d(null,_0x280723);});},'filename':function(_0xe1abf8,_0x4e0df6,_0x45f2bf){const _0x33d06d=_0x4e0df6[_0xafc7('0x2e')][_0xafc7('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x51fdbf=path[_0xafc7('0x39')](_0x33d06d);const _0x17778c=Date[_0xafc7('0x2c')]()+'-'+_0x33d06d[_0xafc7('0x38')](_0x51fdbf,'')+_0x51fdbf;_0x45f2bf(null,_0x17778c);}})});router[_0xafc7('0x20')]('/:id/offline',offlineUploadMulter[_0xafc7('0x3a')](),controller[_0xafc7('0x3b')]);router['post'](_0xafc7('0x3c'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x3d')]);router[_0xafc7('0x20')]('/:id/applications',auth[_0xafc7('0xa')](),controller[_0xafc7('0x3e')]);router[_0xafc7('0x20')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0xafc7('0x3f')]);router['post'](_0xafc7('0x1f'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0xafc7('0xd'),auth['isAuthenticated'](),controller[_0xafc7('0x40')]);router['delete'](_0xafc7('0xd'),auth[_0xafc7('0xa')](),controller['destroy']);router[_0xafc7('0x41')](_0xafc7('0x22'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xafc7('0x41')](_0xafc7('0x24'),auth[_0xafc7('0xa')](),controller[_0xafc7('0x42')]);router[_0xafc7('0x41')]('/:id/users',auth[_0xafc7('0xa')](),controller[_0xafc7('0x43')]);module[_0xafc7('0x44')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index dbf8599..57a2081 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 _0x4ed2=['MicrosoftAzure\x20=>\x20tenant','STRING','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','TEXT','sequelize','exports','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4ed2,0x1d7));var _0x24ed=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x4ed2[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x24ed('0x0'));module[_0x24ed('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x24ed('0x2')](_0x24ed('0x3'),_0x24ed('0x4'),_0x24ed('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x24ed('0x2')](_0x24ed('0x6'),_0x24ed('0x7'))},'data1':{'type':Sequelize['STRING'],'comment':_0x24ed('0x8')},'data2':{'type':Sequelize['STRING'],'comment':_0x24ed('0x9')},'data3':{'type':Sequelize[_0x24ed('0xa')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize['STRING'],'comment':_0x24ed('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0x24ed('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x24ed('0xd')},'data7':{'type':Sequelize[_0x24ed('0xe')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}}; \ No newline at end of file +var _0xb871=['ENUM','Google','Outlook365','Dynamics365','STRING','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports'];(function(_0xb83719,_0x295c63){var _0x2462a5=function(_0x166db2){while(--_0x166db2){_0xb83719['push'](_0xb83719['shift']());}};_0x2462a5(++_0x295c63);}(_0xb871,0x1da));var _0x1b87=function(_0x976826,_0x3a903b){_0x976826=_0x976826-0x0;var _0x5d0be7=_0xb871[_0x976826];return _0x5d0be7;};'use strict';var Sequelize=require(_0x1b87('0x0'));module[_0x1b87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1b87('0x2')]('AmazonAWS',_0x1b87('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x1b87('0x2')](_0x1b87('0x4'),_0x1b87('0x5'))},'data1':{'type':Sequelize[_0x1b87('0x6')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x1b87('0x6')],'comment':_0x1b87('0x7')},'data3':{'type':Sequelize[_0x1b87('0x6')],'comment':_0x1b87('0x8')},'data4':{'type':Sequelize['STRING'],'comment':_0x1b87('0x9')},'data5':{'type':Sequelize[_0x1b87('0xa')],'comment':_0x1b87('0xb')},'data6':{'type':Sequelize['TEXT'],'comment':_0x1b87('0xc')},'data7':{'type':Sequelize['TEXT'],'comment':_0x1b87('0xd')}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 659dd71..effd984 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 _0x2f13=['emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','update','then','destroy','error','name','send','padEnd','slice','index','map','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','filters','filter','merge','VIRTUAL','options','CloudProvider','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','create','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','body','join','encryptString','find','findOne','user','oauth2MicrosoftCallback','get','Invalid\x20state\x20parameter','parse','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','del','data5','data6','refresh_token','startRefreshInterval'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x2f13,0x11d));var _0x32f1=function(_0x561829,_0x31efa4){_0x561829=_0x561829-0x0;var _0x2ddab5=_0x2f13[_0x561829];return _0x2ddab5;};'use strict';var _=require(_0x32f1('0x0'));var Redis=require(_0x32f1('0x1'));var qs=require(_0x32f1('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x32f1('0x3'));var logger=require(_0x32f1('0x4'))('api');var db=require(_0x32f1('0x5'))['db'];var oauth=require(_0x32f1('0x6'));config[_0x32f1('0x7')]=_[_0x32f1('0x8')](config['redis'],{'host':_0x32f1('0x9'),'port':0x18eb});var socket=require(_0x32f1('0xa'))(new Redis(config[_0x32f1('0x7')]));var redis=new Redis(config[_0x32f1('0x7')]);function respondWithStatusCode(_0xac189d,_0xeb5718){_0xeb5718=_0xeb5718||0xcc;return function(_0x32ade6){if(_0x32ade6){return _0xac189d[_0x32f1('0xb')](_0xeb5718);}return _0xac189d[_0x32f1('0xc')](_0xeb5718)[_0x32f1('0xd')]();};}function respondWithResult(_0xa05598,_0x3b4aa7){_0x3b4aa7=_0x3b4aa7||0xc8;return function(_0x1631fe){if(_0x1631fe){return _0xa05598['status'](_0x3b4aa7)[_0x32f1('0xe')](_0x1631fe);}};}function respondWithFilteredResult(_0x5e11af,_0x9cb642){return function(_0x5dff12){if(_0x5dff12){var _0x31f018=typeof _0x9cb642[_0x32f1('0xf')]===_0x32f1('0x10')&&typeof _0x9cb642['limit']===_0x32f1('0x10');var _0x43f5f5=_0x5dff12[_0x32f1('0x11')];var _0x5c69fe=_0x31f018?0x0:_0x9cb642[_0x32f1('0xf')];var _0xd452d5=_0x31f018?_0x5dff12['count']:_0x9cb642[_0x32f1('0xf')]+_0x9cb642['limit'];var _0x3a8111;if(_0xd452d5>=_0x43f5f5){_0xd452d5=_0x43f5f5;_0x3a8111=0xc8;}else{_0x3a8111=0xce;}_0x5e11af[_0x32f1('0xc')](_0x3a8111);return _0x5e11af[_0x32f1('0x12')](_0x32f1('0x13'),_0x5c69fe+'-'+_0xd452d5+'/'+_0x43f5f5)[_0x32f1('0xe')](_0x5dff12);}return null;};}function saveUpdates(_0x58694f){return function(_0x2b352f){if(_0x2b352f){return _0x2b352f[_0x32f1('0x14')](_0x58694f)[_0x32f1('0x15')](function(_0x3916d1){return _0x3916d1;});}return null;};}function removeEntity(_0x370004){return function(_0x3adb3e){if(_0x3adb3e){return _0x3adb3e[_0x32f1('0x16')]()[_0x32f1('0x15')](function(){_0x370004[_0x32f1('0xc')](0xcc)[_0x32f1('0xd')]();});}};}function handleEntityNotFound(_0x1719dc){return function(_0x13fa74){if(!_0x13fa74){_0x1719dc[_0x32f1('0xb')](0x194);}return _0x13fa74;};}function handleError(_0x18b8ca,_0x76b826){_0x76b826=_0x76b826||0x1f4;return function(_0x51179a){logger[_0x32f1('0x17')](_0x51179a['stack']);if(_0x51179a[_0x32f1('0x18')]){delete _0x51179a[_0x32f1('0x18')];}_0x18b8ca[_0x32f1('0xc')](_0x76b826)[_0x32f1('0x19')](_0x51179a);};}function maskClientSecret(_0x2ee2b7){return _[_0x32f1('0x1a')](_0x2ee2b7[_0x32f1('0x1b')](0x0,0x3),0x14,'*');}exports[_0x32f1('0x1c')]=function(_0x1bc85d,_0xc94d6d){var _0x3fc752={},_0x3f3eaa={},_0x24c0b8={'count':0x0,'rows':[]};var _0x4e8a46=_[_0x32f1('0x1d')](db['CloudProvider'][_0x32f1('0x1e')],function(_0x17113e){return{'name':_0x17113e[_0x32f1('0x1f')],'type':_0x17113e[_0x32f1('0x20')][_0x32f1('0x21')]};});_0x3f3eaa[_0x32f1('0x22')]=_[_0x32f1('0x1d')](_0x4e8a46,_0x32f1('0x18'));_0x3f3eaa['query']=_['keys'](_0x1bc85d[_0x32f1('0x23')]);_0x3f3eaa['filters']=_['intersection'](_0x3f3eaa['model'],_0x3f3eaa[_0x32f1('0x23')]);_0x3fc752['attributes']=_[_0x32f1('0x24')](_0x3f3eaa[_0x32f1('0x22')],qs['fields'](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x25')]));_0x3fc752[_0x32f1('0x26')]=_0x3fc752[_0x32f1('0x26')][_0x32f1('0x27')]?_0x3fc752['attributes']:_0x3f3eaa[_0x32f1('0x22')];if(!_0x1bc85d['query'][_0x32f1('0x28')](_0x32f1('0x29'))){_0x3fc752[_0x32f1('0x2a')]=qs[_0x32f1('0x2a')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2a')]);_0x3fc752[_0x32f1('0xf')]=qs[_0x32f1('0xf')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0xf')]);}_0x3fc752['order']=qs[_0x32f1('0x2b')](_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2b')]);_0x3fc752[_0x32f1('0x2c')]=qs[_0x32f1('0x2d')](_['pick'](_0x1bc85d[_0x32f1('0x23')],_0x3f3eaa[_0x32f1('0x2d')]),_0x4e8a46);if(_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2e')]){_0x3fc752[_0x32f1('0x2c')]=_[_0x32f1('0x2f')](_0x3fc752['where'],{'$or':_['map'](_0x4e8a46,function(_0x4c08a3){if(_0x4c08a3[_0x32f1('0x20')]!==_0x32f1('0x30')){var _0x8036dd={};_0x8036dd[_0x4c08a3[_0x32f1('0x18')]]={'$like':'%'+_0x1bc85d[_0x32f1('0x23')][_0x32f1('0x2e')]+'%'};return _0x8036dd;}})});}_0x3fc752=_[_0x32f1('0x2f')]({},_0x3fc752,_0x1bc85d[_0x32f1('0x31')]);var _0x5c70b8={'where':_0x3fc752[_0x32f1('0x2c')]};return db[_0x32f1('0x32')]['count'](_0x5c70b8)[_0x32f1('0x15')](function(_0x49cd99){_0x24c0b8[_0x32f1('0x11')]=_0x49cd99;if(_0x1bc85d['query'][_0x32f1('0x33')]){_0x3fc752[_0x32f1('0x34')]=[{'all':!![]}];}return db[_0x32f1('0x32')][_0x32f1('0x35')](_0x3fc752);})[_0x32f1('0x15')](function(_0x1d19cf){_0x24c0b8['rows']=_[_0x32f1('0x1d')](_0x1d19cf,function(_0x1c9387){if(_0x1c9387[_0x32f1('0x36')]===_0x32f1('0x37')){var _0x33bc5c=encryptor[_0x32f1('0x38')](_0x1c9387[_0x32f1('0x39')]);_0x1c9387['data3']=maskClientSecret(_0x33bc5c);}return _0x1c9387;});return _0x24c0b8;})[_0x32f1('0x15')](respondWithFilteredResult(_0xc94d6d,_0x3fc752))[_0x32f1('0x3a')](handleError(_0xc94d6d,null));};exports[_0x32f1('0x3b')]=function(_0x261eef,_0x4f6d38){var _0x1a3b74={'raw':!![],'where':{'id':_0x261eef[_0x32f1('0x3c')]['id']}},_0x3244ef={};_0x3244ef['model']=_[_0x32f1('0x3d')](db[_0x32f1('0x32')][_0x32f1('0x1e')]);_0x3244ef[_0x32f1('0x23')]=_['keys'](_0x261eef[_0x32f1('0x23')]);_0x3244ef[_0x32f1('0x2d')]=_['intersection'](_0x3244ef[_0x32f1('0x22')],_0x3244ef[_0x32f1('0x23')]);_0x1a3b74['attributes']=_[_0x32f1('0x24')](_0x3244ef[_0x32f1('0x22')],qs['fields'](_0x261eef['query'][_0x32f1('0x25')]));_0x1a3b74[_0x32f1('0x26')]=_0x1a3b74[_0x32f1('0x26')][_0x32f1('0x27')]?_0x1a3b74['attributes']:_0x3244ef[_0x32f1('0x22')];if(_0x261eef[_0x32f1('0x23')][_0x32f1('0x33')]){_0x1a3b74[_0x32f1('0x34')]=[{'all':!![]}];}_0x1a3b74=_[_0x32f1('0x2f')]({},_0x1a3b74,_0x261eef[_0x32f1('0x31')]);return db[_0x32f1('0x32')]['find'](_0x1a3b74)[_0x32f1('0x15')](handleEntityNotFound(_0x4f6d38,null))[_0x32f1('0x15')](function(_0x5478ab){if(_0x5478ab[_0x32f1('0x36')]===_0x32f1('0x37')){var _0x4e1bc1=encryptor[_0x32f1('0x38')](_0x5478ab[_0x32f1('0x39')]);_0x5478ab[_0x32f1('0x39')]=maskClientSecret(_0x4e1bc1);}return _0x5478ab;})[_0x32f1('0x15')](respondWithResult(_0x4f6d38,null))[_0x32f1('0x3a')](handleError(_0x4f6d38,null));};exports[_0x32f1('0x3e')]=function(_0x41bc98,_0x5393d1){if(!_0x41bc98['body'][_0x32f1('0x18')])throw new Error(_0x32f1('0x3f'));if(!_0x41bc98['body']['service'])throw new Error(_0x32f1('0x40'));var _0x8de91e=db['CloudProvider'][_0x32f1('0x1e')]['service']['values'];if(!_0x8de91e['includes'](_0x41bc98[_0x32f1('0x41')]['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x8de91e[_0x32f1('0x42')](',\x20'));if(_0x41bc98[_0x32f1('0x41')][_0x32f1('0x36')]==='MicrosoftAzure'&&_0x41bc98['body'][_0x32f1('0x39')]){_0x41bc98[_0x32f1('0x41')][_0x32f1('0x39')]=encryptor[_0x32f1('0x43')](_0x41bc98[_0x32f1('0x41')][_0x32f1('0x39')]);}return db['CloudProvider']['create'](_0x41bc98['body'],{})[_0x32f1('0x15')](respondWithResult(_0x5393d1,0xc9))[_0x32f1('0x3a')](handleError(_0x5393d1,null));};exports[_0x32f1('0x14')]=function(_0x27714,_0x2ae747){if(_0x27714['body']['id']){delete _0x27714[_0x32f1('0x41')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x27714['params']['id']}})['then'](handleEntityNotFound(_0x2ae747,null))[_0x32f1('0x15')](function(_0x9dd53a){if(_0x9dd53a[_0x32f1('0x36')]===_0x32f1('0x37')&&_0x27714[_0x32f1('0x41')]['data3']){_0x27714[_0x32f1('0x41')]['data3']=encryptor[_0x32f1('0x43')](_0x27714[_0x32f1('0x41')][_0x32f1('0x39')]);}return _0x9dd53a;})[_0x32f1('0x15')](saveUpdates(_0x27714[_0x32f1('0x41')],null))[_0x32f1('0x15')](respondWithResult(_0x2ae747,null))['catch'](handleError(_0x2ae747,null));};exports[_0x32f1('0x16')]=function(_0x31119d,_0xa45e15){return db['CloudProvider'][_0x32f1('0x44')]({'where':{'id':_0x31119d[_0x32f1('0x3c')]['id']}})[_0x32f1('0x15')](handleEntityNotFound(_0xa45e15,null))[_0x32f1('0x15')](removeEntity(_0xa45e15,null))[_0x32f1('0x3a')](handleError(_0xa45e15,null));};exports['oauth2MicrosoftAuthorize']=function(_0x409ca0,_0x3e74f1){return db[_0x32f1('0x32')][_0x32f1('0x45')]({'where':{'id':_0x409ca0['params']['id']},'raw':!![]})[_0x32f1('0x15')](function(_0x180e1c){if(!_0x180e1c)return _0x3e74f1['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x180e1c,_0x409ca0[_0x32f1('0x46')]['id'])};})[_0x32f1('0x15')](respondWithResult(_0x3e74f1,null))[_0x32f1('0x3a')](handleError(_0x3e74f1,null));};exports[_0x32f1('0x47')]=function(_0x3387ac,_0x516119){var _0x6404cc=_0x3387ac[_0x32f1('0x41')];var _0x254e9d;var _0x467777;if(_0x6404cc[_0x32f1('0x17')])throw _0x6404cc;redis[_0x32f1('0x48')](_0x6404cc['state'])[_0x32f1('0x15')](function(_0x615b04){if(!_0x615b04)throw new Error(_0x32f1('0x49'));_0x254e9d=JSON[_0x32f1('0x4a')](_0x615b04);var _0x48fea1=Buffer['from'](_0x6404cc[_0x32f1('0x4b')],_0x32f1('0x4c'))[_0x32f1('0x4d')](_0x32f1('0x4e'));_0x467777=JSON[_0x32f1('0x4a')](_0x48fea1);if(!oauth[_0x32f1('0x4f')](_0x6404cc[_0x32f1('0x50')],_0x254e9d[_0x32f1('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis[_0x32f1('0x52')](_0x6404cc['state']);return oauth['getOauth2MicrosoftAccessToken'](_0x6404cc['code'],_0x254e9d);})[_0x32f1('0x15')](function(_0x2ec9e6){_0x254e9d[_0x32f1('0x53')]=_0x2ec9e6['access_token'];_0x254e9d[_0x32f1('0x54')]=_0x2ec9e6[_0x32f1('0x55')];return db[_0x32f1('0x32')][_0x32f1('0x14')]({'data5':_0x254e9d['data5'],'data6':_0x254e9d[_0x32f1('0x54')]},{'where':{'id':_0x254e9d['id']}});})['then'](function(){oauth[_0x32f1('0x56')](_0x254e9d);socket[_0x32f1('0x57')](_0x32f1('0x58'),{'id':_0x467777['id']});return;})[_0x32f1('0x15')](respondWithStatusCode(_0x516119,null))['catch'](function(_0xc78346){if(_0x467777){socket['emit'](_0x32f1('0x59'),{'id':_0x467777['id']});}if(!_0x254e9d){logger[_0x32f1('0x17')](_0x32f1('0x5a'),_0xc78346);return _0x516119['status'](0x1f4)[_0x32f1('0x19')](_0xc78346[_0x32f1('0x5b')]);}logger[_0x32f1('0x17')](_0x32f1('0x5c'),_0x254e9d['id'],_0xc78346);});}; \ No newline at end of file +var _0x0250=['set','Content-Range','json','then','destroy','error','stack','name','index','CloudProvider','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','service','decryptString','data3','show','params','find','MicrosoftAzure','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','update','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','state','from','base64','toString','parse','isValidIdToken','oauth2Claims','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','microsoftAuthorization:success','emit','Invalid\x20authentication\x20state\x20parameter','send','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s','lodash','ioredis','../../components/parsers/qs','../../config/environment','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','sendStatus','status','undefined','count','offset','limit'];(function(_0x7642c,_0x2ec4b0){var _0x5412fd=function(_0xffc8e3){while(--_0xffc8e3){_0x7642c['push'](_0x7642c['shift']());}};_0x5412fd(++_0x2ec4b0);}(_0x0250,0x1bf));var _0x0025=function(_0x2f8540,_0x5e8fb9){_0x2f8540=_0x2f8540-0x0;var _0x4bc2f3=_0x0250[_0x2f8540];return _0x4bc2f3;};'use strict';var _=require(_0x0025('0x0'));var Redis=require(_0x0025('0x1'));var qs=require(_0x0025('0x2'));var encryptor=require('../../components/encryptor');var config=require(_0x0025('0x3'));var logger=require(_0x0025('0x4'))(_0x0025('0x5'));var db=require(_0x0025('0x6'))['db'];var oauth=require(_0x0025('0x7'));config['redis']=_[_0x0025('0x8')](config[_0x0025('0x9')],{'host':_0x0025('0xa'),'port':0x18eb});var socket=require(_0x0025('0xb'))(new Redis(config[_0x0025('0x9')]));var redis=new Redis(config[_0x0025('0x9')]);function respondWithStatusCode(_0x179645,_0x7f0b12){_0x7f0b12=_0x7f0b12||0xcc;return function(_0x1a5b16){if(_0x1a5b16){return _0x179645[_0x0025('0xc')](_0x7f0b12);}return _0x179645[_0x0025('0xd')](_0x7f0b12)['end']();};}function respondWithResult(_0x4c91b1,_0x19d767){_0x19d767=_0x19d767||0xc8;return function(_0x78227b){if(_0x78227b){return _0x4c91b1[_0x0025('0xd')](_0x19d767)['json'](_0x78227b);}};}function respondWithFilteredResult(_0x230be7,_0x140351){return function(_0x57c12d){if(_0x57c12d){var _0x43bf58=typeof _0x140351['offset']===_0x0025('0xe')&&typeof _0x140351['limit']===_0x0025('0xe');var _0x3d8a43=_0x57c12d[_0x0025('0xf')];var _0x55431d=_0x43bf58?0x0:_0x140351['offset'];var _0x3213f9=_0x43bf58?_0x57c12d[_0x0025('0xf')]:_0x140351[_0x0025('0x10')]+_0x140351[_0x0025('0x11')];var _0x5591c9;if(_0x3213f9>=_0x3d8a43){_0x3213f9=_0x3d8a43;_0x5591c9=0xc8;}else{_0x5591c9=0xce;}_0x230be7['status'](_0x5591c9);return _0x230be7[_0x0025('0x12')](_0x0025('0x13'),_0x55431d+'-'+_0x3213f9+'/'+_0x3d8a43)[_0x0025('0x14')](_0x57c12d);}return null;};}function saveUpdates(_0x28f68a){return function(_0xfef28c){if(_0xfef28c){return _0xfef28c['update'](_0x28f68a)[_0x0025('0x15')](function(_0x334b83){return _0x334b83;});}return null;};}function removeEntity(_0x4b69be){return function(_0x164d7f){if(_0x164d7f){return _0x164d7f[_0x0025('0x16')]()['then'](function(){_0x4b69be['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x502328){return function(_0x1efda1){if(!_0x1efda1){_0x502328[_0x0025('0xc')](0x194);}return _0x1efda1;};}function handleError(_0x2b28ec,_0x4fc25f){_0x4fc25f=_0x4fc25f||0x1f4;return function(_0x122db5){logger[_0x0025('0x17')](_0x122db5[_0x0025('0x18')]);if(_0x122db5[_0x0025('0x19')]){delete _0x122db5[_0x0025('0x19')];}_0x2b28ec[_0x0025('0xd')](_0x4fc25f)['send'](_0x122db5);};}function maskClientSecret(_0x3603c9){return _['padEnd'](_0x3603c9['slice'](0x0,0x3),0x14,'*');}exports[_0x0025('0x1a')]=function(_0x3fa617,_0x4b5759){var _0x4a5871={},_0x553931={},_0x4710aa={'count':0x0,'rows':[]};var _0x1c28e7=_['map'](db[_0x0025('0x1b')][_0x0025('0x1c')],function(_0x566bed){return{'name':_0x566bed[_0x0025('0x1d')],'type':_0x566bed[_0x0025('0x1e')][_0x0025('0x1f')]};});_0x553931[_0x0025('0x20')]=_[_0x0025('0x21')](_0x1c28e7,_0x0025('0x19'));_0x553931[_0x0025('0x22')]=_[_0x0025('0x23')](_0x3fa617[_0x0025('0x22')]);_0x553931[_0x0025('0x24')]=_[_0x0025('0x25')](_0x553931[_0x0025('0x20')],_0x553931[_0x0025('0x22')]);_0x4a5871['attributes']=_[_0x0025('0x25')](_0x553931[_0x0025('0x20')],qs[_0x0025('0x26')](_0x3fa617[_0x0025('0x22')]['fields']));_0x4a5871['attributes']=_0x4a5871[_0x0025('0x27')][_0x0025('0x28')]?_0x4a5871['attributes']:_0x553931[_0x0025('0x20')];if(!_0x3fa617[_0x0025('0x22')][_0x0025('0x29')](_0x0025('0x2a'))){_0x4a5871[_0x0025('0x11')]=qs[_0x0025('0x11')](_0x3fa617[_0x0025('0x22')]['limit']);_0x4a5871['offset']=qs[_0x0025('0x10')](_0x3fa617[_0x0025('0x22')][_0x0025('0x10')]);}_0x4a5871[_0x0025('0x2b')]=qs[_0x0025('0x2c')](_0x3fa617[_0x0025('0x22')][_0x0025('0x2c')]);_0x4a5871[_0x0025('0x2d')]=qs['filters'](_['pick'](_0x3fa617['query'],_0x553931[_0x0025('0x24')]),_0x1c28e7);if(_0x3fa617[_0x0025('0x22')][_0x0025('0x2e')]){_0x4a5871[_0x0025('0x2d')]=_['merge'](_0x4a5871[_0x0025('0x2d')],{'$or':_[_0x0025('0x21')](_0x1c28e7,function(_0x5ea79b){if(_0x5ea79b[_0x0025('0x1e')]!==_0x0025('0x2f')){var _0x4501f2={};_0x4501f2[_0x5ea79b[_0x0025('0x19')]]={'$like':'%'+_0x3fa617[_0x0025('0x22')][_0x0025('0x2e')]+'%'};return _0x4501f2;}})});}_0x4a5871=_[_0x0025('0x30')]({},_0x4a5871,_0x3fa617[_0x0025('0x31')]);var _0x546729={'where':_0x4a5871[_0x0025('0x2d')]};return db[_0x0025('0x1b')][_0x0025('0xf')](_0x546729)['then'](function(_0x57fd4f){_0x4710aa[_0x0025('0xf')]=_0x57fd4f;if(_0x3fa617[_0x0025('0x22')][_0x0025('0x32')]){_0x4a5871[_0x0025('0x33')]=[{'all':!![]}];}return db[_0x0025('0x1b')]['findAll'](_0x4a5871);})[_0x0025('0x15')](function(_0xc2c664){_0x4710aa[_0x0025('0x34')]=_['map'](_0xc2c664,function(_0x6fb111){if(_0x6fb111[_0x0025('0x35')]==='MicrosoftAzure'){var _0x4bd664=encryptor[_0x0025('0x36')](_0x6fb111[_0x0025('0x37')]);_0x6fb111['data3']=maskClientSecret(_0x4bd664);}return _0x6fb111;});return _0x4710aa;})[_0x0025('0x15')](respondWithFilteredResult(_0x4b5759,_0x4a5871))['catch'](handleError(_0x4b5759,null));};exports[_0x0025('0x38')]=function(_0x5102fb,_0x5ab125){var _0x1bd7a6={'raw':!![],'where':{'id':_0x5102fb[_0x0025('0x39')]['id']}},_0x562226={};_0x562226['model']=_[_0x0025('0x23')](db[_0x0025('0x1b')][_0x0025('0x1c')]);_0x562226['query']=_[_0x0025('0x23')](_0x5102fb[_0x0025('0x22')]);_0x562226['filters']=_['intersection'](_0x562226[_0x0025('0x20')],_0x562226[_0x0025('0x22')]);_0x1bd7a6[_0x0025('0x27')]=_[_0x0025('0x25')](_0x562226[_0x0025('0x20')],qs[_0x0025('0x26')](_0x5102fb[_0x0025('0x22')][_0x0025('0x26')]));_0x1bd7a6['attributes']=_0x1bd7a6[_0x0025('0x27')][_0x0025('0x28')]?_0x1bd7a6[_0x0025('0x27')]:_0x562226[_0x0025('0x20')];if(_0x5102fb[_0x0025('0x22')][_0x0025('0x32')]){_0x1bd7a6['include']=[{'all':!![]}];}_0x1bd7a6=_[_0x0025('0x30')]({},_0x1bd7a6,_0x5102fb['options']);return db['CloudProvider'][_0x0025('0x3a')](_0x1bd7a6)[_0x0025('0x15')](handleEntityNotFound(_0x5ab125,null))[_0x0025('0x15')](function(_0x4594b1){if(_0x4594b1[_0x0025('0x35')]===_0x0025('0x3b')){var _0x5e2fb1=encryptor[_0x0025('0x36')](_0x4594b1[_0x0025('0x37')]);_0x4594b1[_0x0025('0x37')]=maskClientSecret(_0x5e2fb1);}return _0x4594b1;})[_0x0025('0x15')](respondWithResult(_0x5ab125,null))[_0x0025('0x3c')](handleError(_0x5ab125,null));};exports[_0x0025('0x3d')]=function(_0x4bd28b,_0x584f57){if(!_0x4bd28b[_0x0025('0x3e')]['name'])throw new Error(_0x0025('0x3f'));if(!_0x4bd28b[_0x0025('0x3e')][_0x0025('0x35')])throw new Error(_0x0025('0x40'));var _0x1a7d7b=db[_0x0025('0x1b')][_0x0025('0x1c')][_0x0025('0x35')][_0x0025('0x41')];if(!_0x1a7d7b[_0x0025('0x42')](_0x4bd28b['body'][_0x0025('0x35')]))throw new Error(_0x0025('0x43')+_0x1a7d7b['join'](',\x20'));if(_0x4bd28b['body'][_0x0025('0x35')]===_0x0025('0x3b')&&_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]){_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]=encryptor[_0x0025('0x44')](_0x4bd28b[_0x0025('0x3e')][_0x0025('0x37')]);}return db[_0x0025('0x1b')][_0x0025('0x3d')](_0x4bd28b[_0x0025('0x3e')],{})[_0x0025('0x15')](respondWithResult(_0x584f57,0xc9))['catch'](handleError(_0x584f57,null));};exports[_0x0025('0x45')]=function(_0x561dda,_0x433dc7){if(_0x561dda['body']['id']){delete _0x561dda[_0x0025('0x3e')]['id'];}return db[_0x0025('0x1b')][_0x0025('0x3a')]({'where':{'id':_0x561dda[_0x0025('0x39')]['id']}})['then'](handleEntityNotFound(_0x433dc7,null))[_0x0025('0x15')](function(_0x1ebd69){if(_0x1ebd69[_0x0025('0x35')]===_0x0025('0x3b')&&_0x561dda[_0x0025('0x3e')][_0x0025('0x37')]){_0x561dda[_0x0025('0x3e')]['data3']=encryptor[_0x0025('0x44')](_0x561dda[_0x0025('0x3e')][_0x0025('0x37')]);}return _0x1ebd69;})[_0x0025('0x15')](saveUpdates(_0x561dda[_0x0025('0x3e')],null))[_0x0025('0x15')](respondWithResult(_0x433dc7,null))[_0x0025('0x3c')](handleError(_0x433dc7,null));};exports[_0x0025('0x16')]=function(_0x45e1e6,_0x113fea){return db[_0x0025('0x1b')]['find']({'where':{'id':_0x45e1e6[_0x0025('0x39')]['id']}})['then'](handleEntityNotFound(_0x113fea,null))['then'](removeEntity(_0x113fea,null))[_0x0025('0x3c')](handleError(_0x113fea,null));};exports[_0x0025('0x46')]=function(_0xcaeef4,_0x2772a5){return db['CloudProvider'][_0x0025('0x47')]({'where':{'id':_0xcaeef4['params']['id']},'raw':!![]})['then'](function(_0x375380){if(!_0x375380)return _0x2772a5[_0x0025('0xc')](0x194);return{'url':oauth[_0x0025('0x48')](_0x375380,_0xcaeef4[_0x0025('0x49')]['id'])};})['then'](respondWithResult(_0x2772a5,null))[_0x0025('0x3c')](handleError(_0x2772a5,null));};exports[_0x0025('0x4a')]=function(_0x326222,_0x24eb4f){var _0x14b60c=_0x326222[_0x0025('0x3e')];var _0x2a7c83;var _0x139829;if(_0x14b60c[_0x0025('0x17')])throw _0x14b60c;redis['get'](_0x14b60c[_0x0025('0x4b')])[_0x0025('0x15')](function(_0x444e38){if(!_0x444e38)throw new Error('Invalid\x20state\x20parameter');_0x2a7c83=JSON['parse'](_0x444e38);var _0x33655d=Buffer[_0x0025('0x4c')](_0x14b60c[_0x0025('0x4b')],_0x0025('0x4d'))[_0x0025('0x4e')]('ascii');_0x139829=JSON[_0x0025('0x4f')](_0x33655d);if(!oauth[_0x0025('0x50')](_0x14b60c['id_token'],_0x2a7c83[_0x0025('0x51')]))throw new Error('Unable\x20to\x20validate\x20id_token');redis['del'](_0x14b60c[_0x0025('0x4b')]);return oauth[_0x0025('0x52')](_0x14b60c[_0x0025('0x53')],_0x2a7c83);})['then'](function(_0x102c22){_0x2a7c83[_0x0025('0x54')]=_0x102c22['access_token'];_0x2a7c83['data6']=_0x102c22[_0x0025('0x55')];return db[_0x0025('0x1b')][_0x0025('0x45')]({'data5':_0x2a7c83[_0x0025('0x54')],'data6':_0x2a7c83[_0x0025('0x56')]},{'where':{'id':_0x2a7c83['id']}});})[_0x0025('0x15')](function(){oauth['startRefreshInterval'](_0x2a7c83);socket['emit'](_0x0025('0x57'),{'id':_0x139829['id']});return;})['then'](respondWithStatusCode(_0x24eb4f,null))['catch'](function(_0x52426f){if(_0x139829){socket[_0x0025('0x58')]('microsoftAuthorization:error',{'id':_0x139829['id']});}if(!_0x2a7c83){logger[_0x0025('0x17')](_0x0025('0x59'),_0x52426f);return _0x24eb4f[_0x0025('0xd')](0x1f4)[_0x0025('0x5a')](_0x52426f[_0x0025('0x5b')]);}logger[_0x0025('0x17')](_0x0025('0x5c'),_0x2a7c83['id'],_0x52426f);});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 2e3cdcf..3d78596 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 _0xb836=['path','rimraf','../../config/environment','exports','CloudProvider','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3bd751,_0x1e89f7){var _0x2c4eb4=function(_0x506f73){while(--_0x506f73){_0x3bd751['push'](_0x3bd751['shift']());}};_0x2c4eb4(++_0x1e89f7);}(_0xb836,0xb5));var _0x6b83=function(_0x590661,_0x4608f1){_0x590661=_0x590661-0x0;var _0x46efb8=_0xb836[_0x590661];return _0x46efb8;};'use strict';var _=require('lodash');var util=require(_0x6b83('0x0'));var logger=require(_0x6b83('0x1'))(_0x6b83('0x2'));var moment=require(_0x6b83('0x3'));var BPromise=require(_0x6b83('0x4'));var rp=require(_0x6b83('0x5'));var fs=require('fs');var path=require(_0x6b83('0x6'));var rimraf=require(_0x6b83('0x7'));var config=require(_0x6b83('0x8'));var attributes=require('./cloudProvider.attributes');module[_0x6b83('0x9')]=function(_0xcb5385,_0x2682d2){return _0xcb5385['define'](_0x6b83('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x137d=['request-promise','../../config/environment','./cloudProvider.attributes','exports','define','lodash','util','../../config/logger','api','bluebird'];(function(_0x3df186,_0x12592c){var _0x5440fc=function(_0x2a7a70){while(--_0x2a7a70){_0x3df186['push'](_0x3df186['shift']());}};_0x5440fc(++_0x12592c);}(_0x137d,0x73));var _0xd137=function(_0x546895,_0xb414da){_0x546895=_0x546895-0x0;var _0x3b5a09=_0x137d[_0x546895];return _0x3b5a09;};'use strict';var _=require(_0xd137('0x0'));var util=require(_0xd137('0x1'));var logger=require(_0xd137('0x2'))(_0xd137('0x3'));var moment=require('moment');var BPromise=require(_0xd137('0x4'));var rp=require(_0xd137('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd137('0x6'));var attributes=require(_0xd137('0x7'));module[_0xd137('0x8')]=function(_0x573141,_0x109c67){return _0x573141[_0xd137('0x9')]('CloudProvider',attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js index fe6d177..bd14256 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 _0xdd14=['key','value','oauth2Claims','set','stringify','payload','issuer','aud','audience','isAfter','unix','exp','resolve','then','data6','findOne','refresh_token','access_token','CloudProvider','data5','authorization_code','data3','intervals','bind','findAll','all','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart','exports','jsonwebtoken','request-promise','util','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','/authorize','type','data7','/.default','join','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','toString','base64','randomBytes','hex','client_id','data1','data4','form_post','nonce','prompt','login','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdd14,0xec));var _0x4dd1=function(_0x4cb801,_0x10e577){_0x4cb801=_0x4cb801-0x0;var _0x5ad676=_0xdd14[_0x4cb801];return _0x5ad676;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x4dd1('0x0'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x4dd1('0x1'));var util=require(_0x4dd1('0x2'));var config=require(_0x4dd1('0x3'));var logger=require(_0x4dd1('0x4'))(_0x4dd1('0x5'));var schedule=require(_0x4dd1('0x6'));var db=require(_0x4dd1('0x7'))['db'];config['redis']=_[_0x4dd1('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x4dd1('0x9')]);var MICROSOFT_AUTH_URL=_0x4dd1('0xa');var AZURE_AUTH_SCOPES={'Outlook365':[_0x4dd1('0xb'),'profile',_0x4dd1('0xc'),_0x4dd1('0xd'),_0x4dd1('0xe'),_0x4dd1('0xf'),'https://outlook.office.com/SMTP.Send'],'Dynamics365':[_0x4dd1('0xb'),_0x4dd1('0xd')]};var MICROSOFT_AUTH_ENDPOINT=_0x4dd1('0x10');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4e46fa){var _0x225d0a=_['map'](AZURE_AUTH_SCOPES[_0x4e46fa[_0x4dd1('0x11')]]);if(_0x4e46fa['type']==='Dynamics365')_0x225d0a['push'](_0x4e46fa[_0x4dd1('0x12')]+_0x4dd1('0x13'));return _0x225d0a[_0x4dd1('0x14')]('\x20');}function getAccessTokenScope(_0x72b4e9){if(_0x72b4e9[_0x4dd1('0x11')]==='Outlook365')return _0x4dd1('0xe');if(_0x72b4e9[_0x4dd1('0x11')]===_0x4dd1('0x15'))return _0x72b4e9['data7']+_0x4dd1('0x13');}function generateMicrosoftAuthorizationUrl(_0x4487ca,_0x247c98){var _0x3e0a3b=MICROSOFT_AUTH_URL[_0x4dd1('0x16')](_0x4dd1('0x17'),_0x4487ca[_0x4dd1('0x18')]);var _0x2ab58c=[_0x4dd1('0x19'),_0x4dd1('0x1a')];var _0x328c29=Buffer[_0x4dd1('0x1b')](JSON['stringify']({'id':_0x247c98}))[_0x4dd1('0x1c')](_0x4dd1('0x1d'));var _0x4bf989=crypto[_0x4dd1('0x1e')](0x10)['toString'](_0x4dd1('0x1f'));var _0x377eb4=getAuthorizationScopes(_0x4487ca);var _0x4e6f21=[{'key':_0x4dd1('0x20'),'value':_0x4487ca[_0x4dd1('0x21')]},{'key':'response_type','value':encodeURIComponent(_0x2ab58c[_0x4dd1('0x14')]('\x20'))},{'key':'redirect_uri','value':_0x4487ca[_0x4dd1('0x22')]},{'key':'response_mode','value':_0x4dd1('0x23')},{'key':'scope','value':encodeURIComponent(_0x377eb4)},{'key':'state','value':_0x328c29},{'key':_0x4dd1('0x24'),'value':_0x4bf989},{'key':_0x4dd1('0x25'),'value':_0x4dd1('0x26')}];var _0xd8b01c=_0x3e0a3b+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4dd1('0x27')](_0x4e6f21,function(_0x8f45fc){return _0x8f45fc[_0x4dd1('0x28')]+'='+_0x8f45fc[_0x4dd1('0x29')];})[_0x4dd1('0x14')]('&');_0x4487ca[_0x4dd1('0x2a')]={'issuer':_0x3e0a3b['replace']('oauth2/',''),'audience':_0x4487ca['data1'],'state':_0x328c29,'nonce':_0x4bf989};redis[_0x4dd1('0x2b')](_0x328c29,JSON[_0x4dd1('0x2c')](_0x4487ca));return _0xd8b01c;}function isValidIdToken(_0xe79a92,_0x5f1056){try{var _0x251d2c=jwt['decode'](_0xe79a92,{'complete':!![]});var _0x6f4ad5=_0x251d2c[_0x4dd1('0x2d')];if(_0x6f4ad5['iss']!==_0x5f1056[_0x4dd1('0x2e')])return![];if(_0x6f4ad5[_0x4dd1('0x2f')]!==_0x5f1056[_0x4dd1('0x30')])return![];if(_0x6f4ad5['nonce']!==_0x5f1056['nonce'])return![];if(moment()[_0x4dd1('0x31')](moment[_0x4dd1('0x32')](_0x6f4ad5[_0x4dd1('0x33')])))return![];return!![];}catch(_0x398353){throw _0x398353;}}function refreshOauth2MicrosoftAccessToken(_0x94e0b0){return Promise[_0x4dd1('0x34')]()[_0x4dd1('0x35')](function(){if(_0x94e0b0[_0x4dd1('0x36')])return _0x94e0b0;return db['CloudProvider'][_0x4dd1('0x37')]({'where':{'id':_0x94e0b0['id']},'raw':!![]});})[_0x4dd1('0x35')](function(_0x19aba7){var _0x2d6e50={'grant_type':_0x4dd1('0x38'),'refresh_token':_0x19aba7['data6'],'scope':getAccessTokenScope(_0x19aba7),'redirect_uri':_0x19aba7[_0x4dd1('0x22')],'client_id':_0x19aba7[_0x4dd1('0x21')],'client_secret':_0x19aba7['data3']};var _0x43108c={'method':'POST','uri':MICROSOFT_AUTH_URL['replace'](_0x4dd1('0x17'),_0x19aba7[_0x4dd1('0x18')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2d6e50,'json':!![]};return rp(_0x43108c);})['then'](function(_0x37c098){_0x94e0b0['data5']=_0x37c098[_0x4dd1('0x39')];_0x94e0b0[_0x4dd1('0x36')]=_0x37c098[_0x4dd1('0x38')];return db[_0x4dd1('0x3a')]['update']({'data5':_0x94e0b0[_0x4dd1('0x3b')],'data6':_0x94e0b0[_0x4dd1('0x36')]},{'where':{'id':_0x94e0b0['id']}});})[_0x4dd1('0x35')](function(){return _0x94e0b0;})['catch'](function(_0x1cb14a){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s',_0x94e0b0['id'],_0x1cb14a);});}function getOauth2MicrosoftAccessToken(_0x2b9af7,_0x5337ed){var _0x542ca5={'grant_type':_0x4dd1('0x3c'),'code':_0x2b9af7,'scope':getAccessTokenScope(_0x5337ed),'redirect_uri':_0x5337ed[_0x4dd1('0x22')],'client_id':_0x5337ed['data1'],'client_secret':_0x5337ed[_0x4dd1('0x3d')]};var _0x2da528={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x4dd1('0x16')]('{TENANT_ID}',_0x5337ed['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x542ca5,'json':!![]};return rp(_0x2da528);}function startRefreshInterval(_0x7a799){var _0x4c92a0=schedule[_0x4dd1('0x3e')];if(_0x4c92a0[_0x7a799['id']])clearInterval(_0x4c92a0[_0x7a799['id']]);_0x4c92a0[_0x7a799['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x4dd1('0x3f')](this,{'id':_0x7a799['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4dd1('0x3e')]=_0x4c92a0;}function startAllRefreshIntervals(){return db[_0x4dd1('0x3a')][_0x4dd1('0x40')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4dd1('0x35')](function(_0x1c07de){var _0x2afeaf=_0x1c07de[_0x4dd1('0x27')](function(_0x5039ed){return refreshOauth2MicrosoftAccessToken(_0x5039ed)[_0x4dd1('0x35')](function(_0x6a1ef4){startRefreshInterval(_0x6a1ef4);});});return Promise[_0x4dd1('0x41')](_0x2afeaf);})['catch'](function(_0x1cdc16){var _0x4044b6=_0x1cdc16?util['inspect'](_0x1cdc16,{'showHidden':![],'depth':null}):'';logger[_0x4dd1('0x42')](_0x4dd1('0x43'),_0x4044b6);});}module[_0x4dd1('0x44')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval}; \ No newline at end of file +var _0xc817=['toString','base64','randomBytes','hex','client_id','data1','redirect_uri','data4','response_mode','scope','state','login','key','oauth2Claims','set','iss','aud','audience','nonce','isAfter','unix','then','data6','CloudProvider','findOne','refresh_token','data3','POST','data2','data5','access_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s','decryptString','intervals','bind','findAll','all','inspect','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','replace','{TENANT_ID}','code','id_token','stringify'];(function(_0x3e2fcf,_0x579110){var _0x497db7=function(_0x2f713d){while(--_0x2f713d){_0x3e2fcf['push'](_0x3e2fcf['shift']());}};_0x497db7(++_0x579110);}(_0xc817,0x75));var _0x7c81=function(_0x4b0b47,_0x25b713){_0x4b0b47=_0x4b0b47-0x0;var _0x371616=_0xc817[_0x4b0b47];return _0x371616;};'use strict';var _=require(_0x7c81('0x0'));var crypto=require(_0x7c81('0x1'));var jwt=require(_0x7c81('0x2'));var moment=require(_0x7c81('0x3'));var Redis=require('ioredis');var rp=require(_0x7c81('0x4'));var util=require(_0x7c81('0x5'));var encryptor=require(_0x7c81('0x6'));var config=require(_0x7c81('0x7'));var logger=require(_0x7c81('0x8'))(_0x7c81('0x9'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x7c81('0xa'))['db'];config[_0x7c81('0xb')]=_['defaults'](config[_0x7c81('0xb')],{'host':_0x7c81('0xc'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x7c81('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0x7c81('0xe'),_0x7c81('0xf'),_0x7c81('0x10'),_0x7c81('0x11'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x7c81('0x12'),_0x7c81('0x13')],'Dynamics365':[_0x7c81('0xe'),_0x7c81('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0x7c81('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0x7c81('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x1f8f50){var _0x17f3ad=_[_0x7c81('0x16')](AZURE_AUTH_SCOPES[_0x1f8f50[_0x7c81('0x17')]]);if(_0x1f8f50[_0x7c81('0x17')]===_0x7c81('0x18'))_0x17f3ad[_0x7c81('0x19')](_0x1f8f50[_0x7c81('0x1a')]+_0x7c81('0x1b'));return _0x17f3ad[_0x7c81('0x1c')]('\x20');}function getAccessTokenScope(_0x9362c4){if(_0x9362c4[_0x7c81('0x17')]===_0x7c81('0x1d'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x9362c4[_0x7c81('0x17')]===_0x7c81('0x18'))return _0x9362c4[_0x7c81('0x1a')]+_0x7c81('0x1b');}function generateMicrosoftAuthorizationUrl(_0x3b36c9,_0x11e06f){var _0x46a745=MICROSOFT_AUTH_URL[_0x7c81('0x1e')](_0x7c81('0x1f'),_0x3b36c9['data2']);var _0x14cce5=[_0x7c81('0x20'),_0x7c81('0x21')];var _0x182a2e=Buffer['from'](JSON[_0x7c81('0x22')]({'id':_0x11e06f}))[_0x7c81('0x23')](_0x7c81('0x24'));var _0x2c15fd=crypto[_0x7c81('0x25')](0x10)['toString'](_0x7c81('0x26'));var _0x1a9cee=getAuthorizationScopes(_0x3b36c9);var _0x15fecb=[{'key':_0x7c81('0x27'),'value':_0x3b36c9[_0x7c81('0x28')]},{'key':'response_type','value':encodeURIComponent(_0x14cce5[_0x7c81('0x1c')]('\x20'))},{'key':_0x7c81('0x29'),'value':_0x3b36c9[_0x7c81('0x2a')]},{'key':_0x7c81('0x2b'),'value':'form_post'},{'key':_0x7c81('0x2c'),'value':encodeURIComponent(_0x1a9cee)},{'key':_0x7c81('0x2d'),'value':_0x182a2e},{'key':'nonce','value':_0x2c15fd},{'key':'prompt','value':_0x7c81('0x2e')}];var _0x4d64f6=_0x46a745+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x15fecb,function(_0x587614){return _0x587614[_0x7c81('0x2f')]+'='+_0x587614['value'];})[_0x7c81('0x1c')]('&');_0x3b36c9[_0x7c81('0x30')]={'issuer':_0x46a745[_0x7c81('0x1e')]('oauth2/',''),'audience':_0x3b36c9[_0x7c81('0x28')],'state':_0x182a2e,'nonce':_0x2c15fd};redis[_0x7c81('0x31')](_0x182a2e,JSON[_0x7c81('0x22')](_0x3b36c9));return _0x4d64f6;}function isValidIdToken(_0x26e2bc,_0x1645bf){try{var _0x4131b6=jwt['decode'](_0x26e2bc,{'complete':!![]});var _0x2e6024=_0x4131b6['payload'];if(_0x2e6024[_0x7c81('0x32')]!==_0x1645bf['issuer'])return![];if(_0x2e6024[_0x7c81('0x33')]!==_0x1645bf[_0x7c81('0x34')])return![];if(_0x2e6024[_0x7c81('0x35')]!==_0x1645bf['nonce'])return![];if(moment()[_0x7c81('0x36')](moment[_0x7c81('0x37')](_0x2e6024['exp'])))return![];return!![];}catch(_0x1dba1d){throw _0x1dba1d;}}function refreshOauth2MicrosoftAccessToken(_0x50f6fb){return Promise['resolve']()[_0x7c81('0x38')](function(){if(_0x50f6fb[_0x7c81('0x39')])return _0x50f6fb;return db[_0x7c81('0x3a')][_0x7c81('0x3b')]({'where':{'id':_0x50f6fb['id']},'raw':!![]});})[_0x7c81('0x38')](function(_0x27d86f){var _0x46e553={'grant_type':_0x7c81('0x3c'),'refresh_token':_0x27d86f['data6'],'scope':getAccessTokenScope(_0x27d86f),'redirect_uri':_0x27d86f[_0x7c81('0x2a')],'client_id':_0x27d86f[_0x7c81('0x28')],'client_secret':encryptor['decryptString'](_0x27d86f[_0x7c81('0x3d')])};var _0xde4bdd={'method':_0x7c81('0x3e'),'uri':MICROSOFT_AUTH_URL['replace'](_0x7c81('0x1f'),_0x27d86f[_0x7c81('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x46e553,'json':!![]};return rp(_0xde4bdd);})[_0x7c81('0x38')](function(_0x34ae2e){_0x50f6fb[_0x7c81('0x40')]=_0x34ae2e[_0x7c81('0x41')];_0x50f6fb[_0x7c81('0x39')]=_0x34ae2e[_0x7c81('0x3c')];return db[_0x7c81('0x3a')][_0x7c81('0x42')]({'data5':_0x50f6fb[_0x7c81('0x40')],'data6':_0x50f6fb[_0x7c81('0x39')]},{'where':{'id':_0x50f6fb['id']}});})[_0x7c81('0x38')](function(){return _0x50f6fb;})['catch'](function(_0x33717e){logger[_0x7c81('0x43')](_0x7c81('0x44'),_0x50f6fb['id'],_0x33717e);});}function getOauth2MicrosoftAccessToken(_0x30e121,_0xc4ec93){var _0x4f5599={'grant_type':'authorization_code','code':_0x30e121,'scope':getAccessTokenScope(_0xc4ec93),'redirect_uri':_0xc4ec93[_0x7c81('0x2a')],'client_id':_0xc4ec93[_0x7c81('0x28')],'client_secret':encryptor[_0x7c81('0x45')](_0xc4ec93[_0x7c81('0x3d')])};var _0x8586f5={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x7c81('0x1e')](_0x7c81('0x1f'),_0xc4ec93[_0x7c81('0x3f')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4f5599,'json':!![]};return rp(_0x8586f5);}function startRefreshInterval(_0x5b2d87){var _0x2266a4=schedule[_0x7c81('0x46')];if(_0x2266a4[_0x5b2d87['id']])clearInterval(_0x2266a4[_0x5b2d87['id']]);_0x2266a4[_0x5b2d87['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x7c81('0x47')](this,{'id':_0x5b2d87['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x2266a4;}function startAllRefreshIntervals(){return db[_0x7c81('0x3a')][_0x7c81('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x63f22c){var _0x1b27da=_0x63f22c[_0x7c81('0x16')](function(_0x12873b){return refreshOauth2MicrosoftAccessToken(_0x12873b)['then'](function(_0x21af47){startRefreshInterval(_0x21af47);});});return Promise[_0x7c81('0x49')](_0x1b27da);})['catch'](function(_0x1a10ee){var _0x2cd932=_0x1a10ee?util[_0x7c81('0x4a')](_0x1a10ee,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart',_0x2cd932);});}module[_0x7c81('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 873208e..5ca9add 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 _0x1c63=['error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x285824,_0x3da647){var _0x311d7e=function(_0x2f3de0){while(--_0x2f3de0){_0x285824['push'](_0x285824['shift']());}};_0x311d7e(++_0x3da647);}(_0x1c63,0xdc));var _0x31c6=function(_0x10d405,_0x28d136){_0x10d405=_0x10d405-0x0;var _0x12bd98=_0x1c63[_0x10d405];return _0x12bd98;};'use strict';var _=require(_0x31c6('0x0'));var util=require(_0x31c6('0x1'));var moment=require(_0x31c6('0x2'));var BPromise=require(_0x31c6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x31c6('0x4'));var db=require(_0x31c6('0x5'))['db'];var utils=require(_0x31c6('0x6'));var logger=require('../../config/logger')(_0x31c6('0x7'));var config=require(_0x31c6('0x8'));var jayson=require(_0x31c6('0x9'));var client=jayson[_0x31c6('0xa')][_0x31c6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ac1b7,_0x560053,_0x30185e){return new BPromise(function(_0x184d7d,_0x37cc89){return client[_0x31c6('0xc')](_0x4ac1b7,_0x30185e)[_0x31c6('0xd')](function(_0x487e6e){logger[_0x31c6('0xe')](_0x31c6('0xf'),_0x560053,_0x31c6('0x10'));logger[_0x31c6('0x11')](_0x31c6('0x12'),_0x560053,'request\x20sent',JSON[_0x31c6('0x13')](_0x487e6e));if(_0x487e6e['error']){if(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x15')]===0x1f4){logger['error'](_0x31c6('0xf'),_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x37cc89(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}logger[_0x31c6('0x14')]('CloudProvider,\x20%s,\x20%s',_0x560053,_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);return _0x184d7d(_0x487e6e[_0x31c6('0x14')][_0x31c6('0x16')]);}else{logger[_0x31c6('0xe')]('CloudProvider,\x20%s,\x20%s',_0x560053,'request\x20sent');_0x184d7d(_0x487e6e['result']['message']);}})[_0x31c6('0x17')](function(_0x512d53){logger[_0x31c6('0x14')](_0x31c6('0xf'),_0x560053,_0x512d53);_0x37cc89(_0x512d53);});});} \ No newline at end of file +var _0xaa56=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1bb7cd,_0x2706f8){var _0x52c493=function(_0xad581b){while(--_0xad581b){_0x1bb7cd['push'](_0x1bb7cd['shift']());}};_0x52c493(++_0x2706f8);}(_0xaa56,0xc6));var _0x6aa5=function(_0x337939,_0x42513b){_0x337939=_0x337939-0x0;var _0x5bcbc1=_0xaa56[_0x337939];return _0x5bcbc1;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var moment=require(_0x6aa5('0x1'));var BPromise=require(_0x6aa5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6aa5('0x3'));var db=require(_0x6aa5('0x4'))['db'];var utils=require(_0x6aa5('0x5'));var logger=require(_0x6aa5('0x6'))(_0x6aa5('0x7'));var config=require('../../config/environment');var jayson=require(_0x6aa5('0x8'));var client=jayson['client'][_0x6aa5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20f6ba,_0x5764dc,_0x26fbf5){return new BPromise(function(_0x35dbbc,_0x3a77bb){return client[_0x6aa5('0xa')](_0x20f6ba,_0x26fbf5)[_0x6aa5('0xb')](function(_0x3d50a0){logger[_0x6aa5('0xc')](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));logger[_0x6aa5('0xf')](_0x6aa5('0x10'),_0x5764dc,_0x6aa5('0xe'),JSON[_0x6aa5('0x11')](_0x3d50a0));if(_0x3d50a0[_0x6aa5('0x12')]){if(_0x3d50a0['error'][_0x6aa5('0x13')]===0x1f4){logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x3a77bb(_0x3d50a0['error']['message']);}logger[_0x6aa5('0x12')](_0x6aa5('0xd'),_0x5764dc,_0x3d50a0[_0x6aa5('0x12')]['message']);return _0x35dbbc(_0x3d50a0[_0x6aa5('0x12')][_0x6aa5('0x14')]);}else{logger['info'](_0x6aa5('0xd'),_0x5764dc,_0x6aa5('0xe'));_0x35dbbc(_0x3d50a0[_0x6aa5('0x15')][_0x6aa5('0x14')]);}})['catch'](function(_0x5e5951){logger[_0x6aa5('0x12')]('CloudProvider,\x20%s,\x20%s',_0x5764dc,_0x5e5951);_0x3a77bb(_0x5e5951);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 8f6f383..64d60df 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x32b0de,_0x36ef41){var _0x40553d=function(_0x34091c){while(--_0x34091c){_0x32b0de['push'](_0x32b0de['shift']());}};_0x40553d(++_0x36ef41);}(_0xdb28,0x106));var _0x8db2=function(_0x211693,_0x4790f5){_0x211693=_0x211693-0x0;var _0x5e7603=_0xdb28[_0x211693];return _0x5e7603;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router; \ No newline at end of file +var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x2784b4,_0x444971){var _0x3390c0=function(_0x176372){while(--_0x176372){_0x2784b4['push'](_0x2784b4['shift']());}};_0x3390c0(++_0x444971);}(_0x2ef3,0xba));var _0x32ef=function(_0x2c850b,_0x38f84a){_0x2c850b=_0x2c850b-0x0;var _0x10fa82=_0x2ef3[_0x2c850b];return _0x10fa82;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 43a9caa..41ce49c 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 _0xb82a=['STRING','name','sequelize','exports'];(function(_0x23839b,_0x54349c){var _0xa88c41=function(_0x296045){while(--_0x296045){_0x23839b['push'](_0x23839b['shift']());}};_0xa88c41(++_0x54349c);}(_0xb82a,0x82));var _0xab82=function(_0xd8def1,_0x422c53){_0xd8def1=_0xd8def1-0x0;var _0x313c3b=_0xb82a[_0xd8def1];return _0x313c3b;};'use strict';var Sequelize=require(_0xab82('0x0'));module[_0xab82('0x1')]={'name':{'type':Sequelize[_0xab82('0x2')],'unique':_0xab82('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xab82('0x2')]},'phone':{'type':Sequelize[_0xab82('0x2')]},'fax':{'type':Sequelize[_0xab82('0x2')]},'type':{'type':Sequelize[_0xab82('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xab82('0x2')]},'city':{'type':Sequelize[_0xab82('0x2')]},'country':{'type':Sequelize[_0xab82('0x2')]},'email':{'type':Sequelize[_0xab82('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xab82('0x2')]},'sStreet':{'type':Sequelize[_0xab82('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xab82('0x2')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa4f9=['exports','name','STRING','sequelize'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xa4f9,0x1cf));var _0x9a4f=function(_0x509e75,_0x36f68e){_0x509e75=_0x509e75-0x0;var _0x368c1b=_0xa4f9[_0x509e75];return _0x368c1b;};'use strict';var Sequelize=require(_0x9a4f('0x0'));module[_0x9a4f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9a4f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9a4f('0x3')]},'companyId':{'type':Sequelize[_0x9a4f('0x3')]},'website':{'type':Sequelize[_0x9a4f('0x3')]},'phone':{'type':Sequelize[_0x9a4f('0x3')]},'fax':{'type':Sequelize[_0x9a4f('0x3')]},'type':{'type':Sequelize[_0x9a4f('0x3')]},'street':{'type':Sequelize[_0x9a4f('0x3')]},'postalCode':{'type':Sequelize[_0x9a4f('0x3')]},'city':{'type':Sequelize[_0x9a4f('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9a4f('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x9a4f('0x3')]},'sStreet':{'type':Sequelize[_0x9a4f('0x3')]},'sPostalCode':{'type':Sequelize[_0x9a4f('0x3')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x9a4f('0x3')]},'description':{'type':Sequelize[_0x9a4f('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index e83d289..af45544 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 _0x069b=['path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','Companies','end','error','stack','name','CmCompany','describe','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','addContacts','CmContact','ids','omit','getContacts','findOne','eml-format','zip-dir','request-promise','moment','mustache','util'];(function(_0xd48d4f,_0x217178){var _0x59d47b=function(_0x4780b1){while(--_0x4780b1){_0xd48d4f['push'](_0xd48d4f['shift']());}};_0x59d47b(++_0x217178);}(_0x069b,0xf9));var _0xb069=function(_0x24bc0c,_0x57243d){_0x24bc0c=_0x24bc0c-0x0;var _0x363ea1=_0x069b[_0x24bc0c];return _0x363ea1;};'use strict';var emlformat=require(_0xb069('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb069('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb069('0x2'));var moment=require(_0xb069('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb069('0x4'));var util=require(_0xb069('0x5'));var path=require(_0xb069('0x6'));var sox=require(_0xb069('0x7'));var csv=require(_0xb069('0x8'));var ejs=require(_0xb069('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb069('0xa'));var squel=require(_0xb069('0xb'));var crypto=require(_0xb069('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb069('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb069('0xe'));var Papa=require(_0xb069('0xf'));var Redis=require(_0xb069('0x10'));var authService=require(_0xb069('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb069('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb069('0x13'))(_0xb069('0x14'));var utils=require(_0xb069('0x15'));var config=require(_0xb069('0x16'));var licenseUtil=require(_0xb069('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7a345e,_0x2480c1){_0x2480c1=_0x2480c1||0xcc;return function(_0x4691bf){if(_0x4691bf){return _0x7a345e[_0xb069('0x18')](_0x2480c1);}return _0x7a345e['status'](_0x2480c1)['end']();};}function respondWithResult(_0x45d74a,_0x54a4dc){_0x54a4dc=_0x54a4dc||0xc8;return function(_0x55d799){if(_0x55d799){return _0x45d74a[_0xb069('0x19')](_0x54a4dc)[_0xb069('0x1a')](_0x55d799);}};}function respondWithFilteredResult(_0x10a3b6,_0x469422){return function(_0x468a88){if(_0x468a88){var _0x410258=typeof _0x469422[_0xb069('0x1b')]==='undefined'&&typeof _0x469422[_0xb069('0x1c')]===_0xb069('0x1d');var _0x1111d6=_0x468a88['count'];var _0x536b58=_0x410258?0x0:_0x469422['offset'];var _0x3656a9=_0x410258?_0x468a88[_0xb069('0x1e')]:_0x469422[_0xb069('0x1b')]+_0x469422[_0xb069('0x1c')];var _0x2254d7;if(_0x3656a9>=_0x1111d6){_0x3656a9=_0x1111d6;_0x2254d7=0xc8;}else{_0x2254d7=0xce;}_0x10a3b6['status'](_0x2254d7);return _0x10a3b6[_0xb069('0x1f')](_0xb069('0x20'),_0x536b58+'-'+_0x3656a9+'/'+_0x1111d6)[_0xb069('0x1a')](_0x468a88);}return null;};}function patchUpdates(_0x4a3f36){return function(_0x1a5b19){try{jsonpatch[_0xb069('0x21')](_0x1a5b19,_0x4a3f36,!![]);}catch(_0x4cf7c0){return BPromise['reject'](_0x4cf7c0);}return _0x1a5b19['save']();};}function saveUpdates(_0xa996e1,_0x388949){return function(_0x4b6c2e){if(_0x4b6c2e){return _0x4b6c2e[_0xb069('0x22')](_0xa996e1)[_0xb069('0x23')](function(_0x6fa42f){return _0x6fa42f;});}return null;};}function removeEntity(_0x3c3d93,_0x43c8b1){return function(_0x398c69){if(_0x398c69){return _0x398c69[_0xb069('0x24')]()['then'](function(){var _0x3dc845=_0x398c69[_0xb069('0x25')]({'plain':!![]});var _0x56f4da=_0xb069('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x56f4da,'resourceId':_0x3dc845['id']}})[_0xb069('0x23')](function(){return _0x398c69;});})[_0xb069('0x23')](function(){_0x3c3d93[_0xb069('0x19')](0xcc)[_0xb069('0x27')]();});}};}function handleEntityNotFound(_0x5dc713,_0x3384b9){return function(_0x55ae0c){if(!_0x55ae0c){_0x5dc713[_0xb069('0x18')](0x194);}return _0x55ae0c;};}function handleError(_0x49af7a,_0x543678){_0x543678=_0x543678||0x1f4;return function(_0x2a263d){logger[_0xb069('0x28')](_0x2a263d[_0xb069('0x29')]);if(_0x2a263d[_0xb069('0x2a')]){delete _0x2a263d[_0xb069('0x2a')];}_0x49af7a[_0xb069('0x19')](_0x543678)['send'](_0x2a263d);};}exports['index']=function(_0x5a1465,_0x17b7b6){var _0x1057b3={},_0x5cb52a={},_0x26324d={'count':0x0,'rows':[]};return db[_0xb069('0x2b')][_0xb069('0x2c')]()['then'](function(_0x23c453){_0x5cb52a['model']=_[_0xb069('0x2d')](_0x23c453);_0x5cb52a[_0xb069('0x2e')]=_[_0xb069('0x2d')](_0x5a1465[_0xb069('0x2e')]);_0x5cb52a[_0xb069('0x2f')]=_['intersection'](_0x5cb52a[_0xb069('0x30')],_0x5cb52a[_0xb069('0x2e')]);_0x1057b3[_0xb069('0x31')]=_[_0xb069('0x32')](_0x5cb52a['model'],qs['fields'](_0x5a1465[_0xb069('0x2e')][_0xb069('0x33')]));_0x1057b3['attributes']=_0x1057b3['attributes'][_0xb069('0x34')]?_0x1057b3[_0xb069('0x31')]:_0x5cb52a[_0xb069('0x30')];if(!_0x5a1465[_0xb069('0x2e')][_0xb069('0x35')](_0xb069('0x36'))){_0x1057b3['limit']=qs['limit'](_0x5a1465[_0xb069('0x2e')][_0xb069('0x1c')]);_0x1057b3[_0xb069('0x1b')]=qs[_0xb069('0x1b')](_0x5a1465[_0xb069('0x2e')][_0xb069('0x1b')]);}_0x1057b3[_0xb069('0x37')]=qs[_0xb069('0x38')](_0x5a1465[_0xb069('0x2e')][_0xb069('0x38')]);_0x1057b3[_0xb069('0x39')]=qs[_0xb069('0x2f')](_[_0xb069('0x3a')](_0x5a1465[_0xb069('0x2e')],_0x5cb52a[_0xb069('0x2f')]),_0x23c453);if(_0x5a1465[_0xb069('0x2e')][_0xb069('0x3b')]){_0x1057b3['where']=_[_0xb069('0x3c')](_0x1057b3[_0xb069('0x39')],{'$or':_[_0xb069('0x3d')](_0x1057b3[_0xb069('0x31')],function(_0x5c0e67){var _0x41d0b6={};_0x41d0b6[_0x5c0e67]={'$like':'%'+_0x5a1465[_0xb069('0x2e')][_0xb069('0x3b')]+'%'};return _0x41d0b6;})});}_0x1057b3=_['merge']({},_0x1057b3,_0x5a1465[_0xb069('0x3e')]);var _0xe3634d={'where':_0x1057b3['where']};return db[_0xb069('0x2b')][_0xb069('0x1e')](_0xe3634d)[_0xb069('0x23')](function(_0x40bfb0){_0x26324d['count']=_0x40bfb0;if(_0x5a1465[_0xb069('0x2e')][_0xb069('0x3f')]){_0x1057b3[_0xb069('0x40')]=[{'all':!![]}];}return db[_0xb069('0x2b')][_0xb069('0x41')](_0x1057b3);})['then'](function(_0x577546){_0x26324d[_0xb069('0x42')]=_0x577546;return _0x26324d;})['then'](respondWithFilteredResult(_0x17b7b6,_0x1057b3))[_0xb069('0x43')](handleError(_0x17b7b6,null));})[_0xb069('0x43')](handleError(_0x17b7b6,null));};exports[_0xb069('0x44')]=function(_0x53772f,_0x4b89d1){var _0x1872ba={'raw':![],'where':{'id':_0x53772f[_0xb069('0x45')]['id']}},_0x20bfe1={};_0x20bfe1['model']=_[_0xb069('0x2d')](db[_0xb069('0x2b')][_0xb069('0x46')]);_0x20bfe1['query']=_['keys'](_0x53772f['query']);_0x20bfe1[_0xb069('0x2f')]=_[_0xb069('0x32')](_0x20bfe1[_0xb069('0x30')],_0x20bfe1[_0xb069('0x2e')]);_0x1872ba['attributes']=_[_0xb069('0x32')](_0x20bfe1[_0xb069('0x30')],qs[_0xb069('0x33')](_0x53772f[_0xb069('0x2e')][_0xb069('0x33')]));_0x1872ba[_0xb069('0x31')]=_0x1872ba['attributes'][_0xb069('0x34')]?_0x1872ba[_0xb069('0x31')]:_0x20bfe1[_0xb069('0x30')];if(_0x53772f[_0xb069('0x2e')][_0xb069('0x3f')]){_0x1872ba[_0xb069('0x40')]=[{'all':!![]}];}_0x1872ba=_[_0xb069('0x3c')]({},_0x1872ba,_0x53772f['options']);return db[_0xb069('0x2b')][_0xb069('0x47')](_0x1872ba)[_0xb069('0x23')](handleEntityNotFound(_0x4b89d1,null))[_0xb069('0x23')](respondWithResult(_0x4b89d1,null))['catch'](handleError(_0x4b89d1,null));};exports[_0xb069('0x48')]=function(_0x1f6480,_0x391079){return db[_0xb069('0x2b')][_0xb069('0x48')](_0x1f6480[_0xb069('0x49')],{})[_0xb069('0x23')](function(_0x55e4bd){var _0x419ea6=_0x1f6480[_0xb069('0x4a')][_0xb069('0x25')]({'plain':!![]});if(!_0x419ea6)throw new Error(_0xb069('0x4b'));if(_0x419ea6['role']===_0xb069('0x4a')){var _0x289af3=_0x55e4bd[_0xb069('0x25')]({'plain':!![]});var _0xc752e3=_0xb069('0x26');return db[_0xb069('0x4c')][_0xb069('0x47')]({'where':{'name':_0xc752e3,'userProfileId':_0x419ea6[_0xb069('0x4d')]},'raw':!![]})['then'](function(_0x348dbe){if(_0x348dbe&&_0x348dbe[_0xb069('0x4e')]===0x0){return db['UserProfileResource'][_0xb069('0x48')]({'name':_0x289af3[_0xb069('0x2a')],'resourceId':_0x289af3['id'],'type':_0x348dbe['name'],'sectionId':_0x348dbe['id']},{})['then'](function(){return _0x55e4bd;});}else{return _0x55e4bd;}})[_0xb069('0x43')](function(_0x447a00){logger[_0xb069('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x447a00);throw _0x447a00;});}return _0x55e4bd;})['then'](respondWithResult(_0x391079,0xc9))[_0xb069('0x43')](handleError(_0x391079,null));};exports[_0xb069('0x22')]=function(_0x544b4f,_0x9b98e1){if(_0x544b4f[_0xb069('0x49')]['id']){delete _0x544b4f['body']['id'];}return db[_0xb069('0x2b')][_0xb069('0x47')]({'where':{'id':_0x544b4f[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x9b98e1,null))[_0xb069('0x23')](saveUpdates(_0x544b4f['body'],null))['then'](respondWithResult(_0x9b98e1,null))[_0xb069('0x43')](handleError(_0x9b98e1,null));};exports[_0xb069('0x24')]=function(_0x439ce4,_0x1b5cb6){return db[_0xb069('0x2b')][_0xb069('0x47')]({'where':{'id':_0x439ce4['params']['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x1b5cb6,null))[_0xb069('0x23')](removeEntity(_0x1b5cb6,null))[_0xb069('0x43')](handleError(_0x1b5cb6,null));};exports[_0xb069('0x2c')]=function(_0x3df63d,_0xd73d2c){return db[_0xb069('0x2b')][_0xb069('0x2c')]()[_0xb069('0x23')](respondWithResult(_0xd73d2c,null))[_0xb069('0x43')](handleError(_0xd73d2c,null));};exports[_0xb069('0x4f')]=function(_0x236a0d,_0x651ef2,_0x5e9b07){return db[_0xb069('0x50')][_0xb069('0x47')]({'where':{'id':_0x236a0d[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x651ef2,null))[_0xb069('0x23')](function(_0x63d23){if(_0x63d23){return _0x63d23[_0xb069('0x4f')](_0x236a0d[_0xb069('0x49')][_0xb069('0x51')],_[_0xb069('0x52')](_0x236a0d['body'],[_0xb069('0x51'),'id'])||{});}})[_0xb069('0x23')](respondWithResult(_0x651ef2,null))[_0xb069('0x43')](handleError(_0x651ef2,null));};exports[_0xb069('0x53')]=function(_0x2b193a,_0x214681,_0x451ecf){var _0x1562d5={};var _0x32318d={};var _0x4092a3;var _0x3c1b7a;return db[_0xb069('0x2b')][_0xb069('0x54')]({'where':{'id':_0x2b193a[_0xb069('0x45')]['id']}})[_0xb069('0x23')](handleEntityNotFound(_0x214681,null))[_0xb069('0x23')](function(_0x1f44ff){if(_0x1f44ff){_0x4092a3=_0x1f44ff;_0x32318d[_0xb069('0x30')]=_[_0xb069('0x2d')](db[_0xb069('0x50')][_0xb069('0x46')]);_0x32318d[_0xb069('0x2e')]=_['keys'](_0x2b193a[_0xb069('0x2e')]);_0x32318d[_0xb069('0x2f')]=_[_0xb069('0x32')](_0x32318d['model'],_0x32318d['query']);_0x1562d5[_0xb069('0x31')]=_['intersection'](_0x32318d['model'],qs['fields'](_0x2b193a['query'][_0xb069('0x33')]));_0x1562d5['attributes']=_0x1562d5['attributes'][_0xb069('0x34')]?_0x1562d5['attributes']:_0x32318d[_0xb069('0x30')];_0x1562d5['order']=qs[_0xb069('0x38')](_0x2b193a[_0xb069('0x2e')]['sort']);_0x1562d5[_0xb069('0x39')]=qs[_0xb069('0x2f')](_['pick'](_0x2b193a[_0xb069('0x2e')],_0x32318d[_0xb069('0x2f')]));if(_0x2b193a[_0xb069('0x2e')][_0xb069('0x3b')]){_0x1562d5[_0xb069('0x39')]=_[_0xb069('0x3c')](_0x1562d5[_0xb069('0x39')],{'$or':_[_0xb069('0x3d')](_0x1562d5[_0xb069('0x31')],function(_0xf6acc2){var _0x66d2f1={};_0x66d2f1[_0xf6acc2]={'$like':'%'+_0x2b193a['query']['filter']+'%'};return _0x66d2f1;})});}_0x1562d5=_[_0xb069('0x3c')]({},_0x1562d5,_0x2b193a[_0xb069('0x3e')]);return _0x4092a3['getContacts'](_0x1562d5);}})[_0xb069('0x23')](function(_0x28c351){if(_0x28c351){_0x3c1b7a=_0x28c351[_0xb069('0x34')];if(!_0x2b193a[_0xb069('0x2e')][_0xb069('0x35')](_0xb069('0x36'))){_0x1562d5[_0xb069('0x1c')]=qs[_0xb069('0x1c')](_0x2b193a[_0xb069('0x2e')][_0xb069('0x1c')]);_0x1562d5['offset']=qs['offset'](_0x2b193a['query'][_0xb069('0x1b')]);}return _0x4092a3['getContacts'](_0x1562d5);}})['then'](function(_0x104231){if(_0x104231){return _0x104231?{'count':_0x3c1b7a,'rows':_0x104231}:null;}})[_0xb069('0x23')](respondWithResult(_0x214681,null))['catch'](handleError(_0x214681,null));}; \ No newline at end of file +var _0xa247=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','keys','query','filters','intersection','model','fields','attributes','nolimit','order','sort','pick','merge','where','filter','options','includeAll','show','params','rawAttributes','length','include','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','omit','ids','getContacts','findOne','map','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x59747e,_0x48e3bb){var _0x1d3285=function(_0x2b68ec){while(--_0x2b68ec){_0x59747e['push'](_0x59747e['shift']());}};_0x1d3285(++_0x48e3bb);}(_0xa247,0x197));var _0x7a24=function(_0x30da0f,_0x356e4d){_0x30da0f=_0x30da0f-0x0;var _0x1234ad=_0xa247[_0x30da0f];return _0x1234ad;};'use strict';var emlformat=require(_0x7a24('0x0'));var rimraf=require(_0x7a24('0x1'));var zipdir=require(_0x7a24('0x2'));var jsonpatch=require(_0x7a24('0x3'));var rp=require('request-promise');var moment=require(_0x7a24('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7a24('0x5'));var util=require('util');var path=require(_0x7a24('0x6'));var sox=require(_0x7a24('0x7'));var csv=require(_0x7a24('0x8'));var ejs=require(_0x7a24('0x9'));var fs=require('fs');var fs_extra=require(_0x7a24('0xa'));var _=require('lodash');var squel=require(_0x7a24('0xb'));var crypto=require(_0x7a24('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a24('0x8'));var querystring=require(_0x7a24('0xd'));var Papa=require(_0x7a24('0xe'));var Redis=require('ioredis');var authService=require(_0x7a24('0xf'));var qs=require(_0x7a24('0x10'));var as=require(_0x7a24('0x11'));var hardwareService=require(_0x7a24('0x12'));var logger=require(_0x7a24('0x13'))(_0x7a24('0x14'));var utils=require(_0x7a24('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x7a24('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b57fb,_0x149311){_0x149311=_0x149311||0xcc;return function(_0x2df9c6){if(_0x2df9c6){return _0x3b57fb[_0x7a24('0x17')](_0x149311);}return _0x3b57fb['status'](_0x149311)[_0x7a24('0x18')]();};}function respondWithResult(_0x4780ad,_0x261cbf){_0x261cbf=_0x261cbf||0xc8;return function(_0x596bbf){if(_0x596bbf){return _0x4780ad[_0x7a24('0x19')](_0x261cbf)['json'](_0x596bbf);}};}function respondWithFilteredResult(_0xed9956,_0x3d2eef){return function(_0x5a0c32){if(_0x5a0c32){var _0x34d5ea=typeof _0x3d2eef[_0x7a24('0x1a')]===_0x7a24('0x1b')&&typeof _0x3d2eef[_0x7a24('0x1c')]===_0x7a24('0x1b');var _0x56fc54=_0x5a0c32[_0x7a24('0x1d')];var _0x311710=_0x34d5ea?0x0:_0x3d2eef['offset'];var _0x5e24b0=_0x34d5ea?_0x5a0c32[_0x7a24('0x1d')]:_0x3d2eef[_0x7a24('0x1a')]+_0x3d2eef[_0x7a24('0x1c')];var _0xd19ba7;if(_0x5e24b0>=_0x56fc54){_0x5e24b0=_0x56fc54;_0xd19ba7=0xc8;}else{_0xd19ba7=0xce;}_0xed9956[_0x7a24('0x19')](_0xd19ba7);return _0xed9956['set'](_0x7a24('0x1e'),_0x311710+'-'+_0x5e24b0+'/'+_0x56fc54)['json'](_0x5a0c32);}return null;};}function patchUpdates(_0x5f5749){return function(_0x46a3ed){try{jsonpatch[_0x7a24('0x1f')](_0x46a3ed,_0x5f5749,!![]);}catch(_0x20e840){return BPromise[_0x7a24('0x20')](_0x20e840);}return _0x46a3ed[_0x7a24('0x21')]();};}function saveUpdates(_0x78dd11,_0x3fa15e){return function(_0x30cd9f){if(_0x30cd9f){return _0x30cd9f[_0x7a24('0x22')](_0x78dd11)[_0x7a24('0x23')](function(_0x29f2e4){return _0x29f2e4;});}return null;};}function removeEntity(_0x40132f,_0x2e72e8){return function(_0x406149){if(_0x406149){return _0x406149[_0x7a24('0x24')]()[_0x7a24('0x23')](function(){var _0x97933a=_0x406149['get']({'plain':!![]});var _0x2e37a5=_0x7a24('0x25');return db[_0x7a24('0x26')][_0x7a24('0x24')]({'where':{'type':_0x2e37a5,'resourceId':_0x97933a['id']}})[_0x7a24('0x23')](function(){return _0x406149;});})[_0x7a24('0x23')](function(){_0x40132f[_0x7a24('0x19')](0xcc)[_0x7a24('0x18')]();});}};}function handleEntityNotFound(_0x1e216a,_0x82a6a0){return function(_0x518820){if(!_0x518820){_0x1e216a[_0x7a24('0x17')](0x194);}return _0x518820;};}function handleError(_0x22e31b,_0x3a630b){_0x3a630b=_0x3a630b||0x1f4;return function(_0x1cd3e2){logger[_0x7a24('0x27')](_0x1cd3e2[_0x7a24('0x28')]);if(_0x1cd3e2[_0x7a24('0x29')]){delete _0x1cd3e2[_0x7a24('0x29')];}_0x22e31b[_0x7a24('0x19')](_0x3a630b)[_0x7a24('0x2a')](_0x1cd3e2);};}exports['index']=function(_0x6ac5c9,_0x578852){var _0x3fc7f6={},_0x173e8e={},_0x3d08ef={'count':0x0,'rows':[]};return db[_0x7a24('0x2b')][_0x7a24('0x2c')]()['then'](function(_0x2d9a2c){_0x173e8e['model']=_[_0x7a24('0x2d')](_0x2d9a2c);_0x173e8e[_0x7a24('0x2e')]=_[_0x7a24('0x2d')](_0x6ac5c9[_0x7a24('0x2e')]);_0x173e8e[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0x173e8e['model'],_0x173e8e[_0x7a24('0x2e')]);_0x3fc7f6['attributes']=_[_0x7a24('0x30')](_0x173e8e[_0x7a24('0x31')],qs[_0x7a24('0x32')](_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x32')]));_0x3fc7f6[_0x7a24('0x33')]=_0x3fc7f6[_0x7a24('0x33')]['length']?_0x3fc7f6['attributes']:_0x173e8e[_0x7a24('0x31')];if(!_0x6ac5c9['query']['hasOwnProperty'](_0x7a24('0x34'))){_0x3fc7f6[_0x7a24('0x1c')]=qs[_0x7a24('0x1c')](_0x6ac5c9[_0x7a24('0x2e')]['limit']);_0x3fc7f6[_0x7a24('0x1a')]=qs['offset'](_0x6ac5c9[_0x7a24('0x2e')]['offset']);}_0x3fc7f6[_0x7a24('0x35')]=qs['sort'](_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x36')]);_0x3fc7f6['where']=qs[_0x7a24('0x2f')](_[_0x7a24('0x37')](_0x6ac5c9[_0x7a24('0x2e')],_0x173e8e[_0x7a24('0x2f')]),_0x2d9a2c);if(_0x6ac5c9[_0x7a24('0x2e')]['filter']){_0x3fc7f6['where']=_[_0x7a24('0x38')](_0x3fc7f6[_0x7a24('0x39')],{'$or':_['map'](_0x3fc7f6['attributes'],function(_0x3d3dec){var _0x269bc3={};_0x269bc3[_0x3d3dec]={'$like':'%'+_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x3a')]+'%'};return _0x269bc3;})});}_0x3fc7f6=_[_0x7a24('0x38')]({},_0x3fc7f6,_0x6ac5c9[_0x7a24('0x3b')]);var _0x48dccd={'where':_0x3fc7f6[_0x7a24('0x39')]};return db[_0x7a24('0x2b')]['count'](_0x48dccd)['then'](function(_0x46bab5){_0x3d08ef['count']=_0x46bab5;if(_0x6ac5c9[_0x7a24('0x2e')][_0x7a24('0x3c')]){_0x3fc7f6['include']=[{'all':!![]}];}return db[_0x7a24('0x2b')]['findAll'](_0x3fc7f6);})[_0x7a24('0x23')](function(_0xad5e25){_0x3d08ef['rows']=_0xad5e25;return _0x3d08ef;})[_0x7a24('0x23')](respondWithFilteredResult(_0x578852,_0x3fc7f6))['catch'](handleError(_0x578852,null));})['catch'](handleError(_0x578852,null));};exports[_0x7a24('0x3d')]=function(_0x48b954,_0x94ae8){var _0x503739={'raw':![],'where':{'id':_0x48b954[_0x7a24('0x3e')]['id']}},_0xdc901a={};_0xdc901a[_0x7a24('0x31')]=_[_0x7a24('0x2d')](db[_0x7a24('0x2b')][_0x7a24('0x3f')]);_0xdc901a[_0x7a24('0x2e')]=_['keys'](_0x48b954[_0x7a24('0x2e')]);_0xdc901a[_0x7a24('0x2f')]=_[_0x7a24('0x30')](_0xdc901a['model'],_0xdc901a[_0x7a24('0x2e')]);_0x503739[_0x7a24('0x33')]=_[_0x7a24('0x30')](_0xdc901a[_0x7a24('0x31')],qs[_0x7a24('0x32')](_0x48b954['query'][_0x7a24('0x32')]));_0x503739['attributes']=_0x503739[_0x7a24('0x33')][_0x7a24('0x40')]?_0x503739[_0x7a24('0x33')]:_0xdc901a[_0x7a24('0x31')];if(_0x48b954['query']['includeAll']){_0x503739[_0x7a24('0x41')]=[{'all':!![]}];}_0x503739=_[_0x7a24('0x38')]({},_0x503739,_0x48b954['options']);return db[_0x7a24('0x2b')][_0x7a24('0x42')](_0x503739)[_0x7a24('0x23')](handleEntityNotFound(_0x94ae8,null))[_0x7a24('0x23')](respondWithResult(_0x94ae8,null))[_0x7a24('0x43')](handleError(_0x94ae8,null));};exports[_0x7a24('0x44')]=function(_0x2ec89f,_0x359b28){return db['CmCompany'][_0x7a24('0x44')](_0x2ec89f['body'],{})[_0x7a24('0x23')](function(_0x1f69b7){var _0x5d33d3=_0x2ec89f[_0x7a24('0x45')][_0x7a24('0x46')]({'plain':!![]});if(!_0x5d33d3)throw new Error(_0x7a24('0x47'));if(_0x5d33d3[_0x7a24('0x48')]===_0x7a24('0x45')){var _0x3122cc=_0x1f69b7[_0x7a24('0x46')]({'plain':!![]});var _0x178631=_0x7a24('0x25');return db[_0x7a24('0x49')]['find']({'where':{'name':_0x178631,'userProfileId':_0x5d33d3[_0x7a24('0x4a')]},'raw':!![]})[_0x7a24('0x23')](function(_0x489527){if(_0x489527&&_0x489527[_0x7a24('0x4b')]===0x0){return db[_0x7a24('0x26')][_0x7a24('0x44')]({'name':_0x3122cc[_0x7a24('0x29')],'resourceId':_0x3122cc['id'],'type':_0x489527[_0x7a24('0x29')],'sectionId':_0x489527['id']},{})[_0x7a24('0x23')](function(){return _0x1f69b7;});}else{return _0x1f69b7;}})['catch'](function(_0x5468d3){logger['error'](_0x7a24('0x4c'),_0x5468d3);throw _0x5468d3;});}return _0x1f69b7;})['then'](respondWithResult(_0x359b28,0xc9))[_0x7a24('0x43')](handleError(_0x359b28,null));};exports[_0x7a24('0x22')]=function(_0x36624f,_0x3902da){if(_0x36624f[_0x7a24('0x4d')]['id']){delete _0x36624f['body']['id'];}return db[_0x7a24('0x2b')][_0x7a24('0x42')]({'where':{'id':_0x36624f[_0x7a24('0x3e')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x3902da,null))['then'](saveUpdates(_0x36624f[_0x7a24('0x4d')],null))[_0x7a24('0x23')](respondWithResult(_0x3902da,null))['catch'](handleError(_0x3902da,null));};exports[_0x7a24('0x24')]=function(_0x28b35a,_0x35d2fb){return db[_0x7a24('0x2b')][_0x7a24('0x42')]({'where':{'id':_0x28b35a[_0x7a24('0x3e')]['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x35d2fb,null))[_0x7a24('0x23')](removeEntity(_0x35d2fb,null))[_0x7a24('0x43')](handleError(_0x35d2fb,null));};exports[_0x7a24('0x2c')]=function(_0x5d3f98,_0x9184a1){return db['CmCompany'][_0x7a24('0x2c')]()[_0x7a24('0x23')](respondWithResult(_0x9184a1,null))[_0x7a24('0x43')](handleError(_0x9184a1,null));};exports[_0x7a24('0x4e')]=function(_0x3d2747,_0x31fb02,_0x40de10){return db[_0x7a24('0x4f')][_0x7a24('0x42')]({'where':{'id':_0x3d2747['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x31fb02,null))[_0x7a24('0x23')](function(_0x3e66a5){if(_0x3e66a5){return _0x3e66a5[_0x7a24('0x4e')](_0x3d2747[_0x7a24('0x4d')]['ids'],_[_0x7a24('0x50')](_0x3d2747[_0x7a24('0x4d')],[_0x7a24('0x51'),'id'])||{});}})[_0x7a24('0x23')](respondWithResult(_0x31fb02,null))[_0x7a24('0x43')](handleError(_0x31fb02,null));};exports[_0x7a24('0x52')]=function(_0x3d6ed9,_0x12f961,_0x17964d){var _0x51a6f0={};var _0x47e172={};var _0x3b66fa;var _0xf4882f;return db['CmCompany'][_0x7a24('0x53')]({'where':{'id':_0x3d6ed9['params']['id']}})[_0x7a24('0x23')](handleEntityNotFound(_0x12f961,null))[_0x7a24('0x23')](function(_0x518c7f){if(_0x518c7f){_0x3b66fa=_0x518c7f;_0x47e172[_0x7a24('0x31')]=_[_0x7a24('0x2d')](db['CmContact'][_0x7a24('0x3f')]);_0x47e172[_0x7a24('0x2e')]=_['keys'](_0x3d6ed9[_0x7a24('0x2e')]);_0x47e172[_0x7a24('0x2f')]=_['intersection'](_0x47e172[_0x7a24('0x31')],_0x47e172['query']);_0x51a6f0['attributes']=_[_0x7a24('0x30')](_0x47e172['model'],qs[_0x7a24('0x32')](_0x3d6ed9['query'][_0x7a24('0x32')]));_0x51a6f0[_0x7a24('0x33')]=_0x51a6f0['attributes']['length']?_0x51a6f0[_0x7a24('0x33')]:_0x47e172['model'];_0x51a6f0[_0x7a24('0x35')]=qs['sort'](_0x3d6ed9['query']['sort']);_0x51a6f0[_0x7a24('0x39')]=qs[_0x7a24('0x2f')](_[_0x7a24('0x37')](_0x3d6ed9[_0x7a24('0x2e')],_0x47e172[_0x7a24('0x2f')]));if(_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x3a')]){_0x51a6f0[_0x7a24('0x39')]=_[_0x7a24('0x38')](_0x51a6f0[_0x7a24('0x39')],{'$or':_[_0x7a24('0x54')](_0x51a6f0[_0x7a24('0x33')],function(_0x51b26a){var _0x3b773c={};_0x3b773c[_0x51b26a]={'$like':'%'+_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x3a')]+'%'};return _0x3b773c;})});}_0x51a6f0=_[_0x7a24('0x38')]({},_0x51a6f0,_0x3d6ed9[_0x7a24('0x3b')]);return _0x3b66fa[_0x7a24('0x52')](_0x51a6f0);}})[_0x7a24('0x23')](function(_0x473aed){if(_0x473aed){_0xf4882f=_0x473aed[_0x7a24('0x40')];if(!_0x3d6ed9[_0x7a24('0x2e')]['hasOwnProperty'](_0x7a24('0x34'))){_0x51a6f0[_0x7a24('0x1c')]=qs['limit'](_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x1c')]);_0x51a6f0[_0x7a24('0x1a')]=qs[_0x7a24('0x1a')](_0x3d6ed9[_0x7a24('0x2e')][_0x7a24('0x1a')]);}return _0x3b66fa[_0x7a24('0x52')](_0x51a6f0);}})[_0x7a24('0x23')](function(_0x1bbfb5){if(_0x1bbfb5){return _0x1bbfb5?{'count':_0xf4882f,'rows':_0x1bbfb5}:null;}})[_0x7a24('0x23')](respondWithResult(_0x12f961,null))[_0x7a24('0x43')](handleError(_0x12f961,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index d52961c..8bc7a57 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 _0xcfd2=['rimraf','../../config/environment','./cmCompany.attributes','CmCompany','lodash','util','../../config/logger','api','moment'];(function(_0x28edda,_0xbd447a){var _0x21f4a4=function(_0x5ae05e){while(--_0x5ae05e){_0x28edda['push'](_0x28edda['shift']());}};_0x21f4a4(++_0xbd447a);}(_0xcfd2,0xdc));var _0x2cfd=function(_0x5bf111,_0x53a71d){_0x5bf111=_0x5bf111-0x0;var _0x26e73f=_0xcfd2[_0x5bf111];return _0x26e73f;};'use strict';var _=require(_0x2cfd('0x0'));var util=require(_0x2cfd('0x1'));var logger=require(_0x2cfd('0x2'))(_0x2cfd('0x3'));var moment=require(_0x2cfd('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2cfd('0x5'));var config=require(_0x2cfd('0x6'));var attributes=require(_0x2cfd('0x7'));module['exports']=function(_0x788f4b,_0x58f0ff){return _0x788f4b['define'](_0x2cfd('0x8'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5570=['api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger'];(function(_0x78d11b,_0x1c2611){var _0x5f2e27=function(_0x58e6ce){while(--_0x58e6ce){_0x78d11b['push'](_0x78d11b['shift']());}};_0x5f2e27(++_0x1c2611);}(_0x5570,0xf4));var _0x0557=function(_0x27d11f,_0x2c59a8){_0x27d11f=_0x27d11f-0x0;var _0x36c1a5=_0x5570[_0x27d11f];return _0x36c1a5;};'use strict';var _=require(_0x0557('0x0'));var util=require(_0x0557('0x1'));var logger=require(_0x0557('0x2'))(_0x0557('0x3'));var moment=require('moment');var BPromise=require(_0x0557('0x4'));var rp=require(_0x0557('0x5'));var fs=require('fs');var path=require(_0x0557('0x6'));var rimraf=require(_0x0557('0x7'));var config=require(_0x0557('0x8'));var attributes=require(_0x0557('0x9'));module['exports']=function(_0x56f613,_0x42cd9f){return _0x56f613[_0x0557('0xa')](_0x0557('0xb'),attributes,{'tableName':_0x0557('0xc'),'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 dd59e5e..a24edbd 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 _0x1305=['jayson/promise','client','request','then','info','CmCompany,\x20%s,\x20%s','debug','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1305,0x142));var _0x5130=function(_0x5f1864,_0x5a2d34){_0x5f1864=_0x5f1864-0x0;var _0x4e92ba=_0x1305[_0x5f1864];return _0x4e92ba;};'use strict';var _=require('lodash');var util=require(_0x5130('0x0'));var moment=require(_0x5130('0x1'));var BPromise=require('bluebird');var rs=require(_0x5130('0x2'));var fs=require('fs');var Redis=require(_0x5130('0x3'));var db=require(_0x5130('0x4'))['db'];var utils=require(_0x5130('0x5'));var logger=require(_0x5130('0x6'))('rpc');var config=require(_0x5130('0x7'));var jayson=require(_0x5130('0x8'));var client=jayson[_0x5130('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccf1,_0x350f3d,_0x35f55a){return new BPromise(function(_0x234696,_0x438b48){return client[_0x5130('0xa')](_0x15ccf1,_0x35f55a)[_0x5130('0xb')](function(_0x61cd29){logger[_0x5130('0xc')](_0x5130('0xd'),_0x350f3d,'request\x20sent');logger[_0x5130('0xe')](_0x5130('0xf'),_0x350f3d,_0x5130('0x10'),JSON['stringify'](_0x61cd29));if(_0x61cd29[_0x5130('0x11')]){if(_0x61cd29[_0x5130('0x11')][_0x5130('0x12')]===0x1f4){logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x61cd29[_0x5130('0x11')][_0x5130('0x13')]);return _0x438b48(_0x61cd29['error'][_0x5130('0x13')]);}logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x61cd29['error']['message']);return _0x234696(_0x61cd29[_0x5130('0x11')][_0x5130('0x13')]);}else{logger['info'](_0x5130('0xd'),_0x350f3d,'request\x20sent');_0x234696(_0x61cd29[_0x5130('0x14')]['message']);}})[_0x5130('0x15')](function(_0x43182e){logger[_0x5130('0x11')](_0x5130('0xd'),_0x350f3d,_0x43182e);_0x438b48(_0x43182e);});});} \ No newline at end of file +var _0x8420=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x49cf2d,_0x3c3bdd){var _0x5d91eb=function(_0x518aa6){while(--_0x518aa6){_0x49cf2d['push'](_0x49cf2d['shift']());}};_0x5d91eb(++_0x3c3bdd);}(_0x8420,0xd1));var _0x0842=function(_0x4fc0f3,_0x282ba2){_0x4fc0f3=_0x4fc0f3-0x0;var _0x633682=_0x8420[_0x4fc0f3];return _0x633682;};'use strict';var _=require(_0x0842('0x0'));var util=require('util');var moment=require(_0x0842('0x1'));var BPromise=require(_0x0842('0x2'));var rs=require(_0x0842('0x3'));var fs=require('fs');var Redis=require(_0x0842('0x4'));var db=require(_0x0842('0x5'))['db'];var utils=require(_0x0842('0x6'));var logger=require(_0x0842('0x7'))(_0x0842('0x8'));var config=require(_0x0842('0x9'));var jayson=require(_0x0842('0xa'));var client=jayson[_0x0842('0xb')][_0x0842('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c9708,_0x25f395,_0x3faddd){return new BPromise(function(_0x2d20bf,_0x449dec){return client[_0x0842('0xd')](_0x5c9708,_0x3faddd)[_0x0842('0xe')](function(_0x59e71c){logger['info']('CmCompany,\x20%s,\x20%s',_0x25f395,_0x0842('0xf'));logger['debug'](_0x0842('0x10'),_0x25f395,'request\x20sent',JSON[_0x0842('0x11')](_0x59e71c));if(_0x59e71c[_0x0842('0x12')]){if(_0x59e71c[_0x0842('0x12')][_0x0842('0x13')]===0x1f4){logger[_0x0842('0x12')](_0x0842('0x14'),_0x25f395,_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);return _0x449dec(_0x59e71c['error']['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x25f395,_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);return _0x2d20bf(_0x59e71c[_0x0842('0x12')][_0x0842('0x15')]);}else{logger['info'](_0x0842('0x14'),_0x25f395,_0x0842('0xf'));_0x2d20bf(_0x59e71c[_0x0842('0x16')]['message']);}})[_0x0842('0x17')](function(_0x2b7142){logger[_0x0842('0x12')](_0x0842('0x14'),_0x25f395,_0x2b7142);_0x449dec(_0x2b7142);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8eff692..a9f0ac4 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 _0x829a=['../../config/environment','get','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','post','create','addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xdd827a,_0x482ad2){var _0x2f46f1=function(_0x221046){while(--_0x221046){_0xdd827a['push'](_0xdd827a['shift']());}};_0x2f46f1(++_0x482ad2);}(_0x829a,0x190));var _0xa829=function(_0x532607,_0x1a44af){_0x532607=_0x532607-0x0;var _0x5093b0=_0x829a[_0x532607];return _0x5093b0;};'use strict';var multer=require(_0xa829('0x0'));var util=require(_0xa829('0x1'));var path=require(_0xa829('0x2'));var timeout=require(_0xa829('0x3'));var express=require(_0xa829('0x4'));var router=express[_0xa829('0x5')]();var fs_extra=require(_0xa829('0x6'));var auth=require(_0xa829('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa829('0x8'));var controller=require('./cmCompany.controller');router[_0xa829('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa829('0x9')](_0xa829('0xa'),auth[_0xa829('0xb')](),controller[_0xa829('0xc')]);router['get'](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0xe')]);router['get'](_0xa829('0xf'),auth[_0xa829('0xb')](),controller['getContacts']);router[_0xa829('0x10')]('/',auth[_0xa829('0xb')](),controller[_0xa829('0x11')]);router['post'](_0xa829('0xf'),auth[_0xa829('0xb')](),controller[_0xa829('0x12')]);router[_0xa829('0x13')](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0x14')]);router[_0xa829('0x15')](_0xa829('0xd'),auth[_0xa829('0xb')](),controller[_0xa829('0x16')]);module[_0xa829('0x17')]=router; \ No newline at end of file +var _0x0c84=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/contacts','create','post','addContacts','put','update','delete','destroy','exports','multer','connect-timeout'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x0c84,0x185));var _0x40c8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x0c84[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x40c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x40c8('0x1'));var express=require('express');var router=express[_0x40c8('0x2')]();var fs_extra=require(_0x40c8('0x3'));var auth=require(_0x40c8('0x4'));var interaction=require(_0x40c8('0x5'));var config=require(_0x40c8('0x6'));var controller=require('./cmCompany.controller');router[_0x40c8('0x7')]('/',auth['isAuthenticated'](),controller[_0x40c8('0x8')]);router[_0x40c8('0x7')](_0x40c8('0x9'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xb')]);router['get'](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0xd')]);router[_0x40c8('0x7')](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller['getContacts']);router['post']('/',auth[_0x40c8('0xa')](),controller[_0x40c8('0xf')]);router[_0x40c8('0x10')](_0x40c8('0xe'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x11')]);router[_0x40c8('0x12')](_0x40c8('0xc'),auth[_0x40c8('0xa')](),controller[_0x40c8('0x13')]);router[_0x40c8('0x14')](_0x40c8('0xc'),auth['isAuthenticated'](),controller[_0x40c8('0x15')]);module[_0x40c8('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 5b332a7..229535e 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 _0x60e4=['STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW','lodash','sequelize'];(function(_0x7c0c77,_0x3cf116){var _0x22a87b=function(_0x37279a){while(--_0x37279a){_0x7c0c77['push'](_0x7c0c77['shift']());}};_0x22a87b(++_0x3cf116);}(_0x60e4,0x17e));var _0x460e=function(_0x319129,_0x500514){_0x319129=_0x319129-0x0;var _0x1ca8a6=_0x60e4[_0x319129];return _0x1ca8a6;};'use strict';var _=require(_0x460e('0x0'));var Sequelize=require(_0x460e('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x460e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x460e('0x2')]},'street':{'type':Sequelize[_0x460e('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x460e('0x2')]},'country':{'type':Sequelize[_0x460e('0x2')]},'dateOfBirth':{'type':Sequelize[_0x460e('0x2')]},'description':{'type':Sequelize[_0x460e('0x3')]},'phone':{'type':Sequelize[_0x460e('0x2')]},'mobile':{'type':Sequelize[_0x460e('0x2')]},'fax':{'type':Sequelize[_0x460e('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x460e('0x2')]},'facebook':{'type':Sequelize[_0x460e('0x2')]},'fb_data':{'type':Sequelize[_0x460e('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x460e('0x2')]},'teams':{'type':Sequelize[_0x460e('0x2')]},'viber':{'type':Sequelize[_0x460e('0x2')]},'line':{'type':Sequelize[_0x460e('0x2')]},'wechat':{'type':Sequelize[_0x460e('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x460e('0x4')](0x2)[_0x460e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x460e('0x6')],'defaultValue':Sequelize[_0x460e('0x7')]}}; \ No newline at end of file +var _0x6463=['lodash','exports','STRING','INTEGER','DATE','NOW'];(function(_0x25a168,_0xde3b74){var _0x1f1485=function(_0x315b68){while(--_0x315b68){_0x25a168['push'](_0x25a168['shift']());}};_0x1f1485(++_0xde3b74);}(_0x6463,0x66));var _0x3646=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6463[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3646('0x0'));var Sequelize=require('sequelize');module[_0x3646('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x3646('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x3646('0x2')]},'city':{'type':Sequelize[_0x3646('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x3646('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x3646('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x3646('0x2')]},'email':{'type':Sequelize[_0x3646('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x3646('0x2')]},'twitter':{'type':Sequelize[_0x3646('0x2')]},'skype':{'type':Sequelize[_0x3646('0x2')]},'teams':{'type':Sequelize[_0x3646('0x2')]},'viber':{'type':Sequelize[_0x3646('0x2')]},'line':{'type':Sequelize[_0x3646('0x2')]},'wechat':{'type':Sequelize[_0x3646('0x2')]},'telegram':{'type':Sequelize[_0x3646('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x3646('0x3')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x3646('0x4')],'defaultValue':Sequelize[_0x3646('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1e445e2..e7080ad 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 _0x4034=['ContactId','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','chmodSync','0777','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','start\x20child\x20process\x20correctly!','error\x20child\x20process','getJourney','mail','sms','openchannel','whatsapp','voice','resolve','channel','includes','Invalid\x20channel','toLowerCase','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','starttime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','DESC','VoiceCallReport','findAndCountAll','chat','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','osName','ratingValue','referer','subject','startCase','Interaction','flatten','sortBy','slice','bluebird','util','path','squel','ioredis','../../components/parsers/qs','../../config/logger','redis','register','status','offset','undefined','limit','count','set','Content-Range','json','destroy','then','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','push','cf_','fieldType','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','Tag','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','and','value','dateOfBirth','datetime','castTo','buildExpression','type','text','filter','isNil','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','length','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','SELECT','having','t.id\x20IN\x20?','agent','some','User','user','getLists','c.ListId\x20IS\x20NULL','role','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','displayName','analytics','CmCustomField','findAll','alias','custom','values','merge','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','ChatInteraction','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappQueueReport','create','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','$and','omit','format','cf_%d','table','cm_contacts','id\x20=\x20?','toParam','phone','findOne','options','getTags','setTags','ids','rawAttributes','includeAll','getHopperHistories','include','getHopperFinals','getJscriptySessions','JscriptySessionReport'];(function(_0x578fe0,_0x5556d5){var _0x5167a6=function(_0x50d022){while(--_0x50d022){_0x578fe0['push'](_0x578fe0['shift']());}};_0x5167a6(++_0x5556d5);}(_0x4034,0x166));var _0x4403=function(_0xfc406a,_0x4479e1){_0xfc406a=_0xfc406a-0x0;var _0x395473=_0x4034[_0xfc406a];return _0x395473;};'use strict';var moment=require('moment');var BPromise=require(_0x4403('0x0'));var util=require(_0x4403('0x1'));var path=require(_0x4403('0x2'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4403('0x3'));var Papa=require('papaparse');var Redis=require(_0x4403('0x4'));var qs=require(_0x4403('0x5'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x4403('0x6'))('api');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x4403('0x7')]=_['defaults'](config[_0x4403('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./cmContact.socket')[_0x4403('0x8')](socket);function respondWithResult(_0x2b91b5,_0x5f3756){_0x5f3756=_0x5f3756||0xc8;return function(_0x3eee9e){if(_0x3eee9e){return _0x2b91b5[_0x4403('0x9')](_0x5f3756)['json'](_0x3eee9e);}};}function respondWithFilteredResult(_0x2544c5,_0x69de2c){return function(_0x39ebca){if(_0x39ebca){var _0x52d84d=typeof _0x69de2c[_0x4403('0xa')]===_0x4403('0xb')&&typeof _0x69de2c[_0x4403('0xc')]===_0x4403('0xb');var _0x1309d8=_0x39ebca['count'];var _0x192dc8=_0x52d84d?0x0:_0x69de2c['offset'];var _0x3b940d=_0x52d84d?_0x39ebca[_0x4403('0xd')]:_0x69de2c['offset']+_0x69de2c[_0x4403('0xc')];var _0x23148e;if(_0x3b940d>=_0x1309d8){_0x3b940d=_0x1309d8;_0x23148e=0xc8;}else{_0x23148e=0xce;}_0x2544c5[_0x4403('0x9')](_0x23148e);return _0x2544c5[_0x4403('0xe')](_0x4403('0xf'),_0x192dc8+'-'+_0x3b940d+'/'+_0x1309d8)[_0x4403('0x10')](_0x39ebca);}return null;};}function saveUpdates(_0x1086fb){return function(_0x1a247b){if(_0x1a247b){return _0x1a247b['update'](_0x1086fb)['then'](function(_0x3e097d){return _0x3e097d;});}return null;};}function removeEntity(_0x475374){return function(_0x5ed2dc){if(_0x5ed2dc){return _0x5ed2dc[_0x4403('0x11')]()[_0x4403('0x12')](function(){_0x475374['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1eb151){return function(_0x50aa92){if(!_0x50aa92){_0x1eb151[_0x4403('0x13')](0x194);}return _0x50aa92;};}function handleError(_0x275d33,_0x428c94){_0x428c94=_0x428c94||0x1f4;return function(_0x5f57b6){logger[_0x4403('0x14')](_0x5f57b6[_0x4403('0x15')]);if(_0x5f57b6[_0x4403('0x16')]){delete _0x5f57b6[_0x4403('0x16')];}_0x275d33['status'](_0x428c94)[_0x4403('0x17')](_0x5f57b6);};}exports[_0x4403('0x18')]=function(_0x382ed7,_0x11f975){var _0x2f7809={},_0x22f964={},_0x4da90d={'count':0x0,'rows':[]};return db[_0x4403('0x19')][_0x4403('0x1a')]()[_0x4403('0x12')](function(_0x1c549a){var _0x132cf3=[];for(var _0x3e037d=0x0;_0x3e037d0x1){_0x4d5b32['or'](_0x4403('0x55'),qs[_0x4403('0x56')](_0x4312bd),null);}else{if(qs[_0x4403('0x57')](_0x4312bd)){_0x4d5b32['or'](_0x4403('0x58'),_0x4312bd+'%');_0x4d5b32['or'](_0x4403('0x59'),_0x4312bd+'%');_0x4d5b32['or'](_0x4403('0x5a'),_0x4312bd+'%');_0x4d5b32['or'](_0x4403('0x5b'),_0x4312bd+'%');}else if(qs['isEmail'](_0x4312bd)){_0x4d5b32['or'](_0x4403('0x5c'),_0x4312bd+'%');}else{_0x4d5b32['or'](_0x4403('0x5d'),'%'+_0x4312bd+'%');_0x4d5b32['or'](_0x4403('0x5e'),'%'+_0x4312bd+'%');_0x4d5b32['or'](_0x4403('0x5c'),'%'+_0x4312bd+'%');}}}}_0x3a4775[_0x4403('0x2a')](_0x4d5b32);_0x3a4775[_0x4403('0x5f')](_0x4403('0x60'));var _0x47fa7b={'type':db[_0x4403('0x61')]['QueryTypes'][_0x4403('0x62')],'raw':!![]};var _0x37b93e=_0x3a4775['clone']()[_0x4403('0x2d')]('c.id');if(_0x2f7809[_0x4403('0x28')]){_0x2f7809[_0x4403('0x28')][_0x4403('0x3f')](function(_0x5ab592){_0x3a4775['order']('c.'+_0x5ab592[0x0],_0x5ab592[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4403('0x4c')](_0x2c6c39)){_0x3a4775[_0x4403('0x63')](_0x336057);_0x37b93e['where'](_0x4403('0x64'),_0x2c6c39);}BPromise['resolve']()[_0x4403('0x12')](function(){if(!_0x405314)return;if(_0x382ed7['user']['role']!==_0x4403('0x65'))return;if(!_[_0x4403('0x66')](_0x405314['conditions'],[_0x4403('0x2d'),_0x4403('0x67')])){return _0x382ed7[_0x4403('0x68')][_0x4403('0x69')]({'attributes':['id'],'raw':!![]})['then'](function(_0x83973b){if(_[_0x4403('0x4c')](_0x83973b)){_0x37b93e['where'](_0x4403('0x6a'));_0x3a4775[_0x4403('0x2a')]('c.ListId\x20IS\x20NULL');}else{_0x37b93e[_0x4403('0x2a')]('c.ListId\x20IN\x20?',_[_0x4403('0x3e')](_0x83973b,'id'));_0x3a4775[_0x4403('0x2a')]('c.ListId\x20IN\x20?',_[_0x4403('0x3e')](_0x83973b,'id'));}});}})[_0x4403('0x12')](function(){if(_0x382ed7[_0x4403('0x68')][_0x4403('0x6b')]==='agent'&&!_0x405314&&!_0x382ed7[_0x4403('0x21')][_0x4403('0x4d')])return[];return db['sequelize'][_0x4403('0x21')](_0x37b93e['toString'](),_0x47fa7b);})[_0x4403('0x12')](function(_0x1d571f){_0x4da90d[_0x4403('0xd')]=_0x1d571f[_0x4403('0x54')];if(_0x4da90d[_0x4403('0xd')]===0x0)return[];return db[_0x4403('0x6c')][_0x4403('0x21')](_0x4e0ddd[_0x4403('0x6d')](),_0x47fa7b)['then'](function(_0x1374cb){_0x38d7f8=_[_0x4403('0x6e')](_0x1374cb,'id');_0x47fa7b=_['merge'](_0x47fa7b,{'model':db[_0x4403('0x19')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x382ed7[_0x4403('0x21')][_0x4403('0x25')]){_0x2f7809[_0x4403('0x24')]['forEach'](function(_0xe06ed7){_0x3a4775[_0x4403('0x2d')]('c.'+_0xe06ed7);});}else{_0x3a4775[_0x4403('0x2d')](_0x4403('0x60'));_0x3a4775['field'](_0x4403('0x6f'));_0x3a4775[_0x4403('0x2d')](_0x4403('0x70'));_0x3a4775['field'](_0x4403('0x71'));_0x3a4775[_0x4403('0x2d')](_0x4403('0x72'));_0x3a4775['field'](_0x4403('0x73'));_0x3a4775['field']('c.email');_0x3a4775[_0x4403('0x2d')](_0x4403('0x74'));_0x3a4775['field'](_0x4403('0x75'));_0x3a4775[_0x4403('0x2d')](_0x4403('0x76'));_0x3a4775[_0x4403('0x2d')](_0x4403('0x77'));_0x3a4775[_0x4403('0x2d')](_0x4403('0x78'),_0x4403('0x79'));}if(_0x2f7809['limit'])_0x3a4775['limit'](_0x2f7809['limit']);if(_0x2f7809[_0x4403('0xa')])_0x3a4775[_0x4403('0xa')](_0x2f7809[_0x4403('0xa')]);return db['sequelize'][_0x4403('0x21')](_0x3a4775[_0x4403('0x6d')](),_0x47fa7b);});})['then'](function(_0x25fc54){_0x25fc54[_0x4403('0x3f')](function(_0x51cdf4){if(_0x51cdf4[_0x4403('0x79')]){_0x51cdf4[_0x4403('0x7a')]=[];_0x51cdf4[_0x4403('0x79')]['split'](',')[_0x4403('0x3f')](function(_0x188b83){_0x51cdf4[_0x4403('0x7a')][_0x4403('0x1d')](_0x38d7f8[_0x188b83]);});}delete _0x51cdf4['TagIds'];});_0x4da90d[_0x4403('0x7b')]=_0x25fc54;return _0x4da90d;})[_0x4403('0x12')](respondWithFilteredResult(_0x11f975,_0x2f7809));})[_0x4403('0x7c')](handleError(_0x11f975,null));};exports['destroy']=function(_0x2c0fdd,_0xced68f){return db[_0x4403('0x19')][_0x4403('0x3b')]({'where':{'id':_0x2c0fdd[_0x4403('0x7d')]['id']}})[_0x4403('0x12')](handleEntityNotFound(_0xced68f,null))[_0x4403('0x12')](removeEntity(_0xced68f,null))[_0x4403('0x7c')](handleError(_0xced68f,null));};exports[_0x4403('0x1a')]=function(_0x3864cd,_0x1dc8b0){return db[_0x4403('0x19')][_0x4403('0x1a')]()[_0x4403('0x12')](function(_0x10b2d2){delete _0x10b2d2[_0x4403('0x7e')];for(var _0xcb294b=0x0;_0xcb294b=_0x4df10c){_0x5ad729=_0x4df10c;_0x2f0e9e=0xc8;}else{_0x2f0e9e=0xce;}_0x32036d[_0xc15d('0x12')](_0x2f0e9e);return _0x32036d[_0xc15d('0x13')](_0xc15d('0x14'),_0x4b4dc5+'-'+_0x5ad729+'/'+_0x4df10c)['json'](_0x396cbc);}return null;};}function saveUpdates(_0x34588d){return function(_0x2bbb2f){if(_0x2bbb2f){return _0x2bbb2f[_0xc15d('0x15')](_0x34588d)['then'](function(_0x1cf854){return _0x1cf854;});}return null;};}function removeEntity(_0x5cf8cb){return function(_0x55cfff){if(_0x55cfff){return _0x55cfff[_0xc15d('0x16')]()['then'](function(){_0x5cf8cb[_0xc15d('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x44a9ef){return function(_0x48213f){if(!_0x48213f){_0x44a9ef[_0xc15d('0x17')](0x194);}return _0x48213f;};}function handleError(_0x4f898f,_0x229f7b){_0x229f7b=_0x229f7b||0x1f4;return function(_0x43fbfb){logger['error'](_0x43fbfb[_0xc15d('0x18')]);if(_0x43fbfb[_0xc15d('0x19')]){delete _0x43fbfb[_0xc15d('0x19')];}_0x4f898f['status'](_0x229f7b)['send'](_0x43fbfb);};}exports[_0xc15d('0x1a')]=function(_0x3c9771,_0x2e7405){var _0x580abe={},_0x57173a={},_0x185294={'count':0x0,'rows':[]};return db[_0xc15d('0x1b')][_0xc15d('0x1c')]()[_0xc15d('0x1d')](function(_0x38cac0){var _0x8b076d=[];for(var _0x36276a=0x0;_0x36276a0x1){_0x46d556['or'](_0xc15d('0x5b'),qs[_0xc15d('0x5c')](_0x3369d0),null);}else{if(qs['isNumeric'](_0x3369d0)){_0x46d556['or'](_0xc15d('0x5d'),_0x3369d0+'%');_0x46d556['or'](_0xc15d('0x5e'),_0x3369d0+'%');_0x46d556['or'](_0xc15d('0x5f'),_0x3369d0+'%');_0x46d556['or'](_0xc15d('0x60'),_0x3369d0+'%');}else if(qs[_0xc15d('0x61')](_0x3369d0)){_0x46d556['or']('c.email\x20LIKE\x20?',_0x3369d0+'%');}else{_0x46d556['or'](_0xc15d('0x62'),'%'+_0x3369d0+'%');_0x46d556['or']('c.lastName\x20LIKE\x20?','%'+_0x3369d0+'%');_0x46d556['or'](_0xc15d('0x63'),'%'+_0x3369d0+'%');}}}}_0x301ecf[_0xc15d('0x31')](_0x46d556);_0x301ecf[_0xc15d('0x64')](_0xc15d('0x65'));var _0x4bb9ca={'type':db[_0xc15d('0x66')][_0xc15d('0x67')][_0xc15d('0x68')],'raw':!![]};var _0x343152=_0x301ecf[_0xc15d('0x69')]()[_0xc15d('0x34')](_0xc15d('0x65'));if(_0x580abe[_0xc15d('0x6a')]){_0x580abe[_0xc15d('0x6a')][_0xc15d('0x48')](function(_0x3e518a){_0x301ecf[_0xc15d('0x6a')]('c.'+_0x3e518a[0x0],_0x3e518a[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc15d('0x6b')](_0x3fe974)){_0x301ecf['having'](_0x380c76);_0x343152[_0xc15d('0x31')]('t.id\x20IN\x20?',_0x3fe974);}BPromise['resolve']()['then'](function(){if(!_0x1bb1fc)return;if(_0x3c9771[_0xc15d('0x6c')][_0xc15d('0x6d')]!==_0xc15d('0x6e'))return;if(!_[_0xc15d('0x6f')](_0x1bb1fc[_0xc15d('0x42')],[_0xc15d('0x34'),_0xc15d('0x4a')])){return _0x3c9771['user'][_0xc15d('0x70')]({'attributes':['id'],'raw':!![]})[_0xc15d('0x1d')](function(_0x59d6a6){if(_['isEmpty'](_0x59d6a6)){_0x343152['where'](_0xc15d('0x71'));_0x301ecf['where']('c.ListId\x20IS\x20NULL');}else{_0x343152[_0xc15d('0x31')]('c.ListId\x20IN\x20?',_['map'](_0x59d6a6,'id'));_0x301ecf['where']('c.ListId\x20IN\x20?',_[_0xc15d('0x47')](_0x59d6a6,'id'));}});}})[_0xc15d('0x1d')](function(){if(_0x3c9771[_0xc15d('0x6c')][_0xc15d('0x6d')]===_0xc15d('0x6e')&&!_0x1bb1fc&&!_0x3c9771[_0xc15d('0x28')][_0xc15d('0x53')])return[];return db[_0xc15d('0x72')]['query'](_0x343152[_0xc15d('0x73')](),_0x4bb9ca);})[_0xc15d('0x1d')](function(_0x292976){_0x185294[_0xc15d('0x11')]=_0x292976[_0xc15d('0x1e')];if(_0x185294['count']===0x0)return[];return db['sequelize'][_0xc15d('0x28')](_0x328821[_0xc15d('0x73')](),_0x4bb9ca)['then'](function(_0x141e58){_0x149487=_[_0xc15d('0x74')](_0x141e58,'id');_0x4bb9ca=_['merge'](_0x4bb9ca,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3c9771['query'][_0xc15d('0x2d')]){_0x580abe[_0xc15d('0x2c')][_0xc15d('0x48')](function(_0x1fa62a){_0x301ecf[_0xc15d('0x34')]('c.'+_0x1fa62a);});}else{_0x301ecf[_0xc15d('0x34')](_0xc15d('0x65'));_0x301ecf['field'](_0xc15d('0x75'));_0x301ecf[_0xc15d('0x34')](_0xc15d('0x76'));_0x301ecf[_0xc15d('0x34')]('c.phone');_0x301ecf['field'](_0xc15d('0x77'));_0x301ecf[_0xc15d('0x34')](_0xc15d('0x78'));_0x301ecf['field'](_0xc15d('0x79'));_0x301ecf[_0xc15d('0x34')](_0xc15d('0x7a'));_0x301ecf[_0xc15d('0x34')](_0xc15d('0x7b'));_0x301ecf[_0xc15d('0x34')]('c.deletedAt');_0x301ecf[_0xc15d('0x34')](_0xc15d('0x7c'));_0x301ecf[_0xc15d('0x34')](_0xc15d('0x7d'),'TagIds');}if(_0x580abe[_0xc15d('0x10')])_0x301ecf[_0xc15d('0x10')](_0x580abe[_0xc15d('0x10')]);if(_0x580abe[_0xc15d('0xe')])_0x301ecf[_0xc15d('0xe')](_0x580abe['offset']);return db['sequelize'][_0xc15d('0x28')](_0x301ecf[_0xc15d('0x73')](),_0x4bb9ca);});})[_0xc15d('0x1d')](function(_0x4c0fff){_0x4c0fff[_0xc15d('0x48')](function(_0x5ee4db){if(_0x5ee4db['TagIds']){_0x5ee4db['Tags']=[];_0x5ee4db[_0xc15d('0x7e')][_0xc15d('0x46')](',')['forEach'](function(_0x5c4356){_0x5ee4db[_0xc15d('0x7f')][_0xc15d('0x22')](_0x149487[_0x5c4356]);});}delete _0x5ee4db[_0xc15d('0x7e')];});_0x185294['rows']=_0x4c0fff;return _0x185294;})[_0xc15d('0x1d')](respondWithFilteredResult(_0x2e7405,_0x580abe));})[_0xc15d('0x80')](handleError(_0x2e7405,null));};exports[_0xc15d('0x16')]=function(_0x4e6305,_0x589fc2){return db['CmContact'][_0xc15d('0x43')]({'where':{'id':_0x4e6305[_0xc15d('0x81')]['id']}})[_0xc15d('0x1d')](handleEntityNotFound(_0x589fc2,null))['then'](removeEntity(_0x589fc2,null))[_0xc15d('0x80')](handleError(_0x589fc2,null));};exports[_0xc15d('0x1c')]=function(_0x46d9a9,_0x455b9a){return db[_0xc15d('0x1b')]['describe']()[_0xc15d('0x1d')](function(_0x228bde){delete _0x228bde['tags'];for(var _0x4f8aee=0x0;_0x4f8aee{}\s\\|]/g,'-');_0x2c6d0e(null,util[_0xc55e('0x22')](_0xc55e('0x23'),path[_0xc55e('0x24')](_0x57b55c['originalname'],path[_0xc55e('0x25')](_0x57b55c[_0xc55e('0x20')])),Date[_0xc55e('0x26')](),path[_0xc55e('0x25')](_0x57b55c[_0xc55e('0x20')])));}})});router['post']('/csv',upload[_0xc55e('0x27')](_0xc55e('0x28')),controller[_0xc55e('0x29')]);var upload=multer({'storage':multer[_0xc55e('0x1d')]({'destination':function(_0x52963d,_0x634ee3,_0x472fb1){_0x472fb1(null,path[_0xc55e('0x1e')](config[_0xc55e('0x2a')],'server/files/tmp'));},'filename':function(_0x413cfc,_0x5326f7,_0x13d8c4){_0x5326f7['originalname']=_0x5326f7[_0xc55e('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x13d8c4(null,util[_0xc55e('0x22')](_0xc55e('0x23'),path[_0xc55e('0x24')](_0x5326f7[_0xc55e('0x20')],path[_0xc55e('0x25')](_0x5326f7[_0xc55e('0x20')])),Date[_0xc55e('0x26')](),path['extname'](_0x5326f7[_0xc55e('0x20')])));}})});router[_0xc55e('0x1a')](_0xc55e('0x2b'),upload[_0xc55e('0x27')](_0xc55e('0x28')),controller[_0xc55e('0x2c')]);router[_0xc55e('0x1a')](_0xc55e('0x2d'),auth[_0xc55e('0x8')](),controller['import']);router['put'](_0xc55e('0xc'),auth[_0xc55e('0x8')](),controller['update']);router['delete'](_0xc55e('0xc'),auth[_0xc55e('0x8')](),controller[_0xc55e('0x2e')]);module[_0xc55e('0x2f')]=router; \ No newline at end of file +var _0x34ad=['single','file','diskStorage','join','root','format','now','import','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','describe','/:id','show','getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','/:id/journey','post','merge','create','/create_many','/:id/tags','setTags','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','/csv'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34ad,0xd9));var _0xd34a=function(_0x4c9f70,_0x53990b){_0x4c9f70=_0x4c9f70-0x0;var _0x3b1dd9=_0x34ad[_0x4c9f70];return _0x3b1dd9;};'use strict';var multer=require('multer');var util=require(_0xd34a('0x0'));var path=require(_0xd34a('0x1'));var timeout=require(_0xd34a('0x2'));var express=require(_0xd34a('0x3'));var router=express[_0xd34a('0x4')]();var fs_extra=require(_0xd34a('0x5'));var auth=require(_0xd34a('0x6'));var interaction=require(_0xd34a('0x7'));var config=require(_0xd34a('0x8'));var controller=require(_0xd34a('0x9'));router[_0xd34a('0xa')]('/',auth[_0xd34a('0xb')](),controller[_0xd34a('0xc')]);router[_0xd34a('0xa')]('/describe',auth[_0xd34a('0xb')](),controller[_0xd34a('0xd')]);router[_0xd34a('0xa')](_0xd34a('0xe'),auth['isAuthenticated'](),controller[_0xd34a('0xf')]);router[_0xd34a('0xa')]('/:id/tags',auth[_0xd34a('0xb')](),controller[_0xd34a('0x10')]);router['get'](_0xd34a('0x11'),auth[_0xd34a('0xb')](),controller[_0xd34a('0x12')]);router[_0xd34a('0xa')](_0xd34a('0x13'),auth[_0xd34a('0xb')](),controller[_0xd34a('0x14')]);router['get'](_0xd34a('0x15'),auth[_0xd34a('0xb')](),controller['getHopperFinals']);router['get'](_0xd34a('0x16'),auth[_0xd34a('0xb')](),controller[_0xd34a('0x17')]);router['get'](_0xd34a('0x18'),auth[_0xd34a('0xb')](),controller['getJourney']);router[_0xd34a('0x19')]('/merge',auth['isAuthenticated'](),controller[_0xd34a('0x1a')]);router[_0xd34a('0x19')]('/',auth[_0xd34a('0xb')](),controller[_0xd34a('0x1b')]);router[_0xd34a('0x19')](_0xd34a('0x1c'),auth['isAuthenticated'](),controller['bulkCreate']);router['post'](_0xd34a('0x1d'),auth['isAuthenticated'](),controller[_0xd34a('0x1e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x9fae73,_0x4c891c,_0x50846f){_0x50846f(null,path['join'](config['root'],_0xd34a('0x1f')));},'filename':function(_0x217a00,_0x4ae0b1,_0x4763e1){_0x4ae0b1[_0xd34a('0x20')]=_0x4ae0b1[_0xd34a('0x20')][_0xd34a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4763e1(null,util['format'](_0xd34a('0x22'),path[_0xd34a('0x23')](_0x4ae0b1[_0xd34a('0x20')],path['extname'](_0x4ae0b1[_0xd34a('0x20')])),Date['now'](),path[_0xd34a('0x24')](_0x4ae0b1[_0xd34a('0x20')])));}})});router[_0xd34a('0x19')](_0xd34a('0x25'),upload[_0xd34a('0x26')](_0xd34a('0x27')),controller['uploadCsv']);var upload=multer({'storage':multer[_0xd34a('0x28')]({'destination':function(_0x3b4e4f,_0x5ae125,_0x4a3300){_0x4a3300(null,path[_0xd34a('0x29')](config[_0xd34a('0x2a')],_0xd34a('0x1f')));},'filename':function(_0x14e1a9,_0x5e41d1,_0x5c8c7c){_0x5e41d1[_0xd34a('0x20')]=_0x5e41d1['originalname'][_0xd34a('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c8c7c(null,util[_0xd34a('0x2b')](_0xd34a('0x22'),path['basename'](_0x5e41d1[_0xd34a('0x20')],path[_0xd34a('0x24')](_0x5e41d1[_0xd34a('0x20')])),Date[_0xd34a('0x2c')](),path['extname'](_0x5e41d1[_0xd34a('0x20')])));}})});router[_0xd34a('0x19')]('/upload',upload[_0xd34a('0x26')](_0xd34a('0x27')),controller['upload']);router[_0xd34a('0x19')]('/upload/:id',auth[_0xd34a('0xb')](),controller[_0xd34a('0x2d')]);router[_0xd34a('0x2e')]('/:id',auth[_0xd34a('0xb')](),controller[_0xd34a('0x2f')]);router[_0xd34a('0x30')](_0xd34a('0xe'),auth[_0xd34a('0xb')](),controller[_0xd34a('0x31')]);module[_0xd34a('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index a2737c4..c887365 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 _0x3450=['exports','VIRTUAL','getDataValue','alias','STRING','setDataValue','name','TEXT','long','type','select','parse','values','isArray','stringify','ENUM','voice','sequelize','lodash'];(function(_0x3acfdb,_0x2ccde1){var _0x35df6c=function(_0x4ac534){while(--_0x4ac534){_0x3acfdb['push'](_0x3acfdb['shift']());}};_0x35df6c(++_0x2ccde1);}(_0x3450,0x1a0));var _0x0345=function(_0x4f83ea,_0x4b484e){_0x4f83ea=_0x4f83ea-0x0;var _0x3e41f6=_0x3450[_0x4f83ea];return _0x3e41f6;};'use strict';var Sequelize=require(_0x0345('0x0'));var _=require(_0x0345('0x1'));module[_0x0345('0x2')]={'name':{'type':Sequelize[_0x0345('0x3')],'get':function(_0x56fb94){return this[_0x0345('0x4')](_0x0345('0x5'));}},'alias':{'type':Sequelize[_0x0345('0x6')],'allowNull':![],'set':function(_0x427ba0){this[_0x0345('0x7')](_0x0345('0x5'),_0x427ba0?_0x427ba0:this[_0x0345('0x4')](_0x0345('0x8')));}},'type':{'type':Sequelize[_0x0345('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x0345('0x9')](_0x0345('0xa')),'get':function(){if(this['getDataValue'](_0x0345('0xb'))===_0x0345('0xc')){return JSON[_0x0345('0xd')](this[_0x0345('0x4')](_0x0345('0xe')));}else{return this[_0x0345('0x4')]('values');}},'set':function(_0x3992b8){if(Array[_0x0345('0xf')](_0x3992b8)){this[_0x0345('0x7')](_0x0345('0xe'),JSON[_0x0345('0x10')](_0x3992b8));}else{this[_0x0345('0x7')](_0x0345('0xe'),_0x3992b8);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x0345('0x11')](_0x0345('0x12'))}}; \ No newline at end of file +var _0xff33=['select','parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','lodash','exports','VIRTUAL','getDataValue','alias','STRING','TEXT','type'];(function(_0x2070bd,_0x1c5b25){var _0x9a3926=function(_0x338e16){while(--_0x338e16){_0x2070bd['push'](_0x2070bd['shift']());}};_0x9a3926(++_0x1c5b25);}(_0xff33,0x78));var _0x3ff3=function(_0x37cc52,_0x459a9b){_0x37cc52=_0x37cc52-0x0;var _0x2b4a90=_0xff33[_0x37cc52];return _0x2b4a90;};'use strict';var Sequelize=require('sequelize');var _=require(_0x3ff3('0x0'));module[_0x3ff3('0x1')]={'name':{'type':Sequelize[_0x3ff3('0x2')],'get':function(_0x4ed5f0){return this[_0x3ff3('0x3')](_0x3ff3('0x4'));}},'alias':{'type':Sequelize[_0x3ff3('0x5')],'allowNull':![],'set':function(_0x5a6f7e){this['setDataValue'](_0x3ff3('0x4'),_0x5a6f7e?_0x5a6f7e:this[_0x3ff3('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x3ff3('0x6')]('long'),'get':function(){if(this[_0x3ff3('0x3')](_0x3ff3('0x7'))===_0x3ff3('0x8')){return JSON[_0x3ff3('0x9')](this[_0x3ff3('0x3')](_0x3ff3('0xa')));}else{return this['getDataValue']('values');}},'set':function(_0x3f0bc5){if(Array[_0x3ff3('0xb')](_0x3f0bc5)){this[_0x3ff3('0xc')](_0x3ff3('0xa'),JSON['stringify'](_0x3f0bc5));}else{this[_0x3ff3('0xc')](_0x3ff3('0xa'),_0x3f0bc5);}}},'required':{'type':Sequelize[_0x3ff3('0xd')],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x3ff3('0xd')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x3ff3('0xe')](_0x3ff3('0xf'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index 33bffdb..47bc34e 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 _0x0388=['differenceBy','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','length','find','catch','body','create','transaction','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','model'];(function(_0x50df3e,_0x3f37cd){var _0x21a626=function(_0x13bea5){while(--_0x13bea5){_0x50df3e['push'](_0x50df3e['shift']());}};_0x21a626(++_0x3f37cd);}(_0x0388,0x12b));var _0x8038=function(_0x30a24e,_0x16ce65){_0x30a24e=_0x30a24e-0x0;var _0x23f5ff=_0x0388[_0x30a24e];return _0x23f5ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8038('0x0'));var zipdir=require(_0x8038('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8038('0x2'));var BPromise=require(_0x8038('0x3'));var Mustache=require(_0x8038('0x4'));var util=require(_0x8038('0x5'));var path=require(_0x8038('0x6'));var sox=require('sox');var csv=require(_0x8038('0x7'));var ejs=require(_0x8038('0x8'));var fs=require('fs');var fs_extra=require(_0x8038('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8038('0xa'));var jsforce=require(_0x8038('0xb'));var deskjs=require(_0x8038('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8038('0xd'));var Papa=require(_0x8038('0xe'));var Redis=require('ioredis');var authService=require(_0x8038('0xf'));var qs=require(_0x8038('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8038('0x11'));var logger=require(_0x8038('0x12'))(_0x8038('0x13'));var utils=require(_0x8038('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x8038('0x15'));var db=require(_0x8038('0x16'))['db'];function respondWithStatusCode(_0x14a56d,_0x35218c){_0x35218c=_0x35218c||0xcc;return function(_0x260d46){if(_0x260d46){return _0x14a56d['sendStatus'](_0x35218c);}return _0x14a56d['status'](_0x35218c)[_0x8038('0x17')]();};}function respondWithResult(_0x4090a1,_0x47c6a7){_0x47c6a7=_0x47c6a7||0xc8;return function(_0x10f51f){if(_0x10f51f){return _0x4090a1[_0x8038('0x18')](_0x47c6a7)[_0x8038('0x19')](_0x10f51f);}};}function respondWithFilteredResult(_0x1e2df9,_0x52be78){return function(_0x1aca52){if(_0x1aca52){var _0x37ae9a=typeof _0x52be78[_0x8038('0x1a')]===_0x8038('0x1b')&&typeof _0x52be78[_0x8038('0x1c')]===_0x8038('0x1b');var _0x5b4907=_0x1aca52[_0x8038('0x1d')];var _0xa022aa=_0x37ae9a?0x0:_0x52be78[_0x8038('0x1a')];var _0x1906cc=_0x37ae9a?_0x1aca52[_0x8038('0x1d')]:_0x52be78[_0x8038('0x1a')]+_0x52be78['limit'];var _0x5c7f67;if(_0x1906cc>=_0x5b4907){_0x1906cc=_0x5b4907;_0x5c7f67=0xc8;}else{_0x5c7f67=0xce;}_0x1e2df9[_0x8038('0x18')](_0x5c7f67);return _0x1e2df9[_0x8038('0x1e')](_0x8038('0x1f'),_0xa022aa+'-'+_0x1906cc+'/'+_0x5b4907)['json'](_0x1aca52);}return null;};}function patchUpdates(_0x5f389c){return function(_0x56f4e0){try{jsonpatch[_0x8038('0x20')](_0x56f4e0,_0x5f389c,!![]);}catch(_0xc7fe68){return BPromise[_0x8038('0x21')](_0xc7fe68);}return _0x56f4e0[_0x8038('0x22')]();};}function saveUpdates(_0x507e5e,_0x1f0404){return function(_0x169eb0){if(_0x169eb0){return _0x169eb0[_0x8038('0x23')](_0x507e5e)[_0x8038('0x24')](function(_0x4270bd){return _0x4270bd;});}return null;};}function removeEntity(_0x305872,_0xe08ebb){return function(_0x1481da){if(_0x1481da){return _0x1481da[_0x8038('0x25')]()[_0x8038('0x24')](function(){_0x305872[_0x8038('0x18')](0xcc)[_0x8038('0x17')]();});}};}function handleEntityNotFound(_0x4ee427,_0x42cc07){return function(_0x31f276){if(!_0x31f276){_0x4ee427[_0x8038('0x26')](0x194);}return _0x31f276;};}function handleError(_0x336d81,_0x193752){_0x193752=_0x193752||0x1f4;return function(_0x2956f4){logger[_0x8038('0x27')](_0x2956f4[_0x8038('0x28')]);if(_0x2956f4[_0x8038('0x29')]){delete _0x2956f4[_0x8038('0x29')];}_0x336d81[_0x8038('0x18')](_0x193752)[_0x8038('0x2a')](_0x2956f4);};}exports['index']=function(_0x39bb42,_0x37762c){var _0x167e85={},_0x439833={},_0x6502a1={'count':0x0,'rows':[]};var _0x17934a=_[_0x8038('0x2b')](db[_0x8038('0x2c')][_0x8038('0x2d')],function(_0x47e78e){return{'name':_0x47e78e[_0x8038('0x2e')],'type':_0x47e78e[_0x8038('0x2f')]['key']};});_0x439833[_0x8038('0x30')]=_[_0x8038('0x31')](_[_0x8038('0x2b')](_0x17934a,_0x8038('0x29')),[_0x8038('0x29')]);_0x439833[_0x8038('0x32')]=_['keys'](_0x39bb42[_0x8038('0x32')]);_0x439833[_0x8038('0x33')]=_[_0x8038('0x34')](_0x439833[_0x8038('0x30')],_0x439833['query']);_0x167e85['attributes']=_[_0x8038('0x34')](_0x439833[_0x8038('0x30')],qs[_0x8038('0x35')](_0x39bb42['query']['fields']));_0x167e85[_0x8038('0x36')]=_0x167e85[_0x8038('0x36')]['length']?_0x167e85[_0x8038('0x36')]:_0x439833[_0x8038('0x30')];if(!_0x39bb42[_0x8038('0x32')]['hasOwnProperty'](_0x8038('0x37'))){_0x167e85[_0x8038('0x1c')]=qs[_0x8038('0x1c')](_0x39bb42[_0x8038('0x32')][_0x8038('0x1c')]);_0x167e85[_0x8038('0x1a')]=qs[_0x8038('0x1a')](_0x39bb42[_0x8038('0x32')][_0x8038('0x1a')]);}_0x167e85['order']=qs[_0x8038('0x38')](_0x39bb42['query'][_0x8038('0x38')]);_0x167e85[_0x8038('0x39')]=qs[_0x8038('0x33')](_[_0x8038('0x3a')](_0x39bb42[_0x8038('0x32')],_0x439833[_0x8038('0x33')]),_0x17934a);if(_0x39bb42[_0x8038('0x32')][_0x8038('0x3b')]){_0x167e85[_0x8038('0x39')]=_['merge'](_0x167e85[_0x8038('0x39')],{'$or':_[_0x8038('0x2b')](_0x17934a,function(_0x375e23){if(_0x375e23[_0x8038('0x2f')]!==_0x8038('0x3c')){var _0x4141e7={};_0x4141e7[_0x375e23['name']]={'$like':'%'+_0x39bb42[_0x8038('0x32')][_0x8038('0x3b')]+'%'};return _0x4141e7;}})});}_0x167e85=_[_0x8038('0x3d')]({},_0x167e85,_0x39bb42[_0x8038('0x3e')]);var _0x1b4d4={'where':_0x167e85[_0x8038('0x39')]};return db[_0x8038('0x2c')][_0x8038('0x1d')](_0x1b4d4)[_0x8038('0x24')](function(_0x1fd4c6){_0x6502a1[_0x8038('0x1d')]=_0x1fd4c6;if(_0x39bb42['query'][_0x8038('0x3f')]){_0x167e85[_0x8038('0x40')]=[{'all':!![]}];}return db[_0x8038('0x2c')][_0x8038('0x41')](_0x167e85);})[_0x8038('0x24')](function(_0x1c2b8a){_0x6502a1['rows']=_0x1c2b8a;return _0x6502a1;})[_0x8038('0x24')](respondWithFilteredResult(_0x37762c,_0x167e85))['catch'](handleError(_0x37762c,null));};exports[_0x8038('0x42')]=function(_0x577e73,_0x86deb5){var _0x341d8e={'raw':!![],'where':{'id':_0x577e73[_0x8038('0x43')]['id']}},_0x32c846={};_0x32c846[_0x8038('0x30')]=_['keys'](db[_0x8038('0x2c')][_0x8038('0x2d')]);_0x32c846[_0x8038('0x32')]=_[_0x8038('0x44')](_0x577e73[_0x8038('0x32')]);_0x32c846[_0x8038('0x33')]=_[_0x8038('0x34')](_0x32c846[_0x8038('0x30')],_0x32c846[_0x8038('0x32')]);_0x341d8e[_0x8038('0x36')]=_[_0x8038('0x34')](_0x32c846['model'],qs['fields'](_0x577e73['query']['fields']));_0x341d8e[_0x8038('0x36')]=_0x341d8e[_0x8038('0x36')][_0x8038('0x45')]?_0x341d8e[_0x8038('0x36')]:_0x32c846['model'];if(_0x577e73['query'][_0x8038('0x3f')]){_0x341d8e[_0x8038('0x40')]=[{'all':!![]}];}_0x341d8e=_[_0x8038('0x3d')]({},_0x341d8e,_0x577e73[_0x8038('0x3e')]);return db[_0x8038('0x2c')][_0x8038('0x46')](_0x341d8e)['then'](handleEntityNotFound(_0x86deb5,null))[_0x8038('0x24')](respondWithResult(_0x86deb5,null))[_0x8038('0x47')](handleError(_0x86deb5,null));};exports[_0x8038('0x23')]=function(_0x510e19,_0x3c8cb5){if(_0x510e19[_0x8038('0x48')]['id']){delete _0x510e19[_0x8038('0x48')]['id'];}return db[_0x8038('0x2c')][_0x8038('0x46')]({'where':{'id':_0x510e19[_0x8038('0x43')]['id']}})[_0x8038('0x24')](handleEntityNotFound(_0x3c8cb5,null))[_0x8038('0x24')](saveUpdates(_0x510e19['body'],null))[_0x8038('0x24')](respondWithResult(_0x3c8cb5,null))[_0x8038('0x47')](handleError(_0x3c8cb5,null));};exports['destroy']=function(_0x24d8b4,_0x2d08f4){return db[_0x8038('0x2c')][_0x8038('0x46')]({'where':{'id':_0x24d8b4[_0x8038('0x43')]['id']}})[_0x8038('0x24')](handleEntityNotFound(_0x2d08f4,null))[_0x8038('0x24')](removeEntity(_0x2d08f4,null))['catch'](handleError(_0x2d08f4,null));};exports[_0x8038('0x49')]=function(_0x164af1,_0x49baf0){var _0x39874d;return db['sequelize'][_0x8038('0x4a')](function(_0x39389a){return db[_0x8038('0x2c')]['create'](_0x164af1[_0x8038('0x48')],{'transaction':_0x39389a})[_0x8038('0x24')](function(_0x2ff33a){_0x39874d=_0x2ff33a;var _0xead780={'type':db['Sequelize'][_0x8038('0x4b')],'transaction':_0x39389a};switch(_0x164af1[_0x8038('0x48')][_0x8038('0x2f')]){case _0x8038('0x4c'):_0xead780[_0x8038('0x2f')]=db[_0x8038('0x4d')][_0x8038('0x4b')];break;case _0x8038('0x4e'):_0xead780[_0x8038('0x2f')]=db[_0x8038('0x4d')][_0x8038('0x4f')];break;case _0x8038('0x50'):_0xead780[_0x8038('0x2f')]=db[_0x8038('0x4d')]['BOOLEAN'];_0xead780[_0x8038('0x51')]=![];break;default:}return db['sequelize'][_0x8038('0x52')][_0x8038('0x53')](_0x8038('0x54'),util[_0x8038('0x55')](_0x8038('0x56'),_0x39874d['id']),_0xead780);})['then'](function(){return _0x39874d;});})[_0x8038('0x24')](respondWithResult(_0x49baf0,0xc9))['catch'](handleError(_0x49baf0,null));}; \ No newline at end of file +var _0x7a87=['../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','reject','update','then','destroy','stack','name','send','CmCustomField','fieldName','type','key','model','differenceBy','map','keys','query','filters','attributes','intersection','fields','nolimit','order','where','pick','filter','merge','options','include','findAll','rows','params','rawAttributes','length','find','body','catch','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','cm_contacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment'];(function(_0x50007c,_0x1cbf11){var _0x5c1ec7=function(_0x52d038){while(--_0x52d038){_0x50007c['push'](_0x50007c['shift']());}};_0x5c1ec7(++_0x1cbf11);}(_0x7a87,0x131));var _0x77a8=function(_0x2ba670,_0x158522){_0x2ba670=_0x2ba670-0x0;var _0x27f18f=_0x7a87[_0x2ba670];return _0x27f18f;};'use strict';var emlformat=require(_0x77a8('0x0'));var rimraf=require(_0x77a8('0x1'));var zipdir=require(_0x77a8('0x2'));var jsonpatch=require(_0x77a8('0x3'));var rp=require(_0x77a8('0x4'));var moment=require(_0x77a8('0x5'));var BPromise=require(_0x77a8('0x6'));var Mustache=require('mustache');var util=require(_0x77a8('0x7'));var path=require(_0x77a8('0x8'));var sox=require(_0x77a8('0x9'));var csv=require(_0x77a8('0xa'));var ejs=require(_0x77a8('0xb'));var fs=require('fs');var fs_extra=require(_0x77a8('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x77a8('0xd'));var jsforce=require(_0x77a8('0xe'));var deskjs=require(_0x77a8('0xf'));var toCsv=require(_0x77a8('0xa'));var querystring=require(_0x77a8('0x10'));var Papa=require(_0x77a8('0x11'));var Redis=require('ioredis');var authService=require(_0x77a8('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x77a8('0x13'));var hardwareService=require(_0x77a8('0x14'));var logger=require(_0x77a8('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x77a8('0x16'));var licenseUtil=require(_0x77a8('0x17'));var db=require(_0x77a8('0x18'))['db'];function respondWithStatusCode(_0x49573a,_0x5c8b5d){_0x5c8b5d=_0x5c8b5d||0xcc;return function(_0x4c19ac){if(_0x4c19ac){return _0x49573a[_0x77a8('0x19')](_0x5c8b5d);}return _0x49573a['status'](_0x5c8b5d)[_0x77a8('0x1a')]();};}function respondWithResult(_0x2fd087,_0x4f114d){_0x4f114d=_0x4f114d||0xc8;return function(_0x11fe08){if(_0x11fe08){return _0x2fd087[_0x77a8('0x1b')](_0x4f114d)[_0x77a8('0x1c')](_0x11fe08);}};}function respondWithFilteredResult(_0x5bd934,_0x2c794a){return function(_0x2ca6e1){if(_0x2ca6e1){var _0x40d8b1=typeof _0x2c794a[_0x77a8('0x1d')]===_0x77a8('0x1e')&&typeof _0x2c794a['limit']===_0x77a8('0x1e');var _0x42864d=_0x2ca6e1[_0x77a8('0x1f')];var _0x499138=_0x40d8b1?0x0:_0x2c794a[_0x77a8('0x1d')];var _0x38ad3c=_0x40d8b1?_0x2ca6e1['count']:_0x2c794a[_0x77a8('0x1d')]+_0x2c794a[_0x77a8('0x20')];var _0x22fb70;if(_0x38ad3c>=_0x42864d){_0x38ad3c=_0x42864d;_0x22fb70=0xc8;}else{_0x22fb70=0xce;}_0x5bd934[_0x77a8('0x1b')](_0x22fb70);return _0x5bd934[_0x77a8('0x21')]('Content-Range',_0x499138+'-'+_0x38ad3c+'/'+_0x42864d)['json'](_0x2ca6e1);}return null;};}function patchUpdates(_0x37f268){return function(_0x239919){try{jsonpatch['apply'](_0x239919,_0x37f268,!![]);}catch(_0x46eaa1){return BPromise[_0x77a8('0x22')](_0x46eaa1);}return _0x239919['save']();};}function saveUpdates(_0x510bf0,_0x1b42f6){return function(_0x2e69a5){if(_0x2e69a5){return _0x2e69a5[_0x77a8('0x23')](_0x510bf0)[_0x77a8('0x24')](function(_0x26b79e){return _0x26b79e;});}return null;};}function removeEntity(_0x485e8a,_0x66960e){return function(_0x108847){if(_0x108847){return _0x108847[_0x77a8('0x25')]()['then'](function(){_0x485e8a[_0x77a8('0x1b')](0xcc)[_0x77a8('0x1a')]();});}};}function handleEntityNotFound(_0x4a0722,_0x557296){return function(_0x5a90c3){if(!_0x5a90c3){_0x4a0722['sendStatus'](0x194);}return _0x5a90c3;};}function handleError(_0x6063a8,_0x346312){_0x346312=_0x346312||0x1f4;return function(_0x31a671){logger['error'](_0x31a671[_0x77a8('0x26')]);if(_0x31a671[_0x77a8('0x27')]){delete _0x31a671[_0x77a8('0x27')];}_0x6063a8[_0x77a8('0x1b')](_0x346312)[_0x77a8('0x28')](_0x31a671);};}exports['index']=function(_0x2d94af,_0x39203b){var _0x1c1da9={},_0x592970={},_0x3f4fe0={'count':0x0,'rows':[]};var _0x8d4f1e=_['map'](db[_0x77a8('0x29')]['rawAttributes'],function(_0x4498e0){return{'name':_0x4498e0[_0x77a8('0x2a')],'type':_0x4498e0[_0x77a8('0x2b')][_0x77a8('0x2c')]};});_0x592970[_0x77a8('0x2d')]=_[_0x77a8('0x2e')](_[_0x77a8('0x2f')](_0x8d4f1e,'name'),['name']);_0x592970['query']=_[_0x77a8('0x30')](_0x2d94af[_0x77a8('0x31')]);_0x592970[_0x77a8('0x32')]=_['intersection'](_0x592970[_0x77a8('0x2d')],_0x592970['query']);_0x1c1da9[_0x77a8('0x33')]=_[_0x77a8('0x34')](_0x592970[_0x77a8('0x2d')],qs[_0x77a8('0x35')](_0x2d94af[_0x77a8('0x31')][_0x77a8('0x35')]));_0x1c1da9['attributes']=_0x1c1da9['attributes']['length']?_0x1c1da9[_0x77a8('0x33')]:_0x592970['model'];if(!_0x2d94af[_0x77a8('0x31')]['hasOwnProperty'](_0x77a8('0x36'))){_0x1c1da9[_0x77a8('0x20')]=qs['limit'](_0x2d94af['query'][_0x77a8('0x20')]);_0x1c1da9[_0x77a8('0x1d')]=qs['offset'](_0x2d94af[_0x77a8('0x31')][_0x77a8('0x1d')]);}_0x1c1da9[_0x77a8('0x37')]=qs['sort'](_0x2d94af[_0x77a8('0x31')]['sort']);_0x1c1da9[_0x77a8('0x38')]=qs[_0x77a8('0x32')](_[_0x77a8('0x39')](_0x2d94af[_0x77a8('0x31')],_0x592970[_0x77a8('0x32')]),_0x8d4f1e);if(_0x2d94af[_0x77a8('0x31')]['filter']){_0x1c1da9[_0x77a8('0x38')]=_['merge'](_0x1c1da9[_0x77a8('0x38')],{'$or':_['map'](_0x8d4f1e,function(_0x27b04c){if(_0x27b04c[_0x77a8('0x2b')]!=='VIRTUAL'){var _0xe96071={};_0xe96071[_0x27b04c[_0x77a8('0x27')]]={'$like':'%'+_0x2d94af[_0x77a8('0x31')][_0x77a8('0x3a')]+'%'};return _0xe96071;}})});}_0x1c1da9=_[_0x77a8('0x3b')]({},_0x1c1da9,_0x2d94af[_0x77a8('0x3c')]);var _0x1fa212={'where':_0x1c1da9['where']};return db[_0x77a8('0x29')][_0x77a8('0x1f')](_0x1fa212)[_0x77a8('0x24')](function(_0x31da23){_0x3f4fe0[_0x77a8('0x1f')]=_0x31da23;if(_0x2d94af[_0x77a8('0x31')]['includeAll']){_0x1c1da9[_0x77a8('0x3d')]=[{'all':!![]}];}return db[_0x77a8('0x29')][_0x77a8('0x3e')](_0x1c1da9);})[_0x77a8('0x24')](function(_0x174c1f){_0x3f4fe0[_0x77a8('0x3f')]=_0x174c1f;return _0x3f4fe0;})[_0x77a8('0x24')](respondWithFilteredResult(_0x39203b,_0x1c1da9))['catch'](handleError(_0x39203b,null));};exports['show']=function(_0x5cd037,_0x334b9a){var _0x2aab7a={'raw':!![],'where':{'id':_0x5cd037[_0x77a8('0x40')]['id']}},_0x3bcb3f={};_0x3bcb3f['model']=_[_0x77a8('0x30')](db['CmCustomField'][_0x77a8('0x41')]);_0x3bcb3f[_0x77a8('0x31')]=_['keys'](_0x5cd037[_0x77a8('0x31')]);_0x3bcb3f[_0x77a8('0x32')]=_[_0x77a8('0x34')](_0x3bcb3f[_0x77a8('0x2d')],_0x3bcb3f[_0x77a8('0x31')]);_0x2aab7a[_0x77a8('0x33')]=_['intersection'](_0x3bcb3f[_0x77a8('0x2d')],qs[_0x77a8('0x35')](_0x5cd037[_0x77a8('0x31')][_0x77a8('0x35')]));_0x2aab7a['attributes']=_0x2aab7a[_0x77a8('0x33')][_0x77a8('0x42')]?_0x2aab7a[_0x77a8('0x33')]:_0x3bcb3f[_0x77a8('0x2d')];if(_0x5cd037[_0x77a8('0x31')]['includeAll']){_0x2aab7a['include']=[{'all':!![]}];}_0x2aab7a=_[_0x77a8('0x3b')]({},_0x2aab7a,_0x5cd037[_0x77a8('0x3c')]);return db[_0x77a8('0x29')][_0x77a8('0x43')](_0x2aab7a)[_0x77a8('0x24')](handleEntityNotFound(_0x334b9a,null))['then'](respondWithResult(_0x334b9a,null))['catch'](handleError(_0x334b9a,null));};exports[_0x77a8('0x23')]=function(_0x1e496f,_0x4f5b5f){if(_0x1e496f[_0x77a8('0x44')]['id']){delete _0x1e496f[_0x77a8('0x44')]['id'];}return db[_0x77a8('0x29')][_0x77a8('0x43')]({'where':{'id':_0x1e496f[_0x77a8('0x40')]['id']}})[_0x77a8('0x24')](handleEntityNotFound(_0x4f5b5f,null))[_0x77a8('0x24')](saveUpdates(_0x1e496f[_0x77a8('0x44')],null))[_0x77a8('0x24')](respondWithResult(_0x4f5b5f,null))[_0x77a8('0x45')](handleError(_0x4f5b5f,null));};exports[_0x77a8('0x25')]=function(_0x14f6d3,_0x625b40){return db[_0x77a8('0x29')][_0x77a8('0x43')]({'where':{'id':_0x14f6d3[_0x77a8('0x40')]['id']}})[_0x77a8('0x24')](handleEntityNotFound(_0x625b40,null))[_0x77a8('0x24')](removeEntity(_0x625b40,null))['catch'](handleError(_0x625b40,null));};exports[_0x77a8('0x46')]=function(_0x22fce9,_0x1379e0){var _0x45c78a;return db[_0x77a8('0x47')][_0x77a8('0x48')](function(_0x102530){return db[_0x77a8('0x29')][_0x77a8('0x46')](_0x22fce9[_0x77a8('0x44')],{'transaction':_0x102530})['then'](function(_0x18c62d){_0x45c78a=_0x18c62d;var _0x41cf54={'type':db[_0x77a8('0x49')][_0x77a8('0x4a')],'transaction':_0x102530};switch(_0x22fce9[_0x77a8('0x44')]['type']){case _0x77a8('0x4b'):_0x41cf54[_0x77a8('0x2b')]=db[_0x77a8('0x49')][_0x77a8('0x4a')];break;case'number':_0x41cf54[_0x77a8('0x2b')]=db['Sequelize'][_0x77a8('0x4c')];break;case _0x77a8('0x4d'):_0x41cf54[_0x77a8('0x2b')]=db[_0x77a8('0x49')][_0x77a8('0x4e')];_0x41cf54[_0x77a8('0x4f')]=![];break;default:}return db[_0x77a8('0x47')][_0x77a8('0x50')]['addColumn'](_0x77a8('0x51'),util['format']('cf_%d',_0x45c78a['id']),_0x41cf54);})[_0x77a8('0x24')](function(){return _0x45c78a;});})[_0x77a8('0x24')](respondWithResult(_0x1379e0,0xc9))['catch'](handleError(_0x1379e0,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index ef09b90..af8e6de 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 _0x4f0e=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','CmCustomField','cm_custom_fields'];(function(_0x4dddcc,_0x5dae19){var _0x2e9da1=function(_0x141fc0){while(--_0x141fc0){_0x4dddcc['push'](_0x4dddcc['shift']());}};_0x2e9da1(++_0x5dae19);}(_0x4f0e,0xa8));var _0xe4f0=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0x4f0e[_0x54bac5];return _0xc15971;};'use strict';var _=require(_0xe4f0('0x0'));var util=require(_0xe4f0('0x1'));var logger=require(_0xe4f0('0x2'))(_0xe4f0('0x3'));var moment=require(_0xe4f0('0x4'));var BPromise=require(_0xe4f0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe4f0('0x6'));var rimraf=require(_0xe4f0('0x7'));var config=require(_0xe4f0('0x8'));var attributes=require(_0xe4f0('0x9'));module[_0xe4f0('0xa')]=function(_0xd2db53,_0x5ba0fb){return _0xd2db53[_0xe4f0('0xb')](_0xe4f0('0xc'),attributes,{'tableName':_0xe4f0('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x828d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api'];(function(_0x2c46af,_0x3470f4){var _0x3f06c7=function(_0x2fd871){while(--_0x2fd871){_0x2c46af['push'](_0x2c46af['shift']());}};_0x3f06c7(++_0x3470f4);}(_0x828d,0x7a));var _0xd828=function(_0x182cdd,_0x20c7d1){_0x182cdd=_0x182cdd-0x0;var _0x5c4424=_0x828d[_0x182cdd];return _0x5c4424;};'use strict';var _=require(_0xd828('0x0'));var util=require(_0xd828('0x1'));var logger=require(_0xd828('0x2'))(_0xd828('0x3'));var moment=require(_0xd828('0x4'));var BPromise=require(_0xd828('0x5'));var rp=require(_0xd828('0x6'));var fs=require('fs');var path=require(_0xd828('0x7'));var rimraf=require(_0xd828('0x8'));var config=require(_0xd828('0x9'));var attributes=require(_0xd828('0xa'));module[_0xd828('0xb')]=function(_0x573abf,_0x82326e){return _0x573abf[_0xd828('0xc')]('CmCustomField',attributes,{'tableName':_0xd828('0xd'),'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 925243f..f31baac 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 _0x1dc6=['then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0x1dc6,0x196));var _0x61dc=function(_0x5c722c,_0x3e739f){_0x5c722c=_0x5c722c-0x0;var _0xd993d=_0x1dc6[_0x5c722c];return _0xd993d;};'use strict';var _=require(_0x61dc('0x0'));var util=require(_0x61dc('0x1'));var moment=require(_0x61dc('0x2'));var BPromise=require(_0x61dc('0x3'));var rs=require(_0x61dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61dc('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x61dc('0x6'))(_0x61dc('0x7'));var config=require(_0x61dc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x61dc('0x9')][_0x61dc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4f32bc,_0x2de58e,_0x3e4c29){return new BPromise(function(_0x5cc004,_0x9c0b5e){return client[_0x61dc('0xb')](_0x4f32bc,_0x3e4c29)[_0x61dc('0xc')](function(_0x519271){logger[_0x61dc('0xd')](_0x61dc('0xe'),_0x2de58e,_0x61dc('0xf'));logger[_0x61dc('0x10')](_0x61dc('0x11'),_0x2de58e,_0x61dc('0xf'),JSON[_0x61dc('0x12')](_0x519271));if(_0x519271[_0x61dc('0x13')]){if(_0x519271[_0x61dc('0x13')]['code']===0x1f4){logger['error'](_0x61dc('0xe'),_0x2de58e,_0x519271[_0x61dc('0x13')][_0x61dc('0x14')]);return _0x9c0b5e(_0x519271[_0x61dc('0x13')]['message']);}logger[_0x61dc('0x13')](_0x61dc('0xe'),_0x2de58e,_0x519271[_0x61dc('0x13')][_0x61dc('0x14')]);return _0x5cc004(_0x519271[_0x61dc('0x13')]['message']);}else{logger[_0x61dc('0xd')](_0x61dc('0xe'),_0x2de58e,_0x61dc('0xf'));_0x5cc004(_0x519271[_0x61dc('0x15')][_0x61dc('0x14')]);}})['catch'](function(_0x549767){logger[_0x61dc('0x13')]('CmCustomField,\x20%s,\x20%s',_0x2de58e,_0x549767);_0x9c0b5e(_0x549767);});});} \ No newline at end of file +var _0x2d8b=['jayson/promise','client','http','request','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4708e3,_0x630b5){var _0x52977f=function(_0x3ea618){while(--_0x3ea618){_0x4708e3['push'](_0x4708e3['shift']());}};_0x52977f(++_0x630b5);}(_0x2d8b,0x132));var _0xb2d8=function(_0x329138,_0x569802){_0x329138=_0x329138-0x0;var _0x3b7486=_0x2d8b[_0x329138];return _0x3b7486;};'use strict';var _=require(_0xb2d8('0x0'));var util=require(_0xb2d8('0x1'));var moment=require('moment');var BPromise=require(_0xb2d8('0x2'));var rs=require(_0xb2d8('0x3'));var fs=require('fs');var Redis=require(_0xb2d8('0x4'));var db=require(_0xb2d8('0x5'))['db'];var utils=require(_0xb2d8('0x6'));var logger=require(_0xb2d8('0x7'))(_0xb2d8('0x8'));var config=require('../../config/environment');var jayson=require(_0xb2d8('0x9'));var client=jayson[_0xb2d8('0xa')][_0xb2d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35640a,_0x44c278,_0xe764f6){return new BPromise(function(_0x4bf6e5,_0x2acf39){return client[_0xb2d8('0xc')](_0x35640a,_0xe764f6)['then'](function(_0x1010a4){logger['info'](_0xb2d8('0xd'),_0x44c278,_0xb2d8('0xe'));logger['debug'](_0xb2d8('0xf'),_0x44c278,_0xb2d8('0xe'),JSON['stringify'](_0x1010a4));if(_0x1010a4[_0xb2d8('0x10')]){if(_0x1010a4[_0xb2d8('0x10')][_0xb2d8('0x11')]===0x1f4){logger[_0xb2d8('0x10')](_0xb2d8('0xd'),_0x44c278,_0x1010a4[_0xb2d8('0x10')][_0xb2d8('0x12')]);return _0x2acf39(_0x1010a4[_0xb2d8('0x10')][_0xb2d8('0x12')]);}logger[_0xb2d8('0x10')]('CmCustomField,\x20%s,\x20%s',_0x44c278,_0x1010a4[_0xb2d8('0x10')][_0xb2d8('0x12')]);return _0x4bf6e5(_0x1010a4[_0xb2d8('0x10')]['message']);}else{logger[_0xb2d8('0x13')](_0xb2d8('0xd'),_0x44c278,_0xb2d8('0xe'));_0x4bf6e5(_0x1010a4[_0xb2d8('0x14')][_0xb2d8('0x12')]);}})['catch'](function(_0x11ee9e){logger[_0xb2d8('0x10')](_0xb2d8('0xd'),_0x44c278,_0x11ee9e);_0x2acf39(_0x11ee9e);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 49990e5..a492194 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 _0x6299=['./cmCustomField.controller','get','isAuthenticated','index','show','put','/:id','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x14b943,_0x190c8a){var _0x47f784=function(_0x4b6fe4){while(--_0x4b6fe4){_0x14b943['push'](_0x14b943['shift']());}};_0x47f784(++_0x190c8a);}(_0x6299,0x169));var _0x9629=function(_0x59d09d,_0x544fb2){_0x59d09d=_0x59d09d-0x0;var _0x28f35a=_0x6299[_0x59d09d];return _0x28f35a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9629('0x0'));var timeout=require(_0x9629('0x1'));var express=require(_0x9629('0x2'));var router=express[_0x9629('0x3')]();var fs_extra=require(_0x9629('0x4'));var auth=require(_0x9629('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9629('0x6'));var controller=require(_0x9629('0x7'));router[_0x9629('0x8')]('/',auth[_0x9629('0x9')](),controller[_0x9629('0xa')]);router['get']('/:id',auth[_0x9629('0x9')](),controller[_0x9629('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x9629('0xc')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['update']);router[_0x9629('0xe')](_0x9629('0xd'),auth[_0x9629('0x9')](),controller['destroy']);module[_0x9629('0xf')]=router; \ No newline at end of file +var _0xadf0=['fs-extra','../../components/auth/service','../../config/environment','get','/:id','post','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x4cbf7c,_0x2a4767){var _0x15b435=function(_0x533186){while(--_0x533186){_0x4cbf7c['push'](_0x4cbf7c['shift']());}};_0x15b435(++_0x2a4767);}(_0xadf0,0x12d));var _0x0adf=function(_0x57fb97,_0xc36cb2){_0x57fb97=_0x57fb97-0x0;var _0x16e95b=_0xadf0[_0x57fb97];return _0x16e95b;};'use strict';var multer=require('multer');var util=require(_0x0adf('0x0'));var path=require(_0x0adf('0x1'));var timeout=require(_0x0adf('0x2'));var express=require(_0x0adf('0x3'));var router=express[_0x0adf('0x4')]();var fs_extra=require(_0x0adf('0x5'));var auth=require(_0x0adf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0adf('0x7'));var controller=require('./cmCustomField.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x0adf('0x8')](_0x0adf('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x0adf('0xa')]('/',auth[_0x0adf('0xb')](),controller['create']);router[_0x0adf('0xc')](_0x0adf('0x9'),auth['isAuthenticated'](),controller[_0x0adf('0xd')]);router[_0x0adf('0xe')](_0x0adf('0x9'),auth['isAuthenticated'](),controller[_0x0adf('0xf')]);module[_0x0adf('0x10')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 28084ac..bd97f53 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 _0xe519=['DATE','UNSIGNED','contactListQueue','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xe519,0x175));var _0x9e51=function(_0x3c4154,_0xeceab){_0x3c4154=_0x3c4154-0x0;var _0x33370f=_0xe519[_0x3c4154];return _0x33370f;};'use strict';var moment=require('moment');var Sequelize=require(_0x9e51('0x0'));module[_0x9e51('0x1')]={'phone':{'type':Sequelize[_0x9e51('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x9e51('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x9e51('0x4')](_0x9e51('0x5'))},'countbusyretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x9e51('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9e51('0x7')]},'priority':{'type':Sequelize[_0x9e51('0x6')](0x2)[_0x9e51('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x9e51('0x6')],'unique':_0x9e51('0x9')},'ListId':{'type':Sequelize[_0x9e51('0x6')],'unique':_0x9e51('0x9')},'UserId':{'type':Sequelize[_0x9e51('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x9e51('0x6')],'unique':_0x9e51('0x9')},'CampaignId':{'type':Sequelize[_0x9e51('0x6')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x9e51('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xfddf=['INTEGER','STRING','contactListQueue','moment','sequelize','exports','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x1ac50f,_0xd19e8d){var _0x5eb1d2=function(_0x236aaa){while(--_0x236aaa){_0x1ac50f['push'](_0x1ac50f['shift']());}};_0x5eb1d2(++_0xd19e8d);}(_0xfddf,0x175));var _0xffdd=function(_0x195686,_0xd329df){_0x195686=_0x195686-0x0;var _0xaf27a1=_0xfddf[_0x195686];return _0xaf27a1;};'use strict';var moment=require(_0xffdd('0x0'));var Sequelize=require(_0xffdd('0x1'));module[_0xffdd('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0xffdd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xffdd('0x4')],'defaultValue':moment()[_0xffdd('0x5')](_0xffdd('0x6'))},'countbusyretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xffdd('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xffdd('0x8')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xffdd('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xffdd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xffdd('0x9')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xffdd('0x9')},'UserId':{'type':Sequelize[_0xffdd('0x7')]},'VoiceQueueId':{'type':Sequelize[_0xffdd('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xffdd('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xffdd('0x7')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index ef7ee5a..2c1c264 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 _0x74c3=['eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','apply','reject','then','destroy','end','error','stack','name','send','index','CmHopper','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','updatedAt','state','deleted','membername','user','UserId','format','YYYY-MM-DD\x20HH:mm:ss','phone','queue','ivr','CmContact','ContactId','isNil','calleridname','firstName','lastName','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','direction','prev','isEmpty','hopperIds','ASC','sequelize','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','priority','scheduledAt','literal','findOne','scheduledat','recallme','LOCK','UPDATE','Contact','CmCompany','Company','CmList','List','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found'];(function(_0x5e254c,_0x340938){var _0x23b0e4=function(_0x5c0034){while(--_0x5c0034){_0x5e254c['push'](_0x5e254c['shift']());}};_0x23b0e4(++_0x340938);}(_0x74c3,0x94));var _0x374c=function(_0x2c0579,_0x4df456){_0x2c0579=_0x2c0579-0x0;var _0x4a8e11=_0x74c3[_0x2c0579];return _0x4a8e11;};'use strict';var emlformat=require(_0x374c('0x0'));var rimraf=require(_0x374c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x374c('0x2'));var rp=require(_0x374c('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x374c('0x4'));var util=require(_0x374c('0x5'));var path=require(_0x374c('0x6'));var sox=require('sox');var csv=require(_0x374c('0x7'));var ejs=require(_0x374c('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x374c('0x9'));var squel=require(_0x374c('0xa'));var crypto=require(_0x374c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x374c('0xc'));var toCsv=require(_0x374c('0x7'));var querystring=require(_0x374c('0xd'));var Papa=require(_0x374c('0xe'));var Redis=require(_0x374c('0xf'));var authService=require(_0x374c('0x10'));var qs=require(_0x374c('0x11'));var as=require(_0x374c('0x12'));var hardwareService=require(_0x374c('0x13'));var logger=require(_0x374c('0x14'))(_0x374c('0x15'));var utils=require(_0x374c('0x16'));var config=require(_0x374c('0x17'));var licenseUtil=require(_0x374c('0x18'));var db=require(_0x374c('0x19'))['db'];function respondWithStatusCode(_0x33cc87,_0x2cae0c){_0x2cae0c=_0x2cae0c||0xcc;return function(_0x4c1e4f){if(_0x4c1e4f){return _0x33cc87[_0x374c('0x1a')](_0x2cae0c);}return _0x33cc87[_0x374c('0x1b')](_0x2cae0c)['end']();};}function respondWithResult(_0x5d161b,_0x4d2de5){_0x4d2de5=_0x4d2de5||0xc8;return function(_0x3d2445){if(_0x3d2445){return _0x5d161b['status'](_0x4d2de5)[_0x374c('0x1c')](_0x3d2445);}};}function respondWithFilteredResult(_0x4d3abb,_0x3814ff){return function(_0x24ec07){if(_0x24ec07){var _0x79921e=typeof _0x3814ff[_0x374c('0x1d')]===_0x374c('0x1e')&&typeof _0x3814ff[_0x374c('0x1f')]===_0x374c('0x1e');var _0x3044e3=_0x24ec07[_0x374c('0x20')];var _0x2c1359=_0x79921e?0x0:_0x3814ff[_0x374c('0x1d')];var _0x3ddab5=_0x79921e?_0x24ec07[_0x374c('0x20')]:_0x3814ff[_0x374c('0x1d')]+_0x3814ff[_0x374c('0x1f')];var _0x24711a;if(_0x3ddab5>=_0x3044e3){_0x3ddab5=_0x3044e3;_0x24711a=0xc8;}else{_0x24711a=0xce;}_0x4d3abb[_0x374c('0x1b')](_0x24711a);return _0x4d3abb['set']('Content-Range',_0x2c1359+'-'+_0x3ddab5+'/'+_0x3044e3)[_0x374c('0x1c')](_0x24ec07);}return null;};}function patchUpdates(_0x45e140){return function(_0x594163){try{jsonpatch[_0x374c('0x21')](_0x594163,_0x45e140,!![]);}catch(_0x408ec1){return BPromise[_0x374c('0x22')](_0x408ec1);}return _0x594163['save']();};}function saveUpdates(_0x467410,_0x58a0b8){return function(_0x5115aa){if(_0x5115aa){return _0x5115aa['update'](_0x467410)[_0x374c('0x23')](function(_0x3e142f){return _0x3e142f;});}return null;};}function removeEntity(_0x36ca4a,_0x3c2467){return function(_0x56d197){if(_0x56d197){return _0x56d197[_0x374c('0x24')]()[_0x374c('0x23')](function(){_0x36ca4a[_0x374c('0x1b')](0xcc)[_0x374c('0x25')]();});}};}function handleEntityNotFound(_0x55ea02,_0x57d7bc){return function(_0x2c6fd8){if(!_0x2c6fd8){_0x55ea02[_0x374c('0x1a')](0x194);}return _0x2c6fd8;};}function handleError(_0x1e1e0a,_0xd96c8){_0xd96c8=_0xd96c8||0x1f4;return function(_0x385358){logger[_0x374c('0x26')](_0x385358[_0x374c('0x27')]);if(_0x385358[_0x374c('0x28')]){delete _0x385358[_0x374c('0x28')];}_0x1e1e0a[_0x374c('0x1b')](_0xd96c8)[_0x374c('0x29')](_0x385358);};}exports[_0x374c('0x2a')]=function(_0x4c7b14,_0x19496f){var _0x100cdc={},_0x1daf93={},_0x1603a4={'count':0x0,'rows':[]};var _0x1ff52a=_['map'](db[_0x374c('0x2b')][_0x374c('0x2c')],function(_0x20c5fd){return{'name':_0x20c5fd[_0x374c('0x2d')],'type':_0x20c5fd[_0x374c('0x2e')]['key']};});_0x1daf93['model']=_[_0x374c('0x2f')](_0x1ff52a,_0x374c('0x28'));_0x1daf93[_0x374c('0x30')]=_[_0x374c('0x31')](_0x4c7b14[_0x374c('0x30')]);_0x1daf93[_0x374c('0x32')]=_[_0x374c('0x33')](_0x1daf93[_0x374c('0x34')],_0x1daf93['query']);_0x1daf93['filters']=_['concat'](_0x1daf93[_0x374c('0x32')],['$and',_0x374c('0x35'),_0x374c('0x36'),_0x374c('0x37'),_0x374c('0x38'),_0x374c('0x39'),_0x374c('0x3a'),_0x374c('0x3b'),_0x374c('0x3c'),_0x374c('0x3d'),'$notBetween',_0x374c('0x3e'),_0x374c('0x3f'),_0x374c('0x40'),'$notLike',_0x374c('0x41'),_0x374c('0x42'),_0x374c('0x40'),_0x374c('0x43'),_0x374c('0x44'),_0x374c('0x45'),_0x374c('0x46')]);_0x100cdc[_0x374c('0x47')]=_[_0x374c('0x33')](_0x1daf93[_0x374c('0x34')],qs['fields'](_0x4c7b14[_0x374c('0x30')][_0x374c('0x48')]));_0x100cdc[_0x374c('0x47')]=_0x100cdc[_0x374c('0x47')][_0x374c('0x49')]?_0x100cdc[_0x374c('0x47')]:_0x1daf93[_0x374c('0x34')];if(!_0x4c7b14['query'][_0x374c('0x4a')](_0x374c('0x4b'))){_0x100cdc[_0x374c('0x1f')]=qs[_0x374c('0x1f')](_0x4c7b14['query'][_0x374c('0x1f')]);_0x100cdc[_0x374c('0x1d')]=qs[_0x374c('0x1d')](_0x4c7b14[_0x374c('0x30')][_0x374c('0x1d')]);}_0x100cdc['order']=qs[_0x374c('0x4c')](_0x4c7b14['query'][_0x374c('0x4c')]);_0x100cdc[_0x374c('0x4d')]=qs[_0x374c('0x32')](_[_0x374c('0x4e')](_0x4c7b14[_0x374c('0x30')],_0x1daf93[_0x374c('0x32')]),_0x1ff52a);if(_0x4c7b14[_0x374c('0x30')][_0x374c('0x4f')]){_0x100cdc[_0x374c('0x4d')]=_[_0x374c('0x50')](_0x100cdc[_0x374c('0x4d')],{'$or':_[_0x374c('0x2f')](_0x1ff52a,function(_0x5b8d61){if(_0x5b8d61['type']!==_0x374c('0x51')){var _0x19b522={};_0x19b522[_0x5b8d61[_0x374c('0x28')]]={'$like':'%'+_0x4c7b14[_0x374c('0x30')][_0x374c('0x4f')]+'%'};return _0x19b522;}})});}_0x100cdc=_[_0x374c('0x50')]({},_0x100cdc,_0x4c7b14[_0x374c('0x52')]);var _0x178c39={'where':_0x100cdc[_0x374c('0x4d')]};return db[_0x374c('0x2b')]['count'](_0x178c39)[_0x374c('0x23')](function(_0x4a4b57){_0x1603a4[_0x374c('0x20')]=_0x4a4b57;if(_0x4c7b14['query'][_0x374c('0x53')]){_0x100cdc[_0x374c('0x54')]=[{'all':!![]}];}return db[_0x374c('0x2b')][_0x374c('0x55')](_0x100cdc);})[_0x374c('0x23')](function(_0xe0120f){_0x1603a4[_0x374c('0x56')]=_0xe0120f;return _0x1603a4;})[_0x374c('0x23')](respondWithFilteredResult(_0x19496f,_0x100cdc))[_0x374c('0x57')](handleError(_0x19496f,null));};exports[_0x374c('0x58')]=function(_0x24ec77,_0x104764){var _0x2feef7={'raw':!![],'where':{'id':_0x24ec77[_0x374c('0x59')]['id']}},_0x49262d={};_0x49262d['model']=_[_0x374c('0x31')](db[_0x374c('0x2b')][_0x374c('0x2c')]);_0x49262d[_0x374c('0x30')]=_['keys'](_0x24ec77[_0x374c('0x30')]);_0x49262d[_0x374c('0x32')]=_[_0x374c('0x33')](_0x49262d[_0x374c('0x34')],_0x49262d[_0x374c('0x30')]);_0x2feef7['attributes']=_[_0x374c('0x33')](_0x49262d[_0x374c('0x34')],qs['fields'](_0x24ec77['query']['fields']));_0x2feef7[_0x374c('0x47')]=_0x2feef7[_0x374c('0x47')][_0x374c('0x49')]?_0x2feef7[_0x374c('0x47')]:_0x49262d[_0x374c('0x34')];if(_0x24ec77['query'][_0x374c('0x53')]){_0x2feef7[_0x374c('0x54')]=[{'all':!![]}];}_0x2feef7=_[_0x374c('0x50')]({},_0x2feef7,_0x24ec77[_0x374c('0x52')]);return db[_0x374c('0x2b')][_0x374c('0x5a')](_0x2feef7)[_0x374c('0x23')](handleEntityNotFound(_0x104764,null))[_0x374c('0x23')](respondWithResult(_0x104764,null))['catch'](handleError(_0x104764,null));};exports['create']=function(_0x4749ac,_0x4d078c){return db['CmHopper']['create'](_0x4749ac[_0x374c('0x5b')],{})[_0x374c('0x23')](respondWithResult(_0x4d078c,0xc9))[_0x374c('0x57')](handleError(_0x4d078c,null));};exports['update']=function(_0x1393b8,_0x1f082b){if(_0x1393b8[_0x374c('0x5b')]['id']){delete _0x1393b8[_0x374c('0x5b')]['id'];}return db[_0x374c('0x2b')][_0x374c('0x5a')]({'where':{'id':_0x1393b8[_0x374c('0x59')]['id']}})[_0x374c('0x23')](handleEntityNotFound(_0x1f082b,null))[_0x374c('0x23')](saveUpdates(_0x1393b8['body'],null))[_0x374c('0x23')](respondWithResult(_0x1f082b,null))[_0x374c('0x57')](handleError(_0x1f082b,null));};exports[_0x374c('0x5c')]=function(_0x17f95f,_0x3dad36){return db[_0x374c('0x2b')][_0x374c('0x5c')]()[_0x374c('0x23')](respondWithResult(_0x3dad36,null))['catch'](handleError(_0x3dad36,null));};exports[_0x374c('0x24')]=function(_0x539152,_0x2d123f){var _0x296d67;return db[_0x374c('0x2b')][_0x374c('0x5a')]({'where':{'id':_0x539152[_0x374c('0x59')]['id']}})[_0x374c('0x23')](handleEntityNotFound(_0x2d123f,null))[_0x374c('0x23')](function(_0x510def){if(_0x510def){return _0x510def[_0x374c('0x24')]()[_0x374c('0x23')](function(_0x599c72){return _0x599c72;});}})[_0x374c('0x23')](function(_0x3bad19){_0x296d67=_0x3bad19;if(_0x3bad19){if(_0x3bad19[_0x374c('0x5d')]||_0x3bad19[_0x374c('0x5e')]){return db[_0x3bad19['VoiceQueueId']?_0x374c('0x5f'):_0x374c('0x60')][_0x374c('0x5a')]({'where':{'id':_0x3bad19['VoiceQueueId']?_0x3bad19[_0x374c('0x5d')]:_0x3bad19['CampaignId']},'attributes':['id',_0x374c('0x28')],'raw':!![]});}}})[_0x374c('0x23')](function(_0x187acd){var _0x2b2c89={};if(_0x187acd){_[_0x374c('0x50')](_0x2b2c89,_[_0x374c('0x61')](_0x296d67[_0x374c('0x62')],['createdAt',_0x374c('0x63'),'id']));_0x2b2c89[_0x374c('0x64')]=0x15;_0x2b2c89['statedesc']=_0x374c('0x65');_0x2b2c89['campaign']=_0x187acd[_0x374c('0x28')];_0x2b2c89[_0x374c('0x66')]=_0x539152[_0x374c('0x67')][_0x374c('0x28')];_0x2b2c89[_0x374c('0x68')]=_0x539152[_0x374c('0x67')]['id'];_0x2b2c89['deleted']=!![];_0x2b2c89['deletedat']=moment()[_0x374c('0x69')](_0x374c('0x6a'));_0x2b2c89['calleridnum']=_0x296d67[_0x374c('0x6b')];_0x2b2c89['campaigntype']=_0x296d67['VoiceQueueId']?_0x374c('0x6c'):_0x374c('0x6d');return db[_0x374c('0x6e')][_0x374c('0x5a')]({'where':{'id':_0x2b2c89[_0x374c('0x6f')]},'attributes':['firstName','lastName']})[_0x374c('0x23')](function(_0x35cbfe){if(!_[_0x374c('0x70')](_0x2d123f)&&!_[_0x374c('0x70')](_0x35cbfe['firstName'])){_0x2b2c89[_0x374c('0x71')]=_0x35cbfe[_0x374c('0x72')];if(!_[_0x374c('0x70')](_0x35cbfe[_0x374c('0x73')])){_0x2b2c89[_0x374c('0x71')]+='\x20'+_0x35cbfe[_0x374c('0x73')];}}})['finally'](function(){return db[_0x374c('0x74')]['create'](_0x2b2c89);});}})['then'](function(){return _0x2d123f[_0x374c('0x1b')](0xcc)['end']();})[_0x374c('0x57')](handleError(_0x2d123f,null));};exports['getPreview']=function(_0x36ef58,_0x330b4d,_0x2b9e87){var _0x2a1458=[];return db[_0x374c('0x6e')][_0x374c('0x5c')]()[_0x374c('0x23')](function(_0x587057){_0x2a1458=_[_0x374c('0x31')](_0x587057);return _0x36ef58[_0x374c('0x67')][_0x374c('0x75')]({'where':{'type':_0x374c('0x76'),'dialActive':!![],'dialMethod':_0x374c('0x77')},'attributes':['id',_0x374c('0x78'),_0x374c('0x79')],'raw':!![]});})['then'](function(_0x102096){if(_0x102096&&_0x102096['length']){return db['sequelize']['transaction'](function(_0x163ef8){var _0x10fe8b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x374c('0x6a'))},'VoiceQueueId':{'$in':_[_0x374c('0x2f')](_0x102096,'id')},'$or':[{'UserId':null},{'UserId':_0x36ef58[_0x374c('0x67')]['id']}]};var _0x313ff7={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x102096)[_0x374c('0x4f')](['dialPreviewAutoRecallMe',0x0])[_0x374c('0x2f')]('id')['value']()},'$or':[{'UserId':null},{'UserId':_0x36ef58[_0x374c('0x67')]['id']}]};var _0x2a7174={'$or':[_0x10fe8b,_0x313ff7]};var _0xf5e489=[];if(_0x36ef58['body'][_0x374c('0x7a')]&&_0x36ef58[_0x374c('0x5b')]['direction']===_0x374c('0x7b')){if(!_[_0x374c('0x7c')](_0x36ef58[_0x374c('0x5b')][_0x374c('0x7d')])){_0x2a7174['id']={'$in':_0x36ef58[_0x374c('0x5b')][_0x374c('0x7d')]};}_0xf5e489=[['priority',_0x374c('0x7e')],['scheduledAt',_0x102096[0x0][_0x374c('0x78')]===_0x374c('0x7e')?'DESC':_0x374c('0x7e')],db[_0x374c('0x7f')]['literal'](_0x374c('0x80')),['id',_0x374c('0x81')]];}else{if(!_[_0x374c('0x7c')](_0x36ef58['body'][_0x374c('0x7d')])){_0x2a7174['id']={'$notIn':_0x36ef58[_0x374c('0x5b')][_0x374c('0x7d')]};}_0xf5e489=[[_0x374c('0x82'),'DESC'],[_0x374c('0x83'),_0x102096[0x0]['dialOrderByScheduledAt']],db[_0x374c('0x7f')][_0x374c('0x84')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x374c('0x7e')]];}return db[_0x374c('0x2b')][_0x374c('0x85')]({'attributes':['id',_0x374c('0x86'),_0x374c('0x87')],'where':_0x2a7174,'order':_0xf5e489,'transaction':_0x163ef8,'lock':_0x163ef8[_0x374c('0x88')][_0x374c('0x89')],'include':[{'model':db[_0x374c('0x6e')],'as':_0x374c('0x8a'),'attributes':_0x2a1458,'include':[{'model':db[_0x374c('0x8b')],'as':_0x374c('0x8c'),'attributes':['id','name']}]},{'model':db[_0x374c('0x8d')],'as':_0x374c('0x8e'),'attributes':['id',_0x374c('0x28')]},{'model':db[_0x374c('0x5f')],'as':'Queue','attributes':['id',_0x374c('0x28'),_0x374c('0x8f')]}]})[_0x374c('0x23')](function(_0x10b521){if(_0x10b521){return _0x10b521['update']({'UserId':_0x36ef58[_0x374c('0x67')]['id']},{'transaction':_0x163ef8});}});});}})[_0x374c('0x23')](handleEntityNotFound(_0x330b4d,null))['then'](respondWithResult(_0x330b4d,null))[_0x374c('0x57')](handleError(_0x330b4d,null));};exports[_0x374c('0x90')]=function(_0x226ba3,_0x1a4895,_0x38aa2f){return _0x226ba3[_0x374c('0x67')]['getVoiceQueues']({'where':{'type':_0x374c('0x76'),'dialActive':!![],'dialMethod':_0x374c('0x77')},'attributes':['id'],'raw':!![]})['then'](function(_0x1097f4){if(_0x1097f4&&_0x1097f4['length']){return db[_0x374c('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x374c('0x69')](_0x374c('0x6a'))},'VoiceQueueId':{'$in':_['map'](_0x1097f4,'id')},'$or':[{'UserId':null},{'UserId':_0x226ba3['user']['id']}]}});}return 0x0;})[_0x374c('0x23')](function(_0x29b37d){if(!_[_0x374c('0x70')](_0x29b37d)&&_[_0x374c('0x91')](_0x29b37d)){return _0x1a4895[_0x374c('0x1b')](0xc8)[_0x374c('0x1c')]({'contacts':_0x29b37d});}else{logger[_0x374c('0x26')](_0x374c('0x92'),_0x374c('0x90'),0x194,_0x374c('0x93'));_0x1a4895[_0x374c('0x1a')](0x194);}})[_0x374c('0x57')](handleError(_0x1a4895,null));}; \ No newline at end of file +var _0x1c4d=['scheduledAt','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','Contact','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','length','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','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','undefined','count','limit','Content-Range','json','apply','save','then','destroy','end','error','stack','name','send','map','CmHopper','fieldName','type','key','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$overlap','$contains','$contained','attributes','model','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','rawAttributes','catch','create','body','update','find','describe','VoiceQueueId','CampaignId','omit','updatedAt','state','campaign','membername','user','UserId','deleted','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','dialPreviewAutoRecallMe','sequelize','value','direction','prev','isEmpty','hopperIds','priority','ASC'];(function(_0x4c15fe,_0x4a108c){var _0xdf9641=function(_0x501c64){while(--_0x501c64){_0x4c15fe['push'](_0x4c15fe['shift']());}};_0xdf9641(++_0x4a108c);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x5e2384,_0x318705){_0x5e2384=_0x5e2384-0x0;var _0x195099=_0x1c4d[_0x5e2384];return _0x195099;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd1c4('0x0'));var zipdir=require(_0xd1c4('0x1'));var jsonpatch=require(_0xd1c4('0x2'));var rp=require('request-promise');var moment=require(_0xd1c4('0x3'));var BPromise=require(_0xd1c4('0x4'));var Mustache=require(_0xd1c4('0x5'));var util=require(_0xd1c4('0x6'));var path=require('path');var sox=require(_0xd1c4('0x7'));var csv=require('to-csv');var ejs=require(_0xd1c4('0x8'));var fs=require('fs');var fs_extra=require(_0xd1c4('0x9'));var _=require(_0xd1c4('0xa'));var squel=require(_0xd1c4('0xb'));var crypto=require(_0xd1c4('0xc'));var jsforce=require(_0xd1c4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd1c4('0xe'));var querystring=require(_0xd1c4('0xf'));var Papa=require('papaparse');var Redis=require(_0xd1c4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd1c4('0x11'));var as=require(_0xd1c4('0x12'));var hardwareService=require(_0xd1c4('0x13'));var logger=require(_0xd1c4('0x14'))(_0xd1c4('0x15'));var utils=require(_0xd1c4('0x16'));var config=require(_0xd1c4('0x17'));var licenseUtil=require(_0xd1c4('0x18'));var db=require(_0xd1c4('0x19'))['db'];function respondWithStatusCode(_0x350a49,_0x337fb8){_0x337fb8=_0x337fb8||0xcc;return function(_0x4f5d13){if(_0x4f5d13){return _0x350a49[_0xd1c4('0x1a')](_0x337fb8);}return _0x350a49[_0xd1c4('0x1b')](_0x337fb8)['end']();};}function respondWithResult(_0x57520b,_0x3dd0cf){_0x3dd0cf=_0x3dd0cf||0xc8;return function(_0x5bec0f){if(_0x5bec0f){return _0x57520b[_0xd1c4('0x1b')](_0x3dd0cf)['json'](_0x5bec0f);}};}function respondWithFilteredResult(_0x4e0840,_0x40ac72){return function(_0x5aed19){if(_0x5aed19){var _0x3f309f=typeof _0x40ac72[_0xd1c4('0x1c')]===_0xd1c4('0x1d')&&typeof _0x40ac72['limit']===_0xd1c4('0x1d');var _0x3cc7d3=_0x5aed19[_0xd1c4('0x1e')];var _0x41c496=_0x3f309f?0x0:_0x40ac72[_0xd1c4('0x1c')];var _0x39e0bb=_0x3f309f?_0x5aed19['count']:_0x40ac72[_0xd1c4('0x1c')]+_0x40ac72[_0xd1c4('0x1f')];var _0x4289f0;if(_0x39e0bb>=_0x3cc7d3){_0x39e0bb=_0x3cc7d3;_0x4289f0=0xc8;}else{_0x4289f0=0xce;}_0x4e0840[_0xd1c4('0x1b')](_0x4289f0);return _0x4e0840['set'](_0xd1c4('0x20'),_0x41c496+'-'+_0x39e0bb+'/'+_0x3cc7d3)[_0xd1c4('0x21')](_0x5aed19);}return null;};}function patchUpdates(_0x2dbdbb){return function(_0x57de1d){try{jsonpatch[_0xd1c4('0x22')](_0x57de1d,_0x2dbdbb,!![]);}catch(_0x28ef14){return BPromise['reject'](_0x28ef14);}return _0x57de1d[_0xd1c4('0x23')]();};}function saveUpdates(_0x3fddef,_0x49f1db){return function(_0x2a4498){if(_0x2a4498){return _0x2a4498['update'](_0x3fddef)[_0xd1c4('0x24')](function(_0x5df0f2){return _0x5df0f2;});}return null;};}function removeEntity(_0x469798,_0x5d24e7){return function(_0x291e66){if(_0x291e66){return _0x291e66[_0xd1c4('0x25')]()[_0xd1c4('0x24')](function(){_0x469798[_0xd1c4('0x1b')](0xcc)[_0xd1c4('0x26')]();});}};}function handleEntityNotFound(_0x23f9af,_0x706f8c){return function(_0x278562){if(!_0x278562){_0x23f9af[_0xd1c4('0x1a')](0x194);}return _0x278562;};}function handleError(_0x541990,_0x3db26f){_0x3db26f=_0x3db26f||0x1f4;return function(_0x2cdf75){logger[_0xd1c4('0x27')](_0x2cdf75[_0xd1c4('0x28')]);if(_0x2cdf75[_0xd1c4('0x29')]){delete _0x2cdf75[_0xd1c4('0x29')];}_0x541990['status'](_0x3db26f)[_0xd1c4('0x2a')](_0x2cdf75);};}exports['index']=function(_0x349c92,_0x3b9fd4){var _0x3aa8ea={},_0x3ef290={},_0xc72fe4={'count':0x0,'rows':[]};var _0x48748b=_[_0xd1c4('0x2b')](db[_0xd1c4('0x2c')]['rawAttributes'],function(_0x18367e){return{'name':_0x18367e[_0xd1c4('0x2d')],'type':_0x18367e[_0xd1c4('0x2e')][_0xd1c4('0x2f')]};});_0x3ef290['model']=_[_0xd1c4('0x2b')](_0x48748b,'name');_0x3ef290[_0xd1c4('0x30')]=_[_0xd1c4('0x31')](_0x349c92[_0xd1c4('0x30')]);_0x3ef290[_0xd1c4('0x32')]=_[_0xd1c4('0x33')](_0x3ef290['model'],_0x3ef290['query']);_0x3ef290[_0xd1c4('0x32')]=_[_0xd1c4('0x34')](_0x3ef290[_0xd1c4('0x32')],[_0xd1c4('0x35'),'$or',_0xd1c4('0x36'),_0xd1c4('0x37'),_0xd1c4('0x38'),_0xd1c4('0x39'),_0xd1c4('0x3a'),_0xd1c4('0x3b'),'$not',_0xd1c4('0x3c'),_0xd1c4('0x3d'),_0xd1c4('0x3e'),'$notIn',_0xd1c4('0x3f'),_0xd1c4('0x40'),_0xd1c4('0x41'),_0xd1c4('0x42'),_0xd1c4('0x3f'),_0xd1c4('0x43'),_0xd1c4('0x44'),_0xd1c4('0x45'),'$any']);_0x3aa8ea[_0xd1c4('0x46')]=_['intersection'](_0x3ef290[_0xd1c4('0x47')],qs[_0xd1c4('0x48')](_0x349c92['query'][_0xd1c4('0x48')]));_0x3aa8ea[_0xd1c4('0x46')]=_0x3aa8ea[_0xd1c4('0x46')]['length']?_0x3aa8ea[_0xd1c4('0x46')]:_0x3ef290['model'];if(!_0x349c92[_0xd1c4('0x30')][_0xd1c4('0x49')](_0xd1c4('0x4a'))){_0x3aa8ea[_0xd1c4('0x1f')]=qs['limit'](_0x349c92['query'][_0xd1c4('0x1f')]);_0x3aa8ea['offset']=qs[_0xd1c4('0x1c')](_0x349c92[_0xd1c4('0x30')][_0xd1c4('0x1c')]);}_0x3aa8ea['order']=qs[_0xd1c4('0x4b')](_0x349c92[_0xd1c4('0x30')]['sort']);_0x3aa8ea[_0xd1c4('0x4c')]=qs[_0xd1c4('0x32')](_['pick'](_0x349c92[_0xd1c4('0x30')],_0x3ef290[_0xd1c4('0x32')]),_0x48748b);if(_0x349c92[_0xd1c4('0x30')][_0xd1c4('0x4d')]){_0x3aa8ea[_0xd1c4('0x4c')]=_[_0xd1c4('0x4e')](_0x3aa8ea[_0xd1c4('0x4c')],{'$or':_[_0xd1c4('0x2b')](_0x48748b,function(_0x2427ed){if(_0x2427ed[_0xd1c4('0x2e')]!==_0xd1c4('0x4f')){var _0x14cabb={};_0x14cabb[_0x2427ed[_0xd1c4('0x29')]]={'$like':'%'+_0x349c92[_0xd1c4('0x30')][_0xd1c4('0x4d')]+'%'};return _0x14cabb;}})});}_0x3aa8ea=_[_0xd1c4('0x4e')]({},_0x3aa8ea,_0x349c92[_0xd1c4('0x50')]);var _0x575084={'where':_0x3aa8ea[_0xd1c4('0x4c')]};return db[_0xd1c4('0x2c')][_0xd1c4('0x1e')](_0x575084)['then'](function(_0x535fde){_0xc72fe4[_0xd1c4('0x1e')]=_0x535fde;if(_0x349c92[_0xd1c4('0x30')][_0xd1c4('0x51')]){_0x3aa8ea[_0xd1c4('0x52')]=[{'all':!![]}];}return db[_0xd1c4('0x2c')][_0xd1c4('0x53')](_0x3aa8ea);})[_0xd1c4('0x24')](function(_0x530c74){_0xc72fe4[_0xd1c4('0x54')]=_0x530c74;return _0xc72fe4;})[_0xd1c4('0x24')](respondWithFilteredResult(_0x3b9fd4,_0x3aa8ea))['catch'](handleError(_0x3b9fd4,null));};exports[_0xd1c4('0x55')]=function(_0x1fe6be,_0x224bbe){var _0x2cef57={'raw':!![],'where':{'id':_0x1fe6be[_0xd1c4('0x56')]['id']}},_0x3c5399={};_0x3c5399[_0xd1c4('0x47')]=_['keys'](db[_0xd1c4('0x2c')][_0xd1c4('0x57')]);_0x3c5399['query']=_[_0xd1c4('0x31')](_0x1fe6be[_0xd1c4('0x30')]);_0x3c5399[_0xd1c4('0x32')]=_['intersection'](_0x3c5399[_0xd1c4('0x47')],_0x3c5399[_0xd1c4('0x30')]);_0x2cef57[_0xd1c4('0x46')]=_[_0xd1c4('0x33')](_0x3c5399['model'],qs[_0xd1c4('0x48')](_0x1fe6be[_0xd1c4('0x30')]['fields']));_0x2cef57['attributes']=_0x2cef57[_0xd1c4('0x46')]['length']?_0x2cef57['attributes']:_0x3c5399[_0xd1c4('0x47')];if(_0x1fe6be['query']['includeAll']){_0x2cef57[_0xd1c4('0x52')]=[{'all':!![]}];}_0x2cef57=_['merge']({},_0x2cef57,_0x1fe6be['options']);return db[_0xd1c4('0x2c')]['find'](_0x2cef57)[_0xd1c4('0x24')](handleEntityNotFound(_0x224bbe,null))[_0xd1c4('0x24')](respondWithResult(_0x224bbe,null))[_0xd1c4('0x58')](handleError(_0x224bbe,null));};exports[_0xd1c4('0x59')]=function(_0x22f32c,_0x5952f6){return db['CmHopper'][_0xd1c4('0x59')](_0x22f32c[_0xd1c4('0x5a')],{})[_0xd1c4('0x24')](respondWithResult(_0x5952f6,0xc9))[_0xd1c4('0x58')](handleError(_0x5952f6,null));};exports[_0xd1c4('0x5b')]=function(_0x4a0624,_0x2c5dab){if(_0x4a0624[_0xd1c4('0x5a')]['id']){delete _0x4a0624[_0xd1c4('0x5a')]['id'];}return db[_0xd1c4('0x2c')][_0xd1c4('0x5c')]({'where':{'id':_0x4a0624[_0xd1c4('0x56')]['id']}})[_0xd1c4('0x24')](handleEntityNotFound(_0x2c5dab,null))[_0xd1c4('0x24')](saveUpdates(_0x4a0624['body'],null))['then'](respondWithResult(_0x2c5dab,null))['catch'](handleError(_0x2c5dab,null));};exports[_0xd1c4('0x5d')]=function(_0x350739,_0x21d5e3){return db[_0xd1c4('0x2c')]['describe']()['then'](respondWithResult(_0x21d5e3,null))[_0xd1c4('0x58')](handleError(_0x21d5e3,null));};exports[_0xd1c4('0x25')]=function(_0x4964b8,_0x22681e){var _0x1a6ed9;return db['CmHopper'][_0xd1c4('0x5c')]({'where':{'id':_0x4964b8['params']['id']}})['then'](handleEntityNotFound(_0x22681e,null))[_0xd1c4('0x24')](function(_0x239b1d){if(_0x239b1d){return _0x239b1d[_0xd1c4('0x25')]()[_0xd1c4('0x24')](function(_0xa3f096){return _0xa3f096;});}})[_0xd1c4('0x24')](function(_0x169872){_0x1a6ed9=_0x169872;if(_0x169872){if(_0x169872[_0xd1c4('0x5e')]||_0x169872[_0xd1c4('0x5f')]){return db[_0x169872[_0xd1c4('0x5e')]?'VoiceQueue':'Campaign'][_0xd1c4('0x5c')]({'where':{'id':_0x169872['VoiceQueueId']?_0x169872[_0xd1c4('0x5e')]:_0x169872['CampaignId']},'attributes':['id',_0xd1c4('0x29')],'raw':!![]});}}})[_0xd1c4('0x24')](function(_0x294d23){var _0x4ff349={};if(_0x294d23){_['merge'](_0x4ff349,_[_0xd1c4('0x60')](_0x1a6ed9['dataValues'],['createdAt',_0xd1c4('0x61'),'id']));_0x4ff349[_0xd1c4('0x62')]=0x15;_0x4ff349['statedesc']='deleted';_0x4ff349[_0xd1c4('0x63')]=_0x294d23[_0xd1c4('0x29')];_0x4ff349[_0xd1c4('0x64')]=_0x4964b8[_0xd1c4('0x65')][_0xd1c4('0x29')];_0x4ff349[_0xd1c4('0x66')]=_0x4964b8[_0xd1c4('0x65')]['id'];_0x4ff349[_0xd1c4('0x67')]=!![];_0x4ff349[_0xd1c4('0x68')]=moment()[_0xd1c4('0x69')](_0xd1c4('0x6a'));_0x4ff349[_0xd1c4('0x6b')]=_0x1a6ed9[_0xd1c4('0x6c')];_0x4ff349[_0xd1c4('0x6d')]=_0x1a6ed9[_0xd1c4('0x5e')]?_0xd1c4('0x6e'):_0xd1c4('0x6f');return db[_0xd1c4('0x70')][_0xd1c4('0x5c')]({'where':{'id':_0x4ff349[_0xd1c4('0x71')]},'attributes':[_0xd1c4('0x72'),_0xd1c4('0x73')]})[_0xd1c4('0x24')](function(_0x2a68ff){if(!_[_0xd1c4('0x74')](_0x22681e)&&!_[_0xd1c4('0x74')](_0x2a68ff[_0xd1c4('0x72')])){_0x4ff349[_0xd1c4('0x75')]=_0x2a68ff[_0xd1c4('0x72')];if(!_[_0xd1c4('0x74')](_0x2a68ff[_0xd1c4('0x73')])){_0x4ff349['calleridname']+='\x20'+_0x2a68ff[_0xd1c4('0x73')];}}})[_0xd1c4('0x76')](function(){return db['CmHopperFinal']['create'](_0x4ff349);});}})[_0xd1c4('0x24')](function(){return _0x22681e[_0xd1c4('0x1b')](0xcc)['end']();})[_0xd1c4('0x58')](handleError(_0x22681e,null));};exports[_0xd1c4('0x77')]=function(_0x181ec4,_0x3b1f66,_0x41215d){var _0x1e2700=[];return db[_0xd1c4('0x70')][_0xd1c4('0x5d')]()[_0xd1c4('0x24')](function(_0x535767){_0x1e2700=_[_0xd1c4('0x31')](_0x535767);return _0x181ec4['user'][_0xd1c4('0x78')]({'where':{'type':_0xd1c4('0x79'),'dialActive':!![],'dialMethod':_0xd1c4('0x7a')},'attributes':['id',_0xd1c4('0x7b'),_0xd1c4('0x7c')],'raw':!![]});})['then'](function(_0x21ff0e){if(_0x21ff0e&&_0x21ff0e['length']){return db[_0xd1c4('0x7d')]['transaction'](function(_0x5ca9dd){var _0x4178a0={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xd1c4('0x69')](_0xd1c4('0x6a'))},'VoiceQueueId':{'$in':_[_0xd1c4('0x2b')](_0x21ff0e,'id')},'$or':[{'UserId':null},{'UserId':_0x181ec4['user']['id']}]};var _0x375eb0={'active':![],'recallme':!![],'VoiceQueueId':{'$in':_(_0x21ff0e)[_0xd1c4('0x4d')]([_0xd1c4('0x7c'),0x0])['map']('id')[_0xd1c4('0x7e')]()},'$or':[{'UserId':null},{'UserId':_0x181ec4[_0xd1c4('0x65')]['id']}]};var _0x232273={'$or':[_0x4178a0,_0x375eb0]};var _0x4df17c=[];if(_0x181ec4[_0xd1c4('0x5a')]['direction']&&_0x181ec4['body'][_0xd1c4('0x7f')]===_0xd1c4('0x80')){if(!_[_0xd1c4('0x81')](_0x181ec4[_0xd1c4('0x5a')][_0xd1c4('0x82')])){_0x232273['id']={'$in':_0x181ec4['body']['hopperIds']};}_0x4df17c=[[_0xd1c4('0x83'),_0xd1c4('0x84')],[_0xd1c4('0x85'),_0x21ff0e[0x0][_0xd1c4('0x7b')]===_0xd1c4('0x84')?_0xd1c4('0x86'):_0xd1c4('0x84')],db[_0xd1c4('0x7d')][_0xd1c4('0x87')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xd1c4('0x86')]];}else{if(!_[_0xd1c4('0x81')](_0x181ec4[_0xd1c4('0x5a')]['hopperIds'])){_0x232273['id']={'$notIn':_0x181ec4[_0xd1c4('0x5a')]['hopperIds']};}_0x4df17c=[['priority',_0xd1c4('0x86')],['scheduledAt',_0x21ff0e[0x0][_0xd1c4('0x7b')]],db[_0xd1c4('0x7d')][_0xd1c4('0x87')](_0xd1c4('0x88')),['id',_0xd1c4('0x84')]];}return db['CmHopper'][_0xd1c4('0x89')]({'attributes':['id',_0xd1c4('0x8a'),'recallme'],'where':_0x232273,'order':_0x4df17c,'transaction':_0x5ca9dd,'lock':_0x5ca9dd[_0xd1c4('0x8b')]['UPDATE'],'include':[{'model':db[_0xd1c4('0x70')],'as':_0xd1c4('0x8c'),'attributes':_0x1e2700,'include':[{'model':db['CmCompany'],'as':'Company','attributes':['id',_0xd1c4('0x29')]}]},{'model':db[_0xd1c4('0x8d')],'as':_0xd1c4('0x8e'),'attributes':['id',_0xd1c4('0x29')]},{'model':db[_0xd1c4('0x8f')],'as':_0xd1c4('0x90'),'attributes':['id',_0xd1c4('0x29'),_0xd1c4('0x91')]}]})[_0xd1c4('0x24')](function(_0x4cddcb){if(_0x4cddcb){return _0x4cddcb[_0xd1c4('0x5b')]({'UserId':_0x181ec4[_0xd1c4('0x65')]['id']},{'transaction':_0x5ca9dd});}});});}})['then'](handleEntityNotFound(_0x3b1f66,null))['then'](respondWithResult(_0x3b1f66,null))['catch'](handleError(_0x3b1f66,null));};exports[_0xd1c4('0x92')]=function(_0x3469bc,_0x117f43,_0x468d80){return _0x3469bc[_0xd1c4('0x65')]['getVoiceQueues']({'where':{'type':_0xd1c4('0x79'),'dialActive':!![],'dialMethod':_0xd1c4('0x7a')},'attributes':['id'],'raw':!![]})[_0xd1c4('0x24')](function(_0x1460e2){if(_0x1460e2&&_0x1460e2[_0xd1c4('0x93')]){return db[_0xd1c4('0x2c')][_0xd1c4('0x1e')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xd1c4('0x2b')](_0x1460e2,'id')},'$or':[{'UserId':null},{'UserId':_0x3469bc[_0xd1c4('0x65')]['id']}]}});}return 0x0;})[_0xd1c4('0x24')](function(_0x1707e6){if(!_['isNil'](_0x1707e6)&&_[_0xd1c4('0x94')](_0x1707e6)){return _0x117f43['status'](0xc8)['json']({'contacts':_0x1707e6});}else{logger[_0xd1c4('0x27')](_0xd1c4('0x95'),_0xd1c4('0x92'),0x194,_0xd1c4('0x96'));_0x117f43[_0xd1c4('0x1a')](0x194);}})['catch'](handleError(_0x117f43,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 8f0925b..21feeda 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 _0x01d9=['define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','exports'];(function(_0x4f232d,_0x50c2fd){var _0x494086=function(_0x163bfa){while(--_0x163bfa){_0x4f232d['push'](_0x4f232d['shift']());}};_0x494086(++_0x50c2fd);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var logger=require(_0x901d('0x2'))(_0x901d('0x3'));var moment=require('moment');var BPromise=require(_0x901d('0x4'));var rp=require(_0x901d('0x5'));var fs=require('fs');var path=require(_0x901d('0x6'));var rimraf=require(_0x901d('0x7'));var config=require(_0x901d('0x8'));var attributes=require(_0x901d('0x9'));module[_0x901d('0xa')]=function(_0x4e7842,_0x1e5d7d){return _0x4e7842[_0x901d('0xb')](_0x901d('0xc'),attributes,{'tableName':_0x901d('0xd'),'paranoid':![],'indexes':[{'name':_0x901d('0xe'),'fields':[_0x901d('0xe')]},{'name':_0x901d('0xf'),'fields':[_0x901d('0xf')]},{'name':_0x901d('0x10'),'fields':[_0x901d('0x10')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x4add1e,_0x594705){var _0x12e2c6=function(_0x3da4c0){while(--_0x3da4c0){_0x4add1e['push'](_0x4add1e['shift']());}};_0x12e2c6(++_0x594705);}(_0x4819,0xcd));var _0x9481=function(_0x57928b,_0x29a111){_0x57928b=_0x57928b-0x0;var _0x49aad6=_0x4819[_0x57928b];return _0x49aad6;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[{'name':_0x9481('0xc'),'fields':[_0x9481('0xc')]},{'name':_0x9481('0xd'),'fields':['phone']},{'name':_0x9481('0xe'),'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 13a4715..40c2d08 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 _0xb4a1=['info','CmHopper,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','options','raw','where','limit','include','map','attributes','ShowCmHopper','find','model','create','body','CreateCmHopper','UpdateCmHopper','update','active','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','findAll','order','LOCK','UPDATE','Contact','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','CmHopperFinal','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','GetCmHopperPreview','ResetActiveCalls','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x5c8ce8,_0x13226b){var _0x3f6bc6=function(_0x35dea7){while(--_0x35dea7){_0x5c8ce8['push'](_0x5c8ce8['shift']());}};_0x3f6bc6(++_0x13226b);}(_0xb4a1,0x182));var _0x1b4a=function(_0x2ba1b2,_0x1d4370){_0x2ba1b2=_0x2ba1b2-0x0;var _0x23345e=_0xb4a1[_0x2ba1b2];return _0x23345e;};'use strict';var _=require('lodash');var util=require(_0x1b4a('0x0'));var moment=require(_0x1b4a('0x1'));var BPromise=require(_0x1b4a('0x2'));var rs=require(_0x1b4a('0x3'));var fs=require('fs');var Redis=require(_0x1b4a('0x4'));var db=require(_0x1b4a('0x5'))['db'];var utils=require(_0x1b4a('0x6'));var logger=require(_0x1b4a('0x7'))(_0x1b4a('0x8'));var config=require('../../config/environment');var jayson=require(_0x1b4a('0x9'));var client=jayson[_0x1b4a('0xa')][_0x1b4a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5def74,_0x9f82ae,_0x411a46){return new BPromise(function(_0x5019e7,_0x1eef64){return client[_0x1b4a('0xc')](_0x5def74,_0x411a46)[_0x1b4a('0xd')](function(_0xebe6d2){logger[_0x1b4a('0xe')](_0x1b4a('0xf'),_0x9f82ae,_0x1b4a('0x10'));logger[_0x1b4a('0x11')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x9f82ae,_0x1b4a('0x10'),JSON[_0x1b4a('0x12')](_0xebe6d2));if(_0xebe6d2[_0x1b4a('0x13')]){if(_0xebe6d2[_0x1b4a('0x13')][_0x1b4a('0x14')]===0x1f4){logger['error']('CmHopper,\x20%s,\x20%s',_0x9f82ae,_0xebe6d2[_0x1b4a('0x13')]['message']);return _0x1eef64(_0xebe6d2[_0x1b4a('0x13')][_0x1b4a('0x15')]);}logger[_0x1b4a('0x13')](_0x1b4a('0xf'),_0x9f82ae,_0xebe6d2[_0x1b4a('0x13')]['message']);return _0x5019e7(_0xebe6d2[_0x1b4a('0x13')][_0x1b4a('0x15')]);}else{logger[_0x1b4a('0xe')]('CmHopper,\x20%s,\x20%s',_0x9f82ae,_0x1b4a('0x10'));_0x5019e7(_0xebe6d2[_0x1b4a('0x16')][_0x1b4a('0x15')]);}})[_0x1b4a('0x17')](function(_0x3e68c0){logger['error'](_0x1b4a('0xf'),_0x9f82ae,_0x3e68c0);_0x1eef64(_0x3e68c0);});});}exports[_0x1b4a('0x18')]=function(_0x32beb4){var _0x170275=this;return new Promise(function(_0xf0b4f7,_0x42c909){return db[_0x1b4a('0x19')]['findAll']({'raw':_0x32beb4[_0x1b4a('0x1a')]?_0x32beb4[_0x1b4a('0x1a')][_0x1b4a('0x1b')]===undefined?!![]:![]:!![],'where':_0x32beb4[_0x1b4a('0x1a')]?_0x32beb4[_0x1b4a('0x1a')][_0x1b4a('0x1c')]||null:null,'attributes':_0x32beb4[_0x1b4a('0x1a')]?_0x32beb4['options']['attributes']||null:null,'limit':_0x32beb4[_0x1b4a('0x1a')]?_0x32beb4[_0x1b4a('0x1a')][_0x1b4a('0x1d')]||null:null,'include':_0x32beb4[_0x1b4a('0x1a')]?_0x32beb4[_0x1b4a('0x1a')][_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x32beb4['options']['include'],function(_0x21da78){return{'model':db[_0x21da78['model']],'as':_0x21da78['as'],'attributes':_0x21da78['attributes'],'include':_0x21da78[_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x21da78[_0x1b4a('0x1e')],function(_0x57c9ac){return{'model':db[_0x57c9ac['model']],'as':_0x57c9ac['as'],'attributes':_0x57c9ac[_0x1b4a('0x20')],'include':_0x57c9ac['include']?_['map'](_0x57c9ac[_0x1b4a('0x1e')],function(_0x396f31){return{'model':db[_0x396f31['model']],'as':_0x396f31['as'],'attributes':_0x396f31[_0x1b4a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b4a('0xd')](function(_0x13bf8f){logger[_0x1b4a('0xe')](_0x1b4a('0x18'),_0x32beb4);logger[_0x1b4a('0x11')](_0x1b4a('0x18'),_0x32beb4,JSON[_0x1b4a('0x12')](_0x13bf8f));_0xf0b4f7(_0x13bf8f);})['catch'](function(_0x407e0d){logger[_0x1b4a('0x13')](_0x1b4a('0x18'),_0x407e0d['message'],_0x32beb4);_0x42c909(_0x170275['error'](0x1f4,_0x407e0d['message']));});});};exports[_0x1b4a('0x21')]=function(_0x5804e8){var _0x5ce48d=this;return new Promise(function(_0x42b797,_0x12caa4){return db[_0x1b4a('0x19')][_0x1b4a('0x22')]({'raw':_0x5804e8['options']?_0x5804e8[_0x1b4a('0x1a')][_0x1b4a('0x1b')]===undefined?!![]:![]:!![],'where':_0x5804e8[_0x1b4a('0x1a')]?_0x5804e8['options'][_0x1b4a('0x1c')]||null:null,'attributes':_0x5804e8['options']?_0x5804e8[_0x1b4a('0x1a')][_0x1b4a('0x20')]||null:null,'include':_0x5804e8[_0x1b4a('0x1a')]?_0x5804e8[_0x1b4a('0x1a')][_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x5804e8[_0x1b4a('0x1a')][_0x1b4a('0x1e')],function(_0x572f0e){return{'model':db[_0x572f0e[_0x1b4a('0x23')]],'as':_0x572f0e['as'],'attributes':_0x572f0e[_0x1b4a('0x20')],'include':_0x572f0e[_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x572f0e[_0x1b4a('0x1e')],function(_0x1d0e7d){return{'model':db[_0x1d0e7d[_0x1b4a('0x23')]],'as':_0x1d0e7d['as'],'attributes':_0x1d0e7d['attributes'],'include':_0x1d0e7d['include']?_[_0x1b4a('0x1f')](_0x1d0e7d[_0x1b4a('0x1e')],function(_0x5ece5d){return{'model':db[_0x5ece5d[_0x1b4a('0x23')]],'as':_0x5ece5d['as'],'attributes':_0x5ece5d['attributes']};}):[]};}):[]};}):[]:[]})[_0x1b4a('0xd')](function(_0x40105b){logger[_0x1b4a('0xe')]('ShowCmHopper',_0x5804e8);logger[_0x1b4a('0x11')](_0x1b4a('0x21'),_0x5804e8,JSON['stringify'](_0x40105b));_0x42b797(_0x40105b);})[_0x1b4a('0x17')](function(_0x1b2aa5){logger['error']('ShowCmHopper',_0x1b2aa5[_0x1b4a('0x15')],_0x5804e8);_0x12caa4(_0x5ce48d[_0x1b4a('0x13')](0x1f4,_0x1b2aa5[_0x1b4a('0x15')]));});});};exports['CreateCmHopper']=function(_0x3332fb){var _0x50d2a7=this;return new Promise(function(_0x47fc16,_0x653b1){return db[_0x1b4a('0x19')][_0x1b4a('0x24')](_0x3332fb[_0x1b4a('0x25')],{'raw':_0x3332fb[_0x1b4a('0x1a')]?_0x3332fb[_0x1b4a('0x1a')][_0x1b4a('0x1b')]===undefined?!![]:![]:!![]})[_0x1b4a('0xd')](function(_0xcd57){logger['info'](_0x1b4a('0x26'),_0x3332fb);logger['debug'](_0x1b4a('0x26'),_0x3332fb,JSON[_0x1b4a('0x12')](_0xcd57));_0x47fc16(_0xcd57);})['catch'](function(_0x1d5e9c){logger['error']('CreateCmHopper',_0x1d5e9c[_0x1b4a('0x15')],_0x3332fb);_0x653b1(_0x50d2a7[_0x1b4a('0x13')](0x1f4,_0x1d5e9c[_0x1b4a('0x15')]));});});};exports[_0x1b4a('0x27')]=function(_0x23d225){var _0x2ec371=this;return new Promise(function(_0x10bfd1,_0xebb727){return db[_0x1b4a('0x19')][_0x1b4a('0x28')](_0x23d225[_0x1b4a('0x25')],{'raw':_0x23d225[_0x1b4a('0x1a')]?_0x23d225[_0x1b4a('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23d225[_0x1b4a('0x1a')]?_0x23d225[_0x1b4a('0x1a')][_0x1b4a('0x1c')]||null:null,'attributes':_0x23d225[_0x1b4a('0x1a')]?_0x23d225[_0x1b4a('0x1a')][_0x1b4a('0x20')]||null:null,'limit':_0x23d225[_0x1b4a('0x1a')]?_0x23d225['options']['limit']||null:null})[_0x1b4a('0xd')](function(_0x4827f1){logger[_0x1b4a('0xe')](_0x1b4a('0x27'),_0x23d225);logger[_0x1b4a('0xe')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0x1b4a('0x12')](_0x23d225['options'][_0x1b4a('0x1c')]),_0x23d225[_0x1b4a('0x25')][_0x1b4a('0x29')]);logger[_0x1b4a('0x11')]('UpdateCmHopper',_0x23d225,JSON[_0x1b4a('0x12')](_0x4827f1));_0x10bfd1(_0x4827f1);})['catch'](function(_0x2810f6){logger['error'](_0x1b4a('0x27'),_0x2810f6[_0x1b4a('0x15')],_0x23d225);_0xebb727(_0x2ec371[_0x1b4a('0x13')](0x1f4,_0x2810f6['message']));});});};exports[_0x1b4a('0x2a')]=function(_0x50f6f4){var _0x237735=this;return new Promise(function(_0x5e9f6a,_0x9fba96){return db[_0x1b4a('0x19')][_0x1b4a('0x2b')]({'where':_0x50f6f4['options']?_0x50f6f4['options']['where']||null:null})[_0x1b4a('0xd')](function(_0x8d249){logger[_0x1b4a('0xe')](_0x1b4a('0x2a'),_0x50f6f4);logger[_0x1b4a('0x11')]('DestroyCmHopper',_0x50f6f4,JSON[_0x1b4a('0x12')](_0x8d249));_0x5e9f6a(_0x8d249);})[_0x1b4a('0x17')](function(_0x553cd6){logger['error'](_0x1b4a('0x2a'),_0x553cd6[_0x1b4a('0x15')],_0x50f6f4);_0x9fba96(_0x237735[_0x1b4a('0x13')](0x1f4,_0x553cd6['message']));});});};exports[_0x1b4a('0x2c')]=function(_0x400825){var _0x2e00c9=this;return new Promise(function(_0x24d30a,_0x3dc4db){return db[_0x1b4a('0x2d')][_0x1b4a('0x2e')]()[_0x1b4a('0xd')](function(_0x2500f6){return db[_0x1b4a('0x2f')][_0x1b4a('0x30')](function(_0x1be325){return db['CmHopper'][_0x1b4a('0x31')]({'where':_0x400825[_0x1b4a('0x1a')]?_0x400825[_0x1b4a('0x1a')]['where']||null:null,'attributes':_0x400825[_0x1b4a('0x1a')]?_0x400825[_0x1b4a('0x1a')][_0x1b4a('0x20')]||null:null,'limit':_0x400825['options']?_0x400825[_0x1b4a('0x1a')][_0x1b4a('0x1d')]||null:null,'order':_0x400825['options']?_0x400825['options'][_0x1b4a('0x32')]||null:null,'transaction':_0x1be325,'lock':_0x1be325[_0x1b4a('0x33')][_0x1b4a('0x34')],'include':[{'model':db[_0x1b4a('0x2d')],'as':_0x1b4a('0x35'),'attributes':_['keys'](_0x2500f6)},{'model':db[_0x1b4a('0x36')],'as':_0x1b4a('0x37'),'attributes':['id',_0x1b4a('0x38'),_0x1b4a('0x39')]}]})[_0x1b4a('0xd')](function(_0x588bc6){var _0x224757=[];var _0x2e6649=[];for(var _0x39f8ee=0x0;_0x39f8ee<_0x588bc6[_0x1b4a('0x3a')];_0x39f8ee+=0x1){var _0x4bc0a8=_0x588bc6[_0x39f8ee][_0x1b4a('0x3b')];if(_0x4bc0a8===null){_0x224757[_0x1b4a('0x3c')](_0x588bc6[_0x39f8ee][_0x1b4a('0x28')](_0x400825[_0x1b4a('0x25')],{'transaction':_0x1be325}));}else if(!_0x2e6649[_0x1b4a('0x3d')](_0x4bc0a8)){_0x2e6649['push'](_0x4bc0a8);_0x224757[_0x1b4a('0x3c')](_0x588bc6[_0x39f8ee]['update'](_0x400825[_0x1b4a('0x25')],{'transaction':_0x1be325}));}}return BPromise[_0x1b4a('0x3e')](_0x224757);});})['then'](function(_0x5dc493){logger[_0x1b4a('0xe')](_0x1b4a('0x2c'),_0x400825);if(_0x5dc493[_0x1b4a('0x3a')]>0x0){logger[_0x1b4a('0xe')](_0x1b4a('0x3f'),_0x5dc493[0x0][_0x1b4a('0x40')]['id'],_0x5dc493[0x0]['dataValues'][_0x1b4a('0x41')],_0x5dc493[0x0][_0x1b4a('0x40')][_0x1b4a('0x29')]);}logger['debug'](_0x1b4a('0x2c'),_0x400825,JSON[_0x1b4a('0x12')](_0x5dc493));_0x24d30a(_0x5dc493);})[_0x1b4a('0x17')](function(_0x497340){logger[_0x1b4a('0x13')](_0x1b4a('0x2c'),_0x497340[_0x1b4a('0x15')],_0x400825);_0x3dc4db(_0x2e00c9[_0x1b4a('0x13')](0x1f4,_0x497340[_0x1b4a('0x15')]));});});});};exports['MoveContactManagedDialer']=function(_0x192d34){var _0x47d0d4=this;return new Promise(function(_0x3580eb,_0x475fb0){return db[_0x1b4a('0x2f')]['transaction'](function(_0x552e96){return db[_0x1b4a('0x42')][_0x1b4a('0x24')](_0x192d34[_0x1b4a('0x25')],{'raw':_0x192d34[_0x1b4a('0x1a')]?_0x192d34['options'][_0x1b4a('0x1b')]===undefined?!![]:![]:!![],'transaction':_0x552e96})['then'](function(){logger[_0x1b4a('0xe')](_0x1b4a('0x43'),JSON['stringify'](_0x192d34[_0x1b4a('0x1a')]['where']),_0x192d34[_0x1b4a('0x1a')][_0x1b4a('0x1c')][_0x1b4a('0x29')]);return db[_0x1b4a('0x19')][_0x1b4a('0x2b')]({'where':_0x192d34[_0x1b4a('0x1a')]?_0x192d34[_0x1b4a('0x1a')]['where']||null:null,'transaction':_0x552e96});});})['then'](function(_0x4c0828){logger[_0x1b4a('0xe')](_0x1b4a('0x44'),_0x192d34);logger['debug'](_0x1b4a('0x44'),_0x192d34,JSON[_0x1b4a('0x12')](_0x4c0828));_0x3580eb(_0x4c0828);})[_0x1b4a('0x17')](function(_0x35ad72){logger['error'](_0x1b4a('0x44'),_0x35ad72[_0x1b4a('0x15')],_0x192d34);_0x475fb0(_0x47d0d4[_0x1b4a('0x13')](0x1f4,_0x35ad72[_0x1b4a('0x15')]));});});};exports[_0x1b4a('0x45')]=function(_0x521c17){var _0x4253a8=this;return new Promise(function(_0x1bb036,_0x52d8c7){return db[_0x1b4a('0x19')][_0x1b4a('0x31')]({'raw':_0x521c17[_0x1b4a('0x1a')]?_0x521c17['options']['raw']===undefined?!![]:![]:!![],'where':_0x521c17['options']?_0x521c17[_0x1b4a('0x1a')][_0x1b4a('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x1b4a('0x46'),db['sequelize']['fn']('IF',db[_0x1b4a('0x2f')][_0x1b4a('0x47')](_0x1b4a('0x48')+util['format'](_0x1b4a('0x49'),moment()[_0x1b4a('0x4a')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x1b4a('0x4b')))),_0x1b4a('0x4c')]]})[_0x1b4a('0xd')](function(_0x40ccdc){logger[_0x1b4a('0xe')](_0x1b4a('0x45'),_0x521c17);logger[_0x1b4a('0x11')]('CountReScheduled',_0x521c17,JSON[_0x1b4a('0x12')](_0x40ccdc));_0x1bb036(_0x40ccdc);})[_0x1b4a('0x17')](function(_0x2a6bff){logger[_0x1b4a('0x13')](_0x1b4a('0x45'),_0x2a6bff[_0x1b4a('0x15')],_0x521c17);_0x52d8c7(_0x4253a8[_0x1b4a('0x13')](0x1f4,_0x2a6bff['message']));});});};exports['GetContactRecallMe']=function(_0x23267f){var _0x4f1810=this;return new Promise(function(_0x2b65b7,_0x47c43f){return db['CmContact'][_0x1b4a('0x2e')]()[_0x1b4a('0xd')](function(_0x53148d){return db[_0x1b4a('0x2f')][_0x1b4a('0x30')](function(_0x1b5125){return db[_0x1b4a('0x19')][_0x1b4a('0x31')]({'where':_0x23267f[_0x1b4a('0x1a')]?_0x23267f[_0x1b4a('0x1a')][_0x1b4a('0x1c')]||null:null,'attributes':_0x23267f['options']?_0x23267f[_0x1b4a('0x1a')][_0x1b4a('0x20')]||null:null,'limit':0x1,'order':_0x23267f[_0x1b4a('0x1a')]?_0x23267f['options'][_0x1b4a('0x32')]||null:null,'group':db[_0x1b4a('0x19')]['UserId'],'transaction':_0x1b5125,'lock':_0x1b5125[_0x1b4a('0x33')][_0x1b4a('0x34')],'include':_0x23267f[_0x1b4a('0x1a')]?_0x23267f[_0x1b4a('0x1a')][_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x23267f['options']['include'],function(_0x36f502){return{'model':db[_0x36f502[_0x1b4a('0x23')]],'as':_0x36f502['as'],'attributes':_0x36f502[_0x1b4a('0x20')],'include':_0x36f502['include']?_[_0x1b4a('0x1f')](_0x36f502[_0x1b4a('0x1e')],function(_0xbd772e){return{'model':db[_0xbd772e[_0x1b4a('0x23')]],'as':_0xbd772e['as'],'attributes':_0xbd772e[_0x1b4a('0x20')],'include':_0xbd772e[_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0xbd772e['include'],function(_0x9ec7cd){return{'model':db[_0x9ec7cd[_0x1b4a('0x23')]],'as':_0x9ec7cd['as'],'attributes':_0x9ec7cd[_0x1b4a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b4a('0xd')](function(_0x3fad10){var _0x1e5003=[];for(var _0x177cd5=0x0;_0x177cd5<_0x3fad10[_0x1b4a('0x3a')];_0x177cd5+=0x1){_0x1e5003[_0x1b4a('0x3c')](_0x3fad10[_0x177cd5]['update'](_0x23267f['body'],{'transaction':_0x1b5125}));}return BPromise[_0x1b4a('0x3e')](_0x1e5003);});})[_0x1b4a('0xd')](function(_0x4fba35){logger[_0x1b4a('0xe')](_0x1b4a('0x4d'),_0x23267f);logger[_0x1b4a('0x11')](_0x1b4a('0x4d'),_0x23267f,JSON['stringify'](_0x4fba35));_0x2b65b7(_0x4fba35);})[_0x1b4a('0x17')](function(_0x42eab6){logger['error'](_0x1b4a('0x4d'),_0x42eab6['message'],_0x23267f);_0x47c43f(_0x4f1810['error'](0x1f4,_0x42eab6[_0x1b4a('0x15')]));});});});};exports[_0x1b4a('0x4e')]=function(_0x2893c9){var _0x577142=this;return new Promise(function(_0x323f8a,_0x2834b9){db[_0x1b4a('0x2d')]['describe']()[_0x1b4a('0xd')](function(_0x334f4c){return db[_0x1b4a('0x19')][_0x1b4a('0x31')]({'raw':_0x2893c9[_0x1b4a('0x1a')]?_0x2893c9['options'][_0x1b4a('0x1b')]===undefined?!![]:![]:!![],'where':_0x2893c9[_0x1b4a('0x1a')]?_0x2893c9['options'][_0x1b4a('0x1c')]||null:null,'attributes':_0x2893c9[_0x1b4a('0x1a')]?_0x2893c9[_0x1b4a('0x1a')][_0x1b4a('0x20')]||null:null,'limit':_0x2893c9['options']?_0x2893c9[_0x1b4a('0x1a')][_0x1b4a('0x1d')]||null:null,'include':_0x2893c9[_0x1b4a('0x1a')]?_0x2893c9['options'][_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x2893c9[_0x1b4a('0x1a')][_0x1b4a('0x1e')],function(_0x16067e){return{'model':db[_0x16067e[_0x1b4a('0x23')]],'as':_0x16067e['as'],'attributes':_0x16067e['as']===_0x1b4a('0x35')?_['keys'](_0x334f4c):_0x16067e[_0x1b4a('0x20')],'include':_0x16067e[_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x16067e['include'],function(_0x28b405){return{'model':db[_0x28b405['model']],'as':_0x28b405['as'],'attributes':_0x28b405[_0x1b4a('0x20')],'include':_0x28b405[_0x1b4a('0x1e')]?_[_0x1b4a('0x1f')](_0x28b405['include'],function(_0x2c6e20){return{'model':db[_0x2c6e20[_0x1b4a('0x23')]],'as':_0x2c6e20['as'],'attributes':_0x2c6e20[_0x1b4a('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1b4a('0xd')](function(_0x1d0615){logger[_0x1b4a('0xe')](_0x1b4a('0x18'),_0x2893c9);logger[_0x1b4a('0x11')](_0x1b4a('0x18'),_0x2893c9,JSON[_0x1b4a('0x12')](_0x1d0615));_0x323f8a(_0x1d0615);})[_0x1b4a('0x17')](function(_0x155718){logger['error'](_0x1b4a('0x18'),_0x155718[_0x1b4a('0x15')],_0x2893c9);_0x2834b9(_0x577142[_0x1b4a('0x13')](0x1f4,_0x155718[_0x1b4a('0x15')]));});});});};exports['ResetActiveCalls']=function(_0x1b989d){var _0x2a15f5=this;return new Promise(function(_0x47ee94,_0x59cb97){return db[_0x1b4a('0x2f')][_0x1b4a('0x30')](function(_0x48bec6){return db['CmHopper'][_0x1b4a('0x28')]({'active':![]},{'where':{},'transaction':_0x48bec6})['then'](function(_0x5af43a){logger['info']('ResetActiveCalls',_0x1b989d);logger['debug'](_0x1b4a('0x4f'),_0x1b989d,JSON[_0x1b4a('0x12')](_0x5af43a));_0x47ee94(_0x5af43a);})[_0x1b4a('0x17')](function(_0xced6d7){logger[_0x1b4a('0x13')]('ResetActiveCalls',_0xced6d7['message'],_0x1b989d);_0x59cb97(_0x2a15f5['error'](0x1f4,_0xced6d7[_0x1b4a('0x15')]));});});});}; \ No newline at end of file +var _0x63ca=['model','debug','ShowCmHopper','find','raw','CreateCmHopper','create','UpdateCmHopper','update','body','active','DestroyCmHopper','destroy','CmContact','describe','sequelize','transaction','UPDATE','Contact','keys','User','Agent','name','voicePause','length','UserId','push','includes','all','GetContactDialer','GetContactDialer\x20hopperId\x20[%s]\x20-\x20contactId\x20[%s]\x20-\x20active\x20status\x20[%s]','dataValues','ContactId','MoveContactManagedDialer','MoveContactManagedDialer\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','order','LOCK','GetCmHopperPreview','ResetActiveCalls','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmHopper,\x20%s,\x20%s','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','map','include'];(function(_0x42fb8f,_0xd5bfff){var _0x18772a=function(_0x53b6ed){while(--_0x53b6ed){_0x42fb8f['push'](_0x42fb8f['shift']());}};_0x18772a(++_0xd5bfff);}(_0x63ca,0x16d));var _0xa63c=function(_0x434467,_0x2c6a75){_0x434467=_0x434467-0x0;var _0x5248ba=_0x63ca[_0x434467];return _0x5248ba;};'use strict';var _=require(_0xa63c('0x0'));var util=require(_0xa63c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa63c('0x2'));var fs=require('fs');var Redis=require(_0xa63c('0x3'));var db=require(_0xa63c('0x4'))['db'];var utils=require(_0xa63c('0x5'));var logger=require(_0xa63c('0x6'))(_0xa63c('0x7'));var config=require(_0xa63c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa63c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e9abd,_0x5278cf,_0x100e7e){return new BPromise(function(_0x39a4f3,_0x350675){return client['request'](_0x4e9abd,_0x100e7e)[_0xa63c('0xa')](function(_0x53c6c1){logger[_0xa63c('0xb')](_0xa63c('0xc'),_0x5278cf,_0xa63c('0xd'));logger['debug'](_0xa63c('0xe'),_0x5278cf,_0xa63c('0xd'),JSON[_0xa63c('0xf')](_0x53c6c1));if(_0x53c6c1['error']){if(_0x53c6c1[_0xa63c('0x10')][_0xa63c('0x11')]===0x1f4){logger[_0xa63c('0x10')](_0xa63c('0xc'),_0x5278cf,_0x53c6c1[_0xa63c('0x10')]['message']);return _0x350675(_0x53c6c1[_0xa63c('0x10')][_0xa63c('0x12')]);}logger[_0xa63c('0x10')](_0xa63c('0xc'),_0x5278cf,_0x53c6c1[_0xa63c('0x10')]['message']);return _0x39a4f3(_0x53c6c1[_0xa63c('0x10')][_0xa63c('0x12')]);}else{logger['info'](_0xa63c('0xc'),_0x5278cf,_0xa63c('0xd'));_0x39a4f3(_0x53c6c1[_0xa63c('0x13')]['message']);}})[_0xa63c('0x14')](function(_0x51487d){logger['error'](_0xa63c('0xc'),_0x5278cf,_0x51487d);_0x350675(_0x51487d);});});}exports[_0xa63c('0x15')]=function(_0x5a6d15){var _0x4c9673=this;return new Promise(function(_0x5710f0,_0x15a512){return db[_0xa63c('0x16')][_0xa63c('0x17')]({'raw':_0x5a6d15[_0xa63c('0x18')]?_0x5a6d15[_0xa63c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5a6d15[_0xa63c('0x18')]?_0x5a6d15[_0xa63c('0x18')][_0xa63c('0x19')]||null:null,'attributes':_0x5a6d15[_0xa63c('0x18')]?_0x5a6d15[_0xa63c('0x18')][_0xa63c('0x1a')]||null:null,'limit':_0x5a6d15[_0xa63c('0x18')]?_0x5a6d15[_0xa63c('0x18')][_0xa63c('0x1b')]||null:null,'include':_0x5a6d15[_0xa63c('0x18')]?_0x5a6d15[_0xa63c('0x18')]['include']?_[_0xa63c('0x1c')](_0x5a6d15[_0xa63c('0x18')]['include'],function(_0x35794f){return{'model':db[_0x35794f['model']],'as':_0x35794f['as'],'attributes':_0x35794f['attributes'],'include':_0x35794f[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x35794f['include'],function(_0x1140fd){return{'model':db[_0x1140fd[_0xa63c('0x1e')]],'as':_0x1140fd['as'],'attributes':_0x1140fd[_0xa63c('0x1a')],'include':_0x1140fd[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x1140fd[_0xa63c('0x1d')],function(_0x31059f){return{'model':db[_0x31059f[_0xa63c('0x1e')]],'as':_0x31059f['as'],'attributes':_0x31059f['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x357784){logger[_0xa63c('0xb')]('GetCmHopper',_0x5a6d15);logger[_0xa63c('0x1f')](_0xa63c('0x15'),_0x5a6d15,JSON[_0xa63c('0xf')](_0x357784));_0x5710f0(_0x357784);})[_0xa63c('0x14')](function(_0x15e6d3){logger[_0xa63c('0x10')]('GetCmHopper',_0x15e6d3[_0xa63c('0x12')],_0x5a6d15);_0x15a512(_0x4c9673[_0xa63c('0x10')](0x1f4,_0x15e6d3[_0xa63c('0x12')]));});});};exports[_0xa63c('0x20')]=function(_0x35ae63){var _0x52ef20=this;return new Promise(function(_0x17b047,_0x44a260){return db[_0xa63c('0x16')][_0xa63c('0x21')]({'raw':_0x35ae63[_0xa63c('0x18')]?_0x35ae63['options'][_0xa63c('0x22')]===undefined?!![]:![]:!![],'where':_0x35ae63[_0xa63c('0x18')]?_0x35ae63[_0xa63c('0x18')]['where']||null:null,'attributes':_0x35ae63['options']?_0x35ae63[_0xa63c('0x18')][_0xa63c('0x1a')]||null:null,'include':_0x35ae63[_0xa63c('0x18')]?_0x35ae63[_0xa63c('0x18')][_0xa63c('0x1d')]?_['map'](_0x35ae63[_0xa63c('0x18')][_0xa63c('0x1d')],function(_0x255b91){return{'model':db[_0x255b91[_0xa63c('0x1e')]],'as':_0x255b91['as'],'attributes':_0x255b91[_0xa63c('0x1a')],'include':_0x255b91[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x255b91[_0xa63c('0x1d')],function(_0x11654d){return{'model':db[_0x11654d[_0xa63c('0x1e')]],'as':_0x11654d['as'],'attributes':_0x11654d[_0xa63c('0x1a')],'include':_0x11654d['include']?_[_0xa63c('0x1c')](_0x11654d['include'],function(_0x2879ab){return{'model':db[_0x2879ab[_0xa63c('0x1e')]],'as':_0x2879ab['as'],'attributes':_0x2879ab[_0xa63c('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa63c('0xa')](function(_0x521b9d){logger[_0xa63c('0xb')](_0xa63c('0x20'),_0x35ae63);logger['debug'](_0xa63c('0x20'),_0x35ae63,JSON[_0xa63c('0xf')](_0x521b9d));_0x17b047(_0x521b9d);})['catch'](function(_0x3b4c7f){logger[_0xa63c('0x10')](_0xa63c('0x20'),_0x3b4c7f[_0xa63c('0x12')],_0x35ae63);_0x44a260(_0x52ef20['error'](0x1f4,_0x3b4c7f['message']));});});};exports[_0xa63c('0x23')]=function(_0x533364){var _0x261fa1=this;return new Promise(function(_0x406f58,_0x38182c){return db[_0xa63c('0x16')][_0xa63c('0x24')](_0x533364['body'],{'raw':_0x533364[_0xa63c('0x18')]?_0x533364[_0xa63c('0x18')][_0xa63c('0x22')]===undefined?!![]:![]:!![]})[_0xa63c('0xa')](function(_0x590773){logger[_0xa63c('0xb')](_0xa63c('0x23'),_0x533364);logger[_0xa63c('0x1f')](_0xa63c('0x23'),_0x533364,JSON['stringify'](_0x590773));_0x406f58(_0x590773);})[_0xa63c('0x14')](function(_0x55bbb7){logger[_0xa63c('0x10')](_0xa63c('0x23'),_0x55bbb7[_0xa63c('0x12')],_0x533364);_0x38182c(_0x261fa1[_0xa63c('0x10')](0x1f4,_0x55bbb7[_0xa63c('0x12')]));});});};exports[_0xa63c('0x25')]=function(_0x321e75){var _0xd4411e=this;return new Promise(function(_0xf0696,_0x7741b5){return db['CmHopper'][_0xa63c('0x26')](_0x321e75[_0xa63c('0x27')],{'raw':_0x321e75[_0xa63c('0x18')]?_0x321e75[_0xa63c('0x18')][_0xa63c('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321e75['options']?_0x321e75['options']['where']||null:null,'attributes':_0x321e75[_0xa63c('0x18')]?_0x321e75[_0xa63c('0x18')][_0xa63c('0x1a')]||null:null,'limit':_0x321e75[_0xa63c('0x18')]?_0x321e75[_0xa63c('0x18')]['limit']||null:null})[_0xa63c('0xa')](function(_0x2e0fac){logger[_0xa63c('0xb')](_0xa63c('0x25'),_0x321e75);logger[_0xa63c('0xb')]('UpdateCmHopper\x20hopper\x20options\x20[%s]\x20active\x20status\x20[%s]',JSON[_0xa63c('0xf')](_0x321e75[_0xa63c('0x18')][_0xa63c('0x19')]),_0x321e75['body'][_0xa63c('0x28')]);logger[_0xa63c('0x1f')]('UpdateCmHopper',_0x321e75,JSON[_0xa63c('0xf')](_0x2e0fac));_0xf0696(_0x2e0fac);})[_0xa63c('0x14')](function(_0x8346dc){logger[_0xa63c('0x10')]('UpdateCmHopper',_0x8346dc[_0xa63c('0x12')],_0x321e75);_0x7741b5(_0xd4411e[_0xa63c('0x10')](0x1f4,_0x8346dc[_0xa63c('0x12')]));});});};exports[_0xa63c('0x29')]=function(_0x3a7e10){var _0x263c72=this;return new Promise(function(_0x54dca9,_0x31ff5c){return db['CmHopper'][_0xa63c('0x2a')]({'where':_0x3a7e10[_0xa63c('0x18')]?_0x3a7e10[_0xa63c('0x18')][_0xa63c('0x19')]||null:null})[_0xa63c('0xa')](function(_0x54cc46){logger['info'](_0xa63c('0x29'),_0x3a7e10);logger[_0xa63c('0x1f')]('DestroyCmHopper',_0x3a7e10,JSON[_0xa63c('0xf')](_0x54cc46));_0x54dca9(_0x54cc46);})[_0xa63c('0x14')](function(_0x2ae4b8){logger[_0xa63c('0x10')](_0xa63c('0x29'),_0x2ae4b8[_0xa63c('0x12')],_0x3a7e10);_0x31ff5c(_0x263c72[_0xa63c('0x10')](0x1f4,_0x2ae4b8[_0xa63c('0x12')]));});});};exports['GetContactDialer']=function(_0x464237){var _0x39df32=this;return new Promise(function(_0x3fb646,_0x120d0c){return db[_0xa63c('0x2b')][_0xa63c('0x2c')]()[_0xa63c('0xa')](function(_0x583e6f){return db[_0xa63c('0x2d')][_0xa63c('0x2e')](function(_0x5ae98d){return db[_0xa63c('0x16')]['findAll']({'where':_0x464237[_0xa63c('0x18')]?_0x464237[_0xa63c('0x18')][_0xa63c('0x19')]||null:null,'attributes':_0x464237['options']?_0x464237['options'][_0xa63c('0x1a')]||null:null,'limit':_0x464237[_0xa63c('0x18')]?_0x464237[_0xa63c('0x18')]['limit']||null:null,'order':_0x464237['options']?_0x464237[_0xa63c('0x18')]['order']||null:null,'transaction':_0x5ae98d,'lock':_0x5ae98d['LOCK'][_0xa63c('0x2f')],'include':[{'model':db[_0xa63c('0x2b')],'as':_0xa63c('0x30'),'attributes':_[_0xa63c('0x31')](_0x583e6f)},{'model':db[_0xa63c('0x32')],'as':_0xa63c('0x33'),'attributes':['id',_0xa63c('0x34'),_0xa63c('0x35')]}]})[_0xa63c('0xa')](function(_0x333208){var _0x310cd5=[];var _0x2c2445=[];for(var _0x53ba51=0x0;_0x53ba51<_0x333208[_0xa63c('0x36')];_0x53ba51+=0x1){var _0x49a17f=_0x333208[_0x53ba51][_0xa63c('0x37')];if(_0x49a17f===null){_0x310cd5[_0xa63c('0x38')](_0x333208[_0x53ba51][_0xa63c('0x26')](_0x464237[_0xa63c('0x27')],{'transaction':_0x5ae98d}));}else if(!_0x2c2445[_0xa63c('0x39')](_0x49a17f)){_0x2c2445[_0xa63c('0x38')](_0x49a17f);_0x310cd5[_0xa63c('0x38')](_0x333208[_0x53ba51][_0xa63c('0x26')](_0x464237[_0xa63c('0x27')],{'transaction':_0x5ae98d}));}}return BPromise[_0xa63c('0x3a')](_0x310cd5);});})['then'](function(_0x2ea3de){logger[_0xa63c('0xb')](_0xa63c('0x3b'),_0x464237);if(_0x2ea3de[_0xa63c('0x36')]>0x0){logger[_0xa63c('0xb')](_0xa63c('0x3c'),_0x2ea3de[0x0][_0xa63c('0x3d')]['id'],_0x2ea3de[0x0][_0xa63c('0x3d')][_0xa63c('0x3e')],_0x2ea3de[0x0][_0xa63c('0x3d')][_0xa63c('0x28')]);}logger['debug']('GetContactDialer',_0x464237,JSON[_0xa63c('0xf')](_0x2ea3de));_0x3fb646(_0x2ea3de);})[_0xa63c('0x14')](function(_0x1c5fbe){logger[_0xa63c('0x10')]('GetContactDialer',_0x1c5fbe[_0xa63c('0x12')],_0x464237);_0x120d0c(_0x39df32[_0xa63c('0x10')](0x1f4,_0x1c5fbe[_0xa63c('0x12')]));});});});};exports[_0xa63c('0x3f')]=function(_0x70f4fa){var _0x70a252=this;return new Promise(function(_0x2d81f9,_0x561fbb){return db[_0xa63c('0x2d')][_0xa63c('0x2e')](function(_0x53f58c){return db['CmHopperFinal'][_0xa63c('0x24')](_0x70f4fa['body'],{'raw':_0x70f4fa[_0xa63c('0x18')]?_0x70f4fa[_0xa63c('0x18')][_0xa63c('0x22')]===undefined?!![]:![]:!![],'transaction':_0x53f58c})['then'](function(){logger[_0xa63c('0xb')](_0xa63c('0x40'),JSON[_0xa63c('0xf')](_0x70f4fa[_0xa63c('0x18')][_0xa63c('0x19')]),_0x70f4fa[_0xa63c('0x18')][_0xa63c('0x19')][_0xa63c('0x28')]);return db[_0xa63c('0x16')][_0xa63c('0x2a')]({'where':_0x70f4fa[_0xa63c('0x18')]?_0x70f4fa[_0xa63c('0x18')][_0xa63c('0x19')]||null:null,'transaction':_0x53f58c});});})[_0xa63c('0xa')](function(_0x4f2591){logger[_0xa63c('0xb')](_0xa63c('0x3f'),_0x70f4fa);logger[_0xa63c('0x1f')](_0xa63c('0x3f'),_0x70f4fa,JSON['stringify'](_0x4f2591));_0x2d81f9(_0x4f2591);})[_0xa63c('0x14')](function(_0x342baa){logger[_0xa63c('0x10')](_0xa63c('0x3f'),_0x342baa[_0xa63c('0x12')],_0x70f4fa);_0x561fbb(_0x70a252[_0xa63c('0x10')](0x1f4,_0x342baa[_0xa63c('0x12')]));});});};exports[_0xa63c('0x41')]=function(_0x3a56ec){var _0x22502d=this;return new Promise(function(_0x4aa644,_0x220fb2){return db['CmHopper'][_0xa63c('0x17')]({'raw':_0x3a56ec['options']?_0x3a56ec[_0xa63c('0x18')][_0xa63c('0x22')]===undefined?!![]:![]:!![],'where':_0x3a56ec[_0xa63c('0x18')]?_0x3a56ec[_0xa63c('0x18')][_0xa63c('0x19')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa63c('0x42'),db[_0xa63c('0x2d')]['fn']('IF',db['sequelize'][_0xa63c('0x43')](_0xa63c('0x44')+util['format'](_0xa63c('0x45'),moment()[_0xa63c('0x46')](_0xa63c('0x47')))+_0xa63c('0x48')))),_0xa63c('0x49')]]})[_0xa63c('0xa')](function(_0x3bb933){logger[_0xa63c('0xb')](_0xa63c('0x41'),_0x3a56ec);logger['debug']('CountReScheduled',_0x3a56ec,JSON['stringify'](_0x3bb933));_0x4aa644(_0x3bb933);})[_0xa63c('0x14')](function(_0x2ce391){logger[_0xa63c('0x10')](_0xa63c('0x41'),_0x2ce391[_0xa63c('0x12')],_0x3a56ec);_0x220fb2(_0x22502d['error'](0x1f4,_0x2ce391[_0xa63c('0x12')]));});});};exports[_0xa63c('0x4a')]=function(_0x1a18d5){var _0x5a01e9=this;return new Promise(function(_0x5f15b9,_0x416f2a){return db[_0xa63c('0x2b')][_0xa63c('0x2c')]()[_0xa63c('0xa')](function(_0x21f475){return db[_0xa63c('0x2d')][_0xa63c('0x2e')](function(_0x49ec89){return db['CmHopper'][_0xa63c('0x17')]({'where':_0x1a18d5['options']?_0x1a18d5[_0xa63c('0x18')][_0xa63c('0x19')]||null:null,'attributes':_0x1a18d5[_0xa63c('0x18')]?_0x1a18d5[_0xa63c('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x1a18d5['options']?_0x1a18d5[_0xa63c('0x18')][_0xa63c('0x4b')]||null:null,'group':db[_0xa63c('0x16')]['UserId'],'transaction':_0x49ec89,'lock':_0x49ec89[_0xa63c('0x4c')][_0xa63c('0x2f')],'include':_0x1a18d5[_0xa63c('0x18')]?_0x1a18d5[_0xa63c('0x18')][_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x1a18d5[_0xa63c('0x18')][_0xa63c('0x1d')],function(_0x208f2b){return{'model':db[_0x208f2b[_0xa63c('0x1e')]],'as':_0x208f2b['as'],'attributes':_0x208f2b[_0xa63c('0x1a')],'include':_0x208f2b[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x208f2b['include'],function(_0x13f855){return{'model':db[_0x13f855['model']],'as':_0x13f855['as'],'attributes':_0x13f855[_0xa63c('0x1a')],'include':_0x13f855[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x13f855[_0xa63c('0x1d')],function(_0x32a865){return{'model':db[_0x32a865[_0xa63c('0x1e')]],'as':_0x32a865['as'],'attributes':_0x32a865[_0xa63c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cb643){var _0x5709d5=[];for(var _0x523cf8=0x0;_0x523cf8<_0x1cb643['length'];_0x523cf8+=0x1){_0x5709d5[_0xa63c('0x38')](_0x1cb643[_0x523cf8][_0xa63c('0x26')](_0x1a18d5[_0xa63c('0x27')],{'transaction':_0x49ec89}));}return BPromise[_0xa63c('0x3a')](_0x5709d5);});})[_0xa63c('0xa')](function(_0x5e3af0){logger[_0xa63c('0xb')](_0xa63c('0x4a'),_0x1a18d5);logger[_0xa63c('0x1f')](_0xa63c('0x4a'),_0x1a18d5,JSON[_0xa63c('0xf')](_0x5e3af0));_0x5f15b9(_0x5e3af0);})['catch'](function(_0x5c5f12){logger[_0xa63c('0x10')](_0xa63c('0x4a'),_0x5c5f12[_0xa63c('0x12')],_0x1a18d5);_0x416f2a(_0x5a01e9[_0xa63c('0x10')](0x1f4,_0x5c5f12[_0xa63c('0x12')]));});});});};exports[_0xa63c('0x4d')]=function(_0x527719){var _0x482a70=this;return new Promise(function(_0x40087f,_0x2028fc){db[_0xa63c('0x2b')][_0xa63c('0x2c')]()[_0xa63c('0xa')](function(_0x3c0ddd){return db[_0xa63c('0x16')][_0xa63c('0x17')]({'raw':_0x527719[_0xa63c('0x18')]?_0x527719[_0xa63c('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x527719[_0xa63c('0x18')]?_0x527719['options'][_0xa63c('0x19')]||null:null,'attributes':_0x527719[_0xa63c('0x18')]?_0x527719[_0xa63c('0x18')]['attributes']||null:null,'limit':_0x527719[_0xa63c('0x18')]?_0x527719[_0xa63c('0x18')]['limit']||null:null,'include':_0x527719[_0xa63c('0x18')]?_0x527719[_0xa63c('0x18')][_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x527719[_0xa63c('0x18')][_0xa63c('0x1d')],function(_0x446e55){return{'model':db[_0x446e55[_0xa63c('0x1e')]],'as':_0x446e55['as'],'attributes':_0x446e55['as']===_0xa63c('0x30')?_['keys'](_0x3c0ddd):_0x446e55['attributes'],'include':_0x446e55[_0xa63c('0x1d')]?_[_0xa63c('0x1c')](_0x446e55['include'],function(_0x3d4c3f){return{'model':db[_0x3d4c3f['model']],'as':_0x3d4c3f['as'],'attributes':_0x3d4c3f[_0xa63c('0x1a')],'include':_0x3d4c3f['include']?_['map'](_0x3d4c3f[_0xa63c('0x1d')],function(_0x1b1289){return{'model':db[_0x1b1289['model']],'as':_0x1b1289['as'],'attributes':_0x1b1289['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x10a315){logger[_0xa63c('0xb')]('GetCmHopper',_0x527719);logger['debug'](_0xa63c('0x15'),_0x527719,JSON['stringify'](_0x10a315));_0x40087f(_0x10a315);})[_0xa63c('0x14')](function(_0x3a5eea){logger[_0xa63c('0x10')]('GetCmHopper',_0x3a5eea[_0xa63c('0x12')],_0x527719);_0x2028fc(_0x482a70[_0xa63c('0x10')](0x1f4,_0x3a5eea['message']));});});});};exports[_0xa63c('0x4e')]=function(_0x31a936){var _0x5d4b41=this;return new Promise(function(_0x31dd01,_0x27ee46){return db['sequelize'][_0xa63c('0x2e')](function(_0x24a317){return db[_0xa63c('0x16')][_0xa63c('0x26')]({'active':![]},{'where':{},'transaction':_0x24a317})[_0xa63c('0xa')](function(_0x437d6e){logger['info']('ResetActiveCalls',_0x31a936);logger['debug'](_0xa63c('0x4e'),_0x31a936,JSON[_0xa63c('0xf')](_0x437d6e));_0x31dd01(_0x437d6e);})[_0xa63c('0x14')](function(_0x3b5b79){logger['error']('ResetActiveCalls',_0x3b5b79[_0xa63c('0x12')],_0x31a936);_0x27ee46(_0x5d4b41[_0xa63c('0x10')](0x1f4,_0x3b5b79[_0xa63c('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7698f3d..4264211 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 _0x48ab=['create','post','/preview','getPreview','put','update','/:id','destroy','multer','util','path','connect-timeout','fs-extra','../../components/interaction/service','./cmHopper.controller','isAuthenticated','index','get','/describe','describe','/opencontacts','getOpenContacts','show'];(function(_0x2ea9bb,_0x41a73f){var _0x3f0084=function(_0x599ab7){while(--_0x599ab7){_0x2ea9bb['push'](_0x2ea9bb['shift']());}};_0x3f0084(++_0x41a73f);}(_0x48ab,0xee));var _0xb48a=function(_0x28947d,_0x4cc9c6){_0x28947d=_0x28947d-0x0;var _0x12d2ee=_0x48ab[_0x28947d];return _0x12d2ee;};'use strict';var multer=require(_0xb48a('0x0'));var util=require(_0xb48a('0x1'));var path=require(_0xb48a('0x2'));var timeout=require(_0xb48a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb48a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb48a('0x5'));var config=require('../../config/environment');var controller=require(_0xb48a('0x6'));router['get']('/',auth[_0xb48a('0x7')](),controller[_0xb48a('0x8')]);router[_0xb48a('0x9')](_0xb48a('0xa'),auth['isAuthenticated'](),controller[_0xb48a('0xb')]);router[_0xb48a('0x9')](_0xb48a('0xc'),auth['isAuthenticated'](),controller[_0xb48a('0xd')]);router[_0xb48a('0x9')]('/:id',auth[_0xb48a('0x7')](),controller[_0xb48a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb48a('0xf')]);router[_0xb48a('0x10')](_0xb48a('0x11'),auth[_0xb48a('0x7')](),controller[_0xb48a('0x12')]);router[_0xb48a('0x13')]('/:id',auth[_0xb48a('0x7')](),controller[_0xb48a('0x14')]);router['delete'](_0xb48a('0x15'),auth['isAuthenticated'](),controller[_0xb48a('0x16')]);module['exports']=router; \ No newline at end of file +var _0xd0aa=['get','isAuthenticated','index','/describe','/opencontacts','getOpenContacts','create','post','/preview','/:id','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./cmHopper.controller'];(function(_0xf9daca,_0x4a2fbd){var _0x2472de=function(_0xa90a99){while(--_0xa90a99){_0xf9daca['push'](_0xf9daca['shift']());}};_0x2472de(++_0x4a2fbd);}(_0xd0aa,0xdf));var _0xad0a=function(_0x387f50,_0x5c66b8){_0x387f50=_0x387f50-0x0;var _0x578413=_0xd0aa[_0x387f50];return _0x578413;};'use strict';var multer=require('multer');var util=require(_0xad0a('0x0'));var path=require(_0xad0a('0x1'));var timeout=require(_0xad0a('0x2'));var express=require('express');var router=express[_0xad0a('0x3')]();var fs_extra=require(_0xad0a('0x4'));var auth=require(_0xad0a('0x5'));var interaction=require(_0xad0a('0x6'));var config=require('../../config/environment');var controller=require(_0xad0a('0x7'));router[_0xad0a('0x8')]('/',auth[_0xad0a('0x9')](),controller[_0xad0a('0xa')]);router[_0xad0a('0x8')](_0xad0a('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xad0a('0xc'),auth['isAuthenticated'](),controller[_0xad0a('0xd')]);router[_0xad0a('0x8')]('/:id',auth[_0xad0a('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xad0a('0xe')]);router[_0xad0a('0xf')](_0xad0a('0x10'),auth[_0xad0a('0x9')](),controller['getPreview']);router['put'](_0xad0a('0x11'),auth['isAuthenticated'](),controller['update']);router[_0xad0a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xad0a('0x13')]);module[_0xad0a('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 2fbffa6..c9a2e25 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 _0x64a1=['exports','contactListQueue','INTEGER','moment','sequelize'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x64a1,0x13e));var _0x164a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x64a1[_0x4a747d];return _0x3a5b5c;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x164a('0x3')},'ListId':{'type':Sequelize[_0x164a('0x4')],'unique':_0x164a('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x164a('0x3')}}; \ No newline at end of file +var _0x624c=['exports','STRING','INTEGER','contactListQueue','sequelize'];(function(_0x191b73,_0x3ade1e){var _0x7a0131=function(_0x55dcdc){while(--_0x55dcdc){_0x191b73['push'](_0x191b73['shift']());}};_0x7a0131(++_0x3ade1e);}(_0x624c,0x1ee));var _0xc624=function(_0xa60623,_0x2d4e4f){_0xa60623=_0xa60623-0x0;var _0x4a6487=_0x624c[_0xa60623];return _0x4a6487;};'use strict';var moment=require('moment');var Sequelize=require(_0xc624('0x0'));module[_0xc624('0x1')]={'phone':{'type':Sequelize[_0xc624('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xc624('0x3')],'unique':_0xc624('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xc624('0x4')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xc624('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index fbf8df8..865cb8e 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 _0x3343=['../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','end','undefined','count','offset','json','apply','reject','save','then','status','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','filter','options','CmHopperBlack','include','findAll','rows','catch','params','includeAll','find','update','body','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs'];(function(_0x180391,_0x55d9ff){var _0x4ded40=function(_0x395160){while(--_0x395160){_0x180391['push'](_0x180391['shift']());}};_0x4ded40(++_0x55d9ff);}(_0x3343,0x1aa));var _0x3334=function(_0x4456a2,_0x376ff2){_0x4456a2=_0x4456a2-0x0;var _0xf36b56=_0x3343[_0x4456a2];return _0xf36b56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3334('0x0'));var jsonpatch=require(_0x3334('0x1'));var rp=require(_0x3334('0x2'));var moment=require(_0x3334('0x3'));var BPromise=require(_0x3334('0x4'));var Mustache=require('mustache');var util=require(_0x3334('0x5'));var path=require(_0x3334('0x6'));var sox=require('sox');var csv=require(_0x3334('0x7'));var ejs=require(_0x3334('0x8'));var fs=require('fs');var fs_extra=require(_0x3334('0x9'));var _=require(_0x3334('0xa'));var squel=require(_0x3334('0xb'));var crypto=require(_0x3334('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3334('0xd'));var toCsv=require(_0x3334('0x7'));var querystring=require(_0x3334('0xe'));var Papa=require(_0x3334('0xf'));var Redis=require(_0x3334('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3334('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3334('0x12'));var logger=require(_0x3334('0x13'))(_0x3334('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3334('0x15'));var db=require(_0x3334('0x16'))['db'];function respondWithStatusCode(_0x3c852c,_0x1cc66d){_0x1cc66d=_0x1cc66d||0xcc;return function(_0xf0770d){if(_0xf0770d){return _0x3c852c['sendStatus'](_0x1cc66d);}return _0x3c852c['status'](_0x1cc66d)[_0x3334('0x17')]();};}function respondWithResult(_0x1d60d0,_0x4c58bc){_0x4c58bc=_0x4c58bc||0xc8;return function(_0x1fff8d){if(_0x1fff8d){return _0x1d60d0['status'](_0x4c58bc)['json'](_0x1fff8d);}};}function respondWithFilteredResult(_0x86a2cf,_0x486b7f){return function(_0x1c6166){if(_0x1c6166){var _0x3fbe8d=typeof _0x486b7f['offset']===_0x3334('0x18')&&typeof _0x486b7f['limit']===_0x3334('0x18');var _0x4c5f8d=_0x1c6166[_0x3334('0x19')];var _0x1aafdb=_0x3fbe8d?0x0:_0x486b7f[_0x3334('0x1a')];var _0x18e118=_0x3fbe8d?_0x1c6166['count']:_0x486b7f['offset']+_0x486b7f['limit'];var _0x3080ee;if(_0x18e118>=_0x4c5f8d){_0x18e118=_0x4c5f8d;_0x3080ee=0xc8;}else{_0x3080ee=0xce;}_0x86a2cf['status'](_0x3080ee);return _0x86a2cf['set']('Content-Range',_0x1aafdb+'-'+_0x18e118+'/'+_0x4c5f8d)[_0x3334('0x1b')](_0x1c6166);}return null;};}function patchUpdates(_0x1e0180){return function(_0x1376d0){try{jsonpatch[_0x3334('0x1c')](_0x1376d0,_0x1e0180,!![]);}catch(_0x3d3bd4){return BPromise[_0x3334('0x1d')](_0x3d3bd4);}return _0x1376d0[_0x3334('0x1e')]();};}function saveUpdates(_0x2c0968,_0x2b810c){return function(_0x15ca47){if(_0x15ca47){return _0x15ca47['update'](_0x2c0968)[_0x3334('0x1f')](function(_0x548da4){return _0x548da4;});}return null;};}function removeEntity(_0xdb78e,_0x4f9ac0){return function(_0xaf41ee){if(_0xaf41ee){return _0xaf41ee['destroy']()[_0x3334('0x1f')](function(){_0xdb78e[_0x3334('0x20')](0xcc)[_0x3334('0x17')]();});}};}function handleEntityNotFound(_0x6d228c,_0x511791){return function(_0x2c9858){if(!_0x2c9858){_0x6d228c[_0x3334('0x21')](0x194);}return _0x2c9858;};}function handleError(_0x5b0802,_0x236492){_0x236492=_0x236492||0x1f4;return function(_0x57df6a){logger[_0x3334('0x22')](_0x57df6a[_0x3334('0x23')]);if(_0x57df6a['name']){delete _0x57df6a[_0x3334('0x24')];}_0x5b0802['status'](_0x236492)[_0x3334('0x25')](_0x57df6a);};}exports[_0x3334('0x26')]=function(_0x31a472,_0x2fc203){var _0x3cbdd8={},_0x257da2={},_0x2f83b9={'count':0x0,'rows':[]};var _0x2fecd8=_[_0x3334('0x27')](db['CmHopperBlack'][_0x3334('0x28')],function(_0x57c2aa){return{'name':_0x57c2aa[_0x3334('0x29')],'type':_0x57c2aa[_0x3334('0x2a')][_0x3334('0x2b')]};});_0x257da2[_0x3334('0x2c')]=_[_0x3334('0x27')](_0x2fecd8,'name');_0x257da2[_0x3334('0x2d')]=_[_0x3334('0x2e')](_0x31a472[_0x3334('0x2d')]);_0x257da2[_0x3334('0x2f')]=_[_0x3334('0x30')](_0x257da2[_0x3334('0x2c')],_0x257da2[_0x3334('0x2d')]);_0x3cbdd8[_0x3334('0x31')]=_[_0x3334('0x30')](_0x257da2[_0x3334('0x2c')],qs[_0x3334('0x32')](_0x31a472[_0x3334('0x2d')]['fields']));_0x3cbdd8[_0x3334('0x31')]=_0x3cbdd8[_0x3334('0x31')][_0x3334('0x33')]?_0x3cbdd8[_0x3334('0x31')]:_0x257da2[_0x3334('0x2c')];if(!_0x31a472['query'][_0x3334('0x34')](_0x3334('0x35'))){_0x3cbdd8[_0x3334('0x36')]=qs[_0x3334('0x36')](_0x31a472[_0x3334('0x2d')][_0x3334('0x36')]);_0x3cbdd8[_0x3334('0x1a')]=qs[_0x3334('0x1a')](_0x31a472[_0x3334('0x2d')]['offset']);}_0x3cbdd8[_0x3334('0x37')]=qs[_0x3334('0x38')](_0x31a472[_0x3334('0x2d')]['sort']);_0x3cbdd8[_0x3334('0x39')]=qs[_0x3334('0x2f')](_[_0x3334('0x3a')](_0x31a472['query'],_0x257da2[_0x3334('0x2f')]),_0x2fecd8);if(_0x31a472[_0x3334('0x2d')]['filter']){_0x3cbdd8[_0x3334('0x39')]=_[_0x3334('0x3b')](_0x3cbdd8[_0x3334('0x39')],{'$or':_[_0x3334('0x27')](_0x2fecd8,function(_0x394fe8){if(_0x394fe8['type']!=='VIRTUAL'){var _0x3884a6={};_0x3884a6[_0x394fe8[_0x3334('0x24')]]={'$like':'%'+_0x31a472[_0x3334('0x2d')][_0x3334('0x3c')]+'%'};return _0x3884a6;}})});}_0x3cbdd8=_[_0x3334('0x3b')]({},_0x3cbdd8,_0x31a472[_0x3334('0x3d')]);var _0x4d3a89={'where':_0x3cbdd8[_0x3334('0x39')]};return db[_0x3334('0x3e')]['count'](_0x4d3a89)[_0x3334('0x1f')](function(_0x4e1a1f){_0x2f83b9[_0x3334('0x19')]=_0x4e1a1f;if(_0x31a472[_0x3334('0x2d')]['includeAll']){_0x3cbdd8[_0x3334('0x3f')]=[{'all':!![]}];}return db[_0x3334('0x3e')][_0x3334('0x40')](_0x3cbdd8);})[_0x3334('0x1f')](function(_0x28deaa){_0x2f83b9[_0x3334('0x41')]=_0x28deaa;return _0x2f83b9;})[_0x3334('0x1f')](respondWithFilteredResult(_0x2fc203,_0x3cbdd8))[_0x3334('0x42')](handleError(_0x2fc203,null));};exports['show']=function(_0x299df8,_0x4f12b8){var _0x3d31cb={'raw':!![],'where':{'id':_0x299df8[_0x3334('0x43')]['id']}},_0x4f9bed={};_0x4f9bed['model']=_[_0x3334('0x2e')](db[_0x3334('0x3e')][_0x3334('0x28')]);_0x4f9bed['query']=_[_0x3334('0x2e')](_0x299df8[_0x3334('0x2d')]);_0x4f9bed[_0x3334('0x2f')]=_['intersection'](_0x4f9bed[_0x3334('0x2c')],_0x4f9bed[_0x3334('0x2d')]);_0x3d31cb['attributes']=_[_0x3334('0x30')](_0x4f9bed[_0x3334('0x2c')],qs[_0x3334('0x32')](_0x299df8[_0x3334('0x2d')][_0x3334('0x32')]));_0x3d31cb[_0x3334('0x31')]=_0x3d31cb[_0x3334('0x31')][_0x3334('0x33')]?_0x3d31cb['attributes']:_0x4f9bed['model'];if(_0x299df8['query'][_0x3334('0x44')]){_0x3d31cb[_0x3334('0x3f')]=[{'all':!![]}];}_0x3d31cb=_[_0x3334('0x3b')]({},_0x3d31cb,_0x299df8[_0x3334('0x3d')]);return db[_0x3334('0x3e')][_0x3334('0x45')](_0x3d31cb)['then'](handleEntityNotFound(_0x4f12b8,null))[_0x3334('0x1f')](respondWithResult(_0x4f12b8,null))['catch'](handleError(_0x4f12b8,null));};exports[_0x3334('0x46')]=function(_0xf51b84,_0x37138c){if(_0xf51b84['body']['id']){delete _0xf51b84['body']['id'];}return db[_0x3334('0x3e')][_0x3334('0x45')]({'where':{'id':_0xf51b84[_0x3334('0x43')]['id']}})['then'](handleEntityNotFound(_0x37138c,null))['then'](saveUpdates(_0xf51b84[_0x3334('0x47')],null))[_0x3334('0x1f')](respondWithResult(_0x37138c,null))[_0x3334('0x42')](handleError(_0x37138c,null));};exports[_0x3334('0x48')]=function(_0x339970,_0x4d729d){return db['CmHopperBlack'][_0x3334('0x45')]({'where':{'id':_0x339970['params']['id']}})['then'](handleEntityNotFound(_0x4d729d,null))['then'](removeEntity(_0x4d729d,null))[_0x3334('0x42')](handleError(_0x4d729d,null));};exports[_0x3334('0x49')]=function(_0x5aa1d9,_0x388e2d){return db[_0x3334('0x3e')][_0x3334('0x49')]()[_0x3334('0x1f')](respondWithResult(_0x388e2d,null))[_0x3334('0x42')](handleError(_0x388e2d,null));}; \ No newline at end of file +var _0xe69c=['find','catch','body','describe','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','key','keys','filters','attributes','intersection','fields','length','model','query','order','sort','pick','where','merge','type','CmHopperBlack','includeAll','include','findAll','rows','show','params','options'];(function(_0x447f0e,_0x4b38af){var _0x3273b4=function(_0x248828){while(--_0x248828){_0x447f0e['push'](_0x447f0e['shift']());}};_0x3273b4(++_0x4b38af);}(_0xe69c,0x92));var _0xce69=function(_0x3fa70a,_0x2edd99){_0x3fa70a=_0x3fa70a-0x0;var _0x30175c=_0xe69c[_0x3fa70a];return _0x30175c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xce69('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xce69('0x1'));var moment=require('moment');var BPromise=require(_0xce69('0x2'));var Mustache=require(_0xce69('0x3'));var util=require(_0xce69('0x4'));var path=require(_0xce69('0x5'));var sox=require('sox');var csv=require(_0xce69('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xce69('0x7'));var _=require(_0xce69('0x8'));var squel=require(_0xce69('0x9'));var crypto=require(_0xce69('0xa'));var jsforce=require(_0xce69('0xb'));var deskjs=require(_0xce69('0xc'));var toCsv=require(_0xce69('0x6'));var querystring=require(_0xce69('0xd'));var Papa=require(_0xce69('0xe'));var Redis=require(_0xce69('0xf'));var authService=require(_0xce69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xce69('0x11'));var hardwareService=require(_0xce69('0x12'));var logger=require('../../config/logger')(_0xce69('0x13'));var utils=require('../../config/utils');var config=require(_0xce69('0x14'));var licenseUtil=require(_0xce69('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x251295,_0xd0db3c){_0xd0db3c=_0xd0db3c||0xcc;return function(_0x50d1e3){if(_0x50d1e3){return _0x251295['sendStatus'](_0xd0db3c);}return _0x251295[_0xce69('0x16')](_0xd0db3c)[_0xce69('0x17')]();};}function respondWithResult(_0x1870aa,_0x4f0776){_0x4f0776=_0x4f0776||0xc8;return function(_0xa3dfea){if(_0xa3dfea){return _0x1870aa['status'](_0x4f0776)[_0xce69('0x18')](_0xa3dfea);}};}function respondWithFilteredResult(_0x42da35,_0x1d014d){return function(_0x3d3098){if(_0x3d3098){var _0x5de818=typeof _0x1d014d[_0xce69('0x19')]==='undefined'&&typeof _0x1d014d[_0xce69('0x1a')]===_0xce69('0x1b');var _0x53fc82=_0x3d3098['count'];var _0x492c98=_0x5de818?0x0:_0x1d014d[_0xce69('0x19')];var _0x4dc603=_0x5de818?_0x3d3098[_0xce69('0x1c')]:_0x1d014d[_0xce69('0x19')]+_0x1d014d[_0xce69('0x1a')];var _0x4b7992;if(_0x4dc603>=_0x53fc82){_0x4dc603=_0x53fc82;_0x4b7992=0xc8;}else{_0x4b7992=0xce;}_0x42da35[_0xce69('0x16')](_0x4b7992);return _0x42da35[_0xce69('0x1d')](_0xce69('0x1e'),_0x492c98+'-'+_0x4dc603+'/'+_0x53fc82)[_0xce69('0x18')](_0x3d3098);}return null;};}function patchUpdates(_0xbb46fa){return function(_0x400922){try{jsonpatch[_0xce69('0x1f')](_0x400922,_0xbb46fa,!![]);}catch(_0x4b3d6a){return BPromise[_0xce69('0x20')](_0x4b3d6a);}return _0x400922[_0xce69('0x21')]();};}function saveUpdates(_0x34b47f,_0x2ddbf0){return function(_0x349ff4){if(_0x349ff4){return _0x349ff4[_0xce69('0x22')](_0x34b47f)[_0xce69('0x23')](function(_0x3d8cf3){return _0x3d8cf3;});}return null;};}function removeEntity(_0x424eaf,_0x5163dd){return function(_0xf53ad4){if(_0xf53ad4){return _0xf53ad4[_0xce69('0x24')]()[_0xce69('0x23')](function(){_0x424eaf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d8989,_0x5a20dd){return function(_0x14c630){if(!_0x14c630){_0x3d8989[_0xce69('0x25')](0x194);}return _0x14c630;};}function handleError(_0x228eb2,_0x541af4){_0x541af4=_0x541af4||0x1f4;return function(_0xbadde0){logger['error'](_0xbadde0[_0xce69('0x26')]);if(_0xbadde0[_0xce69('0x27')]){delete _0xbadde0[_0xce69('0x27')];}_0x228eb2[_0xce69('0x16')](_0x541af4)[_0xce69('0x28')](_0xbadde0);};}exports[_0xce69('0x29')]=function(_0x229b45,_0x3a607c){var _0x167920={},_0x5eb134={},_0x517280={'count':0x0,'rows':[]};var _0x3d954a=_[_0xce69('0x2a')](db['CmHopperBlack'][_0xce69('0x2b')],function(_0x450f56){return{'name':_0x450f56['fieldName'],'type':_0x450f56['type'][_0xce69('0x2c')]};});_0x5eb134['model']=_[_0xce69('0x2a')](_0x3d954a,_0xce69('0x27'));_0x5eb134['query']=_[_0xce69('0x2d')](_0x229b45['query']);_0x5eb134[_0xce69('0x2e')]=_['intersection'](_0x5eb134['model'],_0x5eb134['query']);_0x167920[_0xce69('0x2f')]=_[_0xce69('0x30')](_0x5eb134['model'],qs['fields'](_0x229b45['query'][_0xce69('0x31')]));_0x167920['attributes']=_0x167920[_0xce69('0x2f')][_0xce69('0x32')]?_0x167920[_0xce69('0x2f')]:_0x5eb134[_0xce69('0x33')];if(!_0x229b45[_0xce69('0x34')]['hasOwnProperty']('nolimit')){_0x167920['limit']=qs[_0xce69('0x1a')](_0x229b45[_0xce69('0x34')][_0xce69('0x1a')]);_0x167920[_0xce69('0x19')]=qs[_0xce69('0x19')](_0x229b45[_0xce69('0x34')][_0xce69('0x19')]);}_0x167920[_0xce69('0x35')]=qs[_0xce69('0x36')](_0x229b45['query']['sort']);_0x167920['where']=qs['filters'](_[_0xce69('0x37')](_0x229b45[_0xce69('0x34')],_0x5eb134[_0xce69('0x2e')]),_0x3d954a);if(_0x229b45[_0xce69('0x34')]['filter']){_0x167920[_0xce69('0x38')]=_[_0xce69('0x39')](_0x167920[_0xce69('0x38')],{'$or':_[_0xce69('0x2a')](_0x3d954a,function(_0x2bfb82){if(_0x2bfb82[_0xce69('0x3a')]!=='VIRTUAL'){var _0x4bbcb4={};_0x4bbcb4[_0x2bfb82[_0xce69('0x27')]]={'$like':'%'+_0x229b45[_0xce69('0x34')]['filter']+'%'};return _0x4bbcb4;}})});}_0x167920=_[_0xce69('0x39')]({},_0x167920,_0x229b45['options']);var _0xcac27={'where':_0x167920[_0xce69('0x38')]};return db[_0xce69('0x3b')][_0xce69('0x1c')](_0xcac27)[_0xce69('0x23')](function(_0x337b13){_0x517280[_0xce69('0x1c')]=_0x337b13;if(_0x229b45[_0xce69('0x34')][_0xce69('0x3c')]){_0x167920[_0xce69('0x3d')]=[{'all':!![]}];}return db[_0xce69('0x3b')][_0xce69('0x3e')](_0x167920);})[_0xce69('0x23')](function(_0x3f6ec6){_0x517280[_0xce69('0x3f')]=_0x3f6ec6;return _0x517280;})[_0xce69('0x23')](respondWithFilteredResult(_0x3a607c,_0x167920))['catch'](handleError(_0x3a607c,null));};exports[_0xce69('0x40')]=function(_0x5996e5,_0x28ee12){var _0x4f0056={'raw':!![],'where':{'id':_0x5996e5[_0xce69('0x41')]['id']}},_0x57dae3={};_0x57dae3['model']=_[_0xce69('0x2d')](db['CmHopperBlack']['rawAttributes']);_0x57dae3[_0xce69('0x34')]=_[_0xce69('0x2d')](_0x5996e5[_0xce69('0x34')]);_0x57dae3[_0xce69('0x2e')]=_[_0xce69('0x30')](_0x57dae3['model'],_0x57dae3['query']);_0x4f0056[_0xce69('0x2f')]=_['intersection'](_0x57dae3['model'],qs['fields'](_0x5996e5[_0xce69('0x34')][_0xce69('0x31')]));_0x4f0056[_0xce69('0x2f')]=_0x4f0056['attributes'][_0xce69('0x32')]?_0x4f0056[_0xce69('0x2f')]:_0x57dae3[_0xce69('0x33')];if(_0x5996e5[_0xce69('0x34')]['includeAll']){_0x4f0056[_0xce69('0x3d')]=[{'all':!![]}];}_0x4f0056=_[_0xce69('0x39')]({},_0x4f0056,_0x5996e5[_0xce69('0x42')]);return db[_0xce69('0x3b')][_0xce69('0x43')](_0x4f0056)[_0xce69('0x23')](handleEntityNotFound(_0x28ee12,null))[_0xce69('0x23')](respondWithResult(_0x28ee12,null))[_0xce69('0x44')](handleError(_0x28ee12,null));};exports[_0xce69('0x22')]=function(_0x5b9d99,_0x46c688){if(_0x5b9d99[_0xce69('0x45')]['id']){delete _0x5b9d99[_0xce69('0x45')]['id'];}return db[_0xce69('0x3b')][_0xce69('0x43')]({'where':{'id':_0x5b9d99[_0xce69('0x41')]['id']}})[_0xce69('0x23')](handleEntityNotFound(_0x46c688,null))[_0xce69('0x23')](saveUpdates(_0x5b9d99['body'],null))[_0xce69('0x23')](respondWithResult(_0x46c688,null))[_0xce69('0x44')](handleError(_0x46c688,null));};exports[_0xce69('0x24')]=function(_0x1258eb,_0x386c9a){return db[_0xce69('0x3b')][_0xce69('0x43')]({'where':{'id':_0x1258eb['params']['id']}})['then'](handleEntityNotFound(_0x386c9a,null))[_0xce69('0x23')](removeEntity(_0x386c9a,null))[_0xce69('0x44')](handleError(_0x386c9a,null));};exports[_0xce69('0x46')]=function(_0xe66a99,_0x3b1f72){return db[_0xce69('0x3b')][_0xce69('0x46')]()['then'](respondWithResult(_0x3b1f72,null))[_0xce69('0x44')](handleError(_0x3b1f72,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 125006c..7cbc102 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 _0x2d07=['bluebird','request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','api','moment'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x2d07,0x1ab));var _0x72d0=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x2d07[_0x51ed62];return _0x34aee3;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x72d0('0x0'));var moment=require(_0x72d0('0x1'));var BPromise=require(_0x72d0('0x2'));var rp=require(_0x72d0('0x3'));var fs=require('fs');var path=require(_0x72d0('0x4'));var rimraf=require(_0x72d0('0x5'));var config=require('../../config/environment');var attributes=require(_0x72d0('0x6'));module[_0x72d0('0x7')]=function(_0x54596,_0x445452){return _0x54596[_0x72d0('0x8')](_0x72d0('0x9'),attributes,{'tableName':_0x72d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48b2=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','CmHopperBlack','cm_hopper_black','util'];(function(_0x4d7116,_0xdb8175){var _0x4593dc=function(_0x51d44e){while(--_0x51d44e){_0x4d7116['push'](_0x4d7116['shift']());}};_0x4593dc(++_0xdb8175);}(_0x48b2,0x121));var _0x248b=function(_0xfca494,_0x114bf8){_0xfca494=_0xfca494-0x0;var _0x3dd3f7=_0x48b2[_0xfca494];return _0x3dd3f7;};'use strict';var _=require('lodash');var util=require(_0x248b('0x0'));var logger=require(_0x248b('0x1'))(_0x248b('0x2'));var moment=require('moment');var BPromise=require(_0x248b('0x3'));var rp=require(_0x248b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x248b('0x5'));var config=require(_0x248b('0x6'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x4908a0,_0x3245a7){return _0x4908a0[_0x248b('0x7')](_0x248b('0x8'),attributes,{'tableName':_0x248b('0x9'),'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 167880e..09c72c8 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 _0x2d42=['rpc','../../config/environment','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetCmHopperBlack','findAll','options','raw','where','attributes','model','include','map','debug','UpdateCmHopperBlack','CmHopperBlack','update','DestroyCmHopperBlack','destroy','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2626eb,_0x261d14){var _0x4c8ca9=function(_0x26fc4b){while(--_0x26fc4b){_0x2626eb['push'](_0x2626eb['shift']());}};_0x4c8ca9(++_0x261d14);}(_0x2d42,0xd2));var _0x22d4=function(_0x1b0176,_0x58af21){_0x1b0176=_0x1b0176-0x0;var _0x25256a=_0x2d42[_0x1b0176];return _0x25256a;};'use strict';var _=require('lodash');var util=require(_0x22d4('0x0'));var moment=require('moment');var BPromise=require(_0x22d4('0x1'));var rs=require(_0x22d4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x22d4('0x3'))['db'];var utils=require(_0x22d4('0x4'));var logger=require(_0x22d4('0x5'))(_0x22d4('0x6'));var config=require(_0x22d4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x22d4('0x8')][_0x22d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ea3a1,_0x1a560a,_0x25d220){return new BPromise(function(_0x5ec808,_0x42c5dc){return client[_0x22d4('0xa')](_0x1ea3a1,_0x25d220)[_0x22d4('0xb')](function(_0x12dab9){logger[_0x22d4('0xc')](_0x22d4('0xd'),_0x1a560a,_0x22d4('0xe'));logger['debug'](_0x22d4('0xf'),_0x1a560a,_0x22d4('0xe'),JSON[_0x22d4('0x10')](_0x12dab9));if(_0x12dab9[_0x22d4('0x11')]){if(_0x12dab9[_0x22d4('0x11')]['code']===0x1f4){logger[_0x22d4('0x11')](_0x22d4('0xd'),_0x1a560a,_0x12dab9[_0x22d4('0x11')][_0x22d4('0x12')]);return _0x42c5dc(_0x12dab9[_0x22d4('0x11')][_0x22d4('0x12')]);}logger[_0x22d4('0x11')](_0x22d4('0xd'),_0x1a560a,_0x12dab9[_0x22d4('0x11')][_0x22d4('0x12')]);return _0x5ec808(_0x12dab9[_0x22d4('0x11')][_0x22d4('0x12')]);}else{logger[_0x22d4('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1a560a,_0x22d4('0xe'));_0x5ec808(_0x12dab9[_0x22d4('0x13')][_0x22d4('0x12')]);}})[_0x22d4('0x14')](function(_0x4e02c4){logger[_0x22d4('0x11')](_0x22d4('0xd'),_0x1a560a,_0x4e02c4);_0x42c5dc(_0x4e02c4);});});}exports[_0x22d4('0x15')]=function(_0x176f98){var _0x1a1ad1=this;return new Promise(function(_0x548798,_0x47e647){return db['CmHopperBlack'][_0x22d4('0x16')]({'raw':_0x176f98[_0x22d4('0x17')]?_0x176f98[_0x22d4('0x17')][_0x22d4('0x18')]===undefined?!![]:![]:!![],'where':_0x176f98['options']?_0x176f98['options'][_0x22d4('0x19')]||null:null,'attributes':_0x176f98[_0x22d4('0x17')]?_0x176f98[_0x22d4('0x17')][_0x22d4('0x1a')]||null:null,'limit':_0x176f98[_0x22d4('0x17')]?_0x176f98[_0x22d4('0x17')]['limit']||null:null,'include':_0x176f98['options']?_0x176f98['options']['include']?_['map'](_0x176f98[_0x22d4('0x17')]['include'],function(_0x986fe){return{'model':db[_0x986fe[_0x22d4('0x1b')]],'as':_0x986fe['as'],'attributes':_0x986fe[_0x22d4('0x1a')],'include':_0x986fe[_0x22d4('0x1c')]?_['map'](_0x986fe[_0x22d4('0x1c')],function(_0x5a4437){return{'model':db[_0x5a4437[_0x22d4('0x1b')]],'as':_0x5a4437['as'],'attributes':_0x5a4437['attributes'],'include':_0x5a4437['include']?_[_0x22d4('0x1d')](_0x5a4437['include'],function(_0x363b23){return{'model':db[_0x363b23[_0x22d4('0x1b')]],'as':_0x363b23['as'],'attributes':_0x363b23['attributes']};}):[]};}):[]};}):[]:[]})[_0x22d4('0xb')](function(_0x2452b6){logger[_0x22d4('0xc')](_0x22d4('0x15'),_0x176f98);logger[_0x22d4('0x1e')](_0x22d4('0x15'),_0x176f98,JSON[_0x22d4('0x10')](_0x2452b6));_0x548798(_0x2452b6);})[_0x22d4('0x14')](function(_0x526e0d){logger['error'](_0x22d4('0x15'),_0x526e0d[_0x22d4('0x12')],_0x176f98);_0x47e647(_0x1a1ad1['error'](0x1f4,_0x526e0d['message']));});});};exports[_0x22d4('0x1f')]=function(_0x19f8cc){var _0x27ae7f=this;return new Promise(function(_0x560ca6,_0x55231c){return db[_0x22d4('0x20')][_0x22d4('0x21')](_0x19f8cc['body'],{'raw':_0x19f8cc[_0x22d4('0x17')]?_0x19f8cc[_0x22d4('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19f8cc[_0x22d4('0x17')]?_0x19f8cc['options'][_0x22d4('0x19')]||null:null,'attributes':_0x19f8cc['options']?_0x19f8cc[_0x22d4('0x17')]['attributes']||null:null,'limit':_0x19f8cc[_0x22d4('0x17')]?_0x19f8cc['options']['limit']||null:null})['then'](function(_0x5671d5){logger[_0x22d4('0xc')](_0x22d4('0x1f'),_0x19f8cc);logger[_0x22d4('0x1e')]('UpdateCmHopperBlack',_0x19f8cc,JSON[_0x22d4('0x10')](_0x5671d5));_0x560ca6(_0x5671d5);})[_0x22d4('0x14')](function(_0x563f56){logger['error'](_0x22d4('0x1f'),_0x563f56[_0x22d4('0x12')],_0x19f8cc);_0x55231c(_0x27ae7f['error'](0x1f4,_0x563f56[_0x22d4('0x12')]));});});};exports[_0x22d4('0x22')]=function(_0x47f3ee){var _0x19ec2d=this;return new Promise(function(_0x27133a,_0x4ae5f3){return db[_0x22d4('0x20')][_0x22d4('0x23')]({'where':_0x47f3ee[_0x22d4('0x17')]?_0x47f3ee[_0x22d4('0x17')][_0x22d4('0x19')]||null:null})[_0x22d4('0xb')](function(_0x13d1d7){logger['info']('DestroyCmHopperBlack',_0x47f3ee);logger[_0x22d4('0x1e')]('DestroyCmHopperBlack',_0x47f3ee,JSON['stringify'](_0x13d1d7));_0x27133a(_0x13d1d7);})[_0x22d4('0x14')](function(_0x119318){logger[_0x22d4('0x11')](_0x22d4('0x22'),_0x119318[_0x22d4('0x12')],_0x47f3ee);_0x4ae5f3(_0x19ec2d[_0x22d4('0x11')](0x1f4,_0x119318['message']));});});}; \ No newline at end of file +var _0x2715=['error','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','attributes','limit','include','map','model','debug','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','destroy','where','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x2715,0x119));var _0x5271=function(_0x102bf1,_0x43baa4){_0x102bf1=_0x102bf1-0x0;var _0x3062ac=_0x2715[_0x102bf1];return _0x3062ac;};'use strict';var _=require('lodash');var util=require(_0x5271('0x0'));var moment=require(_0x5271('0x1'));var BPromise=require(_0x5271('0x2'));var rs=require(_0x5271('0x3'));var fs=require('fs');var Redis=require(_0x5271('0x4'));var db=require(_0x5271('0x5'))['db'];var utils=require(_0x5271('0x6'));var logger=require(_0x5271('0x7'))('rpc');var config=require(_0x5271('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28f225,_0x4a2806,_0x21611b){return new BPromise(function(_0x494564,_0x139a32){return client[_0x5271('0x9')](_0x28f225,_0x21611b)[_0x5271('0xa')](function(_0x4ffe31){logger['info'](_0x5271('0xb'),_0x4a2806,_0x5271('0xc'));logger['debug'](_0x5271('0xd'),_0x4a2806,'request\x20sent',JSON[_0x5271('0xe')](_0x4ffe31));if(_0x4ffe31['error']){if(_0x4ffe31['error']['code']===0x1f4){logger[_0x5271('0xf')](_0x5271('0xb'),_0x4a2806,_0x4ffe31[_0x5271('0xf')][_0x5271('0x10')]);return _0x139a32(_0x4ffe31[_0x5271('0xf')][_0x5271('0x10')]);}logger[_0x5271('0xf')](_0x5271('0xb'),_0x4a2806,_0x4ffe31[_0x5271('0xf')][_0x5271('0x10')]);return _0x494564(_0x4ffe31[_0x5271('0xf')][_0x5271('0x10')]);}else{logger[_0x5271('0x11')](_0x5271('0xb'),_0x4a2806,_0x5271('0xc'));_0x494564(_0x4ffe31[_0x5271('0x12')]['message']);}})['catch'](function(_0x37cc66){logger[_0x5271('0xf')](_0x5271('0xb'),_0x4a2806,_0x37cc66);_0x139a32(_0x37cc66);});});}exports[_0x5271('0x13')]=function(_0x4b5d3e){var _0x1cc97a=this;return new Promise(function(_0x2cfee9,_0x4959b5){return db[_0x5271('0x14')][_0x5271('0x15')]({'raw':_0x4b5d3e[_0x5271('0x16')]?_0x4b5d3e[_0x5271('0x16')][_0x5271('0x17')]===undefined?!![]:![]:!![],'where':_0x4b5d3e[_0x5271('0x16')]?_0x4b5d3e[_0x5271('0x16')]['where']||null:null,'attributes':_0x4b5d3e['options']?_0x4b5d3e[_0x5271('0x16')][_0x5271('0x18')]||null:null,'limit':_0x4b5d3e['options']?_0x4b5d3e['options'][_0x5271('0x19')]||null:null,'include':_0x4b5d3e['options']?_0x4b5d3e['options'][_0x5271('0x1a')]?_[_0x5271('0x1b')](_0x4b5d3e[_0x5271('0x16')]['include'],function(_0x21ff56){return{'model':db[_0x21ff56[_0x5271('0x1c')]],'as':_0x21ff56['as'],'attributes':_0x21ff56[_0x5271('0x18')],'include':_0x21ff56[_0x5271('0x1a')]?_[_0x5271('0x1b')](_0x21ff56[_0x5271('0x1a')],function(_0x560825){return{'model':db[_0x560825['model']],'as':_0x560825['as'],'attributes':_0x560825[_0x5271('0x18')],'include':_0x560825[_0x5271('0x1a')]?_[_0x5271('0x1b')](_0x560825[_0x5271('0x1a')],function(_0x2e7691){return{'model':db[_0x2e7691[_0x5271('0x1c')]],'as':_0x2e7691['as'],'attributes':_0x2e7691['attributes']};}):[]};}):[]};}):[]:[]})[_0x5271('0xa')](function(_0x4fa5b0){logger[_0x5271('0x11')](_0x5271('0x13'),_0x4b5d3e);logger[_0x5271('0x1d')](_0x5271('0x13'),_0x4b5d3e,JSON[_0x5271('0xe')](_0x4fa5b0));_0x2cfee9(_0x4fa5b0);})[_0x5271('0x1e')](function(_0x53ac80){logger[_0x5271('0xf')](_0x5271('0x13'),_0x53ac80['message'],_0x4b5d3e);_0x4959b5(_0x1cc97a[_0x5271('0xf')](0x1f4,_0x53ac80[_0x5271('0x10')]));});});};exports[_0x5271('0x1f')]=function(_0x953031){var _0x4a0ea8=this;return new Promise(function(_0x536b6e,_0x4c2662){return db[_0x5271('0x14')][_0x5271('0x20')](_0x953031[_0x5271('0x21')],{'raw':_0x953031['options']?_0x953031[_0x5271('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x953031[_0x5271('0x16')]?_0x953031[_0x5271('0x16')]['where']||null:null,'attributes':_0x953031[_0x5271('0x16')]?_0x953031[_0x5271('0x16')][_0x5271('0x18')]||null:null,'limit':_0x953031[_0x5271('0x16')]?_0x953031[_0x5271('0x16')][_0x5271('0x19')]||null:null})[_0x5271('0xa')](function(_0x4c8215){logger['info']('UpdateCmHopperBlack',_0x953031);logger['debug'](_0x5271('0x1f'),_0x953031,JSON[_0x5271('0xe')](_0x4c8215));_0x536b6e(_0x4c8215);})[_0x5271('0x1e')](function(_0x941cd4){logger[_0x5271('0xf')]('UpdateCmHopperBlack',_0x941cd4[_0x5271('0x10')],_0x953031);_0x4c2662(_0x4a0ea8[_0x5271('0xf')](0x1f4,_0x941cd4['message']));});});};exports[_0x5271('0x22')]=function(_0x5cbd9f){var _0x361e36=this;return new Promise(function(_0xe0738a,_0x310b00){return db[_0x5271('0x14')][_0x5271('0x23')]({'where':_0x5cbd9f[_0x5271('0x16')]?_0x5cbd9f[_0x5271('0x16')][_0x5271('0x24')]||null:null})[_0x5271('0xa')](function(_0x12218d){logger['info'](_0x5271('0x22'),_0x5cbd9f);logger['debug'](_0x5271('0x22'),_0x5cbd9f,JSON[_0x5271('0xe')](_0x12218d));_0xe0738a(_0x12218d);})[_0x5271('0x1e')](function(_0x57df4c){logger[_0x5271('0xf')](_0x5271('0x22'),_0x57df4c[_0x5271('0x10')],_0x5cbd9f);_0x310b00(_0x361e36['error'](0x1f4,_0x57df4c[_0x5271('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 01e0ca1..46296ac 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 _0xf072=['../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','delete','destroy','multer','util','path','express','fs-extra'];(function(_0x315c92,_0x992e7a){var _0x3e7ad8=function(_0x1cc68b){while(--_0x1cc68b){_0x315c92['push'](_0x315c92['shift']());}};_0x3e7ad8(++_0x992e7a);}(_0xf072,0x1cf));var _0x2f07=function(_0x57f5a3,_0x212f61){_0x57f5a3=_0x57f5a3-0x0;var _0x7f49bc=_0xf072[_0x57f5a3];return _0x7f49bc;};'use strict';var multer=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var path=require(_0x2f07('0x2'));var timeout=require('connect-timeout');var express=require(_0x2f07('0x3'));var router=express['Router']();var fs_extra=require(_0x2f07('0x4'));var auth=require(_0x2f07('0x5'));var interaction=require(_0x2f07('0x6'));var config=require('../../config/environment');var controller=require(_0x2f07('0x7'));router[_0x2f07('0x8')]('/',auth[_0x2f07('0x9')](),controller[_0x2f07('0xa')]);router[_0x2f07('0x8')](_0x2f07('0xb'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xc')]);router[_0x2f07('0x8')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0xe')]);router[_0x2f07('0xf')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller['update']);router[_0x2f07('0x10')](_0x2f07('0xd'),auth[_0x2f07('0x9')](),controller[_0x2f07('0x11')]);module['exports']=router; \ No newline at end of file +var _0xf494=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','describe','/:id','show','put','delete','destroy','multer','util'];(function(_0x156092,_0x2d9298){var _0x4ac233=function(_0xb7f3ac){while(--_0xb7f3ac){_0x156092['push'](_0x156092['shift']());}};_0x4ac233(++_0x2d9298);}(_0xf494,0x1c6));var _0x4f49=function(_0xab6b45,_0x3080b5){_0xab6b45=_0xab6b45-0x0;var _0x224347=_0xf494[_0xab6b45];return _0x224347;};'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')]('/describe',auth['isAuthenticated'](),controller[_0x4f49('0xd')]);router[_0x4f49('0xa')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller[_0x4f49('0xf')]);router[_0x4f49('0x10')](_0x4f49('0xe'),auth[_0x4f49('0xb')](),controller['update']);router[_0x4f49('0x11')](_0x4f49('0xe'),auth['isAuthenticated'](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 19059e3..55f1f8d 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 _0x2d72=['endtime','followuptime','diff','setDataValue','dispositionat','BOOLEAN','sequelize','exports','INTEGER','STRING','DATE','getDataValue'];(function(_0x19a17b,_0x5ae2cf){var _0x3ab04e=function(_0x58e110){while(--_0x58e110){_0x19a17b['push'](_0x19a17b['shift']());}};_0x3ab04e(++_0x5ae2cf);}(_0x2d72,0x10e));var _0x22d7=function(_0x6bc799,_0x2a9ab4){_0x6bc799=_0x6bc799-0x0;var _0x477ef3=_0x2d72[_0x6bc799];return _0x477ef3;};'use strict';var Sequelize=require(_0x22d7('0x0'));var moment=require('moment');module[_0x22d7('0x1')]={'state':{'type':Sequelize[_0x22d7('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x22d7('0x3')]},'scheduledat':{'type':Sequelize[_0x22d7('0x4')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x22d7('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x22d7('0x3')]},'starttime':{'type':Sequelize[_0x22d7('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x22d7('0x4')]},'endtime':{'type':Sequelize[_0x22d7('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x22d7('0x3')]},'campaigntype':{'type':Sequelize[_0x22d7('0x3')]},'membername':{'type':Sequelize[_0x22d7('0x3')]},'reason':{'type':Sequelize[_0x22d7('0x3')]},'disposition':{'type':Sequelize[_0x22d7('0x3')]},'secondDisposition':{'type':Sequelize[_0x22d7('0x3')]},'thirdDisposition':{'type':Sequelize[_0x22d7('0x3')]},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x55314a){var _0x2044f1=this[_0x22d7('0x5')](_0x22d7('0x6'));if(_0x2044f1&&_0x55314a){this['setDataValue'](_0x22d7('0x7'),moment(_0x55314a)[_0x22d7('0x8')](moment(_0x2044f1),'seconds'));}return this[_0x22d7('0x9')](_0x22d7('0xa'),_0x55314a);}},'amd':{'type':Sequelize[_0x22d7('0xb')],'defaultValue':![]},'fax':{'type':Sequelize[_0x22d7('0xb')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x22d7('0xb')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x22d7('0xb')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x22d7('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x22d7('0x4')]},'deleted':{'type':Sequelize[_0x22d7('0x3')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x22d7('0x4')]},'recallme':{'type':Sequelize[_0x22d7('0xb')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x22d7('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9f71=['diff','seconds','BOOLEAN','moment','INTEGER','STRING','DATE','setDataValue'];(function(_0x3111f4,_0x47f576){var _0x4d1b1c=function(_0x5061d3){while(--_0x5061d3){_0x3111f4['push'](_0x3111f4['shift']());}};_0x4d1b1c(++_0x47f576);}(_0x9f71,0x163));var _0x19f7=function(_0x4d22af,_0x2da329){_0x4d22af=_0x4d22af-0x0;var _0x1aa3f4=_0x9f71[_0x4d22af];return _0x1aa3f4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x19f7('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x19f7('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x19f7('0x2')]},'originatecalleridname':{'type':Sequelize[_0x19f7('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x19f7('0x2')]},'starttime':{'type':Sequelize[_0x19f7('0x3')]},'responsetime':{'type':Sequelize[_0x19f7('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x19f7('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x19f7('0x2')]},'campaigntype':{'type':Sequelize[_0x19f7('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x19f7('0x2')]},'disposition':{'type':Sequelize[_0x19f7('0x2')]},'secondDisposition':{'type':Sequelize[_0x19f7('0x2')]},'thirdDisposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize[_0x19f7('0x3')],'set':function(_0x5da5){var _0x4ac320=this['getDataValue']('endtime');if(_0x4ac320&&_0x5da5){this[_0x19f7('0x4')]('followuptime',moment(_0x5da5)[_0x19f7('0x5')](moment(_0x4ac320),_0x19f7('0x6')));}return this['setDataValue']('dispositionat',_0x5da5);}},'amd':{'type':Sequelize[_0x19f7('0x7')],'defaultValue':![]},'fax':{'type':Sequelize[_0x19f7('0x7')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0x19f7('0x7')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0x19f7('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x19f7('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x19f7('0x3')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize[_0x19f7('0x7')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x19f7('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x19f7('0x1')],'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 ee58712..c093ea2 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 _0x2a07=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','Content-Range','apply','reject','save','update','then','error','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','catch','show','params','fields','includeAll','describe','body','uniqueid','find','findAll','sequelize','COUNT','literal','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','moveContactsQueueCampaignHopperFinal','insert','into','cm_hopper','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','ANY_VALUE(calleridnum)','phone','field','NOW()','scheduledAt','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','toString','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','group','checkContactHopper','CmHopper','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1e0ecc,_0x36ba4e){var _0x1fac46=function(_0x29bcc6){while(--_0x29bcc6){_0x1e0ecc['push'](_0x1e0ecc['shift']());}};_0x1fac46(++_0x36ba4e);}(_0x2a07,0x74));var _0x72a0=function(_0x2638d0,_0x52f653){_0x2638d0=_0x2638d0-0x0;var _0x411a60=_0x2a07[_0x2638d0];return _0x411a60;};'use strict';var emlformat=require(_0x72a0('0x0'));var rimraf=require(_0x72a0('0x1'));var zipdir=require(_0x72a0('0x2'));var jsonpatch=require(_0x72a0('0x3'));var rp=require(_0x72a0('0x4'));var moment=require('moment');var BPromise=require(_0x72a0('0x5'));var Mustache=require(_0x72a0('0x6'));var util=require(_0x72a0('0x7'));var path=require(_0x72a0('0x8'));var sox=require(_0x72a0('0x9'));var csv=require(_0x72a0('0xa'));var ejs=require(_0x72a0('0xb'));var fs=require('fs');var fs_extra=require(_0x72a0('0xc'));var _=require(_0x72a0('0xd'));var squel=require(_0x72a0('0xe'));var crypto=require(_0x72a0('0xf'));var jsforce=require(_0x72a0('0x10'));var deskjs=require(_0x72a0('0x11'));var toCsv=require(_0x72a0('0xa'));var querystring=require(_0x72a0('0x12'));var Papa=require(_0x72a0('0x13'));var Redis=require('ioredis');var authService=require(_0x72a0('0x14'));var qs=require(_0x72a0('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x72a0('0x16'));var logger=require(_0x72a0('0x17'))(_0x72a0('0x18'));var utils=require(_0x72a0('0x19'));var config=require(_0x72a0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x72a0('0x1b'))['db'];function respondWithStatusCode(_0x335b9f,_0x123ca4){_0x123ca4=_0x123ca4||0xcc;return function(_0xf91a82){if(_0xf91a82){return _0x335b9f[_0x72a0('0x1c')](_0x123ca4);}return _0x335b9f[_0x72a0('0x1d')](_0x123ca4)[_0x72a0('0x1e')]();};}function respondWithResult(_0x5e0b5f,_0x4930c5){_0x4930c5=_0x4930c5||0xc8;return function(_0xe103dc){if(_0xe103dc){return _0x5e0b5f[_0x72a0('0x1d')](_0x4930c5)[_0x72a0('0x1f')](_0xe103dc);}};}function respondWithFilteredResult(_0x1d1133,_0x23b001){return function(_0x3f3d62){if(_0x3f3d62){var _0x4ab55e=typeof _0x23b001[_0x72a0('0x20')]===_0x72a0('0x21')&&typeof _0x23b001[_0x72a0('0x22')]===_0x72a0('0x21');var _0x2d1e95=_0x3f3d62['count'];var _0x100d8f=_0x4ab55e?0x0:_0x23b001[_0x72a0('0x20')];var _0x131b73=_0x4ab55e?_0x3f3d62['count']:_0x23b001[_0x72a0('0x20')]+_0x23b001[_0x72a0('0x22')];var _0x30899b;if(_0x131b73>=_0x2d1e95){_0x131b73=_0x2d1e95;_0x30899b=0xc8;}else{_0x30899b=0xce;}_0x1d1133[_0x72a0('0x1d')](_0x30899b);return _0x1d1133['set'](_0x72a0('0x23'),_0x100d8f+'-'+_0x131b73+'/'+_0x2d1e95)['json'](_0x3f3d62);}return null;};}function patchUpdates(_0x3d0607){return function(_0x315413){try{jsonpatch[_0x72a0('0x24')](_0x315413,_0x3d0607,!![]);}catch(_0x5c7479){return BPromise[_0x72a0('0x25')](_0x5c7479);}return _0x315413[_0x72a0('0x26')]();};}function saveUpdates(_0x1d22d8,_0x3d1965){return function(_0x5d6145){if(_0x5d6145){return _0x5d6145[_0x72a0('0x27')](_0x1d22d8)[_0x72a0('0x28')](function(_0x1ddd54){return _0x1ddd54;});}return null;};}function removeEntity(_0x23b918,_0x3022b0){return function(_0x174b1b){if(_0x174b1b){return _0x174b1b['destroy']()['then'](function(){_0x23b918[_0x72a0('0x1d')](0xcc)[_0x72a0('0x1e')]();});}};}function handleEntityNotFound(_0x123df4,_0x1504ed){return function(_0xf5cb49){if(!_0xf5cb49){_0x123df4[_0x72a0('0x1c')](0x194);}return _0xf5cb49;};}function handleError(_0xa5bda0,_0x15922a){_0x15922a=_0x15922a||0x1f4;return function(_0xee99e2){logger[_0x72a0('0x29')](_0xee99e2['stack']);if(_0xee99e2[_0x72a0('0x2a')]){delete _0xee99e2[_0x72a0('0x2a')];}_0xa5bda0[_0x72a0('0x1d')](_0x15922a)[_0x72a0('0x2b')](_0xee99e2);};}exports[_0x72a0('0x2c')]=function(_0x177a3a,_0x432179){var _0x12eda2={},_0x23c96a={},_0x916733={'count':0x0,'rows':[]};var _0x4ba037=_[_0x72a0('0x2d')](db[_0x72a0('0x2e')][_0x72a0('0x2f')],function(_0xfbe9b3){return{'name':_0xfbe9b3[_0x72a0('0x30')],'type':_0xfbe9b3[_0x72a0('0x31')][_0x72a0('0x32')]};});_0x23c96a['model']=_[_0x72a0('0x2d')](_0x4ba037,_0x72a0('0x2a'));_0x23c96a[_0x72a0('0x33')]=_[_0x72a0('0x34')](_0x177a3a[_0x72a0('0x33')]);_0x23c96a[_0x72a0('0x35')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],_0x23c96a['query']);_0x12eda2[_0x72a0('0x38')]=_[_0x72a0('0x36')](_0x23c96a[_0x72a0('0x37')],qs['fields'](_0x177a3a[_0x72a0('0x33')]['fields']));_0x12eda2[_0x72a0('0x38')]=_0x12eda2[_0x72a0('0x38')][_0x72a0('0x39')]?_0x12eda2[_0x72a0('0x38')]:_0x23c96a[_0x72a0('0x37')];if(!_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3a')](_0x72a0('0x3b'))){_0x12eda2[_0x72a0('0x22')]=qs[_0x72a0('0x22')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x22')]);_0x12eda2['offset']=qs[_0x72a0('0x20')](_0x177a3a['query'][_0x72a0('0x20')]);}_0x12eda2[_0x72a0('0x3c')]=qs[_0x72a0('0x3d')](_0x177a3a[_0x72a0('0x33')][_0x72a0('0x3d')]);_0x12eda2[_0x72a0('0x3e')]=qs[_0x72a0('0x35')](_[_0x72a0('0x3f')](_0x177a3a[_0x72a0('0x33')],_0x23c96a['filters']),_0x4ba037);if(_0x177a3a['query'][_0x72a0('0x40')]){_0x12eda2[_0x72a0('0x3e')]=_[_0x72a0('0x41')](_0x12eda2[_0x72a0('0x3e')],{'$or':_[_0x72a0('0x2d')](_0x4ba037,function(_0x512a06){if(_0x512a06[_0x72a0('0x31')]!==_0x72a0('0x42')){var _0x582c90={};_0x582c90[_0x512a06[_0x72a0('0x2a')]]={'$like':'%'+_0x177a3a['query']['filter']+'%'};return _0x582c90;}})});}_0x12eda2=_['merge']({},_0x12eda2,_0x177a3a[_0x72a0('0x43')]);var _0x49633b={'where':_0x12eda2[_0x72a0('0x3e')]};return db[_0x72a0('0x2e')][_0x72a0('0x44')](_0x49633b)[_0x72a0('0x28')](function(_0x4bf56e){_0x916733['count']=_0x4bf56e;if(_0x177a3a['query']['includeAll']){_0x12eda2[_0x72a0('0x45')]=[{'all':!![]}];}return db[_0x72a0('0x2e')]['findAll'](_0x12eda2);})[_0x72a0('0x28')](function(_0x35d790){_0x916733['rows']=_0x35d790;return _0x916733;})[_0x72a0('0x28')](respondWithFilteredResult(_0x432179,_0x12eda2))[_0x72a0('0x46')](handleError(_0x432179,null));};exports[_0x72a0('0x47')]=function(_0xe4abe1,_0x340153){var _0x341451={'raw':!![],'where':{'id':_0xe4abe1[_0x72a0('0x48')]['id']}},_0x50eb7f={};_0x50eb7f['model']=_[_0x72a0('0x34')](db['CmHopperFinal'][_0x72a0('0x2f')]);_0x50eb7f[_0x72a0('0x33')]=_['keys'](_0xe4abe1[_0x72a0('0x33')]);_0x50eb7f['filters']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],_0x50eb7f[_0x72a0('0x33')]);_0x341451['attributes']=_[_0x72a0('0x36')](_0x50eb7f[_0x72a0('0x37')],qs[_0x72a0('0x49')](_0xe4abe1['query']['fields']));_0x341451[_0x72a0('0x38')]=_0x341451['attributes'][_0x72a0('0x39')]?_0x341451[_0x72a0('0x38')]:_0x50eb7f[_0x72a0('0x37')];if(_0xe4abe1[_0x72a0('0x33')][_0x72a0('0x4a')]){_0x341451[_0x72a0('0x45')]=[{'all':!![]}];}_0x341451=_[_0x72a0('0x41')]({},_0x341451,_0xe4abe1[_0x72a0('0x43')]);return db[_0x72a0('0x2e')]['find'](_0x341451)[_0x72a0('0x28')](handleEntityNotFound(_0x340153,null))[_0x72a0('0x28')](respondWithResult(_0x340153,null))[_0x72a0('0x46')](handleError(_0x340153,null));};exports[_0x72a0('0x4b')]=function(_0x3a669d,_0x304400){return db[_0x72a0('0x2e')]['describe']()['then'](respondWithResult(_0x304400,null))[_0x72a0('0x46')](handleError(_0x304400,null));};exports[_0x72a0('0x27')]=function(_0xe38fb3,_0x3cab6a){if(_0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')]){delete _0xe38fb3[_0x72a0('0x4c')][_0x72a0('0x4d')];}return db[_0x72a0('0x2e')][_0x72a0('0x4e')]({'where':{'uniqueid':_0xe38fb3['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3cab6a,null))[_0x72a0('0x28')](saveUpdates(_0xe38fb3[_0x72a0('0x4c')],null))[_0x72a0('0x28')](respondWithResult(_0x3cab6a,null))[_0x72a0('0x46')](handleError(_0x3cab6a,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x143410,_0x595243,_0x4d712b){return db[_0x72a0('0x2e')][_0x72a0('0x4f')]({'raw':![],'where':{'VoiceQueueId':_0x143410[_0x72a0('0x48')]['id']},'attributes':[[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')]('`state`\x20=\x200,\x201,\x20null'))),'noSuchContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x205,\x201,\x20null'))),_0x72a0('0x55')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x72a0('0x57')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x595243,null))['then'](respondWithResult(_0x595243,null))['catch'](handleError(_0x595243,null));};exports['countContactsIvrCampaignHopperFinal']=function(_0x522ee2,_0x237025,_0x4e5d05){return db[_0x72a0('0x2e')]['findAll']({'raw':![],'where':{'CampaignId':_0x522ee2[_0x72a0('0x48')]['id']},'attributes':[[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x5b')))),_0x72a0('0x5c')],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x53')))),_0x72a0('0x54')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5d')))),'busyContacts'],[db['sequelize']['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x5e')))),_0x72a0('0x5f')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')]['literal'](_0x72a0('0x56')))),'dropContacts'],[db[_0x72a0('0x50')]['fn'](_0x72a0('0x51'),db['sequelize']['fn']('IF',db[_0x72a0('0x50')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x72a0('0x50')]['fn']('COUNT',db[_0x72a0('0x50')]['fn']('IF',db['sequelize'][_0x72a0('0x52')](_0x72a0('0x58')))),_0x72a0('0x59')],[db['sequelize']['fn'](_0x72a0('0x51'),db[_0x72a0('0x50')]['fn']('IF',db[_0x72a0('0x50')][_0x72a0('0x52')](_0x72a0('0x5a')))),'answeringMachine']]})[_0x72a0('0x28')](handleEntityNotFound(_0x237025,null))[_0x72a0('0x28')](respondWithResult(_0x237025,null))[_0x72a0('0x46')](handleError(_0x237025,null));};exports[_0x72a0('0x60')]=function(_0x4f0944,_0x3dd25d,_0x647e75){return db['VoiceQueue'][_0x72a0('0x4e')]({'where':{'id':_0x4f0944['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x3dd25d,null))[_0x72a0('0x28')](function(_0xb17e09){var _0x1238a3;if(_0xb17e09){_0x1238a3=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery'](['phone','scheduledAt',_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x66'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6a'),_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')](_0x72a0('0x6f'),'ContactId')[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))[_0x72a0('0x6c')](_0x72a0('0x71'),_0x72a0('0x66'))['field'](_0x72a0('0x6d'),'createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where'](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']())[_0x72a0('0x3e')](_0x72a0('0x75'),_0x4f0944[_0x72a0('0x4c')][_0x72a0('0x76')]['toString']())[_0x72a0('0x3e')](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x6b'))[_0x72a0('0x72')](_0x72a0('0x63'))[_0x72a0('0x3e')](_0x72a0('0x74'),_0x4f0944[_0x72a0('0x48')]['id']['toString']()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()[_0x72a0('0x6c')](_0x72a0('0x79'))[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')]('VoiceQueueId\x20=\x20?',_0x4f0944[_0x72a0('0x48')]['id']['toString']())['where'](_0x72a0('0x7a')))['group']('ContactId'))[_0x72a0('0x7b')]();return db['sequelize'][_0x72a0('0x33')](_0x1238a3);}return[];})[_0x72a0('0x28')](respondWithResult(_0x3dd25d,null))[_0x72a0('0x46')](handleError(_0x3dd25d,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x344a69,_0x179ca2,_0x3832d7){return db[_0x72a0('0x7c')][_0x72a0('0x4e')]({'where':{'id':_0x344a69['params']['id']}})[_0x72a0('0x28')](handleEntityNotFound(_0x179ca2,null))[_0x72a0('0x28')](function(_0x38736e){var _0x4f421f;if(_0x38736e){_0x4f421f=squel[_0x72a0('0x61')]()[_0x72a0('0x62')](_0x72a0('0x63'))['fromQuery']([_0x72a0('0x6b'),_0x72a0('0x6e'),_0x72a0('0x64'),_0x72a0('0x65'),_0x72a0('0x7d'),_0x72a0('0x67'),_0x72a0('0x68')],squel[_0x72a0('0x69')]()[_0x72a0('0x6c')]('ANY_VALUE(calleridnum)',_0x72a0('0x6b'))[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x6e'))[_0x72a0('0x6c')]('ANY_VALUE(ContactId)',_0x72a0('0x64'))[_0x72a0('0x6c')](_0x72a0('0x70'),_0x72a0('0x65'))['field'](_0x72a0('0x7e'),_0x72a0('0x7d'))[_0x72a0('0x6c')]('NOW()','createdAt')[_0x72a0('0x6c')](_0x72a0('0x6d'),_0x72a0('0x68'))[_0x72a0('0x72')](_0x72a0('0x73'))['where']('CampaignId\x20=\x20?',_0x344a69['params']['id'][_0x72a0('0x7b')]())['where'](_0x72a0('0x75'),_0x344a69['body']['state']['toString']())['where'](_0x72a0('0x77'))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field'](_0x72a0('0x6b'))[_0x72a0('0x72')]('cm_hopper')[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69['params']['id'][_0x72a0('0x7b')]()))[_0x72a0('0x3e')](_0x72a0('0x78'),squel[_0x72a0('0x69')]()['field']('calleridnum')[_0x72a0('0x72')](_0x72a0('0x73'))[_0x72a0('0x3e')](_0x72a0('0x7f'),_0x344a69[_0x72a0('0x48')]['id'][_0x72a0('0x7b')]())['where']('state\x20=\x204'))[_0x72a0('0x80')](_0x72a0('0x64')))['toString']();return db[_0x72a0('0x50')][_0x72a0('0x33')](_0x4f421f);}return[];})[_0x72a0('0x28')](respondWithResult(_0x179ca2,null))[_0x72a0('0x46')](handleError(_0x179ca2,null));};exports[_0x72a0('0x81')]=function(_0x167a80,_0x7533ea,_0x56bdf5){return db[_0x72a0('0x82')][_0x72a0('0x83')]({'where':{'VoiceQueueId':_0x167a80[_0x72a0('0x4c')]['VoiceQueueId'],'CampaignId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x7d')],'ContactId':_0x167a80[_0x72a0('0x4c')][_0x72a0('0x64')]}})[_0x72a0('0x28')](handleEntityNotFound(_0x7533ea,null))['then'](function(_0xc16765){if(_0xc16765){return _0xc16765;}return null;})[_0x72a0('0x28')](respondWithResult(_0x7533ea,null))[_0x72a0('0x46')](handleError(_0x7533ea,null));}; \ No newline at end of file +var _0x90b1=['uniqueid','countContactsQueueCampaignHopperFinal','findAll','params','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','VoiceQueue','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','VoiceQueueId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','moveContactsIvrCampaignHopperFinal','Campaign','into','ListId','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','calleridnum\x20IS\x20NOT\x20NULL','CmHopper','findOne','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','then','destroy','error','name','send','index','map','rawAttributes','fieldName','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','pick','filter','merge','where','type','options','CmHopperFinal','includeAll','rows','include','find','catch','update','body'];(function(_0x5805d7,_0x3d584a){var _0x170fe4=function(_0x3b9b73){while(--_0x3b9b73){_0x5805d7['push'](_0x5805d7['shift']());}};_0x170fe4(++_0x3d584a);}(_0x90b1,0x1bb));var _0x190b=function(_0x29a7bd,_0x4da9ac){_0x29a7bd=_0x29a7bd-0x0;var _0x5a95d3=_0x90b1[_0x29a7bd];return _0x5a95d3;};'use strict';var emlformat=require(_0x190b('0x0'));var rimraf=require(_0x190b('0x1'));var zipdir=require(_0x190b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x190b('0x3'));var BPromise=require(_0x190b('0x4'));var Mustache=require(_0x190b('0x5'));var util=require(_0x190b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x190b('0x7'));var _=require(_0x190b('0x8'));var squel=require(_0x190b('0x9'));var crypto=require(_0x190b('0xa'));var jsforce=require(_0x190b('0xb'));var deskjs=require(_0x190b('0xc'));var toCsv=require(_0x190b('0xd'));var querystring=require('querystring');var Papa=require(_0x190b('0xe'));var Redis=require(_0x190b('0xf'));var authService=require(_0x190b('0x10'));var qs=require(_0x190b('0x11'));var as=require(_0x190b('0x12'));var hardwareService=require(_0x190b('0x13'));var logger=require(_0x190b('0x14'))(_0x190b('0x15'));var utils=require('../../config/utils');var config=require(_0x190b('0x16'));var licenseUtil=require(_0x190b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d63ac,_0x596c48){_0x596c48=_0x596c48||0xcc;return function(_0x286c81){if(_0x286c81){return _0x4d63ac[_0x190b('0x18')](_0x596c48);}return _0x4d63ac[_0x190b('0x19')](_0x596c48)[_0x190b('0x1a')]();};}function respondWithResult(_0x2e12d4,_0x13544c){_0x13544c=_0x13544c||0xc8;return function(_0x1ff180){if(_0x1ff180){return _0x2e12d4[_0x190b('0x19')](_0x13544c)[_0x190b('0x1b')](_0x1ff180);}};}function respondWithFilteredResult(_0x1a046f,_0xab346){return function(_0x3e8781){if(_0x3e8781){var _0x3fbfc3=typeof _0xab346[_0x190b('0x1c')]===_0x190b('0x1d')&&typeof _0xab346['limit']===_0x190b('0x1d');var _0x5efbed=_0x3e8781[_0x190b('0x1e')];var _0x21e458=_0x3fbfc3?0x0:_0xab346[_0x190b('0x1c')];var _0x16c009=_0x3fbfc3?_0x3e8781['count']:_0xab346[_0x190b('0x1c')]+_0xab346[_0x190b('0x1f')];var _0x441a2b;if(_0x16c009>=_0x5efbed){_0x16c009=_0x5efbed;_0x441a2b=0xc8;}else{_0x441a2b=0xce;}_0x1a046f[_0x190b('0x19')](_0x441a2b);return _0x1a046f[_0x190b('0x20')](_0x190b('0x21'),_0x21e458+'-'+_0x16c009+'/'+_0x5efbed)['json'](_0x3e8781);}return null;};}function patchUpdates(_0x3ed24c){return function(_0x14f0a5){try{jsonpatch['apply'](_0x14f0a5,_0x3ed24c,!![]);}catch(_0xb4c32b){return BPromise['reject'](_0xb4c32b);}return _0x14f0a5['save']();};}function saveUpdates(_0xcd15e5,_0x42e7f2){return function(_0x332006){if(_0x332006){return _0x332006['update'](_0xcd15e5)[_0x190b('0x22')](function(_0x2e633e){return _0x2e633e;});}return null;};}function removeEntity(_0x16e989,_0x292ce3){return function(_0x3b8c74){if(_0x3b8c74){return _0x3b8c74[_0x190b('0x23')]()[_0x190b('0x22')](function(){_0x16e989['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x262a63,_0x1a5f86){return function(_0x50605b){if(!_0x50605b){_0x262a63['sendStatus'](0x194);}return _0x50605b;};}function handleError(_0x3260d5,_0x4e2a93){_0x4e2a93=_0x4e2a93||0x1f4;return function(_0x328e5e){logger[_0x190b('0x24')](_0x328e5e['stack']);if(_0x328e5e[_0x190b('0x25')]){delete _0x328e5e[_0x190b('0x25')];}_0x3260d5['status'](_0x4e2a93)[_0x190b('0x26')](_0x328e5e);};}exports[_0x190b('0x27')]=function(_0x359b4a,_0x494f3f){var _0x536d7b={},_0x3730cc={},_0x4d5f3f={'count':0x0,'rows':[]};var _0x14be2c=_[_0x190b('0x28')](db['CmHopperFinal'][_0x190b('0x29')],function(_0x580b92){return{'name':_0x580b92[_0x190b('0x2a')],'type':_0x580b92['type'][_0x190b('0x2b')]};});_0x3730cc['model']=_[_0x190b('0x28')](_0x14be2c,_0x190b('0x25'));_0x3730cc['query']=_[_0x190b('0x2c')](_0x359b4a[_0x190b('0x2d')]);_0x3730cc[_0x190b('0x2e')]=_[_0x190b('0x2f')](_0x3730cc[_0x190b('0x30')],_0x3730cc[_0x190b('0x2d')]);_0x536d7b[_0x190b('0x31')]=_[_0x190b('0x2f')](_0x3730cc['model'],qs['fields'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x32')]));_0x536d7b['attributes']=_0x536d7b[_0x190b('0x31')][_0x190b('0x33')]?_0x536d7b[_0x190b('0x31')]:_0x3730cc[_0x190b('0x30')];if(!_0x359b4a[_0x190b('0x2d')][_0x190b('0x34')](_0x190b('0x35'))){_0x536d7b['limit']=qs['limit'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1f')]);_0x536d7b[_0x190b('0x1c')]=qs['offset'](_0x359b4a[_0x190b('0x2d')][_0x190b('0x1c')]);}_0x536d7b[_0x190b('0x36')]=qs['sort'](_0x359b4a[_0x190b('0x2d')]['sort']);_0x536d7b['where']=qs[_0x190b('0x2e')](_[_0x190b('0x37')](_0x359b4a['query'],_0x3730cc[_0x190b('0x2e')]),_0x14be2c);if(_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]){_0x536d7b['where']=_[_0x190b('0x39')](_0x536d7b[_0x190b('0x3a')],{'$or':_['map'](_0x14be2c,function(_0x5d006d){if(_0x5d006d[_0x190b('0x3b')]!=='VIRTUAL'){var _0x46bdba={};_0x46bdba[_0x5d006d[_0x190b('0x25')]]={'$like':'%'+_0x359b4a[_0x190b('0x2d')][_0x190b('0x38')]+'%'};return _0x46bdba;}})});}_0x536d7b=_['merge']({},_0x536d7b,_0x359b4a[_0x190b('0x3c')]);var _0x5f118c={'where':_0x536d7b[_0x190b('0x3a')]};return db[_0x190b('0x3d')]['count'](_0x5f118c)[_0x190b('0x22')](function(_0x2a75d2){_0x4d5f3f[_0x190b('0x1e')]=_0x2a75d2;if(_0x359b4a['query'][_0x190b('0x3e')]){_0x536d7b['include']=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x536d7b);})[_0x190b('0x22')](function(_0x3aef1d){_0x4d5f3f[_0x190b('0x3f')]=_0x3aef1d;return _0x4d5f3f;})[_0x190b('0x22')](respondWithFilteredResult(_0x494f3f,_0x536d7b))['catch'](handleError(_0x494f3f,null));};exports['show']=function(_0x4045b7,_0x492240){var _0x110891={'raw':!![],'where':{'id':_0x4045b7['params']['id']}},_0x3d67f0={};_0x3d67f0[_0x190b('0x30')]=_[_0x190b('0x2c')](db[_0x190b('0x3d')]['rawAttributes']);_0x3d67f0[_0x190b('0x2d')]=_[_0x190b('0x2c')](_0x4045b7['query']);_0x3d67f0[_0x190b('0x2e')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],_0x3d67f0[_0x190b('0x2d')]);_0x110891[_0x190b('0x31')]=_['intersection'](_0x3d67f0[_0x190b('0x30')],qs['fields'](_0x4045b7[_0x190b('0x2d')][_0x190b('0x32')]));_0x110891[_0x190b('0x31')]=_0x110891[_0x190b('0x31')][_0x190b('0x33')]?_0x110891[_0x190b('0x31')]:_0x3d67f0[_0x190b('0x30')];if(_0x4045b7['query'][_0x190b('0x3e')]){_0x110891[_0x190b('0x40')]=[{'all':!![]}];}_0x110891=_[_0x190b('0x39')]({},_0x110891,_0x4045b7['options']);return db[_0x190b('0x3d')][_0x190b('0x41')](_0x110891)[_0x190b('0x22')](handleEntityNotFound(_0x492240,null))[_0x190b('0x22')](respondWithResult(_0x492240,null))[_0x190b('0x42')](handleError(_0x492240,null));};exports['describe']=function(_0x1f2262,_0xadc789){return db[_0x190b('0x3d')]['describe']()[_0x190b('0x22')](respondWithResult(_0xadc789,null))[_0x190b('0x42')](handleError(_0xadc789,null));};exports[_0x190b('0x43')]=function(_0x505e52,_0x4cb561){if(_0x505e52[_0x190b('0x44')][_0x190b('0x45')]){delete _0x505e52[_0x190b('0x44')][_0x190b('0x45')];}return db[_0x190b('0x3d')][_0x190b('0x41')]({'where':{'uniqueid':_0x505e52['params']['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x4cb561,null))[_0x190b('0x22')](saveUpdates(_0x505e52[_0x190b('0x44')],null))['then'](respondWithResult(_0x4cb561,null))[_0x190b('0x42')](handleError(_0x4cb561,null));};exports[_0x190b('0x46')]=function(_0x215ab6,_0x503700,_0xbc6757){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x215ab6[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db['sequelize']['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x203,\x201,\x20null'))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),_0x190b('0x50')],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')]('`state`\x20=\x2019,\x201,\x20null'))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0x503700,null))[_0x190b('0x22')](respondWithResult(_0x503700,null))['catch'](handleError(_0x503700,null));};exports[_0x190b('0x58')]=function(_0x270b59,_0xffe7cb,_0x405e04){return db[_0x190b('0x3d')][_0x190b('0x47')]({'raw':![],'where':{'CampaignId':_0x270b59[_0x190b('0x48')]['id']},'attributes':[[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x4c')))),_0x190b('0x4d')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')]['literal'](_0x190b('0x59')))),_0x190b('0x4e')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x4f')))),'busyContacts'],[db[_0x190b('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x51')))),'congestionContacts'],[db['sequelize']['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x52')))),_0x190b('0x53')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db['sequelize']['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')](_0x190b('0x54')))),_0x190b('0x55')],[db[_0x190b('0x49')]['fn']('COUNT',db[_0x190b('0x49')]['fn']('IF',db[_0x190b('0x49')][_0x190b('0x4b')]('`state`\x20=\x2022,\x201,\x20null'))),_0x190b('0x5a')],[db[_0x190b('0x49')]['fn'](_0x190b('0x4a'),db[_0x190b('0x49')]['fn']('IF',db['sequelize'][_0x190b('0x4b')](_0x190b('0x5b')))),_0x190b('0x57')]]})[_0x190b('0x22')](handleEntityNotFound(_0xffe7cb,null))['then'](respondWithResult(_0xffe7cb,null))[_0x190b('0x42')](handleError(_0xffe7cb,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x2495c9,_0x348beb,_0x360d39){return db[_0x190b('0x5c')]['find']({'where':{'id':_0x2495c9[_0x190b('0x48')]['id']}})['then'](handleEntityNotFound(_0x348beb,null))[_0x190b('0x22')](function(_0x5073d2){var _0x49b60c;if(_0x5073d2){_0x49b60c=squel[_0x190b('0x5d')]()['into'](_0x190b('0x5e'))[_0x190b('0x5f')]([_0x190b('0x60'),_0x190b('0x61'),_0x190b('0x62'),'ListId',_0x190b('0x63'),_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),'phone')[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))['field'](_0x190b('0x69'),_0x190b('0x62'))[_0x190b('0x66')](_0x190b('0x6a'),'ListId')[_0x190b('0x66')](_0x190b('0x6b'),_0x190b('0x63'))['field'](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')]('NOW()',_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']())[_0x190b('0x3a')](_0x190b('0x6f'),_0x2495c9['body'][_0x190b('0x70')][_0x190b('0x71')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x190b('0x3a')](_0x190b('0x72'),squel['select']()['field'](_0x190b('0x60'))[_0x190b('0x6c')](_0x190b('0x5e'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9['params']['id']['toString']()))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x6e'),_0x2495c9[_0x190b('0x48')]['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')]['query'](_0x49b60c);}return[];})['then'](respondWithResult(_0x348beb,null))[_0x190b('0x42')](handleError(_0x348beb,null));};exports[_0x190b('0x76')]=function(_0x4b988d,_0x40ac95,_0x18c5f4){return db[_0x190b('0x77')]['find']({'where':{'id':_0x4b988d[_0x190b('0x48')]['id']}})[_0x190b('0x22')](handleEntityNotFound(_0x40ac95,null))['then'](function(_0x23298e){var _0x2ba27b;if(_0x23298e){_0x2ba27b=squel['insert']()[_0x190b('0x78')]('cm_hopper')['fromQuery'](['phone','scheduledAt',_0x190b('0x62'),_0x190b('0x79'),'CampaignId',_0x190b('0x64'),_0x190b('0x65')],squel['select']()[_0x190b('0x66')](_0x190b('0x67'),_0x190b('0x60'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x61'))[_0x190b('0x66')](_0x190b('0x69'),_0x190b('0x62'))['field'](_0x190b('0x6a'),'ListId')['field'](_0x190b('0x7a'),_0x190b('0x7b'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x64'))[_0x190b('0x66')](_0x190b('0x68'),_0x190b('0x65'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x6f'),_0x4b988d[_0x190b('0x44')][_0x190b('0x70')][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x7d'))[_0x190b('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x60'))['from'](_0x190b('0x5e'))[_0x190b('0x3a')]('CampaignId\x20=\x20?',_0x4b988d['params']['id'][_0x190b('0x71')]()))[_0x190b('0x3a')](_0x190b('0x72'),squel[_0x190b('0x73')]()[_0x190b('0x66')](_0x190b('0x74'))[_0x190b('0x6c')](_0x190b('0x6d'))[_0x190b('0x3a')](_0x190b('0x7c'),_0x4b988d['params']['id'][_0x190b('0x71')]())[_0x190b('0x3a')](_0x190b('0x75')))['group'](_0x190b('0x62')))[_0x190b('0x71')]();return db[_0x190b('0x49')][_0x190b('0x2d')](_0x2ba27b);}return[];})[_0x190b('0x22')](respondWithResult(_0x40ac95,null))[_0x190b('0x42')](handleError(_0x40ac95,null));};exports['checkContactHopper']=function(_0x476c86,_0x298824,_0x5e7c76){return db[_0x190b('0x7e')][_0x190b('0x7f')]({'where':{'VoiceQueueId':_0x476c86[_0x190b('0x44')][_0x190b('0x63')],'CampaignId':_0x476c86[_0x190b('0x44')][_0x190b('0x7b')],'ContactId':_0x476c86[_0x190b('0x44')][_0x190b('0x62')]}})['then'](handleEntityNotFound(_0x298824,null))[_0x190b('0x22')](function(_0x1b3168){if(_0x1b3168){return _0x1b3168;}return null;})[_0x190b('0x22')](respondWithResult(_0x298824,null))[_0x190b('0x42')](handleError(_0x298824,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 9673bc3..f57c6a5 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 _0xa273=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x3db3c3,_0x56f20c){var _0x2d5c78=function(_0x2631a5){while(--_0x2631a5){_0x3db3c3['push'](_0x3db3c3['shift']());}};_0x2d5c78(++_0x56f20c);}(_0xa273,0x134));var _0x3a27=function(_0x2a7406,_0x105e74){_0x2a7406=_0x2a7406-0x0;var _0x43953d=_0xa273[_0x2a7406];return _0x43953d;};'use strict';var _=require('lodash');var util=require(_0x3a27('0x0'));var logger=require(_0x3a27('0x1'))(_0x3a27('0x2'));var moment=require('moment');var BPromise=require(_0x3a27('0x3'));var rp=require(_0x3a27('0x4'));var fs=require('fs');var path=require(_0x3a27('0x5'));var rimraf=require(_0x3a27('0x6'));var config=require(_0x3a27('0x7'));var attributes=require('./cmHopperFinal.attributes');module[_0x3a27('0x8')]=function(_0x157a85,_0x39f6f3){return _0x157a85[_0x3a27('0x9')](_0x3a27('0xa'),attributes,{'tableName':_0x3a27('0xb'),'paranoid':![],'indexes':[{'name':_0x3a27('0xc'),'fields':['calleridnum']},{'name':_0x3a27('0xd'),'fields':[_0x3a27('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed7=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0xd83430,_0x38b0ba){var _0x3874b2=function(_0x596510){while(--_0x596510){_0xd83430['push'](_0xd83430['shift']());}};_0x3874b2(++_0x38b0ba);}(_0x8ed7,0x89));var _0x78ed=function(_0x8b8d2b,_0x166136){_0x8b8d2b=_0x8b8d2b-0x0;var _0x296dbe=_0x8ed7[_0x8b8d2b];return _0x296dbe;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var logger=require('../../config/logger')(_0x78ed('0x1'));var moment=require(_0x78ed('0x2'));var BPromise=require(_0x78ed('0x3'));var rp=require(_0x78ed('0x4'));var fs=require('fs');var path=require(_0x78ed('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x78ed('0x6'));module[_0x78ed('0x7')]=function(_0x11ab69,_0x2112b0){return _0x11ab69[_0x78ed('0x8')](_0x78ed('0x9'),attributes,{'tableName':_0x78ed('0xa'),'paranoid':![],'indexes':[{'name':_0x78ed('0xb'),'fields':[_0x78ed('0xb')]},{'name':_0x78ed('0xc'),'fields':[_0x78ed('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index db50088..15b4b30 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5115ca,_0x3a1376){var _0x3d4be5=function(_0x3da3de){while(--_0x3da3de){_0x5115ca['push'](_0x5115ca['shift']());}};_0x3d4be5(++_0x3a1376);}(_0xb10b,0x12a));var _0xbb10=function(_0x52c553,_0x273e5a){_0x52c553=_0x52c553-0x0;var _0x425607=_0xb10b[_0x52c553];return _0x425607;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x5e5696,_0x2d591b){var _0x23fd24=function(_0xa25231){while(--_0xa25231){_0x5e5696['push'](_0x5e5696['shift']());}};_0x23fd24(++_0x2d591b);}(_0xb10b,0x12a));var _0xbb10=function(_0x47c492,_0x311a27){_0x47c492=_0x47c492-0x0;var _0x32105d=_0xb10b[_0x47c492];return _0x32105d;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 0b71632..edb309e 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 _0x21ec=['exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','show','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','/:id','update'];(function(_0x2a4bba,_0x6b399b){var _0x3c470d=function(_0xabb4a6){while(--_0xabb4a6){_0x2a4bba['push'](_0x2a4bba['shift']());}};_0x3c470d(++_0x6b399b);}(_0x21ec,0xb0));var _0xc21e=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x21ec[_0x5d4607];return _0x5e4a86;};'use strict';var multer=require(_0xc21e('0x0'));var util=require('util');var path=require(_0xc21e('0x1'));var timeout=require(_0xc21e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc21e('0x3'));var auth=require(_0xc21e('0x4'));var interaction=require(_0xc21e('0x5'));var config=require(_0xc21e('0x6'));var controller=require(_0xc21e('0x7'));router[_0xc21e('0x8')]('/',auth[_0xc21e('0x9')](),controller[_0xc21e('0xa')]);router[_0xc21e('0x8')]('/describe',auth[_0xc21e('0x9')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0xc21e('0xb')]);router[_0xc21e('0x8')]('/voice/queue/countAttributes/:id',auth['isAuthenticated'](),controller[_0xc21e('0xc')]);router['get'](_0xc21e('0xd'),auth[_0xc21e('0x9')](),controller['countContactsIvrCampaignHopperFinal']);router[_0xc21e('0xe')](_0xc21e('0xf'),auth['isAuthenticated'](),controller[_0xc21e('0x10')]);router[_0xc21e('0xe')](_0xc21e('0x11'),auth[_0xc21e('0x9')](),controller[_0xc21e('0x12')]);router[_0xc21e('0xe')](_0xc21e('0x13'),auth['isAuthenticated'](),controller[_0xc21e('0x14')]);router[_0xc21e('0x15')](_0xc21e('0x16'),auth['isAuthenticated'](),controller[_0xc21e('0x17')]);module[_0xc21e('0x18')]=router; \ No newline at end of file +var _0xf12f=['isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','put','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get'];(function(_0x2cf8cd,_0x62b5f4){var _0x55c213=function(_0x3f86e0){while(--_0x3f86e0){_0x2cf8cd['push'](_0x2cf8cd['shift']());}};_0x55c213(++_0x62b5f4);}(_0xf12f,0x104));var _0xff12=function(_0x3a4fc0,_0x315bfb){_0x3a4fc0=_0x3a4fc0-0x0;var _0x11171b=_0xf12f[_0x3a4fc0];return _0x11171b;};'use strict';var multer=require(_0xff12('0x0'));var util=require(_0xff12('0x1'));var path=require(_0xff12('0x2'));var timeout=require(_0xff12('0x3'));var express=require('express');var router=express[_0xff12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xff12('0x5'));var interaction=require(_0xff12('0x6'));var config=require(_0xff12('0x7'));var controller=require(_0xff12('0x8'));router[_0xff12('0x9')]('/',auth[_0xff12('0xa')](),controller[_0xff12('0xb')]);router['get'](_0xff12('0xc'),auth['isAuthenticated'](),controller[_0xff12('0xd')]);router[_0xff12('0x9')](_0xff12('0xe'),auth[_0xff12('0xa')](),controller[_0xff12('0xf')]);router['get'](_0xff12('0x10'),auth[_0xff12('0xa')](),controller[_0xff12('0x11')]);router['get'](_0xff12('0x12'),auth['isAuthenticated'](),controller[_0xff12('0x13')]);router[_0xff12('0x14')]('/voice/queue/moveContacts/:id',auth['isAuthenticated'](),controller[_0xff12('0x15')]);router[_0xff12('0x14')](_0xff12('0x16'),auth[_0xff12('0xa')](),controller[_0xff12('0x17')]);router[_0xff12('0x14')](_0xff12('0x18'),auth[_0xff12('0xa')](),controller['checkContactHopper']);router[_0xff12('0x19')](_0xff12('0xe'),auth['isAuthenticated'](),controller['update']);module[_0xff12('0x1a')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 070d51d..44f2dbd 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 _0xffef=['sequelize','INTEGER','STRING','DATE','BOOLEAN'];(function(_0x42da91,_0x596657){var _0x561a66=function(_0x18389f){while(--_0x18389f){_0x42da91['push'](_0x42da91['shift']());}};_0x561a66(++_0x596657);}(_0xffef,0x1b8));var _0xfffe=function(_0x271ac1,_0x4a5d3f){_0x271ac1=_0x271ac1-0x0;var _0x378913=_0xffef[_0x271ac1];return _0x378913;};'use strict';var Sequelize=require(_0xfffe('0x0'));module['exports']={'state':{'type':Sequelize[_0xfffe('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xfffe('0x2')]},'scheduledat':{'type':Sequelize[_0xfffe('0x3')]},'countbusyretry':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xfffe('0x2')]},'originatecalleridname':{'type':Sequelize[_0xfffe('0x2')]},'calleridnum':{'type':Sequelize[_0xfffe('0x2')]},'calleridname':{'type':Sequelize[_0xfffe('0x2')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xfffe('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xfffe('0x3')]},'ringtime':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xfffe('0x2')]},'campaign':{'type':Sequelize[_0xfffe('0x2')]},'campaigntype':{'type':Sequelize[_0xfffe('0x2')]},'membername':{'type':Sequelize[_0xfffe('0x2')]},'reason':{'type':Sequelize[_0xfffe('0x2')]},'amd':{'type':Sequelize[_0xfffe('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xfffe('0x3')]},'edited':{'type':Sequelize[_0xfffe('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xfffe('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x8529=['STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0xc264c2,_0x5d809e){var _0x2956a5=function(_0xca2f27){while(--_0xca2f27){_0xc264c2['push'](_0xc264c2['shift']());}};_0x2956a5(++_0x5d809e);}(_0x8529,0x1b2));var _0x9852=function(_0x5b9279,_0x154eec){_0x5b9279=_0x5b9279-0x0;var _0x4896c3=_0x8529[_0x5b9279];return _0x4896c3;};'use strict';var Sequelize=require(_0x9852('0x0'));module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x9852('0x1')]},'scheduledat':{'type':Sequelize[_0x9852('0x2')]},'countbusyretry':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9852('0x1')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x9852('0x1')]},'calleridnum':{'type':Sequelize[_0x9852('0x1')]},'calleridname':{'type':Sequelize[_0x9852('0x1')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x9852('0x2')]},'answertime':{'type':Sequelize[_0x9852('0x2')]},'droptime':{'type':Sequelize[_0x9852('0x2')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x9852('0x1')]},'campaign':{'type':Sequelize[_0x9852('0x1')]},'campaigntype':{'type':Sequelize[_0x9852('0x1')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0x9852('0x1')]},'amd':{'type':Sequelize[_0x9852('0x4')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x9852('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x9852('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9852('0x2')]},'recallme':{'type':Sequelize[_0x9852('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize['DATE']},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x9852('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 8bb1c85..634f247 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 _0x4b39=['map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','CmHopperHistory','includeAll','include','rows','catch','params','fields','find','body','describe','update','uniqueid','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','send','index'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x4b39,0x10b));var _0x94b3=function(_0x314123,_0x3384dc){_0x314123=_0x314123-0x0;var _0x14e309=_0x4b39[_0x314123];return _0x14e309;};'use strict';var emlformat=require(_0x94b3('0x0'));var rimraf=require(_0x94b3('0x1'));var zipdir=require(_0x94b3('0x2'));var jsonpatch=require(_0x94b3('0x3'));var rp=require('request-promise');var moment=require(_0x94b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x94b3('0x5'));var util=require(_0x94b3('0x6'));var path=require(_0x94b3('0x7'));var sox=require(_0x94b3('0x8'));var csv=require(_0x94b3('0x9'));var ejs=require(_0x94b3('0xa'));var fs=require('fs');var fs_extra=require(_0x94b3('0xb'));var _=require(_0x94b3('0xc'));var squel=require(_0x94b3('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x94b3('0xe'));var toCsv=require('to-csv');var querystring=require(_0x94b3('0xf'));var Papa=require(_0x94b3('0x10'));var Redis=require(_0x94b3('0x11'));var authService=require(_0x94b3('0x12'));var qs=require(_0x94b3('0x13'));var as=require(_0x94b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x94b3('0x15'));var utils=require(_0x94b3('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x94b3('0x17'));var db=require(_0x94b3('0x18'))['db'];function respondWithStatusCode(_0x1c92fb,_0x534673){_0x534673=_0x534673||0xcc;return function(_0x4337b9){if(_0x4337b9){return _0x1c92fb[_0x94b3('0x19')](_0x534673);}return _0x1c92fb['status'](_0x534673)[_0x94b3('0x1a')]();};}function respondWithResult(_0x3df948,_0x5d11a3){_0x5d11a3=_0x5d11a3||0xc8;return function(_0xa80c26){if(_0xa80c26){return _0x3df948[_0x94b3('0x1b')](_0x5d11a3)[_0x94b3('0x1c')](_0xa80c26);}};}function respondWithFilteredResult(_0x336f44,_0x3c7acf){return function(_0x3290be){if(_0x3290be){var _0x4b0a42=typeof _0x3c7acf[_0x94b3('0x1d')]===_0x94b3('0x1e')&&typeof _0x3c7acf[_0x94b3('0x1f')]===_0x94b3('0x1e');var _0x1595c4=_0x3290be[_0x94b3('0x20')];var _0x15cce2=_0x4b0a42?0x0:_0x3c7acf['offset'];var _0x55c7e4=_0x4b0a42?_0x3290be[_0x94b3('0x20')]:_0x3c7acf[_0x94b3('0x1d')]+_0x3c7acf[_0x94b3('0x1f')];var _0xc82da;if(_0x55c7e4>=_0x1595c4){_0x55c7e4=_0x1595c4;_0xc82da=0xc8;}else{_0xc82da=0xce;}_0x336f44[_0x94b3('0x1b')](_0xc82da);return _0x336f44[_0x94b3('0x21')](_0x94b3('0x22'),_0x15cce2+'-'+_0x55c7e4+'/'+_0x1595c4)[_0x94b3('0x1c')](_0x3290be);}return null;};}function patchUpdates(_0x23312a){return function(_0x5b6fa8){try{jsonpatch[_0x94b3('0x23')](_0x5b6fa8,_0x23312a,!![]);}catch(_0x30799d){return BPromise[_0x94b3('0x24')](_0x30799d);}return _0x5b6fa8[_0x94b3('0x25')]();};}function saveUpdates(_0x3f7d37,_0x205cdd){return function(_0x3d3c52){if(_0x3d3c52){return _0x3d3c52['update'](_0x3f7d37)['then'](function(_0x2831ff){return _0x2831ff;});}return null;};}function removeEntity(_0x5b6b5f,_0x46a82b){return function(_0x3d4fa0){if(_0x3d4fa0){return _0x3d4fa0[_0x94b3('0x26')]()[_0x94b3('0x27')](function(){_0x5b6b5f[_0x94b3('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x57a9f6,_0x7e331d){return function(_0x317b81){if(!_0x317b81){_0x57a9f6['sendStatus'](0x194);}return _0x317b81;};}function handleError(_0x1756a9,_0x3d56c2){_0x3d56c2=_0x3d56c2||0x1f4;return function(_0x21bb76){logger[_0x94b3('0x28')](_0x21bb76[_0x94b3('0x29')]);if(_0x21bb76[_0x94b3('0x2a')]){delete _0x21bb76['name'];}_0x1756a9[_0x94b3('0x1b')](_0x3d56c2)[_0x94b3('0x2b')](_0x21bb76);};}exports[_0x94b3('0x2c')]=function(_0x356ba6,_0x10c258){var _0x10b43b={},_0x1f5c92={},_0x2f124d={'count':0x0,'rows':[]};var _0x1fddde=_[_0x94b3('0x2d')](db['CmHopperHistory'][_0x94b3('0x2e')],function(_0x59f74d){return{'name':_0x59f74d[_0x94b3('0x2f')],'type':_0x59f74d[_0x94b3('0x30')][_0x94b3('0x31')]};});_0x1f5c92[_0x94b3('0x32')]=_[_0x94b3('0x2d')](_0x1fddde,'name');_0x1f5c92[_0x94b3('0x33')]=_[_0x94b3('0x34')](_0x356ba6['query']);_0x1f5c92[_0x94b3('0x35')]=_[_0x94b3('0x36')](_0x1f5c92[_0x94b3('0x32')],_0x1f5c92[_0x94b3('0x33')]);_0x10b43b['attributes']=_[_0x94b3('0x36')](_0x1f5c92[_0x94b3('0x32')],qs['fields'](_0x356ba6['query']['fields']));_0x10b43b[_0x94b3('0x37')]=_0x10b43b[_0x94b3('0x37')][_0x94b3('0x38')]?_0x10b43b[_0x94b3('0x37')]:_0x1f5c92['model'];if(!_0x356ba6[_0x94b3('0x33')][_0x94b3('0x39')](_0x94b3('0x3a'))){_0x10b43b[_0x94b3('0x1f')]=qs[_0x94b3('0x1f')](_0x356ba6[_0x94b3('0x33')]['limit']);_0x10b43b[_0x94b3('0x1d')]=qs[_0x94b3('0x1d')](_0x356ba6[_0x94b3('0x33')][_0x94b3('0x1d')]);}_0x10b43b['order']=qs[_0x94b3('0x3b')](_0x356ba6[_0x94b3('0x33')][_0x94b3('0x3b')]);_0x10b43b[_0x94b3('0x3c')]=qs[_0x94b3('0x35')](_[_0x94b3('0x3d')](_0x356ba6[_0x94b3('0x33')],_0x1f5c92['filters']),_0x1fddde);if(_0x356ba6[_0x94b3('0x33')][_0x94b3('0x3e')]){_0x10b43b[_0x94b3('0x3c')]=_[_0x94b3('0x3f')](_0x10b43b['where'],{'$or':_['map'](_0x1fddde,function(_0x222dde){if(_0x222dde[_0x94b3('0x30')]!==_0x94b3('0x40')){var _0x1c8d27={};_0x1c8d27[_0x222dde[_0x94b3('0x2a')]]={'$like':'%'+_0x356ba6[_0x94b3('0x33')][_0x94b3('0x3e')]+'%'};return _0x1c8d27;}})});}_0x10b43b=_[_0x94b3('0x3f')]({},_0x10b43b,_0x356ba6[_0x94b3('0x41')]);var _0x1443b0={'where':_0x10b43b['where']};return db[_0x94b3('0x42')][_0x94b3('0x20')](_0x1443b0)['then'](function(_0x4ee9c1){_0x2f124d[_0x94b3('0x20')]=_0x4ee9c1;if(_0x356ba6['query'][_0x94b3('0x43')]){_0x10b43b[_0x94b3('0x44')]=[{'all':!![]}];}return db[_0x94b3('0x42')]['findAll'](_0x10b43b);})[_0x94b3('0x27')](function(_0x1ae44d){_0x2f124d[_0x94b3('0x45')]=_0x1ae44d;return _0x2f124d;})[_0x94b3('0x27')](respondWithFilteredResult(_0x10c258,_0x10b43b))[_0x94b3('0x46')](handleError(_0x10c258,null));};exports['show']=function(_0x2b2c9a,_0x135798){var _0x21e0e0={'raw':!![],'where':{'id':_0x2b2c9a[_0x94b3('0x47')]['id']}},_0x367d6a={};_0x367d6a[_0x94b3('0x32')]=_['keys'](db[_0x94b3('0x42')][_0x94b3('0x2e')]);_0x367d6a['query']=_[_0x94b3('0x34')](_0x2b2c9a['query']);_0x367d6a[_0x94b3('0x35')]=_[_0x94b3('0x36')](_0x367d6a[_0x94b3('0x32')],_0x367d6a['query']);_0x21e0e0[_0x94b3('0x37')]=_[_0x94b3('0x36')](_0x367d6a[_0x94b3('0x32')],qs[_0x94b3('0x48')](_0x2b2c9a[_0x94b3('0x33')][_0x94b3('0x48')]));_0x21e0e0[_0x94b3('0x37')]=_0x21e0e0[_0x94b3('0x37')]['length']?_0x21e0e0[_0x94b3('0x37')]:_0x367d6a[_0x94b3('0x32')];if(_0x2b2c9a[_0x94b3('0x33')][_0x94b3('0x43')]){_0x21e0e0[_0x94b3('0x44')]=[{'all':!![]}];}_0x21e0e0=_[_0x94b3('0x3f')]({},_0x21e0e0,_0x2b2c9a[_0x94b3('0x41')]);return db[_0x94b3('0x42')][_0x94b3('0x49')](_0x21e0e0)['then'](handleEntityNotFound(_0x135798,null))[_0x94b3('0x27')](respondWithResult(_0x135798,null))[_0x94b3('0x46')](handleError(_0x135798,null));};exports['create']=function(_0x378c52,_0x24d032){return db[_0x94b3('0x42')]['create'](_0x378c52[_0x94b3('0x4a')],{})[_0x94b3('0x27')](respondWithResult(_0x24d032,0xc9))[_0x94b3('0x46')](handleError(_0x24d032,null));};exports[_0x94b3('0x4b')]=function(_0x40af9b,_0x159ccb){return db[_0x94b3('0x42')][_0x94b3('0x4b')]()[_0x94b3('0x27')](respondWithResult(_0x159ccb,null))[_0x94b3('0x46')](handleError(_0x159ccb,null));};exports[_0x94b3('0x4c')]=function(_0x474b7f,_0x14534b){if(_0x474b7f[_0x94b3('0x4a')]['uniqueid']){delete _0x474b7f['body'][_0x94b3('0x4d')];}return db[_0x94b3('0x42')][_0x94b3('0x49')]({'where':{'uniqueid':_0x474b7f[_0x94b3('0x47')]['id']}})[_0x94b3('0x27')](handleEntityNotFound(_0x14534b,null))[_0x94b3('0x27')](saveUpdates(_0x474b7f[_0x94b3('0x4a')],null))['then'](respondWithResult(_0x14534b,null))[_0x94b3('0x46')](handleError(_0x14534b,null));}; \ No newline at end of file +var _0xb3c1=['map','CmHopperHistory','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','include','findAll','catch','show','params','includeAll','find','create','describe','update','body','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','then','stack','name','send','index'];(function(_0x5b2ce5,_0x30062c){var _0x904763=function(_0x536e82){while(--_0x536e82){_0x5b2ce5['push'](_0x5b2ce5['shift']());}};_0x904763(++_0x30062c);}(_0xb3c1,0x105));var _0x1b3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb3c1[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1b3c('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b3c('0x1'));var rp=require(_0x1b3c('0x2'));var moment=require(_0x1b3c('0x3'));var BPromise=require(_0x1b3c('0x4'));var Mustache=require('mustache');var util=require(_0x1b3c('0x5'));var path=require(_0x1b3c('0x6'));var sox=require('sox');var csv=require(_0x1b3c('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1b3c('0x8'));var _=require(_0x1b3c('0x9'));var squel=require(_0x1b3c('0xa'));var crypto=require(_0x1b3c('0xb'));var jsforce=require(_0x1b3c('0xc'));var deskjs=require(_0x1b3c('0xd'));var toCsv=require(_0x1b3c('0x7'));var querystring=require(_0x1b3c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1b3c('0xf'));var qs=require(_0x1b3c('0x10'));var as=require(_0x1b3c('0x11'));var hardwareService=require(_0x1b3c('0x12'));var logger=require('../../config/logger')(_0x1b3c('0x13'));var utils=require(_0x1b3c('0x14'));var config=require(_0x1b3c('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x1b3c('0x16'))['db'];function respondWithStatusCode(_0x58498b,_0x1810b4){_0x1810b4=_0x1810b4||0xcc;return function(_0x285905){if(_0x285905){return _0x58498b[_0x1b3c('0x17')](_0x1810b4);}return _0x58498b[_0x1b3c('0x18')](_0x1810b4)['end']();};}function respondWithResult(_0x7cad07,_0x3299ec){_0x3299ec=_0x3299ec||0xc8;return function(_0x4616de){if(_0x4616de){return _0x7cad07[_0x1b3c('0x18')](_0x3299ec)[_0x1b3c('0x19')](_0x4616de);}};}function respondWithFilteredResult(_0xc050f3,_0x15386e){return function(_0x327d8a){if(_0x327d8a){var _0x1f4962=typeof _0x15386e[_0x1b3c('0x1a')]==='undefined'&&typeof _0x15386e['limit']===_0x1b3c('0x1b');var _0x3c2989=_0x327d8a[_0x1b3c('0x1c')];var _0xb20d69=_0x1f4962?0x0:_0x15386e[_0x1b3c('0x1a')];var _0x4c84a0=_0x1f4962?_0x327d8a[_0x1b3c('0x1c')]:_0x15386e[_0x1b3c('0x1a')]+_0x15386e[_0x1b3c('0x1d')];var _0x234b6c;if(_0x4c84a0>=_0x3c2989){_0x4c84a0=_0x3c2989;_0x234b6c=0xc8;}else{_0x234b6c=0xce;}_0xc050f3[_0x1b3c('0x18')](_0x234b6c);return _0xc050f3[_0x1b3c('0x1e')]('Content-Range',_0xb20d69+'-'+_0x4c84a0+'/'+_0x3c2989)[_0x1b3c('0x19')](_0x327d8a);}return null;};}function patchUpdates(_0x7b4f62){return function(_0x5c1e38){try{jsonpatch[_0x1b3c('0x1f')](_0x5c1e38,_0x7b4f62,!![]);}catch(_0x4e3568){return BPromise[_0x1b3c('0x20')](_0x4e3568);}return _0x5c1e38[_0x1b3c('0x21')]();};}function saveUpdates(_0x2cf52f,_0x34ab60){return function(_0x81b84a){if(_0x81b84a){return _0x81b84a['update'](_0x2cf52f)[_0x1b3c('0x22')](function(_0x138f05){return _0x138f05;});}return null;};}function removeEntity(_0xd57deb,_0x1b951a){return function(_0x49352b){if(_0x49352b){return _0x49352b['destroy']()[_0x1b3c('0x22')](function(){_0xd57deb[_0x1b3c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e672e,_0x10c7ae){return function(_0xbde543){if(!_0xbde543){_0x2e672e['sendStatus'](0x194);}return _0xbde543;};}function handleError(_0x3a53ba,_0x548141){_0x548141=_0x548141||0x1f4;return function(_0x359daa){logger['error'](_0x359daa[_0x1b3c('0x23')]);if(_0x359daa[_0x1b3c('0x24')]){delete _0x359daa[_0x1b3c('0x24')];}_0x3a53ba[_0x1b3c('0x18')](_0x548141)[_0x1b3c('0x25')](_0x359daa);};}exports[_0x1b3c('0x26')]=function(_0x35a06d,_0x154a6d){var _0xea3bf5={},_0x50729a={},_0x34a88e={'count':0x0,'rows':[]};var _0x2ad9af=_[_0x1b3c('0x27')](db[_0x1b3c('0x28')][_0x1b3c('0x29')],function(_0x1ffa83){return{'name':_0x1ffa83[_0x1b3c('0x2a')],'type':_0x1ffa83['type'][_0x1b3c('0x2b')]};});_0x50729a[_0x1b3c('0x2c')]=_[_0x1b3c('0x27')](_0x2ad9af,'name');_0x50729a[_0x1b3c('0x2d')]=_[_0x1b3c('0x2e')](_0x35a06d[_0x1b3c('0x2d')]);_0x50729a[_0x1b3c('0x2f')]=_[_0x1b3c('0x30')](_0x50729a['model'],_0x50729a['query']);_0xea3bf5[_0x1b3c('0x31')]=_[_0x1b3c('0x30')](_0x50729a[_0x1b3c('0x2c')],qs[_0x1b3c('0x32')](_0x35a06d[_0x1b3c('0x2d')][_0x1b3c('0x32')]));_0xea3bf5[_0x1b3c('0x31')]=_0xea3bf5[_0x1b3c('0x31')][_0x1b3c('0x33')]?_0xea3bf5[_0x1b3c('0x31')]:_0x50729a[_0x1b3c('0x2c')];if(!_0x35a06d[_0x1b3c('0x2d')][_0x1b3c('0x34')](_0x1b3c('0x35'))){_0xea3bf5[_0x1b3c('0x1d')]=qs[_0x1b3c('0x1d')](_0x35a06d[_0x1b3c('0x2d')]['limit']);_0xea3bf5[_0x1b3c('0x1a')]=qs[_0x1b3c('0x1a')](_0x35a06d['query'][_0x1b3c('0x1a')]);}_0xea3bf5[_0x1b3c('0x36')]=qs[_0x1b3c('0x37')](_0x35a06d[_0x1b3c('0x2d')][_0x1b3c('0x37')]);_0xea3bf5['where']=qs['filters'](_[_0x1b3c('0x38')](_0x35a06d[_0x1b3c('0x2d')],_0x50729a[_0x1b3c('0x2f')]),_0x2ad9af);if(_0x35a06d['query'][_0x1b3c('0x39')]){_0xea3bf5[_0x1b3c('0x3a')]=_[_0x1b3c('0x3b')](_0xea3bf5[_0x1b3c('0x3a')],{'$or':_[_0x1b3c('0x27')](_0x2ad9af,function(_0x37b554){if(_0x37b554[_0x1b3c('0x3c')]!==_0x1b3c('0x3d')){var _0x579a25={};_0x579a25[_0x37b554['name']]={'$like':'%'+_0x35a06d[_0x1b3c('0x2d')]['filter']+'%'};return _0x579a25;}})});}_0xea3bf5=_[_0x1b3c('0x3b')]({},_0xea3bf5,_0x35a06d[_0x1b3c('0x3e')]);var _0x2d9dc7={'where':_0xea3bf5[_0x1b3c('0x3a')]};return db['CmHopperHistory'][_0x1b3c('0x1c')](_0x2d9dc7)[_0x1b3c('0x22')](function(_0x41f92a){_0x34a88e[_0x1b3c('0x1c')]=_0x41f92a;if(_0x35a06d[_0x1b3c('0x2d')]['includeAll']){_0xea3bf5[_0x1b3c('0x3f')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x1b3c('0x40')](_0xea3bf5);})[_0x1b3c('0x22')](function(_0x264b55){_0x34a88e['rows']=_0x264b55;return _0x34a88e;})[_0x1b3c('0x22')](respondWithFilteredResult(_0x154a6d,_0xea3bf5))[_0x1b3c('0x41')](handleError(_0x154a6d,null));};exports[_0x1b3c('0x42')]=function(_0x55b074,_0x1d6e13){var _0x509a80={'raw':!![],'where':{'id':_0x55b074[_0x1b3c('0x43')]['id']}},_0x31cec2={};_0x31cec2[_0x1b3c('0x2c')]=_[_0x1b3c('0x2e')](db[_0x1b3c('0x28')]['rawAttributes']);_0x31cec2[_0x1b3c('0x2d')]=_['keys'](_0x55b074[_0x1b3c('0x2d')]);_0x31cec2[_0x1b3c('0x2f')]=_[_0x1b3c('0x30')](_0x31cec2[_0x1b3c('0x2c')],_0x31cec2['query']);_0x509a80[_0x1b3c('0x31')]=_[_0x1b3c('0x30')](_0x31cec2[_0x1b3c('0x2c')],qs[_0x1b3c('0x32')](_0x55b074[_0x1b3c('0x2d')][_0x1b3c('0x32')]));_0x509a80[_0x1b3c('0x31')]=_0x509a80[_0x1b3c('0x31')][_0x1b3c('0x33')]?_0x509a80[_0x1b3c('0x31')]:_0x31cec2[_0x1b3c('0x2c')];if(_0x55b074[_0x1b3c('0x2d')][_0x1b3c('0x44')]){_0x509a80[_0x1b3c('0x3f')]=[{'all':!![]}];}_0x509a80=_[_0x1b3c('0x3b')]({},_0x509a80,_0x55b074[_0x1b3c('0x3e')]);return db[_0x1b3c('0x28')][_0x1b3c('0x45')](_0x509a80)['then'](handleEntityNotFound(_0x1d6e13,null))[_0x1b3c('0x22')](respondWithResult(_0x1d6e13,null))['catch'](handleError(_0x1d6e13,null));};exports[_0x1b3c('0x46')]=function(_0x12df21,_0x54d339){return db[_0x1b3c('0x28')][_0x1b3c('0x46')](_0x12df21['body'],{})[_0x1b3c('0x22')](respondWithResult(_0x54d339,0xc9))['catch'](handleError(_0x54d339,null));};exports[_0x1b3c('0x47')]=function(_0x1ed708,_0x4fd1e0){return db[_0x1b3c('0x28')][_0x1b3c('0x47')]()[_0x1b3c('0x22')](respondWithResult(_0x4fd1e0,null))[_0x1b3c('0x41')](handleError(_0x4fd1e0,null));};exports[_0x1b3c('0x48')]=function(_0x5448d2,_0x54c802){if(_0x5448d2[_0x1b3c('0x49')][_0x1b3c('0x4a')]){delete _0x5448d2[_0x1b3c('0x49')]['uniqueid'];}return db[_0x1b3c('0x28')][_0x1b3c('0x45')]({'where':{'uniqueid':_0x5448d2['params']['id']}})[_0x1b3c('0x22')](handleEntityNotFound(_0x54c802,null))[_0x1b3c('0x22')](saveUpdates(_0x5448d2[_0x1b3c('0x49')],null))[_0x1b3c('0x22')](respondWithResult(_0x54c802,null))[_0x1b3c('0x41')](handleError(_0x54c802,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index dbf8a91..65e0806 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 _0xa7ee=['moment','bluebird','rimraf','./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','api'];(function(_0x58bba5,_0x282ff6){var _0x38fde2=function(_0x303d69){while(--_0x303d69){_0x58bba5['push'](_0x58bba5['shift']());}};_0x38fde2(++_0x282ff6);}(_0xa7ee,0x159));var _0xea7e=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0xa7ee[_0x160248];return _0x4e589d;};'use strict';var _=require(_0xea7e('0x0'));var util=require('util');var logger=require(_0xea7e('0x1'))(_0xea7e('0x2'));var moment=require(_0xea7e('0x3'));var BPromise=require(_0xea7e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xea7e('0x5'));var config=require('../../config/environment');var attributes=require(_0xea7e('0x6'));module[_0xea7e('0x7')]=function(_0x3e99ef,_0x42f578){return _0x3e99ef['define'](_0xea7e('0x8'),attributes,{'tableName':_0xea7e('0x9'),'paranoid':![],'indexes':[{'name':_0xea7e('0xa'),'fields':[_0xea7e('0xa')]},{'name':_0xea7e('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc43c=['cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','request-promise','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x6b07a7,_0x2546ee){var _0x1649b4=function(_0xb93d84){while(--_0xb93d84){_0x6b07a7['push'](_0x6b07a7['shift']());}};_0x1649b4(++_0x2546ee);}(_0xc43c,0xd4));var _0xcc43=function(_0x3b157f,_0xbdfcd5){_0x3b157f=_0x3b157f-0x0;var _0x337d9d=_0xc43c[_0x3b157f];return _0x337d9d;};'use strict';var _=require(_0xcc43('0x0'));var util=require(_0xcc43('0x1'));var logger=require(_0xcc43('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xcc43('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xcc43('0x4'));module[_0xcc43('0x5')]=function(_0x13d329,_0x5e818f){return _0x13d329[_0xcc43('0x6')](_0xcc43('0x7'),attributes,{'tableName':_0xcc43('0x8'),'paranoid':![],'indexes':[{'name':_0xcc43('0x9'),'fields':[_0xcc43('0x9')]},{'name':_0xcc43('0xa'),'fields':[_0xcc43('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9eacc0b..ce9fa0d 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 _0xef92=['`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','catch','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CmHopperHistory,\x20%s,\x20%s','result','CreateCmHopperHistory','CmHopperHistory','body','options','raw','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null'];(function(_0x459157,_0x453fdc){var _0x8b319e=function(_0x3a2570){while(--_0x3a2570){_0x459157['push'](_0x459157['shift']());}};_0x8b319e(++_0x453fdc);}(_0xef92,0xf2));var _0x2ef9=function(_0xc3378c,_0x341b3f){_0xc3378c=_0xc3378c-0x0;var _0x468d81=_0xef92[_0xc3378c];return _0x468d81;};'use strict';var _=require(_0x2ef9('0x0'));var util=require(_0x2ef9('0x1'));var moment=require(_0x2ef9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ef9('0x3'));var db=require(_0x2ef9('0x4'))['db'];var utils=require(_0x2ef9('0x5'));var logger=require(_0x2ef9('0x6'))(_0x2ef9('0x7'));var config=require('../../config/environment');var jayson=require(_0x2ef9('0x8'));var client=jayson[_0x2ef9('0x9')][_0x2ef9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe6c78a,_0x2cc58c,_0x57cf18){return new BPromise(function(_0x26aa6a,_0x4e8684){return client['request'](_0xe6c78a,_0x57cf18)[_0x2ef9('0xb')](function(_0x274857){logger[_0x2ef9('0xc')]('CmHopperHistory,\x20%s,\x20%s',_0x2cc58c,_0x2ef9('0xd'));logger[_0x2ef9('0xe')](_0x2ef9('0xf'),_0x2cc58c,'request\x20sent',JSON[_0x2ef9('0x10')](_0x274857));if(_0x274857[_0x2ef9('0x11')]){if(_0x274857[_0x2ef9('0x11')][_0x2ef9('0x12')]===0x1f4){logger[_0x2ef9('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x2cc58c,_0x274857['error'][_0x2ef9('0x13')]);return _0x4e8684(_0x274857[_0x2ef9('0x11')][_0x2ef9('0x13')]);}logger[_0x2ef9('0x11')](_0x2ef9('0x14'),_0x2cc58c,_0x274857[_0x2ef9('0x11')][_0x2ef9('0x13')]);return _0x26aa6a(_0x274857[_0x2ef9('0x11')][_0x2ef9('0x13')]);}else{logger[_0x2ef9('0xc')](_0x2ef9('0x14'),_0x2cc58c,_0x2ef9('0xd'));_0x26aa6a(_0x274857[_0x2ef9('0x15')][_0x2ef9('0x13')]);}})['catch'](function(_0x11880b){logger['error'](_0x2ef9('0x14'),_0x2cc58c,_0x11880b);_0x4e8684(_0x11880b);});});}exports[_0x2ef9('0x16')]=function(_0x1576f5){var _0x739735=this;return new Promise(function(_0x150043,_0x96b59d){return db[_0x2ef9('0x17')]['create'](_0x1576f5[_0x2ef9('0x18')],{'raw':_0x1576f5[_0x2ef9('0x19')]?_0x1576f5[_0x2ef9('0x19')][_0x2ef9('0x1a')]===undefined?!![]:![]:!![]})[_0x2ef9('0xb')](function(_0x402d48){logger[_0x2ef9('0xc')]('CreateCmHopperHistory',_0x1576f5);logger[_0x2ef9('0xe')](_0x2ef9('0x16'),_0x1576f5,JSON['stringify'](_0x402d48));_0x150043(_0x402d48);})['catch'](function(_0x570825){logger[_0x2ef9('0x11')](_0x2ef9('0x16'),_0x570825[_0x2ef9('0x13')],_0x1576f5);_0x96b59d(_0x739735[_0x2ef9('0x11')](0x1f4,_0x570825[_0x2ef9('0x13')]));});});};exports[_0x2ef9('0x1b')]=function(_0x4a93bb){var _0x1878af=this;return new Promise(function(_0x1db97c,_0xcecbea){return db[_0x2ef9('0x17')][_0x2ef9('0x1c')]({'raw':_0x4a93bb['options']?_0x4a93bb['options'][_0x2ef9('0x1a')]===undefined?!![]:![]:!![],'where':_0x4a93bb[_0x2ef9('0x19')]?_0x4a93bb[_0x2ef9('0x19')][_0x2ef9('0x1d')]||null:null,'attributes':[[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db['sequelize']['col']('id')),_0x2ef9('0x20')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x22')))),_0x2ef9('0x23')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x24')))),_0x2ef9('0x25')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db['sequelize']['fn']('IF',db['sequelize'][_0x2ef9('0x21')](_0x2ef9('0x26')))),_0x2ef9('0x27')],[db['sequelize']['fn'](_0x2ef9('0x28'),db[_0x2ef9('0x1e')]['fn']('IF',db['sequelize'][_0x2ef9('0x21')](_0x2ef9('0x29')))),'predictiveIntervalAvgHoldtime'],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x28'),db['sequelize']['fn']('IF',db[_0x2ef9('0x1e')]['literal'](_0x2ef9('0x2a')))),_0x2ef9('0x2b')]]})[_0x2ef9('0xb')](function(_0x1bdb63){logger[_0x2ef9('0xc')](_0x2ef9('0x1b'),_0x4a93bb);logger[_0x2ef9('0xe')](_0x2ef9('0x1b'),_0x4a93bb,JSON['stringify'](_0x1bdb63));_0x1db97c(_0x1bdb63);})[_0x2ef9('0x2c')](function(_0x5b0ab8){logger[_0x2ef9('0x11')]('AvgHandleTime',_0x5b0ab8[_0x2ef9('0x13')],_0x4a93bb);_0xcecbea(_0x1878af[_0x2ef9('0x11')](0x1f4,_0x5b0ab8[_0x2ef9('0x13')]));});});};exports[_0x2ef9('0x2d')]=function(_0x26da94){var _0x12122d=this;return new Promise(function(_0x380327,_0x28fdac){return db[_0x2ef9('0x17')]['findAll']({'raw':_0x26da94[_0x2ef9('0x19')]?_0x26da94[_0x2ef9('0x19')][_0x2ef9('0x1a')]===undefined?!![]:![]:!![],'where':_0x26da94[_0x2ef9('0x19')]?_0x26da94[_0x2ef9('0x19')]['where']||null:null,'attributes':[[_0x2ef9('0x2e'),_0x2ef9('0x2f')],[db['sequelize']['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x30')))),'outboundNoSuchCallsDay'],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0x2ef9('0x31')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db['sequelize']['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x22')))),_0x2ef9('0x32')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db['sequelize']['fn']('IF',db[_0x2ef9('0x1e')]['literal'](_0x2ef9('0x33')))),_0x2ef9('0x34')],[db[_0x2ef9('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x2ef9('0x21')]('`state`\x20=\x208,\x201,\x20null'))),'outboundCongestionCallsDay'],[db[_0x2ef9('0x1e')]['fn']('COUNT',db[_0x2ef9('0x1e')]['fn']('IF',db['sequelize'][_0x2ef9('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x2ef9('0x35')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db['sequelize']['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x36')))),_0x2ef9('0x37')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0x2ef9('0x38')],[db['sequelize']['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')]['literal'](_0x2ef9('0x39')))),_0x2ef9('0x3a')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')]['literal'](_0x2ef9('0x3b')))),_0x2ef9('0x3c')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x3d')))),_0x2ef9('0x3e')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x3f')))),_0x2ef9('0x40')],[db['sequelize']['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db['sequelize'][_0x2ef9('0x21')]('`state`\x20=\x2020,\x201,\x20null'))),_0x2ef9('0x3e')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x41')))),_0x2ef9('0x42')]],'group':[_0x2ef9('0x2e')]})['then'](function(_0x357885){logger[_0x2ef9('0xc')](_0x2ef9('0x2d'),_0x26da94);logger['debug'](_0x2ef9('0x2d'),_0x26da94,JSON[_0x2ef9('0x10')](_0x357885));_0x380327(_0x357885);})['catch'](function(_0x323ef7){logger[_0x2ef9('0x11')](_0x2ef9('0x2d'),_0x323ef7[_0x2ef9('0x13')],_0x26da94);_0x28fdac(_0x12122d[_0x2ef9('0x11')](0x1f4,_0x323ef7[_0x2ef9('0x13')]));});});};exports[_0x2ef9('0x43')]=function(_0x5ddd3d){var _0x4136bf=this;return new Promise(function(_0xba539f,_0x4608f2){return db['CmHopperHistory'][_0x2ef9('0x1c')]({'raw':_0x5ddd3d[_0x2ef9('0x19')]?_0x5ddd3d['options']['raw']===undefined?!![]:![]:!![],'where':_0x5ddd3d[_0x2ef9('0x19')]?_0x5ddd3d['options'][_0x2ef9('0x1d')]||null:null,'attributes':[[_0x2ef9('0x2e'),_0x2ef9('0x2f')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')][_0x2ef9('0x44')]('id')),_0x2ef9('0x45')],[db[_0x2ef9('0x1e')]['fn'](_0x2ef9('0x1f'),db[_0x2ef9('0x1e')]['fn']('IF',db[_0x2ef9('0x1e')][_0x2ef9('0x21')](_0x2ef9('0x22')))),_0x2ef9('0x46')]],'group':[_0x2ef9('0x2e')]})['then'](function(_0x242133){logger[_0x2ef9('0xc')](_0x2ef9('0x43'),_0x5ddd3d);logger[_0x2ef9('0xe')]('GetCampaignHopperHistory',_0x5ddd3d,JSON[_0x2ef9('0x10')](_0x242133));_0xba539f(_0x242133);})['catch'](function(_0x102042){logger[_0x2ef9('0x11')](_0x2ef9('0x43'),_0x102042['message'],_0x5ddd3d);_0x4608f2(_0x4136bf[_0x2ef9('0x11')](0x1f4,_0x102042['message']));});});}; \ No newline at end of file +var _0x2bc6=['outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','GetVoiceQueueHopperHistory','GetCampaignHopperHistory','col','ivrTotalCallsDays','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','CreateCmHopperHistory','CmHopperHistory','options','raw','catch','AvgHandleTime','sequelize','COUNT','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','findAll','where','name','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null'];(function(_0x687ddc,_0x2092fa){var _0x441991=function(_0x49c6a6){while(--_0x49c6a6){_0x687ddc['push'](_0x687ddc['shift']());}};_0x441991(++_0x2092fa);}(_0x2bc6,0x163));var _0x62bc=function(_0x365c07,_0x3ef179){_0x365c07=_0x365c07-0x0;var _0x348481=_0x2bc6[_0x365c07];return _0x348481;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('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(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['create'](_0xc95407['body'],{'raw':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x380621){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x380621));_0x1d3d8f(_0x380621);})[_0x62bc('0x18')](function(_0x28757d){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x28757d[_0x62bc('0x12')],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x28757d['message']));});});};exports[_0x62bc('0x19')]=function(_0xb0d0fb){var _0x1fb8f6=this;return new Promise(function(_0x3957c9,_0x117ebc){return db['CmHopperHistory']['findAll']({'raw':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0xb0d0fb[_0x62bc('0x16')]?_0xb0d0fb[_0x62bc('0x16')]['where']||null:null,'attributes':[[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['col']('id')),'predictiveIntervalTotalCalls'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1d')))),_0x62bc('0x1e')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x1f')))),_0x62bc('0x20')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x21')))),_0x62bc('0x22')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x23'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x24')))),_0x62bc('0x25')],[db['sequelize']['fn'](_0x62bc('0x23'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x3f22c1){logger[_0x62bc('0xa')](_0x62bc('0x19'),_0xb0d0fb);logger['debug']('AvgHandleTime',_0xb0d0fb,JSON['stringify'](_0x3f22c1));_0x3957c9(_0x3f22c1);})[_0x62bc('0x18')](function(_0x2245a7){logger['error']('AvgHandleTime',_0x2245a7[_0x62bc('0x12')],_0xb0d0fb);_0x117ebc(_0x1fb8f6[_0x62bc('0xf')](0x1f4,_0x2245a7[_0x62bc('0x12')]));});});};exports['GetVoiceQueueHopperHistory']=function(_0x47391){var _0x41e2a8=this;return new Promise(function(_0x3ff9e3,_0x9482f7){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x47391[_0x62bc('0x16')]?_0x47391['options'][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x47391[_0x62bc('0x16')]?_0x47391[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[['campaign',_0x62bc('0x28')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')]('`state`\x20=\x200,\x201,\x20null'))),_0x62bc('0x29')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2a')))),_0x62bc('0x2b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize']['literal'](_0x62bc('0x1d')))),_0x62bc('0x2c')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x2d')))),'outboundBusyCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x2e')))),_0x62bc('0x2f')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x30')))),_0x62bc('0x31')],[db['sequelize']['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x32')))),'outboundDropCallsDayCallersExit'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')](_0x62bc('0x33')))),'outboundUnknownCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x34')))),_0x62bc('0x35')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db['sequelize'][_0x62bc('0x1c')]('`state`\x20=\x2014,\x201,\x20null'))),_0x62bc('0x36')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x37')))),'outboundRejectCallsDay'],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db['sequelize']['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x38')))),_0x62bc('0x39')],[db['sequelize']['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')]['literal'](_0x62bc('0x3a')))),_0x62bc('0x3b')],[db[_0x62bc('0x1a')]['fn'](_0x62bc('0x1b'),db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x3c')))),_0x62bc('0x3d')]],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x601e5d){logger[_0x62bc('0xa')](_0x62bc('0x3f'),_0x47391);logger[_0x62bc('0xc')](_0x62bc('0x3f'),_0x47391,JSON['stringify'](_0x601e5d));_0x3ff9e3(_0x601e5d);})[_0x62bc('0x18')](function(_0x440fd9){logger[_0x62bc('0xf')](_0x62bc('0x3f'),_0x440fd9[_0x62bc('0x12')],_0x47391);_0x9482f7(_0x41e2a8[_0x62bc('0xf')](0x1f4,_0x440fd9[_0x62bc('0x12')]));});});};exports[_0x62bc('0x40')]=function(_0x27020b){var _0x4142dd=this;return new Promise(function(_0x2f2322,_0x2c9ecd){return db['CmHopperHistory'][_0x62bc('0x26')]({'raw':_0x27020b['options']?_0x27020b[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x27020b[_0x62bc('0x16')]?_0x27020b[_0x62bc('0x16')][_0x62bc('0x27')]||null:null,'attributes':[[_0x62bc('0x3e'),_0x62bc('0x28')],[db[_0x62bc('0x1a')]['fn']('COUNT',db['sequelize'][_0x62bc('0x41')]('id')),_0x62bc('0x42')],[db[_0x62bc('0x1a')]['fn']('COUNT',db[_0x62bc('0x1a')]['fn']('IF',db[_0x62bc('0x1a')][_0x62bc('0x1c')](_0x62bc('0x1d')))),'ivrAnswerCallsDay']],'group':[_0x62bc('0x3e')]})[_0x62bc('0x9')](function(_0x237714){logger[_0x62bc('0xa')](_0x62bc('0x40'),_0x27020b);logger[_0x62bc('0xc')](_0x62bc('0x40'),_0x27020b,JSON['stringify'](_0x237714));_0x2f2322(_0x237714);})[_0x62bc('0x18')](function(_0x27e35c){logger[_0x62bc('0xf')]('GetCampaignHopperHistory',_0x27e35c['message'],_0x27020b);_0x2c9ecd(_0x4142dd[_0x62bc('0xf')](0x1f4,_0x27e35c[_0x62bc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 22087aa..33ece2d 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 _0x8ac0=['post','create','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','/describe','/:id','isAuthenticated','show'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x8ac0,0x9c));var _0x08ac=function(_0x340f1d,_0xc8a1fc){_0x340f1d=_0x340f1d-0x0;var _0x2434c9=_0x8ac0[_0x340f1d];return _0x2434c9;};'use strict';var multer=require(_0x08ac('0x0'));var util=require(_0x08ac('0x1'));var path=require(_0x08ac('0x2'));var timeout=require(_0x08ac('0x3'));var express=require(_0x08ac('0x4'));var router=express[_0x08ac('0x5')]();var fs_extra=require(_0x08ac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x08ac('0x7'));var config=require(_0x08ac('0x8'));var controller=require('./cmHopperHistory.controller');router[_0x08ac('0x9')]('/',auth['isAuthenticated'](),controller[_0x08ac('0xa')]);router[_0x08ac('0x9')](_0x08ac('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x08ac('0x9')](_0x08ac('0xc'),auth[_0x08ac('0xd')](),controller[_0x08ac('0xe')]);router[_0x08ac('0xf')]('/',auth[_0x08ac('0xd')](),controller[_0x08ac('0x10')]);router[_0x08ac('0x11')](_0x08ac('0xc'),auth[_0x08ac('0xd')](),controller[_0x08ac('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7eb4=['/:id','show','post','create','put','update','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe'];(function(_0x34b821,_0x504e55){var _0x5e00a0=function(_0x242892){while(--_0x242892){_0x34b821['push'](_0x34b821['shift']());}};_0x5e00a0(++_0x504e55);}(_0x7eb4,0x193));var _0x47eb=function(_0x566ae8,_0x18afa5){_0x566ae8=_0x566ae8-0x0;var _0x1ed94d=_0x7eb4[_0x566ae8];return _0x1ed94d;};'use strict';var multer=require(_0x47eb('0x0'));var util=require('util');var path=require(_0x47eb('0x1'));var timeout=require(_0x47eb('0x2'));var express=require(_0x47eb('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x47eb('0x4'));var interaction=require(_0x47eb('0x5'));var config=require(_0x47eb('0x6'));var controller=require('./cmHopperHistory.controller');router[_0x47eb('0x7')]('/',auth[_0x47eb('0x8')](),controller[_0x47eb('0x9')]);router['get'](_0x47eb('0xa'),auth[_0x47eb('0x8')](),controller['describe']);router[_0x47eb('0x7')](_0x47eb('0xb'),auth[_0x47eb('0x8')](),controller[_0x47eb('0xc')]);router[_0x47eb('0xd')]('/',auth['isAuthenticated'](),controller[_0x47eb('0xe')]);router[_0x47eb('0xf')](_0x47eb('0xb'),auth[_0x47eb('0x8')](),controller[_0x47eb('0x10')]);module[_0x47eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index 32a3f86..803d59f 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 _0xbeff=['name','exports','STRING'];(function(_0x1eeba1,_0x27623f){var _0xc48f2f=function(_0x27434a){while(--_0x27434a){_0x1eeba1['push'](_0x1eeba1['shift']());}};_0xc48f2f(++_0x27623f);}(_0xbeff,0x8e));var _0xfbef=function(_0x34d3fd,_0x318265){_0x34d3fd=_0x34d3fd-0x0;var _0x4730c8=_0xbeff[_0x34d3fd];return _0x4730c8;};'use strict';var Sequelize=require('sequelize');module[_0xfbef('0x0')]={'name':{'type':Sequelize[_0xfbef('0x1')],'unique':_0xfbef('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfbef('0x1')]},'dialPrefix':{'type':Sequelize[_0xfbef('0x1')]}}; \ No newline at end of file +var _0x0dee=['exports','name','STRING','sequelize'];(function(_0x3f8e52,_0x4488b3){var _0x1ad4d1=function(_0x2b6543){while(--_0x2b6543){_0x3f8e52['push'](_0x3f8e52['shift']());}};_0x1ad4d1(++_0x4488b3);}(_0x0dee,0xf7));var _0xe0de=function(_0x33a5d,_0x11392b){_0x33a5d=_0x33a5d-0x0;var _0xb6092=_0x0dee[_0x33a5d];return _0xb6092;};'use strict';var Sequelize=require(_0xe0de('0x0'));module[_0xe0de('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xe0de('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xe0de('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index 78aa19d..51e4098 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 _0xf0e5=['writeFileSync','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','setHeader','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','omit','spread','ids','emit','userCmList:save','userCmList:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','undefined','count','offset','limit','Content-Range','save','update','destroy','then','Lists','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','autoAssociation','params','describe','addDisposition','ListId','Disposition','getDispositions','findOne','hasOwnProperty','removeDispositions','addContacts','CmContact','tags','isArray','join','push','each','dataValues','errors','message','Malformed\x20request\x20syntax','CmCustomField','CustomFields','format','cf_%d','raw','getContacts','getContactsCsv','concat','isEmpty','now'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0xf0e5,0x1e3));var _0x5f0e=function(_0x49ca18,_0x5e6d05){_0x49ca18=_0x49ca18-0x0;var _0x145d54=_0xf0e5[_0x49ca18];return _0x145d54;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5f0e('0x0'));var jsonpatch=require(_0x5f0e('0x1'));var rp=require(_0x5f0e('0x2'));var moment=require(_0x5f0e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5f0e('0x4'));var util=require(_0x5f0e('0x5'));var path=require(_0x5f0e('0x6'));var sox=require(_0x5f0e('0x7'));var csv=require(_0x5f0e('0x8'));var ejs=require(_0x5f0e('0x9'));var fs=require('fs');var fs_extra=require(_0x5f0e('0xa'));var _=require(_0x5f0e('0xb'));var squel=require(_0x5f0e('0xc'));var crypto=require(_0x5f0e('0xd'));var jsforce=require(_0x5f0e('0xe'));var deskjs=require(_0x5f0e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x5f0e('0x10'));var Papa=require('papaparse');var Redis=require(_0x5f0e('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5f0e('0x12'));var hardwareService=require(_0x5f0e('0x13'));var logger=require(_0x5f0e('0x14'))(_0x5f0e('0x15'));var utils=require(_0x5f0e('0x16'));var config=require(_0x5f0e('0x17'));var licenseUtil=require(_0x5f0e('0x18'));var db=require('../../mysqldb')['db'];config[_0x5f0e('0x19')]=_[_0x5f0e('0x1a')](config[_0x5f0e('0x19')],{'host':_0x5f0e('0x1b'),'port':0x18eb});var socket=require(_0x5f0e('0x1c'))(new Redis(config['redis']));require(_0x5f0e('0x1d'))[_0x5f0e('0x1e')](socket);function respondWithStatusCode(_0x5f1241,_0x33cf8d){_0x33cf8d=_0x33cf8d||0xcc;return function(_0x24eff4){if(_0x24eff4){return _0x5f1241[_0x5f0e('0x1f')](_0x33cf8d);}return _0x5f1241[_0x5f0e('0x20')](_0x33cf8d)['end']();};}function respondWithResult(_0x558248,_0x4aed56){_0x4aed56=_0x4aed56||0xc8;return function(_0x32c150){if(_0x32c150){return _0x558248['status'](_0x4aed56)[_0x5f0e('0x21')](_0x32c150);}};}function respondWithFilteredResult(_0xc3aaf1,_0x3240e4){return function(_0x4e3f53){if(_0x4e3f53){var _0x19dce0=typeof _0x3240e4['offset']===_0x5f0e('0x22')&&typeof _0x3240e4['limit']==='undefined';var _0x2b6501=_0x4e3f53[_0x5f0e('0x23')];var _0xcfc6f7=_0x19dce0?0x0:_0x3240e4[_0x5f0e('0x24')];var _0x2f4c19=_0x19dce0?_0x4e3f53[_0x5f0e('0x23')]:_0x3240e4[_0x5f0e('0x24')]+_0x3240e4[_0x5f0e('0x25')];var _0x5db488;if(_0x2f4c19>=_0x2b6501){_0x2f4c19=_0x2b6501;_0x5db488=0xc8;}else{_0x5db488=0xce;}_0xc3aaf1[_0x5f0e('0x20')](_0x5db488);return _0xc3aaf1['set'](_0x5f0e('0x26'),_0xcfc6f7+'-'+_0x2f4c19+'/'+_0x2b6501)['json'](_0x4e3f53);}return null;};}function patchUpdates(_0x14ff22){return function(_0x3726f5){try{jsonpatch['apply'](_0x3726f5,_0x14ff22,!![]);}catch(_0x1a38e2){return BPromise['reject'](_0x1a38e2);}return _0x3726f5[_0x5f0e('0x27')]();};}function saveUpdates(_0x5653cf,_0xd15d13){return function(_0xcf9f13){if(_0xcf9f13){return _0xcf9f13[_0x5f0e('0x28')](_0x5653cf)['then'](function(_0x43f2b4){return _0x43f2b4;});}return null;};}function removeEntity(_0x501455,_0x2adebb){return function(_0x489739){if(_0x489739){return _0x489739[_0x5f0e('0x29')]()[_0x5f0e('0x2a')](function(){var _0x4c79cc=_0x489739['get']({'plain':!![]});var _0x102493=_0x5f0e('0x2b');return db[_0x5f0e('0x2c')][_0x5f0e('0x29')]({'where':{'type':_0x102493,'resourceId':_0x4c79cc['id']}})[_0x5f0e('0x2a')](function(){return _0x489739;});})[_0x5f0e('0x2a')](function(){_0x501455['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c5835,_0x3888b8){return function(_0x739aa7){if(!_0x739aa7){_0x1c5835[_0x5f0e('0x1f')](0x194);}return _0x739aa7;};}function handleError(_0x393e78,_0x57961a){_0x57961a=_0x57961a||0x1f4;return function(_0x4c299b){logger[_0x5f0e('0x2d')](_0x4c299b[_0x5f0e('0x2e')]);if(_0x4c299b['name']){delete _0x4c299b[_0x5f0e('0x2f')];}_0x393e78[_0x5f0e('0x20')](_0x57961a)[_0x5f0e('0x30')](_0x4c299b);};}exports[_0x5f0e('0x31')]=function(_0x4139b7,_0x57d078){var _0x340adc={},_0x8ccd6={},_0x5b9cfe={'count':0x0,'rows':[]};var _0x2e4828=_[_0x5f0e('0x32')](db[_0x5f0e('0x33')][_0x5f0e('0x34')],function(_0x5ccd95){return{'name':_0x5ccd95['fieldName'],'type':_0x5ccd95[_0x5f0e('0x35')][_0x5f0e('0x36')]};});_0x8ccd6[_0x5f0e('0x37')]=_[_0x5f0e('0x32')](_0x2e4828,_0x5f0e('0x2f'));_0x8ccd6[_0x5f0e('0x38')]=_[_0x5f0e('0x39')](_0x4139b7[_0x5f0e('0x38')]);_0x8ccd6[_0x5f0e('0x3a')]=_[_0x5f0e('0x3b')](_0x8ccd6['model'],_0x8ccd6['query']);_0x340adc[_0x5f0e('0x3c')]=_[_0x5f0e('0x3b')](_0x8ccd6[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x4139b7[_0x5f0e('0x38')][_0x5f0e('0x3d')]));_0x340adc['attributes']=_0x340adc[_0x5f0e('0x3c')][_0x5f0e('0x3e')]?_0x340adc[_0x5f0e('0x3c')]:_0x8ccd6[_0x5f0e('0x37')];if(!_0x4139b7[_0x5f0e('0x38')]['hasOwnProperty'](_0x5f0e('0x3f'))){_0x340adc[_0x5f0e('0x25')]=qs[_0x5f0e('0x25')](_0x4139b7[_0x5f0e('0x38')][_0x5f0e('0x25')]);_0x340adc['offset']=qs[_0x5f0e('0x24')](_0x4139b7[_0x5f0e('0x38')]['offset']);}_0x340adc[_0x5f0e('0x40')]=qs[_0x5f0e('0x41')](_0x4139b7[_0x5f0e('0x38')][_0x5f0e('0x41')]);_0x340adc[_0x5f0e('0x42')]=qs['filters'](_[_0x5f0e('0x43')](_0x4139b7[_0x5f0e('0x38')],_0x8ccd6['filters']),_0x2e4828);if(_0x4139b7[_0x5f0e('0x38')][_0x5f0e('0x44')]){_0x340adc[_0x5f0e('0x42')]=_['merge'](_0x340adc['where'],{'$or':_['map'](_0x2e4828,function(_0x67203c){if(_0x67203c[_0x5f0e('0x35')]!==_0x5f0e('0x45')){var _0x2390e3={};_0x2390e3[_0x67203c['name']]={'$like':'%'+_0x4139b7[_0x5f0e('0x38')][_0x5f0e('0x44')]+'%'};return _0x2390e3;}})});}_0x340adc=_[_0x5f0e('0x46')]({},_0x340adc,_0x4139b7[_0x5f0e('0x47')]);var _0x5eb770={'where':_0x340adc[_0x5f0e('0x42')]};return db[_0x5f0e('0x33')][_0x5f0e('0x23')](_0x5eb770)['then'](function(_0x170d8b){_0x5b9cfe['count']=_0x170d8b;if(_0x4139b7[_0x5f0e('0x38')]['includeAll']){_0x340adc[_0x5f0e('0x48')]=[{'all':!![]}];}return db[_0x5f0e('0x33')][_0x5f0e('0x49')](_0x340adc);})[_0x5f0e('0x2a')](function(_0x1c6c80){_0x5b9cfe[_0x5f0e('0x4a')]=_0x1c6c80;return _0x5b9cfe;})['then'](respondWithFilteredResult(_0x57d078,_0x340adc))[_0x5f0e('0x4b')](handleError(_0x57d078,null));};exports['show']=function(_0x33579c,_0x19365c){var _0x14bae0={'raw':![],'where':{'id':_0x33579c['params']['id']}},_0x444a9d={};_0x444a9d[_0x5f0e('0x37')]=_[_0x5f0e('0x39')](db[_0x5f0e('0x33')][_0x5f0e('0x34')]);_0x444a9d['query']=_[_0x5f0e('0x39')](_0x33579c[_0x5f0e('0x38')]);_0x444a9d[_0x5f0e('0x3a')]=_[_0x5f0e('0x3b')](_0x444a9d[_0x5f0e('0x37')],_0x444a9d['query']);_0x14bae0[_0x5f0e('0x3c')]=_[_0x5f0e('0x3b')](_0x444a9d[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x33579c[_0x5f0e('0x38')]['fields']));_0x14bae0['attributes']=_0x14bae0[_0x5f0e('0x3c')]['length']?_0x14bae0[_0x5f0e('0x3c')]:_0x444a9d['model'];if(_0x33579c[_0x5f0e('0x38')][_0x5f0e('0x4c')]){_0x14bae0[_0x5f0e('0x48')]=[{'all':!![]}];}_0x14bae0=_[_0x5f0e('0x46')]({},_0x14bae0,_0x33579c[_0x5f0e('0x47')]);return db['CmList']['find'](_0x14bae0)[_0x5f0e('0x2a')](handleEntityNotFound(_0x19365c,null))[_0x5f0e('0x2a')](respondWithResult(_0x19365c,null))[_0x5f0e('0x4b')](handleError(_0x19365c,null));};exports[_0x5f0e('0x4d')]=function(_0x198bf8,_0x187f1d){return db[_0x5f0e('0x33')]['create'](_0x198bf8[_0x5f0e('0x4e')],{})[_0x5f0e('0x2a')](function(_0x2e375e){var _0x2c7d56=_0x198bf8[_0x5f0e('0x4f')]['get']({'plain':!![]});if(!_0x2c7d56)throw new Error(_0x5f0e('0x50'));if(_0x2c7d56[_0x5f0e('0x51')]===_0x5f0e('0x4f')){var _0x127f7d=_0x2e375e[_0x5f0e('0x52')]({'plain':!![]});var _0x344a17=_0x5f0e('0x2b');return db[_0x5f0e('0x53')][_0x5f0e('0x54')]({'where':{'name':_0x344a17,'userProfileId':_0x2c7d56[_0x5f0e('0x55')]},'raw':!![]})[_0x5f0e('0x2a')](function(_0x303d6f){if(_0x303d6f&&_0x303d6f[_0x5f0e('0x56')]===0x0){return db['UserProfileResource'][_0x5f0e('0x4d')]({'name':_0x127f7d['name'],'resourceId':_0x127f7d['id'],'type':_0x303d6f[_0x5f0e('0x2f')],'sectionId':_0x303d6f['id']},{})[_0x5f0e('0x2a')](function(){return _0x2e375e;});}else{return _0x2e375e;}})[_0x5f0e('0x4b')](function(_0x519794){logger[_0x5f0e('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x519794);throw _0x519794;});}return _0x2e375e;})[_0x5f0e('0x2a')](respondWithResult(_0x187f1d,0xc9))[_0x5f0e('0x4b')](handleError(_0x187f1d,null));};exports[_0x5f0e('0x28')]=function(_0x251da8,_0x57139a){if(_0x251da8[_0x5f0e('0x4e')]['id']){delete _0x251da8[_0x5f0e('0x4e')]['id'];}return db['CmList'][_0x5f0e('0x54')]({'where':{'id':_0x251da8[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x57139a,null))[_0x5f0e('0x2a')](saveUpdates(_0x251da8['body'],null))[_0x5f0e('0x2a')](respondWithResult(_0x57139a,null))[_0x5f0e('0x4b')](handleError(_0x57139a,null));};exports[_0x5f0e('0x29')]=function(_0x2448f4,_0x145206){return db['CmList'][_0x5f0e('0x54')]({'where':{'id':_0x2448f4[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x145206,null))[_0x5f0e('0x2a')](removeEntity(_0x145206,null))[_0x5f0e('0x4b')](handleError(_0x145206,null));};exports[_0x5f0e('0x58')]=function(_0x4a0008,_0x549a06){return db[_0x5f0e('0x33')][_0x5f0e('0x58')]()[_0x5f0e('0x2a')](respondWithResult(_0x549a06,null))[_0x5f0e('0x4b')](handleError(_0x549a06,null));};exports[_0x5f0e('0x59')]=function(_0x172875,_0x2bc56a,_0x4c547d){if(_0x172875[_0x5f0e('0x4e')]['id']){delete _0x172875[_0x5f0e('0x4e')]['id'];}return db[_0x5f0e('0x33')][_0x5f0e('0x54')]({'where':{'id':_0x172875[_0x5f0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x2bc56a,null))[_0x5f0e('0x2a')](function(_0x14fd62){if(_0x14fd62){_0x172875[_0x5f0e('0x4e')][_0x5f0e('0x5a')]=_0x14fd62['id'];return db[_0x5f0e('0x5b')][_0x5f0e('0x4d')](_0x172875['body']);}})[_0x5f0e('0x2a')](respondWithResult(_0x2bc56a,null))['catch'](handleError(_0x2bc56a,null));};exports[_0x5f0e('0x5c')]=function(_0x54332b,_0x1d56b4,_0x2360a1){var _0x2a754f={'raw':![],'where':{}};var _0x1f5332={};var _0x15bd8c={'count':0x0,'rows':[]};return db[_0x5f0e('0x33')][_0x5f0e('0x5d')]({'where':{'id':_0x54332b[_0x5f0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x1d56b4,null))['then'](function(_0x2536be){if(_0x2536be){_0x1f5332['model']=_[_0x5f0e('0x39')](db[_0x5f0e('0x5b')][_0x5f0e('0x34')]);_0x1f5332[_0x5f0e('0x38')]=_[_0x5f0e('0x39')](_0x54332b[_0x5f0e('0x38')]);_0x1f5332[_0x5f0e('0x3a')]=_[_0x5f0e('0x3b')](_0x1f5332[_0x5f0e('0x37')],_0x1f5332[_0x5f0e('0x38')]);_0x2a754f[_0x5f0e('0x3c')]=_[_0x5f0e('0x3b')](_0x1f5332[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x3d')]));_0x2a754f[_0x5f0e('0x3c')]=_0x2a754f[_0x5f0e('0x3c')][_0x5f0e('0x3e')]?_0x2a754f[_0x5f0e('0x3c')]:_0x1f5332[_0x5f0e('0x37')];if(!_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x5e')]('nolimit')){_0x2a754f[_0x5f0e('0x25')]=qs[_0x5f0e('0x25')](_0x54332b[_0x5f0e('0x38')]['limit']);_0x2a754f[_0x5f0e('0x24')]=qs[_0x5f0e('0x24')](_0x54332b['query'][_0x5f0e('0x24')]);}_0x2a754f[_0x5f0e('0x40')]=qs[_0x5f0e('0x41')](_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x41')]);_0x2a754f[_0x5f0e('0x42')]=qs[_0x5f0e('0x3a')](_['pick'](_0x54332b[_0x5f0e('0x38')],_0x1f5332[_0x5f0e('0x3a')]));_0x2a754f[_0x5f0e('0x42')][_0x5f0e('0x5a')]=_0x2536be['id'];if(_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x44')]){_0x2a754f[_0x5f0e('0x42')]=_[_0x5f0e('0x46')](_0x2a754f[_0x5f0e('0x42')],{'$or':_[_0x5f0e('0x32')](_0x2a754f[_0x5f0e('0x3c')],function(_0x1057f9){var _0x494482={};_0x494482[_0x1057f9]={'$like':'%'+_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x44')]+'%'};return _0x494482;})});}_0x2a754f=_[_0x5f0e('0x46')]({},_0x2a754f,_0x54332b[_0x5f0e('0x47')]);return db[_0x5f0e('0x5b')]['count']({'where':_0x2a754f[_0x5f0e('0x42')]})['then'](function(_0x27e1a0){_0x15bd8c[_0x5f0e('0x23')]=_0x27e1a0;if(_0x54332b[_0x5f0e('0x38')][_0x5f0e('0x4c')]){_0x2a754f['include']=[{'all':!![]}];}return db[_0x5f0e('0x5b')][_0x5f0e('0x49')](_0x2a754f);})['then'](function(_0x2a55cb){_0x15bd8c[_0x5f0e('0x4a')]=_0x2a55cb;return _0x15bd8c;});}})[_0x5f0e('0x2a')](respondWithFilteredResult(_0x1d56b4,_0x2a754f))[_0x5f0e('0x4b')](handleError(_0x1d56b4,null));};exports[_0x5f0e('0x5f')]=function(_0x593a7e,_0x9011b4,_0x11b408){return db[_0x5f0e('0x33')][_0x5f0e('0x54')]({'where':{'id':_0x593a7e[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x9011b4,null))[_0x5f0e('0x2a')](function(_0x418e51){if(_0x418e51){return _0x418e51[_0x5f0e('0x5f')](_0x593a7e[_0x5f0e('0x38')]['ids']);}})[_0x5f0e('0x2a')](respondWithStatusCode(_0x9011b4,null))['catch'](handleError(_0x9011b4,null));};exports[_0x5f0e('0x60')]=function(_0x5b17f2,_0x394197,_0x8606f9){return db[_0x5f0e('0x33')][_0x5f0e('0x54')]({'where':{'id':_0x5b17f2[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x394197,null))[_0x5f0e('0x2a')](function(_0x263b41){if(_0x263b41){var _0x5a3561=[];var _0x5a9639={'success':[],'errors':[]};return db[_0x5f0e('0x61')][_0x5f0e('0x58')]()[_0x5f0e('0x2a')](function(_0x248bd1){if(_0x5b17f2[_0x5f0e('0x4e')][_0x5f0e('0x62')]&&_[_0x5f0e('0x63')](_0x5b17f2[_0x5f0e('0x4e')]['tags'])){if(_0x5b17f2[_0x5f0e('0x4e')][_0x5f0e('0x62')][_0x5f0e('0x3e')]){_0x5b17f2['body'][_0x5f0e('0x62')]=_0x5b17f2[_0x5f0e('0x4e')]['tags'][_0x5f0e('0x64')](';')+';';}else{_0x5b17f2[_0x5f0e('0x4e')][_0x5f0e('0x62')]=null;}}else{_0x5b17f2[_0x5f0e('0x4e')]['tags']=null;}if(_0x5b17f2[_0x5f0e('0x4e')]&&_[_0x5f0e('0x63')](_0x5b17f2[_0x5f0e('0x4e')])){for(var _0x379f3e=0x0;_0x379f3e<_0x5b17f2[_0x5f0e('0x4e')]['length'];_0x379f3e+=0x1){_0x5b17f2[_0x5f0e('0x4e')][_0x379f3e][_0x5f0e('0x5a')]=_0x5b17f2['params']['id'];_0x5a3561[_0x5f0e('0x65')](_0x5b17f2['body'][_0x379f3e]);}return BPromise[_0x5f0e('0x66')](_0x5a3561,function(_0x2bf4da){return db[_0x5f0e('0x61')][_0x5f0e('0x4d')](_['omit'](_0x2bf4da,['ids','id'])||{},{'fields':_[_0x5f0e('0x39')](_0x248bd1),'raw':!![]})[_0x5f0e('0x2a')](function(_0x4fe82f){_0x5a9639['success'][_0x5f0e('0x65')](_0x4fe82f[_0x5f0e('0x67')]);})[_0x5f0e('0x4b')](function(_0x16d3ff){_0x5a9639[_0x5f0e('0x68')][_0x5f0e('0x65')]({'data':_0x2bf4da,'error':_0x16d3ff[_0x5f0e('0x69')]});});})[_0x5f0e('0x2a')](function(_0x5e2e0b){return _0x5a9639;})[_0x5f0e('0x4b')](function(_0x5a0333){return _0x5a0333;});}else{_0x394197[_0x5f0e('0x20')](0x190)[_0x5f0e('0x21')]({'message':_0x5f0e('0x6a')});}});}})[_0x5f0e('0x2a')](respondWithResult(_0x394197,null))[_0x5f0e('0x4b')](handleError(_0x394197,null));};exports['getContacts']=function(_0x41783b,_0x497395,_0x43d445){var _0xc05766;return db['CmList'][_0x5f0e('0x54')]({'where':{'id':_0x41783b['params']['id']},'include':[{'model':db[_0x5f0e('0x6b')],'as':_0x5f0e('0x6c')}]})[_0x5f0e('0x2a')](handleEntityNotFound(_0x497395,null))[_0x5f0e('0x2a')](function(_0x3d1eb4){if(_0x3d1eb4){_0xc05766=_0x3d1eb4;return db[_0x5f0e('0x61')][_0x5f0e('0x34')];}})[_0x5f0e('0x2a')](function(_0x5212d3){if(_0x5212d3){var _0x457158={};var _0xa1e760={};_0xa1e760['model']=_['concat'](_[_0x5f0e('0x39')](_0x5212d3),_[_0x5f0e('0x32')](_0xc05766[_0x5f0e('0x6c')],function(_0x2cac06){return util[_0x5f0e('0x6d')](_0x5f0e('0x6e'),_0x2cac06['id']);}));_0xa1e760[_0x5f0e('0x38')]=_[_0x5f0e('0x39')](_0x41783b['query']);_0xa1e760[_0x5f0e('0x3a')]=_[_0x5f0e('0x3b')](_0xa1e760[_0x5f0e('0x37')],_0xa1e760[_0x5f0e('0x38')]);_0x457158['attributes']=_[_0x5f0e('0x3b')](_0xa1e760[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x41783b[_0x5f0e('0x38')]['fields']));_0x457158[_0x5f0e('0x3c')]=_0x457158[_0x5f0e('0x3c')][_0x5f0e('0x3e')]?_0x457158[_0x5f0e('0x3c')]:_0xa1e760[_0x5f0e('0x37')];if(!_0x41783b[_0x5f0e('0x38')]['hasOwnProperty'](_0x5f0e('0x3f'))){_0x457158['limit']=qs[_0x5f0e('0x25')](_0x41783b['query']['limit']);_0x457158[_0x5f0e('0x24')]=qs[_0x5f0e('0x24')](_0x41783b[_0x5f0e('0x38')][_0x5f0e('0x24')]);}_0x457158[_0x5f0e('0x40')]=qs[_0x5f0e('0x41')](_0x41783b['query']['sort']);_0x457158[_0x5f0e('0x42')]=qs[_0x5f0e('0x3a')](_[_0x5f0e('0x43')](_0x41783b['query'],_0xa1e760['filters']));_0x457158[_0x5f0e('0x6f')]=!![];if(_0x41783b[_0x5f0e('0x38')][_0x5f0e('0x44')]){_0x457158['where']=_[_0x5f0e('0x46')](_0x457158['where'],{'$or':_[_0x5f0e('0x32')](_0x457158[_0x5f0e('0x3c')],function(_0x1a0ce1){var _0x3c716c={};_0x3c716c[_0x1a0ce1]={'$like':'%'+_0x41783b['query'][_0x5f0e('0x44')]+'%'};return _0x3c716c;})});}_0x457158=_[_0x5f0e('0x46')]({},_0x457158,_0x41783b[_0x5f0e('0x47')]);return _0xc05766[_0x5f0e('0x70')](_0x457158);}})[_0x5f0e('0x2a')](respondWithResult(_0x497395,null))['catch'](handleError(_0x497395,null));};exports[_0x5f0e('0x71')]=function(_0x456490,_0x33d667,_0x14ec3f){var _0x7c0ca1;return db['CmList'][_0x5f0e('0x54')]({'where':{'id':_0x456490[_0x5f0e('0x57')]['id']},'include':[{'model':db[_0x5f0e('0x6b')],'as':_0x5f0e('0x6c')}]})['then'](handleEntityNotFound(_0x33d667,null))[_0x5f0e('0x2a')](function(_0x4da133){if(_0x4da133){_0x7c0ca1=_0x4da133;return db[_0x5f0e('0x61')][_0x5f0e('0x34')];}})[_0x5f0e('0x2a')](function(_0x182179){if(_0x182179){var _0x12cdae={};var _0x385d4c={};_0x385d4c[_0x5f0e('0x37')]=_[_0x5f0e('0x72')](_['keys'](_0x182179),_[_0x5f0e('0x32')](_0x7c0ca1[_0x5f0e('0x6c')],function(_0x3f5fe4){return util[_0x5f0e('0x6d')](_0x5f0e('0x6e'),_0x3f5fe4['id']);}));_0x385d4c['query']=_[_0x5f0e('0x39')](_0x456490['query']);_0x385d4c['filters']=_['intersection'](_0x385d4c['model'],_0x385d4c[_0x5f0e('0x38')]);_0x12cdae['attributes']=_[_0x5f0e('0x3b')](_0x385d4c[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x456490[_0x5f0e('0x38')][_0x5f0e('0x3d')]));_0x12cdae[_0x5f0e('0x3c')]=_0x12cdae['attributes'][_0x5f0e('0x3e')]?_0x12cdae[_0x5f0e('0x3c')]:_0x385d4c[_0x5f0e('0x37')];if(!_0x456490['query'][_0x5f0e('0x5e')](_0x5f0e('0x3f'))){_0x12cdae[_0x5f0e('0x25')]=qs[_0x5f0e('0x25')](_0x456490['query'][_0x5f0e('0x25')]);_0x12cdae[_0x5f0e('0x24')]=qs['offset'](_0x456490['query']['offset']);}_0x12cdae[_0x5f0e('0x40')]=qs[_0x5f0e('0x41')](_0x456490[_0x5f0e('0x38')][_0x5f0e('0x41')]);_0x12cdae[_0x5f0e('0x42')]=qs[_0x5f0e('0x3a')](_[_0x5f0e('0x43')](_0x456490[_0x5f0e('0x38')],_0x385d4c[_0x5f0e('0x3a')]));_0x12cdae[_0x5f0e('0x6f')]=!![];if(_0x456490[_0x5f0e('0x38')][_0x5f0e('0x44')]){_0x12cdae[_0x5f0e('0x42')]=_['merge'](_0x12cdae['where'],{'$or':_['map'](_0x12cdae[_0x5f0e('0x3c')],function(_0x3f03b9){var _0xc6883d={};_0xc6883d[_0x3f03b9]={'$like':'%'+_0x456490['query']['filter']+'%'};return _0xc6883d;})});}_0x12cdae=_[_0x5f0e('0x46')]({},_0x12cdae,_0x456490['options']);return _0x7c0ca1['getContacts'](_0x12cdae);}})['then'](function(_0x36b9a1){if(!_[_0x5f0e('0x73')](_0x36b9a1)){var _0x284901=toCsv(_0x36b9a1);var _0x2da6bd=Date[_0x5f0e('0x74')]();fs[_0x5f0e('0x75')](util['format']('/tmp/list_%d_%s.csv',_0x7c0ca1['id'],_0x2da6bd),_0x284901);_0x33d667['setHeader'](_0x5f0e('0x76'),_0x5f0e('0x77')+util[_0x5f0e('0x6d')](_0x5f0e('0x78'),_0x7c0ca1['id'],_0x2da6bd));_0x33d667[_0x5f0e('0x79')](_0x5f0e('0x7a'),_0x5f0e('0x7b'));return _0x33d667[_0x5f0e('0x7c')](util[_0x5f0e('0x6d')](_0x5f0e('0x7d'),_0x7c0ca1['id'],_0x2da6bd));}else{return _0x33d667[_0x5f0e('0x1f')](0xcc);}})[_0x5f0e('0x4b')](handleError(_0x33d667,null));};exports[_0x5f0e('0x7e')]=function(_0x495070,_0x2de6bf,_0x27d665){var _0x44cc3a;delete _0x495070[_0x5f0e('0x4e')]['id'];return db['CmList'][_0x5f0e('0x5d')]({'where':{'id':_0x495070[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x2de6bf,null))[_0x5f0e('0x2a')](function(_0x4bd8ef){if(_0x4bd8ef){return db[_0x5f0e('0x7f')]['transaction'](function(_0x49420a){return db[_0x5f0e('0x6b')]['create'](_0x495070[_0x5f0e('0x4e')],{'transaction':_0x49420a})[_0x5f0e('0x2a')](function(_0xd8aec0){_0x44cc3a=_0xd8aec0;return _0x4bd8ef[_0x5f0e('0x80')](_0xd8aec0,{'transaction':_0x49420a});})[_0x5f0e('0x2a')](function(){var _0xb2a67b={'type':db[_0x5f0e('0x81')][_0x5f0e('0x82')],'transaction':_0x49420a};switch(_0x495070[_0x5f0e('0x4e')]['type']){case _0x5f0e('0x83'):_0xb2a67b[_0x5f0e('0x35')]=db['Sequelize']['TEXT'];break;case'number':_0xb2a67b['type']=db[_0x5f0e('0x81')][_0x5f0e('0x84')];break;case _0x5f0e('0x85'):_0xb2a67b[_0x5f0e('0x35')]=db[_0x5f0e('0x81')][_0x5f0e('0x86')];_0xb2a67b[_0x5f0e('0x87')]=![];break;default:}return db[_0x5f0e('0x7f')][_0x5f0e('0x88')][_0x5f0e('0x89')](_0x5f0e('0x8a'),util[_0x5f0e('0x6d')](_0x5f0e('0x8b'),_0x44cc3a['id']),_0xb2a67b);})['then'](function(){return _0x44cc3a;});});}})[_0x5f0e('0x2a')](respondWithResult(_0x2de6bf,null))['catch'](handleError(_0x2de6bf,null));};exports[_0x5f0e('0x8c')]=function(_0x58d47a,_0x2ce590,_0xe0a828){var _0x1387ce={};var _0x532d79={};var _0x217c1f;var _0x140207;return db[_0x5f0e('0x33')]['findOne']({'where':{'id':_0x58d47a[_0x5f0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x2ce590,null))[_0x5f0e('0x2a')](function(_0x333739){if(_0x333739){_0x217c1f=_0x333739;_0x532d79['model']=_['keys'](db[_0x5f0e('0x6b')]['rawAttributes']);_0x532d79[_0x5f0e('0x38')]=_[_0x5f0e('0x39')](_0x58d47a[_0x5f0e('0x38')]);_0x532d79[_0x5f0e('0x3a')]=_[_0x5f0e('0x3b')](_0x532d79[_0x5f0e('0x37')],_0x532d79[_0x5f0e('0x38')]);_0x1387ce[_0x5f0e('0x3c')]=_[_0x5f0e('0x3b')](_0x532d79[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x58d47a[_0x5f0e('0x38')][_0x5f0e('0x3d')]));_0x1387ce['attributes']=_0x1387ce[_0x5f0e('0x3c')]['length']?_0x1387ce[_0x5f0e('0x3c')]:_0x532d79[_0x5f0e('0x37')];_0x1387ce[_0x5f0e('0x40')]=qs[_0x5f0e('0x41')](_0x58d47a[_0x5f0e('0x38')]['sort']);_0x1387ce['where']=qs[_0x5f0e('0x3a')](_[_0x5f0e('0x43')](_0x58d47a[_0x5f0e('0x38')],_0x532d79[_0x5f0e('0x3a')]));_0x1387ce[_0x5f0e('0x42')]=_[_0x5f0e('0x46')](_0x1387ce[_0x5f0e('0x42')],{'$or':[{'ListId':_0x333739['id']},{'ListId':null}]});if(_0x58d47a['query'][_0x5f0e('0x44')]){_0x1387ce[_0x5f0e('0x42')]=_[_0x5f0e('0x46')](_0x1387ce[_0x5f0e('0x42')],{'$or':_[_0x5f0e('0x32')](_0x1387ce['attributes'],function(_0x3d0c02){var _0x209a81={};_0x209a81[_0x3d0c02]={'$like':'%'+_0x58d47a['query'][_0x5f0e('0x44')]+'%'};return _0x209a81;})});}_0x1387ce=_['merge']({},_0x1387ce,_0x58d47a[_0x5f0e('0x47')]);return db[_0x5f0e('0x6b')][_0x5f0e('0x8d')](_0x1387ce);}})[_0x5f0e('0x2a')](respondWithResult(_0x2ce590,null))['catch'](handleError(_0x2ce590,null));};exports[_0x5f0e('0x8e')]=function(_0x1e91f8,_0x57d7d9,_0x4b61aa){return db['CmList'][_0x5f0e('0x54')]({'where':{'id':_0x1e91f8[_0x5f0e('0x57')]['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x57d7d9,null))['then'](function(_0x240aca){if(_0x240aca){return _0x240aca[_0x5f0e('0x8e')](_0x1e91f8[_0x5f0e('0x4e')]['ids'],_[_0x5f0e('0x8f')](_0x1e91f8['body'],['ids','id'])||{})[_0x5f0e('0x90')](function(_0x4af7a1){for(var _0x4bca1c=0x0;_0x4bca1c<_0x1e91f8[_0x5f0e('0x4e')][_0x5f0e('0x91')][_0x5f0e('0x3e')];_0x4bca1c+=0x1){socket[_0x5f0e('0x92')](_0x5f0e('0x93'),{'UserId':Number(_0x1e91f8[_0x5f0e('0x4e')][_0x5f0e('0x91')][_0x4bca1c]),'CmListId':Number(_0x1e91f8[_0x5f0e('0x57')]['id'])});}return _0x4af7a1;});}})[_0x5f0e('0x2a')](respondWithResult(_0x57d7d9,null))[_0x5f0e('0x4b')](handleError(_0x57d7d9,null));};exports['removeAgents']=function(_0x5d91b2,_0x25d1e2,_0x3f4bdf){return db[_0x5f0e('0x33')][_0x5f0e('0x54')]({'where':{'id':_0x5d91b2[_0x5f0e('0x57')]['id']}})['then'](handleEntityNotFound(_0x25d1e2,null))['then'](function(_0x2242da){if(_0x2242da){return _0x2242da['removeAgents'](_0x5d91b2[_0x5f0e('0x38')][_0x5f0e('0x91')])[_0x5f0e('0x2a')](function(){if(_[_0x5f0e('0x63')](_0x5d91b2[_0x5f0e('0x38')][_0x5f0e('0x91')])){for(var _0x106e96=0x0;_0x106e96<_0x5d91b2[_0x5f0e('0x38')]['ids'][_0x5f0e('0x3e')];_0x106e96+=0x1){socket['emit']('userCmList:remove',{'UserId':Number(_0x5d91b2[_0x5f0e('0x38')][_0x5f0e('0x91')][_0x106e96]),'CmListId':Number(_0x5d91b2[_0x5f0e('0x57')]['id'])});}}else{socket[_0x5f0e('0x92')](_0x5f0e('0x94'),{'UserId':Number(_0x5d91b2['query'][_0x5f0e('0x91')]),'CmListId':Number(_0x5d91b2[_0x5f0e('0x57')]['id'])});}});}})[_0x5f0e('0x2a')](respondWithStatusCode(_0x25d1e2,null))['catch'](handleError(_0x25d1e2,null));};exports[_0x5f0e('0x95')]=function(_0x5df3ba,_0x5ac1a1,_0x25c191){var _0x2db916={};var _0x384f31={};var _0x28a991;var _0x2c266b;return db[_0x5f0e('0x33')][_0x5f0e('0x5d')]({'where':{'id':_0x5df3ba['params']['id']}})[_0x5f0e('0x2a')](handleEntityNotFound(_0x5ac1a1,null))[_0x5f0e('0x2a')](function(_0x142dd){if(_0x142dd){_0x28a991=_0x142dd;_0x384f31[_0x5f0e('0x37')]=_[_0x5f0e('0x39')](db['User'][_0x5f0e('0x34')]);_0x384f31['query']=_[_0x5f0e('0x39')](_0x5df3ba[_0x5f0e('0x38')]);_0x384f31[_0x5f0e('0x3a')]=_['intersection'](_0x384f31[_0x5f0e('0x37')],_0x384f31['query']);_0x2db916[_0x5f0e('0x3c')]=_['intersection'](_0x384f31[_0x5f0e('0x37')],qs[_0x5f0e('0x3d')](_0x5df3ba['query'][_0x5f0e('0x3d')]));_0x2db916[_0x5f0e('0x3c')]=_0x2db916[_0x5f0e('0x3c')][_0x5f0e('0x3e')]?_0x2db916['attributes']:_0x384f31['model'];_0x2db916['order']=qs[_0x5f0e('0x41')](_0x5df3ba[_0x5f0e('0x38')][_0x5f0e('0x41')]);_0x2db916[_0x5f0e('0x42')]=qs[_0x5f0e('0x3a')](_[_0x5f0e('0x43')](_0x5df3ba['query'],_0x384f31[_0x5f0e('0x3a')]));if(_0x5df3ba[_0x5f0e('0x38')][_0x5f0e('0x44')]){_0x2db916[_0x5f0e('0x42')]=_[_0x5f0e('0x46')](_0x2db916[_0x5f0e('0x42')],{'$or':_[_0x5f0e('0x32')](_0x2db916['attributes'],function(_0x355bf3){var _0x48ca30={};_0x48ca30[_0x355bf3]={'$like':'%'+_0x5df3ba[_0x5f0e('0x38')][_0x5f0e('0x44')]+'%'};return _0x48ca30;})});}_0x2db916=_['merge']({},_0x2db916,_0x5df3ba[_0x5f0e('0x47')]);return _0x28a991[_0x5f0e('0x95')](_0x2db916);}})[_0x5f0e('0x2a')](function(_0x324186){if(_0x324186){_0x2c266b=_0x324186[_0x5f0e('0x3e')];if(!_0x5df3ba[_0x5f0e('0x38')][_0x5f0e('0x5e')](_0x5f0e('0x3f'))){_0x2db916[_0x5f0e('0x25')]=qs[_0x5f0e('0x25')](_0x5df3ba[_0x5f0e('0x38')][_0x5f0e('0x25')]);_0x2db916[_0x5f0e('0x24')]=qs[_0x5f0e('0x24')](_0x5df3ba['query'][_0x5f0e('0x24')]);}return _0x28a991['getAgents'](_0x2db916);}})[_0x5f0e('0x2a')](function(_0x75a9ec){if(_0x75a9ec){return _0x75a9ec?{'count':_0x2c266b,'rows':_0x75a9ec}:null;}})[_0x5f0e('0x2a')](respondWithResult(_0x5ac1a1,null))[_0x5f0e('0x4b')](handleError(_0x5ac1a1,null));}; \ No newline at end of file +var _0x7a61=['squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','destroy','then','get','Lists','UserProfileResource','end','stack','name','send','CmList','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','getDispositions','findOne','Disposition','nolimit','rows','removeDispositions','ids','addContacts','CmContact','tags','join','isArray','each','omit','success','push','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','getContactsCsv','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','transaction','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','sequelize','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra'];(function(_0x5499ab,_0x5a0d86){var _0x47b1d4=function(_0x27a994){while(--_0x27a994){_0x5499ab['push'](_0x5499ab['shift']());}};_0x47b1d4(++_0x5a0d86);}(_0x7a61,0x89));var _0x17a6=function(_0x36362b,_0x43c646){_0x36362b=_0x36362b-0x0;var _0x1b405b=_0x7a61[_0x36362b];return _0x1b405b;};'use strict';var emlformat=require(_0x17a6('0x0'));var rimraf=require(_0x17a6('0x1'));var zipdir=require(_0x17a6('0x2'));var jsonpatch=require(_0x17a6('0x3'));var rp=require(_0x17a6('0x4'));var moment=require('moment');var BPromise=require(_0x17a6('0x5'));var Mustache=require('mustache');var util=require(_0x17a6('0x6'));var path=require(_0x17a6('0x7'));var sox=require(_0x17a6('0x8'));var csv=require('to-csv');var ejs=require(_0x17a6('0x9'));var fs=require('fs');var fs_extra=require(_0x17a6('0xa'));var _=require('lodash');var squel=require(_0x17a6('0xb'));var crypto=require('crypto');var jsforce=require(_0x17a6('0xc'));var deskjs=require(_0x17a6('0xd'));var toCsv=require(_0x17a6('0xe'));var querystring=require(_0x17a6('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x17a6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x17a6('0x11'));var hardwareService=require(_0x17a6('0x12'));var logger=require(_0x17a6('0x13'))(_0x17a6('0x14'));var utils=require('../../config/utils');var config=require(_0x17a6('0x15'));var licenseUtil=require(_0x17a6('0x16'));var db=require(_0x17a6('0x17'))['db'];config[_0x17a6('0x18')]=_[_0x17a6('0x19')](config['redis'],{'host':_0x17a6('0x1a'),'port':0x18eb});var socket=require(_0x17a6('0x1b'))(new Redis(config['redis']));require(_0x17a6('0x1c'))[_0x17a6('0x1d')](socket);function respondWithStatusCode(_0x1f5921,_0x4a0155){_0x4a0155=_0x4a0155||0xcc;return function(_0xfdc1ee){if(_0xfdc1ee){return _0x1f5921[_0x17a6('0x1e')](_0x4a0155);}return _0x1f5921[_0x17a6('0x1f')](_0x4a0155)['end']();};}function respondWithResult(_0x279d14,_0x3ff216){_0x3ff216=_0x3ff216||0xc8;return function(_0x107b66){if(_0x107b66){return _0x279d14[_0x17a6('0x1f')](_0x3ff216)[_0x17a6('0x20')](_0x107b66);}};}function respondWithFilteredResult(_0x53a418,_0x3209c7){return function(_0x596e65){if(_0x596e65){var _0x32aace=typeof _0x3209c7[_0x17a6('0x21')]===_0x17a6('0x22')&&typeof _0x3209c7[_0x17a6('0x23')]===_0x17a6('0x22');var _0x504e72=_0x596e65[_0x17a6('0x24')];var _0x3683a3=_0x32aace?0x0:_0x3209c7[_0x17a6('0x21')];var _0x502e34=_0x32aace?_0x596e65[_0x17a6('0x24')]:_0x3209c7[_0x17a6('0x21')]+_0x3209c7[_0x17a6('0x23')];var _0x442c1b;if(_0x502e34>=_0x504e72){_0x502e34=_0x504e72;_0x442c1b=0xc8;}else{_0x442c1b=0xce;}_0x53a418[_0x17a6('0x1f')](_0x442c1b);return _0x53a418['set'](_0x17a6('0x25'),_0x3683a3+'-'+_0x502e34+'/'+_0x504e72)['json'](_0x596e65);}return null;};}function patchUpdates(_0xd094a3){return function(_0x25681e){try{jsonpatch[_0x17a6('0x26')](_0x25681e,_0xd094a3,!![]);}catch(_0x15264e){return BPromise[_0x17a6('0x27')](_0x15264e);}return _0x25681e['save']();};}function saveUpdates(_0x296488,_0x31b81d){return function(_0x1e79e4){if(_0x1e79e4){return _0x1e79e4['update'](_0x296488)['then'](function(_0x4702c0){return _0x4702c0;});}return null;};}function removeEntity(_0x57b59d,_0x1abeeb){return function(_0x561cb0){if(_0x561cb0){return _0x561cb0[_0x17a6('0x28')]()[_0x17a6('0x29')](function(){var _0x2c46df=_0x561cb0[_0x17a6('0x2a')]({'plain':!![]});var _0x1dbd28=_0x17a6('0x2b');return db[_0x17a6('0x2c')]['destroy']({'where':{'type':_0x1dbd28,'resourceId':_0x2c46df['id']}})['then'](function(){return _0x561cb0;});})[_0x17a6('0x29')](function(){_0x57b59d[_0x17a6('0x1f')](0xcc)[_0x17a6('0x2d')]();});}};}function handleEntityNotFound(_0x41a820,_0x36c75a){return function(_0x24cc29){if(!_0x24cc29){_0x41a820[_0x17a6('0x1e')](0x194);}return _0x24cc29;};}function handleError(_0x3b9e59,_0x59ad1f){_0x59ad1f=_0x59ad1f||0x1f4;return function(_0x3bd6e6){logger['error'](_0x3bd6e6[_0x17a6('0x2e')]);if(_0x3bd6e6['name']){delete _0x3bd6e6[_0x17a6('0x2f')];}_0x3b9e59['status'](_0x59ad1f)[_0x17a6('0x30')](_0x3bd6e6);};}exports['index']=function(_0x22f502,_0x3221a5){var _0xf45263={},_0x397341={},_0x122a23={'count':0x0,'rows':[]};var _0x68e326=_['map'](db[_0x17a6('0x31')]['rawAttributes'],function(_0x1164be){return{'name':_0x1164be[_0x17a6('0x32')],'type':_0x1164be[_0x17a6('0x33')]['key']};});_0x397341[_0x17a6('0x34')]=_[_0x17a6('0x35')](_0x68e326,_0x17a6('0x2f'));_0x397341['query']=_[_0x17a6('0x36')](_0x22f502[_0x17a6('0x37')]);_0x397341[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0x397341[_0x17a6('0x34')],_0x397341['query']);_0xf45263[_0x17a6('0x3a')]=_[_0x17a6('0x39')](_0x397341[_0x17a6('0x34')],qs['fields'](_0x22f502[_0x17a6('0x37')][_0x17a6('0x3b')]));_0xf45263[_0x17a6('0x3a')]=_0xf45263[_0x17a6('0x3a')][_0x17a6('0x3c')]?_0xf45263[_0x17a6('0x3a')]:_0x397341[_0x17a6('0x34')];if(!_0x22f502[_0x17a6('0x37')][_0x17a6('0x3d')]('nolimit')){_0xf45263[_0x17a6('0x23')]=qs[_0x17a6('0x23')](_0x22f502[_0x17a6('0x37')][_0x17a6('0x23')]);_0xf45263['offset']=qs[_0x17a6('0x21')](_0x22f502[_0x17a6('0x37')][_0x17a6('0x21')]);}_0xf45263[_0x17a6('0x3e')]=qs[_0x17a6('0x3f')](_0x22f502[_0x17a6('0x37')]['sort']);_0xf45263[_0x17a6('0x40')]=qs[_0x17a6('0x38')](_[_0x17a6('0x41')](_0x22f502[_0x17a6('0x37')],_0x397341[_0x17a6('0x38')]),_0x68e326);if(_0x22f502['query'][_0x17a6('0x42')]){_0xf45263[_0x17a6('0x40')]=_[_0x17a6('0x43')](_0xf45263[_0x17a6('0x40')],{'$or':_[_0x17a6('0x35')](_0x68e326,function(_0x5f0792){if(_0x5f0792[_0x17a6('0x33')]!==_0x17a6('0x44')){var _0x1e585a={};_0x1e585a[_0x5f0792['name']]={'$like':'%'+_0x22f502[_0x17a6('0x37')][_0x17a6('0x42')]+'%'};return _0x1e585a;}})});}_0xf45263=_[_0x17a6('0x43')]({},_0xf45263,_0x22f502[_0x17a6('0x45')]);var _0x4babaf={'where':_0xf45263[_0x17a6('0x40')]};return db[_0x17a6('0x31')]['count'](_0x4babaf)[_0x17a6('0x29')](function(_0x35dbc3){_0x122a23[_0x17a6('0x24')]=_0x35dbc3;if(_0x22f502['query'][_0x17a6('0x46')]){_0xf45263[_0x17a6('0x47')]=[{'all':!![]}];}return db[_0x17a6('0x31')][_0x17a6('0x48')](_0xf45263);})[_0x17a6('0x29')](function(_0x287fc6){_0x122a23['rows']=_0x287fc6;return _0x122a23;})[_0x17a6('0x29')](respondWithFilteredResult(_0x3221a5,_0xf45263))['catch'](handleError(_0x3221a5,null));};exports['show']=function(_0x4af5b8,_0x200425){var _0x27a3d1={'raw':![],'where':{'id':_0x4af5b8[_0x17a6('0x49')]['id']}},_0x414dfd={};_0x414dfd[_0x17a6('0x34')]=_['keys'](db[_0x17a6('0x31')][_0x17a6('0x4a')]);_0x414dfd[_0x17a6('0x37')]=_[_0x17a6('0x36')](_0x4af5b8['query']);_0x414dfd[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0x414dfd[_0x17a6('0x34')],_0x414dfd[_0x17a6('0x37')]);_0x27a3d1[_0x17a6('0x3a')]=_[_0x17a6('0x39')](_0x414dfd[_0x17a6('0x34')],qs['fields'](_0x4af5b8[_0x17a6('0x37')]['fields']));_0x27a3d1[_0x17a6('0x3a')]=_0x27a3d1['attributes'][_0x17a6('0x3c')]?_0x27a3d1[_0x17a6('0x3a')]:_0x414dfd[_0x17a6('0x34')];if(_0x4af5b8[_0x17a6('0x37')][_0x17a6('0x46')]){_0x27a3d1[_0x17a6('0x47')]=[{'all':!![]}];}_0x27a3d1=_[_0x17a6('0x43')]({},_0x27a3d1,_0x4af5b8[_0x17a6('0x45')]);return db[_0x17a6('0x31')][_0x17a6('0x4b')](_0x27a3d1)[_0x17a6('0x29')](handleEntityNotFound(_0x200425,null))[_0x17a6('0x29')](respondWithResult(_0x200425,null))[_0x17a6('0x4c')](handleError(_0x200425,null));};exports[_0x17a6('0x4d')]=function(_0x5515ff,_0x52970a){return db[_0x17a6('0x31')][_0x17a6('0x4d')](_0x5515ff[_0x17a6('0x4e')],{})[_0x17a6('0x29')](function(_0x4eb38f){var _0x33669f=_0x5515ff[_0x17a6('0x4f')]['get']({'plain':!![]});if(!_0x33669f)throw new Error(_0x17a6('0x50'));if(_0x33669f['role']===_0x17a6('0x4f')){var _0x2d645b=_0x4eb38f[_0x17a6('0x2a')]({'plain':!![]});var _0x2731c7=_0x17a6('0x2b');return db[_0x17a6('0x51')][_0x17a6('0x4b')]({'where':{'name':_0x2731c7,'userProfileId':_0x33669f['userProfileId']},'raw':!![]})[_0x17a6('0x29')](function(_0x445440){if(_0x445440&&_0x445440[_0x17a6('0x52')]===0x0){return db['UserProfileResource'][_0x17a6('0x4d')]({'name':_0x2d645b[_0x17a6('0x2f')],'resourceId':_0x2d645b['id'],'type':_0x445440[_0x17a6('0x2f')],'sectionId':_0x445440['id']},{})[_0x17a6('0x29')](function(){return _0x4eb38f;});}else{return _0x4eb38f;}})[_0x17a6('0x4c')](function(_0x210b63){logger[_0x17a6('0x53')](_0x17a6('0x54'),_0x210b63);throw _0x210b63;});}return _0x4eb38f;})[_0x17a6('0x29')](respondWithResult(_0x52970a,0xc9))['catch'](handleError(_0x52970a,null));};exports[_0x17a6('0x55')]=function(_0x528fb4,_0x18eb45){if(_0x528fb4[_0x17a6('0x4e')]['id']){delete _0x528fb4['body']['id'];}return db[_0x17a6('0x31')][_0x17a6('0x4b')]({'where':{'id':_0x528fb4['params']['id']}})[_0x17a6('0x29')](handleEntityNotFound(_0x18eb45,null))[_0x17a6('0x29')](saveUpdates(_0x528fb4[_0x17a6('0x4e')],null))[_0x17a6('0x29')](respondWithResult(_0x18eb45,null))[_0x17a6('0x4c')](handleError(_0x18eb45,null));};exports[_0x17a6('0x28')]=function(_0x48d52e,_0x58ed77){return db[_0x17a6('0x31')][_0x17a6('0x4b')]({'where':{'id':_0x48d52e['params']['id']}})['then'](handleEntityNotFound(_0x58ed77,null))[_0x17a6('0x29')](removeEntity(_0x58ed77,null))['catch'](handleError(_0x58ed77,null));};exports[_0x17a6('0x56')]=function(_0x3f6697,_0x3547c5){return db[_0x17a6('0x31')][_0x17a6('0x56')]()['then'](respondWithResult(_0x3547c5,null))[_0x17a6('0x4c')](handleError(_0x3547c5,null));};exports[_0x17a6('0x57')]=function(_0x41a8e1,_0x160787,_0x42a0e5){if(_0x41a8e1[_0x17a6('0x4e')]['id']){delete _0x41a8e1['body']['id'];}return db['CmList'][_0x17a6('0x4b')]({'where':{'id':_0x41a8e1['params']['id']}})['then'](handleEntityNotFound(_0x160787,null))[_0x17a6('0x29')](function(_0x40539d){if(_0x40539d){_0x41a8e1['body'][_0x17a6('0x58')]=_0x40539d['id'];return db['Disposition'][_0x17a6('0x4d')](_0x41a8e1[_0x17a6('0x4e')]);}})[_0x17a6('0x29')](respondWithResult(_0x160787,null))[_0x17a6('0x4c')](handleError(_0x160787,null));};exports[_0x17a6('0x59')]=function(_0x259538,_0x9d9ab8,_0x313170){var _0x4fe91b={'raw':![],'where':{}};var _0x2791ee={};var _0x29ace9={'count':0x0,'rows':[]};return db[_0x17a6('0x31')][_0x17a6('0x5a')]({'where':{'id':_0x259538['params']['id']}})['then'](handleEntityNotFound(_0x9d9ab8,null))[_0x17a6('0x29')](function(_0x3122d4){if(_0x3122d4){_0x2791ee['model']=_[_0x17a6('0x36')](db[_0x17a6('0x5b')][_0x17a6('0x4a')]);_0x2791ee[_0x17a6('0x37')]=_[_0x17a6('0x36')](_0x259538[_0x17a6('0x37')]);_0x2791ee[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0x2791ee[_0x17a6('0x34')],_0x2791ee[_0x17a6('0x37')]);_0x4fe91b[_0x17a6('0x3a')]=_['intersection'](_0x2791ee['model'],qs[_0x17a6('0x3b')](_0x259538[_0x17a6('0x37')][_0x17a6('0x3b')]));_0x4fe91b['attributes']=_0x4fe91b[_0x17a6('0x3a')]['length']?_0x4fe91b[_0x17a6('0x3a')]:_0x2791ee[_0x17a6('0x34')];if(!_0x259538[_0x17a6('0x37')][_0x17a6('0x3d')](_0x17a6('0x5c'))){_0x4fe91b['limit']=qs[_0x17a6('0x23')](_0x259538[_0x17a6('0x37')][_0x17a6('0x23')]);_0x4fe91b['offset']=qs[_0x17a6('0x21')](_0x259538[_0x17a6('0x37')][_0x17a6('0x21')]);}_0x4fe91b[_0x17a6('0x3e')]=qs[_0x17a6('0x3f')](_0x259538['query'][_0x17a6('0x3f')]);_0x4fe91b['where']=qs['filters'](_[_0x17a6('0x41')](_0x259538[_0x17a6('0x37')],_0x2791ee[_0x17a6('0x38')]));_0x4fe91b[_0x17a6('0x40')][_0x17a6('0x58')]=_0x3122d4['id'];if(_0x259538[_0x17a6('0x37')][_0x17a6('0x42')]){_0x4fe91b['where']=_[_0x17a6('0x43')](_0x4fe91b['where'],{'$or':_['map'](_0x4fe91b['attributes'],function(_0x76670e){var _0x564902={};_0x564902[_0x76670e]={'$like':'%'+_0x259538['query'][_0x17a6('0x42')]+'%'};return _0x564902;})});}_0x4fe91b=_['merge']({},_0x4fe91b,_0x259538['options']);return db['Disposition'][_0x17a6('0x24')]({'where':_0x4fe91b['where']})[_0x17a6('0x29')](function(_0x4f8cf4){_0x29ace9[_0x17a6('0x24')]=_0x4f8cf4;if(_0x259538[_0x17a6('0x37')][_0x17a6('0x46')]){_0x4fe91b[_0x17a6('0x47')]=[{'all':!![]}];}return db['Disposition'][_0x17a6('0x48')](_0x4fe91b);})['then'](function(_0x1ab373){_0x29ace9[_0x17a6('0x5d')]=_0x1ab373;return _0x29ace9;});}})['then'](respondWithFilteredResult(_0x9d9ab8,_0x4fe91b))[_0x17a6('0x4c')](handleError(_0x9d9ab8,null));};exports[_0x17a6('0x5e')]=function(_0x419b6e,_0x472dfe,_0x3bb289){return db[_0x17a6('0x31')][_0x17a6('0x4b')]({'where':{'id':_0x419b6e[_0x17a6('0x49')]['id']}})['then'](handleEntityNotFound(_0x472dfe,null))[_0x17a6('0x29')](function(_0x55a1b3){if(_0x55a1b3){return _0x55a1b3['removeDispositions'](_0x419b6e['query'][_0x17a6('0x5f')]);}})[_0x17a6('0x29')](respondWithStatusCode(_0x472dfe,null))[_0x17a6('0x4c')](handleError(_0x472dfe,null));};exports[_0x17a6('0x60')]=function(_0x5c9755,_0x11accd,_0x438244){return db[_0x17a6('0x31')]['find']({'where':{'id':_0x5c9755['params']['id']}})[_0x17a6('0x29')](handleEntityNotFound(_0x11accd,null))[_0x17a6('0x29')](function(_0x2d5103){if(_0x2d5103){var _0x19ffd4=[];var _0x512e44={'success':[],'errors':[]};return db[_0x17a6('0x61')][_0x17a6('0x56')]()[_0x17a6('0x29')](function(_0x4468e7){if(_0x5c9755['body'][_0x17a6('0x62')]&&_['isArray'](_0x5c9755[_0x17a6('0x4e')][_0x17a6('0x62')])){if(_0x5c9755['body'][_0x17a6('0x62')]['length']){_0x5c9755['body']['tags']=_0x5c9755[_0x17a6('0x4e')][_0x17a6('0x62')][_0x17a6('0x63')](';')+';';}else{_0x5c9755[_0x17a6('0x4e')][_0x17a6('0x62')]=null;}}else{_0x5c9755['body'][_0x17a6('0x62')]=null;}if(_0x5c9755['body']&&_[_0x17a6('0x64')](_0x5c9755[_0x17a6('0x4e')])){for(var _0x2d8cb4=0x0;_0x2d8cb4<_0x5c9755[_0x17a6('0x4e')][_0x17a6('0x3c')];_0x2d8cb4+=0x1){_0x5c9755['body'][_0x2d8cb4][_0x17a6('0x58')]=_0x5c9755[_0x17a6('0x49')]['id'];_0x19ffd4['push'](_0x5c9755[_0x17a6('0x4e')][_0x2d8cb4]);}return BPromise[_0x17a6('0x65')](_0x19ffd4,function(_0x16bfc2){return db[_0x17a6('0x61')][_0x17a6('0x4d')](_[_0x17a6('0x66')](_0x16bfc2,[_0x17a6('0x5f'),'id'])||{},{'fields':_[_0x17a6('0x36')](_0x4468e7),'raw':!![]})['then'](function(_0x3beac4){_0x512e44[_0x17a6('0x67')][_0x17a6('0x68')](_0x3beac4[_0x17a6('0x69')]);})[_0x17a6('0x4c')](function(_0x318504){_0x512e44[_0x17a6('0x6a')][_0x17a6('0x68')]({'data':_0x16bfc2,'error':_0x318504[_0x17a6('0x6b')]});});})['then'](function(_0x10107b){return _0x512e44;})[_0x17a6('0x4c')](function(_0xf01bb5){return _0xf01bb5;});}else{_0x11accd[_0x17a6('0x1f')](0x190)[_0x17a6('0x20')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x17a6('0x29')](respondWithResult(_0x11accd,null))[_0x17a6('0x4c')](handleError(_0x11accd,null));};exports[_0x17a6('0x6c')]=function(_0x176206,_0x480b61,_0x4187d3){var _0x4aceef;return db[_0x17a6('0x31')][_0x17a6('0x4b')]({'where':{'id':_0x176206[_0x17a6('0x49')]['id']},'include':[{'model':db[_0x17a6('0x6d')],'as':_0x17a6('0x6e')}]})[_0x17a6('0x29')](handleEntityNotFound(_0x480b61,null))[_0x17a6('0x29')](function(_0xbe2b68){if(_0xbe2b68){_0x4aceef=_0xbe2b68;return db[_0x17a6('0x61')][_0x17a6('0x4a')];}})[_0x17a6('0x29')](function(_0x5e54fe){if(_0x5e54fe){var _0x55d64c={};var _0x34ea52={};_0x34ea52[_0x17a6('0x34')]=_[_0x17a6('0x6f')](_[_0x17a6('0x36')](_0x5e54fe),_[_0x17a6('0x35')](_0x4aceef[_0x17a6('0x6e')],function(_0x1d4d3a){return util[_0x17a6('0x70')](_0x17a6('0x71'),_0x1d4d3a['id']);}));_0x34ea52[_0x17a6('0x37')]=_[_0x17a6('0x36')](_0x176206['query']);_0x34ea52[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0x34ea52['model'],_0x34ea52[_0x17a6('0x37')]);_0x55d64c[_0x17a6('0x3a')]=_['intersection'](_0x34ea52[_0x17a6('0x34')],qs['fields'](_0x176206[_0x17a6('0x37')]['fields']));_0x55d64c[_0x17a6('0x3a')]=_0x55d64c['attributes']['length']?_0x55d64c[_0x17a6('0x3a')]:_0x34ea52[_0x17a6('0x34')];if(!_0x176206[_0x17a6('0x37')][_0x17a6('0x3d')](_0x17a6('0x5c'))){_0x55d64c[_0x17a6('0x23')]=qs[_0x17a6('0x23')](_0x176206[_0x17a6('0x37')][_0x17a6('0x23')]);_0x55d64c[_0x17a6('0x21')]=qs[_0x17a6('0x21')](_0x176206['query'][_0x17a6('0x21')]);}_0x55d64c[_0x17a6('0x3e')]=qs[_0x17a6('0x3f')](_0x176206[_0x17a6('0x37')][_0x17a6('0x3f')]);_0x55d64c[_0x17a6('0x40')]=qs[_0x17a6('0x38')](_['pick'](_0x176206[_0x17a6('0x37')],_0x34ea52['filters']));_0x55d64c['raw']=!![];if(_0x176206[_0x17a6('0x37')][_0x17a6('0x42')]){_0x55d64c[_0x17a6('0x40')]=_['merge'](_0x55d64c[_0x17a6('0x40')],{'$or':_['map'](_0x55d64c[_0x17a6('0x3a')],function(_0x2b8385){var _0x4c576b={};_0x4c576b[_0x2b8385]={'$like':'%'+_0x176206[_0x17a6('0x37')]['filter']+'%'};return _0x4c576b;})});}_0x55d64c=_[_0x17a6('0x43')]({},_0x55d64c,_0x176206[_0x17a6('0x45')]);return _0x4aceef[_0x17a6('0x6c')](_0x55d64c);}})[_0x17a6('0x29')](respondWithResult(_0x480b61,null))[_0x17a6('0x4c')](handleError(_0x480b61,null));};exports[_0x17a6('0x72')]=function(_0x595e9f,_0x49f9b8,_0x403abc){var _0x3c68c6;return db['CmList']['find']({'where':{'id':_0x595e9f[_0x17a6('0x49')]['id']},'include':[{'model':db[_0x17a6('0x6d')],'as':'CustomFields'}]})['then'](handleEntityNotFound(_0x49f9b8,null))[_0x17a6('0x29')](function(_0x34b398){if(_0x34b398){_0x3c68c6=_0x34b398;return db[_0x17a6('0x61')][_0x17a6('0x4a')];}})[_0x17a6('0x29')](function(_0x4ed58c){if(_0x4ed58c){var _0xdb89fd={};var _0x41d40f={};_0x41d40f[_0x17a6('0x34')]=_[_0x17a6('0x6f')](_[_0x17a6('0x36')](_0x4ed58c),_[_0x17a6('0x35')](_0x3c68c6[_0x17a6('0x6e')],function(_0x5b8397){return util[_0x17a6('0x70')](_0x17a6('0x71'),_0x5b8397['id']);}));_0x41d40f[_0x17a6('0x37')]=_[_0x17a6('0x36')](_0x595e9f[_0x17a6('0x37')]);_0x41d40f[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0x41d40f[_0x17a6('0x34')],_0x41d40f[_0x17a6('0x37')]);_0xdb89fd[_0x17a6('0x3a')]=_['intersection'](_0x41d40f[_0x17a6('0x34')],qs['fields'](_0x595e9f[_0x17a6('0x37')][_0x17a6('0x3b')]));_0xdb89fd[_0x17a6('0x3a')]=_0xdb89fd[_0x17a6('0x3a')][_0x17a6('0x3c')]?_0xdb89fd['attributes']:_0x41d40f['model'];if(!_0x595e9f['query'][_0x17a6('0x3d')](_0x17a6('0x5c'))){_0xdb89fd[_0x17a6('0x23')]=qs[_0x17a6('0x23')](_0x595e9f[_0x17a6('0x37')][_0x17a6('0x23')]);_0xdb89fd['offset']=qs[_0x17a6('0x21')](_0x595e9f[_0x17a6('0x37')][_0x17a6('0x21')]);}_0xdb89fd[_0x17a6('0x3e')]=qs[_0x17a6('0x3f')](_0x595e9f[_0x17a6('0x37')][_0x17a6('0x3f')]);_0xdb89fd['where']=qs[_0x17a6('0x38')](_[_0x17a6('0x41')](_0x595e9f[_0x17a6('0x37')],_0x41d40f[_0x17a6('0x38')]));_0xdb89fd[_0x17a6('0x73')]=!![];if(_0x595e9f['query']['filter']){_0xdb89fd['where']=_['merge'](_0xdb89fd[_0x17a6('0x40')],{'$or':_[_0x17a6('0x35')](_0xdb89fd[_0x17a6('0x3a')],function(_0x3d097d){var _0x43b74e={};_0x43b74e[_0x3d097d]={'$like':'%'+_0x595e9f[_0x17a6('0x37')]['filter']+'%'};return _0x43b74e;})});}_0xdb89fd=_[_0x17a6('0x43')]({},_0xdb89fd,_0x595e9f['options']);return _0x3c68c6['getContacts'](_0xdb89fd);}})[_0x17a6('0x29')](function(_0x3e3b6f){if(!_[_0x17a6('0x74')](_0x3e3b6f)){var _0x33dff8=toCsv(_0x3e3b6f);var _0x4759d3=Date[_0x17a6('0x75')]();fs[_0x17a6('0x76')](util['format'](_0x17a6('0x77'),_0x3c68c6['id'],_0x4759d3),_0x33dff8);_0x49f9b8[_0x17a6('0x78')](_0x17a6('0x79'),_0x17a6('0x7a')+util[_0x17a6('0x70')](_0x17a6('0x7b'),_0x3c68c6['id'],_0x4759d3));_0x49f9b8['setHeader'](_0x17a6('0x7c'),_0x17a6('0x7d'));return _0x49f9b8['download'](util[_0x17a6('0x70')]('/tmp/list_%d_%s.csv',_0x3c68c6['id'],_0x4759d3));}else{return _0x49f9b8[_0x17a6('0x1e')](0xcc);}})[_0x17a6('0x4c')](handleError(_0x49f9b8,null));};exports['addCustomField']=function(_0x3d076,_0x2a7ef9,_0x41aec4){var _0x441501;delete _0x3d076[_0x17a6('0x4e')]['id'];return db[_0x17a6('0x31')]['findOne']({'where':{'id':_0x3d076[_0x17a6('0x49')]['id']}})['then'](handleEntityNotFound(_0x2a7ef9,null))[_0x17a6('0x29')](function(_0x2dd71f){if(_0x2dd71f){return db['sequelize'][_0x17a6('0x7e')](function(_0x3e1aae){return db[_0x17a6('0x6d')]['create'](_0x3d076['body'],{'transaction':_0x3e1aae})[_0x17a6('0x29')](function(_0x3c5ce0){_0x441501=_0x3c5ce0;return _0x2dd71f['addCustomFields'](_0x3c5ce0,{'transaction':_0x3e1aae});})[_0x17a6('0x29')](function(){var _0x3b3b1d={'type':db[_0x17a6('0x7f')][_0x17a6('0x80')],'transaction':_0x3e1aae};switch(_0x3d076['body']['type']){case _0x17a6('0x81'):_0x3b3b1d[_0x17a6('0x33')]=db[_0x17a6('0x7f')][_0x17a6('0x80')];break;case _0x17a6('0x82'):_0x3b3b1d[_0x17a6('0x33')]=db['Sequelize'][_0x17a6('0x83')];break;case _0x17a6('0x84'):_0x3b3b1d[_0x17a6('0x33')]=db[_0x17a6('0x7f')][_0x17a6('0x85')];_0x3b3b1d['defaultValue']=![];break;default:}return db[_0x17a6('0x86')][_0x17a6('0x87')][_0x17a6('0x88')](_0x17a6('0x89'),util['format'](_0x17a6('0x8a'),_0x441501['id']),_0x3b3b1d);})['then'](function(){return _0x441501;});});}})[_0x17a6('0x29')](respondWithResult(_0x2a7ef9,null))[_0x17a6('0x4c')](handleError(_0x2a7ef9,null));};exports[_0x17a6('0x8b')]=function(_0x2cded8,_0x39e412,_0x51e0d4){var _0x1b89f3={};var _0x10280e={};var _0x550b4a;var _0x14643f;return db[_0x17a6('0x31')][_0x17a6('0x5a')]({'where':{'id':_0x2cded8[_0x17a6('0x49')]['id']}})[_0x17a6('0x29')](handleEntityNotFound(_0x39e412,null))[_0x17a6('0x29')](function(_0x2f6712){if(_0x2f6712){_0x550b4a=_0x2f6712;_0x10280e[_0x17a6('0x34')]=_[_0x17a6('0x36')](db[_0x17a6('0x6d')][_0x17a6('0x4a')]);_0x10280e['query']=_['keys'](_0x2cded8[_0x17a6('0x37')]);_0x10280e['filters']=_['intersection'](_0x10280e[_0x17a6('0x34')],_0x10280e[_0x17a6('0x37')]);_0x1b89f3[_0x17a6('0x3a')]=_[_0x17a6('0x39')](_0x10280e[_0x17a6('0x34')],qs[_0x17a6('0x3b')](_0x2cded8[_0x17a6('0x37')][_0x17a6('0x3b')]));_0x1b89f3[_0x17a6('0x3a')]=_0x1b89f3[_0x17a6('0x3a')][_0x17a6('0x3c')]?_0x1b89f3[_0x17a6('0x3a')]:_0x10280e[_0x17a6('0x34')];_0x1b89f3['order']=qs[_0x17a6('0x3f')](_0x2cded8[_0x17a6('0x37')][_0x17a6('0x3f')]);_0x1b89f3[_0x17a6('0x40')]=qs[_0x17a6('0x38')](_[_0x17a6('0x41')](_0x2cded8[_0x17a6('0x37')],_0x10280e[_0x17a6('0x38')]));_0x1b89f3[_0x17a6('0x40')]=_[_0x17a6('0x43')](_0x1b89f3[_0x17a6('0x40')],{'$or':[{'ListId':_0x2f6712['id']},{'ListId':null}]});if(_0x2cded8['query'][_0x17a6('0x42')]){_0x1b89f3[_0x17a6('0x40')]=_[_0x17a6('0x43')](_0x1b89f3['where'],{'$or':_['map'](_0x1b89f3['attributes'],function(_0x3b3aff){var _0x449d4d={};_0x449d4d[_0x3b3aff]={'$like':'%'+_0x2cded8[_0x17a6('0x37')][_0x17a6('0x42')]+'%'};return _0x449d4d;})});}_0x1b89f3=_[_0x17a6('0x43')]({},_0x1b89f3,_0x2cded8[_0x17a6('0x45')]);return db[_0x17a6('0x6d')][_0x17a6('0x8c')](_0x1b89f3);}})[_0x17a6('0x29')](respondWithResult(_0x39e412,null))[_0x17a6('0x4c')](handleError(_0x39e412,null));};exports['addAgents']=function(_0x399a18,_0x2f9803,_0x422662){return db[_0x17a6('0x31')][_0x17a6('0x4b')]({'where':{'id':_0x399a18['params']['id']}})[_0x17a6('0x29')](handleEntityNotFound(_0x2f9803,null))[_0x17a6('0x29')](function(_0x1116a4){if(_0x1116a4){return _0x1116a4['addAgents'](_0x399a18['body']['ids'],_[_0x17a6('0x66')](_0x399a18[_0x17a6('0x4e')],['ids','id'])||{})[_0x17a6('0x8d')](function(_0x420c04){for(var _0x54007d=0x0;_0x54007d<_0x399a18[_0x17a6('0x4e')][_0x17a6('0x5f')][_0x17a6('0x3c')];_0x54007d+=0x1){socket['emit'](_0x17a6('0x8e'),{'UserId':Number(_0x399a18[_0x17a6('0x4e')][_0x17a6('0x5f')][_0x54007d]),'CmListId':Number(_0x399a18[_0x17a6('0x49')]['id'])});}return _0x420c04;});}})[_0x17a6('0x29')](respondWithResult(_0x2f9803,null))[_0x17a6('0x4c')](handleError(_0x2f9803,null));};exports['removeAgents']=function(_0x3f76d7,_0x1d364c,_0x44a427){return db[_0x17a6('0x31')]['find']({'where':{'id':_0x3f76d7[_0x17a6('0x49')]['id']}})['then'](handleEntityNotFound(_0x1d364c,null))[_0x17a6('0x29')](function(_0xea2d26){if(_0xea2d26){return _0xea2d26[_0x17a6('0x8f')](_0x3f76d7[_0x17a6('0x37')][_0x17a6('0x5f')])[_0x17a6('0x29')](function(){if(_[_0x17a6('0x64')](_0x3f76d7[_0x17a6('0x37')][_0x17a6('0x5f')])){for(var _0x5084fe=0x0;_0x5084fe<_0x3f76d7[_0x17a6('0x37')][_0x17a6('0x5f')][_0x17a6('0x3c')];_0x5084fe+=0x1){socket[_0x17a6('0x90')](_0x17a6('0x91'),{'UserId':Number(_0x3f76d7['query']['ids'][_0x5084fe]),'CmListId':Number(_0x3f76d7[_0x17a6('0x49')]['id'])});}}else{socket['emit'](_0x17a6('0x91'),{'UserId':Number(_0x3f76d7[_0x17a6('0x37')][_0x17a6('0x5f')]),'CmListId':Number(_0x3f76d7[_0x17a6('0x49')]['id'])});}});}})[_0x17a6('0x29')](respondWithStatusCode(_0x1d364c,null))['catch'](handleError(_0x1d364c,null));};exports[_0x17a6('0x92')]=function(_0x5a69e7,_0x212186,_0x196bd3){var _0x34c9f2={};var _0xfe2a82={};var _0x967573;var _0x5a9c35;return db[_0x17a6('0x31')][_0x17a6('0x5a')]({'where':{'id':_0x5a69e7['params']['id']}})['then'](handleEntityNotFound(_0x212186,null))[_0x17a6('0x29')](function(_0x51322b){if(_0x51322b){_0x967573=_0x51322b;_0xfe2a82[_0x17a6('0x34')]=_[_0x17a6('0x36')](db[_0x17a6('0x93')][_0x17a6('0x4a')]);_0xfe2a82[_0x17a6('0x37')]=_[_0x17a6('0x36')](_0x5a69e7[_0x17a6('0x37')]);_0xfe2a82[_0x17a6('0x38')]=_[_0x17a6('0x39')](_0xfe2a82['model'],_0xfe2a82[_0x17a6('0x37')]);_0x34c9f2[_0x17a6('0x3a')]=_[_0x17a6('0x39')](_0xfe2a82[_0x17a6('0x34')],qs[_0x17a6('0x3b')](_0x5a69e7[_0x17a6('0x37')][_0x17a6('0x3b')]));_0x34c9f2[_0x17a6('0x3a')]=_0x34c9f2[_0x17a6('0x3a')][_0x17a6('0x3c')]?_0x34c9f2[_0x17a6('0x3a')]:_0xfe2a82['model'];_0x34c9f2[_0x17a6('0x3e')]=qs[_0x17a6('0x3f')](_0x5a69e7['query'][_0x17a6('0x3f')]);_0x34c9f2['where']=qs[_0x17a6('0x38')](_[_0x17a6('0x41')](_0x5a69e7[_0x17a6('0x37')],_0xfe2a82[_0x17a6('0x38')]));if(_0x5a69e7[_0x17a6('0x37')][_0x17a6('0x42')]){_0x34c9f2['where']=_[_0x17a6('0x43')](_0x34c9f2[_0x17a6('0x40')],{'$or':_[_0x17a6('0x35')](_0x34c9f2[_0x17a6('0x3a')],function(_0x534188){var _0xe16be5={};_0xe16be5[_0x534188]={'$like':'%'+_0x5a69e7[_0x17a6('0x37')]['filter']+'%'};return _0xe16be5;})});}_0x34c9f2=_[_0x17a6('0x43')]({},_0x34c9f2,_0x5a69e7[_0x17a6('0x45')]);return _0x967573[_0x17a6('0x92')](_0x34c9f2);}})[_0x17a6('0x29')](function(_0x279bc6){if(_0x279bc6){_0x5a9c35=_0x279bc6[_0x17a6('0x3c')];if(!_0x5a69e7['query'][_0x17a6('0x3d')](_0x17a6('0x5c'))){_0x34c9f2[_0x17a6('0x23')]=qs[_0x17a6('0x23')](_0x5a69e7[_0x17a6('0x37')]['limit']);_0x34c9f2[_0x17a6('0x21')]=qs[_0x17a6('0x21')](_0x5a69e7['query'][_0x17a6('0x21')]);}return _0x967573[_0x17a6('0x92')](_0x34c9f2);}})[_0x17a6('0x29')](function(_0x4e67e8){if(_0x4e67e8){return _0x4e67e8?{'count':_0x5a9c35,'rows':_0x4e67e8}:null;}})['then'](respondWithResult(_0x212186,null))['catch'](handleError(_0x212186,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 9666ebc..a579e60 100644 --- a/server/api/cmList/cmList.events.js +++ b/server/api/cmList/cmList.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x5fc3,0xa8));var _0x35fc=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0x5fc3[_0x466bc5];return _0x138952;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var CmList=require(_0x35fc('0x1'))['db']['CmList'];var CmListEvents=new EventEmitter();CmListEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){CmListEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);CmListEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file +var _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x4e46cd,_0x21bb28){var _0x5902fa=function(_0x4f746c){while(--_0x4f746c){_0x4e46cd['push'](_0x4e46cd['shift']());}};_0x5902fa(++_0x21bb28);}(_0x814b,0x1a2));var _0xb814=function(_0x470b0a,_0x2889d6){_0x470b0a=_0x470b0a-0x0;var _0x4463f6=_0x814b[_0x470b0a];return _0x4463f6;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index a6834e1..0767304 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 _0x22fb=['define','CmList','../../config/logger','moment','bluebird','request-promise','path','rimraf','./cmList.attributes','exports'];(function(_0x1c3530,_0x5732b3){var _0xdc6024=function(_0x267409){while(--_0x267409){_0x1c3530['push'](_0x1c3530['shift']());}};_0xdc6024(++_0x5732b3);}(_0x22fb,0x192));var _0xb22f=function(_0x2826d3,_0x1d2dba){_0x2826d3=_0x2826d3-0x0;var _0x1f275e=_0x22fb[_0x2826d3];return _0x1f275e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb22f('0x0'))('api');var moment=require(_0xb22f('0x1'));var BPromise=require(_0xb22f('0x2'));var rp=require(_0xb22f('0x3'));var fs=require('fs');var path=require(_0xb22f('0x4'));var rimraf=require(_0xb22f('0x5'));var config=require('../../config/environment');var attributes=require(_0xb22f('0x6'));module[_0xb22f('0x7')]=function(_0x2d1fb3,_0xc3ffcc){return _0x2d1fb3[_0xb22f('0x8')](_0xb22f('0x9'),attributes,{'tableName':'cm_lists','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['rimraf','./cmList.attributes','exports','define','cm_lists','../../config/logger','api','moment','bluebird','path'];(function(_0x4e4634,_0x441806){var _0x1b108b=function(_0x211daf){while(--_0x211daf){_0x4e4634['push'](_0x4e4634['shift']());}};_0x1b108b(++_0x441806);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0xcb91[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('CmList',attributes,{'tableName':_0x1cb9('0x9'),'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 91cb50b..eda5d3f 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 _0x2a48=['register','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','code','error','message','result','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x412a72,_0x10284f){var _0x53e97f=function(_0x10d626){while(--_0x10d626){_0x412a72['push'](_0x412a72['shift']());}};_0x53e97f(++_0x10284f);}(_0x2a48,0x1ee));var _0x82a4=function(_0x328917,_0x977b28){_0x328917=_0x328917-0x0;var _0x15b349=_0x2a48[_0x328917];return _0x15b349;};'use strict';var _=require(_0x82a4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x82a4('0x1'));var rs=require(_0x82a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82a4('0x3'))['db'];var utils=require(_0x82a4('0x4'));var logger=require('../../config/logger')(_0x82a4('0x5'));var config=require('../../config/environment');var jayson=require(_0x82a4('0x6'));var client=jayson[_0x82a4('0x7')][_0x82a4('0x8')]({'port':0x232a});config[_0x82a4('0x9')]=_[_0x82a4('0xa')](config['redis'],{'host':_0x82a4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x82a4('0x9')]));require('./cmList.socket')[_0x82a4('0xc')](socket);function respondWithRpcPromise(_0x122bdf,_0x5acda,_0xc0148d){return new BPromise(function(_0x4eea7c,_0x1f5097){return client['request'](_0x122bdf,_0xc0148d)[_0x82a4('0xd')](function(_0x14eb5b){logger[_0x82a4('0xe')](_0x82a4('0xf'),_0x5acda,_0x82a4('0x10'));logger[_0x82a4('0x11')]('CmList,\x20%s,\x20%s,\x20%s',_0x5acda,_0x82a4('0x10'),JSON['stringify'](_0x14eb5b));if(_0x14eb5b['error']){if(_0x14eb5b['error'][_0x82a4('0x12')]===0x1f4){logger[_0x82a4('0x13')]('CmList,\x20%s,\x20%s',_0x5acda,_0x14eb5b[_0x82a4('0x13')][_0x82a4('0x14')]);return _0x1f5097(_0x14eb5b['error'][_0x82a4('0x14')]);}logger[_0x82a4('0x13')]('CmList,\x20%s,\x20%s',_0x5acda,_0x14eb5b[_0x82a4('0x13')][_0x82a4('0x14')]);return _0x4eea7c(_0x14eb5b[_0x82a4('0x13')][_0x82a4('0x14')]);}else{logger[_0x82a4('0xe')](_0x82a4('0xf'),_0x5acda,_0x82a4('0x10'));_0x4eea7c(_0x14eb5b[_0x82a4('0x15')][_0x82a4('0x14')]);}})['catch'](function(_0x4185e7){logger[_0x82a4('0x13')]('CmList,\x20%s,\x20%s',_0x5acda,_0x4185e7);_0x1f5097(_0x4185e7);});});} \ No newline at end of file +var _0xf5c1=['stringify','error','message','result','catch','lodash','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./cmList.socket','register','request','info','CmList,\x20%s,\x20%s','CmList,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x88ef7c,_0x2cf664){var _0x4a9b61=function(_0x3a29f7){while(--_0x3a29f7){_0x88ef7c['push'](_0x88ef7c['shift']());}};_0x4a9b61(++_0x2cf664);}(_0xf5c1,0x102));var _0x1f5c=function(_0x3a25ab,_0x32c7fe){_0x3a25ab=_0x3a25ab-0x0;var _0x512888=_0xf5c1[_0x3a25ab];return _0x512888;};'use strict';var _=require(_0x1f5c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1f5c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1f5c('0x2'));var logger=require(_0x1f5c('0x3'))(_0x1f5c('0x4'));var config=require('../../config/environment');var jayson=require(_0x1f5c('0x5'));var client=jayson[_0x1f5c('0x6')][_0x1f5c('0x7')]({'port':0x232a});config[_0x1f5c('0x8')]=_[_0x1f5c('0x9')](config['redis'],{'host':_0x1f5c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f5c('0x8')]));require(_0x1f5c('0xb'))[_0x1f5c('0xc')](socket);function respondWithRpcPromise(_0x28cec4,_0x32b4f9,_0x1021be){return new BPromise(function(_0x698889,_0x19a06a){return client[_0x1f5c('0xd')](_0x28cec4,_0x1021be)['then'](function(_0x10b3dd){logger[_0x1f5c('0xe')](_0x1f5c('0xf'),_0x32b4f9,'request\x20sent');logger['debug'](_0x1f5c('0x10'),_0x32b4f9,_0x1f5c('0x11'),JSON[_0x1f5c('0x12')](_0x10b3dd));if(_0x10b3dd[_0x1f5c('0x13')]){if(_0x10b3dd[_0x1f5c('0x13')]['code']===0x1f4){logger[_0x1f5c('0x13')](_0x1f5c('0xf'),_0x32b4f9,_0x10b3dd[_0x1f5c('0x13')][_0x1f5c('0x14')]);return _0x19a06a(_0x10b3dd[_0x1f5c('0x13')]['message']);}logger[_0x1f5c('0x13')](_0x1f5c('0xf'),_0x32b4f9,_0x10b3dd[_0x1f5c('0x13')][_0x1f5c('0x14')]);return _0x698889(_0x10b3dd['error'][_0x1f5c('0x14')]);}else{logger[_0x1f5c('0xe')](_0x1f5c('0xf'),_0x32b4f9,'request\x20sent');_0x698889(_0x10b3dd[_0x1f5c('0x15')][_0x1f5c('0x14')]);}})[_0x1f5c('0x16')](function(_0x54e014){logger['error'](_0x1f5c('0xf'),_0x32b4f9,_0x54e014);_0x19a06a(_0x54e014);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 149fd35..097680b 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 _0x7715=['length','cmList:','./cmList.events','remove','update','removeListener','register'];(function(_0x5ceff3,_0x2cb590){var _0x8ecbf3=function(_0x342ac1){while(--_0x342ac1){_0x5ceff3['push'](_0x5ceff3['shift']());}};_0x8ecbf3(++_0x2cb590);}(_0x7715,0xbf));var _0x5771=function(_0x4520da,_0x26041e){_0x4520da=_0x4520da-0x0;var _0x396740=_0x7715[_0x4520da];return _0x396740;};'use strict';var CmListEvents=require(_0x5771('0x0'));var events=['save',_0x5771('0x1'),_0x5771('0x2')];function createListener(_0x337b8d,_0x2307db){return function(_0x422122){_0x2307db['emit'](_0x337b8d,_0x422122);};}function removeListener(_0x8242be,_0x39ea41){return function(){CmListEvents[_0x5771('0x3')](_0x8242be,_0x39ea41);};}exports[_0x5771('0x4')]=function(_0x187da0){for(var _0x374fb6=0x0,_0x421123=events[_0x5771('0x5')];_0x374fb6<_0x421123;_0x374fb6++){var _0x565a54=events[_0x374fb6];var _0x5ce08f=createListener(_0x5771('0x6')+_0x565a54,_0x187da0);CmListEvents['on'](_0x565a54,_0x5ce08f);}}; \ No newline at end of file +var _0xefba=['length','cmList:','./cmList.events','save','remove','update','emit','removeListener','register'];(function(_0x555ee1,_0x243524){var _0x13d82f=function(_0x419411){while(--_0x419411){_0x555ee1['push'](_0x555ee1['shift']());}};_0x13d82f(++_0x243524);}(_0xefba,0x17c));var _0xaefb=function(_0x137c34,_0x2ebd98){_0x137c34=_0x137c34-0x0;var _0x145d9b=_0xefba[_0x137c34];return _0x145d9b;};'use strict';var CmListEvents=require(_0xaefb('0x0'));var events=[_0xaefb('0x1'),_0xaefb('0x2'),_0xaefb('0x3')];function createListener(_0x6b8ee7,_0x13211b){return function(_0x33a4f2){_0x13211b[_0xaefb('0x4')](_0x6b8ee7,_0x33a4f2);};}function removeListener(_0xe6925a,_0x1c8a41){return function(){CmListEvents[_0xaefb('0x5')](_0xe6925a,_0x1c8a41);};}exports[_0xaefb('0x6')]=function(_0x48906d){for(var _0x418691=0x0,_0x26ab2e=events[_0xaefb('0x7')];_0x418691<_0x26ab2e;_0x418691++){var _0x41047a=events[_0x418691];var _0x4a161f=createListener(_0xaefb('0x8')+_0x41047a,_0x48906d);CmListEvents['on'](_0x41047a,_0x4a161f);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 7ecd320..0150b98 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 _0x0eb9=['Router','fs-extra','../../components/auth/service','./cmList.controller','isAuthenticated','index','get','/describe','describe','show','getDispositions','/:id/contacts','/:id/contacts/csv','getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','/:id/dispositions','addContacts','addCustomField','addAgents','put','/:id','delete','removeAgents','exports','multer','util','path','express'];(function(_0xd61dd8,_0x429236){var _0x4654d2=function(_0x496e76){while(--_0x496e76){_0xd61dd8['push'](_0xd61dd8['shift']());}};_0x4654d2(++_0x429236);}(_0x0eb9,0x1eb));var _0x90eb=function(_0x2b9e76,_0x467e25){_0x2b9e76=_0x2b9e76-0x0;var _0x4c014e=_0x0eb9[_0x2b9e76];return _0x4c014e;};'use strict';var multer=require(_0x90eb('0x0'));var util=require(_0x90eb('0x1'));var path=require(_0x90eb('0x2'));var timeout=require('connect-timeout');var express=require(_0x90eb('0x3'));var router=express[_0x90eb('0x4')]();var fs_extra=require(_0x90eb('0x5'));var auth=require(_0x90eb('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x90eb('0x7'));router['get']('/',auth[_0x90eb('0x8')](),controller[_0x90eb('0x9')]);router[_0x90eb('0xa')](_0x90eb('0xb'),auth[_0x90eb('0x8')](),controller[_0x90eb('0xc')]);router[_0x90eb('0xa')]('/:id',auth[_0x90eb('0x8')](),controller[_0x90eb('0xd')]);router['get']('/:id/dispositions',auth[_0x90eb('0x8')](),controller[_0x90eb('0xe')]);router[_0x90eb('0xa')](_0x90eb('0xf'),auth[_0x90eb('0x8')](),controller['getContacts']);router[_0x90eb('0xa')](_0x90eb('0x10'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x11')]);router['get'](_0x90eb('0x12'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x13')]);router[_0x90eb('0xa')](_0x90eb('0x14'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x15')]);router[_0x90eb('0x16')]('/',auth[_0x90eb('0x8')](),controller[_0x90eb('0x17')]);router[_0x90eb('0x16')](_0x90eb('0x18'),auth[_0x90eb('0x8')](),controller['addDisposition']);router['post'](_0x90eb('0xf'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x19')]);router[_0x90eb('0x16')](_0x90eb('0x12'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x1a')]);router['post']('/:id/users',auth[_0x90eb('0x8')](),controller[_0x90eb('0x1b')]);router[_0x90eb('0x1c')](_0x90eb('0x1d'),auth[_0x90eb('0x8')](),controller['update']);router['delete'](_0x90eb('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0x90eb('0x1e')](_0x90eb('0x18'),auth[_0x90eb('0x8')](),controller['removeDispositions']);router[_0x90eb('0x1e')](_0x90eb('0x14'),auth[_0x90eb('0x8')](),controller[_0x90eb('0x1f')]);module[_0x90eb('0x20')]=router; \ No newline at end of file +var _0x9629=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','/:id/users','getAgents','post','create','addDisposition','/:id/fields','addCustomField','put','update','delete','/:id','destroy','removeDispositions'];(function(_0x4e8565,_0x1747bb){var _0x382923=function(_0x33b9a9){while(--_0x33b9a9){_0x4e8565['push'](_0x4e8565['shift']());}};_0x382923(++_0x1747bb);}(_0x9629,0x117));var _0x9962=function(_0x549df1,_0x42de3f){_0x549df1=_0x549df1-0x0;var _0x17d8b0=_0x9629[_0x549df1];return _0x17d8b0;};'use strict';var multer=require(_0x9962('0x0'));var util=require(_0x9962('0x1'));var path=require(_0x9962('0x2'));var timeout=require(_0x9962('0x3'));var express=require(_0x9962('0x4'));var router=express[_0x9962('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x9962('0x6'));var interaction=require(_0x9962('0x7'));var config=require(_0x9962('0x8'));var controller=require('./cmList.controller');router[_0x9962('0x9')]('/',auth[_0x9962('0xa')](),controller[_0x9962('0xb')]);router[_0x9962('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x9962('0xc')]);router[_0x9962('0x9')]('/:id',auth[_0x9962('0xa')](),controller['show']);router['get'](_0x9962('0xd'),auth[_0x9962('0xa')](),controller[_0x9962('0xe')]);router['get'](_0x9962('0xf'),auth[_0x9962('0xa')](),controller[_0x9962('0x10')]);router[_0x9962('0x9')](_0x9962('0x11'),auth['isAuthenticated'](),controller['getContactsCsv']);router[_0x9962('0x9')]('/:id/fields',auth[_0x9962('0xa')](),controller['getCustomFields']);router[_0x9962('0x9')](_0x9962('0x12'),auth[_0x9962('0xa')](),controller[_0x9962('0x13')]);router[_0x9962('0x14')]('/',auth[_0x9962('0xa')](),controller[_0x9962('0x15')]);router['post']('/:id/dispositions',auth[_0x9962('0xa')](),controller[_0x9962('0x16')]);router['post'](_0x9962('0xf'),auth['isAuthenticated'](),controller['addContacts']);router[_0x9962('0x14')](_0x9962('0x17'),auth['isAuthenticated'](),controller[_0x9962('0x18')]);router[_0x9962('0x14')](_0x9962('0x12'),auth['isAuthenticated'](),controller['addAgents']);router[_0x9962('0x19')]('/:id',auth[_0x9962('0xa')](),controller[_0x9962('0x1a')]);router[_0x9962('0x1b')](_0x9962('0x1c'),auth[_0x9962('0xa')](),controller[_0x9962('0x1d')]);router[_0x9962('0x1b')](_0x9962('0xd'),auth['isAuthenticated'](),controller[_0x9962('0x1e')]);router[_0x9962('0x1b')](_0x9962('0x12'),auth[_0x9962('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index e945c7f..29c1d34 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 _0x43dc=['STRING','sequelize','exports','getDataValue','field'];(function(_0x5aba6e,_0x3769bb){var _0x201933=function(_0x244e2a){while(--_0x244e2a){_0x5aba6e['push'](_0x5aba6e['shift']());}};_0x201933(++_0x3769bb);}(_0x43dc,0x12d));var _0xc43d=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0x43dc[_0xac151d];return _0x111dba;};'use strict';var Sequelize=require(_0xc43d('0x0'));module[_0xc43d('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x235776){return this[_0xc43d('0x2')](_0xc43d('0x3'));}},'field':{'type':Sequelize[_0xc43d('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0xc43d('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0xc43d('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x0fcd=['exports','VIRTUAL','STRING','sequelize'];(function(_0x474a40,_0x3377aa){var _0x21f947=function(_0xfe8aba){while(--_0xfe8aba){_0x474a40['push'](_0x474a40['shift']());}};_0x21f947(++_0x3377aa);}(_0x0fcd,0x13f));var _0xd0fc=function(_0x11efa2,_0x5b60ba){_0x11efa2=_0x11efa2-0x0;var _0x1b23bf=_0x0fcd[_0x11efa2];return _0x1b23bf;};'use strict';var Sequelize=require(_0xd0fc('0x0'));module[_0xd0fc('0x1')]={'name':{'type':Sequelize[_0xd0fc('0x2')],'get':function(_0x4a889d){return this['getDataValue']('field');}},'field':{'type':Sequelize[_0xd0fc('0x3')],'allowNull':![]},'operator':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xd0fc('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 1447c49..271f77d 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x6a2080,_0x31c2f0){var _0x2110b0=function(_0x568b63){while(--_0x568b63){_0x6a2080['push'](_0x6a2080['shift']());}};_0x2110b0(++_0x31c2f0);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){if(_0x4b6f99['body']['id']){delete _0x4b6f99[_0x7995('0x2c')]['id'];}return db[_0x7995('0x2d')][_0x7995('0x2e')]({'where':{'id':_0x4b6f99['params']['id']}})['then'](handleEntityNotFound(_0x9b2a15,null))['then'](saveUpdates(_0x4b6f99[_0x7995('0x2c')],null))[_0x7995('0x26')](respondWithResult(_0x9b2a15,null))[_0x7995('0x2f')](handleError(_0x9b2a15,null));};exports[_0x7995('0x27')]=function(_0x2e3493,_0x1ca460){return db['Condition']['find']({'where':{'id':_0x2e3493[_0x7995('0x30')]['id']}})['then'](handleEntityNotFound(_0x1ca460,null))[_0x7995('0x26')](removeEntity(_0x1ca460,null))[_0x7995('0x2f')](handleError(_0x1ca460,null));}; \ No newline at end of file +var _0x9957=['eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','update','body','Condition','find','catch','params'];(function(_0x280734,_0xba49f9){var _0x220d34=function(_0x532f20){while(--_0x532f20){_0x280734['push'](_0x280734['shift']());}};_0x220d34(++_0xba49f9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 f427d62..227087f 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 _0x1f8e=['Condition','lodash','../../config/logger','api','bluebird','request-promise','path','../../config/environment','define'];(function(_0xcb854f,_0x478d37){var _0x348504=function(_0x1ec1ec){while(--_0x1ec1ec){_0xcb854f['push'](_0xcb854f['shift']());}};_0x348504(++_0x478d37);}(_0x1f8e,0x1de));var _0xe1f8=function(_0x1ca9e9,_0x1c4391){_0x1ca9e9=_0x1ca9e9-0x0;var _0x309f3c=_0x1f8e[_0x1ca9e9];return _0x309f3c;};'use strict';var _=require(_0xe1f8('0x0'));var util=require('util');var logger=require(_0xe1f8('0x1'))(_0xe1f8('0x2'));var moment=require('moment');var BPromise=require(_0xe1f8('0x3'));var rp=require(_0xe1f8('0x4'));var fs=require('fs');var path=require(_0xe1f8('0x5'));var rimraf=require('rimraf');var config=require(_0xe1f8('0x6'));var attributes=require('./condition.attributes');module['exports']=function(_0x46412a,_0x2db7a2){return _0x46412a[_0xe1f8('0x7')](_0xe1f8('0x8'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x83e2=['define','tools_conditions','util','../../config/logger','api','bluebird','../../config/environment','./condition.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x83e2,0x9b));var _0x283e=function(_0x705b98,_0x1c345b){_0x705b98=_0x705b98-0x0;var _0x47b72f=_0x83e2[_0x705b98];return _0x47b72f;};'use strict';var _=require('lodash');var util=require(_0x283e('0x0'));var logger=require(_0x283e('0x1'))(_0x283e('0x2'));var moment=require('moment');var BPromise=require(_0x283e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x283e('0x4'));var attributes=require(_0x283e('0x5'));module[_0x283e('0x6')]=function(_0x9f8faa,_0x2bf5ab){return _0x9f8faa[_0x283e('0x7')]('Condition',attributes,{'tableName':_0x283e('0x8'),'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 7d2d000..918dbd3 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 _0xbc79=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','message','Condition,\x20%s,\x20%s'];(function(_0x530073,_0x383030){var _0x194a5e=function(_0x3ecbbb){while(--_0x3ecbbb){_0x530073['push'](_0x530073['shift']());}};_0x194a5e(++_0x383030);}(_0xbc79,0x121));var _0x9bc7=function(_0x403e3a,_0x537ec3){_0x403e3a=_0x403e3a-0x0;var _0x517897=_0xbc79[_0x403e3a];return _0x517897;};'use strict';var _=require(_0x9bc7('0x0'));var util=require(_0x9bc7('0x1'));var moment=require(_0x9bc7('0x2'));var BPromise=require(_0x9bc7('0x3'));var rs=require(_0x9bc7('0x4'));var fs=require('fs');var Redis=require(_0x9bc7('0x5'));var db=require(_0x9bc7('0x6'))['db'];var utils=require(_0x9bc7('0x7'));var logger=require('../../config/logger')(_0x9bc7('0x8'));var config=require(_0x9bc7('0x9'));var jayson=require(_0x9bc7('0xa'));var client=jayson[_0x9bc7('0xb')][_0x9bc7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x19d67c,_0x37d0e0,_0x57022f){return new BPromise(function(_0xf284f2,_0xf3f284){return client[_0x9bc7('0xd')](_0x19d67c,_0x57022f)[_0x9bc7('0xe')](function(_0x242385){logger[_0x9bc7('0xf')]('Condition,\x20%s,\x20%s',_0x37d0e0,_0x9bc7('0x10'));logger[_0x9bc7('0x11')]('Condition,\x20%s,\x20%s,\x20%s',_0x37d0e0,_0x9bc7('0x10'),JSON[_0x9bc7('0x12')](_0x242385));if(_0x242385[_0x9bc7('0x13')]){if(_0x242385[_0x9bc7('0x13')][_0x9bc7('0x14')]===0x1f4){logger[_0x9bc7('0x13')]('Condition,\x20%s,\x20%s',_0x37d0e0,_0x242385[_0x9bc7('0x13')][_0x9bc7('0x15')]);return _0xf3f284(_0x242385['error']['message']);}logger[_0x9bc7('0x13')](_0x9bc7('0x16'),_0x37d0e0,_0x242385[_0x9bc7('0x13')][_0x9bc7('0x15')]);return _0xf284f2(_0x242385[_0x9bc7('0x13')][_0x9bc7('0x15')]);}else{logger[_0x9bc7('0xf')]('Condition,\x20%s,\x20%s',_0x37d0e0,_0x9bc7('0x10'));_0xf284f2(_0x242385['result'][_0x9bc7('0x15')]);}})[_0x9bc7('0x17')](function(_0x416fef){logger[_0x9bc7('0x13')](_0x9bc7('0x16'),_0x37d0e0,_0x416fef);_0xf3f284(_0x416fef);});});} \ No newline at end of file +var _0x02c3=['request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http'];(function(_0x289ce7,_0x249b05){var _0x508231=function(_0x3dbb9e){while(--_0x3dbb9e){_0x289ce7['push'](_0x289ce7['shift']());}};_0x508231(++_0x249b05);}(_0x02c3,0x89));var _0x302c=function(_0x516d0e,_0x449567){_0x516d0e=_0x516d0e-0x0;var _0xd7922c=_0x02c3[_0x516d0e];return _0xd7922c;};'use strict';var _=require(_0x302c('0x0'));var util=require('util');var moment=require(_0x302c('0x1'));var BPromise=require(_0x302c('0x2'));var rs=require(_0x302c('0x3'));var fs=require('fs');var Redis=require(_0x302c('0x4'));var db=require(_0x302c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x302c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x302c('0x7'));var client=jayson[_0x302c('0x8')][_0x302c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe9d4f6,_0x5f3332,_0x4d810e){return new BPromise(function(_0x357e1a,_0x1adf3d){return client[_0x302c('0xa')](_0xe9d4f6,_0x4d810e)['then'](function(_0x55ff5b){logger[_0x302c('0xb')](_0x302c('0xc'),_0x5f3332,_0x302c('0xd'));logger[_0x302c('0xe')](_0x302c('0xf'),_0x5f3332,_0x302c('0xd'),JSON[_0x302c('0x10')](_0x55ff5b));if(_0x55ff5b[_0x302c('0x11')]){if(_0x55ff5b[_0x302c('0x11')][_0x302c('0x12')]===0x1f4){logger[_0x302c('0x11')]('Condition,\x20%s,\x20%s',_0x5f3332,_0x55ff5b[_0x302c('0x11')][_0x302c('0x13')]);return _0x1adf3d(_0x55ff5b[_0x302c('0x11')][_0x302c('0x13')]);}logger['error'](_0x302c('0xc'),_0x5f3332,_0x55ff5b[_0x302c('0x11')]['message']);return _0x357e1a(_0x55ff5b[_0x302c('0x11')][_0x302c('0x13')]);}else{logger[_0x302c('0xb')]('Condition,\x20%s,\x20%s',_0x5f3332,_0x302c('0xd'));_0x357e1a(_0x55ff5b['result'][_0x302c('0x13')]);}})[_0x302c('0x14')](function(_0x389b97){logger[_0x302c('0x11')]('Condition,\x20%s,\x20%s',_0x5f3332,_0x389b97);_0x1adf3d(_0x389b97);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index d3a59f6..4659970 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 _0xe30d=['../../components/interaction/service','./condition.controller','put','/:id','isAuthenticated','update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x1ea5e2,_0x382cec){var _0x39380c=function(_0x27893b){while(--_0x27893b){_0x1ea5e2['push'](_0x1ea5e2['shift']());}};_0x39380c(++_0x382cec);}(_0xe30d,0x13b));var _0xde30=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe30d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xde30('0x0'));var util=require(_0xde30('0x1'));var path=require(_0xde30('0x2'));var timeout=require('connect-timeout');var express=require(_0xde30('0x3'));var router=express[_0xde30('0x4')]();var fs_extra=require(_0xde30('0x5'));var auth=require(_0xde30('0x6'));var interaction=require(_0xde30('0x7'));var config=require('../../config/environment');var controller=require(_0xde30('0x8'));router[_0xde30('0x9')](_0xde30('0xa'),auth[_0xde30('0xb')](),controller[_0xde30('0xc')]);router['delete'](_0xde30('0xa'),auth[_0xde30('0xb')](),controller['destroy']);module[_0xde30('0xd')]=router; \ No newline at end of file +var _0xc569=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x1f34c9,_0x3ba010){var _0x1fcdac=function(_0x3cba44){while(--_0x3cba44){_0x1f34c9['push'](_0x1f34c9['shift']());}};_0x1fcdac(++_0x3ba010);}(_0xc569,0x1f1));var _0x9c56=function(_0x4944dc,_0x21b668){_0x4944dc=_0x4944dc-0x0;var _0x238917=_0xc569[_0x4944dc];return _0x238917;};'use strict';var multer=require(_0x9c56('0x0'));var util=require(_0x9c56('0x1'));var path=require(_0x9c56('0x2'));var timeout=require(_0x9c56('0x3'));var express=require(_0x9c56('0x4'));var router=express[_0x9c56('0x5')]();var fs_extra=require(_0x9c56('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x9c56('0x7'));var config=require(_0x9c56('0x8'));var controller=require(_0x9c56('0x9'));router[_0x9c56('0xa')](_0x9c56('0xb'),auth[_0x9c56('0xc')](),controller[_0x9c56('0xd')]);router[_0x9c56('0xe')](_0x9c56('0xb'),auth[_0x9c56('0xc')](),controller[_0x9c56('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 3567899..c7e373e 100644 --- a/server/api/dashboard/dashboard.attributes.js +++ b/server/api/dashboard/dashboard.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['STRING','sequelize'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xb7e7,0x121));var _0x7b7e=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xb7e7[_0x4d8ed9];return _0x1e2140;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0xb7e7=['STRING','sequelize'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0xb7e7,0x121));var _0x7b7e=function(_0x186376,_0x5d988a){_0x186376=_0x186376-0x0;var _0x2dbdd9=_0xb7e7[_0x186376];return _0x2dbdd9;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 533f3df..a445fdb 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 _0x27bb=['crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./dashboard.socket','register','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','get','CustomDashboards','UserProfileResource','sendStatus','error','stack','name','index','map','Dashboard','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','findAll','catch','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','find','omit','updatedAt','createdAt','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie2','attrSerie3','voice','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x27bb,0x70));var _0xb27b=function(_0x5f1731,_0x3d329c){_0x5f1731=_0x5f1731-0x0;var _0x3cdd96=_0x27bb[_0x5f1731];return _0x3cdd96;};'use strict';var emlformat=require(_0xb27b('0x0'));var rimraf=require(_0xb27b('0x1'));var zipdir=require(_0xb27b('0x2'));var jsonpatch=require(_0xb27b('0x3'));var rp=require(_0xb27b('0x4'));var moment=require(_0xb27b('0x5'));var BPromise=require(_0xb27b('0x6'));var Mustache=require(_0xb27b('0x7'));var util=require(_0xb27b('0x8'));var path=require('path');var sox=require(_0xb27b('0x9'));var csv=require(_0xb27b('0xa'));var ejs=require(_0xb27b('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb27b('0xc'));var squel=require(_0xb27b('0xd'));var crypto=require(_0xb27b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xb27b('0xf'));var toCsv=require(_0xb27b('0xa'));var querystring=require('querystring');var Papa=require(_0xb27b('0x10'));var Redis=require(_0xb27b('0x11'));var authService=require(_0xb27b('0x12'));var qs=require(_0xb27b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb27b('0x14'));var logger=require(_0xb27b('0x15'))('api');var utils=require(_0xb27b('0x16'));var config=require(_0xb27b('0x17'));var licenseUtil=require(_0xb27b('0x18'));var db=require('../../mysqldb')['db'];config[_0xb27b('0x19')]=_['defaults'](config[_0xb27b('0x19')],{'host':_0xb27b('0x1a'),'port':0x18eb});var socket=require(_0xb27b('0x1b'))(new Redis(config['redis']));require(_0xb27b('0x1c'))[_0xb27b('0x1d')](socket);function respondWithStatusCode(_0x4b2a38,_0x31a9fe){_0x31a9fe=_0x31a9fe||0xcc;return function(_0x54218d){if(_0x54218d){return _0x4b2a38['sendStatus'](_0x31a9fe);}return _0x4b2a38[_0xb27b('0x1e')](_0x31a9fe)['end']();};}function respondWithResult(_0x4458b7,_0x4cb4a4){_0x4cb4a4=_0x4cb4a4||0xc8;return function(_0x3c4242){if(_0x3c4242){return _0x4458b7['status'](_0x4cb4a4)[_0xb27b('0x1f')](_0x3c4242);}};}function respondWithFilteredResult(_0x2404f1,_0xfa17db){return function(_0x543e45){if(_0x543e45){var _0x2d5499=typeof _0xfa17db[_0xb27b('0x20')]==='undefined'&&typeof _0xfa17db[_0xb27b('0x21')]===_0xb27b('0x22');var _0x3e3127=_0x543e45['count'];var _0x429aa0=_0x2d5499?0x0:_0xfa17db[_0xb27b('0x20')];var _0x297efe=_0x2d5499?_0x543e45[_0xb27b('0x23')]:_0xfa17db[_0xb27b('0x20')]+_0xfa17db[_0xb27b('0x21')];var _0x402831;if(_0x297efe>=_0x3e3127){_0x297efe=_0x3e3127;_0x402831=0xc8;}else{_0x402831=0xce;}_0x2404f1['status'](_0x402831);return _0x2404f1[_0xb27b('0x24')](_0xb27b('0x25'),_0x429aa0+'-'+_0x297efe+'/'+_0x3e3127)[_0xb27b('0x1f')](_0x543e45);}return null;};}function patchUpdates(_0x3cbe3e){return function(_0x419226){try{jsonpatch['apply'](_0x419226,_0x3cbe3e,!![]);}catch(_0x2e8c7b){return BPromise[_0xb27b('0x26')](_0x2e8c7b);}return _0x419226[_0xb27b('0x27')]();};}function saveUpdates(_0x21eb0c,_0x342453){return function(_0x5e2e0d){if(_0x5e2e0d){return _0x5e2e0d[_0xb27b('0x28')](_0x21eb0c)['then'](function(_0x5d1e12){return _0x5d1e12;});}return null;};}function removeEntity(_0x3eb041,_0x3e34bb){return function(_0x6a1372){if(_0x6a1372){return _0x6a1372[_0xb27b('0x29')]()[_0xb27b('0x2a')](function(){var _0x1dc403=_0x6a1372[_0xb27b('0x2b')]({'plain':!![]});var _0xf08cb8=_0xb27b('0x2c');return db[_0xb27b('0x2d')][_0xb27b('0x29')]({'where':{'type':_0xf08cb8,'resourceId':_0x1dc403['id']}})[_0xb27b('0x2a')](function(){return _0x6a1372;});})[_0xb27b('0x2a')](function(){_0x3eb041[_0xb27b('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53fb28,_0x1c5900){return function(_0x26a1ed){if(!_0x26a1ed){_0x53fb28[_0xb27b('0x2e')](0x194);}return _0x26a1ed;};}function handleError(_0x442053,_0x5138d7){_0x5138d7=_0x5138d7||0x1f4;return function(_0x3e6231){logger[_0xb27b('0x2f')](_0x3e6231[_0xb27b('0x30')]);if(_0x3e6231[_0xb27b('0x31')]){delete _0x3e6231[_0xb27b('0x31')];}_0x442053[_0xb27b('0x1e')](_0x5138d7)['send'](_0x3e6231);};}exports[_0xb27b('0x32')]=function(_0x532516,_0x2e7bc9){var _0x21320f={},_0x36b725={},_0x598eb9={'count':0x0,'rows':[]};var _0x48487d=_[_0xb27b('0x33')](db[_0xb27b('0x34')][_0xb27b('0x35')],function(_0x37c00d){return{'name':_0x37c00d[_0xb27b('0x36')],'type':_0x37c00d[_0xb27b('0x37')]['key']};});_0x36b725[_0xb27b('0x38')]=_[_0xb27b('0x33')](_0x48487d,'name');_0x36b725[_0xb27b('0x39')]=_[_0xb27b('0x3a')](_0x532516['query']);_0x36b725[_0xb27b('0x3b')]=_['intersection'](_0x36b725[_0xb27b('0x38')],_0x36b725[_0xb27b('0x39')]);_0x21320f[_0xb27b('0x3c')]=_[_0xb27b('0x3d')](_0x36b725[_0xb27b('0x38')],qs[_0xb27b('0x3e')](_0x532516['query']['fields']));_0x21320f[_0xb27b('0x3c')]=_0x21320f['attributes'][_0xb27b('0x3f')]?_0x21320f[_0xb27b('0x3c')]:_0x36b725[_0xb27b('0x38')];if(!_0x532516[_0xb27b('0x39')]['hasOwnProperty'](_0xb27b('0x40'))){_0x21320f[_0xb27b('0x21')]=qs[_0xb27b('0x21')](_0x532516[_0xb27b('0x39')][_0xb27b('0x21')]);_0x21320f[_0xb27b('0x20')]=qs[_0xb27b('0x20')](_0x532516[_0xb27b('0x39')][_0xb27b('0x20')]);}_0x21320f[_0xb27b('0x41')]=qs[_0xb27b('0x42')](_0x532516[_0xb27b('0x39')][_0xb27b('0x42')]);_0x21320f[_0xb27b('0x43')]=qs['filters'](_['pick'](_0x532516['query'],_0x36b725[_0xb27b('0x3b')]),_0x48487d);if(_0x532516[_0xb27b('0x39')][_0xb27b('0x44')]){_0x21320f[_0xb27b('0x43')]=_['merge'](_0x21320f['where'],{'$or':_['map'](_0x48487d,function(_0x32ca8b){if(_0x32ca8b['type']!==_0xb27b('0x45')){var _0x239921={};_0x239921[_0x32ca8b[_0xb27b('0x31')]]={'$like':'%'+_0x532516['query']['filter']+'%'};return _0x239921;}})});}_0x21320f=_[_0xb27b('0x46')]({},_0x21320f,_0x532516['options']);var _0xf97965={'where':_0x21320f[_0xb27b('0x43')]};return db[_0xb27b('0x34')][_0xb27b('0x23')](_0xf97965)[_0xb27b('0x2a')](function(_0x561e76){_0x598eb9[_0xb27b('0x23')]=_0x561e76;if(_0x532516['query'][_0xb27b('0x47')]){_0x21320f[_0xb27b('0x48')]=[{'all':!![]}];}return db[_0xb27b('0x34')][_0xb27b('0x49')](_0x21320f);})[_0xb27b('0x2a')](function(_0x3e6768){_0x598eb9['rows']=_0x3e6768;return _0x598eb9;})['then'](respondWithFilteredResult(_0x2e7bc9,_0x21320f))[_0xb27b('0x4a')](handleError(_0x2e7bc9,null));};exports['show']=function(_0x2f61d5,_0x1013e9){var _0xf945d5={'raw':![],'where':{'id':_0x2f61d5['params']['id']}},_0x1e93e1={};_0x1e93e1[_0xb27b('0x38')]=_[_0xb27b('0x3a')](db[_0xb27b('0x34')]['rawAttributes']);_0x1e93e1[_0xb27b('0x39')]=_[_0xb27b('0x3a')](_0x2f61d5[_0xb27b('0x39')]);_0x1e93e1['filters']=_[_0xb27b('0x3d')](_0x1e93e1[_0xb27b('0x38')],_0x1e93e1[_0xb27b('0x39')]);_0xf945d5[_0xb27b('0x3c')]=_[_0xb27b('0x3d')](_0x1e93e1[_0xb27b('0x38')],qs[_0xb27b('0x3e')](_0x2f61d5[_0xb27b('0x39')][_0xb27b('0x3e')]));_0xf945d5[_0xb27b('0x3c')]=_0xf945d5[_0xb27b('0x3c')][_0xb27b('0x3f')]?_0xf945d5[_0xb27b('0x3c')]:_0x1e93e1[_0xb27b('0x38')];if(_0x2f61d5[_0xb27b('0x39')][_0xb27b('0x47')]){_0xf945d5[_0xb27b('0x48')]=[{'all':!![]}];}_0xf945d5=_['merge']({},_0xf945d5,_0x2f61d5[_0xb27b('0x4b')]);return db[_0xb27b('0x34')]['find'](_0xf945d5)[_0xb27b('0x2a')](handleEntityNotFound(_0x1013e9,null))['then'](respondWithResult(_0x1013e9,null))[_0xb27b('0x4a')](handleError(_0x1013e9,null));};exports[_0xb27b('0x4c')]=function(_0xcf141f,_0x5d370a){return db[_0xb27b('0x34')][_0xb27b('0x4c')](_0xcf141f[_0xb27b('0x4d')],{})[_0xb27b('0x2a')](function(_0x457a27){var _0x376dc=_0xcf141f[_0xb27b('0x4e')][_0xb27b('0x2b')]({'plain':!![]});if(!_0x376dc)throw new Error(_0xb27b('0x4f'));if(_0x376dc[_0xb27b('0x50')]===_0xb27b('0x4e')){var _0xb78377=_0x457a27[_0xb27b('0x2b')]({'plain':!![]});var _0x212474=_0xb27b('0x2c');return db[_0xb27b('0x51')]['find']({'where':{'name':_0x212474,'userProfileId':_0x376dc[_0xb27b('0x52')]},'raw':!![]})[_0xb27b('0x2a')](function(_0x3f84ef){if(_0x3f84ef&&_0x3f84ef[_0xb27b('0x53')]===0x0){return db[_0xb27b('0x2d')][_0xb27b('0x4c')]({'name':_0xb78377[_0xb27b('0x31')],'resourceId':_0xb78377['id'],'type':_0x3f84ef['name'],'sectionId':_0x3f84ef['id']},{})[_0xb27b('0x2a')](function(){return _0x457a27;});}else{return _0x457a27;}})[_0xb27b('0x4a')](function(_0xeaeba2){logger[_0xb27b('0x2f')](_0xb27b('0x54'),_0xeaeba2);throw _0xeaeba2;});}return _0x457a27;})['then'](respondWithResult(_0x5d370a,0xc9))[_0xb27b('0x4a')](handleError(_0x5d370a,null));};exports['clone']=function(_0xbe277,_0xc8661f){var _0x485028={'where':{'id':_0xbe277[_0xb27b('0x55')]['id']}},_0x537512={};_0x537512['model']=_['keys'](db[_0xb27b('0x34')]['rawAttributes']);_0x485028[_0xb27b('0x3c')]=_[_0xb27b('0x3d')](_0x537512[_0xb27b('0x38')],qs[_0xb27b('0x3e')](_0xbe277[_0xb27b('0x39')]['fields']));_0x485028[_0xb27b('0x3c')]=_0x485028[_0xb27b('0x3c')][_0xb27b('0x3f')]?_0x485028[_0xb27b('0x3c')]:_0x537512['model'];if(_0xbe277['query'][_0xb27b('0x47')]){_0x485028[_0xb27b('0x48')]=[{'all':!![]}];}_0x485028=_[_0xb27b('0x46')]({},_0x485028,_0xbe277['options']);return db[_0xb27b('0x34')][_0xb27b('0x56')](_0x485028)['then'](handleEntityNotFound(_0xc8661f,null))[_0xb27b('0x2a')](function(_0x55a12c){if(_0x55a12c){var _0xc69961=_0x55a12c[_0xb27b('0x2b')]({'plain':!![]});_0xc69961=qs[_0xb27b('0x57')](_0xc69961,['id','createdAt',_0xb27b('0x58')]);_0xbe277[_0xb27b('0x4d')]=_[_0xb27b('0x57')](_0xbe277[_0xb27b('0x4d')],['id',_0xb27b('0x59'),_0xb27b('0x58')]);return db[_0xb27b('0x34')]['create'](_[_0xb27b('0x46')](_0xc69961,_0xbe277[_0xb27b('0x4d')]),{'include':_0xbe277[_0xb27b('0x39')][_0xb27b('0x47')]?[{'all':!![]}]:undefined})['then'](function(_0x35fb0d){var _0x2331e7=_0xbe277['user'][_0xb27b('0x2b')]({'plain':!![]});if(!_0x2331e7)throw new Error(_0xb27b('0x4f'));if(_0x2331e7[_0xb27b('0x50')]==='user'){var _0x2f1b5b=_0x35fb0d[_0xb27b('0x2b')]({'plain':!![]});var _0x53aff3=_0xb27b('0x2c');return db['UserProfileSection'][_0xb27b('0x56')]({'where':{'name':_0x53aff3,'userProfileId':_0x2331e7['userProfileId']},'raw':!![]})[_0xb27b('0x2a')](function(_0x3598e4){if(_0x3598e4&&_0x3598e4['autoAssociation']===0x0){return db[_0xb27b('0x2d')][_0xb27b('0x4c')]({'name':_0x2f1b5b[_0xb27b('0x31')],'resourceId':_0x2f1b5b['id'],'type':_0x3598e4[_0xb27b('0x31')],'sectionId':_0x3598e4['id']},{})[_0xb27b('0x2a')](function(){return _0x35fb0d;});}else{return _0x35fb0d;}})['catch'](function(_0x2c94e0){logger[_0xb27b('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c94e0);throw _0x2c94e0;});}return _0x35fb0d;});}})[_0xb27b('0x2a')](respondWithResult(_0xc8661f,0xc9))[_0xb27b('0x4a')](handleError(_0xc8661f,null));};exports['update']=function(_0x39f283,_0x5a3ecb){if(_0x39f283['body']['id']){delete _0x39f283[_0xb27b('0x4d')]['id'];}return db[_0xb27b('0x34')]['find']({'where':{'id':_0x39f283[_0xb27b('0x55')]['id']}})[_0xb27b('0x2a')](handleEntityNotFound(_0x5a3ecb,null))['then'](saveUpdates(_0x39f283[_0xb27b('0x4d')],null))['then'](respondWithResult(_0x5a3ecb,null))[_0xb27b('0x4a')](handleError(_0x5a3ecb,null));};exports[_0xb27b('0x29')]=function(_0x35b127,_0x547159){return db[_0xb27b('0x34')]['find']({'where':{'id':_0x35b127[_0xb27b('0x55')]['id']}})['then'](handleEntityNotFound(_0x547159,null))[_0xb27b('0x2a')](removeEntity(_0x547159,null))['catch'](handleError(_0x547159,null));};function widgetAttributes(_0x438c4a){try{switch(_0x438c4a[_0xb27b('0x37')]){case'iframe':return[{'name':_0xb27b('0x5a'),'value':_0x438c4a[_0xb27b('0x5a')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x0]?_0x438c4a[_0xb27b('0x5b')][0x0][_0xb27b('0x5c')]:undefined)||_0xb27b('0x5d')}];case _0xb27b('0x5e'):return[{'name':_0xb27b('0x5f'),'value':_0x438c4a[_0xb27b('0x5f')]||(_0x438c4a['attrs']&&_0x438c4a['attrs'][0x0]?_0x438c4a['attrs'][0x0][_0xb27b('0x5c')]:undefined)||''}];case _0xb27b('0x60'):return[{'name':_0xb27b('0x61'),'value':_0x438c4a[_0xb27b('0x61')]||(_0x438c4a['attrs']&&_0x438c4a['attrs'][0x0]?_0x438c4a['attrs'][0x0]['value']:undefined)||_0xb27b('0x62')},{'name':_0xb27b('0x63'),'value':_0x438c4a[_0xb27b('0x63')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x1]?_0x438c4a[_0xb27b('0x5b')][0x1][_0xb27b('0x5c')]:undefined)||_0xb27b('0x64')},{'name':_0xb27b('0x65'),'value':_0x438c4a[_0xb27b('0x65')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x2]?_0x438c4a[_0xb27b('0x5b')][0x2][_0xb27b('0x5c')]:undefined)||0xc}];case _0xb27b('0x66'):return[{'name':'attrMetric','value':_0x438c4a[_0xb27b('0x67')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a['attrs'][0x0]?_0x438c4a['attrs'][0x0][_0xb27b('0x5c')]:undefined)||_0xb27b('0x68')},{'name':_0xb27b('0x69'),'value':_0x438c4a[_0xb27b('0x69')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x1]?_0x438c4a[_0xb27b('0x5b')][0x1][_0xb27b('0x5c')]:undefined)||[]},{'name':_0xb27b('0x65'),'value':_0x438c4a[_0xb27b('0x65')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x2]?_0x438c4a[_0xb27b('0x5b')][0x2]['value']:undefined)||0x14},{'name':_0xb27b('0x6a'),'value':_0x438c4a[_0xb27b('0x6a')]||(_0x438c4a['attrs']&&_0x438c4a[_0xb27b('0x5b')][0x3]?_0x438c4a[_0xb27b('0x5b')][0x3][_0xb27b('0x5c')]:undefined)||'voice'},{'name':_0xb27b('0x6b'),'value':_0x438c4a[_0xb27b('0x6b')]||(_0x438c4a['attrs']&&_0x438c4a[_0xb27b('0x5b')][0x4]?_0x438c4a[_0xb27b('0x5b')][0x4]['value']:undefined)||''},{'name':_0xb27b('0x6c'),'value':_0x438c4a[_0xb27b('0x6c')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x5]?_0x438c4a['attrs'][0x5][_0xb27b('0x5c')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x438c4a[_0xb27b('0x6d')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x6]?_0x438c4a[_0xb27b('0x5b')][0x6][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x6e'),'value':_0x438c4a[_0xb27b('0x6e')]||(_0x438c4a['attrs']&&_0x438c4a[_0xb27b('0x5b')][0x7]?_0x438c4a[_0xb27b('0x5b')][0x7][_0xb27b('0x5c')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x438c4a[_0xb27b('0x6f')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x8]?_0x438c4a['attrs'][0x8][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x70'),'value':_0x438c4a[_0xb27b('0x70')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x9]?_0x438c4a[_0xb27b('0x5b')][0x9][_0xb27b('0x5c')]:undefined)||''}];case _0xb27b('0x71'):case'pie-chart':return[{'name':'attrSerie1','value':_0x438c4a['attrSerie1']||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x0]?_0x438c4a[_0xb27b('0x5b')][0x0][_0xb27b('0x5c')]:undefined)||_0xb27b('0x68')},{'name':'attrSerie2','value':_0x438c4a[_0xb27b('0x72')]||(_0x438c4a['attrs']&&_0x438c4a[_0xb27b('0x5b')][0x1]?_0x438c4a[_0xb27b('0x5b')][0x1][_0xb27b('0x5c')]:undefined)||null},{'name':_0xb27b('0x73'),'value':_0x438c4a[_0xb27b('0x73')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x2]?_0x438c4a[_0xb27b('0x5b')][0x2]['value']:undefined)||null},{'name':_0xb27b('0x69'),'value':_0x438c4a[_0xb27b('0x69')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a['attrs'][0x3]?_0x438c4a[_0xb27b('0x5b')][0x3]['value']:undefined)||[]},{'name':_0xb27b('0x6a'),'value':_0x438c4a[_0xb27b('0x6a')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x4]?_0x438c4a[_0xb27b('0x5b')][0x4][_0xb27b('0x5c')]:undefined)||_0xb27b('0x74')},{'name':'attrEmailAccounts','value':_0x438c4a[_0xb27b('0x6b')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x5]?_0x438c4a[_0xb27b('0x5b')][0x5]['value']:undefined)||''},{'name':'attrFaxAccounts','value':_0x438c4a['attrFaxAccounts']||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x6]?_0x438c4a[_0xb27b('0x5b')][0x6][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x6d'),'value':_0x438c4a[_0xb27b('0x6d')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x7]?_0x438c4a[_0xb27b('0x5b')][0x7][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x6e'),'value':_0x438c4a[_0xb27b('0x6e')]||(_0x438c4a['attrs']&&_0x438c4a[_0xb27b('0x5b')][0x8]?_0x438c4a[_0xb27b('0x5b')][0x8][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x6f'),'value':_0x438c4a['attrWhatsappAccounts']||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x9]?_0x438c4a[_0xb27b('0x5b')][0x9][_0xb27b('0x5c')]:undefined)||''},{'name':_0xb27b('0x70'),'value':_0x438c4a[_0xb27b('0x70')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0xa]?_0x438c4a[_0xb27b('0x5b')][0xa][_0xb27b('0x5c')]:undefined)||''}];case _0xb27b('0x75'):return[{'name':_0xb27b('0x76'),'type':_0x438c4a[_0xb27b('0x77')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x0]?_0x438c4a['attrs'][0x0][_0xb27b('0x37')]:undefined)||null,'value':_0x438c4a[_0xb27b('0x76')]||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x0]?_0x438c4a[_0xb27b('0x5b')][0x0][_0xb27b('0x5c')]:undefined)||null},{'name':_0xb27b('0x78'),'value':_0x438c4a['attrRefresh']||(_0x438c4a[_0xb27b('0x5b')]&&_0x438c4a[_0xb27b('0x5b')][0x1]?_0x438c4a['attrs'][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x52da25){logger[_0xb27b('0x2f')](_0xb27b('0x79'),JSON[_0xb27b('0x7a')](_0x52da25));return[];}}exports['addItem']=function(_0x479bb9,_0x2468d4,_0x56469e){if(_0x479bb9[_0xb27b('0x4d')]['id']){delete _0x479bb9[_0xb27b('0x4d')]['id'];}return db[_0xb27b('0x34')]['find']({'where':{'id':_0x479bb9['params']['id']}})[_0xb27b('0x2a')](handleEntityNotFound(_0x2468d4,null))['then'](function(_0x563eb0){if(_0x563eb0){_0x479bb9[_0xb27b('0x4d')]['DashboardId']=_0x563eb0['id'];_0x479bb9['body'][_0xb27b('0x5b')]=widgetAttributes(_0x479bb9[_0xb27b('0x4d')]);return db[_0xb27b('0x7b')][_0xb27b('0x4c')](_0x479bb9[_0xb27b('0x4d')]);}})['then'](respondWithResult(_0x2468d4,null))[_0xb27b('0x4a')](handleError(_0x2468d4,null));};exports[_0xb27b('0x7c')]=function(_0x3ed99e,_0x15fd56,_0x43dd53){var _0x270550={};var _0x2bad11={};var _0x5013f4;var _0x41dafb;return db[_0xb27b('0x34')][_0xb27b('0x7d')]({'where':{'id':_0x3ed99e[_0xb27b('0x55')]['id']}})[_0xb27b('0x2a')](handleEntityNotFound(_0x15fd56,null))[_0xb27b('0x2a')](function(_0x3d55d7){if(_0x3d55d7){_0x5013f4=_0x3d55d7;_0x2bad11[_0xb27b('0x38')]=_[_0xb27b('0x3a')](db[_0xb27b('0x7b')][_0xb27b('0x35')]);_0x2bad11[_0xb27b('0x39')]=_[_0xb27b('0x3a')](_0x3ed99e['query']);_0x2bad11[_0xb27b('0x3b')]=_[_0xb27b('0x3d')](_0x2bad11[_0xb27b('0x38')],_0x2bad11['query']);_0x270550[_0xb27b('0x3c')]=_[_0xb27b('0x3d')](_0x2bad11[_0xb27b('0x38')],qs[_0xb27b('0x3e')](_0x3ed99e['query']['fields']));_0x270550[_0xb27b('0x3c')]=_0x270550[_0xb27b('0x3c')][_0xb27b('0x3f')]?_0x270550[_0xb27b('0x3c')]:_0x2bad11[_0xb27b('0x38')];_0x270550[_0xb27b('0x41')]=qs['sort'](_0x3ed99e[_0xb27b('0x39')]['sort']);_0x270550[_0xb27b('0x43')]=qs[_0xb27b('0x3b')](_['pick'](_0x3ed99e[_0xb27b('0x39')],_0x2bad11['filters']));if(_0x3ed99e[_0xb27b('0x39')]['filter']){_0x270550[_0xb27b('0x43')]=_[_0xb27b('0x46')](_0x270550[_0xb27b('0x43')],{'$or':_[_0xb27b('0x33')](_0x270550[_0xb27b('0x3c')],function(_0x5df340){var _0x4dd100={};_0x4dd100[_0x5df340]={'$like':'%'+_0x3ed99e[_0xb27b('0x39')][_0xb27b('0x44')]+'%'};return _0x4dd100;})});}_0x270550=_[_0xb27b('0x46')]({},_0x270550,_0x3ed99e[_0xb27b('0x4b')]);return _0x5013f4['getItems'](_0x270550);}})['then'](function(_0xa3a21f){if(_0xa3a21f){_0x41dafb=_0xa3a21f[_0xb27b('0x3f')];if(!_0x3ed99e['query']['hasOwnProperty']('nolimit')){_0x270550[_0xb27b('0x21')]=qs['limit'](_0x3ed99e[_0xb27b('0x39')]['limit']);_0x270550[_0xb27b('0x20')]=qs[_0xb27b('0x20')](_0x3ed99e[_0xb27b('0x39')][_0xb27b('0x20')]);}return _0x5013f4['getItems'](_0x270550);}})[_0xb27b('0x2a')](function(_0xe4ea2a){if(_0xe4ea2a){return _0xe4ea2a?{'count':_0x41dafb,'rows':_0xe4ea2a}:null;}})[_0xb27b('0x2a')](respondWithResult(_0x15fd56,null))['catch'](handleError(_0x15fd56,null));}; \ No newline at end of file +var _0x1e7d=['attrSerie2','attrSerie3','attrSmsAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','findOne','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','CustomDashboards','UserProfileResource','error','name','send','index','Dashboard','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','rows','catch','show','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','clone','params','length','omit','createdAt','updatedAt','body','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','attrUrl','attrs','value','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','total'];(function(_0x291b8c,_0x6b7ed8){var _0x22ba34=function(_0x250020){while(--_0x250020){_0x291b8c['push'](_0x291b8c['shift']());}};_0x22ba34(++_0x6b7ed8);}(_0x1e7d,0x196));var _0xd1e7=function(_0x23ee08,_0x241d65){_0x23ee08=_0x23ee08-0x0;var _0x258232=_0x1e7d[_0x23ee08];return _0x258232;};'use strict';var emlformat=require(_0xd1e7('0x0'));var rimraf=require(_0xd1e7('0x1'));var zipdir=require(_0xd1e7('0x2'));var jsonpatch=require(_0xd1e7('0x3'));var rp=require(_0xd1e7('0x4'));var moment=require(_0xd1e7('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd1e7('0x6'));var util=require(_0xd1e7('0x7'));var path=require('path');var sox=require(_0xd1e7('0x8'));var csv=require('to-csv');var ejs=require(_0xd1e7('0x9'));var fs=require('fs');var fs_extra=require(_0xd1e7('0xa'));var _=require('lodash');var squel=require(_0xd1e7('0xb'));var crypto=require('crypto');var jsforce=require(_0xd1e7('0xc'));var deskjs=require(_0xd1e7('0xd'));var toCsv=require(_0xd1e7('0xe'));var querystring=require('querystring');var Papa=require(_0xd1e7('0xf'));var Redis=require('ioredis');var authService=require(_0xd1e7('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xd1e7('0x11'));var hardwareService=require(_0xd1e7('0x12'));var logger=require(_0xd1e7('0x13'))(_0xd1e7('0x14'));var utils=require(_0xd1e7('0x15'));var config=require(_0xd1e7('0x16'));var licenseUtil=require(_0xd1e7('0x17'));var db=require(_0xd1e7('0x18'))['db'];config[_0xd1e7('0x19')]=_[_0xd1e7('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd1e7('0x1b'))(new Redis(config[_0xd1e7('0x19')]));require(_0xd1e7('0x1c'))[_0xd1e7('0x1d')](socket);function respondWithStatusCode(_0x1353c6,_0x5117b2){_0x5117b2=_0x5117b2||0xcc;return function(_0x1b92ff){if(_0x1b92ff){return _0x1353c6[_0xd1e7('0x1e')](_0x5117b2);}return _0x1353c6[_0xd1e7('0x1f')](_0x5117b2)[_0xd1e7('0x20')]();};}function respondWithResult(_0x14744e,_0x2f1225){_0x2f1225=_0x2f1225||0xc8;return function(_0x19b269){if(_0x19b269){return _0x14744e[_0xd1e7('0x1f')](_0x2f1225)[_0xd1e7('0x21')](_0x19b269);}};}function respondWithFilteredResult(_0x5e0287,_0x5b593f){return function(_0x151e2e){if(_0x151e2e){var _0x1ccee7=typeof _0x5b593f[_0xd1e7('0x22')]===_0xd1e7('0x23')&&typeof _0x5b593f['limit']==='undefined';var _0x3a24a9=_0x151e2e[_0xd1e7('0x24')];var _0x43f48c=_0x1ccee7?0x0:_0x5b593f['offset'];var _0x225c53=_0x1ccee7?_0x151e2e[_0xd1e7('0x24')]:_0x5b593f['offset']+_0x5b593f[_0xd1e7('0x25')];var _0x8f8f2b;if(_0x225c53>=_0x3a24a9){_0x225c53=_0x3a24a9;_0x8f8f2b=0xc8;}else{_0x8f8f2b=0xce;}_0x5e0287[_0xd1e7('0x1f')](_0x8f8f2b);return _0x5e0287[_0xd1e7('0x26')](_0xd1e7('0x27'),_0x43f48c+'-'+_0x225c53+'/'+_0x3a24a9)[_0xd1e7('0x21')](_0x151e2e);}return null;};}function patchUpdates(_0x1d4b96){return function(_0x1845ad){try{jsonpatch[_0xd1e7('0x28')](_0x1845ad,_0x1d4b96,!![]);}catch(_0x534131){return BPromise['reject'](_0x534131);}return _0x1845ad[_0xd1e7('0x29')]();};}function saveUpdates(_0x36a4f1,_0x5a8b16){return function(_0x1f2450){if(_0x1f2450){return _0x1f2450[_0xd1e7('0x2a')](_0x36a4f1)[_0xd1e7('0x2b')](function(_0x51fd8a){return _0x51fd8a;});}return null;};}function removeEntity(_0x1953ad,_0x3f1b6c){return function(_0x2e1744){if(_0x2e1744){return _0x2e1744[_0xd1e7('0x2c')]()[_0xd1e7('0x2b')](function(){var _0x5e845f=_0x2e1744['get']({'plain':!![]});var _0x310e47=_0xd1e7('0x2d');return db[_0xd1e7('0x2e')][_0xd1e7('0x2c')]({'where':{'type':_0x310e47,'resourceId':_0x5e845f['id']}})[_0xd1e7('0x2b')](function(){return _0x2e1744;});})[_0xd1e7('0x2b')](function(){_0x1953ad[_0xd1e7('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x183097,_0x292c7e){return function(_0x10b2e7){if(!_0x10b2e7){_0x183097[_0xd1e7('0x1e')](0x194);}return _0x10b2e7;};}function handleError(_0x36c3f2,_0x3e295b){_0x3e295b=_0x3e295b||0x1f4;return function(_0x53ceae){logger[_0xd1e7('0x2f')](_0x53ceae['stack']);if(_0x53ceae[_0xd1e7('0x30')]){delete _0x53ceae['name'];}_0x36c3f2[_0xd1e7('0x1f')](_0x3e295b)[_0xd1e7('0x31')](_0x53ceae);};}exports[_0xd1e7('0x32')]=function(_0x5adafe,_0x467f33){var _0x4ca696={},_0x5b01d0={},_0x535c0c={'count':0x0,'rows':[]};var _0x29074c=_['map'](db[_0xd1e7('0x33')][_0xd1e7('0x34')],function(_0x28eb82){return{'name':_0x28eb82[_0xd1e7('0x35')],'type':_0x28eb82['type'][_0xd1e7('0x36')]};});_0x5b01d0['model']=_[_0xd1e7('0x37')](_0x29074c,'name');_0x5b01d0[_0xd1e7('0x38')]=_[_0xd1e7('0x39')](_0x5adafe[_0xd1e7('0x38')]);_0x5b01d0[_0xd1e7('0x3a')]=_[_0xd1e7('0x3b')](_0x5b01d0[_0xd1e7('0x3c')],_0x5b01d0['query']);_0x4ca696[_0xd1e7('0x3d')]=_[_0xd1e7('0x3b')](_0x5b01d0[_0xd1e7('0x3c')],qs[_0xd1e7('0x3e')](_0x5adafe['query'][_0xd1e7('0x3e')]));_0x4ca696[_0xd1e7('0x3d')]=_0x4ca696[_0xd1e7('0x3d')]['length']?_0x4ca696[_0xd1e7('0x3d')]:_0x5b01d0[_0xd1e7('0x3c')];if(!_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x3f')](_0xd1e7('0x40'))){_0x4ca696[_0xd1e7('0x25')]=qs[_0xd1e7('0x25')](_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x25')]);_0x4ca696[_0xd1e7('0x22')]=qs[_0xd1e7('0x22')](_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x22')]);}_0x4ca696['order']=qs['sort'](_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x41')]);_0x4ca696[_0xd1e7('0x42')]=qs[_0xd1e7('0x3a')](_[_0xd1e7('0x43')](_0x5adafe[_0xd1e7('0x38')],_0x5b01d0[_0xd1e7('0x3a')]),_0x29074c);if(_0x5adafe[_0xd1e7('0x38')]['filter']){_0x4ca696[_0xd1e7('0x42')]=_[_0xd1e7('0x44')](_0x4ca696['where'],{'$or':_[_0xd1e7('0x37')](_0x29074c,function(_0x2aebac){if(_0x2aebac[_0xd1e7('0x45')]!==_0xd1e7('0x46')){var _0x1bbff3={};_0x1bbff3[_0x2aebac[_0xd1e7('0x30')]]={'$like':'%'+_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x47')]+'%'};return _0x1bbff3;}})});}_0x4ca696=_[_0xd1e7('0x44')]({},_0x4ca696,_0x5adafe[_0xd1e7('0x48')]);var _0xe4663={'where':_0x4ca696[_0xd1e7('0x42')]};return db[_0xd1e7('0x33')][_0xd1e7('0x24')](_0xe4663)[_0xd1e7('0x2b')](function(_0x3a47b0){_0x535c0c[_0xd1e7('0x24')]=_0x3a47b0;if(_0x5adafe[_0xd1e7('0x38')][_0xd1e7('0x49')]){_0x4ca696[_0xd1e7('0x4a')]=[{'all':!![]}];}return db[_0xd1e7('0x33')]['findAll'](_0x4ca696);})[_0xd1e7('0x2b')](function(_0x1f2a78){_0x535c0c[_0xd1e7('0x4b')]=_0x1f2a78;return _0x535c0c;})[_0xd1e7('0x2b')](respondWithFilteredResult(_0x467f33,_0x4ca696))[_0xd1e7('0x4c')](handleError(_0x467f33,null));};exports[_0xd1e7('0x4d')]=function(_0x4aaeb1,_0x1df1dd){var _0x3935a7={'raw':![],'where':{'id':_0x4aaeb1['params']['id']}},_0x34eb49={};_0x34eb49['model']=_['keys'](db[_0xd1e7('0x33')][_0xd1e7('0x34')]);_0x34eb49['query']=_[_0xd1e7('0x39')](_0x4aaeb1[_0xd1e7('0x38')]);_0x34eb49[_0xd1e7('0x3a')]=_[_0xd1e7('0x3b')](_0x34eb49[_0xd1e7('0x3c')],_0x34eb49[_0xd1e7('0x38')]);_0x3935a7[_0xd1e7('0x3d')]=_['intersection'](_0x34eb49[_0xd1e7('0x3c')],qs['fields'](_0x4aaeb1[_0xd1e7('0x38')]['fields']));_0x3935a7['attributes']=_0x3935a7[_0xd1e7('0x3d')]['length']?_0x3935a7['attributes']:_0x34eb49[_0xd1e7('0x3c')];if(_0x4aaeb1[_0xd1e7('0x38')][_0xd1e7('0x49')]){_0x3935a7['include']=[{'all':!![]}];}_0x3935a7=_[_0xd1e7('0x44')]({},_0x3935a7,_0x4aaeb1['options']);return db[_0xd1e7('0x33')]['find'](_0x3935a7)['then'](handleEntityNotFound(_0x1df1dd,null))['then'](respondWithResult(_0x1df1dd,null))['catch'](handleError(_0x1df1dd,null));};exports[_0xd1e7('0x4e')]=function(_0x1e5552,_0x2fe3f7){return db['Dashboard'][_0xd1e7('0x4e')](_0x1e5552['body'],{})['then'](function(_0x3d324f){var _0x2dd162=_0x1e5552[_0xd1e7('0x4f')][_0xd1e7('0x50')]({'plain':!![]});if(!_0x2dd162)throw new Error(_0xd1e7('0x51'));if(_0x2dd162[_0xd1e7('0x52')]===_0xd1e7('0x4f')){var _0x2ee467=_0x3d324f[_0xd1e7('0x50')]({'plain':!![]});var _0x502953='CustomDashboards';return db['UserProfileSection'][_0xd1e7('0x53')]({'where':{'name':_0x502953,'userProfileId':_0x2dd162[_0xd1e7('0x54')]},'raw':!![]})[_0xd1e7('0x2b')](function(_0x4fbed6){if(_0x4fbed6&&_0x4fbed6[_0xd1e7('0x55')]===0x0){return db[_0xd1e7('0x2e')][_0xd1e7('0x4e')]({'name':_0x2ee467[_0xd1e7('0x30')],'resourceId':_0x2ee467['id'],'type':_0x4fbed6[_0xd1e7('0x30')],'sectionId':_0x4fbed6['id']},{})['then'](function(){return _0x3d324f;});}else{return _0x3d324f;}})[_0xd1e7('0x4c')](function(_0x41ea6d){logger[_0xd1e7('0x2f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x41ea6d);throw _0x41ea6d;});}return _0x3d324f;})[_0xd1e7('0x2b')](respondWithResult(_0x2fe3f7,0xc9))[_0xd1e7('0x4c')](handleError(_0x2fe3f7,null));};exports[_0xd1e7('0x56')]=function(_0x45afbc,_0x19c379){var _0x42fc43={'where':{'id':_0x45afbc[_0xd1e7('0x57')]['id']}},_0x258f2b={};_0x258f2b[_0xd1e7('0x3c')]=_['keys'](db[_0xd1e7('0x33')]['rawAttributes']);_0x42fc43[_0xd1e7('0x3d')]=_[_0xd1e7('0x3b')](_0x258f2b[_0xd1e7('0x3c')],qs['fields'](_0x45afbc['query'][_0xd1e7('0x3e')]));_0x42fc43[_0xd1e7('0x3d')]=_0x42fc43[_0xd1e7('0x3d')][_0xd1e7('0x58')]?_0x42fc43[_0xd1e7('0x3d')]:_0x258f2b[_0xd1e7('0x3c')];if(_0x45afbc[_0xd1e7('0x38')][_0xd1e7('0x49')]){_0x42fc43[_0xd1e7('0x4a')]=[{'all':!![]}];}_0x42fc43=_[_0xd1e7('0x44')]({},_0x42fc43,_0x45afbc[_0xd1e7('0x48')]);return db[_0xd1e7('0x33')]['find'](_0x42fc43)[_0xd1e7('0x2b')](handleEntityNotFound(_0x19c379,null))[_0xd1e7('0x2b')](function(_0x476937){if(_0x476937){var _0x3e4111=_0x476937[_0xd1e7('0x50')]({'plain':!![]});_0x3e4111=qs[_0xd1e7('0x59')](_0x3e4111,['id',_0xd1e7('0x5a'),_0xd1e7('0x5b')]);_0x45afbc['body']=_[_0xd1e7('0x59')](_0x45afbc[_0xd1e7('0x5c')],['id','createdAt',_0xd1e7('0x5b')]);return db[_0xd1e7('0x33')][_0xd1e7('0x4e')](_[_0xd1e7('0x44')](_0x3e4111,_0x45afbc[_0xd1e7('0x5c')]),{'include':_0x45afbc[_0xd1e7('0x38')][_0xd1e7('0x49')]?[{'all':!![]}]:undefined})[_0xd1e7('0x2b')](function(_0x5da05b){var _0x4c9e47=_0x45afbc['user'][_0xd1e7('0x50')]({'plain':!![]});if(!_0x4c9e47)throw new Error(_0xd1e7('0x51'));if(_0x4c9e47[_0xd1e7('0x52')]===_0xd1e7('0x4f')){var _0x307725=_0x5da05b[_0xd1e7('0x50')]({'plain':!![]});var _0x2cad2c='CustomDashboards';return db[_0xd1e7('0x5d')][_0xd1e7('0x53')]({'where':{'name':_0x2cad2c,'userProfileId':_0x4c9e47[_0xd1e7('0x54')]},'raw':!![]})[_0xd1e7('0x2b')](function(_0x44afed){if(_0x44afed&&_0x44afed[_0xd1e7('0x55')]===0x0){return db[_0xd1e7('0x2e')][_0xd1e7('0x4e')]({'name':_0x307725[_0xd1e7('0x30')],'resourceId':_0x307725['id'],'type':_0x44afed['name'],'sectionId':_0x44afed['id']},{})[_0xd1e7('0x2b')](function(){return _0x5da05b;});}else{return _0x5da05b;}})[_0xd1e7('0x4c')](function(_0x1c507c){logger[_0xd1e7('0x2f')](_0xd1e7('0x5e'),_0x1c507c);throw _0x1c507c;});}return _0x5da05b;});}})['then'](respondWithResult(_0x19c379,0xc9))[_0xd1e7('0x4c')](handleError(_0x19c379,null));};exports[_0xd1e7('0x2a')]=function(_0x350e23,_0x429544){if(_0x350e23[_0xd1e7('0x5c')]['id']){delete _0x350e23[_0xd1e7('0x5c')]['id'];}return db[_0xd1e7('0x33')][_0xd1e7('0x53')]({'where':{'id':_0x350e23[_0xd1e7('0x57')]['id']}})['then'](handleEntityNotFound(_0x429544,null))['then'](saveUpdates(_0x350e23[_0xd1e7('0x5c')],null))[_0xd1e7('0x2b')](respondWithResult(_0x429544,null))['catch'](handleError(_0x429544,null));};exports[_0xd1e7('0x2c')]=function(_0x24e4be,_0x4ebf09){return db[_0xd1e7('0x33')][_0xd1e7('0x53')]({'where':{'id':_0x24e4be[_0xd1e7('0x57')]['id']}})[_0xd1e7('0x2b')](handleEntityNotFound(_0x4ebf09,null))[_0xd1e7('0x2b')](removeEntity(_0x4ebf09,null))['catch'](handleError(_0x4ebf09,null));};function widgetAttributes(_0x35cc0c){try{switch(_0x35cc0c['type']){case'iframe':return[{'name':_0xd1e7('0x5f'),'value':_0x35cc0c[_0xd1e7('0x5f')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x0]?_0x35cc0c[_0xd1e7('0x60')][0x0][_0xd1e7('0x61')]:undefined)||'https://'}];case'custom':return[{'name':_0xd1e7('0x62'),'value':_0x35cc0c['attrPath']||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x0]?_0x35cc0c[_0xd1e7('0x60')][0x0][_0xd1e7('0x61')]:undefined)||''}];case _0xd1e7('0x63'):return[{'name':_0xd1e7('0x64'),'value':_0x35cc0c[_0xd1e7('0x64')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x0]?_0x35cc0c['attrs'][0x0][_0xd1e7('0x61')]:undefined)||'HH:mm:ss'},{'name':_0xd1e7('0x65'),'value':_0x35cc0c[_0xd1e7('0x65')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x1]?_0x35cc0c[_0xd1e7('0x60')][0x1]['value']:undefined)||_0xd1e7('0x66')},{'name':_0xd1e7('0x67'),'value':_0x35cc0c['attrFontSize']||(_0x35cc0c['attrs']&&_0x35cc0c['attrs'][0x2]?_0x35cc0c[_0xd1e7('0x60')][0x2][_0xd1e7('0x61')]:undefined)||0xc}];case _0xd1e7('0x68'):return[{'name':_0xd1e7('0x69'),'value':_0x35cc0c[_0xd1e7('0x69')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x0]?_0x35cc0c['attrs'][0x0]['value']:undefined)||'total'},{'name':_0xd1e7('0x6a'),'value':_0x35cc0c[_0xd1e7('0x6a')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x1]?_0x35cc0c[_0xd1e7('0x60')][0x1][_0xd1e7('0x61')]:undefined)||[]},{'name':_0xd1e7('0x67'),'value':_0x35cc0c[_0xd1e7('0x67')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x2]?_0x35cc0c[_0xd1e7('0x60')][0x2][_0xd1e7('0x61')]:undefined)||0x14},{'name':_0xd1e7('0x6b'),'value':_0x35cc0c[_0xd1e7('0x6b')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x3]?_0x35cc0c[_0xd1e7('0x60')][0x3]['value']:undefined)||_0xd1e7('0x6c')},{'name':_0xd1e7('0x6d'),'value':_0x35cc0c[_0xd1e7('0x6d')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x4]?_0x35cc0c['attrs'][0x4][_0xd1e7('0x61')]:undefined)||''},{'name':_0xd1e7('0x6e'),'value':_0x35cc0c[_0xd1e7('0x6e')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x5]?_0x35cc0c[_0xd1e7('0x60')][0x5][_0xd1e7('0x61')]:undefined)||''},{'name':'attrSmsAccounts','value':_0x35cc0c['attrSmsAccounts']||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x6]?_0x35cc0c[_0xd1e7('0x60')][0x6]['value']:undefined)||''},{'name':_0xd1e7('0x6f'),'value':_0x35cc0c[_0xd1e7('0x6f')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x7]?_0x35cc0c[_0xd1e7('0x60')][0x7]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x35cc0c[_0xd1e7('0x70')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x8]?_0x35cc0c[_0xd1e7('0x60')][0x8][_0xd1e7('0x61')]:undefined)||''},{'name':_0xd1e7('0x71'),'value':_0x35cc0c[_0xd1e7('0x71')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x9]?_0x35cc0c[_0xd1e7('0x60')][0x9][_0xd1e7('0x61')]:undefined)||''}];case _0xd1e7('0x72'):case _0xd1e7('0x73'):return[{'name':'attrSerie1','value':_0x35cc0c[_0xd1e7('0x74')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x0]?_0x35cc0c[_0xd1e7('0x60')][0x0][_0xd1e7('0x61')]:undefined)||_0xd1e7('0x75')},{'name':_0xd1e7('0x76'),'value':_0x35cc0c['attrSerie2']||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x1]?_0x35cc0c[_0xd1e7('0x60')][0x1]['value']:undefined)||null},{'name':_0xd1e7('0x77'),'value':_0x35cc0c[_0xd1e7('0x77')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x2]?_0x35cc0c[_0xd1e7('0x60')][0x2]['value']:undefined)||null},{'name':_0xd1e7('0x6a'),'value':_0x35cc0c['attrVoiceQueues']||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x3]?_0x35cc0c['attrs'][0x3]['value']:undefined)||[]},{'name':_0xd1e7('0x6b'),'value':_0x35cc0c[_0xd1e7('0x6b')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x4]?_0x35cc0c[_0xd1e7('0x60')][0x4][_0xd1e7('0x61')]:undefined)||_0xd1e7('0x6c')},{'name':_0xd1e7('0x6d'),'value':_0x35cc0c[_0xd1e7('0x6d')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x5]?_0x35cc0c['attrs'][0x5][_0xd1e7('0x61')]:undefined)||''},{'name':_0xd1e7('0x6e'),'value':_0x35cc0c[_0xd1e7('0x6e')]||(_0x35cc0c['attrs']&&_0x35cc0c['attrs'][0x6]?_0x35cc0c[_0xd1e7('0x60')][0x6][_0xd1e7('0x61')]:undefined)||''},{'name':_0xd1e7('0x78'),'value':_0x35cc0c[_0xd1e7('0x78')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x7]?_0x35cc0c['attrs'][0x7]['value']:undefined)||''},{'name':_0xd1e7('0x6f'),'value':_0x35cc0c[_0xd1e7('0x6f')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c['attrs'][0x8]?_0x35cc0c[_0xd1e7('0x60')][0x8]['value']:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x35cc0c['attrWhatsappAccounts']||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x9]?_0x35cc0c['attrs'][0x9][_0xd1e7('0x61')]:undefined)||''},{'name':'attrChatWebsites','value':_0x35cc0c['attrChatWebsites']||(_0x35cc0c['attrs']&&_0x35cc0c['attrs'][0xa]?_0x35cc0c[_0xd1e7('0x60')][0xa][_0xd1e7('0x61')]:undefined)||''}];case _0xd1e7('0x79'):return[{'name':_0xd1e7('0x7a'),'type':_0x35cc0c[_0xd1e7('0x7b')]||(_0x35cc0c['attrs']&&_0x35cc0c['attrs'][0x0]?_0x35cc0c[_0xd1e7('0x60')][0x0][_0xd1e7('0x45')]:undefined)||null,'value':_0x35cc0c[_0xd1e7('0x7a')]||(_0x35cc0c[_0xd1e7('0x60')]&&_0x35cc0c[_0xd1e7('0x60')][0x0]?_0x35cc0c[_0xd1e7('0x60')][0x0][_0xd1e7('0x61')]:undefined)||null},{'name':_0xd1e7('0x7c'),'value':_0x35cc0c[_0xd1e7('0x7c')]||(_0x35cc0c['attrs']&&_0x35cc0c[_0xd1e7('0x60')][0x1]?_0x35cc0c[_0xd1e7('0x60')][0x1][_0xd1e7('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x4f9237){logger[_0xd1e7('0x2f')](_0xd1e7('0x7d'),JSON['stringify'](_0x4f9237));return[];}}exports[_0xd1e7('0x7e')]=function(_0x127755,_0x276063,_0x225aca){if(_0x127755[_0xd1e7('0x5c')]['id']){delete _0x127755[_0xd1e7('0x5c')]['id'];}return db[_0xd1e7('0x33')]['find']({'where':{'id':_0x127755['params']['id']}})[_0xd1e7('0x2b')](handleEntityNotFound(_0x276063,null))[_0xd1e7('0x2b')](function(_0x20252f){if(_0x20252f){_0x127755[_0xd1e7('0x5c')][_0xd1e7('0x7f')]=_0x20252f['id'];_0x127755['body']['attrs']=widgetAttributes(_0x127755['body']);return db[_0xd1e7('0x80')][_0xd1e7('0x4e')](_0x127755[_0xd1e7('0x5c')]);}})['then'](respondWithResult(_0x276063,null))[_0xd1e7('0x4c')](handleError(_0x276063,null));};exports[_0xd1e7('0x81')]=function(_0x3bbc42,_0x3a17c6,_0x30634d){var _0xe6af62={};var _0x346ff5={};var _0x3d2630;var _0x414737;return db[_0xd1e7('0x33')][_0xd1e7('0x82')]({'where':{'id':_0x3bbc42[_0xd1e7('0x57')]['id']}})[_0xd1e7('0x2b')](handleEntityNotFound(_0x3a17c6,null))[_0xd1e7('0x2b')](function(_0x221060){if(_0x221060){_0x3d2630=_0x221060;_0x346ff5[_0xd1e7('0x3c')]=_['keys'](db[_0xd1e7('0x80')]['rawAttributes']);_0x346ff5[_0xd1e7('0x38')]=_[_0xd1e7('0x39')](_0x3bbc42[_0xd1e7('0x38')]);_0x346ff5[_0xd1e7('0x3a')]=_[_0xd1e7('0x3b')](_0x346ff5[_0xd1e7('0x3c')],_0x346ff5[_0xd1e7('0x38')]);_0xe6af62[_0xd1e7('0x3d')]=_[_0xd1e7('0x3b')](_0x346ff5['model'],qs[_0xd1e7('0x3e')](_0x3bbc42['query'][_0xd1e7('0x3e')]));_0xe6af62[_0xd1e7('0x3d')]=_0xe6af62['attributes'][_0xd1e7('0x58')]?_0xe6af62['attributes']:_0x346ff5[_0xd1e7('0x3c')];_0xe6af62['order']=qs['sort'](_0x3bbc42['query'][_0xd1e7('0x41')]);_0xe6af62[_0xd1e7('0x42')]=qs[_0xd1e7('0x3a')](_['pick'](_0x3bbc42[_0xd1e7('0x38')],_0x346ff5['filters']));if(_0x3bbc42['query'][_0xd1e7('0x47')]){_0xe6af62[_0xd1e7('0x42')]=_[_0xd1e7('0x44')](_0xe6af62[_0xd1e7('0x42')],{'$or':_[_0xd1e7('0x37')](_0xe6af62['attributes'],function(_0x317d3e){var _0x1b9f78={};_0x1b9f78[_0x317d3e]={'$like':'%'+_0x3bbc42[_0xd1e7('0x38')][_0xd1e7('0x47')]+'%'};return _0x1b9f78;})});}_0xe6af62=_['merge']({},_0xe6af62,_0x3bbc42['options']);return _0x3d2630[_0xd1e7('0x81')](_0xe6af62);}})[_0xd1e7('0x2b')](function(_0x510d4e){if(_0x510d4e){_0x414737=_0x510d4e[_0xd1e7('0x58')];if(!_0x3bbc42['query'][_0xd1e7('0x3f')](_0xd1e7('0x40'))){_0xe6af62[_0xd1e7('0x25')]=qs[_0xd1e7('0x25')](_0x3bbc42[_0xd1e7('0x38')][_0xd1e7('0x25')]);_0xe6af62[_0xd1e7('0x22')]=qs[_0xd1e7('0x22')](_0x3bbc42['query']['offset']);}return _0x3d2630[_0xd1e7('0x81')](_0xe6af62);}})['then'](function(_0x3dba65){if(_0x3dba65){return _0x3dba65?{'count':_0x414737,'rows':_0x3dba65}:null;}})['then'](respondWithResult(_0x3a17c6,null))[_0xd1e7('0x4c')](handleError(_0x3a17c6,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 7799222..1f13067 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 _0x3657=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','Dashboard','save'];(function(_0x3a3efa,_0x3c40d3){var _0x4751d4=function(_0x5c7a42){while(--_0x5c7a42){_0x3a3efa['push'](_0x3a3efa['shift']());}};_0x4751d4(++_0x3c40d3);}(_0x3657,0xcd));var _0x7365=function(_0x5ca52d,_0x3a4a22){_0x5ca52d=_0x5ca52d-0x0;var _0x89e54e=_0x3657[_0x5ca52d];return _0x89e54e;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0x7365('0x0'))['db'][_0x7365('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7365('0x2'),'afterUpdate':_0x7365('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5f504a){return function(_0x5154c7,_0x303aab,_0x1e2b36){DashboardEvents[_0x7365('0x4')](_0x5f504a+':'+_0x5154c7['id'],_0x5154c7);DashboardEvents[_0x7365('0x4')](_0x5f504a,_0x5154c7);_0x1e2b36(null);};}for(var e in events){if(events[_0x7365('0x5')](e)){var event=events[e];Dashboard[_0x7365('0x6')](e,emitEvent(event));}}module[_0x7365('0x7')]=DashboardEvents; \ No newline at end of file +var _0x16a8=['setMaxListeners','remove','emit','hasOwnProperty','hook','events','Dashboard'];(function(_0xc89935,_0x34ba1f){var _0x333c2e=function(_0x202d11){while(--_0x202d11){_0xc89935['push'](_0xc89935['shift']());}};_0x333c2e(++_0x34ba1f);}(_0x16a8,0xb4));var _0x816a=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x16a8[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0x816a('0x0'));var Dashboard=require('../../mysqldb')['db'][_0x816a('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x816a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x816a('0x3')};function emitEvent(_0x32357f){return function(_0x25f799,_0x31bddc,_0x291884){DashboardEvents[_0x816a('0x4')](_0x32357f+':'+_0x25f799['id'],_0x25f799);DashboardEvents[_0x816a('0x4')](_0x32357f,_0x25f799);_0x291884(null);};}for(var e in events){if(events[_0x816a('0x5')](e)){var event=events[e];Dashboard[_0x816a('0x6')](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 f237b00..853cc2c 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 _0x756a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','Dashboard','dashboards','lodash'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x756a,0x144));var _0xa756=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0x756a[_0x18abd2];return _0x1dcad6;};'use strict';var _=require(_0xa756('0x0'));var util=require(_0xa756('0x1'));var logger=require(_0xa756('0x2'))(_0xa756('0x3'));var moment=require(_0xa756('0x4'));var BPromise=require(_0xa756('0x5'));var rp=require(_0xa756('0x6'));var fs=require('fs');var path=require(_0xa756('0x7'));var rimraf=require(_0xa756('0x8'));var config=require(_0xa756('0x9'));var attributes=require('./dashboard.attributes');module[_0xa756('0xa')]=function(_0x4eddea,_0x5f4be0){return _0x4eddea['define'](_0xa756('0xb'),attributes,{'tableName':_0xa756('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8047=['exports','dashboards','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes'];(function(_0x3e8960,_0x18dd1a){var _0x4515f4=function(_0x406b8a){while(--_0x406b8a){_0x3e8960['push'](_0x3e8960['shift']());}};_0x4515f4(++_0x18dd1a);}(_0x8047,0x91));var _0x7804=function(_0x272d4e,_0x4adf01){_0x272d4e=_0x272d4e-0x0;var _0x17863a=_0x8047[_0x272d4e];return _0x17863a;};'use strict';var _=require(_0x7804('0x0'));var util=require(_0x7804('0x1'));var logger=require(_0x7804('0x2'))(_0x7804('0x3'));var moment=require(_0x7804('0x4'));var BPromise=require(_0x7804('0x5'));var rp=require(_0x7804('0x6'));var fs=require('fs');var path=require(_0x7804('0x7'));var rimraf=require(_0x7804('0x8'));var config=require(_0x7804('0x9'));var attributes=require(_0x7804('0xa'));module[_0x7804('0xb')]=function(_0x2808ee,_0x4686fe){return _0x2808ee['define']('Dashboard',attributes,{'tableName':_0x7804('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 7a12c08..41d324b 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 _0x7d05=['request','then','info','stringify','error','code','message','Dashboard,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register'];(function(_0x2766b4,_0xb9c42c){var _0x3c72ba=function(_0x3c4117){while(--_0x3c4117){_0x2766b4['push'](_0x2766b4['shift']());}};_0x3c72ba(++_0xb9c42c);}(_0x7d05,0x13e));var _0x57d0=function(_0x4ff961,_0x2c1f68){_0x4ff961=_0x4ff961-0x0;var _0x4acb13=_0x7d05[_0x4ff961];return _0x4acb13;};'use strict';var _=require(_0x57d0('0x0'));var util=require(_0x57d0('0x1'));var moment=require(_0x57d0('0x2'));var BPromise=require(_0x57d0('0x3'));var rs=require(_0x57d0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x57d0('0x5'))['db'];var utils=require(_0x57d0('0x6'));var logger=require(_0x57d0('0x7'))(_0x57d0('0x8'));var config=require('../../config/environment');var jayson=require(_0x57d0('0x9'));var client=jayson[_0x57d0('0xa')][_0x57d0('0xb')]({'port':0x232a});config[_0x57d0('0xc')]=_[_0x57d0('0xd')](config[_0x57d0('0xc')],{'host':_0x57d0('0xe'),'port':0x18eb});var socket=require(_0x57d0('0xf'))(new Redis(config[_0x57d0('0xc')]));require(_0x57d0('0x10'))[_0x57d0('0x11')](socket);function respondWithRpcPromise(_0x5d3e76,_0x77a059,_0x1b18a9){return new BPromise(function(_0x3db1bb,_0x462cc1){return client[_0x57d0('0x12')](_0x5d3e76,_0x1b18a9)[_0x57d0('0x13')](function(_0x8a676f){logger[_0x57d0('0x14')]('Dashboard,\x20%s,\x20%s',_0x77a059,'request\x20sent');logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x77a059,'request\x20sent',JSON[_0x57d0('0x15')](_0x8a676f));if(_0x8a676f[_0x57d0('0x16')]){if(_0x8a676f[_0x57d0('0x16')][_0x57d0('0x17')]===0x1f4){logger[_0x57d0('0x16')]('Dashboard,\x20%s,\x20%s',_0x77a059,_0x8a676f[_0x57d0('0x16')]['message']);return _0x462cc1(_0x8a676f[_0x57d0('0x16')][_0x57d0('0x18')]);}logger[_0x57d0('0x16')]('Dashboard,\x20%s,\x20%s',_0x77a059,_0x8a676f[_0x57d0('0x16')][_0x57d0('0x18')]);return _0x3db1bb(_0x8a676f[_0x57d0('0x16')][_0x57d0('0x18')]);}else{logger['info'](_0x57d0('0x19'),_0x77a059,_0x57d0('0x1a'));_0x3db1bb(_0x8a676f[_0x57d0('0x1b')]['message']);}})['catch'](function(_0x14859d){logger[_0x57d0('0x16')]('Dashboard,\x20%s,\x20%s',_0x77a059,_0x14859d);_0x462cc1(_0x14859d);});});} \ No newline at end of file +var _0xa0f5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x3fad67,_0x3efb66){var _0x23eb44=function(_0x1b422a){while(--_0x1b422a){_0x3fad67['push'](_0x3fad67['shift']());}};_0x23eb44(++_0x3efb66);}(_0xa0f5,0x1ac));var _0x5a0f=function(_0x5e0bf8,_0x5f1ccd){_0x5e0bf8=_0x5e0bf8-0x0;var _0x30826c=_0xa0f5[_0x5e0bf8];return _0x30826c;};'use strict';var _=require('lodash');var util=require(_0x5a0f('0x0'));var moment=require('moment');var BPromise=require(_0x5a0f('0x1'));var rs=require(_0x5a0f('0x2'));var fs=require('fs');var Redis=require(_0x5a0f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5a0f('0x4'));var logger=require(_0x5a0f('0x5'))(_0x5a0f('0x6'));var config=require(_0x5a0f('0x7'));var jayson=require(_0x5a0f('0x8'));var client=jayson[_0x5a0f('0x9')][_0x5a0f('0xa')]({'port':0x232a});config[_0x5a0f('0xb')]=_[_0x5a0f('0xc')](config[_0x5a0f('0xb')],{'host':_0x5a0f('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5a0f('0xb')]));require('./dashboard.socket')[_0x5a0f('0xe')](socket);function respondWithRpcPromise(_0x419233,_0x3eb29f,_0xb2e1ae){return new BPromise(function(_0xc61033,_0x319b5e){return client[_0x5a0f('0xf')](_0x419233,_0xb2e1ae)[_0x5a0f('0x10')](function(_0x2d7d5c){logger['info'](_0x5a0f('0x11'),_0x3eb29f,'request\x20sent');logger[_0x5a0f('0x12')](_0x5a0f('0x13'),_0x3eb29f,'request\x20sent',JSON['stringify'](_0x2d7d5c));if(_0x2d7d5c[_0x5a0f('0x14')]){if(_0x2d7d5c['error'][_0x5a0f('0x15')]===0x1f4){logger[_0x5a0f('0x14')]('Dashboard,\x20%s,\x20%s',_0x3eb29f,_0x2d7d5c['error'][_0x5a0f('0x16')]);return _0x319b5e(_0x2d7d5c[_0x5a0f('0x14')][_0x5a0f('0x16')]);}logger[_0x5a0f('0x14')](_0x5a0f('0x11'),_0x3eb29f,_0x2d7d5c[_0x5a0f('0x14')][_0x5a0f('0x16')]);return _0xc61033(_0x2d7d5c[_0x5a0f('0x14')][_0x5a0f('0x16')]);}else{logger[_0x5a0f('0x17')](_0x5a0f('0x11'),_0x3eb29f,_0x5a0f('0x18'));_0xc61033(_0x2d7d5c[_0x5a0f('0x19')][_0x5a0f('0x16')]);}})[_0x5a0f('0x1a')](function(_0x2711fd){logger[_0x5a0f('0x14')](_0x5a0f('0x11'),_0x3eb29f,_0x2711fd);_0x319b5e(_0x2711fd);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 5e9b0c4..cc28d21 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 _0xc48f=['removeListener','register','length','save','remove','update','emit'];(function(_0x522c6d,_0x4d250d){var _0x26300d=function(_0x3ab228){while(--_0x3ab228){_0x522c6d['push'](_0x522c6d['shift']());}};_0x26300d(++_0x4d250d);}(_0xc48f,0x192));var _0xfc48=function(_0x20cddc,_0x5bc87e){_0x20cddc=_0x20cddc-0x0;var _0x227a8a=_0xc48f[_0x20cddc];return _0x227a8a;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xfc48('0x0'),_0xfc48('0x1'),_0xfc48('0x2')];function createListener(_0x3d2e2f,_0x769c10){return function(_0x2b7819){_0x769c10[_0xfc48('0x3')](_0x3d2e2f,_0x2b7819);};}function removeListener(_0x310861,_0x4c96aa){return function(){DashboardEvents[_0xfc48('0x4')](_0x310861,_0x4c96aa);};}exports[_0xfc48('0x5')]=function(_0x3084c5){for(var _0x3b99d1=0x0,_0x3c88e0=events[_0xfc48('0x6')];_0x3b99d1<_0x3c88e0;_0x3b99d1++){var _0x34a5e7=events[_0x3b99d1];var _0x4f0b0d=createListener('dashboard:'+_0x34a5e7,_0x3084c5);DashboardEvents['on'](_0x34a5e7,_0x4f0b0d);}}; \ No newline at end of file +var _0x6857=['update','removeListener','register','length','dashboard:','./dashboard.events'];(function(_0x13b97a,_0x2bc5e4){var _0x25c8e1=function(_0x2a27b){while(--_0x2a27b){_0x13b97a['push'](_0x13b97a['shift']());}};_0x25c8e1(++_0x2bc5e4);}(_0x6857,0xa1));var _0x7685=function(_0x1795fc,_0xb3c5fb){_0x1795fc=_0x1795fc-0x0;var _0x13606e=_0x6857[_0x1795fc];return _0x13606e;};'use strict';var DashboardEvents=require(_0x7685('0x0'));var events=['save','remove',_0x7685('0x1')];function createListener(_0x5aac58,_0x407d9f){return function(_0x1936a6){_0x407d9f['emit'](_0x5aac58,_0x1936a6);};}function removeListener(_0x49f829,_0xcb5270){return function(){DashboardEvents[_0x7685('0x2')](_0x49f829,_0xcb5270);};}exports[_0x7685('0x3')]=function(_0x2e9b4f){for(var _0x8d39c4=0x0,_0x25ebb8=events[_0x7685('0x4')];_0x8d39c4<_0x25ebb8;_0x8d39c4++){var _0x5d482a=events[_0x8d39c4];var _0x511660=createListener(_0x7685('0x5')+_0x5d482a,_0x2e9b4f);DashboardEvents['on'](_0x5d482a,_0x511660);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index acdfe00..fb8caf4 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 _0x44c3=['util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','getItems','post','create','/:id/clone','clone','/:id/items','addItem','put','update','delete','exports','multer'];(function(_0x207d42,_0xc425c2){var _0x3bc604=function(_0x5d6feb){while(--_0x5d6feb){_0x207d42['push'](_0x207d42['shift']());}};_0x3bc604(++_0xc425c2);}(_0x44c3,0x167));var _0x344c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x44c3[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x344c('0x0'));var util=require(_0x344c('0x1'));var path=require(_0x344c('0x2'));var timeout=require(_0x344c('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x344c('0x4'));var auth=require(_0x344c('0x5'));var interaction=require(_0x344c('0x6'));var config=require(_0x344c('0x7'));var controller=require(_0x344c('0x8'));router[_0x344c('0x9')]('/',auth[_0x344c('0xa')](),controller[_0x344c('0xb')]);router[_0x344c('0x9')](_0x344c('0xc'),auth[_0x344c('0xa')](),controller['show']);router[_0x344c('0x9')]('/:id/items',auth[_0x344c('0xa')](),controller[_0x344c('0xd')]);router[_0x344c('0xe')]('/',auth[_0x344c('0xa')](),controller[_0x344c('0xf')]);router['post'](_0x344c('0x10'),auth[_0x344c('0xa')](),controller[_0x344c('0x11')]);router[_0x344c('0xe')](_0x344c('0x12'),auth['isAuthenticated'](),controller[_0x344c('0x13')]);router[_0x344c('0x14')](_0x344c('0xc'),auth[_0x344c('0xa')](),controller[_0x344c('0x15')]);router[_0x344c('0x16')](_0x344c('0xc'),auth[_0x344c('0xa')](),controller['destroy']);module[_0x344c('0x17')]=router; \ No newline at end of file +var _0xc2c0=['delete','destroy','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboard.controller','isAuthenticated','index','get','/:id','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','update'];(function(_0x5491f6,_0x323885){var _0x5babaf=function(_0x2f85c4){while(--_0x2f85c4){_0x5491f6['push'](_0x5491f6['shift']());}};_0x5babaf(++_0x323885);}(_0xc2c0,0x1e2));var _0x0c2c=function(_0xb4eb9e,_0x5914b4){_0xb4eb9e=_0xb4eb9e-0x0;var _0x488b91=_0xc2c0[_0xb4eb9e];return _0x488b91;};'use strict';var multer=require('multer');var util=require(_0x0c2c('0x0'));var path=require('path');var timeout=require(_0x0c2c('0x1'));var express=require(_0x0c2c('0x2'));var router=express[_0x0c2c('0x3')]();var fs_extra=require(_0x0c2c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x0c2c('0x5'));var config=require(_0x0c2c('0x6'));var controller=require(_0x0c2c('0x7'));router['get']('/',auth[_0x0c2c('0x8')](),controller[_0x0c2c('0x9')]);router[_0x0c2c('0xa')](_0x0c2c('0xb'),auth[_0x0c2c('0x8')](),controller[_0x0c2c('0xc')]);router['get'](_0x0c2c('0xd'),auth[_0x0c2c('0x8')](),controller[_0x0c2c('0xe')]);router[_0x0c2c('0xf')]('/',auth['isAuthenticated'](),controller[_0x0c2c('0x10')]);router[_0x0c2c('0xf')](_0x0c2c('0x11'),auth[_0x0c2c('0x8')](),controller[_0x0c2c('0x12')]);router[_0x0c2c('0xf')](_0x0c2c('0xd'),auth['isAuthenticated'](),controller[_0x0c2c('0x13')]);router[_0x0c2c('0x14')]('/:id',auth[_0x0c2c('0x8')](),controller[_0x0c2c('0x15')]);router[_0x0c2c('0x16')]('/:id',auth[_0x0c2c('0x8')](),controller[_0x0c2c('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 8875770..1dce079 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 _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4b9b78,_0x1dc74a){var _0x330388=function(_0x49bcdc){while(--_0x49bcdc){_0x4b9b78['push'](_0x4b9b78['shift']());}};_0x330388(++_0x1dc74a);}(_0x53ec,0x192));var _0xc53e=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0x53ec[_0x3f994d];return _0x5309b4;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0xf61e=['TEXT','long','parse','getDataValue','attrs','setDataValue','INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING'];(function(_0x2b2aa7,_0x36ebdf){var _0x37a732=function(_0x3d41d9){while(--_0x3d41d9){_0x2b2aa7['push'](_0x2b2aa7['shift']());}};_0x37a732(++_0x36ebdf);}(_0xf61e,0x191));var _0xef61=function(_0x350296,_0x4daf1c){_0x350296=_0x350296-0x0;var _0x4490bc=_0xf61e[_0x350296];return _0x4490bc;};'use strict';var Sequelize=require(_0xef61('0x0'));var squel=require(_0xef61('0x1'));var _=require(_0xef61('0x2'));module[_0xef61('0x3')]={'title':{'type':Sequelize[_0xef61('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xef61('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xef61('0x5')](_0xef61('0x6')),'get':function(){try{return JSON[_0xef61('0x7')](this[_0xef61('0x8')](_0xef61('0x9')));}catch(_0x45a18d){return[];}},'set':function(_0x5b00b2){try{this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify'](_0x5b00b2));}catch(_0x2242a7){this[_0xef61('0xa')](_0xef61('0x9'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xef61('0xb')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xef61('0xb')]},'col':{'type':Sequelize[_0xef61('0xb')]},'background':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xc'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xef61('0x4')],'allowNull':![],'defaultValue':_0xef61('0xd'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xef61('0x4')]},'titleFontSize':{'type':Sequelize[_0xef61('0xb')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index adeca48..43456ca 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 _0x05bc=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','update','then','error','stack','name','send','show','keys','DashboardItem','rawAttributes','model','query','attributes','fields','length','includeAll','merge','options','catch','destroy','find','params','type','attrUrl','attrs','value','custom','attrPath','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrFaxAccounts','attrSmsAccounts','attrOpenchannelAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x20db5c,_0x3e2079){var _0x299b65=function(_0x4d38bd){while(--_0x4d38bd){_0x20db5c['push'](_0x20db5c['shift']());}};_0x299b65(++_0x3e2079);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc05b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc05b('0x1'));var rp=require(_0xc05b('0x2'));var moment=require('moment');var BPromise=require(_0xc05b('0x3'));var Mustache=require(_0xc05b('0x4'));var util=require(_0xc05b('0x5'));var path=require(_0xc05b('0x6'));var sox=require(_0xc05b('0x7'));var csv=require(_0xc05b('0x8'));var ejs=require(_0xc05b('0x9'));var fs=require('fs');var fs_extra=require(_0xc05b('0xa'));var _=require(_0xc05b('0xb'));var squel=require(_0xc05b('0xc'));var crypto=require(_0xc05b('0xd'));var jsforce=require(_0xc05b('0xe'));var deskjs=require(_0xc05b('0xf'));var toCsv=require(_0xc05b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc05b('0x10'));var authService=require(_0xc05b('0x11'));var qs=require(_0xc05b('0x12'));var as=require(_0xc05b('0x13'));var hardwareService=require(_0xc05b('0x14'));var logger=require(_0xc05b('0x15'))(_0xc05b('0x16'));var utils=require(_0xc05b('0x17'));var config=require(_0xc05b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc05b('0x19'))['db'];config[_0xc05b('0x1a')]=_[_0xc05b('0x1b')](config[_0xc05b('0x1a')],{'host':_0xc05b('0x1c'),'port':0x18eb});var socket=require(_0xc05b('0x1d'))(new Redis(config['redis']));require(_0xc05b('0x1e'))[_0xc05b('0x1f')](socket);function respondWithStatusCode(_0x55ec04,_0x4d4698){_0x4d4698=_0x4d4698||0xcc;return function(_0x356b76){if(_0x356b76){return _0x55ec04[_0xc05b('0x20')](_0x4d4698);}return _0x55ec04[_0xc05b('0x21')](_0x4d4698)[_0xc05b('0x22')]();};}function respondWithResult(_0x387036,_0x21435e){_0x21435e=_0x21435e||0xc8;return function(_0xe94a8f){if(_0xe94a8f){return _0x387036['status'](_0x21435e)[_0xc05b('0x23')](_0xe94a8f);}};}function respondWithFilteredResult(_0x13c79f,_0xee4d8){return function(_0x421cb){if(_0x421cb){var _0x1cba94=typeof _0xee4d8[_0xc05b('0x24')]==='undefined'&&typeof _0xee4d8[_0xc05b('0x25')]==='undefined';var _0x3cc005=_0x421cb[_0xc05b('0x26')];var _0x45d561=_0x1cba94?0x0:_0xee4d8[_0xc05b('0x24')];var _0x11531b=_0x1cba94?_0x421cb['count']:_0xee4d8[_0xc05b('0x24')]+_0xee4d8[_0xc05b('0x25')];var _0x1837fa;if(_0x11531b>=_0x3cc005){_0x11531b=_0x3cc005;_0x1837fa=0xc8;}else{_0x1837fa=0xce;}_0x13c79f[_0xc05b('0x21')](_0x1837fa);return _0x13c79f['set'](_0xc05b('0x27'),_0x45d561+'-'+_0x11531b+'/'+_0x3cc005)[_0xc05b('0x23')](_0x421cb);}return null;};}function patchUpdates(_0x2692c2){return function(_0x1edaa0){try{jsonpatch[_0xc05b('0x28')](_0x1edaa0,_0x2692c2,!![]);}catch(_0x9a67cc){return BPromise['reject'](_0x9a67cc);}return _0x1edaa0['save']();};}function saveUpdates(_0x2699fb,_0x382743){return function(_0x5c88ad){if(_0x5c88ad){return _0x5c88ad[_0xc05b('0x29')](_0x2699fb)['then'](function(_0x54b3a9){return _0x54b3a9;});}return null;};}function removeEntity(_0x19cadd,_0x58ab0e){return function(_0x4eee98){if(_0x4eee98){return _0x4eee98['destroy']()[_0xc05b('0x2a')](function(){_0x19cadd['status'](0xcc)[_0xc05b('0x22')]();});}};}function handleEntityNotFound(_0xffe261,_0x4d1fd4){return function(_0x337cc1){if(!_0x337cc1){_0xffe261[_0xc05b('0x20')](0x194);}return _0x337cc1;};}function handleError(_0x444a55,_0x3e26c4){_0x3e26c4=_0x3e26c4||0x1f4;return function(_0x23a937){logger[_0xc05b('0x2b')](_0x23a937[_0xc05b('0x2c')]);if(_0x23a937[_0xc05b('0x2d')]){delete _0x23a937[_0xc05b('0x2d')];}_0x444a55[_0xc05b('0x21')](_0x3e26c4)[_0xc05b('0x2e')](_0x23a937);};}exports[_0xc05b('0x2f')]=function(_0x4fbdc7,_0x3ca295){var _0x56cc4a={'raw':![],'where':{'id':_0x4fbdc7['params']['id']}},_0x370d05={};_0x370d05['model']=_[_0xc05b('0x30')](db[_0xc05b('0x31')][_0xc05b('0x32')]);_0x370d05['query']=_[_0xc05b('0x30')](_0x4fbdc7['query']);_0x370d05['filters']=_['intersection'](_0x370d05[_0xc05b('0x33')],_0x370d05[_0xc05b('0x34')]);_0x56cc4a[_0xc05b('0x35')]=_['intersection'](_0x370d05[_0xc05b('0x33')],qs[_0xc05b('0x36')](_0x4fbdc7[_0xc05b('0x34')][_0xc05b('0x36')]));_0x56cc4a['attributes']=_0x56cc4a[_0xc05b('0x35')][_0xc05b('0x37')]?_0x56cc4a[_0xc05b('0x35')]:_0x370d05['model'];if(_0x4fbdc7[_0xc05b('0x34')][_0xc05b('0x38')]){_0x56cc4a['include']=[{'all':!![]}];}_0x56cc4a=_[_0xc05b('0x39')]({},_0x56cc4a,_0x4fbdc7[_0xc05b('0x3a')]);return db['DashboardItem']['find'](_0x56cc4a)[_0xc05b('0x2a')](handleEntityNotFound(_0x3ca295,null))[_0xc05b('0x2a')](respondWithResult(_0x3ca295,null))[_0xc05b('0x3b')](handleError(_0x3ca295,null));};exports[_0xc05b('0x3c')]=function(_0x549899,_0x19cff2){return db['DashboardItem'][_0xc05b('0x3d')]({'where':{'id':_0x549899[_0xc05b('0x3e')]['id']}})[_0xc05b('0x2a')](handleEntityNotFound(_0x19cff2,null))[_0xc05b('0x2a')](removeEntity(_0x19cff2,null))['catch'](handleError(_0x19cff2,null));};function widgetAttributes(_0x7fa59d){try{switch(_0x7fa59d[_0xc05b('0x3f')]){case'iframe':return[{'name':'attrUrl','value':_0x7fa59d[_0xc05b('0x40')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0][_0xc05b('0x42')]:undefined)||'https://'}];case _0xc05b('0x43'):return[{'name':_0xc05b('0x44'),'value':_0x7fa59d[_0xc05b('0x44')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x0]?_0x7fa59d['attrs'][0x0][_0xc05b('0x42')]:undefined)||''}];case'clock':return[{'name':_0xc05b('0x45'),'value':_0x7fa59d['attrHourFormat']||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0][_0xc05b('0x42')]:undefined)||'HH:mm:ss'},{'name':'attrTimezone','value':_0x7fa59d[_0xc05b('0x46')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x1]?_0x7fa59d['attrs'][0x1][_0xc05b('0x42')]:undefined)||_0xc05b('0x47')},{'name':'attrFontSize','value':_0x7fa59d[_0xc05b('0x48')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x2]?_0x7fa59d[_0xc05b('0x41')][0x2][_0xc05b('0x42')]:undefined)||0xc}];case _0xc05b('0x49'):return[{'name':_0xc05b('0x4a'),'value':_0x7fa59d[_0xc05b('0x4a')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0]['value']:undefined)||_0xc05b('0x4b')},{'name':_0xc05b('0x4c'),'value':_0x7fa59d[_0xc05b('0x4c')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x1]?_0x7fa59d[_0xc05b('0x41')][0x1][_0xc05b('0x42')]:undefined)||[]},{'name':_0xc05b('0x48'),'value':_0x7fa59d['attrFontSize']||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x2]?_0x7fa59d['attrs'][0x2][_0xc05b('0x42')]:undefined)||0x14},{'name':_0xc05b('0x4d'),'value':_0x7fa59d[_0xc05b('0x4d')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x3]?_0x7fa59d[_0xc05b('0x41')][0x3][_0xc05b('0x42')]:undefined)||_0xc05b('0x4e')},{'name':_0xc05b('0x4f'),'value':_0x7fa59d[_0xc05b('0x4f')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x4]?_0x7fa59d[_0xc05b('0x41')][0x4][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x50'),'value':_0x7fa59d[_0xc05b('0x50')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x5]?_0x7fa59d[_0xc05b('0x41')][0x5][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x51'),'value':_0x7fa59d[_0xc05b('0x51')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x6]?_0x7fa59d[_0xc05b('0x41')][0x6]['value']:undefined)||''},{'name':_0xc05b('0x52'),'value':_0x7fa59d[_0xc05b('0x52')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x7]?_0x7fa59d[_0xc05b('0x41')][0x7][_0xc05b('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7fa59d[_0xc05b('0x53')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x8]?_0x7fa59d[_0xc05b('0x41')][0x8][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x54'),'value':_0x7fa59d[_0xc05b('0x54')]||(_0x7fa59d['attrs']&&_0x7fa59d['attrs'][0x9]?_0x7fa59d[_0xc05b('0x41')][0x9][_0xc05b('0x42')]:undefined)||''}];case _0xc05b('0x55'):case _0xc05b('0x56'):return[{'name':'attrSerie1','value':_0x7fa59d[_0xc05b('0x57')]||(_0x7fa59d['attrs']&&_0x7fa59d['attrs'][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0][_0xc05b('0x42')]:undefined)||_0xc05b('0x4b')},{'name':_0xc05b('0x58'),'value':_0x7fa59d[_0xc05b('0x58')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x1]?_0x7fa59d['attrs'][0x1][_0xc05b('0x42')]:undefined)||null},{'name':_0xc05b('0x59'),'value':_0x7fa59d[_0xc05b('0x59')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x2]?_0x7fa59d[_0xc05b('0x41')][0x2][_0xc05b('0x42')]:undefined)||null},{'name':_0xc05b('0x4c'),'value':_0x7fa59d[_0xc05b('0x4c')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x3]?_0x7fa59d['attrs'][0x3][_0xc05b('0x42')]:undefined)||[]},{'name':_0xc05b('0x4d'),'value':_0x7fa59d[_0xc05b('0x4d')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x4]?_0x7fa59d[_0xc05b('0x41')][0x4][_0xc05b('0x42')]:undefined)||'voice'},{'name':_0xc05b('0x4f'),'value':_0x7fa59d[_0xc05b('0x4f')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x5]?_0x7fa59d['attrs'][0x5][_0xc05b('0x42')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x7fa59d['attrFaxAccounts']||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x6]?_0x7fa59d[_0xc05b('0x41')][0x6][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x51'),'value':_0x7fa59d[_0xc05b('0x51')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x7]?_0x7fa59d[_0xc05b('0x41')][0x7][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x52'),'value':_0x7fa59d[_0xc05b('0x52')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x8]?_0x7fa59d[_0xc05b('0x41')][0x8][_0xc05b('0x42')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x7fa59d[_0xc05b('0x53')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x9]?_0x7fa59d['attrs'][0x9][_0xc05b('0x42')]:undefined)||''},{'name':_0xc05b('0x54'),'value':_0x7fa59d[_0xc05b('0x54')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0xa]?_0x7fa59d[_0xc05b('0x41')][0xa][_0xc05b('0x42')]:undefined)||''}];case _0xc05b('0x5a'):return[{'name':_0xc05b('0x5b'),'type':_0x7fa59d[_0xc05b('0x5c')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d[_0xc05b('0x41')][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0][_0xc05b('0x3f')]:undefined)||null,'value':_0x7fa59d[_0xc05b('0x5b')]||(_0x7fa59d['attrs']&&_0x7fa59d[_0xc05b('0x41')][0x0]?_0x7fa59d[_0xc05b('0x41')][0x0][_0xc05b('0x42')]:undefined)||null},{'name':_0xc05b('0x5d'),'value':_0x7fa59d[_0xc05b('0x5d')]||(_0x7fa59d[_0xc05b('0x41')]&&_0x7fa59d['attrs'][0x1]?_0x7fa59d[_0xc05b('0x41')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x19696d){logger[_0xc05b('0x2b')](_0xc05b('0x5e'),JSON[_0xc05b('0x5f')](_0x19696d));return[];}}exports[_0xc05b('0x60')]=function(_0x13931f,_0x49be79){if(_0x13931f[_0xc05b('0x61')]){_0x13931f[_0xc05b('0x61')]['attrs']=widgetAttributes(_0x13931f[_0xc05b('0x61')]);}return db[_0xc05b('0x31')][_0xc05b('0x60')](_0x13931f[_0xc05b('0x61')],{})[_0xc05b('0x2a')](respondWithResult(_0x49be79,0xc9))[_0xc05b('0x3b')](handleError(_0x49be79,null));};exports[_0xc05b('0x29')]=function(_0x4f7d2b,_0x40f392){if(_0x4f7d2b[_0xc05b('0x61')]['id']){delete _0x4f7d2b[_0xc05b('0x61')]['id'];}_0x4f7d2b[_0xc05b('0x61')][_0xc05b('0x41')]=widgetAttributes(_0x4f7d2b[_0xc05b('0x61')]);return db['DashboardItem'][_0xc05b('0x3d')]({'where':{'id':_0x4f7d2b[_0xc05b('0x3e')]['id']}})[_0xc05b('0x2a')](handleEntityNotFound(_0x40f392,null))[_0xc05b('0x2a')](saveUpdates(_0x4f7d2b['body'],null))['then'](respondWithResult(_0x40f392,null))[_0xc05b('0x3b')](handleError(_0x40f392,null));}; \ No newline at end of file +var _0xd7ce=['localhost','./dashboardItem.socket','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','then','end','error','stack','name','send','show','model','keys','DashboardItem','query','filters','attributes','intersection','fields','includeAll','include','merge','find','params','catch','type','iframe','attrUrl','value','https://','custom','attrPath','attrs','clock','attrHourFormat','attrTimezone','attrFontSize','counter','attrMetric','total','attrVoiceQueues','attrChannel','voice','attrEmailAccounts','attrSmsAccounts','attrWhatsappAccounts','attrChatWebsites','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrFaxAccounts','attrOpenchannelAccounts','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','create','update','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','defaults','redis'];(function(_0x196bb7,_0xa61f0a){var _0x5ba0c7=function(_0x16eae6){while(--_0x16eae6){_0x196bb7['push'](_0x196bb7['shift']());}};_0x5ba0c7(++_0xa61f0a);}(_0xd7ce,0x16b));var _0xed7c=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xd7ce[_0xa8883];return _0x479426;};'use strict';var emlformat=require(_0xed7c('0x0'));var rimraf=require(_0xed7c('0x1'));var zipdir=require(_0xed7c('0x2'));var jsonpatch=require(_0xed7c('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xed7c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xed7c('0x5'));var csv=require(_0xed7c('0x6'));var ejs=require(_0xed7c('0x7'));var fs=require('fs');var fs_extra=require(_0xed7c('0x8'));var _=require(_0xed7c('0x9'));var squel=require(_0xed7c('0xa'));var crypto=require(_0xed7c('0xb'));var jsforce=require(_0xed7c('0xc'));var deskjs=require(_0xed7c('0xd'));var toCsv=require(_0xed7c('0x6'));var querystring=require(_0xed7c('0xe'));var Papa=require(_0xed7c('0xf'));var Redis=require('ioredis');var authService=require(_0xed7c('0x10'));var qs=require(_0xed7c('0x11'));var as=require(_0xed7c('0x12'));var hardwareService=require(_0xed7c('0x13'));var logger=require(_0xed7c('0x14'))(_0xed7c('0x15'));var utils=require('../../config/utils');var config=require(_0xed7c('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0xed7c('0x17')](config[_0xed7c('0x18')],{'host':_0xed7c('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xed7c('0x1a'))['register'](socket);function respondWithStatusCode(_0x4400a1,_0x1127fa){_0x1127fa=_0x1127fa||0xcc;return function(_0x48ce3f){if(_0x48ce3f){return _0x4400a1[_0xed7c('0x1b')](_0x1127fa);}return _0x4400a1[_0xed7c('0x1c')](_0x1127fa)['end']();};}function respondWithResult(_0x513ea6,_0x16c79f){_0x16c79f=_0x16c79f||0xc8;return function(_0x28d260){if(_0x28d260){return _0x513ea6[_0xed7c('0x1c')](_0x16c79f)['json'](_0x28d260);}};}function respondWithFilteredResult(_0x575651,_0x31d582){return function(_0x125447){if(_0x125447){var _0x2cc52b=typeof _0x31d582[_0xed7c('0x1d')]===_0xed7c('0x1e')&&typeof _0x31d582[_0xed7c('0x1f')]===_0xed7c('0x1e');var _0x3f817a=_0x125447[_0xed7c('0x20')];var _0x4f09b4=_0x2cc52b?0x0:_0x31d582['offset'];var _0x188b2c=_0x2cc52b?_0x125447['count']:_0x31d582[_0xed7c('0x1d')]+_0x31d582[_0xed7c('0x1f')];var _0x13fe87;if(_0x188b2c>=_0x3f817a){_0x188b2c=_0x3f817a;_0x13fe87=0xc8;}else{_0x13fe87=0xce;}_0x575651['status'](_0x13fe87);return _0x575651[_0xed7c('0x21')](_0xed7c('0x22'),_0x4f09b4+'-'+_0x188b2c+'/'+_0x3f817a)[_0xed7c('0x23')](_0x125447);}return null;};}function patchUpdates(_0x177cdf){return function(_0x2a7a4e){try{jsonpatch[_0xed7c('0x24')](_0x2a7a4e,_0x177cdf,!![]);}catch(_0x2c821b){return BPromise[_0xed7c('0x25')](_0x2c821b);}return _0x2a7a4e[_0xed7c('0x26')]();};}function saveUpdates(_0x10e1e1,_0x3719cc){return function(_0xb3f759){if(_0xb3f759){return _0xb3f759['update'](_0x10e1e1)['then'](function(_0x5d20e6){return _0x5d20e6;});}return null;};}function removeEntity(_0x453257,_0x3c03a2){return function(_0x3406f0){if(_0x3406f0){return _0x3406f0[_0xed7c('0x27')]()[_0xed7c('0x28')](function(){_0x453257[_0xed7c('0x1c')](0xcc)[_0xed7c('0x29')]();});}};}function handleEntityNotFound(_0x22354e,_0x183874){return function(_0x46c6b5){if(!_0x46c6b5){_0x22354e[_0xed7c('0x1b')](0x194);}return _0x46c6b5;};}function handleError(_0x56af94,_0x43b842){_0x43b842=_0x43b842||0x1f4;return function(_0x1cf8d2){logger[_0xed7c('0x2a')](_0x1cf8d2[_0xed7c('0x2b')]);if(_0x1cf8d2[_0xed7c('0x2c')]){delete _0x1cf8d2['name'];}_0x56af94['status'](_0x43b842)[_0xed7c('0x2d')](_0x1cf8d2);};}exports[_0xed7c('0x2e')]=function(_0x571e0e,_0x1a35a6){var _0xfc533c={'raw':![],'where':{'id':_0x571e0e['params']['id']}},_0x4c8d17={};_0x4c8d17[_0xed7c('0x2f')]=_[_0xed7c('0x30')](db[_0xed7c('0x31')]['rawAttributes']);_0x4c8d17[_0xed7c('0x32')]=_['keys'](_0x571e0e[_0xed7c('0x32')]);_0x4c8d17[_0xed7c('0x33')]=_['intersection'](_0x4c8d17[_0xed7c('0x2f')],_0x4c8d17['query']);_0xfc533c[_0xed7c('0x34')]=_[_0xed7c('0x35')](_0x4c8d17[_0xed7c('0x2f')],qs[_0xed7c('0x36')](_0x571e0e[_0xed7c('0x32')][_0xed7c('0x36')]));_0xfc533c['attributes']=_0xfc533c[_0xed7c('0x34')]['length']?_0xfc533c['attributes']:_0x4c8d17[_0xed7c('0x2f')];if(_0x571e0e['query'][_0xed7c('0x37')]){_0xfc533c[_0xed7c('0x38')]=[{'all':!![]}];}_0xfc533c=_[_0xed7c('0x39')]({},_0xfc533c,_0x571e0e['options']);return db[_0xed7c('0x31')][_0xed7c('0x3a')](_0xfc533c)[_0xed7c('0x28')](handleEntityNotFound(_0x1a35a6,null))[_0xed7c('0x28')](respondWithResult(_0x1a35a6,null))['catch'](handleError(_0x1a35a6,null));};exports[_0xed7c('0x27')]=function(_0xe27900,_0x1fca4f){return db[_0xed7c('0x31')]['find']({'where':{'id':_0xe27900[_0xed7c('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1fca4f,null))[_0xed7c('0x28')](removeEntity(_0x1fca4f,null))[_0xed7c('0x3c')](handleError(_0x1fca4f,null));};function widgetAttributes(_0x96fbf){try{switch(_0x96fbf[_0xed7c('0x3d')]){case _0xed7c('0x3e'):return[{'name':_0xed7c('0x3f'),'value':_0x96fbf[_0xed7c('0x3f')]||(_0x96fbf['attrs']&&_0x96fbf['attrs'][0x0]?_0x96fbf['attrs'][0x0][_0xed7c('0x40')]:undefined)||_0xed7c('0x41')}];case _0xed7c('0x42'):return[{'name':_0xed7c('0x43'),'value':_0x96fbf[_0xed7c('0x43')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x0]?_0x96fbf['attrs'][0x0]['value']:undefined)||''}];case _0xed7c('0x45'):return[{'name':_0xed7c('0x46'),'value':_0x96fbf[_0xed7c('0x46')]||(_0x96fbf['attrs']&&_0x96fbf['attrs'][0x0]?_0x96fbf[_0xed7c('0x44')][0x0][_0xed7c('0x40')]:undefined)||'HH:mm:ss'},{'name':_0xed7c('0x47'),'value':_0x96fbf['attrTimezone']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x1]?_0x96fbf['attrs'][0x1][_0xed7c('0x40')]:undefined)||'0.00'},{'name':_0xed7c('0x48'),'value':_0x96fbf[_0xed7c('0x48')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf['attrs'][0x2]?_0x96fbf[_0xed7c('0x44')][0x2][_0xed7c('0x40')]:undefined)||0xc}];case _0xed7c('0x49'):return[{'name':_0xed7c('0x4a'),'value':_0x96fbf[_0xed7c('0x4a')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x0]?_0x96fbf[_0xed7c('0x44')][0x0][_0xed7c('0x40')]:undefined)||_0xed7c('0x4b')},{'name':_0xed7c('0x4c'),'value':_0x96fbf[_0xed7c('0x4c')]||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x1]?_0x96fbf[_0xed7c('0x44')][0x1]['value']:undefined)||[]},{'name':'attrFontSize','value':_0x96fbf['attrFontSize']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x2]?_0x96fbf['attrs'][0x2]['value']:undefined)||0x14},{'name':'attrChannel','value':_0x96fbf[_0xed7c('0x4d')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x3]?_0x96fbf[_0xed7c('0x44')][0x3][_0xed7c('0x40')]:undefined)||_0xed7c('0x4e')},{'name':_0xed7c('0x4f'),'value':_0x96fbf[_0xed7c('0x4f')]||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x4]?_0x96fbf[_0xed7c('0x44')][0x4][_0xed7c('0x40')]:undefined)||''},{'name':'attrFaxAccounts','value':_0x96fbf['attrFaxAccounts']||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x5]?_0x96fbf['attrs'][0x5]['value']:undefined)||''},{'name':_0xed7c('0x50'),'value':_0x96fbf[_0xed7c('0x50')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x6]?_0x96fbf[_0xed7c('0x44')][0x6][_0xed7c('0x40')]:undefined)||''},{'name':'attrOpenchannelAccounts','value':_0x96fbf['attrOpenchannelAccounts']||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x7]?_0x96fbf[_0xed7c('0x44')][0x7][_0xed7c('0x40')]:undefined)||''},{'name':'attrWhatsappAccounts','value':_0x96fbf[_0xed7c('0x51')]||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x8]?_0x96fbf[_0xed7c('0x44')][0x8][_0xed7c('0x40')]:undefined)||''},{'name':_0xed7c('0x52'),'value':_0x96fbf['attrChatWebsites']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x9]?_0x96fbf['attrs'][0x9]['value']:undefined)||''}];case _0xed7c('0x53'):case'pie-chart':return[{'name':_0xed7c('0x54'),'value':_0x96fbf['attrSerie1']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf['attrs'][0x0]?_0x96fbf[_0xed7c('0x44')][0x0][_0xed7c('0x40')]:undefined)||_0xed7c('0x4b')},{'name':_0xed7c('0x55'),'value':_0x96fbf['attrSerie2']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x1]?_0x96fbf[_0xed7c('0x44')][0x1][_0xed7c('0x40')]:undefined)||null},{'name':_0xed7c('0x56'),'value':_0x96fbf[_0xed7c('0x56')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x2]?_0x96fbf[_0xed7c('0x44')][0x2][_0xed7c('0x40')]:undefined)||null},{'name':_0xed7c('0x4c'),'value':_0x96fbf[_0xed7c('0x4c')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x3]?_0x96fbf['attrs'][0x3][_0xed7c('0x40')]:undefined)||[]},{'name':_0xed7c('0x4d'),'value':_0x96fbf[_0xed7c('0x4d')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x4]?_0x96fbf[_0xed7c('0x44')][0x4][_0xed7c('0x40')]:undefined)||_0xed7c('0x4e')},{'name':_0xed7c('0x4f'),'value':_0x96fbf['attrEmailAccounts']||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x5]?_0x96fbf[_0xed7c('0x44')][0x5][_0xed7c('0x40')]:undefined)||''},{'name':_0xed7c('0x57'),'value':_0x96fbf[_0xed7c('0x57')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x6]?_0x96fbf[_0xed7c('0x44')][0x6][_0xed7c('0x40')]:undefined)||''},{'name':_0xed7c('0x50'),'value':_0x96fbf[_0xed7c('0x50')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x7]?_0x96fbf[_0xed7c('0x44')][0x7][_0xed7c('0x40')]:undefined)||''},{'name':_0xed7c('0x58'),'value':_0x96fbf[_0xed7c('0x58')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf['attrs'][0x8]?_0x96fbf[_0xed7c('0x44')][0x8][_0xed7c('0x40')]:undefined)||''},{'name':_0xed7c('0x51'),'value':_0x96fbf[_0xed7c('0x51')]||(_0x96fbf['attrs']&&_0x96fbf[_0xed7c('0x44')][0x9]?_0x96fbf[_0xed7c('0x44')][0x9]['value']:undefined)||''},{'name':_0xed7c('0x52'),'value':_0x96fbf['attrChatWebsites']||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0xa]?_0x96fbf[_0xed7c('0x44')][0xa][_0xed7c('0x40')]:undefined)||''}];case _0xed7c('0x59'):return[{'name':_0xed7c('0x5a'),'type':_0x96fbf[_0xed7c('0x5b')]||(_0x96fbf['attrs']&&_0x96fbf['attrs'][0x0]?_0x96fbf[_0xed7c('0x44')][0x0][_0xed7c('0x3d')]:undefined)||null,'value':_0x96fbf[_0xed7c('0x5a')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x0]?_0x96fbf[_0xed7c('0x44')][0x0]['value']:undefined)||null},{'name':_0xed7c('0x5c'),'value':_0x96fbf[_0xed7c('0x5c')]||(_0x96fbf[_0xed7c('0x44')]&&_0x96fbf[_0xed7c('0x44')][0x1]?_0x96fbf[_0xed7c('0x44')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1d321e){logger[_0xed7c('0x2a')](_0xed7c('0x5d'),JSON['stringify'](_0x1d321e));return[];}}exports['create']=function(_0x260d3c,_0x1e1a75){if(_0x260d3c[_0xed7c('0x5e')]){_0x260d3c[_0xed7c('0x5e')][_0xed7c('0x44')]=widgetAttributes(_0x260d3c[_0xed7c('0x5e')]);}return db[_0xed7c('0x31')][_0xed7c('0x5f')](_0x260d3c[_0xed7c('0x5e')],{})[_0xed7c('0x28')](respondWithResult(_0x1e1a75,0xc9))[_0xed7c('0x3c')](handleError(_0x1e1a75,null));};exports[_0xed7c('0x60')]=function(_0x29343b,_0x168517){if(_0x29343b[_0xed7c('0x5e')]['id']){delete _0x29343b[_0xed7c('0x5e')]['id'];}_0x29343b[_0xed7c('0x5e')]['attrs']=widgetAttributes(_0x29343b[_0xed7c('0x5e')]);return db[_0xed7c('0x31')][_0xed7c('0x3a')]({'where':{'id':_0x29343b[_0xed7c('0x3b')]['id']}})[_0xed7c('0x28')](handleEntityNotFound(_0x168517,null))[_0xed7c('0x28')](saveUpdates(_0x29343b[_0xed7c('0x5e')],null))['then'](respondWithResult(_0x168517,null))[_0xed7c('0x3c')](handleError(_0x168517,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 1a1a973..6ff8167 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 _0xb66a=['emit','hook','exports','events','../../mysqldb','DashboardItem','save','remove'];(function(_0x3299a8,_0x2b0549){var _0x299352=function(_0x453061){while(--_0x453061){_0x3299a8['push'](_0x3299a8['shift']());}};_0x299352(++_0x2b0549);}(_0xb66a,0x163));var _0xab66=function(_0x55dfce,_0x3596d9){_0x55dfce=_0x55dfce-0x0;var _0x25066f=_0xb66a[_0x55dfce];return _0x25066f;};'use strict';var EventEmitter=require(_0xab66('0x0'));var DashboardItem=require(_0xab66('0x1'))['db'][_0xab66('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xab66('0x3'),'afterUpdate':'update','afterDestroy':_0xab66('0x4')};function emitEvent(_0x507062){return function(_0x3e5f61,_0xdff0cb,_0x1567a9){DashboardItemEvents['emit'](_0x507062+':'+_0x3e5f61['id'],_0x3e5f61);DashboardItemEvents[_0xab66('0x5')](_0x507062,_0x3e5f61);_0x1567a9(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xab66('0x6')](e,emitEvent(event));}}module[_0xab66('0x7')]=DashboardItemEvents; \ No newline at end of file +var _0xeaf1=['events','../../mysqldb','DashboardItem','setMaxListeners','update','remove','emit','hasOwnProperty','exports'];(function(_0x455e73,_0x3bfcb8){var _0x24c0d6=function(_0x1ab851){while(--_0x1ab851){_0x455e73['push'](_0x455e73['shift']());}};_0x24c0d6(++_0x3bfcb8);}(_0xeaf1,0x87));var _0x1eaf=function(_0x39ed3a,_0x169052){_0x39ed3a=_0x39ed3a-0x0;var _0x25fcc7=_0xeaf1[_0x39ed3a];return _0x25fcc7;};'use strict';var EventEmitter=require(_0x1eaf('0x0'));var DashboardItem=require(_0x1eaf('0x1'))['db'][_0x1eaf('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x1eaf('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1eaf('0x4'),'afterDestroy':_0x1eaf('0x5')};function emitEvent(_0x16a877){return function(_0xcc4775,_0x289f32,_0x425010){DashboardItemEvents[_0x1eaf('0x6')](_0x16a877+':'+_0xcc4775['id'],_0xcc4775);DashboardItemEvents['emit'](_0x16a877,_0xcc4775);_0x425010(null);};}for(var e in events){if(events[_0x1eaf('0x7')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x1eaf('0x8')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 71cfc71..30c6ec9 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 _0xb950=['rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x381cd5,_0x1f66dd){var _0x14b162=function(_0x1e7e89){while(--_0x1e7e89){_0x381cd5['push'](_0x381cd5['shift']());}};_0x14b162(++_0x1f66dd);}(_0xb950,0x18d));var _0x0b95=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb950[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x0b95('0x0'));var util=require('util');var logger=require(_0x0b95('0x1'))('api');var moment=require(_0x0b95('0x2'));var BPromise=require(_0x0b95('0x3'));var rp=require(_0x0b95('0x4'));var fs=require('fs');var path=require(_0x0b95('0x5'));var rimraf=require(_0x0b95('0x6'));var config=require(_0x0b95('0x7'));var attributes=require(_0x0b95('0x8'));module[_0x0b95('0x9')]=function(_0x49e552,_0x50fd5e){return _0x49e552[_0x0b95('0xa')](_0x0b95('0xb'),attributes,{'tableName':_0x0b95('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc0d=['path','define','DashboardItem','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x52212d,_0xaccc45){var _0x39c7a5=function(_0x5926e7){while(--_0x5926e7){_0x52212d['push'](_0x52212d['shift']());}};_0x39c7a5(++_0xaccc45);}(_0xfc0d,0x17b));var _0xdfc0=function(_0x594e62,_0x8024f9){_0x594e62=_0x594e62-0x0;var _0x5dac03=_0xfc0d[_0x594e62];return _0x5dac03;};'use strict';var _=require(_0xdfc0('0x0'));var util=require('util');var logger=require(_0xdfc0('0x1'))(_0xdfc0('0x2'));var moment=require('moment');var BPromise=require(_0xdfc0('0x3'));var rp=require(_0xdfc0('0x4'));var fs=require('fs');var path=require(_0xdfc0('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./dashboardItem.attributes');module['exports']=function(_0x3ab21c,_0x1138ac){return _0x3ab21c[_0xdfc0('0x6')](_0xdfc0('0x7'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index cf6ca97..7ac8f8d 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 _0xe15c=['./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','localhost','socket.io-emitter'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0xe15c,0xae));var _0xce15=function(_0x5a79ac,_0x4312e4){_0x5a79ac=_0x5a79ac-0x0;var _0x11108f=_0xe15c[_0x5a79ac];return _0x11108f;};'use strict';var _=require(_0xce15('0x0'));var util=require(_0xce15('0x1'));var moment=require(_0xce15('0x2'));var BPromise=require(_0xce15('0x3'));var rs=require(_0xce15('0x4'));var fs=require('fs');var Redis=require(_0xce15('0x5'));var db=require(_0xce15('0x6'))['db'];var utils=require(_0xce15('0x7'));var logger=require(_0xce15('0x8'))(_0xce15('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xce15('0xa')][_0xce15('0xb')]({'port':0x232a});config[_0xce15('0xc')]=_['defaults'](config['redis'],{'host':_0xce15('0xd'),'port':0x18eb});var socket=require(_0xce15('0xe'))(new Redis(config['redis']));require(_0xce15('0xf'))[_0xce15('0x10')](socket);function respondWithRpcPromise(_0x5ea7fd,_0x17fd43,_0x359147){return new BPromise(function(_0xf25cfa,_0x4b0115){return client['request'](_0x5ea7fd,_0x359147)[_0xce15('0x11')](function(_0xf64260){logger[_0xce15('0x12')](_0xce15('0x13'),_0x17fd43,_0xce15('0x14'));logger[_0xce15('0x15')](_0xce15('0x16'),_0x17fd43,_0xce15('0x14'),JSON['stringify'](_0xf64260));if(_0xf64260[_0xce15('0x17')]){if(_0xf64260['error']['code']===0x1f4){logger[_0xce15('0x17')]('DashboardItem,\x20%s,\x20%s',_0x17fd43,_0xf64260[_0xce15('0x17')]['message']);return _0x4b0115(_0xf64260['error'][_0xce15('0x18')]);}logger[_0xce15('0x17')](_0xce15('0x13'),_0x17fd43,_0xf64260[_0xce15('0x17')]['message']);return _0xf25cfa(_0xf64260[_0xce15('0x17')][_0xce15('0x18')]);}else{logger[_0xce15('0x12')](_0xce15('0x13'),_0x17fd43,_0xce15('0x14'));_0xf25cfa(_0xf64260[_0xce15('0x19')][_0xce15('0x18')]);}})[_0xce15('0x1a')](function(_0x99d698){logger[_0xce15('0x17')](_0xce15('0x13'),_0x17fd43,_0x99d698);_0x4b0115(_0x99d698);});});} \ No newline at end of file +var _0x9a7b=['stringify','error','message','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s'];(function(_0x5e9e9d,_0x13d590){var _0x5f0e78=function(_0x4f78b9){while(--_0x4f78b9){_0x5e9e9d['push'](_0x5e9e9d['shift']());}};_0x5f0e78(++_0x13d590);}(_0x9a7b,0xe5));var _0xb9a7=function(_0x2938de,_0x2fde69){_0x2938de=_0x2938de-0x0;var _0x391317=_0x9a7b[_0x2938de];return _0x391317;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb9a7('0x0'));var BPromise=require(_0xb9a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9a7('0x2'));var db=require(_0xb9a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb9a7('0x4'))(_0xb9a7('0x5'));var config=require(_0xb9a7('0x6'));var jayson=require(_0xb9a7('0x7'));var client=jayson[_0xb9a7('0x8')][_0xb9a7('0x9')]({'port':0x232a});config['redis']=_[_0xb9a7('0xa')](config['redis'],{'host':_0xb9a7('0xb'),'port':0x18eb});var socket=require(_0xb9a7('0xc'))(new Redis(config[_0xb9a7('0xd')]));require(_0xb9a7('0xe'))['register'](socket);function respondWithRpcPromise(_0x968b0f,_0xb00b0f,_0x20a532){return new BPromise(function(_0xafb107,_0x2604d4){return client[_0xb9a7('0xf')](_0x968b0f,_0x20a532)['then'](function(_0x5f5511){logger[_0xb9a7('0x10')](_0xb9a7('0x11'),_0xb00b0f,_0xb9a7('0x12'));logger[_0xb9a7('0x13')](_0xb9a7('0x14'),_0xb00b0f,'request\x20sent',JSON[_0xb9a7('0x15')](_0x5f5511));if(_0x5f5511[_0xb9a7('0x16')]){if(_0x5f5511[_0xb9a7('0x16')]['code']===0x1f4){logger['error'](_0xb9a7('0x11'),_0xb00b0f,_0x5f5511[_0xb9a7('0x16')]['message']);return _0x2604d4(_0x5f5511['error']['message']);}logger[_0xb9a7('0x16')](_0xb9a7('0x11'),_0xb00b0f,_0x5f5511[_0xb9a7('0x16')][_0xb9a7('0x17')]);return _0xafb107(_0x5f5511['error']['message']);}else{logger[_0xb9a7('0x10')](_0xb9a7('0x11'),_0xb00b0f,_0xb9a7('0x12'));_0xafb107(_0x5f5511['result'][_0xb9a7('0x17')]);}})[_0xb9a7('0x18')](function(_0x4f8cfb){logger[_0xb9a7('0x16')](_0xb9a7('0x11'),_0xb00b0f,_0x4f8cfb);_0x2604d4(_0x4f8cfb);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 516eddc..52ffac7 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 _0x82c2=['./dashboardItem.events','save','remove','update','emit','removeListener','length'];(function(_0x15eb47,_0x7da441){var _0x5abb28=function(_0x910585){while(--_0x910585){_0x15eb47['push'](_0x15eb47['shift']());}};_0x5abb28(++_0x7da441);}(_0x82c2,0x10a));var _0x282c=function(_0x3441e2,_0x57b820){_0x3441e2=_0x3441e2-0x0;var _0x1a129b=_0x82c2[_0x3441e2];return _0x1a129b;};'use strict';var DashboardItemEvents=require(_0x282c('0x0'));var events=[_0x282c('0x1'),_0x282c('0x2'),_0x282c('0x3')];function createListener(_0xda6914,_0x47f409){return function(_0x46ac02){_0x47f409[_0x282c('0x4')](_0xda6914,_0x46ac02);};}function removeListener(_0x549400,_0x1c0aad){return function(){DashboardItemEvents[_0x282c('0x5')](_0x549400,_0x1c0aad);};}exports['register']=function(_0x4d453c){for(var _0x58976a=0x0,_0x1c0dc8=events[_0x282c('0x6')];_0x58976a<_0x1c0dc8;_0x58976a++){var _0x5882a8=events[_0x58976a];var _0xf47621=createListener('dashboardItem:'+_0x5882a8,_0x4d453c);DashboardItemEvents['on'](_0x5882a8,_0xf47621);}}; \ No newline at end of file +var _0xe8be=['dashboardItem:','save','remove','update','emit','removeListener','register'];(function(_0x526df7,_0x3b8d27){var _0x2f94a1=function(_0x2fbe7b){while(--_0x2fbe7b){_0x526df7['push'](_0x526df7['shift']());}};_0x2f94a1(++_0x3b8d27);}(_0xe8be,0x1ba));var _0xee8b=function(_0x210d7f,_0x2abe4f){_0x210d7f=_0x210d7f-0x0;var _0x42d687=_0xe8be[_0x210d7f];return _0x42d687;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0xee8b('0x0'),_0xee8b('0x1'),_0xee8b('0x2')];function createListener(_0xd5b50a,_0x18305a){return function(_0x58d9aa){_0x18305a[_0xee8b('0x3')](_0xd5b50a,_0x58d9aa);};}function removeListener(_0x5628ae,_0x33e948){return function(){DashboardItemEvents[_0xee8b('0x4')](_0x5628ae,_0x33e948);};}exports[_0xee8b('0x5')]=function(_0x3e8228){for(var _0x181922=0x0,_0x5a22b3=events['length'];_0x181922<_0x5a22b3;_0x181922++){var _0x1df573=events[_0x181922];var _0x19da99=createListener(_0xee8b('0x6')+_0x1df573,_0x3e8228);DashboardItemEvents['on'](_0x1df573,_0x19da99);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index 1712dfe..be61b00 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 _0x6c12=['exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','delete'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x6c12,0xab));var _0x26c1=function(_0x1a0daa,_0x2a4634){_0x1a0daa=_0x1a0daa-0x0;var _0x1dbe15=_0x6c12[_0x1a0daa];return _0x1dbe15;};'use strict';var multer=require('multer');var util=require(_0x26c1('0x0'));var path=require(_0x26c1('0x1'));var timeout=require(_0x26c1('0x2'));var express=require(_0x26c1('0x3'));var router=express['Router']();var fs_extra=require(_0x26c1('0x4'));var auth=require(_0x26c1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x26c1('0x6'));var controller=require(_0x26c1('0x7'));router[_0x26c1('0x8')](_0x26c1('0x9'),auth[_0x26c1('0xa')](),controller[_0x26c1('0xb')]);router[_0x26c1('0xc')]('/',auth[_0x26c1('0xa')](),controller[_0x26c1('0xd')]);router[_0x26c1('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x26c1('0xf')]('/:id',auth[_0x26c1('0xa')](),controller['destroy']);module[_0x26c1('0x10')]=router; \ No newline at end of file +var _0xe19e=['show','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated'];(function(_0x3c30cb,_0x56f4aa){var _0x2ff4d2=function(_0x39a5f0){while(--_0x39a5f0){_0x3c30cb['push'](_0x3c30cb['shift']());}};_0x2ff4d2(++_0x56f4aa);}(_0xe19e,0x15c));var _0xee19=function(_0x339a58,_0x75db51){_0x339a58=_0x339a58-0x0;var _0x930c90=_0xe19e[_0x339a58];return _0x930c90;};'use strict';var multer=require(_0xee19('0x0'));var util=require(_0xee19('0x1'));var path=require('path');var timeout=require(_0xee19('0x2'));var express=require(_0xee19('0x3'));var router=express[_0xee19('0x4')]();var fs_extra=require(_0xee19('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xee19('0x6'));var config=require(_0xee19('0x7'));var controller=require(_0xee19('0x8'));router[_0xee19('0x9')](_0xee19('0xa'),auth[_0xee19('0xb')](),controller[_0xee19('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xee19('0xd')]);router[_0xee19('0xe')](_0xee19('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xee19('0xf')]('/:id',auth[_0xee19('0xb')](),controller[_0xee19('0x10')]);module[_0xee19('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 2235639..56f83e2 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 _0xfe99=['first','STRING','sequelize','exports','ENUM','second'];(function(_0x18805f,_0x9973b){var _0x54edbb=function(_0x4686e8){while(--_0x4686e8){_0x18805f['push'](_0x18805f['shift']());}};_0x54edbb(++_0x9973b);}(_0xfe99,0x134));var _0x9fe9=function(_0x3200d5,_0x4a4de2){_0x3200d5=_0x3200d5-0x0;var _0x166e4f=_0xfe99[_0x3200d5];return _0x166e4f;};'use strict';var Sequelize=require(_0x9fe9('0x0'));module[_0x9fe9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x9fe9('0x2')]('first',_0x9fe9('0x3'),'third'),'allowNull':![],'defaultValue':_0x9fe9('0x4')},'description':{'type':Sequelize[_0x9fe9('0x5')]}}; \ No newline at end of file +var _0xd1c3=['STRING','ENUM','first','second','third','sequelize','exports'];(function(_0x429ac6,_0x5ead01){var _0x108c7e=function(_0x1ce818){while(--_0x1ce818){_0x429ac6['push'](_0x429ac6['shift']());}};_0x108c7e(++_0x5ead01);}(_0xd1c3,0x1a2));var _0x3d1c=function(_0x870ac2,_0x38d7dc){_0x870ac2=_0x870ac2-0x0;var _0x351787=_0xd1c3[_0x870ac2];return _0x351787;};'use strict';var Sequelize=require(_0x3d1c('0x0'));module[_0x3d1c('0x1')]={'name':{'type':Sequelize[_0x3d1c('0x2')],'allowNull':![]},'level':{'type':Sequelize[_0x3d1c('0x3')](_0x3d1c('0x4'),_0x3d1c('0x5'),_0x3d1c('0x6')),'allowNull':![],'defaultValue':_0x3d1c('0x4')},'description':{'type':Sequelize[_0x3d1c('0x2')]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index dfba6dd..b1af68d 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 _0x3c4b=['options','Disposition','includeAll','include','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','undefined','count','apply','update','then','destroy','get','Dispositions','UserProfileResource','error','name','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','map','VIRTUAL'];(function(_0x3b16a4,_0x4c34cf){var _0x1e3733=function(_0x4b242d){while(--_0x4b242d){_0x3b16a4['push'](_0x3b16a4['shift']());}};_0x1e3733(++_0x4c34cf);}(_0x3c4b,0x151));var _0xb3c4=function(_0x867794,_0x1ee5ba){_0x867794=_0x867794-0x0;var _0x4908dc=_0x3c4b[_0x867794];return _0x4908dc;};'use strict';var emlformat=require(_0xb3c4('0x0'));var rimraf=require(_0xb3c4('0x1'));var zipdir=require(_0xb3c4('0x2'));var jsonpatch=require(_0xb3c4('0x3'));var rp=require(_0xb3c4('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb3c4('0x5'));var util=require(_0xb3c4('0x6'));var path=require(_0xb3c4('0x7'));var sox=require(_0xb3c4('0x8'));var csv=require(_0xb3c4('0x9'));var ejs=require(_0xb3c4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb3c4('0xb'));var squel=require(_0xb3c4('0xc'));var crypto=require(_0xb3c4('0xd'));var jsforce=require(_0xb3c4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb3c4('0x9'));var querystring=require(_0xb3c4('0xf'));var Papa=require(_0xb3c4('0x10'));var Redis=require(_0xb3c4('0x11'));var authService=require(_0xb3c4('0x12'));var qs=require(_0xb3c4('0x13'));var as=require(_0xb3c4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb3c4('0x15'))(_0xb3c4('0x16'));var utils=require(_0xb3c4('0x17'));var config=require(_0xb3c4('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1596c9,_0x14ac23){_0x14ac23=_0x14ac23||0xcc;return function(_0x337896){if(_0x337896){return _0x1596c9[_0xb3c4('0x19')](_0x14ac23);}return _0x1596c9[_0xb3c4('0x1a')](_0x14ac23)[_0xb3c4('0x1b')]();};}function respondWithResult(_0x132a12,_0x2dffad){_0x2dffad=_0x2dffad||0xc8;return function(_0x2add5d){if(_0x2add5d){return _0x132a12[_0xb3c4('0x1a')](_0x2dffad)[_0xb3c4('0x1c')](_0x2add5d);}};}function respondWithFilteredResult(_0x3305d8,_0x479adb){return function(_0x4809cc){if(_0x4809cc){var _0x38e518=typeof _0x479adb[_0xb3c4('0x1d')]==='undefined'&&typeof _0x479adb[_0xb3c4('0x1e')]===_0xb3c4('0x1f');var _0x3888dd=_0x4809cc[_0xb3c4('0x20')];var _0x205e27=_0x38e518?0x0:_0x479adb[_0xb3c4('0x1d')];var _0x3838aa=_0x38e518?_0x4809cc[_0xb3c4('0x20')]:_0x479adb[_0xb3c4('0x1d')]+_0x479adb[_0xb3c4('0x1e')];var _0x4be23b;if(_0x3838aa>=_0x3888dd){_0x3838aa=_0x3888dd;_0x4be23b=0xc8;}else{_0x4be23b=0xce;}_0x3305d8[_0xb3c4('0x1a')](_0x4be23b);return _0x3305d8['set']('Content-Range',_0x205e27+'-'+_0x3838aa+'/'+_0x3888dd)['json'](_0x4809cc);}return null;};}function patchUpdates(_0x56c47e){return function(_0x15ae2f){try{jsonpatch[_0xb3c4('0x21')](_0x15ae2f,_0x56c47e,!![]);}catch(_0x186c32){return BPromise['reject'](_0x186c32);}return _0x15ae2f['save']();};}function saveUpdates(_0x5ccf5b,_0x4f5392){return function(_0x1db608){if(_0x1db608){return _0x1db608[_0xb3c4('0x22')](_0x5ccf5b)[_0xb3c4('0x23')](function(_0x4b377d){return _0x4b377d;});}return null;};}function removeEntity(_0x5697a4,_0x35b2ce){return function(_0x100bf3){if(_0x100bf3){return _0x100bf3[_0xb3c4('0x24')]()[_0xb3c4('0x23')](function(){var _0x1f6681=_0x100bf3[_0xb3c4('0x25')]({'plain':!![]});var _0x29c3fd=_0xb3c4('0x26');return db[_0xb3c4('0x27')][_0xb3c4('0x24')]({'where':{'type':_0x29c3fd,'resourceId':_0x1f6681['id']}})[_0xb3c4('0x23')](function(){return _0x100bf3;});})[_0xb3c4('0x23')](function(){_0x5697a4[_0xb3c4('0x1a')](0xcc)[_0xb3c4('0x1b')]();});}};}function handleEntityNotFound(_0xfed180,_0x4ce81e){return function(_0x2cee83){if(!_0x2cee83){_0xfed180['sendStatus'](0x194);}return _0x2cee83;};}function handleError(_0x192eac,_0x142acb){_0x142acb=_0x142acb||0x1f4;return function(_0x3fcb7f){logger[_0xb3c4('0x28')](_0x3fcb7f['stack']);if(_0x3fcb7f[_0xb3c4('0x29')]){delete _0x3fcb7f[_0xb3c4('0x29')];}_0x192eac[_0xb3c4('0x1a')](_0x142acb)['send'](_0x3fcb7f);};}exports['index']=function(_0xce02c8,_0x1da142){var _0x52b3db={},_0x2f7b40={},_0x4931df={'count':0x0,'rows':[]};var _0x54b9a7=_['map'](db['Disposition']['rawAttributes'],function(_0x5ac71f){return{'name':_0x5ac71f[_0xb3c4('0x2a')],'type':_0x5ac71f[_0xb3c4('0x2b')][_0xb3c4('0x2c')]};});_0x2f7b40['model']=_['map'](_0x54b9a7,_0xb3c4('0x29'));_0x2f7b40['query']=_[_0xb3c4('0x2d')](_0xce02c8[_0xb3c4('0x2e')]);_0x2f7b40[_0xb3c4('0x2f')]=_['intersection'](_0x2f7b40[_0xb3c4('0x30')],_0x2f7b40['query']);_0x52b3db[_0xb3c4('0x31')]=_[_0xb3c4('0x32')](_0x2f7b40[_0xb3c4('0x30')],qs[_0xb3c4('0x33')](_0xce02c8['query'][_0xb3c4('0x33')]));_0x52b3db[_0xb3c4('0x31')]=_0x52b3db[_0xb3c4('0x31')][_0xb3c4('0x34')]?_0x52b3db['attributes']:_0x2f7b40['model'];if(!_0xce02c8[_0xb3c4('0x2e')][_0xb3c4('0x35')](_0xb3c4('0x36'))){_0x52b3db[_0xb3c4('0x1e')]=qs['limit'](_0xce02c8[_0xb3c4('0x2e')][_0xb3c4('0x1e')]);_0x52b3db['offset']=qs['offset'](_0xce02c8[_0xb3c4('0x2e')][_0xb3c4('0x1d')]);}_0x52b3db[_0xb3c4('0x37')]=qs['sort'](_0xce02c8[_0xb3c4('0x2e')][_0xb3c4('0x38')]);_0x52b3db['where']=qs[_0xb3c4('0x2f')](_[_0xb3c4('0x39')](_0xce02c8[_0xb3c4('0x2e')],_0x2f7b40[_0xb3c4('0x2f')]),_0x54b9a7);if(_0xce02c8['query'][_0xb3c4('0x3a')]){_0x52b3db[_0xb3c4('0x3b')]=_[_0xb3c4('0x3c')](_0x52b3db[_0xb3c4('0x3b')],{'$or':_[_0xb3c4('0x3d')](_0x54b9a7,function(_0x4253b6){if(_0x4253b6[_0xb3c4('0x2b')]!==_0xb3c4('0x3e')){var _0x413ee2={};_0x413ee2[_0x4253b6[_0xb3c4('0x29')]]={'$like':'%'+_0xce02c8['query'][_0xb3c4('0x3a')]+'%'};return _0x413ee2;}})});}_0x52b3db=_['merge']({},_0x52b3db,_0xce02c8[_0xb3c4('0x3f')]);var _0x1a461f={'where':_0x52b3db[_0xb3c4('0x3b')]};return db[_0xb3c4('0x40')][_0xb3c4('0x20')](_0x1a461f)['then'](function(_0x5f0956){_0x4931df['count']=_0x5f0956;if(_0xce02c8[_0xb3c4('0x2e')][_0xb3c4('0x41')]){_0x52b3db[_0xb3c4('0x42')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x52b3db);})[_0xb3c4('0x23')](function(_0x45e147){_0x4931df['rows']=_0x45e147;return _0x4931df;})[_0xb3c4('0x23')](respondWithFilteredResult(_0x1da142,_0x52b3db))['catch'](handleError(_0x1da142,null));};exports[_0xb3c4('0x43')]=function(_0x51fb79,_0x4600a1){var _0x5c4101={'raw':!![],'where':{'id':_0x51fb79[_0xb3c4('0x44')]['id']}},_0x410300={};_0x410300[_0xb3c4('0x30')]=_['keys'](db[_0xb3c4('0x40')]['rawAttributes']);_0x410300['query']=_[_0xb3c4('0x2d')](_0x51fb79[_0xb3c4('0x2e')]);_0x410300[_0xb3c4('0x2f')]=_[_0xb3c4('0x32')](_0x410300[_0xb3c4('0x30')],_0x410300[_0xb3c4('0x2e')]);_0x5c4101[_0xb3c4('0x31')]=_[_0xb3c4('0x32')](_0x410300[_0xb3c4('0x30')],qs[_0xb3c4('0x33')](_0x51fb79[_0xb3c4('0x2e')][_0xb3c4('0x33')]));_0x5c4101[_0xb3c4('0x31')]=_0x5c4101['attributes'][_0xb3c4('0x34')]?_0x5c4101[_0xb3c4('0x31')]:_0x410300[_0xb3c4('0x30')];if(_0x51fb79[_0xb3c4('0x2e')][_0xb3c4('0x41')]){_0x5c4101[_0xb3c4('0x42')]=[{'all':!![]}];}_0x5c4101=_[_0xb3c4('0x3c')]({},_0x5c4101,_0x51fb79[_0xb3c4('0x3f')]);return db[_0xb3c4('0x40')][_0xb3c4('0x45')](_0x5c4101)[_0xb3c4('0x23')](handleEntityNotFound(_0x4600a1,null))['then'](respondWithResult(_0x4600a1,null))[_0xb3c4('0x46')](handleError(_0x4600a1,null));};exports[_0xb3c4('0x47')]=function(_0x1d583d,_0x4d895b){return db[_0xb3c4('0x40')][_0xb3c4('0x47')](_0x1d583d[_0xb3c4('0x48')],{})[_0xb3c4('0x23')](function(_0x1f0a28){var _0x34c3cb=_0x1d583d[_0xb3c4('0x49')][_0xb3c4('0x25')]({'plain':!![]});if(!_0x34c3cb)throw new Error(_0xb3c4('0x4a'));if(_0x34c3cb[_0xb3c4('0x4b')]===_0xb3c4('0x49')){var _0x21e820=_0x1f0a28[_0xb3c4('0x25')]({'plain':!![]});var _0x1f0637='Dispositions';return db[_0xb3c4('0x4c')][_0xb3c4('0x45')]({'where':{'name':_0x1f0637,'userProfileId':_0x34c3cb[_0xb3c4('0x4d')]},'raw':!![]})[_0xb3c4('0x23')](function(_0x2ffc20){if(_0x2ffc20&&_0x2ffc20[_0xb3c4('0x4e')]===0x0){return db[_0xb3c4('0x27')][_0xb3c4('0x47')]({'name':_0x21e820[_0xb3c4('0x29')],'resourceId':_0x21e820['id'],'type':_0x2ffc20[_0xb3c4('0x29')],'sectionId':_0x2ffc20['id']},{})[_0xb3c4('0x23')](function(){return _0x1f0a28;});}else{return _0x1f0a28;}})[_0xb3c4('0x46')](function(_0x12f8a3){logger[_0xb3c4('0x28')](_0xb3c4('0x4f'),_0x12f8a3);throw _0x12f8a3;});}return _0x1f0a28;})[_0xb3c4('0x23')](respondWithResult(_0x4d895b,0xc9))['catch'](handleError(_0x4d895b,null));};exports[_0xb3c4('0x22')]=function(_0x1372df,_0x777c25){if(_0x1372df[_0xb3c4('0x48')]['id']){delete _0x1372df[_0xb3c4('0x48')]['id'];}return db[_0xb3c4('0x40')][_0xb3c4('0x45')]({'where':{'id':_0x1372df[_0xb3c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x777c25,null))[_0xb3c4('0x23')](saveUpdates(_0x1372df['body'],null))[_0xb3c4('0x23')](respondWithResult(_0x777c25,null))[_0xb3c4('0x46')](handleError(_0x777c25,null));};exports[_0xb3c4('0x24')]=function(_0x20ca5d,_0x28fc1d){return db['Disposition']['find']({'where':{'id':_0x20ca5d[_0xb3c4('0x44')]['id']}})['then'](handleEntityNotFound(_0x28fc1d,null))[_0xb3c4('0x23')](removeEntity(_0x28fc1d,null))['catch'](handleError(_0x28fc1d,null));}; \ No newline at end of file +var _0xee14=['sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','Dispositions','UserProfileResource','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','Disposition','includeAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x145067,_0x3bcadb){var _0x2b4929=function(_0x4dac72){while(--_0x4dac72){_0x145067['push'](_0x145067['shift']());}};_0x2b4929(++_0x3bcadb);}(_0xee14,0x13a));var _0x4ee1=function(_0x3caff9,_0x4b04d0){_0x3caff9=_0x3caff9-0x0;var _0x1caf0d=_0xee14[_0x3caff9];return _0x1caf0d;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){var _0x28efdc=_0xaf87e7['get']({'plain':!![]});var _0x5cc0b5=_0x4ee1('0x2a');return db[_0x4ee1('0x2b')]['destroy']({'where':{'type':_0x5cc0b5,'resourceId':_0x28efdc['id']}})[_0x4ee1('0x29')](function(){return _0xaf87e7;});})[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)[_0x4ee1('0x1c')]();});}};}function handleEntityNotFound(_0x2d699c,_0x3c7b2a){return function(_0x45bd0d){if(!_0x45bd0d){_0x2d699c['sendStatus'](0x194);}return _0x45bd0d;};}function handleError(_0x1f7b74,_0x59029c){_0x59029c=_0x59029c||0x1f4;return function(_0x4746c2){logger['error'](_0x4746c2[_0x4ee1('0x2c')]);if(_0x4746c2[_0x4ee1('0x2d')]){delete _0x4746c2[_0x4ee1('0x2d')];}_0x1f7b74[_0x4ee1('0x1b')](_0x59029c)[_0x4ee1('0x2e')](_0x4746c2);};}exports['index']=function(_0x1f7483,_0x5b3792){var _0x121301={},_0x3d5e6c={},_0x33fd38={'count':0x0,'rows':[]};var _0x37bc2e=_[_0x4ee1('0x2f')](db['Disposition'][_0x4ee1('0x30')],function(_0x9fe2b8){return{'name':_0x9fe2b8[_0x4ee1('0x31')],'type':_0x9fe2b8[_0x4ee1('0x32')][_0x4ee1('0x33')]};});_0x3d5e6c[_0x4ee1('0x34')]=_['map'](_0x37bc2e,'name');_0x3d5e6c[_0x4ee1('0x35')]=_[_0x4ee1('0x36')](_0x1f7483[_0x4ee1('0x35')]);_0x3d5e6c['filters']=_[_0x4ee1('0x37')](_0x3d5e6c[_0x4ee1('0x34')],_0x3d5e6c[_0x4ee1('0x35')]);_0x121301[_0x4ee1('0x38')]=_[_0x4ee1('0x37')](_0x3d5e6c[_0x4ee1('0x34')],qs[_0x4ee1('0x39')](_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x39')]));_0x121301[_0x4ee1('0x38')]=_0x121301[_0x4ee1('0x38')][_0x4ee1('0x3a')]?_0x121301[_0x4ee1('0x38')]:_0x3d5e6c['model'];if(!_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x121301['limit']=qs['limit'](_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x20')]);_0x121301[_0x4ee1('0x1e')]=qs[_0x4ee1('0x1e')](_0x1f7483['query'][_0x4ee1('0x1e')]);}_0x121301[_0x4ee1('0x3d')]=qs[_0x4ee1('0x3e')](_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x3e')]);_0x121301[_0x4ee1('0x3f')]=qs[_0x4ee1('0x40')](_[_0x4ee1('0x41')](_0x1f7483['query'],_0x3d5e6c[_0x4ee1('0x40')]),_0x37bc2e);if(_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x42')]){_0x121301[_0x4ee1('0x3f')]=_[_0x4ee1('0x43')](_0x121301[_0x4ee1('0x3f')],{'$or':_['map'](_0x37bc2e,function(_0x3e2ca7){if(_0x3e2ca7[_0x4ee1('0x32')]!==_0x4ee1('0x44')){var _0x333690={};_0x333690[_0x3e2ca7[_0x4ee1('0x2d')]]={'$like':'%'+_0x1f7483[_0x4ee1('0x35')][_0x4ee1('0x42')]+'%'};return _0x333690;}})});}_0x121301=_[_0x4ee1('0x43')]({},_0x121301,_0x1f7483[_0x4ee1('0x45')]);var _0x29493d={'where':_0x121301[_0x4ee1('0x3f')]};return db[_0x4ee1('0x46')][_0x4ee1('0x21')](_0x29493d)['then'](function(_0x3b3bed){_0x33fd38[_0x4ee1('0x21')]=_0x3b3bed;if(_0x1f7483['query'][_0x4ee1('0x47')]){_0x121301['include']=[{'all':!![]}];}return db[_0x4ee1('0x46')]['findAll'](_0x121301);})[_0x4ee1('0x29')](function(_0xc7580c){_0x33fd38['rows']=_0xc7580c;return _0x33fd38;})[_0x4ee1('0x29')](respondWithFilteredResult(_0x5b3792,_0x121301))[_0x4ee1('0x48')](handleError(_0x5b3792,null));};exports[_0x4ee1('0x49')]=function(_0x3dfd9c,_0x516dac){var _0x42e122={'raw':!![],'where':{'id':_0x3dfd9c[_0x4ee1('0x4a')]['id']}},_0x26a030={};_0x26a030['model']=_['keys'](db[_0x4ee1('0x46')][_0x4ee1('0x30')]);_0x26a030[_0x4ee1('0x35')]=_[_0x4ee1('0x36')](_0x3dfd9c[_0x4ee1('0x35')]);_0x26a030['filters']=_['intersection'](_0x26a030[_0x4ee1('0x34')],_0x26a030[_0x4ee1('0x35')]);_0x42e122[_0x4ee1('0x38')]=_[_0x4ee1('0x37')](_0x26a030['model'],qs[_0x4ee1('0x39')](_0x3dfd9c[_0x4ee1('0x35')]['fields']));_0x42e122[_0x4ee1('0x38')]=_0x42e122[_0x4ee1('0x38')][_0x4ee1('0x3a')]?_0x42e122[_0x4ee1('0x38')]:_0x26a030[_0x4ee1('0x34')];if(_0x3dfd9c[_0x4ee1('0x35')][_0x4ee1('0x47')]){_0x42e122[_0x4ee1('0x4b')]=[{'all':!![]}];}_0x42e122=_[_0x4ee1('0x43')]({},_0x42e122,_0x3dfd9c['options']);return db['Disposition'][_0x4ee1('0x4c')](_0x42e122)[_0x4ee1('0x29')](handleEntityNotFound(_0x516dac,null))[_0x4ee1('0x29')](respondWithResult(_0x516dac,null))[_0x4ee1('0x48')](handleError(_0x516dac,null));};exports['create']=function(_0x35edf5,_0x3c66d1){return db[_0x4ee1('0x46')][_0x4ee1('0x4d')](_0x35edf5[_0x4ee1('0x4e')],{})['then'](function(_0x1c71ba){var _0x4ae560=_0x35edf5[_0x4ee1('0x4f')]['get']({'plain':!![]});if(!_0x4ae560)throw new Error(_0x4ee1('0x50'));if(_0x4ae560['role']===_0x4ee1('0x4f')){var _0x5a1114=_0x1c71ba[_0x4ee1('0x51')]({'plain':!![]});var _0x480796=_0x4ee1('0x2a');return db['UserProfileSection'][_0x4ee1('0x4c')]({'where':{'name':_0x480796,'userProfileId':_0x4ae560[_0x4ee1('0x52')]},'raw':!![]})[_0x4ee1('0x29')](function(_0x5f4f78){if(_0x5f4f78&&_0x5f4f78[_0x4ee1('0x53')]===0x0){return db[_0x4ee1('0x2b')][_0x4ee1('0x4d')]({'name':_0x5a1114[_0x4ee1('0x2d')],'resourceId':_0x5a1114['id'],'type':_0x5f4f78[_0x4ee1('0x2d')],'sectionId':_0x5f4f78['id']},{})[_0x4ee1('0x29')](function(){return _0x1c71ba;});}else{return _0x1c71ba;}})[_0x4ee1('0x48')](function(_0x517729){logger['error'](_0x4ee1('0x54'),_0x517729);throw _0x517729;});}return _0x1c71ba;})[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,0xc9))[_0x4ee1('0x48')](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x27')]=function(_0x44e65f,_0x31e82d){if(_0x44e65f[_0x4ee1('0x4e')]['id']){delete _0x44e65f[_0x4ee1('0x4e')]['id'];}return db[_0x4ee1('0x46')][_0x4ee1('0x4c')]({'where':{'id':_0x44e65f[_0x4ee1('0x4a')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x31e82d,null))[_0x4ee1('0x29')](saveUpdates(_0x44e65f['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x31e82d,null))['catch'](handleError(_0x31e82d,null));};exports[_0x4ee1('0x28')]=function(_0x42d532,_0x59bbca){return db[_0x4ee1('0x46')][_0x4ee1('0x4c')]({'where':{'id':_0x42d532['params']['id']}})['then'](handleEntityNotFound(_0x59bbca,null))[_0x4ee1('0x29')](removeEntity(_0x59bbca,null))['catch'](handleError(_0x59bbca,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3a8e251..486fd4e 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 _0x5461=['bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','ListId','name_chat','name','ChatWebsiteId','name_mail','name_sms','SmsAccountId','FaxAccountId','name_openchannel','WhatsappAccountId','lodash','util','moment'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5461,0x19b));var _0x1546=function(_0x35f83e,_0x30ec55){_0x35f83e=_0x35f83e-0x0;var _0x249b05=_0x5461[_0x35f83e];return _0x249b05;};'use strict';var _=require(_0x1546('0x0'));var util=require(_0x1546('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1546('0x2'));var BPromise=require(_0x1546('0x3'));var rp=require(_0x1546('0x4'));var fs=require('fs');var path=require(_0x1546('0x5'));var rimraf=require(_0x1546('0x6'));var config=require(_0x1546('0x7'));var attributes=require(_0x1546('0x8'));module[_0x1546('0x9')]=function(_0x268138,_0x21203d){return _0x268138[_0x1546('0xa')](_0x1546('0xb'),attributes,{'tableName':_0x1546('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':['name',_0x1546('0xd')]},{'unique':!![],'name':_0x1546('0xe'),'fields':[_0x1546('0xf'),_0x1546('0x10')]},{'unique':!![],'name':_0x1546('0x11'),'fields':[_0x1546('0xf'),'MailAccountId']},{'unique':!![],'name':_0x1546('0x12'),'fields':['name',_0x1546('0x13')]},{'unique':!![],'name':'name_fax','fields':[_0x1546('0xf'),_0x1546('0x14')]},{'unique':!![],'name':_0x1546('0x15'),'fields':[_0x1546('0xf'),'OpenchannelAccountId']},{'unique':!![],'name':'name_whatsapp','fields':[_0x1546('0xf'),_0x1546('0x16')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc84d=['FaxAccountId','name_openchannel','OpenchannelAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','moment','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax'];(function(_0x4b3a97,_0x478115){var _0xc1a321=function(_0x33f2ce){while(--_0x33f2ce){_0x4b3a97['push'](_0x4b3a97['shift']());}};_0xc1a321(++_0x478115);}(_0xc84d,0xd5));var _0xdc84=function(_0x481f6c,_0xdf0155){_0x481f6c=_0x481f6c-0x0;var _0x29b89e=_0xc84d[_0x481f6c];return _0x29b89e;};'use strict';var _=require(_0xdc84('0x0'));var util=require('util');var logger=require(_0xdc84('0x1'))(_0xdc84('0x2'));var moment=require(_0xdc84('0x3'));var BPromise=require('bluebird');var rp=require(_0xdc84('0x4'));var fs=require('fs');var path=require(_0xdc84('0x5'));var rimraf=require('rimraf');var config=require(_0xdc84('0x6'));var attributes=require(_0xdc84('0x7'));module[_0xdc84('0x8')]=function(_0x2647cb,_0x12699c){return _0x2647cb[_0xdc84('0x9')](_0xdc84('0xa'),attributes,{'tableName':_0xdc84('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xdc84('0xc'),'fields':[_0xdc84('0xd'),_0xdc84('0xe')]},{'unique':!![],'name':_0xdc84('0xf'),'fields':[_0xdc84('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0xdc84('0x10'),'fields':[_0xdc84('0xd'),_0xdc84('0x11')]},{'unique':!![],'name':_0xdc84('0x12'),'fields':[_0xdc84('0xd'),_0xdc84('0x13')]},{'unique':!![],'name':_0xdc84('0x14'),'fields':[_0xdc84('0xd'),_0xdc84('0x15')]},{'unique':!![],'name':_0xdc84('0x16'),'fields':['name',_0xdc84('0x17')]},{'unique':!![],'name':_0xdc84('0x18'),'fields':[_0xdc84('0xd'),_0xdc84('0x19')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 6af9b0f..d501cba 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(_0x5acf72,_0x44c5ea){var _0x598e35=function(_0x571a76){while(--_0x571a76){_0x5acf72['push'](_0x5acf72['shift']());}};_0x598e35(++_0x44c5ea);}(_0xa9e0,0x123));var _0x0a9e=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xa9e0[_0x31e29a];return _0x32d892;};'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(_0x251dd8,_0x268e96){var _0x430d14=function(_0x517952){while(--_0x517952){_0x251dd8['push'](_0x251dd8['shift']());}};_0x430d14(++_0x268e96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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 46fd256..4eecf13 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 _0x1845=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','exports','util'];(function(_0x1d4094,_0x1bb08e){var _0x4e8045=function(_0x22677b){while(--_0x22677b){_0x1d4094['push'](_0x1d4094['shift']());}};_0x4e8045(++_0x1bb08e);}(_0x1845,0x1da));var _0x5184=function(_0x1105bc,_0x22f775){_0x1105bc=_0x1105bc-0x0;var _0x5109d4=_0x1845[_0x1105bc];return _0x5109d4;};'use strict';var multer=require('multer');var util=require(_0x5184('0x0'));var path=require(_0x5184('0x1'));var timeout=require(_0x5184('0x2'));var express=require(_0x5184('0x3'));var router=express[_0x5184('0x4')]();var fs_extra=require(_0x5184('0x5'));var auth=require(_0x5184('0x6'));var interaction=require(_0x5184('0x7'));var config=require('../../config/environment');var controller=require(_0x5184('0x8'));router[_0x5184('0x9')]('/',auth[_0x5184('0xa')](),controller['index']);router[_0x5184('0x9')](_0x5184('0xb'),auth[_0x5184('0xa')](),controller[_0x5184('0xc')]);router[_0x5184('0xd')]('/',auth[_0x5184('0xa')](),controller['create']);router[_0x5184('0xe')](_0x5184('0xb'),auth['isAuthenticated'](),controller[_0x5184('0xf')]);router[_0x5184('0x10')](_0x5184('0xb'),auth[_0x5184('0xa')](),controller[_0x5184('0x11')]);module[_0x5184('0x12')]=router; \ No newline at end of file +var _0x3d30=['isAuthenticated','index','show','create','put','/:id','update','delete','path','express','../../components/auth/service','../../config/environment','./disposition.controller','get'];(function(_0xef2a14,_0x4c359a){var _0x242a4d=function(_0x3227c9){while(--_0x3227c9){_0xef2a14['push'](_0xef2a14['shift']());}};_0x242a4d(++_0x4c359a);}(_0x3d30,0x6a));var _0x03d3=function(_0x2b67d2,_0x27b8c4){_0x2b67d2=_0x2b67d2-0x0;var _0x4e8248=_0x3d30[_0x2b67d2];return _0x4e8248;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x03d3('0x0'));var timeout=require('connect-timeout');var express=require(_0x03d3('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x03d3('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x03d3('0x3'));var controller=require(_0x03d3('0x4'));router[_0x03d3('0x5')]('/',auth[_0x03d3('0x6')](),controller[_0x03d3('0x7')]);router[_0x03d3('0x5')]('/:id',auth[_0x03d3('0x6')](),controller[_0x03d3('0x8')]);router['post']('/',auth[_0x03d3('0x6')](),controller[_0x03d3('0x9')]);router[_0x03d3('0xa')](_0x03d3('0xb'),auth[_0x03d3('0x6')](),controller[_0x03d3('0xc')]);router[_0x03d3('0xd')](_0x03d3('0xb'),auth[_0x03d3('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 94a7f62..a382dcc 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 _0xeba0=['12000','14400','7200','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','SIP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','9600'];(function(_0x2b55e5,_0x30ed36){var _0x11d65f=function(_0x3518ed){while(--_0x3518ed){_0x2b55e5['push'](_0x2b55e5['shift']());}};_0x11d65f(++_0x30ed36);}(_0xeba0,0x92));var _0x0eba=function(_0x345ac8,_0x2daa49){_0x345ac8=_0x345ac8-0x0;var _0x552f86=_0xeba0[_0x345ac8];return _0x552f86;};'use strict';var Sequelize=require(_0x0eba('0x0'));module[_0x0eba('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0eba('0x2')]},'ecm':{'type':Sequelize[_0x0eba('0x3')](_0x0eba('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x0eba('0x2')],'defaultValue':_0x0eba('0x5')},'localstationid':{'type':Sequelize[_0x0eba('0x2')],'unique':_0x0eba('0x6')},'minrate':{'type':Sequelize['ENUM'](_0x0eba('0x7'),_0x0eba('0x8'),'7200',_0x0eba('0x9'),_0x0eba('0xa'),_0x0eba('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize[_0x0eba('0x3')](_0x0eba('0x7'),_0x0eba('0x8'),_0x0eba('0xc'),_0x0eba('0x9'),_0x0eba('0xa'),_0x0eba('0xb')),'defaultValue':_0x0eba('0xb')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0x0eba('0xd')},'gateway':{'type':Sequelize[_0x0eba('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x0eba('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x0eba('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x0eba('0x3')]('SIP',_0x0eba('0xf'),_0x0eba('0x10'),_0x0eba('0x11')),'defaultValue':_0x0eba('0x12')},'key':{'type':Sequelize[_0x0eba('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0eba('0x13')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0eba('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0eba('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0eba('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0eba('0xe')],'allowNull':!![],'defaultValue':null,'comment':_0x0eba('0x15')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0eba('0x16'),'set':function(_0x2fc746){if(!_0x2fc746)this[_0x0eba('0x17')](_0x0eba('0x18'),null);this[_0x0eba('0x17')](_0x0eba('0x19'),_0x2fc746);}}}; \ No newline at end of file +var _0x48b8=['mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','4800','7200','9600','12000','14400','v17,v27,v29','INTEGER','SIP','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'];(function(_0x1c4965,_0x20d054){var _0x37e4a2=function(_0x1076d7){while(--_0x1076d7){_0x1c4965['push'](_0x1c4965['shift']());}};_0x37e4a2(++_0x20d054);}(_0x48b8,0xfb));var _0x848b=function(_0x2bb55c,_0x27cf84){_0x2bb55c=_0x2bb55c-0x0;var _0x5dc600=_0x48b8[_0x2bb55c];return _0x5dc600;};'use strict';var Sequelize=require('sequelize');module[_0x848b('0x0')]={'name':{'type':Sequelize[_0x848b('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x848b('0x2')](_0x848b('0x3'),'no'),'defaultValue':_0x848b('0x3')},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x848b('0x4')},'localstationid':{'type':Sequelize[_0x848b('0x1')],'unique':_0x848b('0x5')},'minrate':{'type':Sequelize[_0x848b('0x2')](_0x848b('0x6'),_0x848b('0x7'),_0x848b('0x8'),_0x848b('0x9'),_0x848b('0xa'),'14400'),'defaultValue':_0x848b('0x7')},'maxrate':{'type':Sequelize[_0x848b('0x2')](_0x848b('0x6'),'4800',_0x848b('0x8'),'9600',_0x848b('0xa'),_0x848b('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x848b('0x1')],'defaultValue':_0x848b('0xc')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x848b('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x848b('0xe'),'IAX',_0x848b('0xf'),_0x848b('0x10')),'defaultValue':_0x848b('0xe')},'key':{'type':Sequelize[_0x848b('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x848b('0x11')],'defaultValue':function(){return _0x848b('0x12');}},'notificationSound':{'type':Sequelize[_0x848b('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x848b('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x848b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x848b('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x848b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x848b('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x848b('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x848b('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x848b('0x14')},'mandatoryDisposition':{'type':Sequelize[_0x848b('0x13')],'defaultValue':![],'comment':_0x848b('0x15'),'set':function(_0x16ed70){if(!_0x16ed70)this[_0x848b('0x16')](_0x848b('0x17'),null);this[_0x848b('0x16')](_0x848b('0x18'),_0x16ed70);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index c2598dd..a72e6a9 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 _0xd2da=['create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','findOne','Disposition','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','addInteraction','FaxInteraction','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tags','color','tag','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','localstationid','system','description','Fax\x20Extension','priority','push','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','minrate','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','updateAccountApplications','VoiceExtension','omit','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','defaults','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','user','Messages','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','request','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','FaxAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','rawAttributes','fieldName','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','include','findAll','rows','show','params','includeAll'];(function(_0x274ac2,_0x4093a9){var _0x3facdc=function(_0x56d7a4){while(--_0x56d7a4){_0x274ac2['push'](_0x274ac2['shift']());}};_0x3facdc(++_0x4093a9);}(_0xd2da,0x136));var _0xad2d=function(_0x3042c5,_0x36cb88){_0x3042c5=_0x3042c5-0x0;var _0x7cd140=_0xd2da[_0x3042c5];return _0x7cd140;};'use strict';var emlformat=require(_0xad2d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xad2d('0x1'));var jsonpatch=require(_0xad2d('0x2'));var rp=require(_0xad2d('0x3'));var moment=require(_0xad2d('0x4'));var BPromise=require(_0xad2d('0x5'));var Mustache=require('mustache');var util=require(_0xad2d('0x6'));var path=require(_0xad2d('0x7'));var sox=require(_0xad2d('0x8'));var csv=require(_0xad2d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad2d('0xa'));var squel=require(_0xad2d('0xb'));var crypto=require(_0xad2d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xad2d('0xd'));var toCsv=require(_0xad2d('0x9'));var querystring=require(_0xad2d('0xe'));var Papa=require(_0xad2d('0xf'));var Redis=require(_0xad2d('0x10'));var authService=require(_0xad2d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xad2d('0x12'));var hardwareService=require(_0xad2d('0x13'));var logger=require(_0xad2d('0x14'))('api');var utils=require(_0xad2d('0x15'));var config=require(_0xad2d('0x16'));var licenseUtil=require(_0xad2d('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xad2d('0x18')],{'host':_0xad2d('0x19'),'port':0x18eb});var socket=require(_0xad2d('0x1a'))(new Redis(config['redis']));require(_0xad2d('0x1b'))[_0xad2d('0x1c')](socket);var jayson=require(_0xad2d('0x1d'));var client=jayson[_0xad2d('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0xad2d('0x1e')]['http']({'port':0x232a});function respondWithRpcPromise(_0x159824,_0x16e768,_0x46bebc,_0x2189b0){return new BPromise(function(_0x312f1b,_0xd03937){var _0x40f51a=_0x2189b0||client;return _0x40f51a[_0xad2d('0x1f')](_0x159824,_0x46bebc)['then'](function(_0x206fa0){logger[_0xad2d('0x20')](_0xad2d('0x21'),_0x16e768,_0xad2d('0x22'));logger[_0xad2d('0x23')](_0xad2d('0x24'),_0x16e768,_0xad2d('0x22'),JSON[_0xad2d('0x25')](_0x206fa0));if(_0x206fa0[_0xad2d('0x26')]){if(_0x206fa0['error'][_0xad2d('0x27')]===0x1f4){logger[_0xad2d('0x26')](_0xad2d('0x21'),_0x16e768,_0x206fa0[_0xad2d('0x26')]['message']);return _0xd03937(_0x206fa0[_0xad2d('0x26')][_0xad2d('0x28')]);}logger[_0xad2d('0x26')](_0xad2d('0x21'),_0x16e768,_0x206fa0[_0xad2d('0x26')][_0xad2d('0x28')]);return _0x312f1b(_0x206fa0[_0xad2d('0x26')][_0xad2d('0x28')]);}else{logger[_0xad2d('0x20')]('FaxAccount,\x20%s,\x20%s',_0x16e768,_0xad2d('0x22'));_0x312f1b(_0x206fa0[_0xad2d('0x29')][_0xad2d('0x28')]);}})[_0xad2d('0x2a')](function(_0x46d2f1){logger[_0xad2d('0x26')](_0xad2d('0x21'),_0x16e768,_0x46d2f1);_0xd03937(_0x46d2f1);});});}function respondWithStatusCode(_0x3fe5ab,_0x3c619e){_0x3c619e=_0x3c619e||0xcc;return function(_0x11dc55){if(_0x11dc55){return _0x3fe5ab[_0xad2d('0x2b')](_0x3c619e);}return _0x3fe5ab[_0xad2d('0x2c')](_0x3c619e)[_0xad2d('0x2d')]();};}function respondWithResult(_0x3d26d7,_0x48a59d){_0x48a59d=_0x48a59d||0xc8;return function(_0x3dae40){if(_0x3dae40){return _0x3d26d7[_0xad2d('0x2c')](_0x48a59d)[_0xad2d('0x2e')](_0x3dae40);}};}function respondWithFilteredResult(_0x393b59,_0x51bc0a){return function(_0x3b4afc){if(_0x3b4afc){var _0x27cd92=typeof _0x51bc0a[_0xad2d('0x2f')]===_0xad2d('0x30')&&typeof _0x51bc0a[_0xad2d('0x31')]==='undefined';var _0x3533e5=_0x3b4afc[_0xad2d('0x32')];var _0x2a4910=_0x27cd92?0x0:_0x51bc0a['offset'];var _0x18c855=_0x27cd92?_0x3b4afc['count']:_0x51bc0a[_0xad2d('0x2f')]+_0x51bc0a[_0xad2d('0x31')];var _0x4ec937;if(_0x18c855>=_0x3533e5){_0x18c855=_0x3533e5;_0x4ec937=0xc8;}else{_0x4ec937=0xce;}_0x393b59['status'](_0x4ec937);return _0x393b59['set'](_0xad2d('0x33'),_0x2a4910+'-'+_0x18c855+'/'+_0x3533e5)[_0xad2d('0x2e')](_0x3b4afc);}return null;};}function patchUpdates(_0x376810){return function(_0x3e4c5e){try{jsonpatch[_0xad2d('0x34')](_0x3e4c5e,_0x376810,!![]);}catch(_0x479c3f){return BPromise[_0xad2d('0x35')](_0x479c3f);}return _0x3e4c5e[_0xad2d('0x36')]();};}function saveUpdates(_0x57bc33,_0x2ebda1){return function(_0x476853){if(_0x476853){return _0x476853[_0xad2d('0x37')](_0x57bc33)[_0xad2d('0x38')](function(_0x91cb4a){return _0x91cb4a;});}return null;};}function removeEntity(_0x5afc09,_0x3dde61){return function(_0x24b972){if(_0x24b972){return _0x24b972[_0xad2d('0x39')]()[_0xad2d('0x38')](function(){var _0x77db1a=_0x24b972['get']({'plain':!![]});var _0x45954c=_0xad2d('0x3a');return db[_0xad2d('0x3b')][_0xad2d('0x39')]({'where':{'type':_0x45954c,'resourceId':_0x77db1a['id']}})[_0xad2d('0x38')](function(){return _0x24b972;});})[_0xad2d('0x38')](function(){_0x5afc09[_0xad2d('0x2c')](0xcc)[_0xad2d('0x2d')]();});}};}function handleEntityNotFound(_0x509b12,_0x36a727){return function(_0x123b23){if(!_0x123b23){_0x509b12['sendStatus'](0x194);}return _0x123b23;};}function handleError(_0x4bfd84,_0x537d94){_0x537d94=_0x537d94||0x1f4;return function(_0x210a64){logger[_0xad2d('0x26')](_0x210a64[_0xad2d('0x3c')]);if(_0x210a64[_0xad2d('0x3d')]){delete _0x210a64[_0xad2d('0x3d')];}_0x4bfd84[_0xad2d('0x2c')](_0x537d94)[_0xad2d('0x3e')](_0x210a64);};}exports[_0xad2d('0x3f')]=function(_0x165c44,_0x191681){var _0x518d1a={'include':[{'model':db[_0xad2d('0x40')],'as':_0xad2d('0x41')}]},_0x2810c2={},_0x2e8e66={'count':0x0,'rows':[]};var _0x42537f=_[_0xad2d('0x42')](db[_0xad2d('0x43')][_0xad2d('0x44')],function(_0x3933b1){return{'name':_0x3933b1[_0xad2d('0x45')],'type':_0x3933b1['type'][_0xad2d('0x46')]};});_0x2810c2['model']=_[_0xad2d('0x42')](_0x42537f,_0xad2d('0x3d'));_0x2810c2[_0xad2d('0x47')]=_[_0xad2d('0x48')](_0x165c44[_0xad2d('0x47')]);_0x2810c2[_0xad2d('0x49')]=_[_0xad2d('0x4a')](_0x2810c2['model'],_0x2810c2[_0xad2d('0x47')]);_0x518d1a[_0xad2d('0x4b')]=_[_0xad2d('0x4a')](_0x2810c2[_0xad2d('0x4c')],qs[_0xad2d('0x4d')](_0x165c44[_0xad2d('0x47')][_0xad2d('0x4d')]));_0x518d1a[_0xad2d('0x4b')]=_0x518d1a[_0xad2d('0x4b')][_0xad2d('0x4e')]?_0x518d1a[_0xad2d('0x4b')]:_0x2810c2[_0xad2d('0x4c')];if(!_0x165c44['query'][_0xad2d('0x4f')](_0xad2d('0x50'))){_0x518d1a[_0xad2d('0x31')]=qs[_0xad2d('0x31')](_0x165c44[_0xad2d('0x47')][_0xad2d('0x31')]);_0x518d1a['offset']=qs[_0xad2d('0x2f')](_0x165c44['query'][_0xad2d('0x2f')]);}_0x518d1a[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x165c44['query'][_0xad2d('0x52')]);_0x518d1a['where']=qs[_0xad2d('0x49')](_[_0xad2d('0x53')](_0x165c44['query'],_0x2810c2[_0xad2d('0x49')]),_0x42537f);if(_0x165c44[_0xad2d('0x47')][_0xad2d('0x54')]){_0x518d1a['where']=_[_0xad2d('0x55')](_0x518d1a[_0xad2d('0x56')],{'$or':_[_0xad2d('0x42')](_0x42537f,function(_0x414243){if(_0x414243[_0xad2d('0x57')]!==_0xad2d('0x58')){var _0x365bf1={};_0x365bf1[_0x414243[_0xad2d('0x3d')]]={'$like':'%'+_0x165c44['query']['filter']+'%'};return _0x365bf1;}})});}_0x518d1a=_[_0xad2d('0x55')]({},_0x518d1a,_0x165c44[_0xad2d('0x59')]);var _0x5577ec={'where':_0x518d1a[_0xad2d('0x56')]};return db['FaxAccount'][_0xad2d('0x32')](_0x5577ec)[_0xad2d('0x38')](function(_0x1af6d5){_0x2e8e66[_0xad2d('0x32')]=_0x1af6d5;if(_0x165c44['query']['includeAll']){_0x518d1a[_0xad2d('0x5a')]=[{'all':!![]}];}return db[_0xad2d('0x43')][_0xad2d('0x5b')](_0x518d1a);})[_0xad2d('0x38')](function(_0x56aa01){_0x2e8e66[_0xad2d('0x5c')]=_0x56aa01;return _0x2e8e66;})['then'](respondWithFilteredResult(_0x191681,_0x518d1a))[_0xad2d('0x2a')](handleError(_0x191681,null));};exports[_0xad2d('0x5d')]=function(_0x52661f,_0x58e093){var _0x2160f2={'raw':![],'where':{'id':_0x52661f[_0xad2d('0x5e')]['id']},'include':[{'model':db[_0xad2d('0x40')],'as':_0xad2d('0x41')}]},_0x2f0d7c={};_0x2f0d7c[_0xad2d('0x4c')]=_[_0xad2d('0x48')](db['FaxAccount'][_0xad2d('0x44')]);_0x2f0d7c[_0xad2d('0x47')]=_[_0xad2d('0x48')](_0x52661f[_0xad2d('0x47')]);_0x2f0d7c['filters']=_[_0xad2d('0x4a')](_0x2f0d7c['model'],_0x2f0d7c[_0xad2d('0x47')]);_0x2160f2[_0xad2d('0x4b')]=_[_0xad2d('0x4a')](_0x2f0d7c[_0xad2d('0x4c')],qs['fields'](_0x52661f[_0xad2d('0x47')]['fields']));_0x2160f2['attributes']=_0x2160f2[_0xad2d('0x4b')][_0xad2d('0x4e')]?_0x2160f2[_0xad2d('0x4b')]:_0x2f0d7c[_0xad2d('0x4c')];if(_0x52661f[_0xad2d('0x47')][_0xad2d('0x5f')]){_0x2160f2[_0xad2d('0x5a')]=[{'all':!![]}];}_0x2160f2=_[_0xad2d('0x55')]({},_0x2160f2,_0x52661f[_0xad2d('0x59')]);return db[_0xad2d('0x43')]['find'](_0x2160f2)['then'](handleEntityNotFound(_0x58e093,null))[_0xad2d('0x38')](respondWithResult(_0x58e093,null))[_0xad2d('0x2a')](handleError(_0x58e093,null));};exports[_0xad2d('0x60')]=function(_0x52030b,_0x302d99){return db[_0xad2d('0x43')][_0xad2d('0x60')](_0x52030b[_0xad2d('0x61')],{})[_0xad2d('0x38')](function(_0x3aa754){var _0x37482f=_0x52030b['user'][_0xad2d('0x62')]({'plain':!![]});if(!_0x37482f)throw new Error(_0xad2d('0x63'));if(_0x37482f['role']==='user'){var _0xeb0082=_0x3aa754[_0xad2d('0x62')]({'plain':!![]});var _0x2cad3e=_0xad2d('0x3a');return db['UserProfileSection'][_0xad2d('0x64')]({'where':{'name':_0x2cad3e,'userProfileId':_0x37482f[_0xad2d('0x65')]},'raw':!![]})[_0xad2d('0x38')](function(_0x4ca923){if(_0x4ca923&&_0x4ca923[_0xad2d('0x66')]===0x0){return db[_0xad2d('0x3b')]['create']({'name':_0xeb0082[_0xad2d('0x3d')],'resourceId':_0xeb0082['id'],'type':_0x4ca923[_0xad2d('0x3d')],'sectionId':_0x4ca923['id']},{})[_0xad2d('0x38')](function(){return _0x3aa754;});}else{return _0x3aa754;}})[_0xad2d('0x2a')](function(_0x4cd467){logger['error'](_0xad2d('0x67'),_0x4cd467);throw _0x4cd467;});}return _0x3aa754;})[_0xad2d('0x38')](respondWithResult(_0x302d99,0xc9))[_0xad2d('0x2a')](handleError(_0x302d99,null));};exports[_0xad2d('0x37')]=function(_0x4a6161,_0xc46f22){if(_0x4a6161[_0xad2d('0x61')]['id']){delete _0x4a6161['body']['id'];}return db['FaxAccount'][_0xad2d('0x64')]({'where':{'id':_0x4a6161[_0xad2d('0x5e')]['id']},'include':[{'model':db['Pause'],'as':_0xad2d('0x41')}]})[_0xad2d('0x38')](handleEntityNotFound(_0xc46f22,null))[_0xad2d('0x38')](saveUpdates(_0x4a6161[_0xad2d('0x61')],null))['then'](respondWithResult(_0xc46f22,null))[_0xad2d('0x2a')](handleError(_0xc46f22,null));};exports['destroy']=function(_0xe52881,_0x3cfecf){return db[_0xad2d('0x43')][_0xad2d('0x64')]({'where':{'id':_0xe52881[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x3cfecf,null))[_0xad2d('0x38')](removeEntity(_0x3cfecf,null))[_0xad2d('0x2a')](handleError(_0x3cfecf,null));};exports[_0xad2d('0x68')]=function(_0x210b2e,_0x29c960){return db[_0xad2d('0x43')][_0xad2d('0x68')]()[_0xad2d('0x38')](respondWithResult(_0x29c960,null))['catch'](handleError(_0x29c960,null));};exports[_0xad2d('0x69')]=function(_0x48e5d9,_0x4522e7,_0x5877c6){if(_0x48e5d9[_0xad2d('0x61')]['id']){delete _0x48e5d9[_0xad2d('0x61')]['id'];}return db[_0xad2d('0x43')]['find']({'where':{'id':_0x48e5d9['params']['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x4522e7,null))[_0xad2d('0x38')](function(_0x128026){if(_0x128026){_0x48e5d9[_0xad2d('0x61')][_0xad2d('0x6a')]=_0x128026['id'];return db['Disposition'][_0xad2d('0x60')](_0x48e5d9[_0xad2d('0x61')]);}})[_0xad2d('0x38')](respondWithResult(_0x4522e7,null))[_0xad2d('0x2a')](handleError(_0x4522e7,null));};exports['getDispositions']=function(_0x1ec65a,_0x1395db,_0x3fea87){var _0x53f5c3={'raw':![],'where':{}};var _0x37b459={};var _0x280c67={'count':0x0,'rows':[]};return db['FaxAccount'][_0xad2d('0x6b')]({'where':{'id':_0x1ec65a[_0xad2d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1395db,null))[_0xad2d('0x38')](function(_0x1754ce){if(_0x1754ce){_0x37b459[_0xad2d('0x4c')]=_[_0xad2d('0x48')](db['Disposition'][_0xad2d('0x44')]);_0x37b459[_0xad2d('0x47')]=_[_0xad2d('0x48')](_0x1ec65a[_0xad2d('0x47')]);_0x37b459['filters']=_[_0xad2d('0x4a')](_0x37b459[_0xad2d('0x4c')],_0x37b459[_0xad2d('0x47')]);_0x53f5c3[_0xad2d('0x4b')]=_['intersection'](_0x37b459[_0xad2d('0x4c')],qs['fields'](_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x4d')]));_0x53f5c3['attributes']=_0x53f5c3['attributes'][_0xad2d('0x4e')]?_0x53f5c3[_0xad2d('0x4b')]:_0x37b459['model'];if(!_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x4f')](_0xad2d('0x50'))){_0x53f5c3['limit']=qs[_0xad2d('0x31')](_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x31')]);_0x53f5c3['offset']=qs[_0xad2d('0x2f')](_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x2f')]);}_0x53f5c3[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x1ec65a['query'][_0xad2d('0x52')]);_0x53f5c3[_0xad2d('0x56')]=qs[_0xad2d('0x49')](_['pick'](_0x1ec65a[_0xad2d('0x47')],_0x37b459[_0xad2d('0x49')]));_0x53f5c3['where'][_0xad2d('0x6a')]=_0x1754ce['id'];if(_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x54')]){_0x53f5c3['where']=_['merge'](_0x53f5c3[_0xad2d('0x56')],{'$or':_[_0xad2d('0x42')](_0x53f5c3[_0xad2d('0x4b')],function(_0x47fbaf){var _0x350e95={};_0x350e95[_0x47fbaf]={'$like':'%'+_0x1ec65a[_0xad2d('0x47')][_0xad2d('0x54')]+'%'};return _0x350e95;})});}_0x53f5c3=_[_0xad2d('0x55')]({},_0x53f5c3,_0x1ec65a['options']);return db['Disposition'][_0xad2d('0x32')]({'where':_0x53f5c3[_0xad2d('0x56')]})[_0xad2d('0x38')](function(_0x1a9815){_0x280c67[_0xad2d('0x32')]=_0x1a9815;if(_0x1ec65a['query'][_0xad2d('0x5f')]){_0x53f5c3[_0xad2d('0x5a')]=[{'all':!![]}];}return db[_0xad2d('0x6c')]['findAll'](_0x53f5c3);})[_0xad2d('0x38')](function(_0x34b2c0){_0x280c67[_0xad2d('0x5c')]=_0x34b2c0;return _0x280c67;});}})[_0xad2d('0x38')](respondWithFilteredResult(_0x1395db,_0x53f5c3))[_0xad2d('0x2a')](handleError(_0x1395db,null));};exports[_0xad2d('0x6d')]=function(_0x5b5ad9,_0x4c65c4,_0xa7ea39){return db['FaxAccount'][_0xad2d('0x64')]({'where':{'id':_0x5b5ad9[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x4c65c4,null))['then'](function(_0xf8c7f8){if(_0xf8c7f8){return _0xf8c7f8['removeDispositions'](_0x5b5ad9[_0xad2d('0x47')][_0xad2d('0x6e')]);}})[_0xad2d('0x38')](respondWithStatusCode(_0x4c65c4,null))[_0xad2d('0x2a')](handleError(_0x4c65c4,null));};exports[_0xad2d('0x6f')]=function(_0x3d2fb3,_0x181cbe,_0x28e905){if(_0x3d2fb3['body']['id']){delete _0x3d2fb3[_0xad2d('0x61')]['id'];}return db[_0xad2d('0x43')]['find']({'where':{'id':_0x3d2fb3[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x181cbe,null))['then'](function(_0x1d02a0){if(_0x1d02a0){_0x3d2fb3[_0xad2d('0x61')][_0xad2d('0x6a')]=_0x1d02a0['id'];return db['CannedAnswer'][_0xad2d('0x60')](_0x3d2fb3[_0xad2d('0x61')]);}})[_0xad2d('0x38')](respondWithResult(_0x181cbe,null))[_0xad2d('0x2a')](handleError(_0x181cbe,null));};exports[_0xad2d('0x70')]=function(_0xc2bffb,_0x2b3dfe,_0x2966ab){var _0x42a3f4={'raw':![],'where':{}};var _0x63b739={};var _0x126763={'count':0x0,'rows':[]};return db[_0xad2d('0x43')][_0xad2d('0x6b')]({'where':{'id':_0xc2bffb[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x2b3dfe,null))[_0xad2d('0x38')](function(_0x55be09){if(_0x55be09){_0x63b739[_0xad2d('0x4c')]=_['keys'](db[_0xad2d('0x71')]['rawAttributes']);_0x63b739[_0xad2d('0x47')]=_[_0xad2d('0x48')](_0xc2bffb['query']);_0x63b739[_0xad2d('0x49')]=_[_0xad2d('0x4a')](_0x63b739[_0xad2d('0x4c')],_0x63b739[_0xad2d('0x47')]);_0x42a3f4[_0xad2d('0x4b')]=_[_0xad2d('0x4a')](_0x63b739[_0xad2d('0x4c')],qs[_0xad2d('0x4d')](_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x4d')]));_0x42a3f4[_0xad2d('0x4b')]=_0x42a3f4['attributes']['length']?_0x42a3f4[_0xad2d('0x4b')]:_0x63b739[_0xad2d('0x4c')];if(!_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x4f')](_0xad2d('0x50'))){_0x42a3f4[_0xad2d('0x31')]=qs[_0xad2d('0x31')](_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x31')]);_0x42a3f4[_0xad2d('0x2f')]=qs[_0xad2d('0x2f')](_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x2f')]);}_0x42a3f4[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0xc2bffb['query'][_0xad2d('0x52')]);_0x42a3f4[_0xad2d('0x56')]=qs[_0xad2d('0x49')](_[_0xad2d('0x53')](_0xc2bffb['query'],_0x63b739[_0xad2d('0x49')]));_0x42a3f4[_0xad2d('0x56')]['FaxAccountId']=_0x55be09['id'];if(_0xc2bffb['query'][_0xad2d('0x54')]){_0x42a3f4['where']=_['merge'](_0x42a3f4['where'],{'$or':_['map'](_0x42a3f4[_0xad2d('0x4b')],function(_0x53e73c){var _0x4268c6={};_0x4268c6[_0x53e73c]={'$like':'%'+_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x54')]+'%'};return _0x4268c6;})});}_0x42a3f4=_[_0xad2d('0x55')]({},_0x42a3f4,_0xc2bffb[_0xad2d('0x59')]);return db[_0xad2d('0x71')]['count']({'where':_0x42a3f4[_0xad2d('0x56')]})[_0xad2d('0x38')](function(_0x4075ad){_0x126763['count']=_0x4075ad;if(_0xc2bffb[_0xad2d('0x47')][_0xad2d('0x5f')]){_0x42a3f4[_0xad2d('0x5a')]=[{'all':!![]}];}return db['CannedAnswer'][_0xad2d('0x5b')](_0x42a3f4);})[_0xad2d('0x38')](function(_0x3b57a9){_0x126763[_0xad2d('0x5c')]=_0x3b57a9;return _0x126763;});}})[_0xad2d('0x38')](respondWithFilteredResult(_0x2b3dfe,_0x42a3f4))[_0xad2d('0x2a')](handleError(_0x2b3dfe,null));};exports['removeAnswers']=function(_0x2fda8c,_0x7e3516,_0x3a7e06){return db[_0xad2d('0x43')][_0xad2d('0x64')]({'where':{'id':_0x2fda8c['params']['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x7e3516,null))[_0xad2d('0x38')](function(_0x973bf9){if(_0x973bf9){return _0x973bf9[_0xad2d('0x72')](_0x2fda8c[_0xad2d('0x47')][_0xad2d('0x6e')]);}})[_0xad2d('0x38')](respondWithStatusCode(_0x7e3516,null))[_0xad2d('0x2a')](handleError(_0x7e3516,null));};exports[_0xad2d('0x73')]=function(_0xb7f6a,_0x547ec2,_0x5d9933){return db[_0xad2d('0x74')][_0xad2d('0x64')]({'where':{'id':_0xb7f6a['params']['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x547ec2,null))['then'](function(_0x1287f8){if(_0x1287f8){return _0x1287f8[_0xad2d('0x73')](_0xb7f6a[_0xad2d('0x61')][_0xad2d('0x6e')],_['omit'](_0xb7f6a[_0xad2d('0x61')],[_0xad2d('0x6e'),'id'])||{});}})[_0xad2d('0x38')](respondWithResult(_0x547ec2,null))[_0xad2d('0x2a')](handleError(_0x547ec2,null));};exports[_0xad2d('0x75')]=function(_0x12fc23,_0x4dcbb8,_0x4ee48f){var _0x1290a7={'raw':![],'where':{}};var _0x5eb7be={};var _0x232363={'count':0x0,'rows':[]};return db['FaxAccount'][_0xad2d('0x6b')]({'where':{'id':_0x12fc23[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x4dcbb8,null))[_0xad2d('0x38')](function(_0x77fbf9){if(_0x77fbf9){_0x5eb7be[_0xad2d('0x4c')]=_[_0xad2d('0x48')](db[_0xad2d('0x74')][_0xad2d('0x44')]);_0x5eb7be['query']=_[_0xad2d('0x48')](_0x12fc23['query']);_0x5eb7be['filters']=_[_0xad2d('0x4a')](_0x5eb7be['model'],_0x5eb7be['query']);_0x1290a7['attributes']=_[_0xad2d('0x4a')](_0x5eb7be['model'],qs['fields'](_0x12fc23[_0xad2d('0x47')][_0xad2d('0x4d')]));_0x1290a7['attributes']=_0x1290a7[_0xad2d('0x4b')]['length']?_0x1290a7[_0xad2d('0x4b')]:_0x5eb7be[_0xad2d('0x4c')];if(!_0x12fc23['query']['hasOwnProperty'](_0xad2d('0x50'))){_0x1290a7['limit']=qs[_0xad2d('0x31')](_0x12fc23[_0xad2d('0x47')][_0xad2d('0x31')]);_0x1290a7[_0xad2d('0x2f')]=qs[_0xad2d('0x2f')](_0x12fc23[_0xad2d('0x47')][_0xad2d('0x2f')]);}_0x1290a7[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x12fc23[_0xad2d('0x47')][_0xad2d('0x52')]);_0x1290a7[_0xad2d('0x56')]=qs['filters'](_['pick'](_0x12fc23[_0xad2d('0x47')],_0x5eb7be['filters']));_0x1290a7[_0xad2d('0x56')][_0xad2d('0x6a')]=_0x77fbf9['id'];if(_0x12fc23['query'][_0xad2d('0x54')]){_0x1290a7['where']=_[_0xad2d('0x55')](_0x1290a7[_0xad2d('0x56')],{'$or':_[_0xad2d('0x42')](_0x1290a7[_0xad2d('0x4b')],function(_0x4cbb70){var _0x65aba9={};_0x65aba9[_0x4cbb70]={'$like':'%'+_0x12fc23[_0xad2d('0x47')][_0xad2d('0x54')]+'%'};return _0x65aba9;})});}_0x1290a7=_[_0xad2d('0x55')]({},_0x1290a7,_0x12fc23[_0xad2d('0x59')]);return db[_0xad2d('0x74')][_0xad2d('0x32')]({'where':_0x1290a7['where']})[_0xad2d('0x38')](function(_0x5b00e4){_0x232363[_0xad2d('0x32')]=_0x5b00e4;if(_0x12fc23['query']['includeAll']){_0x1290a7[_0xad2d('0x5a')]=[{'model':db[_0xad2d('0x76')],'as':_0xad2d('0x77'),'required':![]},{'model':db[_0xad2d('0x78')],'as':_0xad2d('0x79'),'attributes':[_0xad2d('0x3d'),_0xad2d('0x7a'),_0xad2d('0x7b')],'required':![]},{'model':db['Tag'],'as':_0xad2d('0x7c'),'attributes':['id','name',_0xad2d('0x7d')],'where':_0x12fc23[_0xad2d('0x47')][_0xad2d('0x7e')]?{'id':_0x12fc23[_0xad2d('0x47')]['tag']}:undefined,'required':_0x12fc23[_0xad2d('0x47')]['tag']?!![]:![]}];}return db['FaxInteraction']['findAll'](_0x1290a7);})[_0xad2d('0x38')](function(_0xe6215f){_0x232363[_0xad2d('0x5c')]=_0xe6215f;return _0x232363;});}})[_0xad2d('0x38')](respondWithFilteredResult(_0x4dcbb8,_0x1290a7))[_0xad2d('0x2a')](handleError(_0x4dcbb8,null));};exports[_0xad2d('0x7f')]=function(_0xcf71d8,_0x3a9930){var _0x1f1357=_0xcf71d8[_0xad2d('0x5e')]['id'];var _0x1ab7c8=_0xcf71d8[_0xad2d('0x61')];var _0x15e785=0xc8;var _0x1ba00c=null;return db['sequelize'][_0xad2d('0x80')]({'isolationLevel':db[_0xad2d('0x81')][_0xad2d('0x82')][_0xad2d('0x83')]['READ_COMMITTED']},function(_0x3e2b64){return db[_0xad2d('0x43')][_0xad2d('0x6b')]({'where':{'id':_0x1f1357},'transaction':_0x3e2b64})[_0xad2d('0x38')](function(_0xbbeec0){if(_0xbbeec0){return db[_0xad2d('0x84')][_0xad2d('0x39')]({'where':{'FaxAccountId':_0x1f1357},'transaction':_0x3e2b64})[_0xad2d('0x38')](function(){var _0x374d72=_[_0xad2d('0x42')](_0x1ab7c8,function(_0x12179b){_0x12179b[_0xad2d('0x6a')]=_0x1f1357;return _0x12179b;});return db['FaxApplication'][_0xad2d('0x85')](_0x374d72,{'transaction':_0x3e2b64});});}else{_0x15e785=0x194;_0x1ba00c=[];}});})['then'](function(){if(_0x15e785!==0x194){return db[_0xad2d('0x84')][_0xad2d('0x86')]({'where':{'FaxAccountId':_0x1f1357},'order':'priority'})[_0xad2d('0x38')](function(_0x173096){_0x1ba00c=_0x173096;});}})[_0xad2d('0x2a')](function(_0x2e1926){_0x15e785=0x1f4;logger[_0xad2d('0x26')](_0x2e1926[_0xad2d('0x3c')]);if(_0x2e1926[_0xad2d('0x3d')]){delete _0x2e1926[_0xad2d('0x3d')];}_0x1ba00c=_0x2e1926;})['finally'](function(){if(_0x1ba00c===null){_0x3a9930['sendStatus'](_0x15e785);}else{if(_0x15e785===0x1f4){_0x3a9930[_0xad2d('0x2c')](_0x15e785)[_0xad2d('0x3e')](_0x1ba00c);}else{_0x3a9930[_0xad2d('0x2c')](_0x15e785)['json'](_0x1ba00c);}}});};exports[_0xad2d('0x87')]=function(_0x4d860f,_0x1a983c,_0x348b79){var _0x56dd06={};var _0x53c7bc={};var _0x5e98bc;var _0x2361b9;return db[_0xad2d('0x43')][_0xad2d('0x6b')]({'where':{'id':_0x4d860f[_0xad2d('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1a983c,null))[_0xad2d('0x38')](function(_0x447961){if(_0x447961){_0x5e98bc=_0x447961;_0x53c7bc[_0xad2d('0x4c')]=_[_0xad2d('0x48')](db[_0xad2d('0x84')][_0xad2d('0x44')]);_0x53c7bc[_0xad2d('0x47')]=_[_0xad2d('0x48')](_0x4d860f[_0xad2d('0x47')]);_0x53c7bc[_0xad2d('0x49')]=_[_0xad2d('0x4a')](_0x53c7bc[_0xad2d('0x4c')],_0x53c7bc[_0xad2d('0x47')]);_0x56dd06[_0xad2d('0x4b')]=_[_0xad2d('0x4a')](_0x53c7bc['model'],qs['fields'](_0x4d860f[_0xad2d('0x47')]['fields']));_0x56dd06[_0xad2d('0x4b')]=_0x56dd06[_0xad2d('0x4b')][_0xad2d('0x4e')]?_0x56dd06[_0xad2d('0x4b')]:_0x53c7bc[_0xad2d('0x4c')];_0x56dd06[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x4d860f[_0xad2d('0x47')][_0xad2d('0x52')]);_0x56dd06[_0xad2d('0x56')]=qs[_0xad2d('0x49')](_[_0xad2d('0x53')](_0x4d860f[_0xad2d('0x47')],_0x53c7bc[_0xad2d('0x49')]));if(_0x4d860f[_0xad2d('0x47')]['filter']){_0x56dd06[_0xad2d('0x56')]=_[_0xad2d('0x55')](_0x56dd06[_0xad2d('0x56')],{'$or':_['map'](_0x56dd06[_0xad2d('0x4b')],function(_0x38a653){var _0x48cf5f={};_0x48cf5f[_0x38a653]={'$like':'%'+_0x4d860f[_0xad2d('0x47')][_0xad2d('0x54')]+'%'};return _0x48cf5f;})});}_0x56dd06=_['merge']({},_0x56dd06,_0x4d860f[_0xad2d('0x59')]);return _0x5e98bc[_0xad2d('0x87')](_0x56dd06);}})[_0xad2d('0x38')](function(_0x48abfa){if(_0x48abfa){_0x2361b9=_0x48abfa[_0xad2d('0x4e')];if(!_0x4d860f[_0xad2d('0x47')][_0xad2d('0x4f')](_0xad2d('0x50'))){_0x56dd06['limit']=qs[_0xad2d('0x31')](_0x4d860f['query']['limit']);_0x56dd06[_0xad2d('0x2f')]=qs['offset'](_0x4d860f[_0xad2d('0x47')][_0xad2d('0x2f')]);}return _0x5e98bc[_0xad2d('0x87')](_0x56dd06);}})[_0xad2d('0x38')](function(_0x220817){if(_0x220817){return _0x220817?{'count':_0x2361b9,'rows':_0x220817}:null;}})['then'](respondWithResult(_0x1a983c,null))[_0xad2d('0x2a')](handleError(_0x1a983c,null));};function Extension(_0x23b87d,_0x5640e1,_0x383d5e,_0x39880f){this[_0xad2d('0x88')]=_0xad2d('0x89');this[_0xad2d('0x8a')]=_0x23b87d[_0xad2d('0x8b')];this['app']=_0x39880f;this[_0xad2d('0x57')]=_0xad2d('0x8c');this[_0xad2d('0x8d')]=_0xad2d('0x8e');this[_0xad2d('0x6a')]=_0x23b87d['id'];this[_0xad2d('0x8f')]=_0x5640e1;this['appdata']=_0x383d5e;}function createExtensionsReciveFax(_0x5cceda){var _0x3ed0f1=0x1;var _0x2fff2b=[];_0x2fff2b[_0xad2d('0x90')](new Extension(_0x5cceda,_0x3ed0f1,'','Answer'));_0x3ed0f1+=0x1;_0x2fff2b[_0xad2d('0x90')](new Extension(_0x5cceda,_0x3ed0f1,_0xad2d('0x91'),_0xad2d('0x92')));_0x3ed0f1+=0x1;for(var _0x34c109 in _0x5cceda){if(_0x5cceda['hasOwnProperty'](_0x34c109)&&(_0x34c109===_0xad2d('0x93')||_0x34c109===_0xad2d('0x8b')||_0x34c109===_0xad2d('0x94')||_0x34c109===_0xad2d('0x95')||_0x34c109===_0xad2d('0x96')||_0x34c109==='maxrate'||_0x34c109===_0xad2d('0x97')||_0x34c109==='modem'||_0x34c109==='t38timeout')){_0x2fff2b[_0xad2d('0x90')](new Extension(_0x5cceda,_0x3ed0f1,_0xad2d('0x98')+_0x34c109+')='+_0x5cceda[_0x34c109],_0xad2d('0x92')));_0x3ed0f1+=0x1;}}_0x2fff2b['push'](new Extension(_0x5cceda,_0x3ed0f1,'6',_0xad2d('0x99')));_0x3ed0f1+=0x1;_0x2fff2b[_0xad2d('0x90')](new Extension(_0x5cceda,_0x3ed0f1,_0xad2d('0x9a'),_0xad2d('0x9b')));_0x3ed0f1=0x0;return _0x2fff2b;}exports[_0xad2d('0x9c')]=function(_0x329a62,_0x5bf940,_0x2e764c){var _0x45babd;return db[_0xad2d('0x81')][_0xad2d('0x80')](function(_0x14abe8){return db['FaxAccount'][_0xad2d('0x60')](_0x329a62[_0xad2d('0x61')],{'transaction':_0x14abe8})[_0xad2d('0x38')](function(_0x1599b4){_0x45babd=_0x1599b4['get']({'plain':!![]});return db['VoiceExtension'][_0xad2d('0x85')](createExtensionsReciveFax(_0x45babd),{'transaction':_0x14abe8});});})[_0xad2d('0x38')](function(){return _0x45babd;})['then'](respondWithResult(_0x5bf940,null))[_0xad2d('0x2a')](handleError(_0x5bf940,null));};exports[_0xad2d('0x9d')]=function(_0x5f567b,_0x4f70de,_0x18fc33){var _0x3a4012;return db[_0xad2d('0x81')][_0xad2d('0x80')](function(_0x13f0d6){return db[_0xad2d('0x43')][_0xad2d('0x37')](_0x5f567b[_0xad2d('0x61')],{'where':{'id':_0x5f567b[_0xad2d('0x61')]['id']},'transaction':_0x13f0d6})[_0xad2d('0x38')](function(_0x3f3850){return db[_0xad2d('0x9e')][_0xad2d('0x39')]({'where':{'FaxAccountId':_0x5f567b['body']['id']},'transaction':_0x13f0d6})[_0xad2d('0x38')](function(_0x1461ef){return db[_0xad2d('0x9e')][_0xad2d('0x85')](createExtensionsReciveFax(_[_0xad2d('0x9f')](_0x5f567b[_0xad2d('0x61')],[_0xad2d('0xa0'),'key',_0xad2d('0xa1'),_0xad2d('0xa2'),_0xad2d('0xa3'),_0xad2d('0xa4')])),{'transaction':_0x13f0d6});});});})[_0xad2d('0x38')](function(){return db[_0xad2d('0x43')][_0xad2d('0xa5')](_0x5f567b['body']['id']);})[_0xad2d('0x38')](respondWithResult(_0x4f70de,null))['catch'](handleError(_0x4f70de,null));};exports[_0xad2d('0xa6')]=function(_0x1878eb,_0x1eaf31,_0x2b997c){var _0x257de8={'raw':!![],'where':{}};var _0x3c88b7={};var _0x5152cc={'count':0x0,'rows':[]};return db[_0xad2d('0x43')][_0xad2d('0x6b')]({'where':{'id':_0x1878eb[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x1eaf31,null))[_0xad2d('0x38')](function(_0x346067){if(_0x346067){_0x3c88b7[_0xad2d('0x4c')]=_[_0xad2d('0x48')](db[_0xad2d('0xa7')][_0xad2d('0x44')]);_0x3c88b7['query']=_[_0xad2d('0x48')](_0x1878eb[_0xad2d('0x47')]);_0x3c88b7[_0xad2d('0x49')]=_[_0xad2d('0x4a')](_0x3c88b7[_0xad2d('0x4c')],_0x3c88b7['query']);_0x257de8[_0xad2d('0x4b')]=_['intersection'](_0x3c88b7[_0xad2d('0x4c')],qs[_0xad2d('0x4d')](_0x1878eb['query'][_0xad2d('0x4d')]));_0x257de8[_0xad2d('0x4b')]=_0x257de8[_0xad2d('0x4b')]['length']?_0x257de8[_0xad2d('0x4b')]:_0x3c88b7[_0xad2d('0x4c')];if(!_0x1878eb['query']['hasOwnProperty'](_0xad2d('0x50'))){_0x257de8['limit']=qs[_0xad2d('0x31')](_0x1878eb['query'][_0xad2d('0x31')]);_0x257de8[_0xad2d('0x2f')]=qs[_0xad2d('0x2f')](_0x1878eb[_0xad2d('0x47')][_0xad2d('0x2f')]);}_0x257de8[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x1878eb['query']['sort']);_0x257de8['where']=qs[_0xad2d('0x49')](_[_0xad2d('0x53')](_0x1878eb[_0xad2d('0x47')],_0x3c88b7['filters']));_0x257de8[_0xad2d('0x56')]['FaxAccountId']=_0x346067['id'];if(_0x1878eb[_0xad2d('0x47')][_0xad2d('0x54')]){_0x257de8[_0xad2d('0x56')]=_['merge'](_0x257de8[_0xad2d('0x56')],{'$or':_[_0xad2d('0x42')](_0x257de8['attributes'],function(_0x55848a){var _0x23105d={};_0x23105d[_0x55848a]={'$like':'%'+_0x1878eb[_0xad2d('0x47')][_0xad2d('0x54')]+'%'};return _0x23105d;})});}if(_0x1878eb[_0xad2d('0x47')]['$gte']){var _0x39c038=_0x1878eb['query'][_0xad2d('0xa8')][_0xad2d('0xa9')](',');var _0x5736aa={};_0x5736aa[_0x39c038[0x0]]={'$gte':moment(_0x39c038[0x1])[_0xad2d('0xaa')](_0xad2d('0xab'))};_0x257de8['where']=_['merge'](_0x257de8[_0xad2d('0x56')],_0x5736aa);}_0x257de8=_[_0xad2d('0x55')]({},_0x257de8,_0x1878eb[_0xad2d('0x59')]);return db[_0xad2d('0xa7')][_0xad2d('0x32')]({'where':_0x257de8[_0xad2d('0x56')]})[_0xad2d('0x38')](function(_0x164825){_0x5152cc['count']=_0x164825;if(_0x1878eb['query'][_0xad2d('0x5f')]){_0x257de8[_0xad2d('0x5a')]=[{'all':!![]}];}return db[_0xad2d('0xa7')][_0xad2d('0x5b')](_0x257de8);})[_0xad2d('0x38')](function(_0x2ac648){_0x5152cc['rows']=_0x2ac648;return _0x5152cc;});}})[_0xad2d('0x38')](respondWithFilteredResult(_0x1eaf31,_0x257de8))[_0xad2d('0x2a')](handleError(_0x1eaf31,null));};exports[_0xad2d('0x3e')]=function(_0x4613a7,_0x9319ec,_0x558f9a){var _0x1f529c,_0x10f1f0={},_0x14fc38;if(_0x4613a7[_0xad2d('0x61')]['to']){_0x14fc38=_0x4613a7['body']['to'][0x0];}return db[_0xad2d('0x43')]['find']({'where':{'id':_0x4613a7[_0xad2d('0x5e')]['id']},'include':[{'model':db[_0xad2d('0xac')],'as':_0xad2d('0xad'),'include':[{'model':db[_0xad2d('0x76')],'as':_0xad2d('0xae'),'where':{'fax':_0x14fc38},'limit':0x1,'order':[[_0xad2d('0xa2'),_0xad2d('0xaf')]]}]}]})[_0xad2d('0x38')](handleEntityNotFound(_0x9319ec,null))[_0xad2d('0x38')](function(_0xc88974){_0x1f529c=_0xc88974;if(_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')]&&_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')]['length']){for(var _0x37dd91=0x0;_0x37dd91<_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][_0xad2d('0x4e')];_0x37dd91+=0x1){_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][_0x37dd91]={'filename':_0x4613a7['body']['attachments'][_0x37dd91][_0xad2d('0x3d')],'id':_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][_0x37dd91]['id'],'path':path[_0xad2d('0xb1')](config[_0xad2d('0xb2')],'server/files/attachments',_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][_0x37dd91][_0xad2d('0xb3')])};}}return respondWithRpcPromise(_0xad2d('0xb4'),'CheckAfterSend',{'FaxAccountId':_[_0xad2d('0xb5')](_0x4613a7[_0xad2d('0x5e')]['id'])?undefined:_0x4613a7['params']['id'],'path':_[_0xad2d('0xb5')](_0x4613a7[_0xad2d('0x61')]['attachments'][0x0][_0xad2d('0x7')])?undefined:_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][0x0]['path'],'fax':_['isNil'](_0x4613a7[_0xad2d('0x61')]['to'][0x0])?undefined:_0x4613a7[_0xad2d('0x61')]['to'][0x0]},client9002);})[_0xad2d('0x38')](function(){if(_0x1f529c){if(_[_0xad2d('0xb5')](_0x4613a7['body'][_0xad2d('0xb6')])){_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb6')]=util['format'](_0xad2d('0xb7'),_0x1f529c[_0xad2d('0x3d')],_0x1f529c[_0xad2d('0xb8')]);}if(_0x1f529c['List']){if(_0x1f529c['List'][_0xad2d('0xae')][_0xad2d('0x4e')]){return _0x1f529c[_0xad2d('0xad')][_0xad2d('0xae')][0x0];}else{return db[_0xad2d('0x76')]['create'](_[_0xad2d('0xb9')](_0x4613a7[_0xad2d('0x61')],{'firstName':_0x4613a7['body']['to'][0x0],'phone':_0x4613a7[_0xad2d('0x61')]['to'][0x0],'fax':_0x4613a7[_0xad2d('0x61')]['to'][0x0],'ListId':_0x1f529c[_0xad2d('0xa4')]}));}}else{throw new Error(_0xad2d('0xba'));}}else{throw new Error(_0xad2d('0xbb'));}})[_0xad2d('0x38')](function(_0x420406){if(_0x420406){return db[_0xad2d('0x74')][_0xad2d('0x64')]({'where':{'ContactId':_0x420406['id'],'closed':![],'FaxAccountId':_0x1f529c['id']}})[_0xad2d('0x38')](function(_0x20ae2f){if(_0x20ae2f){return[_0x20ae2f,![]];}return db[_0xad2d('0x74')][_0xad2d('0x60')]({'UserId':_0x4613a7['user']['id'],'ContactId':_0x420406['id'],'FaxAccountId':_0x1f529c['id'],'fax':_0x4613a7[_0xad2d('0x61')]['to'][0x0],'firstMsgDirection':_0xad2d('0xbc'),'Messages':[_[_0xad2d('0x55')](_0x4613a7[_0xad2d('0x61')],{'read':![],'body':_0x4613a7['body']['attachments'][0x0][_0xad2d('0xbd')],'FaxAccountId':_0x1f529c['id'],'UserId':_0x4613a7[_0xad2d('0xbe')]['id'],'ContactId':_0x420406['id'],'AttachmentId':_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][0x0]['id']})]},{'include':[{'model':db[_0xad2d('0xa7')],'as':_0xad2d('0xbf')}]})['then'](function(_0x5f237a){return[_0x5f237a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xad2d('0xc0')](function(_0x281c6e,_0x4316c1){if(_0x4316c1){return _0x281c6e;}return db['FaxMessage']['create']({'direction':_0xad2d('0xbc'),'read':![],'body':_0x4613a7['body'][_0xad2d('0xb0')][0x0]['filename'],'FaxAccountId':_0x1f529c['id'],'FaxInteractionId':_0x281c6e['id'],'UserId':_0x4613a7[_0xad2d('0xbe')]['id'],'ContactId':_0x281c6e[_0xad2d('0xc1')],'AttachmentId':_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][0x0]['id']})[_0xad2d('0x38')](function(_0x39491c){_0x281c6e['dataValues'][_0xad2d('0xbf')]=[];_0x281c6e['dataValues'][_0xad2d('0xbf')]['push'](_0x39491c[_0xad2d('0xc2')]);return _0x281c6e;});})[_0xad2d('0x38')](function(_0x1b840c){respondWithRpcPromise(_0xad2d('0xc3'),_0xad2d('0xc3'),{'FaxAccountId':_['isNil'](_0x4613a7[_0xad2d('0x5e')]['id'])?undefined:_0x4613a7[_0xad2d('0x5e')]['id'],'path':_[_0xad2d('0xb5')](_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][0x0][_0xad2d('0x7')])?undefined:_0x4613a7[_0xad2d('0x61')][_0xad2d('0xb0')][0x0][_0xad2d('0x7')],'fax':_[_0xad2d('0xb5')](_0x4613a7[_0xad2d('0x61')]['to'][0x0])?undefined:_0x4613a7[_0xad2d('0x61')]['to'][0x0],'AttachmentId':_0x4613a7[_0xad2d('0x61')]['attachments'][0x0]['id']},client9002)[_0xad2d('0x38')](function(_0x17319d){logger[_0xad2d('0x20')](_0xad2d('0xc4'),_0x17319d);})[_0xad2d('0x2a')](function(_0x1f9fea){logger['info']('SendFaxRpc,\x20%s',_0x1f9fea);});return _0x1b840c;})[_0xad2d('0x38')](respondWithResult(_0x9319ec,null))['catch'](handleError(_0x9319ec,null));};exports[_0xad2d('0xc5')]=function(_0x5d2b76,_0x1410a1,_0x5f4181){return db[_0xad2d('0x43')][_0xad2d('0x64')]({'where':{'id':_0x5d2b76[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x1410a1,null))[_0xad2d('0x38')](function(_0x4c941c){if(_0x4c941c){return _0x4c941c[_0xad2d('0xc5')](_0x5d2b76[_0xad2d('0x61')]['ids'],_['omit'](_0x5d2b76[_0xad2d('0x61')],['ids','id'])||{})['spread'](function(_0x246897){for(var _0x215b2d=0x0;_0x215b2d<_0x5d2b76[_0xad2d('0x61')][_0xad2d('0x6e')]['length'];_0x215b2d+=0x1){socket['emit']('userFaxAccount:save',{'UserId':Number(_0x5d2b76[_0xad2d('0x61')][_0xad2d('0x6e')][_0x215b2d]),'FaxAccountId':Number(_0x5d2b76[_0xad2d('0x5e')]['id'])});}return _0x246897;});}})[_0xad2d('0x38')](respondWithResult(_0x1410a1,null))[_0xad2d('0x2a')](handleError(_0x1410a1,null));};exports[_0xad2d('0xc6')]=function(_0x276f8e,_0x28b751,_0x5d8104){return db[_0xad2d('0x43')]['find']({'where':{'id':_0x276f8e[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x28b751,null))[_0xad2d('0x38')](function(_0x17d6d7){if(_0x17d6d7){return _0x17d6d7[_0xad2d('0xc6')](_0x276f8e[_0xad2d('0x47')][_0xad2d('0x6e')])[_0xad2d('0x38')](function(){if(_[_0xad2d('0xc7')](_0x276f8e[_0xad2d('0x47')][_0xad2d('0x6e')])){for(var _0x1477dc=0x0;_0x1477dc<_0x276f8e[_0xad2d('0x47')][_0xad2d('0x6e')]['length'];_0x1477dc+=0x1){socket[_0xad2d('0xc8')](_0xad2d('0xc9'),{'UserId':Number(_0x276f8e[_0xad2d('0x47')]['ids'][_0x1477dc]),'FaxAccountId':Number(_0x276f8e[_0xad2d('0x5e')]['id'])});}}else{socket['emit'](_0xad2d('0xc9'),{'UserId':Number(_0x276f8e[_0xad2d('0x47')][_0xad2d('0x6e')]),'FaxAccountId':Number(_0x276f8e[_0xad2d('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x28b751,null))[_0xad2d('0x2a')](handleError(_0x28b751,null));};exports[_0xad2d('0xca')]=function(_0x48e195,_0x4fcf7f,_0x322d0d){var _0x56f28c={};var _0x501f30={};var _0x6e1093;var _0x4e4ea8;return db[_0xad2d('0x43')][_0xad2d('0x6b')]({'where':{'id':_0x48e195[_0xad2d('0x5e')]['id']}})[_0xad2d('0x38')](handleEntityNotFound(_0x4fcf7f,null))[_0xad2d('0x38')](function(_0x23c065){if(_0x23c065){_0x6e1093=_0x23c065;_0x501f30[_0xad2d('0x4c')]=_['keys'](db[_0xad2d('0x78')][_0xad2d('0x44')]);_0x501f30[_0xad2d('0x47')]=_['keys'](_0x48e195[_0xad2d('0x47')]);_0x501f30[_0xad2d('0x49')]=_[_0xad2d('0x4a')](_0x501f30[_0xad2d('0x4c')],_0x501f30['query']);_0x56f28c[_0xad2d('0x4b')]=_[_0xad2d('0x4a')](_0x501f30[_0xad2d('0x4c')],qs[_0xad2d('0x4d')](_0x48e195['query'][_0xad2d('0x4d')]));_0x56f28c[_0xad2d('0x4b')]=_0x56f28c[_0xad2d('0x4b')][_0xad2d('0x4e')]?_0x56f28c['attributes']:_0x501f30[_0xad2d('0x4c')];_0x56f28c[_0xad2d('0x51')]=qs[_0xad2d('0x52')](_0x48e195[_0xad2d('0x47')]['sort']);_0x56f28c['where']=qs['filters'](_[_0xad2d('0x53')](_0x48e195[_0xad2d('0x47')],_0x501f30['filters']));if(_0x48e195['query'][_0xad2d('0x54')]){_0x56f28c[_0xad2d('0x56')]=_[_0xad2d('0x55')](_0x56f28c['where'],{'$or':_[_0xad2d('0x42')](_0x56f28c[_0xad2d('0x4b')],function(_0x33cd67){var _0x17157c={};_0x17157c[_0x33cd67]={'$like':'%'+_0x48e195['query'][_0xad2d('0x54')]+'%'};return _0x17157c;})});}_0x56f28c=_['merge']({},_0x56f28c,_0x48e195['options']);return _0x6e1093[_0xad2d('0xca')](_0x56f28c);}})[_0xad2d('0x38')](function(_0x433d08){if(_0x433d08){_0x4e4ea8=_0x433d08[_0xad2d('0x4e')];if(!_0x48e195[_0xad2d('0x47')]['hasOwnProperty'](_0xad2d('0x50'))){_0x56f28c[_0xad2d('0x31')]=qs[_0xad2d('0x31')](_0x48e195[_0xad2d('0x47')][_0xad2d('0x31')]);_0x56f28c[_0xad2d('0x2f')]=qs[_0xad2d('0x2f')](_0x48e195[_0xad2d('0x47')][_0xad2d('0x2f')]);}return _0x6e1093[_0xad2d('0xca')](_0x56f28c);}})[_0xad2d('0x38')](function(_0x2a7feb){if(_0x2a7feb){return _0x2a7feb?{'count':_0x4e4ea8,'rows':_0x2a7feb}:null;}})['then'](respondWithResult(_0x4fcf7f,null))[_0xad2d('0x2a')](handleError(_0x4fcf7f,null));}; \ No newline at end of file +var _0x8ca6=['addApplications','sequelize','transaction','Transaction','READ_COMMITTED','FaxApplication','findAndCountAll','priority','send','json','getApplications','context','exten','localstationid','app','system','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','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','ReceiveFax','addAccountApplications','VoiceExtension','bulkCreate','updateAccountApplications','tech','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','DESC','attachments','root','server/files/attachments','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','List','Contacts','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','spread','Messages','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','socket.io-emitter','register','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','info','result','sendStatus','end','status','offset','undefined','limit','count','Content-Range','save','update','destroy','get','FaxAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','map','VIRTUAL','FaxAccount','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','FaxAccountId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','User','Owner','fullname','Tags','tag'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x8ca6,0x10c));var _0x68ca=function(_0x43bf17,_0xddef22){_0x43bf17=_0x43bf17-0x0;var _0xf07a81=_0x8ca6[_0x43bf17];return _0xf07a81;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x68ca('0x0'));var zipdir=require(_0x68ca('0x1'));var jsonpatch=require(_0x68ca('0x2'));var rp=require(_0x68ca('0x3'));var moment=require(_0x68ca('0x4'));var BPromise=require(_0x68ca('0x5'));var Mustache=require(_0x68ca('0x6'));var util=require(_0x68ca('0x7'));var path=require(_0x68ca('0x8'));var sox=require('sox');var csv=require(_0x68ca('0x9'));var ejs=require(_0x68ca('0xa'));var fs=require('fs');var fs_extra=require(_0x68ca('0xb'));var _=require(_0x68ca('0xc'));var squel=require(_0x68ca('0xd'));var crypto=require(_0x68ca('0xe'));var jsforce=require(_0x68ca('0xf'));var deskjs=require(_0x68ca('0x10'));var toCsv=require('to-csv');var querystring=require(_0x68ca('0x11'));var Papa=require(_0x68ca('0x12'));var Redis=require(_0x68ca('0x13'));var authService=require(_0x68ca('0x14'));var qs=require(_0x68ca('0x15'));var as=require(_0x68ca('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68ca('0x17'));var utils=require(_0x68ca('0x18'));var config=require(_0x68ca('0x19'));var licenseUtil=require(_0x68ca('0x1a'));var db=require('../../mysqldb')['db'];config[_0x68ca('0x1b')]=_[_0x68ca('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x68ca('0x1d'))(new Redis(config[_0x68ca('0x1b')]));require('./faxAccount.socket')[_0x68ca('0x1e')](socket);var jayson=require(_0x68ca('0x1f'));var client=jayson[_0x68ca('0x20')]['http']({'port':0x232c});var client9002=jayson[_0x68ca('0x20')]['http']({'port':0x232a});function respondWithRpcPromise(_0x607c9f,_0x219f6b,_0x4e16cd,_0x1ab4f5){return new BPromise(function(_0x345976,_0x5dffef){var _0x3e619c=_0x1ab4f5||client;return _0x3e619c[_0x68ca('0x21')](_0x607c9f,_0x4e16cd)[_0x68ca('0x22')](function(_0x34754d){logger['info']('FaxAccount,\x20%s,\x20%s',_0x219f6b,_0x68ca('0x23'));logger[_0x68ca('0x24')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x219f6b,_0x68ca('0x23'),JSON[_0x68ca('0x25')](_0x34754d));if(_0x34754d[_0x68ca('0x26')]){if(_0x34754d['error'][_0x68ca('0x27')]===0x1f4){logger[_0x68ca('0x26')](_0x68ca('0x28'),_0x219f6b,_0x34754d[_0x68ca('0x26')][_0x68ca('0x29')]);return _0x5dffef(_0x34754d[_0x68ca('0x26')][_0x68ca('0x29')]);}logger[_0x68ca('0x26')]('FaxAccount,\x20%s,\x20%s',_0x219f6b,_0x34754d['error']['message']);return _0x345976(_0x34754d['error'][_0x68ca('0x29')]);}else{logger[_0x68ca('0x2a')](_0x68ca('0x28'),_0x219f6b,_0x68ca('0x23'));_0x345976(_0x34754d[_0x68ca('0x2b')][_0x68ca('0x29')]);}})['catch'](function(_0x2d0944){logger['error'](_0x68ca('0x28'),_0x219f6b,_0x2d0944);_0x5dffef(_0x2d0944);});});}function respondWithStatusCode(_0x36bedf,_0x35a67e){_0x35a67e=_0x35a67e||0xcc;return function(_0x1286d9){if(_0x1286d9){return _0x36bedf[_0x68ca('0x2c')](_0x35a67e);}return _0x36bedf['status'](_0x35a67e)[_0x68ca('0x2d')]();};}function respondWithResult(_0x42752a,_0x56c3a1){_0x56c3a1=_0x56c3a1||0xc8;return function(_0x436672){if(_0x436672){return _0x42752a[_0x68ca('0x2e')](_0x56c3a1)['json'](_0x436672);}};}function respondWithFilteredResult(_0x240574,_0x389ca8){return function(_0x491ab8){if(_0x491ab8){var _0x554646=typeof _0x389ca8[_0x68ca('0x2f')]===_0x68ca('0x30')&&typeof _0x389ca8[_0x68ca('0x31')]===_0x68ca('0x30');var _0x509b84=_0x491ab8[_0x68ca('0x32')];var _0x25b32e=_0x554646?0x0:_0x389ca8[_0x68ca('0x2f')];var _0x342c17=_0x554646?_0x491ab8[_0x68ca('0x32')]:_0x389ca8[_0x68ca('0x2f')]+_0x389ca8['limit'];var _0x18f499;if(_0x342c17>=_0x509b84){_0x342c17=_0x509b84;_0x18f499=0xc8;}else{_0x18f499=0xce;}_0x240574[_0x68ca('0x2e')](_0x18f499);return _0x240574['set'](_0x68ca('0x33'),_0x25b32e+'-'+_0x342c17+'/'+_0x509b84)['json'](_0x491ab8);}return null;};}function patchUpdates(_0x305346){return function(_0x42510f){try{jsonpatch['apply'](_0x42510f,_0x305346,!![]);}catch(_0x335a4e){return BPromise['reject'](_0x335a4e);}return _0x42510f[_0x68ca('0x34')]();};}function saveUpdates(_0x3ccf83,_0x17be86){return function(_0x1a6c10){if(_0x1a6c10){return _0x1a6c10[_0x68ca('0x35')](_0x3ccf83)[_0x68ca('0x22')](function(_0x2dc96a){return _0x2dc96a;});}return null;};}function removeEntity(_0x1074a7,_0x2ba037){return function(_0x36c90d){if(_0x36c90d){return _0x36c90d[_0x68ca('0x36')]()[_0x68ca('0x22')](function(){var _0x403c60=_0x36c90d[_0x68ca('0x37')]({'plain':!![]});var _0xe5a231=_0x68ca('0x38');return db[_0x68ca('0x39')][_0x68ca('0x36')]({'where':{'type':_0xe5a231,'resourceId':_0x403c60['id']}})[_0x68ca('0x22')](function(){return _0x36c90d;});})[_0x68ca('0x22')](function(){_0x1074a7['status'](0xcc)[_0x68ca('0x2d')]();});}};}function handleEntityNotFound(_0x538c5e,_0xc0a502){return function(_0x401cd7){if(!_0x401cd7){_0x538c5e[_0x68ca('0x2c')](0x194);}return _0x401cd7;};}function handleError(_0x15df31,_0x4fdc2d){_0x4fdc2d=_0x4fdc2d||0x1f4;return function(_0x432ae7){logger[_0x68ca('0x26')](_0x432ae7[_0x68ca('0x3a')]);if(_0x432ae7[_0x68ca('0x3b')]){delete _0x432ae7[_0x68ca('0x3b')];}_0x15df31['status'](_0x4fdc2d)['send'](_0x432ae7);};}exports['index']=function(_0x54972d,_0x3c4989){var _0x17d2b2={'include':[{'model':db[_0x68ca('0x3c')],'as':_0x68ca('0x3d')}]},_0x30040a={},_0x1d579a={'count':0x0,'rows':[]};var _0xfb8c0a=_['map'](db['FaxAccount'][_0x68ca('0x3e')],function(_0x56f107){return{'name':_0x56f107[_0x68ca('0x3f')],'type':_0x56f107[_0x68ca('0x40')][_0x68ca('0x41')]};});_0x30040a[_0x68ca('0x42')]=_['map'](_0xfb8c0a,'name');_0x30040a[_0x68ca('0x43')]=_[_0x68ca('0x44')](_0x54972d[_0x68ca('0x43')]);_0x30040a['filters']=_[_0x68ca('0x45')](_0x30040a[_0x68ca('0x42')],_0x30040a[_0x68ca('0x43')]);_0x17d2b2['attributes']=_[_0x68ca('0x45')](_0x30040a[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x54972d[_0x68ca('0x43')][_0x68ca('0x46')]));_0x17d2b2[_0x68ca('0x47')]=_0x17d2b2[_0x68ca('0x47')][_0x68ca('0x48')]?_0x17d2b2[_0x68ca('0x47')]:_0x30040a[_0x68ca('0x42')];if(!_0x54972d[_0x68ca('0x43')][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x17d2b2[_0x68ca('0x31')]=qs[_0x68ca('0x31')](_0x54972d[_0x68ca('0x43')][_0x68ca('0x31')]);_0x17d2b2['offset']=qs[_0x68ca('0x2f')](_0x54972d[_0x68ca('0x43')][_0x68ca('0x2f')]);}_0x17d2b2[_0x68ca('0x4b')]=qs['sort'](_0x54972d[_0x68ca('0x43')][_0x68ca('0x4c')]);_0x17d2b2[_0x68ca('0x4d')]=qs[_0x68ca('0x4e')](_[_0x68ca('0x4f')](_0x54972d['query'],_0x30040a[_0x68ca('0x4e')]),_0xfb8c0a);if(_0x54972d['query'][_0x68ca('0x50')]){_0x17d2b2[_0x68ca('0x4d')]=_[_0x68ca('0x51')](_0x17d2b2['where'],{'$or':_[_0x68ca('0x52')](_0xfb8c0a,function(_0x46e5be){if(_0x46e5be[_0x68ca('0x40')]!==_0x68ca('0x53')){var _0x44f39f={};_0x44f39f[_0x46e5be[_0x68ca('0x3b')]]={'$like':'%'+_0x54972d[_0x68ca('0x43')]['filter']+'%'};return _0x44f39f;}})});}_0x17d2b2=_[_0x68ca('0x51')]({},_0x17d2b2,_0x54972d['options']);var _0x242186={'where':_0x17d2b2[_0x68ca('0x4d')]};return db[_0x68ca('0x54')]['count'](_0x242186)['then'](function(_0x423e96){_0x1d579a[_0x68ca('0x32')]=_0x423e96;if(_0x54972d[_0x68ca('0x43')][_0x68ca('0x55')]){_0x17d2b2[_0x68ca('0x56')]=[{'all':!![]}];}return db[_0x68ca('0x54')][_0x68ca('0x57')](_0x17d2b2);})[_0x68ca('0x22')](function(_0x232bb1){_0x1d579a[_0x68ca('0x58')]=_0x232bb1;return _0x1d579a;})['then'](respondWithFilteredResult(_0x3c4989,_0x17d2b2))[_0x68ca('0x59')](handleError(_0x3c4989,null));};exports[_0x68ca('0x5a')]=function(_0x1fd74d,_0x3c89d9){var _0xbc04e5={'raw':![],'where':{'id':_0x1fd74d[_0x68ca('0x5b')]['id']},'include':[{'model':db['Pause'],'as':_0x68ca('0x3d')}]},_0x202d39={};_0x202d39[_0x68ca('0x42')]=_['keys'](db[_0x68ca('0x54')]['rawAttributes']);_0x202d39[_0x68ca('0x43')]=_[_0x68ca('0x44')](_0x1fd74d[_0x68ca('0x43')]);_0x202d39['filters']=_[_0x68ca('0x45')](_0x202d39[_0x68ca('0x42')],_0x202d39[_0x68ca('0x43')]);_0xbc04e5['attributes']=_[_0x68ca('0x45')](_0x202d39[_0x68ca('0x42')],qs['fields'](_0x1fd74d['query'][_0x68ca('0x46')]));_0xbc04e5[_0x68ca('0x47')]=_0xbc04e5['attributes']['length']?_0xbc04e5[_0x68ca('0x47')]:_0x202d39['model'];if(_0x1fd74d[_0x68ca('0x43')][_0x68ca('0x55')]){_0xbc04e5['include']=[{'all':!![]}];}_0xbc04e5=_['merge']({},_0xbc04e5,_0x1fd74d[_0x68ca('0x5c')]);return db[_0x68ca('0x54')][_0x68ca('0x5d')](_0xbc04e5)['then'](handleEntityNotFound(_0x3c89d9,null))['then'](respondWithResult(_0x3c89d9,null))[_0x68ca('0x59')](handleError(_0x3c89d9,null));};exports[_0x68ca('0x5e')]=function(_0x1f81fd,_0x3a56bf){return db[_0x68ca('0x54')][_0x68ca('0x5e')](_0x1f81fd[_0x68ca('0x5f')],{})[_0x68ca('0x22')](function(_0x2895dd){var _0x4588cc=_0x1f81fd[_0x68ca('0x60')][_0x68ca('0x37')]({'plain':!![]});if(!_0x4588cc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4588cc['role']===_0x68ca('0x60')){var _0x1b6203=_0x2895dd[_0x68ca('0x37')]({'plain':!![]});var _0xfb6423=_0x68ca('0x38');return db['UserProfileSection']['find']({'where':{'name':_0xfb6423,'userProfileId':_0x4588cc[_0x68ca('0x61')]},'raw':!![]})['then'](function(_0x1417e8){if(_0x1417e8&&_0x1417e8['autoAssociation']===0x0){return db[_0x68ca('0x39')][_0x68ca('0x5e')]({'name':_0x1b6203['name'],'resourceId':_0x1b6203['id'],'type':_0x1417e8[_0x68ca('0x3b')],'sectionId':_0x1417e8['id']},{})[_0x68ca('0x22')](function(){return _0x2895dd;});}else{return _0x2895dd;}})[_0x68ca('0x59')](function(_0x1d962d){logger[_0x68ca('0x26')](_0x68ca('0x62'),_0x1d962d);throw _0x1d962d;});}return _0x2895dd;})['then'](respondWithResult(_0x3a56bf,0xc9))[_0x68ca('0x59')](handleError(_0x3a56bf,null));};exports['update']=function(_0x2f7759,_0x1f7bfe){if(_0x2f7759[_0x68ca('0x5f')]['id']){delete _0x2f7759[_0x68ca('0x5f')]['id'];}return db[_0x68ca('0x54')][_0x68ca('0x5d')]({'where':{'id':_0x2f7759['params']['id']},'include':[{'model':db[_0x68ca('0x3c')],'as':_0x68ca('0x3d')}]})[_0x68ca('0x22')](handleEntityNotFound(_0x1f7bfe,null))[_0x68ca('0x22')](saveUpdates(_0x2f7759[_0x68ca('0x5f')],null))[_0x68ca('0x22')](respondWithResult(_0x1f7bfe,null))[_0x68ca('0x59')](handleError(_0x1f7bfe,null));};exports['destroy']=function(_0x4bf062,_0x578ddc){return db[_0x68ca('0x54')]['find']({'where':{'id':_0x4bf062['params']['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x578ddc,null))['then'](removeEntity(_0x578ddc,null))[_0x68ca('0x59')](handleError(_0x578ddc,null));};exports[_0x68ca('0x63')]=function(_0x4f54c9,_0xcad2b7){return db['FaxAccount'][_0x68ca('0x63')]()[_0x68ca('0x22')](respondWithResult(_0xcad2b7,null))[_0x68ca('0x59')](handleError(_0xcad2b7,null));};exports['addDisposition']=function(_0x400c26,_0x1d84b9,_0x438559){if(_0x400c26['body']['id']){delete _0x400c26[_0x68ca('0x5f')]['id'];}return db['FaxAccount'][_0x68ca('0x5d')]({'where':{'id':_0x400c26[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x1d84b9,null))[_0x68ca('0x22')](function(_0x3b177d){if(_0x3b177d){_0x400c26[_0x68ca('0x5f')][_0x68ca('0x64')]=_0x3b177d['id'];return db['Disposition'][_0x68ca('0x5e')](_0x400c26[_0x68ca('0x5f')]);}})[_0x68ca('0x22')](respondWithResult(_0x1d84b9,null))[_0x68ca('0x59')](handleError(_0x1d84b9,null));};exports[_0x68ca('0x65')]=function(_0x260eb2,_0x2def2d,_0x28c036){var _0x249bee={'raw':![],'where':{}};var _0x50ba7e={};var _0xcd961a={'count':0x0,'rows':[]};return db['FaxAccount'][_0x68ca('0x66')]({'where':{'id':_0x260eb2[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x2def2d,null))['then'](function(_0x478691){if(_0x478691){_0x50ba7e[_0x68ca('0x42')]=_[_0x68ca('0x44')](db[_0x68ca('0x67')][_0x68ca('0x3e')]);_0x50ba7e[_0x68ca('0x43')]=_['keys'](_0x260eb2['query']);_0x50ba7e[_0x68ca('0x4e')]=_['intersection'](_0x50ba7e[_0x68ca('0x42')],_0x50ba7e[_0x68ca('0x43')]);_0x249bee[_0x68ca('0x47')]=_[_0x68ca('0x45')](_0x50ba7e[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x260eb2[_0x68ca('0x43')]['fields']));_0x249bee[_0x68ca('0x47')]=_0x249bee[_0x68ca('0x47')][_0x68ca('0x48')]?_0x249bee[_0x68ca('0x47')]:_0x50ba7e[_0x68ca('0x42')];if(!_0x260eb2['query'][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x249bee['limit']=qs['limit'](_0x260eb2[_0x68ca('0x43')][_0x68ca('0x31')]);_0x249bee[_0x68ca('0x2f')]=qs[_0x68ca('0x2f')](_0x260eb2[_0x68ca('0x43')][_0x68ca('0x2f')]);}_0x249bee[_0x68ca('0x4b')]=qs[_0x68ca('0x4c')](_0x260eb2[_0x68ca('0x43')]['sort']);_0x249bee[_0x68ca('0x4d')]=qs[_0x68ca('0x4e')](_[_0x68ca('0x4f')](_0x260eb2[_0x68ca('0x43')],_0x50ba7e[_0x68ca('0x4e')]));_0x249bee['where']['FaxAccountId']=_0x478691['id'];if(_0x260eb2[_0x68ca('0x43')]['filter']){_0x249bee[_0x68ca('0x4d')]=_[_0x68ca('0x51')](_0x249bee['where'],{'$or':_['map'](_0x249bee['attributes'],function(_0x381e3c){var _0xd4a1a3={};_0xd4a1a3[_0x381e3c]={'$like':'%'+_0x260eb2[_0x68ca('0x43')][_0x68ca('0x50')]+'%'};return _0xd4a1a3;})});}_0x249bee=_[_0x68ca('0x51')]({},_0x249bee,_0x260eb2[_0x68ca('0x5c')]);return db[_0x68ca('0x67')][_0x68ca('0x32')]({'where':_0x249bee['where']})[_0x68ca('0x22')](function(_0x276c59){_0xcd961a['count']=_0x276c59;if(_0x260eb2[_0x68ca('0x43')][_0x68ca('0x55')]){_0x249bee[_0x68ca('0x56')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x249bee);})[_0x68ca('0x22')](function(_0x1306ec){_0xcd961a['rows']=_0x1306ec;return _0xcd961a;});}})[_0x68ca('0x22')](respondWithFilteredResult(_0x2def2d,_0x249bee))[_0x68ca('0x59')](handleError(_0x2def2d,null));};exports[_0x68ca('0x68')]=function(_0x6f4156,_0xc6f793,_0x27f103){return db['FaxAccount']['find']({'where':{'id':_0x6f4156[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0xc6f793,null))['then'](function(_0x283a57){if(_0x283a57){return _0x283a57['removeDispositions'](_0x6f4156[_0x68ca('0x43')][_0x68ca('0x69')]);}})[_0x68ca('0x22')](respondWithStatusCode(_0xc6f793,null))[_0x68ca('0x59')](handleError(_0xc6f793,null));};exports[_0x68ca('0x6a')]=function(_0x265c4a,_0x39a9cd,_0x1aafcd){if(_0x265c4a['body']['id']){delete _0x265c4a[_0x68ca('0x5f')]['id'];}return db[_0x68ca('0x54')]['find']({'where':{'id':_0x265c4a[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x39a9cd,null))[_0x68ca('0x22')](function(_0x859950){if(_0x859950){_0x265c4a[_0x68ca('0x5f')][_0x68ca('0x64')]=_0x859950['id'];return db[_0x68ca('0x6b')]['create'](_0x265c4a[_0x68ca('0x5f')]);}})['then'](respondWithResult(_0x39a9cd,null))[_0x68ca('0x59')](handleError(_0x39a9cd,null));};exports[_0x68ca('0x6c')]=function(_0x1f10e5,_0x56e7bb,_0x1f5628){var _0x200b15={'raw':![],'where':{}};var _0x250dc3={};var _0x43e4b6={'count':0x0,'rows':[]};return db[_0x68ca('0x54')][_0x68ca('0x66')]({'where':{'id':_0x1f10e5[_0x68ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0x56e7bb,null))['then'](function(_0x5368e1){if(_0x5368e1){_0x250dc3[_0x68ca('0x42')]=_[_0x68ca('0x44')](db[_0x68ca('0x6b')]['rawAttributes']);_0x250dc3[_0x68ca('0x43')]=_[_0x68ca('0x44')](_0x1f10e5[_0x68ca('0x43')]);_0x250dc3[_0x68ca('0x4e')]=_[_0x68ca('0x45')](_0x250dc3['model'],_0x250dc3[_0x68ca('0x43')]);_0x200b15[_0x68ca('0x47')]=_[_0x68ca('0x45')](_0x250dc3[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x46')]));_0x200b15[_0x68ca('0x47')]=_0x200b15[_0x68ca('0x47')][_0x68ca('0x48')]?_0x200b15[_0x68ca('0x47')]:_0x250dc3[_0x68ca('0x42')];if(!_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x200b15[_0x68ca('0x31')]=qs['limit'](_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x31')]);_0x200b15[_0x68ca('0x2f')]=qs[_0x68ca('0x2f')](_0x1f10e5[_0x68ca('0x43')]['offset']);}_0x200b15['order']=qs[_0x68ca('0x4c')](_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x4c')]);_0x200b15['where']=qs[_0x68ca('0x4e')](_[_0x68ca('0x4f')](_0x1f10e5['query'],_0x250dc3[_0x68ca('0x4e')]));_0x200b15['where'][_0x68ca('0x64')]=_0x5368e1['id'];if(_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x50')]){_0x200b15[_0x68ca('0x4d')]=_[_0x68ca('0x51')](_0x200b15[_0x68ca('0x4d')],{'$or':_[_0x68ca('0x52')](_0x200b15['attributes'],function(_0x49a2ec){var _0x2a6fe3={};_0x2a6fe3[_0x49a2ec]={'$like':'%'+_0x1f10e5[_0x68ca('0x43')][_0x68ca('0x50')]+'%'};return _0x2a6fe3;})});}_0x200b15=_[_0x68ca('0x51')]({},_0x200b15,_0x1f10e5['options']);return db[_0x68ca('0x6b')][_0x68ca('0x32')]({'where':_0x200b15[_0x68ca('0x4d')]})[_0x68ca('0x22')](function(_0x180a9b){_0x43e4b6[_0x68ca('0x32')]=_0x180a9b;if(_0x1f10e5['query'][_0x68ca('0x55')]){_0x200b15[_0x68ca('0x56')]=[{'all':!![]}];}return db[_0x68ca('0x6b')]['findAll'](_0x200b15);})[_0x68ca('0x22')](function(_0x184153){_0x43e4b6['rows']=_0x184153;return _0x43e4b6;});}})[_0x68ca('0x22')](respondWithFilteredResult(_0x56e7bb,_0x200b15))['catch'](handleError(_0x56e7bb,null));};exports[_0x68ca('0x6d')]=function(_0x3558ed,_0xe4b1be,_0x3b9741){return db[_0x68ca('0x54')][_0x68ca('0x5d')]({'where':{'id':_0x3558ed[_0x68ca('0x5b')]['id']}})['then'](handleEntityNotFound(_0xe4b1be,null))[_0x68ca('0x22')](function(_0x2a12e5){if(_0x2a12e5){return _0x2a12e5['removeAnswers'](_0x3558ed[_0x68ca('0x43')][_0x68ca('0x69')]);}})[_0x68ca('0x22')](respondWithStatusCode(_0xe4b1be,null))['catch'](handleError(_0xe4b1be,null));};exports['addInteraction']=function(_0x2cf3f9,_0x4a5fb6,_0x5aac08){return db['FaxInteraction'][_0x68ca('0x5d')]({'where':{'id':_0x2cf3f9['params']['id']}})['then'](handleEntityNotFound(_0x4a5fb6,null))[_0x68ca('0x22')](function(_0x17e1c2){if(_0x17e1c2){return _0x17e1c2[_0x68ca('0x6e')](_0x2cf3f9[_0x68ca('0x5f')]['ids'],_[_0x68ca('0x6f')](_0x2cf3f9['body'],['ids','id'])||{});}})[_0x68ca('0x22')](respondWithResult(_0x4a5fb6,null))['catch'](handleError(_0x4a5fb6,null));};exports[_0x68ca('0x70')]=function(_0x4c04c4,_0x1c5946,_0x174271){var _0x32ea39={'raw':![],'where':{}};var _0xd62c63={};var _0x2a8993={'count':0x0,'rows':[]};return db[_0x68ca('0x54')][_0x68ca('0x66')]({'where':{'id':_0x4c04c4[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x1c5946,null))['then'](function(_0x43e784){if(_0x43e784){_0xd62c63[_0x68ca('0x42')]=_[_0x68ca('0x44')](db[_0x68ca('0x71')][_0x68ca('0x3e')]);_0xd62c63[_0x68ca('0x43')]=_['keys'](_0x4c04c4[_0x68ca('0x43')]);_0xd62c63[_0x68ca('0x4e')]=_[_0x68ca('0x45')](_0xd62c63['model'],_0xd62c63[_0x68ca('0x43')]);_0x32ea39[_0x68ca('0x47')]=_[_0x68ca('0x45')](_0xd62c63[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x4c04c4['query'][_0x68ca('0x46')]));_0x32ea39[_0x68ca('0x47')]=_0x32ea39[_0x68ca('0x47')][_0x68ca('0x48')]?_0x32ea39['attributes']:_0xd62c63[_0x68ca('0x42')];if(!_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x32ea39[_0x68ca('0x31')]=qs[_0x68ca('0x31')](_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x31')]);_0x32ea39['offset']=qs[_0x68ca('0x2f')](_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x2f')]);}_0x32ea39[_0x68ca('0x4b')]=qs[_0x68ca('0x4c')](_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x4c')]);_0x32ea39[_0x68ca('0x4d')]=qs['filters'](_[_0x68ca('0x4f')](_0x4c04c4['query'],_0xd62c63[_0x68ca('0x4e')]));_0x32ea39[_0x68ca('0x4d')][_0x68ca('0x64')]=_0x43e784['id'];if(_0x4c04c4[_0x68ca('0x43')]['filter']){_0x32ea39[_0x68ca('0x4d')]=_[_0x68ca('0x51')](_0x32ea39[_0x68ca('0x4d')],{'$or':_[_0x68ca('0x52')](_0x32ea39['attributes'],function(_0xa929ca){var _0x4a5928={};_0x4a5928[_0xa929ca]={'$like':'%'+_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x50')]+'%'};return _0x4a5928;})});}_0x32ea39=_['merge']({},_0x32ea39,_0x4c04c4['options']);return db[_0x68ca('0x71')][_0x68ca('0x32')]({'where':_0x32ea39[_0x68ca('0x4d')]})[_0x68ca('0x22')](function(_0x445222){_0x2a8993[_0x68ca('0x32')]=_0x445222;if(_0x4c04c4[_0x68ca('0x43')][_0x68ca('0x55')]){_0x32ea39[_0x68ca('0x56')]=[{'model':db[_0x68ca('0x72')],'as':'Contact','required':![]},{'model':db[_0x68ca('0x73')],'as':_0x68ca('0x74'),'attributes':[_0x68ca('0x3b'),_0x68ca('0x75'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x68ca('0x76'),'attributes':['id',_0x68ca('0x3b'),'color'],'where':_0x4c04c4['query'][_0x68ca('0x77')]?{'id':_0x4c04c4['query'][_0x68ca('0x77')]}:undefined,'required':_0x4c04c4['query'][_0x68ca('0x77')]?!![]:![]}];}return db[_0x68ca('0x71')]['findAll'](_0x32ea39);})['then'](function(_0x47ea84){_0x2a8993[_0x68ca('0x58')]=_0x47ea84;return _0x2a8993;});}})[_0x68ca('0x22')](respondWithFilteredResult(_0x1c5946,_0x32ea39))[_0x68ca('0x59')](handleError(_0x1c5946,null));};exports[_0x68ca('0x78')]=function(_0x1e03f4,_0x386d27){var _0x327e35=_0x1e03f4[_0x68ca('0x5b')]['id'];var _0x2235e7=_0x1e03f4['body'];var _0x5ac74a=0xc8;var _0x200077=null;return db[_0x68ca('0x79')][_0x68ca('0x7a')]({'isolationLevel':db['sequelize'][_0x68ca('0x7b')]['ISOLATION_LEVELS'][_0x68ca('0x7c')]},function(_0x5ec1ae){return db[_0x68ca('0x54')][_0x68ca('0x66')]({'where':{'id':_0x327e35},'transaction':_0x5ec1ae})['then'](function(_0x14a99c){if(_0x14a99c){return db[_0x68ca('0x7d')][_0x68ca('0x36')]({'where':{'FaxAccountId':_0x327e35},'transaction':_0x5ec1ae})[_0x68ca('0x22')](function(){var _0x12baf6=_[_0x68ca('0x52')](_0x2235e7,function(_0x474c48){_0x474c48['FaxAccountId']=_0x327e35;return _0x474c48;});return db[_0x68ca('0x7d')]['bulkCreate'](_0x12baf6,{'transaction':_0x5ec1ae});});}else{_0x5ac74a=0x194;_0x200077=[];}});})[_0x68ca('0x22')](function(){if(_0x5ac74a!==0x194){return db[_0x68ca('0x7d')][_0x68ca('0x7e')]({'where':{'FaxAccountId':_0x327e35},'order':_0x68ca('0x7f')})[_0x68ca('0x22')](function(_0x4e94f1){_0x200077=_0x4e94f1;});}})[_0x68ca('0x59')](function(_0x1655bb){_0x5ac74a=0x1f4;logger[_0x68ca('0x26')](_0x1655bb['stack']);if(_0x1655bb['name']){delete _0x1655bb['name'];}_0x200077=_0x1655bb;})['finally'](function(){if(_0x200077===null){_0x386d27[_0x68ca('0x2c')](_0x5ac74a);}else{if(_0x5ac74a===0x1f4){_0x386d27[_0x68ca('0x2e')](_0x5ac74a)[_0x68ca('0x80')](_0x200077);}else{_0x386d27[_0x68ca('0x2e')](_0x5ac74a)[_0x68ca('0x81')](_0x200077);}}});};exports['getApplications']=function(_0x1b0087,_0x34d20e,_0x345b60){var _0x57cbb5={};var _0x2c7675={};var _0x162859;var _0x463915;return db[_0x68ca('0x54')][_0x68ca('0x66')]({'where':{'id':_0x1b0087['params']['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x34d20e,null))['then'](function(_0x21022e){if(_0x21022e){_0x162859=_0x21022e;_0x2c7675['model']=_['keys'](db[_0x68ca('0x7d')][_0x68ca('0x3e')]);_0x2c7675[_0x68ca('0x43')]=_[_0x68ca('0x44')](_0x1b0087[_0x68ca('0x43')]);_0x2c7675[_0x68ca('0x4e')]=_[_0x68ca('0x45')](_0x2c7675[_0x68ca('0x42')],_0x2c7675[_0x68ca('0x43')]);_0x57cbb5['attributes']=_['intersection'](_0x2c7675[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x1b0087[_0x68ca('0x43')][_0x68ca('0x46')]));_0x57cbb5[_0x68ca('0x47')]=_0x57cbb5[_0x68ca('0x47')]['length']?_0x57cbb5[_0x68ca('0x47')]:_0x2c7675[_0x68ca('0x42')];_0x57cbb5['order']=qs[_0x68ca('0x4c')](_0x1b0087[_0x68ca('0x43')][_0x68ca('0x4c')]);_0x57cbb5['where']=qs[_0x68ca('0x4e')](_[_0x68ca('0x4f')](_0x1b0087[_0x68ca('0x43')],_0x2c7675[_0x68ca('0x4e')]));if(_0x1b0087[_0x68ca('0x43')]['filter']){_0x57cbb5['where']=_['merge'](_0x57cbb5['where'],{'$or':_['map'](_0x57cbb5[_0x68ca('0x47')],function(_0x27e1bc){var _0x4b6a4a={};_0x4b6a4a[_0x27e1bc]={'$like':'%'+_0x1b0087[_0x68ca('0x43')]['filter']+'%'};return _0x4b6a4a;})});}_0x57cbb5=_[_0x68ca('0x51')]({},_0x57cbb5,_0x1b0087[_0x68ca('0x5c')]);return _0x162859[_0x68ca('0x82')](_0x57cbb5);}})[_0x68ca('0x22')](function(_0x2ee64f){if(_0x2ee64f){_0x463915=_0x2ee64f[_0x68ca('0x48')];if(!_0x1b0087[_0x68ca('0x43')][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x57cbb5[_0x68ca('0x31')]=qs[_0x68ca('0x31')](_0x1b0087[_0x68ca('0x43')][_0x68ca('0x31')]);_0x57cbb5[_0x68ca('0x2f')]=qs[_0x68ca('0x2f')](_0x1b0087['query'][_0x68ca('0x2f')]);}return _0x162859[_0x68ca('0x82')](_0x57cbb5);}})[_0x68ca('0x22')](function(_0x3971bd){if(_0x3971bd){return _0x3971bd?{'count':_0x463915,'rows':_0x3971bd}:null;}})[_0x68ca('0x22')](respondWithResult(_0x34d20e,null))['catch'](handleError(_0x34d20e,null));};function Extension(_0x220588,_0x1ac0d6,_0x140b83,_0x4fb898){this[_0x68ca('0x83')]='from-voip-provider';this[_0x68ca('0x84')]=_0x220588[_0x68ca('0x85')];this[_0x68ca('0x86')]=_0x4fb898;this[_0x68ca('0x40')]=_0x68ca('0x87');this['description']=_0x68ca('0x88');this[_0x68ca('0x64')]=_0x220588['id'];this['priority']=_0x1ac0d6;this[_0x68ca('0x89')]=_0x140b83;}function createExtensionsReciveFax(_0x15c90c){var _0x2d3e86=0x1;var _0x3b5e6f=[];_0x3b5e6f[_0x68ca('0x8a')](new Extension(_0x15c90c,_0x2d3e86,'',_0x68ca('0x8b')));_0x2d3e86+=0x1;_0x3b5e6f[_0x68ca('0x8a')](new Extension(_0x15c90c,_0x2d3e86,_0x68ca('0x8c'),_0x68ca('0x8d')));_0x2d3e86+=0x1;for(var _0x47bef0 in _0x15c90c){if(_0x15c90c[_0x68ca('0x49')](_0x47bef0)&&(_0x47bef0===_0x68ca('0x8e')||_0x47bef0===_0x68ca('0x85')||_0x47bef0===_0x68ca('0x8f')||_0x47bef0===_0x68ca('0x90')||_0x47bef0===_0x68ca('0x91')||_0x47bef0===_0x68ca('0x92')||_0x47bef0===_0x68ca('0x93')||_0x47bef0===_0x68ca('0x94')||_0x47bef0===_0x68ca('0x95'))){_0x3b5e6f[_0x68ca('0x8a')](new Extension(_0x15c90c,_0x2d3e86,_0x68ca('0x96')+_0x47bef0+')='+_0x15c90c[_0x47bef0],'Set'));_0x2d3e86+=0x1;}}_0x3b5e6f[_0x68ca('0x8a')](new Extension(_0x15c90c,_0x2d3e86,'6',_0x68ca('0x97')));_0x2d3e86+=0x1;_0x3b5e6f[_0x68ca('0x8a')](new Extension(_0x15c90c,_0x2d3e86,_0x68ca('0x98'),_0x68ca('0x99')));_0x2d3e86=0x0;return _0x3b5e6f;}exports[_0x68ca('0x9a')]=function(_0x9c1b51,_0x230a9a,_0x12b7f2){var _0x59fe36;return db[_0x68ca('0x79')]['transaction'](function(_0x542333){return db[_0x68ca('0x54')]['create'](_0x9c1b51[_0x68ca('0x5f')],{'transaction':_0x542333})[_0x68ca('0x22')](function(_0x35603e){_0x59fe36=_0x35603e[_0x68ca('0x37')]({'plain':!![]});return db[_0x68ca('0x9b')][_0x68ca('0x9c')](createExtensionsReciveFax(_0x59fe36),{'transaction':_0x542333});});})[_0x68ca('0x22')](function(){return _0x59fe36;})['then'](respondWithResult(_0x230a9a,null))[_0x68ca('0x59')](handleError(_0x230a9a,null));};exports[_0x68ca('0x9d')]=function(_0x2bb4c1,_0x4b91e8,_0x12421c){var _0x4ec277;return db[_0x68ca('0x79')]['transaction'](function(_0x1200a1){return db[_0x68ca('0x54')][_0x68ca('0x35')](_0x2bb4c1[_0x68ca('0x5f')],{'where':{'id':_0x2bb4c1[_0x68ca('0x5f')]['id']},'transaction':_0x1200a1})[_0x68ca('0x22')](function(_0x196dd7){return db[_0x68ca('0x9b')][_0x68ca('0x36')]({'where':{'FaxAccountId':_0x2bb4c1[_0x68ca('0x5f')]['id']},'transaction':_0x1200a1})[_0x68ca('0x22')](function(_0x13f4ba){return db['VoiceExtension']['bulkCreate'](createExtensionsReciveFax(_['omit'](_0x2bb4c1['body'],[_0x68ca('0x9e'),_0x68ca('0x41'),_0x68ca('0x9f'),_0x68ca('0xa0'),_0x68ca('0xa1'),_0x68ca('0xa2')])),{'transaction':_0x1200a1});});});})['then'](function(){return db[_0x68ca('0x54')][_0x68ca('0xa3')](_0x2bb4c1[_0x68ca('0x5f')]['id']);})[_0x68ca('0x22')](respondWithResult(_0x4b91e8,null))['catch'](handleError(_0x4b91e8,null));};exports[_0x68ca('0xa4')]=function(_0x3e3e85,_0x12da27,_0x512533){var _0x2d7ae7={'raw':!![],'where':{}};var _0x33c7b1={};var _0x73821d={'count':0x0,'rows':[]};return db[_0x68ca('0x54')][_0x68ca('0x66')]({'where':{'id':_0x3e3e85[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x12da27,null))[_0x68ca('0x22')](function(_0x3ad5ec){if(_0x3ad5ec){_0x33c7b1[_0x68ca('0x42')]=_[_0x68ca('0x44')](db[_0x68ca('0xa5')][_0x68ca('0x3e')]);_0x33c7b1[_0x68ca('0x43')]=_[_0x68ca('0x44')](_0x3e3e85[_0x68ca('0x43')]);_0x33c7b1[_0x68ca('0x4e')]=_[_0x68ca('0x45')](_0x33c7b1[_0x68ca('0x42')],_0x33c7b1['query']);_0x2d7ae7[_0x68ca('0x47')]=_[_0x68ca('0x45')](_0x33c7b1[_0x68ca('0x42')],qs['fields'](_0x3e3e85[_0x68ca('0x43')][_0x68ca('0x46')]));_0x2d7ae7['attributes']=_0x2d7ae7[_0x68ca('0x47')][_0x68ca('0x48')]?_0x2d7ae7[_0x68ca('0x47')]:_0x33c7b1['model'];if(!_0x3e3e85[_0x68ca('0x43')][_0x68ca('0x49')](_0x68ca('0x4a'))){_0x2d7ae7['limit']=qs[_0x68ca('0x31')](_0x3e3e85[_0x68ca('0x43')]['limit']);_0x2d7ae7[_0x68ca('0x2f')]=qs['offset'](_0x3e3e85[_0x68ca('0x43')][_0x68ca('0x2f')]);}_0x2d7ae7[_0x68ca('0x4b')]=qs[_0x68ca('0x4c')](_0x3e3e85[_0x68ca('0x43')][_0x68ca('0x4c')]);_0x2d7ae7[_0x68ca('0x4d')]=qs[_0x68ca('0x4e')](_[_0x68ca('0x4f')](_0x3e3e85[_0x68ca('0x43')],_0x33c7b1[_0x68ca('0x4e')]));_0x2d7ae7[_0x68ca('0x4d')][_0x68ca('0x64')]=_0x3ad5ec['id'];if(_0x3e3e85[_0x68ca('0x43')]['filter']){_0x2d7ae7['where']=_[_0x68ca('0x51')](_0x2d7ae7['where'],{'$or':_[_0x68ca('0x52')](_0x2d7ae7['attributes'],function(_0x4f6b14){var _0x2dcb27={};_0x2dcb27[_0x4f6b14]={'$like':'%'+_0x3e3e85['query'][_0x68ca('0x50')]+'%'};return _0x2dcb27;})});}if(_0x3e3e85['query'][_0x68ca('0xa6')]){var _0x76805e=_0x3e3e85[_0x68ca('0x43')][_0x68ca('0xa6')][_0x68ca('0xa7')](',');var _0x5a0c0f={};_0x5a0c0f[_0x76805e[0x0]]={'$gte':moment(_0x76805e[0x1])[_0x68ca('0xa8')](_0x68ca('0xa9'))};_0x2d7ae7[_0x68ca('0x4d')]=_[_0x68ca('0x51')](_0x2d7ae7[_0x68ca('0x4d')],_0x5a0c0f);}_0x2d7ae7=_[_0x68ca('0x51')]({},_0x2d7ae7,_0x3e3e85[_0x68ca('0x5c')]);return db[_0x68ca('0xa5')][_0x68ca('0x32')]({'where':_0x2d7ae7[_0x68ca('0x4d')]})[_0x68ca('0x22')](function(_0x32c1ed){_0x73821d[_0x68ca('0x32')]=_0x32c1ed;if(_0x3e3e85['query'][_0x68ca('0x55')]){_0x2d7ae7['include']=[{'all':!![]}];}return db[_0x68ca('0xa5')][_0x68ca('0x57')](_0x2d7ae7);})[_0x68ca('0x22')](function(_0x2ab402){_0x73821d[_0x68ca('0x58')]=_0x2ab402;return _0x73821d;});}})[_0x68ca('0x22')](respondWithFilteredResult(_0x12da27,_0x2d7ae7))[_0x68ca('0x59')](handleError(_0x12da27,null));};exports[_0x68ca('0x80')]=function(_0x5dac58,_0x111154,_0x2b5030){var _0x354925,_0x597dcb={},_0x117486;if(_0x5dac58['body']['to']){_0x117486=_0x5dac58['body']['to'][0x0];}return db['FaxAccount'][_0x68ca('0x5d')]({'where':{'id':_0x5dac58['params']['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':{'fax':_0x117486},'limit':0x1,'order':[['updatedAt',_0x68ca('0xaa')]]}]}]})[_0x68ca('0x22')](handleEntityNotFound(_0x111154,null))['then'](function(_0x5a20bd){_0x354925=_0x5a20bd;if(_0x5dac58['body'][_0x68ca('0xab')]&&_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][_0x68ca('0x48')]){for(var _0x4db380=0x0;_0x4db380<_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')]['length'];_0x4db380+=0x1){_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][_0x4db380]={'filename':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][_0x4db380][_0x68ca('0x3b')],'id':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][_0x4db380]['id'],'path':path['join'](config[_0x68ca('0xac')],_0x68ca('0xad'),_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][_0x4db380]['basename'])};}}return respondWithRpcPromise('CheckAfterSend',_0x68ca('0xae'),{'FaxAccountId':_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5b')]['id'])?undefined:_0x5dac58[_0x68ca('0x5b')]['id'],'path':_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5f')]['attachments'][0x0][_0x68ca('0x8')])?undefined:_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0][_0x68ca('0x8')],'fax':_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5f')]['to'][0x0])?undefined:_0x5dac58[_0x68ca('0x5f')]['to'][0x0]},client9002);})['then'](function(){if(_0x354925){if(_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xb0')])){_0x5dac58['body'][_0x68ca('0xb0')]=util[_0x68ca('0xa8')](_0x68ca('0xb1'),_0x354925[_0x68ca('0x3b')],_0x354925['fax']);}if(_0x354925['List']){if(_0x354925[_0x68ca('0xb2')][_0x68ca('0xb3')][_0x68ca('0x48')]){return _0x354925[_0x68ca('0xb2')]['Contacts'][0x0];}else{return db[_0x68ca('0x72')]['create'](_[_0x68ca('0x1c')](_0x5dac58[_0x68ca('0x5f')],{'firstName':_0x5dac58[_0x68ca('0x5f')]['to'][0x0],'phone':_0x5dac58['body']['to'][0x0],'fax':_0x5dac58[_0x68ca('0x5f')]['to'][0x0],'ListId':_0x354925[_0x68ca('0xa2')]}));}}else{throw new Error(_0x68ca('0xb4'));}}else{throw new Error(_0x68ca('0xb5'));}})[_0x68ca('0x22')](function(_0x5c88a0){if(_0x5c88a0){return db[_0x68ca('0x71')]['find']({'where':{'ContactId':_0x5c88a0['id'],'closed':![],'FaxAccountId':_0x354925['id']}})['then'](function(_0x68acaa){if(_0x68acaa){return[_0x68acaa,![]];}return db[_0x68ca('0x71')]['create']({'UserId':_0x5dac58[_0x68ca('0x60')]['id'],'ContactId':_0x5c88a0['id'],'FaxAccountId':_0x354925['id'],'fax':_0x5dac58[_0x68ca('0x5f')]['to'][0x0],'firstMsgDirection':_0x68ca('0xb6'),'Messages':[_['merge'](_0x5dac58[_0x68ca('0x5f')],{'read':![],'body':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0][_0x68ca('0xb7')],'FaxAccountId':_0x354925['id'],'UserId':_0x5dac58['user']['id'],'ContactId':_0x5c88a0['id'],'AttachmentId':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0]['id']})]},{'include':[{'model':db[_0x68ca('0xa5')],'as':'Messages'}]})[_0x68ca('0x22')](function(_0x382055){return[_0x382055,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x68ca('0xb8')](function(_0x1b3f4d,_0x185817){if(_0x185817){return _0x1b3f4d;}return db[_0x68ca('0xa5')][_0x68ca('0x5e')]({'direction':'out','read':![],'body':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0][_0x68ca('0xb7')],'FaxAccountId':_0x354925['id'],'FaxInteractionId':_0x1b3f4d['id'],'UserId':_0x5dac58['user']['id'],'ContactId':_0x1b3f4d['ContactId'],'AttachmentId':_0x5dac58[_0x68ca('0x5f')]['attachments'][0x0]['id']})[_0x68ca('0x22')](function(_0x3dfb2e){_0x1b3f4d['dataValues'][_0x68ca('0xb9')]=[];_0x1b3f4d[_0x68ca('0xba')][_0x68ca('0xb9')][_0x68ca('0x8a')](_0x3dfb2e[_0x68ca('0xba')]);return _0x1b3f4d;});})['then'](function(_0x45256c){respondWithRpcPromise(_0x68ca('0xbb'),_0x68ca('0xbb'),{'FaxAccountId':_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5b')]['id'])?undefined:_0x5dac58[_0x68ca('0x5b')]['id'],'path':_[_0x68ca('0xaf')](_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0][_0x68ca('0x8')])?undefined:_0x5dac58['body'][_0x68ca('0xab')][0x0][_0x68ca('0x8')],'fax':_['isNil'](_0x5dac58[_0x68ca('0x5f')]['to'][0x0])?undefined:_0x5dac58['body']['to'][0x0],'AttachmentId':_0x5dac58[_0x68ca('0x5f')][_0x68ca('0xab')][0x0]['id']},client9002)['then'](function(_0x5a37a3){logger[_0x68ca('0x2a')](_0x68ca('0xbc'),_0x5a37a3);})['catch'](function(_0x1f35b8){logger[_0x68ca('0x2a')]('SendFaxRpc,\x20%s',_0x1f35b8);});return _0x45256c;})['then'](respondWithResult(_0x111154,null))['catch'](handleError(_0x111154,null));};exports[_0x68ca('0xbd')]=function(_0xcfb2b6,_0x529c31,_0x18b9c2){return db['FaxAccount']['find']({'where':{'id':_0xcfb2b6[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x529c31,null))[_0x68ca('0x22')](function(_0x41516d){if(_0x41516d){return _0x41516d[_0x68ca('0xbd')](_0xcfb2b6[_0x68ca('0x5f')]['ids'],_[_0x68ca('0x6f')](_0xcfb2b6[_0x68ca('0x5f')],[_0x68ca('0x69'),'id'])||{})['spread'](function(_0x17e14f){for(var _0x2a80fa=0x0;_0x2a80fa<_0xcfb2b6[_0x68ca('0x5f')][_0x68ca('0x69')]['length'];_0x2a80fa+=0x1){socket[_0x68ca('0xbe')]('userFaxAccount:save',{'UserId':Number(_0xcfb2b6[_0x68ca('0x5f')]['ids'][_0x2a80fa]),'FaxAccountId':Number(_0xcfb2b6[_0x68ca('0x5b')]['id'])});}return _0x17e14f;});}})[_0x68ca('0x22')](respondWithResult(_0x529c31,null))['catch'](handleError(_0x529c31,null));};exports[_0x68ca('0xbf')]=function(_0x4f4ea9,_0x3bde13,_0x55f018){return db[_0x68ca('0x54')][_0x68ca('0x5d')]({'where':{'id':_0x4f4ea9[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x3bde13,null))[_0x68ca('0x22')](function(_0x8bb09e){if(_0x8bb09e){return _0x8bb09e[_0x68ca('0xbf')](_0x4f4ea9[_0x68ca('0x43')][_0x68ca('0x69')])['then'](function(){if(_['isArray'](_0x4f4ea9[_0x68ca('0x43')]['ids'])){for(var _0x33aa50=0x0;_0x33aa50<_0x4f4ea9[_0x68ca('0x43')][_0x68ca('0x69')][_0x68ca('0x48')];_0x33aa50+=0x1){socket[_0x68ca('0xbe')](_0x68ca('0xc0'),{'UserId':Number(_0x4f4ea9['query'][_0x68ca('0x69')][_0x33aa50]),'FaxAccountId':Number(_0x4f4ea9[_0x68ca('0x5b')]['id'])});}}else{socket[_0x68ca('0xbe')](_0x68ca('0xc0'),{'UserId':Number(_0x4f4ea9[_0x68ca('0x43')][_0x68ca('0x69')]),'FaxAccountId':Number(_0x4f4ea9[_0x68ca('0x5b')]['id'])});}});}})[_0x68ca('0x22')](respondWithStatusCode(_0x3bde13,null))[_0x68ca('0x59')](handleError(_0x3bde13,null));};exports['getAgents']=function(_0x50c138,_0x4c8400,_0x384963){var _0x4c81ee={};var _0x210f75={};var _0x362fd4;var _0x3aa1d6;return db['FaxAccount'][_0x68ca('0x66')]({'where':{'id':_0x50c138[_0x68ca('0x5b')]['id']}})[_0x68ca('0x22')](handleEntityNotFound(_0x4c8400,null))[_0x68ca('0x22')](function(_0x38fbf4){if(_0x38fbf4){_0x362fd4=_0x38fbf4;_0x210f75[_0x68ca('0x42')]=_[_0x68ca('0x44')](db[_0x68ca('0x73')]['rawAttributes']);_0x210f75['query']=_[_0x68ca('0x44')](_0x50c138[_0x68ca('0x43')]);_0x210f75[_0x68ca('0x4e')]=_[_0x68ca('0x45')](_0x210f75[_0x68ca('0x42')],_0x210f75[_0x68ca('0x43')]);_0x4c81ee[_0x68ca('0x47')]=_[_0x68ca('0x45')](_0x210f75[_0x68ca('0x42')],qs[_0x68ca('0x46')](_0x50c138[_0x68ca('0x43')]['fields']));_0x4c81ee[_0x68ca('0x47')]=_0x4c81ee[_0x68ca('0x47')][_0x68ca('0x48')]?_0x4c81ee['attributes']:_0x210f75['model'];_0x4c81ee[_0x68ca('0x4b')]=qs[_0x68ca('0x4c')](_0x50c138['query'][_0x68ca('0x4c')]);_0x4c81ee[_0x68ca('0x4d')]=qs['filters'](_[_0x68ca('0x4f')](_0x50c138[_0x68ca('0x43')],_0x210f75[_0x68ca('0x4e')]));if(_0x50c138[_0x68ca('0x43')][_0x68ca('0x50')]){_0x4c81ee['where']=_['merge'](_0x4c81ee[_0x68ca('0x4d')],{'$or':_[_0x68ca('0x52')](_0x4c81ee[_0x68ca('0x47')],function(_0xa7a2b7){var _0x4f3e9e={};_0x4f3e9e[_0xa7a2b7]={'$like':'%'+_0x50c138[_0x68ca('0x43')][_0x68ca('0x50')]+'%'};return _0x4f3e9e;})});}_0x4c81ee=_[_0x68ca('0x51')]({},_0x4c81ee,_0x50c138[_0x68ca('0x5c')]);return _0x362fd4[_0x68ca('0xc1')](_0x4c81ee);}})['then'](function(_0x6c02f3){if(_0x6c02f3){_0x3aa1d6=_0x6c02f3[_0x68ca('0x48')];if(!_0x50c138[_0x68ca('0x43')][_0x68ca('0x49')]('nolimit')){_0x4c81ee[_0x68ca('0x31')]=qs['limit'](_0x50c138['query'][_0x68ca('0x31')]);_0x4c81ee[_0x68ca('0x2f')]=qs[_0x68ca('0x2f')](_0x50c138[_0x68ca('0x43')][_0x68ca('0x2f')]);}return _0x362fd4[_0x68ca('0xc1')](_0x4c81ee);}})[_0x68ca('0x22')](function(_0x24ef59){if(_0x24ef59){return _0x24ef59?{'count':_0x3aa1d6,'rows':_0x24ef59}:null;}})[_0x68ca('0x22')](respondWithResult(_0x4c8400,null))[_0x68ca('0x59')](handleError(_0x4c8400,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 79789a0..b38463c 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 _0xde9f=['save','remove','emit','exports','events','setMaxListeners'];(function(_0x129213,_0x3816db){var _0x3d5357=function(_0x536455){while(--_0x536455){_0x129213['push'](_0x129213['shift']());}};_0x3d5357(++_0x3816db);}(_0xde9f,0x118));var _0xfde9=function(_0x9df3d8,_0x4074e3){_0x9df3d8=_0x9df3d8-0x0;var _0x366da1=_0xde9f[_0x9df3d8];return _0x366da1;};'use strict';var EventEmitter=require(_0xfde9('0x0'));var FaxAccount=require('../../mysqldb')['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xfde9('0x1')](0x0);var events={'afterCreate':_0xfde9('0x2'),'afterUpdate':'update','afterDestroy':_0xfde9('0x3')};function emitEvent(_0x27a331){return function(_0x4f356a,_0x3a6e6d,_0x4767ba){FaxAccountEvents[_0xfde9('0x4')](_0x27a331+':'+_0x4f356a['id'],_0x4f356a);FaxAccountEvents[_0xfde9('0x4')](_0x27a331,_0x4f356a);_0x4767ba(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xfde9('0x5')]=FaxAccountEvents; \ No newline at end of file +var _0xa8a0=['setMaxListeners','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x30834e,_0x284d08){var _0x3b899c=function(_0x17ac65){while(--_0x17ac65){_0x30834e['push'](_0x30834e['shift']());}};_0x3b899c(++_0x284d08);}(_0xa8a0,0x9e));var _0x0a8a=function(_0x238741,_0x389003){_0x238741=_0x238741-0x0;var _0x211b00=_0xa8a0[_0x238741];return _0x211b00;};'use strict';var EventEmitter=require(_0x0a8a('0x0'));var FaxAccount=require(_0x0a8a('0x1'))['db']['FaxAccount'];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x0a8a('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x0a8a('0x3')};function emitEvent(_0x4c46c0){return function(_0x1efe3b,_0x28cef2,_0x2b8e89){FaxAccountEvents[_0x0a8a('0x4')](_0x4c46c0+':'+_0x1efe3b['id'],_0x1efe3b);FaxAccountEvents[_0x0a8a('0x4')](_0x4c46c0,_0x1efe3b);_0x2b8e89(null);};}for(var e in events){if(events[_0x0a8a('0x5')](e)){var event=events[e];FaxAccount[_0x0a8a('0x6')](e,emitEvent(event));}}module[_0x0a8a('0x7')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index cf2235b..c059d54 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 _0x78a3=['bluebird','request-promise','rimraf','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x15c129,_0x1d3370){var _0x4958d7=function(_0x466cf6){while(--_0x466cf6){_0x15c129['push'](_0x15c129['shift']());}};_0x4958d7(++_0x1d3370);}(_0x78a3,0x1c2));var _0x378a=function(_0x5b87ce,_0x20b7f6){_0x5b87ce=_0x5b87ce-0x0;var _0x597aa7=_0x78a3[_0x5b87ce];return _0x597aa7;};'use strict';var _=require(_0x378a('0x0'));var util=require(_0x378a('0x1'));var logger=require(_0x378a('0x2'))(_0x378a('0x3'));var moment=require(_0x378a('0x4'));var BPromise=require(_0x378a('0x5'));var rp=require(_0x378a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x378a('0x7'));var config=require('../../config/environment');var attributes=require(_0x378a('0x8'));module[_0x378a('0x9')]=function(_0x35f74a,_0xcd792e){return _0x35f74a[_0x378a('0xa')](_0x378a('0xb'),attributes,{'tableName':_0x378a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5f=['./faxAccount.attributes','define','FaxAccount','fax_accounts','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x206984,_0x50b754){var _0xeebc35=function(_0x4cb920){while(--_0x4cb920){_0x206984['push'](_0x206984['shift']());}};_0xeebc35(++_0x50b754);}(_0x9c5f,0xac));var _0xf9c5=function(_0x3fcedb,_0x19e410){_0x3fcedb=_0x3fcedb-0x0;var _0x25a1b2=_0x9c5f[_0x3fcedb];return _0x25a1b2;};'use strict';var _=require(_0xf9c5('0x0'));var util=require('util');var logger=require(_0xf9c5('0x1'))(_0xf9c5('0x2'));var moment=require(_0xf9c5('0x3'));var BPromise=require(_0xf9c5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf9c5('0x5'));var rimraf=require(_0xf9c5('0x6'));var config=require(_0xf9c5('0x7'));var attributes=require(_0xf9c5('0x8'));module['exports']=function(_0x4b86bb,_0x4866f4){return _0x4b86bb[_0xf9c5('0x9')](_0xf9c5('0xa'),attributes,{'tableName':_0xf9c5('0xb'),'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 be049db..ccd9ab8 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 _0xb248=['util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','keys','createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','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','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','created','interaction','FaxMessage','ContactId','AttachmentId','unshift','agent','name','*,*,*,*','startRouting','Start','lodash'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xb248,0x163));var _0x8b24=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xb248[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x8b24('0x0'));var util=require(_0x8b24('0x1'));var moment=require(_0x8b24('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8b24('0x3'));var db=require(_0x8b24('0x4'))['db'];var utils=require(_0x8b24('0x5'));var logger=require(_0x8b24('0x6'))(_0x8b24('0x7'));var config=require(_0x8b24('0x8'));var jayson=require(_0x8b24('0x9'));var client=jayson[_0x8b24('0xa')][_0x8b24('0xb')]({'port':0x232c});config[_0x8b24('0xc')]=_[_0x8b24('0xd')](config[_0x8b24('0xc')],{'host':_0x8b24('0xe'),'port':0x18eb});var socket=require(_0x8b24('0xf'))(new Redis(config[_0x8b24('0xc')]));require(_0x8b24('0x10'))[_0x8b24('0x11')](socket);function respondWithRpcPromise(_0x705576,_0x1ef0e5,_0x3651c6){return new BPromise(function(_0x2d38ec,_0x519f0b){return client[_0x8b24('0x12')](_0x705576,_0x3651c6)[_0x8b24('0x13')](function(_0x34679e){logger[_0x8b24('0x14')](_0x8b24('0x15'),_0x1ef0e5,'request\x20sent');logger[_0x8b24('0x16')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1ef0e5,_0x8b24('0x17'),JSON[_0x8b24('0x18')](_0x34679e));if(_0x34679e[_0x8b24('0x19')]){if(_0x34679e[_0x8b24('0x19')][_0x8b24('0x1a')]===0x1f4){logger['error'](_0x8b24('0x15'),_0x1ef0e5,_0x34679e[_0x8b24('0x19')][_0x8b24('0x1b')]);return _0x519f0b(_0x34679e[_0x8b24('0x19')][_0x8b24('0x1b')]);}logger[_0x8b24('0x19')]('FaxAccount,\x20%s,\x20%s',_0x1ef0e5,_0x34679e[_0x8b24('0x19')]['message']);return _0x2d38ec(_0x34679e['error'][_0x8b24('0x1b')]);}else{logger[_0x8b24('0x14')]('FaxAccount,\x20%s,\x20%s',_0x1ef0e5,_0x8b24('0x17'));_0x2d38ec(_0x34679e['result'][_0x8b24('0x1b')]);}})[_0x8b24('0x1c')](function(_0x2a95f5){logger[_0x8b24('0x19')](_0x8b24('0x15'),_0x1ef0e5,_0x2a95f5);_0x519f0b(_0x2a95f5);});});}exports['GetFaxAccount']=function(_0x3cbf91){var _0x5b532a=this;return new Promise(function(_0x186467,_0x3fa113){return db[_0x8b24('0x1d')][_0x8b24('0x1e')]({'raw':_0x3cbf91[_0x8b24('0x1f')]?_0x3cbf91[_0x8b24('0x1f')][_0x8b24('0x20')]===undefined?!![]:![]:!![],'where':_0x3cbf91[_0x8b24('0x1f')]?_0x3cbf91[_0x8b24('0x1f')][_0x8b24('0x21')]||null:null,'attributes':_0x3cbf91[_0x8b24('0x1f')]?_0x3cbf91[_0x8b24('0x1f')][_0x8b24('0x22')]||null:null,'limit':_0x3cbf91[_0x8b24('0x1f')]?_0x3cbf91[_0x8b24('0x1f')][_0x8b24('0x23')]||null:null,'include':_0x3cbf91[_0x8b24('0x1f')]?_0x3cbf91[_0x8b24('0x1f')][_0x8b24('0x24')]?_[_0x8b24('0x25')](_0x3cbf91['options'][_0x8b24('0x24')],function(_0x7f9299){return{'model':db[_0x7f9299['model']],'as':_0x7f9299['as'],'attributes':_0x7f9299['attributes'],'include':_0x7f9299[_0x8b24('0x24')]?_['map'](_0x7f9299['include'],function(_0x4fc290){return{'model':db[_0x4fc290['model']],'as':_0x4fc290['as'],'attributes':_0x4fc290[_0x8b24('0x22')],'include':_0x4fc290[_0x8b24('0x24')]?_[_0x8b24('0x25')](_0x4fc290['include'],function(_0x2ecee5){return{'model':db[_0x2ecee5[_0x8b24('0x26')]],'as':_0x2ecee5['as'],'attributes':_0x2ecee5[_0x8b24('0x22')]};}):[]};}):[]};}):[]:[]})[_0x8b24('0x13')](function(_0x5a3414){logger[_0x8b24('0x14')](_0x8b24('0x27'),_0x3cbf91);logger[_0x8b24('0x16')](_0x8b24('0x27'),_0x3cbf91,JSON[_0x8b24('0x18')](_0x5a3414));_0x186467(_0x5a3414);})['catch'](function(_0x434395){logger[_0x8b24('0x19')](_0x8b24('0x27'),_0x434395[_0x8b24('0x1b')],_0x3cbf91);_0x3fa113(_0x5b532a[_0x8b24('0x19')](0x1f4,_0x434395[_0x8b24('0x1b')]));});});};exports['NotifyFaxAccount']=function(_0x1bbd6a,_0x3c31ac,_0x411a88){var _0x3db9ff=this;return new Promise(function(_0x4e09fc,_0x10412f){var _0x2bdafb={'body':_0x1bbd6a[_0x8b24('0x28')],'channel':_0x8b24('0x29')};var _0x40b16f=[];var _0x4c1740=[];var _0x17e179={};return db[_0x8b24('0x2a')][_0x8b24('0x2b')]()['then'](function(_0x3b39b0){if(!_0x3b39b0){throw new db[(_0x8b24('0x2c'))][(_0x8b24('0x2d'))](_0x8b24('0x2e'));}_0x40b16f=_['difference'](_[_0x8b24('0x2f')](_0x3b39b0),[_0x8b24('0x30'),_0x8b24('0x31')]);_0x4c1740=_[_0x8b24('0x32')](_['keys'](_0x3b39b0),[_0x8b24('0x30'),'updatedAt',_0x8b24('0x33'),_0x8b24('0x34')]);if(_0x1bbd6a[_0x8b24('0x28')]['id']){delete _0x1bbd6a['body']['id'];}if(_['isNil'](_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x35')])){throw new db[(_0x8b24('0x2c'))][(_0x8b24('0x2d'))](_0x8b24('0x36'));}if(_[_0x8b24('0x37')](_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x28')])||_0x1bbd6a['body']['body']===''){throw new db[(_0x8b24('0x2c'))]['ValidationError'](_0x8b24('0x38'));}if(_[_0x8b24('0x37')](_0x1bbd6a['body'][_0x8b24('0x39')])){throw new db['Sequelize'][(_0x8b24('0x2d'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c1740);}if(!_[_0x8b24('0x3a')](_0x4c1740,_0x1bbd6a[_0x8b24('0x28')]['mapKey'])){throw new db['Sequelize'][(_0x8b24('0x2d'))](_0x8b24('0x3b')+_0x4c1740);}_0x17e179[_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x39')]]=_0x1bbd6a[_0x8b24('0x28')]['from'];})[_0x8b24('0x13')](function(){return db['FaxAccount'][_0x8b24('0x3c')]({'where':{'id':_0x1bbd6a[_0x8b24('0x3d')]['id']},'include':[{'model':db[_0x8b24('0x3e')],'as':'List','include':[{'model':db['CmContact'],'as':_0x8b24('0x3f'),'where':_0x17e179,'limit':0x1,'order':[[_0x8b24('0x31'),_0x8b24('0x40')]]}]},{'model':db['FaxApplication'],'as':_0x8b24('0x41')}]});})[_0x8b24('0x13')](function(_0x3c2424){if(_0x3c2424&&_0x3c2424['List']){var _0x12a985=_0x3c2424[_0x8b24('0x42')]({'plain':!![]});_0x2bdafb[_0x8b24('0x3d')]=_0x12a985;_0x2bdafb[_0x8b24('0x43')]=_0x12a985['Applications'];_0x2bdafb['list']=_0x12a985[_0x8b24('0x44')];_0x2bdafb['applications']=_['orderBy'](_0x2bdafb[_0x8b24('0x43')],[_0x8b24('0x45')],[_0x8b24('0x46')]);if(_0x2bdafb[_0x8b24('0x3d')][_0x8b24('0x41')]){delete _0x2bdafb[_0x8b24('0x3d')][_0x8b24('0x41')];}if(_0x2bdafb['account']['List']&&_0x2bdafb['account'][_0x8b24('0x44')][_0x8b24('0x3f')][_0x8b24('0x47')]){return _0x2bdafb[_0x8b24('0x3d')][_0x8b24('0x44')][_0x8b24('0x3f')][0x0];}var _0xe243df=_['defaults'](_0x1bbd6a[_0x8b24('0x28')],{'firstName':_0x1bbd6a['body']['from'],'ListId':_0x12a985[_0x8b24('0x34')]});_0xe243df[_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x39')]]=_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x35')];return db[_0x8b24('0x2a')][_0x8b24('0x48')](_0xe243df,{'fields':_0x40b16f,'raw':!![]});}})['then'](function(_0x35d010){_0x2bdafb[_0x8b24('0x49')]=_0x35d010;if(_0x35d010){var _0xe8245e={'ContactId':_0x35d010['id'],'FaxAccountId':_0x1bbd6a[_0x8b24('0x3d')]['id'],'fax':_0x35d010[_0x8b24('0x29')]};return db[_0x8b24('0x4a')][_0x8b24('0x3c')]({'where':{'ContactId':_0x35d010['id'],'closed':![],'FaxAccountId':_0x1bbd6a['account']['id']}})[_0x8b24('0x13')](function(_0x271024){if(_0x271024){return[_0x271024,![]];}return db[_0x8b24('0x4a')]['create'](_0xe8245e)['then'](function(_0x16bbda){return[_0x16bbda,!![]];});});}else{throw new Error(_0x8b24('0x4b'));}})['spread'](function(_0x3a0d12,_0xea9ee2){var _0x3adc4a=_0x3a0d12[_0x8b24('0x42')]({'plain':!![]});if(_0xea9ee2){if(_0x2bdafb[_0x8b24('0x3d')][_0x8b24('0x4c')]){_0x2bdafb[_0x8b24('0x43')][_0x8b24('0x4d')]({'id':0x0,'priority':_0x2bdafb[_0x8b24('0x43')]['length']+0x1,'app':'close','appdata':'unmanaged','interval':'*,*,*,*'});}_0x3adc4a[_0x8b24('0x4e')]=!![];}else{_0x3adc4a['created']=![];}_0x2bdafb[_0x8b24('0x4f')]=_0x3adc4a;return db[_0x8b24('0x50')][_0x8b24('0x48')]({'body':_0x1bbd6a['body'][_0x8b24('0x28')],'FaxAccountId':_0x1bbd6a[_0x8b24('0x3d')]['id'],'FaxInteractionId':_0x3a0d12['id'],'direction':'in','ContactId':_0x3a0d12[_0x8b24('0x51')],'AttachmentId':_0x1bbd6a[_0x8b24('0x28')][_0x8b24('0x52')]});})[_0x8b24('0x13')](function(_0x522dae){_0x2bdafb[_0x8b24('0x1b')]=_0x522dae;if(_0x2bdafb[_0x8b24('0x4f')]['UserId']){return db['User'][_0x8b24('0x3c')]({'attributes':['id','name'],'where':{'id':_0x2bdafb['interaction']['UserId']}})['then'](function(_0x12d8bc){if(_0x12d8bc){_0x2bdafb['applications'][_0x8b24('0x53')]({'id':0x0,'priority':0x0,'app':_0x8b24('0x54'),'appdata':_0x12d8bc[_0x8b24('0x55')]+','+(_0x2bdafb[_0x8b24('0x3d')]['waitForTheAssignedAgent']||0xa),'interval':_0x8b24('0x56')});}return respondWithRpcPromise('Start',_0x8b24('0x57'),_0x2bdafb);});}return respondWithRpcPromise(_0x8b24('0x58'),_0x8b24('0x57'),_0x2bdafb);})['then'](function(_0x4efa3a){_0x4e09fc(_0x4efa3a);})[_0x8b24('0x1c')](function(_0x685fc1){_0x10412f(_0x3db9ff['error'](0x1f4,_0x685fc1[_0x8b24('0x1b')]));});});}; \ No newline at end of file +var _0x7f3f=['FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','include','map','model','NotifyFaxAccount','body','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','keys','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','account','CmList','DESC','FaxApplication','Applications','List','get','list','orderBy','applications','priority','Contacts','length','contact','fax','FaxInteraction','find','create','spread','autoclose','push','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','UserId','User','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','then','info','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3e8e66,_0x2c4cc6){var _0x5b9ead=function(_0x2c859a){while(--_0x2c859a){_0x3e8e66['push'](_0x3e8e66['shift']());}};_0x5b9ead(++_0x2c4cc6);}(_0x7f3f,0x9b));var _0xf7f3=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0x7f3f[_0x587dd0];return _0x56f153;};'use strict';var _=require(_0xf7f3('0x0'));var util=require(_0xf7f3('0x1'));var moment=require(_0xf7f3('0x2'));var BPromise=require(_0xf7f3('0x3'));var rs=require(_0xf7f3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf7f3('0x5'))['db'];var utils=require(_0xf7f3('0x6'));var logger=require(_0xf7f3('0x7'))(_0xf7f3('0x8'));var config=require(_0xf7f3('0x9'));var jayson=require(_0xf7f3('0xa'));var client=jayson[_0xf7f3('0xb')]['http']({'port':0x232c});config[_0xf7f3('0xc')]=_[_0xf7f3('0xd')](config[_0xf7f3('0xc')],{'host':_0xf7f3('0xe'),'port':0x18eb});var socket=require(_0xf7f3('0xf'))(new Redis(config[_0xf7f3('0xc')]));require(_0xf7f3('0x10'))[_0xf7f3('0x11')](socket);function respondWithRpcPromise(_0x4909d5,_0x39b856,_0x1c3f14){return new BPromise(function(_0x2fda63,_0x17cf4a){return client['request'](_0x4909d5,_0x1c3f14)[_0xf7f3('0x12')](function(_0x546dbf){logger[_0xf7f3('0x13')]('FaxAccount,\x20%s,\x20%s',_0x39b856,_0xf7f3('0x14'));logger['debug'](_0xf7f3('0x15'),_0x39b856,_0xf7f3('0x14'),JSON[_0xf7f3('0x16')](_0x546dbf));if(_0x546dbf[_0xf7f3('0x17')]){if(_0x546dbf[_0xf7f3('0x17')][_0xf7f3('0x18')]===0x1f4){logger[_0xf7f3('0x17')](_0xf7f3('0x19'),_0x39b856,_0x546dbf['error'][_0xf7f3('0x1a')]);return _0x17cf4a(_0x546dbf[_0xf7f3('0x17')][_0xf7f3('0x1a')]);}logger[_0xf7f3('0x17')]('FaxAccount,\x20%s,\x20%s',_0x39b856,_0x546dbf['error'][_0xf7f3('0x1a')]);return _0x2fda63(_0x546dbf['error']['message']);}else{logger[_0xf7f3('0x13')]('FaxAccount,\x20%s,\x20%s',_0x39b856,_0xf7f3('0x14'));_0x2fda63(_0x546dbf[_0xf7f3('0x1b')][_0xf7f3('0x1a')]);}})[_0xf7f3('0x1c')](function(_0x9e9525){logger[_0xf7f3('0x17')](_0xf7f3('0x19'),_0x39b856,_0x9e9525);_0x17cf4a(_0x9e9525);});});}exports[_0xf7f3('0x1d')]=function(_0x55e0a9){var _0x3e4ab5=this;return new Promise(function(_0x42201d,_0x4b86cb){return db[_0xf7f3('0x1e')][_0xf7f3('0x1f')]({'raw':_0x55e0a9[_0xf7f3('0x20')]?_0x55e0a9[_0xf7f3('0x20')][_0xf7f3('0x21')]===undefined?!![]:![]:!![],'where':_0x55e0a9[_0xf7f3('0x20')]?_0x55e0a9['options']['where']||null:null,'attributes':_0x55e0a9[_0xf7f3('0x20')]?_0x55e0a9[_0xf7f3('0x20')][_0xf7f3('0x22')]||null:null,'limit':_0x55e0a9[_0xf7f3('0x20')]?_0x55e0a9['options']['limit']||null:null,'include':_0x55e0a9[_0xf7f3('0x20')]?_0x55e0a9['options'][_0xf7f3('0x23')]?_[_0xf7f3('0x24')](_0x55e0a9[_0xf7f3('0x20')][_0xf7f3('0x23')],function(_0xfcbd4e){return{'model':db[_0xfcbd4e[_0xf7f3('0x25')]],'as':_0xfcbd4e['as'],'attributes':_0xfcbd4e[_0xf7f3('0x22')],'include':_0xfcbd4e[_0xf7f3('0x23')]?_['map'](_0xfcbd4e[_0xf7f3('0x23')],function(_0x86ef58){return{'model':db[_0x86ef58[_0xf7f3('0x25')]],'as':_0x86ef58['as'],'attributes':_0x86ef58[_0xf7f3('0x22')],'include':_0x86ef58[_0xf7f3('0x23')]?_[_0xf7f3('0x24')](_0x86ef58[_0xf7f3('0x23')],function(_0x2bffaa){return{'model':db[_0x2bffaa[_0xf7f3('0x25')]],'as':_0x2bffaa['as'],'attributes':_0x2bffaa['attributes']};}):[]};}):[]};}):[]:[]})[_0xf7f3('0x12')](function(_0x5a3d5d){logger['info'](_0xf7f3('0x1d'),_0x55e0a9);logger['debug'](_0xf7f3('0x1d'),_0x55e0a9,JSON[_0xf7f3('0x16')](_0x5a3d5d));_0x42201d(_0x5a3d5d);})['catch'](function(_0x2af334){logger[_0xf7f3('0x17')](_0xf7f3('0x1d'),_0x2af334[_0xf7f3('0x1a')],_0x55e0a9);_0x4b86cb(_0x3e4ab5[_0xf7f3('0x17')](0x1f4,_0x2af334[_0xf7f3('0x1a')]));});});};exports[_0xf7f3('0x26')]=function(_0x2fceea,_0x364e7d,_0x191c67){var _0x302202=this;return new Promise(function(_0xf86b5b,_0x23a65e){var _0x3f0568={'body':_0x2fceea[_0xf7f3('0x27')],'channel':'fax'};var _0x1842cc=[];var _0x38c31d=[];var _0x5984f7={};return db[_0xf7f3('0x28')][_0xf7f3('0x29')]()[_0xf7f3('0x12')](function(_0x53106c){if(!_0x53106c){throw new db[(_0xf7f3('0x2a'))][(_0xf7f3('0x2b'))](_0xf7f3('0x2c'));}_0x1842cc=_[_0xf7f3('0x2d')](_['keys'](_0x53106c),[_0xf7f3('0x2e'),_0xf7f3('0x2f')]);_0x38c31d=_[_0xf7f3('0x2d')](_[_0xf7f3('0x30')](_0x53106c),['createdAt',_0xf7f3('0x2f'),_0xf7f3('0x31'),_0xf7f3('0x32')]);if(_0x2fceea[_0xf7f3('0x27')]['id']){delete _0x2fceea[_0xf7f3('0x27')]['id'];}if(_[_0xf7f3('0x33')](_0x2fceea[_0xf7f3('0x27')][_0xf7f3('0x34')])){throw new db[(_0xf7f3('0x2a'))][(_0xf7f3('0x2b'))](_0xf7f3('0x35'));}if(_[_0xf7f3('0x33')](_0x2fceea[_0xf7f3('0x27')]['body'])||_0x2fceea[_0xf7f3('0x27')][_0xf7f3('0x27')]===''){throw new db['Sequelize'][(_0xf7f3('0x2b'))](_0xf7f3('0x36'));}if(_[_0xf7f3('0x33')](_0x2fceea[_0xf7f3('0x27')]['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x38c31d);}if(!_['includes'](_0x38c31d,_0x2fceea['body']['mapKey'])){throw new db[(_0xf7f3('0x2a'))]['ValidationError'](_0xf7f3('0x37')+_0x38c31d);}_0x5984f7[_0x2fceea[_0xf7f3('0x27')][_0xf7f3('0x38')]]=_0x2fceea[_0xf7f3('0x27')][_0xf7f3('0x34')];})[_0xf7f3('0x12')](function(){return db[_0xf7f3('0x1e')]['find']({'where':{'id':_0x2fceea[_0xf7f3('0x39')]['id']},'include':[{'model':db[_0xf7f3('0x3a')],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x5984f7,'limit':0x1,'order':[[_0xf7f3('0x2f'),_0xf7f3('0x3b')]]}]},{'model':db[_0xf7f3('0x3c')],'as':_0xf7f3('0x3d')}]});})[_0xf7f3('0x12')](function(_0x57a2c2){if(_0x57a2c2&&_0x57a2c2[_0xf7f3('0x3e')]){var _0x35ac70=_0x57a2c2[_0xf7f3('0x3f')]({'plain':!![]});_0x3f0568[_0xf7f3('0x39')]=_0x35ac70;_0x3f0568['applications']=_0x35ac70['Applications'];_0x3f0568[_0xf7f3('0x40')]=_0x35ac70['List'];_0x3f0568['applications']=_[_0xf7f3('0x41')](_0x3f0568[_0xf7f3('0x42')],[_0xf7f3('0x43')],['asc']);if(_0x3f0568[_0xf7f3('0x39')][_0xf7f3('0x3d')]){delete _0x3f0568[_0xf7f3('0x39')][_0xf7f3('0x3d')];}if(_0x3f0568['account'][_0xf7f3('0x3e')]&&_0x3f0568[_0xf7f3('0x39')][_0xf7f3('0x3e')][_0xf7f3('0x44')][_0xf7f3('0x45')]){return _0x3f0568['account'][_0xf7f3('0x3e')][_0xf7f3('0x44')][0x0];}var _0x5e9bbf=_[_0xf7f3('0xd')](_0x2fceea[_0xf7f3('0x27')],{'firstName':_0x2fceea[_0xf7f3('0x27')][_0xf7f3('0x34')],'ListId':_0x35ac70[_0xf7f3('0x32')]});_0x5e9bbf[_0x2fceea['body']['mapKey']]=_0x2fceea['body'][_0xf7f3('0x34')];return db[_0xf7f3('0x28')]['create'](_0x5e9bbf,{'fields':_0x1842cc,'raw':!![]});}})[_0xf7f3('0x12')](function(_0x439af2){_0x3f0568[_0xf7f3('0x46')]=_0x439af2;if(_0x439af2){var _0x4c00d3={'ContactId':_0x439af2['id'],'FaxAccountId':_0x2fceea[_0xf7f3('0x39')]['id'],'fax':_0x439af2[_0xf7f3('0x47')]};return db[_0xf7f3('0x48')][_0xf7f3('0x49')]({'where':{'ContactId':_0x439af2['id'],'closed':![],'FaxAccountId':_0x2fceea[_0xf7f3('0x39')]['id']}})[_0xf7f3('0x12')](function(_0x36171a){if(_0x36171a){return[_0x36171a,![]];}return db[_0xf7f3('0x48')][_0xf7f3('0x4a')](_0x4c00d3)[_0xf7f3('0x12')](function(_0x479386){return[_0x479386,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf7f3('0x4b')](function(_0x194178,_0x41c17e){var _0x36b239=_0x194178[_0xf7f3('0x3f')]({'plain':!![]});if(_0x41c17e){if(_0x3f0568[_0xf7f3('0x39')][_0xf7f3('0x4c')]){_0x3f0568[_0xf7f3('0x42')][_0xf7f3('0x4d')]({'id':0x0,'priority':_0x3f0568['applications'][_0xf7f3('0x45')]+0x1,'app':'close','appdata':_0xf7f3('0x4e'),'interval':_0xf7f3('0x4f')});}_0x36b239['created']=!![];}else{_0x36b239[_0xf7f3('0x50')]=![];}_0x3f0568[_0xf7f3('0x51')]=_0x36b239;return db[_0xf7f3('0x52')]['create']({'body':_0x2fceea['body'][_0xf7f3('0x27')],'FaxAccountId':_0x2fceea[_0xf7f3('0x39')]['id'],'FaxInteractionId':_0x194178['id'],'direction':'in','ContactId':_0x194178[_0xf7f3('0x53')],'AttachmentId':_0x2fceea[_0xf7f3('0x27')]['AttachmentId']});})[_0xf7f3('0x12')](function(_0x4b2da2){_0x3f0568['message']=_0x4b2da2;if(_0x3f0568[_0xf7f3('0x51')][_0xf7f3('0x54')]){return db[_0xf7f3('0x55')][_0xf7f3('0x49')]({'attributes':['id',_0xf7f3('0x56')],'where':{'id':_0x3f0568['interaction'][_0xf7f3('0x54')]}})[_0xf7f3('0x12')](function(_0x19435a){if(_0x19435a){_0x3f0568[_0xf7f3('0x42')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x19435a[_0xf7f3('0x56')]+','+(_0x3f0568[_0xf7f3('0x39')][_0xf7f3('0x57')]||0xa),'interval':_0xf7f3('0x4f')});}return respondWithRpcPromise(_0xf7f3('0x58'),_0xf7f3('0x59'),_0x3f0568);});}return respondWithRpcPromise('Start',_0xf7f3('0x59'),_0x3f0568);})['then'](function(_0x53637b){_0xf86b5b(_0x53637b);})['catch'](function(_0x194c87){_0x23a65e(_0x302202['error'](0x1f4,_0x194c87[_0xf7f3('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index cca328e..e5eeaee 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 _0x10c2=['update','emit','removeListener','length','faxAccount:','./faxAccount.events','save','remove'];(function(_0x57104a,_0x48782a){var _0x10b611=function(_0x496329){while(--_0x496329){_0x57104a['push'](_0x57104a['shift']());}};_0x10b611(++_0x48782a);}(_0x10c2,0x125));var _0x210c=function(_0x4019c9,_0x381f4b){_0x4019c9=_0x4019c9-0x0;var _0x1dfe44=_0x10c2[_0x4019c9];return _0x1dfe44;};'use strict';var FaxAccountEvents=require(_0x210c('0x0'));var events=[_0x210c('0x1'),_0x210c('0x2'),_0x210c('0x3')];function createListener(_0x5eed48,_0x3caced){return function(_0x4f74aa){_0x3caced[_0x210c('0x4')](_0x5eed48,_0x4f74aa);};}function removeListener(_0x4df593,_0x40b7df){return function(){FaxAccountEvents[_0x210c('0x5')](_0x4df593,_0x40b7df);};}exports['register']=function(_0x56f1f3){for(var _0x325db2=0x0,_0x188dd=events[_0x210c('0x6')];_0x325db2<_0x188dd;_0x325db2++){var _0x5660b5=events[_0x325db2];var _0x4757a4=createListener(_0x210c('0x7')+_0x5660b5,_0x56f1f3);FaxAccountEvents['on'](_0x5660b5,_0x4757a4);}}; \ No newline at end of file +var _0x59bc=['emit','removeListener','register','length','faxAccount:','./faxAccount.events'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x59bc,0x125));var _0xc59b=function(_0x596c63,_0xcd98f5){_0x596c63=_0x596c63-0x0;var _0x362fb2=_0x59bc[_0x596c63];return _0x362fb2;};'use strict';var FaxAccountEvents=require(_0xc59b('0x0'));var events=['save','remove','update'];function createListener(_0xd20d98,_0x32be3d){return function(_0x41dc12){_0x32be3d[_0xc59b('0x1')](_0xd20d98,_0x41dc12);};}function removeListener(_0x16dba1,_0x3f7eb1){return function(){FaxAccountEvents[_0xc59b('0x2')](_0x16dba1,_0x3f7eb1);};}exports[_0xc59b('0x3')]=function(_0x380537){for(var _0x4f807b=0x0,_0x253b77=events[_0xc59b('0x4')];_0x4f807b<_0x253b77;_0x4f807b++){var _0x251cfa=events[_0x4f807b];var _0x3031d5=createListener(_0xc59b('0x5')+_0x251cfa,_0x380537);FaxAccountEvents['on'](_0x251cfa,_0x3031d5);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index a6de0d2..9e01665 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(_0x133b60,_0x5233ee){var _0x15de19=function(_0x33b81f){while(--_0x33b81f){_0x133b60['push'](_0x133b60['shift']());}};_0x15de19(++_0x5233ee);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c3c0b,_0x4ee35e){_0x5c3c0b=_0x5c3c0b-0x0;var _0x52ecd2=_0xa9e0[_0x5c3c0b];return _0x52ecd2;};'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(_0x6b735b,_0x40f946){var _0x8be084=function(_0x4e1872){while(--_0x4e1872){_0x6b735b['push'](_0x6b735b['shift']());}};_0x8be084(++_0x40f946);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'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 742872e..f3035c5 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 _0x7441=['STRING','*,*,*,*','sequelize','exports','INTEGER','noop','TEXT'];(function(_0x221246,_0x168ceb){var _0x13e1ea=function(_0x17ee22){while(--_0x17ee22){_0x221246['push'](_0x221246['shift']());}};_0x13e1ea(++_0x168ceb);}(_0x7441,0x1bb));var _0x1744=function(_0x2548ea,_0x488331){_0x2548ea=_0x2548ea-0x0;var _0x2e0e97=_0x7441[_0x2548ea];return _0x2e0e97;};'use strict';var Sequelize=require(_0x1744('0x0'));module[_0x1744('0x1')]={'priority':{'type':Sequelize[_0x1744('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1744('0x3')},'appdata':{'type':Sequelize[_0x1744('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x1744('0x5')],'defaultValue':_0x1744('0x6')}}; \ No newline at end of file +var _0xfd01=['noop','sequelize','INTEGER','STRING'];(function(_0x34fd1e,_0x19c2e7){var _0x5b8e5a=function(_0x4f38fa){while(--_0x4f38fa){_0x34fd1e['push'](_0x34fd1e['shift']());}};_0x5b8e5a(++_0x19c2e7);}(_0xfd01,0x18d));var _0x1fd0=function(_0xa1cbfe,_0x246ad4){_0xa1cbfe=_0xa1cbfe-0x0;var _0x3b7a84=_0xfd01[_0xa1cbfe];return _0x3b7a84;};'use strict';var Sequelize=require(_0x1fd0('0x0'));module['exports']={'priority':{'type':Sequelize[_0x1fd0('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x1fd0('0x2')],'allowNull':![],'defaultValue':_0x1fd0('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x1fd0('0x2')]},'interval':{'type':Sequelize[_0x1fd0('0x2')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e9664cc..9de1568 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 _0x340a=['query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','keys','rawAttributes','include','find','create','body','catch','params','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','stack','send','index','map','FaxApplication','fieldName','type','model','name'];(function(_0x46e9f0,_0x47126e){var _0x1399f3=function(_0x13c10f){while(--_0x13c10f){_0x46e9f0['push'](_0x46e9f0['shift']());}};_0x1399f3(++_0x47126e);}(_0x340a,0x1e9));var _0xa340=function(_0x89ad81,_0x43d7b0){_0x89ad81=_0x89ad81-0x0;var _0x447d53=_0x340a[_0x89ad81];return _0x447d53;};'use strict';var emlformat=require(_0xa340('0x0'));var rimraf=require(_0xa340('0x1'));var zipdir=require(_0xa340('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa340('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa340('0x4'));var util=require(_0xa340('0x5'));var path=require(_0xa340('0x6'));var sox=require(_0xa340('0x7'));var csv=require(_0xa340('0x8'));var ejs=require(_0xa340('0x9'));var fs=require('fs');var fs_extra=require(_0xa340('0xa'));var _=require(_0xa340('0xb'));var squel=require(_0xa340('0xc'));var crypto=require(_0xa340('0xd'));var jsforce=require(_0xa340('0xe'));var deskjs=require(_0xa340('0xf'));var toCsv=require(_0xa340('0x8'));var querystring=require(_0xa340('0x10'));var Papa=require(_0xa340('0x11'));var Redis=require(_0xa340('0x12'));var authService=require(_0xa340('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa340('0x14'));var hardwareService=require(_0xa340('0x15'));var logger=require(_0xa340('0x16'))(_0xa340('0x17'));var utils=require(_0xa340('0x18'));var config=require(_0xa340('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa340('0x1a'))['db'];function respondWithStatusCode(_0x4e7583,_0x5ad4f7){_0x5ad4f7=_0x5ad4f7||0xcc;return function(_0x352d1e){if(_0x352d1e){return _0x4e7583[_0xa340('0x1b')](_0x5ad4f7);}return _0x4e7583[_0xa340('0x1c')](_0x5ad4f7)[_0xa340('0x1d')]();};}function respondWithResult(_0x10a621,_0x32a34b){_0x32a34b=_0x32a34b||0xc8;return function(_0x2bc485){if(_0x2bc485){return _0x10a621['status'](_0x32a34b)['json'](_0x2bc485);}};}function respondWithFilteredResult(_0x2494c7,_0x1a6f4f){return function(_0x20139a){if(_0x20139a){var _0x1ba711=typeof _0x1a6f4f[_0xa340('0x1e')]===_0xa340('0x1f')&&typeof _0x1a6f4f[_0xa340('0x20')]===_0xa340('0x1f');var _0x51596c=_0x20139a[_0xa340('0x21')];var _0x4f0f02=_0x1ba711?0x0:_0x1a6f4f[_0xa340('0x1e')];var _0x1f325a=_0x1ba711?_0x20139a[_0xa340('0x21')]:_0x1a6f4f[_0xa340('0x1e')]+_0x1a6f4f[_0xa340('0x20')];var _0x2d19b3;if(_0x1f325a>=_0x51596c){_0x1f325a=_0x51596c;_0x2d19b3=0xc8;}else{_0x2d19b3=0xce;}_0x2494c7[_0xa340('0x1c')](_0x2d19b3);return _0x2494c7[_0xa340('0x22')](_0xa340('0x23'),_0x4f0f02+'-'+_0x1f325a+'/'+_0x51596c)[_0xa340('0x24')](_0x20139a);}return null;};}function patchUpdates(_0x236511){return function(_0x578e74){try{jsonpatch[_0xa340('0x25')](_0x578e74,_0x236511,!![]);}catch(_0x3ec2b2){return BPromise['reject'](_0x3ec2b2);}return _0x578e74[_0xa340('0x26')]();};}function saveUpdates(_0x5be1f5,_0x50b834){return function(_0x3ba04c){if(_0x3ba04c){return _0x3ba04c[_0xa340('0x27')](_0x5be1f5)['then'](function(_0x23a9ae){return _0x23a9ae;});}return null;};}function removeEntity(_0x47985d,_0xa261d1){return function(_0x3a2382){if(_0x3a2382){return _0x3a2382['destroy']()[_0xa340('0x28')](function(){_0x47985d[_0xa340('0x1c')](0xcc)[_0xa340('0x1d')]();});}};}function handleEntityNotFound(_0x148af0,_0x1566a1){return function(_0x4ccfe5){if(!_0x4ccfe5){_0x148af0[_0xa340('0x1b')](0x194);}return _0x4ccfe5;};}function handleError(_0x45a029,_0x37be35){_0x37be35=_0x37be35||0x1f4;return function(_0x2760b5){logger['error'](_0x2760b5[_0xa340('0x29')]);if(_0x2760b5['name']){delete _0x2760b5['name'];}_0x45a029[_0xa340('0x1c')](_0x37be35)[_0xa340('0x2a')](_0x2760b5);};}exports[_0xa340('0x2b')]=function(_0xf17a63,_0x5d17b8){var _0x25c519={},_0x3b99d7={},_0x29559f={'count':0x0,'rows':[]};var _0x3c1632=_[_0xa340('0x2c')](db[_0xa340('0x2d')]['rawAttributes'],function(_0x47244f){return{'name':_0x47244f[_0xa340('0x2e')],'type':_0x47244f[_0xa340('0x2f')]['key']};});_0x3b99d7[_0xa340('0x30')]=_[_0xa340('0x2c')](_0x3c1632,_0xa340('0x31'));_0x3b99d7[_0xa340('0x32')]=_['keys'](_0xf17a63[_0xa340('0x32')]);_0x3b99d7['filters']=_[_0xa340('0x33')](_0x3b99d7[_0xa340('0x30')],_0x3b99d7[_0xa340('0x32')]);_0x25c519[_0xa340('0x34')]=_[_0xa340('0x33')](_0x3b99d7[_0xa340('0x30')],qs[_0xa340('0x35')](_0xf17a63[_0xa340('0x32')][_0xa340('0x35')]));_0x25c519[_0xa340('0x34')]=_0x25c519[_0xa340('0x34')][_0xa340('0x36')]?_0x25c519[_0xa340('0x34')]:_0x3b99d7[_0xa340('0x30')];if(!_0xf17a63['query'][_0xa340('0x37')](_0xa340('0x38'))){_0x25c519[_0xa340('0x20')]=qs[_0xa340('0x20')](_0xf17a63[_0xa340('0x32')]['limit']);_0x25c519['offset']=qs[_0xa340('0x1e')](_0xf17a63[_0xa340('0x32')][_0xa340('0x1e')]);}_0x25c519[_0xa340('0x39')]=qs[_0xa340('0x3a')](_0xf17a63[_0xa340('0x32')]['sort']);_0x25c519[_0xa340('0x3b')]=qs[_0xa340('0x3c')](_['pick'](_0xf17a63[_0xa340('0x32')],_0x3b99d7[_0xa340('0x3c')]),_0x3c1632);if(_0xf17a63[_0xa340('0x32')]['filter']){_0x25c519[_0xa340('0x3b')]=_[_0xa340('0x3d')](_0x25c519[_0xa340('0x3b')],{'$or':_['map'](_0x3c1632,function(_0x59e8c1){if(_0x59e8c1[_0xa340('0x2f')]!==_0xa340('0x3e')){var _0x88f2b7={};_0x88f2b7[_0x59e8c1[_0xa340('0x31')]]={'$like':'%'+_0xf17a63[_0xa340('0x32')][_0xa340('0x3f')]+'%'};return _0x88f2b7;}})});}_0x25c519=_['merge']({},_0x25c519,_0xf17a63[_0xa340('0x40')]);var _0x5da713={'where':_0x25c519[_0xa340('0x3b')]};return db[_0xa340('0x2d')][_0xa340('0x21')](_0x5da713)[_0xa340('0x28')](function(_0x30edcb){_0x29559f[_0xa340('0x21')]=_0x30edcb;if(_0xf17a63['query'][_0xa340('0x41')]){_0x25c519['include']=[{'all':!![]}];}return db[_0xa340('0x2d')][_0xa340('0x42')](_0x25c519);})[_0xa340('0x28')](function(_0x17c55d){_0x29559f[_0xa340('0x43')]=_0x17c55d;return _0x29559f;})[_0xa340('0x28')](respondWithFilteredResult(_0x5d17b8,_0x25c519))['catch'](handleError(_0x5d17b8,null));};exports[_0xa340('0x44')]=function(_0x2ec1a3,_0x3389bf){var _0x58f858={'raw':!![],'where':{'id':_0x2ec1a3['params']['id']}},_0xdca185={};_0xdca185['model']=_[_0xa340('0x45')](db[_0xa340('0x2d')][_0xa340('0x46')]);_0xdca185[_0xa340('0x32')]=_[_0xa340('0x45')](_0x2ec1a3[_0xa340('0x32')]);_0xdca185['filters']=_['intersection'](_0xdca185[_0xa340('0x30')],_0xdca185[_0xa340('0x32')]);_0x58f858['attributes']=_['intersection'](_0xdca185['model'],qs[_0xa340('0x35')](_0x2ec1a3[_0xa340('0x32')]['fields']));_0x58f858[_0xa340('0x34')]=_0x58f858['attributes']['length']?_0x58f858['attributes']:_0xdca185[_0xa340('0x30')];if(_0x2ec1a3[_0xa340('0x32')][_0xa340('0x41')]){_0x58f858[_0xa340('0x47')]=[{'all':!![]}];}_0x58f858=_['merge']({},_0x58f858,_0x2ec1a3[_0xa340('0x40')]);return db[_0xa340('0x2d')][_0xa340('0x48')](_0x58f858)[_0xa340('0x28')](handleEntityNotFound(_0x3389bf,null))[_0xa340('0x28')](respondWithResult(_0x3389bf,null))['catch'](handleError(_0x3389bf,null));};exports['create']=function(_0xf8ce94,_0x4b28d7){return db['FaxApplication'][_0xa340('0x49')](_0xf8ce94[_0xa340('0x4a')],{})[_0xa340('0x28')](respondWithResult(_0x4b28d7,0xc9))[_0xa340('0x4b')](handleError(_0x4b28d7,null));};exports[_0xa340('0x27')]=function(_0x339869,_0x1cfb32){if(_0x339869['body']['id']){delete _0x339869['body']['id'];}return db['FaxApplication'][_0xa340('0x48')]({'where':{'id':_0x339869[_0xa340('0x4c')]['id']}})[_0xa340('0x28')](handleEntityNotFound(_0x1cfb32,null))[_0xa340('0x28')](saveUpdates(_0x339869[_0xa340('0x4a')],null))[_0xa340('0x28')](respondWithResult(_0x1cfb32,null))['catch'](handleError(_0x1cfb32,null));};exports['destroy']=function(_0x2718bd,_0x41686b){return db['FaxApplication'][_0xa340('0x48')]({'where':{'id':_0x2718bd[_0xa340('0x4c')]['id']}})[_0xa340('0x28')](handleEntityNotFound(_0x41686b,null))[_0xa340('0x28')](removeEntity(_0x41686b,null))[_0xa340('0x4b')](handleError(_0x41686b,null));}; \ No newline at end of file +var _0x5e7d=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','then','destroy','end','stack','name','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','FaxApplication','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x7c0c2,_0x3512e9){var _0x26d902=function(_0x4d8cc5){while(--_0x4d8cc5){_0x7c0c2['push'](_0x7c0c2['shift']());}};_0x26d902(++_0x3512e9);}(_0x5e7d,0x1be));var _0xd5e7=function(_0xdda617,_0x54ca1b){_0xdda617=_0xdda617-0x0;var _0x3b8bd9=_0x5e7d[_0xdda617];return _0x3b8bd9;};'use strict';var emlformat=require(_0xd5e7('0x0'));var rimraf=require(_0xd5e7('0x1'));var zipdir=require(_0xd5e7('0x2'));var jsonpatch=require(_0xd5e7('0x3'));var rp=require(_0xd5e7('0x4'));var moment=require(_0xd5e7('0x5'));var BPromise=require(_0xd5e7('0x6'));var Mustache=require(_0xd5e7('0x7'));var util=require('util');var path=require(_0xd5e7('0x8'));var sox=require(_0xd5e7('0x9'));var csv=require(_0xd5e7('0xa'));var ejs=require(_0xd5e7('0xb'));var fs=require('fs');var fs_extra=require(_0xd5e7('0xc'));var _=require(_0xd5e7('0xd'));var squel=require('squel');var crypto=require(_0xd5e7('0xe'));var jsforce=require(_0xd5e7('0xf'));var deskjs=require(_0xd5e7('0x10'));var toCsv=require(_0xd5e7('0xa'));var querystring=require('querystring');var Papa=require(_0xd5e7('0x11'));var Redis=require(_0xd5e7('0x12'));var authService=require(_0xd5e7('0x13'));var qs=require(_0xd5e7('0x14'));var as=require(_0xd5e7('0x15'));var hardwareService=require(_0xd5e7('0x16'));var logger=require(_0xd5e7('0x17'))(_0xd5e7('0x18'));var utils=require(_0xd5e7('0x19'));var config=require(_0xd5e7('0x1a'));var licenseUtil=require(_0xd5e7('0x1b'));var db=require(_0xd5e7('0x1c'))['db'];function respondWithStatusCode(_0x239ef7,_0x9d7325){_0x9d7325=_0x9d7325||0xcc;return function(_0x584c83){if(_0x584c83){return _0x239ef7[_0xd5e7('0x1d')](_0x9d7325);}return _0x239ef7[_0xd5e7('0x1e')](_0x9d7325)['end']();};}function respondWithResult(_0x3efb36,_0x4e9e48){_0x4e9e48=_0x4e9e48||0xc8;return function(_0x417897){if(_0x417897){return _0x3efb36[_0xd5e7('0x1e')](_0x4e9e48)[_0xd5e7('0x1f')](_0x417897);}};}function respondWithFilteredResult(_0x2b33ac,_0x45d79e){return function(_0x9d05ba){if(_0x9d05ba){var _0x50795d=typeof _0x45d79e[_0xd5e7('0x20')]===_0xd5e7('0x21')&&typeof _0x45d79e[_0xd5e7('0x22')]===_0xd5e7('0x21');var _0x561eed=_0x9d05ba['count'];var _0x1fb998=_0x50795d?0x0:_0x45d79e[_0xd5e7('0x20')];var _0x5b48f0=_0x50795d?_0x9d05ba[_0xd5e7('0x23')]:_0x45d79e[_0xd5e7('0x20')]+_0x45d79e[_0xd5e7('0x22')];var _0x409127;if(_0x5b48f0>=_0x561eed){_0x5b48f0=_0x561eed;_0x409127=0xc8;}else{_0x409127=0xce;}_0x2b33ac['status'](_0x409127);return _0x2b33ac['set'](_0xd5e7('0x24'),_0x1fb998+'-'+_0x5b48f0+'/'+_0x561eed)['json'](_0x9d05ba);}return null;};}function patchUpdates(_0x89665){return function(_0x482516){try{jsonpatch[_0xd5e7('0x25')](_0x482516,_0x89665,!![]);}catch(_0x58c4a2){return BPromise['reject'](_0x58c4a2);}return _0x482516[_0xd5e7('0x26')]();};}function saveUpdates(_0x48a67e,_0x594b64){return function(_0x52714e){if(_0x52714e){return _0x52714e['update'](_0x48a67e)[_0xd5e7('0x27')](function(_0x253aaa){return _0x253aaa;});}return null;};}function removeEntity(_0x25e82c,_0x2be720){return function(_0x4eff8c){if(_0x4eff8c){return _0x4eff8c[_0xd5e7('0x28')]()[_0xd5e7('0x27')](function(){_0x25e82c['status'](0xcc)[_0xd5e7('0x29')]();});}};}function handleEntityNotFound(_0x2ba67e,_0x14dcc7){return function(_0x55a206){if(!_0x55a206){_0x2ba67e['sendStatus'](0x194);}return _0x55a206;};}function handleError(_0x309bdf,_0xcb7bdf){_0xcb7bdf=_0xcb7bdf||0x1f4;return function(_0x83ef6){logger['error'](_0x83ef6[_0xd5e7('0x2a')]);if(_0x83ef6['name']){delete _0x83ef6[_0xd5e7('0x2b')];}_0x309bdf[_0xd5e7('0x1e')](_0xcb7bdf)['send'](_0x83ef6);};}exports[_0xd5e7('0x2c')]=function(_0xed7f32,_0x2f8fdf){var _0x476f58={},_0x151334={},_0x188a5a={'count':0x0,'rows':[]};var _0x4bc5ac=_['map'](db['FaxApplication'][_0xd5e7('0x2d')],function(_0x3bb200){return{'name':_0x3bb200[_0xd5e7('0x2e')],'type':_0x3bb200[_0xd5e7('0x2f')][_0xd5e7('0x30')]};});_0x151334['model']=_[_0xd5e7('0x31')](_0x4bc5ac,_0xd5e7('0x2b'));_0x151334[_0xd5e7('0x32')]=_[_0xd5e7('0x33')](_0xed7f32[_0xd5e7('0x32')]);_0x151334[_0xd5e7('0x34')]=_[_0xd5e7('0x35')](_0x151334[_0xd5e7('0x36')],_0x151334[_0xd5e7('0x32')]);_0x476f58[_0xd5e7('0x37')]=_['intersection'](_0x151334[_0xd5e7('0x36')],qs[_0xd5e7('0x38')](_0xed7f32[_0xd5e7('0x32')][_0xd5e7('0x38')]));_0x476f58[_0xd5e7('0x37')]=_0x476f58[_0xd5e7('0x37')][_0xd5e7('0x39')]?_0x476f58[_0xd5e7('0x37')]:_0x151334[_0xd5e7('0x36')];if(!_0xed7f32[_0xd5e7('0x32')]['hasOwnProperty'](_0xd5e7('0x3a'))){_0x476f58['limit']=qs[_0xd5e7('0x22')](_0xed7f32[_0xd5e7('0x32')]['limit']);_0x476f58[_0xd5e7('0x20')]=qs['offset'](_0xed7f32[_0xd5e7('0x32')][_0xd5e7('0x20')]);}_0x476f58[_0xd5e7('0x3b')]=qs[_0xd5e7('0x3c')](_0xed7f32['query'][_0xd5e7('0x3c')]);_0x476f58[_0xd5e7('0x3d')]=qs[_0xd5e7('0x34')](_['pick'](_0xed7f32['query'],_0x151334[_0xd5e7('0x34')]),_0x4bc5ac);if(_0xed7f32[_0xd5e7('0x32')]['filter']){_0x476f58[_0xd5e7('0x3d')]=_[_0xd5e7('0x3e')](_0x476f58['where'],{'$or':_[_0xd5e7('0x31')](_0x4bc5ac,function(_0x462029){if(_0x462029[_0xd5e7('0x2f')]!==_0xd5e7('0x3f')){var _0x40e9e7={};_0x40e9e7[_0x462029[_0xd5e7('0x2b')]]={'$like':'%'+_0xed7f32[_0xd5e7('0x32')][_0xd5e7('0x40')]+'%'};return _0x40e9e7;}})});}_0x476f58=_['merge']({},_0x476f58,_0xed7f32[_0xd5e7('0x41')]);var _0x391fa5={'where':_0x476f58['where']};return db['FaxApplication'][_0xd5e7('0x23')](_0x391fa5)[_0xd5e7('0x27')](function(_0x968117){_0x188a5a[_0xd5e7('0x23')]=_0x968117;if(_0xed7f32['query'][_0xd5e7('0x42')]){_0x476f58[_0xd5e7('0x43')]=[{'all':!![]}];}return db[_0xd5e7('0x44')][_0xd5e7('0x45')](_0x476f58);})[_0xd5e7('0x27')](function(_0x2534ea){_0x188a5a[_0xd5e7('0x46')]=_0x2534ea;return _0x188a5a;})[_0xd5e7('0x27')](respondWithFilteredResult(_0x2f8fdf,_0x476f58))[_0xd5e7('0x47')](handleError(_0x2f8fdf,null));};exports[_0xd5e7('0x48')]=function(_0x45ab8c,_0x20e868){var _0x5f4509={'raw':!![],'where':{'id':_0x45ab8c[_0xd5e7('0x49')]['id']}},_0x3409ef={};_0x3409ef[_0xd5e7('0x36')]=_['keys'](db[_0xd5e7('0x44')]['rawAttributes']);_0x3409ef[_0xd5e7('0x32')]=_[_0xd5e7('0x33')](_0x45ab8c[_0xd5e7('0x32')]);_0x3409ef[_0xd5e7('0x34')]=_[_0xd5e7('0x35')](_0x3409ef[_0xd5e7('0x36')],_0x3409ef[_0xd5e7('0x32')]);_0x5f4509[_0xd5e7('0x37')]=_[_0xd5e7('0x35')](_0x3409ef[_0xd5e7('0x36')],qs[_0xd5e7('0x38')](_0x45ab8c['query'][_0xd5e7('0x38')]));_0x5f4509['attributes']=_0x5f4509[_0xd5e7('0x37')]['length']?_0x5f4509[_0xd5e7('0x37')]:_0x3409ef[_0xd5e7('0x36')];if(_0x45ab8c[_0xd5e7('0x32')][_0xd5e7('0x42')]){_0x5f4509[_0xd5e7('0x43')]=[{'all':!![]}];}_0x5f4509=_[_0xd5e7('0x3e')]({},_0x5f4509,_0x45ab8c[_0xd5e7('0x41')]);return db['FaxApplication'][_0xd5e7('0x4a')](_0x5f4509)[_0xd5e7('0x27')](handleEntityNotFound(_0x20e868,null))[_0xd5e7('0x27')](respondWithResult(_0x20e868,null))['catch'](handleError(_0x20e868,null));};exports[_0xd5e7('0x4b')]=function(_0x2f31cb,_0x3eeed3){return db[_0xd5e7('0x44')]['create'](_0x2f31cb[_0xd5e7('0x4c')],{})[_0xd5e7('0x27')](respondWithResult(_0x3eeed3,0xc9))[_0xd5e7('0x47')](handleError(_0x3eeed3,null));};exports[_0xd5e7('0x4d')]=function(_0x4520df,_0x33e7ad){if(_0x4520df[_0xd5e7('0x4c')]['id']){delete _0x4520df[_0xd5e7('0x4c')]['id'];}return db[_0xd5e7('0x44')][_0xd5e7('0x4a')]({'where':{'id':_0x4520df[_0xd5e7('0x49')]['id']}})[_0xd5e7('0x27')](handleEntityNotFound(_0x33e7ad,null))[_0xd5e7('0x27')](saveUpdates(_0x4520df[_0xd5e7('0x4c')],null))[_0xd5e7('0x27')](respondWithResult(_0x33e7ad,null))[_0xd5e7('0x47')](handleError(_0x33e7ad,null));};exports[_0xd5e7('0x28')]=function(_0x1d9ce0,_0xbc32ba){return db[_0xd5e7('0x44')][_0xd5e7('0x4a')]({'where':{'id':_0x1d9ce0['params']['id']}})[_0xd5e7('0x27')](handleEntityNotFound(_0xbc32ba,null))[_0xd5e7('0x27')](removeEntity(_0xbc32ba,null))[_0xd5e7('0x47')](handleError(_0xbc32ba,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7e246b3..154d6b2 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 _0x45fe=['bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxApplication','fax_applications','util','../../config/logger','api'];(function(_0x30ff84,_0x5db104){var _0x238862=function(_0x2e0901){while(--_0x2e0901){_0x30ff84['push'](_0x30ff84['shift']());}};_0x238862(++_0x5db104);}(_0x45fe,0x194));var _0xe45f=function(_0x43c8b8,_0x5e8934){_0x43c8b8=_0x43c8b8-0x0;var _0x413be3=_0x45fe[_0x43c8b8];return _0x413be3;};'use strict';var _=require('lodash');var util=require(_0xe45f('0x0'));var logger=require(_0xe45f('0x1'))(_0xe45f('0x2'));var moment=require('moment');var BPromise=require(_0xe45f('0x3'));var rp=require(_0xe45f('0x4'));var fs=require('fs');var path=require(_0xe45f('0x5'));var rimraf=require(_0xe45f('0x6'));var config=require(_0xe45f('0x7'));var attributes=require('./faxApplication.attributes');module[_0xe45f('0x8')]=function(_0x48bce5,_0x5d9f17){return _0x48bce5['define'](_0xe45f('0x9'),attributes,{'tableName':_0xe45f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7678=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x7bc1e1,_0x28b281){var _0x2fccdb=function(_0x2255a5){while(--_0x2255a5){_0x7bc1e1['push'](_0x7bc1e1['shift']());}};_0x2fccdb(++_0x28b281);}(_0x7678,0x152));var _0x8767=function(_0x59ebd4,_0x5486df){_0x59ebd4=_0x59ebd4-0x0;var _0x3ac7b4=_0x7678[_0x59ebd4];return _0x3ac7b4;};'use strict';var _=require(_0x8767('0x0'));var util=require(_0x8767('0x1'));var logger=require('../../config/logger')(_0x8767('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8767('0x3'));var fs=require('fs');var path=require(_0x8767('0x4'));var rimraf=require(_0x8767('0x5'));var config=require(_0x8767('0x6'));var attributes=require(_0x8767('0x7'));module[_0x8767('0x8')]=function(_0x303915,_0x4bb465){return _0x303915[_0x8767('0x9')](_0x8767('0xa'),attributes,{'tableName':_0x8767('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8767('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index b401c38..aee562a 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 _0x36dc=['request','then','info','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxApplication,\x20%s,\x20%s','message','request\x20sent','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x523dc9,_0x253911){var _0x2db794=function(_0x814a1c){while(--_0x814a1c){_0x523dc9['push'](_0x523dc9['shift']());}};_0x2db794(++_0x253911);}(_0x36dc,0x13d));var _0xc36d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x36dc[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc36d('0x0'));var util=require(_0xc36d('0x1'));var moment=require(_0xc36d('0x2'));var BPromise=require('bluebird');var rs=require(_0xc36d('0x3'));var fs=require('fs');var Redis=require(_0xc36d('0x4'));var db=require(_0xc36d('0x5'))['db'];var utils=require(_0xc36d('0x6'));var logger=require(_0xc36d('0x7'))(_0xc36d('0x8'));var config=require(_0xc36d('0x9'));var jayson=require(_0xc36d('0xa'));var client=jayson[_0xc36d('0xb')][_0xc36d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc0ddd0,_0x4cd119,_0x466d3d){return new BPromise(function(_0x75d780,_0x351168){return client[_0xc36d('0xd')](_0xc0ddd0,_0x466d3d)[_0xc36d('0xe')](function(_0x5859d5){logger[_0xc36d('0xf')]('FaxApplication,\x20%s,\x20%s',_0x4cd119,'request\x20sent');logger[_0xc36d('0x10')](_0xc36d('0x11'),_0x4cd119,'request\x20sent',JSON[_0xc36d('0x12')](_0x5859d5));if(_0x5859d5[_0xc36d('0x13')]){if(_0x5859d5[_0xc36d('0x13')][_0xc36d('0x14')]===0x1f4){logger[_0xc36d('0x13')](_0xc36d('0x15'),_0x4cd119,_0x5859d5[_0xc36d('0x13')][_0xc36d('0x16')]);return _0x351168(_0x5859d5[_0xc36d('0x13')][_0xc36d('0x16')]);}logger[_0xc36d('0x13')]('FaxApplication,\x20%s,\x20%s',_0x4cd119,_0x5859d5[_0xc36d('0x13')][_0xc36d('0x16')]);return _0x75d780(_0x5859d5[_0xc36d('0x13')][_0xc36d('0x16')]);}else{logger[_0xc36d('0xf')](_0xc36d('0x15'),_0x4cd119,_0xc36d('0x17'));_0x75d780(_0x5859d5['result'][_0xc36d('0x16')]);}})[_0xc36d('0x18')](function(_0xad8a42){logger[_0xc36d('0x13')](_0xc36d('0x15'),_0x4cd119,_0xad8a42);_0x351168(_0xad8a42);});});}exports[_0xc36d('0x19')]=function(_0x448865){var _0x361364=this;return new Promise(function(_0x277c2a,_0x245856){return db[_0xc36d('0x1a')][_0xc36d('0x1b')](_0x448865[_0xc36d('0x1c')],{'raw':_0x448865['options']?_0x448865[_0xc36d('0x1d')][_0xc36d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x448865['options']?_0x448865[_0xc36d('0x1d')]['where']||null:null,'attributes':_0x448865[_0xc36d('0x1d')]?_0x448865[_0xc36d('0x1d')][_0xc36d('0x1f')]||null:null,'limit':_0x448865[_0xc36d('0x1d')]?_0x448865[_0xc36d('0x1d')][_0xc36d('0x20')]||null:null})[_0xc36d('0xe')](function(_0x517dd3){logger[_0xc36d('0xf')](_0xc36d('0x19'),_0x448865);logger['debug']('UpdateFaxApplication',_0x448865,JSON[_0xc36d('0x12')](_0x517dd3));_0x277c2a(_0x517dd3);})[_0xc36d('0x18')](function(_0x741e42){logger[_0xc36d('0x13')]('UpdateFaxApplication',_0x741e42[_0xc36d('0x16')],_0x448865);_0x245856(_0x361364[_0xc36d('0x13')](0x1f4,_0x741e42[_0xc36d('0x16')]));});});}; \ No newline at end of file +var _0x18dd=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','UpdateFaxApplication','update','body','options','where','attributes','limit','lodash','moment','randomstring','ioredis'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x18dd,0x6c));var _0xd18d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x18dd[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xd18d('0x0'));var util=require('util');var moment=require(_0xd18d('0x1'));var BPromise=require('bluebird');var rs=require(_0xd18d('0x2'));var fs=require('fs');var Redis=require(_0xd18d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd18d('0x4'));var logger=require(_0xd18d('0x5'))(_0xd18d('0x6'));var config=require(_0xd18d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd18d('0x8')][_0xd18d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4de3da,_0x34ed99,_0xb1b216){return new BPromise(function(_0x1f65f3,_0x1477c8){return client[_0xd18d('0xa')](_0x4de3da,_0xb1b216)[_0xd18d('0xb')](function(_0x16ae19){logger['info'](_0xd18d('0xc'),_0x34ed99,_0xd18d('0xd'));logger[_0xd18d('0xe')](_0xd18d('0xf'),_0x34ed99,'request\x20sent',JSON['stringify'](_0x16ae19));if(_0x16ae19[_0xd18d('0x10')]){if(_0x16ae19[_0xd18d('0x10')][_0xd18d('0x11')]===0x1f4){logger[_0xd18d('0x10')]('FaxApplication,\x20%s,\x20%s',_0x34ed99,_0x16ae19['error'][_0xd18d('0x12')]);return _0x1477c8(_0x16ae19['error'][_0xd18d('0x12')]);}logger[_0xd18d('0x10')](_0xd18d('0xc'),_0x34ed99,_0x16ae19[_0xd18d('0x10')][_0xd18d('0x12')]);return _0x1f65f3(_0x16ae19[_0xd18d('0x10')]['message']);}else{logger[_0xd18d('0x13')](_0xd18d('0xc'),_0x34ed99,_0xd18d('0xd'));_0x1f65f3(_0x16ae19['result'][_0xd18d('0x12')]);}})[_0xd18d('0x14')](function(_0x2379de){logger['error']('FaxApplication,\x20%s,\x20%s',_0x34ed99,_0x2379de);_0x1477c8(_0x2379de);});});}exports[_0xd18d('0x15')]=function(_0x46698d){var _0x242f0d=this;return new Promise(function(_0x36d6ee,_0x29a300){return db['FaxApplication'][_0xd18d('0x16')](_0x46698d[_0xd18d('0x17')],{'raw':_0x46698d[_0xd18d('0x18')]?_0x46698d[_0xd18d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x46698d[_0xd18d('0x18')]?_0x46698d['options'][_0xd18d('0x19')]||null:null,'attributes':_0x46698d[_0xd18d('0x18')]?_0x46698d[_0xd18d('0x18')][_0xd18d('0x1a')]||null:null,'limit':_0x46698d[_0xd18d('0x18')]?_0x46698d['options'][_0xd18d('0x1b')]||null:null})[_0xd18d('0xb')](function(_0x2823a5){logger[_0xd18d('0x13')]('UpdateFaxApplication',_0x46698d);logger[_0xd18d('0xe')]('UpdateFaxApplication',_0x46698d,JSON['stringify'](_0x2823a5));_0x36d6ee(_0x2823a5);})[_0xd18d('0x14')](function(_0x2f4e35){logger[_0xd18d('0x10')](_0xd18d('0x15'),_0x2f4e35[_0xd18d('0x12')],_0x46698d);_0x29a300(_0x242f0d[_0xd18d('0x10')](0x1f4,_0x2f4e35['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 41c90e5..f25c920 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 _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x6d6f7,_0x4ba1a9){var _0x2a6afe=function(_0x2b9c3c){while(--_0x2b9c3c){_0x6d6f7['push'](_0x6d6f7['shift']());}};_0x2a6afe(++_0x4ba1a9);}(_0xda3f,0xec));var _0xfda3=function(_0x2160d4,_0x2c3f86){_0x2160d4=_0x2160d4-0x0;var _0x88fd83=_0xda3f[_0x2160d4];return _0x88fd83;};'use strict';var multer=require('multer');var util=require(_0xfda3('0x0'));var path=require(_0xfda3('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xfda3('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xfda3('0x3'));var config=require(_0xfda3('0x4'));var controller=require('./faxApplication.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file +var _0xe511=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','index','show','post','put'];(function(_0x5a3fa4,_0x1a0d45){var _0x12fb4e=function(_0x147792){while(--_0x147792){_0x5a3fa4['push'](_0x5a3fa4['shift']());}};_0x12fb4e(++_0x1a0d45);}(_0xe511,0x16f));var _0x1e51=function(_0x5b88f1,_0x9555f0){_0x5b88f1=_0x5b88f1-0x0;var _0x41f6c2=_0xe511[_0x5b88f1];return _0x41f6c2;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var fs_extra=require(_0x1e51('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1e51('0x5'));var config=require(_0x1e51('0x6'));var controller=require(_0x1e51('0x7'));router[_0x1e51('0x8')]('/',auth['isAuthenticated'](),controller[_0x1e51('0x9')]);router[_0x1e51('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x1e51('0xa')]);router[_0x1e51('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1e51('0xc')](_0x1e51('0xd'),auth[_0x1e51('0xe')](),controller[_0x1e51('0xf')]);router[_0x1e51('0x10')](_0x1e51('0xd'),auth['isAuthenticated'](),controller[_0x1e51('0x11')]);module[_0x1e51('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 9ee8102..c578894 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 _0x063a=['sequelize','STRING','ENUM','DATE','out'];(function(_0x5eccf3,_0xc308b1){var _0x5d2cc0=function(_0x5c4058){while(--_0x5c4058){_0x5eccf3['push'](_0x5eccf3['shift']());}};_0x5d2cc0(++_0xc308b1);}(_0x063a,0xc8));var _0xa063=function(_0x57d9e5,_0x3deddf){_0x57d9e5=_0x57d9e5-0x0;var _0x8e7481=_0x063a[_0x57d9e5];return _0x8e7481;};'use strict';var Sequelize=require(_0xa063('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa063('0x1')]},'secondDisposition':{'type':Sequelize[_0xa063('0x1')]},'thirdDisposition':{'type':Sequelize[_0xa063('0x1')]},'note':{'type':Sequelize[_0xa063('0x1')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xa063('0x1')]},'firstMsgDirection':{'type':Sequelize[_0xa063('0x2')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa063('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xa063('0x2')]('in',_0xa063('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xf657=['BOOLEAN','STRING','ENUM','DATE','out','sequelize','exports'];(function(_0x12d79e,_0x1c930f){var _0x3c432c=function(_0x28ce6c){while(--_0x28ce6c){_0x12d79e['push'](_0x12d79e['shift']());}};_0x3c432c(++_0x1c930f);}(_0xf657,0x9f));var _0x7f65=function(_0x72c52b,_0x3ed3ad){_0x72c52b=_0x72c52b-0x0;var _0x1f482e=_0xf657[_0x72c52b];return _0x1f482e;};'use strict';var Sequelize=require(_0x7f65('0x0'));module[_0x7f65('0x1')]={'closed':{'type':Sequelize[_0x7f65('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x7f65('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x7f65('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x7f65('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7f65('0x5')]},'lastMsgDirection':{'type':Sequelize[_0x7f65('0x4')]('in',_0x7f65('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 21a2f42..d9bb994 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 _0x8eaf=['expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','map','forEach','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','type','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','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.fax\x20LIKE\x20?','group','Sequelize','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','catch','show','params','includeAll','include','options','create','body','describe','FaxMessage','addMessage','ids','getMessages','findOne','pick','format','YYYY-MM-DD\x20HH:mm:ss','rows','addTags','setTags','omit','emit','faxInteractionTags:save','removeTags','download','unix','root','files','tmp','join','attachments','transcript-%d-%s.zip','Attachment','get','mkdirSync','Messages','basename','existsSync','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','fullname','TagIds','Tags','split','push','talking','answered','unmanaged','total','closed','waiting','UserId','index','FaxInteraction','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId'];(function(_0x2a5dcc,_0xc457bc){var _0x36f4c1=function(_0x28e686){while(--_0x28e686){_0x2a5dcc['push'](_0x2a5dcc['shift']());}};_0x36f4c1(++_0xc457bc);}(_0x8eaf,0x82));var _0xf8ea=function(_0x47638d,_0x2c6518){_0x47638d=_0x47638d-0x0;var _0x42ccbb=_0x8eaf[_0x47638d];return _0x42ccbb;};'use strict';var emlformat=require(_0xf8ea('0x0'));var rimraf=require(_0xf8ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf8ea('0x2'));var rp=require(_0xf8ea('0x3'));var moment=require(_0xf8ea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf8ea('0x5'));var path=require(_0xf8ea('0x6'));var sox=require('sox');var csv=require(_0xf8ea('0x7'));var ejs=require(_0xf8ea('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf8ea('0x9'));var squel=require('squel');var crypto=require(_0xf8ea('0xa'));var jsforce=require(_0xf8ea('0xb'));var deskjs=require(_0xf8ea('0xc'));var toCsv=require(_0xf8ea('0x7'));var querystring=require(_0xf8ea('0xd'));var Papa=require(_0xf8ea('0xe'));var Redis=require(_0xf8ea('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf8ea('0x10'));var hardwareService=require(_0xf8ea('0x11'));var logger=require('../../config/logger')(_0xf8ea('0x12'));var utils=require(_0xf8ea('0x13'));var config=require(_0xf8ea('0x14'));var licenseUtil=require(_0xf8ea('0x15'));var db=require(_0xf8ea('0x16'))['db'];config['redis']=_['defaults'](config[_0xf8ea('0x17')],{'host':_0xf8ea('0x18'),'port':0x18eb});var socket=require(_0xf8ea('0x19'))(new Redis(config[_0xf8ea('0x17')]));require(_0xf8ea('0x1a'))[_0xf8ea('0x1b')](socket);function respondWithStatusCode(_0x5078b6,_0x52f242){_0x52f242=_0x52f242||0xcc;return function(_0x5db872){if(_0x5db872){return _0x5078b6[_0xf8ea('0x1c')](_0x52f242);}return _0x5078b6['status'](_0x52f242)[_0xf8ea('0x1d')]();};}function respondWithResult(_0x5319c1,_0x4a7d33){_0x4a7d33=_0x4a7d33||0xc8;return function(_0x39fa6a){if(_0x39fa6a){return _0x5319c1[_0xf8ea('0x1e')](_0x4a7d33)['json'](_0x39fa6a);}};}function respondWithFilteredResult(_0x28fc1e,_0x1265ec){return function(_0xb7fc33){if(_0xb7fc33){var _0x2008c9=typeof _0x1265ec[_0xf8ea('0x1f')]===_0xf8ea('0x20')&&typeof _0x1265ec[_0xf8ea('0x21')]===_0xf8ea('0x20');var _0x4dff06=_0xb7fc33[_0xf8ea('0x22')];var _0x4517d7=_0x2008c9?0x0:_0x1265ec['offset'];var _0x3037f4=_0x2008c9?_0xb7fc33[_0xf8ea('0x22')]:_0x1265ec[_0xf8ea('0x1f')]+_0x1265ec[_0xf8ea('0x21')];var _0x226ede;if(_0x3037f4>=_0x4dff06){_0x3037f4=_0x4dff06;_0x226ede=0xc8;}else{_0x226ede=0xce;}_0x28fc1e[_0xf8ea('0x1e')](_0x226ede);return _0x28fc1e['set'](_0xf8ea('0x23'),_0x4517d7+'-'+_0x3037f4+'/'+_0x4dff06)[_0xf8ea('0x24')](_0xb7fc33);}return null;};}function patchUpdates(_0x8ce636){return function(_0x338ee9){try{jsonpatch[_0xf8ea('0x25')](_0x338ee9,_0x8ce636,!![]);}catch(_0x416837){return BPromise[_0xf8ea('0x26')](_0x416837);}return _0x338ee9['save']();};}function saveUpdates(_0x4ee917,_0x42395c){return function(_0x47d7f5){if(_0x47d7f5){return _0x47d7f5[_0xf8ea('0x27')](_0x4ee917)[_0xf8ea('0x28')](function(_0x3e370b){return _0x3e370b;});}return null;};}function removeEntity(_0x4f5afa,_0x24bb61){return function(_0x1a241c){if(_0x1a241c){return _0x1a241c[_0xf8ea('0x29')]()[_0xf8ea('0x28')](function(){_0x4f5afa[_0xf8ea('0x1e')](0xcc)[_0xf8ea('0x1d')]();});}};}function handleEntityNotFound(_0x1a8bf4,_0x161108){return function(_0x3cdb49){if(!_0x3cdb49){_0x1a8bf4[_0xf8ea('0x1c')](0x194);}return _0x3cdb49;};}function handleError(_0x41d624,_0x160286){_0x160286=_0x160286||0x1f4;return function(_0x1d27c1){logger[_0xf8ea('0x2a')](_0x1d27c1[_0xf8ea('0x2b')]);if(_0x1d27c1[_0xf8ea('0x2c')]){delete _0x1d27c1[_0xf8ea('0x2c')];}_0x41d624[_0xf8ea('0x1e')](_0x160286)['send'](_0x1d27c1);};}function getInteractionUsers(_0x15afcb,_0xc5434f){return new BPromise(function(_0x2c8f93,_0x1377ae){try{if(_0xc5434f[_0x15afcb['id']]){_0x15afcb['Users']=_['map'](_0xc5434f[_0x15afcb['id']],function(_0x17685){return{'id':_0x17685['id'],'fullname':_0x17685[_0xf8ea('0x2d')]};});}}catch(_0x4dfeeb){_0x1377ae(_0x4dfeeb);}_0x2c8f93(_0x15afcb);});}function getInteractionTags(_0x4963d5,_0x3b38fd){return new BPromise(function(_0x1f880b,_0x5812a1){try{if(_0x4963d5[_0xf8ea('0x2e')]){_0x4963d5[_0xf8ea('0x2f')]=[];_0x4963d5[_0xf8ea('0x2e')][_0xf8ea('0x30')](',')['forEach'](function(_0x4292b4){_0x4963d5[_0xf8ea('0x2f')][_0xf8ea('0x31')](_0x3b38fd[_0x4292b4]);});}delete _0x4963d5[_0xf8ea('0x2e')];}catch(_0x1c5cb7){_0x5812a1(_0x1c5cb7);}_0x1f880b(_0x4963d5);});}function updateFaxInteraction(_0x5362ab,_0x349552,_0x941bbd){return new BPromise(function(_0x3e2f70,_0x560aec){return getInteractionUsers(_0x5362ab,_0x941bbd)[_0xf8ea('0x28')](function(_0x5c6dcc){return getInteractionTags(_0x5c6dcc,_0x349552);})['then'](function(_0xf0ec1f){return getStateInteraction(_0xf0ec1f);})[_0xf8ea('0x28')](function(_0x14b209){_0x3e2f70(_0x14b209);})['catch'](function(_0x2c5bf0){_0x560aec(_0x2c5bf0);});});}function getStateInteraction(_0x583afc){return new BPromise(function(_0xe8d90e){_0x583afc['waiting']=0x0;_0x583afc[_0xf8ea('0x32')]=0x0;_0x583afc[_0xf8ea('0x33')]=0x0;_0x583afc[_0xf8ea('0x34')]=0x0;_0x583afc[_0xf8ea('0x35')]=0x0;if(!_0x583afc[_0xf8ea('0x36')]&&!_0x583afc['UserId']){_0x583afc[_0xf8ea('0x37')]+=0x1;}if(!_0x583afc['closed']&&_0x583afc[_0xf8ea('0x38')]){_0x583afc[_0xf8ea('0x32')]+=0x1;if(_0x583afc['waiting']){_0x583afc[_0xf8ea('0x37')]-=0x1;}}if(_0x583afc[_0xf8ea('0x36')]&&_0x583afc['UserId']){_0x583afc[_0xf8ea('0x33')]+=0x1;if(_0x583afc[_0xf8ea('0x32')]){_0x583afc[_0xf8ea('0x32')]-=0x1;}}if(_0x583afc[_0xf8ea('0x36')]&&!_0x583afc['UserId']){_0x583afc[_0xf8ea('0x34')]+=0x1;if(_0x583afc[_0xf8ea('0x37')]){_0x583afc['waiting']-=0x1;}}_0x583afc['total']+=0x1;_0xe8d90e(_0x583afc);});}exports[_0xf8ea('0x39')]=function(_0x3800f9,_0x7acb26){var _0xf0357c={},_0x1ae609={},_0x3a00c4={'count':0x0,'rows':[]};var _0x428ea4=_['map'](db[_0xf8ea('0x3a')][_0xf8ea('0x3b')],function(_0xdb3e7){return{'name':_0xdb3e7['fieldName'],'type':_0xdb3e7['type'][_0xf8ea('0x3c')]};});_0x1ae609[_0xf8ea('0x3d')]=_['map'](_0x428ea4,'name');_0x1ae609[_0xf8ea('0x3e')]=_[_0xf8ea('0x3f')](_0x3800f9['query']);_0x1ae609[_0xf8ea('0x40')]=_[_0xf8ea('0x41')](_0x1ae609[_0xf8ea('0x3d')],_0x1ae609[_0xf8ea('0x3e')]);_0xf0357c['attributes']=_['intersection'](_0x1ae609[_0xf8ea('0x3d')],qs[_0xf8ea('0x42')](_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x42')]));_0xf0357c[_0xf8ea('0x43')]=_0xf0357c['attributes'][_0xf8ea('0x44')]?_0xf0357c[_0xf8ea('0x43')]:_0x1ae609[_0xf8ea('0x3d')];if(!_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x45')](_0xf8ea('0x46'))){_0xf0357c[_0xf8ea('0x21')]=qs['limit'](_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x21')]);_0xf0357c[_0xf8ea('0x1f')]=qs[_0xf8ea('0x1f')](_0x3800f9['query']['offset']);}_0xf0357c['order']=qs[_0xf8ea('0x47')](_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x47')]);_0xf0357c[_0xf8ea('0x48')]=qs[_0xf8ea('0x40')](_['pick'](_0x3800f9[_0xf8ea('0x3e')],_0x1ae609[_0xf8ea('0x40')]),_0x428ea4);var _0x513842=[];var _0x5e0d42=squel[_0xf8ea('0x49')]()[_0xf8ea('0x4a')]('id')[_0xf8ea('0x4a')](_0xf8ea('0x2c'))[_0xf8ea('0x4a')](_0xf8ea('0x4b'))[_0xf8ea('0x4c')]('tools_tags');var _0x1cd570=squel[_0xf8ea('0x49')]()[_0xf8ea('0x4a')]('u.id')[_0xf8ea('0x4a')](_0xf8ea('0x4d'))[_0xf8ea('0x4a')](_0xf8ea('0x4e'))[_0xf8ea('0x4c')](_0xf8ea('0x4f'),'ui')[_0xf8ea('0x50')](_0xf8ea('0x51'),'u','u.id\x20=\x20ui.UserId');var _0x2c242f=squel['select']()[_0xf8ea('0x4c')]('fax_interactions','i')[_0xf8ea('0x50')](_0xf8ea('0x52'),'c',_0xf8ea('0x53'))[_0xf8ea('0x50')]('users','o',_0xf8ea('0x54'))['left_join'](_0xf8ea('0x55'),'a',_0xf8ea('0x56'))[_0xf8ea('0x50')]('fax_messages','me',_0xf8ea('0x57'))[_0xf8ea('0x50')]('fax_interaction_has_tags','it','it.FaxInteractionId\x20=\x20i.id')[_0xf8ea('0x50')](_0xf8ea('0x58'),'t',_0xf8ea('0x59'));var _0x3db3ec=squel[_0xf8ea('0x5a')]();var _0x5b0716=[];var _0xd2cf03=squel['expr']();var _0x1a722d;if(_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x5b')]){_0x1a722d=as[_0xf8ea('0x5c')](_0x3800f9[_0xf8ea('0x3e')]['search']);var _0xb07ab2=_0x1a722d[_0xf8ea('0x5d')];for(var _0x63a339=0x0;_0x63a339<_0x1a722d[_0xf8ea('0x5e')][_0xf8ea('0x44')];_0x63a339++){var _0x5185d6=_0x1a722d[_0xf8ea('0x5e')][_0x63a339];var _0x1678a2='i';var _0x167308=_[_0xf8ea('0x5f')](_0x428ea4,[_0xf8ea('0x2c'),_0x5185d6[_0xf8ea('0x4a')]]);if(!_0x167308){switch(_0x5185d6['field']){case _0xf8ea('0x60'):if(_0x5185d6[_0xf8ea('0x61')]==0x1){_0x2c242f[_0xf8ea('0x62')]('`'+_0x5185d6[_0xf8ea('0x4a')]+_0xf8ea('0x63'));}else{_0x2c242f[_0xf8ea('0x62')]('`'+_0x5185d6[_0xf8ea('0x4a')]+_0xf8ea('0x64'));}break;case _0xf8ea('0x65'):if(_0x5185d6['operator']===_0xf8ea('0x66')){if(_0x5185d6[_0xf8ea('0x61')][_0xf8ea('0x30')]('\x20')[_0xf8ea('0x44')]>0x1){_0x3db3ec[_0xb07ab2](_0xf8ea('0x67'),qs['getFullTextValue'](_0x5185d6[_0xf8ea('0x61')]),null);}else{var _0x58273a='%'+_0x5185d6['value']+'%';_0x3db3ec[_0xb07ab2](_0xf8ea('0x68'),_0x58273a,_0x58273a,_0x58273a);}}else{_0x167308=_['find'](_0x428ea4,[_0xf8ea('0x2c'),'ContactId']);_0x5185d6[_0xf8ea('0x4a')]=_0xf8ea('0x69');_0x5aa41f=as[_0xf8ea('0x6a')](_0x1678a2,_0x167308['type'],_0x5185d6);_0x3db3ec[_0xb07ab2](_0x5aa41f[_0xf8ea('0x6b')],_0x5aa41f[_0xf8ea('0x61')][_0xf8ea('0x6c')],_0x5aa41f[_0xf8ea('0x61')]['end']);}break;case _0xf8ea('0x6d'):var _0x551b2d=_0x5185d6[_0xf8ea('0x61')][_0xf8ea('0x30')](',')[_0xf8ea('0x6e')](function(_0x11f3ba){return Number(_0x11f3ba);});_0x551b2d[_0xf8ea('0x6f')](function(_0x25a45b){_0xd2cf03['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25a45b+',%');});_0x5b0716=_[_0xf8ea('0x70')](_0x5b0716,_0x551b2d);break;case _0xf8ea('0x71'):if(_0x5185d6['operator']==='$substring'){_0x3db3ec[_0xb07ab2](_0xf8ea('0x72'),'%'+_0x5185d6[_0xf8ea('0x61')]+'%',null);}else{_0x167308=_['find'](_0x428ea4,[_0xf8ea('0x2c'),_0xf8ea('0x38')]);_0x5185d6[_0xf8ea('0x4a')]=_0xf8ea('0x38');_0x5aa41f=as[_0xf8ea('0x6a')](_0x1678a2,_0x167308[_0xf8ea('0x73')],_0x5185d6);_0x3db3ec[_0xb07ab2](_0x5aa41f[_0xf8ea('0x6b')],_0x5aa41f[_0xf8ea('0x61')]['start'],_0x5aa41f[_0xf8ea('0x61')]['end']);}break;case'body':_0x5aa41f=as[_0xf8ea('0x6a')]('me',null,_0x5185d6);_0x3db3ec[_0xb07ab2](_0x5aa41f[_0xf8ea('0x6b')],_0x5aa41f[_0xf8ea('0x61')]['start'],_0x5aa41f[_0xf8ea('0x61')][_0xf8ea('0x1d')]);break;}}else{var _0x5aa41f=as[_0xf8ea('0x6a')](_0x1678a2,_0x167308['type'],_0x5185d6);_0x3db3ec[_0xb07ab2](_0x5aa41f['text'],_0x5aa41f[_0xf8ea('0x61')][_0xf8ea('0x6c')],_0x5aa41f[_0xf8ea('0x61')][_0xf8ea('0x1d')]);}}}else{var _0x233a92=_(_0x3800f9['query'])[_0xf8ea('0x3f')]()[_0xf8ea('0x6e')](function(_0x1372d9){return _[_0xf8ea('0x74')](_0x428ea4,[_0xf8ea('0x2c'),_0x1372d9])?_0x1372d9:undefined;})['compact']()['value']();if(!_[_0xf8ea('0x75')](_0x233a92)){_0x233a92[_0xf8ea('0x6f')](function(_0x32eff4){if(_0x32eff4===_0xf8ea('0x76')){_0x2c242f[_0xf8ea('0x48')](_0xf8ea('0x77'),[][_0xf8ea('0x78')](_0x3800f9['query'][_0x32eff4]));}else if(_0x32eff4===_0xf8ea('0x79')){var _0xe631b4=JSON['parse'](_0x3800f9[_0xf8ea('0x3e')][_0x32eff4])[_0xf8ea('0x7a')];var _0x46fb27=JSON[_0xf8ea('0x7b')](_0x3800f9[_0xf8ea('0x3e')][_0x32eff4])[_0xf8ea('0x7c')];_0x2c242f[_0xf8ea('0x48')](_0xf8ea('0x7d'),_0xe631b4,_0x46fb27);}else{if(_0x3800f9[_0xf8ea('0x3e')][_0x32eff4]===_0xf8ea('0x7e')){_0x2c242f[_0xf8ea('0x48')]('i.'+_0x32eff4+_0xf8ea('0x7f'));}else{_0x2c242f[_0xf8ea('0x48')]('i.'+_0x32eff4+_0xf8ea('0x80'),_0x3800f9[_0xf8ea('0x3e')][_0x32eff4]);}}});}if(_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x81')]){if(_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x81')]==0x1){_0x2c242f[_0xf8ea('0x62')](_0xf8ea('0x82'));}else{_0x2c242f['having'](_0xf8ea('0x83'));}}if(_0x3800f9[_0xf8ea('0x3e')]['tag']){_0x5b0716=_[_0xf8ea('0x84')](_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x85')])?_0x3800f9['query'][_0xf8ea('0x85')]:new Array(_0x3800f9[_0xf8ea('0x3e')]['tag']);_0x5b0716[_0xf8ea('0x6f')](function(_0x9a7fe8){_0xd2cf03['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x9a7fe8+',%');});}if(_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x86')]){var _0x24adfe=_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x86')][_0xf8ea('0x87')]('\x5c','\x5c\x5c')[_0xf8ea('0x87')](/'/g,'\x27\x27');if(qs[_0xf8ea('0x88')](_0x24adfe)){_0x3db3ec['or'](_0xf8ea('0x89'),_0x24adfe+'%')['or'](_0xf8ea('0x8a'),_0x24adfe+'%');}_0x3db3ec['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x24adfe+'%');}}_0x2c242f[_0xf8ea('0x48')](_0x3db3ec);_0x2c242f[_0xf8ea('0x8b')]('i.id');var _0x4aeb52={'type':db[_0xf8ea('0x8c')]['QueryTypes'][_0xf8ea('0x8d')],'raw':!![]};var _0x220986=_0x2c242f[_0xf8ea('0x8e')]();_0x220986[_0xf8ea('0x4a')](_0xf8ea('0x8f'));_0x220986[_0xf8ea('0x4a')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xf0357c[_0xf8ea('0x90')]){_0xf0357c[_0xf8ea('0x90')][_0xf8ea('0x6f')](function(_0x5e4b42){var _0x153239=_0x5e4b42[0x0]===_0xf8ea('0x91')?_0x5e4b42[0x0]:'i.'+_0x5e4b42[0x0];_0x2c242f[_0xf8ea('0x90')](_0x153239,_0x5e4b42[0x1]===_0xf8ea('0x92')?![]:!![]);});}if(!_['isEmpty'](_0x5b0716)){_0x2c242f[_0xf8ea('0x62')](_0xd2cf03);_0x220986[_0xf8ea('0x48')](_0xf8ea('0x93'),_0x5b0716);}BPromise[_0xf8ea('0x94')]()[_0xf8ea('0x28')](function(){if(!_0x1a722d){if(_0x3800f9['query'][_0xf8ea('0x76')])return;_0x220986['where']('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x2c242f[_0xf8ea('0x48')](_0xf8ea('0x95'));return;}if(_0x3800f9[_0xf8ea('0x96')][_0xf8ea('0x97')]!==_0xf8ea('0x98'))return;return _0x3800f9[_0xf8ea('0x96')][_0xf8ea('0x99')]({'attributes':['id'],'raw':!![]})[_0xf8ea('0x28')](function(_0x5226c8){if(_[_0xf8ea('0x75')](_0x5226c8)){_0x220986[_0xf8ea('0x48')](_0xf8ea('0x9a'));_0x2c242f[_0xf8ea('0x48')](_0xf8ea('0x9a'));}else{_0x220986[_0xf8ea('0x48')](_0xf8ea('0x77'),_[_0xf8ea('0x6e')](_0x5226c8,'id'));_0x2c242f[_0xf8ea('0x48')](_0xf8ea('0x77'),_[_0xf8ea('0x6e')](_0x5226c8,'id'));}});})[_0xf8ea('0x28')](function(){if(_0x3800f9[_0xf8ea('0x96')][_0xf8ea('0x97')]===_0xf8ea('0x98')&&!_0x1a722d&&!_0x3800f9[_0xf8ea('0x3e')][_0xf8ea('0x76')])return[];return db[_0xf8ea('0x9b')]['query'](_0x220986[_0xf8ea('0x9c')](),_0x4aeb52);})[_0xf8ea('0x28')](function(_0x5ab134){_0x3a00c4[_0xf8ea('0x22')]=_0x5ab134[_0xf8ea('0x44')];if(_0x3a00c4['count']===0x0)return[];return db['sequelize']['query'](_0x5e0d42[_0xf8ea('0x9c')](),_0x4aeb52)[_0xf8ea('0x28')](function(_0x9d4656){_0x513842=_[_0xf8ea('0x9d')](_0x9d4656,'id');_0x4aeb52=_[_0xf8ea('0x9e')](_0x4aeb52,{'model':db[_0xf8ea('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3800f9[_0xf8ea('0x3e')]['fields']){_0xf0357c[_0xf8ea('0x43')]['forEach'](function(_0xa719e4){_0x2c242f[_0xf8ea('0x4a')]('i.'+_0xa719e4);});}else{_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0x9f'),_0xf8ea('0x60'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa0'),'Account.key');_0x2c242f['field']('a.mandatoryDisposition',_0xf8ea('0xa1'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa2'),_0xf8ea('0x91'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa3'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa4'),_0xf8ea('0xa5'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa6'),_0xf8ea('0xa7'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa8'),'Contact.email');_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xa9'),_0xf8ea('0xaa'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xab'),_0xf8ea('0xac'));_0x2c242f[_0xf8ea('0x4a')](_0xf8ea('0xad'),_0xf8ea('0xae'));_0x2c242f['field']('o.fullname',_0xf8ea('0xaf'));_0x2c242f[_0xf8ea('0x4a')]('o.internal','Owner.internal');_0x2c242f[_0xf8ea('0x4a')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xf0357c[_0xf8ea('0x21')])_0x2c242f[_0xf8ea('0x21')](_0xf0357c[_0xf8ea('0x21')]);if(_0xf0357c[_0xf8ea('0x1f')])_0x2c242f[_0xf8ea('0x1f')](_0xf0357c[_0xf8ea('0x1f')]);return db[_0xf8ea('0x9b')][_0xf8ea('0x3e')](_0x2c242f[_0xf8ea('0x9c')](),_0x4aeb52);})['then'](function(_0x240bf6){if(_0x240bf6[_0xf8ea('0x44')]>0x0)_0x1cd570['where'](_0xf8ea('0xb0'),_[_0xf8ea('0x6e')](_0x240bf6,'id'));return db[_0xf8ea('0x9b')][_0xf8ea('0x3e')](_0x1cd570[_0xf8ea('0x9c')](),_0x4aeb52)[_0xf8ea('0x28')](function(_0x3065e4){var _0x147dd9=_[_0xf8ea('0xb1')](_0x3065e4,_0xf8ea('0xb2'));var _0x40874f=[];_0x240bf6['forEach'](function(_0x94aa98){_0x40874f[_0xf8ea('0x31')](updateFaxInteraction(_0x94aa98,_0x513842,_0x147dd9));});return BPromise['all'](_0x40874f);});});})['then'](function(_0x5ebb11){_0x3a00c4['rows']=_0x5ebb11;return _0x3a00c4;})[_0xf8ea('0x28')](respondWithFilteredResult(_0x7acb26,_0xf0357c))[_0xf8ea('0xb3')](handleError(_0x7acb26,null));};exports[_0xf8ea('0xb4')]=function(_0x17285f,_0x5e6506){var _0x34850d={'raw':![],'where':{'id':_0x17285f[_0xf8ea('0xb5')]['id']}},_0x1e39bd={};_0x1e39bd[_0xf8ea('0x3d')]=_[_0xf8ea('0x3f')](db[_0xf8ea('0x3a')][_0xf8ea('0x3b')]);_0x1e39bd['query']=_[_0xf8ea('0x3f')](_0x17285f[_0xf8ea('0x3e')]);_0x1e39bd[_0xf8ea('0x40')]=_[_0xf8ea('0x41')](_0x1e39bd[_0xf8ea('0x3d')],_0x1e39bd[_0xf8ea('0x3e')]);_0x34850d['attributes']=_[_0xf8ea('0x41')](_0x1e39bd[_0xf8ea('0x3d')],qs[_0xf8ea('0x42')](_0x17285f[_0xf8ea('0x3e')]['fields']));_0x34850d[_0xf8ea('0x43')]=_0x34850d[_0xf8ea('0x43')][_0xf8ea('0x44')]?_0x34850d['attributes']:_0x1e39bd['model'];if(_0x17285f[_0xf8ea('0x3e')][_0xf8ea('0xb6')]){_0x34850d[_0xf8ea('0xb7')]=[{'all':!![]}];}_0x34850d=_[_0xf8ea('0x9e')]({},_0x34850d,_0x17285f[_0xf8ea('0xb8')]);return db[_0xf8ea('0x3a')][_0xf8ea('0x5f')](_0x34850d)[_0xf8ea('0x28')](handleEntityNotFound(_0x5e6506,null))['then'](respondWithResult(_0x5e6506,null))['catch'](handleError(_0x5e6506,null));};exports['create']=function(_0x1c1196,_0x336b58){return db['FaxInteraction'][_0xf8ea('0xb9')](_0x1c1196[_0xf8ea('0xba')],{})['then'](respondWithResult(_0x336b58,0xc9))['catch'](handleError(_0x336b58,null));};exports['update']=function(_0x56c6f4,_0x23814e){if(_0x56c6f4[_0xf8ea('0xba')]['id']){delete _0x56c6f4[_0xf8ea('0xba')]['id'];}return db['FaxInteraction'][_0xf8ea('0x5f')]({'where':{'id':_0x56c6f4[_0xf8ea('0xb5')]['id']}})[_0xf8ea('0x28')](handleEntityNotFound(_0x23814e,null))[_0xf8ea('0x28')](saveUpdates(_0x56c6f4[_0xf8ea('0xba')],null))[_0xf8ea('0x28')](respondWithResult(_0x23814e,null))[_0xf8ea('0xb3')](handleError(_0x23814e,null));};exports[_0xf8ea('0x29')]=function(_0x1a3340,_0x5493c0){return db[_0xf8ea('0x3a')]['find']({'where':{'id':_0x1a3340[_0xf8ea('0xb5')]['id']}})[_0xf8ea('0x28')](handleEntityNotFound(_0x5493c0,null))['then'](removeEntity(_0x5493c0,null))['catch'](handleError(_0x5493c0,null));};exports[_0xf8ea('0xbb')]=function(_0x53d715,_0x1bc594){return db[_0xf8ea('0x3a')][_0xf8ea('0xbb')]()[_0xf8ea('0x28')](respondWithResult(_0x1bc594,null))[_0xf8ea('0xb3')](handleError(_0x1bc594,null));};exports['addMessage']=function(_0x55ff96,_0x378d3a,_0x324a61){return db[_0xf8ea('0xbc')][_0xf8ea('0x5f')]({'where':{'id':_0x55ff96[_0xf8ea('0xb5')]['id']}})[_0xf8ea('0x28')](handleEntityNotFound(_0x378d3a,null))['then'](function(_0xc53a13){if(_0xc53a13){return _0xc53a13[_0xf8ea('0xbd')](_0x55ff96[_0xf8ea('0xba')][_0xf8ea('0xbe')],_['omit'](_0x55ff96['body'],[_0xf8ea('0xbe'),'id'])||{});}})[_0xf8ea('0x28')](respondWithResult(_0x378d3a,null))[_0xf8ea('0xb3')](handleError(_0x378d3a,null));};exports[_0xf8ea('0xbf')]=function(_0x1a4e9b,_0x6ef37c,_0x3dd16f){var _0x45d15b={'raw':![],'where':{}};var _0x32dfa6={};var _0x3ae167={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xf8ea('0xc0')]({'where':{'id':_0x1a4e9b[_0xf8ea('0xb5')]['id']}})[_0xf8ea('0x28')](handleEntityNotFound(_0x6ef37c,null))['then'](function(_0x13fe13){if(_0x13fe13){_0x32dfa6[_0xf8ea('0x3d')]=_[_0xf8ea('0x3f')](db['FaxMessage'][_0xf8ea('0x3b')]);_0x32dfa6['query']=_['keys'](_0x1a4e9b[_0xf8ea('0x3e')]);_0x32dfa6[_0xf8ea('0x40')]=_[_0xf8ea('0x41')](_0x32dfa6[_0xf8ea('0x3d')],_0x32dfa6['query']);_0x45d15b[_0xf8ea('0x43')]=_[_0xf8ea('0x41')](_0x32dfa6[_0xf8ea('0x3d')],qs[_0xf8ea('0x42')](_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x42')]));_0x45d15b[_0xf8ea('0x43')]=_0x45d15b[_0xf8ea('0x43')]['length']?_0x45d15b['attributes']:_0x32dfa6[_0xf8ea('0x3d')];if(!_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x45')]('nolimit')){_0x45d15b[_0xf8ea('0x21')]=qs[_0xf8ea('0x21')](_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x21')]);_0x45d15b[_0xf8ea('0x1f')]=qs['offset'](_0x1a4e9b[_0xf8ea('0x3e')]['offset']);}_0x45d15b[_0xf8ea('0x90')]=qs[_0xf8ea('0x47')](_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x47')]);_0x45d15b[_0xf8ea('0x48')]=qs[_0xf8ea('0x40')](_[_0xf8ea('0xc1')](_0x1a4e9b['query'],_0x32dfa6['filters']));_0x45d15b['where'][_0xf8ea('0xb2')]=_0x13fe13['id'];if(_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x86')]){_0x45d15b[_0xf8ea('0x48')]=_[_0xf8ea('0x9e')](_0x45d15b['where'],{'$or':_['map'](_0x45d15b[_0xf8ea('0x43')],function(_0x2887a1){var _0x377a89={};_0x377a89[_0x2887a1]={'$like':'%'+_0x1a4e9b['query']['filter']+'%'};return _0x377a89;})});}if(_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0x7a')]){var _0x513a61=_0x1a4e9b[_0xf8ea('0x3e')]['$gte'][_0xf8ea('0x30')](',');var _0xb0d7e={};_0xb0d7e[_0x513a61[0x0]]={'$gte':moment(_0x513a61[0x1])[_0xf8ea('0xc2')](_0xf8ea('0xc3'))};_0x45d15b['where']=_['merge'](_0x45d15b[_0xf8ea('0x48')],_0xb0d7e);}_0x45d15b=_['merge']({},_0x45d15b,_0x1a4e9b['options']);return db[_0xf8ea('0xbc')][_0xf8ea('0x22')]({'where':_0x45d15b['where']})[_0xf8ea('0x28')](function(_0x4b68f7){_0x3ae167[_0xf8ea('0x22')]=_0x4b68f7;if(_0x1a4e9b[_0xf8ea('0x3e')][_0xf8ea('0xb6')]){_0x45d15b[_0xf8ea('0xb7')]=[{'all':!![]}];}return db[_0xf8ea('0xbc')]['findAll'](_0x45d15b);})['then'](function(_0x19fd68){_0x3ae167[_0xf8ea('0xc4')]=_0x19fd68;return _0x3ae167;});}})[_0xf8ea('0x28')](respondWithFilteredResult(_0x6ef37c,_0x45d15b))[_0xf8ea('0xb3')](handleError(_0x6ef37c,null));};exports[_0xf8ea('0xc5')]=function(_0x46761a,_0xb044af,_0x9983b8){return db['FaxInteraction'][_0xf8ea('0x5f')]({'where':{'id':_0x46761a[_0xf8ea('0xb5')]['id']}})['then'](handleEntityNotFound(_0xb044af,null))[_0xf8ea('0x28')](function(_0x1c910e){if(_0x1c910e){return _0x1c910e[_0xf8ea('0xc6')](_0x46761a[_0xf8ea('0xba')]['ids'],_[_0xf8ea('0xc7')](_0x46761a['body'],['ids','id'])||{})['spread'](function(){return db[_0xf8ea('0x6d')]['findAll']({'attributes':['id','name',_0xf8ea('0x4b')],'where':{'id':_0x46761a[_0xf8ea('0xba')]['ids']}});})[_0xf8ea('0x28')](function(_0x12bb77){socket[_0xf8ea('0xc8')](_0xf8ea('0xc9'),{'id':Number(_0x46761a[_0xf8ea('0xb5')]['id']),'tags':_0x12bb77||[]});return{'id':Number(_0x46761a[_0xf8ea('0xb5')]['id']),'tags':_0x12bb77||[]};});}})['then'](respondWithResult(_0xb044af,null))[_0xf8ea('0xb3')](handleError(_0xb044af,null));};exports[_0xf8ea('0xca')]=function(_0x394cb1,_0x3f985f,_0x4cdc36){return db['FaxInteraction']['find']({'where':{'id':_0x394cb1[_0xf8ea('0xb5')]['id']}})[_0xf8ea('0x28')](handleEntityNotFound(_0x3f985f,null))['then'](function(_0x421564){if(_0x421564){return _0x421564['removeTags'](_0x394cb1[_0xf8ea('0x3e')]['ids']);}})[_0xf8ea('0x28')](respondWithStatusCode(_0x3f985f,null))[_0xf8ea('0xb3')](handleError(_0x3f985f,null));};exports[_0xf8ea('0xcb')]=function(_0x594551,_0x5a3e5b){var _0x240c80=moment()[_0xf8ea('0xcc')]()[_0xf8ea('0x9c')]();var _0x553d8d=path['join'](config[_0xf8ea('0xcd')],'server',_0xf8ea('0xce'),_0xf8ea('0xcf'));var _0x4db195=path[_0xf8ea('0xd0')](config[_0xf8ea('0xcd')],'server',_0xf8ea('0xce'),_0xf8ea('0xd1'));var _0x2cee1a=path[_0xf8ea('0xd0')](_0x553d8d,_0x240c80);var _0xbfb700=util[_0xf8ea('0xc2')](_0xf8ea('0xd2'),_0x594551[_0xf8ea('0xb5')]['id'],_0x240c80);var _0x2555a1=path[_0xf8ea('0xd0')](_0x553d8d,_0xbfb700);var _0x558a68=[];_0x558a68[_0xf8ea('0x31')]({'model':db[_0xf8ea('0xd3')],'as':'Attachment','raw':!![]});var _0x1cfce8=[{'model':db[_0xf8ea('0xbc')],'as':'Messages','attributes':['id',_0xf8ea('0xba'),_0xf8ea('0x79')],'include':_0x558a68}];return db[_0xf8ea('0x3a')][_0xf8ea('0x5f')]({'where':{'id':_0x594551[_0xf8ea('0xb5')]['id']},'include':_0x1cfce8})['then'](handleEntityNotFound(_0x5a3e5b,null))[_0xf8ea('0x28')](function(_0x7cb06f){if(_0x7cb06f&&_0x7cb06f['Messages']){var _0x239aee=_0x7cb06f[_0xf8ea('0xd4')]({'plain':!![]});fs[_0xf8ea('0xd5')](_0x2cee1a);for(var _0x510e9c=0x0;_0x510e9c<_0x239aee[_0xf8ea('0xd6')][_0xf8ea('0x44')];_0x510e9c++){var _0x55bee8=_0x239aee[_0xf8ea('0xd6')][_0x510e9c][_0xf8ea('0xd3')];if(_0x55bee8){var _0x50414b=path['join'](_0x4db195,_0x55bee8[_0xf8ea('0xd7')]);if(fs[_0xf8ea('0xd8')](_0x50414b)){fs['createReadStream'](_0x50414b)['pipe'](fs['createWriteStream'](path['join'](_0x2cee1a,_0x55bee8[_0xf8ea('0xd7')])));}}}return BPromise[_0xf8ea('0x94')]()[_0xf8ea('0x28')](function(){return new BPromise(function(_0x27394d,_0x1b2e6b){zipdir(_0x2cee1a,{'saveTo':_0x2555a1},function(_0x3174b7,_0x1a9d52){if(_0x3174b7)return _0x1b2e6b(_0x3174b7);return _0x27394d(_0x1a9d52);});})[_0xf8ea('0x28')](function(){return new BPromise(function(_0x31d6a9,_0x5d9645){rimraf(_0x2cee1a,function(_0x5b1f9b){if(_0x5b1f9b)_0x5d9645(_0x5b1f9b);return _0x31d6a9();});});})['then'](function(){return _0x5a3e5b[_0xf8ea('0xcb')](_0x2555a1,_0xbfb700,function(_0x2bb302){if(_0x2bb302){console[_0xf8ea('0xd9')](_0xf8ea('0xda'),_0x2bb302);}else{fs[_0xf8ea('0xdb')](_0x2555a1);}});});});}else{return _0x5a3e5b['sendStatus'](0xc8);}})[_0xf8ea('0xb3')](handleError(_0x5a3e5b,null));}; \ No newline at end of file +var _0x3b03=['i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','t.id\x20IN\x20?','resolve','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','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','FaxInteractionId','push','all','rows','show','params','includeAll','include','options','create','describe','FaxMessage','addMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','color','emit','faxInteractionTags:save','removeTags','download','root','server','files','attachments','join','transcript-%d-%s.zip','Attachment','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','log','eml-format','zip-dir','fast-json-patch','moment','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','then','destroy','stack','send','map','fullname','TagIds','Tags','forEach','catch','waiting','talking','answered','total','UserId','closed','unmanaged','index','FaxInteraction','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','select','field','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','split','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','body','some','compact','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','$gte','parse','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3b03,0x124));var _0x33b0=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0x3b03[_0xf50820];return _0x2a9b10;};'use strict';var emlformat=require(_0x33b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x33b0('0x1'));var jsonpatch=require(_0x33b0('0x2'));var rp=require('request-promise');var moment=require(_0x33b0('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x33b0('0x4'));var ejs=require(_0x33b0('0x5'));var fs=require('fs');var fs_extra=require(_0x33b0('0x6'));var _=require(_0x33b0('0x7'));var squel=require(_0x33b0('0x8'));var crypto=require(_0x33b0('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x33b0('0xa'));var toCsv=require(_0x33b0('0x4'));var querystring=require('querystring');var Papa=require(_0x33b0('0xb'));var Redis=require('ioredis');var authService=require(_0x33b0('0xc'));var qs=require(_0x33b0('0xd'));var as=require(_0x33b0('0xe'));var hardwareService=require(_0x33b0('0xf'));var logger=require(_0x33b0('0x10'))('api');var utils=require(_0x33b0('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x33b0('0x12'));var db=require(_0x33b0('0x13'))['db'];config[_0x33b0('0x14')]=_[_0x33b0('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x33b0('0x16'))(new Redis(config['redis']));require(_0x33b0('0x17'))[_0x33b0('0x18')](socket);function respondWithStatusCode(_0x5c16a5,_0x4e72ac){_0x4e72ac=_0x4e72ac||0xcc;return function(_0x5387a7){if(_0x5387a7){return _0x5c16a5[_0x33b0('0x19')](_0x4e72ac);}return _0x5c16a5[_0x33b0('0x1a')](_0x4e72ac)[_0x33b0('0x1b')]();};}function respondWithResult(_0x5e2097,_0x3cf394){_0x3cf394=_0x3cf394||0xc8;return function(_0x4146a6){if(_0x4146a6){return _0x5e2097[_0x33b0('0x1a')](_0x3cf394)[_0x33b0('0x1c')](_0x4146a6);}};}function respondWithFilteredResult(_0x37913f,_0x5b5000){return function(_0x56a4a7){if(_0x56a4a7){var _0x1b246d=typeof _0x5b5000[_0x33b0('0x1d')]===_0x33b0('0x1e')&&typeof _0x5b5000['limit']===_0x33b0('0x1e');var _0x20eb7a=_0x56a4a7['count'];var _0x381648=_0x1b246d?0x0:_0x5b5000[_0x33b0('0x1d')];var _0x2ffdff=_0x1b246d?_0x56a4a7[_0x33b0('0x1f')]:_0x5b5000[_0x33b0('0x1d')]+_0x5b5000[_0x33b0('0x20')];var _0x2384d9;if(_0x2ffdff>=_0x20eb7a){_0x2ffdff=_0x20eb7a;_0x2384d9=0xc8;}else{_0x2384d9=0xce;}_0x37913f[_0x33b0('0x1a')](_0x2384d9);return _0x37913f[_0x33b0('0x21')]('Content-Range',_0x381648+'-'+_0x2ffdff+'/'+_0x20eb7a)['json'](_0x56a4a7);}return null;};}function patchUpdates(_0x3e0c69){return function(_0x26f5e9){try{jsonpatch['apply'](_0x26f5e9,_0x3e0c69,!![]);}catch(_0x16b68b){return BPromise[_0x33b0('0x22')](_0x16b68b);}return _0x26f5e9['save']();};}function saveUpdates(_0x273af7,_0x31c264){return function(_0x27576e){if(_0x27576e){return _0x27576e[_0x33b0('0x23')](_0x273af7)[_0x33b0('0x24')](function(_0x1e0159){return _0x1e0159;});}return null;};}function removeEntity(_0x41d42b,_0xd80319){return function(_0x3c5c5d){if(_0x3c5c5d){return _0x3c5c5d[_0x33b0('0x25')]()['then'](function(){_0x41d42b[_0x33b0('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5848d6,_0x5e522d){return function(_0x314b9a){if(!_0x314b9a){_0x5848d6[_0x33b0('0x19')](0x194);}return _0x314b9a;};}function handleError(_0x2ba39b,_0x378b3d){_0x378b3d=_0x378b3d||0x1f4;return function(_0x5096b2){logger['error'](_0x5096b2[_0x33b0('0x26')]);if(_0x5096b2['name']){delete _0x5096b2['name'];}_0x2ba39b[_0x33b0('0x1a')](_0x378b3d)[_0x33b0('0x27')](_0x5096b2);};}function getInteractionUsers(_0x314bad,_0x481f45){return new BPromise(function(_0x3e983e,_0x52a4f9){try{if(_0x481f45[_0x314bad['id']]){_0x314bad['Users']=_[_0x33b0('0x28')](_0x481f45[_0x314bad['id']],function(_0x3fe17a){return{'id':_0x3fe17a['id'],'fullname':_0x3fe17a[_0x33b0('0x29')]};});}}catch(_0x4687e4){_0x52a4f9(_0x4687e4);}_0x3e983e(_0x314bad);});}function getInteractionTags(_0x2e0c5b,_0x414446){return new BPromise(function(_0x699b08,_0x4de723){try{if(_0x2e0c5b[_0x33b0('0x2a')]){_0x2e0c5b[_0x33b0('0x2b')]=[];_0x2e0c5b['TagIds']['split'](',')[_0x33b0('0x2c')](function(_0x2e4f17){_0x2e0c5b[_0x33b0('0x2b')]['push'](_0x414446[_0x2e4f17]);});}delete _0x2e0c5b[_0x33b0('0x2a')];}catch(_0x2a2acd){_0x4de723(_0x2a2acd);}_0x699b08(_0x2e0c5b);});}function updateFaxInteraction(_0x3edbf5,_0x10d5c2,_0x3be00c){return new BPromise(function(_0x1e4f20,_0x520c7b){return getInteractionUsers(_0x3edbf5,_0x3be00c)[_0x33b0('0x24')](function(_0x3e6515){return getInteractionTags(_0x3e6515,_0x10d5c2);})[_0x33b0('0x24')](function(_0x30dbf8){return getStateInteraction(_0x30dbf8);})[_0x33b0('0x24')](function(_0xa84200){_0x1e4f20(_0xa84200);})[_0x33b0('0x2d')](function(_0x150644){_0x520c7b(_0x150644);});});}function getStateInteraction(_0x3073cf){return new BPromise(function(_0x22a6cb){_0x3073cf[_0x33b0('0x2e')]=0x0;_0x3073cf[_0x33b0('0x2f')]=0x0;_0x3073cf[_0x33b0('0x30')]=0x0;_0x3073cf['unmanaged']=0x0;_0x3073cf[_0x33b0('0x31')]=0x0;if(!_0x3073cf['closed']&&!_0x3073cf[_0x33b0('0x32')]){_0x3073cf[_0x33b0('0x2e')]+=0x1;}if(!_0x3073cf[_0x33b0('0x33')]&&_0x3073cf[_0x33b0('0x32')]){_0x3073cf[_0x33b0('0x2f')]+=0x1;if(_0x3073cf['waiting']){_0x3073cf[_0x33b0('0x2e')]-=0x1;}}if(_0x3073cf[_0x33b0('0x33')]&&_0x3073cf[_0x33b0('0x32')]){_0x3073cf[_0x33b0('0x30')]+=0x1;if(_0x3073cf[_0x33b0('0x2f')]){_0x3073cf[_0x33b0('0x2f')]-=0x1;}}if(_0x3073cf[_0x33b0('0x33')]&&!_0x3073cf['UserId']){_0x3073cf[_0x33b0('0x34')]+=0x1;if(_0x3073cf[_0x33b0('0x2e')]){_0x3073cf[_0x33b0('0x2e')]-=0x1;}}_0x3073cf[_0x33b0('0x31')]+=0x1;_0x22a6cb(_0x3073cf);});}exports[_0x33b0('0x35')]=function(_0xcc4cde,_0xc6632f){var _0x3a960d={},_0x2ca88b={},_0x79d429={'count':0x0,'rows':[]};var _0x13ace5=_[_0x33b0('0x28')](db[_0x33b0('0x36')][_0x33b0('0x37')],function(_0x31d4fb){return{'name':_0x31d4fb['fieldName'],'type':_0x31d4fb[_0x33b0('0x38')][_0x33b0('0x39')]};});_0x2ca88b[_0x33b0('0x3a')]=_[_0x33b0('0x28')](_0x13ace5,_0x33b0('0x3b'));_0x2ca88b['query']=_[_0x33b0('0x3c')](_0xcc4cde[_0x33b0('0x3d')]);_0x2ca88b[_0x33b0('0x3e')]=_[_0x33b0('0x3f')](_0x2ca88b[_0x33b0('0x3a')],_0x2ca88b[_0x33b0('0x3d')]);_0x3a960d[_0x33b0('0x40')]=_['intersection'](_0x2ca88b['model'],qs[_0x33b0('0x41')](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x41')]));_0x3a960d[_0x33b0('0x40')]=_0x3a960d[_0x33b0('0x40')]['length']?_0x3a960d[_0x33b0('0x40')]:_0x2ca88b[_0x33b0('0x3a')];if(!_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x42')](_0x33b0('0x43'))){_0x3a960d[_0x33b0('0x20')]=qs[_0x33b0('0x20')](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x20')]);_0x3a960d['offset']=qs[_0x33b0('0x1d')](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x1d')]);}_0x3a960d['order']=qs[_0x33b0('0x44')](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x44')]);_0x3a960d[_0x33b0('0x45')]=qs[_0x33b0('0x3e')](_['pick'](_0xcc4cde[_0x33b0('0x3d')],_0x2ca88b[_0x33b0('0x3e')]),_0x13ace5);var _0x1d8e88=[];var _0x15d405=squel[_0x33b0('0x46')]()[_0x33b0('0x47')]('id')[_0x33b0('0x47')](_0x33b0('0x3b'))[_0x33b0('0x47')]('color')[_0x33b0('0x48')](_0x33b0('0x49'));var _0x33bc0e=squel[_0x33b0('0x46')]()['field'](_0x33b0('0x4a'))[_0x33b0('0x47')](_0x33b0('0x4b'))[_0x33b0('0x47')]('ui.FaxInteractionId')[_0x33b0('0x48')](_0x33b0('0x4c'),'ui')[_0x33b0('0x4d')](_0x33b0('0x4e'),'u',_0x33b0('0x4f'));var _0x1ec87c=squel[_0x33b0('0x46')]()[_0x33b0('0x48')]('fax_interactions','i')[_0x33b0('0x4d')](_0x33b0('0x50'),'c',_0x33b0('0x51'))[_0x33b0('0x4d')]('users','o',_0x33b0('0x52'))[_0x33b0('0x4d')](_0x33b0('0x53'),'a',_0x33b0('0x54'))[_0x33b0('0x4d')](_0x33b0('0x55'),'me',_0x33b0('0x56'))[_0x33b0('0x4d')](_0x33b0('0x57'),'it',_0x33b0('0x58'))['left_join'](_0x33b0('0x49'),'t','t.id\x20=\x20it.TagId');var _0x5e4c8f=squel[_0x33b0('0x59')]();var _0x139b65=[];var _0x3b8beb=squel['expr']();var _0x1ba50c;if(_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x5a')]){_0x1ba50c=as['parseSearch'](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x5a')]);var _0x1dbee9=_0x1ba50c[_0x33b0('0x5b')];for(var _0x48488b=0x0;_0x48488b<_0x1ba50c[_0x33b0('0x5c')][_0x33b0('0x5d')];_0x48488b++){var _0x1d0a87=_0x1ba50c[_0x33b0('0x5c')][_0x48488b];var _0x28e4cd='i';var _0x3bf85f=_[_0x33b0('0x5e')](_0x13ace5,[_0x33b0('0x3b'),_0x1d0a87[_0x33b0('0x47')]]);if(!_0x3bf85f){switch(_0x1d0a87[_0x33b0('0x47')]){case _0x33b0('0x5f'):if(_0x1d0a87[_0x33b0('0x60')]==0x1){_0x1ec87c['having']('`'+_0x1d0a87['field']+'`\x20=\x200');}else{_0x1ec87c[_0x33b0('0x61')]('`'+_0x1d0a87[_0x33b0('0x47')]+_0x33b0('0x62'));}break;case'Contact':if(_0x1d0a87[_0x33b0('0x63')]===_0x33b0('0x64')){if(_0x1d0a87[_0x33b0('0x60')][_0x33b0('0x65')]('\x20')[_0x33b0('0x5d')]>0x1){_0x5e4c8f[_0x1dbee9]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x33b0('0x66')](_0x1d0a87[_0x33b0('0x60')]),null);}else{var _0x16e4e6='%'+_0x1d0a87[_0x33b0('0x60')]+'%';_0x5e4c8f[_0x1dbee9](_0x33b0('0x67'),_0x16e4e6,_0x16e4e6,_0x16e4e6);}}else{_0x3bf85f=_[_0x33b0('0x5e')](_0x13ace5,[_0x33b0('0x3b'),_0x33b0('0x68')]);_0x1d0a87[_0x33b0('0x47')]=_0x33b0('0x68');_0x4633e3=as[_0x33b0('0x69')](_0x28e4cd,_0x3bf85f['type'],_0x1d0a87);_0x5e4c8f[_0x1dbee9](_0x4633e3[_0x33b0('0x6a')],_0x4633e3[_0x33b0('0x60')][_0x33b0('0x6b')],_0x4633e3[_0x33b0('0x60')]['end']);}break;case _0x33b0('0x6c'):var _0x910099=_0x1d0a87[_0x33b0('0x60')][_0x33b0('0x65')](',')[_0x33b0('0x28')](function(_0x27ff98){return Number(_0x27ff98);});_0x910099[_0x33b0('0x2c')](function(_0x526d06){_0x3b8beb['or'](_0x33b0('0x6d'),'%,'+_0x526d06+',%');});_0x139b65=_[_0x33b0('0x6e')](_0x139b65,_0x910099);break;case _0x33b0('0x6f'):if(_0x1d0a87[_0x33b0('0x63')]==='$substring'){_0x5e4c8f[_0x1dbee9]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1d0a87[_0x33b0('0x60')]+'%',null);}else{_0x3bf85f=_[_0x33b0('0x5e')](_0x13ace5,[_0x33b0('0x3b'),_0x33b0('0x32')]);_0x1d0a87[_0x33b0('0x47')]=_0x33b0('0x32');_0x4633e3=as[_0x33b0('0x69')](_0x28e4cd,_0x3bf85f['type'],_0x1d0a87);_0x5e4c8f[_0x1dbee9](_0x4633e3[_0x33b0('0x6a')],_0x4633e3[_0x33b0('0x60')][_0x33b0('0x6b')],_0x4633e3['value'][_0x33b0('0x1b')]);}break;case _0x33b0('0x70'):_0x4633e3=as[_0x33b0('0x69')]('me',null,_0x1d0a87);_0x5e4c8f[_0x1dbee9](_0x4633e3[_0x33b0('0x6a')],_0x4633e3['value']['start'],_0x4633e3[_0x33b0('0x60')][_0x33b0('0x1b')]);break;}}else{var _0x4633e3=as[_0x33b0('0x69')](_0x28e4cd,_0x3bf85f['type'],_0x1d0a87);_0x5e4c8f[_0x1dbee9](_0x4633e3[_0x33b0('0x6a')],_0x4633e3[_0x33b0('0x60')][_0x33b0('0x6b')],_0x4633e3['value']['end']);}}}else{var _0x3b0eed=_(_0xcc4cde[_0x33b0('0x3d')])[_0x33b0('0x3c')]()[_0x33b0('0x28')](function(_0x457836){return _[_0x33b0('0x71')](_0x13ace5,['name',_0x457836])?_0x457836:undefined;})[_0x33b0('0x72')]()['value']();if(!_[_0x33b0('0x73')](_0x3b0eed)){_0x3b0eed[_0x33b0('0x2c')](function(_0x206d64){if(_0x206d64==='FaxAccountId'){_0x1ec87c[_0x33b0('0x45')](_0x33b0('0x74'),[][_0x33b0('0x75')](_0xcc4cde[_0x33b0('0x3d')][_0x206d64]));}else if(_0x206d64===_0x33b0('0x76')){var _0x42b86d=JSON['parse'](_0xcc4cde[_0x33b0('0x3d')][_0x206d64])[_0x33b0('0x77')];var _0x1b9ef4=JSON[_0x33b0('0x78')](_0xcc4cde[_0x33b0('0x3d')][_0x206d64])['$lte'];_0x1ec87c[_0x33b0('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x42b86d,_0x1b9ef4);}else{if(_0xcc4cde[_0x33b0('0x3d')][_0x206d64]==='null'){_0x1ec87c['where']('i.'+_0x206d64+_0x33b0('0x79'));}else{_0x1ec87c[_0x33b0('0x45')]('i.'+_0x206d64+_0x33b0('0x7a'),_0xcc4cde[_0x33b0('0x3d')][_0x206d64]);}}});}if(_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x7b')]){if(_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x7b')]==0x1){_0x1ec87c[_0x33b0('0x61')](_0x33b0('0x7c'));}else{_0x1ec87c['having'](_0x33b0('0x7d'));}}if(_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x7e')]){_0x139b65=_[_0x33b0('0x7f')](_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x7e')])?_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x7e')]:new Array(_0xcc4cde['query'][_0x33b0('0x7e')]);_0x139b65[_0x33b0('0x2c')](function(_0x5a85fd){_0x3b8beb['or'](_0x33b0('0x6d'),'%,'+_0x5a85fd+',%');});}if(_0xcc4cde[_0x33b0('0x3d')]['filter']){var _0x1976e2=_0xcc4cde['query'][_0x33b0('0x80')][_0x33b0('0x81')]('\x5c','\x5c\x5c')[_0x33b0('0x81')](/'/g,'\x27\x27');if(qs[_0x33b0('0x82')](_0x1976e2)){_0x5e4c8f['or'](_0x33b0('0x83'),_0x1976e2+'%')['or'](_0x33b0('0x84'),_0x1976e2+'%');}_0x5e4c8f['or'](_0x33b0('0x85'),_0x1976e2+'%');}}_0x1ec87c[_0x33b0('0x45')](_0x5e4c8f);_0x1ec87c[_0x33b0('0x86')](_0x33b0('0x87'));var _0xe7cbae={'type':db[_0x33b0('0x88')][_0x33b0('0x89')][_0x33b0('0x8a')],'raw':!![]};var _0xf61f94=_0x1ec87c[_0x33b0('0x8b')]();_0xf61f94[_0x33b0('0x47')]('i.id');_0xf61f94[_0x33b0('0x47')](_0x33b0('0x8c'),_0x33b0('0x5f'));if(_0x3a960d[_0x33b0('0x8d')]){_0x3a960d[_0x33b0('0x8d')]['forEach'](function(_0x1f641c){var _0x4c9a3c=_0x1f641c[0x0]===_0x33b0('0x8e')?_0x1f641c[0x0]:'i.'+_0x1f641c[0x0];_0x1ec87c[_0x33b0('0x8d')](_0x4c9a3c,_0x1f641c[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x139b65)){_0x1ec87c[_0x33b0('0x61')](_0x3b8beb);_0xf61f94[_0x33b0('0x45')](_0x33b0('0x8f'),_0x139b65);}BPromise[_0x33b0('0x90')]()['then'](function(){if(!_0x1ba50c){if(_0xcc4cde[_0x33b0('0x3d')][_0x33b0('0x91')])return;_0xf61f94['where'](_0x33b0('0x92'));_0x1ec87c[_0x33b0('0x45')](_0x33b0('0x92'));return;}if(_0xcc4cde[_0x33b0('0x93')][_0x33b0('0x94')]!==_0x33b0('0x95'))return;return _0xcc4cde['user'][_0x33b0('0x96')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3938eb){if(_[_0x33b0('0x73')](_0x3938eb)){_0xf61f94[_0x33b0('0x45')](_0x33b0('0x97'));_0x1ec87c[_0x33b0('0x45')](_0x33b0('0x97'));}else{_0xf61f94[_0x33b0('0x45')](_0x33b0('0x74'),_['map'](_0x3938eb,'id'));_0x1ec87c[_0x33b0('0x45')](_0x33b0('0x74'),_[_0x33b0('0x28')](_0x3938eb,'id'));}});})['then'](function(){if(_0xcc4cde[_0x33b0('0x93')][_0x33b0('0x94')]===_0x33b0('0x95')&&!_0x1ba50c&&!_0xcc4cde['query'][_0x33b0('0x91')])return[];return db[_0x33b0('0x98')]['query'](_0xf61f94[_0x33b0('0x99')](),_0xe7cbae);})[_0x33b0('0x24')](function(_0x495a07){_0x79d429[_0x33b0('0x1f')]=_0x495a07[_0x33b0('0x5d')];if(_0x79d429[_0x33b0('0x1f')]===0x0)return[];return db[_0x33b0('0x98')]['query'](_0x15d405['toString'](),_0xe7cbae)[_0x33b0('0x24')](function(_0x409478){_0x1d8e88=_[_0x33b0('0x9a')](_0x409478,'id');_0xe7cbae=_[_0x33b0('0x9b')](_0xe7cbae,{'model':db[_0x33b0('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xcc4cde[_0x33b0('0x3d')]['fields']){_0x3a960d[_0x33b0('0x40')]['forEach'](function(_0x440571){_0x1ec87c['field']('i.'+_0x440571);});}else{_0x1ec87c[_0x33b0('0x47')](_0x33b0('0x8c'),'unreadMessages');_0x1ec87c[_0x33b0('0x47')]('a.key',_0x33b0('0x9c'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0x9d'),_0x33b0('0x9e'));_0x1ec87c['field']('CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x1ec87c[_0x33b0('0x47')](_0x33b0('0x9f'));_0x1ec87c[_0x33b0('0x47')]('c.firstName',_0x33b0('0xa0'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0xa1'),_0x33b0('0xa2'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0xa3'),_0x33b0('0xa4'));_0x1ec87c['field'](_0x33b0('0xa5'),_0x33b0('0xa6'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0xa7'),_0x33b0('0xa8'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0xa9'),_0x33b0('0xaa'));_0x1ec87c[_0x33b0('0x47')](_0x33b0('0xab'),_0x33b0('0xac'));_0x1ec87c['field']('o.internal','Owner.internal');_0x1ec87c[_0x33b0('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x33b0('0x2a'));}if(_0x3a960d[_0x33b0('0x20')])_0x1ec87c[_0x33b0('0x20')](_0x3a960d[_0x33b0('0x20')]);if(_0x3a960d[_0x33b0('0x1d')])_0x1ec87c[_0x33b0('0x1d')](_0x3a960d[_0x33b0('0x1d')]);return db['sequelize'][_0x33b0('0x3d')](_0x1ec87c['toString'](),_0xe7cbae);})[_0x33b0('0x24')](function(_0x373e2d){if(_0x373e2d['length']>0x0)_0x33bc0e[_0x33b0('0x45')]('ui.FaxInteractionId\x20IN\x20?',_[_0x33b0('0x28')](_0x373e2d,'id'));return db[_0x33b0('0x98')][_0x33b0('0x3d')](_0x33bc0e[_0x33b0('0x99')](),_0xe7cbae)[_0x33b0('0x24')](function(_0x217bd6){var _0x851cdd=_['groupBy'](_0x217bd6,_0x33b0('0xad'));var _0xed9a82=[];_0x373e2d[_0x33b0('0x2c')](function(_0x290682){_0xed9a82[_0x33b0('0xae')](updateFaxInteraction(_0x290682,_0x1d8e88,_0x851cdd));});return BPromise[_0x33b0('0xaf')](_0xed9a82);});});})['then'](function(_0x5a7700){_0x79d429[_0x33b0('0xb0')]=_0x5a7700;return _0x79d429;})[_0x33b0('0x24')](respondWithFilteredResult(_0xc6632f,_0x3a960d))['catch'](handleError(_0xc6632f,null));};exports[_0x33b0('0xb1')]=function(_0x46c3f2,_0x44745a){var _0x3bc3a8={'raw':![],'where':{'id':_0x46c3f2[_0x33b0('0xb2')]['id']}},_0x3017f4={};_0x3017f4[_0x33b0('0x3a')]=_[_0x33b0('0x3c')](db[_0x33b0('0x36')][_0x33b0('0x37')]);_0x3017f4[_0x33b0('0x3d')]=_[_0x33b0('0x3c')](_0x46c3f2['query']);_0x3017f4[_0x33b0('0x3e')]=_['intersection'](_0x3017f4[_0x33b0('0x3a')],_0x3017f4[_0x33b0('0x3d')]);_0x3bc3a8[_0x33b0('0x40')]=_[_0x33b0('0x3f')](_0x3017f4['model'],qs[_0x33b0('0x41')](_0x46c3f2[_0x33b0('0x3d')][_0x33b0('0x41')]));_0x3bc3a8[_0x33b0('0x40')]=_0x3bc3a8[_0x33b0('0x40')][_0x33b0('0x5d')]?_0x3bc3a8[_0x33b0('0x40')]:_0x3017f4[_0x33b0('0x3a')];if(_0x46c3f2['query'][_0x33b0('0xb3')]){_0x3bc3a8[_0x33b0('0xb4')]=[{'all':!![]}];}_0x3bc3a8=_[_0x33b0('0x9b')]({},_0x3bc3a8,_0x46c3f2[_0x33b0('0xb5')]);return db[_0x33b0('0x36')]['find'](_0x3bc3a8)[_0x33b0('0x24')](handleEntityNotFound(_0x44745a,null))[_0x33b0('0x24')](respondWithResult(_0x44745a,null))['catch'](handleError(_0x44745a,null));};exports[_0x33b0('0xb6')]=function(_0x1e6448,_0x1bc9ac){return db[_0x33b0('0x36')][_0x33b0('0xb6')](_0x1e6448[_0x33b0('0x70')],{})[_0x33b0('0x24')](respondWithResult(_0x1bc9ac,0xc9))[_0x33b0('0x2d')](handleError(_0x1bc9ac,null));};exports['update']=function(_0x571455,_0x31414d){if(_0x571455[_0x33b0('0x70')]['id']){delete _0x571455[_0x33b0('0x70')]['id'];}return db[_0x33b0('0x36')][_0x33b0('0x5e')]({'where':{'id':_0x571455[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x31414d,null))[_0x33b0('0x24')](saveUpdates(_0x571455[_0x33b0('0x70')],null))[_0x33b0('0x24')](respondWithResult(_0x31414d,null))[_0x33b0('0x2d')](handleError(_0x31414d,null));};exports[_0x33b0('0x25')]=function(_0x4c786b,_0x173c9a){return db['FaxInteraction'][_0x33b0('0x5e')]({'where':{'id':_0x4c786b[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x173c9a,null))['then'](removeEntity(_0x173c9a,null))['catch'](handleError(_0x173c9a,null));};exports[_0x33b0('0xb7')]=function(_0x5d20ae,_0x289d43){return db['FaxInteraction'][_0x33b0('0xb7')]()[_0x33b0('0x24')](respondWithResult(_0x289d43,null))['catch'](handleError(_0x289d43,null));};exports['addMessage']=function(_0x3fbc23,_0x17b96f,_0x49a5d4){return db[_0x33b0('0xb8')][_0x33b0('0x5e')]({'where':{'id':_0x3fbc23[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x17b96f,null))[_0x33b0('0x24')](function(_0x5cb389){if(_0x5cb389){return _0x5cb389[_0x33b0('0xb9')](_0x3fbc23[_0x33b0('0x70')][_0x33b0('0xba')],_[_0x33b0('0xbb')](_0x3fbc23[_0x33b0('0x70')],[_0x33b0('0xba'),'id'])||{});}})[_0x33b0('0x24')](respondWithResult(_0x17b96f,null))[_0x33b0('0x2d')](handleError(_0x17b96f,null));};exports[_0x33b0('0xbc')]=function(_0x2c78f1,_0x505760,_0x11d857){var _0x47e5ab={'raw':![],'where':{}};var _0x361a3c={};var _0x48919b={'count':0x0,'rows':[]};return db[_0x33b0('0x36')]['findOne']({'where':{'id':_0x2c78f1[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x505760,null))[_0x33b0('0x24')](function(_0x45d282){if(_0x45d282){_0x361a3c['model']=_[_0x33b0('0x3c')](db[_0x33b0('0xb8')]['rawAttributes']);_0x361a3c['query']=_['keys'](_0x2c78f1[_0x33b0('0x3d')]);_0x361a3c[_0x33b0('0x3e')]=_[_0x33b0('0x3f')](_0x361a3c[_0x33b0('0x3a')],_0x361a3c[_0x33b0('0x3d')]);_0x47e5ab[_0x33b0('0x40')]=_['intersection'](_0x361a3c[_0x33b0('0x3a')],qs['fields'](_0x2c78f1['query'][_0x33b0('0x41')]));_0x47e5ab['attributes']=_0x47e5ab[_0x33b0('0x40')]['length']?_0x47e5ab[_0x33b0('0x40')]:_0x361a3c[_0x33b0('0x3a')];if(!_0x2c78f1[_0x33b0('0x3d')][_0x33b0('0x42')]('nolimit')){_0x47e5ab[_0x33b0('0x20')]=qs['limit'](_0x2c78f1[_0x33b0('0x3d')]['limit']);_0x47e5ab[_0x33b0('0x1d')]=qs[_0x33b0('0x1d')](_0x2c78f1[_0x33b0('0x3d')][_0x33b0('0x1d')]);}_0x47e5ab[_0x33b0('0x8d')]=qs[_0x33b0('0x44')](_0x2c78f1[_0x33b0('0x3d')]['sort']);_0x47e5ab[_0x33b0('0x45')]=qs['filters'](_[_0x33b0('0xbd')](_0x2c78f1[_0x33b0('0x3d')],_0x361a3c[_0x33b0('0x3e')]));_0x47e5ab[_0x33b0('0x45')][_0x33b0('0xad')]=_0x45d282['id'];if(_0x2c78f1[_0x33b0('0x3d')][_0x33b0('0x80')]){_0x47e5ab[_0x33b0('0x45')]=_[_0x33b0('0x9b')](_0x47e5ab['where'],{'$or':_[_0x33b0('0x28')](_0x47e5ab[_0x33b0('0x40')],function(_0x28f347){var _0x562398={};_0x562398[_0x28f347]={'$like':'%'+_0x2c78f1[_0x33b0('0x3d')]['filter']+'%'};return _0x562398;})});}if(_0x2c78f1[_0x33b0('0x3d')][_0x33b0('0x77')]){var _0x52cb0e=_0x2c78f1[_0x33b0('0x3d')]['$gte']['split'](',');var _0x1892f6={};_0x1892f6[_0x52cb0e[0x0]]={'$gte':moment(_0x52cb0e[0x1])[_0x33b0('0xbe')](_0x33b0('0xbf'))};_0x47e5ab[_0x33b0('0x45')]=_[_0x33b0('0x9b')](_0x47e5ab['where'],_0x1892f6);}_0x47e5ab=_[_0x33b0('0x9b')]({},_0x47e5ab,_0x2c78f1[_0x33b0('0xb5')]);return db['FaxMessage'][_0x33b0('0x1f')]({'where':_0x47e5ab[_0x33b0('0x45')]})[_0x33b0('0x24')](function(_0x539792){_0x48919b['count']=_0x539792;if(_0x2c78f1[_0x33b0('0x3d')]['includeAll']){_0x47e5ab['include']=[{'all':!![]}];}return db[_0x33b0('0xb8')]['findAll'](_0x47e5ab);})[_0x33b0('0x24')](function(_0x2e6291){_0x48919b[_0x33b0('0xb0')]=_0x2e6291;return _0x48919b;});}})[_0x33b0('0x24')](respondWithFilteredResult(_0x505760,_0x47e5ab))[_0x33b0('0x2d')](handleError(_0x505760,null));};exports['addTags']=function(_0x568c0d,_0x5dd476,_0x4256d7){return db['FaxInteraction'][_0x33b0('0x5e')]({'where':{'id':_0x568c0d[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x5dd476,null))[_0x33b0('0x24')](function(_0x1748ad){if(_0x1748ad){return _0x1748ad['setTags'](_0x568c0d[_0x33b0('0x70')]['ids'],_[_0x33b0('0xbb')](_0x568c0d[_0x33b0('0x70')],[_0x33b0('0xba'),'id'])||{})['spread'](function(){return db[_0x33b0('0x6c')][_0x33b0('0xc0')]({'attributes':['id',_0x33b0('0x3b'),_0x33b0('0xc1')],'where':{'id':_0x568c0d[_0x33b0('0x70')][_0x33b0('0xba')]}});})['then'](function(_0x59cd33){socket[_0x33b0('0xc2')](_0x33b0('0xc3'),{'id':Number(_0x568c0d[_0x33b0('0xb2')]['id']),'tags':_0x59cd33||[]});return{'id':Number(_0x568c0d[_0x33b0('0xb2')]['id']),'tags':_0x59cd33||[]};});}})['then'](respondWithResult(_0x5dd476,null))[_0x33b0('0x2d')](handleError(_0x5dd476,null));};exports['removeTags']=function(_0xebdebc,_0x2644f7,_0xd95fd6){return db[_0x33b0('0x36')][_0x33b0('0x5e')]({'where':{'id':_0xebdebc[_0x33b0('0xb2')]['id']}})[_0x33b0('0x24')](handleEntityNotFound(_0x2644f7,null))[_0x33b0('0x24')](function(_0x200ef5){if(_0x200ef5){return _0x200ef5[_0x33b0('0xc4')](_0xebdebc[_0x33b0('0x3d')][_0x33b0('0xba')]);}})['then'](respondWithStatusCode(_0x2644f7,null))[_0x33b0('0x2d')](handleError(_0x2644f7,null));};exports[_0x33b0('0xc5')]=function(_0x191503,_0x3dd2c3){var _0x4b5623=moment()['unix']()[_0x33b0('0x99')]();var _0x19de8a=path['join'](config[_0x33b0('0xc6')],_0x33b0('0xc7'),_0x33b0('0xc8'),'tmp');var _0xdc9f94=path['join'](config[_0x33b0('0xc6')],_0x33b0('0xc7'),_0x33b0('0xc8'),_0x33b0('0xc9'));var _0x33ef2b=path[_0x33b0('0xca')](_0x19de8a,_0x4b5623);var _0x527d38=util[_0x33b0('0xbe')](_0x33b0('0xcb'),_0x191503[_0x33b0('0xb2')]['id'],_0x4b5623);var _0x9b7ec6=path['join'](_0x19de8a,_0x527d38);var _0x3b86f3=[];_0x3b86f3['push']({'model':db['Attachment'],'as':_0x33b0('0xcc'),'raw':!![]});var _0x4ce539=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0x33b0('0x70'),_0x33b0('0x76')],'include':_0x3b86f3}];return db[_0x33b0('0x36')][_0x33b0('0x5e')]({'where':{'id':_0x191503['params']['id']},'include':_0x4ce539})[_0x33b0('0x24')](handleEntityNotFound(_0x3dd2c3,null))['then'](function(_0x6d90fe){if(_0x6d90fe&&_0x6d90fe[_0x33b0('0xcd')]){var _0xa88749=_0x6d90fe['get']({'plain':!![]});fs['mkdirSync'](_0x33ef2b);for(var _0x3cd944=0x0;_0x3cd944<_0xa88749['Messages']['length'];_0x3cd944++){var _0x5a7578=_0xa88749['Messages'][_0x3cd944][_0x33b0('0xcc')];if(_0x5a7578){var _0xa303f9=path['join'](_0xdc9f94,_0x5a7578[_0x33b0('0xce')]);if(fs[_0x33b0('0xcf')](_0xa303f9)){fs[_0x33b0('0xd0')](_0xa303f9)[_0x33b0('0xd1')](fs[_0x33b0('0xd2')](path[_0x33b0('0xca')](_0x33ef2b,_0x5a7578['basename'])));}}}return BPromise[_0x33b0('0x90')]()[_0x33b0('0x24')](function(){return new BPromise(function(_0x2b3b9c,_0x5dad9f){zipdir(_0x33ef2b,{'saveTo':_0x9b7ec6},function(_0x5e610a,_0x18286c){if(_0x5e610a)return _0x5dad9f(_0x5e610a);return _0x2b3b9c(_0x18286c);});})[_0x33b0('0x24')](function(){return new BPromise(function(_0x3e6698,_0x4ec72b){rimraf(_0x33ef2b,function(_0x3337a0){if(_0x3337a0)_0x4ec72b(_0x3337a0);return _0x3e6698();});});})['then'](function(){return _0x3dd2c3['download'](_0x9b7ec6,_0x527d38,function(_0x2d610f){if(_0x2d610f){console[_0x33b0('0xd3')]('err',_0x2d610f);}else{fs['unlinkSync'](_0x9b7ec6);}});});});}else{return _0x3dd2c3[_0x33b0('0x19')](0xc8);}})[_0x33b0('0x2d')](handleError(_0x3dd2c3,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index df867ac..a3855a9 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 _0x2b55=['update','remove','getUsers','setDataValue','Users','findAll','length','emit','hasOwnProperty','events','FaxInteraction','setMaxListeners','save'];(function(_0x26fca7,_0x9d515e){var _0x54115e=function(_0x4a93f8){while(--_0x4a93f8){_0x26fca7['push'](_0x26fca7['shift']());}};_0x54115e(++_0x9d515e);}(_0x2b55,0x19c));var _0x52b5=function(_0x253061,_0x2eb02b){_0x253061=_0x253061-0x0;var _0x40eb9e=_0x2b55[_0x253061];return _0x40eb9e;};'use strict';var EventEmitter=require(_0x52b5('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x52b5('0x1')];var FaxMessage=require('../../mysqldb')['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x52b5('0x2')](0x0);var events={'afterCreate':_0x52b5('0x3'),'afterUpdate':_0x52b5('0x4'),'afterDestroy':_0x52b5('0x5')};function emitEvent(_0x4a4bc2){return function(_0x4a136b,_0x2ec00e,_0x4854f2){_0x4a136b[_0x52b5('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x4a0273){_0x4a136b[_0x52b5('0x7')](_0x52b5('0x8'),_0x4a0273['map'](function(_0x465dc9){return{'id':_0x465dc9['id']};}));return FaxMessage[_0x52b5('0x9')]({'where':{'FaxInteractionId':_0x4a136b['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x375c66){_0x4a136b[_0x52b5('0x7')]('unreadMessages',_0x375c66[_0x52b5('0xa')]);FaxInteractionEvents[_0x52b5('0xb')](_0x4a4bc2+':'+_0x4a136b['id'],_0x4a136b);FaxInteractionEvents[_0x52b5('0xb')](_0x4a4bc2,_0x4a136b);_0x4854f2(null);})['catch'](_0x4854f2(null));};}for(var e in events){if(events[_0x52b5('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module['exports']=FaxInteractionEvents; \ No newline at end of file +var _0x8801=['findAll','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','FaxInteraction','../../mysqldb','setMaxListeners','save','update','getUsers','then','map'];(function(_0x5d8864,_0x2a9368){var _0x144e50=function(_0x1b12ac){while(--_0x1b12ac){_0x5d8864['push'](_0x5d8864['shift']());}};_0x144e50(++_0x2a9368);}(_0x8801,0x118));var _0x1880=function(_0x4a59b1,_0x20c142){_0x4a59b1=_0x4a59b1-0x0;var _0x128db0=_0x8801[_0x4a59b1];return _0x128db0;};'use strict';var EventEmitter=require(_0x1880('0x0'));var FaxInteraction=require('../../mysqldb')['db'][_0x1880('0x1')];var FaxMessage=require(_0x1880('0x2'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x1880('0x3')](0x0);var events={'afterCreate':_0x1880('0x4'),'afterUpdate':_0x1880('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3bef45){return function(_0x4bf1de,_0x2f6851,_0x171b17){_0x4bf1de[_0x1880('0x6')]({'attributes':['id'],'raw':!![]})[_0x1880('0x7')](function(_0x4d2a17){_0x4bf1de['setDataValue']('Users',_0x4d2a17[_0x1880('0x8')](function(_0x48df0b){return{'id':_0x48df0b['id']};}));return FaxMessage[_0x1880('0x9')]({'where':{'FaxInteractionId':_0x4bf1de['id'],'direction':'in','read':![]},'raw':!![]});})[_0x1880('0x7')](function(_0x2ae558){_0x4bf1de[_0x1880('0xa')](_0x1880('0xb'),_0x2ae558[_0x1880('0xc')]);FaxInteractionEvents[_0x1880('0xd')](_0x3bef45+':'+_0x4bf1de['id'],_0x4bf1de);FaxInteractionEvents[_0x1880('0xd')](_0x3bef45,_0x4bf1de);_0x171b17(null);})[_0x1880('0xe')](_0x171b17(null));};}for(var e in events){if(events[_0x1880('0xf')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x1880('0x10')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index f4d64c5..51faaa7 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 _0x3d5d=['FaxInteraction','fax_interactions','changed','closed','closedAt','format','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define'];(function(_0x52e734,_0x4d3d45){var _0x662c7f=function(_0x48966b){while(--_0x48966b){_0x52e734['push'](_0x52e734['shift']());}};_0x662c7f(++_0x4d3d45);}(_0x3d5d,0x102));var _0xd3d5=function(_0x320b8e,_0x1da3fe){_0x320b8e=_0x320b8e-0x0;var _0x55a10a=_0x3d5d[_0x320b8e];return _0x55a10a;};'use strict';var _=require(_0xd3d5('0x0'));var util=require(_0xd3d5('0x1'));var logger=require(_0xd3d5('0x2'))('api');var moment=require(_0xd3d5('0x3'));var BPromise=require(_0xd3d5('0x4'));var rp=require(_0xd3d5('0x5'));var fs=require('fs');var path=require(_0xd3d5('0x6'));var rimraf=require(_0xd3d5('0x7'));var config=require(_0xd3d5('0x8'));var attributes=require(_0xd3d5('0x9'));module[_0xd3d5('0xa')]=function(_0x528831,_0x741ed4){return _0x528831[_0xd3d5('0xb')](_0xd3d5('0xc'),attributes,{'tableName':_0xd3d5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x225e13,_0x232cb7,_0x467cec){if(_0x225e13[_0xd3d5('0xe')](_0xd3d5('0xf'))){_0x225e13[_0xd3d5('0x10')]=moment()[_0xd3d5('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x467cec(null,_0x225e13);}}});}; \ No newline at end of file +var _0x218d=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','define','FaxInteraction','fax_interactions','changed'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x218d,0x143));var _0xd218=function(_0xf0945b,_0x84078d){_0xf0945b=_0xf0945b-0x0;var _0x4b3aba=_0x218d[_0xf0945b];return _0x4b3aba;};'use strict';var _=require(_0xd218('0x0'));var util=require(_0xd218('0x1'));var logger=require(_0xd218('0x2'))(_0xd218('0x3'));var moment=require(_0xd218('0x4'));var BPromise=require(_0xd218('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd218('0x6'));var rimraf=require(_0xd218('0x7'));var config=require(_0xd218('0x8'));var attributes=require('./faxInteraction.attributes');module['exports']=function(_0x355851,_0x5b005b){return _0x355851[_0xd218('0x9')](_0xd218('0xa'),attributes,{'tableName':_0xd218('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5cfb8b,_0x15adad,_0x12eed1){if(_0x5cfb8b[_0xd218('0xc')]('closed')){_0x5cfb8b[_0xd218('0xd')]=moment()[_0xd218('0xe')](_0xd218('0xf'));}_0x12eed1(null,_0x5cfb8b);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 27e2e78..2fcb5f8 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 _0xfd0c=['rpc','../../config/environment','jayson/promise','http','redis','localhost','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','limit','catch','where','ids','omit','body','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3113f8,_0xe1b455){var _0x4613f1=function(_0x5c7dc2){while(--_0x5c7dc2){_0x3113f8['push'](_0x3113f8['shift']());}};_0x4613f1(++_0xe1b455);}(_0xfd0c,0x1d9));var _0xcfd0=function(_0x75ce5b,_0x3b582f){_0x75ce5b=_0x75ce5b-0x0;var _0x22195e=_0xfd0c[_0x75ce5b];return _0x22195e;};'use strict';var _=require(_0xcfd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcfd0('0x1'));var rs=require(_0xcfd0('0x2'));var fs=require('fs');var Redis=require(_0xcfd0('0x3'));var db=require(_0xcfd0('0x4'))['db'];var utils=require(_0xcfd0('0x5'));var logger=require(_0xcfd0('0x6'))(_0xcfd0('0x7'));var config=require(_0xcfd0('0x8'));var jayson=require(_0xcfd0('0x9'));var client=jayson['client'][_0xcfd0('0xa')]({'port':0x232a});config[_0xcfd0('0xb')]=_['defaults'](config[_0xcfd0('0xb')],{'host':_0xcfd0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcfd0('0xb')]));require(_0xcfd0('0xd'))[_0xcfd0('0xe')](socket);function respondWithRpcPromise(_0x1ef626,_0x225679,_0x313a41){return new BPromise(function(_0x5e9958,_0xa25eed){return client[_0xcfd0('0xf')](_0x1ef626,_0x313a41)[_0xcfd0('0x10')](function(_0x2ae8a8){logger[_0xcfd0('0x11')](_0xcfd0('0x12'),_0x225679,_0xcfd0('0x13'));logger[_0xcfd0('0x14')](_0xcfd0('0x15'),_0x225679,'request\x20sent',JSON[_0xcfd0('0x16')](_0x2ae8a8));if(_0x2ae8a8[_0xcfd0('0x17')]){if(_0x2ae8a8[_0xcfd0('0x17')][_0xcfd0('0x18')]===0x1f4){logger[_0xcfd0('0x17')](_0xcfd0('0x12'),_0x225679,_0x2ae8a8['error'][_0xcfd0('0x19')]);return _0xa25eed(_0x2ae8a8[_0xcfd0('0x17')][_0xcfd0('0x19')]);}logger[_0xcfd0('0x17')](_0xcfd0('0x12'),_0x225679,_0x2ae8a8[_0xcfd0('0x17')][_0xcfd0('0x19')]);return _0x5e9958(_0x2ae8a8[_0xcfd0('0x17')][_0xcfd0('0x19')]);}else{logger[_0xcfd0('0x11')](_0xcfd0('0x12'),_0x225679,_0xcfd0('0x13'));_0x5e9958(_0x2ae8a8[_0xcfd0('0x1a')][_0xcfd0('0x19')]);}})['catch'](function(_0x5c321e){logger[_0xcfd0('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x225679,_0x5c321e);_0xa25eed(_0x5c321e);});});}exports[_0xcfd0('0x1b')]=function(_0x3a9108){var _0x44b866=this;return new Promise(function(_0x276fa9,_0x4fff61){return db[_0xcfd0('0x1c')][_0xcfd0('0x1d')](_0x3a9108['body'],{'raw':_0x3a9108[_0xcfd0('0x1e')]?_0x3a9108[_0xcfd0('0x1e')][_0xcfd0('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a9108[_0xcfd0('0x1e')]?_0x3a9108['options']['where']||null:null,'attributes':_0x3a9108[_0xcfd0('0x1e')]?_0x3a9108[_0xcfd0('0x1e')]['attributes']||null:null,'limit':_0x3a9108[_0xcfd0('0x1e')]?_0x3a9108[_0xcfd0('0x1e')][_0xcfd0('0x20')]||null:null})[_0xcfd0('0x10')](function(_0x6834b1){logger[_0xcfd0('0x11')](_0xcfd0('0x1b'),_0x3a9108);logger[_0xcfd0('0x14')](_0xcfd0('0x1b'),_0x3a9108,JSON[_0xcfd0('0x16')](_0x6834b1));_0x276fa9(_0x6834b1);})[_0xcfd0('0x21')](function(_0x1fd620){logger[_0xcfd0('0x17')](_0xcfd0('0x1b'),_0x1fd620[_0xcfd0('0x19')],_0x3a9108);_0x4fff61(_0x44b866[_0xcfd0('0x17')](0x1f4,_0x1fd620[_0xcfd0('0x19')]));});});};exports['AddTagsToFaxInteraction']=function(_0x17a771){return new Promise(function(_0x28a0d3,_0x99373b){return db['FaxInteraction']['find']({'where':_0x17a771[_0xcfd0('0x1e')]?_0x17a771[_0xcfd0('0x1e')][_0xcfd0('0x22')]||null:null})[_0xcfd0('0x10')](function(_0x3304fa){if(_0x3304fa){return _0x3304fa['addTags'](_0x17a771['body'][_0xcfd0('0x23')],_[_0xcfd0('0x24')](_0x17a771[_0xcfd0('0x25')],['ids','id'])||{});}})[_0xcfd0('0x26')](function(_0x183db1){logger['info'](_0xcfd0('0x27'),_0x17a771);logger['debug'](_0xcfd0('0x27'),_0x17a771,JSON[_0xcfd0('0x16')](_0x183db1));_0x28a0d3(_0x183db1);})['catch'](function(_0x765e37){logger[_0xcfd0('0x17')](_0xcfd0('0x27'),_0x765e37['message'],_0x17a771);_0x99373b(_this[_0xcfd0('0x17')](0x1f4,_0x765e37['message']));});});}; \ No newline at end of file +var _0xf067=['spread','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','where','attributes','limit','then','AddTagsToFaxInteraction','FaxInteraction','ids','omit','body'];(function(_0x53f51e,_0xf77e9){var _0x121f92=function(_0x56cf68){while(--_0x56cf68){_0x53f51e['push'](_0x53f51e['shift']());}};_0x121f92(++_0xf77e9);}(_0xf067,0xfe));var _0x7f06=function(_0x548ddf,_0x195c3e){_0x548ddf=_0x548ddf-0x0;var _0x383c28=_0xf067[_0x548ddf];return _0x383c28;};'use strict';var _=require(_0x7f06('0x0'));var util=require(_0x7f06('0x1'));var moment=require(_0x7f06('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f06('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f06('0x4'));var logger=require(_0x7f06('0x5'))(_0x7f06('0x6'));var config=require(_0x7f06('0x7'));var jayson=require(_0x7f06('0x8'));var client=jayson[_0x7f06('0x9')][_0x7f06('0xa')]({'port':0x232a});config[_0x7f06('0xb')]=_['defaults'](config['redis'],{'host':_0x7f06('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f06('0xb')]));require(_0x7f06('0xd'))[_0x7f06('0xe')](socket);function respondWithRpcPromise(_0x334fc9,_0x49341a,_0x5b8727){return new BPromise(function(_0xd09a10,_0x4b3a0b){return client[_0x7f06('0xf')](_0x334fc9,_0x5b8727)['then'](function(_0x23602d){logger[_0x7f06('0x10')](_0x7f06('0x11'),_0x49341a,_0x7f06('0x12'));logger[_0x7f06('0x13')](_0x7f06('0x14'),_0x49341a,_0x7f06('0x12'),JSON[_0x7f06('0x15')](_0x23602d));if(_0x23602d['error']){if(_0x23602d[_0x7f06('0x16')][_0x7f06('0x17')]===0x1f4){logger[_0x7f06('0x16')](_0x7f06('0x11'),_0x49341a,_0x23602d[_0x7f06('0x16')]['message']);return _0x4b3a0b(_0x23602d['error']['message']);}logger[_0x7f06('0x16')](_0x7f06('0x11'),_0x49341a,_0x23602d['error'][_0x7f06('0x18')]);return _0xd09a10(_0x23602d[_0x7f06('0x16')][_0x7f06('0x18')]);}else{logger[_0x7f06('0x10')](_0x7f06('0x11'),_0x49341a,'request\x20sent');_0xd09a10(_0x23602d[_0x7f06('0x19')][_0x7f06('0x18')]);}})[_0x7f06('0x1a')](function(_0x313999){logger[_0x7f06('0x16')]('FaxInteraction,\x20%s,\x20%s',_0x49341a,_0x313999);_0x4b3a0b(_0x313999);});});}exports[_0x7f06('0x1b')]=function(_0x33a83f){var _0x5d38f0=this;return new Promise(function(_0x51d583,_0x2a6844){return db['FaxInteraction'][_0x7f06('0x1c')](_0x33a83f['body'],{'raw':_0x33a83f[_0x7f06('0x1d')]?_0x33a83f[_0x7f06('0x1d')][_0x7f06('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33a83f[_0x7f06('0x1d')]?_0x33a83f['options'][_0x7f06('0x1f')]||null:null,'attributes':_0x33a83f[_0x7f06('0x1d')]?_0x33a83f[_0x7f06('0x1d')][_0x7f06('0x20')]||null:null,'limit':_0x33a83f[_0x7f06('0x1d')]?_0x33a83f[_0x7f06('0x1d')][_0x7f06('0x21')]||null:null})[_0x7f06('0x22')](function(_0x2243a8){logger[_0x7f06('0x10')](_0x7f06('0x1b'),_0x33a83f);logger['debug']('UpdateFaxInteraction',_0x33a83f,JSON[_0x7f06('0x15')](_0x2243a8));_0x51d583(_0x2243a8);})[_0x7f06('0x1a')](function(_0x2a381a){logger['error'](_0x7f06('0x1b'),_0x2a381a[_0x7f06('0x18')],_0x33a83f);_0x2a6844(_0x5d38f0[_0x7f06('0x16')](0x1f4,_0x2a381a[_0x7f06('0x18')]));});});};exports[_0x7f06('0x23')]=function(_0x173e12){return new Promise(function(_0x168b7b,_0x1c3236){return db[_0x7f06('0x24')]['find']({'where':_0x173e12['options']?_0x173e12[_0x7f06('0x1d')][_0x7f06('0x1f')]||null:null})[_0x7f06('0x22')](function(_0x292163){if(_0x292163){return _0x292163['addTags'](_0x173e12['body'][_0x7f06('0x25')],_[_0x7f06('0x26')](_0x173e12[_0x7f06('0x27')],[_0x7f06('0x25'),'id'])||{});}})[_0x7f06('0x28')](function(_0x3de185){logger['info'](_0x7f06('0x29'),_0x173e12);logger[_0x7f06('0x13')]('AddTags',_0x173e12,JSON[_0x7f06('0x15')](_0x3de185));_0x168b7b(_0x3de185);})[_0x7f06('0x1a')](function(_0x5e84f2){logger['error']('AddTags',_0x5e84f2[_0x7f06('0x18')],_0x173e12);_0x1c3236(_this[_0x7f06('0x16')](0x1f4,_0x5e84f2[_0x7f06('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index c6c3d63..e172b9d 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 _0x24e8=['emit','removeListener','register','length','./faxInteraction.events','save','remove','update'];(function(_0x690cc9,_0x5c471b){var _0x37d484=function(_0x326150){while(--_0x326150){_0x690cc9['push'](_0x690cc9['shift']());}};_0x37d484(++_0x5c471b);}(_0x24e8,0x1a4));var _0x824e=function(_0x119e7a,_0x3949d3){_0x119e7a=_0x119e7a-0x0;var _0x1fb90a=_0x24e8[_0x119e7a];return _0x1fb90a;};'use strict';var FaxInteractionEvents=require(_0x824e('0x0'));var events=[_0x824e('0x1'),_0x824e('0x2'),_0x824e('0x3')];function createListener(_0xbc29e4,_0x3183c6){return function(_0x50a119){_0x3183c6[_0x824e('0x4')](_0xbc29e4,_0x50a119);};}function removeListener(_0x541ffe,_0x40015d){return function(){FaxInteractionEvents[_0x824e('0x5')](_0x541ffe,_0x40015d);};}exports[_0x824e('0x6')]=function(_0x8a07d){for(var _0xaebea1=0x0,_0x3d9e52=events[_0x824e('0x7')];_0xaebea1<_0x3d9e52;_0xaebea1++){var _0x3c7f51=events[_0xaebea1];var _0x554343=createListener('faxInteraction:'+_0x3c7f51,_0x8a07d);FaxInteractionEvents['on'](_0x3c7f51,_0x554343);}}; \ No newline at end of file +var _0x025d=['faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register','length'];(function(_0x230795,_0x28dd64){var _0x2893b3=function(_0x1b5436){while(--_0x1b5436){_0x230795['push'](_0x230795['shift']());}};_0x2893b3(++_0x28dd64);}(_0x025d,0x1d5));var _0xd025=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x025d[_0x20a584];return _0x4b41a8;};'use strict';var FaxInteractionEvents=require(_0xd025('0x0'));var events=[_0xd025('0x1'),_0xd025('0x2'),_0xd025('0x3')];function createListener(_0x124400,_0x3f7159){return function(_0xe160c1){_0x3f7159[_0xd025('0x4')](_0x124400,_0xe160c1);};}function removeListener(_0x5585f9,_0x5addcb){return function(){FaxInteractionEvents[_0xd025('0x5')](_0x5585f9,_0x5addcb);};}exports[_0xd025('0x6')]=function(_0xf5244b){for(var _0x1f73d1=0x0,_0x2d42f5=events[_0xd025('0x7')];_0x1f73d1<_0x2d42f5;_0x1f73d1++){var _0x2b9632=events[_0x1f73d1];var _0x5c838e=createListener(_0xd025('0x8')+_0x2b9632,_0xf5244b);FaxInteractionEvents['on'](_0x2b9632,_0x5c838e);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index ee50faa..3187c01 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 _0xa69d=['isAuthenticated','index','/describe','describe','/:id','show','getMessages','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get'];(function(_0x3f22e8,_0x37732a){var _0x368a7e=function(_0x35f538){while(--_0x35f538){_0x3f22e8['push'](_0x3f22e8['shift']());}};_0x368a7e(++_0x37732a);}(_0xa69d,0x15d));var _0xda69=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa69d[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0xda69('0x0'));var util=require(_0xda69('0x1'));var path=require(_0xda69('0x2'));var timeout=require(_0xda69('0x3'));var express=require('express');var router=express[_0xda69('0x4')]();var fs_extra=require(_0xda69('0x5'));var auth=require(_0xda69('0x6'));var interaction=require(_0xda69('0x7'));var config=require(_0xda69('0x8'));var controller=require(_0xda69('0x9'));router[_0xda69('0xa')]('/',auth[_0xda69('0xb')](),controller[_0xda69('0xc')]);router['get'](_0xda69('0xd'),auth[_0xda69('0xb')](),controller[_0xda69('0xe')]);router[_0xda69('0xa')](_0xda69('0xf'),auth['isAuthenticated'](),controller[_0xda69('0x10')]);router[_0xda69('0xa')]('/:id/messages',auth['isAuthenticated'](),controller[_0xda69('0x11')]);router['get']('/:id/download',auth[_0xda69('0xb')](),controller[_0xda69('0x12')]);router[_0xda69('0x13')]('/',auth[_0xda69('0xb')](),controller[_0xda69('0x14')]);router[_0xda69('0x13')](_0xda69('0x15'),auth['isAuthenticated'](),controller[_0xda69('0x16')]);router[_0xda69('0x13')](_0xda69('0x17'),auth[_0xda69('0xb')](),interaction[_0xda69('0x18')](_0xda69('0x19'),_0xda69('0x1a')),controller[_0xda69('0x1b')]);router[_0xda69('0x1c')](_0xda69('0xf'),auth['isAuthenticated'](),interaction[_0xda69('0x18')](_0xda69('0x19'),_0xda69('0x1d')),controller[_0xda69('0x1e')]);router[_0xda69('0x1f')](_0xda69('0xf'),auth[_0xda69('0xb')](),interaction['tracked'](_0xda69('0x19'),_0xda69('0x20')),controller[_0xda69('0x21')]);router['delete'](_0xda69('0x17'),auth[_0xda69('0xb')](),controller[_0xda69('0x22')]);module[_0xda69('0x23')]=router; \ No newline at end of file +var _0xdcee=['put','/:id','faxinteraction:update','delete','faxinteraction:destroy','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','fax','faxinteraction:addtags','addTags'];(function(_0x9b82b8,_0x1d3d63){var _0x353562=function(_0x42a8a6){while(--_0x42a8a6){_0x9b82b8['push'](_0x9b82b8['shift']());}};_0x353562(++_0x1d3d63);}(_0xdcee,0x15b));var _0xedce=function(_0x3b594b,_0x5835c3){_0x3b594b=_0x3b594b-0x0;var _0x1ea5f8=_0xdcee[_0x3b594b];return _0x1ea5f8;};'use strict';var multer=require(_0xedce('0x0'));var util=require('util');var path=require(_0xedce('0x1'));var timeout=require(_0xedce('0x2'));var express=require(_0xedce('0x3'));var router=express[_0xedce('0x4')]();var fs_extra=require(_0xedce('0x5'));var auth=require(_0xedce('0x6'));var interaction=require(_0xedce('0x7'));var config=require(_0xedce('0x8'));var controller=require('./faxInteraction.controller');router[_0xedce('0x9')]('/',auth[_0xedce('0xa')](),controller[_0xedce('0xb')]);router[_0xedce('0x9')](_0xedce('0xc'),auth[_0xedce('0xa')](),controller[_0xedce('0xd')]);router[_0xedce('0x9')]('/:id',auth[_0xedce('0xa')](),controller[_0xedce('0xe')]);router[_0xedce('0x9')](_0xedce('0xf'),auth[_0xedce('0xa')](),controller[_0xedce('0x10')]);router[_0xedce('0x9')](_0xedce('0x11'),auth[_0xedce('0xa')](),controller[_0xedce('0x12')]);router[_0xedce('0x13')]('/',auth[_0xedce('0xa')](),controller[_0xedce('0x14')]);router[_0xedce('0x13')](_0xedce('0xf'),auth[_0xedce('0xa')](),controller[_0xedce('0x15')]);router[_0xedce('0x13')](_0xedce('0x16'),auth[_0xedce('0xa')](),interaction[_0xedce('0x17')](_0xedce('0x18'),_0xedce('0x19')),controller[_0xedce('0x1a')]);router[_0xedce('0x1b')](_0xedce('0x1c'),auth[_0xedce('0xa')](),interaction[_0xedce('0x17')](_0xedce('0x18'),_0xedce('0x1d')),controller['update']);router[_0xedce('0x1e')]('/:id',auth['isAuthenticated'](),interaction['tracked']('fax',_0xedce('0x1f')),controller[_0xedce('0x20')]);router[_0xedce('0x1e')](_0xedce('0x16'),auth[_0xedce('0xa')](),controller['removeTags']);module[_0xedce('0x21')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 6a3dd3d..cd1c425 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 _0x7341=['ENUM','out','DATE','TEXT','BOOLEAN'];(function(_0x3c4702,_0x315207){var _0x186a83=function(_0x5a2786){while(--_0x5a2786){_0x3c4702['push'](_0x3c4702['shift']());}};_0x186a83(++_0x315207);}(_0x7341,0xe4));var _0x1734=function(_0x5539db,_0x122be5){_0x5539db=_0x5539db-0x0;var _0x5b8aed=_0x7341[_0x5539db];return _0x5b8aed;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x1734('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x1734('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1734('0x2')]('in','out'),'defaultValue':_0x1734('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x1734('0x0')],'defaultValue':null},'readAt':{'type':Sequelize[_0x1734('0x4')]}}; \ No newline at end of file +var _0xe14d=['medium','ENUM','out','DATE','sequelize','exports','TEXT'];(function(_0x18b191,_0x4e0684){var _0x43e146=function(_0x4b464e){while(--_0x4b464e){_0x18b191['push'](_0x18b191['shift']());}};_0x43e146(++_0x4e0684);}(_0xe14d,0x1ee));var _0xde14=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xe14d[_0x45e98e];return _0x374dba;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'body':{'type':Sequelize[_0xde14('0x2')](_0xde14('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xde14('0x4')]('in',_0xde14('0x5')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xde14('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xde14('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 1619e95..6be30da 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 _0xc875=['count','offset','set','apply','update','then','end','stack','name','send','index','FaxMessage','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','where','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','keys','find','body','destroy','describe','fax-interactions','fax','read','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','format','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','Sequelize','QueryTypes','contact','User','fullname','manual','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','internal','interface','event','rejectmessage','create','CmContact','isNil','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','join','server','files','attachments','basename','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','undefined'];(function(_0x3accdd,_0x299365){var _0x36f49d=function(_0x31eb47){while(--_0x31eb47){_0x3accdd['push'](_0x3accdd['shift']());}};_0x36f49d(++_0x299365);}(_0xc875,0x171));var _0x5c87=function(_0x1c8432,_0x682488){_0x1c8432=_0x1c8432-0x0;var _0x5492a1=_0xc875[_0x1c8432];return _0x5492a1;};'use strict';var emlformat=require(_0x5c87('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c87('0x1'));var jsonpatch=require(_0x5c87('0x2'));var rp=require('request-promise');var moment=require(_0x5c87('0x3'));var BPromise=require(_0x5c87('0x4'));var Mustache=require('mustache');var util=require(_0x5c87('0x5'));var path=require(_0x5c87('0x6'));var sox=require(_0x5c87('0x7'));var csv=require(_0x5c87('0x8'));var ejs=require(_0x5c87('0x9'));var fs=require('fs');var fs_extra=require(_0x5c87('0xa'));var _=require(_0x5c87('0xb'));var squel=require(_0x5c87('0xc'));var crypto=require('crypto');var jsforce=require(_0x5c87('0xd'));var deskjs=require(_0x5c87('0xe'));var toCsv=require(_0x5c87('0x8'));var querystring=require(_0x5c87('0xf'));var Papa=require(_0x5c87('0x10'));var Redis=require(_0x5c87('0x11'));var authService=require(_0x5c87('0x12'));var qs=require(_0x5c87('0x13'));var as=require(_0x5c87('0x14'));var hardwareService=require(_0x5c87('0x15'));var logger=require(_0x5c87('0x16'))(_0x5c87('0x17'));var utils=require('../../config/utils');var config=require(_0x5c87('0x18'));var licenseUtil=require(_0x5c87('0x19'));var db=require(_0x5c87('0x1a'))['db'];config[_0x5c87('0x1b')]=_['defaults'](config['redis'],{'host':_0x5c87('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c87('0x1d'))[_0x5c87('0x1e')](socket);var jayson=require(_0x5c87('0x1f'));var client=jayson[_0x5c87('0x20')][_0x5c87('0x21')]({'port':0x232c});var client9002=jayson[_0x5c87('0x20')][_0x5c87('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x371e31,_0x2d520b,_0x3c7149,_0xa6f120){return new BPromise(function(_0x3105b0,_0x23d5c6){var _0x5518e6=_0xa6f120||client;return _0x5518e6[_0x5c87('0x22')](_0x371e31,_0x3c7149)['then'](function(_0x15b35c){logger[_0x5c87('0x23')](_0x5c87('0x24'),_0x2d520b,_0x5c87('0x25'));logger[_0x5c87('0x26')](_0x5c87('0x27'),_0x2d520b,'request\x20sent',JSON[_0x5c87('0x28')](_0x15b35c));if(_0x15b35c['error']){if(_0x15b35c[_0x5c87('0x29')]['code']===0x1f4){logger[_0x5c87('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2d520b,_0x15b35c['error'][_0x5c87('0x2a')]);return _0x23d5c6(_0x15b35c[_0x5c87('0x29')][_0x5c87('0x2a')]);}logger[_0x5c87('0x29')](_0x5c87('0x24'),_0x2d520b,_0x15b35c[_0x5c87('0x29')]['message']);return _0x3105b0(_0x15b35c[_0x5c87('0x29')][_0x5c87('0x2a')]);}else{logger[_0x5c87('0x23')]('FaxMessage,\x20%s,\x20%s',_0x2d520b,_0x5c87('0x25'));_0x3105b0(_0x15b35c['result'][_0x5c87('0x2a')]);}})[_0x5c87('0x2b')](function(_0x44d752){logger[_0x5c87('0x29')]('FaxMessage,\x20%s,\x20%s',_0x2d520b,_0x44d752);_0x23d5c6(_0x44d752);});});}function respondWithStatusCode(_0x281350,_0x5220e2){_0x5220e2=_0x5220e2||0xcc;return function(_0x23d00e){if(_0x23d00e){return _0x281350[_0x5c87('0x2c')](_0x5220e2);}return _0x281350[_0x5c87('0x2d')](_0x5220e2)['end']();};}function respondWithResult(_0x116999,_0xc62b8e){_0xc62b8e=_0xc62b8e||0xc8;return function(_0x43432d){if(_0x43432d){return _0x116999[_0x5c87('0x2d')](_0xc62b8e)[_0x5c87('0x2e')](_0x43432d);}};}function respondWithFilteredResult(_0x3cb683,_0x292161){return function(_0x449d49){if(_0x449d49){var _0x3eac29=typeof _0x292161['offset']===_0x5c87('0x2f')&&typeof _0x292161['limit']===_0x5c87('0x2f');var _0x178fbd=_0x449d49[_0x5c87('0x30')];var _0x158315=_0x3eac29?0x0:_0x292161[_0x5c87('0x31')];var _0x5dbdd1=_0x3eac29?_0x449d49[_0x5c87('0x30')]:_0x292161['offset']+_0x292161['limit'];var _0x5f2f9d;if(_0x5dbdd1>=_0x178fbd){_0x5dbdd1=_0x178fbd;_0x5f2f9d=0xc8;}else{_0x5f2f9d=0xce;}_0x3cb683[_0x5c87('0x2d')](_0x5f2f9d);return _0x3cb683[_0x5c87('0x32')]('Content-Range',_0x158315+'-'+_0x5dbdd1+'/'+_0x178fbd)[_0x5c87('0x2e')](_0x449d49);}return null;};}function patchUpdates(_0x4a5d8b){return function(_0x4b915a){try{jsonpatch[_0x5c87('0x33')](_0x4b915a,_0x4a5d8b,!![]);}catch(_0x228fa5){return BPromise['reject'](_0x228fa5);}return _0x4b915a['save']();};}function saveUpdates(_0x58c141,_0x290c88){return function(_0x3a0420){if(_0x3a0420){return _0x3a0420[_0x5c87('0x34')](_0x58c141)[_0x5c87('0x35')](function(_0x2e29e4){return _0x2e29e4;});}return null;};}function removeEntity(_0x5b95a5,_0x1eecc5){return function(_0x3d44e2){if(_0x3d44e2){return _0x3d44e2['destroy']()[_0x5c87('0x35')](function(){_0x5b95a5[_0x5c87('0x2d')](0xcc)[_0x5c87('0x36')]();});}};}function handleEntityNotFound(_0x19a52,_0x42f07c){return function(_0x3378bb){if(!_0x3378bb){_0x19a52[_0x5c87('0x2c')](0x194);}return _0x3378bb;};}function handleError(_0x31815a,_0x56c91d){_0x56c91d=_0x56c91d||0x1f4;return function(_0xd1c185){logger[_0x5c87('0x29')](_0xd1c185[_0x5c87('0x37')]);if(_0xd1c185['name']){delete _0xd1c185[_0x5c87('0x38')];}_0x31815a['status'](_0x56c91d)[_0x5c87('0x39')](_0xd1c185);};}exports[_0x5c87('0x3a')]=function(_0x2dd77a,_0x50675f){var _0xcacb2e={},_0xb78159={},_0x435fea={'count':0x0,'rows':[]};var _0x4854c7=_['map'](db[_0x5c87('0x3b')]['rawAttributes'],function(_0x460857){return{'name':_0x460857[_0x5c87('0x3c')],'type':_0x460857[_0x5c87('0x3d')][_0x5c87('0x3e')]};});_0xb78159[_0x5c87('0x3f')]=_[_0x5c87('0x40')](_0x4854c7,_0x5c87('0x38'));_0xb78159[_0x5c87('0x41')]=_['keys'](_0x2dd77a[_0x5c87('0x41')]);_0xb78159[_0x5c87('0x42')]=_['intersection'](_0xb78159['model'],_0xb78159['query']);_0xcacb2e['attributes']=_[_0x5c87('0x43')](_0xb78159[_0x5c87('0x3f')],qs[_0x5c87('0x44')](_0x2dd77a[_0x5c87('0x41')]['fields']));_0xcacb2e[_0x5c87('0x45')]=_0xcacb2e[_0x5c87('0x45')][_0x5c87('0x46')]?_0xcacb2e[_0x5c87('0x45')]:_0xb78159[_0x5c87('0x3f')];if(!_0x2dd77a[_0x5c87('0x41')][_0x5c87('0x47')]('nolimit')){_0xcacb2e['limit']=qs[_0x5c87('0x48')](_0x2dd77a[_0x5c87('0x41')][_0x5c87('0x48')]);_0xcacb2e[_0x5c87('0x31')]=qs[_0x5c87('0x31')](_0x2dd77a['query'][_0x5c87('0x31')]);}_0xcacb2e['order']=qs[_0x5c87('0x49')](_0x2dd77a[_0x5c87('0x41')][_0x5c87('0x49')]);_0xcacb2e[_0x5c87('0x4a')]=qs[_0x5c87('0x42')](_['pick'](_0x2dd77a[_0x5c87('0x41')],_0xb78159[_0x5c87('0x42')]),_0x4854c7);if(_0x2dd77a[_0x5c87('0x41')][_0x5c87('0x4b')]){_0xcacb2e[_0x5c87('0x4a')]=_[_0x5c87('0x4c')](_0xcacb2e['where'],{'$or':_[_0x5c87('0x40')](_0x4854c7,function(_0x3e3978){if(_0x3e3978[_0x5c87('0x3d')]!=='VIRTUAL'){var _0xa0718f={};_0xa0718f[_0x3e3978[_0x5c87('0x38')]]={'$like':'%'+_0x2dd77a[_0x5c87('0x41')]['filter']+'%'};return _0xa0718f;}})});}_0xcacb2e=_[_0x5c87('0x4c')]({},_0xcacb2e,_0x2dd77a[_0x5c87('0x4d')]);var _0x549e06={'where':_0xcacb2e[_0x5c87('0x4a')]};return db['FaxMessage'][_0x5c87('0x30')](_0x549e06)[_0x5c87('0x35')](function(_0x16f7fc){_0x435fea[_0x5c87('0x30')]=_0x16f7fc;if(_0x2dd77a['query'][_0x5c87('0x4e')]){_0xcacb2e[_0x5c87('0x4f')]=[{'all':!![]}];}return db[_0x5c87('0x3b')][_0x5c87('0x50')](_0xcacb2e);})[_0x5c87('0x35')](function(_0x596a6f){_0x435fea['rows']=_0x596a6f;return _0x435fea;})[_0x5c87('0x35')](respondWithFilteredResult(_0x50675f,_0xcacb2e))[_0x5c87('0x2b')](handleError(_0x50675f,null));};exports[_0x5c87('0x51')]=function(_0x4266ab,_0x496a37){var _0x3c7c13={'raw':!![],'where':{'id':_0x4266ab[_0x5c87('0x52')]['id']}},_0x19af71={};_0x19af71[_0x5c87('0x3f')]=_['keys'](db[_0x5c87('0x3b')][_0x5c87('0x53')]);_0x19af71[_0x5c87('0x41')]=_[_0x5c87('0x54')](_0x4266ab['query']);_0x19af71[_0x5c87('0x42')]=_[_0x5c87('0x43')](_0x19af71[_0x5c87('0x3f')],_0x19af71[_0x5c87('0x41')]);_0x3c7c13['attributes']=_[_0x5c87('0x43')](_0x19af71[_0x5c87('0x3f')],qs[_0x5c87('0x44')](_0x4266ab[_0x5c87('0x41')][_0x5c87('0x44')]));_0x3c7c13[_0x5c87('0x45')]=_0x3c7c13[_0x5c87('0x45')][_0x5c87('0x46')]?_0x3c7c13[_0x5c87('0x45')]:_0x19af71[_0x5c87('0x3f')];if(_0x4266ab[_0x5c87('0x41')]['includeAll']){_0x3c7c13[_0x5c87('0x4f')]=[{'all':!![]}];}_0x3c7c13=_['merge']({},_0x3c7c13,_0x4266ab[_0x5c87('0x4d')]);return db['FaxMessage'][_0x5c87('0x55')](_0x3c7c13)[_0x5c87('0x35')](handleEntityNotFound(_0x496a37,null))[_0x5c87('0x35')](respondWithResult(_0x496a37,null))[_0x5c87('0x2b')](handleError(_0x496a37,null));};exports[_0x5c87('0x34')]=function(_0x38a571,_0x19902d){if(_0x38a571['body']['id']){delete _0x38a571[_0x5c87('0x56')]['id'];}return db[_0x5c87('0x3b')]['find']({'where':{'id':_0x38a571[_0x5c87('0x52')]['id']}})[_0x5c87('0x35')](handleEntityNotFound(_0x19902d,null))[_0x5c87('0x35')](saveUpdates(_0x38a571[_0x5c87('0x56')],null))['then'](respondWithResult(_0x19902d,null))['catch'](handleError(_0x19902d,null));};exports[_0x5c87('0x57')]=function(_0x215354,_0x152e77){return db[_0x5c87('0x3b')][_0x5c87('0x55')]({'where':{'id':_0x215354[_0x5c87('0x52')]['id']}})[_0x5c87('0x35')](handleEntityNotFound(_0x152e77,null))['then'](removeEntity(_0x152e77,null))[_0x5c87('0x2b')](handleError(_0x152e77,null));};exports[_0x5c87('0x58')]=function(_0x542739,_0x5eef0e){return db['FaxMessage'][_0x5c87('0x58')]()[_0x5c87('0x35')](respondWithResult(_0x5eef0e,null))[_0x5c87('0x2b')](handleError(_0x5eef0e,null));};var interaction_log=require('../../config/logger')(_0x5c87('0x59'));exports['accept']=function(_0x501767,_0x3478ac,_0x594087){var _0x22e4ce={'agent':{},'channel':_0x5c87('0x5a')};if(_0x501767[_0x5c87('0x56')]['id']){delete _0x501767[_0x5c87('0x56')]['id'];}_0x501767[_0x5c87('0x56')][_0x5c87('0x5b')]=!![];_0x501767['body'][_0x5c87('0x5c')]=moment()['format'](_0x5c87('0x5d'));_0x501767[_0x5c87('0x56')]['UserId']=_0x501767[_0x5c87('0x56')][_0x5c87('0x5e')]||_0x501767[_0x5c87('0x5f')]['id'];_0x22e4ce[_0x5c87('0x60')]['id']=_0x501767[_0x5c87('0x56')][_0x5c87('0x5e')];return db[_0x5c87('0x3b')][_0x5c87('0x55')]({'where':{'id':_0x501767[_0x5c87('0x52')]['id'],'UserId':null}})[_0x5c87('0x35')](handleEntityNotFound(_0x3478ac,null))[_0x5c87('0x35')](saveUpdates(_0x501767[_0x5c87('0x56')],null))['then'](function(_0x52d01b){if(_0x52d01b){_0x22e4ce['message']=_0x52d01b[_0x5c87('0x61')]({'plain':!![]});return db[_0x5c87('0x62')][_0x5c87('0x55')]({'where':{'id':_0x52d01b[_0x5c87('0x63')]}});}return null;})[_0x5c87('0x35')](handleEntityNotFound(_0x3478ac,null))['then'](function(_0x37cab4){if(_0x37cab4){return _0x37cab4[_0x5c87('0x34')]({'UserId':_0x501767['body'][_0x5c87('0x5e')],'read1stAt':_['isNil'](_0x37cab4['read1stAt'])?moment()[_0x5c87('0x64')](_0x5c87('0x5d')):undefined});}return null;})[_0x5c87('0x35')](function(_0x2c7b88){if(_0x2c7b88){_0x22e4ce[_0x5c87('0x65')]=_0x2c7b88['get']({'plain':!![]});interaction_log[_0x5c87('0x23')](_0x5c87('0x66'),_0x501767['user']['id'],_0x501767[_0x5c87('0x5f')][_0x5c87('0x38')],_0x501767[_0x5c87('0x5f')][_0x5c87('0x67')],_0x22e4ce[_0x5c87('0x65')]['id'],_0x501767['body']?JSON[_0x5c87('0x28')](_0x501767[_0x5c87('0x56')]):_0x5c87('0x68'));return respondWithRpcPromise('AcceptMessage',_0x5c87('0x69'),_0x22e4ce);}return null;})[_0x5c87('0x35')](function(_0x31f9ed){var _0x2cc207='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x31f9ed[_0x5c87('0x2a')][_0x5c87('0x6a')];return db['sequelize']['query'](_0x2cc207,{'type':db[_0x5c87('0x6b')][_0x5c87('0x6c')]['SELECT'],'raw':!![]})[_0x5c87('0x35')](function(_0x2be114){return _0x2be114;});})[_0x5c87('0x35')](function(_0x3556b2){if(_0x3556b2){_0x22e4ce[_0x5c87('0x2a')][_0x5c87('0x6d')]=_0x3556b2[0x0];if(!_0x501767[_0x5c87('0x56')]['UserId'])return;return db[_0x5c87('0x6e')][_0x5c87('0x55')]({'where':{'id':_0x501767[_0x5c87('0x56')][_0x5c87('0x5e')],'role':_0x5c87('0x60')},'attributes':['id',_0x5c87('0x38'),_0x5c87('0x6f'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x39ce5c){if(!_0x39ce5c)return null;_0x22e4ce[_0x5c87('0x2a')][_0x5c87('0x60')]=_0x39ce5c;return _0x22e4ce;})['then'](function(_0x68b61a){if(_0x68b61a){if(_0x501767[_0x5c87('0x56')][_0x5c87('0x70')]){_0x22e4ce['message']['interface']=util[_0x5c87('0x64')](_0x5c87('0x71'),_0x501767['user'][_0x5c87('0x38')]);_0x22e4ce[_0x5c87('0x2a')][_0x5c87('0x72')]=_0x22e4ce['channel'];_0x22e4ce[_0x5c87('0x2a')][_0x5c87('0x73')]=_0x22e4ce[_0x5c87('0x72')];_0x22e4ce['message']['event']='accept';return respondWithRpcPromise('EventManager',_0x5c87('0x74'),{'event':_0x5c87('0x75'),'message':_0x22e4ce[_0x5c87('0x2a')]},client9002)[_0x5c87('0x35')](function(){return _0x22e4ce;});}return _0x22e4ce;}return null;})[_0x5c87('0x35')](respondWithResult(_0x3478ac,null))['catch'](handleError(_0x3478ac,null));};var interaction_log=require(_0x5c87('0x16'))(_0x5c87('0x59'));exports[_0x5c87('0x76')]=function(_0xf2dc0b,_0xf9fd54,_0xe0f7c7){var _0x1d9fee={'agent':{},'channel':_0x5c87('0x5a')};if(_0xf2dc0b[_0x5c87('0x56')]['id']){delete _0xf2dc0b['body']['id'];}_0xf2dc0b[_0x5c87('0x56')][_0x5c87('0x5e')]=_0xf2dc0b[_0x5c87('0x56')]['UserId']||_0xf2dc0b[_0x5c87('0x5f')]['id'];_0x1d9fee[_0x5c87('0x60')]['id']=_0xf2dc0b[_0x5c87('0x56')][_0x5c87('0x5e')];return db[_0x5c87('0x3b')][_0x5c87('0x55')]({'where':{'id':_0xf2dc0b[_0x5c87('0x52')]['id'],'UserId':null}})[_0x5c87('0x35')](handleEntityNotFound(_0xf9fd54,null))['then'](function(_0x44889f){if(_0x44889f){_0x1d9fee[_0x5c87('0x2a')]=_0x44889f[_0x5c87('0x61')]({'plain':!![]});return db[_0x5c87('0x62')][_0x5c87('0x55')]({'where':{'id':_0x44889f[_0x5c87('0x63')]}});}return null;})[_0x5c87('0x35')](handleEntityNotFound(_0xf9fd54,null))[_0x5c87('0x35')](function(_0x2a6fc4){if(_0x2a6fc4){_0x1d9fee[_0x5c87('0x65')]=_0x2a6fc4[_0x5c87('0x61')]({'plain':!![]});interaction_log[_0x5c87('0x23')]('[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xf2dc0b[_0x5c87('0x5f')]['id'],_0xf2dc0b[_0x5c87('0x5f')][_0x5c87('0x38')],_0xf2dc0b[_0x5c87('0x5f')][_0x5c87('0x67')],_0x1d9fee[_0x5c87('0x65')]['id'],_0xf2dc0b[_0x5c87('0x56')]?JSON[_0x5c87('0x28')](_0xf2dc0b[_0x5c87('0x56')]):_0x5c87('0x68'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1d9fee);}return null;})[_0x5c87('0x35')](function(_0x2583a){var _0x587aae=_0x5c87('0x77')+_0x2583a[_0x5c87('0x2a')]['ContactId'];return db[_0x5c87('0x78')][_0x5c87('0x41')](_0x587aae,{'type':db[_0x5c87('0x6b')][_0x5c87('0x6c')][_0x5c87('0x79')],'raw':!![]})['then'](function(_0x306676){return _0x306676;});})[_0x5c87('0x35')](function(_0x5c515f){if(_0x5c515f){_0x1d9fee['message']['contact']=_0x5c515f[0x0];if(!_0xf2dc0b[_0x5c87('0x56')][_0x5c87('0x5e')])return;return db[_0x5c87('0x6e')][_0x5c87('0x55')]({'where':{'id':_0xf2dc0b[_0x5c87('0x56')][_0x5c87('0x5e')],'role':'agent'},'attributes':['id',_0x5c87('0x38'),_0x5c87('0x6f'),'email',_0x5c87('0x7a')],'raw':!![]});}return null;})[_0x5c87('0x35')](function(_0x22e5b5){if(!_0x22e5b5)return null;_0x1d9fee[_0x5c87('0x2a')]['agent']=_0x22e5b5;return _0x1d9fee;})[_0x5c87('0x35')](function(_0x195241){if(_0x195241){_0x195241[_0x5c87('0x2a')][_0x5c87('0x7b')]=util['format'](_0x5c87('0x71'),_0xf2dc0b[_0x5c87('0x5f')][_0x5c87('0x38')]);_0x195241[_0x5c87('0x2a')][_0x5c87('0x72')]=_0x1d9fee[_0x5c87('0x72')];_0x195241[_0x5c87('0x2a')][_0x5c87('0x73')]=_0x1d9fee[_0x5c87('0x72')];_0x195241[_0x5c87('0x2a')][_0x5c87('0x7c')]='reject';respondWithRpcPromise(_0x5c87('0x74'),_0x5c87('0x74'),{'event':_0x5c87('0x7d'),'message':_0x195241[_0x5c87('0x2a')]},client9002);return _0x1d9fee;}return null;})['then'](respondWithResult(_0xf9fd54,null))[_0x5c87('0x2b')](handleError(_0xf9fd54,null));};exports['create']=function(_0x25e4dc,_0x15b60c){var _0x9dbf03;return db[_0x5c87('0x3b')][_0x5c87('0x7e')](_0x25e4dc['body'],{})[_0x5c87('0x35')](function(_0x5ac362){_0x9dbf03=_0x5ac362;return db[_0x5c87('0x7f')]['findOne']({'where':{'id':_0x9dbf03[_0x5c87('0x6a')]}});})[_0x5c87('0x35')](function(_0x3eed4b){if(_[_0x5c87('0x80')](_0x3eed4b)){return;}else{_0x9dbf03[_0x5c87('0x5a')]=_0x3eed4b['fax'];return db[_0x5c87('0x81')]['findOne']({'where':{'id':_0x9dbf03[_0x5c87('0x82')]}});}})['then'](function(_0x22b1b5){return respondWithRpcPromise(_0x5c87('0x83'),'SendFax',{'FaxAccountId':_['isNil'](_0x25e4dc[_0x5c87('0x56')])?undefined:_0x25e4dc[_0x5c87('0x56')][_0x5c87('0x84')],'path':_['isNil'](_0x22b1b5)?undefined:util[_0x5c87('0x64')](_0x5c87('0x85'),_0x22b1b5['basename']),'fax':_[_0x5c87('0x80')](_0x9dbf03[_0x5c87('0x5a')])?undefined:_0x9dbf03['fax'],'AttachmentId':_0x9dbf03[_0x5c87('0x82')]},client9002);})[_0x5c87('0x35')](respondWithResult(_0x15b60c,0xc9))[_0x5c87('0x2b')](handleError(_0x15b60c,null));};exports['download']=function(_0x530cab,_0x4e0c8e){var _0x1328b6=path[_0x5c87('0x86')](config['root'],_0x5c87('0x87'),_0x5c87('0x88'),_0x5c87('0x89'));return db[_0x5c87('0x3b')][_0x5c87('0x55')]({'where':{'id':_0x530cab['params']['id']},'include':[{'model':db['Attachment'],'as':_0x5c87('0x81')}]})[_0x5c87('0x35')](handleEntityNotFound(_0x4e0c8e,null))[_0x5c87('0x35')](function(_0x228742){if(_0x228742){return _0x4e0c8e['download'](path['join'](_0x1328b6,_0x228742[_0x5c87('0x81')][_0x5c87('0x8a')]));}})['catch'](handleError(_0x4e0c8e,null));}; \ No newline at end of file +var _0x36d9=['jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./faxMessage.socket','register','jayson/promise','client','http','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','name','send','index','map','FaxMessage','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','show','find','update','body','params','describe','fax-interactions','fax','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','FaxInteraction','FaxInteractionId','isNil','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','channel','motionChannel','event','accept','EventManager','acceptmessage','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','fullname','SIP/%s','create','findOne','Attachment','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','files','attachments','eml-format','rimraf','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','squel'];(function(_0x32227a,_0x2af966){var _0x76e698=function(_0x2b9d3b){while(--_0x2b9d3b){_0x32227a['push'](_0x32227a['shift']());}};_0x76e698(++_0x2af966);}(_0x36d9,0x80));var _0x936d=function(_0x51715b,_0xe852a9){_0x51715b=_0x51715b-0x0;var _0x3ba2e2=_0x36d9[_0x51715b];return _0x3ba2e2;};'use strict';var emlformat=require(_0x936d('0x0'));var rimraf=require(_0x936d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x936d('0x2'));var rp=require(_0x936d('0x3'));var moment=require(_0x936d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x936d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x936d('0x6'));var ejs=require(_0x936d('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x936d('0x8'));var squel=require(_0x936d('0x9'));var crypto=require('crypto');var jsforce=require(_0x936d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x936d('0x6'));var querystring=require('querystring');var Papa=require(_0x936d('0xb'));var Redis=require('ioredis');var authService=require(_0x936d('0xc'));var qs=require(_0x936d('0xd'));var as=require(_0x936d('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x936d('0xf'))(_0x936d('0x10'));var utils=require(_0x936d('0x11'));var config=require(_0x936d('0x12'));var licenseUtil=require(_0x936d('0x13'));var db=require(_0x936d('0x14'))['db'];config['redis']=_[_0x936d('0x15')](config[_0x936d('0x16')],{'host':_0x936d('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x936d('0x16')]));require(_0x936d('0x18'))[_0x936d('0x19')](socket);var jayson=require(_0x936d('0x1a'));var client=jayson[_0x936d('0x1b')][_0x936d('0x1c')]({'port':0x232c});var client9002=jayson[_0x936d('0x1b')][_0x936d('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x9ab9fc,_0x5dcf94,_0x732379,_0x5d0503){return new BPromise(function(_0x587ef1,_0x249b44){var _0x174a6d=_0x5d0503||client;return _0x174a6d[_0x936d('0x1d')](_0x9ab9fc,_0x732379)[_0x936d('0x1e')](function(_0x50d351){logger[_0x936d('0x1f')](_0x936d('0x20'),_0x5dcf94,_0x936d('0x21'));logger[_0x936d('0x22')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5dcf94,_0x936d('0x21'),JSON['stringify'](_0x50d351));if(_0x50d351[_0x936d('0x23')]){if(_0x50d351[_0x936d('0x23')][_0x936d('0x24')]===0x1f4){logger[_0x936d('0x23')](_0x936d('0x20'),_0x5dcf94,_0x50d351[_0x936d('0x23')]['message']);return _0x249b44(_0x50d351[_0x936d('0x23')][_0x936d('0x25')]);}logger['error'](_0x936d('0x20'),_0x5dcf94,_0x50d351[_0x936d('0x23')][_0x936d('0x25')]);return _0x587ef1(_0x50d351[_0x936d('0x23')][_0x936d('0x25')]);}else{logger['info'](_0x936d('0x20'),_0x5dcf94,_0x936d('0x21'));_0x587ef1(_0x50d351['result']['message']);}})[_0x936d('0x26')](function(_0x3e61fd){logger[_0x936d('0x23')]('FaxMessage,\x20%s,\x20%s',_0x5dcf94,_0x3e61fd);_0x249b44(_0x3e61fd);});});}function respondWithStatusCode(_0x1aa234,_0x535562){_0x535562=_0x535562||0xcc;return function(_0x546ec5){if(_0x546ec5){return _0x1aa234[_0x936d('0x27')](_0x535562);}return _0x1aa234[_0x936d('0x28')](_0x535562)[_0x936d('0x29')]();};}function respondWithResult(_0x2290be,_0x58b0c2){_0x58b0c2=_0x58b0c2||0xc8;return function(_0x558b64){if(_0x558b64){return _0x2290be[_0x936d('0x28')](_0x58b0c2)[_0x936d('0x2a')](_0x558b64);}};}function respondWithFilteredResult(_0x4f9901,_0x35524b){return function(_0x309c4b){if(_0x309c4b){var _0x3d5fe4=typeof _0x35524b['offset']==='undefined'&&typeof _0x35524b[_0x936d('0x2b')]===_0x936d('0x2c');var _0x187d84=_0x309c4b[_0x936d('0x2d')];var _0x5bd0b8=_0x3d5fe4?0x0:_0x35524b[_0x936d('0x2e')];var _0x1d8b56=_0x3d5fe4?_0x309c4b[_0x936d('0x2d')]:_0x35524b['offset']+_0x35524b[_0x936d('0x2b')];var _0x3d33ea;if(_0x1d8b56>=_0x187d84){_0x1d8b56=_0x187d84;_0x3d33ea=0xc8;}else{_0x3d33ea=0xce;}_0x4f9901[_0x936d('0x28')](_0x3d33ea);return _0x4f9901[_0x936d('0x2f')](_0x936d('0x30'),_0x5bd0b8+'-'+_0x1d8b56+'/'+_0x187d84)[_0x936d('0x2a')](_0x309c4b);}return null;};}function patchUpdates(_0x39cc45){return function(_0x341d36){try{jsonpatch[_0x936d('0x31')](_0x341d36,_0x39cc45,!![]);}catch(_0x464ea3){return BPromise[_0x936d('0x32')](_0x464ea3);}return _0x341d36[_0x936d('0x33')]();};}function saveUpdates(_0x41f24f,_0x40b5d0){return function(_0x110188){if(_0x110188){return _0x110188['update'](_0x41f24f)[_0x936d('0x1e')](function(_0x3f7e14){return _0x3f7e14;});}return null;};}function removeEntity(_0x3bac4f,_0x5941ba){return function(_0xbb542d){if(_0xbb542d){return _0xbb542d['destroy']()['then'](function(){_0x3bac4f[_0x936d('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cb607,_0x3bc8c9){return function(_0x17b497){if(!_0x17b497){_0x3cb607[_0x936d('0x27')](0x194);}return _0x17b497;};}function handleError(_0x4788d9,_0xdd8a3){_0xdd8a3=_0xdd8a3||0x1f4;return function(_0x28005f){logger[_0x936d('0x23')](_0x28005f['stack']);if(_0x28005f[_0x936d('0x34')]){delete _0x28005f['name'];}_0x4788d9[_0x936d('0x28')](_0xdd8a3)[_0x936d('0x35')](_0x28005f);};}exports[_0x936d('0x36')]=function(_0x3643da,_0x57784d){var _0x534740={},_0xe7db74={},_0x4b929a={'count':0x0,'rows':[]};var _0x3c21a6=_[_0x936d('0x37')](db[_0x936d('0x38')][_0x936d('0x39')],function(_0x3ec4b0){return{'name':_0x3ec4b0[_0x936d('0x3a')],'type':_0x3ec4b0[_0x936d('0x3b')]['key']};});_0xe7db74[_0x936d('0x3c')]=_[_0x936d('0x37')](_0x3c21a6,'name');_0xe7db74[_0x936d('0x3d')]=_[_0x936d('0x3e')](_0x3643da[_0x936d('0x3d')]);_0xe7db74[_0x936d('0x3f')]=_['intersection'](_0xe7db74[_0x936d('0x3c')],_0xe7db74[_0x936d('0x3d')]);_0x534740[_0x936d('0x40')]=_[_0x936d('0x41')](_0xe7db74[_0x936d('0x3c')],qs[_0x936d('0x42')](_0x3643da[_0x936d('0x3d')][_0x936d('0x42')]));_0x534740[_0x936d('0x40')]=_0x534740[_0x936d('0x40')][_0x936d('0x43')]?_0x534740[_0x936d('0x40')]:_0xe7db74['model'];if(!_0x3643da['query']['hasOwnProperty'](_0x936d('0x44'))){_0x534740[_0x936d('0x2b')]=qs['limit'](_0x3643da[_0x936d('0x3d')][_0x936d('0x2b')]);_0x534740['offset']=qs[_0x936d('0x2e')](_0x3643da[_0x936d('0x3d')][_0x936d('0x2e')]);}_0x534740[_0x936d('0x45')]=qs[_0x936d('0x46')](_0x3643da[_0x936d('0x3d')]['sort']);_0x534740['where']=qs['filters'](_[_0x936d('0x47')](_0x3643da['query'],_0xe7db74[_0x936d('0x3f')]),_0x3c21a6);if(_0x3643da[_0x936d('0x3d')][_0x936d('0x48')]){_0x534740['where']=_['merge'](_0x534740['where'],{'$or':_[_0x936d('0x37')](_0x3c21a6,function(_0x21ad3e){if(_0x21ad3e[_0x936d('0x3b')]!==_0x936d('0x49')){var _0x3c0e91={};_0x3c0e91[_0x21ad3e[_0x936d('0x34')]]={'$like':'%'+_0x3643da[_0x936d('0x3d')][_0x936d('0x48')]+'%'};return _0x3c0e91;}})});}_0x534740=_[_0x936d('0x4a')]({},_0x534740,_0x3643da[_0x936d('0x4b')]);var _0x3a8178={'where':_0x534740[_0x936d('0x4c')]};return db[_0x936d('0x38')][_0x936d('0x2d')](_0x3a8178)[_0x936d('0x1e')](function(_0x1563d6){_0x4b929a[_0x936d('0x2d')]=_0x1563d6;if(_0x3643da[_0x936d('0x3d')][_0x936d('0x4d')]){_0x534740[_0x936d('0x4e')]=[{'all':!![]}];}return db[_0x936d('0x38')][_0x936d('0x4f')](_0x534740);})[_0x936d('0x1e')](function(_0x12a514){_0x4b929a['rows']=_0x12a514;return _0x4b929a;})['then'](respondWithFilteredResult(_0x57784d,_0x534740))[_0x936d('0x26')](handleError(_0x57784d,null));};exports[_0x936d('0x50')]=function(_0x21682a,_0xf184b4){var _0x436cac={'raw':!![],'where':{'id':_0x21682a['params']['id']}},_0x2ff109={};_0x2ff109[_0x936d('0x3c')]=_[_0x936d('0x3e')](db[_0x936d('0x38')][_0x936d('0x39')]);_0x2ff109[_0x936d('0x3d')]=_['keys'](_0x21682a[_0x936d('0x3d')]);_0x2ff109[_0x936d('0x3f')]=_[_0x936d('0x41')](_0x2ff109[_0x936d('0x3c')],_0x2ff109[_0x936d('0x3d')]);_0x436cac[_0x936d('0x40')]=_[_0x936d('0x41')](_0x2ff109['model'],qs[_0x936d('0x42')](_0x21682a['query'][_0x936d('0x42')]));_0x436cac['attributes']=_0x436cac[_0x936d('0x40')][_0x936d('0x43')]?_0x436cac[_0x936d('0x40')]:_0x2ff109[_0x936d('0x3c')];if(_0x21682a[_0x936d('0x3d')][_0x936d('0x4d')]){_0x436cac[_0x936d('0x4e')]=[{'all':!![]}];}_0x436cac=_['merge']({},_0x436cac,_0x21682a[_0x936d('0x4b')]);return db[_0x936d('0x38')][_0x936d('0x51')](_0x436cac)['then'](handleEntityNotFound(_0xf184b4,null))[_0x936d('0x1e')](respondWithResult(_0xf184b4,null))[_0x936d('0x26')](handleError(_0xf184b4,null));};exports[_0x936d('0x52')]=function(_0x260a07,_0xe51054){if(_0x260a07[_0x936d('0x53')]['id']){delete _0x260a07['body']['id'];}return db[_0x936d('0x38')]['find']({'where':{'id':_0x260a07[_0x936d('0x54')]['id']}})['then'](handleEntityNotFound(_0xe51054,null))[_0x936d('0x1e')](saveUpdates(_0x260a07[_0x936d('0x53')],null))[_0x936d('0x1e')](respondWithResult(_0xe51054,null))[_0x936d('0x26')](handleError(_0xe51054,null));};exports['destroy']=function(_0x242325,_0x393250){return db[_0x936d('0x38')][_0x936d('0x51')]({'where':{'id':_0x242325[_0x936d('0x54')]['id']}})[_0x936d('0x1e')](handleEntityNotFound(_0x393250,null))['then'](removeEntity(_0x393250,null))[_0x936d('0x26')](handleError(_0x393250,null));};exports[_0x936d('0x55')]=function(_0x59ea8e,_0x7ca89b){return db[_0x936d('0x38')][_0x936d('0x55')]()['then'](respondWithResult(_0x7ca89b,null))[_0x936d('0x26')](handleError(_0x7ca89b,null));};var interaction_log=require(_0x936d('0xf'))(_0x936d('0x56'));exports['accept']=function(_0x2983a4,_0x53c559,_0x5bfe4f){var _0x3ffeb7={'agent':{},'channel':_0x936d('0x57')};if(_0x2983a4['body']['id']){delete _0x2983a4['body']['id'];}_0x2983a4['body']['read']=!![];_0x2983a4[_0x936d('0x53')][_0x936d('0x58')]=moment()[_0x936d('0x59')](_0x936d('0x5a'));_0x2983a4[_0x936d('0x53')][_0x936d('0x5b')]=_0x2983a4[_0x936d('0x53')][_0x936d('0x5b')]||_0x2983a4[_0x936d('0x5c')]['id'];_0x3ffeb7[_0x936d('0x5d')]['id']=_0x2983a4[_0x936d('0x53')][_0x936d('0x5b')];return db[_0x936d('0x38')][_0x936d('0x51')]({'where':{'id':_0x2983a4[_0x936d('0x54')]['id'],'UserId':null}})[_0x936d('0x1e')](handleEntityNotFound(_0x53c559,null))[_0x936d('0x1e')](saveUpdates(_0x2983a4[_0x936d('0x53')],null))[_0x936d('0x1e')](function(_0x2588d8){if(_0x2588d8){_0x3ffeb7[_0x936d('0x25')]=_0x2588d8[_0x936d('0x5e')]({'plain':!![]});return db[_0x936d('0x5f')][_0x936d('0x51')]({'where':{'id':_0x2588d8[_0x936d('0x60')]}});}return null;})[_0x936d('0x1e')](handleEntityNotFound(_0x53c559,null))[_0x936d('0x1e')](function(_0x2e959d){if(_0x2e959d){return _0x2e959d[_0x936d('0x52')]({'UserId':_0x2983a4['body'][_0x936d('0x5b')],'read1stAt':_[_0x936d('0x61')](_0x2e959d['read1stAt'])?moment()[_0x936d('0x59')](_0x936d('0x5a')):undefined});}return null;})[_0x936d('0x1e')](function(_0x49c992){if(_0x49c992){_0x3ffeb7[_0x936d('0x62')]=_0x49c992['get']({'plain':!![]});interaction_log[_0x936d('0x1f')](_0x936d('0x63'),_0x2983a4[_0x936d('0x5c')]['id'],_0x2983a4[_0x936d('0x5c')][_0x936d('0x34')],_0x2983a4[_0x936d('0x5c')][_0x936d('0x64')],_0x3ffeb7[_0x936d('0x62')]['id'],_0x2983a4[_0x936d('0x53')]?JSON[_0x936d('0x65')](_0x2983a4[_0x936d('0x53')]):_0x936d('0x66'));return respondWithRpcPromise('AcceptMessage',_0x936d('0x67'),_0x3ffeb7);}return null;})[_0x936d('0x1e')](function(_0x5d1a8b){var _0x498598='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5d1a8b[_0x936d('0x25')][_0x936d('0x68')];return db[_0x936d('0x69')]['query'](_0x498598,{'type':db[_0x936d('0x6a')][_0x936d('0x6b')][_0x936d('0x6c')],'raw':!![]})[_0x936d('0x1e')](function(_0x5c50ea){return _0x5c50ea;});})['then'](function(_0xbe4d21){if(_0xbe4d21){_0x3ffeb7[_0x936d('0x25')][_0x936d('0x6d')]=_0xbe4d21[0x0];if(!_0x2983a4['body'][_0x936d('0x5b')])return;return db[_0x936d('0x6e')]['find']({'where':{'id':_0x2983a4['body'][_0x936d('0x5b')],'role':_0x936d('0x5d')},'attributes':['id','name','fullname',_0x936d('0x6f'),_0x936d('0x70')],'raw':!![]});}return null;})[_0x936d('0x1e')](function(_0x550971){if(!_0x550971)return null;_0x3ffeb7['message'][_0x936d('0x5d')]=_0x550971;return _0x3ffeb7;})[_0x936d('0x1e')](function(_0x2d6b2b){if(_0x2d6b2b){if(_0x2983a4[_0x936d('0x53')][_0x936d('0x71')]){_0x3ffeb7[_0x936d('0x25')][_0x936d('0x72')]=util[_0x936d('0x59')]('SIP/%s',_0x2983a4[_0x936d('0x5c')]['name']);_0x3ffeb7[_0x936d('0x25')][_0x936d('0x73')]=_0x3ffeb7[_0x936d('0x73')];_0x3ffeb7['message'][_0x936d('0x74')]=_0x3ffeb7['channel'];_0x3ffeb7[_0x936d('0x25')][_0x936d('0x75')]=_0x936d('0x76');return respondWithRpcPromise(_0x936d('0x77'),_0x936d('0x77'),{'event':_0x936d('0x78'),'message':_0x3ffeb7[_0x936d('0x25')]},client9002)[_0x936d('0x1e')](function(){return _0x3ffeb7;});}return _0x3ffeb7;}return null;})[_0x936d('0x1e')](respondWithResult(_0x53c559,null))[_0x936d('0x26')](handleError(_0x53c559,null));};var interaction_log=require(_0x936d('0xf'))('fax-interactions');exports['reject']=function(_0x3e804d,_0x13cab1,_0x1c7bb4){var _0x8aed30={'agent':{},'channel':_0x936d('0x57')};if(_0x3e804d[_0x936d('0x53')]['id']){delete _0x3e804d['body']['id'];}_0x3e804d[_0x936d('0x53')][_0x936d('0x5b')]=_0x3e804d[_0x936d('0x53')][_0x936d('0x5b')]||_0x3e804d['user']['id'];_0x8aed30['agent']['id']=_0x3e804d['body'][_0x936d('0x5b')];return db[_0x936d('0x38')][_0x936d('0x51')]({'where':{'id':_0x3e804d[_0x936d('0x54')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x13cab1,null))[_0x936d('0x1e')](function(_0x34e669){if(_0x34e669){_0x8aed30['message']=_0x34e669[_0x936d('0x5e')]({'plain':!![]});return db[_0x936d('0x5f')][_0x936d('0x51')]({'where':{'id':_0x34e669[_0x936d('0x60')]}});}return null;})[_0x936d('0x1e')](handleEntityNotFound(_0x13cab1,null))[_0x936d('0x1e')](function(_0x3301a1){if(_0x3301a1){_0x8aed30['interaction']=_0x3301a1[_0x936d('0x5e')]({'plain':!![]});interaction_log[_0x936d('0x1f')](_0x936d('0x79'),_0x3e804d[_0x936d('0x5c')]['id'],_0x3e804d[_0x936d('0x5c')]['name'],_0x3e804d[_0x936d('0x5c')][_0x936d('0x64')],_0x8aed30[_0x936d('0x62')]['id'],_0x3e804d[_0x936d('0x53')]?JSON[_0x936d('0x65')](_0x3e804d[_0x936d('0x53')]):_0x936d('0x66'));return respondWithRpcPromise('RejectMessage',_0x936d('0x7a'),_0x8aed30);}return null;})[_0x936d('0x1e')](function(_0x47096d){var _0x23ae9c=_0x936d('0x7b')+_0x47096d[_0x936d('0x25')][_0x936d('0x68')];return db['sequelize'][_0x936d('0x3d')](_0x23ae9c,{'type':db[_0x936d('0x6a')]['QueryTypes'][_0x936d('0x6c')],'raw':!![]})[_0x936d('0x1e')](function(_0x138e25){return _0x138e25;});})[_0x936d('0x1e')](function(_0x15a2e9){if(_0x15a2e9){_0x8aed30['message'][_0x936d('0x6d')]=_0x15a2e9[0x0];if(!_0x3e804d[_0x936d('0x53')]['UserId'])return;return db[_0x936d('0x6e')][_0x936d('0x51')]({'where':{'id':_0x3e804d['body']['UserId'],'role':_0x936d('0x5d')},'attributes':['id',_0x936d('0x34'),_0x936d('0x7c'),_0x936d('0x6f'),_0x936d('0x70')],'raw':!![]});}return null;})[_0x936d('0x1e')](function(_0x5267bb){if(!_0x5267bb)return null;_0x8aed30['message'][_0x936d('0x5d')]=_0x5267bb;return _0x8aed30;})[_0x936d('0x1e')](function(_0x4a5d0b){if(_0x4a5d0b){_0x4a5d0b['message'][_0x936d('0x72')]=util[_0x936d('0x59')](_0x936d('0x7d'),_0x3e804d['user'][_0x936d('0x34')]);_0x4a5d0b[_0x936d('0x25')][_0x936d('0x73')]=_0x8aed30[_0x936d('0x73')];_0x4a5d0b['message'][_0x936d('0x74')]=_0x8aed30[_0x936d('0x73')];_0x4a5d0b[_0x936d('0x25')][_0x936d('0x75')]='reject';respondWithRpcPromise(_0x936d('0x77'),'EventManager',{'event':'rejectmessage','message':_0x4a5d0b[_0x936d('0x25')]},client9002);return _0x8aed30;}return null;})['then'](respondWithResult(_0x13cab1,null))[_0x936d('0x26')](handleError(_0x13cab1,null));};exports[_0x936d('0x7e')]=function(_0x2e52b6,_0x21837f){var _0x2712b5;return db[_0x936d('0x38')][_0x936d('0x7e')](_0x2e52b6[_0x936d('0x53')],{})[_0x936d('0x1e')](function(_0x106832){_0x2712b5=_0x106832;return db['CmContact'][_0x936d('0x7f')]({'where':{'id':_0x2712b5['ContactId']}});})[_0x936d('0x1e')](function(_0x2811b0){if(_[_0x936d('0x61')](_0x2811b0)){return;}else{_0x2712b5[_0x936d('0x57')]=_0x2811b0['fax'];return db[_0x936d('0x80')][_0x936d('0x7f')]({'where':{'id':_0x2712b5[_0x936d('0x81')]}});}})[_0x936d('0x1e')](function(_0x181533){return respondWithRpcPromise(_0x936d('0x82'),'SendFax',{'FaxAccountId':_[_0x936d('0x61')](_0x2e52b6[_0x936d('0x53')])?undefined:_0x2e52b6[_0x936d('0x53')][_0x936d('0x83')],'path':_[_0x936d('0x61')](_0x181533)?undefined:util['format'](_0x936d('0x84'),_0x181533[_0x936d('0x85')]),'fax':_[_0x936d('0x61')](_0x2712b5['fax'])?undefined:_0x2712b5['fax'],'AttachmentId':_0x2712b5[_0x936d('0x81')]},client9002);})['then'](respondWithResult(_0x21837f,0xc9))[_0x936d('0x26')](handleError(_0x21837f,null));};exports[_0x936d('0x86')]=function(_0x41f496,_0x3b9521){var _0x2ce948=path[_0x936d('0x87')](config['root'],'server',_0x936d('0x88'),_0x936d('0x89'));return db[_0x936d('0x38')][_0x936d('0x51')]({'where':{'id':_0x41f496[_0x936d('0x54')]['id']},'include':[{'model':db[_0x936d('0x80')],'as':_0x936d('0x80')}]})[_0x936d('0x1e')](handleEntityNotFound(_0x3b9521,null))['then'](function(_0x404753){if(_0x404753){return _0x3b9521['download'](path[_0x936d('0x87')](_0x2ce948,_0x404753['Attachment'][_0x936d('0x85')]));}})[_0x936d('0x26')](handleError(_0x3b9521,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index e93e18e..70b8da2 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 _0xc599=['emit','hasOwnProperty','../../mysqldb','setMaxListeners','save','update'];(function(_0x3c91ce,_0x415864){var _0x5871a5=function(_0x50d37a){while(--_0x50d37a){_0x3c91ce['push'](_0x3c91ce['shift']());}};_0x5871a5(++_0x415864);}(_0xc599,0x1b2));var _0x9c59=function(_0x1b2e63,_0x1d7683){_0x1b2e63=_0x1b2e63-0x0;var _0x3d69e5=_0xc599[_0x1b2e63];return _0x3d69e5;};'use strict';var EventEmitter=require('events');var FaxMessage=require(_0x9c59('0x0'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9c59('0x1')](0x0);var events={'afterCreate':_0x9c59('0x2'),'afterUpdate':_0x9c59('0x3'),'afterDestroy':'remove'};function emitEvent(_0x2fb8fa){return function(_0x129a0c,_0x320cb0,_0x2f16df){FaxMessageEvents[_0x9c59('0x4')](_0x2fb8fa+':'+_0x129a0c['id'],_0x129a0c);FaxMessageEvents[_0x9c59('0x4')](_0x2fb8fa,_0x129a0c);_0x2f16df(null);};}for(var e in events){if(events[_0x9c59('0x5')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x4489=['update','remove','emit','hook','events','../../mysqldb','setMaxListeners','save'];(function(_0x5a23cf,_0x1e3823){var _0x13838e=function(_0x7f6205){while(--_0x7f6205){_0x5a23cf['push'](_0x5a23cf['shift']());}};_0x13838e(++_0x1e3823);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x9448('0x0'));var FaxMessage=require(_0x9448('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x9448('0x2')](0x0);var events={'afterCreate':_0x9448('0x3'),'afterUpdate':_0x9448('0x4'),'afterDestroy':_0x9448('0x5')};function emitEvent(_0x4f7c08){return function(_0x49f6d5,_0x4bf96c,_0x5333bf){FaxMessageEvents['emit'](_0x4f7c08+':'+_0x49f6d5['id'],_0x49f6d5);FaxMessageEvents[_0x9448('0x6')](_0x4f7c08,_0x49f6d5);_0x5333bf(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x9448('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 42a732d..7b2b197 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 _0xcb10=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','fti_fax_messages','FULLTEXT','models','toLowerCase','direction','out','secret','FaxInteraction','findOne','FaxInteractionId','error','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2c5115,_0x331613){var _0x57bb48=function(_0x4af277){while(--_0x4af277){_0x2c5115['push'](_0x2c5115['shift']());}};_0x57bb48(++_0x331613);}(_0xcb10,0x1c5));var _0x0cb1=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcb10[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0cb1('0x0'));var util=require(_0x0cb1('0x1'));var logger=require(_0x0cb1('0x2'))(_0x0cb1('0x3'));var moment=require(_0x0cb1('0x4'));var BPromise=require(_0x0cb1('0x5'));var rp=require(_0x0cb1('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0cb1('0x7'));var config=require(_0x0cb1('0x8'));var attributes=require(_0x0cb1('0x9'));module[_0x0cb1('0xa')]=function(_0x3acd12,_0x71b2ff){return _0x3acd12[_0x0cb1('0xb')]('FaxMessage',attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x0cb1('0xc'),'fields':['body'],'type':_0x0cb1('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x82ea8b,_0x2665bb,_0x1b497c){var _0x2d161e=_0x3acd12[_0x0cb1('0xe')];var _0x3a73e9=_0x82ea8b['get']({'plain':!![]});if(_0x3a73e9['direction'][_0x0cb1('0xf')]()==='in'||_0x3a73e9[_0x0cb1('0x10')][_0x0cb1('0xf')]()===_0x0cb1('0x11')&&!_0x3a73e9[_0x0cb1('0x12')]&&!_['isNil'](_0x3a73e9['UserId'])){_0x2d161e[_0x0cb1('0x13')][_0x0cb1('0x14')]({'where':{'id':_0x3a73e9[_0x0cb1('0x15')]}})['then'](function(_0x3682fe){if(_0x3682fe){_0x3682fe['update']({'lastMsgAt':_0x3a73e9['createdAt'],'lastMsgDirection':_0x3a73e9[_0x0cb1('0x10')][_0x0cb1('0xf')]()});}})['catch'](function(_0x19fb1f){console[_0x0cb1('0x16')](_0x19fb1f);});}_0x1b497c();}},'charset':'utf8mb4','collate':_0x0cb1('0x17')});}; \ No newline at end of file +var _0xd032=['bluebird','request-promise','path','rimraf','../../config/environment','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','direction','toLowerCase','out','isNil','UserId','FaxInteraction','then','update','catch','error','lodash','util'];(function(_0x4815c3,_0x2f6582){var _0x1a4478=function(_0x18906e){while(--_0x18906e){_0x4815c3['push'](_0x4815c3['shift']());}};_0x1a4478(++_0x2f6582);}(_0xd032,0x185));var _0x2d03=function(_0x119d5a,_0x19b457){_0x119d5a=_0x119d5a-0x0;var _0x15bff4=_0xd032[_0x119d5a];return _0x15bff4;};'use strict';var _=require(_0x2d03('0x0'));var util=require(_0x2d03('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x2d03('0x2'));var rp=require(_0x2d03('0x3'));var fs=require('fs');var path=require(_0x2d03('0x4'));var rimraf=require(_0x2d03('0x5'));var config=require(_0x2d03('0x6'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x28849a,_0x38feb0){return _0x28849a[_0x2d03('0x7')](_0x2d03('0x8'),attributes,{'tableName':_0x2d03('0x9'),'paranoid':![],'indexes':[{'name':_0x2d03('0xa'),'fields':[_0x2d03('0xb')],'type':_0x2d03('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x55b699,_0x55d141,_0x47ee5c){var _0x1195c3=_0x28849a['models'];var _0x2e8132=_0x55b699['get']({'plain':!![]});if(_0x2e8132[_0x2d03('0xd')][_0x2d03('0xe')]()==='in'||_0x2e8132[_0x2d03('0xd')][_0x2d03('0xe')]()===_0x2d03('0xf')&&!_0x2e8132['secret']&&!_[_0x2d03('0x10')](_0x2e8132[_0x2d03('0x11')])){_0x1195c3[_0x2d03('0x12')]['findOne']({'where':{'id':_0x2e8132['FaxInteractionId']}})[_0x2d03('0x13')](function(_0x356c4b){if(_0x356c4b){_0x356c4b[_0x2d03('0x14')]({'lastMsgAt':_0x2e8132['createdAt'],'lastMsgDirection':_0x2e8132[_0x2d03('0xd')][_0x2d03('0xe')]()});}})[_0x2d03('0x15')](function(_0x5a5d39){console[_0x2d03('0x16')](_0x5a5d39);});}_0x47ee5c();}},'charset':'utf8mb4','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 8cd950c..d9742f9 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 _0xbec5=['then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','catch','CreateFaxMessage','FaxMessage','create','body','options','UpdateFaxMessage','update','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x2aeb9a,_0x3ab319){var _0x2ec1d3=function(_0x5e4a2f){while(--_0x5e4a2f){_0x2aeb9a['push'](_0x2aeb9a['shift']());}};_0x2ec1d3(++_0x3ab319);}(_0xbec5,0xe5));var _0x5bec=function(_0x5b8b97,_0x6b4dfa){_0x5b8b97=_0x5b8b97-0x0;var _0x1fdf84=_0xbec5[_0x5b8b97];return _0x1fdf84;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});config[_0x5bec('0xb')]=_[_0x5bec('0xc')](config[_0x5bec('0xb')],{'host':_0x5bec('0xd'),'port':0x18eb});var socket=require(_0x5bec('0xe'))(new Redis(config[_0x5bec('0xb')]));require(_0x5bec('0xf'))['register'](socket);function respondWithRpcPromise(_0x41a827,_0x5c2d67,_0x748f75){return new BPromise(function(_0x2a70a7,_0x117162){return client['request'](_0x41a827,_0x748f75)[_0x5bec('0x10')](function(_0x18fa47){logger[_0x5bec('0x11')]('FaxMessage,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'));logger[_0x5bec('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5c2d67,_0x5bec('0x12'),JSON[_0x5bec('0x14')](_0x18fa47));if(_0x18fa47[_0x5bec('0x15')]){if(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x16')]===0x1f4){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);return _0x117162(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x18fa47['error']['message']);return _0x2a70a7(_0x18fa47[_0x5bec('0x15')][_0x5bec('0x18')]);}else{logger[_0x5bec('0x11')](_0x5bec('0x17'),_0x5c2d67,'request\x20sent');_0x2a70a7(_0x18fa47['result'][_0x5bec('0x18')]);}})[_0x5bec('0x19')](function(_0x4e0191){logger[_0x5bec('0x15')](_0x5bec('0x17'),_0x5c2d67,_0x4e0191);_0x117162(_0x4e0191);});});}exports[_0x5bec('0x1a')]=function(_0x593786){var _0x554f9f=this;return new Promise(function(_0xab397b,_0x5be91c){return db[_0x5bec('0x1b')][_0x5bec('0x1c')](_0x593786[_0x5bec('0x1d')],{'raw':_0x593786[_0x5bec('0x1e')]?_0x593786[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x5bec('0x10')](function(_0x4cfcb8){logger[_0x5bec('0x11')](_0x5bec('0x1a'),_0x593786);logger['debug'](_0x5bec('0x1a'),_0x593786,JSON[_0x5bec('0x14')](_0x4cfcb8));_0xab397b(_0x4cfcb8);})['catch'](function(_0x45afb7){logger[_0x5bec('0x15')](_0x5bec('0x1a'),_0x45afb7[_0x5bec('0x18')],_0x593786);_0x5be91c(_0x554f9f[_0x5bec('0x15')](0x1f4,_0x45afb7[_0x5bec('0x18')]));});});};exports[_0x5bec('0x1f')]=function(_0x4de66a){var _0x5b63ab=this;return new Promise(function(_0x5e44b3,_0x2961bd){return db[_0x5bec('0x1b')][_0x5bec('0x20')](_0x4de66a['body'],{'raw':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')]['where']||null:null,'attributes':_0x4de66a['options']?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x21')]||null:null,'limit':_0x4de66a[_0x5bec('0x1e')]?_0x4de66a[_0x5bec('0x1e')][_0x5bec('0x22')]||null:null})[_0x5bec('0x10')](function(_0x5d6621){logger[_0x5bec('0x11')]('UpdateFaxMessage',_0x4de66a);logger[_0x5bec('0x13')](_0x5bec('0x1f'),_0x4de66a,JSON[_0x5bec('0x14')](_0x5d6621));_0x5e44b3(_0x5d6621);})[_0x5bec('0x19')](function(_0x5128c0){logger[_0x5bec('0x15')](_0x5bec('0x1f'),_0x5128c0[_0x5bec('0x18')],_0x4de66a);_0x2961bd(_0x5b63ab['error'](0x1f4,_0x5128c0[_0x5bec('0x18')]));});});}; \ No newline at end of file +var _0x4bc3=['CreateFaxMessage','FaxMessage','create','body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','limit','info','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./faxMessage.socket','register','request','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4bc3,0x16e));var _0x34bc=function(_0x20a558,_0x160e0e){_0x20a558=_0x20a558-0x0;var _0x53d3f7=_0x4bc3[_0x20a558];return _0x53d3f7;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var moment=require('moment');var BPromise=require(_0x34bc('0x2'));var rs=require(_0x34bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x34bc('0x4'))['db'];var utils=require(_0x34bc('0x5'));var logger=require(_0x34bc('0x6'))(_0x34bc('0x7'));var config=require(_0x34bc('0x8'));var jayson=require(_0x34bc('0x9'));var client=jayson[_0x34bc('0xa')]['http']({'port':0x232a});config[_0x34bc('0xb')]=_['defaults'](config['redis'],{'host':_0x34bc('0xc'),'port':0x18eb});var socket=require(_0x34bc('0xd'))(new Redis(config[_0x34bc('0xb')]));require(_0x34bc('0xe'))[_0x34bc('0xf')](socket);function respondWithRpcPromise(_0x41b2ff,_0x5de8b5,_0x5a478d){return new BPromise(function(_0x2b8112,_0x33025c){return client[_0x34bc('0x10')](_0x41b2ff,_0x5a478d)['then'](function(_0x41960e){logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));logger[_0x34bc('0x13')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x5de8b5,_0x34bc('0x12'),JSON['stringify'](_0x41960e));if(_0x41960e[_0x34bc('0x14')]){if(_0x41960e[_0x34bc('0x14')][_0x34bc('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x41960e[_0x34bc('0x14')]['message']);return _0x33025c(_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);}logger[_0x34bc('0x14')](_0x34bc('0x11'),_0x5de8b5,_0x41960e[_0x34bc('0x14')][_0x34bc('0x16')]);return _0x2b8112(_0x41960e['error']['message']);}else{logger['info'](_0x34bc('0x11'),_0x5de8b5,_0x34bc('0x12'));_0x2b8112(_0x41960e[_0x34bc('0x17')][_0x34bc('0x16')]);}})['catch'](function(_0x46aa24){logger[_0x34bc('0x14')]('FaxMessage,\x20%s,\x20%s',_0x5de8b5,_0x46aa24);_0x33025c(_0x46aa24);});});}exports[_0x34bc('0x18')]=function(_0x9e9f14){var _0x4d2d5e=this;return new Promise(function(_0x14cec8,_0x26cdec){return db[_0x34bc('0x19')][_0x34bc('0x1a')](_0x9e9f14[_0x34bc('0x1b')],{'raw':_0x9e9f14[_0x34bc('0x1c')]?_0x9e9f14['options'][_0x34bc('0x1d')]===undefined?!![]:![]:!![]})[_0x34bc('0x1e')](function(_0x38882c){logger['info']('CreateFaxMessage',_0x9e9f14);logger[_0x34bc('0x13')](_0x34bc('0x18'),_0x9e9f14,JSON[_0x34bc('0x1f')](_0x38882c));_0x14cec8(_0x38882c);})[_0x34bc('0x20')](function(_0x13094a){logger[_0x34bc('0x14')](_0x34bc('0x18'),_0x13094a[_0x34bc('0x16')],_0x9e9f14);_0x26cdec(_0x4d2d5e[_0x34bc('0x14')](0x1f4,_0x13094a[_0x34bc('0x16')]));});});};exports[_0x34bc('0x21')]=function(_0x1edcb0){var _0x4fd589=this;return new Promise(function(_0x43e527,_0x48ec13){return db['FaxMessage'][_0x34bc('0x22')](_0x1edcb0['body'],{'raw':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1edcb0['options']?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x23')]||null:null,'attributes':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0[_0x34bc('0x1c')][_0x34bc('0x24')]||null:null,'limit':_0x1edcb0[_0x34bc('0x1c')]?_0x1edcb0['options'][_0x34bc('0x25')]||null:null})[_0x34bc('0x1e')](function(_0x22aacc){logger[_0x34bc('0x26')](_0x34bc('0x21'),_0x1edcb0);logger[_0x34bc('0x13')]('UpdateFaxMessage',_0x1edcb0,JSON[_0x34bc('0x1f')](_0x22aacc));_0x43e527(_0x22aacc);})['catch'](function(_0x530748){logger[_0x34bc('0x14')]('UpdateFaxMessage',_0x530748[_0x34bc('0x16')],_0x1edcb0);_0x48ec13(_0x4fd589[_0x34bc('0x14')](0x1f4,_0x530748[_0x34bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index ac7f98d..d0eca0a 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 _0xda6e=['remove','update','register','length','faxMessage:','./faxMessage.events','save'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xda6e,0x1a9));var _0xeda6=function(_0x45373d,_0x226aa4){_0x45373d=_0x45373d-0x0;var _0x21d0cc=_0xda6e[_0x45373d];return _0x21d0cc;};'use strict';var FaxMessageEvents=require(_0xeda6('0x0'));var events=[_0xeda6('0x1'),_0xeda6('0x2'),_0xeda6('0x3')];function createListener(_0x2cec9f,_0x4c9bb2){return function(_0x11eada){_0x4c9bb2['emit'](_0x2cec9f,_0x11eada);};}function removeListener(_0x1ae893,_0x3ac95e){return function(){FaxMessageEvents['removeListener'](_0x1ae893,_0x3ac95e);};}exports[_0xeda6('0x4')]=function(_0x47a31c){for(var _0xe0b545=0x0,_0x843df2=events[_0xeda6('0x5')];_0xe0b545<_0x843df2;_0xe0b545++){var _0x56514a=events[_0xe0b545];var _0x4ff14f=createListener(_0xeda6('0x6')+_0x56514a,_0x47a31c);FaxMessageEvents['on'](_0x56514a,_0x4ff14f);}}; \ No newline at end of file +var _0xbef7=['remove','emit','removeListener','length','faxMessage:','./faxMessage.events'];(function(_0x3ee6d2,_0x4eac86){var _0xfe0c1a=function(_0x4d31a6){while(--_0x4d31a6){_0x3ee6d2['push'](_0x3ee6d2['shift']());}};_0xfe0c1a(++_0x4eac86);}(_0xbef7,0x10d));var _0x7bef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbef7[_0x3dd15e];return _0x231fd0;};'use strict';var FaxMessageEvents=require(_0x7bef('0x0'));var events=['save',_0x7bef('0x1'),'update'];function createListener(_0x35f8b4,_0x139db3){return function(_0x3cccec){_0x139db3[_0x7bef('0x2')](_0x35f8b4,_0x3cccec);};}function removeListener(_0x2edd35,_0x43435e){return function(){FaxMessageEvents[_0x7bef('0x3')](_0x2edd35,_0x43435e);};}exports['register']=function(_0x403390){for(var _0x22df20=0x0,_0x52a343=events[_0x7bef('0x4')];_0x22df20<_0x52a343;_0x22df20++){var _0x95b336=events[_0x22df20];var _0x56c3ec=createListener(_0x7bef('0x5')+_0x95b336,_0x403390);FaxMessageEvents['on'](_0x95b336,_0x56c3ec);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index bd994e8..6388f40 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 _0xf290=['/:id','show','/:id/download','download','post','fax','create','put','update','accept','/:id/reject','reject','delete','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe'];(function(_0x23deac,_0x5af9cf){var _0x141c2d=function(_0x3221f1){while(--_0x3221f1){_0x23deac['push'](_0x23deac['shift']());}};_0x141c2d(++_0x5af9cf);}(_0xf290,0xde));var _0x0f29=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0xf290[_0x5e6ea3];return _0x4048b5;};'use strict';var multer=require('multer');var util=require(_0x0f29('0x0'));var path=require('path');var timeout=require(_0x0f29('0x1'));var express=require('express');var router=express[_0x0f29('0x2')]();var fs_extra=require(_0x0f29('0x3'));var auth=require(_0x0f29('0x4'));var interaction=require(_0x0f29('0x5'));var config=require(_0x0f29('0x6'));var controller=require('./faxMessage.controller');router[_0x0f29('0x7')]('/',auth['isAuthenticated'](),controller[_0x0f29('0x8')]);router[_0x0f29('0x7')](_0x0f29('0x9'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xb')]);router[_0x0f29('0x7')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xd')]);router[_0x0f29('0x7')](_0x0f29('0xe'),auth[_0x0f29('0xa')](),controller[_0x0f29('0xf')]);router[_0x0f29('0x10')]('/',auth[_0x0f29('0xa')](),interaction['tracked'](_0x0f29('0x11'),'faxmessage:create'),controller[_0x0f29('0x12')]);router[_0x0f29('0x13')](_0x0f29('0xc'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x14')]);router[_0x0f29('0x13')]('/:id/accept',auth[_0x0f29('0xa')](),controller[_0x0f29('0x15')]);router[_0x0f29('0x13')](_0x0f29('0x16'),auth[_0x0f29('0xa')](),controller[_0x0f29('0x17')]);router[_0x0f29('0x18')](_0x0f29('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x0f29('0x19')]=router; \ No newline at end of file +var _0x0fd9=['../../components/interaction/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','/describe','/:id','show','/:id/download','download','post','tracked','fax','create','put','update','/:id/reject','reject','delete','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x3a1ec5,_0x204318){var _0x4f3255=function(_0x4a6c59){while(--_0x4a6c59){_0x3a1ec5['push'](_0x3a1ec5['shift']());}};_0x4f3255(++_0x204318);}(_0x0fd9,0xa3));var _0x90fd=function(_0x462fe4,_0x394d3e){_0x462fe4=_0x462fe4-0x0;var _0x82b23a=_0x0fd9[_0x462fe4];return _0x82b23a;};'use strict';var multer=require('multer');var util=require(_0x90fd('0x0'));var path=require(_0x90fd('0x1'));var timeout=require(_0x90fd('0x2'));var express=require(_0x90fd('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x90fd('0x4'));var interaction=require(_0x90fd('0x5'));var config=require(_0x90fd('0x6'));var controller=require(_0x90fd('0x7'));router[_0x90fd('0x8')]('/',auth[_0x90fd('0x9')](),controller['index']);router['get'](_0x90fd('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x90fd('0x8')](_0x90fd('0xb'),auth['isAuthenticated'](),controller[_0x90fd('0xc')]);router[_0x90fd('0x8')](_0x90fd('0xd'),auth[_0x90fd('0x9')](),controller[_0x90fd('0xe')]);router[_0x90fd('0xf')]('/',auth[_0x90fd('0x9')](),interaction[_0x90fd('0x10')](_0x90fd('0x11'),'faxmessage:create'),controller[_0x90fd('0x12')]);router[_0x90fd('0x13')]('/:id',auth[_0x90fd('0x9')](),controller[_0x90fd('0x14')]);router[_0x90fd('0x13')]('/:id/accept',auth[_0x90fd('0x9')](),controller['accept']);router[_0x90fd('0x13')](_0x90fd('0x15'),auth[_0x90fd('0x9')](),controller[_0x90fd('0x16')]);router[_0x90fd('0x17')](_0x90fd('0xb'),auth[_0x90fd('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index f574015..b51cdbe 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 _0x96e8=['roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory','beepall'];(function(_0x58750a,_0x16e240){var _0x309256=function(_0x4b9f93){while(--_0x4b9f93){_0x58750a['push'](_0x58750a['shift']());}};_0x309256(++_0x16e240);}(_0x96e8,0x99));var _0x896e=function(_0x254295,_0x50730a){_0x254295=_0x254295-0x0;var _0x235c7d=_0x96e8[_0x254295];return _0x235c7d;};'use strict';var Sequelize=require(_0x896e('0x0'));module[_0x896e('0x1')]={'name':{'type':Sequelize[_0x896e('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x896e('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x896e('0x4')](_0x896e('0x5'),_0x896e('0x6'),_0x896e('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x896e('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8aa7=['INTEGER','ENUM','rrmemory','beepall','sequelize','exports','STRING'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x8aa7,0x1c4));var _0x78aa=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0x8aa7[_0x40bffc];return _0x3007e9;};'use strict';var Sequelize=require(_0x78aa('0x0'));module[_0x78aa('0x1')]={'name':{'type':Sequelize[_0x78aa('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x78aa('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x78aa('0x4')](_0x78aa('0x5'),_0x78aa('0x6'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x78aa('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 4763f64..1898e7f 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 _0xe6ff=['addAgents','omit','userFaxQueue:save','removeAgents','userFaxQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','destroy','FaxQueues','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','FaxQueue','includeAll','include','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','UserFaxQueue','nolimit','pick','FaxQueueId','filter','findAll','User','findAndCountAll','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','findOne','Team','getTeams','ids','Agents','voicePause','flatMap','sequelize','transaction','each','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','value','isEmpty','forEach','emit'];(function(_0x28718e,_0x3d7b34){var _0x115b08=function(_0x586b07){while(--_0x586b07){_0x28718e['push'](_0x28718e['shift']());}};_0x115b08(++_0x3d7b34);}(_0xe6ff,0x1aa));var _0xfe6f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0xe6ff[_0x1589dd];return _0x1bddd1;};'use strict';var emlformat=require(_0xfe6f('0x0'));var rimraf=require(_0xfe6f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe6f('0x2'));var rp=require('request-promise');var moment=require(_0xfe6f('0x3'));var BPromise=require(_0xfe6f('0x4'));var Mustache=require('mustache');var util=require(_0xfe6f('0x5'));var path=require(_0xfe6f('0x6'));var sox=require(_0xfe6f('0x7'));var csv=require(_0xfe6f('0x8'));var ejs=require(_0xfe6f('0x9'));var fs=require('fs');var fs_extra=require(_0xfe6f('0xa'));var _=require('lodash');var squel=require(_0xfe6f('0xb'));var crypto=require(_0xfe6f('0xc'));var jsforce=require(_0xfe6f('0xd'));var deskjs=require(_0xfe6f('0xe'));var toCsv=require(_0xfe6f('0x8'));var querystring=require(_0xfe6f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfe6f('0x10'));var qs=require(_0xfe6f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe6f('0x12'));var logger=require(_0xfe6f('0x13'))(_0xfe6f('0x14'));var utils=require('../../config/utils');var config=require(_0xfe6f('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xfe6f('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xfe6f('0x17'),'port':0x18eb});var socket=require(_0xfe6f('0x18'))(new Redis(config['redis']));require(_0xfe6f('0x19'))[_0xfe6f('0x1a')](socket);function respondWithStatusCode(_0x512c80,_0xcdb10f){_0xcdb10f=_0xcdb10f||0xcc;return function(_0x51254e){if(_0x51254e){return _0x512c80[_0xfe6f('0x1b')](_0xcdb10f);}return _0x512c80[_0xfe6f('0x1c')](_0xcdb10f)[_0xfe6f('0x1d')]();};}function respondWithResult(_0x3d4c5b,_0xa3d8ca){_0xa3d8ca=_0xa3d8ca||0xc8;return function(_0x4bce4b){if(_0x4bce4b){return _0x3d4c5b['status'](_0xa3d8ca)[_0xfe6f('0x1e')](_0x4bce4b);}};}function respondWithFilteredResult(_0x46f351,_0x242de4){return function(_0x5a9ef2){if(_0x5a9ef2){var _0x3e5310=typeof _0x242de4['offset']===_0xfe6f('0x1f')&&typeof _0x242de4[_0xfe6f('0x20')]===_0xfe6f('0x1f');var _0x228315=_0x5a9ef2[_0xfe6f('0x21')];var _0x35bd40=_0x3e5310?0x0:_0x242de4[_0xfe6f('0x22')];var _0x1d4846=_0x3e5310?_0x5a9ef2[_0xfe6f('0x21')]:_0x242de4[_0xfe6f('0x22')]+_0x242de4[_0xfe6f('0x20')];var _0x181284;if(_0x1d4846>=_0x228315){_0x1d4846=_0x228315;_0x181284=0xc8;}else{_0x181284=0xce;}_0x46f351[_0xfe6f('0x1c')](_0x181284);return _0x46f351[_0xfe6f('0x23')](_0xfe6f('0x24'),_0x35bd40+'-'+_0x1d4846+'/'+_0x228315)['json'](_0x5a9ef2);}return null;};}function patchUpdates(_0x2edde2){return function(_0x3da066){try{jsonpatch[_0xfe6f('0x25')](_0x3da066,_0x2edde2,!![]);}catch(_0x17f66f){return BPromise[_0xfe6f('0x26')](_0x17f66f);}return _0x3da066[_0xfe6f('0x27')]();};}function saveUpdates(_0x5a527f,_0x686f4e){return function(_0x5fd211){if(_0x5fd211){return _0x5fd211['update'](_0x5a527f)[_0xfe6f('0x28')](function(_0xe8655d){return _0xe8655d;});}return null;};}function removeEntity(_0x33d0f7,_0x2eb9be){return function(_0x3f8fa0){if(_0x3f8fa0){return _0x3f8fa0[_0xfe6f('0x29')]()[_0xfe6f('0x28')](function(){var _0x2cfb66=_0x3f8fa0['get']({'plain':!![]});var _0x2049b3=_0xfe6f('0x2a');return db[_0xfe6f('0x2b')][_0xfe6f('0x29')]({'where':{'type':_0x2049b3,'resourceId':_0x2cfb66['id']}})[_0xfe6f('0x28')](function(){return _0x3f8fa0;});})[_0xfe6f('0x28')](function(){_0x33d0f7[_0xfe6f('0x1c')](0xcc)[_0xfe6f('0x1d')]();});}};}function handleEntityNotFound(_0x4ab493,_0x3d1d30){return function(_0x3f18d5){if(!_0x3f18d5){_0x4ab493[_0xfe6f('0x1b')](0x194);}return _0x3f18d5;};}function handleError(_0x58517b,_0x1ac966){_0x1ac966=_0x1ac966||0x1f4;return function(_0x513858){logger['error'](_0x513858['stack']);if(_0x513858[_0xfe6f('0x2c')]){delete _0x513858[_0xfe6f('0x2c')];}_0x58517b[_0xfe6f('0x1c')](_0x1ac966)[_0xfe6f('0x2d')](_0x513858);};}exports[_0xfe6f('0x2e')]=function(_0x5cc709,_0x281d1a){var _0x5dba6b={},_0x27d68e={},_0x2feefe={'count':0x0,'rows':[]};var _0x4eb37=_[_0xfe6f('0x2f')](db['FaxQueue'][_0xfe6f('0x30')],function(_0x2cbde1){return{'name':_0x2cbde1[_0xfe6f('0x31')],'type':_0x2cbde1[_0xfe6f('0x32')]['key']};});_0x27d68e[_0xfe6f('0x33')]=_[_0xfe6f('0x2f')](_0x4eb37,_0xfe6f('0x2c'));_0x27d68e[_0xfe6f('0x34')]=_[_0xfe6f('0x35')](_0x5cc709[_0xfe6f('0x34')]);_0x27d68e[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x27d68e[_0xfe6f('0x33')],_0x27d68e[_0xfe6f('0x34')]);_0x5dba6b[_0xfe6f('0x38')]=_[_0xfe6f('0x37')](_0x27d68e[_0xfe6f('0x33')],qs[_0xfe6f('0x39')](_0x5cc709[_0xfe6f('0x34')][_0xfe6f('0x39')]));_0x5dba6b[_0xfe6f('0x38')]=_0x5dba6b[_0xfe6f('0x38')][_0xfe6f('0x3a')]?_0x5dba6b[_0xfe6f('0x38')]:_0x27d68e[_0xfe6f('0x33')];if(!_0x5cc709['query'][_0xfe6f('0x3b')]('nolimit')){_0x5dba6b['limit']=qs['limit'](_0x5cc709[_0xfe6f('0x34')][_0xfe6f('0x20')]);_0x5dba6b['offset']=qs[_0xfe6f('0x22')](_0x5cc709['query'][_0xfe6f('0x22')]);}_0x5dba6b[_0xfe6f('0x3c')]=qs[_0xfe6f('0x3d')](_0x5cc709[_0xfe6f('0x34')]['sort']);_0x5dba6b[_0xfe6f('0x3e')]=qs[_0xfe6f('0x36')](_['pick'](_0x5cc709[_0xfe6f('0x34')],_0x27d68e[_0xfe6f('0x36')]),_0x4eb37);if(_0x5cc709[_0xfe6f('0x34')]['filter']){_0x5dba6b[_0xfe6f('0x3e')]=_['merge'](_0x5dba6b[_0xfe6f('0x3e')],{'$or':_[_0xfe6f('0x2f')](_0x4eb37,function(_0x3eb766){if(_0x3eb766[_0xfe6f('0x32')]!==_0xfe6f('0x3f')){var _0x84e63b={};_0x84e63b[_0x3eb766['name']]={'$like':'%'+_0x5cc709[_0xfe6f('0x34')]['filter']+'%'};return _0x84e63b;}})});}_0x5dba6b=_[_0xfe6f('0x40')]({},_0x5dba6b,_0x5cc709['options']);var _0x20b435={'where':_0x5dba6b[_0xfe6f('0x3e')]};return db[_0xfe6f('0x41')][_0xfe6f('0x21')](_0x20b435)[_0xfe6f('0x28')](function(_0x1d6738){_0x2feefe[_0xfe6f('0x21')]=_0x1d6738;if(_0x5cc709['query'][_0xfe6f('0x42')]){_0x5dba6b[_0xfe6f('0x43')]=[{'all':!![]}];}return db[_0xfe6f('0x41')]['findAll'](_0x5dba6b);})[_0xfe6f('0x28')](function(_0x34edd2){_0x2feefe[_0xfe6f('0x44')]=_0x34edd2;return _0x2feefe;})['then'](respondWithFilteredResult(_0x281d1a,_0x5dba6b))[_0xfe6f('0x45')](handleError(_0x281d1a,null));};exports[_0xfe6f('0x46')]=function(_0x585115,_0x3c08b2){var _0x3a8450={'raw':!![],'where':{'id':_0x585115[_0xfe6f('0x47')]['id']}},_0x43170a={};_0x43170a[_0xfe6f('0x33')]=_[_0xfe6f('0x35')](db[_0xfe6f('0x41')][_0xfe6f('0x30')]);_0x43170a[_0xfe6f('0x34')]=_[_0xfe6f('0x35')](_0x585115[_0xfe6f('0x34')]);_0x43170a[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x43170a[_0xfe6f('0x33')],_0x43170a[_0xfe6f('0x34')]);_0x3a8450[_0xfe6f('0x38')]=_['intersection'](_0x43170a[_0xfe6f('0x33')],qs[_0xfe6f('0x39')](_0x585115['query'][_0xfe6f('0x39')]));_0x3a8450[_0xfe6f('0x38')]=_0x3a8450[_0xfe6f('0x38')][_0xfe6f('0x3a')]?_0x3a8450['attributes']:_0x43170a[_0xfe6f('0x33')];if(_0x585115[_0xfe6f('0x34')][_0xfe6f('0x42')]){_0x3a8450[_0xfe6f('0x43')]=[{'all':!![]}];}_0x3a8450=_[_0xfe6f('0x40')]({},_0x3a8450,_0x585115[_0xfe6f('0x48')]);return db[_0xfe6f('0x41')][_0xfe6f('0x49')](_0x3a8450)[_0xfe6f('0x28')](handleEntityNotFound(_0x3c08b2,null))[_0xfe6f('0x28')](respondWithResult(_0x3c08b2,null))[_0xfe6f('0x45')](handleError(_0x3c08b2,null));};exports['create']=function(_0x27a4b4,_0x1c1afe){return db[_0xfe6f('0x41')][_0xfe6f('0x4a')](_0x27a4b4[_0xfe6f('0x4b')],{})[_0xfe6f('0x28')](function(_0x415ab7){var _0x535ef9=_0x27a4b4[_0xfe6f('0x4c')][_0xfe6f('0x4d')]({'plain':!![]});if(!_0x535ef9)throw new Error(_0xfe6f('0x4e'));if(_0x535ef9[_0xfe6f('0x4f')]===_0xfe6f('0x4c')){var _0xd3a4ae=_0x415ab7[_0xfe6f('0x4d')]({'plain':!![]});var _0x2e9b9c='FaxQueues';return db['UserProfileSection'][_0xfe6f('0x49')]({'where':{'name':_0x2e9b9c,'userProfileId':_0x535ef9[_0xfe6f('0x50')]},'raw':!![]})[_0xfe6f('0x28')](function(_0x4bdb48){if(_0x4bdb48&&_0x4bdb48[_0xfe6f('0x51')]===0x0){return db[_0xfe6f('0x2b')]['create']({'name':_0xd3a4ae['name'],'resourceId':_0xd3a4ae['id'],'type':_0x4bdb48[_0xfe6f('0x2c')],'sectionId':_0x4bdb48['id']},{})[_0xfe6f('0x28')](function(){return _0x415ab7;});}else{return _0x415ab7;}})[_0xfe6f('0x45')](function(_0x5aedfe){logger[_0xfe6f('0x52')](_0xfe6f('0x53'),_0x5aedfe);throw _0x5aedfe;});}return _0x415ab7;})[_0xfe6f('0x28')](respondWithResult(_0x1c1afe,0xc9))[_0xfe6f('0x45')](handleError(_0x1c1afe,null));};exports['update']=function(_0x27fdf4,_0x1a45c9){if(_0x27fdf4[_0xfe6f('0x4b')]['id']){delete _0x27fdf4[_0xfe6f('0x4b')]['id'];}return db[_0xfe6f('0x41')][_0xfe6f('0x49')]({'where':{'id':_0x27fdf4[_0xfe6f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a45c9,null))[_0xfe6f('0x28')](saveUpdates(_0x27fdf4[_0xfe6f('0x4b')],null))[_0xfe6f('0x28')](respondWithResult(_0x1a45c9,null))[_0xfe6f('0x45')](handleError(_0x1a45c9,null));};exports['destroy']=function(_0x8ec619,_0x23252a){return db[_0xfe6f('0x41')][_0xfe6f('0x49')]({'where':{'id':_0x8ec619[_0xfe6f('0x47')]['id']}})['then'](handleEntityNotFound(_0x23252a,null))['then'](removeEntity(_0x23252a,null))[_0xfe6f('0x45')](handleError(_0x23252a,null));};exports[_0xfe6f('0x54')]=function(_0x33d419,_0x569eb9){return db[_0xfe6f('0x41')]['describe']()[_0xfe6f('0x28')](respondWithResult(_0x569eb9,null))[_0xfe6f('0x45')](handleError(_0x569eb9,null));};exports['getMembers']=function(_0x41dca6,_0x242188,_0x4d4330){var _0x2a246b={'raw':!![],'where':{}},_0x11bda1={},_0x524776;return db[_0xfe6f('0x41')]['findOne']({'where':{'id':_0x41dca6[_0xfe6f('0x47')]['id']}})['then'](handleEntityNotFound(_0x242188,null))['then'](function(_0x3aeb6a){if(_0x3aeb6a){_0x524776=_0x3aeb6a['get']({'plain':!![]});_0x11bda1[_0xfe6f('0x33')]=_['keys'](db[_0xfe6f('0x55')]['rawAttributes']);_0x11bda1[_0xfe6f('0x34')]=_[_0xfe6f('0x35')](_0x41dca6[_0xfe6f('0x34')]);_0x11bda1[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x11bda1[_0xfe6f('0x33')],_0x11bda1[_0xfe6f('0x34')]);_0x2a246b[_0xfe6f('0x38')]=_['intersection'](_0x11bda1['model'],qs[_0xfe6f('0x39')](_0x41dca6[_0xfe6f('0x34')][_0xfe6f('0x39')]));_0x2a246b[_0xfe6f('0x38')]=_0x2a246b[_0xfe6f('0x38')]['length']?_0x2a246b[_0xfe6f('0x38')]:_0x11bda1[_0xfe6f('0x33')];if(!_0x41dca6['query'][_0xfe6f('0x3b')](_0xfe6f('0x56'))){_0x2a246b[_0xfe6f('0x20')]=qs[_0xfe6f('0x20')](_0x41dca6[_0xfe6f('0x34')]['limit']);_0x2a246b['offset']=qs[_0xfe6f('0x22')](_0x41dca6[_0xfe6f('0x34')]['offset']);}_0x2a246b['order']=qs['sort'](_0x41dca6[_0xfe6f('0x34')][_0xfe6f('0x3d')]);_0x2a246b[_0xfe6f('0x3e')]=qs[_0xfe6f('0x36')](_[_0xfe6f('0x57')](_0x41dca6[_0xfe6f('0x34')],_0x11bda1[_0xfe6f('0x36')]));_0x2a246b[_0xfe6f('0x3e')][_0xfe6f('0x58')]=_0x3aeb6a['id'];if(_0x41dca6[_0xfe6f('0x34')][_0xfe6f('0x59')]){_0x2a246b[_0xfe6f('0x3e')]=_['merge'](_0x2a246b[_0xfe6f('0x3e')],{'$or':_['map'](_0x2a246b[_0xfe6f('0x38')],function(_0xf99e23){var _0x54d93b={};_0x54d93b[_0xf99e23]={'$like':'%'+_0x41dca6[_0xfe6f('0x34')][_0xfe6f('0x59')]+'%'};return _0x54d93b;})});}_0x2a246b=_[_0xfe6f('0x40')]({},_0x2a246b,_0x41dca6[_0xfe6f('0x48')]);return db[_0xfe6f('0x55')][_0xfe6f('0x5a')](_0x2a246b);}})[_0xfe6f('0x28')](function(_0x5976e0){if(_0x5976e0){return db[_0xfe6f('0x5b')][_0xfe6f('0x5c')]({'where':{'id':_[_0xfe6f('0x2f')](_0x5976e0,_0xfe6f('0x5d')),'role':_0xfe6f('0x5e')},'attributes':['id','name',_0xfe6f('0x5f'),_0xfe6f('0x60'),'createdAt']});}})['then'](function(_0x50a90a){if(_0x50a90a){return{'count':_0x50a90a[_0xfe6f('0x21')],'rows':_[_0xfe6f('0x2f')](_0x50a90a[_0xfe6f('0x44')],function(_0x2569d3){return{'membername':_0x2569d3['name'],'UserId':_0x2569d3['id'],'queue_name':_0x524776[_0xfe6f('0x2c')],'FaxQueueId':_0x524776['id'],'interface':util[_0xfe6f('0x61')](_0xfe6f('0x62'),_0xfe6f('0x63'),_0x2569d3[_0xfe6f('0x2c')]),'penalty':0x0,'paused':_0x2569d3[_0xfe6f('0x5f')],'createdAt':_0x2569d3[_0xfe6f('0x64')],'updatedAt':_0x2569d3['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x242188,_0x2a246b))[_0xfe6f('0x45')](handleError(_0x242188,null));};exports['getTeams']=function(_0x32cabf,_0x2ae0db,_0x218820){var _0x49b1dc={};var _0x16cf2a={};var _0x45463c;var _0xbfad05;return db[_0xfe6f('0x41')][_0xfe6f('0x65')]({'where':{'id':_0x32cabf['params']['id']}})['then'](handleEntityNotFound(_0x2ae0db,null))[_0xfe6f('0x28')](function(_0x379b91){if(_0x379b91){_0x45463c=_0x379b91;_0x16cf2a[_0xfe6f('0x33')]=_[_0xfe6f('0x35')](db[_0xfe6f('0x66')][_0xfe6f('0x30')]);_0x16cf2a['query']=_['keys'](_0x32cabf['query']);_0x16cf2a[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0x16cf2a[_0xfe6f('0x33')],_0x16cf2a['query']);_0x49b1dc[_0xfe6f('0x38')]=_['intersection'](_0x16cf2a[_0xfe6f('0x33')],qs[_0xfe6f('0x39')](_0x32cabf[_0xfe6f('0x34')]['fields']));_0x49b1dc[_0xfe6f('0x38')]=_0x49b1dc[_0xfe6f('0x38')][_0xfe6f('0x3a')]?_0x49b1dc[_0xfe6f('0x38')]:_0x16cf2a[_0xfe6f('0x33')];_0x49b1dc['order']=qs[_0xfe6f('0x3d')](_0x32cabf['query'][_0xfe6f('0x3d')]);_0x49b1dc[_0xfe6f('0x3e')]=qs[_0xfe6f('0x36')](_[_0xfe6f('0x57')](_0x32cabf['query'],_0x16cf2a['filters']));if(_0x32cabf[_0xfe6f('0x34')][_0xfe6f('0x59')]){_0x49b1dc[_0xfe6f('0x3e')]=_[_0xfe6f('0x40')](_0x49b1dc[_0xfe6f('0x3e')],{'$or':_[_0xfe6f('0x2f')](_0x49b1dc['attributes'],function(_0x4d34db){var _0x49f3c5={};_0x49f3c5[_0x4d34db]={'$like':'%'+_0x32cabf[_0xfe6f('0x34')][_0xfe6f('0x59')]+'%'};return _0x49f3c5;})});}_0x49b1dc=_['merge']({},_0x49b1dc,_0x32cabf['options']);return _0x45463c[_0xfe6f('0x67')](_0x49b1dc);}})[_0xfe6f('0x28')](function(_0x504ae3){if(_0x504ae3){_0xbfad05=_0x504ae3[_0xfe6f('0x3a')];if(!_0x32cabf[_0xfe6f('0x34')]['hasOwnProperty'](_0xfe6f('0x56'))){_0x49b1dc[_0xfe6f('0x20')]=qs['limit'](_0x32cabf[_0xfe6f('0x34')][_0xfe6f('0x20')]);_0x49b1dc['offset']=qs['offset'](_0x32cabf[_0xfe6f('0x34')]['offset']);}return _0x45463c[_0xfe6f('0x67')](_0x49b1dc);}})[_0xfe6f('0x28')](function(_0x154756){if(_0x154756){return _0x154756?{'count':_0xbfad05,'rows':_0x154756}:null;}})[_0xfe6f('0x28')](respondWithResult(_0x2ae0db,null))[_0xfe6f('0x45')](handleError(_0x2ae0db,null));};exports['addTeams']=function(_0x4c60fc,_0x2f9054,_0x69b33f){var _0x28b45e=_0x4c60fc['body'][_0xfe6f('0x68')];return db[_0xfe6f('0x66')]['findAll']({'where':{'id':_0x28b45e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe6f('0x69'),'attributes':['id',_0xfe6f('0x2c'),'online',_0xfe6f('0x6a'),'interface'],'raw':!![]}]})[_0xfe6f('0x28')](function(_0x45bcba){if(_0x45bcba){var _0xa961e1=_[_0xfe6f('0x6b')](_0x45bcba,function(_0x4d1174){var _0x191dbd=_0x4d1174['get']({'plain':!![]});return _0x191dbd[_0xfe6f('0x69')];});return db[_0xfe6f('0x41')][_0xfe6f('0x49')]({'where':{'id':_0x4c60fc[_0xfe6f('0x47')]['id']}})[_0xfe6f('0x28')](function(_0x43486b){return db[_0xfe6f('0x6c')][_0xfe6f('0x6d')](function(_0x1c1a9f){return _0x43486b['addTeams'](_0x28b45e,{'transaction':_0x1c1a9f})[_0xfe6f('0x28')](function(){return BPromise[_0xfe6f('0x6e')](_0xa961e1,function(_0x196c80){return db[_0xfe6f('0x55')]['findOrCreate']({'where':{'UserId':_0x196c80['id'],'FaxQueueId':_0x4c60fc['params']['id']},'transaction':_0x1c1a9f});});})[_0xfe6f('0x28')](function(){_0xa961e1['forEach'](function(_0x168b78){socket['emit']('userFaxQueue:save',{'UserId':_0x168b78['id'],'FaxQueueId':_0x43486b['id']});});});});});}})[_0xfe6f('0x28')](respondWithStatusCode(_0x2f9054,null))[_0xfe6f('0x45')](handleError(_0x2f9054,null));};exports[_0xfe6f('0x6f')]=function(_0x5ba885,_0x1f7319,_0x471042){return db[_0xfe6f('0x66')][_0xfe6f('0x5a')]({'where':{'id':_0x5ba885['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xfe6f('0x5b')],'as':_0xfe6f('0x69'),'attributes':['id'],'raw':!![]}]})[_0xfe6f('0x28')](handleEntityNotFound(_0x1f7319,null))[_0xfe6f('0x28')](function(_0x494d20){var _0x4c09b2=_[_0xfe6f('0x2f')](_0x494d20,'id');var _0x3e823f=[];var _0x54352e=[];var _0x251f16=squel[_0xfe6f('0x70')]();_0x251f16[_0xfe6f('0x71')](_0xfe6f('0x72'))[_0xfe6f('0x73')](_0xfe6f('0x74'),'tq')[_0xfe6f('0x75')]('user_has_teams','ut',_0xfe6f('0x76'))[_0xfe6f('0x3e')](_0xfe6f('0x77'),_0x5ba885[_0xfe6f('0x47')]['id']);for(var _0x25cc6d=0x0;_0x25cc6d<_0x494d20[_0xfe6f('0x3a')];_0x25cc6d+=0x1){let _0x21c489=_0x494d20[_0x25cc6d];for(var _0x193a2b=0x0;_0x193a2b<_0x21c489[_0xfe6f('0x69')][_0xfe6f('0x3a')];_0x193a2b+=0x1){let _0x369034=_0x21c489[_0xfe6f('0x69')][_0x193a2b];var _0x1b5379=_0x251f16[_0xfe6f('0x78')]();_0x1b5379['where']('ut.UserId\x20=\x20?',_0x369034['id']);_0x54352e[_0xfe6f('0x79')](db[_0xfe6f('0x6c')][_0xfe6f('0x34')](_0x1b5379['toString'](),{'type':db[_0xfe6f('0x6c')][_0xfe6f('0x7a')][_0xfe6f('0x7b')]})[_0xfe6f('0x28')](function(_0x53f226){if(_0x53f226[_0xfe6f('0x3a')]===0x1){return _0x369034['id'];}else{var _0x20c34a=_[_0xfe6f('0x7c')](_[_0xfe6f('0x2f')](_0x53f226,_0xfe6f('0x7d')),function(_0x2de9f7){return _[_0xfe6f('0x7e')](_0x4c09b2,_0x2de9f7);});if(_0x20c34a){return _0x369034['id'];}}}));}}return BPromise[_0xfe6f('0x7f')](_0x54352e)['then'](function(_0x5c0d6b){_0x3e823f=_(_0x3e823f)[_0xfe6f('0x80')](_0x5c0d6b)[_0xfe6f('0x81')]()[_0xfe6f('0x82')]();return db[_0xfe6f('0x41')][_0xfe6f('0x49')]({'where':{'id':_0x5ba885[_0xfe6f('0x47')]['id']}})['then'](function(_0x15da93){return db[_0xfe6f('0x6c')][_0xfe6f('0x6d')](function(_0x1c5287){return _0x15da93[_0xfe6f('0x6f')](_0x5ba885['query']['ids'],{'transaction':_0x1c5287})[_0xfe6f('0x28')](function(){if(!_[_0xfe6f('0x83')](_0x3e823f)){return _0x15da93['removeAgents'](_0x3e823f,{'transaction':_0x1c5287});}})['then'](function(){_0x3e823f[_0xfe6f('0x84')](function(_0x2931d3){socket[_0xfe6f('0x85')]('userFaxQueue:remove',{'UserId':_0x2931d3,'FaxQueueId':_0x15da93['id']});});});});});});})[_0xfe6f('0x28')](respondWithStatusCode(_0x1f7319,null))[_0xfe6f('0x45')](handleError(_0x1f7319,null));};exports[_0xfe6f('0x86')]=function(_0x582251,_0x1e9b75,_0x383de8){return db['FaxQueue'][_0xfe6f('0x49')]({'where':{'id':_0x582251['params']['id']}})['then'](handleEntityNotFound(_0x1e9b75,null))[_0xfe6f('0x28')](function(_0x5ca435){if(_0x5ca435){return _0x5ca435[_0xfe6f('0x86')](_0x582251[_0xfe6f('0x4b')]['ids'],_[_0xfe6f('0x87')](_0x582251['body'],[_0xfe6f('0x68'),'id'])||{})['spread'](function(_0x225deb){for(var _0x31bed4=0x0;_0x31bed4<_0x582251[_0xfe6f('0x4b')][_0xfe6f('0x68')][_0xfe6f('0x3a')];_0x31bed4+=0x1){socket['emit'](_0xfe6f('0x88'),{'UserId':Number(_0x582251[_0xfe6f('0x4b')][_0xfe6f('0x68')][_0x31bed4]),'FaxQueueId':Number(_0x582251[_0xfe6f('0x47')]['id'])});}return _0x225deb;});}})[_0xfe6f('0x28')](respondWithResult(_0x1e9b75,null))['catch'](handleError(_0x1e9b75,null));};exports[_0xfe6f('0x89')]=function(_0x242554,_0x402c58,_0x2c4d21){return db[_0xfe6f('0x41')][_0xfe6f('0x49')]({'where':{'id':_0x242554['params']['id']}})['then'](handleEntityNotFound(_0x402c58,null))[_0xfe6f('0x28')](function(_0x1d0519){if(_0x1d0519){return _0x1d0519[_0xfe6f('0x89')](_0x242554[_0xfe6f('0x34')][_0xfe6f('0x68')])['then'](function(){if(_['isArray'](_0x242554[_0xfe6f('0x34')][_0xfe6f('0x68')])){for(var _0x3be592=0x0;_0x3be592<_0x242554[_0xfe6f('0x34')][_0xfe6f('0x68')][_0xfe6f('0x3a')];_0x3be592+=0x1){socket[_0xfe6f('0x85')](_0xfe6f('0x8a'),{'UserId':Number(_0x242554['query'][_0xfe6f('0x68')][_0x3be592]),'FaxQueueId':Number(_0x242554[_0xfe6f('0x47')]['id'])});}}else{socket[_0xfe6f('0x85')](_0xfe6f('0x8a'),{'UserId':Number(_0x242554[_0xfe6f('0x34')]['ids']),'FaxQueueId':Number(_0x242554[_0xfe6f('0x47')]['id'])});}});}})[_0xfe6f('0x28')](respondWithStatusCode(_0x402c58,null))[_0xfe6f('0x45')](handleError(_0x402c58,null));};exports[_0xfe6f('0x8b')]=function(_0x3a84bf,_0x57d2a1,_0x24e04d){var _0x2b8224={};var _0xe87932={};var _0x252004;var _0x2d4ddc;return db[_0xfe6f('0x41')]['findOne']({'where':{'id':_0x3a84bf[_0xfe6f('0x47')]['id']}})[_0xfe6f('0x28')](handleEntityNotFound(_0x57d2a1,null))[_0xfe6f('0x28')](function(_0x27a134){if(_0x27a134){_0x252004=_0x27a134;_0xe87932['model']=_['keys'](db['User'][_0xfe6f('0x30')]);_0xe87932[_0xfe6f('0x34')]=_['keys'](_0x3a84bf[_0xfe6f('0x34')]);_0xe87932[_0xfe6f('0x36')]=_[_0xfe6f('0x37')](_0xe87932[_0xfe6f('0x33')],_0xe87932[_0xfe6f('0x34')]);_0x2b8224[_0xfe6f('0x38')]=_['intersection'](_0xe87932['model'],qs[_0xfe6f('0x39')](_0x3a84bf[_0xfe6f('0x34')]['fields']));_0x2b8224['attributes']=_0x2b8224[_0xfe6f('0x38')]['length']?_0x2b8224[_0xfe6f('0x38')]:_0xe87932[_0xfe6f('0x33')];_0x2b8224[_0xfe6f('0x3c')]=qs[_0xfe6f('0x3d')](_0x3a84bf[_0xfe6f('0x34')][_0xfe6f('0x3d')]);_0x2b8224[_0xfe6f('0x3e')]=qs[_0xfe6f('0x36')](_[_0xfe6f('0x57')](_0x3a84bf[_0xfe6f('0x34')],_0xe87932[_0xfe6f('0x36')]));if(_0x3a84bf[_0xfe6f('0x34')]['filter']){_0x2b8224['where']=_[_0xfe6f('0x40')](_0x2b8224['where'],{'$or':_[_0xfe6f('0x2f')](_0x2b8224[_0xfe6f('0x38')],function(_0xcf07cc){var _0x11497f={};_0x11497f[_0xcf07cc]={'$like':'%'+_0x3a84bf[_0xfe6f('0x34')][_0xfe6f('0x59')]+'%'};return _0x11497f;})});}_0x2b8224=_[_0xfe6f('0x40')]({},_0x2b8224,_0x3a84bf[_0xfe6f('0x48')]);return _0x252004[_0xfe6f('0x8b')](_0x2b8224);}})[_0xfe6f('0x28')](function(_0x27c428){if(_0x27c428){_0x2d4ddc=_0x27c428[_0xfe6f('0x3a')];if(!_0x3a84bf[_0xfe6f('0x34')]['hasOwnProperty'](_0xfe6f('0x56'))){_0x2b8224[_0xfe6f('0x20')]=qs['limit'](_0x3a84bf[_0xfe6f('0x34')]['limit']);_0x2b8224[_0xfe6f('0x22')]=qs[_0xfe6f('0x22')](_0x3a84bf['query'][_0xfe6f('0x22')]);}return _0x252004[_0xfe6f('0x8b')](_0x2b8224);}})[_0xfe6f('0x28')](function(_0x4f5516){if(_0x4f5516){return _0x4f5516?{'count':_0x2d4ddc,'rows':_0x4f5516}:null;}})[_0xfe6f('0x28')](respondWithResult(_0x57d2a1,null))[_0xfe6f('0x45')](handleError(_0x57d2a1,null));}; \ No newline at end of file +var _0xa8fc=['findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','Agents','voicePause','interface','sequelize','each','emit','userFaxQueue:save','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','all','union','value','transaction','removeTeams','isEmpty','forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','error','stack','name','send','map','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','where','filter','options','FaxQueue','include','findAll','rows','show','params','rawAttributes','includeAll','merge','find','catch','create','body','user','UserProfileSection','autoAssociation','UserProfileResource','describe','findOne','UserFaxQueue','hasOwnProperty','FaxQueueId','User'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa8fc,0x144));var _0xca8f=function(_0x1e3f3b,_0x2b6bf7){_0x1e3f3b=_0x1e3f3b-0x0;var _0x260a28=_0xa8fc[_0x1e3f3b];return _0x260a28;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca8f('0x0'));var zipdir=require(_0xca8f('0x1'));var jsonpatch=require(_0xca8f('0x2'));var rp=require(_0xca8f('0x3'));var moment=require(_0xca8f('0x4'));var BPromise=require(_0xca8f('0x5'));var Mustache=require(_0xca8f('0x6'));var util=require(_0xca8f('0x7'));var path=require('path');var sox=require(_0xca8f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xca8f('0x9'));var _=require(_0xca8f('0xa'));var squel=require(_0xca8f('0xb'));var crypto=require(_0xca8f('0xc'));var jsforce=require(_0xca8f('0xd'));var deskjs=require(_0xca8f('0xe'));var toCsv=require(_0xca8f('0xf'));var querystring=require(_0xca8f('0x10'));var Papa=require(_0xca8f('0x11'));var Redis=require(_0xca8f('0x12'));var authService=require(_0xca8f('0x13'));var qs=require(_0xca8f('0x14'));var as=require(_0xca8f('0x15'));var hardwareService=require(_0xca8f('0x16'));var logger=require(_0xca8f('0x17'))(_0xca8f('0x18'));var utils=require(_0xca8f('0x19'));var config=require(_0xca8f('0x1a'));var licenseUtil=require(_0xca8f('0x1b'));var db=require(_0xca8f('0x1c'))['db'];config[_0xca8f('0x1d')]=_[_0xca8f('0x1e')](config[_0xca8f('0x1d')],{'host':_0xca8f('0x1f'),'port':0x18eb});var socket=require(_0xca8f('0x20'))(new Redis(config['redis']));require(_0xca8f('0x21'))['register'](socket);function respondWithStatusCode(_0x5ddd00,_0x25840b){_0x25840b=_0x25840b||0xcc;return function(_0x381903){if(_0x381903){return _0x5ddd00['sendStatus'](_0x25840b);}return _0x5ddd00[_0xca8f('0x22')](_0x25840b)[_0xca8f('0x23')]();};}function respondWithResult(_0x2b564a,_0x1d260d){_0x1d260d=_0x1d260d||0xc8;return function(_0x32d719){if(_0x32d719){return _0x2b564a[_0xca8f('0x22')](_0x1d260d)[_0xca8f('0x24')](_0x32d719);}};}function respondWithFilteredResult(_0x33c8ee,_0x2f3170){return function(_0x102059){if(_0x102059){var _0xe936e1=typeof _0x2f3170[_0xca8f('0x25')]==='undefined'&&typeof _0x2f3170[_0xca8f('0x26')]==='undefined';var _0x104e2d=_0x102059[_0xca8f('0x27')];var _0x37b9e5=_0xe936e1?0x0:_0x2f3170[_0xca8f('0x25')];var _0x108487=_0xe936e1?_0x102059['count']:_0x2f3170[_0xca8f('0x25')]+_0x2f3170['limit'];var _0x4ef2b8;if(_0x108487>=_0x104e2d){_0x108487=_0x104e2d;_0x4ef2b8=0xc8;}else{_0x4ef2b8=0xce;}_0x33c8ee[_0xca8f('0x22')](_0x4ef2b8);return _0x33c8ee[_0xca8f('0x28')](_0xca8f('0x29'),_0x37b9e5+'-'+_0x108487+'/'+_0x104e2d)[_0xca8f('0x24')](_0x102059);}return null;};}function patchUpdates(_0x26c52b){return function(_0x4444fa){try{jsonpatch[_0xca8f('0x2a')](_0x4444fa,_0x26c52b,!![]);}catch(_0xd6623a){return BPromise[_0xca8f('0x2b')](_0xd6623a);}return _0x4444fa[_0xca8f('0x2c')]();};}function saveUpdates(_0x269b65,_0x589b9b){return function(_0x31fcf6){if(_0x31fcf6){return _0x31fcf6[_0xca8f('0x2d')](_0x269b65)['then'](function(_0x34a40c){return _0x34a40c;});}return null;};}function removeEntity(_0x13c98b,_0x4e3722){return function(_0x33b3eb){if(_0x33b3eb){return _0x33b3eb[_0xca8f('0x2e')]()[_0xca8f('0x2f')](function(){var _0x1545a8=_0x33b3eb[_0xca8f('0x30')]({'plain':!![]});var _0xfc6f62=_0xca8f('0x31');return db['UserProfileResource'][_0xca8f('0x2e')]({'where':{'type':_0xfc6f62,'resourceId':_0x1545a8['id']}})[_0xca8f('0x2f')](function(){return _0x33b3eb;});})[_0xca8f('0x2f')](function(){_0x13c98b[_0xca8f('0x22')](0xcc)[_0xca8f('0x23')]();});}};}function handleEntityNotFound(_0x104f0c,_0x690ae3){return function(_0x8ea58f){if(!_0x8ea58f){_0x104f0c['sendStatus'](0x194);}return _0x8ea58f;};}function handleError(_0x14b3db,_0x52262c){_0x52262c=_0x52262c||0x1f4;return function(_0x444195){logger[_0xca8f('0x32')](_0x444195[_0xca8f('0x33')]);if(_0x444195[_0xca8f('0x34')]){delete _0x444195[_0xca8f('0x34')];}_0x14b3db['status'](_0x52262c)[_0xca8f('0x35')](_0x444195);};}exports['index']=function(_0x3fac50,_0x456e96){var _0x26476b={},_0x32e7be={},_0x38b502={'count':0x0,'rows':[]};var _0x32ca75=_[_0xca8f('0x36')](db['FaxQueue']['rawAttributes'],function(_0x41b34a){return{'name':_0x41b34a[_0xca8f('0x37')],'type':_0x41b34a[_0xca8f('0x38')][_0xca8f('0x39')]};});_0x32e7be[_0xca8f('0x3a')]=_[_0xca8f('0x36')](_0x32ca75,_0xca8f('0x34'));_0x32e7be[_0xca8f('0x3b')]=_[_0xca8f('0x3c')](_0x3fac50[_0xca8f('0x3b')]);_0x32e7be[_0xca8f('0x3d')]=_['intersection'](_0x32e7be['model'],_0x32e7be[_0xca8f('0x3b')]);_0x26476b[_0xca8f('0x3e')]=_[_0xca8f('0x3f')](_0x32e7be[_0xca8f('0x3a')],qs[_0xca8f('0x40')](_0x3fac50['query']['fields']));_0x26476b['attributes']=_0x26476b[_0xca8f('0x3e')][_0xca8f('0x41')]?_0x26476b[_0xca8f('0x3e')]:_0x32e7be['model'];if(!_0x3fac50[_0xca8f('0x3b')]['hasOwnProperty'](_0xca8f('0x42'))){_0x26476b[_0xca8f('0x26')]=qs['limit'](_0x3fac50[_0xca8f('0x3b')][_0xca8f('0x26')]);_0x26476b[_0xca8f('0x25')]=qs[_0xca8f('0x25')](_0x3fac50['query']['offset']);}_0x26476b[_0xca8f('0x43')]=qs[_0xca8f('0x44')](_0x3fac50[_0xca8f('0x3b')][_0xca8f('0x44')]);_0x26476b['where']=qs[_0xca8f('0x3d')](_[_0xca8f('0x45')](_0x3fac50[_0xca8f('0x3b')],_0x32e7be[_0xca8f('0x3d')]),_0x32ca75);if(_0x3fac50[_0xca8f('0x3b')]['filter']){_0x26476b[_0xca8f('0x46')]=_['merge'](_0x26476b[_0xca8f('0x46')],{'$or':_['map'](_0x32ca75,function(_0x434dc1){if(_0x434dc1[_0xca8f('0x38')]!=='VIRTUAL'){var _0x2683d9={};_0x2683d9[_0x434dc1['name']]={'$like':'%'+_0x3fac50[_0xca8f('0x3b')][_0xca8f('0x47')]+'%'};return _0x2683d9;}})});}_0x26476b=_['merge']({},_0x26476b,_0x3fac50[_0xca8f('0x48')]);var _0x18e99f={'where':_0x26476b['where']};return db[_0xca8f('0x49')][_0xca8f('0x27')](_0x18e99f)['then'](function(_0x2a3de6){_0x38b502[_0xca8f('0x27')]=_0x2a3de6;if(_0x3fac50[_0xca8f('0x3b')]['includeAll']){_0x26476b[_0xca8f('0x4a')]=[{'all':!![]}];}return db[_0xca8f('0x49')][_0xca8f('0x4b')](_0x26476b);})[_0xca8f('0x2f')](function(_0x484d76){_0x38b502[_0xca8f('0x4c')]=_0x484d76;return _0x38b502;})['then'](respondWithFilteredResult(_0x456e96,_0x26476b))['catch'](handleError(_0x456e96,null));};exports[_0xca8f('0x4d')]=function(_0xb7f251,_0x4cee85){var _0x455f9a={'raw':!![],'where':{'id':_0xb7f251[_0xca8f('0x4e')]['id']}},_0x392652={};_0x392652[_0xca8f('0x3a')]=_[_0xca8f('0x3c')](db[_0xca8f('0x49')][_0xca8f('0x4f')]);_0x392652[_0xca8f('0x3b')]=_[_0xca8f('0x3c')](_0xb7f251[_0xca8f('0x3b')]);_0x392652[_0xca8f('0x3d')]=_[_0xca8f('0x3f')](_0x392652[_0xca8f('0x3a')],_0x392652[_0xca8f('0x3b')]);_0x455f9a['attributes']=_[_0xca8f('0x3f')](_0x392652['model'],qs['fields'](_0xb7f251[_0xca8f('0x3b')][_0xca8f('0x40')]));_0x455f9a[_0xca8f('0x3e')]=_0x455f9a[_0xca8f('0x3e')][_0xca8f('0x41')]?_0x455f9a[_0xca8f('0x3e')]:_0x392652[_0xca8f('0x3a')];if(_0xb7f251[_0xca8f('0x3b')][_0xca8f('0x50')]){_0x455f9a['include']=[{'all':!![]}];}_0x455f9a=_[_0xca8f('0x51')]({},_0x455f9a,_0xb7f251[_0xca8f('0x48')]);return db[_0xca8f('0x49')][_0xca8f('0x52')](_0x455f9a)[_0xca8f('0x2f')](handleEntityNotFound(_0x4cee85,null))[_0xca8f('0x2f')](respondWithResult(_0x4cee85,null))[_0xca8f('0x53')](handleError(_0x4cee85,null));};exports[_0xca8f('0x54')]=function(_0x15f3b9,_0x5a1455){return db[_0xca8f('0x49')][_0xca8f('0x54')](_0x15f3b9[_0xca8f('0x55')],{})[_0xca8f('0x2f')](function(_0x242f37){var _0xf866b=_0x15f3b9[_0xca8f('0x56')][_0xca8f('0x30')]({'plain':!![]});if(!_0xf866b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xf866b['role']===_0xca8f('0x56')){var _0x425f12=_0x242f37[_0xca8f('0x30')]({'plain':!![]});var _0x458390=_0xca8f('0x31');return db[_0xca8f('0x57')][_0xca8f('0x52')]({'where':{'name':_0x458390,'userProfileId':_0xf866b['userProfileId']},'raw':!![]})[_0xca8f('0x2f')](function(_0x240245){if(_0x240245&&_0x240245[_0xca8f('0x58')]===0x0){return db[_0xca8f('0x59')][_0xca8f('0x54')]({'name':_0x425f12[_0xca8f('0x34')],'resourceId':_0x425f12['id'],'type':_0x240245[_0xca8f('0x34')],'sectionId':_0x240245['id']},{})[_0xca8f('0x2f')](function(){return _0x242f37;});}else{return _0x242f37;}})[_0xca8f('0x53')](function(_0x478b2b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x478b2b);throw _0x478b2b;});}return _0x242f37;})[_0xca8f('0x2f')](respondWithResult(_0x5a1455,0xc9))[_0xca8f('0x53')](handleError(_0x5a1455,null));};exports[_0xca8f('0x2d')]=function(_0x1f5e50,_0x34bb25){if(_0x1f5e50[_0xca8f('0x55')]['id']){delete _0x1f5e50[_0xca8f('0x55')]['id'];}return db['FaxQueue']['find']({'where':{'id':_0x1f5e50[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](handleEntityNotFound(_0x34bb25,null))[_0xca8f('0x2f')](saveUpdates(_0x1f5e50[_0xca8f('0x55')],null))[_0xca8f('0x2f')](respondWithResult(_0x34bb25,null))['catch'](handleError(_0x34bb25,null));};exports[_0xca8f('0x2e')]=function(_0x4a581b,_0x1c447f){return db[_0xca8f('0x49')][_0xca8f('0x52')]({'where':{'id':_0x4a581b[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](handleEntityNotFound(_0x1c447f,null))[_0xca8f('0x2f')](removeEntity(_0x1c447f,null))[_0xca8f('0x53')](handleError(_0x1c447f,null));};exports[_0xca8f('0x5a')]=function(_0x4683a8,_0x48eaef){return db[_0xca8f('0x49')][_0xca8f('0x5a')]()[_0xca8f('0x2f')](respondWithResult(_0x48eaef,null))[_0xca8f('0x53')](handleError(_0x48eaef,null));};exports['getMembers']=function(_0x3b606a,_0x4b1bec,_0x19c2e6){var _0x208356={'raw':!![],'where':{}},_0x144871={},_0x2499e6;return db[_0xca8f('0x49')][_0xca8f('0x5b')]({'where':{'id':_0x3b606a['params']['id']}})['then'](handleEntityNotFound(_0x4b1bec,null))[_0xca8f('0x2f')](function(_0x10c84b){if(_0x10c84b){_0x2499e6=_0x10c84b['get']({'plain':!![]});_0x144871[_0xca8f('0x3a')]=_[_0xca8f('0x3c')](db[_0xca8f('0x5c')][_0xca8f('0x4f')]);_0x144871[_0xca8f('0x3b')]=_['keys'](_0x3b606a[_0xca8f('0x3b')]);_0x144871[_0xca8f('0x3d')]=_['intersection'](_0x144871[_0xca8f('0x3a')],_0x144871[_0xca8f('0x3b')]);_0x208356[_0xca8f('0x3e')]=_[_0xca8f('0x3f')](_0x144871[_0xca8f('0x3a')],qs[_0xca8f('0x40')](_0x3b606a[_0xca8f('0x3b')]['fields']));_0x208356[_0xca8f('0x3e')]=_0x208356[_0xca8f('0x3e')][_0xca8f('0x41')]?_0x208356[_0xca8f('0x3e')]:_0x144871[_0xca8f('0x3a')];if(!_0x3b606a[_0xca8f('0x3b')][_0xca8f('0x5d')]('nolimit')){_0x208356[_0xca8f('0x26')]=qs['limit'](_0x3b606a['query'][_0xca8f('0x26')]);_0x208356[_0xca8f('0x25')]=qs[_0xca8f('0x25')](_0x3b606a[_0xca8f('0x3b')][_0xca8f('0x25')]);}_0x208356[_0xca8f('0x43')]=qs[_0xca8f('0x44')](_0x3b606a['query'][_0xca8f('0x44')]);_0x208356[_0xca8f('0x46')]=qs[_0xca8f('0x3d')](_[_0xca8f('0x45')](_0x3b606a[_0xca8f('0x3b')],_0x144871['filters']));_0x208356[_0xca8f('0x46')][_0xca8f('0x5e')]=_0x10c84b['id'];if(_0x3b606a[_0xca8f('0x3b')][_0xca8f('0x47')]){_0x208356[_0xca8f('0x46')]=_[_0xca8f('0x51')](_0x208356[_0xca8f('0x46')],{'$or':_[_0xca8f('0x36')](_0x208356['attributes'],function(_0x32910d){var _0x405266={};_0x405266[_0x32910d]={'$like':'%'+_0x3b606a[_0xca8f('0x3b')][_0xca8f('0x47')]+'%'};return _0x405266;})});}_0x208356=_[_0xca8f('0x51')]({},_0x208356,_0x3b606a[_0xca8f('0x48')]);return db['UserFaxQueue']['findAll'](_0x208356);}})[_0xca8f('0x2f')](function(_0x12b563){if(_0x12b563){return db[_0xca8f('0x5f')][_0xca8f('0x60')]({'where':{'id':_[_0xca8f('0x36')](_0x12b563,_0xca8f('0x61')),'role':_0xca8f('0x62')},'attributes':['id','name',_0xca8f('0x63'),_0xca8f('0x64'),_0xca8f('0x65')]});}})[_0xca8f('0x2f')](function(_0x206d74){if(_0x206d74){return{'count':_0x206d74['count'],'rows':_[_0xca8f('0x36')](_0x206d74['rows'],function(_0x435b91){return{'membername':_0x435b91['name'],'UserId':_0x435b91['id'],'queue_name':_0x2499e6['name'],'FaxQueueId':_0x2499e6['id'],'interface':util[_0xca8f('0x66')]('%s/%s','SIP',_0x435b91[_0xca8f('0x34')]),'penalty':0x0,'paused':_0x435b91[_0xca8f('0x63')],'createdAt':_0x435b91[_0xca8f('0x65')],'updatedAt':_0x435b91[_0xca8f('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xca8f('0x2f')](respondWithFilteredResult(_0x4b1bec,_0x208356))[_0xca8f('0x53')](handleError(_0x4b1bec,null));};exports[_0xca8f('0x67')]=function(_0x52b1ac,_0x195298,_0xc2adf1){var _0x2910e5={};var _0x1780cf={};var _0x12f0ad;var _0x427cf3;return db[_0xca8f('0x49')]['findOne']({'where':{'id':_0x52b1ac[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](handleEntityNotFound(_0x195298,null))['then'](function(_0x4ed1e6){if(_0x4ed1e6){_0x12f0ad=_0x4ed1e6;_0x1780cf[_0xca8f('0x3a')]=_['keys'](db[_0xca8f('0x68')][_0xca8f('0x4f')]);_0x1780cf[_0xca8f('0x3b')]=_['keys'](_0x52b1ac[_0xca8f('0x3b')]);_0x1780cf[_0xca8f('0x3d')]=_[_0xca8f('0x3f')](_0x1780cf[_0xca8f('0x3a')],_0x1780cf['query']);_0x2910e5[_0xca8f('0x3e')]=_['intersection'](_0x1780cf[_0xca8f('0x3a')],qs[_0xca8f('0x40')](_0x52b1ac[_0xca8f('0x3b')][_0xca8f('0x40')]));_0x2910e5[_0xca8f('0x3e')]=_0x2910e5['attributes'][_0xca8f('0x41')]?_0x2910e5[_0xca8f('0x3e')]:_0x1780cf['model'];_0x2910e5[_0xca8f('0x43')]=qs['sort'](_0x52b1ac[_0xca8f('0x3b')]['sort']);_0x2910e5[_0xca8f('0x46')]=qs[_0xca8f('0x3d')](_[_0xca8f('0x45')](_0x52b1ac[_0xca8f('0x3b')],_0x1780cf['filters']));if(_0x52b1ac[_0xca8f('0x3b')][_0xca8f('0x47')]){_0x2910e5['where']=_[_0xca8f('0x51')](_0x2910e5['where'],{'$or':_[_0xca8f('0x36')](_0x2910e5[_0xca8f('0x3e')],function(_0x463ac4){var _0x294c8d={};_0x294c8d[_0x463ac4]={'$like':'%'+_0x52b1ac[_0xca8f('0x3b')]['filter']+'%'};return _0x294c8d;})});}_0x2910e5=_[_0xca8f('0x51')]({},_0x2910e5,_0x52b1ac[_0xca8f('0x48')]);return _0x12f0ad[_0xca8f('0x67')](_0x2910e5);}})[_0xca8f('0x2f')](function(_0x5e3b07){if(_0x5e3b07){_0x427cf3=_0x5e3b07[_0xca8f('0x41')];if(!_0x52b1ac[_0xca8f('0x3b')]['hasOwnProperty'](_0xca8f('0x42'))){_0x2910e5[_0xca8f('0x26')]=qs[_0xca8f('0x26')](_0x52b1ac[_0xca8f('0x3b')][_0xca8f('0x26')]);_0x2910e5['offset']=qs[_0xca8f('0x25')](_0x52b1ac['query'][_0xca8f('0x25')]);}return _0x12f0ad[_0xca8f('0x67')](_0x2910e5);}})['then'](function(_0x1e763b){if(_0x1e763b){return _0x1e763b?{'count':_0x427cf3,'rows':_0x1e763b}:null;}})[_0xca8f('0x2f')](respondWithResult(_0x195298,null))[_0xca8f('0x53')](handleError(_0x195298,null));};exports[_0xca8f('0x69')]=function(_0x4c14e9,_0x1fa9a9,_0x514906){var _0x175c1f=_0x4c14e9[_0xca8f('0x55')][_0xca8f('0x6a')];return db[_0xca8f('0x68')][_0xca8f('0x4b')]({'where':{'id':_0x175c1f},'attributes':['id'],'include':[{'model':db[_0xca8f('0x5f')],'as':_0xca8f('0x6b'),'attributes':['id','name','online',_0xca8f('0x6c'),_0xca8f('0x6d')],'raw':!![]}]})[_0xca8f('0x2f')](function(_0x4d95b9){if(_0x4d95b9){var _0x4ca9df=_['flatMap'](_0x4d95b9,function(_0x541bda){var _0x445e14=_0x541bda[_0xca8f('0x30')]({'plain':!![]});return _0x445e14['Agents'];});return db[_0xca8f('0x49')]['find']({'where':{'id':_0x4c14e9[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](function(_0x1eeeda){return db[_0xca8f('0x6e')]['transaction'](function(_0x1441a5){return _0x1eeeda[_0xca8f('0x69')](_0x175c1f,{'transaction':_0x1441a5})[_0xca8f('0x2f')](function(){return BPromise[_0xca8f('0x6f')](_0x4ca9df,function(_0x12959f){return db[_0xca8f('0x5c')]['findOrCreate']({'where':{'UserId':_0x12959f['id'],'FaxQueueId':_0x4c14e9[_0xca8f('0x4e')]['id']},'transaction':_0x1441a5});});})['then'](function(){_0x4ca9df['forEach'](function(_0x1414d0){socket[_0xca8f('0x70')](_0xca8f('0x71'),{'UserId':_0x1414d0['id'],'FaxQueueId':_0x1eeeda['id']});});});});});}})[_0xca8f('0x2f')](respondWithStatusCode(_0x1fa9a9,null))[_0xca8f('0x53')](handleError(_0x1fa9a9,null));};exports['removeTeams']=function(_0x31f82f,_0x1f08d5,_0x214392){return db['Team']['findAll']({'where':{'id':_0x31f82f[_0xca8f('0x3b')]['ids']},'attributes':['id'],'include':[{'model':db[_0xca8f('0x5f')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xca8f('0x2f')](handleEntityNotFound(_0x1f08d5,null))['then'](function(_0x54e6cc){var _0x5b9fa1=_[_0xca8f('0x36')](_0x54e6cc,'id');var _0x397f69=[];var _0xdb13c2=[];var _0x2c3390=squel[_0xca8f('0x72')]();_0x2c3390[_0xca8f('0x73')](_0xca8f('0x74'))['from']('team_has_fax_queues','tq')[_0xca8f('0x75')](_0xca8f('0x76'),'ut',_0xca8f('0x77'))[_0xca8f('0x46')](_0xca8f('0x78'),_0x31f82f['params']['id']);for(var _0x3c2a52=0x0;_0x3c2a52<_0x54e6cc['length'];_0x3c2a52+=0x1){let _0x5d1f7b=_0x54e6cc[_0x3c2a52];for(var _0x322b5a=0x0;_0x322b5a<_0x5d1f7b['Agents']['length'];_0x322b5a+=0x1){let _0x994e3f=_0x5d1f7b['Agents'][_0x322b5a];var _0x542118=_0x2c3390['clone']();_0x542118[_0xca8f('0x46')]('ut.UserId\x20=\x20?',_0x994e3f['id']);_0xdb13c2[_0xca8f('0x79')](db[_0xca8f('0x6e')]['query'](_0x542118[_0xca8f('0x7a')](),{'type':db[_0xca8f('0x6e')][_0xca8f('0x7b')]['SELECT']})['then'](function(_0x33d6b1){if(_0x33d6b1[_0xca8f('0x41')]===0x1){return _0x994e3f['id'];}else{var _0x155b9a=_[_0xca8f('0x7c')](_[_0xca8f('0x36')](_0x33d6b1,_0xca8f('0x7d')),function(_0x39650c){return _[_0xca8f('0x7e')](_0x5b9fa1,_0x39650c);});if(_0x155b9a){return _0x994e3f['id'];}}}));}}return BPromise[_0xca8f('0x7f')](_0xdb13c2)[_0xca8f('0x2f')](function(_0xf23aa9){_0x397f69=_(_0x397f69)[_0xca8f('0x80')](_0xf23aa9)['compact']()[_0xca8f('0x81')]();return db[_0xca8f('0x49')][_0xca8f('0x52')]({'where':{'id':_0x31f82f[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](function(_0x1e7cd9){return db['sequelize'][_0xca8f('0x82')](function(_0x25d5f7){return _0x1e7cd9[_0xca8f('0x83')](_0x31f82f['query']['ids'],{'transaction':_0x25d5f7})[_0xca8f('0x2f')](function(){if(!_[_0xca8f('0x84')](_0x397f69)){return _0x1e7cd9['removeAgents'](_0x397f69,{'transaction':_0x25d5f7});}})['then'](function(){_0x397f69[_0xca8f('0x85')](function(_0x52202a){socket['emit'](_0xca8f('0x86'),{'UserId':_0x52202a,'FaxQueueId':_0x1e7cd9['id']});});});});});});})['then'](respondWithStatusCode(_0x1f08d5,null))[_0xca8f('0x53')](handleError(_0x1f08d5,null));};exports[_0xca8f('0x87')]=function(_0x37b92c,_0x2b820b,_0x25c82c){return db[_0xca8f('0x49')][_0xca8f('0x52')]({'where':{'id':_0x37b92c[_0xca8f('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2b820b,null))['then'](function(_0x57ed1a){if(_0x57ed1a){return _0x57ed1a['addAgents'](_0x37b92c['body'][_0xca8f('0x6a')],_[_0xca8f('0x88')](_0x37b92c['body'],[_0xca8f('0x6a'),'id'])||{})[_0xca8f('0x89')](function(_0x4a91dd){for(var _0x5a48ef=0x0;_0x5a48ef<_0x37b92c['body'][_0xca8f('0x6a')][_0xca8f('0x41')];_0x5a48ef+=0x1){socket[_0xca8f('0x70')](_0xca8f('0x71'),{'UserId':Number(_0x37b92c[_0xca8f('0x55')][_0xca8f('0x6a')][_0x5a48ef]),'FaxQueueId':Number(_0x37b92c[_0xca8f('0x4e')]['id'])});}return _0x4a91dd;});}})[_0xca8f('0x2f')](respondWithResult(_0x2b820b,null))[_0xca8f('0x53')](handleError(_0x2b820b,null));};exports['removeAgents']=function(_0x3e79da,_0x3587e3,_0x45f776){return db[_0xca8f('0x49')]['find']({'where':{'id':_0x3e79da[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](handleEntityNotFound(_0x3587e3,null))[_0xca8f('0x2f')](function(_0x183f6e){if(_0x183f6e){return _0x183f6e['removeAgents'](_0x3e79da[_0xca8f('0x3b')]['ids'])['then'](function(){if(_[_0xca8f('0x8a')](_0x3e79da[_0xca8f('0x3b')]['ids'])){for(var _0x2e619e=0x0;_0x2e619e<_0x3e79da[_0xca8f('0x3b')][_0xca8f('0x6a')][_0xca8f('0x41')];_0x2e619e+=0x1){socket[_0xca8f('0x70')](_0xca8f('0x86'),{'UserId':Number(_0x3e79da[_0xca8f('0x3b')][_0xca8f('0x6a')][_0x2e619e]),'FaxQueueId':Number(_0x3e79da[_0xca8f('0x4e')]['id'])});}}else{socket[_0xca8f('0x70')](_0xca8f('0x86'),{'UserId':Number(_0x3e79da[_0xca8f('0x3b')][_0xca8f('0x6a')]),'FaxQueueId':Number(_0x3e79da['params']['id'])});}});}})[_0xca8f('0x2f')](respondWithStatusCode(_0x3587e3,null))[_0xca8f('0x53')](handleError(_0x3587e3,null));};exports['getAgents']=function(_0x51e8ee,_0x178eb7,_0x136806){var _0x3d2204={};var _0x3294b8={};var _0x2010c4;var _0x4fe4ad;return db[_0xca8f('0x49')][_0xca8f('0x5b')]({'where':{'id':_0x51e8ee[_0xca8f('0x4e')]['id']}})[_0xca8f('0x2f')](handleEntityNotFound(_0x178eb7,null))[_0xca8f('0x2f')](function(_0x5270a8){if(_0x5270a8){_0x2010c4=_0x5270a8;_0x3294b8[_0xca8f('0x3a')]=_[_0xca8f('0x3c')](db[_0xca8f('0x5f')][_0xca8f('0x4f')]);_0x3294b8[_0xca8f('0x3b')]=_[_0xca8f('0x3c')](_0x51e8ee[_0xca8f('0x3b')]);_0x3294b8[_0xca8f('0x3d')]=_['intersection'](_0x3294b8['model'],_0x3294b8[_0xca8f('0x3b')]);_0x3d2204[_0xca8f('0x3e')]=_[_0xca8f('0x3f')](_0x3294b8[_0xca8f('0x3a')],qs[_0xca8f('0x40')](_0x51e8ee[_0xca8f('0x3b')][_0xca8f('0x40')]));_0x3d2204[_0xca8f('0x3e')]=_0x3d2204[_0xca8f('0x3e')][_0xca8f('0x41')]?_0x3d2204[_0xca8f('0x3e')]:_0x3294b8['model'];_0x3d2204['order']=qs[_0xca8f('0x44')](_0x51e8ee[_0xca8f('0x3b')][_0xca8f('0x44')]);_0x3d2204['where']=qs[_0xca8f('0x3d')](_[_0xca8f('0x45')](_0x51e8ee[_0xca8f('0x3b')],_0x3294b8['filters']));if(_0x51e8ee[_0xca8f('0x3b')][_0xca8f('0x47')]){_0x3d2204[_0xca8f('0x46')]=_[_0xca8f('0x51')](_0x3d2204[_0xca8f('0x46')],{'$or':_[_0xca8f('0x36')](_0x3d2204['attributes'],function(_0x5237df){var _0xd1c92c={};_0xd1c92c[_0x5237df]={'$like':'%'+_0x51e8ee[_0xca8f('0x3b')][_0xca8f('0x47')]+'%'};return _0xd1c92c;})});}_0x3d2204=_[_0xca8f('0x51')]({},_0x3d2204,_0x51e8ee[_0xca8f('0x48')]);return _0x2010c4[_0xca8f('0x8b')](_0x3d2204);}})[_0xca8f('0x2f')](function(_0x93e2e4){if(_0x93e2e4){_0x4fe4ad=_0x93e2e4['length'];if(!_0x51e8ee[_0xca8f('0x3b')]['hasOwnProperty'](_0xca8f('0x42'))){_0x3d2204['limit']=qs[_0xca8f('0x26')](_0x51e8ee[_0xca8f('0x3b')]['limit']);_0x3d2204[_0xca8f('0x25')]=qs['offset'](_0x51e8ee[_0xca8f('0x3b')][_0xca8f('0x25')]);}return _0x2010c4[_0xca8f('0x8b')](_0x3d2204);}})['then'](function(_0x4929ae){if(_0x4929ae){return _0x4929ae?{'count':_0x4fe4ad,'rows':_0x4929ae}:null;}})[_0xca8f('0x2f')](respondWithResult(_0x178eb7,null))[_0xca8f('0x53')](handleError(_0x178eb7,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 58de36a..681fdee 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 _0xf11b=['remove','emit','exports','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x6f10c5,_0x40d6e3){var _0x54cbaa=function(_0x4aa25f){while(--_0x4aa25f){_0x6f10c5['push'](_0x6f10c5['shift']());}};_0x54cbaa(++_0x40d6e3);}(_0xf11b,0xdb));var _0xbf11=function(_0x959354,_0x21b8cc){_0x959354=_0x959354-0x0;var _0x49adb8=_0xf11b[_0x959354];return _0x49adb8;};'use strict';var EventEmitter=require(_0xbf11('0x0'));var FaxQueue=require(_0xbf11('0x1'))['db'][_0xbf11('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbf11('0x3')](0x0);var events={'afterCreate':_0xbf11('0x4'),'afterUpdate':'update','afterDestroy':_0xbf11('0x5')};function emitEvent(_0x3aa23a){return function(_0x5ae06b,_0x39d9e3,_0x581e20){FaxQueueEvents[_0xbf11('0x6')](_0x3aa23a+':'+_0x5ae06b['id'],_0x5ae06b);FaxQueueEvents[_0xbf11('0x6')](_0x3aa23a,_0x5ae06b);_0x581e20(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0xbf11('0x7')]=FaxQueueEvents; \ No newline at end of file +var _0x5b46=['emit','hook','exports','../../mysqldb','FaxQueue','setMaxListeners','save','update','remove'];(function(_0x23c7e9,_0x5a82d9){var _0x507ced=function(_0x210e44){while(--_0x210e44){_0x23c7e9['push'](_0x23c7e9['shift']());}};_0x507ced(++_0x5a82d9);}(_0x5b46,0x1c5));var _0x65b4=function(_0x1fc572,_0x2bd167){_0x1fc572=_0x1fc572-0x0;var _0x162000=_0x5b46[_0x1fc572];return _0x162000;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x65b4('0x0'))['db'][_0x65b4('0x1')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x65b4('0x2')](0x0);var events={'afterCreate':_0x65b4('0x3'),'afterUpdate':_0x65b4('0x4'),'afterDestroy':_0x65b4('0x5')};function emitEvent(_0x190123){return function(_0x45e107,_0x2502d8,_0x567a7f){FaxQueueEvents[_0x65b4('0x6')](_0x190123+':'+_0x45e107['id'],_0x45e107);FaxQueueEvents['emit'](_0x190123,_0x45e107);_0x567a7f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0x65b4('0x7')](e,emitEvent(event));}}module[_0x65b4('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 011fe88..9275069 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 _0x064d=['define','FaxQueue','fax_queues','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x15bfc9,_0x1644ab){var _0x2577cf=function(_0x556e62){while(--_0x556e62){_0x15bfc9['push'](_0x15bfc9['shift']());}};_0x2577cf(++_0x1644ab);}(_0x064d,0x71));var _0xd064=function(_0x1c661c,_0x530be2){_0x1c661c=_0x1c661c-0x0;var _0x32a1e8=_0x064d[_0x1c661c];return _0x32a1e8;};'use strict';var _=require('lodash');var util=require(_0xd064('0x0'));var logger=require(_0xd064('0x1'))(_0xd064('0x2'));var moment=require('moment');var BPromise=require(_0xd064('0x3'));var rp=require(_0xd064('0x4'));var fs=require('fs');var path=require(_0xd064('0x5'));var rimraf=require(_0xd064('0x6'));var config=require(_0xd064('0x7'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x558424,_0xa332a9){return _0x558424[_0xd064('0x8')](_0xd064('0x9'),attributes,{'tableName':_0xd064('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x76ec=['FaxQueue','fax_queues','api','bluebird','request-promise','rimraf','../../config/environment','./faxQueue.attributes','define'];(function(_0x3bfae3,_0x154aa8){var _0xf20265=function(_0xbfea9f){while(--_0xbfea9f){_0x3bfae3['push'](_0x3bfae3['shift']());}};_0xf20265(++_0x154aa8);}(_0x76ec,0x146));var _0xc76e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x76ec[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xc76e('0x0'));var moment=require('moment');var BPromise=require(_0xc76e('0x1'));var rp=require(_0xc76e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc76e('0x3'));var config=require(_0xc76e('0x4'));var attributes=require(_0xc76e('0x5'));module['exports']=function(_0x142c60,_0x28a76d){return _0x142c60[_0xc76e('0x6')](_0xc76e('0x7'),attributes,{'tableName':_0xc76e('0x8'),'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 af91eb2..697dd18 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 _0x3919=['find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','register','request','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueue,\x20%s,\x20%s','message','result','catch','GetFaxQueue','FaxQueue','raw','options','where','attributes','map','include','model','then','ShowFaxQueue'];(function(_0x20f04c,_0x2f93ba){var _0x43b694=function(_0x3b8e54){while(--_0x3b8e54){_0x20f04c['push'](_0x20f04c['shift']());}};_0x43b694(++_0x2f93ba);}(_0x3919,0x73));var _0x9391=function(_0x388b95,_0x558d40){_0x388b95=_0x388b95-0x0;var _0x415a7a=_0x3919[_0x388b95];return _0x415a7a;};'use strict';var _=require(_0x9391('0x0'));var util=require(_0x9391('0x1'));var moment=require(_0x9391('0x2'));var BPromise=require(_0x9391('0x3'));var rs=require(_0x9391('0x4'));var fs=require('fs');var Redis=require(_0x9391('0x5'));var db=require(_0x9391('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9391('0x7'))(_0x9391('0x8'));var config=require(_0x9391('0x9'));var jayson=require(_0x9391('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x9391('0xb')]=_[_0x9391('0xc')](config[_0x9391('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9391('0xb')]));require('./faxQueue.socket')[_0x9391('0xd')](socket);function respondWithRpcPromise(_0x465abc,_0x940648,_0x13f2de){return new BPromise(function(_0x4e2254,_0x1e3f53){return client[_0x9391('0xe')](_0x465abc,_0x13f2de)['then'](function(_0x15adf3){logger[_0x9391('0xf')]('FaxQueue,\x20%s,\x20%s',_0x940648,_0x9391('0x10'));logger[_0x9391('0x11')](_0x9391('0x12'),_0x940648,_0x9391('0x10'),JSON[_0x9391('0x13')](_0x15adf3));if(_0x15adf3[_0x9391('0x14')]){if(_0x15adf3[_0x9391('0x14')][_0x9391('0x15')]===0x1f4){logger[_0x9391('0x14')](_0x9391('0x16'),_0x940648,_0x15adf3['error']['message']);return _0x1e3f53(_0x15adf3[_0x9391('0x14')]['message']);}logger[_0x9391('0x14')]('FaxQueue,\x20%s,\x20%s',_0x940648,_0x15adf3[_0x9391('0x14')][_0x9391('0x17')]);return _0x4e2254(_0x15adf3['error'][_0x9391('0x17')]);}else{logger[_0x9391('0xf')](_0x9391('0x16'),_0x940648,_0x9391('0x10'));_0x4e2254(_0x15adf3[_0x9391('0x18')]['message']);}})[_0x9391('0x19')](function(_0x211a8e){logger[_0x9391('0x14')](_0x9391('0x16'),_0x940648,_0x211a8e);_0x1e3f53(_0x211a8e);});});}exports[_0x9391('0x1a')]=function(_0x1ca01e){var _0x465cf2=this;return new Promise(function(_0xf0f787,_0x2f06ed){return db[_0x9391('0x1b')]['findAll']({'raw':_0x1ca01e['options']?_0x1ca01e['options'][_0x9391('0x1c')]===undefined?!![]:![]:!![],'where':_0x1ca01e[_0x9391('0x1d')]?_0x1ca01e[_0x9391('0x1d')][_0x9391('0x1e')]||null:null,'attributes':_0x1ca01e[_0x9391('0x1d')]?_0x1ca01e[_0x9391('0x1d')][_0x9391('0x1f')]||null:null,'limit':_0x1ca01e[_0x9391('0x1d')]?_0x1ca01e[_0x9391('0x1d')]['limit']||null:null,'include':_0x1ca01e['options']?_0x1ca01e[_0x9391('0x1d')]['include']?_[_0x9391('0x20')](_0x1ca01e[_0x9391('0x1d')][_0x9391('0x21')],function(_0x2d986b){return{'model':db[_0x2d986b[_0x9391('0x22')]],'as':_0x2d986b['as'],'attributes':_0x2d986b[_0x9391('0x1f')],'include':_0x2d986b[_0x9391('0x21')]?_[_0x9391('0x20')](_0x2d986b[_0x9391('0x21')],function(_0x9575e0){return{'model':db[_0x9575e0[_0x9391('0x22')]],'as':_0x9575e0['as'],'attributes':_0x9575e0[_0x9391('0x1f')],'include':_0x9575e0[_0x9391('0x21')]?_[_0x9391('0x20')](_0x9575e0[_0x9391('0x21')],function(_0x2c5c09){return{'model':db[_0x2c5c09[_0x9391('0x22')]],'as':_0x2c5c09['as'],'attributes':_0x2c5c09[_0x9391('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9391('0x23')](function(_0xebb8f6){logger[_0x9391('0xf')]('GetFaxQueue',_0x1ca01e);logger['debug'](_0x9391('0x1a'),_0x1ca01e,JSON[_0x9391('0x13')](_0xebb8f6));_0xf0f787(_0xebb8f6);})[_0x9391('0x19')](function(_0x581374){logger[_0x9391('0x14')](_0x9391('0x1a'),_0x581374['message'],_0x1ca01e);_0x2f06ed(_0x465cf2[_0x9391('0x14')](0x1f4,_0x581374['message']));});});};exports[_0x9391('0x24')]=function(_0x22cc1c){var _0x213e4c=this;return new Promise(function(_0x2ceb68,_0x1826ec){return db['FaxQueue'][_0x9391('0x25')]({'raw':_0x22cc1c['options']?_0x22cc1c['options'][_0x9391('0x1c')]===undefined?!![]:![]:!![],'where':_0x22cc1c['options']?_0x22cc1c[_0x9391('0x1d')][_0x9391('0x1e')]||null:null,'attributes':_0x22cc1c[_0x9391('0x1d')]?_0x22cc1c[_0x9391('0x1d')][_0x9391('0x1f')]||null:null,'include':_0x22cc1c[_0x9391('0x1d')]?_0x22cc1c[_0x9391('0x1d')][_0x9391('0x21')]?_['map'](_0x22cc1c[_0x9391('0x1d')][_0x9391('0x21')],function(_0x8599ab){return{'model':db[_0x8599ab['model']],'as':_0x8599ab['as'],'attributes':_0x8599ab[_0x9391('0x1f')],'include':_0x8599ab[_0x9391('0x21')]?_[_0x9391('0x20')](_0x8599ab[_0x9391('0x21')],function(_0x457873){return{'model':db[_0x457873['model']],'as':_0x457873['as'],'attributes':_0x457873[_0x9391('0x1f')],'include':_0x457873[_0x9391('0x21')]?_['map'](_0x457873['include'],function(_0x4809e1){return{'model':db[_0x4809e1[_0x9391('0x22')]],'as':_0x4809e1['as'],'attributes':_0x4809e1[_0x9391('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x9391('0x23')](function(_0x5a57ae){logger[_0x9391('0xf')](_0x9391('0x24'),_0x22cc1c);logger[_0x9391('0x11')](_0x9391('0x24'),_0x22cc1c,JSON[_0x9391('0x13')](_0x5a57ae));_0x2ceb68(_0x5a57ae);})[_0x9391('0x19')](function(_0x503d5a){logger['error']('ShowFaxQueue',_0x503d5a[_0x9391('0x17')],_0x22cc1c);_0x1826ec(_0x213e4c[_0x9391('0x14')](0x1f4,_0x503d5a[_0x9391('0x17')]));});});}; \ No newline at end of file +var _0xd2b5=['FaxQueue','findAll','options','where','attributes','limit','include','map','model','GetFaxQueue','ShowFaxQueue','find','raw','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxQueue.socket','register','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x1f9255,_0x351cb3){var _0x5139e8=function(_0x11d703){while(--_0x11d703){_0x1f9255['push'](_0x1f9255['shift']());}};_0x5139e8(++_0x351cb3);}(_0xd2b5,0x1ba));var _0x5d2b=function(_0x19c697,_0x3f8f3a){_0x19c697=_0x19c697-0x0;var _0xac41bc=_0xd2b5[_0x19c697];return _0xac41bc;};'use strict';var _=require('lodash');var util=require(_0x5d2b('0x0'));var moment=require(_0x5d2b('0x1'));var BPromise=require(_0x5d2b('0x2'));var rs=require(_0x5d2b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5d2b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5d2b('0x5'));var config=require(_0x5d2b('0x6'));var jayson=require(_0x5d2b('0x7'));var client=jayson[_0x5d2b('0x8')][_0x5d2b('0x9')]({'port':0x232a});config[_0x5d2b('0xa')]=_['defaults'](config[_0x5d2b('0xa')],{'host':_0x5d2b('0xb'),'port':0x18eb});var socket=require(_0x5d2b('0xc'))(new Redis(config[_0x5d2b('0xa')]));require(_0x5d2b('0xd'))[_0x5d2b('0xe')](socket);function respondWithRpcPromise(_0xfc6f24,_0x1aa5f1,_0x587ee3){return new BPromise(function(_0x212f18,_0x3e5f67){return client['request'](_0xfc6f24,_0x587ee3)[_0x5d2b('0xf')](function(_0x84c889){logger[_0x5d2b('0x10')](_0x5d2b('0x11'),_0x1aa5f1,_0x5d2b('0x12'));logger[_0x5d2b('0x13')](_0x5d2b('0x14'),_0x1aa5f1,_0x5d2b('0x12'),JSON[_0x5d2b('0x15')](_0x84c889));if(_0x84c889['error']){if(_0x84c889[_0x5d2b('0x16')][_0x5d2b('0x17')]===0x1f4){logger[_0x5d2b('0x16')](_0x5d2b('0x11'),_0x1aa5f1,_0x84c889[_0x5d2b('0x16')][_0x5d2b('0x18')]);return _0x3e5f67(_0x84c889[_0x5d2b('0x16')]['message']);}logger[_0x5d2b('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1aa5f1,_0x84c889[_0x5d2b('0x16')][_0x5d2b('0x18')]);return _0x212f18(_0x84c889['error']['message']);}else{logger[_0x5d2b('0x10')](_0x5d2b('0x11'),_0x1aa5f1,_0x5d2b('0x12'));_0x212f18(_0x84c889['result'][_0x5d2b('0x18')]);}})[_0x5d2b('0x19')](function(_0x42759b){logger[_0x5d2b('0x16')]('FaxQueue,\x20%s,\x20%s',_0x1aa5f1,_0x42759b);_0x3e5f67(_0x42759b);});});}exports['GetFaxQueue']=function(_0x26afcc){var _0x28d3b1=this;return new Promise(function(_0x4667ca,_0x554789){return db[_0x5d2b('0x1a')][_0x5d2b('0x1b')]({'raw':_0x26afcc[_0x5d2b('0x1c')]?_0x26afcc[_0x5d2b('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x26afcc['options']?_0x26afcc['options'][_0x5d2b('0x1d')]||null:null,'attributes':_0x26afcc[_0x5d2b('0x1c')]?_0x26afcc['options'][_0x5d2b('0x1e')]||null:null,'limit':_0x26afcc[_0x5d2b('0x1c')]?_0x26afcc[_0x5d2b('0x1c')][_0x5d2b('0x1f')]||null:null,'include':_0x26afcc['options']?_0x26afcc[_0x5d2b('0x1c')][_0x5d2b('0x20')]?_['map'](_0x26afcc['options'][_0x5d2b('0x20')],function(_0x689a21){return{'model':db[_0x689a21['model']],'as':_0x689a21['as'],'attributes':_0x689a21[_0x5d2b('0x1e')],'include':_0x689a21['include']?_[_0x5d2b('0x21')](_0x689a21[_0x5d2b('0x20')],function(_0x30a9c8){return{'model':db[_0x30a9c8['model']],'as':_0x30a9c8['as'],'attributes':_0x30a9c8[_0x5d2b('0x1e')],'include':_0x30a9c8[_0x5d2b('0x20')]?_[_0x5d2b('0x21')](_0x30a9c8['include'],function(_0x18b192){return{'model':db[_0x18b192[_0x5d2b('0x22')]],'as':_0x18b192['as'],'attributes':_0x18b192[_0x5d2b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5d2b('0xf')](function(_0x42bedc){logger[_0x5d2b('0x10')](_0x5d2b('0x23'),_0x26afcc);logger[_0x5d2b('0x13')](_0x5d2b('0x23'),_0x26afcc,JSON['stringify'](_0x42bedc));_0x4667ca(_0x42bedc);})[_0x5d2b('0x19')](function(_0x3c8468){logger['error']('GetFaxQueue',_0x3c8468[_0x5d2b('0x18')],_0x26afcc);_0x554789(_0x28d3b1['error'](0x1f4,_0x3c8468[_0x5d2b('0x18')]));});});};exports[_0x5d2b('0x24')]=function(_0xad80af){var _0xcc8222=this;return new Promise(function(_0x4659b0,_0x4a8fe3){return db[_0x5d2b('0x1a')][_0x5d2b('0x25')]({'raw':_0xad80af['options']?_0xad80af[_0x5d2b('0x1c')][_0x5d2b('0x26')]===undefined?!![]:![]:!![],'where':_0xad80af[_0x5d2b('0x1c')]?_0xad80af[_0x5d2b('0x1c')][_0x5d2b('0x1d')]||null:null,'attributes':_0xad80af[_0x5d2b('0x1c')]?_0xad80af[_0x5d2b('0x1c')][_0x5d2b('0x1e')]||null:null,'include':_0xad80af[_0x5d2b('0x1c')]?_0xad80af[_0x5d2b('0x1c')]['include']?_['map'](_0xad80af[_0x5d2b('0x1c')][_0x5d2b('0x20')],function(_0x381dd1){return{'model':db[_0x381dd1[_0x5d2b('0x22')]],'as':_0x381dd1['as'],'attributes':_0x381dd1[_0x5d2b('0x1e')],'include':_0x381dd1['include']?_[_0x5d2b('0x21')](_0x381dd1[_0x5d2b('0x20')],function(_0x517e78){return{'model':db[_0x517e78[_0x5d2b('0x22')]],'as':_0x517e78['as'],'attributes':_0x517e78['attributes'],'include':_0x517e78[_0x5d2b('0x20')]?_['map'](_0x517e78[_0x5d2b('0x20')],function(_0x53bed4){return{'model':db[_0x53bed4[_0x5d2b('0x22')]],'as':_0x53bed4['as'],'attributes':_0x53bed4['attributes']};}):[]};}):[]};}):[]:[]})[_0x5d2b('0xf')](function(_0x35a84b){logger[_0x5d2b('0x10')](_0x5d2b('0x24'),_0xad80af);logger[_0x5d2b('0x13')](_0x5d2b('0x24'),_0xad80af,JSON[_0x5d2b('0x15')](_0x35a84b));_0x4659b0(_0x35a84b);})[_0x5d2b('0x19')](function(_0x226aaf){logger[_0x5d2b('0x16')](_0x5d2b('0x24'),_0x226aaf['message'],_0xad80af);_0x4a8fe3(_0xcc8222['error'](0x1f4,_0x226aaf[_0x5d2b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 046b3b6..e2a225a 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 _0xdd11=['faxQueue:','./faxQueue.events','save','remove','update','removeListener','register','length'];(function(_0x4e2205,_0x422b5e){var _0x1e0157=function(_0x1525ac){while(--_0x1525ac){_0x4e2205['push'](_0x4e2205['shift']());}};_0x1e0157(++_0x422b5e);}(_0xdd11,0xf1));var _0x1dd1=function(_0x104116,_0x618e32){_0x104116=_0x104116-0x0;var _0x357573=_0xdd11[_0x104116];return _0x357573;};'use strict';var FaxQueueEvents=require(_0x1dd1('0x0'));var events=[_0x1dd1('0x1'),_0x1dd1('0x2'),_0x1dd1('0x3')];function createListener(_0x3dce62,_0x50300b){return function(_0x10a3de){_0x50300b['emit'](_0x3dce62,_0x10a3de);};}function removeListener(_0x27c380,_0x587257){return function(){FaxQueueEvents[_0x1dd1('0x4')](_0x27c380,_0x587257);};}exports[_0x1dd1('0x5')]=function(_0x5bafc9){for(var _0x1da06a=0x0,_0xeae621=events[_0x1dd1('0x6')];_0x1da06a<_0xeae621;_0x1da06a++){var _0x24dbeb=events[_0x1da06a];var _0x9034a0=createListener(_0x1dd1('0x7')+_0x24dbeb,_0x5bafc9);FaxQueueEvents['on'](_0x24dbeb,_0x9034a0);}}; \ No newline at end of file +var _0xf364=['faxQueue:','./faxQueue.events','remove','update','emit','register','length'];(function(_0x4b5874,_0x435615){var _0xf95843=function(_0xfc3bef){while(--_0xfc3bef){_0x4b5874['push'](_0x4b5874['shift']());}};_0xf95843(++_0x435615);}(_0xf364,0x78));var _0x4f36=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf364[_0xbca1b1];return _0x4e1686;};'use strict';var FaxQueueEvents=require(_0x4f36('0x0'));var events=['save',_0x4f36('0x1'),_0x4f36('0x2')];function createListener(_0x47433a,_0x527b7f){return function(_0x58924f){_0x527b7f[_0x4f36('0x3')](_0x47433a,_0x58924f);};}function removeListener(_0x4ae98e,_0x34bf47){return function(){FaxQueueEvents['removeListener'](_0x4ae98e,_0x34bf47);};}exports[_0x4f36('0x4')]=function(_0x1de3ca){for(var _0x38700d=0x0,_0x3f5de3=events[_0x4f36('0x5')];_0x38700d<_0x3f5de3;_0x38700d++){var _0x313377=events[_0x38700d];var _0x162b7e=createListener(_0x4f36('0x6')+_0x313377,_0x1de3ca);FaxQueueEvents['on'](_0x313377,_0x162b7e);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 3871bd1..8507f89 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 _0x8085=['Router','fs-extra','../../config/environment','./faxQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','put','update','destroy','delete','removeTeams','removeAgents','multer','connect-timeout','express'];(function(_0x563d8f,_0x145a2a){var _0x42c064=function(_0x4e8a1f){while(--_0x4e8a1f){_0x563d8f['push'](_0x563d8f['shift']());}};_0x42c064(++_0x145a2a);}(_0x8085,0x71));var _0x5808=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x8085[_0x231e16];return _0x570a7c;};'use strict';var multer=require(_0x5808('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5808('0x1'));var express=require(_0x5808('0x2'));var router=express[_0x5808('0x3')]();var fs_extra=require(_0x5808('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5808('0x5'));var controller=require(_0x5808('0x6'));router['get']('/',auth[_0x5808('0x7')](),controller[_0x5808('0x8')]);router[_0x5808('0x9')](_0x5808('0xa'),auth[_0x5808('0x7')](),controller[_0x5808('0xb')]);router[_0x5808('0x9')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0xd')]);router[_0x5808('0x9')](_0x5808('0xe'),auth[_0x5808('0x7')](),controller[_0x5808('0xf')]);router[_0x5808('0x9')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5808('0x10')]);router[_0x5808('0x9')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x12')]);router[_0x5808('0x13')]('/',auth[_0x5808('0x7')](),controller['create']);router['post'](_0x5808('0x14'),auth[_0x5808('0x7')](),controller[_0x5808('0x15')]);router[_0x5808('0x13')](_0x5808('0x11'),auth[_0x5808('0x7')](),controller[_0x5808('0x16')]);router[_0x5808('0x17')](_0x5808('0xc'),auth[_0x5808('0x7')](),controller[_0x5808('0x18')]);router['delete'](_0x5808('0xc'),auth['isAuthenticated'](),controller[_0x5808('0x19')]);router[_0x5808('0x1a')](_0x5808('0x14'),auth['isAuthenticated'](),controller[_0x5808('0x1b')]);router[_0x5808('0x1a')]('/:id/users',auth['isAuthenticated'](),controller[_0x5808('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x1751=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','/:id/users','addAgents','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller'];(function(_0x30f53a,_0x55acf8){var _0x24fd11=function(_0x4e2626){while(--_0x4e2626){_0x30f53a['push'](_0x30f53a['shift']());}};_0x24fd11(++_0x55acf8);}(_0x1751,0x76));var _0x1175=function(_0x178aa6,_0x116faa){_0x178aa6=_0x178aa6-0x0;var _0xab1e73=_0x1751[_0x178aa6];return _0xab1e73;};'use strict';var multer=require(_0x1175('0x0'));var util=require(_0x1175('0x1'));var path=require(_0x1175('0x2'));var timeout=require(_0x1175('0x3'));var express=require('express');var router=express[_0x1175('0x4')]();var fs_extra=require(_0x1175('0x5'));var auth=require(_0x1175('0x6'));var interaction=require(_0x1175('0x7'));var config=require(_0x1175('0x8'));var controller=require(_0x1175('0x9'));router[_0x1175('0xa')]('/',auth[_0x1175('0xb')](),controller[_0x1175('0xc')]);router[_0x1175('0xa')](_0x1175('0xd'),auth[_0x1175('0xb')](),controller[_0x1175('0xe')]);router[_0x1175('0xa')](_0x1175('0xf'),auth[_0x1175('0xb')](),controller[_0x1175('0x10')]);router[_0x1175('0xa')](_0x1175('0x11'),auth[_0x1175('0xb')](),controller[_0x1175('0x12')]);router[_0x1175('0xa')](_0x1175('0x13'),auth[_0x1175('0xb')](),controller[_0x1175('0x14')]);router[_0x1175('0xa')]('/:id/users',auth['isAuthenticated'](),controller[_0x1175('0x15')]);router[_0x1175('0x16')]('/',auth['isAuthenticated'](),controller[_0x1175('0x17')]);router[_0x1175('0x16')](_0x1175('0x13'),auth['isAuthenticated'](),controller[_0x1175('0x18')]);router[_0x1175('0x16')](_0x1175('0x19'),auth['isAuthenticated'](),controller[_0x1175('0x1a')]);router['put'](_0x1175('0xf'),auth[_0x1175('0xb')](),controller[_0x1175('0x1b')]);router[_0x1175('0x1c')]('/:id',auth[_0x1175('0xb')](),controller[_0x1175('0x1d')]);router['delete']('/:id/teams',auth[_0x1175('0xb')](),controller[_0x1175('0x1e')]);router[_0x1175('0x1c')](_0x1175('0x19'),auth[_0x1175('0xb')](),controller['removeAgents']);module[_0x1175('0x1f')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 060fb1f..e9a41cc 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 _0xe7f9=['sequelize','exports','STRING','DATE'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0xe7f9,0x124));var _0x9e7f=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xe7f9[_0x31eb67];return _0x2a8cb8;};'use strict';var moment=require('moment');var Sequelize=require(_0x9e7f('0x0'));module[_0x9e7f('0x1')]={'uniqueid':{'type':Sequelize[_0x9e7f('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9e7f('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x9e7f('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x9e7f('0x2')]}}; \ No newline at end of file +var _0x64c4=['DATE','sequelize','exports','STRING'];(function(_0x141dd8,_0x48363d){var _0x348080=function(_0x3beb35){while(--_0x3beb35){_0x141dd8['push'](_0x141dd8['shift']());}};_0x348080(++_0x48363d);}(_0x64c4,0xa5));var _0x464c=function(_0x1eaf4e,_0x3ae734){_0x1eaf4e=_0x1eaf4e-0x0;var _0x4a5d12=_0x64c4[_0x1eaf4e];return _0x4a5d12;};'use strict';var moment=require('moment');var Sequelize=require(_0x464c('0x0'));module[_0x464c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x464c('0x2')]},'joinAt':{'type':Sequelize[_0x464c('0x3')]},'leaveAt':{'type':Sequelize[_0x464c('0x3')]},'acceptAt':{'type':Sequelize[_0x464c('0x3')]},'exitAt':{'type':Sequelize[_0x464c('0x3')]},'reason':{'type':Sequelize[_0x464c('0x2')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 9f7d559..35246c2 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 _0x131e=['util','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','FaxQueueReport','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x386525,_0xefae6){var _0x14d015=function(_0x4a45c1){while(--_0x4a45c1){_0x386525['push'](_0x386525['shift']());}};_0x14d015(++_0xefae6);}(_0x131e,0x1ec));var _0xe131=function(_0x13f7c9,_0x56fec2){_0x13f7c9=_0x13f7c9-0x0;var _0x1a9037=_0x131e[_0x13f7c9];return _0x1a9037;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe131('0x0'));var rp=require(_0xe131('0x1'));var moment=require(_0xe131('0x2'));var BPromise=require(_0xe131('0x3'));var Mustache=require(_0xe131('0x4'));var util=require(_0xe131('0x5'));var path=require('path');var sox=require(_0xe131('0x6'));var csv=require(_0xe131('0x7'));var ejs=require(_0xe131('0x8'));var fs=require('fs');var fs_extra=require(_0xe131('0x9'));var _=require(_0xe131('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe131('0x7'));var querystring=require(_0xe131('0xb'));var Papa=require('papaparse');var Redis=require(_0xe131('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe131('0xd'));var as=require(_0xe131('0xe'));var hardwareService=require(_0xe131('0xf'));var logger=require(_0xe131('0x10'))(_0xe131('0x11'));var utils=require(_0xe131('0x12'));var config=require(_0xe131('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554db6,_0x5f0434){_0x5f0434=_0x5f0434||0xcc;return function(_0x14ed9a){if(_0x14ed9a){return _0x554db6[_0xe131('0x14')](_0x5f0434);}return _0x554db6[_0xe131('0x15')](_0x5f0434)[_0xe131('0x16')]();};}function respondWithResult(_0x34289c,_0x420cc2){_0x420cc2=_0x420cc2||0xc8;return function(_0x436549){if(_0x436549){return _0x34289c[_0xe131('0x15')](_0x420cc2)[_0xe131('0x17')](_0x436549);}};}function respondWithFilteredResult(_0x5f2291,_0x4aa1bf){return function(_0x4dfbdf){if(_0x4dfbdf){var _0x5a6ca9=typeof _0x4aa1bf['offset']===_0xe131('0x18')&&typeof _0x4aa1bf[_0xe131('0x19')]===_0xe131('0x18');var _0x5a02b6=_0x4dfbdf['count'];var _0x400f6b=_0x5a6ca9?0x0:_0x4aa1bf[_0xe131('0x1a')];var _0x3bbca8=_0x5a6ca9?_0x4dfbdf[_0xe131('0x1b')]:_0x4aa1bf[_0xe131('0x1a')]+_0x4aa1bf[_0xe131('0x19')];var _0x512570;if(_0x3bbca8>=_0x5a02b6){_0x3bbca8=_0x5a02b6;_0x512570=0xc8;}else{_0x512570=0xce;}_0x5f2291[_0xe131('0x15')](_0x512570);return _0x5f2291[_0xe131('0x1c')](_0xe131('0x1d'),_0x400f6b+'-'+_0x3bbca8+'/'+_0x5a02b6)[_0xe131('0x17')](_0x4dfbdf);}return null;};}function patchUpdates(_0x2d6c6b){return function(_0x49b19e){try{jsonpatch['apply'](_0x49b19e,_0x2d6c6b,!![]);}catch(_0x4405c0){return BPromise[_0xe131('0x1e')](_0x4405c0);}return _0x49b19e['save']();};}function saveUpdates(_0x42df0a,_0x55b0c5){return function(_0x49f304){if(_0x49f304){return _0x49f304[_0xe131('0x1f')](_0x42df0a)[_0xe131('0x20')](function(_0x473bb4){return _0x473bb4;});}return null;};}function removeEntity(_0xecb533,_0x166409){return function(_0x225278){if(_0x225278){return _0x225278[_0xe131('0x21')]()['then'](function(){_0xecb533[_0xe131('0x15')](0xcc)[_0xe131('0x16')]();});}};}function handleEntityNotFound(_0x5ec305,_0x4e7cb8){return function(_0x330638){if(!_0x330638){_0x5ec305['sendStatus'](0x194);}return _0x330638;};}function handleError(_0x41c386,_0x3b95bf){_0x3b95bf=_0x3b95bf||0x1f4;return function(_0x51e109){logger[_0xe131('0x22')](_0x51e109[_0xe131('0x23')]);if(_0x51e109[_0xe131('0x24')]){delete _0x51e109['name'];}_0x41c386[_0xe131('0x15')](_0x3b95bf)[_0xe131('0x25')](_0x51e109);};}exports[_0xe131('0x26')]=function(_0x10d504,_0xb306b4){var _0x2fce8c={},_0x1ff557={},_0x3414f1={'count':0x0,'rows':[]};var _0x9f8c66=_[_0xe131('0x27')](db['FaxQueueReport'][_0xe131('0x28')],function(_0x554b62){return{'name':_0x554b62[_0xe131('0x29')],'type':_0x554b62['type'][_0xe131('0x2a')]};});_0x1ff557['model']=_[_0xe131('0x27')](_0x9f8c66,_0xe131('0x24'));_0x1ff557[_0xe131('0x2b')]=_['keys'](_0x10d504['query']);_0x1ff557[_0xe131('0x2c')]=_[_0xe131('0x2d')](_0x1ff557[_0xe131('0x2e')],_0x1ff557[_0xe131('0x2b')]);_0x2fce8c[_0xe131('0x2f')]=_[_0xe131('0x2d')](_0x1ff557[_0xe131('0x2e')],qs[_0xe131('0x30')](_0x10d504['query']['fields']));_0x2fce8c[_0xe131('0x2f')]=_0x2fce8c[_0xe131('0x2f')][_0xe131('0x31')]?_0x2fce8c[_0xe131('0x2f')]:_0x1ff557[_0xe131('0x2e')];if(!_0x10d504[_0xe131('0x2b')][_0xe131('0x32')]('nolimit')){_0x2fce8c['limit']=qs[_0xe131('0x19')](_0x10d504['query'][_0xe131('0x19')]);_0x2fce8c['offset']=qs[_0xe131('0x1a')](_0x10d504['query'][_0xe131('0x1a')]);}_0x2fce8c['order']=qs[_0xe131('0x33')](_0x10d504[_0xe131('0x2b')][_0xe131('0x33')]);_0x2fce8c[_0xe131('0x34')]=qs[_0xe131('0x2c')](_[_0xe131('0x35')](_0x10d504['query'],_0x1ff557[_0xe131('0x2c')]),_0x9f8c66);if(_0x10d504['query'][_0xe131('0x36')]){_0x2fce8c['where']=_[_0xe131('0x37')](_0x2fce8c[_0xe131('0x34')],{'$or':_[_0xe131('0x27')](_0x9f8c66,function(_0x24ded7){if(_0x24ded7[_0xe131('0x38')]!==_0xe131('0x39')){var _0x374d45={};_0x374d45[_0x24ded7['name']]={'$like':'%'+_0x10d504[_0xe131('0x2b')]['filter']+'%'};return _0x374d45;}})});}_0x2fce8c=_[_0xe131('0x37')]({},_0x2fce8c,_0x10d504[_0xe131('0x3a')]);var _0x4f3645={'where':_0x2fce8c['where']};return db[_0xe131('0x3b')]['count'](_0x4f3645)['then'](function(_0xfe99a7){_0x3414f1['count']=_0xfe99a7;if(_0x10d504[_0xe131('0x2b')][_0xe131('0x3c')]){_0x2fce8c['include']=[{'all':!![]}];}return db[_0xe131('0x3b')][_0xe131('0x3d')](_0x2fce8c);})[_0xe131('0x20')](function(_0x3302b1){_0x3414f1[_0xe131('0x3e')]=_0x3302b1;return _0x3414f1;})['then'](respondWithFilteredResult(_0xb306b4,_0x2fce8c))['catch'](handleError(_0xb306b4,null));};exports[_0xe131('0x3f')]=function(_0x1caa23,_0x2a9a07){var _0x58fe5c={'raw':!![],'where':{'id':_0x1caa23[_0xe131('0x40')]['id']}},_0x34f5ae={};_0x34f5ae[_0xe131('0x2e')]=_['keys'](db[_0xe131('0x3b')][_0xe131('0x28')]);_0x34f5ae[_0xe131('0x2b')]=_['keys'](_0x1caa23[_0xe131('0x2b')]);_0x34f5ae[_0xe131('0x2c')]=_[_0xe131('0x2d')](_0x34f5ae['model'],_0x34f5ae[_0xe131('0x2b')]);_0x58fe5c[_0xe131('0x2f')]=_[_0xe131('0x2d')](_0x34f5ae[_0xe131('0x2e')],qs[_0xe131('0x30')](_0x1caa23[_0xe131('0x2b')][_0xe131('0x30')]));_0x58fe5c['attributes']=_0x58fe5c['attributes'][_0xe131('0x31')]?_0x58fe5c[_0xe131('0x2f')]:_0x34f5ae[_0xe131('0x2e')];if(_0x1caa23[_0xe131('0x2b')][_0xe131('0x3c')]){_0x58fe5c[_0xe131('0x41')]=[{'all':!![]}];}_0x58fe5c=_['merge']({},_0x58fe5c,_0x1caa23[_0xe131('0x3a')]);return db[_0xe131('0x3b')][_0xe131('0x42')](_0x58fe5c)[_0xe131('0x20')](handleEntityNotFound(_0x2a9a07,null))[_0xe131('0x20')](respondWithResult(_0x2a9a07,null))[_0xe131('0x43')](handleError(_0x2a9a07,null));};exports['create']=function(_0x20481b,_0x1ce9b7){return db[_0xe131('0x3b')][_0xe131('0x44')](_0x20481b[_0xe131('0x45')],{})[_0xe131('0x20')](respondWithResult(_0x1ce9b7,0xc9))[_0xe131('0x43')](handleError(_0x1ce9b7,null));};exports[_0xe131('0x1f')]=function(_0x3d7ae8,_0x320699){if(_0x3d7ae8[_0xe131('0x45')]['id']){delete _0x3d7ae8['body']['id'];}return db[_0xe131('0x3b')]['find']({'where':{'id':_0x3d7ae8['params']['id']}})[_0xe131('0x20')](handleEntityNotFound(_0x320699,null))[_0xe131('0x20')](saveUpdates(_0x3d7ae8[_0xe131('0x45')],null))[_0xe131('0x20')](respondWithResult(_0x320699,null))[_0xe131('0x43')](handleError(_0x320699,null));};exports[_0xe131('0x21')]=function(_0xf4dbe4,_0x398c39){return db[_0xe131('0x3b')][_0xe131('0x42')]({'where':{'id':_0xf4dbe4[_0xe131('0x40')]['id']}})['then'](handleEntityNotFound(_0x398c39,null))['then'](removeEntity(_0x398c39,null))[_0xe131('0x43')](handleError(_0x398c39,null));};exports[_0xe131('0x46')]=function(_0x513f94,_0x56893d){return db[_0xe131('0x3b')]['describe']()['then'](respondWithResult(_0x56893d,null))[_0xe131('0x43')](handleError(_0x56893d,null));}; \ No newline at end of file +var _0xb903=['map','FaxQueueReport','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','create','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','count','limit','set','json','apply','reject','save','then','destroy','end','stack','name','send','index'];(function(_0x33da95,_0x39679b){var _0x31c31c=function(_0x2dcffb){while(--_0x2dcffb){_0x33da95['push'](_0x33da95['shift']());}};_0x31c31c(++_0x39679b);}(_0xb903,0x185));var _0x3b90=function(_0x53e47c,_0x344d75){_0x53e47c=_0x53e47c-0x0;var _0x139d57=_0xb903[_0x53e47c];return _0x139d57;};'use strict';var emlformat=require(_0x3b90('0x0'));var rimraf=require(_0x3b90('0x1'));var zipdir=require(_0x3b90('0x2'));var jsonpatch=require(_0x3b90('0x3'));var rp=require('request-promise');var moment=require(_0x3b90('0x4'));var BPromise=require(_0x3b90('0x5'));var Mustache=require(_0x3b90('0x6'));var util=require(_0x3b90('0x7'));var path=require(_0x3b90('0x8'));var sox=require(_0x3b90('0x9'));var csv=require(_0x3b90('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3b90('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3b90('0xc'));var jsforce=require(_0x3b90('0xd'));var deskjs=require(_0x3b90('0xe'));var toCsv=require(_0x3b90('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3b90('0xf'));var logger=require(_0x3b90('0x10'))('api');var utils=require(_0x3b90('0x11'));var config=require(_0x3b90('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x3b90('0x13'))['db'];function respondWithStatusCode(_0x174c0d,_0x43c08c){_0x43c08c=_0x43c08c||0xcc;return function(_0x4badcb){if(_0x4badcb){return _0x174c0d['sendStatus'](_0x43c08c);}return _0x174c0d[_0x3b90('0x14')](_0x43c08c)['end']();};}function respondWithResult(_0x492d39,_0x3a0a55){_0x3a0a55=_0x3a0a55||0xc8;return function(_0x2c72fb){if(_0x2c72fb){return _0x492d39['status'](_0x3a0a55)['json'](_0x2c72fb);}};}function respondWithFilteredResult(_0x3725b9,_0x1b6349){return function(_0x381a9e){if(_0x381a9e){var _0x1af265=typeof _0x1b6349[_0x3b90('0x15')]==='undefined'&&typeof _0x1b6349['limit']===_0x3b90('0x16');var _0x5420dc=_0x381a9e['count'];var _0x269488=_0x1af265?0x0:_0x1b6349[_0x3b90('0x15')];var _0x11ad7d=_0x1af265?_0x381a9e[_0x3b90('0x17')]:_0x1b6349['offset']+_0x1b6349[_0x3b90('0x18')];var _0x5d140f;if(_0x11ad7d>=_0x5420dc){_0x11ad7d=_0x5420dc;_0x5d140f=0xc8;}else{_0x5d140f=0xce;}_0x3725b9[_0x3b90('0x14')](_0x5d140f);return _0x3725b9[_0x3b90('0x19')]('Content-Range',_0x269488+'-'+_0x11ad7d+'/'+_0x5420dc)[_0x3b90('0x1a')](_0x381a9e);}return null;};}function patchUpdates(_0x12e1cf){return function(_0x3642c0){try{jsonpatch[_0x3b90('0x1b')](_0x3642c0,_0x12e1cf,!![]);}catch(_0xc74d57){return BPromise[_0x3b90('0x1c')](_0xc74d57);}return _0x3642c0[_0x3b90('0x1d')]();};}function saveUpdates(_0x2f4270,_0xa98414){return function(_0x3e5bb8){if(_0x3e5bb8){return _0x3e5bb8['update'](_0x2f4270)[_0x3b90('0x1e')](function(_0x36b93e){return _0x36b93e;});}return null;};}function removeEntity(_0x175b42,_0x7faee){return function(_0x1227ed){if(_0x1227ed){return _0x1227ed[_0x3b90('0x1f')]()['then'](function(){_0x175b42['status'](0xcc)[_0x3b90('0x20')]();});}};}function handleEntityNotFound(_0x29d472,_0x103324){return function(_0x2ffa1a){if(!_0x2ffa1a){_0x29d472['sendStatus'](0x194);}return _0x2ffa1a;};}function handleError(_0x414462,_0x2936d7){_0x2936d7=_0x2936d7||0x1f4;return function(_0x1787d1){logger['error'](_0x1787d1[_0x3b90('0x21')]);if(_0x1787d1[_0x3b90('0x22')]){delete _0x1787d1[_0x3b90('0x22')];}_0x414462[_0x3b90('0x14')](_0x2936d7)[_0x3b90('0x23')](_0x1787d1);};}exports[_0x3b90('0x24')]=function(_0x4b4d33,_0x1a839d){var _0x595ac1={},_0xaf453c={},_0x9891e4={'count':0x0,'rows':[]};var _0x1a193e=_[_0x3b90('0x25')](db[_0x3b90('0x26')][_0x3b90('0x27')],function(_0x290283){return{'name':_0x290283[_0x3b90('0x28')],'type':_0x290283['type']['key']};});_0xaf453c[_0x3b90('0x29')]=_[_0x3b90('0x25')](_0x1a193e,_0x3b90('0x22'));_0xaf453c[_0x3b90('0x2a')]=_['keys'](_0x4b4d33['query']);_0xaf453c[_0x3b90('0x2b')]=_[_0x3b90('0x2c')](_0xaf453c[_0x3b90('0x29')],_0xaf453c['query']);_0x595ac1[_0x3b90('0x2d')]=_['intersection'](_0xaf453c['model'],qs[_0x3b90('0x2e')](_0x4b4d33[_0x3b90('0x2a')]['fields']));_0x595ac1[_0x3b90('0x2d')]=_0x595ac1[_0x3b90('0x2d')][_0x3b90('0x2f')]?_0x595ac1['attributes']:_0xaf453c['model'];if(!_0x4b4d33[_0x3b90('0x2a')][_0x3b90('0x30')](_0x3b90('0x31'))){_0x595ac1[_0x3b90('0x18')]=qs['limit'](_0x4b4d33['query'][_0x3b90('0x18')]);_0x595ac1[_0x3b90('0x15')]=qs['offset'](_0x4b4d33['query'][_0x3b90('0x15')]);}_0x595ac1[_0x3b90('0x32')]=qs[_0x3b90('0x33')](_0x4b4d33[_0x3b90('0x2a')]['sort']);_0x595ac1[_0x3b90('0x34')]=qs['filters'](_[_0x3b90('0x35')](_0x4b4d33[_0x3b90('0x2a')],_0xaf453c[_0x3b90('0x2b')]),_0x1a193e);if(_0x4b4d33[_0x3b90('0x2a')][_0x3b90('0x36')]){_0x595ac1[_0x3b90('0x34')]=_[_0x3b90('0x37')](_0x595ac1['where'],{'$or':_[_0x3b90('0x25')](_0x1a193e,function(_0x2b0a5b){if(_0x2b0a5b[_0x3b90('0x38')]!==_0x3b90('0x39')){var _0x3d6040={};_0x3d6040[_0x2b0a5b[_0x3b90('0x22')]]={'$like':'%'+_0x4b4d33[_0x3b90('0x2a')][_0x3b90('0x36')]+'%'};return _0x3d6040;}})});}_0x595ac1=_[_0x3b90('0x37')]({},_0x595ac1,_0x4b4d33['options']);var _0x369d0d={'where':_0x595ac1[_0x3b90('0x34')]};return db[_0x3b90('0x26')][_0x3b90('0x17')](_0x369d0d)[_0x3b90('0x1e')](function(_0xb71509){_0x9891e4[_0x3b90('0x17')]=_0xb71509;if(_0x4b4d33[_0x3b90('0x2a')][_0x3b90('0x3a')]){_0x595ac1[_0x3b90('0x3b')]=[{'all':!![]}];}return db[_0x3b90('0x26')][_0x3b90('0x3c')](_0x595ac1);})[_0x3b90('0x1e')](function(_0x11285e){_0x9891e4[_0x3b90('0x3d')]=_0x11285e;return _0x9891e4;})[_0x3b90('0x1e')](respondWithFilteredResult(_0x1a839d,_0x595ac1))[_0x3b90('0x3e')](handleError(_0x1a839d,null));};exports[_0x3b90('0x3f')]=function(_0x33056a,_0x37e8dd){var _0x11698a={'raw':!![],'where':{'id':_0x33056a[_0x3b90('0x40')]['id']}},_0x4d1157={};_0x4d1157[_0x3b90('0x29')]=_[_0x3b90('0x41')](db[_0x3b90('0x26')]['rawAttributes']);_0x4d1157[_0x3b90('0x2a')]=_['keys'](_0x33056a['query']);_0x4d1157[_0x3b90('0x2b')]=_[_0x3b90('0x2c')](_0x4d1157['model'],_0x4d1157[_0x3b90('0x2a')]);_0x11698a[_0x3b90('0x2d')]=_[_0x3b90('0x2c')](_0x4d1157[_0x3b90('0x29')],qs[_0x3b90('0x2e')](_0x33056a[_0x3b90('0x2a')][_0x3b90('0x2e')]));_0x11698a[_0x3b90('0x2d')]=_0x11698a[_0x3b90('0x2d')]['length']?_0x11698a[_0x3b90('0x2d')]:_0x4d1157[_0x3b90('0x29')];if(_0x33056a['query'][_0x3b90('0x3a')]){_0x11698a[_0x3b90('0x3b')]=[{'all':!![]}];}_0x11698a=_[_0x3b90('0x37')]({},_0x11698a,_0x33056a[_0x3b90('0x42')]);return db[_0x3b90('0x26')]['find'](_0x11698a)['then'](handleEntityNotFound(_0x37e8dd,null))[_0x3b90('0x1e')](respondWithResult(_0x37e8dd,null))['catch'](handleError(_0x37e8dd,null));};exports[_0x3b90('0x43')]=function(_0xd5817,_0x330002){return db[_0x3b90('0x26')][_0x3b90('0x43')](_0xd5817['body'],{})['then'](respondWithResult(_0x330002,0xc9))[_0x3b90('0x3e')](handleError(_0x330002,null));};exports[_0x3b90('0x44')]=function(_0x9e2ee5,_0x5d7333){if(_0x9e2ee5[_0x3b90('0x45')]['id']){delete _0x9e2ee5[_0x3b90('0x45')]['id'];}return db[_0x3b90('0x26')][_0x3b90('0x46')]({'where':{'id':_0x9e2ee5[_0x3b90('0x40')]['id']}})[_0x3b90('0x1e')](handleEntityNotFound(_0x5d7333,null))[_0x3b90('0x1e')](saveUpdates(_0x9e2ee5[_0x3b90('0x45')],null))[_0x3b90('0x1e')](respondWithResult(_0x5d7333,null))['catch'](handleError(_0x5d7333,null));};exports[_0x3b90('0x1f')]=function(_0x407784,_0x2b5b6f){return db['FaxQueueReport'][_0x3b90('0x46')]({'where':{'id':_0x407784['params']['id']}})[_0x3b90('0x1e')](handleEntityNotFound(_0x2b5b6f,null))[_0x3b90('0x1e')](removeEntity(_0x2b5b6f,null))[_0x3b90('0x3e')](handleError(_0x2b5b6f,null));};exports['describe']=function(_0x2a3fe8,_0x1ec976){return db['FaxQueueReport']['describe']()[_0x3b90('0x1e')](respondWithResult(_0x1ec976,null))[_0x3b90('0x3e')](handleError(_0x1ec976,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 2b9bdca..bdc5549 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 _0xc4aa=['bluebird','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','lodash','util','../../config/logger','api','moment'];(function(_0xf48678,_0x2fc7be){var _0x1284c0=function(_0x499190){while(--_0x499190){_0xf48678['push'](_0xf48678['shift']());}};_0x1284c0(++_0x2fc7be);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var logger=require(_0xac4a('0x2'))(_0xac4a('0x3'));var moment=require(_0xac4a('0x4'));var BPromise=require(_0xac4a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xac4a('0x6'));var attributes=require(_0xac4a('0x7'));module[_0xac4a('0x8')]=function(_0x215f39,_0x96be2b){return _0x215f39[_0xac4a('0x9')](_0xac4a('0xa'),attributes,{'tableName':_0xac4a('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x814b=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','uniqueid','lodash','util'];(function(_0x5ce15c,_0x19c917){var _0x36e4f5=function(_0x50fa90){while(--_0x50fa90){_0x5ce15c['push'](_0x5ce15c['shift']());}};_0x36e4f5(++_0x19c917);}(_0x814b,0x1a2));var _0xb814=function(_0x52a7e1,_0x189bf3){_0x52a7e1=_0x52a7e1-0x0;var _0x4f4495=_0x814b[_0x52a7e1];return _0x4f4495;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var logger=require(_0xb814('0x2'))(_0xb814('0x3'));var moment=require(_0xb814('0x4'));var BPromise=require(_0xb814('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb814('0x6'));var rimraf=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var attributes=require(_0xb814('0x9'));module[_0xb814('0xa')]=function(_0x322a70,_0x53e507){return _0x322a70[_0xb814('0xb')](_0xb814('0xc'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb814('0xd'),'fields':[_0xb814('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 38819ea..f07a7dd 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 _0x8cf1=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','CreateFaxQueueReport','FaxQueueReport','create','body','options','raw','then','UpdateFaxQueueReport','where','limit','lodash'];(function(_0x120564,_0x3c18cf){var _0x579980=function(_0x108c13){while(--_0x108c13){_0x120564['push'](_0x120564['shift']());}};_0x579980(++_0x3c18cf);}(_0x8cf1,0x121));var _0x18cf=function(_0x35ab50,_0x24bf8e){_0x35ab50=_0x35ab50-0x0;var _0x5362d8=_0x8cf1[_0x35ab50];return _0x5362d8;};'use strict';var _=require(_0x18cf('0x0'));var util=require(_0x18cf('0x1'));var moment=require('moment');var BPromise=require(_0x18cf('0x2'));var rs=require(_0x18cf('0x3'));var fs=require('fs');var Redis=require(_0x18cf('0x4'));var db=require(_0x18cf('0x5'))['db'];var utils=require(_0x18cf('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x18cf('0x7')][_0x18cf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58f343,_0x5865f6,_0x320d65){return new BPromise(function(_0x18e9d3,_0x3303c5){return client[_0x18cf('0x9')](_0x58f343,_0x320d65)['then'](function(_0x5586aa){logger['info'](_0x18cf('0xa'),_0x5865f6,_0x18cf('0xb'));logger[_0x18cf('0xc')](_0x18cf('0xd'),_0x5865f6,_0x18cf('0xb'),JSON[_0x18cf('0xe')](_0x5586aa));if(_0x5586aa[_0x18cf('0xf')]){if(_0x5586aa[_0x18cf('0xf')]['code']===0x1f4){logger[_0x18cf('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x5865f6,_0x5586aa[_0x18cf('0xf')][_0x18cf('0x10')]);return _0x3303c5(_0x5586aa[_0x18cf('0xf')][_0x18cf('0x10')]);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x5865f6,_0x5586aa[_0x18cf('0xf')][_0x18cf('0x10')]);return _0x18e9d3(_0x5586aa[_0x18cf('0xf')]['message']);}else{logger[_0x18cf('0x11')](_0x18cf('0xa'),_0x5865f6,_0x18cf('0xb'));_0x18e9d3(_0x5586aa['result'][_0x18cf('0x10')]);}})[_0x18cf('0x12')](function(_0x4728ac){logger['error'](_0x18cf('0xa'),_0x5865f6,_0x4728ac);_0x3303c5(_0x4728ac);});});}exports[_0x18cf('0x13')]=function(_0x45bf79){var _0x3c1f01=this;return new Promise(function(_0x115ee8,_0x5b6592){return db[_0x18cf('0x14')][_0x18cf('0x15')](_0x45bf79[_0x18cf('0x16')],{'raw':_0x45bf79[_0x18cf('0x17')]?_0x45bf79[_0x18cf('0x17')][_0x18cf('0x18')]===undefined?!![]:![]:!![]})[_0x18cf('0x19')](function(_0x25b66a){logger['info'](_0x18cf('0x13'),_0x45bf79);logger[_0x18cf('0xc')](_0x18cf('0x13'),_0x45bf79,JSON[_0x18cf('0xe')](_0x25b66a));_0x115ee8(_0x25b66a);})[_0x18cf('0x12')](function(_0x25501f){logger['error']('CreateFaxQueueReport',_0x25501f[_0x18cf('0x10')],_0x45bf79);_0x5b6592(_0x3c1f01[_0x18cf('0xf')](0x1f4,_0x25501f[_0x18cf('0x10')]));});});};exports[_0x18cf('0x1a')]=function(_0x2b94e4){var _0x376359=this;return new Promise(function(_0x382658,_0x15c347){return db[_0x18cf('0x14')]['update'](_0x2b94e4['body'],{'raw':_0x2b94e4[_0x18cf('0x17')]?_0x2b94e4['options'][_0x18cf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b94e4[_0x18cf('0x17')]?_0x2b94e4[_0x18cf('0x17')][_0x18cf('0x1b')]||null:null,'attributes':_0x2b94e4[_0x18cf('0x17')]?_0x2b94e4[_0x18cf('0x17')]['attributes']||null:null,'limit':_0x2b94e4[_0x18cf('0x17')]?_0x2b94e4[_0x18cf('0x17')][_0x18cf('0x1c')]||null:null})[_0x18cf('0x19')](function(_0x251313){logger[_0x18cf('0x11')](_0x18cf('0x1a'),_0x2b94e4);logger['debug']('UpdateFaxQueueReport',_0x2b94e4,JSON[_0x18cf('0xe')](_0x251313));_0x382658(_0x251313);})[_0x18cf('0x12')](function(_0x2e2e7b){logger[_0x18cf('0xf')](_0x18cf('0x1a'),_0x2e2e7b[_0x18cf('0x10')],_0x2b94e4);_0x15c347(_0x376359[_0x18cf('0xf')](0x1f4,_0x2e2e7b[_0x18cf('0x10')]));});});}; \ No newline at end of file +var _0x8fe9=['rpc','../../config/environment','jayson/promise','http','then','FaxQueueReport,\x20%s,\x20%s','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','FaxQueueReport','create','options','debug','UpdateFaxQueueReport','update','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0xfadb3,_0xaa0fcc){var _0x131632=function(_0x3d5593){while(--_0x3d5593){_0xfadb3['push'](_0xfadb3['shift']());}};_0x131632(++_0xaa0fcc);}(_0x8fe9,0xda));var _0x98fe=function(_0x29a29f,_0x155ce7){_0x29a29f=_0x29a29f-0x0;var _0x443ea3=_0x8fe9[_0x29a29f];return _0x443ea3;};'use strict';var _=require('lodash');var util=require(_0x98fe('0x0'));var moment=require(_0x98fe('0x1'));var BPromise=require(_0x98fe('0x2'));var rs=require(_0x98fe('0x3'));var fs=require('fs');var Redis=require(_0x98fe('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x98fe('0x5'));var logger=require('../../config/logger')(_0x98fe('0x6'));var config=require(_0x98fe('0x7'));var jayson=require(_0x98fe('0x8'));var client=jayson['client'][_0x98fe('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x42f884,_0x158a2f,_0x302f74){return new BPromise(function(_0x112642,_0x5ee5eb){return client['request'](_0x42f884,_0x302f74)[_0x98fe('0xa')](function(_0x5d2489){logger['info'](_0x98fe('0xb'),_0x158a2f,'request\x20sent');logger['debug'](_0x98fe('0xc'),_0x158a2f,_0x98fe('0xd'),JSON[_0x98fe('0xe')](_0x5d2489));if(_0x5d2489[_0x98fe('0xf')]){if(_0x5d2489['error'][_0x98fe('0x10')]===0x1f4){logger[_0x98fe('0xf')](_0x98fe('0xb'),_0x158a2f,_0x5d2489['error']['message']);return _0x5ee5eb(_0x5d2489[_0x98fe('0xf')]['message']);}logger['error'](_0x98fe('0xb'),_0x158a2f,_0x5d2489[_0x98fe('0xf')][_0x98fe('0x11')]);return _0x112642(_0x5d2489['error'][_0x98fe('0x11')]);}else{logger[_0x98fe('0x12')](_0x98fe('0xb'),_0x158a2f,'request\x20sent');_0x112642(_0x5d2489[_0x98fe('0x13')]['message']);}})[_0x98fe('0x14')](function(_0x20c76e){logger['error'](_0x98fe('0xb'),_0x158a2f,_0x20c76e);_0x5ee5eb(_0x20c76e);});});}exports[_0x98fe('0x15')]=function(_0x571d1a){var _0x5cc5a4=this;return new Promise(function(_0x58ada1,_0x441679){return db[_0x98fe('0x16')][_0x98fe('0x17')](_0x571d1a['body'],{'raw':_0x571d1a[_0x98fe('0x18')]?_0x571d1a[_0x98fe('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x98fe('0xa')](function(_0x5f29d7){logger['info'](_0x98fe('0x15'),_0x571d1a);logger[_0x98fe('0x19')]('CreateFaxQueueReport',_0x571d1a,JSON[_0x98fe('0xe')](_0x5f29d7));_0x58ada1(_0x5f29d7);})[_0x98fe('0x14')](function(_0xce3f73){logger['error'](_0x98fe('0x15'),_0xce3f73['message'],_0x571d1a);_0x441679(_0x5cc5a4['error'](0x1f4,_0xce3f73[_0x98fe('0x11')]));});});};exports[_0x98fe('0x1a')]=function(_0x2f72a4){var _0x238678=this;return new Promise(function(_0x5bef0d,_0x2876d7){return db[_0x98fe('0x16')][_0x98fe('0x1b')](_0x2f72a4['body'],{'raw':_0x2f72a4[_0x98fe('0x18')]?_0x2f72a4[_0x98fe('0x18')][_0x98fe('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f72a4['options']?_0x2f72a4['options'][_0x98fe('0x1d')]||null:null,'attributes':_0x2f72a4['options']?_0x2f72a4['options'][_0x98fe('0x1e')]||null:null,'limit':_0x2f72a4[_0x98fe('0x18')]?_0x2f72a4[_0x98fe('0x18')][_0x98fe('0x1f')]||null:null})[_0x98fe('0xa')](function(_0x1ff2df){logger[_0x98fe('0x12')](_0x98fe('0x1a'),_0x2f72a4);logger[_0x98fe('0x19')]('UpdateFaxQueueReport',_0x2f72a4,JSON[_0x98fe('0xe')](_0x1ff2df));_0x5bef0d(_0x1ff2df);})['catch'](function(_0x184a32){logger[_0x98fe('0xf')](_0x98fe('0x1a'),_0x184a32[_0x98fe('0x11')],_0x2f72a4);_0x2876d7(_0x238678[_0x98fe('0xf')](0x1f4,_0x184a32[_0x98fe('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index f92ce32..0c8c024 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 _0xe1e1=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1a02c1,_0x39624d){var _0x58979e=function(_0x4b431d){while(--_0x4b431d){_0x1a02c1['push'](_0x1a02c1['shift']());}};_0x58979e(++_0x39624d);}(_0xe1e1,0x1e8));var _0x1e1e=function(_0x3dcf3c,_0x46296a){_0x3dcf3c=_0x3dcf3c-0x0;var _0x2ea71e=_0xe1e1[_0x3dcf3c];return _0x2ea71e;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1e1e('0x0'));var express=require(_0x1e1e('0x1'));var router=express[_0x1e1e('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x1e1e('0x3'));var interaction=require(_0x1e1e('0x4'));var config=require(_0x1e1e('0x5'));var controller=require('./faxQueueReport.controller');router[_0x1e1e('0x6')]('/',auth[_0x1e1e('0x7')](),controller[_0x1e1e('0x8')]);router[_0x1e1e('0x6')](_0x1e1e('0x9'),auth[_0x1e1e('0x7')](),controller[_0x1e1e('0xa')]);router[_0x1e1e('0x6')](_0x1e1e('0xb'),auth['isAuthenticated'](),controller[_0x1e1e('0xc')]);router[_0x1e1e('0xd')]('/',auth[_0x1e1e('0x7')](),controller[_0x1e1e('0xe')]);router[_0x1e1e('0xf')]('/:id',auth[_0x1e1e('0x7')](),controller['update']);router['delete']('/:id',auth[_0x1e1e('0x7')](),controller['destroy']);module[_0x1e1e('0x10')]=router; \ No newline at end of file +var _0x55dd=['../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','update','delete','destroy','exports','path','connect-timeout','fs-extra'];(function(_0x9b2bb0,_0x3965b1){var _0x2cdb3b=function(_0x177d75){while(--_0x177d75){_0x9b2bb0['push'](_0x9b2bb0['shift']());}};_0x2cdb3b(++_0x3965b1);}(_0x55dd,0x129));var _0xd55d=function(_0x5da0d9,_0x49ee54){_0x5da0d9=_0x5da0d9-0x0;var _0x4b6d2f=_0x55dd[_0x5da0d9];return _0x4b6d2f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd55d('0x0'));var timeout=require(_0xd55d('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xd55d('0x2'));var auth=require(_0xd55d('0x3'));var interaction=require(_0xd55d('0x4'));var config=require(_0xd55d('0x5'));var controller=require(_0xd55d('0x6'));router['get']('/',auth[_0xd55d('0x7')](),controller[_0xd55d('0x8')]);router[_0xd55d('0x9')](_0xd55d('0xa'),auth[_0xd55d('0x7')](),controller[_0xd55d('0xb')]);router[_0xd55d('0x9')](_0xd55d('0xc'),auth['isAuthenticated'](),controller[_0xd55d('0xd')]);router[_0xd55d('0xe')]('/',auth[_0xd55d('0x7')](),controller['create']);router[_0xd55d('0xf')]('/:id',auth[_0xd55d('0x7')](),controller[_0xd55d('0x10')]);router[_0xd55d('0x11')](_0xd55d('0xc'),auth['isAuthenticated'](),controller[_0xd55d('0x12')]);module[_0xd55d('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 578f653..db15db5 100644 --- a/server/api/faxTransferReport/faxTransferReport.attributes.js +++ b/server/api/faxTransferReport/faxTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x9bde,0xe1));var _0xe9bd=function(_0x13f058,_0x195328){_0x13f058=_0x13f058-0x0;var _0x313116=_0x9bde[_0x13f058];return _0x313116;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1595ff,_0x238718){var _0x571b9d=function(_0x403228){while(--_0x403228){_0x1595ff['push'](_0x1595ff['shift']());}};_0x571b9d(++_0x238718);}(_0xa9e0,0x123));var _0x0a9e=function(_0xc6be3a,_0x540e05){_0xc6be3a=_0xc6be3a-0x0;var _0x56a310=_0xa9e0[_0xc6be3a];return _0x56a310;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 783fd72..d9c478b 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 _0xb9fb=['index','map','FaxTransferReport','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','rows','keys','intersection','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','error','stack','name','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb9fb,0x68));var _0xbb9f=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0xb9fb[_0xaa0309];return _0x5de7ce;};'use strict';var emlformat=require(_0xbb9f('0x0'));var rimraf=require(_0xbb9f('0x1'));var zipdir=require(_0xbb9f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb9f('0x3'));var moment=require(_0xbb9f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb9f('0x5'));var util=require(_0xbb9f('0x6'));var path=require(_0xbb9f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xbb9f('0x8'));var fs=require('fs');var fs_extra=require(_0xbb9f('0x9'));var _=require('lodash');var squel=require(_0xbb9f('0xa'));var crypto=require(_0xbb9f('0xb'));var jsforce=require(_0xbb9f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xbb9f('0xd'));var querystring=require(_0xbb9f('0xe'));var Papa=require(_0xbb9f('0xf'));var Redis=require(_0xbb9f('0x10'));var authService=require(_0xbb9f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbb9f('0x12'));var hardwareService=require(_0xbb9f('0x13'));var logger=require('../../config/logger')(_0xbb9f('0x14'));var utils=require(_0xbb9f('0x15'));var config=require(_0xbb9f('0x16'));var licenseUtil=require(_0xbb9f('0x17'));var db=require(_0xbb9f('0x18'))['db'];function respondWithStatusCode(_0x520b30,_0x1704e4){_0x1704e4=_0x1704e4||0xcc;return function(_0x93a256){if(_0x93a256){return _0x520b30['sendStatus'](_0x1704e4);}return _0x520b30[_0xbb9f('0x19')](_0x1704e4)[_0xbb9f('0x1a')]();};}function respondWithResult(_0x16a863,_0x4f8bd8){_0x4f8bd8=_0x4f8bd8||0xc8;return function(_0x1e8f3e){if(_0x1e8f3e){return _0x16a863[_0xbb9f('0x19')](_0x4f8bd8)[_0xbb9f('0x1b')](_0x1e8f3e);}};}function respondWithFilteredResult(_0x5c4d69,_0x5c46df){return function(_0x2289fd){if(_0x2289fd){var _0x804b47=typeof _0x5c46df[_0xbb9f('0x1c')]===_0xbb9f('0x1d')&&typeof _0x5c46df[_0xbb9f('0x1e')]===_0xbb9f('0x1d');var _0x15dde0=_0x2289fd[_0xbb9f('0x1f')];var _0x20b233=_0x804b47?0x0:_0x5c46df[_0xbb9f('0x1c')];var _0x4a0968=_0x804b47?_0x2289fd[_0xbb9f('0x1f')]:_0x5c46df[_0xbb9f('0x1c')]+_0x5c46df[_0xbb9f('0x1e')];var _0x231a7e;if(_0x4a0968>=_0x15dde0){_0x4a0968=_0x15dde0;_0x231a7e=0xc8;}else{_0x231a7e=0xce;}_0x5c4d69['status'](_0x231a7e);return _0x5c4d69[_0xbb9f('0x20')](_0xbb9f('0x21'),_0x20b233+'-'+_0x4a0968+'/'+_0x15dde0)[_0xbb9f('0x1b')](_0x2289fd);}return null;};}function patchUpdates(_0x264bae){return function(_0x41fbac){try{jsonpatch['apply'](_0x41fbac,_0x264bae,!![]);}catch(_0x920eb5){return BPromise[_0xbb9f('0x22')](_0x920eb5);}return _0x41fbac['save']();};}function saveUpdates(_0x559ae5,_0x488a02){return function(_0x55cc07){if(_0x55cc07){return _0x55cc07['update'](_0x559ae5)[_0xbb9f('0x23')](function(_0x46a8c3){return _0x46a8c3;});}return null;};}function removeEntity(_0x2192a4,_0x4af3ae){return function(_0x59c64c){if(_0x59c64c){return _0x59c64c[_0xbb9f('0x24')]()['then'](function(){_0x2192a4[_0xbb9f('0x19')](0xcc)[_0xbb9f('0x1a')]();});}};}function handleEntityNotFound(_0x18256d,_0x5041db){return function(_0x48efe4){if(!_0x48efe4){_0x18256d[_0xbb9f('0x25')](0x194);}return _0x48efe4;};}function handleError(_0xea9422,_0x5524ce){_0x5524ce=_0x5524ce||0x1f4;return function(_0x181ecf){logger[_0xbb9f('0x26')](_0x181ecf[_0xbb9f('0x27')]);if(_0x181ecf[_0xbb9f('0x28')]){delete _0x181ecf[_0xbb9f('0x28')];}_0xea9422[_0xbb9f('0x19')](_0x5524ce)[_0xbb9f('0x29')](_0x181ecf);};}exports[_0xbb9f('0x2a')]=function(_0x5e0e4f,_0x1717ee){var _0x3f6694={},_0x51621a={},_0x555060={'count':0x0,'rows':[]};var _0xd5b446=_[_0xbb9f('0x2b')](db[_0xbb9f('0x2c')][_0xbb9f('0x2d')],function(_0x4da492){return{'name':_0x4da492[_0xbb9f('0x2e')],'type':_0x4da492[_0xbb9f('0x2f')]['key']};});_0x51621a['model']=_['map'](_0xd5b446,'name');_0x51621a[_0xbb9f('0x30')]=_['keys'](_0x5e0e4f[_0xbb9f('0x30')]);_0x51621a[_0xbb9f('0x31')]=_['intersection'](_0x51621a[_0xbb9f('0x32')],_0x51621a[_0xbb9f('0x30')]);_0x3f6694[_0xbb9f('0x33')]=_['intersection'](_0x51621a['model'],qs[_0xbb9f('0x34')](_0x5e0e4f[_0xbb9f('0x30')][_0xbb9f('0x34')]));_0x3f6694[_0xbb9f('0x33')]=_0x3f6694['attributes'][_0xbb9f('0x35')]?_0x3f6694[_0xbb9f('0x33')]:_0x51621a[_0xbb9f('0x32')];if(!_0x5e0e4f[_0xbb9f('0x30')][_0xbb9f('0x36')](_0xbb9f('0x37'))){_0x3f6694['limit']=qs['limit'](_0x5e0e4f[_0xbb9f('0x30')]['limit']);_0x3f6694[_0xbb9f('0x1c')]=qs[_0xbb9f('0x1c')](_0x5e0e4f['query'][_0xbb9f('0x1c')]);}_0x3f6694[_0xbb9f('0x38')]=qs[_0xbb9f('0x39')](_0x5e0e4f[_0xbb9f('0x30')][_0xbb9f('0x39')]);_0x3f6694[_0xbb9f('0x3a')]=qs[_0xbb9f('0x31')](_[_0xbb9f('0x3b')](_0x5e0e4f['query'],_0x51621a[_0xbb9f('0x31')]),_0xd5b446);if(_0x5e0e4f[_0xbb9f('0x30')][_0xbb9f('0x3c')]){_0x3f6694[_0xbb9f('0x3a')]=_[_0xbb9f('0x3d')](_0x3f6694[_0xbb9f('0x3a')],{'$or':_['map'](_0xd5b446,function(_0x4436b9){if(_0x4436b9[_0xbb9f('0x2f')]!=='VIRTUAL'){var _0x5c8ef9={};_0x5c8ef9[_0x4436b9['name']]={'$like':'%'+_0x5e0e4f['query'][_0xbb9f('0x3c')]+'%'};return _0x5c8ef9;}})});}_0x3f6694=_['merge']({},_0x3f6694,_0x5e0e4f[_0xbb9f('0x3e')]);var _0x8ac5c9={'where':_0x3f6694[_0xbb9f('0x3a')]};return db[_0xbb9f('0x2c')][_0xbb9f('0x1f')](_0x8ac5c9)[_0xbb9f('0x23')](function(_0x170864){_0x555060['count']=_0x170864;if(_0x5e0e4f[_0xbb9f('0x30')][_0xbb9f('0x3f')]){_0x3f6694['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x3f6694);})[_0xbb9f('0x23')](function(_0x547b13){_0x555060[_0xbb9f('0x40')]=_0x547b13;return _0x555060;})['then'](respondWithFilteredResult(_0x1717ee,_0x3f6694))['catch'](handleError(_0x1717ee,null));};exports['show']=function(_0x23def0,_0xb2e444){var _0x4db382={'raw':!![],'where':{'id':_0x23def0['params']['id']}},_0x1fbae7={};_0x1fbae7[_0xbb9f('0x32')]=_[_0xbb9f('0x41')](db['FaxTransferReport']['rawAttributes']);_0x1fbae7[_0xbb9f('0x30')]=_[_0xbb9f('0x41')](_0x23def0[_0xbb9f('0x30')]);_0x1fbae7[_0xbb9f('0x31')]=_[_0xbb9f('0x42')](_0x1fbae7[_0xbb9f('0x32')],_0x1fbae7[_0xbb9f('0x30')]);_0x4db382[_0xbb9f('0x33')]=_[_0xbb9f('0x42')](_0x1fbae7[_0xbb9f('0x32')],qs[_0xbb9f('0x34')](_0x23def0[_0xbb9f('0x30')]['fields']));_0x4db382[_0xbb9f('0x33')]=_0x4db382[_0xbb9f('0x33')][_0xbb9f('0x35')]?_0x4db382['attributes']:_0x1fbae7[_0xbb9f('0x32')];if(_0x23def0[_0xbb9f('0x30')][_0xbb9f('0x3f')]){_0x4db382['include']=[{'all':!![]}];}_0x4db382=_[_0xbb9f('0x3d')]({},_0x4db382,_0x23def0[_0xbb9f('0x3e')]);return db[_0xbb9f('0x2c')][_0xbb9f('0x43')](_0x4db382)[_0xbb9f('0x23')](handleEntityNotFound(_0xb2e444,null))[_0xbb9f('0x23')](respondWithResult(_0xb2e444,null))['catch'](handleError(_0xb2e444,null));};exports[_0xbb9f('0x44')]=function(_0x58f369,_0x39a59c){return db[_0xbb9f('0x2c')][_0xbb9f('0x44')](_0x58f369['body'],{})[_0xbb9f('0x23')](respondWithResult(_0x39a59c,0xc9))[_0xbb9f('0x45')](handleError(_0x39a59c,null));};exports['update']=function(_0x415e9f,_0x1c017f){if(_0x415e9f[_0xbb9f('0x46')]['id']){delete _0x415e9f[_0xbb9f('0x46')]['id'];}return db[_0xbb9f('0x2c')][_0xbb9f('0x43')]({'where':{'id':_0x415e9f['params']['id']}})[_0xbb9f('0x23')](handleEntityNotFound(_0x1c017f,null))[_0xbb9f('0x23')](saveUpdates(_0x415e9f['body'],null))[_0xbb9f('0x23')](respondWithResult(_0x1c017f,null))[_0xbb9f('0x45')](handleError(_0x1c017f,null));};exports[_0xbb9f('0x24')]=function(_0x14ed7a,_0x1c018a){return db[_0xbb9f('0x2c')][_0xbb9f('0x43')]({'where':{'id':_0x14ed7a[_0xbb9f('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c018a,null))[_0xbb9f('0x23')](removeEntity(_0x1c018a,null))[_0xbb9f('0x45')](handleError(_0x1c018a,null));};exports[_0xbb9f('0x48')]=function(_0x494283,_0x3d6401){return db[_0xbb9f('0x2c')]['describe']()[_0xbb9f('0x23')](respondWithResult(_0x3d6401,null))[_0xbb9f('0x45')](handleError(_0x3d6401,null));}; \ No newline at end of file +var _0x7464=['Content-Range','reject','save','destroy','then','error','stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','find','create','body','update','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x3537c7,_0x2be727){var _0x17d82a=function(_0x4032fd){while(--_0x4032fd){_0x3537c7['push'](_0x3537c7['shift']());}};_0x17d82a(++_0x2be727);}(_0x7464,0x71));var _0x4746=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7464[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4746('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4746('0x1'));var rp=require(_0x4746('0x2'));var moment=require(_0x4746('0x3'));var BPromise=require(_0x4746('0x4'));var Mustache=require('mustache');var util=require(_0x4746('0x5'));var path=require(_0x4746('0x6'));var sox=require(_0x4746('0x7'));var csv=require('to-csv');var ejs=require(_0x4746('0x8'));var fs=require('fs');var fs_extra=require(_0x4746('0x9'));var _=require(_0x4746('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4746('0xb'));var toCsv=require(_0x4746('0xc'));var querystring=require('querystring');var Papa=require(_0x4746('0xd'));var Redis=require(_0x4746('0xe'));var authService=require(_0x4746('0xf'));var qs=require(_0x4746('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4746('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x4746('0x12'));var config=require(_0x4746('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4746('0x14'))['db'];function respondWithStatusCode(_0xa9e2d4,_0x1416a2){_0x1416a2=_0x1416a2||0xcc;return function(_0x32e9d7){if(_0x32e9d7){return _0xa9e2d4[_0x4746('0x15')](_0x1416a2);}return _0xa9e2d4[_0x4746('0x16')](_0x1416a2)[_0x4746('0x17')]();};}function respondWithResult(_0x24800f,_0x15a554){_0x15a554=_0x15a554||0xc8;return function(_0x24b7e7){if(_0x24b7e7){return _0x24800f[_0x4746('0x16')](_0x15a554)[_0x4746('0x18')](_0x24b7e7);}};}function respondWithFilteredResult(_0x3eb64f,_0x26e8c5){return function(_0x456b4a){if(_0x456b4a){var _0x40031d=typeof _0x26e8c5[_0x4746('0x19')]===_0x4746('0x1a')&&typeof _0x26e8c5[_0x4746('0x1b')]===_0x4746('0x1a');var _0x3158c4=_0x456b4a[_0x4746('0x1c')];var _0x2d0877=_0x40031d?0x0:_0x26e8c5[_0x4746('0x19')];var _0x568d5b=_0x40031d?_0x456b4a[_0x4746('0x1c')]:_0x26e8c5[_0x4746('0x19')]+_0x26e8c5[_0x4746('0x1b')];var _0x48ef49;if(_0x568d5b>=_0x3158c4){_0x568d5b=_0x3158c4;_0x48ef49=0xc8;}else{_0x48ef49=0xce;}_0x3eb64f[_0x4746('0x16')](_0x48ef49);return _0x3eb64f['set'](_0x4746('0x1d'),_0x2d0877+'-'+_0x568d5b+'/'+_0x3158c4)['json'](_0x456b4a);}return null;};}function patchUpdates(_0x5a5ceb){return function(_0x64c227){try{jsonpatch['apply'](_0x64c227,_0x5a5ceb,!![]);}catch(_0x5bc115){return BPromise[_0x4746('0x1e')](_0x5bc115);}return _0x64c227[_0x4746('0x1f')]();};}function saveUpdates(_0x155bcd,_0x201039){return function(_0x4211fc){if(_0x4211fc){return _0x4211fc['update'](_0x155bcd)['then'](function(_0x394728){return _0x394728;});}return null;};}function removeEntity(_0x437667,_0x51e312){return function(_0x95967d){if(_0x95967d){return _0x95967d[_0x4746('0x20')]()[_0x4746('0x21')](function(){_0x437667[_0x4746('0x16')](0xcc)[_0x4746('0x17')]();});}};}function handleEntityNotFound(_0x2f0c23,_0x500505){return function(_0x2299b1){if(!_0x2299b1){_0x2f0c23[_0x4746('0x15')](0x194);}return _0x2299b1;};}function handleError(_0x5232b4,_0x5e4743){_0x5e4743=_0x5e4743||0x1f4;return function(_0x29c52f){logger[_0x4746('0x22')](_0x29c52f[_0x4746('0x23')]);if(_0x29c52f[_0x4746('0x24')]){delete _0x29c52f[_0x4746('0x24')];}_0x5232b4['status'](_0x5e4743)[_0x4746('0x25')](_0x29c52f);};}exports[_0x4746('0x26')]=function(_0x11fac2,_0x1799fc){var _0x1e3ee1={},_0x11b5ba={},_0x39e6f6={'count':0x0,'rows':[]};var _0x452405=_[_0x4746('0x27')](db[_0x4746('0x28')][_0x4746('0x29')],function(_0x3eab71){return{'name':_0x3eab71[_0x4746('0x2a')],'type':_0x3eab71[_0x4746('0x2b')]['key']};});_0x11b5ba[_0x4746('0x2c')]=_[_0x4746('0x27')](_0x452405,_0x4746('0x24'));_0x11b5ba[_0x4746('0x2d')]=_[_0x4746('0x2e')](_0x11fac2[_0x4746('0x2d')]);_0x11b5ba[_0x4746('0x2f')]=_[_0x4746('0x30')](_0x11b5ba[_0x4746('0x2c')],_0x11b5ba[_0x4746('0x2d')]);_0x1e3ee1[_0x4746('0x31')]=_['intersection'](_0x11b5ba['model'],qs[_0x4746('0x32')](_0x11fac2['query'][_0x4746('0x32')]));_0x1e3ee1[_0x4746('0x31')]=_0x1e3ee1[_0x4746('0x31')][_0x4746('0x33')]?_0x1e3ee1[_0x4746('0x31')]:_0x11b5ba[_0x4746('0x2c')];if(!_0x11fac2[_0x4746('0x2d')][_0x4746('0x34')](_0x4746('0x35'))){_0x1e3ee1[_0x4746('0x1b')]=qs[_0x4746('0x1b')](_0x11fac2[_0x4746('0x2d')][_0x4746('0x1b')]);_0x1e3ee1[_0x4746('0x19')]=qs[_0x4746('0x19')](_0x11fac2[_0x4746('0x2d')]['offset']);}_0x1e3ee1[_0x4746('0x36')]=qs['sort'](_0x11fac2[_0x4746('0x2d')][_0x4746('0x37')]);_0x1e3ee1[_0x4746('0x38')]=qs[_0x4746('0x2f')](_['pick'](_0x11fac2[_0x4746('0x2d')],_0x11b5ba[_0x4746('0x2f')]),_0x452405);if(_0x11fac2['query'][_0x4746('0x39')]){_0x1e3ee1['where']=_[_0x4746('0x3a')](_0x1e3ee1['where'],{'$or':_[_0x4746('0x27')](_0x452405,function(_0x511f72){if(_0x511f72[_0x4746('0x2b')]!==_0x4746('0x3b')){var _0x5d5a8f={};_0x5d5a8f[_0x511f72[_0x4746('0x24')]]={'$like':'%'+_0x11fac2[_0x4746('0x2d')][_0x4746('0x39')]+'%'};return _0x5d5a8f;}})});}_0x1e3ee1=_['merge']({},_0x1e3ee1,_0x11fac2['options']);var _0x22abd0={'where':_0x1e3ee1[_0x4746('0x38')]};return db[_0x4746('0x28')][_0x4746('0x1c')](_0x22abd0)[_0x4746('0x21')](function(_0x29f8c8){_0x39e6f6['count']=_0x29f8c8;if(_0x11fac2['query'][_0x4746('0x3c')]){_0x1e3ee1['include']=[{'all':!![]}];}return db[_0x4746('0x28')][_0x4746('0x3d')](_0x1e3ee1);})[_0x4746('0x21')](function(_0xd1e40c){_0x39e6f6['rows']=_0xd1e40c;return _0x39e6f6;})[_0x4746('0x21')](respondWithFilteredResult(_0x1799fc,_0x1e3ee1))[_0x4746('0x3e')](handleError(_0x1799fc,null));};exports[_0x4746('0x3f')]=function(_0x5bcec9,_0x3e2b37){var _0x156865={'raw':!![],'where':{'id':_0x5bcec9[_0x4746('0x40')]['id']}},_0x1f5f0c={};_0x1f5f0c[_0x4746('0x2c')]=_['keys'](db[_0x4746('0x28')][_0x4746('0x29')]);_0x1f5f0c[_0x4746('0x2d')]=_[_0x4746('0x2e')](_0x5bcec9[_0x4746('0x2d')]);_0x1f5f0c[_0x4746('0x2f')]=_[_0x4746('0x30')](_0x1f5f0c[_0x4746('0x2c')],_0x1f5f0c[_0x4746('0x2d')]);_0x156865[_0x4746('0x31')]=_[_0x4746('0x30')](_0x1f5f0c['model'],qs[_0x4746('0x32')](_0x5bcec9['query'][_0x4746('0x32')]));_0x156865[_0x4746('0x31')]=_0x156865[_0x4746('0x31')][_0x4746('0x33')]?_0x156865['attributes']:_0x1f5f0c[_0x4746('0x2c')];if(_0x5bcec9[_0x4746('0x2d')][_0x4746('0x3c')]){_0x156865[_0x4746('0x41')]=[{'all':!![]}];}_0x156865=_[_0x4746('0x3a')]({},_0x156865,_0x5bcec9['options']);return db[_0x4746('0x28')][_0x4746('0x42')](_0x156865)[_0x4746('0x21')](handleEntityNotFound(_0x3e2b37,null))['then'](respondWithResult(_0x3e2b37,null))['catch'](handleError(_0x3e2b37,null));};exports[_0x4746('0x43')]=function(_0x3ff0ed,_0x581252){return db[_0x4746('0x28')][_0x4746('0x43')](_0x3ff0ed[_0x4746('0x44')],{})[_0x4746('0x21')](respondWithResult(_0x581252,0xc9))[_0x4746('0x3e')](handleError(_0x581252,null));};exports[_0x4746('0x45')]=function(_0xaa4afd,_0x2d7675){if(_0xaa4afd[_0x4746('0x44')]['id']){delete _0xaa4afd[_0x4746('0x44')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0xaa4afd['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x2d7675,null))[_0x4746('0x21')](saveUpdates(_0xaa4afd[_0x4746('0x44')],null))[_0x4746('0x21')](respondWithResult(_0x2d7675,null))[_0x4746('0x3e')](handleError(_0x2d7675,null));};exports[_0x4746('0x20')]=function(_0x3970af,_0x460b8b){return db[_0x4746('0x28')][_0x4746('0x42')]({'where':{'id':_0x3970af['params']['id']}})[_0x4746('0x21')](handleEntityNotFound(_0x460b8b,null))[_0x4746('0x21')](removeEntity(_0x460b8b,null))[_0x4746('0x3e')](handleError(_0x460b8b,null));};exports[_0x4746('0x46')]=function(_0x552ac2,_0x5175bd){return db['FaxTransferReport'][_0x4746('0x46')]()[_0x4746('0x21')](respondWithResult(_0x5175bd,null))['catch'](handleError(_0x5175bd,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 6aeb93a..3f0444c 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 _0x782e=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x5929a5,_0x38bd2a){var _0x1d3f2b=function(_0x42f986){while(--_0x42f986){_0x5929a5['push'](_0x5929a5['shift']());}};_0x1d3f2b(++_0x38bd2a);}(_0x782e,0x1d4));var _0xe782=function(_0x438cb6,_0x5bea69){_0x438cb6=_0x438cb6-0x0;var _0x43b0b8=_0x782e[_0x438cb6];return _0x43b0b8;};'use strict';var _=require(_0xe782('0x0'));var util=require(_0xe782('0x1'));var logger=require(_0xe782('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe782('0x3'));var rp=require(_0xe782('0x4'));var fs=require('fs');var path=require(_0xe782('0x5'));var rimraf=require(_0xe782('0x6'));var config=require(_0xe782('0x7'));var attributes=require(_0xe782('0x8'));module[_0xe782('0x9')]=function(_0x2183d8,_0x2f9f5d){return _0x2183d8[_0xe782('0xa')](_0xe782('0xb'),attributes,{'tableName':_0xe782('0xc'),'paranoid':![],'indexes':[{'name':_0xe782('0xd'),'fields':[_0xe782('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc7bb=['define','report_fax_transfer','uniqueid','lodash','api','moment','bluebird','rimraf','../../config/environment','./faxTransferReport.attributes','exports'];(function(_0x22c4ff,_0x4cffd6){var _0x3e39b2=function(_0x283bb9){while(--_0x283bb9){_0x22c4ff['push'](_0x22c4ff['shift']());}};_0x3e39b2(++_0x4cffd6);}(_0xc7bb,0x158));var _0xbc7b=function(_0xd78e6c,_0x3eee96){_0xd78e6c=_0xd78e6c-0x0;var _0x43b101=_0xc7bb[_0xd78e6c];return _0x43b101;};'use strict';var _=require(_0xbc7b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbc7b('0x1'));var moment=require(_0xbc7b('0x2'));var BPromise=require(_0xbc7b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc7b('0x4'));var config=require(_0xbc7b('0x5'));var attributes=require(_0xbc7b('0x6'));module[_0xbc7b('0x7')]=function(_0x65a0c7,_0x496d01){return _0x65a0c7[_0xbc7b('0x8')]('FaxTransferReport',attributes,{'tableName':_0xbc7b('0x9'),'paranoid':![],'indexes':[{'name':_0xbc7b('0xa'),'fields':[_0xbc7b('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 2fad223..61bd5a5 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 _0xfcab=['http','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x54bac5,_0x8d3a16){var _0xc15971=function(_0x254653){while(--_0x254653){_0x54bac5['push'](_0x54bac5['shift']());}};_0xc15971(++_0x8d3a16);}(_0xfcab,0x15b));var _0xbfca=function(_0x1265ed,_0x4b85e8){_0x1265ed=_0x1265ed-0x0;var _0x5ac459=_0xfcab[_0x1265ed];return _0x5ac459;};'use strict';var _=require(_0xbfca('0x0'));var util=require(_0xbfca('0x1'));var moment=require(_0xbfca('0x2'));var BPromise=require(_0xbfca('0x3'));var rs=require(_0xbfca('0x4'));var fs=require('fs');var Redis=require(_0xbfca('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbfca('0x6'));var logger=require('../../config/logger')(_0xbfca('0x7'));var config=require(_0xbfca('0x8'));var jayson=require(_0xbfca('0x9'));var client=jayson['client'][_0xbfca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99c1b,_0x29f537,_0x305bae){return new BPromise(function(_0x596025,_0x47d6f2){return client['request'](_0x99c1b,_0x305bae)[_0xbfca('0xb')](function(_0x2f20ad){logger[_0xbfca('0xc')](_0xbfca('0xd'),_0x29f537,_0xbfca('0xe'));logger[_0xbfca('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x29f537,_0xbfca('0xe'),JSON['stringify'](_0x2f20ad));if(_0x2f20ad['error']){if(_0x2f20ad[_0xbfca('0x10')][_0xbfca('0x11')]===0x1f4){logger[_0xbfca('0x10')](_0xbfca('0xd'),_0x29f537,_0x2f20ad[_0xbfca('0x10')]['message']);return _0x47d6f2(_0x2f20ad[_0xbfca('0x10')]['message']);}logger[_0xbfca('0x10')](_0xbfca('0xd'),_0x29f537,_0x2f20ad['error'][_0xbfca('0x12')]);return _0x596025(_0x2f20ad[_0xbfca('0x10')][_0xbfca('0x12')]);}else{logger[_0xbfca('0xc')](_0xbfca('0xd'),_0x29f537,_0xbfca('0xe'));_0x596025(_0x2f20ad[_0xbfca('0x13')][_0xbfca('0x12')]);}})[_0xbfca('0x14')](function(_0x106ae1){logger[_0xbfca('0x10')](_0xbfca('0xd'),_0x29f537,_0x106ae1);_0x47d6f2(_0x106ae1);});});} \ No newline at end of file +var _0xe0e7=['jayson/promise','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2a28c9,_0x12f1c7){var _0x274a1b=function(_0x43aacb){while(--_0x43aacb){_0x2a28c9['push'](_0x2a28c9['shift']());}};_0x274a1b(++_0x12f1c7);}(_0xe0e7,0x14d));var _0x7e0e=function(_0x56562d,_0x578183){_0x56562d=_0x56562d-0x0;var _0xdafef9=_0xe0e7[_0x56562d];return _0xdafef9;};'use strict';var _=require('lodash');var util=require(_0x7e0e('0x0'));var moment=require('moment');var BPromise=require(_0x7e0e('0x1'));var rs=require(_0x7e0e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e0e('0x3'))['db'];var utils=require(_0x7e0e('0x4'));var logger=require(_0x7e0e('0x5'))('rpc');var config=require(_0x7e0e('0x6'));var jayson=require(_0x7e0e('0x7'));var client=jayson[_0x7e0e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5902bb,_0x54c69e,_0x4de8a9){return new BPromise(function(_0x39af72,_0x5b97b4){return client[_0x7e0e('0x9')](_0x5902bb,_0x4de8a9)[_0x7e0e('0xa')](function(_0xd711d4){logger[_0x7e0e('0xb')](_0x7e0e('0xc'),_0x54c69e,_0x7e0e('0xd'));logger['debug'](_0x7e0e('0xe'),_0x54c69e,'request\x20sent',JSON[_0x7e0e('0xf')](_0xd711d4));if(_0xd711d4[_0x7e0e('0x10')]){if(_0xd711d4[_0x7e0e('0x10')][_0x7e0e('0x11')]===0x1f4){logger[_0x7e0e('0x10')](_0x7e0e('0xc'),_0x54c69e,_0xd711d4[_0x7e0e('0x10')]['message']);return _0x5b97b4(_0xd711d4['error'][_0x7e0e('0x12')]);}logger[_0x7e0e('0x10')](_0x7e0e('0xc'),_0x54c69e,_0xd711d4[_0x7e0e('0x10')][_0x7e0e('0x12')]);return _0x39af72(_0xd711d4[_0x7e0e('0x10')]['message']);}else{logger[_0x7e0e('0xb')](_0x7e0e('0xc'),_0x54c69e,'request\x20sent');_0x39af72(_0xd711d4['result']['message']);}})[_0x7e0e('0x13')](function(_0x220357){logger[_0x7e0e('0x10')](_0x7e0e('0xc'),_0x54c69e,_0x220357);_0x5b97b4(_0x220357);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 99867bf..d455fae 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 _0x8948=['connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','create','put','update','/:id','exports','util','path'];(function(_0x9c8a31,_0x4200c6){var _0x4931e1=function(_0x5b5974){while(--_0x5b5974){_0x9c8a31['push'](_0x9c8a31['shift']());}};_0x4931e1(++_0x4200c6);}(_0x8948,0x97));var _0x8894=function(_0x536d76,_0x5e6905){_0x536d76=_0x536d76-0x0;var _0x207a48=_0x8948[_0x536d76];return _0x207a48;};'use strict';var multer=require('multer');var util=require(_0x8894('0x0'));var path=require(_0x8894('0x1'));var timeout=require(_0x8894('0x2'));var express=require(_0x8894('0x3'));var router=express['Router']();var fs_extra=require(_0x8894('0x4'));var auth=require(_0x8894('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8894('0x6'));var controller=require('./faxTransferReport.controller');router[_0x8894('0x7')]('/',auth[_0x8894('0x8')](),controller[_0x8894('0x9')]);router[_0x8894('0x7')]('/describe',auth[_0x8894('0x8')](),controller[_0x8894('0xa')]);router[_0x8894('0x7')]('/:id',auth[_0x8894('0x8')](),controller[_0x8894('0xb')]);router['post']('/',auth[_0x8894('0x8')](),controller[_0x8894('0xc')]);router[_0x8894('0xd')]('/:id',auth[_0x8894('0x8')](),controller[_0x8894('0xe')]);router['delete'](_0x8894('0xf'),auth[_0x8894('0x8')](),controller['destroy']);module[_0x8894('0x10')]=router; \ No newline at end of file +var _0x1ec2=['/describe','describe','/:id','show','post','create','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','get','isAuthenticated','index'];(function(_0x5b4910,_0x1228f8){var _0x6296d6=function(_0x195937){while(--_0x195937){_0x5b4910['push'](_0x5b4910['shift']());}};_0x6296d6(++_0x1228f8);}(_0x1ec2,0x172));var _0x21ec=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x1ec2[_0x29b609];return _0x54c952;};'use strict';var multer=require(_0x21ec('0x0'));var util=require('util');var path=require(_0x21ec('0x1'));var timeout=require('connect-timeout');var express=require(_0x21ec('0x2'));var router=express['Router']();var fs_extra=require(_0x21ec('0x3'));var auth=require(_0x21ec('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./faxTransferReport.controller');router[_0x21ec('0x5')]('/',auth[_0x21ec('0x6')](),controller[_0x21ec('0x7')]);router[_0x21ec('0x5')](_0x21ec('0x8'),auth['isAuthenticated'](),controller[_0x21ec('0x9')]);router[_0x21ec('0x5')](_0x21ec('0xa'),auth[_0x21ec('0x6')](),controller[_0x21ec('0xb')]);router[_0x21ec('0xc')]('/',auth[_0x21ec('0x6')](),controller[_0x21ec('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x21ec('0xe')]);router[_0x21ec('0xf')](_0x21ec('0xa'),auth[_0x21ec('0x6')](),controller[_0x21ec('0x10')]);module[_0x21ec('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 4adcf5a..f638d8f 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 _0xec6f=['/:id','show','/:id/configurations','/:id/fields','getFields','create','post','addConfiguration','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','isAuthenticated','index'];(function(_0x418c22,_0x5033d3){var _0x5926b2=function(_0xa1f25){while(--_0xa1f25){_0x418c22['push'](_0x418c22['shift']());}};_0x5926b2(++_0x5033d3);}(_0xec6f,0x10a));var _0xfec6=function(_0x5d851d,_0x53c51c){_0x5d851d=_0x5d851d-0x0;var _0xbaaa92=_0xec6f[_0x5d851d];return _0xbaaa92;};'use strict';var multer=require('multer');var util=require(_0xfec6('0x0'));var path=require(_0xfec6('0x1'));var timeout=require('connect-timeout');var express=require(_0xfec6('0x2'));var router=express[_0xfec6('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xfec6('0x4'));var interaction=require(_0xfec6('0x5'));var config=require('../../config/environment');var controller=require(_0xfec6('0x6'));router[_0xfec6('0x7')]('/',auth[_0xfec6('0x8')](),controller[_0xfec6('0x9')]);router['get'](_0xfec6('0xa'),auth[_0xfec6('0x8')](),controller[_0xfec6('0xb')]);router[_0xfec6('0x7')](_0xfec6('0xc'),auth[_0xfec6('0x8')](),controller['getConfigurations']);router[_0xfec6('0x7')](_0xfec6('0xd'),auth[_0xfec6('0x8')](),controller[_0xfec6('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xfec6('0xf')]);router[_0xfec6('0x10')](_0xfec6('0xc'),auth[_0xfec6('0x8')](),controller[_0xfec6('0x11')]);router[_0xfec6('0x12')](_0xfec6('0xa'),auth[_0xfec6('0x8')](),controller[_0xfec6('0x13')]);router[_0xfec6('0x14')]('/:id',auth[_0xfec6('0x8')](),controller[_0xfec6('0x15')]);module[_0xfec6('0x16')]=router; \ No newline at end of file +var _0x2ef5=['show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id'];(function(_0x2165bd,_0x4f9906){var _0x5e6fd0=function(_0x161e7c){while(--_0x161e7c){_0x2165bd['push'](_0x2165bd['shift']());}};_0x5e6fd0(++_0x4f9906);}(_0x2ef5,0x11d));var _0x52ef=function(_0x3c3ec7,_0x321114){_0x3c3ec7=_0x3c3ec7-0x0;var _0x535807=_0x2ef5[_0x3c3ec7];return _0x535807;};'use strict';var multer=require(_0x52ef('0x0'));var util=require(_0x52ef('0x1'));var path=require(_0x52ef('0x2'));var timeout=require(_0x52ef('0x3'));var express=require(_0x52ef('0x4'));var router=express[_0x52ef('0x5')]();var fs_extra=require(_0x52ef('0x6'));var auth=require(_0x52ef('0x7'));var interaction=require(_0x52ef('0x8'));var config=require(_0x52ef('0x9'));var controller=require(_0x52ef('0xa'));router[_0x52ef('0xb')]('/',auth[_0x52ef('0xc')](),controller[_0x52ef('0xd')]);router['get'](_0x52ef('0xe'),auth[_0x52ef('0xc')](),controller[_0x52ef('0xf')]);router['get'](_0x52ef('0x10'),auth['isAuthenticated'](),controller[_0x52ef('0x11')]);router[_0x52ef('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x52ef('0x12')]);router[_0x52ef('0x13')]('/',auth['isAuthenticated'](),controller[_0x52ef('0x14')]);router['post'](_0x52ef('0x10'),auth[_0x52ef('0xc')](),controller[_0x52ef('0x15')]);router[_0x52ef('0x16')]('/:id',auth[_0x52ef('0xc')](),controller['update']);router[_0x52ef('0x17')](_0x52ef('0xe'),auth[_0x52ef('0xc')](),controller['destroy']);module[_0x52ef('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 7a72065..9d835a1 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 _0x9079=['integrationTab','STRING','ENUM','basic'];(function(_0x39563d,_0x41479){var _0x4e5278=function(_0x4ce23e){while(--_0x4ce23e){_0x39563d['push'](_0x39563d['shift']());}};_0x4e5278(++_0x41479);}(_0x9079,0x165));var _0x9907=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9079[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9907('0x0')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9907('0x0')]},'authType':{'type':Sequelize[_0x9907('0x1')](_0x9907('0x2')),'defaultValue':'basic'},'password':{'type':Sequelize[_0x9907('0x0')]},'consumerKey':{'type':Sequelize[_0x9907('0x0')]},'consumerSecret':{'type':Sequelize[_0x9907('0x0')]},'token':{'type':Sequelize[_0x9907('0x0')]},'tokenSecret':{'type':Sequelize[_0x9907('0x0')]},'serverUrl':{'type':Sequelize[_0x9907('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x9907('0x1')](_0x9907('0x3'),'newTab'),'defaultValue':_0x9907('0x3')}}; \ No newline at end of file +var _0xd9c4=['integrationTab','newTab','STRING','ENUM','basic'];(function(_0x286cbc,_0x284f45){var _0x3f7789=function(_0x9e0892){while(--_0x9e0892){_0x286cbc['push'](_0x286cbc['shift']());}};_0x3f7789(++_0x284f45);}(_0xd9c4,0x1a6));var _0x4d9c=function(_0x3f0b30,_0x159bc8){_0x3f0b30=_0x3f0b30-0x0;var _0x2748a5=_0xd9c4[_0x3f0b30];return _0x2748a5;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x4d9c('0x0')]},'remoteUri':{'type':Sequelize[_0x4d9c('0x0')]},'authType':{'type':Sequelize[_0x4d9c('0x1')](_0x4d9c('0x2')),'defaultValue':_0x4d9c('0x2')},'password':{'type':Sequelize[_0x4d9c('0x0')]},'consumerKey':{'type':Sequelize[_0x4d9c('0x0')]},'consumerSecret':{'type':Sequelize[_0x4d9c('0x0')]},'token':{'type':Sequelize[_0x4d9c('0x0')]},'tokenSecret':{'type':Sequelize[_0x4d9c('0x0')]},'serverUrl':{'type':Sequelize[_0x4d9c('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x4d9c('0x1')](_0x4d9c('0x3'),_0x4d9c('0x4')),'defaultValue':_0x4d9c('0x3')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 969546c..8d128b4 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 _0xf7e4=['fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','DeskAccount','findAll','rows','catch','show','params','filters','include','find','create','body','destroy','getConfigurations','DeskConfiguration','order','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','findOne','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','Authorization','Basic\x20%s','%s:%s','toString','_embedded','entries','label','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','request-promise','moment','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','limit','undefined','count','offset','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send','index','map','rawAttributes'];(function(_0x3c15c5,_0x49e3c4){var _0xf4c89e=function(_0x2254c5){while(--_0x2254c5){_0x3c15c5['push'](_0x3c15c5['shift']());}};_0xf4c89e(++_0x49e3c4);}(_0xf7e4,0x126));var _0x4f7e=function(_0x382d56,_0xf2dfbe){_0x382d56=_0x382d56-0x0;var _0x2fe525=_0xf7e4[_0x382d56];return _0x2fe525;};'use strict';var emlformat=require(_0x4f7e('0x0'));var rimraf=require(_0x4f7e('0x1'));var zipdir=require(_0x4f7e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f7e('0x3'));var moment=require(_0x4f7e('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x4f7e('0x5'));var csv=require(_0x4f7e('0x6'));var ejs=require(_0x4f7e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4f7e('0x8'));var squel=require(_0x4f7e('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4f7e('0xa'));var toCsv=require(_0x4f7e('0x6'));var querystring=require(_0x4f7e('0xb'));var Papa=require(_0x4f7e('0xc'));var Redis=require(_0x4f7e('0xd'));var authService=require(_0x4f7e('0xe'));var qs=require(_0x4f7e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f7e('0x10'));var logger=require(_0x4f7e('0x11'))('api');var utils=require(_0x4f7e('0x12'));var config=require(_0x4f7e('0x13'));var licenseUtil=require(_0x4f7e('0x14'));var db=require(_0x4f7e('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3b1f52,_0xd34b2){_0xd34b2=_0xd34b2||0xcc;return function(_0x273e8b){if(_0x273e8b){return _0x3b1f52['sendStatus'](_0xd34b2);}return _0x3b1f52[_0x4f7e('0x16')](_0xd34b2)[_0x4f7e('0x17')]();};}function respondWithResult(_0xaf1228,_0x154db5){_0x154db5=_0x154db5||0xc8;return function(_0x5cefa8){if(_0x5cefa8){return _0xaf1228['status'](_0x154db5)['json'](_0x5cefa8);}};}function respondWithFilteredResult(_0x4b529c,_0x5a4125){return function(_0x37c798){if(_0x37c798){var _0x3290ab=typeof _0x5a4125['offset']==='undefined'&&typeof _0x5a4125[_0x4f7e('0x18')]===_0x4f7e('0x19');var _0x964b6f=_0x37c798[_0x4f7e('0x1a')];var _0x1af7ca=_0x3290ab?0x0:_0x5a4125['offset'];var _0x1b1653=_0x3290ab?_0x37c798['count']:_0x5a4125[_0x4f7e('0x1b')]+_0x5a4125[_0x4f7e('0x18')];var _0x4716fb;if(_0x1b1653>=_0x964b6f){_0x1b1653=_0x964b6f;_0x4716fb=0xc8;}else{_0x4716fb=0xce;}_0x4b529c[_0x4f7e('0x16')](_0x4716fb);return _0x4b529c[_0x4f7e('0x1c')](_0x4f7e('0x1d'),_0x1af7ca+'-'+_0x1b1653+'/'+_0x964b6f)['json'](_0x37c798);}return null;};}function patchUpdates(_0x5e658c){return function(_0x1f5ecb){try{jsonpatch[_0x4f7e('0x1e')](_0x1f5ecb,_0x5e658c,!![]);}catch(_0x2fc22a){return BPromise['reject'](_0x2fc22a);}return _0x1f5ecb[_0x4f7e('0x1f')]();};}function saveUpdates(_0x4790e2,_0x57bcee){return function(_0x2ccefc){if(_0x2ccefc){return _0x2ccefc[_0x4f7e('0x20')](_0x4790e2)[_0x4f7e('0x21')](function(_0x20c546){return _0x20c546;});}return null;};}function removeEntity(_0x4987ef,_0x39166a){return function(_0xc47424){if(_0xc47424){return _0xc47424['destroy']()[_0x4f7e('0x21')](function(){_0x4987ef[_0x4f7e('0x16')](0xcc)[_0x4f7e('0x17')]();});}};}function handleEntityNotFound(_0x3264af,_0x5a72da){return function(_0x114cd4){if(!_0x114cd4){_0x3264af[_0x4f7e('0x22')](0x194);}return _0x114cd4;};}function handleError(_0x3d5ca6,_0x4652f8){_0x4652f8=_0x4652f8||0x1f4;return function(_0x1ada0f){logger[_0x4f7e('0x23')](_0x1ada0f[_0x4f7e('0x24')]);if(_0x1ada0f['name']){delete _0x1ada0f[_0x4f7e('0x25')];}_0x3d5ca6['status'](_0x4652f8)[_0x4f7e('0x26')](_0x1ada0f);};}exports[_0x4f7e('0x27')]=function(_0x23d162,_0x3954e8){var _0x22f279={},_0x432f79={},_0x1c820f={'count':0x0,'rows':[]};var _0x20e47b=_[_0x4f7e('0x28')](db['DeskAccount'][_0x4f7e('0x29')],function(_0xe154dc){return{'name':_0xe154dc[_0x4f7e('0x2a')],'type':_0xe154dc['type'][_0x4f7e('0x2b')]};});_0x432f79[_0x4f7e('0x2c')]=_[_0x4f7e('0x28')](_0x20e47b,_0x4f7e('0x25'));_0x432f79[_0x4f7e('0x2d')]=_[_0x4f7e('0x2e')](_0x23d162[_0x4f7e('0x2d')]);_0x432f79['filters']=_[_0x4f7e('0x2f')](_0x432f79[_0x4f7e('0x2c')],_0x432f79[_0x4f7e('0x2d')]);_0x22f279[_0x4f7e('0x30')]=_['intersection'](_0x432f79[_0x4f7e('0x2c')],qs[_0x4f7e('0x31')](_0x23d162[_0x4f7e('0x2d')][_0x4f7e('0x31')]));_0x22f279[_0x4f7e('0x30')]=_0x22f279[_0x4f7e('0x30')][_0x4f7e('0x32')]?_0x22f279[_0x4f7e('0x30')]:_0x432f79[_0x4f7e('0x2c')];if(!_0x23d162[_0x4f7e('0x2d')]['hasOwnProperty'](_0x4f7e('0x33'))){_0x22f279[_0x4f7e('0x18')]=qs[_0x4f7e('0x18')](_0x23d162[_0x4f7e('0x2d')][_0x4f7e('0x18')]);_0x22f279['offset']=qs[_0x4f7e('0x1b')](_0x23d162[_0x4f7e('0x2d')][_0x4f7e('0x1b')]);}_0x22f279['order']=qs['sort'](_0x23d162['query'][_0x4f7e('0x34')]);_0x22f279[_0x4f7e('0x35')]=qs['filters'](_[_0x4f7e('0x36')](_0x23d162[_0x4f7e('0x2d')],_0x432f79['filters']),_0x20e47b);if(_0x23d162['query'][_0x4f7e('0x37')]){_0x22f279['where']=_['merge'](_0x22f279[_0x4f7e('0x35')],{'$or':_['map'](_0x20e47b,function(_0x2b05b4){if(_0x2b05b4[_0x4f7e('0x38')]!==_0x4f7e('0x39')){var _0x5d9eb4={};_0x5d9eb4[_0x2b05b4[_0x4f7e('0x25')]]={'$like':'%'+_0x23d162[_0x4f7e('0x2d')][_0x4f7e('0x37')]+'%'};return _0x5d9eb4;}})});}_0x22f279=_[_0x4f7e('0x3a')]({},_0x22f279,_0x23d162[_0x4f7e('0x3b')]);var _0x1b066b={'where':_0x22f279[_0x4f7e('0x35')]};return db['DeskAccount'][_0x4f7e('0x1a')](_0x1b066b)[_0x4f7e('0x21')](function(_0x25c60e){_0x1c820f[_0x4f7e('0x1a')]=_0x25c60e;if(_0x23d162[_0x4f7e('0x2d')][_0x4f7e('0x3c')]){_0x22f279['include']=[{'all':!![]}];}return db[_0x4f7e('0x3d')][_0x4f7e('0x3e')](_0x22f279);})['then'](function(_0x1816cd){_0x1c820f[_0x4f7e('0x3f')]=_0x1816cd;return _0x1c820f;})[_0x4f7e('0x21')](respondWithFilteredResult(_0x3954e8,_0x22f279))[_0x4f7e('0x40')](handleError(_0x3954e8,null));};exports[_0x4f7e('0x41')]=function(_0x3c835c,_0x4d8cce){var _0x1869ef={'raw':![],'where':{'id':_0x3c835c[_0x4f7e('0x42')]['id']}},_0x228872={};_0x228872[_0x4f7e('0x2c')]=_['keys'](db[_0x4f7e('0x3d')]['rawAttributes']);_0x228872[_0x4f7e('0x2d')]=_[_0x4f7e('0x2e')](_0x3c835c[_0x4f7e('0x2d')]);_0x228872[_0x4f7e('0x43')]=_[_0x4f7e('0x2f')](_0x228872[_0x4f7e('0x2c')],_0x228872[_0x4f7e('0x2d')]);_0x1869ef[_0x4f7e('0x30')]=_[_0x4f7e('0x2f')](_0x228872['model'],qs['fields'](_0x3c835c[_0x4f7e('0x2d')][_0x4f7e('0x31')]));_0x1869ef['attributes']=_0x1869ef[_0x4f7e('0x30')][_0x4f7e('0x32')]?_0x1869ef[_0x4f7e('0x30')]:_0x228872[_0x4f7e('0x2c')];if(_0x3c835c[_0x4f7e('0x2d')][_0x4f7e('0x3c')]){_0x1869ef[_0x4f7e('0x44')]=[{'all':!![]}];}_0x1869ef=_[_0x4f7e('0x3a')]({},_0x1869ef,_0x3c835c['options']);return db[_0x4f7e('0x3d')][_0x4f7e('0x45')](_0x1869ef)[_0x4f7e('0x21')](handleEntityNotFound(_0x4d8cce,null))['then'](respondWithResult(_0x4d8cce,null))['catch'](handleError(_0x4d8cce,null));};exports[_0x4f7e('0x46')]=function(_0x362c9c,_0x516ffb){return db['DeskAccount'][_0x4f7e('0x46')](_0x362c9c[_0x4f7e('0x47')],{})['then'](respondWithResult(_0x516ffb,0xc9))['catch'](handleError(_0x516ffb,null));};exports[_0x4f7e('0x20')]=function(_0x56d3b3,_0x2701d1){if(_0x56d3b3[_0x4f7e('0x47')]['id']){delete _0x56d3b3['body']['id'];}return db[_0x4f7e('0x3d')][_0x4f7e('0x45')]({'where':{'id':_0x56d3b3[_0x4f7e('0x42')]['id']}})['then'](handleEntityNotFound(_0x2701d1,null))[_0x4f7e('0x21')](saveUpdates(_0x56d3b3[_0x4f7e('0x47')],null))[_0x4f7e('0x21')](respondWithResult(_0x2701d1,null))[_0x4f7e('0x40')](handleError(_0x2701d1,null));};exports[_0x4f7e('0x48')]=function(_0x740fe0,_0x1f270e){return db[_0x4f7e('0x3d')][_0x4f7e('0x45')]({'where':{'id':_0x740fe0[_0x4f7e('0x42')]['id']}})[_0x4f7e('0x21')](handleEntityNotFound(_0x1f270e,null))[_0x4f7e('0x21')](removeEntity(_0x1f270e,null))[_0x4f7e('0x40')](handleError(_0x1f270e,null));};exports[_0x4f7e('0x49')]=function(_0x426a2a,_0x33eecc,_0x3ac405){var _0x2923e6={};var _0x1f5a0a={};var _0x15b327;var _0x13cebc;return db[_0x4f7e('0x3d')]['findOne']({'where':{'id':_0x426a2a['params']['id']}})['then'](handleEntityNotFound(_0x33eecc,null))[_0x4f7e('0x21')](function(_0x959745){if(_0x959745){_0x15b327=_0x959745;_0x1f5a0a[_0x4f7e('0x2c')]=_['keys'](db[_0x4f7e('0x4a')][_0x4f7e('0x29')]);_0x1f5a0a['query']=_[_0x4f7e('0x2e')](_0x426a2a['query']);_0x1f5a0a[_0x4f7e('0x43')]=_[_0x4f7e('0x2f')](_0x1f5a0a[_0x4f7e('0x2c')],_0x1f5a0a['query']);_0x2923e6[_0x4f7e('0x30')]=_[_0x4f7e('0x2f')](_0x1f5a0a['model'],qs[_0x4f7e('0x31')](_0x426a2a[_0x4f7e('0x2d')][_0x4f7e('0x31')]));_0x2923e6[_0x4f7e('0x30')]=_0x2923e6['attributes'][_0x4f7e('0x32')]?_0x2923e6['attributes']:_0x1f5a0a['model'];_0x2923e6[_0x4f7e('0x4b')]=qs[_0x4f7e('0x34')](_0x426a2a[_0x4f7e('0x2d')][_0x4f7e('0x34')]);_0x2923e6[_0x4f7e('0x35')]=qs[_0x4f7e('0x43')](_[_0x4f7e('0x36')](_0x426a2a[_0x4f7e('0x2d')],_0x1f5a0a[_0x4f7e('0x43')]));if(_0x426a2a[_0x4f7e('0x2d')][_0x4f7e('0x37')]){_0x2923e6[_0x4f7e('0x35')]=_[_0x4f7e('0x3a')](_0x2923e6['where'],{'$or':_['map'](_0x2923e6['attributes'],function(_0x43dd89){var _0x2630eb={};_0x2630eb[_0x43dd89]={'$like':'%'+_0x426a2a[_0x4f7e('0x2d')]['filter']+'%'};return _0x2630eb;})});}_0x2923e6=_[_0x4f7e('0x3a')]({},_0x2923e6,_0x426a2a[_0x4f7e('0x3b')]);return _0x15b327['getConfigurations'](_0x2923e6);}})[_0x4f7e('0x21')](function(_0x1203e7){if(_0x1203e7){_0x13cebc=_0x1203e7[_0x4f7e('0x32')];if(!_0x426a2a[_0x4f7e('0x2d')][_0x4f7e('0x4c')](_0x4f7e('0x33'))){_0x2923e6[_0x4f7e('0x18')]=qs[_0x4f7e('0x18')](_0x426a2a[_0x4f7e('0x2d')][_0x4f7e('0x18')]);_0x2923e6[_0x4f7e('0x1b')]=qs[_0x4f7e('0x1b')](_0x426a2a[_0x4f7e('0x2d')]['offset']);}return _0x15b327[_0x4f7e('0x49')](_0x2923e6);}})['then'](function(_0x44b085){if(_0x44b085){return _0x44b085?{'count':_0x13cebc,'rows':_0x44b085}:null;}})[_0x4f7e('0x21')](respondWithResult(_0x33eecc,null))['catch'](handleError(_0x33eecc,null));};exports[_0x4f7e('0x4d')]=function(_0x322c99,_0x1044f6,_0x194391){if(_0x322c99['body']['id']){delete _0x322c99[_0x4f7e('0x47')]['id'];}return db[_0x4f7e('0x3d')]['findOne']({'where':{'id':_0x322c99['params']['id']}})[_0x4f7e('0x21')](handleEntityNotFound(_0x1044f6,null))[_0x4f7e('0x21')](function(_0xf89dc0){if(_0xf89dc0){_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x4e')]=_0xf89dc0['id'];_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x4f')]=integrations[_0x4f7e('0x50')](_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x51')],_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x38')]);_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x52')]=integrations[_0x4f7e('0x53')](_0x322c99[_0x4f7e('0x47')][_0x4f7e('0x51')],_0x322c99[_0x4f7e('0x47')]['type']);return db[_0x4f7e('0x4a')][_0x4f7e('0x46')](_0x322c99[_0x4f7e('0x47')],{'include':[{'model':db[_0x4f7e('0x54')],'as':_0x4f7e('0x4f')},{'model':db['DeskField'],'as':_0x4f7e('0x52')}]});}return null;})[_0x4f7e('0x21')](respondWithResult(_0x1044f6,null))[_0x4f7e('0x40')](handleError(_0x1044f6,null));};exports[_0x4f7e('0x55')]=function(_0x2325b6,_0x253c81,_0x519463){var _0x570285=[{'name':_0x4f7e('0x56'),'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 _0x539564='';return db[_0x4f7e('0x3d')][_0x4f7e('0x57')]({'where':{'id':_0x2325b6['params']['id']},'attributes':['id',_0x4f7e('0x58'),_0x4f7e('0x59'),_0x4f7e('0x5a'),_0x4f7e('0x5b'),'consumerKey',_0x4f7e('0x5c'),_0x4f7e('0x5d'),_0x4f7e('0x5e')]})[_0x4f7e('0x21')](handleEntityNotFound(_0x253c81,null))['then'](function(_0x1f77de){if(_0x1f77de){_0x539564=_0x1f77de[_0x4f7e('0x58')];var _0x744c42=_0x539564['slice'](-0x1);if(_0x744c42==='/'){_0x539564=_0x539564[_0x4f7e('0x5f')](0x0,_0x539564[_0x4f7e('0x60')](_0x744c42));}var _0x300588={'method':_0x4f7e('0x61'),'uri':util[_0x4f7e('0x62')](_0x4f7e('0x63'),_0x539564),'headers':{'Content-Type':_0x4f7e('0x64'),'Accept':_0x4f7e('0x64')},'json':!![]};if(_0x1f77de[_0x4f7e('0x59')]===_0x4f7e('0x65')){_0x300588['headers'][_0x4f7e('0x66')]=util[_0x4f7e('0x62')](_0x4f7e('0x67'),new Buffer(util[_0x4f7e('0x62')](_0x4f7e('0x68'),_0x1f77de[_0x4f7e('0x5a')],_0x1f77de[_0x4f7e('0x5b')]))[_0x4f7e('0x69')]('base64'));}return rp(_0x300588)['then'](function(_0x1dcc21){return _0x570285['concat'](_[_0x4f7e('0x28')](_0x1dcc21[_0x4f7e('0x6a')][_0x4f7e('0x6b')],function(_0x2d2f66){return{'id':_0x2d2f66['name'],'name':_0x2d2f66[_0x4f7e('0x25')],'type':_0x2d2f66[_0x4f7e('0x38')],'active':_0x2d2f66['active'],'label':_0x2d2f66[_0x4f7e('0x6c')],'custom':!![]};}));});}})[_0x4f7e('0x21')](function(_0x58229e){return{'count':_0x58229e[_0x4f7e('0x32')],'rows':_0x58229e};})[_0x4f7e('0x21')](respondWithResult(_0x253c81,null))[_0x4f7e('0x40')](function(_0x3d4883){var _0x3901f2=_0x2325b6[_0x4f7e('0x2d')][_0x4f7e('0x6d')]?0x1f4:_0x3d4883[_0x4f7e('0x6e')]||0x1f4;logger[_0x4f7e('0x23')](_0x4f7e('0x6f'),_0x4f7e('0x55'),_0x3901f2,JSON['stringify'](_0x3d4883));delete _0x3d4883['name'];if(_0x3901f2===0x191){_0x3901f2=0x190;}_0x253c81[_0x4f7e('0x16')](_0x3901f2)['send'](_0x2325b6[_0x4f7e('0x2d')][_0x4f7e('0x6d')]?{'message':'Wrong\x20credentials','statusCode':_0x3d4883[_0x4f7e('0x6e')]}:_0x3d4883);});}; \ No newline at end of file +var _0xa6cf=['api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','name','send','index','map','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','type','VIRTUAL','filter','options','DeskAccount','includeAll','findAll','rows','keys','include','find','create','body','params','catch','getConfigurations','findOne','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','DeskConfiguration','DeskField','priority','remoteUri','username','consumerKey','token','tokenSecret','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','authType','basic','headers','Authorization','Basic\x20%s','%s:%s','password','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0xa6cf,0x1b7));var _0xfa6c=function(_0x138566,_0x5d9f96){_0x138566=_0x138566-0x0;var _0x3310c1=_0xa6cf[_0x138566];return _0x3310c1;};'use strict';var emlformat=require(_0xfa6c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfa6c('0x1'));var rp=require(_0xfa6c('0x2'));var moment=require(_0xfa6c('0x3'));var BPromise=require(_0xfa6c('0x4'));var Mustache=require('mustache');var util=require(_0xfa6c('0x5'));var path=require(_0xfa6c('0x6'));var sox=require('sox');var csv=require(_0xfa6c('0x7'));var ejs=require(_0xfa6c('0x8'));var fs=require('fs');var fs_extra=require(_0xfa6c('0x9'));var _=require(_0xfa6c('0xa'));var squel=require(_0xfa6c('0xb'));var crypto=require(_0xfa6c('0xc'));var jsforce=require(_0xfa6c('0xd'));var deskjs=require(_0xfa6c('0xe'));var toCsv=require(_0xfa6c('0x7'));var querystring=require(_0xfa6c('0xf'));var Papa=require(_0xfa6c('0x10'));var Redis=require(_0xfa6c('0x11'));var authService=require(_0xfa6c('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfa6c('0x13'));var logger=require(_0xfa6c('0x14'))(_0xfa6c('0x15'));var utils=require('../../config/utils');var config=require(_0xfa6c('0x16'));var licenseUtil=require(_0xfa6c('0x17'));var db=require(_0xfa6c('0x18'))['db'];var integrations=require(_0xfa6c('0x19'));function respondWithStatusCode(_0x1e5cf5,_0x6e52b3){_0x6e52b3=_0x6e52b3||0xcc;return function(_0x4b5e4e){if(_0x4b5e4e){return _0x1e5cf5['sendStatus'](_0x6e52b3);}return _0x1e5cf5[_0xfa6c('0x1a')](_0x6e52b3)['end']();};}function respondWithResult(_0x281a7b,_0x11c958){_0x11c958=_0x11c958||0xc8;return function(_0x55d530){if(_0x55d530){return _0x281a7b[_0xfa6c('0x1a')](_0x11c958)[_0xfa6c('0x1b')](_0x55d530);}};}function respondWithFilteredResult(_0x268993,_0x225a3e){return function(_0x487e44){if(_0x487e44){var _0x50e737=typeof _0x225a3e[_0xfa6c('0x1c')]===_0xfa6c('0x1d')&&typeof _0x225a3e['limit']==='undefined';var _0x58cc80=_0x487e44[_0xfa6c('0x1e')];var _0x49def1=_0x50e737?0x0:_0x225a3e[_0xfa6c('0x1c')];var _0x14a810=_0x50e737?_0x487e44[_0xfa6c('0x1e')]:_0x225a3e[_0xfa6c('0x1c')]+_0x225a3e[_0xfa6c('0x1f')];var _0x41df49;if(_0x14a810>=_0x58cc80){_0x14a810=_0x58cc80;_0x41df49=0xc8;}else{_0x41df49=0xce;}_0x268993['status'](_0x41df49);return _0x268993[_0xfa6c('0x20')](_0xfa6c('0x21'),_0x49def1+'-'+_0x14a810+'/'+_0x58cc80)[_0xfa6c('0x1b')](_0x487e44);}return null;};}function patchUpdates(_0x1e2a66){return function(_0xe457d0){try{jsonpatch[_0xfa6c('0x22')](_0xe457d0,_0x1e2a66,!![]);}catch(_0x27859f){return BPromise[_0xfa6c('0x23')](_0x27859f);}return _0xe457d0[_0xfa6c('0x24')]();};}function saveUpdates(_0x1bcaa3,_0x3f2deb){return function(_0x3d4597){if(_0x3d4597){return _0x3d4597[_0xfa6c('0x25')](_0x1bcaa3)[_0xfa6c('0x26')](function(_0x3ee0ad){return _0x3ee0ad;});}return null;};}function removeEntity(_0x760ecb,_0x1b70cb){return function(_0x4a902c){if(_0x4a902c){return _0x4a902c[_0xfa6c('0x27')]()[_0xfa6c('0x26')](function(){_0x760ecb[_0xfa6c('0x1a')](0xcc)[_0xfa6c('0x28')]();});}};}function handleEntityNotFound(_0x1d57b5,_0x18f0b6){return function(_0x1c3066){if(!_0x1c3066){_0x1d57b5[_0xfa6c('0x29')](0x194);}return _0x1c3066;};}function handleError(_0x1bb9e1,_0x104db4){_0x104db4=_0x104db4||0x1f4;return function(_0x24fc5a){logger[_0xfa6c('0x2a')](_0x24fc5a['stack']);if(_0x24fc5a[_0xfa6c('0x2b')]){delete _0x24fc5a['name'];}_0x1bb9e1[_0xfa6c('0x1a')](_0x104db4)[_0xfa6c('0x2c')](_0x24fc5a);};}exports[_0xfa6c('0x2d')]=function(_0xfd1ce9,_0x326f73){var _0x2a8921={},_0x28875d={},_0x460130={'count':0x0,'rows':[]};var _0x446c00=_[_0xfa6c('0x2e')](db['DeskAccount'][_0xfa6c('0x2f')],function(_0x296654){return{'name':_0x296654['fieldName'],'type':_0x296654['type']['key']};});_0x28875d[_0xfa6c('0x30')]=_[_0xfa6c('0x2e')](_0x446c00,'name');_0x28875d[_0xfa6c('0x31')]=_['keys'](_0xfd1ce9[_0xfa6c('0x31')]);_0x28875d['filters']=_[_0xfa6c('0x32')](_0x28875d[_0xfa6c('0x30')],_0x28875d[_0xfa6c('0x31')]);_0x2a8921[_0xfa6c('0x33')]=_[_0xfa6c('0x32')](_0x28875d[_0xfa6c('0x30')],qs[_0xfa6c('0x34')](_0xfd1ce9[_0xfa6c('0x31')][_0xfa6c('0x34')]));_0x2a8921[_0xfa6c('0x33')]=_0x2a8921[_0xfa6c('0x33')][_0xfa6c('0x35')]?_0x2a8921[_0xfa6c('0x33')]:_0x28875d[_0xfa6c('0x30')];if(!_0xfd1ce9['query'][_0xfa6c('0x36')]('nolimit')){_0x2a8921['limit']=qs['limit'](_0xfd1ce9[_0xfa6c('0x31')]['limit']);_0x2a8921[_0xfa6c('0x1c')]=qs['offset'](_0xfd1ce9['query'][_0xfa6c('0x1c')]);}_0x2a8921[_0xfa6c('0x37')]=qs['sort'](_0xfd1ce9[_0xfa6c('0x31')][_0xfa6c('0x38')]);_0x2a8921['where']=qs[_0xfa6c('0x39')](_[_0xfa6c('0x3a')](_0xfd1ce9[_0xfa6c('0x31')],_0x28875d['filters']),_0x446c00);if(_0xfd1ce9[_0xfa6c('0x31')]['filter']){_0x2a8921[_0xfa6c('0x3b')]=_[_0xfa6c('0x3c')](_0x2a8921[_0xfa6c('0x3b')],{'$or':_[_0xfa6c('0x2e')](_0x446c00,function(_0x39ea49){if(_0x39ea49[_0xfa6c('0x3d')]!==_0xfa6c('0x3e')){var _0x28d4c4={};_0x28d4c4[_0x39ea49[_0xfa6c('0x2b')]]={'$like':'%'+_0xfd1ce9[_0xfa6c('0x31')][_0xfa6c('0x3f')]+'%'};return _0x28d4c4;}})});}_0x2a8921=_['merge']({},_0x2a8921,_0xfd1ce9[_0xfa6c('0x40')]);var _0x5a5fb1={'where':_0x2a8921[_0xfa6c('0x3b')]};return db[_0xfa6c('0x41')][_0xfa6c('0x1e')](_0x5a5fb1)['then'](function(_0x4b7ad7){_0x460130[_0xfa6c('0x1e')]=_0x4b7ad7;if(_0xfd1ce9['query'][_0xfa6c('0x42')]){_0x2a8921['include']=[{'all':!![]}];}return db[_0xfa6c('0x41')][_0xfa6c('0x43')](_0x2a8921);})[_0xfa6c('0x26')](function(_0x17bc76){_0x460130[_0xfa6c('0x44')]=_0x17bc76;return _0x460130;})['then'](respondWithFilteredResult(_0x326f73,_0x2a8921))['catch'](handleError(_0x326f73,null));};exports['show']=function(_0x28ced8,_0xb97e6a){var _0x5cb4fb={'raw':![],'where':{'id':_0x28ced8['params']['id']}},_0x420eb5={};_0x420eb5[_0xfa6c('0x30')]=_[_0xfa6c('0x45')](db[_0xfa6c('0x41')][_0xfa6c('0x2f')]);_0x420eb5[_0xfa6c('0x31')]=_[_0xfa6c('0x45')](_0x28ced8[_0xfa6c('0x31')]);_0x420eb5[_0xfa6c('0x39')]=_[_0xfa6c('0x32')](_0x420eb5[_0xfa6c('0x30')],_0x420eb5[_0xfa6c('0x31')]);_0x5cb4fb[_0xfa6c('0x33')]=_[_0xfa6c('0x32')](_0x420eb5[_0xfa6c('0x30')],qs['fields'](_0x28ced8[_0xfa6c('0x31')]['fields']));_0x5cb4fb['attributes']=_0x5cb4fb[_0xfa6c('0x33')][_0xfa6c('0x35')]?_0x5cb4fb[_0xfa6c('0x33')]:_0x420eb5[_0xfa6c('0x30')];if(_0x28ced8[_0xfa6c('0x31')]['includeAll']){_0x5cb4fb[_0xfa6c('0x46')]=[{'all':!![]}];}_0x5cb4fb=_[_0xfa6c('0x3c')]({},_0x5cb4fb,_0x28ced8[_0xfa6c('0x40')]);return db[_0xfa6c('0x41')][_0xfa6c('0x47')](_0x5cb4fb)[_0xfa6c('0x26')](handleEntityNotFound(_0xb97e6a,null))[_0xfa6c('0x26')](respondWithResult(_0xb97e6a,null))['catch'](handleError(_0xb97e6a,null));};exports[_0xfa6c('0x48')]=function(_0x2d2041,_0x43bc3a){return db[_0xfa6c('0x41')]['create'](_0x2d2041[_0xfa6c('0x49')],{})['then'](respondWithResult(_0x43bc3a,0xc9))['catch'](handleError(_0x43bc3a,null));};exports[_0xfa6c('0x25')]=function(_0x4f43c8,_0x4337e7){if(_0x4f43c8[_0xfa6c('0x49')]['id']){delete _0x4f43c8['body']['id'];}return db[_0xfa6c('0x41')][_0xfa6c('0x47')]({'where':{'id':_0x4f43c8[_0xfa6c('0x4a')]['id']}})[_0xfa6c('0x26')](handleEntityNotFound(_0x4337e7,null))[_0xfa6c('0x26')](saveUpdates(_0x4f43c8[_0xfa6c('0x49')],null))['then'](respondWithResult(_0x4337e7,null))[_0xfa6c('0x4b')](handleError(_0x4337e7,null));};exports[_0xfa6c('0x27')]=function(_0x5f4d78,_0x4702fe){return db[_0xfa6c('0x41')]['find']({'where':{'id':_0x5f4d78[_0xfa6c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4702fe,null))[_0xfa6c('0x26')](removeEntity(_0x4702fe,null))['catch'](handleError(_0x4702fe,null));};exports[_0xfa6c('0x4c')]=function(_0x2c900b,_0x462d95,_0x56cc19){var _0x3d1406={};var _0x5dcf73={};var _0x2b61b5;var _0x423a05;return db['DeskAccount'][_0xfa6c('0x4d')]({'where':{'id':_0x2c900b[_0xfa6c('0x4a')]['id']}})[_0xfa6c('0x26')](handleEntityNotFound(_0x462d95,null))[_0xfa6c('0x26')](function(_0x22ef39){if(_0x22ef39){_0x2b61b5=_0x22ef39;_0x5dcf73['model']=_[_0xfa6c('0x45')](db['DeskConfiguration'][_0xfa6c('0x2f')]);_0x5dcf73[_0xfa6c('0x31')]=_[_0xfa6c('0x45')](_0x2c900b[_0xfa6c('0x31')]);_0x5dcf73['filters']=_[_0xfa6c('0x32')](_0x5dcf73['model'],_0x5dcf73[_0xfa6c('0x31')]);_0x3d1406['attributes']=_[_0xfa6c('0x32')](_0x5dcf73[_0xfa6c('0x30')],qs[_0xfa6c('0x34')](_0x2c900b['query'][_0xfa6c('0x34')]));_0x3d1406['attributes']=_0x3d1406[_0xfa6c('0x33')][_0xfa6c('0x35')]?_0x3d1406['attributes']:_0x5dcf73[_0xfa6c('0x30')];_0x3d1406['order']=qs['sort'](_0x2c900b[_0xfa6c('0x31')]['sort']);_0x3d1406[_0xfa6c('0x3b')]=qs['filters'](_[_0xfa6c('0x3a')](_0x2c900b['query'],_0x5dcf73['filters']));if(_0x2c900b[_0xfa6c('0x31')][_0xfa6c('0x3f')]){_0x3d1406['where']=_['merge'](_0x3d1406['where'],{'$or':_[_0xfa6c('0x2e')](_0x3d1406[_0xfa6c('0x33')],function(_0x5eaf86){var _0x3bdf2f={};_0x3bdf2f[_0x5eaf86]={'$like':'%'+_0x2c900b[_0xfa6c('0x31')][_0xfa6c('0x3f')]+'%'};return _0x3bdf2f;})});}_0x3d1406=_[_0xfa6c('0x3c')]({},_0x3d1406,_0x2c900b[_0xfa6c('0x40')]);return _0x2b61b5['getConfigurations'](_0x3d1406);}})[_0xfa6c('0x26')](function(_0xfaf08){if(_0xfaf08){_0x423a05=_0xfaf08['length'];if(!_0x2c900b[_0xfa6c('0x31')][_0xfa6c('0x36')](_0xfa6c('0x4e'))){_0x3d1406[_0xfa6c('0x1f')]=qs[_0xfa6c('0x1f')](_0x2c900b[_0xfa6c('0x31')][_0xfa6c('0x1f')]);_0x3d1406[_0xfa6c('0x1c')]=qs[_0xfa6c('0x1c')](_0x2c900b['query'][_0xfa6c('0x1c')]);}return _0x2b61b5['getConfigurations'](_0x3d1406);}})[_0xfa6c('0x26')](function(_0x4cc633){if(_0x4cc633){return _0x4cc633?{'count':_0x423a05,'rows':_0x4cc633}:null;}})['then'](respondWithResult(_0x462d95,null))[_0xfa6c('0x4b')](handleError(_0x462d95,null));};exports[_0xfa6c('0x4f')]=function(_0x307058,_0x3b16ad,_0x44c604){if(_0x307058[_0xfa6c('0x49')]['id']){delete _0x307058[_0xfa6c('0x49')]['id'];}return db['DeskAccount'][_0xfa6c('0x4d')]({'where':{'id':_0x307058[_0xfa6c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3b16ad,null))['then'](function(_0x60a1d9){if(_0x60a1d9){_0x307058['body'][_0xfa6c('0x50')]=_0x60a1d9['id'];_0x307058[_0xfa6c('0x49')][_0xfa6c('0x51')]=integrations['getSubjects'](_0x307058[_0xfa6c('0x49')]['channel'],_0x307058['body']['type']);_0x307058[_0xfa6c('0x49')][_0xfa6c('0x52')]=integrations['getDescriptions'](_0x307058[_0xfa6c('0x49')][_0xfa6c('0x53')],_0x307058[_0xfa6c('0x49')][_0xfa6c('0x3d')]);return db[_0xfa6c('0x54')][_0xfa6c('0x48')](_0x307058[_0xfa6c('0x49')],{'include':[{'model':db[_0xfa6c('0x55')],'as':_0xfa6c('0x51')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})[_0xfa6c('0x26')](respondWithResult(_0x3b16ad,null))['catch'](handleError(_0x3b16ad,null));};exports['getFields']=function(_0x3959b6,_0xf14b57,_0x2aa3d8){var _0x39e370=[{'name':'priority','label':_0xfa6c('0x56'),'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 _0x52c452='';return db[_0xfa6c('0x41')][_0xfa6c('0x4d')]({'where':{'id':_0x3959b6['params']['id']},'attributes':['id',_0xfa6c('0x57'),'authType',_0xfa6c('0x58'),'password',_0xfa6c('0x59'),'consumerSecret',_0xfa6c('0x5a'),_0xfa6c('0x5b')]})[_0xfa6c('0x26')](handleEntityNotFound(_0xf14b57,null))[_0xfa6c('0x26')](function(_0x9cb75){if(_0x9cb75){_0x52c452=_0x9cb75[_0xfa6c('0x57')];var _0x439d88=_0x52c452['slice'](-0x1);if(_0x439d88==='/'){_0x52c452=_0x52c452[_0xfa6c('0x5c')](0x0,_0x52c452[_0xfa6c('0x5d')](_0x439d88));}var _0x396e3a={'method':_0xfa6c('0x5e'),'uri':util[_0xfa6c('0x5f')](_0xfa6c('0x60'),_0x52c452),'headers':{'Content-Type':_0xfa6c('0x61'),'Accept':'application/json'},'json':!![]};if(_0x9cb75[_0xfa6c('0x62')]===_0xfa6c('0x63')){_0x396e3a[_0xfa6c('0x64')][_0xfa6c('0x65')]=util[_0xfa6c('0x5f')](_0xfa6c('0x66'),new Buffer(util['format'](_0xfa6c('0x67'),_0x9cb75[_0xfa6c('0x58')],_0x9cb75[_0xfa6c('0x68')]))[_0xfa6c('0x69')](_0xfa6c('0x6a')));}return rp(_0x396e3a)[_0xfa6c('0x26')](function(_0x103b7c){return _0x39e370['concat'](_['map'](_0x103b7c[_0xfa6c('0x6b')][_0xfa6c('0x6c')],function(_0x5a600c){return{'id':_0x5a600c[_0xfa6c('0x2b')],'name':_0x5a600c[_0xfa6c('0x2b')],'type':_0x5a600c['type'],'active':_0x5a600c[_0xfa6c('0x6d')],'label':_0x5a600c[_0xfa6c('0x6e')],'custom':!![]};}));});}})[_0xfa6c('0x26')](function(_0x2c5061){return{'count':_0x2c5061[_0xfa6c('0x35')],'rows':_0x2c5061};})[_0xfa6c('0x26')](respondWithResult(_0xf14b57,null))[_0xfa6c('0x4b')](function(_0x26aeba){var _0x3bb02e=_0x3959b6[_0xfa6c('0x31')]['test']?0x1f4:_0x26aeba['statusCode']||0x1f4;logger['error'](_0xfa6c('0x6f'),'getFields',_0x3bb02e,JSON[_0xfa6c('0x70')](_0x26aeba));delete _0x26aeba[_0xfa6c('0x2b')];if(_0x3bb02e===0x191){_0x3bb02e=0x190;}_0xf14b57[_0xfa6c('0x1a')](_0x3bb02e)[_0xfa6c('0x2c')](_0x3959b6['query'][_0xfa6c('0x71')]?{'message':_0xfa6c('0x72'),'statusCode':_0x26aeba['statusCode']}:_0x26aeba);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 15db666..ea6bf24 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 _0xc07e=['bluebird','request-promise','../../config/environment','./intDeskAccount.attributes','exports','define','DeskAccount','int_desk_accounts','lodash','../../config/logger','moment'];(function(_0x25c3c1,_0x2c1d84){var _0x2a5b60=function(_0x3d15b4){while(--_0x3d15b4){_0x25c3c1['push'](_0x25c3c1['shift']());}};_0x2a5b60(++_0x2c1d84);}(_0xc07e,0xd9));var _0xec07=function(_0x4a03b6,_0x4aac1a){_0x4a03b6=_0x4a03b6-0x0;var _0x407daf=_0xc07e[_0x4a03b6];return _0x407daf;};'use strict';var _=require(_0xec07('0x0'));var util=require('util');var logger=require(_0xec07('0x1'))('api');var moment=require(_0xec07('0x2'));var BPromise=require(_0xec07('0x3'));var rp=require(_0xec07('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xec07('0x5'));var attributes=require(_0xec07('0x6'));var integrations=require('../../components/integrations/configuration');module[_0xec07('0x7')]=function(_0x58e889,_0xcdc3b0){return _0x58e889[_0xec07('0x8')](_0xec07('0x9'),attributes,{'tableName':_0xec07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e09=['bluebird','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0xd6e388,_0x3495ab){var _0xef7093=function(_0x52110a){while(--_0x52110a){_0xd6e388['push'](_0xd6e388['shift']());}};_0xef7093(++_0x3495ab);}(_0x8e09,0xfa));var _0x98e0=function(_0x1c289a,_0x277fe7){_0x1c289a=_0x1c289a-0x0;var _0x28d68e=_0x8e09[_0x1c289a];return _0x28d68e;};'use strict';var _=require(_0x98e0('0x0'));var util=require(_0x98e0('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x98e0('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x98e0('0x3'));var config=require(_0x98e0('0x4'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0x98e0('0x5'));module[_0x98e0('0x6')]=function(_0x4bcdff,_0x2cf9b9){return _0x4bcdff[_0x98e0('0x7')]('DeskAccount',attributes,{'tableName':_0x98e0('0x8'),'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 60ac058..5971ff0 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 _0x54d1=['DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetDeskAccount','raw','options','where','attributes','include','map','model','ShowDeskAccount','find','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x4203fc,_0x5a5ff7){var _0x448ec2=function(_0xf29baf){while(--_0xf29baf){_0x4203fc['push'](_0x4203fc['shift']());}};_0x448ec2(++_0x5a5ff7);}(_0x54d1,0x1ef));var _0x154d=function(_0x266937,_0x146cb1){_0x266937=_0x266937-0x0;var _0x157fee=_0x54d1[_0x266937];return _0x157fee;};'use strict';var _=require(_0x154d('0x0'));var util=require('util');var moment=require(_0x154d('0x1'));var BPromise=require(_0x154d('0x2'));var rs=require(_0x154d('0x3'));var fs=require('fs');var Redis=require(_0x154d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x154d('0x5'));var logger=require(_0x154d('0x6'))(_0x154d('0x7'));var config=require(_0x154d('0x8'));var jayson=require(_0x154d('0x9'));var client=jayson[_0x154d('0xa')][_0x154d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18d35b,_0x31a761,_0xbe9431){return new BPromise(function(_0x1a6e17,_0x3a31f4){return client[_0x154d('0xc')](_0x18d35b,_0xbe9431)[_0x154d('0xd')](function(_0x13d68a){logger[_0x154d('0xe')](_0x154d('0xf'),_0x31a761,_0x154d('0x10'));logger[_0x154d('0x11')](_0x154d('0x12'),_0x31a761,_0x154d('0x10'),JSON[_0x154d('0x13')](_0x13d68a));if(_0x13d68a[_0x154d('0x14')]){if(_0x13d68a['error'][_0x154d('0x15')]===0x1f4){logger[_0x154d('0x14')](_0x154d('0xf'),_0x31a761,_0x13d68a['error'][_0x154d('0x16')]);return _0x3a31f4(_0x13d68a[_0x154d('0x14')][_0x154d('0x16')]);}logger['error'](_0x154d('0xf'),_0x31a761,_0x13d68a[_0x154d('0x14')][_0x154d('0x16')]);return _0x1a6e17(_0x13d68a[_0x154d('0x14')][_0x154d('0x16')]);}else{logger[_0x154d('0xe')](_0x154d('0xf'),_0x31a761,_0x154d('0x10'));_0x1a6e17(_0x13d68a['result'][_0x154d('0x16')]);}})['catch'](function(_0x643485){logger[_0x154d('0x14')](_0x154d('0xf'),_0x31a761,_0x643485);_0x3a31f4(_0x643485);});});}exports[_0x154d('0x17')]=function(_0x234af1){var _0x3b8d44=this;return new Promise(function(_0x12a2c4,_0x56c9f2){return db['DeskAccount']['findAll']({'raw':_0x234af1['options']?_0x234af1['options'][_0x154d('0x18')]===undefined?!![]:![]:!![],'where':_0x234af1[_0x154d('0x19')]?_0x234af1[_0x154d('0x19')][_0x154d('0x1a')]||null:null,'attributes':_0x234af1[_0x154d('0x19')]?_0x234af1[_0x154d('0x19')][_0x154d('0x1b')]||null:null,'limit':_0x234af1[_0x154d('0x19')]?_0x234af1[_0x154d('0x19')]['limit']||null:null,'include':_0x234af1['options']?_0x234af1[_0x154d('0x19')][_0x154d('0x1c')]?_[_0x154d('0x1d')](_0x234af1['options'][_0x154d('0x1c')],function(_0x11c1d9){return{'model':db[_0x11c1d9[_0x154d('0x1e')]],'as':_0x11c1d9['as'],'attributes':_0x11c1d9[_0x154d('0x1b')],'include':_0x11c1d9[_0x154d('0x1c')]?_[_0x154d('0x1d')](_0x11c1d9[_0x154d('0x1c')],function(_0x1641ef){return{'model':db[_0x1641ef[_0x154d('0x1e')]],'as':_0x1641ef['as'],'attributes':_0x1641ef[_0x154d('0x1b')],'include':_0x1641ef[_0x154d('0x1c')]?_['map'](_0x1641ef[_0x154d('0x1c')],function(_0x3a7315){return{'model':db[_0x3a7315[_0x154d('0x1e')]],'as':_0x3a7315['as'],'attributes':_0x3a7315['attributes']};}):[]};}):[]};}):[]:[]})[_0x154d('0xd')](function(_0x37451a){logger[_0x154d('0xe')]('GetDeskAccount',_0x234af1);logger[_0x154d('0x11')]('GetDeskAccount',_0x234af1,JSON[_0x154d('0x13')](_0x37451a));_0x12a2c4(_0x37451a);})['catch'](function(_0xd02e53){logger[_0x154d('0x14')](_0x154d('0x17'),_0xd02e53[_0x154d('0x16')],_0x234af1);_0x56c9f2(_0x3b8d44[_0x154d('0x14')](0x1f4,_0xd02e53[_0x154d('0x16')]));});});};exports[_0x154d('0x1f')]=function(_0x4ecf97){var _0x3e463c=this;return new Promise(function(_0x377409,_0x4d2516){return db['DeskAccount'][_0x154d('0x20')]({'raw':_0x4ecf97[_0x154d('0x19')]?_0x4ecf97['options'][_0x154d('0x18')]===undefined?!![]:![]:!![],'where':_0x4ecf97['options']?_0x4ecf97[_0x154d('0x19')][_0x154d('0x1a')]||null:null,'attributes':_0x4ecf97[_0x154d('0x19')]?_0x4ecf97[_0x154d('0x19')]['attributes']||null:null,'include':_0x4ecf97['options']?_0x4ecf97['options']['include']?_[_0x154d('0x1d')](_0x4ecf97[_0x154d('0x19')][_0x154d('0x1c')],function(_0x546637){return{'model':db[_0x546637[_0x154d('0x1e')]],'as':_0x546637['as'],'attributes':_0x546637['attributes'],'include':_0x546637['include']?_['map'](_0x546637[_0x154d('0x1c')],function(_0x149ec0){return{'model':db[_0x149ec0[_0x154d('0x1e')]],'as':_0x149ec0['as'],'attributes':_0x149ec0[_0x154d('0x1b')],'include':_0x149ec0['include']?_[_0x154d('0x1d')](_0x149ec0[_0x154d('0x1c')],function(_0x562b3e){return{'model':db[_0x562b3e[_0x154d('0x1e')]],'as':_0x562b3e['as'],'attributes':_0x562b3e[_0x154d('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x154d('0xd')](function(_0x3b4d2d){logger[_0x154d('0xe')]('ShowDeskAccount',_0x4ecf97);logger[_0x154d('0x11')]('ShowDeskAccount',_0x4ecf97,JSON[_0x154d('0x13')](_0x3b4d2d));_0x377409(_0x3b4d2d);})[_0x154d('0x21')](function(_0x2aa992){logger['error'](_0x154d('0x1f'),_0x2aa992['message'],_0x4ecf97);_0x4d2516(_0x3e463c[_0x154d('0x14')](0x1f4,_0x2aa992[_0x154d('0x16')]));});});}; \ No newline at end of file +var _0xc096=['model','attributes','GetDeskAccount','ShowDeskAccount','find','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/environment','jayson/promise','http','request','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','DeskAccount','findAll','options','raw','where','limit','include','map'];(function(_0x4544f6,_0x482881){var _0x36be63=function(_0x5cc8e4){while(--_0x5cc8e4){_0x4544f6['push'](_0x4544f6['shift']());}};_0x36be63(++_0x482881);}(_0xc096,0x1bf));var _0x6c09=function(_0x48c938,_0x14ac2c){_0x48c938=_0x48c938-0x0;var _0x5625b2=_0xc096[_0x48c938];return _0x5625b2;};'use strict';var _=require(_0x6c09('0x0'));var util=require(_0x6c09('0x1'));var moment=require(_0x6c09('0x2'));var BPromise=require(_0x6c09('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c09('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c09('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c09('0x6'));var jayson=require(_0x6c09('0x7'));var client=jayson['client'][_0x6c09('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5cda74,_0xc1a1a2,_0x58bf55){return new BPromise(function(_0x1bd962,_0xe4b3f4){return client[_0x6c09('0x9')](_0x5cda74,_0x58bf55)['then'](function(_0xd178e9){logger['info'](_0x6c09('0xa'),_0xc1a1a2,_0x6c09('0xb'));logger[_0x6c09('0xc')](_0x6c09('0xd'),_0xc1a1a2,_0x6c09('0xb'),JSON[_0x6c09('0xe')](_0xd178e9));if(_0xd178e9[_0x6c09('0xf')]){if(_0xd178e9[_0x6c09('0xf')][_0x6c09('0x10')]===0x1f4){logger[_0x6c09('0xf')](_0x6c09('0xa'),_0xc1a1a2,_0xd178e9[_0x6c09('0xf')][_0x6c09('0x11')]);return _0xe4b3f4(_0xd178e9[_0x6c09('0xf')][_0x6c09('0x11')]);}logger[_0x6c09('0xf')](_0x6c09('0xa'),_0xc1a1a2,_0xd178e9['error']['message']);return _0x1bd962(_0xd178e9[_0x6c09('0xf')][_0x6c09('0x11')]);}else{logger[_0x6c09('0x12')](_0x6c09('0xa'),_0xc1a1a2,'request\x20sent');_0x1bd962(_0xd178e9[_0x6c09('0x13')][_0x6c09('0x11')]);}})[_0x6c09('0x14')](function(_0x3ccc43){logger[_0x6c09('0xf')](_0x6c09('0xa'),_0xc1a1a2,_0x3ccc43);_0xe4b3f4(_0x3ccc43);});});}exports['GetDeskAccount']=function(_0xebad7c){var _0x352622=this;return new Promise(function(_0x5e4d68,_0x1de9da){return db[_0x6c09('0x15')][_0x6c09('0x16')]({'raw':_0xebad7c[_0x6c09('0x17')]?_0xebad7c['options'][_0x6c09('0x18')]===undefined?!![]:![]:!![],'where':_0xebad7c[_0x6c09('0x17')]?_0xebad7c[_0x6c09('0x17')][_0x6c09('0x19')]||null:null,'attributes':_0xebad7c['options']?_0xebad7c[_0x6c09('0x17')]['attributes']||null:null,'limit':_0xebad7c[_0x6c09('0x17')]?_0xebad7c['options'][_0x6c09('0x1a')]||null:null,'include':_0xebad7c['options']?_0xebad7c['options'][_0x6c09('0x1b')]?_[_0x6c09('0x1c')](_0xebad7c[_0x6c09('0x17')][_0x6c09('0x1b')],function(_0x2812c8){return{'model':db[_0x2812c8[_0x6c09('0x1d')]],'as':_0x2812c8['as'],'attributes':_0x2812c8[_0x6c09('0x1e')],'include':_0x2812c8[_0x6c09('0x1b')]?_[_0x6c09('0x1c')](_0x2812c8[_0x6c09('0x1b')],function(_0x3501a0){return{'model':db[_0x3501a0[_0x6c09('0x1d')]],'as':_0x3501a0['as'],'attributes':_0x3501a0[_0x6c09('0x1e')],'include':_0x3501a0[_0x6c09('0x1b')]?_[_0x6c09('0x1c')](_0x3501a0[_0x6c09('0x1b')],function(_0x514aeb){return{'model':db[_0x514aeb['model']],'as':_0x514aeb['as'],'attributes':_0x514aeb['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a45cf){logger[_0x6c09('0x12')](_0x6c09('0x1f'),_0xebad7c);logger[_0x6c09('0xc')]('GetDeskAccount',_0xebad7c,JSON['stringify'](_0x4a45cf));_0x5e4d68(_0x4a45cf);})['catch'](function(_0x5aa189){logger['error'](_0x6c09('0x1f'),_0x5aa189['message'],_0xebad7c);_0x1de9da(_0x352622['error'](0x1f4,_0x5aa189[_0x6c09('0x11')]));});});};exports[_0x6c09('0x20')]=function(_0x82dd55){var _0x12ea7c=this;return new Promise(function(_0x36f7a1,_0x2a2617){return db[_0x6c09('0x15')][_0x6c09('0x21')]({'raw':_0x82dd55[_0x6c09('0x17')]?_0x82dd55[_0x6c09('0x17')][_0x6c09('0x18')]===undefined?!![]:![]:!![],'where':_0x82dd55[_0x6c09('0x17')]?_0x82dd55[_0x6c09('0x17')][_0x6c09('0x19')]||null:null,'attributes':_0x82dd55[_0x6c09('0x17')]?_0x82dd55[_0x6c09('0x17')][_0x6c09('0x1e')]||null:null,'include':_0x82dd55['options']?_0x82dd55[_0x6c09('0x17')][_0x6c09('0x1b')]?_[_0x6c09('0x1c')](_0x82dd55[_0x6c09('0x17')]['include'],function(_0x4ce6bf){return{'model':db[_0x4ce6bf[_0x6c09('0x1d')]],'as':_0x4ce6bf['as'],'attributes':_0x4ce6bf[_0x6c09('0x1e')],'include':_0x4ce6bf[_0x6c09('0x1b')]?_[_0x6c09('0x1c')](_0x4ce6bf[_0x6c09('0x1b')],function(_0x121fb8){return{'model':db[_0x121fb8[_0x6c09('0x1d')]],'as':_0x121fb8['as'],'attributes':_0x121fb8[_0x6c09('0x1e')],'include':_0x121fb8['include']?_[_0x6c09('0x1c')](_0x121fb8[_0x6c09('0x1b')],function(_0x5b8cd6){return{'model':db[_0x5b8cd6[_0x6c09('0x1d')]],'as':_0x5b8cd6['as'],'attributes':_0x5b8cd6[_0x6c09('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1d18c1){logger[_0x6c09('0x12')](_0x6c09('0x20'),_0x82dd55);logger['debug']('ShowDeskAccount',_0x82dd55,JSON['stringify'](_0x1d18c1));_0x36f7a1(_0x1d18c1);})[_0x6c09('0x14')](function(_0x2734bf){logger[_0x6c09('0xf')](_0x6c09('0x20'),_0x2734bf[_0x6c09('0x11')],_0x82dd55);_0x2a2617(_0x12ea7c[_0x6c09('0xf')](0x1f4,_0x2734bf['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 621c593..595c691 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 _0x34e8=['../../config/environment','./intDeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x519c6b,_0x3c4325){var _0x43d87c=function(_0x39775a){while(--_0x39775a){_0x519c6b['push'](_0x519c6b['shift']());}};_0x43d87c(++_0x3c4325);}(_0x34e8,0x12c));var _0x834e=function(_0x2d46cc,_0x3542a5){_0x2d46cc=_0x2d46cc-0x0;var _0x1abc2c=_0x34e8[_0x2d46cc];return _0x1abc2c;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xa')](_0x834e('0xf'),auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0xa')](_0x834e('0x11'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0xa')](_0x834e('0x13'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);router[_0x834e('0xa')](_0x834e('0x15'),auth['isAuthenticated'](),controller[_0x834e('0x16')]);router[_0x834e('0x17')]('/',auth['isAuthenticated'](),controller[_0x834e('0x18')]);router[_0x834e('0x17')](_0x834e('0x15'),auth[_0x834e('0xd')](),controller['setTags']);router[_0x834e('0x19')](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);router['delete'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller['destroy']);module[_0x834e('0x1b')]=router; \ No newline at end of file +var _0x55ca=['../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','setTags','put','/:id','update','destroy','exports','multer','util','Router','fs-extra','../../components/interaction/service'];(function(_0x44454f,_0x4bfbe8){var _0x475150=function(_0x1cde13){while(--_0x1cde13){_0x44454f['push'](_0x44454f['shift']());}};_0x475150(++_0x4bfbe8);}(_0x55ca,0x126));var _0xa55c=function(_0x2c2781,_0x5f1153){_0x2c2781=_0x2c2781-0x0;var _0x3fe469=_0x55ca[_0x2c2781];return _0x3fe469;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var fs_extra=require(_0xa55c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xa55c('0x4'));var config=require(_0xa55c('0x5'));var controller=require(_0xa55c('0x6'));router[_0xa55c('0x7')]('/',auth[_0xa55c('0x8')](),controller[_0xa55c('0x9')]);router[_0xa55c('0x7')]('/:id',auth[_0xa55c('0x8')](),controller[_0xa55c('0xa')]);router['get'](_0xa55c('0xb'),auth[_0xa55c('0x8')](),controller['getFields']);router['get'](_0xa55c('0xc'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xd')]);router[_0xa55c('0x7')](_0xa55c('0xe'),auth[_0xa55c('0x8')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x7')](_0xa55c('0x10'),auth[_0xa55c('0x8')](),controller['getTags']);router['post']('/',auth[_0xa55c('0x8')](),controller['create']);router['post']('/:id/tags',auth[_0xa55c('0x8')](),controller[_0xa55c('0x11')]);router[_0xa55c('0x12')](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x14')]);router['delete'](_0xa55c('0x13'),auth[_0xa55c('0x8')](),controller[_0xa55c('0x15')]);module[_0xa55c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f49d052..869d949 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 _0x1494=['STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1494,0x8b));var _0x4149=function(_0x14212c,_0x1f57f4){_0x14212c=_0x14212c-0x0;var _0x47a69d=_0x1494[_0x14212c];return _0x47a69d;};'use strict';var Sequelize=require(_0x4149('0x0'));module['exports']={'name':{'type':Sequelize[_0x4149('0x1')]},'description':{'type':Sequelize[_0x4149('0x1')]}}; \ No newline at end of file +var _0xe986=['STRING'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0xe986,0x128));var _0x6e98=function(_0x5e2bf1,_0x196a30){_0x5e2bf1=_0x5e2bf1-0x0;var _0xebb68d=_0xe986[_0x5e2bf1];return _0xebb68d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x6e98('0x0')]},'description':{'type':Sequelize[_0x6e98('0x0')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 0e10c67..f339cd9 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 _0xc26c=['undefined','count','limit','set','Content-Range','apply','save','update','then','error','name','send','index','map','DeskConfiguration','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','body','find','destroy','DeskField','order','getFields','hasOwnProperty','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x5f0bd8,_0x5bb5c3){var _0x11538d=function(_0x502607){while(--_0x502607){_0x5f0bd8['push'](_0x5f0bd8['shift']());}};_0x11538d(++_0x5bb5c3);}(_0xc26c,0xe4));var _0xcc26=function(_0x31a825,_0x4dc839){_0x31a825=_0x31a825-0x0;var _0x55c66c=_0xc26c[_0x31a825];return _0x55c66c;};'use strict';var emlformat=require(_0xcc26('0x0'));var rimraf=require(_0xcc26('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xcc26('0x2'));var BPromise=require(_0xcc26('0x3'));var Mustache=require(_0xcc26('0x4'));var util=require(_0xcc26('0x5'));var path=require(_0xcc26('0x6'));var sox=require(_0xcc26('0x7'));var csv=require(_0xcc26('0x8'));var ejs=require(_0xcc26('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcc26('0xa'));var squel=require(_0xcc26('0xb'));var crypto=require(_0xcc26('0xc'));var jsforce=require(_0xcc26('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xcc26('0x8'));var querystring=require('querystring');var Papa=require(_0xcc26('0xe'));var Redis=require(_0xcc26('0xf'));var authService=require(_0xcc26('0x10'));var qs=require(_0xcc26('0x11'));var as=require(_0xcc26('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc26('0x13'))(_0xcc26('0x14'));var utils=require(_0xcc26('0x15'));var config=require(_0xcc26('0x16'));var licenseUtil=require(_0xcc26('0x17'));var db=require(_0xcc26('0x18'))['db'];function respondWithStatusCode(_0x1c2e5d,_0x474656){_0x474656=_0x474656||0xcc;return function(_0x480948){if(_0x480948){return _0x1c2e5d[_0xcc26('0x19')](_0x474656);}return _0x1c2e5d[_0xcc26('0x1a')](_0x474656)[_0xcc26('0x1b')]();};}function respondWithResult(_0x117edc,_0x31fc4c){_0x31fc4c=_0x31fc4c||0xc8;return function(_0xa21c3a){if(_0xa21c3a){return _0x117edc[_0xcc26('0x1a')](_0x31fc4c)[_0xcc26('0x1c')](_0xa21c3a);}};}function respondWithFilteredResult(_0x249be1,_0xd9cf9c){return function(_0x123d84){if(_0x123d84){var _0x1d8820=typeof _0xd9cf9c[_0xcc26('0x1d')]===_0xcc26('0x1e')&&typeof _0xd9cf9c['limit']==='undefined';var _0x32d103=_0x123d84[_0xcc26('0x1f')];var _0x3ff495=_0x1d8820?0x0:_0xd9cf9c[_0xcc26('0x1d')];var _0x38b524=_0x1d8820?_0x123d84['count']:_0xd9cf9c[_0xcc26('0x1d')]+_0xd9cf9c[_0xcc26('0x20')];var _0x17ec05;if(_0x38b524>=_0x32d103){_0x38b524=_0x32d103;_0x17ec05=0xc8;}else{_0x17ec05=0xce;}_0x249be1[_0xcc26('0x1a')](_0x17ec05);return _0x249be1[_0xcc26('0x21')](_0xcc26('0x22'),_0x3ff495+'-'+_0x38b524+'/'+_0x32d103)[_0xcc26('0x1c')](_0x123d84);}return null;};}function patchUpdates(_0x5cb5fb){return function(_0x28c6be){try{jsonpatch[_0xcc26('0x23')](_0x28c6be,_0x5cb5fb,!![]);}catch(_0x58f0b5){return BPromise['reject'](_0x58f0b5);}return _0x28c6be[_0xcc26('0x24')]();};}function saveUpdates(_0xe151f8,_0x3944b4){return function(_0x3f50e6){if(_0x3f50e6){return _0x3f50e6[_0xcc26('0x25')](_0xe151f8)[_0xcc26('0x26')](function(_0x5a2de9){return _0x5a2de9;});}return null;};}function removeEntity(_0x594e5e,_0x583fd2){return function(_0x57633f){if(_0x57633f){return _0x57633f['destroy']()[_0xcc26('0x26')](function(){_0x594e5e[_0xcc26('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8a585c,_0xd9bada){return function(_0x270869){if(!_0x270869){_0x8a585c['sendStatus'](0x194);}return _0x270869;};}function handleError(_0x557db6,_0x304c66){_0x304c66=_0x304c66||0x1f4;return function(_0x3d42ba){logger[_0xcc26('0x27')](_0x3d42ba['stack']);if(_0x3d42ba[_0xcc26('0x28')]){delete _0x3d42ba[_0xcc26('0x28')];}_0x557db6[_0xcc26('0x1a')](_0x304c66)[_0xcc26('0x29')](_0x3d42ba);};}exports[_0xcc26('0x2a')]=function(_0x380b5b,_0x5cb04c){var _0x47b4ee={},_0x147892={},_0x89fad3={'count':0x0,'rows':[]};var _0x3de40b=_[_0xcc26('0x2b')](db[_0xcc26('0x2c')]['rawAttributes'],function(_0x27fe8d){return{'name':_0x27fe8d['fieldName'],'type':_0x27fe8d[_0xcc26('0x2d')][_0xcc26('0x2e')]};});_0x147892[_0xcc26('0x2f')]=_['map'](_0x3de40b,_0xcc26('0x28'));_0x147892[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x380b5b[_0xcc26('0x30')]);_0x147892[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x147892[_0xcc26('0x2f')],_0x147892['query']);_0x47b4ee['attributes']=_[_0xcc26('0x33')](_0x147892[_0xcc26('0x2f')],qs[_0xcc26('0x34')](_0x380b5b['query'][_0xcc26('0x34')]));_0x47b4ee[_0xcc26('0x35')]=_0x47b4ee[_0xcc26('0x35')][_0xcc26('0x36')]?_0x47b4ee[_0xcc26('0x35')]:_0x147892[_0xcc26('0x2f')];if(!_0x380b5b[_0xcc26('0x30')]['hasOwnProperty'](_0xcc26('0x37'))){_0x47b4ee[_0xcc26('0x20')]=qs[_0xcc26('0x20')](_0x380b5b['query'][_0xcc26('0x20')]);_0x47b4ee['offset']=qs[_0xcc26('0x1d')](_0x380b5b[_0xcc26('0x30')]['offset']);}_0x47b4ee['order']=qs[_0xcc26('0x38')](_0x380b5b['query']['sort']);_0x47b4ee['where']=qs['filters'](_[_0xcc26('0x39')](_0x380b5b[_0xcc26('0x30')],_0x147892['filters']),_0x3de40b);if(_0x380b5b[_0xcc26('0x30')][_0xcc26('0x3a')]){_0x47b4ee[_0xcc26('0x3b')]=_[_0xcc26('0x3c')](_0x47b4ee['where'],{'$or':_[_0xcc26('0x2b')](_0x3de40b,function(_0x5ba637){if(_0x5ba637[_0xcc26('0x2d')]!==_0xcc26('0x3d')){var _0xe131c9={};_0xe131c9[_0x5ba637[_0xcc26('0x28')]]={'$like':'%'+_0x380b5b[_0xcc26('0x30')][_0xcc26('0x3a')]+'%'};return _0xe131c9;}})});}_0x47b4ee=_[_0xcc26('0x3c')]({},_0x47b4ee,_0x380b5b[_0xcc26('0x3e')]);var _0x5f1de1={'where':_0x47b4ee[_0xcc26('0x3b')]};return db[_0xcc26('0x2c')][_0xcc26('0x1f')](_0x5f1de1)[_0xcc26('0x26')](function(_0x1051b6){_0x89fad3[_0xcc26('0x1f')]=_0x1051b6;if(_0x380b5b['query']['includeAll']){_0x47b4ee[_0xcc26('0x3f')]=[{'all':!![]}];}return db[_0xcc26('0x2c')][_0xcc26('0x40')](_0x47b4ee);})[_0xcc26('0x26')](function(_0x50e0b9){_0x89fad3[_0xcc26('0x41')]=_0x50e0b9;return _0x89fad3;})[_0xcc26('0x26')](respondWithFilteredResult(_0x5cb04c,_0x47b4ee))[_0xcc26('0x42')](handleError(_0x5cb04c,null));};exports[_0xcc26('0x43')]=function(_0x46c530,_0x4c9088){var _0x2e143a={'raw':![],'where':{'id':_0x46c530[_0xcc26('0x44')]['id']}},_0x2014bc={};_0x2014bc['model']=_[_0xcc26('0x31')](db['DeskConfiguration'][_0xcc26('0x45')]);_0x2014bc['query']=_[_0xcc26('0x31')](_0x46c530[_0xcc26('0x30')]);_0x2014bc['filters']=_[_0xcc26('0x33')](_0x2014bc[_0xcc26('0x2f')],_0x2014bc[_0xcc26('0x30')]);_0x2e143a[_0xcc26('0x35')]=_[_0xcc26('0x33')](_0x2014bc[_0xcc26('0x2f')],qs['fields'](_0x46c530['query']['fields']));_0x2e143a[_0xcc26('0x35')]=_0x2e143a[_0xcc26('0x35')][_0xcc26('0x36')]?_0x2e143a[_0xcc26('0x35')]:_0x2014bc['model'];if(_0x46c530['query'][_0xcc26('0x46')]){_0x2e143a['include']=[{'all':!![]}];}_0x2e143a=_[_0xcc26('0x3c')]({},_0x2e143a,_0x46c530[_0xcc26('0x3e')]);return db[_0xcc26('0x2c')]['find'](_0x2e143a)[_0xcc26('0x26')](handleEntityNotFound(_0x4c9088,null))[_0xcc26('0x26')](respondWithResult(_0x4c9088,null))[_0xcc26('0x42')](handleError(_0x4c9088,null));};exports[_0xcc26('0x47')]=function(_0x1552b7,_0x3e2842){return db[_0xcc26('0x2c')][_0xcc26('0x47')](_0x1552b7[_0xcc26('0x48')],{})[_0xcc26('0x26')](respondWithResult(_0x3e2842,0xc9))[_0xcc26('0x42')](handleError(_0x3e2842,null));};exports[_0xcc26('0x25')]=function(_0x5d549f,_0x1e7df5){if(_0x5d549f[_0xcc26('0x48')]['id']){delete _0x5d549f[_0xcc26('0x48')]['id'];}return db[_0xcc26('0x2c')][_0xcc26('0x49')]({'where':{'id':_0x5d549f[_0xcc26('0x44')]['id']}})[_0xcc26('0x26')](handleEntityNotFound(_0x1e7df5,null))['then'](saveUpdates(_0x5d549f['body'],null))[_0xcc26('0x26')](respondWithResult(_0x1e7df5,null))[_0xcc26('0x42')](handleError(_0x1e7df5,null));};exports[_0xcc26('0x4a')]=function(_0x289035,_0x15fd91){return db['DeskConfiguration'][_0xcc26('0x49')]({'where':{'id':_0x289035['params']['id']}})['then'](handleEntityNotFound(_0x15fd91,null))[_0xcc26('0x26')](removeEntity(_0x15fd91,null))['catch'](handleError(_0x15fd91,null));};exports['getFields']=function(_0x376ec6,_0x3c1be1,_0x288182){var _0x40caf9={};var _0x5dc16c={};var _0x2c9ae9;var _0x202ba7;return db['DeskConfiguration']['findOne']({'where':{'id':_0x376ec6[_0xcc26('0x44')]['id']}})[_0xcc26('0x26')](handleEntityNotFound(_0x3c1be1,null))[_0xcc26('0x26')](function(_0x5e4f1e){if(_0x5e4f1e){_0x2c9ae9=_0x5e4f1e;_0x5dc16c[_0xcc26('0x2f')]=_['keys'](db[_0xcc26('0x4b')][_0xcc26('0x45')]);_0x5dc16c[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x376ec6[_0xcc26('0x30')]);_0x5dc16c[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x5dc16c[_0xcc26('0x2f')],_0x5dc16c[_0xcc26('0x30')]);_0x40caf9[_0xcc26('0x35')]=_[_0xcc26('0x33')](_0x5dc16c[_0xcc26('0x2f')],qs[_0xcc26('0x34')](_0x376ec6[_0xcc26('0x30')]['fields']));_0x40caf9[_0xcc26('0x35')]=_0x40caf9[_0xcc26('0x35')][_0xcc26('0x36')]?_0x40caf9[_0xcc26('0x35')]:_0x5dc16c[_0xcc26('0x2f')];_0x40caf9[_0xcc26('0x4c')]=qs['sort'](_0x376ec6[_0xcc26('0x30')][_0xcc26('0x38')]);_0x40caf9[_0xcc26('0x3b')]=qs['filters'](_[_0xcc26('0x39')](_0x376ec6[_0xcc26('0x30')],_0x5dc16c[_0xcc26('0x32')]));if(_0x376ec6[_0xcc26('0x30')][_0xcc26('0x3a')]){_0x40caf9[_0xcc26('0x3b')]=_[_0xcc26('0x3c')](_0x40caf9[_0xcc26('0x3b')],{'$or':_[_0xcc26('0x2b')](_0x40caf9['attributes'],function(_0x195dfa){var _0x97a3b={};_0x97a3b[_0x195dfa]={'$like':'%'+_0x376ec6['query'][_0xcc26('0x3a')]+'%'};return _0x97a3b;})});}_0x40caf9=_[_0xcc26('0x3c')]({},_0x40caf9,_0x376ec6[_0xcc26('0x3e')]);return _0x2c9ae9[_0xcc26('0x4d')](_0x40caf9);}})[_0xcc26('0x26')](function(_0xaf0656){if(_0xaf0656){_0x202ba7=_0xaf0656[_0xcc26('0x36')];if(!_0x376ec6[_0xcc26('0x30')][_0xcc26('0x4e')](_0xcc26('0x37'))){_0x40caf9['limit']=qs['limit'](_0x376ec6[_0xcc26('0x30')][_0xcc26('0x20')]);_0x40caf9[_0xcc26('0x1d')]=qs[_0xcc26('0x1d')](_0x376ec6[_0xcc26('0x30')]['offset']);}return _0x2c9ae9['getFields'](_0x40caf9);}})[_0xcc26('0x26')](function(_0x32ff8e){if(_0x32ff8e){return _0x32ff8e?{'count':_0x202ba7,'rows':_0x32ff8e}:null;}})[_0xcc26('0x26')](respondWithResult(_0x3c1be1,null))[_0xcc26('0x42')](handleError(_0x3c1be1,null));};exports['getSubjects']=function(_0x332c55,_0x321091,_0x533414){var _0x11143b={};var _0x1e5e92={};var _0x35028d;var _0x5d9b2d;return db[_0xcc26('0x2c')][_0xcc26('0x4f')]({'where':{'id':_0x332c55['params']['id']}})[_0xcc26('0x26')](handleEntityNotFound(_0x321091,null))[_0xcc26('0x26')](function(_0x38d89d){if(_0x38d89d){_0x35028d=_0x38d89d;_0x1e5e92[_0xcc26('0x2f')]=_[_0xcc26('0x31')](db[_0xcc26('0x4b')][_0xcc26('0x45')]);_0x1e5e92[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x332c55[_0xcc26('0x30')]);_0x1e5e92[_0xcc26('0x32')]=_['intersection'](_0x1e5e92[_0xcc26('0x2f')],_0x1e5e92[_0xcc26('0x30')]);_0x11143b[_0xcc26('0x35')]=_[_0xcc26('0x33')](_0x1e5e92['model'],qs[_0xcc26('0x34')](_0x332c55[_0xcc26('0x30')][_0xcc26('0x34')]));_0x11143b[_0xcc26('0x35')]=_0x11143b[_0xcc26('0x35')][_0xcc26('0x36')]?_0x11143b[_0xcc26('0x35')]:_0x1e5e92[_0xcc26('0x2f')];_0x11143b[_0xcc26('0x4c')]=qs[_0xcc26('0x38')](_0x332c55[_0xcc26('0x30')]['sort']);_0x11143b[_0xcc26('0x3b')]=qs['filters'](_['pick'](_0x332c55[_0xcc26('0x30')],_0x1e5e92[_0xcc26('0x32')]));if(_0x332c55[_0xcc26('0x30')][_0xcc26('0x3a')]){_0x11143b[_0xcc26('0x3b')]=_['merge'](_0x11143b[_0xcc26('0x3b')],{'$or':_[_0xcc26('0x2b')](_0x11143b['attributes'],function(_0x32a95d){var _0x1e53ca={};_0x1e53ca[_0x32a95d]={'$like':'%'+_0x332c55[_0xcc26('0x30')][_0xcc26('0x3a')]+'%'};return _0x1e53ca;})});}_0x11143b=_[_0xcc26('0x3c')]({},_0x11143b,_0x332c55[_0xcc26('0x3e')]);return _0x35028d[_0xcc26('0x50')](_0x11143b);}})[_0xcc26('0x26')](function(_0x286394){if(_0x286394){_0x5d9b2d=_0x286394['length'];if(!_0x332c55[_0xcc26('0x30')][_0xcc26('0x4e')](_0xcc26('0x37'))){_0x11143b[_0xcc26('0x20')]=qs[_0xcc26('0x20')](_0x332c55['query'][_0xcc26('0x20')]);_0x11143b[_0xcc26('0x1d')]=qs[_0xcc26('0x1d')](_0x332c55['query'][_0xcc26('0x1d')]);}return _0x35028d[_0xcc26('0x50')](_0x11143b);}})['then'](function(_0x326208){if(_0x326208){return _0x326208?{'count':_0x5d9b2d,'rows':_0x326208}:null;}})[_0xcc26('0x26')](respondWithResult(_0x321091,null))[_0xcc26('0x42')](handleError(_0x321091,null));};exports[_0xcc26('0x51')]=function(_0x1d39bd,_0x122391,_0xa7faed){var _0x1e5c65={};var _0x430d23={};var _0x45bf68;var _0x3dac22;return db['DeskConfiguration'][_0xcc26('0x4f')]({'where':{'id':_0x1d39bd[_0xcc26('0x44')]['id']}})['then'](handleEntityNotFound(_0x122391,null))[_0xcc26('0x26')](function(_0x49ace1){if(_0x49ace1){_0x45bf68=_0x49ace1;_0x430d23[_0xcc26('0x2f')]=_[_0xcc26('0x31')](db['DeskField'][_0xcc26('0x45')]);_0x430d23[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x1d39bd[_0xcc26('0x30')]);_0x430d23[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x430d23['model'],_0x430d23[_0xcc26('0x30')]);_0x1e5c65[_0xcc26('0x35')]=_[_0xcc26('0x33')](_0x430d23[_0xcc26('0x2f')],qs['fields'](_0x1d39bd[_0xcc26('0x30')][_0xcc26('0x34')]));_0x1e5c65[_0xcc26('0x35')]=_0x1e5c65[_0xcc26('0x35')][_0xcc26('0x36')]?_0x1e5c65[_0xcc26('0x35')]:_0x430d23[_0xcc26('0x2f')];_0x1e5c65[_0xcc26('0x4c')]=qs['sort'](_0x1d39bd[_0xcc26('0x30')][_0xcc26('0x38')]);_0x1e5c65['where']=qs[_0xcc26('0x32')](_[_0xcc26('0x39')](_0x1d39bd[_0xcc26('0x30')],_0x430d23[_0xcc26('0x32')]));if(_0x1d39bd['query'][_0xcc26('0x3a')]){_0x1e5c65['where']=_[_0xcc26('0x3c')](_0x1e5c65[_0xcc26('0x3b')],{'$or':_['map'](_0x1e5c65['attributes'],function(_0x24a597){var _0x3ecc5b={};_0x3ecc5b[_0x24a597]={'$like':'%'+_0x1d39bd[_0xcc26('0x30')][_0xcc26('0x3a')]+'%'};return _0x3ecc5b;})});}_0x1e5c65=_[_0xcc26('0x3c')]({},_0x1e5c65,_0x1d39bd[_0xcc26('0x3e')]);return _0x45bf68[_0xcc26('0x51')](_0x1e5c65);}})[_0xcc26('0x26')](function(_0xde6bfb){if(_0xde6bfb){_0x3dac22=_0xde6bfb[_0xcc26('0x36')];if(!_0x1d39bd[_0xcc26('0x30')]['hasOwnProperty'](_0xcc26('0x37'))){_0x1e5c65['limit']=qs['limit'](_0x1d39bd[_0xcc26('0x30')][_0xcc26('0x20')]);_0x1e5c65[_0xcc26('0x1d')]=qs[_0xcc26('0x1d')](_0x1d39bd['query'][_0xcc26('0x1d')]);}return _0x45bf68[_0xcc26('0x51')](_0x1e5c65);}})[_0xcc26('0x26')](function(_0x540f74){if(_0x540f74){return _0x540f74?{'count':_0x3dac22,'rows':_0x540f74}:null;}})[_0xcc26('0x26')](respondWithResult(_0x122391,null))[_0xcc26('0x42')](handleError(_0x122391,null));};exports[_0xcc26('0x52')]=function(_0x47f1cc,_0x1b2633,_0x4afcd7){var _0x4dc66a={};var _0x2d78d4={};var _0x320c4b;var _0x382a7a;return db[_0xcc26('0x2c')][_0xcc26('0x4f')]({'where':{'id':_0x47f1cc['params']['id']}})[_0xcc26('0x26')](handleEntityNotFound(_0x1b2633,null))[_0xcc26('0x26')](function(_0x5973d2){if(_0x5973d2){_0x320c4b=_0x5973d2;_0x2d78d4[_0xcc26('0x2f')]=_[_0xcc26('0x31')](db[_0xcc26('0x53')][_0xcc26('0x45')]);_0x2d78d4[_0xcc26('0x30')]=_[_0xcc26('0x31')](_0x47f1cc[_0xcc26('0x30')]);_0x2d78d4[_0xcc26('0x32')]=_[_0xcc26('0x33')](_0x2d78d4[_0xcc26('0x2f')],_0x2d78d4['query']);_0x4dc66a[_0xcc26('0x35')]=_[_0xcc26('0x33')](_0x2d78d4[_0xcc26('0x2f')],qs[_0xcc26('0x34')](_0x47f1cc['query'][_0xcc26('0x34')]));_0x4dc66a['attributes']=_0x4dc66a[_0xcc26('0x35')]['length']?_0x4dc66a[_0xcc26('0x35')]:_0x2d78d4['model'];_0x4dc66a['order']=qs['sort'](_0x47f1cc[_0xcc26('0x30')][_0xcc26('0x38')]);_0x4dc66a['where']=qs['filters'](_[_0xcc26('0x39')](_0x47f1cc[_0xcc26('0x30')],_0x2d78d4[_0xcc26('0x32')]));if(_0x47f1cc[_0xcc26('0x30')]['filter']){_0x4dc66a[_0xcc26('0x3b')]=_[_0xcc26('0x3c')](_0x4dc66a[_0xcc26('0x3b')],{'$or':_[_0xcc26('0x2b')](_0x4dc66a[_0xcc26('0x35')],function(_0x15087d){var _0x35d8c2={};_0x35d8c2[_0x15087d]={'$like':'%'+_0x47f1cc[_0xcc26('0x30')][_0xcc26('0x3a')]+'%'};return _0x35d8c2;})});}_0x4dc66a=_[_0xcc26('0x3c')]({},_0x4dc66a,_0x47f1cc[_0xcc26('0x3e')]);return _0x320c4b['getTags'](_0x4dc66a);}})[_0xcc26('0x26')](function(_0x5cfa92){if(_0x5cfa92){_0x382a7a=_0x5cfa92['length'];if(!_0x47f1cc[_0xcc26('0x30')][_0xcc26('0x4e')](_0xcc26('0x37'))){_0x4dc66a['limit']=qs[_0xcc26('0x20')](_0x47f1cc[_0xcc26('0x30')][_0xcc26('0x20')]);_0x4dc66a[_0xcc26('0x1d')]=qs[_0xcc26('0x1d')](_0x47f1cc[_0xcc26('0x30')]['offset']);}return _0x320c4b[_0xcc26('0x52')](_0x4dc66a);}})['then'](function(_0x1d65f0){if(_0x1d65f0){return _0x1d65f0?{'count':_0x382a7a,'rows':_0x1d65f0}:null;}})['then'](respondWithResult(_0x1b2633,null))[_0xcc26('0x42')](handleError(_0x1b2633,null));};exports[_0xcc26('0x54')]=function(_0x51878e,_0x68f224,_0x59c534){if(_0x51878e[_0xcc26('0x48')]['id']){delete _0x51878e[_0xcc26('0x48')]['id'];}return db[_0xcc26('0x2c')][_0xcc26('0x4f')]({'where':{'id':_0x51878e[_0xcc26('0x44')]['id']}})[_0xcc26('0x26')](handleEntityNotFound(_0x68f224,null))[_0xcc26('0x26')](function(_0x269774){if(_0x269774){return _0x269774[_0xcc26('0x54')](_0x51878e[_0xcc26('0x48')][_0xcc26('0x55')]||[]);}return null;})[_0xcc26('0x26')](respondWithResult(_0x68f224,null))[_0xcc26('0x42')](handleError(_0x68f224,null));}; \ No newline at end of file +var _0x14fb=['filter','merge','options','includeAll','include','rows','catch','show','params','DeskConfiguration','rawAttributes','find','create','body','getFields','findOne','order','getSubjects','DeskField','getDescriptions','getTags','Tag','setTags','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','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','error','stack','name','send','index','map','type','key','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick'];(function(_0x2a4497,_0x1b0574){var _0x4c6de6=function(_0x344071){while(--_0x344071){_0x2a4497['push'](_0x2a4497['shift']());}};_0x4c6de6(++_0x1b0574);}(_0x14fb,0x116));var _0xb14f=function(_0xd21e29,_0x33a08f){_0xd21e29=_0xd21e29-0x0;var _0xcd0479=_0x14fb[_0xd21e29];return _0xcd0479;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb14f('0x0'));var jsonpatch=require(_0xb14f('0x1'));var rp=require(_0xb14f('0x2'));var moment=require(_0xb14f('0x3'));var BPromise=require(_0xb14f('0x4'));var Mustache=require(_0xb14f('0x5'));var util=require(_0xb14f('0x6'));var path=require(_0xb14f('0x7'));var sox=require(_0xb14f('0x8'));var csv=require(_0xb14f('0x9'));var ejs=require(_0xb14f('0xa'));var fs=require('fs');var fs_extra=require(_0xb14f('0xb'));var _=require(_0xb14f('0xc'));var squel=require(_0xb14f('0xd'));var crypto=require(_0xb14f('0xe'));var jsforce=require(_0xb14f('0xf'));var deskjs=require(_0xb14f('0x10'));var toCsv=require(_0xb14f('0x9'));var querystring=require(_0xb14f('0x11'));var Papa=require(_0xb14f('0x12'));var Redis=require(_0xb14f('0x13'));var authService=require(_0xb14f('0x14'));var qs=require(_0xb14f('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb14f('0x16'));var logger=require(_0xb14f('0x17'))(_0xb14f('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb14f('0x19'))['db'];function respondWithStatusCode(_0x33a8dd,_0x98ffbb){_0x98ffbb=_0x98ffbb||0xcc;return function(_0xef9b8a){if(_0xef9b8a){return _0x33a8dd[_0xb14f('0x1a')](_0x98ffbb);}return _0x33a8dd[_0xb14f('0x1b')](_0x98ffbb)[_0xb14f('0x1c')]();};}function respondWithResult(_0x21deac,_0x11c909){_0x11c909=_0x11c909||0xc8;return function(_0x7d0c87){if(_0x7d0c87){return _0x21deac['status'](_0x11c909)[_0xb14f('0x1d')](_0x7d0c87);}};}function respondWithFilteredResult(_0x59f180,_0x35ec18){return function(_0x35dd2a){if(_0x35dd2a){var _0x447f0a=typeof _0x35ec18['offset']==='undefined'&&typeof _0x35ec18['limit']===_0xb14f('0x1e');var _0x547882=_0x35dd2a[_0xb14f('0x1f')];var _0x51d4ab=_0x447f0a?0x0:_0x35ec18['offset'];var _0x3e367f=_0x447f0a?_0x35dd2a[_0xb14f('0x1f')]:_0x35ec18[_0xb14f('0x20')]+_0x35ec18[_0xb14f('0x21')];var _0x522325;if(_0x3e367f>=_0x547882){_0x3e367f=_0x547882;_0x522325=0xc8;}else{_0x522325=0xce;}_0x59f180[_0xb14f('0x1b')](_0x522325);return _0x59f180[_0xb14f('0x22')](_0xb14f('0x23'),_0x51d4ab+'-'+_0x3e367f+'/'+_0x547882)[_0xb14f('0x1d')](_0x35dd2a);}return null;};}function patchUpdates(_0x1fd249){return function(_0x5679dc){try{jsonpatch[_0xb14f('0x24')](_0x5679dc,_0x1fd249,!![]);}catch(_0x5b1e4c){return BPromise[_0xb14f('0x25')](_0x5b1e4c);}return _0x5679dc['save']();};}function saveUpdates(_0x3a46f4,_0x7cb0a0){return function(_0x19fe27){if(_0x19fe27){return _0x19fe27[_0xb14f('0x26')](_0x3a46f4)['then'](function(_0x500b2d){return _0x500b2d;});}return null;};}function removeEntity(_0x51dccd,_0x45e014){return function(_0x37af97){if(_0x37af97){return _0x37af97[_0xb14f('0x27')]()[_0xb14f('0x28')](function(){_0x51dccd[_0xb14f('0x1b')](0xcc)[_0xb14f('0x1c')]();});}};}function handleEntityNotFound(_0x341a1e,_0x2fb290){return function(_0x28b292){if(!_0x28b292){_0x341a1e[_0xb14f('0x1a')](0x194);}return _0x28b292;};}function handleError(_0x10b869,_0x334f23){_0x334f23=_0x334f23||0x1f4;return function(_0x1f9b8d){logger[_0xb14f('0x29')](_0x1f9b8d[_0xb14f('0x2a')]);if(_0x1f9b8d[_0xb14f('0x2b')]){delete _0x1f9b8d[_0xb14f('0x2b')];}_0x10b869[_0xb14f('0x1b')](_0x334f23)[_0xb14f('0x2c')](_0x1f9b8d);};}exports[_0xb14f('0x2d')]=function(_0x8d349,_0x81d99f){var _0x249903={},_0x18f8b6={},_0x30879f={'count':0x0,'rows':[]};var _0x215fe1=_[_0xb14f('0x2e')](db['DeskConfiguration']['rawAttributes'],function(_0x53c7a5){return{'name':_0x53c7a5['fieldName'],'type':_0x53c7a5[_0xb14f('0x2f')][_0xb14f('0x30')]};});_0x18f8b6['model']=_[_0xb14f('0x2e')](_0x215fe1,_0xb14f('0x2b'));_0x18f8b6['query']=_[_0xb14f('0x31')](_0x8d349[_0xb14f('0x32')]);_0x18f8b6[_0xb14f('0x33')]=_['intersection'](_0x18f8b6[_0xb14f('0x34')],_0x18f8b6['query']);_0x249903[_0xb14f('0x35')]=_[_0xb14f('0x36')](_0x18f8b6[_0xb14f('0x34')],qs[_0xb14f('0x37')](_0x8d349[_0xb14f('0x32')]['fields']));_0x249903['attributes']=_0x249903[_0xb14f('0x35')][_0xb14f('0x38')]?_0x249903[_0xb14f('0x35')]:_0x18f8b6[_0xb14f('0x34')];if(!_0x8d349[_0xb14f('0x32')][_0xb14f('0x39')](_0xb14f('0x3a'))){_0x249903[_0xb14f('0x21')]=qs[_0xb14f('0x21')](_0x8d349[_0xb14f('0x32')][_0xb14f('0x21')]);_0x249903['offset']=qs[_0xb14f('0x20')](_0x8d349[_0xb14f('0x32')][_0xb14f('0x20')]);}_0x249903['order']=qs[_0xb14f('0x3b')](_0x8d349[_0xb14f('0x32')][_0xb14f('0x3b')]);_0x249903[_0xb14f('0x3c')]=qs[_0xb14f('0x33')](_[_0xb14f('0x3d')](_0x8d349[_0xb14f('0x32')],_0x18f8b6[_0xb14f('0x33')]),_0x215fe1);if(_0x8d349[_0xb14f('0x32')][_0xb14f('0x3e')]){_0x249903['where']=_[_0xb14f('0x3f')](_0x249903[_0xb14f('0x3c')],{'$or':_[_0xb14f('0x2e')](_0x215fe1,function(_0x5a0ad9){if(_0x5a0ad9[_0xb14f('0x2f')]!=='VIRTUAL'){var _0x5e4420={};_0x5e4420[_0x5a0ad9['name']]={'$like':'%'+_0x8d349['query'][_0xb14f('0x3e')]+'%'};return _0x5e4420;}})});}_0x249903=_[_0xb14f('0x3f')]({},_0x249903,_0x8d349[_0xb14f('0x40')]);var _0x5caa5d={'where':_0x249903[_0xb14f('0x3c')]};return db['DeskConfiguration'][_0xb14f('0x1f')](_0x5caa5d)[_0xb14f('0x28')](function(_0x4166dc){_0x30879f[_0xb14f('0x1f')]=_0x4166dc;if(_0x8d349[_0xb14f('0x32')][_0xb14f('0x41')]){_0x249903[_0xb14f('0x42')]=[{'all':!![]}];}return db['DeskConfiguration']['findAll'](_0x249903);})['then'](function(_0x3e09f8){_0x30879f[_0xb14f('0x43')]=_0x3e09f8;return _0x30879f;})[_0xb14f('0x28')](respondWithFilteredResult(_0x81d99f,_0x249903))[_0xb14f('0x44')](handleError(_0x81d99f,null));};exports[_0xb14f('0x45')]=function(_0x3ab7df,_0x299a2c){var _0x137dbf={'raw':![],'where':{'id':_0x3ab7df[_0xb14f('0x46')]['id']}},_0x398ee6={};_0x398ee6[_0xb14f('0x34')]=_['keys'](db[_0xb14f('0x47')][_0xb14f('0x48')]);_0x398ee6[_0xb14f('0x32')]=_[_0xb14f('0x31')](_0x3ab7df['query']);_0x398ee6[_0xb14f('0x33')]=_[_0xb14f('0x36')](_0x398ee6[_0xb14f('0x34')],_0x398ee6[_0xb14f('0x32')]);_0x137dbf['attributes']=_['intersection'](_0x398ee6[_0xb14f('0x34')],qs[_0xb14f('0x37')](_0x3ab7df['query'][_0xb14f('0x37')]));_0x137dbf['attributes']=_0x137dbf[_0xb14f('0x35')][_0xb14f('0x38')]?_0x137dbf[_0xb14f('0x35')]:_0x398ee6['model'];if(_0x3ab7df['query'][_0xb14f('0x41')]){_0x137dbf[_0xb14f('0x42')]=[{'all':!![]}];}_0x137dbf=_['merge']({},_0x137dbf,_0x3ab7df[_0xb14f('0x40')]);return db[_0xb14f('0x47')][_0xb14f('0x49')](_0x137dbf)[_0xb14f('0x28')](handleEntityNotFound(_0x299a2c,null))['then'](respondWithResult(_0x299a2c,null))[_0xb14f('0x44')](handleError(_0x299a2c,null));};exports[_0xb14f('0x4a')]=function(_0x22de5d,_0x2ecf4c){return db[_0xb14f('0x47')][_0xb14f('0x4a')](_0x22de5d[_0xb14f('0x4b')],{})[_0xb14f('0x28')](respondWithResult(_0x2ecf4c,0xc9))['catch'](handleError(_0x2ecf4c,null));};exports[_0xb14f('0x26')]=function(_0x43195e,_0x227291){if(_0x43195e[_0xb14f('0x4b')]['id']){delete _0x43195e[_0xb14f('0x4b')]['id'];}return db[_0xb14f('0x47')]['find']({'where':{'id':_0x43195e[_0xb14f('0x46')]['id']}})[_0xb14f('0x28')](handleEntityNotFound(_0x227291,null))['then'](saveUpdates(_0x43195e[_0xb14f('0x4b')],null))['then'](respondWithResult(_0x227291,null))[_0xb14f('0x44')](handleError(_0x227291,null));};exports[_0xb14f('0x27')]=function(_0x5d764b,_0x4047f3){return db['DeskConfiguration']['find']({'where':{'id':_0x5d764b[_0xb14f('0x46')]['id']}})[_0xb14f('0x28')](handleEntityNotFound(_0x4047f3,null))['then'](removeEntity(_0x4047f3,null))[_0xb14f('0x44')](handleError(_0x4047f3,null));};exports[_0xb14f('0x4c')]=function(_0x140e41,_0x16de49,_0x47a54b){var _0x1c1cf4={};var _0x5f0c47={};var _0x54ecc9;var _0xf7531d;return db[_0xb14f('0x47')][_0xb14f('0x4d')]({'where':{'id':_0x140e41[_0xb14f('0x46')]['id']}})[_0xb14f('0x28')](handleEntityNotFound(_0x16de49,null))[_0xb14f('0x28')](function(_0x5b725e){if(_0x5b725e){_0x54ecc9=_0x5b725e;_0x5f0c47[_0xb14f('0x34')]=_[_0xb14f('0x31')](db['DeskField'][_0xb14f('0x48')]);_0x5f0c47[_0xb14f('0x32')]=_[_0xb14f('0x31')](_0x140e41[_0xb14f('0x32')]);_0x5f0c47['filters']=_[_0xb14f('0x36')](_0x5f0c47[_0xb14f('0x34')],_0x5f0c47['query']);_0x1c1cf4[_0xb14f('0x35')]=_[_0xb14f('0x36')](_0x5f0c47[_0xb14f('0x34')],qs['fields'](_0x140e41[_0xb14f('0x32')][_0xb14f('0x37')]));_0x1c1cf4['attributes']=_0x1c1cf4['attributes'][_0xb14f('0x38')]?_0x1c1cf4[_0xb14f('0x35')]:_0x5f0c47['model'];_0x1c1cf4[_0xb14f('0x4e')]=qs[_0xb14f('0x3b')](_0x140e41[_0xb14f('0x32')]['sort']);_0x1c1cf4[_0xb14f('0x3c')]=qs[_0xb14f('0x33')](_[_0xb14f('0x3d')](_0x140e41['query'],_0x5f0c47[_0xb14f('0x33')]));if(_0x140e41[_0xb14f('0x32')][_0xb14f('0x3e')]){_0x1c1cf4['where']=_[_0xb14f('0x3f')](_0x1c1cf4[_0xb14f('0x3c')],{'$or':_['map'](_0x1c1cf4[_0xb14f('0x35')],function(_0xac3679){var _0x556971={};_0x556971[_0xac3679]={'$like':'%'+_0x140e41[_0xb14f('0x32')][_0xb14f('0x3e')]+'%'};return _0x556971;})});}_0x1c1cf4=_[_0xb14f('0x3f')]({},_0x1c1cf4,_0x140e41[_0xb14f('0x40')]);return _0x54ecc9[_0xb14f('0x4c')](_0x1c1cf4);}})[_0xb14f('0x28')](function(_0x2b004d){if(_0x2b004d){_0xf7531d=_0x2b004d[_0xb14f('0x38')];if(!_0x140e41[_0xb14f('0x32')]['hasOwnProperty']('nolimit')){_0x1c1cf4['limit']=qs[_0xb14f('0x21')](_0x140e41[_0xb14f('0x32')]['limit']);_0x1c1cf4[_0xb14f('0x20')]=qs[_0xb14f('0x20')](_0x140e41[_0xb14f('0x32')][_0xb14f('0x20')]);}return _0x54ecc9[_0xb14f('0x4c')](_0x1c1cf4);}})[_0xb14f('0x28')](function(_0x582e9c){if(_0x582e9c){return _0x582e9c?{'count':_0xf7531d,'rows':_0x582e9c}:null;}})[_0xb14f('0x28')](respondWithResult(_0x16de49,null))[_0xb14f('0x44')](handleError(_0x16de49,null));};exports[_0xb14f('0x4f')]=function(_0x1b1bf2,_0x23928f,_0x9a99f4){var _0x4ae3c1={};var _0x33134d={};var _0x564de4;var _0x35515c;return db['DeskConfiguration'][_0xb14f('0x4d')]({'where':{'id':_0x1b1bf2[_0xb14f('0x46')]['id']}})[_0xb14f('0x28')](handleEntityNotFound(_0x23928f,null))[_0xb14f('0x28')](function(_0x5241f2){if(_0x5241f2){_0x564de4=_0x5241f2;_0x33134d[_0xb14f('0x34')]=_['keys'](db[_0xb14f('0x50')][_0xb14f('0x48')]);_0x33134d[_0xb14f('0x32')]=_[_0xb14f('0x31')](_0x1b1bf2[_0xb14f('0x32')]);_0x33134d[_0xb14f('0x33')]=_['intersection'](_0x33134d['model'],_0x33134d['query']);_0x4ae3c1[_0xb14f('0x35')]=_['intersection'](_0x33134d[_0xb14f('0x34')],qs[_0xb14f('0x37')](_0x1b1bf2[_0xb14f('0x32')][_0xb14f('0x37')]));_0x4ae3c1[_0xb14f('0x35')]=_0x4ae3c1[_0xb14f('0x35')][_0xb14f('0x38')]?_0x4ae3c1[_0xb14f('0x35')]:_0x33134d[_0xb14f('0x34')];_0x4ae3c1[_0xb14f('0x4e')]=qs['sort'](_0x1b1bf2['query'][_0xb14f('0x3b')]);_0x4ae3c1['where']=qs[_0xb14f('0x33')](_['pick'](_0x1b1bf2[_0xb14f('0x32')],_0x33134d['filters']));if(_0x1b1bf2[_0xb14f('0x32')][_0xb14f('0x3e')]){_0x4ae3c1[_0xb14f('0x3c')]=_[_0xb14f('0x3f')](_0x4ae3c1[_0xb14f('0x3c')],{'$or':_['map'](_0x4ae3c1['attributes'],function(_0x1d90e3){var _0x1e324d={};_0x1e324d[_0x1d90e3]={'$like':'%'+_0x1b1bf2[_0xb14f('0x32')][_0xb14f('0x3e')]+'%'};return _0x1e324d;})});}_0x4ae3c1=_[_0xb14f('0x3f')]({},_0x4ae3c1,_0x1b1bf2[_0xb14f('0x40')]);return _0x564de4[_0xb14f('0x4f')](_0x4ae3c1);}})[_0xb14f('0x28')](function(_0x15501a){if(_0x15501a){_0x35515c=_0x15501a['length'];if(!_0x1b1bf2['query'][_0xb14f('0x39')](_0xb14f('0x3a'))){_0x4ae3c1[_0xb14f('0x21')]=qs[_0xb14f('0x21')](_0x1b1bf2['query'][_0xb14f('0x21')]);_0x4ae3c1[_0xb14f('0x20')]=qs[_0xb14f('0x20')](_0x1b1bf2[_0xb14f('0x32')]['offset']);}return _0x564de4[_0xb14f('0x4f')](_0x4ae3c1);}})[_0xb14f('0x28')](function(_0x50174c){if(_0x50174c){return _0x50174c?{'count':_0x35515c,'rows':_0x50174c}:null;}})[_0xb14f('0x28')](respondWithResult(_0x23928f,null))['catch'](handleError(_0x23928f,null));};exports[_0xb14f('0x51')]=function(_0x25c2a6,_0x2c681f,_0x46dfe2){var _0x481314={};var _0x49aaa7={};var _0x3817f1;var _0xc5a0b9;return db['DeskConfiguration'][_0xb14f('0x4d')]({'where':{'id':_0x25c2a6[_0xb14f('0x46')]['id']}})[_0xb14f('0x28')](handleEntityNotFound(_0x2c681f,null))[_0xb14f('0x28')](function(_0x190f80){if(_0x190f80){_0x3817f1=_0x190f80;_0x49aaa7[_0xb14f('0x34')]=_[_0xb14f('0x31')](db['DeskField']['rawAttributes']);_0x49aaa7['query']=_[_0xb14f('0x31')](_0x25c2a6[_0xb14f('0x32')]);_0x49aaa7[_0xb14f('0x33')]=_['intersection'](_0x49aaa7[_0xb14f('0x34')],_0x49aaa7[_0xb14f('0x32')]);_0x481314['attributes']=_[_0xb14f('0x36')](_0x49aaa7['model'],qs['fields'](_0x25c2a6[_0xb14f('0x32')][_0xb14f('0x37')]));_0x481314['attributes']=_0x481314['attributes'][_0xb14f('0x38')]?_0x481314[_0xb14f('0x35')]:_0x49aaa7[_0xb14f('0x34')];_0x481314[_0xb14f('0x4e')]=qs[_0xb14f('0x3b')](_0x25c2a6[_0xb14f('0x32')][_0xb14f('0x3b')]);_0x481314[_0xb14f('0x3c')]=qs[_0xb14f('0x33')](_[_0xb14f('0x3d')](_0x25c2a6[_0xb14f('0x32')],_0x49aaa7[_0xb14f('0x33')]));if(_0x25c2a6[_0xb14f('0x32')][_0xb14f('0x3e')]){_0x481314['where']=_[_0xb14f('0x3f')](_0x481314['where'],{'$or':_[_0xb14f('0x2e')](_0x481314[_0xb14f('0x35')],function(_0x312930){var _0x5188da={};_0x5188da[_0x312930]={'$like':'%'+_0x25c2a6['query']['filter']+'%'};return _0x5188da;})});}_0x481314=_[_0xb14f('0x3f')]({},_0x481314,_0x25c2a6[_0xb14f('0x40')]);return _0x3817f1['getDescriptions'](_0x481314);}})[_0xb14f('0x28')](function(_0x1bb93f){if(_0x1bb93f){_0xc5a0b9=_0x1bb93f[_0xb14f('0x38')];if(!_0x25c2a6[_0xb14f('0x32')][_0xb14f('0x39')](_0xb14f('0x3a'))){_0x481314['limit']=qs[_0xb14f('0x21')](_0x25c2a6[_0xb14f('0x32')]['limit']);_0x481314[_0xb14f('0x20')]=qs[_0xb14f('0x20')](_0x25c2a6['query'][_0xb14f('0x20')]);}return _0x3817f1[_0xb14f('0x51')](_0x481314);}})[_0xb14f('0x28')](function(_0x4fbff4){if(_0x4fbff4){return _0x4fbff4?{'count':_0xc5a0b9,'rows':_0x4fbff4}:null;}})['then'](respondWithResult(_0x2c681f,null))['catch'](handleError(_0x2c681f,null));};exports[_0xb14f('0x52')]=function(_0x7a6b03,_0x12a41b,_0x14239a){var _0x880e78={};var _0x4fe20b={};var _0x57af3c;var _0x247798;return db[_0xb14f('0x47')]['findOne']({'where':{'id':_0x7a6b03[_0xb14f('0x46')]['id']}})['then'](handleEntityNotFound(_0x12a41b,null))[_0xb14f('0x28')](function(_0x18503e){if(_0x18503e){_0x57af3c=_0x18503e;_0x4fe20b[_0xb14f('0x34')]=_['keys'](db[_0xb14f('0x53')]['rawAttributes']);_0x4fe20b['query']=_[_0xb14f('0x31')](_0x7a6b03[_0xb14f('0x32')]);_0x4fe20b['filters']=_[_0xb14f('0x36')](_0x4fe20b[_0xb14f('0x34')],_0x4fe20b[_0xb14f('0x32')]);_0x880e78['attributes']=_[_0xb14f('0x36')](_0x4fe20b[_0xb14f('0x34')],qs[_0xb14f('0x37')](_0x7a6b03[_0xb14f('0x32')][_0xb14f('0x37')]));_0x880e78['attributes']=_0x880e78[_0xb14f('0x35')]['length']?_0x880e78['attributes']:_0x4fe20b['model'];_0x880e78['order']=qs[_0xb14f('0x3b')](_0x7a6b03['query'][_0xb14f('0x3b')]);_0x880e78[_0xb14f('0x3c')]=qs[_0xb14f('0x33')](_[_0xb14f('0x3d')](_0x7a6b03['query'],_0x4fe20b[_0xb14f('0x33')]));if(_0x7a6b03[_0xb14f('0x32')][_0xb14f('0x3e')]){_0x880e78[_0xb14f('0x3c')]=_['merge'](_0x880e78[_0xb14f('0x3c')],{'$or':_['map'](_0x880e78['attributes'],function(_0x1f96cc){var _0x167f1f={};_0x167f1f[_0x1f96cc]={'$like':'%'+_0x7a6b03[_0xb14f('0x32')]['filter']+'%'};return _0x167f1f;})});}_0x880e78=_[_0xb14f('0x3f')]({},_0x880e78,_0x7a6b03[_0xb14f('0x40')]);return _0x57af3c[_0xb14f('0x52')](_0x880e78);}})['then'](function(_0x2d8f6f){if(_0x2d8f6f){_0x247798=_0x2d8f6f[_0xb14f('0x38')];if(!_0x7a6b03[_0xb14f('0x32')][_0xb14f('0x39')](_0xb14f('0x3a'))){_0x880e78[_0xb14f('0x21')]=qs[_0xb14f('0x21')](_0x7a6b03[_0xb14f('0x32')][_0xb14f('0x21')]);_0x880e78['offset']=qs['offset'](_0x7a6b03[_0xb14f('0x32')]['offset']);}return _0x57af3c[_0xb14f('0x52')](_0x880e78);}})[_0xb14f('0x28')](function(_0x47ee5c){if(_0x47ee5c){return _0x47ee5c?{'count':_0x247798,'rows':_0x47ee5c}:null;}})[_0xb14f('0x28')](respondWithResult(_0x12a41b,null))[_0xb14f('0x44')](handleError(_0x12a41b,null));};exports[_0xb14f('0x54')]=function(_0x228cf0,_0x36ec32,_0x3374ec){if(_0x228cf0[_0xb14f('0x4b')]['id']){delete _0x228cf0[_0xb14f('0x4b')]['id'];}return db[_0xb14f('0x47')][_0xb14f('0x4d')]({'where':{'id':_0x228cf0[_0xb14f('0x46')]['id']}})['then'](handleEntityNotFound(_0x36ec32,null))['then'](function(_0x2c456a){if(_0x2c456a){return _0x2c456a[_0xb14f('0x54')](_0x228cf0[_0xb14f('0x4b')]['ids']||[]);}return null;})[_0xb14f('0x28')](respondWithResult(_0x36ec32,null))['catch'](handleError(_0x36ec32,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 770ea24..e6219c7 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 _0x40f6=['rimraf','./intDeskConfiguration.attributes','exports','DeskConfiguration','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x193985,_0x52122c){var _0x80f19c=function(_0x106862){while(--_0x106862){_0x193985['push'](_0x193985['shift']());}};_0x80f19c(++_0x52122c);}(_0x40f6,0x1e8));var _0x640f=function(_0x1a735e,_0x1ec37b){_0x1a735e=_0x1a735e-0x0;var _0xdbe2cc=_0x40f6[_0x1a735e];return _0xdbe2cc;};'use strict';var _=require(_0x640f('0x0'));var util=require(_0x640f('0x1'));var logger=require(_0x640f('0x2'))(_0x640f('0x3'));var moment=require(_0x640f('0x4'));var BPromise=require(_0x640f('0x5'));var rp=require(_0x640f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x640f('0x7'));var config=require('../../config/environment');var attributes=require(_0x640f('0x8'));module[_0x640f('0x9')]=function(_0x39bdde,_0x10cec9){return _0x39bdde['define'](_0x640f('0xa'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb9c7=['int_desk_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','define','DeskConfiguration'];(function(_0x510990,_0x5834ef){var _0x130aac=function(_0x45ba06){while(--_0x45ba06){_0x510990['push'](_0x510990['shift']());}};_0x130aac(++_0x5834ef);}(_0xb9c7,0x182));var _0x7b9c=function(_0x21f233,_0x454c36){_0x21f233=_0x21f233-0x0;var _0x51aa20=_0xb9c7[_0x21f233];return _0x51aa20;};'use strict';var _=require('lodash');var util=require(_0x7b9c('0x0'));var logger=require(_0x7b9c('0x1'))(_0x7b9c('0x2'));var moment=require(_0x7b9c('0x3'));var BPromise=require(_0x7b9c('0x4'));var rp=require(_0x7b9c('0x5'));var fs=require('fs');var path=require(_0x7b9c('0x6'));var rimraf=require(_0x7b9c('0x7'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module['exports']=function(_0x1a5ddc,_0x1770f8){return _0x1a5ddc[_0x7b9c('0x8')](_0x7b9c('0x9'),attributes,{'tableName':_0x7b9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 3cc59fc..c0352e3 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 _0x2581=['client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x368e19,_0x2ae452){var _0x1f7658=function(_0x3f2012){while(--_0x3f2012){_0x368e19['push'](_0x368e19['shift']());}};_0x1f7658(++_0x2ae452);}(_0x2581,0x72));var _0x1258=function(_0x2c0f8d,_0x162cd9){_0x2c0f8d=_0x2c0f8d-0x0;var _0x527fcd=_0x2581[_0x2c0f8d];return _0x527fcd;};'use strict';var _=require(_0x1258('0x0'));var util=require(_0x1258('0x1'));var moment=require(_0x1258('0x2'));var BPromise=require(_0x1258('0x3'));var rs=require(_0x1258('0x4'));var fs=require('fs');var Redis=require(_0x1258('0x5'));var db=require(_0x1258('0x6'))['db'];var utils=require(_0x1258('0x7'));var logger=require(_0x1258('0x8'))(_0x1258('0x9'));var config=require('../../config/environment');var jayson=require(_0x1258('0xa'));var client=jayson[_0x1258('0xb')][_0x1258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b2472,_0x2a9cd3,_0x21ad5b){return new BPromise(function(_0x21a94f,_0x251539){return client[_0x1258('0xd')](_0x1b2472,_0x21ad5b)[_0x1258('0xe')](function(_0x5574ea){logger[_0x1258('0xf')](_0x1258('0x10'),_0x2a9cd3,_0x1258('0x11'));logger[_0x1258('0x12')](_0x1258('0x13'),_0x2a9cd3,'request\x20sent',JSON['stringify'](_0x5574ea));if(_0x5574ea['error']){if(_0x5574ea[_0x1258('0x14')][_0x1258('0x15')]===0x1f4){logger[_0x1258('0x14')](_0x1258('0x10'),_0x2a9cd3,_0x5574ea[_0x1258('0x14')]['message']);return _0x251539(_0x5574ea[_0x1258('0x14')][_0x1258('0x16')]);}logger['error'](_0x1258('0x10'),_0x2a9cd3,_0x5574ea[_0x1258('0x14')][_0x1258('0x16')]);return _0x21a94f(_0x5574ea[_0x1258('0x14')][_0x1258('0x16')]);}else{logger['info'](_0x1258('0x10'),_0x2a9cd3,_0x1258('0x11'));_0x21a94f(_0x5574ea[_0x1258('0x17')][_0x1258('0x16')]);}})[_0x1258('0x18')](function(_0x471586){logger['error'](_0x1258('0x10'),_0x2a9cd3,_0x471586);_0x251539(_0x471586);});});} \ No newline at end of file +var _0xcdc2=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','DeskConfiguration,\x20%s,\x20%s','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0xbce261,_0x5bf87e){var _0x23848f=function(_0x582169){while(--_0x582169){_0xbce261['push'](_0xbce261['shift']());}};_0x23848f(++_0x5bf87e);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x153411,_0x2c4286){_0x153411=_0x153411-0x0;var _0x255992=_0xcdc2[_0x153411];return _0x255992;};'use strict';var _=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var moment=require(_0x2cdc('0x2'));var BPromise=require(_0x2cdc('0x3'));var rs=require(_0x2cdc('0x4'));var fs=require('fs');var Redis=require(_0x2cdc('0x5'));var db=require(_0x2cdc('0x6'))['db'];var utils=require(_0x2cdc('0x7'));var logger=require(_0x2cdc('0x8'))(_0x2cdc('0x9'));var config=require(_0x2cdc('0xa'));var jayson=require(_0x2cdc('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10b817,_0x54e717,_0x17f9f4){return new BPromise(function(_0x35a1d0,_0x393327){return client['request'](_0x10b817,_0x17f9f4)[_0x2cdc('0xc')](function(_0x51e6e7){logger['info'](_0x2cdc('0xd'),_0x54e717,'request\x20sent');logger['debug'](_0x2cdc('0xe'),_0x54e717,'request\x20sent',JSON[_0x2cdc('0xf')](_0x51e6e7));if(_0x51e6e7[_0x2cdc('0x10')]){if(_0x51e6e7[_0x2cdc('0x10')]['code']===0x1f4){logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x54e717,_0x51e6e7['error']['message']);return _0x393327(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x51e6e7['error']['message']);return _0x35a1d0(_0x51e6e7[_0x2cdc('0x10')][_0x2cdc('0x11')]);}else{logger[_0x2cdc('0x12')](_0x2cdc('0xd'),_0x54e717,'request\x20sent');_0x35a1d0(_0x51e6e7['result'][_0x2cdc('0x11')]);}})[_0x2cdc('0x13')](function(_0x2a60d2){logger[_0x2cdc('0x10')](_0x2cdc('0xd'),_0x54e717,_0x2a60d2);_0x393327(_0x2a60d2);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index a3683a5..7919cb9 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 _0x7764=['../../components/auth/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x36d20f,_0x133196){var _0x324a71=function(_0x2153b3){while(--_0x2153b3){_0x36d20f['push'](_0x36d20f['shift']());}};_0x324a71(++_0x133196);}(_0x7764,0x120));var _0x4776=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0x7764[_0x5b78e8];return _0xf2c321;};'use strict';var multer=require(_0x4776('0x0'));var util=require(_0x4776('0x1'));var path=require(_0x4776('0x2'));var timeout=require(_0x4776('0x3'));var express=require(_0x4776('0x4'));var router=express[_0x4776('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x4776('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4776('0x7'));var controller=require(_0x4776('0x8'));router[_0x4776('0x9')]('/',auth[_0x4776('0xa')](),controller[_0x4776('0xb')]);router[_0x4776('0x9')]('/:id',auth[_0x4776('0xa')](),controller[_0x4776('0xc')]);router[_0x4776('0xd')]('/',auth[_0x4776('0xa')](),controller[_0x4776('0xe')]);router[_0x4776('0xf')](_0x4776('0x10'),auth['isAuthenticated'](),controller[_0x4776('0x11')]);router[_0x4776('0x12')](_0x4776('0x10'),auth[_0x4776('0xa')](),controller[_0x4776('0x13')]);module[_0x4776('0x14')]=router; \ No newline at end of file +var _0xf8fb=['index','show','post','create','put','/:id','update','delete','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated'];(function(_0x13b392,_0x3481f2){var _0x39db24=function(_0xab91e5){while(--_0xab91e5){_0x13b392['push'](_0x13b392['shift']());}};_0x39db24(++_0x3481f2);}(_0xf8fb,0x184));var _0xbf8f=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xf8fb[_0xfae23b];return _0x200640;};'use strict';var multer=require(_0xbf8f('0x0'));var util=require('util');var path=require(_0xbf8f('0x1'));var timeout=require(_0xbf8f('0x2'));var express=require(_0xbf8f('0x3'));var router=express[_0xbf8f('0x4')]();var fs_extra=require(_0xbf8f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf8f('0x6'));var config=require(_0xbf8f('0x7'));var controller=require(_0xbf8f('0x8'));router[_0xbf8f('0x9')]('/',auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xb')]);router[_0xbf8f('0x9')]('/:id',auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xc')]);router[_0xbf8f('0xd')]('/',auth[_0xbf8f('0xa')](),controller[_0xbf8f('0xe')]);router[_0xbf8f('0xf')](_0xbf8f('0x10'),auth[_0xbf8f('0xa')](),controller[_0xbf8f('0x11')]);router[_0xbf8f('0x12')](_0xbf8f('0x10'),auth[_0xbf8f('0xa')](),controller['destroy']);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 0c7f455..393812b 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 _0x189d=['picklist','string','STRING','customVariable','BOOLEAN','sequelize','ENUM','variable','keyValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x189d,0x83));var _0xd189=function(_0x511577,_0x2ec0cf){_0x511577=_0x511577-0x0;var _0x1b9201=_0x189d[_0x511577];return _0x1b9201;};'use strict';var Sequelize=require(_0xd189('0x0'));module['exports']={'type':{'type':Sequelize[_0xd189('0x1')]('string',_0xd189('0x2'),'customVariable',_0xd189('0x3'),_0xd189('0x4')),'defaultValue':_0xd189('0x5')},'content':{'type':Sequelize[_0xd189('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string',_0xd189('0x2'),_0xd189('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xd189('0x6')]},'customField':{'type':Sequelize[_0xd189('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd189('0x6')]}}; \ No newline at end of file +var _0xbf75=['ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x1ca560,_0x556697){var _0x92d541=function(_0x1808ae){while(--_0x1808ae){_0x1ca560['push'](_0x1ca560['shift']());}};_0x92d541(++_0x556697);}(_0xbf75,0x76));var _0x5bf7=function(_0x2576d7,_0x167624){_0x2576d7=_0x2576d7-0x0;var _0x16a08c=_0xbf75[_0x2576d7];return _0x16a08c;};'use strict';var Sequelize=require(_0x5bf7('0x0'));module['exports']={'type':{'type':Sequelize[_0x5bf7('0x1')](_0x5bf7('0x2'),_0x5bf7('0x3'),_0x5bf7('0x4'),'keyValue','picklist'),'defaultValue':_0x5bf7('0x2')},'content':{'type':Sequelize[_0x5bf7('0x5')]},'key':{'type':Sequelize[_0x5bf7('0x5')]},'keyType':{'type':Sequelize[_0x5bf7('0x1')](_0x5bf7('0x2'),_0x5bf7('0x3'),_0x5bf7('0x4'))},'keyContent':{'type':Sequelize[_0x5bf7('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x5bf7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 1aaceff..99109d4 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 _0x015e=['moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','options','includeAll','include','DeskField','findAll','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4348bc,_0x2982a1){var _0x33d10b=function(_0x423c26){while(--_0x423c26){_0x4348bc['push'](_0x4348bc['shift']());}};_0x33d10b(++_0x2982a1);}(_0x015e,0x138));var _0xe015=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0x015e[_0xd09668];return _0x68726;};'use strict';var emlformat=require(_0xe015('0x0'));var rimraf=require(_0xe015('0x1'));var zipdir=require(_0xe015('0x2'));var jsonpatch=require(_0xe015('0x3'));var rp=require('request-promise');var moment=require(_0xe015('0x4'));var BPromise=require(_0xe015('0x5'));var Mustache=require(_0xe015('0x6'));var util=require(_0xe015('0x7'));var path=require(_0xe015('0x8'));var sox=require(_0xe015('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe015('0xa'));var _=require(_0xe015('0xb'));var squel=require(_0xe015('0xc'));var crypto=require(_0xe015('0xd'));var jsforce=require(_0xe015('0xe'));var deskjs=require(_0xe015('0xf'));var toCsv=require(_0xe015('0x10'));var querystring=require(_0xe015('0x11'));var Papa=require(_0xe015('0x12'));var Redis=require(_0xe015('0x13'));var authService=require(_0xe015('0x14'));var qs=require(_0xe015('0x15'));var as=require(_0xe015('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe015('0x17'))(_0xe015('0x18'));var utils=require(_0xe015('0x19'));var config=require(_0xe015('0x1a'));var licenseUtil=require(_0xe015('0x1b'));var db=require(_0xe015('0x1c'))['db'];function respondWithStatusCode(_0x24df8e,_0x1db5b4){_0x1db5b4=_0x1db5b4||0xcc;return function(_0xfa23bf){if(_0xfa23bf){return _0x24df8e[_0xe015('0x1d')](_0x1db5b4);}return _0x24df8e['status'](_0x1db5b4)[_0xe015('0x1e')]();};}function respondWithResult(_0x5763bf,_0x3c1ff6){_0x3c1ff6=_0x3c1ff6||0xc8;return function(_0x2f599e){if(_0x2f599e){return _0x5763bf[_0xe015('0x1f')](_0x3c1ff6)[_0xe015('0x20')](_0x2f599e);}};}function respondWithFilteredResult(_0x496fbe,_0x1372db){return function(_0x372337){if(_0x372337){var _0xdbcfe=typeof _0x1372db[_0xe015('0x21')]===_0xe015('0x22')&&typeof _0x1372db[_0xe015('0x23')]===_0xe015('0x22');var _0x123271=_0x372337[_0xe015('0x24')];var _0x1f2ab8=_0xdbcfe?0x0:_0x1372db[_0xe015('0x21')];var _0x802c67=_0xdbcfe?_0x372337[_0xe015('0x24')]:_0x1372db[_0xe015('0x21')]+_0x1372db[_0xe015('0x23')];var _0x46fc00;if(_0x802c67>=_0x123271){_0x802c67=_0x123271;_0x46fc00=0xc8;}else{_0x46fc00=0xce;}_0x496fbe[_0xe015('0x1f')](_0x46fc00);return _0x496fbe[_0xe015('0x25')]('Content-Range',_0x1f2ab8+'-'+_0x802c67+'/'+_0x123271)['json'](_0x372337);}return null;};}function patchUpdates(_0x537ee0){return function(_0x1ee28b){try{jsonpatch[_0xe015('0x26')](_0x1ee28b,_0x537ee0,!![]);}catch(_0x4c8350){return BPromise[_0xe015('0x27')](_0x4c8350);}return _0x1ee28b[_0xe015('0x28')]();};}function saveUpdates(_0x532a24,_0xb8b644){return function(_0x39d370){if(_0x39d370){return _0x39d370['update'](_0x532a24)['then'](function(_0x431d15){return _0x431d15;});}return null;};}function removeEntity(_0x3055bc,_0x265867){return function(_0x498a2a){if(_0x498a2a){return _0x498a2a[_0xe015('0x29')]()[_0xe015('0x2a')](function(){_0x3055bc[_0xe015('0x1f')](0xcc)[_0xe015('0x1e')]();});}};}function handleEntityNotFound(_0x3344ba,_0x1d8562){return function(_0x248bd2){if(!_0x248bd2){_0x3344ba[_0xe015('0x1d')](0x194);}return _0x248bd2;};}function handleError(_0x290e10,_0x3cdf97){_0x3cdf97=_0x3cdf97||0x1f4;return function(_0x42b67e){logger[_0xe015('0x2b')](_0x42b67e[_0xe015('0x2c')]);if(_0x42b67e[_0xe015('0x2d')]){delete _0x42b67e[_0xe015('0x2d')];}_0x290e10['status'](_0x3cdf97)['send'](_0x42b67e);};}exports[_0xe015('0x2e')]=function(_0x5d10df,_0x739050){var _0x2446d9={},_0x1e90b5={},_0x4031a6={'count':0x0,'rows':[]};var _0x1d7646=_[_0xe015('0x2f')](db['DeskField'][_0xe015('0x30')],function(_0x3127b8){return{'name':_0x3127b8[_0xe015('0x31')],'type':_0x3127b8[_0xe015('0x32')][_0xe015('0x33')]};});_0x1e90b5[_0xe015('0x34')]=_[_0xe015('0x2f')](_0x1d7646,_0xe015('0x2d'));_0x1e90b5[_0xe015('0x35')]=_[_0xe015('0x36')](_0x5d10df[_0xe015('0x35')]);_0x1e90b5[_0xe015('0x37')]=_[_0xe015('0x38')](_0x1e90b5[_0xe015('0x34')],_0x1e90b5['query']);_0x2446d9[_0xe015('0x39')]=_['intersection'](_0x1e90b5['model'],qs[_0xe015('0x3a')](_0x5d10df[_0xe015('0x35')][_0xe015('0x3a')]));_0x2446d9[_0xe015('0x39')]=_0x2446d9[_0xe015('0x39')][_0xe015('0x3b')]?_0x2446d9[_0xe015('0x39')]:_0x1e90b5[_0xe015('0x34')];if(!_0x5d10df[_0xe015('0x35')][_0xe015('0x3c')](_0xe015('0x3d'))){_0x2446d9['limit']=qs[_0xe015('0x23')](_0x5d10df[_0xe015('0x35')]['limit']);_0x2446d9[_0xe015('0x21')]=qs[_0xe015('0x21')](_0x5d10df[_0xe015('0x35')]['offset']);}_0x2446d9['order']=qs['sort'](_0x5d10df[_0xe015('0x35')]['sort']);_0x2446d9['where']=qs[_0xe015('0x37')](_[_0xe015('0x3e')](_0x5d10df[_0xe015('0x35')],_0x1e90b5[_0xe015('0x37')]),_0x1d7646);if(_0x5d10df['query'][_0xe015('0x3f')]){_0x2446d9[_0xe015('0x40')]=_['merge'](_0x2446d9[_0xe015('0x40')],{'$or':_[_0xe015('0x2f')](_0x1d7646,function(_0x3e454a){if(_0x3e454a[_0xe015('0x32')]!==_0xe015('0x41')){var _0x424582={};_0x424582[_0x3e454a[_0xe015('0x2d')]]={'$like':'%'+_0x5d10df[_0xe015('0x35')][_0xe015('0x3f')]+'%'};return _0x424582;}})});}_0x2446d9=_[_0xe015('0x42')]({},_0x2446d9,_0x5d10df[_0xe015('0x43')]);var _0x56cb68={'where':_0x2446d9[_0xe015('0x40')]};return db['DeskField']['count'](_0x56cb68)['then'](function(_0x15ee8c){_0x4031a6['count']=_0x15ee8c;if(_0x5d10df[_0xe015('0x35')][_0xe015('0x44')]){_0x2446d9[_0xe015('0x45')]=[{'all':!![]}];}return db[_0xe015('0x46')][_0xe015('0x47')](_0x2446d9);})[_0xe015('0x2a')](function(_0x4607a9){_0x4031a6['rows']=_0x4607a9;return _0x4031a6;})[_0xe015('0x2a')](respondWithFilteredResult(_0x739050,_0x2446d9))[_0xe015('0x48')](handleError(_0x739050,null));};exports[_0xe015('0x49')]=function(_0x49991f,_0x3d35d8){var _0x1b0106={'raw':!![],'where':{'id':_0x49991f[_0xe015('0x4a')]['id']}},_0x442737={};_0x442737['model']=_[_0xe015('0x36')](db[_0xe015('0x46')][_0xe015('0x30')]);_0x442737[_0xe015('0x35')]=_[_0xe015('0x36')](_0x49991f[_0xe015('0x35')]);_0x442737[_0xe015('0x37')]=_[_0xe015('0x38')](_0x442737['model'],_0x442737[_0xe015('0x35')]);_0x1b0106[_0xe015('0x39')]=_[_0xe015('0x38')](_0x442737[_0xe015('0x34')],qs[_0xe015('0x3a')](_0x49991f[_0xe015('0x35')][_0xe015('0x3a')]));_0x1b0106['attributes']=_0x1b0106[_0xe015('0x39')][_0xe015('0x3b')]?_0x1b0106[_0xe015('0x39')]:_0x442737[_0xe015('0x34')];if(_0x49991f['query']['includeAll']){_0x1b0106[_0xe015('0x45')]=[{'all':!![]}];}_0x1b0106=_[_0xe015('0x42')]({},_0x1b0106,_0x49991f['options']);return db[_0xe015('0x46')][_0xe015('0x4b')](_0x1b0106)['then'](handleEntityNotFound(_0x3d35d8,null))['then'](respondWithResult(_0x3d35d8,null))[_0xe015('0x48')](handleError(_0x3d35d8,null));};exports['create']=function(_0x5b75d9,_0x36f55c){return db['DeskField'][_0xe015('0x4c')](_0x5b75d9[_0xe015('0x4d')],{})['then'](respondWithResult(_0x36f55c,0xc9))[_0xe015('0x48')](handleError(_0x36f55c,null));};exports[_0xe015('0x4e')]=function(_0x215adc,_0x19a5ae){if(_0x215adc[_0xe015('0x4d')]['id']){delete _0x215adc[_0xe015('0x4d')]['id'];}return db[_0xe015('0x46')]['find']({'where':{'id':_0x215adc[_0xe015('0x4a')]['id']}})[_0xe015('0x2a')](handleEntityNotFound(_0x19a5ae,null))[_0xe015('0x2a')](saveUpdates(_0x215adc['body'],null))[_0xe015('0x2a')](respondWithResult(_0x19a5ae,null))[_0xe015('0x48')](handleError(_0x19a5ae,null));};exports[_0xe015('0x29')]=function(_0x202bbb,_0x59b9ce){return db['DeskField'][_0xe015('0x4b')]({'where':{'id':_0x202bbb[_0xe015('0x4a')]['id']}})['then'](handleEntityNotFound(_0x59b9ce,null))[_0xe015('0x2a')](removeEntity(_0x59b9ce,null))[_0xe015('0x48')](handleError(_0x59b9ce,null));}; \ No newline at end of file +var _0xcc0b=['stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','DeskField','findAll','rows','show','params','keys','find','catch','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error'];(function(_0x57c0ce,_0x474c01){var _0x56160f=function(_0x40686b){while(--_0x40686b){_0x57c0ce['push'](_0x57c0ce['shift']());}};_0x56160f(++_0x474c01);}(_0xcc0b,0xc0));var _0xbcc0=function(_0x24403d,_0x94ebf1){_0x24403d=_0x24403d-0x0;var _0x3fabf3=_0xcc0b[_0x24403d];return _0x3fabf3;};'use strict';var emlformat=require(_0xbcc0('0x0'));var rimraf=require(_0xbcc0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbcc0('0x2'));var rp=require(_0xbcc0('0x3'));var moment=require(_0xbcc0('0x4'));var BPromise=require(_0xbcc0('0x5'));var Mustache=require(_0xbcc0('0x6'));var util=require('util');var path=require(_0xbcc0('0x7'));var sox=require(_0xbcc0('0x8'));var csv=require('to-csv');var ejs=require(_0xbcc0('0x9'));var fs=require('fs');var fs_extra=require(_0xbcc0('0xa'));var _=require(_0xbcc0('0xb'));var squel=require(_0xbcc0('0xc'));var crypto=require(_0xbcc0('0xd'));var jsforce=require(_0xbcc0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbcc0('0xf'));var querystring=require(_0xbcc0('0x10'));var Papa=require(_0xbcc0('0x11'));var Redis=require(_0xbcc0('0x12'));var authService=require(_0xbcc0('0x13'));var qs=require(_0xbcc0('0x14'));var as=require(_0xbcc0('0x15'));var hardwareService=require(_0xbcc0('0x16'));var logger=require(_0xbcc0('0x17'))(_0xbcc0('0x18'));var utils=require(_0xbcc0('0x19'));var config=require(_0xbcc0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xbcc0('0x1b'))['db'];function respondWithStatusCode(_0x49c03e,_0x5218b2){_0x5218b2=_0x5218b2||0xcc;return function(_0x382f3a){if(_0x382f3a){return _0x49c03e[_0xbcc0('0x1c')](_0x5218b2);}return _0x49c03e[_0xbcc0('0x1d')](_0x5218b2)[_0xbcc0('0x1e')]();};}function respondWithResult(_0x45c134,_0x1c4ab5){_0x1c4ab5=_0x1c4ab5||0xc8;return function(_0x5aa320){if(_0x5aa320){return _0x45c134[_0xbcc0('0x1d')](_0x1c4ab5)['json'](_0x5aa320);}};}function respondWithFilteredResult(_0x3a9dc7,_0x5432c1){return function(_0x4e7768){if(_0x4e7768){var _0x994a92=typeof _0x5432c1[_0xbcc0('0x1f')]===_0xbcc0('0x20')&&typeof _0x5432c1['limit']===_0xbcc0('0x20');var _0x4ee2ca=_0x4e7768[_0xbcc0('0x21')];var _0xab7fbe=_0x994a92?0x0:_0x5432c1[_0xbcc0('0x1f')];var _0x43a670=_0x994a92?_0x4e7768[_0xbcc0('0x21')]:_0x5432c1[_0xbcc0('0x1f')]+_0x5432c1[_0xbcc0('0x22')];var _0x320646;if(_0x43a670>=_0x4ee2ca){_0x43a670=_0x4ee2ca;_0x320646=0xc8;}else{_0x320646=0xce;}_0x3a9dc7[_0xbcc0('0x1d')](_0x320646);return _0x3a9dc7[_0xbcc0('0x23')](_0xbcc0('0x24'),_0xab7fbe+'-'+_0x43a670+'/'+_0x4ee2ca)[_0xbcc0('0x25')](_0x4e7768);}return null;};}function patchUpdates(_0x3d0dee){return function(_0x1ca6ea){try{jsonpatch[_0xbcc0('0x26')](_0x1ca6ea,_0x3d0dee,!![]);}catch(_0xbed373){return BPromise[_0xbcc0('0x27')](_0xbed373);}return _0x1ca6ea[_0xbcc0('0x28')]();};}function saveUpdates(_0x5b868f,_0x2a453f){return function(_0x2e051c){if(_0x2e051c){return _0x2e051c[_0xbcc0('0x29')](_0x5b868f)['then'](function(_0x4cc54b){return _0x4cc54b;});}return null;};}function removeEntity(_0x205c1a,_0x257e88){return function(_0x4d4ace){if(_0x4d4ace){return _0x4d4ace[_0xbcc0('0x2a')]()[_0xbcc0('0x2b')](function(){_0x205c1a[_0xbcc0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x524164,_0x5c1e0a){return function(_0x431883){if(!_0x431883){_0x524164[_0xbcc0('0x1c')](0x194);}return _0x431883;};}function handleError(_0x276638,_0x13a011){_0x13a011=_0x13a011||0x1f4;return function(_0x344375){logger[_0xbcc0('0x2c')](_0x344375[_0xbcc0('0x2d')]);if(_0x344375[_0xbcc0('0x2e')]){delete _0x344375[_0xbcc0('0x2e')];}_0x276638[_0xbcc0('0x1d')](_0x13a011)['send'](_0x344375);};}exports[_0xbcc0('0x2f')]=function(_0x26d5cd,_0x547d14){var _0x210aa9={},_0x2331e3={},_0x3013c4={'count':0x0,'rows':[]};var _0x1dbb50=_[_0xbcc0('0x30')](db['DeskField'][_0xbcc0('0x31')],function(_0xc1134e){return{'name':_0xc1134e['fieldName'],'type':_0xc1134e[_0xbcc0('0x32')][_0xbcc0('0x33')]};});_0x2331e3[_0xbcc0('0x34')]=_['map'](_0x1dbb50,_0xbcc0('0x2e'));_0x2331e3['query']=_['keys'](_0x26d5cd[_0xbcc0('0x35')]);_0x2331e3[_0xbcc0('0x36')]=_[_0xbcc0('0x37')](_0x2331e3[_0xbcc0('0x34')],_0x2331e3[_0xbcc0('0x35')]);_0x210aa9[_0xbcc0('0x38')]=_[_0xbcc0('0x37')](_0x2331e3[_0xbcc0('0x34')],qs['fields'](_0x26d5cd['query'][_0xbcc0('0x39')]));_0x210aa9[_0xbcc0('0x38')]=_0x210aa9['attributes'][_0xbcc0('0x3a')]?_0x210aa9[_0xbcc0('0x38')]:_0x2331e3['model'];if(!_0x26d5cd[_0xbcc0('0x35')][_0xbcc0('0x3b')](_0xbcc0('0x3c'))){_0x210aa9[_0xbcc0('0x22')]=qs[_0xbcc0('0x22')](_0x26d5cd[_0xbcc0('0x35')][_0xbcc0('0x22')]);_0x210aa9[_0xbcc0('0x1f')]=qs[_0xbcc0('0x1f')](_0x26d5cd[_0xbcc0('0x35')][_0xbcc0('0x1f')]);}_0x210aa9['order']=qs[_0xbcc0('0x3d')](_0x26d5cd[_0xbcc0('0x35')]['sort']);_0x210aa9[_0xbcc0('0x3e')]=qs[_0xbcc0('0x36')](_[_0xbcc0('0x3f')](_0x26d5cd[_0xbcc0('0x35')],_0x2331e3[_0xbcc0('0x36')]),_0x1dbb50);if(_0x26d5cd[_0xbcc0('0x35')][_0xbcc0('0x40')]){_0x210aa9[_0xbcc0('0x3e')]=_[_0xbcc0('0x41')](_0x210aa9[_0xbcc0('0x3e')],{'$or':_[_0xbcc0('0x30')](_0x1dbb50,function(_0x406988){if(_0x406988[_0xbcc0('0x32')]!==_0xbcc0('0x42')){var _0xb565ca={};_0xb565ca[_0x406988['name']]={'$like':'%'+_0x26d5cd['query']['filter']+'%'};return _0xb565ca;}})});}_0x210aa9=_['merge']({},_0x210aa9,_0x26d5cd[_0xbcc0('0x43')]);var _0x1ce959={'where':_0x210aa9[_0xbcc0('0x3e')]};return db['DeskField'][_0xbcc0('0x21')](_0x1ce959)['then'](function(_0x399b15){_0x3013c4[_0xbcc0('0x21')]=_0x399b15;if(_0x26d5cd[_0xbcc0('0x35')][_0xbcc0('0x44')]){_0x210aa9['include']=[{'all':!![]}];}return db[_0xbcc0('0x45')][_0xbcc0('0x46')](_0x210aa9);})[_0xbcc0('0x2b')](function(_0x4ff8f4){_0x3013c4[_0xbcc0('0x47')]=_0x4ff8f4;return _0x3013c4;})['then'](respondWithFilteredResult(_0x547d14,_0x210aa9))['catch'](handleError(_0x547d14,null));};exports[_0xbcc0('0x48')]=function(_0x51acf5,_0x5d3126){var _0x26ecfd={'raw':!![],'where':{'id':_0x51acf5[_0xbcc0('0x49')]['id']}},_0x93eef3={};_0x93eef3['model']=_[_0xbcc0('0x4a')](db[_0xbcc0('0x45')][_0xbcc0('0x31')]);_0x93eef3[_0xbcc0('0x35')]=_[_0xbcc0('0x4a')](_0x51acf5[_0xbcc0('0x35')]);_0x93eef3[_0xbcc0('0x36')]=_[_0xbcc0('0x37')](_0x93eef3[_0xbcc0('0x34')],_0x93eef3[_0xbcc0('0x35')]);_0x26ecfd[_0xbcc0('0x38')]=_[_0xbcc0('0x37')](_0x93eef3[_0xbcc0('0x34')],qs[_0xbcc0('0x39')](_0x51acf5['query'][_0xbcc0('0x39')]));_0x26ecfd[_0xbcc0('0x38')]=_0x26ecfd['attributes'][_0xbcc0('0x3a')]?_0x26ecfd[_0xbcc0('0x38')]:_0x93eef3['model'];if(_0x51acf5[_0xbcc0('0x35')][_0xbcc0('0x44')]){_0x26ecfd['include']=[{'all':!![]}];}_0x26ecfd=_[_0xbcc0('0x41')]({},_0x26ecfd,_0x51acf5[_0xbcc0('0x43')]);return db[_0xbcc0('0x45')][_0xbcc0('0x4b')](_0x26ecfd)[_0xbcc0('0x2b')](handleEntityNotFound(_0x5d3126,null))[_0xbcc0('0x2b')](respondWithResult(_0x5d3126,null))[_0xbcc0('0x4c')](handleError(_0x5d3126,null));};exports[_0xbcc0('0x4d')]=function(_0x587730,_0x2dcf41){return db[_0xbcc0('0x45')][_0xbcc0('0x4d')](_0x587730[_0xbcc0('0x4e')],{})['then'](respondWithResult(_0x2dcf41,0xc9))['catch'](handleError(_0x2dcf41,null));};exports[_0xbcc0('0x29')]=function(_0x3edb98,_0x2fd4c5){if(_0x3edb98['body']['id']){delete _0x3edb98['body']['id'];}return db['DeskField']['find']({'where':{'id':_0x3edb98['params']['id']}})[_0xbcc0('0x2b')](handleEntityNotFound(_0x2fd4c5,null))[_0xbcc0('0x2b')](saveUpdates(_0x3edb98['body'],null))[_0xbcc0('0x2b')](respondWithResult(_0x2fd4c5,null))['catch'](handleError(_0x2fd4c5,null));};exports['destroy']=function(_0x540f0f,_0x4edf3e){return db['DeskField'][_0xbcc0('0x4b')]({'where':{'id':_0x540f0f[_0xbcc0('0x49')]['id']}})['then'](handleEntityNotFound(_0x4edf3e,null))[_0xbcc0('0x2b')](removeEntity(_0x4edf3e,null))[_0xbcc0('0x4c')](handleError(_0x4edf3e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 6bc1971..1af8cdf 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 _0x4996=['./intDeskField.attributes','define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3a6a95,_0x56692d){var _0xe06718=function(_0x37893b){while(--_0x37893b){_0x3a6a95['push'](_0x3a6a95['shift']());}};_0xe06718(++_0x56692d);}(_0x4996,0x12d));var _0x6499=function(_0x27a5bb,_0x3f4cfb){_0x27a5bb=_0x27a5bb-0x0;var _0x2e17ea=_0x4996[_0x27a5bb];return _0x2e17ea;};'use strict';var _=require(_0x6499('0x0'));var util=require('util');var logger=require(_0x6499('0x1'))(_0x6499('0x2'));var moment=require(_0x6499('0x3'));var BPromise=require('bluebird');var rp=require(_0x6499('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6499('0x5'));var config=require(_0x6499('0x6'));var attributes=require(_0x6499('0x7'));module['exports']=function(_0x4783aa,_0x39cad7){return _0x4783aa[_0x6499('0x8')](_0x6499('0x9'),attributes,{'tableName':_0x6499('0xa'),'paranoid':![],'indexes':[{'name':_0x6499('0xb'),'fields':[_0x6499('0xc'),_0x6499('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa02a=['exports','define','DeskField','int_desk_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x54eab6,_0x5e262f){var _0x1e7435=function(_0x468c91){while(--_0x468c91){_0x54eab6['push'](_0x54eab6['shift']());}};_0x1e7435(++_0x5e262f);}(_0xa02a,0xc9));var _0xaa02=function(_0x4f895d,_0x1a139c){_0x4f895d=_0x4f895d-0x0;var _0x4bb497=_0xa02a[_0x4f895d];return _0x4bb497;};'use strict';var _=require(_0xaa02('0x0'));var util=require(_0xaa02('0x1'));var logger=require(_0xaa02('0x2'))('api');var moment=require(_0xaa02('0x3'));var BPromise=require(_0xaa02('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa02('0x5'));var rimraf=require(_0xaa02('0x6'));var config=require(_0xaa02('0x7'));var attributes=require(_0xaa02('0x8'));module[_0xaa02('0x9')]=function(_0x279314,_0x78a5f9){return _0x279314[_0xaa02('0xa')](_0xaa02('0xb'),attributes,{'tableName':_0xaa02('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xaa02('0xd'),'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 c74dafc..45a1e0c 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 _0x5ceb=['error','code','DeskField,\x20%s,\x20%s','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x2a390b,_0xf49f9b){var _0x5df10a=function(_0x115dbe){while(--_0x115dbe){_0x2a390b['push'](_0x2a390b['shift']());}};_0x5df10a(++_0xf49f9b);}(_0x5ceb,0x96));var _0xb5ce=function(_0x872b02,_0x4f4458){_0x872b02=_0x872b02-0x0;var _0x1a6b24=_0x5ceb[_0x872b02];return _0x1a6b24;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb5ce('0x0'));var BPromise=require(_0xb5ce('0x1'));var rs=require(_0xb5ce('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb5ce('0x3'))['db'];var utils=require(_0xb5ce('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xb5ce('0x5'));var jayson=require(_0xb5ce('0x6'));var client=jayson[_0xb5ce('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x458f98,_0x96dc39,_0x2b9bb5){return new BPromise(function(_0x400e72,_0x5a3096){return client[_0xb5ce('0x8')](_0x458f98,_0x2b9bb5)[_0xb5ce('0x9')](function(_0x18f7f0){logger[_0xb5ce('0xa')]('DeskField,\x20%s,\x20%s',_0x96dc39,_0xb5ce('0xb'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x96dc39,_0xb5ce('0xb'),JSON['stringify'](_0x18f7f0));if(_0x18f7f0[_0xb5ce('0xc')]){if(_0x18f7f0[_0xb5ce('0xc')][_0xb5ce('0xd')]===0x1f4){logger['error'](_0xb5ce('0xe'),_0x96dc39,_0x18f7f0[_0xb5ce('0xc')][_0xb5ce('0xf')]);return _0x5a3096(_0x18f7f0[_0xb5ce('0xc')][_0xb5ce('0xf')]);}logger[_0xb5ce('0xc')]('DeskField,\x20%s,\x20%s',_0x96dc39,_0x18f7f0['error']['message']);return _0x400e72(_0x18f7f0['error'][_0xb5ce('0xf')]);}else{logger[_0xb5ce('0xa')](_0xb5ce('0xe'),_0x96dc39,'request\x20sent');_0x400e72(_0x18f7f0[_0xb5ce('0x10')][_0xb5ce('0xf')]);}})[_0xb5ce('0x11')](function(_0x5a102c){logger[_0xb5ce('0xc')]('DeskField,\x20%s,\x20%s',_0x96dc39,_0x5a102c);_0x5a3096(_0x5a102c);});});} \ No newline at end of file +var _0x8a5a=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0xe7fcc5,_0x3ec043){var _0x236d9b=function(_0x37b4e6){while(--_0x37b4e6){_0xe7fcc5['push'](_0xe7fcc5['shift']());}};_0x236d9b(++_0x3ec043);}(_0x8a5a,0xcb));var _0xa8a5=function(_0x1d74fd,_0x3e55e9){_0x1d74fd=_0x1d74fd-0x0;var _0x304d1f=_0x8a5a[_0x1d74fd];return _0x304d1f;};'use strict';var _=require(_0xa8a5('0x0'));var util=require(_0xa8a5('0x1'));var moment=require(_0xa8a5('0x2'));var BPromise=require(_0xa8a5('0x3'));var rs=require(_0xa8a5('0x4'));var fs=require('fs');var Redis=require(_0xa8a5('0x5'));var db=require(_0xa8a5('0x6'))['db'];var utils=require(_0xa8a5('0x7'));var logger=require(_0xa8a5('0x8'))(_0xa8a5('0x9'));var config=require(_0xa8a5('0xa'));var jayson=require(_0xa8a5('0xb'));var client=jayson[_0xa8a5('0xc')][_0xa8a5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5a2a89,_0x19427d,_0xa56ad5){return new BPromise(function(_0x2cfb42,_0x4197bb){return client['request'](_0x5a2a89,_0xa56ad5)[_0xa8a5('0xe')](function(_0x1ed4fd){logger[_0xa8a5('0xf')](_0xa8a5('0x10'),_0x19427d,_0xa8a5('0x11'));logger[_0xa8a5('0x12')](_0xa8a5('0x13'),_0x19427d,_0xa8a5('0x11'),JSON[_0xa8a5('0x14')](_0x1ed4fd));if(_0x1ed4fd[_0xa8a5('0x15')]){if(_0x1ed4fd[_0xa8a5('0x15')]['code']===0x1f4){logger['error'](_0xa8a5('0x10'),_0x19427d,_0x1ed4fd['error'][_0xa8a5('0x16')]);return _0x4197bb(_0x1ed4fd['error']['message']);}logger['error'](_0xa8a5('0x10'),_0x19427d,_0x1ed4fd[_0xa8a5('0x15')]['message']);return _0x2cfb42(_0x1ed4fd[_0xa8a5('0x15')][_0xa8a5('0x16')]);}else{logger[_0xa8a5('0xf')](_0xa8a5('0x10'),_0x19427d,_0xa8a5('0x11'));_0x2cfb42(_0x1ed4fd[_0xa8a5('0x17')][_0xa8a5('0x16')]);}})[_0xa8a5('0x18')](function(_0x461db1){logger[_0xa8a5('0x15')](_0xa8a5('0x10'),_0x19427d,_0x461db1);_0x4197bb(_0x461db1);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ed644f2..5857f04 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 _0x758a=['isAuthenticated','index','get','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intDynamics365Account.controller'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x758a,0x19b));var _0xa758=function(_0x219459,_0x20f401){_0x219459=_0x219459-0x0;var _0x4dbfff=_0x758a[_0x219459];return _0x4dbfff;};'use strict';var multer=require('multer');var util=require(_0xa758('0x0'));var path=require(_0xa758('0x1'));var timeout=require(_0xa758('0x2'));var express=require('express');var router=express[_0xa758('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xa758('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa758('0x5'));var controller=require(_0xa758('0x6'));router['get']('/',auth[_0xa758('0x7')](),controller[_0xa758('0x8')]);router[_0xa758('0x9')](_0xa758('0xa'),auth[_0xa758('0x7')](),controller['show']);router['get'](_0xa758('0xb'),auth[_0xa758('0x7')](),controller['getConfigurations']);router['get'](_0xa758('0xc'),auth[_0xa758('0x7')](),controller[_0xa758('0xd')]);router[_0xa758('0xe')]('/',auth[_0xa758('0x7')](),controller['create']);router[_0xa758('0xe')](_0xa758('0xb'),auth['isAuthenticated'](),controller[_0xa758('0xf')]);router[_0xa758('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xa758('0x11')](_0xa758('0xa'),auth[_0xa758('0x7')](),controller['destroy']);module[_0xa758('0x12')]=router; \ No newline at end of file +var _0x1150=['./intDynamics365Account.controller','index','/:id','isAuthenticated','show','get','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44e00a,_0x248bbc){var _0x2bdfba=function(_0x5e66c4){while(--_0x5e66c4){_0x44e00a['push'](_0x44e00a['shift']());}};_0x2bdfba(++_0x248bbc);}(_0x1150,0x1d1));var _0x0115=function(_0x381bff,_0x19d01f){_0x381bff=_0x381bff-0x0;var _0x201ab1=_0x1150[_0x381bff];return _0x201ab1;};'use strict';var multer=require(_0x0115('0x0'));var util=require(_0x0115('0x1'));var path=require(_0x0115('0x2'));var timeout=require(_0x0115('0x3'));var express=require(_0x0115('0x4'));var router=express[_0x0115('0x5')]();var fs_extra=require(_0x0115('0x6'));var auth=require(_0x0115('0x7'));var interaction=require(_0x0115('0x8'));var config=require(_0x0115('0x9'));var controller=require(_0x0115('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x0115('0xb')]);router['get'](_0x0115('0xc'),auth[_0x0115('0xd')](),controller[_0x0115('0xe')]);router[_0x0115('0xf')](_0x0115('0x10'),auth[_0x0115('0xd')](),controller['getConfigurations']);router['get'](_0x0115('0x11'),auth[_0x0115('0xd')](),controller[_0x0115('0x12')]);router[_0x0115('0x13')]('/',auth[_0x0115('0xd')](),controller['create']);router[_0x0115('0x13')](_0x0115('0x10'),auth[_0x0115('0xd')](),controller[_0x0115('0x14')]);router[_0x0115('0x15')](_0x0115('0xc'),auth[_0x0115('0xd')](),controller['update']);router[_0x0115('0x16')](_0x0115('0xc'),auth[_0x0115('0xd')](),controller[_0x0115('0x17')]);module[_0x0115('0x18')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index e594b86..4e46ee9 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 _0x67e1=['sequelize','STRING'];(function(_0x1b5762,_0x2e592e){var _0x3e40aa=function(_0x3a6a32){while(--_0x3a6a32){_0x1b5762['push'](_0x1b5762['shift']());}};_0x3e40aa(++_0x2e592e);}(_0x67e1,0x19a));var _0x167e=function(_0x1c1e19,_0x3a53bd){_0x1c1e19=_0x1c1e19-0x0;var _0x581375=_0x67e1[_0x1c1e19];return _0x581375;};'use strict';var Sequelize=require(_0x167e('0x0'));module['exports']={'name':{'type':Sequelize[_0x167e('0x1')]},'username':{'type':Sequelize[_0x167e('0x1')]},'password':{'type':Sequelize[_0x167e('0x1')]},'remoteUri':{'type':Sequelize[_0x167e('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x167e('0x1')]},'serverUrl':{'type':Sequelize[_0x167e('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7356=['sequelize','STRING'];(function(_0x24f21c,_0x965ead){var _0x22ca54=function(_0x633728){while(--_0x633728){_0x24f21c['push'](_0x24f21c['shift']());}};_0x22ca54(++_0x965ead);}(_0x7356,0x196));var _0x6735=function(_0x199091,_0x3ae5bb){_0x199091=_0x199091-0x0;var _0x31738f=_0x7356[_0x199091];return _0x31738f;};'use strict';var Sequelize=require(_0x6735('0x0'));module['exports']={'name':{'type':Sequelize[_0x6735('0x1')]},'username':{'type':Sequelize[_0x6735('0x1')]},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6735('0x1')]},'tenantId':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x6735('0x1')]},'serverUrl':{'type':Sequelize[_0x6735('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 5a36ee3..7166ec5 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 _0x9a22=['incident','Incident','PhoneCall','customerid','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','remoteUri','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','/oauth2/token','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','forEach','@odata.type','PicklistAttributeMetadata','push','isNil','all','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','DecimalAttributeMetadata','test','statusCode','Wrong\x20credentials','EntityDefinitions(',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','LogicalName','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','key','query','filters','intersection','attributes','length','model','hasOwnProperty','sort','pick','filter','where','merge','type','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','catch','show','params','keys','fields','create','body','find','getConfigurations','findOne','Dynamics365Configuration','order','nolimit','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','Dynamics365Field','ticketType'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x9a22,0x75));var _0x29a2=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x9a22[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x29a2('0x0'));var rimraf=require(_0x29a2('0x1'));var zipdir=require(_0x29a2('0x2'));var jsonpatch=require(_0x29a2('0x3'));var rp=require(_0x29a2('0x4'));var moment=require(_0x29a2('0x5'));var BPromise=require(_0x29a2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x29a2('0x7'));var sox=require(_0x29a2('0x8'));var csv=require(_0x29a2('0x9'));var ejs=require(_0x29a2('0xa'));var fs=require('fs');var fs_extra=require(_0x29a2('0xb'));var _=require(_0x29a2('0xc'));var squel=require(_0x29a2('0xd'));var crypto=require(_0x29a2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x29a2('0xf'));var toCsv=require(_0x29a2('0x9'));var querystring=require('querystring');var Papa=require(_0x29a2('0x10'));var Redis=require(_0x29a2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x29a2('0x12'));var as=require(_0x29a2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x29a2('0x14'))(_0x29a2('0x15'));var utils=require(_0x29a2('0x16'));var config=require(_0x29a2('0x17'));var licenseUtil=require(_0x29a2('0x18'));var db=require(_0x29a2('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x240da2,_0x36ded5){_0x36ded5=_0x36ded5||0xcc;return function(_0xad122){if(_0xad122){return _0x240da2[_0x29a2('0x1a')](_0x36ded5);}return _0x240da2[_0x29a2('0x1b')](_0x36ded5)[_0x29a2('0x1c')]();};}function respondWithResult(_0xc38d1e,_0x4d5dbe){_0x4d5dbe=_0x4d5dbe||0xc8;return function(_0x33e9d5){if(_0x33e9d5){return _0xc38d1e[_0x29a2('0x1b')](_0x4d5dbe)[_0x29a2('0x1d')](_0x33e9d5);}};}function respondWithFilteredResult(_0x9e981,_0x5c34cd){return function(_0x554e29){if(_0x554e29){var _0x45bcd4=typeof _0x5c34cd[_0x29a2('0x1e')]===_0x29a2('0x1f')&&typeof _0x5c34cd[_0x29a2('0x20')]===_0x29a2('0x1f');var _0x5c279e=_0x554e29[_0x29a2('0x21')];var _0x157fba=_0x45bcd4?0x0:_0x5c34cd['offset'];var _0x2810a8=_0x45bcd4?_0x554e29['count']:_0x5c34cd[_0x29a2('0x1e')]+_0x5c34cd[_0x29a2('0x20')];var _0x68433a;if(_0x2810a8>=_0x5c279e){_0x2810a8=_0x5c279e;_0x68433a=0xc8;}else{_0x68433a=0xce;}_0x9e981[_0x29a2('0x1b')](_0x68433a);return _0x9e981['set']('Content-Range',_0x157fba+'-'+_0x2810a8+'/'+_0x5c279e)['json'](_0x554e29);}return null;};}function patchUpdates(_0x20eac0){return function(_0x46f0d5){try{jsonpatch[_0x29a2('0x22')](_0x46f0d5,_0x20eac0,!![]);}catch(_0x90ae67){return BPromise[_0x29a2('0x23')](_0x90ae67);}return _0x46f0d5[_0x29a2('0x24')]();};}function saveUpdates(_0x44db82,_0x4b8e05){return function(_0x44a878){if(_0x44a878){return _0x44a878[_0x29a2('0x25')](_0x44db82)[_0x29a2('0x26')](function(_0x40157a){return _0x40157a;});}return null;};}function removeEntity(_0x2c58fc,_0x20e72a){return function(_0x302153){if(_0x302153){return _0x302153[_0x29a2('0x27')]()['then'](function(){_0x2c58fc['status'](0xcc)[_0x29a2('0x1c')]();});}};}function handleEntityNotFound(_0x24ec4c,_0x1d328f){return function(_0x294088){if(!_0x294088){_0x24ec4c[_0x29a2('0x1a')](0x194);}return _0x294088;};}function handleError(_0x16f516,_0x46dfaf){_0x46dfaf=_0x46dfaf||0x1f4;return function(_0x320ea4){logger[_0x29a2('0x28')](_0x320ea4[_0x29a2('0x29')]);if(_0x320ea4[_0x29a2('0x2a')]){delete _0x320ea4[_0x29a2('0x2a')];}_0x16f516[_0x29a2('0x1b')](_0x46dfaf)['send'](_0x320ea4);};}exports[_0x29a2('0x2b')]=function(_0x35af98,_0x124a99){var _0x30b706={},_0x59a253={},_0x592685={'count':0x0,'rows':[]};var _0x82707a=_[_0x29a2('0x2c')](db['Dynamics365Account'][_0x29a2('0x2d')],function(_0x5a0c4b){return{'name':_0x5a0c4b[_0x29a2('0x2e')],'type':_0x5a0c4b['type'][_0x29a2('0x2f')]};});_0x59a253['model']=_[_0x29a2('0x2c')](_0x82707a,_0x29a2('0x2a'));_0x59a253[_0x29a2('0x30')]=_['keys'](_0x35af98[_0x29a2('0x30')]);_0x59a253[_0x29a2('0x31')]=_[_0x29a2('0x32')](_0x59a253['model'],_0x59a253[_0x29a2('0x30')]);_0x30b706[_0x29a2('0x33')]=_[_0x29a2('0x32')](_0x59a253['model'],qs['fields'](_0x35af98['query']['fields']));_0x30b706[_0x29a2('0x33')]=_0x30b706[_0x29a2('0x33')][_0x29a2('0x34')]?_0x30b706[_0x29a2('0x33')]:_0x59a253[_0x29a2('0x35')];if(!_0x35af98[_0x29a2('0x30')][_0x29a2('0x36')]('nolimit')){_0x30b706[_0x29a2('0x20')]=qs[_0x29a2('0x20')](_0x35af98['query']['limit']);_0x30b706['offset']=qs[_0x29a2('0x1e')](_0x35af98[_0x29a2('0x30')][_0x29a2('0x1e')]);}_0x30b706['order']=qs[_0x29a2('0x37')](_0x35af98[_0x29a2('0x30')][_0x29a2('0x37')]);_0x30b706['where']=qs[_0x29a2('0x31')](_[_0x29a2('0x38')](_0x35af98['query'],_0x59a253[_0x29a2('0x31')]),_0x82707a);if(_0x35af98['query'][_0x29a2('0x39')]){_0x30b706[_0x29a2('0x3a')]=_[_0x29a2('0x3b')](_0x30b706[_0x29a2('0x3a')],{'$or':_[_0x29a2('0x2c')](_0x82707a,function(_0x8778bb){if(_0x8778bb[_0x29a2('0x3c')]!==_0x29a2('0x3d')){var _0x5f2464={};_0x5f2464[_0x8778bb[_0x29a2('0x2a')]]={'$like':'%'+_0x35af98[_0x29a2('0x30')]['filter']+'%'};return _0x5f2464;}})});}_0x30b706=_[_0x29a2('0x3b')]({},_0x30b706,_0x35af98[_0x29a2('0x3e')]);var _0x5429be={'where':_0x30b706['where']};return db[_0x29a2('0x3f')][_0x29a2('0x21')](_0x5429be)[_0x29a2('0x26')](function(_0x48388f){_0x592685['count']=_0x48388f;if(_0x35af98[_0x29a2('0x30')][_0x29a2('0x40')]){_0x30b706[_0x29a2('0x41')]=[{'all':!![]}];}return db[_0x29a2('0x3f')][_0x29a2('0x42')](_0x30b706);})[_0x29a2('0x26')](function(_0x329b50){_0x592685['rows']=_0x329b50;return _0x592685;})['then'](respondWithFilteredResult(_0x124a99,_0x30b706))[_0x29a2('0x43')](handleError(_0x124a99,null));};exports[_0x29a2('0x44')]=function(_0x230aaf,_0x58f294){var _0x497d4a={'raw':![],'where':{'id':_0x230aaf[_0x29a2('0x45')]['id']}},_0x44d0ab={};_0x44d0ab['model']=_['keys'](db['Dynamics365Account'][_0x29a2('0x2d')]);_0x44d0ab[_0x29a2('0x30')]=_[_0x29a2('0x46')](_0x230aaf['query']);_0x44d0ab[_0x29a2('0x31')]=_['intersection'](_0x44d0ab[_0x29a2('0x35')],_0x44d0ab['query']);_0x497d4a[_0x29a2('0x33')]=_[_0x29a2('0x32')](_0x44d0ab[_0x29a2('0x35')],qs['fields'](_0x230aaf['query'][_0x29a2('0x47')]));_0x497d4a[_0x29a2('0x33')]=_0x497d4a[_0x29a2('0x33')]['length']?_0x497d4a[_0x29a2('0x33')]:_0x44d0ab[_0x29a2('0x35')];if(_0x230aaf[_0x29a2('0x30')][_0x29a2('0x40')]){_0x497d4a[_0x29a2('0x41')]=[{'all':!![]}];}_0x497d4a=_[_0x29a2('0x3b')]({},_0x497d4a,_0x230aaf[_0x29a2('0x3e')]);return db[_0x29a2('0x3f')]['find'](_0x497d4a)['then'](handleEntityNotFound(_0x58f294,null))[_0x29a2('0x26')](respondWithResult(_0x58f294,null))[_0x29a2('0x43')](handleError(_0x58f294,null));};exports[_0x29a2('0x48')]=function(_0x7738f5,_0x56c126){return db['Dynamics365Account'][_0x29a2('0x48')](_0x7738f5[_0x29a2('0x49')],{})[_0x29a2('0x26')](respondWithResult(_0x56c126,0xc9))[_0x29a2('0x43')](handleError(_0x56c126,null));};exports[_0x29a2('0x25')]=function(_0x3e40cc,_0x118ffd){if(_0x3e40cc[_0x29a2('0x49')]['id']){delete _0x3e40cc[_0x29a2('0x49')]['id'];}return db[_0x29a2('0x3f')][_0x29a2('0x4a')]({'where':{'id':_0x3e40cc['params']['id']}})[_0x29a2('0x26')](handleEntityNotFound(_0x118ffd,null))[_0x29a2('0x26')](saveUpdates(_0x3e40cc['body'],null))[_0x29a2('0x26')](respondWithResult(_0x118ffd,null))['catch'](handleError(_0x118ffd,null));};exports['destroy']=function(_0x5d0e8f,_0x11e962){return db[_0x29a2('0x3f')][_0x29a2('0x4a')]({'where':{'id':_0x5d0e8f['params']['id']}})[_0x29a2('0x26')](handleEntityNotFound(_0x11e962,null))[_0x29a2('0x26')](removeEntity(_0x11e962,null))['catch'](handleError(_0x11e962,null));};exports[_0x29a2('0x4b')]=function(_0x593851,_0x4b9b6c,_0x10610a){var _0x21dd26={};var _0x19072d={};var _0xd33bbb;var _0x2487ee;return db['Dynamics365Account'][_0x29a2('0x4c')]({'where':{'id':_0x593851[_0x29a2('0x45')]['id']}})['then'](handleEntityNotFound(_0x4b9b6c,null))[_0x29a2('0x26')](function(_0x2effb9){if(_0x2effb9){_0xd33bbb=_0x2effb9;_0x19072d[_0x29a2('0x35')]=_['keys'](db[_0x29a2('0x4d')]['rawAttributes']);_0x19072d[_0x29a2('0x30')]=_[_0x29a2('0x46')](_0x593851['query']);_0x19072d[_0x29a2('0x31')]=_[_0x29a2('0x32')](_0x19072d[_0x29a2('0x35')],_0x19072d['query']);_0x21dd26[_0x29a2('0x33')]=_[_0x29a2('0x32')](_0x19072d['model'],qs[_0x29a2('0x47')](_0x593851[_0x29a2('0x30')][_0x29a2('0x47')]));_0x21dd26[_0x29a2('0x33')]=_0x21dd26[_0x29a2('0x33')][_0x29a2('0x34')]?_0x21dd26[_0x29a2('0x33')]:_0x19072d['model'];_0x21dd26[_0x29a2('0x4e')]=qs[_0x29a2('0x37')](_0x593851['query'][_0x29a2('0x37')]);_0x21dd26['where']=qs[_0x29a2('0x31')](_[_0x29a2('0x38')](_0x593851['query'],_0x19072d['filters']));if(_0x593851['query'][_0x29a2('0x39')]){_0x21dd26[_0x29a2('0x3a')]=_[_0x29a2('0x3b')](_0x21dd26[_0x29a2('0x3a')],{'$or':_['map'](_0x21dd26['attributes'],function(_0x201ac7){var _0x1d54a6={};_0x1d54a6[_0x201ac7]={'$like':'%'+_0x593851[_0x29a2('0x30')]['filter']+'%'};return _0x1d54a6;})});}_0x21dd26=_[_0x29a2('0x3b')]({},_0x21dd26,_0x593851[_0x29a2('0x3e')]);return _0xd33bbb[_0x29a2('0x4b')](_0x21dd26);}})[_0x29a2('0x26')](function(_0xfc22b6){if(_0xfc22b6){_0x2487ee=_0xfc22b6['length'];if(!_0x593851[_0x29a2('0x30')][_0x29a2('0x36')](_0x29a2('0x4f'))){_0x21dd26[_0x29a2('0x20')]=qs[_0x29a2('0x20')](_0x593851[_0x29a2('0x30')][_0x29a2('0x20')]);_0x21dd26[_0x29a2('0x1e')]=qs['offset'](_0x593851[_0x29a2('0x30')][_0x29a2('0x1e')]);}return _0xd33bbb[_0x29a2('0x4b')](_0x21dd26);}})[_0x29a2('0x26')](function(_0x397ac8){if(_0x397ac8){return _0x397ac8?{'count':_0x2487ee,'rows':_0x397ac8}:null;}})['then'](respondWithResult(_0x4b9b6c,null))[_0x29a2('0x43')](handleError(_0x4b9b6c,null));};exports['addConfiguration']=function(_0x7ee5d,_0x55845b,_0x57618b){if(_0x7ee5d[_0x29a2('0x49')]['id']){delete _0x7ee5d[_0x29a2('0x49')]['id'];}return db[_0x29a2('0x3f')][_0x29a2('0x4c')]({'where':{'id':_0x7ee5d[_0x29a2('0x45')]['id']}})[_0x29a2('0x26')](handleEntityNotFound(_0x55845b,null))[_0x29a2('0x26')](function(_0x553584){if(_0x553584){_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x50')]=_0x553584['id'];_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x51')]=integrations[_0x29a2('0x52')](_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x53')],_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x3c')]);_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x54')]=integrations[_0x29a2('0x55')](_0x7ee5d[_0x29a2('0x49')][_0x29a2('0x53')],_0x7ee5d['body'][_0x29a2('0x3c')]);return db[_0x29a2('0x4d')][_0x29a2('0x48')](_0x7ee5d['body'],{'include':[{'model':db[_0x29a2('0x56')],'as':'Subjects'},{'model':db[_0x29a2('0x56')],'as':_0x29a2('0x54')}]});}return null;})[_0x29a2('0x26')](respondWithResult(_0x55845b,null))[_0x29a2('0x43')](handleError(_0x55845b,null));};exports['getFields']=function(_0x388456,_0x16f8f3,_0x3011ef){var _0x314c23=_0x388456[_0x29a2('0x30')][_0x29a2('0x57')];var _0x3e2a4f=_0x314c23===_0x29a2('0x58')?_0x29a2('0x59'):_0x29a2('0x5a');var _0x50cd10='';var _0x2ed97c='';var _0x5a283c='';var _0xc77793='';var _0x16b571='';var _0x1c3a75='';var _0x4d7357='';var _0x4da6a3='';var _0x5d3866=['title','description',_0x29a2('0x5b'),_0x29a2('0x5c'),_0x29a2('0x5d'),_0x29a2('0x5e'),_0x29a2('0x5f'),'regardingobjectid',_0x29a2('0x60'),_0x29a2('0x61')];var _0x118fb1=['accountidname',_0x29a2('0x62'),_0x29a2('0x63'),'billedserviceunits',_0x29a2('0x64'),'contactidyominame','contractdetailidname',_0x29a2('0x65'),_0x29a2('0x66'),_0x29a2('0x67'),_0x29a2('0x68'),_0x29a2('0x69'),'createdon',_0x29a2('0x6a'),_0x29a2('0x6b'),_0x29a2('0x6c'),_0x29a2('0x6d'),_0x29a2('0x6e'),_0x29a2('0x6f'),'entitlementidname',_0x29a2('0x70'),_0x29a2('0x71'),_0x29a2('0x72'),_0x29a2('0x73'),_0x29a2('0x74'),'followupby','importsequencenumber',_0x29a2('0x75'),_0x29a2('0x76'),_0x29a2('0x77'),_0x29a2('0x78'),_0x29a2('0x79'),_0x29a2('0x7a'),_0x29a2('0x7b'),'modifiedbyyominame',_0x29a2('0x7c'),_0x29a2('0x7d'),'modifiedonbehalfbyyominame','msdyn_incidenttypename',_0x29a2('0x7e'),_0x29a2('0x7f'),_0x29a2('0x80'),_0x29a2('0x81'),_0x29a2('0x82'),'owneridtype',_0x29a2('0x83'),_0x29a2('0x84'),_0x29a2('0x85'),'primarycontactidyominame','prioritycodename',_0x29a2('0x86'),_0x29a2('0x87'),_0x29a2('0x88'),'resolvebykpiidname',_0x29a2('0x89'),_0x29a2('0x8a'),_0x29a2('0x8b'),_0x29a2('0x8c'),_0x29a2('0x8d'),_0x29a2('0x8e'),_0x29a2('0x8f'),'statecode','statuscode',_0x29a2('0x90'),_0x29a2('0x91'),_0x29a2('0x92'),_0x29a2('0x93'),_0x29a2('0x94'),_0x29a2('0x95'),_0x29a2('0x96')];var _0x1fd9a8=_0x5d3866[_0x29a2('0x97')](_0x118fb1);return db['Dynamics365Account']['findOne']({'where':{'id':_0x388456[_0x29a2('0x45')]['id']},'attributes':['id',_0x29a2('0x98'),_0x29a2('0x99'),'remoteUri',_0x29a2('0x9a'),_0x29a2('0x9b'),_0x29a2('0x9c')]})['then'](handleEntityNotFound(_0x16f8f3,null))[_0x29a2('0x26')](function(_0x3ae39){if(_0x3ae39){_0x4da6a3=_0x3ae39[_0x29a2('0x9d')];var _0x147eb3=_0x4da6a3[_0x29a2('0x9e')](-0x1);if(_0x147eb3==='/'){_0x4da6a3=_0x4da6a3[_0x29a2('0x9f')](0x0,_0x4da6a3[_0x29a2('0xa0')](_0x147eb3));}_0x4d7357=util[_0x29a2('0xa1')](_0x29a2('0xa2'),_0x4da6a3);var _0x431b0d={'method':_0x29a2('0xa3'),'uri':_0x29a2('0xa4')+_0x3ae39[_0x29a2('0x9a')]+_0x29a2('0xa5'),'form':{'client_id':_0x3ae39['clientId'],'resource':_0x4da6a3,'username':_0x3ae39['username'],'password':_0x3ae39[_0x29a2('0x99')],'grant_type':_0x29a2('0x99'),'client_secret':_0x3ae39[_0x29a2('0x9c')]},'json':!![]};return rp(_0x431b0d);}})['then'](function(_0x2da06e){_0x1c3a75=_0x2da06e[_0x29a2('0xa6')];var _0x1ad5e6={'method':_0x29a2('0xa7'),'uri':encodeURI(_0x4d7357+_0x29a2('0xa8')+_0x3e2a4f+'\x27'),'headers':{'Authorization':_0x29a2('0xa9')+_0x1c3a75,'If-None-Match':null,'OData-Version':_0x29a2('0xaa')},'json':!![]};return rp(_0x1ad5e6);})['then'](function(_0x10886f){var _0x39eacd=_0x10886f[_0x29a2('0xab')][0x0];var _0x52e74c=_0x39eacd[_0x29a2('0xac')];var _0x4b429d={'method':_0x29a2('0xa7'),'uri':_0x4d7357+'EntityDefinitions('+_0x52e74c+_0x29a2('0xad'),'headers':{'Authorization':_0x29a2('0xa9')+_0x1c3a75,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4b429d);})['then'](function(_0x38481f){_0x50cd10=_0x38481f;_0x2ed97c=_0x50cd10[_0x29a2('0xae')];_0x2ed97c=_[_0x29a2('0xaf')](_0x2ed97c,function(_0x3fc0d9){return!_0x1fd9a8['includes'](_0x3fc0d9['LogicalName']);});var _0x3db286=[];var _0x4d4952=[];_0x2ed97c[_0x29a2('0xb0')](function(_0xc9f4e){if(_0xc9f4e[_0x29a2('0xb1')]){var _0x14673d=_0xc9f4e[_0x29a2('0xb1')][_0x29a2('0x9f')](_0xc9f4e[_0x29a2('0xb1')][_0x29a2('0xa0')]('.')+0x1);if(_0x14673d===_0x29a2('0xb2')){_0x3db286[_0x29a2('0xb3')](getSelectList(_0x4d7357,_0x314c23,_0x4d4952,_0x50cd10[_0x29a2('0xac')],_0xc9f4e['MetadataId'],_0x1c3a75));}}});return Promise['all'](_0x3db286);})[_0x29a2('0x26')](function(_0x1bc2e4){_0x5a283c=_0x1bc2e4[0x0];var _0x184fb2=[];var _0x472221=[];_0x2ed97c[_0x29a2('0xb0')](function(_0x5a84c8){if(!_[_0x29a2('0xb4')](_0x5a84c8[_0x29a2('0xb1')])){var _0x5a2374=_0x5a84c8[_0x29a2('0xb1')][_0x29a2('0x9f')](_0x5a84c8[_0x29a2('0xb1')][_0x29a2('0xa0')]('.')+0x1);if(_0x5a2374==='BooleanAttributeMetadata'){_0x184fb2[_0x29a2('0xb3')](getBooleanList(_0x4d7357,_0x314c23,_0x472221,_0x50cd10['MetadataId'],_0x5a84c8[_0x29a2('0xac')],_0x1c3a75));}}});return Promise[_0x29a2('0xb5')](_0x184fb2);})[_0x29a2('0x26')](function(_0x30df9e){_0xc77793=_0x30df9e[0x0];var _0x2bcfd6=[];var _0x16e041=[];_0x2ed97c[_0x29a2('0xb0')](function(_0x1bb679){if(_0x1bb679[_0x29a2('0xb1')]){var _0x2894ff=_0x1bb679['@odata.type'][_0x29a2('0x9f')](_0x1bb679[_0x29a2('0xb1')][_0x29a2('0xa0')]('.')+0x1);if(_0x2894ff==='StringAttributeMetadata'||_0x2894ff===_0x29a2('0xb6')||_0x2894ff===_0x29a2('0xb7')||_0x2894ff===_0x29a2('0xb8')||_0x2894ff==='MemoAttributeMetadata'||_0x2894ff===_0x29a2('0xb9')||_0x2894ff==='StatusAttributeMetadata'||_0x2894ff==='EntityNameAttributeMetadata'||_0x2894ff==='StateAttributeMetadata'||_0x2894ff===_0x29a2('0xba')){_0x2bcfd6[_0x29a2('0xb3')](getInputList(_0x4d7357,_0x314c23,_0x2894ff,_0x16e041,_0x50cd10[_0x29a2('0xac')],_0x1bb679[_0x29a2('0xac')],_0x1c3a75));}}});return Promise[_0x29a2('0xb5')](_0x2bcfd6);})['then'](function(_0x24bd89){_0x16b571=_0x24bd89[0x0];var _0x12f978=_0x5a283c[_0x29a2('0x97')](_0xc77793)[_0x29a2('0x97')](_0x16b571);var _0x1d456e={'count':_0x12f978[_0x29a2('0x34')],'rows':_0x12f978};return _0x1d456e;})[_0x29a2('0x26')](respondWithResult(_0x16f8f3,null))[_0x29a2('0x43')](function(_0x168886){var _0xcc2dd3=_0x388456[_0x29a2('0x30')][_0x29a2('0xbb')]?0x1f4:_0x168886[_0x29a2('0xbc')]||0x1f4;logger[_0x29a2('0x28')](_0x168886['stack']);delete _0x168886['name'];if(_0xcc2dd3===0x191){_0xcc2dd3=0x190;}_0x16f8f3[_0x29a2('0x1b')](_0xcc2dd3)['send'](_0x388456[_0x29a2('0x30')]['test']?{'message':_0x29a2('0xbd'),'statusCode':_0x168886['statusCode']}:_0x168886);});};function getSelectList(_0x59dda9,_0x39f66a,_0x326a36,_0x1a698e,_0x5eaccc,_0x5a4c7b){var _0x473b6a={'method':_0x29a2('0xa7'),'uri':_0x59dda9+_0x29a2('0xbe')+_0x1a698e+_0x29a2('0xbf')+_0x5eaccc+_0x29a2('0xc0')+_0x29a2('0xc1'),'headers':{'Authorization':_0x29a2('0xa9')+_0x5a4c7b,'If-None-Match':null,'OData-Version':_0x29a2('0xaa')},'json':!![]};return rp(_0x473b6a)[_0x29a2('0x26')](function(_0x4e40fb){var _0x5eec1c=[];var _0x2b52e6=_0x4e40fb[_0x29a2('0xc2')]['Options'];_0x2b52e6[_0x29a2('0xb0')](function(_0x3ba9ba){_0x5eec1c[_0x29a2('0xb3')]({'name':_0x3ba9ba[_0x29a2('0xc3')]['UserLocalizedLabel'][_0x29a2('0xc3')],'value':String(_0x3ba9ba['Value'])});});var _0x3ce104={'id':_0x39f66a+'_'+_0x4e40fb[_0x29a2('0xc4')],'name':_0x4e40fb[_0x29a2('0xc5')][_0x29a2('0xc6')][_0x29a2('0xc3')],'custom':![],'options':_0x5eec1c};_0x326a36['push'](_0x3ce104);return _0x326a36;});}function getBooleanList(_0x1a9e60,_0x27191a,_0x2c0174,_0x1c21e4,_0x5a787f,_0x52a308){var _0x587b0d={'method':_0x29a2('0xa7'),'uri':_0x1a9e60+'EntityDefinitions('+_0x1c21e4+')/Attributes('+_0x5a787f+_0x29a2('0xc7'),'headers':{'Authorization':_0x29a2('0xa9')+_0x52a308,'If-None-Match':null,'OData-Version':_0x29a2('0xaa')},'json':!![]};return rp(_0x587b0d)['then'](function(_0x4afbef){var _0x4e93a7=[];_0x4e93a7[_0x29a2('0xb3')]({'name':_0x4afbef[_0x29a2('0xc2')]['TrueOption']['Label'][_0x29a2('0xc6')][_0x29a2('0xc3')],'value':_0x29a2('0xc8')},{'name':_0x4afbef[_0x29a2('0xc2')][_0x29a2('0xc9')]['Label']['UserLocalizedLabel'][_0x29a2('0xc3')],'value':_0x29a2('0xca')});var _0x2e1464={'id':_0x27191a+'_'+_0x4afbef[_0x29a2('0xc4')],'name':_0x4afbef[_0x29a2('0xc5')][_0x29a2('0xc6')]['Label'],'custom':![],'options':_0x4e93a7};_0x2c0174[_0x29a2('0xb3')](_0x2e1464);return _0x2c0174;});}function getInputList(_0x461182,_0x2ca1f4,_0x104b0a,_0x20dd0c,_0x3d991b,_0xfd703d,_0x174b56){var _0x566745={'method':_0x29a2('0xa7'),'uri':_0x461182+_0x29a2('0xbe')+_0x3d991b+_0x29a2('0xbf')+_0xfd703d+_0x29a2('0xcb')+_0x104b0a+_0x29a2('0xcc'),'headers':{'Authorization':'Bearer\x20'+_0x174b56,'If-None-Match':null,'OData-Version':_0x29a2('0xaa')},'json':!![]};return rp(_0x566745)[_0x29a2('0x26')](function(_0x2b5ff3){var _0x49411b={'id':_0x2ca1f4+'_'+_0x2b5ff3['LogicalName'],'name':_0x2b5ff3[_0x29a2('0xc5')][_0x29a2('0xc6')]?_0x2b5ff3['DisplayName'][_0x29a2('0xc6')][_0x29a2('0xc3')]:_0x2b5ff3['LogicalName'],'custom':![],'options':[]};_0x20dd0c['push'](_0x49411b);return _0x20dd0c;});} \ No newline at end of file +var _0x34f8=['addConfiguration','AccountId','Subjects','channel','Descriptions','getDescriptions','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_url','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','productidname','productserialnumber','resolvebykpiidname','responseby','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','clientId','clientSecret','slice','substring','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','tenantId','/oauth2/token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','4.0','value','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Bearer\x20','Attributes','remove','includes','LogicalName','forEach','@odata.type','push','MetadataId','isNil','lastIndexOf','BooleanAttributeMetadata','all','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','OptionSet','FalseOption','false',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','end','status','offset','undefined','count','limit','set','json','apply','reject','save','update','error','stack','name','send','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','catch','find','create','body','destroy','params','findOne','Dynamics365Configuration','order','getConfigurations'];(function(_0x3b9e5c,_0x20b707){var _0x51431=function(_0x157ae6){while(--_0x157ae6){_0x3b9e5c['push'](_0x3b9e5c['shift']());}};_0x51431(++_0x20b707);}(_0x34f8,0x80));var _0x834f=function(_0x11574a,_0x46d39e){_0x11574a=_0x11574a-0x0;var _0x18f23a=_0x34f8[_0x11574a];return _0x18f23a;};'use strict';var emlformat=require(_0x834f('0x0'));var rimraf=require(_0x834f('0x1'));var zipdir=require(_0x834f('0x2'));var jsonpatch=require(_0x834f('0x3'));var rp=require(_0x834f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x834f('0x5'));var util=require(_0x834f('0x6'));var path=require('path');var sox=require(_0x834f('0x7'));var csv=require(_0x834f('0x8'));var ejs=require(_0x834f('0x9'));var fs=require('fs');var fs_extra=require(_0x834f('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x834f('0xb'));var jsforce=require(_0x834f('0xc'));var deskjs=require(_0x834f('0xd'));var toCsv=require(_0x834f('0x8'));var querystring=require('querystring');var Papa=require(_0x834f('0xe'));var Redis=require(_0x834f('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x834f('0x10'));var as=require(_0x834f('0x11'));var hardwareService=require(_0x834f('0x12'));var logger=require(_0x834f('0x13'))(_0x834f('0x14'));var utils=require(_0x834f('0x15'));var config=require(_0x834f('0x16'));var licenseUtil=require(_0x834f('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x834f('0x18'));function respondWithStatusCode(_0x46b91b,_0x456e59){_0x456e59=_0x456e59||0xcc;return function(_0xda9f2d){if(_0xda9f2d){return _0x46b91b[_0x834f('0x19')](_0x456e59);}return _0x46b91b['status'](_0x456e59)[_0x834f('0x1a')]();};}function respondWithResult(_0x2f8592,_0x5bfea4){_0x5bfea4=_0x5bfea4||0xc8;return function(_0x34348c){if(_0x34348c){return _0x2f8592[_0x834f('0x1b')](_0x5bfea4)['json'](_0x34348c);}};}function respondWithFilteredResult(_0x2b9a0c,_0x4bb979){return function(_0x342382){if(_0x342382){var _0x438187=typeof _0x4bb979[_0x834f('0x1c')]===_0x834f('0x1d')&&typeof _0x4bb979['limit']==='undefined';var _0x421e86=_0x342382[_0x834f('0x1e')];var _0xe0a86d=_0x438187?0x0:_0x4bb979[_0x834f('0x1c')];var _0x515633=_0x438187?_0x342382[_0x834f('0x1e')]:_0x4bb979[_0x834f('0x1c')]+_0x4bb979[_0x834f('0x1f')];var _0x4c61ee;if(_0x515633>=_0x421e86){_0x515633=_0x421e86;_0x4c61ee=0xc8;}else{_0x4c61ee=0xce;}_0x2b9a0c['status'](_0x4c61ee);return _0x2b9a0c[_0x834f('0x20')]('Content-Range',_0xe0a86d+'-'+_0x515633+'/'+_0x421e86)[_0x834f('0x21')](_0x342382);}return null;};}function patchUpdates(_0x148839){return function(_0x519afb){try{jsonpatch[_0x834f('0x22')](_0x519afb,_0x148839,!![]);}catch(_0x5e4fa2){return BPromise[_0x834f('0x23')](_0x5e4fa2);}return _0x519afb[_0x834f('0x24')]();};}function saveUpdates(_0x31044a,_0x24cf5d){return function(_0x5e5576){if(_0x5e5576){return _0x5e5576[_0x834f('0x25')](_0x31044a)['then'](function(_0x3ec8dc){return _0x3ec8dc;});}return null;};}function removeEntity(_0x59af4e,_0x536907){return function(_0x43b644){if(_0x43b644){return _0x43b644['destroy']()['then'](function(){_0x59af4e['status'](0xcc)[_0x834f('0x1a')]();});}};}function handleEntityNotFound(_0x2268a1,_0xf54a26){return function(_0x1956fa){if(!_0x1956fa){_0x2268a1[_0x834f('0x19')](0x194);}return _0x1956fa;};}function handleError(_0x2d852b,_0x2cace0){_0x2cace0=_0x2cace0||0x1f4;return function(_0x139495){logger[_0x834f('0x26')](_0x139495[_0x834f('0x27')]);if(_0x139495[_0x834f('0x28')]){delete _0x139495['name'];}_0x2d852b[_0x834f('0x1b')](_0x2cace0)[_0x834f('0x29')](_0x139495);};}exports[_0x834f('0x2a')]=function(_0x586324,_0x1136b9){var _0x37e1d8={},_0x20da2d={},_0x2854e4={'count':0x0,'rows':[]};var _0x51cc8f=_[_0x834f('0x2b')](db[_0x834f('0x2c')][_0x834f('0x2d')],function(_0x19ecc5){return{'name':_0x19ecc5['fieldName'],'type':_0x19ecc5[_0x834f('0x2e')][_0x834f('0x2f')]};});_0x20da2d[_0x834f('0x30')]=_[_0x834f('0x2b')](_0x51cc8f,'name');_0x20da2d[_0x834f('0x31')]=_[_0x834f('0x32')](_0x586324['query']);_0x20da2d[_0x834f('0x33')]=_[_0x834f('0x34')](_0x20da2d['model'],_0x20da2d[_0x834f('0x31')]);_0x37e1d8[_0x834f('0x35')]=_[_0x834f('0x34')](_0x20da2d[_0x834f('0x30')],qs[_0x834f('0x36')](_0x586324['query'][_0x834f('0x36')]));_0x37e1d8['attributes']=_0x37e1d8['attributes'][_0x834f('0x37')]?_0x37e1d8['attributes']:_0x20da2d[_0x834f('0x30')];if(!_0x586324[_0x834f('0x31')][_0x834f('0x38')](_0x834f('0x39'))){_0x37e1d8['limit']=qs['limit'](_0x586324['query'][_0x834f('0x1f')]);_0x37e1d8[_0x834f('0x1c')]=qs[_0x834f('0x1c')](_0x586324[_0x834f('0x31')][_0x834f('0x1c')]);}_0x37e1d8['order']=qs[_0x834f('0x3a')](_0x586324[_0x834f('0x31')][_0x834f('0x3a')]);_0x37e1d8[_0x834f('0x3b')]=qs[_0x834f('0x33')](_[_0x834f('0x3c')](_0x586324[_0x834f('0x31')],_0x20da2d[_0x834f('0x33')]),_0x51cc8f);if(_0x586324[_0x834f('0x31')][_0x834f('0x3d')]){_0x37e1d8[_0x834f('0x3b')]=_[_0x834f('0x3e')](_0x37e1d8[_0x834f('0x3b')],{'$or':_['map'](_0x51cc8f,function(_0x50bf5f){if(_0x50bf5f['type']!==_0x834f('0x3f')){var _0x5b2315={};_0x5b2315[_0x50bf5f['name']]={'$like':'%'+_0x586324[_0x834f('0x31')][_0x834f('0x3d')]+'%'};return _0x5b2315;}})});}_0x37e1d8=_[_0x834f('0x3e')]({},_0x37e1d8,_0x586324[_0x834f('0x40')]);var _0x42a91d={'where':_0x37e1d8['where']};return db[_0x834f('0x2c')][_0x834f('0x1e')](_0x42a91d)[_0x834f('0x41')](function(_0x20abd4){_0x2854e4[_0x834f('0x1e')]=_0x20abd4;if(_0x586324['query'][_0x834f('0x42')]){_0x37e1d8[_0x834f('0x43')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x834f('0x44')](_0x37e1d8);})[_0x834f('0x41')](function(_0x333348){_0x2854e4['rows']=_0x333348;return _0x2854e4;})['then'](respondWithFilteredResult(_0x1136b9,_0x37e1d8))[_0x834f('0x45')](handleError(_0x1136b9,null));};exports['show']=function(_0x49f627,_0x1b2744){var _0x214549={'raw':![],'where':{'id':_0x49f627['params']['id']}},_0x29e6c7={};_0x29e6c7['model']=_['keys'](db['Dynamics365Account'][_0x834f('0x2d')]);_0x29e6c7['query']=_[_0x834f('0x32')](_0x49f627[_0x834f('0x31')]);_0x29e6c7[_0x834f('0x33')]=_['intersection'](_0x29e6c7[_0x834f('0x30')],_0x29e6c7[_0x834f('0x31')]);_0x214549[_0x834f('0x35')]=_[_0x834f('0x34')](_0x29e6c7[_0x834f('0x30')],qs[_0x834f('0x36')](_0x49f627[_0x834f('0x31')][_0x834f('0x36')]));_0x214549['attributes']=_0x214549['attributes'][_0x834f('0x37')]?_0x214549[_0x834f('0x35')]:_0x29e6c7[_0x834f('0x30')];if(_0x49f627[_0x834f('0x31')]['includeAll']){_0x214549['include']=[{'all':!![]}];}_0x214549=_['merge']({},_0x214549,_0x49f627['options']);return db[_0x834f('0x2c')][_0x834f('0x46')](_0x214549)[_0x834f('0x41')](handleEntityNotFound(_0x1b2744,null))[_0x834f('0x41')](respondWithResult(_0x1b2744,null))[_0x834f('0x45')](handleError(_0x1b2744,null));};exports[_0x834f('0x47')]=function(_0x5db5d5,_0x326db5){return db[_0x834f('0x2c')][_0x834f('0x47')](_0x5db5d5[_0x834f('0x48')],{})[_0x834f('0x41')](respondWithResult(_0x326db5,0xc9))[_0x834f('0x45')](handleError(_0x326db5,null));};exports[_0x834f('0x25')]=function(_0x28a8eb,_0xa16e1c){if(_0x28a8eb['body']['id']){delete _0x28a8eb[_0x834f('0x48')]['id'];}return db[_0x834f('0x2c')][_0x834f('0x46')]({'where':{'id':_0x28a8eb['params']['id']}})[_0x834f('0x41')](handleEntityNotFound(_0xa16e1c,null))[_0x834f('0x41')](saveUpdates(_0x28a8eb[_0x834f('0x48')],null))[_0x834f('0x41')](respondWithResult(_0xa16e1c,null))['catch'](handleError(_0xa16e1c,null));};exports[_0x834f('0x49')]=function(_0x1617da,_0x15529a){return db[_0x834f('0x2c')]['find']({'where':{'id':_0x1617da[_0x834f('0x4a')]['id']}})[_0x834f('0x41')](handleEntityNotFound(_0x15529a,null))['then'](removeEntity(_0x15529a,null))[_0x834f('0x45')](handleError(_0x15529a,null));};exports['getConfigurations']=function(_0x2224ef,_0x4e0d46,_0xb80452){var _0x4bab78={};var _0x3111ab={};var _0x2a5a1d;var _0x2b23dc;return db[_0x834f('0x2c')][_0x834f('0x4b')]({'where':{'id':_0x2224ef['params']['id']}})[_0x834f('0x41')](handleEntityNotFound(_0x4e0d46,null))[_0x834f('0x41')](function(_0x5a1e21){if(_0x5a1e21){_0x2a5a1d=_0x5a1e21;_0x3111ab['model']=_['keys'](db[_0x834f('0x4c')][_0x834f('0x2d')]);_0x3111ab[_0x834f('0x31')]=_[_0x834f('0x32')](_0x2224ef['query']);_0x3111ab[_0x834f('0x33')]=_[_0x834f('0x34')](_0x3111ab['model'],_0x3111ab[_0x834f('0x31')]);_0x4bab78['attributes']=_[_0x834f('0x34')](_0x3111ab[_0x834f('0x30')],qs[_0x834f('0x36')](_0x2224ef['query'][_0x834f('0x36')]));_0x4bab78[_0x834f('0x35')]=_0x4bab78[_0x834f('0x35')][_0x834f('0x37')]?_0x4bab78['attributes']:_0x3111ab[_0x834f('0x30')];_0x4bab78[_0x834f('0x4d')]=qs[_0x834f('0x3a')](_0x2224ef['query'][_0x834f('0x3a')]);_0x4bab78[_0x834f('0x3b')]=qs[_0x834f('0x33')](_[_0x834f('0x3c')](_0x2224ef[_0x834f('0x31')],_0x3111ab[_0x834f('0x33')]));if(_0x2224ef[_0x834f('0x31')][_0x834f('0x3d')]){_0x4bab78[_0x834f('0x3b')]=_[_0x834f('0x3e')](_0x4bab78['where'],{'$or':_[_0x834f('0x2b')](_0x4bab78[_0x834f('0x35')],function(_0x5b34f5){var _0x34b1e0={};_0x34b1e0[_0x5b34f5]={'$like':'%'+_0x2224ef['query'][_0x834f('0x3d')]+'%'};return _0x34b1e0;})});}_0x4bab78=_[_0x834f('0x3e')]({},_0x4bab78,_0x2224ef[_0x834f('0x40')]);return _0x2a5a1d['getConfigurations'](_0x4bab78);}})['then'](function(_0x1f42ed){if(_0x1f42ed){_0x2b23dc=_0x1f42ed[_0x834f('0x37')];if(!_0x2224ef[_0x834f('0x31')]['hasOwnProperty']('nolimit')){_0x4bab78[_0x834f('0x1f')]=qs[_0x834f('0x1f')](_0x2224ef[_0x834f('0x31')][_0x834f('0x1f')]);_0x4bab78[_0x834f('0x1c')]=qs[_0x834f('0x1c')](_0x2224ef[_0x834f('0x31')]['offset']);}return _0x2a5a1d[_0x834f('0x4e')](_0x4bab78);}})[_0x834f('0x41')](function(_0x15590b){if(_0x15590b){return _0x15590b?{'count':_0x2b23dc,'rows':_0x15590b}:null;}})[_0x834f('0x41')](respondWithResult(_0x4e0d46,null))[_0x834f('0x45')](handleError(_0x4e0d46,null));};exports[_0x834f('0x4f')]=function(_0x3d6289,_0x14b605,_0x97890c){if(_0x3d6289['body']['id']){delete _0x3d6289[_0x834f('0x48')]['id'];}return db[_0x834f('0x2c')][_0x834f('0x4b')]({'where':{'id':_0x3d6289[_0x834f('0x4a')]['id']}})[_0x834f('0x41')](handleEntityNotFound(_0x14b605,null))[_0x834f('0x41')](function(_0x2c89e7){if(_0x2c89e7){_0x3d6289[_0x834f('0x48')][_0x834f('0x50')]=_0x2c89e7['id'];_0x3d6289[_0x834f('0x48')][_0x834f('0x51')]=integrations['getSubjects'](_0x3d6289[_0x834f('0x48')][_0x834f('0x52')],_0x3d6289[_0x834f('0x48')]['type']);_0x3d6289[_0x834f('0x48')][_0x834f('0x53')]=integrations[_0x834f('0x54')](_0x3d6289[_0x834f('0x48')][_0x834f('0x52')],_0x3d6289[_0x834f('0x48')]['type']);return db[_0x834f('0x4c')][_0x834f('0x47')](_0x3d6289[_0x834f('0x48')],{'include':[{'model':db['Dynamics365Field'],'as':_0x834f('0x51')},{'model':db[_0x834f('0x55')],'as':_0x834f('0x53')}]});}return null;})[_0x834f('0x41')](respondWithResult(_0x14b605,null))[_0x834f('0x45')](handleError(_0x14b605,null));};exports[_0x834f('0x56')]=function(_0x31e503,_0x18a257,_0x27ce55){var _0x3b7b9c=_0x31e503[_0x834f('0x31')][_0x834f('0x57')];var _0x3abfeb=_0x3b7b9c===_0x834f('0x58')?_0x834f('0x59'):_0x834f('0x5a');var _0x546a81='';var _0x1b541d='';var _0x2d0323='';var _0x287bc3='';var _0x33b0ad='';var _0x13e1a4='';var _0x34dd5b='';var _0x4fb03b='';var _0x399ddd=[_0x834f('0x5b'),'description',_0x834f('0x5c'),_0x834f('0x5d'),'caseorigincode',_0x834f('0x5e'),_0x834f('0x5f'),_0x834f('0x60'),_0x834f('0x61'),_0x834f('0x62')];var _0x52c1b5=['accountidname',_0x834f('0x63'),_0x834f('0x64'),_0x834f('0x65'),_0x834f('0x66'),_0x834f('0x67'),_0x834f('0x68'),_0x834f('0x69'),_0x834f('0x6a'),_0x834f('0x6b'),'createdbyname',_0x834f('0x6c'),_0x834f('0x6d'),'createdonbehalfbyname',_0x834f('0x6e'),_0x834f('0x6f'),'customeridtype',_0x834f('0x70'),_0x834f('0x71'),_0x834f('0x72'),'entityimage_timestamp',_0x834f('0x73'),'escalatedon','exchangerate',_0x834f('0x74'),_0x834f('0x75'),_0x834f('0x76'),_0x834f('0x77'),_0x834f('0x78'),_0x834f('0x79'),'masteridname',_0x834f('0x7a'),_0x834f('0x7b'),'modifiedbyname',_0x834f('0x7c'),_0x834f('0x7d'),'modifiedonbehalfbyname',_0x834f('0x7e'),_0x834f('0x7f'),_0x834f('0x80'),_0x834f('0x81'),_0x834f('0x82'),_0x834f('0x83'),_0x834f('0x84'),_0x834f('0x85'),'owneridyominame',_0x834f('0x86'),_0x834f('0x87'),_0x834f('0x88'),'prioritycodename',_0x834f('0x89'),_0x834f('0x8a'),'resolveby',_0x834f('0x8b'),_0x834f('0x8c'),'responsiblecontactidname','responsiblecontactidyominame','sentimentvalue',_0x834f('0x8d'),_0x834f('0x8e'),_0x834f('0x8f'),_0x834f('0x90'),_0x834f('0x91'),_0x834f('0x92'),_0x834f('0x93'),_0x834f('0x94'),_0x834f('0x95'),_0x834f('0x96'),_0x834f('0x97'),_0x834f('0x98')];var _0x7f1f65=_0x399ddd[_0x834f('0x99')](_0x52c1b5);return db['Dynamics365Account']['findOne']({'where':{'id':_0x31e503['params']['id']},'attributes':['id',_0x834f('0x9a'),_0x834f('0x9b'),_0x834f('0x9c'),'tenantId',_0x834f('0x9d'),_0x834f('0x9e')]})[_0x834f('0x41')](handleEntityNotFound(_0x18a257,null))[_0x834f('0x41')](function(_0x3de645){if(_0x3de645){_0x4fb03b=_0x3de645[_0x834f('0x9c')];var _0xe05a17=_0x4fb03b[_0x834f('0x9f')](-0x1);if(_0xe05a17==='/'){_0x4fb03b=_0x4fb03b[_0x834f('0xa0')](0x0,_0x4fb03b['lastIndexOf'](_0xe05a17));}_0x34dd5b=util['format'](_0x834f('0xa1'),_0x4fb03b);var _0x58ed70={'method':_0x834f('0xa2'),'uri':_0x834f('0xa3')+_0x3de645[_0x834f('0xa4')]+_0x834f('0xa5'),'form':{'client_id':_0x3de645['clientId'],'resource':_0x4fb03b,'username':_0x3de645['username'],'password':_0x3de645['password'],'grant_type':_0x834f('0x9b'),'client_secret':_0x3de645[_0x834f('0x9e')]},'json':!![]};return rp(_0x58ed70);}})[_0x834f('0x41')](function(_0x2199cb){_0x13e1a4=_0x2199cb['access_token'];var _0x285d84={'method':_0x834f('0xa6'),'uri':encodeURI(_0x34dd5b+_0x834f('0xa7')+_0x3abfeb+'\x27'),'headers':{'Authorization':'Bearer\x20'+_0x13e1a4,'If-None-Match':null,'OData-Version':_0x834f('0xa8')},'json':!![]};return rp(_0x285d84);})[_0x834f('0x41')](function(_0x3f16fb){var _0x41e2c6=_0x3f16fb[_0x834f('0xa9')][0x0];var _0x3f64e5=_0x41e2c6['MetadataId'];var _0x50b672={'method':_0x834f('0xa6'),'uri':_0x34dd5b+_0x834f('0xaa')+_0x3f64e5+_0x834f('0xab'),'headers':{'Authorization':_0x834f('0xac')+_0x13e1a4,'If-None-Match':null,'OData-Version':_0x834f('0xa8')},'json':!![]};return rp(_0x50b672);})[_0x834f('0x41')](function(_0x1629fb){_0x546a81=_0x1629fb;_0x1b541d=_0x546a81[_0x834f('0xad')];_0x1b541d=_[_0x834f('0xae')](_0x1b541d,function(_0xde10ec){return!_0x7f1f65[_0x834f('0xaf')](_0xde10ec[_0x834f('0xb0')]);});var _0x435b7f=[];var _0xa015c8=[];_0x1b541d[_0x834f('0xb1')](function(_0x1125c0){if(_0x1125c0[_0x834f('0xb2')]){var _0x29454d=_0x1125c0[_0x834f('0xb2')][_0x834f('0xa0')](_0x1125c0['@odata.type']['lastIndexOf']('.')+0x1);if(_0x29454d==='PicklistAttributeMetadata'){_0x435b7f[_0x834f('0xb3')](getSelectList(_0x34dd5b,_0x3b7b9c,_0xa015c8,_0x546a81[_0x834f('0xb4')],_0x1125c0[_0x834f('0xb4')],_0x13e1a4));}}});return Promise['all'](_0x435b7f);})['then'](function(_0x1f48ce){_0x2d0323=_0x1f48ce[0x0];var _0x38dbda=[];var _0xe8c219=[];_0x1b541d[_0x834f('0xb1')](function(_0x39b119){if(!_[_0x834f('0xb5')](_0x39b119[_0x834f('0xb2')])){var _0x41ff91=_0x39b119[_0x834f('0xb2')][_0x834f('0xa0')](_0x39b119[_0x834f('0xb2')][_0x834f('0xb6')]('.')+0x1);if(_0x41ff91===_0x834f('0xb7')){_0x38dbda[_0x834f('0xb3')](getBooleanList(_0x34dd5b,_0x3b7b9c,_0xe8c219,_0x546a81[_0x834f('0xb4')],_0x39b119[_0x834f('0xb4')],_0x13e1a4));}}});return Promise[_0x834f('0xb8')](_0x38dbda);})[_0x834f('0x41')](function(_0x9b700e){_0x287bc3=_0x9b700e[0x0];var _0x59e1bf=[];var _0x36e805=[];_0x1b541d[_0x834f('0xb1')](function(_0x52c3ea){if(_0x52c3ea['@odata.type']){var _0x53a16a=_0x52c3ea[_0x834f('0xb2')][_0x834f('0xa0')](_0x52c3ea[_0x834f('0xb2')][_0x834f('0xb6')]('.')+0x1);if(_0x53a16a===_0x834f('0xb9')||_0x53a16a===_0x834f('0xba')||_0x53a16a===_0x834f('0xbb')||_0x53a16a===_0x834f('0xbc')||_0x53a16a===_0x834f('0xbd')||_0x53a16a==='DateTimeAttributeMetadata'||_0x53a16a===_0x834f('0xbe')||_0x53a16a==='EntityNameAttributeMetadata'||_0x53a16a===_0x834f('0xbf')||_0x53a16a===_0x834f('0xc0')){_0x59e1bf[_0x834f('0xb3')](getInputList(_0x34dd5b,_0x3b7b9c,_0x53a16a,_0x36e805,_0x546a81[_0x834f('0xb4')],_0x52c3ea[_0x834f('0xb4')],_0x13e1a4));}}});return Promise[_0x834f('0xb8')](_0x59e1bf);})[_0x834f('0x41')](function(_0x420b2f){_0x33b0ad=_0x420b2f[0x0];var _0x583b2d=_0x2d0323['concat'](_0x287bc3)['concat'](_0x33b0ad);var _0x3b6cbb={'count':_0x583b2d[_0x834f('0x37')],'rows':_0x583b2d};return _0x3b6cbb;})[_0x834f('0x41')](respondWithResult(_0x18a257,null))[_0x834f('0x45')](function(_0xbd0cde){var _0x153cb6=_0x31e503[_0x834f('0x31')]['test']?0x1f4:_0xbd0cde[_0x834f('0xc1')]||0x1f4;logger[_0x834f('0x26')](_0xbd0cde[_0x834f('0x27')]);delete _0xbd0cde[_0x834f('0x28')];if(_0x153cb6===0x191){_0x153cb6=0x190;}_0x18a257['status'](_0x153cb6)[_0x834f('0x29')](_0x31e503[_0x834f('0x31')]['test']?{'message':_0x834f('0xc2'),'statusCode':_0xbd0cde[_0x834f('0xc1')]}:_0xbd0cde);});};function getSelectList(_0x14495e,_0x12f3c9,_0x5552e4,_0x50e80c,_0x25c104,_0x585c16){var _0x156214={'method':_0x834f('0xa6'),'uri':_0x14495e+_0x834f('0xaa')+_0x50e80c+_0x834f('0xc3')+_0x25c104+_0x834f('0xc4')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x834f('0xac')+_0x585c16,'If-None-Match':null,'OData-Version':_0x834f('0xa8')},'json':!![]};return rp(_0x156214)[_0x834f('0x41')](function(_0xd3cd71){var _0x504b06=[];var _0x210c7b=_0xd3cd71['OptionSet'][_0x834f('0xc5')];_0x210c7b[_0x834f('0xb1')](function(_0x599287){_0x504b06[_0x834f('0xb3')]({'name':_0x599287[_0x834f('0xc6')][_0x834f('0xc7')][_0x834f('0xc6')],'value':String(_0x599287['Value'])});});var _0x3b1c30={'id':_0x12f3c9+'_'+_0xd3cd71['LogicalName'],'name':_0xd3cd71[_0x834f('0xc8')][_0x834f('0xc7')][_0x834f('0xc6')],'custom':![],'options':_0x504b06};_0x5552e4[_0x834f('0xb3')](_0x3b1c30);return _0x5552e4;});}function getBooleanList(_0x422ace,_0x560aa7,_0x59d837,_0x5b20a7,_0x1f12ac,_0x1c0f53){var _0x1057d0={'method':_0x834f('0xa6'),'uri':_0x422ace+_0x834f('0xaa')+_0x5b20a7+')/Attributes('+_0x1f12ac+_0x834f('0xc9'),'headers':{'Authorization':_0x834f('0xac')+_0x1c0f53,'If-None-Match':null,'OData-Version':_0x834f('0xa8')},'json':!![]};return rp(_0x1057d0)[_0x834f('0x41')](function(_0x3d1071){var _0x19d872=[];_0x19d872[_0x834f('0xb3')]({'name':_0x3d1071['OptionSet']['TrueOption'][_0x834f('0xc6')][_0x834f('0xc7')]['Label'],'value':_0x834f('0xca')},{'name':_0x3d1071[_0x834f('0xcb')][_0x834f('0xcc')]['Label']['UserLocalizedLabel'][_0x834f('0xc6')],'value':_0x834f('0xcd')});var _0x3b1c31={'id':_0x560aa7+'_'+_0x3d1071[_0x834f('0xb0')],'name':_0x3d1071['DisplayName'][_0x834f('0xc7')]['Label'],'custom':![],'options':_0x19d872};_0x59d837[_0x834f('0xb3')](_0x3b1c31);return _0x59d837;});}function getInputList(_0x58fdee,_0xc22ad8,_0x476270,_0x4dcc59,_0x2886e3,_0x5e1c82,_0x372ef){var _0x49d36a={'method':_0x834f('0xa6'),'uri':_0x58fdee+'EntityDefinitions('+_0x2886e3+_0x834f('0xc3')+_0x5e1c82+_0x834f('0xce')+_0x476270+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0x834f('0xac')+_0x372ef,'If-None-Match':null,'OData-Version':_0x834f('0xa8')},'json':!![]};return rp(_0x49d36a)[_0x834f('0x41')](function(_0x205a7f){var _0x556669={'id':_0xc22ad8+'_'+_0x205a7f['LogicalName'],'name':_0x205a7f[_0x834f('0xc8')][_0x834f('0xc7')]?_0x205a7f[_0x834f('0xc8')][_0x834f('0xc7')][_0x834f('0xc6')]:_0x205a7f['LogicalName'],'custom':![],'options':[]};_0x4dcc59['push'](_0x556669);return _0x4dcc59;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 1a716ec..951ef8b 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 _0xd8b0=['exports','Dynamics365Account','int_dynamics365_accounts','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1775b3,_0xb677e0){var _0x1f1d0d=function(_0x4a20be){while(--_0x4a20be){_0x1775b3['push'](_0x1775b3['shift']());}};_0x1f1d0d(++_0xb677e0);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x0d8b('0x7')]=function(_0x227c63,_0x39f43a){return _0x227c63['define'](_0x0d8b('0x8'),attributes,{'tableName':_0x0d8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x3229a0,_0x3c62bf){var _0x358d04=function(_0x9cfe6a){while(--_0x9cfe6a){_0x3229a0['push'](_0x3229a0['shift']());}};_0x358d04(++_0x3c62bf);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index c161f6e..56aa58d 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 _0xcfaa=['then','info','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','findAll','options','raw','where','attributes','include','map','model','stringify','ShowDynamics365Account','Dynamics365Account','find','lodash','moment','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','request'];(function(_0x55c466,_0x1e6362){var _0x1c09a3=function(_0x11c91e){while(--_0x11c91e){_0x55c466['push'](_0x55c466['shift']());}};_0x1c09a3(++_0x1e6362);}(_0xcfaa,0x18b));var _0xacfa=function(_0x29ecda,_0x190e67){_0x29ecda=_0x29ecda-0x0;var _0x48fbc8=_0xcfaa[_0x29ecda];return _0x48fbc8;};'use strict';var _=require(_0xacfa('0x0'));var util=require('util');var moment=require(_0xacfa('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacfa('0x2'))['db'];var utils=require(_0xacfa('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xacfa('0x4'));var jayson=require(_0xacfa('0x5'));var client=jayson[_0xacfa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b2699,_0x5c19a5,_0x31ea57){return new BPromise(function(_0xceab7c,_0x5e0313){return client[_0xacfa('0x7')](_0x2b2699,_0x31ea57)[_0xacfa('0x8')](function(_0xba90f7){logger[_0xacfa('0x9')]('Dynamics365Account,\x20%s,\x20%s',_0x5c19a5,_0xacfa('0xa'));logger[_0xacfa('0xb')](_0xacfa('0xc'),_0x5c19a5,_0xacfa('0xa'),JSON['stringify'](_0xba90f7));if(_0xba90f7[_0xacfa('0xd')]){if(_0xba90f7[_0xacfa('0xd')][_0xacfa('0xe')]===0x1f4){logger[_0xacfa('0xd')](_0xacfa('0xf'),_0x5c19a5,_0xba90f7[_0xacfa('0xd')][_0xacfa('0x10')]);return _0x5e0313(_0xba90f7['error'][_0xacfa('0x10')]);}logger[_0xacfa('0xd')](_0xacfa('0xf'),_0x5c19a5,_0xba90f7[_0xacfa('0xd')][_0xacfa('0x10')]);return _0xceab7c(_0xba90f7[_0xacfa('0xd')][_0xacfa('0x10')]);}else{logger[_0xacfa('0x9')](_0xacfa('0xf'),_0x5c19a5,_0xacfa('0xa'));_0xceab7c(_0xba90f7['result']['message']);}})[_0xacfa('0x11')](function(_0x19a09c){logger[_0xacfa('0xd')](_0xacfa('0xf'),_0x5c19a5,_0x19a09c);_0x5e0313(_0x19a09c);});});}exports[_0xacfa('0x12')]=function(_0x235ddc){var _0x9b269f=this;return new Promise(function(_0x20fe06,_0x57a586){return db['Dynamics365Account'][_0xacfa('0x13')]({'raw':_0x235ddc[_0xacfa('0x14')]?_0x235ddc[_0xacfa('0x14')][_0xacfa('0x15')]===undefined?!![]:![]:!![],'where':_0x235ddc[_0xacfa('0x14')]?_0x235ddc[_0xacfa('0x14')][_0xacfa('0x16')]||null:null,'attributes':_0x235ddc[_0xacfa('0x14')]?_0x235ddc[_0xacfa('0x14')][_0xacfa('0x17')]||null:null,'limit':_0x235ddc[_0xacfa('0x14')]?_0x235ddc[_0xacfa('0x14')]['limit']||null:null,'include':_0x235ddc[_0xacfa('0x14')]?_0x235ddc[_0xacfa('0x14')][_0xacfa('0x18')]?_[_0xacfa('0x19')](_0x235ddc[_0xacfa('0x14')][_0xacfa('0x18')],function(_0x1b6e97){return{'model':db[_0x1b6e97[_0xacfa('0x1a')]],'as':_0x1b6e97['as'],'attributes':_0x1b6e97[_0xacfa('0x17')],'include':_0x1b6e97[_0xacfa('0x18')]?_[_0xacfa('0x19')](_0x1b6e97[_0xacfa('0x18')],function(_0x144f3c){return{'model':db[_0x144f3c[_0xacfa('0x1a')]],'as':_0x144f3c['as'],'attributes':_0x144f3c[_0xacfa('0x17')],'include':_0x144f3c[_0xacfa('0x18')]?_[_0xacfa('0x19')](_0x144f3c[_0xacfa('0x18')],function(_0x52ce06){return{'model':db[_0x52ce06[_0xacfa('0x1a')]],'as':_0x52ce06['as'],'attributes':_0x52ce06['attributes']};}):[]};}):[]};}):[]:[]})[_0xacfa('0x8')](function(_0x4bc7af){logger[_0xacfa('0x9')](_0xacfa('0x12'),_0x235ddc);logger[_0xacfa('0xb')](_0xacfa('0x12'),_0x235ddc,JSON[_0xacfa('0x1b')](_0x4bc7af));_0x20fe06(_0x4bc7af);})['catch'](function(_0x2a8fdd){logger[_0xacfa('0xd')](_0xacfa('0x12'),_0x2a8fdd[_0xacfa('0x10')],_0x235ddc);_0x57a586(_0x9b269f[_0xacfa('0xd')](0x1f4,_0x2a8fdd[_0xacfa('0x10')]));});});};exports[_0xacfa('0x1c')]=function(_0x12ee8d){var _0x179e6b=this;return new Promise(function(_0x5d4dbf,_0x6a0f10){return db[_0xacfa('0x1d')][_0xacfa('0x1e')]({'raw':_0x12ee8d[_0xacfa('0x14')]?_0x12ee8d['options']['raw']===undefined?!![]:![]:!![],'where':_0x12ee8d[_0xacfa('0x14')]?_0x12ee8d['options'][_0xacfa('0x16')]||null:null,'attributes':_0x12ee8d[_0xacfa('0x14')]?_0x12ee8d['options'][_0xacfa('0x17')]||null:null,'include':_0x12ee8d[_0xacfa('0x14')]?_0x12ee8d[_0xacfa('0x14')][_0xacfa('0x18')]?_['map'](_0x12ee8d['options'][_0xacfa('0x18')],function(_0x1344e6){return{'model':db[_0x1344e6['model']],'as':_0x1344e6['as'],'attributes':_0x1344e6[_0xacfa('0x17')],'include':_0x1344e6[_0xacfa('0x18')]?_['map'](_0x1344e6[_0xacfa('0x18')],function(_0x1515fa){return{'model':db[_0x1515fa[_0xacfa('0x1a')]],'as':_0x1515fa['as'],'attributes':_0x1515fa[_0xacfa('0x17')],'include':_0x1515fa[_0xacfa('0x18')]?_['map'](_0x1515fa['include'],function(_0x456817){return{'model':db[_0x456817[_0xacfa('0x1a')]],'as':_0x456817['as'],'attributes':_0x456817[_0xacfa('0x17')]};}):[]};}):[]};}):[]:[]})[_0xacfa('0x8')](function(_0x3701da){logger['info'](_0xacfa('0x1c'),_0x12ee8d);logger[_0xacfa('0xb')](_0xacfa('0x1c'),_0x12ee8d,JSON[_0xacfa('0x1b')](_0x3701da));_0x5d4dbf(_0x3701da);})[_0xacfa('0x11')](function(_0x13606f){logger[_0xacfa('0xd')](_0xacfa('0x1c'),_0x13606f[_0xacfa('0x10')],_0x12ee8d);_0x6a0f10(_0x179e6b['error'](0x1f4,_0x13606f[_0xacfa('0x10')]));});});}; \ No newline at end of file +var _0xab2f=['model','GetDynamics365Account','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','Dynamics365Account','options','raw','where','attributes','limit','include','map'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xab2f,0xd6));var _0xfab2=function(_0x341c44,_0x2e1057){_0x341c44=_0x341c44-0x0;var _0x2bda72=_0xab2f[_0x341c44];return _0x2bda72;};'use strict';var _=require(_0xfab2('0x0'));var util=require(_0xfab2('0x1'));var moment=require(_0xfab2('0x2'));var BPromise=require(_0xfab2('0x3'));var rs=require(_0xfab2('0x4'));var fs=require('fs');var Redis=require(_0xfab2('0x5'));var db=require(_0xfab2('0x6'))['db'];var utils=require(_0xfab2('0x7'));var logger=require('../../config/logger')(_0xfab2('0x8'));var config=require('../../config/environment');var jayson=require(_0xfab2('0x9'));var client=jayson[_0xfab2('0xa')][_0xfab2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5c64eb,_0x2b29c0,_0x12f663){return new BPromise(function(_0x43d29d,_0x57fb7d){return client[_0xfab2('0xc')](_0x5c64eb,_0x12f663)[_0xfab2('0xd')](function(_0x58956b){logger[_0xfab2('0xe')](_0xfab2('0xf'),_0x2b29c0,_0xfab2('0x10'));logger[_0xfab2('0x11')](_0xfab2('0x12'),_0x2b29c0,_0xfab2('0x10'),JSON[_0xfab2('0x13')](_0x58956b));if(_0x58956b['error']){if(_0x58956b['error']['code']===0x1f4){logger[_0xfab2('0x14')](_0xfab2('0xf'),_0x2b29c0,_0x58956b['error'][_0xfab2('0x15')]);return _0x57fb7d(_0x58956b['error']['message']);}logger[_0xfab2('0x14')]('Dynamics365Account,\x20%s,\x20%s',_0x2b29c0,_0x58956b['error'][_0xfab2('0x15')]);return _0x43d29d(_0x58956b['error']['message']);}else{logger[_0xfab2('0xe')](_0xfab2('0xf'),_0x2b29c0,_0xfab2('0x10'));_0x43d29d(_0x58956b['result'][_0xfab2('0x15')]);}})[_0xfab2('0x16')](function(_0x4d14a0){logger[_0xfab2('0x14')](_0xfab2('0xf'),_0x2b29c0,_0x4d14a0);_0x57fb7d(_0x4d14a0);});});}exports['GetDynamics365Account']=function(_0x4fccdc){var _0x571bff=this;return new Promise(function(_0x276e47,_0x4727e1){return db[_0xfab2('0x17')]['findAll']({'raw':_0x4fccdc['options']?_0x4fccdc[_0xfab2('0x18')][_0xfab2('0x19')]===undefined?!![]:![]:!![],'where':_0x4fccdc[_0xfab2('0x18')]?_0x4fccdc[_0xfab2('0x18')][_0xfab2('0x1a')]||null:null,'attributes':_0x4fccdc['options']?_0x4fccdc[_0xfab2('0x18')][_0xfab2('0x1b')]||null:null,'limit':_0x4fccdc[_0xfab2('0x18')]?_0x4fccdc[_0xfab2('0x18')][_0xfab2('0x1c')]||null:null,'include':_0x4fccdc[_0xfab2('0x18')]?_0x4fccdc[_0xfab2('0x18')][_0xfab2('0x1d')]?_[_0xfab2('0x1e')](_0x4fccdc['options'][_0xfab2('0x1d')],function(_0xaacbf3){return{'model':db[_0xaacbf3[_0xfab2('0x1f')]],'as':_0xaacbf3['as'],'attributes':_0xaacbf3['attributes'],'include':_0xaacbf3['include']?_[_0xfab2('0x1e')](_0xaacbf3[_0xfab2('0x1d')],function(_0x16215b){return{'model':db[_0x16215b[_0xfab2('0x1f')]],'as':_0x16215b['as'],'attributes':_0x16215b[_0xfab2('0x1b')],'include':_0x16215b[_0xfab2('0x1d')]?_['map'](_0x16215b['include'],function(_0x548b4f){return{'model':db[_0x548b4f[_0xfab2('0x1f')]],'as':_0x548b4f['as'],'attributes':_0x548b4f[_0xfab2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfab2('0xd')](function(_0x162413){logger['info'](_0xfab2('0x20'),_0x4fccdc);logger['debug'](_0xfab2('0x20'),_0x4fccdc,JSON[_0xfab2('0x13')](_0x162413));_0x276e47(_0x162413);})['catch'](function(_0x526c02){logger[_0xfab2('0x14')]('GetDynamics365Account',_0x526c02[_0xfab2('0x15')],_0x4fccdc);_0x4727e1(_0x571bff[_0xfab2('0x14')](0x1f4,_0x526c02['message']));});});};exports[_0xfab2('0x21')]=function(_0x55efca){var _0x3ace46=this;return new Promise(function(_0x4c6fae,_0x17405c){return db[_0xfab2('0x17')][_0xfab2('0x22')]({'raw':_0x55efca[_0xfab2('0x18')]?_0x55efca[_0xfab2('0x18')][_0xfab2('0x19')]===undefined?!![]:![]:!![],'where':_0x55efca[_0xfab2('0x18')]?_0x55efca[_0xfab2('0x18')][_0xfab2('0x1a')]||null:null,'attributes':_0x55efca['options']?_0x55efca['options'][_0xfab2('0x1b')]||null:null,'include':_0x55efca[_0xfab2('0x18')]?_0x55efca[_0xfab2('0x18')][_0xfab2('0x1d')]?_[_0xfab2('0x1e')](_0x55efca['options'][_0xfab2('0x1d')],function(_0x435689){return{'model':db[_0x435689[_0xfab2('0x1f')]],'as':_0x435689['as'],'attributes':_0x435689['attributes'],'include':_0x435689[_0xfab2('0x1d')]?_[_0xfab2('0x1e')](_0x435689[_0xfab2('0x1d')],function(_0x1b5833){return{'model':db[_0x1b5833[_0xfab2('0x1f')]],'as':_0x1b5833['as'],'attributes':_0x1b5833[_0xfab2('0x1b')],'include':_0x1b5833['include']?_[_0xfab2('0x1e')](_0x1b5833[_0xfab2('0x1d')],function(_0x1413cb){return{'model':db[_0x1413cb[_0xfab2('0x1f')]],'as':_0x1413cb['as'],'attributes':_0x1413cb[_0xfab2('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfab2('0xd')](function(_0x232791){logger[_0xfab2('0xe')](_0xfab2('0x21'),_0x55efca);logger[_0xfab2('0x11')]('ShowDynamics365Account',_0x55efca,JSON[_0xfab2('0x13')](_0x232791));_0x4c6fae(_0x232791);})[_0xfab2('0x16')](function(_0x578af2){logger['error'](_0xfab2('0x21'),_0x578af2[_0xfab2('0x15')],_0x55efca);_0x17405c(_0x3ace46['error'](0x1f4,_0x578af2['message']));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 5a6c648..763c4e1 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 _0xb12d=['path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getSubjects','getDescriptions','post','create','update','exports','multer','util'];(function(_0x8fa4bc,_0x5cd2af){var _0x35b6a7=function(_0x357c25){while(--_0x357c25){_0x8fa4bc['push'](_0x8fa4bc['shift']());}};_0x35b6a7(++_0x5cd2af);}(_0xb12d,0x124));var _0xdb12=function(_0xd336fa,_0x39d1b2){_0xd336fa=_0xd336fa-0x0;var _0x3370b1=_0xb12d[_0xd336fa];return _0x3370b1;};'use strict';var multer=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var path=require(_0xdb12('0x2'));var timeout=require('connect-timeout');var express=require(_0xdb12('0x3'));var router=express['Router']();var fs_extra=require(_0xdb12('0x4'));var auth=require(_0xdb12('0x5'));var interaction=require(_0xdb12('0x6'));var config=require(_0xdb12('0x7'));var controller=require(_0xdb12('0x8'));router[_0xdb12('0x9')]('/',auth['isAuthenticated'](),controller[_0xdb12('0xa')]);router[_0xdb12('0x9')](_0xdb12('0xb'),auth[_0xdb12('0xc')](),controller[_0xdb12('0xd')]);router[_0xdb12('0x9')](_0xdb12('0xe'),auth[_0xdb12('0xc')](),controller['getFields']);router[_0xdb12('0x9')]('/:id/subjects',auth[_0xdb12('0xc')](),controller[_0xdb12('0xf')]);router[_0xdb12('0x9')]('/:id/descriptions',auth[_0xdb12('0xc')](),controller[_0xdb12('0x10')]);router[_0xdb12('0x11')]('/',auth['isAuthenticated'](),controller[_0xdb12('0x12')]);router['put'](_0xdb12('0xb'),auth[_0xdb12('0xc')](),controller[_0xdb12('0x13')]);router['delete'](_0xdb12('0xb'),auth[_0xdb12('0xc')](),controller['destroy']);module[_0xdb12('0x14')]=router; \ No newline at end of file +var _0x4a1d=['isAuthenticated','index','/:id','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get'];(function(_0x363e15,_0x3b63b6){var _0x54e8f9=function(_0x4e67e1){while(--_0x4e67e1){_0x363e15['push'](_0x363e15['shift']());}};_0x54e8f9(++_0x3b63b6);}(_0x4a1d,0x77));var _0xd4a1=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x4a1d[_0x13ea00];return _0x1f7347;};'use strict';var multer=require(_0xd4a1('0x0'));var util=require(_0xd4a1('0x1'));var path=require(_0xd4a1('0x2'));var timeout=require(_0xd4a1('0x3'));var express=require(_0xd4a1('0x4'));var router=express['Router']();var fs_extra=require(_0xd4a1('0x5'));var auth=require(_0xd4a1('0x6'));var interaction=require(_0xd4a1('0x7'));var config=require(_0xd4a1('0x8'));var controller=require(_0xd4a1('0x9'));router[_0xd4a1('0xa')]('/',auth[_0xd4a1('0xb')](),controller[_0xd4a1('0xc')]);router['get'](_0xd4a1('0xd'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0xe')]);router[_0xd4a1('0xa')](_0xd4a1('0xf'),auth['isAuthenticated'](),controller['getFields']);router[_0xd4a1('0xa')](_0xd4a1('0x10'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x11')]);router['get'](_0xd4a1('0x12'),auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x13')]);router['post']('/',auth[_0xd4a1('0xb')](),controller[_0xd4a1('0x14')]);router[_0xd4a1('0x15')](_0xd4a1('0xd'),auth['isAuthenticated'](),controller[_0xd4a1('0x16')]);router[_0xd4a1('0x17')](_0xd4a1('0xd'),auth['isAuthenticated'](),controller[_0xd4a1('0x18')]);module[_0xd4a1('0x19')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 81d80b5..c067d12 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 _0x72fd=['exports','STRING','ENUM','phonecall','contact','nothing','sequelize'];(function(_0x26369b,_0x2ed411){var _0x49280b=function(_0x344cba){while(--_0x344cba){_0x26369b['push'](_0x26369b['shift']());}};_0x49280b(++_0x2ed411);}(_0x72fd,0x12c));var _0xd72f=function(_0x5828cc,_0x386e5f){_0x5828cc=_0x5828cc-0x0;var _0x5e32c8=_0x72fd[_0x5828cc];return _0x5e32c8;};'use strict';var Sequelize=require(_0xd72f('0x0'));module[_0xd72f('0x1')]={'name':{'type':Sequelize[_0xd72f('0x2')]},'description':{'type':Sequelize[_0xd72f('0x2')]},'ticketType':{'type':Sequelize[_0xd72f('0x3')]('incident',_0xd72f('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0xd72f('0x3')](_0xd72f('0x5'),_0xd72f('0x6')),'defaultValue':_0xd72f('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0xb193=['ENUM','incident','phonecall','contact','nothing','exports','STRING'];(function(_0x12230d,_0x91e9bf){var _0x40daa0=function(_0x3a7b7c){while(--_0x3a7b7c){_0x12230d['push'](_0x12230d['shift']());}};_0x40daa0(++_0x91e9bf);}(_0xb193,0x8a));var _0x3b19=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xb193[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require('sequelize');module[_0x3b19('0x0')]={'name':{'type':Sequelize[_0x3b19('0x1')]},'description':{'type':Sequelize[_0x3b19('0x1')]},'ticketType':{'type':Sequelize[_0x3b19('0x2')](_0x3b19('0x3'),_0x3b19('0x4')),'defaultValue':'incident'},'moduleCreate':{'type':Sequelize[_0x3b19('0x2')](_0x3b19('0x5'),_0x3b19('0x6')),'defaultValue':_0x3b19('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 91b2c3a..3654a8d 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 _0x95d5=['nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','catch','create','body','update','find','findOne','order','pick','getFields','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','apply','reject','save','then','destroy','error','stack','name','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x95d5,0x19a));var _0x595d=function(_0x22193e,_0x2ae001){_0x22193e=_0x22193e-0x0;var _0x10c378=_0x95d5[_0x22193e];return _0x10c378;};'use strict';var emlformat=require(_0x595d('0x0'));var rimraf=require(_0x595d('0x1'));var zipdir=require(_0x595d('0x2'));var jsonpatch=require(_0x595d('0x3'));var rp=require(_0x595d('0x4'));var moment=require(_0x595d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x595d('0x6'));var util=require('util');var path=require(_0x595d('0x7'));var sox=require(_0x595d('0x8'));var csv=require(_0x595d('0x9'));var ejs=require(_0x595d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x595d('0xb'));var crypto=require(_0x595d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x595d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x595d('0xe'));var Redis=require(_0x595d('0xf'));var authService=require(_0x595d('0x10'));var qs=require(_0x595d('0x11'));var as=require(_0x595d('0x12'));var hardwareService=require(_0x595d('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x595d('0x14'));var config=require(_0x595d('0x15'));var licenseUtil=require(_0x595d('0x16'));var db=require(_0x595d('0x17'))['db'];function respondWithStatusCode(_0x1cf8e9,_0x52c3ea){_0x52c3ea=_0x52c3ea||0xcc;return function(_0x285572){if(_0x285572){return _0x1cf8e9[_0x595d('0x18')](_0x52c3ea);}return _0x1cf8e9[_0x595d('0x19')](_0x52c3ea)['end']();};}function respondWithResult(_0x5004f6,_0x4bd82a){_0x4bd82a=_0x4bd82a||0xc8;return function(_0x13bab7){if(_0x13bab7){return _0x5004f6['status'](_0x4bd82a)[_0x595d('0x1a')](_0x13bab7);}};}function respondWithFilteredResult(_0x1d6fe4,_0xa0fd41){return function(_0x33f0e3){if(_0x33f0e3){var _0x937b0=typeof _0xa0fd41[_0x595d('0x1b')]===_0x595d('0x1c')&&typeof _0xa0fd41['limit']===_0x595d('0x1c');var _0x1e6825=_0x33f0e3[_0x595d('0x1d')];var _0x376715=_0x937b0?0x0:_0xa0fd41[_0x595d('0x1b')];var _0x3ee8b0=_0x937b0?_0x33f0e3[_0x595d('0x1d')]:_0xa0fd41['offset']+_0xa0fd41[_0x595d('0x1e')];var _0x30ef44;if(_0x3ee8b0>=_0x1e6825){_0x3ee8b0=_0x1e6825;_0x30ef44=0xc8;}else{_0x30ef44=0xce;}_0x1d6fe4[_0x595d('0x19')](_0x30ef44);return _0x1d6fe4['set']('Content-Range',_0x376715+'-'+_0x3ee8b0+'/'+_0x1e6825)['json'](_0x33f0e3);}return null;};}function patchUpdates(_0x5d0ef7){return function(_0x128de9){try{jsonpatch[_0x595d('0x1f')](_0x128de9,_0x5d0ef7,!![]);}catch(_0x1e197f){return BPromise[_0x595d('0x20')](_0x1e197f);}return _0x128de9[_0x595d('0x21')]();};}function saveUpdates(_0x53d21a,_0x3a0784){return function(_0x94c40c){if(_0x94c40c){return _0x94c40c['update'](_0x53d21a)[_0x595d('0x22')](function(_0x1db99b){return _0x1db99b;});}return null;};}function removeEntity(_0x4e30d2,_0x34326b){return function(_0x2e0b49){if(_0x2e0b49){return _0x2e0b49[_0x595d('0x23')]()[_0x595d('0x22')](function(){_0x4e30d2[_0x595d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bd6e7,_0x5e4576){return function(_0x4a3e29){if(!_0x4a3e29){_0x2bd6e7[_0x595d('0x18')](0x194);}return _0x4a3e29;};}function handleError(_0x80f9a7,_0x5ed1f2){_0x5ed1f2=_0x5ed1f2||0x1f4;return function(_0x490205){logger[_0x595d('0x24')](_0x490205[_0x595d('0x25')]);if(_0x490205[_0x595d('0x26')]){delete _0x490205[_0x595d('0x26')];}_0x80f9a7[_0x595d('0x19')](_0x5ed1f2)['send'](_0x490205);};}exports['index']=function(_0x1f56f5,_0xc69a12){var _0x45cbba={},_0x4c3d61={},_0x246c26={'count':0x0,'rows':[]};var _0x296ca5=_[_0x595d('0x27')](db[_0x595d('0x28')][_0x595d('0x29')],function(_0x2884b5){return{'name':_0x2884b5[_0x595d('0x2a')],'type':_0x2884b5['type'][_0x595d('0x2b')]};});_0x4c3d61['model']=_['map'](_0x296ca5,_0x595d('0x26'));_0x4c3d61[_0x595d('0x2c')]=_['keys'](_0x1f56f5['query']);_0x4c3d61[_0x595d('0x2d')]=_[_0x595d('0x2e')](_0x4c3d61[_0x595d('0x2f')],_0x4c3d61[_0x595d('0x2c')]);_0x45cbba[_0x595d('0x30')]=_[_0x595d('0x2e')](_0x4c3d61[_0x595d('0x2f')],qs[_0x595d('0x31')](_0x1f56f5[_0x595d('0x2c')][_0x595d('0x31')]));_0x45cbba[_0x595d('0x30')]=_0x45cbba['attributes'][_0x595d('0x32')]?_0x45cbba[_0x595d('0x30')]:_0x4c3d61[_0x595d('0x2f')];if(!_0x1f56f5['query'][_0x595d('0x33')](_0x595d('0x34'))){_0x45cbba[_0x595d('0x1e')]=qs[_0x595d('0x1e')](_0x1f56f5[_0x595d('0x2c')]['limit']);_0x45cbba[_0x595d('0x1b')]=qs[_0x595d('0x1b')](_0x1f56f5[_0x595d('0x2c')][_0x595d('0x1b')]);}_0x45cbba['order']=qs[_0x595d('0x35')](_0x1f56f5[_0x595d('0x2c')]['sort']);_0x45cbba[_0x595d('0x36')]=qs[_0x595d('0x2d')](_['pick'](_0x1f56f5['query'],_0x4c3d61[_0x595d('0x2d')]),_0x296ca5);if(_0x1f56f5[_0x595d('0x2c')][_0x595d('0x37')]){_0x45cbba['where']=_[_0x595d('0x38')](_0x45cbba[_0x595d('0x36')],{'$or':_[_0x595d('0x27')](_0x296ca5,function(_0x2b66c2){if(_0x2b66c2['type']!==_0x595d('0x39')){var _0x17ca0a={};_0x17ca0a[_0x2b66c2['name']]={'$like':'%'+_0x1f56f5[_0x595d('0x2c')][_0x595d('0x37')]+'%'};return _0x17ca0a;}})});}_0x45cbba=_[_0x595d('0x38')]({},_0x45cbba,_0x1f56f5[_0x595d('0x3a')]);var _0x324c49={'where':_0x45cbba['where']};return db['Dynamics365Configuration'][_0x595d('0x1d')](_0x324c49)[_0x595d('0x22')](function(_0x1baf3f){_0x246c26[_0x595d('0x1d')]=_0x1baf3f;if(_0x1f56f5['query'][_0x595d('0x3b')]){_0x45cbba[_0x595d('0x3c')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x595d('0x3d')](_0x45cbba);})[_0x595d('0x22')](function(_0x294d7d){_0x246c26[_0x595d('0x3e')]=_0x294d7d;return _0x246c26;})['then'](respondWithFilteredResult(_0xc69a12,_0x45cbba))['catch'](handleError(_0xc69a12,null));};exports[_0x595d('0x3f')]=function(_0x398b51,_0x5e7529){var _0x4b3abb={'raw':![],'where':{'id':_0x398b51[_0x595d('0x40')]['id']}},_0x22c89e={};_0x22c89e['model']=_[_0x595d('0x41')](db[_0x595d('0x28')][_0x595d('0x29')]);_0x22c89e[_0x595d('0x2c')]=_['keys'](_0x398b51[_0x595d('0x2c')]);_0x22c89e['filters']=_[_0x595d('0x2e')](_0x22c89e[_0x595d('0x2f')],_0x22c89e[_0x595d('0x2c')]);_0x4b3abb[_0x595d('0x30')]=_['intersection'](_0x22c89e['model'],qs['fields'](_0x398b51['query']['fields']));_0x4b3abb[_0x595d('0x30')]=_0x4b3abb['attributes'][_0x595d('0x32')]?_0x4b3abb[_0x595d('0x30')]:_0x22c89e[_0x595d('0x2f')];if(_0x398b51[_0x595d('0x2c')]['includeAll']){_0x4b3abb[_0x595d('0x3c')]=[{'all':!![]}];}_0x4b3abb=_[_0x595d('0x38')]({},_0x4b3abb,_0x398b51[_0x595d('0x3a')]);return db['Dynamics365Configuration']['find'](_0x4b3abb)[_0x595d('0x22')](handleEntityNotFound(_0x5e7529,null))['then'](respondWithResult(_0x5e7529,null))[_0x595d('0x42')](handleError(_0x5e7529,null));};exports['create']=function(_0x20d2b0,_0x232325){return db['Dynamics365Configuration'][_0x595d('0x43')](_0x20d2b0[_0x595d('0x44')],{})[_0x595d('0x22')](respondWithResult(_0x232325,0xc9))[_0x595d('0x42')](handleError(_0x232325,null));};exports[_0x595d('0x45')]=function(_0x16f0fd,_0x468eb3){if(_0x16f0fd['body']['id']){delete _0x16f0fd[_0x595d('0x44')]['id'];}return db[_0x595d('0x28')][_0x595d('0x46')]({'where':{'id':_0x16f0fd[_0x595d('0x40')]['id']}})[_0x595d('0x22')](handleEntityNotFound(_0x468eb3,null))[_0x595d('0x22')](saveUpdates(_0x16f0fd[_0x595d('0x44')],null))[_0x595d('0x22')](respondWithResult(_0x468eb3,null))['catch'](handleError(_0x468eb3,null));};exports[_0x595d('0x23')]=function(_0x412522,_0x24494d){return db['Dynamics365Configuration'][_0x595d('0x46')]({'where':{'id':_0x412522[_0x595d('0x40')]['id']}})[_0x595d('0x22')](handleEntityNotFound(_0x24494d,null))['then'](removeEntity(_0x24494d,null))[_0x595d('0x42')](handleError(_0x24494d,null));};exports['getFields']=function(_0x49c238,_0x3f987b,_0x1e6f7d){var _0xa402b5={};var _0x4b1a19={};var _0x47d2cf;var _0x1a9aae;return db[_0x595d('0x28')][_0x595d('0x47')]({'where':{'id':_0x49c238['params']['id']}})[_0x595d('0x22')](handleEntityNotFound(_0x3f987b,null))[_0x595d('0x22')](function(_0x13b765){if(_0x13b765){_0x47d2cf=_0x13b765;_0x4b1a19[_0x595d('0x2f')]=_[_0x595d('0x41')](db['Dynamics365Field']['rawAttributes']);_0x4b1a19[_0x595d('0x2c')]=_['keys'](_0x49c238[_0x595d('0x2c')]);_0x4b1a19['filters']=_[_0x595d('0x2e')](_0x4b1a19['model'],_0x4b1a19['query']);_0xa402b5['attributes']=_[_0x595d('0x2e')](_0x4b1a19[_0x595d('0x2f')],qs[_0x595d('0x31')](_0x49c238[_0x595d('0x2c')][_0x595d('0x31')]));_0xa402b5[_0x595d('0x30')]=_0xa402b5[_0x595d('0x30')]['length']?_0xa402b5['attributes']:_0x4b1a19['model'];_0xa402b5[_0x595d('0x48')]=qs[_0x595d('0x35')](_0x49c238['query'][_0x595d('0x35')]);_0xa402b5[_0x595d('0x36')]=qs[_0x595d('0x2d')](_[_0x595d('0x49')](_0x49c238[_0x595d('0x2c')],_0x4b1a19['filters']));if(_0x49c238['query'][_0x595d('0x37')]){_0xa402b5[_0x595d('0x36')]=_[_0x595d('0x38')](_0xa402b5[_0x595d('0x36')],{'$or':_[_0x595d('0x27')](_0xa402b5[_0x595d('0x30')],function(_0x177a56){var _0xb4a0c0={};_0xb4a0c0[_0x177a56]={'$like':'%'+_0x49c238[_0x595d('0x2c')]['filter']+'%'};return _0xb4a0c0;})});}_0xa402b5=_[_0x595d('0x38')]({},_0xa402b5,_0x49c238[_0x595d('0x3a')]);return _0x47d2cf[_0x595d('0x4a')](_0xa402b5);}})[_0x595d('0x22')](function(_0x30ca17){if(_0x30ca17){_0x1a9aae=_0x30ca17[_0x595d('0x32')];if(!_0x49c238[_0x595d('0x2c')][_0x595d('0x33')]('nolimit')){_0xa402b5[_0x595d('0x1e')]=qs[_0x595d('0x1e')](_0x49c238[_0x595d('0x2c')]['limit']);_0xa402b5[_0x595d('0x1b')]=qs[_0x595d('0x1b')](_0x49c238['query'][_0x595d('0x1b')]);}return _0x47d2cf[_0x595d('0x4a')](_0xa402b5);}})[_0x595d('0x22')](function(_0x32c098){if(_0x32c098){return _0x32c098?{'count':_0x1a9aae,'rows':_0x32c098}:null;}})[_0x595d('0x22')](respondWithResult(_0x3f987b,null))[_0x595d('0x42')](handleError(_0x3f987b,null));};exports[_0x595d('0x4b')]=function(_0x448137,_0x3f453c,_0x306a3e){var _0x32664f={};var _0xb95315={};var _0x221b59;var _0x3479c7;return db[_0x595d('0x28')][_0x595d('0x47')]({'where':{'id':_0x448137[_0x595d('0x40')]['id']}})[_0x595d('0x22')](handleEntityNotFound(_0x3f453c,null))[_0x595d('0x22')](function(_0x4c4348){if(_0x4c4348){_0x221b59=_0x4c4348;_0xb95315[_0x595d('0x2f')]=_[_0x595d('0x41')](db['Dynamics365Field'][_0x595d('0x29')]);_0xb95315[_0x595d('0x2c')]=_[_0x595d('0x41')](_0x448137[_0x595d('0x2c')]);_0xb95315['filters']=_[_0x595d('0x2e')](_0xb95315[_0x595d('0x2f')],_0xb95315[_0x595d('0x2c')]);_0x32664f[_0x595d('0x30')]=_[_0x595d('0x2e')](_0xb95315[_0x595d('0x2f')],qs['fields'](_0x448137['query'][_0x595d('0x31')]));_0x32664f[_0x595d('0x30')]=_0x32664f[_0x595d('0x30')][_0x595d('0x32')]?_0x32664f[_0x595d('0x30')]:_0xb95315['model'];_0x32664f[_0x595d('0x48')]=qs[_0x595d('0x35')](_0x448137[_0x595d('0x2c')]['sort']);_0x32664f[_0x595d('0x36')]=qs[_0x595d('0x2d')](_[_0x595d('0x49')](_0x448137[_0x595d('0x2c')],_0xb95315[_0x595d('0x2d')]));if(_0x448137[_0x595d('0x2c')][_0x595d('0x37')]){_0x32664f[_0x595d('0x36')]=_[_0x595d('0x38')](_0x32664f[_0x595d('0x36')],{'$or':_[_0x595d('0x27')](_0x32664f[_0x595d('0x30')],function(_0x3bd104){var _0x3b6471={};_0x3b6471[_0x3bd104]={'$like':'%'+_0x448137['query'][_0x595d('0x37')]+'%'};return _0x3b6471;})});}_0x32664f=_['merge']({},_0x32664f,_0x448137['options']);return _0x221b59[_0x595d('0x4b')](_0x32664f);}})[_0x595d('0x22')](function(_0x1e1b9f){if(_0x1e1b9f){_0x3479c7=_0x1e1b9f[_0x595d('0x32')];if(!_0x448137['query'][_0x595d('0x33')](_0x595d('0x34'))){_0x32664f[_0x595d('0x1e')]=qs[_0x595d('0x1e')](_0x448137[_0x595d('0x2c')][_0x595d('0x1e')]);_0x32664f[_0x595d('0x1b')]=qs[_0x595d('0x1b')](_0x448137[_0x595d('0x2c')][_0x595d('0x1b')]);}return _0x221b59[_0x595d('0x4b')](_0x32664f);}})['then'](function(_0x1d8d44){if(_0x1d8d44){return _0x1d8d44?{'count':_0x3479c7,'rows':_0x1d8d44}:null;}})[_0x595d('0x22')](respondWithResult(_0x3f453c,null))[_0x595d('0x42')](handleError(_0x3f453c,null));};exports[_0x595d('0x4c')]=function(_0x2625a6,_0x4dfcbe,_0xb7f59){var _0x4f6c22={};var _0x10e407={};var _0x5a6a09;var _0x2f9ca3;return db['Dynamics365Configuration'][_0x595d('0x47')]({'where':{'id':_0x2625a6['params']['id']}})['then'](handleEntityNotFound(_0x4dfcbe,null))[_0x595d('0x22')](function(_0x59c38c){if(_0x59c38c){_0x5a6a09=_0x59c38c;_0x10e407[_0x595d('0x2f')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x10e407[_0x595d('0x2c')]=_[_0x595d('0x41')](_0x2625a6[_0x595d('0x2c')]);_0x10e407[_0x595d('0x2d')]=_['intersection'](_0x10e407[_0x595d('0x2f')],_0x10e407[_0x595d('0x2c')]);_0x4f6c22[_0x595d('0x30')]=_['intersection'](_0x10e407[_0x595d('0x2f')],qs[_0x595d('0x31')](_0x2625a6[_0x595d('0x2c')][_0x595d('0x31')]));_0x4f6c22[_0x595d('0x30')]=_0x4f6c22['attributes']['length']?_0x4f6c22['attributes']:_0x10e407['model'];_0x4f6c22[_0x595d('0x48')]=qs[_0x595d('0x35')](_0x2625a6[_0x595d('0x2c')][_0x595d('0x35')]);_0x4f6c22[_0x595d('0x36')]=qs[_0x595d('0x2d')](_[_0x595d('0x49')](_0x2625a6[_0x595d('0x2c')],_0x10e407['filters']));if(_0x2625a6['query'][_0x595d('0x37')]){_0x4f6c22[_0x595d('0x36')]=_[_0x595d('0x38')](_0x4f6c22[_0x595d('0x36')],{'$or':_[_0x595d('0x27')](_0x4f6c22[_0x595d('0x30')],function(_0x819c91){var _0x3bacca={};_0x3bacca[_0x819c91]={'$like':'%'+_0x2625a6[_0x595d('0x2c')][_0x595d('0x37')]+'%'};return _0x3bacca;})});}_0x4f6c22=_[_0x595d('0x38')]({},_0x4f6c22,_0x2625a6[_0x595d('0x3a')]);return _0x5a6a09['getDescriptions'](_0x4f6c22);}})[_0x595d('0x22')](function(_0xec7f71){if(_0xec7f71){_0x2f9ca3=_0xec7f71[_0x595d('0x32')];if(!_0x2625a6[_0x595d('0x2c')][_0x595d('0x33')](_0x595d('0x34'))){_0x4f6c22[_0x595d('0x1e')]=qs[_0x595d('0x1e')](_0x2625a6[_0x595d('0x2c')]['limit']);_0x4f6c22[_0x595d('0x1b')]=qs['offset'](_0x2625a6[_0x595d('0x2c')][_0x595d('0x1b')]);}return _0x5a6a09[_0x595d('0x4c')](_0x4f6c22);}})[_0x595d('0x22')](function(_0x3bc064){if(_0x3bc064){return _0x3bc064?{'count':_0x2f9ca3,'rows':_0x3bc064}:null;}})[_0x595d('0x22')](respondWithResult(_0x4dfcbe,null))['catch'](handleError(_0x4dfcbe,null));}; \ No newline at end of file +var _0xd71b=['getDescriptions','findOne','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','catch','show','params','Dynamics365Configuration','merge','find','then','create','body','Dynamics365Field','length','getFields','getSubjects'];(function(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0xd71b,0x94));var _0xbd71=function(_0x54f3bb,_0x35d68d){_0x54f3bb=_0x54f3bb-0x0;var _0x42ecf1=_0xd71b[_0x54f3bb];return _0x42ecf1;};'use strict';var emlformat=require(_0xbd71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd71('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbd71('0x2'));var Mustache=require(_0xbd71('0x3'));var util=require(_0xbd71('0x4'));var path=require(_0xbd71('0x5'));var sox=require(_0xbd71('0x6'));var csv=require(_0xbd71('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbd71('0x8'));var _=require(_0xbd71('0x9'));var squel=require(_0xbd71('0xa'));var crypto=require(_0xbd71('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xbd71('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xbd71('0xd'));var Redis=require(_0xbd71('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xbd71('0xf'));var as=require(_0xbd71('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbd71('0x11'))(_0xbd71('0x12'));var utils=require(_0xbd71('0x13'));var config=require(_0xbd71('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xbd71('0x15'))['db'];function respondWithStatusCode(_0x3d2614,_0x2fe467){_0x2fe467=_0x2fe467||0xcc;return function(_0x35e8bb){if(_0x35e8bb){return _0x3d2614[_0xbd71('0x16')](_0x2fe467);}return _0x3d2614[_0xbd71('0x17')](_0x2fe467)['end']();};}function respondWithResult(_0x83b06c,_0x4e98f5){_0x4e98f5=_0x4e98f5||0xc8;return function(_0x1ca5e4){if(_0x1ca5e4){return _0x83b06c[_0xbd71('0x17')](_0x4e98f5)[_0xbd71('0x18')](_0x1ca5e4);}};}function respondWithFilteredResult(_0x3abf2d,_0x44e606){return function(_0x5c1fa2){if(_0x5c1fa2){var _0x2324e5=typeof _0x44e606['offset']==='undefined'&&typeof _0x44e606['limit']==='undefined';var _0x34081e=_0x5c1fa2[_0xbd71('0x19')];var _0x38b8eb=_0x2324e5?0x0:_0x44e606[_0xbd71('0x1a')];var _0x2a5795=_0x2324e5?_0x5c1fa2[_0xbd71('0x19')]:_0x44e606[_0xbd71('0x1a')]+_0x44e606[_0xbd71('0x1b')];var _0x5341d9;if(_0x2a5795>=_0x34081e){_0x2a5795=_0x34081e;_0x5341d9=0xc8;}else{_0x5341d9=0xce;}_0x3abf2d[_0xbd71('0x17')](_0x5341d9);return _0x3abf2d['set']('Content-Range',_0x38b8eb+'-'+_0x2a5795+'/'+_0x34081e)[_0xbd71('0x18')](_0x5c1fa2);}return null;};}function patchUpdates(_0x5e9e58){return function(_0x3035f8){try{jsonpatch['apply'](_0x3035f8,_0x5e9e58,!![]);}catch(_0x5c94c9){return BPromise['reject'](_0x5c94c9);}return _0x3035f8['save']();};}function saveUpdates(_0x5902b4,_0x2fc513){return function(_0x257e55){if(_0x257e55){return _0x257e55[_0xbd71('0x1c')](_0x5902b4)['then'](function(_0x4ec97c){return _0x4ec97c;});}return null;};}function removeEntity(_0x405512,_0x28bf3e){return function(_0x4fac75){if(_0x4fac75){return _0x4fac75[_0xbd71('0x1d')]()['then'](function(){_0x405512[_0xbd71('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x8bf525,_0x36f030){return function(_0xc5afea){if(!_0xc5afea){_0x8bf525[_0xbd71('0x16')](0x194);}return _0xc5afea;};}function handleError(_0x22767d,_0x39411d){_0x39411d=_0x39411d||0x1f4;return function(_0x365d91){logger[_0xbd71('0x1e')](_0x365d91[_0xbd71('0x1f')]);if(_0x365d91[_0xbd71('0x20')]){delete _0x365d91[_0xbd71('0x20')];}_0x22767d[_0xbd71('0x17')](_0x39411d)[_0xbd71('0x21')](_0x365d91);};}exports[_0xbd71('0x22')]=function(_0x4bf513,_0xc63f10){var _0x2d03b3={},_0x2a9d66={},_0x5dcbde={'count':0x0,'rows':[]};var _0x58269c=_[_0xbd71('0x23')](db['Dynamics365Configuration'][_0xbd71('0x24')],function(_0xe7b2ae){return{'name':_0xe7b2ae[_0xbd71('0x25')],'type':_0xe7b2ae['type'][_0xbd71('0x26')]};});_0x2a9d66[_0xbd71('0x27')]=_['map'](_0x58269c,_0xbd71('0x20'));_0x2a9d66[_0xbd71('0x28')]=_[_0xbd71('0x29')](_0x4bf513[_0xbd71('0x28')]);_0x2a9d66[_0xbd71('0x2a')]=_[_0xbd71('0x2b')](_0x2a9d66[_0xbd71('0x27')],_0x2a9d66[_0xbd71('0x28')]);_0x2d03b3[_0xbd71('0x2c')]=_['intersection'](_0x2a9d66[_0xbd71('0x27')],qs[_0xbd71('0x2d')](_0x4bf513[_0xbd71('0x28')]['fields']));_0x2d03b3[_0xbd71('0x2c')]=_0x2d03b3[_0xbd71('0x2c')]['length']?_0x2d03b3[_0xbd71('0x2c')]:_0x2a9d66[_0xbd71('0x27')];if(!_0x4bf513[_0xbd71('0x28')][_0xbd71('0x2e')](_0xbd71('0x2f'))){_0x2d03b3[_0xbd71('0x1b')]=qs[_0xbd71('0x1b')](_0x4bf513[_0xbd71('0x28')][_0xbd71('0x1b')]);_0x2d03b3['offset']=qs[_0xbd71('0x1a')](_0x4bf513[_0xbd71('0x28')]['offset']);}_0x2d03b3[_0xbd71('0x30')]=qs['sort'](_0x4bf513[_0xbd71('0x28')][_0xbd71('0x31')]);_0x2d03b3[_0xbd71('0x32')]=qs['filters'](_[_0xbd71('0x33')](_0x4bf513['query'],_0x2a9d66[_0xbd71('0x2a')]),_0x58269c);if(_0x4bf513['query'][_0xbd71('0x34')]){_0x2d03b3[_0xbd71('0x32')]=_['merge'](_0x2d03b3[_0xbd71('0x32')],{'$or':_['map'](_0x58269c,function(_0x1b11c1){if(_0x1b11c1[_0xbd71('0x35')]!==_0xbd71('0x36')){var _0x53def2={};_0x53def2[_0x1b11c1[_0xbd71('0x20')]]={'$like':'%'+_0x4bf513[_0xbd71('0x28')][_0xbd71('0x34')]+'%'};return _0x53def2;}})});}_0x2d03b3=_['merge']({},_0x2d03b3,_0x4bf513[_0xbd71('0x37')]);var _0x4f0c88={'where':_0x2d03b3[_0xbd71('0x32')]};return db['Dynamics365Configuration'][_0xbd71('0x19')](_0x4f0c88)['then'](function(_0xcf37a0){_0x5dcbde[_0xbd71('0x19')]=_0xcf37a0;if(_0x4bf513[_0xbd71('0x28')][_0xbd71('0x38')]){_0x2d03b3[_0xbd71('0x39')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x2d03b3);})['then'](function(_0x5719d3){_0x5dcbde['rows']=_0x5719d3;return _0x5dcbde;})['then'](respondWithFilteredResult(_0xc63f10,_0x2d03b3))[_0xbd71('0x3a')](handleError(_0xc63f10,null));};exports[_0xbd71('0x3b')]=function(_0xfe41e2,_0x488783){var _0x3f7af0={'raw':![],'where':{'id':_0xfe41e2[_0xbd71('0x3c')]['id']}},_0x14dac={};_0x14dac[_0xbd71('0x27')]=_['keys'](db[_0xbd71('0x3d')]['rawAttributes']);_0x14dac[_0xbd71('0x28')]=_[_0xbd71('0x29')](_0xfe41e2[_0xbd71('0x28')]);_0x14dac[_0xbd71('0x2a')]=_[_0xbd71('0x2b')](_0x14dac[_0xbd71('0x27')],_0x14dac[_0xbd71('0x28')]);_0x3f7af0[_0xbd71('0x2c')]=_['intersection'](_0x14dac[_0xbd71('0x27')],qs[_0xbd71('0x2d')](_0xfe41e2[_0xbd71('0x28')][_0xbd71('0x2d')]));_0x3f7af0[_0xbd71('0x2c')]=_0x3f7af0['attributes']['length']?_0x3f7af0[_0xbd71('0x2c')]:_0x14dac[_0xbd71('0x27')];if(_0xfe41e2[_0xbd71('0x28')]['includeAll']){_0x3f7af0[_0xbd71('0x39')]=[{'all':!![]}];}_0x3f7af0=_[_0xbd71('0x3e')]({},_0x3f7af0,_0xfe41e2[_0xbd71('0x37')]);return db[_0xbd71('0x3d')][_0xbd71('0x3f')](_0x3f7af0)[_0xbd71('0x40')](handleEntityNotFound(_0x488783,null))['then'](respondWithResult(_0x488783,null))[_0xbd71('0x3a')](handleError(_0x488783,null));};exports[_0xbd71('0x41')]=function(_0x2a1d2c,_0x1c5951){return db[_0xbd71('0x3d')][_0xbd71('0x41')](_0x2a1d2c[_0xbd71('0x42')],{})['then'](respondWithResult(_0x1c5951,0xc9))['catch'](handleError(_0x1c5951,null));};exports[_0xbd71('0x1c')]=function(_0xef49e5,_0x4ccf54){if(_0xef49e5[_0xbd71('0x42')]['id']){delete _0xef49e5[_0xbd71('0x42')]['id'];}return db[_0xbd71('0x3d')][_0xbd71('0x3f')]({'where':{'id':_0xef49e5['params']['id']}})[_0xbd71('0x40')](handleEntityNotFound(_0x4ccf54,null))[_0xbd71('0x40')](saveUpdates(_0xef49e5['body'],null))['then'](respondWithResult(_0x4ccf54,null))[_0xbd71('0x3a')](handleError(_0x4ccf54,null));};exports[_0xbd71('0x1d')]=function(_0x1528ab,_0x4d0f4a){return db[_0xbd71('0x3d')]['find']({'where':{'id':_0x1528ab[_0xbd71('0x3c')]['id']}})['then'](handleEntityNotFound(_0x4d0f4a,null))[_0xbd71('0x40')](removeEntity(_0x4d0f4a,null))[_0xbd71('0x3a')](handleError(_0x4d0f4a,null));};exports['getFields']=function(_0xd9aae0,_0xc8907a,_0x45d80a){var _0x544f6c={};var _0xb546e5={};var _0x29200e;var _0x1c0746;return db[_0xbd71('0x3d')]['findOne']({'where':{'id':_0xd9aae0['params']['id']}})[_0xbd71('0x40')](handleEntityNotFound(_0xc8907a,null))[_0xbd71('0x40')](function(_0x3132e7){if(_0x3132e7){_0x29200e=_0x3132e7;_0xb546e5['model']=_[_0xbd71('0x29')](db[_0xbd71('0x43')][_0xbd71('0x24')]);_0xb546e5['query']=_['keys'](_0xd9aae0[_0xbd71('0x28')]);_0xb546e5['filters']=_[_0xbd71('0x2b')](_0xb546e5[_0xbd71('0x27')],_0xb546e5[_0xbd71('0x28')]);_0x544f6c[_0xbd71('0x2c')]=_[_0xbd71('0x2b')](_0xb546e5[_0xbd71('0x27')],qs[_0xbd71('0x2d')](_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x2d')]));_0x544f6c[_0xbd71('0x2c')]=_0x544f6c[_0xbd71('0x2c')][_0xbd71('0x44')]?_0x544f6c['attributes']:_0xb546e5[_0xbd71('0x27')];_0x544f6c[_0xbd71('0x30')]=qs['sort'](_0xd9aae0['query'][_0xbd71('0x31')]);_0x544f6c[_0xbd71('0x32')]=qs[_0xbd71('0x2a')](_[_0xbd71('0x33')](_0xd9aae0[_0xbd71('0x28')],_0xb546e5[_0xbd71('0x2a')]));if(_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x34')]){_0x544f6c[_0xbd71('0x32')]=_[_0xbd71('0x3e')](_0x544f6c[_0xbd71('0x32')],{'$or':_[_0xbd71('0x23')](_0x544f6c[_0xbd71('0x2c')],function(_0x1e95f1){var _0x226661={};_0x226661[_0x1e95f1]={'$like':'%'+_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x34')]+'%'};return _0x226661;})});}_0x544f6c=_[_0xbd71('0x3e')]({},_0x544f6c,_0xd9aae0[_0xbd71('0x37')]);return _0x29200e[_0xbd71('0x45')](_0x544f6c);}})[_0xbd71('0x40')](function(_0x549ade){if(_0x549ade){_0x1c0746=_0x549ade[_0xbd71('0x44')];if(!_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x2e')](_0xbd71('0x2f'))){_0x544f6c[_0xbd71('0x1b')]=qs[_0xbd71('0x1b')](_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x1b')]);_0x544f6c['offset']=qs[_0xbd71('0x1a')](_0xd9aae0[_0xbd71('0x28')][_0xbd71('0x1a')]);}return _0x29200e[_0xbd71('0x45')](_0x544f6c);}})[_0xbd71('0x40')](function(_0x3872f0){if(_0x3872f0){return _0x3872f0?{'count':_0x1c0746,'rows':_0x3872f0}:null;}})['then'](respondWithResult(_0xc8907a,null))[_0xbd71('0x3a')](handleError(_0xc8907a,null));};exports['getSubjects']=function(_0x139c6c,_0x225714,_0x1a252b){var _0x57496d={};var _0x2223cb={};var _0x29d9da;var _0x518e6f;return db[_0xbd71('0x3d')]['findOne']({'where':{'id':_0x139c6c[_0xbd71('0x3c')]['id']}})[_0xbd71('0x40')](handleEntityNotFound(_0x225714,null))[_0xbd71('0x40')](function(_0x350ba0){if(_0x350ba0){_0x29d9da=_0x350ba0;_0x2223cb['model']=_[_0xbd71('0x29')](db[_0xbd71('0x43')][_0xbd71('0x24')]);_0x2223cb[_0xbd71('0x28')]=_[_0xbd71('0x29')](_0x139c6c[_0xbd71('0x28')]);_0x2223cb[_0xbd71('0x2a')]=_[_0xbd71('0x2b')](_0x2223cb['model'],_0x2223cb[_0xbd71('0x28')]);_0x57496d[_0xbd71('0x2c')]=_['intersection'](_0x2223cb[_0xbd71('0x27')],qs[_0xbd71('0x2d')](_0x139c6c[_0xbd71('0x28')][_0xbd71('0x2d')]));_0x57496d[_0xbd71('0x2c')]=_0x57496d['attributes']['length']?_0x57496d[_0xbd71('0x2c')]:_0x2223cb[_0xbd71('0x27')];_0x57496d[_0xbd71('0x30')]=qs['sort'](_0x139c6c[_0xbd71('0x28')][_0xbd71('0x31')]);_0x57496d[_0xbd71('0x32')]=qs[_0xbd71('0x2a')](_[_0xbd71('0x33')](_0x139c6c[_0xbd71('0x28')],_0x2223cb[_0xbd71('0x2a')]));if(_0x139c6c[_0xbd71('0x28')][_0xbd71('0x34')]){_0x57496d[_0xbd71('0x32')]=_[_0xbd71('0x3e')](_0x57496d[_0xbd71('0x32')],{'$or':_[_0xbd71('0x23')](_0x57496d['attributes'],function(_0x2e2583){var _0x1f3270={};_0x1f3270[_0x2e2583]={'$like':'%'+_0x139c6c['query']['filter']+'%'};return _0x1f3270;})});}_0x57496d=_['merge']({},_0x57496d,_0x139c6c[_0xbd71('0x37')]);return _0x29d9da[_0xbd71('0x46')](_0x57496d);}})[_0xbd71('0x40')](function(_0x26e45a){if(_0x26e45a){_0x518e6f=_0x26e45a[_0xbd71('0x44')];if(!_0x139c6c[_0xbd71('0x28')]['hasOwnProperty'](_0xbd71('0x2f'))){_0x57496d[_0xbd71('0x1b')]=qs[_0xbd71('0x1b')](_0x139c6c[_0xbd71('0x28')][_0xbd71('0x1b')]);_0x57496d['offset']=qs['offset'](_0x139c6c['query'][_0xbd71('0x1a')]);}return _0x29d9da['getSubjects'](_0x57496d);}})['then'](function(_0x2fc25d){if(_0x2fc25d){return _0x2fc25d?{'count':_0x518e6f,'rows':_0x2fc25d}:null;}})[_0xbd71('0x40')](respondWithResult(_0x225714,null))[_0xbd71('0x3a')](handleError(_0x225714,null));};exports[_0xbd71('0x47')]=function(_0x170d0c,_0x28ab74,_0x323401){var _0x1c407e={};var _0x5c877f={};var _0x3761f5;var _0x1812cb;return db[_0xbd71('0x3d')][_0xbd71('0x48')]({'where':{'id':_0x170d0c['params']['id']}})[_0xbd71('0x40')](handleEntityNotFound(_0x28ab74,null))[_0xbd71('0x40')](function(_0x4f81d0){if(_0x4f81d0){_0x3761f5=_0x4f81d0;_0x5c877f[_0xbd71('0x27')]=_[_0xbd71('0x29')](db[_0xbd71('0x43')][_0xbd71('0x24')]);_0x5c877f[_0xbd71('0x28')]=_[_0xbd71('0x29')](_0x170d0c[_0xbd71('0x28')]);_0x5c877f[_0xbd71('0x2a')]=_[_0xbd71('0x2b')](_0x5c877f[_0xbd71('0x27')],_0x5c877f[_0xbd71('0x28')]);_0x1c407e[_0xbd71('0x2c')]=_[_0xbd71('0x2b')](_0x5c877f[_0xbd71('0x27')],qs['fields'](_0x170d0c[_0xbd71('0x28')][_0xbd71('0x2d')]));_0x1c407e[_0xbd71('0x2c')]=_0x1c407e[_0xbd71('0x2c')][_0xbd71('0x44')]?_0x1c407e[_0xbd71('0x2c')]:_0x5c877f[_0xbd71('0x27')];_0x1c407e[_0xbd71('0x30')]=qs[_0xbd71('0x31')](_0x170d0c[_0xbd71('0x28')][_0xbd71('0x31')]);_0x1c407e['where']=qs[_0xbd71('0x2a')](_[_0xbd71('0x33')](_0x170d0c[_0xbd71('0x28')],_0x5c877f[_0xbd71('0x2a')]));if(_0x170d0c[_0xbd71('0x28')][_0xbd71('0x34')]){_0x1c407e[_0xbd71('0x32')]=_[_0xbd71('0x3e')](_0x1c407e[_0xbd71('0x32')],{'$or':_[_0xbd71('0x23')](_0x1c407e[_0xbd71('0x2c')],function(_0x41ba1a){var _0x3ff1b3={};_0x3ff1b3[_0x41ba1a]={'$like':'%'+_0x170d0c['query']['filter']+'%'};return _0x3ff1b3;})});}_0x1c407e=_[_0xbd71('0x3e')]({},_0x1c407e,_0x170d0c['options']);return _0x3761f5['getDescriptions'](_0x1c407e);}})['then'](function(_0x187524){if(_0x187524){_0x1812cb=_0x187524[_0xbd71('0x44')];if(!_0x170d0c[_0xbd71('0x28')][_0xbd71('0x2e')]('nolimit')){_0x1c407e['limit']=qs['limit'](_0x170d0c[_0xbd71('0x28')][_0xbd71('0x1b')]);_0x1c407e[_0xbd71('0x1a')]=qs[_0xbd71('0x1a')](_0x170d0c[_0xbd71('0x28')][_0xbd71('0x1a')]);}return _0x3761f5[_0xbd71('0x47')](_0x1c407e);}})[_0xbd71('0x40')](function(_0x20efc8){if(_0x20efc8){return _0x20efc8?{'count':_0x1812cb,'rows':_0x20efc8}:null;}})['then'](respondWithResult(_0x28ab74,null))[_0xbd71('0x3a')](handleError(_0x28ab74,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 63bc19a..5190456 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 _0x55ca=['./intDynamics365Configuration.attributes','exports','define','int_dynamics365_configurations','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x55ca,0x126));var _0xa55c=function(_0x1a3ca2,_0xe144e7){_0x1a3ca2=_0x1a3ca2-0x0;var _0x30ea08=_0x55ca[_0x1a3ca2];return _0x30ea08;};'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')]('Dynamics365Configuration',attributes,{'tableName':_0xa55c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa9e0=['../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','lodash','util','../../config/logger','bluebird','path','rimraf'];(function(_0xe7c4b4,_0x24fd07){var _0x30024b=function(_0x4c09ec){while(--_0x4c09ec){_0xe7c4b4['push'](_0xe7c4b4['shift']());}};_0x30024b(++_0x24fd07);}(_0xa9e0,0x123));var _0x0a9e=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xa9e0[_0x173d7e];return _0x2220d6;};'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':'int_dynamics365_configurations','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 682b6e2..c807950 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 _0xd2d6=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash'];(function(_0x5e0c1b,_0x4f4477){var _0x4bc390=function(_0x373c95){while(--_0x373c95){_0x5e0c1b['push'](_0x5e0c1b['shift']());}};_0x4bc390(++_0x4f4477);}(_0xd2d6,0x1cb));var _0x6d2d=function(_0x198836,_0x44dc96){_0x198836=_0x198836-0x0;var _0x55c67d=_0xd2d6[_0x198836];return _0x55c67d;};'use strict';var _=require(_0x6d2d('0x0'));var util=require(_0x6d2d('0x1'));var moment=require(_0x6d2d('0x2'));var BPromise=require(_0x6d2d('0x3'));var rs=require(_0x6d2d('0x4'));var fs=require('fs');var Redis=require(_0x6d2d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d2d('0x6'));var logger=require(_0x6d2d('0x7'))(_0x6d2d('0x8'));var config=require('../../config/environment');var jayson=require(_0x6d2d('0x9'));var client=jayson[_0x6d2d('0xa')][_0x6d2d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x224f9d,_0x11e19f,_0x928408){return new BPromise(function(_0x3411b0,_0x83821e){return client['request'](_0x224f9d,_0x928408)['then'](function(_0x6c0459){logger['info'](_0x6d2d('0xc'),_0x11e19f,_0x6d2d('0xd'));logger[_0x6d2d('0xe')](_0x6d2d('0xf'),_0x11e19f,_0x6d2d('0xd'),JSON[_0x6d2d('0x10')](_0x6c0459));if(_0x6c0459[_0x6d2d('0x11')]){if(_0x6c0459[_0x6d2d('0x11')][_0x6d2d('0x12')]===0x1f4){logger[_0x6d2d('0x11')](_0x6d2d('0xc'),_0x11e19f,_0x6c0459[_0x6d2d('0x11')][_0x6d2d('0x13')]);return _0x83821e(_0x6c0459[_0x6d2d('0x11')][_0x6d2d('0x13')]);}logger[_0x6d2d('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x11e19f,_0x6c0459[_0x6d2d('0x11')][_0x6d2d('0x13')]);return _0x3411b0(_0x6c0459[_0x6d2d('0x11')][_0x6d2d('0x13')]);}else{logger[_0x6d2d('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x11e19f,'request\x20sent');_0x3411b0(_0x6c0459[_0x6d2d('0x15')][_0x6d2d('0x13')]);}})[_0x6d2d('0x16')](function(_0x4dbfd2){logger[_0x6d2d('0x11')](_0x6d2d('0xc'),_0x11e19f,_0x4dbfd2);_0x83821e(_0x4dbfd2);});});} \ No newline at end of file +var _0x4c02=['info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x5eafb7,_0x585c2c){var _0x292994=function(_0x53daa3){while(--_0x53daa3){_0x5eafb7['push'](_0x5eafb7['shift']());}};_0x292994(++_0x585c2c);}(_0x4c02,0x105));var _0x24c0=function(_0x46c8fb,_0x253501){_0x46c8fb=_0x46c8fb-0x0;var _0x48f9eb=_0x4c02[_0x46c8fb];return _0x48f9eb;};'use strict';var _=require(_0x24c0('0x0'));var util=require(_0x24c0('0x1'));var moment=require(_0x24c0('0x2'));var BPromise=require(_0x24c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24c0('0x4'))['db'];var utils=require(_0x24c0('0x5'));var logger=require(_0x24c0('0x6'))(_0x24c0('0x7'));var config=require(_0x24c0('0x8'));var jayson=require(_0x24c0('0x9'));var client=jayson[_0x24c0('0xa')][_0x24c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4e4682,_0x418bae,_0x79edfd){return new BPromise(function(_0x20ed6d,_0x5158eb){return client[_0x24c0('0xc')](_0x4e4682,_0x79edfd)[_0x24c0('0xd')](function(_0x279d53){logger[_0x24c0('0xe')](_0x24c0('0xf'),_0x418bae,_0x24c0('0x10'));logger[_0x24c0('0x11')](_0x24c0('0x12'),_0x418bae,_0x24c0('0x10'),JSON[_0x24c0('0x13')](_0x279d53));if(_0x279d53[_0x24c0('0x14')]){if(_0x279d53['error'][_0x24c0('0x15')]===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x418bae,_0x279d53[_0x24c0('0x14')][_0x24c0('0x16')]);return _0x5158eb(_0x279d53[_0x24c0('0x14')][_0x24c0('0x16')]);}logger[_0x24c0('0x14')](_0x24c0('0xf'),_0x418bae,_0x279d53[_0x24c0('0x14')]['message']);return _0x20ed6d(_0x279d53[_0x24c0('0x14')][_0x24c0('0x16')]);}else{logger['info'](_0x24c0('0xf'),_0x418bae,_0x24c0('0x10'));_0x20ed6d(_0x279d53[_0x24c0('0x17')][_0x24c0('0x16')]);}})[_0x24c0('0x18')](function(_0x7056e0){logger[_0x24c0('0x14')]('Dynamics365Configuration,\x20%s,\x20%s',_0x418bae,_0x7056e0);_0x5158eb(_0x7056e0);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index c69f739..34400a1 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 _0xc8e0=['../../components/auth/service','../../components/interaction/service','./intDynamics365Field.controller','isAuthenticated','get','/:id','show','create','put','destroy','exports','util','path','express','fs-extra'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xc8e0,0x65));var _0x0c8e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc8e0[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require('multer');var util=require(_0x0c8e('0x0'));var path=require(_0x0c8e('0x1'));var timeout=require('connect-timeout');var express=require(_0x0c8e('0x2'));var router=express['Router']();var fs_extra=require(_0x0c8e('0x3'));var auth=require(_0x0c8e('0x4'));var interaction=require(_0x0c8e('0x5'));var config=require('../../config/environment');var controller=require(_0x0c8e('0x6'));router['get']('/',auth[_0x0c8e('0x7')](),controller['index']);router[_0x0c8e('0x8')](_0x0c8e('0x9'),auth[_0x0c8e('0x7')](),controller[_0x0c8e('0xa')]);router['post']('/',auth[_0x0c8e('0x7')](),controller[_0x0c8e('0xb')]);router[_0x0c8e('0xc')](_0x0c8e('0x9'),auth[_0x0c8e('0x7')](),controller['update']);router['delete'](_0x0c8e('0x9'),auth[_0x0c8e('0x7')](),controller[_0x0c8e('0xd')]);module[_0x0c8e('0xe')]=router; \ No newline at end of file +var _0x8824=['get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x24c0b8,_0x50eadd){var _0x34c932=function(_0x3e4c2d){while(--_0x3e4c2d){_0x24c0b8['push'](_0x24c0b8['shift']());}};_0x34c932(++_0x50eadd);}(_0x8824,0x65));var _0x4882=function(_0x392ab3,_0x34665a){_0x392ab3=_0x392ab3-0x0;var _0x4ec486=_0x8824[_0x392ab3];return _0x4ec486;};'use strict';var multer=require(_0x4882('0x0'));var util=require('util');var path=require(_0x4882('0x1'));var timeout=require(_0x4882('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4882('0x3'));var auth=require(_0x4882('0x4'));var interaction=require(_0x4882('0x5'));var config=require(_0x4882('0x6'));var controller=require('./intDynamics365Field.controller');router[_0x4882('0x7')]('/',auth[_0x4882('0x8')](),controller[_0x4882('0x9')]);router[_0x4882('0x7')](_0x4882('0xa'),auth['isAuthenticated'](),controller[_0x4882('0xb')]);router[_0x4882('0xc')]('/',auth[_0x4882('0x8')](),controller[_0x4882('0xd')]);router[_0x4882('0xe')](_0x4882('0xa'),auth[_0x4882('0x8')](),controller[_0x4882('0xf')]);router['delete'](_0x4882('0xa'),auth[_0x4882('0x8')](),controller[_0x4882('0x10')]);module[_0x4882('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 18c988a..bb2d449 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 _0xf41e=['BOOLEAN','exports','string','variable','customVariable','keyValue','picklist','STRING','ENUM'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0xf41e,0x13c));var _0xef41=function(_0x4dd370,_0x3f1ff0){_0x4dd370=_0x4dd370-0x0;var _0x14adc3=_0xf41e[_0x4dd370];return _0x14adc3;};'use strict';var Sequelize=require('sequelize');module[_0xef41('0x0')]={'type':{'type':Sequelize['ENUM'](_0xef41('0x1'),_0xef41('0x2'),_0xef41('0x3'),_0xef41('0x4'),_0xef41('0x5')),'defaultValue':_0xef41('0x1')},'content':{'type':Sequelize[_0xef41('0x6')]},'key':{'type':Sequelize[_0xef41('0x6')]},'keyType':{'type':Sequelize[_0xef41('0x7')](_0xef41('0x1'),_0xef41('0x2'),_0xef41('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xef41('0x6')]},'nameField':{'type':Sequelize[_0xef41('0x6')]},'customField':{'type':Sequelize[_0xef41('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xef41('0x6')]}}; \ No newline at end of file +var _0x5d0a=['customVariable','sequelize','exports','string','variable','STRING','ENUM'];(function(_0x152d1a,_0x369400){var _0x404a02=function(_0x31fadb){while(--_0x31fadb){_0x152d1a['push'](_0x152d1a['shift']());}};_0x404a02(++_0x369400);}(_0x5d0a,0x135));var _0xa5d0=function(_0x44e627,_0x2506b2){_0x44e627=_0x44e627-0x0;var _0x5be6f8=_0x5d0a[_0x44e627];return _0x5be6f8;};'use strict';var Sequelize=require(_0xa5d0('0x0'));module[_0xa5d0('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa5d0('0x2'),_0xa5d0('0x3'),'customVariable','keyValue','picklist'),'defaultValue':_0xa5d0('0x2')},'content':{'type':Sequelize[_0xa5d0('0x4')]},'key':{'type':Sequelize[_0xa5d0('0x4')]},'keyType':{'type':Sequelize[_0xa5d0('0x5')](_0xa5d0('0x2'),'variable',_0xa5d0('0x6'))},'keyContent':{'type':Sequelize[_0xa5d0('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa5d0('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index de8c329..9334998 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 _0xde37=['status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','map','Dynamics365Field','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','intersection','include','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x2e8abe,_0x3504a7){var _0x2838f9=function(_0x5581c2){while(--_0x5581c2){_0x2e8abe['push'](_0x2e8abe['shift']());}};_0x2838f9(++_0x3504a7);}(_0xde37,0x1d5));var _0x7de3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde37[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x7de3('0x0'));var rimraf=require(_0x7de3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7de3('0x2'));var rp=require(_0x7de3('0x3'));var moment=require(_0x7de3('0x4'));var BPromise=require(_0x7de3('0x5'));var Mustache=require(_0x7de3('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7de3('0x7'));var ejs=require(_0x7de3('0x8'));var fs=require('fs');var fs_extra=require(_0x7de3('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7de3('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x7de3('0xb'));var toCsv=require('to-csv');var querystring=require(_0x7de3('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7de3('0xd'));var qs=require(_0x7de3('0xe'));var as=require(_0x7de3('0xf'));var hardwareService=require(_0x7de3('0x10'));var logger=require(_0x7de3('0x11'))(_0x7de3('0x12'));var utils=require(_0x7de3('0x13'));var config=require(_0x7de3('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b20d6,_0x2e2622){_0x2e2622=_0x2e2622||0xcc;return function(_0x1e42ce){if(_0x1e42ce){return _0x1b20d6['sendStatus'](_0x2e2622);}return _0x1b20d6['status'](_0x2e2622)['end']();};}function respondWithResult(_0x4e4496,_0x56e048){_0x56e048=_0x56e048||0xc8;return function(_0x362721){if(_0x362721){return _0x4e4496[_0x7de3('0x15')](_0x56e048)[_0x7de3('0x16')](_0x362721);}};}function respondWithFilteredResult(_0xa2de3f,_0xc95008){return function(_0x138109){if(_0x138109){var _0x3dae82=typeof _0xc95008['offset']===_0x7de3('0x17')&&typeof _0xc95008[_0x7de3('0x18')]===_0x7de3('0x17');var _0x1324dc=_0x138109[_0x7de3('0x19')];var _0x2280bd=_0x3dae82?0x0:_0xc95008[_0x7de3('0x1a')];var _0x5d8f70=_0x3dae82?_0x138109[_0x7de3('0x19')]:_0xc95008[_0x7de3('0x1a')]+_0xc95008['limit'];var _0x5a216d;if(_0x5d8f70>=_0x1324dc){_0x5d8f70=_0x1324dc;_0x5a216d=0xc8;}else{_0x5a216d=0xce;}_0xa2de3f[_0x7de3('0x15')](_0x5a216d);return _0xa2de3f[_0x7de3('0x1b')](_0x7de3('0x1c'),_0x2280bd+'-'+_0x5d8f70+'/'+_0x1324dc)['json'](_0x138109);}return null;};}function patchUpdates(_0x330799){return function(_0x43cb96){try{jsonpatch[_0x7de3('0x1d')](_0x43cb96,_0x330799,!![]);}catch(_0x1a05b6){return BPromise[_0x7de3('0x1e')](_0x1a05b6);}return _0x43cb96[_0x7de3('0x1f')]();};}function saveUpdates(_0x2e9b9c,_0x2acb5c){return function(_0x345069){if(_0x345069){return _0x345069[_0x7de3('0x20')](_0x2e9b9c)[_0x7de3('0x21')](function(_0x426ab5){return _0x426ab5;});}return null;};}function removeEntity(_0x5bc1f2,_0x385a14){return function(_0x4cadf3){if(_0x4cadf3){return _0x4cadf3[_0x7de3('0x22')]()[_0x7de3('0x21')](function(){_0x5bc1f2[_0x7de3('0x15')](0xcc)[_0x7de3('0x23')]();});}};}function handleEntityNotFound(_0x16abdc,_0x33f5ec){return function(_0x5638b4){if(!_0x5638b4){_0x16abdc[_0x7de3('0x24')](0x194);}return _0x5638b4;};}function handleError(_0x25590f,_0x3a6d7d){_0x3a6d7d=_0x3a6d7d||0x1f4;return function(_0x2ed379){logger[_0x7de3('0x25')](_0x2ed379[_0x7de3('0x26')]);if(_0x2ed379[_0x7de3('0x27')]){delete _0x2ed379[_0x7de3('0x27')];}_0x25590f[_0x7de3('0x15')](_0x3a6d7d)['send'](_0x2ed379);};}exports[_0x7de3('0x28')]=function(_0x5a134d,_0x201a39){var _0x369725={},_0x1b9183={},_0x124f89={'count':0x0,'rows':[]};var _0x393ad5=_[_0x7de3('0x29')](db[_0x7de3('0x2a')][_0x7de3('0x2b')],function(_0x3b1ba5){return{'name':_0x3b1ba5[_0x7de3('0x2c')],'type':_0x3b1ba5['type']['key']};});_0x1b9183[_0x7de3('0x2d')]=_[_0x7de3('0x29')](_0x393ad5,'name');_0x1b9183[_0x7de3('0x2e')]=_[_0x7de3('0x2f')](_0x5a134d[_0x7de3('0x2e')]);_0x1b9183[_0x7de3('0x30')]=_['intersection'](_0x1b9183['model'],_0x1b9183[_0x7de3('0x2e')]);_0x369725[_0x7de3('0x31')]=_['intersection'](_0x1b9183['model'],qs[_0x7de3('0x32')](_0x5a134d[_0x7de3('0x2e')]['fields']));_0x369725[_0x7de3('0x31')]=_0x369725[_0x7de3('0x31')]['length']?_0x369725[_0x7de3('0x31')]:_0x1b9183['model'];if(!_0x5a134d['query'][_0x7de3('0x33')](_0x7de3('0x34'))){_0x369725['limit']=qs[_0x7de3('0x18')](_0x5a134d[_0x7de3('0x2e')][_0x7de3('0x18')]);_0x369725[_0x7de3('0x1a')]=qs[_0x7de3('0x1a')](_0x5a134d[_0x7de3('0x2e')][_0x7de3('0x1a')]);}_0x369725['order']=qs[_0x7de3('0x35')](_0x5a134d[_0x7de3('0x2e')][_0x7de3('0x35')]);_0x369725[_0x7de3('0x36')]=qs['filters'](_[_0x7de3('0x37')](_0x5a134d[_0x7de3('0x2e')],_0x1b9183[_0x7de3('0x30')]),_0x393ad5);if(_0x5a134d[_0x7de3('0x2e')][_0x7de3('0x38')]){_0x369725[_0x7de3('0x36')]=_[_0x7de3('0x39')](_0x369725[_0x7de3('0x36')],{'$or':_[_0x7de3('0x29')](_0x393ad5,function(_0x51e6a5){if(_0x51e6a5['type']!==_0x7de3('0x3a')){var _0x26fad5={};_0x26fad5[_0x51e6a5[_0x7de3('0x27')]]={'$like':'%'+_0x5a134d[_0x7de3('0x2e')]['filter']+'%'};return _0x26fad5;}})});}_0x369725=_[_0x7de3('0x39')]({},_0x369725,_0x5a134d[_0x7de3('0x3b')]);var _0x3a3cee={'where':_0x369725['where']};return db['Dynamics365Field']['count'](_0x3a3cee)[_0x7de3('0x21')](function(_0xca58f){_0x124f89[_0x7de3('0x19')]=_0xca58f;if(_0x5a134d[_0x7de3('0x2e')][_0x7de3('0x3c')]){_0x369725['include']=[{'all':!![]}];}return db[_0x7de3('0x2a')]['findAll'](_0x369725);})[_0x7de3('0x21')](function(_0x119da3){_0x124f89[_0x7de3('0x3d')]=_0x119da3;return _0x124f89;})['then'](respondWithFilteredResult(_0x201a39,_0x369725))[_0x7de3('0x3e')](handleError(_0x201a39,null));};exports[_0x7de3('0x3f')]=function(_0x4e3bad,_0x31504f){var _0x1e122b={'raw':!![],'where':{'id':_0x4e3bad[_0x7de3('0x40')]['id']}},_0x141b51={};_0x141b51[_0x7de3('0x2d')]=_[_0x7de3('0x2f')](db[_0x7de3('0x2a')][_0x7de3('0x2b')]);_0x141b51['query']=_[_0x7de3('0x2f')](_0x4e3bad[_0x7de3('0x2e')]);_0x141b51[_0x7de3('0x30')]=_[_0x7de3('0x41')](_0x141b51[_0x7de3('0x2d')],_0x141b51[_0x7de3('0x2e')]);_0x1e122b[_0x7de3('0x31')]=_[_0x7de3('0x41')](_0x141b51[_0x7de3('0x2d')],qs['fields'](_0x4e3bad[_0x7de3('0x2e')][_0x7de3('0x32')]));_0x1e122b['attributes']=_0x1e122b['attributes']['length']?_0x1e122b['attributes']:_0x141b51[_0x7de3('0x2d')];if(_0x4e3bad['query'][_0x7de3('0x3c')]){_0x1e122b[_0x7de3('0x42')]=[{'all':!![]}];}_0x1e122b=_[_0x7de3('0x39')]({},_0x1e122b,_0x4e3bad[_0x7de3('0x3b')]);return db[_0x7de3('0x2a')][_0x7de3('0x43')](_0x1e122b)['then'](handleEntityNotFound(_0x31504f,null))[_0x7de3('0x21')](respondWithResult(_0x31504f,null))[_0x7de3('0x3e')](handleError(_0x31504f,null));};exports[_0x7de3('0x44')]=function(_0x6759fb,_0x4d3465){return db['Dynamics365Field']['create'](_0x6759fb['body'],{})[_0x7de3('0x21')](respondWithResult(_0x4d3465,0xc9))['catch'](handleError(_0x4d3465,null));};exports['update']=function(_0x5b8881,_0x447de8){if(_0x5b8881[_0x7de3('0x45')]['id']){delete _0x5b8881[_0x7de3('0x45')]['id'];}return db[_0x7de3('0x2a')][_0x7de3('0x43')]({'where':{'id':_0x5b8881[_0x7de3('0x40')]['id']}})[_0x7de3('0x21')](handleEntityNotFound(_0x447de8,null))['then'](saveUpdates(_0x5b8881[_0x7de3('0x45')],null))['then'](respondWithResult(_0x447de8,null))[_0x7de3('0x3e')](handleError(_0x447de8,null));};exports[_0x7de3('0x22')]=function(_0x382f2d,_0x40c365){return db[_0x7de3('0x2a')][_0x7de3('0x43')]({'where':{'id':_0x382f2d['params']['id']}})[_0x7de3('0x21')](handleEntityNotFound(_0x40c365,null))[_0x7de3('0x21')](removeEntity(_0x40c365,null))[_0x7de3('0x3e')](handleError(_0x40c365,null));}; \ No newline at end of file +var _0x167d=['json','offset','undefined','count','set','Content-Range','reject','save','then','error','stack','name','send','map','Dynamics365Field','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','nolimit','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','show','length','find','create','body','catch','params','rimraf','zip-dir','fast-json-patch','request-promise','util','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','end','status'];(function(_0x537cf6,_0x4f21b7){var _0xd4bdd8=function(_0x31da4c){while(--_0x31da4c){_0x537cf6['push'](_0x537cf6['shift']());}};_0xd4bdd8(++_0x4f21b7);}(_0x167d,0x1bb));var _0xd167=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x167d[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd167('0x0'));var zipdir=require(_0xd167('0x1'));var jsonpatch=require(_0xd167('0x2'));var rp=require(_0xd167('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd167('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xd167('0x5'));var ejs=require(_0xd167('0x6'));var fs=require('fs');var fs_extra=require(_0xd167('0x7'));var _=require(_0xd167('0x8'));var squel=require(_0xd167('0x9'));var crypto=require(_0xd167('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd167('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd167('0xc'));var Papa=require(_0xd167('0xd'));var Redis=require(_0xd167('0xe'));var authService=require(_0xd167('0xf'));var qs=require(_0xd167('0x10'));var as=require(_0xd167('0x11'));var hardwareService=require(_0xd167('0x12'));var logger=require(_0xd167('0x13'))(_0xd167('0x14'));var utils=require(_0xd167('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xd167('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5929b3,_0x868765){_0x868765=_0x868765||0xcc;return function(_0x2cd395){if(_0x2cd395){return _0x5929b3[_0xd167('0x17')](_0x868765);}return _0x5929b3['status'](_0x868765)[_0xd167('0x18')]();};}function respondWithResult(_0x396826,_0x306d7d){_0x306d7d=_0x306d7d||0xc8;return function(_0x5b7805){if(_0x5b7805){return _0x396826[_0xd167('0x19')](_0x306d7d)[_0xd167('0x1a')](_0x5b7805);}};}function respondWithFilteredResult(_0x55ccd6,_0x244640){return function(_0x1a8b06){if(_0x1a8b06){var _0x38935d=typeof _0x244640[_0xd167('0x1b')]===_0xd167('0x1c')&&typeof _0x244640['limit']===_0xd167('0x1c');var _0x4a50ec=_0x1a8b06[_0xd167('0x1d')];var _0x11f81b=_0x38935d?0x0:_0x244640[_0xd167('0x1b')];var _0x12a164=_0x38935d?_0x1a8b06['count']:_0x244640[_0xd167('0x1b')]+_0x244640['limit'];var _0x2b2837;if(_0x12a164>=_0x4a50ec){_0x12a164=_0x4a50ec;_0x2b2837=0xc8;}else{_0x2b2837=0xce;}_0x55ccd6[_0xd167('0x19')](_0x2b2837);return _0x55ccd6[_0xd167('0x1e')](_0xd167('0x1f'),_0x11f81b+'-'+_0x12a164+'/'+_0x4a50ec)[_0xd167('0x1a')](_0x1a8b06);}return null;};}function patchUpdates(_0x2ccbc5){return function(_0x3cd253){try{jsonpatch['apply'](_0x3cd253,_0x2ccbc5,!![]);}catch(_0x1ec3b1){return BPromise[_0xd167('0x20')](_0x1ec3b1);}return _0x3cd253[_0xd167('0x21')]();};}function saveUpdates(_0x404e1c,_0x118e1f){return function(_0x6b5661){if(_0x6b5661){return _0x6b5661['update'](_0x404e1c)[_0xd167('0x22')](function(_0x196e1a){return _0x196e1a;});}return null;};}function removeEntity(_0x5acf10,_0x3240e0){return function(_0x482afd){if(_0x482afd){return _0x482afd['destroy']()[_0xd167('0x22')](function(){_0x5acf10[_0xd167('0x19')](0xcc)[_0xd167('0x18')]();});}};}function handleEntityNotFound(_0x4cf5f0,_0x4aedf0){return function(_0x41c0ec){if(!_0x41c0ec){_0x4cf5f0[_0xd167('0x17')](0x194);}return _0x41c0ec;};}function handleError(_0x5f3f7b,_0x42f1fe){_0x42f1fe=_0x42f1fe||0x1f4;return function(_0x4ada6c){logger[_0xd167('0x23')](_0x4ada6c[_0xd167('0x24')]);if(_0x4ada6c[_0xd167('0x25')]){delete _0x4ada6c[_0xd167('0x25')];}_0x5f3f7b['status'](_0x42f1fe)[_0xd167('0x26')](_0x4ada6c);};}exports['index']=function(_0x359c9e,_0x320e57){var _0x4e319f={},_0x570fec={},_0x32bff1={'count':0x0,'rows':[]};var _0x53ee39=_[_0xd167('0x27')](db[_0xd167('0x28')][_0xd167('0x29')],function(_0x55ada5){return{'name':_0x55ada5['fieldName'],'type':_0x55ada5[_0xd167('0x2a')]['key']};});_0x570fec[_0xd167('0x2b')]=_[_0xd167('0x27')](_0x53ee39,_0xd167('0x25'));_0x570fec[_0xd167('0x2c')]=_[_0xd167('0x2d')](_0x359c9e[_0xd167('0x2c')]);_0x570fec[_0xd167('0x2e')]=_[_0xd167('0x2f')](_0x570fec[_0xd167('0x2b')],_0x570fec[_0xd167('0x2c')]);_0x4e319f[_0xd167('0x30')]=_[_0xd167('0x2f')](_0x570fec[_0xd167('0x2b')],qs[_0xd167('0x31')](_0x359c9e[_0xd167('0x2c')][_0xd167('0x31')]));_0x4e319f[_0xd167('0x30')]=_0x4e319f[_0xd167('0x30')]['length']?_0x4e319f[_0xd167('0x30')]:_0x570fec[_0xd167('0x2b')];if(!_0x359c9e['query']['hasOwnProperty'](_0xd167('0x32'))){_0x4e319f['limit']=qs['limit'](_0x359c9e['query']['limit']);_0x4e319f['offset']=qs[_0xd167('0x1b')](_0x359c9e[_0xd167('0x2c')][_0xd167('0x1b')]);}_0x4e319f['order']=qs['sort'](_0x359c9e[_0xd167('0x2c')]['sort']);_0x4e319f[_0xd167('0x33')]=qs[_0xd167('0x2e')](_[_0xd167('0x34')](_0x359c9e[_0xd167('0x2c')],_0x570fec[_0xd167('0x2e')]),_0x53ee39);if(_0x359c9e[_0xd167('0x2c')][_0xd167('0x35')]){_0x4e319f[_0xd167('0x33')]=_[_0xd167('0x36')](_0x4e319f['where'],{'$or':_[_0xd167('0x27')](_0x53ee39,function(_0x38842d){if(_0x38842d[_0xd167('0x2a')]!==_0xd167('0x37')){var _0x55c356={};_0x55c356[_0x38842d[_0xd167('0x25')]]={'$like':'%'+_0x359c9e[_0xd167('0x2c')][_0xd167('0x35')]+'%'};return _0x55c356;}})});}_0x4e319f=_[_0xd167('0x36')]({},_0x4e319f,_0x359c9e[_0xd167('0x38')]);var _0x1c0de2={'where':_0x4e319f['where']};return db[_0xd167('0x28')][_0xd167('0x1d')](_0x1c0de2)[_0xd167('0x22')](function(_0x269800){_0x32bff1[_0xd167('0x1d')]=_0x269800;if(_0x359c9e[_0xd167('0x2c')][_0xd167('0x39')]){_0x4e319f[_0xd167('0x3a')]=[{'all':!![]}];}return db[_0xd167('0x28')]['findAll'](_0x4e319f);})[_0xd167('0x22')](function(_0x1c1cf8){_0x32bff1[_0xd167('0x3b')]=_0x1c1cf8;return _0x32bff1;})[_0xd167('0x22')](respondWithFilteredResult(_0x320e57,_0x4e319f))['catch'](handleError(_0x320e57,null));};exports[_0xd167('0x3c')]=function(_0xaf0d95,_0x5ede0e){var _0x5bc274={'raw':!![],'where':{'id':_0xaf0d95['params']['id']}},_0x43f04d={};_0x43f04d[_0xd167('0x2b')]=_[_0xd167('0x2d')](db[_0xd167('0x28')][_0xd167('0x29')]);_0x43f04d[_0xd167('0x2c')]=_['keys'](_0xaf0d95['query']);_0x43f04d[_0xd167('0x2e')]=_[_0xd167('0x2f')](_0x43f04d[_0xd167('0x2b')],_0x43f04d['query']);_0x5bc274[_0xd167('0x30')]=_[_0xd167('0x2f')](_0x43f04d[_0xd167('0x2b')],qs[_0xd167('0x31')](_0xaf0d95['query'][_0xd167('0x31')]));_0x5bc274[_0xd167('0x30')]=_0x5bc274['attributes'][_0xd167('0x3d')]?_0x5bc274[_0xd167('0x30')]:_0x43f04d[_0xd167('0x2b')];if(_0xaf0d95[_0xd167('0x2c')][_0xd167('0x39')]){_0x5bc274[_0xd167('0x3a')]=[{'all':!![]}];}_0x5bc274=_[_0xd167('0x36')]({},_0x5bc274,_0xaf0d95['options']);return db[_0xd167('0x28')][_0xd167('0x3e')](_0x5bc274)['then'](handleEntityNotFound(_0x5ede0e,null))['then'](respondWithResult(_0x5ede0e,null))['catch'](handleError(_0x5ede0e,null));};exports[_0xd167('0x3f')]=function(_0x447f24,_0x28e7f8){return db[_0xd167('0x28')][_0xd167('0x3f')](_0x447f24[_0xd167('0x40')],{})['then'](respondWithResult(_0x28e7f8,0xc9))[_0xd167('0x41')](handleError(_0x28e7f8,null));};exports['update']=function(_0xd2d695,_0x160daa){if(_0xd2d695[_0xd167('0x40')]['id']){delete _0xd2d695['body']['id'];}return db['Dynamics365Field'][_0xd167('0x3e')]({'where':{'id':_0xd2d695['params']['id']}})[_0xd167('0x22')](handleEntityNotFound(_0x160daa,null))[_0xd167('0x22')](saveUpdates(_0xd2d695['body'],null))[_0xd167('0x22')](respondWithResult(_0x160daa,null))[_0xd167('0x41')](handleError(_0x160daa,null));};exports['destroy']=function(_0x3b2c9c,_0x47a1c6){return db[_0xd167('0x28')][_0xd167('0x3e')]({'where':{'id':_0x3b2c9c[_0xd167('0x42')]['id']}})['then'](handleEntityNotFound(_0x47a1c6,null))[_0xd167('0x22')](removeEntity(_0x47a1c6,null))[_0xd167('0x41')](handleError(_0x47a1c6,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index a05cde7..b29f060 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 _0xb965=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash'];(function(_0x4bae62,_0x10a523){var _0x1907b5=function(_0x541d38){while(--_0x541d38){_0x4bae62['push'](_0x4bae62['shift']());}};_0x1907b5(++_0x10a523);}(_0xb965,0x18f));var _0x5b96=function(_0x52be03,_0x5bf5f6){_0x52be03=_0x52be03-0x0;var _0xc64bda=_0xb965[_0x52be03];return _0xc64bda;};'use strict';var _=require(_0x5b96('0x0'));var util=require(_0x5b96('0x1'));var logger=require(_0x5b96('0x2'))(_0x5b96('0x3'));var moment=require(_0x5b96('0x4'));var BPromise=require(_0x5b96('0x5'));var rp=require(_0x5b96('0x6'));var fs=require('fs');var path=require(_0x5b96('0x7'));var rimraf=require(_0x5b96('0x8'));var config=require(_0x5b96('0x9'));var attributes=require('./intDynamics365Field.attributes');module[_0x5b96('0xa')]=function(_0x3ff4be,_0x44e0fd){return _0x3ff4be[_0x5b96('0xb')](_0x5b96('0xc'),attributes,{'tableName':_0x5b96('0xd'),'paranoid':![],'indexes':[{'name':_0x5b96('0xe'),'fields':[_0x5b96('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea58=['./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','idField','FieldId','lodash','util','api','moment','request-promise'];(function(_0x4a6db6,_0x1d30d2){var _0xcd17ef=function(_0x2754f3){while(--_0x2754f3){_0x4a6db6['push'](_0x4a6db6['shift']());}};_0xcd17ef(++_0x1d30d2);}(_0xea58,0x8a));var _0x8ea5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xea58[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8ea5('0x0'));var util=require(_0x8ea5('0x1'));var logger=require('../../config/logger')(_0x8ea5('0x2'));var moment=require(_0x8ea5('0x3'));var BPromise=require('bluebird');var rp=require(_0x8ea5('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ea5('0x5'));module[_0x8ea5('0x6')]=function(_0x17ce14,_0x36347e){return _0x17ce14[_0x8ea5('0x7')]('Dynamics365Field',attributes,{'tableName':_0x8ea5('0x8'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x8ea5('0x9'),_0x8ea5('0xa')],'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 dce65e5..cc6076b 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 _0x671b=['debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent'];(function(_0x3b507d,_0x54d3a6){var _0x4dca9b=function(_0x314aae){while(--_0x314aae){_0x3b507d['push'](_0x3b507d['shift']());}};_0x4dca9b(++_0x54d3a6);}(_0x671b,0xd9));var _0xb671=function(_0x143291,_0x13f2a8){_0x143291=_0x143291-0x0;var _0x498789=_0x671b[_0x143291];return _0x498789;};'use strict';var _=require(_0xb671('0x0'));var util=require(_0xb671('0x1'));var moment=require(_0xb671('0x2'));var BPromise=require(_0xb671('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb671('0x4'))['db'];var utils=require(_0xb671('0x5'));var logger=require(_0xb671('0x6'))(_0xb671('0x7'));var config=require('../../config/environment');var jayson=require(_0xb671('0x8'));var client=jayson[_0xb671('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24607d,_0x434e2f,_0x1052aa){return new BPromise(function(_0x1472ee,_0x17654c){return client['request'](_0x24607d,_0x1052aa)[_0xb671('0xa')](function(_0x4cdc69){logger[_0xb671('0xb')](_0xb671('0xc'),_0x434e2f,_0xb671('0xd'));logger[_0xb671('0xe')](_0xb671('0xf'),_0x434e2f,'request\x20sent',JSON['stringify'](_0x4cdc69));if(_0x4cdc69['error']){if(_0x4cdc69[_0xb671('0x10')][_0xb671('0x11')]===0x1f4){logger[_0xb671('0x10')](_0xb671('0xc'),_0x434e2f,_0x4cdc69[_0xb671('0x10')][_0xb671('0x12')]);return _0x17654c(_0x4cdc69[_0xb671('0x10')][_0xb671('0x12')]);}logger[_0xb671('0x10')](_0xb671('0xc'),_0x434e2f,_0x4cdc69[_0xb671('0x10')][_0xb671('0x12')]);return _0x1472ee(_0x4cdc69[_0xb671('0x10')]['message']);}else{logger['info'](_0xb671('0xc'),_0x434e2f,_0xb671('0xd'));_0x1472ee(_0x4cdc69[_0xb671('0x13')][_0xb671('0x12')]);}})[_0xb671('0x14')](function(_0x292d68){logger[_0xb671('0x10')](_0xb671('0xc'),_0x434e2f,_0x292d68);_0x17654c(_0x292d68);});});} \ No newline at end of file +var _0x59f5=['Dynamics365Field,\x20%s,\x20%s','message','result','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x38ee7e,_0x74efc8){var _0x590e16=function(_0x19f0aa){while(--_0x19f0aa){_0x38ee7e['push'](_0x38ee7e['shift']());}};_0x590e16(++_0x74efc8);}(_0x59f5,0x67));var _0x559f=function(_0x2288c2,_0x502819){_0x2288c2=_0x2288c2-0x0;var _0x571dff=_0x59f5[_0x2288c2];return _0x571dff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x559f('0x0'));var BPromise=require(_0x559f('0x1'));var rs=require(_0x559f('0x2'));var fs=require('fs');var Redis=require(_0x559f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x559f('0x4'));var logger=require(_0x559f('0x5'))(_0x559f('0x6'));var config=require(_0x559f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x559f('0x8')][_0x559f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5cedbf,_0x56c19e,_0x4861d3){return new BPromise(function(_0x4dd3cd,_0xaf8af8){return client[_0x559f('0xa')](_0x5cedbf,_0x4861d3)[_0x559f('0xb')](function(_0x530173){logger[_0x559f('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x56c19e,_0x559f('0xd'));logger['debug'](_0x559f('0xe'),_0x56c19e,_0x559f('0xd'),JSON[_0x559f('0xf')](_0x530173));if(_0x530173[_0x559f('0x10')]){if(_0x530173[_0x559f('0x10')]['code']===0x1f4){logger[_0x559f('0x10')](_0x559f('0x11'),_0x56c19e,_0x530173[_0x559f('0x10')]['message']);return _0xaf8af8(_0x530173[_0x559f('0x10')][_0x559f('0x12')]);}logger['error'](_0x559f('0x11'),_0x56c19e,_0x530173[_0x559f('0x10')]['message']);return _0x4dd3cd(_0x530173[_0x559f('0x10')][_0x559f('0x12')]);}else{logger['info'](_0x559f('0x11'),_0x56c19e,_0x559f('0xd'));_0x4dd3cd(_0x530173[_0x559f('0x13')][_0x559f('0x12')]);}})['catch'](function(_0x283621){logger[_0x559f('0x10')](_0x559f('0x11'),_0x56c19e,_0x283621);_0xaf8af8(_0x283621);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 194259d..1340d22 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 _0xf239=['isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x206328,_0x520087){var _0x245ef8=function(_0x341218){while(--_0x341218){_0x206328['push'](_0x206328['shift']());}};_0x245ef8(++_0x520087);}(_0xf239,0x1af));var _0x9f23=function(_0x4d4fcf,_0x41bcea){_0x4d4fcf=_0x4d4fcf-0x0;var _0x31b21c=_0xf239[_0x4d4fcf];return _0x31b21c;};'use strict';var multer=require('multer');var util=require(_0x9f23('0x0'));var path=require(_0x9f23('0x1'));var timeout=require('connect-timeout');var express=require(_0x9f23('0x2'));var router=express[_0x9f23('0x3')]();var fs_extra=require(_0x9f23('0x4'));var auth=require(_0x9f23('0x5'));var interaction=require(_0x9f23('0x6'));var config=require(_0x9f23('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x9f23('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9f23('0x8')](_0x9f23('0x9'),auth[_0x9f23('0xa')](),controller['show']);router[_0x9f23('0x8')](_0x9f23('0xb'),auth[_0x9f23('0xa')](),controller[_0x9f23('0xc')]);router[_0x9f23('0x8')](_0x9f23('0xd'),auth[_0x9f23('0xa')](),controller[_0x9f23('0xe')]);router[_0x9f23('0xf')]('/',auth[_0x9f23('0xa')](),controller[_0x9f23('0x10')]);router[_0x9f23('0xf')]('/:id/configurations',auth[_0x9f23('0xa')](),controller[_0x9f23('0x11')]);router[_0x9f23('0x12')](_0x9f23('0x9'),auth[_0x9f23('0xa')](),controller[_0x9f23('0x13')]);router['delete']('/:id',auth[_0x9f23('0xa')](),controller['destroy']);module[_0x9f23('0x14')]=router; \ No newline at end of file +var _0xee3c=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','getFields','create','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x516a4a,_0x41a72b){var _0x3fef51=function(_0x148002){while(--_0x148002){_0x516a4a['push'](_0x516a4a['shift']());}};_0x3fef51(++_0x41a72b);}(_0xee3c,0x1c3));var _0xcee3=function(_0x11364e,_0x3d50fd){_0x11364e=_0x11364e-0x0;var _0x254c7f=_0xee3c[_0x11364e];return _0x254c7f;};'use strict';var multer=require(_0xcee3('0x0'));var util=require(_0xcee3('0x1'));var path=require(_0xcee3('0x2'));var timeout=require(_0xcee3('0x3'));var express=require(_0xcee3('0x4'));var router=express[_0xcee3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xcee3('0x6'));var interaction=require(_0xcee3('0x7'));var config=require(_0xcee3('0x8'));var controller=require('./intFreshdeskAccount.controller');router[_0xcee3('0x9')]('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0xb')]);router['get']('/:id',auth[_0xcee3('0xa')](),controller[_0xcee3('0xc')]);router[_0xcee3('0x9')](_0xcee3('0xd'),auth[_0xcee3('0xa')](),controller[_0xcee3('0xe')]);router[_0xcee3('0x9')]('/:id/fields',auth[_0xcee3('0xa')](),controller[_0xcee3('0xf')]);router['post']('/',auth[_0xcee3('0xa')](),controller[_0xcee3('0x10')]);router[_0xcee3('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller['addConfiguration']);router[_0xcee3('0x12')](_0xcee3('0x13'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x14')]);router[_0xcee3('0x15')](_0xcee3('0x13'),auth[_0xcee3('0xa')](),controller[_0xcee3('0x16')]);module[_0xcee3('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 4ae83aa..0a162d0 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(_0x500785,_0x15e5ff){var _0x1f8bcc=function(_0x406983){while(--_0x406983){_0x500785['push'](_0x500785['shift']());}};_0x1f8bcc(++_0x15e5ff);}(_0xadb5,0xad));var _0x5adb=function(_0x19de64,_0x1772ae){_0x19de64=_0x19de64-0x0;var _0x53fde4=_0xadb5[_0x19de64];return _0x53fde4;};'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 _0x33af=['exports','STRING','username','remoteUri'];(function(_0x5389f4,_0x1bc406){var _0x175115=function(_0x41a0d0){while(--_0x41a0d0){_0x5389f4['push'](_0x5389f4['shift']());}};_0x175115(++_0x1bc406);}(_0x33af,0xec));var _0xf33a=function(_0x9e9ead,_0x1a7ff3){_0x9e9ead=_0x9e9ead-0x0;var _0x31ff57=_0x33af[_0x9e9ead];return _0x31ff57;};'use strict';var Sequelize=require('sequelize');module[_0xf33a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf33a('0x1')]},'username':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x2')},'apiKey':{'type':Sequelize[_0xf33a('0x1')]},'remoteUri':{'type':Sequelize[_0xf33a('0x1')],'unique':_0xf33a('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 7885235..6288dc2 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 _0x93e6=['where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','catch','create','body','update','find','getConfigurations','findOne','params','FreshdeskConfiguration','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','FreshdeskField','getFields','remoteUri','slice','lastIndexOf','GET','%s/%s','api/v2/ticket_fields','format','Basic\x20%s','%s:X','toString','base64','requester','description','priority','group','source','remove','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','moment','mustache','util','path','to-csv','ejs','fs-extra','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','index','FreshdeskAccount','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x2c2d99,_0x1a61ce){var _0xc9af40=function(_0x4bc502){while(--_0x4bc502){_0x2c2d99['push'](_0x2c2d99['shift']());}};_0xc9af40(++_0x1a61ce);}(_0x93e6,0x11e));var _0x693e=function(_0x2822b3,_0x49842b){_0x2822b3=_0x2822b3-0x0;var _0x4b9178=_0x93e6[_0x2822b3];return _0x4b9178;};'use strict';var emlformat=require(_0x693e('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x693e('0x1'));var rp=require('request-promise');var moment=require(_0x693e('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x693e('0x3'));var util=require(_0x693e('0x4'));var path=require(_0x693e('0x5'));var sox=require('sox');var csv=require(_0x693e('0x6'));var ejs=require(_0x693e('0x7'));var fs=require('fs');var fs_extra=require(_0x693e('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x693e('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x693e('0x6'));var querystring=require(_0x693e('0xa'));var Papa=require(_0x693e('0xb'));var Redis=require('ioredis');var authService=require(_0x693e('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x693e('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x693e('0xe'))('api');var utils=require('../../config/utils');var config=require(_0x693e('0xf'));var licenseUtil=require(_0x693e('0x10'));var db=require(_0x693e('0x11'))['db'];var integrations=require(_0x693e('0x12'));function respondWithStatusCode(_0x5bc8a3,_0x256143){_0x256143=_0x256143||0xcc;return function(_0x172b79){if(_0x172b79){return _0x5bc8a3[_0x693e('0x13')](_0x256143);}return _0x5bc8a3[_0x693e('0x14')](_0x256143)[_0x693e('0x15')]();};}function respondWithResult(_0x2d8e11,_0x3e44ba){_0x3e44ba=_0x3e44ba||0xc8;return function(_0x4a7626){if(_0x4a7626){return _0x2d8e11[_0x693e('0x14')](_0x3e44ba)[_0x693e('0x16')](_0x4a7626);}};}function respondWithFilteredResult(_0xb91404,_0x54d946){return function(_0x18b748){if(_0x18b748){var _0x7103b1=typeof _0x54d946[_0x693e('0x17')]===_0x693e('0x18')&&typeof _0x54d946[_0x693e('0x19')]===_0x693e('0x18');var _0x31a0bc=_0x18b748['count'];var _0x593916=_0x7103b1?0x0:_0x54d946['offset'];var _0x149325=_0x7103b1?_0x18b748[_0x693e('0x1a')]:_0x54d946['offset']+_0x54d946['limit'];var _0x809b63;if(_0x149325>=_0x31a0bc){_0x149325=_0x31a0bc;_0x809b63=0xc8;}else{_0x809b63=0xce;}_0xb91404[_0x693e('0x14')](_0x809b63);return _0xb91404[_0x693e('0x1b')](_0x693e('0x1c'),_0x593916+'-'+_0x149325+'/'+_0x31a0bc)['json'](_0x18b748);}return null;};}function patchUpdates(_0x21dbdc){return function(_0x40aee8){try{jsonpatch[_0x693e('0x1d')](_0x40aee8,_0x21dbdc,!![]);}catch(_0x48f7c2){return BPromise[_0x693e('0x1e')](_0x48f7c2);}return _0x40aee8[_0x693e('0x1f')]();};}function saveUpdates(_0x569646,_0x433d14){return function(_0x1e5c04){if(_0x1e5c04){return _0x1e5c04['update'](_0x569646)[_0x693e('0x20')](function(_0x2c9340){return _0x2c9340;});}return null;};}function removeEntity(_0x51f0f0,_0x3847be){return function(_0x25c39e){if(_0x25c39e){return _0x25c39e[_0x693e('0x21')]()[_0x693e('0x20')](function(){_0x51f0f0[_0x693e('0x14')](0xcc)[_0x693e('0x15')]();});}};}function handleEntityNotFound(_0x24b9bf,_0x13fcb9){return function(_0x2225f4){if(!_0x2225f4){_0x24b9bf[_0x693e('0x13')](0x194);}return _0x2225f4;};}function handleError(_0x761568,_0x17cbb6){_0x17cbb6=_0x17cbb6||0x1f4;return function(_0x232883){logger[_0x693e('0x22')](_0x232883[_0x693e('0x23')]);if(_0x232883[_0x693e('0x24')]){delete _0x232883[_0x693e('0x24')];}_0x761568[_0x693e('0x14')](_0x17cbb6)['send'](_0x232883);};}exports[_0x693e('0x25')]=function(_0x1c002d,_0x1ea8e1){var _0x3d350b={},_0x26b9c4={},_0x5f3b88={'count':0x0,'rows':[]};var _0x207fc4=_['map'](db[_0x693e('0x26')]['rawAttributes'],function(_0x279c2e){return{'name':_0x279c2e[_0x693e('0x27')],'type':_0x279c2e['type'][_0x693e('0x28')]};});_0x26b9c4[_0x693e('0x29')]=_['map'](_0x207fc4,_0x693e('0x24'));_0x26b9c4[_0x693e('0x2a')]=_[_0x693e('0x2b')](_0x1c002d[_0x693e('0x2a')]);_0x26b9c4[_0x693e('0x2c')]=_[_0x693e('0x2d')](_0x26b9c4[_0x693e('0x29')],_0x26b9c4[_0x693e('0x2a')]);_0x3d350b[_0x693e('0x2e')]=_[_0x693e('0x2d')](_0x26b9c4[_0x693e('0x29')],qs[_0x693e('0x2f')](_0x1c002d[_0x693e('0x2a')][_0x693e('0x2f')]));_0x3d350b[_0x693e('0x2e')]=_0x3d350b[_0x693e('0x2e')][_0x693e('0x30')]?_0x3d350b[_0x693e('0x2e')]:_0x26b9c4[_0x693e('0x29')];if(!_0x1c002d['query'][_0x693e('0x31')](_0x693e('0x32'))){_0x3d350b['limit']=qs[_0x693e('0x19')](_0x1c002d[_0x693e('0x2a')]['limit']);_0x3d350b['offset']=qs[_0x693e('0x17')](_0x1c002d[_0x693e('0x2a')][_0x693e('0x17')]);}_0x3d350b[_0x693e('0x33')]=qs[_0x693e('0x34')](_0x1c002d[_0x693e('0x2a')][_0x693e('0x34')]);_0x3d350b[_0x693e('0x35')]=qs['filters'](_[_0x693e('0x36')](_0x1c002d[_0x693e('0x2a')],_0x26b9c4['filters']),_0x207fc4);if(_0x1c002d[_0x693e('0x2a')][_0x693e('0x37')]){_0x3d350b[_0x693e('0x35')]=_[_0x693e('0x38')](_0x3d350b[_0x693e('0x35')],{'$or':_[_0x693e('0x39')](_0x207fc4,function(_0x3fa71f){if(_0x3fa71f['type']!==_0x693e('0x3a')){var _0x1c93c6={};_0x1c93c6[_0x3fa71f[_0x693e('0x24')]]={'$like':'%'+_0x1c002d['query'][_0x693e('0x37')]+'%'};return _0x1c93c6;}})});}_0x3d350b=_['merge']({},_0x3d350b,_0x1c002d[_0x693e('0x3b')]);var _0x8a2f3={'where':_0x3d350b['where']};return db['FreshdeskAccount'][_0x693e('0x1a')](_0x8a2f3)[_0x693e('0x20')](function(_0x1303e0){_0x5f3b88[_0x693e('0x1a')]=_0x1303e0;if(_0x1c002d[_0x693e('0x2a')][_0x693e('0x3c')]){_0x3d350b[_0x693e('0x3d')]=[{'all':!![]}];}return db[_0x693e('0x26')][_0x693e('0x3e')](_0x3d350b);})[_0x693e('0x20')](function(_0x45a329){_0x5f3b88[_0x693e('0x3f')]=_0x45a329;return _0x5f3b88;})['then'](respondWithFilteredResult(_0x1ea8e1,_0x3d350b))['catch'](handleError(_0x1ea8e1,null));};exports[_0x693e('0x40')]=function(_0x288d86,_0x2c26d0){var _0x461047={'raw':![],'where':{'id':_0x288d86['params']['id']}},_0x291244={};_0x291244[_0x693e('0x29')]=_[_0x693e('0x2b')](db[_0x693e('0x26')][_0x693e('0x41')]);_0x291244[_0x693e('0x2a')]=_[_0x693e('0x2b')](_0x288d86[_0x693e('0x2a')]);_0x291244[_0x693e('0x2c')]=_['intersection'](_0x291244[_0x693e('0x29')],_0x291244['query']);_0x461047[_0x693e('0x2e')]=_[_0x693e('0x2d')](_0x291244['model'],qs[_0x693e('0x2f')](_0x288d86[_0x693e('0x2a')][_0x693e('0x2f')]));_0x461047['attributes']=_0x461047[_0x693e('0x2e')][_0x693e('0x30')]?_0x461047[_0x693e('0x2e')]:_0x291244[_0x693e('0x29')];if(_0x288d86[_0x693e('0x2a')][_0x693e('0x3c')]){_0x461047[_0x693e('0x3d')]=[{'all':!![]}];}_0x461047=_[_0x693e('0x38')]({},_0x461047,_0x288d86[_0x693e('0x3b')]);return db[_0x693e('0x26')]['find'](_0x461047)['then'](handleEntityNotFound(_0x2c26d0,null))[_0x693e('0x20')](respondWithResult(_0x2c26d0,null))[_0x693e('0x42')](handleError(_0x2c26d0,null));};exports[_0x693e('0x43')]=function(_0x419be2,_0x83e206){return db['FreshdeskAccount'][_0x693e('0x43')](_0x419be2[_0x693e('0x44')],{})[_0x693e('0x20')](respondWithResult(_0x83e206,0xc9))[_0x693e('0x42')](handleError(_0x83e206,null));};exports[_0x693e('0x45')]=function(_0x1186f3,_0x511c69){if(_0x1186f3[_0x693e('0x44')]['id']){delete _0x1186f3[_0x693e('0x44')]['id'];}return db[_0x693e('0x26')][_0x693e('0x46')]({'where':{'id':_0x1186f3['params']['id']}})[_0x693e('0x20')](handleEntityNotFound(_0x511c69,null))['then'](saveUpdates(_0x1186f3[_0x693e('0x44')],null))[_0x693e('0x20')](respondWithResult(_0x511c69,null))[_0x693e('0x42')](handleError(_0x511c69,null));};exports[_0x693e('0x21')]=function(_0x245229,_0x2085a5){return db[_0x693e('0x26')][_0x693e('0x46')]({'where':{'id':_0x245229['params']['id']}})['then'](handleEntityNotFound(_0x2085a5,null))[_0x693e('0x20')](removeEntity(_0x2085a5,null))[_0x693e('0x42')](handleError(_0x2085a5,null));};exports[_0x693e('0x47')]=function(_0x1fc19f,_0x382781,_0x56b553){var _0x3a7b63={};var _0x2bb552={};var _0x573ce1;var _0x2c2406;return db[_0x693e('0x26')][_0x693e('0x48')]({'where':{'id':_0x1fc19f[_0x693e('0x49')]['id']}})[_0x693e('0x20')](handleEntityNotFound(_0x382781,null))[_0x693e('0x20')](function(_0x1b9a0f){if(_0x1b9a0f){_0x573ce1=_0x1b9a0f;_0x2bb552[_0x693e('0x29')]=_[_0x693e('0x2b')](db[_0x693e('0x4a')][_0x693e('0x41')]);_0x2bb552[_0x693e('0x2a')]=_[_0x693e('0x2b')](_0x1fc19f['query']);_0x2bb552['filters']=_['intersection'](_0x2bb552[_0x693e('0x29')],_0x2bb552[_0x693e('0x2a')]);_0x3a7b63[_0x693e('0x2e')]=_[_0x693e('0x2d')](_0x2bb552[_0x693e('0x29')],qs['fields'](_0x1fc19f['query'][_0x693e('0x2f')]));_0x3a7b63[_0x693e('0x2e')]=_0x3a7b63[_0x693e('0x2e')][_0x693e('0x30')]?_0x3a7b63[_0x693e('0x2e')]:_0x2bb552[_0x693e('0x29')];_0x3a7b63['order']=qs[_0x693e('0x34')](_0x1fc19f[_0x693e('0x2a')][_0x693e('0x34')]);_0x3a7b63[_0x693e('0x35')]=qs['filters'](_['pick'](_0x1fc19f[_0x693e('0x2a')],_0x2bb552[_0x693e('0x2c')]));if(_0x1fc19f['query'][_0x693e('0x37')]){_0x3a7b63[_0x693e('0x35')]=_[_0x693e('0x38')](_0x3a7b63[_0x693e('0x35')],{'$or':_[_0x693e('0x39')](_0x3a7b63[_0x693e('0x2e')],function(_0x4f0855){var _0x5de7ec={};_0x5de7ec[_0x4f0855]={'$like':'%'+_0x1fc19f[_0x693e('0x2a')][_0x693e('0x37')]+'%'};return _0x5de7ec;})});}_0x3a7b63=_['merge']({},_0x3a7b63,_0x1fc19f['options']);return _0x573ce1[_0x693e('0x47')](_0x3a7b63);}})[_0x693e('0x20')](function(_0x1d2882){if(_0x1d2882){_0x2c2406=_0x1d2882[_0x693e('0x30')];if(!_0x1fc19f[_0x693e('0x2a')][_0x693e('0x31')](_0x693e('0x32'))){_0x3a7b63['limit']=qs[_0x693e('0x19')](_0x1fc19f[_0x693e('0x2a')]['limit']);_0x3a7b63['offset']=qs[_0x693e('0x17')](_0x1fc19f[_0x693e('0x2a')]['offset']);}return _0x573ce1[_0x693e('0x47')](_0x3a7b63);}})[_0x693e('0x20')](function(_0x47bfa9){if(_0x47bfa9){return _0x47bfa9?{'count':_0x2c2406,'rows':_0x47bfa9}:null;}})[_0x693e('0x20')](respondWithResult(_0x382781,null))[_0x693e('0x42')](handleError(_0x382781,null));};exports[_0x693e('0x4b')]=function(_0x45ef00,_0x1c8f53,_0xcf3116){if(_0x45ef00[_0x693e('0x44')]['id']){delete _0x45ef00[_0x693e('0x44')]['id'];}return db[_0x693e('0x26')][_0x693e('0x48')]({'where':{'id':_0x45ef00[_0x693e('0x49')]['id']}})[_0x693e('0x20')](handleEntityNotFound(_0x1c8f53,null))[_0x693e('0x20')](function(_0x1f3f26){if(_0x1f3f26){_0x45ef00[_0x693e('0x44')][_0x693e('0x4c')]=_0x1f3f26['id'];_0x45ef00[_0x693e('0x44')][_0x693e('0x4d')]=integrations[_0x693e('0x4e')](_0x45ef00[_0x693e('0x44')]['channel'],_0x45ef00['body'][_0x693e('0x4f')]);_0x45ef00[_0x693e('0x44')][_0x693e('0x50')]=integrations[_0x693e('0x51')](_0x45ef00['body'][_0x693e('0x52')],_0x45ef00[_0x693e('0x44')][_0x693e('0x4f')]);return db[_0x693e('0x4a')][_0x693e('0x43')](_0x45ef00[_0x693e('0x44')],{'include':[{'model':db[_0x693e('0x53')],'as':_0x693e('0x4d')},{'model':db[_0x693e('0x53')],'as':'Descriptions'}]});}return null;})[_0x693e('0x20')](respondWithResult(_0x1c8f53,null))[_0x693e('0x42')](handleError(_0x1c8f53,null));};exports[_0x693e('0x54')]=function(_0x537668,_0x2a91b2,_0xdc879b){var _0x2efb85='';return db[_0x693e('0x26')]['findOne']({'where':{'id':_0x537668[_0x693e('0x49')]['id']},'attributes':['id',_0x693e('0x55'),'apiKey']})[_0x693e('0x20')](handleEntityNotFound(_0x2a91b2,null))[_0x693e('0x20')](function(_0x57bfe3){if(_0x57bfe3){_0x2efb85=_0x57bfe3['remoteUri'];var _0x513d06=_0x2efb85[_0x693e('0x56')](-0x1);if(_0x513d06==='/'){_0x2efb85=_0x2efb85['substring'](0x0,_0x2efb85[_0x693e('0x57')](_0x513d06));}return rp({'method':_0x693e('0x58'),'uri':util['format'](_0x693e('0x59'),_0x2efb85,_0x693e('0x5a')),'headers':{'Authorization':util[_0x693e('0x5b')](_0x693e('0x5c'),new Buffer(util[_0x693e('0x5b')](_0x693e('0x5d'),_0x57bfe3['apiKey']))[_0x693e('0x5e')](_0x693e('0x5f')))},'json':!![]});}})[_0x693e('0x20')](function(_0x433a83){if(_0x433a83){var _0x2e4bef=[_0x693e('0x60'),'subject','agent',_0x693e('0x61'),'status',_0x693e('0x62'),_0x693e('0x63'),_0x693e('0x64'),'ticket_type',_0x693e('0x63'),'company'];_[_0x693e('0x65')](_0x433a83,function(_0x1b80e2){return _0x2e4bef['includes'](_0x1b80e2[_0x693e('0x24')])||!_0x1b80e2[_0x693e('0x66')]&&_0x1b80e2[_0x693e('0x4f')]!==_0x693e('0x67')&&_0x1b80e2[_0x693e('0x4f')]!==_0x693e('0x68');});return{'count':_0x433a83[_0x693e('0x30')],'rows':_[_0x693e('0x39')](_0x433a83,function(_0x4823fa){return{'id':_0x4823fa[_0x693e('0x24')],'name':_0x4823fa['label'],'custom':!_0x4823fa[_0x693e('0x66')],'options':_0x4823fa[_0x693e('0x69')]?_['map'](_0x4823fa['choices'],function(_0x2320c9){return{'name':_[_0x693e('0x6a')](_0x2320c9),'value':_0x2320c9};}):[]};})};}})[_0x693e('0x20')](respondWithResult(_0x2a91b2,null))['catch'](function(_0x435aa3){var _0xb92505=_0x537668[_0x693e('0x2a')][_0x693e('0x6b')]?0x1f4:_0x435aa3[_0x693e('0x6c')]||0x1f4;logger[_0x693e('0x22')](_0x693e('0x6d'),_0x693e('0x54'),_0xb92505,JSON[_0x693e('0x6e')](_0x435aa3));delete _0x435aa3[_0x693e('0x24')];if(_0xb92505===0x191){_0xb92505=0x190;}_0x2a91b2[_0x693e('0x14')](_0xb92505)[_0x693e('0x6f')](_0x537668[_0x693e('0x2a')][_0x693e('0x6b')]?{'message':_0x693e('0x70'),'statusCode':_0x435aa3[_0x693e('0x6c')]}:_0x435aa3);});}; \ No newline at end of file +var _0x1707=['priority','group','source','ticket_type','company','default','custom_text','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials','eml-format','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/advancedSearch','../../config/logger','api','../../config/utils','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','FreshdeskAccount','rawAttributes','fieldName','key','map','keys','query','filters','model','fields','attributes','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','intersection','length','find','create','body','catch','getConfigurations','FreshdeskConfiguration','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','toString','base64','requester','subject','description'];(function(_0x2747e3,_0xbd47bc){var _0x60c337=function(_0x43c008){while(--_0x43c008){_0x2747e3['push'](_0x2747e3['shift']());}};_0x60c337(++_0xbd47bc);}(_0x1707,0x1df));var _0x7170=function(_0x4d39d9,_0x367c67){_0x4d39d9=_0x4d39d9-0x0;var _0x94fbe6=_0x1707[_0x4d39d9];return _0x94fbe6;};'use strict';var emlformat=require(_0x7170('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7170('0x1'));var moment=require(_0x7170('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x7170('0x3'));var util=require(_0x7170('0x4'));var path=require(_0x7170('0x5'));var sox=require(_0x7170('0x6'));var csv=require(_0x7170('0x7'));var ejs=require(_0x7170('0x8'));var fs=require('fs');var fs_extra=require(_0x7170('0x9'));var _=require(_0x7170('0xa'));var squel=require(_0x7170('0xb'));var crypto=require(_0x7170('0xc'));var jsforce=require(_0x7170('0xd'));var deskjs=require(_0x7170('0xe'));var toCsv=require(_0x7170('0x7'));var querystring=require(_0x7170('0xf'));var Papa=require(_0x7170('0x10'));var Redis=require(_0x7170('0x11'));var authService=require(_0x7170('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x7170('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7170('0x14'))(_0x7170('0x15'));var utils=require(_0x7170('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0x7170('0x17'));function respondWithStatusCode(_0x3193c7,_0x58c1ec){_0x58c1ec=_0x58c1ec||0xcc;return function(_0x42911e){if(_0x42911e){return _0x3193c7[_0x7170('0x18')](_0x58c1ec);}return _0x3193c7[_0x7170('0x19')](_0x58c1ec)[_0x7170('0x1a')]();};}function respondWithResult(_0x369b9e,_0x418282){_0x418282=_0x418282||0xc8;return function(_0x4f3b70){if(_0x4f3b70){return _0x369b9e['status'](_0x418282)[_0x7170('0x1b')](_0x4f3b70);}};}function respondWithFilteredResult(_0x599aa8,_0x31ffb6){return function(_0xabf79a){if(_0xabf79a){var _0x578f10=typeof _0x31ffb6[_0x7170('0x1c')]==='undefined'&&typeof _0x31ffb6[_0x7170('0x1d')]===_0x7170('0x1e');var _0x4f6ab5=_0xabf79a[_0x7170('0x1f')];var _0x58f2dc=_0x578f10?0x0:_0x31ffb6[_0x7170('0x1c')];var _0x2cf7da=_0x578f10?_0xabf79a['count']:_0x31ffb6[_0x7170('0x1c')]+_0x31ffb6['limit'];var _0x58e2ef;if(_0x2cf7da>=_0x4f6ab5){_0x2cf7da=_0x4f6ab5;_0x58e2ef=0xc8;}else{_0x58e2ef=0xce;}_0x599aa8[_0x7170('0x19')](_0x58e2ef);return _0x599aa8[_0x7170('0x20')](_0x7170('0x21'),_0x58f2dc+'-'+_0x2cf7da+'/'+_0x4f6ab5)[_0x7170('0x1b')](_0xabf79a);}return null;};}function patchUpdates(_0x126d87){return function(_0x32b51a){try{jsonpatch[_0x7170('0x22')](_0x32b51a,_0x126d87,!![]);}catch(_0x57b3ae){return BPromise[_0x7170('0x23')](_0x57b3ae);}return _0x32b51a[_0x7170('0x24')]();};}function saveUpdates(_0x25e86e,_0x1fa020){return function(_0x25b033){if(_0x25b033){return _0x25b033[_0x7170('0x25')](_0x25e86e)[_0x7170('0x26')](function(_0x474d30){return _0x474d30;});}return null;};}function removeEntity(_0x598fe3,_0x1539b4){return function(_0xfa8e3){if(_0xfa8e3){return _0xfa8e3[_0x7170('0x27')]()[_0x7170('0x26')](function(){_0x598fe3[_0x7170('0x19')](0xcc)[_0x7170('0x1a')]();});}};}function handleEntityNotFound(_0x1af07f,_0x31c3cb){return function(_0x256991){if(!_0x256991){_0x1af07f['sendStatus'](0x194);}return _0x256991;};}function handleError(_0x38aadf,_0x57977b){_0x57977b=_0x57977b||0x1f4;return function(_0x2f6c1c){logger[_0x7170('0x28')](_0x2f6c1c['stack']);if(_0x2f6c1c['name']){delete _0x2f6c1c[_0x7170('0x29')];}_0x38aadf[_0x7170('0x19')](_0x57977b)[_0x7170('0x2a')](_0x2f6c1c);};}exports['index']=function(_0x382c9f,_0x2a5c45){var _0x126985={},_0x533f40={},_0xb0d003={'count':0x0,'rows':[]};var _0x515b12=_['map'](db[_0x7170('0x2b')][_0x7170('0x2c')],function(_0x39861a){return{'name':_0x39861a[_0x7170('0x2d')],'type':_0x39861a['type'][_0x7170('0x2e')]};});_0x533f40['model']=_[_0x7170('0x2f')](_0x515b12,_0x7170('0x29'));_0x533f40['query']=_[_0x7170('0x30')](_0x382c9f[_0x7170('0x31')]);_0x533f40[_0x7170('0x32')]=_['intersection'](_0x533f40['model'],_0x533f40[_0x7170('0x31')]);_0x126985['attributes']=_['intersection'](_0x533f40[_0x7170('0x33')],qs[_0x7170('0x34')](_0x382c9f['query'][_0x7170('0x34')]));_0x126985['attributes']=_0x126985[_0x7170('0x35')]['length']?_0x126985[_0x7170('0x35')]:_0x533f40['model'];if(!_0x382c9f[_0x7170('0x31')]['hasOwnProperty'](_0x7170('0x36'))){_0x126985[_0x7170('0x1d')]=qs[_0x7170('0x1d')](_0x382c9f[_0x7170('0x31')][_0x7170('0x1d')]);_0x126985[_0x7170('0x1c')]=qs[_0x7170('0x1c')](_0x382c9f['query'][_0x7170('0x1c')]);}_0x126985[_0x7170('0x37')]=qs['sort'](_0x382c9f[_0x7170('0x31')][_0x7170('0x38')]);_0x126985['where']=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x382c9f[_0x7170('0x31')],_0x533f40[_0x7170('0x32')]),_0x515b12);if(_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]){_0x126985[_0x7170('0x3b')]=_['merge'](_0x126985[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x515b12,function(_0x4b8a26){if(_0x4b8a26[_0x7170('0x3c')]!==_0x7170('0x3d')){var _0x35ae24={};_0x35ae24[_0x4b8a26[_0x7170('0x29')]]={'$like':'%'+_0x382c9f[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x35ae24;}})});}_0x126985=_[_0x7170('0x3e')]({},_0x126985,_0x382c9f[_0x7170('0x3f')]);var _0x385e2e={'where':_0x126985[_0x7170('0x3b')]};return db[_0x7170('0x2b')][_0x7170('0x1f')](_0x385e2e)[_0x7170('0x26')](function(_0x48c7f3){_0xb0d003[_0x7170('0x1f')]=_0x48c7f3;if(_0x382c9f['query'][_0x7170('0x40')]){_0x126985['include']=[{'all':!![]}];}return db[_0x7170('0x2b')][_0x7170('0x41')](_0x126985);})[_0x7170('0x26')](function(_0x293ba5){_0xb0d003[_0x7170('0x42')]=_0x293ba5;return _0xb0d003;})[_0x7170('0x26')](respondWithFilteredResult(_0x2a5c45,_0x126985))['catch'](handleError(_0x2a5c45,null));};exports[_0x7170('0x43')]=function(_0x2086b1,_0xcaa498){var _0x404bdd={'raw':![],'where':{'id':_0x2086b1[_0x7170('0x44')]['id']}},_0xc16b7={};_0xc16b7['model']=_[_0x7170('0x30')](db[_0x7170('0x2b')][_0x7170('0x2c')]);_0xc16b7[_0x7170('0x31')]=_['keys'](_0x2086b1[_0x7170('0x31')]);_0xc16b7[_0x7170('0x32')]=_[_0x7170('0x45')](_0xc16b7['model'],_0xc16b7[_0x7170('0x31')]);_0x404bdd[_0x7170('0x35')]=_[_0x7170('0x45')](_0xc16b7[_0x7170('0x33')],qs['fields'](_0x2086b1[_0x7170('0x31')]['fields']));_0x404bdd['attributes']=_0x404bdd['attributes'][_0x7170('0x46')]?_0x404bdd['attributes']:_0xc16b7[_0x7170('0x33')];if(_0x2086b1[_0x7170('0x31')][_0x7170('0x40')]){_0x404bdd['include']=[{'all':!![]}];}_0x404bdd=_[_0x7170('0x3e')]({},_0x404bdd,_0x2086b1['options']);return db[_0x7170('0x2b')][_0x7170('0x47')](_0x404bdd)[_0x7170('0x26')](handleEntityNotFound(_0xcaa498,null))[_0x7170('0x26')](respondWithResult(_0xcaa498,null))['catch'](handleError(_0xcaa498,null));};exports[_0x7170('0x48')]=function(_0x27d103,_0x495105){return db[_0x7170('0x2b')][_0x7170('0x48')](_0x27d103[_0x7170('0x49')],{})[_0x7170('0x26')](respondWithResult(_0x495105,0xc9))[_0x7170('0x4a')](handleError(_0x495105,null));};exports[_0x7170('0x25')]=function(_0x33b41f,_0x56674b){if(_0x33b41f[_0x7170('0x49')]['id']){delete _0x33b41f[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x33b41f[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x56674b,null))[_0x7170('0x26')](saveUpdates(_0x33b41f['body'],null))[_0x7170('0x26')](respondWithResult(_0x56674b,null))[_0x7170('0x4a')](handleError(_0x56674b,null));};exports[_0x7170('0x27')]=function(_0x4e84ed,_0x1be3b1){return db[_0x7170('0x2b')][_0x7170('0x47')]({'where':{'id':_0x4e84ed[_0x7170('0x44')]['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x1be3b1,null))[_0x7170('0x26')](removeEntity(_0x1be3b1,null))[_0x7170('0x4a')](handleError(_0x1be3b1,null));};exports[_0x7170('0x4b')]=function(_0x125083,_0x595890,_0x4dec37){var _0x3f5f3b={};var _0x2b5b8b={};var _0x9b4c2;var _0x20acb8;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x125083[_0x7170('0x44')]['id']}})['then'](handleEntityNotFound(_0x595890,null))[_0x7170('0x26')](function(_0x1964d8){if(_0x1964d8){_0x9b4c2=_0x1964d8;_0x2b5b8b['model']=_[_0x7170('0x30')](db[_0x7170('0x4c')][_0x7170('0x2c')]);_0x2b5b8b[_0x7170('0x31')]=_[_0x7170('0x30')](_0x125083[_0x7170('0x31')]);_0x2b5b8b[_0x7170('0x32')]=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],_0x2b5b8b[_0x7170('0x31')]);_0x3f5f3b['attributes']=_[_0x7170('0x45')](_0x2b5b8b[_0x7170('0x33')],qs[_0x7170('0x34')](_0x125083[_0x7170('0x31')][_0x7170('0x34')]));_0x3f5f3b[_0x7170('0x35')]=_0x3f5f3b['attributes'][_0x7170('0x46')]?_0x3f5f3b[_0x7170('0x35')]:_0x2b5b8b[_0x7170('0x33')];_0x3f5f3b['order']=qs[_0x7170('0x38')](_0x125083['query']['sort']);_0x3f5f3b[_0x7170('0x3b')]=qs[_0x7170('0x32')](_[_0x7170('0x39')](_0x125083[_0x7170('0x31')],_0x2b5b8b[_0x7170('0x32')]));if(_0x125083[_0x7170('0x31')][_0x7170('0x3a')]){_0x3f5f3b[_0x7170('0x3b')]=_['merge'](_0x3f5f3b[_0x7170('0x3b')],{'$or':_[_0x7170('0x2f')](_0x3f5f3b['attributes'],function(_0x520981){var _0x4f389b={};_0x4f389b[_0x520981]={'$like':'%'+_0x125083[_0x7170('0x31')][_0x7170('0x3a')]+'%'};return _0x4f389b;})});}_0x3f5f3b=_[_0x7170('0x3e')]({},_0x3f5f3b,_0x125083[_0x7170('0x3f')]);return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})[_0x7170('0x26')](function(_0x12855b){if(_0x12855b){_0x20acb8=_0x12855b['length'];if(!_0x125083[_0x7170('0x31')][_0x7170('0x4d')](_0x7170('0x36'))){_0x3f5f3b[_0x7170('0x1d')]=qs['limit'](_0x125083[_0x7170('0x31')][_0x7170('0x1d')]);_0x3f5f3b['offset']=qs[_0x7170('0x1c')](_0x125083[_0x7170('0x31')][_0x7170('0x1c')]);}return _0x9b4c2[_0x7170('0x4b')](_0x3f5f3b);}})['then'](function(_0x11de38){if(_0x11de38){return _0x11de38?{'count':_0x20acb8,'rows':_0x11de38}:null;}})[_0x7170('0x26')](respondWithResult(_0x595890,null))['catch'](handleError(_0x595890,null));};exports[_0x7170('0x4e')]=function(_0x2162d3,_0x397250,_0x55f5f2){if(_0x2162d3[_0x7170('0x49')]['id']){delete _0x2162d3[_0x7170('0x49')]['id'];}return db[_0x7170('0x2b')][_0x7170('0x4f')]({'where':{'id':_0x2162d3['params']['id']}})[_0x7170('0x26')](handleEntityNotFound(_0x397250,null))[_0x7170('0x26')](function(_0x14a6f0){if(_0x14a6f0){_0x2162d3[_0x7170('0x49')][_0x7170('0x50')]=_0x14a6f0['id'];_0x2162d3[_0x7170('0x49')][_0x7170('0x51')]=integrations[_0x7170('0x52')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);_0x2162d3[_0x7170('0x49')]['Descriptions']=integrations[_0x7170('0x54')](_0x2162d3[_0x7170('0x49')][_0x7170('0x53')],_0x2162d3[_0x7170('0x49')][_0x7170('0x3c')]);return db[_0x7170('0x4c')]['create'](_0x2162d3[_0x7170('0x49')],{'include':[{'model':db[_0x7170('0x55')],'as':_0x7170('0x51')},{'model':db[_0x7170('0x55')],'as':_0x7170('0x56')}]});}return null;})['then'](respondWithResult(_0x397250,null))[_0x7170('0x4a')](handleError(_0x397250,null));};exports[_0x7170('0x57')]=function(_0xa36419,_0x3f1318,_0x25a7e0){var _0x4aab89='';return db[_0x7170('0x2b')]['findOne']({'where':{'id':_0xa36419['params']['id']},'attributes':['id',_0x7170('0x58'),_0x7170('0x59')]})['then'](handleEntityNotFound(_0x3f1318,null))[_0x7170('0x26')](function(_0x241f8){if(_0x241f8){_0x4aab89=_0x241f8[_0x7170('0x58')];var _0x30413d=_0x4aab89[_0x7170('0x5a')](-0x1);if(_0x30413d==='/'){_0x4aab89=_0x4aab89['substring'](0x0,_0x4aab89[_0x7170('0x5b')](_0x30413d));}return rp({'method':_0x7170('0x5c'),'uri':util[_0x7170('0x5d')](_0x7170('0x5e'),_0x4aab89,_0x7170('0x5f')),'headers':{'Authorization':util[_0x7170('0x5d')]('Basic\x20%s',new Buffer(util[_0x7170('0x5d')]('%s:X',_0x241f8[_0x7170('0x59')]))[_0x7170('0x60')](_0x7170('0x61')))},'json':!![]});}})[_0x7170('0x26')](function(_0x4fd91a){if(_0x4fd91a){var _0x36de8e=[_0x7170('0x62'),_0x7170('0x63'),'agent',_0x7170('0x64'),_0x7170('0x19'),_0x7170('0x65'),_0x7170('0x66'),_0x7170('0x67'),_0x7170('0x68'),'group',_0x7170('0x69')];_['remove'](_0x4fd91a,function(_0x59292c){return _0x36de8e['includes'](_0x59292c[_0x7170('0x29')])||!_0x59292c[_0x7170('0x6a')]&&_0x59292c[_0x7170('0x3c')]!==_0x7170('0x6b')&&_0x59292c['type']!=='custom_dropdown';});return{'count':_0x4fd91a[_0x7170('0x46')],'rows':_[_0x7170('0x2f')](_0x4fd91a,function(_0x1ee17e){return{'id':_0x1ee17e['name'],'name':_0x1ee17e[_0x7170('0x6c')],'custom':!_0x1ee17e[_0x7170('0x6a')],'options':_0x1ee17e['choices']?_['map'](_0x1ee17e[_0x7170('0x6d')],function(_0x2818c2){return{'name':_[_0x7170('0x6e')](_0x2818c2),'value':_0x2818c2};}):[]};})};}})['then'](respondWithResult(_0x3f1318,null))[_0x7170('0x4a')](function(_0x39fd2d){var _0x3660a7=_0xa36419['query']['test']?0x1f4:_0x39fd2d[_0x7170('0x6f')]||0x1f4;logger['error'](_0x7170('0x70'),'getFields',_0x3660a7,JSON[_0x7170('0x71')](_0x39fd2d));delete _0x39fd2d[_0x7170('0x29')];if(_0x3660a7===0x191){_0x3660a7=0x190;}_0x3f1318['status'](_0x3660a7)[_0x7170('0x2a')](_0xa36419[_0x7170('0x31')][_0x7170('0x72')]?{'message':_0x7170('0x73'),'statusCode':_0x39fd2d[_0x7170('0x6f')]}:_0x39fd2d);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index bea39bb..1dc9e9b 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 _0x3d0c=['moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','int_freshdesk_accounts','util','../../config/logger','api'];(function(_0x45252e,_0x2af614){var _0xfc380c=function(_0x55926e){while(--_0x55926e){_0x45252e['push'](_0x45252e['shift']());}};_0xfc380c(++_0x2af614);}(_0x3d0c,0x81));var _0xc3d0=function(_0x2fff83,_0x29d5fe){_0x2fff83=_0x2fff83-0x0;var _0xa2a722=_0x3d0c[_0x2fff83];return _0xa2a722;};'use strict';var _=require('lodash');var util=require(_0xc3d0('0x0'));var logger=require(_0xc3d0('0x1'))(_0xc3d0('0x2'));var moment=require(_0xc3d0('0x3'));var BPromise=require(_0xc3d0('0x4'));var rp=require(_0xc3d0('0x5'));var fs=require('fs');var path=require(_0xc3d0('0x6'));var rimraf=require('rimraf');var config=require(_0xc3d0('0x7'));var attributes=require(_0xc3d0('0x8'));var integrations=require(_0xc3d0('0x9'));module[_0xc3d0('0xa')]=function(_0x423155,_0x389f10){return _0x423155['define']('FreshdeskAccount',attributes,{'tableName':_0xc3d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7583=['define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x34750b,_0x34aae5){var _0x244258=function(_0x503bf2){while(--_0x503bf2){_0x34750b['push'](_0x34750b['shift']());}};_0x244258(++_0x34aae5);}(_0x7583,0x6b));var _0x3758=function(_0x2df523,_0x11b09e){_0x2df523=_0x2df523-0x0;var _0x43f919=_0x7583[_0x2df523];return _0x43f919;};'use strict';var _=require(_0x3758('0x0'));var util=require(_0x3758('0x1'));var logger=require(_0x3758('0x2'))(_0x3758('0x3'));var moment=require('moment');var BPromise=require(_0x3758('0x4'));var rp=require(_0x3758('0x5'));var fs=require('fs');var path=require(_0x3758('0x6'));var rimraf=require(_0x3758('0x7'));var config=require(_0x3758('0x8'));var attributes=require(_0x3758('0x9'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x3ef1a5,_0x32c07c){return _0x3ef1a5[_0x3758('0xa')](_0x3758('0xb'),attributes,{'tableName':_0x3758('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 6d1b9f8..2bd3b5d 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 _0xd187=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskAccount,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','map','model','include','GetFreshdeskAccount','FreshdeskAccount','find','raw','ShowFreshdeskAccount','lodash','util','moment','randomstring'];(function(_0x426076,_0xfdf5d2){var _0x1e9565=function(_0x38832a){while(--_0x38832a){_0x426076['push'](_0x426076['shift']());}};_0x1e9565(++_0xfdf5d2);}(_0xd187,0x90));var _0x7d18=function(_0x361d3f,_0x3be2aa){_0x361d3f=_0x361d3f-0x0;var _0x320229=_0xd187[_0x361d3f];return _0x320229;};'use strict';var _=require(_0x7d18('0x0'));var util=require(_0x7d18('0x1'));var moment=require(_0x7d18('0x2'));var BPromise=require('bluebird');var rs=require(_0x7d18('0x3'));var fs=require('fs');var Redis=require(_0x7d18('0x4'));var db=require(_0x7d18('0x5'))['db'];var utils=require(_0x7d18('0x6'));var logger=require(_0x7d18('0x7'))(_0x7d18('0x8'));var config=require(_0x7d18('0x9'));var jayson=require(_0x7d18('0xa'));var client=jayson['client'][_0x7d18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4757be,_0x522585,_0x2e5993){return new BPromise(function(_0x3ce418,_0xbbf33b){return client[_0x7d18('0xc')](_0x4757be,_0x2e5993)[_0x7d18('0xd')](function(_0x5b8a42){logger[_0x7d18('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x522585,_0x7d18('0xf'));logger[_0x7d18('0x10')](_0x7d18('0x11'),_0x522585,_0x7d18('0xf'),JSON[_0x7d18('0x12')](_0x5b8a42));if(_0x5b8a42[_0x7d18('0x13')]){if(_0x5b8a42[_0x7d18('0x13')][_0x7d18('0x14')]===0x1f4){logger[_0x7d18('0x13')](_0x7d18('0x15'),_0x522585,_0x5b8a42[_0x7d18('0x13')][_0x7d18('0x16')]);return _0xbbf33b(_0x5b8a42[_0x7d18('0x13')][_0x7d18('0x16')]);}logger[_0x7d18('0x13')](_0x7d18('0x15'),_0x522585,_0x5b8a42[_0x7d18('0x13')][_0x7d18('0x16')]);return _0x3ce418(_0x5b8a42[_0x7d18('0x13')][_0x7d18('0x16')]);}else{logger[_0x7d18('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x522585,'request\x20sent');_0x3ce418(_0x5b8a42[_0x7d18('0x17')][_0x7d18('0x16')]);}})[_0x7d18('0x18')](function(_0x40a31b){logger[_0x7d18('0x13')]('FreshdeskAccount,\x20%s,\x20%s',_0x522585,_0x40a31b);_0xbbf33b(_0x40a31b);});});}exports['GetFreshdeskAccount']=function(_0x22a6e5){var _0x5c12e6=this;return new Promise(function(_0x3da107,_0xdea849){return db['FreshdeskAccount'][_0x7d18('0x19')]({'raw':_0x22a6e5['options']?_0x22a6e5[_0x7d18('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x22a6e5[_0x7d18('0x1a')]?_0x22a6e5[_0x7d18('0x1a')][_0x7d18('0x1b')]||null:null,'attributes':_0x22a6e5[_0x7d18('0x1a')]?_0x22a6e5[_0x7d18('0x1a')][_0x7d18('0x1c')]||null:null,'limit':_0x22a6e5[_0x7d18('0x1a')]?_0x22a6e5['options']['limit']||null:null,'include':_0x22a6e5[_0x7d18('0x1a')]?_0x22a6e5[_0x7d18('0x1a')]['include']?_[_0x7d18('0x1d')](_0x22a6e5[_0x7d18('0x1a')]['include'],function(_0x200578){return{'model':db[_0x200578[_0x7d18('0x1e')]],'as':_0x200578['as'],'attributes':_0x200578[_0x7d18('0x1c')],'include':_0x200578['include']?_[_0x7d18('0x1d')](_0x200578[_0x7d18('0x1f')],function(_0x10d664){return{'model':db[_0x10d664['model']],'as':_0x10d664['as'],'attributes':_0x10d664[_0x7d18('0x1c')],'include':_0x10d664[_0x7d18('0x1f')]?_[_0x7d18('0x1d')](_0x10d664[_0x7d18('0x1f')],function(_0x4ef54b){return{'model':db[_0x4ef54b['model']],'as':_0x4ef54b['as'],'attributes':_0x4ef54b[_0x7d18('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7d18('0xd')](function(_0x3c00e6){logger[_0x7d18('0xe')](_0x7d18('0x20'),_0x22a6e5);logger[_0x7d18('0x10')](_0x7d18('0x20'),_0x22a6e5,JSON[_0x7d18('0x12')](_0x3c00e6));_0x3da107(_0x3c00e6);})[_0x7d18('0x18')](function(_0x3ca6ab){logger[_0x7d18('0x13')](_0x7d18('0x20'),_0x3ca6ab[_0x7d18('0x16')],_0x22a6e5);_0xdea849(_0x5c12e6[_0x7d18('0x13')](0x1f4,_0x3ca6ab[_0x7d18('0x16')]));});});};exports['ShowFreshdeskAccount']=function(_0x5dc87b){var _0x255bc4=this;return new Promise(function(_0x38e93c,_0x482b1c){return db[_0x7d18('0x21')][_0x7d18('0x22')]({'raw':_0x5dc87b['options']?_0x5dc87b['options'][_0x7d18('0x23')]===undefined?!![]:![]:!![],'where':_0x5dc87b[_0x7d18('0x1a')]?_0x5dc87b[_0x7d18('0x1a')][_0x7d18('0x1b')]||null:null,'attributes':_0x5dc87b[_0x7d18('0x1a')]?_0x5dc87b[_0x7d18('0x1a')][_0x7d18('0x1c')]||null:null,'include':_0x5dc87b[_0x7d18('0x1a')]?_0x5dc87b['options'][_0x7d18('0x1f')]?_[_0x7d18('0x1d')](_0x5dc87b[_0x7d18('0x1a')][_0x7d18('0x1f')],function(_0x1a4706){return{'model':db[_0x1a4706[_0x7d18('0x1e')]],'as':_0x1a4706['as'],'attributes':_0x1a4706[_0x7d18('0x1c')],'include':_0x1a4706[_0x7d18('0x1f')]?_['map'](_0x1a4706[_0x7d18('0x1f')],function(_0x27a7f0){return{'model':db[_0x27a7f0['model']],'as':_0x27a7f0['as'],'attributes':_0x27a7f0[_0x7d18('0x1c')],'include':_0x27a7f0[_0x7d18('0x1f')]?_[_0x7d18('0x1d')](_0x27a7f0[_0x7d18('0x1f')],function(_0x19e245){return{'model':db[_0x19e245[_0x7d18('0x1e')]],'as':_0x19e245['as'],'attributes':_0x19e245['attributes']};}):[]};}):[]};}):[]:[]})[_0x7d18('0xd')](function(_0x46aab0){logger['info'](_0x7d18('0x24'),_0x5dc87b);logger[_0x7d18('0x10')](_0x7d18('0x24'),_0x5dc87b,JSON[_0x7d18('0x12')](_0x46aab0));_0x38e93c(_0x46aab0);})[_0x7d18('0x18')](function(_0x22cf39){logger[_0x7d18('0x13')]('ShowFreshdeskAccount',_0x22cf39['message'],_0x5dc87b);_0x482b1c(_0x255bc4[_0x7d18('0x13')](0x1f4,_0x22cf39[_0x7d18('0x16')]));});});}; \ No newline at end of file +var _0x1d18=['message','info','result','catch','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','ShowFreshdeskAccount','find','raw','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x314085,_0x4235c6){var _0x26190a=function(_0x2314a2){while(--_0x2314a2){_0x314085['push'](_0x314085['shift']());}};_0x26190a(++_0x4235c6);}(_0x1d18,0x10d));var _0x81d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d18[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x81d1('0x0'));var util=require(_0x81d1('0x1'));var moment=require(_0x81d1('0x2'));var BPromise=require(_0x81d1('0x3'));var rs=require(_0x81d1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81d1('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x81d1('0x6'))(_0x81d1('0x7'));var config=require('../../config/environment');var jayson=require(_0x81d1('0x8'));var client=jayson[_0x81d1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d8664,_0x756dae,_0x5ecee5){return new BPromise(function(_0xa4dbc0,_0x47d443){return client[_0x81d1('0xa')](_0x1d8664,_0x5ecee5)[_0x81d1('0xb')](function(_0x3aa5b3){logger['info'](_0x81d1('0xc'),_0x756dae,_0x81d1('0xd'));logger[_0x81d1('0xe')](_0x81d1('0xf'),_0x756dae,_0x81d1('0xd'),JSON[_0x81d1('0x10')](_0x3aa5b3));if(_0x3aa5b3[_0x81d1('0x11')]){if(_0x3aa5b3['error'][_0x81d1('0x12')]===0x1f4){logger[_0x81d1('0x11')](_0x81d1('0xc'),_0x756dae,_0x3aa5b3['error'][_0x81d1('0x13')]);return _0x47d443(_0x3aa5b3[_0x81d1('0x11')][_0x81d1('0x13')]);}logger[_0x81d1('0x11')](_0x81d1('0xc'),_0x756dae,_0x3aa5b3['error'][_0x81d1('0x13')]);return _0xa4dbc0(_0x3aa5b3[_0x81d1('0x11')][_0x81d1('0x13')]);}else{logger[_0x81d1('0x14')](_0x81d1('0xc'),_0x756dae,_0x81d1('0xd'));_0xa4dbc0(_0x3aa5b3[_0x81d1('0x15')][_0x81d1('0x13')]);}})[_0x81d1('0x16')](function(_0x1b2e91){logger[_0x81d1('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x756dae,_0x1b2e91);_0x47d443(_0x1b2e91);});});}exports[_0x81d1('0x17')]=function(_0x581c3b){var _0x266008=this;return new Promise(function(_0x27b6a7,_0x31c644){return db[_0x81d1('0x18')][_0x81d1('0x19')]({'raw':_0x581c3b[_0x81d1('0x1a')]?_0x581c3b[_0x81d1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x581c3b[_0x81d1('0x1a')]?_0x581c3b[_0x81d1('0x1a')][_0x81d1('0x1b')]||null:null,'attributes':_0x581c3b[_0x81d1('0x1a')]?_0x581c3b[_0x81d1('0x1a')][_0x81d1('0x1c')]||null:null,'limit':_0x581c3b[_0x81d1('0x1a')]?_0x581c3b[_0x81d1('0x1a')][_0x81d1('0x1d')]||null:null,'include':_0x581c3b['options']?_0x581c3b[_0x81d1('0x1a')][_0x81d1('0x1e')]?_[_0x81d1('0x1f')](_0x581c3b[_0x81d1('0x1a')]['include'],function(_0x4bfec9){return{'model':db[_0x4bfec9[_0x81d1('0x20')]],'as':_0x4bfec9['as'],'attributes':_0x4bfec9[_0x81d1('0x1c')],'include':_0x4bfec9[_0x81d1('0x1e')]?_[_0x81d1('0x1f')](_0x4bfec9[_0x81d1('0x1e')],function(_0x468ab3){return{'model':db[_0x468ab3[_0x81d1('0x20')]],'as':_0x468ab3['as'],'attributes':_0x468ab3[_0x81d1('0x1c')],'include':_0x468ab3[_0x81d1('0x1e')]?_[_0x81d1('0x1f')](_0x468ab3[_0x81d1('0x1e')],function(_0x1550b3){return{'model':db[_0x1550b3['model']],'as':_0x1550b3['as'],'attributes':_0x1550b3[_0x81d1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x81d1('0xb')](function(_0x528d28){logger['info'](_0x81d1('0x17'),_0x581c3b);logger[_0x81d1('0xe')](_0x81d1('0x17'),_0x581c3b,JSON['stringify'](_0x528d28));_0x27b6a7(_0x528d28);})['catch'](function(_0x4fd0a8){logger[_0x81d1('0x11')](_0x81d1('0x17'),_0x4fd0a8[_0x81d1('0x13')],_0x581c3b);_0x31c644(_0x266008['error'](0x1f4,_0x4fd0a8['message']));});});};exports[_0x81d1('0x21')]=function(_0x500350){var _0x4cd330=this;return new Promise(function(_0x250a43,_0x1b1999){return db['FreshdeskAccount'][_0x81d1('0x22')]({'raw':_0x500350[_0x81d1('0x1a')]?_0x500350[_0x81d1('0x1a')][_0x81d1('0x23')]===undefined?!![]:![]:!![],'where':_0x500350['options']?_0x500350[_0x81d1('0x1a')][_0x81d1('0x1b')]||null:null,'attributes':_0x500350['options']?_0x500350['options'][_0x81d1('0x1c')]||null:null,'include':_0x500350[_0x81d1('0x1a')]?_0x500350[_0x81d1('0x1a')][_0x81d1('0x1e')]?_['map'](_0x500350[_0x81d1('0x1a')][_0x81d1('0x1e')],function(_0x2de9ad){return{'model':db[_0x2de9ad[_0x81d1('0x20')]],'as':_0x2de9ad['as'],'attributes':_0x2de9ad[_0x81d1('0x1c')],'include':_0x2de9ad['include']?_[_0x81d1('0x1f')](_0x2de9ad[_0x81d1('0x1e')],function(_0x5caa58){return{'model':db[_0x5caa58['model']],'as':_0x5caa58['as'],'attributes':_0x5caa58[_0x81d1('0x1c')],'include':_0x5caa58[_0x81d1('0x1e')]?_[_0x81d1('0x1f')](_0x5caa58[_0x81d1('0x1e')],function(_0x23051d){return{'model':db[_0x23051d[_0x81d1('0x20')]],'as':_0x23051d['as'],'attributes':_0x23051d[_0x81d1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x81d1('0xb')](function(_0x5a062b){logger[_0x81d1('0x14')](_0x81d1('0x21'),_0x500350);logger[_0x81d1('0xe')]('ShowFreshdeskAccount',_0x500350,JSON[_0x81d1('0x10')](_0x5a062b));_0x250a43(_0x5a062b);})[_0x81d1('0x16')](function(_0x176704){logger[_0x81d1('0x11')]('ShowFreshdeskAccount',_0x176704['message'],_0x500350);_0x1b1999(_0x4cd330['error'](0x1f4,_0x176704[_0x81d1('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index bd7caac..945d62e 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 _0xbcef=['destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','isAuthenticated','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','update','delete'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xbcef,0x16e));var _0xfbce=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbcef[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0xfbce('0x0'));var path=require(_0xfbce('0x1'));var timeout=require(_0xfbce('0x2'));var express=require(_0xfbce('0x3'));var router=express[_0xfbce('0x4')]();var fs_extra=require(_0xfbce('0x5'));var auth=require(_0xfbce('0x6'));var interaction=require(_0xfbce('0x7'));var config=require(_0xfbce('0x8'));var controller=require(_0xfbce('0x9'));router[_0xfbce('0xa')]('/',auth['isAuthenticated'](),controller[_0xfbce('0xb')]);router[_0xfbce('0xa')](_0xfbce('0xc'),auth[_0xfbce('0xd')](),controller['show']);router['get'](_0xfbce('0xe'),auth[_0xfbce('0xd')](),controller[_0xfbce('0xf')]);router[_0xfbce('0xa')]('/:id/subjects',auth[_0xfbce('0xd')](),controller[_0xfbce('0x10')]);router[_0xfbce('0xa')](_0xfbce('0x11'),auth[_0xfbce('0xd')](),controller[_0xfbce('0x12')]);router['get']('/:id/tags',auth[_0xfbce('0xd')](),controller[_0xfbce('0x13')]);router[_0xfbce('0x14')]('/',auth[_0xfbce('0xd')](),controller[_0xfbce('0x15')]);router[_0xfbce('0x14')]('/:id/tags',auth['isAuthenticated'](),controller[_0xfbce('0x16')]);router[_0xfbce('0x17')](_0xfbce('0xc'),auth[_0xfbce('0xd')](),controller[_0xfbce('0x18')]);router[_0xfbce('0x19')]('/:id',auth['isAuthenticated'](),controller[_0xfbce('0x1a')]);module[_0xfbce('0x1b')]=router; \ No newline at end of file +var _0x4ed9=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','setTags','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x5e875b,_0x38b586){var _0x3e2185=function(_0x2829b0){while(--_0x2829b0){_0x5e875b['push'](_0x5e875b['shift']());}};_0x3e2185(++_0x38b586);}(_0x4ed9,0x18a));var _0x94ed=function(_0x2eb281,_0x29129d){_0x2eb281=_0x2eb281-0x0;var _0x564009=_0x4ed9[_0x2eb281];return _0x564009;};'use strict';var multer=require(_0x94ed('0x0'));var util=require(_0x94ed('0x1'));var path=require(_0x94ed('0x2'));var timeout=require(_0x94ed('0x3'));var express=require(_0x94ed('0x4'));var router=express[_0x94ed('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x94ed('0x6'));var interaction=require(_0x94ed('0x7'));var config=require(_0x94ed('0x8'));var controller=require(_0x94ed('0x9'));router['get']('/',auth[_0x94ed('0xa')](),controller[_0x94ed('0xb')]);router['get'](_0x94ed('0xc'),auth['isAuthenticated'](),controller[_0x94ed('0xd')]);router[_0x94ed('0xe')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x94ed('0xe')](_0x94ed('0xf'),auth[_0x94ed('0xa')](),controller[_0x94ed('0x10')]);router[_0x94ed('0xe')](_0x94ed('0x11'),auth['isAuthenticated'](),controller[_0x94ed('0x12')]);router[_0x94ed('0xe')](_0x94ed('0x13'),auth[_0x94ed('0xa')](),controller['getTags']);router['post']('/',auth[_0x94ed('0xa')](),controller[_0x94ed('0x14')]);router['post'](_0x94ed('0x13'),auth[_0x94ed('0xa')](),controller[_0x94ed('0x15')]);router['put'](_0x94ed('0xc'),auth[_0x94ed('0xa')](),controller[_0x94ed('0x16')]);router['delete'](_0x94ed('0xc'),auth[_0x94ed('0xa')](),controller[_0x94ed('0x17')]);module[_0x94ed('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index c393828..61016b1 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 _0x8116=['exports','STRING','sequelize'];(function(_0x432025,_0x4a7bbe){var _0x3c6d63=function(_0x29ca11){while(--_0x29ca11){_0x432025['push'](_0x432025['shift']());}};_0x3c6d63(++_0x4a7bbe);}(_0x8116,0x13a));var _0x6811=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8116[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x6811('0x0'));module[_0x6811('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6811('0x2')]}}; \ No newline at end of file +var _0xa5be=['exports','STRING','sequelize'];(function(_0xac4668,_0x939532){var _0x195d64=function(_0x807aba){while(--_0x807aba){_0xac4668['push'](_0xac4668['shift']());}};_0x195d64(++_0x939532);}(_0xa5be,0x1d3));var _0xea5b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa5be[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0xea5b('0x0'));module[_0xea5b('0x1')]={'name':{'type':Sequelize[_0xea5b('0x2')]},'description':{'type':Sequelize[_0xea5b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 53dfab4..57c9d58 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 _0x56ac=['update','destroy','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','findOne','FreshdeskField','pick','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','ids','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save'];(function(_0x300708,_0x5ae0aa){var _0x3e56ed=function(_0x39d0ce){while(--_0x39d0ce){_0x300708['push'](_0x300708['shift']());}};_0x3e56ed(++_0x5ae0aa);}(_0x56ac,0x1d0));var _0xc56a=function(_0x3900ff,_0x2de8c6){_0x3900ff=_0x3900ff-0x0;var _0x2de713=_0x56ac[_0x3900ff];return _0x2de713;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc56a('0x0'));var zipdir=require(_0xc56a('0x1'));var jsonpatch=require(_0xc56a('0x2'));var rp=require(_0xc56a('0x3'));var moment=require(_0xc56a('0x4'));var BPromise=require(_0xc56a('0x5'));var Mustache=require('mustache');var util=require(_0xc56a('0x6'));var path=require('path');var sox=require(_0xc56a('0x7'));var csv=require(_0xc56a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc56a('0x9'));var squel=require(_0xc56a('0xa'));var crypto=require(_0xc56a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xc56a('0xc'));var toCsv=require(_0xc56a('0x8'));var querystring=require(_0xc56a('0xd'));var Papa=require(_0xc56a('0xe'));var Redis=require(_0xc56a('0xf'));var authService=require(_0xc56a('0x10'));var qs=require(_0xc56a('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc56a('0x12'));var logger=require(_0xc56a('0x13'))('api');var utils=require(_0xc56a('0x14'));var config=require(_0xc56a('0x15'));var licenseUtil=require(_0xc56a('0x16'));var db=require(_0xc56a('0x17'))['db'];function respondWithStatusCode(_0xd4ab71,_0x6fda9b){_0x6fda9b=_0x6fda9b||0xcc;return function(_0x4241aa){if(_0x4241aa){return _0xd4ab71[_0xc56a('0x18')](_0x6fda9b);}return _0xd4ab71[_0xc56a('0x19')](_0x6fda9b)[_0xc56a('0x1a')]();};}function respondWithResult(_0x15b72e,_0x3f607f){_0x3f607f=_0x3f607f||0xc8;return function(_0x542fb6){if(_0x542fb6){return _0x15b72e['status'](_0x3f607f)[_0xc56a('0x1b')](_0x542fb6);}};}function respondWithFilteredResult(_0x588d41,_0x2dd53b){return function(_0x246932){if(_0x246932){var _0x3b4045=typeof _0x2dd53b[_0xc56a('0x1c')]===_0xc56a('0x1d')&&typeof _0x2dd53b[_0xc56a('0x1e')]===_0xc56a('0x1d');var _0x5d34e8=_0x246932['count'];var _0xf54cec=_0x3b4045?0x0:_0x2dd53b[_0xc56a('0x1c')];var _0x570050=_0x3b4045?_0x246932[_0xc56a('0x1f')]:_0x2dd53b[_0xc56a('0x1c')]+_0x2dd53b['limit'];var _0x313f10;if(_0x570050>=_0x5d34e8){_0x570050=_0x5d34e8;_0x313f10=0xc8;}else{_0x313f10=0xce;}_0x588d41[_0xc56a('0x19')](_0x313f10);return _0x588d41['set'](_0xc56a('0x20'),_0xf54cec+'-'+_0x570050+'/'+_0x5d34e8)[_0xc56a('0x1b')](_0x246932);}return null;};}function patchUpdates(_0x1b4ba7){return function(_0x5a52af){try{jsonpatch['apply'](_0x5a52af,_0x1b4ba7,!![]);}catch(_0x222c81){return BPromise['reject'](_0x222c81);}return _0x5a52af[_0xc56a('0x21')]();};}function saveUpdates(_0x4e273d,_0x3f947e){return function(_0x51183c){if(_0x51183c){return _0x51183c[_0xc56a('0x22')](_0x4e273d)['then'](function(_0x304107){return _0x304107;});}return null;};}function removeEntity(_0x29f22b,_0x1c7e08){return function(_0x30b579){if(_0x30b579){return _0x30b579[_0xc56a('0x23')]()['then'](function(){_0x29f22b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55b922,_0x3bbed0){return function(_0x11b454){if(!_0x11b454){_0x55b922[_0xc56a('0x18')](0x194);}return _0x11b454;};}function handleError(_0x3c19e9,_0x4e31ad){_0x4e31ad=_0x4e31ad||0x1f4;return function(_0x249c67){logger['error'](_0x249c67['stack']);if(_0x249c67['name']){delete _0x249c67[_0xc56a('0x24')];}_0x3c19e9[_0xc56a('0x19')](_0x4e31ad)[_0xc56a('0x25')](_0x249c67);};}exports[_0xc56a('0x26')]=function(_0x347bb0,_0x569051){var _0x5b6460={},_0x4d67db={},_0x13ce0={'count':0x0,'rows':[]};var _0x445e00=_[_0xc56a('0x27')](db[_0xc56a('0x28')][_0xc56a('0x29')],function(_0x2e3842){return{'name':_0x2e3842[_0xc56a('0x2a')],'type':_0x2e3842['type'][_0xc56a('0x2b')]};});_0x4d67db[_0xc56a('0x2c')]=_[_0xc56a('0x27')](_0x445e00,_0xc56a('0x24'));_0x4d67db[_0xc56a('0x2d')]=_[_0xc56a('0x2e')](_0x347bb0[_0xc56a('0x2d')]);_0x4d67db[_0xc56a('0x2f')]=_[_0xc56a('0x30')](_0x4d67db[_0xc56a('0x2c')],_0x4d67db[_0xc56a('0x2d')]);_0x5b6460[_0xc56a('0x31')]=_[_0xc56a('0x30')](_0x4d67db[_0xc56a('0x2c')],qs[_0xc56a('0x32')](_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x32')]));_0x5b6460[_0xc56a('0x31')]=_0x5b6460[_0xc56a('0x31')][_0xc56a('0x33')]?_0x5b6460[_0xc56a('0x31')]:_0x4d67db[_0xc56a('0x2c')];if(!_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x34')](_0xc56a('0x35'))){_0x5b6460[_0xc56a('0x1e')]=qs[_0xc56a('0x1e')](_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x1e')]);_0x5b6460['offset']=qs[_0xc56a('0x1c')](_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x1c')]);}_0x5b6460[_0xc56a('0x36')]=qs['sort'](_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x37')]);_0x5b6460[_0xc56a('0x38')]=qs[_0xc56a('0x2f')](_['pick'](_0x347bb0[_0xc56a('0x2d')],_0x4d67db[_0xc56a('0x2f')]),_0x445e00);if(_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x39')]){_0x5b6460[_0xc56a('0x38')]=_[_0xc56a('0x3a')](_0x5b6460['where'],{'$or':_[_0xc56a('0x27')](_0x445e00,function(_0x5eca53){if(_0x5eca53[_0xc56a('0x3b')]!==_0xc56a('0x3c')){var _0x5ec578={};_0x5ec578[_0x5eca53[_0xc56a('0x24')]]={'$like':'%'+_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x39')]+'%'};return _0x5ec578;}})});}_0x5b6460=_[_0xc56a('0x3a')]({},_0x5b6460,_0x347bb0[_0xc56a('0x3d')]);var _0x44bad2={'where':_0x5b6460[_0xc56a('0x38')]};return db[_0xc56a('0x28')][_0xc56a('0x1f')](_0x44bad2)[_0xc56a('0x3e')](function(_0x5adcdc){_0x13ce0[_0xc56a('0x1f')]=_0x5adcdc;if(_0x347bb0[_0xc56a('0x2d')][_0xc56a('0x3f')]){_0x5b6460[_0xc56a('0x40')]=[{'all':!![]}];}return db[_0xc56a('0x28')][_0xc56a('0x41')](_0x5b6460);})['then'](function(_0x506c15){_0x13ce0[_0xc56a('0x42')]=_0x506c15;return _0x13ce0;})[_0xc56a('0x3e')](respondWithFilteredResult(_0x569051,_0x5b6460))['catch'](handleError(_0x569051,null));};exports[_0xc56a('0x43')]=function(_0x273da7,_0x2341e1){var _0x5edba9={'raw':![],'where':{'id':_0x273da7[_0xc56a('0x44')]['id']}},_0x2b158f={};_0x2b158f[_0xc56a('0x2c')]=_[_0xc56a('0x2e')](db['FreshdeskConfiguration'][_0xc56a('0x29')]);_0x2b158f['query']=_[_0xc56a('0x2e')](_0x273da7[_0xc56a('0x2d')]);_0x2b158f[_0xc56a('0x2f')]=_[_0xc56a('0x30')](_0x2b158f[_0xc56a('0x2c')],_0x2b158f[_0xc56a('0x2d')]);_0x5edba9[_0xc56a('0x31')]=_[_0xc56a('0x30')](_0x2b158f['model'],qs[_0xc56a('0x32')](_0x273da7[_0xc56a('0x2d')][_0xc56a('0x32')]));_0x5edba9[_0xc56a('0x31')]=_0x5edba9[_0xc56a('0x31')][_0xc56a('0x33')]?_0x5edba9['attributes']:_0x2b158f[_0xc56a('0x2c')];if(_0x273da7['query'][_0xc56a('0x3f')]){_0x5edba9[_0xc56a('0x40')]=[{'all':!![]}];}_0x5edba9=_['merge']({},_0x5edba9,_0x273da7[_0xc56a('0x3d')]);return db[_0xc56a('0x28')][_0xc56a('0x45')](_0x5edba9)['then'](handleEntityNotFound(_0x2341e1,null))['then'](respondWithResult(_0x2341e1,null))[_0xc56a('0x46')](handleError(_0x2341e1,null));};exports[_0xc56a('0x47')]=function(_0x27ec5d,_0x58b617){return db[_0xc56a('0x28')][_0xc56a('0x47')](_0x27ec5d[_0xc56a('0x48')],{})[_0xc56a('0x3e')](respondWithResult(_0x58b617,0xc9))['catch'](handleError(_0x58b617,null));};exports[_0xc56a('0x22')]=function(_0x36046c,_0x35bf20){if(_0x36046c['body']['id']){delete _0x36046c[_0xc56a('0x48')]['id'];}return db[_0xc56a('0x28')][_0xc56a('0x45')]({'where':{'id':_0x36046c['params']['id']}})['then'](handleEntityNotFound(_0x35bf20,null))[_0xc56a('0x3e')](saveUpdates(_0x36046c[_0xc56a('0x48')],null))[_0xc56a('0x3e')](respondWithResult(_0x35bf20,null))['catch'](handleError(_0x35bf20,null));};exports['destroy']=function(_0x357763,_0x2fc7f7){return db[_0xc56a('0x28')]['find']({'where':{'id':_0x357763[_0xc56a('0x44')]['id']}})[_0xc56a('0x3e')](handleEntityNotFound(_0x2fc7f7,null))['then'](removeEntity(_0x2fc7f7,null))[_0xc56a('0x46')](handleError(_0x2fc7f7,null));};exports['getFields']=function(_0x1937b4,_0x176606,_0x1d9344){var _0x215a64={};var _0x22d7cd={};var _0x5f12dc;var _0x4012c0;return db[_0xc56a('0x28')][_0xc56a('0x49')]({'where':{'id':_0x1937b4[_0xc56a('0x44')]['id']}})[_0xc56a('0x3e')](handleEntityNotFound(_0x176606,null))['then'](function(_0x1fa158){if(_0x1fa158){_0x5f12dc=_0x1fa158;_0x22d7cd[_0xc56a('0x2c')]=_[_0xc56a('0x2e')](db[_0xc56a('0x4a')][_0xc56a('0x29')]);_0x22d7cd[_0xc56a('0x2d')]=_[_0xc56a('0x2e')](_0x1937b4[_0xc56a('0x2d')]);_0x22d7cd[_0xc56a('0x2f')]=_[_0xc56a('0x30')](_0x22d7cd['model'],_0x22d7cd[_0xc56a('0x2d')]);_0x215a64['attributes']=_[_0xc56a('0x30')](_0x22d7cd[_0xc56a('0x2c')],qs[_0xc56a('0x32')](_0x1937b4[_0xc56a('0x2d')][_0xc56a('0x32')]));_0x215a64[_0xc56a('0x31')]=_0x215a64[_0xc56a('0x31')][_0xc56a('0x33')]?_0x215a64[_0xc56a('0x31')]:_0x22d7cd[_0xc56a('0x2c')];_0x215a64['order']=qs[_0xc56a('0x37')](_0x1937b4[_0xc56a('0x2d')]['sort']);_0x215a64[_0xc56a('0x38')]=qs[_0xc56a('0x2f')](_[_0xc56a('0x4b')](_0x1937b4[_0xc56a('0x2d')],_0x22d7cd['filters']));if(_0x1937b4['query'][_0xc56a('0x39')]){_0x215a64[_0xc56a('0x38')]=_[_0xc56a('0x3a')](_0x215a64[_0xc56a('0x38')],{'$or':_['map'](_0x215a64[_0xc56a('0x31')],function(_0x2db022){var _0x54404b={};_0x54404b[_0x2db022]={'$like':'%'+_0x1937b4[_0xc56a('0x2d')][_0xc56a('0x39')]+'%'};return _0x54404b;})});}_0x215a64=_[_0xc56a('0x3a')]({},_0x215a64,_0x1937b4[_0xc56a('0x3d')]);return _0x5f12dc[_0xc56a('0x4c')](_0x215a64);}})[_0xc56a('0x3e')](function(_0x5e668a){if(_0x5e668a){_0x4012c0=_0x5e668a[_0xc56a('0x33')];if(!_0x1937b4[_0xc56a('0x2d')]['hasOwnProperty'](_0xc56a('0x35'))){_0x215a64[_0xc56a('0x1e')]=qs[_0xc56a('0x1e')](_0x1937b4[_0xc56a('0x2d')]['limit']);_0x215a64['offset']=qs['offset'](_0x1937b4[_0xc56a('0x2d')]['offset']);}return _0x5f12dc[_0xc56a('0x4c')](_0x215a64);}})[_0xc56a('0x3e')](function(_0x26bcdf){if(_0x26bcdf){return _0x26bcdf?{'count':_0x4012c0,'rows':_0x26bcdf}:null;}})[_0xc56a('0x3e')](respondWithResult(_0x176606,null))[_0xc56a('0x46')](handleError(_0x176606,null));};exports['getSubjects']=function(_0x55e776,_0x32b5e4,_0x3a6e1a){var _0x196a36={};var _0x5adf91={};var _0x27b2df;var _0x37b910;return db[_0xc56a('0x28')][_0xc56a('0x49')]({'where':{'id':_0x55e776[_0xc56a('0x44')]['id']}})[_0xc56a('0x3e')](handleEntityNotFound(_0x32b5e4,null))[_0xc56a('0x3e')](function(_0x34cad2){if(_0x34cad2){_0x27b2df=_0x34cad2;_0x5adf91['model']=_['keys'](db[_0xc56a('0x4a')]['rawAttributes']);_0x5adf91[_0xc56a('0x2d')]=_['keys'](_0x55e776[_0xc56a('0x2d')]);_0x5adf91[_0xc56a('0x2f')]=_[_0xc56a('0x30')](_0x5adf91[_0xc56a('0x2c')],_0x5adf91[_0xc56a('0x2d')]);_0x196a36[_0xc56a('0x31')]=_[_0xc56a('0x30')](_0x5adf91['model'],qs[_0xc56a('0x32')](_0x55e776[_0xc56a('0x2d')]['fields']));_0x196a36[_0xc56a('0x31')]=_0x196a36['attributes'][_0xc56a('0x33')]?_0x196a36[_0xc56a('0x31')]:_0x5adf91['model'];_0x196a36[_0xc56a('0x36')]=qs['sort'](_0x55e776[_0xc56a('0x2d')][_0xc56a('0x37')]);_0x196a36[_0xc56a('0x38')]=qs['filters'](_['pick'](_0x55e776[_0xc56a('0x2d')],_0x5adf91[_0xc56a('0x2f')]));if(_0x55e776['query']['filter']){_0x196a36[_0xc56a('0x38')]=_[_0xc56a('0x3a')](_0x196a36[_0xc56a('0x38')],{'$or':_[_0xc56a('0x27')](_0x196a36[_0xc56a('0x31')],function(_0x17136c){var _0x37b0ce={};_0x37b0ce[_0x17136c]={'$like':'%'+_0x55e776[_0xc56a('0x2d')][_0xc56a('0x39')]+'%'};return _0x37b0ce;})});}_0x196a36=_[_0xc56a('0x3a')]({},_0x196a36,_0x55e776[_0xc56a('0x3d')]);return _0x27b2df[_0xc56a('0x4d')](_0x196a36);}})[_0xc56a('0x3e')](function(_0x39ed60){if(_0x39ed60){_0x37b910=_0x39ed60[_0xc56a('0x33')];if(!_0x55e776[_0xc56a('0x2d')][_0xc56a('0x34')](_0xc56a('0x35'))){_0x196a36['limit']=qs['limit'](_0x55e776['query'][_0xc56a('0x1e')]);_0x196a36['offset']=qs[_0xc56a('0x1c')](_0x55e776[_0xc56a('0x2d')][_0xc56a('0x1c')]);}return _0x27b2df[_0xc56a('0x4d')](_0x196a36);}})[_0xc56a('0x3e')](function(_0x285850){if(_0x285850){return _0x285850?{'count':_0x37b910,'rows':_0x285850}:null;}})[_0xc56a('0x3e')](respondWithResult(_0x32b5e4,null))['catch'](handleError(_0x32b5e4,null));};exports[_0xc56a('0x4e')]=function(_0x467459,_0x73e35c,_0x3853af){var _0x30d6c3={};var _0x1a6f27={};var _0x4c8603;var _0x224e37;return db[_0xc56a('0x28')][_0xc56a('0x49')]({'where':{'id':_0x467459[_0xc56a('0x44')]['id']}})[_0xc56a('0x3e')](handleEntityNotFound(_0x73e35c,null))[_0xc56a('0x3e')](function(_0x5c83f2){if(_0x5c83f2){_0x4c8603=_0x5c83f2;_0x1a6f27[_0xc56a('0x2c')]=_['keys'](db[_0xc56a('0x4a')]['rawAttributes']);_0x1a6f27['query']=_[_0xc56a('0x2e')](_0x467459[_0xc56a('0x2d')]);_0x1a6f27['filters']=_[_0xc56a('0x30')](_0x1a6f27[_0xc56a('0x2c')],_0x1a6f27['query']);_0x30d6c3[_0xc56a('0x31')]=_[_0xc56a('0x30')](_0x1a6f27[_0xc56a('0x2c')],qs[_0xc56a('0x32')](_0x467459['query']['fields']));_0x30d6c3[_0xc56a('0x31')]=_0x30d6c3['attributes'][_0xc56a('0x33')]?_0x30d6c3[_0xc56a('0x31')]:_0x1a6f27[_0xc56a('0x2c')];_0x30d6c3['order']=qs[_0xc56a('0x37')](_0x467459[_0xc56a('0x2d')]['sort']);_0x30d6c3[_0xc56a('0x38')]=qs[_0xc56a('0x2f')](_[_0xc56a('0x4b')](_0x467459[_0xc56a('0x2d')],_0x1a6f27[_0xc56a('0x2f')]));if(_0x467459[_0xc56a('0x2d')]['filter']){_0x30d6c3['where']=_[_0xc56a('0x3a')](_0x30d6c3[_0xc56a('0x38')],{'$or':_[_0xc56a('0x27')](_0x30d6c3[_0xc56a('0x31')],function(_0x3bd4b6){var _0x46a179={};_0x46a179[_0x3bd4b6]={'$like':'%'+_0x467459[_0xc56a('0x2d')]['filter']+'%'};return _0x46a179;})});}_0x30d6c3=_[_0xc56a('0x3a')]({},_0x30d6c3,_0x467459[_0xc56a('0x3d')]);return _0x4c8603['getDescriptions'](_0x30d6c3);}})['then'](function(_0x2c7241){if(_0x2c7241){_0x224e37=_0x2c7241[_0xc56a('0x33')];if(!_0x467459[_0xc56a('0x2d')][_0xc56a('0x34')](_0xc56a('0x35'))){_0x30d6c3[_0xc56a('0x1e')]=qs[_0xc56a('0x1e')](_0x467459['query'][_0xc56a('0x1e')]);_0x30d6c3[_0xc56a('0x1c')]=qs[_0xc56a('0x1c')](_0x467459[_0xc56a('0x2d')][_0xc56a('0x1c')]);}return _0x4c8603[_0xc56a('0x4e')](_0x30d6c3);}})[_0xc56a('0x3e')](function(_0x1bc2cd){if(_0x1bc2cd){return _0x1bc2cd?{'count':_0x224e37,'rows':_0x1bc2cd}:null;}})[_0xc56a('0x3e')](respondWithResult(_0x73e35c,null))['catch'](handleError(_0x73e35c,null));};exports['getTags']=function(_0x4658e6,_0x3568b9,_0x204322){var _0x46fb07={};var _0x10714e={};var _0xf3d601;var _0x373f1c;return db[_0xc56a('0x28')]['findOne']({'where':{'id':_0x4658e6['params']['id']}})[_0xc56a('0x3e')](handleEntityNotFound(_0x3568b9,null))['then'](function(_0x5049ec){if(_0x5049ec){_0xf3d601=_0x5049ec;_0x10714e[_0xc56a('0x2c')]=_[_0xc56a('0x2e')](db[_0xc56a('0x4f')]['rawAttributes']);_0x10714e[_0xc56a('0x2d')]=_[_0xc56a('0x2e')](_0x4658e6['query']);_0x10714e[_0xc56a('0x2f')]=_[_0xc56a('0x30')](_0x10714e[_0xc56a('0x2c')],_0x10714e[_0xc56a('0x2d')]);_0x46fb07[_0xc56a('0x31')]=_['intersection'](_0x10714e[_0xc56a('0x2c')],qs[_0xc56a('0x32')](_0x4658e6[_0xc56a('0x2d')][_0xc56a('0x32')]));_0x46fb07[_0xc56a('0x31')]=_0x46fb07['attributes']['length']?_0x46fb07[_0xc56a('0x31')]:_0x10714e[_0xc56a('0x2c')];_0x46fb07[_0xc56a('0x36')]=qs[_0xc56a('0x37')](_0x4658e6['query']['sort']);_0x46fb07[_0xc56a('0x38')]=qs[_0xc56a('0x2f')](_['pick'](_0x4658e6[_0xc56a('0x2d')],_0x10714e[_0xc56a('0x2f')]));if(_0x4658e6[_0xc56a('0x2d')]['filter']){_0x46fb07[_0xc56a('0x38')]=_[_0xc56a('0x3a')](_0x46fb07[_0xc56a('0x38')],{'$or':_[_0xc56a('0x27')](_0x46fb07[_0xc56a('0x31')],function(_0x15a278){var _0x23e207={};_0x23e207[_0x15a278]={'$like':'%'+_0x4658e6['query'][_0xc56a('0x39')]+'%'};return _0x23e207;})});}_0x46fb07=_[_0xc56a('0x3a')]({},_0x46fb07,_0x4658e6[_0xc56a('0x3d')]);return _0xf3d601[_0xc56a('0x50')](_0x46fb07);}})[_0xc56a('0x3e')](function(_0x40200d){if(_0x40200d){_0x373f1c=_0x40200d[_0xc56a('0x33')];if(!_0x4658e6[_0xc56a('0x2d')][_0xc56a('0x34')](_0xc56a('0x35'))){_0x46fb07[_0xc56a('0x1e')]=qs[_0xc56a('0x1e')](_0x4658e6['query'][_0xc56a('0x1e')]);_0x46fb07['offset']=qs[_0xc56a('0x1c')](_0x4658e6[_0xc56a('0x2d')][_0xc56a('0x1c')]);}return _0xf3d601[_0xc56a('0x50')](_0x46fb07);}})[_0xc56a('0x3e')](function(_0x575ba7){if(_0x575ba7){return _0x575ba7?{'count':_0x373f1c,'rows':_0x575ba7}:null;}})[_0xc56a('0x3e')](respondWithResult(_0x3568b9,null))[_0xc56a('0x46')](handleError(_0x3568b9,null));};exports[_0xc56a('0x51')]=function(_0x4b61db,_0x35a77a,_0xd4d93b){if(_0x4b61db['body']['id']){delete _0x4b61db[_0xc56a('0x48')]['id'];}return db[_0xc56a('0x28')][_0xc56a('0x49')]({'where':{'id':_0x4b61db[_0xc56a('0x44')]['id']}})['then'](handleEntityNotFound(_0x35a77a,null))[_0xc56a('0x3e')](function(_0x147b8b){if(_0x147b8b){return _0x147b8b['setTags'](_0x4b61db['body'][_0xc56a('0x52')]||[]);}return null;})['then'](respondWithResult(_0x35a77a,null))['catch'](handleError(_0x35a77a,null));}; \ No newline at end of file +var _0x6eb3=['fields','length','hasOwnProperty','limit','order','where','pick','merge','map','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','FreshdeskField','sort','nolimit','findOne','getSubjects','getDescriptions','getTags','Tag','setTags','ids','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0xd294e7,_0x15afb7){var _0x46459e=function(_0x156237){while(--_0x156237){_0xd294e7['push'](_0xd294e7['shift']());}};_0x46459e(++_0x15afb7);}(_0x6eb3,0x124));var _0x36eb=function(_0x2cd3e3,_0xbbe36c){_0x2cd3e3=_0x2cd3e3-0x0;var _0xfbda40=_0x6eb3[_0x2cd3e3];return _0xfbda40;};'use strict';var emlformat=require(_0x36eb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x36eb('0x1'));var jsonpatch=require(_0x36eb('0x2'));var rp=require('request-promise');var moment=require(_0x36eb('0x3'));var BPromise=require(_0x36eb('0x4'));var Mustache=require(_0x36eb('0x5'));var util=require('util');var path=require(_0x36eb('0x6'));var sox=require(_0x36eb('0x7'));var csv=require(_0x36eb('0x8'));var ejs=require(_0x36eb('0x9'));var fs=require('fs');var fs_extra=require(_0x36eb('0xa'));var _=require(_0x36eb('0xb'));var squel=require(_0x36eb('0xc'));var crypto=require(_0x36eb('0xd'));var jsforce=require(_0x36eb('0xe'));var deskjs=require(_0x36eb('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x36eb('0x10'));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(_0x36eb('0x11'));var logger=require(_0x36eb('0x12'))(_0x36eb('0x13'));var utils=require(_0x36eb('0x14'));var config=require(_0x36eb('0x15'));var licenseUtil=require(_0x36eb('0x16'));var db=require(_0x36eb('0x17'))['db'];function respondWithStatusCode(_0x2904c5,_0x1cd886){_0x1cd886=_0x1cd886||0xcc;return function(_0x170a77){if(_0x170a77){return _0x2904c5[_0x36eb('0x18')](_0x1cd886);}return _0x2904c5['status'](_0x1cd886)[_0x36eb('0x19')]();};}function respondWithResult(_0x2675b7,_0x3ba7c5){_0x3ba7c5=_0x3ba7c5||0xc8;return function(_0x5eb4ef){if(_0x5eb4ef){return _0x2675b7[_0x36eb('0x1a')](_0x3ba7c5)[_0x36eb('0x1b')](_0x5eb4ef);}};}function respondWithFilteredResult(_0x309bf1,_0x491da9){return function(_0x7698ca){if(_0x7698ca){var _0x76537d=typeof _0x491da9[_0x36eb('0x1c')]===_0x36eb('0x1d')&&typeof _0x491da9['limit']===_0x36eb('0x1d');var _0x2666e8=_0x7698ca[_0x36eb('0x1e')];var _0x438b6f=_0x76537d?0x0:_0x491da9['offset'];var _0x5a3133=_0x76537d?_0x7698ca[_0x36eb('0x1e')]:_0x491da9[_0x36eb('0x1c')]+_0x491da9['limit'];var _0xb90a53;if(_0x5a3133>=_0x2666e8){_0x5a3133=_0x2666e8;_0xb90a53=0xc8;}else{_0xb90a53=0xce;}_0x309bf1['status'](_0xb90a53);return _0x309bf1[_0x36eb('0x1f')](_0x36eb('0x20'),_0x438b6f+'-'+_0x5a3133+'/'+_0x2666e8)[_0x36eb('0x1b')](_0x7698ca);}return null;};}function patchUpdates(_0x330dfa){return function(_0x3e5a84){try{jsonpatch[_0x36eb('0x21')](_0x3e5a84,_0x330dfa,!![]);}catch(_0x7c946e){return BPromise[_0x36eb('0x22')](_0x7c946e);}return _0x3e5a84[_0x36eb('0x23')]();};}function saveUpdates(_0x33cd03,_0x51e456){return function(_0x5c668c){if(_0x5c668c){return _0x5c668c[_0x36eb('0x24')](_0x33cd03)[_0x36eb('0x25')](function(_0x349f1f){return _0x349f1f;});}return null;};}function removeEntity(_0x2a3c8b,_0x2f1cc5){return function(_0x321d47){if(_0x321d47){return _0x321d47[_0x36eb('0x26')]()[_0x36eb('0x25')](function(){_0x2a3c8b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x14c9fc,_0x84de4d){return function(_0x41f798){if(!_0x41f798){_0x14c9fc[_0x36eb('0x18')](0x194);}return _0x41f798;};}function handleError(_0x575c2a,_0x388a2e){_0x388a2e=_0x388a2e||0x1f4;return function(_0x4a2303){logger[_0x36eb('0x27')](_0x4a2303['stack']);if(_0x4a2303[_0x36eb('0x28')]){delete _0x4a2303[_0x36eb('0x28')];}_0x575c2a[_0x36eb('0x1a')](_0x388a2e)[_0x36eb('0x29')](_0x4a2303);};}exports[_0x36eb('0x2a')]=function(_0x2bbd03,_0x34c329){var _0x154a3b={},_0x238dd1={},_0x2b45cb={'count':0x0,'rows':[]};var _0x1242af=_['map'](db['FreshdeskConfiguration'][_0x36eb('0x2b')],function(_0x2b34c2){return{'name':_0x2b34c2[_0x36eb('0x2c')],'type':_0x2b34c2[_0x36eb('0x2d')]['key']};});_0x238dd1['model']=_['map'](_0x1242af,_0x36eb('0x28'));_0x238dd1[_0x36eb('0x2e')]=_[_0x36eb('0x2f')](_0x2bbd03['query']);_0x238dd1[_0x36eb('0x30')]=_[_0x36eb('0x31')](_0x238dd1[_0x36eb('0x32')],_0x238dd1['query']);_0x154a3b[_0x36eb('0x33')]=_[_0x36eb('0x31')](_0x238dd1[_0x36eb('0x32')],qs[_0x36eb('0x34')](_0x2bbd03['query'][_0x36eb('0x34')]));_0x154a3b['attributes']=_0x154a3b[_0x36eb('0x33')][_0x36eb('0x35')]?_0x154a3b[_0x36eb('0x33')]:_0x238dd1[_0x36eb('0x32')];if(!_0x2bbd03['query'][_0x36eb('0x36')]('nolimit')){_0x154a3b[_0x36eb('0x37')]=qs[_0x36eb('0x37')](_0x2bbd03['query'][_0x36eb('0x37')]);_0x154a3b[_0x36eb('0x1c')]=qs[_0x36eb('0x1c')](_0x2bbd03['query'][_0x36eb('0x1c')]);}_0x154a3b[_0x36eb('0x38')]=qs['sort'](_0x2bbd03[_0x36eb('0x2e')]['sort']);_0x154a3b[_0x36eb('0x39')]=qs[_0x36eb('0x30')](_[_0x36eb('0x3a')](_0x2bbd03[_0x36eb('0x2e')],_0x238dd1[_0x36eb('0x30')]),_0x1242af);if(_0x2bbd03[_0x36eb('0x2e')]['filter']){_0x154a3b[_0x36eb('0x39')]=_[_0x36eb('0x3b')](_0x154a3b[_0x36eb('0x39')],{'$or':_[_0x36eb('0x3c')](_0x1242af,function(_0x1b0a5e){if(_0x1b0a5e[_0x36eb('0x2d')]!==_0x36eb('0x3d')){var _0x5c81da={};_0x5c81da[_0x1b0a5e[_0x36eb('0x28')]]={'$like':'%'+_0x2bbd03[_0x36eb('0x2e')][_0x36eb('0x3e')]+'%'};return _0x5c81da;}})});}_0x154a3b=_['merge']({},_0x154a3b,_0x2bbd03[_0x36eb('0x3f')]);var _0x5a0128={'where':_0x154a3b[_0x36eb('0x39')]};return db[_0x36eb('0x40')]['count'](_0x5a0128)[_0x36eb('0x25')](function(_0x3cb012){_0x2b45cb[_0x36eb('0x1e')]=_0x3cb012;if(_0x2bbd03[_0x36eb('0x2e')][_0x36eb('0x41')]){_0x154a3b[_0x36eb('0x42')]=[{'all':!![]}];}return db[_0x36eb('0x40')][_0x36eb('0x43')](_0x154a3b);})[_0x36eb('0x25')](function(_0x208e10){_0x2b45cb[_0x36eb('0x44')]=_0x208e10;return _0x2b45cb;})[_0x36eb('0x25')](respondWithFilteredResult(_0x34c329,_0x154a3b))[_0x36eb('0x45')](handleError(_0x34c329,null));};exports[_0x36eb('0x46')]=function(_0x2b1b4a,_0x39e46f){var _0xbd3df8={'raw':![],'where':{'id':_0x2b1b4a[_0x36eb('0x47')]['id']}},_0x16b037={};_0x16b037['model']=_[_0x36eb('0x2f')](db[_0x36eb('0x40')]['rawAttributes']);_0x16b037[_0x36eb('0x2e')]=_[_0x36eb('0x2f')](_0x2b1b4a[_0x36eb('0x2e')]);_0x16b037[_0x36eb('0x30')]=_[_0x36eb('0x31')](_0x16b037[_0x36eb('0x32')],_0x16b037[_0x36eb('0x2e')]);_0xbd3df8[_0x36eb('0x33')]=_[_0x36eb('0x31')](_0x16b037[_0x36eb('0x32')],qs['fields'](_0x2b1b4a[_0x36eb('0x2e')]['fields']));_0xbd3df8[_0x36eb('0x33')]=_0xbd3df8[_0x36eb('0x33')][_0x36eb('0x35')]?_0xbd3df8[_0x36eb('0x33')]:_0x16b037[_0x36eb('0x32')];if(_0x2b1b4a[_0x36eb('0x2e')][_0x36eb('0x41')]){_0xbd3df8[_0x36eb('0x42')]=[{'all':!![]}];}_0xbd3df8=_[_0x36eb('0x3b')]({},_0xbd3df8,_0x2b1b4a['options']);return db[_0x36eb('0x40')][_0x36eb('0x48')](_0xbd3df8)[_0x36eb('0x25')](handleEntityNotFound(_0x39e46f,null))[_0x36eb('0x25')](respondWithResult(_0x39e46f,null))['catch'](handleError(_0x39e46f,null));};exports['create']=function(_0x2af20b,_0x58cc6a){return db['FreshdeskConfiguration'][_0x36eb('0x49')](_0x2af20b[_0x36eb('0x4a')],{})['then'](respondWithResult(_0x58cc6a,0xc9))[_0x36eb('0x45')](handleError(_0x58cc6a,null));};exports['update']=function(_0x5d8d15,_0x5ac030){if(_0x5d8d15[_0x36eb('0x4a')]['id']){delete _0x5d8d15[_0x36eb('0x4a')]['id'];}return db[_0x36eb('0x40')][_0x36eb('0x48')]({'where':{'id':_0x5d8d15[_0x36eb('0x47')]['id']}})[_0x36eb('0x25')](handleEntityNotFound(_0x5ac030,null))[_0x36eb('0x25')](saveUpdates(_0x5d8d15[_0x36eb('0x4a')],null))[_0x36eb('0x25')](respondWithResult(_0x5ac030,null))['catch'](handleError(_0x5ac030,null));};exports[_0x36eb('0x26')]=function(_0x46c867,_0x2fe6e0){return db[_0x36eb('0x40')]['find']({'where':{'id':_0x46c867[_0x36eb('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fe6e0,null))[_0x36eb('0x25')](removeEntity(_0x2fe6e0,null))[_0x36eb('0x45')](handleError(_0x2fe6e0,null));};exports[_0x36eb('0x4b')]=function(_0x21efec,_0x29eba4,_0x12767a){var _0x31be97={};var _0x30ec93={};var _0x9a1270;var _0x4c833d;return db[_0x36eb('0x40')]['findOne']({'where':{'id':_0x21efec['params']['id']}})[_0x36eb('0x25')](handleEntityNotFound(_0x29eba4,null))[_0x36eb('0x25')](function(_0xc4b34){if(_0xc4b34){_0x9a1270=_0xc4b34;_0x30ec93[_0x36eb('0x32')]=_['keys'](db[_0x36eb('0x4c')][_0x36eb('0x2b')]);_0x30ec93[_0x36eb('0x2e')]=_['keys'](_0x21efec[_0x36eb('0x2e')]);_0x30ec93[_0x36eb('0x30')]=_['intersection'](_0x30ec93[_0x36eb('0x32')],_0x30ec93['query']);_0x31be97[_0x36eb('0x33')]=_[_0x36eb('0x31')](_0x30ec93['model'],qs[_0x36eb('0x34')](_0x21efec[_0x36eb('0x2e')]['fields']));_0x31be97['attributes']=_0x31be97['attributes']['length']?_0x31be97[_0x36eb('0x33')]:_0x30ec93[_0x36eb('0x32')];_0x31be97[_0x36eb('0x38')]=qs[_0x36eb('0x4d')](_0x21efec['query'][_0x36eb('0x4d')]);_0x31be97[_0x36eb('0x39')]=qs[_0x36eb('0x30')](_[_0x36eb('0x3a')](_0x21efec[_0x36eb('0x2e')],_0x30ec93[_0x36eb('0x30')]));if(_0x21efec[_0x36eb('0x2e')][_0x36eb('0x3e')]){_0x31be97[_0x36eb('0x39')]=_['merge'](_0x31be97['where'],{'$or':_['map'](_0x31be97[_0x36eb('0x33')],function(_0x397de4){var _0x923ca9={};_0x923ca9[_0x397de4]={'$like':'%'+_0x21efec[_0x36eb('0x2e')][_0x36eb('0x3e')]+'%'};return _0x923ca9;})});}_0x31be97=_[_0x36eb('0x3b')]({},_0x31be97,_0x21efec['options']);return _0x9a1270[_0x36eb('0x4b')](_0x31be97);}})[_0x36eb('0x25')](function(_0x116b1a){if(_0x116b1a){_0x4c833d=_0x116b1a[_0x36eb('0x35')];if(!_0x21efec['query'][_0x36eb('0x36')](_0x36eb('0x4e'))){_0x31be97['limit']=qs[_0x36eb('0x37')](_0x21efec[_0x36eb('0x2e')][_0x36eb('0x37')]);_0x31be97[_0x36eb('0x1c')]=qs[_0x36eb('0x1c')](_0x21efec['query'][_0x36eb('0x1c')]);}return _0x9a1270[_0x36eb('0x4b')](_0x31be97);}})['then'](function(_0x3dcf64){if(_0x3dcf64){return _0x3dcf64?{'count':_0x4c833d,'rows':_0x3dcf64}:null;}})[_0x36eb('0x25')](respondWithResult(_0x29eba4,null))[_0x36eb('0x45')](handleError(_0x29eba4,null));};exports['getSubjects']=function(_0x1be7d1,_0x33e430,_0xbf9085){var _0x4ef392={};var _0x564247={};var _0x5f0ea1;var _0x3ee637;return db[_0x36eb('0x40')][_0x36eb('0x4f')]({'where':{'id':_0x1be7d1[_0x36eb('0x47')]['id']}})['then'](handleEntityNotFound(_0x33e430,null))[_0x36eb('0x25')](function(_0x4f18fa){if(_0x4f18fa){_0x5f0ea1=_0x4f18fa;_0x564247[_0x36eb('0x32')]=_['keys'](db[_0x36eb('0x4c')][_0x36eb('0x2b')]);_0x564247['query']=_['keys'](_0x1be7d1[_0x36eb('0x2e')]);_0x564247[_0x36eb('0x30')]=_[_0x36eb('0x31')](_0x564247[_0x36eb('0x32')],_0x564247['query']);_0x4ef392[_0x36eb('0x33')]=_[_0x36eb('0x31')](_0x564247[_0x36eb('0x32')],qs[_0x36eb('0x34')](_0x1be7d1[_0x36eb('0x2e')][_0x36eb('0x34')]));_0x4ef392['attributes']=_0x4ef392[_0x36eb('0x33')][_0x36eb('0x35')]?_0x4ef392[_0x36eb('0x33')]:_0x564247['model'];_0x4ef392[_0x36eb('0x38')]=qs[_0x36eb('0x4d')](_0x1be7d1['query']['sort']);_0x4ef392[_0x36eb('0x39')]=qs[_0x36eb('0x30')](_['pick'](_0x1be7d1[_0x36eb('0x2e')],_0x564247[_0x36eb('0x30')]));if(_0x1be7d1['query'][_0x36eb('0x3e')]){_0x4ef392['where']=_[_0x36eb('0x3b')](_0x4ef392[_0x36eb('0x39')],{'$or':_[_0x36eb('0x3c')](_0x4ef392[_0x36eb('0x33')],function(_0x256e87){var _0x30c313={};_0x30c313[_0x256e87]={'$like':'%'+_0x1be7d1[_0x36eb('0x2e')][_0x36eb('0x3e')]+'%'};return _0x30c313;})});}_0x4ef392=_[_0x36eb('0x3b')]({},_0x4ef392,_0x1be7d1['options']);return _0x5f0ea1[_0x36eb('0x50')](_0x4ef392);}})[_0x36eb('0x25')](function(_0x34de96){if(_0x34de96){_0x3ee637=_0x34de96['length'];if(!_0x1be7d1[_0x36eb('0x2e')][_0x36eb('0x36')]('nolimit')){_0x4ef392[_0x36eb('0x37')]=qs[_0x36eb('0x37')](_0x1be7d1[_0x36eb('0x2e')][_0x36eb('0x37')]);_0x4ef392[_0x36eb('0x1c')]=qs[_0x36eb('0x1c')](_0x1be7d1[_0x36eb('0x2e')][_0x36eb('0x1c')]);}return _0x5f0ea1[_0x36eb('0x50')](_0x4ef392);}})[_0x36eb('0x25')](function(_0x10d225){if(_0x10d225){return _0x10d225?{'count':_0x3ee637,'rows':_0x10d225}:null;}})[_0x36eb('0x25')](respondWithResult(_0x33e430,null))['catch'](handleError(_0x33e430,null));};exports[_0x36eb('0x51')]=function(_0x284887,_0x5cc954,_0x3e7209){var _0x247a0f={};var _0x199b41={};var _0x193a43;var _0x2e708f;return db[_0x36eb('0x40')][_0x36eb('0x4f')]({'where':{'id':_0x284887['params']['id']}})[_0x36eb('0x25')](handleEntityNotFound(_0x5cc954,null))['then'](function(_0x5c90e6){if(_0x5c90e6){_0x193a43=_0x5c90e6;_0x199b41[_0x36eb('0x32')]=_['keys'](db[_0x36eb('0x4c')][_0x36eb('0x2b')]);_0x199b41[_0x36eb('0x2e')]=_['keys'](_0x284887[_0x36eb('0x2e')]);_0x199b41[_0x36eb('0x30')]=_[_0x36eb('0x31')](_0x199b41[_0x36eb('0x32')],_0x199b41[_0x36eb('0x2e')]);_0x247a0f[_0x36eb('0x33')]=_[_0x36eb('0x31')](_0x199b41[_0x36eb('0x32')],qs[_0x36eb('0x34')](_0x284887['query'][_0x36eb('0x34')]));_0x247a0f[_0x36eb('0x33')]=_0x247a0f[_0x36eb('0x33')][_0x36eb('0x35')]?_0x247a0f[_0x36eb('0x33')]:_0x199b41[_0x36eb('0x32')];_0x247a0f[_0x36eb('0x38')]=qs['sort'](_0x284887[_0x36eb('0x2e')][_0x36eb('0x4d')]);_0x247a0f[_0x36eb('0x39')]=qs[_0x36eb('0x30')](_[_0x36eb('0x3a')](_0x284887[_0x36eb('0x2e')],_0x199b41[_0x36eb('0x30')]));if(_0x284887[_0x36eb('0x2e')][_0x36eb('0x3e')]){_0x247a0f[_0x36eb('0x39')]=_['merge'](_0x247a0f[_0x36eb('0x39')],{'$or':_[_0x36eb('0x3c')](_0x247a0f['attributes'],function(_0x367f8e){var _0x5e9017={};_0x5e9017[_0x367f8e]={'$like':'%'+_0x284887[_0x36eb('0x2e')]['filter']+'%'};return _0x5e9017;})});}_0x247a0f=_['merge']({},_0x247a0f,_0x284887[_0x36eb('0x3f')]);return _0x193a43[_0x36eb('0x51')](_0x247a0f);}})['then'](function(_0x38c106){if(_0x38c106){_0x2e708f=_0x38c106[_0x36eb('0x35')];if(!_0x284887[_0x36eb('0x2e')]['hasOwnProperty'](_0x36eb('0x4e'))){_0x247a0f['limit']=qs[_0x36eb('0x37')](_0x284887[_0x36eb('0x2e')]['limit']);_0x247a0f[_0x36eb('0x1c')]=qs['offset'](_0x284887['query'][_0x36eb('0x1c')]);}return _0x193a43[_0x36eb('0x51')](_0x247a0f);}})[_0x36eb('0x25')](function(_0x41bbbe){if(_0x41bbbe){return _0x41bbbe?{'count':_0x2e708f,'rows':_0x41bbbe}:null;}})[_0x36eb('0x25')](respondWithResult(_0x5cc954,null))['catch'](handleError(_0x5cc954,null));};exports[_0x36eb('0x52')]=function(_0x1f626b,_0x429036,_0x21208a){var _0x3fe75b={};var _0x28e7ee={};var _0x2feab2;var _0x35d1e6;return db[_0x36eb('0x40')]['findOne']({'where':{'id':_0x1f626b[_0x36eb('0x47')]['id']}})[_0x36eb('0x25')](handleEntityNotFound(_0x429036,null))['then'](function(_0x3a77a7){if(_0x3a77a7){_0x2feab2=_0x3a77a7;_0x28e7ee[_0x36eb('0x32')]=_[_0x36eb('0x2f')](db[_0x36eb('0x53')][_0x36eb('0x2b')]);_0x28e7ee[_0x36eb('0x2e')]=_['keys'](_0x1f626b[_0x36eb('0x2e')]);_0x28e7ee[_0x36eb('0x30')]=_[_0x36eb('0x31')](_0x28e7ee[_0x36eb('0x32')],_0x28e7ee['query']);_0x3fe75b['attributes']=_[_0x36eb('0x31')](_0x28e7ee['model'],qs['fields'](_0x1f626b[_0x36eb('0x2e')][_0x36eb('0x34')]));_0x3fe75b['attributes']=_0x3fe75b[_0x36eb('0x33')][_0x36eb('0x35')]?_0x3fe75b[_0x36eb('0x33')]:_0x28e7ee['model'];_0x3fe75b[_0x36eb('0x38')]=qs['sort'](_0x1f626b['query']['sort']);_0x3fe75b[_0x36eb('0x39')]=qs['filters'](_[_0x36eb('0x3a')](_0x1f626b[_0x36eb('0x2e')],_0x28e7ee['filters']));if(_0x1f626b[_0x36eb('0x2e')][_0x36eb('0x3e')]){_0x3fe75b[_0x36eb('0x39')]=_['merge'](_0x3fe75b[_0x36eb('0x39')],{'$or':_[_0x36eb('0x3c')](_0x3fe75b[_0x36eb('0x33')],function(_0x5ac3ef){var _0x331e67={};_0x331e67[_0x5ac3ef]={'$like':'%'+_0x1f626b[_0x36eb('0x2e')][_0x36eb('0x3e')]+'%'};return _0x331e67;})});}_0x3fe75b=_['merge']({},_0x3fe75b,_0x1f626b['options']);return _0x2feab2['getTags'](_0x3fe75b);}})[_0x36eb('0x25')](function(_0x26f7c8){if(_0x26f7c8){_0x35d1e6=_0x26f7c8[_0x36eb('0x35')];if(!_0x1f626b['query'][_0x36eb('0x36')]('nolimit')){_0x3fe75b[_0x36eb('0x37')]=qs['limit'](_0x1f626b['query']['limit']);_0x3fe75b['offset']=qs[_0x36eb('0x1c')](_0x1f626b[_0x36eb('0x2e')][_0x36eb('0x1c')]);}return _0x2feab2[_0x36eb('0x52')](_0x3fe75b);}})['then'](function(_0x57c67d){if(_0x57c67d){return _0x57c67d?{'count':_0x35d1e6,'rows':_0x57c67d}:null;}})[_0x36eb('0x25')](respondWithResult(_0x429036,null))[_0x36eb('0x45')](handleError(_0x429036,null));};exports['setTags']=function(_0x32d6f9,_0xc61b13,_0x2032c4){if(_0x32d6f9['body']['id']){delete _0x32d6f9[_0x36eb('0x4a')]['id'];}return db[_0x36eb('0x40')]['findOne']({'where':{'id':_0x32d6f9[_0x36eb('0x47')]['id']}})[_0x36eb('0x25')](handleEntityNotFound(_0xc61b13,null))['then'](function(_0x3104e7){if(_0x3104e7){return _0x3104e7[_0x36eb('0x54')](_0x32d6f9[_0x36eb('0x4a')][_0x36eb('0x55')]||[]);}return null;})['then'](respondWithResult(_0xc61b13,null))['catch'](handleError(_0xc61b13,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 4772fbf..0ff75c1 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 _0x8dad=['path','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','int_freshdesk_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x69a858,_0x713f84){var _0x35e9b1=function(_0x3fe06c){while(--_0x3fe06c){_0x69a858['push'](_0x69a858['shift']());}};_0x35e9b1(++_0x713f84);}(_0x8dad,0xe2));var _0xd8da=function(_0x572a5c,_0x197d8a){_0x572a5c=_0x572a5c-0x0;var _0x3734ca=_0x8dad[_0x572a5c];return _0x3734ca;};'use strict';var _=require(_0xd8da('0x0'));var util=require(_0xd8da('0x1'));var logger=require(_0xd8da('0x2'))('api');var moment=require(_0xd8da('0x3'));var BPromise=require(_0xd8da('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8da('0x5'));var rimraf=require('rimraf');var config=require(_0xd8da('0x6'));var attributes=require(_0xd8da('0x7'));module[_0xd8da('0x8')]=function(_0x124639,_0x85ddf6){return _0x124639[_0xd8da('0x9')]('FreshdeskConfiguration',attributes,{'tableName':_0xd8da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63a5=['path','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','../../config/logger','api','request-promise'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x63a5,0x1b6));var _0x563a=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x63a5[_0x51c819];return _0x15c5d2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x563a('0x0'))(_0x563a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x563a('0x2'));var fs=require('fs');var path=require(_0x563a('0x3'));var rimraf=require('rimraf');var config=require(_0x563a('0x4'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x563a('0x5')]=function(_0x3b74f5,_0x4364b6){return _0x3b74f5[_0x563a('0x6')](_0x563a('0x7'),attributes,{'tableName':_0x563a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 4fa4d9a..c6e0a61 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 _0x4713=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4713,0x1a9));var _0x3471=function(_0x46b8aa,_0x246d21){_0x46b8aa=_0x46b8aa-0x0;var _0x5a3d61=_0x4713[_0x46b8aa];return _0x5a3d61;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3471('0x0'));var BPromise=require(_0x3471('0x1'));var rs=require(_0x3471('0x2'));var fs=require('fs');var Redis=require(_0x3471('0x3'));var db=require(_0x3471('0x4'))['db'];var utils=require(_0x3471('0x5'));var logger=require(_0x3471('0x6'))(_0x3471('0x7'));var config=require(_0x3471('0x8'));var jayson=require(_0x3471('0x9'));var client=jayson[_0x3471('0xa')][_0x3471('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4374cf,_0xd9e99c,_0x1a654d){return new BPromise(function(_0x3f0ac7,_0xa3750f){return client[_0x3471('0xc')](_0x4374cf,_0x1a654d)[_0x3471('0xd')](function(_0x4af066){logger[_0x3471('0xe')]('FreshdeskConfiguration,\x20%s,\x20%s',_0xd9e99c,_0x3471('0xf'));logger[_0x3471('0x10')](_0x3471('0x11'),_0xd9e99c,'request\x20sent',JSON[_0x3471('0x12')](_0x4af066));if(_0x4af066[_0x3471('0x13')]){if(_0x4af066[_0x3471('0x13')][_0x3471('0x14')]===0x1f4){logger[_0x3471('0x13')](_0x3471('0x15'),_0xd9e99c,_0x4af066[_0x3471('0x13')]['message']);return _0xa3750f(_0x4af066[_0x3471('0x13')][_0x3471('0x16')]);}logger[_0x3471('0x13')](_0x3471('0x15'),_0xd9e99c,_0x4af066[_0x3471('0x13')]['message']);return _0x3f0ac7(_0x4af066[_0x3471('0x13')][_0x3471('0x16')]);}else{logger[_0x3471('0xe')](_0x3471('0x15'),_0xd9e99c,_0x3471('0xf'));_0x3f0ac7(_0x4af066['result'][_0x3471('0x16')]);}})[_0x3471('0x17')](function(_0x124022){logger[_0x3471('0x13')](_0x3471('0x15'),_0xd9e99c,_0x124022);_0xa3750f(_0x124022);});});} \ No newline at end of file +var _0x5dcb=['request','then','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x4b4638,_0xe99cda){var _0x59e92b=function(_0x2817ea){while(--_0x2817ea){_0x4b4638['push'](_0x4b4638['shift']());}};_0x59e92b(++_0xe99cda);}(_0x5dcb,0x9c));var _0xb5dc=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x5dcb[_0x1ad926];return _0x1b81dc;};'use strict';var _=require(_0xb5dc('0x0'));var util=require(_0xb5dc('0x1'));var moment=require(_0xb5dc('0x2'));var BPromise=require(_0xb5dc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5dc('0x4'));var db=require(_0xb5dc('0x5'))['db'];var utils=require(_0xb5dc('0x6'));var logger=require(_0xb5dc('0x7'))(_0xb5dc('0x8'));var config=require(_0xb5dc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb5dc('0xa')][_0xb5dc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b21aa,_0x45130a,_0x5ba3de){return new BPromise(function(_0x1020fa,_0x54dbbc){return client[_0xb5dc('0xc')](_0x2b21aa,_0x5ba3de)[_0xb5dc('0xd')](function(_0x40aaad){logger['info'](_0xb5dc('0xe'),_0x45130a,_0xb5dc('0xf'));logger[_0xb5dc('0x10')](_0xb5dc('0x11'),_0x45130a,_0xb5dc('0xf'),JSON[_0xb5dc('0x12')](_0x40aaad));if(_0x40aaad[_0xb5dc('0x13')]){if(_0x40aaad[_0xb5dc('0x13')][_0xb5dc('0x14')]===0x1f4){logger[_0xb5dc('0x13')](_0xb5dc('0xe'),_0x45130a,_0x40aaad[_0xb5dc('0x13')][_0xb5dc('0x15')]);return _0x54dbbc(_0x40aaad[_0xb5dc('0x13')][_0xb5dc('0x15')]);}logger[_0xb5dc('0x13')](_0xb5dc('0xe'),_0x45130a,_0x40aaad[_0xb5dc('0x13')][_0xb5dc('0x15')]);return _0x1020fa(_0x40aaad['error'][_0xb5dc('0x15')]);}else{logger[_0xb5dc('0x16')](_0xb5dc('0xe'),_0x45130a,_0xb5dc('0xf'));_0x1020fa(_0x40aaad['result'][_0xb5dc('0x15')]);}})[_0xb5dc('0x17')](function(_0x104dbb){logger[_0xb5dc('0x13')](_0xb5dc('0xe'),_0x45130a,_0x104dbb);_0x54dbbc(_0x104dbb);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index de889e8..43c54ad 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 _0x7baf=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','index','/:id','isAuthenticated','show','create','put','update','destroy','exports','multer','util','path','express'];(function(_0x3af955,_0x21431c){var _0x167de5=function(_0x78879c){while(--_0x78879c){_0x3af955['push'](_0x3af955['shift']());}};_0x167de5(++_0x21431c);}(_0x7baf,0x152));var _0xf7ba=function(_0x53ddab,_0x4ada9d){_0x53ddab=_0x53ddab-0x0;var _0x5819ac=_0x7baf[_0x53ddab];return _0x5819ac;};'use strict';var multer=require(_0xf7ba('0x0'));var util=require(_0xf7ba('0x1'));var path=require(_0xf7ba('0x2'));var timeout=require('connect-timeout');var express=require(_0xf7ba('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf7ba('0x4'));var interaction=require(_0xf7ba('0x5'));var config=require(_0xf7ba('0x6'));var controller=require(_0xf7ba('0x7'));router[_0xf7ba('0x8')]('/',auth['isAuthenticated'](),controller[_0xf7ba('0x9')]);router['get'](_0xf7ba('0xa'),auth[_0xf7ba('0xb')](),controller[_0xf7ba('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf7ba('0xd')]);router[_0xf7ba('0xe')](_0xf7ba('0xa'),auth['isAuthenticated'](),controller[_0xf7ba('0xf')]);router['delete'](_0xf7ba('0xa'),auth[_0xf7ba('0xb')](),controller[_0xf7ba('0x10')]);module[_0xf7ba('0x11')]=router; \ No newline at end of file +var _0xf40e=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer','util','path'];(function(_0x5d96ec,_0x25db83){var _0x2773b7=function(_0x9cba0b){while(--_0x9cba0b){_0x5d96ec['push'](_0x5d96ec['shift']());}};_0x2773b7(++_0x25db83);}(_0xf40e,0xd9));var _0xef40=function(_0x46c139,_0x173e07){_0x46c139=_0x46c139-0x0;var _0x2eed9b=_0xf40e[_0x46c139];return _0x2eed9b;};'use strict';var multer=require(_0xef40('0x0'));var util=require(_0xef40('0x1'));var path=require(_0xef40('0x2'));var timeout=require(_0xef40('0x3'));var express=require(_0xef40('0x4'));var router=express[_0xef40('0x5')]();var fs_extra=require(_0xef40('0x6'));var auth=require(_0xef40('0x7'));var interaction=require(_0xef40('0x8'));var config=require('../../config/environment');var controller=require(_0xef40('0x9'));router[_0xef40('0xa')]('/',auth[_0xef40('0xb')](),controller[_0xef40('0xc')]);router[_0xef40('0xa')](_0xef40('0xd'),auth['isAuthenticated'](),controller[_0xef40('0xe')]);router[_0xef40('0xf')]('/',auth[_0xef40('0xb')](),controller['create']);router[_0xef40('0x10')](_0xef40('0xd'),auth[_0xef40('0xb')](),controller['update']);router[_0xef40('0x11')](_0xef40('0xd'),auth[_0xef40('0xb')](),controller[_0xef40('0x12')]);module[_0xef40('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 1d433c5..f929494 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 _0x2729=['string','STRING','BOOLEAN','sequelize','exports','ENUM','customVariable','keyValue'];(function(_0x188bcd,_0x52f234){var _0x3c4e5b=function(_0x23dc8f){while(--_0x23dc8f){_0x188bcd['push'](_0x188bcd['shift']());}};_0x3c4e5b(++_0x52f234);}(_0x2729,0x163));var _0x9272=function(_0x18c479,_0x4c8b82){_0x18c479=_0x18c479-0x0;var _0x296ec3=_0x2729[_0x18c479];return _0x296ec3;};'use strict';var Sequelize=require(_0x9272('0x0'));module[_0x9272('0x1')]={'type':{'type':Sequelize[_0x9272('0x2')]('string','variable',_0x9272('0x3'),_0x9272('0x4'),'picklist'),'defaultValue':_0x9272('0x5')},'content':{'type':Sequelize[_0x9272('0x6')]},'key':{'type':Sequelize[_0x9272('0x6')]},'keyType':{'type':Sequelize['ENUM']('string','variable','customVariable')},'keyContent':{'type':Sequelize[_0x9272('0x6')]},'idField':{'type':Sequelize[_0x9272('0x6')]},'nameField':{'type':Sequelize[_0x9272('0x6')]},'customField':{'type':Sequelize[_0x9272('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9272('0x6')]}}; \ No newline at end of file +var _0xd0a7=['STRING','ENUM','variable','BOOLEAN','exports','string','customVariable','picklist'];(function(_0x415ccc,_0x54b3f0){var _0x2d6e42=function(_0x304794){while(--_0x304794){_0x415ccc['push'](_0x415ccc['shift']());}};_0x2d6e42(++_0x54b3f0);}(_0xd0a7,0x12c));var _0x7d0a=function(_0x10d684,_0x15bb6b){_0x10d684=_0x10d684-0x0;var _0x41e85b=_0xd0a7[_0x10d684];return _0x41e85b;};'use strict';var Sequelize=require('sequelize');module[_0x7d0a('0x0')]={'type':{'type':Sequelize['ENUM'](_0x7d0a('0x1'),'variable',_0x7d0a('0x2'),'keyValue',_0x7d0a('0x3')),'defaultValue':_0x7d0a('0x1')},'content':{'type':Sequelize[_0x7d0a('0x4')]},'key':{'type':Sequelize[_0x7d0a('0x4')]},'keyType':{'type':Sequelize[_0x7d0a('0x5')](_0x7d0a('0x1'),_0x7d0a('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x7d0a('0x4')]},'idField':{'type':Sequelize[_0x7d0a('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x7d0a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7d0a('0x4')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index fe1034e..693b66c 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 _0x4e81=['../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','end','error','stack','name','send','index','FreshdeskField','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','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'];(function(_0x3566f0,_0x653f45){var _0x16eb9c=function(_0x84063){while(--_0x84063){_0x3566f0['push'](_0x3566f0['shift']());}};_0x16eb9c(++_0x653f45);}(_0x4e81,0x1bc));var _0x14e8=function(_0xf0ec6e,_0xa183d3){_0xf0ec6e=_0xf0ec6e-0x0;var _0x8bbc27=_0x4e81[_0xf0ec6e];return _0x8bbc27;};'use strict';var emlformat=require(_0x14e8('0x0'));var rimraf=require(_0x14e8('0x1'));var zipdir=require(_0x14e8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x14e8('0x3'));var Mustache=require(_0x14e8('0x4'));var util=require(_0x14e8('0x5'));var path=require(_0x14e8('0x6'));var sox=require(_0x14e8('0x7'));var csv=require(_0x14e8('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x14e8('0x9'));var squel=require(_0x14e8('0xa'));var crypto=require(_0x14e8('0xb'));var jsforce=require(_0x14e8('0xc'));var deskjs=require(_0x14e8('0xd'));var toCsv=require(_0x14e8('0x8'));var querystring=require(_0x14e8('0xe'));var Papa=require(_0x14e8('0xf'));var Redis=require(_0x14e8('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x14e8('0x11'));var as=require(_0x14e8('0x12'));var hardwareService=require(_0x14e8('0x13'));var logger=require(_0x14e8('0x14'))(_0x14e8('0x15'));var utils=require(_0x14e8('0x16'));var config=require(_0x14e8('0x17'));var licenseUtil=require(_0x14e8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x37eccb,_0x59c6c9){_0x59c6c9=_0x59c6c9||0xcc;return function(_0x2607ef){if(_0x2607ef){return _0x37eccb[_0x14e8('0x19')](_0x59c6c9);}return _0x37eccb[_0x14e8('0x1a')](_0x59c6c9)['end']();};}function respondWithResult(_0x22fa86,_0x4e1064){_0x4e1064=_0x4e1064||0xc8;return function(_0x458e4a){if(_0x458e4a){return _0x22fa86['status'](_0x4e1064)[_0x14e8('0x1b')](_0x458e4a);}};}function respondWithFilteredResult(_0x3761a1,_0xc6101f){return function(_0x135996){if(_0x135996){var _0x52e64f=typeof _0xc6101f[_0x14e8('0x1c')]===_0x14e8('0x1d')&&typeof _0xc6101f[_0x14e8('0x1e')]===_0x14e8('0x1d');var _0xd4d6b2=_0x135996[_0x14e8('0x1f')];var _0x10dc8b=_0x52e64f?0x0:_0xc6101f[_0x14e8('0x1c')];var _0x5a38c1=_0x52e64f?_0x135996[_0x14e8('0x1f')]:_0xc6101f[_0x14e8('0x1c')]+_0xc6101f[_0x14e8('0x1e')];var _0x7b10f2;if(_0x5a38c1>=_0xd4d6b2){_0x5a38c1=_0xd4d6b2;_0x7b10f2=0xc8;}else{_0x7b10f2=0xce;}_0x3761a1[_0x14e8('0x1a')](_0x7b10f2);return _0x3761a1['set'](_0x14e8('0x20'),_0x10dc8b+'-'+_0x5a38c1+'/'+_0xd4d6b2)[_0x14e8('0x1b')](_0x135996);}return null;};}function patchUpdates(_0x2abfec){return function(_0x48e30a){try{jsonpatch[_0x14e8('0x21')](_0x48e30a,_0x2abfec,!![]);}catch(_0x47f060){return BPromise[_0x14e8('0x22')](_0x47f060);}return _0x48e30a[_0x14e8('0x23')]();};}function saveUpdates(_0x3e8d5c,_0x117b00){return function(_0xcf673){if(_0xcf673){return _0xcf673['update'](_0x3e8d5c)[_0x14e8('0x24')](function(_0x5b11f9){return _0x5b11f9;});}return null;};}function removeEntity(_0x31bdd3,_0x185a0e){return function(_0x4ffc8b){if(_0x4ffc8b){return _0x4ffc8b['destroy']()['then'](function(){_0x31bdd3[_0x14e8('0x1a')](0xcc)[_0x14e8('0x25')]();});}};}function handleEntityNotFound(_0x3eae0b,_0x20bfe8){return function(_0x333d44){if(!_0x333d44){_0x3eae0b['sendStatus'](0x194);}return _0x333d44;};}function handleError(_0x23a9dc,_0x3fd96d){_0x3fd96d=_0x3fd96d||0x1f4;return function(_0x3c09cb){logger[_0x14e8('0x26')](_0x3c09cb[_0x14e8('0x27')]);if(_0x3c09cb[_0x14e8('0x28')]){delete _0x3c09cb[_0x14e8('0x28')];}_0x23a9dc['status'](_0x3fd96d)[_0x14e8('0x29')](_0x3c09cb);};}exports[_0x14e8('0x2a')]=function(_0x393ab0,_0x5f5abb){var _0x48eed0={},_0x5cacd7={},_0x8fe0e2={'count':0x0,'rows':[]};var _0x2a408d=_['map'](db[_0x14e8('0x2b')][_0x14e8('0x2c')],function(_0x176e8f){return{'name':_0x176e8f[_0x14e8('0x2d')],'type':_0x176e8f['type'][_0x14e8('0x2e')]};});_0x5cacd7[_0x14e8('0x2f')]=_[_0x14e8('0x30')](_0x2a408d,_0x14e8('0x28'));_0x5cacd7[_0x14e8('0x31')]=_['keys'](_0x393ab0[_0x14e8('0x31')]);_0x5cacd7[_0x14e8('0x32')]=_[_0x14e8('0x33')](_0x5cacd7[_0x14e8('0x2f')],_0x5cacd7['query']);_0x48eed0[_0x14e8('0x34')]=_['intersection'](_0x5cacd7[_0x14e8('0x2f')],qs[_0x14e8('0x35')](_0x393ab0[_0x14e8('0x31')][_0x14e8('0x35')]));_0x48eed0[_0x14e8('0x34')]=_0x48eed0[_0x14e8('0x34')][_0x14e8('0x36')]?_0x48eed0[_0x14e8('0x34')]:_0x5cacd7[_0x14e8('0x2f')];if(!_0x393ab0[_0x14e8('0x31')][_0x14e8('0x37')](_0x14e8('0x38'))){_0x48eed0['limit']=qs['limit'](_0x393ab0['query'][_0x14e8('0x1e')]);_0x48eed0['offset']=qs[_0x14e8('0x1c')](_0x393ab0['query'][_0x14e8('0x1c')]);}_0x48eed0[_0x14e8('0x39')]=qs[_0x14e8('0x3a')](_0x393ab0[_0x14e8('0x31')]['sort']);_0x48eed0[_0x14e8('0x3b')]=qs['filters'](_[_0x14e8('0x3c')](_0x393ab0[_0x14e8('0x31')],_0x5cacd7[_0x14e8('0x32')]),_0x2a408d);if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x3d')]){_0x48eed0[_0x14e8('0x3b')]=_['merge'](_0x48eed0[_0x14e8('0x3b')],{'$or':_['map'](_0x2a408d,function(_0x30baf1){if(_0x30baf1[_0x14e8('0x3e')]!==_0x14e8('0x3f')){var _0x4cafe6={};_0x4cafe6[_0x30baf1[_0x14e8('0x28')]]={'$like':'%'+_0x393ab0[_0x14e8('0x31')]['filter']+'%'};return _0x4cafe6;}})});}_0x48eed0=_[_0x14e8('0x40')]({},_0x48eed0,_0x393ab0[_0x14e8('0x41')]);var _0x1f429a={'where':_0x48eed0[_0x14e8('0x3b')]};return db[_0x14e8('0x2b')][_0x14e8('0x1f')](_0x1f429a)[_0x14e8('0x24')](function(_0x38ec58){_0x8fe0e2[_0x14e8('0x1f')]=_0x38ec58;if(_0x393ab0[_0x14e8('0x31')][_0x14e8('0x42')]){_0x48eed0[_0x14e8('0x43')]=[{'all':!![]}];}return db[_0x14e8('0x2b')][_0x14e8('0x44')](_0x48eed0);})[_0x14e8('0x24')](function(_0x596ac7){_0x8fe0e2[_0x14e8('0x45')]=_0x596ac7;return _0x8fe0e2;})['then'](respondWithFilteredResult(_0x5f5abb,_0x48eed0))['catch'](handleError(_0x5f5abb,null));};exports['show']=function(_0x3d2d95,_0x5ed821){var _0x46a3c4={'raw':!![],'where':{'id':_0x3d2d95[_0x14e8('0x46')]['id']}},_0x45bff0={};_0x45bff0[_0x14e8('0x2f')]=_[_0x14e8('0x47')](db[_0x14e8('0x2b')][_0x14e8('0x2c')]);_0x45bff0[_0x14e8('0x31')]=_[_0x14e8('0x47')](_0x3d2d95[_0x14e8('0x31')]);_0x45bff0[_0x14e8('0x32')]=_['intersection'](_0x45bff0[_0x14e8('0x2f')],_0x45bff0[_0x14e8('0x31')]);_0x46a3c4[_0x14e8('0x34')]=_[_0x14e8('0x33')](_0x45bff0['model'],qs[_0x14e8('0x35')](_0x3d2d95[_0x14e8('0x31')]['fields']));_0x46a3c4['attributes']=_0x46a3c4[_0x14e8('0x34')]['length']?_0x46a3c4['attributes']:_0x45bff0[_0x14e8('0x2f')];if(_0x3d2d95[_0x14e8('0x31')]['includeAll']){_0x46a3c4[_0x14e8('0x43')]=[{'all':!![]}];}_0x46a3c4=_[_0x14e8('0x40')]({},_0x46a3c4,_0x3d2d95['options']);return db[_0x14e8('0x2b')][_0x14e8('0x48')](_0x46a3c4)[_0x14e8('0x24')](handleEntityNotFound(_0x5ed821,null))[_0x14e8('0x24')](respondWithResult(_0x5ed821,null))[_0x14e8('0x49')](handleError(_0x5ed821,null));};exports[_0x14e8('0x4a')]=function(_0x343529,_0x2541ad){return db[_0x14e8('0x2b')][_0x14e8('0x4a')](_0x343529[_0x14e8('0x4b')],{})[_0x14e8('0x24')](respondWithResult(_0x2541ad,0xc9))[_0x14e8('0x49')](handleError(_0x2541ad,null));};exports[_0x14e8('0x4c')]=function(_0x1bf742,_0x1f50bc){if(_0x1bf742['body']['id']){delete _0x1bf742[_0x14e8('0x4b')]['id'];}return db['FreshdeskField'][_0x14e8('0x48')]({'where':{'id':_0x1bf742[_0x14e8('0x46')]['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x1f50bc,null))[_0x14e8('0x24')](saveUpdates(_0x1bf742['body'],null))['then'](respondWithResult(_0x1f50bc,null))['catch'](handleError(_0x1f50bc,null));};exports[_0x14e8('0x4d')]=function(_0x49657e,_0x55f9b0){return db[_0x14e8('0x2b')][_0x14e8('0x48')]({'where':{'id':_0x49657e['params']['id']}})[_0x14e8('0x24')](handleEntityNotFound(_0x55f9b0,null))[_0x14e8('0x24')](removeEntity(_0x55f9b0,null))[_0x14e8('0x49')](handleError(_0x55f9b0,null));}; \ No newline at end of file +var _0xa0bc=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskField','findAll','rows','show','create','catch','body','find','params','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x235f63,_0x4e8ab5){var _0x3ef857=function(_0x1421db){while(--_0x1421db){_0x235f63['push'](_0x235f63['shift']());}};_0x3ef857(++_0x4e8ab5);}(_0xa0bc,0x1b6));var _0xca0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa0bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xca0b('0x0'));var zipdir=require(_0xca0b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca0b('0x2'));var moment=require(_0xca0b('0x3'));var BPromise=require(_0xca0b('0x4'));var Mustache=require(_0xca0b('0x5'));var util=require(_0xca0b('0x6'));var path=require(_0xca0b('0x7'));var sox=require(_0xca0b('0x8'));var csv=require(_0xca0b('0x9'));var ejs=require(_0xca0b('0xa'));var fs=require('fs');var fs_extra=require(_0xca0b('0xb'));var _=require(_0xca0b('0xc'));var squel=require(_0xca0b('0xd'));var crypto=require(_0xca0b('0xe'));var jsforce=require(_0xca0b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xca0b('0x9'));var querystring=require(_0xca0b('0x10'));var Papa=require(_0xca0b('0x11'));var Redis=require(_0xca0b('0x12'));var authService=require(_0xca0b('0x13'));var qs=require(_0xca0b('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xca0b('0x15'));var logger=require(_0xca0b('0x16'))(_0xca0b('0x17'));var utils=require(_0xca0b('0x18'));var config=require(_0xca0b('0x19'));var licenseUtil=require(_0xca0b('0x1a'));var db=require(_0xca0b('0x1b'))['db'];function respondWithStatusCode(_0x3a2e25,_0x22ca9d){_0x22ca9d=_0x22ca9d||0xcc;return function(_0x2ce366){if(_0x2ce366){return _0x3a2e25['sendStatus'](_0x22ca9d);}return _0x3a2e25[_0xca0b('0x1c')](_0x22ca9d)[_0xca0b('0x1d')]();};}function respondWithResult(_0x358972,_0x5da205){_0x5da205=_0x5da205||0xc8;return function(_0x106ed6){if(_0x106ed6){return _0x358972[_0xca0b('0x1c')](_0x5da205)[_0xca0b('0x1e')](_0x106ed6);}};}function respondWithFilteredResult(_0x2beba9,_0x42b68e){return function(_0x404c6d){if(_0x404c6d){var _0x4d7620=typeof _0x42b68e[_0xca0b('0x1f')]===_0xca0b('0x20')&&typeof _0x42b68e['limit']===_0xca0b('0x20');var _0x5db810=_0x404c6d[_0xca0b('0x21')];var _0x5050b7=_0x4d7620?0x0:_0x42b68e[_0xca0b('0x1f')];var _0x32eff7=_0x4d7620?_0x404c6d[_0xca0b('0x21')]:_0x42b68e['offset']+_0x42b68e[_0xca0b('0x22')];var _0x2c0c53;if(_0x32eff7>=_0x5db810){_0x32eff7=_0x5db810;_0x2c0c53=0xc8;}else{_0x2c0c53=0xce;}_0x2beba9['status'](_0x2c0c53);return _0x2beba9[_0xca0b('0x23')](_0xca0b('0x24'),_0x5050b7+'-'+_0x32eff7+'/'+_0x5db810)[_0xca0b('0x1e')](_0x404c6d);}return null;};}function patchUpdates(_0x59bda9){return function(_0x865393){try{jsonpatch[_0xca0b('0x25')](_0x865393,_0x59bda9,!![]);}catch(_0x484e26){return BPromise[_0xca0b('0x26')](_0x484e26);}return _0x865393[_0xca0b('0x27')]();};}function saveUpdates(_0x2ae93b,_0x49e695){return function(_0x119589){if(_0x119589){return _0x119589[_0xca0b('0x28')](_0x2ae93b)[_0xca0b('0x29')](function(_0x504d91){return _0x504d91;});}return null;};}function removeEntity(_0x54fb03,_0x11f5c3){return function(_0x428459){if(_0x428459){return _0x428459[_0xca0b('0x2a')]()[_0xca0b('0x29')](function(){_0x54fb03[_0xca0b('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe122e8,_0x10b5f3){return function(_0x131c0e){if(!_0x131c0e){_0xe122e8[_0xca0b('0x2b')](0x194);}return _0x131c0e;};}function handleError(_0x15478d,_0x48e172){_0x48e172=_0x48e172||0x1f4;return function(_0x4d2d1a){logger['error'](_0x4d2d1a[_0xca0b('0x2c')]);if(_0x4d2d1a[_0xca0b('0x2d')]){delete _0x4d2d1a[_0xca0b('0x2d')];}_0x15478d[_0xca0b('0x1c')](_0x48e172)[_0xca0b('0x2e')](_0x4d2d1a);};}exports['index']=function(_0x23af62,_0xbfcb5f){var _0x3b73ff={},_0x20f0d5={},_0x227cdc={'count':0x0,'rows':[]};var _0x449a3a=_[_0xca0b('0x2f')](db['FreshdeskField'][_0xca0b('0x30')],function(_0x17a365){return{'name':_0x17a365[_0xca0b('0x31')],'type':_0x17a365[_0xca0b('0x32')]['key']};});_0x20f0d5[_0xca0b('0x33')]=_[_0xca0b('0x2f')](_0x449a3a,_0xca0b('0x2d'));_0x20f0d5[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x23af62[_0xca0b('0x34')]);_0x20f0d5[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],_0x20f0d5[_0xca0b('0x34')]);_0x3b73ff[_0xca0b('0x38')]=_[_0xca0b('0x37')](_0x20f0d5[_0xca0b('0x33')],qs[_0xca0b('0x39')](_0x23af62[_0xca0b('0x34')]['fields']));_0x3b73ff[_0xca0b('0x38')]=_0x3b73ff[_0xca0b('0x38')][_0xca0b('0x3a')]?_0x3b73ff[_0xca0b('0x38')]:_0x20f0d5['model'];if(!_0x23af62[_0xca0b('0x34')][_0xca0b('0x3b')]('nolimit')){_0x3b73ff[_0xca0b('0x22')]=qs[_0xca0b('0x22')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x22')]);_0x3b73ff[_0xca0b('0x1f')]=qs[_0xca0b('0x1f')](_0x23af62[_0xca0b('0x34')][_0xca0b('0x1f')]);}_0x3b73ff['order']=qs['sort'](_0x23af62[_0xca0b('0x34')][_0xca0b('0x3c')]);_0x3b73ff[_0xca0b('0x3d')]=qs[_0xca0b('0x36')](_[_0xca0b('0x3e')](_0x23af62[_0xca0b('0x34')],_0x20f0d5[_0xca0b('0x36')]),_0x449a3a);if(_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]){_0x3b73ff[_0xca0b('0x3d')]=_[_0xca0b('0x40')](_0x3b73ff[_0xca0b('0x3d')],{'$or':_[_0xca0b('0x2f')](_0x449a3a,function(_0x236edc){if(_0x236edc[_0xca0b('0x32')]!==_0xca0b('0x41')){var _0xdce72f={};_0xdce72f[_0x236edc[_0xca0b('0x2d')]]={'$like':'%'+_0x23af62[_0xca0b('0x34')][_0xca0b('0x3f')]+'%'};return _0xdce72f;}})});}_0x3b73ff=_[_0xca0b('0x40')]({},_0x3b73ff,_0x23af62[_0xca0b('0x42')]);var _0x1757f0={'where':_0x3b73ff[_0xca0b('0x3d')]};return db[_0xca0b('0x43')]['count'](_0x1757f0)['then'](function(_0x1e62f5){_0x227cdc[_0xca0b('0x21')]=_0x1e62f5;if(_0x23af62['query']['includeAll']){_0x3b73ff['include']=[{'all':!![]}];}return db[_0xca0b('0x43')][_0xca0b('0x44')](_0x3b73ff);})[_0xca0b('0x29')](function(_0xf9e175){_0x227cdc[_0xca0b('0x45')]=_0xf9e175;return _0x227cdc;})['then'](respondWithFilteredResult(_0xbfcb5f,_0x3b73ff))['catch'](handleError(_0xbfcb5f,null));};exports[_0xca0b('0x46')]=function(_0x543bf8,_0x170d76){var _0x4eca5d={'raw':!![],'where':{'id':_0x543bf8['params']['id']}},_0x57bab3={};_0x57bab3[_0xca0b('0x33')]=_[_0xca0b('0x35')](db[_0xca0b('0x43')][_0xca0b('0x30')]);_0x57bab3[_0xca0b('0x34')]=_[_0xca0b('0x35')](_0x543bf8['query']);_0x57bab3[_0xca0b('0x36')]=_[_0xca0b('0x37')](_0x57bab3[_0xca0b('0x33')],_0x57bab3[_0xca0b('0x34')]);_0x4eca5d[_0xca0b('0x38')]=_['intersection'](_0x57bab3['model'],qs[_0xca0b('0x39')](_0x543bf8[_0xca0b('0x34')][_0xca0b('0x39')]));_0x4eca5d[_0xca0b('0x38')]=_0x4eca5d['attributes'][_0xca0b('0x3a')]?_0x4eca5d[_0xca0b('0x38')]:_0x57bab3[_0xca0b('0x33')];if(_0x543bf8[_0xca0b('0x34')]['includeAll']){_0x4eca5d['include']=[{'all':!![]}];}_0x4eca5d=_[_0xca0b('0x40')]({},_0x4eca5d,_0x543bf8[_0xca0b('0x42')]);return db[_0xca0b('0x43')]['find'](_0x4eca5d)[_0xca0b('0x29')](handleEntityNotFound(_0x170d76,null))[_0xca0b('0x29')](respondWithResult(_0x170d76,null))['catch'](handleError(_0x170d76,null));};exports['create']=function(_0x4f531c,_0x379a06){return db[_0xca0b('0x43')][_0xca0b('0x47')](_0x4f531c['body'],{})['then'](respondWithResult(_0x379a06,0xc9))[_0xca0b('0x48')](handleError(_0x379a06,null));};exports[_0xca0b('0x28')]=function(_0x250288,_0x174e81){if(_0x250288[_0xca0b('0x49')]['id']){delete _0x250288[_0xca0b('0x49')]['id'];}return db['FreshdeskField']['find']({'where':{'id':_0x250288['params']['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x174e81,null))[_0xca0b('0x29')](saveUpdates(_0x250288['body'],null))[_0xca0b('0x29')](respondWithResult(_0x174e81,null))[_0xca0b('0x48')](handleError(_0x174e81,null));};exports[_0xca0b('0x2a')]=function(_0x535cce,_0x251820){return db['FreshdeskField'][_0xca0b('0x4a')]({'where':{'id':_0x535cce[_0xca0b('0x4b')]['id']}})[_0xca0b('0x29')](handleEntityNotFound(_0x251820,null))[_0xca0b('0x29')](removeEntity(_0x251820,null))[_0xca0b('0x48')](handleError(_0x251820,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index dafe2e0..c792ee2 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 _0x0c2b=['lodash','util','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId'];(function(_0x56ed47,_0x29bda0){var _0x5a3502=function(_0x1a8302){while(--_0x1a8302){_0x56ed47['push'](_0x56ed47['shift']());}};_0x5a3502(++_0x29bda0);}(_0x0c2b,0x134));var _0xb0c2=function(_0x163fc8,_0x123ce2){_0x163fc8=_0x163fc8-0x0;var _0x46d393=_0x0c2b[_0x163fc8];return _0x46d393;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xb0c2('0x2'));var BPromise=require('bluebird');var rp=require(_0xb0c2('0x3'));var fs=require('fs');var path=require(_0xb0c2('0x4'));var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module['exports']=function(_0x514b10,_0x1f0b7e){return _0x514b10[_0xb0c2('0x8')](_0xb0c2('0x9'),attributes,{'tableName':_0xb0c2('0xa'),'paranoid':![],'indexes':[{'name':_0xb0c2('0xb'),'fields':[_0xb0c2('0xc'),_0xb0c2('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8cb4=['bluebird','request-promise','path','rimraf','../../config/environment','define','FreshdeskField','int_freshdesk_fields','FieldId','lodash','util','../../config/logger','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x8cb4,0xf3));var _0x48cb=function(_0x4ad21d,_0x3283b4){_0x4ad21d=_0x4ad21d-0x0;var _0x5b5ddf=_0x8cb4[_0x4ad21d];return _0x5b5ddf;};'use strict';var _=require(_0x48cb('0x0'));var util=require(_0x48cb('0x1'));var logger=require(_0x48cb('0x2'))('api');var moment=require(_0x48cb('0x3'));var BPromise=require(_0x48cb('0x4'));var rp=require(_0x48cb('0x5'));var fs=require('fs');var path=require(_0x48cb('0x6'));var rimraf=require(_0x48cb('0x7'));var config=require(_0x48cb('0x8'));var attributes=require('./intFreshdeskField.attributes');module['exports']=function(_0x5907b3,_0x2fd844){return _0x5907b3[_0x48cb('0x9')](_0x48cb('0xa'),attributes,{'tableName':_0x48cb('0xb'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':['idField',_0x48cb('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 a0622be..b1820ba 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 _0x6894=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','FreshdeskField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x4b03bd,_0x1021ba){var _0x19a0da=function(_0x14d226){while(--_0x14d226){_0x4b03bd['push'](_0x4b03bd['shift']());}};_0x19a0da(++_0x1021ba);}(_0x6894,0x1cb));var _0x4689=function(_0x2eb5bc,_0x4634c6){_0x2eb5bc=_0x2eb5bc-0x0;var _0x51c7b1=_0x6894[_0x2eb5bc];return _0x51c7b1;};'use strict';var _=require(_0x4689('0x0'));var util=require(_0x4689('0x1'));var moment=require(_0x4689('0x2'));var BPromise=require(_0x4689('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4689('0x4'));var db=require(_0x4689('0x5'))['db'];var utils=require(_0x4689('0x6'));var logger=require(_0x4689('0x7'))(_0x4689('0x8'));var config=require(_0x4689('0x9'));var jayson=require(_0x4689('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11512c,_0x2f0a71,_0xb623be){return new BPromise(function(_0x25ec3b,_0x4b218c){return client[_0x4689('0xb')](_0x11512c,_0xb623be)[_0x4689('0xc')](function(_0x4b4a8a){logger[_0x4689('0xd')](_0x4689('0xe'),_0x2f0a71,'request\x20sent');logger[_0x4689('0xf')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x2f0a71,_0x4689('0x10'),JSON[_0x4689('0x11')](_0x4b4a8a));if(_0x4b4a8a[_0x4689('0x12')]){if(_0x4b4a8a['error'][_0x4689('0x13')]===0x1f4){logger[_0x4689('0x12')](_0x4689('0xe'),_0x2f0a71,_0x4b4a8a[_0x4689('0x12')][_0x4689('0x14')]);return _0x4b218c(_0x4b4a8a[_0x4689('0x12')][_0x4689('0x14')]);}logger[_0x4689('0x12')](_0x4689('0xe'),_0x2f0a71,_0x4b4a8a[_0x4689('0x12')][_0x4689('0x14')]);return _0x25ec3b(_0x4b4a8a['error']['message']);}else{logger[_0x4689('0xd')](_0x4689('0xe'),_0x2f0a71,_0x4689('0x10'));_0x25ec3b(_0x4b4a8a[_0x4689('0x15')]['message']);}})[_0x4689('0x16')](function(_0x2efc52){logger[_0x4689('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x2f0a71,_0x2efc52);_0x4b218c(_0x2efc52);});});} \ No newline at end of file +var _0xfa7a=['FreshdeskField,\x20%s,\x20%s','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x1de641,_0x44d464){var _0xccacbc=function(_0x1ed9fb){while(--_0x1ed9fb){_0x1de641['push'](_0x1de641['shift']());}};_0xccacbc(++_0x44d464);}(_0xfa7a,0x10d));var _0xafa7=function(_0xccb38e,_0x326333){_0xccb38e=_0xccb38e-0x0;var _0x5d0a7e=_0xfa7a[_0xccb38e];return _0x5d0a7e;};'use strict';var _=require(_0xafa7('0x0'));var util=require('util');var moment=require(_0xafa7('0x1'));var BPromise=require('bluebird');var rs=require(_0xafa7('0x2'));var fs=require('fs');var Redis=require(_0xafa7('0x3'));var db=require(_0xafa7('0x4'))['db'];var utils=require(_0xafa7('0x5'));var logger=require(_0xafa7('0x6'))('rpc');var config=require(_0xafa7('0x7'));var jayson=require(_0xafa7('0x8'));var client=jayson['client'][_0xafa7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c03ad,_0x1a5323,_0x2e3423){return new BPromise(function(_0x814777,_0x52e44e){return client[_0xafa7('0xa')](_0x2c03ad,_0x2e3423)['then'](function(_0x379a4d){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x1a5323,_0xafa7('0xb'));logger[_0xafa7('0xc')](_0xafa7('0xd'),_0x1a5323,'request\x20sent',JSON['stringify'](_0x379a4d));if(_0x379a4d[_0xafa7('0xe')]){if(_0x379a4d['error'][_0xafa7('0xf')]===0x1f4){logger[_0xafa7('0xe')](_0xafa7('0x10'),_0x1a5323,_0x379a4d[_0xafa7('0xe')][_0xafa7('0x11')]);return _0x52e44e(_0x379a4d[_0xafa7('0xe')][_0xafa7('0x11')]);}logger[_0xafa7('0xe')](_0xafa7('0x10'),_0x1a5323,_0x379a4d[_0xafa7('0xe')][_0xafa7('0x11')]);return _0x814777(_0x379a4d[_0xafa7('0xe')][_0xafa7('0x11')]);}else{logger['info']('FreshdeskField,\x20%s,\x20%s',_0x1a5323,_0xafa7('0xb'));_0x814777(_0x379a4d['result'][_0xafa7('0x11')]);}})[_0xafa7('0x12')](function(_0x1e541a){logger[_0xafa7('0xe')](_0xafa7('0x10'),_0x1a5323,_0x1e541a);_0x52e44e(_0x1e541a);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index a1a5a01..cb433aa 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 _0x2e54=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','express'];(function(_0x440fd3,_0x37df98){var _0x201c71=function(_0x122e62){while(--_0x122e62){_0x440fd3['push'](_0x440fd3['shift']());}};_0x201c71(++_0x37df98);}(_0x2e54,0x1dd));var _0x42e5=function(_0x1e7429,_0x21d4da){_0x1e7429=_0x1e7429-0x0;var _0x24a2ab=_0x2e54[_0x1e7429];return _0x24a2ab;};'use strict';var multer=require(_0x42e5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x42e5('0x1'));var express=require(_0x42e5('0x2'));var router=express[_0x42e5('0x3')]();var fs_extra=require(_0x42e5('0x4'));var auth=require(_0x42e5('0x5'));var interaction=require(_0x42e5('0x6'));var config=require(_0x42e5('0x7'));var controller=require('./intFreshsalesAccount.controller');router[_0x42e5('0x8')]('/',auth[_0x42e5('0x9')](),controller[_0x42e5('0xa')]);router['get'](_0x42e5('0xb'),auth['isAuthenticated'](),controller[_0x42e5('0xc')]);router['get'](_0x42e5('0xd'),auth[_0x42e5('0x9')](),controller[_0x42e5('0xe')]);router[_0x42e5('0x8')](_0x42e5('0xf'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x10')]);router[_0x42e5('0x11')]('/',auth[_0x42e5('0x9')](),controller['create']);router[_0x42e5('0x11')](_0x42e5('0xd'),auth['isAuthenticated'](),controller[_0x42e5('0x12')]);router[_0x42e5('0x13')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x14')]);router[_0x42e5('0x15')](_0x42e5('0xb'),auth[_0x42e5('0x9')](),controller[_0x42e5('0x16')]);module[_0x42e5('0x17')]=router; \ No newline at end of file +var _0x0972=['create','addConfiguration','put','/:id','update','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x0972,0x64));var _0x2097=function(_0x3d886c,_0x35fcbe){_0x3d886c=_0x3d886c-0x0;var _0x3819a7=_0x0972[_0x3d886c];return _0x3819a7;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/:id',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['getConfigurations']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0xe')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0xe')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller[_0x2097('0x10')]);router[_0x2097('0x11')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x13')]);router[_0x2097('0x14')](_0x2097('0x12'),auth[_0x2097('0x8')](),controller[_0x2097('0x15')]);module[_0x2097('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 b1b5d01..a8c29ab 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 _0x6d11=['exports','STRING','sequelize'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x6d11,0xbf));var _0x16d1=function(_0x1012c1,_0x251951){_0x1012c1=_0x1012c1-0x0;var _0x580111=_0x6d11[_0x1012c1];return _0x580111;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'name':{'type':Sequelize[_0x16d1('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x16d1('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x16d1('0x2')]},'remoteUri':{'type':Sequelize[_0x16d1('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x4e2e=['username','remoteUri','exports','STRING'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x35496b,_0x976aee){_0x35496b=_0x35496b-0x0;var _0x567fd3=_0x4e2e[_0x35496b];return _0x567fd3;};'use strict';var Sequelize=require('sequelize');module[_0xe4e2('0x0')]={'name':{'type':Sequelize[_0xe4e2('0x1')]},'description':{'type':Sequelize[_0xe4e2('0x1')]},'username':{'type':Sequelize[_0xe4e2('0x1')],'unique':_0xe4e2('0x2')},'apiKey':{'type':Sequelize[_0xe4e2('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xe4e2('0x3')},'serverUrl':{'type':Sequelize[_0xe4e2('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 1adae35..61763e8 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 _0x7835=['jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','FreshsalesAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','options','includeAll','rows','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','FreshsalesField','getFields','remoteUri','apiKey','slice','substring','GET','format','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','test','statusCode','error','stringify','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel'];(function(_0x4df94b,_0x1169a5){var _0x3fb6b4=function(_0x3f7860){while(--_0x3f7860){_0x4df94b['push'](_0x4df94b['shift']());}};_0x3fb6b4(++_0x1169a5);}(_0x7835,0x1f0));var _0x5783=function(_0x5e13c6,_0xfbd9b7){_0x5e13c6=_0x5e13c6-0x0;var _0x31bd11=_0x7835[_0x5e13c6];return _0x31bd11;};'use strict';var emlformat=require(_0x5783('0x0'));var rimraf=require(_0x5783('0x1'));var zipdir=require(_0x5783('0x2'));var jsonpatch=require(_0x5783('0x3'));var rp=require(_0x5783('0x4'));var moment=require(_0x5783('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5783('0x6'));var util=require(_0x5783('0x7'));var path=require(_0x5783('0x8'));var sox=require(_0x5783('0x9'));var csv=require(_0x5783('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5783('0xb'));var _=require(_0x5783('0xc'));var squel=require(_0x5783('0xd'));var crypto=require('crypto');var jsforce=require(_0x5783('0xe'));var deskjs=require(_0x5783('0xf'));var toCsv=require(_0x5783('0xa'));var querystring=require(_0x5783('0x10'));var Papa=require(_0x5783('0x11'));var Redis=require(_0x5783('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5783('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5783('0x14'))(_0x5783('0x15'));var utils=require(_0x5783('0x16'));var config=require(_0x5783('0x17'));var licenseUtil=require(_0x5783('0x18'));var db=require(_0x5783('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x507560,_0x395e55){_0x395e55=_0x395e55||0xcc;return function(_0x4ce05a){if(_0x4ce05a){return _0x507560[_0x5783('0x1a')](_0x395e55);}return _0x507560[_0x5783('0x1b')](_0x395e55)[_0x5783('0x1c')]();};}function respondWithResult(_0x3acb45,_0x1595da){_0x1595da=_0x1595da||0xc8;return function(_0x1ec4d9){if(_0x1ec4d9){return _0x3acb45['status'](_0x1595da)[_0x5783('0x1d')](_0x1ec4d9);}};}function respondWithFilteredResult(_0x53a8f1,_0x2d422d){return function(_0x3c9a5b){if(_0x3c9a5b){var _0x480567=typeof _0x2d422d['offset']===_0x5783('0x1e')&&typeof _0x2d422d[_0x5783('0x1f')]===_0x5783('0x1e');var _0xf069b2=_0x3c9a5b[_0x5783('0x20')];var _0x2f6319=_0x480567?0x0:_0x2d422d['offset'];var _0x5dca8d=_0x480567?_0x3c9a5b[_0x5783('0x20')]:_0x2d422d[_0x5783('0x21')]+_0x2d422d[_0x5783('0x1f')];var _0x2c5e90;if(_0x5dca8d>=_0xf069b2){_0x5dca8d=_0xf069b2;_0x2c5e90=0xc8;}else{_0x2c5e90=0xce;}_0x53a8f1['status'](_0x2c5e90);return _0x53a8f1[_0x5783('0x22')]('Content-Range',_0x2f6319+'-'+_0x5dca8d+'/'+_0xf069b2)[_0x5783('0x1d')](_0x3c9a5b);}return null;};}function patchUpdates(_0x501486){return function(_0x41ea71){try{jsonpatch[_0x5783('0x23')](_0x41ea71,_0x501486,!![]);}catch(_0x63e8dd){return BPromise[_0x5783('0x24')](_0x63e8dd);}return _0x41ea71[_0x5783('0x25')]();};}function saveUpdates(_0x42d113,_0x31c575){return function(_0x58f54e){if(_0x58f54e){return _0x58f54e[_0x5783('0x26')](_0x42d113)[_0x5783('0x27')](function(_0x3fbec6){return _0x3fbec6;});}return null;};}function removeEntity(_0x4aa17a,_0xbc9ba3){return function(_0x25dd4a){if(_0x25dd4a){return _0x25dd4a[_0x5783('0x28')]()[_0x5783('0x27')](function(){_0x4aa17a[_0x5783('0x1b')](0xcc)[_0x5783('0x1c')]();});}};}function handleEntityNotFound(_0x5e6355,_0x538701){return function(_0x384c69){if(!_0x384c69){_0x5e6355['sendStatus'](0x194);}return _0x384c69;};}function handleError(_0x4f74cf,_0x27c7e6){_0x27c7e6=_0x27c7e6||0x1f4;return function(_0x3a8d94){logger['error'](_0x3a8d94[_0x5783('0x29')]);if(_0x3a8d94[_0x5783('0x2a')]){delete _0x3a8d94[_0x5783('0x2a')];}_0x4f74cf['status'](_0x27c7e6)[_0x5783('0x2b')](_0x3a8d94);};}exports['index']=function(_0x15a172,_0x1952c9){var _0x6da829={},_0x381c3c={},_0x40c91d={'count':0x0,'rows':[]};var _0x33815c=_['map'](db[_0x5783('0x2c')]['rawAttributes'],function(_0xb4b502){return{'name':_0xb4b502[_0x5783('0x2d')],'type':_0xb4b502[_0x5783('0x2e')][_0x5783('0x2f')]};});_0x381c3c[_0x5783('0x30')]=_['map'](_0x33815c,_0x5783('0x2a'));_0x381c3c[_0x5783('0x31')]=_[_0x5783('0x32')](_0x15a172['query']);_0x381c3c[_0x5783('0x33')]=_['intersection'](_0x381c3c[_0x5783('0x30')],_0x381c3c[_0x5783('0x31')]);_0x6da829[_0x5783('0x34')]=_[_0x5783('0x35')](_0x381c3c[_0x5783('0x30')],qs[_0x5783('0x36')](_0x15a172[_0x5783('0x31')][_0x5783('0x36')]));_0x6da829[_0x5783('0x34')]=_0x6da829['attributes'][_0x5783('0x37')]?_0x6da829[_0x5783('0x34')]:_0x381c3c[_0x5783('0x30')];if(!_0x15a172[_0x5783('0x31')][_0x5783('0x38')](_0x5783('0x39'))){_0x6da829[_0x5783('0x1f')]=qs[_0x5783('0x1f')](_0x15a172[_0x5783('0x31')][_0x5783('0x1f')]);_0x6da829['offset']=qs[_0x5783('0x21')](_0x15a172[_0x5783('0x31')][_0x5783('0x21')]);}_0x6da829[_0x5783('0x3a')]=qs[_0x5783('0x3b')](_0x15a172[_0x5783('0x31')][_0x5783('0x3b')]);_0x6da829[_0x5783('0x3c')]=qs[_0x5783('0x33')](_[_0x5783('0x3d')](_0x15a172[_0x5783('0x31')],_0x381c3c[_0x5783('0x33')]),_0x33815c);if(_0x15a172[_0x5783('0x31')]['filter']){_0x6da829[_0x5783('0x3c')]=_[_0x5783('0x3e')](_0x6da829['where'],{'$or':_[_0x5783('0x3f')](_0x33815c,function(_0x5c9c5e){if(_0x5c9c5e[_0x5783('0x2e')]!==_0x5783('0x40')){var _0x409a68={};_0x409a68[_0x5c9c5e[_0x5783('0x2a')]]={'$like':'%'+_0x15a172['query'][_0x5783('0x41')]+'%'};return _0x409a68;}})});}_0x6da829=_[_0x5783('0x3e')]({},_0x6da829,_0x15a172[_0x5783('0x42')]);var _0x1fc106={'where':_0x6da829['where']};return db['FreshsalesAccount'][_0x5783('0x20')](_0x1fc106)[_0x5783('0x27')](function(_0x3b5bb6){_0x40c91d[_0x5783('0x20')]=_0x3b5bb6;if(_0x15a172[_0x5783('0x31')][_0x5783('0x43')]){_0x6da829['include']=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x6da829);})[_0x5783('0x27')](function(_0x4b2f8b){_0x40c91d[_0x5783('0x44')]=_0x4b2f8b;return _0x40c91d;})['then'](respondWithFilteredResult(_0x1952c9,_0x6da829))[_0x5783('0x45')](handleError(_0x1952c9,null));};exports[_0x5783('0x46')]=function(_0xefaddc,_0x101e85){var _0x33f3af={'raw':![],'where':{'id':_0xefaddc[_0x5783('0x47')]['id']}},_0x1e70bd={};_0x1e70bd[_0x5783('0x30')]=_['keys'](db['FreshsalesAccount'][_0x5783('0x48')]);_0x1e70bd[_0x5783('0x31')]=_['keys'](_0xefaddc[_0x5783('0x31')]);_0x1e70bd[_0x5783('0x33')]=_[_0x5783('0x35')](_0x1e70bd['model'],_0x1e70bd['query']);_0x33f3af['attributes']=_[_0x5783('0x35')](_0x1e70bd[_0x5783('0x30')],qs['fields'](_0xefaddc[_0x5783('0x31')]['fields']));_0x33f3af['attributes']=_0x33f3af[_0x5783('0x34')][_0x5783('0x37')]?_0x33f3af['attributes']:_0x1e70bd[_0x5783('0x30')];if(_0xefaddc[_0x5783('0x31')][_0x5783('0x43')]){_0x33f3af['include']=[{'all':!![]}];}_0x33f3af=_['merge']({},_0x33f3af,_0xefaddc[_0x5783('0x42')]);return db[_0x5783('0x2c')][_0x5783('0x49')](_0x33f3af)['then'](handleEntityNotFound(_0x101e85,null))[_0x5783('0x27')](respondWithResult(_0x101e85,null))[_0x5783('0x45')](handleError(_0x101e85,null));};exports[_0x5783('0x4a')]=function(_0x38477f,_0x4f5588){return db[_0x5783('0x2c')]['create'](_0x38477f[_0x5783('0x4b')],{})['then'](respondWithResult(_0x4f5588,0xc9))[_0x5783('0x45')](handleError(_0x4f5588,null));};exports[_0x5783('0x26')]=function(_0x2941ac,_0xbef3f){if(_0x2941ac[_0x5783('0x4b')]['id']){delete _0x2941ac[_0x5783('0x4b')]['id'];}return db[_0x5783('0x2c')][_0x5783('0x49')]({'where':{'id':_0x2941ac[_0x5783('0x47')]['id']}})['then'](handleEntityNotFound(_0xbef3f,null))['then'](saveUpdates(_0x2941ac[_0x5783('0x4b')],null))[_0x5783('0x27')](respondWithResult(_0xbef3f,null))['catch'](handleError(_0xbef3f,null));};exports['destroy']=function(_0x2e1a54,_0x1f864d){return db[_0x5783('0x2c')][_0x5783('0x49')]({'where':{'id':_0x2e1a54[_0x5783('0x47')]['id']}})[_0x5783('0x27')](handleEntityNotFound(_0x1f864d,null))['then'](removeEntity(_0x1f864d,null))[_0x5783('0x45')](handleError(_0x1f864d,null));};exports[_0x5783('0x4c')]=function(_0x46b0c8,_0x1ca8ea,_0x209698){var _0x472530={};var _0x1cc047={};var _0x24bf67;var _0x499745;return db[_0x5783('0x2c')][_0x5783('0x4d')]({'where':{'id':_0x46b0c8[_0x5783('0x47')]['id']}})['then'](handleEntityNotFound(_0x1ca8ea,null))['then'](function(_0x5f32ba){if(_0x5f32ba){_0x24bf67=_0x5f32ba;_0x1cc047[_0x5783('0x30')]=_['keys'](db[_0x5783('0x4e')][_0x5783('0x48')]);_0x1cc047['query']=_[_0x5783('0x32')](_0x46b0c8[_0x5783('0x31')]);_0x1cc047['filters']=_[_0x5783('0x35')](_0x1cc047[_0x5783('0x30')],_0x1cc047[_0x5783('0x31')]);_0x472530[_0x5783('0x34')]=_[_0x5783('0x35')](_0x1cc047[_0x5783('0x30')],qs[_0x5783('0x36')](_0x46b0c8[_0x5783('0x31')][_0x5783('0x36')]));_0x472530[_0x5783('0x34')]=_0x472530[_0x5783('0x34')]['length']?_0x472530[_0x5783('0x34')]:_0x1cc047[_0x5783('0x30')];_0x472530[_0x5783('0x3a')]=qs[_0x5783('0x3b')](_0x46b0c8[_0x5783('0x31')][_0x5783('0x3b')]);_0x472530[_0x5783('0x3c')]=qs['filters'](_[_0x5783('0x3d')](_0x46b0c8['query'],_0x1cc047[_0x5783('0x33')]));if(_0x46b0c8['query']['filter']){_0x472530['where']=_[_0x5783('0x3e')](_0x472530[_0x5783('0x3c')],{'$or':_['map'](_0x472530[_0x5783('0x34')],function(_0x5f1810){var _0x551fec={};_0x551fec[_0x5f1810]={'$like':'%'+_0x46b0c8[_0x5783('0x31')][_0x5783('0x41')]+'%'};return _0x551fec;})});}_0x472530=_[_0x5783('0x3e')]({},_0x472530,_0x46b0c8[_0x5783('0x42')]);return _0x24bf67[_0x5783('0x4c')](_0x472530);}})[_0x5783('0x27')](function(_0x50429d){if(_0x50429d){_0x499745=_0x50429d[_0x5783('0x37')];if(!_0x46b0c8[_0x5783('0x31')][_0x5783('0x38')]('nolimit')){_0x472530['limit']=qs[_0x5783('0x1f')](_0x46b0c8['query']['limit']);_0x472530[_0x5783('0x21')]=qs[_0x5783('0x21')](_0x46b0c8['query'][_0x5783('0x21')]);}return _0x24bf67[_0x5783('0x4c')](_0x472530);}})[_0x5783('0x27')](function(_0x650a6a){if(_0x650a6a){return _0x650a6a?{'count':_0x499745,'rows':_0x650a6a}:null;}})[_0x5783('0x27')](respondWithResult(_0x1ca8ea,null))['catch'](handleError(_0x1ca8ea,null));};exports[_0x5783('0x4f')]=function(_0xa2da15,_0x2fb20f,_0x5cf5ce){if(_0xa2da15[_0x5783('0x4b')]['id']){delete _0xa2da15[_0x5783('0x4b')]['id'];}return db['FreshsalesAccount']['findOne']({'where':{'id':_0xa2da15[_0x5783('0x47')]['id']}})[_0x5783('0x27')](handleEntityNotFound(_0x2fb20f,null))[_0x5783('0x27')](function(_0x49e80a){if(_0x49e80a){_0xa2da15[_0x5783('0x4b')][_0x5783('0x50')]=_0x49e80a['id'];_0xa2da15[_0x5783('0x4b')][_0x5783('0x51')]=integrations[_0x5783('0x52')](_0xa2da15[_0x5783('0x4b')][_0x5783('0x53')],_0xa2da15[_0x5783('0x4b')][_0x5783('0x2e')]);_0xa2da15[_0x5783('0x4b')][_0x5783('0x54')]=integrations['getDescriptions'](_0xa2da15[_0x5783('0x4b')][_0x5783('0x53')],_0xa2da15['body'][_0x5783('0x2e')]);return db['FreshsalesConfiguration'][_0x5783('0x4a')](_0xa2da15['body'],{'include':[{'model':db['FreshsalesField'],'as':_0x5783('0x51')},{'model':db[_0x5783('0x55')],'as':_0x5783('0x54')}]});}return null;})['then'](respondWithResult(_0x2fb20f,null))[_0x5783('0x45')](handleError(_0x2fb20f,null));};exports[_0x5783('0x56')]=function(_0x3256af,_0x68807,_0x460214){var _0x953939='';var _0x3075ca='';return db[_0x5783('0x2c')][_0x5783('0x4d')]({'where':{'id':_0x3256af['params']['id']},'attributes':['id','username',_0x5783('0x57'),_0x5783('0x58')]})[_0x5783('0x27')](handleEntityNotFound(_0x68807,null))[_0x5783('0x27')](function(_0x6a7100){if(_0x6a7100){_0x3075ca=_0x6a7100['username'];_0x953939=_0x6a7100['remoteUri'];var _0x4fdb5f=_0x6a7100[_0x5783('0x57')][_0x5783('0x59')](-0x1);if(_0x4fdb5f==='/'){_0x953939=_0x953939[_0x5783('0x5a')](0x0,_0x953939['lastIndexOf'](_0x4fdb5f));}return rp({'method':_0x5783('0x5b'),'uri':util[_0x5783('0x5c')]('%s%s',_0x953939,_0x5783('0x5d')),'headers':{'Authorization':_0x5783('0x5e')+_0x6a7100[_0x5783('0x58')]},'json':!![]});}})[_0x5783('0x27')](function(_0x1464ed){if(_0x1464ed){var _0x3a25e9=_0x1464ed['users'];var _0x5e9226=![];var _0x396d2c=null;for(_0x396d2c=0x0;_0x396d2c<_0x3a25e9[_0x5783('0x37')];_0x396d2c++){if(_0x3a25e9[_0x396d2c][_0x5783('0x5f')]===_0x3075ca){_0x5e9226=!![];}}if(_0x5e9226){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x5783('0x60')});}}})['then'](respondWithResult(_0x68807,null))[_0x5783('0x45')](function(_0x4b22fe){var _0x1c6a9b=_0x3256af[_0x5783('0x31')][_0x5783('0x61')]?0x1f4:_0x4b22fe[_0x5783('0x62')]||0x1f4;logger[_0x5783('0x63')]('getFields,\x20%s,\x20%s,\x20%s',_0x5783('0x56'),_0x1c6a9b,JSON[_0x5783('0x64')](_0x4b22fe));delete _0x4b22fe['name'];if(_0x1c6a9b===0x191){_0x1c6a9b=0x190;}_0x68807[_0x5783('0x1b')](_0x1c6a9b)[_0x5783('0x2b')](_0x3256af[_0x5783('0x31')][_0x5783('0x61')]?{'message':_0x5783('0x65'),'statusCode':_0x4b22fe[_0x5783('0x62')]}:_0x4b22fe);});}; \ No newline at end of file +var _0x3fff=['remoteUri','apiKey','slice','substring','lastIndexOf','%s%s','Token\x20token=','users','email','Requested\x20Resource\x20not\x20Found','Wrong\x20credentials','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','map','FreshsalesAccount','fieldName','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','keys','rawAttributes','length','find','create','body','update','getConfigurations','findOne','FreshsalesConfiguration','pick','addConfiguration','AccountId','Subjects','channel','type','Descriptions','FreshsalesField','getFields','username'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3fff,0x134));var _0xf3ff=function(_0x288615,_0x4f46d0){_0x288615=_0x288615-0x0;var _0x50991d=_0x3fff[_0x288615];return _0x50991d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf3ff('0x0'));var zipdir=require(_0xf3ff('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3ff('0x2'));var moment=require(_0xf3ff('0x3'));var BPromise=require(_0xf3ff('0x4'));var Mustache=require('mustache');var util=require(_0xf3ff('0x5'));var path=require(_0xf3ff('0x6'));var sox=require(_0xf3ff('0x7'));var csv=require(_0xf3ff('0x8'));var ejs=require(_0xf3ff('0x9'));var fs=require('fs');var fs_extra=require(_0xf3ff('0xa'));var _=require('lodash');var squel=require(_0xf3ff('0xb'));var crypto=require(_0xf3ff('0xc'));var jsforce=require(_0xf3ff('0xd'));var deskjs=require(_0xf3ff('0xe'));var toCsv=require(_0xf3ff('0x8'));var querystring=require(_0xf3ff('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf3ff('0x10'));var qs=require(_0xf3ff('0x11'));var as=require(_0xf3ff('0x12'));var hardwareService=require(_0xf3ff('0x13'));var logger=require(_0xf3ff('0x14'))(_0xf3ff('0x15'));var utils=require(_0xf3ff('0x16'));var config=require(_0xf3ff('0x17'));var licenseUtil=require(_0xf3ff('0x18'));var db=require(_0xf3ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x3bf035,_0x3f4671){_0x3f4671=_0x3f4671||0xcc;return function(_0x5eece5){if(_0x5eece5){return _0x3bf035[_0xf3ff('0x1a')](_0x3f4671);}return _0x3bf035[_0xf3ff('0x1b')](_0x3f4671)[_0xf3ff('0x1c')]();};}function respondWithResult(_0x1ca145,_0x1a182a){_0x1a182a=_0x1a182a||0xc8;return function(_0x4e3eea){if(_0x4e3eea){return _0x1ca145[_0xf3ff('0x1b')](_0x1a182a)[_0xf3ff('0x1d')](_0x4e3eea);}};}function respondWithFilteredResult(_0x1c41f0,_0xa5de54){return function(_0x35bfcc){if(_0x35bfcc){var _0x152f37=typeof _0xa5de54[_0xf3ff('0x1e')]===_0xf3ff('0x1f')&&typeof _0xa5de54[_0xf3ff('0x20')]===_0xf3ff('0x1f');var _0x3a156a=_0x35bfcc['count'];var _0x43d0e1=_0x152f37?0x0:_0xa5de54[_0xf3ff('0x1e')];var _0x33783c=_0x152f37?_0x35bfcc[_0xf3ff('0x21')]:_0xa5de54[_0xf3ff('0x1e')]+_0xa5de54['limit'];var _0xe8b838;if(_0x33783c>=_0x3a156a){_0x33783c=_0x3a156a;_0xe8b838=0xc8;}else{_0xe8b838=0xce;}_0x1c41f0[_0xf3ff('0x1b')](_0xe8b838);return _0x1c41f0[_0xf3ff('0x22')](_0xf3ff('0x23'),_0x43d0e1+'-'+_0x33783c+'/'+_0x3a156a)[_0xf3ff('0x1d')](_0x35bfcc);}return null;};}function patchUpdates(_0x49e31c){return function(_0x30f1d9){try{jsonpatch[_0xf3ff('0x24')](_0x30f1d9,_0x49e31c,!![]);}catch(_0x1ffcbf){return BPromise[_0xf3ff('0x25')](_0x1ffcbf);}return _0x30f1d9[_0xf3ff('0x26')]();};}function saveUpdates(_0x4c7f77,_0x5e2705){return function(_0x1925db){if(_0x1925db){return _0x1925db['update'](_0x4c7f77)[_0xf3ff('0x27')](function(_0x4791e9){return _0x4791e9;});}return null;};}function removeEntity(_0x5a2844,_0x452ad7){return function(_0x18a672){if(_0x18a672){return _0x18a672[_0xf3ff('0x28')]()['then'](function(){_0x5a2844[_0xf3ff('0x1b')](0xcc)[_0xf3ff('0x1c')]();});}};}function handleEntityNotFound(_0x32a291,_0x3923c8){return function(_0x3ac759){if(!_0x3ac759){_0x32a291['sendStatus'](0x194);}return _0x3ac759;};}function handleError(_0x4c7120,_0x12a2d4){_0x12a2d4=_0x12a2d4||0x1f4;return function(_0x5988f0){logger[_0xf3ff('0x29')](_0x5988f0[_0xf3ff('0x2a')]);if(_0x5988f0[_0xf3ff('0x2b')]){delete _0x5988f0[_0xf3ff('0x2b')];}_0x4c7120['status'](_0x12a2d4)[_0xf3ff('0x2c')](_0x5988f0);};}exports['index']=function(_0xfeaaa3,_0x1b34b6){var _0x26ce22={},_0x2033a4={},_0x3e45cd={'count':0x0,'rows':[]};var _0x1b1145=_[_0xf3ff('0x2d')](db[_0xf3ff('0x2e')]['rawAttributes'],function(_0x2db892){return{'name':_0x2db892[_0xf3ff('0x2f')],'type':_0x2db892['type']['key']};});_0x2033a4[_0xf3ff('0x30')]=_[_0xf3ff('0x2d')](_0x1b1145,'name');_0x2033a4[_0xf3ff('0x31')]=_['keys'](_0xfeaaa3[_0xf3ff('0x31')]);_0x2033a4[_0xf3ff('0x32')]=_['intersection'](_0x2033a4['model'],_0x2033a4[_0xf3ff('0x31')]);_0x26ce22[_0xf3ff('0x33')]=_[_0xf3ff('0x34')](_0x2033a4['model'],qs[_0xf3ff('0x35')](_0xfeaaa3[_0xf3ff('0x31')]['fields']));_0x26ce22[_0xf3ff('0x33')]=_0x26ce22[_0xf3ff('0x33')]['length']?_0x26ce22[_0xf3ff('0x33')]:_0x2033a4['model'];if(!_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x36')](_0xf3ff('0x37'))){_0x26ce22[_0xf3ff('0x20')]=qs[_0xf3ff('0x20')](_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x20')]);_0x26ce22[_0xf3ff('0x1e')]=qs[_0xf3ff('0x1e')](_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x1e')]);}_0x26ce22[_0xf3ff('0x38')]=qs[_0xf3ff('0x39')](_0xfeaaa3[_0xf3ff('0x31')]['sort']);_0x26ce22[_0xf3ff('0x3a')]=qs[_0xf3ff('0x32')](_['pick'](_0xfeaaa3[_0xf3ff('0x31')],_0x2033a4[_0xf3ff('0x32')]),_0x1b1145);if(_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x3b')]){_0x26ce22[_0xf3ff('0x3a')]=_[_0xf3ff('0x3c')](_0x26ce22[_0xf3ff('0x3a')],{'$or':_[_0xf3ff('0x2d')](_0x1b1145,function(_0x500a6c){if(_0x500a6c['type']!==_0xf3ff('0x3d')){var _0x417b7d={};_0x417b7d[_0x500a6c[_0xf3ff('0x2b')]]={'$like':'%'+_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x3b')]+'%'};return _0x417b7d;}})});}_0x26ce22=_[_0xf3ff('0x3c')]({},_0x26ce22,_0xfeaaa3[_0xf3ff('0x3e')]);var _0x43dc95={'where':_0x26ce22[_0xf3ff('0x3a')]};return db[_0xf3ff('0x2e')]['count'](_0x43dc95)[_0xf3ff('0x27')](function(_0x3bd1a9){_0x3e45cd[_0xf3ff('0x21')]=_0x3bd1a9;if(_0xfeaaa3[_0xf3ff('0x31')][_0xf3ff('0x3f')]){_0x26ce22[_0xf3ff('0x40')]=[{'all':!![]}];}return db[_0xf3ff('0x2e')]['findAll'](_0x26ce22);})[_0xf3ff('0x27')](function(_0x281e2b){_0x3e45cd[_0xf3ff('0x41')]=_0x281e2b;return _0x3e45cd;})[_0xf3ff('0x27')](respondWithFilteredResult(_0x1b34b6,_0x26ce22))[_0xf3ff('0x42')](handleError(_0x1b34b6,null));};exports['show']=function(_0x5ed87e,_0x478270){var _0x47f95b={'raw':![],'where':{'id':_0x5ed87e[_0xf3ff('0x43')]['id']}},_0x1ccfda={};_0x1ccfda[_0xf3ff('0x30')]=_[_0xf3ff('0x44')](db[_0xf3ff('0x2e')][_0xf3ff('0x45')]);_0x1ccfda[_0xf3ff('0x31')]=_[_0xf3ff('0x44')](_0x5ed87e[_0xf3ff('0x31')]);_0x1ccfda[_0xf3ff('0x32')]=_[_0xf3ff('0x34')](_0x1ccfda[_0xf3ff('0x30')],_0x1ccfda[_0xf3ff('0x31')]);_0x47f95b[_0xf3ff('0x33')]=_[_0xf3ff('0x34')](_0x1ccfda[_0xf3ff('0x30')],qs[_0xf3ff('0x35')](_0x5ed87e[_0xf3ff('0x31')][_0xf3ff('0x35')]));_0x47f95b[_0xf3ff('0x33')]=_0x47f95b[_0xf3ff('0x33')][_0xf3ff('0x46')]?_0x47f95b[_0xf3ff('0x33')]:_0x1ccfda[_0xf3ff('0x30')];if(_0x5ed87e[_0xf3ff('0x31')][_0xf3ff('0x3f')]){_0x47f95b['include']=[{'all':!![]}];}_0x47f95b=_['merge']({},_0x47f95b,_0x5ed87e['options']);return db[_0xf3ff('0x2e')][_0xf3ff('0x47')](_0x47f95b)['then'](handleEntityNotFound(_0x478270,null))[_0xf3ff('0x27')](respondWithResult(_0x478270,null))[_0xf3ff('0x42')](handleError(_0x478270,null));};exports[_0xf3ff('0x48')]=function(_0x5120bc,_0x69a764){return db[_0xf3ff('0x2e')]['create'](_0x5120bc[_0xf3ff('0x49')],{})[_0xf3ff('0x27')](respondWithResult(_0x69a764,0xc9))[_0xf3ff('0x42')](handleError(_0x69a764,null));};exports[_0xf3ff('0x4a')]=function(_0x14207,_0xfc538d){if(_0x14207[_0xf3ff('0x49')]['id']){delete _0x14207[_0xf3ff('0x49')]['id'];}return db['FreshsalesAccount'][_0xf3ff('0x47')]({'where':{'id':_0x14207[_0xf3ff('0x43')]['id']}})[_0xf3ff('0x27')](handleEntityNotFound(_0xfc538d,null))[_0xf3ff('0x27')](saveUpdates(_0x14207[_0xf3ff('0x49')],null))[_0xf3ff('0x27')](respondWithResult(_0xfc538d,null))[_0xf3ff('0x42')](handleError(_0xfc538d,null));};exports[_0xf3ff('0x28')]=function(_0x55d452,_0x47dbbb){return db[_0xf3ff('0x2e')][_0xf3ff('0x47')]({'where':{'id':_0x55d452[_0xf3ff('0x43')]['id']}})[_0xf3ff('0x27')](handleEntityNotFound(_0x47dbbb,null))[_0xf3ff('0x27')](removeEntity(_0x47dbbb,null))[_0xf3ff('0x42')](handleError(_0x47dbbb,null));};exports[_0xf3ff('0x4b')]=function(_0x379c0a,_0xb86dd2,_0x415bc6){var _0x4d95dd={};var _0x4ae7bb={};var _0x424663;var _0x324325;return db['FreshsalesAccount'][_0xf3ff('0x4c')]({'where':{'id':_0x379c0a[_0xf3ff('0x43')]['id']}})[_0xf3ff('0x27')](handleEntityNotFound(_0xb86dd2,null))[_0xf3ff('0x27')](function(_0x1164e){if(_0x1164e){_0x424663=_0x1164e;_0x4ae7bb['model']=_[_0xf3ff('0x44')](db[_0xf3ff('0x4d')][_0xf3ff('0x45')]);_0x4ae7bb['query']=_[_0xf3ff('0x44')](_0x379c0a[_0xf3ff('0x31')]);_0x4ae7bb['filters']=_[_0xf3ff('0x34')](_0x4ae7bb[_0xf3ff('0x30')],_0x4ae7bb[_0xf3ff('0x31')]);_0x4d95dd[_0xf3ff('0x33')]=_[_0xf3ff('0x34')](_0x4ae7bb[_0xf3ff('0x30')],qs['fields'](_0x379c0a['query'][_0xf3ff('0x35')]));_0x4d95dd[_0xf3ff('0x33')]=_0x4d95dd[_0xf3ff('0x33')][_0xf3ff('0x46')]?_0x4d95dd[_0xf3ff('0x33')]:_0x4ae7bb[_0xf3ff('0x30')];_0x4d95dd[_0xf3ff('0x38')]=qs[_0xf3ff('0x39')](_0x379c0a['query'][_0xf3ff('0x39')]);_0x4d95dd[_0xf3ff('0x3a')]=qs[_0xf3ff('0x32')](_[_0xf3ff('0x4e')](_0x379c0a[_0xf3ff('0x31')],_0x4ae7bb[_0xf3ff('0x32')]));if(_0x379c0a[_0xf3ff('0x31')]['filter']){_0x4d95dd[_0xf3ff('0x3a')]=_[_0xf3ff('0x3c')](_0x4d95dd[_0xf3ff('0x3a')],{'$or':_[_0xf3ff('0x2d')](_0x4d95dd[_0xf3ff('0x33')],function(_0x13f892){var _0x130443={};_0x130443[_0x13f892]={'$like':'%'+_0x379c0a[_0xf3ff('0x31')][_0xf3ff('0x3b')]+'%'};return _0x130443;})});}_0x4d95dd=_[_0xf3ff('0x3c')]({},_0x4d95dd,_0x379c0a[_0xf3ff('0x3e')]);return _0x424663[_0xf3ff('0x4b')](_0x4d95dd);}})[_0xf3ff('0x27')](function(_0x107ef0){if(_0x107ef0){_0x324325=_0x107ef0[_0xf3ff('0x46')];if(!_0x379c0a[_0xf3ff('0x31')]['hasOwnProperty'](_0xf3ff('0x37'))){_0x4d95dd[_0xf3ff('0x20')]=qs[_0xf3ff('0x20')](_0x379c0a[_0xf3ff('0x31')][_0xf3ff('0x20')]);_0x4d95dd[_0xf3ff('0x1e')]=qs[_0xf3ff('0x1e')](_0x379c0a[_0xf3ff('0x31')][_0xf3ff('0x1e')]);}return _0x424663[_0xf3ff('0x4b')](_0x4d95dd);}})[_0xf3ff('0x27')](function(_0x4c5c6b){if(_0x4c5c6b){return _0x4c5c6b?{'count':_0x324325,'rows':_0x4c5c6b}:null;}})[_0xf3ff('0x27')](respondWithResult(_0xb86dd2,null))[_0xf3ff('0x42')](handleError(_0xb86dd2,null));};exports[_0xf3ff('0x4f')]=function(_0x14b15d,_0x44a36c,_0x541ec8){if(_0x14b15d[_0xf3ff('0x49')]['id']){delete _0x14b15d[_0xf3ff('0x49')]['id'];}return db[_0xf3ff('0x2e')][_0xf3ff('0x4c')]({'where':{'id':_0x14b15d[_0xf3ff('0x43')]['id']}})[_0xf3ff('0x27')](handleEntityNotFound(_0x44a36c,null))[_0xf3ff('0x27')](function(_0x6d85b2){if(_0x6d85b2){_0x14b15d[_0xf3ff('0x49')][_0xf3ff('0x50')]=_0x6d85b2['id'];_0x14b15d[_0xf3ff('0x49')][_0xf3ff('0x51')]=integrations['getSubjects'](_0x14b15d[_0xf3ff('0x49')][_0xf3ff('0x52')],_0x14b15d['body'][_0xf3ff('0x53')]);_0x14b15d['body'][_0xf3ff('0x54')]=integrations['getDescriptions'](_0x14b15d['body'][_0xf3ff('0x52')],_0x14b15d[_0xf3ff('0x49')][_0xf3ff('0x53')]);return db[_0xf3ff('0x4d')][_0xf3ff('0x48')](_0x14b15d[_0xf3ff('0x49')],{'include':[{'model':db['FreshsalesField'],'as':_0xf3ff('0x51')},{'model':db[_0xf3ff('0x55')],'as':_0xf3ff('0x54')}]});}return null;})[_0xf3ff('0x27')](respondWithResult(_0x44a36c,null))[_0xf3ff('0x42')](handleError(_0x44a36c,null));};exports[_0xf3ff('0x56')]=function(_0x4da247,_0x5bf2ed,_0x384e60){var _0x14e8d9='';var _0x5d5251='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x4da247[_0xf3ff('0x43')]['id']},'attributes':['id',_0xf3ff('0x57'),_0xf3ff('0x58'),_0xf3ff('0x59')]})[_0xf3ff('0x27')](handleEntityNotFound(_0x5bf2ed,null))[_0xf3ff('0x27')](function(_0x3a7b18){if(_0x3a7b18){_0x5d5251=_0x3a7b18[_0xf3ff('0x57')];_0x14e8d9=_0x3a7b18['remoteUri'];var _0x50a699=_0x3a7b18[_0xf3ff('0x58')][_0xf3ff('0x5a')](-0x1);if(_0x50a699==='/'){_0x14e8d9=_0x14e8d9[_0xf3ff('0x5b')](0x0,_0x14e8d9[_0xf3ff('0x5c')](_0x50a699));}return rp({'method':'GET','uri':util['format'](_0xf3ff('0x5d'),_0x14e8d9,'/api/selector/owners'),'headers':{'Authorization':_0xf3ff('0x5e')+_0x3a7b18[_0xf3ff('0x59')]},'json':!![]});}})['then'](function(_0x438771){if(_0x438771){var _0x1dae5f=_0x438771[_0xf3ff('0x5f')];var _0x218838=![];var _0x5339c2=null;for(_0x5339c2=0x0;_0x5339c2<_0x1dae5f[_0xf3ff('0x46')];_0x5339c2++){if(_0x1dae5f[_0x5339c2][_0xf3ff('0x60')]===_0x5d5251){_0x218838=!![];}}if(_0x218838){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf3ff('0x61')});}}})[_0xf3ff('0x27')](respondWithResult(_0x5bf2ed,null))['catch'](function(_0x581597){var _0x1c3980=_0x4da247[_0xf3ff('0x31')]['test']?0x1f4:_0x581597['statusCode']||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xf3ff('0x56'),_0x1c3980,JSON['stringify'](_0x581597));delete _0x581597[_0xf3ff('0x2b')];if(_0x1c3980===0x191){_0x1c3980=0x190;}_0x5bf2ed[_0xf3ff('0x1b')](_0x1c3980)['send'](_0x4da247[_0xf3ff('0x31')]['test']?{'message':_0xf3ff('0x62'),'statusCode':_0x581597['statusCode']}:_0x581597);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 321a05c..7e0c6a9 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 _0x687b=['./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','int_freshsales_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x5c8551,_0x1452ec){var _0x4c3c81=function(_0x1f058f){while(--_0x1f058f){_0x5c8551['push'](_0x5c8551['shift']());}};_0x4c3c81(++_0x1452ec);}(_0x687b,0x14a));var _0xb687=function(_0xb46ba,_0x2e2cc1){_0xb46ba=_0xb46ba-0x0;var _0x3b76a8=_0x687b[_0xb46ba];return _0x3b76a8;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('FreshsalesAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82c4=['define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intFreshsalesAccount.attributes','exports'];(function(_0x5e2a26,_0x52d4bc){var _0x3760a3=function(_0x49bbbf){while(--_0x49bbbf){_0x5e2a26['push'](_0x5e2a26['shift']());}};_0x3760a3(++_0x52d4bc);}(_0x82c4,0x1ca));var _0x482c=function(_0x450eae,_0x2ad04d){_0x450eae=_0x450eae-0x0;var _0x2379d3=_0x82c4[_0x450eae];return _0x2379d3;};'use strict';var _=require(_0x482c('0x0'));var util=require(_0x482c('0x1'));var logger=require(_0x482c('0x2'))(_0x482c('0x3'));var moment=require(_0x482c('0x4'));var BPromise=require(_0x482c('0x5'));var rp=require(_0x482c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x482c('0x7'));var config=require('../../config/environment');var attributes=require(_0x482c('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x482c('0x9')]=function(_0x5d7c76,_0xfdb92){return _0x5d7c76[_0x482c('0xa')](_0x482c('0xb'),attributes,{'tableName':_0x482c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 5e23078..f9feca7 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 _0x8aad=['stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','limit','include','map','model','attributes','then','ShowFreshsalesAccount','find','raw','lodash','util','bluebird','ioredis','../../mysqldb','rpc','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x6dfbaa,_0x31eede){var _0xfbe02=function(_0x4adcaf){while(--_0x4adcaf){_0x6dfbaa['push'](_0x6dfbaa['shift']());}};_0xfbe02(++_0x31eede);}(_0x8aad,0x146));var _0xd8aa=function(_0x1a6478,_0x2968f2){_0x1a6478=_0x1a6478-0x0;var _0x1fef17=_0x8aad[_0x1a6478];return _0x1fef17;};'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']('FreshsalesAccount,\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);});});}exports[_0xd8aa('0x14')]=function(_0x32e2cd){var _0x3a29ca=this;return new Promise(function(_0x2d34ac,_0x4953be){return db[_0xd8aa('0x15')][_0xd8aa('0x16')]({'raw':_0x32e2cd[_0xd8aa('0x17')]?_0x32e2cd[_0xd8aa('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x32e2cd[_0xd8aa('0x17')]?_0x32e2cd[_0xd8aa('0x17')][_0xd8aa('0x18')]||null:null,'attributes':_0x32e2cd[_0xd8aa('0x17')]?_0x32e2cd[_0xd8aa('0x17')]['attributes']||null:null,'limit':_0x32e2cd[_0xd8aa('0x17')]?_0x32e2cd[_0xd8aa('0x17')][_0xd8aa('0x19')]||null:null,'include':_0x32e2cd['options']?_0x32e2cd[_0xd8aa('0x17')][_0xd8aa('0x1a')]?_[_0xd8aa('0x1b')](_0x32e2cd[_0xd8aa('0x17')][_0xd8aa('0x1a')],function(_0x16758a){return{'model':db[_0x16758a[_0xd8aa('0x1c')]],'as':_0x16758a['as'],'attributes':_0x16758a[_0xd8aa('0x1d')],'include':_0x16758a[_0xd8aa('0x1a')]?_[_0xd8aa('0x1b')](_0x16758a[_0xd8aa('0x1a')],function(_0x370d6f){return{'model':db[_0x370d6f[_0xd8aa('0x1c')]],'as':_0x370d6f['as'],'attributes':_0x370d6f['attributes'],'include':_0x370d6f[_0xd8aa('0x1a')]?_[_0xd8aa('0x1b')](_0x370d6f[_0xd8aa('0x1a')],function(_0x1f6ab2){return{'model':db[_0x1f6ab2[_0xd8aa('0x1c')]],'as':_0x1f6ab2['as'],'attributes':_0x1f6ab2[_0xd8aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd8aa('0x1e')](function(_0x19edee){logger[_0xd8aa('0x9')](_0xd8aa('0x14'),_0x32e2cd);logger['debug'](_0xd8aa('0x14'),_0x32e2cd,JSON[_0xd8aa('0xe')](_0x19edee));_0x2d34ac(_0x19edee);})[_0xd8aa('0x13')](function(_0x49a7c8){logger[_0xd8aa('0xf')]('GetFreshsalesAccount',_0x49a7c8[_0xd8aa('0x11')],_0x32e2cd);_0x4953be(_0x3a29ca[_0xd8aa('0xf')](0x1f4,_0x49a7c8[_0xd8aa('0x11')]));});});};exports[_0xd8aa('0x1f')]=function(_0x44f783){var _0x28f3cc=this;return new Promise(function(_0xd8d3b3,_0x3cbe8d){return db['FreshsalesAccount'][_0xd8aa('0x20')]({'raw':_0x44f783[_0xd8aa('0x17')]?_0x44f783[_0xd8aa('0x17')][_0xd8aa('0x21')]===undefined?!![]:![]:!![],'where':_0x44f783[_0xd8aa('0x17')]?_0x44f783[_0xd8aa('0x17')][_0xd8aa('0x18')]||null:null,'attributes':_0x44f783[_0xd8aa('0x17')]?_0x44f783['options'][_0xd8aa('0x1d')]||null:null,'include':_0x44f783[_0xd8aa('0x17')]?_0x44f783[_0xd8aa('0x17')]['include']?_[_0xd8aa('0x1b')](_0x44f783[_0xd8aa('0x17')][_0xd8aa('0x1a')],function(_0x45c216){return{'model':db[_0x45c216[_0xd8aa('0x1c')]],'as':_0x45c216['as'],'attributes':_0x45c216[_0xd8aa('0x1d')],'include':_0x45c216[_0xd8aa('0x1a')]?_[_0xd8aa('0x1b')](_0x45c216[_0xd8aa('0x1a')],function(_0x47a3b2){return{'model':db[_0x47a3b2[_0xd8aa('0x1c')]],'as':_0x47a3b2['as'],'attributes':_0x47a3b2[_0xd8aa('0x1d')],'include':_0x47a3b2[_0xd8aa('0x1a')]?_[_0xd8aa('0x1b')](_0x47a3b2[_0xd8aa('0x1a')],function(_0x1b1469){return{'model':db[_0x1b1469[_0xd8aa('0x1c')]],'as':_0x1b1469['as'],'attributes':_0x1b1469[_0xd8aa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd8aa('0x1e')](function(_0x5983f6){logger[_0xd8aa('0x9')]('ShowFreshsalesAccount',_0x44f783);logger[_0xd8aa('0xc')](_0xd8aa('0x1f'),_0x44f783,JSON['stringify'](_0x5983f6));_0xd8d3b3(_0x5983f6);})[_0xd8aa('0x13')](function(_0x1a4f2c){logger[_0xd8aa('0xf')](_0xd8aa('0x1f'),_0x1a4f2c[_0xd8aa('0x11')],_0x44f783);_0x3cbe8d(_0x28f3cc['error'](0x1f4,_0x1a4f2c['message']));});});}; \ No newline at end of file +var _0xa46e=['model','attributes','GetFreshsalesAccount','ShowFreshsalesAccount','find','where','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','request','then','request\x20sent','debug','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','info','result','catch','FreshsalesAccount','findAll','options','raw','include','map'];(function(_0x25ffdb,_0x3cb5b8){var _0xe9c6f0=function(_0x39a146){while(--_0x39a146){_0x25ffdb['push'](_0x25ffdb['shift']());}};_0xe9c6f0(++_0x3cb5b8);}(_0xa46e,0x8a));var _0xea46=function(_0xbc2974,_0xec3342){_0xbc2974=_0xbc2974-0x0;var _0x3a5b4f=_0xa46e[_0xbc2974];return _0x3a5b4f;};'use strict';var _=require(_0xea46('0x0'));var util=require(_0xea46('0x1'));var moment=require('moment');var BPromise=require(_0xea46('0x2'));var rs=require(_0xea46('0x3'));var fs=require('fs');var Redis=require(_0xea46('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xea46('0x5'));var logger=require('../../config/logger')(_0xea46('0x6'));var config=require('../../config/environment');var jayson=require(_0xea46('0x7'));var client=jayson['client'][_0xea46('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc26f,_0x5f1cd1,_0x2d1b30){return new BPromise(function(_0x42771a,_0xe7d428){return client[_0xea46('0x9')](_0x3dc26f,_0x2d1b30)[_0xea46('0xa')](function(_0x4cf206){logger['info']('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'));logger[_0xea46('0xc')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x5f1cd1,_0xea46('0xb'),JSON[_0xea46('0xd')](_0x4cf206));if(_0x4cf206[_0xea46('0xe')]){if(_0x4cf206['error'][_0xea46('0xf')]===0x1f4){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0xe7d428(_0x4cf206['error'][_0xea46('0x10')]);}logger['error'](_0xea46('0x11'),_0x5f1cd1,_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);return _0x42771a(_0x4cf206[_0xea46('0xe')][_0xea46('0x10')]);}else{logger[_0xea46('0x12')](_0xea46('0x11'),_0x5f1cd1,_0xea46('0xb'));_0x42771a(_0x4cf206[_0xea46('0x13')]['message']);}})[_0xea46('0x14')](function(_0xbf225e){logger[_0xea46('0xe')]('FreshsalesAccount,\x20%s,\x20%s',_0x5f1cd1,_0xbf225e);_0xe7d428(_0xbf225e);});});}exports['GetFreshsalesAccount']=function(_0x19d5c1){var _0x3f463d=this;return new Promise(function(_0x5cf5dd,_0x4b6745){return db[_0xea46('0x15')][_0xea46('0x16')]({'raw':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1[_0xea46('0x17')]['where']||null:null,'attributes':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['attributes']||null:null,'limit':_0x19d5c1[_0xea46('0x17')]?_0x19d5c1['options']['limit']||null:null,'include':_0x19d5c1['options']?_0x19d5c1[_0xea46('0x17')][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x19d5c1['options'][_0xea46('0x19')],function(_0x59b10d){return{'model':db[_0x59b10d[_0xea46('0x1b')]],'as':_0x59b10d['as'],'attributes':_0x59b10d[_0xea46('0x1c')],'include':_0x59b10d['include']?_[_0xea46('0x1a')](_0x59b10d['include'],function(_0x2b3a8f){return{'model':db[_0x2b3a8f[_0xea46('0x1b')]],'as':_0x2b3a8f['as'],'attributes':_0x2b3a8f[_0xea46('0x1c')],'include':_0x2b3a8f['include']?_['map'](_0x2b3a8f[_0xea46('0x19')],function(_0x38ac07){return{'model':db[_0x38ac07['model']],'as':_0x38ac07['as'],'attributes':_0x38ac07[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x11129d){logger['info'](_0xea46('0x1d'),_0x19d5c1);logger[_0xea46('0xc')](_0xea46('0x1d'),_0x19d5c1,JSON[_0xea46('0xd')](_0x11129d));_0x5cf5dd(_0x11129d);})[_0xea46('0x14')](function(_0x174345){logger['error'](_0xea46('0x1d'),_0x174345[_0xea46('0x10')],_0x19d5c1);_0x4b6745(_0x3f463d[_0xea46('0xe')](0x1f4,_0x174345['message']));});});};exports[_0xea46('0x1e')]=function(_0x3cdf96){var _0x38d631=this;return new Promise(function(_0x5a0fc0,_0x4a0635){return db['FreshsalesAccount'][_0xea46('0x1f')]({'raw':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x18')]===undefined?!![]:![]:!![],'where':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x20')]||null:null,'attributes':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96[_0xea46('0x17')][_0xea46('0x1c')]||null:null,'include':_0x3cdf96[_0xea46('0x17')]?_0x3cdf96['options'][_0xea46('0x19')]?_[_0xea46('0x1a')](_0x3cdf96[_0xea46('0x17')][_0xea46('0x19')],function(_0x1472c0){return{'model':db[_0x1472c0[_0xea46('0x1b')]],'as':_0x1472c0['as'],'attributes':_0x1472c0[_0xea46('0x1c')],'include':_0x1472c0['include']?_[_0xea46('0x1a')](_0x1472c0[_0xea46('0x19')],function(_0x388449){return{'model':db[_0x388449[_0xea46('0x1b')]],'as':_0x388449['as'],'attributes':_0x388449[_0xea46('0x1c')],'include':_0x388449['include']?_['map'](_0x388449[_0xea46('0x19')],function(_0x343499){return{'model':db[_0x343499['model']],'as':_0x343499['as'],'attributes':_0x343499[_0xea46('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea46('0xa')](function(_0x123aae){logger[_0xea46('0x12')]('ShowFreshsalesAccount',_0x3cdf96);logger['debug'](_0xea46('0x1e'),_0x3cdf96,JSON['stringify'](_0x123aae));_0x5a0fc0(_0x123aae);})[_0xea46('0x14')](function(_0xdec374){logger['error'](_0xea46('0x1e'),_0xdec374[_0xea46('0x10')],_0x3cdf96);_0x4a0635(_0x38d631['error'](0x1f4,_0xdec374[_0xea46('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index b1d5a05..3e0a997 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 _0x7a64=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x2d69e1,_0x43f881){var _0x9b5140=function(_0x374b86){while(--_0x374b86){_0x2d69e1['push'](_0x2d69e1['shift']());}};_0x9b5140(++_0x43f881);}(_0x7a64,0x153));var _0x47a6=function(_0x9bf561,_0x534291){_0x9bf561=_0x9bf561-0x0;var _0x4c492c=_0x7a64[_0x9bf561];return _0x4c492c;};'use strict';var multer=require(_0x47a6('0x0'));var util=require('util');var path=require(_0x47a6('0x1'));var timeout=require('connect-timeout');var express=require(_0x47a6('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x47a6('0x3'));var interaction=require(_0x47a6('0x4'));var config=require(_0x47a6('0x5'));var controller=require(_0x47a6('0x6'));router['get']('/',auth[_0x47a6('0x7')](),controller['index']);router[_0x47a6('0x8')](_0x47a6('0x9'),auth['isAuthenticated'](),controller[_0x47a6('0xa')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0x47a6('0x8')]('/:id/descriptions',auth[_0x47a6('0x7')](),controller['getDescriptions']);router['get']('/:id/fields',auth[_0x47a6('0x7')](),controller['getFields']);router[_0x47a6('0xb')]('/',auth['isAuthenticated'](),controller[_0x47a6('0xc')]);router[_0x47a6('0xd')](_0x47a6('0x9'),auth[_0x47a6('0x7')](),controller[_0x47a6('0xe')]);router[_0x47a6('0xf')]('/:id',auth[_0x47a6('0x7')](),controller[_0x47a6('0x10')]);module[_0x47a6('0x11')]=router; \ No newline at end of file +var _0x0553=['destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','/:id/fields','getFields','create','put','update','delete'];(function(_0x4a4322,_0x5495eb){var _0x5210ff=function(_0x1ce2e0){while(--_0x1ce2e0){_0x4a4322['push'](_0x4a4322['shift']());}};_0x5210ff(++_0x5495eb);}(_0x0553,0x1b7));var _0x3055=function(_0x68c4d9,_0x419b3c){_0x68c4d9=_0x68c4d9-0x0;var _0x62da93=_0x0553[_0x68c4d9];return _0x62da93;};'use strict';var multer=require(_0x3055('0x0'));var util=require('util');var path=require(_0x3055('0x1'));var timeout=require(_0x3055('0x2'));var express=require(_0x3055('0x3'));var router=express['Router']();var fs_extra=require(_0x3055('0x4'));var auth=require(_0x3055('0x5'));var interaction=require(_0x3055('0x6'));var config=require(_0x3055('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0x3055('0x8')](),controller['index']);router[_0x3055('0x9')](_0x3055('0xa'),auth[_0x3055('0x8')](),controller[_0x3055('0xb')]);router['get'](_0x3055('0xc'),auth[_0x3055('0x8')](),controller[_0x3055('0xd')]);router[_0x3055('0x9')](_0x3055('0xe'),auth[_0x3055('0x8')](),controller['getDescriptions']);router[_0x3055('0x9')](_0x3055('0xf'),auth[_0x3055('0x8')](),controller[_0x3055('0x10')]);router['post']('/',auth[_0x3055('0x8')](),controller[_0x3055('0x11')]);router[_0x3055('0x12')]('/:id',auth[_0x3055('0x8')](),controller[_0x3055('0x13')]);router[_0x3055('0x14')](_0x3055('0xa'),auth['isAuthenticated'](),controller[_0x3055('0x15')]);module[_0x3055('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 04805cd..ef29453 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 _0x6b66=['STRING','sequelize'];(function(_0x3d647c,_0x1741dd){var _0x7d1af8=function(_0x4ac6c8){while(--_0x4ac6c8){_0x3d647c['push'](_0x3d647c['shift']());}};_0x7d1af8(++_0x1741dd);}(_0x6b66,0x13f));var _0x66b6=function(_0xdcd2f4,_0x38e5c3){_0xdcd2f4=_0xdcd2f4-0x0;var _0x55a05d=_0x6b66[_0xdcd2f4];return _0x55a05d;};'use strict';var Sequelize=require(_0x66b6('0x0'));module['exports']={'name':{'type':Sequelize[_0x66b6('0x1')]},'description':{'type':Sequelize[_0x66b6('0x1')]}}; \ No newline at end of file +var _0xfce0=['sequelize','exports','STRING'];(function(_0x35f17c,_0x232dcc){var _0x14f76b=function(_0x529c54){while(--_0x529c54){_0x35f17c['push'](_0x35f17c['shift']());}};_0x14f76b(++_0x232dcc);}(_0xfce0,0x102));var _0x0fce=function(_0x2587cb,_0x3fdfec){_0x2587cb=_0x2587cb-0x0;var _0x1f2523=_0xfce0[_0x2587cb];return _0x1f2523;};'use strict';var Sequelize=require(_0x0fce('0x0'));module[_0x0fce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0fce('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 8803612..a0af812 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 _0xafd1=['reject','update','then','destroy','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','FreshsalesConfiguration','includeAll','include','findAll','rows','params','find','create','catch','body','getSubjects','findOne','FreshsalesField','order','pick','getDescriptions','hasOwnProperty','getFields','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0xb24a3e,_0x4a3594){var _0x4038d7=function(_0x1ea3c3){while(--_0x1ea3c3){_0xb24a3e['push'](_0xb24a3e['shift']());}};_0x4038d7(++_0x4a3594);}(_0xafd1,0x1c2));var _0x1afd=function(_0x488ca1,_0xf6858e){_0x488ca1=_0x488ca1-0x0;var _0x4dd0a4=_0xafd1[_0x488ca1];return _0x4dd0a4;};'use strict';var emlformat=require(_0x1afd('0x0'));var rimraf=require(_0x1afd('0x1'));var zipdir=require(_0x1afd('0x2'));var jsonpatch=require(_0x1afd('0x3'));var rp=require(_0x1afd('0x4'));var moment=require(_0x1afd('0x5'));var BPromise=require(_0x1afd('0x6'));var Mustache=require(_0x1afd('0x7'));var util=require('util');var path=require(_0x1afd('0x8'));var sox=require(_0x1afd('0x9'));var csv=require(_0x1afd('0xa'));var ejs=require(_0x1afd('0xb'));var fs=require('fs');var fs_extra=require(_0x1afd('0xc'));var _=require('lodash');var squel=require(_0x1afd('0xd'));var crypto=require('crypto');var jsforce=require(_0x1afd('0xe'));var deskjs=require(_0x1afd('0xf'));var toCsv=require(_0x1afd('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1afd('0x10'));var authService=require(_0x1afd('0x11'));var qs=require(_0x1afd('0x12'));var as=require(_0x1afd('0x13'));var hardwareService=require(_0x1afd('0x14'));var logger=require(_0x1afd('0x15'))(_0x1afd('0x16'));var utils=require(_0x1afd('0x17'));var config=require(_0x1afd('0x18'));var licenseUtil=require(_0x1afd('0x19'));var db=require(_0x1afd('0x1a'))['db'];function respondWithStatusCode(_0x228431,_0x43e224){_0x43e224=_0x43e224||0xcc;return function(_0x58ff79){if(_0x58ff79){return _0x228431['sendStatus'](_0x43e224);}return _0x228431[_0x1afd('0x1b')](_0x43e224)['end']();};}function respondWithResult(_0x6dff39,_0x2c3258){_0x2c3258=_0x2c3258||0xc8;return function(_0x4f0d72){if(_0x4f0d72){return _0x6dff39['status'](_0x2c3258)['json'](_0x4f0d72);}};}function respondWithFilteredResult(_0x377bf3,_0xad745b){return function(_0x41dff2){if(_0x41dff2){var _0x87fbd=typeof _0xad745b[_0x1afd('0x1c')]===_0x1afd('0x1d')&&typeof _0xad745b[_0x1afd('0x1e')]==='undefined';var _0x253e36=_0x41dff2[_0x1afd('0x1f')];var _0x5c3613=_0x87fbd?0x0:_0xad745b[_0x1afd('0x1c')];var _0x42df1a=_0x87fbd?_0x41dff2[_0x1afd('0x1f')]:_0xad745b[_0x1afd('0x1c')]+_0xad745b['limit'];var _0xcd4a3e;if(_0x42df1a>=_0x253e36){_0x42df1a=_0x253e36;_0xcd4a3e=0xc8;}else{_0xcd4a3e=0xce;}_0x377bf3[_0x1afd('0x1b')](_0xcd4a3e);return _0x377bf3[_0x1afd('0x20')](_0x1afd('0x21'),_0x5c3613+'-'+_0x42df1a+'/'+_0x253e36)[_0x1afd('0x22')](_0x41dff2);}return null;};}function patchUpdates(_0x1bac3c){return function(_0x28f48a){try{jsonpatch[_0x1afd('0x23')](_0x28f48a,_0x1bac3c,!![]);}catch(_0xa23cf9){return BPromise[_0x1afd('0x24')](_0xa23cf9);}return _0x28f48a['save']();};}function saveUpdates(_0x298c8c,_0x20e1f6){return function(_0x3f4cf3){if(_0x3f4cf3){return _0x3f4cf3[_0x1afd('0x25')](_0x298c8c)[_0x1afd('0x26')](function(_0x47a88a){return _0x47a88a;});}return null;};}function removeEntity(_0x461adb,_0x1c44a0){return function(_0x3d2733){if(_0x3d2733){return _0x3d2733[_0x1afd('0x27')]()[_0x1afd('0x26')](function(){_0x461adb[_0x1afd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x392664,_0x1210b5){return function(_0x3cadd9){if(!_0x3cadd9){_0x392664['sendStatus'](0x194);}return _0x3cadd9;};}function handleError(_0x2d4d1e,_0x353caa){_0x353caa=_0x353caa||0x1f4;return function(_0x206e42){logger[_0x1afd('0x28')](_0x206e42[_0x1afd('0x29')]);if(_0x206e42[_0x1afd('0x2a')]){delete _0x206e42['name'];}_0x2d4d1e[_0x1afd('0x1b')](_0x353caa)['send'](_0x206e42);};}exports['index']=function(_0x50f2a2,_0x1bd5ad){var _0x452d94={},_0x31fedc={},_0x16adfa={'count':0x0,'rows':[]};var _0x47021e=_[_0x1afd('0x2b')](db['FreshsalesConfiguration'][_0x1afd('0x2c')],function(_0x10a32c){return{'name':_0x10a32c[_0x1afd('0x2d')],'type':_0x10a32c[_0x1afd('0x2e')][_0x1afd('0x2f')]};});_0x31fedc[_0x1afd('0x30')]=_['map'](_0x47021e,'name');_0x31fedc[_0x1afd('0x31')]=_[_0x1afd('0x32')](_0x50f2a2[_0x1afd('0x31')]);_0x31fedc[_0x1afd('0x33')]=_[_0x1afd('0x34')](_0x31fedc[_0x1afd('0x30')],_0x31fedc[_0x1afd('0x31')]);_0x452d94[_0x1afd('0x35')]=_[_0x1afd('0x34')](_0x31fedc[_0x1afd('0x30')],qs['fields'](_0x50f2a2[_0x1afd('0x31')][_0x1afd('0x36')]));_0x452d94[_0x1afd('0x35')]=_0x452d94['attributes'][_0x1afd('0x37')]?_0x452d94['attributes']:_0x31fedc[_0x1afd('0x30')];if(!_0x50f2a2[_0x1afd('0x31')]['hasOwnProperty'](_0x1afd('0x38'))){_0x452d94[_0x1afd('0x1e')]=qs['limit'](_0x50f2a2[_0x1afd('0x31')]['limit']);_0x452d94[_0x1afd('0x1c')]=qs['offset'](_0x50f2a2[_0x1afd('0x31')][_0x1afd('0x1c')]);}_0x452d94['order']=qs[_0x1afd('0x39')](_0x50f2a2['query'][_0x1afd('0x39')]);_0x452d94[_0x1afd('0x3a')]=qs[_0x1afd('0x33')](_['pick'](_0x50f2a2['query'],_0x31fedc[_0x1afd('0x33')]),_0x47021e);if(_0x50f2a2[_0x1afd('0x31')][_0x1afd('0x3b')]){_0x452d94[_0x1afd('0x3a')]=_[_0x1afd('0x3c')](_0x452d94[_0x1afd('0x3a')],{'$or':_[_0x1afd('0x2b')](_0x47021e,function(_0x32074a){if(_0x32074a[_0x1afd('0x2e')]!==_0x1afd('0x3d')){var _0x434229={};_0x434229[_0x32074a[_0x1afd('0x2a')]]={'$like':'%'+_0x50f2a2[_0x1afd('0x31')]['filter']+'%'};return _0x434229;}})});}_0x452d94=_['merge']({},_0x452d94,_0x50f2a2[_0x1afd('0x3e')]);var _0xe602c9={'where':_0x452d94[_0x1afd('0x3a')]};return db[_0x1afd('0x3f')][_0x1afd('0x1f')](_0xe602c9)[_0x1afd('0x26')](function(_0x88304){_0x16adfa['count']=_0x88304;if(_0x50f2a2[_0x1afd('0x31')][_0x1afd('0x40')]){_0x452d94[_0x1afd('0x41')]=[{'all':!![]}];}return db[_0x1afd('0x3f')][_0x1afd('0x42')](_0x452d94);})[_0x1afd('0x26')](function(_0x492b5b){_0x16adfa[_0x1afd('0x43')]=_0x492b5b;return _0x16adfa;})[_0x1afd('0x26')](respondWithFilteredResult(_0x1bd5ad,_0x452d94))['catch'](handleError(_0x1bd5ad,null));};exports['show']=function(_0x32517f,_0xb33eb){var _0x131345={'raw':![],'where':{'id':_0x32517f[_0x1afd('0x44')]['id']}},_0x2f69c0={};_0x2f69c0[_0x1afd('0x30')]=_[_0x1afd('0x32')](db['FreshsalesConfiguration'][_0x1afd('0x2c')]);_0x2f69c0[_0x1afd('0x31')]=_['keys'](_0x32517f[_0x1afd('0x31')]);_0x2f69c0[_0x1afd('0x33')]=_[_0x1afd('0x34')](_0x2f69c0['model'],_0x2f69c0['query']);_0x131345[_0x1afd('0x35')]=_[_0x1afd('0x34')](_0x2f69c0[_0x1afd('0x30')],qs['fields'](_0x32517f['query'][_0x1afd('0x36')]));_0x131345['attributes']=_0x131345[_0x1afd('0x35')][_0x1afd('0x37')]?_0x131345['attributes']:_0x2f69c0['model'];if(_0x32517f['query'][_0x1afd('0x40')]){_0x131345[_0x1afd('0x41')]=[{'all':!![]}];}_0x131345=_[_0x1afd('0x3c')]({},_0x131345,_0x32517f[_0x1afd('0x3e')]);return db[_0x1afd('0x3f')][_0x1afd('0x45')](_0x131345)[_0x1afd('0x26')](handleEntityNotFound(_0xb33eb,null))[_0x1afd('0x26')](respondWithResult(_0xb33eb,null))['catch'](handleError(_0xb33eb,null));};exports[_0x1afd('0x46')]=function(_0x3dd9c5,_0x5723b4){return db[_0x1afd('0x3f')][_0x1afd('0x46')](_0x3dd9c5['body'],{})[_0x1afd('0x26')](respondWithResult(_0x5723b4,0xc9))[_0x1afd('0x47')](handleError(_0x5723b4,null));};exports['update']=function(_0x57d203,_0x17a267){if(_0x57d203['body']['id']){delete _0x57d203[_0x1afd('0x48')]['id'];}return db['FreshsalesConfiguration']['find']({'where':{'id':_0x57d203[_0x1afd('0x44')]['id']}})[_0x1afd('0x26')](handleEntityNotFound(_0x17a267,null))[_0x1afd('0x26')](saveUpdates(_0x57d203[_0x1afd('0x48')],null))[_0x1afd('0x26')](respondWithResult(_0x17a267,null))[_0x1afd('0x47')](handleError(_0x17a267,null));};exports['destroy']=function(_0x463fad,_0x1ee7a5){return db[_0x1afd('0x3f')]['find']({'where':{'id':_0x463fad[_0x1afd('0x44')]['id']}})[_0x1afd('0x26')](handleEntityNotFound(_0x1ee7a5,null))['then'](removeEntity(_0x1ee7a5,null))[_0x1afd('0x47')](handleError(_0x1ee7a5,null));};exports[_0x1afd('0x49')]=function(_0x5c43db,_0x5b25fc,_0x5b9763){var _0x3a5d80={};var _0x2d65b2={};var _0x55510b;var _0x3d1aac;return db['FreshsalesConfiguration'][_0x1afd('0x4a')]({'where':{'id':_0x5c43db[_0x1afd('0x44')]['id']}})[_0x1afd('0x26')](handleEntityNotFound(_0x5b25fc,null))[_0x1afd('0x26')](function(_0xb3db7){if(_0xb3db7){_0x55510b=_0xb3db7;_0x2d65b2[_0x1afd('0x30')]=_[_0x1afd('0x32')](db[_0x1afd('0x4b')][_0x1afd('0x2c')]);_0x2d65b2[_0x1afd('0x31')]=_[_0x1afd('0x32')](_0x5c43db[_0x1afd('0x31')]);_0x2d65b2['filters']=_[_0x1afd('0x34')](_0x2d65b2[_0x1afd('0x30')],_0x2d65b2['query']);_0x3a5d80[_0x1afd('0x35')]=_[_0x1afd('0x34')](_0x2d65b2[_0x1afd('0x30')],qs[_0x1afd('0x36')](_0x5c43db['query']['fields']));_0x3a5d80[_0x1afd('0x35')]=_0x3a5d80[_0x1afd('0x35')][_0x1afd('0x37')]?_0x3a5d80[_0x1afd('0x35')]:_0x2d65b2[_0x1afd('0x30')];_0x3a5d80[_0x1afd('0x4c')]=qs['sort'](_0x5c43db['query'][_0x1afd('0x39')]);_0x3a5d80[_0x1afd('0x3a')]=qs[_0x1afd('0x33')](_[_0x1afd('0x4d')](_0x5c43db['query'],_0x2d65b2['filters']));if(_0x5c43db[_0x1afd('0x31')][_0x1afd('0x3b')]){_0x3a5d80['where']=_['merge'](_0x3a5d80[_0x1afd('0x3a')],{'$or':_[_0x1afd('0x2b')](_0x3a5d80[_0x1afd('0x35')],function(_0x25f4af){var _0x5d5d93={};_0x5d5d93[_0x25f4af]={'$like':'%'+_0x5c43db['query'][_0x1afd('0x3b')]+'%'};return _0x5d5d93;})});}_0x3a5d80=_[_0x1afd('0x3c')]({},_0x3a5d80,_0x5c43db[_0x1afd('0x3e')]);return _0x55510b[_0x1afd('0x49')](_0x3a5d80);}})['then'](function(_0x109fbc){if(_0x109fbc){_0x3d1aac=_0x109fbc[_0x1afd('0x37')];if(!_0x5c43db['query']['hasOwnProperty'](_0x1afd('0x38'))){_0x3a5d80[_0x1afd('0x1e')]=qs[_0x1afd('0x1e')](_0x5c43db[_0x1afd('0x31')][_0x1afd('0x1e')]);_0x3a5d80['offset']=qs['offset'](_0x5c43db[_0x1afd('0x31')]['offset']);}return _0x55510b['getSubjects'](_0x3a5d80);}})[_0x1afd('0x26')](function(_0x1d051c){if(_0x1d051c){return _0x1d051c?{'count':_0x3d1aac,'rows':_0x1d051c}:null;}})[_0x1afd('0x26')](respondWithResult(_0x5b25fc,null))[_0x1afd('0x47')](handleError(_0x5b25fc,null));};exports[_0x1afd('0x4e')]=function(_0x392a0b,_0x4cfdd9,_0x337bb5){var _0x56231c={};var _0x166d41={};var _0x4ac284;var _0xff6e8c;return db[_0x1afd('0x3f')]['findOne']({'where':{'id':_0x392a0b[_0x1afd('0x44')]['id']}})['then'](handleEntityNotFound(_0x4cfdd9,null))[_0x1afd('0x26')](function(_0x443862){if(_0x443862){_0x4ac284=_0x443862;_0x166d41[_0x1afd('0x30')]=_['keys'](db['FreshsalesField'][_0x1afd('0x2c')]);_0x166d41[_0x1afd('0x31')]=_[_0x1afd('0x32')](_0x392a0b['query']);_0x166d41[_0x1afd('0x33')]=_[_0x1afd('0x34')](_0x166d41['model'],_0x166d41['query']);_0x56231c[_0x1afd('0x35')]=_[_0x1afd('0x34')](_0x166d41['model'],qs[_0x1afd('0x36')](_0x392a0b[_0x1afd('0x31')][_0x1afd('0x36')]));_0x56231c['attributes']=_0x56231c[_0x1afd('0x35')][_0x1afd('0x37')]?_0x56231c['attributes']:_0x166d41[_0x1afd('0x30')];_0x56231c[_0x1afd('0x4c')]=qs[_0x1afd('0x39')](_0x392a0b['query'][_0x1afd('0x39')]);_0x56231c[_0x1afd('0x3a')]=qs['filters'](_[_0x1afd('0x4d')](_0x392a0b[_0x1afd('0x31')],_0x166d41[_0x1afd('0x33')]));if(_0x392a0b[_0x1afd('0x31')][_0x1afd('0x3b')]){_0x56231c['where']=_['merge'](_0x56231c[_0x1afd('0x3a')],{'$or':_[_0x1afd('0x2b')](_0x56231c[_0x1afd('0x35')],function(_0x5754eb){var _0x4b6219={};_0x4b6219[_0x5754eb]={'$like':'%'+_0x392a0b[_0x1afd('0x31')][_0x1afd('0x3b')]+'%'};return _0x4b6219;})});}_0x56231c=_[_0x1afd('0x3c')]({},_0x56231c,_0x392a0b[_0x1afd('0x3e')]);return _0x4ac284[_0x1afd('0x4e')](_0x56231c);}})[_0x1afd('0x26')](function(_0xe47a60){if(_0xe47a60){_0xff6e8c=_0xe47a60[_0x1afd('0x37')];if(!_0x392a0b[_0x1afd('0x31')][_0x1afd('0x4f')]('nolimit')){_0x56231c[_0x1afd('0x1e')]=qs[_0x1afd('0x1e')](_0x392a0b[_0x1afd('0x31')][_0x1afd('0x1e')]);_0x56231c[_0x1afd('0x1c')]=qs[_0x1afd('0x1c')](_0x392a0b[_0x1afd('0x31')][_0x1afd('0x1c')]);}return _0x4ac284[_0x1afd('0x4e')](_0x56231c);}})[_0x1afd('0x26')](function(_0x2e9597){if(_0x2e9597){return _0x2e9597?{'count':_0xff6e8c,'rows':_0x2e9597}:null;}})['then'](respondWithResult(_0x4cfdd9,null))[_0x1afd('0x47')](handleError(_0x4cfdd9,null));};exports[_0x1afd('0x50')]=function(_0x3b37c1,_0x4220bf,_0x8bb0c8){var _0x2c8fda={};var _0x4d51d8={};var _0x8cd630;var _0x28b889;return db[_0x1afd('0x3f')]['findOne']({'where':{'id':_0x3b37c1[_0x1afd('0x44')]['id']}})[_0x1afd('0x26')](handleEntityNotFound(_0x4220bf,null))[_0x1afd('0x26')](function(_0x32c394){if(_0x32c394){_0x8cd630=_0x32c394;_0x4d51d8['model']=_['keys'](db['FreshsalesField'][_0x1afd('0x2c')]);_0x4d51d8[_0x1afd('0x31')]=_[_0x1afd('0x32')](_0x3b37c1['query']);_0x4d51d8[_0x1afd('0x33')]=_[_0x1afd('0x34')](_0x4d51d8['model'],_0x4d51d8[_0x1afd('0x31')]);_0x2c8fda[_0x1afd('0x35')]=_[_0x1afd('0x34')](_0x4d51d8[_0x1afd('0x30')],qs['fields'](_0x3b37c1[_0x1afd('0x31')]['fields']));_0x2c8fda[_0x1afd('0x35')]=_0x2c8fda['attributes'][_0x1afd('0x37')]?_0x2c8fda[_0x1afd('0x35')]:_0x4d51d8[_0x1afd('0x30')];_0x2c8fda[_0x1afd('0x4c')]=qs[_0x1afd('0x39')](_0x3b37c1[_0x1afd('0x31')][_0x1afd('0x39')]);_0x2c8fda['where']=qs[_0x1afd('0x33')](_[_0x1afd('0x4d')](_0x3b37c1[_0x1afd('0x31')],_0x4d51d8[_0x1afd('0x33')]));if(_0x3b37c1[_0x1afd('0x31')]['filter']){_0x2c8fda[_0x1afd('0x3a')]=_['merge'](_0x2c8fda[_0x1afd('0x3a')],{'$or':_[_0x1afd('0x2b')](_0x2c8fda[_0x1afd('0x35')],function(_0x2a99c5){var _0x5b4e96={};_0x5b4e96[_0x2a99c5]={'$like':'%'+_0x3b37c1[_0x1afd('0x31')][_0x1afd('0x3b')]+'%'};return _0x5b4e96;})});}_0x2c8fda=_['merge']({},_0x2c8fda,_0x3b37c1[_0x1afd('0x3e')]);return _0x8cd630[_0x1afd('0x50')](_0x2c8fda);}})[_0x1afd('0x26')](function(_0x21e10c){if(_0x21e10c){_0x28b889=_0x21e10c[_0x1afd('0x37')];if(!_0x3b37c1[_0x1afd('0x31')][_0x1afd('0x4f')](_0x1afd('0x38'))){_0x2c8fda[_0x1afd('0x1e')]=qs['limit'](_0x3b37c1[_0x1afd('0x31')][_0x1afd('0x1e')]);_0x2c8fda['offset']=qs[_0x1afd('0x1c')](_0x3b37c1[_0x1afd('0x31')]['offset']);}return _0x8cd630[_0x1afd('0x50')](_0x2c8fda);}})[_0x1afd('0x26')](function(_0x39e5ee){if(_0x39e5ee){return _0x39e5ee?{'count':_0x28b889,'rows':_0x39e5ee}:null;}})[_0x1afd('0x26')](respondWithResult(_0x4220bf,null))['catch'](handleError(_0x4220bf,null));}; \ No newline at end of file +var _0x1dfa=['fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','getSubjects','findOne','FreshsalesField','nolimit','getDescriptions','getFields','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','destroy','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x4e6913,_0xba423b){var _0x9ef2ad=function(_0x259f53){while(--_0x259f53){_0x4e6913['push'](_0x4e6913['shift']());}};_0x9ef2ad(++_0xba423b);}(_0x1dfa,0xc6));var _0xa1df=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0x1dfa[_0x174ef5];return _0x1cc379;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1df('0x0'));var zipdir=require(_0xa1df('0x1'));var jsonpatch=require(_0xa1df('0x2'));var rp=require(_0xa1df('0x3'));var moment=require(_0xa1df('0x4'));var BPromise=require(_0xa1df('0x5'));var Mustache=require(_0xa1df('0x6'));var util=require(_0xa1df('0x7'));var path=require(_0xa1df('0x8'));var sox=require(_0xa1df('0x9'));var csv=require('to-csv');var ejs=require(_0xa1df('0xa'));var fs=require('fs');var fs_extra=require(_0xa1df('0xb'));var _=require(_0xa1df('0xc'));var squel=require('squel');var crypto=require(_0xa1df('0xd'));var jsforce=require(_0xa1df('0xe'));var deskjs=require(_0xa1df('0xf'));var toCsv=require(_0xa1df('0x10'));var querystring=require(_0xa1df('0x11'));var Papa=require(_0xa1df('0x12'));var Redis=require(_0xa1df('0x13'));var authService=require(_0xa1df('0x14'));var qs=require(_0xa1df('0x15'));var as=require(_0xa1df('0x16'));var hardwareService=require(_0xa1df('0x17'));var logger=require(_0xa1df('0x18'))(_0xa1df('0x19'));var utils=require(_0xa1df('0x1a'));var config=require(_0xa1df('0x1b'));var licenseUtil=require('../../config/license/util');var db=require(_0xa1df('0x1c'))['db'];function respondWithStatusCode(_0x5df813,_0x5a5857){_0x5a5857=_0x5a5857||0xcc;return function(_0x566408){if(_0x566408){return _0x5df813[_0xa1df('0x1d')](_0x5a5857);}return _0x5df813[_0xa1df('0x1e')](_0x5a5857)[_0xa1df('0x1f')]();};}function respondWithResult(_0x989196,_0x30aaa8){_0x30aaa8=_0x30aaa8||0xc8;return function(_0x4c65c1){if(_0x4c65c1){return _0x989196[_0xa1df('0x1e')](_0x30aaa8)[_0xa1df('0x20')](_0x4c65c1);}};}function respondWithFilteredResult(_0x275604,_0x297a36){return function(_0x3919ac){if(_0x3919ac){var _0x50ed73=typeof _0x297a36[_0xa1df('0x21')]===_0xa1df('0x22')&&typeof _0x297a36['limit']===_0xa1df('0x22');var _0x156bc3=_0x3919ac['count'];var _0x397b11=_0x50ed73?0x0:_0x297a36[_0xa1df('0x21')];var _0x28e37c=_0x50ed73?_0x3919ac[_0xa1df('0x23')]:_0x297a36[_0xa1df('0x21')]+_0x297a36[_0xa1df('0x24')];var _0x5f20e6;if(_0x28e37c>=_0x156bc3){_0x28e37c=_0x156bc3;_0x5f20e6=0xc8;}else{_0x5f20e6=0xce;}_0x275604[_0xa1df('0x1e')](_0x5f20e6);return _0x275604[_0xa1df('0x25')]('Content-Range',_0x397b11+'-'+_0x28e37c+'/'+_0x156bc3)['json'](_0x3919ac);}return null;};}function patchUpdates(_0x531760){return function(_0x22c4b5){try{jsonpatch[_0xa1df('0x26')](_0x22c4b5,_0x531760,!![]);}catch(_0x33f208){return BPromise['reject'](_0x33f208);}return _0x22c4b5[_0xa1df('0x27')]();};}function saveUpdates(_0x168893,_0x34feaa){return function(_0x2623a9){if(_0x2623a9){return _0x2623a9[_0xa1df('0x28')](_0x168893)[_0xa1df('0x29')](function(_0x531b0a){return _0x531b0a;});}return null;};}function removeEntity(_0x18e0b8,_0x532629){return function(_0x4087aa){if(_0x4087aa){return _0x4087aa[_0xa1df('0x2a')]()[_0xa1df('0x29')](function(){_0x18e0b8['status'](0xcc)[_0xa1df('0x1f')]();});}};}function handleEntityNotFound(_0x47e643,_0x40579a){return function(_0x396059){if(!_0x396059){_0x47e643['sendStatus'](0x194);}return _0x396059;};}function handleError(_0x5cde43,_0x37b0b1){_0x37b0b1=_0x37b0b1||0x1f4;return function(_0x4f0ec7){logger[_0xa1df('0x2b')](_0x4f0ec7[_0xa1df('0x2c')]);if(_0x4f0ec7[_0xa1df('0x2d')]){delete _0x4f0ec7[_0xa1df('0x2d')];}_0x5cde43[_0xa1df('0x1e')](_0x37b0b1)[_0xa1df('0x2e')](_0x4f0ec7);};}exports[_0xa1df('0x2f')]=function(_0x3665ac,_0x35a1ad){var _0xdce2a3={},_0x58d5c1={},_0x1191dc={'count':0x0,'rows':[]};var _0x3444b4=_[_0xa1df('0x30')](db[_0xa1df('0x31')][_0xa1df('0x32')],function(_0x30c391){return{'name':_0x30c391[_0xa1df('0x33')],'type':_0x30c391[_0xa1df('0x34')][_0xa1df('0x35')]};});_0x58d5c1[_0xa1df('0x36')]=_['map'](_0x3444b4,_0xa1df('0x2d'));_0x58d5c1[_0xa1df('0x37')]=_[_0xa1df('0x38')](_0x3665ac[_0xa1df('0x37')]);_0x58d5c1[_0xa1df('0x39')]=_[_0xa1df('0x3a')](_0x58d5c1['model'],_0x58d5c1[_0xa1df('0x37')]);_0xdce2a3[_0xa1df('0x3b')]=_['intersection'](_0x58d5c1[_0xa1df('0x36')],qs[_0xa1df('0x3c')](_0x3665ac[_0xa1df('0x37')]['fields']));_0xdce2a3[_0xa1df('0x3b')]=_0xdce2a3[_0xa1df('0x3b')][_0xa1df('0x3d')]?_0xdce2a3['attributes']:_0x58d5c1[_0xa1df('0x36')];if(!_0x3665ac[_0xa1df('0x37')][_0xa1df('0x3e')]('nolimit')){_0xdce2a3[_0xa1df('0x24')]=qs[_0xa1df('0x24')](_0x3665ac[_0xa1df('0x37')][_0xa1df('0x24')]);_0xdce2a3[_0xa1df('0x21')]=qs['offset'](_0x3665ac['query'][_0xa1df('0x21')]);}_0xdce2a3[_0xa1df('0x3f')]=qs[_0xa1df('0x40')](_0x3665ac['query'][_0xa1df('0x40')]);_0xdce2a3[_0xa1df('0x41')]=qs[_0xa1df('0x39')](_[_0xa1df('0x42')](_0x3665ac[_0xa1df('0x37')],_0x58d5c1['filters']),_0x3444b4);if(_0x3665ac[_0xa1df('0x37')][_0xa1df('0x43')]){_0xdce2a3[_0xa1df('0x41')]=_[_0xa1df('0x44')](_0xdce2a3[_0xa1df('0x41')],{'$or':_['map'](_0x3444b4,function(_0x325d27){if(_0x325d27['type']!==_0xa1df('0x45')){var _0x5e373a={};_0x5e373a[_0x325d27[_0xa1df('0x2d')]]={'$like':'%'+_0x3665ac['query'][_0xa1df('0x43')]+'%'};return _0x5e373a;}})});}_0xdce2a3=_[_0xa1df('0x44')]({},_0xdce2a3,_0x3665ac['options']);var _0x35c7d7={'where':_0xdce2a3[_0xa1df('0x41')]};return db[_0xa1df('0x31')][_0xa1df('0x23')](_0x35c7d7)[_0xa1df('0x29')](function(_0x3307f5){_0x1191dc[_0xa1df('0x23')]=_0x3307f5;if(_0x3665ac[_0xa1df('0x37')][_0xa1df('0x46')]){_0xdce2a3[_0xa1df('0x47')]=[{'all':!![]}];}return db['FreshsalesConfiguration'][_0xa1df('0x48')](_0xdce2a3);})[_0xa1df('0x29')](function(_0xeb72bd){_0x1191dc['rows']=_0xeb72bd;return _0x1191dc;})['then'](respondWithFilteredResult(_0x35a1ad,_0xdce2a3))[_0xa1df('0x49')](handleError(_0x35a1ad,null));};exports[_0xa1df('0x4a')]=function(_0x5517d7,_0x4363a6){var _0x38b44d={'raw':![],'where':{'id':_0x5517d7[_0xa1df('0x4b')]['id']}},_0x4e5710={};_0x4e5710[_0xa1df('0x36')]=_[_0xa1df('0x38')](db['FreshsalesConfiguration']['rawAttributes']);_0x4e5710[_0xa1df('0x37')]=_[_0xa1df('0x38')](_0x5517d7[_0xa1df('0x37')]);_0x4e5710[_0xa1df('0x39')]=_[_0xa1df('0x3a')](_0x4e5710['model'],_0x4e5710[_0xa1df('0x37')]);_0x38b44d[_0xa1df('0x3b')]=_[_0xa1df('0x3a')](_0x4e5710[_0xa1df('0x36')],qs['fields'](_0x5517d7[_0xa1df('0x37')][_0xa1df('0x3c')]));_0x38b44d['attributes']=_0x38b44d['attributes'][_0xa1df('0x3d')]?_0x38b44d[_0xa1df('0x3b')]:_0x4e5710[_0xa1df('0x36')];if(_0x5517d7[_0xa1df('0x37')][_0xa1df('0x46')]){_0x38b44d['include']=[{'all':!![]}];}_0x38b44d=_[_0xa1df('0x44')]({},_0x38b44d,_0x5517d7[_0xa1df('0x4c')]);return db[_0xa1df('0x31')][_0xa1df('0x4d')](_0x38b44d)[_0xa1df('0x29')](handleEntityNotFound(_0x4363a6,null))[_0xa1df('0x29')](respondWithResult(_0x4363a6,null))[_0xa1df('0x49')](handleError(_0x4363a6,null));};exports['create']=function(_0x391a0d,_0x485b6e){return db['FreshsalesConfiguration'][_0xa1df('0x4e')](_0x391a0d[_0xa1df('0x4f')],{})['then'](respondWithResult(_0x485b6e,0xc9))[_0xa1df('0x49')](handleError(_0x485b6e,null));};exports[_0xa1df('0x28')]=function(_0x438bf3,_0x20b85f){if(_0x438bf3[_0xa1df('0x4f')]['id']){delete _0x438bf3[_0xa1df('0x4f')]['id'];}return db['FreshsalesConfiguration'][_0xa1df('0x4d')]({'where':{'id':_0x438bf3[_0xa1df('0x4b')]['id']}})[_0xa1df('0x29')](handleEntityNotFound(_0x20b85f,null))[_0xa1df('0x29')](saveUpdates(_0x438bf3[_0xa1df('0x4f')],null))[_0xa1df('0x29')](respondWithResult(_0x20b85f,null))[_0xa1df('0x49')](handleError(_0x20b85f,null));};exports['destroy']=function(_0x1fa6b4,_0x42a2cc){return db[_0xa1df('0x31')][_0xa1df('0x4d')]({'where':{'id':_0x1fa6b4[_0xa1df('0x4b')]['id']}})['then'](handleEntityNotFound(_0x42a2cc,null))[_0xa1df('0x29')](removeEntity(_0x42a2cc,null))[_0xa1df('0x49')](handleError(_0x42a2cc,null));};exports[_0xa1df('0x50')]=function(_0x5c8968,_0x3cb53b,_0x34c5bd){var _0x264dc4={};var _0x288d9c={};var _0x1ad01c;var _0x2e6f84;return db[_0xa1df('0x31')][_0xa1df('0x51')]({'where':{'id':_0x5c8968[_0xa1df('0x4b')]['id']}})[_0xa1df('0x29')](handleEntityNotFound(_0x3cb53b,null))[_0xa1df('0x29')](function(_0x329de2){if(_0x329de2){_0x1ad01c=_0x329de2;_0x288d9c[_0xa1df('0x36')]=_[_0xa1df('0x38')](db[_0xa1df('0x52')][_0xa1df('0x32')]);_0x288d9c['query']=_[_0xa1df('0x38')](_0x5c8968[_0xa1df('0x37')]);_0x288d9c[_0xa1df('0x39')]=_[_0xa1df('0x3a')](_0x288d9c[_0xa1df('0x36')],_0x288d9c[_0xa1df('0x37')]);_0x264dc4[_0xa1df('0x3b')]=_[_0xa1df('0x3a')](_0x288d9c[_0xa1df('0x36')],qs['fields'](_0x5c8968[_0xa1df('0x37')][_0xa1df('0x3c')]));_0x264dc4['attributes']=_0x264dc4[_0xa1df('0x3b')][_0xa1df('0x3d')]?_0x264dc4[_0xa1df('0x3b')]:_0x288d9c[_0xa1df('0x36')];_0x264dc4[_0xa1df('0x3f')]=qs['sort'](_0x5c8968[_0xa1df('0x37')][_0xa1df('0x40')]);_0x264dc4[_0xa1df('0x41')]=qs[_0xa1df('0x39')](_[_0xa1df('0x42')](_0x5c8968[_0xa1df('0x37')],_0x288d9c[_0xa1df('0x39')]));if(_0x5c8968[_0xa1df('0x37')][_0xa1df('0x43')]){_0x264dc4[_0xa1df('0x41')]=_['merge'](_0x264dc4[_0xa1df('0x41')],{'$or':_[_0xa1df('0x30')](_0x264dc4['attributes'],function(_0x4ef5e2){var _0x262c24={};_0x262c24[_0x4ef5e2]={'$like':'%'+_0x5c8968[_0xa1df('0x37')][_0xa1df('0x43')]+'%'};return _0x262c24;})});}_0x264dc4=_[_0xa1df('0x44')]({},_0x264dc4,_0x5c8968[_0xa1df('0x4c')]);return _0x1ad01c[_0xa1df('0x50')](_0x264dc4);}})[_0xa1df('0x29')](function(_0x106763){if(_0x106763){_0x2e6f84=_0x106763[_0xa1df('0x3d')];if(!_0x5c8968[_0xa1df('0x37')][_0xa1df('0x3e')](_0xa1df('0x53'))){_0x264dc4['limit']=qs['limit'](_0x5c8968[_0xa1df('0x37')]['limit']);_0x264dc4[_0xa1df('0x21')]=qs[_0xa1df('0x21')](_0x5c8968[_0xa1df('0x37')][_0xa1df('0x21')]);}return _0x1ad01c[_0xa1df('0x50')](_0x264dc4);}})[_0xa1df('0x29')](function(_0x293b01){if(_0x293b01){return _0x293b01?{'count':_0x2e6f84,'rows':_0x293b01}:null;}})[_0xa1df('0x29')](respondWithResult(_0x3cb53b,null))['catch'](handleError(_0x3cb53b,null));};exports['getDescriptions']=function(_0x465e6f,_0x297583,_0x53a634){var _0x52d716={};var _0x5cbb66={};var _0xea57c7;var _0xf0155b;return db['FreshsalesConfiguration'][_0xa1df('0x51')]({'where':{'id':_0x465e6f[_0xa1df('0x4b')]['id']}})[_0xa1df('0x29')](handleEntityNotFound(_0x297583,null))['then'](function(_0x1ba75e){if(_0x1ba75e){_0xea57c7=_0x1ba75e;_0x5cbb66[_0xa1df('0x36')]=_[_0xa1df('0x38')](db['FreshsalesField']['rawAttributes']);_0x5cbb66[_0xa1df('0x37')]=_[_0xa1df('0x38')](_0x465e6f[_0xa1df('0x37')]);_0x5cbb66[_0xa1df('0x39')]=_[_0xa1df('0x3a')](_0x5cbb66[_0xa1df('0x36')],_0x5cbb66[_0xa1df('0x37')]);_0x52d716[_0xa1df('0x3b')]=_[_0xa1df('0x3a')](_0x5cbb66['model'],qs['fields'](_0x465e6f[_0xa1df('0x37')][_0xa1df('0x3c')]));_0x52d716[_0xa1df('0x3b')]=_0x52d716[_0xa1df('0x3b')][_0xa1df('0x3d')]?_0x52d716[_0xa1df('0x3b')]:_0x5cbb66['model'];_0x52d716['order']=qs[_0xa1df('0x40')](_0x465e6f[_0xa1df('0x37')]['sort']);_0x52d716[_0xa1df('0x41')]=qs[_0xa1df('0x39')](_[_0xa1df('0x42')](_0x465e6f[_0xa1df('0x37')],_0x5cbb66[_0xa1df('0x39')]));if(_0x465e6f['query']['filter']){_0x52d716[_0xa1df('0x41')]=_[_0xa1df('0x44')](_0x52d716[_0xa1df('0x41')],{'$or':_[_0xa1df('0x30')](_0x52d716[_0xa1df('0x3b')],function(_0xd4c012){var _0x286cd3={};_0x286cd3[_0xd4c012]={'$like':'%'+_0x465e6f['query'][_0xa1df('0x43')]+'%'};return _0x286cd3;})});}_0x52d716=_[_0xa1df('0x44')]({},_0x52d716,_0x465e6f[_0xa1df('0x4c')]);return _0xea57c7[_0xa1df('0x54')](_0x52d716);}})[_0xa1df('0x29')](function(_0x4c5e61){if(_0x4c5e61){_0xf0155b=_0x4c5e61['length'];if(!_0x465e6f[_0xa1df('0x37')][_0xa1df('0x3e')](_0xa1df('0x53'))){_0x52d716[_0xa1df('0x24')]=qs['limit'](_0x465e6f[_0xa1df('0x37')][_0xa1df('0x24')]);_0x52d716[_0xa1df('0x21')]=qs[_0xa1df('0x21')](_0x465e6f['query']['offset']);}return _0xea57c7[_0xa1df('0x54')](_0x52d716);}})[_0xa1df('0x29')](function(_0x4aedb0){if(_0x4aedb0){return _0x4aedb0?{'count':_0xf0155b,'rows':_0x4aedb0}:null;}})['then'](respondWithResult(_0x297583,null))[_0xa1df('0x49')](handleError(_0x297583,null));};exports[_0xa1df('0x55')]=function(_0x29b62e,_0x367732,_0x1561af){var _0x499010={};var _0x1c2979={};var _0x4676e7;var _0x339a61;return db['FreshsalesConfiguration'][_0xa1df('0x51')]({'where':{'id':_0x29b62e['params']['id']}})[_0xa1df('0x29')](handleEntityNotFound(_0x367732,null))[_0xa1df('0x29')](function(_0x44df4e){if(_0x44df4e){_0x4676e7=_0x44df4e;_0x1c2979['model']=_[_0xa1df('0x38')](db[_0xa1df('0x52')]['rawAttributes']);_0x1c2979[_0xa1df('0x37')]=_[_0xa1df('0x38')](_0x29b62e['query']);_0x1c2979[_0xa1df('0x39')]=_[_0xa1df('0x3a')](_0x1c2979['model'],_0x1c2979['query']);_0x499010[_0xa1df('0x3b')]=_[_0xa1df('0x3a')](_0x1c2979['model'],qs[_0xa1df('0x3c')](_0x29b62e[_0xa1df('0x37')][_0xa1df('0x3c')]));_0x499010[_0xa1df('0x3b')]=_0x499010[_0xa1df('0x3b')][_0xa1df('0x3d')]?_0x499010['attributes']:_0x1c2979['model'];_0x499010['order']=qs['sort'](_0x29b62e[_0xa1df('0x37')]['sort']);_0x499010[_0xa1df('0x41')]=qs[_0xa1df('0x39')](_[_0xa1df('0x42')](_0x29b62e[_0xa1df('0x37')],_0x1c2979[_0xa1df('0x39')]));if(_0x29b62e[_0xa1df('0x37')]['filter']){_0x499010[_0xa1df('0x41')]=_['merge'](_0x499010[_0xa1df('0x41')],{'$or':_[_0xa1df('0x30')](_0x499010[_0xa1df('0x3b')],function(_0x592e28){var _0x46d33a={};_0x46d33a[_0x592e28]={'$like':'%'+_0x29b62e[_0xa1df('0x37')][_0xa1df('0x43')]+'%'};return _0x46d33a;})});}_0x499010=_[_0xa1df('0x44')]({},_0x499010,_0x29b62e[_0xa1df('0x4c')]);return _0x4676e7[_0xa1df('0x55')](_0x499010);}})[_0xa1df('0x29')](function(_0x56ed58){if(_0x56ed58){_0x339a61=_0x56ed58[_0xa1df('0x3d')];if(!_0x29b62e[_0xa1df('0x37')]['hasOwnProperty'](_0xa1df('0x53'))){_0x499010[_0xa1df('0x24')]=qs['limit'](_0x29b62e[_0xa1df('0x37')][_0xa1df('0x24')]);_0x499010[_0xa1df('0x21')]=qs['offset'](_0x29b62e[_0xa1df('0x37')][_0xa1df('0x21')]);}return _0x4676e7[_0xa1df('0x55')](_0x499010);}})[_0xa1df('0x29')](function(_0x4a04bd){if(_0x4a04bd){return _0x4a04bd?{'count':_0x339a61,'rows':_0x4a04bd}:null;}})[_0xa1df('0x29')](respondWithResult(_0x367732,null))[_0xa1df('0x49')](handleError(_0x367732,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 9686e85..b1caf8b 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 _0xe409=['define','int_freshsales_configurations','lodash','util','../../config/logger','api','request-promise','path','./intFreshsalesConfiguration.attributes'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xe409,0x80));var _0x9e40=function(_0x329e63,_0x133a6e){_0x329e63=_0x329e63-0x0;var _0x45c749=_0xe409[_0x329e63];return _0x45c749;};'use strict';var _=require(_0x9e40('0x0'));var util=require(_0x9e40('0x1'));var logger=require(_0x9e40('0x2'))(_0x9e40('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9e40('0x4'));var fs=require('fs');var path=require(_0x9e40('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9e40('0x6'));module['exports']=function(_0x5985fb,_0x110ea4){return _0x5985fb[_0x9e40('0x7')]('FreshsalesConfiguration',attributes,{'tableName':_0x9e40('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3412=['bluebird','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','lodash','util','moment'];(function(_0xfd589,_0x338084){var _0x48489d=function(_0x271677){while(--_0x271677){_0xfd589['push'](_0xfd589['shift']());}};_0x48489d(++_0x338084);}(_0x3412,0x19f));var _0x2341=function(_0x129f74,_0x3d64d8){_0x129f74=_0x129f74-0x0;var _0x1cf683=_0x3412[_0x129f74];return _0x1cf683;};'use strict';var _=require(_0x2341('0x0'));var util=require(_0x2341('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2341('0x2'));var BPromise=require(_0x2341('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2341('0x4'));var rimraf=require('rimraf');var config=require(_0x2341('0x5'));var attributes=require(_0x2341('0x6'));module[_0x2341('0x7')]=function(_0x5b406d,_0x2798ab){return _0x5b406d[_0x2341('0x8')](_0x2341('0x9'),attributes,{'tableName':_0x2341('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index a19dbd4..196add9 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 _0x02f8=['request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x28e08a,_0x3a7a8c){var _0x3bb087=function(_0x3ddb2d){while(--_0x3ddb2d){_0x28e08a['push'](_0x28e08a['shift']());}};_0x3bb087(++_0x3a7a8c);}(_0x02f8,0x170));var _0x802f=function(_0x9a7d5b,_0x50327f){_0x9a7d5b=_0x9a7d5b-0x0;var _0xe2a5b3=_0x02f8[_0x9a7d5b];return _0xe2a5b3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x802f('0x0'));var BPromise=require('bluebird');var rs=require(_0x802f('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x802f('0x2'));var logger=require(_0x802f('0x3'))(_0x802f('0x4'));var config=require('../../config/environment');var jayson=require(_0x802f('0x5'));var client=jayson[_0x802f('0x6')][_0x802f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x10c119,_0x26aa2b,_0x56160e){return new BPromise(function(_0x347065,_0x1416a9){return client[_0x802f('0x8')](_0x10c119,_0x56160e)[_0x802f('0x9')](function(_0x17ed5d){logger[_0x802f('0xa')](_0x802f('0xb'),_0x26aa2b,_0x802f('0xc'));logger[_0x802f('0xd')](_0x802f('0xe'),_0x26aa2b,_0x802f('0xc'),JSON[_0x802f('0xf')](_0x17ed5d));if(_0x17ed5d['error']){if(_0x17ed5d[_0x802f('0x10')][_0x802f('0x11')]===0x1f4){logger[_0x802f('0x10')](_0x802f('0xb'),_0x26aa2b,_0x17ed5d[_0x802f('0x10')][_0x802f('0x12')]);return _0x1416a9(_0x17ed5d[_0x802f('0x10')][_0x802f('0x12')]);}logger[_0x802f('0x10')](_0x802f('0xb'),_0x26aa2b,_0x17ed5d[_0x802f('0x10')][_0x802f('0x12')]);return _0x347065(_0x17ed5d[_0x802f('0x10')][_0x802f('0x12')]);}else{logger[_0x802f('0xa')](_0x802f('0xb'),_0x26aa2b,_0x802f('0xc'));_0x347065(_0x17ed5d['result'][_0x802f('0x12')]);}})[_0x802f('0x13')](function(_0x19919f){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x26aa2b,_0x19919f);_0x1416a9(_0x19919f);});});} \ No newline at end of file +var _0xb57d=['debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then','info'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xb57d,0x112));var _0xdb57=function(_0x48157b,_0x3dd91e){_0x48157b=_0x48157b-0x0;var _0x23e206=_0xb57d[_0x48157b];return _0x23e206;};'use strict';var _=require(_0xdb57('0x0'));var util=require(_0xdb57('0x1'));var moment=require(_0xdb57('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb57('0x3'));var db=require(_0xdb57('0x4'))['db'];var utils=require(_0xdb57('0x5'));var logger=require(_0xdb57('0x6'))(_0xdb57('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdb57('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x484029,_0x3f1cee,_0x32aef3){return new BPromise(function(_0x17670e,_0x2e97c4){return client[_0xdb57('0x9')](_0x484029,_0x32aef3)[_0xdb57('0xa')](function(_0x41f44f){logger[_0xdb57('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f1cee,'request\x20sent');logger[_0xdb57('0xc')](_0xdb57('0xd'),_0x3f1cee,_0xdb57('0xe'),JSON[_0xdb57('0xf')](_0x41f44f));if(_0x41f44f[_0xdb57('0x10')]){if(_0x41f44f[_0xdb57('0x10')][_0xdb57('0x11')]===0x1f4){logger[_0xdb57('0x10')](_0xdb57('0x12'),_0x3f1cee,_0x41f44f[_0xdb57('0x10')]['message']);return _0x2e97c4(_0x41f44f[_0xdb57('0x10')]['message']);}logger[_0xdb57('0x10')](_0xdb57('0x12'),_0x3f1cee,_0x41f44f[_0xdb57('0x10')]['message']);return _0x17670e(_0x41f44f['error'][_0xdb57('0x13')]);}else{logger[_0xdb57('0xb')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f1cee,_0xdb57('0xe'));_0x17670e(_0x41f44f[_0xdb57('0x14')]['message']);}})[_0xdb57('0x15')](function(_0x34e671){logger[_0xdb57('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x3f1cee,_0x34e671);_0x2e97c4(_0x34e671);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index ab4a857..395c77b 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 _0xb04a=['get','index','post','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller'];(function(_0x3340c8,_0x3d67d7){var _0x30ca8a=function(_0x435fff){while(--_0x435fff){_0x3340c8['push'](_0x3340c8['shift']());}};_0x30ca8a(++_0x3d67d7);}(_0xb04a,0xcf));var _0xab04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb04a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xab04('0x0'));var util=require(_0xab04('0x1'));var path=require(_0xab04('0x2'));var timeout=require(_0xab04('0x3'));var express=require('express');var router=express[_0xab04('0x4')]();var fs_extra=require(_0xab04('0x5'));var auth=require(_0xab04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xab04('0x7'));var controller=require(_0xab04('0x8'));router[_0xab04('0x9')]('/',auth['isAuthenticated'](),controller[_0xab04('0xa')]);router[_0xab04('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xab04('0xb')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xab04('0xc'),auth[_0xab04('0xd')](),controller[_0xab04('0xe')]);router[_0xab04('0xf')](_0xab04('0xc'),auth[_0xab04('0xd')](),controller[_0xab04('0x10')]);module[_0xab04('0x11')]=router; \ No newline at end of file +var _0xe28e=['delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','/:id','show','post','create','update'];(function(_0x413b49,_0x3a9846){var _0x262b8c=function(_0x1ad995){while(--_0x1ad995){_0x413b49['push'](_0x413b49['shift']());}};_0x262b8c(++_0x3a9846);}(_0xe28e,0x1ba));var _0xee28=function(_0x3e30de,_0x5dac0b){_0x3e30de=_0x3e30de-0x0;var _0x3958e9=_0xe28e[_0x3e30de];return _0x3958e9;};'use strict';var multer=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var path=require(_0xee28('0x2'));var timeout=require(_0xee28('0x3'));var express=require(_0xee28('0x4'));var router=express[_0xee28('0x5')]();var fs_extra=require(_0xee28('0x6'));var auth=require(_0xee28('0x7'));var interaction=require(_0xee28('0x8'));var config=require(_0xee28('0x9'));var controller=require(_0xee28('0xa'));router[_0xee28('0xb')]('/',auth[_0xee28('0xc')](),controller['index']);router[_0xee28('0xb')](_0xee28('0xd'),auth[_0xee28('0xc')](),controller[_0xee28('0xe')]);router[_0xee28('0xf')]('/',auth[_0xee28('0xc')](),controller[_0xee28('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xee28('0x11')]);router[_0xee28('0x12')]('/:id',auth[_0xee28('0xc')](),controller[_0xee28('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 3adf265..79e5ec1 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 _0xc09d=['string','STRING','sequelize','exports','variable','customVariable','keyValue','picklist'];(function(_0x1d86bb,_0x244fd0){var _0x41d5fd=function(_0x39ab5a){while(--_0x39ab5a){_0x1d86bb['push'](_0x1d86bb['shift']());}};_0x41d5fd(++_0x244fd0);}(_0xc09d,0x1d2));var _0xdc09=function(_0x413646,_0x12cf4d){_0x413646=_0x413646-0x0;var _0x1ae077=_0xc09d[_0x413646];return _0x1ae077;};'use strict';var Sequelize=require(_0xdc09('0x0'));module[_0xdc09('0x1')]={'type':{'type':Sequelize['ENUM']('string',_0xdc09('0x2'),_0xdc09('0x3'),_0xdc09('0x4'),_0xdc09('0x5')),'defaultValue':_0xdc09('0x6')},'content':{'type':Sequelize[_0xdc09('0x7')]},'key':{'type':Sequelize[_0xdc09('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xdc09('0x6'),_0xdc09('0x2'),_0xdc09('0x3'))},'keyContent':{'type':Sequelize[_0xdc09('0x7')]},'idField':{'type':Sequelize[_0xdc09('0x7')]},'nameField':{'type':Sequelize[_0xdc09('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdc09('0x7')]}}; \ No newline at end of file +var _0xee28=['customVariable','keyValue','picklist','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x273f77,_0xe5b0cb){var _0x71e147=function(_0x564056){while(--_0x564056){_0x273f77['push'](_0x273f77['shift']());}};_0x71e147(++_0xe5b0cb);}(_0xee28,0x152));var _0x8ee2=function(_0x47a14b,_0x6f8c0){_0x47a14b=_0x47a14b-0x0;var _0x52cf12=_0xee28[_0x47a14b];return _0x52cf12;};'use strict';var Sequelize=require(_0x8ee2('0x0'));module['exports']={'type':{'type':Sequelize[_0x8ee2('0x1')](_0x8ee2('0x2'),_0x8ee2('0x3'),_0x8ee2('0x4'),_0x8ee2('0x5'),_0x8ee2('0x6')),'defaultValue':_0x8ee2('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x8ee2('0x7')]},'keyType':{'type':Sequelize[_0x8ee2('0x1')]('string',_0x8ee2('0x3'),_0x8ee2('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x8ee2('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index dc79ef1..04d210e 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 _0x76dc=['moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','FreshsalesField','include','findAll','rows','catch','show','includeAll','options','create','body','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x479509,_0x1daf8a){var _0x382da8=function(_0x39d77c){while(--_0x39d77c){_0x479509['push'](_0x479509['shift']());}};_0x382da8(++_0x1daf8a);}(_0x76dc,0x91));var _0xc76d=function(_0x3afe18,_0x26922c){_0x3afe18=_0x3afe18-0x0;var _0x19ed1f=_0x76dc[_0x3afe18];return _0x19ed1f;};'use strict';var emlformat=require(_0xc76d('0x0'));var rimraf=require(_0xc76d('0x1'));var zipdir=require(_0xc76d('0x2'));var jsonpatch=require(_0xc76d('0x3'));var rp=require(_0xc76d('0x4'));var moment=require(_0xc76d('0x5'));var BPromise=require(_0xc76d('0x6'));var Mustache=require(_0xc76d('0x7'));var util=require(_0xc76d('0x8'));var path=require(_0xc76d('0x9'));var sox=require(_0xc76d('0xa'));var csv=require(_0xc76d('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc76d('0xc'));var _=require(_0xc76d('0xd'));var squel=require(_0xc76d('0xe'));var crypto=require(_0xc76d('0xf'));var jsforce=require(_0xc76d('0x10'));var deskjs=require(_0xc76d('0x11'));var toCsv=require(_0xc76d('0xb'));var querystring=require('querystring');var Papa=require(_0xc76d('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc76d('0x13'));var as=require(_0xc76d('0x14'));var hardwareService=require(_0xc76d('0x15'));var logger=require(_0xc76d('0x16'))(_0xc76d('0x17'));var utils=require(_0xc76d('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0xc76d('0x19'));var db=require(_0xc76d('0x1a'))['db'];function respondWithStatusCode(_0xa15de5,_0x49368f){_0x49368f=_0x49368f||0xcc;return function(_0x359981){if(_0x359981){return _0xa15de5[_0xc76d('0x1b')](_0x49368f);}return _0xa15de5[_0xc76d('0x1c')](_0x49368f)['end']();};}function respondWithResult(_0x47e7ed,_0x20ffae){_0x20ffae=_0x20ffae||0xc8;return function(_0x43cb9f){if(_0x43cb9f){return _0x47e7ed['status'](_0x20ffae)[_0xc76d('0x1d')](_0x43cb9f);}};}function respondWithFilteredResult(_0x210799,_0x36dde0){return function(_0x212870){if(_0x212870){var _0x3bf0cc=typeof _0x36dde0[_0xc76d('0x1e')]===_0xc76d('0x1f')&&typeof _0x36dde0[_0xc76d('0x20')]==='undefined';var _0x490b8e=_0x212870['count'];var _0x33fa46=_0x3bf0cc?0x0:_0x36dde0[_0xc76d('0x1e')];var _0x42093f=_0x3bf0cc?_0x212870[_0xc76d('0x21')]:_0x36dde0[_0xc76d('0x1e')]+_0x36dde0[_0xc76d('0x20')];var _0x2f8e75;if(_0x42093f>=_0x490b8e){_0x42093f=_0x490b8e;_0x2f8e75=0xc8;}else{_0x2f8e75=0xce;}_0x210799[_0xc76d('0x1c')](_0x2f8e75);return _0x210799[_0xc76d('0x22')](_0xc76d('0x23'),_0x33fa46+'-'+_0x42093f+'/'+_0x490b8e)['json'](_0x212870);}return null;};}function patchUpdates(_0x280641){return function(_0x40ea60){try{jsonpatch['apply'](_0x40ea60,_0x280641,!![]);}catch(_0xe978f4){return BPromise[_0xc76d('0x24')](_0xe978f4);}return _0x40ea60[_0xc76d('0x25')]();};}function saveUpdates(_0x153950,_0x48fa14){return function(_0x10b42d){if(_0x10b42d){return _0x10b42d['update'](_0x153950)[_0xc76d('0x26')](function(_0x24fb2c){return _0x24fb2c;});}return null;};}function removeEntity(_0x21448b,_0x42c0ae){return function(_0x8303c5){if(_0x8303c5){return _0x8303c5[_0xc76d('0x27')]()['then'](function(){_0x21448b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4aa57f,_0x4fc607){return function(_0x19070c){if(!_0x19070c){_0x4aa57f[_0xc76d('0x1b')](0x194);}return _0x19070c;};}function handleError(_0x29982a,_0xc89011){_0xc89011=_0xc89011||0x1f4;return function(_0x330fde){logger[_0xc76d('0x28')](_0x330fde[_0xc76d('0x29')]);if(_0x330fde[_0xc76d('0x2a')]){delete _0x330fde[_0xc76d('0x2a')];}_0x29982a['status'](_0xc89011)[_0xc76d('0x2b')](_0x330fde);};}exports[_0xc76d('0x2c')]=function(_0x23cd05,_0x7f6494){var _0x39309a={},_0x12d3b8={},_0xce3d9d={'count':0x0,'rows':[]};var _0x243930=_['map'](db['FreshsalesField'][_0xc76d('0x2d')],function(_0x435404){return{'name':_0x435404['fieldName'],'type':_0x435404['type']['key']};});_0x12d3b8[_0xc76d('0x2e')]=_['map'](_0x243930,'name');_0x12d3b8['query']=_[_0xc76d('0x2f')](_0x23cd05[_0xc76d('0x30')]);_0x12d3b8[_0xc76d('0x31')]=_[_0xc76d('0x32')](_0x12d3b8['model'],_0x12d3b8[_0xc76d('0x30')]);_0x39309a['attributes']=_['intersection'](_0x12d3b8[_0xc76d('0x2e')],qs[_0xc76d('0x33')](_0x23cd05[_0xc76d('0x30')][_0xc76d('0x33')]));_0x39309a['attributes']=_0x39309a[_0xc76d('0x34')][_0xc76d('0x35')]?_0x39309a[_0xc76d('0x34')]:_0x12d3b8['model'];if(!_0x23cd05['query'][_0xc76d('0x36')](_0xc76d('0x37'))){_0x39309a[_0xc76d('0x20')]=qs['limit'](_0x23cd05['query'][_0xc76d('0x20')]);_0x39309a[_0xc76d('0x1e')]=qs['offset'](_0x23cd05[_0xc76d('0x30')][_0xc76d('0x1e')]);}_0x39309a[_0xc76d('0x38')]=qs[_0xc76d('0x39')](_0x23cd05[_0xc76d('0x30')][_0xc76d('0x39')]);_0x39309a[_0xc76d('0x3a')]=qs[_0xc76d('0x31')](_[_0xc76d('0x3b')](_0x23cd05[_0xc76d('0x30')],_0x12d3b8[_0xc76d('0x31')]),_0x243930);if(_0x23cd05['query'][_0xc76d('0x3c')]){_0x39309a[_0xc76d('0x3a')]=_[_0xc76d('0x3d')](_0x39309a[_0xc76d('0x3a')],{'$or':_[_0xc76d('0x3e')](_0x243930,function(_0x36ddcb){if(_0x36ddcb['type']!=='VIRTUAL'){var _0x26c28d={};_0x26c28d[_0x36ddcb['name']]={'$like':'%'+_0x23cd05[_0xc76d('0x30')]['filter']+'%'};return _0x26c28d;}})});}_0x39309a=_['merge']({},_0x39309a,_0x23cd05['options']);var _0x1f362a={'where':_0x39309a[_0xc76d('0x3a')]};return db[_0xc76d('0x3f')]['count'](_0x1f362a)[_0xc76d('0x26')](function(_0x1a3b14){_0xce3d9d[_0xc76d('0x21')]=_0x1a3b14;if(_0x23cd05['query']['includeAll']){_0x39309a[_0xc76d('0x40')]=[{'all':!![]}];}return db['FreshsalesField'][_0xc76d('0x41')](_0x39309a);})[_0xc76d('0x26')](function(_0x3453b1){_0xce3d9d[_0xc76d('0x42')]=_0x3453b1;return _0xce3d9d;})[_0xc76d('0x26')](respondWithFilteredResult(_0x7f6494,_0x39309a))[_0xc76d('0x43')](handleError(_0x7f6494,null));};exports[_0xc76d('0x44')]=function(_0xf624ec,_0x25ac04){var _0x39bb9e={'raw':!![],'where':{'id':_0xf624ec['params']['id']}},_0x599091={};_0x599091[_0xc76d('0x2e')]=_['keys'](db[_0xc76d('0x3f')][_0xc76d('0x2d')]);_0x599091[_0xc76d('0x30')]=_[_0xc76d('0x2f')](_0xf624ec[_0xc76d('0x30')]);_0x599091[_0xc76d('0x31')]=_[_0xc76d('0x32')](_0x599091['model'],_0x599091[_0xc76d('0x30')]);_0x39bb9e['attributes']=_[_0xc76d('0x32')](_0x599091[_0xc76d('0x2e')],qs['fields'](_0xf624ec[_0xc76d('0x30')][_0xc76d('0x33')]));_0x39bb9e[_0xc76d('0x34')]=_0x39bb9e[_0xc76d('0x34')][_0xc76d('0x35')]?_0x39bb9e[_0xc76d('0x34')]:_0x599091[_0xc76d('0x2e')];if(_0xf624ec[_0xc76d('0x30')][_0xc76d('0x45')]){_0x39bb9e[_0xc76d('0x40')]=[{'all':!![]}];}_0x39bb9e=_['merge']({},_0x39bb9e,_0xf624ec[_0xc76d('0x46')]);return db['FreshsalesField']['find'](_0x39bb9e)['then'](handleEntityNotFound(_0x25ac04,null))[_0xc76d('0x26')](respondWithResult(_0x25ac04,null))['catch'](handleError(_0x25ac04,null));};exports[_0xc76d('0x47')]=function(_0x337a28,_0x59bc9b){return db[_0xc76d('0x3f')][_0xc76d('0x47')](_0x337a28[_0xc76d('0x48')],{})[_0xc76d('0x26')](respondWithResult(_0x59bc9b,0xc9))[_0xc76d('0x43')](handleError(_0x59bc9b,null));};exports['update']=function(_0x56fb34,_0x4fdbcf){if(_0x56fb34[_0xc76d('0x48')]['id']){delete _0x56fb34['body']['id'];}return db[_0xc76d('0x3f')][_0xc76d('0x49')]({'where':{'id':_0x56fb34[_0xc76d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4fdbcf,null))[_0xc76d('0x26')](saveUpdates(_0x56fb34[_0xc76d('0x48')],null))['then'](respondWithResult(_0x4fdbcf,null))[_0xc76d('0x43')](handleError(_0x4fdbcf,null));};exports[_0xc76d('0x27')]=function(_0x546ea2,_0x5b8c2c){return db[_0xc76d('0x3f')][_0xc76d('0x49')]({'where':{'id':_0x546ea2[_0xc76d('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5b8c2c,null))[_0xc76d('0x26')](removeEntity(_0x5b8c2c,null))[_0xc76d('0x43')](handleError(_0x5b8c2c,null));}; \ No newline at end of file +var _0x3c4a=['moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','FreshsalesField','includeAll','include','findAll','rows','show','params','intersection','options','find','create','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x1e3a29,_0x41e70c){var _0x2afdb2=function(_0x38e843){while(--_0x38e843){_0x1e3a29['push'](_0x1e3a29['shift']());}};_0x2afdb2(++_0x41e70c);}(_0x3c4a,0x1e2));var _0xa3c4=function(_0x59a0e4,_0x492f2c){_0x59a0e4=_0x59a0e4-0x0;var _0x64e2f9=_0x3c4a[_0x59a0e4];return _0x64e2f9;};'use strict';var emlformat=require(_0xa3c4('0x0'));var rimraf=require(_0xa3c4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa3c4('0x2'));var rp=require(_0xa3c4('0x3'));var moment=require(_0xa3c4('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa3c4('0x5'));var util=require(_0xa3c4('0x6'));var path=require(_0xa3c4('0x7'));var sox=require(_0xa3c4('0x8'));var csv=require(_0xa3c4('0x9'));var ejs=require(_0xa3c4('0xa'));var fs=require('fs');var fs_extra=require(_0xa3c4('0xb'));var _=require(_0xa3c4('0xc'));var squel=require(_0xa3c4('0xd'));var crypto=require(_0xa3c4('0xe'));var jsforce=require(_0xa3c4('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xa3c4('0x9'));var querystring=require(_0xa3c4('0x10'));var Papa=require(_0xa3c4('0x11'));var Redis=require(_0xa3c4('0x12'));var authService=require(_0xa3c4('0x13'));var qs=require(_0xa3c4('0x14'));var as=require(_0xa3c4('0x15'));var hardwareService=require(_0xa3c4('0x16'));var logger=require(_0xa3c4('0x17'))(_0xa3c4('0x18'));var utils=require(_0xa3c4('0x19'));var config=require('../../config/environment');var licenseUtil=require(_0xa3c4('0x1a'));var db=require(_0xa3c4('0x1b'))['db'];function respondWithStatusCode(_0x37217e,_0x2b7ca7){_0x2b7ca7=_0x2b7ca7||0xcc;return function(_0x580cc7){if(_0x580cc7){return _0x37217e[_0xa3c4('0x1c')](_0x2b7ca7);}return _0x37217e['status'](_0x2b7ca7)[_0xa3c4('0x1d')]();};}function respondWithResult(_0x58801c,_0x3b89f2){_0x3b89f2=_0x3b89f2||0xc8;return function(_0x174264){if(_0x174264){return _0x58801c[_0xa3c4('0x1e')](_0x3b89f2)[_0xa3c4('0x1f')](_0x174264);}};}function respondWithFilteredResult(_0x37ce11,_0x6ab047){return function(_0x35cb22){if(_0x35cb22){var _0xc77415=typeof _0x6ab047[_0xa3c4('0x20')]==='undefined'&&typeof _0x6ab047[_0xa3c4('0x21')]===_0xa3c4('0x22');var _0x58f4a7=_0x35cb22[_0xa3c4('0x23')];var _0x6d5cc7=_0xc77415?0x0:_0x6ab047['offset'];var _0x4cb576=_0xc77415?_0x35cb22['count']:_0x6ab047[_0xa3c4('0x20')]+_0x6ab047[_0xa3c4('0x21')];var _0x26f693;if(_0x4cb576>=_0x58f4a7){_0x4cb576=_0x58f4a7;_0x26f693=0xc8;}else{_0x26f693=0xce;}_0x37ce11['status'](_0x26f693);return _0x37ce11[_0xa3c4('0x24')](_0xa3c4('0x25'),_0x6d5cc7+'-'+_0x4cb576+'/'+_0x58f4a7)['json'](_0x35cb22);}return null;};}function patchUpdates(_0x6c7446){return function(_0x56c61a){try{jsonpatch[_0xa3c4('0x26')](_0x56c61a,_0x6c7446,!![]);}catch(_0x534c80){return BPromise['reject'](_0x534c80);}return _0x56c61a[_0xa3c4('0x27')]();};}function saveUpdates(_0x959436,_0x10ee42){return function(_0x5b4d6b){if(_0x5b4d6b){return _0x5b4d6b[_0xa3c4('0x28')](_0x959436)[_0xa3c4('0x29')](function(_0x17489f){return _0x17489f;});}return null;};}function removeEntity(_0x80ba29,_0x47b7e5){return function(_0x10d06a){if(_0x10d06a){return _0x10d06a['destroy']()[_0xa3c4('0x29')](function(){_0x80ba29[_0xa3c4('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b94a5,_0x387bf1){return function(_0x177e93){if(!_0x177e93){_0x4b94a5[_0xa3c4('0x1c')](0x194);}return _0x177e93;};}function handleError(_0x35643b,_0x25a649){_0x25a649=_0x25a649||0x1f4;return function(_0x321a7f){logger[_0xa3c4('0x2a')](_0x321a7f[_0xa3c4('0x2b')]);if(_0x321a7f[_0xa3c4('0x2c')]){delete _0x321a7f['name'];}_0x35643b[_0xa3c4('0x1e')](_0x25a649)[_0xa3c4('0x2d')](_0x321a7f);};}exports[_0xa3c4('0x2e')]=function(_0xe2ee5f,_0x5f2561){var _0x17adb0={},_0x4c9b7f={},_0x37704c={'count':0x0,'rows':[]};var _0x52d7e1=_[_0xa3c4('0x2f')](db['FreshsalesField'][_0xa3c4('0x30')],function(_0x3f290a){return{'name':_0x3f290a[_0xa3c4('0x31')],'type':_0x3f290a[_0xa3c4('0x32')][_0xa3c4('0x33')]};});_0x4c9b7f[_0xa3c4('0x34')]=_[_0xa3c4('0x2f')](_0x52d7e1,_0xa3c4('0x2c'));_0x4c9b7f[_0xa3c4('0x35')]=_[_0xa3c4('0x36')](_0xe2ee5f['query']);_0x4c9b7f[_0xa3c4('0x37')]=_['intersection'](_0x4c9b7f[_0xa3c4('0x34')],_0x4c9b7f['query']);_0x17adb0[_0xa3c4('0x38')]=_['intersection'](_0x4c9b7f[_0xa3c4('0x34')],qs[_0xa3c4('0x39')](_0xe2ee5f[_0xa3c4('0x35')][_0xa3c4('0x39')]));_0x17adb0['attributes']=_0x17adb0[_0xa3c4('0x38')][_0xa3c4('0x3a')]?_0x17adb0['attributes']:_0x4c9b7f['model'];if(!_0xe2ee5f[_0xa3c4('0x35')][_0xa3c4('0x3b')]('nolimit')){_0x17adb0[_0xa3c4('0x21')]=qs[_0xa3c4('0x21')](_0xe2ee5f[_0xa3c4('0x35')][_0xa3c4('0x21')]);_0x17adb0[_0xa3c4('0x20')]=qs[_0xa3c4('0x20')](_0xe2ee5f['query'][_0xa3c4('0x20')]);}_0x17adb0[_0xa3c4('0x3c')]=qs['sort'](_0xe2ee5f[_0xa3c4('0x35')][_0xa3c4('0x3d')]);_0x17adb0[_0xa3c4('0x3e')]=qs['filters'](_[_0xa3c4('0x3f')](_0xe2ee5f[_0xa3c4('0x35')],_0x4c9b7f[_0xa3c4('0x37')]),_0x52d7e1);if(_0xe2ee5f[_0xa3c4('0x35')]['filter']){_0x17adb0['where']=_[_0xa3c4('0x40')](_0x17adb0[_0xa3c4('0x3e')],{'$or':_[_0xa3c4('0x2f')](_0x52d7e1,function(_0x4ce2fe){if(_0x4ce2fe[_0xa3c4('0x32')]!==_0xa3c4('0x41')){var _0x175e86={};_0x175e86[_0x4ce2fe['name']]={'$like':'%'+_0xe2ee5f[_0xa3c4('0x35')][_0xa3c4('0x42')]+'%'};return _0x175e86;}})});}_0x17adb0=_[_0xa3c4('0x40')]({},_0x17adb0,_0xe2ee5f['options']);var _0x1947b8={'where':_0x17adb0[_0xa3c4('0x3e')]};return db[_0xa3c4('0x43')][_0xa3c4('0x23')](_0x1947b8)[_0xa3c4('0x29')](function(_0x12e696){_0x37704c[_0xa3c4('0x23')]=_0x12e696;if(_0xe2ee5f['query'][_0xa3c4('0x44')]){_0x17adb0[_0xa3c4('0x45')]=[{'all':!![]}];}return db[_0xa3c4('0x43')][_0xa3c4('0x46')](_0x17adb0);})['then'](function(_0x2c3659){_0x37704c[_0xa3c4('0x47')]=_0x2c3659;return _0x37704c;})[_0xa3c4('0x29')](respondWithFilteredResult(_0x5f2561,_0x17adb0))['catch'](handleError(_0x5f2561,null));};exports[_0xa3c4('0x48')]=function(_0x3b4014,_0x4454c7){var _0x39c54f={'raw':!![],'where':{'id':_0x3b4014[_0xa3c4('0x49')]['id']}},_0x2446b9={};_0x2446b9[_0xa3c4('0x34')]=_[_0xa3c4('0x36')](db[_0xa3c4('0x43')][_0xa3c4('0x30')]);_0x2446b9[_0xa3c4('0x35')]=_[_0xa3c4('0x36')](_0x3b4014[_0xa3c4('0x35')]);_0x2446b9['filters']=_[_0xa3c4('0x4a')](_0x2446b9['model'],_0x2446b9[_0xa3c4('0x35')]);_0x39c54f['attributes']=_[_0xa3c4('0x4a')](_0x2446b9['model'],qs[_0xa3c4('0x39')](_0x3b4014['query'][_0xa3c4('0x39')]));_0x39c54f['attributes']=_0x39c54f[_0xa3c4('0x38')][_0xa3c4('0x3a')]?_0x39c54f[_0xa3c4('0x38')]:_0x2446b9[_0xa3c4('0x34')];if(_0x3b4014[_0xa3c4('0x35')][_0xa3c4('0x44')]){_0x39c54f[_0xa3c4('0x45')]=[{'all':!![]}];}_0x39c54f=_[_0xa3c4('0x40')]({},_0x39c54f,_0x3b4014[_0xa3c4('0x4b')]);return db['FreshsalesField'][_0xa3c4('0x4c')](_0x39c54f)[_0xa3c4('0x29')](handleEntityNotFound(_0x4454c7,null))[_0xa3c4('0x29')](respondWithResult(_0x4454c7,null))['catch'](handleError(_0x4454c7,null));};exports[_0xa3c4('0x4d')]=function(_0x4ad0d5,_0x5d1cbe){return db[_0xa3c4('0x43')]['create'](_0x4ad0d5['body'],{})[_0xa3c4('0x29')](respondWithResult(_0x5d1cbe,0xc9))[_0xa3c4('0x4e')](handleError(_0x5d1cbe,null));};exports['update']=function(_0x38f05b,_0xefc514){if(_0x38f05b['body']['id']){delete _0x38f05b['body']['id'];}return db[_0xa3c4('0x43')][_0xa3c4('0x4c')]({'where':{'id':_0x38f05b[_0xa3c4('0x49')]['id']}})[_0xa3c4('0x29')](handleEntityNotFound(_0xefc514,null))[_0xa3c4('0x29')](saveUpdates(_0x38f05b[_0xa3c4('0x4f')],null))[_0xa3c4('0x29')](respondWithResult(_0xefc514,null))[_0xa3c4('0x4e')](handleError(_0xefc514,null));};exports[_0xa3c4('0x50')]=function(_0x196c5d,_0x8808dd){return db[_0xa3c4('0x43')]['find']({'where':{'id':_0x196c5d['params']['id']}})['then'](handleEntityNotFound(_0x8808dd,null))[_0xa3c4('0x29')](removeEntity(_0x8808dd,null))[_0xa3c4('0x4e')](handleError(_0x8808dd,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 3f29914..b72981a 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 _0xd5fc=['../../config/environment','exports','define','idField','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x1f5143,_0x5e31e6){var _0x383a38=function(_0x2c123c){while(--_0x2c123c){_0x1f5143['push'](_0x1f5143['shift']());}};_0x383a38(++_0x5e31e6);}(_0xd5fc,0xae));var _0xcd5f=function(_0x3ccaf5,_0x3a7c98){_0x3ccaf5=_0x3ccaf5-0x0;var _0x2c2009=_0xd5fc[_0x3ccaf5];return _0x2c2009;};'use strict';var _=require(_0xcd5f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcd5f('0x1'));var BPromise=require(_0xcd5f('0x2'));var rp=require(_0xcd5f('0x3'));var fs=require('fs');var path=require(_0xcd5f('0x4'));var rimraf=require(_0xcd5f('0x5'));var config=require(_0xcd5f('0x6'));var attributes=require('./intFreshsalesField.attributes');module[_0xcd5f('0x7')]=function(_0x4b4ca8,_0x95b8bb){return _0x4b4ca8[_0xcd5f('0x8')]('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0xcd5f('0x9'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfd7b=['FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','FreshsalesField','int_freshsales_fields','freshsales_unique_index'];(function(_0x2de826,_0x35d536){var _0x59bc0e=function(_0x2495d8){while(--_0x2495d8){_0x2de826['push'](_0x2de826['shift']());}};_0x59bc0e(++_0x35d536);}(_0xfd7b,0xd1));var _0xbfd7=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0xfd7b[_0x39d544];return _0x5a5ff2;};'use strict';var _=require(_0xbfd7('0x0'));var util=require(_0xbfd7('0x1'));var logger=require(_0xbfd7('0x2'))('api');var moment=require(_0xbfd7('0x3'));var BPromise=require(_0xbfd7('0x4'));var rp=require(_0xbfd7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbfd7('0x6'));var config=require(_0xbfd7('0x7'));var attributes=require(_0xbfd7('0x8'));module['exports']=function(_0x134ee5,_0x3d054f){return _0x134ee5['define'](_0xbfd7('0x9'),attributes,{'tableName':_0xbfd7('0xa'),'paranoid':![],'indexes':[{'name':_0xbfd7('0xb'),'fields':['idField',_0xbfd7('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 7f6330c..28b8d00 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 _0x9536=['request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','FreshsalesField,\x20%s,\x20%s'];(function(_0x8cd5c3,_0x5542d5){var _0xb9e679=function(_0x11160a){while(--_0x11160a){_0x8cd5c3['push'](_0x8cd5c3['shift']());}};_0xb9e679(++_0x5542d5);}(_0x9536,0x179));var _0x6953=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0x9536[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb026,_0x385f2d,_0x3e1aff){return new BPromise(function(_0x1c8225,_0x58ac30){return client[_0x6953('0xb')](_0x2bb026,_0x3e1aff)[_0x6953('0xc')](function(_0x449acb){logger['info'](_0x6953('0xd'),_0x385f2d,_0x6953('0xe'));logger[_0x6953('0xf')](_0x6953('0x10'),_0x385f2d,_0x6953('0xe'),JSON[_0x6953('0x11')](_0x449acb));if(_0x449acb[_0x6953('0x12')]){if(_0x449acb[_0x6953('0x12')][_0x6953('0x13')]===0x1f4){logger['error'](_0x6953('0xd'),_0x385f2d,_0x449acb['error'][_0x6953('0x14')]);return _0x58ac30(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}logger[_0x6953('0x12')](_0x6953('0xd'),_0x385f2d,_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);return _0x1c8225(_0x449acb[_0x6953('0x12')][_0x6953('0x14')]);}else{logger[_0x6953('0x15')](_0x6953('0xd'),_0x385f2d,'request\x20sent');_0x1c8225(_0x449acb['result'][_0x6953('0x14')]);}})[_0x6953('0x16')](function(_0x16b79b){logger[_0x6953('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x385f2d,_0x16b79b);_0x58ac30(_0x16b79b);});});} \ No newline at end of file +var _0x5d58=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x10d6f5,_0x140245){var _0x484db4=function(_0x2f7ec4){while(--_0x2f7ec4){_0x10d6f5['push'](_0x10d6f5['shift']());}};_0x484db4(++_0x140245);}(_0x5d58,0x187));var _0x85d5=function(_0x344ccf,_0x5027c5){_0x344ccf=_0x344ccf-0x0;var _0x51c204=_0x5d58[_0x344ccf];return _0x51c204;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46e7b4,_0x5f47ec,_0x98c963){return new BPromise(function(_0x3fecca,_0x4ca293){return client[_0x85d5('0x7')](_0x46e7b4,_0x98c963)['then'](function(_0x1098be){logger[_0x85d5('0x8')](_0x85d5('0x9'),_0x5f47ec,'request\x20sent');logger['debug']('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x5f47ec,_0x85d5('0xa'),JSON[_0x85d5('0xb')](_0x1098be));if(_0x1098be[_0x85d5('0xc')]){if(_0x1098be[_0x85d5('0xc')][_0x85d5('0xd')]===0x1f4){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be['error']['message']);return _0x4ca293(_0x1098be['error'][_0x85d5('0xe')]);}logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);return _0x3fecca(_0x1098be[_0x85d5('0xc')][_0x85d5('0xe')]);}else{logger['info'](_0x85d5('0x9'),_0x5f47ec,_0x85d5('0xa'));_0x3fecca(_0x1098be[_0x85d5('0xf')][_0x85d5('0xe')]);}})[_0x85d5('0x10')](function(_0x3dc83c){logger[_0x85d5('0xc')](_0x85d5('0x9'),_0x5f47ec,_0x3dc83c);_0x4ca293(_0x3dc83c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 85769f9..f57ac39 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(_0x42dfd1,_0x13f4d4){var _0x3b573c=function(_0x4de267){while(--_0x4de267){_0x42dfd1['push'](_0x42dfd1['shift']());}};_0x3b573c(++_0x13f4d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0xc56a75,_0x39d0b5){var _0x2dd783=function(_0x53652f){while(--_0x53652f){_0xc56a75['push'](_0xc56a75['shift']());}};_0x2dd783(++_0x39d0b5);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 0945e6a..7848b0e 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 _0x5630=['sequelize','exports','STRING','newTab','integrationTab'];(function(_0x5007dc,_0x26e8ed){var _0x145fb2=function(_0x5e5afc){while(--_0x5e5afc){_0x5007dc['push'](_0x5007dc['shift']());}};_0x145fb2(++_0x26e8ed);}(_0x5630,0xc3));var _0x0563=function(_0x41597d,_0x17cf39){_0x41597d=_0x41597d-0x0;var _0x1b987f=_0x5630[_0x41597d];return _0x1b987f;};'use strict';var Sequelize=require(_0x0563('0x0'));module[_0x0563('0x1')]={'name':{'type':Sequelize[_0x0563('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':'username'},'remoteUri':{'type':Sequelize[_0x0563('0x2')]},'password':{'type':Sequelize[_0x0563('0x2')]},'clientId':{'type':Sequelize[_0x0563('0x2')]},'clientSecret':{'type':Sequelize[_0x0563('0x2')]},'securityToken':{'type':Sequelize[_0x0563('0x2')]},'serverUrl':{'type':Sequelize[_0x0563('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0x0563('0x3')),'defaultValue':_0x0563('0x4')}}; \ No newline at end of file +var _0xb366=['STRING','username','ENUM','newTab','sequelize'];(function(_0x38702c,_0x57f5d3){var _0x5ccb20=function(_0x4b300a){while(--_0x4b300a){_0x38702c['push'](_0x38702c['shift']());}};_0x5ccb20(++_0x57f5d3);}(_0xb366,0xa4));var _0x6b36=function(_0x2e7a52,_0x1f203f){_0x2e7a52=_0x2e7a52-0x0;var _0x527587=_0xb366[_0x2e7a52];return _0x527587;};'use strict';var Sequelize=require(_0x6b36('0x0'));module['exports']={'name':{'type':Sequelize[_0x6b36('0x1')]},'description':{'type':Sequelize[_0x6b36('0x1')]},'username':{'type':Sequelize['STRING'],'unique':_0x6b36('0x2')},'remoteUri':{'type':Sequelize[_0x6b36('0x1')]},'password':{'type':Sequelize[_0x6b36('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x6b36('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x6b36('0x3')]('integrationTab',_0x6b36('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 06c578c..b511634 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 _0x219d=['reject','save','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','update','body','destroy','getConfigurations','findOne','SalesforceConfiguration','nolimit','addConfiguration','AccountId','getSubjects','Descriptions','Subjects','getFields','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','lastIndexOf','Connection','login','concat','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsReminderSet','Subject','int','picklist','boolean','email','phone','includes','label','custom','picklistValues','value','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','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','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply'];(function(_0x51dae5,_0x5f388a){var _0x1135fe=function(_0x374ba5){while(--_0x374ba5){_0x51dae5['push'](_0x51dae5['shift']());}};_0x1135fe(++_0x5f388a);}(_0x219d,0x15b));var _0xd219=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x219d[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd219('0x0'));var zipdir=require(_0xd219('0x1'));var jsonpatch=require(_0xd219('0x2'));var rp=require(_0xd219('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd219('0x4'));var util=require(_0xd219('0x5'));var path=require(_0xd219('0x6'));var sox=require(_0xd219('0x7'));var csv=require('to-csv');var ejs=require(_0xd219('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd219('0x9'));var squel=require(_0xd219('0xa'));var crypto=require(_0xd219('0xb'));var jsforce=require(_0xd219('0xc'));var deskjs=require(_0xd219('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd219('0xe'));var Papa=require(_0xd219('0xf'));var Redis=require(_0xd219('0x10'));var authService=require(_0xd219('0x11'));var qs=require(_0xd219('0x12'));var as=require(_0xd219('0x13'));var hardwareService=require(_0xd219('0x14'));var logger=require(_0xd219('0x15'))(_0xd219('0x16'));var utils=require(_0xd219('0x17'));var config=require(_0xd219('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xd219('0x19'))['db'];var integrations=require(_0xd219('0x1a'));function respondWithStatusCode(_0x54b19e,_0x39f376){_0x39f376=_0x39f376||0xcc;return function(_0x4be870){if(_0x4be870){return _0x54b19e[_0xd219('0x1b')](_0x39f376);}return _0x54b19e[_0xd219('0x1c')](_0x39f376)[_0xd219('0x1d')]();};}function respondWithResult(_0x297f57,_0x474b63){_0x474b63=_0x474b63||0xc8;return function(_0x1aaac8){if(_0x1aaac8){return _0x297f57[_0xd219('0x1c')](_0x474b63)[_0xd219('0x1e')](_0x1aaac8);}};}function respondWithFilteredResult(_0x33fa4d,_0x833091){return function(_0x4fd935){if(_0x4fd935){var _0x38d820=typeof _0x833091[_0xd219('0x1f')]===_0xd219('0x20')&&typeof _0x833091[_0xd219('0x21')]===_0xd219('0x20');var _0x2a71cb=_0x4fd935[_0xd219('0x22')];var _0x511cb6=_0x38d820?0x0:_0x833091[_0xd219('0x1f')];var _0x2043d6=_0x38d820?_0x4fd935[_0xd219('0x22')]:_0x833091[_0xd219('0x1f')]+_0x833091['limit'];var _0x1c49f7;if(_0x2043d6>=_0x2a71cb){_0x2043d6=_0x2a71cb;_0x1c49f7=0xc8;}else{_0x1c49f7=0xce;}_0x33fa4d[_0xd219('0x1c')](_0x1c49f7);return _0x33fa4d['set'](_0xd219('0x23'),_0x511cb6+'-'+_0x2043d6+'/'+_0x2a71cb)['json'](_0x4fd935);}return null;};}function patchUpdates(_0x4bcdf0){return function(_0x332dd9){try{jsonpatch[_0xd219('0x24')](_0x332dd9,_0x4bcdf0,!![]);}catch(_0x346a84){return BPromise[_0xd219('0x25')](_0x346a84);}return _0x332dd9[_0xd219('0x26')]();};}function saveUpdates(_0x5a081d,_0x3300c2){return function(_0x2591d2){if(_0x2591d2){return _0x2591d2['update'](_0x5a081d)['then'](function(_0x36da09){return _0x36da09;});}return null;};}function removeEntity(_0x5a5673,_0x2a0c93){return function(_0x359232){if(_0x359232){return _0x359232['destroy']()['then'](function(){_0x5a5673[_0xd219('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10b2a1,_0x528c6b){return function(_0x41f70a){if(!_0x41f70a){_0x10b2a1['sendStatus'](0x194);}return _0x41f70a;};}function handleError(_0x1cc34f,_0xdf1da5){_0xdf1da5=_0xdf1da5||0x1f4;return function(_0x226ad6){logger[_0xd219('0x27')](_0x226ad6[_0xd219('0x28')]);if(_0x226ad6[_0xd219('0x29')]){delete _0x226ad6['name'];}_0x1cc34f['status'](_0xdf1da5)['send'](_0x226ad6);};}exports[_0xd219('0x2a')]=function(_0x9350d5,_0x4c290d){var _0x2380c2={},_0x51a9cf={},_0x359cdc={'count':0x0,'rows':[]};var _0x16f605=_[_0xd219('0x2b')](db[_0xd219('0x2c')][_0xd219('0x2d')],function(_0x9af44b){return{'name':_0x9af44b[_0xd219('0x2e')],'type':_0x9af44b[_0xd219('0x2f')][_0xd219('0x30')]};});_0x51a9cf[_0xd219('0x31')]=_[_0xd219('0x2b')](_0x16f605,_0xd219('0x29'));_0x51a9cf[_0xd219('0x32')]=_[_0xd219('0x33')](_0x9350d5['query']);_0x51a9cf['filters']=_[_0xd219('0x34')](_0x51a9cf[_0xd219('0x31')],_0x51a9cf[_0xd219('0x32')]);_0x2380c2[_0xd219('0x35')]=_[_0xd219('0x34')](_0x51a9cf[_0xd219('0x31')],qs[_0xd219('0x36')](_0x9350d5[_0xd219('0x32')][_0xd219('0x36')]));_0x2380c2[_0xd219('0x35')]=_0x2380c2[_0xd219('0x35')][_0xd219('0x37')]?_0x2380c2[_0xd219('0x35')]:_0x51a9cf[_0xd219('0x31')];if(!_0x9350d5[_0xd219('0x32')][_0xd219('0x38')]('nolimit')){_0x2380c2[_0xd219('0x21')]=qs['limit'](_0x9350d5[_0xd219('0x32')]['limit']);_0x2380c2[_0xd219('0x1f')]=qs[_0xd219('0x1f')](_0x9350d5[_0xd219('0x32')][_0xd219('0x1f')]);}_0x2380c2[_0xd219('0x39')]=qs[_0xd219('0x3a')](_0x9350d5['query'][_0xd219('0x3a')]);_0x2380c2[_0xd219('0x3b')]=qs[_0xd219('0x3c')](_[_0xd219('0x3d')](_0x9350d5[_0xd219('0x32')],_0x51a9cf['filters']),_0x16f605);if(_0x9350d5[_0xd219('0x32')][_0xd219('0x3e')]){_0x2380c2[_0xd219('0x3b')]=_[_0xd219('0x3f')](_0x2380c2[_0xd219('0x3b')],{'$or':_[_0xd219('0x2b')](_0x16f605,function(_0x122785){if(_0x122785[_0xd219('0x2f')]!==_0xd219('0x40')){var _0x3cf384={};_0x3cf384[_0x122785['name']]={'$like':'%'+_0x9350d5[_0xd219('0x32')][_0xd219('0x3e')]+'%'};return _0x3cf384;}})});}_0x2380c2=_[_0xd219('0x3f')]({},_0x2380c2,_0x9350d5[_0xd219('0x41')]);var _0x13aa47={'where':_0x2380c2['where']};return db[_0xd219('0x2c')][_0xd219('0x22')](_0x13aa47)[_0xd219('0x42')](function(_0x3624bb){_0x359cdc[_0xd219('0x22')]=_0x3624bb;if(_0x9350d5[_0xd219('0x32')][_0xd219('0x43')]){_0x2380c2[_0xd219('0x44')]=[{'all':!![]}];}return db[_0xd219('0x2c')][_0xd219('0x45')](_0x2380c2);})[_0xd219('0x42')](function(_0x1eebf2){_0x359cdc[_0xd219('0x46')]=_0x1eebf2;return _0x359cdc;})[_0xd219('0x42')](respondWithFilteredResult(_0x4c290d,_0x2380c2))[_0xd219('0x47')](handleError(_0x4c290d,null));};exports[_0xd219('0x48')]=function(_0x5b4c85,_0x46c9c3){var _0xd1ee28={'raw':![],'where':{'id':_0x5b4c85[_0xd219('0x49')]['id']}},_0x301e26={};_0x301e26[_0xd219('0x31')]=_[_0xd219('0x33')](db[_0xd219('0x2c')][_0xd219('0x2d')]);_0x301e26[_0xd219('0x32')]=_[_0xd219('0x33')](_0x5b4c85[_0xd219('0x32')]);_0x301e26[_0xd219('0x3c')]=_[_0xd219('0x34')](_0x301e26['model'],_0x301e26['query']);_0xd1ee28[_0xd219('0x35')]=_[_0xd219('0x34')](_0x301e26[_0xd219('0x31')],qs[_0xd219('0x36')](_0x5b4c85[_0xd219('0x32')][_0xd219('0x36')]));_0xd1ee28[_0xd219('0x35')]=_0xd1ee28[_0xd219('0x35')][_0xd219('0x37')]?_0xd1ee28[_0xd219('0x35')]:_0x301e26['model'];if(_0x5b4c85[_0xd219('0x32')]['includeAll']){_0xd1ee28['include']=[{'all':!![]}];}_0xd1ee28=_[_0xd219('0x3f')]({},_0xd1ee28,_0x5b4c85[_0xd219('0x41')]);return db['SalesforceAccount'][_0xd219('0x4a')](_0xd1ee28)[_0xd219('0x42')](handleEntityNotFound(_0x46c9c3,null))['then'](respondWithResult(_0x46c9c3,null))['catch'](handleError(_0x46c9c3,null));};exports[_0xd219('0x4b')]=function(_0x4c95e3,_0x2d303f){return db['SalesforceAccount'][_0xd219('0x4b')](_0x4c95e3['body'],{})[_0xd219('0x42')](respondWithResult(_0x2d303f,0xc9))[_0xd219('0x47')](handleError(_0x2d303f,null));};exports[_0xd219('0x4c')]=function(_0x483055,_0x2843f7){if(_0x483055[_0xd219('0x4d')]['id']){delete _0x483055[_0xd219('0x4d')]['id'];}return db['SalesforceAccount']['find']({'where':{'id':_0x483055[_0xd219('0x49')]['id']}})[_0xd219('0x42')](handleEntityNotFound(_0x2843f7,null))[_0xd219('0x42')](saveUpdates(_0x483055[_0xd219('0x4d')],null))[_0xd219('0x42')](respondWithResult(_0x2843f7,null))[_0xd219('0x47')](handleError(_0x2843f7,null));};exports[_0xd219('0x4e')]=function(_0x368f57,_0x55766a){return db[_0xd219('0x2c')][_0xd219('0x4a')]({'where':{'id':_0x368f57[_0xd219('0x49')]['id']}})['then'](handleEntityNotFound(_0x55766a,null))[_0xd219('0x42')](removeEntity(_0x55766a,null))['catch'](handleError(_0x55766a,null));};exports[_0xd219('0x4f')]=function(_0x575c14,_0x404d46,_0x9cfedb){var _0x4b1418={};var _0x97087c={};var _0x206d9c;var _0x1cfe09;return db['SalesforceAccount'][_0xd219('0x50')]({'where':{'id':_0x575c14[_0xd219('0x49')]['id']}})['then'](handleEntityNotFound(_0x404d46,null))[_0xd219('0x42')](function(_0xf43799){if(_0xf43799){_0x206d9c=_0xf43799;_0x97087c[_0xd219('0x31')]=_['keys'](db[_0xd219('0x51')][_0xd219('0x2d')]);_0x97087c[_0xd219('0x32')]=_[_0xd219('0x33')](_0x575c14[_0xd219('0x32')]);_0x97087c[_0xd219('0x3c')]=_[_0xd219('0x34')](_0x97087c[_0xd219('0x31')],_0x97087c[_0xd219('0x32')]);_0x4b1418[_0xd219('0x35')]=_[_0xd219('0x34')](_0x97087c[_0xd219('0x31')],qs[_0xd219('0x36')](_0x575c14[_0xd219('0x32')][_0xd219('0x36')]));_0x4b1418[_0xd219('0x35')]=_0x4b1418[_0xd219('0x35')]['length']?_0x4b1418[_0xd219('0x35')]:_0x97087c['model'];_0x4b1418['order']=qs[_0xd219('0x3a')](_0x575c14[_0xd219('0x32')][_0xd219('0x3a')]);_0x4b1418[_0xd219('0x3b')]=qs['filters'](_[_0xd219('0x3d')](_0x575c14[_0xd219('0x32')],_0x97087c[_0xd219('0x3c')]));if(_0x575c14[_0xd219('0x32')]['filter']){_0x4b1418[_0xd219('0x3b')]=_['merge'](_0x4b1418[_0xd219('0x3b')],{'$or':_['map'](_0x4b1418[_0xd219('0x35')],function(_0x796491){var _0x577929={};_0x577929[_0x796491]={'$like':'%'+_0x575c14[_0xd219('0x32')][_0xd219('0x3e')]+'%'};return _0x577929;})});}_0x4b1418=_[_0xd219('0x3f')]({},_0x4b1418,_0x575c14[_0xd219('0x41')]);return _0x206d9c[_0xd219('0x4f')](_0x4b1418);}})[_0xd219('0x42')](function(_0x5b6155){if(_0x5b6155){_0x1cfe09=_0x5b6155[_0xd219('0x37')];if(!_0x575c14[_0xd219('0x32')][_0xd219('0x38')](_0xd219('0x52'))){_0x4b1418['limit']=qs['limit'](_0x575c14[_0xd219('0x32')][_0xd219('0x21')]);_0x4b1418['offset']=qs[_0xd219('0x1f')](_0x575c14[_0xd219('0x32')]['offset']);}return _0x206d9c['getConfigurations'](_0x4b1418);}})[_0xd219('0x42')](function(_0x275d5b){if(_0x275d5b){return _0x275d5b?{'count':_0x1cfe09,'rows':_0x275d5b}:null;}})[_0xd219('0x42')](respondWithResult(_0x404d46,null))[_0xd219('0x47')](handleError(_0x404d46,null));};exports[_0xd219('0x53')]=function(_0x2eea61,_0x230bf3,_0xaa50b3){if(_0x2eea61[_0xd219('0x4d')]['id']){delete _0x2eea61[_0xd219('0x4d')]['id'];}return db[_0xd219('0x2c')]['findOne']({'where':{'id':_0x2eea61[_0xd219('0x49')]['id']}})[_0xd219('0x42')](handleEntityNotFound(_0x230bf3,null))[_0xd219('0x42')](function(_0x6c21ff){if(_0x6c21ff){_0x2eea61['body'][_0xd219('0x54')]=_0x6c21ff['id'];_0x2eea61[_0xd219('0x4d')]['Subjects']=integrations[_0xd219('0x55')](_0x2eea61[_0xd219('0x4d')]['channel'],_0x2eea61['body']['type']);_0x2eea61[_0xd219('0x4d')][_0xd219('0x56')]=integrations['getDescriptions'](_0x2eea61[_0xd219('0x4d')]['channel'],_0x2eea61[_0xd219('0x4d')][_0xd219('0x2f')]);return db[_0xd219('0x51')][_0xd219('0x4b')](_0x2eea61[_0xd219('0x4d')],{'include':[{'model':db['SalesforceField'],'as':_0xd219('0x57')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0xd219('0x42')](respondWithResult(_0x230bf3,null))[_0xd219('0x47')](handleError(_0x230bf3,null));};exports[_0xd219('0x58')]=function(_0x504cac,_0x4b7c5a,_0x31296c){var _0x378a35;var _0x419e03='';var _0x2f1e58=_0xd219('0x59');return db[_0xd219('0x2c')][_0xd219('0x50')]({'where':{'id':_0x504cac[_0xd219('0x49')]['id']},'attributes':['id',_0xd219('0x5a'),_0xd219('0x5b'),_0xd219('0x5c'),_0xd219('0x5d'),_0xd219('0x5e'),_0xd219('0x5f')]})[_0xd219('0x42')](handleEntityNotFound(_0x4b7c5a,null))[_0xd219('0x42')](function(_0x266616){if(_0x266616){_0x419e03=_0x266616[_0xd219('0x5a')];var _0x5e07de=_0x419e03[_0xd219('0x60')](-0x1);if(_0x5e07de==='/'){_0x419e03=_0x419e03['substring'](0x0,_0x419e03[_0xd219('0x61')](_0x5e07de));}_0x378a35=new jsforce[(_0xd219('0x62'))]({'oauth2':{'loginUrl':_0x419e03,'clientId':_0x266616['clientId'],'clientSecret':_0x266616[_0xd219('0x5c')]}});return _0x378a35[_0xd219('0x63')](_0x266616[_0xd219('0x5d')],_0x266616[_0xd219('0x5e')][_0xd219('0x64')](_0x266616[_0xd219('0x5f')]));}})[_0xd219('0x42')](function(_0x43deee){if(_0x43deee){if(!_[_0xd219('0x65')](_0x504cac['query'][_0xd219('0x66')])){_0x2f1e58=_0x504cac[_0xd219('0x32')]['ticketType'];}return _0x378a35[_0xd219('0x67')](_0x2f1e58)[_0xd219('0x68')]();}})[_0xd219('0x42')](function(_0x3dde1a){var _0x326a2b=[_0xd219('0x69'),_0xd219('0x6a'),_0xd219('0x6b'),'IsRecurrence',_0xd219('0x6c'),'Description'];var _0xa65905=['string',_0xd219('0x6d'),_0xd219('0x6e'),_0xd219('0x6f'),_0xd219('0x70'),'textarea',_0xd219('0x71')];if(_0x3dde1a){_['remove'](_0x3dde1a[_0xd219('0x36')],function(_0x331a63){return _0x326a2b[_0xd219('0x72')](_0x331a63[_0xd219('0x29')])||!_0xa65905['includes'](_0x331a63['type']);});return{'count':_0x3dde1a[_0xd219('0x36')][_0xd219('0x37')],'rows':_[_0xd219('0x2b')](_0x3dde1a['fields'],function(_0x329cd6){return{'id':_0x329cd6[_0xd219('0x29')],'name':_0x329cd6[_0xd219('0x73')],'custom':_0x329cd6[_0xd219('0x74')],'options':_0x329cd6[_0xd219('0x75')][_0xd219('0x37')]>0x0?_[_0xd219('0x2b')](_0x329cd6[_0xd219('0x75')],function(_0x5ab910){return{'name':_0x5ab910[_0xd219('0x73')],'value':_0x5ab910[_0xd219('0x76')]};}):_0x329cd6[_0xd219('0x2f')]==_0xd219('0x6f')?[{'name':_0xd219('0x77'),'value':'true'},{'name':_0xd219('0x78'),'value':_0xd219('0x79')}]:[]};})};}})[_0xd219('0x42')](respondWithResult(_0x4b7c5a,null))[_0xd219('0x47')](function(_0x58ea04){var _0x5b65e0=_0x504cac['query'][_0xd219('0x7a')]?0x1f4:_0x58ea04[_0xd219('0x7b')]||0x1f4;logger[_0xd219('0x27')](_0xd219('0x7c'),_0xd219('0x58'),_0x5b65e0,JSON[_0xd219('0x7d')](_0x58ea04));delete _0x58ea04[_0xd219('0x29')];if(_0x5b65e0===0x191){_0x5b65e0=0x190;}_0x4b7c5a[_0xd219('0x1c')](_0x5b65e0)[_0xd219('0x7e')](_0x504cac[_0xd219('0x32')][_0xd219('0x7a')]?{'message':_0xd219('0x7f'),'statusCode':_0x58ea04['statusCode']}:_0x58ea04);});}; \ No newline at end of file +var _0x9123=['remove','includes','label','picklistValues','value','True','true','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','sendStatus','error','stack','name','index','SalesforceAccount','rawAttributes','key','map','query','keys','intersection','model','fields','attributes','nolimit','order','sort','where','pick','filters','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','params','find','create','body','destroy','findOne','SalesforceConfiguration','length','getConfigurations','hasOwnProperty','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SalesforceField','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','lastIndexOf','login','ticketType','sobject','OwnerId','ActivityDate','IsReminderSet','IsRecurrence','Subject','string','int','picklist','boolean','email','textarea','phone'];(function(_0x26c2e3,_0x11dc31){var _0x1f6e35=function(_0x1e9efd){while(--_0x1e9efd){_0x26c2e3['push'](_0x26c2e3['shift']());}};_0x1f6e35(++_0x11dc31);}(_0x9123,0x89));var _0x3912=function(_0x4f37fa,_0x583f8b){_0x4f37fa=_0x4f37fa-0x0;var _0x43eba2=_0x9123[_0x4f37fa];return _0x43eba2;};'use strict';var emlformat=require(_0x3912('0x0'));var rimraf=require(_0x3912('0x1'));var zipdir=require(_0x3912('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3912('0x3'));var moment=require('moment');var BPromise=require(_0x3912('0x4'));var Mustache=require('mustache');var util=require(_0x3912('0x5'));var path=require(_0x3912('0x6'));var sox=require(_0x3912('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3912('0x8'));var _=require(_0x3912('0x9'));var squel=require(_0x3912('0xa'));var crypto=require('crypto');var jsforce=require(_0x3912('0xb'));var deskjs=require(_0x3912('0xc'));var toCsv=require(_0x3912('0xd'));var querystring=require(_0x3912('0xe'));var Papa=require(_0x3912('0xf'));var Redis=require(_0x3912('0x10'));var authService=require(_0x3912('0x11'));var qs=require(_0x3912('0x12'));var as=require(_0x3912('0x13'));var hardwareService=require(_0x3912('0x14'));var logger=require(_0x3912('0x15'))('api');var utils=require(_0x3912('0x16'));var config=require(_0x3912('0x17'));var licenseUtil=require(_0x3912('0x18'));var db=require(_0x3912('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x2b06db,_0x5730d9){_0x5730d9=_0x5730d9||0xcc;return function(_0x10ebe7){if(_0x10ebe7){return _0x2b06db['sendStatus'](_0x5730d9);}return _0x2b06db[_0x3912('0x1a')](_0x5730d9)['end']();};}function respondWithResult(_0x459127,_0x32c319){_0x32c319=_0x32c319||0xc8;return function(_0x376034){if(_0x376034){return _0x459127[_0x3912('0x1a')](_0x32c319)[_0x3912('0x1b')](_0x376034);}};}function respondWithFilteredResult(_0x59322e,_0x4e804f){return function(_0x43e8d6){if(_0x43e8d6){var _0x28afdc=typeof _0x4e804f[_0x3912('0x1c')]===_0x3912('0x1d')&&typeof _0x4e804f[_0x3912('0x1e')]===_0x3912('0x1d');var _0x207e0d=_0x43e8d6[_0x3912('0x1f')];var _0x27daab=_0x28afdc?0x0:_0x4e804f[_0x3912('0x1c')];var _0x2b5572=_0x28afdc?_0x43e8d6[_0x3912('0x1f')]:_0x4e804f[_0x3912('0x1c')]+_0x4e804f[_0x3912('0x1e')];var _0x1a3580;if(_0x2b5572>=_0x207e0d){_0x2b5572=_0x207e0d;_0x1a3580=0xc8;}else{_0x1a3580=0xce;}_0x59322e[_0x3912('0x1a')](_0x1a3580);return _0x59322e[_0x3912('0x20')]('Content-Range',_0x27daab+'-'+_0x2b5572+'/'+_0x207e0d)[_0x3912('0x1b')](_0x43e8d6);}return null;};}function patchUpdates(_0xfcffdf){return function(_0x1d413d){try{jsonpatch[_0x3912('0x21')](_0x1d413d,_0xfcffdf,!![]);}catch(_0x1c22d5){return BPromise[_0x3912('0x22')](_0x1c22d5);}return _0x1d413d[_0x3912('0x23')]();};}function saveUpdates(_0x418e4f,_0x3ef6d9){return function(_0x15df45){if(_0x15df45){return _0x15df45[_0x3912('0x24')](_0x418e4f)['then'](function(_0x29865f){return _0x29865f;});}return null;};}function removeEntity(_0x43199c,_0x4d269c){return function(_0x57f19e){if(_0x57f19e){return _0x57f19e['destroy']()[_0x3912('0x25')](function(){_0x43199c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a7290,_0x2697c6){return function(_0xe4e7a1){if(!_0xe4e7a1){_0x3a7290[_0x3912('0x26')](0x194);}return _0xe4e7a1;};}function handleError(_0x3bfba3,_0x273c52){_0x273c52=_0x273c52||0x1f4;return function(_0x59b786){logger[_0x3912('0x27')](_0x59b786[_0x3912('0x28')]);if(_0x59b786[_0x3912('0x29')]){delete _0x59b786['name'];}_0x3bfba3[_0x3912('0x1a')](_0x273c52)['send'](_0x59b786);};}exports[_0x3912('0x2a')]=function(_0x381de4,_0x10e586){var _0x57b032={},_0x1fde92={},_0xba1332={'count':0x0,'rows':[]};var _0x2a05e1=_['map'](db[_0x3912('0x2b')][_0x3912('0x2c')],function(_0x18f116){return{'name':_0x18f116['fieldName'],'type':_0x18f116['type'][_0x3912('0x2d')]};});_0x1fde92['model']=_[_0x3912('0x2e')](_0x2a05e1,_0x3912('0x29'));_0x1fde92[_0x3912('0x2f')]=_[_0x3912('0x30')](_0x381de4[_0x3912('0x2f')]);_0x1fde92['filters']=_[_0x3912('0x31')](_0x1fde92[_0x3912('0x32')],_0x1fde92['query']);_0x57b032['attributes']=_[_0x3912('0x31')](_0x1fde92[_0x3912('0x32')],qs['fields'](_0x381de4[_0x3912('0x2f')][_0x3912('0x33')]));_0x57b032[_0x3912('0x34')]=_0x57b032[_0x3912('0x34')]['length']?_0x57b032[_0x3912('0x34')]:_0x1fde92['model'];if(!_0x381de4['query']['hasOwnProperty'](_0x3912('0x35'))){_0x57b032[_0x3912('0x1e')]=qs['limit'](_0x381de4[_0x3912('0x2f')][_0x3912('0x1e')]);_0x57b032[_0x3912('0x1c')]=qs[_0x3912('0x1c')](_0x381de4['query'][_0x3912('0x1c')]);}_0x57b032[_0x3912('0x36')]=qs['sort'](_0x381de4['query'][_0x3912('0x37')]);_0x57b032[_0x3912('0x38')]=qs['filters'](_[_0x3912('0x39')](_0x381de4['query'],_0x1fde92[_0x3912('0x3a')]),_0x2a05e1);if(_0x381de4['query'][_0x3912('0x3b')]){_0x57b032[_0x3912('0x38')]=_[_0x3912('0x3c')](_0x57b032[_0x3912('0x38')],{'$or':_[_0x3912('0x2e')](_0x2a05e1,function(_0x40d72c){if(_0x40d72c[_0x3912('0x3d')]!==_0x3912('0x3e')){var _0x29149f={};_0x29149f[_0x40d72c['name']]={'$like':'%'+_0x381de4[_0x3912('0x2f')]['filter']+'%'};return _0x29149f;}})});}_0x57b032=_[_0x3912('0x3c')]({},_0x57b032,_0x381de4['options']);var _0x3a284f={'where':_0x57b032[_0x3912('0x38')]};return db[_0x3912('0x2b')][_0x3912('0x1f')](_0x3a284f)[_0x3912('0x25')](function(_0x3589a6){_0xba1332[_0x3912('0x1f')]=_0x3589a6;if(_0x381de4[_0x3912('0x2f')][_0x3912('0x3f')]){_0x57b032[_0x3912('0x40')]=[{'all':!![]}];}return db[_0x3912('0x2b')][_0x3912('0x41')](_0x57b032);})[_0x3912('0x25')](function(_0x25e617){_0xba1332['rows']=_0x25e617;return _0xba1332;})[_0x3912('0x25')](respondWithFilteredResult(_0x10e586,_0x57b032))[_0x3912('0x42')](handleError(_0x10e586,null));};exports['show']=function(_0x4e7013,_0x31b69d){var _0x1ea4fd={'raw':![],'where':{'id':_0x4e7013[_0x3912('0x43')]['id']}},_0x3d01f1={};_0x3d01f1[_0x3912('0x32')]=_['keys'](db['SalesforceAccount'][_0x3912('0x2c')]);_0x3d01f1[_0x3912('0x2f')]=_[_0x3912('0x30')](_0x4e7013[_0x3912('0x2f')]);_0x3d01f1[_0x3912('0x3a')]=_['intersection'](_0x3d01f1[_0x3912('0x32')],_0x3d01f1[_0x3912('0x2f')]);_0x1ea4fd[_0x3912('0x34')]=_['intersection'](_0x3d01f1[_0x3912('0x32')],qs[_0x3912('0x33')](_0x4e7013['query']['fields']));_0x1ea4fd[_0x3912('0x34')]=_0x1ea4fd[_0x3912('0x34')]['length']?_0x1ea4fd[_0x3912('0x34')]:_0x3d01f1[_0x3912('0x32')];if(_0x4e7013[_0x3912('0x2f')]['includeAll']){_0x1ea4fd[_0x3912('0x40')]=[{'all':!![]}];}_0x1ea4fd=_['merge']({},_0x1ea4fd,_0x4e7013['options']);return db[_0x3912('0x2b')][_0x3912('0x44')](_0x1ea4fd)[_0x3912('0x25')](handleEntityNotFound(_0x31b69d,null))[_0x3912('0x25')](respondWithResult(_0x31b69d,null))[_0x3912('0x42')](handleError(_0x31b69d,null));};exports[_0x3912('0x45')]=function(_0x1687f4,_0x45354a){return db['SalesforceAccount'][_0x3912('0x45')](_0x1687f4[_0x3912('0x46')],{})[_0x3912('0x25')](respondWithResult(_0x45354a,0xc9))[_0x3912('0x42')](handleError(_0x45354a,null));};exports[_0x3912('0x24')]=function(_0x541b22,_0x450119){if(_0x541b22['body']['id']){delete _0x541b22[_0x3912('0x46')]['id'];}return db[_0x3912('0x2b')][_0x3912('0x44')]({'where':{'id':_0x541b22[_0x3912('0x43')]['id']}})[_0x3912('0x25')](handleEntityNotFound(_0x450119,null))['then'](saveUpdates(_0x541b22['body'],null))[_0x3912('0x25')](respondWithResult(_0x450119,null))[_0x3912('0x42')](handleError(_0x450119,null));};exports[_0x3912('0x47')]=function(_0x4d70da,_0x4a776d){return db['SalesforceAccount']['find']({'where':{'id':_0x4d70da['params']['id']}})[_0x3912('0x25')](handleEntityNotFound(_0x4a776d,null))[_0x3912('0x25')](removeEntity(_0x4a776d,null))[_0x3912('0x42')](handleError(_0x4a776d,null));};exports['getConfigurations']=function(_0x33fdc4,_0x487530,_0x26959e){var _0x296781={};var _0x19b45e={};var _0xe42576;var _0x492f74;return db[_0x3912('0x2b')][_0x3912('0x48')]({'where':{'id':_0x33fdc4[_0x3912('0x43')]['id']}})['then'](handleEntityNotFound(_0x487530,null))[_0x3912('0x25')](function(_0x2c6c02){if(_0x2c6c02){_0xe42576=_0x2c6c02;_0x19b45e[_0x3912('0x32')]=_['keys'](db[_0x3912('0x49')][_0x3912('0x2c')]);_0x19b45e[_0x3912('0x2f')]=_[_0x3912('0x30')](_0x33fdc4['query']);_0x19b45e['filters']=_['intersection'](_0x19b45e[_0x3912('0x32')],_0x19b45e[_0x3912('0x2f')]);_0x296781[_0x3912('0x34')]=_[_0x3912('0x31')](_0x19b45e['model'],qs['fields'](_0x33fdc4[_0x3912('0x2f')][_0x3912('0x33')]));_0x296781[_0x3912('0x34')]=_0x296781['attributes'][_0x3912('0x4a')]?_0x296781[_0x3912('0x34')]:_0x19b45e[_0x3912('0x32')];_0x296781[_0x3912('0x36')]=qs['sort'](_0x33fdc4[_0x3912('0x2f')]['sort']);_0x296781[_0x3912('0x38')]=qs[_0x3912('0x3a')](_[_0x3912('0x39')](_0x33fdc4[_0x3912('0x2f')],_0x19b45e[_0x3912('0x3a')]));if(_0x33fdc4[_0x3912('0x2f')][_0x3912('0x3b')]){_0x296781['where']=_['merge'](_0x296781[_0x3912('0x38')],{'$or':_[_0x3912('0x2e')](_0x296781[_0x3912('0x34')],function(_0x50a9b7){var _0x1607a0={};_0x1607a0[_0x50a9b7]={'$like':'%'+_0x33fdc4[_0x3912('0x2f')][_0x3912('0x3b')]+'%'};return _0x1607a0;})});}_0x296781=_[_0x3912('0x3c')]({},_0x296781,_0x33fdc4['options']);return _0xe42576[_0x3912('0x4b')](_0x296781);}})[_0x3912('0x25')](function(_0xc18fb9){if(_0xc18fb9){_0x492f74=_0xc18fb9['length'];if(!_0x33fdc4['query'][_0x3912('0x4c')](_0x3912('0x35'))){_0x296781['limit']=qs[_0x3912('0x1e')](_0x33fdc4['query']['limit']);_0x296781[_0x3912('0x1c')]=qs[_0x3912('0x1c')](_0x33fdc4['query'][_0x3912('0x1c')]);}return _0xe42576[_0x3912('0x4b')](_0x296781);}})[_0x3912('0x25')](function(_0xb25d2e){if(_0xb25d2e){return _0xb25d2e?{'count':_0x492f74,'rows':_0xb25d2e}:null;}})[_0x3912('0x25')](respondWithResult(_0x487530,null))['catch'](handleError(_0x487530,null));};exports['addConfiguration']=function(_0x375306,_0xab0dcb,_0x2b4017){if(_0x375306[_0x3912('0x46')]['id']){delete _0x375306['body']['id'];}return db[_0x3912('0x2b')][_0x3912('0x48')]({'where':{'id':_0x375306[_0x3912('0x43')]['id']}})[_0x3912('0x25')](handleEntityNotFound(_0xab0dcb,null))[_0x3912('0x25')](function(_0x1b13b6){if(_0x1b13b6){_0x375306[_0x3912('0x46')][_0x3912('0x4d')]=_0x1b13b6['id'];_0x375306['body'][_0x3912('0x4e')]=integrations[_0x3912('0x4f')](_0x375306['body'][_0x3912('0x50')],_0x375306[_0x3912('0x46')][_0x3912('0x3d')]);_0x375306[_0x3912('0x46')][_0x3912('0x51')]=integrations[_0x3912('0x52')](_0x375306[_0x3912('0x46')][_0x3912('0x50')],_0x375306[_0x3912('0x46')][_0x3912('0x3d')]);return db[_0x3912('0x49')][_0x3912('0x45')](_0x375306[_0x3912('0x46')],{'include':[{'model':db[_0x3912('0x53')],'as':'Subjects'},{'model':db[_0x3912('0x53')],'as':_0x3912('0x51')}]});}return null;})[_0x3912('0x25')](respondWithResult(_0xab0dcb,null))[_0x3912('0x42')](handleError(_0xab0dcb,null));};exports['getFields']=function(_0x405833,_0x202833,_0x1c6644){var _0x3b01e5;var _0x409f49='';var _0x2dcb29=_0x3912('0x54');return db[_0x3912('0x2b')][_0x3912('0x48')]({'where':{'id':_0x405833[_0x3912('0x43')]['id']},'attributes':['id',_0x3912('0x55'),_0x3912('0x56'),_0x3912('0x57'),_0x3912('0x58'),_0x3912('0x59'),_0x3912('0x5a')]})[_0x3912('0x25')](handleEntityNotFound(_0x202833,null))[_0x3912('0x25')](function(_0x37fca7){if(_0x37fca7){_0x409f49=_0x37fca7['remoteUri'];var _0x30990a=_0x409f49[_0x3912('0x5b')](-0x1);if(_0x30990a==='/'){_0x409f49=_0x409f49[_0x3912('0x5c')](0x0,_0x409f49[_0x3912('0x5d')](_0x30990a));}_0x3b01e5=new jsforce['Connection']({'oauth2':{'loginUrl':_0x409f49,'clientId':_0x37fca7[_0x3912('0x56')],'clientSecret':_0x37fca7[_0x3912('0x57')]}});return _0x3b01e5[_0x3912('0x5e')](_0x37fca7[_0x3912('0x58')],_0x37fca7[_0x3912('0x59')]['concat'](_0x37fca7['securityToken']));}})[_0x3912('0x25')](function(_0x9422af){if(_0x9422af){if(!_['isNil'](_0x405833['query'][_0x3912('0x5f')])){_0x2dcb29=_0x405833[_0x3912('0x2f')]['ticketType'];}return _0x3b01e5[_0x3912('0x60')](_0x2dcb29)['describe']();}})[_0x3912('0x25')](function(_0xfb091a){var _0xc8de27=[_0x3912('0x61'),_0x3912('0x62'),_0x3912('0x63'),_0x3912('0x64'),_0x3912('0x65'),'Description'];var _0x22db60=[_0x3912('0x66'),_0x3912('0x67'),_0x3912('0x68'),_0x3912('0x69'),_0x3912('0x6a'),_0x3912('0x6b'),_0x3912('0x6c')];if(_0xfb091a){_[_0x3912('0x6d')](_0xfb091a['fields'],function(_0x14a99f){return _0xc8de27['includes'](_0x14a99f['name'])||!_0x22db60[_0x3912('0x6e')](_0x14a99f[_0x3912('0x3d')]);});return{'count':_0xfb091a['fields']['length'],'rows':_[_0x3912('0x2e')](_0xfb091a[_0x3912('0x33')],function(_0x2e1cd5){return{'id':_0x2e1cd5[_0x3912('0x29')],'name':_0x2e1cd5[_0x3912('0x6f')],'custom':_0x2e1cd5['custom'],'options':_0x2e1cd5[_0x3912('0x70')][_0x3912('0x4a')]>0x0?_[_0x3912('0x2e')](_0x2e1cd5[_0x3912('0x70')],function(_0x4e8b7b){return{'name':_0x4e8b7b[_0x3912('0x6f')],'value':_0x4e8b7b[_0x3912('0x71')]};}):_0x2e1cd5['type']==_0x3912('0x69')?[{'name':_0x3912('0x72'),'value':_0x3912('0x73')},{'name':'False','value':'false'}]:[]};})};}})[_0x3912('0x25')](respondWithResult(_0x202833,null))[_0x3912('0x42')](function(_0x5eb47c){var _0x4b6a19=_0x405833[_0x3912('0x2f')][_0x3912('0x74')]?0x1f4:_0x5eb47c[_0x3912('0x75')]||0x1f4;logger[_0x3912('0x27')](_0x3912('0x76'),_0x3912('0x77'),_0x4b6a19,JSON[_0x3912('0x78')](_0x5eb47c));delete _0x5eb47c[_0x3912('0x29')];if(_0x4b6a19===0x191){_0x4b6a19=0x190;}_0x202833['status'](_0x4b6a19)[_0x3912('0x79')](_0x405833[_0x3912('0x2f')][_0x3912('0x74')]?{'message':_0x3912('0x7a'),'statusCode':_0x5eb47c[_0x3912('0x75')]}:_0x5eb47c);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index af5874c..a7fd37a 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 _0x619d=['rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x132313,_0x3d5302){var _0x450e99=function(_0x504237){while(--_0x504237){_0x132313['push'](_0x132313['shift']());}};_0x450e99(++_0x3d5302);}(_0x619d,0xd9));var _0xd619=function(_0x477d14,_0x2aa491){_0x477d14=_0x477d14-0x0;var _0x18b80f=_0x619d[_0x477d14];return _0x18b80f;};'use strict';var _=require(_0xd619('0x0'));var util=require(_0xd619('0x1'));var logger=require(_0xd619('0x2'))('api');var moment=require(_0xd619('0x3'));var BPromise=require(_0xd619('0x4'));var rp=require(_0xd619('0x5'));var fs=require('fs');var path=require(_0xd619('0x6'));var rimraf=require(_0xd619('0x7'));var config=require('../../config/environment');var attributes=require(_0xd619('0x8'));var integrations=require(_0xd619('0x9'));module[_0xd619('0xa')]=function(_0x2f5d9a,_0x4f8823){return _0x2f5d9a[_0xd619('0xb')](_0xd619('0xc'),attributes,{'tableName':_0xd619('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe16b=['exports','define','SalesforceAccount','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration'];(function(_0x4c6136,_0x2b0b22){var _0x43d193=function(_0x1deec0){while(--_0x1deec0){_0x4c6136['push'](_0x4c6136['shift']());}};_0x43d193(++_0x2b0b22);}(_0xe16b,0x155));var _0xbe16=function(_0xea458b,_0x535452){_0xea458b=_0xea458b-0x0;var _0x41f1dc=_0xe16b[_0xea458b];return _0x41f1dc;};'use strict';var _=require('lodash');var util=require(_0xbe16('0x0'));var logger=require(_0xbe16('0x1'))(_0xbe16('0x2'));var moment=require(_0xbe16('0x3'));var BPromise=require(_0xbe16('0x4'));var rp=require(_0xbe16('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbe16('0x6'));var config=require(_0xbe16('0x7'));var attributes=require(_0xbe16('0x8'));var integrations=require(_0xbe16('0x9'));module[_0xbe16('0xa')]=function(_0x555e1e,_0x1eb352){return _0x555e1e[_0xbe16('0xb')](_0xbe16('0xc'),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 97eeffe..8308f14 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 _0xc359=['request','then','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowSalesforceAccount','find','util','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x177916,_0x2b1c4f){var _0x5a34e5=function(_0x5af299){while(--_0x5af299){_0x177916['push'](_0x177916['shift']());}};_0x5a34e5(++_0x2b1c4f);}(_0xc359,0x1d9));var _0x9c35=function(_0x321e39,_0x2f99c8){_0x321e39=_0x321e39-0x0;var _0x2e5be2=_0xc359[_0x321e39];return _0x2e5be2;};'use strict';var _=require('lodash');var util=require(_0x9c35('0x0'));var moment=require('moment');var BPromise=require(_0x9c35('0x1'));var rs=require(_0x9c35('0x2'));var fs=require('fs');var Redis=require(_0x9c35('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c35('0x4'));var logger=require('../../config/logger')(_0x9c35('0x5'));var config=require('../../config/environment');var jayson=require(_0x9c35('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53d9d7,_0x4b61d6,_0x279ba9){return new BPromise(function(_0x2993da,_0x1ab745){return client[_0x9c35('0x7')](_0x53d9d7,_0x279ba9)[_0x9c35('0x8')](function(_0x2efae8){logger['info'](_0x9c35('0x9'),_0x4b61d6,_0x9c35('0xa'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4b61d6,'request\x20sent',JSON[_0x9c35('0xb')](_0x2efae8));if(_0x2efae8['error']){if(_0x2efae8[_0x9c35('0xc')][_0x9c35('0xd')]===0x1f4){logger[_0x9c35('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x4b61d6,_0x2efae8[_0x9c35('0xc')][_0x9c35('0xe')]);return _0x1ab745(_0x2efae8[_0x9c35('0xc')][_0x9c35('0xe')]);}logger[_0x9c35('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x4b61d6,_0x2efae8[_0x9c35('0xc')][_0x9c35('0xe')]);return _0x2993da(_0x2efae8[_0x9c35('0xc')][_0x9c35('0xe')]);}else{logger[_0x9c35('0xf')](_0x9c35('0x9'),_0x4b61d6,_0x9c35('0xa'));_0x2993da(_0x2efae8[_0x9c35('0x10')][_0x9c35('0xe')]);}})[_0x9c35('0x11')](function(_0x387dd7){logger[_0x9c35('0xc')](_0x9c35('0x9'),_0x4b61d6,_0x387dd7);_0x1ab745(_0x387dd7);});});}exports[_0x9c35('0x12')]=function(_0x26db4b){var _0x4cbeb6=this;return new Promise(function(_0x1d0227,_0x389ddb){return db[_0x9c35('0x13')][_0x9c35('0x14')]({'raw':_0x26db4b['options']?_0x26db4b[_0x9c35('0x15')][_0x9c35('0x16')]===undefined?!![]:![]:!![],'where':_0x26db4b[_0x9c35('0x15')]?_0x26db4b[_0x9c35('0x15')][_0x9c35('0x17')]||null:null,'attributes':_0x26db4b['options']?_0x26db4b[_0x9c35('0x15')]['attributes']||null:null,'limit':_0x26db4b[_0x9c35('0x15')]?_0x26db4b[_0x9c35('0x15')][_0x9c35('0x18')]||null:null,'include':_0x26db4b[_0x9c35('0x15')]?_0x26db4b[_0x9c35('0x15')][_0x9c35('0x19')]?_[_0x9c35('0x1a')](_0x26db4b['options']['include'],function(_0x1bc7e4){return{'model':db[_0x1bc7e4[_0x9c35('0x1b')]],'as':_0x1bc7e4['as'],'attributes':_0x1bc7e4[_0x9c35('0x1c')],'include':_0x1bc7e4[_0x9c35('0x19')]?_['map'](_0x1bc7e4[_0x9c35('0x19')],function(_0x578e00){return{'model':db[_0x578e00[_0x9c35('0x1b')]],'as':_0x578e00['as'],'attributes':_0x578e00['attributes'],'include':_0x578e00['include']?_[_0x9c35('0x1a')](_0x578e00[_0x9c35('0x19')],function(_0x2cba78){return{'model':db[_0x2cba78['model']],'as':_0x2cba78['as'],'attributes':_0x2cba78[_0x9c35('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x16cc31){logger[_0x9c35('0xf')](_0x9c35('0x12'),_0x26db4b);logger[_0x9c35('0x1d')](_0x9c35('0x12'),_0x26db4b,JSON['stringify'](_0x16cc31));_0x1d0227(_0x16cc31);})[_0x9c35('0x11')](function(_0x16e8dd){logger['error'](_0x9c35('0x12'),_0x16e8dd[_0x9c35('0xe')],_0x26db4b);_0x389ddb(_0x4cbeb6[_0x9c35('0xc')](0x1f4,_0x16e8dd[_0x9c35('0xe')]));});});};exports[_0x9c35('0x1e')]=function(_0x4cb625){var _0x37379c=this;return new Promise(function(_0xd9c6b3,_0x2a7412){return db[_0x9c35('0x13')][_0x9c35('0x1f')]({'raw':_0x4cb625[_0x9c35('0x15')]?_0x4cb625['options'][_0x9c35('0x16')]===undefined?!![]:![]:!![],'where':_0x4cb625['options']?_0x4cb625[_0x9c35('0x15')][_0x9c35('0x17')]||null:null,'attributes':_0x4cb625[_0x9c35('0x15')]?_0x4cb625[_0x9c35('0x15')][_0x9c35('0x1c')]||null:null,'include':_0x4cb625['options']?_0x4cb625[_0x9c35('0x15')][_0x9c35('0x19')]?_['map'](_0x4cb625['options'][_0x9c35('0x19')],function(_0x5105c6){return{'model':db[_0x5105c6['model']],'as':_0x5105c6['as'],'attributes':_0x5105c6['attributes'],'include':_0x5105c6[_0x9c35('0x19')]?_[_0x9c35('0x1a')](_0x5105c6[_0x9c35('0x19')],function(_0x1ca5f1){return{'model':db[_0x1ca5f1[_0x9c35('0x1b')]],'as':_0x1ca5f1['as'],'attributes':_0x1ca5f1[_0x9c35('0x1c')],'include':_0x1ca5f1['include']?_[_0x9c35('0x1a')](_0x1ca5f1[_0x9c35('0x19')],function(_0x2077e7){return{'model':db[_0x2077e7[_0x9c35('0x1b')]],'as':_0x2077e7['as'],'attributes':_0x2077e7['attributes']};}):[]};}):[]};}):[]:[]})[_0x9c35('0x8')](function(_0x1690b9){logger[_0x9c35('0xf')](_0x9c35('0x1e'),_0x4cb625);logger[_0x9c35('0x1d')](_0x9c35('0x1e'),_0x4cb625,JSON[_0x9c35('0xb')](_0x1690b9));_0xd9c6b3(_0x1690b9);})['catch'](function(_0x535edd){logger['error'](_0x9c35('0x1e'),_0x535edd['message'],_0x4cb625);_0x2a7412(_0x37379c[_0x9c35('0xc')](0x1f4,_0x535edd['message']));});});}; \ No newline at end of file +var _0xa217=['GetSalesforceAccount','stringify','ShowSalesforceAccount','SalesforceAccount','find','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','http','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','attributes','map','model','include'];(function(_0x4b055c,_0x4b870b){var _0x4b62bb=function(_0x4884c2){while(--_0x4884c2){_0x4b055c['push'](_0x4b055c['shift']());}};_0x4b62bb(++_0x4b870b);}(_0xa217,0xc5));var _0x7a21=function(_0x233d84,_0x3f63c9){_0x233d84=_0x233d84-0x0;var _0x33f28f=_0xa217[_0x233d84];return _0x33f28f;};'use strict';var _=require(_0x7a21('0x0'));var util=require('util');var moment=require(_0x7a21('0x1'));var BPromise=require('bluebird');var rs=require(_0x7a21('0x2'));var fs=require('fs');var Redis=require(_0x7a21('0x3'));var db=require(_0x7a21('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a21('0x5'))('rpc');var config=require(_0x7a21('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7a21('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x33490e,_0x569c4d,_0x405313){return new BPromise(function(_0x386169,_0x6fad66){return client['request'](_0x33490e,_0x405313)[_0x7a21('0x8')](function(_0x184f0c){logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,_0x7a21('0xb'));logger[_0x7a21('0xc')](_0x7a21('0xd'),_0x569c4d,_0x7a21('0xb'),JSON['stringify'](_0x184f0c));if(_0x184f0c[_0x7a21('0xe')]){if(_0x184f0c[_0x7a21('0xe')][_0x7a21('0xf')]===0x1f4){logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c[_0x7a21('0xe')][_0x7a21('0x10')]);return _0x6fad66(_0x184f0c[_0x7a21('0xe')]['message']);}logger[_0x7a21('0xe')](_0x7a21('0xa'),_0x569c4d,_0x184f0c['error'][_0x7a21('0x10')]);return _0x386169(_0x184f0c['error'][_0x7a21('0x10')]);}else{logger[_0x7a21('0x9')](_0x7a21('0xa'),_0x569c4d,'request\x20sent');_0x386169(_0x184f0c[_0x7a21('0x11')][_0x7a21('0x10')]);}})[_0x7a21('0x12')](function(_0xdfe12b){logger[_0x7a21('0xe')]('SalesforceAccount,\x20%s,\x20%s',_0x569c4d,_0xdfe12b);_0x6fad66(_0xdfe12b);});});}exports['GetSalesforceAccount']=function(_0x532848){var _0x38467b=this;return new Promise(function(_0x28d84f,_0x52e547){return db['SalesforceAccount'][_0x7a21('0x13')]({'raw':_0x532848[_0x7a21('0x14')]?_0x532848[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x532848['options']?_0x532848[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x532848['options']?_0x532848['options'][_0x7a21('0x17')]||null:null,'limit':_0x532848['options']?_0x532848[_0x7a21('0x14')]['limit']||null:null,'include':_0x532848[_0x7a21('0x14')]?_0x532848['options']['include']?_[_0x7a21('0x18')](_0x532848[_0x7a21('0x14')]['include'],function(_0x3f6451){return{'model':db[_0x3f6451[_0x7a21('0x19')]],'as':_0x3f6451['as'],'attributes':_0x3f6451[_0x7a21('0x17')],'include':_0x3f6451[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3f6451[_0x7a21('0x1a')],function(_0x139894){return{'model':db[_0x139894[_0x7a21('0x19')]],'as':_0x139894['as'],'attributes':_0x139894[_0x7a21('0x17')],'include':_0x139894[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x139894['include'],function(_0x31b14e){return{'model':db[_0x31b14e['model']],'as':_0x31b14e['as'],'attributes':_0x31b14e[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xf4ce97){logger[_0x7a21('0x9')](_0x7a21('0x1b'),_0x532848);logger['debug']('GetSalesforceAccount',_0x532848,JSON[_0x7a21('0x1c')](_0xf4ce97));_0x28d84f(_0xf4ce97);})[_0x7a21('0x12')](function(_0x3785e2){logger[_0x7a21('0xe')](_0x7a21('0x1b'),_0x3785e2['message'],_0x532848);_0x52e547(_0x38467b[_0x7a21('0xe')](0x1f4,_0x3785e2[_0x7a21('0x10')]));});});};exports[_0x7a21('0x1d')]=function(_0x1ca71e){var _0x231e6d=this;return new Promise(function(_0x410f40,_0x2c1a37){return db[_0x7a21('0x1e')][_0x7a21('0x1f')]({'raw':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x15')]===undefined?!![]:![]:!![],'where':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x16')]||null:null,'attributes':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')]['attributes']||null:null,'include':_0x1ca71e[_0x7a21('0x14')]?_0x1ca71e[_0x7a21('0x14')][_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x1ca71e[_0x7a21('0x14')]['include'],function(_0x3ef1eb){return{'model':db[_0x3ef1eb['model']],'as':_0x3ef1eb['as'],'attributes':_0x3ef1eb[_0x7a21('0x17')],'include':_0x3ef1eb[_0x7a21('0x1a')]?_[_0x7a21('0x18')](_0x3ef1eb[_0x7a21('0x1a')],function(_0xc89f8c){return{'model':db[_0xc89f8c['model']],'as':_0xc89f8c['as'],'attributes':_0xc89f8c['attributes'],'include':_0xc89f8c[_0x7a21('0x1a')]?_['map'](_0xc89f8c['include'],function(_0x452240){return{'model':db[_0x452240[_0x7a21('0x19')]],'as':_0x452240['as'],'attributes':_0x452240[_0x7a21('0x17')]};}):[]};}):[]};}):[]:[]})[_0x7a21('0x8')](function(_0x16f490){logger['info'](_0x7a21('0x1d'),_0x1ca71e);logger['debug'](_0x7a21('0x1d'),_0x1ca71e,JSON[_0x7a21('0x1c')](_0x16f490));_0x410f40(_0x16f490);})[_0x7a21('0x12')](function(_0x3acadf){logger[_0x7a21('0xe')]('ShowSalesforceAccount',_0x3acadf[_0x7a21('0x10')],_0x1ca71e);_0x2c1a37(_0x231e6d[_0x7a21('0xe')](0x1f4,_0x3acadf[_0x7a21('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1d733f9..402f2b4 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 _0xadb5=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','delete','destroy','exports','util','connect-timeout','express'];(function(_0x4ff87b,_0x3da57e){var _0x1a07be=function(_0x42a498){while(--_0x42a498){_0x4ff87b['push'](_0x4ff87b['shift']());}};_0x1a07be(++_0x3da57e);}(_0xadb5,0xad));var _0x5adb=function(_0x5410d1,_0x49724c){_0x5410d1=_0x5410d1-0x0;var _0x42bcc9=_0xadb5[_0x5410d1];return _0x42bcc9;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./intSalesforceConfiguration.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x7')](_0x5adb('0xe'),auth[_0x5adb('0x8')](),controller['getSubjects']);router['get'](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x10')]);router['post']('/',auth[_0x5adb('0x8')](),controller['create']);router[_0x5adb('0x11')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x12')]);router[_0x5adb('0x13')]('/:id',auth[_0x5adb('0x8')](),controller[_0x5adb('0x14')]);module[_0x5adb('0x15')]=router; \ No newline at end of file +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(_0x433fc6,_0x289d22){var _0x360e4c=function(_0x24b034){while(--_0x24b034){_0x433fc6['push'](_0x433fc6['shift']());}};_0x360e4c(++_0x289d22);}(_0x7a54,0x106));var _0x47a5=function(_0x58bac3,_0x327013){_0x58bac3=_0x58bac3-0x0;var _0x122d81=_0x7a54[_0x58bac3];return _0x122d81;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0x9')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0x47a5('0x9')](_0x47a5('0xd'),auth['isAuthenticated'](),controller[_0x47a5('0xe')]);router['get']('/:id/descriptions',auth[_0x47a5('0xc')](),controller[_0x47a5('0xf')]);router[_0x47a5('0x10')]('/',auth[_0x47a5('0xc')](),controller[_0x47a5('0x11')]);router[_0x47a5('0x12')](_0x47a5('0xb'),auth['isAuthenticated'](),controller[_0x47a5('0x13')]);router[_0x47a5('0x14')](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller[_0x47a5('0x15')]);module[_0x47a5('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index a6e0108..95fb570 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 _0xed0c=['nothing','account','lead','sequelize','exports','STRING','Task','Case','ENUM','contact_lead','contact','account_contact_lead'];(function(_0x51e721,_0x1acfb1){var _0x4146e2=function(_0x4c287f){while(--_0x4c287f){_0x51e721['push'](_0x51e721['shift']());}};_0x4146e2(++_0x1acfb1);}(_0xed0c,0x1d7));var _0xced0=function(_0x2fb8e6,_0x4b71ca){_0x2fb8e6=_0x2fb8e6-0x0;var _0x1f9dc1=_0xed0c[_0x2fb8e6];return _0x1f9dc1;};'use strict';var Sequelize=require(_0xced0('0x0'));module[_0xced0('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xced0('0x2')]},'ticketType':{'type':Sequelize['ENUM'](_0xced0('0x3'),_0xced0('0x4')),'defaultValue':_0xced0('0x3')},'moduleSearch':{'type':Sequelize[_0xced0('0x5')](_0xced0('0x6'),_0xced0('0x7'),'lead',_0xced0('0x8'),'account'),'defaultValue':_0xced0('0x6')},'moduleCreate':{'type':Sequelize[_0xced0('0x5')](_0xced0('0x9'),_0xced0('0x7'),'lead',_0xced0('0xa')),'defaultValue':_0xced0('0xb')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0xced0('0x2')]},'additionalSearchContact':{'type':Sequelize['STRING']},'additionalSearchLead':{'type':Sequelize[_0xced0('0x2')]}}; \ No newline at end of file +var _0x8109=['Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING','ENUM'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0x8109,0xb0));var _0x9810=function(_0x1fb9be,_0x22bd4f){_0x1fb9be=_0x1fb9be-0x0;var _0xed7df3=_0x8109[_0x1fb9be];return _0xed7df3;};'use strict';var Sequelize=require(_0x9810('0x0'));module[_0x9810('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9810('0x2')]},'ticketType':{'type':Sequelize[_0x9810('0x3')](_0x9810('0x4'),_0x9810('0x5')),'defaultValue':_0x9810('0x4')},'moduleSearch':{'type':Sequelize[_0x9810('0x3')](_0x9810('0x6'),_0x9810('0x7'),_0x9810('0x8'),_0x9810('0x9'),_0x9810('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize['ENUM'](_0x9810('0xb'),_0x9810('0x7'),_0x9810('0x8'),_0x9810('0xa')),'defaultValue':_0x9810('0x8')},'leadId':{'type':Sequelize['STRING']},'additionalSearchAccount':{'type':Sequelize[_0x9810('0x2')]},'additionalSearchContact':{'type':Sequelize[_0x9810('0x2')]},'additionalSearchLead':{'type':Sequelize[_0x9810('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index a5a1669..95defe3 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 _0xa3b4=['status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','VIRTUAL','merge','options','include','findAll','catch','show','params','keys','includeAll','find','create','body','destroy','getFields','findOne','SalesforceField','pick','hasOwnProperty','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','sendStatus'];(function(_0x2d736e,_0x5ef3ee){var _0x2231c8=function(_0x2ab9b9){while(--_0x2ab9b9){_0x2d736e['push'](_0x2d736e['shift']());}};_0x2231c8(++_0x5ef3ee);}(_0xa3b4,0x130));var _0x4a3b=function(_0x454e2c,_0x58d070){_0x454e2c=_0x454e2c-0x0;var _0x2d6923=_0xa3b4[_0x454e2c];return _0x2d6923;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a3b('0x0'));var zipdir=require(_0x4a3b('0x1'));var jsonpatch=require(_0x4a3b('0x2'));var rp=require(_0x4a3b('0x3'));var moment=require(_0x4a3b('0x4'));var BPromise=require(_0x4a3b('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4a3b('0x6'));var sox=require(_0x4a3b('0x7'));var csv=require(_0x4a3b('0x8'));var ejs=require(_0x4a3b('0x9'));var fs=require('fs');var fs_extra=require(_0x4a3b('0xa'));var _=require(_0x4a3b('0xb'));var squel=require(_0x4a3b('0xc'));var crypto=require(_0x4a3b('0xd'));var jsforce=require(_0x4a3b('0xe'));var deskjs=require(_0x4a3b('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a3b('0x10'));var Redis=require(_0x4a3b('0x11'));var authService=require(_0x4a3b('0x12'));var qs=require(_0x4a3b('0x13'));var as=require(_0x4a3b('0x14'));var hardwareService=require(_0x4a3b('0x15'));var logger=require(_0x4a3b('0x16'))(_0x4a3b('0x17'));var utils=require(_0x4a3b('0x18'));var config=require(_0x4a3b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x4a3b('0x1a'))['db'];function respondWithStatusCode(_0x143518,_0x49e7a3){_0x49e7a3=_0x49e7a3||0xcc;return function(_0x521042){if(_0x521042){return _0x143518[_0x4a3b('0x1b')](_0x49e7a3);}return _0x143518[_0x4a3b('0x1c')](_0x49e7a3)['end']();};}function respondWithResult(_0x31488c,_0x4af142){_0x4af142=_0x4af142||0xc8;return function(_0x39c702){if(_0x39c702){return _0x31488c[_0x4a3b('0x1c')](_0x4af142)[_0x4a3b('0x1d')](_0x39c702);}};}function respondWithFilteredResult(_0x2bdcd0,_0xa9da19){return function(_0x5d5d2b){if(_0x5d5d2b){var _0xeb78a9=typeof _0xa9da19[_0x4a3b('0x1e')]===_0x4a3b('0x1f')&&typeof _0xa9da19[_0x4a3b('0x20')]===_0x4a3b('0x1f');var _0x2cd32d=_0x5d5d2b['count'];var _0x47a322=_0xeb78a9?0x0:_0xa9da19[_0x4a3b('0x1e')];var _0x31b98c=_0xeb78a9?_0x5d5d2b[_0x4a3b('0x21')]:_0xa9da19[_0x4a3b('0x1e')]+_0xa9da19['limit'];var _0x261350;if(_0x31b98c>=_0x2cd32d){_0x31b98c=_0x2cd32d;_0x261350=0xc8;}else{_0x261350=0xce;}_0x2bdcd0[_0x4a3b('0x1c')](_0x261350);return _0x2bdcd0[_0x4a3b('0x22')](_0x4a3b('0x23'),_0x47a322+'-'+_0x31b98c+'/'+_0x2cd32d)[_0x4a3b('0x1d')](_0x5d5d2b);}return null;};}function patchUpdates(_0x5c61cb){return function(_0x5e2a71){try{jsonpatch[_0x4a3b('0x24')](_0x5e2a71,_0x5c61cb,!![]);}catch(_0x3e51c9){return BPromise[_0x4a3b('0x25')](_0x3e51c9);}return _0x5e2a71['save']();};}function saveUpdates(_0x5df54f,_0x38f8ba){return function(_0x291699){if(_0x291699){return _0x291699[_0x4a3b('0x26')](_0x5df54f)[_0x4a3b('0x27')](function(_0x15739d){return _0x15739d;});}return null;};}function removeEntity(_0x5337c5,_0x5761dd){return function(_0x29a848){if(_0x29a848){return _0x29a848['destroy']()[_0x4a3b('0x27')](function(){_0x5337c5[_0x4a3b('0x1c')](0xcc)[_0x4a3b('0x28')]();});}};}function handleEntityNotFound(_0x1760ba,_0x4a7f27){return function(_0x49af0d){if(!_0x49af0d){_0x1760ba[_0x4a3b('0x1b')](0x194);}return _0x49af0d;};}function handleError(_0x147936,_0x1179a3){_0x1179a3=_0x1179a3||0x1f4;return function(_0xff458f){logger[_0x4a3b('0x29')](_0xff458f['stack']);if(_0xff458f['name']){delete _0xff458f[_0x4a3b('0x2a')];}_0x147936[_0x4a3b('0x1c')](_0x1179a3)['send'](_0xff458f);};}exports[_0x4a3b('0x2b')]=function(_0xe0d6ed,_0x2eff99){var _0x5b8e4f={},_0xfe4fdb={},_0x44fa92={'count':0x0,'rows':[]};var _0x280f23=_[_0x4a3b('0x2c')](db[_0x4a3b('0x2d')][_0x4a3b('0x2e')],function(_0xfeceaf){return{'name':_0xfeceaf[_0x4a3b('0x2f')],'type':_0xfeceaf[_0x4a3b('0x30')][_0x4a3b('0x31')]};});_0xfe4fdb[_0x4a3b('0x32')]=_['map'](_0x280f23,_0x4a3b('0x2a'));_0xfe4fdb[_0x4a3b('0x33')]=_['keys'](_0xe0d6ed['query']);_0xfe4fdb['filters']=_['intersection'](_0xfe4fdb[_0x4a3b('0x32')],_0xfe4fdb[_0x4a3b('0x33')]);_0x5b8e4f[_0x4a3b('0x34')]=_[_0x4a3b('0x35')](_0xfe4fdb[_0x4a3b('0x32')],qs[_0x4a3b('0x36')](_0xe0d6ed[_0x4a3b('0x33')][_0x4a3b('0x36')]));_0x5b8e4f[_0x4a3b('0x34')]=_0x5b8e4f['attributes'][_0x4a3b('0x37')]?_0x5b8e4f['attributes']:_0xfe4fdb[_0x4a3b('0x32')];if(!_0xe0d6ed['query']['hasOwnProperty'](_0x4a3b('0x38'))){_0x5b8e4f['limit']=qs[_0x4a3b('0x20')](_0xe0d6ed[_0x4a3b('0x33')][_0x4a3b('0x20')]);_0x5b8e4f['offset']=qs[_0x4a3b('0x1e')](_0xe0d6ed['query'][_0x4a3b('0x1e')]);}_0x5b8e4f[_0x4a3b('0x39')]=qs[_0x4a3b('0x3a')](_0xe0d6ed[_0x4a3b('0x33')][_0x4a3b('0x3a')]);_0x5b8e4f[_0x4a3b('0x3b')]=qs[_0x4a3b('0x3c')](_['pick'](_0xe0d6ed[_0x4a3b('0x33')],_0xfe4fdb[_0x4a3b('0x3c')]),_0x280f23);if(_0xe0d6ed[_0x4a3b('0x33')][_0x4a3b('0x3d')]){_0x5b8e4f[_0x4a3b('0x3b')]=_['merge'](_0x5b8e4f[_0x4a3b('0x3b')],{'$or':_[_0x4a3b('0x2c')](_0x280f23,function(_0x5c54fe){if(_0x5c54fe[_0x4a3b('0x30')]!==_0x4a3b('0x3e')){var _0x33435b={};_0x33435b[_0x5c54fe[_0x4a3b('0x2a')]]={'$like':'%'+_0xe0d6ed[_0x4a3b('0x33')]['filter']+'%'};return _0x33435b;}})});}_0x5b8e4f=_[_0x4a3b('0x3f')]({},_0x5b8e4f,_0xe0d6ed[_0x4a3b('0x40')]);var _0x24cd52={'where':_0x5b8e4f[_0x4a3b('0x3b')]};return db['SalesforceConfiguration'][_0x4a3b('0x21')](_0x24cd52)['then'](function(_0x2ea8de){_0x44fa92[_0x4a3b('0x21')]=_0x2ea8de;if(_0xe0d6ed['query']['includeAll']){_0x5b8e4f[_0x4a3b('0x41')]=[{'all':!![]}];}return db[_0x4a3b('0x2d')][_0x4a3b('0x42')](_0x5b8e4f);})[_0x4a3b('0x27')](function(_0x3ad573){_0x44fa92['rows']=_0x3ad573;return _0x44fa92;})[_0x4a3b('0x27')](respondWithFilteredResult(_0x2eff99,_0x5b8e4f))[_0x4a3b('0x43')](handleError(_0x2eff99,null));};exports[_0x4a3b('0x44')]=function(_0x441081,_0x40b32c){var _0x410cef={'raw':![],'where':{'id':_0x441081[_0x4a3b('0x45')]['id']}},_0x5f3768={};_0x5f3768['model']=_[_0x4a3b('0x46')](db[_0x4a3b('0x2d')][_0x4a3b('0x2e')]);_0x5f3768[_0x4a3b('0x33')]=_['keys'](_0x441081[_0x4a3b('0x33')]);_0x5f3768['filters']=_[_0x4a3b('0x35')](_0x5f3768[_0x4a3b('0x32')],_0x5f3768[_0x4a3b('0x33')]);_0x410cef[_0x4a3b('0x34')]=_['intersection'](_0x5f3768[_0x4a3b('0x32')],qs[_0x4a3b('0x36')](_0x441081[_0x4a3b('0x33')]['fields']));_0x410cef[_0x4a3b('0x34')]=_0x410cef[_0x4a3b('0x34')][_0x4a3b('0x37')]?_0x410cef['attributes']:_0x5f3768[_0x4a3b('0x32')];if(_0x441081[_0x4a3b('0x33')][_0x4a3b('0x47')]){_0x410cef['include']=[{'all':!![]}];}_0x410cef=_[_0x4a3b('0x3f')]({},_0x410cef,_0x441081[_0x4a3b('0x40')]);return db['SalesforceConfiguration'][_0x4a3b('0x48')](_0x410cef)[_0x4a3b('0x27')](handleEntityNotFound(_0x40b32c,null))['then'](respondWithResult(_0x40b32c,null))[_0x4a3b('0x43')](handleError(_0x40b32c,null));};exports[_0x4a3b('0x49')]=function(_0x175186,_0x49258e){return db[_0x4a3b('0x2d')][_0x4a3b('0x49')](_0x175186[_0x4a3b('0x4a')],{})['then'](respondWithResult(_0x49258e,0xc9))[_0x4a3b('0x43')](handleError(_0x49258e,null));};exports['update']=function(_0x3e5063,_0x58a966){if(_0x3e5063[_0x4a3b('0x4a')]['id']){delete _0x3e5063[_0x4a3b('0x4a')]['id'];}return db['SalesforceConfiguration'][_0x4a3b('0x48')]({'where':{'id':_0x3e5063[_0x4a3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x58a966,null))['then'](saveUpdates(_0x3e5063[_0x4a3b('0x4a')],null))['then'](respondWithResult(_0x58a966,null))[_0x4a3b('0x43')](handleError(_0x58a966,null));};exports[_0x4a3b('0x4b')]=function(_0x4d8384,_0x7e9af7){return db['SalesforceConfiguration'][_0x4a3b('0x48')]({'where':{'id':_0x4d8384[_0x4a3b('0x45')]['id']}})[_0x4a3b('0x27')](handleEntityNotFound(_0x7e9af7,null))[_0x4a3b('0x27')](removeEntity(_0x7e9af7,null))[_0x4a3b('0x43')](handleError(_0x7e9af7,null));};exports[_0x4a3b('0x4c')]=function(_0xaf7e6,_0x22f4fd,_0x19350a){var _0x16c990={};var _0x37ba75={};var _0x4e30bd;var _0x2b4a4a;return db[_0x4a3b('0x2d')][_0x4a3b('0x4d')]({'where':{'id':_0xaf7e6[_0x4a3b('0x45')]['id']}})[_0x4a3b('0x27')](handleEntityNotFound(_0x22f4fd,null))['then'](function(_0x45dc5e){if(_0x45dc5e){_0x4e30bd=_0x45dc5e;_0x37ba75[_0x4a3b('0x32')]=_[_0x4a3b('0x46')](db[_0x4a3b('0x4e')][_0x4a3b('0x2e')]);_0x37ba75[_0x4a3b('0x33')]=_[_0x4a3b('0x46')](_0xaf7e6[_0x4a3b('0x33')]);_0x37ba75[_0x4a3b('0x3c')]=_['intersection'](_0x37ba75['model'],_0x37ba75[_0x4a3b('0x33')]);_0x16c990[_0x4a3b('0x34')]=_[_0x4a3b('0x35')](_0x37ba75[_0x4a3b('0x32')],qs[_0x4a3b('0x36')](_0xaf7e6['query'][_0x4a3b('0x36')]));_0x16c990[_0x4a3b('0x34')]=_0x16c990[_0x4a3b('0x34')]['length']?_0x16c990[_0x4a3b('0x34')]:_0x37ba75[_0x4a3b('0x32')];_0x16c990[_0x4a3b('0x39')]=qs[_0x4a3b('0x3a')](_0xaf7e6['query'][_0x4a3b('0x3a')]);_0x16c990[_0x4a3b('0x3b')]=qs[_0x4a3b('0x3c')](_[_0x4a3b('0x4f')](_0xaf7e6['query'],_0x37ba75['filters']));if(_0xaf7e6[_0x4a3b('0x33')][_0x4a3b('0x3d')]){_0x16c990[_0x4a3b('0x3b')]=_[_0x4a3b('0x3f')](_0x16c990[_0x4a3b('0x3b')],{'$or':_[_0x4a3b('0x2c')](_0x16c990[_0x4a3b('0x34')],function(_0x39b5da){var _0x4278a5={};_0x4278a5[_0x39b5da]={'$like':'%'+_0xaf7e6[_0x4a3b('0x33')]['filter']+'%'};return _0x4278a5;})});}_0x16c990=_[_0x4a3b('0x3f')]({},_0x16c990,_0xaf7e6[_0x4a3b('0x40')]);return _0x4e30bd['getFields'](_0x16c990);}})[_0x4a3b('0x27')](function(_0xa271bf){if(_0xa271bf){_0x2b4a4a=_0xa271bf['length'];if(!_0xaf7e6[_0x4a3b('0x33')][_0x4a3b('0x50')](_0x4a3b('0x38'))){_0x16c990[_0x4a3b('0x20')]=qs[_0x4a3b('0x20')](_0xaf7e6[_0x4a3b('0x33')][_0x4a3b('0x20')]);_0x16c990['offset']=qs['offset'](_0xaf7e6[_0x4a3b('0x33')]['offset']);}return _0x4e30bd[_0x4a3b('0x4c')](_0x16c990);}})[_0x4a3b('0x27')](function(_0x20d5a9){if(_0x20d5a9){return _0x20d5a9?{'count':_0x2b4a4a,'rows':_0x20d5a9}:null;}})['then'](respondWithResult(_0x22f4fd,null))[_0x4a3b('0x43')](handleError(_0x22f4fd,null));};exports[_0x4a3b('0x51')]=function(_0x38332d,_0xf2c082,_0x52fd7a){var _0x3c5f0d={};var _0x4f66c2={};var _0x2b2e28;var _0x2261c9;return db[_0x4a3b('0x2d')][_0x4a3b('0x4d')]({'where':{'id':_0x38332d[_0x4a3b('0x45')]['id']}})[_0x4a3b('0x27')](handleEntityNotFound(_0xf2c082,null))[_0x4a3b('0x27')](function(_0xc4ab90){if(_0xc4ab90){_0x2b2e28=_0xc4ab90;_0x4f66c2[_0x4a3b('0x32')]=_['keys'](db[_0x4a3b('0x4e')][_0x4a3b('0x2e')]);_0x4f66c2[_0x4a3b('0x33')]=_[_0x4a3b('0x46')](_0x38332d[_0x4a3b('0x33')]);_0x4f66c2['filters']=_[_0x4a3b('0x35')](_0x4f66c2['model'],_0x4f66c2[_0x4a3b('0x33')]);_0x3c5f0d['attributes']=_[_0x4a3b('0x35')](_0x4f66c2['model'],qs[_0x4a3b('0x36')](_0x38332d[_0x4a3b('0x33')][_0x4a3b('0x36')]));_0x3c5f0d[_0x4a3b('0x34')]=_0x3c5f0d['attributes']['length']?_0x3c5f0d[_0x4a3b('0x34')]:_0x4f66c2[_0x4a3b('0x32')];_0x3c5f0d[_0x4a3b('0x39')]=qs[_0x4a3b('0x3a')](_0x38332d[_0x4a3b('0x33')][_0x4a3b('0x3a')]);_0x3c5f0d[_0x4a3b('0x3b')]=qs[_0x4a3b('0x3c')](_[_0x4a3b('0x4f')](_0x38332d[_0x4a3b('0x33')],_0x4f66c2['filters']));if(_0x38332d[_0x4a3b('0x33')][_0x4a3b('0x3d')]){_0x3c5f0d[_0x4a3b('0x3b')]=_['merge'](_0x3c5f0d[_0x4a3b('0x3b')],{'$or':_[_0x4a3b('0x2c')](_0x3c5f0d['attributes'],function(_0x3c0510){var _0xf0539f={};_0xf0539f[_0x3c0510]={'$like':'%'+_0x38332d[_0x4a3b('0x33')][_0x4a3b('0x3d')]+'%'};return _0xf0539f;})});}_0x3c5f0d=_[_0x4a3b('0x3f')]({},_0x3c5f0d,_0x38332d[_0x4a3b('0x40')]);return _0x2b2e28[_0x4a3b('0x51')](_0x3c5f0d);}})[_0x4a3b('0x27')](function(_0x2ad5f8){if(_0x2ad5f8){_0x2261c9=_0x2ad5f8[_0x4a3b('0x37')];if(!_0x38332d[_0x4a3b('0x33')][_0x4a3b('0x50')](_0x4a3b('0x38'))){_0x3c5f0d[_0x4a3b('0x20')]=qs[_0x4a3b('0x20')](_0x38332d['query'][_0x4a3b('0x20')]);_0x3c5f0d[_0x4a3b('0x1e')]=qs[_0x4a3b('0x1e')](_0x38332d['query'][_0x4a3b('0x1e')]);}return _0x2b2e28[_0x4a3b('0x51')](_0x3c5f0d);}})[_0x4a3b('0x27')](function(_0x517c20){if(_0x517c20){return _0x517c20?{'count':_0x2261c9,'rows':_0x517c20}:null;}})[_0x4a3b('0x27')](respondWithResult(_0xf2c082,null))['catch'](handleError(_0xf2c082,null));};exports[_0x4a3b('0x52')]=function(_0x55904f,_0x46b1bf,_0x49933c){var _0x5a1fc5={};var _0xa0feb4={};var _0x3c0ad5;var _0x454963;return db['SalesforceConfiguration'][_0x4a3b('0x4d')]({'where':{'id':_0x55904f[_0x4a3b('0x45')]['id']}})[_0x4a3b('0x27')](handleEntityNotFound(_0x46b1bf,null))[_0x4a3b('0x27')](function(_0x5ebe58){if(_0x5ebe58){_0x3c0ad5=_0x5ebe58;_0xa0feb4[_0x4a3b('0x32')]=_[_0x4a3b('0x46')](db[_0x4a3b('0x4e')][_0x4a3b('0x2e')]);_0xa0feb4['query']=_[_0x4a3b('0x46')](_0x55904f[_0x4a3b('0x33')]);_0xa0feb4[_0x4a3b('0x3c')]=_[_0x4a3b('0x35')](_0xa0feb4['model'],_0xa0feb4[_0x4a3b('0x33')]);_0x5a1fc5[_0x4a3b('0x34')]=_[_0x4a3b('0x35')](_0xa0feb4[_0x4a3b('0x32')],qs['fields'](_0x55904f[_0x4a3b('0x33')]['fields']));_0x5a1fc5[_0x4a3b('0x34')]=_0x5a1fc5[_0x4a3b('0x34')]['length']?_0x5a1fc5[_0x4a3b('0x34')]:_0xa0feb4[_0x4a3b('0x32')];_0x5a1fc5[_0x4a3b('0x39')]=qs['sort'](_0x55904f[_0x4a3b('0x33')][_0x4a3b('0x3a')]);_0x5a1fc5[_0x4a3b('0x3b')]=qs[_0x4a3b('0x3c')](_[_0x4a3b('0x4f')](_0x55904f[_0x4a3b('0x33')],_0xa0feb4[_0x4a3b('0x3c')]));if(_0x55904f[_0x4a3b('0x33')][_0x4a3b('0x3d')]){_0x5a1fc5[_0x4a3b('0x3b')]=_[_0x4a3b('0x3f')](_0x5a1fc5['where'],{'$or':_['map'](_0x5a1fc5[_0x4a3b('0x34')],function(_0x4bf9a5){var _0x5200b1={};_0x5200b1[_0x4bf9a5]={'$like':'%'+_0x55904f['query']['filter']+'%'};return _0x5200b1;})});}_0x5a1fc5=_[_0x4a3b('0x3f')]({},_0x5a1fc5,_0x55904f[_0x4a3b('0x40')]);return _0x3c0ad5[_0x4a3b('0x52')](_0x5a1fc5);}})[_0x4a3b('0x27')](function(_0x5e675f){if(_0x5e675f){_0x454963=_0x5e675f[_0x4a3b('0x37')];if(!_0x55904f[_0x4a3b('0x33')][_0x4a3b('0x50')]('nolimit')){_0x5a1fc5['limit']=qs['limit'](_0x55904f[_0x4a3b('0x33')]['limit']);_0x5a1fc5[_0x4a3b('0x1e')]=qs[_0x4a3b('0x1e')](_0x55904f[_0x4a3b('0x33')][_0x4a3b('0x1e')]);}return _0x3c0ad5[_0x4a3b('0x52')](_0x5a1fc5);}})[_0x4a3b('0x27')](function(_0x5b10f6){if(_0x5b10f6){return _0x5b10f6?{'count':_0x454963,'rows':_0x5b10f6}:null;}})[_0x4a3b('0x27')](respondWithResult(_0x46b1bf,null))[_0x4a3b('0x43')](handleError(_0x46b1bf,null));}; \ No newline at end of file +var _0x7e63=['SalesforceConfiguration','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map'];(function(_0x30ca4c,_0x168449){var _0x2ee8ff=function(_0x528063){while(--_0x528063){_0x30ca4c['push'](_0x30ca4c['shift']());}};_0x2ee8ff(++_0x168449);}(_0x7e63,0x74));var _0x37e6=function(_0x5e762a,_0x37e347){_0x5e762a=_0x5e762a-0x0;var _0x3df8ec=_0x7e63[_0x5e762a];return _0x3df8ec;};'use strict';var emlformat=require(_0x37e6('0x0'));var rimraf=require(_0x37e6('0x1'));var zipdir=require(_0x37e6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37e6('0x3'));var moment=require(_0x37e6('0x4'));var BPromise=require(_0x37e6('0x5'));var Mustache=require('mustache');var util=require(_0x37e6('0x6'));var path=require(_0x37e6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x37e6('0x8'));var fs=require('fs');var fs_extra=require(_0x37e6('0x9'));var _=require(_0x37e6('0xa'));var squel=require('squel');var crypto=require(_0x37e6('0xb'));var jsforce=require(_0x37e6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x37e6('0xd'));var querystring=require(_0x37e6('0xe'));var Papa=require(_0x37e6('0xf'));var Redis=require(_0x37e6('0x10'));var authService=require(_0x37e6('0x11'));var qs=require(_0x37e6('0x12'));var as=require(_0x37e6('0x13'));var hardwareService=require(_0x37e6('0x14'));var logger=require('../../config/logger')(_0x37e6('0x15'));var utils=require(_0x37e6('0x16'));var config=require(_0x37e6('0x17'));var licenseUtil=require(_0x37e6('0x18'));var db=require(_0x37e6('0x19'))['db'];function respondWithStatusCode(_0x3f7687,_0x3496a2){_0x3496a2=_0x3496a2||0xcc;return function(_0x26cd23){if(_0x26cd23){return _0x3f7687[_0x37e6('0x1a')](_0x3496a2);}return _0x3f7687[_0x37e6('0x1b')](_0x3496a2)[_0x37e6('0x1c')]();};}function respondWithResult(_0x5269aa,_0x258295){_0x258295=_0x258295||0xc8;return function(_0x4f1a03){if(_0x4f1a03){return _0x5269aa['status'](_0x258295)[_0x37e6('0x1d')](_0x4f1a03);}};}function respondWithFilteredResult(_0x4bc135,_0x419f4a){return function(_0x550e1e){if(_0x550e1e){var _0x495109=typeof _0x419f4a[_0x37e6('0x1e')]===_0x37e6('0x1f')&&typeof _0x419f4a[_0x37e6('0x20')]==='undefined';var _0x1f5771=_0x550e1e[_0x37e6('0x21')];var _0x25a5e9=_0x495109?0x0:_0x419f4a[_0x37e6('0x1e')];var _0x1650f3=_0x495109?_0x550e1e[_0x37e6('0x21')]:_0x419f4a[_0x37e6('0x1e')]+_0x419f4a[_0x37e6('0x20')];var _0x383ac9;if(_0x1650f3>=_0x1f5771){_0x1650f3=_0x1f5771;_0x383ac9=0xc8;}else{_0x383ac9=0xce;}_0x4bc135[_0x37e6('0x1b')](_0x383ac9);return _0x4bc135['set'](_0x37e6('0x22'),_0x25a5e9+'-'+_0x1650f3+'/'+_0x1f5771)[_0x37e6('0x1d')](_0x550e1e);}return null;};}function patchUpdates(_0x352fb9){return function(_0x1e7d34){try{jsonpatch[_0x37e6('0x23')](_0x1e7d34,_0x352fb9,!![]);}catch(_0x5d58d6){return BPromise[_0x37e6('0x24')](_0x5d58d6);}return _0x1e7d34[_0x37e6('0x25')]();};}function saveUpdates(_0x42bc16,_0x22fa3b){return function(_0x4e3caa){if(_0x4e3caa){return _0x4e3caa[_0x37e6('0x26')](_0x42bc16)[_0x37e6('0x27')](function(_0x4862b0){return _0x4862b0;});}return null;};}function removeEntity(_0x213fb7,_0x17dc4e){return function(_0x25fbb0){if(_0x25fbb0){return _0x25fbb0[_0x37e6('0x28')]()[_0x37e6('0x27')](function(){_0x213fb7[_0x37e6('0x1b')](0xcc)[_0x37e6('0x1c')]();});}};}function handleEntityNotFound(_0xd2dec8,_0x3ca17a){return function(_0x4b2de9){if(!_0x4b2de9){_0xd2dec8[_0x37e6('0x1a')](0x194);}return _0x4b2de9;};}function handleError(_0x19b9b4,_0x2f4941){_0x2f4941=_0x2f4941||0x1f4;return function(_0x21f0ba){logger[_0x37e6('0x29')](_0x21f0ba['stack']);if(_0x21f0ba[_0x37e6('0x2a')]){delete _0x21f0ba[_0x37e6('0x2a')];}_0x19b9b4[_0x37e6('0x1b')](_0x2f4941)[_0x37e6('0x2b')](_0x21f0ba);};}exports[_0x37e6('0x2c')]=function(_0x1da3f7,_0x1601f3){var _0x3ea7f5={},_0x2e11ac={},_0x2d5a52={'count':0x0,'rows':[]};var _0x227636=_[_0x37e6('0x2d')](db[_0x37e6('0x2e')][_0x37e6('0x2f')],function(_0x3e8caa){return{'name':_0x3e8caa['fieldName'],'type':_0x3e8caa[_0x37e6('0x30')][_0x37e6('0x31')]};});_0x2e11ac[_0x37e6('0x32')]=_[_0x37e6('0x2d')](_0x227636,'name');_0x2e11ac[_0x37e6('0x33')]=_[_0x37e6('0x34')](_0x1da3f7[_0x37e6('0x33')]);_0x2e11ac['filters']=_[_0x37e6('0x35')](_0x2e11ac[_0x37e6('0x32')],_0x2e11ac[_0x37e6('0x33')]);_0x3ea7f5[_0x37e6('0x36')]=_[_0x37e6('0x35')](_0x2e11ac[_0x37e6('0x32')],qs[_0x37e6('0x37')](_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x37')]));_0x3ea7f5['attributes']=_0x3ea7f5['attributes'][_0x37e6('0x38')]?_0x3ea7f5[_0x37e6('0x36')]:_0x2e11ac[_0x37e6('0x32')];if(!_0x1da3f7['query'][_0x37e6('0x39')](_0x37e6('0x3a'))){_0x3ea7f5['limit']=qs[_0x37e6('0x20')](_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x20')]);_0x3ea7f5[_0x37e6('0x1e')]=qs['offset'](_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x1e')]);}_0x3ea7f5[_0x37e6('0x3b')]=qs[_0x37e6('0x3c')](_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x3c')]);_0x3ea7f5['where']=qs[_0x37e6('0x3d')](_[_0x37e6('0x3e')](_0x1da3f7[_0x37e6('0x33')],_0x2e11ac[_0x37e6('0x3d')]),_0x227636);if(_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x3f')]){_0x3ea7f5[_0x37e6('0x40')]=_[_0x37e6('0x41')](_0x3ea7f5[_0x37e6('0x40')],{'$or':_[_0x37e6('0x2d')](_0x227636,function(_0x24066a){if(_0x24066a[_0x37e6('0x30')]!=='VIRTUAL'){var _0xac1ed0={};_0xac1ed0[_0x24066a[_0x37e6('0x2a')]]={'$like':'%'+_0x1da3f7[_0x37e6('0x33')]['filter']+'%'};return _0xac1ed0;}})});}_0x3ea7f5=_[_0x37e6('0x41')]({},_0x3ea7f5,_0x1da3f7[_0x37e6('0x42')]);var _0x54f11f={'where':_0x3ea7f5[_0x37e6('0x40')]};return db[_0x37e6('0x2e')][_0x37e6('0x21')](_0x54f11f)[_0x37e6('0x27')](function(_0x48856d){_0x2d5a52[_0x37e6('0x21')]=_0x48856d;if(_0x1da3f7[_0x37e6('0x33')][_0x37e6('0x43')]){_0x3ea7f5[_0x37e6('0x44')]=[{'all':!![]}];}return db[_0x37e6('0x2e')][_0x37e6('0x45')](_0x3ea7f5);})[_0x37e6('0x27')](function(_0x5605d9){_0x2d5a52[_0x37e6('0x46')]=_0x5605d9;return _0x2d5a52;})[_0x37e6('0x27')](respondWithFilteredResult(_0x1601f3,_0x3ea7f5))[_0x37e6('0x47')](handleError(_0x1601f3,null));};exports[_0x37e6('0x48')]=function(_0x5b905d,_0x103323){var _0x3e82e7={'raw':![],'where':{'id':_0x5b905d[_0x37e6('0x49')]['id']}},_0x136c90={};_0x136c90[_0x37e6('0x32')]=_['keys'](db['SalesforceConfiguration'][_0x37e6('0x2f')]);_0x136c90[_0x37e6('0x33')]=_[_0x37e6('0x34')](_0x5b905d[_0x37e6('0x33')]);_0x136c90['filters']=_['intersection'](_0x136c90[_0x37e6('0x32')],_0x136c90[_0x37e6('0x33')]);_0x3e82e7['attributes']=_[_0x37e6('0x35')](_0x136c90[_0x37e6('0x32')],qs['fields'](_0x5b905d['query'][_0x37e6('0x37')]));_0x3e82e7[_0x37e6('0x36')]=_0x3e82e7[_0x37e6('0x36')]['length']?_0x3e82e7[_0x37e6('0x36')]:_0x136c90['model'];if(_0x5b905d[_0x37e6('0x33')][_0x37e6('0x43')]){_0x3e82e7[_0x37e6('0x44')]=[{'all':!![]}];}_0x3e82e7=_['merge']({},_0x3e82e7,_0x5b905d['options']);return db[_0x37e6('0x2e')][_0x37e6('0x4a')](_0x3e82e7)[_0x37e6('0x27')](handleEntityNotFound(_0x103323,null))[_0x37e6('0x27')](respondWithResult(_0x103323,null))[_0x37e6('0x47')](handleError(_0x103323,null));};exports['create']=function(_0xc0f76e,_0x37f767){return db['SalesforceConfiguration']['create'](_0xc0f76e[_0x37e6('0x4b')],{})['then'](respondWithResult(_0x37f767,0xc9))[_0x37e6('0x47')](handleError(_0x37f767,null));};exports[_0x37e6('0x26')]=function(_0x5efcc1,_0x22cf2a){if(_0x5efcc1[_0x37e6('0x4b')]['id']){delete _0x5efcc1['body']['id'];}return db[_0x37e6('0x2e')][_0x37e6('0x4a')]({'where':{'id':_0x5efcc1[_0x37e6('0x49')]['id']}})['then'](handleEntityNotFound(_0x22cf2a,null))[_0x37e6('0x27')](saveUpdates(_0x5efcc1['body'],null))[_0x37e6('0x27')](respondWithResult(_0x22cf2a,null))[_0x37e6('0x47')](handleError(_0x22cf2a,null));};exports[_0x37e6('0x28')]=function(_0x5c7b17,_0x5dd8d0){return db[_0x37e6('0x2e')][_0x37e6('0x4a')]({'where':{'id':_0x5c7b17[_0x37e6('0x49')]['id']}})[_0x37e6('0x27')](handleEntityNotFound(_0x5dd8d0,null))[_0x37e6('0x27')](removeEntity(_0x5dd8d0,null))[_0x37e6('0x47')](handleError(_0x5dd8d0,null));};exports[_0x37e6('0x4c')]=function(_0x12bb2c,_0x466174,_0x2c4fb8){var _0x3ee716={};var _0x5716c9={};var _0x28d81b;var _0x40230a;return db[_0x37e6('0x2e')][_0x37e6('0x4d')]({'where':{'id':_0x12bb2c[_0x37e6('0x49')]['id']}})[_0x37e6('0x27')](handleEntityNotFound(_0x466174,null))[_0x37e6('0x27')](function(_0x27ce94){if(_0x27ce94){_0x28d81b=_0x27ce94;_0x5716c9[_0x37e6('0x32')]=_[_0x37e6('0x34')](db[_0x37e6('0x4e')][_0x37e6('0x2f')]);_0x5716c9[_0x37e6('0x33')]=_[_0x37e6('0x34')](_0x12bb2c['query']);_0x5716c9[_0x37e6('0x3d')]=_[_0x37e6('0x35')](_0x5716c9[_0x37e6('0x32')],_0x5716c9[_0x37e6('0x33')]);_0x3ee716[_0x37e6('0x36')]=_[_0x37e6('0x35')](_0x5716c9['model'],qs['fields'](_0x12bb2c[_0x37e6('0x33')][_0x37e6('0x37')]));_0x3ee716['attributes']=_0x3ee716['attributes']['length']?_0x3ee716[_0x37e6('0x36')]:_0x5716c9['model'];_0x3ee716[_0x37e6('0x3b')]=qs[_0x37e6('0x3c')](_0x12bb2c[_0x37e6('0x33')][_0x37e6('0x3c')]);_0x3ee716[_0x37e6('0x40')]=qs[_0x37e6('0x3d')](_[_0x37e6('0x3e')](_0x12bb2c[_0x37e6('0x33')],_0x5716c9[_0x37e6('0x3d')]));if(_0x12bb2c['query'][_0x37e6('0x3f')]){_0x3ee716[_0x37e6('0x40')]=_[_0x37e6('0x41')](_0x3ee716[_0x37e6('0x40')],{'$or':_['map'](_0x3ee716['attributes'],function(_0x17d14c){var _0x28ebea={};_0x28ebea[_0x17d14c]={'$like':'%'+_0x12bb2c[_0x37e6('0x33')]['filter']+'%'};return _0x28ebea;})});}_0x3ee716=_['merge']({},_0x3ee716,_0x12bb2c['options']);return _0x28d81b['getFields'](_0x3ee716);}})['then'](function(_0x4061bb){if(_0x4061bb){_0x40230a=_0x4061bb[_0x37e6('0x38')];if(!_0x12bb2c[_0x37e6('0x33')]['hasOwnProperty'](_0x37e6('0x3a'))){_0x3ee716[_0x37e6('0x20')]=qs[_0x37e6('0x20')](_0x12bb2c[_0x37e6('0x33')][_0x37e6('0x20')]);_0x3ee716[_0x37e6('0x1e')]=qs[_0x37e6('0x1e')](_0x12bb2c[_0x37e6('0x33')]['offset']);}return _0x28d81b[_0x37e6('0x4c')](_0x3ee716);}})['then'](function(_0x24f331){if(_0x24f331){return _0x24f331?{'count':_0x40230a,'rows':_0x24f331}:null;}})[_0x37e6('0x27')](respondWithResult(_0x466174,null))[_0x37e6('0x47')](handleError(_0x466174,null));};exports[_0x37e6('0x4f')]=function(_0x574f84,_0x310a45,_0x1f5e20){var _0x437862={};var _0x4bc2b2={};var _0x5ee81d;var _0x2457ce;return db[_0x37e6('0x2e')][_0x37e6('0x4d')]({'where':{'id':_0x574f84[_0x37e6('0x49')]['id']}})['then'](handleEntityNotFound(_0x310a45,null))['then'](function(_0x354f92){if(_0x354f92){_0x5ee81d=_0x354f92;_0x4bc2b2[_0x37e6('0x32')]=_[_0x37e6('0x34')](db[_0x37e6('0x4e')][_0x37e6('0x2f')]);_0x4bc2b2['query']=_[_0x37e6('0x34')](_0x574f84[_0x37e6('0x33')]);_0x4bc2b2[_0x37e6('0x3d')]=_[_0x37e6('0x35')](_0x4bc2b2[_0x37e6('0x32')],_0x4bc2b2[_0x37e6('0x33')]);_0x437862['attributes']=_[_0x37e6('0x35')](_0x4bc2b2[_0x37e6('0x32')],qs[_0x37e6('0x37')](_0x574f84['query'][_0x37e6('0x37')]));_0x437862[_0x37e6('0x36')]=_0x437862['attributes']['length']?_0x437862[_0x37e6('0x36')]:_0x4bc2b2[_0x37e6('0x32')];_0x437862[_0x37e6('0x3b')]=qs[_0x37e6('0x3c')](_0x574f84['query'][_0x37e6('0x3c')]);_0x437862[_0x37e6('0x40')]=qs[_0x37e6('0x3d')](_['pick'](_0x574f84[_0x37e6('0x33')],_0x4bc2b2[_0x37e6('0x3d')]));if(_0x574f84[_0x37e6('0x33')]['filter']){_0x437862[_0x37e6('0x40')]=_['merge'](_0x437862[_0x37e6('0x40')],{'$or':_[_0x37e6('0x2d')](_0x437862[_0x37e6('0x36')],function(_0x428a1c){var _0x2017e7={};_0x2017e7[_0x428a1c]={'$like':'%'+_0x574f84[_0x37e6('0x33')][_0x37e6('0x3f')]+'%'};return _0x2017e7;})});}_0x437862=_[_0x37e6('0x41')]({},_0x437862,_0x574f84[_0x37e6('0x42')]);return _0x5ee81d['getSubjects'](_0x437862);}})[_0x37e6('0x27')](function(_0x426874){if(_0x426874){_0x2457ce=_0x426874['length'];if(!_0x574f84[_0x37e6('0x33')]['hasOwnProperty'](_0x37e6('0x3a'))){_0x437862['limit']=qs['limit'](_0x574f84[_0x37e6('0x33')][_0x37e6('0x20')]);_0x437862[_0x37e6('0x1e')]=qs[_0x37e6('0x1e')](_0x574f84[_0x37e6('0x33')][_0x37e6('0x1e')]);}return _0x5ee81d[_0x37e6('0x4f')](_0x437862);}})[_0x37e6('0x27')](function(_0x3a5ccf){if(_0x3a5ccf){return _0x3a5ccf?{'count':_0x2457ce,'rows':_0x3a5ccf}:null;}})[_0x37e6('0x27')](respondWithResult(_0x310a45,null))[_0x37e6('0x47')](handleError(_0x310a45,null));};exports[_0x37e6('0x50')]=function(_0x21019c,_0x3c4c19,_0x33bf5a){var _0x5dd6f5={};var _0x108c37={};var _0x170d25;var _0x3ee90c;return db[_0x37e6('0x2e')][_0x37e6('0x4d')]({'where':{'id':_0x21019c['params']['id']}})[_0x37e6('0x27')](handleEntityNotFound(_0x3c4c19,null))[_0x37e6('0x27')](function(_0x1bdb8b){if(_0x1bdb8b){_0x170d25=_0x1bdb8b;_0x108c37[_0x37e6('0x32')]=_[_0x37e6('0x34')](db[_0x37e6('0x4e')][_0x37e6('0x2f')]);_0x108c37['query']=_[_0x37e6('0x34')](_0x21019c[_0x37e6('0x33')]);_0x108c37[_0x37e6('0x3d')]=_['intersection'](_0x108c37[_0x37e6('0x32')],_0x108c37[_0x37e6('0x33')]);_0x5dd6f5[_0x37e6('0x36')]=_[_0x37e6('0x35')](_0x108c37['model'],qs[_0x37e6('0x37')](_0x21019c[_0x37e6('0x33')]['fields']));_0x5dd6f5['attributes']=_0x5dd6f5[_0x37e6('0x36')][_0x37e6('0x38')]?_0x5dd6f5['attributes']:_0x108c37[_0x37e6('0x32')];_0x5dd6f5[_0x37e6('0x3b')]=qs[_0x37e6('0x3c')](_0x21019c[_0x37e6('0x33')][_0x37e6('0x3c')]);_0x5dd6f5['where']=qs[_0x37e6('0x3d')](_[_0x37e6('0x3e')](_0x21019c['query'],_0x108c37[_0x37e6('0x3d')]));if(_0x21019c['query'][_0x37e6('0x3f')]){_0x5dd6f5[_0x37e6('0x40')]=_[_0x37e6('0x41')](_0x5dd6f5['where'],{'$or':_[_0x37e6('0x2d')](_0x5dd6f5[_0x37e6('0x36')],function(_0x32d96e){var _0x4a0b91={};_0x4a0b91[_0x32d96e]={'$like':'%'+_0x21019c['query'][_0x37e6('0x3f')]+'%'};return _0x4a0b91;})});}_0x5dd6f5=_['merge']({},_0x5dd6f5,_0x21019c[_0x37e6('0x42')]);return _0x170d25[_0x37e6('0x50')](_0x5dd6f5);}})[_0x37e6('0x27')](function(_0x3e6d40){if(_0x3e6d40){_0x3ee90c=_0x3e6d40[_0x37e6('0x38')];if(!_0x21019c[_0x37e6('0x33')]['hasOwnProperty'](_0x37e6('0x3a'))){_0x5dd6f5[_0x37e6('0x20')]=qs['limit'](_0x21019c[_0x37e6('0x33')][_0x37e6('0x20')]);_0x5dd6f5['offset']=qs['offset'](_0x21019c['query'][_0x37e6('0x1e')]);}return _0x170d25[_0x37e6('0x50')](_0x5dd6f5);}})['then'](function(_0x3b422b){if(_0x3b422b){return _0x3b422b?{'count':_0x3ee90c,'rows':_0x3b422b}:null;}})[_0x37e6('0x27')](respondWithResult(_0x3c4c19,null))['catch'](handleError(_0x3c4c19,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 7d57779..3c732d7 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 _0xe4e3=['path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xe4e3,0x6a));var _0x3e4e=function(_0xa6f2cc,_0x27f2dc){_0xa6f2cc=_0xa6f2cc-0x0;var _0x1da25a=_0xe4e3[_0xa6f2cc];return _0x1da25a;};'use strict';var _=require(_0x3e4e('0x0'));var util=require('util');var logger=require(_0x3e4e('0x1'))(_0x3e4e('0x2'));var moment=require(_0x3e4e('0x3'));var BPromise=require(_0x3e4e('0x4'));var rp=require(_0x3e4e('0x5'));var fs=require('fs');var path=require(_0x3e4e('0x6'));var rimraf=require(_0x3e4e('0x7'));var config=require(_0x3e4e('0x8'));var attributes=require(_0x3e4e('0x9'));module[_0x3e4e('0xa')]=function(_0x47654f,_0x2221c5){return _0x47654f[_0x3e4e('0xb')](_0x3e4e('0xc'),attributes,{'tableName':_0x3e4e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a11=['exports','SalesforceConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x21294d,_0x21e45d){var _0x1f7db6=function(_0xa2f8ab){while(--_0xa2f8ab){_0x21294d['push'](_0x21294d['shift']());}};_0x1f7db6(++_0x21e45d);}(_0x5a11,0xe8));var _0x15a1=function(_0x11e0e6,_0x2da16f){_0x11e0e6=_0x11e0e6-0x0;var _0x4826b7=_0x5a11[_0x11e0e6];return _0x4826b7;};'use strict';var _=require(_0x15a1('0x0'));var util=require('util');var logger=require(_0x15a1('0x1'))(_0x15a1('0x2'));var moment=require(_0x15a1('0x3'));var BPromise=require(_0x15a1('0x4'));var rp=require(_0x15a1('0x5'));var fs=require('fs');var path=require(_0x15a1('0x6'));var rimraf=require('rimraf');var config=require(_0x15a1('0x7'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0x15a1('0x8')]=function(_0x486341,_0x4f3fdd){return _0x486341['define'](_0x15a1('0x9'),attributes,{'tableName':'int_salesforce_configurations','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 e934bd1..9168a4b 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 _0xfbf7=['stringify','error','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x31f390,_0xc56701){var _0x49ad8a=function(_0x44e3bd){while(--_0x44e3bd){_0x31f390['push'](_0x31f390['shift']());}};_0x49ad8a(++_0xc56701);}(_0xfbf7,0x148));var _0x7fbf=function(_0x1294af,_0x3fa78a){_0x1294af=_0x1294af-0x0;var _0xd2ca86=_0xfbf7[_0x1294af];return _0xd2ca86;};'use strict';var _=require(_0x7fbf('0x0'));var util=require('util');var moment=require(_0x7fbf('0x1'));var BPromise=require(_0x7fbf('0x2'));var rs=require(_0x7fbf('0x3'));var fs=require('fs');var Redis=require(_0x7fbf('0x4'));var db=require(_0x7fbf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7fbf('0x6'))('rpc');var config=require(_0x7fbf('0x7'));var jayson=require(_0x7fbf('0x8'));var client=jayson['client'][_0x7fbf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1955ba,_0x4e0755,_0x4a5f5a){return new BPromise(function(_0x45c306,_0x30370f){return client[_0x7fbf('0xa')](_0x1955ba,_0x4a5f5a)[_0x7fbf('0xb')](function(_0x289183){logger['info'](_0x7fbf('0xc'),_0x4e0755,'request\x20sent');logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x4e0755,_0x7fbf('0xd'),JSON[_0x7fbf('0xe')](_0x289183));if(_0x289183['error']){if(_0x289183['error']['code']===0x1f4){logger['error'](_0x7fbf('0xc'),_0x4e0755,_0x289183[_0x7fbf('0xf')][_0x7fbf('0x10')]);return _0x30370f(_0x289183[_0x7fbf('0xf')][_0x7fbf('0x10')]);}logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x4e0755,_0x289183[_0x7fbf('0xf')]['message']);return _0x45c306(_0x289183[_0x7fbf('0xf')][_0x7fbf('0x10')]);}else{logger[_0x7fbf('0x11')](_0x7fbf('0xc'),_0x4e0755,'request\x20sent');_0x45c306(_0x289183[_0x7fbf('0x12')][_0x7fbf('0x10')]);}})['catch'](function(_0xea7eb8){logger[_0x7fbf('0xf')](_0x7fbf('0xc'),_0x4e0755,_0xea7eb8);_0x30370f(_0xea7eb8);});});} \ No newline at end of file +var _0xba77=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','moment'];(function(_0x340380,_0x4bd2a8){var _0x49ce1c=function(_0x4cb9e2){while(--_0x4cb9e2){_0x340380['push'](_0x340380['shift']());}};_0x49ce1c(++_0x4bd2a8);}(_0xba77,0x15e));var _0x7ba7=function(_0x1dbaf7,_0x3d05b3){_0x1dbaf7=_0x1dbaf7-0x0;var _0x593f05=_0xba77[_0x1dbaf7];return _0x593f05;};'use strict';var _=require(_0x7ba7('0x0'));var util=require('util');var moment=require(_0x7ba7('0x1'));var BPromise=require('bluebird');var rs=require(_0x7ba7('0x2'));var fs=require('fs');var Redis=require(_0x7ba7('0x3'));var db=require(_0x7ba7('0x4'))['db'];var utils=require(_0x7ba7('0x5'));var logger=require(_0x7ba7('0x6'))(_0x7ba7('0x7'));var config=require(_0x7ba7('0x8'));var jayson=require(_0x7ba7('0x9'));var client=jayson[_0x7ba7('0xa')][_0x7ba7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c9fe3,_0x46dde2,_0xf37844){return new BPromise(function(_0x2c0ff4,_0x342f00){return client[_0x7ba7('0xc')](_0x4c9fe3,_0xf37844)['then'](function(_0x4a046f){logger[_0x7ba7('0xd')](_0x7ba7('0xe'),_0x46dde2,_0x7ba7('0xf'));logger[_0x7ba7('0x10')](_0x7ba7('0x11'),_0x46dde2,'request\x20sent',JSON[_0x7ba7('0x12')](_0x4a046f));if(_0x4a046f[_0x7ba7('0x13')]){if(_0x4a046f[_0x7ba7('0x13')]['code']===0x1f4){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x46dde2,_0x4a046f[_0x7ba7('0x13')][_0x7ba7('0x14')]);return _0x342f00(_0x4a046f['error']['message']);}logger[_0x7ba7('0x13')](_0x7ba7('0xe'),_0x46dde2,_0x4a046f[_0x7ba7('0x13')]['message']);return _0x2c0ff4(_0x4a046f[_0x7ba7('0x13')][_0x7ba7('0x14')]);}else{logger['info']('SalesforceConfiguration,\x20%s,\x20%s',_0x46dde2,_0x7ba7('0xf'));_0x2c0ff4(_0x4a046f['result']['message']);}})[_0x7ba7('0x15')](function(_0x467427){logger['error'](_0x7ba7('0xe'),_0x46dde2,_0x467427);_0x342f00(_0x467427);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index a74fd8c..6d90590 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 _0xb0b2=['../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x37c762,_0x391c6f){var _0x2d887f=function(_0x4b3800){while(--_0x4b3800){_0x37c762['push'](_0x37c762['shift']());}};_0x2d887f(++_0x391c6f);}(_0xb0b2,0x184));var _0x2b0b=function(_0x6a02d5,_0x5680ab){_0x6a02d5=_0x6a02d5-0x0;var _0x4d25ea=_0xb0b2[_0x6a02d5];return _0x4d25ea;};'use strict';var multer=require(_0x2b0b('0x0'));var util=require(_0x2b0b('0x1'));var path=require(_0x2b0b('0x2'));var timeout=require(_0x2b0b('0x3'));var express=require(_0x2b0b('0x4'));var router=express[_0x2b0b('0x5')]();var fs_extra=require(_0x2b0b('0x6'));var auth=require(_0x2b0b('0x7'));var interaction=require(_0x2b0b('0x8'));var config=require(_0x2b0b('0x9'));var controller=require(_0x2b0b('0xa'));router[_0x2b0b('0xb')]('/',auth[_0x2b0b('0xc')](),controller[_0x2b0b('0xd')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2b0b('0xe')]);router['post']('/',auth[_0x2b0b('0xc')](),controller[_0x2b0b('0xf')]);router[_0x2b0b('0x10')](_0x2b0b('0x11'),auth[_0x2b0b('0xc')](),controller[_0x2b0b('0x12')]);router[_0x2b0b('0x13')](_0x2b0b('0x11'),auth[_0x2b0b('0xc')](),controller[_0x2b0b('0x14')]);module[_0x2b0b('0x15')]=router; \ No newline at end of file +var _0x8b02=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','util','path'];(function(_0x3772a2,_0xd5e57d){var _0x3d1a63=function(_0x44eb28){while(--_0x44eb28){_0x3772a2['push'](_0x3772a2['shift']());}};_0x3d1a63(++_0xd5e57d);}(_0x8b02,0x1a0));var _0x28b0=function(_0xb1c142,_0xebb39b){_0xb1c142=_0xb1c142-0x0;var _0x314f01=_0x8b02[_0xb1c142];return _0x314f01;};'use strict';var multer=require('multer');var util=require(_0x28b0('0x0'));var path=require(_0x28b0('0x1'));var timeout=require(_0x28b0('0x2'));var express=require(_0x28b0('0x3'));var router=express[_0x28b0('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x28b0('0x5'));var interaction=require(_0x28b0('0x6'));var config=require(_0x28b0('0x7'));var controller=require(_0x28b0('0x8'));router[_0x28b0('0x9')]('/',auth[_0x28b0('0xa')](),controller['index']);router[_0x28b0('0x9')]('/:id',auth[_0x28b0('0xa')](),controller[_0x28b0('0xb')]);router[_0x28b0('0xc')]('/',auth[_0x28b0('0xa')](),controller['create']);router[_0x28b0('0xd')](_0x28b0('0xe'),auth[_0x28b0('0xa')](),controller[_0x28b0('0xf')]);router[_0x28b0('0x10')](_0x28b0('0xe'),auth[_0x28b0('0xa')](),controller[_0x28b0('0x11')]);module[_0x28b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 1b29347..a3adaec 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 _0x32a8=['exports','string','variable','customVariable','picklist','STRING','ENUM','sequelize'];(function(_0x17d324,_0x2ae239){var _0x132768=function(_0x1eb053){while(--_0x1eb053){_0x17d324['push'](_0x17d324['shift']());}};_0x132768(++_0x2ae239);}(_0x32a8,0x87));var _0x832a=function(_0x4a8600,_0x1e723e){_0x4a8600=_0x4a8600-0x0;var _0x4458b6=_0x32a8[_0x4a8600];return _0x4458b6;};'use strict';var Sequelize=require(_0x832a('0x0'));module[_0x832a('0x1')]={'type':{'type':Sequelize['ENUM'](_0x832a('0x2'),_0x832a('0x3'),_0x832a('0x4'),'keyValue',_0x832a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x832a('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x832a('0x7')](_0x832a('0x2'),_0x832a('0x3'),_0x832a('0x4'))},'keyContent':{'type':Sequelize[_0x832a('0x6')]},'idField':{'type':Sequelize[_0x832a('0x6')]},'variableName':{'type':Sequelize[_0x832a('0x6')]}}; \ No newline at end of file +var _0x2174=['exports','ENUM','variable','customVariable','string','STRING','sequelize'];(function(_0x3ceb2f,_0x278439){var _0x55a3f4=function(_0x340c75){while(--_0x340c75){_0x3ceb2f['push'](_0x3ceb2f['shift']());}};_0x55a3f4(++_0x278439);}(_0x2174,0xca));var _0x4217=function(_0x840117,_0x23fc79){_0x840117=_0x840117-0x0;var _0x3fe612=_0x2174[_0x840117];return _0x3fe612;};'use strict';var Sequelize=require(_0x4217('0x0'));module[_0x4217('0x1')]={'type':{'type':Sequelize[_0x4217('0x2')]('string',_0x4217('0x3'),_0x4217('0x4'),'keyValue','picklist'),'defaultValue':_0x4217('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x4217('0x6')]},'keyType':{'type':Sequelize[_0x4217('0x2')](_0x4217('0x5'),_0x4217('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x4217('0x6')]},'idField':{'type':Sequelize[_0x4217('0x6')]},'variableName':{'type':Sequelize[_0x4217('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index b7c630a..ece4a76 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 _0x936c=['desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','destroy','stack','name','index','map','SalesforceField','rawAttributes','fieldName','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','catch','find','create','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce'];(function(_0x1cbda3,_0x3451ea){var _0x15cd8e=function(_0x31c387){while(--_0x31c387){_0x1cbda3['push'](_0x1cbda3['shift']());}};_0x15cd8e(++_0x3451ea);}(_0x936c,0x106));var _0xc936=function(_0x52c1ac,_0xfe0523){_0x52c1ac=_0x52c1ac-0x0;var _0x44bb9a=_0x936c[_0x52c1ac];return _0x44bb9a;};'use strict';var emlformat=require(_0xc936('0x0'));var rimraf=require(_0xc936('0x1'));var zipdir=require(_0xc936('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc936('0x3'));var moment=require(_0xc936('0x4'));var BPromise=require(_0xc936('0x5'));var Mustache=require(_0xc936('0x6'));var util=require(_0xc936('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc936('0x8'));var ejs=require(_0xc936('0x9'));var fs=require('fs');var fs_extra=require(_0xc936('0xa'));var _=require(_0xc936('0xb'));var squel=require(_0xc936('0xc'));var crypto=require('crypto');var jsforce=require(_0xc936('0xd'));var deskjs=require(_0xc936('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc936('0xf'));var qs=require(_0xc936('0x10'));var as=require(_0xc936('0x11'));var hardwareService=require(_0xc936('0x12'));var logger=require(_0xc936('0x13'))(_0xc936('0x14'));var utils=require('../../config/utils');var config=require(_0xc936('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x149f4a,_0x1c279a){_0x1c279a=_0x1c279a||0xcc;return function(_0x4bde72){if(_0x4bde72){return _0x149f4a[_0xc936('0x16')](_0x1c279a);}return _0x149f4a[_0xc936('0x17')](_0x1c279a)['end']();};}function respondWithResult(_0x171640,_0x3f9dd1){_0x3f9dd1=_0x3f9dd1||0xc8;return function(_0x3fcde7){if(_0x3fcde7){return _0x171640[_0xc936('0x17')](_0x3f9dd1)[_0xc936('0x18')](_0x3fcde7);}};}function respondWithFilteredResult(_0x27db27,_0x594590){return function(_0x439096){if(_0x439096){var _0x11f079=typeof _0x594590[_0xc936('0x19')]===_0xc936('0x1a')&&typeof _0x594590['limit']===_0xc936('0x1a');var _0x18f428=_0x439096[_0xc936('0x1b')];var _0x4df59b=_0x11f079?0x0:_0x594590['offset'];var _0x3c3980=_0x11f079?_0x439096['count']:_0x594590['offset']+_0x594590[_0xc936('0x1c')];var _0x314aa3;if(_0x3c3980>=_0x18f428){_0x3c3980=_0x18f428;_0x314aa3=0xc8;}else{_0x314aa3=0xce;}_0x27db27[_0xc936('0x17')](_0x314aa3);return _0x27db27[_0xc936('0x1d')]('Content-Range',_0x4df59b+'-'+_0x3c3980+'/'+_0x18f428)[_0xc936('0x18')](_0x439096);}return null;};}function patchUpdates(_0x1e5275){return function(_0x1f297f){try{jsonpatch[_0xc936('0x1e')](_0x1f297f,_0x1e5275,!![]);}catch(_0x198819){return BPromise[_0xc936('0x1f')](_0x198819);}return _0x1f297f[_0xc936('0x20')]();};}function saveUpdates(_0x534fc7,_0x358a10){return function(_0x29a1e0){if(_0x29a1e0){return _0x29a1e0[_0xc936('0x21')](_0x534fc7)[_0xc936('0x22')](function(_0x484faa){return _0x484faa;});}return null;};}function removeEntity(_0x56e2d0,_0x5e8d42){return function(_0x27476e){if(_0x27476e){return _0x27476e[_0xc936('0x23')]()[_0xc936('0x22')](function(){_0x56e2d0[_0xc936('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16eff1,_0x2736a6){return function(_0x41902a){if(!_0x41902a){_0x16eff1[_0xc936('0x16')](0x194);}return _0x41902a;};}function handleError(_0x429411,_0x394238){_0x394238=_0x394238||0x1f4;return function(_0x29e8a1){logger['error'](_0x29e8a1[_0xc936('0x24')]);if(_0x29e8a1[_0xc936('0x25')]){delete _0x29e8a1[_0xc936('0x25')];}_0x429411[_0xc936('0x17')](_0x394238)['send'](_0x29e8a1);};}exports[_0xc936('0x26')]=function(_0x251564,_0x20f6e6){var _0x85ebd8={},_0x10fef5={},_0x4aa7f7={'count':0x0,'rows':[]};var _0x38cac5=_[_0xc936('0x27')](db[_0xc936('0x28')][_0xc936('0x29')],function(_0x492500){return{'name':_0x492500[_0xc936('0x2a')],'type':_0x492500['type'][_0xc936('0x2b')]};});_0x10fef5[_0xc936('0x2c')]=_['map'](_0x38cac5,_0xc936('0x25'));_0x10fef5[_0xc936('0x2d')]=_[_0xc936('0x2e')](_0x251564[_0xc936('0x2d')]);_0x10fef5['filters']=_['intersection'](_0x10fef5[_0xc936('0x2c')],_0x10fef5[_0xc936('0x2d')]);_0x85ebd8['attributes']=_[_0xc936('0x2f')](_0x10fef5[_0xc936('0x2c')],qs[_0xc936('0x30')](_0x251564['query'][_0xc936('0x30')]));_0x85ebd8[_0xc936('0x31')]=_0x85ebd8[_0xc936('0x31')][_0xc936('0x32')]?_0x85ebd8[_0xc936('0x31')]:_0x10fef5[_0xc936('0x2c')];if(!_0x251564['query']['hasOwnProperty'](_0xc936('0x33'))){_0x85ebd8[_0xc936('0x1c')]=qs[_0xc936('0x1c')](_0x251564['query'][_0xc936('0x1c')]);_0x85ebd8[_0xc936('0x19')]=qs[_0xc936('0x19')](_0x251564[_0xc936('0x2d')]['offset']);}_0x85ebd8[_0xc936('0x34')]=qs[_0xc936('0x35')](_0x251564[_0xc936('0x2d')][_0xc936('0x35')]);_0x85ebd8[_0xc936('0x36')]=qs[_0xc936('0x37')](_[_0xc936('0x38')](_0x251564[_0xc936('0x2d')],_0x10fef5['filters']),_0x38cac5);if(_0x251564[_0xc936('0x2d')][_0xc936('0x39')]){_0x85ebd8['where']=_[_0xc936('0x3a')](_0x85ebd8[_0xc936('0x36')],{'$or':_['map'](_0x38cac5,function(_0x5775f0){if(_0x5775f0[_0xc936('0x3b')]!=='VIRTUAL'){var _0xd67592={};_0xd67592[_0x5775f0[_0xc936('0x25')]]={'$like':'%'+_0x251564[_0xc936('0x2d')][_0xc936('0x39')]+'%'};return _0xd67592;}})});}_0x85ebd8=_[_0xc936('0x3a')]({},_0x85ebd8,_0x251564[_0xc936('0x3c')]);var _0x3be188={'where':_0x85ebd8[_0xc936('0x36')]};return db[_0xc936('0x28')]['count'](_0x3be188)[_0xc936('0x22')](function(_0x50b0fb){_0x4aa7f7[_0xc936('0x1b')]=_0x50b0fb;if(_0x251564[_0xc936('0x2d')][_0xc936('0x3d')]){_0x85ebd8[_0xc936('0x3e')]=[{'all':!![]}];}return db[_0xc936('0x28')][_0xc936('0x3f')](_0x85ebd8);})[_0xc936('0x22')](function(_0x3c0f09){_0x4aa7f7['rows']=_0x3c0f09;return _0x4aa7f7;})['then'](respondWithFilteredResult(_0x20f6e6,_0x85ebd8))[_0xc936('0x40')](handleError(_0x20f6e6,null));};exports['show']=function(_0x1df465,_0x447dd1){var _0x1fe0b9={'raw':!![],'where':{'id':_0x1df465['params']['id']}},_0x496065={};_0x496065['model']=_[_0xc936('0x2e')](db[_0xc936('0x28')][_0xc936('0x29')]);_0x496065['query']=_[_0xc936('0x2e')](_0x1df465[_0xc936('0x2d')]);_0x496065[_0xc936('0x37')]=_['intersection'](_0x496065[_0xc936('0x2c')],_0x496065[_0xc936('0x2d')]);_0x1fe0b9[_0xc936('0x31')]=_['intersection'](_0x496065[_0xc936('0x2c')],qs[_0xc936('0x30')](_0x1df465['query'][_0xc936('0x30')]));_0x1fe0b9[_0xc936('0x31')]=_0x1fe0b9[_0xc936('0x31')][_0xc936('0x32')]?_0x1fe0b9[_0xc936('0x31')]:_0x496065[_0xc936('0x2c')];if(_0x1df465[_0xc936('0x2d')][_0xc936('0x3d')]){_0x1fe0b9['include']=[{'all':!![]}];}_0x1fe0b9=_[_0xc936('0x3a')]({},_0x1fe0b9,_0x1df465[_0xc936('0x3c')]);return db[_0xc936('0x28')][_0xc936('0x41')](_0x1fe0b9)[_0xc936('0x22')](handleEntityNotFound(_0x447dd1,null))['then'](respondWithResult(_0x447dd1,null))[_0xc936('0x40')](handleError(_0x447dd1,null));};exports[_0xc936('0x42')]=function(_0x527fbe,_0x563fb7){return db[_0xc936('0x28')][_0xc936('0x42')](_0x527fbe['body'],{})[_0xc936('0x22')](respondWithResult(_0x563fb7,0xc9))[_0xc936('0x40')](handleError(_0x563fb7,null));};exports[_0xc936('0x21')]=function(_0x9ee768,_0x53d53a){if(_0x9ee768[_0xc936('0x43')]['id']){delete _0x9ee768['body']['id'];}return db[_0xc936('0x28')]['find']({'where':{'id':_0x9ee768[_0xc936('0x44')]['id']}})[_0xc936('0x22')](handleEntityNotFound(_0x53d53a,null))['then'](saveUpdates(_0x9ee768[_0xc936('0x43')],null))[_0xc936('0x22')](respondWithResult(_0x53d53a,null))[_0xc936('0x40')](handleError(_0x53d53a,null));};exports[_0xc936('0x23')]=function(_0xf49b86,_0x28ce67){return db[_0xc936('0x28')][_0xc936('0x41')]({'where':{'id':_0xf49b86[_0xc936('0x44')]['id']}})[_0xc936('0x22')](handleEntityNotFound(_0x28ce67,null))[_0xc936('0x22')](removeEntity(_0x28ce67,null))[_0xc936('0x40')](handleError(_0x28ce67,null));}; \ No newline at end of file +var _0x7449=['querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','error','send','map','SalesforceField','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js'];(function(_0x456ad8,_0x5495c7){var _0x80e21e=function(_0x487e11){while(--_0x487e11){_0x456ad8['push'](_0x456ad8['shift']());}};_0x80e21e(++_0x5495c7);}(_0x7449,0x1f1));var _0x9744=function(_0xaca3c8,_0x5abe51){_0xaca3c8=_0xaca3c8-0x0;var _0x1b895c=_0x7449[_0xaca3c8];return _0x1b895c;};'use strict';var emlformat=require(_0x9744('0x0'));var rimraf=require(_0x9744('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9744('0x2'));var rp=require(_0x9744('0x3'));var moment=require('moment');var BPromise=require(_0x9744('0x4'));var Mustache=require(_0x9744('0x5'));var util=require(_0x9744('0x6'));var path=require(_0x9744('0x7'));var sox=require(_0x9744('0x8'));var csv=require(_0x9744('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9744('0xa'));var _=require(_0x9744('0xb'));var squel=require(_0x9744('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9744('0xd'));var toCsv=require(_0x9744('0x9'));var querystring=require(_0x9744('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9744('0xf'));var qs=require(_0x9744('0x10'));var as=require(_0x9744('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9744('0x12'))(_0x9744('0x13'));var utils=require(_0x9744('0x14'));var config=require(_0x9744('0x15'));var licenseUtil=require(_0x9744('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4e6299,_0x3997b4){_0x3997b4=_0x3997b4||0xcc;return function(_0x19750b){if(_0x19750b){return _0x4e6299[_0x9744('0x17')](_0x3997b4);}return _0x4e6299[_0x9744('0x18')](_0x3997b4)[_0x9744('0x19')]();};}function respondWithResult(_0x5dd76f,_0x4d4529){_0x4d4529=_0x4d4529||0xc8;return function(_0x1c798b){if(_0x1c798b){return _0x5dd76f[_0x9744('0x18')](_0x4d4529)[_0x9744('0x1a')](_0x1c798b);}};}function respondWithFilteredResult(_0x2fa7b7,_0x19c658){return function(_0x36e141){if(_0x36e141){var _0x43635f=typeof _0x19c658['offset']===_0x9744('0x1b')&&typeof _0x19c658[_0x9744('0x1c')]==='undefined';var _0x17f92b=_0x36e141[_0x9744('0x1d')];var _0x210c09=_0x43635f?0x0:_0x19c658[_0x9744('0x1e')];var _0xb40743=_0x43635f?_0x36e141['count']:_0x19c658['offset']+_0x19c658['limit'];var _0x30f367;if(_0xb40743>=_0x17f92b){_0xb40743=_0x17f92b;_0x30f367=0xc8;}else{_0x30f367=0xce;}_0x2fa7b7[_0x9744('0x18')](_0x30f367);return _0x2fa7b7[_0x9744('0x1f')](_0x9744('0x20'),_0x210c09+'-'+_0xb40743+'/'+_0x17f92b)[_0x9744('0x1a')](_0x36e141);}return null;};}function patchUpdates(_0x268e62){return function(_0x47042){try{jsonpatch[_0x9744('0x21')](_0x47042,_0x268e62,!![]);}catch(_0x596742){return BPromise['reject'](_0x596742);}return _0x47042[_0x9744('0x22')]();};}function saveUpdates(_0x33adf8,_0x551ac9){return function(_0x4a9c68){if(_0x4a9c68){return _0x4a9c68[_0x9744('0x23')](_0x33adf8)[_0x9744('0x24')](function(_0x2a36c2){return _0x2a36c2;});}return null;};}function removeEntity(_0x35c0e5,_0x4665be){return function(_0x4d81bd){if(_0x4d81bd){return _0x4d81bd['destroy']()[_0x9744('0x24')](function(){_0x35c0e5[_0x9744('0x18')](0xcc)[_0x9744('0x19')]();});}};}function handleEntityNotFound(_0x3f017e,_0x1f1dd){return function(_0x4601c0){if(!_0x4601c0){_0x3f017e['sendStatus'](0x194);}return _0x4601c0;};}function handleError(_0x493cfa,_0x3c636d){_0x3c636d=_0x3c636d||0x1f4;return function(_0x56f591){logger[_0x9744('0x25')](_0x56f591['stack']);if(_0x56f591['name']){delete _0x56f591['name'];}_0x493cfa[_0x9744('0x18')](_0x3c636d)[_0x9744('0x26')](_0x56f591);};}exports['index']=function(_0x4c12f6,_0x566912){var _0x249b49={},_0x181546={},_0x6dd59d={'count':0x0,'rows':[]};var _0x319752=_[_0x9744('0x27')](db[_0x9744('0x28')][_0x9744('0x29')],function(_0xa16d28){return{'name':_0xa16d28[_0x9744('0x2a')],'type':_0xa16d28[_0x9744('0x2b')][_0x9744('0x2c')]};});_0x181546[_0x9744('0x2d')]=_['map'](_0x319752,_0x9744('0x2e'));_0x181546['query']=_[_0x9744('0x2f')](_0x4c12f6[_0x9744('0x30')]);_0x181546['filters']=_[_0x9744('0x31')](_0x181546[_0x9744('0x2d')],_0x181546[_0x9744('0x30')]);_0x249b49['attributes']=_[_0x9744('0x31')](_0x181546[_0x9744('0x2d')],qs[_0x9744('0x32')](_0x4c12f6[_0x9744('0x30')][_0x9744('0x32')]));_0x249b49[_0x9744('0x33')]=_0x249b49[_0x9744('0x33')][_0x9744('0x34')]?_0x249b49[_0x9744('0x33')]:_0x181546[_0x9744('0x2d')];if(!_0x4c12f6[_0x9744('0x30')][_0x9744('0x35')](_0x9744('0x36'))){_0x249b49['limit']=qs['limit'](_0x4c12f6[_0x9744('0x30')]['limit']);_0x249b49[_0x9744('0x1e')]=qs[_0x9744('0x1e')](_0x4c12f6[_0x9744('0x30')][_0x9744('0x1e')]);}_0x249b49[_0x9744('0x37')]=qs[_0x9744('0x38')](_0x4c12f6[_0x9744('0x30')][_0x9744('0x38')]);_0x249b49[_0x9744('0x39')]=qs['filters'](_[_0x9744('0x3a')](_0x4c12f6['query'],_0x181546[_0x9744('0x3b')]),_0x319752);if(_0x4c12f6[_0x9744('0x30')][_0x9744('0x3c')]){_0x249b49[_0x9744('0x39')]=_[_0x9744('0x3d')](_0x249b49[_0x9744('0x39')],{'$or':_[_0x9744('0x27')](_0x319752,function(_0x461694){if(_0x461694[_0x9744('0x2b')]!==_0x9744('0x3e')){var _0xb98649={};_0xb98649[_0x461694[_0x9744('0x2e')]]={'$like':'%'+_0x4c12f6[_0x9744('0x30')][_0x9744('0x3c')]+'%'};return _0xb98649;}})});}_0x249b49=_['merge']({},_0x249b49,_0x4c12f6[_0x9744('0x3f')]);var _0x1b4fee={'where':_0x249b49[_0x9744('0x39')]};return db[_0x9744('0x28')]['count'](_0x1b4fee)[_0x9744('0x24')](function(_0x2c47bd){_0x6dd59d['count']=_0x2c47bd;if(_0x4c12f6['query'][_0x9744('0x40')]){_0x249b49[_0x9744('0x41')]=[{'all':!![]}];}return db[_0x9744('0x28')][_0x9744('0x42')](_0x249b49);})['then'](function(_0x231e48){_0x6dd59d['rows']=_0x231e48;return _0x6dd59d;})[_0x9744('0x24')](respondWithFilteredResult(_0x566912,_0x249b49))[_0x9744('0x43')](handleError(_0x566912,null));};exports[_0x9744('0x44')]=function(_0x3e7e91,_0x3fa2a8){var _0x311ed2={'raw':!![],'where':{'id':_0x3e7e91[_0x9744('0x45')]['id']}},_0x2bc187={};_0x2bc187[_0x9744('0x2d')]=_[_0x9744('0x2f')](db[_0x9744('0x28')]['rawAttributes']);_0x2bc187['query']=_['keys'](_0x3e7e91['query']);_0x2bc187[_0x9744('0x3b')]=_[_0x9744('0x31')](_0x2bc187['model'],_0x2bc187['query']);_0x311ed2['attributes']=_[_0x9744('0x31')](_0x2bc187['model'],qs['fields'](_0x3e7e91[_0x9744('0x30')][_0x9744('0x32')]));_0x311ed2[_0x9744('0x33')]=_0x311ed2[_0x9744('0x33')][_0x9744('0x34')]?_0x311ed2[_0x9744('0x33')]:_0x2bc187['model'];if(_0x3e7e91[_0x9744('0x30')][_0x9744('0x40')]){_0x311ed2[_0x9744('0x41')]=[{'all':!![]}];}_0x311ed2=_[_0x9744('0x3d')]({},_0x311ed2,_0x3e7e91['options']);return db[_0x9744('0x28')][_0x9744('0x46')](_0x311ed2)[_0x9744('0x24')](handleEntityNotFound(_0x3fa2a8,null))[_0x9744('0x24')](respondWithResult(_0x3fa2a8,null))[_0x9744('0x43')](handleError(_0x3fa2a8,null));};exports[_0x9744('0x47')]=function(_0x4f8403,_0x133454){return db[_0x9744('0x28')][_0x9744('0x47')](_0x4f8403[_0x9744('0x48')],{})[_0x9744('0x24')](respondWithResult(_0x133454,0xc9))[_0x9744('0x43')](handleError(_0x133454,null));};exports[_0x9744('0x23')]=function(_0x3c016a,_0x1221c9){if(_0x3c016a['body']['id']){delete _0x3c016a['body']['id'];}return db[_0x9744('0x28')]['find']({'where':{'id':_0x3c016a['params']['id']}})[_0x9744('0x24')](handleEntityNotFound(_0x1221c9,null))[_0x9744('0x24')](saveUpdates(_0x3c016a['body'],null))['then'](respondWithResult(_0x1221c9,null))[_0x9744('0x43')](handleError(_0x1221c9,null));};exports['destroy']=function(_0x1e1b99,_0x554f1e){return db[_0x9744('0x28')]['find']({'where':{'id':_0x1e1b99['params']['id']}})[_0x9744('0x24')](handleEntityNotFound(_0x554f1e,null))[_0x9744('0x24')](removeEntity(_0x554f1e,null))[_0x9744('0x43')](handleError(_0x554f1e,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index aa906ef..d696be4 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 _0x2771=['idField','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index'];(function(_0x2f3c12,_0x25213f){var _0x52f90a=function(_0x250a43){while(--_0x250a43){_0x2f3c12['push'](_0x2f3c12['shift']());}};_0x52f90a(++_0x25213f);}(_0x2771,0x12d));var _0x1277=function(_0x474f93,_0x131bd2){_0x474f93=_0x474f93-0x0;var _0x4ad7d1=_0x2771[_0x474f93];return _0x4ad7d1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1277('0x0'))(_0x1277('0x1'));var moment=require(_0x1277('0x2'));var BPromise=require(_0x1277('0x3'));var rp=require(_0x1277('0x4'));var fs=require('fs');var path=require(_0x1277('0x5'));var rimraf=require(_0x1277('0x6'));var config=require(_0x1277('0x7'));var attributes=require(_0x1277('0x8'));module[_0x1277('0x9')]=function(_0x57345f,_0x15d0df){return _0x57345f[_0x1277('0xa')](_0x1277('0xb'),attributes,{'tableName':_0x1277('0xc'),'paranoid':![],'indexes':[{'name':_0x1277('0xd'),'fields':[_0x1277('0xe'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9c90=['rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4a0f4e,_0x239fd9){var _0x87987f=function(_0x37f042){while(--_0x37f042){_0x4a0f4e['push'](_0x4a0f4e['shift']());}};_0x87987f(++_0x239fd9);}(_0x9c90,0x191));var _0x09c9=function(_0xdbb6cb,_0x3b8fda){_0xdbb6cb=_0xdbb6cb-0x0;var _0x476b50=_0x9c90[_0xdbb6cb];return _0x476b50;};'use strict';var _=require(_0x09c9('0x0'));var util=require('util');var logger=require(_0x09c9('0x1'))(_0x09c9('0x2'));var moment=require(_0x09c9('0x3'));var BPromise=require(_0x09c9('0x4'));var rp=require(_0x09c9('0x5'));var fs=require('fs');var path=require(_0x09c9('0x6'));var rimraf=require(_0x09c9('0x7'));var config=require(_0x09c9('0x8'));var attributes=require(_0x09c9('0x9'));module[_0x09c9('0xa')]=function(_0x8c4cd3,_0x375c95){return _0x8c4cd3[_0x09c9('0xb')](_0x09c9('0xc'),attributes,{'tableName':_0x09c9('0xd'),'paranoid':![],'indexes':[{'name':_0x09c9('0xe'),'fields':[_0x09c9('0xf'),_0x09c9('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index d746e62..dd5f14c 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 _0xef45=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../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'];(function(_0x57d008,_0x184a7c){var _0x3f919b=function(_0xb0a767){while(--_0xb0a767){_0x57d008['push'](_0x57d008['shift']());}};_0x3f919b(++_0x184a7c);}(_0xef45,0x15c));var _0x5ef4=function(_0x39b86c,_0x5a8b64){_0x39b86c=_0x39b86c-0x0;var _0x120b7a=_0xef45[_0x39b86c];return _0x120b7a;};'use strict';var _=require(_0x5ef4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5ef4('0x1'));var rs=require(_0x5ef4('0x2'));var fs=require('fs');var Redis=require(_0x5ef4('0x3'));var db=require(_0x5ef4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ef4('0x5'))(_0x5ef4('0x6'));var config=require(_0x5ef4('0x7'));var jayson=require(_0x5ef4('0x8'));var client=jayson[_0x5ef4('0x9')][_0x5ef4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x582655,_0x58887f,_0x187467){return new BPromise(function(_0x1b502b,_0x24054f){return client['request'](_0x582655,_0x187467)[_0x5ef4('0xb')](function(_0x4502eb){logger[_0x5ef4('0xc')](_0x5ef4('0xd'),_0x58887f,_0x5ef4('0xe'));logger[_0x5ef4('0xf')](_0x5ef4('0x10'),_0x58887f,_0x5ef4('0xe'),JSON[_0x5ef4('0x11')](_0x4502eb));if(_0x4502eb[_0x5ef4('0x12')]){if(_0x4502eb[_0x5ef4('0x12')][_0x5ef4('0x13')]===0x1f4){logger['error'](_0x5ef4('0xd'),_0x58887f,_0x4502eb[_0x5ef4('0x12')][_0x5ef4('0x14')]);return _0x24054f(_0x4502eb[_0x5ef4('0x12')][_0x5ef4('0x14')]);}logger[_0x5ef4('0x12')](_0x5ef4('0xd'),_0x58887f,_0x4502eb['error']['message']);return _0x1b502b(_0x4502eb[_0x5ef4('0x12')][_0x5ef4('0x14')]);}else{logger[_0x5ef4('0xc')](_0x5ef4('0xd'),_0x58887f,_0x5ef4('0xe'));_0x1b502b(_0x4502eb[_0x5ef4('0x15')]['message']);}})[_0x5ef4('0x16')](function(_0x17817d){logger[_0x5ef4('0x12')](_0x5ef4('0xd'),_0x58887f,_0x17817d);_0x24054f(_0x17817d);});});} \ No newline at end of file +var _0xb983=['lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','error','code','SalesforceField,\x20%s,\x20%s','message','catch'];(function(_0x1b64dd,_0x2cf769){var _0xeb464c=function(_0x38272c){while(--_0x38272c){_0x1b64dd['push'](_0x1b64dd['shift']());}};_0xeb464c(++_0x2cf769);}(_0xb983,0x73));var _0x3b98=function(_0x3e6b2f,_0x1ffa07){_0x3e6b2f=_0x3e6b2f-0x0;var _0x323215=_0xb983[_0x3e6b2f];return _0x323215;};'use strict';var _=require(_0x3b98('0x0'));var util=require(_0x3b98('0x1'));var moment=require(_0x3b98('0x2'));var BPromise=require('bluebird');var rs=require(_0x3b98('0x3'));var fs=require('fs');var Redis=require(_0x3b98('0x4'));var db=require(_0x3b98('0x5'))['db'];var utils=require(_0x3b98('0x6'));var logger=require(_0x3b98('0x7'))(_0x3b98('0x8'));var config=require(_0x3b98('0x9'));var jayson=require(_0x3b98('0xa'));var client=jayson['client'][_0x3b98('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b8e3e,_0x407048,_0x58c191){return new BPromise(function(_0x1cedae,_0x1ec4bb){return client[_0x3b98('0xc')](_0x3b8e3e,_0x58c191)[_0x3b98('0xd')](function(_0x14deb1){logger[_0x3b98('0xe')]('SalesforceField,\x20%s,\x20%s',_0x407048,_0x3b98('0xf'));logger[_0x3b98('0x10')](_0x3b98('0x11'),_0x407048,'request\x20sent',JSON['stringify'](_0x14deb1));if(_0x14deb1[_0x3b98('0x12')]){if(_0x14deb1[_0x3b98('0x12')][_0x3b98('0x13')]===0x1f4){logger[_0x3b98('0x12')](_0x3b98('0x14'),_0x407048,_0x14deb1['error'][_0x3b98('0x15')]);return _0x1ec4bb(_0x14deb1[_0x3b98('0x12')]['message']);}logger['error'](_0x3b98('0x14'),_0x407048,_0x14deb1[_0x3b98('0x12')]['message']);return _0x1cedae(_0x14deb1[_0x3b98('0x12')]['message']);}else{logger[_0x3b98('0xe')](_0x3b98('0x14'),_0x407048,_0x3b98('0xf'));_0x1cedae(_0x14deb1['result']['message']);}})[_0x3b98('0x16')](function(_0x2fdb5e){logger[_0x3b98('0x12')](_0x3b98('0x14'),_0x407048,_0x2fdb5e);_0x1ec4bb(_0x2fdb5e);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b37f6b4..6d9176a 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 _0x8ad0=['path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','show','getConfigurations','get','post','create','/:id/configurations','/:id','update','delete','destroy','exports','multer','util'];(function(_0x19a9e3,_0xf9c119){var _0x55f441=function(_0x30d0ed){while(--_0x30d0ed){_0x19a9e3['push'](_0x19a9e3['shift']());}};_0x55f441(++_0xf9c119);}(_0x8ad0,0xfa));var _0x08ad=function(_0x746df2,_0x2d4b9d){_0x746df2=_0x746df2-0x0;var _0x3b5bc1=_0x8ad0[_0x746df2];return _0x3b5bc1;};'use strict';var multer=require(_0x08ad('0x0'));var util=require(_0x08ad('0x1'));var path=require(_0x08ad('0x2'));var timeout=require(_0x08ad('0x3'));var express=require(_0x08ad('0x4'));var router=express['Router']();var fs_extra=require(_0x08ad('0x5'));var auth=require(_0x08ad('0x6'));var interaction=require(_0x08ad('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router['get']('/',auth[_0x08ad('0x8')](),controller[_0x08ad('0x9')]);router['get']('/:id',auth[_0x08ad('0x8')](),controller[_0x08ad('0xa')]);router['get']('/:id/configurations',auth[_0x08ad('0x8')](),controller[_0x08ad('0xb')]);router[_0x08ad('0xc')]('/:id/fields',auth[_0x08ad('0x8')](),controller['getFields']);router[_0x08ad('0xd')]('/',auth[_0x08ad('0x8')](),controller[_0x08ad('0xe')]);router[_0x08ad('0xd')](_0x08ad('0xf'),auth[_0x08ad('0x8')](),controller['addConfiguration']);router['put'](_0x08ad('0x10'),auth['isAuthenticated'](),controller[_0x08ad('0x11')]);router[_0x08ad('0x12')](_0x08ad('0x10'),auth[_0x08ad('0x8')](),controller[_0x08ad('0x13')]);module[_0x08ad('0x14')]=router; \ No newline at end of file +var _0xd3ef=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','destroy','exports','util','path','connect-timeout','express'];(function(_0x17fc83,_0x155791){var _0x122710=function(_0x5ac2ee){while(--_0x5ac2ee){_0x17fc83['push'](_0x17fc83['shift']());}};_0x122710(++_0x155791);}(_0xd3ef,0xce));var _0xfd3e=function(_0x19ce6d,_0xf0f6cd){_0x19ce6d=_0x19ce6d-0x0;var _0x509d56=_0xd3ef[_0x19ce6d];return _0x509d56;};'use strict';var multer=require('multer');var util=require(_0xfd3e('0x0'));var path=require(_0xfd3e('0x1'));var timeout=require(_0xfd3e('0x2'));var express=require(_0xfd3e('0x3'));var router=express[_0xfd3e('0x4')]();var fs_extra=require(_0xfd3e('0x5'));var auth=require(_0xfd3e('0x6'));var interaction=require(_0xfd3e('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xfd3e('0x8')]('/',auth[_0xfd3e('0x9')](),controller[_0xfd3e('0xa')]);router[_0xfd3e('0x8')](_0xfd3e('0xb'),auth[_0xfd3e('0x9')](),controller[_0xfd3e('0xc')]);router[_0xfd3e('0x8')](_0xfd3e('0xd'),auth[_0xfd3e('0x9')](),controller['getConfigurations']);router[_0xfd3e('0x8')](_0xfd3e('0xe'),auth[_0xfd3e('0x9')](),controller[_0xfd3e('0xf')]);router[_0xfd3e('0x10')]('/',auth['isAuthenticated'](),controller[_0xfd3e('0x11')]);router[_0xfd3e('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xfd3e('0x12')]);router['put'](_0xfd3e('0xb'),auth[_0xfd3e('0x9')](),controller['update']);router['delete'](_0xfd3e('0xb'),auth[_0xfd3e('0x9')](),controller[_0xfd3e('0x13')]);module[_0xfd3e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index eb6bf46..801600b 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 _0xb5d7=['STRING','username','remoteUri'];(function(_0x4fcc89,_0x2ecd89){var _0x5af786=function(_0x42ab33){while(--_0x42ab33){_0x4fcc89['push'](_0x4fcc89['shift']());}};_0x5af786(++_0x2ecd89);}(_0xb5d7,0xa2));var _0x7b5d=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb5d7[_0x3bf83f];return _0x22c4a9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x7b5d('0x0')]},'description':{'type':Sequelize[_0x7b5d('0x0')]},'username':{'type':Sequelize['STRING'],'unique':_0x7b5d('0x1')},'password':{'type':Sequelize[_0x7b5d('0x0')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x7b5d('0x2')},'serverUrl':{'type':Sequelize[_0x7b5d('0x0')],'allowNull':![]}}; \ No newline at end of file +var _0x9806=['remoteUri','exports','STRING','username'];(function(_0x42af8a,_0x331de2){var _0x118479=function(_0x5af153){while(--_0x5af153){_0x42af8a['push'](_0x42af8a['shift']());}};_0x118479(++_0x331de2);}(_0x9806,0x1c5));var _0x6980=function(_0x4589d1,_0x548e84){_0x4589d1=_0x4589d1-0x0;var _0x599fbd=_0x9806[_0x4589d1];return _0x599fbd;};'use strict';var Sequelize=require('sequelize');module[_0x6980('0x0')]={'name':{'type':Sequelize[_0x6980('0x1')]},'description':{'type':Sequelize[_0x6980('0x1')]},'username':{'type':Sequelize[_0x6980('0x1')],'unique':_0x6980('0x2')},'password':{'type':Sequelize[_0x6980('0x1')]},'email':{'type':Sequelize[_0x6980('0x1')]},'remoteUri':{'type':Sequelize[_0x6980('0x1')],'unique':_0x6980('0x3')},'serverUrl':{'type':Sequelize[_0x6980('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 1b03d90..f1ef82e 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 _0xc6a5=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','ServicenowAccount','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','type','VIRTUAL','merge','includeAll','include','rows','catch','params','rawAttributes','options','find','create','body','getConfigurations','ServicenowConfiguration','order','pick','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','made_sla','hold_reason','subcategory','close_code','incident_state','severity','parent','watch_list','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','problem_id','company','reassignment_count','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','category','username','password','email','remoteUri','slice','lastIndexOf','format','GET','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','label','log','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','push','concat','test','error','Wrong\x20credentials','statusCode','boolean','True','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash'];(function(_0x4ae395,_0x3bd1aa){var _0x224810=function(_0x415e93){while(--_0x415e93){_0x4ae395['push'](_0x4ae395['shift']());}};_0x224810(++_0x3bd1aa);}(_0xc6a5,0xab));var _0x5c6a=function(_0x7ca935,_0x5c96f9){_0x7ca935=_0x7ca935-0x0;var _0x493e5b=_0xc6a5[_0x7ca935];return _0x493e5b;};'use strict';var emlformat=require(_0x5c6a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5c6a('0x1'));var jsonpatch=require(_0x5c6a('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5c6a('0x3'));var Mustache=require(_0x5c6a('0x4'));var util=require(_0x5c6a('0x5'));var path=require(_0x5c6a('0x6'));var sox=require('sox');var csv=require(_0x5c6a('0x7'));var ejs=require(_0x5c6a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x5c6a('0x9'));var squel=require(_0x5c6a('0xa'));var crypto=require('crypto');var jsforce=require(_0x5c6a('0xb'));var deskjs=require(_0x5c6a('0xc'));var toCsv=require(_0x5c6a('0x7'));var querystring=require(_0x5c6a('0xd'));var Papa=require(_0x5c6a('0xe'));var Redis=require('ioredis');var authService=require(_0x5c6a('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5c6a('0x10'));var hardwareService=require(_0x5c6a('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5c6a('0x12'));var config=require(_0x5c6a('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5c6a('0x14'))['db'];var integrations=require(_0x5c6a('0x15'));function respondWithStatusCode(_0x5ace46,_0x531b82){_0x531b82=_0x531b82||0xcc;return function(_0x2e50d5){if(_0x2e50d5){return _0x5ace46[_0x5c6a('0x16')](_0x531b82);}return _0x5ace46[_0x5c6a('0x17')](_0x531b82)[_0x5c6a('0x18')]();};}function respondWithResult(_0x388d7d,_0xfad7b6){_0xfad7b6=_0xfad7b6||0xc8;return function(_0x2e197c){if(_0x2e197c){return _0x388d7d[_0x5c6a('0x17')](_0xfad7b6)[_0x5c6a('0x19')](_0x2e197c);}};}function respondWithFilteredResult(_0x2299dd,_0x19f90c){return function(_0x375806){if(_0x375806){var _0x134dca=typeof _0x19f90c['offset']==='undefined'&&typeof _0x19f90c[_0x5c6a('0x1a')]===_0x5c6a('0x1b');var _0x58d8e6=_0x375806['count'];var _0x47dce6=_0x134dca?0x0:_0x19f90c['offset'];var _0x579b31=_0x134dca?_0x375806[_0x5c6a('0x1c')]:_0x19f90c[_0x5c6a('0x1d')]+_0x19f90c['limit'];var _0x149cb9;if(_0x579b31>=_0x58d8e6){_0x579b31=_0x58d8e6;_0x149cb9=0xc8;}else{_0x149cb9=0xce;}_0x2299dd[_0x5c6a('0x17')](_0x149cb9);return _0x2299dd[_0x5c6a('0x1e')](_0x5c6a('0x1f'),_0x47dce6+'-'+_0x579b31+'/'+_0x58d8e6)[_0x5c6a('0x19')](_0x375806);}return null;};}function patchUpdates(_0x4fdd9c){return function(_0x575df7){try{jsonpatch['apply'](_0x575df7,_0x4fdd9c,!![]);}catch(_0x16eed4){return BPromise[_0x5c6a('0x20')](_0x16eed4);}return _0x575df7[_0x5c6a('0x21')]();};}function saveUpdates(_0x7064bc,_0x49f146){return function(_0xae8cd){if(_0xae8cd){return _0xae8cd[_0x5c6a('0x22')](_0x7064bc)[_0x5c6a('0x23')](function(_0x362f7d){return _0x362f7d;});}return null;};}function removeEntity(_0x54d180,_0x1d7f13){return function(_0x295719){if(_0x295719){return _0x295719[_0x5c6a('0x24')]()['then'](function(){_0x54d180[_0x5c6a('0x17')](0xcc)[_0x5c6a('0x18')]();});}};}function handleEntityNotFound(_0x415075,_0x452681){return function(_0x29e50e){if(!_0x29e50e){_0x415075[_0x5c6a('0x16')](0x194);}return _0x29e50e;};}function handleError(_0x16de00,_0x4c365b){_0x4c365b=_0x4c365b||0x1f4;return function(_0x3dd8c8){logger['error'](_0x3dd8c8['stack']);if(_0x3dd8c8[_0x5c6a('0x25')]){delete _0x3dd8c8[_0x5c6a('0x25')];}_0x16de00['status'](_0x4c365b)[_0x5c6a('0x26')](_0x3dd8c8);};}exports[_0x5c6a('0x27')]=function(_0x3738d7,_0x48617b){var _0x5e4fe9={},_0x128060={},_0x5a707e={'count':0x0,'rows':[]};var _0xb032b0=_[_0x5c6a('0x28')](db[_0x5c6a('0x29')]['rawAttributes'],function(_0x28e63f){return{'name':_0x28e63f['fieldName'],'type':_0x28e63f['type']['key']};});_0x128060[_0x5c6a('0x2a')]=_['map'](_0xb032b0,'name');_0x128060[_0x5c6a('0x2b')]=_[_0x5c6a('0x2c')](_0x3738d7[_0x5c6a('0x2b')]);_0x128060[_0x5c6a('0x2d')]=_[_0x5c6a('0x2e')](_0x128060[_0x5c6a('0x2a')],_0x128060[_0x5c6a('0x2b')]);_0x5e4fe9['attributes']=_[_0x5c6a('0x2e')](_0x128060[_0x5c6a('0x2a')],qs[_0x5c6a('0x2f')](_0x3738d7['query'][_0x5c6a('0x2f')]));_0x5e4fe9[_0x5c6a('0x30')]=_0x5e4fe9[_0x5c6a('0x30')][_0x5c6a('0x31')]?_0x5e4fe9[_0x5c6a('0x30')]:_0x128060[_0x5c6a('0x2a')];if(!_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x32')](_0x5c6a('0x33'))){_0x5e4fe9[_0x5c6a('0x1a')]=qs[_0x5c6a('0x1a')](_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x1a')]);_0x5e4fe9['offset']=qs['offset'](_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x1d')]);}_0x5e4fe9['order']=qs[_0x5c6a('0x34')](_0x3738d7[_0x5c6a('0x2b')]['sort']);_0x5e4fe9['where']=qs['filters'](_['pick'](_0x3738d7[_0x5c6a('0x2b')],_0x128060['filters']),_0xb032b0);if(_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x35')]){_0x5e4fe9[_0x5c6a('0x36')]=_['merge'](_0x5e4fe9[_0x5c6a('0x36')],{'$or':_[_0x5c6a('0x28')](_0xb032b0,function(_0xb01dd3){if(_0xb01dd3[_0x5c6a('0x37')]!==_0x5c6a('0x38')){var _0x543dea={};_0x543dea[_0xb01dd3[_0x5c6a('0x25')]]={'$like':'%'+_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x35')]+'%'};return _0x543dea;}})});}_0x5e4fe9=_[_0x5c6a('0x39')]({},_0x5e4fe9,_0x3738d7['options']);var _0x43fe08={'where':_0x5e4fe9['where']};return db[_0x5c6a('0x29')][_0x5c6a('0x1c')](_0x43fe08)[_0x5c6a('0x23')](function(_0x383b3d){_0x5a707e[_0x5c6a('0x1c')]=_0x383b3d;if(_0x3738d7[_0x5c6a('0x2b')][_0x5c6a('0x3a')]){_0x5e4fe9[_0x5c6a('0x3b')]=[{'all':!![]}];}return db[_0x5c6a('0x29')]['findAll'](_0x5e4fe9);})[_0x5c6a('0x23')](function(_0x2f994c){_0x5a707e[_0x5c6a('0x3c')]=_0x2f994c;return _0x5a707e;})['then'](respondWithFilteredResult(_0x48617b,_0x5e4fe9))[_0x5c6a('0x3d')](handleError(_0x48617b,null));};exports['show']=function(_0x1c8b3a,_0x57e1e2){var _0x1d122e={'raw':![],'where':{'id':_0x1c8b3a[_0x5c6a('0x3e')]['id']}},_0x4f5d08={};_0x4f5d08[_0x5c6a('0x2a')]=_[_0x5c6a('0x2c')](db[_0x5c6a('0x29')][_0x5c6a('0x3f')]);_0x4f5d08[_0x5c6a('0x2b')]=_[_0x5c6a('0x2c')](_0x1c8b3a[_0x5c6a('0x2b')]);_0x4f5d08['filters']=_[_0x5c6a('0x2e')](_0x4f5d08[_0x5c6a('0x2a')],_0x4f5d08[_0x5c6a('0x2b')]);_0x1d122e['attributes']=_[_0x5c6a('0x2e')](_0x4f5d08[_0x5c6a('0x2a')],qs[_0x5c6a('0x2f')](_0x1c8b3a[_0x5c6a('0x2b')][_0x5c6a('0x2f')]));_0x1d122e[_0x5c6a('0x30')]=_0x1d122e[_0x5c6a('0x30')]['length']?_0x1d122e['attributes']:_0x4f5d08[_0x5c6a('0x2a')];if(_0x1c8b3a[_0x5c6a('0x2b')][_0x5c6a('0x3a')]){_0x1d122e['include']=[{'all':!![]}];}_0x1d122e=_[_0x5c6a('0x39')]({},_0x1d122e,_0x1c8b3a[_0x5c6a('0x40')]);return db[_0x5c6a('0x29')][_0x5c6a('0x41')](_0x1d122e)[_0x5c6a('0x23')](handleEntityNotFound(_0x57e1e2,null))['then'](respondWithResult(_0x57e1e2,null))[_0x5c6a('0x3d')](handleError(_0x57e1e2,null));};exports[_0x5c6a('0x42')]=function(_0x3088a1,_0x357549){return db[_0x5c6a('0x29')][_0x5c6a('0x42')](_0x3088a1[_0x5c6a('0x43')],{})[_0x5c6a('0x23')](respondWithResult(_0x357549,0xc9))[_0x5c6a('0x3d')](handleError(_0x357549,null));};exports['update']=function(_0x2df9e4,_0xd14b93){if(_0x2df9e4[_0x5c6a('0x43')]['id']){delete _0x2df9e4[_0x5c6a('0x43')]['id'];}return db['ServicenowAccount'][_0x5c6a('0x41')]({'where':{'id':_0x2df9e4[_0x5c6a('0x3e')]['id']}})[_0x5c6a('0x23')](handleEntityNotFound(_0xd14b93,null))['then'](saveUpdates(_0x2df9e4[_0x5c6a('0x43')],null))[_0x5c6a('0x23')](respondWithResult(_0xd14b93,null))[_0x5c6a('0x3d')](handleError(_0xd14b93,null));};exports[_0x5c6a('0x24')]=function(_0x3bc9c0,_0x221d69){return db[_0x5c6a('0x29')][_0x5c6a('0x41')]({'where':{'id':_0x3bc9c0[_0x5c6a('0x3e')]['id']}})[_0x5c6a('0x23')](handleEntityNotFound(_0x221d69,null))[_0x5c6a('0x23')](removeEntity(_0x221d69,null))[_0x5c6a('0x3d')](handleError(_0x221d69,null));};exports[_0x5c6a('0x44')]=function(_0x1d3cb9,_0x3a72b8,_0x2d3723){var _0xcaefac={};var _0x316858={};var _0xb58dbb;var _0x101939;return db[_0x5c6a('0x29')]['findOne']({'where':{'id':_0x1d3cb9[_0x5c6a('0x3e')]['id']}})[_0x5c6a('0x23')](handleEntityNotFound(_0x3a72b8,null))[_0x5c6a('0x23')](function(_0xa19fba){if(_0xa19fba){_0xb58dbb=_0xa19fba;_0x316858[_0x5c6a('0x2a')]=_[_0x5c6a('0x2c')](db[_0x5c6a('0x45')]['rawAttributes']);_0x316858[_0x5c6a('0x2b')]=_[_0x5c6a('0x2c')](_0x1d3cb9[_0x5c6a('0x2b')]);_0x316858[_0x5c6a('0x2d')]=_[_0x5c6a('0x2e')](_0x316858[_0x5c6a('0x2a')],_0x316858[_0x5c6a('0x2b')]);_0xcaefac[_0x5c6a('0x30')]=_[_0x5c6a('0x2e')](_0x316858[_0x5c6a('0x2a')],qs[_0x5c6a('0x2f')](_0x1d3cb9['query'][_0x5c6a('0x2f')]));_0xcaefac[_0x5c6a('0x30')]=_0xcaefac['attributes']['length']?_0xcaefac['attributes']:_0x316858[_0x5c6a('0x2a')];_0xcaefac[_0x5c6a('0x46')]=qs['sort'](_0x1d3cb9[_0x5c6a('0x2b')][_0x5c6a('0x34')]);_0xcaefac[_0x5c6a('0x36')]=qs[_0x5c6a('0x2d')](_[_0x5c6a('0x47')](_0x1d3cb9['query'],_0x316858[_0x5c6a('0x2d')]));if(_0x1d3cb9[_0x5c6a('0x2b')][_0x5c6a('0x35')]){_0xcaefac[_0x5c6a('0x36')]=_['merge'](_0xcaefac['where'],{'$or':_[_0x5c6a('0x28')](_0xcaefac[_0x5c6a('0x30')],function(_0x4136d4){var _0x53e999={};_0x53e999[_0x4136d4]={'$like':'%'+_0x1d3cb9[_0x5c6a('0x2b')][_0x5c6a('0x35')]+'%'};return _0x53e999;})});}_0xcaefac=_['merge']({},_0xcaefac,_0x1d3cb9[_0x5c6a('0x40')]);return _0xb58dbb[_0x5c6a('0x44')](_0xcaefac);}})['then'](function(_0x533ca5){if(_0x533ca5){_0x101939=_0x533ca5[_0x5c6a('0x31')];if(!_0x1d3cb9[_0x5c6a('0x2b')][_0x5c6a('0x32')](_0x5c6a('0x33'))){_0xcaefac['limit']=qs[_0x5c6a('0x1a')](_0x1d3cb9[_0x5c6a('0x2b')][_0x5c6a('0x1a')]);_0xcaefac[_0x5c6a('0x1d')]=qs[_0x5c6a('0x1d')](_0x1d3cb9['query'][_0x5c6a('0x1d')]);}return _0xb58dbb[_0x5c6a('0x44')](_0xcaefac);}})['then'](function(_0x171a08){if(_0x171a08){return _0x171a08?{'count':_0x101939,'rows':_0x171a08}:null;}})[_0x5c6a('0x23')](respondWithResult(_0x3a72b8,null))[_0x5c6a('0x3d')](handleError(_0x3a72b8,null));};exports[_0x5c6a('0x48')]=function(_0x297d4d,_0x480121,_0xb3abcf){if(_0x297d4d[_0x5c6a('0x43')]['id']){delete _0x297d4d['body']['id'];}return db[_0x5c6a('0x29')][_0x5c6a('0x49')]({'where':{'id':_0x297d4d[_0x5c6a('0x3e')]['id']}})[_0x5c6a('0x23')](handleEntityNotFound(_0x480121,null))[_0x5c6a('0x23')](function(_0x7d4f6a){if(_0x7d4f6a){_0x297d4d['body'][_0x5c6a('0x4a')]=_0x7d4f6a['id'];_0x297d4d[_0x5c6a('0x43')][_0x5c6a('0x4b')]=integrations[_0x5c6a('0x4c')](_0x297d4d[_0x5c6a('0x43')][_0x5c6a('0x4d')],_0x297d4d[_0x5c6a('0x43')][_0x5c6a('0x37')]);_0x297d4d[_0x5c6a('0x43')]['Descriptions']=integrations['getDescriptions'](_0x297d4d[_0x5c6a('0x43')]['channel'],_0x297d4d[_0x5c6a('0x43')][_0x5c6a('0x37')]);return db[_0x5c6a('0x45')][_0x5c6a('0x42')](_0x297d4d[_0x5c6a('0x43')],{'include':[{'model':db[_0x5c6a('0x4e')],'as':'Subjects'},{'model':db[_0x5c6a('0x4e')],'as':_0x5c6a('0x4f')}]});}return null;})['then'](respondWithResult(_0x480121,null))[_0x5c6a('0x3d')](handleError(_0x480121,null));};exports['getFields']=function(_0x533ff9,_0x343767,_0x241548){var _0x212ac9=[_0x5c6a('0x50'),_0x5c6a('0x51'),'knowledge',_0x5c6a('0x52'),_0x5c6a('0x53'),'notify',_0x5c6a('0x54'),_0x5c6a('0x55'),'category'];var _0x2ea292=[_0x5c6a('0x56'),_0x5c6a('0x50'),'caused_by',_0x5c6a('0x57'),_0x5c6a('0x58'),'sys_updated_on',_0x5c6a('0x59'),_0x5c6a('0x51'),_0x5c6a('0x5a'),_0x5c6a('0x5b'),_0x5c6a('0x5c'),_0x5c6a('0x5d'),'opened_by',_0x5c6a('0x5e'),_0x5c6a('0x5f'),_0x5c6a('0x60'),_0x5c6a('0x61'),_0x5c6a('0x62'),_0x5c6a('0x63'),_0x5c6a('0x46'),_0x5c6a('0x64'),_0x5c6a('0x65'),_0x5c6a('0x66'),_0x5c6a('0x67'),_0x5c6a('0x68'),_0x5c6a('0x69'),_0x5c6a('0x6a'),_0x5c6a('0x6b'),_0x5c6a('0x6c'),_0x5c6a('0x6d'),_0x5c6a('0x6e'),_0x5c6a('0x6f'),_0x5c6a('0x70'),_0x5c6a('0x71'),_0x5c6a('0x72'),_0x5c6a('0x73'),_0x5c6a('0x74'),_0x5c6a('0x75'),'resolved_at',_0x5c6a('0x76'),_0x5c6a('0x77'),_0x5c6a('0x52'),_0x5c6a('0x78'),_0x5c6a('0x79'),'close_code',_0x5c6a('0x7a'),_0x5c6a('0x7b'),'work_start','assignment_group','business_stc',_0x5c6a('0x7c'),_0x5c6a('0x7d'),_0x5c6a('0x7e'),_0x5c6a('0x7f'),_0x5c6a('0x80'),_0x5c6a('0x81'),_0x5c6a('0x82'),_0x5c6a('0x83'),_0x5c6a('0x84'),_0x5c6a('0x85'),_0x5c6a('0x86'),_0x5c6a('0x87'),_0x5c6a('0x54'),'urgency',_0x5c6a('0x88'),_0x5c6a('0x89'),_0x5c6a('0x8a'),'activity_due',_0x5c6a('0x8b'),_0x5c6a('0x55'),_0x5c6a('0x8c'),'sla_due',_0x5c6a('0x8d'),_0x5c6a('0x8e'),_0x5c6a('0x8f'),_0x5c6a('0x90'),_0x5c6a('0x91'),_0x5c6a('0x92'),_0x5c6a('0x93'),'upon_approval',_0x5c6a('0x94'),_0x5c6a('0x95'),_0x5c6a('0x96')];var _0x2d7214='';var _0x7595b1='';var _0x386e55=[];var _0x743100='';var _0x4b4525='';var _0x5c7eda=[];var _0x29a077='';var _0x598310='';var _0x2b800c={};var _0x292c09='';return db[_0x5c6a('0x29')][_0x5c6a('0x49')]({'where':{'id':_0x533ff9[_0x5c6a('0x3e')]['id']},'attributes':['id',_0x5c6a('0x97'),_0x5c6a('0x98'),_0x5c6a('0x99'),'remoteUri','serverUrl']})['then'](handleEntityNotFound(_0x343767,null))[_0x5c6a('0x23')](function(_0x116c98){if(_0x116c98){_0x292c09=_0x116c98[_0x5c6a('0x9a')];var _0x14e273=_0x292c09[_0x5c6a('0x9b')](-0x1);if(_0x14e273==='/'){_0x292c09=_0x292c09['substring'](0x0,_0x292c09[_0x5c6a('0x9c')](_0x14e273));}_0x598310=util['format']('%s/api/now/doc/table/schema/',_0x292c09);_0x29a077=util[_0x5c6a('0x9d')]('%s/api/now/table/',_0x292c09);_0x2b800c={'user':_0x116c98[_0x5c6a('0x97')],'pass':_0x116c98[_0x5c6a('0x98')]};var _0x59e05d={'method':_0x5c6a('0x9e'),'uri':_0x598310+_0x5c6a('0x9f'),'auth':_0x2b800c,'json':!![]};return rp(_0x59e05d);}})[_0x5c6a('0x23')](function(_0x10ad80){if(_0x10ad80[_0x5c6a('0xa0')]['length']>0x0){_0x2d7214=_0x10ad80[_0x5c6a('0xa0')];}console['log'](_0x5c6a('0xa1'),_0x2d7214);_0x5c7eda=[];_0x7595b1=Object[_0x5c6a('0xa2')]([],_0x2d7214);_[_0x5c6a('0xa3')](_0x7595b1,function(_0x539a41){return!_0x212ac9['includes'](_0x539a41['name']);});_0x7595b1['forEach'](function(_0xc65fb8){var _0x847a46=createFieldObject(_0x29a077,_0x2b800c,_0xc65fb8['internalType'],_0xc65fb8['name'],_0xc65fb8[_0x5c6a('0xa4')],![]);_0x5c7eda['push'](_0x847a46);});return Promise['all'](_0x5c7eda);})['then'](function(_0x30e6cd){_0x386e55=_0x30e6cd;_0x743100=Object[_0x5c6a('0xa2')]([],_0x2d7214);console['log']('TCL:\x20_object',_0x2d7214);_[_0x5c6a('0xa3')](_0x743100,function(_0x46771b){return _0x2ea292['includes'](_0x46771b[_0x5c6a('0x25')]);});console[_0x5c6a('0xa5')](_0x5c6a('0xa6'),_0x743100);_0x5c7eda=[];_0x743100[_0x5c6a('0xa7')](function(_0x34287d){var _0x3de177=createFieldObject(_0x29a077,_0x2b800c,_0x34287d['internalType'],_0x34287d[_0x5c6a('0x25')],_0x34287d['label'],!![]);_0x5c7eda[_0x5c6a('0xa8')](_0x3de177);});return Promise['all'](_0x5c7eda);})['then'](function(_0x3e80e3){_0x4b4525=_0x3e80e3;var _0xd17eb3=_0x386e55[_0x5c6a('0xa9')](_0x4b4525);return{'count':_0xd17eb3[_0x5c6a('0x31')],'rows':_0xd17eb3};})[_0x5c6a('0x23')](respondWithResult(_0x343767,null))[_0x5c6a('0x3d')](function(_0x1ba75e){console['log']('ServiceNow\x20error:\x20'+_0x1ba75e);var _0x2943f4=_0x533ff9[_0x5c6a('0x2b')][_0x5c6a('0xaa')]?0x1f4:_0x1ba75e['statusCode']||0x1f4;logger[_0x5c6a('0xab')](_0x1ba75e['stack']);delete _0x1ba75e[_0x5c6a('0x25')];if(_0x2943f4===0x191){_0x2943f4=0x190;}_0x343767[_0x5c6a('0x17')](_0x2943f4)[_0x5c6a('0x26')](_0x533ff9[_0x5c6a('0x2b')][_0x5c6a('0xaa')]?{'message':_0x5c6a('0xac'),'statusCode':_0x1ba75e[_0x5c6a('0xad')]}:_0x1ba75e);});};function createFieldObject(_0x43b255,_0x9de60a,_0x346216,_0x35c9cc,_0xb0d1d3,_0x5a9b91){return new Promise(function(_0x40acef,_0x526b0a){var _0x1cecea={'id':_0x35c9cc,'name':_0xb0d1d3,'custom':_0x5a9b91};if(_0x346216===_0x5c6a('0xae')){_0x1cecea['options']=[{'name':_0x5c6a('0xaf'),'value':'true'},{'name':_0x5c6a('0xb0'),'value':_0x5c6a('0xb1')}];_0x40acef(_0x1cecea);}else{var _0x1772dd={'method':_0x5c6a('0x9e'),'uri':_0x43b255+_0x5c6a('0xb2')+_0x35c9cc,'auth':_0x9de60a,'json':!![]};return rp(_0x1772dd)['then'](function(_0x2e9eea){var _0xef3bff=[];if(_0x2e9eea[_0x5c6a('0xa0')][_0x5c6a('0x31')]>0x0){_0x2e9eea[_0x5c6a('0xa0')][_0x5c6a('0xa7')](function(_0x353555){if(_0x353555[_0x5c6a('0xb3')]===_0x5c6a('0xb1')){var _0x3d9801={'name':_0x353555['label'],'value':_0x353555[_0x5c6a('0xb4')]};_0xef3bff[_0x5c6a('0xa8')](_0x3d9801);}});}_0x1cecea[_0x5c6a('0x40')]=_0xef3bff;if(_0x1cecea['options']['length']>0x0){_0x40acef(_0x1cecea);}else{if(_0x5a9b91==![]){_0x40acef();}else{_0x40acef(_0x1cecea);}}});}});} \ No newline at end of file +var _0xd6c0=['slice','substring','lastIndexOf','format','%s/api/now/table/','incident?sysparm_display_value=all','result','incident\x20table\x20objects','assign','remove','forEach','internalType','label','push','all','log','TCL:\x20_object','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','concat','ServiceNow\x20error:\x20','test','statusCode','error','boolean','true','False','false','GET','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','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply','save','update','then','name','send','index','fieldName','type','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','ServicenowAccount','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','category','parent','caused_by','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','state','sys_created_by','calendar_stc','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','work_start','assignment_group','business_stc','description','calendar_duration','sys_class_name','follow_up','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','assigned_to','severity','approval','comments_and_work_notes','due_date','reopen_count','escalation','upon_approval','correlation_id','location','username','password','email','remoteUri'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0xd6c0,0x182));var _0x0d6c=function(_0x17daa7,_0x100018){_0x17daa7=_0x17daa7-0x0;var _0x23591a=_0xd6c0[_0x17daa7];return _0x23591a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0d6c('0x0'));var jsonpatch=require(_0x0d6c('0x1'));var rp=require(_0x0d6c('0x2'));var moment=require(_0x0d6c('0x3'));var BPromise=require(_0x0d6c('0x4'));var Mustache=require('mustache');var util=require(_0x0d6c('0x5'));var path=require(_0x0d6c('0x6'));var sox=require(_0x0d6c('0x7'));var csv=require(_0x0d6c('0x8'));var ejs=require(_0x0d6c('0x9'));var fs=require('fs');var fs_extra=require(_0x0d6c('0xa'));var _=require(_0x0d6c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0d6c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0d6c('0x8'));var querystring=require('querystring');var Papa=require(_0x0d6c('0xd'));var Redis=require('ioredis');var authService=require(_0x0d6c('0xe'));var qs=require(_0x0d6c('0xf'));var as=require(_0x0d6c('0x10'));var hardwareService=require(_0x0d6c('0x11'));var logger=require('../../config/logger')(_0x0d6c('0x12'));var utils=require('../../config/utils');var config=require(_0x0d6c('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d6c('0x14'))['db'];var integrations=require(_0x0d6c('0x15'));function respondWithStatusCode(_0x35b93d,_0x20c407){_0x20c407=_0x20c407||0xcc;return function(_0x6dbaf8){if(_0x6dbaf8){return _0x35b93d[_0x0d6c('0x16')](_0x20c407);}return _0x35b93d[_0x0d6c('0x17')](_0x20c407)[_0x0d6c('0x18')]();};}function respondWithResult(_0x472726,_0x5d247f){_0x5d247f=_0x5d247f||0xc8;return function(_0x3c0bb4){if(_0x3c0bb4){return _0x472726[_0x0d6c('0x17')](_0x5d247f)['json'](_0x3c0bb4);}};}function respondWithFilteredResult(_0x5c6fb7,_0x39c425){return function(_0xb52c0f){if(_0xb52c0f){var _0x3b7920=typeof _0x39c425['offset']===_0x0d6c('0x19')&&typeof _0x39c425[_0x0d6c('0x1a')]==='undefined';var _0x2e7c31=_0xb52c0f[_0x0d6c('0x1b')];var _0x52e34e=_0x3b7920?0x0:_0x39c425[_0x0d6c('0x1c')];var _0x32e2ea=_0x3b7920?_0xb52c0f[_0x0d6c('0x1b')]:_0x39c425[_0x0d6c('0x1c')]+_0x39c425['limit'];var _0x90d34;if(_0x32e2ea>=_0x2e7c31){_0x32e2ea=_0x2e7c31;_0x90d34=0xc8;}else{_0x90d34=0xce;}_0x5c6fb7[_0x0d6c('0x17')](_0x90d34);return _0x5c6fb7['set'](_0x0d6c('0x1d'),_0x52e34e+'-'+_0x32e2ea+'/'+_0x2e7c31)[_0x0d6c('0x1e')](_0xb52c0f);}return null;};}function patchUpdates(_0x35d505){return function(_0x173179){try{jsonpatch[_0x0d6c('0x1f')](_0x173179,_0x35d505,!![]);}catch(_0x40c770){return BPromise['reject'](_0x40c770);}return _0x173179[_0x0d6c('0x20')]();};}function saveUpdates(_0x385fb5,_0x490047){return function(_0x273ad1){if(_0x273ad1){return _0x273ad1[_0x0d6c('0x21')](_0x385fb5)[_0x0d6c('0x22')](function(_0x1d4c7f){return _0x1d4c7f;});}return null;};}function removeEntity(_0x2f6691,_0x148d9d){return function(_0x2ad652){if(_0x2ad652){return _0x2ad652['destroy']()['then'](function(){_0x2f6691[_0x0d6c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c3bc9,_0x5fd0ea){return function(_0x5b8896){if(!_0x5b8896){_0x4c3bc9['sendStatus'](0x194);}return _0x5b8896;};}function handleError(_0xd32683,_0x375238){_0x375238=_0x375238||0x1f4;return function(_0xfb4f2a){logger['error'](_0xfb4f2a['stack']);if(_0xfb4f2a[_0x0d6c('0x23')]){delete _0xfb4f2a[_0x0d6c('0x23')];}_0xd32683[_0x0d6c('0x17')](_0x375238)[_0x0d6c('0x24')](_0xfb4f2a);};}exports[_0x0d6c('0x25')]=function(_0x1febc6,_0x38ebcf){var _0x2487ca={},_0x291022={},_0x116905={'count':0x0,'rows':[]};var _0x3c9dc5=_['map'](db['ServicenowAccount']['rawAttributes'],function(_0xb5f086){return{'name':_0xb5f086[_0x0d6c('0x26')],'type':_0xb5f086[_0x0d6c('0x27')]['key']};});_0x291022['model']=_[_0x0d6c('0x28')](_0x3c9dc5,_0x0d6c('0x23'));_0x291022[_0x0d6c('0x29')]=_[_0x0d6c('0x2a')](_0x1febc6[_0x0d6c('0x29')]);_0x291022['filters']=_[_0x0d6c('0x2b')](_0x291022[_0x0d6c('0x2c')],_0x291022[_0x0d6c('0x29')]);_0x2487ca[_0x0d6c('0x2d')]=_['intersection'](_0x291022[_0x0d6c('0x2c')],qs[_0x0d6c('0x2e')](_0x1febc6[_0x0d6c('0x29')][_0x0d6c('0x2e')]));_0x2487ca['attributes']=_0x2487ca['attributes'][_0x0d6c('0x2f')]?_0x2487ca[_0x0d6c('0x2d')]:_0x291022[_0x0d6c('0x2c')];if(!_0x1febc6['query'][_0x0d6c('0x30')](_0x0d6c('0x31'))){_0x2487ca[_0x0d6c('0x1a')]=qs[_0x0d6c('0x1a')](_0x1febc6[_0x0d6c('0x29')][_0x0d6c('0x1a')]);_0x2487ca['offset']=qs[_0x0d6c('0x1c')](_0x1febc6[_0x0d6c('0x29')]['offset']);}_0x2487ca[_0x0d6c('0x32')]=qs['sort'](_0x1febc6[_0x0d6c('0x29')][_0x0d6c('0x33')]);_0x2487ca[_0x0d6c('0x34')]=qs[_0x0d6c('0x35')](_[_0x0d6c('0x36')](_0x1febc6[_0x0d6c('0x29')],_0x291022[_0x0d6c('0x35')]),_0x3c9dc5);if(_0x1febc6[_0x0d6c('0x29')][_0x0d6c('0x37')]){_0x2487ca[_0x0d6c('0x34')]=_[_0x0d6c('0x38')](_0x2487ca['where'],{'$or':_[_0x0d6c('0x28')](_0x3c9dc5,function(_0x52b16d){if(_0x52b16d[_0x0d6c('0x27')]!=='VIRTUAL'){var _0x2268eb={};_0x2268eb[_0x52b16d[_0x0d6c('0x23')]]={'$like':'%'+_0x1febc6['query']['filter']+'%'};return _0x2268eb;}})});}_0x2487ca=_['merge']({},_0x2487ca,_0x1febc6[_0x0d6c('0x39')]);var _0x4b4928={'where':_0x2487ca[_0x0d6c('0x34')]};return db[_0x0d6c('0x3a')][_0x0d6c('0x1b')](_0x4b4928)[_0x0d6c('0x22')](function(_0x181fa1){_0x116905['count']=_0x181fa1;if(_0x1febc6[_0x0d6c('0x29')][_0x0d6c('0x3b')]){_0x2487ca[_0x0d6c('0x3c')]=[{'all':!![]}];}return db[_0x0d6c('0x3a')]['findAll'](_0x2487ca);})[_0x0d6c('0x22')](function(_0x59c3b9){_0x116905[_0x0d6c('0x3d')]=_0x59c3b9;return _0x116905;})[_0x0d6c('0x22')](respondWithFilteredResult(_0x38ebcf,_0x2487ca))[_0x0d6c('0x3e')](handleError(_0x38ebcf,null));};exports[_0x0d6c('0x3f')]=function(_0x11ce6a,_0x46defa){var _0x20b55b={'raw':![],'where':{'id':_0x11ce6a[_0x0d6c('0x40')]['id']}},_0xe21f4={};_0xe21f4[_0x0d6c('0x2c')]=_[_0x0d6c('0x2a')](db[_0x0d6c('0x3a')][_0x0d6c('0x41')]);_0xe21f4[_0x0d6c('0x29')]=_[_0x0d6c('0x2a')](_0x11ce6a[_0x0d6c('0x29')]);_0xe21f4[_0x0d6c('0x35')]=_[_0x0d6c('0x2b')](_0xe21f4[_0x0d6c('0x2c')],_0xe21f4[_0x0d6c('0x29')]);_0x20b55b[_0x0d6c('0x2d')]=_['intersection'](_0xe21f4[_0x0d6c('0x2c')],qs[_0x0d6c('0x2e')](_0x11ce6a[_0x0d6c('0x29')][_0x0d6c('0x2e')]));_0x20b55b[_0x0d6c('0x2d')]=_0x20b55b[_0x0d6c('0x2d')][_0x0d6c('0x2f')]?_0x20b55b[_0x0d6c('0x2d')]:_0xe21f4['model'];if(_0x11ce6a[_0x0d6c('0x29')][_0x0d6c('0x3b')]){_0x20b55b[_0x0d6c('0x3c')]=[{'all':!![]}];}_0x20b55b=_['merge']({},_0x20b55b,_0x11ce6a[_0x0d6c('0x39')]);return db['ServicenowAccount'][_0x0d6c('0x42')](_0x20b55b)['then'](handleEntityNotFound(_0x46defa,null))[_0x0d6c('0x22')](respondWithResult(_0x46defa,null))[_0x0d6c('0x3e')](handleError(_0x46defa,null));};exports[_0x0d6c('0x43')]=function(_0x48166f,_0x12c9e6){return db[_0x0d6c('0x3a')][_0x0d6c('0x43')](_0x48166f[_0x0d6c('0x44')],{})[_0x0d6c('0x22')](respondWithResult(_0x12c9e6,0xc9))['catch'](handleError(_0x12c9e6,null));};exports[_0x0d6c('0x21')]=function(_0x24d072,_0x5f127c){if(_0x24d072[_0x0d6c('0x44')]['id']){delete _0x24d072['body']['id'];}return db[_0x0d6c('0x3a')][_0x0d6c('0x42')]({'where':{'id':_0x24d072['params']['id']}})[_0x0d6c('0x22')](handleEntityNotFound(_0x5f127c,null))[_0x0d6c('0x22')](saveUpdates(_0x24d072['body'],null))[_0x0d6c('0x22')](respondWithResult(_0x5f127c,null))['catch'](handleError(_0x5f127c,null));};exports[_0x0d6c('0x45')]=function(_0x3bfe63,_0x2a5620){return db[_0x0d6c('0x3a')]['find']({'where':{'id':_0x3bfe63[_0x0d6c('0x40')]['id']}})[_0x0d6c('0x22')](handleEntityNotFound(_0x2a5620,null))['then'](removeEntity(_0x2a5620,null))[_0x0d6c('0x3e')](handleError(_0x2a5620,null));};exports[_0x0d6c('0x46')]=function(_0x56a1f9,_0xfad4b1,_0x11934c){var _0x29bfe9={};var _0x2cf389={};var _0x23a40d;var _0x35b640;return db[_0x0d6c('0x3a')][_0x0d6c('0x47')]({'where':{'id':_0x56a1f9['params']['id']}})[_0x0d6c('0x22')](handleEntityNotFound(_0xfad4b1,null))[_0x0d6c('0x22')](function(_0x1c3b76){if(_0x1c3b76){_0x23a40d=_0x1c3b76;_0x2cf389[_0x0d6c('0x2c')]=_[_0x0d6c('0x2a')](db[_0x0d6c('0x48')][_0x0d6c('0x41')]);_0x2cf389[_0x0d6c('0x29')]=_[_0x0d6c('0x2a')](_0x56a1f9[_0x0d6c('0x29')]);_0x2cf389[_0x0d6c('0x35')]=_[_0x0d6c('0x2b')](_0x2cf389[_0x0d6c('0x2c')],_0x2cf389[_0x0d6c('0x29')]);_0x29bfe9[_0x0d6c('0x2d')]=_['intersection'](_0x2cf389[_0x0d6c('0x2c')],qs[_0x0d6c('0x2e')](_0x56a1f9[_0x0d6c('0x29')][_0x0d6c('0x2e')]));_0x29bfe9['attributes']=_0x29bfe9[_0x0d6c('0x2d')]['length']?_0x29bfe9[_0x0d6c('0x2d')]:_0x2cf389[_0x0d6c('0x2c')];_0x29bfe9['order']=qs[_0x0d6c('0x33')](_0x56a1f9[_0x0d6c('0x29')][_0x0d6c('0x33')]);_0x29bfe9[_0x0d6c('0x34')]=qs[_0x0d6c('0x35')](_[_0x0d6c('0x36')](_0x56a1f9['query'],_0x2cf389['filters']));if(_0x56a1f9['query']['filter']){_0x29bfe9[_0x0d6c('0x34')]=_[_0x0d6c('0x38')](_0x29bfe9[_0x0d6c('0x34')],{'$or':_[_0x0d6c('0x28')](_0x29bfe9[_0x0d6c('0x2d')],function(_0xb7b4da){var _0x45c1e3={};_0x45c1e3[_0xb7b4da]={'$like':'%'+_0x56a1f9[_0x0d6c('0x29')]['filter']+'%'};return _0x45c1e3;})});}_0x29bfe9=_[_0x0d6c('0x38')]({},_0x29bfe9,_0x56a1f9[_0x0d6c('0x39')]);return _0x23a40d[_0x0d6c('0x46')](_0x29bfe9);}})[_0x0d6c('0x22')](function(_0x4a93d5){if(_0x4a93d5){_0x35b640=_0x4a93d5[_0x0d6c('0x2f')];if(!_0x56a1f9['query']['hasOwnProperty'](_0x0d6c('0x31'))){_0x29bfe9[_0x0d6c('0x1a')]=qs[_0x0d6c('0x1a')](_0x56a1f9['query'][_0x0d6c('0x1a')]);_0x29bfe9[_0x0d6c('0x1c')]=qs[_0x0d6c('0x1c')](_0x56a1f9['query'][_0x0d6c('0x1c')]);}return _0x23a40d[_0x0d6c('0x46')](_0x29bfe9);}})['then'](function(_0x55933e){if(_0x55933e){return _0x55933e?{'count':_0x35b640,'rows':_0x55933e}:null;}})[_0x0d6c('0x22')](respondWithResult(_0xfad4b1,null))[_0x0d6c('0x3e')](handleError(_0xfad4b1,null));};exports[_0x0d6c('0x49')]=function(_0x42dd2f,_0x22eb35,_0x2e9a1e){if(_0x42dd2f[_0x0d6c('0x44')]['id']){delete _0x42dd2f['body']['id'];}return db['ServicenowAccount']['findOne']({'where':{'id':_0x42dd2f[_0x0d6c('0x40')]['id']}})['then'](handleEntityNotFound(_0x22eb35,null))[_0x0d6c('0x22')](function(_0x216530){if(_0x216530){_0x42dd2f[_0x0d6c('0x44')][_0x0d6c('0x4a')]=_0x216530['id'];_0x42dd2f['body'][_0x0d6c('0x4b')]=integrations[_0x0d6c('0x4c')](_0x42dd2f[_0x0d6c('0x44')][_0x0d6c('0x4d')],_0x42dd2f[_0x0d6c('0x44')][_0x0d6c('0x27')]);_0x42dd2f['body'][_0x0d6c('0x4e')]=integrations[_0x0d6c('0x4f')](_0x42dd2f[_0x0d6c('0x44')][_0x0d6c('0x4d')],_0x42dd2f['body'][_0x0d6c('0x27')]);return db['ServicenowConfiguration'][_0x0d6c('0x43')](_0x42dd2f[_0x0d6c('0x44')],{'include':[{'model':db[_0x0d6c('0x50')],'as':'Subjects'},{'model':db[_0x0d6c('0x50')],'as':_0x0d6c('0x4e')}]});}return null;})['then'](respondWithResult(_0x22eb35,null))['catch'](handleError(_0x22eb35,null));};exports['getFields']=function(_0x49f525,_0x5c7a0f,_0x7bbb0c){var _0x4c2409=[_0x0d6c('0x51'),_0x0d6c('0x52'),_0x0d6c('0x53'),_0x0d6c('0x54'),_0x0d6c('0x55'),_0x0d6c('0x56'),_0x0d6c('0x57'),'severity',_0x0d6c('0x58')];var _0x3a7215=[_0x0d6c('0x59'),_0x0d6c('0x51'),_0x0d6c('0x5a'),'watch_list',_0x0d6c('0x5b'),_0x0d6c('0x5c'),_0x0d6c('0x5d'),_0x0d6c('0x52'),_0x0d6c('0x5e'),_0x0d6c('0x5f'),_0x0d6c('0x60'),_0x0d6c('0x61'),_0x0d6c('0x62'),'user_input','sys_created_on','sys_domain',_0x0d6c('0x63'),_0x0d6c('0x64'),'knowledge','order',_0x0d6c('0x65'),'closed_at','cmdb_ci',_0x0d6c('0x66'),_0x0d6c('0x67'),_0x0d6c('0x68'),_0x0d6c('0x69'),_0x0d6c('0x6a'),_0x0d6c('0x6b'),'sys_domain_path',_0x0d6c('0x6c'),_0x0d6c('0x6d'),'expected_start',_0x0d6c('0x6e'),'business_duration',_0x0d6c('0x6f'),_0x0d6c('0x70'),_0x0d6c('0x71'),_0x0d6c('0x72'),_0x0d6c('0x73'),_0x0d6c('0x74'),_0x0d6c('0x54'),_0x0d6c('0x75'),'short_description',_0x0d6c('0x55'),'correlation_display','delivery_task',_0x0d6c('0x76'),_0x0d6c('0x77'),_0x0d6c('0x78'),'additional_assignee_list',_0x0d6c('0x79'),_0x0d6c('0x7a'),_0x0d6c('0x56'),_0x0d6c('0x7b'),'close_notes','closed_by',_0x0d6c('0x7c'),'parent_incident','sys_id',_0x0d6c('0x7d'),_0x0d6c('0x7e'),_0x0d6c('0x57'),_0x0d6c('0x7f'),_0x0d6c('0x80'),_0x0d6c('0x81'),_0x0d6c('0x82'),'activity_due',_0x0d6c('0x83'),_0x0d6c('0x84'),'comments','sla_due',_0x0d6c('0x85'),_0x0d6c('0x86'),_0x0d6c('0x87'),'sys_mod_count',_0x0d6c('0x88'),'sys_tags',_0x0d6c('0x89'),_0x0d6c('0x8a'),_0x0d6c('0x8b'),_0x0d6c('0x8c'),'category'];var _0x2ef472='';var _0x5b5249='';var _0x174f59=[];var _0x34a438='';var _0x3381e0='';var _0x1d998e=[];var _0x255917='';var _0x2db8e3='';var _0xdfc450={};var _0x1205fd='';return db[_0x0d6c('0x3a')]['findOne']({'where':{'id':_0x49f525[_0x0d6c('0x40')]['id']},'attributes':['id',_0x0d6c('0x8d'),_0x0d6c('0x8e'),_0x0d6c('0x8f'),_0x0d6c('0x90'),'serverUrl']})[_0x0d6c('0x22')](handleEntityNotFound(_0x5c7a0f,null))['then'](function(_0x20ff85){if(_0x20ff85){_0x1205fd=_0x20ff85[_0x0d6c('0x90')];var _0x204e64=_0x1205fd[_0x0d6c('0x91')](-0x1);if(_0x204e64==='/'){_0x1205fd=_0x1205fd[_0x0d6c('0x92')](0x0,_0x1205fd[_0x0d6c('0x93')](_0x204e64));}_0x2db8e3=util[_0x0d6c('0x94')]('%s/api/now/doc/table/schema/',_0x1205fd);_0x255917=util[_0x0d6c('0x94')](_0x0d6c('0x95'),_0x1205fd);_0xdfc450={'user':_0x20ff85[_0x0d6c('0x8d')],'pass':_0x20ff85[_0x0d6c('0x8e')]};var _0x40d955={'method':'GET','uri':_0x2db8e3+_0x0d6c('0x96'),'auth':_0xdfc450,'json':!![]};return rp(_0x40d955);}})[_0x0d6c('0x22')](function(_0x324544){if(_0x324544[_0x0d6c('0x97')]['length']>0x0){_0x2ef472=_0x324544[_0x0d6c('0x97')];}console['log'](_0x0d6c('0x98'),_0x2ef472);_0x1d998e=[];_0x5b5249=Object[_0x0d6c('0x99')]([],_0x2ef472);_[_0x0d6c('0x9a')](_0x5b5249,function(_0x1398bf){return!_0x4c2409['includes'](_0x1398bf['name']);});_0x5b5249[_0x0d6c('0x9b')](function(_0x4ed964){var _0x20312a=createFieldObject(_0x255917,_0xdfc450,_0x4ed964[_0x0d6c('0x9c')],_0x4ed964['name'],_0x4ed964[_0x0d6c('0x9d')],![]);_0x1d998e[_0x0d6c('0x9e')](_0x20312a);});return Promise[_0x0d6c('0x9f')](_0x1d998e);})[_0x0d6c('0x22')](function(_0x3ea7ca){_0x174f59=_0x3ea7ca;_0x34a438=Object['assign']([],_0x2ef472);console[_0x0d6c('0xa0')](_0x0d6c('0xa1'),_0x2ef472);_['remove'](_0x34a438,function(_0x41ba0c){return _0x3a7215[_0x0d6c('0xa2')](_0x41ba0c[_0x0d6c('0x23')]);});console[_0x0d6c('0xa0')](_0x0d6c('0xa3'),_0x34a438);_0x1d998e=[];_0x34a438['forEach'](function(_0x9bfe91){var _0x578f12=createFieldObject(_0x255917,_0xdfc450,_0x9bfe91[_0x0d6c('0x9c')],_0x9bfe91[_0x0d6c('0x23')],_0x9bfe91[_0x0d6c('0x9d')],!![]);_0x1d998e[_0x0d6c('0x9e')](_0x578f12);});return Promise[_0x0d6c('0x9f')](_0x1d998e);})[_0x0d6c('0x22')](function(_0x5a43d8){_0x3381e0=_0x5a43d8;var _0x4a88ea=_0x174f59[_0x0d6c('0xa4')](_0x3381e0);return{'count':_0x4a88ea[_0x0d6c('0x2f')],'rows':_0x4a88ea};})[_0x0d6c('0x22')](respondWithResult(_0x5c7a0f,null))[_0x0d6c('0x3e')](function(_0x224eab){console['log'](_0x0d6c('0xa5')+_0x224eab);var _0x18ca9b=_0x49f525[_0x0d6c('0x29')][_0x0d6c('0xa6')]?0x1f4:_0x224eab[_0x0d6c('0xa7')]||0x1f4;logger[_0x0d6c('0xa8')](_0x224eab['stack']);delete _0x224eab[_0x0d6c('0x23')];if(_0x18ca9b===0x191){_0x18ca9b=0x190;}_0x5c7a0f[_0x0d6c('0x17')](_0x18ca9b)[_0x0d6c('0x24')](_0x49f525['query'][_0x0d6c('0xa6')]?{'message':'Wrong\x20credentials','statusCode':_0x224eab['statusCode']}:_0x224eab);});};function createFieldObject(_0x2259a3,_0x32b13f,_0x7a92c0,_0x4212b9,_0x477799,_0x7dc9b8){return new Promise(function(_0x265f51,_0x45e29c){var _0x3a5cd7={'id':_0x4212b9,'name':_0x477799,'custom':_0x7dc9b8};if(_0x7a92c0===_0x0d6c('0xa9')){_0x3a5cd7[_0x0d6c('0x39')]=[{'name':'True','value':_0x0d6c('0xaa')},{'name':_0x0d6c('0xab'),'value':_0x0d6c('0xac')}];_0x265f51(_0x3a5cd7);}else{var _0x82c573={'method':_0x0d6c('0xad'),'uri':_0x2259a3+_0x0d6c('0xae')+_0x4212b9,'auth':_0x32b13f,'json':!![]};return rp(_0x82c573)['then'](function(_0x58e29f){var _0x403bd1=[];if(_0x58e29f['result']['length']>0x0){_0x58e29f[_0x0d6c('0x97')][_0x0d6c('0x9b')](function(_0x2a7482){if(_0x2a7482[_0x0d6c('0xaf')]===_0x0d6c('0xac')){var _0x33d16e={'name':_0x2a7482[_0x0d6c('0x9d')],'value':_0x2a7482[_0x0d6c('0xb0')]};_0x403bd1[_0x0d6c('0x9e')](_0x33d16e);}});}_0x3a5cd7['options']=_0x403bd1;if(_0x3a5cd7['options'][_0x0d6c('0x2f')]>0x0){_0x265f51(_0x3a5cd7);}else{if(_0x7dc9b8==![]){_0x265f51();}else{_0x265f51(_0x3a5cd7);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 7a39877..4d2327e 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 _0x687b=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','int_servicenow_accounts','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x545f89,_0x40cf1b){var _0x32d6d2=function(_0xa130a5){while(--_0xa130a5){_0x545f89['push'](_0x545f89['shift']());}};_0x32d6d2(++_0x40cf1b);}(_0x687b,0x14a));var _0xb687=function(_0x297d6f,_0x12c8be){_0x297d6f=_0x297d6f-0x0;var _0x4e0852=_0x687b[_0x297d6f];return _0x4e0852;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));var integrations=require(_0xb687('0x9'));module[_0xb687('0xa')]=function(_0xf43a1f,_0x47ffea){return _0xf43a1f[_0xb687('0xb')]('ServicenowAccount',attributes,{'tableName':_0xb687('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2bd8=['bluebird','request-promise','path','rimraf','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','../../config/logger','api','moment'];(function(_0x723816,_0x489cd4){var _0x53edc2=function(_0x44fdbf){while(--_0x44fdbf){_0x723816['push'](_0x723816['shift']());}};_0x53edc2(++_0x489cd4);}(_0x2bd8,0x130));var _0x82bd=function(_0xa26149,_0x17c873){_0xa26149=_0xa26149-0x0;var _0x5ccb0e=_0x2bd8[_0xa26149];return _0x5ccb0e;};'use strict';var _=require(_0x82bd('0x0'));var util=require('util');var logger=require(_0x82bd('0x1'))(_0x82bd('0x2'));var moment=require(_0x82bd('0x3'));var BPromise=require(_0x82bd('0x4'));var rp=require(_0x82bd('0x5'));var fs=require('fs');var path=require(_0x82bd('0x6'));var rimraf=require(_0x82bd('0x7'));var config=require('../../config/environment');var attributes=require(_0x82bd('0x8'));var integrations=require(_0x82bd('0x9'));module[_0x82bd('0xa')]=function(_0x5ceb60,_0x19dbb1){return _0x5ceb60[_0x82bd('0xb')](_0x82bd('0xc'),attributes,{'tableName':_0x82bd('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 74dbebc..467b0d9 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 _0x1887=['then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetServicenowAccount','ServicenowAccount','options','raw','attributes','limit','include','map','model','ShowServicenowAccount','find','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x589248,_0x31dea3){var _0x486750=function(_0x3e7c21){while(--_0x3e7c21){_0x589248['push'](_0x589248['shift']());}};_0x486750(++_0x31dea3);}(_0x1887,0x1f2));var _0x7188=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1887[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7188('0x0'));var util=require('util');var moment=require(_0x7188('0x1'));var BPromise=require(_0x7188('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7188('0x3'));var db=require(_0x7188('0x4'))['db'];var utils=require(_0x7188('0x5'));var logger=require(_0x7188('0x6'))(_0x7188('0x7'));var config=require('../../config/environment');var jayson=require(_0x7188('0x8'));var client=jayson[_0x7188('0x9')][_0x7188('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x979c91,_0x2cab30,_0x97c6b7){return new BPromise(function(_0x3c3f57,_0x50abeb){return client[_0x7188('0xb')](_0x979c91,_0x97c6b7)[_0x7188('0xc')](function(_0xf97e58){logger[_0x7188('0xd')](_0x7188('0xe'),_0x2cab30,_0x7188('0xf'));logger[_0x7188('0x10')](_0x7188('0x11'),_0x2cab30,_0x7188('0xf'),JSON[_0x7188('0x12')](_0xf97e58));if(_0xf97e58[_0x7188('0x13')]){if(_0xf97e58[_0x7188('0x13')]['code']===0x1f4){logger[_0x7188('0x13')](_0x7188('0xe'),_0x2cab30,_0xf97e58[_0x7188('0x13')]['message']);return _0x50abeb(_0xf97e58[_0x7188('0x13')][_0x7188('0x14')]);}logger[_0x7188('0x13')](_0x7188('0xe'),_0x2cab30,_0xf97e58[_0x7188('0x13')][_0x7188('0x14')]);return _0x3c3f57(_0xf97e58[_0x7188('0x13')][_0x7188('0x14')]);}else{logger['info'](_0x7188('0xe'),_0x2cab30,_0x7188('0xf'));_0x3c3f57(_0xf97e58[_0x7188('0x15')][_0x7188('0x14')]);}})[_0x7188('0x16')](function(_0xce4400){logger[_0x7188('0x13')](_0x7188('0xe'),_0x2cab30,_0xce4400);_0x50abeb(_0xce4400);});});}exports[_0x7188('0x17')]=function(_0xad8934){var _0x513322=this;return new Promise(function(_0x328cf8,_0xba1774){return db[_0x7188('0x18')]['findAll']({'raw':_0xad8934[_0x7188('0x19')]?_0xad8934[_0x7188('0x19')][_0x7188('0x1a')]===undefined?!![]:![]:!![],'where':_0xad8934[_0x7188('0x19')]?_0xad8934['options']['where']||null:null,'attributes':_0xad8934[_0x7188('0x19')]?_0xad8934[_0x7188('0x19')][_0x7188('0x1b')]||null:null,'limit':_0xad8934['options']?_0xad8934['options'][_0x7188('0x1c')]||null:null,'include':_0xad8934[_0x7188('0x19')]?_0xad8934[_0x7188('0x19')][_0x7188('0x1d')]?_[_0x7188('0x1e')](_0xad8934['options'][_0x7188('0x1d')],function(_0x7ed493){return{'model':db[_0x7ed493[_0x7188('0x1f')]],'as':_0x7ed493['as'],'attributes':_0x7ed493[_0x7188('0x1b')],'include':_0x7ed493[_0x7188('0x1d')]?_[_0x7188('0x1e')](_0x7ed493[_0x7188('0x1d')],function(_0x18af02){return{'model':db[_0x18af02[_0x7188('0x1f')]],'as':_0x18af02['as'],'attributes':_0x18af02[_0x7188('0x1b')],'include':_0x18af02['include']?_[_0x7188('0x1e')](_0x18af02['include'],function(_0x4a3bfb){return{'model':db[_0x4a3bfb['model']],'as':_0x4a3bfb['as'],'attributes':_0x4a3bfb[_0x7188('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x949ff2){logger['info'](_0x7188('0x17'),_0xad8934);logger[_0x7188('0x10')](_0x7188('0x17'),_0xad8934,JSON['stringify'](_0x949ff2));_0x328cf8(_0x949ff2);})[_0x7188('0x16')](function(_0xcde103){logger[_0x7188('0x13')](_0x7188('0x17'),_0xcde103['message'],_0xad8934);_0xba1774(_0x513322[_0x7188('0x13')](0x1f4,_0xcde103[_0x7188('0x14')]));});});};exports[_0x7188('0x20')]=function(_0x100ab2){var _0x587cf7=this;return new Promise(function(_0x2aa11a,_0x54c015){return db[_0x7188('0x18')][_0x7188('0x21')]({'raw':_0x100ab2[_0x7188('0x19')]?_0x100ab2['options'][_0x7188('0x1a')]===undefined?!![]:![]:!![],'where':_0x100ab2[_0x7188('0x19')]?_0x100ab2[_0x7188('0x19')]['where']||null:null,'attributes':_0x100ab2[_0x7188('0x19')]?_0x100ab2[_0x7188('0x19')]['attributes']||null:null,'include':_0x100ab2[_0x7188('0x19')]?_0x100ab2[_0x7188('0x19')][_0x7188('0x1d')]?_[_0x7188('0x1e')](_0x100ab2[_0x7188('0x19')][_0x7188('0x1d')],function(_0x474e02){return{'model':db[_0x474e02[_0x7188('0x1f')]],'as':_0x474e02['as'],'attributes':_0x474e02['attributes'],'include':_0x474e02[_0x7188('0x1d')]?_['map'](_0x474e02[_0x7188('0x1d')],function(_0x3d4b08){return{'model':db[_0x3d4b08[_0x7188('0x1f')]],'as':_0x3d4b08['as'],'attributes':_0x3d4b08[_0x7188('0x1b')],'include':_0x3d4b08[_0x7188('0x1d')]?_[_0x7188('0x1e')](_0x3d4b08[_0x7188('0x1d')],function(_0x209f74){return{'model':db[_0x209f74['model']],'as':_0x209f74['as'],'attributes':_0x209f74[_0x7188('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x7188('0xc')](function(_0xf796b7){logger[_0x7188('0xd')](_0x7188('0x20'),_0x100ab2);logger['debug']('ShowServicenowAccount',_0x100ab2,JSON['stringify'](_0xf796b7));_0x2aa11a(_0xf796b7);})['catch'](function(_0x5e7b94){logger['error']('ShowServicenowAccount',_0x5e7b94[_0x7188('0x14')],_0x100ab2);_0x54c015(_0x587cf7[_0x7188('0x13')](0x1f4,_0x5e7b94['message']));});});}; \ No newline at end of file +var _0xc337=['model','map','ShowServicenowAccount','raw','lodash','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','findAll','options','where','attributes','limit','include'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc337,0x1b6));var _0x7c33=function(_0xdf305b,_0x292380){_0xdf305b=_0xdf305b-0x0;var _0x616415=_0xc337[_0xdf305b];return _0x616415;};'use strict';var _=require(_0x7c33('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7c33('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7c33('0x2'));var logger=require(_0x7c33('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7c33('0x4'));var client=jayson[_0x7c33('0x5')][_0x7c33('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x15f688,_0xff6283,_0x25ab17){return new BPromise(function(_0x5a914a,_0x4c614a){return client['request'](_0x15f688,_0x25ab17)[_0x7c33('0x7')](function(_0x35efde){logger[_0x7c33('0x8')]('ServicenowAccount,\x20%s,\x20%s',_0xff6283,_0x7c33('0x9'));logger[_0x7c33('0xa')](_0x7c33('0xb'),_0xff6283,_0x7c33('0x9'),JSON[_0x7c33('0xc')](_0x35efde));if(_0x35efde['error']){if(_0x35efde[_0x7c33('0xd')][_0x7c33('0xe')]===0x1f4){logger['error'](_0x7c33('0xf'),_0xff6283,_0x35efde[_0x7c33('0xd')][_0x7c33('0x10')]);return _0x4c614a(_0x35efde['error'][_0x7c33('0x10')]);}logger[_0x7c33('0xd')]('ServicenowAccount,\x20%s,\x20%s',_0xff6283,_0x35efde[_0x7c33('0xd')]['message']);return _0x5a914a(_0x35efde[_0x7c33('0xd')]['message']);}else{logger[_0x7c33('0x8')](_0x7c33('0xf'),_0xff6283,_0x7c33('0x9'));_0x5a914a(_0x35efde[_0x7c33('0x11')][_0x7c33('0x10')]);}})[_0x7c33('0x12')](function(_0x4d96f0){logger[_0x7c33('0xd')](_0x7c33('0xf'),_0xff6283,_0x4d96f0);_0x4c614a(_0x4d96f0);});});}exports[_0x7c33('0x13')]=function(_0x36ef2d){var _0xcd6855=this;return new Promise(function(_0x19c6ff,_0x518563){return db[_0x7c33('0x14')][_0x7c33('0x15')]({'raw':_0x36ef2d[_0x7c33('0x16')]?_0x36ef2d[_0x7c33('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x36ef2d[_0x7c33('0x16')]?_0x36ef2d['options'][_0x7c33('0x17')]||null:null,'attributes':_0x36ef2d['options']?_0x36ef2d[_0x7c33('0x16')][_0x7c33('0x18')]||null:null,'limit':_0x36ef2d[_0x7c33('0x16')]?_0x36ef2d[_0x7c33('0x16')][_0x7c33('0x19')]||null:null,'include':_0x36ef2d[_0x7c33('0x16')]?_0x36ef2d[_0x7c33('0x16')][_0x7c33('0x1a')]?_['map'](_0x36ef2d[_0x7c33('0x16')][_0x7c33('0x1a')],function(_0x483d36){return{'model':db[_0x483d36[_0x7c33('0x1b')]],'as':_0x483d36['as'],'attributes':_0x483d36['attributes'],'include':_0x483d36['include']?_[_0x7c33('0x1c')](_0x483d36[_0x7c33('0x1a')],function(_0x468af5){return{'model':db[_0x468af5['model']],'as':_0x468af5['as'],'attributes':_0x468af5[_0x7c33('0x18')],'include':_0x468af5['include']?_['map'](_0x468af5[_0x7c33('0x1a')],function(_0x59af95){return{'model':db[_0x59af95[_0x7c33('0x1b')]],'as':_0x59af95['as'],'attributes':_0x59af95[_0x7c33('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7c33('0x7')](function(_0x194c2c){logger['info']('GetServicenowAccount',_0x36ef2d);logger[_0x7c33('0xa')](_0x7c33('0x13'),_0x36ef2d,JSON[_0x7c33('0xc')](_0x194c2c));_0x19c6ff(_0x194c2c);})['catch'](function(_0xb83e46){logger[_0x7c33('0xd')](_0x7c33('0x13'),_0xb83e46[_0x7c33('0x10')],_0x36ef2d);_0x518563(_0xcd6855[_0x7c33('0xd')](0x1f4,_0xb83e46[_0x7c33('0x10')]));});});};exports[_0x7c33('0x1d')]=function(_0x2fc885){var _0x45ef86=this;return new Promise(function(_0x233f74,_0x4dea20){return db[_0x7c33('0x14')]['find']({'raw':_0x2fc885[_0x7c33('0x16')]?_0x2fc885[_0x7c33('0x16')][_0x7c33('0x1e')]===undefined?!![]:![]:!![],'where':_0x2fc885['options']?_0x2fc885['options'][_0x7c33('0x17')]||null:null,'attributes':_0x2fc885[_0x7c33('0x16')]?_0x2fc885[_0x7c33('0x16')][_0x7c33('0x18')]||null:null,'include':_0x2fc885[_0x7c33('0x16')]?_0x2fc885['options'][_0x7c33('0x1a')]?_[_0x7c33('0x1c')](_0x2fc885[_0x7c33('0x16')][_0x7c33('0x1a')],function(_0x11a183){return{'model':db[_0x11a183[_0x7c33('0x1b')]],'as':_0x11a183['as'],'attributes':_0x11a183[_0x7c33('0x18')],'include':_0x11a183[_0x7c33('0x1a')]?_[_0x7c33('0x1c')](_0x11a183['include'],function(_0xa1b9a4){return{'model':db[_0xa1b9a4[_0x7c33('0x1b')]],'as':_0xa1b9a4['as'],'attributes':_0xa1b9a4[_0x7c33('0x18')],'include':_0xa1b9a4[_0x7c33('0x1a')]?_['map'](_0xa1b9a4['include'],function(_0x2440a3){return{'model':db[_0x2440a3[_0x7c33('0x1b')]],'as':_0x2440a3['as'],'attributes':_0x2440a3[_0x7c33('0x18')]};}):[]};}):[]};}):[]:[]})[_0x7c33('0x7')](function(_0x1de138){logger[_0x7c33('0x8')](_0x7c33('0x1d'),_0x2fc885);logger[_0x7c33('0xa')](_0x7c33('0x1d'),_0x2fc885,JSON[_0x7c33('0xc')](_0x1de138));_0x233f74(_0x1de138);})[_0x7c33('0x12')](function(_0x3f532f){logger[_0x7c33('0xd')]('ShowServicenowAccount',_0x3f532f[_0x7c33('0x10')],_0x2fc885);_0x4dea20(_0x45ef86[_0x7c33('0xd')](0x1f4,_0x3f532f['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ff0ae1c..e6c0b7b 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 _0x5612=['getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','put','update','delete','exports','multer','util','path','connect-timeout','express','fs-extra','../../config/environment','./intServicenowConfiguration.controller','index','get','/:id','isAuthenticated','show','/:id/fields'];(function(_0x39f405,_0x432107){var _0x4f958c=function(_0x2dba91){while(--_0x2dba91){_0x39f405['push'](_0x39f405['shift']());}};_0x4f958c(++_0x432107);}(_0x5612,0x134));var _0x2561=function(_0x27748c,_0x3fcf2f){_0x27748c=_0x27748c-0x0;var _0x3ddf1f=_0x5612[_0x27748c];return _0x3ddf1f;};'use strict';var multer=require(_0x2561('0x0'));var util=require(_0x2561('0x1'));var path=require(_0x2561('0x2'));var timeout=require(_0x2561('0x3'));var express=require(_0x2561('0x4'));var router=express['Router']();var fs_extra=require(_0x2561('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2561('0x6'));var controller=require(_0x2561('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x2561('0x8')]);router[_0x2561('0x9')](_0x2561('0xa'),auth[_0x2561('0xb')](),controller[_0x2561('0xc')]);router[_0x2561('0x9')](_0x2561('0xd'),auth[_0x2561('0xb')](),controller[_0x2561('0xe')]);router['get'](_0x2561('0xf'),auth[_0x2561('0xb')](),controller['getSubjects']);router['get'](_0x2561('0x10'),auth[_0x2561('0xb')](),controller[_0x2561('0x11')]);router[_0x2561('0x12')]('/',auth[_0x2561('0xb')](),controller['create']);router[_0x2561('0x13')](_0x2561('0xa'),auth[_0x2561('0xb')](),controller[_0x2561('0x14')]);router[_0x2561('0x15')](_0x2561('0xa'),auth[_0x2561('0xb')](),controller['destroy']);module[_0x2561('0x16')]=router; \ No newline at end of file +var _0xb260=['../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x3d21db,_0x4adb9d){var _0x466cf3=function(_0x4a527c){while(--_0x4a527c){_0x3d21db['push'](_0x3d21db['shift']());}};_0x466cf3(++_0x4adb9d);}(_0xb260,0xaa));var _0x0b26=function(_0x257e1f,_0x11a95a){_0x257e1f=_0x257e1f-0x0;var _0xa85736=_0xb260[_0x257e1f];return _0xa85736;};'use strict';var multer=require(_0x0b26('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0b26('0x1'));var express=require(_0x0b26('0x2'));var router=express[_0x0b26('0x3')]();var fs_extra=require(_0x0b26('0x4'));var auth=require(_0x0b26('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0b26('0x6'));var controller=require('./intServicenowConfiguration.controller');router['get']('/',auth[_0x0b26('0x7')](),controller[_0x0b26('0x8')]);router[_0x0b26('0x9')](_0x0b26('0xa'),auth[_0x0b26('0x7')](),controller['show']);router[_0x0b26('0x9')](_0x0b26('0xb'),auth[_0x0b26('0x7')](),controller['getFields']);router['get']('/:id/subjects',auth[_0x0b26('0x7')](),controller[_0x0b26('0xc')]);router['get'](_0x0b26('0xd'),auth[_0x0b26('0x7')](),controller[_0x0b26('0xe')]);router[_0x0b26('0xf')]('/',auth['isAuthenticated'](),controller[_0x0b26('0x10')]);router[_0x0b26('0x11')](_0x0b26('0xa'),auth[_0x0b26('0x7')](),controller[_0x0b26('0x12')]);router[_0x0b26('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x0b26('0x14')]);module[_0x0b26('0x15')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index d1cbb13..28e86be 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 _0xf766=['sequelize','exports','STRING'];(function(_0x5ceaf2,_0x25b233){var _0x57dc8f=function(_0x483267){while(--_0x483267){_0x5ceaf2['push'](_0x5ceaf2['shift']());}};_0x57dc8f(++_0x25b233);}(_0xf766,0x153));var _0x6f76=function(_0x34fc32,_0x1b372f){_0x34fc32=_0x34fc32-0x0;var _0x567758=_0xf766[_0x34fc32];return _0x567758;};'use strict';var Sequelize=require(_0x6f76('0x0'));module[_0x6f76('0x1')]={'name':{'type':Sequelize[_0x6f76('0x2')]},'description':{'type':Sequelize[_0x6f76('0x2')]}}; \ No newline at end of file +var _0x2b88=['STRING','exports'];(function(_0xf69ea2,_0x4b0d5c){var _0x2c88ec=function(_0x25c12f){while(--_0x25c12f){_0xf69ea2['push'](_0xf69ea2['shift']());}};_0x2c88ec(++_0x4b0d5c);}(_0x2b88,0x15d));var _0x82b8=function(_0x3f994d,_0x249d72){_0x3f994d=_0x3f994d-0x0;var _0x5309b4=_0x2b88[_0x3f994d];return _0x5309b4;};'use strict';var Sequelize=require('sequelize');module[_0x82b8('0x0')]={'name':{'type':Sequelize[_0x82b8('0x1')]},'description':{'type':Sequelize[_0x82b8('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index f17725d..2633d13 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 _0xf1d1=['sort','where','pick','filter','VIRTUAL','merge','options','include','rows','catch','show','params','length','find','create','body','getFields','findOne','ServicenowField','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','squel','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order'];(function(_0x2af42f,_0x2a219b){var _0x13e899=function(_0x53dd00){while(--_0x53dd00){_0x2af42f['push'](_0x2af42f['shift']());}};_0x13e899(++_0x2a219b);}(_0xf1d1,0xaf));var _0x1f1d=function(_0x4cd7c4,_0x81b3a8){_0x4cd7c4=_0x4cd7c4-0x0;var _0x14b7e2=_0xf1d1[_0x4cd7c4];return _0x14b7e2;};'use strict';var emlformat=require(_0x1f1d('0x0'));var rimraf=require(_0x1f1d('0x1'));var zipdir=require(_0x1f1d('0x2'));var jsonpatch=require(_0x1f1d('0x3'));var rp=require(_0x1f1d('0x4'));var moment=require(_0x1f1d('0x5'));var BPromise=require(_0x1f1d('0x6'));var Mustache=require('mustache');var util=require(_0x1f1d('0x7'));var path=require('path');var sox=require(_0x1f1d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f1d('0x9'));var _=require('lodash');var squel=require(_0x1f1d('0xa'));var crypto=require('crypto');var jsforce=require(_0x1f1d('0xb'));var deskjs=require(_0x1f1d('0xc'));var toCsv=require(_0x1f1d('0xd'));var querystring=require(_0x1f1d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1f1d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1f1d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1f1d('0x11'))(_0x1f1d('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1f1d('0x13'));var db=require(_0x1f1d('0x14'))['db'];function respondWithStatusCode(_0x4324b9,_0x1ac2c4){_0x1ac2c4=_0x1ac2c4||0xcc;return function(_0x1fc539){if(_0x1fc539){return _0x4324b9[_0x1f1d('0x15')](_0x1ac2c4);}return _0x4324b9[_0x1f1d('0x16')](_0x1ac2c4)[_0x1f1d('0x17')]();};}function respondWithResult(_0x5095fd,_0x134063){_0x134063=_0x134063||0xc8;return function(_0x3cb0c9){if(_0x3cb0c9){return _0x5095fd[_0x1f1d('0x16')](_0x134063)['json'](_0x3cb0c9);}};}function respondWithFilteredResult(_0x73cc86,_0x75aea6){return function(_0x378f74){if(_0x378f74){var _0xfb8190=typeof _0x75aea6[_0x1f1d('0x18')]===_0x1f1d('0x19')&&typeof _0x75aea6[_0x1f1d('0x1a')]===_0x1f1d('0x19');var _0x3d09dd=_0x378f74['count'];var _0x315849=_0xfb8190?0x0:_0x75aea6[_0x1f1d('0x18')];var _0x376389=_0xfb8190?_0x378f74[_0x1f1d('0x1b')]:_0x75aea6[_0x1f1d('0x18')]+_0x75aea6[_0x1f1d('0x1a')];var _0x5f114c;if(_0x376389>=_0x3d09dd){_0x376389=_0x3d09dd;_0x5f114c=0xc8;}else{_0x5f114c=0xce;}_0x73cc86[_0x1f1d('0x16')](_0x5f114c);return _0x73cc86[_0x1f1d('0x1c')](_0x1f1d('0x1d'),_0x315849+'-'+_0x376389+'/'+_0x3d09dd)[_0x1f1d('0x1e')](_0x378f74);}return null;};}function patchUpdates(_0x498ac0){return function(_0x390534){try{jsonpatch[_0x1f1d('0x1f')](_0x390534,_0x498ac0,!![]);}catch(_0x3d8be7){return BPromise[_0x1f1d('0x20')](_0x3d8be7);}return _0x390534[_0x1f1d('0x21')]();};}function saveUpdates(_0x56978a,_0x5f18b1){return function(_0x44bb86){if(_0x44bb86){return _0x44bb86[_0x1f1d('0x22')](_0x56978a)[_0x1f1d('0x23')](function(_0x34066a){return _0x34066a;});}return null;};}function removeEntity(_0x48e6a6,_0x577879){return function(_0x26a04e){if(_0x26a04e){return _0x26a04e[_0x1f1d('0x24')]()[_0x1f1d('0x23')](function(){_0x48e6a6[_0x1f1d('0x16')](0xcc)[_0x1f1d('0x17')]();});}};}function handleEntityNotFound(_0x57651b,_0x12f863){return function(_0x5c0d1d){if(!_0x5c0d1d){_0x57651b[_0x1f1d('0x15')](0x194);}return _0x5c0d1d;};}function handleError(_0x215679,_0x1a12ac){_0x1a12ac=_0x1a12ac||0x1f4;return function(_0x550f8c){logger[_0x1f1d('0x25')](_0x550f8c[_0x1f1d('0x26')]);if(_0x550f8c[_0x1f1d('0x27')]){delete _0x550f8c['name'];}_0x215679[_0x1f1d('0x16')](_0x1a12ac)[_0x1f1d('0x28')](_0x550f8c);};}exports['index']=function(_0x37661f,_0x5c4ac6){var _0xff36ba={},_0x23e83d={},_0x3dfe4e={'count':0x0,'rows':[]};var _0x12bedf=_[_0x1f1d('0x29')](db[_0x1f1d('0x2a')][_0x1f1d('0x2b')],function(_0x4a30d3){return{'name':_0x4a30d3['fieldName'],'type':_0x4a30d3[_0x1f1d('0x2c')][_0x1f1d('0x2d')]};});_0x23e83d[_0x1f1d('0x2e')]=_[_0x1f1d('0x29')](_0x12bedf,_0x1f1d('0x27'));_0x23e83d['query']=_[_0x1f1d('0x2f')](_0x37661f[_0x1f1d('0x30')]);_0x23e83d[_0x1f1d('0x31')]=_[_0x1f1d('0x32')](_0x23e83d[_0x1f1d('0x2e')],_0x23e83d[_0x1f1d('0x30')]);_0xff36ba[_0x1f1d('0x33')]=_[_0x1f1d('0x32')](_0x23e83d[_0x1f1d('0x2e')],qs[_0x1f1d('0x34')](_0x37661f[_0x1f1d('0x30')][_0x1f1d('0x34')]));_0xff36ba[_0x1f1d('0x33')]=_0xff36ba[_0x1f1d('0x33')]['length']?_0xff36ba[_0x1f1d('0x33')]:_0x23e83d['model'];if(!_0x37661f[_0x1f1d('0x30')][_0x1f1d('0x35')](_0x1f1d('0x36'))){_0xff36ba[_0x1f1d('0x1a')]=qs[_0x1f1d('0x1a')](_0x37661f[_0x1f1d('0x30')][_0x1f1d('0x1a')]);_0xff36ba[_0x1f1d('0x18')]=qs[_0x1f1d('0x18')](_0x37661f[_0x1f1d('0x30')][_0x1f1d('0x18')]);}_0xff36ba[_0x1f1d('0x37')]=qs['sort'](_0x37661f[_0x1f1d('0x30')][_0x1f1d('0x38')]);_0xff36ba[_0x1f1d('0x39')]=qs['filters'](_[_0x1f1d('0x3a')](_0x37661f['query'],_0x23e83d[_0x1f1d('0x31')]),_0x12bedf);if(_0x37661f['query'][_0x1f1d('0x3b')]){_0xff36ba[_0x1f1d('0x39')]=_['merge'](_0xff36ba[_0x1f1d('0x39')],{'$or':_[_0x1f1d('0x29')](_0x12bedf,function(_0x2fedd8){if(_0x2fedd8[_0x1f1d('0x2c')]!==_0x1f1d('0x3c')){var _0x4b03ca={};_0x4b03ca[_0x2fedd8[_0x1f1d('0x27')]]={'$like':'%'+_0x37661f['query'][_0x1f1d('0x3b')]+'%'};return _0x4b03ca;}})});}_0xff36ba=_[_0x1f1d('0x3d')]({},_0xff36ba,_0x37661f[_0x1f1d('0x3e')]);var _0x5905c1={'where':_0xff36ba[_0x1f1d('0x39')]};return db['ServicenowConfiguration']['count'](_0x5905c1)[_0x1f1d('0x23')](function(_0x6f4502){_0x3dfe4e[_0x1f1d('0x1b')]=_0x6f4502;if(_0x37661f[_0x1f1d('0x30')]['includeAll']){_0xff36ba[_0x1f1d('0x3f')]=[{'all':!![]}];}return db[_0x1f1d('0x2a')]['findAll'](_0xff36ba);})[_0x1f1d('0x23')](function(_0x1878e6){_0x3dfe4e[_0x1f1d('0x40')]=_0x1878e6;return _0x3dfe4e;})['then'](respondWithFilteredResult(_0x5c4ac6,_0xff36ba))[_0x1f1d('0x41')](handleError(_0x5c4ac6,null));};exports[_0x1f1d('0x42')]=function(_0x1396cf,_0x33eddc){var _0x5a96b4={'raw':![],'where':{'id':_0x1396cf[_0x1f1d('0x43')]['id']}},_0x5a097e={};_0x5a097e[_0x1f1d('0x2e')]=_[_0x1f1d('0x2f')](db[_0x1f1d('0x2a')][_0x1f1d('0x2b')]);_0x5a097e[_0x1f1d('0x30')]=_[_0x1f1d('0x2f')](_0x1396cf[_0x1f1d('0x30')]);_0x5a097e['filters']=_['intersection'](_0x5a097e[_0x1f1d('0x2e')],_0x5a097e[_0x1f1d('0x30')]);_0x5a96b4['attributes']=_[_0x1f1d('0x32')](_0x5a097e[_0x1f1d('0x2e')],qs[_0x1f1d('0x34')](_0x1396cf['query'][_0x1f1d('0x34')]));_0x5a96b4[_0x1f1d('0x33')]=_0x5a96b4[_0x1f1d('0x33')][_0x1f1d('0x44')]?_0x5a96b4[_0x1f1d('0x33')]:_0x5a097e[_0x1f1d('0x2e')];if(_0x1396cf['query']['includeAll']){_0x5a96b4[_0x1f1d('0x3f')]=[{'all':!![]}];}_0x5a96b4=_[_0x1f1d('0x3d')]({},_0x5a96b4,_0x1396cf[_0x1f1d('0x3e')]);return db['ServicenowConfiguration'][_0x1f1d('0x45')](_0x5a96b4)['then'](handleEntityNotFound(_0x33eddc,null))[_0x1f1d('0x23')](respondWithResult(_0x33eddc,null))[_0x1f1d('0x41')](handleError(_0x33eddc,null));};exports[_0x1f1d('0x46')]=function(_0x185f03,_0x38e385){return db['ServicenowConfiguration']['create'](_0x185f03[_0x1f1d('0x47')],{})['then'](respondWithResult(_0x38e385,0xc9))[_0x1f1d('0x41')](handleError(_0x38e385,null));};exports['update']=function(_0x17642e,_0x3809c8){if(_0x17642e[_0x1f1d('0x47')]['id']){delete _0x17642e[_0x1f1d('0x47')]['id'];}return db[_0x1f1d('0x2a')][_0x1f1d('0x45')]({'where':{'id':_0x17642e[_0x1f1d('0x43')]['id']}})[_0x1f1d('0x23')](handleEntityNotFound(_0x3809c8,null))['then'](saveUpdates(_0x17642e['body'],null))['then'](respondWithResult(_0x3809c8,null))[_0x1f1d('0x41')](handleError(_0x3809c8,null));};exports[_0x1f1d('0x24')]=function(_0x2a2fad,_0x49b0cf){return db['ServicenowConfiguration'][_0x1f1d('0x45')]({'where':{'id':_0x2a2fad[_0x1f1d('0x43')]['id']}})[_0x1f1d('0x23')](handleEntityNotFound(_0x49b0cf,null))[_0x1f1d('0x23')](removeEntity(_0x49b0cf,null))[_0x1f1d('0x41')](handleError(_0x49b0cf,null));};exports[_0x1f1d('0x48')]=function(_0xd84658,_0x5525b7,_0x41538d){var _0x1d7046={};var _0x2cf14c={};var _0x2d2adc;var _0x3f24b4;return db[_0x1f1d('0x2a')][_0x1f1d('0x49')]({'where':{'id':_0xd84658[_0x1f1d('0x43')]['id']}})[_0x1f1d('0x23')](handleEntityNotFound(_0x5525b7,null))['then'](function(_0x1238e4){if(_0x1238e4){_0x2d2adc=_0x1238e4;_0x2cf14c[_0x1f1d('0x2e')]=_[_0x1f1d('0x2f')](db['ServicenowField']['rawAttributes']);_0x2cf14c['query']=_['keys'](_0xd84658[_0x1f1d('0x30')]);_0x2cf14c[_0x1f1d('0x31')]=_[_0x1f1d('0x32')](_0x2cf14c[_0x1f1d('0x2e')],_0x2cf14c[_0x1f1d('0x30')]);_0x1d7046['attributes']=_[_0x1f1d('0x32')](_0x2cf14c[_0x1f1d('0x2e')],qs['fields'](_0xd84658[_0x1f1d('0x30')][_0x1f1d('0x34')]));_0x1d7046[_0x1f1d('0x33')]=_0x1d7046[_0x1f1d('0x33')][_0x1f1d('0x44')]?_0x1d7046[_0x1f1d('0x33')]:_0x2cf14c[_0x1f1d('0x2e')];_0x1d7046[_0x1f1d('0x37')]=qs[_0x1f1d('0x38')](_0xd84658['query'][_0x1f1d('0x38')]);_0x1d7046[_0x1f1d('0x39')]=qs[_0x1f1d('0x31')](_[_0x1f1d('0x3a')](_0xd84658[_0x1f1d('0x30')],_0x2cf14c['filters']));if(_0xd84658['query'][_0x1f1d('0x3b')]){_0x1d7046[_0x1f1d('0x39')]=_['merge'](_0x1d7046[_0x1f1d('0x39')],{'$or':_['map'](_0x1d7046[_0x1f1d('0x33')],function(_0x230c34){var _0x3b1c17={};_0x3b1c17[_0x230c34]={'$like':'%'+_0xd84658[_0x1f1d('0x30')][_0x1f1d('0x3b')]+'%'};return _0x3b1c17;})});}_0x1d7046=_['merge']({},_0x1d7046,_0xd84658[_0x1f1d('0x3e')]);return _0x2d2adc[_0x1f1d('0x48')](_0x1d7046);}})[_0x1f1d('0x23')](function(_0x5be4c3){if(_0x5be4c3){_0x3f24b4=_0x5be4c3[_0x1f1d('0x44')];if(!_0xd84658[_0x1f1d('0x30')][_0x1f1d('0x35')](_0x1f1d('0x36'))){_0x1d7046[_0x1f1d('0x1a')]=qs[_0x1f1d('0x1a')](_0xd84658['query'][_0x1f1d('0x1a')]);_0x1d7046['offset']=qs[_0x1f1d('0x18')](_0xd84658['query'][_0x1f1d('0x18')]);}return _0x2d2adc[_0x1f1d('0x48')](_0x1d7046);}})[_0x1f1d('0x23')](function(_0x7d1598){if(_0x7d1598){return _0x7d1598?{'count':_0x3f24b4,'rows':_0x7d1598}:null;}})['then'](respondWithResult(_0x5525b7,null))[_0x1f1d('0x41')](handleError(_0x5525b7,null));};exports['getSubjects']=function(_0x74826a,_0x41df28,_0x630115){var _0x3cc750={};var _0x34f9ab={};var _0x13f6df;var _0x50af87;return db[_0x1f1d('0x2a')][_0x1f1d('0x49')]({'where':{'id':_0x74826a[_0x1f1d('0x43')]['id']}})[_0x1f1d('0x23')](handleEntityNotFound(_0x41df28,null))[_0x1f1d('0x23')](function(_0x494ae7){if(_0x494ae7){_0x13f6df=_0x494ae7;_0x34f9ab[_0x1f1d('0x2e')]=_['keys'](db[_0x1f1d('0x4a')][_0x1f1d('0x2b')]);_0x34f9ab[_0x1f1d('0x30')]=_[_0x1f1d('0x2f')](_0x74826a['query']);_0x34f9ab['filters']=_[_0x1f1d('0x32')](_0x34f9ab[_0x1f1d('0x2e')],_0x34f9ab[_0x1f1d('0x30')]);_0x3cc750['attributes']=_[_0x1f1d('0x32')](_0x34f9ab[_0x1f1d('0x2e')],qs[_0x1f1d('0x34')](_0x74826a[_0x1f1d('0x30')]['fields']));_0x3cc750[_0x1f1d('0x33')]=_0x3cc750[_0x1f1d('0x33')][_0x1f1d('0x44')]?_0x3cc750['attributes']:_0x34f9ab[_0x1f1d('0x2e')];_0x3cc750['order']=qs['sort'](_0x74826a[_0x1f1d('0x30')][_0x1f1d('0x38')]);_0x3cc750[_0x1f1d('0x39')]=qs[_0x1f1d('0x31')](_['pick'](_0x74826a['query'],_0x34f9ab[_0x1f1d('0x31')]));if(_0x74826a[_0x1f1d('0x30')][_0x1f1d('0x3b')]){_0x3cc750[_0x1f1d('0x39')]=_['merge'](_0x3cc750[_0x1f1d('0x39')],{'$or':_[_0x1f1d('0x29')](_0x3cc750[_0x1f1d('0x33')],function(_0x45ba71){var _0x2b68fd={};_0x2b68fd[_0x45ba71]={'$like':'%'+_0x74826a['query']['filter']+'%'};return _0x2b68fd;})});}_0x3cc750=_['merge']({},_0x3cc750,_0x74826a[_0x1f1d('0x3e')]);return _0x13f6df[_0x1f1d('0x4b')](_0x3cc750);}})[_0x1f1d('0x23')](function(_0x271345){if(_0x271345){_0x50af87=_0x271345[_0x1f1d('0x44')];if(!_0x74826a['query']['hasOwnProperty'](_0x1f1d('0x36'))){_0x3cc750[_0x1f1d('0x1a')]=qs[_0x1f1d('0x1a')](_0x74826a['query']['limit']);_0x3cc750['offset']=qs['offset'](_0x74826a['query'][_0x1f1d('0x18')]);}return _0x13f6df[_0x1f1d('0x4b')](_0x3cc750);}})[_0x1f1d('0x23')](function(_0x34b5b2){if(_0x34b5b2){return _0x34b5b2?{'count':_0x50af87,'rows':_0x34b5b2}:null;}})[_0x1f1d('0x23')](respondWithResult(_0x41df28,null))['catch'](handleError(_0x41df28,null));};exports['getDescriptions']=function(_0x347964,_0x545a43,_0x1f4663){var _0x5abb8b={};var _0x4a2043={};var _0x8f3099;var _0x1f9d66;return db[_0x1f1d('0x2a')][_0x1f1d('0x49')]({'where':{'id':_0x347964[_0x1f1d('0x43')]['id']}})[_0x1f1d('0x23')](handleEntityNotFound(_0x545a43,null))[_0x1f1d('0x23')](function(_0x1e5a2e){if(_0x1e5a2e){_0x8f3099=_0x1e5a2e;_0x4a2043[_0x1f1d('0x2e')]=_['keys'](db[_0x1f1d('0x4a')][_0x1f1d('0x2b')]);_0x4a2043[_0x1f1d('0x30')]=_[_0x1f1d('0x2f')](_0x347964[_0x1f1d('0x30')]);_0x4a2043[_0x1f1d('0x31')]=_['intersection'](_0x4a2043[_0x1f1d('0x2e')],_0x4a2043[_0x1f1d('0x30')]);_0x5abb8b[_0x1f1d('0x33')]=_[_0x1f1d('0x32')](_0x4a2043[_0x1f1d('0x2e')],qs[_0x1f1d('0x34')](_0x347964[_0x1f1d('0x30')][_0x1f1d('0x34')]));_0x5abb8b['attributes']=_0x5abb8b[_0x1f1d('0x33')][_0x1f1d('0x44')]?_0x5abb8b[_0x1f1d('0x33')]:_0x4a2043['model'];_0x5abb8b[_0x1f1d('0x37')]=qs[_0x1f1d('0x38')](_0x347964['query'][_0x1f1d('0x38')]);_0x5abb8b[_0x1f1d('0x39')]=qs[_0x1f1d('0x31')](_[_0x1f1d('0x3a')](_0x347964[_0x1f1d('0x30')],_0x4a2043[_0x1f1d('0x31')]));if(_0x347964[_0x1f1d('0x30')][_0x1f1d('0x3b')]){_0x5abb8b['where']=_[_0x1f1d('0x3d')](_0x5abb8b[_0x1f1d('0x39')],{'$or':_[_0x1f1d('0x29')](_0x5abb8b[_0x1f1d('0x33')],function(_0x3f6978){var _0x3925a1={};_0x3925a1[_0x3f6978]={'$like':'%'+_0x347964[_0x1f1d('0x30')][_0x1f1d('0x3b')]+'%'};return _0x3925a1;})});}_0x5abb8b=_[_0x1f1d('0x3d')]({},_0x5abb8b,_0x347964[_0x1f1d('0x3e')]);return _0x8f3099[_0x1f1d('0x4c')](_0x5abb8b);}})[_0x1f1d('0x23')](function(_0x3dd1e5){if(_0x3dd1e5){_0x1f9d66=_0x3dd1e5[_0x1f1d('0x44')];if(!_0x347964[_0x1f1d('0x30')][_0x1f1d('0x35')](_0x1f1d('0x36'))){_0x5abb8b[_0x1f1d('0x1a')]=qs[_0x1f1d('0x1a')](_0x347964['query'][_0x1f1d('0x1a')]);_0x5abb8b['offset']=qs[_0x1f1d('0x18')](_0x347964[_0x1f1d('0x30')][_0x1f1d('0x18')]);}return _0x8f3099['getDescriptions'](_0x5abb8b);}})[_0x1f1d('0x23')](function(_0x5c507e){if(_0x5c507e){return _0x5c507e?{'count':_0x1f9d66,'rows':_0x5c507e}:null;}})[_0x1f1d('0x23')](respondWithResult(_0x545a43,null))[_0x1f1d('0x41')](handleError(_0x545a43,null));}; \ No newline at end of file +var _0x512a=['includeAll','include','findAll','rows','show','params','keys','options','create','body','catch','find','getFields','findOne','ServicenowField','hasOwnProperty','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge'];(function(_0x314397,_0x550526){var _0x1ec45e=function(_0x111722){while(--_0x111722){_0x314397['push'](_0x314397['shift']());}};_0x1ec45e(++_0x550526);}(_0x512a,0x10b));var _0xa512=function(_0x1bc906,_0x3adf03){_0x1bc906=_0x1bc906-0x0;var _0x1d1a81=_0x512a[_0x1bc906];return _0x1d1a81;};'use strict';var emlformat=require(_0xa512('0x0'));var rimraf=require(_0xa512('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa512('0x2'));var rp=require(_0xa512('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa512('0x4'));var util=require(_0xa512('0x5'));var path=require(_0xa512('0x6'));var sox=require(_0xa512('0x7'));var csv=require(_0xa512('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa512('0x9'));var _=require(_0xa512('0xa'));var squel=require('squel');var crypto=require(_0xa512('0xb'));var jsforce=require(_0xa512('0xc'));var deskjs=require(_0xa512('0xd'));var toCsv=require(_0xa512('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa512('0xe'));var authService=require(_0xa512('0xf'));var qs=require(_0xa512('0x10'));var as=require(_0xa512('0x11'));var hardwareService=require(_0xa512('0x12'));var logger=require(_0xa512('0x13'))(_0xa512('0x14'));var utils=require(_0xa512('0x15'));var config=require(_0xa512('0x16'));var licenseUtil=require(_0xa512('0x17'));var db=require(_0xa512('0x18'))['db'];function respondWithStatusCode(_0x4bef95,_0x51bfb5){_0x51bfb5=_0x51bfb5||0xcc;return function(_0x5c0cf1){if(_0x5c0cf1){return _0x4bef95[_0xa512('0x19')](_0x51bfb5);}return _0x4bef95[_0xa512('0x1a')](_0x51bfb5)['end']();};}function respondWithResult(_0x2b4822,_0x5e46fc){_0x5e46fc=_0x5e46fc||0xc8;return function(_0x205e2a){if(_0x205e2a){return _0x2b4822[_0xa512('0x1a')](_0x5e46fc)[_0xa512('0x1b')](_0x205e2a);}};}function respondWithFilteredResult(_0x49c25c,_0x4097e){return function(_0x3be3cf){if(_0x3be3cf){var _0x202b07=typeof _0x4097e[_0xa512('0x1c')]==='undefined'&&typeof _0x4097e['limit']===_0xa512('0x1d');var _0x14e43e=_0x3be3cf[_0xa512('0x1e')];var _0x5415b5=_0x202b07?0x0:_0x4097e[_0xa512('0x1c')];var _0x5dfc3a=_0x202b07?_0x3be3cf[_0xa512('0x1e')]:_0x4097e[_0xa512('0x1c')]+_0x4097e['limit'];var _0x30b737;if(_0x5dfc3a>=_0x14e43e){_0x5dfc3a=_0x14e43e;_0x30b737=0xc8;}else{_0x30b737=0xce;}_0x49c25c[_0xa512('0x1a')](_0x30b737);return _0x49c25c[_0xa512('0x1f')](_0xa512('0x20'),_0x5415b5+'-'+_0x5dfc3a+'/'+_0x14e43e)[_0xa512('0x1b')](_0x3be3cf);}return null;};}function patchUpdates(_0x5948e7){return function(_0x12c367){try{jsonpatch[_0xa512('0x21')](_0x12c367,_0x5948e7,!![]);}catch(_0x4164f7){return BPromise[_0xa512('0x22')](_0x4164f7);}return _0x12c367[_0xa512('0x23')]();};}function saveUpdates(_0x33ea4a,_0x50a8df){return function(_0x8b3c47){if(_0x8b3c47){return _0x8b3c47[_0xa512('0x24')](_0x33ea4a)[_0xa512('0x25')](function(_0x133486){return _0x133486;});}return null;};}function removeEntity(_0x22242c,_0x60fdff){return function(_0x5709a0){if(_0x5709a0){return _0x5709a0[_0xa512('0x26')]()[_0xa512('0x25')](function(){_0x22242c[_0xa512('0x1a')](0xcc)[_0xa512('0x27')]();});}};}function handleEntityNotFound(_0x1ecc76,_0x4bac81){return function(_0x5a27d4){if(!_0x5a27d4){_0x1ecc76['sendStatus'](0x194);}return _0x5a27d4;};}function handleError(_0x4eb19c,_0xdc5133){_0xdc5133=_0xdc5133||0x1f4;return function(_0x3d46c4){logger[_0xa512('0x28')](_0x3d46c4['stack']);if(_0x3d46c4[_0xa512('0x29')]){delete _0x3d46c4[_0xa512('0x29')];}_0x4eb19c[_0xa512('0x1a')](_0xdc5133)[_0xa512('0x2a')](_0x3d46c4);};}exports[_0xa512('0x2b')]=function(_0x54d3d5,_0x29ab43){var _0xad22a3={},_0x5ef7ca={},_0x12816c={'count':0x0,'rows':[]};var _0x1fda4c=_[_0xa512('0x2c')](db[_0xa512('0x2d')][_0xa512('0x2e')],function(_0x3a75a9){return{'name':_0x3a75a9[_0xa512('0x2f')],'type':_0x3a75a9[_0xa512('0x30')][_0xa512('0x31')]};});_0x5ef7ca[_0xa512('0x32')]=_[_0xa512('0x2c')](_0x1fda4c,_0xa512('0x29'));_0x5ef7ca[_0xa512('0x33')]=_['keys'](_0x54d3d5['query']);_0x5ef7ca[_0xa512('0x34')]=_[_0xa512('0x35')](_0x5ef7ca[_0xa512('0x32')],_0x5ef7ca['query']);_0xad22a3[_0xa512('0x36')]=_[_0xa512('0x35')](_0x5ef7ca[_0xa512('0x32')],qs[_0xa512('0x37')](_0x54d3d5[_0xa512('0x33')][_0xa512('0x37')]));_0xad22a3[_0xa512('0x36')]=_0xad22a3['attributes'][_0xa512('0x38')]?_0xad22a3[_0xa512('0x36')]:_0x5ef7ca[_0xa512('0x32')];if(!_0x54d3d5['query']['hasOwnProperty'](_0xa512('0x39'))){_0xad22a3[_0xa512('0x3a')]=qs[_0xa512('0x3a')](_0x54d3d5['query'][_0xa512('0x3a')]);_0xad22a3[_0xa512('0x1c')]=qs[_0xa512('0x1c')](_0x54d3d5[_0xa512('0x33')][_0xa512('0x1c')]);}_0xad22a3[_0xa512('0x3b')]=qs[_0xa512('0x3c')](_0x54d3d5[_0xa512('0x33')][_0xa512('0x3c')]);_0xad22a3[_0xa512('0x3d')]=qs['filters'](_[_0xa512('0x3e')](_0x54d3d5['query'],_0x5ef7ca['filters']),_0x1fda4c);if(_0x54d3d5[_0xa512('0x33')][_0xa512('0x3f')]){_0xad22a3[_0xa512('0x3d')]=_[_0xa512('0x40')](_0xad22a3[_0xa512('0x3d')],{'$or':_['map'](_0x1fda4c,function(_0x32456d){if(_0x32456d['type']!=='VIRTUAL'){var _0x14bcca={};_0x14bcca[_0x32456d[_0xa512('0x29')]]={'$like':'%'+_0x54d3d5[_0xa512('0x33')][_0xa512('0x3f')]+'%'};return _0x14bcca;}})});}_0xad22a3=_[_0xa512('0x40')]({},_0xad22a3,_0x54d3d5['options']);var _0x156740={'where':_0xad22a3[_0xa512('0x3d')]};return db[_0xa512('0x2d')]['count'](_0x156740)['then'](function(_0x2bf362){_0x12816c['count']=_0x2bf362;if(_0x54d3d5[_0xa512('0x33')][_0xa512('0x41')]){_0xad22a3[_0xa512('0x42')]=[{'all':!![]}];}return db[_0xa512('0x2d')][_0xa512('0x43')](_0xad22a3);})['then'](function(_0x18c593){_0x12816c[_0xa512('0x44')]=_0x18c593;return _0x12816c;})[_0xa512('0x25')](respondWithFilteredResult(_0x29ab43,_0xad22a3))['catch'](handleError(_0x29ab43,null));};exports[_0xa512('0x45')]=function(_0x5cce98,_0x37117b){var _0x39e690={'raw':![],'where':{'id':_0x5cce98[_0xa512('0x46')]['id']}},_0xbe60c6={};_0xbe60c6['model']=_[_0xa512('0x47')](db[_0xa512('0x2d')][_0xa512('0x2e')]);_0xbe60c6['query']=_[_0xa512('0x47')](_0x5cce98[_0xa512('0x33')]);_0xbe60c6[_0xa512('0x34')]=_[_0xa512('0x35')](_0xbe60c6[_0xa512('0x32')],_0xbe60c6[_0xa512('0x33')]);_0x39e690[_0xa512('0x36')]=_[_0xa512('0x35')](_0xbe60c6[_0xa512('0x32')],qs[_0xa512('0x37')](_0x5cce98['query'][_0xa512('0x37')]));_0x39e690[_0xa512('0x36')]=_0x39e690['attributes'][_0xa512('0x38')]?_0x39e690['attributes']:_0xbe60c6['model'];if(_0x5cce98[_0xa512('0x33')][_0xa512('0x41')]){_0x39e690[_0xa512('0x42')]=[{'all':!![]}];}_0x39e690=_[_0xa512('0x40')]({},_0x39e690,_0x5cce98[_0xa512('0x48')]);return db[_0xa512('0x2d')]['find'](_0x39e690)[_0xa512('0x25')](handleEntityNotFound(_0x37117b,null))[_0xa512('0x25')](respondWithResult(_0x37117b,null))['catch'](handleError(_0x37117b,null));};exports[_0xa512('0x49')]=function(_0x3c9632,_0x51c935){return db[_0xa512('0x2d')][_0xa512('0x49')](_0x3c9632[_0xa512('0x4a')],{})[_0xa512('0x25')](respondWithResult(_0x51c935,0xc9))[_0xa512('0x4b')](handleError(_0x51c935,null));};exports[_0xa512('0x24')]=function(_0x12fefa,_0x5442ce){if(_0x12fefa[_0xa512('0x4a')]['id']){delete _0x12fefa[_0xa512('0x4a')]['id'];}return db[_0xa512('0x2d')]['find']({'where':{'id':_0x12fefa[_0xa512('0x46')]['id']}})[_0xa512('0x25')](handleEntityNotFound(_0x5442ce,null))[_0xa512('0x25')](saveUpdates(_0x12fefa[_0xa512('0x4a')],null))[_0xa512('0x25')](respondWithResult(_0x5442ce,null))[_0xa512('0x4b')](handleError(_0x5442ce,null));};exports[_0xa512('0x26')]=function(_0xbebdad,_0x6598e1){return db['ServicenowConfiguration'][_0xa512('0x4c')]({'where':{'id':_0xbebdad[_0xa512('0x46')]['id']}})['then'](handleEntityNotFound(_0x6598e1,null))['then'](removeEntity(_0x6598e1,null))['catch'](handleError(_0x6598e1,null));};exports[_0xa512('0x4d')]=function(_0x12413c,_0x430879,_0x525573){var _0xb0b638={};var _0x411c66={};var _0x532a82;var _0x5331b7;return db[_0xa512('0x2d')][_0xa512('0x4e')]({'where':{'id':_0x12413c[_0xa512('0x46')]['id']}})['then'](handleEntityNotFound(_0x430879,null))[_0xa512('0x25')](function(_0x114e38){if(_0x114e38){_0x532a82=_0x114e38;_0x411c66[_0xa512('0x32')]=_[_0xa512('0x47')](db[_0xa512('0x4f')]['rawAttributes']);_0x411c66[_0xa512('0x33')]=_[_0xa512('0x47')](_0x12413c[_0xa512('0x33')]);_0x411c66[_0xa512('0x34')]=_[_0xa512('0x35')](_0x411c66[_0xa512('0x32')],_0x411c66[_0xa512('0x33')]);_0xb0b638[_0xa512('0x36')]=_[_0xa512('0x35')](_0x411c66[_0xa512('0x32')],qs[_0xa512('0x37')](_0x12413c[_0xa512('0x33')][_0xa512('0x37')]));_0xb0b638[_0xa512('0x36')]=_0xb0b638[_0xa512('0x36')][_0xa512('0x38')]?_0xb0b638[_0xa512('0x36')]:_0x411c66['model'];_0xb0b638['order']=qs[_0xa512('0x3c')](_0x12413c[_0xa512('0x33')][_0xa512('0x3c')]);_0xb0b638[_0xa512('0x3d')]=qs[_0xa512('0x34')](_[_0xa512('0x3e')](_0x12413c['query'],_0x411c66['filters']));if(_0x12413c['query'][_0xa512('0x3f')]){_0xb0b638['where']=_[_0xa512('0x40')](_0xb0b638[_0xa512('0x3d')],{'$or':_[_0xa512('0x2c')](_0xb0b638[_0xa512('0x36')],function(_0x87d856){var _0x52435b={};_0x52435b[_0x87d856]={'$like':'%'+_0x12413c[_0xa512('0x33')][_0xa512('0x3f')]+'%'};return _0x52435b;})});}_0xb0b638=_[_0xa512('0x40')]({},_0xb0b638,_0x12413c[_0xa512('0x48')]);return _0x532a82[_0xa512('0x4d')](_0xb0b638);}})['then'](function(_0x5602f1){if(_0x5602f1){_0x5331b7=_0x5602f1[_0xa512('0x38')];if(!_0x12413c[_0xa512('0x33')][_0xa512('0x50')](_0xa512('0x39'))){_0xb0b638[_0xa512('0x3a')]=qs[_0xa512('0x3a')](_0x12413c[_0xa512('0x33')][_0xa512('0x3a')]);_0xb0b638[_0xa512('0x1c')]=qs[_0xa512('0x1c')](_0x12413c[_0xa512('0x33')][_0xa512('0x1c')]);}return _0x532a82[_0xa512('0x4d')](_0xb0b638);}})['then'](function(_0x477908){if(_0x477908){return _0x477908?{'count':_0x5331b7,'rows':_0x477908}:null;}})[_0xa512('0x25')](respondWithResult(_0x430879,null))['catch'](handleError(_0x430879,null));};exports[_0xa512('0x51')]=function(_0x242d86,_0x10a5fa,_0x5b553e){var _0x2657b6={};var _0x3b2f72={};var _0x20d806;var _0x47193d;return db[_0xa512('0x2d')][_0xa512('0x4e')]({'where':{'id':_0x242d86[_0xa512('0x46')]['id']}})[_0xa512('0x25')](handleEntityNotFound(_0x10a5fa,null))['then'](function(_0x36399b){if(_0x36399b){_0x20d806=_0x36399b;_0x3b2f72[_0xa512('0x32')]=_[_0xa512('0x47')](db['ServicenowField'][_0xa512('0x2e')]);_0x3b2f72[_0xa512('0x33')]=_['keys'](_0x242d86[_0xa512('0x33')]);_0x3b2f72['filters']=_[_0xa512('0x35')](_0x3b2f72['model'],_0x3b2f72[_0xa512('0x33')]);_0x2657b6['attributes']=_[_0xa512('0x35')](_0x3b2f72[_0xa512('0x32')],qs[_0xa512('0x37')](_0x242d86[_0xa512('0x33')]['fields']));_0x2657b6[_0xa512('0x36')]=_0x2657b6[_0xa512('0x36')]['length']?_0x2657b6[_0xa512('0x36')]:_0x3b2f72[_0xa512('0x32')];_0x2657b6[_0xa512('0x3b')]=qs['sort'](_0x242d86[_0xa512('0x33')][_0xa512('0x3c')]);_0x2657b6[_0xa512('0x3d')]=qs['filters'](_['pick'](_0x242d86[_0xa512('0x33')],_0x3b2f72[_0xa512('0x34')]));if(_0x242d86[_0xa512('0x33')][_0xa512('0x3f')]){_0x2657b6['where']=_['merge'](_0x2657b6['where'],{'$or':_[_0xa512('0x2c')](_0x2657b6[_0xa512('0x36')],function(_0x578b94){var _0x52fdbd={};_0x52fdbd[_0x578b94]={'$like':'%'+_0x242d86[_0xa512('0x33')][_0xa512('0x3f')]+'%'};return _0x52fdbd;})});}_0x2657b6=_[_0xa512('0x40')]({},_0x2657b6,_0x242d86[_0xa512('0x48')]);return _0x20d806['getSubjects'](_0x2657b6);}})[_0xa512('0x25')](function(_0x398a42){if(_0x398a42){_0x47193d=_0x398a42[_0xa512('0x38')];if(!_0x242d86[_0xa512('0x33')][_0xa512('0x50')](_0xa512('0x39'))){_0x2657b6[_0xa512('0x3a')]=qs['limit'](_0x242d86[_0xa512('0x33')][_0xa512('0x3a')]);_0x2657b6[_0xa512('0x1c')]=qs[_0xa512('0x1c')](_0x242d86[_0xa512('0x33')][_0xa512('0x1c')]);}return _0x20d806[_0xa512('0x51')](_0x2657b6);}})[_0xa512('0x25')](function(_0x350a2){if(_0x350a2){return _0x350a2?{'count':_0x47193d,'rows':_0x350a2}:null;}})[_0xa512('0x25')](respondWithResult(_0x10a5fa,null))[_0xa512('0x4b')](handleError(_0x10a5fa,null));};exports[_0xa512('0x52')]=function(_0x44fc1a,_0x4b161e,_0x57e68f){var _0x20651c={};var _0x17ce51={};var _0x441a1;var _0x42acec;return db[_0xa512('0x2d')][_0xa512('0x4e')]({'where':{'id':_0x44fc1a[_0xa512('0x46')]['id']}})[_0xa512('0x25')](handleEntityNotFound(_0x4b161e,null))[_0xa512('0x25')](function(_0xf73889){if(_0xf73889){_0x441a1=_0xf73889;_0x17ce51[_0xa512('0x32')]=_['keys'](db[_0xa512('0x4f')]['rawAttributes']);_0x17ce51[_0xa512('0x33')]=_[_0xa512('0x47')](_0x44fc1a['query']);_0x17ce51[_0xa512('0x34')]=_['intersection'](_0x17ce51[_0xa512('0x32')],_0x17ce51[_0xa512('0x33')]);_0x20651c[_0xa512('0x36')]=_['intersection'](_0x17ce51[_0xa512('0x32')],qs[_0xa512('0x37')](_0x44fc1a['query'][_0xa512('0x37')]));_0x20651c['attributes']=_0x20651c[_0xa512('0x36')]['length']?_0x20651c[_0xa512('0x36')]:_0x17ce51[_0xa512('0x32')];_0x20651c['order']=qs['sort'](_0x44fc1a[_0xa512('0x33')][_0xa512('0x3c')]);_0x20651c[_0xa512('0x3d')]=qs[_0xa512('0x34')](_['pick'](_0x44fc1a['query'],_0x17ce51['filters']));if(_0x44fc1a[_0xa512('0x33')][_0xa512('0x3f')]){_0x20651c[_0xa512('0x3d')]=_['merge'](_0x20651c[_0xa512('0x3d')],{'$or':_[_0xa512('0x2c')](_0x20651c[_0xa512('0x36')],function(_0x27b948){var _0x2e0ca2={};_0x2e0ca2[_0x27b948]={'$like':'%'+_0x44fc1a[_0xa512('0x33')][_0xa512('0x3f')]+'%'};return _0x2e0ca2;})});}_0x20651c=_[_0xa512('0x40')]({},_0x20651c,_0x44fc1a[_0xa512('0x48')]);return _0x441a1['getDescriptions'](_0x20651c);}})[_0xa512('0x25')](function(_0x1c34b6){if(_0x1c34b6){_0x42acec=_0x1c34b6['length'];if(!_0x44fc1a['query'][_0xa512('0x50')](_0xa512('0x39'))){_0x20651c[_0xa512('0x3a')]=qs['limit'](_0x44fc1a[_0xa512('0x33')][_0xa512('0x3a')]);_0x20651c[_0xa512('0x1c')]=qs['offset'](_0x44fc1a['query'][_0xa512('0x1c')]);}return _0x441a1[_0xa512('0x52')](_0x20651c);}})[_0xa512('0x25')](function(_0x5d064c){if(_0x5d064c){return _0x5d064c?{'count':_0x42acec,'rows':_0x5d064c}:null;}})[_0xa512('0x25')](respondWithResult(_0x4b161e,null))[_0xa512('0x4b')](handleError(_0x4b161e,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 86d7623..8054532 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 _0xbc4a=['lodash','util','../../config/logger','rimraf','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc4a,0x1dd));var _0xabc4=function(_0xefca7c,_0x2807a8){_0xefca7c=_0xefca7c-0x0;var _0x1baca6=_0xbc4a[_0xefca7c];return _0x1baca6;};'use strict';var _=require(_0xabc4('0x0'));var util=require(_0xabc4('0x1'));var logger=require(_0xabc4('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xabc4('0x3'));var config=require('../../config/environment');var attributes=require(_0xabc4('0x4'));module[_0xabc4('0x5')]=function(_0x282a1e,_0x422903){return _0x282a1e[_0xabc4('0x6')](_0xabc4('0x7'),attributes,{'tableName':_0xabc4('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24e9=['ServicenowConfiguration','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x18f224,_0x380b67){var _0x193ab9=function(_0x3a59c1){while(--_0x3a59c1){_0x18f224['push'](_0x18f224['shift']());}};_0x193ab9(++_0x380b67);}(_0x24e9,0x85));var _0x924e=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x24e9[_0x335271];return _0xa9fff8;};'use strict';var _=require(_0x924e('0x0'));var util=require('util');var logger=require(_0x924e('0x1'))(_0x924e('0x2'));var moment=require(_0x924e('0x3'));var BPromise=require(_0x924e('0x4'));var rp=require(_0x924e('0x5'));var fs=require('fs');var path=require(_0x924e('0x6'));var rimraf=require(_0x924e('0x7'));var config=require(_0x924e('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x924e('0x9')]=function(_0x31f0c3,_0x13accc){return _0x31f0c3[_0x924e('0xa')](_0x924e('0xb'),attributes,{'tableName':'int_servicenow_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.rpc.js index c0a0381..ee81693 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 _0x91ac=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x135365,_0x5ce7bf){var _0x3cdc77=function(_0x589ebe){while(--_0x589ebe){_0x135365['push'](_0x135365['shift']());}};_0x3cdc77(++_0x5ce7bf);}(_0x91ac,0x17c));var _0xc91a=function(_0x373ab4,_0x21a751){_0x373ab4=_0x373ab4-0x0;var _0x4c5b53=_0x91ac[_0x373ab4];return _0x4c5b53;};'use strict';var _=require(_0xc91a('0x0'));var util=require(_0xc91a('0x1'));var moment=require(_0xc91a('0x2'));var BPromise=require(_0xc91a('0x3'));var rs=require(_0xc91a('0x4'));var fs=require('fs');var Redis=require(_0xc91a('0x5'));var db=require(_0xc91a('0x6'))['db'];var utils=require(_0xc91a('0x7'));var logger=require(_0xc91a('0x8'))(_0xc91a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xc91a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5b6443,_0x26e4c3,_0x234524){return new BPromise(function(_0x54308f,_0x112d99){return client['request'](_0x5b6443,_0x234524)[_0xc91a('0xb')](function(_0x34add0){logger[_0xc91a('0xc')](_0xc91a('0xd'),_0x26e4c3,_0xc91a('0xe'));logger[_0xc91a('0xf')](_0xc91a('0x10'),_0x26e4c3,_0xc91a('0xe'),JSON['stringify'](_0x34add0));if(_0x34add0[_0xc91a('0x11')]){if(_0x34add0['error']['code']===0x1f4){logger[_0xc91a('0x11')]('ServicenowConfiguration,\x20%s,\x20%s',_0x26e4c3,_0x34add0[_0xc91a('0x11')][_0xc91a('0x12')]);return _0x112d99(_0x34add0['error'][_0xc91a('0x12')]);}logger['error'](_0xc91a('0xd'),_0x26e4c3,_0x34add0['error'][_0xc91a('0x12')]);return _0x54308f(_0x34add0[_0xc91a('0x11')][_0xc91a('0x12')]);}else{logger['info'](_0xc91a('0xd'),_0x26e4c3,_0xc91a('0xe'));_0x54308f(_0x34add0['result'][_0xc91a('0x12')]);}})[_0xc91a('0x13')](function(_0x5153f2){logger[_0xc91a('0x11')](_0xc91a('0xd'),_0x26e4c3,_0x5153f2);_0x112d99(_0x5153f2);});});} \ No newline at end of file +var _0x18af=['moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x36909d,_0x2795f1){var _0x1fd29d=function(_0x27d0fa){while(--_0x27d0fa){_0x36909d['push'](_0x36909d['shift']());}};_0x1fd29d(++_0x2795f1);}(_0x18af,0x8b));var _0xf18a=function(_0x4bb8b5,_0x24784a){_0x4bb8b5=_0x4bb8b5-0x0;var _0x191af7=_0x18af[_0x4bb8b5];return _0x191af7;};'use strict';var _=require(_0xf18a('0x0'));var util=require('util');var moment=require(_0xf18a('0x1'));var BPromise=require('bluebird');var rs=require(_0xf18a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf18a('0x3'))(_0xf18a('0x4'));var config=require(_0xf18a('0x5'));var jayson=require(_0xf18a('0x6'));var client=jayson['client'][_0xf18a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2d5955,_0x3fc64b,_0x4dc297){return new BPromise(function(_0x42176e,_0x22c181){return client[_0xf18a('0x8')](_0x2d5955,_0x4dc297)[_0xf18a('0x9')](function(_0x30b135){logger[_0xf18a('0xa')](_0xf18a('0xb'),_0x3fc64b,_0xf18a('0xc'));logger[_0xf18a('0xd')](_0xf18a('0xe'),_0x3fc64b,_0xf18a('0xc'),JSON[_0xf18a('0xf')](_0x30b135));if(_0x30b135[_0xf18a('0x10')]){if(_0x30b135['error'][_0xf18a('0x11')]===0x1f4){logger[_0xf18a('0x10')](_0xf18a('0xb'),_0x3fc64b,_0x30b135[_0xf18a('0x10')][_0xf18a('0x12')]);return _0x22c181(_0x30b135['error'][_0xf18a('0x12')]);}logger[_0xf18a('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x3fc64b,_0x30b135[_0xf18a('0x10')]['message']);return _0x42176e(_0x30b135[_0xf18a('0x10')][_0xf18a('0x12')]);}else{logger['info'](_0xf18a('0xb'),_0x3fc64b,'request\x20sent');_0x42176e(_0x30b135[_0xf18a('0x13')][_0xf18a('0x12')]);}})['catch'](function(_0x526bb7){logger[_0xf18a('0x10')](_0xf18a('0xb'),_0x3fc64b,_0x526bb7);_0x22c181(_0x526bb7);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index f16773a..6cb3478 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 _0xd833=['fs-extra','../../components/auth/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','express'];(function(_0x5d5b69,_0x1111ab){var _0xf82413=function(_0x3a1f48){while(--_0x3a1f48){_0x5d5b69['push'](_0x5d5b69['shift']());}};_0xf82413(++_0x1111ab);}(_0xd833,0x95));var _0x3d83=function(_0x300522,_0x4562b4){_0x300522=_0x300522-0x0;var _0x536ff5=_0xd833[_0x300522];return _0x536ff5;};'use strict';var multer=require(_0x3d83('0x0'));var util=require('util');var path=require(_0x3d83('0x1'));var timeout=require('connect-timeout');var express=require(_0x3d83('0x2'));var router=express['Router']();var fs_extra=require(_0x3d83('0x3'));var auth=require(_0x3d83('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3d83('0x5'));var controller=require(_0x3d83('0x6'));router[_0x3d83('0x7')]('/',auth[_0x3d83('0x8')](),controller[_0x3d83('0x9')]);router[_0x3d83('0x7')](_0x3d83('0xa'),auth[_0x3d83('0x8')](),controller[_0x3d83('0xb')]);router[_0x3d83('0xc')]('/',auth[_0x3d83('0x8')](),controller[_0x3d83('0xd')]);router[_0x3d83('0xe')]('/:id',auth[_0x3d83('0x8')](),controller[_0x3d83('0xf')]);router[_0x3d83('0x10')]('/:id',auth[_0x3d83('0x8')](),controller[_0x3d83('0x11')]);module[_0x3d83('0x12')]=router; \ No newline at end of file +var _0x6bf6=['path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','show','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6bf6,0xe8));var _0x66bf=function(_0x1c1509,_0x2dfa81){_0x1c1509=_0x1c1509-0x0;var _0xf11b7=_0x6bf6[_0x1c1509];return _0xf11b7;};'use strict';var multer=require(_0x66bf('0x0'));var util=require(_0x66bf('0x1'));var path=require(_0x66bf('0x2'));var timeout=require(_0x66bf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x66bf('0x4'));var interaction=require(_0x66bf('0x5'));var config=require(_0x66bf('0x6'));var controller=require(_0x66bf('0x7'));router[_0x66bf('0x8')]('/',auth[_0x66bf('0x9')](),controller['index']);router[_0x66bf('0x8')]('/:id',auth[_0x66bf('0x9')](),controller[_0x66bf('0xa')]);router[_0x66bf('0xb')]('/',auth[_0x66bf('0x9')](),controller['create']);router[_0x66bf('0xc')](_0x66bf('0xd'),auth[_0x66bf('0x9')](),controller[_0x66bf('0xe')]);router[_0x66bf('0xf')]('/:id',auth[_0x66bf('0x9')](),controller[_0x66bf('0x10')]);module[_0x66bf('0x11')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 8b33b73..b68f72d 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 _0xfb9f=['picklist','STRING','BOOLEAN','sequelize','exports','ENUM','variable','customVariable','keyValue'];(function(_0x5d0e5c,_0x1eb95f){var _0x2c4bd4=function(_0x5528dd){while(--_0x5528dd){_0x5d0e5c['push'](_0x5d0e5c['shift']());}};_0x2c4bd4(++_0x1eb95f);}(_0xfb9f,0x198));var _0xffb9=function(_0x17a03d,_0x4e398f){_0x17a03d=_0x17a03d-0x0;var _0x401c3d=_0xfb9f[_0x17a03d];return _0x401c3d;};'use strict';var Sequelize=require(_0xffb9('0x0'));module[_0xffb9('0x1')]={'type':{'type':Sequelize[_0xffb9('0x2')]('string',_0xffb9('0x3'),_0xffb9('0x4'),_0xffb9('0x5'),_0xffb9('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xffb9('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM']('string','variable',_0xffb9('0x4'))},'keyContent':{'type':Sequelize[_0xffb9('0x7')]},'idField':{'type':Sequelize[_0xffb9('0x7')]},'nameField':{'type':Sequelize[_0xffb9('0x7')]},'customField':{'type':Sequelize[_0xffb9('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xffb9('0x7')]}}; \ No newline at end of file +var _0x44ae=['STRING','BOOLEAN','exports','ENUM','string','variable','keyValue','picklist'];(function(_0xcd4d8e,_0x1fc2fd){var _0x1c3c61=function(_0x293f3c){while(--_0x293f3c){_0xcd4d8e['push'](_0xcd4d8e['shift']());}};_0x1c3c61(++_0x1fc2fd);}(_0x44ae,0xe2));var _0xe44a=function(_0x31ddea,_0x40de6d){_0x31ddea=_0x31ddea-0x0;var _0x12539b=_0x44ae[_0x31ddea];return _0x12539b;};'use strict';var Sequelize=require('sequelize');module[_0xe44a('0x0')]={'type':{'type':Sequelize[_0xe44a('0x1')](_0xe44a('0x2'),_0xe44a('0x3'),'customVariable',_0xe44a('0x4'),_0xe44a('0x5')),'defaultValue':_0xe44a('0x2')},'content':{'type':Sequelize[_0xe44a('0x6')]},'key':{'type':Sequelize[_0xe44a('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xe44a('0x2'),_0xe44a('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xe44a('0x6')]},'idField':{'type':Sequelize[_0xe44a('0x6')]},'nameField':{'type':Sequelize[_0xe44a('0x6')]},'customField':{'type':Sequelize[_0xe44a('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xe44a('0x6')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index cd0b76f..21ea972 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 _0x952b=['send','index','ServicenowField','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','stack','name'];(function(_0x31c062,_0x4c1983){var _0x276edd=function(_0x4fcd39){while(--_0x4fcd39){_0x31c062['push'](_0x31c062['shift']());}};_0x276edd(++_0x4c1983);}(_0x952b,0x10a));var _0xb952=function(_0x524bb9,_0x2b28b3){_0x524bb9=_0x524bb9-0x0;var _0x3d20ed=_0x952b[_0x524bb9];return _0x3d20ed;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb952('0x0'));var jsonpatch=require(_0xb952('0x1'));var rp=require(_0xb952('0x2'));var moment=require(_0xb952('0x3'));var BPromise=require(_0xb952('0x4'));var Mustache=require(_0xb952('0x5'));var util=require(_0xb952('0x6'));var path=require(_0xb952('0x7'));var sox=require(_0xb952('0x8'));var csv=require(_0xb952('0x9'));var ejs=require(_0xb952('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb952('0xb'));var squel=require(_0xb952('0xc'));var crypto=require(_0xb952('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb952('0x9'));var querystring=require(_0xb952('0xe'));var Papa=require(_0xb952('0xf'));var Redis=require(_0xb952('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb952('0x11'));var as=require(_0xb952('0x12'));var hardwareService=require(_0xb952('0x13'));var logger=require(_0xb952('0x14'))('api');var utils=require(_0xb952('0x15'));var config=require(_0xb952('0x16'));var licenseUtil=require(_0xb952('0x17'));var db=require(_0xb952('0x18'))['db'];function respondWithStatusCode(_0x1089b4,_0x32bcd6){_0x32bcd6=_0x32bcd6||0xcc;return function(_0x1baafa){if(_0x1baafa){return _0x1089b4[_0xb952('0x19')](_0x32bcd6);}return _0x1089b4[_0xb952('0x1a')](_0x32bcd6)[_0xb952('0x1b')]();};}function respondWithResult(_0x220869,_0x3ae0b6){_0x3ae0b6=_0x3ae0b6||0xc8;return function(_0x1a62df){if(_0x1a62df){return _0x220869[_0xb952('0x1a')](_0x3ae0b6)[_0xb952('0x1c')](_0x1a62df);}};}function respondWithFilteredResult(_0x50f593,_0x556b1f){return function(_0x8c3916){if(_0x8c3916){var _0x25d28c=typeof _0x556b1f[_0xb952('0x1d')]===_0xb952('0x1e')&&typeof _0x556b1f[_0xb952('0x1f')]===_0xb952('0x1e');var _0x3c85e2=_0x8c3916[_0xb952('0x20')];var _0x30d477=_0x25d28c?0x0:_0x556b1f[_0xb952('0x1d')];var _0x345b46=_0x25d28c?_0x8c3916[_0xb952('0x20')]:_0x556b1f[_0xb952('0x1d')]+_0x556b1f[_0xb952('0x1f')];var _0x270729;if(_0x345b46>=_0x3c85e2){_0x345b46=_0x3c85e2;_0x270729=0xc8;}else{_0x270729=0xce;}_0x50f593[_0xb952('0x1a')](_0x270729);return _0x50f593[_0xb952('0x21')](_0xb952('0x22'),_0x30d477+'-'+_0x345b46+'/'+_0x3c85e2)[_0xb952('0x1c')](_0x8c3916);}return null;};}function patchUpdates(_0x1319e4){return function(_0x20d409){try{jsonpatch[_0xb952('0x23')](_0x20d409,_0x1319e4,!![]);}catch(_0x328c81){return BPromise[_0xb952('0x24')](_0x328c81);}return _0x20d409['save']();};}function saveUpdates(_0xcc8b29,_0x5446d0){return function(_0x2f760b){if(_0x2f760b){return _0x2f760b[_0xb952('0x25')](_0xcc8b29)[_0xb952('0x26')](function(_0x3fd3b5){return _0x3fd3b5;});}return null;};}function removeEntity(_0x5d6711,_0x40722c){return function(_0x4d5345){if(_0x4d5345){return _0x4d5345[_0xb952('0x27')]()[_0xb952('0x26')](function(){_0x5d6711[_0xb952('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f6ebb,_0x45a386){return function(_0x22b755){if(!_0x22b755){_0x2f6ebb['sendStatus'](0x194);}return _0x22b755;};}function handleError(_0x3d572e,_0x5370bc){_0x5370bc=_0x5370bc||0x1f4;return function(_0x5ac480){logger['error'](_0x5ac480[_0xb952('0x28')]);if(_0x5ac480['name']){delete _0x5ac480[_0xb952('0x29')];}_0x3d572e[_0xb952('0x1a')](_0x5370bc)[_0xb952('0x2a')](_0x5ac480);};}exports[_0xb952('0x2b')]=function(_0x34c6d7,_0x26fa0e){var _0x27c8be={},_0xf15e11={},_0x341c6d={'count':0x0,'rows':[]};var _0x1d09ff=_['map'](db[_0xb952('0x2c')][_0xb952('0x2d')],function(_0x37053d){return{'name':_0x37053d[_0xb952('0x2e')],'type':_0x37053d['type'][_0xb952('0x2f')]};});_0xf15e11[_0xb952('0x30')]=_['map'](_0x1d09ff,'name');_0xf15e11['query']=_[_0xb952('0x31')](_0x34c6d7[_0xb952('0x32')]);_0xf15e11[_0xb952('0x33')]=_[_0xb952('0x34')](_0xf15e11[_0xb952('0x30')],_0xf15e11[_0xb952('0x32')]);_0x27c8be['attributes']=_['intersection'](_0xf15e11[_0xb952('0x30')],qs[_0xb952('0x35')](_0x34c6d7[_0xb952('0x32')][_0xb952('0x35')]));_0x27c8be[_0xb952('0x36')]=_0x27c8be[_0xb952('0x36')][_0xb952('0x37')]?_0x27c8be[_0xb952('0x36')]:_0xf15e11[_0xb952('0x30')];if(!_0x34c6d7[_0xb952('0x32')][_0xb952('0x38')]('nolimit')){_0x27c8be[_0xb952('0x1f')]=qs[_0xb952('0x1f')](_0x34c6d7[_0xb952('0x32')][_0xb952('0x1f')]);_0x27c8be[_0xb952('0x1d')]=qs[_0xb952('0x1d')](_0x34c6d7[_0xb952('0x32')]['offset']);}_0x27c8be[_0xb952('0x39')]=qs[_0xb952('0x3a')](_0x34c6d7['query']['sort']);_0x27c8be[_0xb952('0x3b')]=qs[_0xb952('0x33')](_[_0xb952('0x3c')](_0x34c6d7[_0xb952('0x32')],_0xf15e11['filters']),_0x1d09ff);if(_0x34c6d7[_0xb952('0x32')]['filter']){_0x27c8be[_0xb952('0x3b')]=_[_0xb952('0x3d')](_0x27c8be[_0xb952('0x3b')],{'$or':_[_0xb952('0x3e')](_0x1d09ff,function(_0x1e5d26){if(_0x1e5d26[_0xb952('0x3f')]!==_0xb952('0x40')){var _0x5497b5={};_0x5497b5[_0x1e5d26[_0xb952('0x29')]]={'$like':'%'+_0x34c6d7[_0xb952('0x32')][_0xb952('0x41')]+'%'};return _0x5497b5;}})});}_0x27c8be=_[_0xb952('0x3d')]({},_0x27c8be,_0x34c6d7[_0xb952('0x42')]);var _0x35d768={'where':_0x27c8be[_0xb952('0x3b')]};return db[_0xb952('0x2c')][_0xb952('0x20')](_0x35d768)[_0xb952('0x26')](function(_0x5500d4){_0x341c6d[_0xb952('0x20')]=_0x5500d4;if(_0x34c6d7['query'][_0xb952('0x43')]){_0x27c8be[_0xb952('0x44')]=[{'all':!![]}];}return db['ServicenowField'][_0xb952('0x45')](_0x27c8be);})[_0xb952('0x26')](function(_0x5dc996){_0x341c6d[_0xb952('0x46')]=_0x5dc996;return _0x341c6d;})[_0xb952('0x26')](respondWithFilteredResult(_0x26fa0e,_0x27c8be))[_0xb952('0x47')](handleError(_0x26fa0e,null));};exports[_0xb952('0x48')]=function(_0x448566,_0x2a8969){var _0x484c58={'raw':!![],'where':{'id':_0x448566[_0xb952('0x49')]['id']}},_0x512641={};_0x512641[_0xb952('0x30')]=_['keys'](db[_0xb952('0x2c')][_0xb952('0x2d')]);_0x512641['query']=_['keys'](_0x448566['query']);_0x512641['filters']=_[_0xb952('0x34')](_0x512641['model'],_0x512641['query']);_0x484c58[_0xb952('0x36')]=_[_0xb952('0x34')](_0x512641[_0xb952('0x30')],qs[_0xb952('0x35')](_0x448566['query'][_0xb952('0x35')]));_0x484c58[_0xb952('0x36')]=_0x484c58['attributes'][_0xb952('0x37')]?_0x484c58['attributes']:_0x512641[_0xb952('0x30')];if(_0x448566['query'][_0xb952('0x43')]){_0x484c58[_0xb952('0x44')]=[{'all':!![]}];}_0x484c58=_[_0xb952('0x3d')]({},_0x484c58,_0x448566[_0xb952('0x42')]);return db[_0xb952('0x2c')]['find'](_0x484c58)['then'](handleEntityNotFound(_0x2a8969,null))[_0xb952('0x26')](respondWithResult(_0x2a8969,null))[_0xb952('0x47')](handleError(_0x2a8969,null));};exports['create']=function(_0x5452cf,_0x32651e){return db[_0xb952('0x2c')][_0xb952('0x4a')](_0x5452cf[_0xb952('0x4b')],{})[_0xb952('0x26')](respondWithResult(_0x32651e,0xc9))[_0xb952('0x47')](handleError(_0x32651e,null));};exports[_0xb952('0x25')]=function(_0x10b87e,_0x1b04d9){if(_0x10b87e[_0xb952('0x4b')]['id']){delete _0x10b87e['body']['id'];}return db[_0xb952('0x2c')][_0xb952('0x4c')]({'where':{'id':_0x10b87e[_0xb952('0x49')]['id']}})[_0xb952('0x26')](handleEntityNotFound(_0x1b04d9,null))['then'](saveUpdates(_0x10b87e['body'],null))['then'](respondWithResult(_0x1b04d9,null))[_0xb952('0x47')](handleError(_0x1b04d9,null));};exports[_0xb952('0x27')]=function(_0x432da8,_0x47d4fa){return db['ServicenowField'][_0xb952('0x4c')]({'where':{'id':_0x432da8[_0xb952('0x49')]['id']}})[_0xb952('0x26')](handleEntityNotFound(_0x47d4fa,null))['then'](removeEntity(_0x47d4fa,null))[_0xb952('0x47')](handleError(_0x47d4fa,null));}; \ No newline at end of file +var _0x282c=['send','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','ServicenowField','includeAll','include','findAll','catch','show','params','find','create','body','update','destroy','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','then','stack','name'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x282c,0xae));var _0xc282=function(_0x5464e0,_0x3c4742){_0x5464e0=_0x5464e0-0x0;var _0x5be420=_0x282c[_0x5464e0];return _0x5be420;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc282('0x0'));var zipdir=require(_0xc282('0x1'));var jsonpatch=require(_0xc282('0x2'));var rp=require(_0xc282('0x3'));var moment=require(_0xc282('0x4'));var BPromise=require(_0xc282('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc282('0x6'));var ejs=require(_0xc282('0x7'));var fs=require('fs');var fs_extra=require(_0xc282('0x8'));var _=require(_0xc282('0x9'));var squel=require(_0xc282('0xa'));var crypto=require('crypto');var jsforce=require(_0xc282('0xb'));var deskjs=require(_0xc282('0xc'));var toCsv=require(_0xc282('0x6'));var querystring=require(_0xc282('0xd'));var Papa=require(_0xc282('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc282('0xf'));var as=require(_0xc282('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc282('0x11'))(_0xc282('0x12'));var utils=require(_0xc282('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xc282('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55f202,_0x4a79c6){_0x4a79c6=_0x4a79c6||0xcc;return function(_0x2703a7){if(_0x2703a7){return _0x55f202[_0xc282('0x15')](_0x4a79c6);}return _0x55f202[_0xc282('0x16')](_0x4a79c6)[_0xc282('0x17')]();};}function respondWithResult(_0x1b2e02,_0x105393){_0x105393=_0x105393||0xc8;return function(_0x7cf9ea){if(_0x7cf9ea){return _0x1b2e02[_0xc282('0x16')](_0x105393)[_0xc282('0x18')](_0x7cf9ea);}};}function respondWithFilteredResult(_0xa8258c,_0x3493a4){return function(_0x493bb8){if(_0x493bb8){var _0x4f7b6a=typeof _0x3493a4[_0xc282('0x19')]==='undefined'&&typeof _0x3493a4[_0xc282('0x1a')]===_0xc282('0x1b');var _0x24eaf8=_0x493bb8[_0xc282('0x1c')];var _0x10857b=_0x4f7b6a?0x0:_0x3493a4['offset'];var _0x387e1c=_0x4f7b6a?_0x493bb8['count']:_0x3493a4[_0xc282('0x19')]+_0x3493a4[_0xc282('0x1a')];var _0x1f50c7;if(_0x387e1c>=_0x24eaf8){_0x387e1c=_0x24eaf8;_0x1f50c7=0xc8;}else{_0x1f50c7=0xce;}_0xa8258c[_0xc282('0x16')](_0x1f50c7);return _0xa8258c['set'](_0xc282('0x1d'),_0x10857b+'-'+_0x387e1c+'/'+_0x24eaf8)[_0xc282('0x18')](_0x493bb8);}return null;};}function patchUpdates(_0x8d5a84){return function(_0x3dc6b7){try{jsonpatch[_0xc282('0x1e')](_0x3dc6b7,_0x8d5a84,!![]);}catch(_0x5cff38){return BPromise[_0xc282('0x1f')](_0x5cff38);}return _0x3dc6b7[_0xc282('0x20')]();};}function saveUpdates(_0x779e64,_0x275539){return function(_0x237351){if(_0x237351){return _0x237351['update'](_0x779e64)[_0xc282('0x21')](function(_0x39ab00){return _0x39ab00;});}return null;};}function removeEntity(_0x21b00f,_0x4a4424){return function(_0x3e2955){if(_0x3e2955){return _0x3e2955['destroy']()['then'](function(){_0x21b00f[_0xc282('0x16')](0xcc)[_0xc282('0x17')]();});}};}function handleEntityNotFound(_0x1316d3,_0x1d12e4){return function(_0x4ae673){if(!_0x4ae673){_0x1316d3[_0xc282('0x15')](0x194);}return _0x4ae673;};}function handleError(_0x4f40fb,_0x5173de){_0x5173de=_0x5173de||0x1f4;return function(_0x5444cf){logger['error'](_0x5444cf[_0xc282('0x22')]);if(_0x5444cf[_0xc282('0x23')]){delete _0x5444cf['name'];}_0x4f40fb[_0xc282('0x16')](_0x5173de)[_0xc282('0x24')](_0x5444cf);};}exports['index']=function(_0x946ffd,_0x4674e1){var _0x597d08={},_0x4ba847={},_0x19b12f={'count':0x0,'rows':[]};var _0x1ab884=_[_0xc282('0x25')](db['ServicenowField'][_0xc282('0x26')],function(_0x5d0aa2){return{'name':_0x5d0aa2[_0xc282('0x27')],'type':_0x5d0aa2[_0xc282('0x28')]['key']};});_0x4ba847[_0xc282('0x29')]=_['map'](_0x1ab884,'name');_0x4ba847['query']=_[_0xc282('0x2a')](_0x946ffd['query']);_0x4ba847[_0xc282('0x2b')]=_[_0xc282('0x2c')](_0x4ba847[_0xc282('0x29')],_0x4ba847[_0xc282('0x2d')]);_0x597d08[_0xc282('0x2e')]=_[_0xc282('0x2c')](_0x4ba847[_0xc282('0x29')],qs['fields'](_0x946ffd[_0xc282('0x2d')][_0xc282('0x2f')]));_0x597d08[_0xc282('0x2e')]=_0x597d08[_0xc282('0x2e')][_0xc282('0x30')]?_0x597d08['attributes']:_0x4ba847[_0xc282('0x29')];if(!_0x946ffd[_0xc282('0x2d')][_0xc282('0x31')]('nolimit')){_0x597d08[_0xc282('0x1a')]=qs[_0xc282('0x1a')](_0x946ffd[_0xc282('0x2d')][_0xc282('0x1a')]);_0x597d08[_0xc282('0x19')]=qs[_0xc282('0x19')](_0x946ffd[_0xc282('0x2d')][_0xc282('0x19')]);}_0x597d08[_0xc282('0x32')]=qs[_0xc282('0x33')](_0x946ffd[_0xc282('0x2d')][_0xc282('0x33')]);_0x597d08[_0xc282('0x34')]=qs[_0xc282('0x2b')](_[_0xc282('0x35')](_0x946ffd['query'],_0x4ba847[_0xc282('0x2b')]),_0x1ab884);if(_0x946ffd[_0xc282('0x2d')][_0xc282('0x36')]){_0x597d08[_0xc282('0x34')]=_['merge'](_0x597d08[_0xc282('0x34')],{'$or':_['map'](_0x1ab884,function(_0x43ba88){if(_0x43ba88[_0xc282('0x28')]!==_0xc282('0x37')){var _0x3eb55f={};_0x3eb55f[_0x43ba88[_0xc282('0x23')]]={'$like':'%'+_0x946ffd[_0xc282('0x2d')]['filter']+'%'};return _0x3eb55f;}})});}_0x597d08=_[_0xc282('0x38')]({},_0x597d08,_0x946ffd[_0xc282('0x39')]);var _0x37d598={'where':_0x597d08['where']};return db[_0xc282('0x3a')]['count'](_0x37d598)['then'](function(_0x3dd19b){_0x19b12f[_0xc282('0x1c')]=_0x3dd19b;if(_0x946ffd[_0xc282('0x2d')][_0xc282('0x3b')]){_0x597d08[_0xc282('0x3c')]=[{'all':!![]}];}return db[_0xc282('0x3a')][_0xc282('0x3d')](_0x597d08);})[_0xc282('0x21')](function(_0x214fff){_0x19b12f['rows']=_0x214fff;return _0x19b12f;})[_0xc282('0x21')](respondWithFilteredResult(_0x4674e1,_0x597d08))[_0xc282('0x3e')](handleError(_0x4674e1,null));};exports[_0xc282('0x3f')]=function(_0x5bed4c,_0x4b6e9a){var _0x395328={'raw':!![],'where':{'id':_0x5bed4c[_0xc282('0x40')]['id']}},_0xd8ee9={};_0xd8ee9['model']=_['keys'](db[_0xc282('0x3a')][_0xc282('0x26')]);_0xd8ee9[_0xc282('0x2d')]=_[_0xc282('0x2a')](_0x5bed4c[_0xc282('0x2d')]);_0xd8ee9[_0xc282('0x2b')]=_[_0xc282('0x2c')](_0xd8ee9[_0xc282('0x29')],_0xd8ee9[_0xc282('0x2d')]);_0x395328[_0xc282('0x2e')]=_[_0xc282('0x2c')](_0xd8ee9[_0xc282('0x29')],qs[_0xc282('0x2f')](_0x5bed4c[_0xc282('0x2d')][_0xc282('0x2f')]));_0x395328[_0xc282('0x2e')]=_0x395328['attributes'][_0xc282('0x30')]?_0x395328[_0xc282('0x2e')]:_0xd8ee9[_0xc282('0x29')];if(_0x5bed4c['query']['includeAll']){_0x395328[_0xc282('0x3c')]=[{'all':!![]}];}_0x395328=_[_0xc282('0x38')]({},_0x395328,_0x5bed4c['options']);return db[_0xc282('0x3a')][_0xc282('0x41')](_0x395328)[_0xc282('0x21')](handleEntityNotFound(_0x4b6e9a,null))['then'](respondWithResult(_0x4b6e9a,null))[_0xc282('0x3e')](handleError(_0x4b6e9a,null));};exports[_0xc282('0x42')]=function(_0x53fdab,_0x52851f){return db[_0xc282('0x3a')][_0xc282('0x42')](_0x53fdab[_0xc282('0x43')],{})['then'](respondWithResult(_0x52851f,0xc9))[_0xc282('0x3e')](handleError(_0x52851f,null));};exports[_0xc282('0x44')]=function(_0x7baefb,_0x546f4b){if(_0x7baefb[_0xc282('0x43')]['id']){delete _0x7baefb[_0xc282('0x43')]['id'];}return db['ServicenowField']['find']({'where':{'id':_0x7baefb[_0xc282('0x40')]['id']}})['then'](handleEntityNotFound(_0x546f4b,null))[_0xc282('0x21')](saveUpdates(_0x7baefb[_0xc282('0x43')],null))[_0xc282('0x21')](respondWithResult(_0x546f4b,null))[_0xc282('0x3e')](handleError(_0x546f4b,null));};exports[_0xc282('0x45')]=function(_0x47f7ca,_0x54b847){return db[_0xc282('0x3a')][_0xc282('0x41')]({'where':{'id':_0x47f7ca['params']['id']}})[_0xc282('0x21')](handleEntityNotFound(_0x54b847,null))[_0xc282('0x21')](removeEntity(_0x54b847,null))[_0xc282('0x3e')](handleError(_0x54b847,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index dd3ecbf..2ed231f 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 _0x4567=['./intServicenowField.attributes','exports','int_servicenow_fields','servicenow_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa24985,_0x1d2c15){var _0x2f7c36=function(_0x28219c){while(--_0x28219c){_0xa24985['push'](_0xa24985['shift']());}};_0x2f7c36(++_0x1d2c15);}(_0x4567,0x1d3));var _0x7456=function(_0x39697e,_0x5a4f14){_0x39697e=_0x39697e-0x0;var _0x4bf544=_0x4567[_0x39697e];return _0x4bf544;};'use strict';var _=require(_0x7456('0x0'));var util=require(_0x7456('0x1'));var logger=require(_0x7456('0x2'))(_0x7456('0x3'));var moment=require('moment');var BPromise=require(_0x7456('0x4'));var rp=require(_0x7456('0x5'));var fs=require('fs');var path=require(_0x7456('0x6'));var rimraf=require(_0x7456('0x7'));var config=require(_0x7456('0x8'));var attributes=require(_0x7456('0x9'));module[_0x7456('0xa')]=function(_0x3456ef,_0x1307dc){return _0x3456ef['define']('ServicenowField',attributes,{'tableName':_0x7456('0xb'),'paranoid':![],'indexes':[{'name':_0x7456('0xc'),'fields':[_0x7456('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfa05=['servicenow_unique_index','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField'];(function(_0x5136d9,_0x2f91da){var _0x3e23dd=function(_0x266e74){while(--_0x266e74){_0x5136d9['push'](_0x5136d9['shift']());}};_0x3e23dd(++_0x2f91da);}(_0xfa05,0x17b));var _0x5fa0=function(_0x2aa870,_0x349d8b){_0x2aa870=_0x2aa870-0x0;var _0x5e757f=_0xfa05[_0x2aa870];return _0x5e757f;};'use strict';var _=require(_0x5fa0('0x0'));var util=require(_0x5fa0('0x1'));var logger=require(_0x5fa0('0x2'))(_0x5fa0('0x3'));var moment=require(_0x5fa0('0x4'));var BPromise=require(_0x5fa0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5fa0('0x6'));var rimraf=require(_0x5fa0('0x7'));var config=require(_0x5fa0('0x8'));var attributes=require(_0x5fa0('0x9'));module[_0x5fa0('0xa')]=function(_0x4aa3dc,_0x154c06){return _0x4aa3dc[_0x5fa0('0xb')](_0x5fa0('0xc'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x5fa0('0xd'),'fields':['idField','FieldId'],'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 99bee53..6bd3e63 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 _0x70e0=['code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x58452b,_0x263816){var _0x2296a1=function(_0x3489d7){while(--_0x3489d7){_0x58452b['push'](_0x58452b['shift']());}};_0x2296a1(++_0x263816);}(_0x70e0,0x17b));var _0x070e=function(_0x217d17,_0x415ce7){_0x217d17=_0x217d17-0x0;var _0x4ca0f5=_0x70e0[_0x217d17];return _0x4ca0f5;};'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')]('ServicenowField,\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')]('ServicenowField,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('ServicenowField,\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','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(_0x2a90ea,_0x12e428){var _0xa1ba2d=function(_0x2ccae5){while(--_0x2ccae5){_0x2a90ea['push'](_0x2a90ea['shift']());}};_0xa1ba2d(++_0x12e428);}(_0xb43b,0x1b2));var _0xbb43=function(_0x161acc,_0x1d03a3){_0x161acc=_0x161acc-0x0;var _0x2dcb4f=_0xb43b[_0x161acc];return _0x2dcb4f;};'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 dd58058..4b3aa95 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(_0x625519,_0x59f7d4){var _0xc9bd44=function(_0x42b000){while(--_0x42b000){_0x625519['push'](_0x625519['shift']());}};_0xc9bd44(++_0x59f7d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xa9e0[_0x2a6809];return _0x11c371;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file +var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x35e221,_0x477a7c){var _0x39b5cc=function(_0x4099ce){while(--_0x4099ce){_0x35e221['push'](_0x35e221['shift']());}};_0x39b5cc(++_0x477a7c);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'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 a3b57bc..12ffdc3 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(_0x784926,_0x14e759){var _0x365660=function(_0x5ef764){while(--_0x5ef764){_0x784926['push'](_0x784926['shift']());}};_0x365660(++_0x14e759);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'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(_0x1bccdd,_0x3b73e3){var _0x2a4ba5=function(_0x359462){while(--_0x359462){_0x1bccdd['push'](_0x1bccdd['shift']());}};_0x2a4ba5(++_0x3b73e3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 ac70fff..db0f388 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 _0xfbcd=['length','hasOwnProperty','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','nolimit','addConfiguration','AccountId','Subjects','channel','getDescriptions','SugarcrmField','getFields','assigned_user_id','description','duration_hours','duration_minutes','parent_id','parent_type','parent_name','direction','username','password','remoteUri','substring','lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','PLAIN','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','Wrong\x20credentials','statusCode','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','status','end','json','undefined','offset','count','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','type','key','model','keys','intersection','query','attributes','fields'];(function(_0x47d2fd,_0x1fcc59){var _0x240459=function(_0x4ae16d){while(--_0x4ae16d){_0x47d2fd['push'](_0x47d2fd['shift']());}};_0x240459(++_0x1fcc59);}(_0xfbcd,0x133));var _0xdfbc=function(_0x3d3419,_0x87c34b){_0x3d3419=_0x3d3419-0x0;var _0x3985b7=_0xfbcd[_0x3d3419];return _0x3985b7;};'use strict';var emlformat=require(_0xdfbc('0x0'));var rimraf=require(_0xdfbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdfbc('0x2'));var rp=require('request-promise');var moment=require(_0xdfbc('0x3'));var BPromise=require(_0xdfbc('0x4'));var Mustache=require(_0xdfbc('0x5'));var util=require(_0xdfbc('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdfbc('0x7'));var ejs=require(_0xdfbc('0x8'));var fs=require('fs');var fs_extra=require(_0xdfbc('0x9'));var _=require(_0xdfbc('0xa'));var squel=require('squel');var crypto=require(_0xdfbc('0xb'));var jsforce=require(_0xdfbc('0xc'));var deskjs=require(_0xdfbc('0xd'));var toCsv=require(_0xdfbc('0x7'));var querystring=require('querystring');var Papa=require(_0xdfbc('0xe'));var Redis=require(_0xdfbc('0xf'));var authService=require(_0xdfbc('0x10'));var qs=require(_0xdfbc('0x11'));var as=require(_0xdfbc('0x12'));var hardwareService=require(_0xdfbc('0x13'));var logger=require(_0xdfbc('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xdfbc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xdfbc('0x16'))['db'];var integrations=require(_0xdfbc('0x17'));function respondWithStatusCode(_0x24cd83,_0x464ba4){_0x464ba4=_0x464ba4||0xcc;return function(_0x591875){if(_0x591875){return _0x24cd83['sendStatus'](_0x464ba4);}return _0x24cd83[_0xdfbc('0x18')](_0x464ba4)[_0xdfbc('0x19')]();};}function respondWithResult(_0x33ee71,_0x59dbce){_0x59dbce=_0x59dbce||0xc8;return function(_0x232b9c){if(_0x232b9c){return _0x33ee71[_0xdfbc('0x18')](_0x59dbce)[_0xdfbc('0x1a')](_0x232b9c);}};}function respondWithFilteredResult(_0x165349,_0xe9d631){return function(_0x14b534){if(_0x14b534){var _0x2782b7=typeof _0xe9d631['offset']===_0xdfbc('0x1b')&&typeof _0xe9d631['limit']===_0xdfbc('0x1b');var _0x95e528=_0x14b534['count'];var _0xc6f75c=_0x2782b7?0x0:_0xe9d631[_0xdfbc('0x1c')];var _0x45a327=_0x2782b7?_0x14b534[_0xdfbc('0x1d')]:_0xe9d631['offset']+_0xe9d631[_0xdfbc('0x1e')];var _0x5294bf;if(_0x45a327>=_0x95e528){_0x45a327=_0x95e528;_0x5294bf=0xc8;}else{_0x5294bf=0xce;}_0x165349['status'](_0x5294bf);return _0x165349[_0xdfbc('0x1f')]('Content-Range',_0xc6f75c+'-'+_0x45a327+'/'+_0x95e528)['json'](_0x14b534);}return null;};}function patchUpdates(_0x1a56e9){return function(_0x1de8c4){try{jsonpatch[_0xdfbc('0x20')](_0x1de8c4,_0x1a56e9,!![]);}catch(_0x230f2f){return BPromise[_0xdfbc('0x21')](_0x230f2f);}return _0x1de8c4[_0xdfbc('0x22')]();};}function saveUpdates(_0x1ebcd8,_0x255302){return function(_0x27fb67){if(_0x27fb67){return _0x27fb67[_0xdfbc('0x23')](_0x1ebcd8)[_0xdfbc('0x24')](function(_0x2cb048){return _0x2cb048;});}return null;};}function removeEntity(_0x183c44,_0xb8c9cd){return function(_0x5caaf1){if(_0x5caaf1){return _0x5caaf1[_0xdfbc('0x25')]()[_0xdfbc('0x24')](function(){_0x183c44[_0xdfbc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30d4c2,_0x1532ae){return function(_0x52f04c){if(!_0x52f04c){_0x30d4c2[_0xdfbc('0x26')](0x194);}return _0x52f04c;};}function handleError(_0x394f4a,_0x4f38e5){_0x4f38e5=_0x4f38e5||0x1f4;return function(_0x3cbaee){logger[_0xdfbc('0x27')](_0x3cbaee[_0xdfbc('0x28')]);if(_0x3cbaee[_0xdfbc('0x29')]){delete _0x3cbaee[_0xdfbc('0x29')];}_0x394f4a[_0xdfbc('0x18')](_0x4f38e5)[_0xdfbc('0x2a')](_0x3cbaee);};}exports[_0xdfbc('0x2b')]=function(_0x29cf63,_0x5e6b9a){var _0x56286e={},_0x1d6f19={},_0x20257={'count':0x0,'rows':[]};var _0x501722=_[_0xdfbc('0x2c')](db['SugarcrmAccount']['rawAttributes'],function(_0x4db192){return{'name':_0x4db192['fieldName'],'type':_0x4db192[_0xdfbc('0x2d')][_0xdfbc('0x2e')]};});_0x1d6f19[_0xdfbc('0x2f')]=_[_0xdfbc('0x2c')](_0x501722,'name');_0x1d6f19['query']=_[_0xdfbc('0x30')](_0x29cf63['query']);_0x1d6f19['filters']=_[_0xdfbc('0x31')](_0x1d6f19[_0xdfbc('0x2f')],_0x1d6f19[_0xdfbc('0x32')]);_0x56286e[_0xdfbc('0x33')]=_[_0xdfbc('0x31')](_0x1d6f19[_0xdfbc('0x2f')],qs[_0xdfbc('0x34')](_0x29cf63[_0xdfbc('0x32')][_0xdfbc('0x34')]));_0x56286e[_0xdfbc('0x33')]=_0x56286e[_0xdfbc('0x33')][_0xdfbc('0x35')]?_0x56286e['attributes']:_0x1d6f19[_0xdfbc('0x2f')];if(!_0x29cf63['query'][_0xdfbc('0x36')]('nolimit')){_0x56286e['limit']=qs['limit'](_0x29cf63['query']['limit']);_0x56286e[_0xdfbc('0x1c')]=qs[_0xdfbc('0x1c')](_0x29cf63[_0xdfbc('0x32')][_0xdfbc('0x1c')]);}_0x56286e[_0xdfbc('0x37')]=qs[_0xdfbc('0x38')](_0x29cf63[_0xdfbc('0x32')]['sort']);_0x56286e[_0xdfbc('0x39')]=qs['filters'](_[_0xdfbc('0x3a')](_0x29cf63['query'],_0x1d6f19[_0xdfbc('0x3b')]),_0x501722);if(_0x29cf63['query'][_0xdfbc('0x3c')]){_0x56286e[_0xdfbc('0x39')]=_[_0xdfbc('0x3d')](_0x56286e[_0xdfbc('0x39')],{'$or':_[_0xdfbc('0x2c')](_0x501722,function(_0x546b3c){if(_0x546b3c[_0xdfbc('0x2d')]!==_0xdfbc('0x3e')){var _0x449509={};_0x449509[_0x546b3c['name']]={'$like':'%'+_0x29cf63[_0xdfbc('0x32')]['filter']+'%'};return _0x449509;}})});}_0x56286e=_['merge']({},_0x56286e,_0x29cf63[_0xdfbc('0x3f')]);var _0x300383={'where':_0x56286e[_0xdfbc('0x39')]};return db[_0xdfbc('0x40')]['count'](_0x300383)['then'](function(_0x86dcaa){_0x20257['count']=_0x86dcaa;if(_0x29cf63[_0xdfbc('0x32')][_0xdfbc('0x41')]){_0x56286e[_0xdfbc('0x42')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xdfbc('0x43')](_0x56286e);})['then'](function(_0x13b3cb){_0x20257['rows']=_0x13b3cb;return _0x20257;})[_0xdfbc('0x24')](respondWithFilteredResult(_0x5e6b9a,_0x56286e))[_0xdfbc('0x44')](handleError(_0x5e6b9a,null));};exports[_0xdfbc('0x45')]=function(_0x12e69f,_0x8141ce){var _0x46edd3={'raw':![],'where':{'id':_0x12e69f[_0xdfbc('0x46')]['id']}},_0x1fa6c9={};_0x1fa6c9[_0xdfbc('0x2f')]=_[_0xdfbc('0x30')](db['SugarcrmAccount'][_0xdfbc('0x47')]);_0x1fa6c9[_0xdfbc('0x32')]=_[_0xdfbc('0x30')](_0x12e69f['query']);_0x1fa6c9[_0xdfbc('0x3b')]=_['intersection'](_0x1fa6c9[_0xdfbc('0x2f')],_0x1fa6c9[_0xdfbc('0x32')]);_0x46edd3[_0xdfbc('0x33')]=_[_0xdfbc('0x31')](_0x1fa6c9[_0xdfbc('0x2f')],qs[_0xdfbc('0x34')](_0x12e69f['query']['fields']));_0x46edd3[_0xdfbc('0x33')]=_0x46edd3[_0xdfbc('0x33')]['length']?_0x46edd3['attributes']:_0x1fa6c9[_0xdfbc('0x2f')];if(_0x12e69f[_0xdfbc('0x32')][_0xdfbc('0x41')]){_0x46edd3['include']=[{'all':!![]}];}_0x46edd3=_[_0xdfbc('0x3d')]({},_0x46edd3,_0x12e69f[_0xdfbc('0x3f')]);return db['SugarcrmAccount'][_0xdfbc('0x48')](_0x46edd3)[_0xdfbc('0x24')](handleEntityNotFound(_0x8141ce,null))[_0xdfbc('0x24')](respondWithResult(_0x8141ce,null))[_0xdfbc('0x44')](handleError(_0x8141ce,null));};exports[_0xdfbc('0x49')]=function(_0x4ebb75,_0x33e86b){return db['SugarcrmAccount']['create'](_0x4ebb75['body'],{})[_0xdfbc('0x24')](respondWithResult(_0x33e86b,0xc9))[_0xdfbc('0x44')](handleError(_0x33e86b,null));};exports[_0xdfbc('0x23')]=function(_0x4e8464,_0x3ca004){if(_0x4e8464[_0xdfbc('0x4a')]['id']){delete _0x4e8464[_0xdfbc('0x4a')]['id'];}return db[_0xdfbc('0x40')][_0xdfbc('0x48')]({'where':{'id':_0x4e8464['params']['id']}})[_0xdfbc('0x24')](handleEntityNotFound(_0x3ca004,null))[_0xdfbc('0x24')](saveUpdates(_0x4e8464[_0xdfbc('0x4a')],null))[_0xdfbc('0x24')](respondWithResult(_0x3ca004,null))['catch'](handleError(_0x3ca004,null));};exports['destroy']=function(_0x52aa4e,_0x209b65){return db[_0xdfbc('0x40')]['find']({'where':{'id':_0x52aa4e['params']['id']}})[_0xdfbc('0x24')](handleEntityNotFound(_0x209b65,null))[_0xdfbc('0x24')](removeEntity(_0x209b65,null))[_0xdfbc('0x44')](handleError(_0x209b65,null));};exports[_0xdfbc('0x4b')]=function(_0xe1194c,_0x154b80,_0x3981bc){var _0x5acfb5={};var _0x50b1ea={};var _0x39e4c4;var _0x51bfc2;return db[_0xdfbc('0x40')][_0xdfbc('0x4c')]({'where':{'id':_0xe1194c[_0xdfbc('0x46')]['id']}})[_0xdfbc('0x24')](handleEntityNotFound(_0x154b80,null))[_0xdfbc('0x24')](function(_0x48176f){if(_0x48176f){_0x39e4c4=_0x48176f;_0x50b1ea[_0xdfbc('0x2f')]=_[_0xdfbc('0x30')](db[_0xdfbc('0x4d')]['rawAttributes']);_0x50b1ea[_0xdfbc('0x32')]=_[_0xdfbc('0x30')](_0xe1194c[_0xdfbc('0x32')]);_0x50b1ea['filters']=_[_0xdfbc('0x31')](_0x50b1ea['model'],_0x50b1ea[_0xdfbc('0x32')]);_0x5acfb5[_0xdfbc('0x33')]=_[_0xdfbc('0x31')](_0x50b1ea[_0xdfbc('0x2f')],qs[_0xdfbc('0x34')](_0xe1194c[_0xdfbc('0x32')][_0xdfbc('0x34')]));_0x5acfb5[_0xdfbc('0x33')]=_0x5acfb5[_0xdfbc('0x33')]['length']?_0x5acfb5[_0xdfbc('0x33')]:_0x50b1ea[_0xdfbc('0x2f')];_0x5acfb5[_0xdfbc('0x37')]=qs['sort'](_0xe1194c[_0xdfbc('0x32')]['sort']);_0x5acfb5[_0xdfbc('0x39')]=qs[_0xdfbc('0x3b')](_[_0xdfbc('0x3a')](_0xe1194c['query'],_0x50b1ea[_0xdfbc('0x3b')]));if(_0xe1194c[_0xdfbc('0x32')][_0xdfbc('0x3c')]){_0x5acfb5['where']=_['merge'](_0x5acfb5['where'],{'$or':_[_0xdfbc('0x2c')](_0x5acfb5[_0xdfbc('0x33')],function(_0x16f018){var _0x2d10e0={};_0x2d10e0[_0x16f018]={'$like':'%'+_0xe1194c[_0xdfbc('0x32')]['filter']+'%'};return _0x2d10e0;})});}_0x5acfb5=_[_0xdfbc('0x3d')]({},_0x5acfb5,_0xe1194c[_0xdfbc('0x3f')]);return _0x39e4c4[_0xdfbc('0x4b')](_0x5acfb5);}})['then'](function(_0x165e2b){if(_0x165e2b){_0x51bfc2=_0x165e2b[_0xdfbc('0x35')];if(!_0xe1194c[_0xdfbc('0x32')][_0xdfbc('0x36')](_0xdfbc('0x4e'))){_0x5acfb5[_0xdfbc('0x1e')]=qs['limit'](_0xe1194c[_0xdfbc('0x32')][_0xdfbc('0x1e')]);_0x5acfb5[_0xdfbc('0x1c')]=qs[_0xdfbc('0x1c')](_0xe1194c[_0xdfbc('0x32')]['offset']);}return _0x39e4c4[_0xdfbc('0x4b')](_0x5acfb5);}})[_0xdfbc('0x24')](function(_0x4400f6){if(_0x4400f6){return _0x4400f6?{'count':_0x51bfc2,'rows':_0x4400f6}:null;}})['then'](respondWithResult(_0x154b80,null))[_0xdfbc('0x44')](handleError(_0x154b80,null));};exports[_0xdfbc('0x4f')]=function(_0x1f773b,_0xbab351,_0x4d8dbe){if(_0x1f773b[_0xdfbc('0x4a')]['id']){delete _0x1f773b[_0xdfbc('0x4a')]['id'];}return db[_0xdfbc('0x40')][_0xdfbc('0x4c')]({'where':{'id':_0x1f773b[_0xdfbc('0x46')]['id']}})['then'](handleEntityNotFound(_0xbab351,null))[_0xdfbc('0x24')](function(_0x25861b){if(_0x25861b){_0x1f773b[_0xdfbc('0x4a')][_0xdfbc('0x50')]=_0x25861b['id'];_0x1f773b[_0xdfbc('0x4a')][_0xdfbc('0x51')]=integrations['getSubjects'](_0x1f773b[_0xdfbc('0x4a')][_0xdfbc('0x52')],_0x1f773b[_0xdfbc('0x4a')][_0xdfbc('0x2d')]);_0x1f773b[_0xdfbc('0x4a')]['Descriptions']=integrations[_0xdfbc('0x53')](_0x1f773b[_0xdfbc('0x4a')][_0xdfbc('0x52')],_0x1f773b['body'][_0xdfbc('0x2d')]);return db['SugarcrmConfiguration'][_0xdfbc('0x49')](_0x1f773b['body'],{'include':[{'model':db[_0xdfbc('0x54')],'as':_0xdfbc('0x51')},{'model':db[_0xdfbc('0x54')],'as':'Descriptions'}]});}return null;})[_0xdfbc('0x24')](respondWithResult(_0xbab351,null))[_0xdfbc('0x44')](handleError(_0xbab351,null));};exports[_0xdfbc('0x55')]=function(_0x4547a5,_0x4787c7,_0x25ebb0){var _0x2d17d4='';var _0x35e6c2=['id',_0xdfbc('0x29'),_0xdfbc('0x56'),'created_by',_0xdfbc('0x57'),'date_start',_0xdfbc('0x58'),_0xdfbc('0x59'),_0xdfbc('0x5a'),_0xdfbc('0x5b'),_0xdfbc('0x5c'),_0xdfbc('0x5d')];return db[_0xdfbc('0x40')][_0xdfbc('0x4c')]({'where':{'id':_0x4547a5[_0xdfbc('0x46')]['id']},'attributes':['id',_0xdfbc('0x5e'),_0xdfbc('0x5f'),_0xdfbc('0x60')]})[_0xdfbc('0x24')](handleEntityNotFound(_0x4787c7,null))[_0xdfbc('0x24')](function(_0x3695d1){if(_0x3695d1){_0x2d17d4=_0x3695d1[_0xdfbc('0x60')];var _0x5a1959=_0x2d17d4['slice'](-0x1);if(_0x5a1959==='/'){_0x2d17d4=_0x2d17d4[_0xdfbc('0x61')](0x0,_0x2d17d4[_0xdfbc('0x62')](_0x5a1959));}return rp({'method':'POST','uri':util[_0xdfbc('0x63')](_0xdfbc('0x64'),_0x2d17d4,_0xdfbc('0x65')),'json':!![],'form':{'method':_0xdfbc('0x66'),'input_type':_0xdfbc('0x67'),'response_type':_0xdfbc('0x67'),'rest_data':JSON[_0xdfbc('0x68')]({'user_auth':{'user_name':_0x3695d1[_0xdfbc('0x5e')],'password':_0x3695d1[_0xdfbc('0x5f')],'encryption':_0xdfbc('0x69')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x4456eb){if(_0x4456eb&&_0x4456eb[_0xdfbc('0x29')]!==_0xdfbc('0x6a')&&_0x4456eb['name']!==_0xdfbc('0x6b')){return rp({'method':_0xdfbc('0x6c'),'uri':util[_0xdfbc('0x63')](_0xdfbc('0x64'),_0x2d17d4,_0xdfbc('0x65')),'json':!![],'form':{'method':_0xdfbc('0x6d'),'input_type':_0xdfbc('0x67'),'response_type':_0xdfbc('0x67'),'rest_data':JSON['stringify']({'session':_0x4456eb['id'],'module_name':_0xdfbc('0x6e')})}})['then'](function(_0x120586){if(_0x120586){var _0xed3e38=_[_0xdfbc('0x6f')](_0x120586[_0xdfbc('0x70')]);_[_0xdfbc('0x71')](_0xed3e38,function(_0x55c346){return _0x35e6c2['includes'](_0x55c346[_0xdfbc('0x29')]);});return{'count':_0xed3e38[_0xdfbc('0x35')],'rows':_[_0xdfbc('0x2c')](_0xed3e38,function(_0x4d5fa3){return{'id':_0x4d5fa3[_0xdfbc('0x29')],'name':_0x4d5fa3[_0xdfbc('0x72')],'custom':_[_0xdfbc('0x73')](_0x4d5fa3['name'],'_c')?!![]:![],'options':_0x4d5fa3['options']?_[_0xdfbc('0x2c')](_['values'](_0x4d5fa3[_0xdfbc('0x3f')]),function(_0x222eb9){return{'name':_0x222eb9[_0xdfbc('0x74')],'value':_0x222eb9['name']};}):[]};})};}})[_0xdfbc('0x24')](respondWithResult(_0x4787c7,null))['catch'](function(_0x533863){var _0x290ffb=_0x4547a5[_0xdfbc('0x32')][_0xdfbc('0x75')]?0x1f4:_0x533863['statusCode']||0x1f4;logger[_0xdfbc('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0xdfbc('0x55'),_0x290ffb,JSON[_0xdfbc('0x68')](_0x533863));delete _0x533863[_0xdfbc('0x29')];if(_0x290ffb===0x191){_0x290ffb=0x190;}_0x4787c7[_0xdfbc('0x18')](_0x290ffb)[_0xdfbc('0x2a')](_0x4547a5['query'][_0xdfbc('0x75')]?{'message':_0xdfbc('0x76'),'statusCode':_0x533863[_0xdfbc('0x77')]}:_0x533863);});}else{var _0x4ca103=0x1f4;_0x4787c7[_0xdfbc('0x18')](_0x4ca103)[_0xdfbc('0x2a')]({'message':_0xdfbc('0x76'),'statusCode':0x190});}});}; \ No newline at end of file +var _0xd8d2=['parent_type','remoteUri','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','login','JSON','stringify','password','PLAIN','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','module_fields','remove','includes','label','values','value','test','statusCode','getFields','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','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/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','update','destroy','then','error','stack','name','send','map','SugarcrmAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','keys','create','body','find','findOne','SugarcrmConfiguration','getConfigurations','hasOwnProperty','nolimit','addConfiguration','AccountId','getSubjects','channel','Subjects','SugarcrmField','Descriptions','created_by','description','duration_minutes','parent_id'];(function(_0x3b0c9d,_0x3ddeb5){var _0xcfc8d7=function(_0x320dc6){while(--_0x320dc6){_0x3b0c9d['push'](_0x3b0c9d['shift']());}};_0xcfc8d7(++_0x3ddeb5);}(_0xd8d2,0x103));var _0x2d8d=function(_0x373afe,_0x4841f3){_0x373afe=_0x373afe-0x0;var _0x4decea=_0xd8d2[_0x373afe];return _0x4decea;};'use strict';var emlformat=require(_0x2d8d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d8d('0x1'));var jsonpatch=require(_0x2d8d('0x2'));var rp=require('request-promise');var moment=require(_0x2d8d('0x3'));var BPromise=require(_0x2d8d('0x4'));var Mustache=require(_0x2d8d('0x5'));var util=require('util');var path=require(_0x2d8d('0x6'));var sox=require(_0x2d8d('0x7'));var csv=require(_0x2d8d('0x8'));var ejs=require(_0x2d8d('0x9'));var fs=require('fs');var fs_extra=require(_0x2d8d('0xa'));var _=require(_0x2d8d('0xb'));var squel=require(_0x2d8d('0xc'));var crypto=require(_0x2d8d('0xd'));var jsforce=require(_0x2d8d('0xe'));var deskjs=require(_0x2d8d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2d8d('0x10'));var Papa=require('papaparse');var Redis=require(_0x2d8d('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x2d8d('0x12'));var as=require(_0x2d8d('0x13'));var hardwareService=require(_0x2d8d('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2d8d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2d8d('0x16'));var db=require(_0x2d8d('0x17'))['db'];var integrations=require(_0x2d8d('0x18'));function respondWithStatusCode(_0x4056d3,_0x494413){_0x494413=_0x494413||0xcc;return function(_0x320474){if(_0x320474){return _0x4056d3[_0x2d8d('0x19')](_0x494413);}return _0x4056d3[_0x2d8d('0x1a')](_0x494413)[_0x2d8d('0x1b')]();};}function respondWithResult(_0x484e84,_0x23ab07){_0x23ab07=_0x23ab07||0xc8;return function(_0x23485b){if(_0x23485b){return _0x484e84[_0x2d8d('0x1a')](_0x23ab07)[_0x2d8d('0x1c')](_0x23485b);}};}function respondWithFilteredResult(_0x86eddf,_0x29f69e){return function(_0x504319){if(_0x504319){var _0x26bea4=typeof _0x29f69e[_0x2d8d('0x1d')]===_0x2d8d('0x1e')&&typeof _0x29f69e['limit']===_0x2d8d('0x1e');var _0x44c9ed=_0x504319[_0x2d8d('0x1f')];var _0x4ab286=_0x26bea4?0x0:_0x29f69e[_0x2d8d('0x1d')];var _0x14f813=_0x26bea4?_0x504319[_0x2d8d('0x1f')]:_0x29f69e[_0x2d8d('0x1d')]+_0x29f69e[_0x2d8d('0x20')];var _0x2396b8;if(_0x14f813>=_0x44c9ed){_0x14f813=_0x44c9ed;_0x2396b8=0xc8;}else{_0x2396b8=0xce;}_0x86eddf[_0x2d8d('0x1a')](_0x2396b8);return _0x86eddf[_0x2d8d('0x21')](_0x2d8d('0x22'),_0x4ab286+'-'+_0x14f813+'/'+_0x44c9ed)['json'](_0x504319);}return null;};}function patchUpdates(_0x5ed3f6){return function(_0x35e166){try{jsonpatch[_0x2d8d('0x23')](_0x35e166,_0x5ed3f6,!![]);}catch(_0x2ea83b){return BPromise['reject'](_0x2ea83b);}return _0x35e166['save']();};}function saveUpdates(_0x20a05f,_0x27a6bb){return function(_0x129219){if(_0x129219){return _0x129219[_0x2d8d('0x24')](_0x20a05f)['then'](function(_0x308f07){return _0x308f07;});}return null;};}function removeEntity(_0x1b41b3,_0x4fe178){return function(_0x450773){if(_0x450773){return _0x450773[_0x2d8d('0x25')]()[_0x2d8d('0x26')](function(){_0x1b41b3[_0x2d8d('0x1a')](0xcc)[_0x2d8d('0x1b')]();});}};}function handleEntityNotFound(_0x1a117d,_0x3f6560){return function(_0x54ab43){if(!_0x54ab43){_0x1a117d[_0x2d8d('0x19')](0x194);}return _0x54ab43;};}function handleError(_0x4fbb95,_0x377cfc){_0x377cfc=_0x377cfc||0x1f4;return function(_0x4d7198){logger[_0x2d8d('0x27')](_0x4d7198[_0x2d8d('0x28')]);if(_0x4d7198[_0x2d8d('0x29')]){delete _0x4d7198[_0x2d8d('0x29')];}_0x4fbb95['status'](_0x377cfc)[_0x2d8d('0x2a')](_0x4d7198);};}exports['index']=function(_0x41d245,_0x23fc2f){var _0x3e456a={},_0xe7e96e={},_0x56dde1={'count':0x0,'rows':[]};var _0x4575e8=_[_0x2d8d('0x2b')](db[_0x2d8d('0x2c')][_0x2d8d('0x2d')],function(_0x1dce42){return{'name':_0x1dce42[_0x2d8d('0x2e')],'type':_0x1dce42[_0x2d8d('0x2f')][_0x2d8d('0x30')]};});_0xe7e96e[_0x2d8d('0x31')]=_[_0x2d8d('0x2b')](_0x4575e8,_0x2d8d('0x29'));_0xe7e96e[_0x2d8d('0x32')]=_['keys'](_0x41d245[_0x2d8d('0x32')]);_0xe7e96e[_0x2d8d('0x33')]=_[_0x2d8d('0x34')](_0xe7e96e[_0x2d8d('0x31')],_0xe7e96e[_0x2d8d('0x32')]);_0x3e456a[_0x2d8d('0x35')]=_[_0x2d8d('0x34')](_0xe7e96e[_0x2d8d('0x31')],qs[_0x2d8d('0x36')](_0x41d245[_0x2d8d('0x32')]['fields']));_0x3e456a[_0x2d8d('0x35')]=_0x3e456a[_0x2d8d('0x35')][_0x2d8d('0x37')]?_0x3e456a['attributes']:_0xe7e96e[_0x2d8d('0x31')];if(!_0x41d245[_0x2d8d('0x32')]['hasOwnProperty']('nolimit')){_0x3e456a[_0x2d8d('0x20')]=qs['limit'](_0x41d245[_0x2d8d('0x32')]['limit']);_0x3e456a[_0x2d8d('0x1d')]=qs[_0x2d8d('0x1d')](_0x41d245[_0x2d8d('0x32')][_0x2d8d('0x1d')]);}_0x3e456a['order']=qs[_0x2d8d('0x38')](_0x41d245['query'][_0x2d8d('0x38')]);_0x3e456a[_0x2d8d('0x39')]=qs[_0x2d8d('0x33')](_[_0x2d8d('0x3a')](_0x41d245[_0x2d8d('0x32')],_0xe7e96e[_0x2d8d('0x33')]),_0x4575e8);if(_0x41d245[_0x2d8d('0x32')][_0x2d8d('0x3b')]){_0x3e456a[_0x2d8d('0x39')]=_['merge'](_0x3e456a[_0x2d8d('0x39')],{'$or':_[_0x2d8d('0x2b')](_0x4575e8,function(_0x14d7be){if(_0x14d7be[_0x2d8d('0x2f')]!==_0x2d8d('0x3c')){var _0x172bb4={};_0x172bb4[_0x14d7be[_0x2d8d('0x29')]]={'$like':'%'+_0x41d245[_0x2d8d('0x32')]['filter']+'%'};return _0x172bb4;}})});}_0x3e456a=_[_0x2d8d('0x3d')]({},_0x3e456a,_0x41d245[_0x2d8d('0x3e')]);var _0x329037={'where':_0x3e456a[_0x2d8d('0x39')]};return db[_0x2d8d('0x2c')][_0x2d8d('0x1f')](_0x329037)['then'](function(_0x4594f9){_0x56dde1[_0x2d8d('0x1f')]=_0x4594f9;if(_0x41d245[_0x2d8d('0x32')][_0x2d8d('0x3f')]){_0x3e456a[_0x2d8d('0x40')]=[{'all':!![]}];}return db[_0x2d8d('0x2c')][_0x2d8d('0x41')](_0x3e456a);})[_0x2d8d('0x26')](function(_0x510b79){_0x56dde1['rows']=_0x510b79;return _0x56dde1;})[_0x2d8d('0x26')](respondWithFilteredResult(_0x23fc2f,_0x3e456a))[_0x2d8d('0x42')](handleError(_0x23fc2f,null));};exports[_0x2d8d('0x43')]=function(_0x2b8f69,_0x24cd1c){var _0x4b5b69={'raw':![],'where':{'id':_0x2b8f69[_0x2d8d('0x44')]['id']}},_0x2ecf31={};_0x2ecf31[_0x2d8d('0x31')]=_['keys'](db['SugarcrmAccount'][_0x2d8d('0x2d')]);_0x2ecf31[_0x2d8d('0x32')]=_[_0x2d8d('0x45')](_0x2b8f69[_0x2d8d('0x32')]);_0x2ecf31[_0x2d8d('0x33')]=_[_0x2d8d('0x34')](_0x2ecf31[_0x2d8d('0x31')],_0x2ecf31[_0x2d8d('0x32')]);_0x4b5b69['attributes']=_[_0x2d8d('0x34')](_0x2ecf31['model'],qs[_0x2d8d('0x36')](_0x2b8f69[_0x2d8d('0x32')][_0x2d8d('0x36')]));_0x4b5b69[_0x2d8d('0x35')]=_0x4b5b69[_0x2d8d('0x35')][_0x2d8d('0x37')]?_0x4b5b69[_0x2d8d('0x35')]:_0x2ecf31[_0x2d8d('0x31')];if(_0x2b8f69[_0x2d8d('0x32')][_0x2d8d('0x3f')]){_0x4b5b69[_0x2d8d('0x40')]=[{'all':!![]}];}_0x4b5b69=_[_0x2d8d('0x3d')]({},_0x4b5b69,_0x2b8f69['options']);return db[_0x2d8d('0x2c')]['find'](_0x4b5b69)[_0x2d8d('0x26')](handleEntityNotFound(_0x24cd1c,null))['then'](respondWithResult(_0x24cd1c,null))[_0x2d8d('0x42')](handleError(_0x24cd1c,null));};exports['create']=function(_0x2a0061,_0x4ef785){return db[_0x2d8d('0x2c')][_0x2d8d('0x46')](_0x2a0061[_0x2d8d('0x47')],{})[_0x2d8d('0x26')](respondWithResult(_0x4ef785,0xc9))[_0x2d8d('0x42')](handleError(_0x4ef785,null));};exports['update']=function(_0x1e37f8,_0x38f4a2){if(_0x1e37f8['body']['id']){delete _0x1e37f8[_0x2d8d('0x47')]['id'];}return db['SugarcrmAccount'][_0x2d8d('0x48')]({'where':{'id':_0x1e37f8[_0x2d8d('0x44')]['id']}})['then'](handleEntityNotFound(_0x38f4a2,null))[_0x2d8d('0x26')](saveUpdates(_0x1e37f8['body'],null))['then'](respondWithResult(_0x38f4a2,null))['catch'](handleError(_0x38f4a2,null));};exports[_0x2d8d('0x25')]=function(_0x1ac3a0,_0x44cb74){return db[_0x2d8d('0x2c')][_0x2d8d('0x48')]({'where':{'id':_0x1ac3a0[_0x2d8d('0x44')]['id']}})[_0x2d8d('0x26')](handleEntityNotFound(_0x44cb74,null))[_0x2d8d('0x26')](removeEntity(_0x44cb74,null))[_0x2d8d('0x42')](handleError(_0x44cb74,null));};exports['getConfigurations']=function(_0x5efc4c,_0x1070ce,_0x18870d){var _0x317d83={};var _0x2012cd={};var _0x5e9dfb;var _0x46cceb;return db[_0x2d8d('0x2c')][_0x2d8d('0x49')]({'where':{'id':_0x5efc4c[_0x2d8d('0x44')]['id']}})['then'](handleEntityNotFound(_0x1070ce,null))[_0x2d8d('0x26')](function(_0x31118b){if(_0x31118b){_0x5e9dfb=_0x31118b;_0x2012cd[_0x2d8d('0x31')]=_[_0x2d8d('0x45')](db[_0x2d8d('0x4a')]['rawAttributes']);_0x2012cd[_0x2d8d('0x32')]=_['keys'](_0x5efc4c[_0x2d8d('0x32')]);_0x2012cd[_0x2d8d('0x33')]=_['intersection'](_0x2012cd[_0x2d8d('0x31')],_0x2012cd[_0x2d8d('0x32')]);_0x317d83['attributes']=_[_0x2d8d('0x34')](_0x2012cd[_0x2d8d('0x31')],qs[_0x2d8d('0x36')](_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x36')]));_0x317d83[_0x2d8d('0x35')]=_0x317d83[_0x2d8d('0x35')][_0x2d8d('0x37')]?_0x317d83[_0x2d8d('0x35')]:_0x2012cd[_0x2d8d('0x31')];_0x317d83['order']=qs[_0x2d8d('0x38')](_0x5efc4c['query'][_0x2d8d('0x38')]);_0x317d83[_0x2d8d('0x39')]=qs['filters'](_[_0x2d8d('0x3a')](_0x5efc4c[_0x2d8d('0x32')],_0x2012cd[_0x2d8d('0x33')]));if(_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x3b')]){_0x317d83[_0x2d8d('0x39')]=_[_0x2d8d('0x3d')](_0x317d83[_0x2d8d('0x39')],{'$or':_[_0x2d8d('0x2b')](_0x317d83[_0x2d8d('0x35')],function(_0x39ff07){var _0x25b092={};_0x25b092[_0x39ff07]={'$like':'%'+_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x3b')]+'%'};return _0x25b092;})});}_0x317d83=_[_0x2d8d('0x3d')]({},_0x317d83,_0x5efc4c[_0x2d8d('0x3e')]);return _0x5e9dfb[_0x2d8d('0x4b')](_0x317d83);}})['then'](function(_0x5bc52a){if(_0x5bc52a){_0x46cceb=_0x5bc52a['length'];if(!_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x4c')](_0x2d8d('0x4d'))){_0x317d83[_0x2d8d('0x20')]=qs[_0x2d8d('0x20')](_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x20')]);_0x317d83[_0x2d8d('0x1d')]=qs[_0x2d8d('0x1d')](_0x5efc4c[_0x2d8d('0x32')][_0x2d8d('0x1d')]);}return _0x5e9dfb[_0x2d8d('0x4b')](_0x317d83);}})[_0x2d8d('0x26')](function(_0x32691d){if(_0x32691d){return _0x32691d?{'count':_0x46cceb,'rows':_0x32691d}:null;}})[_0x2d8d('0x26')](respondWithResult(_0x1070ce,null))[_0x2d8d('0x42')](handleError(_0x1070ce,null));};exports[_0x2d8d('0x4e')]=function(_0x1102f2,_0x18986f,_0x5d8a52){if(_0x1102f2[_0x2d8d('0x47')]['id']){delete _0x1102f2[_0x2d8d('0x47')]['id'];}return db[_0x2d8d('0x2c')][_0x2d8d('0x49')]({'where':{'id':_0x1102f2['params']['id']}})[_0x2d8d('0x26')](handleEntityNotFound(_0x18986f,null))[_0x2d8d('0x26')](function(_0x106289){if(_0x106289){_0x1102f2['body'][_0x2d8d('0x4f')]=_0x106289['id'];_0x1102f2[_0x2d8d('0x47')]['Subjects']=integrations[_0x2d8d('0x50')](_0x1102f2[_0x2d8d('0x47')][_0x2d8d('0x51')],_0x1102f2['body'][_0x2d8d('0x2f')]);_0x1102f2[_0x2d8d('0x47')]['Descriptions']=integrations['getDescriptions'](_0x1102f2[_0x2d8d('0x47')][_0x2d8d('0x51')],_0x1102f2[_0x2d8d('0x47')][_0x2d8d('0x2f')]);return db['SugarcrmConfiguration'][_0x2d8d('0x46')](_0x1102f2['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x2d8d('0x52')},{'model':db[_0x2d8d('0x53')],'as':_0x2d8d('0x54')}]});}return null;})['then'](respondWithResult(_0x18986f,null))[_0x2d8d('0x42')](handleError(_0x18986f,null));};exports['getFields']=function(_0xd50059,_0x1ac9c8,_0x2c2c76){var _0x23eaf3='';var _0x65d746=['id','name','assigned_user_id',_0x2d8d('0x55'),_0x2d8d('0x56'),'date_start','duration_hours',_0x2d8d('0x57'),_0x2d8d('0x58'),_0x2d8d('0x59'),'parent_name','direction'];return db[_0x2d8d('0x2c')][_0x2d8d('0x49')]({'where':{'id':_0xd50059[_0x2d8d('0x44')]['id']},'attributes':['id','username','password',_0x2d8d('0x5a')]})['then'](handleEntityNotFound(_0x1ac9c8,null))['then'](function(_0x4dd78b){if(_0x4dd78b){_0x23eaf3=_0x4dd78b['remoteUri'];var _0x5f9307=_0x23eaf3[_0x2d8d('0x5b')](-0x1);if(_0x5f9307==='/'){_0x23eaf3=_0x23eaf3[_0x2d8d('0x5c')](0x0,_0x23eaf3[_0x2d8d('0x5d')](_0x5f9307));}return rp({'method':_0x2d8d('0x5e'),'uri':util[_0x2d8d('0x5f')]('%s%s',_0x23eaf3,_0x2d8d('0x60')),'json':!![],'form':{'method':_0x2d8d('0x61'),'input_type':_0x2d8d('0x62'),'response_type':'JSON','rest_data':JSON[_0x2d8d('0x63')]({'user_auth':{'user_name':_0x4dd78b['username'],'password':_0x4dd78b[_0x2d8d('0x64')],'encryption':_0x2d8d('0x65')},'application':_0x2d8d('0x66')})}});}})[_0x2d8d('0x26')](function(_0x421045){if(_0x421045&&_0x421045[_0x2d8d('0x29')]!==_0x2d8d('0x67')&&_0x421045[_0x2d8d('0x29')]!==_0x2d8d('0x68')){return rp({'method':_0x2d8d('0x5e'),'uri':util[_0x2d8d('0x5f')]('%s%s',_0x23eaf3,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x2d8d('0x69'),'input_type':_0x2d8d('0x62'),'response_type':_0x2d8d('0x62'),'rest_data':JSON[_0x2d8d('0x63')]({'session':_0x421045['id'],'module_name':'Calls'})}})['then'](function(_0x1a1b78){if(_0x1a1b78){var _0x3c0fab=_['values'](_0x1a1b78[_0x2d8d('0x6a')]);_[_0x2d8d('0x6b')](_0x3c0fab,function(_0x2c5765){return _0x65d746[_0x2d8d('0x6c')](_0x2c5765[_0x2d8d('0x29')]);});return{'count':_0x3c0fab[_0x2d8d('0x37')],'rows':_[_0x2d8d('0x2b')](_0x3c0fab,function(_0x36058d){return{'id':_0x36058d[_0x2d8d('0x29')],'name':_0x36058d[_0x2d8d('0x6d')],'custom':_['endsWith'](_0x36058d['name'],'_c')?!![]:![],'options':_0x36058d[_0x2d8d('0x3e')]?_[_0x2d8d('0x2b')](_[_0x2d8d('0x6e')](_0x36058d['options']),function(_0x36ec9f){return{'name':_0x36ec9f[_0x2d8d('0x6f')],'value':_0x36ec9f['name']};}):[]};})};}})[_0x2d8d('0x26')](respondWithResult(_0x1ac9c8,null))['catch'](function(_0x300a7f){var _0x41e0e7=_0xd50059['query'][_0x2d8d('0x70')]?0x1f4:_0x300a7f[_0x2d8d('0x71')]||0x1f4;logger[_0x2d8d('0x27')]('getFields,\x20%s,\x20%s,\x20%s',_0x2d8d('0x72'),_0x41e0e7,JSON[_0x2d8d('0x63')](_0x300a7f));delete _0x300a7f['name'];if(_0x41e0e7===0x191){_0x41e0e7=0x190;}_0x1ac9c8[_0x2d8d('0x1a')](_0x41e0e7)[_0x2d8d('0x2a')](_0xd50059[_0x2d8d('0x32')][_0x2d8d('0x70')]?{'message':_0x2d8d('0x73'),'statusCode':_0x300a7f[_0x2d8d('0x71')]}:_0x300a7f);});}else{var _0x13f420=0x1f4;_0x1ac9c8[_0x2d8d('0x1a')](_0x13f420)[_0x2d8d('0x2a')]({'message':_0x2d8d('0x73'),'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 843f564..897ba62 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 _0x87a1=['api','moment','request-promise','path','../../config/environment','define','SugarcrmAccount','lodash','util','../../config/logger'];(function(_0x45de81,_0x5af58e){var _0x9bd208=function(_0x465b4c){while(--_0x465b4c){_0x45de81['push'](_0x45de81['shift']());}};_0x9bd208(++_0x5af58e);}(_0x87a1,0x16f));var _0x187a=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x87a1[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x187a('0x0'));var util=require(_0x187a('0x1'));var logger=require(_0x187a('0x2'))(_0x187a('0x3'));var moment=require(_0x187a('0x4'));var BPromise=require('bluebird');var rp=require(_0x187a('0x5'));var fs=require('fs');var path=require(_0x187a('0x6'));var rimraf=require('rimraf');var config=require(_0x187a('0x7'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x17e733,_0x1011e0){return _0x17e733[_0x187a('0x8')](_0x187a('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8137=['request-promise','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','int_sugarcrm_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3bfc8c,_0x2d8eb1){var _0x2a1506=function(_0x1ad1df){while(--_0x1ad1df){_0x3bfc8c['push'](_0x3bfc8c['shift']());}};_0x2a1506(++_0x2d8eb1);}(_0x8137,0x180));var _0x7813=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0x8137[_0x2070da];return _0x4f9fe1;};'use strict';var _=require(_0x7813('0x0'));var util=require(_0x7813('0x1'));var logger=require(_0x7813('0x2'))(_0x7813('0x3'));var moment=require(_0x7813('0x4'));var BPromise=require(_0x7813('0x5'));var rp=require(_0x7813('0x6'));var fs=require('fs');var path=require(_0x7813('0x7'));var rimraf=require(_0x7813('0x8'));var config=require('../../config/environment');var attributes=require(_0x7813('0x9'));var integrations=require(_0x7813('0xa'));module[_0x7813('0xb')]=function(_0x22ed9a,_0x4e6789){return _0x22ed9a['define']('SugarcrmAccount',attributes,{'tableName':_0x7813('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index f2c4c17..7569a10 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 _0x7128=['lodash','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','findAll','options','raw','attributes','limit','include','map','model','GetSugarcrmAccount','find'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7128,0x1f0));var _0x8712=function(_0xd0b415,_0x149675){_0xd0b415=_0xd0b415-0x0;var _0x2bdf2c=_0x7128[_0xd0b415];return _0x2bdf2c;};'use strict';var _=require(_0x8712('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8712('0x1'));var db=require(_0x8712('0x2'))['db'];var utils=require(_0x8712('0x3'));var logger=require(_0x8712('0x4'))(_0x8712('0x5'));var config=require(_0x8712('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8712('0x7')][_0x8712('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x16dc19,_0x7f43e9,_0x547637){return new BPromise(function(_0x552929,_0x3edd0c){return client[_0x8712('0x9')](_0x16dc19,_0x547637)[_0x8712('0xa')](function(_0x28bd9a){logger[_0x8712('0xb')](_0x8712('0xc'),_0x7f43e9,_0x8712('0xd'));logger[_0x8712('0xe')](_0x8712('0xf'),_0x7f43e9,_0x8712('0xd'),JSON[_0x8712('0x10')](_0x28bd9a));if(_0x28bd9a[_0x8712('0x11')]){if(_0x28bd9a[_0x8712('0x11')]['code']===0x1f4){logger[_0x8712('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x7f43e9,_0x28bd9a[_0x8712('0x11')][_0x8712('0x12')]);return _0x3edd0c(_0x28bd9a[_0x8712('0x11')][_0x8712('0x12')]);}logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x7f43e9,_0x28bd9a[_0x8712('0x11')]['message']);return _0x552929(_0x28bd9a[_0x8712('0x11')][_0x8712('0x12')]);}else{logger[_0x8712('0xb')](_0x8712('0xc'),_0x7f43e9,_0x8712('0xd'));_0x552929(_0x28bd9a[_0x8712('0x13')][_0x8712('0x12')]);}})[_0x8712('0x14')](function(_0x3d0aaf){logger[_0x8712('0x11')](_0x8712('0xc'),_0x7f43e9,_0x3d0aaf);_0x3edd0c(_0x3d0aaf);});});}exports['GetSugarcrmAccount']=function(_0x21fc30){var _0x5d9364=this;return new Promise(function(_0x519ba0,_0x1ab57c){return db['SugarcrmAccount'][_0x8712('0x15')]({'raw':_0x21fc30[_0x8712('0x16')]?_0x21fc30[_0x8712('0x16')][_0x8712('0x17')]===undefined?!![]:![]:!![],'where':_0x21fc30[_0x8712('0x16')]?_0x21fc30[_0x8712('0x16')]['where']||null:null,'attributes':_0x21fc30[_0x8712('0x16')]?_0x21fc30[_0x8712('0x16')][_0x8712('0x18')]||null:null,'limit':_0x21fc30['options']?_0x21fc30[_0x8712('0x16')][_0x8712('0x19')]||null:null,'include':_0x21fc30[_0x8712('0x16')]?_0x21fc30[_0x8712('0x16')][_0x8712('0x1a')]?_[_0x8712('0x1b')](_0x21fc30[_0x8712('0x16')][_0x8712('0x1a')],function(_0x973694){return{'model':db[_0x973694[_0x8712('0x1c')]],'as':_0x973694['as'],'attributes':_0x973694[_0x8712('0x18')],'include':_0x973694['include']?_[_0x8712('0x1b')](_0x973694[_0x8712('0x1a')],function(_0x436c2f){return{'model':db[_0x436c2f['model']],'as':_0x436c2f['as'],'attributes':_0x436c2f[_0x8712('0x18')],'include':_0x436c2f[_0x8712('0x1a')]?_[_0x8712('0x1b')](_0x436c2f[_0x8712('0x1a')],function(_0x17beaa){return{'model':db[_0x17beaa[_0x8712('0x1c')]],'as':_0x17beaa['as'],'attributes':_0x17beaa[_0x8712('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8712('0xa')](function(_0x153dda){logger[_0x8712('0xb')](_0x8712('0x1d'),_0x21fc30);logger['debug']('GetSugarcrmAccount',_0x21fc30,JSON['stringify'](_0x153dda));_0x519ba0(_0x153dda);})[_0x8712('0x14')](function(_0x54154d){logger['error'](_0x8712('0x1d'),_0x54154d[_0x8712('0x12')],_0x21fc30);_0x1ab57c(_0x5d9364[_0x8712('0x11')](0x1f4,_0x54154d[_0x8712('0x12')]));});});};exports['ShowSugarcrmAccount']=function(_0x2045c5){var _0x271530=this;return new Promise(function(_0x5c7e14,_0x38efaf){return db['SugarcrmAccount'][_0x8712('0x1e')]({'raw':_0x2045c5[_0x8712('0x16')]?_0x2045c5['options'][_0x8712('0x17')]===undefined?!![]:![]:!![],'where':_0x2045c5[_0x8712('0x16')]?_0x2045c5[_0x8712('0x16')]['where']||null:null,'attributes':_0x2045c5[_0x8712('0x16')]?_0x2045c5['options']['attributes']||null:null,'include':_0x2045c5['options']?_0x2045c5['options'][_0x8712('0x1a')]?_['map'](_0x2045c5[_0x8712('0x16')]['include'],function(_0x205b94){return{'model':db[_0x205b94[_0x8712('0x1c')]],'as':_0x205b94['as'],'attributes':_0x205b94[_0x8712('0x18')],'include':_0x205b94[_0x8712('0x1a')]?_[_0x8712('0x1b')](_0x205b94[_0x8712('0x1a')],function(_0x38c1fd){return{'model':db[_0x38c1fd[_0x8712('0x1c')]],'as':_0x38c1fd['as'],'attributes':_0x38c1fd[_0x8712('0x18')],'include':_0x38c1fd[_0x8712('0x1a')]?_['map'](_0x38c1fd['include'],function(_0x36fa2b){return{'model':db[_0x36fa2b[_0x8712('0x1c')]],'as':_0x36fa2b['as'],'attributes':_0x36fa2b[_0x8712('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8712('0xa')](function(_0x5cc15b){logger[_0x8712('0xb')]('ShowSugarcrmAccount',_0x2045c5);logger[_0x8712('0xe')]('ShowSugarcrmAccount',_0x2045c5,JSON[_0x8712('0x10')](_0x5cc15b));_0x5c7e14(_0x5cc15b);})['catch'](function(_0x4ea709){logger[_0x8712('0x11')]('ShowSugarcrmAccount',_0x4ea709[_0x8712('0x12')],_0x2045c5);_0x38efaf(_0x271530[_0x8712('0x11')](0x1f4,_0x4ea709[_0x8712('0x12')]));});});}; \ No newline at end of file +var _0x911d=['map','model','attributes','stringify','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','limit','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x911d,0x1cc));var _0xd911=function(_0x141cf2,_0xc262e1){_0x141cf2=_0x141cf2-0x0;var _0x44dc0b=_0x911d[_0x141cf2];return _0x44dc0b;};'use strict';var _=require(_0xd911('0x0'));var util=require(_0xd911('0x1'));var moment=require(_0xd911('0x2'));var BPromise=require(_0xd911('0x3'));var rs=require(_0xd911('0x4'));var fs=require('fs');var Redis=require(_0xd911('0x5'));var db=require(_0xd911('0x6'))['db'];var utils=require(_0xd911('0x7'));var logger=require('../../config/logger')(_0xd911('0x8'));var config=require(_0xd911('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd911('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23a806,_0x4cf84b,_0x4923e2){return new BPromise(function(_0x1a61c3,_0x103817){return client[_0xd911('0xb')](_0x23a806,_0x4923e2)[_0xd911('0xc')](function(_0x3e4040){logger[_0xd911('0xd')](_0xd911('0xe'),_0x4cf84b,'request\x20sent');logger[_0xd911('0xf')](_0xd911('0x10'),_0x4cf84b,'request\x20sent',JSON['stringify'](_0x3e4040));if(_0x3e4040[_0xd911('0x11')]){if(_0x3e4040[_0xd911('0x11')]['code']===0x1f4){logger[_0xd911('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x4cf84b,_0x3e4040[_0xd911('0x11')][_0xd911('0x12')]);return _0x103817(_0x3e4040['error']['message']);}logger[_0xd911('0x11')]('SugarcrmAccount,\x20%s,\x20%s',_0x4cf84b,_0x3e4040['error'][_0xd911('0x12')]);return _0x1a61c3(_0x3e4040[_0xd911('0x11')][_0xd911('0x12')]);}else{logger[_0xd911('0xd')](_0xd911('0xe'),_0x4cf84b,_0xd911('0x13'));_0x1a61c3(_0x3e4040[_0xd911('0x14')][_0xd911('0x12')]);}})[_0xd911('0x15')](function(_0x5b6868){logger[_0xd911('0x11')](_0xd911('0xe'),_0x4cf84b,_0x5b6868);_0x103817(_0x5b6868);});});}exports[_0xd911('0x16')]=function(_0x20922f){var _0x2a327b=this;return new Promise(function(_0x50509a,_0x59f8e3){return db[_0xd911('0x17')][_0xd911('0x18')]({'raw':_0x20922f['options']?_0x20922f[_0xd911('0x19')][_0xd911('0x1a')]===undefined?!![]:![]:!![],'where':_0x20922f[_0xd911('0x19')]?_0x20922f[_0xd911('0x19')][_0xd911('0x1b')]||null:null,'attributes':_0x20922f[_0xd911('0x19')]?_0x20922f['options']['attributes']||null:null,'limit':_0x20922f[_0xd911('0x19')]?_0x20922f[_0xd911('0x19')][_0xd911('0x1c')]||null:null,'include':_0x20922f[_0xd911('0x19')]?_0x20922f[_0xd911('0x19')][_0xd911('0x1d')]?_[_0xd911('0x1e')](_0x20922f[_0xd911('0x19')][_0xd911('0x1d')],function(_0x29617a){return{'model':db[_0x29617a[_0xd911('0x1f')]],'as':_0x29617a['as'],'attributes':_0x29617a[_0xd911('0x20')],'include':_0x29617a[_0xd911('0x1d')]?_['map'](_0x29617a[_0xd911('0x1d')],function(_0x4f463f){return{'model':db[_0x4f463f['model']],'as':_0x4f463f['as'],'attributes':_0x4f463f[_0xd911('0x20')],'include':_0x4f463f['include']?_[_0xd911('0x1e')](_0x4f463f[_0xd911('0x1d')],function(_0x5c22fc){return{'model':db[_0x5c22fc[_0xd911('0x1f')]],'as':_0x5c22fc['as'],'attributes':_0x5c22fc[_0xd911('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd911('0xc')](function(_0x57b81e){logger[_0xd911('0xd')](_0xd911('0x16'),_0x20922f);logger[_0xd911('0xf')](_0xd911('0x16'),_0x20922f,JSON[_0xd911('0x21')](_0x57b81e));_0x50509a(_0x57b81e);})[_0xd911('0x15')](function(_0x37c9a8){logger['error'](_0xd911('0x16'),_0x37c9a8[_0xd911('0x12')],_0x20922f);_0x59f8e3(_0x2a327b[_0xd911('0x11')](0x1f4,_0x37c9a8[_0xd911('0x12')]));});});};exports[_0xd911('0x22')]=function(_0x235290){var _0x5ca916=this;return new Promise(function(_0x387f32,_0x5f5983){return db[_0xd911('0x17')]['find']({'raw':_0x235290[_0xd911('0x19')]?_0x235290[_0xd911('0x19')][_0xd911('0x1a')]===undefined?!![]:![]:!![],'where':_0x235290[_0xd911('0x19')]?_0x235290[_0xd911('0x19')][_0xd911('0x1b')]||null:null,'attributes':_0x235290[_0xd911('0x19')]?_0x235290[_0xd911('0x19')][_0xd911('0x20')]||null:null,'include':_0x235290[_0xd911('0x19')]?_0x235290[_0xd911('0x19')][_0xd911('0x1d')]?_[_0xd911('0x1e')](_0x235290[_0xd911('0x19')][_0xd911('0x1d')],function(_0x18dbda){return{'model':db[_0x18dbda[_0xd911('0x1f')]],'as':_0x18dbda['as'],'attributes':_0x18dbda['attributes'],'include':_0x18dbda[_0xd911('0x1d')]?_[_0xd911('0x1e')](_0x18dbda[_0xd911('0x1d')],function(_0x453b82){return{'model':db[_0x453b82[_0xd911('0x1f')]],'as':_0x453b82['as'],'attributes':_0x453b82[_0xd911('0x20')],'include':_0x453b82['include']?_[_0xd911('0x1e')](_0x453b82[_0xd911('0x1d')],function(_0x33a87a){return{'model':db[_0x33a87a['model']],'as':_0x33a87a['as'],'attributes':_0x33a87a['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x7d0d7f){logger[_0xd911('0xd')](_0xd911('0x22'),_0x235290);logger[_0xd911('0xf')](_0xd911('0x22'),_0x235290,JSON[_0xd911('0x21')](_0x7d0d7f));_0x387f32(_0x7d0d7f);})['catch'](function(_0x4958b0){logger[_0xd911('0x11')](_0xd911('0x22'),_0x4958b0['message'],_0x235290);_0x5f5983(_0x5ca916[_0xd911('0x11')](0x1f4,_0x4958b0[_0xd911('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 8bcfd51..6cf2e04 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 _0x0164=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy','exports','multer','path','connect-timeout'];(function(_0xd816e2,_0x5edac2){var _0x1f5924=function(_0x1bcbf0){while(--_0x1bcbf0){_0xd816e2['push'](_0xd816e2['shift']());}};_0x1f5924(++_0x5edac2);}(_0x0164,0x11d));var _0x4016=function(_0x4cb095,_0x58da07){_0x4cb095=_0x4cb095-0x0;var _0x2b565d=_0x0164[_0x4cb095];return _0x2b565d;};'use strict';var multer=require(_0x4016('0x0'));var util=require('util');var path=require(_0x4016('0x1'));var timeout=require(_0x4016('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4016('0x3'));var auth=require(_0x4016('0x4'));var interaction=require(_0x4016('0x5'));var config=require(_0x4016('0x6'));var controller=require(_0x4016('0x7'));router[_0x4016('0x8')]('/',auth[_0x4016('0x9')](),controller[_0x4016('0xa')]);router['get'](_0x4016('0xb'),auth[_0x4016('0x9')](),controller[_0x4016('0xc')]);router[_0x4016('0x8')](_0x4016('0xd'),auth[_0x4016('0x9')](),controller[_0x4016('0xe')]);router[_0x4016('0x8')](_0x4016('0xf'),auth[_0x4016('0x9')](),controller['getSubjects']);router[_0x4016('0x8')](_0x4016('0x10'),auth[_0x4016('0x9')](),controller[_0x4016('0x11')]);router[_0x4016('0x12')]('/',auth['isAuthenticated'](),controller[_0x4016('0x13')]);router[_0x4016('0x14')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x4016('0x15')]('/:id',auth[_0x4016('0x9')](),controller[_0x4016('0x16')]);module[_0x4016('0x17')]=router; \ No newline at end of file +var _0x8e93=['getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields'];(function(_0x3f8f82,_0x18e12c){var _0x1efdf7=function(_0x57eb45){while(--_0x57eb45){_0x3f8f82['push'](_0x3f8f82['shift']());}};_0x1efdf7(++_0x18e12c);}(_0x8e93,0x1b2));var _0x38e9=function(_0x2dffe9,_0x1a20f0){_0x2dffe9=_0x2dffe9-0x0;var _0x562520=_0x8e93[_0x2dffe9];return _0x562520;};'use strict';var multer=require(_0x38e9('0x0'));var util=require(_0x38e9('0x1'));var path=require(_0x38e9('0x2'));var timeout=require(_0x38e9('0x3'));var express=require(_0x38e9('0x4'));var router=express[_0x38e9('0x5')]();var fs_extra=require(_0x38e9('0x6'));var auth=require(_0x38e9('0x7'));var interaction=require(_0x38e9('0x8'));var config=require('../../config/environment');var controller=require(_0x38e9('0x9'));router['get']('/',auth[_0x38e9('0xa')](),controller[_0x38e9('0xb')]);router[_0x38e9('0xc')](_0x38e9('0xd'),auth[_0x38e9('0xa')](),controller[_0x38e9('0xe')]);router[_0x38e9('0xc')](_0x38e9('0xf'),auth['isAuthenticated'](),controller[_0x38e9('0x10')]);router[_0x38e9('0xc')](_0x38e9('0x11'),auth[_0x38e9('0xa')](),controller[_0x38e9('0x12')]);router[_0x38e9('0xc')]('/:id/descriptions',auth[_0x38e9('0xa')](),controller[_0x38e9('0x13')]);router[_0x38e9('0x14')]('/',auth[_0x38e9('0xa')](),controller[_0x38e9('0x15')]);router[_0x38e9('0x16')](_0x38e9('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x38e9('0xd'),auth[_0x38e9('0xa')](),controller[_0x38e9('0x17')]);module[_0x38e9('0x18')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index a471edb..19f551a 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 _0x1a80=['STRING'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0x1a80,0xf2));var _0x01a8=function(_0x1791db,_0x26c9e4){_0x1791db=_0x1791db-0x0;var _0x276952=_0x1a80[_0x1791db];return _0x276952;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x01a8('0x0')]},'description':{'type':Sequelize[_0x01a8('0x0')]}}; \ No newline at end of file +var _0x253b=['exports','sequelize'];(function(_0x5ad07c,_0x324dcd){var _0x204bae=function(_0x1245bc){while(--_0x1245bc){_0x5ad07c['push'](_0x5ad07c['shift']());}};_0x204bae(++_0x324dcd);}(_0x253b,0x16d));var _0xb253=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x253b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xb253('0x0'));module[_0xb253('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index 27a1522..8069864 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 _0xf0e4=['create','body','destroy','SugarcrmField','rawAttributes','options','getFields','nolimit','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','SugarcrmConfiguration','includeAll','findAll','catch','show','params','filters','attributes','include','find'];(function(_0x403fc7,_0x32931a){var _0x5d0827=function(_0x5ea698){while(--_0x5ea698){_0x403fc7['push'](_0x403fc7['shift']());}};_0x5d0827(++_0x32931a);}(_0xf0e4,0x104));var _0x4f0e=function(_0x234eb9,_0x5e0645){_0x234eb9=_0x234eb9-0x0;var _0x47d806=_0xf0e4[_0x234eb9];return _0x47d806;};'use strict';var emlformat=require(_0x4f0e('0x0'));var rimraf=require(_0x4f0e('0x1'));var zipdir=require(_0x4f0e('0x2'));var jsonpatch=require(_0x4f0e('0x3'));var rp=require(_0x4f0e('0x4'));var moment=require(_0x4f0e('0x5'));var BPromise=require(_0x4f0e('0x6'));var Mustache=require(_0x4f0e('0x7'));var util=require(_0x4f0e('0x8'));var path=require(_0x4f0e('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4f0e('0xa'));var fs=require('fs');var fs_extra=require(_0x4f0e('0xb'));var _=require('lodash');var squel=require(_0x4f0e('0xc'));var crypto=require('crypto');var jsforce=require(_0x4f0e('0xd'));var deskjs=require(_0x4f0e('0xe'));var toCsv=require(_0x4f0e('0xf'));var querystring=require(_0x4f0e('0x10'));var Papa=require(_0x4f0e('0x11'));var Redis=require('ioredis');var authService=require(_0x4f0e('0x12'));var qs=require(_0x4f0e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f0e('0x14'));var logger=require(_0x4f0e('0x15'))(_0x4f0e('0x16'));var utils=require('../../config/utils');var config=require(_0x4f0e('0x17'));var licenseUtil=require(_0x4f0e('0x18'));var db=require(_0x4f0e('0x19'))['db'];function respondWithStatusCode(_0x5f2a72,_0x87ccdf){_0x87ccdf=_0x87ccdf||0xcc;return function(_0x3bb93d){if(_0x3bb93d){return _0x5f2a72[_0x4f0e('0x1a')](_0x87ccdf);}return _0x5f2a72['status'](_0x87ccdf)['end']();};}function respondWithResult(_0x215b8f,_0x39d3fb){_0x39d3fb=_0x39d3fb||0xc8;return function(_0x499662){if(_0x499662){return _0x215b8f[_0x4f0e('0x1b')](_0x39d3fb)[_0x4f0e('0x1c')](_0x499662);}};}function respondWithFilteredResult(_0x3c6c1d,_0x304c0e){return function(_0x50ecaf){if(_0x50ecaf){var _0x3ff57f=typeof _0x304c0e[_0x4f0e('0x1d')]==='undefined'&&typeof _0x304c0e[_0x4f0e('0x1e')]===_0x4f0e('0x1f');var _0x4c9fa8=_0x50ecaf[_0x4f0e('0x20')];var _0x27c20b=_0x3ff57f?0x0:_0x304c0e['offset'];var _0x97d57a=_0x3ff57f?_0x50ecaf[_0x4f0e('0x20')]:_0x304c0e[_0x4f0e('0x1d')]+_0x304c0e[_0x4f0e('0x1e')];var _0x3e4ad1;if(_0x97d57a>=_0x4c9fa8){_0x97d57a=_0x4c9fa8;_0x3e4ad1=0xc8;}else{_0x3e4ad1=0xce;}_0x3c6c1d[_0x4f0e('0x1b')](_0x3e4ad1);return _0x3c6c1d[_0x4f0e('0x21')](_0x4f0e('0x22'),_0x27c20b+'-'+_0x97d57a+'/'+_0x4c9fa8)[_0x4f0e('0x1c')](_0x50ecaf);}return null;};}function patchUpdates(_0x43f311){return function(_0x2d1946){try{jsonpatch[_0x4f0e('0x23')](_0x2d1946,_0x43f311,!![]);}catch(_0x3984dc){return BPromise[_0x4f0e('0x24')](_0x3984dc);}return _0x2d1946[_0x4f0e('0x25')]();};}function saveUpdates(_0x203337,_0x2158ca){return function(_0xdc3b62){if(_0xdc3b62){return _0xdc3b62[_0x4f0e('0x26')](_0x203337)[_0x4f0e('0x27')](function(_0x3fd79c){return _0x3fd79c;});}return null;};}function removeEntity(_0xa019e0,_0x3040b5){return function(_0x4981ea){if(_0x4981ea){return _0x4981ea['destroy']()['then'](function(){_0xa019e0[_0x4f0e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b16e9,_0x5f0e83){return function(_0x108532){if(!_0x108532){_0x3b16e9['sendStatus'](0x194);}return _0x108532;};}function handleError(_0x365186,_0x2df788){_0x2df788=_0x2df788||0x1f4;return function(_0x2ae716){logger[_0x4f0e('0x28')](_0x2ae716[_0x4f0e('0x29')]);if(_0x2ae716[_0x4f0e('0x2a')]){delete _0x2ae716['name'];}_0x365186['status'](_0x2df788)[_0x4f0e('0x2b')](_0x2ae716);};}exports[_0x4f0e('0x2c')]=function(_0x329208,_0x102b87){var _0x219181={},_0x57d567={},_0x58fb38={'count':0x0,'rows':[]};var _0x4ac5fb=_[_0x4f0e('0x2d')](db['SugarcrmConfiguration']['rawAttributes'],function(_0x464215){return{'name':_0x464215[_0x4f0e('0x2e')],'type':_0x464215[_0x4f0e('0x2f')][_0x4f0e('0x30')]};});_0x57d567[_0x4f0e('0x31')]=_['map'](_0x4ac5fb,_0x4f0e('0x2a'));_0x57d567[_0x4f0e('0x32')]=_[_0x4f0e('0x33')](_0x329208['query']);_0x57d567['filters']=_[_0x4f0e('0x34')](_0x57d567[_0x4f0e('0x31')],_0x57d567[_0x4f0e('0x32')]);_0x219181['attributes']=_[_0x4f0e('0x34')](_0x57d567[_0x4f0e('0x31')],qs['fields'](_0x329208['query'][_0x4f0e('0x35')]));_0x219181['attributes']=_0x219181['attributes'][_0x4f0e('0x36')]?_0x219181['attributes']:_0x57d567[_0x4f0e('0x31')];if(!_0x329208['query'][_0x4f0e('0x37')]('nolimit')){_0x219181[_0x4f0e('0x1e')]=qs[_0x4f0e('0x1e')](_0x329208['query'][_0x4f0e('0x1e')]);_0x219181['offset']=qs[_0x4f0e('0x1d')](_0x329208[_0x4f0e('0x32')][_0x4f0e('0x1d')]);}_0x219181[_0x4f0e('0x38')]=qs[_0x4f0e('0x39')](_0x329208[_0x4f0e('0x32')][_0x4f0e('0x39')]);_0x219181[_0x4f0e('0x3a')]=qs['filters'](_[_0x4f0e('0x3b')](_0x329208[_0x4f0e('0x32')],_0x57d567['filters']),_0x4ac5fb);if(_0x329208[_0x4f0e('0x32')][_0x4f0e('0x3c')]){_0x219181['where']=_[_0x4f0e('0x3d')](_0x219181[_0x4f0e('0x3a')],{'$or':_[_0x4f0e('0x2d')](_0x4ac5fb,function(_0x4ee69e){if(_0x4ee69e[_0x4f0e('0x2f')]!=='VIRTUAL'){var _0x37f801={};_0x37f801[_0x4ee69e[_0x4f0e('0x2a')]]={'$like':'%'+_0x329208[_0x4f0e('0x32')][_0x4f0e('0x3c')]+'%'};return _0x37f801;}})});}_0x219181=_[_0x4f0e('0x3d')]({},_0x219181,_0x329208['options']);var _0x2f6052={'where':_0x219181[_0x4f0e('0x3a')]};return db[_0x4f0e('0x3e')][_0x4f0e('0x20')](_0x2f6052)[_0x4f0e('0x27')](function(_0x33e6fc){_0x58fb38[_0x4f0e('0x20')]=_0x33e6fc;if(_0x329208[_0x4f0e('0x32')][_0x4f0e('0x3f')]){_0x219181['include']=[{'all':!![]}];}return db[_0x4f0e('0x3e')][_0x4f0e('0x40')](_0x219181);})[_0x4f0e('0x27')](function(_0x319222){_0x58fb38['rows']=_0x319222;return _0x58fb38;})[_0x4f0e('0x27')](respondWithFilteredResult(_0x102b87,_0x219181))[_0x4f0e('0x41')](handleError(_0x102b87,null));};exports[_0x4f0e('0x42')]=function(_0x19a4a6,_0x4d596f){var _0xf25dbd={'raw':![],'where':{'id':_0x19a4a6[_0x4f0e('0x43')]['id']}},_0x151172={};_0x151172[_0x4f0e('0x31')]=_[_0x4f0e('0x33')](db[_0x4f0e('0x3e')]['rawAttributes']);_0x151172[_0x4f0e('0x32')]=_['keys'](_0x19a4a6[_0x4f0e('0x32')]);_0x151172[_0x4f0e('0x44')]=_[_0x4f0e('0x34')](_0x151172[_0x4f0e('0x31')],_0x151172[_0x4f0e('0x32')]);_0xf25dbd[_0x4f0e('0x45')]=_['intersection'](_0x151172[_0x4f0e('0x31')],qs['fields'](_0x19a4a6['query'][_0x4f0e('0x35')]));_0xf25dbd[_0x4f0e('0x45')]=_0xf25dbd[_0x4f0e('0x45')][_0x4f0e('0x36')]?_0xf25dbd['attributes']:_0x151172['model'];if(_0x19a4a6[_0x4f0e('0x32')]['includeAll']){_0xf25dbd[_0x4f0e('0x46')]=[{'all':!![]}];}_0xf25dbd=_[_0x4f0e('0x3d')]({},_0xf25dbd,_0x19a4a6['options']);return db['SugarcrmConfiguration'][_0x4f0e('0x47')](_0xf25dbd)[_0x4f0e('0x27')](handleEntityNotFound(_0x4d596f,null))[_0x4f0e('0x27')](respondWithResult(_0x4d596f,null))[_0x4f0e('0x41')](handleError(_0x4d596f,null));};exports[_0x4f0e('0x48')]=function(_0x23daaa,_0x51f333){return db[_0x4f0e('0x3e')][_0x4f0e('0x48')](_0x23daaa[_0x4f0e('0x49')],{})['then'](respondWithResult(_0x51f333,0xc9))[_0x4f0e('0x41')](handleError(_0x51f333,null));};exports[_0x4f0e('0x26')]=function(_0x111d83,_0x493adf){if(_0x111d83['body']['id']){delete _0x111d83[_0x4f0e('0x49')]['id'];}return db[_0x4f0e('0x3e')][_0x4f0e('0x47')]({'where':{'id':_0x111d83[_0x4f0e('0x43')]['id']}})[_0x4f0e('0x27')](handleEntityNotFound(_0x493adf,null))[_0x4f0e('0x27')](saveUpdates(_0x111d83['body'],null))[_0x4f0e('0x27')](respondWithResult(_0x493adf,null))[_0x4f0e('0x41')](handleError(_0x493adf,null));};exports[_0x4f0e('0x4a')]=function(_0x38e1d8,_0x2c89eb){return db[_0x4f0e('0x3e')][_0x4f0e('0x47')]({'where':{'id':_0x38e1d8[_0x4f0e('0x43')]['id']}})[_0x4f0e('0x27')](handleEntityNotFound(_0x2c89eb,null))[_0x4f0e('0x27')](removeEntity(_0x2c89eb,null))[_0x4f0e('0x41')](handleError(_0x2c89eb,null));};exports['getFields']=function(_0x35d7ca,_0x1de1ca,_0x2df52a){var _0x4ee7c6={};var _0x4177eb={};var _0x60ea6c;var _0x529aa7;return db[_0x4f0e('0x3e')]['findOne']({'where':{'id':_0x35d7ca['params']['id']}})[_0x4f0e('0x27')](handleEntityNotFound(_0x1de1ca,null))[_0x4f0e('0x27')](function(_0x42ac4f){if(_0x42ac4f){_0x60ea6c=_0x42ac4f;_0x4177eb[_0x4f0e('0x31')]=_['keys'](db[_0x4f0e('0x4b')][_0x4f0e('0x4c')]);_0x4177eb[_0x4f0e('0x32')]=_[_0x4f0e('0x33')](_0x35d7ca['query']);_0x4177eb[_0x4f0e('0x44')]=_[_0x4f0e('0x34')](_0x4177eb[_0x4f0e('0x31')],_0x4177eb[_0x4f0e('0x32')]);_0x4ee7c6[_0x4f0e('0x45')]=_[_0x4f0e('0x34')](_0x4177eb[_0x4f0e('0x31')],qs[_0x4f0e('0x35')](_0x35d7ca['query'][_0x4f0e('0x35')]));_0x4ee7c6[_0x4f0e('0x45')]=_0x4ee7c6[_0x4f0e('0x45')][_0x4f0e('0x36')]?_0x4ee7c6[_0x4f0e('0x45')]:_0x4177eb['model'];_0x4ee7c6[_0x4f0e('0x38')]=qs[_0x4f0e('0x39')](_0x35d7ca['query']['sort']);_0x4ee7c6['where']=qs['filters'](_['pick'](_0x35d7ca[_0x4f0e('0x32')],_0x4177eb[_0x4f0e('0x44')]));if(_0x35d7ca[_0x4f0e('0x32')]['filter']){_0x4ee7c6[_0x4f0e('0x3a')]=_[_0x4f0e('0x3d')](_0x4ee7c6[_0x4f0e('0x3a')],{'$or':_[_0x4f0e('0x2d')](_0x4ee7c6[_0x4f0e('0x45')],function(_0x1bb787){var _0x501856={};_0x501856[_0x1bb787]={'$like':'%'+_0x35d7ca[_0x4f0e('0x32')][_0x4f0e('0x3c')]+'%'};return _0x501856;})});}_0x4ee7c6=_[_0x4f0e('0x3d')]({},_0x4ee7c6,_0x35d7ca[_0x4f0e('0x4d')]);return _0x60ea6c[_0x4f0e('0x4e')](_0x4ee7c6);}})[_0x4f0e('0x27')](function(_0x6a8cce){if(_0x6a8cce){_0x529aa7=_0x6a8cce[_0x4f0e('0x36')];if(!_0x35d7ca['query'][_0x4f0e('0x37')](_0x4f0e('0x4f'))){_0x4ee7c6[_0x4f0e('0x1e')]=qs[_0x4f0e('0x1e')](_0x35d7ca[_0x4f0e('0x32')][_0x4f0e('0x1e')]);_0x4ee7c6[_0x4f0e('0x1d')]=qs[_0x4f0e('0x1d')](_0x35d7ca['query'][_0x4f0e('0x1d')]);}return _0x60ea6c['getFields'](_0x4ee7c6);}})[_0x4f0e('0x27')](function(_0x266123){if(_0x266123){return _0x266123?{'count':_0x529aa7,'rows':_0x266123}:null;}})[_0x4f0e('0x27')](respondWithResult(_0x1de1ca,null))[_0x4f0e('0x41')](handleError(_0x1de1ca,null));};exports[_0x4f0e('0x50')]=function(_0x505245,_0xee8bcd,_0x372b16){var _0x596262={};var _0xec153a={};var _0x104e02;var _0x19cb45;return db['SugarcrmConfiguration'][_0x4f0e('0x51')]({'where':{'id':_0x505245[_0x4f0e('0x43')]['id']}})[_0x4f0e('0x27')](handleEntityNotFound(_0xee8bcd,null))[_0x4f0e('0x27')](function(_0xf6b1aa){if(_0xf6b1aa){_0x104e02=_0xf6b1aa;_0xec153a[_0x4f0e('0x31')]=_[_0x4f0e('0x33')](db['SugarcrmField'][_0x4f0e('0x4c')]);_0xec153a[_0x4f0e('0x32')]=_[_0x4f0e('0x33')](_0x505245['query']);_0xec153a[_0x4f0e('0x44')]=_[_0x4f0e('0x34')](_0xec153a[_0x4f0e('0x31')],_0xec153a[_0x4f0e('0x32')]);_0x596262[_0x4f0e('0x45')]=_[_0x4f0e('0x34')](_0xec153a[_0x4f0e('0x31')],qs[_0x4f0e('0x35')](_0x505245[_0x4f0e('0x32')]['fields']));_0x596262['attributes']=_0x596262['attributes']['length']?_0x596262[_0x4f0e('0x45')]:_0xec153a[_0x4f0e('0x31')];_0x596262[_0x4f0e('0x38')]=qs[_0x4f0e('0x39')](_0x505245[_0x4f0e('0x32')]['sort']);_0x596262[_0x4f0e('0x3a')]=qs[_0x4f0e('0x44')](_[_0x4f0e('0x3b')](_0x505245[_0x4f0e('0x32')],_0xec153a['filters']));if(_0x505245[_0x4f0e('0x32')][_0x4f0e('0x3c')]){_0x596262['where']=_[_0x4f0e('0x3d')](_0x596262[_0x4f0e('0x3a')],{'$or':_[_0x4f0e('0x2d')](_0x596262[_0x4f0e('0x45')],function(_0x26a71b){var _0x1f558d={};_0x1f558d[_0x26a71b]={'$like':'%'+_0x505245[_0x4f0e('0x32')][_0x4f0e('0x3c')]+'%'};return _0x1f558d;})});}_0x596262=_[_0x4f0e('0x3d')]({},_0x596262,_0x505245['options']);return _0x104e02[_0x4f0e('0x50')](_0x596262);}})[_0x4f0e('0x27')](function(_0x5a0c06){if(_0x5a0c06){_0x19cb45=_0x5a0c06['length'];if(!_0x505245['query'][_0x4f0e('0x37')](_0x4f0e('0x4f'))){_0x596262[_0x4f0e('0x1e')]=qs['limit'](_0x505245[_0x4f0e('0x32')]['limit']);_0x596262[_0x4f0e('0x1d')]=qs[_0x4f0e('0x1d')](_0x505245[_0x4f0e('0x32')][_0x4f0e('0x1d')]);}return _0x104e02[_0x4f0e('0x50')](_0x596262);}})[_0x4f0e('0x27')](function(_0x49c4e0){if(_0x49c4e0){return _0x49c4e0?{'count':_0x19cb45,'rows':_0x49c4e0}:null;}})[_0x4f0e('0x27')](respondWithResult(_0xee8bcd,null))[_0x4f0e('0x41')](handleError(_0xee8bcd,null));};exports[_0x4f0e('0x52')]=function(_0x241656,_0x27aac9,_0x41b315){var _0x2cf658={};var _0x28eb69={};var _0x47c412;var _0x42f9e5;return db[_0x4f0e('0x3e')][_0x4f0e('0x51')]({'where':{'id':_0x241656['params']['id']}})[_0x4f0e('0x27')](handleEntityNotFound(_0x27aac9,null))['then'](function(_0x3fdbfe){if(_0x3fdbfe){_0x47c412=_0x3fdbfe;_0x28eb69[_0x4f0e('0x31')]=_['keys'](db[_0x4f0e('0x4b')][_0x4f0e('0x4c')]);_0x28eb69[_0x4f0e('0x32')]=_[_0x4f0e('0x33')](_0x241656[_0x4f0e('0x32')]);_0x28eb69[_0x4f0e('0x44')]=_[_0x4f0e('0x34')](_0x28eb69[_0x4f0e('0x31')],_0x28eb69[_0x4f0e('0x32')]);_0x2cf658[_0x4f0e('0x45')]=_[_0x4f0e('0x34')](_0x28eb69[_0x4f0e('0x31')],qs[_0x4f0e('0x35')](_0x241656[_0x4f0e('0x32')]['fields']));_0x2cf658[_0x4f0e('0x45')]=_0x2cf658[_0x4f0e('0x45')][_0x4f0e('0x36')]?_0x2cf658[_0x4f0e('0x45')]:_0x28eb69['model'];_0x2cf658[_0x4f0e('0x38')]=qs[_0x4f0e('0x39')](_0x241656['query'][_0x4f0e('0x39')]);_0x2cf658[_0x4f0e('0x3a')]=qs[_0x4f0e('0x44')](_['pick'](_0x241656[_0x4f0e('0x32')],_0x28eb69[_0x4f0e('0x44')]));if(_0x241656[_0x4f0e('0x32')][_0x4f0e('0x3c')]){_0x2cf658['where']=_['merge'](_0x2cf658[_0x4f0e('0x3a')],{'$or':_['map'](_0x2cf658[_0x4f0e('0x45')],function(_0x43234c){var _0x38a0e5={};_0x38a0e5[_0x43234c]={'$like':'%'+_0x241656[_0x4f0e('0x32')]['filter']+'%'};return _0x38a0e5;})});}_0x2cf658=_[_0x4f0e('0x3d')]({},_0x2cf658,_0x241656['options']);return _0x47c412[_0x4f0e('0x52')](_0x2cf658);}})[_0x4f0e('0x27')](function(_0x5b79f9){if(_0x5b79f9){_0x42f9e5=_0x5b79f9[_0x4f0e('0x36')];if(!_0x241656[_0x4f0e('0x32')][_0x4f0e('0x37')]('nolimit')){_0x2cf658[_0x4f0e('0x1e')]=qs[_0x4f0e('0x1e')](_0x241656[_0x4f0e('0x32')][_0x4f0e('0x1e')]);_0x2cf658[_0x4f0e('0x1d')]=qs[_0x4f0e('0x1d')](_0x241656[_0x4f0e('0x32')][_0x4f0e('0x1d')]);}return _0x47c412[_0x4f0e('0x52')](_0x2cf658);}})[_0x4f0e('0x27')](function(_0x2418f3){if(_0x2418f3){return _0x2418f3?{'count':_0x42f9e5,'rows':_0x2418f3}:null;}})[_0x4f0e('0x27')](respondWithResult(_0x27aac9,null))[_0x4f0e('0x41')](handleError(_0x27aac9,null));}; \ No newline at end of file +var _0x9a86=['../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','save','then','sendStatus','error','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','length','nolimit','order','sort','where','pick','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','fields','options','find','create','body','destroy','getFields','findOne','filter','hasOwnProperty','getSubjects','SugarcrmField','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','fs-extra','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs'];(function(_0x4b174a,_0x33a017){var _0x3cd7bf=function(_0x44ccd9){while(--_0x44ccd9){_0x4b174a['push'](_0x4b174a['shift']());}};_0x3cd7bf(++_0x33a017);}(_0x9a86,0x124));var _0x69a8=function(_0x7275e9,_0x321fa5){_0x7275e9=_0x7275e9-0x0;var _0x17b99d=_0x9a86[_0x7275e9];return _0x17b99d;};'use strict';var emlformat=require(_0x69a8('0x0'));var rimraf=require(_0x69a8('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x69a8('0x2'));var rp=require(_0x69a8('0x3'));var moment=require(_0x69a8('0x4'));var BPromise=require(_0x69a8('0x5'));var Mustache=require(_0x69a8('0x6'));var util=require(_0x69a8('0x7'));var path=require('path');var sox=require(_0x69a8('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x69a8('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x69a8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x69a8('0xb'));var toCsv=require('to-csv');var querystring=require(_0x69a8('0xc'));var Papa=require(_0x69a8('0xd'));var Redis=require('ioredis');var authService=require(_0x69a8('0xe'));var qs=require(_0x69a8('0xf'));var as=require(_0x69a8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x69a8('0x11'))(_0x69a8('0x12'));var utils=require(_0x69a8('0x13'));var config=require(_0x69a8('0x14'));var licenseUtil=require(_0x69a8('0x15'));var db=require(_0x69a8('0x16'))['db'];function respondWithStatusCode(_0x50113c,_0x3d2ce9){_0x3d2ce9=_0x3d2ce9||0xcc;return function(_0x29da4e){if(_0x29da4e){return _0x50113c['sendStatus'](_0x3d2ce9);}return _0x50113c['status'](_0x3d2ce9)[_0x69a8('0x17')]();};}function respondWithResult(_0x1028d4,_0x58d30f){_0x58d30f=_0x58d30f||0xc8;return function(_0xb5ba49){if(_0xb5ba49){return _0x1028d4[_0x69a8('0x18')](_0x58d30f)[_0x69a8('0x19')](_0xb5ba49);}};}function respondWithFilteredResult(_0x28eacb,_0x1e0a67){return function(_0x2909f2){if(_0x2909f2){var _0x387248=typeof _0x1e0a67[_0x69a8('0x1a')]===_0x69a8('0x1b')&&typeof _0x1e0a67[_0x69a8('0x1c')]==='undefined';var _0x4fe3e2=_0x2909f2['count'];var _0x375565=_0x387248?0x0:_0x1e0a67[_0x69a8('0x1a')];var _0x37dc26=_0x387248?_0x2909f2[_0x69a8('0x1d')]:_0x1e0a67[_0x69a8('0x1a')]+_0x1e0a67[_0x69a8('0x1c')];var _0x4a6248;if(_0x37dc26>=_0x4fe3e2){_0x37dc26=_0x4fe3e2;_0x4a6248=0xc8;}else{_0x4a6248=0xce;}_0x28eacb[_0x69a8('0x18')](_0x4a6248);return _0x28eacb['set']('Content-Range',_0x375565+'-'+_0x37dc26+'/'+_0x4fe3e2)['json'](_0x2909f2);}return null;};}function patchUpdates(_0x538307){return function(_0x28b941){try{jsonpatch[_0x69a8('0x1e')](_0x28b941,_0x538307,!![]);}catch(_0x167599){return BPromise[_0x69a8('0x1f')](_0x167599);}return _0x28b941[_0x69a8('0x20')]();};}function saveUpdates(_0x235ca1,_0x4e33fb){return function(_0x2916c5){if(_0x2916c5){return _0x2916c5['update'](_0x235ca1)['then'](function(_0x1515ee){return _0x1515ee;});}return null;};}function removeEntity(_0x144710,_0x26c3e9){return function(_0x59692a){if(_0x59692a){return _0x59692a['destroy']()[_0x69a8('0x21')](function(){_0x144710['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x195d97,_0x446dfc){return function(_0x1fe5d6){if(!_0x1fe5d6){_0x195d97[_0x69a8('0x22')](0x194);}return _0x1fe5d6;};}function handleError(_0x1282aa,_0x852d43){_0x852d43=_0x852d43||0x1f4;return function(_0x53309c){logger[_0x69a8('0x23')](_0x53309c['stack']);if(_0x53309c[_0x69a8('0x24')]){delete _0x53309c['name'];}_0x1282aa[_0x69a8('0x18')](_0x852d43)[_0x69a8('0x25')](_0x53309c);};}exports['index']=function(_0x4243a9,_0x420e9e){var _0x41fc3b={},_0x2f1a2d={},_0x369abf={'count':0x0,'rows':[]};var _0x43ac77=_[_0x69a8('0x26')](db[_0x69a8('0x27')][_0x69a8('0x28')],function(_0x116968){return{'name':_0x116968[_0x69a8('0x29')],'type':_0x116968[_0x69a8('0x2a')]['key']};});_0x2f1a2d[_0x69a8('0x2b')]=_[_0x69a8('0x26')](_0x43ac77,_0x69a8('0x24'));_0x2f1a2d[_0x69a8('0x2c')]=_['keys'](_0x4243a9[_0x69a8('0x2c')]);_0x2f1a2d[_0x69a8('0x2d')]=_['intersection'](_0x2f1a2d['model'],_0x2f1a2d[_0x69a8('0x2c')]);_0x41fc3b[_0x69a8('0x2e')]=_[_0x69a8('0x2f')](_0x2f1a2d[_0x69a8('0x2b')],qs['fields'](_0x4243a9[_0x69a8('0x2c')]['fields']));_0x41fc3b[_0x69a8('0x2e')]=_0x41fc3b[_0x69a8('0x2e')][_0x69a8('0x30')]?_0x41fc3b[_0x69a8('0x2e')]:_0x2f1a2d[_0x69a8('0x2b')];if(!_0x4243a9[_0x69a8('0x2c')]['hasOwnProperty'](_0x69a8('0x31'))){_0x41fc3b[_0x69a8('0x1c')]=qs['limit'](_0x4243a9[_0x69a8('0x2c')][_0x69a8('0x1c')]);_0x41fc3b[_0x69a8('0x1a')]=qs[_0x69a8('0x1a')](_0x4243a9[_0x69a8('0x2c')]['offset']);}_0x41fc3b[_0x69a8('0x32')]=qs[_0x69a8('0x33')](_0x4243a9[_0x69a8('0x2c')][_0x69a8('0x33')]);_0x41fc3b[_0x69a8('0x34')]=qs[_0x69a8('0x2d')](_[_0x69a8('0x35')](_0x4243a9[_0x69a8('0x2c')],_0x2f1a2d['filters']),_0x43ac77);if(_0x4243a9[_0x69a8('0x2c')]['filter']){_0x41fc3b['where']=_[_0x69a8('0x36')](_0x41fc3b[_0x69a8('0x34')],{'$or':_[_0x69a8('0x26')](_0x43ac77,function(_0x8e0607){if(_0x8e0607['type']!==_0x69a8('0x37')){var _0x1ab4b4={};_0x1ab4b4[_0x8e0607['name']]={'$like':'%'+_0x4243a9[_0x69a8('0x2c')]['filter']+'%'};return _0x1ab4b4;}})});}_0x41fc3b=_[_0x69a8('0x36')]({},_0x41fc3b,_0x4243a9['options']);var _0x799f5a={'where':_0x41fc3b['where']};return db[_0x69a8('0x27')][_0x69a8('0x1d')](_0x799f5a)[_0x69a8('0x21')](function(_0x2d0056){_0x369abf[_0x69a8('0x1d')]=_0x2d0056;if(_0x4243a9[_0x69a8('0x2c')][_0x69a8('0x38')]){_0x41fc3b[_0x69a8('0x39')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0x69a8('0x3a')](_0x41fc3b);})['then'](function(_0x44065f){_0x369abf[_0x69a8('0x3b')]=_0x44065f;return _0x369abf;})[_0x69a8('0x21')](respondWithFilteredResult(_0x420e9e,_0x41fc3b))[_0x69a8('0x3c')](handleError(_0x420e9e,null));};exports[_0x69a8('0x3d')]=function(_0xaee7ff,_0x507727){var _0x33aeec={'raw':![],'where':{'id':_0xaee7ff[_0x69a8('0x3e')]['id']}},_0x426101={};_0x426101['model']=_[_0x69a8('0x3f')](db[_0x69a8('0x27')][_0x69a8('0x28')]);_0x426101[_0x69a8('0x2c')]=_[_0x69a8('0x3f')](_0xaee7ff['query']);_0x426101[_0x69a8('0x2d')]=_[_0x69a8('0x2f')](_0x426101[_0x69a8('0x2b')],_0x426101[_0x69a8('0x2c')]);_0x33aeec[_0x69a8('0x2e')]=_['intersection'](_0x426101['model'],qs[_0x69a8('0x40')](_0xaee7ff[_0x69a8('0x2c')][_0x69a8('0x40')]));_0x33aeec['attributes']=_0x33aeec[_0x69a8('0x2e')]['length']?_0x33aeec['attributes']:_0x426101['model'];if(_0xaee7ff[_0x69a8('0x2c')]['includeAll']){_0x33aeec['include']=[{'all':!![]}];}_0x33aeec=_[_0x69a8('0x36')]({},_0x33aeec,_0xaee7ff[_0x69a8('0x41')]);return db[_0x69a8('0x27')][_0x69a8('0x42')](_0x33aeec)['then'](handleEntityNotFound(_0x507727,null))[_0x69a8('0x21')](respondWithResult(_0x507727,null))['catch'](handleError(_0x507727,null));};exports[_0x69a8('0x43')]=function(_0x240959,_0x35a487){return db[_0x69a8('0x27')][_0x69a8('0x43')](_0x240959[_0x69a8('0x44')],{})[_0x69a8('0x21')](respondWithResult(_0x35a487,0xc9))['catch'](handleError(_0x35a487,null));};exports['update']=function(_0x173ee2,_0x34ee03){if(_0x173ee2[_0x69a8('0x44')]['id']){delete _0x173ee2[_0x69a8('0x44')]['id'];}return db[_0x69a8('0x27')][_0x69a8('0x42')]({'where':{'id':_0x173ee2[_0x69a8('0x3e')]['id']}})[_0x69a8('0x21')](handleEntityNotFound(_0x34ee03,null))[_0x69a8('0x21')](saveUpdates(_0x173ee2[_0x69a8('0x44')],null))['then'](respondWithResult(_0x34ee03,null))[_0x69a8('0x3c')](handleError(_0x34ee03,null));};exports[_0x69a8('0x45')]=function(_0x65b1d0,_0x4d51eb){return db[_0x69a8('0x27')]['find']({'where':{'id':_0x65b1d0[_0x69a8('0x3e')]['id']}})['then'](handleEntityNotFound(_0x4d51eb,null))[_0x69a8('0x21')](removeEntity(_0x4d51eb,null))[_0x69a8('0x3c')](handleError(_0x4d51eb,null));};exports[_0x69a8('0x46')]=function(_0x440c3e,_0x3322a8,_0x4b33f4){var _0x1cb77e={};var _0x1e3d9f={};var _0x119250;var _0x285f77;return db[_0x69a8('0x27')][_0x69a8('0x47')]({'where':{'id':_0x440c3e['params']['id']}})['then'](handleEntityNotFound(_0x3322a8,null))[_0x69a8('0x21')](function(_0x1b1e65){if(_0x1b1e65){_0x119250=_0x1b1e65;_0x1e3d9f['model']=_[_0x69a8('0x3f')](db['SugarcrmField'][_0x69a8('0x28')]);_0x1e3d9f[_0x69a8('0x2c')]=_['keys'](_0x440c3e['query']);_0x1e3d9f[_0x69a8('0x2d')]=_[_0x69a8('0x2f')](_0x1e3d9f[_0x69a8('0x2b')],_0x1e3d9f[_0x69a8('0x2c')]);_0x1cb77e[_0x69a8('0x2e')]=_[_0x69a8('0x2f')](_0x1e3d9f['model'],qs[_0x69a8('0x40')](_0x440c3e[_0x69a8('0x2c')][_0x69a8('0x40')]));_0x1cb77e[_0x69a8('0x2e')]=_0x1cb77e['attributes'][_0x69a8('0x30')]?_0x1cb77e[_0x69a8('0x2e')]:_0x1e3d9f[_0x69a8('0x2b')];_0x1cb77e['order']=qs['sort'](_0x440c3e[_0x69a8('0x2c')][_0x69a8('0x33')]);_0x1cb77e[_0x69a8('0x34')]=qs[_0x69a8('0x2d')](_[_0x69a8('0x35')](_0x440c3e[_0x69a8('0x2c')],_0x1e3d9f['filters']));if(_0x440c3e[_0x69a8('0x2c')][_0x69a8('0x48')]){_0x1cb77e[_0x69a8('0x34')]=_[_0x69a8('0x36')](_0x1cb77e[_0x69a8('0x34')],{'$or':_[_0x69a8('0x26')](_0x1cb77e[_0x69a8('0x2e')],function(_0x55d702){var _0xea9bbf={};_0xea9bbf[_0x55d702]={'$like':'%'+_0x440c3e['query'][_0x69a8('0x48')]+'%'};return _0xea9bbf;})});}_0x1cb77e=_[_0x69a8('0x36')]({},_0x1cb77e,_0x440c3e[_0x69a8('0x41')]);return _0x119250[_0x69a8('0x46')](_0x1cb77e);}})[_0x69a8('0x21')](function(_0x5afccf){if(_0x5afccf){_0x285f77=_0x5afccf[_0x69a8('0x30')];if(!_0x440c3e[_0x69a8('0x2c')][_0x69a8('0x49')]('nolimit')){_0x1cb77e[_0x69a8('0x1c')]=qs[_0x69a8('0x1c')](_0x440c3e[_0x69a8('0x2c')][_0x69a8('0x1c')]);_0x1cb77e[_0x69a8('0x1a')]=qs['offset'](_0x440c3e['query'][_0x69a8('0x1a')]);}return _0x119250[_0x69a8('0x46')](_0x1cb77e);}})['then'](function(_0x4616ab){if(_0x4616ab){return _0x4616ab?{'count':_0x285f77,'rows':_0x4616ab}:null;}})[_0x69a8('0x21')](respondWithResult(_0x3322a8,null))[_0x69a8('0x3c')](handleError(_0x3322a8,null));};exports[_0x69a8('0x4a')]=function(_0x298aff,_0x23a718,_0x5e7df7){var _0x7d7ac6={};var _0xa4f4e7={};var _0x30b43d;var _0xf72670;return db['SugarcrmConfiguration'][_0x69a8('0x47')]({'where':{'id':_0x298aff[_0x69a8('0x3e')]['id']}})[_0x69a8('0x21')](handleEntityNotFound(_0x23a718,null))[_0x69a8('0x21')](function(_0x36a9f6){if(_0x36a9f6){_0x30b43d=_0x36a9f6;_0xa4f4e7[_0x69a8('0x2b')]=_[_0x69a8('0x3f')](db[_0x69a8('0x4b')]['rawAttributes']);_0xa4f4e7['query']=_[_0x69a8('0x3f')](_0x298aff[_0x69a8('0x2c')]);_0xa4f4e7[_0x69a8('0x2d')]=_['intersection'](_0xa4f4e7[_0x69a8('0x2b')],_0xa4f4e7[_0x69a8('0x2c')]);_0x7d7ac6[_0x69a8('0x2e')]=_[_0x69a8('0x2f')](_0xa4f4e7[_0x69a8('0x2b')],qs[_0x69a8('0x40')](_0x298aff[_0x69a8('0x2c')][_0x69a8('0x40')]));_0x7d7ac6[_0x69a8('0x2e')]=_0x7d7ac6[_0x69a8('0x2e')][_0x69a8('0x30')]?_0x7d7ac6[_0x69a8('0x2e')]:_0xa4f4e7[_0x69a8('0x2b')];_0x7d7ac6['order']=qs['sort'](_0x298aff['query'][_0x69a8('0x33')]);_0x7d7ac6['where']=qs[_0x69a8('0x2d')](_[_0x69a8('0x35')](_0x298aff[_0x69a8('0x2c')],_0xa4f4e7[_0x69a8('0x2d')]));if(_0x298aff[_0x69a8('0x2c')][_0x69a8('0x48')]){_0x7d7ac6['where']=_[_0x69a8('0x36')](_0x7d7ac6[_0x69a8('0x34')],{'$or':_[_0x69a8('0x26')](_0x7d7ac6[_0x69a8('0x2e')],function(_0x1208fa){var _0x36c64e={};_0x36c64e[_0x1208fa]={'$like':'%'+_0x298aff[_0x69a8('0x2c')][_0x69a8('0x48')]+'%'};return _0x36c64e;})});}_0x7d7ac6=_['merge']({},_0x7d7ac6,_0x298aff[_0x69a8('0x41')]);return _0x30b43d[_0x69a8('0x4a')](_0x7d7ac6);}})[_0x69a8('0x21')](function(_0x953db1){if(_0x953db1){_0xf72670=_0x953db1[_0x69a8('0x30')];if(!_0x298aff['query'][_0x69a8('0x49')]('nolimit')){_0x7d7ac6[_0x69a8('0x1c')]=qs['limit'](_0x298aff['query'][_0x69a8('0x1c')]);_0x7d7ac6[_0x69a8('0x1a')]=qs[_0x69a8('0x1a')](_0x298aff[_0x69a8('0x2c')][_0x69a8('0x1a')]);}return _0x30b43d[_0x69a8('0x4a')](_0x7d7ac6);}})[_0x69a8('0x21')](function(_0x1d8c83){if(_0x1d8c83){return _0x1d8c83?{'count':_0xf72670,'rows':_0x1d8c83}:null;}})[_0x69a8('0x21')](respondWithResult(_0x23a718,null))[_0x69a8('0x3c')](handleError(_0x23a718,null));};exports[_0x69a8('0x4c')]=function(_0x1321ea,_0x108ec6,_0x472135){var _0x390093={};var _0x24e73a={};var _0x1535ba;var _0x180afb;return db[_0x69a8('0x27')][_0x69a8('0x47')]({'where':{'id':_0x1321ea['params']['id']}})[_0x69a8('0x21')](handleEntityNotFound(_0x108ec6,null))['then'](function(_0x3227e4){if(_0x3227e4){_0x1535ba=_0x3227e4;_0x24e73a[_0x69a8('0x2b')]=_[_0x69a8('0x3f')](db[_0x69a8('0x4b')][_0x69a8('0x28')]);_0x24e73a[_0x69a8('0x2c')]=_[_0x69a8('0x3f')](_0x1321ea[_0x69a8('0x2c')]);_0x24e73a['filters']=_[_0x69a8('0x2f')](_0x24e73a['model'],_0x24e73a[_0x69a8('0x2c')]);_0x390093[_0x69a8('0x2e')]=_[_0x69a8('0x2f')](_0x24e73a[_0x69a8('0x2b')],qs[_0x69a8('0x40')](_0x1321ea[_0x69a8('0x2c')][_0x69a8('0x40')]));_0x390093[_0x69a8('0x2e')]=_0x390093[_0x69a8('0x2e')][_0x69a8('0x30')]?_0x390093[_0x69a8('0x2e')]:_0x24e73a[_0x69a8('0x2b')];_0x390093['order']=qs[_0x69a8('0x33')](_0x1321ea[_0x69a8('0x2c')]['sort']);_0x390093['where']=qs[_0x69a8('0x2d')](_[_0x69a8('0x35')](_0x1321ea[_0x69a8('0x2c')],_0x24e73a[_0x69a8('0x2d')]));if(_0x1321ea[_0x69a8('0x2c')][_0x69a8('0x48')]){_0x390093['where']=_[_0x69a8('0x36')](_0x390093[_0x69a8('0x34')],{'$or':_[_0x69a8('0x26')](_0x390093[_0x69a8('0x2e')],function(_0x3bc2b7){var _0x506130={};_0x506130[_0x3bc2b7]={'$like':'%'+_0x1321ea[_0x69a8('0x2c')][_0x69a8('0x48')]+'%'};return _0x506130;})});}_0x390093=_[_0x69a8('0x36')]({},_0x390093,_0x1321ea[_0x69a8('0x41')]);return _0x1535ba['getDescriptions'](_0x390093);}})['then'](function(_0x4c1668){if(_0x4c1668){_0x180afb=_0x4c1668[_0x69a8('0x30')];if(!_0x1321ea[_0x69a8('0x2c')]['hasOwnProperty']('nolimit')){_0x390093[_0x69a8('0x1c')]=qs[_0x69a8('0x1c')](_0x1321ea[_0x69a8('0x2c')][_0x69a8('0x1c')]);_0x390093[_0x69a8('0x1a')]=qs[_0x69a8('0x1a')](_0x1321ea[_0x69a8('0x2c')][_0x69a8('0x1a')]);}return _0x1535ba[_0x69a8('0x4c')](_0x390093);}})[_0x69a8('0x21')](function(_0x2f401a){if(_0x2f401a){return _0x2f401a?{'count':_0x180afb,'rows':_0x2f401a}:null;}})[_0x69a8('0x21')](respondWithResult(_0x108ec6,null))['catch'](handleError(_0x108ec6,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index e4db4c9..f31b1f8 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 _0x0511=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','lodash','../../config/logger','api','moment','request-promise'];(function(_0x11db48,_0x363415){var _0x2cc224=function(_0x3ea173){while(--_0x3ea173){_0x11db48['push'](_0x11db48['shift']());}};_0x2cc224(++_0x363415);}(_0x0511,0x1bd));var _0x1051=function(_0x3211fe,_0x61867f){_0x3211fe=_0x3211fe-0x0;var _0x20b1db=_0x0511[_0x3211fe];return _0x20b1db;};'use strict';var _=require(_0x1051('0x0'));var util=require('util');var logger=require(_0x1051('0x1'))(_0x1051('0x2'));var moment=require(_0x1051('0x3'));var BPromise=require('bluebird');var rp=require(_0x1051('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1051('0x5'));var config=require(_0x1051('0x6'));var attributes=require(_0x1051('0x7'));module[_0x1051('0x8')]=function(_0x5f15d3,_0x22250d){return _0x5f15d3['define']('SugarcrmConfiguration',attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc847=['moment','request-promise','path','../../config/environment','exports','define','SugarcrmConfiguration','../../config/logger','api'];(function(_0x32b49f,_0xc5a77b){var _0x1713ae=function(_0x1e41a6){while(--_0x1e41a6){_0x32b49f['push'](_0x32b49f['shift']());}};_0x1713ae(++_0xc5a77b);}(_0xc847,0x1c9));var _0x7c84=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc847[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x7c84('0x0'))(_0x7c84('0x1'));var moment=require(_0x7c84('0x2'));var BPromise=require('bluebird');var rp=require(_0x7c84('0x3'));var fs=require('fs');var path=require(_0x7c84('0x4'));var rimraf=require('rimraf');var config=require(_0x7c84('0x5'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0x7c84('0x6')]=function(_0x880066,_0x2bd2d5){return _0x880066[_0x7c84('0x7')](_0x7c84('0x8'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 105b616..e84f5d0 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 _0x502f=['catch','lodash','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result'];(function(_0x38bb85,_0x6db5ea){var _0x3dfab4=function(_0x16718f){while(--_0x16718f){_0x38bb85['push'](_0x38bb85['shift']());}};_0x3dfab4(++_0x6db5ea);}(_0x502f,0x161));var _0xf502=function(_0x5a4e16,_0x5e2937){_0x5a4e16=_0x5a4e16-0x0;var _0xbd38a8=_0x502f[_0x5a4e16];return _0xbd38a8;};'use strict';var _=require(_0xf502('0x0'));var util=require('util');var moment=require(_0xf502('0x1'));var BPromise=require('bluebird');var rs=require(_0xf502('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf502('0x3'));var logger=require(_0xf502('0x4'))('rpc');var config=require(_0xf502('0x5'));var jayson=require(_0xf502('0x6'));var client=jayson[_0xf502('0x7')][_0xf502('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xcf31c6,_0x4638d2,_0x35c571){return new BPromise(function(_0x313afb,_0x44e6fb){return client[_0xf502('0x9')](_0xcf31c6,_0x35c571)[_0xf502('0xa')](function(_0x439caa){logger['info'](_0xf502('0xb'),_0x4638d2,_0xf502('0xc'));logger[_0xf502('0xd')](_0xf502('0xe'),_0x4638d2,'request\x20sent',JSON[_0xf502('0xf')](_0x439caa));if(_0x439caa['error']){if(_0x439caa['error'][_0xf502('0x10')]===0x1f4){logger[_0xf502('0x11')](_0xf502('0xb'),_0x4638d2,_0x439caa[_0xf502('0x11')][_0xf502('0x12')]);return _0x44e6fb(_0x439caa['error'][_0xf502('0x12')]);}logger[_0xf502('0x11')](_0xf502('0xb'),_0x4638d2,_0x439caa[_0xf502('0x11')]['message']);return _0x313afb(_0x439caa['error']['message']);}else{logger[_0xf502('0x13')](_0xf502('0xb'),_0x4638d2,_0xf502('0xc'));_0x313afb(_0x439caa[_0xf502('0x14')][_0xf502('0x12')]);}})[_0xf502('0x15')](function(_0x336c56){logger[_0xf502('0x11')](_0xf502('0xb'),_0x4638d2,_0x336c56);_0x44e6fb(_0x336c56);});});} \ No newline at end of file +var _0x45e9=['lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','SugarcrmConfiguration,\x20%s,\x20%s','result','catch'];(function(_0x132797,_0x20bf26){var _0x471f47=function(_0x150936){while(--_0x150936){_0x132797['push'](_0x132797['shift']());}};_0x471f47(++_0x20bf26);}(_0x45e9,0x1a2));var _0x945e=function(_0x5d9878,_0x3794e6){_0x5d9878=_0x5d9878-0x0;var _0x2e6226=_0x45e9[_0x5d9878];return _0x2e6226;};'use strict';var _=require(_0x945e('0x0'));var util=require(_0x945e('0x1'));var moment=require('moment');var BPromise=require(_0x945e('0x2'));var rs=require(_0x945e('0x3'));var fs=require('fs');var Redis=require(_0x945e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x945e('0x5'));var logger=require(_0x945e('0x6'))('rpc');var config=require(_0x945e('0x7'));var jayson=require(_0x945e('0x8'));var client=jayson['client'][_0x945e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49c1dc,_0x5de11c,_0x2fa794){return new BPromise(function(_0x4f6527,_0x289663){return client[_0x945e('0xa')](_0x49c1dc,_0x2fa794)[_0x945e('0xb')](function(_0x4eff3e){logger[_0x945e('0xc')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5de11c,_0x945e('0xd'));logger[_0x945e('0xe')](_0x945e('0xf'),_0x5de11c,_0x945e('0xd'),JSON['stringify'](_0x4eff3e));if(_0x4eff3e[_0x945e('0x10')]){if(_0x4eff3e[_0x945e('0x10')][_0x945e('0x11')]===0x1f4){logger[_0x945e('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x5de11c,_0x4eff3e[_0x945e('0x10')]['message']);return _0x289663(_0x4eff3e[_0x945e('0x10')][_0x945e('0x12')]);}logger[_0x945e('0x10')](_0x945e('0x13'),_0x5de11c,_0x4eff3e[_0x945e('0x10')][_0x945e('0x12')]);return _0x4f6527(_0x4eff3e[_0x945e('0x10')][_0x945e('0x12')]);}else{logger['info'](_0x945e('0x13'),_0x5de11c,_0x945e('0xd'));_0x4f6527(_0x4eff3e[_0x945e('0x14')][_0x945e('0x12')]);}})[_0x945e('0x15')](function(_0x5cbf27){logger['error'](_0x945e('0x13'),_0x5de11c,_0x5cbf27);_0x289663(_0x5cbf27);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index a2efded..8dc17cb 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 _0xa96e=['../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x1415b6,_0x319869){var _0x1dd423=function(_0x279a59){while(--_0x279a59){_0x1415b6['push'](_0x1415b6['shift']());}};_0x1dd423(++_0x319869);}(_0xa96e,0x1b3));var _0xea96=function(_0x383d4d,_0x3d4f44){_0x383d4d=_0x383d4d-0x0;var _0x232f1b=_0xa96e[_0x383d4d];return _0x232f1b;};'use strict';var multer=require(_0xea96('0x0'));var util=require(_0xea96('0x1'));var path=require(_0xea96('0x2'));var timeout=require(_0xea96('0x3'));var express=require(_0xea96('0x4'));var router=express[_0xea96('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xea96('0x6'));var interaction=require(_0xea96('0x7'));var config=require(_0xea96('0x8'));var controller=require('./intSugarcrmField.controller');router['get']('/',auth[_0xea96('0x9')](),controller['index']);router[_0xea96('0xa')](_0xea96('0xb'),auth[_0xea96('0x9')](),controller[_0xea96('0xc')]);router['post']('/',auth[_0xea96('0x9')](),controller[_0xea96('0xd')]);router[_0xea96('0xe')](_0xea96('0xb'),auth[_0xea96('0x9')](),controller[_0xea96('0xf')]);router[_0xea96('0x10')](_0xea96('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8560=['isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmField.controller','get'];(function(_0x3c6812,_0x1f6a10){var _0x460350=function(_0x236743){while(--_0x236743){_0x3c6812['push'](_0x3c6812['shift']());}};_0x460350(++_0x1f6a10);}(_0x8560,0x14c));var _0x0856=function(_0x1ba43c,_0x5bd2e8){_0x1ba43c=_0x1ba43c-0x0;var _0x2f60eb=_0x8560[_0x1ba43c];return _0x2f60eb;};'use strict';var multer=require(_0x0856('0x0'));var util=require(_0x0856('0x1'));var path=require(_0x0856('0x2'));var timeout=require(_0x0856('0x3'));var express=require('express');var router=express[_0x0856('0x4')]();var fs_extra=require(_0x0856('0x5'));var auth=require(_0x0856('0x6'));var interaction=require(_0x0856('0x7'));var config=require('../../config/environment');var controller=require(_0x0856('0x8'));router[_0x0856('0x9')]('/',auth[_0x0856('0xa')](),controller['index']);router[_0x0856('0x9')](_0x0856('0xb'),auth[_0x0856('0xa')](),controller[_0x0856('0xc')]);router[_0x0856('0xd')]('/',auth[_0x0856('0xa')](),controller[_0x0856('0xe')]);router[_0x0856('0xf')](_0x0856('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x0856('0x10')](_0x0856('0xb'),auth[_0x0856('0xa')](),controller[_0x0856('0x11')]);module[_0x0856('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 75c1d32..4749da3 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 _0x6d8a=['ENUM','string','customVariable','keyValue','picklist','STRING','variable','BOOLEAN','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6d8a,0xce));var _0xa6d8=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x6d8a[_0x425716];return _0x2d39af;};'use strict';var Sequelize=require(_0xa6d8('0x0'));module['exports']={'type':{'type':Sequelize[_0xa6d8('0x1')](_0xa6d8('0x2'),'variable',_0xa6d8('0x3'),_0xa6d8('0x4'),_0xa6d8('0x5')),'defaultValue':_0xa6d8('0x2')},'content':{'type':Sequelize[_0xa6d8('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa6d8('0x1')]('string',_0xa6d8('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xa6d8('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xa6d8('0x6')]},'customField':{'type':Sequelize[_0xa6d8('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa6d8('0x6')]}}; \ No newline at end of file +var _0x255f=['BOOLEAN','sequelize','exports','string','variable','picklist','STRING','ENUM','customVariable'];(function(_0x1dbb97,_0xc2e02f){var _0x57612f=function(_0x5e9ffc){while(--_0x5e9ffc){_0x1dbb97['push'](_0x1dbb97['shift']());}};_0x57612f(++_0xc2e02f);}(_0x255f,0x196));var _0xf255=function(_0x3cb027,_0x1063a1){_0x3cb027=_0x3cb027-0x0;var _0x5004b7=_0x255f[_0x3cb027];return _0x5004b7;};'use strict';var Sequelize=require(_0xf255('0x0'));module[_0xf255('0x1')]={'type':{'type':Sequelize['ENUM'](_0xf255('0x2'),_0xf255('0x3'),'customVariable','keyValue',_0xf255('0x4')),'defaultValue':_0xf255('0x2')},'content':{'type':Sequelize[_0xf255('0x5')]},'key':{'type':Sequelize[_0xf255('0x5')]},'keyType':{'type':Sequelize[_0xf255('0x6')]('string',_0xf255('0x3'),_0xf255('0x7'))},'keyContent':{'type':Sequelize[_0xf255('0x5')]},'idField':{'type':Sequelize[_0xf255('0x5')]},'nameField':{'type':Sequelize[_0xf255('0x5')]},'customField':{'type':Sequelize[_0xf255('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf255('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index a325af4..2988c50 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 _0x04ed=['sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','order','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x2a6766,_0x3c3ee6){var _0x2a6220=function(_0x2082de){while(--_0x2082de){_0x2a6766['push'](_0x2a6766['shift']());}};_0x2a6220(++_0x3c3ee6);}(_0x04ed,0x123));var _0xd04e=function(_0x3c75b1,_0x6d511f){_0x3c75b1=_0x3c75b1-0x0;var _0x29e386=_0x04ed[_0x3c75b1];return _0x29e386;};'use strict';var emlformat=require(_0xd04e('0x0'));var rimraf=require(_0xd04e('0x1'));var zipdir=require(_0xd04e('0x2'));var jsonpatch=require(_0xd04e('0x3'));var rp=require(_0xd04e('0x4'));var moment=require(_0xd04e('0x5'));var BPromise=require(_0xd04e('0x6'));var Mustache=require(_0xd04e('0x7'));var util=require(_0xd04e('0x8'));var path=require('path');var sox=require(_0xd04e('0x9'));var csv=require(_0xd04e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd04e('0xb'));var _=require(_0xd04e('0xc'));var squel=require(_0xd04e('0xd'));var crypto=require(_0xd04e('0xe'));var jsforce=require(_0xd04e('0xf'));var deskjs=require(_0xd04e('0x10'));var toCsv=require(_0xd04e('0xa'));var querystring=require(_0xd04e('0x11'));var Papa=require(_0xd04e('0x12'));var Redis=require(_0xd04e('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xd04e('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd04e('0x15'));var logger=require(_0xd04e('0x16'))(_0xd04e('0x17'));var utils=require('../../config/utils');var config=require(_0xd04e('0x18'));var licenseUtil=require(_0xd04e('0x19'));var db=require(_0xd04e('0x1a'))['db'];function respondWithStatusCode(_0x7d7d64,_0x3cf44e){_0x3cf44e=_0x3cf44e||0xcc;return function(_0x50f1ad){if(_0x50f1ad){return _0x7d7d64['sendStatus'](_0x3cf44e);}return _0x7d7d64[_0xd04e('0x1b')](_0x3cf44e)[_0xd04e('0x1c')]();};}function respondWithResult(_0x1c1da6,_0x446340){_0x446340=_0x446340||0xc8;return function(_0x10809c){if(_0x10809c){return _0x1c1da6[_0xd04e('0x1b')](_0x446340)['json'](_0x10809c);}};}function respondWithFilteredResult(_0x400f1d,_0x4a47d5){return function(_0x3800ae){if(_0x3800ae){var _0x15d7a7=typeof _0x4a47d5[_0xd04e('0x1d')]===_0xd04e('0x1e')&&typeof _0x4a47d5[_0xd04e('0x1f')]===_0xd04e('0x1e');var _0x36c58d=_0x3800ae[_0xd04e('0x20')];var _0x269de6=_0x15d7a7?0x0:_0x4a47d5[_0xd04e('0x1d')];var _0x2517c6=_0x15d7a7?_0x3800ae[_0xd04e('0x20')]:_0x4a47d5[_0xd04e('0x1d')]+_0x4a47d5[_0xd04e('0x1f')];var _0x21883e;if(_0x2517c6>=_0x36c58d){_0x2517c6=_0x36c58d;_0x21883e=0xc8;}else{_0x21883e=0xce;}_0x400f1d[_0xd04e('0x1b')](_0x21883e);return _0x400f1d[_0xd04e('0x21')](_0xd04e('0x22'),_0x269de6+'-'+_0x2517c6+'/'+_0x36c58d)['json'](_0x3800ae);}return null;};}function patchUpdates(_0x5c4fe4){return function(_0x32e178){try{jsonpatch[_0xd04e('0x23')](_0x32e178,_0x5c4fe4,!![]);}catch(_0x208955){return BPromise[_0xd04e('0x24')](_0x208955);}return _0x32e178['save']();};}function saveUpdates(_0x2f86cd,_0x55a248){return function(_0xea7346){if(_0xea7346){return _0xea7346[_0xd04e('0x25')](_0x2f86cd)[_0xd04e('0x26')](function(_0x101cbe){return _0x101cbe;});}return null;};}function removeEntity(_0x111e06,_0x413af8){return function(_0x2ebe09){if(_0x2ebe09){return _0x2ebe09[_0xd04e('0x27')]()[_0xd04e('0x26')](function(){_0x111e06[_0xd04e('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31efe1,_0x10905d){return function(_0x5f2d7f){if(!_0x5f2d7f){_0x31efe1[_0xd04e('0x28')](0x194);}return _0x5f2d7f;};}function handleError(_0x55e24e,_0x2111bd){_0x2111bd=_0x2111bd||0x1f4;return function(_0x5f1c30){logger['error'](_0x5f1c30[_0xd04e('0x29')]);if(_0x5f1c30[_0xd04e('0x2a')]){delete _0x5f1c30[_0xd04e('0x2a')];}_0x55e24e['status'](_0x2111bd)[_0xd04e('0x2b')](_0x5f1c30);};}exports[_0xd04e('0x2c')]=function(_0x1f189f,_0x103528){var _0x1a9a80={},_0x3f3b0a={},_0xbf54ba={'count':0x0,'rows':[]};var _0x5ee384=_['map'](db[_0xd04e('0x2d')][_0xd04e('0x2e')],function(_0x549518){return{'name':_0x549518[_0xd04e('0x2f')],'type':_0x549518[_0xd04e('0x30')][_0xd04e('0x31')]};});_0x3f3b0a[_0xd04e('0x32')]=_[_0xd04e('0x33')](_0x5ee384,_0xd04e('0x2a'));_0x3f3b0a[_0xd04e('0x34')]=_['keys'](_0x1f189f[_0xd04e('0x34')]);_0x3f3b0a[_0xd04e('0x35')]=_[_0xd04e('0x36')](_0x3f3b0a['model'],_0x3f3b0a['query']);_0x1a9a80[_0xd04e('0x37')]=_[_0xd04e('0x36')](_0x3f3b0a[_0xd04e('0x32')],qs[_0xd04e('0x38')](_0x1f189f['query'][_0xd04e('0x38')]));_0x1a9a80[_0xd04e('0x37')]=_0x1a9a80[_0xd04e('0x37')]['length']?_0x1a9a80['attributes']:_0x3f3b0a['model'];if(!_0x1f189f[_0xd04e('0x34')]['hasOwnProperty']('nolimit')){_0x1a9a80['limit']=qs['limit'](_0x1f189f[_0xd04e('0x34')]['limit']);_0x1a9a80[_0xd04e('0x1d')]=qs[_0xd04e('0x1d')](_0x1f189f[_0xd04e('0x34')]['offset']);}_0x1a9a80[_0xd04e('0x39')]=qs['sort'](_0x1f189f['query']['sort']);_0x1a9a80[_0xd04e('0x3a')]=qs[_0xd04e('0x35')](_['pick'](_0x1f189f[_0xd04e('0x34')],_0x3f3b0a[_0xd04e('0x35')]),_0x5ee384);if(_0x1f189f[_0xd04e('0x34')]['filter']){_0x1a9a80[_0xd04e('0x3a')]=_[_0xd04e('0x3b')](_0x1a9a80[_0xd04e('0x3a')],{'$or':_[_0xd04e('0x33')](_0x5ee384,function(_0xd18531){if(_0xd18531['type']!==_0xd04e('0x3c')){var _0x3f1c82={};_0x3f1c82[_0xd18531[_0xd04e('0x2a')]]={'$like':'%'+_0x1f189f[_0xd04e('0x34')][_0xd04e('0x3d')]+'%'};return _0x3f1c82;}})});}_0x1a9a80=_[_0xd04e('0x3b')]({},_0x1a9a80,_0x1f189f['options']);var _0x12d524={'where':_0x1a9a80[_0xd04e('0x3a')]};return db[_0xd04e('0x2d')][_0xd04e('0x20')](_0x12d524)[_0xd04e('0x26')](function(_0x371bd6){_0xbf54ba[_0xd04e('0x20')]=_0x371bd6;if(_0x1f189f[_0xd04e('0x34')][_0xd04e('0x3e')]){_0x1a9a80[_0xd04e('0x3f')]=[{'all':!![]}];}return db[_0xd04e('0x2d')][_0xd04e('0x40')](_0x1a9a80);})[_0xd04e('0x26')](function(_0x362792){_0xbf54ba[_0xd04e('0x41')]=_0x362792;return _0xbf54ba;})[_0xd04e('0x26')](respondWithFilteredResult(_0x103528,_0x1a9a80))[_0xd04e('0x42')](handleError(_0x103528,null));};exports[_0xd04e('0x43')]=function(_0xf552a6,_0x41721e){var _0x2ba617={'raw':!![],'where':{'id':_0xf552a6[_0xd04e('0x44')]['id']}},_0xf88c5b={};_0xf88c5b[_0xd04e('0x32')]=_['keys'](db[_0xd04e('0x2d')]['rawAttributes']);_0xf88c5b[_0xd04e('0x34')]=_[_0xd04e('0x45')](_0xf552a6[_0xd04e('0x34')]);_0xf88c5b[_0xd04e('0x35')]=_[_0xd04e('0x36')](_0xf88c5b[_0xd04e('0x32')],_0xf88c5b[_0xd04e('0x34')]);_0x2ba617['attributes']=_['intersection'](_0xf88c5b[_0xd04e('0x32')],qs['fields'](_0xf552a6[_0xd04e('0x34')][_0xd04e('0x38')]));_0x2ba617[_0xd04e('0x37')]=_0x2ba617[_0xd04e('0x37')][_0xd04e('0x46')]?_0x2ba617[_0xd04e('0x37')]:_0xf88c5b[_0xd04e('0x32')];if(_0xf552a6[_0xd04e('0x34')][_0xd04e('0x3e')]){_0x2ba617[_0xd04e('0x3f')]=[{'all':!![]}];}_0x2ba617=_[_0xd04e('0x3b')]({},_0x2ba617,_0xf552a6[_0xd04e('0x47')]);return db[_0xd04e('0x2d')][_0xd04e('0x48')](_0x2ba617)['then'](handleEntityNotFound(_0x41721e,null))[_0xd04e('0x26')](respondWithResult(_0x41721e,null))[_0xd04e('0x42')](handleError(_0x41721e,null));};exports[_0xd04e('0x49')]=function(_0x34630a,_0x42eace){return db[_0xd04e('0x2d')][_0xd04e('0x49')](_0x34630a[_0xd04e('0x4a')],{})[_0xd04e('0x26')](respondWithResult(_0x42eace,0xc9))[_0xd04e('0x42')](handleError(_0x42eace,null));};exports[_0xd04e('0x25')]=function(_0x8d5001,_0x2e4b84){if(_0x8d5001['body']['id']){delete _0x8d5001[_0xd04e('0x4a')]['id'];}return db[_0xd04e('0x2d')][_0xd04e('0x48')]({'where':{'id':_0x8d5001[_0xd04e('0x44')]['id']}})['then'](handleEntityNotFound(_0x2e4b84,null))[_0xd04e('0x26')](saveUpdates(_0x8d5001['body'],null))['then'](respondWithResult(_0x2e4b84,null))['catch'](handleError(_0x2e4b84,null));};exports[_0xd04e('0x27')]=function(_0x2c0bdb,_0x3acb45){return db['SugarcrmField'][_0xd04e('0x48')]({'where':{'id':_0x2c0bdb[_0xd04e('0x44')]['id']}})[_0xd04e('0x26')](handleEntityNotFound(_0x3acb45,null))['then'](removeEntity(_0x3acb45,null))[_0xd04e('0x42')](handleError(_0x3acb45,null));}; \ No newline at end of file +var _0x3b3f=['update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','SugarcrmField','includeAll','findAll','rows','catch','params','include','find','create','body'];(function(_0x311840,_0x592872){var _0x1289a3=function(_0x542a80){while(--_0x542a80){_0x311840['push'](_0x311840['shift']());}};_0x1289a3(++_0x592872);}(_0x3b3f,0x179));var _0xf3b3=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x3b3f[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0xf3b3('0x0'));var rimraf=require(_0xf3b3('0x1'));var zipdir=require(_0xf3b3('0x2'));var jsonpatch=require(_0xf3b3('0x3'));var rp=require(_0xf3b3('0x4'));var moment=require(_0xf3b3('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf3b3('0x6'));var util=require(_0xf3b3('0x7'));var path=require(_0xf3b3('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf3b3('0x9'));var fs=require('fs');var fs_extra=require(_0xf3b3('0xa'));var _=require(_0xf3b3('0xb'));var squel=require(_0xf3b3('0xc'));var crypto=require(_0xf3b3('0xd'));var jsforce=require(_0xf3b3('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf3b3('0xf'));var Redis=require(_0xf3b3('0x10'));var authService=require(_0xf3b3('0x11'));var qs=require(_0xf3b3('0x12'));var as=require(_0xf3b3('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf3b3('0x14'))(_0xf3b3('0x15'));var utils=require(_0xf3b3('0x16'));var config=require(_0xf3b3('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3b3('0x18'))['db'];function respondWithStatusCode(_0x23976d,_0x56ce14){_0x56ce14=_0x56ce14||0xcc;return function(_0x4ad28d){if(_0x4ad28d){return _0x23976d[_0xf3b3('0x19')](_0x56ce14);}return _0x23976d[_0xf3b3('0x1a')](_0x56ce14)[_0xf3b3('0x1b')]();};}function respondWithResult(_0x23838e,_0x387abb){_0x387abb=_0x387abb||0xc8;return function(_0x1c6595){if(_0x1c6595){return _0x23838e[_0xf3b3('0x1a')](_0x387abb)['json'](_0x1c6595);}};}function respondWithFilteredResult(_0x165d0e,_0x27b44e){return function(_0x461d46){if(_0x461d46){var _0xc3f27=typeof _0x27b44e[_0xf3b3('0x1c')]==='undefined'&&typeof _0x27b44e[_0xf3b3('0x1d')]===_0xf3b3('0x1e');var _0x2dc6db=_0x461d46[_0xf3b3('0x1f')];var _0x135823=_0xc3f27?0x0:_0x27b44e['offset'];var _0x320b89=_0xc3f27?_0x461d46['count']:_0x27b44e[_0xf3b3('0x1c')]+_0x27b44e[_0xf3b3('0x1d')];var _0xa3d4fa;if(_0x320b89>=_0x2dc6db){_0x320b89=_0x2dc6db;_0xa3d4fa=0xc8;}else{_0xa3d4fa=0xce;}_0x165d0e[_0xf3b3('0x1a')](_0xa3d4fa);return _0x165d0e['set'](_0xf3b3('0x20'),_0x135823+'-'+_0x320b89+'/'+_0x2dc6db)[_0xf3b3('0x21')](_0x461d46);}return null;};}function patchUpdates(_0x2efcac){return function(_0x1ff855){try{jsonpatch[_0xf3b3('0x22')](_0x1ff855,_0x2efcac,!![]);}catch(_0x4b0d0f){return BPromise[_0xf3b3('0x23')](_0x4b0d0f);}return _0x1ff855[_0xf3b3('0x24')]();};}function saveUpdates(_0x535b6e,_0x23b1c8){return function(_0x168ac7){if(_0x168ac7){return _0x168ac7['update'](_0x535b6e)[_0xf3b3('0x25')](function(_0x2d1e56){return _0x2d1e56;});}return null;};}function removeEntity(_0x14a21d,_0x57790c){return function(_0x3d1f22){if(_0x3d1f22){return _0x3d1f22['destroy']()[_0xf3b3('0x25')](function(){_0x14a21d['status'](0xcc)[_0xf3b3('0x1b')]();});}};}function handleEntityNotFound(_0x1e73ec,_0x2decb3){return function(_0x5187f8){if(!_0x5187f8){_0x1e73ec[_0xf3b3('0x19')](0x194);}return _0x5187f8;};}function handleError(_0x5da0df,_0x1a4a55){_0x1a4a55=_0x1a4a55||0x1f4;return function(_0xe18f97){logger[_0xf3b3('0x26')](_0xe18f97[_0xf3b3('0x27')]);if(_0xe18f97['name']){delete _0xe18f97[_0xf3b3('0x28')];}_0x5da0df[_0xf3b3('0x1a')](_0x1a4a55)[_0xf3b3('0x29')](_0xe18f97);};}exports['index']=function(_0x36123d,_0x12bd1a){var _0x1d9391={},_0x105689={},_0x4a68b1={'count':0x0,'rows':[]};var _0x3322f1=_[_0xf3b3('0x2a')](db['SugarcrmField'][_0xf3b3('0x2b')],function(_0x41af5c){return{'name':_0x41af5c[_0xf3b3('0x2c')],'type':_0x41af5c['type'][_0xf3b3('0x2d')]};});_0x105689[_0xf3b3('0x2e')]=_['map'](_0x3322f1,'name');_0x105689[_0xf3b3('0x2f')]=_[_0xf3b3('0x30')](_0x36123d[_0xf3b3('0x2f')]);_0x105689[_0xf3b3('0x31')]=_[_0xf3b3('0x32')](_0x105689[_0xf3b3('0x2e')],_0x105689[_0xf3b3('0x2f')]);_0x1d9391['attributes']=_[_0xf3b3('0x32')](_0x105689[_0xf3b3('0x2e')],qs[_0xf3b3('0x33')](_0x36123d[_0xf3b3('0x2f')]['fields']));_0x1d9391[_0xf3b3('0x34')]=_0x1d9391['attributes'][_0xf3b3('0x35')]?_0x1d9391[_0xf3b3('0x34')]:_0x105689['model'];if(!_0x36123d[_0xf3b3('0x2f')]['hasOwnProperty'](_0xf3b3('0x36'))){_0x1d9391[_0xf3b3('0x1d')]=qs[_0xf3b3('0x1d')](_0x36123d[_0xf3b3('0x2f')][_0xf3b3('0x1d')]);_0x1d9391[_0xf3b3('0x1c')]=qs[_0xf3b3('0x1c')](_0x36123d[_0xf3b3('0x2f')]['offset']);}_0x1d9391[_0xf3b3('0x37')]=qs[_0xf3b3('0x38')](_0x36123d[_0xf3b3('0x2f')][_0xf3b3('0x38')]);_0x1d9391[_0xf3b3('0x39')]=qs[_0xf3b3('0x31')](_[_0xf3b3('0x3a')](_0x36123d[_0xf3b3('0x2f')],_0x105689[_0xf3b3('0x31')]),_0x3322f1);if(_0x36123d[_0xf3b3('0x2f')][_0xf3b3('0x3b')]){_0x1d9391['where']=_[_0xf3b3('0x3c')](_0x1d9391[_0xf3b3('0x39')],{'$or':_[_0xf3b3('0x2a')](_0x3322f1,function(_0x580bff){if(_0x580bff[_0xf3b3('0x3d')]!==_0xf3b3('0x3e')){var _0x3ba5ff={};_0x3ba5ff[_0x580bff['name']]={'$like':'%'+_0x36123d['query']['filter']+'%'};return _0x3ba5ff;}})});}_0x1d9391=_[_0xf3b3('0x3c')]({},_0x1d9391,_0x36123d['options']);var _0x21e500={'where':_0x1d9391[_0xf3b3('0x39')]};return db[_0xf3b3('0x3f')][_0xf3b3('0x1f')](_0x21e500)[_0xf3b3('0x25')](function(_0x24d7d2){_0x4a68b1[_0xf3b3('0x1f')]=_0x24d7d2;if(_0x36123d['query'][_0xf3b3('0x40')]){_0x1d9391['include']=[{'all':!![]}];}return db[_0xf3b3('0x3f')][_0xf3b3('0x41')](_0x1d9391);})[_0xf3b3('0x25')](function(_0x5d5435){_0x4a68b1[_0xf3b3('0x42')]=_0x5d5435;return _0x4a68b1;})['then'](respondWithFilteredResult(_0x12bd1a,_0x1d9391))[_0xf3b3('0x43')](handleError(_0x12bd1a,null));};exports['show']=function(_0x3776bb,_0x12572){var _0x45a974={'raw':!![],'where':{'id':_0x3776bb[_0xf3b3('0x44')]['id']}},_0x2bced0={};_0x2bced0['model']=_[_0xf3b3('0x30')](db[_0xf3b3('0x3f')][_0xf3b3('0x2b')]);_0x2bced0['query']=_[_0xf3b3('0x30')](_0x3776bb[_0xf3b3('0x2f')]);_0x2bced0[_0xf3b3('0x31')]=_[_0xf3b3('0x32')](_0x2bced0[_0xf3b3('0x2e')],_0x2bced0[_0xf3b3('0x2f')]);_0x45a974[_0xf3b3('0x34')]=_[_0xf3b3('0x32')](_0x2bced0[_0xf3b3('0x2e')],qs[_0xf3b3('0x33')](_0x3776bb[_0xf3b3('0x2f')][_0xf3b3('0x33')]));_0x45a974[_0xf3b3('0x34')]=_0x45a974['attributes']['length']?_0x45a974[_0xf3b3('0x34')]:_0x2bced0['model'];if(_0x3776bb[_0xf3b3('0x2f')][_0xf3b3('0x40')]){_0x45a974[_0xf3b3('0x45')]=[{'all':!![]}];}_0x45a974=_[_0xf3b3('0x3c')]({},_0x45a974,_0x3776bb['options']);return db[_0xf3b3('0x3f')][_0xf3b3('0x46')](_0x45a974)[_0xf3b3('0x25')](handleEntityNotFound(_0x12572,null))['then'](respondWithResult(_0x12572,null))[_0xf3b3('0x43')](handleError(_0x12572,null));};exports[_0xf3b3('0x47')]=function(_0xc7d213,_0x4ea6f8){return db[_0xf3b3('0x3f')]['create'](_0xc7d213[_0xf3b3('0x48')],{})[_0xf3b3('0x25')](respondWithResult(_0x4ea6f8,0xc9))[_0xf3b3('0x43')](handleError(_0x4ea6f8,null));};exports[_0xf3b3('0x49')]=function(_0x1a817d,_0x2521b6){if(_0x1a817d[_0xf3b3('0x48')]['id']){delete _0x1a817d[_0xf3b3('0x48')]['id'];}return db[_0xf3b3('0x3f')][_0xf3b3('0x46')]({'where':{'id':_0x1a817d[_0xf3b3('0x44')]['id']}})[_0xf3b3('0x25')](handleEntityNotFound(_0x2521b6,null))[_0xf3b3('0x25')](saveUpdates(_0x1a817d['body'],null))[_0xf3b3('0x25')](respondWithResult(_0x2521b6,null))['catch'](handleError(_0x2521b6,null));};exports[_0xf3b3('0x4a')]=function(_0x1f401f,_0x27ac4a){return db[_0xf3b3('0x3f')]['find']({'where':{'id':_0x1f401f[_0xf3b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x27ac4a,null))[_0xf3b3('0x25')](removeEntity(_0x27ac4a,null))[_0xf3b3('0x43')](handleError(_0x27ac4a,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 5edfd09..2aa9e8f 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 _0x493c=['lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId'];(function(_0x18df61,_0x574d3e){var _0x57dd9f=function(_0x4e6417){while(--_0x4e6417){_0x18df61['push'](_0x18df61['shift']());}};_0x57dd9f(++_0x574d3e);}(_0x493c,0x120));var _0xc493=function(_0x316952,_0x3d01a1){_0x316952=_0x316952-0x0;var _0x21cb60=_0x493c[_0x316952];return _0x21cb60;};'use strict';var _=require(_0xc493('0x0'));var util=require(_0xc493('0x1'));var logger=require(_0xc493('0x2'))('api');var moment=require(_0xc493('0x3'));var BPromise=require('bluebird');var rp=require(_0xc493('0x4'));var fs=require('fs');var path=require(_0xc493('0x5'));var rimraf=require(_0xc493('0x6'));var config=require(_0xc493('0x7'));var attributes=require(_0xc493('0x8'));module[_0xc493('0x9')]=function(_0x4f21e3,_0x2d3bd2){return _0x4f21e3[_0xc493('0xa')](_0xc493('0xb'),attributes,{'tableName':_0xc493('0xc'),'paranoid':![],'indexes':[{'name':_0xc493('0xd'),'fields':[_0xc493('0xe'),_0xc493('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6b7c=['int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','define','SugarcrmField'];(function(_0x2b45d3,_0x54fb9f){var _0x48a09d=function(_0xe8dce4){while(--_0xe8dce4){_0x2b45d3['push'](_0x2b45d3['shift']());}};_0x48a09d(++_0x54fb9f);}(_0x6b7c,0x13f));var _0xc6b7=function(_0x4434f7,_0x431595){_0x4434f7=_0x4434f7-0x0;var _0x364db2=_0x6b7c[_0x4434f7];return _0x364db2;};'use strict';var _=require(_0xc6b7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc6b7('0x1'));var moment=require(_0xc6b7('0x2'));var BPromise=require(_0xc6b7('0x3'));var rp=require(_0xc6b7('0x4'));var fs=require('fs');var path=require(_0xc6b7('0x5'));var rimraf=require(_0xc6b7('0x6'));var config=require(_0xc6b7('0x7'));var attributes=require(_0xc6b7('0x8'));module['exports']=function(_0x1a11ff,_0x2ee842){return _0x1a11ff[_0xc6b7('0x9')](_0xc6b7('0xa'),attributes,{'tableName':_0xc6b7('0xb'),'paranoid':![],'indexes':[{'name':_0xc6b7('0xc'),'fields':[_0xc6b7('0xd'),_0xc6b7('0xe')],'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 e33f873..c57db06 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 _0xf787=['rpc','jayson/promise','client','http','request','then','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x13e3cc,_0x2e722c){var _0x5e0d88=function(_0x3a40e9){while(--_0x3a40e9){_0x13e3cc['push'](_0x13e3cc['shift']());}};_0x5e0d88(++_0x2e722c);}(_0xf787,0x8c));var _0x7f78=function(_0x504072,_0x2b7160){_0x504072=_0x504072-0x0;var _0x545ba4=_0xf787[_0x504072];return _0x545ba4;};'use strict';var _=require(_0x7f78('0x0'));var util=require(_0x7f78('0x1'));var moment=require(_0x7f78('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f78('0x3'));var fs=require('fs');var Redis=require(_0x7f78('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f78('0x5'));var logger=require(_0x7f78('0x6'))(_0x7f78('0x7'));var config=require('../../config/environment');var jayson=require(_0x7f78('0x8'));var client=jayson[_0x7f78('0x9')][_0x7f78('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e0240,_0x171f4b,_0x52c349){return new BPromise(function(_0x5a8915,_0x50461c){return client[_0x7f78('0xb')](_0x3e0240,_0x52c349)[_0x7f78('0xc')](function(_0x142193){logger['info'](_0x7f78('0xd'),_0x171f4b,_0x7f78('0xe'));logger['debug'](_0x7f78('0xf'),_0x171f4b,_0x7f78('0xe'),JSON['stringify'](_0x142193));if(_0x142193[_0x7f78('0x10')]){if(_0x142193['error'][_0x7f78('0x11')]===0x1f4){logger[_0x7f78('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x171f4b,_0x142193[_0x7f78('0x10')][_0x7f78('0x12')]);return _0x50461c(_0x142193[_0x7f78('0x10')][_0x7f78('0x12')]);}logger[_0x7f78('0x10')](_0x7f78('0xd'),_0x171f4b,_0x142193[_0x7f78('0x10')][_0x7f78('0x12')]);return _0x5a8915(_0x142193[_0x7f78('0x10')]['message']);}else{logger['info'](_0x7f78('0xd'),_0x171f4b,_0x7f78('0xe'));_0x5a8915(_0x142193[_0x7f78('0x13')][_0x7f78('0x12')]);}})[_0x7f78('0x14')](function(_0x2ac87f){logger[_0x7f78('0x10')](_0x7f78('0xd'),_0x171f4b,_0x2ac87f);_0x50461c(_0x2ac87f);});});} \ No newline at end of file +var _0x6be5=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SugarcrmField,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x2dbb81,_0x106756){var _0x5b5ad7=function(_0x3477f9){while(--_0x3477f9){_0x2dbb81['push'](_0x2dbb81['shift']());}};_0x5b5ad7(++_0x106756);}(_0x6be5,0xe2));var _0x56be=function(_0x566ca7,_0x589ec0){_0x566ca7=_0x566ca7-0x0;var _0x5560f0=_0x6be5[_0x566ca7];return _0x5560f0;};'use strict';var _=require(_0x56be('0x0'));var util=require(_0x56be('0x1'));var moment=require('moment');var BPromise=require(_0x56be('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x56be('0x3'));var db=require(_0x56be('0x4'))['db'];var utils=require(_0x56be('0x5'));var logger=require(_0x56be('0x6'))(_0x56be('0x7'));var config=require(_0x56be('0x8'));var jayson=require(_0x56be('0x9'));var client=jayson[_0x56be('0xa')][_0x56be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19010a,_0x2feef4,_0xd3672){return new BPromise(function(_0x1e18e1,_0x40b1eb){return client['request'](_0x19010a,_0xd3672)['then'](function(_0xcb42b1){logger[_0x56be('0xc')](_0x56be('0xd'),_0x2feef4,'request\x20sent');logger[_0x56be('0xe')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x2feef4,'request\x20sent',JSON[_0x56be('0xf')](_0xcb42b1));if(_0xcb42b1['error']){if(_0xcb42b1[_0x56be('0x10')][_0x56be('0x11')]===0x1f4){logger['error'](_0x56be('0xd'),_0x2feef4,_0xcb42b1[_0x56be('0x10')][_0x56be('0x12')]);return _0x40b1eb(_0xcb42b1[_0x56be('0x10')][_0x56be('0x12')]);}logger['error']('SugarcrmField,\x20%s,\x20%s',_0x2feef4,_0xcb42b1[_0x56be('0x10')][_0x56be('0x12')]);return _0x1e18e1(_0xcb42b1[_0x56be('0x10')][_0x56be('0x12')]);}else{logger[_0x56be('0xc')](_0x56be('0xd'),_0x2feef4,'request\x20sent');_0x1e18e1(_0xcb42b1[_0x56be('0x13')][_0x56be('0x12')]);}})[_0x56be('0x14')](function(_0x5a1971){logger[_0x56be('0x10')]('SugarcrmField,\x20%s,\x20%s',_0x2feef4,_0x5a1971);_0x40b1eb(_0x5a1971);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index a39b3b8..eaefa77 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 _0x8db0=['delete','multer','util','connect-timeout','express','Router','../../components/auth/service','get','index','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x592cdd,_0x38e5d2){var _0x404abf=function(_0x2a46bf){while(--_0x2a46bf){_0x592cdd['push'](_0x592cdd['shift']());}};_0x404abf(++_0x38e5d2);}(_0x8db0,0x65));var _0x08db=function(_0x25cd2c,_0x57498e){_0x25cd2c=_0x25cd2c-0x0;var _0x1e364c=_0x8db0[_0x25cd2c];return _0x1e364c;};'use strict';var multer=require(_0x08db('0x0'));var util=require(_0x08db('0x1'));var path=require('path');var timeout=require(_0x08db('0x2'));var express=require(_0x08db('0x3'));var router=express[_0x08db('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x08db('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x08db('0x6')]('/',auth['isAuthenticated'](),controller[_0x08db('0x7')]);router['get'](_0x08db('0x8'),auth[_0x08db('0x9')](),controller[_0x08db('0xa')]);router[_0x08db('0x6')](_0x08db('0xb'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x08db('0x6')](_0x08db('0xc'),auth[_0x08db('0x9')](),controller[_0x08db('0xd')]);router[_0x08db('0xe')]('/',auth[_0x08db('0x9')](),controller[_0x08db('0xf')]);router[_0x08db('0xe')](_0x08db('0xb'),auth[_0x08db('0x9')](),controller[_0x08db('0x10')]);router[_0x08db('0x11')](_0x08db('0x8'),auth[_0x08db('0x9')](),controller[_0x08db('0x12')]);router[_0x08db('0x13')](_0x08db('0x8'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x782e=['../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','/:id','destroy','path','connect-timeout','Router','fs-extra'];(function(_0x3e7c7c,_0x558c8b){var _0x510350=function(_0x12ec5a){while(--_0x12ec5a){_0x3e7c7c['push'](_0x3e7c7c['shift']());}};_0x510350(++_0x558c8b);}(_0x782e,0xb9));var _0xe782=function(_0x598a35,_0x517f8a){_0x598a35=_0x598a35-0x0;var _0x250bae=_0x782e[_0x598a35];return _0x250bae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe782('0x0'));var timeout=require(_0xe782('0x1'));var express=require('express');var router=express[_0xe782('0x2')]();var fs_extra=require(_0xe782('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xe782('0x4'));var config=require(_0xe782('0x5'));var controller=require(_0xe782('0x6'));router[_0xe782('0x7')]('/',auth['isAuthenticated'](),controller[_0xe782('0x8')]);router['get']('/:id',auth[_0xe782('0x9')](),controller['show']);router[_0xe782('0x7')](_0xe782('0xa'),auth[_0xe782('0x9')](),controller[_0xe782('0xb')]);router[_0xe782('0x7')](_0xe782('0xc'),auth[_0xe782('0x9')](),controller[_0xe782('0xd')]);router[_0xe782('0xe')]('/',auth[_0xe782('0x9')](),controller[_0xe782('0xf')]);router[_0xe782('0xe')](_0xe782('0xa'),auth[_0xe782('0x9')](),controller['addConfiguration']);router[_0xe782('0x10')]('/:id',auth[_0xe782('0x9')](),controller[_0xe782('0x11')]);router[_0xe782('0x12')](_0xe782('0x13'),auth[_0xe782('0x9')](),controller[_0xe782('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 0db55fa..c9a1074 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 _0xdcf6=['STRING','HelpDesk','exports'];(function(_0x5bf9a0,_0x377d69){var _0x55fb8c=function(_0x4a89c7){while(--_0x4a89c7){_0x5bf9a0['push'](_0x5bf9a0['shift']());}};_0x55fb8c(++_0x377d69);}(_0xdcf6,0x131));var _0x6dcf=function(_0x3dcd52,_0x2c151a){_0x3dcd52=_0x3dcd52-0x0;var _0x4fb1c2=_0xdcf6[_0x3dcd52];return _0x4fb1c2;};'use strict';var Sequelize=require('sequelize');module[_0x6dcf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6dcf('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x6dcf('0x1')],'allowNull':![],'defaultValue':_0x6dcf('0x2')},'remoteUri':{'type':Sequelize[_0x6dcf('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x6dcf('0x1')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x6dcf('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb563=['STRING'];(function(_0x507d61,_0x9af129){var _0x4051bd=function(_0x441f82){while(--_0x441f82){_0x507d61['push'](_0x507d61['shift']());}};_0x4051bd(++_0x9af129);}(_0xb563,0x9c));var _0x3b56=function(_0x26b4ba,_0x469d3d){_0x26b4ba=_0x26b4ba-0x0;var _0x577e09=_0xb563[_0x26b4ba];return _0x577e09;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x3b56('0x0')]},'username':{'type':Sequelize[_0x3b56('0x0')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x3b56('0x0')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize[_0x3b56('0x0')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x3b56('0x0')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x3b56('0x0')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index bc01917..4035683 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 _0xf202=['sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VtigerAccount','findAll','catch','show','params','keys','include','options','find','create','body','nolimit','findOne','AccountId','Subjects','getSubjects','channel','getDescriptions','VtigerConfiguration','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','POST','login','result','token','success','sessionName','autogenerated','reference','owner','remove','includes','label','startsWith','cf_','picklistValues','value','log','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0xf202,0x158));var _0x2f20=function(_0x4c6530,_0x143039){_0x4c6530=_0x4c6530-0x0;var _0x10ccc3=_0xf202[_0x4c6530];return _0x10ccc3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f20('0x0'));var zipdir=require(_0x2f20('0x1'));var jsonpatch=require(_0x2f20('0x2'));var rp=require(_0x2f20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2f20('0x4'));var util=require(_0x2f20('0x5'));var path=require(_0x2f20('0x6'));var sox=require(_0x2f20('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f20('0x8'));var _=require(_0x2f20('0x9'));var squel=require(_0x2f20('0xa'));var crypto=require(_0x2f20('0xb'));var jsforce=require(_0x2f20('0xc'));var deskjs=require(_0x2f20('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2f20('0xe'));var Papa=require(_0x2f20('0xf'));var Redis=require(_0x2f20('0x10'));var authService=require(_0x2f20('0x11'));var qs=require(_0x2f20('0x12'));var as=require(_0x2f20('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2f20('0x14'));var utils=require(_0x2f20('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x2f20('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2f20('0x17'));function respondWithStatusCode(_0x33b097,_0x51053f){_0x51053f=_0x51053f||0xcc;return function(_0x26902e){if(_0x26902e){return _0x33b097[_0x2f20('0x18')](_0x51053f);}return _0x33b097['status'](_0x51053f)['end']();};}function respondWithResult(_0x296749,_0x4774e5){_0x4774e5=_0x4774e5||0xc8;return function(_0x223762){if(_0x223762){return _0x296749[_0x2f20('0x19')](_0x4774e5)[_0x2f20('0x1a')](_0x223762);}};}function respondWithFilteredResult(_0x492568,_0x58a065){return function(_0x42e83c){if(_0x42e83c){var _0x4a581c=typeof _0x58a065[_0x2f20('0x1b')]===_0x2f20('0x1c')&&typeof _0x58a065[_0x2f20('0x1d')]===_0x2f20('0x1c');var _0x220c34=_0x42e83c[_0x2f20('0x1e')];var _0x600a35=_0x4a581c?0x0:_0x58a065[_0x2f20('0x1b')];var _0x1b07f3=_0x4a581c?_0x42e83c[_0x2f20('0x1e')]:_0x58a065[_0x2f20('0x1b')]+_0x58a065['limit'];var _0x14bd63;if(_0x1b07f3>=_0x220c34){_0x1b07f3=_0x220c34;_0x14bd63=0xc8;}else{_0x14bd63=0xce;}_0x492568[_0x2f20('0x19')](_0x14bd63);return _0x492568[_0x2f20('0x1f')](_0x2f20('0x20'),_0x600a35+'-'+_0x1b07f3+'/'+_0x220c34)[_0x2f20('0x1a')](_0x42e83c);}return null;};}function patchUpdates(_0x5c283d){return function(_0x251efb){try{jsonpatch[_0x2f20('0x21')](_0x251efb,_0x5c283d,!![]);}catch(_0xe87b73){return BPromise[_0x2f20('0x22')](_0xe87b73);}return _0x251efb[_0x2f20('0x23')]();};}function saveUpdates(_0x92c6f,_0x8cd7b6){return function(_0x45956e){if(_0x45956e){return _0x45956e[_0x2f20('0x24')](_0x92c6f)[_0x2f20('0x25')](function(_0x36247b){return _0x36247b;});}return null;};}function removeEntity(_0x4f9b00,_0x4ae0b5){return function(_0x40ecb1){if(_0x40ecb1){return _0x40ecb1[_0x2f20('0x26')]()['then'](function(){_0x4f9b00[_0x2f20('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x474c88,_0x3de28a){return function(_0x8aa02b){if(!_0x8aa02b){_0x474c88[_0x2f20('0x18')](0x194);}return _0x8aa02b;};}function handleError(_0x472140,_0x99f8cc){_0x99f8cc=_0x99f8cc||0x1f4;return function(_0x16c76){logger[_0x2f20('0x27')](_0x16c76['stack']);if(_0x16c76['name']){delete _0x16c76[_0x2f20('0x28')];}_0x472140[_0x2f20('0x19')](_0x99f8cc)['send'](_0x16c76);};}exports[_0x2f20('0x29')]=function(_0x4249e6,_0x471c37){var _0x1b6984={},_0x3342d2={},_0x4ee808={'count':0x0,'rows':[]};var _0x2c4e4f=_[_0x2f20('0x2a')](db['VtigerAccount'][_0x2f20('0x2b')],function(_0x4d1dd6){return{'name':_0x4d1dd6[_0x2f20('0x2c')],'type':_0x4d1dd6[_0x2f20('0x2d')]['key']};});_0x3342d2[_0x2f20('0x2e')]=_['map'](_0x2c4e4f,_0x2f20('0x28'));_0x3342d2[_0x2f20('0x2f')]=_['keys'](_0x4249e6['query']);_0x3342d2[_0x2f20('0x30')]=_[_0x2f20('0x31')](_0x3342d2['model'],_0x3342d2['query']);_0x1b6984[_0x2f20('0x32')]=_['intersection'](_0x3342d2[_0x2f20('0x2e')],qs[_0x2f20('0x33')](_0x4249e6[_0x2f20('0x2f')][_0x2f20('0x33')]));_0x1b6984[_0x2f20('0x32')]=_0x1b6984[_0x2f20('0x32')][_0x2f20('0x34')]?_0x1b6984['attributes']:_0x3342d2[_0x2f20('0x2e')];if(!_0x4249e6[_0x2f20('0x2f')][_0x2f20('0x35')]('nolimit')){_0x1b6984[_0x2f20('0x1d')]=qs[_0x2f20('0x1d')](_0x4249e6[_0x2f20('0x2f')][_0x2f20('0x1d')]);_0x1b6984[_0x2f20('0x1b')]=qs[_0x2f20('0x1b')](_0x4249e6['query'][_0x2f20('0x1b')]);}_0x1b6984[_0x2f20('0x36')]=qs['sort'](_0x4249e6['query'][_0x2f20('0x37')]);_0x1b6984['where']=qs[_0x2f20('0x30')](_[_0x2f20('0x38')](_0x4249e6[_0x2f20('0x2f')],_0x3342d2[_0x2f20('0x30')]),_0x2c4e4f);if(_0x4249e6[_0x2f20('0x2f')][_0x2f20('0x39')]){_0x1b6984['where']=_['merge'](_0x1b6984[_0x2f20('0x3a')],{'$or':_[_0x2f20('0x2a')](_0x2c4e4f,function(_0x58fed7){if(_0x58fed7[_0x2f20('0x2d')]!=='VIRTUAL'){var _0x2cfd4d={};_0x2cfd4d[_0x58fed7[_0x2f20('0x28')]]={'$like':'%'+_0x4249e6['query'][_0x2f20('0x39')]+'%'};return _0x2cfd4d;}})});}_0x1b6984=_[_0x2f20('0x3b')]({},_0x1b6984,_0x4249e6['options']);var _0x4bce8c={'where':_0x1b6984['where']};return db[_0x2f20('0x3c')][_0x2f20('0x1e')](_0x4bce8c)[_0x2f20('0x25')](function(_0x13f996){_0x4ee808['count']=_0x13f996;if(_0x4249e6[_0x2f20('0x2f')]['includeAll']){_0x1b6984['include']=[{'all':!![]}];}return db['VtigerAccount'][_0x2f20('0x3d')](_0x1b6984);})['then'](function(_0x3a2287){_0x4ee808['rows']=_0x3a2287;return _0x4ee808;})[_0x2f20('0x25')](respondWithFilteredResult(_0x471c37,_0x1b6984))[_0x2f20('0x3e')](handleError(_0x471c37,null));};exports[_0x2f20('0x3f')]=function(_0x363530,_0x2dd440){var _0x144da8={'raw':![],'where':{'id':_0x363530[_0x2f20('0x40')]['id']}},_0x1cb669={};_0x1cb669[_0x2f20('0x2e')]=_[_0x2f20('0x41')](db[_0x2f20('0x3c')][_0x2f20('0x2b')]);_0x1cb669['query']=_[_0x2f20('0x41')](_0x363530['query']);_0x1cb669[_0x2f20('0x30')]=_['intersection'](_0x1cb669[_0x2f20('0x2e')],_0x1cb669['query']);_0x144da8['attributes']=_[_0x2f20('0x31')](_0x1cb669[_0x2f20('0x2e')],qs[_0x2f20('0x33')](_0x363530[_0x2f20('0x2f')][_0x2f20('0x33')]));_0x144da8['attributes']=_0x144da8[_0x2f20('0x32')]['length']?_0x144da8[_0x2f20('0x32')]:_0x1cb669[_0x2f20('0x2e')];if(_0x363530[_0x2f20('0x2f')]['includeAll']){_0x144da8[_0x2f20('0x42')]=[{'all':!![]}];}_0x144da8=_[_0x2f20('0x3b')]({},_0x144da8,_0x363530[_0x2f20('0x43')]);return db[_0x2f20('0x3c')][_0x2f20('0x44')](_0x144da8)[_0x2f20('0x25')](handleEntityNotFound(_0x2dd440,null))[_0x2f20('0x25')](respondWithResult(_0x2dd440,null))[_0x2f20('0x3e')](handleError(_0x2dd440,null));};exports['create']=function(_0x436884,_0x1c0f8b){return db[_0x2f20('0x3c')][_0x2f20('0x45')](_0x436884[_0x2f20('0x46')],{})[_0x2f20('0x25')](respondWithResult(_0x1c0f8b,0xc9))[_0x2f20('0x3e')](handleError(_0x1c0f8b,null));};exports[_0x2f20('0x24')]=function(_0x41331d,_0x132e5a){if(_0x41331d[_0x2f20('0x46')]['id']){delete _0x41331d[_0x2f20('0x46')]['id'];}return db[_0x2f20('0x3c')][_0x2f20('0x44')]({'where':{'id':_0x41331d['params']['id']}})[_0x2f20('0x25')](handleEntityNotFound(_0x132e5a,null))['then'](saveUpdates(_0x41331d[_0x2f20('0x46')],null))[_0x2f20('0x25')](respondWithResult(_0x132e5a,null))[_0x2f20('0x3e')](handleError(_0x132e5a,null));};exports[_0x2f20('0x26')]=function(_0x2b000f,_0x48ebde){return db[_0x2f20('0x3c')][_0x2f20('0x44')]({'where':{'id':_0x2b000f[_0x2f20('0x40')]['id']}})[_0x2f20('0x25')](handleEntityNotFound(_0x48ebde,null))[_0x2f20('0x25')](removeEntity(_0x48ebde,null))[_0x2f20('0x3e')](handleError(_0x48ebde,null));};exports['getConfigurations']=function(_0x545790,_0x226e4a,_0x104065){var _0x2d9753={};var _0x79c7a={};var _0x117634;var _0x5cebab;return db[_0x2f20('0x3c')]['findOne']({'where':{'id':_0x545790[_0x2f20('0x40')]['id']}})[_0x2f20('0x25')](handleEntityNotFound(_0x226e4a,null))['then'](function(_0x3ff7a3){if(_0x3ff7a3){_0x117634=_0x3ff7a3;_0x79c7a[_0x2f20('0x2e')]=_[_0x2f20('0x41')](db['VtigerConfiguration'][_0x2f20('0x2b')]);_0x79c7a[_0x2f20('0x2f')]=_[_0x2f20('0x41')](_0x545790[_0x2f20('0x2f')]);_0x79c7a['filters']=_[_0x2f20('0x31')](_0x79c7a[_0x2f20('0x2e')],_0x79c7a[_0x2f20('0x2f')]);_0x2d9753[_0x2f20('0x32')]=_[_0x2f20('0x31')](_0x79c7a['model'],qs[_0x2f20('0x33')](_0x545790[_0x2f20('0x2f')][_0x2f20('0x33')]));_0x2d9753['attributes']=_0x2d9753[_0x2f20('0x32')][_0x2f20('0x34')]?_0x2d9753[_0x2f20('0x32')]:_0x79c7a['model'];_0x2d9753[_0x2f20('0x36')]=qs['sort'](_0x545790['query']['sort']);_0x2d9753[_0x2f20('0x3a')]=qs['filters'](_[_0x2f20('0x38')](_0x545790['query'],_0x79c7a[_0x2f20('0x30')]));if(_0x545790[_0x2f20('0x2f')][_0x2f20('0x39')]){_0x2d9753[_0x2f20('0x3a')]=_[_0x2f20('0x3b')](_0x2d9753[_0x2f20('0x3a')],{'$or':_['map'](_0x2d9753[_0x2f20('0x32')],function(_0x4d721b){var _0x5627f6={};_0x5627f6[_0x4d721b]={'$like':'%'+_0x545790['query'][_0x2f20('0x39')]+'%'};return _0x5627f6;})});}_0x2d9753=_[_0x2f20('0x3b')]({},_0x2d9753,_0x545790[_0x2f20('0x43')]);return _0x117634['getConfigurations'](_0x2d9753);}})['then'](function(_0x55601c){if(_0x55601c){_0x5cebab=_0x55601c[_0x2f20('0x34')];if(!_0x545790['query'][_0x2f20('0x35')](_0x2f20('0x47'))){_0x2d9753[_0x2f20('0x1d')]=qs['limit'](_0x545790[_0x2f20('0x2f')][_0x2f20('0x1d')]);_0x2d9753[_0x2f20('0x1b')]=qs[_0x2f20('0x1b')](_0x545790[_0x2f20('0x2f')][_0x2f20('0x1b')]);}return _0x117634['getConfigurations'](_0x2d9753);}})[_0x2f20('0x25')](function(_0x151096){if(_0x151096){return _0x151096?{'count':_0x5cebab,'rows':_0x151096}:null;}})[_0x2f20('0x25')](respondWithResult(_0x226e4a,null))['catch'](handleError(_0x226e4a,null));};exports['addConfiguration']=function(_0x586cb0,_0x570f50,_0x4b5048){if(_0x586cb0[_0x2f20('0x46')]['id']){delete _0x586cb0[_0x2f20('0x46')]['id'];}return db[_0x2f20('0x3c')][_0x2f20('0x48')]({'where':{'id':_0x586cb0[_0x2f20('0x40')]['id']}})[_0x2f20('0x25')](handleEntityNotFound(_0x570f50,null))[_0x2f20('0x25')](function(_0x52ceb5){if(_0x52ceb5){_0x586cb0['body'][_0x2f20('0x49')]=_0x52ceb5['id'];_0x586cb0[_0x2f20('0x46')][_0x2f20('0x4a')]=integrations[_0x2f20('0x4b')](_0x586cb0[_0x2f20('0x46')][_0x2f20('0x4c')],_0x586cb0[_0x2f20('0x46')]['type']);_0x586cb0[_0x2f20('0x46')]['Descriptions']=integrations[_0x2f20('0x4d')](_0x586cb0[_0x2f20('0x46')][_0x2f20('0x4c')],_0x586cb0[_0x2f20('0x46')][_0x2f20('0x2d')]);return db[_0x2f20('0x4e')]['create'](_0x586cb0[_0x2f20('0x46')],{'include':[{'model':db[_0x2f20('0x4f')],'as':_0x2f20('0x4a')},{'model':db[_0x2f20('0x4f')],'as':_0x2f20('0x50')}]});}return null;})[_0x2f20('0x25')](respondWithResult(_0x570f50,null))['catch'](handleError(_0x570f50,null));};var md5=require(_0x2f20('0x51'));exports[_0x2f20('0x52')]=function(_0x28151d,_0x3d4e5d,_0x30d23d){var _0x370204=null;var _0x25c033=null;var _0x467573=null;var _0xa6cd07=null;var _0x42b6dc='';return db[_0x2f20('0x3c')][_0x2f20('0x48')]({'where':{'id':_0x28151d[_0x2f20('0x40')]['id']},'attributes':['id','name',_0x2f20('0x53'),_0x2f20('0x54'),_0x2f20('0x55'),_0x2f20('0x56'),_0x2f20('0x57'),_0x2f20('0x58')]})[_0x2f20('0x25')](handleEntityNotFound(_0x3d4e5d,null))[_0x2f20('0x25')](function(_0x240d88){if(_0x240d88){_0x370204=_0x240d88[_0x2f20('0x53')];_0x25c033=_0x240d88['accessKey'];_0x467573=_0x240d88[_0x2f20('0x55')];_0x42b6dc=_0x240d88['remoteUri'];var _0x54d1e6=_0x42b6dc['slice'](-0x1);if(_0x54d1e6==='/'){_0x42b6dc=_0x42b6dc[_0x2f20('0x59')](0x0,_0x42b6dc[_0x2f20('0x5a')](_0x54d1e6));}_0xa6cd07=util[_0x2f20('0x5b')](_0x2f20('0x5c'),_0x42b6dc);var _0x231a69={'method':_0x2f20('0x5d'),'uri':_0xa6cd07,'qs':{'operation':_0x2f20('0x5e'),'username':_0x240d88[_0x2f20('0x53')]},'json':!![]};return rp(_0x231a69);}})[_0x2f20('0x25')](function(_0x467874){if(_0x467874['success']){var _0x5b530a={'method':_0x2f20('0x5f'),'uri':_0xa6cd07,'form':{'operation':_0x2f20('0x60'),'username':_0x370204,'accessKey':md5(_0x467874[_0x2f20('0x61')][_0x2f20('0x62')]+_0x25c033)},'json':!![]};return rp(_0x5b530a);}})['then'](function(_0x28b701){if(_0x28b701[_0x2f20('0x63')]){var _0x27c47d={'method':_0x2f20('0x5d'),'uri':_0xa6cd07,'qs':{'operation':'describe','username':_0x370204,'sessionName':_0x28b701[_0x2f20('0x61')][_0x2f20('0x64')],'elementType':_0x467573},'json':!![]};return rp(_0x27c47d);}})[_0x2f20('0x25')](function(_0x2e5c12){if(_0x2e5c12['success']){var _0x3d1316=[_0x2f20('0x65'),_0x2f20('0x66'),_0x2f20('0x67')];_[_0x2f20('0x68')](_0x2e5c12[_0x2f20('0x61')]['fields'],function(_0x36367a){return _0x3d1316[_0x2f20('0x69')](_0x36367a[_0x2f20('0x2d')]['name']);});_['remove'](_0x2e5c12[_0x2f20('0x61')][_0x2f20('0x33')],function(_0x276914){return _0x276914['editable']==='false';});return{'count':_0x2e5c12[_0x2f20('0x61')]['fields'][_0x2f20('0x34')],'rows':_['map'](_0x2e5c12[_0x2f20('0x61')][_0x2f20('0x33')],function(_0x604d7e){return{'id':_0x604d7e[_0x2f20('0x28')],'name':_0x604d7e[_0x2f20('0x6a')],'custom':_[_0x2f20('0x6b')](_0x604d7e[_0x2f20('0x28')],_0x2f20('0x6c'))?!![]:![],'options':_0x604d7e[_0x2f20('0x2d')][_0x2f20('0x28')]==='picklist'&&_0x604d7e[_0x2f20('0x2d')][_0x2f20('0x6d')][_0x2f20('0x34')]>0x0?_[_0x2f20('0x2a')](_0x604d7e[_0x2f20('0x2d')][_0x2f20('0x6d')],function(_0x284d3d){return{'name':_0x284d3d[_0x2f20('0x6a')],'value':_0x284d3d[_0x2f20('0x6e')]};}):[]};})};}})[_0x2f20('0x25')](respondWithResult(_0x3d4e5d,null))['catch'](function(_0x167f90){console[_0x2f20('0x6f')]('vTiger\x20error:\x20'+_0x167f90);var _0xfb063d=_0x28151d[_0x2f20('0x2f')][_0x2f20('0x70')]?0x1f4:_0x167f90[_0x2f20('0x71')]||0x1f4;logger[_0x2f20('0x27')](_0x2f20('0x72'),_0x2f20('0x52'),_0xfb063d,JSON[_0x2f20('0x73')](_0x167f90));delete _0x167f90['name'];if(_0xfb063d===0x191){_0xfb063d=0x190;}_0x3d4e5d['status'](_0xfb063d)['send'](_0x28151d['query'][_0x2f20('0x70')]?{'message':_0x2f20('0x74'),'statusCode':_0x167f90[_0x2f20('0x71')]}:_0x167f90);});}; \ No newline at end of file +var _0x8c31=['model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','options','find','body','VtigerConfiguration','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','VtigerField','md5','getFields','findOne','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','GET','success','POST','login','result','describe','sessionName','autogenerated','owner','remove','includes','editable','label','startsWith','picklist','picklistValues','value','log','test','statusCode','stringify','send','Wrong\x20credentials','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','error','name','index','map','VtigerAccount','rawAttributes','fieldName','type','key'];(function(_0x2ab9d2,_0x3294ac){var _0x2bb88a=function(_0x455338){while(--_0x455338){_0x2ab9d2['push'](_0x2ab9d2['shift']());}};_0x2bb88a(++_0x3294ac);}(_0x8c31,0x13d));var _0x18c3=function(_0x5e641a,_0xbc3567){_0x5e641a=_0x5e641a-0x0;var _0x45a9fe=_0x8c31[_0x5e641a];return _0x45a9fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18c3('0x0'));var jsonpatch=require(_0x18c3('0x1'));var rp=require('request-promise');var moment=require(_0x18c3('0x2'));var BPromise=require(_0x18c3('0x3'));var Mustache=require(_0x18c3('0x4'));var util=require('util');var path=require('path');var sox=require(_0x18c3('0x5'));var csv=require(_0x18c3('0x6'));var ejs=require(_0x18c3('0x7'));var fs=require('fs');var fs_extra=require(_0x18c3('0x8'));var _=require(_0x18c3('0x9'));var squel=require(_0x18c3('0xa'));var crypto=require(_0x18c3('0xb'));var jsforce=require(_0x18c3('0xc'));var deskjs=require(_0x18c3('0xd'));var toCsv=require(_0x18c3('0x6'));var querystring=require(_0x18c3('0xe'));var Papa=require(_0x18c3('0xf'));var Redis=require(_0x18c3('0x10'));var authService=require(_0x18c3('0x11'));var qs=require(_0x18c3('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x18c3('0x13'));var logger=require('../../config/logger')(_0x18c3('0x14'));var utils=require(_0x18c3('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x18c3('0x16'));var db=require(_0x18c3('0x17'))['db'];var integrations=require(_0x18c3('0x18'));function respondWithStatusCode(_0x5646a8,_0xdbb66c){_0xdbb66c=_0xdbb66c||0xcc;return function(_0x4949f1){if(_0x4949f1){return _0x5646a8[_0x18c3('0x19')](_0xdbb66c);}return _0x5646a8[_0x18c3('0x1a')](_0xdbb66c)[_0x18c3('0x1b')]();};}function respondWithResult(_0x82e3d4,_0x3d72a4){_0x3d72a4=_0x3d72a4||0xc8;return function(_0x1f5ec7){if(_0x1f5ec7){return _0x82e3d4[_0x18c3('0x1a')](_0x3d72a4)[_0x18c3('0x1c')](_0x1f5ec7);}};}function respondWithFilteredResult(_0x65bd2c,_0x47592f){return function(_0x4a7851){if(_0x4a7851){var _0xc35062=typeof _0x47592f[_0x18c3('0x1d')]==='undefined'&&typeof _0x47592f[_0x18c3('0x1e')]===_0x18c3('0x1f');var _0x38a550=_0x4a7851[_0x18c3('0x20')];var _0x2e8fff=_0xc35062?0x0:_0x47592f[_0x18c3('0x1d')];var _0x4037fc=_0xc35062?_0x4a7851[_0x18c3('0x20')]:_0x47592f[_0x18c3('0x1d')]+_0x47592f[_0x18c3('0x1e')];var _0x3357c8;if(_0x4037fc>=_0x38a550){_0x4037fc=_0x38a550;_0x3357c8=0xc8;}else{_0x3357c8=0xce;}_0x65bd2c[_0x18c3('0x1a')](_0x3357c8);return _0x65bd2c[_0x18c3('0x21')](_0x18c3('0x22'),_0x2e8fff+'-'+_0x4037fc+'/'+_0x38a550)['json'](_0x4a7851);}return null;};}function patchUpdates(_0x4a6a92){return function(_0x14af9b){try{jsonpatch[_0x18c3('0x23')](_0x14af9b,_0x4a6a92,!![]);}catch(_0x2d58fa){return BPromise[_0x18c3('0x24')](_0x2d58fa);}return _0x14af9b[_0x18c3('0x25')]();};}function saveUpdates(_0x3b97ca,_0x179cbf){return function(_0x441160){if(_0x441160){return _0x441160[_0x18c3('0x26')](_0x3b97ca)[_0x18c3('0x27')](function(_0x297b8f){return _0x297b8f;});}return null;};}function removeEntity(_0x3368d7,_0x113e52){return function(_0x44ded1){if(_0x44ded1){return _0x44ded1['destroy']()[_0x18c3('0x27')](function(){_0x3368d7[_0x18c3('0x1a')](0xcc)[_0x18c3('0x1b')]();});}};}function handleEntityNotFound(_0x164526,_0x4f9cff){return function(_0x4f798c){if(!_0x4f798c){_0x164526['sendStatus'](0x194);}return _0x4f798c;};}function handleError(_0x46e15c,_0x14f58b){_0x14f58b=_0x14f58b||0x1f4;return function(_0x10db29){logger[_0x18c3('0x28')](_0x10db29['stack']);if(_0x10db29[_0x18c3('0x29')]){delete _0x10db29[_0x18c3('0x29')];}_0x46e15c['status'](_0x14f58b)['send'](_0x10db29);};}exports[_0x18c3('0x2a')]=function(_0x4c7d0e,_0x3a5be5){var _0x33c428={},_0x336096={},_0x40b28c={'count':0x0,'rows':[]};var _0x4211eb=_[_0x18c3('0x2b')](db[_0x18c3('0x2c')][_0x18c3('0x2d')],function(_0x5cdf85){return{'name':_0x5cdf85[_0x18c3('0x2e')],'type':_0x5cdf85[_0x18c3('0x2f')][_0x18c3('0x30')]};});_0x336096[_0x18c3('0x31')]=_['map'](_0x4211eb,'name');_0x336096[_0x18c3('0x32')]=_[_0x18c3('0x33')](_0x4c7d0e[_0x18c3('0x32')]);_0x336096[_0x18c3('0x34')]=_[_0x18c3('0x35')](_0x336096[_0x18c3('0x31')],_0x336096[_0x18c3('0x32')]);_0x33c428['attributes']=_[_0x18c3('0x35')](_0x336096[_0x18c3('0x31')],qs['fields'](_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x36')]));_0x33c428[_0x18c3('0x37')]=_0x33c428['attributes']['length']?_0x33c428[_0x18c3('0x37')]:_0x336096[_0x18c3('0x31')];if(!_0x4c7d0e['query']['hasOwnProperty'](_0x18c3('0x38'))){_0x33c428[_0x18c3('0x1e')]=qs[_0x18c3('0x1e')](_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x1e')]);_0x33c428[_0x18c3('0x1d')]=qs['offset'](_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x1d')]);}_0x33c428[_0x18c3('0x39')]=qs[_0x18c3('0x3a')](_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x3a')]);_0x33c428['where']=qs[_0x18c3('0x34')](_[_0x18c3('0x3b')](_0x4c7d0e[_0x18c3('0x32')],_0x336096[_0x18c3('0x34')]),_0x4211eb);if(_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x3c')]){_0x33c428[_0x18c3('0x3d')]=_['merge'](_0x33c428[_0x18c3('0x3d')],{'$or':_[_0x18c3('0x2b')](_0x4211eb,function(_0x5d68f1){if(_0x5d68f1['type']!==_0x18c3('0x3e')){var _0x598914={};_0x598914[_0x5d68f1[_0x18c3('0x29')]]={'$like':'%'+_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x3c')]+'%'};return _0x598914;}})});}_0x33c428=_[_0x18c3('0x3f')]({},_0x33c428,_0x4c7d0e['options']);var _0x1196b3={'where':_0x33c428[_0x18c3('0x3d')]};return db['VtigerAccount']['count'](_0x1196b3)[_0x18c3('0x27')](function(_0x10c6d2){_0x40b28c['count']=_0x10c6d2;if(_0x4c7d0e[_0x18c3('0x32')][_0x18c3('0x40')]){_0x33c428[_0x18c3('0x41')]=[{'all':!![]}];}return db[_0x18c3('0x2c')][_0x18c3('0x42')](_0x33c428);})[_0x18c3('0x27')](function(_0x79e2ba){_0x40b28c[_0x18c3('0x43')]=_0x79e2ba;return _0x40b28c;})[_0x18c3('0x27')](respondWithFilteredResult(_0x3a5be5,_0x33c428))[_0x18c3('0x44')](handleError(_0x3a5be5,null));};exports[_0x18c3('0x45')]=function(_0x2a3323,_0x1d1066){var _0x1047a0={'raw':![],'where':{'id':_0x2a3323[_0x18c3('0x46')]['id']}},_0x17da4a={};_0x17da4a[_0x18c3('0x31')]=_[_0x18c3('0x33')](db['VtigerAccount']['rawAttributes']);_0x17da4a['query']=_['keys'](_0x2a3323[_0x18c3('0x32')]);_0x17da4a[_0x18c3('0x34')]=_[_0x18c3('0x35')](_0x17da4a[_0x18c3('0x31')],_0x17da4a[_0x18c3('0x32')]);_0x1047a0[_0x18c3('0x37')]=_[_0x18c3('0x35')](_0x17da4a[_0x18c3('0x31')],qs[_0x18c3('0x36')](_0x2a3323[_0x18c3('0x32')][_0x18c3('0x36')]));_0x1047a0[_0x18c3('0x37')]=_0x1047a0[_0x18c3('0x37')][_0x18c3('0x47')]?_0x1047a0['attributes']:_0x17da4a['model'];if(_0x2a3323['query'][_0x18c3('0x40')]){_0x1047a0['include']=[{'all':!![]}];}_0x1047a0=_[_0x18c3('0x3f')]({},_0x1047a0,_0x2a3323[_0x18c3('0x48')]);return db[_0x18c3('0x2c')][_0x18c3('0x49')](_0x1047a0)[_0x18c3('0x27')](handleEntityNotFound(_0x1d1066,null))[_0x18c3('0x27')](respondWithResult(_0x1d1066,null))[_0x18c3('0x44')](handleError(_0x1d1066,null));};exports['create']=function(_0x5ec81e,_0x24b174){return db[_0x18c3('0x2c')]['create'](_0x5ec81e[_0x18c3('0x4a')],{})['then'](respondWithResult(_0x24b174,0xc9))[_0x18c3('0x44')](handleError(_0x24b174,null));};exports[_0x18c3('0x26')]=function(_0x5e3f25,_0xe3c1ec){if(_0x5e3f25[_0x18c3('0x4a')]['id']){delete _0x5e3f25['body']['id'];}return db[_0x18c3('0x2c')]['find']({'where':{'id':_0x5e3f25[_0x18c3('0x46')]['id']}})['then'](handleEntityNotFound(_0xe3c1ec,null))[_0x18c3('0x27')](saveUpdates(_0x5e3f25[_0x18c3('0x4a')],null))[_0x18c3('0x27')](respondWithResult(_0xe3c1ec,null))[_0x18c3('0x44')](handleError(_0xe3c1ec,null));};exports['destroy']=function(_0x3fdedc,_0x46f868){return db[_0x18c3('0x2c')][_0x18c3('0x49')]({'where':{'id':_0x3fdedc['params']['id']}})[_0x18c3('0x27')](handleEntityNotFound(_0x46f868,null))['then'](removeEntity(_0x46f868,null))[_0x18c3('0x44')](handleError(_0x46f868,null));};exports['getConfigurations']=function(_0x3b45a6,_0x1cbc8a,_0x2ba02e){var _0x476757={};var _0x21dc4b={};var _0x1bef79;var _0x559ce3;return db[_0x18c3('0x2c')]['findOne']({'where':{'id':_0x3b45a6[_0x18c3('0x46')]['id']}})[_0x18c3('0x27')](handleEntityNotFound(_0x1cbc8a,null))[_0x18c3('0x27')](function(_0x42b62c){if(_0x42b62c){_0x1bef79=_0x42b62c;_0x21dc4b[_0x18c3('0x31')]=_[_0x18c3('0x33')](db[_0x18c3('0x4b')]['rawAttributes']);_0x21dc4b[_0x18c3('0x32')]=_[_0x18c3('0x33')](_0x3b45a6[_0x18c3('0x32')]);_0x21dc4b[_0x18c3('0x34')]=_['intersection'](_0x21dc4b[_0x18c3('0x31')],_0x21dc4b[_0x18c3('0x32')]);_0x476757[_0x18c3('0x37')]=_[_0x18c3('0x35')](_0x21dc4b['model'],qs['fields'](_0x3b45a6['query'][_0x18c3('0x36')]));_0x476757['attributes']=_0x476757[_0x18c3('0x37')]['length']?_0x476757[_0x18c3('0x37')]:_0x21dc4b[_0x18c3('0x31')];_0x476757[_0x18c3('0x39')]=qs[_0x18c3('0x3a')](_0x3b45a6[_0x18c3('0x32')]['sort']);_0x476757[_0x18c3('0x3d')]=qs[_0x18c3('0x34')](_[_0x18c3('0x3b')](_0x3b45a6[_0x18c3('0x32')],_0x21dc4b[_0x18c3('0x34')]));if(_0x3b45a6[_0x18c3('0x32')][_0x18c3('0x3c')]){_0x476757[_0x18c3('0x3d')]=_[_0x18c3('0x3f')](_0x476757['where'],{'$or':_[_0x18c3('0x2b')](_0x476757[_0x18c3('0x37')],function(_0x2f071f){var _0x5efef5={};_0x5efef5[_0x2f071f]={'$like':'%'+_0x3b45a6[_0x18c3('0x32')][_0x18c3('0x3c')]+'%'};return _0x5efef5;})});}_0x476757=_[_0x18c3('0x3f')]({},_0x476757,_0x3b45a6[_0x18c3('0x48')]);return _0x1bef79[_0x18c3('0x4c')](_0x476757);}})[_0x18c3('0x27')](function(_0xe5f004){if(_0xe5f004){_0x559ce3=_0xe5f004['length'];if(!_0x3b45a6[_0x18c3('0x32')][_0x18c3('0x4d')](_0x18c3('0x38'))){_0x476757['limit']=qs[_0x18c3('0x1e')](_0x3b45a6[_0x18c3('0x32')][_0x18c3('0x1e')]);_0x476757[_0x18c3('0x1d')]=qs['offset'](_0x3b45a6[_0x18c3('0x32')]['offset']);}return _0x1bef79[_0x18c3('0x4c')](_0x476757);}})['then'](function(_0x233e6b){if(_0x233e6b){return _0x233e6b?{'count':_0x559ce3,'rows':_0x233e6b}:null;}})['then'](respondWithResult(_0x1cbc8a,null))[_0x18c3('0x44')](handleError(_0x1cbc8a,null));};exports[_0x18c3('0x4e')]=function(_0x341505,_0x2906d8,_0x4f4268){if(_0x341505[_0x18c3('0x4a')]['id']){delete _0x341505[_0x18c3('0x4a')]['id'];}return db['VtigerAccount']['findOne']({'where':{'id':_0x341505[_0x18c3('0x46')]['id']}})['then'](handleEntityNotFound(_0x2906d8,null))[_0x18c3('0x27')](function(_0x422e5b){if(_0x422e5b){_0x341505['body'][_0x18c3('0x4f')]=_0x422e5b['id'];_0x341505[_0x18c3('0x4a')][_0x18c3('0x50')]=integrations[_0x18c3('0x51')](_0x341505[_0x18c3('0x4a')][_0x18c3('0x52')],_0x341505['body'][_0x18c3('0x2f')]);_0x341505[_0x18c3('0x4a')][_0x18c3('0x53')]=integrations[_0x18c3('0x54')](_0x341505['body'][_0x18c3('0x52')],_0x341505[_0x18c3('0x4a')][_0x18c3('0x2f')]);return db[_0x18c3('0x4b')]['create'](_0x341505[_0x18c3('0x4a')],{'include':[{'model':db[_0x18c3('0x55')],'as':_0x18c3('0x50')},{'model':db[_0x18c3('0x55')],'as':_0x18c3('0x53')}]});}return null;})['then'](respondWithResult(_0x2906d8,null))[_0x18c3('0x44')](handleError(_0x2906d8,null));};var md5=require(_0x18c3('0x56'));exports[_0x18c3('0x57')]=function(_0x46cba0,_0x1b448d,_0x1e9b57){var _0x30b618=null;var _0x50b944=null;var _0x4c8ec4=null;var _0x3a4837=null;var _0x40e50f='';return db['VtigerAccount'][_0x18c3('0x58')]({'where':{'id':_0x46cba0[_0x18c3('0x46')]['id']},'attributes':['id',_0x18c3('0x29'),_0x18c3('0x59'),_0x18c3('0x5a'),_0x18c3('0x5b'),_0x18c3('0x5c'),_0x18c3('0x5d'),'accessKey']})[_0x18c3('0x27')](handleEntityNotFound(_0x1b448d,null))['then'](function(_0x567334){if(_0x567334){_0x30b618=_0x567334[_0x18c3('0x59')];_0x50b944=_0x567334[_0x18c3('0x5e')];_0x4c8ec4=_0x567334[_0x18c3('0x5b')];_0x40e50f=_0x567334[_0x18c3('0x5c')];var _0x15df3d=_0x40e50f[_0x18c3('0x5f')](-0x1);if(_0x15df3d==='/'){_0x40e50f=_0x40e50f[_0x18c3('0x60')](0x0,_0x40e50f[_0x18c3('0x61')](_0x15df3d));}_0x3a4837=util[_0x18c3('0x62')]('%s/webservice.php',_0x40e50f);var _0x16bb3b={'method':_0x18c3('0x63'),'uri':_0x3a4837,'qs':{'operation':'getchallenge','username':_0x567334[_0x18c3('0x59')]},'json':!![]};return rp(_0x16bb3b);}})['then'](function(_0x10fff0){if(_0x10fff0[_0x18c3('0x64')]){var _0x38ded7={'method':_0x18c3('0x65'),'uri':_0x3a4837,'form':{'operation':_0x18c3('0x66'),'username':_0x30b618,'accessKey':md5(_0x10fff0[_0x18c3('0x67')]['token']+_0x50b944)},'json':!![]};return rp(_0x38ded7);}})[_0x18c3('0x27')](function(_0x1924ba){if(_0x1924ba[_0x18c3('0x64')]){var _0x24f1ee={'method':_0x18c3('0x63'),'uri':_0x3a4837,'qs':{'operation':_0x18c3('0x68'),'username':_0x30b618,'sessionName':_0x1924ba[_0x18c3('0x67')][_0x18c3('0x69')],'elementType':_0x4c8ec4},'json':!![]};return rp(_0x24f1ee);}})[_0x18c3('0x27')](function(_0x3398fd){if(_0x3398fd[_0x18c3('0x64')]){var _0x5afa29=[_0x18c3('0x6a'),'reference',_0x18c3('0x6b')];_[_0x18c3('0x6c')](_0x3398fd[_0x18c3('0x67')]['fields'],function(_0x787d4e){return _0x5afa29[_0x18c3('0x6d')](_0x787d4e[_0x18c3('0x2f')][_0x18c3('0x29')]);});_[_0x18c3('0x6c')](_0x3398fd['result'][_0x18c3('0x36')],function(_0x19defb){return _0x19defb[_0x18c3('0x6e')]==='false';});return{'count':_0x3398fd[_0x18c3('0x67')][_0x18c3('0x36')][_0x18c3('0x47')],'rows':_[_0x18c3('0x2b')](_0x3398fd['result'][_0x18c3('0x36')],function(_0x20f4b3){return{'id':_0x20f4b3[_0x18c3('0x29')],'name':_0x20f4b3[_0x18c3('0x6f')],'custom':_[_0x18c3('0x70')](_0x20f4b3['name'],'cf_')?!![]:![],'options':_0x20f4b3[_0x18c3('0x2f')][_0x18c3('0x29')]===_0x18c3('0x71')&&_0x20f4b3[_0x18c3('0x2f')][_0x18c3('0x72')]['length']>0x0?_['map'](_0x20f4b3['type']['picklistValues'],function(_0x6a0bd2){return{'name':_0x6a0bd2['label'],'value':_0x6a0bd2[_0x18c3('0x73')]};}):[]};})};}})[_0x18c3('0x27')](respondWithResult(_0x1b448d,null))[_0x18c3('0x44')](function(_0x485010){console[_0x18c3('0x74')]('vTiger\x20error:\x20'+_0x485010);var _0x1a8239=_0x46cba0[_0x18c3('0x32')][_0x18c3('0x75')]?0x1f4:_0x485010[_0x18c3('0x76')]||0x1f4;logger[_0x18c3('0x28')]('getFields,\x20%s,\x20%s,\x20%s',_0x18c3('0x57'),_0x1a8239,JSON[_0x18c3('0x77')](_0x485010));delete _0x485010[_0x18c3('0x29')];if(_0x1a8239===0x191){_0x1a8239=0x190;}_0x1b448d[_0x18c3('0x1a')](_0x1a8239)[_0x18c3('0x78')](_0x46cba0[_0x18c3('0x32')]['test']?{'message':_0x18c3('0x79'),'statusCode':_0x485010['statusCode']}:_0x485010);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index d066c2e..3718faa 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 _0xd318=['path','rimraf','../../config/environment','./intVtigerAccount.attributes','define','int_vtiger_accounts','util','../../config/logger','api','moment','request-promise'];(function(_0x4eb6c0,_0x35e903){var _0x18b7f8=function(_0xd6618e){while(--_0xd6618e){_0x4eb6c0['push'](_0x4eb6c0['shift']());}};_0x18b7f8(++_0x35e903);}(_0xd318,0x119));var _0x8d31=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd318[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x8d31('0x0'));var logger=require(_0x8d31('0x1'))(_0x8d31('0x2'));var moment=require(_0x8d31('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d31('0x4'));var fs=require('fs');var path=require(_0x8d31('0x5'));var rimraf=require(_0x8d31('0x6'));var config=require(_0x8d31('0x7'));var attributes=require(_0x8d31('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1a6de2,_0x4246e3){return _0x1a6de2[_0x8d31('0x9')]('VtigerAccount',attributes,{'tableName':_0x8d31('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbf7e=['request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','define','int_vtiger_accounts','util','../../config/logger','moment','bluebird'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xbf7e,0xc8));var _0xebf7=function(_0x5585e8,_0x2ec54c){_0x5585e8=_0x5585e8-0x0;var _0x5bcd57=_0xbf7e[_0x5585e8];return _0x5bcd57;};'use strict';var _=require('lodash');var util=require(_0xebf7('0x0'));var logger=require(_0xebf7('0x1'))('api');var moment=require(_0xebf7('0x2'));var BPromise=require(_0xebf7('0x3'));var rp=require(_0xebf7('0x4'));var fs=require('fs');var path=require(_0xebf7('0x5'));var rimraf=require(_0xebf7('0x6'));var config=require(_0xebf7('0x7'));var attributes=require(_0xebf7('0x8'));var integrations=require(_0xebf7('0x9'));module['exports']=function(_0x560301,_0x18bf18){return _0x560301[_0xebf7('0xa')]('VtigerAccount',attributes,{'tableName':_0xebf7('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 13a467b..1d5325b 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 _0x0bb5=['VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','options','raw','where','limit','map','include','model','attributes','GetVtigerAccount','ShowVtigerAccount','VtigerAccount','find','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info'];(function(_0x2a9eb1,_0xf77af3){var _0x27c480=function(_0x2ba5d1){while(--_0x2ba5d1){_0x2a9eb1['push'](_0x2a9eb1['shift']());}};_0x27c480(++_0xf77af3);}(_0x0bb5,0x148));var _0x50bb=function(_0x1aa074,_0xe71ab8){_0x1aa074=_0x1aa074-0x0;var _0x162750=_0x0bb5[_0x1aa074];return _0x162750;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});}exports['GetVtigerAccount']=function(_0x24ba19){var _0x4796ec=this;return new Promise(function(_0x301f61,_0x431ed4){return db['VtigerAccount']['findAll']({'raw':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x24ba19[_0x50bb('0x16')]?_0x24ba19['options'][_0x50bb('0x18')]||null:null,'attributes':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')]['attributes']||null:null,'limit':_0x24ba19[_0x50bb('0x16')]?_0x24ba19[_0x50bb('0x16')][_0x50bb('0x19')]||null:null,'include':_0x24ba19['options']?_0x24ba19[_0x50bb('0x16')]['include']?_[_0x50bb('0x1a')](_0x24ba19[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x2ee87a){return{'model':db[_0x2ee87a[_0x50bb('0x1c')]],'as':_0x2ee87a['as'],'attributes':_0x2ee87a[_0x50bb('0x1d')],'include':_0x2ee87a['include']?_[_0x50bb('0x1a')](_0x2ee87a[_0x50bb('0x1b')],function(_0x284a76){return{'model':db[_0x284a76[_0x50bb('0x1c')]],'as':_0x284a76['as'],'attributes':_0x284a76['attributes'],'include':_0x284a76[_0x50bb('0x1b')]?_['map'](_0x284a76['include'],function(_0x2befd9){return{'model':db[_0x2befd9['model']],'as':_0x2befd9['as'],'attributes':_0x2befd9['attributes']};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x12ee2c){logger[_0x50bb('0xb')](_0x50bb('0x1e'),_0x24ba19);logger[_0x50bb('0xd')](_0x50bb('0x1e'),_0x24ba19,JSON[_0x50bb('0x10')](_0x12ee2c));_0x301f61(_0x12ee2c);})[_0x50bb('0x15')](function(_0x4f7514){logger[_0x50bb('0x11')](_0x50bb('0x1e'),_0x4f7514[_0x50bb('0x13')],_0x24ba19);_0x431ed4(_0x4796ec[_0x50bb('0x11')](0x1f4,_0x4f7514['message']));});});};exports[_0x50bb('0x1f')]=function(_0x1a62fb){var _0xc38da5=this;return new Promise(function(_0xb3c3ba,_0x3fd5f6){return db[_0x50bb('0x20')][_0x50bb('0x21')]({'raw':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x17')]===undefined?!![]:![]:!![],'where':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')]['where']||null:null,'attributes':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1d')]||null:null,'include':_0x1a62fb[_0x50bb('0x16')]?_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1a62fb[_0x50bb('0x16')][_0x50bb('0x1b')],function(_0x1cc4e2){return{'model':db[_0x1cc4e2[_0x50bb('0x1c')]],'as':_0x1cc4e2['as'],'attributes':_0x1cc4e2['attributes'],'include':_0x1cc4e2[_0x50bb('0x1b')]?_[_0x50bb('0x1a')](_0x1cc4e2[_0x50bb('0x1b')],function(_0x2bfb54){return{'model':db[_0x2bfb54[_0x50bb('0x1c')]],'as':_0x2bfb54['as'],'attributes':_0x2bfb54[_0x50bb('0x1d')],'include':_0x2bfb54['include']?_['map'](_0x2bfb54[_0x50bb('0x1b')],function(_0x5ed0b4){return{'model':db[_0x5ed0b4[_0x50bb('0x1c')]],'as':_0x5ed0b4['as'],'attributes':_0x5ed0b4[_0x50bb('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x50bb('0xa')](function(_0x171c6b){logger[_0x50bb('0xb')]('ShowVtigerAccount',_0x1a62fb);logger[_0x50bb('0xd')]('ShowVtigerAccount',_0x1a62fb,JSON[_0x50bb('0x10')](_0x171c6b));_0xb3c3ba(_0x171c6b);})[_0x50bb('0x15')](function(_0x280e5a){logger['error']('ShowVtigerAccount',_0x280e5a[_0x50bb('0x13')],_0x1a62fb);_0x3fd5f6(_0xc38da5[_0x50bb('0x11')](0x1f4,_0x280e5a[_0x50bb('0x13')]));});});}; \ No newline at end of file +var _0xa571=['http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetVtigerAccount','VtigerAccount','findAll','options','where','limit','include','map','model','attributes','ShowVtigerAccount','find','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client'];(function(_0x14794a,_0x15990e){var _0x55ed3c=function(_0x5f512e){while(--_0x5f512e){_0x14794a['push'](_0x14794a['shift']());}};_0x55ed3c(++_0x15990e);}(_0xa571,0x107));var _0x1a57=function(_0xb08125,_0x561acb){_0xb08125=_0xb08125-0x0;var _0x2ace23=_0xa571[_0xb08125];return _0x2ace23;};'use strict';var _=require(_0x1a57('0x0'));var util=require(_0x1a57('0x1'));var moment=require(_0x1a57('0x2'));var BPromise=require(_0x1a57('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a57('0x4'));var db=require(_0x1a57('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1a57('0x6'));var config=require('../../config/environment');var jayson=require(_0x1a57('0x7'));var client=jayson[_0x1a57('0x8')][_0x1a57('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c5352,_0x2492f5,_0x924873){return new BPromise(function(_0x5d9f45,_0x3edb40){return client[_0x1a57('0xa')](_0x3c5352,_0x924873)[_0x1a57('0xb')](function(_0x58e266){logger[_0x1a57('0xc')](_0x1a57('0xd'),_0x2492f5,_0x1a57('0xe'));logger[_0x1a57('0xf')](_0x1a57('0x10'),_0x2492f5,_0x1a57('0xe'),JSON[_0x1a57('0x11')](_0x58e266));if(_0x58e266[_0x1a57('0x12')]){if(_0x58e266['error']['code']===0x1f4){logger[_0x1a57('0x12')](_0x1a57('0xd'),_0x2492f5,_0x58e266[_0x1a57('0x12')]['message']);return _0x3edb40(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}logger['error'](_0x1a57('0xd'),_0x2492f5,_0x58e266['error'][_0x1a57('0x13')]);return _0x5d9f45(_0x58e266[_0x1a57('0x12')][_0x1a57('0x13')]);}else{logger[_0x1a57('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1a57('0xe'));_0x5d9f45(_0x58e266['result']['message']);}})[_0x1a57('0x14')](function(_0x1c537f){logger[_0x1a57('0x12')]('VtigerAccount,\x20%s,\x20%s',_0x2492f5,_0x1c537f);_0x3edb40(_0x1c537f);});});}exports[_0x1a57('0x15')]=function(_0x1662a3){var _0x80f8c1=this;return new Promise(function(_0x53bb20,_0x3daa66){return db[_0x1a57('0x16')][_0x1a57('0x17')]({'raw':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x1662a3[_0x1a57('0x18')]?_0x1662a3['options']['attributes']||null:null,'limit':_0x1662a3['options']?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1a')]||null:null,'include':_0x1662a3[_0x1a57('0x18')]?_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x1662a3[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x183ca3){return{'model':db[_0x183ca3[_0x1a57('0x1d')]],'as':_0x183ca3['as'],'attributes':_0x183ca3[_0x1a57('0x1e')],'include':_0x183ca3[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x183ca3[_0x1a57('0x1b')],function(_0x2f9454){return{'model':db[_0x2f9454[_0x1a57('0x1d')]],'as':_0x2f9454['as'],'attributes':_0x2f9454[_0x1a57('0x1e')],'include':_0x2f9454[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2f9454[_0x1a57('0x1b')],function(_0x26584b){return{'model':db[_0x26584b[_0x1a57('0x1d')]],'as':_0x26584b['as'],'attributes':_0x26584b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x139d8c){logger[_0x1a57('0xc')]('GetVtigerAccount',_0x1662a3);logger[_0x1a57('0xf')]('GetVtigerAccount',_0x1662a3,JSON[_0x1a57('0x11')](_0x139d8c));_0x53bb20(_0x139d8c);})[_0x1a57('0x14')](function(_0x53bf6e){logger[_0x1a57('0x12')](_0x1a57('0x15'),_0x53bf6e[_0x1a57('0x13')],_0x1662a3);_0x3daa66(_0x80f8c1[_0x1a57('0x12')](0x1f4,_0x53bf6e['message']));});});};exports[_0x1a57('0x1f')]=function(_0x396832){var _0x4374f0=this;return new Promise(function(_0x160536,_0x5763ba){return db[_0x1a57('0x16')][_0x1a57('0x20')]({'raw':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x21')]===undefined?!![]:![]:!![],'where':_0x396832[_0x1a57('0x18')]?_0x396832[_0x1a57('0x18')][_0x1a57('0x19')]||null:null,'attributes':_0x396832[_0x1a57('0x18')]?_0x396832['options'][_0x1a57('0x1e')]||null:null,'include':_0x396832[_0x1a57('0x18')]?_0x396832['options']['include']?_[_0x1a57('0x1c')](_0x396832[_0x1a57('0x18')][_0x1a57('0x1b')],function(_0x170bf7){return{'model':db[_0x170bf7[_0x1a57('0x1d')]],'as':_0x170bf7['as'],'attributes':_0x170bf7[_0x1a57('0x1e')],'include':_0x170bf7[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x170bf7[_0x1a57('0x1b')],function(_0x2a6feb){return{'model':db[_0x2a6feb[_0x1a57('0x1d')]],'as':_0x2a6feb['as'],'attributes':_0x2a6feb[_0x1a57('0x1e')],'include':_0x2a6feb[_0x1a57('0x1b')]?_[_0x1a57('0x1c')](_0x2a6feb[_0x1a57('0x1b')],function(_0x12102f){return{'model':db[_0x12102f[_0x1a57('0x1d')]],'as':_0x12102f['as'],'attributes':_0x12102f[_0x1a57('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cd160){logger[_0x1a57('0xc')](_0x1a57('0x1f'),_0x396832);logger[_0x1a57('0xf')](_0x1a57('0x1f'),_0x396832,JSON[_0x1a57('0x11')](_0x3cd160));_0x160536(_0x3cd160);})[_0x1a57('0x14')](function(_0x23d087){logger[_0x1a57('0x12')]('ShowVtigerAccount',_0x23d087['message'],_0x396832);_0x5763ba(_0x4374f0['error'](0x1f4,_0x23d087['message']));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7656736..eae57c0 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 _0xb56a=['multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intVtigerConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete','exports'];(function(_0x3acbd8,_0x19874d){var _0x1b7a84=function(_0x3688ee){while(--_0x3688ee){_0x3acbd8['push'](_0x3acbd8['shift']());}};_0x1b7a84(++_0x19874d);}(_0xb56a,0x160));var _0xab56=function(_0x45d3f0,_0x4be53f){_0x45d3f0=_0x45d3f0-0x0;var _0x314b79=_0xb56a[_0x45d3f0];return _0x314b79;};'use strict';var multer=require(_0xab56('0x0'));var util=require(_0xab56('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xab56('0x2'));var router=express[_0xab56('0x3')]();var fs_extra=require(_0xab56('0x4'));var auth=require(_0xab56('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab56('0x6'));var controller=require(_0xab56('0x7'));router[_0xab56('0x8')]('/',auth[_0xab56('0x9')](),controller['index']);router[_0xab56('0x8')](_0xab56('0xa'),auth[_0xab56('0x9')](),controller['show']);router[_0xab56('0x8')](_0xab56('0xb'),auth[_0xab56('0x9')](),controller[_0xab56('0xc')]);router['get'](_0xab56('0xd'),auth[_0xab56('0x9')](),controller[_0xab56('0xe')]);router[_0xab56('0x8')](_0xab56('0xf'),auth[_0xab56('0x9')](),controller[_0xab56('0x10')]);router[_0xab56('0x11')]('/',auth['isAuthenticated'](),controller[_0xab56('0x12')]);router['put'](_0xab56('0xa'),auth[_0xab56('0x9')](),controller[_0xab56('0x13')]);router[_0xab56('0x14')](_0xab56('0xa'),auth[_0xab56('0x9')](),controller['destroy']);module[_0xab56('0x15')]=router; \ No newline at end of file +var _0x6e73=['put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','post','create'];(function(_0x16829d,_0x5795b7){var _0x3560c5=function(_0x215279){while(--_0x215279){_0x16829d['push'](_0x16829d['shift']());}};_0x3560c5(++_0x5795b7);}(_0x6e73,0x147));var _0x36e7=function(_0x17bbcd,_0x1ae4b7){_0x17bbcd=_0x17bbcd-0x0;var _0x1e1376=_0x6e73[_0x17bbcd];return _0x1e1376;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x36e7('0x0'));var timeout=require(_0x36e7('0x1'));var express=require('express');var router=express[_0x36e7('0x2')]();var fs_extra=require(_0x36e7('0x3'));var auth=require(_0x36e7('0x4'));var interaction=require(_0x36e7('0x5'));var config=require(_0x36e7('0x6'));var controller=require(_0x36e7('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x36e7('0x8')](_0x36e7('0x9'),auth[_0x36e7('0xa')](),controller[_0x36e7('0xb')]);router[_0x36e7('0x8')](_0x36e7('0xc'),auth['isAuthenticated'](),controller[_0x36e7('0xd')]);router[_0x36e7('0x8')](_0x36e7('0xe'),auth[_0x36e7('0xa')](),controller['getSubjects']);router[_0x36e7('0x8')](_0x36e7('0xf'),auth[_0x36e7('0xa')](),controller['getDescriptions']);router[_0x36e7('0x10')]('/',auth[_0x36e7('0xa')](),controller[_0x36e7('0x11')]);router[_0x36e7('0x12')](_0x36e7('0x9'),auth[_0x36e7('0xa')](),controller[_0x36e7('0x13')]);router[_0x36e7('0x14')](_0x36e7('0x9'),auth[_0x36e7('0xa')](),controller[_0x36e7('0x15')]);module[_0x36e7('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 43fedca..61d04d7 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 _0x4832=['STRING','exports'];(function(_0x3062cb,_0x44ca12){var _0xf29731=function(_0x11fc4b){while(--_0x11fc4b){_0x3062cb['push'](_0x3062cb['shift']());}};_0xf29731(++_0x44ca12);}(_0x4832,0x18b));var _0x2483=function(_0x2bb3f6,_0x25fde0){_0x2bb3f6=_0x2bb3f6-0x0;var _0x62b339=_0x4832[_0x2bb3f6];return _0x62b339;};'use strict';var Sequelize=require('sequelize');module[_0x2483('0x0')]={'name':{'type':Sequelize[_0x2483('0x1')]},'description':{'type':Sequelize[_0x2483('0x1')]}}; \ No newline at end of file +var _0x2afc=['sequelize','exports','STRING'];(function(_0x3f22e8,_0x37732a){var _0x368a7e=function(_0x35f538){while(--_0x35f538){_0x3f22e8['push'](_0x3f22e8['shift']());}};_0x368a7e(++_0x37732a);}(_0x2afc,0xf6));var _0xc2af=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0x2afc[_0x207811];return _0x170d56;};'use strict';var Sequelize=require(_0xc2af('0x0'));module[_0xc2af('0x1')]={'name':{'type':Sequelize[_0xc2af('0x2')]},'description':{'type':Sequelize[_0xc2af('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 9081000..c289cd8 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 _0x8bf0=['filters','pick','filter','merge','VIRTUAL','options','findAll','catch','show','find','create','body','params','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x36e6b2,_0x390639){var _0xb45b58=function(_0x6648fd){while(--_0x6648fd){_0x36e6b2['push'](_0x36e6b2['shift']());}};_0xb45b58(++_0x390639);}(_0x8bf0,0x14a));var _0x08bf=function(_0x1cc986,_0x4f94a0){_0x1cc986=_0x1cc986-0x0;var _0x251eda=_0x8bf0[_0x1cc986];return _0x251eda;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x08bf('0x0'));var jsonpatch=require(_0x08bf('0x1'));var rp=require(_0x08bf('0x2'));var moment=require('moment');var BPromise=require(_0x08bf('0x3'));var Mustache=require(_0x08bf('0x4'));var util=require('util');var path=require(_0x08bf('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x08bf('0x6'));var fs=require('fs');var fs_extra=require(_0x08bf('0x7'));var _=require(_0x08bf('0x8'));var squel=require(_0x08bf('0x9'));var crypto=require(_0x08bf('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x08bf('0xb'));var toCsv=require(_0x08bf('0xc'));var querystring=require('querystring');var Papa=require(_0x08bf('0xd'));var Redis=require(_0x08bf('0xe'));var authService=require(_0x08bf('0xf'));var qs=require(_0x08bf('0x10'));var as=require(_0x08bf('0x11'));var hardwareService=require(_0x08bf('0x12'));var logger=require('../../config/logger')(_0x08bf('0x13'));var utils=require(_0x08bf('0x14'));var config=require(_0x08bf('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x08bf('0x16'))['db'];function respondWithStatusCode(_0x5d2d7a,_0x1d53b4){_0x1d53b4=_0x1d53b4||0xcc;return function(_0x20a30e){if(_0x20a30e){return _0x5d2d7a[_0x08bf('0x17')](_0x1d53b4);}return _0x5d2d7a[_0x08bf('0x18')](_0x1d53b4)[_0x08bf('0x19')]();};}function respondWithResult(_0x4819d8,_0x55d7b3){_0x55d7b3=_0x55d7b3||0xc8;return function(_0x5ca5c4){if(_0x5ca5c4){return _0x4819d8[_0x08bf('0x18')](_0x55d7b3)[_0x08bf('0x1a')](_0x5ca5c4);}};}function respondWithFilteredResult(_0x5d7bd6,_0x332de2){return function(_0x48ffa4){if(_0x48ffa4){var _0x3a4ae8=typeof _0x332de2[_0x08bf('0x1b')]===_0x08bf('0x1c')&&typeof _0x332de2[_0x08bf('0x1d')]==='undefined';var _0x130c3c=_0x48ffa4[_0x08bf('0x1e')];var _0x47cdc6=_0x3a4ae8?0x0:_0x332de2[_0x08bf('0x1b')];var _0x44218d=_0x3a4ae8?_0x48ffa4[_0x08bf('0x1e')]:_0x332de2[_0x08bf('0x1b')]+_0x332de2['limit'];var _0x4e031f;if(_0x44218d>=_0x130c3c){_0x44218d=_0x130c3c;_0x4e031f=0xc8;}else{_0x4e031f=0xce;}_0x5d7bd6[_0x08bf('0x18')](_0x4e031f);return _0x5d7bd6[_0x08bf('0x1f')]('Content-Range',_0x47cdc6+'-'+_0x44218d+'/'+_0x130c3c)['json'](_0x48ffa4);}return null;};}function patchUpdates(_0x1ecad5){return function(_0x142623){try{jsonpatch[_0x08bf('0x20')](_0x142623,_0x1ecad5,!![]);}catch(_0x2b844b){return BPromise[_0x08bf('0x21')](_0x2b844b);}return _0x142623[_0x08bf('0x22')]();};}function saveUpdates(_0x508620,_0x56353e){return function(_0x3bc5de){if(_0x3bc5de){return _0x3bc5de[_0x08bf('0x23')](_0x508620)[_0x08bf('0x24')](function(_0x2ff2ce){return _0x2ff2ce;});}return null;};}function removeEntity(_0x748a54,_0x568384){return function(_0x22f5e1){if(_0x22f5e1){return _0x22f5e1[_0x08bf('0x25')]()[_0x08bf('0x24')](function(){_0x748a54[_0x08bf('0x18')](0xcc)[_0x08bf('0x19')]();});}};}function handleEntityNotFound(_0x4a38da,_0x437b0f){return function(_0x2d04b4){if(!_0x2d04b4){_0x4a38da[_0x08bf('0x17')](0x194);}return _0x2d04b4;};}function handleError(_0x2d8e2c,_0x4d54fa){_0x4d54fa=_0x4d54fa||0x1f4;return function(_0x2ddb26){logger[_0x08bf('0x26')](_0x2ddb26[_0x08bf('0x27')]);if(_0x2ddb26[_0x08bf('0x28')]){delete _0x2ddb26['name'];}_0x2d8e2c['status'](_0x4d54fa)[_0x08bf('0x29')](_0x2ddb26);};}exports['index']=function(_0x515a4d,_0x35c48e){var _0x4705c0={},_0x346f9f={},_0x2b8903={'count':0x0,'rows':[]};var _0x5ea272=_[_0x08bf('0x2a')](db[_0x08bf('0x2b')][_0x08bf('0x2c')],function(_0x25d81a){return{'name':_0x25d81a[_0x08bf('0x2d')],'type':_0x25d81a[_0x08bf('0x2e')][_0x08bf('0x2f')]};});_0x346f9f[_0x08bf('0x30')]=_['map'](_0x5ea272,_0x08bf('0x28'));_0x346f9f[_0x08bf('0x31')]=_[_0x08bf('0x32')](_0x515a4d[_0x08bf('0x31')]);_0x346f9f['filters']=_[_0x08bf('0x33')](_0x346f9f['model'],_0x346f9f['query']);_0x4705c0[_0x08bf('0x34')]=_[_0x08bf('0x33')](_0x346f9f[_0x08bf('0x30')],qs['fields'](_0x515a4d[_0x08bf('0x31')][_0x08bf('0x35')]));_0x4705c0[_0x08bf('0x34')]=_0x4705c0['attributes'][_0x08bf('0x36')]?_0x4705c0[_0x08bf('0x34')]:_0x346f9f[_0x08bf('0x30')];if(!_0x515a4d[_0x08bf('0x31')][_0x08bf('0x37')](_0x08bf('0x38'))){_0x4705c0[_0x08bf('0x1d')]=qs[_0x08bf('0x1d')](_0x515a4d['query'][_0x08bf('0x1d')]);_0x4705c0[_0x08bf('0x1b')]=qs[_0x08bf('0x1b')](_0x515a4d['query']['offset']);}_0x4705c0[_0x08bf('0x39')]=qs[_0x08bf('0x3a')](_0x515a4d[_0x08bf('0x31')]['sort']);_0x4705c0[_0x08bf('0x3b')]=qs[_0x08bf('0x3c')](_[_0x08bf('0x3d')](_0x515a4d[_0x08bf('0x31')],_0x346f9f[_0x08bf('0x3c')]),_0x5ea272);if(_0x515a4d[_0x08bf('0x31')][_0x08bf('0x3e')]){_0x4705c0[_0x08bf('0x3b')]=_[_0x08bf('0x3f')](_0x4705c0[_0x08bf('0x3b')],{'$or':_[_0x08bf('0x2a')](_0x5ea272,function(_0x32926c){if(_0x32926c[_0x08bf('0x2e')]!==_0x08bf('0x40')){var _0x181249={};_0x181249[_0x32926c['name']]={'$like':'%'+_0x515a4d['query']['filter']+'%'};return _0x181249;}})});}_0x4705c0=_[_0x08bf('0x3f')]({},_0x4705c0,_0x515a4d[_0x08bf('0x41')]);var _0x10d35e={'where':_0x4705c0[_0x08bf('0x3b')]};return db['VtigerConfiguration'][_0x08bf('0x1e')](_0x10d35e)[_0x08bf('0x24')](function(_0xa38a11){_0x2b8903[_0x08bf('0x1e')]=_0xa38a11;if(_0x515a4d[_0x08bf('0x31')]['includeAll']){_0x4705c0['include']=[{'all':!![]}];}return db[_0x08bf('0x2b')][_0x08bf('0x42')](_0x4705c0);})[_0x08bf('0x24')](function(_0x2eefb3){_0x2b8903['rows']=_0x2eefb3;return _0x2b8903;})[_0x08bf('0x24')](respondWithFilteredResult(_0x35c48e,_0x4705c0))[_0x08bf('0x43')](handleError(_0x35c48e,null));};exports[_0x08bf('0x44')]=function(_0x28f48f,_0x12b90e){var _0x407a9f={'raw':![],'where':{'id':_0x28f48f['params']['id']}},_0x443482={};_0x443482[_0x08bf('0x30')]=_[_0x08bf('0x32')](db[_0x08bf('0x2b')][_0x08bf('0x2c')]);_0x443482[_0x08bf('0x31')]=_[_0x08bf('0x32')](_0x28f48f[_0x08bf('0x31')]);_0x443482['filters']=_['intersection'](_0x443482['model'],_0x443482[_0x08bf('0x31')]);_0x407a9f[_0x08bf('0x34')]=_['intersection'](_0x443482[_0x08bf('0x30')],qs['fields'](_0x28f48f['query'][_0x08bf('0x35')]));_0x407a9f['attributes']=_0x407a9f[_0x08bf('0x34')]['length']?_0x407a9f[_0x08bf('0x34')]:_0x443482[_0x08bf('0x30')];if(_0x28f48f[_0x08bf('0x31')]['includeAll']){_0x407a9f['include']=[{'all':!![]}];}_0x407a9f=_[_0x08bf('0x3f')]({},_0x407a9f,_0x28f48f['options']);return db['VtigerConfiguration'][_0x08bf('0x45')](_0x407a9f)['then'](handleEntityNotFound(_0x12b90e,null))[_0x08bf('0x24')](respondWithResult(_0x12b90e,null))[_0x08bf('0x43')](handleError(_0x12b90e,null));};exports['create']=function(_0x12255b,_0x26e2e8){return db[_0x08bf('0x2b')][_0x08bf('0x46')](_0x12255b[_0x08bf('0x47')],{})[_0x08bf('0x24')](respondWithResult(_0x26e2e8,0xc9))[_0x08bf('0x43')](handleError(_0x26e2e8,null));};exports[_0x08bf('0x23')]=function(_0x3134fd,_0x39cd98){if(_0x3134fd[_0x08bf('0x47')]['id']){delete _0x3134fd['body']['id'];}return db[_0x08bf('0x2b')][_0x08bf('0x45')]({'where':{'id':_0x3134fd['params']['id']}})[_0x08bf('0x24')](handleEntityNotFound(_0x39cd98,null))[_0x08bf('0x24')](saveUpdates(_0x3134fd[_0x08bf('0x47')],null))[_0x08bf('0x24')](respondWithResult(_0x39cd98,null))[_0x08bf('0x43')](handleError(_0x39cd98,null));};exports[_0x08bf('0x25')]=function(_0x3b6b83,_0x3b2ee5){return db[_0x08bf('0x2b')][_0x08bf('0x45')]({'where':{'id':_0x3b6b83[_0x08bf('0x48')]['id']}})[_0x08bf('0x24')](handleEntityNotFound(_0x3b2ee5,null))[_0x08bf('0x24')](removeEntity(_0x3b2ee5,null))['catch'](handleError(_0x3b2ee5,null));};exports[_0x08bf('0x49')]=function(_0x3deedc,_0x3d2c2e,_0x297635){var _0x3ac53e={};var _0x3f693e={};var _0x302445;var _0x392225;return db[_0x08bf('0x2b')][_0x08bf('0x4a')]({'where':{'id':_0x3deedc[_0x08bf('0x48')]['id']}})[_0x08bf('0x24')](handleEntityNotFound(_0x3d2c2e,null))[_0x08bf('0x24')](function(_0x150aed){if(_0x150aed){_0x302445=_0x150aed;_0x3f693e[_0x08bf('0x30')]=_['keys'](db[_0x08bf('0x4b')][_0x08bf('0x2c')]);_0x3f693e[_0x08bf('0x31')]=_['keys'](_0x3deedc['query']);_0x3f693e[_0x08bf('0x3c')]=_[_0x08bf('0x33')](_0x3f693e[_0x08bf('0x30')],_0x3f693e['query']);_0x3ac53e[_0x08bf('0x34')]=_[_0x08bf('0x33')](_0x3f693e[_0x08bf('0x30')],qs[_0x08bf('0x35')](_0x3deedc[_0x08bf('0x31')][_0x08bf('0x35')]));_0x3ac53e['attributes']=_0x3ac53e[_0x08bf('0x34')][_0x08bf('0x36')]?_0x3ac53e[_0x08bf('0x34')]:_0x3f693e[_0x08bf('0x30')];_0x3ac53e[_0x08bf('0x39')]=qs['sort'](_0x3deedc['query'][_0x08bf('0x3a')]);_0x3ac53e['where']=qs['filters'](_['pick'](_0x3deedc['query'],_0x3f693e['filters']));if(_0x3deedc[_0x08bf('0x31')]['filter']){_0x3ac53e[_0x08bf('0x3b')]=_[_0x08bf('0x3f')](_0x3ac53e[_0x08bf('0x3b')],{'$or':_[_0x08bf('0x2a')](_0x3ac53e[_0x08bf('0x34')],function(_0x537338){var _0x362159={};_0x362159[_0x537338]={'$like':'%'+_0x3deedc[_0x08bf('0x31')]['filter']+'%'};return _0x362159;})});}_0x3ac53e=_['merge']({},_0x3ac53e,_0x3deedc[_0x08bf('0x41')]);return _0x302445[_0x08bf('0x49')](_0x3ac53e);}})[_0x08bf('0x24')](function(_0x50b22b){if(_0x50b22b){_0x392225=_0x50b22b[_0x08bf('0x36')];if(!_0x3deedc[_0x08bf('0x31')][_0x08bf('0x37')]('nolimit')){_0x3ac53e[_0x08bf('0x1d')]=qs['limit'](_0x3deedc[_0x08bf('0x31')][_0x08bf('0x1d')]);_0x3ac53e[_0x08bf('0x1b')]=qs['offset'](_0x3deedc[_0x08bf('0x31')]['offset']);}return _0x302445['getFields'](_0x3ac53e);}})['then'](function(_0x57e03d){if(_0x57e03d){return _0x57e03d?{'count':_0x392225,'rows':_0x57e03d}:null;}})[_0x08bf('0x24')](respondWithResult(_0x3d2c2e,null))[_0x08bf('0x43')](handleError(_0x3d2c2e,null));};exports[_0x08bf('0x4c')]=function(_0x32be58,_0x40bac2,_0x495cb3){var _0x21d3b6={};var _0x18aa21={};var _0x39b1c9;var _0x1c94dc;return db['VtigerConfiguration'][_0x08bf('0x4a')]({'where':{'id':_0x32be58[_0x08bf('0x48')]['id']}})['then'](handleEntityNotFound(_0x40bac2,null))[_0x08bf('0x24')](function(_0x1e9c37){if(_0x1e9c37){_0x39b1c9=_0x1e9c37;_0x18aa21[_0x08bf('0x30')]=_[_0x08bf('0x32')](db[_0x08bf('0x4b')]['rawAttributes']);_0x18aa21['query']=_[_0x08bf('0x32')](_0x32be58[_0x08bf('0x31')]);_0x18aa21[_0x08bf('0x3c')]=_[_0x08bf('0x33')](_0x18aa21[_0x08bf('0x30')],_0x18aa21[_0x08bf('0x31')]);_0x21d3b6[_0x08bf('0x34')]=_[_0x08bf('0x33')](_0x18aa21['model'],qs[_0x08bf('0x35')](_0x32be58['query'][_0x08bf('0x35')]));_0x21d3b6[_0x08bf('0x34')]=_0x21d3b6[_0x08bf('0x34')][_0x08bf('0x36')]?_0x21d3b6[_0x08bf('0x34')]:_0x18aa21[_0x08bf('0x30')];_0x21d3b6[_0x08bf('0x39')]=qs[_0x08bf('0x3a')](_0x32be58[_0x08bf('0x31')][_0x08bf('0x3a')]);_0x21d3b6['where']=qs[_0x08bf('0x3c')](_[_0x08bf('0x3d')](_0x32be58[_0x08bf('0x31')],_0x18aa21['filters']));if(_0x32be58[_0x08bf('0x31')][_0x08bf('0x3e')]){_0x21d3b6[_0x08bf('0x3b')]=_[_0x08bf('0x3f')](_0x21d3b6[_0x08bf('0x3b')],{'$or':_[_0x08bf('0x2a')](_0x21d3b6[_0x08bf('0x34')],function(_0x4d2ecc){var _0x40ff1b={};_0x40ff1b[_0x4d2ecc]={'$like':'%'+_0x32be58['query'][_0x08bf('0x3e')]+'%'};return _0x40ff1b;})});}_0x21d3b6=_[_0x08bf('0x3f')]({},_0x21d3b6,_0x32be58[_0x08bf('0x41')]);return _0x39b1c9[_0x08bf('0x4c')](_0x21d3b6);}})['then'](function(_0xb300da){if(_0xb300da){_0x1c94dc=_0xb300da[_0x08bf('0x36')];if(!_0x32be58[_0x08bf('0x31')]['hasOwnProperty'](_0x08bf('0x38'))){_0x21d3b6['limit']=qs[_0x08bf('0x1d')](_0x32be58[_0x08bf('0x31')][_0x08bf('0x1d')]);_0x21d3b6[_0x08bf('0x1b')]=qs[_0x08bf('0x1b')](_0x32be58[_0x08bf('0x31')][_0x08bf('0x1b')]);}return _0x39b1c9[_0x08bf('0x4c')](_0x21d3b6);}})[_0x08bf('0x24')](function(_0x5a3150){if(_0x5a3150){return _0x5a3150?{'count':_0x1c94dc,'rows':_0x5a3150}:null;}})[_0x08bf('0x24')](respondWithResult(_0x40bac2,null))[_0x08bf('0x43')](handleError(_0x40bac2,null));};exports[_0x08bf('0x4d')]=function(_0x21cf6a,_0x2ae7ff,_0x2132ed){var _0xfd13b2={};var _0x1d88b5={};var _0x5b24aa;var _0x52920c;return db['VtigerConfiguration'][_0x08bf('0x4a')]({'where':{'id':_0x21cf6a[_0x08bf('0x48')]['id']}})[_0x08bf('0x24')](handleEntityNotFound(_0x2ae7ff,null))[_0x08bf('0x24')](function(_0x22a587){if(_0x22a587){_0x5b24aa=_0x22a587;_0x1d88b5[_0x08bf('0x30')]=_[_0x08bf('0x32')](db[_0x08bf('0x4b')]['rawAttributes']);_0x1d88b5['query']=_['keys'](_0x21cf6a['query']);_0x1d88b5['filters']=_['intersection'](_0x1d88b5['model'],_0x1d88b5[_0x08bf('0x31')]);_0xfd13b2[_0x08bf('0x34')]=_[_0x08bf('0x33')](_0x1d88b5[_0x08bf('0x30')],qs['fields'](_0x21cf6a['query'][_0x08bf('0x35')]));_0xfd13b2[_0x08bf('0x34')]=_0xfd13b2[_0x08bf('0x34')][_0x08bf('0x36')]?_0xfd13b2[_0x08bf('0x34')]:_0x1d88b5[_0x08bf('0x30')];_0xfd13b2[_0x08bf('0x39')]=qs[_0x08bf('0x3a')](_0x21cf6a[_0x08bf('0x31')][_0x08bf('0x3a')]);_0xfd13b2[_0x08bf('0x3b')]=qs[_0x08bf('0x3c')](_[_0x08bf('0x3d')](_0x21cf6a[_0x08bf('0x31')],_0x1d88b5[_0x08bf('0x3c')]));if(_0x21cf6a['query'][_0x08bf('0x3e')]){_0xfd13b2[_0x08bf('0x3b')]=_[_0x08bf('0x3f')](_0xfd13b2[_0x08bf('0x3b')],{'$or':_[_0x08bf('0x2a')](_0xfd13b2[_0x08bf('0x34')],function(_0x32667a){var _0x1c608c={};_0x1c608c[_0x32667a]={'$like':'%'+_0x21cf6a[_0x08bf('0x31')][_0x08bf('0x3e')]+'%'};return _0x1c608c;})});}_0xfd13b2=_[_0x08bf('0x3f')]({},_0xfd13b2,_0x21cf6a[_0x08bf('0x41')]);return _0x5b24aa['getDescriptions'](_0xfd13b2);}})[_0x08bf('0x24')](function(_0x1f9025){if(_0x1f9025){_0x52920c=_0x1f9025[_0x08bf('0x36')];if(!_0x21cf6a[_0x08bf('0x31')][_0x08bf('0x37')](_0x08bf('0x38'))){_0xfd13b2[_0x08bf('0x1d')]=qs[_0x08bf('0x1d')](_0x21cf6a[_0x08bf('0x31')][_0x08bf('0x1d')]);_0xfd13b2[_0x08bf('0x1b')]=qs[_0x08bf('0x1b')](_0x21cf6a['query'][_0x08bf('0x1b')]);}return _0x5b24aa[_0x08bf('0x4d')](_0xfd13b2);}})[_0x08bf('0x24')](function(_0x329256){if(_0x329256){return _0x329256?{'count':_0x52920c,'rows':_0x329256}:null;}})['then'](respondWithResult(_0x2ae7ff,null))[_0x08bf('0x43')](handleError(_0x2ae7ff,null));}; \ No newline at end of file +var _0x33e1=['getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VtigerConfiguration','rawAttributes','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','getFields','findOne','VtigerField'];(function(_0x63ed20,_0x5bed5f){var _0x30d38f=function(_0x334a0c){while(--_0x334a0c){_0x63ed20['push'](_0x63ed20['shift']());}};_0x30d38f(++_0x5bed5f);}(_0x33e1,0x142));var _0x133e=function(_0x15b261,_0x537009){_0x15b261=_0x15b261-0x0;var _0x520f72=_0x33e1[_0x15b261];return _0x520f72;};'use strict';var emlformat=require(_0x133e('0x0'));var rimraf=require(_0x133e('0x1'));var zipdir=require(_0x133e('0x2'));var jsonpatch=require(_0x133e('0x3'));var rp=require(_0x133e('0x4'));var moment=require('moment');var BPromise=require(_0x133e('0x5'));var Mustache=require(_0x133e('0x6'));var util=require(_0x133e('0x7'));var path=require(_0x133e('0x8'));var sox=require(_0x133e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x133e('0xa'));var squel=require(_0x133e('0xb'));var crypto=require(_0x133e('0xc'));var jsforce=require(_0x133e('0xd'));var deskjs=require(_0x133e('0xe'));var toCsv=require(_0x133e('0xf'));var querystring=require(_0x133e('0x10'));var Papa=require(_0x133e('0x11'));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(_0x133e('0x12'));var logger=require(_0x133e('0x13'))(_0x133e('0x14'));var utils=require(_0x133e('0x15'));var config=require(_0x133e('0x16'));var licenseUtil=require(_0x133e('0x17'));var db=require(_0x133e('0x18'))['db'];function respondWithStatusCode(_0x2192f0,_0x256005){_0x256005=_0x256005||0xcc;return function(_0x12714d){if(_0x12714d){return _0x2192f0['sendStatus'](_0x256005);}return _0x2192f0[_0x133e('0x19')](_0x256005)[_0x133e('0x1a')]();};}function respondWithResult(_0x37bd40,_0x227a1f){_0x227a1f=_0x227a1f||0xc8;return function(_0x1fd2d8){if(_0x1fd2d8){return _0x37bd40[_0x133e('0x19')](_0x227a1f)['json'](_0x1fd2d8);}};}function respondWithFilteredResult(_0x4e1547,_0x3bbb5f){return function(_0x5722ed){if(_0x5722ed){var _0xd593e4=typeof _0x3bbb5f['offset']===_0x133e('0x1b')&&typeof _0x3bbb5f['limit']==='undefined';var _0x4aca5f=_0x5722ed[_0x133e('0x1c')];var _0x276902=_0xd593e4?0x0:_0x3bbb5f[_0x133e('0x1d')];var _0x5aeafa=_0xd593e4?_0x5722ed[_0x133e('0x1c')]:_0x3bbb5f[_0x133e('0x1d')]+_0x3bbb5f[_0x133e('0x1e')];var _0x1832a1;if(_0x5aeafa>=_0x4aca5f){_0x5aeafa=_0x4aca5f;_0x1832a1=0xc8;}else{_0x1832a1=0xce;}_0x4e1547[_0x133e('0x19')](_0x1832a1);return _0x4e1547[_0x133e('0x1f')](_0x133e('0x20'),_0x276902+'-'+_0x5aeafa+'/'+_0x4aca5f)['json'](_0x5722ed);}return null;};}function patchUpdates(_0x16073d){return function(_0xf4d9f9){try{jsonpatch[_0x133e('0x21')](_0xf4d9f9,_0x16073d,!![]);}catch(_0x2ce1d9){return BPromise[_0x133e('0x22')](_0x2ce1d9);}return _0xf4d9f9[_0x133e('0x23')]();};}function saveUpdates(_0x49ddb0,_0x1cda65){return function(_0x185033){if(_0x185033){return _0x185033[_0x133e('0x24')](_0x49ddb0)[_0x133e('0x25')](function(_0x52f229){return _0x52f229;});}return null;};}function removeEntity(_0x1948d3,_0x39fb43){return function(_0x5f3f50){if(_0x5f3f50){return _0x5f3f50[_0x133e('0x26')]()[_0x133e('0x25')](function(){_0x1948d3[_0x133e('0x19')](0xcc)[_0x133e('0x1a')]();});}};}function handleEntityNotFound(_0x4431f3,_0x3a2ce6){return function(_0x34e802){if(!_0x34e802){_0x4431f3['sendStatus'](0x194);}return _0x34e802;};}function handleError(_0x43a283,_0x3d9107){_0x3d9107=_0x3d9107||0x1f4;return function(_0x7b5d55){logger['error'](_0x7b5d55[_0x133e('0x27')]);if(_0x7b5d55[_0x133e('0x28')]){delete _0x7b5d55[_0x133e('0x28')];}_0x43a283[_0x133e('0x19')](_0x3d9107)[_0x133e('0x29')](_0x7b5d55);};}exports[_0x133e('0x2a')]=function(_0x241029,_0x46462a){var _0xe420fa={},_0x279970={},_0x440777={'count':0x0,'rows':[]};var _0x448940=_[_0x133e('0x2b')](db[_0x133e('0x2c')][_0x133e('0x2d')],function(_0x4a14fd){return{'name':_0x4a14fd['fieldName'],'type':_0x4a14fd[_0x133e('0x2e')][_0x133e('0x2f')]};});_0x279970[_0x133e('0x30')]=_[_0x133e('0x2b')](_0x448940,_0x133e('0x28'));_0x279970[_0x133e('0x31')]=_[_0x133e('0x32')](_0x241029[_0x133e('0x31')]);_0x279970['filters']=_[_0x133e('0x33')](_0x279970['model'],_0x279970[_0x133e('0x31')]);_0xe420fa['attributes']=_[_0x133e('0x33')](_0x279970['model'],qs[_0x133e('0x34')](_0x241029[_0x133e('0x31')][_0x133e('0x34')]));_0xe420fa[_0x133e('0x35')]=_0xe420fa['attributes']['length']?_0xe420fa[_0x133e('0x35')]:_0x279970['model'];if(!_0x241029['query'][_0x133e('0x36')](_0x133e('0x37'))){_0xe420fa[_0x133e('0x1e')]=qs[_0x133e('0x1e')](_0x241029['query'][_0x133e('0x1e')]);_0xe420fa[_0x133e('0x1d')]=qs[_0x133e('0x1d')](_0x241029[_0x133e('0x31')][_0x133e('0x1d')]);}_0xe420fa[_0x133e('0x38')]=qs[_0x133e('0x39')](_0x241029[_0x133e('0x31')]['sort']);_0xe420fa[_0x133e('0x3a')]=qs[_0x133e('0x3b')](_[_0x133e('0x3c')](_0x241029[_0x133e('0x31')],_0x279970['filters']),_0x448940);if(_0x241029['query'][_0x133e('0x3d')]){_0xe420fa[_0x133e('0x3a')]=_[_0x133e('0x3e')](_0xe420fa[_0x133e('0x3a')],{'$or':_[_0x133e('0x2b')](_0x448940,function(_0x15772e){if(_0x15772e[_0x133e('0x2e')]!==_0x133e('0x3f')){var _0x4699df={};_0x4699df[_0x15772e[_0x133e('0x28')]]={'$like':'%'+_0x241029[_0x133e('0x31')][_0x133e('0x3d')]+'%'};return _0x4699df;}})});}_0xe420fa=_[_0x133e('0x3e')]({},_0xe420fa,_0x241029[_0x133e('0x40')]);var _0x1e28e9={'where':_0xe420fa[_0x133e('0x3a')]};return db[_0x133e('0x2c')][_0x133e('0x1c')](_0x1e28e9)[_0x133e('0x25')](function(_0xca1b4){_0x440777[_0x133e('0x1c')]=_0xca1b4;if(_0x241029['query']['includeAll']){_0xe420fa[_0x133e('0x41')]=[{'all':!![]}];}return db[_0x133e('0x2c')][_0x133e('0x42')](_0xe420fa);})['then'](function(_0x36c66b){_0x440777[_0x133e('0x43')]=_0x36c66b;return _0x440777;})[_0x133e('0x25')](respondWithFilteredResult(_0x46462a,_0xe420fa))[_0x133e('0x44')](handleError(_0x46462a,null));};exports[_0x133e('0x45')]=function(_0x328ae9,_0x515369){var _0x185c7f={'raw':![],'where':{'id':_0x328ae9[_0x133e('0x46')]['id']}},_0x46a6f3={};_0x46a6f3[_0x133e('0x30')]=_[_0x133e('0x32')](db[_0x133e('0x2c')][_0x133e('0x2d')]);_0x46a6f3[_0x133e('0x31')]=_[_0x133e('0x32')](_0x328ae9[_0x133e('0x31')]);_0x46a6f3[_0x133e('0x3b')]=_[_0x133e('0x33')](_0x46a6f3[_0x133e('0x30')],_0x46a6f3[_0x133e('0x31')]);_0x185c7f[_0x133e('0x35')]=_[_0x133e('0x33')](_0x46a6f3[_0x133e('0x30')],qs[_0x133e('0x34')](_0x328ae9[_0x133e('0x31')][_0x133e('0x34')]));_0x185c7f[_0x133e('0x35')]=_0x185c7f[_0x133e('0x35')][_0x133e('0x47')]?_0x185c7f[_0x133e('0x35')]:_0x46a6f3[_0x133e('0x30')];if(_0x328ae9[_0x133e('0x31')]['includeAll']){_0x185c7f[_0x133e('0x41')]=[{'all':!![]}];}_0x185c7f=_[_0x133e('0x3e')]({},_0x185c7f,_0x328ae9[_0x133e('0x40')]);return db[_0x133e('0x2c')][_0x133e('0x48')](_0x185c7f)['then'](handleEntityNotFound(_0x515369,null))[_0x133e('0x25')](respondWithResult(_0x515369,null))[_0x133e('0x44')](handleError(_0x515369,null));};exports['create']=function(_0x300d1c,_0x4168b1){return db['VtigerConfiguration'][_0x133e('0x49')](_0x300d1c[_0x133e('0x4a')],{})[_0x133e('0x25')](respondWithResult(_0x4168b1,0xc9))[_0x133e('0x44')](handleError(_0x4168b1,null));};exports['update']=function(_0x3d091f,_0x4cb5f8){if(_0x3d091f[_0x133e('0x4a')]['id']){delete _0x3d091f['body']['id'];}return db[_0x133e('0x2c')]['find']({'where':{'id':_0x3d091f[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0x4cb5f8,null))['then'](saveUpdates(_0x3d091f[_0x133e('0x4a')],null))['then'](respondWithResult(_0x4cb5f8,null))[_0x133e('0x44')](handleError(_0x4cb5f8,null));};exports[_0x133e('0x26')]=function(_0x17a988,_0xd7ef21){return db[_0x133e('0x2c')][_0x133e('0x48')]({'where':{'id':_0x17a988[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0xd7ef21,null))[_0x133e('0x25')](removeEntity(_0xd7ef21,null))[_0x133e('0x44')](handleError(_0xd7ef21,null));};exports[_0x133e('0x4b')]=function(_0x2ec4ee,_0xa1608e,_0x1b0ecd){var _0x180e0a={};var _0x37335e={};var _0x404de4;var _0x3bf134;return db[_0x133e('0x2c')][_0x133e('0x4c')]({'where':{'id':_0x2ec4ee[_0x133e('0x46')]['id']}})['then'](handleEntityNotFound(_0xa1608e,null))[_0x133e('0x25')](function(_0xfc7425){if(_0xfc7425){_0x404de4=_0xfc7425;_0x37335e[_0x133e('0x30')]=_[_0x133e('0x32')](db[_0x133e('0x4d')]['rawAttributes']);_0x37335e['query']=_['keys'](_0x2ec4ee[_0x133e('0x31')]);_0x37335e[_0x133e('0x3b')]=_[_0x133e('0x33')](_0x37335e['model'],_0x37335e['query']);_0x180e0a['attributes']=_[_0x133e('0x33')](_0x37335e['model'],qs[_0x133e('0x34')](_0x2ec4ee['query'][_0x133e('0x34')]));_0x180e0a[_0x133e('0x35')]=_0x180e0a[_0x133e('0x35')][_0x133e('0x47')]?_0x180e0a[_0x133e('0x35')]:_0x37335e['model'];_0x180e0a[_0x133e('0x38')]=qs['sort'](_0x2ec4ee[_0x133e('0x31')][_0x133e('0x39')]);_0x180e0a[_0x133e('0x3a')]=qs[_0x133e('0x3b')](_['pick'](_0x2ec4ee[_0x133e('0x31')],_0x37335e[_0x133e('0x3b')]));if(_0x2ec4ee[_0x133e('0x31')][_0x133e('0x3d')]){_0x180e0a[_0x133e('0x3a')]=_[_0x133e('0x3e')](_0x180e0a['where'],{'$or':_[_0x133e('0x2b')](_0x180e0a[_0x133e('0x35')],function(_0x158763){var _0x1306b1={};_0x1306b1[_0x158763]={'$like':'%'+_0x2ec4ee[_0x133e('0x31')][_0x133e('0x3d')]+'%'};return _0x1306b1;})});}_0x180e0a=_[_0x133e('0x3e')]({},_0x180e0a,_0x2ec4ee[_0x133e('0x40')]);return _0x404de4[_0x133e('0x4b')](_0x180e0a);}})['then'](function(_0x346abf){if(_0x346abf){_0x3bf134=_0x346abf['length'];if(!_0x2ec4ee[_0x133e('0x31')][_0x133e('0x36')](_0x133e('0x37'))){_0x180e0a[_0x133e('0x1e')]=qs[_0x133e('0x1e')](_0x2ec4ee[_0x133e('0x31')][_0x133e('0x1e')]);_0x180e0a[_0x133e('0x1d')]=qs[_0x133e('0x1d')](_0x2ec4ee[_0x133e('0x31')][_0x133e('0x1d')]);}return _0x404de4['getFields'](_0x180e0a);}})[_0x133e('0x25')](function(_0x3c1ed9){if(_0x3c1ed9){return _0x3c1ed9?{'count':_0x3bf134,'rows':_0x3c1ed9}:null;}})[_0x133e('0x25')](respondWithResult(_0xa1608e,null))[_0x133e('0x44')](handleError(_0xa1608e,null));};exports['getSubjects']=function(_0x3dd867,_0x206202,_0x3de34f){var _0x46ed85={};var _0xfb4f8f={};var _0xf4b01d;var _0x15722d;return db[_0x133e('0x2c')]['findOne']({'where':{'id':_0x3dd867[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0x206202,null))['then'](function(_0x3ce054){if(_0x3ce054){_0xf4b01d=_0x3ce054;_0xfb4f8f[_0x133e('0x30')]=_[_0x133e('0x32')](db[_0x133e('0x4d')][_0x133e('0x2d')]);_0xfb4f8f[_0x133e('0x31')]=_[_0x133e('0x32')](_0x3dd867['query']);_0xfb4f8f['filters']=_[_0x133e('0x33')](_0xfb4f8f[_0x133e('0x30')],_0xfb4f8f['query']);_0x46ed85[_0x133e('0x35')]=_[_0x133e('0x33')](_0xfb4f8f[_0x133e('0x30')],qs['fields'](_0x3dd867[_0x133e('0x31')][_0x133e('0x34')]));_0x46ed85[_0x133e('0x35')]=_0x46ed85[_0x133e('0x35')][_0x133e('0x47')]?_0x46ed85[_0x133e('0x35')]:_0xfb4f8f[_0x133e('0x30')];_0x46ed85[_0x133e('0x38')]=qs['sort'](_0x3dd867['query'][_0x133e('0x39')]);_0x46ed85[_0x133e('0x3a')]=qs['filters'](_[_0x133e('0x3c')](_0x3dd867[_0x133e('0x31')],_0xfb4f8f[_0x133e('0x3b')]));if(_0x3dd867[_0x133e('0x31')][_0x133e('0x3d')]){_0x46ed85[_0x133e('0x3a')]=_[_0x133e('0x3e')](_0x46ed85[_0x133e('0x3a')],{'$or':_[_0x133e('0x2b')](_0x46ed85[_0x133e('0x35')],function(_0x3c2b9d){var _0x30add7={};_0x30add7[_0x3c2b9d]={'$like':'%'+_0x3dd867[_0x133e('0x31')]['filter']+'%'};return _0x30add7;})});}_0x46ed85=_['merge']({},_0x46ed85,_0x3dd867['options']);return _0xf4b01d[_0x133e('0x4e')](_0x46ed85);}})[_0x133e('0x25')](function(_0x5f0418){if(_0x5f0418){_0x15722d=_0x5f0418[_0x133e('0x47')];if(!_0x3dd867['query'][_0x133e('0x36')](_0x133e('0x37'))){_0x46ed85[_0x133e('0x1e')]=qs[_0x133e('0x1e')](_0x3dd867[_0x133e('0x31')]['limit']);_0x46ed85['offset']=qs[_0x133e('0x1d')](_0x3dd867['query'][_0x133e('0x1d')]);}return _0xf4b01d[_0x133e('0x4e')](_0x46ed85);}})[_0x133e('0x25')](function(_0x32a2cd){if(_0x32a2cd){return _0x32a2cd?{'count':_0x15722d,'rows':_0x32a2cd}:null;}})['then'](respondWithResult(_0x206202,null))['catch'](handleError(_0x206202,null));};exports[_0x133e('0x4f')]=function(_0x18b603,_0x456432,_0x870114){var _0x467850={};var _0x5dbb39={};var _0xf41fb2;var _0x1bd4d9;return db['VtigerConfiguration']['findOne']({'where':{'id':_0x18b603[_0x133e('0x46')]['id']}})[_0x133e('0x25')](handleEntityNotFound(_0x456432,null))[_0x133e('0x25')](function(_0x42d24a){if(_0x42d24a){_0xf41fb2=_0x42d24a;_0x5dbb39['model']=_[_0x133e('0x32')](db[_0x133e('0x4d')]['rawAttributes']);_0x5dbb39['query']=_[_0x133e('0x32')](_0x18b603[_0x133e('0x31')]);_0x5dbb39[_0x133e('0x3b')]=_['intersection'](_0x5dbb39[_0x133e('0x30')],_0x5dbb39[_0x133e('0x31')]);_0x467850[_0x133e('0x35')]=_[_0x133e('0x33')](_0x5dbb39['model'],qs[_0x133e('0x34')](_0x18b603[_0x133e('0x31')]['fields']));_0x467850[_0x133e('0x35')]=_0x467850[_0x133e('0x35')][_0x133e('0x47')]?_0x467850[_0x133e('0x35')]:_0x5dbb39[_0x133e('0x30')];_0x467850['order']=qs[_0x133e('0x39')](_0x18b603[_0x133e('0x31')][_0x133e('0x39')]);_0x467850[_0x133e('0x3a')]=qs[_0x133e('0x3b')](_['pick'](_0x18b603[_0x133e('0x31')],_0x5dbb39[_0x133e('0x3b')]));if(_0x18b603[_0x133e('0x31')][_0x133e('0x3d')]){_0x467850[_0x133e('0x3a')]=_[_0x133e('0x3e')](_0x467850[_0x133e('0x3a')],{'$or':_[_0x133e('0x2b')](_0x467850[_0x133e('0x35')],function(_0x1c28c6){var _0x537cc7={};_0x537cc7[_0x1c28c6]={'$like':'%'+_0x18b603['query'][_0x133e('0x3d')]+'%'};return _0x537cc7;})});}_0x467850=_[_0x133e('0x3e')]({},_0x467850,_0x18b603[_0x133e('0x40')]);return _0xf41fb2[_0x133e('0x4f')](_0x467850);}})[_0x133e('0x25')](function(_0x226aa2){if(_0x226aa2){_0x1bd4d9=_0x226aa2[_0x133e('0x47')];if(!_0x18b603['query']['hasOwnProperty']('nolimit')){_0x467850[_0x133e('0x1e')]=qs['limit'](_0x18b603[_0x133e('0x31')][_0x133e('0x1e')]);_0x467850[_0x133e('0x1d')]=qs[_0x133e('0x1d')](_0x18b603[_0x133e('0x31')][_0x133e('0x1d')]);}return _0xf41fb2['getDescriptions'](_0x467850);}})[_0x133e('0x25')](function(_0x5ee9f2){if(_0x5ee9f2){return _0x5ee9f2?{'count':_0x1bd4d9,'rows':_0x5ee9f2}:null;}})['then'](respondWithResult(_0x456432,null))['catch'](handleError(_0x456432,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index cbbdd7e..8f17ef6 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 _0xfa30=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','exports'];(function(_0x2dba9a,_0x1177e1){var _0x4e6157=function(_0x559e41){while(--_0x559e41){_0x2dba9a['push'](_0x2dba9a['shift']());}};_0x4e6157(++_0x1177e1);}(_0xfa30,0x150));var _0x0fa3=function(_0x1717ba,_0x3f3b1b){_0x1717ba=_0x1717ba-0x0;var _0x127b4a=_0xfa30[_0x1717ba];return _0x127b4a;};'use strict';var _=require(_0x0fa3('0x0'));var util=require('util');var logger=require(_0x0fa3('0x1'))('api');var moment=require(_0x0fa3('0x2'));var BPromise=require(_0x0fa3('0x3'));var rp=require(_0x0fa3('0x4'));var fs=require('fs');var path=require(_0x0fa3('0x5'));var rimraf=require(_0x0fa3('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x0fa3('0x7')]=function(_0x3d4b7a,_0x24b846){return _0x3d4b7a['define']('VtigerConfiguration',attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc1f=['../../config/environment','define','VtigerConfiguration','int_vtiger_configurations','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1844db,_0x480bab){var _0x13866e=function(_0x1f1ea6){while(--_0x1f1ea6){_0x1844db['push'](_0x1844db['shift']());}};_0x13866e(++_0x480bab);}(_0xdc1f,0x1b1));var _0xfdc1=function(_0x5650c2,_0x1ec93d){_0x5650c2=_0x5650c2-0x0;var _0x5ba66d=_0xdc1f[_0x5650c2];return _0x5ba66d;};'use strict';var _=require('lodash');var util=require(_0xfdc1('0x0'));var logger=require(_0xfdc1('0x1'))(_0xfdc1('0x2'));var moment=require(_0xfdc1('0x3'));var BPromise=require(_0xfdc1('0x4'));var rp=require(_0xfdc1('0x5'));var fs=require('fs');var path=require(_0xfdc1('0x6'));var rimraf=require('rimraf');var config=require(_0xfdc1('0x7'));var attributes=require('./intVtigerConfiguration.attributes');module['exports']=function(_0x148d03,_0x8f564){return _0x148d03[_0xfdc1('0x8')](_0xfdc1('0x9'),attributes,{'tableName':_0xfdc1('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 d883e18..e396a4b 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 _0xb20c=['request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','VtigerConfiguration,\x20%s,\x20%s'];(function(_0x5aa31e,_0xa0550f){var _0x414260=function(_0x443d7a){while(--_0x443d7a){_0x5aa31e['push'](_0x5aa31e['shift']());}};_0x414260(++_0xa0550f);}(_0xb20c,0x129));var _0xcb20=function(_0x3300b2,_0x5dbcd3){_0x3300b2=_0x3300b2-0x0;var _0x21d4b5=_0xb20c[_0x3300b2];return _0x21d4b5;};'use strict';var _=require(_0xcb20('0x0'));var util=require(_0xcb20('0x1'));var moment=require(_0xcb20('0x2'));var BPromise=require(_0xcb20('0x3'));var rs=require(_0xcb20('0x4'));var fs=require('fs');var Redis=require(_0xcb20('0x5'));var db=require(_0xcb20('0x6'))['db'];var utils=require(_0xcb20('0x7'));var logger=require(_0xcb20('0x8'))(_0xcb20('0x9'));var config=require(_0xcb20('0xa'));var jayson=require(_0xcb20('0xb'));var client=jayson['client'][_0xcb20('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e548b,_0x3d547f,_0xdabeb6){return new BPromise(function(_0x2a659d,_0x20fdd2){return client['request'](_0x3e548b,_0xdabeb6)[_0xcb20('0xd')](function(_0xbccadf){logger['info'](_0xcb20('0xe'),_0x3d547f,_0xcb20('0xf'));logger[_0xcb20('0x10')](_0xcb20('0x11'),_0x3d547f,_0xcb20('0xf'),JSON[_0xcb20('0x12')](_0xbccadf));if(_0xbccadf[_0xcb20('0x13')]){if(_0xbccadf[_0xcb20('0x13')]['code']===0x1f4){logger[_0xcb20('0x13')](_0xcb20('0xe'),_0x3d547f,_0xbccadf[_0xcb20('0x13')]['message']);return _0x20fdd2(_0xbccadf[_0xcb20('0x13')][_0xcb20('0x14')]);}logger[_0xcb20('0x13')](_0xcb20('0xe'),_0x3d547f,_0xbccadf[_0xcb20('0x13')][_0xcb20('0x14')]);return _0x2a659d(_0xbccadf[_0xcb20('0x13')]['message']);}else{logger[_0xcb20('0x15')](_0xcb20('0xe'),_0x3d547f,_0xcb20('0xf'));_0x2a659d(_0xbccadf[_0xcb20('0x16')]['message']);}})[_0xcb20('0x17')](function(_0x36f827){logger[_0xcb20('0x13')](_0xcb20('0xe'),_0x3d547f,_0x36f827);_0x20fdd2(_0x36f827);});});} \ No newline at end of file +var _0xb298=['info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','then'];(function(_0x57190e,_0x331d69){var _0x111364=function(_0x1a29e2){while(--_0x1a29e2){_0x57190e['push'](_0x57190e['shift']());}};_0x111364(++_0x331d69);}(_0xb298,0xa0));var _0x8b29=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb298[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8b29('0x0'));var util=require(_0x8b29('0x1'));var moment=require(_0x8b29('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b29('0x3'));var fs=require('fs');var Redis=require(_0x8b29('0x4'));var db=require(_0x8b29('0x5'))['db'];var utils=require(_0x8b29('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8b29('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8b29('0x8')][_0x8b29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x416c4f,_0x2e1d76,_0x35afd6){return new BPromise(function(_0x155f4c,_0xef28d3){return client['request'](_0x416c4f,_0x35afd6)[_0x8b29('0xa')](function(_0x1cc10c){logger[_0x8b29('0xb')](_0x8b29('0xc'),_0x2e1d76,_0x8b29('0xd'));logger[_0x8b29('0xe')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x2e1d76,_0x8b29('0xd'),JSON['stringify'](_0x1cc10c));if(_0x1cc10c[_0x8b29('0xf')]){if(_0x1cc10c[_0x8b29('0xf')][_0x8b29('0x10')]===0x1f4){logger[_0x8b29('0xf')](_0x8b29('0xc'),_0x2e1d76,_0x1cc10c['error'][_0x8b29('0x11')]);return _0xef28d3(_0x1cc10c[_0x8b29('0xf')][_0x8b29('0x11')]);}logger[_0x8b29('0xf')](_0x8b29('0xc'),_0x2e1d76,_0x1cc10c['error']['message']);return _0x155f4c(_0x1cc10c[_0x8b29('0xf')][_0x8b29('0x11')]);}else{logger[_0x8b29('0xb')](_0x8b29('0xc'),_0x2e1d76,_0x8b29('0xd'));_0x155f4c(_0x1cc10c['result'][_0x8b29('0x11')]);}})[_0x8b29('0x12')](function(_0x338944){logger[_0x8b29('0xf')](_0x8b29('0xc'),_0x2e1d76,_0x338944);_0xef28d3(_0x338944);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 75cf170..f03c404 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 _0x280b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','/:id','show','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router'];(function(_0x3a9aa7,_0x488f21){var _0x299dde=function(_0x1c26ba){while(--_0x1c26ba){_0x3a9aa7['push'](_0x3a9aa7['shift']());}};_0x299dde(++_0x488f21);}(_0x280b,0x178));var _0xb280=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x280b[_0x2b4411];return _0x8e41ef;};'use strict';var multer=require(_0xb280('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb280('0x1'));var express=require(_0xb280('0x2'));var router=express[_0xb280('0x3')]();var fs_extra=require(_0xb280('0x4'));var auth=require(_0xb280('0x5'));var interaction=require(_0xb280('0x6'));var config=require(_0xb280('0x7'));var controller=require(_0xb280('0x8'));router['get']('/',auth[_0xb280('0x9')](),controller[_0xb280('0xa')]);router['get'](_0xb280('0xb'),auth[_0xb280('0x9')](),controller[_0xb280('0xc')]);router['post']('/',auth[_0xb280('0x9')](),controller[_0xb280('0xd')]);router[_0xb280('0xe')](_0xb280('0xb'),auth['isAuthenticated'](),controller[_0xb280('0xf')]);router[_0xb280('0x10')]('/:id',auth[_0xb280('0x9')](),controller[_0xb280('0x11')]);module[_0xb280('0x12')]=router; \ No newline at end of file +var _0xbe3a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x47e3f8,_0x517bcd){var _0x4742d5=function(_0x2a4f20){while(--_0x2a4f20){_0x47e3f8['push'](_0x47e3f8['shift']());}};_0x4742d5(++_0x517bcd);}(_0xbe3a,0x173));var _0xabe3=function(_0x484767,_0x2cfcff){_0x484767=_0x484767-0x0;var _0x5b8f61=_0xbe3a[_0x484767];return _0x5b8f61;};'use strict';var multer=require(_0xabe3('0x0'));var util=require(_0xabe3('0x1'));var path=require(_0xabe3('0x2'));var timeout=require(_0xabe3('0x3'));var express=require(_0xabe3('0x4'));var router=express[_0xabe3('0x5')]();var fs_extra=require(_0xabe3('0x6'));var auth=require(_0xabe3('0x7'));var interaction=require(_0xabe3('0x8'));var config=require(_0xabe3('0x9'));var controller=require(_0xabe3('0xa'));router[_0xabe3('0xb')]('/',auth[_0xabe3('0xc')](),controller[_0xabe3('0xd')]);router['get'](_0xabe3('0xe'),auth[_0xabe3('0xc')](),controller[_0xabe3('0xf')]);router[_0xabe3('0x10')]('/',auth['isAuthenticated'](),controller[_0xabe3('0x11')]);router[_0xabe3('0x12')](_0xabe3('0xe'),auth[_0xabe3('0xc')](),controller['update']);router[_0xabe3('0x13')](_0xabe3('0xe'),auth[_0xabe3('0xc')](),controller[_0xabe3('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 0061fa1..f3c2020 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 _0xcf30=['string','variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM'];(function(_0x35791e,_0x489717){var _0x3f7ae5=function(_0x5f37f7){while(--_0x5f37f7){_0x35791e['push'](_0x35791e['shift']());}};_0x3f7ae5(++_0x489717);}(_0xcf30,0x1ed));var _0x0cf3=function(_0x5e25d7,_0x210ade){_0x5e25d7=_0x5e25d7-0x0;var _0x174496=_0xcf30[_0x5e25d7];return _0x174496;};'use strict';var Sequelize=require('sequelize');module[_0x0cf3('0x0')]={'type':{'type':Sequelize[_0x0cf3('0x1')](_0x0cf3('0x2'),_0x0cf3('0x3'),_0x0cf3('0x4'),_0x0cf3('0x5'),_0x0cf3('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0cf3('0x7')]},'key':{'type':Sequelize[_0x0cf3('0x7')]},'keyType':{'type':Sequelize[_0x0cf3('0x1')]('string',_0x0cf3('0x3'),_0x0cf3('0x4'))},'keyContent':{'type':Sequelize[_0x0cf3('0x7')]},'idField':{'type':Sequelize[_0x0cf3('0x7')]},'nameField':{'type':Sequelize[_0x0cf3('0x7')]},'customField':{'type':Sequelize[_0x0cf3('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cf3('0x7')]}}; \ No newline at end of file +var _0xaa0f=['sequelize','exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable'];(function(_0xdbd077,_0x26c463){var _0x23c721=function(_0x3c226a){while(--_0x3c226a){_0xdbd077['push'](_0xdbd077['shift']());}};_0x23c721(++_0x26c463);}(_0xaa0f,0x144));var _0xfaa0=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0xaa0f[_0x3d8ca8];return _0x517e45;};'use strict';var Sequelize=require(_0xfaa0('0x0'));module[_0xfaa0('0x1')]={'type':{'type':Sequelize[_0xfaa0('0x2')](_0xfaa0('0x3'),'variable',_0xfaa0('0x4'),_0xfaa0('0x5'),_0xfaa0('0x6')),'defaultValue':_0xfaa0('0x3')},'content':{'type':Sequelize[_0xfaa0('0x7')]},'key':{'type':Sequelize[_0xfaa0('0x7')]},'keyType':{'type':Sequelize[_0xfaa0('0x2')]('string',_0xfaa0('0x8'),_0xfaa0('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xfaa0('0x7')]},'nameField':{'type':Sequelize[_0xfaa0('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index b91cac8..1640854 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 _0x2f97=['model','query','keys','filters','attributes','intersection','fields','length','order','where','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','options','find','create','body','update','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','destroy','sendStatus','stack','name','send','map','VtigerField','rawAttributes','type','key'];(function(_0x277491,_0x2dddd9){var _0x5b5730=function(_0x3663d0){while(--_0x3663d0){_0x277491['push'](_0x277491['shift']());}};_0x5b5730(++_0x2dddd9);}(_0x2f97,0x1d8));var _0x72f9=function(_0x32f9a1,_0x5debbc){_0x32f9a1=_0x32f9a1-0x0;var _0x25694b=_0x2f97[_0x32f9a1];return _0x25694b;};'use strict';var emlformat=require(_0x72f9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x72f9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x72f9('0x2'));var moment=require(_0x72f9('0x3'));var BPromise=require(_0x72f9('0x4'));var Mustache=require(_0x72f9('0x5'));var util=require('util');var path=require(_0x72f9('0x6'));var sox=require('sox');var csv=require(_0x72f9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x72f9('0x8'));var squel=require(_0x72f9('0x9'));var crypto=require(_0x72f9('0xa'));var jsforce=require(_0x72f9('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x72f9('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x72f9('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x72f9('0xd'));var as=require(_0x72f9('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x72f9('0xf'));var utils=require(_0x72f9('0x10'));var config=require(_0x72f9('0x11'));var licenseUtil=require(_0x72f9('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x257d83,_0x40b262){_0x40b262=_0x40b262||0xcc;return function(_0x3d2f54){if(_0x3d2f54){return _0x257d83['sendStatus'](_0x40b262);}return _0x257d83[_0x72f9('0x13')](_0x40b262)[_0x72f9('0x14')]();};}function respondWithResult(_0x15ec18,_0x2fdffd){_0x2fdffd=_0x2fdffd||0xc8;return function(_0x162833){if(_0x162833){return _0x15ec18[_0x72f9('0x13')](_0x2fdffd)[_0x72f9('0x15')](_0x162833);}};}function respondWithFilteredResult(_0x369d9d,_0x135f00){return function(_0x3a9c00){if(_0x3a9c00){var _0x4bd11e=typeof _0x135f00[_0x72f9('0x16')]===_0x72f9('0x17')&&typeof _0x135f00[_0x72f9('0x18')]===_0x72f9('0x17');var _0x3fe374=_0x3a9c00[_0x72f9('0x19')];var _0x6725a1=_0x4bd11e?0x0:_0x135f00[_0x72f9('0x16')];var _0x3a460c=_0x4bd11e?_0x3a9c00[_0x72f9('0x19')]:_0x135f00['offset']+_0x135f00['limit'];var _0x2a661a;if(_0x3a460c>=_0x3fe374){_0x3a460c=_0x3fe374;_0x2a661a=0xc8;}else{_0x2a661a=0xce;}_0x369d9d['status'](_0x2a661a);return _0x369d9d[_0x72f9('0x1a')](_0x72f9('0x1b'),_0x6725a1+'-'+_0x3a460c+'/'+_0x3fe374)[_0x72f9('0x15')](_0x3a9c00);}return null;};}function patchUpdates(_0x33e0bb){return function(_0x9b742a){try{jsonpatch['apply'](_0x9b742a,_0x33e0bb,!![]);}catch(_0x412a8e){return BPromise[_0x72f9('0x1c')](_0x412a8e);}return _0x9b742a['save']();};}function saveUpdates(_0x117c0d,_0x26a63d){return function(_0x29c872){if(_0x29c872){return _0x29c872['update'](_0x117c0d)[_0x72f9('0x1d')](function(_0x42852d){return _0x42852d;});}return null;};}function removeEntity(_0xb8205,_0x5d0065){return function(_0x7d82bf){if(_0x7d82bf){return _0x7d82bf[_0x72f9('0x1e')]()[_0x72f9('0x1d')](function(){_0xb8205[_0x72f9('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x471176,_0x91299f){return function(_0x7996da){if(!_0x7996da){_0x471176[_0x72f9('0x1f')](0x194);}return _0x7996da;};}function handleError(_0x2f33f1,_0x1b301e){_0x1b301e=_0x1b301e||0x1f4;return function(_0x140384){logger['error'](_0x140384[_0x72f9('0x20')]);if(_0x140384[_0x72f9('0x21')]){delete _0x140384['name'];}_0x2f33f1['status'](_0x1b301e)[_0x72f9('0x22')](_0x140384);};}exports['index']=function(_0x5a6c38,_0x17e01d){var _0x23ef30={},_0x4eaad3={},_0x207f28={'count':0x0,'rows':[]};var _0x398f58=_[_0x72f9('0x23')](db[_0x72f9('0x24')][_0x72f9('0x25')],function(_0x349bc8){return{'name':_0x349bc8['fieldName'],'type':_0x349bc8[_0x72f9('0x26')][_0x72f9('0x27')]};});_0x4eaad3[_0x72f9('0x28')]=_[_0x72f9('0x23')](_0x398f58,_0x72f9('0x21'));_0x4eaad3[_0x72f9('0x29')]=_[_0x72f9('0x2a')](_0x5a6c38[_0x72f9('0x29')]);_0x4eaad3[_0x72f9('0x2b')]=_['intersection'](_0x4eaad3[_0x72f9('0x28')],_0x4eaad3[_0x72f9('0x29')]);_0x23ef30[_0x72f9('0x2c')]=_[_0x72f9('0x2d')](_0x4eaad3[_0x72f9('0x28')],qs[_0x72f9('0x2e')](_0x5a6c38[_0x72f9('0x29')][_0x72f9('0x2e')]));_0x23ef30['attributes']=_0x23ef30[_0x72f9('0x2c')][_0x72f9('0x2f')]?_0x23ef30[_0x72f9('0x2c')]:_0x4eaad3[_0x72f9('0x28')];if(!_0x5a6c38[_0x72f9('0x29')]['hasOwnProperty']('nolimit')){_0x23ef30[_0x72f9('0x18')]=qs[_0x72f9('0x18')](_0x5a6c38[_0x72f9('0x29')][_0x72f9('0x18')]);_0x23ef30[_0x72f9('0x16')]=qs[_0x72f9('0x16')](_0x5a6c38['query'][_0x72f9('0x16')]);}_0x23ef30[_0x72f9('0x30')]=qs['sort'](_0x5a6c38[_0x72f9('0x29')]['sort']);_0x23ef30[_0x72f9('0x31')]=qs[_0x72f9('0x2b')](_['pick'](_0x5a6c38[_0x72f9('0x29')],_0x4eaad3[_0x72f9('0x2b')]),_0x398f58);if(_0x5a6c38['query'][_0x72f9('0x32')]){_0x23ef30['where']=_['merge'](_0x23ef30[_0x72f9('0x31')],{'$or':_[_0x72f9('0x23')](_0x398f58,function(_0x235e84){if(_0x235e84['type']!==_0x72f9('0x33')){var _0x16691b={};_0x16691b[_0x235e84['name']]={'$like':'%'+_0x5a6c38[_0x72f9('0x29')][_0x72f9('0x32')]+'%'};return _0x16691b;}})});}_0x23ef30=_[_0x72f9('0x34')]({},_0x23ef30,_0x5a6c38['options']);var _0x2d5b22={'where':_0x23ef30['where']};return db[_0x72f9('0x24')][_0x72f9('0x19')](_0x2d5b22)[_0x72f9('0x1d')](function(_0x48aa9b){_0x207f28[_0x72f9('0x19')]=_0x48aa9b;if(_0x5a6c38[_0x72f9('0x29')][_0x72f9('0x35')]){_0x23ef30[_0x72f9('0x36')]=[{'all':!![]}];}return db['VtigerField'][_0x72f9('0x37')](_0x23ef30);})['then'](function(_0xd5ab39){_0x207f28[_0x72f9('0x38')]=_0xd5ab39;return _0x207f28;})[_0x72f9('0x1d')](respondWithFilteredResult(_0x17e01d,_0x23ef30))[_0x72f9('0x39')](handleError(_0x17e01d,null));};exports[_0x72f9('0x3a')]=function(_0x58f575,_0x1c6730){var _0x1be616={'raw':!![],'where':{'id':_0x58f575['params']['id']}},_0x5882d1={};_0x5882d1[_0x72f9('0x28')]=_[_0x72f9('0x2a')](db[_0x72f9('0x24')]['rawAttributes']);_0x5882d1[_0x72f9('0x29')]=_[_0x72f9('0x2a')](_0x58f575['query']);_0x5882d1[_0x72f9('0x2b')]=_[_0x72f9('0x2d')](_0x5882d1['model'],_0x5882d1[_0x72f9('0x29')]);_0x1be616[_0x72f9('0x2c')]=_[_0x72f9('0x2d')](_0x5882d1[_0x72f9('0x28')],qs[_0x72f9('0x2e')](_0x58f575[_0x72f9('0x29')][_0x72f9('0x2e')]));_0x1be616[_0x72f9('0x2c')]=_0x1be616[_0x72f9('0x2c')][_0x72f9('0x2f')]?_0x1be616['attributes']:_0x5882d1[_0x72f9('0x28')];if(_0x58f575[_0x72f9('0x29')]['includeAll']){_0x1be616['include']=[{'all':!![]}];}_0x1be616=_['merge']({},_0x1be616,_0x58f575[_0x72f9('0x3b')]);return db[_0x72f9('0x24')][_0x72f9('0x3c')](_0x1be616)[_0x72f9('0x1d')](handleEntityNotFound(_0x1c6730,null))[_0x72f9('0x1d')](respondWithResult(_0x1c6730,null))['catch'](handleError(_0x1c6730,null));};exports[_0x72f9('0x3d')]=function(_0x1ff0b1,_0x4ba92c){return db[_0x72f9('0x24')]['create'](_0x1ff0b1[_0x72f9('0x3e')],{})[_0x72f9('0x1d')](respondWithResult(_0x4ba92c,0xc9))[_0x72f9('0x39')](handleError(_0x4ba92c,null));};exports[_0x72f9('0x3f')]=function(_0xf8349d,_0x1299a7){if(_0xf8349d[_0x72f9('0x3e')]['id']){delete _0xf8349d[_0x72f9('0x3e')]['id'];}return db[_0x72f9('0x24')][_0x72f9('0x3c')]({'where':{'id':_0xf8349d['params']['id']}})[_0x72f9('0x1d')](handleEntityNotFound(_0x1299a7,null))['then'](saveUpdates(_0xf8349d[_0x72f9('0x3e')],null))[_0x72f9('0x1d')](respondWithResult(_0x1299a7,null))[_0x72f9('0x39')](handleError(_0x1299a7,null));};exports['destroy']=function(_0x5d9083,_0x40a895){return db[_0x72f9('0x24')]['find']({'where':{'id':_0x5d9083['params']['id']}})[_0x72f9('0x1d')](handleEntityNotFound(_0x40a895,null))[_0x72f9('0x1d')](removeEntity(_0x40a895,null))[_0x72f9('0x39')](handleError(_0x40a895,null));}; \ No newline at end of file +var _0xde12=['end','error','stack','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','VtigerField','findAll','rows','catch','show','params','fields','find','create','body','eml-format','rimraf','zip-dir','request-promise','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/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','offset','limit','undefined','count','status','Content-Range','json','update','then'];(function(_0x417a23,_0x2a228d){var _0x3aeb3f=function(_0x38d60a){while(--_0x38d60a){_0x417a23['push'](_0x417a23['shift']());}};_0x3aeb3f(++_0x2a228d);}(_0xde12,0x1dc));var _0x2de1=function(_0x508413,_0x3429ca){_0x508413=_0x508413-0x0;var _0x5cc46d=_0xde12[_0x508413];return _0x5cc46d;};'use strict';var emlformat=require(_0x2de1('0x0'));var rimraf=require(_0x2de1('0x1'));var zipdir=require(_0x2de1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2de1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2de1('0x4'));var util=require(_0x2de1('0x5'));var path=require(_0x2de1('0x6'));var sox=require(_0x2de1('0x7'));var csv=require(_0x2de1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2de1('0x9'));var _=require('lodash');var squel=require(_0x2de1('0xa'));var crypto=require(_0x2de1('0xb'));var jsforce=require(_0x2de1('0xc'));var deskjs=require(_0x2de1('0xd'));var toCsv=require(_0x2de1('0x8'));var querystring=require(_0x2de1('0xe'));var Papa=require(_0x2de1('0xf'));var Redis=require(_0x2de1('0x10'));var authService=require(_0x2de1('0x11'));var qs=require(_0x2de1('0x12'));var as=require(_0x2de1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2de1('0x14'))(_0x2de1('0x15'));var utils=require('../../config/utils');var config=require(_0x2de1('0x16'));var licenseUtil=require(_0x2de1('0x17'));var db=require(_0x2de1('0x18'))['db'];function respondWithStatusCode(_0x4e8dce,_0x313f0f){_0x313f0f=_0x313f0f||0xcc;return function(_0x174144){if(_0x174144){return _0x4e8dce[_0x2de1('0x19')](_0x313f0f);}return _0x4e8dce['status'](_0x313f0f)['end']();};}function respondWithResult(_0x442e66,_0x3311d4){_0x3311d4=_0x3311d4||0xc8;return function(_0x46b0ac){if(_0x46b0ac){return _0x442e66['status'](_0x3311d4)['json'](_0x46b0ac);}};}function respondWithFilteredResult(_0x7128f5,_0x2f8c68){return function(_0x638561){if(_0x638561){var _0x54f041=typeof _0x2f8c68[_0x2de1('0x1a')]==='undefined'&&typeof _0x2f8c68[_0x2de1('0x1b')]===_0x2de1('0x1c');var _0x885769=_0x638561[_0x2de1('0x1d')];var _0x2e7940=_0x54f041?0x0:_0x2f8c68['offset'];var _0x8d226d=_0x54f041?_0x638561['count']:_0x2f8c68[_0x2de1('0x1a')]+_0x2f8c68[_0x2de1('0x1b')];var _0x59b7ee;if(_0x8d226d>=_0x885769){_0x8d226d=_0x885769;_0x59b7ee=0xc8;}else{_0x59b7ee=0xce;}_0x7128f5[_0x2de1('0x1e')](_0x59b7ee);return _0x7128f5['set'](_0x2de1('0x1f'),_0x2e7940+'-'+_0x8d226d+'/'+_0x885769)[_0x2de1('0x20')](_0x638561);}return null;};}function patchUpdates(_0x312cec){return function(_0x515df1){try{jsonpatch['apply'](_0x515df1,_0x312cec,!![]);}catch(_0x3ed5c9){return BPromise['reject'](_0x3ed5c9);}return _0x515df1['save']();};}function saveUpdates(_0x3b0da8,_0x6c5810){return function(_0x17a347){if(_0x17a347){return _0x17a347[_0x2de1('0x21')](_0x3b0da8)[_0x2de1('0x22')](function(_0x2b1aca){return _0x2b1aca;});}return null;};}function removeEntity(_0x5ec010,_0x138848){return function(_0x530486){if(_0x530486){return _0x530486['destroy']()[_0x2de1('0x22')](function(){_0x5ec010[_0x2de1('0x1e')](0xcc)[_0x2de1('0x23')]();});}};}function handleEntityNotFound(_0x39860e,_0x353731){return function(_0x53dac5){if(!_0x53dac5){_0x39860e[_0x2de1('0x19')](0x194);}return _0x53dac5;};}function handleError(_0x506f18,_0x211260){_0x211260=_0x211260||0x1f4;return function(_0x2c63ad){logger[_0x2de1('0x24')](_0x2c63ad[_0x2de1('0x25')]);if(_0x2c63ad[_0x2de1('0x26')]){delete _0x2c63ad['name'];}_0x506f18['status'](_0x211260)['send'](_0x2c63ad);};}exports['index']=function(_0x21399d,_0x56ca43){var _0x4ea097={},_0x207e10={},_0x4eb805={'count':0x0,'rows':[]};var _0x1dc378=_[_0x2de1('0x27')](db['VtigerField'][_0x2de1('0x28')],function(_0x1c6af2){return{'name':_0x1c6af2[_0x2de1('0x29')],'type':_0x1c6af2[_0x2de1('0x2a')][_0x2de1('0x2b')]};});_0x207e10[_0x2de1('0x2c')]=_[_0x2de1('0x27')](_0x1dc378,_0x2de1('0x26'));_0x207e10[_0x2de1('0x2d')]=_[_0x2de1('0x2e')](_0x21399d[_0x2de1('0x2d')]);_0x207e10[_0x2de1('0x2f')]=_[_0x2de1('0x30')](_0x207e10[_0x2de1('0x2c')],_0x207e10[_0x2de1('0x2d')]);_0x4ea097[_0x2de1('0x31')]=_[_0x2de1('0x30')](_0x207e10[_0x2de1('0x2c')],qs['fields'](_0x21399d[_0x2de1('0x2d')]['fields']));_0x4ea097[_0x2de1('0x31')]=_0x4ea097[_0x2de1('0x31')][_0x2de1('0x32')]?_0x4ea097[_0x2de1('0x31')]:_0x207e10[_0x2de1('0x2c')];if(!_0x21399d[_0x2de1('0x2d')][_0x2de1('0x33')](_0x2de1('0x34'))){_0x4ea097[_0x2de1('0x1b')]=qs[_0x2de1('0x1b')](_0x21399d[_0x2de1('0x2d')]['limit']);_0x4ea097[_0x2de1('0x1a')]=qs['offset'](_0x21399d['query']['offset']);}_0x4ea097[_0x2de1('0x35')]=qs[_0x2de1('0x36')](_0x21399d[_0x2de1('0x2d')][_0x2de1('0x36')]);_0x4ea097['where']=qs[_0x2de1('0x2f')](_[_0x2de1('0x37')](_0x21399d[_0x2de1('0x2d')],_0x207e10['filters']),_0x1dc378);if(_0x21399d['query'][_0x2de1('0x38')]){_0x4ea097[_0x2de1('0x39')]=_[_0x2de1('0x3a')](_0x4ea097[_0x2de1('0x39')],{'$or':_[_0x2de1('0x27')](_0x1dc378,function(_0x2e0d38){if(_0x2e0d38[_0x2de1('0x2a')]!==_0x2de1('0x3b')){var _0x5d824={};_0x5d824[_0x2e0d38[_0x2de1('0x26')]]={'$like':'%'+_0x21399d[_0x2de1('0x2d')][_0x2de1('0x38')]+'%'};return _0x5d824;}})});}_0x4ea097=_[_0x2de1('0x3a')]({},_0x4ea097,_0x21399d[_0x2de1('0x3c')]);var _0x57ebf2={'where':_0x4ea097[_0x2de1('0x39')]};return db['VtigerField'][_0x2de1('0x1d')](_0x57ebf2)[_0x2de1('0x22')](function(_0x44da4c){_0x4eb805[_0x2de1('0x1d')]=_0x44da4c;if(_0x21399d[_0x2de1('0x2d')][_0x2de1('0x3d')]){_0x4ea097[_0x2de1('0x3e')]=[{'all':!![]}];}return db[_0x2de1('0x3f')][_0x2de1('0x40')](_0x4ea097);})[_0x2de1('0x22')](function(_0x434771){_0x4eb805[_0x2de1('0x41')]=_0x434771;return _0x4eb805;})[_0x2de1('0x22')](respondWithFilteredResult(_0x56ca43,_0x4ea097))[_0x2de1('0x42')](handleError(_0x56ca43,null));};exports[_0x2de1('0x43')]=function(_0x12da03,_0x56981b){var _0x3953c1={'raw':!![],'where':{'id':_0x12da03[_0x2de1('0x44')]['id']}},_0x37dfa5={};_0x37dfa5[_0x2de1('0x2c')]=_['keys'](db[_0x2de1('0x3f')][_0x2de1('0x28')]);_0x37dfa5[_0x2de1('0x2d')]=_[_0x2de1('0x2e')](_0x12da03['query']);_0x37dfa5[_0x2de1('0x2f')]=_[_0x2de1('0x30')](_0x37dfa5[_0x2de1('0x2c')],_0x37dfa5[_0x2de1('0x2d')]);_0x3953c1[_0x2de1('0x31')]=_[_0x2de1('0x30')](_0x37dfa5['model'],qs[_0x2de1('0x45')](_0x12da03['query'][_0x2de1('0x45')]));_0x3953c1['attributes']=_0x3953c1[_0x2de1('0x31')][_0x2de1('0x32')]?_0x3953c1['attributes']:_0x37dfa5[_0x2de1('0x2c')];if(_0x12da03['query'][_0x2de1('0x3d')]){_0x3953c1['include']=[{'all':!![]}];}_0x3953c1=_['merge']({},_0x3953c1,_0x12da03[_0x2de1('0x3c')]);return db[_0x2de1('0x3f')][_0x2de1('0x46')](_0x3953c1)[_0x2de1('0x22')](handleEntityNotFound(_0x56981b,null))[_0x2de1('0x22')](respondWithResult(_0x56981b,null))[_0x2de1('0x42')](handleError(_0x56981b,null));};exports['create']=function(_0x1fd1a7,_0x1cd353){return db[_0x2de1('0x3f')][_0x2de1('0x47')](_0x1fd1a7['body'],{})[_0x2de1('0x22')](respondWithResult(_0x1cd353,0xc9))[_0x2de1('0x42')](handleError(_0x1cd353,null));};exports[_0x2de1('0x21')]=function(_0x1e799b,_0x22af8e){if(_0x1e799b[_0x2de1('0x48')]['id']){delete _0x1e799b['body']['id'];}return db[_0x2de1('0x3f')][_0x2de1('0x46')]({'where':{'id':_0x1e799b['params']['id']}})[_0x2de1('0x22')](handleEntityNotFound(_0x22af8e,null))[_0x2de1('0x22')](saveUpdates(_0x1e799b[_0x2de1('0x48')],null))[_0x2de1('0x22')](respondWithResult(_0x22af8e,null))[_0x2de1('0x42')](handleError(_0x22af8e,null));};exports['destroy']=function(_0x4b034c,_0x2650c4){return db['VtigerField'][_0x2de1('0x46')]({'where':{'id':_0x4b034c[_0x2de1('0x44')]['id']}})[_0x2de1('0x22')](handleEntityNotFound(_0x2650c4,null))[_0x2de1('0x22')](removeEntity(_0x2650c4,null))['catch'](handleError(_0x2650c4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c9602e4..42be800 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 _0x5085=['../../config/logger','api','moment','bluebird','rimraf','../../config/environment','define','VtigerField','int_vtiger_fields','FieldId','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x5085,0x1ba));var _0x5508=function(_0xc43cb5,_0x223300){_0xc43cb5=_0xc43cb5-0x0;var _0x52a98c=_0x5085[_0xc43cb5];return _0x52a98c;};'use strict';var _=require(_0x5508('0x0'));var util=require(_0x5508('0x1'));var logger=require(_0x5508('0x2'))(_0x5508('0x3'));var moment=require(_0x5508('0x4'));var BPromise=require(_0x5508('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5508('0x6'));var config=require(_0x5508('0x7'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x115ba0,_0x1cb23){return _0x115ba0[_0x5508('0x8')](_0x5508('0x9'),attributes,{'tableName':_0x5508('0xa'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':['idField',_0x5508('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb70b=['vtiger_unique_index','idField','FieldId','lodash','../../config/logger','api','moment','path','./intVtigerField.attributes','exports','define','int_vtiger_fields'];(function(_0x4bffe7,_0x2bd104){var _0x325690=function(_0x29e700){while(--_0x29e700){_0x4bffe7['push'](_0x4bffe7['shift']());}};_0x325690(++_0x2bd104);}(_0xb70b,0x18f));var _0xbb70=function(_0x5da7fb,_0x143fb3){_0x5da7fb=_0x5da7fb-0x0;var _0x5c9d10=_0xb70b[_0x5da7fb];return _0x5c9d10;};'use strict';var _=require(_0xbb70('0x0'));var util=require('util');var logger=require(_0xbb70('0x1'))(_0xbb70('0x2'));var moment=require(_0xbb70('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbb70('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbb70('0x5'));module[_0xbb70('0x6')]=function(_0x209b0a,_0x1e85b5){return _0x209b0a[_0xbb70('0x7')]('VtigerField',attributes,{'tableName':_0xbb70('0x8'),'paranoid':![],'indexes':[{'name':_0xbb70('0x9'),'fields':[_0xbb70('0xa'),_0xbb70('0xb')],'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 cce7463..bd0a6d4 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 _0x7369=['error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','VtigerField,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x2d92b8,_0x4e75ee){var _0x1a1d8a=function(_0xff11c4){while(--_0xff11c4){_0x2d92b8['push'](_0x2d92b8['shift']());}};_0x1a1d8a(++_0x4e75ee);}(_0x7369,0x1a8));var _0x9736=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0x7369[_0xbe200f];return _0x192597;};'use strict';var _=require(_0x9736('0x0'));var util=require(_0x9736('0x1'));var moment=require(_0x9736('0x2'));var BPromise=require('bluebird');var rs=require(_0x9736('0x3'));var fs=require('fs');var Redis=require(_0x9736('0x4'));var db=require(_0x9736('0x5'))['db'];var utils=require(_0x9736('0x6'));var logger=require('../../config/logger')(_0x9736('0x7'));var config=require(_0x9736('0x8'));var jayson=require(_0x9736('0x9'));var client=jayson[_0x9736('0xa')][_0x9736('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a58ce,_0x4ea870,_0x524ce4){return new BPromise(function(_0x2d9ee2,_0x24edfe){return client[_0x9736('0xc')](_0x1a58ce,_0x524ce4)['then'](function(_0xd7281b){logger[_0x9736('0xd')](_0x9736('0xe'),_0x4ea870,_0x9736('0xf'));logger['debug']('VtigerField,\x20%s,\x20%s,\x20%s',_0x4ea870,_0x9736('0xf'),JSON[_0x9736('0x10')](_0xd7281b));if(_0xd7281b['error']){if(_0xd7281b[_0x9736('0x11')]['code']===0x1f4){logger[_0x9736('0x11')](_0x9736('0xe'),_0x4ea870,_0xd7281b[_0x9736('0x11')][_0x9736('0x12')]);return _0x24edfe(_0xd7281b['error'][_0x9736('0x12')]);}logger['error']('VtigerField,\x20%s,\x20%s',_0x4ea870,_0xd7281b[_0x9736('0x11')][_0x9736('0x12')]);return _0x2d9ee2(_0xd7281b[_0x9736('0x11')][_0x9736('0x12')]);}else{logger['info'](_0x9736('0xe'),_0x4ea870,_0x9736('0xf'));_0x2d9ee2(_0xd7281b[_0x9736('0x13')]['message']);}})[_0x9736('0x14')](function(_0x396ad4){logger[_0x9736('0x11')]('VtigerField,\x20%s,\x20%s',_0x4ea870,_0x396ad4);_0x24edfe(_0x396ad4);});});} \ No newline at end of file +var _0x1cea=['stringify','error','code','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','request\x20sent','debug','VtigerField,\x20%s,\x20%s,\x20%s'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1cea,0x103));var _0xa1ce=function(_0x5e36d1,_0x471178){_0x5e36d1=_0x5e36d1-0x0;var _0x950b9e=_0x1cea[_0x5e36d1];return _0x950b9e;};'use strict';var _=require(_0xa1ce('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa1ce('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1ce('0x2'));var db=require(_0xa1ce('0x3'))['db'];var utils=require(_0xa1ce('0x4'));var logger=require('../../config/logger')(_0xa1ce('0x5'));var config=require(_0xa1ce('0x6'));var jayson=require(_0xa1ce('0x7'));var client=jayson[_0xa1ce('0x8')][_0xa1ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e8f40,_0x29ddf9,_0x2de423){return new BPromise(function(_0x34bd76,_0x1be4d7){return client[_0xa1ce('0xa')](_0x5e8f40,_0x2de423)[_0xa1ce('0xb')](function(_0x10eea7){logger[_0xa1ce('0xc')](_0xa1ce('0xd'),_0x29ddf9,_0xa1ce('0xe'));logger[_0xa1ce('0xf')](_0xa1ce('0x10'),_0x29ddf9,'request\x20sent',JSON[_0xa1ce('0x11')](_0x10eea7));if(_0x10eea7['error']){if(_0x10eea7[_0xa1ce('0x12')][_0xa1ce('0x13')]===0x1f4){logger[_0xa1ce('0x12')](_0xa1ce('0xd'),_0x29ddf9,_0x10eea7[_0xa1ce('0x12')][_0xa1ce('0x14')]);return _0x1be4d7(_0x10eea7[_0xa1ce('0x12')]['message']);}logger[_0xa1ce('0x12')](_0xa1ce('0xd'),_0x29ddf9,_0x10eea7[_0xa1ce('0x12')][_0xa1ce('0x14')]);return _0x34bd76(_0x10eea7[_0xa1ce('0x12')][_0xa1ce('0x14')]);}else{logger[_0xa1ce('0xc')](_0xa1ce('0xd'),_0x29ddf9,'request\x20sent');_0x34bd76(_0x10eea7[_0xa1ce('0x15')][_0xa1ce('0x14')]);}})[_0xa1ce('0x16')](function(_0x224ed7){logger['error']('VtigerField,\x20%s,\x20%s',_0x29ddf9,_0x224ed7);_0x1be4d7(_0x224ed7);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 2b68f0c..dea44f1 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 _0xb2b4=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb2b4,0x141));var _0x4b2b=function(_0x2f6541,_0x363cba){_0x2f6541=_0x2f6541-0x0;var _0x4d76d8=_0xb2b4[_0x2f6541];return _0x4d76d8;};'use strict';var multer=require(_0x4b2b('0x0'));var util=require(_0x4b2b('0x1'));var path=require(_0x4b2b('0x2'));var timeout=require(_0x4b2b('0x3'));var express=require(_0x4b2b('0x4'));var router=express['Router']();var fs_extra=require(_0x4b2b('0x5'));var auth=require(_0x4b2b('0x6'));var interaction=require(_0x4b2b('0x7'));var config=require(_0x4b2b('0x8'));var controller=require(_0x4b2b('0x9'));router[_0x4b2b('0xa')]('/',auth[_0x4b2b('0xb')](),controller[_0x4b2b('0xc')]);router[_0x4b2b('0xa')](_0x4b2b('0xd'),auth['isAuthenticated'](),controller[_0x4b2b('0xe')]);router[_0x4b2b('0xa')](_0x4b2b('0xf'),auth['isAuthenticated'](),controller[_0x4b2b('0x10')]);router[_0x4b2b('0xa')](_0x4b2b('0x11'),auth[_0x4b2b('0xb')](),controller[_0x4b2b('0x12')]);router[_0x4b2b('0x13')]('/',auth['isAuthenticated'](),controller[_0x4b2b('0x14')]);router[_0x4b2b('0x13')](_0x4b2b('0xf'),auth[_0x4b2b('0xb')](),controller['addConfiguration']);router[_0x4b2b('0x15')](_0x4b2b('0xd'),auth[_0x4b2b('0xb')](),controller['update']);router[_0x4b2b('0x16')]('/:id',auth[_0x4b2b('0xb')](),controller[_0x4b2b('0x17')]);module[_0x4b2b('0x18')]=router; \ No newline at end of file +var _0xcb0e=['getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations'];(function(_0x271567,_0x3381fc){var _0x48164f=function(_0x3d561f){while(--_0x3d561f){_0x271567['push'](_0x271567['shift']());}};_0x48164f(++_0x3381fc);}(_0xcb0e,0x1c0));var _0xecb0=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcb0e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xecb0('0x0'));var util=require(_0xecb0('0x1'));var path=require(_0xecb0('0x2'));var timeout=require(_0xecb0('0x3'));var express=require(_0xecb0('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xecb0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xecb0('0x6'));var controller=require(_0xecb0('0x7'));router[_0xecb0('0x8')]('/',auth[_0xecb0('0x9')](),controller[_0xecb0('0xa')]);router['get']('/:id',auth[_0xecb0('0x9')](),controller['show']);router['get'](_0xecb0('0xb'),auth[_0xecb0('0x9')](),controller[_0xecb0('0xc')]);router['get'](_0xecb0('0xd'),auth[_0xecb0('0x9')](),controller['getFields']);router[_0xecb0('0xe')]('/',auth['isAuthenticated'](),controller[_0xecb0('0xf')]);router['post']('/:id/configurations',auth[_0xecb0('0x9')](),controller[_0xecb0('0x10')]);router[_0xecb0('0x11')](_0xecb0('0x12'),auth[_0xecb0('0x9')](),controller[_0xecb0('0x13')]);router[_0xecb0('0x14')](_0xecb0('0x12'),auth[_0xecb0('0x9')](),controller[_0xecb0('0x15')]);module[_0xecb0('0x16')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 5fc30d3..83e46b2 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 _0x5f2f=['STRING','username','ENUM','password','token','newTab','integrationTab','sequelize','exports'];(function(_0x3e231b,_0x126ff3){var _0x867a46=function(_0x21ca7a){while(--_0x21ca7a){_0x3e231b['push'](_0x3e231b['shift']());}};_0x867a46(++_0x126ff3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2951cf,_0x4d662e){_0x2951cf=_0x2951cf-0x0;var _0x4c70c5=_0x5f2f[_0x2951cf];return _0x4c70c5;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'name':{'type':Sequelize[_0xf5f2('0x2')]},'description':{'type':Sequelize[_0xf5f2('0x2')]},'username':{'type':Sequelize[_0xf5f2('0x2')],'unique':_0xf5f2('0x3')},'password':{'type':Sequelize[_0xf5f2('0x2')]},'token':{'type':Sequelize[_0xf5f2('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xf5f2('0x4')](_0xf5f2('0x5'),_0xf5f2('0x6')),'defaultValue':_0xf5f2('0x5')},'serverUrl':{'type':Sequelize[_0xf5f2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xf5f2('0x4')]('integrationTab',_0xf5f2('0x7')),'defaultValue':_0xf5f2('0x8')}}; \ No newline at end of file +var _0xdec3=['newTab','sequelize','STRING','remoteUri','password','token','ENUM','integrationTab'];(function(_0x25e754,_0x5c0c83){var _0x3282b4=function(_0x14e36c){while(--_0x14e36c){_0x25e754['push'](_0x25e754['shift']());}};_0x3282b4(++_0x5c0c83);}(_0xdec3,0x89));var _0x3dec=function(_0x4a39a6,_0x5eaa0d){_0x4a39a6=_0x4a39a6-0x0;var _0x1dee5a=_0xdec3[_0x4a39a6];return _0x1dee5a;};'use strict';var Sequelize=require(_0x3dec('0x0'));module['exports']={'name':{'type':Sequelize[_0x3dec('0x1')]},'description':{'type':Sequelize[_0x3dec('0x1')]},'username':{'type':Sequelize[_0x3dec('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x3dec('0x1')]},'token':{'type':Sequelize[_0x3dec('0x1')]},'remoteUri':{'type':Sequelize[_0x3dec('0x1')],'unique':_0x3dec('0x2')},'authType':{'type':Sequelize['ENUM'](_0x3dec('0x3'),_0x3dec('0x4')),'defaultValue':_0x3dec('0x3')},'serverUrl':{'type':Sequelize[_0x3dec('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x3dec('0x5')](_0x3dec('0x6'),_0x3dec('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a866890..6313184 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 _0x9ffd=['catch','show','params','rawAttributes','find','create','body','destroy','getConfigurations','ZendeskConfiguration','pick','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','ZendeskField','findOne','username','password','token','authType','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','base64','%s/token:%s','toString','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','getFields','send','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','update','then','stack','name','index','map','ZendeskAccount','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll'];(function(_0x45f2c6,_0x2e571d){var _0x505f61=function(_0x3328f8){while(--_0x3328f8){_0x45f2c6['push'](_0x45f2c6['shift']());}};_0x505f61(++_0x2e571d);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x2bf7f0,_0x127d8e){_0x2bf7f0=_0x2bf7f0-0x0;var _0xd83a5c=_0x9ffd[_0x2bf7f0];return _0xd83a5c;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var hardwareService=require(_0xd9ff('0x13'));var logger=require(_0xd9ff('0x14'))(_0xd9ff('0x15'));var utils=require(_0xd9ff('0x16'));var config=require(_0xd9ff('0x17'));var licenseUtil=require(_0xd9ff('0x18'));var db=require(_0xd9ff('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x47b0d7,_0xaaf7af){_0xaaf7af=_0xaaf7af||0xcc;return function(_0x16a0d9){if(_0x16a0d9){return _0x47b0d7[_0xd9ff('0x1a')](_0xaaf7af);}return _0x47b0d7[_0xd9ff('0x1b')](_0xaaf7af)[_0xd9ff('0x1c')]();};}function respondWithResult(_0x556aa4,_0x2f78c1){_0x2f78c1=_0x2f78c1||0xc8;return function(_0x3c9ace){if(_0x3c9ace){return _0x556aa4['status'](_0x2f78c1)[_0xd9ff('0x1d')](_0x3c9ace);}};}function respondWithFilteredResult(_0x5db010,_0x4ffe54){return function(_0x547e28){if(_0x547e28){var _0x4c5718=typeof _0x4ffe54[_0xd9ff('0x1e')]==='undefined'&&typeof _0x4ffe54[_0xd9ff('0x1f')]===_0xd9ff('0x20');var _0x39c6ce=_0x547e28[_0xd9ff('0x21')];var _0x5f45c4=_0x4c5718?0x0:_0x4ffe54[_0xd9ff('0x1e')];var _0x3ccf15=_0x4c5718?_0x547e28[_0xd9ff('0x21')]:_0x4ffe54[_0xd9ff('0x1e')]+_0x4ffe54[_0xd9ff('0x1f')];var _0x3ea97d;if(_0x3ccf15>=_0x39c6ce){_0x3ccf15=_0x39c6ce;_0x3ea97d=0xc8;}else{_0x3ea97d=0xce;}_0x5db010[_0xd9ff('0x1b')](_0x3ea97d);return _0x5db010[_0xd9ff('0x22')]('Content-Range',_0x5f45c4+'-'+_0x3ccf15+'/'+_0x39c6ce)['json'](_0x547e28);}return null;};}function patchUpdates(_0x264a3d){return function(_0x3eed13){try{jsonpatch['apply'](_0x3eed13,_0x264a3d,!![]);}catch(_0x588151){return BPromise['reject'](_0x588151);}return _0x3eed13['save']();};}function saveUpdates(_0x1f4d9e,_0x58eb5f){return function(_0x4c486a){if(_0x4c486a){return _0x4c486a[_0xd9ff('0x23')](_0x1f4d9e)[_0xd9ff('0x24')](function(_0x9f074e){return _0x9f074e;});}return null;};}function removeEntity(_0x278b66,_0x42a828){return function(_0x4b058a){if(_0x4b058a){return _0x4b058a['destroy']()[_0xd9ff('0x24')](function(){_0x278b66['status'](0xcc)[_0xd9ff('0x1c')]();});}};}function handleEntityNotFound(_0x4d86fe,_0x285002){return function(_0x5d45b3){if(!_0x5d45b3){_0x4d86fe[_0xd9ff('0x1a')](0x194);}return _0x5d45b3;};}function handleError(_0x159e56,_0x2138b4){_0x2138b4=_0x2138b4||0x1f4;return function(_0x2970e8){logger['error'](_0x2970e8[_0xd9ff('0x25')]);if(_0x2970e8[_0xd9ff('0x26')]){delete _0x2970e8[_0xd9ff('0x26')];}_0x159e56[_0xd9ff('0x1b')](_0x2138b4)['send'](_0x2970e8);};}exports[_0xd9ff('0x27')]=function(_0x3792d9,_0x44b5a7){var _0x45fb63={},_0x263d3a={},_0xe516e2={'count':0x0,'rows':[]};var _0x420ffa=_[_0xd9ff('0x28')](db[_0xd9ff('0x29')]['rawAttributes'],function(_0xcea5db){return{'name':_0xcea5db['fieldName'],'type':_0xcea5db[_0xd9ff('0x2a')][_0xd9ff('0x2b')]};});_0x263d3a[_0xd9ff('0x2c')]=_['map'](_0x420ffa,_0xd9ff('0x26'));_0x263d3a[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x3792d9[_0xd9ff('0x2d')]);_0x263d3a['filters']=_[_0xd9ff('0x2f')](_0x263d3a['model'],_0x263d3a[_0xd9ff('0x2d')]);_0x45fb63[_0xd9ff('0x30')]=_[_0xd9ff('0x2f')](_0x263d3a[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x45fb63[_0xd9ff('0x30')]=_0x45fb63[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x45fb63[_0xd9ff('0x30')]:_0x263d3a[_0xd9ff('0x2c')];if(!_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x33')]('nolimit')){_0x45fb63[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x3792d9[_0xd9ff('0x2d')]['limit']);_0x45fb63[_0xd9ff('0x1e')]=qs['offset'](_0x3792d9[_0xd9ff('0x2d')]['offset']);}_0x45fb63[_0xd9ff('0x34')]=qs['sort'](_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x45fb63[_0xd9ff('0x36')]=qs['filters'](_['pick'](_0x3792d9['query'],_0x263d3a[_0xd9ff('0x37')]),_0x420ffa);if(_0x3792d9[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x45fb63[_0xd9ff('0x36')]=_[_0xd9ff('0x39')](_0x45fb63[_0xd9ff('0x36')],{'$or':_['map'](_0x420ffa,function(_0x4c00c2){if(_0x4c00c2['type']!==_0xd9ff('0x3a')){var _0x252edc={};_0x252edc[_0x4c00c2[_0xd9ff('0x26')]]={'$like':'%'+_0x3792d9[_0xd9ff('0x2d')]['filter']+'%'};return _0x252edc;}})});}_0x45fb63=_[_0xd9ff('0x39')]({},_0x45fb63,_0x3792d9['options']);var _0x3cff52={'where':_0x45fb63[_0xd9ff('0x36')]};return db[_0xd9ff('0x29')][_0xd9ff('0x21')](_0x3cff52)['then'](function(_0x1e34da){_0xe516e2[_0xd9ff('0x21')]=_0x1e34da;if(_0x3792d9['query'][_0xd9ff('0x3b')]){_0x45fb63[_0xd9ff('0x3c')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x3d')](_0x45fb63);})[_0xd9ff('0x24')](function(_0x1cc848){_0xe516e2['rows']=_0x1cc848;return _0xe516e2;})[_0xd9ff('0x24')](respondWithFilteredResult(_0x44b5a7,_0x45fb63))[_0xd9ff('0x3e')](handleError(_0x44b5a7,null));};exports[_0xd9ff('0x3f')]=function(_0x39fbbb,_0x472724){var _0x52aab8={'raw':![],'where':{'id':_0x39fbbb[_0xd9ff('0x40')]['id']}},_0x3178cd={};_0x3178cd[_0xd9ff('0x2c')]=_['keys'](db['ZendeskAccount'][_0xd9ff('0x41')]);_0x3178cd[_0xd9ff('0x2d')]=_[_0xd9ff('0x2e')](_0x39fbbb[_0xd9ff('0x2d')]);_0x3178cd[_0xd9ff('0x37')]=_[_0xd9ff('0x2f')](_0x3178cd['model'],_0x3178cd[_0xd9ff('0x2d')]);_0x52aab8[_0xd9ff('0x30')]=_['intersection'](_0x3178cd[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x39fbbb[_0xd9ff('0x2d')][_0xd9ff('0x31')]));_0x52aab8[_0xd9ff('0x30')]=_0x52aab8['attributes']['length']?_0x52aab8['attributes']:_0x3178cd[_0xd9ff('0x2c')];if(_0x39fbbb['query'][_0xd9ff('0x3b')]){_0x52aab8[_0xd9ff('0x3c')]=[{'all':!![]}];}_0x52aab8=_[_0xd9ff('0x39')]({},_0x52aab8,_0x39fbbb['options']);return db[_0xd9ff('0x29')][_0xd9ff('0x42')](_0x52aab8)['then'](handleEntityNotFound(_0x472724,null))[_0xd9ff('0x24')](respondWithResult(_0x472724,null))[_0xd9ff('0x3e')](handleError(_0x472724,null));};exports[_0xd9ff('0x43')]=function(_0x316854,_0x559101){return db[_0xd9ff('0x29')]['create'](_0x316854[_0xd9ff('0x44')],{})['then'](respondWithResult(_0x559101,0xc9))[_0xd9ff('0x3e')](handleError(_0x559101,null));};exports[_0xd9ff('0x23')]=function(_0x2bf37a,_0x1760c3){if(_0x2bf37a[_0xd9ff('0x44')]['id']){delete _0x2bf37a['body']['id'];}return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x2bf37a[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x1760c3,null))['then'](saveUpdates(_0x2bf37a['body'],null))['then'](respondWithResult(_0x1760c3,null))[_0xd9ff('0x3e')](handleError(_0x1760c3,null));};exports[_0xd9ff('0x45')]=function(_0x29c6bd,_0x572618){return db[_0xd9ff('0x29')][_0xd9ff('0x42')]({'where':{'id':_0x29c6bd[_0xd9ff('0x40')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x572618,null))[_0xd9ff('0x24')](removeEntity(_0x572618,null))[_0xd9ff('0x3e')](handleError(_0x572618,null));};exports[_0xd9ff('0x46')]=function(_0x1e1364,_0x1ad160,_0x10d9d0){var _0x5dcb5={};var _0x3d6143={};var _0x2533d7;var _0x487b07;return db[_0xd9ff('0x29')]['findOne']({'where':{'id':_0x1e1364[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0x1ad160,null))[_0xd9ff('0x24')](function(_0x49623d){if(_0x49623d){_0x2533d7=_0x49623d;_0x3d6143[_0xd9ff('0x2c')]=_['keys'](db[_0xd9ff('0x47')]['rawAttributes']);_0x3d6143[_0xd9ff('0x2d')]=_['keys'](_0x1e1364[_0xd9ff('0x2d')]);_0x3d6143['filters']=_[_0xd9ff('0x2f')](_0x3d6143[_0xd9ff('0x2c')],_0x3d6143[_0xd9ff('0x2d')]);_0x5dcb5[_0xd9ff('0x30')]=_['intersection'](_0x3d6143[_0xd9ff('0x2c')],qs[_0xd9ff('0x31')](_0x1e1364[_0xd9ff('0x2d')]['fields']));_0x5dcb5[_0xd9ff('0x30')]=_0x5dcb5[_0xd9ff('0x30')][_0xd9ff('0x32')]?_0x5dcb5[_0xd9ff('0x30')]:_0x3d6143[_0xd9ff('0x2c')];_0x5dcb5['order']=qs[_0xd9ff('0x35')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x35')]);_0x5dcb5[_0xd9ff('0x36')]=qs[_0xd9ff('0x37')](_[_0xd9ff('0x48')](_0x1e1364[_0xd9ff('0x2d')],_0x3d6143['filters']));if(_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x38')]){_0x5dcb5['where']=_[_0xd9ff('0x39')](_0x5dcb5[_0xd9ff('0x36')],{'$or':_['map'](_0x5dcb5[_0xd9ff('0x30')],function(_0x36d5c2){var _0x25d8d1={};_0x25d8d1[_0x36d5c2]={'$like':'%'+_0x1e1364['query']['filter']+'%'};return _0x25d8d1;})});}_0x5dcb5=_[_0xd9ff('0x39')]({},_0x5dcb5,_0x1e1364['options']);return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x31907e){if(_0x31907e){_0x487b07=_0x31907e[_0xd9ff('0x32')];if(!_0x1e1364['query']['hasOwnProperty']('nolimit')){_0x5dcb5[_0xd9ff('0x1f')]=qs[_0xd9ff('0x1f')](_0x1e1364[_0xd9ff('0x2d')][_0xd9ff('0x1f')]);_0x5dcb5[_0xd9ff('0x1e')]=qs['offset'](_0x1e1364[_0xd9ff('0x2d')]['offset']);}return _0x2533d7[_0xd9ff('0x46')](_0x5dcb5);}})[_0xd9ff('0x24')](function(_0x3f92c3){if(_0x3f92c3){return _0x3f92c3?{'count':_0x487b07,'rows':_0x3f92c3}:null;}})[_0xd9ff('0x24')](respondWithResult(_0x1ad160,null))[_0xd9ff('0x3e')](handleError(_0x1ad160,null));};exports[_0xd9ff('0x49')]=function(_0xed12df,_0xfcafbe,_0x5d633b){if(_0xed12df[_0xd9ff('0x44')]['id']){delete _0xed12df[_0xd9ff('0x44')]['id'];}return db['ZendeskAccount']['findOne']({'where':{'id':_0xed12df[_0xd9ff('0x40')]['id']}})['then'](handleEntityNotFound(_0xfcafbe,null))[_0xd9ff('0x24')](function(_0x34fca4){if(_0x34fca4){_0xed12df['body'][_0xd9ff('0x4a')]=_0x34fca4['id'];_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4b')]=integrations[_0xd9ff('0x4c')](_0xed12df[_0xd9ff('0x44')]['channel'],_0xed12df[_0xd9ff('0x44')]['type']);_0xed12df['body'][_0xd9ff('0x4d')]=integrations[_0xd9ff('0x4e')](_0xed12df[_0xd9ff('0x44')][_0xd9ff('0x4f')],_0xed12df['body'][_0xd9ff('0x2a')]);return db[_0xd9ff('0x47')][_0xd9ff('0x43')](_0xed12df[_0xd9ff('0x44')],{'include':[{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4b')},{'model':db[_0xd9ff('0x50')],'as':_0xd9ff('0x4d')}]});}return null;})['then'](respondWithResult(_0xfcafbe,null))['catch'](handleError(_0xfcafbe,null));};exports['getFields']=function(_0x275fb9,_0x31db27,_0x514d59){var _0x196670='';return db[_0xd9ff('0x29')][_0xd9ff('0x51')]({'where':{'id':_0x275fb9[_0xd9ff('0x40')]['id']},'attributes':['id',_0xd9ff('0x52'),_0xd9ff('0x53'),_0xd9ff('0x54'),_0xd9ff('0x55'),'remoteUri']})[_0xd9ff('0x24')](handleEntityNotFound(_0x31db27,null))[_0xd9ff('0x24')](function(_0x228413){if(_0x228413){_0x196670=_0x228413['remoteUri'];var _0x14e936=_0x196670['slice'](-0x1);if(_0x14e936==='/'){_0x196670=_0x196670[_0xd9ff('0x56')](0x0,_0x196670[_0xd9ff('0x57')](_0x14e936));}var _0x25ee82={'method':'GET','uri':util[_0xd9ff('0x58')](_0xd9ff('0x59'),_0x196670,_0xd9ff('0x5a')),'json':!![]};switch(_0x228413[_0xd9ff('0x55')]){case'password':_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5d'),_0x228413[_0xd9ff('0x52')],_0x228413[_0xd9ff('0x53')]))['toString'](_0xd9ff('0x5e')))};break;case _0xd9ff('0x54'):_0x25ee82[_0xd9ff('0x5b')]={'Authorization':util[_0xd9ff('0x58')](_0xd9ff('0x5c'),new Buffer(util['format'](_0xd9ff('0x5f'),_0x228413[_0xd9ff('0x52')],_0x228413['token']))[_0xd9ff('0x60')](_0xd9ff('0x5e')))};break;default:throw new db[(_0xd9ff('0x61'))]['ValidationError'](_0xd9ff('0x62'));}return rp(_0x25ee82);}})['then'](function(_0x1e46fc){if(_0x1e46fc){var _0x478e0d=[_0xd9ff('0x63'),_0xd9ff('0x64'),_0xd9ff('0x65'),_0xd9ff('0x66')];_[_0xd9ff('0x67')](_0x1e46fc[_0xd9ff('0x5a')],function(_0xda0003){return _0x478e0d[_0xd9ff('0x68')](_0xda0003[_0xd9ff('0x2a')]);});return{'count':_0x1e46fc[_0xd9ff('0x5a')]['length'],'rows':_[_0xd9ff('0x28')](_0x1e46fc[_0xd9ff('0x5a')],function(_0x1f6cb9){return{'id':_0x1f6cb9['id'],'name':_0x1f6cb9[_0xd9ff('0x69')]>0x7?_0x1f6cb9[_0xd9ff('0x6a')]:_0x1f6cb9[_0xd9ff('0x2a')],'custom':_0x1f6cb9['position']>0x7?!![]:![],'options':_0x1f6cb9['system_field_options']?_0x1f6cb9[_0xd9ff('0x6b')]:_0x1f6cb9[_0xd9ff('0x6c')]?_0x1f6cb9[_0xd9ff('0x6c')]:[]};})};}})[_0xd9ff('0x24')](respondWithResult(_0x31db27,null))[_0xd9ff('0x3e')](function(_0x183199){var _0x5b234c=_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?0x1f4:_0x183199[_0xd9ff('0x6e')]||0x1f4;logger[_0xd9ff('0x6f')](_0xd9ff('0x70'),_0xd9ff('0x71'),_0x5b234c,JSON['stringify'](_0x183199));delete _0x183199[_0xd9ff('0x26')];if(_0x5b234c===0x191){_0x5b234c=0x190;}_0x31db27[_0xd9ff('0x1b')](_0x5b234c)[_0xd9ff('0x72')](_0x275fb9[_0xd9ff('0x2d')][_0xd9ff('0x6d')]?{'message':_0xd9ff('0x73'),'statusCode':_0x183199[_0xd9ff('0x6e')]}:_0x183199);});}; \ No newline at end of file +var _0xb688=['json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','stack','index','map','ZendeskAccount','rawAttributes','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','name','options','findAll','rows','catch','show','includeAll','include','find','create','params','body','findOne','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','ZendeskConfiguration','getFields','username','password','token','remoteUri','slice','substring','%s/%s','authType','format','Basic\x20%s','%s:%s','toString','base64','headers','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','description','group','assignee','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','error','stringify','send','Wrong\x20credentials','statusCode','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','../../components/integrations/configuration','sendStatus','end','status'];(function(_0x4536a4,_0x55af7b){var _0x4fd1c1=function(_0x4c68cd){while(--_0x4c68cd){_0x4536a4['push'](_0x4536a4['shift']());}};_0x4fd1c1(++_0x55af7b);}(_0xb688,0xcf));var _0x8b68=function(_0x35cf67,_0x2001cc){_0x35cf67=_0x35cf67-0x0;var _0x15c4f1=_0xb688[_0x35cf67];return _0x15c4f1;};'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'];var integrations=require(_0x8b68('0x1b'));function respondWithStatusCode(_0x2f3af4,_0xaa8725){_0xaa8725=_0xaa8725||0xcc;return function(_0x137c8e){if(_0x137c8e){return _0x2f3af4[_0x8b68('0x1c')](_0xaa8725);}return _0x2f3af4['status'](_0xaa8725)[_0x8b68('0x1d')]();};}function respondWithResult(_0x509033,_0x5e3c66){_0x5e3c66=_0x5e3c66||0xc8;return function(_0x22f75b){if(_0x22f75b){return _0x509033[_0x8b68('0x1e')](_0x5e3c66)[_0x8b68('0x1f')](_0x22f75b);}};}function respondWithFilteredResult(_0x5d3468,_0x5c8d0e){return function(_0x23bd52){if(_0x23bd52){var _0x5c1e44=typeof _0x5c8d0e[_0x8b68('0x20')]===_0x8b68('0x21')&&typeof _0x5c8d0e[_0x8b68('0x22')]===_0x8b68('0x21');var _0x491695=_0x23bd52[_0x8b68('0x23')];var _0x203dd4=_0x5c1e44?0x0:_0x5c8d0e['offset'];var _0x42b3bd=_0x5c1e44?_0x23bd52[_0x8b68('0x23')]:_0x5c8d0e[_0x8b68('0x20')]+_0x5c8d0e[_0x8b68('0x22')];var _0x38b7a7;if(_0x42b3bd>=_0x491695){_0x42b3bd=_0x491695;_0x38b7a7=0xc8;}else{_0x38b7a7=0xce;}_0x5d3468['status'](_0x38b7a7);return _0x5d3468[_0x8b68('0x24')](_0x8b68('0x25'),_0x203dd4+'-'+_0x42b3bd+'/'+_0x491695)[_0x8b68('0x1f')](_0x23bd52);}return null;};}function patchUpdates(_0x1a9788){return function(_0x35d055){try{jsonpatch[_0x8b68('0x26')](_0x35d055,_0x1a9788,!![]);}catch(_0x5603d4){return BPromise['reject'](_0x5603d4);}return _0x35d055[_0x8b68('0x27')]();};}function saveUpdates(_0x59cb26,_0x332202){return function(_0x30b6d0){if(_0x30b6d0){return _0x30b6d0[_0x8b68('0x28')](_0x59cb26)[_0x8b68('0x29')](function(_0x32ddc5){return _0x32ddc5;});}return null;};}function removeEntity(_0x173524,_0x59bb8a){return function(_0x1a6fe8){if(_0x1a6fe8){return _0x1a6fe8[_0x8b68('0x2a')]()['then'](function(){_0x173524[_0x8b68('0x1e')](0xcc)[_0x8b68('0x1d')]();});}};}function handleEntityNotFound(_0x240b0b,_0x5590ec){return function(_0x511ccf){if(!_0x511ccf){_0x240b0b['sendStatus'](0x194);}return _0x511ccf;};}function handleError(_0x92d186,_0x448e43){_0x448e43=_0x448e43||0x1f4;return function(_0x2ba2a3){logger['error'](_0x2ba2a3[_0x8b68('0x2b')]);if(_0x2ba2a3['name']){delete _0x2ba2a3['name'];}_0x92d186[_0x8b68('0x1e')](_0x448e43)['send'](_0x2ba2a3);};}exports[_0x8b68('0x2c')]=function(_0x3ac356,_0x48e2c8){var _0x494ce4={},_0x357635={},_0x1cd230={'count':0x0,'rows':[]};var _0x1e7c06=_[_0x8b68('0x2d')](db[_0x8b68('0x2e')][_0x8b68('0x2f')],function(_0x460c37){return{'name':_0x460c37['fieldName'],'type':_0x460c37[_0x8b68('0x30')]['key']};});_0x357635[_0x8b68('0x31')]=_[_0x8b68('0x2d')](_0x1e7c06,'name');_0x357635[_0x8b68('0x32')]=_[_0x8b68('0x33')](_0x3ac356[_0x8b68('0x32')]);_0x357635['filters']=_['intersection'](_0x357635[_0x8b68('0x31')],_0x357635[_0x8b68('0x32')]);_0x494ce4[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x357635[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x36')]));_0x494ce4[_0x8b68('0x34')]=_0x494ce4[_0x8b68('0x34')][_0x8b68('0x37')]?_0x494ce4[_0x8b68('0x34')]:_0x357635[_0x8b68('0x31')];if(!_0x3ac356[_0x8b68('0x32')][_0x8b68('0x38')](_0x8b68('0x39'))){_0x494ce4[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x22')]);_0x494ce4[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x3ac356['query']['offset']);}_0x494ce4[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x494ce4[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x3ac356[_0x8b68('0x32')],_0x357635['filters']),_0x1e7c06);if(_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x494ce4[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x494ce4[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x1e7c06,function(_0xff4080){if(_0xff4080[_0x8b68('0x30')]!=='VIRTUAL'){var _0x3f874c={};_0x3f874c[_0xff4080[_0x8b68('0x41')]]={'$like':'%'+_0x3ac356[_0x8b68('0x32')][_0x8b68('0x3f')]+'%'};return _0x3f874c;}})});}_0x494ce4=_[_0x8b68('0x40')]({},_0x494ce4,_0x3ac356[_0x8b68('0x42')]);var _0xa748c2={'where':_0x494ce4['where']};return db[_0x8b68('0x2e')][_0x8b68('0x23')](_0xa748c2)['then'](function(_0x14ec40){_0x1cd230[_0x8b68('0x23')]=_0x14ec40;if(_0x3ac356['query']['includeAll']){_0x494ce4['include']=[{'all':!![]}];}return db['ZendeskAccount'][_0x8b68('0x43')](_0x494ce4);})[_0x8b68('0x29')](function(_0x515815){_0x1cd230[_0x8b68('0x44')]=_0x515815;return _0x1cd230;})['then'](respondWithFilteredResult(_0x48e2c8,_0x494ce4))[_0x8b68('0x45')](handleError(_0x48e2c8,null));};exports[_0x8b68('0x46')]=function(_0x5a3193,_0x2f90d9){var _0x5ae345={'raw':![],'where':{'id':_0x5a3193['params']['id']}},_0x4a718c={};_0x4a718c[_0x8b68('0x31')]=_[_0x8b68('0x33')](db[_0x8b68('0x2e')][_0x8b68('0x2f')]);_0x4a718c['query']=_[_0x8b68('0x33')](_0x5a3193['query']);_0x4a718c[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x4a718c['model'],_0x4a718c[_0x8b68('0x32')]);_0x5ae345[_0x8b68('0x34')]=_[_0x8b68('0x35')](_0x4a718c[_0x8b68('0x31')],qs['fields'](_0x5a3193[_0x8b68('0x32')][_0x8b68('0x36')]));_0x5ae345[_0x8b68('0x34')]=_0x5ae345[_0x8b68('0x34')][_0x8b68('0x37')]?_0x5ae345[_0x8b68('0x34')]:_0x4a718c[_0x8b68('0x31')];if(_0x5a3193[_0x8b68('0x32')][_0x8b68('0x47')]){_0x5ae345[_0x8b68('0x48')]=[{'all':!![]}];}_0x5ae345=_[_0x8b68('0x40')]({},_0x5ae345,_0x5a3193[_0x8b68('0x42')]);return db[_0x8b68('0x2e')][_0x8b68('0x49')](_0x5ae345)[_0x8b68('0x29')](handleEntityNotFound(_0x2f90d9,null))[_0x8b68('0x29')](respondWithResult(_0x2f90d9,null))['catch'](handleError(_0x2f90d9,null));};exports[_0x8b68('0x4a')]=function(_0x20681a,_0x5dd099){return db[_0x8b68('0x2e')]['create'](_0x20681a['body'],{})['then'](respondWithResult(_0x5dd099,0xc9))[_0x8b68('0x45')](handleError(_0x5dd099,null));};exports[_0x8b68('0x28')]=function(_0x34047c,_0x6da48b){if(_0x34047c['body']['id']){delete _0x34047c['body']['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x49')]({'where':{'id':_0x34047c[_0x8b68('0x4b')]['id']}})['then'](handleEntityNotFound(_0x6da48b,null))[_0x8b68('0x29')](saveUpdates(_0x34047c[_0x8b68('0x4c')],null))['then'](respondWithResult(_0x6da48b,null))[_0x8b68('0x45')](handleError(_0x6da48b,null));};exports[_0x8b68('0x2a')]=function(_0x595942,_0x18a9ae){return db[_0x8b68('0x2e')]['find']({'where':{'id':_0x595942[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x18a9ae,null))['then'](removeEntity(_0x18a9ae,null))['catch'](handleError(_0x18a9ae,null));};exports['getConfigurations']=function(_0x28f82d,_0x42eabd,_0x3718b2){var _0x3d4b4f={};var _0x55aad3={};var _0x5a1711;var _0x4492fd;return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x28f82d['params']['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x42eabd,null))[_0x8b68('0x29')](function(_0x3f9d34){if(_0x3f9d34){_0x5a1711=_0x3f9d34;_0x55aad3['model']=_[_0x8b68('0x33')](db['ZendeskConfiguration'][_0x8b68('0x2f')]);_0x55aad3[_0x8b68('0x32')]=_['keys'](_0x28f82d[_0x8b68('0x32')]);_0x55aad3[_0x8b68('0x3d')]=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],_0x55aad3[_0x8b68('0x32')]);_0x3d4b4f['attributes']=_[_0x8b68('0x35')](_0x55aad3[_0x8b68('0x31')],qs[_0x8b68('0x36')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x36')]));_0x3d4b4f[_0x8b68('0x34')]=_0x3d4b4f[_0x8b68('0x34')][_0x8b68('0x37')]?_0x3d4b4f['attributes']:_0x55aad3[_0x8b68('0x31')];_0x3d4b4f[_0x8b68('0x3a')]=qs[_0x8b68('0x3b')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3b')]);_0x3d4b4f[_0x8b68('0x3c')]=qs[_0x8b68('0x3d')](_[_0x8b68('0x3e')](_0x28f82d[_0x8b68('0x32')],_0x55aad3[_0x8b68('0x3d')]));if(_0x28f82d[_0x8b68('0x32')][_0x8b68('0x3f')]){_0x3d4b4f[_0x8b68('0x3c')]=_[_0x8b68('0x40')](_0x3d4b4f[_0x8b68('0x3c')],{'$or':_[_0x8b68('0x2d')](_0x3d4b4f[_0x8b68('0x34')],function(_0x3da7b4){var _0xae90f0={};_0xae90f0[_0x3da7b4]={'$like':'%'+_0x28f82d[_0x8b68('0x32')]['filter']+'%'};return _0xae90f0;})});}_0x3d4b4f=_[_0x8b68('0x40')]({},_0x3d4b4f,_0x28f82d['options']);return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x5d2476){if(_0x5d2476){_0x4492fd=_0x5d2476[_0x8b68('0x37')];if(!_0x28f82d[_0x8b68('0x32')][_0x8b68('0x38')]('nolimit')){_0x3d4b4f[_0x8b68('0x22')]=qs[_0x8b68('0x22')](_0x28f82d[_0x8b68('0x32')][_0x8b68('0x22')]);_0x3d4b4f[_0x8b68('0x20')]=qs[_0x8b68('0x20')](_0x28f82d[_0x8b68('0x32')]['offset']);}return _0x5a1711['getConfigurations'](_0x3d4b4f);}})[_0x8b68('0x29')](function(_0x4224f5){if(_0x4224f5){return _0x4224f5?{'count':_0x4492fd,'rows':_0x4224f5}:null;}})[_0x8b68('0x29')](respondWithResult(_0x42eabd,null))[_0x8b68('0x45')](handleError(_0x42eabd,null));};exports[_0x8b68('0x4e')]=function(_0x37da34,_0x2d1519,_0x314f1e){if(_0x37da34[_0x8b68('0x4c')]['id']){delete _0x37da34[_0x8b68('0x4c')]['id'];}return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x37da34[_0x8b68('0x4b')]['id']}})[_0x8b68('0x29')](handleEntityNotFound(_0x2d1519,null))[_0x8b68('0x29')](function(_0x414096){if(_0x414096){_0x37da34[_0x8b68('0x4c')][_0x8b68('0x4f')]=_0x414096['id'];_0x37da34['body']['Subjects']=integrations[_0x8b68('0x50')](_0x37da34[_0x8b68('0x4c')]['channel'],_0x37da34['body']['type']);_0x37da34[_0x8b68('0x4c')][_0x8b68('0x51')]=integrations[_0x8b68('0x52')](_0x37da34[_0x8b68('0x4c')][_0x8b68('0x53')],_0x37da34['body'][_0x8b68('0x30')]);return db[_0x8b68('0x54')]['create'](_0x37da34[_0x8b68('0x4c')],{'include':[{'model':db['ZendeskField'],'as':'Subjects'},{'model':db['ZendeskField'],'as':_0x8b68('0x51')}]});}return null;})[_0x8b68('0x29')](respondWithResult(_0x2d1519,null))[_0x8b68('0x45')](handleError(_0x2d1519,null));};exports[_0x8b68('0x55')]=function(_0x864b6b,_0x1fc24c,_0x35b22b){var _0x34456d='';return db[_0x8b68('0x2e')][_0x8b68('0x4d')]({'where':{'id':_0x864b6b['params']['id']},'attributes':['id',_0x8b68('0x56'),_0x8b68('0x57'),_0x8b68('0x58'),'authType','remoteUri']})[_0x8b68('0x29')](handleEntityNotFound(_0x1fc24c,null))[_0x8b68('0x29')](function(_0x525b41){if(_0x525b41){_0x34456d=_0x525b41[_0x8b68('0x59')];var _0x2c1c96=_0x34456d[_0x8b68('0x5a')](-0x1);if(_0x2c1c96==='/'){_0x34456d=_0x34456d[_0x8b68('0x5b')](0x0,_0x34456d['lastIndexOf'](_0x2c1c96));}var _0x96e526={'method':'GET','uri':util['format'](_0x8b68('0x5c'),_0x34456d,'ticket_fields'),'json':!![]};switch(_0x525b41[_0x8b68('0x5d')]){case _0x8b68('0x57'):_0x96e526['headers']={'Authorization':util[_0x8b68('0x5e')](_0x8b68('0x5f'),new Buffer(util[_0x8b68('0x5e')](_0x8b68('0x60'),_0x525b41[_0x8b68('0x56')],_0x525b41['password']))[_0x8b68('0x61')](_0x8b68('0x62')))};break;case _0x8b68('0x58'):_0x96e526[_0x8b68('0x63')]={'Authorization':util[_0x8b68('0x5e')]('Basic\x20%s',new Buffer(util['format'](_0x8b68('0x64'),_0x525b41['username'],_0x525b41[_0x8b68('0x58')]))[_0x8b68('0x61')](_0x8b68('0x62')))};break;default:throw new db[(_0x8b68('0x65'))][(_0x8b68('0x66'))](_0x8b68('0x67'));}return rp(_0x96e526);}})[_0x8b68('0x29')](function(_0x486be8){if(_0x486be8){var _0x3033b4=['subject',_0x8b68('0x68'),_0x8b68('0x69'),_0x8b68('0x6a')];_['remove'](_0x486be8[_0x8b68('0x6b')],function(_0x50d0b9){return _0x3033b4[_0x8b68('0x6c')](_0x50d0b9['type']);});return{'count':_0x486be8[_0x8b68('0x6b')][_0x8b68('0x37')],'rows':_[_0x8b68('0x2d')](_0x486be8['ticket_fields'],function(_0x33b775){return{'id':_0x33b775['id'],'name':_0x33b775[_0x8b68('0x6d')]>0x7?_0x33b775[_0x8b68('0x6e')]:_0x33b775[_0x8b68('0x30')],'custom':_0x33b775[_0x8b68('0x6d')]>0x7?!![]:![],'options':_0x33b775[_0x8b68('0x6f')]?_0x33b775[_0x8b68('0x6f')]:_0x33b775[_0x8b68('0x70')]?_0x33b775[_0x8b68('0x70')]:[]};})};}})['then'](respondWithResult(_0x1fc24c,null))[_0x8b68('0x45')](function(_0x3cb970){var _0x9a5bec=_0x864b6b[_0x8b68('0x32')][_0x8b68('0x71')]?0x1f4:_0x3cb970['statusCode']||0x1f4;logger[_0x8b68('0x72')]('getFields,\x20%s,\x20%s,\x20%s',_0x8b68('0x55'),_0x9a5bec,JSON[_0x8b68('0x73')](_0x3cb970));delete _0x3cb970['name'];if(_0x9a5bec===0x191){_0x9a5bec=0x190;}_0x1fc24c[_0x8b68('0x1e')](_0x9a5bec)[_0x8b68('0x74')](_0x864b6b[_0x8b68('0x32')]['test']?{'message':_0x8b68('0x75'),'statusCode':_0x3cb970[_0x8b68('0x76')]}:_0x3cb970);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 1f64a80..feec7ca 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 _0xc61b=['../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intZendeskAccount.attributes','exports','define','int_zendesk_accounts','lodash','util'];(function(_0x5b740d,_0x89abbe){var _0x46b17c=function(_0x1f763b){while(--_0x1f763b){_0x5b740d['push'](_0x5b740d['shift']());}};_0x46b17c(++_0x89abbe);}(_0xc61b,0x18a));var _0xbc61=function(_0x188ad1,_0x12f423){_0x188ad1=_0x188ad1-0x0;var _0x25f272=_0xc61b[_0x188ad1];return _0x25f272;};'use strict';var _=require(_0xbc61('0x0'));var util=require(_0xbc61('0x1'));var logger=require(_0xbc61('0x2'))(_0xbc61('0x3'));var moment=require('moment');var BPromise=require(_0xbc61('0x4'));var rp=require(_0xbc61('0x5'));var fs=require('fs');var path=require(_0xbc61('0x6'));var rimraf=require('rimraf');var config=require(_0xbc61('0x7'));var attributes=require(_0xbc61('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xbc61('0x9')]=function(_0x12f545,_0x239e76){return _0x12f545[_0xbc61('0xa')]('ZendeskAccount',attributes,{'tableName':_0xbc61('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa35=['./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','int_zendesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0xfa35,0x148));var _0x5fa3=function(_0x27062d,_0x24b179){_0x27062d=_0x27062d-0x0;var _0x4f1478=_0xfa35[_0x27062d];return _0x4f1478;};'use strict';var _=require(_0x5fa3('0x0'));var util=require('util');var logger=require(_0x5fa3('0x1'))(_0x5fa3('0x2'));var moment=require(_0x5fa3('0x3'));var BPromise=require(_0x5fa3('0x4'));var rp=require(_0x5fa3('0x5'));var fs=require('fs');var path=require(_0x5fa3('0x6'));var rimraf=require('rimraf');var config=require(_0x5fa3('0x7'));var attributes=require(_0x5fa3('0x8'));var integrations=require(_0x5fa3('0x9'));module[_0x5fa3('0xa')]=function(_0x4e8cba,_0x250976){return _0x4e8cba[_0x5fa3('0xb')](_0x5fa3('0xc'),attributes,{'tableName':_0x5fa3('0xd'),'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 910f96c..b9dd3a9 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 _0x5c89=['findAll','options','where','attributes','limit','map','include','model','stringify','find','raw','ShowZendeskAccount','lodash','util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x5c89,0x182));var _0x95c8=function(_0x4fbdf4,_0x2719b1){_0x4fbdf4=_0x4fbdf4-0x0;var _0x186fce=_0x5c89[_0x4fbdf4];return _0x186fce;};'use strict';var _=require(_0x95c8('0x0'));var util=require(_0x95c8('0x1'));var moment=require(_0x95c8('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(_0x95c8('0x3'));var logger=require('../../config/logger')(_0x95c8('0x4'));var config=require(_0x95c8('0x5'));var jayson=require(_0x95c8('0x6'));var client=jayson[_0x95c8('0x7')][_0x95c8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1ca32b,_0x2dd1d5,_0x29682a){return new BPromise(function(_0x17b7d2,_0x10666f){return client['request'](_0x1ca32b,_0x29682a)[_0x95c8('0x9')](function(_0x4791f5){logger[_0x95c8('0xa')](_0x95c8('0xb'),_0x2dd1d5,_0x95c8('0xc'));logger[_0x95c8('0xd')](_0x95c8('0xe'),_0x2dd1d5,_0x95c8('0xc'),JSON['stringify'](_0x4791f5));if(_0x4791f5[_0x95c8('0xf')]){if(_0x4791f5['error'][_0x95c8('0x10')]===0x1f4){logger[_0x95c8('0xf')](_0x95c8('0xb'),_0x2dd1d5,_0x4791f5['error'][_0x95c8('0x11')]);return _0x10666f(_0x4791f5['error']['message']);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x2dd1d5,_0x4791f5[_0x95c8('0xf')]['message']);return _0x17b7d2(_0x4791f5['error']['message']);}else{logger[_0x95c8('0xa')](_0x95c8('0xb'),_0x2dd1d5,'request\x20sent');_0x17b7d2(_0x4791f5[_0x95c8('0x12')][_0x95c8('0x11')]);}})[_0x95c8('0x13')](function(_0x4c28ce){logger[_0x95c8('0xf')]('ZendeskAccount,\x20%s,\x20%s',_0x2dd1d5,_0x4c28ce);_0x10666f(_0x4c28ce);});});}exports[_0x95c8('0x14')]=function(_0x18f73c){var _0x251d83=this;return new Promise(function(_0xba6055,_0xca951c){return db[_0x95c8('0x15')][_0x95c8('0x16')]({'raw':_0x18f73c[_0x95c8('0x17')]?_0x18f73c[_0x95c8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x18f73c[_0x95c8('0x17')]?_0x18f73c['options'][_0x95c8('0x18')]||null:null,'attributes':_0x18f73c[_0x95c8('0x17')]?_0x18f73c['options'][_0x95c8('0x19')]||null:null,'limit':_0x18f73c[_0x95c8('0x17')]?_0x18f73c[_0x95c8('0x17')][_0x95c8('0x1a')]||null:null,'include':_0x18f73c['options']?_0x18f73c[_0x95c8('0x17')]['include']?_[_0x95c8('0x1b')](_0x18f73c[_0x95c8('0x17')][_0x95c8('0x1c')],function(_0x4e3275){return{'model':db[_0x4e3275[_0x95c8('0x1d')]],'as':_0x4e3275['as'],'attributes':_0x4e3275[_0x95c8('0x19')],'include':_0x4e3275['include']?_[_0x95c8('0x1b')](_0x4e3275[_0x95c8('0x1c')],function(_0xdbc64b){return{'model':db[_0xdbc64b[_0x95c8('0x1d')]],'as':_0xdbc64b['as'],'attributes':_0xdbc64b['attributes'],'include':_0xdbc64b[_0x95c8('0x1c')]?_[_0x95c8('0x1b')](_0xdbc64b[_0x95c8('0x1c')],function(_0x58aec9){return{'model':db[_0x58aec9[_0x95c8('0x1d')]],'as':_0x58aec9['as'],'attributes':_0x58aec9[_0x95c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x95c8('0x9')](function(_0x556ec6){logger[_0x95c8('0xa')](_0x95c8('0x14'),_0x18f73c);logger[_0x95c8('0xd')]('GetZendeskAccount',_0x18f73c,JSON[_0x95c8('0x1e')](_0x556ec6));_0xba6055(_0x556ec6);})['catch'](function(_0x1b45a5){logger[_0x95c8('0xf')](_0x95c8('0x14'),_0x1b45a5[_0x95c8('0x11')],_0x18f73c);_0xca951c(_0x251d83[_0x95c8('0xf')](0x1f4,_0x1b45a5[_0x95c8('0x11')]));});});};exports['ShowZendeskAccount']=function(_0x369f2a){var _0x870066=this;return new Promise(function(_0x311ca9,_0x220cf2){return db['ZendeskAccount'][_0x95c8('0x1f')]({'raw':_0x369f2a['options']?_0x369f2a['options'][_0x95c8('0x20')]===undefined?!![]:![]:!![],'where':_0x369f2a[_0x95c8('0x17')]?_0x369f2a[_0x95c8('0x17')][_0x95c8('0x18')]||null:null,'attributes':_0x369f2a[_0x95c8('0x17')]?_0x369f2a[_0x95c8('0x17')][_0x95c8('0x19')]||null:null,'include':_0x369f2a['options']?_0x369f2a[_0x95c8('0x17')][_0x95c8('0x1c')]?_[_0x95c8('0x1b')](_0x369f2a[_0x95c8('0x17')][_0x95c8('0x1c')],function(_0x2e658b){return{'model':db[_0x2e658b[_0x95c8('0x1d')]],'as':_0x2e658b['as'],'attributes':_0x2e658b[_0x95c8('0x19')],'include':_0x2e658b['include']?_[_0x95c8('0x1b')](_0x2e658b['include'],function(_0x25dec8){return{'model':db[_0x25dec8[_0x95c8('0x1d')]],'as':_0x25dec8['as'],'attributes':_0x25dec8[_0x95c8('0x19')],'include':_0x25dec8[_0x95c8('0x1c')]?_[_0x95c8('0x1b')](_0x25dec8['include'],function(_0x55e366){return{'model':db[_0x55e366[_0x95c8('0x1d')]],'as':_0x55e366['as'],'attributes':_0x55e366[_0x95c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x95c8('0x9')](function(_0x10a757){logger[_0x95c8('0xa')](_0x95c8('0x21'),_0x369f2a);logger[_0x95c8('0xd')](_0x95c8('0x21'),_0x369f2a,JSON[_0x95c8('0x1e')](_0x10a757));_0x311ca9(_0x10a757);})[_0x95c8('0x13')](function(_0x5d6ae1){logger['error'](_0x95c8('0x21'),_0x5d6ae1[_0x95c8('0x11')],_0x369f2a);_0x220cf2(_0x870066[_0x95c8('0xf')](0x1f4,_0x5d6ae1[_0x95c8('0x11')]));});});}; \ No newline at end of file +var _0x8e7c=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','GetZendeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZendeskAccount','ZendeskAccount','find','lodash','util','moment','bluebird'];(function(_0x339ecb,_0xeda4a0){var _0x5966f6=function(_0x2022c4){while(--_0x2022c4){_0x339ecb['push'](_0x339ecb['shift']());}};_0x5966f6(++_0xeda4a0);}(_0x8e7c,0x90));var _0xc8e7=function(_0x2cee3f,_0x182b4a){_0x2cee3f=_0x2cee3f-0x0;var _0x491296=_0x8e7c[_0x2cee3f];return _0x491296;};'use strict';var _=require(_0xc8e7('0x0'));var util=require(_0xc8e7('0x1'));var moment=require(_0xc8e7('0x2'));var BPromise=require(_0xc8e7('0x3'));var rs=require(_0xc8e7('0x4'));var fs=require('fs');var Redis=require(_0xc8e7('0x5'));var db=require(_0xc8e7('0x6'))['db'];var utils=require(_0xc8e7('0x7'));var logger=require('../../config/logger')(_0xc8e7('0x8'));var config=require(_0xc8e7('0x9'));var jayson=require(_0xc8e7('0xa'));var client=jayson[_0xc8e7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2ce0e9,_0x2029b5,_0x3f4ebb){return new BPromise(function(_0x1d26e8,_0x4d0946){return client[_0xc8e7('0xc')](_0x2ce0e9,_0x3f4ebb)[_0xc8e7('0xd')](function(_0x428989){logger['info'](_0xc8e7('0xe'),_0x2029b5,_0xc8e7('0xf'));logger[_0xc8e7('0x10')](_0xc8e7('0x11'),_0x2029b5,_0xc8e7('0xf'),JSON[_0xc8e7('0x12')](_0x428989));if(_0x428989[_0xc8e7('0x13')]){if(_0x428989['error']['code']===0x1f4){logger[_0xc8e7('0x13')](_0xc8e7('0xe'),_0x2029b5,_0x428989[_0xc8e7('0x13')][_0xc8e7('0x14')]);return _0x4d0946(_0x428989[_0xc8e7('0x13')]['message']);}logger[_0xc8e7('0x13')](_0xc8e7('0xe'),_0x2029b5,_0x428989[_0xc8e7('0x13')][_0xc8e7('0x14')]);return _0x1d26e8(_0x428989[_0xc8e7('0x13')]['message']);}else{logger[_0xc8e7('0x15')](_0xc8e7('0xe'),_0x2029b5,_0xc8e7('0xf'));_0x1d26e8(_0x428989[_0xc8e7('0x16')][_0xc8e7('0x14')]);}})[_0xc8e7('0x17')](function(_0x1a5707){logger[_0xc8e7('0x13')](_0xc8e7('0xe'),_0x2029b5,_0x1a5707);_0x4d0946(_0x1a5707);});});}exports[_0xc8e7('0x18')]=function(_0x3cba0b){var _0x5d5d62=this;return new Promise(function(_0x119fda,_0x214f6d){return db['ZendeskAccount'][_0xc8e7('0x19')]({'raw':_0x3cba0b[_0xc8e7('0x1a')]?_0x3cba0b['options'][_0xc8e7('0x1b')]===undefined?!![]:![]:!![],'where':_0x3cba0b[_0xc8e7('0x1a')]?_0x3cba0b['options'][_0xc8e7('0x1c')]||null:null,'attributes':_0x3cba0b[_0xc8e7('0x1a')]?_0x3cba0b['options'][_0xc8e7('0x1d')]||null:null,'limit':_0x3cba0b['options']?_0x3cba0b[_0xc8e7('0x1a')][_0xc8e7('0x1e')]||null:null,'include':_0x3cba0b['options']?_0x3cba0b[_0xc8e7('0x1a')][_0xc8e7('0x1f')]?_['map'](_0x3cba0b['options'][_0xc8e7('0x1f')],function(_0x31272a){return{'model':db[_0x31272a['model']],'as':_0x31272a['as'],'attributes':_0x31272a['attributes'],'include':_0x31272a[_0xc8e7('0x1f')]?_[_0xc8e7('0x20')](_0x31272a[_0xc8e7('0x1f')],function(_0xbd1a3b){return{'model':db[_0xbd1a3b[_0xc8e7('0x21')]],'as':_0xbd1a3b['as'],'attributes':_0xbd1a3b['attributes'],'include':_0xbd1a3b[_0xc8e7('0x1f')]?_[_0xc8e7('0x20')](_0xbd1a3b[_0xc8e7('0x1f')],function(_0x33f1f4){return{'model':db[_0x33f1f4['model']],'as':_0x33f1f4['as'],'attributes':_0x33f1f4[_0xc8e7('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xc8e7('0xd')](function(_0x32d3a0){logger[_0xc8e7('0x15')](_0xc8e7('0x18'),_0x3cba0b);logger['debug'](_0xc8e7('0x18'),_0x3cba0b,JSON[_0xc8e7('0x12')](_0x32d3a0));_0x119fda(_0x32d3a0);})[_0xc8e7('0x17')](function(_0x54d67f){logger[_0xc8e7('0x13')](_0xc8e7('0x18'),_0x54d67f[_0xc8e7('0x14')],_0x3cba0b);_0x214f6d(_0x5d5d62['error'](0x1f4,_0x54d67f['message']));});});};exports[_0xc8e7('0x22')]=function(_0x55b8de){var _0x323de6=this;return new Promise(function(_0x54983a,_0x4962a0){return db[_0xc8e7('0x23')][_0xc8e7('0x24')]({'raw':_0x55b8de['options']?_0x55b8de[_0xc8e7('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x55b8de[_0xc8e7('0x1a')]?_0x55b8de[_0xc8e7('0x1a')][_0xc8e7('0x1c')]||null:null,'attributes':_0x55b8de[_0xc8e7('0x1a')]?_0x55b8de[_0xc8e7('0x1a')]['attributes']||null:null,'include':_0x55b8de[_0xc8e7('0x1a')]?_0x55b8de[_0xc8e7('0x1a')][_0xc8e7('0x1f')]?_[_0xc8e7('0x20')](_0x55b8de[_0xc8e7('0x1a')][_0xc8e7('0x1f')],function(_0x4d21f9){return{'model':db[_0x4d21f9['model']],'as':_0x4d21f9['as'],'attributes':_0x4d21f9[_0xc8e7('0x1d')],'include':_0x4d21f9[_0xc8e7('0x1f')]?_[_0xc8e7('0x20')](_0x4d21f9[_0xc8e7('0x1f')],function(_0x3b0f33){return{'model':db[_0x3b0f33['model']],'as':_0x3b0f33['as'],'attributes':_0x3b0f33['attributes'],'include':_0x3b0f33['include']?_[_0xc8e7('0x20')](_0x3b0f33[_0xc8e7('0x1f')],function(_0x26b2f0){return{'model':db[_0x26b2f0['model']],'as':_0x26b2f0['as'],'attributes':_0x26b2f0['attributes']};}):[]};}):[]};}):[]:[]})[_0xc8e7('0xd')](function(_0x175d4a){logger['info'](_0xc8e7('0x22'),_0x55b8de);logger['debug'](_0xc8e7('0x22'),_0x55b8de,JSON[_0xc8e7('0x12')](_0x175d4a));_0x54983a(_0x175d4a);})['catch'](function(_0xf43dad){logger[_0xc8e7('0x13')](_0xc8e7('0x22'),_0xf43dad[_0xc8e7('0x14')],_0x55b8de);_0x4962a0(_0x323de6[_0xc8e7('0x13')](0x1f4,_0xf43dad[_0xc8e7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 96f46c8..a1c2a84 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 _0xb688=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','update','exports','util'];(function(_0x3dc538,_0x4f7702){var _0x72c2fd=function(_0x5a7260){while(--_0x5a7260){_0x3dc538['push'](_0x3dc538['shift']());}};_0x72c2fd(++_0x4f7702);}(_0xb688,0xcf));var _0x8b68=function(_0x4cc917,_0x55cb07){_0x4cc917=_0x4cc917-0x0;var _0x413452=_0xb688[_0x4cc917];return _0x413452;};'use strict';var multer=require('multer');var util=require(_0x8b68('0x0'));var path=require(_0x8b68('0x1'));var timeout=require(_0x8b68('0x2'));var express=require(_0x8b68('0x3'));var router=express[_0x8b68('0x4')]();var fs_extra=require(_0x8b68('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x8b68('0x6'));var config=require(_0x8b68('0x7'));var controller=require(_0x8b68('0x8'));router[_0x8b68('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['get'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xd')]);router[_0x8b68('0x9')](_0x8b68('0xe'),auth[_0x8b68('0xc')](),controller[_0x8b68('0xf')]);router[_0x8b68('0x9')](_0x8b68('0x10'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x11')]);router[_0x8b68('0x9')](_0x8b68('0x12'),auth['isAuthenticated'](),controller[_0x8b68('0x13')]);router[_0x8b68('0x9')](_0x8b68('0x14'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x15')]);router[_0x8b68('0x16')]('/',auth[_0x8b68('0xc')](),controller[_0x8b68('0x17')]);router[_0x8b68('0x16')]('/:id/tags',auth[_0x8b68('0xc')](),controller['setTags']);router['put'](_0x8b68('0xb'),auth[_0x8b68('0xc')](),controller[_0x8b68('0x18')]);router['delete']('/:id',auth[_0x8b68('0xc')](),controller['destroy']);module[_0x8b68('0x19')]=router; \ No newline at end of file +var _0x9ffd=['update','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','create','post','put'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x124b39,_0x123925){_0x124b39=_0x124b39-0x0;var _0x44b70f=_0x9ffd[_0x124b39];return _0x44b70f;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var fs_extra=require(_0xd9ff('0x5'));var auth=require(_0xd9ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd9ff('0x7'));var controller=require(_0xd9ff('0x8'));router['get']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xa')]);router[_0xd9ff('0xb')](_0xd9ff('0xc'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0xd')]);router[_0xd9ff('0xb')](_0xd9ff('0xe'),auth[_0xd9ff('0x9')](),controller['getFields']);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0xb')](_0xd9ff('0x10'),auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x11')]);router[_0xd9ff('0xb')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['getTags']);router['post']('/',auth[_0xd9ff('0x9')](),controller[_0xd9ff('0x13')]);router[_0xd9ff('0x14')](_0xd9ff('0x12'),auth[_0xd9ff('0x9')](),controller['setTags']);router[_0xd9ff('0x15')](_0xd9ff('0xc'),auth['isAuthenticated'](),controller[_0xd9ff('0x16')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd9ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 2c92376..9048928 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 _0x1e95=['sequelize','exports','STRING'];(function(_0x5c4efb,_0x15ffc1){var _0x971dad=function(_0x2bab0e){while(--_0x2bab0e){_0x5c4efb['push'](_0x5c4efb['shift']());}};_0x971dad(++_0x15ffc1);}(_0x1e95,0x66));var _0x51e9=function(_0x11b001,_0x486b8a){_0x11b001=_0x11b001-0x0;var _0x227c87=_0x1e95[_0x11b001];return _0x227c87;};'use strict';var Sequelize=require(_0x51e9('0x0'));module[_0x51e9('0x1')]={'name':{'type':Sequelize[_0x51e9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa7cc=['STRING'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xa7cc,0x11f));var _0xca7c=function(_0x368234,_0x3da10a){_0x368234=_0x368234-0x0;var _0x374fa6=_0xa7cc[_0x368234];return _0x374fa6;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xca7c('0x0')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 2612c2b..8ac1868 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 _0x7545=['index','ZendeskConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','getFields','findOne','ZendeskField','getSubjects','getDescriptions','getTags','Tag','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send'];(function(_0x15d3a3,_0x198203){var _0x3a0ee9=function(_0x559818){while(--_0x559818){_0x15d3a3['push'](_0x15d3a3['shift']());}};_0x3a0ee9(++_0x198203);}(_0x7545,0x132));var _0x5754=function(_0x54c107,_0xd7ffea){_0x54c107=_0x54c107-0x0;var _0x591d0c=_0x7545[_0x54c107];return _0x591d0c;};'use strict';var emlformat=require(_0x5754('0x0'));var rimraf=require(_0x5754('0x1'));var zipdir=require(_0x5754('0x2'));var jsonpatch=require(_0x5754('0x3'));var rp=require(_0x5754('0x4'));var moment=require(_0x5754('0x5'));var BPromise=require(_0x5754('0x6'));var Mustache=require(_0x5754('0x7'));var util=require('util');var path=require('path');var sox=require(_0x5754('0x8'));var csv=require(_0x5754('0x9'));var ejs=require(_0x5754('0xa'));var fs=require('fs');var fs_extra=require(_0x5754('0xb'));var _=require(_0x5754('0xc'));var squel=require(_0x5754('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5754('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5754('0xf'));var Papa=require(_0x5754('0x10'));var Redis=require(_0x5754('0x11'));var authService=require(_0x5754('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5754('0x13'));var hardwareService=require(_0x5754('0x14'));var logger=require(_0x5754('0x15'))(_0x5754('0x16'));var utils=require(_0x5754('0x17'));var config=require(_0x5754('0x18'));var licenseUtil=require(_0x5754('0x19'));var db=require(_0x5754('0x1a'))['db'];function respondWithStatusCode(_0x216fd3,_0x4835dc){_0x4835dc=_0x4835dc||0xcc;return function(_0x426dc3){if(_0x426dc3){return _0x216fd3['sendStatus'](_0x4835dc);}return _0x216fd3[_0x5754('0x1b')](_0x4835dc)[_0x5754('0x1c')]();};}function respondWithResult(_0x42debd,_0xdb08ac){_0xdb08ac=_0xdb08ac||0xc8;return function(_0x2733c9){if(_0x2733c9){return _0x42debd['status'](_0xdb08ac)[_0x5754('0x1d')](_0x2733c9);}};}function respondWithFilteredResult(_0x34d98a,_0x31ca99){return function(_0x1bab98){if(_0x1bab98){var _0x32862f=typeof _0x31ca99[_0x5754('0x1e')]==='undefined'&&typeof _0x31ca99[_0x5754('0x1f')]===_0x5754('0x20');var _0x432548=_0x1bab98['count'];var _0x55d5bc=_0x32862f?0x0:_0x31ca99['offset'];var _0x41f0d2=_0x32862f?_0x1bab98['count']:_0x31ca99[_0x5754('0x1e')]+_0x31ca99[_0x5754('0x1f')];var _0x2a70f0;if(_0x41f0d2>=_0x432548){_0x41f0d2=_0x432548;_0x2a70f0=0xc8;}else{_0x2a70f0=0xce;}_0x34d98a[_0x5754('0x1b')](_0x2a70f0);return _0x34d98a[_0x5754('0x21')](_0x5754('0x22'),_0x55d5bc+'-'+_0x41f0d2+'/'+_0x432548)[_0x5754('0x1d')](_0x1bab98);}return null;};}function patchUpdates(_0x35b5fc){return function(_0x5020b5){try{jsonpatch[_0x5754('0x23')](_0x5020b5,_0x35b5fc,!![]);}catch(_0x4067c8){return BPromise[_0x5754('0x24')](_0x4067c8);}return _0x5020b5[_0x5754('0x25')]();};}function saveUpdates(_0x52b1e0,_0x357c3c){return function(_0x2fd409){if(_0x2fd409){return _0x2fd409[_0x5754('0x26')](_0x52b1e0)[_0x5754('0x27')](function(_0x5ec346){return _0x5ec346;});}return null;};}function removeEntity(_0x43d4ce,_0x1434b8){return function(_0x583e46){if(_0x583e46){return _0x583e46[_0x5754('0x28')]()[_0x5754('0x27')](function(){_0x43d4ce['status'](0xcc)[_0x5754('0x1c')]();});}};}function handleEntityNotFound(_0x5ba001,_0x237795){return function(_0x447075){if(!_0x447075){_0x5ba001[_0x5754('0x29')](0x194);}return _0x447075;};}function handleError(_0x5054cf,_0x5a4dac){_0x5a4dac=_0x5a4dac||0x1f4;return function(_0x3bd0f1){logger[_0x5754('0x2a')](_0x3bd0f1[_0x5754('0x2b')]);if(_0x3bd0f1[_0x5754('0x2c')]){delete _0x3bd0f1['name'];}_0x5054cf[_0x5754('0x1b')](_0x5a4dac)[_0x5754('0x2d')](_0x3bd0f1);};}exports[_0x5754('0x2e')]=function(_0x51df0e,_0x164940){var _0x8a5d42={},_0x1f1212={},_0x46a7ed={'count':0x0,'rows':[]};var _0x404bf1=_['map'](db[_0x5754('0x2f')][_0x5754('0x30')],function(_0x3d908e){return{'name':_0x3d908e[_0x5754('0x31')],'type':_0x3d908e['type'][_0x5754('0x32')]};});_0x1f1212[_0x5754('0x33')]=_[_0x5754('0x34')](_0x404bf1,_0x5754('0x2c'));_0x1f1212[_0x5754('0x35')]=_[_0x5754('0x36')](_0x51df0e[_0x5754('0x35')]);_0x1f1212[_0x5754('0x37')]=_[_0x5754('0x38')](_0x1f1212['model'],_0x1f1212[_0x5754('0x35')]);_0x8a5d42[_0x5754('0x39')]=_[_0x5754('0x38')](_0x1f1212['model'],qs['fields'](_0x51df0e[_0x5754('0x35')][_0x5754('0x3a')]));_0x8a5d42[_0x5754('0x39')]=_0x8a5d42['attributes'][_0x5754('0x3b')]?_0x8a5d42[_0x5754('0x39')]:_0x1f1212[_0x5754('0x33')];if(!_0x51df0e[_0x5754('0x35')][_0x5754('0x3c')](_0x5754('0x3d'))){_0x8a5d42['limit']=qs[_0x5754('0x1f')](_0x51df0e[_0x5754('0x35')]['limit']);_0x8a5d42[_0x5754('0x1e')]=qs[_0x5754('0x1e')](_0x51df0e[_0x5754('0x35')][_0x5754('0x1e')]);}_0x8a5d42[_0x5754('0x3e')]=qs[_0x5754('0x3f')](_0x51df0e[_0x5754('0x35')]['sort']);_0x8a5d42[_0x5754('0x40')]=qs[_0x5754('0x37')](_[_0x5754('0x41')](_0x51df0e['query'],_0x1f1212[_0x5754('0x37')]),_0x404bf1);if(_0x51df0e['query']['filter']){_0x8a5d42['where']=_[_0x5754('0x42')](_0x8a5d42[_0x5754('0x40')],{'$or':_[_0x5754('0x34')](_0x404bf1,function(_0x2588f6){if(_0x2588f6[_0x5754('0x43')]!==_0x5754('0x44')){var _0x44da7c={};_0x44da7c[_0x2588f6[_0x5754('0x2c')]]={'$like':'%'+_0x51df0e['query'][_0x5754('0x45')]+'%'};return _0x44da7c;}})});}_0x8a5d42=_[_0x5754('0x42')]({},_0x8a5d42,_0x51df0e[_0x5754('0x46')]);var _0x152bf4={'where':_0x8a5d42[_0x5754('0x40')]};return db[_0x5754('0x2f')][_0x5754('0x47')](_0x152bf4)[_0x5754('0x27')](function(_0x1b5eaa){_0x46a7ed[_0x5754('0x47')]=_0x1b5eaa;if(_0x51df0e[_0x5754('0x35')][_0x5754('0x48')]){_0x8a5d42[_0x5754('0x49')]=[{'all':!![]}];}return db[_0x5754('0x2f')][_0x5754('0x4a')](_0x8a5d42);})[_0x5754('0x27')](function(_0x5393ef){_0x46a7ed[_0x5754('0x4b')]=_0x5393ef;return _0x46a7ed;})[_0x5754('0x27')](respondWithFilteredResult(_0x164940,_0x8a5d42))[_0x5754('0x4c')](handleError(_0x164940,null));};exports['show']=function(_0x5e7bf0,_0x59ee28){var _0x4e0c15={'raw':![],'where':{'id':_0x5e7bf0[_0x5754('0x4d')]['id']}},_0x820665={};_0x820665[_0x5754('0x33')]=_[_0x5754('0x36')](db[_0x5754('0x2f')]['rawAttributes']);_0x820665['query']=_[_0x5754('0x36')](_0x5e7bf0[_0x5754('0x35')]);_0x820665[_0x5754('0x37')]=_[_0x5754('0x38')](_0x820665[_0x5754('0x33')],_0x820665[_0x5754('0x35')]);_0x4e0c15[_0x5754('0x39')]=_[_0x5754('0x38')](_0x820665[_0x5754('0x33')],qs['fields'](_0x5e7bf0['query'][_0x5754('0x3a')]));_0x4e0c15['attributes']=_0x4e0c15[_0x5754('0x39')][_0x5754('0x3b')]?_0x4e0c15[_0x5754('0x39')]:_0x820665[_0x5754('0x33')];if(_0x5e7bf0[_0x5754('0x35')][_0x5754('0x48')]){_0x4e0c15[_0x5754('0x49')]=[{'all':!![]}];}_0x4e0c15=_['merge']({},_0x4e0c15,_0x5e7bf0[_0x5754('0x46')]);return db['ZendeskConfiguration']['find'](_0x4e0c15)[_0x5754('0x27')](handleEntityNotFound(_0x59ee28,null))[_0x5754('0x27')](respondWithResult(_0x59ee28,null))[_0x5754('0x4c')](handleError(_0x59ee28,null));};exports[_0x5754('0x4e')]=function(_0xb59a7b,_0x5dc650){return db[_0x5754('0x2f')][_0x5754('0x4e')](_0xb59a7b[_0x5754('0x4f')],{})[_0x5754('0x27')](respondWithResult(_0x5dc650,0xc9))['catch'](handleError(_0x5dc650,null));};exports[_0x5754('0x26')]=function(_0x22dabb,_0xe2bb11){if(_0x22dabb[_0x5754('0x4f')]['id']){delete _0x22dabb['body']['id'];}return db['ZendeskConfiguration'][_0x5754('0x50')]({'where':{'id':_0x22dabb[_0x5754('0x4d')]['id']}})['then'](handleEntityNotFound(_0xe2bb11,null))[_0x5754('0x27')](saveUpdates(_0x22dabb[_0x5754('0x4f')],null))[_0x5754('0x27')](respondWithResult(_0xe2bb11,null))[_0x5754('0x4c')](handleError(_0xe2bb11,null));};exports[_0x5754('0x28')]=function(_0x4d62d9,_0x454fc9){return db[_0x5754('0x2f')][_0x5754('0x50')]({'where':{'id':_0x4d62d9['params']['id']}})[_0x5754('0x27')](handleEntityNotFound(_0x454fc9,null))['then'](removeEntity(_0x454fc9,null))[_0x5754('0x4c')](handleError(_0x454fc9,null));};exports[_0x5754('0x51')]=function(_0xd1978e,_0x2f7b4c,_0x57e32e){var _0x4e5ed4={};var _0x3b9613={};var _0x3b1124;var _0x540fbe;return db[_0x5754('0x2f')][_0x5754('0x52')]({'where':{'id':_0xd1978e[_0x5754('0x4d')]['id']}})[_0x5754('0x27')](handleEntityNotFound(_0x2f7b4c,null))[_0x5754('0x27')](function(_0x42117d){if(_0x42117d){_0x3b1124=_0x42117d;_0x3b9613[_0x5754('0x33')]=_[_0x5754('0x36')](db[_0x5754('0x53')][_0x5754('0x30')]);_0x3b9613[_0x5754('0x35')]=_[_0x5754('0x36')](_0xd1978e[_0x5754('0x35')]);_0x3b9613[_0x5754('0x37')]=_['intersection'](_0x3b9613['model'],_0x3b9613[_0x5754('0x35')]);_0x4e5ed4[_0x5754('0x39')]=_[_0x5754('0x38')](_0x3b9613[_0x5754('0x33')],qs['fields'](_0xd1978e[_0x5754('0x35')][_0x5754('0x3a')]));_0x4e5ed4[_0x5754('0x39')]=_0x4e5ed4[_0x5754('0x39')][_0x5754('0x3b')]?_0x4e5ed4[_0x5754('0x39')]:_0x3b9613['model'];_0x4e5ed4[_0x5754('0x3e')]=qs['sort'](_0xd1978e[_0x5754('0x35')][_0x5754('0x3f')]);_0x4e5ed4[_0x5754('0x40')]=qs[_0x5754('0x37')](_[_0x5754('0x41')](_0xd1978e[_0x5754('0x35')],_0x3b9613[_0x5754('0x37')]));if(_0xd1978e[_0x5754('0x35')][_0x5754('0x45')]){_0x4e5ed4[_0x5754('0x40')]=_[_0x5754('0x42')](_0x4e5ed4[_0x5754('0x40')],{'$or':_['map'](_0x4e5ed4[_0x5754('0x39')],function(_0x4aaea6){var _0x151e8b={};_0x151e8b[_0x4aaea6]={'$like':'%'+_0xd1978e[_0x5754('0x35')][_0x5754('0x45')]+'%'};return _0x151e8b;})});}_0x4e5ed4=_['merge']({},_0x4e5ed4,_0xd1978e[_0x5754('0x46')]);return _0x3b1124[_0x5754('0x51')](_0x4e5ed4);}})[_0x5754('0x27')](function(_0x9f6005){if(_0x9f6005){_0x540fbe=_0x9f6005[_0x5754('0x3b')];if(!_0xd1978e[_0x5754('0x35')][_0x5754('0x3c')](_0x5754('0x3d'))){_0x4e5ed4['limit']=qs[_0x5754('0x1f')](_0xd1978e[_0x5754('0x35')][_0x5754('0x1f')]);_0x4e5ed4[_0x5754('0x1e')]=qs[_0x5754('0x1e')](_0xd1978e[_0x5754('0x35')][_0x5754('0x1e')]);}return _0x3b1124['getFields'](_0x4e5ed4);}})[_0x5754('0x27')](function(_0x4392fe){if(_0x4392fe){return _0x4392fe?{'count':_0x540fbe,'rows':_0x4392fe}:null;}})[_0x5754('0x27')](respondWithResult(_0x2f7b4c,null))[_0x5754('0x4c')](handleError(_0x2f7b4c,null));};exports[_0x5754('0x54')]=function(_0x1fc5c,_0x3e8589,_0xe0803){var _0x35551a={};var _0x1bfac7={};var _0x44a6e1;var _0x56e15f;return db['ZendeskConfiguration'][_0x5754('0x52')]({'where':{'id':_0x1fc5c['params']['id']}})['then'](handleEntityNotFound(_0x3e8589,null))[_0x5754('0x27')](function(_0x3b6858){if(_0x3b6858){_0x44a6e1=_0x3b6858;_0x1bfac7[_0x5754('0x33')]=_[_0x5754('0x36')](db[_0x5754('0x53')][_0x5754('0x30')]);_0x1bfac7[_0x5754('0x35')]=_[_0x5754('0x36')](_0x1fc5c['query']);_0x1bfac7[_0x5754('0x37')]=_[_0x5754('0x38')](_0x1bfac7['model'],_0x1bfac7[_0x5754('0x35')]);_0x35551a['attributes']=_[_0x5754('0x38')](_0x1bfac7[_0x5754('0x33')],qs[_0x5754('0x3a')](_0x1fc5c['query'][_0x5754('0x3a')]));_0x35551a[_0x5754('0x39')]=_0x35551a[_0x5754('0x39')][_0x5754('0x3b')]?_0x35551a[_0x5754('0x39')]:_0x1bfac7[_0x5754('0x33')];_0x35551a[_0x5754('0x3e')]=qs[_0x5754('0x3f')](_0x1fc5c[_0x5754('0x35')]['sort']);_0x35551a[_0x5754('0x40')]=qs[_0x5754('0x37')](_['pick'](_0x1fc5c[_0x5754('0x35')],_0x1bfac7[_0x5754('0x37')]));if(_0x1fc5c[_0x5754('0x35')][_0x5754('0x45')]){_0x35551a[_0x5754('0x40')]=_[_0x5754('0x42')](_0x35551a[_0x5754('0x40')],{'$or':_[_0x5754('0x34')](_0x35551a[_0x5754('0x39')],function(_0x2ec77d){var _0x1659b9={};_0x1659b9[_0x2ec77d]={'$like':'%'+_0x1fc5c[_0x5754('0x35')]['filter']+'%'};return _0x1659b9;})});}_0x35551a=_['merge']({},_0x35551a,_0x1fc5c[_0x5754('0x46')]);return _0x44a6e1[_0x5754('0x54')](_0x35551a);}})[_0x5754('0x27')](function(_0x9f71bc){if(_0x9f71bc){_0x56e15f=_0x9f71bc[_0x5754('0x3b')];if(!_0x1fc5c[_0x5754('0x35')][_0x5754('0x3c')](_0x5754('0x3d'))){_0x35551a[_0x5754('0x1f')]=qs['limit'](_0x1fc5c['query']['limit']);_0x35551a['offset']=qs[_0x5754('0x1e')](_0x1fc5c['query'][_0x5754('0x1e')]);}return _0x44a6e1[_0x5754('0x54')](_0x35551a);}})[_0x5754('0x27')](function(_0x1b7e80){if(_0x1b7e80){return _0x1b7e80?{'count':_0x56e15f,'rows':_0x1b7e80}:null;}})['then'](respondWithResult(_0x3e8589,null))[_0x5754('0x4c')](handleError(_0x3e8589,null));};exports['getDescriptions']=function(_0x63d286,_0x5a7ecb,_0x3d8529){var _0x40b1b3={};var _0x1102e3={};var _0x13f64d;var _0x52757b;return db[_0x5754('0x2f')][_0x5754('0x52')]({'where':{'id':_0x63d286['params']['id']}})[_0x5754('0x27')](handleEntityNotFound(_0x5a7ecb,null))[_0x5754('0x27')](function(_0x120d53){if(_0x120d53){_0x13f64d=_0x120d53;_0x1102e3[_0x5754('0x33')]=_[_0x5754('0x36')](db['ZendeskField']['rawAttributes']);_0x1102e3['query']=_[_0x5754('0x36')](_0x63d286[_0x5754('0x35')]);_0x1102e3[_0x5754('0x37')]=_[_0x5754('0x38')](_0x1102e3['model'],_0x1102e3[_0x5754('0x35')]);_0x40b1b3[_0x5754('0x39')]=_[_0x5754('0x38')](_0x1102e3[_0x5754('0x33')],qs[_0x5754('0x3a')](_0x63d286[_0x5754('0x35')][_0x5754('0x3a')]));_0x40b1b3[_0x5754('0x39')]=_0x40b1b3[_0x5754('0x39')][_0x5754('0x3b')]?_0x40b1b3['attributes']:_0x1102e3['model'];_0x40b1b3['order']=qs['sort'](_0x63d286['query']['sort']);_0x40b1b3['where']=qs[_0x5754('0x37')](_['pick'](_0x63d286[_0x5754('0x35')],_0x1102e3[_0x5754('0x37')]));if(_0x63d286['query'][_0x5754('0x45')]){_0x40b1b3['where']=_[_0x5754('0x42')](_0x40b1b3[_0x5754('0x40')],{'$or':_['map'](_0x40b1b3[_0x5754('0x39')],function(_0xabf80){var _0x1eaaa3={};_0x1eaaa3[_0xabf80]={'$like':'%'+_0x63d286[_0x5754('0x35')][_0x5754('0x45')]+'%'};return _0x1eaaa3;})});}_0x40b1b3=_[_0x5754('0x42')]({},_0x40b1b3,_0x63d286[_0x5754('0x46')]);return _0x13f64d[_0x5754('0x55')](_0x40b1b3);}})[_0x5754('0x27')](function(_0x287346){if(_0x287346){_0x52757b=_0x287346[_0x5754('0x3b')];if(!_0x63d286[_0x5754('0x35')]['hasOwnProperty'](_0x5754('0x3d'))){_0x40b1b3['limit']=qs[_0x5754('0x1f')](_0x63d286[_0x5754('0x35')][_0x5754('0x1f')]);_0x40b1b3['offset']=qs[_0x5754('0x1e')](_0x63d286[_0x5754('0x35')][_0x5754('0x1e')]);}return _0x13f64d['getDescriptions'](_0x40b1b3);}})[_0x5754('0x27')](function(_0x430253){if(_0x430253){return _0x430253?{'count':_0x52757b,'rows':_0x430253}:null;}})[_0x5754('0x27')](respondWithResult(_0x5a7ecb,null))[_0x5754('0x4c')](handleError(_0x5a7ecb,null));};exports[_0x5754('0x56')]=function(_0x27b5ee,_0x3fe8bc,_0x323dd8){var _0x5f43ad={};var _0x1906ff={};var _0x4e8539;var _0x58d5b6;return db['ZendeskConfiguration'][_0x5754('0x52')]({'where':{'id':_0x27b5ee[_0x5754('0x4d')]['id']}})[_0x5754('0x27')](handleEntityNotFound(_0x3fe8bc,null))['then'](function(_0x265d2b){if(_0x265d2b){_0x4e8539=_0x265d2b;_0x1906ff[_0x5754('0x33')]=_[_0x5754('0x36')](db[_0x5754('0x57')]['rawAttributes']);_0x1906ff[_0x5754('0x35')]=_[_0x5754('0x36')](_0x27b5ee[_0x5754('0x35')]);_0x1906ff['filters']=_[_0x5754('0x38')](_0x1906ff['model'],_0x1906ff[_0x5754('0x35')]);_0x5f43ad[_0x5754('0x39')]=_[_0x5754('0x38')](_0x1906ff[_0x5754('0x33')],qs['fields'](_0x27b5ee['query'][_0x5754('0x3a')]));_0x5f43ad['attributes']=_0x5f43ad[_0x5754('0x39')][_0x5754('0x3b')]?_0x5f43ad[_0x5754('0x39')]:_0x1906ff[_0x5754('0x33')];_0x5f43ad[_0x5754('0x3e')]=qs[_0x5754('0x3f')](_0x27b5ee[_0x5754('0x35')][_0x5754('0x3f')]);_0x5f43ad[_0x5754('0x40')]=qs[_0x5754('0x37')](_[_0x5754('0x41')](_0x27b5ee[_0x5754('0x35')],_0x1906ff['filters']));if(_0x27b5ee[_0x5754('0x35')][_0x5754('0x45')]){_0x5f43ad['where']=_['merge'](_0x5f43ad[_0x5754('0x40')],{'$or':_[_0x5754('0x34')](_0x5f43ad[_0x5754('0x39')],function(_0x21fcda){var _0x3ec726={};_0x3ec726[_0x21fcda]={'$like':'%'+_0x27b5ee[_0x5754('0x35')][_0x5754('0x45')]+'%'};return _0x3ec726;})});}_0x5f43ad=_[_0x5754('0x42')]({},_0x5f43ad,_0x27b5ee[_0x5754('0x46')]);return _0x4e8539['getTags'](_0x5f43ad);}})[_0x5754('0x27')](function(_0x2811aa){if(_0x2811aa){_0x58d5b6=_0x2811aa[_0x5754('0x3b')];if(!_0x27b5ee['query']['hasOwnProperty'](_0x5754('0x3d'))){_0x5f43ad[_0x5754('0x1f')]=qs['limit'](_0x27b5ee[_0x5754('0x35')][_0x5754('0x1f')]);_0x5f43ad[_0x5754('0x1e')]=qs['offset'](_0x27b5ee['query'][_0x5754('0x1e')]);}return _0x4e8539[_0x5754('0x56')](_0x5f43ad);}})[_0x5754('0x27')](function(_0x5abed3){if(_0x5abed3){return _0x5abed3?{'count':_0x58d5b6,'rows':_0x5abed3}:null;}})['then'](respondWithResult(_0x3fe8bc,null))['catch'](handleError(_0x3fe8bc,null));};exports['setTags']=function(_0xd817d1,_0x3a2000,_0x3ad578){if(_0xd817d1[_0x5754('0x4f')]['id']){delete _0xd817d1[_0x5754('0x4f')]['id'];}return db[_0x5754('0x2f')][_0x5754('0x52')]({'where':{'id':_0xd817d1[_0x5754('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3a2000,null))[_0x5754('0x27')](function(_0x43d9a5){if(_0x43d9a5){return _0x43d9a5['setTags'](_0xd817d1[_0x5754('0x4f')]['ids']||[]);}return null;})['then'](respondWithResult(_0x3a2000,null))[_0x5754('0x4c')](handleError(_0x3a2000,null));}; \ No newline at end of file +var _0x26ab=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','include','rows','show','params','find','catch','create','body','findOne','ZendeskField','sort','getFields','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','ZendeskConfiguration','rawAttributes','fieldName','type','model','map'];(function(_0x59cdfe,_0x31fdf6){var _0x24c85d=function(_0x4e4d93){while(--_0x4e4d93){_0x59cdfe['push'](_0x59cdfe['shift']());}};_0x24c85d(++_0x31fdf6);}(_0x26ab,0x171));var _0xb26a=function(_0x4ae625,_0x58a84e){_0x4ae625=_0x4ae625-0x0;var _0x2fb608=_0x26ab[_0x4ae625];return _0x2fb608;};'use strict';var emlformat=require(_0xb26a('0x0'));var rimraf=require(_0xb26a('0x1'));var zipdir=require(_0xb26a('0x2'));var jsonpatch=require(_0xb26a('0x3'));var rp=require(_0xb26a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xb26a('0x5'));var util=require(_0xb26a('0x6'));var path=require(_0xb26a('0x7'));var sox=require('sox');var csv=require(_0xb26a('0x8'));var ejs=require(_0xb26a('0x9'));var fs=require('fs');var fs_extra=require(_0xb26a('0xa'));var _=require(_0xb26a('0xb'));var squel=require(_0xb26a('0xc'));var crypto=require(_0xb26a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb26a('0xe'));var toCsv=require(_0xb26a('0x8'));var querystring=require(_0xb26a('0xf'));var Papa=require(_0xb26a('0x10'));var Redis=require(_0xb26a('0x11'));var authService=require(_0xb26a('0x12'));var qs=require(_0xb26a('0x13'));var as=require(_0xb26a('0x14'));var hardwareService=require(_0xb26a('0x15'));var logger=require('../../config/logger')(_0xb26a('0x16'));var utils=require('../../config/utils');var config=require(_0xb26a('0x17'));var licenseUtil=require(_0xb26a('0x18'));var db=require(_0xb26a('0x19'))['db'];function respondWithStatusCode(_0xb1d5ff,_0x4bf67c){_0x4bf67c=_0x4bf67c||0xcc;return function(_0x684eee){if(_0x684eee){return _0xb1d5ff[_0xb26a('0x1a')](_0x4bf67c);}return _0xb1d5ff['status'](_0x4bf67c)[_0xb26a('0x1b')]();};}function respondWithResult(_0x3c30c0,_0x4ce5f5){_0x4ce5f5=_0x4ce5f5||0xc8;return function(_0x1a65b9){if(_0x1a65b9){return _0x3c30c0[_0xb26a('0x1c')](_0x4ce5f5)[_0xb26a('0x1d')](_0x1a65b9);}};}function respondWithFilteredResult(_0x3e7e50,_0xacaa1a){return function(_0x25d30a){if(_0x25d30a){var _0x45b442=typeof _0xacaa1a[_0xb26a('0x1e')]===_0xb26a('0x1f')&&typeof _0xacaa1a[_0xb26a('0x20')]===_0xb26a('0x1f');var _0x43c741=_0x25d30a[_0xb26a('0x21')];var _0x162f60=_0x45b442?0x0:_0xacaa1a['offset'];var _0xcf215d=_0x45b442?_0x25d30a['count']:_0xacaa1a[_0xb26a('0x1e')]+_0xacaa1a[_0xb26a('0x20')];var _0x234228;if(_0xcf215d>=_0x43c741){_0xcf215d=_0x43c741;_0x234228=0xc8;}else{_0x234228=0xce;}_0x3e7e50['status'](_0x234228);return _0x3e7e50[_0xb26a('0x22')]('Content-Range',_0x162f60+'-'+_0xcf215d+'/'+_0x43c741)[_0xb26a('0x1d')](_0x25d30a);}return null;};}function patchUpdates(_0x24ff66){return function(_0x38104b){try{jsonpatch[_0xb26a('0x23')](_0x38104b,_0x24ff66,!![]);}catch(_0x158b6b){return BPromise[_0xb26a('0x24')](_0x158b6b);}return _0x38104b[_0xb26a('0x25')]();};}function saveUpdates(_0x461272,_0x4aa0e7){return function(_0x405d2c){if(_0x405d2c){return _0x405d2c[_0xb26a('0x26')](_0x461272)[_0xb26a('0x27')](function(_0x253995){return _0x253995;});}return null;};}function removeEntity(_0x1ad89d,_0x30af3d){return function(_0x43a545){if(_0x43a545){return _0x43a545[_0xb26a('0x28')]()[_0xb26a('0x27')](function(){_0x1ad89d['status'](0xcc)[_0xb26a('0x1b')]();});}};}function handleEntityNotFound(_0x5cf30e,_0x11343a){return function(_0x5517c7){if(!_0x5517c7){_0x5cf30e[_0xb26a('0x1a')](0x194);}return _0x5517c7;};}function handleError(_0x1a8480,_0x1b256b){_0x1b256b=_0x1b256b||0x1f4;return function(_0x1dba9f){logger[_0xb26a('0x29')](_0x1dba9f[_0xb26a('0x2a')]);if(_0x1dba9f[_0xb26a('0x2b')]){delete _0x1dba9f['name'];}_0x1a8480[_0xb26a('0x1c')](_0x1b256b)[_0xb26a('0x2c')](_0x1dba9f);};}exports['index']=function(_0x39c0b8,_0x3fb1e8){var _0x56d0ee={},_0x5d62c7={},_0x33fbd5={'count':0x0,'rows':[]};var _0x476777=_['map'](db[_0xb26a('0x2d')][_0xb26a('0x2e')],function(_0x16e8ac){return{'name':_0x16e8ac[_0xb26a('0x2f')],'type':_0x16e8ac[_0xb26a('0x30')]['key']};});_0x5d62c7[_0xb26a('0x31')]=_[_0xb26a('0x32')](_0x476777,_0xb26a('0x2b'));_0x5d62c7['query']=_[_0xb26a('0x33')](_0x39c0b8[_0xb26a('0x34')]);_0x5d62c7[_0xb26a('0x35')]=_[_0xb26a('0x36')](_0x5d62c7[_0xb26a('0x31')],_0x5d62c7[_0xb26a('0x34')]);_0x56d0ee[_0xb26a('0x37')]=_[_0xb26a('0x36')](_0x5d62c7[_0xb26a('0x31')],qs[_0xb26a('0x38')](_0x39c0b8['query']['fields']));_0x56d0ee[_0xb26a('0x37')]=_0x56d0ee[_0xb26a('0x37')][_0xb26a('0x39')]?_0x56d0ee[_0xb26a('0x37')]:_0x5d62c7['model'];if(!_0x39c0b8[_0xb26a('0x34')][_0xb26a('0x3a')](_0xb26a('0x3b'))){_0x56d0ee[_0xb26a('0x20')]=qs['limit'](_0x39c0b8['query']['limit']);_0x56d0ee[_0xb26a('0x1e')]=qs[_0xb26a('0x1e')](_0x39c0b8[_0xb26a('0x34')][_0xb26a('0x1e')]);}_0x56d0ee[_0xb26a('0x3c')]=qs['sort'](_0x39c0b8['query']['sort']);_0x56d0ee[_0xb26a('0x3d')]=qs[_0xb26a('0x35')](_[_0xb26a('0x3e')](_0x39c0b8[_0xb26a('0x34')],_0x5d62c7[_0xb26a('0x35')]),_0x476777);if(_0x39c0b8['query'][_0xb26a('0x3f')]){_0x56d0ee['where']=_[_0xb26a('0x40')](_0x56d0ee['where'],{'$or':_[_0xb26a('0x32')](_0x476777,function(_0x40fcfb){if(_0x40fcfb[_0xb26a('0x30')]!==_0xb26a('0x41')){var _0x229a60={};_0x229a60[_0x40fcfb[_0xb26a('0x2b')]]={'$like':'%'+_0x39c0b8['query'][_0xb26a('0x3f')]+'%'};return _0x229a60;}})});}_0x56d0ee=_['merge']({},_0x56d0ee,_0x39c0b8[_0xb26a('0x42')]);var _0x975136={'where':_0x56d0ee[_0xb26a('0x3d')]};return db[_0xb26a('0x2d')][_0xb26a('0x21')](_0x975136)[_0xb26a('0x27')](function(_0x482999){_0x33fbd5['count']=_0x482999;if(_0x39c0b8[_0xb26a('0x34')]['includeAll']){_0x56d0ee[_0xb26a('0x43')]=[{'all':!![]}];}return db[_0xb26a('0x2d')]['findAll'](_0x56d0ee);})[_0xb26a('0x27')](function(_0x30112c){_0x33fbd5[_0xb26a('0x44')]=_0x30112c;return _0x33fbd5;})[_0xb26a('0x27')](respondWithFilteredResult(_0x3fb1e8,_0x56d0ee))['catch'](handleError(_0x3fb1e8,null));};exports[_0xb26a('0x45')]=function(_0x284c06,_0x4d8b6f){var _0x29b73f={'raw':![],'where':{'id':_0x284c06[_0xb26a('0x46')]['id']}},_0x2d50aa={};_0x2d50aa[_0xb26a('0x31')]=_['keys'](db[_0xb26a('0x2d')][_0xb26a('0x2e')]);_0x2d50aa[_0xb26a('0x34')]=_['keys'](_0x284c06['query']);_0x2d50aa[_0xb26a('0x35')]=_['intersection'](_0x2d50aa[_0xb26a('0x31')],_0x2d50aa[_0xb26a('0x34')]);_0x29b73f['attributes']=_[_0xb26a('0x36')](_0x2d50aa['model'],qs[_0xb26a('0x38')](_0x284c06['query'][_0xb26a('0x38')]));_0x29b73f['attributes']=_0x29b73f[_0xb26a('0x37')][_0xb26a('0x39')]?_0x29b73f['attributes']:_0x2d50aa[_0xb26a('0x31')];if(_0x284c06[_0xb26a('0x34')]['includeAll']){_0x29b73f[_0xb26a('0x43')]=[{'all':!![]}];}_0x29b73f=_[_0xb26a('0x40')]({},_0x29b73f,_0x284c06[_0xb26a('0x42')]);return db[_0xb26a('0x2d')][_0xb26a('0x47')](_0x29b73f)[_0xb26a('0x27')](handleEntityNotFound(_0x4d8b6f,null))[_0xb26a('0x27')](respondWithResult(_0x4d8b6f,null))[_0xb26a('0x48')](handleError(_0x4d8b6f,null));};exports[_0xb26a('0x49')]=function(_0x57bc6a,_0x4fdd6d){return db[_0xb26a('0x2d')][_0xb26a('0x49')](_0x57bc6a[_0xb26a('0x4a')],{})['then'](respondWithResult(_0x4fdd6d,0xc9))[_0xb26a('0x48')](handleError(_0x4fdd6d,null));};exports['update']=function(_0x28309c,_0x5db931){if(_0x28309c[_0xb26a('0x4a')]['id']){delete _0x28309c[_0xb26a('0x4a')]['id'];}return db[_0xb26a('0x2d')][_0xb26a('0x47')]({'where':{'id':_0x28309c['params']['id']}})[_0xb26a('0x27')](handleEntityNotFound(_0x5db931,null))[_0xb26a('0x27')](saveUpdates(_0x28309c[_0xb26a('0x4a')],null))[_0xb26a('0x27')](respondWithResult(_0x5db931,null))[_0xb26a('0x48')](handleError(_0x5db931,null));};exports[_0xb26a('0x28')]=function(_0x438fac,_0x2f1512){return db[_0xb26a('0x2d')][_0xb26a('0x47')]({'where':{'id':_0x438fac[_0xb26a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2f1512,null))['then'](removeEntity(_0x2f1512,null))[_0xb26a('0x48')](handleError(_0x2f1512,null));};exports['getFields']=function(_0x11535b,_0x30df90,_0x5b275b){var _0x1352c3={};var _0x3e35a6={};var _0x3cb5b0;var _0x3394e6;return db['ZendeskConfiguration'][_0xb26a('0x4b')]({'where':{'id':_0x11535b[_0xb26a('0x46')]['id']}})[_0xb26a('0x27')](handleEntityNotFound(_0x30df90,null))[_0xb26a('0x27')](function(_0x2218d9){if(_0x2218d9){_0x3cb5b0=_0x2218d9;_0x3e35a6[_0xb26a('0x31')]=_[_0xb26a('0x33')](db[_0xb26a('0x4c')][_0xb26a('0x2e')]);_0x3e35a6[_0xb26a('0x34')]=_['keys'](_0x11535b[_0xb26a('0x34')]);_0x3e35a6['filters']=_[_0xb26a('0x36')](_0x3e35a6[_0xb26a('0x31')],_0x3e35a6[_0xb26a('0x34')]);_0x1352c3[_0xb26a('0x37')]=_[_0xb26a('0x36')](_0x3e35a6[_0xb26a('0x31')],qs[_0xb26a('0x38')](_0x11535b[_0xb26a('0x34')][_0xb26a('0x38')]));_0x1352c3[_0xb26a('0x37')]=_0x1352c3[_0xb26a('0x37')][_0xb26a('0x39')]?_0x1352c3['attributes']:_0x3e35a6['model'];_0x1352c3[_0xb26a('0x3c')]=qs['sort'](_0x11535b['query'][_0xb26a('0x4d')]);_0x1352c3[_0xb26a('0x3d')]=qs[_0xb26a('0x35')](_['pick'](_0x11535b[_0xb26a('0x34')],_0x3e35a6[_0xb26a('0x35')]));if(_0x11535b['query']['filter']){_0x1352c3[_0xb26a('0x3d')]=_['merge'](_0x1352c3[_0xb26a('0x3d')],{'$or':_[_0xb26a('0x32')](_0x1352c3['attributes'],function(_0x331096){var _0x34e0ee={};_0x34e0ee[_0x331096]={'$like':'%'+_0x11535b[_0xb26a('0x34')][_0xb26a('0x3f')]+'%'};return _0x34e0ee;})});}_0x1352c3=_[_0xb26a('0x40')]({},_0x1352c3,_0x11535b[_0xb26a('0x42')]);return _0x3cb5b0[_0xb26a('0x4e')](_0x1352c3);}})[_0xb26a('0x27')](function(_0x3145f6){if(_0x3145f6){_0x3394e6=_0x3145f6[_0xb26a('0x39')];if(!_0x11535b['query']['hasOwnProperty'](_0xb26a('0x3b'))){_0x1352c3[_0xb26a('0x20')]=qs[_0xb26a('0x20')](_0x11535b['query'][_0xb26a('0x20')]);_0x1352c3[_0xb26a('0x1e')]=qs[_0xb26a('0x1e')](_0x11535b['query'][_0xb26a('0x1e')]);}return _0x3cb5b0[_0xb26a('0x4e')](_0x1352c3);}})['then'](function(_0x450832){if(_0x450832){return _0x450832?{'count':_0x3394e6,'rows':_0x450832}:null;}})['then'](respondWithResult(_0x30df90,null))[_0xb26a('0x48')](handleError(_0x30df90,null));};exports[_0xb26a('0x4f')]=function(_0x369fa3,_0x32d59c,_0x31277a){var _0x5894e4={};var _0x44b825={};var _0x2c0f5e;var _0x5c4273;return db['ZendeskConfiguration'][_0xb26a('0x4b')]({'where':{'id':_0x369fa3['params']['id']}})[_0xb26a('0x27')](handleEntityNotFound(_0x32d59c,null))[_0xb26a('0x27')](function(_0x238d90){if(_0x238d90){_0x2c0f5e=_0x238d90;_0x44b825[_0xb26a('0x31')]=_[_0xb26a('0x33')](db[_0xb26a('0x4c')][_0xb26a('0x2e')]);_0x44b825[_0xb26a('0x34')]=_['keys'](_0x369fa3[_0xb26a('0x34')]);_0x44b825[_0xb26a('0x35')]=_['intersection'](_0x44b825['model'],_0x44b825[_0xb26a('0x34')]);_0x5894e4[_0xb26a('0x37')]=_[_0xb26a('0x36')](_0x44b825[_0xb26a('0x31')],qs[_0xb26a('0x38')](_0x369fa3[_0xb26a('0x34')][_0xb26a('0x38')]));_0x5894e4[_0xb26a('0x37')]=_0x5894e4[_0xb26a('0x37')]['length']?_0x5894e4['attributes']:_0x44b825[_0xb26a('0x31')];_0x5894e4[_0xb26a('0x3c')]=qs[_0xb26a('0x4d')](_0x369fa3[_0xb26a('0x34')][_0xb26a('0x4d')]);_0x5894e4['where']=qs[_0xb26a('0x35')](_[_0xb26a('0x3e')](_0x369fa3['query'],_0x44b825[_0xb26a('0x35')]));if(_0x369fa3['query'][_0xb26a('0x3f')]){_0x5894e4[_0xb26a('0x3d')]=_['merge'](_0x5894e4[_0xb26a('0x3d')],{'$or':_[_0xb26a('0x32')](_0x5894e4[_0xb26a('0x37')],function(_0x3405f9){var _0x5e6316={};_0x5e6316[_0x3405f9]={'$like':'%'+_0x369fa3[_0xb26a('0x34')][_0xb26a('0x3f')]+'%'};return _0x5e6316;})});}_0x5894e4=_[_0xb26a('0x40')]({},_0x5894e4,_0x369fa3[_0xb26a('0x42')]);return _0x2c0f5e['getSubjects'](_0x5894e4);}})[_0xb26a('0x27')](function(_0x53f340){if(_0x53f340){_0x5c4273=_0x53f340[_0xb26a('0x39')];if(!_0x369fa3[_0xb26a('0x34')][_0xb26a('0x3a')]('nolimit')){_0x5894e4[_0xb26a('0x20')]=qs[_0xb26a('0x20')](_0x369fa3['query'][_0xb26a('0x20')]);_0x5894e4[_0xb26a('0x1e')]=qs[_0xb26a('0x1e')](_0x369fa3[_0xb26a('0x34')][_0xb26a('0x1e')]);}return _0x2c0f5e[_0xb26a('0x4f')](_0x5894e4);}})['then'](function(_0x1e6057){if(_0x1e6057){return _0x1e6057?{'count':_0x5c4273,'rows':_0x1e6057}:null;}})[_0xb26a('0x27')](respondWithResult(_0x32d59c,null))[_0xb26a('0x48')](handleError(_0x32d59c,null));};exports['getDescriptions']=function(_0x8d1fdd,_0x3988d7,_0x405703){var _0x5baf7a={};var _0x49e9d1={};var _0x1014d3;var _0x47bcbc;return db[_0xb26a('0x2d')]['findOne']({'where':{'id':_0x8d1fdd[_0xb26a('0x46')]['id']}})[_0xb26a('0x27')](handleEntityNotFound(_0x3988d7,null))[_0xb26a('0x27')](function(_0x36f5db){if(_0x36f5db){_0x1014d3=_0x36f5db;_0x49e9d1['model']=_[_0xb26a('0x33')](db['ZendeskField'][_0xb26a('0x2e')]);_0x49e9d1[_0xb26a('0x34')]=_[_0xb26a('0x33')](_0x8d1fdd['query']);_0x49e9d1['filters']=_[_0xb26a('0x36')](_0x49e9d1[_0xb26a('0x31')],_0x49e9d1['query']);_0x5baf7a[_0xb26a('0x37')]=_[_0xb26a('0x36')](_0x49e9d1[_0xb26a('0x31')],qs[_0xb26a('0x38')](_0x8d1fdd['query'][_0xb26a('0x38')]));_0x5baf7a[_0xb26a('0x37')]=_0x5baf7a['attributes'][_0xb26a('0x39')]?_0x5baf7a[_0xb26a('0x37')]:_0x49e9d1['model'];_0x5baf7a[_0xb26a('0x3c')]=qs[_0xb26a('0x4d')](_0x8d1fdd[_0xb26a('0x34')][_0xb26a('0x4d')]);_0x5baf7a[_0xb26a('0x3d')]=qs[_0xb26a('0x35')](_['pick'](_0x8d1fdd[_0xb26a('0x34')],_0x49e9d1[_0xb26a('0x35')]));if(_0x8d1fdd[_0xb26a('0x34')][_0xb26a('0x3f')]){_0x5baf7a[_0xb26a('0x3d')]=_['merge'](_0x5baf7a['where'],{'$or':_[_0xb26a('0x32')](_0x5baf7a[_0xb26a('0x37')],function(_0x38699f){var _0x5678f0={};_0x5678f0[_0x38699f]={'$like':'%'+_0x8d1fdd[_0xb26a('0x34')]['filter']+'%'};return _0x5678f0;})});}_0x5baf7a=_[_0xb26a('0x40')]({},_0x5baf7a,_0x8d1fdd[_0xb26a('0x42')]);return _0x1014d3[_0xb26a('0x50')](_0x5baf7a);}})[_0xb26a('0x27')](function(_0x2304bc){if(_0x2304bc){_0x47bcbc=_0x2304bc['length'];if(!_0x8d1fdd[_0xb26a('0x34')][_0xb26a('0x3a')]('nolimit')){_0x5baf7a[_0xb26a('0x20')]=qs['limit'](_0x8d1fdd[_0xb26a('0x34')]['limit']);_0x5baf7a[_0xb26a('0x1e')]=qs[_0xb26a('0x1e')](_0x8d1fdd[_0xb26a('0x34')]['offset']);}return _0x1014d3['getDescriptions'](_0x5baf7a);}})[_0xb26a('0x27')](function(_0x441541){if(_0x441541){return _0x441541?{'count':_0x47bcbc,'rows':_0x441541}:null;}})[_0xb26a('0x27')](respondWithResult(_0x3988d7,null))[_0xb26a('0x48')](handleError(_0x3988d7,null));};exports['getTags']=function(_0x2a72ab,_0x1171bc,_0x161aed){var _0x36fbb7={};var _0x2f1539={};var _0x1262c9;var _0x35e72f;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x2a72ab[_0xb26a('0x46')]['id']}})['then'](handleEntityNotFound(_0x1171bc,null))[_0xb26a('0x27')](function(_0x41fdec){if(_0x41fdec){_0x1262c9=_0x41fdec;_0x2f1539[_0xb26a('0x31')]=_[_0xb26a('0x33')](db[_0xb26a('0x51')][_0xb26a('0x2e')]);_0x2f1539[_0xb26a('0x34')]=_[_0xb26a('0x33')](_0x2a72ab[_0xb26a('0x34')]);_0x2f1539[_0xb26a('0x35')]=_[_0xb26a('0x36')](_0x2f1539[_0xb26a('0x31')],_0x2f1539['query']);_0x36fbb7[_0xb26a('0x37')]=_['intersection'](_0x2f1539['model'],qs['fields'](_0x2a72ab[_0xb26a('0x34')]['fields']));_0x36fbb7[_0xb26a('0x37')]=_0x36fbb7[_0xb26a('0x37')][_0xb26a('0x39')]?_0x36fbb7[_0xb26a('0x37')]:_0x2f1539[_0xb26a('0x31')];_0x36fbb7['order']=qs[_0xb26a('0x4d')](_0x2a72ab[_0xb26a('0x34')][_0xb26a('0x4d')]);_0x36fbb7[_0xb26a('0x3d')]=qs[_0xb26a('0x35')](_[_0xb26a('0x3e')](_0x2a72ab[_0xb26a('0x34')],_0x2f1539[_0xb26a('0x35')]));if(_0x2a72ab[_0xb26a('0x34')][_0xb26a('0x3f')]){_0x36fbb7[_0xb26a('0x3d')]=_[_0xb26a('0x40')](_0x36fbb7[_0xb26a('0x3d')],{'$or':_[_0xb26a('0x32')](_0x36fbb7['attributes'],function(_0x3007d7){var _0x5d2050={};_0x5d2050[_0x3007d7]={'$like':'%'+_0x2a72ab[_0xb26a('0x34')][_0xb26a('0x3f')]+'%'};return _0x5d2050;})});}_0x36fbb7=_[_0xb26a('0x40')]({},_0x36fbb7,_0x2a72ab[_0xb26a('0x42')]);return _0x1262c9[_0xb26a('0x52')](_0x36fbb7);}})[_0xb26a('0x27')](function(_0x287875){if(_0x287875){_0x35e72f=_0x287875[_0xb26a('0x39')];if(!_0x2a72ab[_0xb26a('0x34')]['hasOwnProperty'](_0xb26a('0x3b'))){_0x36fbb7[_0xb26a('0x20')]=qs['limit'](_0x2a72ab['query'][_0xb26a('0x20')]);_0x36fbb7[_0xb26a('0x1e')]=qs[_0xb26a('0x1e')](_0x2a72ab[_0xb26a('0x34')][_0xb26a('0x1e')]);}return _0x1262c9[_0xb26a('0x52')](_0x36fbb7);}})['then'](function(_0x4218ed){if(_0x4218ed){return _0x4218ed?{'count':_0x35e72f,'rows':_0x4218ed}:null;}})[_0xb26a('0x27')](respondWithResult(_0x1171bc,null))[_0xb26a('0x48')](handleError(_0x1171bc,null));};exports[_0xb26a('0x53')]=function(_0x3e3d2b,_0x2bd54e,_0x400ca8){if(_0x3e3d2b[_0xb26a('0x4a')]['id']){delete _0x3e3d2b[_0xb26a('0x4a')]['id'];}return db[_0xb26a('0x2d')][_0xb26a('0x4b')]({'where':{'id':_0x3e3d2b[_0xb26a('0x46')]['id']}})['then'](handleEntityNotFound(_0x2bd54e,null))[_0xb26a('0x27')](function(_0x5dcc46){if(_0x5dcc46){return _0x5dcc46['setTags'](_0x3e3d2b[_0xb26a('0x4a')]['ids']||[]);}return null;})[_0xb26a('0x27')](respondWithResult(_0x2bd54e,null))[_0xb26a('0x48')](handleError(_0x2bd54e,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 6ebc9d1..61416b3 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 _0x0972=['util','api','bluebird','request-promise','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','int_zendesk_configurations'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x0972,0x64));var _0x2097=function(_0x3462b6,_0x215c99){_0x3462b6=_0x3462b6-0x0;var _0x766bfd=_0x0972[_0x3462b6];return _0x766bfd;};'use strict';var _=require('lodash');var util=require(_0x2097('0x0'));var logger=require('../../config/logger')(_0x2097('0x1'));var moment=require('moment');var BPromise=require(_0x2097('0x2'));var rp=require(_0x2097('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var attributes=require(_0x2097('0x6'));module[_0x2097('0x7')]=function(_0x2f84d8,_0x11ed13){return _0x2f84d8[_0x2097('0x8')]('ZendeskConfiguration',attributes,{'tableName':_0x2097('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x896e=['request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x189e5b,_0x241e68){var _0x131846=function(_0x386533){while(--_0x386533){_0x189e5b['push'](_0x189e5b['shift']());}};_0x131846(++_0x241e68);}(_0x896e,0x1e9));var _0xe896=function(_0x6f6adf,_0x421450){_0x6f6adf=_0x6f6adf-0x0;var _0x12fa23=_0x896e[_0x6f6adf];return _0x12fa23;};'use strict';var _=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var logger=require(_0xe896('0x2'))(_0xe896('0x3'));var moment=require(_0xe896('0x4'));var BPromise=require(_0xe896('0x5'));var rp=require(_0xe896('0x6'));var fs=require('fs');var path=require(_0xe896('0x7'));var rimraf=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var attributes=require(_0xe896('0xa'));module[_0xe896('0xb')]=function(_0x52ac80,_0x24c430){return _0x52ac80[_0xe896('0xc')](_0xe896('0xd'),attributes,{'tableName':_0xe896('0xe'),'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 2204a8d..c29d385 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 _0x2923=['error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x1b7ab7,_0x234fdb){var _0x5b4564=function(_0x2b53f1){while(--_0x2b53f1){_0x1b7ab7['push'](_0x1b7ab7['shift']());}};_0x5b4564(++_0x234fdb);}(_0x2923,0x155));var _0x3292=function(_0x4e927e,_0x1ecc9f){_0x4e927e=_0x4e927e-0x0;var _0x2d5953=_0x2923[_0x4e927e];return _0x2d5953;};'use strict';var _=require(_0x3292('0x0'));var util=require('util');var moment=require(_0x3292('0x1'));var BPromise=require(_0x3292('0x2'));var rs=require(_0x3292('0x3'));var fs=require('fs');var Redis=require(_0x3292('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3292('0x5'));var logger=require(_0x3292('0x6'))(_0x3292('0x7'));var config=require(_0x3292('0x8'));var jayson=require(_0x3292('0x9'));var client=jayson[_0x3292('0xa')][_0x3292('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c5442,_0x46ee5a,_0x25f494){return new BPromise(function(_0x29a949,_0x152d16){return client[_0x3292('0xc')](_0x1c5442,_0x25f494)[_0x3292('0xd')](function(_0x9a050){logger[_0x3292('0xe')](_0x3292('0xf'),_0x46ee5a,'request\x20sent');logger[_0x3292('0x10')](_0x3292('0x11'),_0x46ee5a,_0x3292('0x12'),JSON['stringify'](_0x9a050));if(_0x9a050[_0x3292('0x13')]){if(_0x9a050['error'][_0x3292('0x14')]===0x1f4){logger[_0x3292('0x13')](_0x3292('0xf'),_0x46ee5a,_0x9a050['error']['message']);return _0x152d16(_0x9a050[_0x3292('0x13')][_0x3292('0x15')]);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x46ee5a,_0x9a050[_0x3292('0x13')][_0x3292('0x15')]);return _0x29a949(_0x9a050[_0x3292('0x13')][_0x3292('0x15')]);}else{logger[_0x3292('0xe')](_0x3292('0xf'),_0x46ee5a,'request\x20sent');_0x29a949(_0x9a050[_0x3292('0x16')][_0x3292('0x15')]);}})[_0x3292('0x17')](function(_0x88ffaf){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x46ee5a,_0x88ffaf);_0x152d16(_0x88ffaf);});});} \ No newline at end of file +var _0x33d9=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x314de1,_0x50c4f0){var _0x231441=function(_0x2f30be){while(--_0x2f30be){_0x314de1['push'](_0x314de1['shift']());}};_0x231441(++_0x50c4f0);}(_0x33d9,0x18a));var _0x933d=function(_0x22d26b,_0x361d36){_0x22d26b=_0x22d26b-0x0;var _0x398a48=_0x33d9[_0x22d26b];return _0x398a48;};'use strict';var _=require('lodash');var util=require(_0x933d('0x0'));var moment=require(_0x933d('0x1'));var BPromise=require(_0x933d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x933d('0x3'));var db=require(_0x933d('0x4'))['db'];var utils=require(_0x933d('0x5'));var logger=require(_0x933d('0x6'))(_0x933d('0x7'));var config=require(_0x933d('0x8'));var jayson=require(_0x933d('0x9'));var client=jayson[_0x933d('0xa')][_0x933d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3544bb,_0x2858b1,_0x3c11f9){return new BPromise(function(_0x123a1d,_0x6017d8){return client[_0x933d('0xc')](_0x3544bb,_0x3c11f9)['then'](function(_0xc0d30b){logger['info'](_0x933d('0xd'),_0x2858b1,_0x933d('0xe'));logger[_0x933d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2858b1,'request\x20sent',JSON['stringify'](_0xc0d30b));if(_0xc0d30b[_0x933d('0x10')]){if(_0xc0d30b[_0x933d('0x10')][_0x933d('0x11')]===0x1f4){logger[_0x933d('0x10')](_0x933d('0xd'),_0x2858b1,_0xc0d30b[_0x933d('0x10')]['message']);return _0x6017d8(_0xc0d30b[_0x933d('0x10')][_0x933d('0x12')]);}logger[_0x933d('0x10')](_0x933d('0xd'),_0x2858b1,_0xc0d30b[_0x933d('0x10')][_0x933d('0x12')]);return _0x123a1d(_0xc0d30b[_0x933d('0x10')][_0x933d('0x12')]);}else{logger[_0x933d('0x13')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2858b1,_0x933d('0xe'));_0x123a1d(_0xc0d30b['result'][_0x933d('0x12')]);}})[_0x933d('0x14')](function(_0x584033){logger[_0x933d('0x10')](_0x933d('0xd'),_0x2858b1,_0x584033);_0x6017d8(_0x584033);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 206d3fa..acb35f4 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 _0xea3c=['exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id','post','create','update'];(function(_0x171ce6,_0x160d7b){var _0x5d070a=function(_0x2c2e54){while(--_0x2c2e54){_0x171ce6['push'](_0x171ce6['shift']());}};_0x5d070a(++_0x160d7b);}(_0xea3c,0xef));var _0xcea3=function(_0x1f46c0,_0x1148b0){_0x1f46c0=_0x1f46c0-0x0;var _0x34d79d=_0xea3c[_0x1f46c0];return _0x34d79d;};'use strict';var multer=require('multer');var util=require(_0xcea3('0x0'));var path=require(_0xcea3('0x1'));var timeout=require(_0xcea3('0x2'));var express=require(_0xcea3('0x3'));var router=express['Router']();var fs_extra=require(_0xcea3('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcea3('0x5'));var config=require('../../config/environment');var controller=require('./intZendeskField.controller');router['get']('/',auth[_0xcea3('0x6')](),controller[_0xcea3('0x7')]);router[_0xcea3('0x8')](_0xcea3('0x9'),auth[_0xcea3('0x6')](),controller['show']);router[_0xcea3('0xa')]('/',auth[_0xcea3('0x6')](),controller[_0xcea3('0xb')]);router['put'](_0xcea3('0x9'),auth['isAuthenticated'](),controller[_0xcea3('0xc')]);router['delete'](_0xcea3('0x9'),auth[_0xcea3('0x6')](),controller['destroy']);module[_0xcea3('0xd')]=router; \ No newline at end of file +var _0x7043=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','fs-extra'];(function(_0x57641a,_0x303962){var _0x212754=function(_0x162e34){while(--_0x162e34){_0x57641a['push'](_0x57641a['shift']());}};_0x212754(++_0x303962);}(_0x7043,0xc2));var _0x3704=function(_0x53153d,_0x314886){_0x53153d=_0x53153d-0x0;var _0x1cce3a=_0x7043[_0x53153d];return _0x1cce3a;};'use strict';var multer=require(_0x3704('0x0'));var util=require(_0x3704('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3704('0x2'));var router=express['Router']();var fs_extra=require(_0x3704('0x3'));var auth=require(_0x3704('0x4'));var interaction=require(_0x3704('0x5'));var config=require(_0x3704('0x6'));var controller=require(_0x3704('0x7'));router[_0x3704('0x8')]('/',auth[_0x3704('0x9')](),controller['index']);router[_0x3704('0x8')](_0x3704('0xa'),auth['isAuthenticated'](),controller[_0x3704('0xb')]);router[_0x3704('0xc')]('/',auth['isAuthenticated'](),controller[_0x3704('0xd')]);router['put']('/:id',auth[_0x3704('0x9')](),controller[_0x3704('0xe')]);router[_0x3704('0xf')](_0x3704('0xa'),auth['isAuthenticated'](),controller[_0x3704('0x10')]);module[_0x3704('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index c646c68..5cc7524 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 _0x2cdb=['sequelize','picklist','string','STRING','customVariable','BOOLEAN'];(function(_0x33e3c8,_0x127edd){var _0x1d0431=function(_0x586d6b){while(--_0x586d6b){_0x33e3c8['push'](_0x33e3c8['shift']());}};_0x1d0431(++_0x127edd);}(_0x2cdb,0x114));var _0xb2cd=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2cdb[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require(_0xb2cd('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string','variable','customVariable','keyValue',_0xb2cd('0x1')),'defaultValue':_0xb2cd('0x2')},'content':{'type':Sequelize[_0xb2cd('0x3')]},'key':{'type':Sequelize[_0xb2cd('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0xb2cd('0x2'),'variable',_0xb2cd('0x4'))},'keyContent':{'type':Sequelize[_0xb2cd('0x3')]},'idField':{'type':Sequelize[_0xb2cd('0x3')]},'nameField':{'type':Sequelize[_0xb2cd('0x3')]},'customField':{'type':Sequelize[_0xb2cd('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb2cd('0x3')]}}; \ No newline at end of file +var _0x572f=['keyValue','picklist','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string','variable'];(function(_0x3ac8c9,_0x353ea9){var _0x5ee2d1=function(_0x26742c){while(--_0x26742c){_0x3ac8c9['push'](_0x3ac8c9['shift']());}};_0x5ee2d1(++_0x353ea9);}(_0x572f,0x131));var _0xf572=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x572f[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require(_0xf572('0x0'));module[_0xf572('0x1')]={'type':{'type':Sequelize[_0xf572('0x2')](_0xf572('0x3'),_0xf572('0x4'),'customVariable',_0xf572('0x5'),_0xf572('0x6')),'defaultValue':_0xf572('0x3')},'content':{'type':Sequelize[_0xf572('0x7')]},'key':{'type':Sequelize[_0xf572('0x7')]},'keyType':{'type':Sequelize[_0xf572('0x2')](_0xf572('0x3'),_0xf572('0x4'),_0xf572('0x8'))},'keyContent':{'type':Sequelize[_0xf572('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xf572('0x7')]},'customField':{'type':Sequelize[_0xf572('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf572('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 14007af..640daf0 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 _0x587a=['rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','catch','params','length','merge','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','apply','save','then','end','sendStatus','error','stack','name','index','map','ZendeskField'];(function(_0x459f52,_0x27736d){var _0xe685b0=function(_0x1f416b){while(--_0x1f416b){_0x459f52['push'](_0x459f52['shift']());}};_0xe685b0(++_0x27736d);}(_0x587a,0x18b));var _0xa587=function(_0x5e81ea,_0x2c6893){_0x5e81ea=_0x5e81ea-0x0;var _0x4c19ed=_0x587a[_0x5e81ea];return _0x4c19ed;};'use strict';var emlformat=require(_0xa587('0x0'));var rimraf=require(_0xa587('0x1'));var zipdir=require(_0xa587('0x2'));var jsonpatch=require(_0xa587('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa587('0x4'));var Mustache=require(_0xa587('0x5'));var util=require(_0xa587('0x6'));var path=require(_0xa587('0x7'));var sox=require('sox');var csv=require(_0xa587('0x8'));var ejs=require(_0xa587('0x9'));var fs=require('fs');var fs_extra=require(_0xa587('0xa'));var _=require(_0xa587('0xb'));var squel=require(_0xa587('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa587('0xd'));var toCsv=require(_0xa587('0x8'));var querystring=require(_0xa587('0xe'));var Papa=require(_0xa587('0xf'));var Redis=require(_0xa587('0x10'));var authService=require(_0xa587('0x11'));var qs=require(_0xa587('0x12'));var as=require(_0xa587('0x13'));var hardwareService=require(_0xa587('0x14'));var logger=require(_0xa587('0x15'))('api');var utils=require(_0xa587('0x16'));var config=require(_0xa587('0x17'));var licenseUtil=require(_0xa587('0x18'));var db=require(_0xa587('0x19'))['db'];function respondWithStatusCode(_0x5d7ef9,_0x1ba31a){_0x1ba31a=_0x1ba31a||0xcc;return function(_0x616276){if(_0x616276){return _0x5d7ef9['sendStatus'](_0x1ba31a);}return _0x5d7ef9['status'](_0x1ba31a)['end']();};}function respondWithResult(_0x58fd50,_0x22b5d2){_0x22b5d2=_0x22b5d2||0xc8;return function(_0x4780db){if(_0x4780db){return _0x58fd50[_0xa587('0x1a')](_0x22b5d2)[_0xa587('0x1b')](_0x4780db);}};}function respondWithFilteredResult(_0x425cee,_0x54d3bc){return function(_0x469cc1){if(_0x469cc1){var _0x1634e9=typeof _0x54d3bc[_0xa587('0x1c')]===_0xa587('0x1d')&&typeof _0x54d3bc[_0xa587('0x1e')]===_0xa587('0x1d');var _0x57967e=_0x469cc1[_0xa587('0x1f')];var _0x1e0fad=_0x1634e9?0x0:_0x54d3bc[_0xa587('0x1c')];var _0x500803=_0x1634e9?_0x469cc1[_0xa587('0x1f')]:_0x54d3bc[_0xa587('0x1c')]+_0x54d3bc['limit'];var _0x188a8c;if(_0x500803>=_0x57967e){_0x500803=_0x57967e;_0x188a8c=0xc8;}else{_0x188a8c=0xce;}_0x425cee[_0xa587('0x1a')](_0x188a8c);return _0x425cee['set']('Content-Range',_0x1e0fad+'-'+_0x500803+'/'+_0x57967e)[_0xa587('0x1b')](_0x469cc1);}return null;};}function patchUpdates(_0x61835b){return function(_0x50eb24){try{jsonpatch[_0xa587('0x20')](_0x50eb24,_0x61835b,!![]);}catch(_0xd4d4ed){return BPromise['reject'](_0xd4d4ed);}return _0x50eb24[_0xa587('0x21')]();};}function saveUpdates(_0x97cb1,_0x3a8a14){return function(_0x1d4741){if(_0x1d4741){return _0x1d4741['update'](_0x97cb1)[_0xa587('0x22')](function(_0x2de469){return _0x2de469;});}return null;};}function removeEntity(_0x4abca3,_0x18fef3){return function(_0x40e4bc){if(_0x40e4bc){return _0x40e4bc['destroy']()[_0xa587('0x22')](function(){_0x4abca3['status'](0xcc)[_0xa587('0x23')]();});}};}function handleEntityNotFound(_0x5e3a78,_0xfc03bd){return function(_0x2d104f){if(!_0x2d104f){_0x5e3a78[_0xa587('0x24')](0x194);}return _0x2d104f;};}function handleError(_0x3e1eda,_0x1a3a1d){_0x1a3a1d=_0x1a3a1d||0x1f4;return function(_0x4b52d8){logger[_0xa587('0x25')](_0x4b52d8[_0xa587('0x26')]);if(_0x4b52d8['name']){delete _0x4b52d8[_0xa587('0x27')];}_0x3e1eda[_0xa587('0x1a')](_0x1a3a1d)['send'](_0x4b52d8);};}exports[_0xa587('0x28')]=function(_0x20729e,_0x547eeb){var _0x110623={},_0x5a2304={},_0x5d27d1={'count':0x0,'rows':[]};var _0x42b370=_[_0xa587('0x29')](db[_0xa587('0x2a')][_0xa587('0x2b')],function(_0x5068ee){return{'name':_0x5068ee[_0xa587('0x2c')],'type':_0x5068ee['type']['key']};});_0x5a2304[_0xa587('0x2d')]=_[_0xa587('0x29')](_0x42b370,'name');_0x5a2304[_0xa587('0x2e')]=_[_0xa587('0x2f')](_0x20729e[_0xa587('0x2e')]);_0x5a2304[_0xa587('0x30')]=_[_0xa587('0x31')](_0x5a2304['model'],_0x5a2304['query']);_0x110623[_0xa587('0x32')]=_[_0xa587('0x31')](_0x5a2304[_0xa587('0x2d')],qs[_0xa587('0x33')](_0x20729e[_0xa587('0x2e')][_0xa587('0x33')]));_0x110623[_0xa587('0x32')]=_0x110623[_0xa587('0x32')]['length']?_0x110623[_0xa587('0x32')]:_0x5a2304[_0xa587('0x2d')];if(!_0x20729e['query'][_0xa587('0x34')](_0xa587('0x35'))){_0x110623['limit']=qs[_0xa587('0x1e')](_0x20729e[_0xa587('0x2e')][_0xa587('0x1e')]);_0x110623[_0xa587('0x1c')]=qs[_0xa587('0x1c')](_0x20729e[_0xa587('0x2e')][_0xa587('0x1c')]);}_0x110623[_0xa587('0x36')]=qs[_0xa587('0x37')](_0x20729e['query'][_0xa587('0x37')]);_0x110623[_0xa587('0x38')]=qs['filters'](_[_0xa587('0x39')](_0x20729e[_0xa587('0x2e')],_0x5a2304['filters']),_0x42b370);if(_0x20729e[_0xa587('0x2e')][_0xa587('0x3a')]){_0x110623[_0xa587('0x38')]=_['merge'](_0x110623['where'],{'$or':_[_0xa587('0x29')](_0x42b370,function(_0x17f8bb){if(_0x17f8bb[_0xa587('0x3b')]!==_0xa587('0x3c')){var _0x3f1ad5={};_0x3f1ad5[_0x17f8bb[_0xa587('0x27')]]={'$like':'%'+_0x20729e[_0xa587('0x2e')][_0xa587('0x3a')]+'%'};return _0x3f1ad5;}})});}_0x110623=_['merge']({},_0x110623,_0x20729e[_0xa587('0x3d')]);var _0x122957={'where':_0x110623[_0xa587('0x38')]};return db[_0xa587('0x2a')][_0xa587('0x1f')](_0x122957)[_0xa587('0x22')](function(_0x1982d9){_0x5d27d1['count']=_0x1982d9;if(_0x20729e[_0xa587('0x2e')][_0xa587('0x3e')]){_0x110623[_0xa587('0x3f')]=[{'all':!![]}];}return db[_0xa587('0x2a')][_0xa587('0x40')](_0x110623);})[_0xa587('0x22')](function(_0xff059a){_0x5d27d1['rows']=_0xff059a;return _0x5d27d1;})[_0xa587('0x22')](respondWithFilteredResult(_0x547eeb,_0x110623))[_0xa587('0x41')](handleError(_0x547eeb,null));};exports['show']=function(_0x580869,_0x2ecee6){var _0x4f7a2b={'raw':!![],'where':{'id':_0x580869[_0xa587('0x42')]['id']}},_0x5a3efa={};_0x5a3efa[_0xa587('0x2d')]=_[_0xa587('0x2f')](db['ZendeskField']['rawAttributes']);_0x5a3efa[_0xa587('0x2e')]=_['keys'](_0x580869[_0xa587('0x2e')]);_0x5a3efa[_0xa587('0x30')]=_[_0xa587('0x31')](_0x5a3efa[_0xa587('0x2d')],_0x5a3efa[_0xa587('0x2e')]);_0x4f7a2b[_0xa587('0x32')]=_['intersection'](_0x5a3efa['model'],qs[_0xa587('0x33')](_0x580869[_0xa587('0x2e')]['fields']));_0x4f7a2b[_0xa587('0x32')]=_0x4f7a2b[_0xa587('0x32')][_0xa587('0x43')]?_0x4f7a2b[_0xa587('0x32')]:_0x5a3efa[_0xa587('0x2d')];if(_0x580869[_0xa587('0x2e')][_0xa587('0x3e')]){_0x4f7a2b[_0xa587('0x3f')]=[{'all':!![]}];}_0x4f7a2b=_[_0xa587('0x44')]({},_0x4f7a2b,_0x580869[_0xa587('0x3d')]);return db['ZendeskField'][_0xa587('0x45')](_0x4f7a2b)[_0xa587('0x22')](handleEntityNotFound(_0x2ecee6,null))[_0xa587('0x22')](respondWithResult(_0x2ecee6,null))[_0xa587('0x41')](handleError(_0x2ecee6,null));};exports[_0xa587('0x46')]=function(_0xdbe5a1,_0x451f33){return db[_0xa587('0x2a')]['create'](_0xdbe5a1[_0xa587('0x47')],{})[_0xa587('0x22')](respondWithResult(_0x451f33,0xc9))[_0xa587('0x41')](handleError(_0x451f33,null));};exports['update']=function(_0x400f7b,_0x524369){if(_0x400f7b[_0xa587('0x47')]['id']){delete _0x400f7b[_0xa587('0x47')]['id'];}return db[_0xa587('0x2a')][_0xa587('0x45')]({'where':{'id':_0x400f7b['params']['id']}})[_0xa587('0x22')](handleEntityNotFound(_0x524369,null))[_0xa587('0x22')](saveUpdates(_0x400f7b['body'],null))[_0xa587('0x22')](respondWithResult(_0x524369,null))[_0xa587('0x41')](handleError(_0x524369,null));};exports[_0xa587('0x48')]=function(_0x1c97ca,_0x5d9238){return db[_0xa587('0x2a')][_0xa587('0x45')]({'where':{'id':_0x1c97ca[_0xa587('0x42')]['id']}})[_0xa587('0x22')](handleEntityNotFound(_0x5d9238,null))[_0xa587('0x22')](removeEntity(_0x5d9238,null))[_0xa587('0x41')](handleError(_0x5d9238,null));}; \ No newline at end of file +var _0x0c08=['squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','reject','update','error','send','index','map','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','ZendeskField','then','includeAll','include','rows','show','params','keys','find','catch','body','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash'];(function(_0x3d764d,_0x57f964){var _0x22999d=function(_0x3b7e08){while(--_0x3b7e08){_0x3d764d['push'](_0x3d764d['shift']());}};_0x22999d(++_0x57f964);}(_0x0c08,0x1e6));var _0x80c0=function(_0x45d5ef,_0x10c29b){_0x45d5ef=_0x45d5ef-0x0;var _0x474d19=_0x0c08[_0x45d5ef];return _0x474d19;};'use strict';var emlformat=require(_0x80c0('0x0'));var rimraf=require(_0x80c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x80c0('0x2'));var rp=require(_0x80c0('0x3'));var moment=require(_0x80c0('0x4'));var BPromise=require(_0x80c0('0x5'));var Mustache=require(_0x80c0('0x6'));var util=require('util');var path=require(_0x80c0('0x7'));var sox=require('sox');var csv=require(_0x80c0('0x8'));var ejs=require(_0x80c0('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x80c0('0xa'));var squel=require(_0x80c0('0xb'));var crypto=require(_0x80c0('0xc'));var jsforce=require(_0x80c0('0xd'));var deskjs=require(_0x80c0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x80c0('0xf'));var Redis=require(_0x80c0('0x10'));var authService=require(_0x80c0('0x11'));var qs=require(_0x80c0('0x12'));var as=require(_0x80c0('0x13'));var hardwareService=require(_0x80c0('0x14'));var logger=require('../../config/logger')(_0x80c0('0x15'));var utils=require(_0x80c0('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x80c0('0x17'))['db'];function respondWithStatusCode(_0x4f4ea1,_0x58d30a){_0x58d30a=_0x58d30a||0xcc;return function(_0x4ad164){if(_0x4ad164){return _0x4f4ea1[_0x80c0('0x18')](_0x58d30a);}return _0x4f4ea1[_0x80c0('0x19')](_0x58d30a)[_0x80c0('0x1a')]();};}function respondWithResult(_0x364692,_0x13c438){_0x13c438=_0x13c438||0xc8;return function(_0xbc152a){if(_0xbc152a){return _0x364692[_0x80c0('0x19')](_0x13c438)[_0x80c0('0x1b')](_0xbc152a);}};}function respondWithFilteredResult(_0x157fb1,_0x21f761){return function(_0x57bbf7){if(_0x57bbf7){var _0x169701=typeof _0x21f761['offset']===_0x80c0('0x1c')&&typeof _0x21f761[_0x80c0('0x1d')]===_0x80c0('0x1c');var _0x204eb6=_0x57bbf7['count'];var _0x230e77=_0x169701?0x0:_0x21f761[_0x80c0('0x1e')];var _0x4e05a5=_0x169701?_0x57bbf7[_0x80c0('0x1f')]:_0x21f761[_0x80c0('0x1e')]+_0x21f761['limit'];var _0x5163bf;if(_0x4e05a5>=_0x204eb6){_0x4e05a5=_0x204eb6;_0x5163bf=0xc8;}else{_0x5163bf=0xce;}_0x157fb1[_0x80c0('0x19')](_0x5163bf);return _0x157fb1[_0x80c0('0x20')](_0x80c0('0x21'),_0x230e77+'-'+_0x4e05a5+'/'+_0x204eb6)[_0x80c0('0x1b')](_0x57bbf7);}return null;};}function patchUpdates(_0x3aca93){return function(_0x120382){try{jsonpatch['apply'](_0x120382,_0x3aca93,!![]);}catch(_0x20f480){return BPromise[_0x80c0('0x22')](_0x20f480);}return _0x120382['save']();};}function saveUpdates(_0x1ba08f,_0x2f9a73){return function(_0x4879f3){if(_0x4879f3){return _0x4879f3[_0x80c0('0x23')](_0x1ba08f)['then'](function(_0x147cee){return _0x147cee;});}return null;};}function removeEntity(_0x4766f5,_0x51ac53){return function(_0x58bd36){if(_0x58bd36){return _0x58bd36['destroy']()['then'](function(){_0x4766f5[_0x80c0('0x19')](0xcc)[_0x80c0('0x1a')]();});}};}function handleEntityNotFound(_0x588660,_0x2e7c0b){return function(_0x4851aa){if(!_0x4851aa){_0x588660[_0x80c0('0x18')](0x194);}return _0x4851aa;};}function handleError(_0x32350d,_0x38f9f2){_0x38f9f2=_0x38f9f2||0x1f4;return function(_0x2e63ed){logger[_0x80c0('0x24')](_0x2e63ed['stack']);if(_0x2e63ed['name']){delete _0x2e63ed['name'];}_0x32350d[_0x80c0('0x19')](_0x38f9f2)[_0x80c0('0x25')](_0x2e63ed);};}exports[_0x80c0('0x26')]=function(_0x291fed,_0x54af31){var _0x12a780={},_0x581adc={},_0x531c46={'count':0x0,'rows':[]};var _0x1d6293=_[_0x80c0('0x27')](db['ZendeskField'][_0x80c0('0x28')],function(_0x114058){return{'name':_0x114058[_0x80c0('0x29')],'type':_0x114058['type']['key']};});_0x581adc[_0x80c0('0x2a')]=_[_0x80c0('0x27')](_0x1d6293,_0x80c0('0x2b'));_0x581adc[_0x80c0('0x2c')]=_['keys'](_0x291fed['query']);_0x581adc[_0x80c0('0x2d')]=_[_0x80c0('0x2e')](_0x581adc[_0x80c0('0x2a')],_0x581adc['query']);_0x12a780[_0x80c0('0x2f')]=_[_0x80c0('0x2e')](_0x581adc[_0x80c0('0x2a')],qs[_0x80c0('0x30')](_0x291fed[_0x80c0('0x2c')][_0x80c0('0x30')]));_0x12a780[_0x80c0('0x2f')]=_0x12a780[_0x80c0('0x2f')][_0x80c0('0x31')]?_0x12a780[_0x80c0('0x2f')]:_0x581adc['model'];if(!_0x291fed['query'][_0x80c0('0x32')](_0x80c0('0x33'))){_0x12a780[_0x80c0('0x1d')]=qs['limit'](_0x291fed[_0x80c0('0x2c')]['limit']);_0x12a780[_0x80c0('0x1e')]=qs[_0x80c0('0x1e')](_0x291fed[_0x80c0('0x2c')]['offset']);}_0x12a780['order']=qs[_0x80c0('0x34')](_0x291fed['query'][_0x80c0('0x34')]);_0x12a780['where']=qs[_0x80c0('0x2d')](_[_0x80c0('0x35')](_0x291fed[_0x80c0('0x2c')],_0x581adc[_0x80c0('0x2d')]),_0x1d6293);if(_0x291fed[_0x80c0('0x2c')][_0x80c0('0x36')]){_0x12a780[_0x80c0('0x37')]=_[_0x80c0('0x38')](_0x12a780['where'],{'$or':_['map'](_0x1d6293,function(_0x32d1fc){if(_0x32d1fc[_0x80c0('0x39')]!==_0x80c0('0x3a')){var _0x117b43={};_0x117b43[_0x32d1fc[_0x80c0('0x2b')]]={'$like':'%'+_0x291fed[_0x80c0('0x2c')]['filter']+'%'};return _0x117b43;}})});}_0x12a780=_[_0x80c0('0x38')]({},_0x12a780,_0x291fed['options']);var _0x400785={'where':_0x12a780[_0x80c0('0x37')]};return db[_0x80c0('0x3b')][_0x80c0('0x1f')](_0x400785)[_0x80c0('0x3c')](function(_0x4884a4){_0x531c46[_0x80c0('0x1f')]=_0x4884a4;if(_0x291fed[_0x80c0('0x2c')][_0x80c0('0x3d')]){_0x12a780[_0x80c0('0x3e')]=[{'all':!![]}];}return db[_0x80c0('0x3b')]['findAll'](_0x12a780);})['then'](function(_0x44826d){_0x531c46[_0x80c0('0x3f')]=_0x44826d;return _0x531c46;})[_0x80c0('0x3c')](respondWithFilteredResult(_0x54af31,_0x12a780))['catch'](handleError(_0x54af31,null));};exports[_0x80c0('0x40')]=function(_0x1f8af7,_0x206b41){var _0x5ccee1={'raw':!![],'where':{'id':_0x1f8af7[_0x80c0('0x41')]['id']}},_0x195110={};_0x195110['model']=_['keys'](db[_0x80c0('0x3b')][_0x80c0('0x28')]);_0x195110[_0x80c0('0x2c')]=_[_0x80c0('0x42')](_0x1f8af7[_0x80c0('0x2c')]);_0x195110['filters']=_['intersection'](_0x195110[_0x80c0('0x2a')],_0x195110[_0x80c0('0x2c')]);_0x5ccee1[_0x80c0('0x2f')]=_[_0x80c0('0x2e')](_0x195110['model'],qs['fields'](_0x1f8af7[_0x80c0('0x2c')]['fields']));_0x5ccee1[_0x80c0('0x2f')]=_0x5ccee1[_0x80c0('0x2f')][_0x80c0('0x31')]?_0x5ccee1[_0x80c0('0x2f')]:_0x195110['model'];if(_0x1f8af7[_0x80c0('0x2c')][_0x80c0('0x3d')]){_0x5ccee1['include']=[{'all':!![]}];}_0x5ccee1=_['merge']({},_0x5ccee1,_0x1f8af7['options']);return db[_0x80c0('0x3b')][_0x80c0('0x43')](_0x5ccee1)[_0x80c0('0x3c')](handleEntityNotFound(_0x206b41,null))['then'](respondWithResult(_0x206b41,null))[_0x80c0('0x44')](handleError(_0x206b41,null));};exports['create']=function(_0x27094f,_0x2c296f){return db['ZendeskField']['create'](_0x27094f[_0x80c0('0x45')],{})['then'](respondWithResult(_0x2c296f,0xc9))[_0x80c0('0x44')](handleError(_0x2c296f,null));};exports['update']=function(_0x31c058,_0x26e729){if(_0x31c058[_0x80c0('0x45')]['id']){delete _0x31c058['body']['id'];}return db[_0x80c0('0x3b')][_0x80c0('0x43')]({'where':{'id':_0x31c058[_0x80c0('0x41')]['id']}})[_0x80c0('0x3c')](handleEntityNotFound(_0x26e729,null))[_0x80c0('0x3c')](saveUpdates(_0x31c058[_0x80c0('0x45')],null))[_0x80c0('0x3c')](respondWithResult(_0x26e729,null))[_0x80c0('0x44')](handleError(_0x26e729,null));};exports[_0x80c0('0x46')]=function(_0x38479d,_0x44af76){return db[_0x80c0('0x3b')][_0x80c0('0x43')]({'where':{'id':_0x38479d[_0x80c0('0x41')]['id']}})[_0x80c0('0x3c')](handleEntityNotFound(_0x44af76,null))[_0x80c0('0x3c')](removeEntity(_0x44af76,null))[_0x80c0('0x44')](handleError(_0x44af76,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index cf42beb..6152ef7 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 _0x08e8=['path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','lodash','util','api','bluebird','request-promise'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x08e8,0x14d));var _0x808e=function(_0xe12930,_0x15101c){_0xe12930=_0xe12930-0x0;var _0x3aa3aa=_0x08e8[_0xe12930];return _0x3aa3aa;};'use strict';var _=require(_0x808e('0x0'));var util=require(_0x808e('0x1'));var logger=require('../../config/logger')(_0x808e('0x2'));var moment=require('moment');var BPromise=require(_0x808e('0x3'));var rp=require(_0x808e('0x4'));var fs=require('fs');var path=require(_0x808e('0x5'));var rimraf=require('rimraf');var config=require(_0x808e('0x6'));var attributes=require(_0x808e('0x7'));module[_0x808e('0x8')]=function(_0x1176a3,_0x51576a){return _0x1176a3[_0x808e('0x9')](_0x808e('0xa'),attributes,{'tableName':_0x808e('0xb'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x808e('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8bff=['FieldId','util','../../config/logger','api','bluebird','path','../../config/environment','./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index'];(function(_0x5a799d,_0x20e981){var _0x1388b5=function(_0x34fccc){while(--_0x34fccc){_0x5a799d['push'](_0x5a799d['shift']());}};_0x1388b5(++_0x20e981);}(_0x8bff,0xf3));var _0xf8bf=function(_0x3fa56e,_0x41f4dd){_0x3fa56e=_0x3fa56e-0x0;var _0x580a15=_0x8bff[_0x3fa56e];return _0x580a15;};'use strict';var _=require('lodash');var util=require(_0xf8bf('0x0'));var logger=require(_0xf8bf('0x1'))(_0xf8bf('0x2'));var moment=require('moment');var BPromise=require(_0xf8bf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8bf('0x4'));var rimraf=require('rimraf');var config=require(_0xf8bf('0x5'));var attributes=require(_0xf8bf('0x6'));module['exports']=function(_0x1e3ec1,_0x1e02d7){return _0x1e3ec1[_0xf8bf('0x7')]('ZendeskField',attributes,{'tableName':_0xf8bf('0x8'),'paranoid':![],'indexes':[{'name':_0xf8bf('0x9'),'fields':['idField',_0xf8bf('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index 384e202..0c49e19 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 _0xed41=['request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','ZendeskField,\x20%s,\x20%s'];(function(_0x2984d0,_0x1a7211){var _0x2885f2=function(_0x42f3da){while(--_0x42f3da){_0x2984d0['push'](_0x2984d0['shift']());}};_0x2885f2(++_0x1a7211);}(_0xed41,0x11f));var _0x1ed4=function(_0x169463,_0x506407){_0x169463=_0x169463-0x0;var _0x1a12f4=_0xed41[_0x169463];return _0x1a12f4;};'use strict';var _=require(_0x1ed4('0x0'));var util=require(_0x1ed4('0x1'));var moment=require('moment');var BPromise=require(_0x1ed4('0x2'));var rs=require(_0x1ed4('0x3'));var fs=require('fs');var Redis=require(_0x1ed4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1ed4('0x5'));var logger=require(_0x1ed4('0x6'))(_0x1ed4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ed4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2b06b4,_0x3cd618,_0x56f54e){return new BPromise(function(_0x5124cc,_0x15d75d){return client[_0x1ed4('0x9')](_0x2b06b4,_0x56f54e)[_0x1ed4('0xa')](function(_0x46dc9f){logger[_0x1ed4('0xb')](_0x1ed4('0xc'),_0x3cd618,_0x1ed4('0xd'));logger[_0x1ed4('0xe')](_0x1ed4('0xf'),_0x3cd618,'request\x20sent',JSON['stringify'](_0x46dc9f));if(_0x46dc9f[_0x1ed4('0x10')]){if(_0x46dc9f[_0x1ed4('0x10')][_0x1ed4('0x11')]===0x1f4){logger[_0x1ed4('0x10')]('ZendeskField,\x20%s,\x20%s',_0x3cd618,_0x46dc9f[_0x1ed4('0x10')][_0x1ed4('0x12')]);return _0x15d75d(_0x46dc9f[_0x1ed4('0x10')]['message']);}logger[_0x1ed4('0x10')](_0x1ed4('0xc'),_0x3cd618,_0x46dc9f[_0x1ed4('0x10')][_0x1ed4('0x12')]);return _0x5124cc(_0x46dc9f[_0x1ed4('0x10')][_0x1ed4('0x12')]);}else{logger[_0x1ed4('0xb')]('ZendeskField,\x20%s,\x20%s',_0x3cd618,_0x1ed4('0xd'));_0x5124cc(_0x46dc9f[_0x1ed4('0x13')]['message']);}})['catch'](function(_0x4b64dc){logger[_0x1ed4('0x10')]('ZendeskField,\x20%s,\x20%s',_0x3cd618,_0x4b64dc);_0x15d75d(_0x4b64dc);});});} \ No newline at end of file +var _0x07bc=['result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x3891e8,_0x3b6b95){var _0xc34c60=function(_0x1c62a9){while(--_0x1c62a9){_0x3891e8['push'](_0x3891e8['shift']());}};_0xc34c60(++_0x3b6b95);}(_0x07bc,0x1b9));var _0xc07b=function(_0x425b9a,_0x490f73){_0x425b9a=_0x425b9a-0x0;var _0x1d20f5=_0x07bc[_0x425b9a];return _0x1d20f5;};'use strict';var _=require(_0xc07b('0x0'));var util=require(_0xc07b('0x1'));var moment=require(_0xc07b('0x2'));var BPromise=require(_0xc07b('0x3'));var rs=require(_0xc07b('0x4'));var fs=require('fs');var Redis=require(_0xc07b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xc07b('0x6'));var logger=require(_0xc07b('0x7'))(_0xc07b('0x8'));var config=require(_0xc07b('0x9'));var jayson=require(_0xc07b('0xa'));var client=jayson[_0xc07b('0xb')][_0xc07b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b790a,_0xf923b2,_0x1c30bc){return new BPromise(function(_0x5c6c00,_0x24ee53){return client['request'](_0x1b790a,_0x1c30bc)['then'](function(_0x153fa1){logger[_0xc07b('0xd')](_0xc07b('0xe'),_0xf923b2,_0xc07b('0xf'));logger[_0xc07b('0x10')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0xf923b2,_0xc07b('0xf'),JSON[_0xc07b('0x11')](_0x153fa1));if(_0x153fa1[_0xc07b('0x12')]){if(_0x153fa1[_0xc07b('0x12')][_0xc07b('0x13')]===0x1f4){logger['error'](_0xc07b('0xe'),_0xf923b2,_0x153fa1[_0xc07b('0x12')][_0xc07b('0x14')]);return _0x24ee53(_0x153fa1[_0xc07b('0x12')][_0xc07b('0x14')]);}logger[_0xc07b('0x12')](_0xc07b('0xe'),_0xf923b2,_0x153fa1[_0xc07b('0x12')][_0xc07b('0x14')]);return _0x5c6c00(_0x153fa1['error'][_0xc07b('0x14')]);}else{logger[_0xc07b('0xd')](_0xc07b('0xe'),_0xf923b2,_0xc07b('0xf'));_0x5c6c00(_0x153fa1[_0xc07b('0x15')][_0xc07b('0x14')]);}})['catch'](function(_0xd21458){logger['error']('ZendeskField,\x20%s,\x20%s',_0xf923b2,_0xd21458);_0x24ee53(_0xd21458);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 2e61eac..e13532b 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 _0x3ce9=['isAuthenticated','index','/:id','show','/:id/configurations','getFields','post','create','addConfiguration','put','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','get'];(function(_0x4d4265,_0x117bf7){var _0x1602bc=function(_0x3c288c){while(--_0x3c288c){_0x4d4265['push'](_0x4d4265['shift']());}};_0x1602bc(++_0x117bf7);}(_0x3ce9,0x109));var _0x93ce=function(_0x3b74fa,_0x1cb495){_0x3b74fa=_0x3b74fa-0x0;var _0x3f2ded=_0x3ce9[_0x3b74fa];return _0x3f2ded;};'use strict';var multer=require('multer');var util=require(_0x93ce('0x0'));var path=require(_0x93ce('0x1'));var timeout=require(_0x93ce('0x2'));var express=require(_0x93ce('0x3'));var router=express[_0x93ce('0x4')]();var fs_extra=require(_0x93ce('0x5'));var auth=require(_0x93ce('0x6'));var interaction=require(_0x93ce('0x7'));var config=require(_0x93ce('0x8'));var controller=require(_0x93ce('0x9'));router[_0x93ce('0xa')]('/',auth[_0x93ce('0xb')](),controller[_0x93ce('0xc')]);router[_0x93ce('0xa')](_0x93ce('0xd'),auth[_0x93ce('0xb')](),controller[_0x93ce('0xe')]);router[_0x93ce('0xa')](_0x93ce('0xf'),auth[_0x93ce('0xb')](),controller['getConfigurations']);router[_0x93ce('0xa')]('/:id/fields',auth[_0x93ce('0xb')](),controller[_0x93ce('0x10')]);router[_0x93ce('0x11')]('/',auth[_0x93ce('0xb')](),controller[_0x93ce('0x12')]);router[_0x93ce('0x11')](_0x93ce('0xf'),auth[_0x93ce('0xb')](),controller[_0x93ce('0x13')]);router[_0x93ce('0x14')](_0x93ce('0xd'),auth[_0x93ce('0xb')](),controller['update']);router[_0x93ce('0x15')]('/:id',auth[_0x93ce('0xb')](),controller['destroy']);module[_0x93ce('0x16')]=router; \ No newline at end of file +var _0xb30d=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/fields','getFields','post','addConfiguration','update','delete'];(function(_0x1a3d5a,_0x55f24c){var _0x32fb6e=function(_0x3ebbd8){while(--_0x3ebbd8){_0x1a3d5a['push'](_0x1a3d5a['shift']());}};_0x32fb6e(++_0x55f24c);}(_0xb30d,0x178));var _0xdb30=function(_0x4849f6,_0x104836){_0x4849f6=_0x4849f6-0x0;var _0x1a3dcd=_0xb30d[_0x4849f6];return _0x1a3dcd;};'use strict';var multer=require(_0xdb30('0x0'));var util=require(_0xdb30('0x1'));var path=require(_0xdb30('0x2'));var timeout=require(_0xdb30('0x3'));var express=require(_0xdb30('0x4'));var router=express[_0xdb30('0x5')]();var fs_extra=require(_0xdb30('0x6'));var auth=require(_0xdb30('0x7'));var interaction=require(_0xdb30('0x8'));var config=require(_0xdb30('0x9'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xdb30('0xa')](),controller[_0xdb30('0xb')]);router[_0xdb30('0xc')](_0xdb30('0xd'),auth[_0xdb30('0xa')](),controller['show']);router[_0xdb30('0xc')]('/:id/configurations',auth[_0xdb30('0xa')](),controller['getConfigurations']);router[_0xdb30('0xc')](_0xdb30('0xe'),auth[_0xdb30('0xa')](),controller[_0xdb30('0xf')]);router['post']('/',auth[_0xdb30('0xa')](),controller['create']);router[_0xdb30('0x10')]('/:id/configurations',auth[_0xdb30('0xa')](),controller[_0xdb30('0x11')]);router['put']('/:id',auth[_0xdb30('0xa')](),controller[_0xdb30('0x12')]);router[_0xdb30('0x13')]('/:id',auth[_0xdb30('0xa')](),controller[_0xdb30('0x14')]);module[_0xdb30('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 0be2c79..8272b0d 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 _0xdace=['STRING','sequelize'];(function(_0x24b567,_0x47157d){var _0x2ba728=function(_0x27fa4a){while(--_0x27fa4a){_0x24b567['push'](_0x24b567['shift']());}};_0x2ba728(++_0x47157d);}(_0xdace,0xc5));var _0xedac=function(_0x220afa,_0xf5f6cc){_0x220afa=_0x220afa-0x0;var _0x1b79d1=_0xdace[_0x220afa];return _0x1b79d1;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'description':{'type':Sequelize[_0xedac('0x1')]},'host':{'type':Sequelize[_0xedac('0x1')]},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0xedac('0x1')]},'clientSecret':{'type':Sequelize[_0xedac('0x1')]},'serverUrl':{'type':Sequelize[_0xedac('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xedac('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x34e8=['sequelize','exports','STRING'];(function(_0x5c3107,_0x3d1516){var _0x4773b8=function(_0x508ef1){while(--_0x508ef1){_0x5c3107['push'](_0x5c3107['shift']());}};_0x4773b8(++_0x3d1516);}(_0x34e8,0x12c));var _0x834e=function(_0x59d3e4,_0x582e58){_0x59d3e4=_0x59d3e4-0x0;var _0x288fb4=_0x34e8[_0x59d3e4];return _0x288fb4;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')]},'description':{'type':Sequelize[_0x834e('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x834e('0x2')]},'clientId':{'type':Sequelize[_0x834e('0x2')]},'clientSecret':{'type':Sequelize[_0x834e('0x2')]},'serverUrl':{'type':Sequelize[_0x834e('0x2')],'allowNull':![]},'code':{'type':Sequelize[_0x834e('0x2')]},'refreshToken':{'type':Sequelize[_0x834e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index bbb89b5..554224e 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 _0xe8fd=['create','body','getConfigurations','ZohoConfiguration','order','hasOwnProperty','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','ZohoField','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','code','refreshToken','com','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','WhoId','Call_Duration','Call_Start_Time','remove','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','test','statusCode','stringify','Wrong\x20credentials','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','save','update','then','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','ZohoAccount','findAll','rows','show','params','rawAttributes','filters','intersection','find','catch'];(function(_0x484132,_0xde9fa5){var _0x1e700e=function(_0x4a23b5){while(--_0x4a23b5){_0x484132['push'](_0x484132['shift']());}};_0x1e700e(++_0xde9fa5);}(_0xe8fd,0x128));var _0xde8f=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xe8fd[_0x411017];return _0x2adeea;};'use strict';var emlformat=require(_0xde8f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xde8f('0x1'));var moment=require('moment');var BPromise=require(_0xde8f('0x2'));var Mustache=require(_0xde8f('0x3'));var util=require(_0xde8f('0x4'));var path=require('path');var sox=require(_0xde8f('0x5'));var csv=require(_0xde8f('0x6'));var ejs=require(_0xde8f('0x7'));var fs=require('fs');var fs_extra=require(_0xde8f('0x8'));var _=require(_0xde8f('0x9'));var squel=require('squel');var crypto=require(_0xde8f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xde8f('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xde8f('0xc'));var authService=require(_0xde8f('0xd'));var qs=require(_0xde8f('0xe'));var as=require(_0xde8f('0xf'));var hardwareService=require(_0xde8f('0x10'));var logger=require(_0xde8f('0x11'))(_0xde8f('0x12'));var utils=require(_0xde8f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xde8f('0x14'));var db=require(_0xde8f('0x15'))['db'];var integrations=require(_0xde8f('0x16'));function respondWithStatusCode(_0x19ce05,_0x563ce8){_0x563ce8=_0x563ce8||0xcc;return function(_0x1b4f75){if(_0x1b4f75){return _0x19ce05[_0xde8f('0x17')](_0x563ce8);}return _0x19ce05[_0xde8f('0x18')](_0x563ce8)[_0xde8f('0x19')]();};}function respondWithResult(_0x213d03,_0x2b9ce1){_0x2b9ce1=_0x2b9ce1||0xc8;return function(_0x11e770){if(_0x11e770){return _0x213d03[_0xde8f('0x18')](_0x2b9ce1)['json'](_0x11e770);}};}function respondWithFilteredResult(_0x5c6e98,_0x2934b2){return function(_0x22fb0f){if(_0x22fb0f){var _0x5793d1=typeof _0x2934b2[_0xde8f('0x1a')]==='undefined'&&typeof _0x2934b2['limit']===_0xde8f('0x1b');var _0x4a0a28=_0x22fb0f[_0xde8f('0x1c')];var _0x51e483=_0x5793d1?0x0:_0x2934b2[_0xde8f('0x1a')];var _0x249cc4=_0x5793d1?_0x22fb0f[_0xde8f('0x1c')]:_0x2934b2[_0xde8f('0x1a')]+_0x2934b2[_0xde8f('0x1d')];var _0x5eb54f;if(_0x249cc4>=_0x4a0a28){_0x249cc4=_0x4a0a28;_0x5eb54f=0xc8;}else{_0x5eb54f=0xce;}_0x5c6e98[_0xde8f('0x18')](_0x5eb54f);return _0x5c6e98[_0xde8f('0x1e')](_0xde8f('0x1f'),_0x51e483+'-'+_0x249cc4+'/'+_0x4a0a28)[_0xde8f('0x20')](_0x22fb0f);}return null;};}function patchUpdates(_0x310181){return function(_0x510bd0){try{jsonpatch['apply'](_0x510bd0,_0x310181,!![]);}catch(_0x2844f5){return BPromise['reject'](_0x2844f5);}return _0x510bd0[_0xde8f('0x21')]();};}function saveUpdates(_0x3f4a4f,_0x2053bd){return function(_0x2a9639){if(_0x2a9639){return _0x2a9639[_0xde8f('0x22')](_0x3f4a4f)[_0xde8f('0x23')](function(_0x31d4b0){return _0x31d4b0;});}return null;};}function removeEntity(_0x1f67bf,_0x9f1f0f){return function(_0x301616){if(_0x301616){return _0x301616[_0xde8f('0x24')]()[_0xde8f('0x23')](function(){_0x1f67bf[_0xde8f('0x18')](0xcc)[_0xde8f('0x19')]();});}};}function handleEntityNotFound(_0x43fd2b,_0x30376c){return function(_0x263dab){if(!_0x263dab){_0x43fd2b[_0xde8f('0x17')](0x194);}return _0x263dab;};}function handleError(_0x2b6be2,_0x3386c9){_0x3386c9=_0x3386c9||0x1f4;return function(_0x5d9f96){logger[_0xde8f('0x25')](_0x5d9f96[_0xde8f('0x26')]);if(_0x5d9f96[_0xde8f('0x27')]){delete _0x5d9f96[_0xde8f('0x27')];}_0x2b6be2[_0xde8f('0x18')](_0x3386c9)[_0xde8f('0x28')](_0x5d9f96);};}exports[_0xde8f('0x29')]=function(_0x44428d,_0x76e987){var _0x3c585b={},_0x1bc47f={},_0x1e33ad={'count':0x0,'rows':[]};var _0xaab9a=_[_0xde8f('0x2a')](db['ZohoAccount']['rawAttributes'],function(_0x5a5bde){return{'name':_0x5a5bde[_0xde8f('0x2b')],'type':_0x5a5bde[_0xde8f('0x2c')][_0xde8f('0x2d')]};});_0x1bc47f[_0xde8f('0x2e')]=_[_0xde8f('0x2a')](_0xaab9a,_0xde8f('0x27'));_0x1bc47f[_0xde8f('0x2f')]=_[_0xde8f('0x30')](_0x44428d[_0xde8f('0x2f')]);_0x1bc47f['filters']=_['intersection'](_0x1bc47f['model'],_0x1bc47f[_0xde8f('0x2f')]);_0x3c585b['attributes']=_['intersection'](_0x1bc47f['model'],qs[_0xde8f('0x31')](_0x44428d['query'][_0xde8f('0x31')]));_0x3c585b[_0xde8f('0x32')]=_0x3c585b[_0xde8f('0x32')][_0xde8f('0x33')]?_0x3c585b[_0xde8f('0x32')]:_0x1bc47f[_0xde8f('0x2e')];if(!_0x44428d[_0xde8f('0x2f')]['hasOwnProperty'](_0xde8f('0x34'))){_0x3c585b[_0xde8f('0x1d')]=qs[_0xde8f('0x1d')](_0x44428d['query']['limit']);_0x3c585b['offset']=qs[_0xde8f('0x1a')](_0x44428d[_0xde8f('0x2f')][_0xde8f('0x1a')]);}_0x3c585b['order']=qs[_0xde8f('0x35')](_0x44428d[_0xde8f('0x2f')][_0xde8f('0x35')]);_0x3c585b[_0xde8f('0x36')]=qs['filters'](_[_0xde8f('0x37')](_0x44428d['query'],_0x1bc47f['filters']),_0xaab9a);if(_0x44428d['query'][_0xde8f('0x38')]){_0x3c585b[_0xde8f('0x36')]=_[_0xde8f('0x39')](_0x3c585b[_0xde8f('0x36')],{'$or':_[_0xde8f('0x2a')](_0xaab9a,function(_0xd323a8){if(_0xd323a8[_0xde8f('0x2c')]!=='VIRTUAL'){var _0x27d7d0={};_0x27d7d0[_0xd323a8['name']]={'$like':'%'+_0x44428d[_0xde8f('0x2f')]['filter']+'%'};return _0x27d7d0;}})});}_0x3c585b=_[_0xde8f('0x39')]({},_0x3c585b,_0x44428d[_0xde8f('0x3a')]);var _0x4979f1={'where':_0x3c585b[_0xde8f('0x36')]};return db['ZohoAccount']['count'](_0x4979f1)[_0xde8f('0x23')](function(_0x335dbd){_0x1e33ad[_0xde8f('0x1c')]=_0x335dbd;if(_0x44428d[_0xde8f('0x2f')][_0xde8f('0x3b')]){_0x3c585b['include']=[{'all':!![]}];}return db[_0xde8f('0x3c')][_0xde8f('0x3d')](_0x3c585b);})[_0xde8f('0x23')](function(_0x88220f){_0x1e33ad[_0xde8f('0x3e')]=_0x88220f;return _0x1e33ad;})['then'](respondWithFilteredResult(_0x76e987,_0x3c585b))['catch'](handleError(_0x76e987,null));};exports[_0xde8f('0x3f')]=function(_0x17d988,_0x1e83b6){var _0x14409e={'raw':![],'where':{'id':_0x17d988[_0xde8f('0x40')]['id']}},_0x150ef9={};_0x150ef9['model']=_['keys'](db['ZohoAccount'][_0xde8f('0x41')]);_0x150ef9[_0xde8f('0x2f')]=_[_0xde8f('0x30')](_0x17d988['query']);_0x150ef9[_0xde8f('0x42')]=_[_0xde8f('0x43')](_0x150ef9[_0xde8f('0x2e')],_0x150ef9[_0xde8f('0x2f')]);_0x14409e[_0xde8f('0x32')]=_[_0xde8f('0x43')](_0x150ef9[_0xde8f('0x2e')],qs[_0xde8f('0x31')](_0x17d988['query']['fields']));_0x14409e[_0xde8f('0x32')]=_0x14409e['attributes'][_0xde8f('0x33')]?_0x14409e[_0xde8f('0x32')]:_0x150ef9[_0xde8f('0x2e')];if(_0x17d988['query'][_0xde8f('0x3b')]){_0x14409e['include']=[{'all':!![]}];}_0x14409e=_[_0xde8f('0x39')]({},_0x14409e,_0x17d988['options']);return db[_0xde8f('0x3c')][_0xde8f('0x44')](_0x14409e)[_0xde8f('0x23')](handleEntityNotFound(_0x1e83b6,null))[_0xde8f('0x23')](respondWithResult(_0x1e83b6,null))[_0xde8f('0x45')](handleError(_0x1e83b6,null));};exports[_0xde8f('0x46')]=function(_0x5ed51,_0x3cb7a5){return db[_0xde8f('0x3c')]['create'](_0x5ed51['body'],{})[_0xde8f('0x23')](respondWithResult(_0x3cb7a5,0xc9))[_0xde8f('0x45')](handleError(_0x3cb7a5,null));};exports[_0xde8f('0x22')]=function(_0x146a3e,_0x1ac0d8){if(_0x146a3e[_0xde8f('0x47')]['id']){delete _0x146a3e[_0xde8f('0x47')]['id'];}return db[_0xde8f('0x3c')]['find']({'where':{'id':_0x146a3e[_0xde8f('0x40')]['id']}})[_0xde8f('0x23')](handleEntityNotFound(_0x1ac0d8,null))[_0xde8f('0x23')](saveUpdates(_0x146a3e[_0xde8f('0x47')],null))['then'](respondWithResult(_0x1ac0d8,null))[_0xde8f('0x45')](handleError(_0x1ac0d8,null));};exports[_0xde8f('0x24')]=function(_0x4894f9,_0x9379b1){return db[_0xde8f('0x3c')][_0xde8f('0x44')]({'where':{'id':_0x4894f9[_0xde8f('0x40')]['id']}})['then'](handleEntityNotFound(_0x9379b1,null))[_0xde8f('0x23')](removeEntity(_0x9379b1,null))[_0xde8f('0x45')](handleError(_0x9379b1,null));};exports[_0xde8f('0x48')]=function(_0x2e663f,_0xf0739b,_0x387988){var _0x1df0d5={};var _0x21e209={};var _0x21588b;var _0x1f9d68;return db[_0xde8f('0x3c')]['findOne']({'where':{'id':_0x2e663f[_0xde8f('0x40')]['id']}})[_0xde8f('0x23')](handleEntityNotFound(_0xf0739b,null))[_0xde8f('0x23')](function(_0x328076){if(_0x328076){_0x21588b=_0x328076;_0x21e209['model']=_[_0xde8f('0x30')](db[_0xde8f('0x49')][_0xde8f('0x41')]);_0x21e209['query']=_[_0xde8f('0x30')](_0x2e663f['query']);_0x21e209['filters']=_[_0xde8f('0x43')](_0x21e209[_0xde8f('0x2e')],_0x21e209[_0xde8f('0x2f')]);_0x1df0d5[_0xde8f('0x32')]=_[_0xde8f('0x43')](_0x21e209[_0xde8f('0x2e')],qs[_0xde8f('0x31')](_0x2e663f['query']['fields']));_0x1df0d5['attributes']=_0x1df0d5[_0xde8f('0x32')][_0xde8f('0x33')]?_0x1df0d5[_0xde8f('0x32')]:_0x21e209['model'];_0x1df0d5[_0xde8f('0x4a')]=qs[_0xde8f('0x35')](_0x2e663f[_0xde8f('0x2f')][_0xde8f('0x35')]);_0x1df0d5[_0xde8f('0x36')]=qs['filters'](_[_0xde8f('0x37')](_0x2e663f[_0xde8f('0x2f')],_0x21e209['filters']));if(_0x2e663f[_0xde8f('0x2f')]['filter']){_0x1df0d5[_0xde8f('0x36')]=_[_0xde8f('0x39')](_0x1df0d5[_0xde8f('0x36')],{'$or':_[_0xde8f('0x2a')](_0x1df0d5[_0xde8f('0x32')],function(_0x55155d){var _0x53c4c7={};_0x53c4c7[_0x55155d]={'$like':'%'+_0x2e663f[_0xde8f('0x2f')][_0xde8f('0x38')]+'%'};return _0x53c4c7;})});}_0x1df0d5=_[_0xde8f('0x39')]({},_0x1df0d5,_0x2e663f[_0xde8f('0x3a')]);return _0x21588b[_0xde8f('0x48')](_0x1df0d5);}})[_0xde8f('0x23')](function(_0x4af8bd){if(_0x4af8bd){_0x1f9d68=_0x4af8bd[_0xde8f('0x33')];if(!_0x2e663f[_0xde8f('0x2f')][_0xde8f('0x4b')]('nolimit')){_0x1df0d5[_0xde8f('0x1d')]=qs['limit'](_0x2e663f[_0xde8f('0x2f')]['limit']);_0x1df0d5[_0xde8f('0x1a')]=qs[_0xde8f('0x1a')](_0x2e663f[_0xde8f('0x2f')][_0xde8f('0x1a')]);}return _0x21588b[_0xde8f('0x48')](_0x1df0d5);}})[_0xde8f('0x23')](function(_0xf66c5e){if(_0xf66c5e){return _0xf66c5e?{'count':_0x1f9d68,'rows':_0xf66c5e}:null;}})[_0xde8f('0x23')](respondWithResult(_0xf0739b,null))[_0xde8f('0x45')](handleError(_0xf0739b,null));};exports[_0xde8f('0x4c')]=function(_0x246a88,_0x58cc70,_0x3011f2){if(_0x246a88[_0xde8f('0x47')]['id']){delete _0x246a88[_0xde8f('0x47')]['id'];}return db[_0xde8f('0x3c')][_0xde8f('0x4d')]({'where':{'id':_0x246a88[_0xde8f('0x40')]['id']}})[_0xde8f('0x23')](handleEntityNotFound(_0x58cc70,null))[_0xde8f('0x23')](function(_0x6dab2){if(_0x6dab2){_0x246a88['body'][_0xde8f('0x4e')]=_0x6dab2['id'];_0x246a88[_0xde8f('0x47')][_0xde8f('0x4f')]=integrations[_0xde8f('0x50')](_0x246a88[_0xde8f('0x47')][_0xde8f('0x51')],_0x246a88[_0xde8f('0x47')][_0xde8f('0x2c')]);_0x246a88[_0xde8f('0x47')]['Descriptions']=integrations['getDescriptions'](_0x246a88[_0xde8f('0x47')]['channel'],_0x246a88['body'][_0xde8f('0x2c')]);return db[_0xde8f('0x49')][_0xde8f('0x46')](_0x246a88[_0xde8f('0x47')],{'include':[{'model':db[_0xde8f('0x52')],'as':_0xde8f('0x4f')},{'model':db[_0xde8f('0x52')],'as':'Descriptions'}]});}return null;})[_0xde8f('0x23')](respondWithResult(_0x58cc70,null))['catch'](handleError(_0x58cc70,null));};function getAccessToken(_0x4de881){return new Promise(function(_0x4634a1,_0xa326b3){var _0x3ea24b;switch(_0x4de881['zone']){case'US':_0x3ea24b='https://accounts.zoho.com';break;case'AU':_0x3ea24b=_0xde8f('0x53');break;case'EU':_0x3ea24b=_0xde8f('0x54');break;case'IN':_0x3ea24b=_0xde8f('0x55');break;case'CN':_0x3ea24b=_0xde8f('0x56');break;default:_0x3ea24b='https://accounts.zoho.eu';break;}var _0x333a61={'method':'POST','uri':_0x3ea24b+_0xde8f('0x57'),'qs':{'refresh_token':_0x4de881['refreshToken'],'client_id':_0x4de881[_0xde8f('0x58')],'client_secret':_0x4de881[_0xde8f('0x59')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x333a61)[_0xde8f('0x23')](function(_0x42bae5){if(_0x42bae5[_0xde8f('0x5a')]){_0x4634a1(_0x42bae5[_0xde8f('0x5a')]);}else{_0xa326b3(_0xde8f('0x5b'));}})['catch'](function(_0x43d9ed){_0xa326b3(_0x43d9ed);});});}exports[_0xde8f('0x5c')]=function(_0x501536,_0x39761b,_0x44cc12){var _0x1b00ec,_0x576c65,_0x2fd932,_0x3409b3,_0x47dd9c;return db[_0xde8f('0x3c')][_0xde8f('0x4d')]({'where':{'id':_0x501536['params']['id']},'attributes':['id',_0xde8f('0x5d'),'zone','clientId',_0xde8f('0x59'),_0xde8f('0x5e'),_0xde8f('0x5f'),_0xde8f('0x60')]})['then'](handleEntityNotFound(_0x39761b,null))[_0xde8f('0x23')](function(_0x5c6581){_0x47dd9c=_0x5c6581;_0x1b00ec=_0x47dd9c[_0xde8f('0x5d')];_0x576c65=_0x1b00ec==='zoho.eu'?'eu':_0xde8f('0x61');_0x2fd932=_0x47dd9c[_0xde8f('0x5e')];var _0x26857a=_0x2fd932['slice'](-0x1);if(_0x26857a==='/'||_0x26857a==='\x5c'||_0x26857a===':'){_0x2fd932=_0x2fd932[_0xde8f('0x62')](0x0,_0x2fd932[_0xde8f('0x63')](_0x26857a));}if(!_0x47dd9c[_0xde8f('0x60')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0x47dd9c);})[_0xde8f('0x23')](function(_0x2e41ba){if(_0x2e41ba){return rp({'method':_0xde8f('0x64'),'uri':util['format'](_0xde8f('0x65'),_0x576c65),'qs':{'module':_0xde8f('0x66')},'headers':{'Authorization':_0xde8f('0x67')+_0x2e41ba},'json':!![]});}})['then'](function(_0xead2cf){if(_0xead2cf){if(_0xead2cf[_0xde8f('0x68')]&&_0xead2cf[_0xde8f('0x68')][_0xde8f('0x25')]){throw new Error(_0xead2cf[_0xde8f('0x68')]['error'][_0xde8f('0x69')]);}var _0x2241f4=[];var _0x6e9aea=[];var _0x27ed4f=[_0xde8f('0x6a'),'Subject','Description',_0xde8f('0x6b'),_0xde8f('0x6c'),'Call_Result',_0xde8f('0x6d'),'Call_Type'];_0x6e9aea=_[_0xde8f('0x6e')](_0xead2cf['fields'],function(_0x3c5316){return _0x27ed4f['includes'](_0x3c5316['api_name']);});for(var _0x3cebc4=0x0;_0x3cebc4<_0x6e9aea['length'];_0x3cebc4++){if(_0x6e9aea[_0x3cebc4][_0xde8f('0x6f')]===![]){_0x2241f4[_0xde8f('0x70')]({'id':_0x6e9aea[_0x3cebc4]['id'],'name':_0x6e9aea[_0x3cebc4][_0xde8f('0x71')],'custom':_0x6e9aea[_0x3cebc4][_0xde8f('0x72')],'options':_0x6e9aea[_0x3cebc4][_0xde8f('0x73')]===_0xde8f('0x74')&&_0x6e9aea[_0x3cebc4][_0xde8f('0x75')][_0xde8f('0x33')]>-0x1?_[_0xde8f('0x2a')](_0x6e9aea[_0x3cebc4]['pick_list_values'],function(_0x1b7af6){return{'name':_0x1b7af6,'value':_0x1b7af6};}):[]});}}return{'count':_0x2241f4[_0xde8f('0x33')],'rows':_0x2241f4};}else{return{'count':0x0,'rows':[]};}})[_0xde8f('0x23')](respondWithResult(_0x39761b,null))[_0xde8f('0x45')](function(_0x331dc3){var _0x4ab273=_0x501536[_0xde8f('0x2f')][_0xde8f('0x76')]?0x1f4:_0x331dc3[_0xde8f('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xde8f('0x5c'),_0x4ab273,JSON[_0xde8f('0x78')](_0x331dc3));delete _0x331dc3[_0xde8f('0x27')];if(_0x4ab273===0x191){_0x4ab273=0x190;}_0x39761b[_0xde8f('0x18')](_0x4ab273)[_0xde8f('0x28')](_0x501536[_0xde8f('0x2f')]['test']?{'message':_0xde8f('0x79'),'statusCode':_0x331dc3[_0xde8f('0x77')]}:_0x331dc3);});}; \ No newline at end of file +var _0x24af=['key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','keys','find','create','body','update','getConfigurations','findOne','ZohoConfiguration','addConfiguration','AccountId','Subjects','getSubjects','getDescriptions','channel','ZohoField','Descriptions','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientSecret','serverUrl','host','zoho.eu','com','slice','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','pick_list_values','test','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','statusCode','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../components/integrations/configuration','sendStatus','end','json','undefined','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','ZohoAccount','rawAttributes','type'];(function(_0x3327e2,_0x251554){var _0x59fb5c=function(_0xf092ac){while(--_0xf092ac){_0x3327e2['push'](_0x3327e2['shift']());}};_0x59fb5c(++_0x251554);}(_0x24af,0x169));var _0xf24a=function(_0x5d0609,_0x127562){_0x5d0609=_0x5d0609-0x0;var _0xaa3fd1=_0x24af[_0x5d0609];return _0xaa3fd1;};'use strict';var emlformat=require(_0xf24a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf24a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf24a('0x2'));var moment=require(_0xf24a('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf24a('0x4'));var util=require(_0xf24a('0x5'));var path=require(_0xf24a('0x6'));var sox=require(_0xf24a('0x7'));var csv=require(_0xf24a('0x8'));var ejs=require(_0xf24a('0x9'));var fs=require('fs');var fs_extra=require(_0xf24a('0xa'));var _=require(_0xf24a('0xb'));var squel=require(_0xf24a('0xc'));var crypto=require('crypto');var jsforce=require(_0xf24a('0xd'));var deskjs=require(_0xf24a('0xe'));var toCsv=require(_0xf24a('0x8'));var querystring=require(_0xf24a('0xf'));var Papa=require(_0xf24a('0x10'));var Redis=require(_0xf24a('0x11'));var authService=require(_0xf24a('0x12'));var qs=require(_0xf24a('0x13'));var as=require(_0xf24a('0x14'));var hardwareService=require(_0xf24a('0x15'));var logger=require(_0xf24a('0x16'))(_0xf24a('0x17'));var utils=require('../../config/utils');var config=require(_0xf24a('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xf24a('0x19'));function respondWithStatusCode(_0x4b36d6,_0x4dc664){_0x4dc664=_0x4dc664||0xcc;return function(_0xcd98ae){if(_0xcd98ae){return _0x4b36d6[_0xf24a('0x1a')](_0x4dc664);}return _0x4b36d6['status'](_0x4dc664)[_0xf24a('0x1b')]();};}function respondWithResult(_0x463d3a,_0x5a8b47){_0x5a8b47=_0x5a8b47||0xc8;return function(_0x21396b){if(_0x21396b){return _0x463d3a['status'](_0x5a8b47)[_0xf24a('0x1c')](_0x21396b);}};}function respondWithFilteredResult(_0x21c088,_0x5aa3d6){return function(_0x79f4d4){if(_0x79f4d4){var _0x2dcf06=typeof _0x5aa3d6['offset']===_0xf24a('0x1d')&&typeof _0x5aa3d6['limit']===_0xf24a('0x1d');var _0x3dc480=_0x79f4d4[_0xf24a('0x1e')];var _0x829807=_0x2dcf06?0x0:_0x5aa3d6[_0xf24a('0x1f')];var _0x956ec5=_0x2dcf06?_0x79f4d4[_0xf24a('0x1e')]:_0x5aa3d6[_0xf24a('0x1f')]+_0x5aa3d6[_0xf24a('0x20')];var _0x5d2f26;if(_0x956ec5>=_0x3dc480){_0x956ec5=_0x3dc480;_0x5d2f26=0xc8;}else{_0x5d2f26=0xce;}_0x21c088[_0xf24a('0x21')](_0x5d2f26);return _0x21c088[_0xf24a('0x22')](_0xf24a('0x23'),_0x829807+'-'+_0x956ec5+'/'+_0x3dc480)[_0xf24a('0x1c')](_0x79f4d4);}return null;};}function patchUpdates(_0x3b854e){return function(_0x65434a){try{jsonpatch[_0xf24a('0x24')](_0x65434a,_0x3b854e,!![]);}catch(_0x2e00cb){return BPromise[_0xf24a('0x25')](_0x2e00cb);}return _0x65434a[_0xf24a('0x26')]();};}function saveUpdates(_0x5ce296,_0x558267){return function(_0x3f0ea8){if(_0x3f0ea8){return _0x3f0ea8['update'](_0x5ce296)[_0xf24a('0x27')](function(_0x567c0d){return _0x567c0d;});}return null;};}function removeEntity(_0x4fcafc,_0x1660fd){return function(_0x119a99){if(_0x119a99){return _0x119a99[_0xf24a('0x28')]()[_0xf24a('0x27')](function(){_0x4fcafc[_0xf24a('0x21')](0xcc)[_0xf24a('0x1b')]();});}};}function handleEntityNotFound(_0x1bf72c,_0xe7d46e){return function(_0x16f0b8){if(!_0x16f0b8){_0x1bf72c[_0xf24a('0x1a')](0x194);}return _0x16f0b8;};}function handleError(_0xcb5471,_0x8a7ab){_0x8a7ab=_0x8a7ab||0x1f4;return function(_0x550efe){logger[_0xf24a('0x29')](_0x550efe[_0xf24a('0x2a')]);if(_0x550efe[_0xf24a('0x2b')]){delete _0x550efe['name'];}_0xcb5471[_0xf24a('0x21')](_0x8a7ab)[_0xf24a('0x2c')](_0x550efe);};}exports[_0xf24a('0x2d')]=function(_0x167531,_0x158e53){var _0x57b22f={},_0x37ad93={},_0x474cf7={'count':0x0,'rows':[]};var _0x148f92=_[_0xf24a('0x2e')](db[_0xf24a('0x2f')][_0xf24a('0x30')],function(_0x2d98de){return{'name':_0x2d98de['fieldName'],'type':_0x2d98de[_0xf24a('0x31')][_0xf24a('0x32')]};});_0x37ad93[_0xf24a('0x33')]=_['map'](_0x148f92,_0xf24a('0x2b'));_0x37ad93[_0xf24a('0x34')]=_['keys'](_0x167531[_0xf24a('0x34')]);_0x37ad93[_0xf24a('0x35')]=_['intersection'](_0x37ad93[_0xf24a('0x33')],_0x37ad93[_0xf24a('0x34')]);_0x57b22f[_0xf24a('0x36')]=_[_0xf24a('0x37')](_0x37ad93[_0xf24a('0x33')],qs[_0xf24a('0x38')](_0x167531[_0xf24a('0x34')]['fields']));_0x57b22f[_0xf24a('0x36')]=_0x57b22f[_0xf24a('0x36')][_0xf24a('0x39')]?_0x57b22f[_0xf24a('0x36')]:_0x37ad93['model'];if(!_0x167531[_0xf24a('0x34')][_0xf24a('0x3a')](_0xf24a('0x3b'))){_0x57b22f[_0xf24a('0x20')]=qs[_0xf24a('0x20')](_0x167531[_0xf24a('0x34')][_0xf24a('0x20')]);_0x57b22f[_0xf24a('0x1f')]=qs['offset'](_0x167531[_0xf24a('0x34')][_0xf24a('0x1f')]);}_0x57b22f[_0xf24a('0x3c')]=qs[_0xf24a('0x3d')](_0x167531[_0xf24a('0x34')][_0xf24a('0x3d')]);_0x57b22f[_0xf24a('0x3e')]=qs['filters'](_[_0xf24a('0x3f')](_0x167531['query'],_0x37ad93[_0xf24a('0x35')]),_0x148f92);if(_0x167531[_0xf24a('0x34')]['filter']){_0x57b22f[_0xf24a('0x3e')]=_[_0xf24a('0x40')](_0x57b22f[_0xf24a('0x3e')],{'$or':_[_0xf24a('0x2e')](_0x148f92,function(_0x5396ac){if(_0x5396ac['type']!=='VIRTUAL'){var _0x14b676={};_0x14b676[_0x5396ac[_0xf24a('0x2b')]]={'$like':'%'+_0x167531['query'][_0xf24a('0x41')]+'%'};return _0x14b676;}})});}_0x57b22f=_[_0xf24a('0x40')]({},_0x57b22f,_0x167531[_0xf24a('0x42')]);var _0x2604bd={'where':_0x57b22f[_0xf24a('0x3e')]};return db[_0xf24a('0x2f')][_0xf24a('0x1e')](_0x2604bd)[_0xf24a('0x27')](function(_0x2021b1){_0x474cf7['count']=_0x2021b1;if(_0x167531[_0xf24a('0x34')][_0xf24a('0x43')]){_0x57b22f[_0xf24a('0x44')]=[{'all':!![]}];}return db[_0xf24a('0x2f')]['findAll'](_0x57b22f);})[_0xf24a('0x27')](function(_0x3906a7){_0x474cf7[_0xf24a('0x45')]=_0x3906a7;return _0x474cf7;})[_0xf24a('0x27')](respondWithFilteredResult(_0x158e53,_0x57b22f))[_0xf24a('0x46')](handleError(_0x158e53,null));};exports[_0xf24a('0x47')]=function(_0x125929,_0x490543){var _0x403699={'raw':![],'where':{'id':_0x125929[_0xf24a('0x48')]['id']}},_0x5a41b1={};_0x5a41b1[_0xf24a('0x33')]=_[_0xf24a('0x49')](db[_0xf24a('0x2f')][_0xf24a('0x30')]);_0x5a41b1[_0xf24a('0x34')]=_['keys'](_0x125929['query']);_0x5a41b1[_0xf24a('0x35')]=_[_0xf24a('0x37')](_0x5a41b1['model'],_0x5a41b1[_0xf24a('0x34')]);_0x403699[_0xf24a('0x36')]=_[_0xf24a('0x37')](_0x5a41b1['model'],qs[_0xf24a('0x38')](_0x125929['query'][_0xf24a('0x38')]));_0x403699[_0xf24a('0x36')]=_0x403699[_0xf24a('0x36')]['length']?_0x403699[_0xf24a('0x36')]:_0x5a41b1[_0xf24a('0x33')];if(_0x125929['query'][_0xf24a('0x43')]){_0x403699['include']=[{'all':!![]}];}_0x403699=_[_0xf24a('0x40')]({},_0x403699,_0x125929[_0xf24a('0x42')]);return db['ZohoAccount'][_0xf24a('0x4a')](_0x403699)['then'](handleEntityNotFound(_0x490543,null))['then'](respondWithResult(_0x490543,null))[_0xf24a('0x46')](handleError(_0x490543,null));};exports[_0xf24a('0x4b')]=function(_0x25f63d,_0x57bb79){return db[_0xf24a('0x2f')][_0xf24a('0x4b')](_0x25f63d[_0xf24a('0x4c')],{})[_0xf24a('0x27')](respondWithResult(_0x57bb79,0xc9))[_0xf24a('0x46')](handleError(_0x57bb79,null));};exports[_0xf24a('0x4d')]=function(_0x5a9b50,_0x1966b1){if(_0x5a9b50[_0xf24a('0x4c')]['id']){delete _0x5a9b50['body']['id'];}return db[_0xf24a('0x2f')][_0xf24a('0x4a')]({'where':{'id':_0x5a9b50[_0xf24a('0x48')]['id']}})[_0xf24a('0x27')](handleEntityNotFound(_0x1966b1,null))[_0xf24a('0x27')](saveUpdates(_0x5a9b50[_0xf24a('0x4c')],null))[_0xf24a('0x27')](respondWithResult(_0x1966b1,null))['catch'](handleError(_0x1966b1,null));};exports[_0xf24a('0x28')]=function(_0x4c73e8,_0x216f71){return db[_0xf24a('0x2f')][_0xf24a('0x4a')]({'where':{'id':_0x4c73e8[_0xf24a('0x48')]['id']}})[_0xf24a('0x27')](handleEntityNotFound(_0x216f71,null))['then'](removeEntity(_0x216f71,null))['catch'](handleError(_0x216f71,null));};exports[_0xf24a('0x4e')]=function(_0x4042a1,_0x2f82ba,_0x139d5d){var _0x145d17={};var _0x40dd15={};var _0x3166f7;var _0x145217;return db['ZohoAccount'][_0xf24a('0x4f')]({'where':{'id':_0x4042a1[_0xf24a('0x48')]['id']}})[_0xf24a('0x27')](handleEntityNotFound(_0x2f82ba,null))[_0xf24a('0x27')](function(_0x3f0535){if(_0x3f0535){_0x3166f7=_0x3f0535;_0x40dd15['model']=_[_0xf24a('0x49')](db[_0xf24a('0x50')]['rawAttributes']);_0x40dd15[_0xf24a('0x34')]=_[_0xf24a('0x49')](_0x4042a1[_0xf24a('0x34')]);_0x40dd15[_0xf24a('0x35')]=_[_0xf24a('0x37')](_0x40dd15[_0xf24a('0x33')],_0x40dd15['query']);_0x145d17[_0xf24a('0x36')]=_['intersection'](_0x40dd15[_0xf24a('0x33')],qs[_0xf24a('0x38')](_0x4042a1[_0xf24a('0x34')][_0xf24a('0x38')]));_0x145d17[_0xf24a('0x36')]=_0x145d17[_0xf24a('0x36')][_0xf24a('0x39')]?_0x145d17[_0xf24a('0x36')]:_0x40dd15[_0xf24a('0x33')];_0x145d17['order']=qs[_0xf24a('0x3d')](_0x4042a1[_0xf24a('0x34')][_0xf24a('0x3d')]);_0x145d17[_0xf24a('0x3e')]=qs[_0xf24a('0x35')](_[_0xf24a('0x3f')](_0x4042a1[_0xf24a('0x34')],_0x40dd15[_0xf24a('0x35')]));if(_0x4042a1[_0xf24a('0x34')][_0xf24a('0x41')]){_0x145d17['where']=_['merge'](_0x145d17['where'],{'$or':_[_0xf24a('0x2e')](_0x145d17['attributes'],function(_0x1cd5ef){var _0x101e99={};_0x101e99[_0x1cd5ef]={'$like':'%'+_0x4042a1['query'][_0xf24a('0x41')]+'%'};return _0x101e99;})});}_0x145d17=_[_0xf24a('0x40')]({},_0x145d17,_0x4042a1[_0xf24a('0x42')]);return _0x3166f7[_0xf24a('0x4e')](_0x145d17);}})[_0xf24a('0x27')](function(_0x873e7a){if(_0x873e7a){_0x145217=_0x873e7a[_0xf24a('0x39')];if(!_0x4042a1['query'][_0xf24a('0x3a')](_0xf24a('0x3b'))){_0x145d17[_0xf24a('0x20')]=qs[_0xf24a('0x20')](_0x4042a1[_0xf24a('0x34')][_0xf24a('0x20')]);_0x145d17[_0xf24a('0x1f')]=qs['offset'](_0x4042a1[_0xf24a('0x34')][_0xf24a('0x1f')]);}return _0x3166f7['getConfigurations'](_0x145d17);}})['then'](function(_0x35d610){if(_0x35d610){return _0x35d610?{'count':_0x145217,'rows':_0x35d610}:null;}})['then'](respondWithResult(_0x2f82ba,null))[_0xf24a('0x46')](handleError(_0x2f82ba,null));};exports[_0xf24a('0x51')]=function(_0x557e63,_0x700812,_0x4bcb42){if(_0x557e63[_0xf24a('0x4c')]['id']){delete _0x557e63[_0xf24a('0x4c')]['id'];}return db[_0xf24a('0x2f')][_0xf24a('0x4f')]({'where':{'id':_0x557e63['params']['id']}})[_0xf24a('0x27')](handleEntityNotFound(_0x700812,null))['then'](function(_0x3cd896){if(_0x3cd896){_0x557e63[_0xf24a('0x4c')][_0xf24a('0x52')]=_0x3cd896['id'];_0x557e63[_0xf24a('0x4c')][_0xf24a('0x53')]=integrations[_0xf24a('0x54')](_0x557e63[_0xf24a('0x4c')]['channel'],_0x557e63[_0xf24a('0x4c')][_0xf24a('0x31')]);_0x557e63['body']['Descriptions']=integrations[_0xf24a('0x55')](_0x557e63[_0xf24a('0x4c')][_0xf24a('0x56')],_0x557e63['body'][_0xf24a('0x31')]);return db[_0xf24a('0x50')][_0xf24a('0x4b')](_0x557e63[_0xf24a('0x4c')],{'include':[{'model':db[_0xf24a('0x57')],'as':_0xf24a('0x53')},{'model':db[_0xf24a('0x57')],'as':_0xf24a('0x58')}]});}return null;})[_0xf24a('0x27')](respondWithResult(_0x700812,null))[_0xf24a('0x46')](handleError(_0x700812,null));};function getAccessToken(_0x7bd7f8){return new Promise(function(_0x1b0b0d,_0x1e7a53){var _0x297f65;switch(_0x7bd7f8[_0xf24a('0x59')]){case'US':_0x297f65=_0xf24a('0x5a');break;case'AU':_0x297f65=_0xf24a('0x5b');break;case'EU':_0x297f65=_0xf24a('0x5c');break;case'IN':_0x297f65='https://accounts.zoho.in';break;case'CN':_0x297f65='https://accounts.zoho.com.cn';break;default:_0x297f65='https://accounts.zoho.eu';break;}var _0x37e9c1={'method':_0xf24a('0x5d'),'uri':_0x297f65+_0xf24a('0x5e'),'qs':{'refresh_token':_0x7bd7f8[_0xf24a('0x5f')],'client_id':_0x7bd7f8[_0xf24a('0x60')],'client_secret':_0x7bd7f8['clientSecret'],'grant_type':_0xf24a('0x61')},'json':!![]};return rp(_0x37e9c1)[_0xf24a('0x27')](function(_0x5d4a3b){if(_0x5d4a3b[_0xf24a('0x62')]){_0x1b0b0d(_0x5d4a3b[_0xf24a('0x62')]);}else{_0x1e7a53(_0xf24a('0x63'));}})[_0xf24a('0x46')](function(_0x5ec6ed){_0x1e7a53(_0x5ec6ed);});});}exports[_0xf24a('0x64')]=function(_0x465b5c,_0x3f6f99,_0x1ac9b4){var _0x16f90f,_0x3a131f,_0x7cd8fb,_0x20d054,_0x50fa8b;return db[_0xf24a('0x2f')]['findOne']({'where':{'id':_0x465b5c[_0xf24a('0x48')]['id']},'attributes':['id','host',_0xf24a('0x59'),_0xf24a('0x60'),_0xf24a('0x65'),_0xf24a('0x66'),'code',_0xf24a('0x5f')]})[_0xf24a('0x27')](handleEntityNotFound(_0x3f6f99,null))['then'](function(_0x587d8a){_0x50fa8b=_0x587d8a;_0x16f90f=_0x50fa8b[_0xf24a('0x67')];_0x3a131f=_0x16f90f===_0xf24a('0x68')?'eu':_0xf24a('0x69');_0x7cd8fb=_0x50fa8b[_0xf24a('0x66')];var _0x3db4dd=_0x7cd8fb[_0xf24a('0x6a')](-0x1);if(_0x3db4dd==='/'||_0x3db4dd==='\x5c'||_0x3db4dd===':'){_0x7cd8fb=_0x7cd8fb[_0xf24a('0x6b')](0x0,_0x7cd8fb['lastIndexOf'](_0x3db4dd));}if(!_0x50fa8b['refreshToken']){throw new Error(_0xf24a('0x6c'));}return getAccessToken(_0x50fa8b);})[_0xf24a('0x27')](function(_0x34e9f9){if(_0x34e9f9){return rp({'method':_0xf24a('0x6d'),'uri':util[_0xf24a('0x6e')](_0xf24a('0x6f'),_0x3a131f),'qs':{'module':_0xf24a('0x70')},'headers':{'Authorization':_0xf24a('0x71')+_0x34e9f9},'json':!![]});}})[_0xf24a('0x27')](function(_0x1a9c08){if(_0x1a9c08){if(_0x1a9c08[_0xf24a('0x72')]&&_0x1a9c08[_0xf24a('0x72')]['error']){throw new Error(_0x1a9c08[_0xf24a('0x72')][_0xf24a('0x29')][_0xf24a('0x73')]);}var _0x109ba4=[];var _0x1c6059=[];var _0x56c061=[_0xf24a('0x74'),'Subject',_0xf24a('0x75'),_0xf24a('0x76'),_0xf24a('0x77'),_0xf24a('0x78'),_0xf24a('0x79'),_0xf24a('0x7a')];_0x1c6059=_[_0xf24a('0x7b')](_0x1a9c08[_0xf24a('0x38')],function(_0x416782){return _0x56c061[_0xf24a('0x7c')](_0x416782[_0xf24a('0x7d')]);});for(var _0x47d12e=0x0;_0x47d12e<_0x1c6059['length'];_0x47d12e++){if(_0x1c6059[_0x47d12e][_0xf24a('0x7e')]===![]){_0x109ba4[_0xf24a('0x7f')]({'id':_0x1c6059[_0x47d12e]['id'],'name':_0x1c6059[_0x47d12e][_0xf24a('0x80')],'custom':_0x1c6059[_0x47d12e][_0xf24a('0x81')],'options':_0x1c6059[_0x47d12e]['data_type']===_0xf24a('0x82')&&_0x1c6059[_0x47d12e][_0xf24a('0x83')][_0xf24a('0x39')]>-0x1?_[_0xf24a('0x2e')](_0x1c6059[_0x47d12e][_0xf24a('0x83')],function(_0x395101){return{'name':_0x395101,'value':_0x395101};}):[]});}}return{'count':_0x109ba4[_0xf24a('0x39')],'rows':_0x109ba4};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x3f6f99,null))['catch'](function(_0x28153b){var _0x765b1e=_0x465b5c[_0xf24a('0x34')][_0xf24a('0x84')]?0x1f4:_0x28153b['statusCode']||0x1f4;logger[_0xf24a('0x29')](_0xf24a('0x85'),_0xf24a('0x64'),_0x765b1e,JSON[_0xf24a('0x86')](_0x28153b));delete _0x28153b[_0xf24a('0x2b')];if(_0x765b1e===0x191){_0x765b1e=0x190;}_0x3f6f99[_0xf24a('0x21')](_0x765b1e)[_0xf24a('0x2c')](_0x465b5c['query']['test']?{'message':_0xf24a('0x87'),'statusCode':_0x28153b[_0xf24a('0x88')]}:_0x28153b);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 38baa82..44e5c9a 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 _0x616f=['moment','request-promise','path','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','slice','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','zone','https://accounts.zoho.eu','/oauth/v2/token','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','util','../../config/logger','api'];(function(_0xaa7ffc,_0x49e8f4){var _0x127ca6=function(_0x5a12b7){while(--_0x5a12b7){_0xaa7ffc['push'](_0xaa7ffc['shift']());}};_0x127ca6(++_0x49e8f4);}(_0x616f,0x129));var _0xf616=function(_0x1b892b,_0x4efe48){_0x1b892b=_0x1b892b-0x0;var _0xa99e57=_0x616f[_0x1b892b];return _0xa99e57;};'use strict';var _=require(_0xf616('0x0'));var util=require(_0xf616('0x1'));var logger=require(_0xf616('0x2'))(_0xf616('0x3'));var moment=require(_0xf616('0x4'));var BPromise=require('bluebird');var rp=require(_0xf616('0x5'));var fs=require('fs');var path=require(_0xf616('0x6'));var rimraf=require(_0xf616('0x7'));var config=require('../../config/environment');var attributes=require(_0xf616('0x8'));var integrations=require(_0xf616('0x9'));module['exports']=function(_0x19892b,_0x2e592d){return _0x19892b[_0xf616('0xa')](_0xf616('0xb'),attributes,{'tableName':_0xf616('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x24f055,_0x2dff6b,_0x325360){if(_0x24f055[_0xf616('0xd')]('zone')||_0x24f055[_0xf616('0xd')](_0xf616('0xe'))||_0x24f055[_0xf616('0xd')](_0xf616('0xf'))||_0x24f055[_0xf616('0xd')](_0xf616('0x10'))||_0x24f055['changed']('code')||_0x24f055[_0xf616('0xd')](_0xf616('0x11'))){var _0x2e145d,_0x51cbd5;_0x2e145d=_0x24f055['serverUrl'];var _0x3c2db4=_0x2e145d[_0xf616('0x12')](-0x1);if(_0x3c2db4==='/'||_0x3c2db4==='\x5c'||_0x3c2db4===':'){_0x2e145d=_0x2e145d['substring'](0x0,_0x2e145d[_0xf616('0x13')](_0x3c2db4));}switch(_0x24f055['zone']){case'US':_0x51cbd5=_0xf616('0x14');break;case'AU':_0x51cbd5=_0xf616('0x15');break;case'IN':_0x51cbd5=_0xf616('0x16');break;case'CN':_0x51cbd5=_0xf616('0x17');break;default:_0x51cbd5='https://accounts.zoho.eu';break;}var _0x5fd070={'method':_0xf616('0x18'),'uri':_0x51cbd5+'/oauth/v2/token','form':{'grant_type':_0xf616('0x19'),'client_id':_0x24f055['clientId'],'client_secret':_0x24f055[_0xf616('0x10')],'redirect_uri':_0x24f055[_0xf616('0xe')],'code':_0x24f055[_0xf616('0x1a')]},'headers':{'Content-Type':_0xf616('0x1b')}};return rp(_0x5fd070)[_0xf616('0x1c')](function(_0x460d92){var _0xc32de1=JSON[_0xf616('0x1d')](_0x460d92);if(_0xc32de1[_0xf616('0x1e')]){_0x24f055[_0xf616('0x1f')]=_0xc32de1[_0xf616('0x1e')];logger[_0xf616('0x20')](util[_0xf616('0x21')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x24f055[_0xf616('0x22')],_0x24f055['id']));}else{logger[_0xf616('0x23')](util[_0xf616('0x21')](_0xf616('0x24'),_0x24f055['name'],_0x24f055['id']),util[_0xf616('0x25')](_0xc32de1,{'showHidden':![],'depth':null}));}return _0x325360(null,_0x2dff6b);})[_0xf616('0x26')](function(_0x50411b){logger[_0xf616('0x23')](util[_0xf616('0x21')](_0xf616('0x24'),_0x24f055[_0xf616('0x22')],_0x24f055['id']),util[_0xf616('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x325360(_0x50411b);});}else{return _0x325360(null,_0x2dff6b);}},'beforeUpdate':function(_0x53caa7,_0x4eded7,_0x1fe67e){if(_0x53caa7[_0xf616('0xd')](_0xf616('0x27'))||_0x53caa7[_0xf616('0xd')](_0xf616('0xe'))||_0x53caa7[_0xf616('0xd')](_0xf616('0xf'))||_0x53caa7[_0xf616('0xd')](_0xf616('0x10'))||_0x53caa7[_0xf616('0xd')](_0xf616('0x1a'))||_0x53caa7[_0xf616('0xd')](_0xf616('0x11'))){var _0x4a9cab,_0x28ff4d;_0x4a9cab=_0x53caa7[_0xf616('0xe')];var _0x5a4946=_0x4a9cab['slice'](-0x1);if(_0x5a4946==='/'||_0x5a4946==='\x5c'||_0x5a4946===':'){_0x4a9cab=_0x4a9cab['substring'](0x0,_0x4a9cab[_0xf616('0x13')](_0x5a4946));}switch(_0x53caa7[_0xf616('0x27')]){case'US':_0x28ff4d=_0xf616('0x14');break;case'AU':_0x28ff4d=_0xf616('0x15');break;case'IN':_0x28ff4d=_0xf616('0x16');break;case'CN':_0x28ff4d=_0xf616('0x17');break;default:_0x28ff4d=_0xf616('0x28');break;}var _0x26db5d={'method':_0xf616('0x18'),'uri':_0x28ff4d+_0xf616('0x29'),'form':{'grant_type':'authorization_code','client_id':_0x53caa7[_0xf616('0xf')],'client_secret':_0x53caa7[_0xf616('0x10')],'redirect_uri':_0x53caa7[_0xf616('0xe')],'code':_0x53caa7['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x26db5d)[_0xf616('0x1c')](function(_0x12fde5){var _0x145e1f=JSON['parse'](_0x12fde5);if(_0x145e1f[_0xf616('0x1e')]){_0x53caa7['refreshToken']=_0x145e1f[_0xf616('0x1e')];logger[_0xf616('0x20')](util[_0xf616('0x21')](_0xf616('0x2a'),_0x53caa7[_0xf616('0x22')],_0x53caa7['id']));}else{logger[_0xf616('0x23')](util[_0xf616('0x21')](_0xf616('0x24'),_0x53caa7[_0xf616('0x22')],_0x53caa7['id']),util[_0xf616('0x25')](_0x145e1f,{'showHidden':![],'depth':null}));}return _0x1fe67e(null,_0x4eded7);})[_0xf616('0x26')](function(_0xcef2f1){logger[_0xf616('0x23')](util[_0xf616('0x21')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x53caa7[_0xf616('0x22')],_0x53caa7['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1fe67e(_0xcef2f1);});}else{return _0x1fe67e(null,_0x4eded7);}}}});}; \ No newline at end of file +var _0x0f56=['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','catch','https://accounts.zoho.com.cn','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','clientId','clientSecret','host','serverUrl','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info'];(function(_0x5d191d,_0x370f3c){var _0xcc64da=function(_0x366aed){while(--_0x366aed){_0x5d191d['push'](_0x5d191d['shift']());}};_0xcc64da(++_0x370f3c);}(_0x0f56,0x1e1));var _0x60f5=function(_0x5360f2,_0x2242b6){_0x5360f2=_0x5360f2-0x0;var _0x1a558d=_0x0f56[_0x5360f2];return _0x1a558d;};'use strict';var _=require(_0x60f5('0x0'));var util=require(_0x60f5('0x1'));var logger=require(_0x60f5('0x2'))(_0x60f5('0x3'));var moment=require(_0x60f5('0x4'));var BPromise=require(_0x60f5('0x5'));var rp=require(_0x60f5('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x60f5('0x7'));var config=require(_0x60f5('0x8'));var attributes=require(_0x60f5('0x9'));var integrations=require(_0x60f5('0xa'));module[_0x60f5('0xb')]=function(_0x522393,_0x86fa86){return _0x522393[_0x60f5('0xc')]('ZohoAccount',attributes,{'tableName':_0x60f5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x35cd38,_0x108ea3,_0x3e8bba){if(_0x35cd38[_0x60f5('0xe')]('zone')||_0x35cd38[_0x60f5('0xe')]('serverUrl')||_0x35cd38[_0x60f5('0xe')](_0x60f5('0xf'))||_0x35cd38[_0x60f5('0xe')](_0x60f5('0x10'))||_0x35cd38[_0x60f5('0xe')]('code')||_0x35cd38['changed'](_0x60f5('0x11'))){var _0x32fb7f,_0x1db46a;_0x32fb7f=_0x35cd38[_0x60f5('0x12')];var _0x477fef=_0x32fb7f[_0x60f5('0x13')](-0x1);if(_0x477fef==='/'||_0x477fef==='\x5c'||_0x477fef===':'){_0x32fb7f=_0x32fb7f[_0x60f5('0x14')](0x0,_0x32fb7f['lastIndexOf'](_0x477fef));}switch(_0x35cd38[_0x60f5('0x15')]){case'US':_0x1db46a=_0x60f5('0x16');break;case'AU':_0x1db46a=_0x60f5('0x17');break;case'IN':_0x1db46a=_0x60f5('0x18');break;case'CN':_0x1db46a='https://accounts.zoho.com.cn';break;default:_0x1db46a=_0x60f5('0x19');break;}var _0x551c1b={'method':'POST','uri':_0x1db46a+_0x60f5('0x1a'),'form':{'grant_type':_0x60f5('0x1b'),'client_id':_0x35cd38['clientId'],'client_secret':_0x35cd38[_0x60f5('0x10')],'redirect_uri':_0x35cd38[_0x60f5('0x12')],'code':_0x35cd38[_0x60f5('0x1c')]},'headers':{'Content-Type':_0x60f5('0x1d')}};return rp(_0x551c1b)[_0x60f5('0x1e')](function(_0xbec3f){var _0x3bf831=JSON[_0x60f5('0x1f')](_0xbec3f);if(_0x3bf831[_0x60f5('0x20')]){_0x35cd38[_0x60f5('0x21')]=_0x3bf831['refresh_token'];logger[_0x60f5('0x22')](util[_0x60f5('0x23')](_0x60f5('0x24'),_0x35cd38[_0x60f5('0x25')],_0x35cd38['id']));}else{logger[_0x60f5('0x26')](util[_0x60f5('0x23')](_0x60f5('0x27'),_0x35cd38['name'],_0x35cd38['id']),util[_0x60f5('0x28')](_0x3bf831,{'showHidden':![],'depth':null}));}return _0x3e8bba(null,_0x108ea3);})[_0x60f5('0x29')](function(_0x23db84){logger['error'](util[_0x60f5('0x23')](_0x60f5('0x27'),_0x35cd38['name'],_0x35cd38['id']),util[_0x60f5('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x3e8bba(_0x23db84);});}else{return _0x3e8bba(null,_0x108ea3);}},'beforeUpdate':function(_0x13a42f,_0x3a41f2,_0x4ea5ed){if(_0x13a42f['changed'](_0x60f5('0x15'))||_0x13a42f[_0x60f5('0xe')](_0x60f5('0x12'))||_0x13a42f[_0x60f5('0xe')]('clientId')||_0x13a42f[_0x60f5('0xe')](_0x60f5('0x10'))||_0x13a42f['changed'](_0x60f5('0x1c'))||_0x13a42f[_0x60f5('0xe')](_0x60f5('0x11'))){var _0x25980f,_0x2ddb70;_0x25980f=_0x13a42f[_0x60f5('0x12')];var _0x2be136=_0x25980f[_0x60f5('0x13')](-0x1);if(_0x2be136==='/'||_0x2be136==='\x5c'||_0x2be136===':'){_0x25980f=_0x25980f[_0x60f5('0x14')](0x0,_0x25980f['lastIndexOf'](_0x2be136));}switch(_0x13a42f[_0x60f5('0x15')]){case'US':_0x2ddb70=_0x60f5('0x16');break;case'AU':_0x2ddb70='https://accounts.zoho.com.au';break;case'IN':_0x2ddb70=_0x60f5('0x18');break;case'CN':_0x2ddb70=_0x60f5('0x2a');break;default:_0x2ddb70=_0x60f5('0x19');break;}var _0x5f3c8d={'method':'POST','uri':_0x2ddb70+'/oauth/v2/token','form':{'grant_type':_0x60f5('0x1b'),'client_id':_0x13a42f[_0x60f5('0xf')],'client_secret':_0x13a42f['clientSecret'],'redirect_uri':_0x13a42f[_0x60f5('0x12')],'code':_0x13a42f[_0x60f5('0x1c')]},'headers':{'Content-Type':_0x60f5('0x1d')}};return rp(_0x5f3c8d)[_0x60f5('0x1e')](function(_0x2ec229){var _0x30878b=JSON[_0x60f5('0x1f')](_0x2ec229);if(_0x30878b[_0x60f5('0x20')]){_0x13a42f[_0x60f5('0x21')]=_0x30878b[_0x60f5('0x20')];logger[_0x60f5('0x22')](util[_0x60f5('0x23')](_0x60f5('0x24'),_0x13a42f[_0x60f5('0x25')],_0x13a42f['id']));}else{logger[_0x60f5('0x26')](util['format'](_0x60f5('0x27'),_0x13a42f[_0x60f5('0x25')],_0x13a42f['id']),util[_0x60f5('0x28')](_0x30878b,{'showHidden':![],'depth':null}));}return _0x4ea5ed(null,_0x3a41f2);})[_0x60f5('0x29')](function(_0x181a04){logger[_0x60f5('0x26')](util['format'](_0x60f5('0x27'),_0x13a42f[_0x60f5('0x25')],_0x13a42f['id']),util[_0x60f5('0x28')](parsedResult,{'showHidden':![],'depth':null}));return _0x4ea5ed(_0x181a04);});}else{return _0x4ea5ed(null,_0x3a41f2);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index eb55928..ad84c3b 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 _0xbd36=['../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','find','then','ShowZohoAccount','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x5b2f71,_0x5c7880){var _0x1e18f2=function(_0x703e27){while(--_0x703e27){_0x5b2f71['push'](_0x5b2f71['shift']());}};_0x1e18f2(++_0x5c7880);}(_0xbd36,0x65));var _0x6bd3=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xbd36[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x6bd3('0x0'));var util=require(_0x6bd3('0x1'));var moment=require(_0x6bd3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6bd3('0x3'));var db=require(_0x6bd3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6bd3('0x5'))(_0x6bd3('0x6'));var config=require(_0x6bd3('0x7'));var jayson=require(_0x6bd3('0x8'));var client=jayson['client'][_0x6bd3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x173035,_0x221ec0,_0x1b4148){return new BPromise(function(_0x1b2946,_0x3db900){return client[_0x6bd3('0xa')](_0x173035,_0x1b4148)['then'](function(_0x516c47){logger[_0x6bd3('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x221ec0,_0x6bd3('0xc'));logger[_0x6bd3('0xd')](_0x6bd3('0xe'),_0x221ec0,_0x6bd3('0xc'),JSON[_0x6bd3('0xf')](_0x516c47));if(_0x516c47['error']){if(_0x516c47[_0x6bd3('0x10')][_0x6bd3('0x11')]===0x1f4){logger['error'](_0x6bd3('0x12'),_0x221ec0,_0x516c47[_0x6bd3('0x10')][_0x6bd3('0x13')]);return _0x3db900(_0x516c47[_0x6bd3('0x10')][_0x6bd3('0x13')]);}logger[_0x6bd3('0x10')](_0x6bd3('0x12'),_0x221ec0,_0x516c47[_0x6bd3('0x10')]['message']);return _0x1b2946(_0x516c47[_0x6bd3('0x10')][_0x6bd3('0x13')]);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x221ec0,'request\x20sent');_0x1b2946(_0x516c47[_0x6bd3('0x14')]['message']);}})[_0x6bd3('0x15')](function(_0x3aa000){logger[_0x6bd3('0x10')](_0x6bd3('0x12'),_0x221ec0,_0x3aa000);_0x3db900(_0x3aa000);});});}exports['GetZohoAccount']=function(_0x573656){var _0xa72c2d=this;return new Promise(function(_0x769de8,_0xf0f85a){return db[_0x6bd3('0x16')][_0x6bd3('0x17')]({'raw':_0x573656[_0x6bd3('0x18')]?_0x573656[_0x6bd3('0x18')][_0x6bd3('0x19')]===undefined?!![]:![]:!![],'where':_0x573656[_0x6bd3('0x18')]?_0x573656[_0x6bd3('0x18')][_0x6bd3('0x1a')]||null:null,'attributes':_0x573656[_0x6bd3('0x18')]?_0x573656[_0x6bd3('0x18')][_0x6bd3('0x1b')]||null:null,'limit':_0x573656[_0x6bd3('0x18')]?_0x573656[_0x6bd3('0x18')][_0x6bd3('0x1c')]||null:null,'include':_0x573656[_0x6bd3('0x18')]?_0x573656[_0x6bd3('0x18')][_0x6bd3('0x1d')]?_['map'](_0x573656[_0x6bd3('0x18')][_0x6bd3('0x1d')],function(_0x28b9a9){return{'model':db[_0x28b9a9['model']],'as':_0x28b9a9['as'],'attributes':_0x28b9a9[_0x6bd3('0x1b')],'include':_0x28b9a9[_0x6bd3('0x1d')]?_[_0x6bd3('0x1e')](_0x28b9a9[_0x6bd3('0x1d')],function(_0xa8c894){return{'model':db[_0xa8c894[_0x6bd3('0x1f')]],'as':_0xa8c894['as'],'attributes':_0xa8c894[_0x6bd3('0x1b')],'include':_0xa8c894[_0x6bd3('0x1d')]?_['map'](_0xa8c894[_0x6bd3('0x1d')],function(_0x585f4e){return{'model':db[_0x585f4e[_0x6bd3('0x1f')]],'as':_0x585f4e['as'],'attributes':_0x585f4e[_0x6bd3('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x26ffc5){logger[_0x6bd3('0xb')](_0x6bd3('0x20'),_0x573656);logger[_0x6bd3('0xd')](_0x6bd3('0x20'),_0x573656,JSON[_0x6bd3('0xf')](_0x26ffc5));_0x769de8(_0x26ffc5);})[_0x6bd3('0x15')](function(_0x552628){logger[_0x6bd3('0x10')](_0x6bd3('0x20'),_0x552628[_0x6bd3('0x13')],_0x573656);_0xf0f85a(_0xa72c2d[_0x6bd3('0x10')](0x1f4,_0x552628['message']));});});};exports['ShowZohoAccount']=function(_0x5e65b7){var _0x418281=this;return new Promise(function(_0xf10a80,_0x5f0883){return db[_0x6bd3('0x16')][_0x6bd3('0x21')]({'raw':_0x5e65b7['options']?_0x5e65b7[_0x6bd3('0x18')][_0x6bd3('0x19')]===undefined?!![]:![]:!![],'where':_0x5e65b7['options']?_0x5e65b7[_0x6bd3('0x18')][_0x6bd3('0x1a')]||null:null,'attributes':_0x5e65b7[_0x6bd3('0x18')]?_0x5e65b7['options'][_0x6bd3('0x1b')]||null:null,'include':_0x5e65b7[_0x6bd3('0x18')]?_0x5e65b7['options'][_0x6bd3('0x1d')]?_['map'](_0x5e65b7[_0x6bd3('0x18')][_0x6bd3('0x1d')],function(_0x2f3e55){return{'model':db[_0x2f3e55[_0x6bd3('0x1f')]],'as':_0x2f3e55['as'],'attributes':_0x2f3e55[_0x6bd3('0x1b')],'include':_0x2f3e55[_0x6bd3('0x1d')]?_[_0x6bd3('0x1e')](_0x2f3e55['include'],function(_0x1261a7){return{'model':db[_0x1261a7[_0x6bd3('0x1f')]],'as':_0x1261a7['as'],'attributes':_0x1261a7[_0x6bd3('0x1b')],'include':_0x1261a7[_0x6bd3('0x1d')]?_[_0x6bd3('0x1e')](_0x1261a7[_0x6bd3('0x1d')],function(_0x1c0ccb){return{'model':db[_0x1c0ccb[_0x6bd3('0x1f')]],'as':_0x1c0ccb['as'],'attributes':_0x1c0ccb[_0x6bd3('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6bd3('0x22')](function(_0x1a7368){logger['info']('ShowZohoAccount',_0x5e65b7);logger[_0x6bd3('0xd')](_0x6bd3('0x23'),_0x5e65b7,JSON[_0x6bd3('0xf')](_0x1a7368));_0xf10a80(_0x1a7368);})[_0x6bd3('0x15')](function(_0x508f3a){logger[_0x6bd3('0x10')]('ShowZohoAccount',_0x508f3a[_0x6bd3('0x13')],_0x5e65b7);_0x5f0883(_0x418281[_0x6bd3('0x10')](0x1f4,_0x508f3a['message']));});});}; \ No newline at end of file +var _0x75b6=['GetZohoAccount','ZohoAccount','options','raw','where','limit','include','map','attributes','model','ShowZohoAccount','find','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x3b9878,_0x2e6e42){var _0x5daae2=function(_0xaf4145){while(--_0xaf4145){_0x3b9878['push'](_0x3b9878['shift']());}};_0x5daae2(++_0x2e6e42);}(_0x75b6,0x1a4));var _0x675b=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x75b6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x675b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x675b('0x1'));var rs=require(_0x675b('0x2'));var fs=require('fs');var Redis=require(_0x675b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x675b('0x4'));var logger=require(_0x675b('0x5'))(_0x675b('0x6'));var config=require('../../config/environment');var jayson=require(_0x675b('0x7'));var client=jayson['client'][_0x675b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3a7a7a,_0x3f34b8,_0x556239){return new BPromise(function(_0x1bff7d,_0x4f55d4){return client[_0x675b('0x9')](_0x3a7a7a,_0x556239)[_0x675b('0xa')](function(_0x24cf1c){logger[_0x675b('0xb')](_0x675b('0xc'),_0x3f34b8,_0x675b('0xd'));logger[_0x675b('0xe')](_0x675b('0xf'),_0x3f34b8,_0x675b('0xd'),JSON[_0x675b('0x10')](_0x24cf1c));if(_0x24cf1c['error']){if(_0x24cf1c[_0x675b('0x11')][_0x675b('0x12')]===0x1f4){logger[_0x675b('0x11')](_0x675b('0xc'),_0x3f34b8,_0x24cf1c['error']['message']);return _0x4f55d4(_0x24cf1c['error']['message']);}logger['error'](_0x675b('0xc'),_0x3f34b8,_0x24cf1c['error']['message']);return _0x1bff7d(_0x24cf1c[_0x675b('0x11')][_0x675b('0x13')]);}else{logger[_0x675b('0xb')](_0x675b('0xc'),_0x3f34b8,'request\x20sent');_0x1bff7d(_0x24cf1c[_0x675b('0x14')][_0x675b('0x13')]);}})[_0x675b('0x15')](function(_0x17c3fc){logger[_0x675b('0x11')](_0x675b('0xc'),_0x3f34b8,_0x17c3fc);_0x4f55d4(_0x17c3fc);});});}exports[_0x675b('0x16')]=function(_0x303a4d){var _0x5cf336=this;return new Promise(function(_0x57867c,_0x35bc04){return db[_0x675b('0x17')]['findAll']({'raw':_0x303a4d['options']?_0x303a4d[_0x675b('0x18')][_0x675b('0x19')]===undefined?!![]:![]:!![],'where':_0x303a4d[_0x675b('0x18')]?_0x303a4d['options'][_0x675b('0x1a')]||null:null,'attributes':_0x303a4d[_0x675b('0x18')]?_0x303a4d['options']['attributes']||null:null,'limit':_0x303a4d[_0x675b('0x18')]?_0x303a4d[_0x675b('0x18')][_0x675b('0x1b')]||null:null,'include':_0x303a4d[_0x675b('0x18')]?_0x303a4d[_0x675b('0x18')][_0x675b('0x1c')]?_[_0x675b('0x1d')](_0x303a4d[_0x675b('0x18')][_0x675b('0x1c')],function(_0x28a243){return{'model':db[_0x28a243['model']],'as':_0x28a243['as'],'attributes':_0x28a243[_0x675b('0x1e')],'include':_0x28a243[_0x675b('0x1c')]?_[_0x675b('0x1d')](_0x28a243[_0x675b('0x1c')],function(_0x507088){return{'model':db[_0x507088[_0x675b('0x1f')]],'as':_0x507088['as'],'attributes':_0x507088[_0x675b('0x1e')],'include':_0x507088['include']?_[_0x675b('0x1d')](_0x507088['include'],function(_0x245cf8){return{'model':db[_0x245cf8[_0x675b('0x1f')]],'as':_0x245cf8['as'],'attributes':_0x245cf8['attributes']};}):[]};}):[]};}):[]:[]})[_0x675b('0xa')](function(_0x44d8e3){logger[_0x675b('0xb')](_0x675b('0x16'),_0x303a4d);logger[_0x675b('0xe')]('GetZohoAccount',_0x303a4d,JSON[_0x675b('0x10')](_0x44d8e3));_0x57867c(_0x44d8e3);})[_0x675b('0x15')](function(_0x4c464d){logger[_0x675b('0x11')](_0x675b('0x16'),_0x4c464d[_0x675b('0x13')],_0x303a4d);_0x35bc04(_0x5cf336[_0x675b('0x11')](0x1f4,_0x4c464d['message']));});});};exports[_0x675b('0x20')]=function(_0xe7c579){var _0x21f34d=this;return new Promise(function(_0x2b2aca,_0x5f579d){return db[_0x675b('0x17')][_0x675b('0x21')]({'raw':_0xe7c579[_0x675b('0x18')]?_0xe7c579[_0x675b('0x18')][_0x675b('0x19')]===undefined?!![]:![]:!![],'where':_0xe7c579[_0x675b('0x18')]?_0xe7c579[_0x675b('0x18')][_0x675b('0x1a')]||null:null,'attributes':_0xe7c579['options']?_0xe7c579[_0x675b('0x18')]['attributes']||null:null,'include':_0xe7c579[_0x675b('0x18')]?_0xe7c579[_0x675b('0x18')]['include']?_['map'](_0xe7c579[_0x675b('0x18')][_0x675b('0x1c')],function(_0x4f9482){return{'model':db[_0x4f9482[_0x675b('0x1f')]],'as':_0x4f9482['as'],'attributes':_0x4f9482[_0x675b('0x1e')],'include':_0x4f9482[_0x675b('0x1c')]?_[_0x675b('0x1d')](_0x4f9482[_0x675b('0x1c')],function(_0x1ddb9f){return{'model':db[_0x1ddb9f['model']],'as':_0x1ddb9f['as'],'attributes':_0x1ddb9f[_0x675b('0x1e')],'include':_0x1ddb9f[_0x675b('0x1c')]?_['map'](_0x1ddb9f['include'],function(_0x918e1c){return{'model':db[_0x918e1c[_0x675b('0x1f')]],'as':_0x918e1c['as'],'attributes':_0x918e1c[_0x675b('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x675b('0xa')](function(_0x181ebb){logger[_0x675b('0xb')](_0x675b('0x20'),_0xe7c579);logger[_0x675b('0xe')](_0x675b('0x20'),_0xe7c579,JSON[_0x675b('0x10')](_0x181ebb));_0x2b2aca(_0x181ebb);})[_0x675b('0x15')](function(_0x573061){logger['error'](_0x675b('0x20'),_0x573061['message'],_0xe7c579);_0x5f579d(_0x21f34d[_0x675b('0x11')](0x1f4,_0x573061[_0x675b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index dcee9d1..3595ff5 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 _0xa5f0=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','post','create','put','update','delete'];(function(_0x1b4b0e,_0x3b42b4){var _0x2a91be=function(_0x2a44da){while(--_0x2a44da){_0x1b4b0e['push'](_0x1b4b0e['shift']());}};_0x2a91be(++_0x3b42b4);}(_0xa5f0,0xfc));var _0x0a5f=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xa5f0[_0x243b59];return _0x3e1676;};'use strict';var multer=require(_0x0a5f('0x0'));var util=require(_0x0a5f('0x1'));var path=require('path');var timeout=require(_0x0a5f('0x2'));var express=require(_0x0a5f('0x3'));var router=express[_0x0a5f('0x4')]();var fs_extra=require(_0x0a5f('0x5'));var auth=require(_0x0a5f('0x6'));var interaction=require(_0x0a5f('0x7'));var config=require('../../config/environment');var controller=require(_0x0a5f('0x8'));router[_0x0a5f('0x9')]('/',auth[_0x0a5f('0xa')](),controller[_0x0a5f('0xb')]);router[_0x0a5f('0x9')](_0x0a5f('0xc'),auth['isAuthenticated'](),controller[_0x0a5f('0xd')]);router[_0x0a5f('0x9')](_0x0a5f('0xe'),auth['isAuthenticated'](),controller[_0x0a5f('0xf')]);router[_0x0a5f('0x9')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x0a5f('0x10')]);router[_0x0a5f('0x9')](_0x0a5f('0x11'),auth[_0x0a5f('0xa')](),controller['getDescriptions']);router[_0x0a5f('0x12')]('/',auth['isAuthenticated'](),controller[_0x0a5f('0x13')]);router[_0x0a5f('0x14')](_0x0a5f('0xc'),auth[_0x0a5f('0xa')](),controller[_0x0a5f('0x15')]);router[_0x0a5f('0x16')](_0x0a5f('0xc'),auth[_0x0a5f('0xa')](),controller[_0x0a5f('0x17')]);module[_0x0a5f('0x18')]=router; \ No newline at end of file +var _0x445e=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','index','/:id','isAuthenticated','show','getSubjects','/:id/descriptions','getDescriptions','put','update','delete'];(function(_0x3ca30d,_0x33b8cd){var _0x4f0fc0=function(_0x2a8012){while(--_0x2a8012){_0x3ca30d['push'](_0x3ca30d['shift']());}};_0x4f0fc0(++_0x33b8cd);}(_0x445e,0x8c));var _0xe445=function(_0x7ef41e,_0x1da6c4){_0x7ef41e=_0x7ef41e-0x0;var _0x1cfb32=_0x445e[_0x7ef41e];return _0x1cfb32;};'use strict';var multer=require(_0xe445('0x0'));var util=require('util');var path=require(_0xe445('0x1'));var timeout=require(_0xe445('0x2'));var express=require(_0xe445('0x3'));var router=express[_0xe445('0x4')]();var fs_extra=require(_0xe445('0x5'));var auth=require(_0xe445('0x6'));var interaction=require(_0xe445('0x7'));var config=require(_0xe445('0x8'));var controller=require(_0xe445('0x9'));router[_0xe445('0xa')]('/',auth['isAuthenticated'](),controller[_0xe445('0xb')]);router['get'](_0xe445('0xc'),auth[_0xe445('0xd')](),controller[_0xe445('0xe')]);router[_0xe445('0xa')]('/:id/fields',auth[_0xe445('0xd')](),controller['getFields']);router[_0xe445('0xa')]('/:id/subjects',auth[_0xe445('0xd')](),controller[_0xe445('0xf')]);router[_0xe445('0xa')](_0xe445('0x10'),auth[_0xe445('0xd')](),controller[_0xe445('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe445('0x12')]('/:id',auth[_0xe445('0xd')](),controller[_0xe445('0x13')]);router[_0xe445('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe445('0x15')]);module[_0xe445('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 9fb4ead..77df969 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 _0x5e89=['lead','contact','ENUM','contact_lead','sequelize','exports','STRING'];(function(_0x14d269,_0x6517c2){var _0xd0b684=function(_0x34241e){while(--_0x34241e){_0x14d269['push'](_0x14d269['shift']());}};_0xd0b684(++_0x6517c2);}(_0x5e89,0x1af));var _0x95e8=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x5e89[_0x1f9f37];return _0x21c080;};'use strict';var Sequelize=require(_0x95e8('0x0'));module[_0x95e8('0x1')]={'name':{'type':Sequelize[_0x95e8('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x95e8('0x3'),_0x95e8('0x4'),'nothing'),'defaultValue':_0x95e8('0x3')},'moduleSearch':{'type':Sequelize[_0x95e8('0x5')](_0x95e8('0x6'),_0x95e8('0x4'),_0x95e8('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x95e8('0x2')]}}; \ No newline at end of file +var _0xa9dd=['exports','STRING','lead','contact','nothing','contact_lead'];(function(_0x41be5e,_0x179575){var _0x32cdee=function(_0x181214){while(--_0x181214){_0x41be5e['push'](_0x41be5e['shift']());}};_0x32cdee(++_0x179575);}(_0xa9dd,0x1c2));var _0xda9d=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xa9dd[_0x119629];return _0x49a771;};'use strict';var Sequelize=require('sequelize');module[_0xda9d('0x0')]={'name':{'type':Sequelize[_0xda9d('0x1')]},'moduleCreate':{'type':Sequelize['ENUM'](_0xda9d('0x2'),_0xda9d('0x3'),_0xda9d('0x4')),'defaultValue':_0xda9d('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0xda9d('0x5'),_0xda9d('0x3'),'lead'),'defaultValue':_0xda9d('0x5')},'description':{'type':Sequelize[_0xda9d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 252d2ba..7738e5c 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 _0x0d16=['to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../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','update','then','destroy','error','name','index','ZohoConfiguration','rawAttributes','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','findOne','ZohoField','order','pick','getFields','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x5d015d,_0x331109){var _0x2794a0=function(_0x419597){while(--_0x419597){_0x5d015d['push'](_0x5d015d['shift']());}};_0x2794a0(++_0x331109);}(_0x0d16,0x13a));var _0x60d1=function(_0x530b5e,_0x44a1fe){_0x530b5e=_0x530b5e-0x0;var _0x47b355=_0x0d16[_0x530b5e];return _0x47b355;};'use strict';var emlformat=require(_0x60d1('0x0'));var rimraf=require(_0x60d1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x60d1('0x2'));var rp=require(_0x60d1('0x3'));var moment=require(_0x60d1('0x4'));var BPromise=require(_0x60d1('0x5'));var Mustache=require(_0x60d1('0x6'));var util=require(_0x60d1('0x7'));var path=require(_0x60d1('0x8'));var sox=require(_0x60d1('0x9'));var csv=require(_0x60d1('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x60d1('0xb'));var _=require(_0x60d1('0xc'));var squel=require('squel');var crypto=require(_0x60d1('0xd'));var jsforce=require(_0x60d1('0xe'));var deskjs=require(_0x60d1('0xf'));var toCsv=require(_0x60d1('0xa'));var querystring=require(_0x60d1('0x10'));var Papa=require('papaparse');var Redis=require(_0x60d1('0x11'));var authService=require(_0x60d1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x60d1('0x13'));var hardwareService=require(_0x60d1('0x14'));var logger=require(_0x60d1('0x15'))(_0x60d1('0x16'));var utils=require('../../config/utils');var config=require(_0x60d1('0x17'));var licenseUtil=require(_0x60d1('0x18'));var db=require(_0x60d1('0x19'))['db'];function respondWithStatusCode(_0x2392cd,_0xf9ad35){_0xf9ad35=_0xf9ad35||0xcc;return function(_0x1dc4b4){if(_0x1dc4b4){return _0x2392cd[_0x60d1('0x1a')](_0xf9ad35);}return _0x2392cd[_0x60d1('0x1b')](_0xf9ad35)[_0x60d1('0x1c')]();};}function respondWithResult(_0x44fe3f,_0x40e636){_0x40e636=_0x40e636||0xc8;return function(_0x488e08){if(_0x488e08){return _0x44fe3f['status'](_0x40e636)[_0x60d1('0x1d')](_0x488e08);}};}function respondWithFilteredResult(_0xc70b1b,_0x2b1398){return function(_0x592dc4){if(_0x592dc4){var _0xeb833c=typeof _0x2b1398[_0x60d1('0x1e')]===_0x60d1('0x1f')&&typeof _0x2b1398[_0x60d1('0x20')]==='undefined';var _0xd9b6a4=_0x592dc4[_0x60d1('0x21')];var _0x58faac=_0xeb833c?0x0:_0x2b1398[_0x60d1('0x1e')];var _0x491a39=_0xeb833c?_0x592dc4[_0x60d1('0x21')]:_0x2b1398[_0x60d1('0x1e')]+_0x2b1398['limit'];var _0x5ef1b7;if(_0x491a39>=_0xd9b6a4){_0x491a39=_0xd9b6a4;_0x5ef1b7=0xc8;}else{_0x5ef1b7=0xce;}_0xc70b1b[_0x60d1('0x1b')](_0x5ef1b7);return _0xc70b1b[_0x60d1('0x22')]('Content-Range',_0x58faac+'-'+_0x491a39+'/'+_0xd9b6a4)[_0x60d1('0x1d')](_0x592dc4);}return null;};}function patchUpdates(_0x5b3c6b){return function(_0x5a89aa){try{jsonpatch[_0x60d1('0x23')](_0x5a89aa,_0x5b3c6b,!![]);}catch(_0x53daca){return BPromise['reject'](_0x53daca);}return _0x5a89aa[_0x60d1('0x24')]();};}function saveUpdates(_0x6ae861,_0x6b6799){return function(_0x390aa6){if(_0x390aa6){return _0x390aa6[_0x60d1('0x25')](_0x6ae861)[_0x60d1('0x26')](function(_0x4eec71){return _0x4eec71;});}return null;};}function removeEntity(_0x2a9ff1,_0x57846d){return function(_0x3ed56b){if(_0x3ed56b){return _0x3ed56b[_0x60d1('0x27')]()[_0x60d1('0x26')](function(){_0x2a9ff1[_0x60d1('0x1b')](0xcc)[_0x60d1('0x1c')]();});}};}function handleEntityNotFound(_0x27cf0d,_0x3ce954){return function(_0x416538){if(!_0x416538){_0x27cf0d[_0x60d1('0x1a')](0x194);}return _0x416538;};}function handleError(_0xfaa8e2,_0x2c22e4){_0x2c22e4=_0x2c22e4||0x1f4;return function(_0x3a0fb0){logger[_0x60d1('0x28')](_0x3a0fb0['stack']);if(_0x3a0fb0[_0x60d1('0x29')]){delete _0x3a0fb0[_0x60d1('0x29')];}_0xfaa8e2[_0x60d1('0x1b')](_0x2c22e4)['send'](_0x3a0fb0);};}exports[_0x60d1('0x2a')]=function(_0xd6bcdf,_0x3d9e11){var _0x1b7686={},_0x58d354={},_0x3ce6ee={'count':0x0,'rows':[]};var _0xcc4431=_['map'](db[_0x60d1('0x2b')][_0x60d1('0x2c')],function(_0x128819){return{'name':_0x128819[_0x60d1('0x2d')],'type':_0x128819[_0x60d1('0x2e')][_0x60d1('0x2f')]};});_0x58d354['model']=_[_0x60d1('0x30')](_0xcc4431,_0x60d1('0x29'));_0x58d354[_0x60d1('0x31')]=_[_0x60d1('0x32')](_0xd6bcdf['query']);_0x58d354['filters']=_[_0x60d1('0x33')](_0x58d354[_0x60d1('0x34')],_0x58d354['query']);_0x1b7686[_0x60d1('0x35')]=_[_0x60d1('0x33')](_0x58d354['model'],qs[_0x60d1('0x36')](_0xd6bcdf['query']['fields']));_0x1b7686[_0x60d1('0x35')]=_0x1b7686[_0x60d1('0x35')]['length']?_0x1b7686[_0x60d1('0x35')]:_0x58d354[_0x60d1('0x34')];if(!_0xd6bcdf[_0x60d1('0x31')][_0x60d1('0x37')](_0x60d1('0x38'))){_0x1b7686['limit']=qs[_0x60d1('0x20')](_0xd6bcdf[_0x60d1('0x31')][_0x60d1('0x20')]);_0x1b7686[_0x60d1('0x1e')]=qs['offset'](_0xd6bcdf[_0x60d1('0x31')][_0x60d1('0x1e')]);}_0x1b7686['order']=qs[_0x60d1('0x39')](_0xd6bcdf[_0x60d1('0x31')]['sort']);_0x1b7686[_0x60d1('0x3a')]=qs[_0x60d1('0x3b')](_['pick'](_0xd6bcdf[_0x60d1('0x31')],_0x58d354[_0x60d1('0x3b')]),_0xcc4431);if(_0xd6bcdf[_0x60d1('0x31')]['filter']){_0x1b7686[_0x60d1('0x3a')]=_['merge'](_0x1b7686['where'],{'$or':_[_0x60d1('0x30')](_0xcc4431,function(_0x25edb9){if(_0x25edb9[_0x60d1('0x2e')]!==_0x60d1('0x3c')){var _0x241b96={};_0x241b96[_0x25edb9[_0x60d1('0x29')]]={'$like':'%'+_0xd6bcdf[_0x60d1('0x31')][_0x60d1('0x3d')]+'%'};return _0x241b96;}})});}_0x1b7686=_[_0x60d1('0x3e')]({},_0x1b7686,_0xd6bcdf[_0x60d1('0x3f')]);var _0x307dbe={'where':_0x1b7686['where']};return db[_0x60d1('0x2b')]['count'](_0x307dbe)[_0x60d1('0x26')](function(_0x511415){_0x3ce6ee[_0x60d1('0x21')]=_0x511415;if(_0xd6bcdf[_0x60d1('0x31')][_0x60d1('0x40')]){_0x1b7686[_0x60d1('0x41')]=[{'all':!![]}];}return db[_0x60d1('0x2b')][_0x60d1('0x42')](_0x1b7686);})['then'](function(_0x387b2f){_0x3ce6ee[_0x60d1('0x43')]=_0x387b2f;return _0x3ce6ee;})[_0x60d1('0x26')](respondWithFilteredResult(_0x3d9e11,_0x1b7686))['catch'](handleError(_0x3d9e11,null));};exports[_0x60d1('0x44')]=function(_0x34c946,_0x529f63){var _0x409e42={'raw':![],'where':{'id':_0x34c946[_0x60d1('0x45')]['id']}},_0x599d1e={};_0x599d1e['model']=_[_0x60d1('0x32')](db[_0x60d1('0x2b')]['rawAttributes']);_0x599d1e[_0x60d1('0x31')]=_['keys'](_0x34c946[_0x60d1('0x31')]);_0x599d1e[_0x60d1('0x3b')]=_[_0x60d1('0x33')](_0x599d1e[_0x60d1('0x34')],_0x599d1e[_0x60d1('0x31')]);_0x409e42[_0x60d1('0x35')]=_['intersection'](_0x599d1e[_0x60d1('0x34')],qs['fields'](_0x34c946[_0x60d1('0x31')][_0x60d1('0x36')]));_0x409e42[_0x60d1('0x35')]=_0x409e42['attributes'][_0x60d1('0x46')]?_0x409e42[_0x60d1('0x35')]:_0x599d1e[_0x60d1('0x34')];if(_0x34c946['query'][_0x60d1('0x40')]){_0x409e42[_0x60d1('0x41')]=[{'all':!![]}];}_0x409e42=_[_0x60d1('0x3e')]({},_0x409e42,_0x34c946['options']);return db[_0x60d1('0x2b')][_0x60d1('0x47')](_0x409e42)[_0x60d1('0x26')](handleEntityNotFound(_0x529f63,null))['then'](respondWithResult(_0x529f63,null))[_0x60d1('0x48')](handleError(_0x529f63,null));};exports[_0x60d1('0x49')]=function(_0x170296,_0x167fc6){return db[_0x60d1('0x2b')][_0x60d1('0x49')](_0x170296[_0x60d1('0x4a')],{})[_0x60d1('0x26')](respondWithResult(_0x167fc6,0xc9))[_0x60d1('0x48')](handleError(_0x167fc6,null));};exports[_0x60d1('0x25')]=function(_0x3c0165,_0x4240d5){if(_0x3c0165[_0x60d1('0x4a')]['id']){delete _0x3c0165[_0x60d1('0x4a')]['id'];}return db[_0x60d1('0x2b')][_0x60d1('0x47')]({'where':{'id':_0x3c0165[_0x60d1('0x45')]['id']}})[_0x60d1('0x26')](handleEntityNotFound(_0x4240d5,null))[_0x60d1('0x26')](saveUpdates(_0x3c0165[_0x60d1('0x4a')],null))[_0x60d1('0x26')](respondWithResult(_0x4240d5,null))[_0x60d1('0x48')](handleError(_0x4240d5,null));};exports[_0x60d1('0x27')]=function(_0x5e61ab,_0x264875){return db[_0x60d1('0x2b')]['find']({'where':{'id':_0x5e61ab[_0x60d1('0x45')]['id']}})[_0x60d1('0x26')](handleEntityNotFound(_0x264875,null))[_0x60d1('0x26')](removeEntity(_0x264875,null))['catch'](handleError(_0x264875,null));};exports['getFields']=function(_0x447223,_0x35469f,_0x4973bd){var _0x270546={};var _0x49ed1b={};var _0x485935;var _0x2d97e4;return db[_0x60d1('0x2b')][_0x60d1('0x4b')]({'where':{'id':_0x447223['params']['id']}})['then'](handleEntityNotFound(_0x35469f,null))[_0x60d1('0x26')](function(_0x464e84){if(_0x464e84){_0x485935=_0x464e84;_0x49ed1b['model']=_[_0x60d1('0x32')](db[_0x60d1('0x4c')][_0x60d1('0x2c')]);_0x49ed1b[_0x60d1('0x31')]=_[_0x60d1('0x32')](_0x447223[_0x60d1('0x31')]);_0x49ed1b[_0x60d1('0x3b')]=_[_0x60d1('0x33')](_0x49ed1b[_0x60d1('0x34')],_0x49ed1b['query']);_0x270546[_0x60d1('0x35')]=_[_0x60d1('0x33')](_0x49ed1b[_0x60d1('0x34')],qs[_0x60d1('0x36')](_0x447223[_0x60d1('0x31')]['fields']));_0x270546[_0x60d1('0x35')]=_0x270546['attributes'][_0x60d1('0x46')]?_0x270546[_0x60d1('0x35')]:_0x49ed1b[_0x60d1('0x34')];_0x270546[_0x60d1('0x4d')]=qs[_0x60d1('0x39')](_0x447223[_0x60d1('0x31')][_0x60d1('0x39')]);_0x270546[_0x60d1('0x3a')]=qs['filters'](_[_0x60d1('0x4e')](_0x447223[_0x60d1('0x31')],_0x49ed1b[_0x60d1('0x3b')]));if(_0x447223[_0x60d1('0x31')][_0x60d1('0x3d')]){_0x270546[_0x60d1('0x3a')]=_[_0x60d1('0x3e')](_0x270546[_0x60d1('0x3a')],{'$or':_[_0x60d1('0x30')](_0x270546['attributes'],function(_0x5ea664){var _0x1bb1e7={};_0x1bb1e7[_0x5ea664]={'$like':'%'+_0x447223[_0x60d1('0x31')][_0x60d1('0x3d')]+'%'};return _0x1bb1e7;})});}_0x270546=_['merge']({},_0x270546,_0x447223['options']);return _0x485935[_0x60d1('0x4f')](_0x270546);}})[_0x60d1('0x26')](function(_0x2cee31){if(_0x2cee31){_0x2d97e4=_0x2cee31[_0x60d1('0x46')];if(!_0x447223[_0x60d1('0x31')][_0x60d1('0x37')](_0x60d1('0x38'))){_0x270546['limit']=qs['limit'](_0x447223[_0x60d1('0x31')][_0x60d1('0x20')]);_0x270546[_0x60d1('0x1e')]=qs[_0x60d1('0x1e')](_0x447223[_0x60d1('0x31')][_0x60d1('0x1e')]);}return _0x485935[_0x60d1('0x4f')](_0x270546);}})[_0x60d1('0x26')](function(_0x362f0b){if(_0x362f0b){return _0x362f0b?{'count':_0x2d97e4,'rows':_0x362f0b}:null;}})[_0x60d1('0x26')](respondWithResult(_0x35469f,null))['catch'](handleError(_0x35469f,null));};exports['getSubjects']=function(_0x1afe79,_0x23b715,_0x43a3aa){var _0x3a23cd={};var _0x14c578={};var _0x3fb207;var _0x39eda5;return db[_0x60d1('0x2b')][_0x60d1('0x4b')]({'where':{'id':_0x1afe79[_0x60d1('0x45')]['id']}})[_0x60d1('0x26')](handleEntityNotFound(_0x23b715,null))[_0x60d1('0x26')](function(_0x500a77){if(_0x500a77){_0x3fb207=_0x500a77;_0x14c578[_0x60d1('0x34')]=_[_0x60d1('0x32')](db[_0x60d1('0x4c')]['rawAttributes']);_0x14c578[_0x60d1('0x31')]=_[_0x60d1('0x32')](_0x1afe79[_0x60d1('0x31')]);_0x14c578['filters']=_[_0x60d1('0x33')](_0x14c578[_0x60d1('0x34')],_0x14c578[_0x60d1('0x31')]);_0x3a23cd[_0x60d1('0x35')]=_[_0x60d1('0x33')](_0x14c578[_0x60d1('0x34')],qs[_0x60d1('0x36')](_0x1afe79[_0x60d1('0x31')][_0x60d1('0x36')]));_0x3a23cd[_0x60d1('0x35')]=_0x3a23cd[_0x60d1('0x35')][_0x60d1('0x46')]?_0x3a23cd[_0x60d1('0x35')]:_0x14c578[_0x60d1('0x34')];_0x3a23cd[_0x60d1('0x4d')]=qs['sort'](_0x1afe79['query']['sort']);_0x3a23cd[_0x60d1('0x3a')]=qs[_0x60d1('0x3b')](_['pick'](_0x1afe79[_0x60d1('0x31')],_0x14c578[_0x60d1('0x3b')]));if(_0x1afe79[_0x60d1('0x31')][_0x60d1('0x3d')]){_0x3a23cd[_0x60d1('0x3a')]=_[_0x60d1('0x3e')](_0x3a23cd[_0x60d1('0x3a')],{'$or':_[_0x60d1('0x30')](_0x3a23cd['attributes'],function(_0x4e49ce){var _0x105ad8={};_0x105ad8[_0x4e49ce]={'$like':'%'+_0x1afe79[_0x60d1('0x31')][_0x60d1('0x3d')]+'%'};return _0x105ad8;})});}_0x3a23cd=_[_0x60d1('0x3e')]({},_0x3a23cd,_0x1afe79[_0x60d1('0x3f')]);return _0x3fb207['getSubjects'](_0x3a23cd);}})[_0x60d1('0x26')](function(_0x39973c){if(_0x39973c){_0x39eda5=_0x39973c[_0x60d1('0x46')];if(!_0x1afe79[_0x60d1('0x31')]['hasOwnProperty'](_0x60d1('0x38'))){_0x3a23cd['limit']=qs[_0x60d1('0x20')](_0x1afe79[_0x60d1('0x31')]['limit']);_0x3a23cd['offset']=qs[_0x60d1('0x1e')](_0x1afe79[_0x60d1('0x31')][_0x60d1('0x1e')]);}return _0x3fb207['getSubjects'](_0x3a23cd);}})[_0x60d1('0x26')](function(_0x361621){if(_0x361621){return _0x361621?{'count':_0x39eda5,'rows':_0x361621}:null;}})['then'](respondWithResult(_0x23b715,null))[_0x60d1('0x48')](handleError(_0x23b715,null));};exports[_0x60d1('0x50')]=function(_0x160605,_0x395161,_0x343e48){var _0x465052={};var _0x5a9fae={};var _0x423ef6;var _0x2f7db8;return db[_0x60d1('0x2b')][_0x60d1('0x4b')]({'where':{'id':_0x160605['params']['id']}})[_0x60d1('0x26')](handleEntityNotFound(_0x395161,null))['then'](function(_0x2b729d){if(_0x2b729d){_0x423ef6=_0x2b729d;_0x5a9fae[_0x60d1('0x34')]=_['keys'](db[_0x60d1('0x4c')][_0x60d1('0x2c')]);_0x5a9fae[_0x60d1('0x31')]=_[_0x60d1('0x32')](_0x160605[_0x60d1('0x31')]);_0x5a9fae[_0x60d1('0x3b')]=_[_0x60d1('0x33')](_0x5a9fae['model'],_0x5a9fae[_0x60d1('0x31')]);_0x465052[_0x60d1('0x35')]=_[_0x60d1('0x33')](_0x5a9fae[_0x60d1('0x34')],qs[_0x60d1('0x36')](_0x160605[_0x60d1('0x31')][_0x60d1('0x36')]));_0x465052['attributes']=_0x465052[_0x60d1('0x35')][_0x60d1('0x46')]?_0x465052[_0x60d1('0x35')]:_0x5a9fae[_0x60d1('0x34')];_0x465052[_0x60d1('0x4d')]=qs[_0x60d1('0x39')](_0x160605[_0x60d1('0x31')]['sort']);_0x465052[_0x60d1('0x3a')]=qs['filters'](_[_0x60d1('0x4e')](_0x160605[_0x60d1('0x31')],_0x5a9fae['filters']));if(_0x160605[_0x60d1('0x31')]['filter']){_0x465052[_0x60d1('0x3a')]=_[_0x60d1('0x3e')](_0x465052['where'],{'$or':_[_0x60d1('0x30')](_0x465052['attributes'],function(_0x54f8a1){var _0x35e2c5={};_0x35e2c5[_0x54f8a1]={'$like':'%'+_0x160605[_0x60d1('0x31')][_0x60d1('0x3d')]+'%'};return _0x35e2c5;})});}_0x465052=_[_0x60d1('0x3e')]({},_0x465052,_0x160605['options']);return _0x423ef6[_0x60d1('0x50')](_0x465052);}})[_0x60d1('0x26')](function(_0x44ba92){if(_0x44ba92){_0x2f7db8=_0x44ba92[_0x60d1('0x46')];if(!_0x160605[_0x60d1('0x31')][_0x60d1('0x37')]('nolimit')){_0x465052[_0x60d1('0x20')]=qs['limit'](_0x160605[_0x60d1('0x31')]['limit']);_0x465052[_0x60d1('0x1e')]=qs[_0x60d1('0x1e')](_0x160605[_0x60d1('0x31')][_0x60d1('0x1e')]);}return _0x423ef6[_0x60d1('0x50')](_0x465052);}})['then'](function(_0x34abc0){if(_0x34abc0){return _0x34abc0?{'count':_0x2f7db8,'rows':_0x34abc0}:null;}})[_0x60d1('0x26')](respondWithResult(_0x395161,null))[_0x60d1('0x48')](handleError(_0x395161,null));}; \ No newline at end of file +var _0xc60f=['fields','find','create','body','findOne','ZohoField','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','json','reject','update','then','destroy','error','stack','name','send','index','map','ZohoConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes'];(function(_0x38192c,_0x231e41){var _0x31d64e=function(_0x579a6e){while(--_0x579a6e){_0x38192c['push'](_0x38192c['shift']());}};_0x31d64e(++_0x231e41);}(_0xc60f,0xa6));var _0xfc60=function(_0x2136d5,_0x4b0479){_0x2136d5=_0x2136d5-0x0;var _0x3bee2e=_0xc60f[_0x2136d5];return _0x3bee2e;};'use strict';var emlformat=require(_0xfc60('0x0'));var rimraf=require(_0xfc60('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfc60('0x2'));var rp=require(_0xfc60('0x3'));var moment=require('moment');var BPromise=require(_0xfc60('0x4'));var Mustache=require(_0xfc60('0x5'));var util=require('util');var path=require(_0xfc60('0x6'));var sox=require('sox');var csv=require(_0xfc60('0x7'));var ejs=require(_0xfc60('0x8'));var fs=require('fs');var fs_extra=require(_0xfc60('0x9'));var _=require(_0xfc60('0xa'));var squel=require(_0xfc60('0xb'));var crypto=require(_0xfc60('0xc'));var jsforce=require(_0xfc60('0xd'));var deskjs=require(_0xfc60('0xe'));var toCsv=require(_0xfc60('0x7'));var querystring=require(_0xfc60('0xf'));var Papa=require('papaparse');var Redis=require(_0xfc60('0x10'));var authService=require(_0xfc60('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xfc60('0x12'));var hardwareService=require(_0xfc60('0x13'));var logger=require(_0xfc60('0x14'))('api');var utils=require(_0xfc60('0x15'));var config=require(_0xfc60('0x16'));var licenseUtil=require(_0xfc60('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3abf5f,_0x34294c){_0x34294c=_0x34294c||0xcc;return function(_0x3920e4){if(_0x3920e4){return _0x3abf5f[_0xfc60('0x18')](_0x34294c);}return _0x3abf5f[_0xfc60('0x19')](_0x34294c)[_0xfc60('0x1a')]();};}function respondWithResult(_0x4cbd18,_0x1b3c48){_0x1b3c48=_0x1b3c48||0xc8;return function(_0x1d797a){if(_0x1d797a){return _0x4cbd18[_0xfc60('0x19')](_0x1b3c48)['json'](_0x1d797a);}};}function respondWithFilteredResult(_0x235fbd,_0x5ea5b2){return function(_0x224603){if(_0x224603){var _0x1699af=typeof _0x5ea5b2[_0xfc60('0x1b')]===_0xfc60('0x1c')&&typeof _0x5ea5b2[_0xfc60('0x1d')]===_0xfc60('0x1c');var _0x3de1b5=_0x224603['count'];var _0x3fd0aa=_0x1699af?0x0:_0x5ea5b2['offset'];var _0x28e8ec=_0x1699af?_0x224603[_0xfc60('0x1e')]:_0x5ea5b2[_0xfc60('0x1b')]+_0x5ea5b2[_0xfc60('0x1d')];var _0xb90a55;if(_0x28e8ec>=_0x3de1b5){_0x28e8ec=_0x3de1b5;_0xb90a55=0xc8;}else{_0xb90a55=0xce;}_0x235fbd[_0xfc60('0x19')](_0xb90a55);return _0x235fbd['set']('Content-Range',_0x3fd0aa+'-'+_0x28e8ec+'/'+_0x3de1b5)[_0xfc60('0x1f')](_0x224603);}return null;};}function patchUpdates(_0xab8753){return function(_0x21da25){try{jsonpatch['apply'](_0x21da25,_0xab8753,!![]);}catch(_0x1007e9){return BPromise[_0xfc60('0x20')](_0x1007e9);}return _0x21da25['save']();};}function saveUpdates(_0x4c644d,_0x19f592){return function(_0x3203e5){if(_0x3203e5){return _0x3203e5[_0xfc60('0x21')](_0x4c644d)[_0xfc60('0x22')](function(_0x1bda0f){return _0x1bda0f;});}return null;};}function removeEntity(_0x2fedca,_0x3c7610){return function(_0x2faf55){if(_0x2faf55){return _0x2faf55[_0xfc60('0x23')]()[_0xfc60('0x22')](function(){_0x2fedca['status'](0xcc)[_0xfc60('0x1a')]();});}};}function handleEntityNotFound(_0xac0e7,_0x28acf6){return function(_0xeb057d){if(!_0xeb057d){_0xac0e7[_0xfc60('0x18')](0x194);}return _0xeb057d;};}function handleError(_0xfb188c,_0x438776){_0x438776=_0x438776||0x1f4;return function(_0x296d94){logger[_0xfc60('0x24')](_0x296d94[_0xfc60('0x25')]);if(_0x296d94[_0xfc60('0x26')]){delete _0x296d94[_0xfc60('0x26')];}_0xfb188c[_0xfc60('0x19')](_0x438776)[_0xfc60('0x27')](_0x296d94);};}exports[_0xfc60('0x28')]=function(_0x225e85,_0x22f888){var _0x230759={},_0x4d1591={},_0x12014d={'count':0x0,'rows':[]};var _0x47d833=_[_0xfc60('0x29')](db[_0xfc60('0x2a')]['rawAttributes'],function(_0x4aa14b){return{'name':_0x4aa14b[_0xfc60('0x2b')],'type':_0x4aa14b[_0xfc60('0x2c')]['key']};});_0x4d1591[_0xfc60('0x2d')]=_[_0xfc60('0x29')](_0x47d833,'name');_0x4d1591[_0xfc60('0x2e')]=_[_0xfc60('0x2f')](_0x225e85[_0xfc60('0x2e')]);_0x4d1591[_0xfc60('0x30')]=_[_0xfc60('0x31')](_0x4d1591['model'],_0x4d1591[_0xfc60('0x2e')]);_0x230759[_0xfc60('0x32')]=_[_0xfc60('0x31')](_0x4d1591[_0xfc60('0x2d')],qs['fields'](_0x225e85[_0xfc60('0x2e')]['fields']));_0x230759[_0xfc60('0x32')]=_0x230759['attributes'][_0xfc60('0x33')]?_0x230759[_0xfc60('0x32')]:_0x4d1591[_0xfc60('0x2d')];if(!_0x225e85['query'][_0xfc60('0x34')]('nolimit')){_0x230759[_0xfc60('0x1d')]=qs[_0xfc60('0x1d')](_0x225e85['query'][_0xfc60('0x1d')]);_0x230759[_0xfc60('0x1b')]=qs[_0xfc60('0x1b')](_0x225e85['query'][_0xfc60('0x1b')]);}_0x230759[_0xfc60('0x35')]=qs[_0xfc60('0x36')](_0x225e85[_0xfc60('0x2e')]['sort']);_0x230759[_0xfc60('0x37')]=qs[_0xfc60('0x30')](_[_0xfc60('0x38')](_0x225e85['query'],_0x4d1591[_0xfc60('0x30')]),_0x47d833);if(_0x225e85[_0xfc60('0x2e')][_0xfc60('0x39')]){_0x230759[_0xfc60('0x37')]=_['merge'](_0x230759[_0xfc60('0x37')],{'$or':_[_0xfc60('0x29')](_0x47d833,function(_0x37d5ce){if(_0x37d5ce[_0xfc60('0x2c')]!==_0xfc60('0x3a')){var _0x49e60c={};_0x49e60c[_0x37d5ce['name']]={'$like':'%'+_0x225e85[_0xfc60('0x2e')]['filter']+'%'};return _0x49e60c;}})});}_0x230759=_[_0xfc60('0x3b')]({},_0x230759,_0x225e85[_0xfc60('0x3c')]);var _0x372a39={'where':_0x230759['where']};return db['ZohoConfiguration'][_0xfc60('0x1e')](_0x372a39)['then'](function(_0x10bd3c){_0x12014d[_0xfc60('0x1e')]=_0x10bd3c;if(_0x225e85[_0xfc60('0x2e')][_0xfc60('0x3d')]){_0x230759[_0xfc60('0x3e')]=[{'all':!![]}];}return db['ZohoConfiguration']['findAll'](_0x230759);})[_0xfc60('0x22')](function(_0x1ff722){_0x12014d[_0xfc60('0x3f')]=_0x1ff722;return _0x12014d;})[_0xfc60('0x22')](respondWithFilteredResult(_0x22f888,_0x230759))[_0xfc60('0x40')](handleError(_0x22f888,null));};exports[_0xfc60('0x41')]=function(_0x2db3ee,_0x4319af){var _0x2225d7={'raw':![],'where':{'id':_0x2db3ee[_0xfc60('0x42')]['id']}},_0x5c6d21={};_0x5c6d21[_0xfc60('0x2d')]=_[_0xfc60('0x2f')](db[_0xfc60('0x2a')][_0xfc60('0x43')]);_0x5c6d21['query']=_[_0xfc60('0x2f')](_0x2db3ee[_0xfc60('0x2e')]);_0x5c6d21[_0xfc60('0x30')]=_[_0xfc60('0x31')](_0x5c6d21[_0xfc60('0x2d')],_0x5c6d21[_0xfc60('0x2e')]);_0x2225d7[_0xfc60('0x32')]=_[_0xfc60('0x31')](_0x5c6d21[_0xfc60('0x2d')],qs['fields'](_0x2db3ee[_0xfc60('0x2e')][_0xfc60('0x44')]));_0x2225d7['attributes']=_0x2225d7[_0xfc60('0x32')]['length']?_0x2225d7['attributes']:_0x5c6d21['model'];if(_0x2db3ee[_0xfc60('0x2e')][_0xfc60('0x3d')]){_0x2225d7[_0xfc60('0x3e')]=[{'all':!![]}];}_0x2225d7=_[_0xfc60('0x3b')]({},_0x2225d7,_0x2db3ee[_0xfc60('0x3c')]);return db[_0xfc60('0x2a')][_0xfc60('0x45')](_0x2225d7)['then'](handleEntityNotFound(_0x4319af,null))['then'](respondWithResult(_0x4319af,null))[_0xfc60('0x40')](handleError(_0x4319af,null));};exports[_0xfc60('0x46')]=function(_0x4b7d85,_0x3d6953){return db[_0xfc60('0x2a')][_0xfc60('0x46')](_0x4b7d85[_0xfc60('0x47')],{})[_0xfc60('0x22')](respondWithResult(_0x3d6953,0xc9))[_0xfc60('0x40')](handleError(_0x3d6953,null));};exports['update']=function(_0x3027b8,_0x1c6d49){if(_0x3027b8['body']['id']){delete _0x3027b8[_0xfc60('0x47')]['id'];}return db[_0xfc60('0x2a')]['find']({'where':{'id':_0x3027b8[_0xfc60('0x42')]['id']}})[_0xfc60('0x22')](handleEntityNotFound(_0x1c6d49,null))[_0xfc60('0x22')](saveUpdates(_0x3027b8[_0xfc60('0x47')],null))[_0xfc60('0x22')](respondWithResult(_0x1c6d49,null))[_0xfc60('0x40')](handleError(_0x1c6d49,null));};exports[_0xfc60('0x23')]=function(_0x359a89,_0xa1d3e3){return db[_0xfc60('0x2a')][_0xfc60('0x45')]({'where':{'id':_0x359a89[_0xfc60('0x42')]['id']}})[_0xfc60('0x22')](handleEntityNotFound(_0xa1d3e3,null))[_0xfc60('0x22')](removeEntity(_0xa1d3e3,null))['catch'](handleError(_0xa1d3e3,null));};exports['getFields']=function(_0x37f820,_0x3ec071,_0x58a4f9){var _0x317533={};var _0x5d3f6c={};var _0x27187b;var _0x52328c;return db[_0xfc60('0x2a')][_0xfc60('0x48')]({'where':{'id':_0x37f820[_0xfc60('0x42')]['id']}})['then'](handleEntityNotFound(_0x3ec071,null))['then'](function(_0x27b3b5){if(_0x27b3b5){_0x27187b=_0x27b3b5;_0x5d3f6c[_0xfc60('0x2d')]=_[_0xfc60('0x2f')](db[_0xfc60('0x49')]['rawAttributes']);_0x5d3f6c[_0xfc60('0x2e')]=_[_0xfc60('0x2f')](_0x37f820[_0xfc60('0x2e')]);_0x5d3f6c[_0xfc60('0x30')]=_[_0xfc60('0x31')](_0x5d3f6c[_0xfc60('0x2d')],_0x5d3f6c[_0xfc60('0x2e')]);_0x317533[_0xfc60('0x32')]=_[_0xfc60('0x31')](_0x5d3f6c[_0xfc60('0x2d')],qs[_0xfc60('0x44')](_0x37f820['query'][_0xfc60('0x44')]));_0x317533[_0xfc60('0x32')]=_0x317533[_0xfc60('0x32')][_0xfc60('0x33')]?_0x317533[_0xfc60('0x32')]:_0x5d3f6c[_0xfc60('0x2d')];_0x317533[_0xfc60('0x35')]=qs[_0xfc60('0x36')](_0x37f820[_0xfc60('0x2e')][_0xfc60('0x36')]);_0x317533['where']=qs[_0xfc60('0x30')](_[_0xfc60('0x38')](_0x37f820[_0xfc60('0x2e')],_0x5d3f6c['filters']));if(_0x37f820[_0xfc60('0x2e')][_0xfc60('0x39')]){_0x317533['where']=_['merge'](_0x317533[_0xfc60('0x37')],{'$or':_['map'](_0x317533[_0xfc60('0x32')],function(_0x4a63ce){var _0x2a8ece={};_0x2a8ece[_0x4a63ce]={'$like':'%'+_0x37f820['query'][_0xfc60('0x39')]+'%'};return _0x2a8ece;})});}_0x317533=_[_0xfc60('0x3b')]({},_0x317533,_0x37f820[_0xfc60('0x3c')]);return _0x27187b[_0xfc60('0x4a')](_0x317533);}})[_0xfc60('0x22')](function(_0x56c0d6){if(_0x56c0d6){_0x52328c=_0x56c0d6[_0xfc60('0x33')];if(!_0x37f820[_0xfc60('0x2e')]['hasOwnProperty'](_0xfc60('0x4b'))){_0x317533[_0xfc60('0x1d')]=qs['limit'](_0x37f820[_0xfc60('0x2e')][_0xfc60('0x1d')]);_0x317533[_0xfc60('0x1b')]=qs[_0xfc60('0x1b')](_0x37f820['query'][_0xfc60('0x1b')]);}return _0x27187b['getFields'](_0x317533);}})[_0xfc60('0x22')](function(_0x4af46b){if(_0x4af46b){return _0x4af46b?{'count':_0x52328c,'rows':_0x4af46b}:null;}})[_0xfc60('0x22')](respondWithResult(_0x3ec071,null))[_0xfc60('0x40')](handleError(_0x3ec071,null));};exports[_0xfc60('0x4c')]=function(_0x5c19a1,_0x216918,_0x2b9c2f){var _0x4376d2={};var _0x2726bf={};var _0x1937bb;var _0x248c3f;return db['ZohoConfiguration'][_0xfc60('0x48')]({'where':{'id':_0x5c19a1[_0xfc60('0x42')]['id']}})[_0xfc60('0x22')](handleEntityNotFound(_0x216918,null))[_0xfc60('0x22')](function(_0x1335d2){if(_0x1335d2){_0x1937bb=_0x1335d2;_0x2726bf[_0xfc60('0x2d')]=_['keys'](db['ZohoField']['rawAttributes']);_0x2726bf['query']=_[_0xfc60('0x2f')](_0x5c19a1[_0xfc60('0x2e')]);_0x2726bf[_0xfc60('0x30')]=_[_0xfc60('0x31')](_0x2726bf['model'],_0x2726bf['query']);_0x4376d2['attributes']=_[_0xfc60('0x31')](_0x2726bf['model'],qs[_0xfc60('0x44')](_0x5c19a1['query'][_0xfc60('0x44')]));_0x4376d2[_0xfc60('0x32')]=_0x4376d2[_0xfc60('0x32')][_0xfc60('0x33')]?_0x4376d2[_0xfc60('0x32')]:_0x2726bf[_0xfc60('0x2d')];_0x4376d2['order']=qs[_0xfc60('0x36')](_0x5c19a1[_0xfc60('0x2e')][_0xfc60('0x36')]);_0x4376d2[_0xfc60('0x37')]=qs[_0xfc60('0x30')](_[_0xfc60('0x38')](_0x5c19a1['query'],_0x2726bf[_0xfc60('0x30')]));if(_0x5c19a1[_0xfc60('0x2e')][_0xfc60('0x39')]){_0x4376d2[_0xfc60('0x37')]=_[_0xfc60('0x3b')](_0x4376d2['where'],{'$or':_[_0xfc60('0x29')](_0x4376d2['attributes'],function(_0x1a9ac4){var _0x3da9c6={};_0x3da9c6[_0x1a9ac4]={'$like':'%'+_0x5c19a1[_0xfc60('0x2e')][_0xfc60('0x39')]+'%'};return _0x3da9c6;})});}_0x4376d2=_['merge']({},_0x4376d2,_0x5c19a1[_0xfc60('0x3c')]);return _0x1937bb[_0xfc60('0x4c')](_0x4376d2);}})[_0xfc60('0x22')](function(_0x31bf6c){if(_0x31bf6c){_0x248c3f=_0x31bf6c[_0xfc60('0x33')];if(!_0x5c19a1[_0xfc60('0x2e')]['hasOwnProperty'](_0xfc60('0x4b'))){_0x4376d2[_0xfc60('0x1d')]=qs[_0xfc60('0x1d')](_0x5c19a1[_0xfc60('0x2e')][_0xfc60('0x1d')]);_0x4376d2[_0xfc60('0x1b')]=qs[_0xfc60('0x1b')](_0x5c19a1['query'][_0xfc60('0x1b')]);}return _0x1937bb[_0xfc60('0x4c')](_0x4376d2);}})[_0xfc60('0x22')](function(_0x3c0e71){if(_0x3c0e71){return _0x3c0e71?{'count':_0x248c3f,'rows':_0x3c0e71}:null;}})[_0xfc60('0x22')](respondWithResult(_0x216918,null))[_0xfc60('0x40')](handleError(_0x216918,null));};exports[_0xfc60('0x4d')]=function(_0x5e5abd,_0x122113,_0x2e915f){var _0xd64c9f={};var _0x50e1ab={};var _0x1589d0;var _0xb2e451;return db[_0xfc60('0x2a')][_0xfc60('0x48')]({'where':{'id':_0x5e5abd[_0xfc60('0x42')]['id']}})[_0xfc60('0x22')](handleEntityNotFound(_0x122113,null))[_0xfc60('0x22')](function(_0x53977c){if(_0x53977c){_0x1589d0=_0x53977c;_0x50e1ab[_0xfc60('0x2d')]=_['keys'](db[_0xfc60('0x49')][_0xfc60('0x43')]);_0x50e1ab[_0xfc60('0x2e')]=_[_0xfc60('0x2f')](_0x5e5abd[_0xfc60('0x2e')]);_0x50e1ab[_0xfc60('0x30')]=_[_0xfc60('0x31')](_0x50e1ab[_0xfc60('0x2d')],_0x50e1ab['query']);_0xd64c9f[_0xfc60('0x32')]=_[_0xfc60('0x31')](_0x50e1ab['model'],qs[_0xfc60('0x44')](_0x5e5abd[_0xfc60('0x2e')][_0xfc60('0x44')]));_0xd64c9f[_0xfc60('0x32')]=_0xd64c9f[_0xfc60('0x32')][_0xfc60('0x33')]?_0xd64c9f[_0xfc60('0x32')]:_0x50e1ab[_0xfc60('0x2d')];_0xd64c9f['order']=qs[_0xfc60('0x36')](_0x5e5abd[_0xfc60('0x2e')]['sort']);_0xd64c9f[_0xfc60('0x37')]=qs[_0xfc60('0x30')](_[_0xfc60('0x38')](_0x5e5abd[_0xfc60('0x2e')],_0x50e1ab[_0xfc60('0x30')]));if(_0x5e5abd[_0xfc60('0x2e')][_0xfc60('0x39')]){_0xd64c9f['where']=_[_0xfc60('0x3b')](_0xd64c9f['where'],{'$or':_[_0xfc60('0x29')](_0xd64c9f[_0xfc60('0x32')],function(_0x1a65f6){var _0x223d92={};_0x223d92[_0x1a65f6]={'$like':'%'+_0x5e5abd[_0xfc60('0x2e')]['filter']+'%'};return _0x223d92;})});}_0xd64c9f=_[_0xfc60('0x3b')]({},_0xd64c9f,_0x5e5abd['options']);return _0x1589d0[_0xfc60('0x4d')](_0xd64c9f);}})['then'](function(_0x8537d0){if(_0x8537d0){_0xb2e451=_0x8537d0[_0xfc60('0x33')];if(!_0x5e5abd[_0xfc60('0x2e')]['hasOwnProperty']('nolimit')){_0xd64c9f[_0xfc60('0x1d')]=qs[_0xfc60('0x1d')](_0x5e5abd[_0xfc60('0x2e')]['limit']);_0xd64c9f[_0xfc60('0x1b')]=qs[_0xfc60('0x1b')](_0x5e5abd['query'][_0xfc60('0x1b')]);}return _0x1589d0[_0xfc60('0x4d')](_0xd64c9f);}})[_0xfc60('0x22')](function(_0x37d0f6){if(_0x37d0f6){return _0x37d0f6?{'count':_0xb2e451,'rows':_0x37d0f6}:null;}})[_0xfc60('0x22')](respondWithResult(_0x122113,null))[_0xfc60('0x40')](handleError(_0x122113,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 5a42da6..914947e 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 _0xa3fd=['int_zoho_configurations','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZohoConfiguration.attributes','define','ZohoConfiguration'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xa3fd,0x1ae));var _0xda3f=function(_0x3a19d4,_0x3f19a4){_0x3a19d4=_0x3a19d4-0x0;var _0x5b858b=_0xa3fd[_0x3a19d4];return _0x5b858b;};'use strict';var _=require(_0xda3f('0x0'));var util=require('util');var logger=require(_0xda3f('0x1'))(_0xda3f('0x2'));var moment=require(_0xda3f('0x3'));var BPromise=require(_0xda3f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xda3f('0x5'));var rimraf=require('rimraf');var config=require(_0xda3f('0x6'));var attributes=require(_0xda3f('0x7'));module['exports']=function(_0x422aba,_0xd3a60c){return _0x422aba[_0xda3f('0x8')](_0xda3f('0x9'),attributes,{'tableName':_0xda3f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc1a8=['moment','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','../../config/logger','api'];(function(_0x68ee8b,_0x3cc6c5){var _0x5148f7=function(_0x5dcbd5){while(--_0x5dcbd5){_0x68ee8b['push'](_0x68ee8b['shift']());}};_0x5148f7(++_0x3cc6c5);}(_0xc1a8,0x1b6));var _0x8c1a=function(_0x413aac,_0x5e2430){_0x413aac=_0x413aac-0x0;var _0x569b11=_0xc1a8[_0x413aac];return _0x569b11;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8c1a('0x0'))(_0x8c1a('0x1'));var moment=require(_0x8c1a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c1a('0x3'));var rimraf=require('rimraf');var config=require(_0x8c1a('0x4'));var attributes=require(_0x8c1a('0x5'));module[_0x8c1a('0x6')]=function(_0x17490e,_0x430a9f){return _0x17490e[_0x8c1a('0x7')](_0x8c1a('0x8'),attributes,{'tableName':_0x8c1a('0x9'),'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 90cbb57..abcca5d 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 _0x68cc=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http'];(function(_0x18dae1,_0x5f338a){var _0x50a188=function(_0xa8c8c4){while(--_0xa8c8c4){_0x18dae1['push'](_0x18dae1['shift']());}};_0x50a188(++_0x5f338a);}(_0x68cc,0xd1));var _0xc68c=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x68cc[_0x5d4607];return _0x5e4a86;};'use strict';var _=require(_0xc68c('0x0'));var util=require(_0xc68c('0x1'));var moment=require(_0xc68c('0x2'));var BPromise=require(_0xc68c('0x3'));var rs=require(_0xc68c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc68c('0x5'))['db'];var utils=require(_0xc68c('0x6'));var logger=require(_0xc68c('0x7'))(_0xc68c('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc68c('0x9')][_0xc68c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1484d4,_0x455220,_0x6134e0){return new BPromise(function(_0x5b743b,_0x290f6b){return client['request'](_0x1484d4,_0x6134e0)[_0xc68c('0xb')](function(_0x53b3bf){logger[_0xc68c('0xc')](_0xc68c('0xd'),_0x455220,_0xc68c('0xe'));logger[_0xc68c('0xf')](_0xc68c('0x10'),_0x455220,_0xc68c('0xe'),JSON[_0xc68c('0x11')](_0x53b3bf));if(_0x53b3bf[_0xc68c('0x12')]){if(_0x53b3bf[_0xc68c('0x12')]['code']===0x1f4){logger[_0xc68c('0x12')](_0xc68c('0xd'),_0x455220,_0x53b3bf[_0xc68c('0x12')]['message']);return _0x290f6b(_0x53b3bf[_0xc68c('0x12')][_0xc68c('0x13')]);}logger[_0xc68c('0x12')](_0xc68c('0xd'),_0x455220,_0x53b3bf[_0xc68c('0x12')][_0xc68c('0x13')]);return _0x5b743b(_0x53b3bf[_0xc68c('0x12')][_0xc68c('0x13')]);}else{logger[_0xc68c('0xc')](_0xc68c('0xd'),_0x455220,_0xc68c('0xe'));_0x5b743b(_0x53b3bf[_0xc68c('0x14')]['message']);}})[_0xc68c('0x15')](function(_0x222531){logger[_0xc68c('0x12')](_0xc68c('0xd'),_0x455220,_0x222531);_0x290f6b(_0x222531);});});} \ No newline at end of file +var _0x5ce9=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','catch','lodash','ioredis','../../mysqldb','../../config/utils'];(function(_0xef3ae2,_0x4c63b8){var _0x1cc22b=function(_0x4de2da){while(--_0x4de2da){_0xef3ae2['push'](_0xef3ae2['shift']());}};_0x1cc22b(++_0x4c63b8);}(_0x5ce9,0x137));var _0x95ce=function(_0x18db6a,_0x1b5ecb){_0x18db6a=_0x18db6a-0x0;var _0x3dd441=_0x5ce9[_0x18db6a];return _0x3dd441;};'use strict';var _=require(_0x95ce('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95ce('0x1'));var db=require(_0x95ce('0x2'))['db'];var utils=require(_0x95ce('0x3'));var logger=require('../../config/logger')(_0x95ce('0x4'));var config=require(_0x95ce('0x5'));var jayson=require(_0x95ce('0x6'));var client=jayson[_0x95ce('0x7')][_0x95ce('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x38d1c4,_0x16ba63,_0x3e70fd){return new BPromise(function(_0x7d7533,_0x37dd46){return client[_0x95ce('0x9')](_0x38d1c4,_0x3e70fd)[_0x95ce('0xa')](function(_0xcf7e26){logger[_0x95ce('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x16ba63,'request\x20sent');logger[_0x95ce('0xc')](_0x95ce('0xd'),_0x16ba63,'request\x20sent',JSON[_0x95ce('0xe')](_0xcf7e26));if(_0xcf7e26[_0x95ce('0xf')]){if(_0xcf7e26[_0x95ce('0xf')][_0x95ce('0x10')]===0x1f4){logger['error']('ZohoConfiguration,\x20%s,\x20%s',_0x16ba63,_0xcf7e26[_0x95ce('0xf')]['message']);return _0x37dd46(_0xcf7e26[_0x95ce('0xf')][_0x95ce('0x11')]);}logger[_0x95ce('0xf')](_0x95ce('0x12'),_0x16ba63,_0xcf7e26[_0x95ce('0xf')][_0x95ce('0x11')]);return _0x7d7533(_0xcf7e26[_0x95ce('0xf')]['message']);}else{logger[_0x95ce('0xb')]('ZohoConfiguration,\x20%s,\x20%s',_0x16ba63,_0x95ce('0x13'));_0x7d7533(_0xcf7e26['result'][_0x95ce('0x11')]);}})[_0x95ce('0x14')](function(_0x381002){logger['error'](_0x95ce('0x12'),_0x16ba63,_0x381002);_0x37dd46(_0x381002);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 3368f45..41f057b 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 _0x8002=['index','/:id','show','post','create','delete','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2675da,_0x5a250e){var _0x5e6153=function(_0xf93114){while(--_0xf93114){_0x2675da['push'](_0x2675da['shift']());}};_0x5e6153(++_0x5a250e);}(_0x8002,0xa0));var _0x2800=function(_0x1a2037,_0x51abbe){_0x1a2037=_0x1a2037-0x0;var _0xb12025=_0x8002[_0x1a2037];return _0xb12025;};'use strict';var multer=require(_0x2800('0x0'));var util=require(_0x2800('0x1'));var path=require(_0x2800('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2800('0x3')]();var fs_extra=require(_0x2800('0x4'));var auth=require(_0x2800('0x5'));var interaction=require(_0x2800('0x6'));var config=require(_0x2800('0x7'));var controller=require('./intZohoField.controller');router[_0x2800('0x8')]('/',auth[_0x2800('0x9')](),controller[_0x2800('0xa')]);router['get'](_0x2800('0xb'),auth[_0x2800('0x9')](),controller[_0x2800('0xc')]);router[_0x2800('0xd')]('/',auth[_0x2800('0x9')](),controller[_0x2800('0xe')]);router['put']('/:id',auth[_0x2800('0x9')](),controller['update']);router[_0x2800('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2800('0x10')]);module['exports']=router; \ No newline at end of file +var _0xf933=['express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','show','post','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2a68e0,_0x5c5f3f){var _0x172280=function(_0x345999){while(--_0x345999){_0x2a68e0['push'](_0x2a68e0['shift']());}};_0x172280(++_0x5c5f3f);}(_0xf933,0x80));var _0x3f93=function(_0x2f87cd,_0xcaf299){_0x2f87cd=_0x2f87cd-0x0;var _0x5d7eda=_0xf933[_0x2f87cd];return _0x5d7eda;};'use strict';var multer=require(_0x3f93('0x0'));var util=require(_0x3f93('0x1'));var path=require(_0x3f93('0x2'));var timeout=require(_0x3f93('0x3'));var express=require(_0x3f93('0x4'));var router=express['Router']();var fs_extra=require(_0x3f93('0x5'));var auth=require(_0x3f93('0x6'));var interaction=require(_0x3f93('0x7'));var config=require(_0x3f93('0x8'));var controller=require(_0x3f93('0x9'));router[_0x3f93('0xa')]('/',auth['isAuthenticated'](),controller[_0x3f93('0xb')]);router[_0x3f93('0xa')](_0x3f93('0xc'),auth['isAuthenticated'](),controller[_0x3f93('0xd')]);router[_0x3f93('0xe')]('/',auth[_0x3f93('0xf')](),controller[_0x3f93('0x10')]);router[_0x3f93('0x11')](_0x3f93('0xc'),auth[_0x3f93('0xf')](),controller[_0x3f93('0x12')]);router[_0x3f93('0x13')](_0x3f93('0xc'),auth[_0x3f93('0xf')](),controller[_0x3f93('0x14')]);module[_0x3f93('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6413aca..308042b 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 _0x6ecc=['keyValue','customVariable','STRING','sequelize','exports','ENUM','string','variable'];(function(_0x554b32,_0x577efd){var _0x2d896d=function(_0x2f4a14){while(--_0x2f4a14){_0x554b32['push'](_0x554b32['shift']());}};_0x2d896d(++_0x577efd);}(_0x6ecc,0x17b));var _0xc6ec=function(_0x1079ef,_0x5c16d2){_0x1079ef=_0x1079ef-0x0;var _0x455f69=_0x6ecc[_0x1079ef];return _0x455f69;};'use strict';var Sequelize=require(_0xc6ec('0x0'));module[_0xc6ec('0x1')]={'type':{'type':Sequelize[_0xc6ec('0x2')](_0xc6ec('0x3'),_0xc6ec('0x4'),'customVariable',_0xc6ec('0x5'),'picklist'),'defaultValue':_0xc6ec('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xc6ec('0x2')]('string',_0xc6ec('0x4'),_0xc6ec('0x6'))},'keyContent':{'type':Sequelize[_0xc6ec('0x7')]},'idField':{'type':Sequelize[_0xc6ec('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc6ec('0x7')]}}; \ No newline at end of file +var _0x4956=['string','variable','customVariable','keyValue','picklist','STRING','ENUM','BOOLEAN','sequelize','exports'];(function(_0xac15c3,_0x2451ea){var _0x3ef3db=function(_0x361906){while(--_0x361906){_0xac15c3['push'](_0xac15c3['shift']());}};_0x3ef3db(++_0x2451ea);}(_0x4956,0x116));var _0x6495=function(_0x590f6e,_0x449de5){_0x590f6e=_0x590f6e-0x0;var _0x4234f1=_0x4956[_0x590f6e];return _0x4234f1;};'use strict';var Sequelize=require(_0x6495('0x0'));module[_0x6495('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6495('0x2'),_0x6495('0x3'),_0x6495('0x4'),_0x6495('0x5'),_0x6495('0x6')),'defaultValue':_0x6495('0x2')},'content':{'type':Sequelize[_0x6495('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6495('0x8')](_0x6495('0x2'),_0x6495('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6495('0x7')]},'nameField':{'type':Sequelize[_0x6495('0x7')]},'customField':{'type':Sequelize[_0x6495('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6495('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index a2b0e52..e6dd7ee 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 _0x32db=['includeAll','include','findAll','rows','show','params','rawAttributes','intersection','length','find','catch','create','body','update','destroy','eml-format','rimraf','fast-json-patch','util','path','sox','ejs','fs-extra','squel','desk.js','to-csv','papaparse','../../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','set','json','apply','reject','save','then','error','index','map','ZohoField','fieldName','type','key','model','name','query','keys','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','options'];(function(_0x56608c,_0x29eb74){var _0x3c7fb0=function(_0x154b1c){while(--_0x154b1c){_0x56608c['push'](_0x56608c['shift']());}};_0x3c7fb0(++_0x29eb74);}(_0x32db,0x12b));var _0xb32d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x32db[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xb32d('0x0'));var rimraf=require(_0xb32d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb32d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb32d('0x3'));var path=require(_0xb32d('0x4'));var sox=require(_0xb32d('0x5'));var csv=require('to-csv');var ejs=require(_0xb32d('0x6'));var fs=require('fs');var fs_extra=require(_0xb32d('0x7'));var _=require('lodash');var squel=require(_0xb32d('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb32d('0x9'));var toCsv=require(_0xb32d('0xa'));var querystring=require('querystring');var Papa=require(_0xb32d('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb32d('0xc'));var as=require(_0xb32d('0xd'));var hardwareService=require(_0xb32d('0xe'));var logger=require(_0xb32d('0xf'))(_0xb32d('0x10'));var utils=require('../../config/utils');var config=require(_0xb32d('0x11'));var licenseUtil=require(_0xb32d('0x12'));var db=require(_0xb32d('0x13'))['db'];function respondWithStatusCode(_0x5e1fc8,_0x3cf5ac){_0x3cf5ac=_0x3cf5ac||0xcc;return function(_0x4711e9){if(_0x4711e9){return _0x5e1fc8[_0xb32d('0x14')](_0x3cf5ac);}return _0x5e1fc8[_0xb32d('0x15')](_0x3cf5ac)[_0xb32d('0x16')]();};}function respondWithResult(_0x4d1a42,_0x3d5134){_0x3d5134=_0x3d5134||0xc8;return function(_0x2b13e1){if(_0x2b13e1){return _0x4d1a42[_0xb32d('0x15')](_0x3d5134)['json'](_0x2b13e1);}};}function respondWithFilteredResult(_0x12c866,_0x56f1fd){return function(_0x27313f){if(_0x27313f){var _0x4f2b8a=typeof _0x56f1fd[_0xb32d('0x17')]===_0xb32d('0x18')&&typeof _0x56f1fd[_0xb32d('0x19')]===_0xb32d('0x18');var _0x41ecf1=_0x27313f[_0xb32d('0x1a')];var _0x2a4fc2=_0x4f2b8a?0x0:_0x56f1fd['offset'];var _0x5302df=_0x4f2b8a?_0x27313f[_0xb32d('0x1a')]:_0x56f1fd['offset']+_0x56f1fd['limit'];var _0x41ae8c;if(_0x5302df>=_0x41ecf1){_0x5302df=_0x41ecf1;_0x41ae8c=0xc8;}else{_0x41ae8c=0xce;}_0x12c866['status'](_0x41ae8c);return _0x12c866[_0xb32d('0x1b')]('Content-Range',_0x2a4fc2+'-'+_0x5302df+'/'+_0x41ecf1)[_0xb32d('0x1c')](_0x27313f);}return null;};}function patchUpdates(_0x49d691){return function(_0x1298e6){try{jsonpatch[_0xb32d('0x1d')](_0x1298e6,_0x49d691,!![]);}catch(_0xf6f3a5){return BPromise[_0xb32d('0x1e')](_0xf6f3a5);}return _0x1298e6[_0xb32d('0x1f')]();};}function saveUpdates(_0x4a76a7,_0x59d07e){return function(_0x2bb021){if(_0x2bb021){return _0x2bb021['update'](_0x4a76a7)[_0xb32d('0x20')](function(_0x559215){return _0x559215;});}return null;};}function removeEntity(_0x3be2b0,_0x31686f){return function(_0x44f4a9){if(_0x44f4a9){return _0x44f4a9['destroy']()[_0xb32d('0x20')](function(){_0x3be2b0['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36ff96,_0x60ebb7){return function(_0x50d14a){if(!_0x50d14a){_0x36ff96[_0xb32d('0x14')](0x194);}return _0x50d14a;};}function handleError(_0x3e98b4,_0xbad6de){_0xbad6de=_0xbad6de||0x1f4;return function(_0xc4a5ad){logger[_0xb32d('0x21')](_0xc4a5ad['stack']);if(_0xc4a5ad['name']){delete _0xc4a5ad['name'];}_0x3e98b4[_0xb32d('0x15')](_0xbad6de)['send'](_0xc4a5ad);};}exports[_0xb32d('0x22')]=function(_0x4562b7,_0x342f83){var _0x1f1a60={},_0x1f2e66={},_0x4177a3={'count':0x0,'rows':[]};var _0x2693c0=_[_0xb32d('0x23')](db[_0xb32d('0x24')]['rawAttributes'],function(_0xc0b0f7){return{'name':_0xc0b0f7[_0xb32d('0x25')],'type':_0xc0b0f7[_0xb32d('0x26')][_0xb32d('0x27')]};});_0x1f2e66[_0xb32d('0x28')]=_[_0xb32d('0x23')](_0x2693c0,_0xb32d('0x29'));_0x1f2e66[_0xb32d('0x2a')]=_[_0xb32d('0x2b')](_0x4562b7[_0xb32d('0x2a')]);_0x1f2e66['filters']=_['intersection'](_0x1f2e66[_0xb32d('0x28')],_0x1f2e66[_0xb32d('0x2a')]);_0x1f1a60[_0xb32d('0x2c')]=_['intersection'](_0x1f2e66[_0xb32d('0x28')],qs[_0xb32d('0x2d')](_0x4562b7[_0xb32d('0x2a')]['fields']));_0x1f1a60[_0xb32d('0x2c')]=_0x1f1a60['attributes']['length']?_0x1f1a60[_0xb32d('0x2c')]:_0x1f2e66['model'];if(!_0x4562b7['query'][_0xb32d('0x2e')](_0xb32d('0x2f'))){_0x1f1a60[_0xb32d('0x19')]=qs[_0xb32d('0x19')](_0x4562b7[_0xb32d('0x2a')]['limit']);_0x1f1a60['offset']=qs['offset'](_0x4562b7[_0xb32d('0x2a')][_0xb32d('0x17')]);}_0x1f1a60[_0xb32d('0x30')]=qs[_0xb32d('0x31')](_0x4562b7[_0xb32d('0x2a')]['sort']);_0x1f1a60[_0xb32d('0x32')]=qs[_0xb32d('0x33')](_[_0xb32d('0x34')](_0x4562b7[_0xb32d('0x2a')],_0x1f2e66[_0xb32d('0x33')]),_0x2693c0);if(_0x4562b7['query']['filter']){_0x1f1a60[_0xb32d('0x32')]=_[_0xb32d('0x35')](_0x1f1a60[_0xb32d('0x32')],{'$or':_[_0xb32d('0x23')](_0x2693c0,function(_0x34e631){if(_0x34e631['type']!==_0xb32d('0x36')){var _0x5b4511={};_0x5b4511[_0x34e631[_0xb32d('0x29')]]={'$like':'%'+_0x4562b7[_0xb32d('0x2a')]['filter']+'%'};return _0x5b4511;}})});}_0x1f1a60=_['merge']({},_0x1f1a60,_0x4562b7[_0xb32d('0x37')]);var _0x3557cf={'where':_0x1f1a60['where']};return db['ZohoField']['count'](_0x3557cf)['then'](function(_0x2f8508){_0x4177a3['count']=_0x2f8508;if(_0x4562b7[_0xb32d('0x2a')][_0xb32d('0x38')]){_0x1f1a60[_0xb32d('0x39')]=[{'all':!![]}];}return db[_0xb32d('0x24')][_0xb32d('0x3a')](_0x1f1a60);})[_0xb32d('0x20')](function(_0x195f5b){_0x4177a3[_0xb32d('0x3b')]=_0x195f5b;return _0x4177a3;})[_0xb32d('0x20')](respondWithFilteredResult(_0x342f83,_0x1f1a60))['catch'](handleError(_0x342f83,null));};exports[_0xb32d('0x3c')]=function(_0x1be60a,_0x3a05c0){var _0x3de3eb={'raw':!![],'where':{'id':_0x1be60a[_0xb32d('0x3d')]['id']}},_0x47299e={};_0x47299e[_0xb32d('0x28')]=_[_0xb32d('0x2b')](db[_0xb32d('0x24')][_0xb32d('0x3e')]);_0x47299e[_0xb32d('0x2a')]=_['keys'](_0x1be60a[_0xb32d('0x2a')]);_0x47299e[_0xb32d('0x33')]=_[_0xb32d('0x3f')](_0x47299e['model'],_0x47299e[_0xb32d('0x2a')]);_0x3de3eb['attributes']=_[_0xb32d('0x3f')](_0x47299e[_0xb32d('0x28')],qs['fields'](_0x1be60a['query'][_0xb32d('0x2d')]));_0x3de3eb[_0xb32d('0x2c')]=_0x3de3eb[_0xb32d('0x2c')][_0xb32d('0x40')]?_0x3de3eb[_0xb32d('0x2c')]:_0x47299e[_0xb32d('0x28')];if(_0x1be60a[_0xb32d('0x2a')]['includeAll']){_0x3de3eb['include']=[{'all':!![]}];}_0x3de3eb=_['merge']({},_0x3de3eb,_0x1be60a['options']);return db['ZohoField'][_0xb32d('0x41')](_0x3de3eb)[_0xb32d('0x20')](handleEntityNotFound(_0x3a05c0,null))[_0xb32d('0x20')](respondWithResult(_0x3a05c0,null))[_0xb32d('0x42')](handleError(_0x3a05c0,null));};exports['create']=function(_0x5536c6,_0x4295b4){return db[_0xb32d('0x24')][_0xb32d('0x43')](_0x5536c6[_0xb32d('0x44')],{})[_0xb32d('0x20')](respondWithResult(_0x4295b4,0xc9))[_0xb32d('0x42')](handleError(_0x4295b4,null));};exports[_0xb32d('0x45')]=function(_0x197237,_0x243da7){if(_0x197237[_0xb32d('0x44')]['id']){delete _0x197237[_0xb32d('0x44')]['id'];}return db[_0xb32d('0x24')][_0xb32d('0x41')]({'where':{'id':_0x197237[_0xb32d('0x3d')]['id']}})['then'](handleEntityNotFound(_0x243da7,null))[_0xb32d('0x20')](saveUpdates(_0x197237['body'],null))[_0xb32d('0x20')](respondWithResult(_0x243da7,null))[_0xb32d('0x42')](handleError(_0x243da7,null));};exports[_0xb32d('0x46')]=function(_0x505fab,_0x34a27c){return db[_0xb32d('0x24')]['find']({'where':{'id':_0x505fab[_0xb32d('0x3d')]['id']}})[_0xb32d('0x20')](handleEntityNotFound(_0x34a27c,null))[_0xb32d('0x20')](removeEntity(_0x34a27c,null))[_0xb32d('0x42')](handleError(_0x34a27c,null));}; \ No newline at end of file +var _0xbfc1=['../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','save','then','destroy','end','error','stack','name','index','map','ZohoField','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','intersection','include','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils'];(function(_0x15ad81,_0x1114f9){var _0x42e08b=function(_0x39d824){while(--_0x39d824){_0x15ad81['push'](_0x15ad81['shift']());}};_0x42e08b(++_0x1114f9);}(_0xbfc1,0x15a));var _0x1bfc=function(_0x32ccae,_0x5774fa){_0x32ccae=_0x32ccae-0x0;var _0x37f66a=_0xbfc1[_0x32ccae];return _0x37f66a;};'use strict';var emlformat=require(_0x1bfc('0x0'));var rimraf=require(_0x1bfc('0x1'));var zipdir=require(_0x1bfc('0x2'));var jsonpatch=require(_0x1bfc('0x3'));var rp=require(_0x1bfc('0x4'));var moment=require(_0x1bfc('0x5'));var BPromise=require(_0x1bfc('0x6'));var Mustache=require(_0x1bfc('0x7'));var util=require(_0x1bfc('0x8'));var path=require(_0x1bfc('0x9'));var sox=require(_0x1bfc('0xa'));var csv=require(_0x1bfc('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1bfc('0xc'));var _=require(_0x1bfc('0xd'));var squel=require(_0x1bfc('0xe'));var crypto=require(_0x1bfc('0xf'));var jsforce=require(_0x1bfc('0x10'));var deskjs=require(_0x1bfc('0x11'));var toCsv=require(_0x1bfc('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1bfc('0x12'));var authService=require(_0x1bfc('0x13'));var qs=require(_0x1bfc('0x14'));var as=require(_0x1bfc('0x15'));var hardwareService=require(_0x1bfc('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1bfc('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1bfc('0x18'));var db=require(_0x1bfc('0x19'))['db'];function respondWithStatusCode(_0x580bb5,_0x37b539){_0x37b539=_0x37b539||0xcc;return function(_0x32d86d){if(_0x32d86d){return _0x580bb5[_0x1bfc('0x1a')](_0x37b539);}return _0x580bb5['status'](_0x37b539)['end']();};}function respondWithResult(_0x2a9ff6,_0x529be2){_0x529be2=_0x529be2||0xc8;return function(_0x380bab){if(_0x380bab){return _0x2a9ff6[_0x1bfc('0x1b')](_0x529be2)[_0x1bfc('0x1c')](_0x380bab);}};}function respondWithFilteredResult(_0x443255,_0x2e932f){return function(_0x21622b){if(_0x21622b){var _0xf33591=typeof _0x2e932f[_0x1bfc('0x1d')]==='undefined'&&typeof _0x2e932f[_0x1bfc('0x1e')]==='undefined';var _0x39a989=_0x21622b['count'];var _0x1c8363=_0xf33591?0x0:_0x2e932f[_0x1bfc('0x1d')];var _0x5d0a2d=_0xf33591?_0x21622b[_0x1bfc('0x1f')]:_0x2e932f['offset']+_0x2e932f[_0x1bfc('0x1e')];var _0x23330c;if(_0x5d0a2d>=_0x39a989){_0x5d0a2d=_0x39a989;_0x23330c=0xc8;}else{_0x23330c=0xce;}_0x443255[_0x1bfc('0x1b')](_0x23330c);return _0x443255[_0x1bfc('0x20')](_0x1bfc('0x21'),_0x1c8363+'-'+_0x5d0a2d+'/'+_0x39a989)[_0x1bfc('0x1c')](_0x21622b);}return null;};}function patchUpdates(_0x3c9e8b){return function(_0x21411c){try{jsonpatch['apply'](_0x21411c,_0x3c9e8b,!![]);}catch(_0x2ca5e3){return BPromise[_0x1bfc('0x22')](_0x2ca5e3);}return _0x21411c[_0x1bfc('0x23')]();};}function saveUpdates(_0x19121c,_0x6df1b6){return function(_0x32710d){if(_0x32710d){return _0x32710d['update'](_0x19121c)[_0x1bfc('0x24')](function(_0x2f327f){return _0x2f327f;});}return null;};}function removeEntity(_0x131681,_0x5ba234){return function(_0x5d7764){if(_0x5d7764){return _0x5d7764[_0x1bfc('0x25')]()['then'](function(){_0x131681['status'](0xcc)[_0x1bfc('0x26')]();});}};}function handleEntityNotFound(_0xde1680,_0x3ff48d){return function(_0x4c03ed){if(!_0x4c03ed){_0xde1680[_0x1bfc('0x1a')](0x194);}return _0x4c03ed;};}function handleError(_0x2fbcef,_0x8fe1dd){_0x8fe1dd=_0x8fe1dd||0x1f4;return function(_0x3a4e09){logger[_0x1bfc('0x27')](_0x3a4e09[_0x1bfc('0x28')]);if(_0x3a4e09['name']){delete _0x3a4e09[_0x1bfc('0x29')];}_0x2fbcef[_0x1bfc('0x1b')](_0x8fe1dd)['send'](_0x3a4e09);};}exports[_0x1bfc('0x2a')]=function(_0xbe385,_0x4edf47){var _0x5623b4={},_0x54a28b={},_0x5f2afe={'count':0x0,'rows':[]};var _0x244100=_[_0x1bfc('0x2b')](db[_0x1bfc('0x2c')]['rawAttributes'],function(_0x4802cb){return{'name':_0x4802cb['fieldName'],'type':_0x4802cb['type'][_0x1bfc('0x2d')]};});_0x54a28b[_0x1bfc('0x2e')]=_['map'](_0x244100,_0x1bfc('0x29'));_0x54a28b['query']=_[_0x1bfc('0x2f')](_0xbe385[_0x1bfc('0x30')]);_0x54a28b[_0x1bfc('0x31')]=_['intersection'](_0x54a28b[_0x1bfc('0x2e')],_0x54a28b[_0x1bfc('0x30')]);_0x5623b4['attributes']=_['intersection'](_0x54a28b[_0x1bfc('0x2e')],qs['fields'](_0xbe385[_0x1bfc('0x30')][_0x1bfc('0x32')]));_0x5623b4[_0x1bfc('0x33')]=_0x5623b4['attributes'][_0x1bfc('0x34')]?_0x5623b4['attributes']:_0x54a28b['model'];if(!_0xbe385[_0x1bfc('0x30')][_0x1bfc('0x35')](_0x1bfc('0x36'))){_0x5623b4[_0x1bfc('0x1e')]=qs['limit'](_0xbe385[_0x1bfc('0x30')][_0x1bfc('0x1e')]);_0x5623b4['offset']=qs[_0x1bfc('0x1d')](_0xbe385['query']['offset']);}_0x5623b4[_0x1bfc('0x37')]=qs[_0x1bfc('0x38')](_0xbe385['query'][_0x1bfc('0x38')]);_0x5623b4[_0x1bfc('0x39')]=qs[_0x1bfc('0x31')](_[_0x1bfc('0x3a')](_0xbe385[_0x1bfc('0x30')],_0x54a28b[_0x1bfc('0x31')]),_0x244100);if(_0xbe385[_0x1bfc('0x30')][_0x1bfc('0x3b')]){_0x5623b4[_0x1bfc('0x39')]=_[_0x1bfc('0x3c')](_0x5623b4[_0x1bfc('0x39')],{'$or':_[_0x1bfc('0x2b')](_0x244100,function(_0x5ac168){if(_0x5ac168['type']!==_0x1bfc('0x3d')){var _0x6c9268={};_0x6c9268[_0x5ac168[_0x1bfc('0x29')]]={'$like':'%'+_0xbe385['query']['filter']+'%'};return _0x6c9268;}})});}_0x5623b4=_[_0x1bfc('0x3c')]({},_0x5623b4,_0xbe385[_0x1bfc('0x3e')]);var _0x319a0c={'where':_0x5623b4[_0x1bfc('0x39')]};return db[_0x1bfc('0x2c')][_0x1bfc('0x1f')](_0x319a0c)[_0x1bfc('0x24')](function(_0x9512e5){_0x5f2afe[_0x1bfc('0x1f')]=_0x9512e5;if(_0xbe385[_0x1bfc('0x30')]['includeAll']){_0x5623b4['include']=[{'all':!![]}];}return db['ZohoField'][_0x1bfc('0x3f')](_0x5623b4);})[_0x1bfc('0x24')](function(_0x46ee46){_0x5f2afe[_0x1bfc('0x40')]=_0x46ee46;return _0x5f2afe;})[_0x1bfc('0x24')](respondWithFilteredResult(_0x4edf47,_0x5623b4))[_0x1bfc('0x41')](handleError(_0x4edf47,null));};exports[_0x1bfc('0x42')]=function(_0x29ffd1,_0x3c75d4){var _0x4325b7={'raw':!![],'where':{'id':_0x29ffd1[_0x1bfc('0x43')]['id']}},_0x49a0ad={};_0x49a0ad[_0x1bfc('0x2e')]=_['keys'](db['ZohoField']['rawAttributes']);_0x49a0ad[_0x1bfc('0x30')]=_[_0x1bfc('0x2f')](_0x29ffd1[_0x1bfc('0x30')]);_0x49a0ad[_0x1bfc('0x31')]=_['intersection'](_0x49a0ad[_0x1bfc('0x2e')],_0x49a0ad[_0x1bfc('0x30')]);_0x4325b7[_0x1bfc('0x33')]=_[_0x1bfc('0x44')](_0x49a0ad[_0x1bfc('0x2e')],qs['fields'](_0x29ffd1[_0x1bfc('0x30')][_0x1bfc('0x32')]));_0x4325b7['attributes']=_0x4325b7[_0x1bfc('0x33')][_0x1bfc('0x34')]?_0x4325b7[_0x1bfc('0x33')]:_0x49a0ad[_0x1bfc('0x2e')];if(_0x29ffd1[_0x1bfc('0x30')]['includeAll']){_0x4325b7[_0x1bfc('0x45')]=[{'all':!![]}];}_0x4325b7=_[_0x1bfc('0x3c')]({},_0x4325b7,_0x29ffd1[_0x1bfc('0x3e')]);return db[_0x1bfc('0x2c')]['find'](_0x4325b7)[_0x1bfc('0x24')](handleEntityNotFound(_0x3c75d4,null))[_0x1bfc('0x24')](respondWithResult(_0x3c75d4,null))[_0x1bfc('0x41')](handleError(_0x3c75d4,null));};exports[_0x1bfc('0x46')]=function(_0x34b17c,_0x2293bd){return db[_0x1bfc('0x2c')][_0x1bfc('0x46')](_0x34b17c[_0x1bfc('0x47')],{})[_0x1bfc('0x24')](respondWithResult(_0x2293bd,0xc9))['catch'](handleError(_0x2293bd,null));};exports[_0x1bfc('0x48')]=function(_0x15d9ec,_0xc13a77){if(_0x15d9ec[_0x1bfc('0x47')]['id']){delete _0x15d9ec[_0x1bfc('0x47')]['id'];}return db[_0x1bfc('0x2c')][_0x1bfc('0x49')]({'where':{'id':_0x15d9ec['params']['id']}})[_0x1bfc('0x24')](handleEntityNotFound(_0xc13a77,null))['then'](saveUpdates(_0x15d9ec[_0x1bfc('0x47')],null))[_0x1bfc('0x24')](respondWithResult(_0xc13a77,null))[_0x1bfc('0x41')](handleError(_0xc13a77,null));};exports[_0x1bfc('0x25')]=function(_0x25cdd4,_0x2b81cf){return db[_0x1bfc('0x2c')]['find']({'where':{'id':_0x25cdd4[_0x1bfc('0x43')]['id']}})[_0x1bfc('0x24')](handleEntityNotFound(_0x2b81cf,null))['then'](removeEntity(_0x2b81cf,null))[_0x1bfc('0x41')](handleError(_0x2b81cf,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index c531f71..d85a34d 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 _0x3a6d=['../../config/environment','./intZohoField.attributes','exports','define','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x34de09,_0x369851){var _0x449283=function(_0x1679d8){while(--_0x1679d8){_0x34de09['push'](_0x34de09['shift']());}};_0x449283(++_0x369851);}(_0x3a6d,0x143));var _0xd3a6=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x3a6d[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0xd3a6('0x0'));var util=require(_0xd3a6('0x1'));var logger=require('../../config/logger')(_0xd3a6('0x2'));var moment=require(_0xd3a6('0x3'));var BPromise=require(_0xd3a6('0x4'));var rp=require(_0xd3a6('0x5'));var fs=require('fs');var path=require(_0xd3a6('0x6'));var rimraf=require('rimraf');var config=require(_0xd3a6('0x7'));var attributes=require(_0xd3a6('0x8'));module[_0xd3a6('0x9')]=function(_0x1fc450,_0x25b042){return _0x1fc450[_0xd3a6('0xa')]('ZohoField',attributes,{'tableName':_0xd3a6('0xb'),'paranoid':![],'indexes':[{'name':_0xd3a6('0xc'),'fields':[_0xd3a6('0xd'),_0xd3a6('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb44a=['define','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','../../config/logger','moment','path','../../config/environment','./intZohoField.attributes','exports'];(function(_0x5d4889,_0x3dc9e3){var _0x328b28=function(_0x3e08d){while(--_0x3e08d){_0x5d4889['push'](_0x5d4889['shift']());}};_0x328b28(++_0x3dc9e3);}(_0xb44a,0x1c2));var _0xab44=function(_0x56d1b5,_0x289333){_0x56d1b5=_0x56d1b5-0x0;var _0x4ad91e=_0xb44a[_0x56d1b5];return _0x4ad91e;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xab44('0x0'))('api');var moment=require(_0xab44('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xab44('0x2'));var rimraf=require('rimraf');var config=require(_0xab44('0x3'));var attributes=require(_0xab44('0x4'));module[_0xab44('0x5')]=function(_0x28681a,_0x2f3948){return _0x28681a[_0xab44('0x6')](_0xab44('0x7'),attributes,{'tableName':_0xab44('0x8'),'paranoid':![],'indexes':[{'name':_0xab44('0x9'),'fields':[_0xab44('0xa'),_0xab44('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 492526b..717ce47 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 _0xd18b=['debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoField,\x20%s,\x20%s','request\x20sent'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xd18b,0x149));var _0xbd18=function(_0x5c1ce9,_0x3dd735){_0x5c1ce9=_0x5c1ce9-0x0;var _0x5df3ea=_0xd18b[_0x5c1ce9];return _0x5df3ea;};'use strict';var _=require('lodash');var util=require(_0xbd18('0x0'));var moment=require(_0xbd18('0x1'));var BPromise=require(_0xbd18('0x2'));var rs=require(_0xbd18('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd18('0x4'))['db'];var utils=require(_0xbd18('0x5'));var logger=require(_0xbd18('0x6'))('rpc');var config=require(_0xbd18('0x7'));var jayson=require(_0xbd18('0x8'));var client=jayson[_0xbd18('0x9')][_0xbd18('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2edbaf,_0x2b25a2,_0xd2d9a5){return new BPromise(function(_0x2ed204,_0x16ac19){return client[_0xbd18('0xb')](_0x2edbaf,_0xd2d9a5)[_0xbd18('0xc')](function(_0x32d1f6){logger[_0xbd18('0xd')](_0xbd18('0xe'),_0x2b25a2,_0xbd18('0xf'));logger[_0xbd18('0x10')](_0xbd18('0x11'),_0x2b25a2,'request\x20sent',JSON['stringify'](_0x32d1f6));if(_0x32d1f6[_0xbd18('0x12')]){if(_0x32d1f6[_0xbd18('0x12')][_0xbd18('0x13')]===0x1f4){logger[_0xbd18('0x12')](_0xbd18('0xe'),_0x2b25a2,_0x32d1f6[_0xbd18('0x12')]['message']);return _0x16ac19(_0x32d1f6[_0xbd18('0x12')][_0xbd18('0x14')]);}logger[_0xbd18('0x12')](_0xbd18('0xe'),_0x2b25a2,_0x32d1f6[_0xbd18('0x12')][_0xbd18('0x14')]);return _0x2ed204(_0x32d1f6[_0xbd18('0x12')]['message']);}else{logger[_0xbd18('0xd')](_0xbd18('0xe'),_0x2b25a2,_0xbd18('0xf'));_0x2ed204(_0x32d1f6[_0xbd18('0x15')]['message']);}})[_0xbd18('0x16')](function(_0x2240d9){logger[_0xbd18('0x12')](_0xbd18('0xe'),_0x2b25a2,_0x2240d9);_0x16ac19(_0x2240d9);});});} \ No newline at end of file +var _0xd0fa=['error','code','message','info','request\x20sent','result','catch','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','ZohoField,\x20%s,\x20%s','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1314d4,_0xb0b16d){var _0x584ba5=function(_0x394269){while(--_0x394269){_0x1314d4['push'](_0x1314d4['shift']());}};_0x584ba5(++_0xb0b16d);}(_0xd0fa,0xc4));var _0xad0f=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xd0fa[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0xad0f('0x0'));var util=require(_0xad0f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xad0f('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad0f('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xad0f('0x4'))(_0xad0f('0x5'));var config=require(_0xad0f('0x6'));var jayson=require(_0xad0f('0x7'));var client=jayson[_0xad0f('0x8')][_0xad0f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13d06c,_0x54949b,_0x52cba4){return new BPromise(function(_0x3befb3,_0x5bf543){return client['request'](_0x13d06c,_0x52cba4)['then'](function(_0x1926c4){logger['info'](_0xad0f('0xa'),_0x54949b,'request\x20sent');logger[_0xad0f('0xb')](_0xad0f('0xc'),_0x54949b,'request\x20sent',JSON[_0xad0f('0xd')](_0x1926c4));if(_0x1926c4['error']){if(_0x1926c4[_0xad0f('0xe')][_0xad0f('0xf')]===0x1f4){logger[_0xad0f('0xe')](_0xad0f('0xa'),_0x54949b,_0x1926c4[_0xad0f('0xe')]['message']);return _0x5bf543(_0x1926c4[_0xad0f('0xe')]['message']);}logger[_0xad0f('0xe')](_0xad0f('0xa'),_0x54949b,_0x1926c4[_0xad0f('0xe')]['message']);return _0x3befb3(_0x1926c4['error'][_0xad0f('0x10')]);}else{logger[_0xad0f('0x11')](_0xad0f('0xa'),_0x54949b,_0xad0f('0x12'));_0x3befb3(_0x1926c4[_0xad0f('0x13')][_0xad0f('0x10')]);}})[_0xad0f('0x14')](function(_0x2ff242){logger[_0xad0f('0xe')](_0xad0f('0xa'),_0x54949b,_0x2ff242);_0x5bf543(_0x2ff242);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 8a361dc..ba409de 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x33e710,_0x3be03e){var _0x53ecf6=function(_0x402e95){while(--_0x402e95){_0x33e710['push'](_0x33e710['shift']());}};_0x53ecf6(++_0x3be03e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0xcb91[_0x53abe5];return _0xc1c37e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x186ffb,_0x3a4f93){var _0x443686=function(_0x24d2d3){while(--_0x24d2d3){_0x186ffb['push'](_0x186ffb['shift']());}};_0x443686(++_0x3a4f93);}(_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 a417602..151915c 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 _0x8b29=['state','sequelize','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN'];(function(_0x1a87de,_0x856870){var _0x39c84b=function(_0xb8fda6){while(--_0xb8fda6){_0x1a87de['push'](_0x1a87de['shift']());}};_0x39c84b(++_0x856870);}(_0x8b29,0xbe));var _0x98b2=function(_0x7766c8,_0xe28de8){_0x7766c8=_0x7766c8-0x0;var _0x4196c0=_0x8b29[_0x7766c8];return _0x4196c0;};'use strict';var Sequelize=require(_0x98b2('0x0'));module['exports']={'name':{'type':Sequelize[_0x98b2('0x1')],'allowNull':![],'unique':_0x98b2('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':'unique_name_and_version'},'main':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':_0x98b2('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x98b2('0x1')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x98b2('0x4')]},'active':{'type':Sequelize[_0x98b2('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x98b2('0x1')]},'logo':{'type':Sequelize[_0x98b2('0x1')]},'state':{'type':Sequelize[_0x98b2('0x1')],'unique':_0x98b2('0x6')},'description':{'type':Sequelize[_0x98b2('0x1')]},'title':{'type':Sequelize[_0x98b2('0x1')]},'remoteUri':{'type':Sequelize[_0x98b2('0x1')]},'link':{'type':Sequelize[_0x98b2('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7d3f=['BOOLEAN','state','sequelize','exports','STRING','unique_name_and_version','app.js','INTEGER'];(function(_0x5dc4ae,_0x14e977){var _0x22dbf0=function(_0x4e9cc7){while(--_0x4e9cc7){_0x5dc4ae['push'](_0x5dc4ae['shift']());}};_0x22dbf0(++_0x14e977);}(_0x7d3f,0xd2));var _0xf7d3=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x7d3f[_0x80d733];return _0x435868;};'use strict';var Sequelize=require(_0xf7d3('0x0'));module[_0xf7d3('0x1')]={'name':{'type':Sequelize[_0xf7d3('0x2')],'allowNull':![],'unique':_0xf7d3('0x3')},'version':{'type':Sequelize[_0xf7d3('0x2')],'allowNull':![],'unique':_0xf7d3('0x3')},'main':{'type':Sequelize[_0xf7d3('0x2')],'defaultValue':_0xf7d3('0x4')},'filename':{'type':Sequelize[_0xf7d3('0x2')]},'path':{'type':Sequelize[_0xf7d3('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0xf7d3('0x5')]},'active':{'type':Sequelize[_0xf7d3('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0xf7d3('0x2')]},'logo':{'type':Sequelize[_0xf7d3('0x2')]},'state':{'type':Sequelize[_0xf7d3('0x2')],'unique':_0xf7d3('0x7')},'description':{'type':Sequelize[_0xf7d3('0x2')]},'title':{'type':Sequelize[_0xf7d3('0x2')]},'remoteUri':{'type':Sequelize[_0xf7d3('0x2')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 1809655..1e97ad0 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 _0x4991=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','filter','options','Integration','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','rawAttributes','fieldName','key','model','query','filters'];(function(_0x1610a4,_0x416bf5){var _0x476d45=function(_0x4d409b){while(--_0x4d409b){_0x1610a4['push'](_0x1610a4['shift']());}};_0x476d45(++_0x416bf5);}(_0x4991,0xf7));var _0x1499=function(_0x44c5f5,_0x555aa8){_0x44c5f5=_0x44c5f5-0x0;var _0x38dbc5=_0x4991[_0x44c5f5];return _0x38dbc5;};'use strict';var emlformat=require(_0x1499('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1499('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1499('0x2'));var moment=require(_0x1499('0x3'));var BPromise=require(_0x1499('0x4'));var Mustache=require(_0x1499('0x5'));var util=require(_0x1499('0x6'));var path=require(_0x1499('0x7'));var sox=require(_0x1499('0x8'));var csv=require(_0x1499('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1499('0xa'));var _=require(_0x1499('0xb'));var squel=require(_0x1499('0xc'));var crypto=require(_0x1499('0xd'));var jsforce=require(_0x1499('0xe'));var deskjs=require(_0x1499('0xf'));var toCsv=require(_0x1499('0x9'));var querystring=require(_0x1499('0x10'));var Papa=require('papaparse');var Redis=require(_0x1499('0x11'));var authService=require(_0x1499('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1499('0x13'));var hardwareService=require(_0x1499('0x14'));var logger=require('../../config/logger')(_0x1499('0x15'));var utils=require(_0x1499('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3039ce,_0x274bc1){_0x274bc1=_0x274bc1||0xcc;return function(_0x34a928){if(_0x34a928){return _0x3039ce[_0x1499('0x17')](_0x274bc1);}return _0x3039ce[_0x1499('0x18')](_0x274bc1)['end']();};}function respondWithResult(_0x5f34f2,_0x308177){_0x308177=_0x308177||0xc8;return function(_0x4e5195){if(_0x4e5195){return _0x5f34f2[_0x1499('0x18')](_0x308177)[_0x1499('0x19')](_0x4e5195);}};}function respondWithFilteredResult(_0x308318,_0x3ab605){return function(_0x48f654){if(_0x48f654){var _0x1ed43b=typeof _0x3ab605[_0x1499('0x1a')]==='undefined'&&typeof _0x3ab605[_0x1499('0x1b')]===_0x1499('0x1c');var _0x46b364=_0x48f654[_0x1499('0x1d')];var _0x1e45a9=_0x1ed43b?0x0:_0x3ab605[_0x1499('0x1a')];var _0x5b9859=_0x1ed43b?_0x48f654['count']:_0x3ab605['offset']+_0x3ab605[_0x1499('0x1b')];var _0xad534b;if(_0x5b9859>=_0x46b364){_0x5b9859=_0x46b364;_0xad534b=0xc8;}else{_0xad534b=0xce;}_0x308318['status'](_0xad534b);return _0x308318[_0x1499('0x1e')](_0x1499('0x1f'),_0x1e45a9+'-'+_0x5b9859+'/'+_0x46b364)[_0x1499('0x19')](_0x48f654);}return null;};}function patchUpdates(_0x18e4a6){return function(_0x21e887){try{jsonpatch[_0x1499('0x20')](_0x21e887,_0x18e4a6,!![]);}catch(_0x2b0458){return BPromise[_0x1499('0x21')](_0x2b0458);}return _0x21e887[_0x1499('0x22')]();};}function saveUpdates(_0x15bcd4,_0x2bb71f){return function(_0x836081){if(_0x836081){return _0x836081[_0x1499('0x23')](_0x15bcd4)[_0x1499('0x24')](function(_0x4ec57a){return _0x4ec57a;});}return null;};}function removeEntity(_0x1e2c51,_0x2c7f57){return function(_0x5615b4){if(_0x5615b4){return _0x5615b4[_0x1499('0x25')]()[_0x1499('0x24')](function(){_0x1e2c51[_0x1499('0x18')](0xcc)[_0x1499('0x26')]();});}};}function handleEntityNotFound(_0x3968e0,_0x16d036){return function(_0x54f3c2){if(!_0x54f3c2){_0x3968e0['sendStatus'](0x194);}return _0x54f3c2;};}function handleError(_0x12739b,_0x3c9aca){_0x3c9aca=_0x3c9aca||0x1f4;return function(_0x3b9259){logger[_0x1499('0x27')](_0x3b9259[_0x1499('0x28')]);if(_0x3b9259['name']){delete _0x3b9259[_0x1499('0x29')];}_0x12739b['status'](_0x3c9aca)['send'](_0x3b9259);};}exports['index']=function(_0x21d204,_0x103efa){var _0x40932a={},_0x1b460b={},_0x3dad86={'count':0x0,'rows':[]};var _0x388513=_[_0x1499('0x2a')](db['Integration'][_0x1499('0x2b')],function(_0x1a2c99){return{'name':_0x1a2c99[_0x1499('0x2c')],'type':_0x1a2c99['type'][_0x1499('0x2d')]};});_0x1b460b[_0x1499('0x2e')]=_['map'](_0x388513,_0x1499('0x29'));_0x1b460b[_0x1499('0x2f')]=_['keys'](_0x21d204[_0x1499('0x2f')]);_0x1b460b[_0x1499('0x30')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],_0x1b460b[_0x1499('0x2f')]);_0x40932a[_0x1499('0x32')]=_[_0x1499('0x31')](_0x1b460b[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x21d204[_0x1499('0x2f')][_0x1499('0x33')]));_0x40932a[_0x1499('0x32')]=_0x40932a[_0x1499('0x32')][_0x1499('0x34')]?_0x40932a[_0x1499('0x32')]:_0x1b460b[_0x1499('0x2e')];if(!_0x21d204[_0x1499('0x2f')][_0x1499('0x35')](_0x1499('0x36'))){_0x40932a[_0x1499('0x1b')]=qs['limit'](_0x21d204[_0x1499('0x2f')][_0x1499('0x1b')]);_0x40932a[_0x1499('0x1a')]=qs[_0x1499('0x1a')](_0x21d204[_0x1499('0x2f')][_0x1499('0x1a')]);}_0x40932a[_0x1499('0x37')]=qs[_0x1499('0x38')](_0x21d204[_0x1499('0x2f')][_0x1499('0x38')]);_0x40932a[_0x1499('0x39')]=qs['filters'](_['pick'](_0x21d204[_0x1499('0x2f')],_0x1b460b['filters']),_0x388513);if(_0x21d204[_0x1499('0x2f')]['filter']){_0x40932a[_0x1499('0x39')]=_[_0x1499('0x3a')](_0x40932a[_0x1499('0x39')],{'$or':_[_0x1499('0x2a')](_0x388513,function(_0x531933){if(_0x531933[_0x1499('0x3b')]!=='VIRTUAL'){var _0x2f9c59={};_0x2f9c59[_0x531933[_0x1499('0x29')]]={'$like':'%'+_0x21d204[_0x1499('0x2f')][_0x1499('0x3c')]+'%'};return _0x2f9c59;}})});}_0x40932a=_['merge']({},_0x40932a,_0x21d204[_0x1499('0x3d')]);var _0x815a99={'where':_0x40932a[_0x1499('0x39')]};return db[_0x1499('0x3e')]['count'](_0x815a99)[_0x1499('0x24')](function(_0x4cc411){_0x3dad86[_0x1499('0x1d')]=_0x4cc411;if(_0x21d204[_0x1499('0x2f')][_0x1499('0x3f')]){_0x40932a[_0x1499('0x40')]=[{'all':!![]}];}return db[_0x1499('0x3e')][_0x1499('0x41')](_0x40932a);})[_0x1499('0x24')](function(_0xcb85eb){_0x3dad86[_0x1499('0x42')]=_0xcb85eb;return _0x3dad86;})[_0x1499('0x24')](respondWithFilteredResult(_0x103efa,_0x40932a))['catch'](handleError(_0x103efa,null));};exports[_0x1499('0x43')]=function(_0x5dd36c,_0x2cfdaf){var _0x1af1a1={'raw':![],'where':{'id':_0x5dd36c[_0x1499('0x44')]['id']}},_0x5646cf={};_0x5646cf[_0x1499('0x2e')]=_[_0x1499('0x45')](db[_0x1499('0x3e')][_0x1499('0x2b')]);_0x5646cf['query']=_['keys'](_0x5dd36c[_0x1499('0x2f')]);_0x5646cf[_0x1499('0x30')]=_['intersection'](_0x5646cf[_0x1499('0x2e')],_0x5646cf[_0x1499('0x2f')]);_0x1af1a1['attributes']=_['intersection'](_0x5646cf[_0x1499('0x2e')],qs[_0x1499('0x33')](_0x5dd36c[_0x1499('0x2f')]['fields']));_0x1af1a1[_0x1499('0x32')]=_0x1af1a1[_0x1499('0x32')][_0x1499('0x34')]?_0x1af1a1[_0x1499('0x32')]:_0x5646cf['model'];if(_0x5dd36c[_0x1499('0x2f')][_0x1499('0x3f')]){_0x1af1a1[_0x1499('0x40')]=[{'all':!![]}];}_0x1af1a1=_[_0x1499('0x3a')]({},_0x1af1a1,_0x5dd36c['options']);return db[_0x1499('0x3e')][_0x1499('0x46')](_0x1af1a1)[_0x1499('0x24')](handleEntityNotFound(_0x2cfdaf,null))['then'](respondWithResult(_0x2cfdaf,null))['catch'](handleError(_0x2cfdaf,null));};exports[_0x1499('0x47')]=function(_0x491777,_0x7fa101){return db[_0x1499('0x3e')][_0x1499('0x47')](_0x491777[_0x1499('0x48')],{})[_0x1499('0x24')](respondWithResult(_0x7fa101,0xc9))[_0x1499('0x49')](handleError(_0x7fa101,null));};exports[_0x1499('0x23')]=function(_0x591aa8,_0x420d16){if(_0x591aa8['body']['id']){delete _0x591aa8[_0x1499('0x48')]['id'];}return db[_0x1499('0x3e')]['find']({'where':{'id':_0x591aa8[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x420d16,null))[_0x1499('0x24')](saveUpdates(_0x591aa8['body'],null))[_0x1499('0x24')](respondWithResult(_0x420d16,null))[_0x1499('0x49')](handleError(_0x420d16,null));};exports[_0x1499('0x25')]=function(_0x29ac0f,_0x305599){return db[_0x1499('0x3e')][_0x1499('0x46')]({'where':{'id':_0x29ac0f[_0x1499('0x44')]['id']}})[_0x1499('0x24')](handleEntityNotFound(_0x305599,null))[_0x1499('0x24')](removeEntity(_0x305599,null))['catch'](handleError(_0x305599,null));}; \ No newline at end of file +var _0x5d58=['../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','then','error','stack','name','send','index','map','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','Integration','include','findAll','rows','show','params','rawAttributes','keys','length','includeAll','merge','create','update','find','catch','destroy','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x9aa39c,_0x3f3eb1){var _0x576c82=function(_0x254461){while(--_0x254461){_0x9aa39c['push'](_0x9aa39c['shift']());}};_0x576c82(++_0x3f3eb1);}(_0x5d58,0x187));var _0x85d5=function(_0x17cebd,_0x40165e){_0x17cebd=_0x17cebd-0x0;var _0x53ce3e=_0x5d58[_0x17cebd];return _0x53ce3e;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x85d5('0x0'));var BPromise=require(_0x85d5('0x1'));var Mustache=require('mustache');var util=require(_0x85d5('0x2'));var path=require(_0x85d5('0x3'));var sox=require('sox');var csv=require(_0x85d5('0x4'));var ejs=require(_0x85d5('0x5'));var fs=require('fs');var fs_extra=require(_0x85d5('0x6'));var _=require(_0x85d5('0x7'));var squel=require('squel');var crypto=require(_0x85d5('0x8'));var jsforce=require(_0x85d5('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x85d5('0x4'));var querystring=require('querystring');var Papa=require(_0x85d5('0xa'));var Redis=require(_0x85d5('0xb'));var authService=require(_0x85d5('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x85d5('0xd'))(_0x85d5('0xe'));var utils=require(_0x85d5('0xf'));var config=require(_0x85d5('0x10'));var licenseUtil=require(_0x85d5('0x11'));var db=require(_0x85d5('0x12'))['db'];function respondWithStatusCode(_0x31409d,_0x5897af){_0x5897af=_0x5897af||0xcc;return function(_0x4bbf2a){if(_0x4bbf2a){return _0x31409d['sendStatus'](_0x5897af);}return _0x31409d[_0x85d5('0x13')](_0x5897af)[_0x85d5('0x14')]();};}function respondWithResult(_0x339d4f,_0x1704f0){_0x1704f0=_0x1704f0||0xc8;return function(_0x18a20c){if(_0x18a20c){return _0x339d4f[_0x85d5('0x13')](_0x1704f0)[_0x85d5('0x15')](_0x18a20c);}};}function respondWithFilteredResult(_0x586382,_0x18e977){return function(_0x2d7c95){if(_0x2d7c95){var _0x1621ed=typeof _0x18e977[_0x85d5('0x16')]===_0x85d5('0x17')&&typeof _0x18e977[_0x85d5('0x18')]===_0x85d5('0x17');var _0x12bef9=_0x2d7c95[_0x85d5('0x19')];var _0x17acb0=_0x1621ed?0x0:_0x18e977[_0x85d5('0x16')];var _0x432bd6=_0x1621ed?_0x2d7c95[_0x85d5('0x19')]:_0x18e977[_0x85d5('0x16')]+_0x18e977[_0x85d5('0x18')];var _0x26981b;if(_0x432bd6>=_0x12bef9){_0x432bd6=_0x12bef9;_0x26981b=0xc8;}else{_0x26981b=0xce;}_0x586382[_0x85d5('0x13')](_0x26981b);return _0x586382[_0x85d5('0x1a')]('Content-Range',_0x17acb0+'-'+_0x432bd6+'/'+_0x12bef9)[_0x85d5('0x15')](_0x2d7c95);}return null;};}function patchUpdates(_0x133fa9){return function(_0x5f5755){try{jsonpatch[_0x85d5('0x1b')](_0x5f5755,_0x133fa9,!![]);}catch(_0x1264ca){return BPromise['reject'](_0x1264ca);}return _0x5f5755['save']();};}function saveUpdates(_0x347337,_0x5a1b9a){return function(_0x2f2bae){if(_0x2f2bae){return _0x2f2bae['update'](_0x347337)[_0x85d5('0x1c')](function(_0x1f8d27){return _0x1f8d27;});}return null;};}function removeEntity(_0x560b3a,_0x4e11c4){return function(_0x4da71b){if(_0x4da71b){return _0x4da71b['destroy']()[_0x85d5('0x1c')](function(){_0x560b3a[_0x85d5('0x13')](0xcc)[_0x85d5('0x14')]();});}};}function handleEntityNotFound(_0x466bbd,_0x12fea3){return function(_0xef2405){if(!_0xef2405){_0x466bbd['sendStatus'](0x194);}return _0xef2405;};}function handleError(_0x7e9a11,_0x4f8c66){_0x4f8c66=_0x4f8c66||0x1f4;return function(_0x1b3fae){logger[_0x85d5('0x1d')](_0x1b3fae[_0x85d5('0x1e')]);if(_0x1b3fae['name']){delete _0x1b3fae[_0x85d5('0x1f')];}_0x7e9a11[_0x85d5('0x13')](_0x4f8c66)[_0x85d5('0x20')](_0x1b3fae);};}exports[_0x85d5('0x21')]=function(_0x4605c5,_0x56031f){var _0x1cbef1={},_0x476c8b={},_0x330f8a={'count':0x0,'rows':[]};var _0x22a961=_[_0x85d5('0x22')](db['Integration']['rawAttributes'],function(_0x2ce7a9){return{'name':_0x2ce7a9[_0x85d5('0x23')],'type':_0x2ce7a9[_0x85d5('0x24')][_0x85d5('0x25')]};});_0x476c8b[_0x85d5('0x26')]=_['map'](_0x22a961,_0x85d5('0x1f'));_0x476c8b[_0x85d5('0x27')]=_['keys'](_0x4605c5['query']);_0x476c8b[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x476c8b['model'],_0x476c8b[_0x85d5('0x27')]);_0x1cbef1['attributes']=_[_0x85d5('0x29')](_0x476c8b[_0x85d5('0x26')],qs['fields'](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x1cbef1[_0x85d5('0x2b')]=_0x1cbef1[_0x85d5('0x2b')]['length']?_0x1cbef1['attributes']:_0x476c8b[_0x85d5('0x26')];if(!_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2c')](_0x85d5('0x2d'))){_0x1cbef1[_0x85d5('0x18')]=qs[_0x85d5('0x18')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x18')]);_0x1cbef1[_0x85d5('0x16')]=qs['offset'](_0x4605c5['query'][_0x85d5('0x16')]);}_0x1cbef1[_0x85d5('0x2e')]=qs[_0x85d5('0x2f')](_0x4605c5[_0x85d5('0x27')][_0x85d5('0x2f')]);_0x1cbef1[_0x85d5('0x30')]=qs[_0x85d5('0x28')](_[_0x85d5('0x31')](_0x4605c5['query'],_0x476c8b[_0x85d5('0x28')]),_0x22a961);if(_0x4605c5[_0x85d5('0x27')][_0x85d5('0x32')]){_0x1cbef1[_0x85d5('0x30')]=_['merge'](_0x1cbef1[_0x85d5('0x30')],{'$or':_[_0x85d5('0x22')](_0x22a961,function(_0x3282d3){if(_0x3282d3[_0x85d5('0x24')]!=='VIRTUAL'){var _0x34caed={};_0x34caed[_0x3282d3['name']]={'$like':'%'+_0x4605c5['query'][_0x85d5('0x32')]+'%'};return _0x34caed;}})});}_0x1cbef1=_['merge']({},_0x1cbef1,_0x4605c5[_0x85d5('0x33')]);var _0x5ddba7={'where':_0x1cbef1['where']};return db[_0x85d5('0x34')][_0x85d5('0x19')](_0x5ddba7)[_0x85d5('0x1c')](function(_0x1beffc){_0x330f8a[_0x85d5('0x19')]=_0x1beffc;if(_0x4605c5['query']['includeAll']){_0x1cbef1[_0x85d5('0x35')]=[{'all':!![]}];}return db[_0x85d5('0x34')][_0x85d5('0x36')](_0x1cbef1);})[_0x85d5('0x1c')](function(_0xdd8b3e){_0x330f8a[_0x85d5('0x37')]=_0xdd8b3e;return _0x330f8a;})['then'](respondWithFilteredResult(_0x56031f,_0x1cbef1))['catch'](handleError(_0x56031f,null));};exports[_0x85d5('0x38')]=function(_0x52c99b,_0xfbf466){var _0x18e94d={'raw':![],'where':{'id':_0x52c99b[_0x85d5('0x39')]['id']}},_0x7dd430={};_0x7dd430[_0x85d5('0x26')]=_['keys'](db['Integration'][_0x85d5('0x3a')]);_0x7dd430[_0x85d5('0x27')]=_[_0x85d5('0x3b')](_0x52c99b[_0x85d5('0x27')]);_0x7dd430[_0x85d5('0x28')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],_0x7dd430[_0x85d5('0x27')]);_0x18e94d[_0x85d5('0x2b')]=_[_0x85d5('0x29')](_0x7dd430[_0x85d5('0x26')],qs[_0x85d5('0x2a')](_0x52c99b[_0x85d5('0x27')][_0x85d5('0x2a')]));_0x18e94d[_0x85d5('0x2b')]=_0x18e94d[_0x85d5('0x2b')][_0x85d5('0x3c')]?_0x18e94d['attributes']:_0x7dd430['model'];if(_0x52c99b[_0x85d5('0x27')][_0x85d5('0x3d')]){_0x18e94d[_0x85d5('0x35')]=[{'all':!![]}];}_0x18e94d=_[_0x85d5('0x3e')]({},_0x18e94d,_0x52c99b[_0x85d5('0x33')]);return db[_0x85d5('0x34')]['find'](_0x18e94d)[_0x85d5('0x1c')](handleEntityNotFound(_0xfbf466,null))['then'](respondWithResult(_0xfbf466,null))['catch'](handleError(_0xfbf466,null));};exports[_0x85d5('0x3f')]=function(_0x13ab32,_0x12a03){return db[_0x85d5('0x34')][_0x85d5('0x3f')](_0x13ab32['body'],{})[_0x85d5('0x1c')](respondWithResult(_0x12a03,0xc9))['catch'](handleError(_0x12a03,null));};exports[_0x85d5('0x40')]=function(_0xd8db57,_0x219154){if(_0xd8db57['body']['id']){delete _0xd8db57['body']['id'];}return db['Integration'][_0x85d5('0x41')]({'where':{'id':_0xd8db57[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x219154,null))['then'](saveUpdates(_0xd8db57['body'],null))[_0x85d5('0x1c')](respondWithResult(_0x219154,null))[_0x85d5('0x42')](handleError(_0x219154,null));};exports[_0x85d5('0x43')]=function(_0x288b56,_0x4b2dce){return db[_0x85d5('0x34')][_0x85d5('0x41')]({'where':{'id':_0x288b56[_0x85d5('0x39')]['id']}})[_0x85d5('0x1c')](handleEntityNotFound(_0x4b2dce,null))[_0x85d5('0x1c')](removeEntity(_0x4b2dce,null))[_0x85d5('0x42')](handleError(_0x4b2dce,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 4358c0f..f5ca184 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 _0x209f=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','Integration','integrations'];(function(_0x3ce694,_0x5bb551){var _0x532b9e=function(_0x2208e3){while(--_0x2208e3){_0x3ce694['push'](_0x3ce694['shift']());}};_0x532b9e(++_0x5bb551);}(_0x209f,0x1d9));var _0xf209=function(_0x19a0f6,_0x39ea17){_0x19a0f6=_0x19a0f6-0x0;var _0x41ba09=_0x209f[_0x19a0f6];return _0x41ba09;};'use strict';var _=require(_0xf209('0x0'));var util=require(_0xf209('0x1'));var logger=require(_0xf209('0x2'))(_0xf209('0x3'));var moment=require('moment');var BPromise=require(_0xf209('0x4'));var rp=require(_0xf209('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf209('0x6'));var config=require(_0xf209('0x7'));var attributes=require(_0xf209('0x8'));module['exports']=function(_0x597594,_0x57d630){return _0x597594['define'](_0xf209('0x9'),attributes,{'tableName':_0xf209('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc3b6=['util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Integration','integrations'];(function(_0x6d02b,_0x1e5fd0){var _0x514ec2=function(_0x58d12e){while(--_0x58d12e){_0x6d02b['push'](_0x6d02b['shift']());}};_0x514ec2(++_0x1e5fd0);}(_0xc3b6,0x1e4));var _0x6c3b=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xc3b6[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require(_0x6c3b('0x0'));var logger=require('../../config/logger')(_0x6c3b('0x1'));var moment=require('moment');var BPromise=require(_0x6c3b('0x2'));var rp=require(_0x6c3b('0x3'));var fs=require('fs');var path=require(_0x6c3b('0x4'));var rimraf=require(_0x6c3b('0x5'));var config=require(_0x6c3b('0x6'));var attributes=require('./integration.attributes');module[_0x6c3b('0x7')]=function(_0x39e6ec,_0x29321d){return _0x39e6ec[_0x6c3b('0x8')](_0x6c3b('0x9'),attributes,{'tableName':_0x6c3b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index de231c1..323b1b4 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 _0x5f66=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','Integration,\x20%s,\x20%s','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','info','catch','util','bluebird','randomstring','ioredis'];(function(_0x260c53,_0xdcce16){var _0x25bd0a=function(_0x553ae6){while(--_0x553ae6){_0x260c53['push'](_0x260c53['shift']());}};_0x25bd0a(++_0xdcce16);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0x5f66[_0x5d4607];return _0x5e4a86;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4ed98f,_0x1c0e12,_0x2c6571){return new BPromise(function(_0x112079,_0x8f6451){return client[_0x65f6('0x9')](_0x4ed98f,_0x2c6571)[_0x65f6('0xa')](function(_0x48d85c){logger['info'](_0x65f6('0xb'),_0x1c0e12,_0x65f6('0xc'));logger[_0x65f6('0xd')](_0x65f6('0xe'),_0x1c0e12,'request\x20sent',JSON[_0x65f6('0xf')](_0x48d85c));if(_0x48d85c['error']){if(_0x48d85c['error'][_0x65f6('0x10')]===0x1f4){logger['error'](_0x65f6('0xb'),_0x1c0e12,_0x48d85c['error'][_0x65f6('0x11')]);return _0x8f6451(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);return _0x112079(_0x48d85c[_0x65f6('0x12')][_0x65f6('0x11')]);}else{logger[_0x65f6('0x13')]('Integration,\x20%s,\x20%s',_0x1c0e12,_0x65f6('0xc'));_0x112079(_0x48d85c['result']['message']);}})[_0x65f6('0x14')](function(_0x5c69f8){logger[_0x65f6('0x12')](_0x65f6('0xb'),_0x1c0e12,_0x5c69f8);_0x8f6451(_0x5c69f8);});});} \ No newline at end of file +var _0xc6ac=['http','request','then','info','Integration,\x20%s,\x20%s','debug','Integration,\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(_0x20a024,_0x48d00c){var _0x1e9d89=function(_0x55474a){while(--_0x55474a){_0x20a024['push'](_0x20a024['shift']());}};_0x1e9d89(++_0x48d00c);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x194cd4,_0x3165d8){_0x194cd4=_0x194cd4-0x0;var _0x23d0ec=_0xc6ac[_0x194cd4];return _0x23d0ec;};'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']('Integration,\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/integrationReport/index.js b/server/api/integrationReport/index.js index fdc60d8..5ca86d1 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['show','create','put','/:id','update','delete','util','path','connect-timeout','express','Router','../../config/environment','./integrationReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0xda2d,0x102));var _0xdda2=function(_0x4d4e60,_0x3199e7){_0x4d4e60=_0x4d4e60-0x0;var _0x56c835=_0xda2d[_0x4d4e60];return _0x56c835;};'use strict';var multer=require('multer');var util=require(_0xdda2('0x0'));var path=require(_0xdda2('0x1'));var timeout=require(_0xdda2('0x2'));var express=require(_0xdda2('0x3'));var router=express[_0xdda2('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdda2('0x5'));var controller=require(_0xdda2('0x6'));router[_0xdda2('0x7')]('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0x9')]);router[_0xdda2('0x7')](_0xdda2('0xa'),auth[_0xdda2('0x8')](),controller[_0xdda2('0xb')]);router[_0xdda2('0x7')]('/:id',auth[_0xdda2('0x8')](),controller[_0xdda2('0xc')]);router['post']('/',auth[_0xdda2('0x8')](),controller[_0xdda2('0xd')]);router[_0xdda2('0xe')](_0xdda2('0xf'),auth[_0xdda2('0x8')](),controller[_0xdda2('0x10')]);router[_0xdda2('0x11')](_0xdda2('0xf'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x524e=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','path','connect-timeout'];(function(_0x42ebc0,_0x3ca80e){var _0x590292=function(_0x3d4ded){while(--_0x3d4ded){_0x42ebc0['push'](_0x42ebc0['shift']());}};_0x590292(++_0x3ca80e);}(_0x524e,0x15e));var _0xe524=function(_0x562133,_0x32cdb2){_0x562133=_0x562133-0x0;var _0x43d4bb=_0x524e[_0x562133];return _0x43d4bb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var fs_extra=require(_0xe524('0x4'));var auth=require(_0xe524('0x5'));var interaction=require(_0xe524('0x6'));var config=require(_0xe524('0x7'));var controller=require(_0xe524('0x8'));router[_0xe524('0x9')]('/',auth['isAuthenticated'](),controller[_0xe524('0xa')]);router[_0xe524('0x9')](_0xe524('0xb'),auth['isAuthenticated'](),controller[_0xe524('0xc')]);router[_0xe524('0x9')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0xf')]);router[_0xe524('0x10')]('/',auth[_0xe524('0xe')](),controller[_0xe524('0x11')]);router[_0xe524('0x12')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x13')]);router[_0xe524('0x14')](_0xe524('0xd'),auth[_0xe524('0xe')](),controller[_0xe524('0x15')]);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 50b9bf5..82f15d6 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 _0x09ab=['TEXT','ENUM','FAILED','exports','STRING','INTEGER','DATE','BOOLEAN'];(function(_0x2609e9,_0xb4ba89){var _0x4a3fa3=function(_0x3e66e6){while(--_0x3e66e6){_0x2609e9['push'](_0x2609e9['shift']());}};_0x4a3fa3(++_0xb4ba89);}(_0x09ab,0x1bb));var _0xb09a=function(_0xcd7827,_0x5effe2){_0xcd7827=_0xcd7827-0x0;var _0x432f21=_0x09ab[_0xcd7827];return _0x432f21;};'use strict';var Sequelize=require('sequelize');module[_0xb09a('0x0')]={'integration':{'type':Sequelize[_0xb09a('0x1')]},'eventChannel':{'type':Sequelize[_0xb09a('0x1')]},'exitStatus':{'type':Sequelize[_0xb09a('0x1')]},'ticketId':{'type':Sequelize['STRING']},'integrationId':{'type':Sequelize[_0xb09a('0x2')]},'contacts':{'type':Sequelize[_0xb09a('0x1')]},'uniqueid':{'type':Sequelize[_0xb09a('0x1')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb09a('0x1')]},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0xb09a('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0xb09a('0x3')]},'holdtime':{'type':Sequelize[_0xb09a('0x2')]},'agentcomplete':{'type':Sequelize[_0xb09a('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0xb09a('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xb09a('0x2')]},'reason':{'type':Sequelize[_0xb09a('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xb09a('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xb09a('0x3')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xb09a('0x3')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xb09a('0x1')]},'connectedlinenum':{'type':Sequelize[_0xb09a('0x1')]},'connectedlinename':{'type':Sequelize[_0xb09a('0x1')]},'language':{'type':Sequelize[_0xb09a('0x1')]},'accountcode':{'type':Sequelize[_0xb09a('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb09a('0x1')]},'priority':{'type':Sequelize[_0xb09a('0x1')]},'destchannel':{'type':Sequelize[_0xb09a('0x1')]},'destchannelstate':{'type':Sequelize[_0xb09a('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xb09a('0x1')]},'destcalleridnum':{'type':Sequelize[_0xb09a('0x1')]},'destcalleridname':{'type':Sequelize[_0xb09a('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xb09a('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xb09a('0x1')]},'destlanguage':{'type':Sequelize[_0xb09a('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0xb09a('0x1')]},'destexten':{'type':Sequelize[_0xb09a('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0xb09a('0x1')]},'messageId':{'type':Sequelize[_0xb09a('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize['STRING']},'from':{'type':Sequelize[_0xb09a('0x1')]},'to':{'type':Sequelize[_0xb09a('0x1')]},'cc':{'type':Sequelize[_0xb09a('0x1')]},'attachment':{'type':Sequelize['TEXT']},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0xb09a('0x5')]},'status':{'type':Sequelize[_0xb09a('0x6')]('SENT','SENDING','RECEIVED',_0xb09a('0x7'))},'url':{'type':Sequelize[_0xb09a('0x1')]},'app':{'type':Sequelize[_0xb09a('0x1')]},'appdata':{'type':Sequelize[_0xb09a('0x1')]},'projectId':{'type':Sequelize[_0xb09a('0x2')]}}; \ No newline at end of file +var _0xf6ee=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENDING','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xf6ee,0x1d7));var _0xef6e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf6ee[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xef6e('0x0')]={'integration':{'type':Sequelize[_0xef6e('0x1')]},'eventChannel':{'type':Sequelize[_0xef6e('0x1')]},'exitStatus':{'type':Sequelize[_0xef6e('0x1')]},'ticketId':{'type':Sequelize[_0xef6e('0x1')]},'integrationId':{'type':Sequelize[_0xef6e('0x2')]},'contacts':{'type':Sequelize[_0xef6e('0x1')]},'uniqueid':{'type':Sequelize[_0xef6e('0x1')]},'calleridnum':{'type':Sequelize[_0xef6e('0x1')]},'calleridname':{'type':Sequelize[_0xef6e('0x1')]},'queue':{'type':Sequelize[_0xef6e('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xef6e('0x1')]},'agentcalledAt':{'type':Sequelize[_0xef6e('0x3')]},'agentconnectAt':{'type':Sequelize[_0xef6e('0x3')]},'holdtime':{'type':Sequelize[_0xef6e('0x2')]},'agentcomplete':{'type':Sequelize[_0xef6e('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xef6e('0x3')]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xef6e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xef6e('0x2')]},'reason':{'type':Sequelize[_0xef6e('0x1')]},'agentringnoanswer':{'type':Sequelize[_0xef6e('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xef6e('0x3')]},'agentdump':{'type':Sequelize[_0xef6e('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xef6e('0x3')]},'lastevent':{'type':Sequelize[_0xef6e('0x1')]},'channel':{'type':Sequelize[_0xef6e('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xef6e('0x1')]},'connectedlinenum':{'type':Sequelize[_0xef6e('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xef6e('0x1')]},'accountcode':{'type':Sequelize[_0xef6e('0x1')]},'context':{'type':Sequelize[_0xef6e('0x1')]},'exten':{'type':Sequelize[_0xef6e('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xef6e('0x1')]},'destchannelstate':{'type':Sequelize[_0xef6e('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xef6e('0x1')]},'destcalleridnum':{'type':Sequelize[_0xef6e('0x1')]},'destcalleridname':{'type':Sequelize[_0xef6e('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xef6e('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xef6e('0x1')]},'destlanguage':{'type':Sequelize[_0xef6e('0x1')]},'destaccountcode':{'type':Sequelize[_0xef6e('0x1')]},'destcontext':{'type':Sequelize[_0xef6e('0x1')]},'destexten':{'type':Sequelize[_0xef6e('0x1')]},'destpriority':{'type':Sequelize[_0xef6e('0x1')]},'destuniqueid':{'type':Sequelize[_0xef6e('0x1')]},'messageId':{'type':Sequelize[_0xef6e('0x1')]},'inReplyTo':{'type':Sequelize[_0xef6e('0x1')]},'subject':{'type':Sequelize[_0xef6e('0x1')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0xef6e('0x1')]},'cc':{'type':Sequelize[_0xef6e('0x1')]},'attachment':{'type':Sequelize[_0xef6e('0x5')]},'html':{'type':Sequelize[_0xef6e('0x5')]},'text':{'type':Sequelize[_0xef6e('0x5')]},'status':{'type':Sequelize[_0xef6e('0x6')]('SENT',_0xef6e('0x7'),'RECEIVED','FAILED')},'url':{'type':Sequelize[_0xef6e('0x1')]},'app':{'type':Sequelize[_0xef6e('0x1')]},'appdata':{'type':Sequelize[_0xef6e('0x1')]},'projectId':{'type':Sequelize[_0xef6e('0x2')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 58451c8..404ffc0 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 _0x81f0=['../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','IntegrationReport','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','length','find','create','body','params','describe','zip-dir','request-promise','moment','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment'];(function(_0x231af8,_0x6b47e){var _0x3255a6=function(_0x12b329){while(--_0x12b329){_0x231af8['push'](_0x231af8['shift']());}};_0x3255a6(++_0x6b47e);}(_0x81f0,0x159));var _0x081f=function(_0x4ab21b,_0x23c17f){_0x4ab21b=_0x4ab21b-0x0;var _0x39c944=_0x81f0[_0x4ab21b];return _0x39c944;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x081f('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x081f('0x1'));var moment=require(_0x081f('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x081f('0x3'));var sox=require(_0x081f('0x4'));var csv=require(_0x081f('0x5'));var ejs=require(_0x081f('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x081f('0x7'));var squel=require(_0x081f('0x8'));var crypto=require(_0x081f('0x9'));var jsforce=require(_0x081f('0xa'));var deskjs=require(_0x081f('0xb'));var toCsv=require('to-csv');var querystring=require(_0x081f('0xc'));var Papa=require(_0x081f('0xd'));var Redis=require(_0x081f('0xe'));var authService=require(_0x081f('0xf'));var qs=require(_0x081f('0x10'));var as=require(_0x081f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x081f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x081f('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x081f('0x14'))['db'];function respondWithStatusCode(_0x5a3251,_0x2a97dd){_0x2a97dd=_0x2a97dd||0xcc;return function(_0x25a46a){if(_0x25a46a){return _0x5a3251['sendStatus'](_0x2a97dd);}return _0x5a3251[_0x081f('0x15')](_0x2a97dd)[_0x081f('0x16')]();};}function respondWithResult(_0x34b39e,_0x976f73){_0x976f73=_0x976f73||0xc8;return function(_0x3db54e){if(_0x3db54e){return _0x34b39e[_0x081f('0x15')](_0x976f73)['json'](_0x3db54e);}};}function respondWithFilteredResult(_0x35e218,_0x21e4bf){return function(_0x44b588){if(_0x44b588){var _0xfe3be4=typeof _0x21e4bf[_0x081f('0x17')]===_0x081f('0x18')&&typeof _0x21e4bf[_0x081f('0x19')]===_0x081f('0x18');var _0x15c361=_0x44b588[_0x081f('0x1a')];var _0x54d01c=_0xfe3be4?0x0:_0x21e4bf[_0x081f('0x17')];var _0x40d67b=_0xfe3be4?_0x44b588[_0x081f('0x1a')]:_0x21e4bf[_0x081f('0x17')]+_0x21e4bf[_0x081f('0x19')];var _0x120bb4;if(_0x40d67b>=_0x15c361){_0x40d67b=_0x15c361;_0x120bb4=0xc8;}else{_0x120bb4=0xce;}_0x35e218[_0x081f('0x15')](_0x120bb4);return _0x35e218[_0x081f('0x1b')](_0x081f('0x1c'),_0x54d01c+'-'+_0x40d67b+'/'+_0x15c361)[_0x081f('0x1d')](_0x44b588);}return null;};}function patchUpdates(_0x688be1){return function(_0x2c9674){try{jsonpatch[_0x081f('0x1e')](_0x2c9674,_0x688be1,!![]);}catch(_0x515290){return BPromise[_0x081f('0x1f')](_0x515290);}return _0x2c9674[_0x081f('0x20')]();};}function saveUpdates(_0x3315b4,_0x39f420){return function(_0x5e3474){if(_0x5e3474){return _0x5e3474[_0x081f('0x21')](_0x3315b4)[_0x081f('0x22')](function(_0x312b9f){return _0x312b9f;});}return null;};}function removeEntity(_0x57766f,_0x4c3b68){return function(_0x58c716){if(_0x58c716){return _0x58c716[_0x081f('0x23')]()[_0x081f('0x22')](function(){_0x57766f[_0x081f('0x15')](0xcc)[_0x081f('0x16')]();});}};}function handleEntityNotFound(_0x4d19a5,_0x259dc6){return function(_0x3cc08b){if(!_0x3cc08b){_0x4d19a5[_0x081f('0x24')](0x194);}return _0x3cc08b;};}function handleError(_0x7c4527,_0x363fe5){_0x363fe5=_0x363fe5||0x1f4;return function(_0x426407){logger[_0x081f('0x25')](_0x426407[_0x081f('0x26')]);if(_0x426407[_0x081f('0x27')]){delete _0x426407[_0x081f('0x27')];}_0x7c4527[_0x081f('0x15')](_0x363fe5)['send'](_0x426407);};}exports[_0x081f('0x28')]=function(_0x1dd38,_0x345cc7){var _0x4c1a5a={},_0x208659={},_0x28992d={'count':0x0,'rows':[]};var _0x184b4c=_[_0x081f('0x29')](db[_0x081f('0x2a')][_0x081f('0x2b')],function(_0x51a8aa){return{'name':_0x51a8aa[_0x081f('0x2c')],'type':_0x51a8aa[_0x081f('0x2d')][_0x081f('0x2e')]};});_0x208659[_0x081f('0x2f')]=_[_0x081f('0x29')](_0x184b4c,_0x081f('0x27'));_0x208659[_0x081f('0x30')]=_['keys'](_0x1dd38[_0x081f('0x30')]);_0x208659['filters']=_[_0x081f('0x31')](_0x208659[_0x081f('0x2f')],_0x208659[_0x081f('0x30')]);_0x4c1a5a[_0x081f('0x32')]=_[_0x081f('0x31')](_0x208659[_0x081f('0x2f')],qs[_0x081f('0x33')](_0x1dd38['query'][_0x081f('0x33')]));_0x4c1a5a[_0x081f('0x32')]=_0x4c1a5a[_0x081f('0x32')]['length']?_0x4c1a5a[_0x081f('0x32')]:_0x208659[_0x081f('0x2f')];if(!_0x1dd38['query'][_0x081f('0x34')](_0x081f('0x35'))){_0x4c1a5a[_0x081f('0x19')]=qs['limit'](_0x1dd38[_0x081f('0x30')]['limit']);_0x4c1a5a[_0x081f('0x17')]=qs[_0x081f('0x17')](_0x1dd38[_0x081f('0x30')][_0x081f('0x17')]);}_0x4c1a5a['order']=qs[_0x081f('0x36')](_0x1dd38[_0x081f('0x30')]['sort']);_0x4c1a5a[_0x081f('0x37')]=qs[_0x081f('0x38')](_['pick'](_0x1dd38[_0x081f('0x30')],_0x208659[_0x081f('0x38')]),_0x184b4c);if(_0x1dd38[_0x081f('0x30')][_0x081f('0x39')]){_0x4c1a5a['where']=_[_0x081f('0x3a')](_0x4c1a5a[_0x081f('0x37')],{'$or':_[_0x081f('0x29')](_0x184b4c,function(_0x51f9cc){if(_0x51f9cc[_0x081f('0x2d')]!==_0x081f('0x3b')){var _0x3e6b36={};_0x3e6b36[_0x51f9cc[_0x081f('0x27')]]={'$like':'%'+_0x1dd38[_0x081f('0x30')][_0x081f('0x39')]+'%'};return _0x3e6b36;}})});}_0x4c1a5a=_['merge']({},_0x4c1a5a,_0x1dd38['options']);var _0x460572={'where':_0x4c1a5a['where']};return db['IntegrationReport']['count'](_0x460572)['then'](function(_0x27d3c5){_0x28992d[_0x081f('0x1a')]=_0x27d3c5;if(_0x1dd38[_0x081f('0x30')][_0x081f('0x3c')]){_0x4c1a5a[_0x081f('0x3d')]=[{'all':!![]}];}return db[_0x081f('0x2a')][_0x081f('0x3e')](_0x4c1a5a);})['then'](function(_0x49a5a9){_0x28992d[_0x081f('0x3f')]=_0x49a5a9;return _0x28992d;})[_0x081f('0x22')](respondWithFilteredResult(_0x345cc7,_0x4c1a5a))[_0x081f('0x40')](handleError(_0x345cc7,null));};exports[_0x081f('0x41')]=function(_0x4735d9,_0x5b15c8){var _0x496175={'raw':![],'where':{'id':_0x4735d9['params']['id']}},_0x56104c={};_0x56104c[_0x081f('0x2f')]=_[_0x081f('0x42')](db['IntegrationReport'][_0x081f('0x2b')]);_0x56104c[_0x081f('0x30')]=_[_0x081f('0x42')](_0x4735d9[_0x081f('0x30')]);_0x56104c['filters']=_['intersection'](_0x56104c[_0x081f('0x2f')],_0x56104c[_0x081f('0x30')]);_0x496175[_0x081f('0x32')]=_[_0x081f('0x31')](_0x56104c['model'],qs[_0x081f('0x33')](_0x4735d9[_0x081f('0x30')][_0x081f('0x33')]));_0x496175[_0x081f('0x32')]=_0x496175[_0x081f('0x32')][_0x081f('0x43')]?_0x496175[_0x081f('0x32')]:_0x56104c[_0x081f('0x2f')];if(_0x4735d9[_0x081f('0x30')][_0x081f('0x3c')]){_0x496175[_0x081f('0x3d')]=[{'all':!![]}];}_0x496175=_['merge']({},_0x496175,_0x4735d9['options']);return db[_0x081f('0x2a')][_0x081f('0x44')](_0x496175)[_0x081f('0x22')](handleEntityNotFound(_0x5b15c8,null))[_0x081f('0x22')](respondWithResult(_0x5b15c8,null))[_0x081f('0x40')](handleError(_0x5b15c8,null));};exports[_0x081f('0x45')]=function(_0x2f5faf,_0x7ec2c6){return db[_0x081f('0x2a')][_0x081f('0x45')](_0x2f5faf[_0x081f('0x46')],{})[_0x081f('0x22')](respondWithResult(_0x7ec2c6,0xc9))[_0x081f('0x40')](handleError(_0x7ec2c6,null));};exports['update']=function(_0x1572b6,_0x27bd3b){if(_0x1572b6[_0x081f('0x46')]['id']){delete _0x1572b6[_0x081f('0x46')]['id'];}return db[_0x081f('0x2a')][_0x081f('0x44')]({'where':{'id':_0x1572b6[_0x081f('0x47')]['id']}})['then'](handleEntityNotFound(_0x27bd3b,null))[_0x081f('0x22')](saveUpdates(_0x1572b6['body'],null))[_0x081f('0x22')](respondWithResult(_0x27bd3b,null))[_0x081f('0x40')](handleError(_0x27bd3b,null));};exports[_0x081f('0x23')]=function(_0x404cfb,_0x3c0cfc){return db[_0x081f('0x2a')]['find']({'where':{'id':_0x404cfb[_0x081f('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c0cfc,null))[_0x081f('0x22')](removeEntity(_0x3c0cfc,null))[_0x081f('0x40')](handleError(_0x3c0cfc,null));};exports[_0x081f('0x48')]=function(_0x289ae3,_0x45689f){return db['IntegrationReport']['describe']()['then'](respondWithResult(_0x45689f,null))[_0x081f('0x40')](handleError(_0x45689f,null));}; \ No newline at end of file +var _0xfc97=['moment','bluebird','mustache','util','path','sox','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','error','stack','name','send','index','map','IntegrationReport','fieldName','model','intersection','attributes','fields','query','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','keys','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xfc97,0x178));var _0x7fc9=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfc97[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x7fc9('0x0'));var rimraf=require(_0x7fc9('0x1'));var zipdir=require(_0x7fc9('0x2'));var jsonpatch=require(_0x7fc9('0x3'));var rp=require('request-promise');var moment=require(_0x7fc9('0x4'));var BPromise=require(_0x7fc9('0x5'));var Mustache=require(_0x7fc9('0x6'));var util=require(_0x7fc9('0x7'));var path=require(_0x7fc9('0x8'));var sox=require(_0x7fc9('0x9'));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(_0x7fc9('0xa'));var jsforce=require(_0x7fc9('0xb'));var deskjs=require(_0x7fc9('0xc'));var toCsv=require(_0x7fc9('0xd'));var querystring=require(_0x7fc9('0xe'));var Papa=require(_0x7fc9('0xf'));var Redis=require(_0x7fc9('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7fc9('0x11'));var as=require(_0x7fc9('0x12'));var hardwareService=require(_0x7fc9('0x13'));var logger=require(_0x7fc9('0x14'))(_0x7fc9('0x15'));var utils=require(_0x7fc9('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x7fc9('0x17'));var db=require(_0x7fc9('0x18'))['db'];function respondWithStatusCode(_0x490151,_0x301c89){_0x301c89=_0x301c89||0xcc;return function(_0xf1c73f){if(_0xf1c73f){return _0x490151[_0x7fc9('0x19')](_0x301c89);}return _0x490151[_0x7fc9('0x1a')](_0x301c89)[_0x7fc9('0x1b')]();};}function respondWithResult(_0x773407,_0x6a0548){_0x6a0548=_0x6a0548||0xc8;return function(_0x39ea7a){if(_0x39ea7a){return _0x773407[_0x7fc9('0x1a')](_0x6a0548)[_0x7fc9('0x1c')](_0x39ea7a);}};}function respondWithFilteredResult(_0x3dcfc3,_0x1da465){return function(_0x31a982){if(_0x31a982){var _0x5bae19=typeof _0x1da465[_0x7fc9('0x1d')]==='undefined'&&typeof _0x1da465[_0x7fc9('0x1e')]===_0x7fc9('0x1f');var _0x3d829d=_0x31a982[_0x7fc9('0x20')];var _0x3c27df=_0x5bae19?0x0:_0x1da465[_0x7fc9('0x1d')];var _0x4aa398=_0x5bae19?_0x31a982[_0x7fc9('0x20')]:_0x1da465[_0x7fc9('0x1d')]+_0x1da465[_0x7fc9('0x1e')];var _0x37e6cf;if(_0x4aa398>=_0x3d829d){_0x4aa398=_0x3d829d;_0x37e6cf=0xc8;}else{_0x37e6cf=0xce;}_0x3dcfc3[_0x7fc9('0x1a')](_0x37e6cf);return _0x3dcfc3['set'](_0x7fc9('0x21'),_0x3c27df+'-'+_0x4aa398+'/'+_0x3d829d)[_0x7fc9('0x1c')](_0x31a982);}return null;};}function patchUpdates(_0x4a43c9){return function(_0x4db4c8){try{jsonpatch[_0x7fc9('0x22')](_0x4db4c8,_0x4a43c9,!![]);}catch(_0x5bb16d){return BPromise['reject'](_0x5bb16d);}return _0x4db4c8[_0x7fc9('0x23')]();};}function saveUpdates(_0x5eae73,_0x57364f){return function(_0x54a652){if(_0x54a652){return _0x54a652[_0x7fc9('0x24')](_0x5eae73)[_0x7fc9('0x25')](function(_0x1d22b5){return _0x1d22b5;});}return null;};}function removeEntity(_0x9069ed,_0x1c787d){return function(_0x5f273a){if(_0x5f273a){return _0x5f273a['destroy']()[_0x7fc9('0x25')](function(){_0x9069ed[_0x7fc9('0x1a')](0xcc)[_0x7fc9('0x1b')]();});}};}function handleEntityNotFound(_0x3db502,_0x17d63b){return function(_0x570f73){if(!_0x570f73){_0x3db502[_0x7fc9('0x19')](0x194);}return _0x570f73;};}function handleError(_0x3e4c4a,_0x2060b4){_0x2060b4=_0x2060b4||0x1f4;return function(_0x571de0){logger[_0x7fc9('0x26')](_0x571de0[_0x7fc9('0x27')]);if(_0x571de0[_0x7fc9('0x28')]){delete _0x571de0[_0x7fc9('0x28')];}_0x3e4c4a['status'](_0x2060b4)[_0x7fc9('0x29')](_0x571de0);};}exports[_0x7fc9('0x2a')]=function(_0x2082ad,_0x2b4779){var _0x8d9055={},_0x194b31={},_0x4bf0fa={'count':0x0,'rows':[]};var _0x35e913=_[_0x7fc9('0x2b')](db[_0x7fc9('0x2c')]['rawAttributes'],function(_0x15c9d5){return{'name':_0x15c9d5[_0x7fc9('0x2d')],'type':_0x15c9d5['type']['key']};});_0x194b31[_0x7fc9('0x2e')]=_['map'](_0x35e913,_0x7fc9('0x28'));_0x194b31['query']=_['keys'](_0x2082ad['query']);_0x194b31['filters']=_[_0x7fc9('0x2f')](_0x194b31['model'],_0x194b31['query']);_0x8d9055[_0x7fc9('0x30')]=_['intersection'](_0x194b31[_0x7fc9('0x2e')],qs[_0x7fc9('0x31')](_0x2082ad[_0x7fc9('0x32')]['fields']));_0x8d9055[_0x7fc9('0x30')]=_0x8d9055[_0x7fc9('0x30')]['length']?_0x8d9055[_0x7fc9('0x30')]:_0x194b31['model'];if(!_0x2082ad[_0x7fc9('0x32')][_0x7fc9('0x33')](_0x7fc9('0x34'))){_0x8d9055[_0x7fc9('0x1e')]=qs['limit'](_0x2082ad[_0x7fc9('0x32')][_0x7fc9('0x1e')]);_0x8d9055['offset']=qs[_0x7fc9('0x1d')](_0x2082ad[_0x7fc9('0x32')][_0x7fc9('0x1d')]);}_0x8d9055[_0x7fc9('0x35')]=qs[_0x7fc9('0x36')](_0x2082ad[_0x7fc9('0x32')][_0x7fc9('0x36')]);_0x8d9055[_0x7fc9('0x37')]=qs[_0x7fc9('0x38')](_[_0x7fc9('0x39')](_0x2082ad['query'],_0x194b31[_0x7fc9('0x38')]),_0x35e913);if(_0x2082ad['query'][_0x7fc9('0x3a')]){_0x8d9055[_0x7fc9('0x37')]=_['merge'](_0x8d9055[_0x7fc9('0x37')],{'$or':_['map'](_0x35e913,function(_0xb8e722){if(_0xb8e722[_0x7fc9('0x3b')]!=='VIRTUAL'){var _0x421e88={};_0x421e88[_0xb8e722['name']]={'$like':'%'+_0x2082ad['query'][_0x7fc9('0x3a')]+'%'};return _0x421e88;}})});}_0x8d9055=_[_0x7fc9('0x3c')]({},_0x8d9055,_0x2082ad[_0x7fc9('0x3d')]);var _0x5c43ff={'where':_0x8d9055['where']};return db[_0x7fc9('0x2c')][_0x7fc9('0x20')](_0x5c43ff)[_0x7fc9('0x25')](function(_0x529359){_0x4bf0fa[_0x7fc9('0x20')]=_0x529359;if(_0x2082ad[_0x7fc9('0x32')][_0x7fc9('0x3e')]){_0x8d9055[_0x7fc9('0x3f')]=[{'all':!![]}];}return db[_0x7fc9('0x2c')][_0x7fc9('0x40')](_0x8d9055);})[_0x7fc9('0x25')](function(_0x2d44e8){_0x4bf0fa[_0x7fc9('0x41')]=_0x2d44e8;return _0x4bf0fa;})[_0x7fc9('0x25')](respondWithFilteredResult(_0x2b4779,_0x8d9055))[_0x7fc9('0x42')](handleError(_0x2b4779,null));};exports[_0x7fc9('0x43')]=function(_0x2565e9,_0x39b228){var _0x47e206={'raw':![],'where':{'id':_0x2565e9[_0x7fc9('0x44')]['id']}},_0x453980={};_0x453980['model']=_['keys'](db['IntegrationReport'][_0x7fc9('0x45')]);_0x453980[_0x7fc9('0x32')]=_[_0x7fc9('0x46')](_0x2565e9[_0x7fc9('0x32')]);_0x453980[_0x7fc9('0x38')]=_[_0x7fc9('0x2f')](_0x453980[_0x7fc9('0x2e')],_0x453980[_0x7fc9('0x32')]);_0x47e206[_0x7fc9('0x30')]=_[_0x7fc9('0x2f')](_0x453980[_0x7fc9('0x2e')],qs[_0x7fc9('0x31')](_0x2565e9[_0x7fc9('0x32')][_0x7fc9('0x31')]));_0x47e206[_0x7fc9('0x30')]=_0x47e206['attributes']['length']?_0x47e206['attributes']:_0x453980[_0x7fc9('0x2e')];if(_0x2565e9[_0x7fc9('0x32')][_0x7fc9('0x3e')]){_0x47e206[_0x7fc9('0x3f')]=[{'all':!![]}];}_0x47e206=_['merge']({},_0x47e206,_0x2565e9[_0x7fc9('0x3d')]);return db[_0x7fc9('0x2c')]['find'](_0x47e206)[_0x7fc9('0x25')](handleEntityNotFound(_0x39b228,null))['then'](respondWithResult(_0x39b228,null))['catch'](handleError(_0x39b228,null));};exports[_0x7fc9('0x47')]=function(_0x4c232d,_0x32b70b){return db[_0x7fc9('0x2c')][_0x7fc9('0x47')](_0x4c232d['body'],{})[_0x7fc9('0x25')](respondWithResult(_0x32b70b,0xc9))[_0x7fc9('0x42')](handleError(_0x32b70b,null));};exports['update']=function(_0x2da951,_0x43e436){if(_0x2da951[_0x7fc9('0x48')]['id']){delete _0x2da951[_0x7fc9('0x48')]['id'];}return db['IntegrationReport'][_0x7fc9('0x49')]({'where':{'id':_0x2da951[_0x7fc9('0x44')]['id']}})['then'](handleEntityNotFound(_0x43e436,null))['then'](saveUpdates(_0x2da951[_0x7fc9('0x48')],null))[_0x7fc9('0x25')](respondWithResult(_0x43e436,null))[_0x7fc9('0x42')](handleError(_0x43e436,null));};exports[_0x7fc9('0x4a')]=function(_0x39c9e6,_0x33fed1){return db[_0x7fc9('0x2c')][_0x7fc9('0x49')]({'where':{'id':_0x39c9e6[_0x7fc9('0x44')]['id']}})[_0x7fc9('0x25')](handleEntityNotFound(_0x33fed1,null))[_0x7fc9('0x25')](removeEntity(_0x33fed1,null))[_0x7fc9('0x42')](handleError(_0x33fed1,null));};exports[_0x7fc9('0x4b')]=function(_0x9f575e,_0x41244f){return db[_0x7fc9('0x2c')][_0x7fc9('0x4b')]()[_0x7fc9('0x25')](respondWithResult(_0x41244f,null))[_0x7fc9('0x42')](handleError(_0x41244f,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 1d88f94..5a21681 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 _0x9b0c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x9b0c,0x8c));var _0xc9b0=function(_0x5a1737,_0x3c26ab){_0x5a1737=_0x5a1737-0x0;var _0x24b326=_0x9b0c[_0x5a1737];return _0x24b326;};'use strict';var _=require(_0xc9b0('0x0'));var util=require('util');var logger=require(_0xc9b0('0x1'))(_0xc9b0('0x2'));var moment=require(_0xc9b0('0x3'));var BPromise=require(_0xc9b0('0x4'));var rp=require(_0xc9b0('0x5'));var fs=require('fs');var path=require(_0xc9b0('0x6'));var rimraf=require(_0xc9b0('0x7'));var config=require(_0xc9b0('0x8'));var attributes=require('./integrationReport.attributes');module[_0xc9b0('0x9')]=function(_0x209312,_0xa95ad1){return _0x209312[_0xc9b0('0xa')](_0xc9b0('0xb'),attributes,{'tableName':_0xc9b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14cc=['request-promise','path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','util','api','moment','bluebird'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x14cc,0xe3));var _0xc14c=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0x14cc[_0x10c16d];return _0x5896f4;};'use strict';var _=require('lodash');var util=require(_0xc14c('0x0'));var logger=require('../../config/logger')(_0xc14c('0x1'));var moment=require(_0xc14c('0x2'));var BPromise=require(_0xc14c('0x3'));var rp=require(_0xc14c('0x4'));var fs=require('fs');var path=require(_0xc14c('0x5'));var rimraf=require(_0xc14c('0x6'));var config=require(_0xc14c('0x7'));var attributes=require(_0xc14c('0x8'));module[_0xc14c('0x9')]=function(_0x48ae57,_0x1bfbaa){return _0x48ae57['define'](_0xc14c('0xa'),attributes,{'tableName':'report_integration','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 3db003b..d0acf11 100644 --- a/server/api/integrationReport/integrationReport.rpc.js +++ b/server/api/integrationReport/integrationReport.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0x687b,0x14a));var _0xb687=function(_0x3893da,_0x22bffb){_0x3893da=_0x3893da-0x0;var _0x1c3533=_0x687b[_0x3893da];return _0x1c3533;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0x1967=['then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x1967,0x173));var _0x7196=function(_0x563ecd,_0x221e16){_0x563ecd=_0x563ecd-0x0;var _0x347157=_0x1967[_0x563ecd];return _0x347157;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x194746,_0x40e0af,_0x266a6e){return new BPromise(function(_0xad78a,_0x510c72){return client[_0x7196('0xc')](_0x194746,_0x266a6e)[_0x7196('0xd')](function(_0x3f846e){logger[_0x7196('0xe')](_0x7196('0xf'),_0x40e0af,'request\x20sent');logger['debug'](_0x7196('0x10'),_0x40e0af,_0x7196('0x11'),JSON[_0x7196('0x12')](_0x3f846e));if(_0x3f846e[_0x7196('0x13')]){if(_0x3f846e[_0x7196('0x13')][_0x7196('0x14')]===0x1f4){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0x510c72(_0x3f846e[_0x7196('0x13')]['message']);}logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x3f846e[_0x7196('0x13')][_0x7196('0x15')]);return _0xad78a(_0x3f846e['error'][_0x7196('0x15')]);}else{logger['info'](_0x7196('0xf'),_0x40e0af,_0x7196('0x11'));_0xad78a(_0x3f846e[_0x7196('0x16')][_0x7196('0x15')]);}})[_0x7196('0x17')](function(_0x2e3e0e){logger[_0x7196('0x13')](_0x7196('0xf'),_0x40e0af,_0x2e3e0e);_0x510c72(_0x2e3e0e);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index ba9aa4c..01d3792 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 _0x3de2=['../../components/interaction/service','../../config/environment','./interval.controller','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x5a128e,_0x52b148){var _0x121cd3=function(_0x201a0c){while(--_0x201a0c){_0x5a128e['push'](_0x5a128e['shift']());}};_0x121cd3(++_0x52b148);}(_0x3de2,0x79));var _0x23de=function(_0x3070dc,_0x40cf11){_0x3070dc=_0x3070dc-0x0;var _0x431489=_0x3de2[_0x3070dc];return _0x431489;};'use strict';var multer=require(_0x23de('0x0'));var util=require('util');var path=require(_0x23de('0x1'));var timeout=require(_0x23de('0x2'));var express=require(_0x23de('0x3'));var router=express[_0x23de('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x23de('0x5'));var config=require(_0x23de('0x6'));var controller=require(_0x23de('0x7'));router[_0x23de('0x8')]('/',auth['isAuthenticated'](),controller[_0x23de('0x9')]);router['get'](_0x23de('0xa'),auth[_0x23de('0xb')](),controller[_0x23de('0xc')]);router[_0x23de('0x8')](_0x23de('0xd'),auth[_0x23de('0xb')](),controller[_0x23de('0xe')]);router['post']('/',auth[_0x23de('0xb')](),controller['create']);router[_0x23de('0xf')](_0x23de('0xd'),auth['isAuthenticated'](),controller['addInterval']);router[_0x23de('0xf')]('/:id/sub_intervals/create_many',auth[_0x23de('0xb')](),controller['addIntervals']);router[_0x23de('0x10')](_0x23de('0xa'),auth[_0x23de('0xb')](),controller[_0x23de('0x11')]);router[_0x23de('0x12')](_0x23de('0xa'),auth[_0x23de('0xb')](),controller[_0x23de('0x13')]);module[_0x23de('0x14')]=router; \ No newline at end of file +var _0x8098=['post','create','addInterval','/:id/sub_intervals/create_many','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./interval.controller','get','index','isAuthenticated','show','/:id/sub_intervals','getIntervals'];(function(_0x118b11,_0xb640a1){var _0x41bad6=function(_0x51ee30){while(--_0x51ee30){_0x118b11['push'](_0x118b11['shift']());}};_0x41bad6(++_0xb640a1);}(_0x8098,0x1ba));var _0x8809=function(_0x1402fd,_0x168602){_0x1402fd=_0x1402fd-0x0;var _0xad68d6=_0x8098[_0x1402fd];return _0xad68d6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8809('0x0'));var timeout=require(_0x8809('0x1'));var express=require(_0x8809('0x2'));var router=express[_0x8809('0x3')]();var fs_extra=require(_0x8809('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8809('0x5'));var config=require(_0x8809('0x6'));var controller=require(_0x8809('0x7'));router[_0x8809('0x8')]('/',auth['isAuthenticated'](),controller[_0x8809('0x9')]);router[_0x8809('0x8')]('/:id',auth[_0x8809('0xa')](),controller[_0x8809('0xb')]);router[_0x8809('0x8')](_0x8809('0xc'),auth[_0x8809('0xa')](),controller[_0x8809('0xd')]);router[_0x8809('0xe')]('/',auth[_0x8809('0xa')](),controller[_0x8809('0xf')]);router[_0x8809('0xe')](_0x8809('0xc'),auth[_0x8809('0xa')](),controller[_0x8809('0x10')]);router[_0x8809('0xe')](_0x8809('0x11'),auth[_0x8809('0xa')](),controller['addIntervals']);router[_0x8809('0x12')](_0x8809('0x13'),auth['isAuthenticated'](),controller[_0x8809('0x14')]);router[_0x8809('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x8809('0x16')]);module[_0x8809('0x17')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index bf2f1f7..98edcc4 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 _0xd4ef=['sequelize','exports','STRING'];(function(_0x173c27,_0x16bad6){var _0x4d32fe=function(_0x5893e4){while(--_0x5893e4){_0x173c27['push'](_0x173c27['shift']());}};_0x4d32fe(++_0x16bad6);}(_0xd4ef,0x174));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xfd4e('0x0'));module[_0xfd4e('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xfd4e('0x2')]},'interval':{'type':Sequelize[_0xfd4e('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x920e=['exports','STRING','sequelize'];(function(_0x4b81cb,_0x15727d){var _0x34dd24=function(_0x47007d){while(--_0x47007d){_0x4b81cb['push'](_0x4b81cb['shift']());}};_0x34dd24(++_0x15727d);}(_0x920e,0x173));var _0xe920=function(_0x46b438,_0x38d0a6){_0x46b438=_0x46b438-0x0;var _0x35dd40=_0x920e[_0x46b438];return _0x35dd40;};'use strict';var Sequelize=require(_0xe920('0x0'));module[_0xe920('0x1')]={'name':{'type':Sequelize[_0xe920('0x2')]},'description':{'type':Sequelize[_0xe920('0x2')]},'interval':{'type':Sequelize[_0xe920('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 8fb4704..8ad878e 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 _0x7506=['find','create','user','get','role','userProfileId','autoAssociation','catch','body','params','addInterval','IntervalId','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../components/extensions/rewrite','sendStatus','status','end','offset','undefined','limit','count','set','json','save','update','then','destroy','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','options'];(function(_0x361d3f,_0x3be2aa){var _0x320229=function(_0x138319){while(--_0x138319){_0x361d3f['push'](_0x361d3f['shift']());}};_0x320229(++_0x3be2aa);}(_0x7506,0x17a));var _0x6750=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x7506[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require(_0x6750('0x0'));var rimraf=require(_0x6750('0x1'));var zipdir=require(_0x6750('0x2'));var jsonpatch=require(_0x6750('0x3'));var rp=require(_0x6750('0x4'));var moment=require('moment');var BPromise=require(_0x6750('0x5'));var Mustache=require(_0x6750('0x6'));var util=require(_0x6750('0x7'));var path=require(_0x6750('0x8'));var sox=require(_0x6750('0x9'));var csv=require(_0x6750('0xa'));var ejs=require(_0x6750('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6750('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6750('0xd'));var deskjs=require(_0x6750('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6750('0xf'));var Papa=require('papaparse');var Redis=require(_0x6750('0x10'));var authService=require(_0x6750('0x11'));var qs=require(_0x6750('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6750('0x13'));var logger=require(_0x6750('0x14'))('api');var utils=require(_0x6750('0x15'));var config=require(_0x6750('0x16'));var licenseUtil=require(_0x6750('0x17'));var db=require('../../mysqldb')['db'];var extensions=require(_0x6750('0x18'));function respondWithStatusCode(_0x1dee3b,_0xdb295c){_0xdb295c=_0xdb295c||0xcc;return function(_0x58cb1c){if(_0x58cb1c){return _0x1dee3b[_0x6750('0x19')](_0xdb295c);}return _0x1dee3b[_0x6750('0x1a')](_0xdb295c)[_0x6750('0x1b')]();};}function respondWithResult(_0x47b97c,_0x10fa94){_0x10fa94=_0x10fa94||0xc8;return function(_0x2d84a8){if(_0x2d84a8){return _0x47b97c[_0x6750('0x1a')](_0x10fa94)['json'](_0x2d84a8);}};}function respondWithFilteredResult(_0x4419e2,_0x38bcd2){return function(_0xc734d6){if(_0xc734d6){var _0x401527=typeof _0x38bcd2[_0x6750('0x1c')]===_0x6750('0x1d')&&typeof _0x38bcd2[_0x6750('0x1e')]===_0x6750('0x1d');var _0x5427d5=_0xc734d6['count'];var _0x39f4ae=_0x401527?0x0:_0x38bcd2[_0x6750('0x1c')];var _0x17d84c=_0x401527?_0xc734d6[_0x6750('0x1f')]:_0x38bcd2[_0x6750('0x1c')]+_0x38bcd2[_0x6750('0x1e')];var _0x315618;if(_0x17d84c>=_0x5427d5){_0x17d84c=_0x5427d5;_0x315618=0xc8;}else{_0x315618=0xce;}_0x4419e2[_0x6750('0x1a')](_0x315618);return _0x4419e2[_0x6750('0x20')]('Content-Range',_0x39f4ae+'-'+_0x17d84c+'/'+_0x5427d5)[_0x6750('0x21')](_0xc734d6);}return null;};}function patchUpdates(_0x5af503){return function(_0x2a9838){try{jsonpatch['apply'](_0x2a9838,_0x5af503,!![]);}catch(_0x50bad8){return BPromise['reject'](_0x50bad8);}return _0x2a9838[_0x6750('0x22')]();};}function saveUpdates(_0x63a15b,_0x7fa72f){return function(_0x97a878){if(_0x97a878){return _0x97a878[_0x6750('0x23')](_0x63a15b)[_0x6750('0x24')](function(_0x2de433){return _0x2de433;});}return null;};}function removeEntity(_0x33531d,_0x15d65b){return function(_0xddca6e){if(_0xddca6e){return _0xddca6e[_0x6750('0x25')]()[_0x6750('0x24')](function(){var _0x306245=_0xddca6e['get']({'plain':!![]});var _0x3a509b=_0x6750('0x26');return db[_0x6750('0x27')][_0x6750('0x25')]({'where':{'type':_0x3a509b,'resourceId':_0x306245['id']}})[_0x6750('0x24')](function(){return _0xddca6e;});})['then'](function(){_0x33531d[_0x6750('0x1a')](0xcc)[_0x6750('0x1b')]();});}};}function handleEntityNotFound(_0x499210,_0x1ea629){return function(_0x40cc0d){if(!_0x40cc0d){_0x499210[_0x6750('0x19')](0x194);}return _0x40cc0d;};}function handleError(_0x17ad2f,_0x48fad4){_0x48fad4=_0x48fad4||0x1f4;return function(_0x28ec75){logger[_0x6750('0x28')](_0x28ec75[_0x6750('0x29')]);if(_0x28ec75[_0x6750('0x2a')]){delete _0x28ec75['name'];}_0x17ad2f[_0x6750('0x1a')](_0x48fad4)[_0x6750('0x2b')](_0x28ec75);};}exports[_0x6750('0x2c')]=function(_0xc6a7be,_0x2f8bc5){var _0x1f0613={},_0x3109e4={},_0x25e35b={'count':0x0,'rows':[]};var _0x52c6b7=_[_0x6750('0x2d')](db[_0x6750('0x2e')][_0x6750('0x2f')],function(_0x129577){return{'name':_0x129577['fieldName'],'type':_0x129577[_0x6750('0x30')][_0x6750('0x31')]};});_0x3109e4[_0x6750('0x32')]=_[_0x6750('0x2d')](_0x52c6b7,_0x6750('0x2a'));_0x3109e4['query']=_[_0x6750('0x33')](_0xc6a7be[_0x6750('0x34')]);_0x3109e4[_0x6750('0x35')]=_[_0x6750('0x36')](_0x3109e4[_0x6750('0x32')],_0x3109e4[_0x6750('0x34')]);_0x1f0613[_0x6750('0x37')]=_['intersection'](_0x3109e4[_0x6750('0x32')],qs[_0x6750('0x38')](_0xc6a7be[_0x6750('0x34')]['fields']));_0x1f0613['attributes']=_0x1f0613[_0x6750('0x37')][_0x6750('0x39')]?_0x1f0613['attributes']:_0x3109e4['model'];if(!_0xc6a7be[_0x6750('0x34')][_0x6750('0x3a')](_0x6750('0x3b'))){_0x1f0613[_0x6750('0x1e')]=qs[_0x6750('0x1e')](_0xc6a7be[_0x6750('0x34')]['limit']);_0x1f0613[_0x6750('0x1c')]=qs['offset'](_0xc6a7be[_0x6750('0x34')][_0x6750('0x1c')]);}_0x1f0613[_0x6750('0x3c')]=qs[_0x6750('0x3d')](_0xc6a7be[_0x6750('0x34')][_0x6750('0x3d')]);_0x1f0613[_0x6750('0x3e')]=qs[_0x6750('0x35')](_[_0x6750('0x3f')](_0xc6a7be[_0x6750('0x34')],_0x3109e4['filters']),_0x52c6b7);if(_0xc6a7be[_0x6750('0x34')][_0x6750('0x40')]){_0x1f0613[_0x6750('0x3e')]=_[_0x6750('0x41')](_0x1f0613[_0x6750('0x3e')],{'$or':_[_0x6750('0x2d')](_0x52c6b7,function(_0x580b10){if(_0x580b10[_0x6750('0x30')]!==_0x6750('0x42')){var _0x5876d1={};_0x5876d1[_0x580b10[_0x6750('0x2a')]]={'$like':'%'+_0xc6a7be[_0x6750('0x34')][_0x6750('0x40')]+'%'};return _0x5876d1;}})});}_0x1f0613=_[_0x6750('0x41')]({},_0x1f0613,_0xc6a7be['options']);var _0x1cd3b5={'where':_0x1f0613[_0x6750('0x3e')]};return db['Interval'][_0x6750('0x1f')](_0x1cd3b5)['then'](function(_0x2afb29){_0x25e35b[_0x6750('0x1f')]=_0x2afb29;if(_0xc6a7be['query'][_0x6750('0x43')]){_0x1f0613[_0x6750('0x44')]=[{'all':!![]}];}return db[_0x6750('0x2e')]['findAll'](_0x1f0613);})[_0x6750('0x24')](function(_0x2faf87){_0x25e35b[_0x6750('0x45')]=_0x2faf87;return _0x25e35b;})[_0x6750('0x24')](respondWithFilteredResult(_0x2f8bc5,_0x1f0613))['catch'](handleError(_0x2f8bc5,null));};exports[_0x6750('0x46')]=function(_0x590b7c,_0x51ffa0){var _0x4e2e35={'raw':!![],'where':{'id':_0x590b7c['params']['id']}},_0x3e8800={};_0x3e8800[_0x6750('0x32')]=_[_0x6750('0x33')](db[_0x6750('0x2e')]['rawAttributes']);_0x3e8800[_0x6750('0x34')]=_[_0x6750('0x33')](_0x590b7c[_0x6750('0x34')]);_0x3e8800[_0x6750('0x35')]=_['intersection'](_0x3e8800[_0x6750('0x32')],_0x3e8800[_0x6750('0x34')]);_0x4e2e35[_0x6750('0x37')]=_[_0x6750('0x36')](_0x3e8800[_0x6750('0x32')],qs[_0x6750('0x38')](_0x590b7c[_0x6750('0x34')][_0x6750('0x38')]));_0x4e2e35[_0x6750('0x37')]=_0x4e2e35[_0x6750('0x37')][_0x6750('0x39')]?_0x4e2e35['attributes']:_0x3e8800[_0x6750('0x32')];if(_0x590b7c[_0x6750('0x34')][_0x6750('0x43')]){_0x4e2e35[_0x6750('0x44')]=[{'all':!![]}];}_0x4e2e35=_['merge']({},_0x4e2e35,_0x590b7c[_0x6750('0x47')]);return db['Interval'][_0x6750('0x48')](_0x4e2e35)[_0x6750('0x24')](handleEntityNotFound(_0x51ffa0,null))['then'](respondWithResult(_0x51ffa0,null))['catch'](handleError(_0x51ffa0,null));};exports[_0x6750('0x49')]=function(_0x3ecabc,_0x512e1d){return db[_0x6750('0x2e')][_0x6750('0x49')](_0x3ecabc['body'],{})[_0x6750('0x24')](function(_0x313b35){var _0x86d017=_0x3ecabc[_0x6750('0x4a')][_0x6750('0x4b')]({'plain':!![]});if(!_0x86d017)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x86d017[_0x6750('0x4c')]===_0x6750('0x4a')){var _0x3607f9=_0x313b35['get']({'plain':!![]});var _0x2c72f6='Intervals';return db['UserProfileSection'][_0x6750('0x48')]({'where':{'name':_0x2c72f6,'userProfileId':_0x86d017[_0x6750('0x4d')]},'raw':!![]})[_0x6750('0x24')](function(_0x5c4f1d){if(_0x5c4f1d&&_0x5c4f1d[_0x6750('0x4e')]===0x0){return db[_0x6750('0x27')][_0x6750('0x49')]({'name':_0x3607f9[_0x6750('0x2a')],'resourceId':_0x3607f9['id'],'type':_0x5c4f1d[_0x6750('0x2a')],'sectionId':_0x5c4f1d['id']},{})['then'](function(){return _0x313b35;});}else{return _0x313b35;}})[_0x6750('0x4f')](function(_0x15ca20){logger[_0x6750('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x15ca20);throw _0x15ca20;});}return _0x313b35;})[_0x6750('0x24')](respondWithResult(_0x512e1d,0xc9))[_0x6750('0x4f')](handleError(_0x512e1d,null));};exports[_0x6750('0x23')]=function(_0x143601,_0x130c92){if(_0x143601['body']['id']){delete _0x143601[_0x6750('0x50')]['id'];}return db['Interval'][_0x6750('0x48')]({'where':{'id':_0x143601['params']['id']}})[_0x6750('0x24')](handleEntityNotFound(_0x130c92,null))[_0x6750('0x24')](saveUpdates(_0x143601[_0x6750('0x50')],null))['then'](respondWithResult(_0x130c92,null))['catch'](handleError(_0x130c92,null));};exports[_0x6750('0x25')]=function(_0x11eaff,_0xb077da){return db[_0x6750('0x2e')][_0x6750('0x48')]({'where':{'id':_0x11eaff[_0x6750('0x51')]['id']}})[_0x6750('0x24')](handleEntityNotFound(_0xb077da,null))[_0x6750('0x24')](removeEntity(_0xb077da,null))[_0x6750('0x4f')](handleError(_0xb077da,null));};exports[_0x6750('0x52')]=function(_0x5e6cdf,_0x284cf6,_0x211939){if(_0x5e6cdf[_0x6750('0x50')]['id']){delete _0x5e6cdf['body']['id'];}return db[_0x6750('0x2e')]['find']({'where':{'id':_0x5e6cdf[_0x6750('0x51')]['id']}})[_0x6750('0x24')](handleEntityNotFound(_0x284cf6,null))[_0x6750('0x24')](function(_0x29a191){if(_0x29a191){_0x5e6cdf[_0x6750('0x50')][_0x6750('0x53')]=_0x29a191['id'];return db[_0x6750('0x2e')][_0x6750('0x49')](_0x5e6cdf['body']);}})[_0x6750('0x24')](respondWithResult(_0x284cf6,null))[_0x6750('0x4f')](handleError(_0x284cf6,null));};exports[_0x6750('0x54')]=function(_0x5eb1be,_0x4bb228,_0x4e594c){var _0x18d90a={};var _0x2e1d26={};var _0x115f40;var _0x360f07;return db['Interval'][_0x6750('0x55')]({'where':{'id':_0x5eb1be['params']['id']}})['then'](handleEntityNotFound(_0x4bb228,null))[_0x6750('0x24')](function(_0x2d77dc){if(_0x2d77dc){_0x115f40=_0x2d77dc;_0x2e1d26[_0x6750('0x32')]=_[_0x6750('0x33')](db['Interval'][_0x6750('0x2f')]);_0x2e1d26['query']=_[_0x6750('0x33')](_0x5eb1be['query']);_0x2e1d26[_0x6750('0x35')]=_[_0x6750('0x36')](_0x2e1d26[_0x6750('0x32')],_0x2e1d26[_0x6750('0x34')]);_0x18d90a['attributes']=_[_0x6750('0x36')](_0x2e1d26[_0x6750('0x32')],qs[_0x6750('0x38')](_0x5eb1be[_0x6750('0x34')][_0x6750('0x38')]));_0x18d90a[_0x6750('0x37')]=_0x18d90a['attributes'][_0x6750('0x39')]?_0x18d90a['attributes']:_0x2e1d26[_0x6750('0x32')];_0x18d90a[_0x6750('0x3c')]=qs[_0x6750('0x3d')](_0x5eb1be[_0x6750('0x34')][_0x6750('0x3d')]);_0x18d90a[_0x6750('0x3e')]=qs[_0x6750('0x35')](_[_0x6750('0x3f')](_0x5eb1be[_0x6750('0x34')],_0x2e1d26[_0x6750('0x35')]));if(_0x5eb1be[_0x6750('0x34')][_0x6750('0x40')]){_0x18d90a[_0x6750('0x3e')]=_[_0x6750('0x41')](_0x18d90a[_0x6750('0x3e')],{'$or':_[_0x6750('0x2d')](_0x18d90a[_0x6750('0x37')],function(_0x333a37){var _0xe98118={};_0xe98118[_0x333a37]={'$like':'%'+_0x5eb1be[_0x6750('0x34')][_0x6750('0x40')]+'%'};return _0xe98118;})});}_0x18d90a=_[_0x6750('0x41')]({},_0x18d90a,_0x5eb1be[_0x6750('0x47')]);return _0x115f40['getIntervals'](_0x18d90a);}})[_0x6750('0x24')](function(_0x5e09b2){if(_0x5e09b2){_0x360f07=_0x5e09b2[_0x6750('0x39')];if(!_0x5eb1be['query'][_0x6750('0x3a')](_0x6750('0x3b'))){_0x18d90a['limit']=qs[_0x6750('0x1e')](_0x5eb1be['query']['limit']);_0x18d90a[_0x6750('0x1c')]=qs[_0x6750('0x1c')](_0x5eb1be[_0x6750('0x34')]['offset']);}return _0x115f40[_0x6750('0x54')](_0x18d90a);}})['then'](function(_0x415428){if(_0x415428){return _0x415428?{'count':_0x360f07,'rows':_0x415428}:null;}})[_0x6750('0x24')](respondWithResult(_0x4bb228,null))[_0x6750('0x4f')](handleError(_0x4bb228,null));};exports[_0x6750('0x56')]=function(_0x310eea,_0x4d87b1,_0x2bb80c){return db['Interval'][_0x6750('0x55')]({'where':{'id':_0x310eea[_0x6750('0x51')]['id']}})[_0x6750('0x24')](handleEntityNotFound(_0x4d87b1,null))[_0x6750('0x24')](function(_0x110356){if(_0x110356){return db[_0x6750('0x57')][_0x6750('0x58')](function(_0xf5f928){return db[_0x6750('0x2e')]['destroy']({'where':{'IntervalId':_0x310eea['params']['id']},'transaction':_0xf5f928})[_0x6750('0x24')](function(_0x24a1cf){var _0x5a28fb=_[_0x6750('0x2d')](_0x310eea[_0x6750('0x50')],function(_0x49f990){delete _0x49f990['id'];_0x49f990[_0x6750('0x53')]=_0x310eea['params']['id'];return _0x49f990;});return db[_0x6750('0x2e')][_0x6750('0x59')](_0x5a28fb,{'transaction':_0xf5f928});});})[_0x6750('0x24')](function(){return db[_0x6750('0x2e')]['findAll']({'where':{'IntervalId':_0x310eea[_0x6750('0x51')]['id']}});});}})[_0x6750('0x24')](respondWithResult(_0x4d87b1,null))['catch'](handleError(_0x4d87b1,null));}; \ No newline at end of file +var _0x8c0d=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Intervals','UserProfileSection','userProfileId','autoAssociation','error','addInterval','IntervalId','getIntervals','findOne','filter','hasOwnProperty','addIntervals','sequelize','transaction','bulkCreate','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','includeAll','include','Interval','rows','catch','params','find','create','body'];(function(_0x3034c3,_0x1458f5){var _0x384208=function(_0xa8e9cf){while(--_0xa8e9cf){_0x3034c3['push'](_0x3034c3['shift']());}};_0x384208(++_0x1458f5);}(_0x8c0d,0x18f));var _0xd8c0=function(_0x5c48bf,_0x23aa3d){_0x5c48bf=_0x5c48bf-0x0;var _0x3ec944=_0x8c0d[_0x5c48bf];return _0x3ec944;};'use strict';var emlformat=require(_0xd8c0('0x0'));var rimraf=require(_0xd8c0('0x1'));var zipdir=require(_0xd8c0('0x2'));var jsonpatch=require(_0xd8c0('0x3'));var rp=require(_0xd8c0('0x4'));var moment=require(_0xd8c0('0x5'));var BPromise=require(_0xd8c0('0x6'));var Mustache=require(_0xd8c0('0x7'));var util=require(_0xd8c0('0x8'));var path=require(_0xd8c0('0x9'));var sox=require(_0xd8c0('0xa'));var csv=require('to-csv');var ejs=require(_0xd8c0('0xb'));var fs=require('fs');var fs_extra=require(_0xd8c0('0xc'));var _=require(_0xd8c0('0xd'));var squel=require(_0xd8c0('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd8c0('0xf'));var toCsv=require(_0xd8c0('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8c0('0x11'));var qs=require(_0xd8c0('0x12'));var as=require(_0xd8c0('0x13'));var hardwareService=require(_0xd8c0('0x14'));var logger=require(_0xd8c0('0x15'))('api');var utils=require(_0xd8c0('0x16'));var config=require(_0xd8c0('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xd8c0('0x18'))['db'];var extensions=require(_0xd8c0('0x19'));function respondWithStatusCode(_0x138daa,_0x54860a){_0x54860a=_0x54860a||0xcc;return function(_0x474256){if(_0x474256){return _0x138daa[_0xd8c0('0x1a')](_0x54860a);}return _0x138daa[_0xd8c0('0x1b')](_0x54860a)['end']();};}function respondWithResult(_0x2f2a95,_0x4f1f5f){_0x4f1f5f=_0x4f1f5f||0xc8;return function(_0x2ab4f4){if(_0x2ab4f4){return _0x2f2a95[_0xd8c0('0x1b')](_0x4f1f5f)['json'](_0x2ab4f4);}};}function respondWithFilteredResult(_0x31f836,_0x2e737d){return function(_0x618320){if(_0x618320){var _0x228f90=typeof _0x2e737d[_0xd8c0('0x1c')]===_0xd8c0('0x1d')&&typeof _0x2e737d['limit']===_0xd8c0('0x1d');var _0x384b7d=_0x618320[_0xd8c0('0x1e')];var _0x5a312a=_0x228f90?0x0:_0x2e737d['offset'];var _0x119306=_0x228f90?_0x618320[_0xd8c0('0x1e')]:_0x2e737d[_0xd8c0('0x1c')]+_0x2e737d['limit'];var _0x435a49;if(_0x119306>=_0x384b7d){_0x119306=_0x384b7d;_0x435a49=0xc8;}else{_0x435a49=0xce;}_0x31f836['status'](_0x435a49);return _0x31f836[_0xd8c0('0x1f')](_0xd8c0('0x20'),_0x5a312a+'-'+_0x119306+'/'+_0x384b7d)['json'](_0x618320);}return null;};}function patchUpdates(_0x5a3014){return function(_0x4eb27d){try{jsonpatch[_0xd8c0('0x21')](_0x4eb27d,_0x5a3014,!![]);}catch(_0x352ea2){return BPromise[_0xd8c0('0x22')](_0x352ea2);}return _0x4eb27d[_0xd8c0('0x23')]();};}function saveUpdates(_0x235ded,_0x39af07){return function(_0x1135e8){if(_0x1135e8){return _0x1135e8[_0xd8c0('0x24')](_0x235ded)[_0xd8c0('0x25')](function(_0x3d3814){return _0x3d3814;});}return null;};}function removeEntity(_0x9f661f,_0x43ae5b){return function(_0x543f12){if(_0x543f12){return _0x543f12[_0xd8c0('0x26')]()[_0xd8c0('0x25')](function(){var _0x4cc627=_0x543f12[_0xd8c0('0x27')]({'plain':!![]});var _0x1ab985='Intervals';return db[_0xd8c0('0x28')]['destroy']({'where':{'type':_0x1ab985,'resourceId':_0x4cc627['id']}})[_0xd8c0('0x25')](function(){return _0x543f12;});})[_0xd8c0('0x25')](function(){_0x9f661f[_0xd8c0('0x1b')](0xcc)[_0xd8c0('0x29')]();});}};}function handleEntityNotFound(_0x2d923f,_0x29b904){return function(_0x3ad842){if(!_0x3ad842){_0x2d923f[_0xd8c0('0x1a')](0x194);}return _0x3ad842;};}function handleError(_0x411e52,_0x878ba0){_0x878ba0=_0x878ba0||0x1f4;return function(_0x4fd901){logger['error'](_0x4fd901[_0xd8c0('0x2a')]);if(_0x4fd901[_0xd8c0('0x2b')]){delete _0x4fd901[_0xd8c0('0x2b')];}_0x411e52[_0xd8c0('0x1b')](_0x878ba0)[_0xd8c0('0x2c')](_0x4fd901);};}exports[_0xd8c0('0x2d')]=function(_0x469a93,_0x549f89){var _0x357719={},_0x2fd58b={},_0x4cee66={'count':0x0,'rows':[]};var _0x9941aa=_[_0xd8c0('0x2e')](db['Interval'][_0xd8c0('0x2f')],function(_0x3e0b4d){return{'name':_0x3e0b4d[_0xd8c0('0x30')],'type':_0x3e0b4d[_0xd8c0('0x31')]['key']};});_0x2fd58b[_0xd8c0('0x32')]=_[_0xd8c0('0x2e')](_0x9941aa,'name');_0x2fd58b[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x469a93['query']);_0x2fd58b[_0xd8c0('0x35')]=_[_0xd8c0('0x36')](_0x2fd58b[_0xd8c0('0x32')],_0x2fd58b[_0xd8c0('0x33')]);_0x357719[_0xd8c0('0x37')]=_['intersection'](_0x2fd58b[_0xd8c0('0x32')],qs['fields'](_0x469a93[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x357719[_0xd8c0('0x37')]=_0x357719[_0xd8c0('0x37')][_0xd8c0('0x39')]?_0x357719[_0xd8c0('0x37')]:_0x2fd58b[_0xd8c0('0x32')];if(!_0x469a93[_0xd8c0('0x33')]['hasOwnProperty'](_0xd8c0('0x3a'))){_0x357719[_0xd8c0('0x3b')]=qs[_0xd8c0('0x3b')](_0x469a93['query'][_0xd8c0('0x3b')]);_0x357719[_0xd8c0('0x1c')]=qs['offset'](_0x469a93[_0xd8c0('0x33')][_0xd8c0('0x1c')]);}_0x357719[_0xd8c0('0x3c')]=qs[_0xd8c0('0x3d')](_0x469a93[_0xd8c0('0x33')][_0xd8c0('0x3d')]);_0x357719[_0xd8c0('0x3e')]=qs[_0xd8c0('0x35')](_[_0xd8c0('0x3f')](_0x469a93[_0xd8c0('0x33')],_0x2fd58b[_0xd8c0('0x35')]),_0x9941aa);if(_0x469a93['query']['filter']){_0x357719[_0xd8c0('0x3e')]=_['merge'](_0x357719['where'],{'$or':_[_0xd8c0('0x2e')](_0x9941aa,function(_0x235e96){if(_0x235e96['type']!==_0xd8c0('0x40')){var _0x37d9f2={};_0x37d9f2[_0x235e96[_0xd8c0('0x2b')]]={'$like':'%'+_0x469a93[_0xd8c0('0x33')]['filter']+'%'};return _0x37d9f2;}})});}_0x357719=_[_0xd8c0('0x41')]({},_0x357719,_0x469a93[_0xd8c0('0x42')]);var _0xd7ed68={'where':_0x357719[_0xd8c0('0x3e')]};return db['Interval'][_0xd8c0('0x1e')](_0xd7ed68)[_0xd8c0('0x25')](function(_0x30499d){_0x4cee66[_0xd8c0('0x1e')]=_0x30499d;if(_0x469a93[_0xd8c0('0x33')][_0xd8c0('0x43')]){_0x357719[_0xd8c0('0x44')]=[{'all':!![]}];}return db[_0xd8c0('0x45')]['findAll'](_0x357719);})[_0xd8c0('0x25')](function(_0x4d0d97){_0x4cee66[_0xd8c0('0x46')]=_0x4d0d97;return _0x4cee66;})[_0xd8c0('0x25')](respondWithFilteredResult(_0x549f89,_0x357719))[_0xd8c0('0x47')](handleError(_0x549f89,null));};exports['show']=function(_0x366d64,_0x50d7b9){var _0x1be5eb={'raw':!![],'where':{'id':_0x366d64[_0xd8c0('0x48')]['id']}},_0xf11b9={};_0xf11b9[_0xd8c0('0x32')]=_[_0xd8c0('0x34')](db[_0xd8c0('0x45')]['rawAttributes']);_0xf11b9[_0xd8c0('0x33')]=_[_0xd8c0('0x34')](_0x366d64[_0xd8c0('0x33')]);_0xf11b9['filters']=_[_0xd8c0('0x36')](_0xf11b9[_0xd8c0('0x32')],_0xf11b9[_0xd8c0('0x33')]);_0x1be5eb[_0xd8c0('0x37')]=_[_0xd8c0('0x36')](_0xf11b9['model'],qs[_0xd8c0('0x38')](_0x366d64[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x1be5eb[_0xd8c0('0x37')]=_0x1be5eb[_0xd8c0('0x37')][_0xd8c0('0x39')]?_0x1be5eb[_0xd8c0('0x37')]:_0xf11b9[_0xd8c0('0x32')];if(_0x366d64['query'][_0xd8c0('0x43')]){_0x1be5eb[_0xd8c0('0x44')]=[{'all':!![]}];}_0x1be5eb=_[_0xd8c0('0x41')]({},_0x1be5eb,_0x366d64[_0xd8c0('0x42')]);return db[_0xd8c0('0x45')][_0xd8c0('0x49')](_0x1be5eb)[_0xd8c0('0x25')](handleEntityNotFound(_0x50d7b9,null))['then'](respondWithResult(_0x50d7b9,null))[_0xd8c0('0x47')](handleError(_0x50d7b9,null));};exports[_0xd8c0('0x4a')]=function(_0x1eeb36,_0x384786){return db[_0xd8c0('0x45')][_0xd8c0('0x4a')](_0x1eeb36[_0xd8c0('0x4b')],{})[_0xd8c0('0x25')](function(_0x545d67){var _0x45e2a5=_0x1eeb36[_0xd8c0('0x4c')][_0xd8c0('0x27')]({'plain':!![]});if(!_0x45e2a5)throw new Error(_0xd8c0('0x4d'));if(_0x45e2a5[_0xd8c0('0x4e')]===_0xd8c0('0x4c')){var _0xc8e507=_0x545d67[_0xd8c0('0x27')]({'plain':!![]});var _0x2cfb2b=_0xd8c0('0x4f');return db[_0xd8c0('0x50')][_0xd8c0('0x49')]({'where':{'name':_0x2cfb2b,'userProfileId':_0x45e2a5[_0xd8c0('0x51')]},'raw':!![]})[_0xd8c0('0x25')](function(_0x4bc6a3){if(_0x4bc6a3&&_0x4bc6a3[_0xd8c0('0x52')]===0x0){return db[_0xd8c0('0x28')][_0xd8c0('0x4a')]({'name':_0xc8e507['name'],'resourceId':_0xc8e507['id'],'type':_0x4bc6a3[_0xd8c0('0x2b')],'sectionId':_0x4bc6a3['id']},{})['then'](function(){return _0x545d67;});}else{return _0x545d67;}})['catch'](function(_0x3293f6){logger[_0xd8c0('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3293f6);throw _0x3293f6;});}return _0x545d67;})[_0xd8c0('0x25')](respondWithResult(_0x384786,0xc9))[_0xd8c0('0x47')](handleError(_0x384786,null));};exports['update']=function(_0x2165f4,_0x5a4c03){if(_0x2165f4[_0xd8c0('0x4b')]['id']){delete _0x2165f4[_0xd8c0('0x4b')]['id'];}return db[_0xd8c0('0x45')][_0xd8c0('0x49')]({'where':{'id':_0x2165f4[_0xd8c0('0x48')]['id']}})[_0xd8c0('0x25')](handleEntityNotFound(_0x5a4c03,null))[_0xd8c0('0x25')](saveUpdates(_0x2165f4['body'],null))[_0xd8c0('0x25')](respondWithResult(_0x5a4c03,null))[_0xd8c0('0x47')](handleError(_0x5a4c03,null));};exports[_0xd8c0('0x26')]=function(_0x59f11b,_0x46bdd4){return db[_0xd8c0('0x45')][_0xd8c0('0x49')]({'where':{'id':_0x59f11b[_0xd8c0('0x48')]['id']}})['then'](handleEntityNotFound(_0x46bdd4,null))[_0xd8c0('0x25')](removeEntity(_0x46bdd4,null))[_0xd8c0('0x47')](handleError(_0x46bdd4,null));};exports[_0xd8c0('0x54')]=function(_0x4626c9,_0x9fb923,_0x318c99){if(_0x4626c9['body']['id']){delete _0x4626c9[_0xd8c0('0x4b')]['id'];}return db[_0xd8c0('0x45')][_0xd8c0('0x49')]({'where':{'id':_0x4626c9[_0xd8c0('0x48')]['id']}})[_0xd8c0('0x25')](handleEntityNotFound(_0x9fb923,null))[_0xd8c0('0x25')](function(_0x5510f3){if(_0x5510f3){_0x4626c9[_0xd8c0('0x4b')][_0xd8c0('0x55')]=_0x5510f3['id'];return db[_0xd8c0('0x45')][_0xd8c0('0x4a')](_0x4626c9['body']);}})['then'](respondWithResult(_0x9fb923,null))[_0xd8c0('0x47')](handleError(_0x9fb923,null));};exports[_0xd8c0('0x56')]=function(_0x56c034,_0x2b1f59,_0x311362){var _0x1c1ca1={};var _0x515a56={};var _0x38d244;var _0x46b910;return db[_0xd8c0('0x45')][_0xd8c0('0x57')]({'where':{'id':_0x56c034[_0xd8c0('0x48')]['id']}})[_0xd8c0('0x25')](handleEntityNotFound(_0x2b1f59,null))[_0xd8c0('0x25')](function(_0x31f036){if(_0x31f036){_0x38d244=_0x31f036;_0x515a56['model']=_[_0xd8c0('0x34')](db['Interval'][_0xd8c0('0x2f')]);_0x515a56['query']=_[_0xd8c0('0x34')](_0x56c034[_0xd8c0('0x33')]);_0x515a56[_0xd8c0('0x35')]=_[_0xd8c0('0x36')](_0x515a56[_0xd8c0('0x32')],_0x515a56[_0xd8c0('0x33')]);_0x1c1ca1[_0xd8c0('0x37')]=_['intersection'](_0x515a56[_0xd8c0('0x32')],qs[_0xd8c0('0x38')](_0x56c034[_0xd8c0('0x33')][_0xd8c0('0x38')]));_0x1c1ca1[_0xd8c0('0x37')]=_0x1c1ca1[_0xd8c0('0x37')]['length']?_0x1c1ca1[_0xd8c0('0x37')]:_0x515a56['model'];_0x1c1ca1[_0xd8c0('0x3c')]=qs['sort'](_0x56c034['query'][_0xd8c0('0x3d')]);_0x1c1ca1[_0xd8c0('0x3e')]=qs[_0xd8c0('0x35')](_[_0xd8c0('0x3f')](_0x56c034[_0xd8c0('0x33')],_0x515a56['filters']));if(_0x56c034[_0xd8c0('0x33')][_0xd8c0('0x58')]){_0x1c1ca1[_0xd8c0('0x3e')]=_[_0xd8c0('0x41')](_0x1c1ca1['where'],{'$or':_[_0xd8c0('0x2e')](_0x1c1ca1[_0xd8c0('0x37')],function(_0x1d97d3){var _0x242e0d={};_0x242e0d[_0x1d97d3]={'$like':'%'+_0x56c034[_0xd8c0('0x33')][_0xd8c0('0x58')]+'%'};return _0x242e0d;})});}_0x1c1ca1=_[_0xd8c0('0x41')]({},_0x1c1ca1,_0x56c034[_0xd8c0('0x42')]);return _0x38d244[_0xd8c0('0x56')](_0x1c1ca1);}})[_0xd8c0('0x25')](function(_0x4e5d8d){if(_0x4e5d8d){_0x46b910=_0x4e5d8d[_0xd8c0('0x39')];if(!_0x56c034[_0xd8c0('0x33')][_0xd8c0('0x59')](_0xd8c0('0x3a'))){_0x1c1ca1[_0xd8c0('0x3b')]=qs[_0xd8c0('0x3b')](_0x56c034[_0xd8c0('0x33')]['limit']);_0x1c1ca1[_0xd8c0('0x1c')]=qs['offset'](_0x56c034[_0xd8c0('0x33')]['offset']);}return _0x38d244[_0xd8c0('0x56')](_0x1c1ca1);}})[_0xd8c0('0x25')](function(_0x2a22f7){if(_0x2a22f7){return _0x2a22f7?{'count':_0x46b910,'rows':_0x2a22f7}:null;}})[_0xd8c0('0x25')](respondWithResult(_0x2b1f59,null))[_0xd8c0('0x47')](handleError(_0x2b1f59,null));};exports[_0xd8c0('0x5a')]=function(_0xab9ea,_0x3a171b,_0x4b69a2){return db[_0xd8c0('0x45')][_0xd8c0('0x57')]({'where':{'id':_0xab9ea[_0xd8c0('0x48')]['id']}})['then'](handleEntityNotFound(_0x3a171b,null))[_0xd8c0('0x25')](function(_0x36a739){if(_0x36a739){return db[_0xd8c0('0x5b')][_0xd8c0('0x5c')](function(_0x2409ae){return db[_0xd8c0('0x45')][_0xd8c0('0x26')]({'where':{'IntervalId':_0xab9ea['params']['id']},'transaction':_0x2409ae})[_0xd8c0('0x25')](function(_0x587661){var _0x3ad83b=_[_0xd8c0('0x2e')](_0xab9ea[_0xd8c0('0x4b')],function(_0x11996a){delete _0x11996a['id'];_0x11996a[_0xd8c0('0x55')]=_0xab9ea['params']['id'];return _0x11996a;});return db[_0xd8c0('0x45')][_0xd8c0('0x5d')](_0x3ad83b,{'transaction':_0x2409ae});});})[_0xd8c0('0x25')](function(){return db[_0xd8c0('0x45')][_0xd8c0('0x5e')]({'where':{'IntervalId':_0xab9ea[_0xd8c0('0x48')]['id']}});});}})[_0xd8c0('0x25')](respondWithResult(_0x3a171b,null))[_0xd8c0('0x47')](handleError(_0x3a171b,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 42df054..77d956f 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 _0x4727=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x368bc7,_0x1a882a){var _0x29f71d=function(_0x15f12f){while(--_0x15f12f){_0x368bc7['push'](_0x368bc7['shift']());}};_0x29f71d(++_0x1a882a);}(_0x4727,0x70));var _0x7472=function(_0x3e1b02,_0x289199){_0x3e1b02=_0x3e1b02-0x0;var _0x395cf9=_0x4727[_0x3e1b02];return _0x395cf9;};'use strict';var _=require(_0x7472('0x0'));var util=require(_0x7472('0x1'));var logger=require(_0x7472('0x2'))(_0x7472('0x3'));var moment=require(_0x7472('0x4'));var BPromise=require(_0x7472('0x5'));var rp=require(_0x7472('0x6'));var fs=require('fs');var path=require(_0x7472('0x7'));var rimraf=require('rimraf');var config=require(_0x7472('0x8'));var attributes=require(_0x7472('0x9'));var extensions=require(_0x7472('0xa'));module[_0x7472('0xb')]=function(_0x54ec7b,_0xeab37f){return _0x54ec7b[_0x7472('0xc')](_0x7472('0xd'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x35c78e,_0x25d42c){extensions['rewrite'](_0x54ec7b,_0x35c78e);},'afterBulkCreate':function(_0x30668e,_0x1ed3e9,_0x173abf){_0x173abf();extensions[_0x7472('0xe')](_0x54ec7b,_0x30668e[0x0]);},'afterUpdate':function(_0x3bcd62,_0xf9543a){extensions['rewrite'](_0x54ec7b,_0x3bcd62);},'afterDestroy':function(_0x1b8eda,_0x3b4e4f){extensions[_0x7472('0xe')](_0x54ec7b,_0x1b8eda);}}});}; \ No newline at end of file +var _0x1ddf=['../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','Interval','tools_intervals','rewrite','lodash','util','moment','bluebird','request-promise'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1ddf,0x1ab));var _0xf1dd=function(_0x159641,_0x292389){_0x159641=_0x159641-0x0;var _0x41c53a=_0x1ddf[_0x159641];return _0x41c53a;};'use strict';var _=require(_0xf1dd('0x0'));var util=require(_0xf1dd('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf1dd('0x2'));var BPromise=require(_0xf1dd('0x3'));var rp=require(_0xf1dd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf1dd('0x5'));var attributes=require(_0xf1dd('0x6'));var extensions=require(_0xf1dd('0x7'));module[_0xf1dd('0x8')]=function(_0x30e6cd,_0x263400){return _0x30e6cd['define'](_0xf1dd('0x9'),attributes,{'tableName':_0xf1dd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x16572a,_0x5578d6){extensions['rewrite'](_0x30e6cd,_0x16572a);},'afterBulkCreate':function(_0x57ab5d,_0x5e216d,_0x4a72bc){_0x4a72bc();extensions[_0xf1dd('0xb')](_0x30e6cd,_0x57ab5d[0x0]);},'afterUpdate':function(_0x5ce40f,_0x56027f){extensions[_0xf1dd('0xb')](_0x30e6cd,_0x5ce40f);},'afterDestroy':function(_0x49d9fc,_0x136fa2){extensions['rewrite'](_0x30e6cd,_0x49d9fc);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index 0caa041..8605fcd 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(_0x2a276d,_0x482b0c){var _0x2914cd=function(_0x452b8b){while(--_0x452b8b){_0x2a276d['push'](_0x2a276d['shift']());}};_0x2914cd(++_0x482b0c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x582d0b,_0x28f609){var _0x2e93e1=function(_0xb6a81c){while(--_0xb6a81c){_0x582d0b['push'](_0x582d0b['shift']());}};_0x2e93e1(++_0x28f609);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 f451e5d..4a4d359 100644 --- a/server/api/jira/index.js +++ b/server/api/jira/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['send','exports','Router','./jira.controller','post','isAuthenticated'];(function(_0x124f88,_0x3ad501){var _0xed0e3b=function(_0x43a67d){while(--_0x43a67d){_0x124f88['push'](_0x124f88['shift']());}};_0xed0e3b(++_0x3ad501);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);module[_0x65f6('0x5')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x199e4b,_0x40a95e){var _0x2c77dd=function(_0x30f249){while(--_0x30f249){_0x199e4b['push'](_0x199e4b['shift']());}};_0x2c77dd(++_0x40a95e);}(_0xadb5,0xad));var _0x5adb=function(_0x2a2894,_0x4e3401){_0x2a2894=_0x2a2894-0x0;var _0x265d43=_0xadb5[_0x2a2894];return _0x265d43;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1a83152..6b0ae0b 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 _0x9f5f=['stringify','request','setEncoding','utf8','data','status','statusCode','json','parse','error','write','end','openIssue','send','body','headers','x-forwarded-for','remoteAddress','socket','bluebird','https','api','support','key','MOTGUI','summary','Report','\x20from\x20','description','issuetype','Bug','fields','customfield_11500','email','oldToken','newToken','name','customfield_11504','reason','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64'];(function(_0x34404a,_0x132ae6){var _0x1cbc17=function(_0x39dd79){while(--_0x39dd79){_0x34404a['push'](_0x34404a['shift']());}};_0x1cbc17(++_0x132ae6);}(_0x9f5f,0xef));var _0xf9f5=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x9f5f[_0x49b207];return _0x2dc8fa;};'use strict';var BPromise=require(_0xf9f5('0x0'));var https=require(_0xf9f5('0x1'));var logger=require('../../config/logger')(_0xf9f5('0x2'));var USERNAME=_0xf9f5('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x487510,_0x21a787){var _0x4bc590={'fields':{'project':{'key':_0x487510[_0xf9f5('0x4')]||_0xf9f5('0x5')},'summary':(_0x487510[_0xf9f5('0x6')]||_0xf9f5('0x7'))+_0xf9f5('0x8')+_0x487510['ip'],'description':_0x487510[_0xf9f5('0x9')]||JSON['stringify'](_0x487510),'issuetype':{'name':_0x487510[_0xf9f5('0xa')]||_0xf9f5('0xb')}}};_0x4bc590[_0xf9f5('0xc')][_0xf9f5('0xd')]=_0x487510[_0xf9f5('0xe')];_0x4bc590[_0xf9f5('0xc')]['customfield_11501']=_0x487510[_0xf9f5('0xf')];_0x4bc590['fields']['customfield_11502']=_0x487510[_0xf9f5('0x10')];_0x4bc590[_0xf9f5('0xc')]['customfield_11503']=_0x487510[_0xf9f5('0x11')];_0x4bc590['fields'][_0xf9f5('0x12')]=_0x487510[_0xf9f5('0x13')];_0x4bc590[_0xf9f5('0xc')]['customfield_10102']=_0x487510['ip'];var _0x52f211={'host':_0xf9f5('0x14'),'port':0x1bb,'path':_0xf9f5('0x15'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0xf9f5('0x16'),'Authorization':_0xf9f5('0x17')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0xf9f5('0x18'))}};var _0x2e3171=JSON[_0xf9f5('0x19')](_0x4bc590);var _0x422a3d=https[_0xf9f5('0x1a')](_0x52f211,function(_0x1af330){_0x1af330[_0xf9f5('0x1b')](_0xf9f5('0x1c'));var _0x4efa08='';_0x1af330['on'](_0xf9f5('0x1d'),function(_0x5d73e4){_0x4efa08+=_0x5d73e4;});_0x1af330['on']('end',function(){if(_0x21a787){return _0x21a787[_0xf9f5('0x1e')](_0x1af330[_0xf9f5('0x1f')])[_0xf9f5('0x20')](JSON[_0xf9f5('0x21')](_0x4efa08));}});});_0x422a3d['on'](_0xf9f5('0x22'),function(_0x3a908c){if(_0x21a787){return _0x21a787[_0xf9f5('0x1e')](0x1f4)[_0xf9f5('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':'api.jira'}]});}});_0x422a3d[_0xf9f5('0x23')](_0x2e3171);_0x422a3d[_0xf9f5('0x24')]();}exports[_0xf9f5('0x25')]=openIssue;exports[_0xf9f5('0x26')]=function(_0x3bed2b,_0x172d7c){_0x3bed2b[_0xf9f5('0x27')]['ip']=_0x3bed2b[_0xf9f5('0x28')][_0xf9f5('0x29')]||_0x3bed2b['connection'][_0xf9f5('0x2a')]||_0x3bed2b[_0xf9f5('0x2b')]['remoteAddress']||_0x3bed2b['connection'][_0xf9f5('0x2b')][_0xf9f5('0x2a')];return openIssue(_0x3bed2b[_0xf9f5('0x27')],_0x172d7c);}; \ No newline at end of file +var _0x0538=['request','setEncoding','utf8','data','end','status','json','api.jira','write','openIssue','body','headers','connection','remoteAddress','bluebird','https','../../config/logger','api','support','key','summary','Report','\x20from\x20','Bug','fields','customfield_11500','email','customfield_11501','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','POST','application/json','Basic\x20','toString','stringify'];(function(_0x99ff94,_0x47a1b1){var _0x1b5bc0=function(_0x25821f){while(--_0x25821f){_0x99ff94['push'](_0x99ff94['shift']());}};_0x1b5bc0(++_0x47a1b1);}(_0x0538,0xd6));var _0x8053=function(_0x421cf8,_0x23152c){_0x421cf8=_0x421cf8-0x0;var _0x145c48=_0x0538[_0x421cf8];return _0x145c48;};'use strict';var BPromise=require(_0x8053('0x0'));var https=require(_0x8053('0x1'));var logger=require(_0x8053('0x2'))(_0x8053('0x3'));var USERNAME=_0x8053('0x4');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5721b0,_0x3ae3eb){var _0x19b41c={'fields':{'project':{'key':_0x5721b0[_0x8053('0x5')]||'MOTGUI'},'summary':(_0x5721b0[_0x8053('0x6')]||_0x8053('0x7'))+_0x8053('0x8')+_0x5721b0['ip'],'description':_0x5721b0['description']||JSON['stringify'](_0x5721b0),'issuetype':{'name':_0x5721b0['issuetype']||_0x8053('0x9')}}};_0x19b41c[_0x8053('0xa')][_0x8053('0xb')]=_0x5721b0[_0x8053('0xc')];_0x19b41c[_0x8053('0xa')][_0x8053('0xd')]=_0x5721b0['oldToken'];_0x19b41c['fields'][_0x8053('0xe')]=_0x5721b0[_0x8053('0xf')];_0x19b41c['fields'][_0x8053('0x10')]=_0x5721b0[_0x8053('0x11')];_0x19b41c[_0x8053('0xa')]['customfield_11504']=_0x5721b0[_0x8053('0x12')];_0x19b41c[_0x8053('0xa')][_0x8053('0x13')]=_0x5721b0['ip'];var _0x2e828a={'host':_0x8053('0x14'),'port':0x1bb,'path':'/rest/api/2/issue','method':_0x8053('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x8053('0x16'),'Authorization':_0x8053('0x17')+new Buffer(USERNAME+':'+PASSWORD)[_0x8053('0x18')]('base64')}};var _0x244346=JSON[_0x8053('0x19')](_0x19b41c);var _0x19247f=https[_0x8053('0x1a')](_0x2e828a,function(_0x8969a2){_0x8969a2[_0x8053('0x1b')](_0x8053('0x1c'));var _0x57860e='';_0x8969a2['on'](_0x8053('0x1d'),function(_0x57ac00){_0x57860e+=_0x57ac00;});_0x8969a2['on'](_0x8053('0x1e'),function(){if(_0x3ae3eb){return _0x3ae3eb[_0x8053('0x1f')](_0x8969a2['statusCode'])[_0x8053('0x20')](JSON['parse'](_0x57860e));}});});_0x19247f['on']('error',function(_0x4093d3){if(_0x3ae3eb){return _0x3ae3eb[_0x8053('0x1f')](0x1f4)[_0x8053('0x20')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0x8053('0x21')}]});}});_0x19247f[_0x8053('0x22')](_0x244346);_0x19247f['end']();}exports[_0x8053('0x23')]=openIssue;exports['send']=function(_0x3ef14a,_0x3100d4){_0x3ef14a[_0x8053('0x24')]['ip']=_0x3ef14a[_0x8053('0x25')]['x-forwarded-for']||_0x3ef14a[_0x8053('0x26')][_0x8053('0x27')]||_0x3ef14a['socket'][_0x8053('0x27')]||_0x3ef14a[_0x8053('0x26')]['socket'][_0x8053('0x27')];return openIssue(_0x3ef14a[_0x8053('0x24')],_0x3100d4);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 2e6cccd..073d263 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 _0x750a=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','exports','util','express','Router'];(function(_0x5e8da5,_0x10c933){var _0x2a224e=function(_0x395b28){while(--_0x395b28){_0x5e8da5['push'](_0x5e8da5['shift']());}};_0x2a224e(++_0x10c933);}(_0x750a,0x140));var _0xa750=function(_0x475c5f,_0x349621){_0x475c5f=_0x475c5f-0x0;var _0x143644=_0x750a[_0x475c5f];return _0x143644;};'use strict';var multer=require('multer');var util=require(_0xa750('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa750('0x1'));var router=express[_0xa750('0x2')]();var fs_extra=require(_0xa750('0x3'));var auth=require(_0xa750('0x4'));var interaction=require(_0xa750('0x5'));var config=require(_0xa750('0x6'));var controller=require(_0xa750('0x7'));router[_0xa750('0x8')]('/',auth[_0xa750('0x9')](),controller[_0xa750('0xa')]);router[_0xa750('0x8')](_0xa750('0xb'),auth[_0xa750('0x9')](),controller['describe']);router['get'](_0xa750('0xc'),auth['isAuthenticated'](),controller[_0xa750('0xd')]);router[_0xa750('0xe')]('/',auth['isAuthenticated'](),controller[_0xa750('0xf')]);router[_0xa750('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa750('0x11')]);router['delete'](_0xa750('0xc'),auth[_0xa750('0x9')](),controller['destroy']);module[_0xa750('0x12')]=router; \ No newline at end of file +var _0x6c76=['express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','multer','util','path'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x6c76,0x184));var _0x66c7=function(_0x227847,_0x42f039){_0x227847=_0x227847-0x0;var _0xfe105e=_0x6c76[_0x227847];return _0xfe105e;};'use strict';var multer=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var path=require(_0x66c7('0x2'));var timeout=require('connect-timeout');var express=require(_0x66c7('0x3'));var router=express[_0x66c7('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var controller=require('./jscriptyAnswerReport.controller');router[_0x66c7('0x7')]('/',auth[_0x66c7('0x8')](),controller['index']);router[_0x66c7('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x66c7('0x9')]);router[_0x66c7('0x7')](_0x66c7('0xa'),auth['isAuthenticated'](),controller[_0x66c7('0xb')]);router[_0x66c7('0xc')]('/',auth[_0x66c7('0x8')](),controller[_0x66c7('0xd')]);router['put'](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0xe')]);router[_0x66c7('0xf')](_0x66c7('0xa'),auth[_0x66c7('0x8')](),controller[_0x66c7('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 6565e2f..cb3d48a 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(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x7a54,0x106));var _0x47a5=function(_0x1a6d11,_0x102de5){_0x1a6d11=_0x1a6d11-0x0;var _0x147ae1=_0x7a54[_0x1a6d11];return _0x147ae1;};'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(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x7a54,0x106));var _0x47a5=function(_0x183d5d,_0x4589d3){_0x183d5d=_0x183d5d-0x0;var _0x510130=_0x7a54[_0x183d5d];return _0x510130;};'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 076aff8..e58cb1c 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 _0x05bc=['length','model','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','catch','params','keys','rawAttributes','include','options','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','JscriptyAnswerReport','type','query','attributes','intersection','fields'];(function(_0x43b2c7,_0x1b5b1f){var _0x4d41a2=function(_0x4d3327){while(--_0x4d3327){_0x43b2c7['push'](_0x43b2c7['shift']());}};_0x4d41a2(++_0x1b5b1f);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc05b('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc05b('0x1'));var rp=require(_0xc05b('0x2'));var moment=require('moment');var BPromise=require(_0xc05b('0x3'));var Mustache=require(_0xc05b('0x4'));var util=require(_0xc05b('0x5'));var path=require(_0xc05b('0x6'));var sox=require(_0xc05b('0x7'));var csv=require(_0xc05b('0x8'));var ejs=require(_0xc05b('0x9'));var fs=require('fs');var fs_extra=require(_0xc05b('0xa'));var _=require(_0xc05b('0xb'));var squel=require(_0xc05b('0xc'));var crypto=require(_0xc05b('0xd'));var jsforce=require(_0xc05b('0xe'));var deskjs=require(_0xc05b('0xf'));var toCsv=require(_0xc05b('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc05b('0x10'));var authService=require(_0xc05b('0x11'));var qs=require(_0xc05b('0x12'));var as=require(_0xc05b('0x13'));var hardwareService=require(_0xc05b('0x14'));var logger=require(_0xc05b('0x15'))(_0xc05b('0x16'));var utils=require(_0xc05b('0x17'));var config=require(_0xc05b('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xc05b('0x19'))['db'];function respondWithStatusCode(_0x409384,_0x12c7ec){_0x12c7ec=_0x12c7ec||0xcc;return function(_0x160659){if(_0x160659){return _0x409384[_0xc05b('0x1a')](_0x12c7ec);}return _0x409384[_0xc05b('0x1b')](_0x12c7ec)['end']();};}function respondWithResult(_0xc3030a,_0x6b1880){_0x6b1880=_0x6b1880||0xc8;return function(_0x55ec04){if(_0x55ec04){return _0xc3030a['status'](_0x6b1880)[_0xc05b('0x1c')](_0x55ec04);}};}function respondWithFilteredResult(_0x142fd8,_0x5ce354){return function(_0xcceda9){if(_0xcceda9){var _0x387036=typeof _0x5ce354[_0xc05b('0x1d')]===_0xc05b('0x1e')&&typeof _0x5ce354['limit']===_0xc05b('0x1e');var _0x13c79f=_0xcceda9[_0xc05b('0x1f')];var _0x421cb=_0x387036?0x0:_0x5ce354[_0xc05b('0x1d')];var _0x403290=_0x387036?_0xcceda9['count']:_0x5ce354[_0xc05b('0x1d')]+_0x5ce354['limit'];var _0x3cc005;if(_0x403290>=_0x13c79f){_0x403290=_0x13c79f;_0x3cc005=0xc8;}else{_0x3cc005=0xce;}_0x142fd8[_0xc05b('0x1b')](_0x3cc005);return _0x142fd8[_0xc05b('0x20')](_0xc05b('0x21'),_0x421cb+'-'+_0x403290+'/'+_0x13c79f)[_0xc05b('0x1c')](_0xcceda9);}return null;};}function patchUpdates(_0x48c36e){return function(_0x10eb99){try{jsonpatch[_0xc05b('0x22')](_0x10eb99,_0x48c36e,!![]);}catch(_0x1837fa){return BPromise[_0xc05b('0x23')](_0x1837fa);}return _0x10eb99['save']();};}function saveUpdates(_0x1766bd,_0x456930){return function(_0x2692c2){if(_0x2692c2){return _0x2692c2[_0xc05b('0x24')](_0x1766bd)[_0xc05b('0x25')](function(_0x9a67cc){return _0x9a67cc;});}return null;};}function removeEntity(_0x4938d9,_0x585447){return function(_0x2699fb){if(_0x2699fb){return _0x2699fb[_0xc05b('0x26')]()['then'](function(){_0x4938d9[_0xc05b('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b3a9,_0x19cadd){return function(_0x58ab0e){if(!_0x58ab0e){_0x54b3a9['sendStatus'](0x194);}return _0x58ab0e;};}function handleError(_0x597c8d,_0x3a085f){_0x3a085f=_0x3a085f||0x1f4;return function(_0x4c133c){logger[_0xc05b('0x27')](_0x4c133c[_0xc05b('0x28')]);if(_0x4c133c['name']){delete _0x4c133c[_0xc05b('0x29')];}_0x597c8d[_0xc05b('0x1b')](_0x3a085f)[_0xc05b('0x2a')](_0x4c133c);};}exports[_0xc05b('0x2b')]=function(_0x23a937,_0xeb6d8b){var _0x2f1364={},_0x2ba6b4={},_0xda61de={'count':0x0,'rows':[]};var _0x12e0d3=_[_0xc05b('0x2c')](db[_0xc05b('0x2d')]['rawAttributes'],function(_0x3ca295){return{'name':_0x3ca295['fieldName'],'type':_0x3ca295[_0xc05b('0x2e')]['key']};});_0x2ba6b4['model']=_[_0xc05b('0x2c')](_0x12e0d3,_0xc05b('0x29'));_0x2ba6b4[_0xc05b('0x2f')]=_['keys'](_0x23a937[_0xc05b('0x2f')]);_0x2ba6b4['filters']=_['intersection'](_0x2ba6b4['model'],_0x2ba6b4[_0xc05b('0x2f')]);_0x2f1364[_0xc05b('0x30')]=_[_0xc05b('0x31')](_0x2ba6b4['model'],qs[_0xc05b('0x32')](_0x23a937[_0xc05b('0x2f')][_0xc05b('0x32')]));_0x2f1364[_0xc05b('0x30')]=_0x2f1364['attributes'][_0xc05b('0x33')]?_0x2f1364[_0xc05b('0x30')]:_0x2ba6b4[_0xc05b('0x34')];if(!_0x23a937['query'][_0xc05b('0x35')](_0xc05b('0x36'))){_0x2f1364['limit']=qs[_0xc05b('0x37')](_0x23a937[_0xc05b('0x2f')]['limit']);_0x2f1364['offset']=qs[_0xc05b('0x1d')](_0x23a937[_0xc05b('0x2f')][_0xc05b('0x1d')]);}_0x2f1364[_0xc05b('0x38')]=qs['sort'](_0x23a937[_0xc05b('0x2f')]['sort']);_0x2f1364[_0xc05b('0x39')]=qs[_0xc05b('0x3a')](_[_0xc05b('0x3b')](_0x23a937[_0xc05b('0x2f')],_0x2ba6b4['filters']),_0x12e0d3);if(_0x23a937[_0xc05b('0x2f')][_0xc05b('0x3c')]){_0x2f1364['where']=_['merge'](_0x2f1364[_0xc05b('0x39')],{'$or':_[_0xc05b('0x2c')](_0x12e0d3,function(_0x25097c){if(_0x25097c[_0xc05b('0x2e')]!==_0xc05b('0x3d')){var _0x574617={};_0x574617[_0x25097c[_0xc05b('0x29')]]={'$like':'%'+_0x23a937[_0xc05b('0x2f')][_0xc05b('0x3c')]+'%'};return _0x574617;}})});}_0x2f1364=_[_0xc05b('0x3e')]({},_0x2f1364,_0x23a937['options']);var _0x58a796={'where':_0x2f1364[_0xc05b('0x39')]};return db['JscriptyAnswerReport'][_0xc05b('0x1f')](_0x58a796)['then'](function(_0x4b4060){_0xda61de[_0xc05b('0x1f')]=_0x4b4060;if(_0x23a937[_0xc05b('0x2f')][_0xc05b('0x3f')]){_0x2f1364['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xc05b('0x40')](_0x2f1364);})['then'](function(_0x42de7e){_0xda61de['rows']=_0x42de7e;return _0xda61de;})[_0xc05b('0x25')](respondWithFilteredResult(_0xeb6d8b,_0x2f1364))[_0xc05b('0x41')](handleError(_0xeb6d8b,null));};exports['show']=function(_0x3697ff,_0x15b762){var _0x51b3ee={'raw':!![],'where':{'id':_0x3697ff[_0xc05b('0x42')]['id']}},_0x1f7288={};_0x1f7288[_0xc05b('0x34')]=_[_0xc05b('0x43')](db[_0xc05b('0x2d')][_0xc05b('0x44')]);_0x1f7288[_0xc05b('0x2f')]=_[_0xc05b('0x43')](_0x3697ff['query']);_0x1f7288[_0xc05b('0x3a')]=_[_0xc05b('0x31')](_0x1f7288[_0xc05b('0x34')],_0x1f7288['query']);_0x51b3ee[_0xc05b('0x30')]=_[_0xc05b('0x31')](_0x1f7288[_0xc05b('0x34')],qs[_0xc05b('0x32')](_0x3697ff['query'][_0xc05b('0x32')]));_0x51b3ee[_0xc05b('0x30')]=_0x51b3ee['attributes'][_0xc05b('0x33')]?_0x51b3ee[_0xc05b('0x30')]:_0x1f7288[_0xc05b('0x34')];if(_0x3697ff['query'][_0xc05b('0x3f')]){_0x51b3ee[_0xc05b('0x45')]=[{'all':!![]}];}_0x51b3ee=_[_0xc05b('0x3e')]({},_0x51b3ee,_0x3697ff[_0xc05b('0x46')]);return db[_0xc05b('0x2d')][_0xc05b('0x47')](_0x51b3ee)[_0xc05b('0x25')](handleEntityNotFound(_0x15b762,null))['then'](respondWithResult(_0x15b762,null))[_0xc05b('0x41')](handleError(_0x15b762,null));};exports[_0xc05b('0x48')]=function(_0x24cb60,_0x1851c8){return db[_0xc05b('0x2d')]['create'](_0x24cb60[_0xc05b('0x49')],{})[_0xc05b('0x25')](respondWithResult(_0x1851c8,0xc9))[_0xc05b('0x41')](handleError(_0x1851c8,null));};exports[_0xc05b('0x24')]=function(_0xea513b,_0x45467){if(_0xea513b[_0xc05b('0x49')]['id']){delete _0xea513b['body']['id'];}return db[_0xc05b('0x2d')][_0xc05b('0x47')]({'where':{'id':_0xea513b[_0xc05b('0x42')]['id']}})[_0xc05b('0x25')](handleEntityNotFound(_0x45467,null))[_0xc05b('0x25')](saveUpdates(_0xea513b[_0xc05b('0x49')],null))['then'](respondWithResult(_0x45467,null))[_0xc05b('0x41')](handleError(_0x45467,null));};exports[_0xc05b('0x26')]=function(_0x4c3c52,_0xc2dc13){return db[_0xc05b('0x2d')][_0xc05b('0x47')]({'where':{'id':_0x4c3c52[_0xc05b('0x42')]['id']}})['then'](handleEntityNotFound(_0xc2dc13,null))['then'](removeEntity(_0xc2dc13,null))[_0xc05b('0x41')](handleError(_0xc2dc13,null));};exports[_0xc05b('0x4a')]=function(_0x210adf,_0x31e65d){return db['JscriptyAnswerReport'][_0xc05b('0x4a')]()['then'](respondWithResult(_0x31e65d,null))['catch'](handleError(_0x31e65d,null));}; \ No newline at end of file +var _0x42b0=['update','destroy','then','stack','name','send','index','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','include','rows','catch','show','params','includeAll','create','body','find','describe','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','ejs','squel','crypto','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','json','offset','undefined','limit','set','apply','reject','save'];(function(_0x1071c0,_0x5d0ad9){var _0x3fd8db=function(_0x104b05){while(--_0x104b05){_0x1071c0['push'](_0x1071c0['shift']());}};_0x3fd8db(++_0x5d0ad9);}(_0x42b0,0xbc));var _0x042b=function(_0x1cb128,_0x2770eb){_0x1cb128=_0x1cb128-0x0;var _0x4843e2=_0x42b0[_0x1cb128];return _0x4843e2;};'use strict';var emlformat=require(_0x042b('0x0'));var rimraf=require(_0x042b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x042b('0x2'));var rp=require('request-promise');var moment=require(_0x042b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x042b('0x4'));var path=require(_0x042b('0x5'));var sox=require(_0x042b('0x6'));var csv=require(_0x042b('0x7'));var ejs=require(_0x042b('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x042b('0x9'));var crypto=require(_0x042b('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x042b('0x7'));var querystring=require('querystring');var Papa=require(_0x042b('0xb'));var Redis=require('ioredis');var authService=require(_0x042b('0xc'));var qs=require(_0x042b('0xd'));var as=require(_0x042b('0xe'));var hardwareService=require(_0x042b('0xf'));var logger=require(_0x042b('0x10'))(_0x042b('0x11'));var utils=require(_0x042b('0x12'));var config=require(_0x042b('0x13'));var licenseUtil=require(_0x042b('0x14'));var db=require(_0x042b('0x15'))['db'];function respondWithStatusCode(_0x2c0a6f,_0x35414e){_0x35414e=_0x35414e||0xcc;return function(_0x950ed9){if(_0x950ed9){return _0x2c0a6f['sendStatus'](_0x35414e);}return _0x2c0a6f[_0x042b('0x16')](_0x35414e)['end']();};}function respondWithResult(_0x1e5626,_0x5681bd){_0x5681bd=_0x5681bd||0xc8;return function(_0x31c22e){if(_0x31c22e){return _0x1e5626[_0x042b('0x16')](_0x5681bd)[_0x042b('0x17')](_0x31c22e);}};}function respondWithFilteredResult(_0xf9f4f3,_0x30c86f){return function(_0x183225){if(_0x183225){var _0x4dc4a6=typeof _0x30c86f[_0x042b('0x18')]===_0x042b('0x19')&&typeof _0x30c86f[_0x042b('0x1a')]===_0x042b('0x19');var _0x1e4eee=_0x183225['count'];var _0x2e2cb6=_0x4dc4a6?0x0:_0x30c86f[_0x042b('0x18')];var _0x4b5c25=_0x4dc4a6?_0x183225['count']:_0x30c86f[_0x042b('0x18')]+_0x30c86f[_0x042b('0x1a')];var _0x561d06;if(_0x4b5c25>=_0x1e4eee){_0x4b5c25=_0x1e4eee;_0x561d06=0xc8;}else{_0x561d06=0xce;}_0xf9f4f3[_0x042b('0x16')](_0x561d06);return _0xf9f4f3[_0x042b('0x1b')]('Content-Range',_0x2e2cb6+'-'+_0x4b5c25+'/'+_0x1e4eee)['json'](_0x183225);}return null;};}function patchUpdates(_0x5e6d8a){return function(_0x4eec67){try{jsonpatch[_0x042b('0x1c')](_0x4eec67,_0x5e6d8a,!![]);}catch(_0x23c915){return BPromise[_0x042b('0x1d')](_0x23c915);}return _0x4eec67[_0x042b('0x1e')]();};}function saveUpdates(_0x336c40,_0x50be84){return function(_0x36fabf){if(_0x36fabf){return _0x36fabf[_0x042b('0x1f')](_0x336c40)['then'](function(_0x5bc416){return _0x5bc416;});}return null;};}function removeEntity(_0x434d21,_0x59af51){return function(_0x558889){if(_0x558889){return _0x558889[_0x042b('0x20')]()[_0x042b('0x21')](function(){_0x434d21['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3204fc,_0x2f6e67){return function(_0x3c5491){if(!_0x3c5491){_0x3204fc['sendStatus'](0x194);}return _0x3c5491;};}function handleError(_0xda0462,_0x45d2c6){_0x45d2c6=_0x45d2c6||0x1f4;return function(_0x1b1250){logger['error'](_0x1b1250[_0x042b('0x22')]);if(_0x1b1250[_0x042b('0x23')]){delete _0x1b1250['name'];}_0xda0462[_0x042b('0x16')](_0x45d2c6)[_0x042b('0x24')](_0x1b1250);};}exports[_0x042b('0x25')]=function(_0x39596c,_0x52e467){var _0x5b5fe7={},_0x572d6a={},_0x5c0c41={'count':0x0,'rows':[]};var _0x34bb9e=_['map'](db[_0x042b('0x26')][_0x042b('0x27')],function(_0xddc276){return{'name':_0xddc276[_0x042b('0x28')],'type':_0xddc276[_0x042b('0x29')][_0x042b('0x2a')]};});_0x572d6a[_0x042b('0x2b')]=_[_0x042b('0x2c')](_0x34bb9e,_0x042b('0x23'));_0x572d6a[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x39596c[_0x042b('0x2d')]);_0x572d6a[_0x042b('0x2f')]=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],_0x572d6a[_0x042b('0x2d')]);_0x5b5fe7['attributes']=_[_0x042b('0x30')](_0x572d6a[_0x042b('0x2b')],qs[_0x042b('0x31')](_0x39596c[_0x042b('0x2d')][_0x042b('0x31')]));_0x5b5fe7[_0x042b('0x32')]=_0x5b5fe7['attributes'][_0x042b('0x33')]?_0x5b5fe7[_0x042b('0x32')]:_0x572d6a['model'];if(!_0x39596c[_0x042b('0x2d')][_0x042b('0x34')](_0x042b('0x35'))){_0x5b5fe7[_0x042b('0x1a')]=qs['limit'](_0x39596c[_0x042b('0x2d')][_0x042b('0x1a')]);_0x5b5fe7[_0x042b('0x18')]=qs[_0x042b('0x18')](_0x39596c[_0x042b('0x2d')]['offset']);}_0x5b5fe7[_0x042b('0x36')]=qs[_0x042b('0x37')](_0x39596c[_0x042b('0x2d')]['sort']);_0x5b5fe7[_0x042b('0x38')]=qs['filters'](_[_0x042b('0x39')](_0x39596c[_0x042b('0x2d')],_0x572d6a['filters']),_0x34bb9e);if(_0x39596c[_0x042b('0x2d')][_0x042b('0x3a')]){_0x5b5fe7['where']=_['merge'](_0x5b5fe7[_0x042b('0x38')],{'$or':_[_0x042b('0x2c')](_0x34bb9e,function(_0x4aa81d){if(_0x4aa81d[_0x042b('0x29')]!==_0x042b('0x3b')){var _0x1f38c2={};_0x1f38c2[_0x4aa81d['name']]={'$like':'%'+_0x39596c['query'][_0x042b('0x3a')]+'%'};return _0x1f38c2;}})});}_0x5b5fe7=_[_0x042b('0x3c')]({},_0x5b5fe7,_0x39596c[_0x042b('0x3d')]);var _0x296b35={'where':_0x5b5fe7['where']};return db['JscriptyAnswerReport'][_0x042b('0x3e')](_0x296b35)['then'](function(_0x220653){_0x5c0c41['count']=_0x220653;if(_0x39596c[_0x042b('0x2d')]['includeAll']){_0x5b5fe7[_0x042b('0x3f')]=[{'all':!![]}];}return db[_0x042b('0x26')]['findAll'](_0x5b5fe7);})[_0x042b('0x21')](function(_0x5471fa){_0x5c0c41[_0x042b('0x40')]=_0x5471fa;return _0x5c0c41;})['then'](respondWithFilteredResult(_0x52e467,_0x5b5fe7))[_0x042b('0x41')](handleError(_0x52e467,null));};exports[_0x042b('0x42')]=function(_0x1a9245,_0x4ee3a4){var _0x527f49={'raw':!![],'where':{'id':_0x1a9245[_0x042b('0x43')]['id']}},_0x1fb824={};_0x1fb824[_0x042b('0x2b')]=_[_0x042b('0x2e')](db[_0x042b('0x26')][_0x042b('0x27')]);_0x1fb824[_0x042b('0x2d')]=_[_0x042b('0x2e')](_0x1a9245[_0x042b('0x2d')]);_0x1fb824[_0x042b('0x2f')]=_['intersection'](_0x1fb824[_0x042b('0x2b')],_0x1fb824[_0x042b('0x2d')]);_0x527f49[_0x042b('0x32')]=_[_0x042b('0x30')](_0x1fb824['model'],qs['fields'](_0x1a9245[_0x042b('0x2d')]['fields']));_0x527f49[_0x042b('0x32')]=_0x527f49[_0x042b('0x32')][_0x042b('0x33')]?_0x527f49['attributes']:_0x1fb824[_0x042b('0x2b')];if(_0x1a9245[_0x042b('0x2d')][_0x042b('0x44')]){_0x527f49[_0x042b('0x3f')]=[{'all':!![]}];}_0x527f49=_[_0x042b('0x3c')]({},_0x527f49,_0x1a9245[_0x042b('0x3d')]);return db[_0x042b('0x26')]['find'](_0x527f49)[_0x042b('0x21')](handleEntityNotFound(_0x4ee3a4,null))['then'](respondWithResult(_0x4ee3a4,null))[_0x042b('0x41')](handleError(_0x4ee3a4,null));};exports[_0x042b('0x45')]=function(_0x533862,_0x37488a){return db[_0x042b('0x26')][_0x042b('0x45')](_0x533862[_0x042b('0x46')],{})[_0x042b('0x21')](respondWithResult(_0x37488a,0xc9))[_0x042b('0x41')](handleError(_0x37488a,null));};exports[_0x042b('0x1f')]=function(_0x476eda,_0x48fe3e){if(_0x476eda[_0x042b('0x46')]['id']){delete _0x476eda[_0x042b('0x46')]['id'];}return db[_0x042b('0x26')][_0x042b('0x47')]({'where':{'id':_0x476eda[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x48fe3e,null))['then'](saveUpdates(_0x476eda['body'],null))[_0x042b('0x21')](respondWithResult(_0x48fe3e,null))[_0x042b('0x41')](handleError(_0x48fe3e,null));};exports[_0x042b('0x20')]=function(_0x396da4,_0x261c87){return db['JscriptyAnswerReport']['find']({'where':{'id':_0x396da4[_0x042b('0x43')]['id']}})['then'](handleEntityNotFound(_0x261c87,null))['then'](removeEntity(_0x261c87,null))[_0x042b('0x41')](handleError(_0x261c87,null));};exports['describe']=function(_0x15e46f,_0x170056){return db[_0x042b('0x26')][_0x042b('0x48')]()['then'](respondWithResult(_0x170056,null))[_0x042b('0x41')](handleError(_0x170056,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 5c37eb8..b3cbf2d 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 _0xe03e=['report_jscripty_answers','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x260821,_0x4d4ddd){var _0x258b98=function(_0x4b95ca){while(--_0x4b95ca){_0x260821['push'](_0x260821['shift']());}};_0x258b98(++_0x4d4ddd);}(_0xe03e,0x1da));var _0xee03=function(_0x1230f5,_0x31d229){_0x1230f5=_0x1230f5-0x0;var _0x851634=_0xe03e[_0x1230f5];return _0x851634;};'use strict';var _=require(_0xee03('0x0'));var util=require(_0xee03('0x1'));var logger=require(_0xee03('0x2'))('api');var moment=require('moment');var BPromise=require(_0xee03('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee03('0x4'));var rimraf=require(_0xee03('0x5'));var config=require(_0xee03('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xee03('0x7')]=function(_0x3a7134,_0x3dc502){return _0x3a7134[_0xee03('0x8')](_0xee03('0x9'),attributes,{'tableName':_0xee03('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe6b2=['exports','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x724ced,_0x15b3e4){var _0x3b02bb=function(_0x53212e){while(--_0x53212e){_0x724ced['push'](_0x724ced['shift']());}};_0x3b02bb(++_0x15b3e4);}(_0xe6b2,0x1c4));var _0x2e6b=function(_0x4457f4,_0x1aaef3){_0x4457f4=_0x4457f4-0x0;var _0x5b4588=_0xe6b2[_0x4457f4];return _0x5b4588;};'use strict';var _=require('lodash');var util=require(_0x2e6b('0x0'));var logger=require(_0x2e6b('0x1'))(_0x2e6b('0x2'));var moment=require(_0x2e6b('0x3'));var BPromise=require(_0x2e6b('0x4'));var rp=require(_0x2e6b('0x5'));var fs=require('fs');var path=require(_0x2e6b('0x6'));var rimraf=require(_0x2e6b('0x7'));var config=require(_0x2e6b('0x8'));var attributes=require(_0x2e6b('0x9'));module[_0x2e6b('0xa')]=function(_0x379f85,_0xa57228){return _0x379f85[_0x2e6b('0xb')](_0x2e6b('0xc'),attributes,{'tableName':_0x2e6b('0xd'),'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 ed4f77b..63a0c84 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 _0xc880=['request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','request','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xc880,0xda));var _0x0c88=function(_0x260c53,_0x455308){_0x260c53=_0x260c53-0x0;var _0x2346d5=_0xc880[_0x260c53];return _0x2346d5;};'use strict';var _=require(_0x0c88('0x0'));var util=require(_0x0c88('0x1'));var moment=require(_0x0c88('0x2'));var BPromise=require(_0x0c88('0x3'));var rs=require(_0x0c88('0x4'));var fs=require('fs');var Redis=require(_0x0c88('0x5'));var db=require(_0x0c88('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c88('0x7'))(_0x0c88('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0c88('0x9')][_0x0c88('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e2025,_0x5aa2dc,_0x3b0a4f){return new BPromise(function(_0xa09a7e,_0x10cefa){return client[_0x0c88('0xb')](_0x1e2025,_0x3b0a4f)['then'](function(_0x153d0d){logger['info'](_0x0c88('0xc'),_0x5aa2dc,_0x0c88('0xd'));logger[_0x0c88('0xe')](_0x0c88('0xf'),_0x5aa2dc,_0x0c88('0xd'),JSON[_0x0c88('0x10')](_0x153d0d));if(_0x153d0d['error']){if(_0x153d0d[_0x0c88('0x11')][_0x0c88('0x12')]===0x1f4){logger[_0x0c88('0x11')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5aa2dc,_0x153d0d['error'][_0x0c88('0x13')]);return _0x10cefa(_0x153d0d['error']['message']);}logger[_0x0c88('0x11')](_0x0c88('0xc'),_0x5aa2dc,_0x153d0d['error']['message']);return _0xa09a7e(_0x153d0d[_0x0c88('0x11')][_0x0c88('0x13')]);}else{logger[_0x0c88('0x14')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x5aa2dc,_0x0c88('0xd'));_0xa09a7e(_0x153d0d['result'][_0x0c88('0x13')]);}})['catch'](function(_0x399bc6){logger['error'](_0x0c88('0xc'),_0x5aa2dc,_0x399bc6);_0x10cefa(_0x399bc6);});});} \ No newline at end of file +var _0xe4aa=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2bbefc,_0x179021){var _0x23158e=function(_0x2cea61){while(--_0x2cea61){_0x2bbefc['push'](_0x2bbefc['shift']());}};_0x23158e(++_0x179021);}(_0xe4aa,0x114));var _0xae4a=function(_0x98929c,_0xb7c32b){_0x98929c=_0x98929c-0x0;var _0x4771ba=_0xe4aa[_0x98929c];return _0x4771ba;};'use strict';var _=require(_0xae4a('0x0'));var util=require(_0xae4a('0x1'));var moment=require('moment');var BPromise=require(_0xae4a('0x2'));var rs=require(_0xae4a('0x3'));var fs=require('fs');var Redis=require(_0xae4a('0x4'));var db=require(_0xae4a('0x5'))['db'];var utils=require(_0xae4a('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xae4a('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5ba95b,_0x3cac16,_0x162094){return new BPromise(function(_0x54c203,_0x39bed2){return client[_0xae4a('0x8')](_0x5ba95b,_0x162094)[_0xae4a('0x9')](function(_0x364397){logger[_0xae4a('0xa')](_0xae4a('0xb'),_0x3cac16,_0xae4a('0xc'));logger[_0xae4a('0xd')](_0xae4a('0xe'),_0x3cac16,_0xae4a('0xc'),JSON[_0xae4a('0xf')](_0x364397));if(_0x364397[_0xae4a('0x10')]){if(_0x364397[_0xae4a('0x10')][_0xae4a('0x11')]===0x1f4){logger[_0xae4a('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x3cac16,_0x364397['error'][_0xae4a('0x12')]);return _0x39bed2(_0x364397['error'][_0xae4a('0x12')]);}logger['error'](_0xae4a('0xb'),_0x3cac16,_0x364397['error'][_0xae4a('0x12')]);return _0x54c203(_0x364397[_0xae4a('0x10')][_0xae4a('0x12')]);}else{logger['info'](_0xae4a('0xb'),_0x3cac16,_0xae4a('0xc'));_0x54c203(_0x364397[_0xae4a('0x13')][_0xae4a('0x12')]);}})[_0xae4a('0x14')](function(_0x51a0af){logger[_0xae4a('0x10')](_0xae4a('0xb'),_0x3cac16,_0x51a0af);_0x39bed2(_0x51a0af);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 28d3473..dbca145 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 _0x3ef0=['isAuthenticated','show','/:id/sessions','getSessions','getAnswers','30s','getSummary','post','/:id/clone','put','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get','index','/:id'];(function(_0x4d4fc4,_0x508931){var _0x4649ee=function(_0x30f5d2){while(--_0x30f5d2){_0x4d4fc4['push'](_0x4d4fc4['shift']());}};_0x4649ee(++_0x508931);}(_0x3ef0,0x7e));var _0x03ef=function(_0x4ba41c,_0x5a05c8){_0x4ba41c=_0x4ba41c-0x0;var _0x260839=_0x3ef0[_0x4ba41c];return _0x260839;};'use strict';var multer=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var path=require(_0x03ef('0x2'));var timeout=require(_0x03ef('0x3'));var express=require('express');var router=express[_0x03ef('0x4')]();var fs_extra=require(_0x03ef('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x03ef('0x6'));var config=require(_0x03ef('0x7'));var controller=require(_0x03ef('0x8'));router[_0x03ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x03ef('0xa')]);router[_0x03ef('0x9')](_0x03ef('0xb'),auth[_0x03ef('0xc')](),controller[_0x03ef('0xd')]);router[_0x03ef('0x9')](_0x03ef('0xe'),auth[_0x03ef('0xc')](),controller[_0x03ef('0xf')]);router[_0x03ef('0x9')]('/:id/answers',auth[_0x03ef('0xc')](),controller[_0x03ef('0x10')]);router[_0x03ef('0x9')]('/:id/summary',auth[_0x03ef('0xc')](),timeout(_0x03ef('0x11')),controller[_0x03ef('0x12')]);router[_0x03ef('0x13')]('/',auth[_0x03ef('0xc')](),controller['create']);router[_0x03ef('0x13')](_0x03ef('0x14'),auth[_0x03ef('0xc')](),controller['clone']);router[_0x03ef('0x15')](_0x03ef('0xb'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x03ef('0xb'),auth[_0x03ef('0xc')](),controller['destroy']);module[_0x03ef('0x16')]=router; \ No newline at end of file +var _0x1f38=['./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','getAnswers','/:id/summary','30s','getSummary','post','clone','put','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x5a5708,_0x37ee4a){var _0x522284=function(_0x52ffe5){while(--_0x52ffe5){_0x5a5708['push'](_0x5a5708['shift']());}};_0x522284(++_0x37ee4a);}(_0x1f38,0x1dc));var _0x81f3=function(_0x9f27a3,_0x3716d9){_0x9f27a3=_0x9f27a3-0x0;var _0x1e712e=_0x1f38[_0x9f27a3];return _0x1e712e;};'use strict';var multer=require('multer');var util=require(_0x81f3('0x0'));var path=require(_0x81f3('0x1'));var timeout=require(_0x81f3('0x2'));var express=require(_0x81f3('0x3'));var router=express['Router']();var fs_extra=require(_0x81f3('0x4'));var auth=require(_0x81f3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x81f3('0x6'));var controller=require(_0x81f3('0x7'));router[_0x81f3('0x8')]('/',auth[_0x81f3('0x9')](),controller[_0x81f3('0xa')]);router[_0x81f3('0x8')](_0x81f3('0xb'),auth[_0x81f3('0x9')](),controller[_0x81f3('0xc')]);router[_0x81f3('0x8')]('/:id/sessions',auth['isAuthenticated'](),controller[_0x81f3('0xd')]);router['get']('/:id/answers',auth[_0x81f3('0x9')](),controller[_0x81f3('0xe')]);router['get'](_0x81f3('0xf'),auth[_0x81f3('0x9')](),timeout(_0x81f3('0x10')),controller[_0x81f3('0x11')]);router[_0x81f3('0x12')]('/',auth[_0x81f3('0x9')](),controller['create']);router['post']('/:id/clone',auth['isAuthenticated'](),controller[_0x81f3('0x13')]);router[_0x81f3('0x14')](_0x81f3('0xb'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x81f3('0x9')](),controller[_0x81f3('0x15')]);module[_0x81f3('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index b43bad2..c146024 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 _0x6be4=['formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','stringify','isString'];(function(_0x53785b,_0x14b386){var _0x2ae6da=function(_0x262d6b){while(--_0x262d6b){_0x53785b['push'](_0x53785b['shift']());}};_0x2ae6da(++_0x14b386);}(_0x6be4,0xe3));var _0x46be=function(_0x58ce6f,_0x440436){_0x58ce6f=_0x58ce6f-0x0;var _0x1bd172=_0x6be4[_0x58ce6f];return _0x1bd172;};'use strict';var Sequelize=require(_0x46be('0x0'));var _=require(_0x46be('0x1'));var util=require('util');module[_0x46be('0x2')]={'name':{'type':Sequelize[_0x46be('0x3')],'unique':_0x46be('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x46be('0x5')](_0x46be('0x6')),'set':function(_0xb2ef5c){if(_[_0x46be('0x7')](_0xb2ef5c)){this[_0x46be('0x8')]('formData',JSON[_0x46be('0x9')](_0xb2ef5c));}else if(_[_0x46be('0xa')](_0xb2ef5c)){this[_0x46be('0x8')]('formData',_0xb2ef5c);}else{this['setDataValue'](_0x46be('0xb'),util[_0x46be('0xc')](_0x46be('0xd'),this[_0x46be('0xe')](_0x46be('0x4'))||'',this[_0x46be('0xe')](_0x46be('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x46be('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xca2b=['lodash','util','STRING','name','TEXT','long','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','BOOLEAN','sequelize'];(function(_0x33fd2f,_0x515393){var _0x1092b6=function(_0x3da257){while(--_0x3da257){_0x33fd2f['push'](_0x33fd2f['shift']());}};_0x1092b6(++_0x515393);}(_0xca2b,0x178));var _0xbca2=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xca2b[_0x126558];return _0x1f6d14;};'use strict';var Sequelize=require(_0xbca2('0x0'));var _=require(_0xbca2('0x1'));var util=require(_0xbca2('0x2'));module['exports']={'name':{'type':Sequelize[_0xbca2('0x3')],'unique':_0xbca2('0x4')},'description':{'type':Sequelize[_0xbca2('0x3')]},'formData':{'type':Sequelize[_0xbca2('0x5')](_0xbca2('0x6')),'set':function(_0x5d290e){if(_['isObjectLike'](_0x5d290e)){this[_0xbca2('0x7')](_0xbca2('0x8'),JSON['stringify'](_0x5d290e));}else if(_[_0xbca2('0x9')](_0x5d290e)){this[_0xbca2('0x7')](_0xbca2('0x8'),_0x5d290e);}else{this[_0xbca2('0x7')](_0xbca2('0x8'),util['format'](_0xbca2('0xa'),this[_0xbca2('0xb')]('name')||'',this[_0xbca2('0xb')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0xbca2('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 4ad8c56..284051c 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 _0x69af=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','UserProfileSection','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','replace','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','SessionId','answer','push','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','JscriptyProject','rawAttributes','fieldName','map','filters','intersection','query','attributes','model','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','fields','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Projects','userProfileId'];(function(_0x1672d6,_0x34ccd7){var _0x3f949e=function(_0x5650dc){while(--_0x5650dc){_0x1672d6['push'](_0x1672d6['shift']());}};_0x3f949e(++_0x34ccd7);}(_0x69af,0x17b));var _0xf69a=function(_0x5d3dfe,_0x5b3bb6){_0x5d3dfe=_0x5d3dfe-0x0;var _0xb3a2be=_0x69af[_0x5d3dfe];return _0xb3a2be;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf69a('0x0'));var zipdir=require(_0xf69a('0x1'));var jsonpatch=require(_0xf69a('0x2'));var rp=require(_0xf69a('0x3'));var moment=require(_0xf69a('0x4'));var BPromise=require(_0xf69a('0x5'));var Mustache=require('mustache');var util=require(_0xf69a('0x6'));var path=require(_0xf69a('0x7'));var sox=require(_0xf69a('0x8'));var csv=require(_0xf69a('0x9'));var ejs=require(_0xf69a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf69a('0xb'));var squel=require(_0xf69a('0xc'));var crypto=require(_0xf69a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf69a('0x9'));var querystring=require(_0xf69a('0xe'));var Papa=require(_0xf69a('0xf'));var Redis=require(_0xf69a('0x10'));var authService=require(_0xf69a('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf69a('0x12'))(_0xf69a('0x13'));var utils=require(_0xf69a('0x14'));var config=require(_0xf69a('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xf69a('0x16'))['db'];function respondWithStatusCode(_0x2f9dd7,_0x331bd4){_0x331bd4=_0x331bd4||0xcc;return function(_0x1b053f){if(_0x1b053f){return _0x2f9dd7[_0xf69a('0x17')](_0x331bd4);}return _0x2f9dd7[_0xf69a('0x18')](_0x331bd4)[_0xf69a('0x19')]();};}function respondWithResult(_0x3d76e8,_0x1bab41){_0x1bab41=_0x1bab41||0xc8;return function(_0x3a7342){if(_0x3a7342){return _0x3d76e8['status'](_0x1bab41)[_0xf69a('0x1a')](_0x3a7342);}};}function respondWithFilteredResult(_0x28a747,_0x1e7ed4){return function(_0x324002){if(_0x324002){var _0x510555=typeof _0x1e7ed4[_0xf69a('0x1b')]===_0xf69a('0x1c')&&typeof _0x1e7ed4[_0xf69a('0x1d')]===_0xf69a('0x1c');var _0x1e486c=_0x324002[_0xf69a('0x1e')];var _0x272ad5=_0x510555?0x0:_0x1e7ed4['offset'];var _0x495b1e=_0x510555?_0x324002['count']:_0x1e7ed4[_0xf69a('0x1b')]+_0x1e7ed4['limit'];var _0x58e1a3;if(_0x495b1e>=_0x1e486c){_0x495b1e=_0x1e486c;_0x58e1a3=0xc8;}else{_0x58e1a3=0xce;}_0x28a747['status'](_0x58e1a3);return _0x28a747[_0xf69a('0x1f')](_0xf69a('0x20'),_0x272ad5+'-'+_0x495b1e+'/'+_0x1e486c)[_0xf69a('0x1a')](_0x324002);}return null;};}function patchUpdates(_0x39c67a){return function(_0x5f0c24){try{jsonpatch['apply'](_0x5f0c24,_0x39c67a,!![]);}catch(_0x21c486){return BPromise[_0xf69a('0x21')](_0x21c486);}return _0x5f0c24[_0xf69a('0x22')]();};}function saveUpdates(_0x752c26,_0xdb0def){return function(_0x1ca53e){if(_0x1ca53e){return _0x1ca53e[_0xf69a('0x23')](_0x752c26)[_0xf69a('0x24')](function(_0x492034){return _0x492034;});}return null;};}function removeEntity(_0x24b0f9,_0x40ed91){return function(_0x223fea){if(_0x223fea){return _0x223fea[_0xf69a('0x25')]()[_0xf69a('0x24')](function(){var _0x451c92=_0x223fea[_0xf69a('0x26')]({'plain':!![]});var _0xc1384e='Projects';return db[_0xf69a('0x27')]['destroy']({'where':{'type':_0xc1384e,'resourceId':_0x451c92['id']}})[_0xf69a('0x24')](function(){return _0x223fea;});})[_0xf69a('0x24')](function(){_0x24b0f9[_0xf69a('0x18')](0xcc)[_0xf69a('0x19')]();});}};}function handleEntityNotFound(_0x145494,_0x5e08e3){return function(_0xed95e7){if(!_0xed95e7){_0x145494[_0xf69a('0x17')](0x194);}return _0xed95e7;};}function handleError(_0x1c05bc,_0x580f84){_0x580f84=_0x580f84||0x1f4;return function(_0x5c4211){logger[_0xf69a('0x28')](_0x5c4211['stack']);if(_0x5c4211['name']){delete _0x5c4211[_0xf69a('0x29')];}_0x1c05bc['status'](_0x580f84)['send'](_0x5c4211);};}exports[_0xf69a('0x2a')]=function(_0x431284,_0x2cc439){var _0x9ce13b={},_0x1f4676={},_0x459de3={'count':0x0,'rows':[]};var _0x2f349e=_['map'](db[_0xf69a('0x2b')][_0xf69a('0x2c')],function(_0x5ca1e4){return{'name':_0x5ca1e4[_0xf69a('0x2d')],'type':_0x5ca1e4['type']['key']};});_0x1f4676['model']=_[_0xf69a('0x2e')](_0x2f349e,'name');_0x1f4676['query']=_['keys'](_0x431284['query']);_0x1f4676[_0xf69a('0x2f')]=_[_0xf69a('0x30')](_0x1f4676['model'],_0x1f4676[_0xf69a('0x31')]);_0x9ce13b[_0xf69a('0x32')]=_[_0xf69a('0x30')](_0x1f4676[_0xf69a('0x33')],qs['fields'](_0x431284[_0xf69a('0x31')]['fields']));_0x9ce13b['attributes']=_0x9ce13b[_0xf69a('0x32')]['length']?_0x9ce13b['attributes']:_0x1f4676[_0xf69a('0x33')];if(!_0x431284['query'][_0xf69a('0x34')](_0xf69a('0x35'))){_0x9ce13b['limit']=qs['limit'](_0x431284[_0xf69a('0x31')][_0xf69a('0x1d')]);_0x9ce13b[_0xf69a('0x1b')]=qs['offset'](_0x431284[_0xf69a('0x31')][_0xf69a('0x1b')]);}_0x9ce13b[_0xf69a('0x36')]=qs[_0xf69a('0x37')](_0x431284[_0xf69a('0x31')][_0xf69a('0x37')]);_0x9ce13b[_0xf69a('0x38')]=qs[_0xf69a('0x2f')](_[_0xf69a('0x39')](_0x431284[_0xf69a('0x31')],_0x1f4676[_0xf69a('0x2f')]),_0x2f349e);if(_0x431284['query'][_0xf69a('0x3a')]){_0x9ce13b['where']=_['merge'](_0x9ce13b[_0xf69a('0x38')],{'$or':_[_0xf69a('0x2e')](_0x2f349e,function(_0x38d0c2){if(_0x38d0c2[_0xf69a('0x3b')]!==_0xf69a('0x3c')){var _0x50bb9c={};_0x50bb9c[_0x38d0c2[_0xf69a('0x29')]]={'$like':'%'+_0x431284[_0xf69a('0x31')][_0xf69a('0x3a')]+'%'};return _0x50bb9c;}})});}_0x9ce13b=_['merge']({},_0x9ce13b,_0x431284[_0xf69a('0x3d')]);var _0x2fc097={'where':_0x9ce13b['where']};return db[_0xf69a('0x2b')]['count'](_0x2fc097)[_0xf69a('0x24')](function(_0x44610a){_0x459de3[_0xf69a('0x1e')]=_0x44610a;if(_0x431284['query'][_0xf69a('0x3e')]){_0x9ce13b[_0xf69a('0x3f')]=[{'all':!![]}];}return db['JscriptyProject'][_0xf69a('0x40')](_0x9ce13b);})[_0xf69a('0x24')](function(_0x4f9773){_0x459de3[_0xf69a('0x41')]=_0x4f9773;return _0x459de3;})['then'](respondWithFilteredResult(_0x2cc439,_0x9ce13b))[_0xf69a('0x42')](handleError(_0x2cc439,null));};exports[_0xf69a('0x43')]=function(_0x536dde,_0x559642){var _0x441af9={'raw':![],'where':{'id':_0x536dde[_0xf69a('0x44')]['id']}},_0x178675={};_0x178675['model']=_[_0xf69a('0x45')](db['JscriptyProject'][_0xf69a('0x2c')]);_0x178675[_0xf69a('0x31')]=_['keys'](_0x536dde[_0xf69a('0x31')]);_0x178675[_0xf69a('0x2f')]=_[_0xf69a('0x30')](_0x178675[_0xf69a('0x33')],_0x178675[_0xf69a('0x31')]);_0x441af9['attributes']=_[_0xf69a('0x30')](_0x178675[_0xf69a('0x33')],qs[_0xf69a('0x46')](_0x536dde[_0xf69a('0x31')][_0xf69a('0x46')]));_0x441af9[_0xf69a('0x32')]=_0x441af9[_0xf69a('0x32')][_0xf69a('0x47')]?_0x441af9[_0xf69a('0x32')]:_0x178675['model'];if(_0x536dde['query'][_0xf69a('0x3e')]){_0x441af9['include']=[{'all':!![]}];}_0x441af9=_[_0xf69a('0x48')]({},_0x441af9,_0x536dde['options']);return db[_0xf69a('0x2b')][_0xf69a('0x49')](_0x441af9)[_0xf69a('0x24')](handleEntityNotFound(_0x559642,null))[_0xf69a('0x24')](respondWithResult(_0x559642,null))[_0xf69a('0x42')](handleError(_0x559642,null));};exports[_0xf69a('0x4a')]=function(_0x927d70,_0x4b59db){return db['JscriptyProject'][_0xf69a('0x4a')](_0x927d70[_0xf69a('0x4b')],{})['then'](function(_0x1d03be){var _0x4853cc=_0x927d70[_0xf69a('0x4c')][_0xf69a('0x26')]({'plain':!![]});if(!_0x4853cc)throw new Error(_0xf69a('0x4d'));if(_0x4853cc[_0xf69a('0x4e')]===_0xf69a('0x4c')){var _0x14d64c=_0x1d03be[_0xf69a('0x26')]({'plain':!![]});var _0x456a69=_0xf69a('0x4f');return db['UserProfileSection'][_0xf69a('0x49')]({'where':{'name':_0x456a69,'userProfileId':_0x4853cc[_0xf69a('0x50')]},'raw':!![]})['then'](function(_0x3718d0){if(_0x3718d0&&_0x3718d0[_0xf69a('0x51')]===0x0){return db[_0xf69a('0x27')]['create']({'name':_0x14d64c[_0xf69a('0x29')],'resourceId':_0x14d64c['id'],'type':_0x3718d0['name'],'sectionId':_0x3718d0['id']},{})[_0xf69a('0x24')](function(){return _0x1d03be;});}else{return _0x1d03be;}})[_0xf69a('0x42')](function(_0x5a5e7d){logger[_0xf69a('0x28')](_0xf69a('0x52'),_0x5a5e7d);throw _0x5a5e7d;});}return _0x1d03be;})[_0xf69a('0x24')](respondWithResult(_0x4b59db,0xc9))[_0xf69a('0x42')](handleError(_0x4b59db,null));};exports[_0xf69a('0x53')]=function(_0x2c181e,_0x33f94a){var _0x491975={'where':{'id':_0x2c181e['params']['id']}},_0x278aec={};_0x278aec[_0xf69a('0x33')]=_[_0xf69a('0x45')](db[_0xf69a('0x2b')]['rawAttributes']);_0x491975[_0xf69a('0x32')]=_[_0xf69a('0x30')](_0x278aec[_0xf69a('0x33')],qs[_0xf69a('0x46')](_0x2c181e[_0xf69a('0x31')][_0xf69a('0x46')]));_0x491975[_0xf69a('0x32')]=_0x491975['attributes'][_0xf69a('0x47')]?_0x491975['attributes']:_0x278aec[_0xf69a('0x33')];if(_0x2c181e['query'][_0xf69a('0x3e')]){_0x491975[_0xf69a('0x3f')]=[{'all':!![]}];}_0x491975=_['merge']({},_0x491975,_0x2c181e[_0xf69a('0x3d')]);return db[_0xf69a('0x2b')][_0xf69a('0x49')](_0x491975)[_0xf69a('0x24')](handleEntityNotFound(_0x33f94a,null))['then'](function(_0x25c0f1){if(_0x25c0f1){var _0x55d698=_0x25c0f1[_0xf69a('0x26')]({'plain':!![]});_0x55d698=qs[_0xf69a('0x54')](_0x55d698,['id','createdAt',_0xf69a('0x55')]);_0x2c181e[_0xf69a('0x4b')]=_[_0xf69a('0x54')](_0x2c181e[_0xf69a('0x4b')],['id','createdAt','updatedAt']);return db[_0xf69a('0x2b')][_0xf69a('0x4a')](_[_0xf69a('0x48')](_0x55d698,_0x2c181e[_0xf69a('0x4b')]),{'include':_0x2c181e[_0xf69a('0x31')][_0xf69a('0x3e')]?[{'all':!![]}]:undefined})[_0xf69a('0x24')](function(_0x27e7a3){var _0x2e591d=_0x2c181e['user'][_0xf69a('0x26')]({'plain':!![]});if(!_0x2e591d)throw new Error(_0xf69a('0x4d'));if(_0x2e591d[_0xf69a('0x4e')]===_0xf69a('0x4c')){var _0x389a5d=_0x27e7a3['get']({'plain':!![]});var _0x35dda1=_0xf69a('0x4f');return db[_0xf69a('0x56')]['find']({'where':{'name':_0x35dda1,'userProfileId':_0x2e591d[_0xf69a('0x50')]},'raw':!![]})[_0xf69a('0x24')](function(_0x3958d9){if(_0x3958d9&&_0x3958d9[_0xf69a('0x51')]===0x0){return db['UserProfileResource'][_0xf69a('0x4a')]({'name':_0x389a5d[_0xf69a('0x29')],'resourceId':_0x389a5d['id'],'type':_0x3958d9[_0xf69a('0x29')],'sectionId':_0x3958d9['id']},{})['then'](function(){return _0x27e7a3;});}else{return _0x27e7a3;}})[_0xf69a('0x42')](function(_0x5f3815){logger[_0xf69a('0x28')](_0xf69a('0x52'),_0x5f3815);throw _0x5f3815;});}return _0x27e7a3;});}})['then'](respondWithResult(_0x33f94a,0xc9))[_0xf69a('0x42')](handleError(_0x33f94a,null));};exports[_0xf69a('0x23')]=function(_0x5015d5,_0x3401bf){if(_0x5015d5[_0xf69a('0x4b')]['id']){delete _0x5015d5['body']['id'];}return db[_0xf69a('0x2b')][_0xf69a('0x49')]({'where':{'id':_0x5015d5[_0xf69a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3401bf,null))[_0xf69a('0x24')](saveUpdates(_0x5015d5[_0xf69a('0x4b')],null))[_0xf69a('0x24')](respondWithResult(_0x3401bf,null))[_0xf69a('0x42')](handleError(_0x3401bf,null));};exports['destroy']=function(_0x871e9c,_0x2fa36e){return db[_0xf69a('0x2b')]['find']({'where':{'id':_0x871e9c[_0xf69a('0x44')]['id']}})[_0xf69a('0x24')](handleEntityNotFound(_0x2fa36e,null))[_0xf69a('0x24')](removeEntity(_0x2fa36e,null))[_0xf69a('0x42')](handleError(_0x2fa36e,null));};exports[_0xf69a('0x57')]=function(_0x556455,_0x334cec,_0x37461e){var _0xa8029={'raw':!![],'where':{}};var _0x31664f={};var _0x100b64={'count':0x0,'rows':[]};return db[_0xf69a('0x2b')][_0xf69a('0x58')]({'where':{'id':_0x556455[_0xf69a('0x44')]['id']}})['then'](handleEntityNotFound(_0x334cec,null))[_0xf69a('0x24')](function(_0x43b89b){if(_0x43b89b){_0x31664f[_0xf69a('0x33')]=_['keys'](db[_0xf69a('0x59')][_0xf69a('0x2c')]);_0x31664f['query']=_[_0xf69a('0x45')](_0x556455[_0xf69a('0x31')]);_0x31664f[_0xf69a('0x2f')]=_[_0xf69a('0x30')](_0x31664f[_0xf69a('0x33')],_0x31664f[_0xf69a('0x31')]);_0xa8029[_0xf69a('0x32')]=_['intersection'](_0x31664f[_0xf69a('0x33')],qs['fields'](_0x556455[_0xf69a('0x31')][_0xf69a('0x46')]));_0xa8029[_0xf69a('0x32')]=_0xa8029['attributes']['length']?_0xa8029[_0xf69a('0x32')]:_0x31664f[_0xf69a('0x33')];if(!_0x556455[_0xf69a('0x31')][_0xf69a('0x34')]('nolimit')){_0xa8029[_0xf69a('0x1d')]=qs[_0xf69a('0x1d')](_0x556455['query'][_0xf69a('0x1d')]);_0xa8029['offset']=qs[_0xf69a('0x1b')](_0x556455[_0xf69a('0x31')][_0xf69a('0x1b')]);}_0xa8029[_0xf69a('0x36')]=qs[_0xf69a('0x37')](_0x556455['query'][_0xf69a('0x37')]);_0xa8029[_0xf69a('0x38')]=qs[_0xf69a('0x2f')](_[_0xf69a('0x39')](_0x556455[_0xf69a('0x31')],_0x31664f[_0xf69a('0x2f')]));_0xa8029[_0xf69a('0x38')][_0xf69a('0x5a')]=_0x43b89b['id'];if(_0x556455[_0xf69a('0x31')][_0xf69a('0x3a')]){_0xa8029[_0xf69a('0x38')]=_['merge'](_0xa8029['where'],{'$or':_[_0xf69a('0x2e')](_0xa8029[_0xf69a('0x32')],function(_0x51faca){var _0x28a48e={};_0x28a48e[_0x51faca]={'$like':'%'+_0x556455[_0xf69a('0x31')][_0xf69a('0x3a')]+'%'};return _0x28a48e;})});}_0xa8029=_[_0xf69a('0x48')]({},_0xa8029,_0x556455[_0xf69a('0x3d')]);return db[_0xf69a('0x59')]['count']({'where':_0xa8029[_0xf69a('0x38')]})['then'](function(_0x2b5080){_0x100b64['count']=_0x2b5080;if(_0x556455[_0xf69a('0x31')][_0xf69a('0x3e')]){_0xa8029[_0xf69a('0x3f')]=[{'all':!![]}];}return db[_0xf69a('0x59')][_0xf69a('0x40')](_0xa8029);})[_0xf69a('0x24')](function(_0x5a1ae9){_0x100b64[_0xf69a('0x41')]=_0x5a1ae9;return _0x100b64;});}})[_0xf69a('0x24')](respondWithFilteredResult(_0x334cec,_0xa8029))[_0xf69a('0x42')](handleError(_0x334cec,null));};exports['getAnswers']=function(_0x2554d0,_0x71fe50,_0x3e2409){var _0x408e69={'raw':!![],'where':{}};var _0x3300a1={};var _0x4dbf97={'count':0x0,'rows':[]};return db[_0xf69a('0x2b')]['findOne']({'where':{'id':_0x2554d0['params']['id']}})[_0xf69a('0x24')](handleEntityNotFound(_0x71fe50,null))[_0xf69a('0x24')](function(_0x26bba1){if(_0x26bba1){_0x3300a1[_0xf69a('0x33')]=_[_0xf69a('0x45')](db['JscriptyAnswerReport'][_0xf69a('0x2c')]);_0x3300a1['query']=_['keys'](_0x2554d0[_0xf69a('0x31')]);_0x3300a1[_0xf69a('0x2f')]=_['intersection'](_0x3300a1[_0xf69a('0x33')],_0x3300a1['query']);_0x408e69[_0xf69a('0x32')]=_[_0xf69a('0x30')](_0x3300a1[_0xf69a('0x33')],qs['fields'](_0x2554d0[_0xf69a('0x31')][_0xf69a('0x46')]));_0x408e69[_0xf69a('0x32')]=_0x408e69[_0xf69a('0x32')][_0xf69a('0x47')]?_0x408e69[_0xf69a('0x32')]:_0x3300a1[_0xf69a('0x33')];if(!_0x2554d0[_0xf69a('0x31')][_0xf69a('0x34')](_0xf69a('0x35'))){_0x408e69[_0xf69a('0x1d')]=qs[_0xf69a('0x1d')](_0x2554d0[_0xf69a('0x31')][_0xf69a('0x1d')]);_0x408e69[_0xf69a('0x1b')]=qs[_0xf69a('0x1b')](_0x2554d0[_0xf69a('0x31')][_0xf69a('0x1b')]);}_0x408e69[_0xf69a('0x36')]=qs[_0xf69a('0x37')](_0x2554d0[_0xf69a('0x31')][_0xf69a('0x37')]);_0x408e69[_0xf69a('0x38')]=qs[_0xf69a('0x2f')](_[_0xf69a('0x39')](_0x2554d0[_0xf69a('0x31')],_0x3300a1[_0xf69a('0x2f')]));_0x408e69[_0xf69a('0x38')][_0xf69a('0x5a')]=_0x26bba1['id'];if(_0x2554d0[_0xf69a('0x31')][_0xf69a('0x3a')]){_0x408e69[_0xf69a('0x38')]=_['merge'](_0x408e69['where'],{'$or':_[_0xf69a('0x2e')](_0x408e69[_0xf69a('0x32')],function(_0x155152){var _0x318532={};_0x318532[_0x155152]={'$like':'%'+_0x2554d0[_0xf69a('0x31')][_0xf69a('0x3a')]+'%'};return _0x318532;})});}_0x408e69=_['merge']({},_0x408e69,_0x2554d0[_0xf69a('0x3d')]);return db[_0xf69a('0x5b')][_0xf69a('0x1e')]({'where':_0x408e69['where']})[_0xf69a('0x24')](function(_0x96b659){_0x4dbf97[_0xf69a('0x1e')]=_0x96b659;if(_0x2554d0[_0xf69a('0x31')][_0xf69a('0x3e')]){_0x408e69[_0xf69a('0x3f')]=[{'all':!![]}];}return db[_0xf69a('0x5b')][_0xf69a('0x40')](_0x408e69);})[_0xf69a('0x24')](function(_0x2ed05b){_0x4dbf97[_0xf69a('0x41')]=_0x2ed05b;return _0x4dbf97;});}})[_0xf69a('0x24')](respondWithFilteredResult(_0x71fe50,_0x408e69))[_0xf69a('0x42')](handleError(_0x71fe50,null));};function char(_0x164c2c){return _0xf69a('0x5c')===typeof _0x164c2c?String[_0xf69a('0x5d')]['apply'](null,arguments):_0x164c2c;}function needsEncapsulation(_0x30e0d8){return!!_0x30e0d8&&(_0x30e0d8[_0xf69a('0x5e')]()[_0xf69a('0x5f')](char(0xd))>=0x0||_0x30e0d8[_0xf69a('0x5e')]()[_0xf69a('0x5f')](char(0xa))>=0x0||_0x30e0d8['toString']()[_0xf69a('0x5f')](char(0x2c))>=0x0||_0x30e0d8[_0xf69a('0x5e')]()[_0xf69a('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x1aa94b){var _0x477578=char(0x22),_0x28252f='\x5c'+char(0x22),_0x3f51f0=_0x1aa94b[_0xf69a('0x5e')]()[_0xf69a('0x60')](new RegExp(_0x477578,'g'),_0x28252f);return _0x477578+_0x3f51f0+_0x477578;}exports['getSummary']=function(_0x47bbd9,_0x2ea8f7,_0xf3e76c){var _0x101de3,_0x297195;var _0x500161={'where':{'ProjectId':_0x47bbd9['params']['id']}};if(_0x47bbd9['query'][_0xf69a('0x61')]){_0x500161[_0xf69a('0x38')][_0xf69a('0x62')]=JSON[_0xf69a('0x63')](_0x47bbd9[_0xf69a('0x31')][_0xf69a('0x61')]);}return db[_0xf69a('0x59')][_0xf69a('0x40')](_0x500161)[_0xf69a('0x24')](handleEntityNotFound(_0x2ea8f7,null))[_0xf69a('0x24')](function(_0x57a783){if(_0x57a783){_0x101de3=_0x57a783;return db[_0xf69a('0x64')][_0xf69a('0x40')]({'where':{'SessionId':{'$in':_[_0xf69a('0x2e')](_0x101de3,'id')},'ProjectId':_0x47bbd9[_0xf69a('0x44')]['id']},'order':'-createdAt'});}})['then'](handleEntityNotFound(_0x2ea8f7,null))[_0xf69a('0x24')](function(_0x58a1be){if(_0x58a1be){_0x297195=_0x58a1be;var _0x34e7bc={};for(var _0x305418=0x0,_0x19bd74=_0x297195[_0xf69a('0x47')];_0x305418<_0x19bd74;_0x305418++){if(!_0x34e7bc[_0xf69a('0x34')](_0x297195[_0x305418][_0xf69a('0x65')])){_0x34e7bc[_0x297195[_0x305418][_0xf69a('0x65')]]=needsEncapsulation(_0x297195[_0x305418][_0xf69a('0x66')])?encapsulate(_0x297195[_0x305418][_0xf69a('0x66')]):_0x297195[_0x305418][_0xf69a('0x66')];}}var _0x1ad690=[],_0x77d653={};for(var _0x4fb0cf=0x0,_0x334314=_0x101de3[_0xf69a('0x47')];_0x4fb0cf<_0x334314;_0x4fb0cf++){_0x77d653={'ProjectId':_0x47bbd9[_0xf69a('0x44')]['id'],'SessionId':_0x101de3[_0x4fb0cf]['id'],'StartTime':moment(_0x101de3[_0x4fb0cf][_0xf69a('0x62')])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x3789e=0x0,_0x1b868d=_0x297195[_0xf69a('0x47')];_0x3789e<_0x1b868d;_0x3789e++){if(_0x297195[_0x3789e][_0xf69a('0x67')]==_0x101de3[_0x4fb0cf]['id']&&_0x34e7bc[_0xf69a('0x34')](_0x297195[_0x3789e][_0xf69a('0x65')])){_0x77d653[_0x34e7bc[_0x297195[_0x3789e][_0xf69a('0x65')]]]=_0x297195[_0x3789e][_0xf69a('0x68')];}}for(var _0x29231f in _0x34e7bc){if(!_0x77d653[_0xf69a('0x34')](_0x34e7bc[_0x29231f])){_0x77d653[_0x34e7bc[_0x29231f]]=null;}}_0x1ad690[_0xf69a('0x69')](_0x77d653);}return _0x1ad690;}})[_0xf69a('0x24')](function(_0x27bf1e){if(!_['isEmpty'](_0x27bf1e)){var _0x10d25c=toCsv(_0x27bf1e);var _0x50bf02=Date[_0xf69a('0x6a')]();fs['writeFileSync'](util['format'](_0xf69a('0x6b'),_0x47bbd9['params']['id'],_0x50bf02),_0x10d25c);_0x2ea8f7[_0xf69a('0x6c')]('Content-disposition',_0xf69a('0x6d')+util['format'](_0xf69a('0x6e'),_0x47bbd9[_0xf69a('0x44')]['id'],_0x50bf02));_0x2ea8f7[_0xf69a('0x6c')](_0xf69a('0x6f'),_0xf69a('0x70'));return _0x2ea8f7[_0xf69a('0x71')](util[_0xf69a('0x72')](_0xf69a('0x6b'),_0x47bbd9['params']['id'],_0x50bf02));}else{return _0x2ea8f7[_0xf69a('0x17')](0xcc);}})[_0xf69a('0x42')](handleError(_0x2ea8f7,null));}; \ No newline at end of file +var _0xccbf=['ProjectId','getAnswers','findOne','JscriptyAnswerReport','order','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-type','text/csv','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','apply','reject','save','update','destroy','get','Projects','UserProfileResource','then','sendStatus','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','body','user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','JscriptySessionReport'];(function(_0x1d7037,_0x57dd95){var _0x4d6568=function(_0x5c64c5){while(--_0x5c64c5){_0x1d7037['push'](_0x1d7037['shift']());}};_0x4d6568(++_0x57dd95);}(_0xccbf,0x1ef));var _0xfccb=function(_0x5c9ee7,_0x59ad62){_0x5c9ee7=_0x5c9ee7-0x0;var _0x349421=_0xccbf[_0x5c9ee7];return _0x349421;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfccb('0x0'));var jsonpatch=require(_0xfccb('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfccb('0x2'));var util=require(_0xfccb('0x3'));var path=require(_0xfccb('0x4'));var sox=require(_0xfccb('0x5'));var csv=require(_0xfccb('0x6'));var ejs=require(_0xfccb('0x7'));var fs=require('fs');var fs_extra=require(_0xfccb('0x8'));var _=require(_0xfccb('0x9'));var squel=require(_0xfccb('0xa'));var crypto=require(_0xfccb('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfccb('0x6'));var querystring=require('querystring');var Papa=require(_0xfccb('0xc'));var Redis=require(_0xfccb('0xd'));var authService=require(_0xfccb('0xe'));var qs=require(_0xfccb('0xf'));var as=require(_0xfccb('0x10'));var hardwareService=require(_0xfccb('0x11'));var logger=require(_0xfccb('0x12'))('api');var utils=require(_0xfccb('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xfccb('0x14'));var db=require(_0xfccb('0x15'))['db'];function respondWithStatusCode(_0x294290,_0x6347e){_0x6347e=_0x6347e||0xcc;return function(_0x3feeb8){if(_0x3feeb8){return _0x294290['sendStatus'](_0x6347e);}return _0x294290[_0xfccb('0x16')](_0x6347e)[_0xfccb('0x17')]();};}function respondWithResult(_0x4dbc25,_0x24b877){_0x24b877=_0x24b877||0xc8;return function(_0x1ac34f){if(_0x1ac34f){return _0x4dbc25[_0xfccb('0x16')](_0x24b877)[_0xfccb('0x18')](_0x1ac34f);}};}function respondWithFilteredResult(_0x3ec8f6,_0x4b982c){return function(_0x45f2dc){if(_0x45f2dc){var _0x2c1cdb=typeof _0x4b982c[_0xfccb('0x19')]===_0xfccb('0x1a')&&typeof _0x4b982c['limit']===_0xfccb('0x1a');var _0xa7dde9=_0x45f2dc[_0xfccb('0x1b')];var _0x3ccfaf=_0x2c1cdb?0x0:_0x4b982c[_0xfccb('0x19')];var _0x44bc94=_0x2c1cdb?_0x45f2dc['count']:_0x4b982c[_0xfccb('0x19')]+_0x4b982c['limit'];var _0x2d1282;if(_0x44bc94>=_0xa7dde9){_0x44bc94=_0xa7dde9;_0x2d1282=0xc8;}else{_0x2d1282=0xce;}_0x3ec8f6[_0xfccb('0x16')](_0x2d1282);return _0x3ec8f6[_0xfccb('0x1c')]('Content-Range',_0x3ccfaf+'-'+_0x44bc94+'/'+_0xa7dde9)[_0xfccb('0x18')](_0x45f2dc);}return null;};}function patchUpdates(_0x385272){return function(_0x46c59a){try{jsonpatch[_0xfccb('0x1d')](_0x46c59a,_0x385272,!![]);}catch(_0x121b20){return BPromise[_0xfccb('0x1e')](_0x121b20);}return _0x46c59a[_0xfccb('0x1f')]();};}function saveUpdates(_0x587fe2,_0x5beeef){return function(_0x2baa04){if(_0x2baa04){return _0x2baa04[_0xfccb('0x20')](_0x587fe2)['then'](function(_0x35679f){return _0x35679f;});}return null;};}function removeEntity(_0x23c395,_0x343f15){return function(_0x2087c6){if(_0x2087c6){return _0x2087c6[_0xfccb('0x21')]()['then'](function(){var _0x3a86ed=_0x2087c6[_0xfccb('0x22')]({'plain':!![]});var _0x29e1f9=_0xfccb('0x23');return db[_0xfccb('0x24')][_0xfccb('0x21')]({'where':{'type':_0x29e1f9,'resourceId':_0x3a86ed['id']}})['then'](function(){return _0x2087c6;});})[_0xfccb('0x25')](function(){_0x23c395[_0xfccb('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29e5fa,_0x4edf31){return function(_0x2e9e0a){if(!_0x2e9e0a){_0x29e5fa[_0xfccb('0x26')](0x194);}return _0x2e9e0a;};}function handleError(_0x6ba751,_0x2dc7d1){_0x2dc7d1=_0x2dc7d1||0x1f4;return function(_0x54834f){logger[_0xfccb('0x27')](_0x54834f[_0xfccb('0x28')]);if(_0x54834f['name']){delete _0x54834f[_0xfccb('0x29')];}_0x6ba751[_0xfccb('0x16')](_0x2dc7d1)[_0xfccb('0x2a')](_0x54834f);};}exports[_0xfccb('0x2b')]=function(_0x5314b8,_0x3d7e72){var _0x26f6df={},_0xf35e06={},_0x3286f1={'count':0x0,'rows':[]};var _0x301e0b=_['map'](db[_0xfccb('0x2c')][_0xfccb('0x2d')],function(_0x30493f){return{'name':_0x30493f[_0xfccb('0x2e')],'type':_0x30493f[_0xfccb('0x2f')][_0xfccb('0x30')]};});_0xf35e06[_0xfccb('0x31')]=_[_0xfccb('0x32')](_0x301e0b,_0xfccb('0x29'));_0xf35e06[_0xfccb('0x33')]=_['keys'](_0x5314b8[_0xfccb('0x33')]);_0xf35e06[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],_0xf35e06[_0xfccb('0x33')]);_0x26f6df['attributes']=_[_0xfccb('0x35')](_0xf35e06[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x36')]));_0x26f6df['attributes']=_0x26f6df[_0xfccb('0x37')][_0xfccb('0x38')]?_0x26f6df[_0xfccb('0x37')]:_0xf35e06[_0xfccb('0x31')];if(!_0x5314b8[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x26f6df[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x26f6df[_0xfccb('0x19')]=qs[_0xfccb('0x19')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x26f6df['order']=qs[_0xfccb('0x3c')](_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3c')]);_0x26f6df[_0xfccb('0x3d')]=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x5314b8[_0xfccb('0x33')],_0xf35e06['filters']),_0x301e0b);if(_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x26f6df[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x26f6df[_0xfccb('0x3d')],{'$or':_['map'](_0x301e0b,function(_0x2fb449){if(_0x2fb449[_0xfccb('0x2f')]!==_0xfccb('0x41')){var _0x231e27={};_0x231e27[_0x2fb449[_0xfccb('0x29')]]={'$like':'%'+_0x5314b8[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x231e27;}})});}_0x26f6df=_[_0xfccb('0x40')]({},_0x26f6df,_0x5314b8[_0xfccb('0x42')]);var _0x6b7a4b={'where':_0x26f6df[_0xfccb('0x3d')]};return db[_0xfccb('0x2c')][_0xfccb('0x1b')](_0x6b7a4b)[_0xfccb('0x25')](function(_0x300eb5){_0x3286f1[_0xfccb('0x1b')]=_0x300eb5;if(_0x5314b8['query'][_0xfccb('0x43')]){_0x26f6df[_0xfccb('0x44')]=[{'all':!![]}];}return db[_0xfccb('0x2c')][_0xfccb('0x45')](_0x26f6df);})['then'](function(_0x16da43){_0x3286f1[_0xfccb('0x46')]=_0x16da43;return _0x3286f1;})[_0xfccb('0x25')](respondWithFilteredResult(_0x3d7e72,_0x26f6df))['catch'](handleError(_0x3d7e72,null));};exports[_0xfccb('0x47')]=function(_0x51cc89,_0x3a6409){var _0x450a82={'raw':![],'where':{'id':_0x51cc89[_0xfccb('0x48')]['id']}},_0x4c1229={};_0x4c1229[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x4c1229[_0xfccb('0x33')]=_[_0xfccb('0x49')](_0x51cc89[_0xfccb('0x33')]);_0x4c1229[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x4c1229['model'],_0x4c1229[_0xfccb('0x33')]);_0x450a82[_0xfccb('0x37')]=_[_0xfccb('0x35')](_0x4c1229['model'],qs[_0xfccb('0x36')](_0x51cc89[_0xfccb('0x33')][_0xfccb('0x36')]));_0x450a82[_0xfccb('0x37')]=_0x450a82[_0xfccb('0x37')]['length']?_0x450a82[_0xfccb('0x37')]:_0x4c1229['model'];if(_0x51cc89[_0xfccb('0x33')]['includeAll']){_0x450a82[_0xfccb('0x44')]=[{'all':!![]}];}_0x450a82=_['merge']({},_0x450a82,_0x51cc89[_0xfccb('0x42')]);return db[_0xfccb('0x2c')][_0xfccb('0x4a')](_0x450a82)['then'](handleEntityNotFound(_0x3a6409,null))[_0xfccb('0x25')](respondWithResult(_0x3a6409,null))['catch'](handleError(_0x3a6409,null));};exports['create']=function(_0x1dd08b,_0x7bb37c){return db[_0xfccb('0x2c')]['create'](_0x1dd08b[_0xfccb('0x4b')],{})[_0xfccb('0x25')](function(_0x467afe){var _0x11951a=_0x1dd08b[_0xfccb('0x4c')]['get']({'plain':!![]});if(!_0x11951a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x11951a[_0xfccb('0x4d')]===_0xfccb('0x4c')){var _0x503c22=_0x467afe[_0xfccb('0x22')]({'plain':!![]});var _0x5045b5=_0xfccb('0x23');return db[_0xfccb('0x4e')][_0xfccb('0x4a')]({'where':{'name':_0x5045b5,'userProfileId':_0x11951a[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x237642){if(_0x237642&&_0x237642[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x503c22['name'],'resourceId':_0x503c22['id'],'type':_0x237642['name'],'sectionId':_0x237642['id']},{})[_0xfccb('0x25')](function(){return _0x467afe;});}else{return _0x467afe;}})['catch'](function(_0x3d86ef){logger['error'](_0xfccb('0x52'),_0x3d86ef);throw _0x3d86ef;});}return _0x467afe;})[_0xfccb('0x25')](respondWithResult(_0x7bb37c,0xc9))[_0xfccb('0x53')](handleError(_0x7bb37c,null));};exports[_0xfccb('0x54')]=function(_0x1d0dad,_0xea2af8){var _0x3a6530={'where':{'id':_0x1d0dad[_0xfccb('0x48')]['id']}},_0x4188c4={};_0x4188c4['model']=_[_0xfccb('0x49')](db[_0xfccb('0x2c')][_0xfccb('0x2d')]);_0x3a6530['attributes']=_[_0xfccb('0x35')](_0x4188c4[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x1d0dad[_0xfccb('0x33')]['fields']));_0x3a6530[_0xfccb('0x37')]=_0x3a6530['attributes'][_0xfccb('0x38')]?_0x3a6530[_0xfccb('0x37')]:_0x4188c4['model'];if(_0x1d0dad['query'][_0xfccb('0x43')]){_0x3a6530['include']=[{'all':!![]}];}_0x3a6530=_[_0xfccb('0x40')]({},_0x3a6530,_0x1d0dad[_0xfccb('0x42')]);return db[_0xfccb('0x2c')]['find'](_0x3a6530)[_0xfccb('0x25')](handleEntityNotFound(_0xea2af8,null))['then'](function(_0x1497bd){if(_0x1497bd){var _0x3e7319=_0x1497bd[_0xfccb('0x22')]({'plain':!![]});_0x3e7319=qs[_0xfccb('0x55')](_0x3e7319,['id','createdAt',_0xfccb('0x56')]);_0x1d0dad[_0xfccb('0x4b')]=_[_0xfccb('0x55')](_0x1d0dad[_0xfccb('0x4b')],['id',_0xfccb('0x57'),_0xfccb('0x56')]);return db['JscriptyProject'][_0xfccb('0x51')](_[_0xfccb('0x40')](_0x3e7319,_0x1d0dad[_0xfccb('0x4b')]),{'include':_0x1d0dad[_0xfccb('0x33')]['includeAll']?[{'all':!![]}]:undefined})[_0xfccb('0x25')](function(_0x3f82f9){var _0x6c1e39=_0x1d0dad[_0xfccb('0x4c')][_0xfccb('0x22')]({'plain':!![]});if(!_0x6c1e39)throw new Error(_0xfccb('0x58'));if(_0x6c1e39['role']===_0xfccb('0x4c')){var _0x3db3e4=_0x3f82f9[_0xfccb('0x22')]({'plain':!![]});var _0x5d19eb='Projects';return db['UserProfileSection']['find']({'where':{'name':_0x5d19eb,'userProfileId':_0x6c1e39[_0xfccb('0x4f')]},'raw':!![]})[_0xfccb('0x25')](function(_0x52251a){if(_0x52251a&&_0x52251a[_0xfccb('0x50')]===0x0){return db['UserProfileResource'][_0xfccb('0x51')]({'name':_0x3db3e4[_0xfccb('0x29')],'resourceId':_0x3db3e4['id'],'type':_0x52251a[_0xfccb('0x29')],'sectionId':_0x52251a['id']},{})['then'](function(){return _0x3f82f9;});}else{return _0x3f82f9;}})[_0xfccb('0x53')](function(_0x302b4b){logger[_0xfccb('0x27')](_0xfccb('0x52'),_0x302b4b);throw _0x302b4b;});}return _0x3f82f9;});}})['then'](respondWithResult(_0xea2af8,0xc9))['catch'](handleError(_0xea2af8,null));};exports[_0xfccb('0x20')]=function(_0x5df317,_0xdb6347){if(_0x5df317[_0xfccb('0x4b')]['id']){delete _0x5df317[_0xfccb('0x4b')]['id'];}return db[_0xfccb('0x2c')][_0xfccb('0x4a')]({'where':{'id':_0x5df317['params']['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0xdb6347,null))[_0xfccb('0x25')](saveUpdates(_0x5df317[_0xfccb('0x4b')],null))['then'](respondWithResult(_0xdb6347,null))['catch'](handleError(_0xdb6347,null));};exports[_0xfccb('0x21')]=function(_0x347ed7,_0x121d6c){return db[_0xfccb('0x2c')]['find']({'where':{'id':_0x347ed7[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x121d6c,null))['then'](removeEntity(_0x121d6c,null))[_0xfccb('0x53')](handleError(_0x121d6c,null));};exports['getSessions']=function(_0x2c8fd9,_0x45dd06,_0x2749ae){var _0x4fad84={'raw':!![],'where':{}};var _0x1d03e8={};var _0x2924e4={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x2c8fd9[_0xfccb('0x48')]['id']}})['then'](handleEntityNotFound(_0x45dd06,null))[_0xfccb('0x25')](function(_0x153075){if(_0x153075){_0x1d03e8['model']=_[_0xfccb('0x49')](db[_0xfccb('0x59')][_0xfccb('0x2d')]);_0x1d03e8[_0xfccb('0x33')]=_['keys'](_0x2c8fd9[_0xfccb('0x33')]);_0x1d03e8['filters']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],_0x1d03e8[_0xfccb('0x33')]);_0x4fad84['attributes']=_[_0xfccb('0x35')](_0x1d03e8[_0xfccb('0x31')],qs[_0xfccb('0x36')](_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x36')]));_0x4fad84[_0xfccb('0x37')]=_0x4fad84[_0xfccb('0x37')]['length']?_0x4fad84[_0xfccb('0x37')]:_0x1d03e8['model'];if(!_0x2c8fd9[_0xfccb('0x33')]['hasOwnProperty'](_0xfccb('0x3a'))){_0x4fad84[_0xfccb('0x3b')]=qs[_0xfccb('0x3b')](_0x2c8fd9[_0xfccb('0x33')]['limit']);_0x4fad84['offset']=qs[_0xfccb('0x19')](_0x2c8fd9['query']['offset']);}_0x4fad84['order']=qs[_0xfccb('0x3c')](_0x2c8fd9['query'][_0xfccb('0x3c')]);_0x4fad84['where']=qs[_0xfccb('0x34')](_[_0xfccb('0x3e')](_0x2c8fd9[_0xfccb('0x33')],_0x1d03e8[_0xfccb('0x34')]));_0x4fad84[_0xfccb('0x3d')][_0xfccb('0x5a')]=_0x153075['id'];if(_0x2c8fd9[_0xfccb('0x33')]['filter']){_0x4fad84[_0xfccb('0x3d')]=_['merge'](_0x4fad84[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x4fad84[_0xfccb('0x37')],function(_0x5e7fc3){var _0x5c7838={};_0x5c7838[_0x5e7fc3]={'$like':'%'+_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x5c7838;})});}_0x4fad84=_[_0xfccb('0x40')]({},_0x4fad84,_0x2c8fd9[_0xfccb('0x42')]);return db[_0xfccb('0x59')][_0xfccb('0x1b')]({'where':_0x4fad84[_0xfccb('0x3d')]})[_0xfccb('0x25')](function(_0x452d7a){_0x2924e4[_0xfccb('0x1b')]=_0x452d7a;if(_0x2c8fd9[_0xfccb('0x33')][_0xfccb('0x43')]){_0x4fad84[_0xfccb('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xfccb('0x45')](_0x4fad84);})[_0xfccb('0x25')](function(_0x2ab1cc){_0x2924e4[_0xfccb('0x46')]=_0x2ab1cc;return _0x2924e4;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x45dd06,_0x4fad84))[_0xfccb('0x53')](handleError(_0x45dd06,null));};exports[_0xfccb('0x5b')]=function(_0x363c1e,_0x5c0779,_0x4a6f51){var _0x35c6dd={'raw':!![],'where':{}};var _0x1961a0={};var _0x38d94c={'count':0x0,'rows':[]};return db[_0xfccb('0x2c')][_0xfccb('0x5c')]({'where':{'id':_0x363c1e[_0xfccb('0x48')]['id']}})[_0xfccb('0x25')](handleEntityNotFound(_0x5c0779,null))['then'](function(_0x1b5961){if(_0x1b5961){_0x1961a0[_0xfccb('0x31')]=_[_0xfccb('0x49')](db[_0xfccb('0x5d')][_0xfccb('0x2d')]);_0x1961a0['query']=_[_0xfccb('0x49')](_0x363c1e[_0xfccb('0x33')]);_0x1961a0[_0xfccb('0x34')]=_[_0xfccb('0x35')](_0x1961a0['model'],_0x1961a0[_0xfccb('0x33')]);_0x35c6dd[_0xfccb('0x37')]=_['intersection'](_0x1961a0[_0xfccb('0x31')],qs['fields'](_0x363c1e[_0xfccb('0x33')]['fields']));_0x35c6dd['attributes']=_0x35c6dd['attributes']['length']?_0x35c6dd[_0xfccb('0x37')]:_0x1961a0[_0xfccb('0x31')];if(!_0x363c1e[_0xfccb('0x33')][_0xfccb('0x39')](_0xfccb('0x3a'))){_0x35c6dd['limit']=qs[_0xfccb('0x3b')](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3b')]);_0x35c6dd[_0xfccb('0x19')]=qs['offset'](_0x363c1e[_0xfccb('0x33')][_0xfccb('0x19')]);}_0x35c6dd[_0xfccb('0x5e')]=qs[_0xfccb('0x3c')](_0x363c1e['query'][_0xfccb('0x3c')]);_0x35c6dd[_0xfccb('0x3d')]=qs['filters'](_[_0xfccb('0x3e')](_0x363c1e[_0xfccb('0x33')],_0x1961a0[_0xfccb('0x34')]));_0x35c6dd[_0xfccb('0x3d')]['ProjectId']=_0x1b5961['id'];if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]){_0x35c6dd[_0xfccb('0x3d')]=_[_0xfccb('0x40')](_0x35c6dd[_0xfccb('0x3d')],{'$or':_[_0xfccb('0x32')](_0x35c6dd[_0xfccb('0x37')],function(_0x3b949b){var _0x1afb9e={};_0x1afb9e[_0x3b949b]={'$like':'%'+_0x363c1e[_0xfccb('0x33')][_0xfccb('0x3f')]+'%'};return _0x1afb9e;})});}_0x35c6dd=_[_0xfccb('0x40')]({},_0x35c6dd,_0x363c1e['options']);return db[_0xfccb('0x5d')][_0xfccb('0x1b')]({'where':_0x35c6dd['where']})[_0xfccb('0x25')](function(_0x5783d6){_0x38d94c['count']=_0x5783d6;if(_0x363c1e[_0xfccb('0x33')][_0xfccb('0x43')]){_0x35c6dd[_0xfccb('0x44')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x35c6dd);})[_0xfccb('0x25')](function(_0x3de35e){_0x38d94c[_0xfccb('0x46')]=_0x3de35e;return _0x38d94c;});}})[_0xfccb('0x25')](respondWithFilteredResult(_0x5c0779,_0x35c6dd))['catch'](handleError(_0x5c0779,null));};function char(_0x45b22d){return'number'===typeof _0x45b22d?String['fromCharCode']['apply'](null,arguments):_0x45b22d;}function needsEncapsulation(_0x37fd9f){return!!_0x37fd9f&&(_0x37fd9f['toString']()['indexOf'](char(0xd))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()['indexOf'](char(0xa))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()[_0xfccb('0x60')](char(0x2c))>=0x0||_0x37fd9f[_0xfccb('0x5f')]()[_0xfccb('0x60')](char(0x22))>=0x0);}function encapsulate(_0xcb1c31){var _0x2ead16=char(0x22),_0x49e272='\x5c'+char(0x22),_0x2e4e26=_0xcb1c31['toString']()[_0xfccb('0x61')](new RegExp(_0x2ead16,'g'),_0x49e272);return _0x2ead16+_0x2e4e26+_0x2ead16;}exports[_0xfccb('0x62')]=function(_0x11c643,_0x35e614,_0xbb397c){var _0x5bc8b4,_0x14c851;var _0x368b5e={'where':{'ProjectId':_0x11c643[_0xfccb('0x48')]['id']}};if(_0x11c643[_0xfccb('0x33')][_0xfccb('0x63')]){_0x368b5e[_0xfccb('0x3d')]['starttime']=JSON[_0xfccb('0x64')](_0x11c643[_0xfccb('0x33')][_0xfccb('0x63')]);}return db[_0xfccb('0x59')]['findAll'](_0x368b5e)['then'](handleEntityNotFound(_0x35e614,null))[_0xfccb('0x25')](function(_0x1d0d17){if(_0x1d0d17){_0x5bc8b4=_0x1d0d17;return db[_0xfccb('0x65')][_0xfccb('0x45')]({'where':{'SessionId':{'$in':_[_0xfccb('0x32')](_0x5bc8b4,'id')},'ProjectId':_0x11c643[_0xfccb('0x48')]['id']},'order':_0xfccb('0x66')});}})[_0xfccb('0x25')](handleEntityNotFound(_0x35e614,null))[_0xfccb('0x25')](function(_0x54dc80){if(_0x54dc80){_0x14c851=_0x54dc80;var _0x939693={};for(var _0x1d2982=0x0,_0x5f2f4f=_0x14c851[_0xfccb('0x38')];_0x1d2982<_0x5f2f4f;_0x1d2982++){if(!_0x939693[_0xfccb('0x39')](_0x14c851[_0x1d2982][_0xfccb('0x67')])){_0x939693[_0x14c851[_0x1d2982][_0xfccb('0x67')]]=needsEncapsulation(_0x14c851[_0x1d2982][_0xfccb('0x68')])?encapsulate(_0x14c851[_0x1d2982]['question']):_0x14c851[_0x1d2982]['question'];}}var _0x1584c6=[],_0x40eaca={};for(var _0x2178f9=0x0,_0xc38726=_0x5bc8b4[_0xfccb('0x38')];_0x2178f9<_0xc38726;_0x2178f9++){_0x40eaca={'ProjectId':_0x11c643[_0xfccb('0x48')]['id'],'SessionId':_0x5bc8b4[_0x2178f9]['id'],'StartTime':moment(_0x5bc8b4[_0x2178f9][_0xfccb('0x69')])[_0xfccb('0x6a')](_0xfccb('0x6b'))};for(var _0x4f4b8=0x0,_0x2c6f02=_0x14c851[_0xfccb('0x38')];_0x4f4b8<_0x2c6f02;_0x4f4b8++){if(_0x14c851[_0x4f4b8]['SessionId']==_0x5bc8b4[_0x2178f9]['id']&&_0x939693[_0xfccb('0x39')](_0x14c851[_0x4f4b8][_0xfccb('0x67')])){_0x40eaca[_0x939693[_0x14c851[_0x4f4b8]['questionId']]]=_0x14c851[_0x4f4b8][_0xfccb('0x6c')];}}for(var _0x1f5192 in _0x939693){if(!_0x40eaca[_0xfccb('0x39')](_0x939693[_0x1f5192])){_0x40eaca[_0x939693[_0x1f5192]]=null;}}_0x1584c6['push'](_0x40eaca);}return _0x1584c6;}})['then'](function(_0x315d9b){if(!_[_0xfccb('0x6d')](_0x315d9b)){var _0x12a8bb=toCsv(_0x315d9b);var _0x136977=Date['now']();fs[_0xfccb('0x6e')](util[_0xfccb('0x6a')](_0xfccb('0x6f'),_0x11c643[_0xfccb('0x48')]['id'],_0x136977),_0x12a8bb);_0x35e614['setHeader']('Content-disposition',_0xfccb('0x70')+util[_0xfccb('0x6a')](_0xfccb('0x71'),_0x11c643['params']['id'],_0x136977));_0x35e614[_0xfccb('0x72')](_0xfccb('0x73'),_0xfccb('0x74'));return _0x35e614['download'](util[_0xfccb('0x6a')](_0xfccb('0x6f'),_0x11c643[_0xfccb('0x48')]['id'],_0x136977));}else{return _0x35e614['sendStatus'](0xcc);}})[_0xfccb('0x53')](handleError(_0x35e614,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index ee2315b..8495940 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 _0xe548=['jscripty_projects','lodash','util','../../config/logger','api','moment','./jscriptyProject.attributes','define','JscriptyProject'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xe548,0x184));var _0x8e54=function(_0x484f06,_0x36e4ac){_0x484f06=_0x484f06-0x0;var _0x332d44=_0xe548[_0x484f06];return _0x332d44;};'use strict';var _=require(_0x8e54('0x0'));var util=require(_0x8e54('0x1'));var logger=require(_0x8e54('0x2'))(_0x8e54('0x3'));var moment=require(_0x8e54('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('../../config/environment');var attributes=require(_0x8e54('0x5'));module['exports']=function(_0x288be8,_0x47a58d){return _0x288be8[_0x8e54('0x6')](_0x8e54('0x7'),attributes,{'tableName':_0x8e54('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20d7=['rimraf','../../config/environment','JscriptyProject','jscripty_projects','../../config/logger','api','moment'];(function(_0x390556,_0x5b64bd){var _0x11868e=function(_0x51bf69){while(--_0x51bf69){_0x390556['push'](_0x390556['shift']());}};_0x11868e(++_0x5b64bd);}(_0x20d7,0x146));var _0x720d=function(_0x59134d,_0x299558){_0x59134d=_0x59134d-0x0;var _0x335878=_0x20d7[_0x59134d];return _0x335878;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x720d('0x0'))(_0x720d('0x1'));var moment=require(_0x720d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x720d('0x3'));var config=require(_0x720d('0x4'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x5904d8,_0x23379b){return _0x5904d8['define'](_0x720d('0x5'),attributes,{'tableName':_0x720d('0x6'),'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 098b833..5413721 100644 --- a/server/api/jscriptyProject/jscriptyProject.rpc.js +++ b/server/api/jscriptyProject/jscriptyProject.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf4eb=['JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1fdff9,_0x4c4bf4){var _0x3d1b6e=function(_0x2fd0a8){while(--_0x2fd0a8){_0x1fdff9['push'](_0x1fdff9['shift']());}};_0x3d1b6e(++_0x4c4bf4);}(_0xf4eb,0xec));var _0xbf4e=function(_0x4e4619,_0x2bcbb6){_0x4e4619=_0x4e4619-0x0;var _0x352bbf=_0xf4eb[_0x4e4619];return _0x352bbf;};'use strict';var _=require(_0xbf4e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf4e('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbf4e('0x2'))(_0xbf4e('0x3'));var config=require(_0xbf4e('0x4'));var jayson=require(_0xbf4e('0x5'));var client=jayson[_0xbf4e('0x6')][_0xbf4e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b99f,_0x540736,_0x449d55){return new BPromise(function(_0x5013c2,_0x5e23d4){return client[_0xbf4e('0x8')](_0x15b99f,_0x449d55)[_0xbf4e('0x9')](function(_0xcc4097){logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));logger[_0xbf4e('0xd')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x540736,'request\x20sent',JSON[_0xbf4e('0xe')](_0xcc4097));if(_0xcc4097['error']){if(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x10')]===0x1f4){logger['error'](_0xbf4e('0xb'),_0x540736,_0xcc4097['error']['message']);return _0x5e23d4(_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);}logger[_0xbf4e('0xf')](_0xbf4e('0xb'),_0x540736,_0xcc4097[_0xbf4e('0xf')][_0xbf4e('0x11')]);return _0x5013c2(_0xcc4097['error']['message']);}else{logger[_0xbf4e('0xa')](_0xbf4e('0xb'),_0x540736,_0xbf4e('0xc'));_0x5013c2(_0xcc4097['result'][_0xbf4e('0x11')]);}})[_0xbf4e('0x12')](function(_0x912fc0){logger[_0xbf4e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x540736,_0x912fc0);_0x5e23d4(_0x912fc0);});});} \ No newline at end of file +var _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(_0x3c7c6a,_0x40e534){var _0x410dd5=function(_0x3b48ec){while(--_0x3b48ec){_0x3c7c6a['push'](_0x3c7c6a['shift']());}};_0x410dd5(++_0x40e534);}(_0x70e0,0x17b));var _0x070e=function(_0x4ae462,_0x104d40){_0x4ae462=_0x4ae462-0x0;var _0xc76eb4=_0x70e0[_0x4ae462];return _0xc76eb4;};'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 diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 1d8595b..9921681 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 _0xdc27=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyQuestionReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','create','put','update','destroy','util','path'];(function(_0x575bb5,_0x346d6e){var _0x32c1ec=function(_0x18ae3c){while(--_0x18ae3c){_0x575bb5['push'](_0x575bb5['shift']());}};_0x32c1ec(++_0x346d6e);}(_0xdc27,0x166));var _0x7dc2=function(_0x14c813,_0x3a3fb5){_0x14c813=_0x14c813-0x0;var _0x384758=_0xdc27[_0x14c813];return _0x384758;};'use strict';var multer=require('multer');var util=require(_0x7dc2('0x0'));var path=require(_0x7dc2('0x1'));var timeout=require(_0x7dc2('0x2'));var express=require(_0x7dc2('0x3'));var router=express[_0x7dc2('0x4')]();var fs_extra=require(_0x7dc2('0x5'));var auth=require(_0x7dc2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7dc2('0x7'));var controller=require(_0x7dc2('0x8'));router[_0x7dc2('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7dc2('0x9')](_0x7dc2('0xa'),auth['isAuthenticated'](),controller[_0x7dc2('0xb')]);router[_0x7dc2('0x9')](_0x7dc2('0xc'),auth[_0x7dc2('0xd')](),controller[_0x7dc2('0xe')]);router[_0x7dc2('0xf')]('/',auth[_0x7dc2('0xd')](),controller[_0x7dc2('0x10')]);router[_0x7dc2('0x11')]('/:id',auth[_0x7dc2('0xd')](),controller[_0x7dc2('0x12')]);router['delete'](_0x7dc2('0xc'),auth[_0x7dc2('0xd')](),controller[_0x7dc2('0x13')]);module['exports']=router; \ No newline at end of file +var _0x9e26=['destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2cbb91,_0x1e719e){var _0x570acf=function(_0x139863){while(--_0x139863){_0x2cbb91['push'](_0x2cbb91['shift']());}};_0x570acf(++_0x1e719e);}(_0x9e26,0xa4));var _0x69e2=function(_0x233fa3,_0x16a853){_0x233fa3=_0x233fa3-0x0;var _0x5f0b06=_0x9e26[_0x233fa3];return _0x5f0b06;};'use strict';var multer=require(_0x69e2('0x0'));var util=require('util');var path=require(_0x69e2('0x1'));var timeout=require('connect-timeout');var express=require(_0x69e2('0x2'));var router=express['Router']();var fs_extra=require(_0x69e2('0x3'));var auth=require(_0x69e2('0x4'));var interaction=require(_0x69e2('0x5'));var config=require(_0x69e2('0x6'));var controller=require(_0x69e2('0x7'));router[_0x69e2('0x8')]('/',auth[_0x69e2('0x9')](),controller[_0x69e2('0xa')]);router[_0x69e2('0x8')]('/describe',auth[_0x69e2('0x9')](),controller['describe']);router[_0x69e2('0x8')](_0x69e2('0xb'),auth[_0x69e2('0x9')](),controller[_0x69e2('0xc')]);router[_0x69e2('0xd')]('/',auth[_0x69e2('0x9')](),controller['create']);router[_0x69e2('0xe')](_0x69e2('0xb'),auth['isAuthenticated'](),controller[_0x69e2('0xf')]);router['delete'](_0x69e2('0xb'),auth['isAuthenticated'](),controller[_0x69e2('0x10')]);module[_0x69e2('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 196608e..58130d4 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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x3c6d71,_0xbf3a24){_0x3c6d71=_0x3c6d71-0x0;var _0x3169cd=_0x7a54[_0x3c6d71];return _0x3169cd;};'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(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x7a54,0x106));var _0x47a5=function(_0x5869ab,_0x272e09){_0x5869ab=_0x5869ab-0x0;var _0x4fd7c1=_0x7a54[_0x5869ab];return _0x4fd7c1;};'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 e1a62aa..5eff817 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 _0x3036=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','catch','show','params','rawAttributes','include','find','create','body','describe','eml-format','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service'];(function(_0x2a4498,_0x555022){var _0x3479b2=function(_0x343320){while(--_0x343320){_0x2a4498['push'](_0x2a4498['shift']());}};_0x3479b2(++_0x555022);}(_0x3036,0xce));var _0x6303=function(_0x5cb90c,_0x45bd24){_0x5cb90c=_0x5cb90c-0x0;var _0x41b397=_0x3036[_0x5cb90c];return _0x41b397;};'use strict';var emlformat=require(_0x6303('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6303('0x1'));var rp=require(_0x6303('0x2'));var moment=require(_0x6303('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6303('0x4'));var util=require('util');var path=require(_0x6303('0x5'));var sox=require(_0x6303('0x6'));var csv=require(_0x6303('0x7'));var ejs=require(_0x6303('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6303('0x9'));var squel=require(_0x6303('0xa'));var crypto=require(_0x6303('0xb'));var jsforce=require(_0x6303('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6303('0x7'));var querystring=require(_0x6303('0xd'));var Papa=require(_0x6303('0xe'));var Redis=require('ioredis');var authService=require(_0x6303('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6303('0x10'));var hardwareService=require(_0x6303('0x11'));var logger=require(_0x6303('0x12'))(_0x6303('0x13'));var utils=require(_0x6303('0x14'));var config=require(_0x6303('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40049d,_0x6c5aa3){_0x6c5aa3=_0x6c5aa3||0xcc;return function(_0x264c39){if(_0x264c39){return _0x40049d[_0x6303('0x16')](_0x6c5aa3);}return _0x40049d[_0x6303('0x17')](_0x6c5aa3)[_0x6303('0x18')]();};}function respondWithResult(_0x5996dd,_0x42580c){_0x42580c=_0x42580c||0xc8;return function(_0x155718){if(_0x155718){return _0x5996dd[_0x6303('0x17')](_0x42580c)['json'](_0x155718);}};}function respondWithFilteredResult(_0x540717,_0x33171a){return function(_0x47feb0){if(_0x47feb0){var _0x5b3831=typeof _0x33171a[_0x6303('0x19')]===_0x6303('0x1a')&&typeof _0x33171a[_0x6303('0x1b')]===_0x6303('0x1a');var _0x960f2f=_0x47feb0[_0x6303('0x1c')];var _0x31d252=_0x5b3831?0x0:_0x33171a[_0x6303('0x19')];var _0x35b8c5=_0x5b3831?_0x47feb0[_0x6303('0x1c')]:_0x33171a['offset']+_0x33171a[_0x6303('0x1b')];var _0x10ccb0;if(_0x35b8c5>=_0x960f2f){_0x35b8c5=_0x960f2f;_0x10ccb0=0xc8;}else{_0x10ccb0=0xce;}_0x540717[_0x6303('0x17')](_0x10ccb0);return _0x540717[_0x6303('0x1d')](_0x6303('0x1e'),_0x31d252+'-'+_0x35b8c5+'/'+_0x960f2f)['json'](_0x47feb0);}return null;};}function patchUpdates(_0x505f58){return function(_0x2c6c48){try{jsonpatch[_0x6303('0x1f')](_0x2c6c48,_0x505f58,!![]);}catch(_0x2b0253){return BPromise[_0x6303('0x20')](_0x2b0253);}return _0x2c6c48[_0x6303('0x21')]();};}function saveUpdates(_0x5f098b,_0x4f9103){return function(_0x1ffed9){if(_0x1ffed9){return _0x1ffed9[_0x6303('0x22')](_0x5f098b)[_0x6303('0x23')](function(_0x2b9a6d){return _0x2b9a6d;});}return null;};}function removeEntity(_0x595ec7,_0x2aec33){return function(_0x371f55){if(_0x371f55){return _0x371f55[_0x6303('0x24')]()[_0x6303('0x23')](function(){_0x595ec7[_0x6303('0x17')](0xcc)[_0x6303('0x18')]();});}};}function handleEntityNotFound(_0x209c51,_0x3eb8b1){return function(_0xe3d368){if(!_0xe3d368){_0x209c51[_0x6303('0x16')](0x194);}return _0xe3d368;};}function handleError(_0x298921,_0x12b8ab){_0x12b8ab=_0x12b8ab||0x1f4;return function(_0x8b4be1){logger[_0x6303('0x25')](_0x8b4be1[_0x6303('0x26')]);if(_0x8b4be1[_0x6303('0x27')]){delete _0x8b4be1[_0x6303('0x27')];}_0x298921[_0x6303('0x17')](_0x12b8ab)[_0x6303('0x28')](_0x8b4be1);};}exports[_0x6303('0x29')]=function(_0x59776f,_0x483c57){var _0xf2b9f7={},_0x4c7984={},_0x19dec4={'count':0x0,'rows':[]};var _0x1fbb7f=_[_0x6303('0x2a')](db[_0x6303('0x2b')]['rawAttributes'],function(_0xd2275b){return{'name':_0xd2275b[_0x6303('0x2c')],'type':_0xd2275b['type'][_0x6303('0x2d')]};});_0x4c7984[_0x6303('0x2e')]=_[_0x6303('0x2a')](_0x1fbb7f,_0x6303('0x27'));_0x4c7984[_0x6303('0x2f')]=_[_0x6303('0x30')](_0x59776f[_0x6303('0x2f')]);_0x4c7984[_0x6303('0x31')]=_[_0x6303('0x32')](_0x4c7984[_0x6303('0x2e')],_0x4c7984['query']);_0xf2b9f7[_0x6303('0x33')]=_[_0x6303('0x32')](_0x4c7984['model'],qs[_0x6303('0x34')](_0x59776f['query'][_0x6303('0x34')]));_0xf2b9f7['attributes']=_0xf2b9f7['attributes'][_0x6303('0x35')]?_0xf2b9f7[_0x6303('0x33')]:_0x4c7984[_0x6303('0x2e')];if(!_0x59776f['query']['hasOwnProperty'](_0x6303('0x36'))){_0xf2b9f7[_0x6303('0x1b')]=qs[_0x6303('0x1b')](_0x59776f[_0x6303('0x2f')][_0x6303('0x1b')]);_0xf2b9f7[_0x6303('0x19')]=qs[_0x6303('0x19')](_0x59776f[_0x6303('0x2f')]['offset']);}_0xf2b9f7[_0x6303('0x37')]=qs['sort'](_0x59776f[_0x6303('0x2f')][_0x6303('0x38')]);_0xf2b9f7['where']=qs['filters'](_[_0x6303('0x39')](_0x59776f['query'],_0x4c7984[_0x6303('0x31')]),_0x1fbb7f);if(_0x59776f[_0x6303('0x2f')][_0x6303('0x3a')]){_0xf2b9f7[_0x6303('0x3b')]=_[_0x6303('0x3c')](_0xf2b9f7[_0x6303('0x3b')],{'$or':_[_0x6303('0x2a')](_0x1fbb7f,function(_0x27cde8){if(_0x27cde8[_0x6303('0x3d')]!==_0x6303('0x3e')){var _0x18544f={};_0x18544f[_0x27cde8[_0x6303('0x27')]]={'$like':'%'+_0x59776f[_0x6303('0x2f')][_0x6303('0x3a')]+'%'};return _0x18544f;}})});}_0xf2b9f7=_[_0x6303('0x3c')]({},_0xf2b9f7,_0x59776f[_0x6303('0x3f')]);var _0x52b6ba={'where':_0xf2b9f7[_0x6303('0x3b')]};return db[_0x6303('0x2b')][_0x6303('0x1c')](_0x52b6ba)['then'](function(_0x322ac8){_0x19dec4[_0x6303('0x1c')]=_0x322ac8;if(_0x59776f[_0x6303('0x2f')][_0x6303('0x40')]){_0xf2b9f7['include']=[{'all':!![]}];}return db[_0x6303('0x2b')]['findAll'](_0xf2b9f7);})[_0x6303('0x23')](function(_0xa54068){_0x19dec4['rows']=_0xa54068;return _0x19dec4;})[_0x6303('0x23')](respondWithFilteredResult(_0x483c57,_0xf2b9f7))[_0x6303('0x41')](handleError(_0x483c57,null));};exports[_0x6303('0x42')]=function(_0x40bdbf,_0x4cbb39){var _0x875d61={'raw':!![],'where':{'id':_0x40bdbf[_0x6303('0x43')]['id']}},_0x591297={};_0x591297[_0x6303('0x2e')]=_[_0x6303('0x30')](db[_0x6303('0x2b')][_0x6303('0x44')]);_0x591297[_0x6303('0x2f')]=_[_0x6303('0x30')](_0x40bdbf[_0x6303('0x2f')]);_0x591297[_0x6303('0x31')]=_['intersection'](_0x591297['model'],_0x591297[_0x6303('0x2f')]);_0x875d61['attributes']=_['intersection'](_0x591297['model'],qs['fields'](_0x40bdbf[_0x6303('0x2f')][_0x6303('0x34')]));_0x875d61[_0x6303('0x33')]=_0x875d61[_0x6303('0x33')][_0x6303('0x35')]?_0x875d61['attributes']:_0x591297[_0x6303('0x2e')];if(_0x40bdbf[_0x6303('0x2f')][_0x6303('0x40')]){_0x875d61[_0x6303('0x45')]=[{'all':!![]}];}_0x875d61=_[_0x6303('0x3c')]({},_0x875d61,_0x40bdbf[_0x6303('0x3f')]);return db[_0x6303('0x2b')][_0x6303('0x46')](_0x875d61)['then'](handleEntityNotFound(_0x4cbb39,null))[_0x6303('0x23')](respondWithResult(_0x4cbb39,null))['catch'](handleError(_0x4cbb39,null));};exports[_0x6303('0x47')]=function(_0x3b7ccd,_0x4968ee){return db[_0x6303('0x2b')]['create'](_0x3b7ccd['body'],{})[_0x6303('0x23')](respondWithResult(_0x4968ee,0xc9))[_0x6303('0x41')](handleError(_0x4968ee,null));};exports[_0x6303('0x22')]=function(_0x5bd151,_0x4065cf){if(_0x5bd151[_0x6303('0x48')]['id']){delete _0x5bd151[_0x6303('0x48')]['id'];}return db[_0x6303('0x2b')][_0x6303('0x46')]({'where':{'id':_0x5bd151[_0x6303('0x43')]['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x4065cf,null))[_0x6303('0x23')](saveUpdates(_0x5bd151[_0x6303('0x48')],null))[_0x6303('0x23')](respondWithResult(_0x4065cf,null))[_0x6303('0x41')](handleError(_0x4065cf,null));};exports['destroy']=function(_0x447213,_0x52512f){return db[_0x6303('0x2b')][_0x6303('0x46')]({'where':{'id':_0x447213[_0x6303('0x43')]['id']}})[_0x6303('0x23')](handleEntityNotFound(_0x52512f,null))[_0x6303('0x23')](removeEntity(_0x52512f,null))[_0x6303('0x41')](handleError(_0x52512f,null));};exports[_0x6303('0x49')]=function(_0x125ae3,_0x11ec62){return db['JscriptyQuestionReport'][_0x6303('0x49')]()[_0x6303('0x23')](respondWithResult(_0x11ec62,null))['catch'](handleError(_0x11ec62,null));}; \ No newline at end of file +var _0xb67a=['index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','find','create','body','catch','destroy','describe','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send'];(function(_0x4d0d10,_0x5638d1){var _0x2a3db1=function(_0x201542){while(--_0x201542){_0x4d0d10['push'](_0x4d0d10['shift']());}};_0x2a3db1(++_0x5638d1);}(_0xb67a,0x10a));var _0xab67=function(_0x2237be,_0x2ed5c1){_0x2237be=_0x2237be-0x0;var _0x3312ab=_0xb67a[_0x2237be];return _0x3312ab;};'use strict';var emlformat=require(_0xab67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xab67('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab67('0x2'));var moment=require(_0xab67('0x3'));var BPromise=require(_0xab67('0x4'));var Mustache=require(_0xab67('0x5'));var util=require('util');var path=require(_0xab67('0x6'));var sox=require(_0xab67('0x7'));var csv=require(_0xab67('0x8'));var ejs=require(_0xab67('0x9'));var fs=require('fs');var fs_extra=require(_0xab67('0xa'));var _=require(_0xab67('0xb'));var squel=require(_0xab67('0xc'));var crypto=require('crypto');var jsforce=require(_0xab67('0xd'));var deskjs=require(_0xab67('0xe'));var toCsv=require(_0xab67('0x8'));var querystring=require(_0xab67('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xab67('0x10'));var qs=require(_0xab67('0x11'));var as=require(_0xab67('0x12'));var hardwareService=require(_0xab67('0x13'));var logger=require(_0xab67('0x14'))(_0xab67('0x15'));var utils=require(_0xab67('0x16'));var config=require(_0xab67('0x17'));var licenseUtil=require(_0xab67('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a49c2,_0x4753b4){_0x4753b4=_0x4753b4||0xcc;return function(_0x3984f3){if(_0x3984f3){return _0x4a49c2['sendStatus'](_0x4753b4);}return _0x4a49c2[_0xab67('0x19')](_0x4753b4)[_0xab67('0x1a')]();};}function respondWithResult(_0x3c49b7,_0x39571c){_0x39571c=_0x39571c||0xc8;return function(_0x1e4dab){if(_0x1e4dab){return _0x3c49b7[_0xab67('0x19')](_0x39571c)[_0xab67('0x1b')](_0x1e4dab);}};}function respondWithFilteredResult(_0x4ec3e2,_0x148470){return function(_0x519f3e){if(_0x519f3e){var _0x37afbb=typeof _0x148470[_0xab67('0x1c')]===_0xab67('0x1d')&&typeof _0x148470['limit']===_0xab67('0x1d');var _0xd9c8c2=_0x519f3e[_0xab67('0x1e')];var _0x17e74d=_0x37afbb?0x0:_0x148470[_0xab67('0x1c')];var _0x3e018d=_0x37afbb?_0x519f3e[_0xab67('0x1e')]:_0x148470[_0xab67('0x1c')]+_0x148470['limit'];var _0x860aa5;if(_0x3e018d>=_0xd9c8c2){_0x3e018d=_0xd9c8c2;_0x860aa5=0xc8;}else{_0x860aa5=0xce;}_0x4ec3e2[_0xab67('0x19')](_0x860aa5);return _0x4ec3e2[_0xab67('0x1f')](_0xab67('0x20'),_0x17e74d+'-'+_0x3e018d+'/'+_0xd9c8c2)['json'](_0x519f3e);}return null;};}function patchUpdates(_0xa47516){return function(_0x58e3ac){try{jsonpatch[_0xab67('0x21')](_0x58e3ac,_0xa47516,!![]);}catch(_0x6d86f9){return BPromise[_0xab67('0x22')](_0x6d86f9);}return _0x58e3ac[_0xab67('0x23')]();};}function saveUpdates(_0x470ac7,_0x1da8df){return function(_0x5b08f8){if(_0x5b08f8){return _0x5b08f8[_0xab67('0x24')](_0x470ac7)[_0xab67('0x25')](function(_0x1d66b4){return _0x1d66b4;});}return null;};}function removeEntity(_0x16c3e3,_0x585835){return function(_0x2006eb){if(_0x2006eb){return _0x2006eb['destroy']()['then'](function(){_0x16c3e3[_0xab67('0x19')](0xcc)[_0xab67('0x1a')]();});}};}function handleEntityNotFound(_0x3ecc8f,_0x571575){return function(_0x4153d2){if(!_0x4153d2){_0x3ecc8f[_0xab67('0x26')](0x194);}return _0x4153d2;};}function handleError(_0x4ce1cc,_0x32236a){_0x32236a=_0x32236a||0x1f4;return function(_0x3b6f04){logger['error'](_0x3b6f04[_0xab67('0x27')]);if(_0x3b6f04[_0xab67('0x28')]){delete _0x3b6f04[_0xab67('0x28')];}_0x4ce1cc['status'](_0x32236a)[_0xab67('0x29')](_0x3b6f04);};}exports[_0xab67('0x2a')]=function(_0x193674,_0x3d4667){var _0xc07279={},_0x416df9={},_0x4d1253={'count':0x0,'rows':[]};var _0x109c51=_[_0xab67('0x2b')](db[_0xab67('0x2c')][_0xab67('0x2d')],function(_0x854977){return{'name':_0x854977[_0xab67('0x2e')],'type':_0x854977[_0xab67('0x2f')]['key']};});_0x416df9[_0xab67('0x30')]=_[_0xab67('0x2b')](_0x109c51,_0xab67('0x28'));_0x416df9[_0xab67('0x31')]=_[_0xab67('0x32')](_0x193674['query']);_0x416df9[_0xab67('0x33')]=_[_0xab67('0x34')](_0x416df9[_0xab67('0x30')],_0x416df9['query']);_0xc07279[_0xab67('0x35')]=_[_0xab67('0x34')](_0x416df9['model'],qs['fields'](_0x193674[_0xab67('0x31')][_0xab67('0x36')]));_0xc07279[_0xab67('0x35')]=_0xc07279[_0xab67('0x35')][_0xab67('0x37')]?_0xc07279[_0xab67('0x35')]:_0x416df9[_0xab67('0x30')];if(!_0x193674[_0xab67('0x31')]['hasOwnProperty'](_0xab67('0x38'))){_0xc07279[_0xab67('0x39')]=qs[_0xab67('0x39')](_0x193674['query'][_0xab67('0x39')]);_0xc07279['offset']=qs['offset'](_0x193674['query'][_0xab67('0x1c')]);}_0xc07279[_0xab67('0x3a')]=qs[_0xab67('0x3b')](_0x193674['query'][_0xab67('0x3b')]);_0xc07279['where']=qs['filters'](_[_0xab67('0x3c')](_0x193674['query'],_0x416df9[_0xab67('0x33')]),_0x109c51);if(_0x193674[_0xab67('0x31')]['filter']){_0xc07279[_0xab67('0x3d')]=_[_0xab67('0x3e')](_0xc07279[_0xab67('0x3d')],{'$or':_[_0xab67('0x2b')](_0x109c51,function(_0x7306cf){if(_0x7306cf[_0xab67('0x2f')]!==_0xab67('0x3f')){var _0x6d8741={};_0x6d8741[_0x7306cf[_0xab67('0x28')]]={'$like':'%'+_0x193674['query'][_0xab67('0x40')]+'%'};return _0x6d8741;}})});}_0xc07279=_[_0xab67('0x3e')]({},_0xc07279,_0x193674['options']);var _0x5d75d0={'where':_0xc07279[_0xab67('0x3d')]};return db[_0xab67('0x2c')]['count'](_0x5d75d0)['then'](function(_0xc4a366){_0x4d1253['count']=_0xc4a366;if(_0x193674[_0xab67('0x31')][_0xab67('0x41')]){_0xc07279[_0xab67('0x42')]=[{'all':!![]}];}return db[_0xab67('0x2c')][_0xab67('0x43')](_0xc07279);})[_0xab67('0x25')](function(_0x31aceb){_0x4d1253[_0xab67('0x44')]=_0x31aceb;return _0x4d1253;})[_0xab67('0x25')](respondWithFilteredResult(_0x3d4667,_0xc07279))['catch'](handleError(_0x3d4667,null));};exports[_0xab67('0x45')]=function(_0x232eff,_0x1be6cc){var _0x25b9bc={'raw':!![],'where':{'id':_0x232eff[_0xab67('0x46')]['id']}},_0x35bf93={};_0x35bf93['model']=_[_0xab67('0x32')](db['JscriptyQuestionReport'][_0xab67('0x2d')]);_0x35bf93['query']=_[_0xab67('0x32')](_0x232eff[_0xab67('0x31')]);_0x35bf93[_0xab67('0x33')]=_[_0xab67('0x34')](_0x35bf93[_0xab67('0x30')],_0x35bf93[_0xab67('0x31')]);_0x25b9bc[_0xab67('0x35')]=_['intersection'](_0x35bf93[_0xab67('0x30')],qs['fields'](_0x232eff[_0xab67('0x31')]['fields']));_0x25b9bc['attributes']=_0x25b9bc[_0xab67('0x35')][_0xab67('0x37')]?_0x25b9bc[_0xab67('0x35')]:_0x35bf93[_0xab67('0x30')];if(_0x232eff[_0xab67('0x31')][_0xab67('0x41')]){_0x25b9bc[_0xab67('0x42')]=[{'all':!![]}];}_0x25b9bc=_[_0xab67('0x3e')]({},_0x25b9bc,_0x232eff['options']);return db[_0xab67('0x2c')][_0xab67('0x47')](_0x25b9bc)[_0xab67('0x25')](handleEntityNotFound(_0x1be6cc,null))[_0xab67('0x25')](respondWithResult(_0x1be6cc,null))['catch'](handleError(_0x1be6cc,null));};exports[_0xab67('0x48')]=function(_0x98dcb9,_0x36595a){return db[_0xab67('0x2c')][_0xab67('0x48')](_0x98dcb9[_0xab67('0x49')],{})['then'](respondWithResult(_0x36595a,0xc9))[_0xab67('0x4a')](handleError(_0x36595a,null));};exports[_0xab67('0x24')]=function(_0x166c8a,_0x451e81){if(_0x166c8a[_0xab67('0x49')]['id']){delete _0x166c8a[_0xab67('0x49')]['id'];}return db[_0xab67('0x2c')][_0xab67('0x47')]({'where':{'id':_0x166c8a['params']['id']}})['then'](handleEntityNotFound(_0x451e81,null))[_0xab67('0x25')](saveUpdates(_0x166c8a[_0xab67('0x49')],null))[_0xab67('0x25')](respondWithResult(_0x451e81,null))[_0xab67('0x4a')](handleError(_0x451e81,null));};exports[_0xab67('0x4b')]=function(_0x50215d,_0x1da182){return db['JscriptyQuestionReport'][_0xab67('0x47')]({'where':{'id':_0x50215d[_0xab67('0x46')]['id']}})[_0xab67('0x25')](handleEntityNotFound(_0x1da182,null))[_0xab67('0x25')](removeEntity(_0x1da182,null))['catch'](handleError(_0x1da182,null));};exports[_0xab67('0x4c')]=function(_0x4167f3,_0x284655){return db[_0xab67('0x2c')]['describe']()[_0xab67('0x25')](respondWithResult(_0x284655,null))[_0xab67('0x4a')](handleError(_0x284655,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 4c78a5d..f46b7fd 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 _0xd4e4=['request-promise','rimraf','./jscriptyQuestionReport.attributes','exports','JscriptyQuestionReport','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xd4e4,0x191));var _0x4d4e=function(_0x58067b,_0x463dc0){_0x58067b=_0x58067b-0x0;var _0x35c2a1=_0xd4e4[_0x58067b];return _0x35c2a1;};'use strict';var _=require(_0x4d4e('0x0'));var util=require(_0x4d4e('0x1'));var logger=require(_0x4d4e('0x2'))(_0x4d4e('0x3'));var moment=require(_0x4d4e('0x4'));var BPromise=require(_0x4d4e('0x5'));var rp=require(_0x4d4e('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4d4e('0x7'));var config=require('../../config/environment');var attributes=require(_0x4d4e('0x8'));module[_0x4d4e('0x9')]=function(_0x54c67d,_0x48ae34){return _0x54c67d['define'](_0x4d4e('0xa'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x254c=['JscriptyQuestionReport','report_jscripty_questions','lodash','../../config/logger','api','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','define'];(function(_0x5c9c18,_0x433870){var _0x2e3040=function(_0x22a8a5){while(--_0x22a8a5){_0x5c9c18['push'](_0x5c9c18['shift']());}};_0x2e3040(++_0x433870);}(_0x254c,0x106));var _0xc254=function(_0x55daed,_0x892a6d){_0x55daed=_0x55daed-0x0;var _0x5d5451=_0x254c[_0x55daed];return _0x5d5451;};'use strict';var _=require(_0xc254('0x0'));var util=require('util');var logger=require(_0xc254('0x1'))(_0xc254('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc254('0x3'));var rimraf=require(_0xc254('0x4'));var config=require(_0xc254('0x5'));var attributes=require(_0xc254('0x6'));module['exports']=function(_0x5da7f9,_0x424ba3){return _0x5da7f9[_0xc254('0x7')](_0xc254('0x8'),attributes,{'tableName':_0xc254('0x9'),'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 0bc8168..2617de6 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 _0xf405=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result'];(function(_0x328bd3,_0x9cf5a5){var _0x458149=function(_0x3f60d9){while(--_0x3f60d9){_0x328bd3['push'](_0x328bd3['shift']());}};_0x458149(++_0x9cf5a5);}(_0xf405,0x191));var _0x5f40=function(_0x4da88d,_0x602ec7){_0x4da88d=_0x4da88d-0x0;var _0x22a265=_0xf405[_0x4da88d];return _0x22a265;};'use strict';var _=require(_0x5f40('0x0'));var util=require('util');var moment=require(_0x5f40('0x1'));var BPromise=require(_0x5f40('0x2'));var rs=require(_0x5f40('0x3'));var fs=require('fs');var Redis=require(_0x5f40('0x4'));var db=require(_0x5f40('0x5'))['db'];var utils=require(_0x5f40('0x6'));var logger=require(_0x5f40('0x7'))(_0x5f40('0x8'));var config=require(_0x5f40('0x9'));var jayson=require(_0x5f40('0xa'));var client=jayson[_0x5f40('0xb')][_0x5f40('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd750c5,_0x414ec7,_0x19f846){return new BPromise(function(_0x36b107,_0x2dad4f){return client[_0x5f40('0xd')](_0xd750c5,_0x19f846)[_0x5f40('0xe')](function(_0x4307b3){logger[_0x5f40('0xf')](_0x5f40('0x10'),_0x414ec7,'request\x20sent');logger[_0x5f40('0x11')](_0x5f40('0x12'),_0x414ec7,_0x5f40('0x13'),JSON['stringify'](_0x4307b3));if(_0x4307b3[_0x5f40('0x14')]){if(_0x4307b3[_0x5f40('0x14')][_0x5f40('0x15')]===0x1f4){logger[_0x5f40('0x14')](_0x5f40('0x10'),_0x414ec7,_0x4307b3[_0x5f40('0x14')][_0x5f40('0x16')]);return _0x2dad4f(_0x4307b3[_0x5f40('0x14')][_0x5f40('0x16')]);}logger['error'](_0x5f40('0x10'),_0x414ec7,_0x4307b3[_0x5f40('0x14')][_0x5f40('0x16')]);return _0x36b107(_0x4307b3['error']['message']);}else{logger[_0x5f40('0xf')](_0x5f40('0x10'),_0x414ec7,_0x5f40('0x13'));_0x36b107(_0x4307b3[_0x5f40('0x17')][_0x5f40('0x16')]);}})[_0x5f40('0x18')](function(_0x132503){logger[_0x5f40('0x14')](_0x5f40('0x10'),_0x414ec7,_0x132503);_0x2dad4f(_0x132503);});});} \ No newline at end of file +var _0xd0e3=['http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xd65c05,_0x11e746){var _0x2932f4=function(_0xa5bdab){while(--_0xa5bdab){_0xd65c05['push'](_0xd65c05['shift']());}};_0x2932f4(++_0x11e746);}(_0xd0e3,0x185));var _0x3d0e=function(_0xc9edd4,_0x193a14){_0xc9edd4=_0xc9edd4-0x0;var _0x43185c=_0xd0e3[_0xc9edd4];return _0x43185c;};'use strict';var _=require(_0x3d0e('0x0'));var util=require(_0x3d0e('0x1'));var moment=require('moment');var BPromise=require(_0x3d0e('0x2'));var rs=require(_0x3d0e('0x3'));var fs=require('fs');var Redis=require(_0x3d0e('0x4'));var db=require(_0x3d0e('0x5'))['db'];var utils=require(_0x3d0e('0x6'));var logger=require(_0x3d0e('0x7'))(_0x3d0e('0x8'));var config=require('../../config/environment');var jayson=require(_0x3d0e('0x9'));var client=jayson['client'][_0x3d0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1164ae,_0x3ce684,_0x3b272c){return new BPromise(function(_0x46030f,_0x3ecef4){return client[_0x3d0e('0xb')](_0x1164ae,_0x3b272c)['then'](function(_0x32d230){logger[_0x3d0e('0xc')](_0x3d0e('0xd'),_0x3ce684,_0x3d0e('0xe'));logger[_0x3d0e('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x3ce684,'request\x20sent',JSON[_0x3d0e('0x10')](_0x32d230));if(_0x32d230['error']){if(_0x32d230[_0x3d0e('0x11')][_0x3d0e('0x12')]===0x1f4){logger[_0x3d0e('0x11')](_0x3d0e('0xd'),_0x3ce684,_0x32d230['error'][_0x3d0e('0x13')]);return _0x3ecef4(_0x32d230[_0x3d0e('0x11')][_0x3d0e('0x13')]);}logger['error'](_0x3d0e('0xd'),_0x3ce684,_0x32d230[_0x3d0e('0x11')][_0x3d0e('0x13')]);return _0x46030f(_0x32d230['error'][_0x3d0e('0x13')]);}else{logger[_0x3d0e('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x3ce684,_0x3d0e('0xe'));_0x46030f(_0x32d230[_0x3d0e('0x14')][_0x3d0e('0x13')]);}})['catch'](function(_0xb1bfbb){logger[_0x3d0e('0x11')](_0x3d0e('0xd'),_0x3ce684,_0xb1bfbb);_0x3ecef4(_0xb1bfbb);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8e57896..9b83425 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 _0xd355=['./jscriptySessionReport.controller','get','index','/describe','describe','/:id','isAuthenticated','show','getQuestions','post','create','put','update','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x40f1f7,_0x672727){var _0x569c14=function(_0x2e62d2){while(--_0x2e62d2){_0x40f1f7['push'](_0x40f1f7['shift']());}};_0x569c14(++_0x672727);}(_0xd355,0xdd));var _0x5d35=function(_0x54f4f5,_0x245d1d){_0x54f4f5=_0x54f4f5-0x0;var _0x1ab06d=_0xd355[_0x54f4f5];return _0x1ab06d;};'use strict';var multer=require(_0x5d35('0x0'));var util=require(_0x5d35('0x1'));var path=require(_0x5d35('0x2'));var timeout=require(_0x5d35('0x3'));var express=require(_0x5d35('0x4'));var router=express[_0x5d35('0x5')]();var fs_extra=require(_0x5d35('0x6'));var auth=require(_0x5d35('0x7'));var interaction=require(_0x5d35('0x8'));var config=require('../../config/environment');var controller=require(_0x5d35('0x9'));router[_0x5d35('0xa')]('/',auth['isAuthenticated'](),controller[_0x5d35('0xb')]);router['get'](_0x5d35('0xc'),auth['isAuthenticated'](),controller[_0x5d35('0xd')]);router['get'](_0x5d35('0xe'),auth[_0x5d35('0xf')](),controller[_0x5d35('0x10')]);router['get']('/:id/questions',auth[_0x5d35('0xf')](),controller[_0x5d35('0x11')]);router[_0x5d35('0x12')]('/',auth[_0x5d35('0xf')](),controller[_0x5d35('0x13')]);router[_0x5d35('0x14')](_0x5d35('0xe'),auth[_0x5d35('0xf')](),controller[_0x5d35('0x15')]);router['delete']('/:id',auth[_0x5d35('0xf')](),controller[_0x5d35('0x16')]);module['exports']=router; \ No newline at end of file +var _0xcc15=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/questions','getQuestions','post','put','delete','destroy','exports','multer'];(function(_0x2d0953,_0x30bcf9){var _0x1e824a=function(_0x4ec9f1){while(--_0x4ec9f1){_0x2d0953['push'](_0x2d0953['shift']());}};_0x1e824a(++_0x30bcf9);}(_0xcc15,0x137));var _0x5cc1=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xcc15[_0x46e363];return _0x3fb059;};'use strict';var multer=require(_0x5cc1('0x0'));var util=require(_0x5cc1('0x1'));var path=require(_0x5cc1('0x2'));var timeout=require(_0x5cc1('0x3'));var express=require(_0x5cc1('0x4'));var router=express[_0x5cc1('0x5')]();var fs_extra=require(_0x5cc1('0x6'));var auth=require(_0x5cc1('0x7'));var interaction=require(_0x5cc1('0x8'));var config=require(_0x5cc1('0x9'));var controller=require('./jscriptySessionReport.controller');router[_0x5cc1('0xa')]('/',auth[_0x5cc1('0xb')](),controller[_0x5cc1('0xc')]);router[_0x5cc1('0xa')](_0x5cc1('0xd'),auth[_0x5cc1('0xb')](),controller[_0x5cc1('0xe')]);router[_0x5cc1('0xa')](_0x5cc1('0xf'),auth[_0x5cc1('0xb')](),controller[_0x5cc1('0x10')]);router[_0x5cc1('0xa')](_0x5cc1('0x11'),auth[_0x5cc1('0xb')](),controller[_0x5cc1('0x12')]);router[_0x5cc1('0x13')]('/',auth[_0x5cc1('0xb')](),controller['create']);router[_0x5cc1('0x14')](_0x5cc1('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x5cc1('0x15')](_0x5cc1('0xf'),auth['isAuthenticated'](),controller[_0x5cc1('0x16')]);module[_0x5cc1('0x17')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 7796db4..6cd6fe7 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 _0x2162=['format','DATE','STRING','moment','sequelize','endtime'];(function(_0x5dcadc,_0x385caf){var _0x2eb116=function(_0xf9e557){while(--_0xf9e557){_0x5dcadc['push'](_0x5dcadc['shift']());}};_0x2eb116(++_0x385caf);}(_0x2162,0x1d1));var _0x2216=function(_0x3e18e8,_0x3e1a25){_0x3e18e8=_0x3e18e8-0x0;var _0xd23fae=_0x2162[_0x3e18e8];return _0xd23fae;};'use strict';var moment=require(_0x2216('0x0'));var Sequelize=require(_0x2216('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x3d116c){this['setDataValue']('starttime',_0x3d116c);this['setDataValue'](_0x2216('0x2'),moment()[_0x2216('0x3')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x2216('0x4')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x2216('0x5')]},'queue':{'type':Sequelize[_0x2216('0x5')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x2216('0x5')]},'calleridnum':{'type':Sequelize[_0x2216('0x5')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf418=['BOOLEAN','moment','sequelize','setDataValue','starttime','endtime','format','DATE','STRING'];(function(_0x4ec3b2,_0x4ac15f){var _0x3177ce=function(_0x925de5){while(--_0x925de5){_0x4ec3b2['push'](_0x4ec3b2['shift']());}};_0x3177ce(++_0x4ac15f);}(_0xf418,0x157));var _0x8f41=function(_0x51ca00,_0x5bee63){_0x51ca00=_0x51ca00-0x0;var _0x3f89a4=_0xf418[_0x51ca00];return _0x3f89a4;};'use strict';var moment=require(_0x8f41('0x0'));var Sequelize=require(_0x8f41('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x41baec){this[_0x8f41('0x2')](_0x8f41('0x3'),_0x41baec);this['setDataValue'](_0x8f41('0x4'),moment()[_0x8f41('0x5')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x8f41('0x6')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x8f41('0x7')]},'queue':{'type':Sequelize[_0x8f41('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8f41('0x7')]},'calleridnum':{'type':Sequelize[_0x8f41('0x7')]},'completed':{'type':Sequelize[_0x8f41('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 8a55241..0add75c 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 _0x9988=['save','then','end','stack','name','send','index','JscriptySessionReport','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','params','find','catch','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','rawAttributes','SessionId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply'];(function(_0x3ad5fa,_0x1972c1){var _0x56f98e=function(_0x5eb671){while(--_0x5eb671){_0x3ad5fa['push'](_0x3ad5fa['shift']());}};_0x56f98e(++_0x1972c1);}(_0x9988,0x1a6));var _0x8998=function(_0x534185,_0x1e880f){_0x534185=_0x534185-0x0;var _0xd10ee2=_0x9988[_0x534185];return _0xd10ee2;};'use strict';var emlformat=require(_0x8998('0x0'));var rimraf=require(_0x8998('0x1'));var zipdir=require(_0x8998('0x2'));var jsonpatch=require(_0x8998('0x3'));var rp=require(_0x8998('0x4'));var moment=require(_0x8998('0x5'));var BPromise=require(_0x8998('0x6'));var Mustache=require(_0x8998('0x7'));var util=require(_0x8998('0x8'));var path=require('path');var sox=require(_0x8998('0x9'));var csv=require(_0x8998('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8998('0xb'));var _=require(_0x8998('0xc'));var squel=require(_0x8998('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8998('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8998('0xf'));var Redis=require(_0x8998('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8998('0x11'));var as=require(_0x8998('0x12'));var hardwareService=require(_0x8998('0x13'));var logger=require(_0x8998('0x14'))('api');var utils=require(_0x8998('0x15'));var config=require(_0x8998('0x16'));var licenseUtil=require(_0x8998('0x17'));var db=require(_0x8998('0x18'))['db'];function respondWithStatusCode(_0x2efb2b,_0x528362){_0x528362=_0x528362||0xcc;return function(_0x3a2948){if(_0x3a2948){return _0x2efb2b[_0x8998('0x19')](_0x528362);}return _0x2efb2b['status'](_0x528362)['end']();};}function respondWithResult(_0x10fecb,_0x303596){_0x303596=_0x303596||0xc8;return function(_0x494ac5){if(_0x494ac5){return _0x10fecb[_0x8998('0x1a')](_0x303596)[_0x8998('0x1b')](_0x494ac5);}};}function respondWithFilteredResult(_0x52bdd4,_0x47d49e){return function(_0xfc371){if(_0xfc371){var _0x459eed=typeof _0x47d49e['offset']===_0x8998('0x1c')&&typeof _0x47d49e['limit']==='undefined';var _0x6d4966=_0xfc371[_0x8998('0x1d')];var _0x149977=_0x459eed?0x0:_0x47d49e[_0x8998('0x1e')];var _0x1abd0f=_0x459eed?_0xfc371['count']:_0x47d49e[_0x8998('0x1e')]+_0x47d49e[_0x8998('0x1f')];var _0x4aac22;if(_0x1abd0f>=_0x6d4966){_0x1abd0f=_0x6d4966;_0x4aac22=0xc8;}else{_0x4aac22=0xce;}_0x52bdd4[_0x8998('0x1a')](_0x4aac22);return _0x52bdd4['set'](_0x8998('0x20'),_0x149977+'-'+_0x1abd0f+'/'+_0x6d4966)[_0x8998('0x1b')](_0xfc371);}return null;};}function patchUpdates(_0x1ecf5c){return function(_0x35d680){try{jsonpatch[_0x8998('0x21')](_0x35d680,_0x1ecf5c,!![]);}catch(_0x5652db){return BPromise['reject'](_0x5652db);}return _0x35d680[_0x8998('0x22')]();};}function saveUpdates(_0x509bb4,_0x43cde3){return function(_0x4602fd){if(_0x4602fd){return _0x4602fd['update'](_0x509bb4)[_0x8998('0x23')](function(_0x3d0d21){return _0x3d0d21;});}return null;};}function removeEntity(_0x35c42d,_0x156fb4){return function(_0x565e38){if(_0x565e38){return _0x565e38['destroy']()[_0x8998('0x23')](function(){_0x35c42d['status'](0xcc)[_0x8998('0x24')]();});}};}function handleEntityNotFound(_0x3c6d8b,_0x542ce9){return function(_0x42ef4d){if(!_0x42ef4d){_0x3c6d8b[_0x8998('0x19')](0x194);}return _0x42ef4d;};}function handleError(_0x1333c7,_0x3ab688){_0x3ab688=_0x3ab688||0x1f4;return function(_0x238c87){logger['error'](_0x238c87[_0x8998('0x25')]);if(_0x238c87[_0x8998('0x26')]){delete _0x238c87[_0x8998('0x26')];}_0x1333c7[_0x8998('0x1a')](_0x3ab688)[_0x8998('0x27')](_0x238c87);};}exports[_0x8998('0x28')]=function(_0x3fbe46,_0x5e15bd){var _0x272ad9={},_0x48af14={},_0x1cb894={'count':0x0,'rows':[]};var _0x1581b0=_['map'](db[_0x8998('0x29')]['rawAttributes'],function(_0x4a911e){return{'name':_0x4a911e['fieldName'],'type':_0x4a911e['type'][_0x8998('0x2a')]};});_0x48af14[_0x8998('0x2b')]=_[_0x8998('0x2c')](_0x1581b0,'name');_0x48af14[_0x8998('0x2d')]=_[_0x8998('0x2e')](_0x3fbe46[_0x8998('0x2d')]);_0x48af14[_0x8998('0x2f')]=_[_0x8998('0x30')](_0x48af14[_0x8998('0x2b')],_0x48af14[_0x8998('0x2d')]);_0x272ad9['attributes']=_[_0x8998('0x30')](_0x48af14[_0x8998('0x2b')],qs['fields'](_0x3fbe46[_0x8998('0x2d')][_0x8998('0x31')]));_0x272ad9[_0x8998('0x32')]=_0x272ad9['attributes']['length']?_0x272ad9[_0x8998('0x32')]:_0x48af14[_0x8998('0x2b')];if(!_0x3fbe46[_0x8998('0x2d')][_0x8998('0x33')](_0x8998('0x34'))){_0x272ad9[_0x8998('0x1f')]=qs['limit'](_0x3fbe46[_0x8998('0x2d')][_0x8998('0x1f')]);_0x272ad9['offset']=qs[_0x8998('0x1e')](_0x3fbe46[_0x8998('0x2d')]['offset']);}_0x272ad9[_0x8998('0x35')]=qs['sort'](_0x3fbe46[_0x8998('0x2d')][_0x8998('0x36')]);_0x272ad9['where']=qs[_0x8998('0x2f')](_[_0x8998('0x37')](_0x3fbe46['query'],_0x48af14[_0x8998('0x2f')]),_0x1581b0);if(_0x3fbe46[_0x8998('0x2d')][_0x8998('0x38')]){_0x272ad9['where']=_[_0x8998('0x39')](_0x272ad9[_0x8998('0x3a')],{'$or':_[_0x8998('0x2c')](_0x1581b0,function(_0x4f51f3){if(_0x4f51f3[_0x8998('0x3b')]!==_0x8998('0x3c')){var _0xc8b95a={};_0xc8b95a[_0x4f51f3['name']]={'$like':'%'+_0x3fbe46[_0x8998('0x2d')][_0x8998('0x38')]+'%'};return _0xc8b95a;}})});}_0x272ad9=_[_0x8998('0x39')]({},_0x272ad9,_0x3fbe46[_0x8998('0x3d')]);var _0xf919fe={'where':_0x272ad9['where']};return db[_0x8998('0x29')]['count'](_0xf919fe)['then'](function(_0x68b2f4){_0x1cb894['count']=_0x68b2f4;if(_0x3fbe46[_0x8998('0x2d')][_0x8998('0x3e')]){_0x272ad9[_0x8998('0x3f')]=[{'all':!![]}];}return db[_0x8998('0x29')]['findAll'](_0x272ad9);})[_0x8998('0x23')](function(_0x4f8402){_0x1cb894[_0x8998('0x40')]=_0x4f8402;return _0x1cb894;})[_0x8998('0x23')](respondWithFilteredResult(_0x5e15bd,_0x272ad9))['catch'](handleError(_0x5e15bd,null));};exports['show']=function(_0x5b20e8,_0x18dae5){var _0x4366bc={'raw':!![],'where':{'id':_0x5b20e8[_0x8998('0x41')]['id']}},_0x468446={};_0x468446[_0x8998('0x2b')]=_[_0x8998('0x2e')](db[_0x8998('0x29')]['rawAttributes']);_0x468446[_0x8998('0x2d')]=_[_0x8998('0x2e')](_0x5b20e8[_0x8998('0x2d')]);_0x468446[_0x8998('0x2f')]=_['intersection'](_0x468446['model'],_0x468446[_0x8998('0x2d')]);_0x4366bc[_0x8998('0x32')]=_[_0x8998('0x30')](_0x468446[_0x8998('0x2b')],qs[_0x8998('0x31')](_0x5b20e8['query'][_0x8998('0x31')]));_0x4366bc[_0x8998('0x32')]=_0x4366bc[_0x8998('0x32')]['length']?_0x4366bc[_0x8998('0x32')]:_0x468446[_0x8998('0x2b')];if(_0x5b20e8[_0x8998('0x2d')][_0x8998('0x3e')]){_0x4366bc[_0x8998('0x3f')]=[{'all':!![]}];}_0x4366bc=_['merge']({},_0x4366bc,_0x5b20e8[_0x8998('0x3d')]);return db[_0x8998('0x29')][_0x8998('0x42')](_0x4366bc)[_0x8998('0x23')](handleEntityNotFound(_0x18dae5,null))[_0x8998('0x23')](respondWithResult(_0x18dae5,null))[_0x8998('0x43')](handleError(_0x18dae5,null));};exports[_0x8998('0x44')]=function(_0x1a5520,_0x59d5ef){return db[_0x8998('0x29')]['create'](_0x1a5520[_0x8998('0x45')],{})[_0x8998('0x23')](respondWithResult(_0x59d5ef,0xc9))[_0x8998('0x43')](handleError(_0x59d5ef,null));};exports['update']=function(_0x119195,_0x34effa){if(_0x119195[_0x8998('0x45')]['id']){delete _0x119195[_0x8998('0x45')]['id'];}return db[_0x8998('0x29')][_0x8998('0x42')]({'where':{'id':_0x119195[_0x8998('0x41')]['id']}})[_0x8998('0x23')](handleEntityNotFound(_0x34effa,null))[_0x8998('0x23')](saveUpdates(_0x119195[_0x8998('0x45')],null))[_0x8998('0x23')](respondWithResult(_0x34effa,null))[_0x8998('0x43')](handleError(_0x34effa,null));};exports['destroy']=function(_0x5f29c9,_0x226ce2){return db[_0x8998('0x29')][_0x8998('0x42')]({'where':{'id':_0x5f29c9[_0x8998('0x41')]['id']}})['then'](handleEntityNotFound(_0x226ce2,null))[_0x8998('0x23')](removeEntity(_0x226ce2,null))['catch'](handleError(_0x226ce2,null));};exports[_0x8998('0x46')]=function(_0x498085,_0x1dbf44){return db[_0x8998('0x29')][_0x8998('0x46')]()['then'](respondWithResult(_0x1dbf44,null))['catch'](handleError(_0x1dbf44,null));};exports[_0x8998('0x47')]=function(_0x367a19,_0x2cc634,_0x295f1e){var _0x1fd096={'raw':!![],'where':{}};var _0x4d77db={};var _0x2e05cb={'count':0x0,'rows':[]};return db[_0x8998('0x29')][_0x8998('0x48')]({'where':{'id':_0x367a19[_0x8998('0x41')]['id']}})[_0x8998('0x23')](handleEntityNotFound(_0x2cc634,null))[_0x8998('0x23')](function(_0x36c8d7){if(_0x36c8d7){_0x4d77db['model']=_[_0x8998('0x2e')](db[_0x8998('0x49')][_0x8998('0x4a')]);_0x4d77db[_0x8998('0x2d')]=_['keys'](_0x367a19[_0x8998('0x2d')]);_0x4d77db['filters']=_[_0x8998('0x30')](_0x4d77db[_0x8998('0x2b')],_0x4d77db[_0x8998('0x2d')]);_0x1fd096[_0x8998('0x32')]=_[_0x8998('0x30')](_0x4d77db['model'],qs['fields'](_0x367a19['query']['fields']));_0x1fd096[_0x8998('0x32')]=_0x1fd096[_0x8998('0x32')]['length']?_0x1fd096[_0x8998('0x32')]:_0x4d77db[_0x8998('0x2b')];if(!_0x367a19[_0x8998('0x2d')][_0x8998('0x33')](_0x8998('0x34'))){_0x1fd096[_0x8998('0x1f')]=qs[_0x8998('0x1f')](_0x367a19[_0x8998('0x2d')][_0x8998('0x1f')]);_0x1fd096[_0x8998('0x1e')]=qs['offset'](_0x367a19[_0x8998('0x2d')][_0x8998('0x1e')]);}_0x1fd096['order']=qs[_0x8998('0x36')](_0x367a19['query']['sort']);_0x1fd096['where']=qs[_0x8998('0x2f')](_[_0x8998('0x37')](_0x367a19[_0x8998('0x2d')],_0x4d77db[_0x8998('0x2f')]));_0x1fd096[_0x8998('0x3a')][_0x8998('0x4b')]=_0x36c8d7['id'];if(_0x367a19['query']['filter']){_0x1fd096['where']=_[_0x8998('0x39')](_0x1fd096[_0x8998('0x3a')],{'$or':_[_0x8998('0x2c')](_0x1fd096[_0x8998('0x32')],function(_0x44d52e){var _0x5573aa={};_0x5573aa[_0x44d52e]={'$like':'%'+_0x367a19[_0x8998('0x2d')]['filter']+'%'};return _0x5573aa;})});}_0x1fd096=_[_0x8998('0x39')]({},_0x1fd096,_0x367a19['options']);return db[_0x8998('0x49')][_0x8998('0x1d')]({'where':_0x1fd096['where']})[_0x8998('0x23')](function(_0x5c4a36){_0x2e05cb[_0x8998('0x1d')]=_0x5c4a36;if(_0x367a19[_0x8998('0x2d')][_0x8998('0x3e')]){_0x1fd096[_0x8998('0x3f')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x1fd096);})[_0x8998('0x23')](function(_0x4d8571){_0x2e05cb[_0x8998('0x40')]=_0x4d8571;return _0x2e05cb;});}})[_0x8998('0x23')](respondWithFilteredResult(_0x2cc634,_0x1fd096))[_0x8998('0x43')](handleError(_0x2cc634,null));}; \ No newline at end of file +var _0x2be1=['include','rows','catch','show','params','length','create','body','update','find','describe','getQuestions','findOne','SessionId','JscriptyQuestionReport','findAll','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack','name','send','map','JscriptySessionReport','rawAttributes','type','key','keys','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2be1,0x191));var _0x12be=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x2be1[_0x213518];return _0x1baf75;};'use strict';var emlformat=require(_0x12be('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x12be('0x1'));var rp=require(_0x12be('0x2'));var moment=require(_0x12be('0x3'));var BPromise=require(_0x12be('0x4'));var Mustache=require('mustache');var util=require(_0x12be('0x5'));var path=require(_0x12be('0x6'));var sox=require(_0x12be('0x7'));var csv=require(_0x12be('0x8'));var ejs=require(_0x12be('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x12be('0xa'));var squel=require(_0x12be('0xb'));var crypto=require(_0x12be('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x12be('0x8'));var querystring=require(_0x12be('0xd'));var Papa=require(_0x12be('0xe'));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(_0x12be('0xf'));var logger=require('../../config/logger')(_0x12be('0x10'));var utils=require(_0x12be('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x12be('0x12'));var db=require(_0x12be('0x13'))['db'];function respondWithStatusCode(_0x5948ec,_0x4770e2){_0x4770e2=_0x4770e2||0xcc;return function(_0x4d4b8b){if(_0x4d4b8b){return _0x5948ec['sendStatus'](_0x4770e2);}return _0x5948ec[_0x12be('0x14')](_0x4770e2)[_0x12be('0x15')]();};}function respondWithResult(_0x4361b1,_0x20a0f8){_0x20a0f8=_0x20a0f8||0xc8;return function(_0x55838b){if(_0x55838b){return _0x4361b1[_0x12be('0x14')](_0x20a0f8)[_0x12be('0x16')](_0x55838b);}};}function respondWithFilteredResult(_0x310c75,_0x2ac238){return function(_0x29663a){if(_0x29663a){var _0x1752c7=typeof _0x2ac238[_0x12be('0x17')]===_0x12be('0x18')&&typeof _0x2ac238[_0x12be('0x19')]===_0x12be('0x18');var _0x4b4186=_0x29663a[_0x12be('0x1a')];var _0x4fe42d=_0x1752c7?0x0:_0x2ac238[_0x12be('0x17')];var _0x2f856c=_0x1752c7?_0x29663a[_0x12be('0x1a')]:_0x2ac238[_0x12be('0x17')]+_0x2ac238[_0x12be('0x19')];var _0x577671;if(_0x2f856c>=_0x4b4186){_0x2f856c=_0x4b4186;_0x577671=0xc8;}else{_0x577671=0xce;}_0x310c75[_0x12be('0x14')](_0x577671);return _0x310c75[_0x12be('0x1b')](_0x12be('0x1c'),_0x4fe42d+'-'+_0x2f856c+'/'+_0x4b4186)[_0x12be('0x16')](_0x29663a);}return null;};}function patchUpdates(_0x4e3339){return function(_0x1281d8){try{jsonpatch[_0x12be('0x1d')](_0x1281d8,_0x4e3339,!![]);}catch(_0x554cda){return BPromise['reject'](_0x554cda);}return _0x1281d8[_0x12be('0x1e')]();};}function saveUpdates(_0x39e24e,_0x100753){return function(_0x3ccead){if(_0x3ccead){return _0x3ccead['update'](_0x39e24e)[_0x12be('0x1f')](function(_0x40c7db){return _0x40c7db;});}return null;};}function removeEntity(_0x4cbe25,_0x12b9fe){return function(_0x46f453){if(_0x46f453){return _0x46f453[_0x12be('0x20')]()[_0x12be('0x1f')](function(){_0x4cbe25[_0x12be('0x14')](0xcc)[_0x12be('0x15')]();});}};}function handleEntityNotFound(_0x2389e6,_0x5af133){return function(_0x3619ee){if(!_0x3619ee){_0x2389e6[_0x12be('0x21')](0x194);}return _0x3619ee;};}function handleError(_0x275ea4,_0x35acb8){_0x35acb8=_0x35acb8||0x1f4;return function(_0x1c7a06){logger[_0x12be('0x22')](_0x1c7a06[_0x12be('0x23')]);if(_0x1c7a06[_0x12be('0x24')]){delete _0x1c7a06[_0x12be('0x24')];}_0x275ea4[_0x12be('0x14')](_0x35acb8)[_0x12be('0x25')](_0x1c7a06);};}exports['index']=function(_0x3395bb,_0x4462dc){var _0x1ed243={},_0x156f2d={},_0x282f44={'count':0x0,'rows':[]};var _0x26616b=_[_0x12be('0x26')](db[_0x12be('0x27')][_0x12be('0x28')],function(_0x59d4e4){return{'name':_0x59d4e4['fieldName'],'type':_0x59d4e4[_0x12be('0x29')][_0x12be('0x2a')]};});_0x156f2d['model']=_['map'](_0x26616b,_0x12be('0x24'));_0x156f2d['query']=_[_0x12be('0x2b')](_0x3395bb[_0x12be('0x2c')]);_0x156f2d['filters']=_[_0x12be('0x2d')](_0x156f2d[_0x12be('0x2e')],_0x156f2d[_0x12be('0x2c')]);_0x1ed243[_0x12be('0x2f')]=_[_0x12be('0x2d')](_0x156f2d[_0x12be('0x2e')],qs[_0x12be('0x30')](_0x3395bb[_0x12be('0x2c')][_0x12be('0x30')]));_0x1ed243[_0x12be('0x2f')]=_0x1ed243['attributes']['length']?_0x1ed243[_0x12be('0x2f')]:_0x156f2d[_0x12be('0x2e')];if(!_0x3395bb['query'][_0x12be('0x31')](_0x12be('0x32'))){_0x1ed243['limit']=qs[_0x12be('0x19')](_0x3395bb[_0x12be('0x2c')][_0x12be('0x19')]);_0x1ed243[_0x12be('0x17')]=qs['offset'](_0x3395bb[_0x12be('0x2c')][_0x12be('0x17')]);}_0x1ed243[_0x12be('0x33')]=qs[_0x12be('0x34')](_0x3395bb[_0x12be('0x2c')][_0x12be('0x34')]);_0x1ed243['where']=qs[_0x12be('0x35')](_[_0x12be('0x36')](_0x3395bb[_0x12be('0x2c')],_0x156f2d[_0x12be('0x35')]),_0x26616b);if(_0x3395bb['query'][_0x12be('0x37')]){_0x1ed243[_0x12be('0x38')]=_[_0x12be('0x39')](_0x1ed243[_0x12be('0x38')],{'$or':_['map'](_0x26616b,function(_0x135352){if(_0x135352[_0x12be('0x29')]!==_0x12be('0x3a')){var _0x49e07e={};_0x49e07e[_0x135352[_0x12be('0x24')]]={'$like':'%'+_0x3395bb[_0x12be('0x2c')][_0x12be('0x37')]+'%'};return _0x49e07e;}})});}_0x1ed243=_[_0x12be('0x39')]({},_0x1ed243,_0x3395bb[_0x12be('0x3b')]);var _0x117287={'where':_0x1ed243[_0x12be('0x38')]};return db['JscriptySessionReport'][_0x12be('0x1a')](_0x117287)['then'](function(_0x2482bd){_0x282f44['count']=_0x2482bd;if(_0x3395bb[_0x12be('0x2c')][_0x12be('0x3c')]){_0x1ed243[_0x12be('0x3d')]=[{'all':!![]}];}return db[_0x12be('0x27')]['findAll'](_0x1ed243);})[_0x12be('0x1f')](function(_0x20eee8){_0x282f44[_0x12be('0x3e')]=_0x20eee8;return _0x282f44;})[_0x12be('0x1f')](respondWithFilteredResult(_0x4462dc,_0x1ed243))[_0x12be('0x3f')](handleError(_0x4462dc,null));};exports[_0x12be('0x40')]=function(_0x52d24b,_0x214e25){var _0x6ca32a={'raw':!![],'where':{'id':_0x52d24b[_0x12be('0x41')]['id']}},_0x16f4d7={};_0x16f4d7['model']=_[_0x12be('0x2b')](db['JscriptySessionReport'][_0x12be('0x28')]);_0x16f4d7[_0x12be('0x2c')]=_['keys'](_0x52d24b[_0x12be('0x2c')]);_0x16f4d7[_0x12be('0x35')]=_[_0x12be('0x2d')](_0x16f4d7['model'],_0x16f4d7['query']);_0x6ca32a['attributes']=_[_0x12be('0x2d')](_0x16f4d7['model'],qs[_0x12be('0x30')](_0x52d24b['query'][_0x12be('0x30')]));_0x6ca32a['attributes']=_0x6ca32a[_0x12be('0x2f')][_0x12be('0x42')]?_0x6ca32a[_0x12be('0x2f')]:_0x16f4d7['model'];if(_0x52d24b[_0x12be('0x2c')][_0x12be('0x3c')]){_0x6ca32a[_0x12be('0x3d')]=[{'all':!![]}];}_0x6ca32a=_[_0x12be('0x39')]({},_0x6ca32a,_0x52d24b[_0x12be('0x3b')]);return db['JscriptySessionReport']['find'](_0x6ca32a)[_0x12be('0x1f')](handleEntityNotFound(_0x214e25,null))['then'](respondWithResult(_0x214e25,null))[_0x12be('0x3f')](handleError(_0x214e25,null));};exports[_0x12be('0x43')]=function(_0x15fa88,_0x343710){return db['JscriptySessionReport'][_0x12be('0x43')](_0x15fa88[_0x12be('0x44')],{})[_0x12be('0x1f')](respondWithResult(_0x343710,0xc9))[_0x12be('0x3f')](handleError(_0x343710,null));};exports[_0x12be('0x45')]=function(_0x143eec,_0x5a163f){if(_0x143eec[_0x12be('0x44')]['id']){delete _0x143eec[_0x12be('0x44')]['id'];}return db[_0x12be('0x27')][_0x12be('0x46')]({'where':{'id':_0x143eec[_0x12be('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a163f,null))[_0x12be('0x1f')](saveUpdates(_0x143eec[_0x12be('0x44')],null))[_0x12be('0x1f')](respondWithResult(_0x5a163f,null))[_0x12be('0x3f')](handleError(_0x5a163f,null));};exports[_0x12be('0x20')]=function(_0xef9f22,_0x2db40a){return db[_0x12be('0x27')][_0x12be('0x46')]({'where':{'id':_0xef9f22[_0x12be('0x41')]['id']}})[_0x12be('0x1f')](handleEntityNotFound(_0x2db40a,null))['then'](removeEntity(_0x2db40a,null))[_0x12be('0x3f')](handleError(_0x2db40a,null));};exports[_0x12be('0x47')]=function(_0x17658d,_0x50d918){return db[_0x12be('0x27')]['describe']()[_0x12be('0x1f')](respondWithResult(_0x50d918,null))['catch'](handleError(_0x50d918,null));};exports[_0x12be('0x48')]=function(_0x152f82,_0x1c3142,_0x53fd42){var _0x31783d={'raw':!![],'where':{}};var _0x9f6647={};var _0x5de162={'count':0x0,'rows':[]};return db[_0x12be('0x27')][_0x12be('0x49')]({'where':{'id':_0x152f82[_0x12be('0x41')]['id']}})['then'](handleEntityNotFound(_0x1c3142,null))[_0x12be('0x1f')](function(_0x4789a1){if(_0x4789a1){_0x9f6647[_0x12be('0x2e')]=_['keys'](db['JscriptyQuestionReport'][_0x12be('0x28')]);_0x9f6647[_0x12be('0x2c')]=_[_0x12be('0x2b')](_0x152f82['query']);_0x9f6647[_0x12be('0x35')]=_[_0x12be('0x2d')](_0x9f6647[_0x12be('0x2e')],_0x9f6647[_0x12be('0x2c')]);_0x31783d[_0x12be('0x2f')]=_[_0x12be('0x2d')](_0x9f6647[_0x12be('0x2e')],qs[_0x12be('0x30')](_0x152f82[_0x12be('0x2c')][_0x12be('0x30')]));_0x31783d[_0x12be('0x2f')]=_0x31783d[_0x12be('0x2f')][_0x12be('0x42')]?_0x31783d[_0x12be('0x2f')]:_0x9f6647[_0x12be('0x2e')];if(!_0x152f82[_0x12be('0x2c')][_0x12be('0x31')]('nolimit')){_0x31783d[_0x12be('0x19')]=qs[_0x12be('0x19')](_0x152f82['query'][_0x12be('0x19')]);_0x31783d[_0x12be('0x17')]=qs[_0x12be('0x17')](_0x152f82[_0x12be('0x2c')][_0x12be('0x17')]);}_0x31783d[_0x12be('0x33')]=qs[_0x12be('0x34')](_0x152f82[_0x12be('0x2c')]['sort']);_0x31783d[_0x12be('0x38')]=qs[_0x12be('0x35')](_['pick'](_0x152f82[_0x12be('0x2c')],_0x9f6647[_0x12be('0x35')]));_0x31783d[_0x12be('0x38')][_0x12be('0x4a')]=_0x4789a1['id'];if(_0x152f82[_0x12be('0x2c')][_0x12be('0x37')]){_0x31783d[_0x12be('0x38')]=_[_0x12be('0x39')](_0x31783d[_0x12be('0x38')],{'$or':_[_0x12be('0x26')](_0x31783d[_0x12be('0x2f')],function(_0x259729){var _0x149886={};_0x149886[_0x259729]={'$like':'%'+_0x152f82[_0x12be('0x2c')][_0x12be('0x37')]+'%'};return _0x149886;})});}_0x31783d=_[_0x12be('0x39')]({},_0x31783d,_0x152f82[_0x12be('0x3b')]);return db['JscriptyQuestionReport'][_0x12be('0x1a')]({'where':_0x31783d[_0x12be('0x38')]})[_0x12be('0x1f')](function(_0x357c5e){_0x5de162['count']=_0x357c5e;if(_0x152f82[_0x12be('0x2c')][_0x12be('0x3c')]){_0x31783d['include']=[{'all':!![]}];}return db[_0x12be('0x4b')][_0x12be('0x4c')](_0x31783d);})['then'](function(_0x3aa2a9){_0x5de162[_0x12be('0x3e')]=_0x3aa2a9;return _0x5de162;});}})[_0x12be('0x1f')](respondWithFilteredResult(_0x1c3142,_0x31783d))['catch'](handleError(_0x1c3142,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 80e664d..2653ceb 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 _0x8ca9=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','exports','define','JscriptySessionReport','report_jscripty_sessions'];(function(_0x2925a9,_0x4de960){var _0x1a380a=function(_0x538030){while(--_0x538030){_0x2925a9['push'](_0x2925a9['shift']());}};_0x1a380a(++_0x4de960);}(_0x8ca9,0x9c));var _0x98ca=function(_0x2a1b7d,_0x343761){_0x2a1b7d=_0x2a1b7d-0x0;var _0xc63df8=_0x8ca9[_0x2a1b7d];return _0xc63df8;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require(_0x98ca('0x4'));var BPromise=require(_0x98ca('0x5'));var rp=require(_0x98ca('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ca('0x7'));var attributes=require('./jscriptySessionReport.attributes');module[_0x98ca('0x8')]=function(_0x48415d,_0x219619){return _0x48415d[_0x98ca('0x9')](_0x98ca('0xa'),attributes,{'tableName':_0x98ca('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeda8=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','define','report_jscripty_sessions'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xeda8,0x104));var _0x8eda=function(_0x4abf33,_0x313c46){_0x4abf33=_0x4abf33-0x0;var _0x2e276a=_0xeda8[_0x4abf33];return _0x2e276a;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var logger=require('../../config/logger')(_0x8eda('0x2'));var moment=require(_0x8eda('0x3'));var BPromise=require(_0x8eda('0x4'));var rp=require(_0x8eda('0x5'));var fs=require('fs');var path=require(_0x8eda('0x6'));var rimraf=require(_0x8eda('0x7'));var config=require(_0x8eda('0x8'));var attributes=require(_0x8eda('0x9'));module[_0x8eda('0xa')]=function(_0x1f3556,_0x349361){return _0x1f3556[_0x8eda('0xb')]('JscriptySessionReport',attributes,{'tableName':_0x8eda('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index de36903..664566e 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 _0x4745=['debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent'];(function(_0x12729f,_0x327285){var _0x43aa24=function(_0x4d5a41){while(--_0x4d5a41){_0x12729f['push'](_0x12729f['shift']());}};_0x43aa24(++_0x327285);}(_0x4745,0x1e7));var _0x5474=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0x4745[_0x373dee];return _0x46798f;};'use strict';var _=require(_0x5474('0x0'));var util=require(_0x5474('0x1'));var moment=require(_0x5474('0x2'));var BPromise=require(_0x5474('0x3'));var rs=require(_0x5474('0x4'));var fs=require('fs');var Redis=require(_0x5474('0x5'));var db=require(_0x5474('0x6'))['db'];var utils=require(_0x5474('0x7'));var logger=require(_0x5474('0x8'))(_0x5474('0x9'));var config=require(_0x5474('0xa'));var jayson=require(_0x5474('0xb'));var client=jayson['client'][_0x5474('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x431f81,_0x57add7,_0x13929f){return new BPromise(function(_0x5d778b,_0x902ba8){return client[_0x5474('0xd')](_0x431f81,_0x13929f)['then'](function(_0xf876f8){logger[_0x5474('0xe')](_0x5474('0xf'),_0x57add7,_0x5474('0x10'));logger[_0x5474('0x11')](_0x5474('0x12'),_0x57add7,_0x5474('0x10'),JSON[_0x5474('0x13')](_0xf876f8));if(_0xf876f8['error']){if(_0xf876f8[_0x5474('0x14')][_0x5474('0x15')]===0x1f4){logger[_0x5474('0x14')](_0x5474('0xf'),_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x902ba8(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}logger[_0x5474('0x14')]('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);return _0x5d778b(_0xf876f8[_0x5474('0x14')][_0x5474('0x16')]);}else{logger['info']('JscriptySessionReport,\x20%s,\x20%s',_0x57add7,'request\x20sent');_0x5d778b(_0xf876f8['result'][_0x5474('0x16')]);}})[_0x5474('0x17')](function(_0x2da774){logger['error'](_0x5474('0xf'),_0x57add7,_0x2da774);_0x902ba8(_0x2da774);});});} \ No newline at end of file +var _0x25e7=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request','then','info'];(function(_0x5cb648,_0x3db0f1){var _0x4f865f=function(_0x39d8fe){while(--_0x39d8fe){_0x5cb648['push'](_0x5cb648['shift']());}};_0x4f865f(++_0x3db0f1);}(_0x25e7,0x1d6));var _0x725e=function(_0x58a872,_0x50d43a){_0x58a872=_0x58a872-0x0;var _0x3e1577=_0x25e7[_0x58a872];return _0x3e1577;};'use strict';var _=require(_0x725e('0x0'));var util=require(_0x725e('0x1'));var moment=require(_0x725e('0x2'));var BPromise=require(_0x725e('0x3'));var rs=require(_0x725e('0x4'));var fs=require('fs');var Redis=require(_0x725e('0x5'));var db=require(_0x725e('0x6'))['db'];var utils=require(_0x725e('0x7'));var logger=require(_0x725e('0x8'))(_0x725e('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x725e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x481316,_0x111a50,_0x192c27){return new BPromise(function(_0x216b33,_0x67de0c){return client[_0x725e('0xb')](_0x481316,_0x192c27)[_0x725e('0xc')](function(_0x39858a){logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,_0x725e('0xf'));logger[_0x725e('0x10')](_0x725e('0x11'),_0x111a50,'request\x20sent',JSON['stringify'](_0x39858a));if(_0x39858a[_0x725e('0x12')]){if(_0x39858a[_0x725e('0x12')]['code']===0x1f4){logger['error'](_0x725e('0xe'),_0x111a50,_0x39858a[_0x725e('0x12')]['message']);return _0x67de0c(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}logger[_0x725e('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x111a50,_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);return _0x216b33(_0x39858a[_0x725e('0x12')][_0x725e('0x13')]);}else{logger[_0x725e('0xd')](_0x725e('0xe'),_0x111a50,'request\x20sent');_0x216b33(_0x39858a[_0x725e('0x14')][_0x725e('0x13')]);}})[_0x725e('0x15')](function(_0x54ac0f){logger[_0x725e('0x12')](_0x725e('0xe'),_0x111a50,_0x54ac0f);_0x67de0c(_0x54ac0f);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index a95cb3b..94c2bf4 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 _0x29ae=['express','Router','../../components/auth/service','../../config/environment','./license.controller','get','put','/:id','exports','multer'];(function(_0x12ddb2,_0x5ad61e){var _0x10b6dd=function(_0x47dd27){while(--_0x47dd27){_0x12ddb2['push'](_0x12ddb2['shift']());}};_0x10b6dd(++_0x5ad61e);}(_0x29ae,0x167));var _0xe29a=function(_0x409ea8,_0x299ca3){_0x409ea8=_0x409ea8-0x0;var _0x305448=_0x29ae[_0x409ea8];return _0x305448;};'use strict';var multer=require(_0xe29a('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe29a('0x1'));var router=express[_0xe29a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe29a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xe29a('0x4'));var controller=require(_0xe29a('0x5'));router[_0xe29a('0x6')]('/',controller['index']);router[_0xe29a('0x7')](_0xe29a('0x8'),auth['isAuthenticated'](),controller['update']);module[_0xe29a('0x9')]=router; \ No newline at end of file +var _0x861a=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./license.controller','get','index','put','isAuthenticated','update','exports','multer'];(function(_0x16a9b4,_0x9a73f4){var _0x2aa60a=function(_0x2f9e0c){while(--_0x2f9e0c){_0x16a9b4['push'](_0x16a9b4['shift']());}};_0x2aa60a(++_0x9a73f4);}(_0x861a,0x194));var _0xa861=function(_0x525123,_0x3e7b2d){_0x525123=_0x525123-0x0;var _0x5112a1=_0x861a[_0x525123];return _0x5112a1;};'use strict';var multer=require(_0xa861('0x0'));var util=require('util');var path=require(_0xa861('0x1'));var timeout=require(_0xa861('0x2'));var express=require(_0xa861('0x3'));var router=express[_0xa861('0x4')]();var fs_extra=require(_0xa861('0x5'));var auth=require(_0xa861('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa861('0x7'));var controller=require(_0xa861('0x8'));router[_0xa861('0x9')]('/',controller[_0xa861('0xa')]);router[_0xa861('0xb')]('/:id',auth[_0xa861('0xc')](),controller[_0xa861('0xd')]);module[_0xa861('0xe')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index eca9eb7..4bb9bcb 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 _0xb67b=['exports','TEXT','STRING','sequelize'];(function(_0x44932c,_0x273e65){var _0x45b69b=function(_0x54d8a1){while(--_0x54d8a1){_0x44932c['push'](_0x44932c['shift']());}};_0x45b69b(++_0x273e65);}(_0xb67b,0x1c3));var _0xbb67=function(_0x4a16aa,_0x46f661){_0x4a16aa=_0x4a16aa-0x0;var _0x4e9af4=_0xb67b[_0x4a16aa];return _0x4e9af4;};'use strict';var Sequelize=require(_0xbb67('0x0'));module[_0xbb67('0x1')]={'license':{'type':Sequelize[_0xbb67('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xbb67('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4092=['STRING','exports'];(function(_0x4e3b9c,_0x4d76a3){var _0x358b13=function(_0x2409d6){while(--_0x2409d6){_0x4e3b9c['push'](_0x4e3b9c['shift']());}};_0x358b13(++_0x4d76a3);}(_0x4092,0x16d));var _0x2409=function(_0x44cb92,_0x59afa3){_0x44cb92=_0x44cb92-0x0;var _0x56b9e6=_0x4092[_0x44cb92];return _0x56b9e6;};'use strict';var Sequelize=require('sequelize');module[_0x2409('0x0')]={'license':{'type':Sequelize['TEXT']},'data1':{'type':Sequelize[_0x2409('0x1')]},'data2':{'type':Sequelize[_0x2409('0x1')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'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 f71921b..6a19348 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 _0x1261=['../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','error','stack','send','index','model','License','query','intersection','fields','attributes','merge','options','getLicense','catch','body','find','params','get','key','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis'];(function(_0x67eb59,_0x5677a4){var _0x5f468d=function(_0x24e741){while(--_0x24e741){_0x67eb59['push'](_0x67eb59['shift']());}};_0x5f468d(++_0x5677a4);}(_0x1261,0x144));var _0x1126=function(_0x45564a,_0x160043){_0x45564a=_0x45564a-0x0;var _0x1184c7=_0x1261[_0x45564a];return _0x1184c7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1126('0x0'));var zipdir=require(_0x1126('0x1'));var jsonpatch=require(_0x1126('0x2'));var rp=require(_0x1126('0x3'));var moment=require(_0x1126('0x4'));var BPromise=require(_0x1126('0x5'));var Mustache=require(_0x1126('0x6'));var util=require(_0x1126('0x7'));var path=require(_0x1126('0x8'));var sox=require(_0x1126('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1126('0xa'));var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x1126('0x16'));var db=require(_0x1126('0x17'))['db'];function respondWithStatusCode(_0xd26a32,_0x273896){_0x273896=_0x273896||0xcc;return function(_0xca0355){if(_0xca0355){return _0xd26a32[_0x1126('0x18')](_0x273896);}return _0xd26a32[_0x1126('0x19')](_0x273896)[_0x1126('0x1a')]();};}function respondWithResult(_0x43850b,_0x53a8f0){_0x53a8f0=_0x53a8f0||0xc8;return function(_0x5de9a7){if(_0x5de9a7){return _0x43850b[_0x1126('0x19')](_0x53a8f0)[_0x1126('0x1b')](_0x5de9a7);}};}function respondWithFilteredResult(_0x279455,_0x4be0c6){return function(_0x45149c){if(_0x45149c){var _0x4794a7=typeof _0x4be0c6[_0x1126('0x1c')]===_0x1126('0x1d')&&typeof _0x4be0c6[_0x1126('0x1e')]==='undefined';var _0x245cd7=_0x45149c[_0x1126('0x1f')];var _0x4a7b49=_0x4794a7?0x0:_0x4be0c6['offset'];var _0x22ae0b=_0x4794a7?_0x45149c[_0x1126('0x1f')]:_0x4be0c6['offset']+_0x4be0c6['limit'];var _0x4564c0;if(_0x22ae0b>=_0x245cd7){_0x22ae0b=_0x245cd7;_0x4564c0=0xc8;}else{_0x4564c0=0xce;}_0x279455['status'](_0x4564c0);return _0x279455[_0x1126('0x20')](_0x1126('0x21'),_0x4a7b49+'-'+_0x22ae0b+'/'+_0x245cd7)[_0x1126('0x1b')](_0x45149c);}return null;};}function patchUpdates(_0x54400a){return function(_0x2a08ba){try{jsonpatch['apply'](_0x2a08ba,_0x54400a,!![]);}catch(_0x56efeb){return BPromise[_0x1126('0x22')](_0x56efeb);}return _0x2a08ba[_0x1126('0x23')]();};}function saveUpdates(_0x25b24b,_0x36d254){return function(_0x526ca1){if(_0x526ca1){return _0x526ca1[_0x1126('0x24')](_0x25b24b)[_0x1126('0x25')](function(_0x48a08d){return _0x48a08d;});}return null;};}function removeEntity(_0x2175fa,_0x59cd8e){return function(_0x529dd9){if(_0x529dd9){return _0x529dd9['destroy']()[_0x1126('0x25')](function(){_0x2175fa[_0x1126('0x19')](0xcc)[_0x1126('0x1a')]();});}};}function handleEntityNotFound(_0x34bcf1,_0x566c09){return function(_0x1b07a7){if(!_0x1b07a7){_0x34bcf1[_0x1126('0x18')](0x194);}return _0x1b07a7;};}function handleError(_0x38119d,_0x589725){_0x589725=_0x589725||0x1f4;return function(_0x35eec3){logger[_0x1126('0x26')](_0x35eec3[_0x1126('0x27')]);if(_0x35eec3['name']){delete _0x35eec3['name'];}_0x38119d[_0x1126('0x19')](_0x589725)[_0x1126('0x28')](_0x35eec3);};}var utilLicense=require('../../config/license/util');exports[_0x1126('0x29')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={'raw':!![],'where':{'id':0x1}},_0x4bf807={};_0x4bf807[_0x1126('0x2a')]=_['keys'](db[_0x1126('0x2b')]['rawAttributes']);_0x4bf807[_0x1126('0x2c')]=_['keys'](_0x23d2bc['query']);_0x4bf807['filters']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],_0x4bf807[_0x1126('0x2c')]);_0x3fa694['attributes']=_[_0x1126('0x2d')](_0x4bf807[_0x1126('0x2a')],qs['fields'](_0x23d2bc[_0x1126('0x2c')][_0x1126('0x2e')]));_0x3fa694[_0x1126('0x2f')]=_0x3fa694[_0x1126('0x2f')]['length']?_0x3fa694['attributes']:_0x4bf807[_0x1126('0x2a')];_0x3fa694=_[_0x1126('0x30')]({},_0x3fa694,_0x23d2bc[_0x1126('0x31')]);return utilLicense[_0x1126('0x32')](_0x3fa694)['then'](respondWithResult(_0x4a334a,null))[_0x1126('0x33')](handleError(_0x4a334a,null));};exports[_0x1126('0x24')]=function(_0x313ebe,_0x22436c){if(_0x313ebe[_0x1126('0x34')]['id']){delete _0x313ebe['body']['id'];}return db[_0x1126('0x2b')][_0x1126('0x35')]({'where':{'id':_0x313ebe[_0x1126('0x36')]['id']}})[_0x1126('0x25')](handleEntityNotFound(_0x22436c,null))['then'](function(_0x4ca51c){var _0x22827a=_0x4ca51c[_0x1126('0x37')]({'plain':!![]});return utilLicense['checkLicense'](_0x22827a,_0x313ebe[_0x1126('0x34')][_0x1126('0x38')]);})[_0x1126('0x25')](function(_0x5c08b9){if(!_0x5c08b9['demo']){return saveUpdates(_0x313ebe[_0x1126('0x34')],null);}return _0x5c08b9;})[_0x1126('0x25')](respondWithResult(_0x22436c,null))[_0x1126('0x33')](handleError(_0x22436c,null));}; \ No newline at end of file +var _0x0295=['demo','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','../../config/license/util','model','keys','rawAttributes','query','filters','intersection','attributes','fields','merge','options','catch','body','License','find','checkLicense','key'];(function(_0x474bc0,_0x26989c){var _0x4b24cf=function(_0x4be866){while(--_0x4be866){_0x474bc0['push'](_0x474bc0['shift']());}};_0x4b24cf(++_0x26989c);}(_0x0295,0x1f0));var _0x5029=function(_0x20d93a,_0x422a10){_0x20d93a=_0x20d93a-0x0;var _0x4e5cec=_0x0295[_0x20d93a];return _0x4e5cec;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}var utilLicense=require(_0x5029('0x25'));exports['index']=function(_0x32da06,_0x251f99){var _0xe5313e={'raw':!![],'where':{'id':0x1}},_0x4b6f92={};_0x4b6f92[_0x5029('0x26')]=_[_0x5029('0x27')](db['License'][_0x5029('0x28')]);_0x4b6f92[_0x5029('0x29')]=_[_0x5029('0x27')](_0x32da06[_0x5029('0x29')]);_0x4b6f92[_0x5029('0x2a')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],_0x4b6f92[_0x5029('0x29')]);_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2b')](_0x4b6f92[_0x5029('0x26')],qs[_0x5029('0x2d')](_0x32da06['query'][_0x5029('0x2d')]));_0xe5313e['attributes']=_0xe5313e[_0x5029('0x2c')]['length']?_0xe5313e['attributes']:_0x4b6f92[_0x5029('0x26')];_0xe5313e=_[_0x5029('0x2e')]({},_0xe5313e,_0x32da06[_0x5029('0x2f')]);return utilLicense['getLicense'](_0xe5313e)[_0x5029('0x20')](respondWithResult(_0x251f99,null))[_0x5029('0x30')](handleError(_0x251f99,null));};exports[_0x5029('0x1f')]=function(_0x29c59a,_0x1bb896){if(_0x29c59a[_0x5029('0x31')]['id']){delete _0x29c59a[_0x5029('0x31')]['id'];}return db[_0x5029('0x32')][_0x5029('0x33')]({'where':{'id':_0x29c59a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bb896,null))[_0x5029('0x20')](function(_0xc110e8){var _0x1b3817=_0xc110e8['get']({'plain':!![]});return utilLicense[_0x5029('0x34')](_0x1b3817,_0x29c59a[_0x5029('0x31')][_0x5029('0x35')]);})['then'](function(_0x4904cc){if(!_0x4904cc[_0x5029('0x36')]){return saveUpdates(_0x29c59a[_0x5029('0x31')],null);}return _0x4904cc;})['then'](respondWithResult(_0x1bb896,null))['catch'](handleError(_0x1bb896,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index b4eb585..76fdf66 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 _0xadfa=['../../config/environment','./license.attributes','exports','define','License','license','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x368a19,_0x345752){var _0x341ddd=function(_0x32dfd2){while(--_0x32dfd2){_0x368a19['push'](_0x368a19['shift']());}};_0x341ddd(++_0x345752);}(_0xadfa,0x66));var _0xaadf=function(_0x14ce7d,_0x1b6c4e){_0x14ce7d=_0x14ce7d-0x0;var _0x575a73=_0xadfa[_0x14ce7d];return _0x575a73;};'use strict';var _=require('lodash');var util=require(_0xaadf('0x0'));var logger=require(_0xaadf('0x1'))('api');var moment=require(_0xaadf('0x2'));var BPromise=require('bluebird');var rp=require(_0xaadf('0x3'));var fs=require('fs');var path=require(_0xaadf('0x4'));var rimraf=require(_0xaadf('0x5'));var config=require(_0xaadf('0x6'));var attributes=require(_0xaadf('0x7'));module[_0xaadf('0x8')]=function(_0x5f24aa,_0x4f15d9){return _0x5f24aa[_0xaadf('0x9')](_0xaadf('0xa'),attributes,{'tableName':_0xaadf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7898=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','license'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x7898,0xee));var _0x8789=function(_0x542ae7,_0x57332f){_0x542ae7=_0x542ae7-0x0;var _0x5a96a6=_0x7898[_0x542ae7];return _0x5a96a6;};'use strict';var _=require(_0x8789('0x0'));var util=require(_0x8789('0x1'));var logger=require('../../config/logger')(_0x8789('0x2'));var moment=require(_0x8789('0x3'));var BPromise=require(_0x8789('0x4'));var rp=require(_0x8789('0x5'));var fs=require('fs');var path=require(_0x8789('0x6'));var rimraf=require(_0x8789('0x7'));var config=require(_0x8789('0x8'));var attributes=require(_0x8789('0x9'));module[_0x8789('0xa')]=function(_0x986e7f,_0x35ee9f){return _0x986e7f[_0x8789('0xb')](_0x8789('0xc'),attributes,{'tableName':_0x8789('0xd'),'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 1560216..5a78814 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 _0x2e42=['info','License,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x30c6bb,_0x1ed3f7){var _0x229bf1=function(_0x2410fa){while(--_0x2410fa){_0x30c6bb['push'](_0x30c6bb['shift']());}};_0x229bf1(++_0x1ed3f7);}(_0x2e42,0x8e));var _0x22e4=function(_0x15b380,_0x1a3c5f){_0x15b380=_0x15b380-0x0;var _0x232c5c=_0x2e42[_0x15b380];return _0x232c5c;};'use strict';var _=require(_0x22e4('0x0'));var util=require(_0x22e4('0x1'));var moment=require('moment');var BPromise=require(_0x22e4('0x2'));var rs=require(_0x22e4('0x3'));var fs=require('fs');var Redis=require(_0x22e4('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x22e4('0x5'));var config=require(_0x22e4('0x6'));var jayson=require(_0x22e4('0x7'));var client=jayson[_0x22e4('0x8')][_0x22e4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ed595,_0x50cfe9,_0x26f8cc){return new BPromise(function(_0x4c6912,_0x338af6){return client[_0x22e4('0xa')](_0x1ed595,_0x26f8cc)[_0x22e4('0xb')](function(_0x2b60f0){logger[_0x22e4('0xc')](_0x22e4('0xd'),_0x50cfe9,_0x22e4('0xe'));logger[_0x22e4('0xf')]('License,\x20%s,\x20%s,\x20%s',_0x50cfe9,'request\x20sent',JSON[_0x22e4('0x10')](_0x2b60f0));if(_0x2b60f0[_0x22e4('0x11')]){if(_0x2b60f0[_0x22e4('0x11')][_0x22e4('0x12')]===0x1f4){logger[_0x22e4('0x11')](_0x22e4('0xd'),_0x50cfe9,_0x2b60f0['error']['message']);return _0x338af6(_0x2b60f0[_0x22e4('0x11')][_0x22e4('0x13')]);}logger['error']('License,\x20%s,\x20%s',_0x50cfe9,_0x2b60f0[_0x22e4('0x11')][_0x22e4('0x13')]);return _0x4c6912(_0x2b60f0['error'][_0x22e4('0x13')]);}else{logger[_0x22e4('0xc')]('License,\x20%s,\x20%s',_0x50cfe9,'request\x20sent');_0x4c6912(_0x2b60f0[_0x22e4('0x14')]['message']);}})[_0x22e4('0x15')](function(_0x59438b){logger['error'](_0x22e4('0xd'),_0x50cfe9,_0x59438b);_0x338af6(_0x59438b);});});} \ No newline at end of file +var _0xfca2=['http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x5dc01d,_0x2666f7){var _0x2cf7e8=function(_0x172535){while(--_0x172535){_0x5dc01d['push'](_0x5dc01d['shift']());}};_0x2cf7e8(++_0x2666f7);}(_0xfca2,0x12e));var _0x2fca=function(_0xee3051,_0xbe4f18){_0xee3051=_0xee3051-0x0;var _0x139e81=_0xfca2[_0xee3051];return _0x139e81;};'use strict';var _=require(_0x2fca('0x0'));var util=require(_0x2fca('0x1'));var moment=require('moment');var BPromise=require(_0x2fca('0x2'));var rs=require(_0x2fca('0x3'));var fs=require('fs');var Redis=require(_0x2fca('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2fca('0x5'));var logger=require(_0x2fca('0x6'))(_0x2fca('0x7'));var config=require(_0x2fca('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x2fca('0x9')][_0x2fca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15836f,_0x118278,_0x54e248){return new BPromise(function(_0x29a8fa,_0x5f172a){return client[_0x2fca('0xb')](_0x15836f,_0x54e248)[_0x2fca('0xc')](function(_0x21d276){logger[_0x2fca('0xd')](_0x2fca('0xe'),_0x118278,_0x2fca('0xf'));logger[_0x2fca('0x10')](_0x2fca('0x11'),_0x118278,'request\x20sent',JSON[_0x2fca('0x12')](_0x21d276));if(_0x21d276['error']){if(_0x21d276[_0x2fca('0x13')][_0x2fca('0x14')]===0x1f4){logger[_0x2fca('0x13')](_0x2fca('0xe'),_0x118278,_0x21d276[_0x2fca('0x13')][_0x2fca('0x15')]);return _0x5f172a(_0x21d276[_0x2fca('0x13')][_0x2fca('0x15')]);}logger[_0x2fca('0x13')](_0x2fca('0xe'),_0x118278,_0x21d276[_0x2fca('0x13')]['message']);return _0x29a8fa(_0x21d276[_0x2fca('0x13')]['message']);}else{logger[_0x2fca('0xd')](_0x2fca('0xe'),_0x118278,'request\x20sent');_0x29a8fa(_0x21d276[_0x2fca('0x16')][_0x2fca('0x15')]);}})[_0x2fca('0x17')](function(_0x29a77f){logger['error'](_0x2fca('0xe'),_0x118278,_0x29a77f);_0x5f172a(_0x29a77f);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f3b7f97..365e27c 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 _0xffdf=['removeAgents','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','getAnswers','/:id/in_servers','getImap','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','/:id/canned_answers','addImap','addSmtp','addApplications','addAgents','put','update','delete','removeDispositions','removeAnswers','removeImap','/:id/out_servers','removeSmtp','destroy'];(function(_0x352767,_0x333ee8){var _0xeaefe1=function(_0x2fe9a5){while(--_0x2fe9a5){_0x352767['push'](_0x352767['shift']());}};_0xeaefe1(++_0x333ee8);}(_0xffdf,0x1b2));var _0xfffd=function(_0x59da33,_0x555969){_0x59da33=_0x59da33-0x0;var _0x1da20f=_0xffdf[_0x59da33];return _0x1da20f;};'use strict';var multer=require('multer');var util=require(_0xfffd('0x0'));var path=require('path');var timeout=require(_0xfffd('0x1'));var express=require(_0xfffd('0x2'));var router=express[_0xfffd('0x3')]();var fs_extra=require(_0xfffd('0x4'));var auth=require(_0xfffd('0x5'));var interaction=require(_0xfffd('0x6'));var config=require(_0xfffd('0x7'));var controller=require(_0xfffd('0x8'));router[_0xfffd('0x9')]('/',auth['isAuthenticated'](),controller[_0xfffd('0xa')]);router[_0xfffd('0x9')](_0xfffd('0xb'),auth[_0xfffd('0xc')](),controller[_0xfffd('0xd')]);router[_0xfffd('0x9')](_0xfffd('0xe'),auth[_0xfffd('0xc')](),controller['show']);router['get'](_0xfffd('0xf'),auth['isAuthenticated'](),controller[_0xfffd('0x10')]);router[_0xfffd('0x9')]('/:id/canned_answers',auth[_0xfffd('0xc')](),controller[_0xfffd('0x11')]);router['get'](_0xfffd('0x12'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x13')]);router[_0xfffd('0x9')]('/:id/out_servers',auth[_0xfffd('0xc')](),controller[_0xfffd('0x14')]);router[_0xfffd('0x9')](_0xfffd('0x15'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x16')]);router['get'](_0xfffd('0x17'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x18')]);router[_0xfffd('0x9')](_0xfffd('0x19'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x1a')]);router['get'](_0xfffd('0x1b'),auth['isAuthenticated'](),controller[_0xfffd('0x1c')]);router[_0xfffd('0x9')](_0xfffd('0x1d'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x1e')]);router[_0xfffd('0x1f')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0xfffd('0x1f')](_0xfffd('0x20'),auth[_0xfffd('0xc')](),controller['addAnswer']);router[_0xfffd('0x1f')]('/',auth[_0xfffd('0xc')](),controller['create']);router[_0xfffd('0x1f')](_0xfffd('0x12'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x21')]);router[_0xfffd('0x1f')]('/:id/out_servers',auth['isAuthenticated'](),controller[_0xfffd('0x22')]);router[_0xfffd('0x1f')](_0xfffd('0x15'),auth[_0xfffd('0xc')](),controller['addInteraction']);router['post'](_0xfffd('0x17'),auth['isAuthenticated'](),controller[_0xfffd('0x23')]);router['post']('/:id/send',auth['isAuthenticated'](),controller['send']);router['post'](_0xfffd('0x1d'),auth['isAuthenticated'](),controller[_0xfffd('0x24')]);router[_0xfffd('0x25')](_0xfffd('0xe'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x26')]);router[_0xfffd('0x27')]('/:id/dispositions',auth[_0xfffd('0xc')](),controller[_0xfffd('0x28')]);router[_0xfffd('0x27')](_0xfffd('0x20'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x29')]);router[_0xfffd('0x27')](_0xfffd('0x12'),auth['isAuthenticated'](),controller[_0xfffd('0x2a')]);router[_0xfffd('0x27')](_0xfffd('0x2b'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x2c')]);router[_0xfffd('0x27')]('/:id',auth[_0xfffd('0xc')](),controller[_0xfffd('0x2d')]);router['delete'](_0xfffd('0x1d'),auth[_0xfffd('0xc')](),controller[_0xfffd('0x2e')]);module[_0xfffd('0x2f')]=router; \ No newline at end of file +var _0x3918=['addSmtp','addInteraction','addApplications','/:id/send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','express','fs-extra','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/verify','verifySmtp','/:id/users','getAgents','post','addAnswer','create','addImap'];(function(_0x52096b,_0x20bab4){var _0x2b1cc7=function(_0x3f7021){while(--_0x3f7021){_0x52096b['push'](_0x52096b['shift']());}};_0x2b1cc7(++_0x20bab4);}(_0x3918,0x1ac));var _0x8391=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x3918[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x8391('0x0'));var util=require(_0x8391('0x1'));var path=require(_0x8391('0x2'));var timeout=require('connect-timeout');var express=require(_0x8391('0x3'));var router=express['Router']();var fs_extra=require(_0x8391('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8391('0x5'));var config=require('../../config/environment');var controller=require(_0x8391('0x6'));router['get']('/',auth[_0x8391('0x7')](),controller[_0x8391('0x8')]);router[_0x8391('0x9')](_0x8391('0xa'),auth[_0x8391('0x7')](),controller[_0x8391('0xb')]);router['get'](_0x8391('0xc'),auth[_0x8391('0x7')](),controller['show']);router[_0x8391('0x9')](_0x8391('0xd'),auth['isAuthenticated'](),controller[_0x8391('0xe')]);router[_0x8391('0x9')](_0x8391('0xf'),auth[_0x8391('0x7')](),controller[_0x8391('0x10')]);router[_0x8391('0x9')](_0x8391('0x11'),auth[_0x8391('0x7')](),controller['getImap']);router[_0x8391('0x9')](_0x8391('0x12'),auth[_0x8391('0x7')](),controller[_0x8391('0x13')]);router['get'](_0x8391('0x14'),auth[_0x8391('0x7')](),controller[_0x8391('0x15')]);router[_0x8391('0x9')](_0x8391('0x16'),auth[_0x8391('0x7')](),controller[_0x8391('0x17')]);router[_0x8391('0x9')]('/:id/messages',auth[_0x8391('0x7')](),controller['getMessages']);router[_0x8391('0x9')](_0x8391('0x18'),auth[_0x8391('0x7')](),controller[_0x8391('0x19')]);router[_0x8391('0x9')](_0x8391('0x1a'),auth[_0x8391('0x7')](),controller[_0x8391('0x1b')]);router[_0x8391('0x1c')]('/:id/dispositions',auth[_0x8391('0x7')](),controller['addDisposition']);router[_0x8391('0x1c')](_0x8391('0xf'),auth['isAuthenticated'](),controller[_0x8391('0x1d')]);router[_0x8391('0x1c')]('/',auth[_0x8391('0x7')](),controller[_0x8391('0x1e')]);router[_0x8391('0x1c')](_0x8391('0x11'),auth[_0x8391('0x7')](),controller[_0x8391('0x1f')]);router[_0x8391('0x1c')](_0x8391('0x12'),auth[_0x8391('0x7')](),controller[_0x8391('0x20')]);router['post'](_0x8391('0x14'),auth['isAuthenticated'](),controller[_0x8391('0x21')]);router[_0x8391('0x1c')](_0x8391('0x16'),auth[_0x8391('0x7')](),controller[_0x8391('0x22')]);router[_0x8391('0x1c')](_0x8391('0x23'),auth[_0x8391('0x7')](),controller['send']);router[_0x8391('0x1c')](_0x8391('0x1a'),auth[_0x8391('0x7')](),controller[_0x8391('0x24')]);router['put']('/:id',auth[_0x8391('0x7')](),controller[_0x8391('0x25')]);router[_0x8391('0x26')](_0x8391('0xd'),auth[_0x8391('0x7')](),controller[_0x8391('0x27')]);router[_0x8391('0x26')](_0x8391('0xf'),auth[_0x8391('0x7')](),controller[_0x8391('0x28')]);router[_0x8391('0x26')](_0x8391('0x11'),auth['isAuthenticated'](),controller[_0x8391('0x29')]);router['delete'](_0x8391('0x12'),auth[_0x8391('0x7')](),controller[_0x8391('0x2a')]);router['delete'](_0x8391('0xc'),auth[_0x8391('0x7')](),controller[_0x8391('0x2b')]);router[_0x8391('0x26')]('/:id/users',auth[_0x8391('0x7')](),controller[_0x8391('0x2c')]);module[_0x8391('0x2d')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 54c9b66..ca7b335 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 _0x6dea=['setDataValue','mandatoryDisposition','ENUM','gmail','hotmail','outlook365','getDataValue','provider','custom','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x3b2444,_0x4f4e9b){var _0x11a188=function(_0xc9c102){while(--_0xc9c102){_0x3b2444['push'](_0x3b2444['shift']());}};_0x11a188(++_0x4f4e9b);}(_0x6dea,0x1c1));var _0xa6de=function(_0x2447b2,_0x4828ea){_0x2447b2=_0x2447b2-0x0;var _0x445b4f=_0x6dea[_0x2447b2];return _0x445b4f;};'use strict';var Sequelize=require(_0xa6de('0x0'));module[_0xa6de('0x1')]={'description':{'type':Sequelize[_0xa6de('0x2')]},'name':{'type':Sequelize[_0xa6de('0x2')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xa6de('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xa6de('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0xa6de('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xa6de('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xa6de('0x2')],'allowNull':![],'defaultValue':_0xa6de('0x5')},'fontSize':{'type':Sequelize[_0xa6de('0x6')](0x2)[_0xa6de('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xa6de('0x4')],'defaultValue':function(){return _0xa6de('0x8');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa6de('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xa6de('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa6de('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa6de('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa6de('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa6de('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa6de('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xa6de('0x9')},'mandatoryDisposition':{'type':Sequelize[_0xa6de('0x3')],'defaultValue':![],'comment':_0xa6de('0xa'),'set':function(_0x141652){if(!_0x141652)this[_0xa6de('0xb')]('mandatoryDispositionPauseId',null);this[_0xa6de('0xb')](_0xa6de('0xc'),_0x141652);}},'provider':{'type':Sequelize[_0xa6de('0xd')](_0xa6de('0xe'),_0xa6de('0xf'),'yahoo',_0xa6de('0x10')),'defaultValue':null,'get':function(){if(!this[_0xa6de('0x11')](_0xa6de('0x12')))return _0xa6de('0x13');return this[_0xa6de('0x11')](_0xa6de('0x12'));},'set':function(_0x2eb42a){if(_0x2eb42a===_0xa6de('0x13'))_0x2eb42a=null;return this[_0xa6de('0xb')](_0xa6de('0x12'),_0x2eb42a);}}}; \ No newline at end of file +var _0x50d9=['yahoo','getDataValue','provider','sequelize','STRING','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','ENUM'];(function(_0x416dde,_0x474424){var _0x5f0e33=function(_0x2aedb1){while(--_0x2aedb1){_0x416dde['push'](_0x416dde['shift']());}};_0x5f0e33(++_0x474424);}(_0x50d9,0x9f));var _0x950d=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x50d9[_0x47e7cb];return _0x2a8874;};'use strict';var Sequelize=require(_0x950d('0x0'));module['exports']={'description':{'type':Sequelize[_0x950d('0x1')]},'name':{'type':Sequelize[_0x950d('0x1')],'allowNull':![]},'service':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x950d('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x950d('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x950d('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x950d('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x950d('0x3')],'defaultValue':function(){return _0x950d('0x4');}},'notificationSound':{'type':Sequelize[_0x950d('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x950d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x950d('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x950d('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x950d('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x950d('0x5')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x950d('0x6'),'set':function(_0x39d721){if(!_0x39d721)this[_0x950d('0x7')]('mandatoryDispositionPauseId',null);this[_0x950d('0x7')](_0x950d('0x8'),_0x39d721);}},'provider':{'type':Sequelize[_0x950d('0x9')]('gmail','hotmail',_0x950d('0xa'),'outlook365'),'defaultValue':null,'get':function(){if(!this[_0x950d('0xb')]('provider'))return'custom';return this[_0x950d('0xb')](_0x950d('0xc'));},'set':function(_0x11dc55){if(_0x11dc55==='custom')_0x11dc55=null;return this[_0x950d('0x7')](_0x950d('0xc'),_0x11dc55);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 43d574e..1f0be22 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 _0x2ece=['describe','MailAccountId','Disposition','getDispositions','findOne','rows','removeDispositions','addAnswer','getAnswers','hasOwnProperty','CannedAnswer','findAll','removeAnswers','ids','create','key','provider','custom','email','ListId','isNil','active','user','username','password','pass','modernAuthentication','service','host','port','authentication','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','getInteractions','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','Transaction','ISOLATION_LEVELS','MailApplication','findAndCountAll','priority','stack','finally','send','getApplications','getMessages','MailMessage','split','YYYY-MM-DD\x20HH:mm:ss','true','CmList','CmContact','Contacts','updatedAt','from','format','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','List\x20not\x20found','List','messageId','subject','attach','out','Interaction','Messages','CloudProvider','OAuth2','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','util','path','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','get','MailAccounts','UserProfileResource','then','name','index','MailServerOut','Pause','MailAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','params','MailServerIn','Smtp','mandatoryDispositionPause','fields','find','body','Imap','CloudProviderId'];(function(_0x42d21f,_0x30623a){var _0x47c64e=function(_0x22e791){while(--_0x22e791){_0x42d21f['push'](_0x42d21f['shift']());}};_0x47c64e(++_0x30623a);}(_0x2ece,0x11d));var _0xe2ec=function(_0x5c03a4,_0x38d38e){_0x5c03a4=_0x5c03a4-0x0;var _0x1b5c9c=_0x2ece[_0x5c03a4];return _0x1b5c9c;};'use strict';var moment=require(_0xe2ec('0x0'));var BPromise=require('bluebird');var util=require(_0xe2ec('0x1'));var path=require(_0xe2ec('0x2'));var _=require('lodash');var juice=require('juice');var Redis=require('ioredis');var qs=require(_0xe2ec('0x3'));var logger=require(_0xe2ec('0x4'))(_0xe2ec('0x5'));var config=require('../../config/environment');var db=require(_0xe2ec('0x6'))['db'];config[_0xe2ec('0x7')]=_[_0xe2ec('0x8')](config[_0xe2ec('0x7')],{'host':_0xe2ec('0x9'),'port':0x18eb});var socket=require(_0xe2ec('0xa'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xe2ec('0xb')](socket);var jayson=require(_0xe2ec('0xc'));var client=jayson[_0xe2ec('0xd')][_0xe2ec('0xe')]({'port':0x232b});function respondWithRpcPromise(_0x9e129e,_0x65d813,_0x7527b4,_0x1dc017){return new BPromise(function(_0xcde009,_0x1b7b12){var _0x2ad2b2=_0x1dc017||client;return _0x2ad2b2['request'](_0x9e129e,_0x7527b4)['then'](function(_0x14d324){logger[_0xe2ec('0xf')](_0xe2ec('0x10'),_0x65d813,_0xe2ec('0x11'));logger[_0xe2ec('0x12')](_0xe2ec('0x13'),_0x65d813,_0xe2ec('0x11'),JSON[_0xe2ec('0x14')](_0x14d324));if(_0x14d324[_0xe2ec('0x15')]){if(_0x14d324['error'][_0xe2ec('0x16')]===0x1f4){logger[_0xe2ec('0x15')](_0xe2ec('0x10'),_0x65d813,_0x14d324['error']['message']);return _0x1b7b12(_0x14d324[_0xe2ec('0x15')]['message']);}logger['error'](_0xe2ec('0x10'),_0x65d813,_0x14d324['error']['message']);return _0xcde009(_0x14d324[_0xe2ec('0x15')][_0xe2ec('0x17')]);}else{logger[_0xe2ec('0xf')](_0xe2ec('0x10'),_0x65d813,_0xe2ec('0x11'));_0xcde009(_0x14d324[_0xe2ec('0x18')][_0xe2ec('0x17')]);}})[_0xe2ec('0x19')](function(_0x8d3676){logger[_0xe2ec('0x15')](_0xe2ec('0x10'),_0x65d813,_0x8d3676);_0x1b7b12(_0x8d3676);});});}function respondWithStatusCode(_0x48895b,_0x1fa02e){_0x1fa02e=_0x1fa02e||0xcc;return function(_0x2de5f0){if(_0x2de5f0){return _0x48895b[_0xe2ec('0x1a')](_0x1fa02e);}return _0x48895b[_0xe2ec('0x1b')](_0x1fa02e)[_0xe2ec('0x1c')]();};}function respondWithResult(_0x4fb920,_0x22a8af){_0x22a8af=_0x22a8af||0xc8;return function(_0x1501d3){if(_0x1501d3){return _0x4fb920[_0xe2ec('0x1b')](_0x22a8af)[_0xe2ec('0x1d')](_0x1501d3);}};}function respondWithFilteredResult(_0xca939c,_0x5563b2){return function(_0x418ed3){if(_0x418ed3){var _0x276032=typeof _0x5563b2[_0xe2ec('0x1e')]===_0xe2ec('0x1f')&&typeof _0x5563b2['limit']===_0xe2ec('0x1f');var _0x778adb=_0x418ed3['count'];var _0x2b7585=_0x276032?0x0:_0x5563b2[_0xe2ec('0x1e')];var _0x2e127e=_0x276032?_0x418ed3[_0xe2ec('0x20')]:_0x5563b2[_0xe2ec('0x1e')]+_0x5563b2[_0xe2ec('0x21')];var _0x861043;if(_0x2e127e>=_0x778adb){_0x2e127e=_0x778adb;_0x861043=0xc8;}else{_0x861043=0xce;}_0xca939c[_0xe2ec('0x1b')](_0x861043);return _0xca939c[_0xe2ec('0x22')](_0xe2ec('0x23'),_0x2b7585+'-'+_0x2e127e+'/'+_0x778adb)['json'](_0x418ed3);}return null;};}function saveUpdates(_0x2cba80){return function(_0x4b3882){if(_0x4b3882){return _0x4b3882[_0xe2ec('0x24')](_0x2cba80)['then'](function(_0x5ee74b){return _0x5ee74b;});}return null;};}function removeEntity(_0x2054a7){return function(_0x4c159a){if(_0x4c159a){return _0x4c159a['destroy']()['then'](function(){var _0x20d1f7=_0x4c159a[_0xe2ec('0x25')]({'plain':!![]});var _0x273c10=_0xe2ec('0x26');return db[_0xe2ec('0x27')]['destroy']({'where':{'type':_0x273c10,'resourceId':_0x20d1f7['id']}})[_0xe2ec('0x28')](function(){return _0x4c159a;});})['then'](function(){_0x2054a7[_0xe2ec('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16f584){return function(_0x234c43){if(!_0x234c43){_0x16f584[_0xe2ec('0x1a')](0x194);}return _0x234c43;};}function handleError(_0x3baebb,_0x2e2815){_0x2e2815=_0x2e2815||0x1f4;return function(_0x37fbf7){logger['error'](_0x37fbf7['stack']);if(_0x37fbf7[_0xe2ec('0x29')]){delete _0x37fbf7[_0xe2ec('0x29')];}_0x3baebb[_0xe2ec('0x1b')](_0x2e2815)['send'](_0x37fbf7);};}exports[_0xe2ec('0x2a')]=function(_0x2b6d69,_0x32e1d1){var _0x2905e0={'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0xe2ec('0x2b')],'as':'Smtp'},{'model':db[_0xe2ec('0x2c')],'as':'mandatoryDispositionPause'}]},_0x1774d1={},_0x15fbc5={'count':0x0,'rows':[]};var _0x12e478=_['map'](db[_0xe2ec('0x2d')][_0xe2ec('0x2e')],function(_0x3e0443){return{'name':_0x3e0443[_0xe2ec('0x2f')],'type':_0x3e0443[_0xe2ec('0x30')]['key']};});_0x1774d1[_0xe2ec('0x31')]=_[_0xe2ec('0x32')](_0x12e478,_0xe2ec('0x29'));_0x1774d1[_0xe2ec('0x33')]=_[_0xe2ec('0x34')](_0x2b6d69[_0xe2ec('0x33')]);_0x1774d1[_0xe2ec('0x35')]=_['intersection'](_0x1774d1[_0xe2ec('0x31')],_0x1774d1[_0xe2ec('0x33')]);_0x2905e0[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x1774d1['model'],qs['fields'](_0x2b6d69['query']['fields']));_0x2905e0['attributes']=_0x2905e0[_0xe2ec('0x36')][_0xe2ec('0x38')]?_0x2905e0[_0xe2ec('0x36')]:_0x1774d1['model'];if(!_0x2b6d69['query']['hasOwnProperty'](_0xe2ec('0x39'))){_0x2905e0[_0xe2ec('0x21')]=qs[_0xe2ec('0x21')](_0x2b6d69['query'][_0xe2ec('0x21')]);_0x2905e0[_0xe2ec('0x1e')]=qs[_0xe2ec('0x1e')](_0x2b6d69[_0xe2ec('0x33')][_0xe2ec('0x1e')]);}_0x2905e0[_0xe2ec('0x3a')]=qs[_0xe2ec('0x3b')](_0x2b6d69[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x2905e0[_0xe2ec('0x3c')]=qs[_0xe2ec('0x35')](_[_0xe2ec('0x3d')](_0x2b6d69['query'],_0x1774d1[_0xe2ec('0x35')]),_0x12e478);if(_0x2b6d69[_0xe2ec('0x33')][_0xe2ec('0x3e')]){_0x2905e0[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0x2905e0['where'],{'$or':_[_0xe2ec('0x32')](_0x12e478,function(_0x134d7b){if(_0x134d7b[_0xe2ec('0x30')]!==_0xe2ec('0x40')){var _0x2c85ab={};_0x2c85ab[_0x134d7b['name']]={'$like':'%'+_0x2b6d69[_0xe2ec('0x33')][_0xe2ec('0x3e')]+'%'};return _0x2c85ab;}})});}_0x2905e0=_[_0xe2ec('0x3f')]({},_0x2905e0,_0x2b6d69[_0xe2ec('0x41')]);var _0x3df929={'where':_0x2905e0[_0xe2ec('0x3c')]};return db['MailAccount'][_0xe2ec('0x20')](_0x3df929)[_0xe2ec('0x28')](function(_0x16cfc9){_0x15fbc5[_0xe2ec('0x20')]=_0x16cfc9;if(_0x2b6d69[_0xe2ec('0x33')][_0xe2ec('0x42')]){_0x2905e0[_0xe2ec('0x43')]=[{'all':!![]}];}return db[_0xe2ec('0x2d')]['findAll'](_0x2905e0);})[_0xe2ec('0x28')](function(_0x38d811){_0x15fbc5['rows']=_0x38d811;return _0x15fbc5;})['then'](respondWithFilteredResult(_0x32e1d1,_0x2905e0))['catch'](handleError(_0x32e1d1,null));};exports['show']=function(_0x515f32,_0x4393c9){var _0x1d1436={'raw':![],'where':{'id':_0x515f32[_0xe2ec('0x44')]['id']},'include':[{'model':db[_0xe2ec('0x45')],'as':'Imap'},{'model':db[_0xe2ec('0x2b')],'as':_0xe2ec('0x46')},{'model':db[_0xe2ec('0x2c')],'as':_0xe2ec('0x47')}]},_0x547725={};_0x547725['model']=_[_0xe2ec('0x34')](db[_0xe2ec('0x2d')][_0xe2ec('0x2e')]);_0x547725['query']=_[_0xe2ec('0x34')](_0x515f32[_0xe2ec('0x33')]);_0x547725['filters']=_[_0xe2ec('0x37')](_0x547725[_0xe2ec('0x31')],_0x547725[_0xe2ec('0x33')]);_0x1d1436[_0xe2ec('0x36')]=_['intersection'](_0x547725['model'],qs['fields'](_0x515f32[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0x1d1436[_0xe2ec('0x36')]=_0x1d1436['attributes'][_0xe2ec('0x38')]?_0x1d1436[_0xe2ec('0x36')]:_0x547725[_0xe2ec('0x31')];if(_0x515f32[_0xe2ec('0x33')][_0xe2ec('0x42')]){_0x1d1436[_0xe2ec('0x43')]=[{'all':!![]}];}_0x1d1436=_[_0xe2ec('0x3f')]({},_0x1d1436,_0x515f32['options']);return db[_0xe2ec('0x2d')][_0xe2ec('0x49')](_0x1d1436)['then'](handleEntityNotFound(_0x4393c9,null))[_0xe2ec('0x28')](respondWithResult(_0x4393c9,null))[_0xe2ec('0x19')](handleError(_0x4393c9,null));};exports['update']=function(_0x4bc107,_0x2cfc7a){if(_0x4bc107[_0xe2ec('0x4a')]['id']){delete _0x4bc107[_0xe2ec('0x4a')]['id'];}if(_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x4b')]){if(!_0x4bc107['body'][_0xe2ec('0x4b')]['modernAuthentication']){_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x4b')][_0xe2ec('0x4c')]=null;}}if(_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x46')]){if(!_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x46')]['modernAuthentication']){_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x46')][_0xe2ec('0x4c')]=null;}}return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0x4bc107[_0xe2ec('0x44')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xe2ec('0x4b')},{'model':db[_0xe2ec('0x2b')],'as':_0xe2ec('0x46')},{'model':db[_0xe2ec('0x2c')],'as':_0xe2ec('0x47')}]})['then'](handleEntityNotFound(_0x2cfc7a,null))[_0xe2ec('0x28')](saveUpdates(_0x4bc107[_0xe2ec('0x4a')],null))[_0xe2ec('0x28')](function(_0x3a3212){if(_0x3a3212&&_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x4b')]){return db[_0xe2ec('0x45')][_0xe2ec('0x24')](_0x4bc107[_0xe2ec('0x4a')][_0xe2ec('0x4b')],{'where':{'MailAccountId':_0x3a3212['id']}})[_0xe2ec('0x28')](function(){return _0x3a3212;});}return _0x3a3212;})[_0xe2ec('0x28')](function(_0x1b4d9b){if(_0x1b4d9b&&_0x4bc107['body'][_0xe2ec('0x46')]){return db['MailServerOut']['update'](_0x4bc107[_0xe2ec('0x4a')]['Smtp'],{'where':{'MailAccountId':_0x1b4d9b['id']}})[_0xe2ec('0x28')](function(){return _0x1b4d9b;});}return _0x1b4d9b;})[_0xe2ec('0x28')](respondWithResult(_0x2cfc7a,null))[_0xe2ec('0x19')](handleError(_0x2cfc7a,null));};exports['describe']=function(_0x59e275,_0x3143df){return db[_0xe2ec('0x2d')][_0xe2ec('0x4d')]()[_0xe2ec('0x28')](respondWithResult(_0x3143df,null))[_0xe2ec('0x19')](handleError(_0x3143df,null));};exports['addDisposition']=function(_0xd87305,_0x1cf834){if(_0xd87305[_0xe2ec('0x4a')]['id']){delete _0xd87305[_0xe2ec('0x4a')]['id'];}return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0xd87305['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x1cf834,null))['then'](function(_0x14eb1a){if(_0x14eb1a){_0xd87305[_0xe2ec('0x4a')][_0xe2ec('0x4e')]=_0x14eb1a['id'];return db[_0xe2ec('0x4f')]['create'](_0xd87305['body']);}})[_0xe2ec('0x28')](respondWithResult(_0x1cf834,null))[_0xe2ec('0x19')](handleError(_0x1cf834,null));};exports[_0xe2ec('0x50')]=function(_0x2cfd29,_0xbcddf4){var _0xaaff4b={'raw':![],'where':{}};var _0x15f89f={};var _0x5e5bc5={'count':0x0,'rows':[]};return db[_0xe2ec('0x2d')][_0xe2ec('0x51')]({'where':{'id':_0x2cfd29['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0xbcddf4,null))['then'](function(_0xcdea1){if(_0xcdea1){_0x15f89f[_0xe2ec('0x31')]=_['keys'](db[_0xe2ec('0x4f')]['rawAttributes']);_0x15f89f[_0xe2ec('0x33')]=_[_0xe2ec('0x34')](_0x2cfd29[_0xe2ec('0x33')]);_0x15f89f[_0xe2ec('0x35')]=_[_0xe2ec('0x37')](_0x15f89f['model'],_0x15f89f[_0xe2ec('0x33')]);_0xaaff4b[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x15f89f[_0xe2ec('0x31')],qs['fields'](_0x2cfd29[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0xaaff4b[_0xe2ec('0x36')]=_0xaaff4b[_0xe2ec('0x36')][_0xe2ec('0x38')]?_0xaaff4b[_0xe2ec('0x36')]:_0x15f89f[_0xe2ec('0x31')];if(!_0x2cfd29[_0xe2ec('0x33')]['hasOwnProperty'](_0xe2ec('0x39'))){_0xaaff4b[_0xe2ec('0x21')]=qs[_0xe2ec('0x21')](_0x2cfd29[_0xe2ec('0x33')]['limit']);_0xaaff4b[_0xe2ec('0x1e')]=qs[_0xe2ec('0x1e')](_0x2cfd29[_0xe2ec('0x33')][_0xe2ec('0x1e')]);}_0xaaff4b['order']=qs['sort'](_0x2cfd29[_0xe2ec('0x33')]['sort']);_0xaaff4b['where']=qs[_0xe2ec('0x35')](_[_0xe2ec('0x3d')](_0x2cfd29['query'],_0x15f89f[_0xe2ec('0x35')]));_0xaaff4b[_0xe2ec('0x3c')][_0xe2ec('0x4e')]=_0xcdea1['id'];if(_0x2cfd29['query'][_0xe2ec('0x3e')]){_0xaaff4b[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0xaaff4b['where'],{'$or':_[_0xe2ec('0x32')](_0xaaff4b[_0xe2ec('0x36')],function(_0x116e97){var _0x3b6cf0={};_0x3b6cf0[_0x116e97]={'$like':'%'+_0x2cfd29[_0xe2ec('0x33')]['filter']+'%'};return _0x3b6cf0;})});}_0xaaff4b=_['merge']({},_0xaaff4b,_0x2cfd29[_0xe2ec('0x41')]);return db[_0xe2ec('0x4f')][_0xe2ec('0x20')]({'where':_0xaaff4b['where']})['then'](function(_0x385759){_0x5e5bc5['count']=_0x385759;if(_0x2cfd29[_0xe2ec('0x33')][_0xe2ec('0x42')]){_0xaaff4b['include']=[{'all':!![]}];}return db[_0xe2ec('0x4f')]['findAll'](_0xaaff4b);})[_0xe2ec('0x28')](function(_0x38c200){_0x5e5bc5[_0xe2ec('0x52')]=_0x38c200;return _0x5e5bc5;});}})[_0xe2ec('0x28')](respondWithFilteredResult(_0xbcddf4,_0xaaff4b))['catch'](handleError(_0xbcddf4,null));};exports[_0xe2ec('0x53')]=function(_0x4a5f71,_0x5b2daa){return db['MailAccount'][_0xe2ec('0x49')]({'where':{'id':_0x4a5f71[_0xe2ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x5b2daa,null))[_0xe2ec('0x28')](function(_0x592c54){if(_0x592c54){return _0x592c54[_0xe2ec('0x53')](_0x4a5f71['query']['ids']);}})[_0xe2ec('0x28')](respondWithStatusCode(_0x5b2daa,null))[_0xe2ec('0x19')](handleError(_0x5b2daa,null));};exports[_0xe2ec('0x54')]=function(_0x14ff21,_0x273339){if(_0x14ff21[_0xe2ec('0x4a')]['id']){delete _0x14ff21[_0xe2ec('0x4a')]['id'];}return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0x14ff21[_0xe2ec('0x44')]['id']}})['then'](handleEntityNotFound(_0x273339,null))[_0xe2ec('0x28')](function(_0x2338c8){if(_0x2338c8){_0x14ff21[_0xe2ec('0x4a')][_0xe2ec('0x4e')]=_0x2338c8['id'];return db['CannedAnswer']['create'](_0x14ff21['body']);}})[_0xe2ec('0x28')](respondWithResult(_0x273339,null))['catch'](handleError(_0x273339,null));};exports[_0xe2ec('0x55')]=function(_0x238759,_0x2cb8b3){var _0x101cae={'raw':![],'where':{}};var _0x58a840={};var _0x11fa5d={'count':0x0,'rows':[]};return db[_0xe2ec('0x2d')]['findOne']({'where':{'id':_0x238759['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x2cb8b3,null))[_0xe2ec('0x28')](function(_0x477f2e){if(_0x477f2e){_0x58a840[_0xe2ec('0x31')]=_['keys'](db['CannedAnswer'][_0xe2ec('0x2e')]);_0x58a840[_0xe2ec('0x33')]=_[_0xe2ec('0x34')](_0x238759['query']);_0x58a840[_0xe2ec('0x35')]=_[_0xe2ec('0x37')](_0x58a840[_0xe2ec('0x31')],_0x58a840[_0xe2ec('0x33')]);_0x101cae[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x58a840['model'],qs['fields'](_0x238759[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0x101cae[_0xe2ec('0x36')]=_0x101cae['attributes'][_0xe2ec('0x38')]?_0x101cae[_0xe2ec('0x36')]:_0x58a840[_0xe2ec('0x31')];if(!_0x238759['query'][_0xe2ec('0x56')]('nolimit')){_0x101cae[_0xe2ec('0x21')]=qs[_0xe2ec('0x21')](_0x238759['query'][_0xe2ec('0x21')]);_0x101cae[_0xe2ec('0x1e')]=qs[_0xe2ec('0x1e')](_0x238759['query']['offset']);}_0x101cae[_0xe2ec('0x3a')]=qs[_0xe2ec('0x3b')](_0x238759[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x101cae[_0xe2ec('0x3c')]=qs['filters'](_['pick'](_0x238759[_0xe2ec('0x33')],_0x58a840['filters']));_0x101cae['where'][_0xe2ec('0x4e')]=_0x477f2e['id'];if(_0x238759['query']['filter']){_0x101cae[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0x101cae[_0xe2ec('0x3c')],{'$or':_[_0xe2ec('0x32')](_0x101cae[_0xe2ec('0x36')],function(_0x3fe04e){var _0x4db613={};_0x4db613[_0x3fe04e]={'$like':'%'+_0x238759['query'][_0xe2ec('0x3e')]+'%'};return _0x4db613;})});}_0x101cae=_[_0xe2ec('0x3f')]({},_0x101cae,_0x238759[_0xe2ec('0x41')]);return db[_0xe2ec('0x57')][_0xe2ec('0x20')]({'where':_0x101cae['where']})[_0xe2ec('0x28')](function(_0x54a674){_0x11fa5d[_0xe2ec('0x20')]=_0x54a674;if(_0x238759[_0xe2ec('0x33')][_0xe2ec('0x42')]){_0x101cae[_0xe2ec('0x43')]=[{'all':!![]}];}return db['CannedAnswer'][_0xe2ec('0x58')](_0x101cae);})['then'](function(_0x17b6e9){_0x11fa5d[_0xe2ec('0x52')]=_0x17b6e9;return _0x11fa5d;});}})[_0xe2ec('0x28')](respondWithFilteredResult(_0x2cb8b3,_0x101cae))['catch'](handleError(_0x2cb8b3,null));};exports[_0xe2ec('0x59')]=function(_0x4cf314,_0x360292){return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0x4cf314[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x360292,null))[_0xe2ec('0x28')](function(_0x197de1){if(_0x197de1){return _0x197de1[_0xe2ec('0x59')](_0x4cf314[_0xe2ec('0x33')][_0xe2ec('0x5a')]);}})[_0xe2ec('0x28')](respondWithStatusCode(_0x360292,null))[_0xe2ec('0x19')](handleError(_0x360292,null));};exports[_0xe2ec('0x5b')]=function(_0x1e9bd5,_0x588e99){var _0x2de761={'name':_0x1e9bd5['body'][_0xe2ec('0x29')],'key':_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x5c')],'provider':_0x1e9bd5['body'][_0xe2ec('0x5d')]===_0xe2ec('0x5e')?null:_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x5d')],'email':_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x5f')],'ListId':_0x1e9bd5['body'][_0xe2ec('0x60')],'active':!_[_0xe2ec('0x61')](_0x1e9bd5['body'][_0xe2ec('0x62')])?_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x62')]:!![],'description':_0x1e9bd5[_0xe2ec('0x4a')]['description']||null,'Imap':{},'Smtp':{}};if(_0x2de761[_0xe2ec('0x5d')]){_0x2de761['Imap']['user']=_0x2de761['Smtp'][_0xe2ec('0x63')]=_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x64')];_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x65')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x66')]=_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x65')];if(_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x67')]){_0x2de761[_0xe2ec('0x4b')]['modernAuthentication']=_0x2de761['Smtp'][_0xe2ec('0x67')]=!![];_0x2de761[_0xe2ec('0x4b')]['CloudProviderId']=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x4c')]=_0x1e9bd5['body'][_0xe2ec('0x4c')];_0x2de761['Imap'][_0xe2ec('0x65')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x66')]=null;}else{_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x4c')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x4c')]=null;}_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x68')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x68')]=null;_0x2de761['Imap'][_0xe2ec('0x69')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x69')]=null;_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x6a')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x6a')]=null;}else{if(_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x6b')]){_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x63')]=_0x2de761[_0xe2ec('0x46')]['user']=_0x1e9bd5['body']['username'];_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x65')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x66')]=_0x1e9bd5['body'][_0xe2ec('0x65')];}else{_0x2de761['Imap'][_0xe2ec('0x6b')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x6b')]=![];_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x63')]=_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x63')]=null;_0x2de761['Imap'][_0xe2ec('0x65')]=_0x2de761['Smtp'][_0xe2ec('0x66')]=null;}_0x2de761['Imap'][_0xe2ec('0x69')]=_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x4b')][_0xe2ec('0x69')];_0x2de761[_0xe2ec('0x4b')][_0xe2ec('0x6a')]=_0x1e9bd5[_0xe2ec('0x4a')][_0xe2ec('0x4b')][_0xe2ec('0x6a')];_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x69')]=_0x1e9bd5['body'][_0xe2ec('0x46')]['host'];_0x2de761[_0xe2ec('0x46')][_0xe2ec('0x6a')]=_0x1e9bd5['body'][_0xe2ec('0x46')][_0xe2ec('0x6a')];}return db['MailAccount'][_0xe2ec('0x5b')](_0x2de761,{'include':[{'model':db[_0xe2ec('0x2b')],'as':_0xe2ec('0x46')},{'model':db[_0xe2ec('0x45')],'as':'Imap'}]})[_0xe2ec('0x28')](function(_0x1572dc){var _0x5f8e35=_0x1e9bd5[_0xe2ec('0x63')]['get']({'plain':!![]});if(!_0x5f8e35)throw new Error(_0xe2ec('0x6c'));if(_0x5f8e35['role']==='user'){var _0x1f2331=_0x1572dc[_0xe2ec('0x25')]({'plain':!![]});return db[_0xe2ec('0x6d')][_0xe2ec('0x49')]({'where':{'name':'MailAccounts','userProfileId':_0x5f8e35['userProfileId']},'raw':!![]})[_0xe2ec('0x28')](function(_0xba778e){if(_0xba778e&&_0xba778e[_0xe2ec('0x6e')]===0x0){return db[_0xe2ec('0x27')][_0xe2ec('0x5b')]({'name':_0x1f2331[_0xe2ec('0x29')],'resourceId':_0x1f2331['id'],'type':_0xba778e[_0xe2ec('0x29')],'sectionId':_0xba778e['id']},{})[_0xe2ec('0x28')](function(){return _0x1572dc;});}else{return _0x1572dc;}})[_0xe2ec('0x19')](function(_0x36dc1f){logger[_0xe2ec('0x15')](_0xe2ec('0x6f'),_0x36dc1f);throw _0x36dc1f;});}return _0x1572dc;})[_0xe2ec('0x28')](respondWithResult(_0x588e99,0xc9))['catch'](handleError(_0x588e99,null));};exports[_0xe2ec('0x70')]=function(_0x456ce0,_0x38a141){return db['MailAccount']['findOne']({'where':{'id':_0x456ce0[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x38a141,null))[_0xe2ec('0x28')](function(_0x5d0d6f){if(_0x5d0d6f){return _0x5d0d6f['getImap']();}return null;})[_0xe2ec('0x28')](respondWithResult(_0x38a141,null))[_0xe2ec('0x19')](handleError(_0x38a141,null));};exports['addImap']=function(_0x1a4929,_0x5499f7){if(_0x1a4929[_0xe2ec('0x4a')]['id']){delete _0x1a4929[_0xe2ec('0x4a')]['id'];}return db['MailAccount'][_0xe2ec('0x49')]({'where':{'id':_0x1a4929['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x5499f7,null))[_0xe2ec('0x28')](function(_0xa58fb0){if(_0xa58fb0){_0x1a4929[_0xe2ec('0x4a')][_0xe2ec('0x4e')]=_0xa58fb0['id'];return db['MailServerIn']['create'](_0x1a4929[_0xe2ec('0x4a')]);}})[_0xe2ec('0x28')](respondWithResult(_0x5499f7,null))[_0xe2ec('0x19')](handleError(_0x5499f7,null));};exports[_0xe2ec('0x71')]=function(_0x2f132f,_0x4f36fc){return db[_0xe2ec('0x2d')]['findOne']({'where':{'id':_0x2f132f[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x4f36fc,null))[_0xe2ec('0x28')](function(_0x3195a4){if(_0x3195a4){return _0x3195a4[_0xe2ec('0x72')](null);}return null;})[_0xe2ec('0x28')](respondWithStatusCode(_0x4f36fc,null))['catch'](handleError(_0x4f36fc,null));};exports['getSmtp']=function(_0x4e85af,_0x37326c){return db['MailAccount'][_0xe2ec('0x51')]({'where':{'id':_0x4e85af['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x37326c,null))[_0xe2ec('0x28')](function(_0x2c75cc){if(_0x2c75cc){return _0x2c75cc[_0xe2ec('0x73')]();}return null;})[_0xe2ec('0x28')](respondWithResult(_0x37326c,null))['catch'](handleError(_0x37326c,null));};exports[_0xe2ec('0x74')]=function(_0x55b246,_0x4f6d8d){if(_0x55b246['body']['id']){delete _0x55b246[_0xe2ec('0x4a')]['id'];}return db['MailAccount'][_0xe2ec('0x49')]({'where':{'id':_0x55b246['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x4f6d8d,null))[_0xe2ec('0x28')](function(_0x1e6b8b){if(_0x1e6b8b){_0x55b246['body'][_0xe2ec('0x4e')]=_0x1e6b8b['id'];return db[_0xe2ec('0x2b')][_0xe2ec('0x5b')](_0x55b246[_0xe2ec('0x4a')]);}})[_0xe2ec('0x28')](respondWithResult(_0x4f6d8d,null))[_0xe2ec('0x19')](handleError(_0x4f6d8d,null));};exports[_0xe2ec('0x75')]=function(_0x11313c,_0x3c9601){return db['MailAccount'][_0xe2ec('0x51')]({'where':{'id':_0x11313c['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x3c9601,null))[_0xe2ec('0x28')](function(_0x4d1087){if(_0x4d1087){return _0x4d1087[_0xe2ec('0x76')](null);}return null;})['then'](respondWithStatusCode(_0x3c9601,null))['catch'](handleError(_0x3c9601,null));};exports[_0xe2ec('0x77')]=function(_0x11c649,_0x5298be){return db[_0xe2ec('0x78')][_0xe2ec('0x49')]({'where':{'id':_0x11c649[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x5298be,null))[_0xe2ec('0x28')](function(_0x20a847){if(_0x20a847){return _0x20a847['addInteraction'](_0x11c649[_0xe2ec('0x4a')][_0xe2ec('0x5a')],_['omit'](_0x11c649[_0xe2ec('0x4a')],[_0xe2ec('0x5a'),'id'])||{});}})[_0xe2ec('0x28')](respondWithResult(_0x5298be,null))[_0xe2ec('0x19')](handleError(_0x5298be,null));};exports[_0xe2ec('0x79')]=function(_0x8e0d64,_0x1a6045){var _0x9e1c06={'raw':![],'where':{}};var _0x1ad6e3={};var _0x2d3fc2={'count':0x0,'rows':[]};return db['MailAccount'][_0xe2ec('0x51')]({'where':{'id':_0x8e0d64['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x1a6045,null))[_0xe2ec('0x28')](function(_0x2063e1){if(_0x2063e1){_0x1ad6e3['model']=_[_0xe2ec('0x34')](db[_0xe2ec('0x78')]['rawAttributes']);_0x1ad6e3['query']=_[_0xe2ec('0x34')](_0x8e0d64[_0xe2ec('0x33')]);_0x1ad6e3[_0xe2ec('0x35')]=_[_0xe2ec('0x37')](_0x1ad6e3[_0xe2ec('0x31')],_0x1ad6e3[_0xe2ec('0x33')]);_0x9e1c06[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x1ad6e3[_0xe2ec('0x31')],qs['fields'](_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0x9e1c06['attributes']=_0x9e1c06[_0xe2ec('0x36')]['length']?_0x9e1c06[_0xe2ec('0x36')]:_0x1ad6e3[_0xe2ec('0x31')];if(!_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x56')](_0xe2ec('0x39'))){_0x9e1c06[_0xe2ec('0x21')]=qs['limit'](_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x21')]);_0x9e1c06[_0xe2ec('0x1e')]=qs[_0xe2ec('0x1e')](_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x1e')]);}_0x9e1c06[_0xe2ec('0x3a')]=qs['sort'](_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x9e1c06[_0xe2ec('0x3c')]=qs[_0xe2ec('0x35')](_['pick'](_0x8e0d64[_0xe2ec('0x33')],_0x1ad6e3[_0xe2ec('0x35')]));_0x9e1c06[_0xe2ec('0x3c')]['MailAccountId']=_0x2063e1['id'];if(_0x8e0d64['query'][_0xe2ec('0x3e')]){_0x9e1c06[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0x9e1c06[_0xe2ec('0x3c')],{'$or':_['map'](_0x9e1c06[_0xe2ec('0x36')],function(_0x5ea8d7){var _0x58dc99={};_0x58dc99[_0x5ea8d7]={'$like':'%'+_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x3e')]+'%'};return _0x58dc99;})});}_0x9e1c06=_[_0xe2ec('0x3f')]({},_0x9e1c06,_0x8e0d64[_0xe2ec('0x41')]);return db['MailInteraction'][_0xe2ec('0x20')]({'where':_0x9e1c06[_0xe2ec('0x3c')]})[_0xe2ec('0x28')](function(_0xb53a69){_0x2d3fc2[_0xe2ec('0x20')]=_0xb53a69;if(_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x42')]){_0x9e1c06[_0xe2ec('0x43')]=[{'model':db['CmContact'],'as':_0xe2ec('0x7a'),'required':![]},{'model':db[_0xe2ec('0x7b')],'as':_0xe2ec('0x7c'),'attributes':[_0xe2ec('0x29'),_0xe2ec('0x7d'),_0xe2ec('0x7e')],'required':![]},{'model':db[_0xe2ec('0x7f')],'as':_0xe2ec('0x80'),'attributes':['id',_0xe2ec('0x29'),_0xe2ec('0x81')],'where':_0x8e0d64[_0xe2ec('0x33')]['tag']?{'id':_0x8e0d64[_0xe2ec('0x33')][_0xe2ec('0x82')]}:undefined,'required':_0x8e0d64[_0xe2ec('0x33')]['tag']?!![]:![]}];}return db[_0xe2ec('0x78')]['findAll'](_0x9e1c06);})[_0xe2ec('0x28')](function(_0x37e9bf){_0x2d3fc2[_0xe2ec('0x52')]=_0x37e9bf;return _0x2d3fc2;});}})[_0xe2ec('0x28')](respondWithFilteredResult(_0x1a6045,_0x9e1c06))['catch'](handleError(_0x1a6045,null));};exports['addApplications']=function addApplications(_0xaf67b,_0x34ec6a){var _0x25dfda=_0xaf67b['params']['id'];var _0x3b0b11=_0xaf67b[_0xe2ec('0x4a')];var _0x148e20=0xc8;var _0x4c228e=null;return db[_0xe2ec('0x83')]['transaction']({'isolationLevel':db[_0xe2ec('0x83')][_0xe2ec('0x84')][_0xe2ec('0x85')]['READ_COMMITTED']},function(_0x49e680){return db[_0xe2ec('0x2d')][_0xe2ec('0x51')]({'where':{'id':_0x25dfda},'transaction':_0x49e680})[_0xe2ec('0x28')](function(_0x5eae74){if(_0x5eae74){return db[_0xe2ec('0x86')]['destroy']({'where':{'MailAccountId':_0x25dfda},'transaction':_0x49e680})[_0xe2ec('0x28')](function(){var _0x4a1c00=_[_0xe2ec('0x32')](_0x3b0b11,function(_0x5e5e49){_0x5e5e49[_0xe2ec('0x4e')]=_0x25dfda;return _0x5e5e49;});return db['MailApplication']['bulkCreate'](_0x4a1c00,{'transaction':_0x49e680});});}else{_0x148e20=0x194;_0x4c228e=[];}});})['then'](function(){if(_0x148e20!==0x194){return db[_0xe2ec('0x86')][_0xe2ec('0x87')]({'where':{'MailAccountId':_0x25dfda},'order':_0xe2ec('0x88')})[_0xe2ec('0x28')](function(_0x50f36a){_0x4c228e=_0x50f36a;});}})[_0xe2ec('0x19')](function(_0x5e004d){_0x148e20=0x1f4;logger[_0xe2ec('0x15')](_0x5e004d[_0xe2ec('0x89')]);if(_0x5e004d[_0xe2ec('0x29')]){delete _0x5e004d['name'];}_0x4c228e=_0x5e004d;})[_0xe2ec('0x8a')](function(){if(_0x4c228e===null){_0x34ec6a[_0xe2ec('0x1a')](_0x148e20);}else{if(_0x148e20===0x1f4){_0x34ec6a[_0xe2ec('0x1b')](_0x148e20)[_0xe2ec('0x8b')](_0x4c228e);}else{_0x34ec6a[_0xe2ec('0x1b')](_0x148e20)['json'](_0x4c228e);}}});};exports[_0xe2ec('0x8c')]=function(_0x2a42bb,_0x56b3fa){var _0x1f080b={};var _0x96cff9={};var _0x3e87cf;var _0xfd14f;return db[_0xe2ec('0x2d')][_0xe2ec('0x51')]({'where':{'id':_0x2a42bb['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x56b3fa,null))[_0xe2ec('0x28')](function(_0x2ebef0){if(_0x2ebef0){_0x3e87cf=_0x2ebef0;_0x96cff9[_0xe2ec('0x31')]=_[_0xe2ec('0x34')](db[_0xe2ec('0x86')][_0xe2ec('0x2e')]);_0x96cff9[_0xe2ec('0x33')]=_[_0xe2ec('0x34')](_0x2a42bb[_0xe2ec('0x33')]);_0x96cff9[_0xe2ec('0x35')]=_['intersection'](_0x96cff9['model'],_0x96cff9['query']);_0x1f080b[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0x96cff9['model'],qs[_0xe2ec('0x48')](_0x2a42bb[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0x1f080b['attributes']=_0x1f080b['attributes']['length']?_0x1f080b[_0xe2ec('0x36')]:_0x96cff9[_0xe2ec('0x31')];_0x1f080b[_0xe2ec('0x3a')]=qs[_0xe2ec('0x3b')](_0x2a42bb[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x1f080b[_0xe2ec('0x3c')]=qs[_0xe2ec('0x35')](_[_0xe2ec('0x3d')](_0x2a42bb[_0xe2ec('0x33')],_0x96cff9[_0xe2ec('0x35')]));if(_0x2a42bb[_0xe2ec('0x33')][_0xe2ec('0x3e')]){_0x1f080b['where']=_['merge'](_0x1f080b[_0xe2ec('0x3c')],{'$or':_[_0xe2ec('0x32')](_0x1f080b[_0xe2ec('0x36')],function(_0x2e98dc){var _0x3f8459={};_0x3f8459[_0x2e98dc]={'$like':'%'+_0x2a42bb[_0xe2ec('0x33')]['filter']+'%'};return _0x3f8459;})});}_0x1f080b=_[_0xe2ec('0x3f')]({},_0x1f080b,_0x2a42bb[_0xe2ec('0x41')]);return _0x3e87cf['getApplications'](_0x1f080b);}})['then'](function(_0x29db8f){if(_0x29db8f){_0xfd14f=_0x29db8f[_0xe2ec('0x38')];if(!_0x2a42bb[_0xe2ec('0x33')]['hasOwnProperty'](_0xe2ec('0x39'))){_0x1f080b[_0xe2ec('0x21')]=qs[_0xe2ec('0x21')](_0x2a42bb[_0xe2ec('0x33')][_0xe2ec('0x21')]);_0x1f080b[_0xe2ec('0x1e')]=qs['offset'](_0x2a42bb[_0xe2ec('0x33')]['offset']);}return _0x3e87cf['getApplications'](_0x1f080b);}})[_0xe2ec('0x28')](function(_0x4c7895){if(_0x4c7895){return _0x4c7895?{'count':_0xfd14f,'rows':_0x4c7895}:null;}})[_0xe2ec('0x28')](respondWithResult(_0x56b3fa,null))['catch'](handleError(_0x56b3fa,null));};exports[_0xe2ec('0x8d')]=function(_0x4826c2,_0x4f4f10){var _0x4706e9={'raw':!![],'where':{}};var _0x5acf59={};var _0x445a22={'count':0x0,'rows':[]};return db[_0xe2ec('0x2d')][_0xe2ec('0x51')]({'where':{'id':_0x4826c2[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x4f4f10,null))[_0xe2ec('0x28')](function(_0xdc68b8){if(_0xdc68b8){_0x5acf59[_0xe2ec('0x31')]=_[_0xe2ec('0x34')](db[_0xe2ec('0x8e')][_0xe2ec('0x2e')]);_0x5acf59['query']=_['keys'](_0x4826c2[_0xe2ec('0x33')]);_0x5acf59[_0xe2ec('0x35')]=_[_0xe2ec('0x37')](_0x5acf59[_0xe2ec('0x31')],_0x5acf59[_0xe2ec('0x33')]);_0x4706e9['attributes']=_['intersection'](_0x5acf59[_0xe2ec('0x31')],qs[_0xe2ec('0x48')](_0x4826c2[_0xe2ec('0x33')][_0xe2ec('0x48')]));_0x4706e9[_0xe2ec('0x36')]=_0x4706e9[_0xe2ec('0x36')]['length']?_0x4706e9[_0xe2ec('0x36')]:_0x5acf59[_0xe2ec('0x31')];if(!_0x4826c2[_0xe2ec('0x33')]['hasOwnProperty']('nolimit')){_0x4706e9[_0xe2ec('0x21')]=qs[_0xe2ec('0x21')](_0x4826c2[_0xe2ec('0x33')]['limit']);_0x4706e9[_0xe2ec('0x1e')]=qs['offset'](_0x4826c2[_0xe2ec('0x33')]['offset']);}_0x4706e9[_0xe2ec('0x3a')]=qs[_0xe2ec('0x3b')](_0x4826c2[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x4706e9[_0xe2ec('0x3c')]=qs[_0xe2ec('0x35')](_[_0xe2ec('0x3d')](_0x4826c2[_0xe2ec('0x33')],_0x5acf59[_0xe2ec('0x35')]));_0x4706e9['where'][_0xe2ec('0x4e')]=_0xdc68b8['id'];if(_0x4826c2[_0xe2ec('0x33')][_0xe2ec('0x3e')]){_0x4706e9[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0x4706e9['where'],{'$or':_[_0xe2ec('0x32')](_0x4706e9[_0xe2ec('0x36')],function(_0x202acb){var _0x388469={};_0x388469[_0x202acb]={'$like':'%'+_0x4826c2[_0xe2ec('0x33')][_0xe2ec('0x3e')]+'%'};return _0x388469;})});}if(_0x4826c2[_0xe2ec('0x33')]['$gte']){var _0x33fd48=_0x4826c2[_0xe2ec('0x33')]['$gte'][_0xe2ec('0x8f')](',');var _0x5620ab={};_0x5620ab[_0x33fd48[0x0]]={'$gte':moment(_0x33fd48[0x1])['format'](_0xe2ec('0x90'))};_0x4706e9[_0xe2ec('0x3c')]=_[_0xe2ec('0x3f')](_0x4706e9['where'],_0x5620ab);}_0x4706e9=_[_0xe2ec('0x3f')]({},_0x4706e9,_0x4826c2[_0xe2ec('0x41')]);return db['MailMessage'][_0xe2ec('0x20')]({'where':_0x4706e9[_0xe2ec('0x3c')]})['then'](function(_0x4f4577){_0x445a22['count']=_0x4f4577;if(_0x4826c2['query'][_0xe2ec('0x42')]){_0x4706e9['include']=[{'all':!![]}];}return db['MailMessage'][_0xe2ec('0x58')](_0x4706e9);})['then'](function(_0x1ba886){if(_0x4826c2[_0xe2ec('0x33')]['inlineCss']===_0xe2ec('0x91')){for(var _0x107dfd=0x0;_0x107dfd<_0x1ba886['length'];_0x107dfd++){_0x1ba886[_0x107dfd]['body']=juice(_0x1ba886[_0x107dfd][_0xe2ec('0x4a')]);}}_0x445a22[_0xe2ec('0x52')]=_0x1ba886;return _0x445a22;});}})['then'](respondWithFilteredResult(_0x4f4f10,_0x4706e9))['catch'](handleError(_0x4f4f10,null));};exports[_0xe2ec('0x8b')]=function(_0x402b82,_0x12023f){var _0x1df796,_0x4bd04c={},_0x25e8b5;if(_0x402b82[_0xe2ec('0x4a')]['to']){_0x25e8b5=_0x402b82[_0xe2ec('0x4a')]['to'][_0xe2ec('0x8f')](',')[0x0];}return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0x402b82[_0xe2ec('0x44')]['id']},'include':[{'model':db[_0xe2ec('0x92')],'as':'List','include':[{'model':db[_0xe2ec('0x93')],'as':_0xe2ec('0x94'),'where':{'email':_0x25e8b5},'limit':0x1,'order':[[_0xe2ec('0x95'),'DESC']]}]},{'model':db[_0xe2ec('0x2b')],'as':'Smtp','raw':!![]}]})[_0xe2ec('0x28')](handleEntityNotFound(_0x12023f,null))[_0xe2ec('0x28')](function(_0x3e93df){if(_0x3e93df){_0x1df796=_0x3e93df;if(_0x3e93df[_0xe2ec('0x46')]){if(_[_0xe2ec('0x61')](_0x402b82['body'][_0xe2ec('0x96')])){_0x402b82['body'][_0xe2ec('0x96')]=util[_0xe2ec('0x97')]('%s\x20<%s>',_0x3e93df[_0xe2ec('0x29')],_0x3e93df[_0xe2ec('0x5f')]||_0x3e93df['Smtp']['user']);}if(_0x402b82[_0xe2ec('0x4a')][_0xe2ec('0x98')]&&_0x402b82['body'][_0xe2ec('0x98')][_0xe2ec('0x38')]){for(var _0x1e99ed=0x0;_0x1e99ed<_0x402b82[_0xe2ec('0x4a')][_0xe2ec('0x98')][_0xe2ec('0x38')];_0x1e99ed+=0x1){_0x402b82[_0xe2ec('0x4a')]['attachments'][_0x1e99ed]={'filename':_0x402b82['body']['attachments'][_0x1e99ed][_0xe2ec('0x29')],'path':path[_0xe2ec('0x99')](config[_0xe2ec('0x9a')],_0xe2ec('0x9b'),_0x402b82['body'][_0xe2ec('0x98')][_0x1e99ed][_0xe2ec('0x9c')])};}}var _0x279ec0={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x3e93df[_0xe2ec('0x46')]['service'])){if(_0x3e93df['Smtp'][_0xe2ec('0x6b')]){_0x279ec0[_0xe2ec('0x9d')]={'user':_0x3e93df[_0xe2ec('0x46')]['user'],'pass':_0x3e93df[_0xe2ec('0x46')][_0xe2ec('0x66')]};}_0x279ec0[_0xe2ec('0x69')]=_0x3e93df[_0xe2ec('0x46')]['host'];_0x279ec0[_0xe2ec('0x6a')]=_0x3e93df[_0xe2ec('0x46')][_0xe2ec('0x6a')];_0x279ec0[_0xe2ec('0x9e')]=_0x3e93df[_0xe2ec('0x46')][_0xe2ec('0x9e')];}else{_0x279ec0[_0xe2ec('0x68')]=_0x3e93df[_0xe2ec('0x46')][_0xe2ec('0x68')];_0x279ec0[_0xe2ec('0x9d')]={'user':_0x3e93df['Smtp'][_0xe2ec('0x63')],'pass':_0x3e93df[_0xe2ec('0x46')]['pass']};}return respondWithRpcPromise(_0xe2ec('0x9f'),'sendMail',{'account':_0x279ec0,'message':_0x402b82[_0xe2ec('0x4a')]});}else{throw new Error(_0xe2ec('0xa0'));}}})[_0xe2ec('0x28')](function(_0x2cd2ea){if(_0x2cd2ea){_0x4bd04c=_0x2cd2ea;if(_0x1df796[_0xe2ec('0xa1')]){if(_0x1df796['List'][_0xe2ec('0x94')][_0xe2ec('0x38')]){return _0x1df796['List'][_0xe2ec('0x94')][0x0];}else{return db[_0xe2ec('0x93')][_0xe2ec('0x5b')](_[_0xe2ec('0x8')](_0x402b82[_0xe2ec('0x4a')],{'firstName':_0x402b82['body']['to'],'email':_0x402b82[_0xe2ec('0x4a')]['to'],'phone':_0x402b82['body']['to'],'ListId':_0x1df796[_0xe2ec('0x60')]}));}}else{throw new Error(_0xe2ec('0xa0'));}}})[_0xe2ec('0x28')](function(_0x1c47e7){if(_0x1c47e7){var _0x1d5298={'UserId':_0x402b82[_0xe2ec('0x63')]['id'],'ContactId':_0x1c47e7['id'],'MailAccountId':_0x1df796['id'],'inReplyTo':_0x4bd04c[_0xe2ec('0xa2')],'to':_0x402b82['body'][_0xe2ec('0x96')],'cc':_0x402b82[_0xe2ec('0x4a')]['cc'],'subject':_0x402b82[_0xe2ec('0x4a')][_0xe2ec('0xa3')],'attach':_0x402b82[_0xe2ec('0x4a')][_0xe2ec('0xa4')],'firstMsgDirection':_0xe2ec('0xa5'),'lastMsgAt':moment()[_0xe2ec('0x97')](_0xe2ec('0x90')),'lastMsgDirection':_0xe2ec('0xa5'),'Messages':[_['merge'](_0x402b82[_0xe2ec('0x4a')],{'messageId':_0x4bd04c['messageId'],'sentAt':moment()[_0xe2ec('0x97')](_0xe2ec('0x90')),'read':!![],'MailAccountId':_0x1df796['id'],'UserId':_0x402b82['user']['id'],'ContactId':_0x1c47e7['id']})]};if(_0x402b82[_0xe2ec('0x4a')]['Interaction']){_0x1d5298=_[_0xe2ec('0x3f')](_0x1d5298,_0x402b82[_0xe2ec('0x4a')][_0xe2ec('0xa6')]);}return db['MailInteraction'][_0xe2ec('0x5b')](_0x1d5298,{'include':[{'model':db[_0xe2ec('0x8e')],'as':_0xe2ec('0xa7')}]});}})[_0xe2ec('0x28')](respondWithResult(_0x12023f,null))[_0xe2ec('0x19')](handleError(_0x12023f,null));};exports['verifySmtp']=function(_0x5edbd1,_0x3f9079){return db[_0xe2ec('0x2d')][_0xe2ec('0x49')]({'where':{'id':_0x5edbd1['params']['id']},'include':[{'model':db[_0xe2ec('0x2b')],'as':_0xe2ec('0x46'),'raw':!![],'include':[{'model':db[_0xe2ec('0xa8')],'as':_0xe2ec('0xa8'),'raw':!![]}]}]})[_0xe2ec('0x28')](handleEntityNotFound(_0x3f9079,null))[_0xe2ec('0x28')](function(_0x16d1f6){if(!_0x16d1f6[_0xe2ec('0x46')])return;var _0x151e7d={'id':_0x16d1f6['id'],'tls':{'rejectUnauthorized':![]}};if(_0x16d1f6[_0xe2ec('0x5d')]!==_0xe2ec('0x5e')){_0x151e7d[_0xe2ec('0x68')]=_0x16d1f6[_0xe2ec('0x5d')];}else{_0x151e7d[_0xe2ec('0x69')]=_0x16d1f6[_0xe2ec('0x46')]['host'];_0x151e7d['port']=_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x6a')];_0x151e7d[_0xe2ec('0x9e')]=_0x16d1f6[_0xe2ec('0x46')]['secure'];}if(_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x6b')]){if(_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x67')]){_0x151e7d[_0xe2ec('0x9d')]={'type':_0xe2ec('0xa9'),'user':_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x63')],'accessToken':_0x16d1f6[_0xe2ec('0x46')]['CloudProvider']['data5']};}else{_0x151e7d['auth']={'user':_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x63')],'pass':_0x16d1f6[_0xe2ec('0x46')][_0xe2ec('0x66')]};}}return respondWithRpcPromise(_0xe2ec('0xaa'),'verifySmtp',{'account':_0x151e7d});})['then'](respondWithResult(_0x3f9079,null))[_0xe2ec('0x19')](handleError(_0x3f9079,null));};exports['destroy']=function(_0x58b498,_0xb4c8f1){return db[_0xe2ec('0x2d')]['find']({'where':{'id':_0x58b498[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0xb4c8f1,null))['then'](function(_0x334ee8){if(_0x334ee8&&_0x334ee8[_0xe2ec('0x68')]){throw new db[(_0xe2ec('0xab'))][(_0xe2ec('0xac'))](_0xe2ec('0xad'));}return _0x334ee8;})[_0xe2ec('0x28')](removeEntity(_0xb4c8f1,null))['catch'](handleError(_0xb4c8f1,null));};exports[_0xe2ec('0xae')]=function(_0x21308f,_0x3383bd){return db[_0xe2ec('0x2d')]['find']({'where':{'id':_0x21308f[_0xe2ec('0x44')]['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x3383bd,null))[_0xe2ec('0x28')](function(_0x309dca){if(_0x309dca){return _0x309dca[_0xe2ec('0xae')](_0x21308f[_0xe2ec('0x4a')][_0xe2ec('0x5a')],_['omit'](_0x21308f['body'],[_0xe2ec('0x5a'),'id'])||{})['spread'](function(_0x211a2e){for(var _0x3025c3=0x0;_0x3025c3<_0x21308f[_0xe2ec('0x4a')][_0xe2ec('0x5a')][_0xe2ec('0x38')];_0x3025c3+=0x1){socket[_0xe2ec('0xaf')](_0xe2ec('0xb0'),{'UserId':Number(_0x21308f[_0xe2ec('0x4a')][_0xe2ec('0x5a')][_0x3025c3]),'MailAccountId':Number(_0x21308f[_0xe2ec('0x44')]['id'])});}return _0x211a2e;});}})[_0xe2ec('0x28')](respondWithResult(_0x3383bd,null))[_0xe2ec('0x19')](handleError(_0x3383bd,null));};exports[_0xe2ec('0xb1')]=function(_0x33788a,_0x41c004){return db['MailAccount']['find']({'where':{'id':_0x33788a['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x41c004,null))[_0xe2ec('0x28')](function(_0x2e11f1){if(_0x2e11f1){return _0x2e11f1['removeAgents'](_0x33788a[_0xe2ec('0x33')][_0xe2ec('0x5a')])[_0xe2ec('0x28')](function(){if(_[_0xe2ec('0xb2')](_0x33788a[_0xe2ec('0x33')][_0xe2ec('0x5a')])){for(var _0x309bc3=0x0;_0x309bc3<_0x33788a[_0xe2ec('0x33')]['ids'][_0xe2ec('0x38')];_0x309bc3+=0x1){socket[_0xe2ec('0xaf')](_0xe2ec('0xb3'),{'UserId':Number(_0x33788a[_0xe2ec('0x33')][_0xe2ec('0x5a')][_0x309bc3]),'MailAccountId':Number(_0x33788a['params']['id'])});}}else{socket[_0xe2ec('0xaf')](_0xe2ec('0xb3'),{'UserId':Number(_0x33788a['query'][_0xe2ec('0x5a')]),'MailAccountId':Number(_0x33788a[_0xe2ec('0x44')]['id'])});}});}})[_0xe2ec('0x28')](respondWithStatusCode(_0x41c004,null))[_0xe2ec('0x19')](handleError(_0x41c004,null));};exports[_0xe2ec('0xb4')]=function(_0x1005ae,_0x3a8982){var _0x2a7446={};var _0xf6252b={};var _0x2a9c78;var _0x39f5c5;return db[_0xe2ec('0x2d')]['findOne']({'where':{'id':_0x1005ae['params']['id']}})[_0xe2ec('0x28')](handleEntityNotFound(_0x3a8982,null))['then'](function(_0x4f5984){if(_0x4f5984){_0x2a9c78=_0x4f5984;_0xf6252b['model']=_[_0xe2ec('0x34')](db['User']['rawAttributes']);_0xf6252b[_0xe2ec('0x33')]=_[_0xe2ec('0x34')](_0x1005ae[_0xe2ec('0x33')]);_0xf6252b[_0xe2ec('0x35')]=_[_0xe2ec('0x37')](_0xf6252b[_0xe2ec('0x31')],_0xf6252b['query']);_0x2a7446[_0xe2ec('0x36')]=_[_0xe2ec('0x37')](_0xf6252b[_0xe2ec('0x31')],qs[_0xe2ec('0x48')](_0x1005ae[_0xe2ec('0x33')]['fields']));_0x2a7446[_0xe2ec('0x36')]=_0x2a7446[_0xe2ec('0x36')][_0xe2ec('0x38')]?_0x2a7446[_0xe2ec('0x36')]:_0xf6252b['model'];_0x2a7446[_0xe2ec('0x3a')]=qs[_0xe2ec('0x3b')](_0x1005ae[_0xe2ec('0x33')][_0xe2ec('0x3b')]);_0x2a7446[_0xe2ec('0x3c')]=qs[_0xe2ec('0x35')](_[_0xe2ec('0x3d')](_0x1005ae[_0xe2ec('0x33')],_0xf6252b[_0xe2ec('0x35')]));if(_0x1005ae[_0xe2ec('0x33')][_0xe2ec('0x3e')]){_0x2a7446['where']=_[_0xe2ec('0x3f')](_0x2a7446[_0xe2ec('0x3c')],{'$or':_[_0xe2ec('0x32')](_0x2a7446[_0xe2ec('0x36')],function(_0x2dc2eb){var _0x5b65fa={};_0x5b65fa[_0x2dc2eb]={'$like':'%'+_0x1005ae['query'][_0xe2ec('0x3e')]+'%'};return _0x5b65fa;})});}_0x2a7446=_[_0xe2ec('0x3f')]({},_0x2a7446,_0x1005ae[_0xe2ec('0x41')]);return _0x2a9c78[_0xe2ec('0xb4')](_0x2a7446);}})[_0xe2ec('0x28')](function(_0x25607a){if(_0x25607a){_0x39f5c5=_0x25607a[_0xe2ec('0x38')];if(!_0x1005ae[_0xe2ec('0x33')][_0xe2ec('0x56')](_0xe2ec('0x39'))){_0x2a7446['limit']=qs[_0xe2ec('0x21')](_0x1005ae[_0xe2ec('0x33')]['limit']);_0x2a7446[_0xe2ec('0x1e')]=qs[_0xe2ec('0x1e')](_0x1005ae[_0xe2ec('0x33')]['offset']);}return _0x2a9c78[_0xe2ec('0xb4')](_0x2a7446);}})[_0xe2ec('0x28')](function(_0x50f79d){if(_0x50f79d){return _0x50f79d?{'count':_0x39f5c5,'rows':_0x50f79d}:null;}})[_0xe2ec('0x28')](respondWithResult(_0x3a8982,null))[_0xe2ec('0x19')](handleError(_0x3a8982,null));}; \ No newline at end of file +var _0x91f5=['name','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','findAll','rows','show','params','Pause','keys','find','update','body','CloudProviderId','describe','addDisposition','MailAccountId','Disposition','getDispositions','findOne','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','count','removeAnswers','create','key','provider','email','isNil','active','description','user','username','password','pass','modernAuthentication','service','host','port','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','getImap','addImap','setImap','getSmtp','addSmtp','setSmtp','MailInteraction','addInteraction','getInteractions','Contact','Owner','fullname','internal','color','tag','sequelize','transaction','READ_COMMITTED','MailApplication','bulkCreate','findAndCountAll','priority','finally','getApplications','$gte','split','YYYY-MM-DD\x20HH:mm:ss','includeAll','inlineCss','true','send','CmList','List','CmContact','Contacts','updatedAt','DESC','%s\x20<%s>','attachments','join','root','server/files/attachments','authentication','auth','secure','SendMail','sendMail','List\x20not\x20found','messageId','subject','out','format','Interaction','MailMessage','Messages','verifySmtp','OAuth2','data5','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','omit','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','moment','bluebird','util','path','juice','../../components/parsers/qs','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','destroy','get','MailAccounts','UserProfileResource','stack','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','map','MailAccount','rawAttributes','type','model'];(function(_0x5a6cef,_0x1697df){var _0x37f76f=function(_0x17dc71){while(--_0x17dc71){_0x5a6cef['push'](_0x5a6cef['shift']());}};_0x37f76f(++_0x1697df);}(_0x91f5,0x13a));var _0x591f=function(_0x1863a3,_0x422797){_0x1863a3=_0x1863a3-0x0;var _0x7136e2=_0x91f5[_0x1863a3];return _0x7136e2;};'use strict';var moment=require(_0x591f('0x0'));var BPromise=require(_0x591f('0x1'));var util=require(_0x591f('0x2'));var path=require(_0x591f('0x3'));var _=require('lodash');var juice=require(_0x591f('0x4'));var Redis=require('ioredis');var qs=require(_0x591f('0x5'));var logger=require('../../config/logger')(_0x591f('0x6'));var config=require(_0x591f('0x7'));var db=require(_0x591f('0x8'))['db'];config['redis']=_[_0x591f('0x9')](config[_0x591f('0xa')],{'host':_0x591f('0xb'),'port':0x18eb});var socket=require(_0x591f('0xc'))(new Redis(config['redis']));require(_0x591f('0xd'))[_0x591f('0xe')](socket);var jayson=require(_0x591f('0xf'));var client=jayson[_0x591f('0x10')]['http']({'port':0x232b});function respondWithRpcPromise(_0x573a59,_0x31b0a9,_0x4ad3ed,_0x2fdd87){return new BPromise(function(_0x2851f8,_0x26e1d0){var _0x1c8af2=_0x2fdd87||client;return _0x1c8af2[_0x591f('0x11')](_0x573a59,_0x4ad3ed)[_0x591f('0x12')](function(_0x2d0e6b){logger[_0x591f('0x13')](_0x591f('0x14'),_0x31b0a9,_0x591f('0x15'));logger[_0x591f('0x16')](_0x591f('0x17'),_0x31b0a9,'request\x20sent',JSON[_0x591f('0x18')](_0x2d0e6b));if(_0x2d0e6b[_0x591f('0x19')]){if(_0x2d0e6b[_0x591f('0x19')][_0x591f('0x1a')]===0x1f4){logger[_0x591f('0x19')](_0x591f('0x14'),_0x31b0a9,_0x2d0e6b[_0x591f('0x19')]['message']);return _0x26e1d0(_0x2d0e6b['error'][_0x591f('0x1b')]);}logger[_0x591f('0x19')](_0x591f('0x14'),_0x31b0a9,_0x2d0e6b[_0x591f('0x19')][_0x591f('0x1b')]);return _0x2851f8(_0x2d0e6b[_0x591f('0x19')]['message']);}else{logger[_0x591f('0x13')](_0x591f('0x14'),_0x31b0a9,'request\x20sent');_0x2851f8(_0x2d0e6b[_0x591f('0x1c')]['message']);}})[_0x591f('0x1d')](function(_0xea03cc){logger[_0x591f('0x19')](_0x591f('0x14'),_0x31b0a9,_0xea03cc);_0x26e1d0(_0xea03cc);});});}function respondWithStatusCode(_0x2151ac,_0x4df9b7){_0x4df9b7=_0x4df9b7||0xcc;return function(_0x7270ad){if(_0x7270ad){return _0x2151ac[_0x591f('0x1e')](_0x4df9b7);}return _0x2151ac[_0x591f('0x1f')](_0x4df9b7)[_0x591f('0x20')]();};}function respondWithResult(_0x29b8ca,_0x30e251){_0x30e251=_0x30e251||0xc8;return function(_0x4b6f55){if(_0x4b6f55){return _0x29b8ca[_0x591f('0x1f')](_0x30e251)[_0x591f('0x21')](_0x4b6f55);}};}function respondWithFilteredResult(_0x1d5be2,_0x41bec7){return function(_0xb4030d){if(_0xb4030d){var _0x50de23=typeof _0x41bec7[_0x591f('0x22')]===_0x591f('0x23')&&typeof _0x41bec7['limit']===_0x591f('0x23');var _0x315aed=_0xb4030d['count'];var _0x113777=_0x50de23?0x0:_0x41bec7[_0x591f('0x22')];var _0x366088=_0x50de23?_0xb4030d['count']:_0x41bec7[_0x591f('0x22')]+_0x41bec7[_0x591f('0x24')];var _0x318964;if(_0x366088>=_0x315aed){_0x366088=_0x315aed;_0x318964=0xc8;}else{_0x318964=0xce;}_0x1d5be2[_0x591f('0x1f')](_0x318964);return _0x1d5be2[_0x591f('0x25')]('Content-Range',_0x113777+'-'+_0x366088+'/'+_0x315aed)[_0x591f('0x21')](_0xb4030d);}return null;};}function saveUpdates(_0xc64c4b){return function(_0xf37a6a){if(_0xf37a6a){return _0xf37a6a['update'](_0xc64c4b)[_0x591f('0x12')](function(_0x19bbbd){return _0x19bbbd;});}return null;};}function removeEntity(_0x23d49d){return function(_0x3543c8){if(_0x3543c8){return _0x3543c8[_0x591f('0x26')]()[_0x591f('0x12')](function(){var _0x4290e7=_0x3543c8[_0x591f('0x27')]({'plain':!![]});var _0x4e7fa3=_0x591f('0x28');return db[_0x591f('0x29')][_0x591f('0x26')]({'where':{'type':_0x4e7fa3,'resourceId':_0x4290e7['id']}})[_0x591f('0x12')](function(){return _0x3543c8;});})[_0x591f('0x12')](function(){_0x23d49d[_0x591f('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ee965){return function(_0x1ccdb1){if(!_0x1ccdb1){_0x5ee965[_0x591f('0x1e')](0x194);}return _0x1ccdb1;};}function handleError(_0x5e709a,_0x2c743a){_0x2c743a=_0x2c743a||0x1f4;return function(_0x1121f4){logger[_0x591f('0x19')](_0x1121f4[_0x591f('0x2a')]);if(_0x1121f4['name']){delete _0x1121f4['name'];}_0x5e709a[_0x591f('0x1f')](_0x2c743a)['send'](_0x1121f4);};}exports[_0x591f('0x2b')]=function(_0xb1407f,_0x5e8982){var _0x458e77={'include':[{'model':db[_0x591f('0x2c')],'as':_0x591f('0x2d')},{'model':db[_0x591f('0x2e')],'as':_0x591f('0x2f')},{'model':db['Pause'],'as':_0x591f('0x30')}]},_0x42e8f8={},_0x43ab45={'count':0x0,'rows':[]};var _0x20be81=_[_0x591f('0x31')](db[_0x591f('0x32')][_0x591f('0x33')],function(_0xf947f7){return{'name':_0xf947f7['fieldName'],'type':_0xf947f7[_0x591f('0x34')]['key']};});_0x42e8f8[_0x591f('0x35')]=_[_0x591f('0x31')](_0x20be81,_0x591f('0x36'));_0x42e8f8[_0x591f('0x37')]=_['keys'](_0xb1407f['query']);_0x42e8f8[_0x591f('0x38')]=_['intersection'](_0x42e8f8[_0x591f('0x35')],_0x42e8f8[_0x591f('0x37')]);_0x458e77['attributes']=_[_0x591f('0x39')](_0x42e8f8[_0x591f('0x35')],qs[_0x591f('0x3a')](_0xb1407f[_0x591f('0x37')][_0x591f('0x3a')]));_0x458e77['attributes']=_0x458e77[_0x591f('0x3b')][_0x591f('0x3c')]?_0x458e77[_0x591f('0x3b')]:_0x42e8f8[_0x591f('0x35')];if(!_0xb1407f[_0x591f('0x37')][_0x591f('0x3d')](_0x591f('0x3e'))){_0x458e77[_0x591f('0x24')]=qs[_0x591f('0x24')](_0xb1407f[_0x591f('0x37')][_0x591f('0x24')]);_0x458e77[_0x591f('0x22')]=qs[_0x591f('0x22')](_0xb1407f[_0x591f('0x37')][_0x591f('0x22')]);}_0x458e77[_0x591f('0x3f')]=qs[_0x591f('0x40')](_0xb1407f[_0x591f('0x37')]['sort']);_0x458e77['where']=qs['filters'](_[_0x591f('0x41')](_0xb1407f[_0x591f('0x37')],_0x42e8f8['filters']),_0x20be81);if(_0xb1407f['query'][_0x591f('0x42')]){_0x458e77['where']=_['merge'](_0x458e77[_0x591f('0x43')],{'$or':_[_0x591f('0x31')](_0x20be81,function(_0x4d031a){if(_0x4d031a[_0x591f('0x34')]!==_0x591f('0x44')){var _0x58a25c={};_0x58a25c[_0x4d031a[_0x591f('0x36')]]={'$like':'%'+_0xb1407f[_0x591f('0x37')][_0x591f('0x42')]+'%'};return _0x58a25c;}})});}_0x458e77=_[_0x591f('0x45')]({},_0x458e77,_0xb1407f[_0x591f('0x46')]);var _0x102f90={'where':_0x458e77[_0x591f('0x43')]};return db[_0x591f('0x32')]['count'](_0x102f90)[_0x591f('0x12')](function(_0x5c82ce){_0x43ab45['count']=_0x5c82ce;if(_0xb1407f[_0x591f('0x37')]['includeAll']){_0x458e77[_0x591f('0x47')]=[{'all':!![]}];}return db['MailAccount'][_0x591f('0x48')](_0x458e77);})[_0x591f('0x12')](function(_0x1bd6bf){_0x43ab45[_0x591f('0x49')]=_0x1bd6bf;return _0x43ab45;})[_0x591f('0x12')](respondWithFilteredResult(_0x5e8982,_0x458e77))[_0x591f('0x1d')](handleError(_0x5e8982,null));};exports[_0x591f('0x4a')]=function(_0x4bb826,_0x59d8b8){var _0x2f163b={'raw':![],'where':{'id':_0x4bb826[_0x591f('0x4b')]['id']},'include':[{'model':db[_0x591f('0x2c')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x591f('0x2f')},{'model':db[_0x591f('0x4c')],'as':_0x591f('0x30')}]},_0x551d4b={};_0x551d4b[_0x591f('0x35')]=_['keys'](db[_0x591f('0x32')][_0x591f('0x33')]);_0x551d4b[_0x591f('0x37')]=_[_0x591f('0x4d')](_0x4bb826[_0x591f('0x37')]);_0x551d4b[_0x591f('0x38')]=_[_0x591f('0x39')](_0x551d4b['model'],_0x551d4b[_0x591f('0x37')]);_0x2f163b['attributes']=_[_0x591f('0x39')](_0x551d4b[_0x591f('0x35')],qs[_0x591f('0x3a')](_0x4bb826[_0x591f('0x37')][_0x591f('0x3a')]));_0x2f163b['attributes']=_0x2f163b[_0x591f('0x3b')][_0x591f('0x3c')]?_0x2f163b[_0x591f('0x3b')]:_0x551d4b[_0x591f('0x35')];if(_0x4bb826[_0x591f('0x37')]['includeAll']){_0x2f163b[_0x591f('0x47')]=[{'all':!![]}];}_0x2f163b=_[_0x591f('0x45')]({},_0x2f163b,_0x4bb826[_0x591f('0x46')]);return db['MailAccount'][_0x591f('0x4e')](_0x2f163b)[_0x591f('0x12')](handleEntityNotFound(_0x59d8b8,null))[_0x591f('0x12')](respondWithResult(_0x59d8b8,null))[_0x591f('0x1d')](handleError(_0x59d8b8,null));};exports[_0x591f('0x4f')]=function(_0x410c00,_0x4c734e){if(_0x410c00[_0x591f('0x50')]['id']){delete _0x410c00['body']['id'];}if(_0x410c00[_0x591f('0x50')][_0x591f('0x2d')]){if(!_0x410c00[_0x591f('0x50')][_0x591f('0x2d')]['modernAuthentication']){_0x410c00[_0x591f('0x50')][_0x591f('0x2d')]['CloudProviderId']=null;}}if(_0x410c00[_0x591f('0x50')][_0x591f('0x2f')]){if(!_0x410c00[_0x591f('0x50')][_0x591f('0x2f')]['modernAuthentication']){_0x410c00[_0x591f('0x50')][_0x591f('0x2f')][_0x591f('0x51')]=null;}}return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x410c00[_0x591f('0x4b')]['id']},'include':[{'model':db[_0x591f('0x2c')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x591f('0x2f')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x591f('0x12')](handleEntityNotFound(_0x4c734e,null))[_0x591f('0x12')](saveUpdates(_0x410c00[_0x591f('0x50')],null))[_0x591f('0x12')](function(_0x4febc4){if(_0x4febc4&&_0x410c00[_0x591f('0x50')][_0x591f('0x2d')]){return db[_0x591f('0x2c')]['update'](_0x410c00['body']['Imap'],{'where':{'MailAccountId':_0x4febc4['id']}})[_0x591f('0x12')](function(){return _0x4febc4;});}return _0x4febc4;})[_0x591f('0x12')](function(_0x54d64a){if(_0x54d64a&&_0x410c00['body']['Smtp']){return db[_0x591f('0x2e')][_0x591f('0x4f')](_0x410c00[_0x591f('0x50')]['Smtp'],{'where':{'MailAccountId':_0x54d64a['id']}})['then'](function(){return _0x54d64a;});}return _0x54d64a;})['then'](respondWithResult(_0x4c734e,null))[_0x591f('0x1d')](handleError(_0x4c734e,null));};exports[_0x591f('0x52')]=function(_0x3a5a52,_0x4fe96d){return db['MailAccount']['describe']()[_0x591f('0x12')](respondWithResult(_0x4fe96d,null))[_0x591f('0x1d')](handleError(_0x4fe96d,null));};exports[_0x591f('0x53')]=function(_0x3ee1e0,_0x24b147){if(_0x3ee1e0[_0x591f('0x50')]['id']){delete _0x3ee1e0[_0x591f('0x50')]['id'];}return db['MailAccount'][_0x591f('0x4e')]({'where':{'id':_0x3ee1e0[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x24b147,null))[_0x591f('0x12')](function(_0x1ca230){if(_0x1ca230){_0x3ee1e0[_0x591f('0x50')][_0x591f('0x54')]=_0x1ca230['id'];return db[_0x591f('0x55')]['create'](_0x3ee1e0[_0x591f('0x50')]);}})[_0x591f('0x12')](respondWithResult(_0x24b147,null))['catch'](handleError(_0x24b147,null));};exports[_0x591f('0x56')]=function(_0x396ef6,_0x584b68){var _0x5e0775={'raw':![],'where':{}};var _0x550e23={};var _0x16c86d={'count':0x0,'rows':[]};return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x396ef6[_0x591f('0x4b')]['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x584b68,null))[_0x591f('0x12')](function(_0x4ca7cb){if(_0x4ca7cb){_0x550e23['model']=_[_0x591f('0x4d')](db[_0x591f('0x55')][_0x591f('0x33')]);_0x550e23['query']=_['keys'](_0x396ef6[_0x591f('0x37')]);_0x550e23[_0x591f('0x38')]=_[_0x591f('0x39')](_0x550e23[_0x591f('0x35')],_0x550e23['query']);_0x5e0775[_0x591f('0x3b')]=_[_0x591f('0x39')](_0x550e23[_0x591f('0x35')],qs[_0x591f('0x3a')](_0x396ef6[_0x591f('0x37')][_0x591f('0x3a')]));_0x5e0775['attributes']=_0x5e0775[_0x591f('0x3b')][_0x591f('0x3c')]?_0x5e0775[_0x591f('0x3b')]:_0x550e23[_0x591f('0x35')];if(!_0x396ef6[_0x591f('0x37')][_0x591f('0x3d')](_0x591f('0x3e'))){_0x5e0775['limit']=qs['limit'](_0x396ef6[_0x591f('0x37')][_0x591f('0x24')]);_0x5e0775['offset']=qs[_0x591f('0x22')](_0x396ef6['query'][_0x591f('0x22')]);}_0x5e0775[_0x591f('0x3f')]=qs['sort'](_0x396ef6['query']['sort']);_0x5e0775[_0x591f('0x43')]=qs[_0x591f('0x38')](_[_0x591f('0x41')](_0x396ef6['query'],_0x550e23[_0x591f('0x38')]));_0x5e0775['where'][_0x591f('0x54')]=_0x4ca7cb['id'];if(_0x396ef6[_0x591f('0x37')][_0x591f('0x42')]){_0x5e0775[_0x591f('0x43')]=_['merge'](_0x5e0775[_0x591f('0x43')],{'$or':_['map'](_0x5e0775[_0x591f('0x3b')],function(_0x3f8dbe){var _0x422f0c={};_0x422f0c[_0x3f8dbe]={'$like':'%'+_0x396ef6[_0x591f('0x37')][_0x591f('0x42')]+'%'};return _0x422f0c;})});}_0x5e0775=_[_0x591f('0x45')]({},_0x5e0775,_0x396ef6[_0x591f('0x46')]);return db['Disposition']['count']({'where':_0x5e0775[_0x591f('0x43')]})[_0x591f('0x12')](function(_0xbf28f1){_0x16c86d['count']=_0xbf28f1;if(_0x396ef6[_0x591f('0x37')]['includeAll']){_0x5e0775[_0x591f('0x47')]=[{'all':!![]}];}return db[_0x591f('0x55')][_0x591f('0x48')](_0x5e0775);})[_0x591f('0x12')](function(_0x313651){_0x16c86d[_0x591f('0x49')]=_0x313651;return _0x16c86d;});}})[_0x591f('0x12')](respondWithFilteredResult(_0x584b68,_0x5e0775))[_0x591f('0x1d')](handleError(_0x584b68,null));};exports[_0x591f('0x58')]=function(_0x4fed0a,_0x30bb30){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x4fed0a['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x30bb30,null))[_0x591f('0x12')](function(_0x43b76b){if(_0x43b76b){return _0x43b76b[_0x591f('0x58')](_0x4fed0a[_0x591f('0x37')][_0x591f('0x59')]);}})[_0x591f('0x12')](respondWithStatusCode(_0x30bb30,null))[_0x591f('0x1d')](handleError(_0x30bb30,null));};exports[_0x591f('0x5a')]=function(_0x136450,_0x39fc99){if(_0x136450['body']['id']){delete _0x136450['body']['id'];}return db[_0x591f('0x32')]['find']({'where':{'id':_0x136450[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x39fc99,null))[_0x591f('0x12')](function(_0x240c2b){if(_0x240c2b){_0x136450[_0x591f('0x50')][_0x591f('0x54')]=_0x240c2b['id'];return db[_0x591f('0x5b')]['create'](_0x136450[_0x591f('0x50')]);}})[_0x591f('0x12')](respondWithResult(_0x39fc99,null))[_0x591f('0x1d')](handleError(_0x39fc99,null));};exports[_0x591f('0x5c')]=function(_0x332977,_0x1a1814){var _0x28b4e5={'raw':![],'where':{}};var _0x10ae2e={};var _0x3016f8={'count':0x0,'rows':[]};return db['MailAccount'][_0x591f('0x57')]({'where':{'id':_0x332977['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x1a1814,null))[_0x591f('0x12')](function(_0x51541d){if(_0x51541d){_0x10ae2e[_0x591f('0x35')]=_['keys'](db[_0x591f('0x5b')][_0x591f('0x33')]);_0x10ae2e[_0x591f('0x37')]=_['keys'](_0x332977[_0x591f('0x37')]);_0x10ae2e[_0x591f('0x38')]=_[_0x591f('0x39')](_0x10ae2e[_0x591f('0x35')],_0x10ae2e['query']);_0x28b4e5[_0x591f('0x3b')]=_[_0x591f('0x39')](_0x10ae2e['model'],qs[_0x591f('0x3a')](_0x332977[_0x591f('0x37')][_0x591f('0x3a')]));_0x28b4e5[_0x591f('0x3b')]=_0x28b4e5[_0x591f('0x3b')]['length']?_0x28b4e5[_0x591f('0x3b')]:_0x10ae2e[_0x591f('0x35')];if(!_0x332977['query'][_0x591f('0x3d')]('nolimit')){_0x28b4e5[_0x591f('0x24')]=qs[_0x591f('0x24')](_0x332977[_0x591f('0x37')][_0x591f('0x24')]);_0x28b4e5[_0x591f('0x22')]=qs[_0x591f('0x22')](_0x332977[_0x591f('0x37')][_0x591f('0x22')]);}_0x28b4e5[_0x591f('0x3f')]=qs['sort'](_0x332977['query'][_0x591f('0x40')]);_0x28b4e5[_0x591f('0x43')]=qs[_0x591f('0x38')](_['pick'](_0x332977[_0x591f('0x37')],_0x10ae2e[_0x591f('0x38')]));_0x28b4e5[_0x591f('0x43')][_0x591f('0x54')]=_0x51541d['id'];if(_0x332977[_0x591f('0x37')][_0x591f('0x42')]){_0x28b4e5[_0x591f('0x43')]=_[_0x591f('0x45')](_0x28b4e5[_0x591f('0x43')],{'$or':_['map'](_0x28b4e5['attributes'],function(_0x2dea6d){var _0x43db0c={};_0x43db0c[_0x2dea6d]={'$like':'%'+_0x332977[_0x591f('0x37')]['filter']+'%'};return _0x43db0c;})});}_0x28b4e5=_['merge']({},_0x28b4e5,_0x332977[_0x591f('0x46')]);return db[_0x591f('0x5b')]['count']({'where':_0x28b4e5[_0x591f('0x43')]})[_0x591f('0x12')](function(_0x2cd3ce){_0x3016f8[_0x591f('0x5d')]=_0x2cd3ce;if(_0x332977['query']['includeAll']){_0x28b4e5[_0x591f('0x47')]=[{'all':!![]}];}return db[_0x591f('0x5b')][_0x591f('0x48')](_0x28b4e5);})[_0x591f('0x12')](function(_0x4b7d29){_0x3016f8[_0x591f('0x49')]=_0x4b7d29;return _0x3016f8;});}})[_0x591f('0x12')](respondWithFilteredResult(_0x1a1814,_0x28b4e5))[_0x591f('0x1d')](handleError(_0x1a1814,null));};exports['removeAnswers']=function(_0x2bac27,_0x285103){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x2bac27[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x285103,null))[_0x591f('0x12')](function(_0xefbbe){if(_0xefbbe){return _0xefbbe[_0x591f('0x5e')](_0x2bac27['query'][_0x591f('0x59')]);}})[_0x591f('0x12')](respondWithStatusCode(_0x285103,null))[_0x591f('0x1d')](handleError(_0x285103,null));};exports[_0x591f('0x5f')]=function(_0x34929a,_0x4cef89){var _0x2f766b={'name':_0x34929a[_0x591f('0x50')][_0x591f('0x36')],'key':_0x34929a[_0x591f('0x50')][_0x591f('0x60')],'provider':_0x34929a[_0x591f('0x50')]['provider']==='custom'?null:_0x34929a['body'][_0x591f('0x61')],'email':_0x34929a[_0x591f('0x50')][_0x591f('0x62')],'ListId':_0x34929a[_0x591f('0x50')]['ListId'],'active':!_[_0x591f('0x63')](_0x34929a[_0x591f('0x50')][_0x591f('0x64')])?_0x34929a[_0x591f('0x50')][_0x591f('0x64')]:!![],'description':_0x34929a[_0x591f('0x50')][_0x591f('0x65')]||null,'Imap':{},'Smtp':{}};if(_0x2f766b[_0x591f('0x61')]){_0x2f766b['Imap'][_0x591f('0x66')]=_0x2f766b['Smtp'][_0x591f('0x66')]=_0x34929a[_0x591f('0x50')][_0x591f('0x67')];_0x2f766b[_0x591f('0x2d')][_0x591f('0x68')]=_0x2f766b[_0x591f('0x2f')][_0x591f('0x69')]=_0x34929a[_0x591f('0x50')][_0x591f('0x68')];if(_0x34929a[_0x591f('0x50')][_0x591f('0x6a')]){_0x2f766b[_0x591f('0x2d')][_0x591f('0x6a')]=_0x2f766b[_0x591f('0x2f')][_0x591f('0x6a')]=!![];_0x2f766b[_0x591f('0x2d')][_0x591f('0x51')]=_0x2f766b[_0x591f('0x2f')][_0x591f('0x51')]=_0x34929a[_0x591f('0x50')][_0x591f('0x51')];_0x2f766b[_0x591f('0x2d')]['password']=_0x2f766b[_0x591f('0x2f')][_0x591f('0x69')]=null;}else{_0x2f766b[_0x591f('0x2d')][_0x591f('0x51')]=_0x2f766b['Smtp'][_0x591f('0x51')]=null;}_0x2f766b['Imap']['service']=_0x2f766b['Smtp'][_0x591f('0x6b')]=null;_0x2f766b[_0x591f('0x2d')][_0x591f('0x6c')]=_0x2f766b['Smtp'][_0x591f('0x6c')]=null;_0x2f766b[_0x591f('0x2d')][_0x591f('0x6d')]=_0x2f766b['Smtp'][_0x591f('0x6d')]=null;}else{if(_0x34929a[_0x591f('0x50')]['authentication']){_0x2f766b[_0x591f('0x2d')]['user']=_0x2f766b[_0x591f('0x2f')][_0x591f('0x66')]=_0x34929a[_0x591f('0x50')][_0x591f('0x67')];_0x2f766b['Imap'][_0x591f('0x68')]=_0x2f766b['Smtp'][_0x591f('0x69')]=_0x34929a[_0x591f('0x50')][_0x591f('0x68')];}else{_0x2f766b['Imap']['authentication']=_0x2f766b[_0x591f('0x2f')]['authentication']=![];_0x2f766b[_0x591f('0x2d')][_0x591f('0x66')]=_0x2f766b[_0x591f('0x2f')][_0x591f('0x66')]=null;_0x2f766b[_0x591f('0x2d')][_0x591f('0x68')]=_0x2f766b[_0x591f('0x2f')][_0x591f('0x69')]=null;}_0x2f766b[_0x591f('0x2d')][_0x591f('0x6c')]=_0x34929a[_0x591f('0x50')][_0x591f('0x2d')][_0x591f('0x6c')];_0x2f766b[_0x591f('0x2d')]['port']=_0x34929a[_0x591f('0x50')][_0x591f('0x2d')][_0x591f('0x6d')];_0x2f766b['Smtp'][_0x591f('0x6c')]=_0x34929a[_0x591f('0x50')]['Smtp'][_0x591f('0x6c')];_0x2f766b[_0x591f('0x2f')][_0x591f('0x6d')]=_0x34929a[_0x591f('0x50')][_0x591f('0x2f')][_0x591f('0x6d')];}return db[_0x591f('0x32')][_0x591f('0x5f')](_0x2f766b,{'include':[{'model':db[_0x591f('0x2e')],'as':'Smtp'},{'model':db[_0x591f('0x2c')],'as':_0x591f('0x2d')}]})[_0x591f('0x12')](function(_0x53a87a){var _0x56b9e4=_0x34929a[_0x591f('0x66')][_0x591f('0x27')]({'plain':!![]});if(!_0x56b9e4)throw new Error(_0x591f('0x6e'));if(_0x56b9e4[_0x591f('0x6f')]===_0x591f('0x66')){var _0x5d0d84=_0x53a87a[_0x591f('0x27')]({'plain':!![]});return db[_0x591f('0x70')][_0x591f('0x4e')]({'where':{'name':_0x591f('0x28'),'userProfileId':_0x56b9e4['userProfileId']},'raw':!![]})[_0x591f('0x12')](function(_0x139e78){if(_0x139e78&&_0x139e78[_0x591f('0x71')]===0x0){return db[_0x591f('0x29')][_0x591f('0x5f')]({'name':_0x5d0d84[_0x591f('0x36')],'resourceId':_0x5d0d84['id'],'type':_0x139e78[_0x591f('0x36')],'sectionId':_0x139e78['id']},{})[_0x591f('0x12')](function(){return _0x53a87a;});}else{return _0x53a87a;}})[_0x591f('0x1d')](function(_0x5753d4){logger[_0x591f('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5753d4);throw _0x5753d4;});}return _0x53a87a;})[_0x591f('0x12')](respondWithResult(_0x4cef89,0xc9))['catch'](handleError(_0x4cef89,null));};exports[_0x591f('0x72')]=function(_0x5e7aec,_0x164ce3){return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x5e7aec['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x164ce3,null))[_0x591f('0x12')](function(_0x108430){if(_0x108430){return _0x108430['getImap']();}return null;})['then'](respondWithResult(_0x164ce3,null))[_0x591f('0x1d')](handleError(_0x164ce3,null));};exports[_0x591f('0x73')]=function(_0xd31b06,_0x38f1aa){if(_0xd31b06[_0x591f('0x50')]['id']){delete _0xd31b06[_0x591f('0x50')]['id'];}return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0xd31b06[_0x591f('0x4b')]['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x38f1aa,null))[_0x591f('0x12')](function(_0x42aa33){if(_0x42aa33){_0xd31b06['body'][_0x591f('0x54')]=_0x42aa33['id'];return db[_0x591f('0x2c')][_0x591f('0x5f')](_0xd31b06['body']);}})[_0x591f('0x12')](respondWithResult(_0x38f1aa,null))[_0x591f('0x1d')](handleError(_0x38f1aa,null));};exports['removeImap']=function(_0x4756b1,_0x3ab796){return db[_0x591f('0x32')]['findOne']({'where':{'id':_0x4756b1[_0x591f('0x4b')]['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x3ab796,null))['then'](function(_0x3d6068){if(_0x3d6068){return _0x3d6068[_0x591f('0x74')](null);}return null;})['then'](respondWithStatusCode(_0x3ab796,null))[_0x591f('0x1d')](handleError(_0x3ab796,null));};exports['getSmtp']=function(_0x56a190,_0x25d01f){return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x56a190['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x25d01f,null))[_0x591f('0x12')](function(_0x41ba20){if(_0x41ba20){return _0x41ba20[_0x591f('0x75')]();}return null;})['then'](respondWithResult(_0x25d01f,null))[_0x591f('0x1d')](handleError(_0x25d01f,null));};exports[_0x591f('0x76')]=function(_0x148ff3,_0x4858c2){if(_0x148ff3['body']['id']){delete _0x148ff3[_0x591f('0x50')]['id'];}return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x148ff3['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x4858c2,null))[_0x591f('0x12')](function(_0x278183){if(_0x278183){_0x148ff3['body']['MailAccountId']=_0x278183['id'];return db[_0x591f('0x2e')]['create'](_0x148ff3['body']);}})[_0x591f('0x12')](respondWithResult(_0x4858c2,null))[_0x591f('0x1d')](handleError(_0x4858c2,null));};exports['removeSmtp']=function(_0x3af27c,_0x367e11){return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x3af27c[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x367e11,null))[_0x591f('0x12')](function(_0x2e5647){if(_0x2e5647){return _0x2e5647[_0x591f('0x77')](null);}return null;})[_0x591f('0x12')](respondWithStatusCode(_0x367e11,null))[_0x591f('0x1d')](handleError(_0x367e11,null));};exports['addInteraction']=function(_0x505ecf,_0x5c26f4){return db[_0x591f('0x78')][_0x591f('0x4e')]({'where':{'id':_0x505ecf['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x5c26f4,null))[_0x591f('0x12')](function(_0x325643){if(_0x325643){return _0x325643[_0x591f('0x79')](_0x505ecf[_0x591f('0x50')][_0x591f('0x59')],_['omit'](_0x505ecf[_0x591f('0x50')],['ids','id'])||{});}})[_0x591f('0x12')](respondWithResult(_0x5c26f4,null))[_0x591f('0x1d')](handleError(_0x5c26f4,null));};exports[_0x591f('0x7a')]=function(_0xcffb52,_0x2292f7){var _0x52c2bf={'raw':![],'where':{}};var _0x1088bd={};var _0x1fefbc={'count':0x0,'rows':[]};return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0xcffb52[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2292f7,null))['then'](function(_0x3bca9f){if(_0x3bca9f){_0x1088bd[_0x591f('0x35')]=_[_0x591f('0x4d')](db['MailInteraction'][_0x591f('0x33')]);_0x1088bd[_0x591f('0x37')]=_[_0x591f('0x4d')](_0xcffb52[_0x591f('0x37')]);_0x1088bd[_0x591f('0x38')]=_['intersection'](_0x1088bd[_0x591f('0x35')],_0x1088bd[_0x591f('0x37')]);_0x52c2bf[_0x591f('0x3b')]=_[_0x591f('0x39')](_0x1088bd[_0x591f('0x35')],qs[_0x591f('0x3a')](_0xcffb52[_0x591f('0x37')][_0x591f('0x3a')]));_0x52c2bf[_0x591f('0x3b')]=_0x52c2bf[_0x591f('0x3b')][_0x591f('0x3c')]?_0x52c2bf[_0x591f('0x3b')]:_0x1088bd[_0x591f('0x35')];if(!_0xcffb52[_0x591f('0x37')][_0x591f('0x3d')](_0x591f('0x3e'))){_0x52c2bf['limit']=qs[_0x591f('0x24')](_0xcffb52[_0x591f('0x37')]['limit']);_0x52c2bf['offset']=qs[_0x591f('0x22')](_0xcffb52['query'][_0x591f('0x22')]);}_0x52c2bf['order']=qs[_0x591f('0x40')](_0xcffb52[_0x591f('0x37')][_0x591f('0x40')]);_0x52c2bf[_0x591f('0x43')]=qs[_0x591f('0x38')](_[_0x591f('0x41')](_0xcffb52[_0x591f('0x37')],_0x1088bd[_0x591f('0x38')]));_0x52c2bf[_0x591f('0x43')][_0x591f('0x54')]=_0x3bca9f['id'];if(_0xcffb52[_0x591f('0x37')][_0x591f('0x42')]){_0x52c2bf['where']=_['merge'](_0x52c2bf['where'],{'$or':_['map'](_0x52c2bf[_0x591f('0x3b')],function(_0x43f9ec){var _0x1715cc={};_0x1715cc[_0x43f9ec]={'$like':'%'+_0xcffb52[_0x591f('0x37')][_0x591f('0x42')]+'%'};return _0x1715cc;})});}_0x52c2bf=_[_0x591f('0x45')]({},_0x52c2bf,_0xcffb52[_0x591f('0x46')]);return db[_0x591f('0x78')][_0x591f('0x5d')]({'where':_0x52c2bf[_0x591f('0x43')]})['then'](function(_0x3e7449){_0x1fefbc[_0x591f('0x5d')]=_0x3e7449;if(_0xcffb52['query']['includeAll']){_0x52c2bf['include']=[{'model':db['CmContact'],'as':_0x591f('0x7b'),'required':![]},{'model':db['User'],'as':_0x591f('0x7c'),'attributes':['name',_0x591f('0x7d'),_0x591f('0x7e')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x591f('0x36'),_0x591f('0x7f')],'where':_0xcffb52[_0x591f('0x37')][_0x591f('0x80')]?{'id':_0xcffb52[_0x591f('0x37')][_0x591f('0x80')]}:undefined,'required':_0xcffb52[_0x591f('0x37')]['tag']?!![]:![]}];}return db[_0x591f('0x78')]['findAll'](_0x52c2bf);})[_0x591f('0x12')](function(_0x3f10c2){_0x1fefbc['rows']=_0x3f10c2;return _0x1fefbc;});}})[_0x591f('0x12')](respondWithFilteredResult(_0x2292f7,_0x52c2bf))['catch'](handleError(_0x2292f7,null));};exports['addApplications']=function addApplications(_0x3ea672,_0x3bdf80){var _0x4b9a2c=_0x3ea672[_0x591f('0x4b')]['id'];var _0x4e8c6d=_0x3ea672[_0x591f('0x50')];var _0xbe678d=0xc8;var _0x124b93=null;return db[_0x591f('0x81')][_0x591f('0x82')]({'isolationLevel':db[_0x591f('0x81')]['Transaction']['ISOLATION_LEVELS'][_0x591f('0x83')]},function(_0x23cbf1){return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x4b9a2c},'transaction':_0x23cbf1})[_0x591f('0x12')](function(_0x5d7c3a){if(_0x5d7c3a){return db[_0x591f('0x84')]['destroy']({'where':{'MailAccountId':_0x4b9a2c},'transaction':_0x23cbf1})['then'](function(){var _0x5c8cfd=_['map'](_0x4e8c6d,function(_0x4187cd){_0x4187cd['MailAccountId']=_0x4b9a2c;return _0x4187cd;});return db[_0x591f('0x84')][_0x591f('0x85')](_0x5c8cfd,{'transaction':_0x23cbf1});});}else{_0xbe678d=0x194;_0x124b93=[];}});})[_0x591f('0x12')](function(){if(_0xbe678d!==0x194){return db[_0x591f('0x84')][_0x591f('0x86')]({'where':{'MailAccountId':_0x4b9a2c},'order':_0x591f('0x87')})[_0x591f('0x12')](function(_0x2b1ccf){_0x124b93=_0x2b1ccf;});}})[_0x591f('0x1d')](function(_0x58cc05){_0xbe678d=0x1f4;logger[_0x591f('0x19')](_0x58cc05[_0x591f('0x2a')]);if(_0x58cc05[_0x591f('0x36')]){delete _0x58cc05['name'];}_0x124b93=_0x58cc05;})[_0x591f('0x88')](function(){if(_0x124b93===null){_0x3bdf80['sendStatus'](_0xbe678d);}else{if(_0xbe678d===0x1f4){_0x3bdf80[_0x591f('0x1f')](_0xbe678d)['send'](_0x124b93);}else{_0x3bdf80[_0x591f('0x1f')](_0xbe678d)[_0x591f('0x21')](_0x124b93);}}});};exports[_0x591f('0x89')]=function(_0x2e00a1,_0x2e45a9){var _0x415f1c={};var _0xf982e0={};var _0x1f850b;var _0x3a7ce9;return db[_0x591f('0x32')]['findOne']({'where':{'id':_0x2e00a1[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2e45a9,null))[_0x591f('0x12')](function(_0x29d049){if(_0x29d049){_0x1f850b=_0x29d049;_0xf982e0[_0x591f('0x35')]=_[_0x591f('0x4d')](db['MailApplication'][_0x591f('0x33')]);_0xf982e0[_0x591f('0x37')]=_['keys'](_0x2e00a1[_0x591f('0x37')]);_0xf982e0[_0x591f('0x38')]=_[_0x591f('0x39')](_0xf982e0[_0x591f('0x35')],_0xf982e0[_0x591f('0x37')]);_0x415f1c[_0x591f('0x3b')]=_[_0x591f('0x39')](_0xf982e0[_0x591f('0x35')],qs[_0x591f('0x3a')](_0x2e00a1['query'][_0x591f('0x3a')]));_0x415f1c[_0x591f('0x3b')]=_0x415f1c[_0x591f('0x3b')][_0x591f('0x3c')]?_0x415f1c['attributes']:_0xf982e0[_0x591f('0x35')];_0x415f1c['order']=qs[_0x591f('0x40')](_0x2e00a1[_0x591f('0x37')][_0x591f('0x40')]);_0x415f1c['where']=qs[_0x591f('0x38')](_['pick'](_0x2e00a1[_0x591f('0x37')],_0xf982e0['filters']));if(_0x2e00a1['query'][_0x591f('0x42')]){_0x415f1c[_0x591f('0x43')]=_[_0x591f('0x45')](_0x415f1c[_0x591f('0x43')],{'$or':_[_0x591f('0x31')](_0x415f1c['attributes'],function(_0x3da375){var _0x24fb13={};_0x24fb13[_0x3da375]={'$like':'%'+_0x2e00a1['query'][_0x591f('0x42')]+'%'};return _0x24fb13;})});}_0x415f1c=_[_0x591f('0x45')]({},_0x415f1c,_0x2e00a1['options']);return _0x1f850b[_0x591f('0x89')](_0x415f1c);}})['then'](function(_0x5a2bc0){if(_0x5a2bc0){_0x3a7ce9=_0x5a2bc0[_0x591f('0x3c')];if(!_0x2e00a1[_0x591f('0x37')][_0x591f('0x3d')](_0x591f('0x3e'))){_0x415f1c['limit']=qs[_0x591f('0x24')](_0x2e00a1[_0x591f('0x37')]['limit']);_0x415f1c['offset']=qs[_0x591f('0x22')](_0x2e00a1[_0x591f('0x37')][_0x591f('0x22')]);}return _0x1f850b['getApplications'](_0x415f1c);}})[_0x591f('0x12')](function(_0x171323){if(_0x171323){return _0x171323?{'count':_0x3a7ce9,'rows':_0x171323}:null;}})[_0x591f('0x12')](respondWithResult(_0x2e45a9,null))['catch'](handleError(_0x2e45a9,null));};exports['getMessages']=function(_0x162414,_0x33afb1){var _0x2892b9={'raw':!![],'where':{}};var _0x3528e8={};var _0x1f68e0={'count':0x0,'rows':[]};return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x162414[_0x591f('0x4b')]['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x33afb1,null))[_0x591f('0x12')](function(_0x2fa5f6){if(_0x2fa5f6){_0x3528e8[_0x591f('0x35')]=_[_0x591f('0x4d')](db['MailMessage'][_0x591f('0x33')]);_0x3528e8[_0x591f('0x37')]=_[_0x591f('0x4d')](_0x162414[_0x591f('0x37')]);_0x3528e8[_0x591f('0x38')]=_['intersection'](_0x3528e8['model'],_0x3528e8[_0x591f('0x37')]);_0x2892b9[_0x591f('0x3b')]=_[_0x591f('0x39')](_0x3528e8[_0x591f('0x35')],qs[_0x591f('0x3a')](_0x162414['query'][_0x591f('0x3a')]));_0x2892b9[_0x591f('0x3b')]=_0x2892b9[_0x591f('0x3b')][_0x591f('0x3c')]?_0x2892b9[_0x591f('0x3b')]:_0x3528e8[_0x591f('0x35')];if(!_0x162414[_0x591f('0x37')][_0x591f('0x3d')](_0x591f('0x3e'))){_0x2892b9[_0x591f('0x24')]=qs[_0x591f('0x24')](_0x162414['query'][_0x591f('0x24')]);_0x2892b9['offset']=qs[_0x591f('0x22')](_0x162414[_0x591f('0x37')][_0x591f('0x22')]);}_0x2892b9[_0x591f('0x3f')]=qs[_0x591f('0x40')](_0x162414[_0x591f('0x37')][_0x591f('0x40')]);_0x2892b9[_0x591f('0x43')]=qs[_0x591f('0x38')](_[_0x591f('0x41')](_0x162414[_0x591f('0x37')],_0x3528e8[_0x591f('0x38')]));_0x2892b9[_0x591f('0x43')]['MailAccountId']=_0x2fa5f6['id'];if(_0x162414[_0x591f('0x37')][_0x591f('0x42')]){_0x2892b9['where']=_[_0x591f('0x45')](_0x2892b9[_0x591f('0x43')],{'$or':_[_0x591f('0x31')](_0x2892b9[_0x591f('0x3b')],function(_0x133212){var _0x3583e3={};_0x3583e3[_0x133212]={'$like':'%'+_0x162414[_0x591f('0x37')]['filter']+'%'};return _0x3583e3;})});}if(_0x162414[_0x591f('0x37')][_0x591f('0x8a')]){var _0x47d486=_0x162414[_0x591f('0x37')][_0x591f('0x8a')][_0x591f('0x8b')](',');var _0x2a62d0={};_0x2a62d0[_0x47d486[0x0]]={'$gte':moment(_0x47d486[0x1])['format'](_0x591f('0x8c'))};_0x2892b9['where']=_['merge'](_0x2892b9[_0x591f('0x43')],_0x2a62d0);}_0x2892b9=_[_0x591f('0x45')]({},_0x2892b9,_0x162414[_0x591f('0x46')]);return db['MailMessage'][_0x591f('0x5d')]({'where':_0x2892b9[_0x591f('0x43')]})[_0x591f('0x12')](function(_0x596ef0){_0x1f68e0[_0x591f('0x5d')]=_0x596ef0;if(_0x162414[_0x591f('0x37')][_0x591f('0x8d')]){_0x2892b9[_0x591f('0x47')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x2892b9);})[_0x591f('0x12')](function(_0xa03679){if(_0x162414['query'][_0x591f('0x8e')]===_0x591f('0x8f')){for(var _0x37ef28=0x0;_0x37ef28<_0xa03679['length'];_0x37ef28++){_0xa03679[_0x37ef28]['body']=juice(_0xa03679[_0x37ef28]['body']);}}_0x1f68e0['rows']=_0xa03679;return _0x1f68e0;});}})[_0x591f('0x12')](respondWithFilteredResult(_0x33afb1,_0x2892b9))[_0x591f('0x1d')](handleError(_0x33afb1,null));};exports[_0x591f('0x90')]=function(_0x466678,_0x2798e0){var _0x1129b9,_0x48fad1={},_0x214392;if(_0x466678[_0x591f('0x50')]['to']){_0x214392=_0x466678['body']['to']['split'](',')[0x0];}return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x466678[_0x591f('0x4b')]['id']},'include':[{'model':db[_0x591f('0x91')],'as':_0x591f('0x92'),'include':[{'model':db[_0x591f('0x93')],'as':_0x591f('0x94'),'where':{'email':_0x214392},'limit':0x1,'order':[[_0x591f('0x95'),_0x591f('0x96')]]}]},{'model':db[_0x591f('0x2e')],'as':_0x591f('0x2f'),'raw':!![]}]})[_0x591f('0x12')](handleEntityNotFound(_0x2798e0,null))[_0x591f('0x12')](function(_0x3f9bd3){if(_0x3f9bd3){_0x1129b9=_0x3f9bd3;if(_0x3f9bd3[_0x591f('0x2f')]){if(_[_0x591f('0x63')](_0x466678[_0x591f('0x50')]['from'])){_0x466678[_0x591f('0x50')]['from']=util['format'](_0x591f('0x97'),_0x3f9bd3[_0x591f('0x36')],_0x3f9bd3[_0x591f('0x62')]||_0x3f9bd3[_0x591f('0x2f')]['user']);}if(_0x466678[_0x591f('0x50')][_0x591f('0x98')]&&_0x466678[_0x591f('0x50')]['attachments'][_0x591f('0x3c')]){for(var _0x2b164e=0x0;_0x2b164e<_0x466678[_0x591f('0x50')][_0x591f('0x98')][_0x591f('0x3c')];_0x2b164e+=0x1){_0x466678[_0x591f('0x50')]['attachments'][_0x2b164e]={'filename':_0x466678[_0x591f('0x50')][_0x591f('0x98')][_0x2b164e][_0x591f('0x36')],'path':path[_0x591f('0x99')](config[_0x591f('0x9a')],_0x591f('0x9b'),_0x466678['body']['attachments'][_0x2b164e]['basename'])};}}var _0x2e9087={'tls':{'rejectUnauthorized':![]}};if(_[_0x591f('0x63')](_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x6b')])){if(_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x9c')]){_0x2e9087[_0x591f('0x9d')]={'user':_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x66')],'pass':_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x69')]};}_0x2e9087['host']=_0x3f9bd3[_0x591f('0x2f')]['host'];_0x2e9087[_0x591f('0x6d')]=_0x3f9bd3['Smtp'][_0x591f('0x6d')];_0x2e9087['secure']=_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x9e')];}else{_0x2e9087['service']=_0x3f9bd3['Smtp'][_0x591f('0x6b')];_0x2e9087['auth']={'user':_0x3f9bd3['Smtp'][_0x591f('0x66')],'pass':_0x3f9bd3[_0x591f('0x2f')][_0x591f('0x69')]};}return respondWithRpcPromise(_0x591f('0x9f'),_0x591f('0xa0'),{'account':_0x2e9087,'message':_0x466678['body']});}else{throw new Error(_0x591f('0xa1'));}}})[_0x591f('0x12')](function(_0x13c75b){if(_0x13c75b){_0x48fad1=_0x13c75b;if(_0x1129b9['List']){if(_0x1129b9[_0x591f('0x92')]['Contacts'][_0x591f('0x3c')]){return _0x1129b9[_0x591f('0x92')][_0x591f('0x94')][0x0];}else{return db['CmContact'][_0x591f('0x5f')](_[_0x591f('0x9')](_0x466678[_0x591f('0x50')],{'firstName':_0x466678[_0x591f('0x50')]['to'],'email':_0x466678[_0x591f('0x50')]['to'],'phone':_0x466678['body']['to'],'ListId':_0x1129b9['ListId']}));}}else{throw new Error(_0x591f('0xa1'));}}})[_0x591f('0x12')](function(_0xc28703){if(_0xc28703){var _0x39f76b={'UserId':_0x466678[_0x591f('0x66')]['id'],'ContactId':_0xc28703['id'],'MailAccountId':_0x1129b9['id'],'inReplyTo':_0x48fad1[_0x591f('0xa2')],'to':_0x466678[_0x591f('0x50')]['from'],'cc':_0x466678[_0x591f('0x50')]['cc'],'subject':_0x466678['body'][_0x591f('0xa3')],'attach':_0x466678[_0x591f('0x50')]['attach'],'firstMsgDirection':_0x591f('0xa4'),'lastMsgAt':moment()[_0x591f('0xa5')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0x591f('0x45')](_0x466678[_0x591f('0x50')],{'messageId':_0x48fad1['messageId'],'sentAt':moment()[_0x591f('0xa5')](_0x591f('0x8c')),'read':!![],'MailAccountId':_0x1129b9['id'],'UserId':_0x466678[_0x591f('0x66')]['id'],'ContactId':_0xc28703['id']})]};if(_0x466678[_0x591f('0x50')][_0x591f('0xa6')]){_0x39f76b=_['merge'](_0x39f76b,_0x466678[_0x591f('0x50')][_0x591f('0xa6')]);}return db[_0x591f('0x78')][_0x591f('0x5f')](_0x39f76b,{'include':[{'model':db[_0x591f('0xa7')],'as':_0x591f('0xa8')}]});}})[_0x591f('0x12')](respondWithResult(_0x2798e0,null))['catch'](handleError(_0x2798e0,null));};exports[_0x591f('0xa9')]=function(_0x37327d,_0x52853e){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x37327d['params']['id']},'include':[{'model':db[_0x591f('0x2e')],'as':_0x591f('0x2f'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]})[_0x591f('0x12')](handleEntityNotFound(_0x52853e,null))['then'](function(_0x423f3a){if(!_0x423f3a[_0x591f('0x2f')])return;var _0x530d98={'id':_0x423f3a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x423f3a['provider']!=='custom'){_0x530d98['service']=_0x423f3a['provider'];}else{_0x530d98['host']=_0x423f3a[_0x591f('0x2f')][_0x591f('0x6c')];_0x530d98['port']=_0x423f3a[_0x591f('0x2f')][_0x591f('0x6d')];_0x530d98['secure']=_0x423f3a[_0x591f('0x2f')]['secure'];}if(_0x423f3a[_0x591f('0x2f')][_0x591f('0x9c')]){if(_0x423f3a[_0x591f('0x2f')][_0x591f('0x6a')]){_0x530d98['auth']={'type':_0x591f('0xaa'),'user':_0x423f3a[_0x591f('0x2f')]['user'],'accessToken':_0x423f3a[_0x591f('0x2f')]['CloudProvider'][_0x591f('0xab')]};}else{_0x530d98[_0x591f('0x9d')]={'user':_0x423f3a[_0x591f('0x2f')][_0x591f('0x66')],'pass':_0x423f3a[_0x591f('0x2f')][_0x591f('0x69')]};}}return respondWithRpcPromise(_0x591f('0xac'),'verifySmtp',{'account':_0x530d98});})[_0x591f('0x12')](respondWithResult(_0x52853e,null))[_0x591f('0x1d')](handleError(_0x52853e,null));};exports[_0x591f('0x26')]=function(_0x3bacc0,_0x140606){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x3bacc0[_0x591f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x140606,null))[_0x591f('0x12')](function(_0x49ef85){if(_0x49ef85&&_0x49ef85[_0x591f('0x6b')]){throw new db[(_0x591f('0xad'))]['ValidationError'](_0x591f('0xae'));}return _0x49ef85;})[_0x591f('0x12')](removeEntity(_0x140606,null))['catch'](handleError(_0x140606,null));};exports[_0x591f('0xaf')]=function(_0x58efab,_0x141414){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x58efab['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x141414,null))[_0x591f('0x12')](function(_0x572f56){if(_0x572f56){return _0x572f56[_0x591f('0xaf')](_0x58efab[_0x591f('0x50')][_0x591f('0x59')],_[_0x591f('0xb0')](_0x58efab[_0x591f('0x50')],[_0x591f('0x59'),'id'])||{})[_0x591f('0xb1')](function(_0x156790){for(var _0x491be9=0x0;_0x491be9<_0x58efab[_0x591f('0x50')][_0x591f('0x59')][_0x591f('0x3c')];_0x491be9+=0x1){socket[_0x591f('0xb2')](_0x591f('0xb3'),{'UserId':Number(_0x58efab[_0x591f('0x50')][_0x591f('0x59')][_0x491be9]),'MailAccountId':Number(_0x58efab[_0x591f('0x4b')]['id'])});}return _0x156790;});}})[_0x591f('0x12')](respondWithResult(_0x141414,null))[_0x591f('0x1d')](handleError(_0x141414,null));};exports['removeAgents']=function(_0x3fd2cc,_0x1461e1){return db[_0x591f('0x32')][_0x591f('0x4e')]({'where':{'id':_0x3fd2cc[_0x591f('0x4b')]['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x1461e1,null))[_0x591f('0x12')](function(_0x43120d){if(_0x43120d){return _0x43120d[_0x591f('0xb4')](_0x3fd2cc[_0x591f('0x37')][_0x591f('0x59')])[_0x591f('0x12')](function(){if(_[_0x591f('0xb5')](_0x3fd2cc['query']['ids'])){for(var _0x299793=0x0;_0x299793<_0x3fd2cc['query']['ids'][_0x591f('0x3c')];_0x299793+=0x1){socket[_0x591f('0xb2')](_0x591f('0xb6'),{'UserId':Number(_0x3fd2cc[_0x591f('0x37')][_0x591f('0x59')][_0x299793]),'MailAccountId':Number(_0x3fd2cc[_0x591f('0x4b')]['id'])});}}else{socket[_0x591f('0xb2')](_0x591f('0xb6'),{'UserId':Number(_0x3fd2cc[_0x591f('0x37')][_0x591f('0x59')]),'MailAccountId':Number(_0x3fd2cc[_0x591f('0x4b')]['id'])});}});}})[_0x591f('0x12')](respondWithStatusCode(_0x1461e1,null))[_0x591f('0x1d')](handleError(_0x1461e1,null));};exports[_0x591f('0xb7')]=function(_0x4fed61,_0x1526b0){var _0x29c65f={};var _0x5e2e4f={};var _0x5807eb;var _0x287229;return db[_0x591f('0x32')][_0x591f('0x57')]({'where':{'id':_0x4fed61['params']['id']}})[_0x591f('0x12')](handleEntityNotFound(_0x1526b0,null))[_0x591f('0x12')](function(_0x1b3686){if(_0x1b3686){_0x5807eb=_0x1b3686;_0x5e2e4f[_0x591f('0x35')]=_[_0x591f('0x4d')](db['User'][_0x591f('0x33')]);_0x5e2e4f['query']=_[_0x591f('0x4d')](_0x4fed61[_0x591f('0x37')]);_0x5e2e4f['filters']=_[_0x591f('0x39')](_0x5e2e4f[_0x591f('0x35')],_0x5e2e4f[_0x591f('0x37')]);_0x29c65f[_0x591f('0x3b')]=_[_0x591f('0x39')](_0x5e2e4f[_0x591f('0x35')],qs['fields'](_0x4fed61[_0x591f('0x37')][_0x591f('0x3a')]));_0x29c65f[_0x591f('0x3b')]=_0x29c65f[_0x591f('0x3b')]['length']?_0x29c65f[_0x591f('0x3b')]:_0x5e2e4f[_0x591f('0x35')];_0x29c65f[_0x591f('0x3f')]=qs[_0x591f('0x40')](_0x4fed61[_0x591f('0x37')][_0x591f('0x40')]);_0x29c65f[_0x591f('0x43')]=qs[_0x591f('0x38')](_['pick'](_0x4fed61['query'],_0x5e2e4f['filters']));if(_0x4fed61['query']['filter']){_0x29c65f[_0x591f('0x43')]=_[_0x591f('0x45')](_0x29c65f['where'],{'$or':_['map'](_0x29c65f[_0x591f('0x3b')],function(_0x3ef05a){var _0x2d009b={};_0x2d009b[_0x3ef05a]={'$like':'%'+_0x4fed61[_0x591f('0x37')]['filter']+'%'};return _0x2d009b;})});}_0x29c65f=_[_0x591f('0x45')]({},_0x29c65f,_0x4fed61[_0x591f('0x46')]);return _0x5807eb[_0x591f('0xb7')](_0x29c65f);}})[_0x591f('0x12')](function(_0x303d6f){if(_0x303d6f){_0x287229=_0x303d6f[_0x591f('0x3c')];if(!_0x4fed61[_0x591f('0x37')]['hasOwnProperty'](_0x591f('0x3e'))){_0x29c65f[_0x591f('0x24')]=qs[_0x591f('0x24')](_0x4fed61[_0x591f('0x37')][_0x591f('0x24')]);_0x29c65f[_0x591f('0x22')]=qs['offset'](_0x4fed61['query'][_0x591f('0x22')]);}return _0x5807eb['getAgents'](_0x29c65f);}})[_0x591f('0x12')](function(_0x21e356){if(_0x21e356){return _0x21e356?{'count':_0x287229,'rows':_0x21e356}:null;}})[_0x591f('0x12')](respondWithResult(_0x1526b0,null))[_0x591f('0x1d')](handleError(_0x1526b0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 53cc7e0..807d183 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 _0x36d4=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x36d4,0x17d));var _0x436d=function(_0x3dbeae,_0x48de1c){_0x3dbeae=_0x3dbeae-0x0;var _0x545eff=_0x36d4[_0x3dbeae];return _0x545eff;};'use strict';var EventEmitter=require(_0x436d('0x0'));var MailAccount=require(_0x436d('0x1'))['db'][_0x436d('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x436d('0x3')](0x0);var events={'afterCreate':_0x436d('0x4'),'afterUpdate':_0x436d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x296d0a){return function(_0x29af36,_0x201144,_0x8250e6){MailAccountEvents[_0x436d('0x6')](_0x296d0a+':'+_0x29af36['id'],_0x29af36);MailAccountEvents['emit'](_0x296d0a,_0x29af36);_0x8250e6(null);};}for(var e in events){if(events[_0x436d('0x7')](e)){var event=events[e];MailAccount[_0x436d('0x8')](e,emitEvent(event));}}module[_0x436d('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x9d76=['exports','events','MailAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x9d76,0x76));var _0x69d7=function(_0x59f832,_0x2de1b4){_0x59f832=_0x59f832-0x0;var _0x5d87d2=_0x9d76[_0x59f832];return _0x5d87d2;};'use strict';var EventEmitter=require(_0x69d7('0x0'));var MailAccount=require('../../mysqldb')['db'][_0x69d7('0x1')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x69d7('0x2')](0x0);var events={'afterCreate':_0x69d7('0x3'),'afterUpdate':_0x69d7('0x4'),'afterDestroy':_0x69d7('0x5')};function emitEvent(_0x1ec147){return function(_0x501e6e,_0x564797,_0xe17afc){MailAccountEvents[_0x69d7('0x6')](_0x1ec147+':'+_0x501e6e['id'],_0x501e6e);MailAccountEvents[_0x69d7('0x6')](_0x1ec147,_0x501e6e);_0xe17afc(null);};}for(var e in events){if(events[_0x69d7('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x69d7('0x8')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 330652e..f8eca78 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 _0xd1f2=['../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x44e577,_0x16a38d){var _0x2ff124=function(_0x266893){while(--_0x266893){_0x44e577['push'](_0x44e577['shift']());}};_0x2ff124(++_0x16a38d);}(_0xd1f2,0x84));var _0x2d1f=function(_0x15919b,_0x88fc37){_0x15919b=_0x15919b-0x0;var _0x1b0710=_0xd1f2[_0x15919b];return _0x1b0710;};'use strict';var _=require(_0x2d1f('0x0'));var util=require(_0x2d1f('0x1'));var logger=require(_0x2d1f('0x2'))(_0x2d1f('0x3'));var moment=require(_0x2d1f('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d1f('0x5'));var fs=require('fs');var path=require(_0x2d1f('0x6'));var rimraf=require(_0x2d1f('0x7'));var config=require(_0x2d1f('0x8'));var attributes=require(_0x2d1f('0x9'));module[_0x2d1f('0xa')]=function(_0x3f73b5,_0x1ee8a8){return _0x3f73b5[_0x2d1f('0xb')](_0x2d1f('0xc'),attributes,{'tableName':_0x2d1f('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd4f=['util','api','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x3495ee,_0x4139fb){var _0x3b057f=function(_0x45bfac){while(--_0x45bfac){_0x3495ee['push'](_0x3495ee['shift']());}};_0x3b057f(++_0x4139fb);}(_0xdd4f,0x138));var _0xfdd4=function(_0x2886f0,_0x43b950){_0x2886f0=_0x2886f0-0x0;var _0x1f6c97=_0xdd4f[_0x2886f0];return _0x1f6c97;};'use strict';var _=require('lodash');var util=require(_0xfdd4('0x0'));var logger=require('../../config/logger')(_0xfdd4('0x1'));var moment=require(_0xfdd4('0x2'));var BPromise=require(_0xfdd4('0x3'));var rp=require(_0xfdd4('0x4'));var fs=require('fs');var path=require(_0xfdd4('0x5'));var rimraf=require(_0xfdd4('0x6'));var config=require('../../config/environment');var attributes=require(_0xfdd4('0x7'));module[_0xfdd4('0x8')]=function(_0x22905f,_0x416237){return _0x22905f[_0xfdd4('0x9')](_0xfdd4('0xa'),attributes,{'tableName':_0xfdd4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 0da319a..b98542b 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 _0x366d=['socket.io-emitter','register','request','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','MailAccount','options','raw','where','limit','include','map','model','attributes','then','debug','GetMailAccount','ShowMailAccount','find','NotifyMailAccount','difference','keys','CmContact','rawAttributes','updatedAt','CompanyId','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','Applications','MailServerOut','Smtp','get','applications','list','orderBy','priority','push','length','autoclose','*,*,*,*','create','List\x20not\x20found','contact','messageId','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','update','interaction','created','attachments','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xa2f4d1,_0x4c4ee5){var _0x400bee=function(_0x26d4c9){while(--_0x26d4c9){_0xa2f4d1['push'](_0xa2f4d1['shift']());}};_0x400bee(++_0x4c4ee5);}(_0x366d,0x129));var _0xd366=function(_0x4bdd18,_0x31b414){_0x4bdd18=_0x4bdd18-0x0;var _0x37edeb=_0x366d[_0x4bdd18];return _0x37edeb;};'use strict';var _=require(_0xd366('0x0'));var util=require(_0xd366('0x1'));var moment=require(_0xd366('0x2'));var BPromise=require(_0xd366('0x3'));var rs=require(_0xd366('0x4'));var fs=require('fs');var Redis=require(_0xd366('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd366('0x6'));var logger=require(_0xd366('0x7'))('rpc');var config=require(_0xd366('0x8'));var jayson=require(_0xd366('0x9'));var client=jayson[_0xd366('0xa')][_0xd366('0xb')]({'port':0x232c});config[_0xd366('0xc')]=_[_0xd366('0xd')](config[_0xd366('0xc')],{'host':_0xd366('0xe'),'port':0x18eb});var socket=require(_0xd366('0xf'))(new Redis(config['redis']));require('./mailAccount.socket')[_0xd366('0x10')](socket);function respondWithRpcPromise(_0x4ae62d,_0x5f26b6,_0x2ff704){return new BPromise(function(_0xf62363,_0x5e5b5d){return client[_0xd366('0x11')](_0x4ae62d,_0x2ff704)['then'](function(_0x389bf8){logger[_0xd366('0x12')](_0xd366('0x13'),_0x5f26b6,'request\x20sent');logger['debug'](_0xd366('0x14'),_0x5f26b6,_0xd366('0x15'),JSON[_0xd366('0x16')](_0x389bf8));if(_0x389bf8['error']){if(_0x389bf8['error'][_0xd366('0x17')]===0x1f4){logger[_0xd366('0x18')](_0xd366('0x13'),_0x5f26b6,_0x389bf8[_0xd366('0x18')][_0xd366('0x19')]);return _0x5e5b5d(_0x389bf8[_0xd366('0x18')][_0xd366('0x19')]);}logger[_0xd366('0x18')](_0xd366('0x13'),_0x5f26b6,_0x389bf8[_0xd366('0x18')][_0xd366('0x19')]);return _0xf62363(_0x389bf8[_0xd366('0x18')][_0xd366('0x19')]);}else{logger['info'](_0xd366('0x13'),_0x5f26b6,_0xd366('0x15'));_0xf62363(_0x389bf8['result'][_0xd366('0x19')]);}})[_0xd366('0x1a')](function(_0x2f91b3){logger[_0xd366('0x18')](_0xd366('0x13'),_0x5f26b6,_0x2f91b3);_0x5e5b5d(_0x2f91b3);});});}exports['GetMailAccount']=function(_0x1fdb80){var _0x35cf0c=this;return new Promise(function(_0x33f4ca,_0x31001a){return db[_0xd366('0x1b')]['findAll']({'raw':_0x1fdb80[_0xd366('0x1c')]?_0x1fdb80[_0xd366('0x1c')][_0xd366('0x1d')]===undefined?!![]:![]:!![],'where':_0x1fdb80[_0xd366('0x1c')]?_0x1fdb80[_0xd366('0x1c')][_0xd366('0x1e')]||null:null,'attributes':_0x1fdb80[_0xd366('0x1c')]?_0x1fdb80[_0xd366('0x1c')]['attributes']||null:null,'limit':_0x1fdb80[_0xd366('0x1c')]?_0x1fdb80[_0xd366('0x1c')][_0xd366('0x1f')]||null:null,'include':_0x1fdb80['options']?_0x1fdb80[_0xd366('0x1c')][_0xd366('0x20')]?_[_0xd366('0x21')](_0x1fdb80[_0xd366('0x1c')][_0xd366('0x20')],function(_0x3de9d0){return{'model':db[_0x3de9d0['model']],'as':_0x3de9d0['as'],'attributes':_0x3de9d0['attributes'],'include':_0x3de9d0[_0xd366('0x20')]?_[_0xd366('0x21')](_0x3de9d0[_0xd366('0x20')],function(_0x4ede18){return{'model':db[_0x4ede18[_0xd366('0x22')]],'as':_0x4ede18['as'],'attributes':_0x4ede18[_0xd366('0x23')],'include':_0x4ede18['include']?_['map'](_0x4ede18['include'],function(_0x31897e){return{'model':db[_0x31897e[_0xd366('0x22')]],'as':_0x31897e['as'],'attributes':_0x31897e[_0xd366('0x23')]};}):[]};}):[]};}):[]:[]})[_0xd366('0x24')](function(_0x3a8306){logger['info']('GetMailAccount',_0x1fdb80);logger[_0xd366('0x25')]('GetMailAccount',_0x1fdb80,JSON[_0xd366('0x16')](_0x3a8306));_0x33f4ca(_0x3a8306);})[_0xd366('0x1a')](function(_0x1089ec){logger[_0xd366('0x18')](_0xd366('0x26'),_0x1089ec[_0xd366('0x19')],_0x1fdb80);_0x31001a(_0x35cf0c[_0xd366('0x18')](0x1f4,_0x1089ec['message']));});});};exports[_0xd366('0x27')]=function(_0x1da16c){var _0x582a44=this;return new Promise(function(_0x10ff96,_0x5063cf){return db['MailAccount'][_0xd366('0x28')]({'raw':_0x1da16c['options']?_0x1da16c[_0xd366('0x1c')][_0xd366('0x1d')]===undefined?!![]:![]:!![],'where':_0x1da16c[_0xd366('0x1c')]?_0x1da16c[_0xd366('0x1c')]['where']||null:null,'attributes':_0x1da16c[_0xd366('0x1c')]?_0x1da16c[_0xd366('0x1c')][_0xd366('0x23')]||null:null,'include':_0x1da16c[_0xd366('0x1c')]?_0x1da16c['options'][_0xd366('0x20')]?_[_0xd366('0x21')](_0x1da16c[_0xd366('0x1c')][_0xd366('0x20')],function(_0xefb2a3){return{'model':db[_0xefb2a3[_0xd366('0x22')]],'as':_0xefb2a3['as'],'attributes':_0xefb2a3[_0xd366('0x23')],'include':_0xefb2a3[_0xd366('0x20')]?_['map'](_0xefb2a3[_0xd366('0x20')],function(_0x24355c){return{'model':db[_0x24355c[_0xd366('0x22')]],'as':_0x24355c['as'],'attributes':_0x24355c[_0xd366('0x23')],'include':_0x24355c[_0xd366('0x20')]?_[_0xd366('0x21')](_0x24355c[_0xd366('0x20')],function(_0x3ffc57){return{'model':db[_0x3ffc57[_0xd366('0x22')]],'as':_0x3ffc57['as'],'attributes':_0x3ffc57['attributes']};}):[]};}):[]};}):[]:[]})[_0xd366('0x24')](function(_0x44b243){logger[_0xd366('0x12')](_0xd366('0x27'),_0x1da16c);logger['debug'](_0xd366('0x27'),_0x1da16c,JSON[_0xd366('0x16')](_0x44b243));_0x10ff96(_0x44b243);})[_0xd366('0x1a')](function(_0x51cb3c){logger[_0xd366('0x18')](_0xd366('0x27'),_0x51cb3c[_0xd366('0x19')],_0x1da16c);_0x5063cf(_0x582a44[_0xd366('0x18')](0x1f4,_0x51cb3c[_0xd366('0x19')]));});});};exports[_0xd366('0x29')]=function(_0x192dbf){var _0x36e518=this;return new Promise(function(_0x77d567,_0x201f06){var _0x28946f={'body':_0x192dbf['body'],'channel':'mail'};var _0x5c80f2=_[_0xd366('0x2a')](_[_0xd366('0x2b')](db[_0xd366('0x2c')][_0xd366('0x2d')]),['createdAt',_0xd366('0x2e'),_0xd366('0x2f'),_0xd366('0x30')]);var _0x192bd6=![];if(_0x192dbf[_0xd366('0x31')]['id']){delete _0x192dbf[_0xd366('0x31')]['id'];}if(_[_0xd366('0x32')](_0x192dbf[_0xd366('0x31')][_0xd366('0x33')])){return _0x201f06(_0x36e518[_0xd366('0x18')](0x1f4,_0xd366('0x34')));}if(_[_0xd366('0x32')](_0x192dbf['body'][_0xd366('0x31')])||_0x192dbf[_0xd366('0x31')][_0xd366('0x31')]===''){return _0x201f06(_0x36e518['error'](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xd366('0x32')](_0x192dbf[_0xd366('0x31')][_0xd366('0x35')])){return _0x201f06(_0x36e518[_0xd366('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5c80f2));}if(!_['includes'](_0x5c80f2,_0x192dbf[_0xd366('0x31')][_0xd366('0x35')])){return _0x201f06(_0x36e518[_0xd366('0x18')](0x1f4,_0xd366('0x36')+_0x5c80f2));}var _0x2ca0eb={};_0x2ca0eb[_0x192dbf[_0xd366('0x31')][_0xd366('0x35')]]=_0x192dbf[_0xd366('0x31')]['from'];return db[_0xd366('0x1b')][_0xd366('0x28')]({'where':{'id':_0x192dbf[_0xd366('0x37')]['id']},'include':[{'model':db[_0xd366('0x38')],'as':_0xd366('0x39'),'include':[{'model':db[_0xd366('0x2c')],'as':_0xd366('0x3a'),'where':_0x2ca0eb,'limit':0x1,'order':[[_0xd366('0x2e'),'DESC']]}]},{'model':db['MailApplication'],'as':_0xd366('0x3b')},{'model':db[_0xd366('0x3c')],'as':_0xd366('0x3d')}]})['then'](function(_0x19fcb8){if(_0x19fcb8&&_0x19fcb8[_0xd366('0x39')]){var _0x5420e8=_0x19fcb8[_0xd366('0x3e')]({'plain':!![]});_0x28946f[_0xd366('0x37')]=_['omit'](_0x5420e8,['Applications',_0xd366('0x39')]);_0x28946f[_0xd366('0x3f')]=_0x5420e8[_0xd366('0x3b')];_0x28946f[_0xd366('0x40')]=_0x5420e8['List'];_0x28946f[_0xd366('0x3f')]=_[_0xd366('0x41')](_0x28946f['applications'],[_0xd366('0x42')],['asc']);if(_0x28946f[_0xd366('0x37')]&&_0x28946f[_0xd366('0x37')]['autoclose']){_0x28946f[_0xd366('0x3f')][_0xd366('0x43')]({'id':0x0,'priority':_0x28946f['applications'][_0xd366('0x44')]+0x1,'app':'close','appdata':_0xd366('0x45'),'interval':_0xd366('0x46')});}if(_0x28946f[_0xd366('0x37')]['Applications']){delete _0x28946f['account'][_0xd366('0x3b')];}if(_0x28946f['account'][_0xd366('0x39')]){delete _0x28946f['account'][_0xd366('0x39')];}if(_0x5420e8[_0xd366('0x39')][_0xd366('0x3a')]['length']){return _0x5420e8[_0xd366('0x39')][_0xd366('0x3a')][0x0];}var _0x3414d9=_[_0xd366('0xd')](_0x192dbf[_0xd366('0x31')],{'firstName':_0x192dbf[_0xd366('0x31')]['from'],'ListId':_0x5420e8[_0xd366('0x30')]});_0x3414d9[_0x192dbf[_0xd366('0x31')][_0xd366('0x35')]]=_0x192dbf['body']['from'];return db[_0xd366('0x2c')][_0xd366('0x47')](_0x3414d9);}else{throw new Error(_0xd366('0x48'));}})[_0xd366('0x24')](function(_0x162595){_0x28946f[_0xd366('0x49')]=_0x162595;if(_0x162595){if(!_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['messageId']){_0x192dbf['body'][_0xd366('0x19')]['messageId']=rs['generate']()+'\x20'+_0x192dbf['body']['message'][_0xd366('0x33')];}var _0x348a23={'ContactId':_0x162595['id'],'MailAccountId':_0x192dbf[_0xd366('0x37')]['id'],'inReplyTo':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x4a')],'to':_0x192dbf['body'][_0xd366('0x19')][_0xd366('0x33')],'cc':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['cc'],'subject':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x4b')],'attach':_0x192dbf['body'][_0xd366('0x19')][_0xd366('0x4c')],'lastMsgAt':moment()[_0xd366('0x4d')](_0xd366('0x4e')),'lastMsgDirection':'in'};return db[_0xd366('0x4f')][_0xd366('0x28')]({'where':{'closed':![],'MailAccountId':_0x192dbf['account']['id']},'include':[{'model':db[_0xd366('0x50')],'as':_0xd366('0x51'),'attributes':['messageId'],'where':{'messageId':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x52')]}}]})[_0xd366('0x24')](function(_0x5e306a){if(_0x5e306a){return[_0x5e306a,![]];}return db[_0xd366('0x4f')][_0xd366('0x47')](_0x348a23)[_0xd366('0x24')](function(_0x784efb){return[_0x784efb,!![]];});});}else{throw new Error(_0xd366('0x53'));}})[_0xd366('0x54')](function(_0x804958,_0x44f737){if(_0x804958){_0x192bd6=_0x44f737;if(!_0x44f737){return _0x804958[_0xd366('0x55')]({'inReplyTo':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['messageId'],'to':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x33')],'cc':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['cc'],'subject':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['subject'],'attach':_0x804958['attach']?_0x804958['attach']:_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['attach'],'substatus':null,'substatusAt':moment()['format'](_0xd366('0x4e')),'lastMsgAt':moment()[_0xd366('0x4d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x804958;}}})['then'](function(_0x5bd9ec){_0x28946f[_0xd366('0x56')]=_0x5bd9ec[_0xd366('0x3e')]({'plain':!![]});_0x28946f[_0xd366('0x56')][_0xd366('0x57')]=_0x192bd6;return db[_0xd366('0x50')][_0xd366('0x47')]({'body':_0x192dbf[_0xd366('0x31')][_0xd366('0x31')],'MailAccountId':_0x192dbf['account']['id'],'MailInteractionId':_0x5bd9ec['id'],'direction':'in','ContactId':_0x28946f[_0xd366('0x49')]['id'],'messageId':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x4a')],'from':_0x192dbf['body'][_0xd366('0x19')][_0xd366('0x33')],'to':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['to'],'cc':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')]['cc'],'subject':_0x192dbf[_0xd366('0x31')]['message'][_0xd366('0x4b')],'attach':_0x192dbf[_0xd366('0x31')]['message'][_0xd366('0x4c')],'Attachments':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x58')],'originTo':_0x192dbf['body'][_0xd366('0x19')]['originTo'],'originCc':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x59')],'bcc':_0x192dbf['body'][_0xd366('0x19')][_0xd366('0x5a')],'ChatWebsiteId':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x5b')]||null,'originChannel':_0x192dbf[_0xd366('0x31')]['message'][_0xd366('0x5c')]||_0xd366('0x5d'),'ChatOfflineMessageId':_0x192dbf[_0xd366('0x31')][_0xd366('0x19')][_0xd366('0x5e')]||null},{'include':[{'model':db[_0xd366('0x5f')],'as':_0xd366('0x60')}]});})['then'](function(_0x478eb1){_0x28946f[_0xd366('0x19')]=_0x478eb1;if(_0x28946f[_0xd366('0x56')][_0xd366('0x61')]){return db['User'][_0xd366('0x28')]({'attributes':['id',_0xd366('0x62')],'where':{'id':_0x28946f[_0xd366('0x56')]['UserId']}})[_0xd366('0x24')](function(_0xecef54){if(_0xecef54){_0x28946f['applications'][_0xd366('0x63')]({'id':0x0,'priority':0x0,'app':_0xd366('0x64'),'appdata':_0xecef54[_0xd366('0x62')]+','+(_0x28946f[_0xd366('0x37')][_0xd366('0x65')]||0xa),'interval':_0xd366('0x46')});}return respondWithRpcPromise(_0xd366('0x66'),_0xd366('0x67'),_0x28946f);});}return respondWithRpcPromise(_0xd366('0x66'),_0xd366('0x67'),_0x28946f);})[_0xd366('0x24')](function(_0x165441){_0x77d567(_0x165441);})[_0xd366('0x1a')](function(_0x459bff){_0x201f06(_0x36e518[_0xd366('0x18')](0x1f4,_0x459bff['message']));});});}; \ No newline at end of file +var _0x7c15=['update','interaction','attachments','originTo','originCc','bcc','ChatWebsiteId','originChannel','Email','ChatOfflineMessageId','Attachments','User','name','unshift','agent','waitForTheAssignedAgent','startRouting','Start','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','request','then','info','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','MailAccount,\x20%s,\x20%s','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','map','include','model','stringify','ShowMailAccount','find','NotifyMailAccount','body','keys','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','account','CmList','List','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','asc','autoclose','push','length','close','*,*,*,*','Contacts','create','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x7c15,0xe8));var _0x57c1=function(_0x5dbbfc,_0x4fa82c){_0x5dbbfc=_0x5dbbfc-0x0;var _0x36f022=_0x7c15[_0x5dbbfc];return _0x36f022;};'use strict';var _=require(_0x57c1('0x0'));var util=require(_0x57c1('0x1'));var moment=require(_0x57c1('0x2'));var BPromise=require(_0x57c1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x57c1('0x4'));var db=require(_0x57c1('0x5'))['db'];var utils=require(_0x57c1('0x6'));var logger=require(_0x57c1('0x7'))('rpc');var config=require(_0x57c1('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x57c1('0x9')](config[_0x57c1('0xa')],{'host':_0x57c1('0xb'),'port':0x18eb});var socket=require(_0x57c1('0xc'))(new Redis(config[_0x57c1('0xa')]));require(_0x57c1('0xd'))[_0x57c1('0xe')](socket);function respondWithRpcPromise(_0x369822,_0xcf48e3,_0x2d0acf){return new BPromise(function(_0x866947,_0x3810ce){return client[_0x57c1('0xf')](_0x369822,_0x2d0acf)[_0x57c1('0x10')](function(_0x1c7288){logger[_0x57c1('0x11')]('MailAccount,\x20%s,\x20%s',_0xcf48e3,'request\x20sent');logger[_0x57c1('0x12')](_0x57c1('0x13'),_0xcf48e3,_0x57c1('0x14'),JSON['stringify'](_0x1c7288));if(_0x1c7288[_0x57c1('0x15')]){if(_0x1c7288[_0x57c1('0x15')]['code']===0x1f4){logger['error'](_0x57c1('0x16'),_0xcf48e3,_0x1c7288['error'][_0x57c1('0x17')]);return _0x3810ce(_0x1c7288['error'][_0x57c1('0x17')]);}logger[_0x57c1('0x15')]('MailAccount,\x20%s,\x20%s',_0xcf48e3,_0x1c7288['error'][_0x57c1('0x17')]);return _0x866947(_0x1c7288[_0x57c1('0x15')][_0x57c1('0x17')]);}else{logger[_0x57c1('0x11')](_0x57c1('0x16'),_0xcf48e3,'request\x20sent');_0x866947(_0x1c7288[_0x57c1('0x18')]['message']);}})[_0x57c1('0x19')](function(_0x35b06c){logger[_0x57c1('0x15')](_0x57c1('0x16'),_0xcf48e3,_0x35b06c);_0x3810ce(_0x35b06c);});});}exports[_0x57c1('0x1a')]=function(_0x1f6017){var _0x32ef8e=this;return new Promise(function(_0x4af429,_0x39524c){return db[_0x57c1('0x1b')][_0x57c1('0x1c')]({'raw':_0x1f6017[_0x57c1('0x1d')]?_0x1f6017['options'][_0x57c1('0x1e')]===undefined?!![]:![]:!![],'where':_0x1f6017[_0x57c1('0x1d')]?_0x1f6017[_0x57c1('0x1d')][_0x57c1('0x1f')]||null:null,'attributes':_0x1f6017[_0x57c1('0x1d')]?_0x1f6017[_0x57c1('0x1d')][_0x57c1('0x20')]||null:null,'limit':_0x1f6017[_0x57c1('0x1d')]?_0x1f6017[_0x57c1('0x1d')][_0x57c1('0x21')]||null:null,'include':_0x1f6017[_0x57c1('0x1d')]?_0x1f6017[_0x57c1('0x1d')]['include']?_[_0x57c1('0x22')](_0x1f6017['options'][_0x57c1('0x23')],function(_0x2786f1){return{'model':db[_0x2786f1[_0x57c1('0x24')]],'as':_0x2786f1['as'],'attributes':_0x2786f1[_0x57c1('0x20')],'include':_0x2786f1[_0x57c1('0x23')]?_[_0x57c1('0x22')](_0x2786f1['include'],function(_0x4114fd){return{'model':db[_0x4114fd[_0x57c1('0x24')]],'as':_0x4114fd['as'],'attributes':_0x4114fd[_0x57c1('0x20')],'include':_0x4114fd[_0x57c1('0x23')]?_[_0x57c1('0x22')](_0x4114fd['include'],function(_0x3e76de){return{'model':db[_0x3e76de[_0x57c1('0x24')]],'as':_0x3e76de['as'],'attributes':_0x3e76de[_0x57c1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x57c1('0x10')](function(_0x34acab){logger[_0x57c1('0x11')]('GetMailAccount',_0x1f6017);logger[_0x57c1('0x12')](_0x57c1('0x1a'),_0x1f6017,JSON[_0x57c1('0x25')](_0x34acab));_0x4af429(_0x34acab);})[_0x57c1('0x19')](function(_0x33a928){logger[_0x57c1('0x15')]('GetMailAccount',_0x33a928[_0x57c1('0x17')],_0x1f6017);_0x39524c(_0x32ef8e['error'](0x1f4,_0x33a928['message']));});});};exports[_0x57c1('0x26')]=function(_0x5bc181){var _0xdda9a=this;return new Promise(function(_0x161ebb,_0x415772){return db[_0x57c1('0x1b')][_0x57c1('0x27')]({'raw':_0x5bc181[_0x57c1('0x1d')]?_0x5bc181[_0x57c1('0x1d')][_0x57c1('0x1e')]===undefined?!![]:![]:!![],'where':_0x5bc181[_0x57c1('0x1d')]?_0x5bc181['options']['where']||null:null,'attributes':_0x5bc181['options']?_0x5bc181['options'][_0x57c1('0x20')]||null:null,'include':_0x5bc181[_0x57c1('0x1d')]?_0x5bc181[_0x57c1('0x1d')][_0x57c1('0x23')]?_['map'](_0x5bc181[_0x57c1('0x1d')][_0x57c1('0x23')],function(_0x29ddd0){return{'model':db[_0x29ddd0[_0x57c1('0x24')]],'as':_0x29ddd0['as'],'attributes':_0x29ddd0[_0x57c1('0x20')],'include':_0x29ddd0['include']?_[_0x57c1('0x22')](_0x29ddd0[_0x57c1('0x23')],function(_0x1aa979){return{'model':db[_0x1aa979['model']],'as':_0x1aa979['as'],'attributes':_0x1aa979[_0x57c1('0x20')],'include':_0x1aa979[_0x57c1('0x23')]?_[_0x57c1('0x22')](_0x1aa979[_0x57c1('0x23')],function(_0x50b598){return{'model':db[_0x50b598['model']],'as':_0x50b598['as'],'attributes':_0x50b598[_0x57c1('0x20')]};}):[]};}):[]};}):[]:[]})[_0x57c1('0x10')](function(_0x34eb1e){logger[_0x57c1('0x11')](_0x57c1('0x26'),_0x5bc181);logger[_0x57c1('0x12')](_0x57c1('0x26'),_0x5bc181,JSON['stringify'](_0x34eb1e));_0x161ebb(_0x34eb1e);})[_0x57c1('0x19')](function(_0x177bb4){logger['error'](_0x57c1('0x26'),_0x177bb4[_0x57c1('0x17')],_0x5bc181);_0x415772(_0xdda9a[_0x57c1('0x15')](0x1f4,_0x177bb4[_0x57c1('0x17')]));});});};exports[_0x57c1('0x28')]=function(_0x1a8c55){var _0x3d3d10=this;return new Promise(function(_0x16dd83,_0x5641bd){var _0x5db7e6={'body':_0x1a8c55[_0x57c1('0x29')],'channel':'mail'};var _0x465b99=_['difference'](_[_0x57c1('0x2a')](db[_0x57c1('0x2b')][_0x57c1('0x2c')]),[_0x57c1('0x2d'),_0x57c1('0x2e'),_0x57c1('0x2f'),_0x57c1('0x30')]);var _0x5d487d=![];if(_0x1a8c55[_0x57c1('0x29')]['id']){delete _0x1a8c55[_0x57c1('0x29')]['id'];}if(_[_0x57c1('0x31')](_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x32')])){return _0x5641bd(_0x3d3d10[_0x57c1('0x15')](0x1f4,_0x57c1('0x33')));}if(_['isNil'](_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x29')])||_0x1a8c55['body']['body']===''){return _0x5641bd(_0x3d3d10[_0x57c1('0x15')](0x1f4,_0x57c1('0x34')));}if(_[_0x57c1('0x31')](_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x35')])){return _0x5641bd(_0x3d3d10[_0x57c1('0x15')](0x1f4,_0x57c1('0x36')+_0x465b99));}if(!_[_0x57c1('0x37')](_0x465b99,_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x35')])){return _0x5641bd(_0x3d3d10[_0x57c1('0x15')](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x465b99));}var _0x3311db={};_0x3311db[_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x35')]]=_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x32')];return db[_0x57c1('0x1b')][_0x57c1('0x27')]({'where':{'id':_0x1a8c55[_0x57c1('0x38')]['id']},'include':[{'model':db[_0x57c1('0x39')],'as':_0x57c1('0x3a'),'include':[{'model':db[_0x57c1('0x2b')],'as':'Contacts','where':_0x3311db,'limit':0x1,'order':[[_0x57c1('0x2e'),_0x57c1('0x3b')]]}]},{'model':db[_0x57c1('0x3c')],'as':_0x57c1('0x3d')},{'model':db[_0x57c1('0x3e')],'as':_0x57c1('0x3f')}]})[_0x57c1('0x10')](function(_0x2b0350){if(_0x2b0350&&_0x2b0350[_0x57c1('0x3a')]){var _0x386acb=_0x2b0350[_0x57c1('0x40')]({'plain':!![]});_0x5db7e6[_0x57c1('0x38')]=_[_0x57c1('0x41')](_0x386acb,[_0x57c1('0x3d'),_0x57c1('0x3a')]);_0x5db7e6[_0x57c1('0x42')]=_0x386acb[_0x57c1('0x3d')];_0x5db7e6[_0x57c1('0x43')]=_0x386acb[_0x57c1('0x3a')];_0x5db7e6[_0x57c1('0x42')]=_['orderBy'](_0x5db7e6[_0x57c1('0x42')],['priority'],[_0x57c1('0x44')]);if(_0x5db7e6['account']&&_0x5db7e6[_0x57c1('0x38')][_0x57c1('0x45')]){_0x5db7e6[_0x57c1('0x42')][_0x57c1('0x46')]({'id':0x0,'priority':_0x5db7e6['applications'][_0x57c1('0x47')]+0x1,'app':_0x57c1('0x48'),'appdata':_0x57c1('0x45'),'interval':_0x57c1('0x49')});}if(_0x5db7e6[_0x57c1('0x38')][_0x57c1('0x3d')]){delete _0x5db7e6['account']['Applications'];}if(_0x5db7e6[_0x57c1('0x38')][_0x57c1('0x3a')]){delete _0x5db7e6[_0x57c1('0x38')][_0x57c1('0x3a')];}if(_0x386acb[_0x57c1('0x3a')][_0x57c1('0x4a')][_0x57c1('0x47')]){return _0x386acb['List'][_0x57c1('0x4a')][0x0];}var _0x459eb3=_['defaults'](_0x1a8c55[_0x57c1('0x29')],{'firstName':_0x1a8c55['body']['from'],'ListId':_0x386acb[_0x57c1('0x30')]});_0x459eb3[_0x1a8c55['body'][_0x57c1('0x35')]]=_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x32')];return db[_0x57c1('0x2b')][_0x57c1('0x4b')](_0x459eb3);}else{throw new Error('List\x20not\x20found');}})[_0x57c1('0x10')](function(_0x37bb9d){_0x5db7e6[_0x57c1('0x4c')]=_0x37bb9d;if(_0x37bb9d){if(!_0x1a8c55[_0x57c1('0x29')]['message']['messageId']){_0x1a8c55['body'][_0x57c1('0x17')][_0x57c1('0x4d')]=rs[_0x57c1('0x4e')]()+'\x20'+_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x32')];}var _0x1674e3={'ContactId':_0x37bb9d['id'],'MailAccountId':_0x1a8c55[_0x57c1('0x38')]['id'],'inReplyTo':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')]['messageId'],'to':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x32')],'cc':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')]['cc'],'subject':_0x1a8c55[_0x57c1('0x29')]['message'][_0x57c1('0x4f')],'attach':_0x1a8c55['body'][_0x57c1('0x17')][_0x57c1('0x50')],'lastMsgAt':moment()[_0x57c1('0x51')](_0x57c1('0x52')),'lastMsgDirection':'in'};return db[_0x57c1('0x53')]['find']({'where':{'closed':![],'MailAccountId':_0x1a8c55[_0x57c1('0x38')]['id']},'include':[{'model':db[_0x57c1('0x54')],'as':_0x57c1('0x55'),'attributes':['messageId'],'where':{'messageId':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x56')]}}]})[_0x57c1('0x10')](function(_0x3a20ca){if(_0x3a20ca){return[_0x3a20ca,![]];}return db[_0x57c1('0x53')][_0x57c1('0x4b')](_0x1674e3)['then'](function(_0x4e1029){return[_0x4e1029,!![]];});});}else{throw new Error(_0x57c1('0x57'));}})[_0x57c1('0x58')](function(_0x384022,_0x2ce63a){if(_0x384022){_0x5d487d=_0x2ce63a;if(!_0x2ce63a){return _0x384022[_0x57c1('0x59')]({'inReplyTo':_0x1a8c55[_0x57c1('0x29')]['message'][_0x57c1('0x4d')],'to':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x32')],'cc':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')]['cc'],'subject':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x4f')],'attach':_0x384022[_0x57c1('0x50')]?_0x384022[_0x57c1('0x50')]:_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x50')],'substatus':null,'substatusAt':moment()['format'](_0x57c1('0x52')),'lastMsgAt':moment()[_0x57c1('0x51')](_0x57c1('0x52')),'lastMsgDirection':'in'});}else{return _0x384022;}}})[_0x57c1('0x10')](function(_0x3409b7){_0x5db7e6[_0x57c1('0x5a')]=_0x3409b7[_0x57c1('0x40')]({'plain':!![]});_0x5db7e6[_0x57c1('0x5a')]['created']=_0x5d487d;return db[_0x57c1('0x54')][_0x57c1('0x4b')]({'body':_0x1a8c55['body'][_0x57c1('0x29')],'MailAccountId':_0x1a8c55[_0x57c1('0x38')]['id'],'MailInteractionId':_0x3409b7['id'],'direction':'in','ContactId':_0x5db7e6[_0x57c1('0x4c')]['id'],'messageId':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x4d')],'from':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x32')],'to':_0x1a8c55[_0x57c1('0x29')]['message']['to'],'cc':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')]['cc'],'subject':_0x1a8c55[_0x57c1('0x29')]['message']['subject'],'attach':_0x1a8c55['body']['message'][_0x57c1('0x50')],'Attachments':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x5b')],'originTo':_0x1a8c55['body'][_0x57c1('0x17')][_0x57c1('0x5c')],'originCc':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x5d')],'bcc':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x5e')],'ChatWebsiteId':_0x1a8c55[_0x57c1('0x29')]['message'][_0x57c1('0x5f')]||null,'originChannel':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x60')]||_0x57c1('0x61'),'ChatOfflineMessageId':_0x1a8c55[_0x57c1('0x29')][_0x57c1('0x17')][_0x57c1('0x62')]||null},{'include':[{'model':db['Attachment'],'as':_0x57c1('0x63')}]});})[_0x57c1('0x10')](function(_0x425797){_0x5db7e6['message']=_0x425797;if(_0x5db7e6[_0x57c1('0x5a')]['UserId']){return db[_0x57c1('0x64')]['find']({'attributes':['id',_0x57c1('0x65')],'where':{'id':_0x5db7e6['interaction']['UserId']}})[_0x57c1('0x10')](function(_0x33cd56){if(_0x33cd56){_0x5db7e6[_0x57c1('0x42')][_0x57c1('0x66')]({'id':0x0,'priority':0x0,'app':_0x57c1('0x67'),'appdata':_0x33cd56[_0x57c1('0x65')]+','+(_0x5db7e6[_0x57c1('0x38')][_0x57c1('0x68')]||0xa),'interval':_0x57c1('0x49')});}return respondWithRpcPromise('Start',_0x57c1('0x69'),_0x5db7e6);});}return respondWithRpcPromise(_0x57c1('0x6a'),_0x57c1('0x69'),_0x5db7e6);})[_0x57c1('0x10')](function(_0x4c6ec0){_0x16dd83(_0x4c6ec0);})['catch'](function(_0x5d26bd){_0x5641bd(_0x3d3d10[_0x57c1('0x15')](0x1f4,_0x5d26bd['message']));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 495bcc0..4ebd2a5 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 _0x415b=['removeListener','register','length','mailAccount:','./mailAccount.events','remove','update','emit'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x415b,0x1e4));var _0xb415=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x415b[_0x40a045];return _0x1a687c;};'use strict';var MailAccountEvents=require(_0xb415('0x0'));var events=['save',_0xb415('0x1'),_0xb415('0x2')];function createListener(_0x1d31d4,_0x526867){return function(_0x4e7b58){_0x526867[_0xb415('0x3')](_0x1d31d4,_0x4e7b58);};}function removeListener(_0x1df22d,_0x1385e6){return function(){MailAccountEvents[_0xb415('0x4')](_0x1df22d,_0x1385e6);};}exports[_0xb415('0x5')]=function(_0x5bf5cd){for(var _0x81bbbd=0x0,_0x3ae834=events[_0xb415('0x6')];_0x81bbbd<_0x3ae834;_0x81bbbd++){var _0x2684d0=events[_0x81bbbd];var _0x1b4c6b=createListener(_0xb415('0x7')+_0x2684d0,_0x5bf5cd);MailAccountEvents['on'](_0x2684d0,_0x1b4c6b);}}; \ No newline at end of file +var _0xa713=['update','removeListener','register','length','mailAccount:','./mailAccount.events'];(function(_0x1a7567,_0x3c0228){var _0x1a9940=function(_0x3414a4){while(--_0x3414a4){_0x1a7567['push'](_0x1a7567['shift']());}};_0x1a9940(++_0x3c0228);}(_0xa713,0x7d));var _0x3a71=function(_0x27a824,_0x50dc82){_0x27a824=_0x27a824-0x0;var _0x5a1a7b=_0xa713[_0x27a824];return _0x5a1a7b;};'use strict';var MailAccountEvents=require(_0x3a71('0x0'));var events=['save','remove',_0x3a71('0x1')];function createListener(_0x47c27b,_0x5d1a9a){return function(_0x697881){_0x5d1a9a['emit'](_0x47c27b,_0x697881);};}function removeListener(_0x1f7c3a,_0x5aa74c){return function(){MailAccountEvents[_0x3a71('0x2')](_0x1f7c3a,_0x5aa74c);};}exports[_0x3a71('0x3')]=function(_0x49b8ee){for(var _0x27de9a=0x0,_0x48b695=events[_0x3a71('0x4')];_0x27de9a<_0x48b695;_0x27de9a++){var _0x8d742d=events[_0x27de9a];var _0x33ce27=createListener(_0x3a71('0x5')+_0x8d742d,_0x49b8ee);MailAccountEvents['on'](_0x8d742d,_0x33ce27);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 9ede7c5..289f7f3 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 _0xfb38=['get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0xfb38,0xd5));var _0x8fb3=function(_0x4e4061,_0x26503b){_0x4e4061=_0x4e4061-0x0;var _0x371dbd=_0xfb38[_0x4e4061];return _0x371dbd;};'use strict';var multer=require(_0x8fb3('0x0'));var util=require(_0x8fb3('0x1'));var path=require(_0x8fb3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8fb3('0x3'));var auth=require(_0x8fb3('0x4'));var interaction=require(_0x8fb3('0x5'));var config=require(_0x8fb3('0x6'));var controller=require(_0x8fb3('0x7'));router[_0x8fb3('0x8')](_0x8fb3('0x9'),auth[_0x8fb3('0xa')](),controller[_0x8fb3('0xb')]);router[_0x8fb3('0xc')](_0x8fb3('0x9'),auth[_0x8fb3('0xa')](),controller[_0x8fb3('0xd')]);router[_0x8fb3('0xe')](_0x8fb3('0x9'),auth['isAuthenticated'](),controller[_0x8fb3('0xf')]);module[_0x8fb3('0x10')]=router; \ No newline at end of file +var _0x89e9=['update','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','/:id'];(function(_0x8b8564,_0x162976){var _0x360c61=function(_0x164cc9){while(--_0x164cc9){_0x8b8564['push'](_0x8b8564['shift']());}};_0x360c61(++_0x162976);}(_0x89e9,0x138));var _0x989e=function(_0x2bbd91,_0x13ef8f){_0x2bbd91=_0x2bbd91-0x0;var _0x4fc351=_0x89e9[_0x2bbd91];return _0x4fc351;};'use strict';var multer=require(_0x989e('0x0'));var util=require('util');var path=require(_0x989e('0x1'));var timeout=require(_0x989e('0x2'));var express=require(_0x989e('0x3'));var router=express['Router']();var fs_extra=require(_0x989e('0x4'));var auth=require(_0x989e('0x5'));var interaction=require(_0x989e('0x6'));var config=require(_0x989e('0x7'));var controller=require('./mailApplication.controller');router['get']('/:id',auth[_0x989e('0x8')](),controller['show']);router['put'](_0x989e('0x9'),auth['isAuthenticated'](),controller[_0x989e('0xa')]);router[_0x989e('0xb')](_0x989e('0x9'),auth[_0x989e('0x8')](),controller[_0x989e('0xc')]);module[_0x989e('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 7dcade2..789f4b0 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 _0xc720=['STRING','*,*,*,*','sequelize','exports','TEXT'];(function(_0x5d4607,_0x6b5e7b){var _0x5e4a86=function(_0x46891a){while(--_0x46891a){_0x5d4607['push'](_0x5d4607['shift']());}};_0x5e4a86(++_0x6b5e7b);}(_0xc720,0xe3));var _0x0c72=function(_0x33504a,_0x486d73){_0x33504a=_0x33504a-0x0;var _0x5b84e0=_0xc720[_0x33504a];return _0x5b84e0;};'use strict';var Sequelize=require(_0x0c72('0x0'));module[_0x0c72('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0c72('0x2')]()},'description':{'type':Sequelize[_0x0c72('0x3')]},'interval':{'type':Sequelize[_0x0c72('0x3')],'defaultValue':_0x0c72('0x4')}}; \ No newline at end of file +var _0x3beb=['sequelize','INTEGER','*,*,*,*'];(function(_0x5dde81,_0xb8507b){var _0x23e51b=function(_0xc40cfe){while(--_0xc40cfe){_0x5dde81['push'](_0x5dde81['shift']());}};_0x23e51b(++_0xb8507b);}(_0x3beb,0x17d));var _0xb3be=function(_0x1d805a,_0x33b4c1){_0x1d805a=_0x1d805a-0x0;var _0x47b386=_0x3beb[_0x1d805a];return _0x47b386;};'use strict';var Sequelize=require(_0xb3be('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb3be('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xb3be('0x2')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index d2bc41d..4437110 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 _0x70e0=['util','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count','limit','set','apply','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','attributes','intersection','length','includeAll','include','find','catch','body','params','eml-format','rimraf','zip-dir','moment','bluebird','mustache'];(function(_0x2d8a23,_0x522080){var _0xd7bce1=function(_0x6adbdd){while(--_0x6adbdd){_0x2d8a23['push'](_0x2d8a23['shift']());}};_0xd7bce1(++_0x522080);}(_0x70e0,0x17b));var _0x070e=function(_0x41fa73,_0x219441){_0x41fa73=_0x41fa73-0x0;var _0x138390=_0x70e0[_0x41fa73];return _0x138390;};'use strict';var emlformat=require(_0x070e('0x0'));var rimraf=require(_0x070e('0x1'));var zipdir=require(_0x070e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x070e('0x3'));var BPromise=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var util=require(_0x070e('0x6'));var path=require('path');var sox=require(_0x070e('0x7'));var csv=require('to-csv');var ejs=require(_0x070e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0xc'));var querystring=require(_0x070e('0xd'));var Papa=require(_0x070e('0xe'));var Redis=require(_0x070e('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0x10'));var hardwareService=require(_0x070e('0x11'));var logger=require(_0x070e('0x12'))(_0x070e('0x13'));var utils=require(_0x070e('0x14'));var config=require(_0x070e('0x15'));var licenseUtil=require(_0x070e('0x16'));var db=require(_0x070e('0x17'))['db'];function respondWithStatusCode(_0x39d2b9,_0x5bf079){_0x5bf079=_0x5bf079||0xcc;return function(_0x2930b8){if(_0x2930b8){return _0x39d2b9['sendStatus'](_0x5bf079);}return _0x39d2b9['status'](_0x5bf079)[_0x070e('0x18')]();};}function respondWithResult(_0x56c7ba,_0x4a33d2){_0x4a33d2=_0x4a33d2||0xc8;return function(_0x5bae0f){if(_0x5bae0f){return _0x56c7ba[_0x070e('0x19')](_0x4a33d2)[_0x070e('0x1a')](_0x5bae0f);}};}function respondWithFilteredResult(_0x51d14d,_0x5d3a38){return function(_0x373d86){if(_0x373d86){var _0xeae1a5=typeof _0x5d3a38[_0x070e('0x1b')]===_0x070e('0x1c')&&typeof _0x5d3a38['limit']==='undefined';var _0x17e2e4=_0x373d86[_0x070e('0x1d')];var _0x38f6e6=_0xeae1a5?0x0:_0x5d3a38[_0x070e('0x1b')];var _0x364b3f=_0xeae1a5?_0x373d86['count']:_0x5d3a38[_0x070e('0x1b')]+_0x5d3a38[_0x070e('0x1e')];var _0x1ad3de;if(_0x364b3f>=_0x17e2e4){_0x364b3f=_0x17e2e4;_0x1ad3de=0xc8;}else{_0x1ad3de=0xce;}_0x51d14d[_0x070e('0x19')](_0x1ad3de);return _0x51d14d[_0x070e('0x1f')]('Content-Range',_0x38f6e6+'-'+_0x364b3f+'/'+_0x17e2e4)['json'](_0x373d86);}return null;};}function patchUpdates(_0x4e958f){return function(_0x9907cf){try{jsonpatch[_0x070e('0x20')](_0x9907cf,_0x4e958f,!![]);}catch(_0x20dc60){return BPromise['reject'](_0x20dc60);}return _0x9907cf[_0x070e('0x21')]();};}function saveUpdates(_0x5dc5d2,_0xf8dd5d){return function(_0x3f6985){if(_0x3f6985){return _0x3f6985[_0x070e('0x22')](_0x5dc5d2)[_0x070e('0x23')](function(_0x28a1c3){return _0x28a1c3;});}return null;};}function removeEntity(_0xa86797,_0xe405e){return function(_0x164cdf){if(_0x164cdf){return _0x164cdf['destroy']()[_0x070e('0x23')](function(){_0xa86797[_0x070e('0x19')](0xcc)[_0x070e('0x18')]();});}};}function handleEntityNotFound(_0x503f4d,_0xf17c56){return function(_0x5f3e9d){if(!_0x5f3e9d){_0x503f4d['sendStatus'](0x194);}return _0x5f3e9d;};}function handleError(_0x2ccbd7,_0x25f6e){_0x25f6e=_0x25f6e||0x1f4;return function(_0x41deb1){logger[_0x070e('0x24')](_0x41deb1[_0x070e('0x25')]);if(_0x41deb1['name']){delete _0x41deb1[_0x070e('0x26')];}_0x2ccbd7[_0x070e('0x19')](_0x25f6e)[_0x070e('0x27')](_0x41deb1);};}exports[_0x070e('0x28')]=function(_0x43dd96,_0x28d7f2){var _0x1a1892={'raw':!![],'where':{'id':_0x43dd96['params']['id']}},_0x26373b={};_0x26373b[_0x070e('0x29')]=_[_0x070e('0x2a')](db[_0x070e('0x2b')]['rawAttributes']);_0x26373b['query']=_[_0x070e('0x2a')](_0x43dd96[_0x070e('0x2c')]);_0x26373b[_0x070e('0x2d')]=_['intersection'](_0x26373b[_0x070e('0x29')],_0x26373b[_0x070e('0x2c')]);_0x1a1892[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x26373b['model'],qs['fields'](_0x43dd96['query']['fields']));_0x1a1892[_0x070e('0x2e')]=_0x1a1892['attributes'][_0x070e('0x30')]?_0x1a1892[_0x070e('0x2e')]:_0x26373b['model'];if(_0x43dd96['query'][_0x070e('0x31')]){_0x1a1892[_0x070e('0x32')]=[{'all':!![]}];}_0x1a1892=_['merge']({},_0x1a1892,_0x43dd96['options']);return db[_0x070e('0x2b')][_0x070e('0x33')](_0x1a1892)[_0x070e('0x23')](handleEntityNotFound(_0x28d7f2,null))[_0x070e('0x23')](respondWithResult(_0x28d7f2,null))[_0x070e('0x34')](handleError(_0x28d7f2,null));};exports['update']=function(_0x482cc2,_0x24d17d){if(_0x482cc2[_0x070e('0x35')]['id']){delete _0x482cc2[_0x070e('0x35')]['id'];}return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x482cc2['params']['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x24d17d,null))[_0x070e('0x23')](saveUpdates(_0x482cc2['body'],null))[_0x070e('0x23')](respondWithResult(_0x24d17d,null))[_0x070e('0x34')](handleError(_0x24d17d,null));};exports['destroy']=function(_0x4d4ee8,_0x5ddbe9){return db[_0x070e('0x2b')][_0x070e('0x33')]({'where':{'id':_0x4d4ee8[_0x070e('0x36')]['id']}})[_0x070e('0x23')](handleEntityNotFound(_0x5ddbe9,null))[_0x070e('0x23')](removeEntity(_0x5ddbe9,null))['catch'](handleError(_0x5ddbe9,null));}; \ No newline at end of file +var _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x4b14c9,_0x28b08e){var _0xca0592=function(_0x5c7db5){while(--_0x5c7db5){_0x4b14c9['push'](_0x4b14c9['shift']());}};_0xca0592(++_0x28b08e);}(_0xac4a,0x13f));var _0xaac4=function(_0x5c065b,_0x4771f8){_0x5c065b=_0x5c065b-0x0;var _0x39415a=_0xac4a[_0x5c065b];return _0x39415a;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 1138fa3..1499704 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 _0xf3a9=['mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0xf3a9,0xe2));var _0x9f3a=function(_0x2c41df,_0x5b22fb){_0x2c41df=_0x2c41df-0x0;var _0x1d9ee7=_0xf3a9[_0x2c41df];return _0x1d9ee7;};'use strict';var _=require(_0x9f3a('0x0'));var util=require(_0x9f3a('0x1'));var logger=require(_0x9f3a('0x2'))(_0x9f3a('0x3'));var moment=require(_0x9f3a('0x4'));var BPromise=require(_0x9f3a('0x5'));var rp=require(_0x9f3a('0x6'));var fs=require('fs');var path=require(_0x9f3a('0x7'));var rimraf=require(_0x9f3a('0x8'));var config=require(_0x9f3a('0x9'));var attributes=require(_0x9f3a('0xa'));module[_0x9f3a('0xb')]=function(_0x24f222,_0x979474){return _0x24f222[_0x9f3a('0xc')](_0x9f3a('0xd'),attributes,{'tableName':_0x9f3a('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9f3a('0xf')});}; \ No newline at end of file +var _0x7dcb=['MailApplication','utf8mb4','utf8mb4_unicode_ci','util','api','moment','rimraf','./mailApplication.attributes','exports','define'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x7dcb,0x161));var _0xb7dc=function(_0x21a8b9,_0x590b43){_0x21a8b9=_0x21a8b9-0x0;var _0x22068e=_0x7dcb[_0x21a8b9];return _0x22068e;};'use strict';var _=require('lodash');var util=require(_0xb7dc('0x0'));var logger=require('../../config/logger')(_0xb7dc('0x1'));var moment=require(_0xb7dc('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb7dc('0x3'));var config=require('../../config/environment');var attributes=require(_0xb7dc('0x4'));module[_0xb7dc('0x5')]=function(_0x2f3ece,_0x1afb08){return _0x2f3ece[_0xb7dc('0x6')](_0xb7dc('0x7'),attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb7dc('0x8'),'collate':_0xb7dc('0x9')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 5a503b2..a9ac0dc 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 _0x044a=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','limit','stringify','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1210cc,_0x2ec2ec){var _0x59cc74=function(_0x11553b){while(--_0x11553b){_0x1210cc['push'](_0x1210cc['shift']());}};_0x59cc74(++_0x2ec2ec);}(_0x044a,0x1cc));var _0xa044=function(_0x340088,_0x36877c){_0x340088=_0x340088-0x0;var _0x18e2f5=_0x044a[_0x340088];return _0x18e2f5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa044('0x0'));var rs=require(_0xa044('0x1'));var fs=require('fs');var Redis=require(_0xa044('0x2'));var db=require(_0xa044('0x3'))['db'];var utils=require(_0xa044('0x4'));var logger=require(_0xa044('0x5'))(_0xa044('0x6'));var config=require(_0xa044('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa044('0x8')][_0xa044('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x307a64,_0x37d093,_0x3360cb){return new BPromise(function(_0x4f6e36,_0x2de02b){return client['request'](_0x307a64,_0x3360cb)[_0xa044('0xa')](function(_0x7a8c77){logger[_0xa044('0xb')](_0xa044('0xc'),_0x37d093,_0xa044('0xd'));logger[_0xa044('0xe')](_0xa044('0xf'),_0x37d093,_0xa044('0xd'),JSON['stringify'](_0x7a8c77));if(_0x7a8c77[_0xa044('0x10')]){if(_0x7a8c77[_0xa044('0x10')][_0xa044('0x11')]===0x1f4){logger['error'](_0xa044('0xc'),_0x37d093,_0x7a8c77[_0xa044('0x10')][_0xa044('0x12')]);return _0x2de02b(_0x7a8c77[_0xa044('0x10')]['message']);}logger[_0xa044('0x10')]('MailApplication,\x20%s,\x20%s',_0x37d093,_0x7a8c77['error'][_0xa044('0x12')]);return _0x4f6e36(_0x7a8c77[_0xa044('0x10')][_0xa044('0x12')]);}else{logger[_0xa044('0xb')]('MailApplication,\x20%s,\x20%s',_0x37d093,_0xa044('0xd'));_0x4f6e36(_0x7a8c77['result']['message']);}})[_0xa044('0x13')](function(_0x1802c5){logger[_0xa044('0x10')](_0xa044('0xc'),_0x37d093,_0x1802c5);_0x2de02b(_0x1802c5);});});}exports[_0xa044('0x14')]=function(_0x11d9cd){var _0x549f36=this;return new Promise(function(_0x2e511b,_0x4c456f){return db[_0xa044('0x15')][_0xa044('0x16')](_0x11d9cd[_0xa044('0x17')],{'raw':_0x11d9cd[_0xa044('0x18')]?_0x11d9cd[_0xa044('0x18')][_0xa044('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11d9cd[_0xa044('0x18')]?_0x11d9cd[_0xa044('0x18')][_0xa044('0x1a')]||null:null,'attributes':_0x11d9cd[_0xa044('0x18')]?_0x11d9cd[_0xa044('0x18')]['attributes']||null:null,'limit':_0x11d9cd['options']?_0x11d9cd[_0xa044('0x18')][_0xa044('0x1b')]||null:null})['then'](function(_0x3701b1){logger['info']('UpdateMailApplication',_0x11d9cd);logger[_0xa044('0xe')](_0xa044('0x14'),_0x11d9cd,JSON[_0xa044('0x1c')](_0x3701b1));_0x2e511b(_0x3701b1);})['catch'](function(_0x6af4a3){logger[_0xa044('0x10')](_0xa044('0x14'),_0x6af4a3[_0xa044('0x12')],_0x11d9cd);_0x4c456f(_0x549f36[_0xa044('0x10')](0x1f4,_0x6af4a3['message']));});});}; \ No newline at end of file +var _0xc8b8=['request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','message','catch','update','body','options','where','attributes','limit','UpdateMailApplication','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','MailApplication,\x20%s,\x20%s'];(function(_0x1ed466,_0x3fe319){var _0x21cbc2=function(_0x15176b){while(--_0x15176b){_0x1ed466['push'](_0x1ed466['shift']());}};_0x21cbc2(++_0x3fe319);}(_0xc8b8,0xd3));var _0x8c8b=function(_0x151721,_0x20d5bc){_0x151721=_0x151721-0x0;var _0x2deaa7=_0xc8b8[_0x151721];return _0x2deaa7;};'use strict';var _=require(_0x8c8b('0x0'));var util=require(_0x8c8b('0x1'));var moment=require(_0x8c8b('0x2'));var BPromise=require(_0x8c8b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c8b('0x4'));var db=require(_0x8c8b('0x5'))['db'];var utils=require(_0x8c8b('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x8c8b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x8c8b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x65e360,_0x49e2a2,_0x4858fd){return new BPromise(function(_0x5eb9f1,_0x1fafa6){return client[_0x8c8b('0x9')](_0x65e360,_0x4858fd)[_0x8c8b('0xa')](function(_0x3fed85){logger[_0x8c8b('0xb')](_0x8c8b('0xc'),_0x49e2a2,_0x8c8b('0xd'));logger[_0x8c8b('0xe')](_0x8c8b('0xf'),_0x49e2a2,_0x8c8b('0xd'),JSON['stringify'](_0x3fed85));if(_0x3fed85[_0x8c8b('0x10')]){if(_0x3fed85[_0x8c8b('0x10')][_0x8c8b('0x11')]===0x1f4){logger['error'](_0x8c8b('0xc'),_0x49e2a2,_0x3fed85[_0x8c8b('0x10')][_0x8c8b('0x12')]);return _0x1fafa6(_0x3fed85[_0x8c8b('0x10')][_0x8c8b('0x12')]);}logger[_0x8c8b('0x10')](_0x8c8b('0xc'),_0x49e2a2,_0x3fed85[_0x8c8b('0x10')][_0x8c8b('0x12')]);return _0x5eb9f1(_0x3fed85[_0x8c8b('0x10')][_0x8c8b('0x12')]);}else{logger[_0x8c8b('0xb')]('MailApplication,\x20%s,\x20%s',_0x49e2a2,'request\x20sent');_0x5eb9f1(_0x3fed85['result'][_0x8c8b('0x12')]);}})[_0x8c8b('0x13')](function(_0x333b7c){logger['error'](_0x8c8b('0xc'),_0x49e2a2,_0x333b7c);_0x1fafa6(_0x333b7c);});});}exports['UpdateMailApplication']=function(_0x16e284){var _0x23abe1=this;return new Promise(function(_0x3087e7,_0x12361d){return db['MailApplication'][_0x8c8b('0x14')](_0x16e284[_0x8c8b('0x15')],{'raw':_0x16e284[_0x8c8b('0x16')]?_0x16e284[_0x8c8b('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x16e284[_0x8c8b('0x16')]?_0x16e284[_0x8c8b('0x16')][_0x8c8b('0x17')]||null:null,'attributes':_0x16e284[_0x8c8b('0x16')]?_0x16e284[_0x8c8b('0x16')][_0x8c8b('0x18')]||null:null,'limit':_0x16e284[_0x8c8b('0x16')]?_0x16e284[_0x8c8b('0x16')][_0x8c8b('0x19')]||null:null})[_0x8c8b('0xa')](function(_0x56e0ee){logger['info'](_0x8c8b('0x1a'),_0x16e284);logger[_0x8c8b('0xe')](_0x8c8b('0x1a'),_0x16e284,JSON[_0x8c8b('0x1b')](_0x56e0ee));_0x3087e7(_0x56e0ee);})['catch'](function(_0x29c7cd){logger[_0x8c8b('0x10')](_0x8c8b('0x1a'),_0x29c7cd[_0x8c8b('0x12')],_0x16e284);_0x12361d(_0x23abe1[_0x8c8b('0x10')](0x1f4,_0x29c7cd[_0x8c8b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 32d92bf..5c64a2e 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 _0x34b0=['delete','/:id','mailinteraction:destroy','destroy','removeTags','express','Router','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','/describe','describe','show','/:id/messages','getMessages','/:id/download','download','post','addMessage','/:id/tags','mailinteraction:addtags','addTags','tracked','mail','mailinteraction:update','update'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x34b0,0x1b5));var _0x034b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x34b0[_0x20a584];return _0x4b41a8;};'use strict';var express=require(_0x034b('0x0'));var router=express[_0x034b('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0x034b('0x2'));var controller=require(_0x034b('0x3'));router[_0x034b('0x4')]('/',auth[_0x034b('0x5')](),controller['index']);router['get'](_0x034b('0x6'),auth[_0x034b('0x5')](),controller[_0x034b('0x7')]);router[_0x034b('0x4')]('/:id',auth['isAuthenticated'](),controller[_0x034b('0x8')]);router[_0x034b('0x4')](_0x034b('0x9'),auth[_0x034b('0x5')](),controller[_0x034b('0xa')]);router['get'](_0x034b('0xb'),auth[_0x034b('0x5')](),controller[_0x034b('0xc')]);router[_0x034b('0xd')]('/',auth[_0x034b('0x5')](),controller['create']);router[_0x034b('0xd')](_0x034b('0x9'),auth[_0x034b('0x5')](),controller[_0x034b('0xe')]);router[_0x034b('0xd')](_0x034b('0xf'),auth[_0x034b('0x5')](),interaction['tracked']('mail',_0x034b('0x10')),controller[_0x034b('0x11')]);router['put']('/:id',auth[_0x034b('0x5')](),interaction[_0x034b('0x12')](_0x034b('0x13'),_0x034b('0x14')),controller[_0x034b('0x15')]);router[_0x034b('0x16')](_0x034b('0x17'),auth[_0x034b('0x5')](),interaction[_0x034b('0x12')]('mail',_0x034b('0x18')),controller[_0x034b('0x19')]);router['delete'](_0x034b('0xf'),auth[_0x034b('0x5')](),controller[_0x034b('0x1a')]);module['exports']=router; \ No newline at end of file +var _0x0087=['delete','mailinteraction:destroy','destroy','removeTags','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','addTags','put','mail','mailinteraction:update','update'];(function(_0x3bea2c,_0x59281e){var _0x20d7fd=function(_0x2918a2){while(--_0x2918a2){_0x3bea2c['push'](_0x3bea2c['shift']());}};_0x20d7fd(++_0x59281e);}(_0x0087,0x17e));var _0x7008=function(_0x1c17e3,_0x5995b9){_0x1c17e3=_0x1c17e3-0x0;var _0x54a18b=_0x0087[_0x1c17e3];return _0x54a18b;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x7008('0x0'));var interaction=require(_0x7008('0x1'));var controller=require(_0x7008('0x2'));router[_0x7008('0x3')]('/',auth[_0x7008('0x4')](),controller[_0x7008('0x5')]);router[_0x7008('0x3')](_0x7008('0x6'),auth[_0x7008('0x4')](),controller[_0x7008('0x7')]);router['get'](_0x7008('0x8'),auth[_0x7008('0x4')](),controller[_0x7008('0x9')]);router['get'](_0x7008('0xa'),auth[_0x7008('0x4')](),controller[_0x7008('0xb')]);router['get'](_0x7008('0xc'),auth[_0x7008('0x4')](),controller[_0x7008('0xd')]);router[_0x7008('0xe')]('/',auth[_0x7008('0x4')](),controller[_0x7008('0xf')]);router['post'](_0x7008('0xa'),auth[_0x7008('0x4')](),controller['addMessage']);router['post'](_0x7008('0x10'),auth[_0x7008('0x4')](),interaction[_0x7008('0x11')]('mail','mailinteraction:addtags'),controller[_0x7008('0x12')]);router[_0x7008('0x13')](_0x7008('0x8'),auth[_0x7008('0x4')](),interaction[_0x7008('0x11')](_0x7008('0x14'),_0x7008('0x15')),controller[_0x7008('0x16')]);router[_0x7008('0x17')](_0x7008('0x8'),auth[_0x7008('0x4')](),interaction[_0x7008('0x11')]('mail',_0x7008('0x18')),controller[_0x7008('0x19')]);router[_0x7008('0x17')](_0x7008('0x10'),auth['isAuthenticated'](),controller[_0x7008('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 9f5cf49..e0f2a09 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 _0x853e=['sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','ENUM','out'];(function(_0x3d1ce2,_0x2a9d26){var _0x43c682=function(_0x1d3031){while(--_0x1d3031){_0x3d1ce2['push'](_0x3d1ce2['shift']());}};_0x43c682(++_0x2a9d26);}(_0x853e,0xea));var _0xe853=function(_0x7f91bd,_0x317594){_0x7f91bd=_0x7f91bd-0x0;var _0x3f156a=_0x853e[_0x7f91bd];return _0x3f156a;};'use strict';var Sequelize=require(_0xe853('0x0'));var iconv=require(_0xe853('0x1'));module[_0xe853('0x2')]={'closed':{'type':Sequelize[_0xe853('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xe853('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xe853('0x5')]},'thirdDisposition':{'type':Sequelize[_0xe853('0x5')]},'note':{'type':Sequelize[_0xe853('0x5')]},'inReplyTo':{'type':Sequelize[_0xe853('0x5')](0x1fe)},'to':{'type':Sequelize[_0xe853('0x5')]},'cc':{'type':Sequelize[_0xe853('0x6')]('long')},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xe853('0x4')]},'substatus':{'type':Sequelize[_0xe853('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0xe853('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xe853('0x7')]('in',_0xe853('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xe853('0x7')]('in',_0xe853('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf990=['TEXT','long','ENUM','out','sequelize','exports','DATE','STRING'];(function(_0x4af45e,_0xa921ff){var _0x20e6da=function(_0x502525){while(--_0x502525){_0x4af45e['push'](_0x4af45e['shift']());}};_0x20e6da(++_0xa921ff);}(_0xf990,0x1bc));var _0x0f99=function(_0x321d0f,_0xc41539){_0x321d0f=_0x321d0f-0x0;var _0xbe7682=_0xf990[_0x321d0f];return _0xbe7682;};'use strict';var Sequelize=require(_0x0f99('0x0'));var iconv=require('iconv');module[_0x0f99('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0f99('0x2')]},'disposition':{'type':Sequelize[_0x0f99('0x3')]},'secondDisposition':{'type':Sequelize[_0x0f99('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0f99('0x3')]},'inReplyTo':{'type':Sequelize[_0x0f99('0x3')](0x1fe)},'to':{'type':Sequelize[_0x0f99('0x3')]},'cc':{'type':Sequelize[_0x0f99('0x4')](_0x0f99('0x5'))},'subject':{'type':Sequelize[_0x0f99('0x4')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x0f99('0x2')]},'substatus':{'type':Sequelize[_0x0f99('0x3')](0x3c)},'substatusAt':{'type':Sequelize[_0x0f99('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x0f99('0x6')]('in',_0x0f99('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0f99('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x0f99('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index ac9f95f..353220a 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 _0x2eb2=['MailMessage','findOne','out','plainBody','lastMsgText','trimStart','catch','waiting','talking','answered','total','closed','UserId','unmanaged','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','select','color','tools_tags','field','ui.MailInteractionId','user_has_mail_interactions','users','u.id\x20=\x20ui.UserId','from','mail_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','keys','some','isEmpty','MailAccountId','concat','createdAt','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','QueryTypes','clone','i.id','contactName','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','count','keyBy','MailInteraction','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','o.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','enableEmailPreview','rows','show','includeAll','include','merge','options','create','body','destroy','params','describe','addMessage','getMessages','MailInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','true','addTags','setTags','omit','ids','mailInteractionTags:save','removeTags','download','unix','join','root','files','tmp','server','attachments','format','Attachment','Messages','bcc','get','mkdirSync','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','Bcc','Attachments','basename','existsSync','build','writeFileSync','message%d.eml','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','squel','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','html-entities','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','status','json','offset','limit','undefined','set','Content-Range','update','then','end','error','stack','name','send','Users','map','TagIds','Tags','push'];(function(_0x49cf9b,_0x2fc65b){var _0x263b08=function(_0x423465){while(--_0x423465){_0x49cf9b['push'](_0x49cf9b['shift']());}};_0x263b08(++_0x2fc65b);}(_0x2eb2,0x19f));var _0x22eb=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x2eb2[_0x18cd5b];return _0x5eaa52;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x22eb('0x0'));var zipdir=require(_0x22eb('0x1'));var moment=require(_0x22eb('0x2'));var BPromise=require(_0x22eb('0x3'));var util=require(_0x22eb('0x4'));var path=require(_0x22eb('0x5'));var fs=require('fs');var _=require('lodash');var squel=require(_0x22eb('0x6'));var juice=require('juice');var Redis=require('ioredis');var qs=require(_0x22eb('0x7'));var as=require(_0x22eb('0x8'));var logger=require(_0x22eb('0x9'))(_0x22eb('0xa'));var config=require(_0x22eb('0xb'));var db=require(_0x22eb('0xc'))['db'];var htmlEntities=require(_0x22eb('0xd'));config[_0x22eb('0xe')]=_[_0x22eb('0xf')](config[_0x22eb('0xe')],{'host':_0x22eb('0x10'),'port':0x18eb});var socket=require(_0x22eb('0x11'))(new Redis(config['redis']));require(_0x22eb('0x12'))['register'](socket);function respondWithStatusCode(_0x4ce9fb,_0x1aa348){_0x1aa348=_0x1aa348||0xcc;return function(_0x5d6f8a){if(_0x5d6f8a){return _0x4ce9fb[_0x22eb('0x13')](_0x1aa348);}return _0x4ce9fb[_0x22eb('0x14')](_0x1aa348)['end']();};}function respondWithResult(_0x5068ea,_0x1f286c){_0x1f286c=_0x1f286c||0xc8;return function(_0x189f05){if(_0x189f05){return _0x5068ea[_0x22eb('0x14')](_0x1f286c)[_0x22eb('0x15')](_0x189f05);}};}function respondWithFilteredResult(_0x427439,_0x49e37e){return function(_0x350ade){if(_0x350ade){var _0x53f14e=typeof _0x49e37e[_0x22eb('0x16')]==='undefined'&&typeof _0x49e37e[_0x22eb('0x17')]===_0x22eb('0x18');var _0x53abbf=_0x350ade['count'];var _0x4bc29a=_0x53f14e?0x0:_0x49e37e[_0x22eb('0x16')];var _0x5245fe=_0x53f14e?_0x350ade['count']:_0x49e37e[_0x22eb('0x16')]+_0x49e37e['limit'];var _0x4d9b09;if(_0x5245fe>=_0x53abbf){_0x5245fe=_0x53abbf;_0x4d9b09=0xc8;}else{_0x4d9b09=0xce;}_0x427439[_0x22eb('0x14')](_0x4d9b09);return _0x427439[_0x22eb('0x19')](_0x22eb('0x1a'),_0x4bc29a+'-'+_0x5245fe+'/'+_0x53abbf)[_0x22eb('0x15')](_0x350ade);}return null;};}function saveUpdates(_0x3b0940){return function(_0x4bc0a2){if(_0x4bc0a2){return _0x4bc0a2[_0x22eb('0x1b')](_0x3b0940)[_0x22eb('0x1c')](function(_0x10d182){return _0x10d182;});}return null;};}function removeEntity(_0x410c25){return function(_0x36be50){if(_0x36be50){return _0x36be50['destroy']()[_0x22eb('0x1c')](function(){_0x410c25[_0x22eb('0x14')](0xcc)[_0x22eb('0x1d')]();});}};}function handleEntityNotFound(_0x49ce2a){return function(_0x490b34){if(!_0x490b34){_0x49ce2a[_0x22eb('0x13')](0x194);}return _0x490b34;};}function handleError(_0x267d97,_0x434ecb){_0x434ecb=_0x434ecb||0x1f4;return function(_0x44639a){logger[_0x22eb('0x1e')](_0x44639a[_0x22eb('0x1f')]);if(_0x44639a[_0x22eb('0x20')]){delete _0x44639a['name'];}_0x267d97[_0x22eb('0x14')](_0x434ecb)[_0x22eb('0x21')](_0x44639a);};}function getInteractionUsers(_0x3ffa9e,_0x3031b3){return new BPromise(function(_0x420d4f,_0x4da252){try{if(_0x3031b3[_0x3ffa9e['id']]){_0x3ffa9e[_0x22eb('0x22')]=_[_0x22eb('0x23')](_0x3031b3[_0x3ffa9e['id']],function(_0x2f3b39){return{'id':_0x2f3b39['id'],'fullname':_0x2f3b39['fullname']};});}}catch(_0xe0783c){_0x4da252(_0xe0783c);}_0x420d4f(_0x3ffa9e);});}function getInteractionTags(_0x259847,_0x4b409a){return new BPromise(function(_0x32a4b6,_0x222ef3){try{if(_0x259847[_0x22eb('0x24')]){_0x259847[_0x22eb('0x25')]=[];_0x259847[_0x22eb('0x24')]['split'](',')['forEach'](function(_0x2a950e){_0x259847[_0x22eb('0x25')][_0x22eb('0x26')](_0x4b409a[_0x2a950e]);});}delete _0x259847[_0x22eb('0x24')];}catch(_0x1599c7){_0x222ef3(_0x1599c7);}_0x32a4b6(_0x259847);});}function getLastMessageText(_0x14724e){return new BPromise(function(_0x2375e7,_0x13814f){return db[_0x22eb('0x27')][_0x22eb('0x28')]({'where':{'$and':[{'MailInteractionId':_0x14724e['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x22eb('0x29')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0x22eb('0x2a')],'order':'-id','raw':!![]})[_0x22eb('0x1c')](function(_0x4e3604){if(_0x4e3604&&_0x4e3604[_0x22eb('0x2a')]){_0x14724e[_0x22eb('0x2b')]=_[_0x22eb('0x2c')](_0x4e3604[_0x22eb('0x2a')]);}_0x2375e7(_0x14724e);})[_0x22eb('0x2d')](function(_0x158cfa){_0x13814f(_0x158cfa);});});}function updateMailInteraction(_0x35fb89,_0x476cdb,_0x22354d,_0x232af4){return new BPromise(function(_0x509bb7,_0x49259f){return getInteractionUsers(_0x35fb89,_0x22354d)[_0x22eb('0x1c')](function(_0x5ceec1){return getInteractionTags(_0x5ceec1,_0x476cdb);})['then'](function(_0x2caba3){return getStateInteraction(_0x2caba3);})[_0x22eb('0x1c')](function(_0x39dbc6){if(_0x232af4){_0x509bb7(getLastMessageText(_0x39dbc6));}else{_0x509bb7(_0x39dbc6);}})[_0x22eb('0x2d')](function(_0x45c53e){_0x49259f(_0x45c53e);});});}function getStateInteraction(_0x332e9a){return new BPromise(function(_0x3855df){_0x332e9a[_0x22eb('0x2e')]=0x0;_0x332e9a[_0x22eb('0x2f')]=0x0;_0x332e9a[_0x22eb('0x30')]=0x0;_0x332e9a['unmanaged']=0x0;_0x332e9a[_0x22eb('0x31')]=0x0;if(!_0x332e9a['closed']&&!_0x332e9a['UserId']){_0x332e9a[_0x22eb('0x2e')]+=0x1;}if(!_0x332e9a[_0x22eb('0x32')]&&_0x332e9a['UserId']){_0x332e9a[_0x22eb('0x2f')]+=0x1;if(_0x332e9a[_0x22eb('0x2e')]){_0x332e9a[_0x22eb('0x2e')]-=0x1;}}if(_0x332e9a[_0x22eb('0x32')]&&_0x332e9a[_0x22eb('0x33')]){_0x332e9a['answered']+=0x1;if(_0x332e9a[_0x22eb('0x2f')]){_0x332e9a[_0x22eb('0x2f')]-=0x1;}}if(_0x332e9a['closed']&&!_0x332e9a[_0x22eb('0x33')]){_0x332e9a[_0x22eb('0x34')]+=0x1;if(_0x332e9a[_0x22eb('0x2e')]){_0x332e9a[_0x22eb('0x2e')]-=0x1;}}_0x332e9a[_0x22eb('0x31')]+=0x1;_0x3855df(_0x332e9a);});}exports['index']=function(_0x51c8b5,_0x2b1ae1){var _0x6cd651={},_0x541153={},_0x595d76={'count':0x0,'rows':[]};var _0x2e2a0c=_[_0x22eb('0x23')](db['MailInteraction'][_0x22eb('0x35')],function(_0x3377eb){return{'name':_0x3377eb[_0x22eb('0x36')],'type':_0x3377eb[_0x22eb('0x37')][_0x22eb('0x38')]};});_0x541153[_0x22eb('0x39')]=_['map'](_0x2e2a0c,_0x22eb('0x20'));_0x541153[_0x22eb('0x3a')]=_['keys'](_0x51c8b5[_0x22eb('0x3a')]);_0x541153[_0x22eb('0x3b')]=_[_0x22eb('0x3c')](_0x541153[_0x22eb('0x39')],_0x541153[_0x22eb('0x3a')]);_0x6cd651[_0x22eb('0x3d')]=_[_0x22eb('0x3c')](_0x541153[_0x22eb('0x39')],qs[_0x22eb('0x3e')](_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x3e')]));_0x6cd651[_0x22eb('0x3d')]=_0x6cd651[_0x22eb('0x3d')][_0x22eb('0x3f')]?_0x6cd651[_0x22eb('0x3d')]:_0x541153[_0x22eb('0x39')];if(!_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x40')]('nolimit')){_0x6cd651[_0x22eb('0x17')]=qs[_0x22eb('0x17')](_0x51c8b5['query'][_0x22eb('0x17')]);_0x6cd651[_0x22eb('0x16')]=qs['offset'](_0x51c8b5['query']['offset']);}_0x6cd651[_0x22eb('0x41')]=qs[_0x22eb('0x42')](_0x51c8b5['query']['sort']);_0x6cd651[_0x22eb('0x43')]=qs[_0x22eb('0x3b')](_[_0x22eb('0x44')](_0x51c8b5[_0x22eb('0x3a')],_0x541153[_0x22eb('0x3b')]),_0x2e2a0c);var _0x3b30a3=[];var _0x80efb0=squel[_0x22eb('0x45')]()['field']('id')['field'](_0x22eb('0x20'))['field'](_0x22eb('0x46'))['from'](_0x22eb('0x47'));var _0x5c41c0=squel['select']()['field']('u.id')[_0x22eb('0x48')]('u.fullname')[_0x22eb('0x48')](_0x22eb('0x49'))['from'](_0x22eb('0x4a'),'ui')['left_join'](_0x22eb('0x4b'),'u',_0x22eb('0x4c'));var _0x1df219=squel[_0x22eb('0x45')]()[_0x22eb('0x4d')](_0x22eb('0x4e'),'i')[_0x22eb('0x4f')](_0x22eb('0x50'),'c',_0x22eb('0x51'))['left_join'](_0x22eb('0x4b'),'o',_0x22eb('0x52'))['left_join'](_0x22eb('0x53'),'a',_0x22eb('0x54'))[_0x22eb('0x4f')](_0x22eb('0x55'),'me','me.MailInteractionId\x20=\x20i.id')[_0x22eb('0x4f')](_0x22eb('0x56'),'it',_0x22eb('0x57'))[_0x22eb('0x4f')](_0x22eb('0x47'),'t',_0x22eb('0x58'));var _0x5effca=squel[_0x22eb('0x59')]();var _0x4e5b9f=[];var _0x3ff406=squel['expr']();var _0x13859b;if(_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x5a')]){_0x13859b=as[_0x22eb('0x5b')](_0x51c8b5[_0x22eb('0x3a')]['search']);var _0x4896ed=_0x13859b[_0x22eb('0x5c')];for(var _0x8e3864=0x0;_0x8e3864<_0x13859b['conditions'][_0x22eb('0x3f')];_0x8e3864++){var _0xdf9531=_0x13859b[_0x22eb('0x5d')][_0x8e3864];var _0x27f8a2='i';var _0x3337dd=_[_0x22eb('0x5e')](_0x2e2a0c,[_0x22eb('0x20'),_0xdf9531[_0x22eb('0x48')]]);if(!_0x3337dd){switch(_0xdf9531[_0x22eb('0x48')]){case _0x22eb('0x5f'):if(_0xdf9531[_0x22eb('0x60')]==0x1){_0x1df219['having']('`'+_0xdf9531[_0x22eb('0x48')]+_0x22eb('0x61'));}else{_0x1df219[_0x22eb('0x62')]('`'+_0xdf9531[_0x22eb('0x48')]+_0x22eb('0x63'));}break;case _0x22eb('0x64'):if(_0xdf9531[_0x22eb('0x65')]===_0x22eb('0x66')){if(_0xdf9531[_0x22eb('0x60')][_0x22eb('0x67')]('\x20')[_0x22eb('0x3f')]>0x1){_0x5effca[_0x4896ed](_0x22eb('0x68'),qs[_0x22eb('0x69')](_0xdf9531[_0x22eb('0x60')]),null);}else{var _0x586384='%'+_0xdf9531['value']+'%';_0x5effca[_0x4896ed](_0x22eb('0x6a'),_0x586384,_0x586384,_0x586384);}}else{_0x3337dd=_[_0x22eb('0x5e')](_0x2e2a0c,[_0x22eb('0x20'),_0x22eb('0x6b')]);_0xdf9531[_0x22eb('0x48')]='ContactId';_0x2e77c6=as[_0x22eb('0x6c')](_0x27f8a2,_0x3337dd[_0x22eb('0x37')],_0xdf9531);_0x5effca[_0x4896ed](_0x2e77c6['text'],_0x2e77c6['value'][_0x22eb('0x6d')],_0x2e77c6[_0x22eb('0x60')][_0x22eb('0x1d')]);}break;case _0x22eb('0x6e'):var _0x445ec5=_0xdf9531[_0x22eb('0x60')][_0x22eb('0x67')](',')[_0x22eb('0x23')](function(_0x3f7b33){return Number(_0x3f7b33);});_0x445ec5[_0x22eb('0x6f')](function(_0x164645){_0x3ff406['or'](_0x22eb('0x70'),'%,'+_0x164645+',%');});_0x4e5b9f=_[_0x22eb('0x71')](_0x4e5b9f,_0x445ec5);break;case _0x22eb('0x72'):if(_0xdf9531['operator']===_0x22eb('0x66')){_0x5effca[_0x4896ed](_0x22eb('0x73'),'%'+_0xdf9531[_0x22eb('0x60')]+'%',null);}else{_0x3337dd=_['find'](_0x2e2a0c,[_0x22eb('0x20'),'UserId']);_0xdf9531[_0x22eb('0x48')]='UserId';_0x2e77c6=as[_0x22eb('0x6c')](_0x27f8a2,_0x3337dd[_0x22eb('0x37')],_0xdf9531);_0x5effca[_0x4896ed](_0x2e77c6['text'],_0x2e77c6[_0x22eb('0x60')][_0x22eb('0x6d')],_0x2e77c6['value']['end']);}break;case _0x22eb('0x2a'):_0x2e77c6=as[_0x22eb('0x6c')]('me',null,_0xdf9531);_0x5effca[_0x4896ed](_0x2e77c6[_0x22eb('0x74')],_0x2e77c6[_0x22eb('0x60')][_0x22eb('0x6d')],_0x2e77c6[_0x22eb('0x60')]['end']);break;}}else{var _0x2e77c6=as['buildExpression'](_0x27f8a2,_0x3337dd['type'],_0xdf9531);_0x5effca[_0x4896ed](_0x2e77c6[_0x22eb('0x74')],_0x2e77c6[_0x22eb('0x60')][_0x22eb('0x6d')],_0x2e77c6[_0x22eb('0x60')][_0x22eb('0x1d')]);}}}else{var _0x797700=_(_0x51c8b5[_0x22eb('0x3a')])[_0x22eb('0x75')]()['map'](function(_0x57e25a){return _[_0x22eb('0x76')](_0x2e2a0c,[_0x22eb('0x20'),_0x57e25a])?_0x57e25a:undefined;})['compact']()[_0x22eb('0x60')]();if(!_[_0x22eb('0x77')](_0x797700)){_0x797700[_0x22eb('0x6f')](function(_0x27e3d2){if(_0x27e3d2===_0x22eb('0x78')){_0x1df219[_0x22eb('0x43')]('i.MailAccountId\x20IN\x20?',[][_0x22eb('0x79')](_0x51c8b5[_0x22eb('0x3a')][_0x27e3d2]));}else if(_0x27e3d2===_0x22eb('0x7a')){var _0x5e46b0=JSON['parse'](_0x51c8b5[_0x22eb('0x3a')][_0x27e3d2])[_0x22eb('0x7b')];var _0xa4178f=JSON['parse'](_0x51c8b5[_0x22eb('0x3a')][_0x27e3d2])['$lte'];_0x1df219[_0x22eb('0x43')](_0x22eb('0x7c'),_0x5e46b0,_0xa4178f);}else{if(_0x51c8b5[_0x22eb('0x3a')][_0x27e3d2]===_0x22eb('0x7d')){_0x1df219['where']('i.'+_0x27e3d2+_0x22eb('0x7e'));}else{_0x1df219[_0x22eb('0x43')]('i.'+_0x27e3d2+_0x22eb('0x7f'),_0x51c8b5[_0x22eb('0x3a')][_0x27e3d2]);}}});}if(_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x80')]){if(_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x80')]==0x1){_0x1df219[_0x22eb('0x62')](_0x22eb('0x81'));}else{_0x1df219[_0x22eb('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x82')]){_0x4e5b9f=_['isArray'](_0x51c8b5['query']['tag'])?_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x82')]:new Array(_0x51c8b5['query'][_0x22eb('0x82')]);_0x4e5b9f[_0x22eb('0x6f')](function(_0xe6e71d){_0x3ff406['or'](_0x22eb('0x70'),'%,'+_0xe6e71d+',%');});}if(_0x51c8b5[_0x22eb('0x3a')]['filter']){var _0x5e01b5=_0x51c8b5[_0x22eb('0x3a')][_0x22eb('0x83')][_0x22eb('0x84')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5e01b5)){_0x5effca['or'](_0x22eb('0x85'),_0x5e01b5+'%');}else if(qs['isEmail'](_0x5e01b5)){_0x5effca['or']('c.email\x20LIKE\x20?',_0x5e01b5+'%');}else{_0x5effca['or'](_0x22eb('0x86'),qs[_0x22eb('0x69')](_0x5e01b5))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5e01b5));}}}_0x1df219[_0x22eb('0x43')](_0x5effca);_0x1df219[_0x22eb('0x87')]('i.id');var _0x17f51b={'type':db[_0x22eb('0x88')][_0x22eb('0x89')]['SELECT'],'raw':!![]};var _0x464f4f=_0x1df219[_0x22eb('0x8a')]();_0x464f4f[_0x22eb('0x48')](_0x22eb('0x8b'));_0x464f4f[_0x22eb('0x48')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x22eb('0x5f'));if(_0x6cd651[_0x22eb('0x41')]){_0x6cd651[_0x22eb('0x41')]['forEach'](function(_0x49bd55){var _0x17e7a3=_0x49bd55[0x0]===_0x22eb('0x8c')?_0x49bd55[0x0]:'i.'+_0x49bd55[0x0];_0x1df219[_0x22eb('0x41')](_0x17e7a3,_0x49bd55[0x1]==='DESC'?![]:!![]);});}if(!_[_0x22eb('0x77')](_0x4e5b9f)){_0x1df219[_0x22eb('0x62')](_0x3ff406);_0x464f4f[_0x22eb('0x43')]('t.id\x20IN\x20?',_0x4e5b9f);}BPromise[_0x22eb('0x8d')]()['then'](function(){if(!_0x13859b){if(_0x51c8b5['query'][_0x22eb('0x78')])return;_0x464f4f[_0x22eb('0x43')](_0x22eb('0x8e'));_0x1df219['where'](_0x22eb('0x8e'));return;}if(_0x51c8b5[_0x22eb('0x8f')][_0x22eb('0x90')]!==_0x22eb('0x91'))return;return _0x51c8b5[_0x22eb('0x8f')]['getMailAccounts']({'attributes':['id'],'raw':!![]})[_0x22eb('0x1c')](function(_0x4c88d8){if(_[_0x22eb('0x77')](_0x4c88d8)){_0x464f4f[_0x22eb('0x43')](_0x22eb('0x92'));_0x1df219['where'](_0x22eb('0x92'));}else{_0x464f4f[_0x22eb('0x43')](_0x22eb('0x93'),_[_0x22eb('0x23')](_0x4c88d8,'id'));_0x1df219[_0x22eb('0x43')](_0x22eb('0x93'),_[_0x22eb('0x23')](_0x4c88d8,'id'));}});})[_0x22eb('0x1c')](function(){if(_0x51c8b5[_0x22eb('0x8f')][_0x22eb('0x90')]===_0x22eb('0x91')&&!_0x13859b&&!_0x51c8b5['query'][_0x22eb('0x78')])return[];return db[_0x22eb('0x94')][_0x22eb('0x3a')](_0x464f4f[_0x22eb('0x95')](),_0x17f51b);})['then'](function(_0x267c0a){_0x595d76[_0x22eb('0x96')]=_0x267c0a['length'];if(_0x595d76[_0x22eb('0x96')]===0x0)return[];return db[_0x22eb('0x94')][_0x22eb('0x3a')](_0x80efb0[_0x22eb('0x95')](),_0x17f51b)[_0x22eb('0x1c')](function(_0x3a172e){_0x3b30a3=_[_0x22eb('0x97')](_0x3a172e,'id');_0x17f51b=_['merge'](_0x17f51b,{'model':db[_0x22eb('0x98')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51c8b5[_0x22eb('0x3a')]['fields']){_0x6cd651['attributes'][_0x22eb('0x6f')](function(_0x31c40a){_0x1df219[_0x22eb('0x48')]('i.'+_0x31c40a);});}else{_0x1df219[_0x22eb('0x48')](_0x22eb('0x99'),'unreadMessages');_0x1df219['field'](_0x22eb('0x9a'),_0x22eb('0x9b'));_0x1df219['field'](_0x22eb('0x9c'),_0x22eb('0x9d'));_0x1df219[_0x22eb('0x48')]('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0x22eb('0x8c'));_0x1df219[_0x22eb('0x48')](_0x22eb('0x8b'));_0x1df219[_0x22eb('0x48')](_0x22eb('0x9e'));_0x1df219[_0x22eb('0x48')](_0x22eb('0x9f'));_0x1df219[_0x22eb('0x48')]('i.closed');_0x1df219['field']('i.closedAt');_0x1df219[_0x22eb('0x48')]('i.attach');_0x1df219['field'](_0x22eb('0xa0'));_0x1df219[_0x22eb('0x48')]('i.lastMsgDirection');_0x1df219[_0x22eb('0x48')](_0x22eb('0xa1'));_0x1df219[_0x22eb('0x48')](_0x22eb('0xa2'));_0x1df219['field'](_0x22eb('0xa3'));_0x1df219[_0x22eb('0x48')](_0x22eb('0xa4'));_0x1df219['field']('i.substatus');_0x1df219['field'](_0x22eb('0xa5'));_0x1df219[_0x22eb('0x48')](_0x22eb('0xa6'));_0x1df219['field'](_0x22eb('0xa7'));_0x1df219['field']('i.UserId');_0x1df219[_0x22eb('0x48')](_0x22eb('0xa8'),'Contact.firstName');_0x1df219['field'](_0x22eb('0xa9'),_0x22eb('0xaa'));_0x1df219[_0x22eb('0x48')](_0x22eb('0xab'),_0x22eb('0xac'));_0x1df219['field']('c.phone',_0x22eb('0xad'));_0x1df219[_0x22eb('0x48')](_0x22eb('0xae'),'Contact.mobile');_0x1df219[_0x22eb('0x48')]('c.fax','Contact.fax');_0x1df219[_0x22eb('0x48')](_0x22eb('0xaf'),'Owner.fullname');_0x1df219[_0x22eb('0x48')]('o.internal',_0x22eb('0xb0'));_0x1df219['field'](_0x22eb('0xb1'),'TagIds');}if(_0x6cd651[_0x22eb('0x17')])_0x1df219[_0x22eb('0x17')](_0x6cd651[_0x22eb('0x17')]);if(_0x6cd651[_0x22eb('0x16')])_0x1df219[_0x22eb('0x16')](_0x6cd651['offset']);return db[_0x22eb('0x94')]['query'](_0x1df219[_0x22eb('0x95')](),_0x17f51b);})[_0x22eb('0x1c')](function(_0xfb52ee){if(_0xfb52ee[_0x22eb('0x3f')]>0x0)_0x5c41c0[_0x22eb('0x43')](_0x22eb('0xb2'),_['map'](_0xfb52ee,'id'));return db[_0x22eb('0x94')]['query'](_0x5c41c0['toString'](),_0x17f51b)[_0x22eb('0x1c')](function(_0x277b27){var _0x701fd0=_['groupBy'](_0x277b27,'MailInteractionId');var _0x23a537=[];return db['Setting'][_0x22eb('0x28')]({'attributes':[_0x22eb('0xb3')],'raw':!![]})[_0x22eb('0x1c')](function(_0x8bd1d0){var _0x31a73a=_0x8bd1d0[_0x22eb('0xb3')];_0xfb52ee[_0x22eb('0x6f')](function(_0x2d8e45){_0x23a537[_0x22eb('0x26')](updateMailInteraction(_0x2d8e45,_0x3b30a3,_0x701fd0,_0x31a73a));});return BPromise['all'](_0x23a537);});});});})[_0x22eb('0x1c')](function(_0x434e12){_0x595d76[_0x22eb('0xb4')]=_0x434e12;return _0x595d76;})[_0x22eb('0x1c')](respondWithFilteredResult(_0x2b1ae1,_0x6cd651))[_0x22eb('0x2d')](handleError(_0x2b1ae1,null));};exports[_0x22eb('0xb5')]=function(_0x42dbfb,_0x34b34d){var _0x38e5b5={'raw':![],'where':{'id':_0x42dbfb['params']['id']}},_0x435930={};_0x435930[_0x22eb('0x39')]=_['keys'](db[_0x22eb('0x98')][_0x22eb('0x35')]);_0x435930[_0x22eb('0x3a')]=_[_0x22eb('0x75')](_0x42dbfb[_0x22eb('0x3a')]);_0x435930['filters']=_[_0x22eb('0x3c')](_0x435930[_0x22eb('0x39')],_0x435930[_0x22eb('0x3a')]);_0x38e5b5[_0x22eb('0x3d')]=_[_0x22eb('0x3c')](_0x435930[_0x22eb('0x39')],qs[_0x22eb('0x3e')](_0x42dbfb['query'][_0x22eb('0x3e')]));_0x38e5b5[_0x22eb('0x3d')]=_0x38e5b5[_0x22eb('0x3d')][_0x22eb('0x3f')]?_0x38e5b5['attributes']:_0x435930[_0x22eb('0x39')];if(_0x42dbfb[_0x22eb('0x3a')][_0x22eb('0xb6')]){_0x38e5b5[_0x22eb('0xb7')]=[{'all':!![]}];}_0x38e5b5=_[_0x22eb('0xb8')]({},_0x38e5b5,_0x42dbfb[_0x22eb('0xb9')]);return db[_0x22eb('0x98')]['find'](_0x38e5b5)[_0x22eb('0x1c')](handleEntityNotFound(_0x34b34d,null))[_0x22eb('0x1c')](respondWithResult(_0x34b34d,null))[_0x22eb('0x2d')](handleError(_0x34b34d,null));};exports[_0x22eb('0xba')]=function(_0xe26a88,_0x358f63){return db[_0x22eb('0x98')]['create'](_0xe26a88['body'],{})[_0x22eb('0x1c')](respondWithResult(_0x358f63,0xc9))['catch'](handleError(_0x358f63,null));};exports[_0x22eb('0x1b')]=function(_0x4c38a2,_0x495c09){if(_0x4c38a2[_0x22eb('0xbb')]['id']){delete _0x4c38a2[_0x22eb('0xbb')]['id'];}return db[_0x22eb('0x98')][_0x22eb('0x5e')]({'where':{'id':_0x4c38a2['params']['id']}})[_0x22eb('0x1c')](handleEntityNotFound(_0x495c09,null))[_0x22eb('0x1c')](saveUpdates(_0x4c38a2[_0x22eb('0xbb')],null))['then'](respondWithResult(_0x495c09,null))[_0x22eb('0x2d')](handleError(_0x495c09,null));};exports[_0x22eb('0xbc')]=function(_0x2030c1,_0x315a73){return db[_0x22eb('0x98')]['find']({'where':{'id':_0x2030c1[_0x22eb('0xbd')]['id']}})[_0x22eb('0x1c')](handleEntityNotFound(_0x315a73,null))[_0x22eb('0x1c')](removeEntity(_0x315a73,null))[_0x22eb('0x2d')](handleError(_0x315a73,null));};exports['describe']=function(_0xc4a67b,_0x2500ad){return db['MailInteraction'][_0x22eb('0xbe')]()[_0x22eb('0x1c')](respondWithResult(_0x2500ad,null))[_0x22eb('0x2d')](handleError(_0x2500ad,null));};exports[_0x22eb('0xbf')]=function(_0x3e2453,_0x4187d7){return db[_0x22eb('0x27')][_0x22eb('0x5e')]({'where':{'id':_0x3e2453[_0x22eb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4187d7,null))[_0x22eb('0x1c')](function(_0x3b2e19){if(_0x3b2e19){return _0x3b2e19[_0x22eb('0xbf')](_0x3e2453[_0x22eb('0xbb')]['ids'],_['omit'](_0x3e2453[_0x22eb('0xbb')],['ids','id'])||{});}})['then'](respondWithResult(_0x4187d7,null))[_0x22eb('0x2d')](handleError(_0x4187d7,null));};exports[_0x22eb('0xc0')]=function(_0x6e975d,_0x39277b){var _0x3b84ec={'raw':![],'where':{}};var _0x44d9d5={};var _0x5cf6ee={'count':0x0,'rows':[]};return db[_0x22eb('0x98')][_0x22eb('0x28')]({'where':{'id':_0x6e975d[_0x22eb('0xbd')]['id']}})['then'](handleEntityNotFound(_0x39277b,null))[_0x22eb('0x1c')](function(_0x55ed17){if(_0x55ed17){_0x44d9d5[_0x22eb('0x39')]=_['keys'](db[_0x22eb('0x27')]['rawAttributes']);_0x44d9d5[_0x22eb('0x3a')]=_[_0x22eb('0x75')](_0x6e975d[_0x22eb('0x3a')]);_0x44d9d5[_0x22eb('0x3b')]=_[_0x22eb('0x3c')](_0x44d9d5[_0x22eb('0x39')],_0x44d9d5[_0x22eb('0x3a')]);_0x3b84ec[_0x22eb('0x3d')]=_[_0x22eb('0x3c')](_0x44d9d5[_0x22eb('0x39')],qs['fields'](_0x6e975d[_0x22eb('0x3a')][_0x22eb('0x3e')]));_0x3b84ec['attributes']=_0x3b84ec[_0x22eb('0x3d')][_0x22eb('0x3f')]?_0x3b84ec[_0x22eb('0x3d')]:_0x44d9d5[_0x22eb('0x39')];if(!_0x6e975d['query']['hasOwnProperty']('nolimit')){_0x3b84ec[_0x22eb('0x17')]=qs['limit'](_0x6e975d['query'][_0x22eb('0x17')]);_0x3b84ec[_0x22eb('0x16')]=qs[_0x22eb('0x16')](_0x6e975d['query']['offset']);}_0x3b84ec[_0x22eb('0x41')]=qs[_0x22eb('0x42')](_0x6e975d[_0x22eb('0x3a')][_0x22eb('0x42')]);_0x3b84ec[_0x22eb('0x43')]=qs[_0x22eb('0x3b')](_['pick'](_0x6e975d['query'],_0x44d9d5[_0x22eb('0x3b')]));_0x3b84ec[_0x22eb('0x43')][_0x22eb('0xc1')]=_0x55ed17['id'];if(_0x6e975d[_0x22eb('0x3a')][_0x22eb('0x83')]){_0x3b84ec[_0x22eb('0x43')]=_[_0x22eb('0xb8')](_0x3b84ec[_0x22eb('0x43')],{'$or':_[_0x22eb('0x23')](_0x3b84ec['attributes'],function(_0x1d5990){var _0x5d28f8={};_0x5d28f8[_0x1d5990]={'$like':'%'+_0x6e975d['query'][_0x22eb('0x83')]+'%'};return _0x5d28f8;})});}if(_0x6e975d['query'][_0x22eb('0x7b')]){var _0x564f0f=_0x6e975d[_0x22eb('0x3a')][_0x22eb('0x7b')][_0x22eb('0x67')](',');var _0x1c5d94={};_0x1c5d94[_0x564f0f[0x0]]={'$gte':moment(_0x564f0f[0x1])['format'](_0x22eb('0xc2'))};_0x3b84ec[_0x22eb('0x43')]=_[_0x22eb('0xb8')](_0x3b84ec[_0x22eb('0x43')],_0x1c5d94);}_0x3b84ec=_[_0x22eb('0xb8')]({},_0x3b84ec,_0x6e975d[_0x22eb('0xb9')]);return db['MailMessage'][_0x22eb('0x96')]({'where':_0x3b84ec[_0x22eb('0x43')]})[_0x22eb('0x1c')](function(_0x4e027e){_0x5cf6ee[_0x22eb('0x96')]=_0x4e027e;if(_0x6e975d['query'][_0x22eb('0xb6')]){_0x3b84ec[_0x22eb('0xb7')]=[{'all':!![]}];}return db[_0x22eb('0x27')][_0x22eb('0xc3')](_0x3b84ec);})[_0x22eb('0x1c')](function(_0x1ada3a){if(_0x6e975d[_0x22eb('0x3a')]['inlineCss']===_0x22eb('0xc4')){for(var _0x5e06cd=0x0;_0x5e06cd<_0x1ada3a[_0x22eb('0x3f')];_0x5e06cd++){_0x1ada3a[_0x5e06cd]['body']=juice(_0x1ada3a[_0x5e06cd][_0x22eb('0xbb')]);}}_0x5cf6ee['rows']=_0x1ada3a;return _0x5cf6ee;});}})[_0x22eb('0x1c')](respondWithFilteredResult(_0x39277b,_0x3b84ec))['catch'](handleError(_0x39277b,null));};exports[_0x22eb('0xc5')]=function(_0x12d3c0,_0x499cde){return db[_0x22eb('0x98')][_0x22eb('0x5e')]({'where':{'id':_0x12d3c0[_0x22eb('0xbd')]['id']}})[_0x22eb('0x1c')](handleEntityNotFound(_0x499cde,null))[_0x22eb('0x1c')](function(_0xf1d03c){if(_0xf1d03c){return _0xf1d03c[_0x22eb('0xc6')](_0x12d3c0['body']['ids'],_[_0x22eb('0xc7')](_0x12d3c0[_0x22eb('0xbb')],[_0x22eb('0xc8'),'id'])||{})['spread'](function(){return db['Tag']['findAll']({'attributes':['id',_0x22eb('0x20'),_0x22eb('0x46')],'where':{'id':_0x12d3c0[_0x22eb('0xbb')][_0x22eb('0xc8')]}});})['then'](function(_0x159a3f){socket['emit'](_0x22eb('0xc9'),{'id':Number(_0x12d3c0[_0x22eb('0xbd')]['id']),'tags':_0x159a3f||[]});return{'id':Number(_0x12d3c0['params']['id']),'tags':_0x159a3f||[]};});}})[_0x22eb('0x1c')](respondWithResult(_0x499cde,null))['catch'](handleError(_0x499cde,null));};exports[_0x22eb('0xca')]=function(_0x5051ae,_0x14602e){return db[_0x22eb('0x98')]['find']({'where':{'id':_0x5051ae[_0x22eb('0xbd')]['id']}})[_0x22eb('0x1c')](handleEntityNotFound(_0x14602e,null))[_0x22eb('0x1c')](function(_0x5041d9){if(_0x5041d9){return _0x5041d9['removeTags'](_0x5051ae[_0x22eb('0x3a')]['ids']);}})['then'](respondWithStatusCode(_0x14602e,null))['catch'](handleError(_0x14602e,null));};exports[_0x22eb('0xcb')]=function(_0x47abac,_0xa9eb71){var _0xc659d2=moment()[_0x22eb('0xcc')]()[_0x22eb('0x95')]();var _0x31652f=path[_0x22eb('0xcd')](config[_0x22eb('0xce')],'server',_0x22eb('0xcf'),_0x22eb('0xd0'));var _0x5d0257=path[_0x22eb('0xcd')](config[_0x22eb('0xce')],_0x22eb('0xd1'),_0x22eb('0xcf'),_0x22eb('0xd2'));var _0x1dfca2=path['join'](_0x31652f,_0xc659d2);var _0x2f6d51=util[_0x22eb('0xd3')]('transcript-%d-%s.zip',_0x47abac['params']['id'],_0xc659d2);var _0x299bc8=path['join'](_0x31652f,_0x2f6d51);var _0x5f2cfb=[];if(_0x47abac[_0x22eb('0x3a')][_0x22eb('0xd2')]){_0x5f2cfb['push']({'model':db[_0x22eb('0xd4')],'as':'Attachments','raw':!![]});}var _0x26f5c0=[{'model':db[_0x22eb('0x27')],'as':_0x22eb('0xd5'),'attributes':['id',_0x22eb('0xbb'),_0x22eb('0x4d'),'to','cc',_0x22eb('0xd6'),'subject',_0x22eb('0x7a')],'where':{'secret':![]},'order':qs[_0x22eb('0x42')]('id'),'include':_0x5f2cfb}];return db[_0x22eb('0x98')][_0x22eb('0x5e')]({'where':{'id':_0x47abac['params']['id']},'include':_0x26f5c0})[_0x22eb('0x1c')](handleEntityNotFound(_0xa9eb71,null))[_0x22eb('0x1c')](function(_0x18f49d){if(_0x18f49d&&_0x18f49d[_0x22eb('0xd5')]){var _0x1d8690=_0x18f49d[_0x22eb('0xd7')]({'plain':!![]});fs[_0x22eb('0xd8')](_0x1dfca2);return BPromise['each'](_0x1d8690[_0x22eb('0xd5')],function(_0x127a72,_0x5eab5e){var _0x2b1c67={'from':_0x127a72[_0x22eb('0x4d')],'to':_0x127a72['to'],'subject':_0x127a72['subject'],'html':htmlEntities[_0x22eb('0xd9')](_0x127a72[_0x22eb('0xbb')]),'headers':{'Date':moment(_0x127a72['createdAt'])[_0x22eb('0xd3')](_0x22eb('0xda'))},'attachments':[]};if(_0x127a72['cc']){_0x2b1c67['headers']['Cc']=_0x127a72['cc'];}if(_0x127a72['bcc']){_0x2b1c67['headers'][_0x22eb('0xdb')]=_0x127a72[_0x22eb('0xd6')];}return new BPromise(function(_0x47b840,_0x22eba7){if(_0x127a72[_0x22eb('0xdc')]){for(var _0x15b9d3=0x0;_0x15b9d3<_0x127a72[_0x22eb('0xdc')][_0x22eb('0x3f')];_0x15b9d3++){var _0x19e0a1=_0x127a72[_0x22eb('0xdc')][_0x15b9d3];var _0x591ec0=path['join'](_0x5d0257,_0x19e0a1[_0x22eb('0xdd')]);if(fs[_0x22eb('0xde')](_0x591ec0)){_0x2b1c67['attachments'][_0x22eb('0x26')]({'name':_0x19e0a1[_0x22eb('0x20')],'contentType':_0x19e0a1['type'],'data':fs['readFileSync'](_0x591ec0)});}}}emlformat[_0x22eb('0xdf')](_0x2b1c67,function(_0x14888c,_0x299a14){if(_0x14888c)return _0x22eba7(_0x14888c);fs[_0x22eb('0xe0')](path[_0x22eb('0xcd')](_0x1dfca2,util[_0x22eb('0xd3')](_0x22eb('0xe1'),_0x5eab5e)),_0x299a14);return _0x47b840(_0x299a14);});});})['then'](function(){return new BPromise(function(_0x46d9e2,_0x4f8b30){zipdir(_0x1dfca2,{'saveTo':_0x299bc8},function(_0x1458a6,_0x3f025c){if(_0x1458a6)return _0x4f8b30(_0x1458a6);return _0x46d9e2(_0x3f025c);});})[_0x22eb('0x1c')](function(){return new BPromise(function(_0x2a0dbf,_0x5cb13b){rimraf(_0x1dfca2,function(_0x3cdb6c){if(_0x3cdb6c)_0x5cb13b(_0x3cdb6c);return _0x2a0dbf();});});})[_0x22eb('0x1c')](function(){return _0xa9eb71[_0x22eb('0xcb')](_0x299bc8,_0x2f6d51,function(_0x328865){if(!_0x328865)fs[_0x22eb('0xe2')](_0x299bc8);});});});}else{return _0xa9eb71[_0x22eb('0x13')](0xc8);}})[_0x22eb('0x2d')](handleError(_0xa9eb71,null));}; \ No newline at end of file +var _0xb0df=['union','User','$substring','some','compact','isEmpty','MailAccountId','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','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)','group','i.id','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','i.MailAccountId\x20IS\x20NOT\x20NULL','agent','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.thirdDisposition','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','params','MailInteraction','includeAll','include','merge','options','create','body','describe','MailMessage','addMessage','ids','getMessages','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','omit','spread','emit','mailInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachments','Messages','bcc','subject','createdAt','get','mkdirSync','each','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','readFileSync','build','writeFileSync','unlinkSync','rimraf','zip-dir','moment','bluebird','util','path','lodash','squel','juice','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./mailInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','send','Users','map','fullname','Tags','TagIds','forEach','push','findOne','out','plainBody','-id','lastMsgText','trimStart','catch','waiting','talking','answered','unmanaged','closed','UserId','total','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','a.id\x20=\x20i.MailAccountId','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','unreadMessages','value','having','`\x20=\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb0df,0x85));var _0xfb0d=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0xb0df[_0x196e1b];return _0x5e1f18;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb0d('0x0'));var zipdir=require(_0xfb0d('0x1'));var moment=require(_0xfb0d('0x2'));var BPromise=require(_0xfb0d('0x3'));var util=require(_0xfb0d('0x4'));var path=require(_0xfb0d('0x5'));var fs=require('fs');var _=require(_0xfb0d('0x6'));var squel=require(_0xfb0d('0x7'));var juice=require(_0xfb0d('0x8'));var Redis=require('ioredis');var qs=require(_0xfb0d('0x9'));var as=require(_0xfb0d('0xa'));var logger=require('../../config/logger')('api');var config=require(_0xfb0d('0xb'));var db=require(_0xfb0d('0xc'))['db'];var htmlEntities=require('html-entities');config['redis']=_[_0xfb0d('0xd')](config[_0xfb0d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb0d('0xf'))(new Redis(config[_0xfb0d('0xe')]));require(_0xfb0d('0x10'))[_0xfb0d('0x11')](socket);function respondWithStatusCode(_0xf6ee9b,_0x154c31){_0x154c31=_0x154c31||0xcc;return function(_0x4936a1){if(_0x4936a1){return _0xf6ee9b[_0xfb0d('0x12')](_0x154c31);}return _0xf6ee9b['status'](_0x154c31)[_0xfb0d('0x13')]();};}function respondWithResult(_0x335172,_0x254576){_0x254576=_0x254576||0xc8;return function(_0x2e9f20){if(_0x2e9f20){return _0x335172[_0xfb0d('0x14')](_0x254576)[_0xfb0d('0x15')](_0x2e9f20);}};}function respondWithFilteredResult(_0x303aa3,_0x587b3a){return function(_0x505e22){if(_0x505e22){var _0x5b7e54=typeof _0x587b3a[_0xfb0d('0x16')]===_0xfb0d('0x17')&&typeof _0x587b3a[_0xfb0d('0x18')]===_0xfb0d('0x17');var _0x38c64b=_0x505e22[_0xfb0d('0x19')];var _0xced21c=_0x5b7e54?0x0:_0x587b3a['offset'];var _0x77e8e7=_0x5b7e54?_0x505e22[_0xfb0d('0x19')]:_0x587b3a[_0xfb0d('0x16')]+_0x587b3a[_0xfb0d('0x18')];var _0x58b1cc;if(_0x77e8e7>=_0x38c64b){_0x77e8e7=_0x38c64b;_0x58b1cc=0xc8;}else{_0x58b1cc=0xce;}_0x303aa3[_0xfb0d('0x14')](_0x58b1cc);return _0x303aa3[_0xfb0d('0x1a')](_0xfb0d('0x1b'),_0xced21c+'-'+_0x77e8e7+'/'+_0x38c64b)[_0xfb0d('0x15')](_0x505e22);}return null;};}function saveUpdates(_0x190c64){return function(_0x1d4217){if(_0x1d4217){return _0x1d4217[_0xfb0d('0x1c')](_0x190c64)['then'](function(_0x1b869f){return _0x1b869f;});}return null;};}function removeEntity(_0xa5da11){return function(_0x2baa88){if(_0x2baa88){return _0x2baa88[_0xfb0d('0x1d')]()[_0xfb0d('0x1e')](function(){_0xa5da11[_0xfb0d('0x14')](0xcc)[_0xfb0d('0x13')]();});}};}function handleEntityNotFound(_0x27a5cf){return function(_0x391ec6){if(!_0x391ec6){_0x27a5cf[_0xfb0d('0x12')](0x194);}return _0x391ec6;};}function handleError(_0x3411cb,_0x5ef220){_0x5ef220=_0x5ef220||0x1f4;return function(_0x4f605a){logger[_0xfb0d('0x1f')](_0x4f605a[_0xfb0d('0x20')]);if(_0x4f605a['name']){delete _0x4f605a['name'];}_0x3411cb[_0xfb0d('0x14')](_0x5ef220)[_0xfb0d('0x21')](_0x4f605a);};}function getInteractionUsers(_0x5a1e63,_0x85663a){return new BPromise(function(_0x29be8f,_0x1c234c){try{if(_0x85663a[_0x5a1e63['id']]){_0x5a1e63[_0xfb0d('0x22')]=_[_0xfb0d('0x23')](_0x85663a[_0x5a1e63['id']],function(_0x10c1f9){return{'id':_0x10c1f9['id'],'fullname':_0x10c1f9[_0xfb0d('0x24')]};});}}catch(_0x373373){_0x1c234c(_0x373373);}_0x29be8f(_0x5a1e63);});}function getInteractionTags(_0x2d5f75,_0x31496e){return new BPromise(function(_0x1c6770,_0x803bdd){try{if(_0x2d5f75['TagIds']){_0x2d5f75[_0xfb0d('0x25')]=[];_0x2d5f75[_0xfb0d('0x26')]['split'](',')[_0xfb0d('0x27')](function(_0x2a2838){_0x2d5f75[_0xfb0d('0x25')][_0xfb0d('0x28')](_0x31496e[_0x2a2838]);});}delete _0x2d5f75['TagIds'];}catch(_0x4fb6ba){_0x803bdd(_0x4fb6ba);}_0x1c6770(_0x2d5f75);});}function getLastMessageText(_0x421a23){return new BPromise(function(_0x4c4c8f,_0x21f005){return db['MailMessage'][_0xfb0d('0x29')]({'where':{'$and':[{'MailInteractionId':_0x421a23['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xfb0d('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':[_0xfb0d('0x2b')],'order':_0xfb0d('0x2c'),'raw':!![]})['then'](function(_0x4839e7){if(_0x4839e7&&_0x4839e7[_0xfb0d('0x2b')]){_0x421a23[_0xfb0d('0x2d')]=_[_0xfb0d('0x2e')](_0x4839e7[_0xfb0d('0x2b')]);}_0x4c4c8f(_0x421a23);})['catch'](function(_0x162d86){_0x21f005(_0x162d86);});});}function updateMailInteraction(_0x4e2c40,_0xc54535,_0x5987db,_0x2640a6){return new BPromise(function(_0x45e7e9,_0x470071){return getInteractionUsers(_0x4e2c40,_0x5987db)[_0xfb0d('0x1e')](function(_0x608b28){return getInteractionTags(_0x608b28,_0xc54535);})[_0xfb0d('0x1e')](function(_0x5a1c0d){return getStateInteraction(_0x5a1c0d);})[_0xfb0d('0x1e')](function(_0x3e9206){if(_0x2640a6){_0x45e7e9(getLastMessageText(_0x3e9206));}else{_0x45e7e9(_0x3e9206);}})[_0xfb0d('0x2f')](function(_0x394c85){_0x470071(_0x394c85);});});}function getStateInteraction(_0x404e26){return new BPromise(function(_0x5278aa){_0x404e26[_0xfb0d('0x30')]=0x0;_0x404e26[_0xfb0d('0x31')]=0x0;_0x404e26[_0xfb0d('0x32')]=0x0;_0x404e26[_0xfb0d('0x33')]=0x0;_0x404e26['total']=0x0;if(!_0x404e26['closed']&&!_0x404e26['UserId']){_0x404e26[_0xfb0d('0x30')]+=0x1;}if(!_0x404e26[_0xfb0d('0x34')]&&_0x404e26[_0xfb0d('0x35')]){_0x404e26[_0xfb0d('0x31')]+=0x1;if(_0x404e26[_0xfb0d('0x30')]){_0x404e26[_0xfb0d('0x30')]-=0x1;}}if(_0x404e26[_0xfb0d('0x34')]&&_0x404e26['UserId']){_0x404e26[_0xfb0d('0x32')]+=0x1;if(_0x404e26[_0xfb0d('0x31')]){_0x404e26['talking']-=0x1;}}if(_0x404e26['closed']&&!_0x404e26[_0xfb0d('0x35')]){_0x404e26[_0xfb0d('0x33')]+=0x1;if(_0x404e26[_0xfb0d('0x30')]){_0x404e26[_0xfb0d('0x30')]-=0x1;}}_0x404e26[_0xfb0d('0x36')]+=0x1;_0x5278aa(_0x404e26);});}exports['index']=function(_0x6113e6,_0x211db5){var _0x3e1072={},_0x3020b4={},_0x4e8a83={'count':0x0,'rows':[]};var _0x46dc01=_[_0xfb0d('0x23')](db['MailInteraction'][_0xfb0d('0x37')],function(_0x3415ca){return{'name':_0x3415ca[_0xfb0d('0x38')],'type':_0x3415ca[_0xfb0d('0x39')][_0xfb0d('0x3a')]};});_0x3020b4[_0xfb0d('0x3b')]=_['map'](_0x46dc01,_0xfb0d('0x3c'));_0x3020b4[_0xfb0d('0x3d')]=_[_0xfb0d('0x3e')](_0x6113e6['query']);_0x3020b4[_0xfb0d('0x3f')]=_[_0xfb0d('0x40')](_0x3020b4['model'],_0x3020b4[_0xfb0d('0x3d')]);_0x3e1072['attributes']=_[_0xfb0d('0x40')](_0x3020b4[_0xfb0d('0x3b')],qs['fields'](_0x6113e6['query'][_0xfb0d('0x41')]));_0x3e1072['attributes']=_0x3e1072[_0xfb0d('0x42')][_0xfb0d('0x43')]?_0x3e1072[_0xfb0d('0x42')]:_0x3020b4[_0xfb0d('0x3b')];if(!_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x44')](_0xfb0d('0x45'))){_0x3e1072['limit']=qs[_0xfb0d('0x18')](_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x18')]);_0x3e1072[_0xfb0d('0x16')]=qs[_0xfb0d('0x16')](_0x6113e6['query'][_0xfb0d('0x16')]);}_0x3e1072['order']=qs[_0xfb0d('0x46')](_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x46')]);_0x3e1072[_0xfb0d('0x47')]=qs[_0xfb0d('0x3f')](_[_0xfb0d('0x48')](_0x6113e6[_0xfb0d('0x3d')],_0x3020b4['filters']),_0x46dc01);var _0x356f7c=[];var _0x34fbd0=squel[_0xfb0d('0x49')]()[_0xfb0d('0x4a')]('id')[_0xfb0d('0x4a')](_0xfb0d('0x3c'))['field'](_0xfb0d('0x4b'))[_0xfb0d('0x4c')]('tools_tags');var _0x23d3cf=squel['select']()['field'](_0xfb0d('0x4d'))[_0xfb0d('0x4a')](_0xfb0d('0x4e'))['field'](_0xfb0d('0x4f'))[_0xfb0d('0x4c')](_0xfb0d('0x50'),'ui')[_0xfb0d('0x51')](_0xfb0d('0x52'),'u',_0xfb0d('0x53'));var _0x25ba79=squel[_0xfb0d('0x49')]()[_0xfb0d('0x4c')]('mail_interactions','i')[_0xfb0d('0x51')]('cm_contacts','c',_0xfb0d('0x54'))['left_join'](_0xfb0d('0x52'),'o','o.id\x20=\x20i.UserId')[_0xfb0d('0x51')]('mail_accounts','a',_0xfb0d('0x55'))[_0xfb0d('0x51')]('mail_messages','me',_0xfb0d('0x56'))[_0xfb0d('0x51')](_0xfb0d('0x57'),'it',_0xfb0d('0x58'))[_0xfb0d('0x51')]('tools_tags','t',_0xfb0d('0x59'));var _0x5735bb=squel[_0xfb0d('0x5a')]();var _0x27923b=[];var _0x453f3f=squel['expr']();var _0x32e1f8;if(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x5b')]){_0x32e1f8=as[_0xfb0d('0x5c')](_0x6113e6['query'][_0xfb0d('0x5b')]);var _0x30f6f4=_0x32e1f8[_0xfb0d('0x5d')];for(var _0x38674a=0x0;_0x38674a<_0x32e1f8[_0xfb0d('0x5e')][_0xfb0d('0x43')];_0x38674a++){var _0x3a4433=_0x32e1f8[_0xfb0d('0x5e')][_0x38674a];var _0x4d2b4b='i';var _0x312ada=_[_0xfb0d('0x5f')](_0x46dc01,[_0xfb0d('0x3c'),_0x3a4433['field']]);if(!_0x312ada){switch(_0x3a4433[_0xfb0d('0x4a')]){case _0xfb0d('0x60'):if(_0x3a4433[_0xfb0d('0x61')]==0x1){_0x25ba79[_0xfb0d('0x62')]('`'+_0x3a4433['field']+_0xfb0d('0x63'));}else{_0x25ba79['having']('`'+_0x3a4433[_0xfb0d('0x4a')]+'`\x20>\x200');}break;case _0xfb0d('0x64'):if(_0x3a4433[_0xfb0d('0x65')]==='$substring'){if(_0x3a4433[_0xfb0d('0x61')][_0xfb0d('0x66')]('\x20')[_0xfb0d('0x43')]>0x1){_0x5735bb[_0x30f6f4](_0xfb0d('0x67'),qs[_0xfb0d('0x68')](_0x3a4433[_0xfb0d('0x61')]),null);}else{var _0x43c72f='%'+_0x3a4433['value']+'%';_0x5735bb[_0x30f6f4](_0xfb0d('0x69'),_0x43c72f,_0x43c72f,_0x43c72f);}}else{_0x312ada=_[_0xfb0d('0x5f')](_0x46dc01,['name','ContactId']);_0x3a4433[_0xfb0d('0x4a')]=_0xfb0d('0x6a');_0x4e27e8=as[_0xfb0d('0x6b')](_0x4d2b4b,_0x312ada[_0xfb0d('0x39')],_0x3a4433);_0x5735bb[_0x30f6f4](_0x4e27e8[_0xfb0d('0x6c')],_0x4e27e8['value'][_0xfb0d('0x6d')],_0x4e27e8['value'][_0xfb0d('0x13')]);}break;case _0xfb0d('0x6e'):var _0x2461fb=_0x3a4433['value']['split'](',')[_0xfb0d('0x23')](function(_0x28b103){return Number(_0x28b103);});_0x2461fb[_0xfb0d('0x27')](function(_0x569da9){_0x453f3f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x569da9+',%');});_0x27923b=_[_0xfb0d('0x6f')](_0x27923b,_0x2461fb);break;case _0xfb0d('0x70'):if(_0x3a4433[_0xfb0d('0x65')]===_0xfb0d('0x71')){_0x5735bb[_0x30f6f4]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3a4433[_0xfb0d('0x61')]+'%',null);}else{_0x312ada=_[_0xfb0d('0x5f')](_0x46dc01,['name',_0xfb0d('0x35')]);_0x3a4433['field']=_0xfb0d('0x35');_0x4e27e8=as[_0xfb0d('0x6b')](_0x4d2b4b,_0x312ada[_0xfb0d('0x39')],_0x3a4433);_0x5735bb[_0x30f6f4](_0x4e27e8['text'],_0x4e27e8[_0xfb0d('0x61')][_0xfb0d('0x6d')],_0x4e27e8[_0xfb0d('0x61')]['end']);}break;case'plainBody':_0x4e27e8=as['buildExpression']('me',null,_0x3a4433);_0x5735bb[_0x30f6f4](_0x4e27e8[_0xfb0d('0x6c')],_0x4e27e8[_0xfb0d('0x61')]['start'],_0x4e27e8['value'][_0xfb0d('0x13')]);break;}}else{var _0x4e27e8=as[_0xfb0d('0x6b')](_0x4d2b4b,_0x312ada[_0xfb0d('0x39')],_0x3a4433);_0x5735bb[_0x30f6f4](_0x4e27e8['text'],_0x4e27e8[_0xfb0d('0x61')][_0xfb0d('0x6d')],_0x4e27e8['value'][_0xfb0d('0x13')]);}}}else{var _0x4dea17=_(_0x6113e6[_0xfb0d('0x3d')])[_0xfb0d('0x3e')]()[_0xfb0d('0x23')](function(_0xbc2b73){return _[_0xfb0d('0x72')](_0x46dc01,[_0xfb0d('0x3c'),_0xbc2b73])?_0xbc2b73:undefined;})[_0xfb0d('0x73')]()['value']();if(!_[_0xfb0d('0x74')](_0x4dea17)){_0x4dea17['forEach'](function(_0x1ad8a0){if(_0x1ad8a0===_0xfb0d('0x75')){_0x25ba79[_0xfb0d('0x47')]('i.MailAccountId\x20IN\x20?',[]['concat'](_0x6113e6[_0xfb0d('0x3d')][_0x1ad8a0]));}else if(_0x1ad8a0==='createdAt'){var _0x2c8dcc=JSON[_0xfb0d('0x76')](_0x6113e6[_0xfb0d('0x3d')][_0x1ad8a0])[_0xfb0d('0x77')];var _0x500bbb=JSON[_0xfb0d('0x76')](_0x6113e6['query'][_0x1ad8a0])['$lte'];_0x25ba79[_0xfb0d('0x47')](_0xfb0d('0x78'),_0x2c8dcc,_0x500bbb);}else{if(_0x6113e6[_0xfb0d('0x3d')][_0x1ad8a0]==='null'){_0x25ba79[_0xfb0d('0x47')]('i.'+_0x1ad8a0+_0xfb0d('0x79'));}else{_0x25ba79[_0xfb0d('0x47')]('i.'+_0x1ad8a0+'\x20=\x20?',_0x6113e6['query'][_0x1ad8a0]);}}});}if(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x7a')]){if(_0x6113e6['query'][_0xfb0d('0x7a')]==0x1){_0x25ba79[_0xfb0d('0x62')](_0xfb0d('0x7b'));}else{_0x25ba79[_0xfb0d('0x62')](_0xfb0d('0x7c'));}}if(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x7d')]){_0x27923b=_[_0xfb0d('0x7e')](_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x7d')])?_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x7d')]:new Array(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x7d')]);_0x27923b[_0xfb0d('0x27')](function(_0x47cc17){_0x453f3f['or'](_0xfb0d('0x7f'),'%,'+_0x47cc17+',%');});}if(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x80')]){var _0x139aef=_0x6113e6[_0xfb0d('0x3d')]['filter'][_0xfb0d('0x81')]('\x5c','\x5c\x5c')[_0xfb0d('0x81')](/'/g,'\x27\x27');if(qs[_0xfb0d('0x82')](_0x139aef)){_0x5735bb['or'](_0xfb0d('0x83'),_0x139aef+'%');}else if(qs[_0xfb0d('0x84')](_0x139aef)){_0x5735bb['or'](_0xfb0d('0x85'),_0x139aef+'%');}else{_0x5735bb['or'](_0xfb0d('0x86'),qs[_0xfb0d('0x68')](_0x139aef))['or'](_0xfb0d('0x87'),qs[_0xfb0d('0x68')](_0x139aef));}}}_0x25ba79[_0xfb0d('0x47')](_0x5735bb);_0x25ba79[_0xfb0d('0x88')](_0xfb0d('0x89'));var _0x4050a7={'type':db['Sequelize'][_0xfb0d('0x8a')][_0xfb0d('0x8b')],'raw':!![]};var _0x30cf71=_0x25ba79[_0xfb0d('0x8c')]();_0x30cf71[_0xfb0d('0x4a')](_0xfb0d('0x89'));_0x30cf71['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3e1072['order']){_0x3e1072[_0xfb0d('0x8d')]['forEach'](function(_0x26aebb){var _0xfd5b23=_0x26aebb[0x0]==='contactName'?_0x26aebb[0x0]:'i.'+_0x26aebb[0x0];_0x25ba79[_0xfb0d('0x8d')](_0xfd5b23,_0x26aebb[0x1]===_0xfb0d('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x27923b)){_0x25ba79[_0xfb0d('0x62')](_0x453f3f);_0x30cf71[_0xfb0d('0x47')](_0xfb0d('0x8f'),_0x27923b);}BPromise[_0xfb0d('0x90')]()['then'](function(){if(!_0x32e1f8){if(_0x6113e6[_0xfb0d('0x3d')]['MailAccountId'])return;_0x30cf71[_0xfb0d('0x47')](_0xfb0d('0x91'));_0x25ba79[_0xfb0d('0x47')](_0xfb0d('0x91'));return;}if(_0x6113e6['user']['role']!==_0xfb0d('0x92'))return;return _0x6113e6[_0xfb0d('0x93')][_0xfb0d('0x94')]({'attributes':['id'],'raw':!![]})[_0xfb0d('0x1e')](function(_0x4ce28c){if(_['isEmpty'](_0x4ce28c)){_0x30cf71[_0xfb0d('0x47')](_0xfb0d('0x95'));_0x25ba79[_0xfb0d('0x47')](_0xfb0d('0x95'));}else{_0x30cf71['where'](_0xfb0d('0x96'),_['map'](_0x4ce28c,'id'));_0x25ba79[_0xfb0d('0x47')](_0xfb0d('0x96'),_['map'](_0x4ce28c,'id'));}});})[_0xfb0d('0x1e')](function(){if(_0x6113e6['user']['role']===_0xfb0d('0x92')&&!_0x32e1f8&&!_0x6113e6['query']['MailAccountId'])return[];return db[_0xfb0d('0x97')]['query'](_0x30cf71[_0xfb0d('0x98')](),_0x4050a7);})['then'](function(_0x5a2d50){_0x4e8a83[_0xfb0d('0x19')]=_0x5a2d50[_0xfb0d('0x43')];if(_0x4e8a83[_0xfb0d('0x19')]===0x0)return[];return db[_0xfb0d('0x97')][_0xfb0d('0x3d')](_0x34fbd0[_0xfb0d('0x98')](),_0x4050a7)['then'](function(_0x297dd5){_0x356f7c=_['keyBy'](_0x297dd5,'id');_0x4050a7=_['merge'](_0x4050a7,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x6113e6[_0xfb0d('0x3d')][_0xfb0d('0x41')]){_0x3e1072[_0xfb0d('0x42')]['forEach'](function(_0x5650ea){_0x25ba79[_0xfb0d('0x4a')]('i.'+_0x5650ea);});}else{_0x25ba79['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfb0d('0x60'));_0x25ba79['field'](_0xfb0d('0x99'),_0xfb0d('0x9a'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0x9b'),_0xfb0d('0x9c'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0x9d'),_0xfb0d('0x9e'));_0x25ba79['field'](_0xfb0d('0x89'));_0x25ba79['field'](_0xfb0d('0x9f'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa0'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa1'));_0x25ba79[_0xfb0d('0x4a')]('i.closedAt');_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa2'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa3'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa4'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa5'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa6'));_0x25ba79[_0xfb0d('0x4a')]('i.secondDisposition');_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa7'));_0x25ba79[_0xfb0d('0x4a')]('i.substatus');_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa8'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xa9'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xaa'));_0x25ba79['field'](_0xfb0d('0xab'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xac'),_0xfb0d('0xad'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xae'),_0xfb0d('0xaf'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xb0'),_0xfb0d('0xb1'));_0x25ba79['field'](_0xfb0d('0xb2'),_0xfb0d('0xb3'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xb4'),'Contact.mobile');_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xb5'),'Contact.fax');_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xb6'),_0xfb0d('0xb7'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xb8'),_0xfb0d('0xb9'));_0x25ba79[_0xfb0d('0x4a')](_0xfb0d('0xba'),_0xfb0d('0x26'));}if(_0x3e1072[_0xfb0d('0x18')])_0x25ba79[_0xfb0d('0x18')](_0x3e1072[_0xfb0d('0x18')]);if(_0x3e1072[_0xfb0d('0x16')])_0x25ba79['offset'](_0x3e1072['offset']);return db[_0xfb0d('0x97')]['query'](_0x25ba79[_0xfb0d('0x98')](),_0x4050a7);})[_0xfb0d('0x1e')](function(_0xed5a8a){if(_0xed5a8a[_0xfb0d('0x43')]>0x0)_0x23d3cf[_0xfb0d('0x47')](_0xfb0d('0xbb'),_['map'](_0xed5a8a,'id'));return db['sequelize'][_0xfb0d('0x3d')](_0x23d3cf[_0xfb0d('0x98')](),_0x4050a7)[_0xfb0d('0x1e')](function(_0x177950){var _0x5e80c0=_[_0xfb0d('0xbc')](_0x177950,_0xfb0d('0xbd'));var _0x1b5223=[];return db[_0xfb0d('0xbe')][_0xfb0d('0x29')]({'attributes':[_0xfb0d('0xbf')],'raw':!![]})[_0xfb0d('0x1e')](function(_0x5b59f4){var _0x2c1c55=_0x5b59f4[_0xfb0d('0xbf')];_0xed5a8a[_0xfb0d('0x27')](function(_0x555736){_0x1b5223[_0xfb0d('0x28')](updateMailInteraction(_0x555736,_0x356f7c,_0x5e80c0,_0x2c1c55));});return BPromise[_0xfb0d('0xc0')](_0x1b5223);});});});})[_0xfb0d('0x1e')](function(_0x529468){_0x4e8a83[_0xfb0d('0xc1')]=_0x529468;return _0x4e8a83;})[_0xfb0d('0x1e')](respondWithFilteredResult(_0x211db5,_0x3e1072))[_0xfb0d('0x2f')](handleError(_0x211db5,null));};exports[_0xfb0d('0xc2')]=function(_0x3b4289,_0x10d640){var _0x5f13bc={'raw':![],'where':{'id':_0x3b4289[_0xfb0d('0xc3')]['id']}},_0xea7404={};_0xea7404[_0xfb0d('0x3b')]=_['keys'](db[_0xfb0d('0xc4')][_0xfb0d('0x37')]);_0xea7404[_0xfb0d('0x3d')]=_[_0xfb0d('0x3e')](_0x3b4289[_0xfb0d('0x3d')]);_0xea7404['filters']=_[_0xfb0d('0x40')](_0xea7404[_0xfb0d('0x3b')],_0xea7404[_0xfb0d('0x3d')]);_0x5f13bc[_0xfb0d('0x42')]=_[_0xfb0d('0x40')](_0xea7404[_0xfb0d('0x3b')],qs[_0xfb0d('0x41')](_0x3b4289[_0xfb0d('0x3d')]['fields']));_0x5f13bc[_0xfb0d('0x42')]=_0x5f13bc['attributes'][_0xfb0d('0x43')]?_0x5f13bc[_0xfb0d('0x42')]:_0xea7404[_0xfb0d('0x3b')];if(_0x3b4289[_0xfb0d('0x3d')][_0xfb0d('0xc5')]){_0x5f13bc[_0xfb0d('0xc6')]=[{'all':!![]}];}_0x5f13bc=_[_0xfb0d('0xc7')]({},_0x5f13bc,_0x3b4289[_0xfb0d('0xc8')]);return db[_0xfb0d('0xc4')][_0xfb0d('0x5f')](_0x5f13bc)[_0xfb0d('0x1e')](handleEntityNotFound(_0x10d640,null))[_0xfb0d('0x1e')](respondWithResult(_0x10d640,null))[_0xfb0d('0x2f')](handleError(_0x10d640,null));};exports[_0xfb0d('0xc9')]=function(_0x31c5a5,_0x37c2c3){return db[_0xfb0d('0xc4')]['create'](_0x31c5a5[_0xfb0d('0xca')],{})[_0xfb0d('0x1e')](respondWithResult(_0x37c2c3,0xc9))[_0xfb0d('0x2f')](handleError(_0x37c2c3,null));};exports[_0xfb0d('0x1c')]=function(_0x175fd7,_0x1010b4){if(_0x175fd7[_0xfb0d('0xca')]['id']){delete _0x175fd7['body']['id'];}return db[_0xfb0d('0xc4')][_0xfb0d('0x5f')]({'where':{'id':_0x175fd7[_0xfb0d('0xc3')]['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x1010b4,null))[_0xfb0d('0x1e')](saveUpdates(_0x175fd7['body'],null))['then'](respondWithResult(_0x1010b4,null))[_0xfb0d('0x2f')](handleError(_0x1010b4,null));};exports[_0xfb0d('0x1d')]=function(_0x416e2d,_0x1dd2c6){return db[_0xfb0d('0xc4')][_0xfb0d('0x5f')]({'where':{'id':_0x416e2d[_0xfb0d('0xc3')]['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x1dd2c6,null))[_0xfb0d('0x1e')](removeEntity(_0x1dd2c6,null))[_0xfb0d('0x2f')](handleError(_0x1dd2c6,null));};exports[_0xfb0d('0xcb')]=function(_0x2aea7d,_0x42cff1){return db[_0xfb0d('0xc4')][_0xfb0d('0xcb')]()[_0xfb0d('0x1e')](respondWithResult(_0x42cff1,null))[_0xfb0d('0x2f')](handleError(_0x42cff1,null));};exports['addMessage']=function(_0x1eeacc,_0x4bf73e){return db[_0xfb0d('0xcc')][_0xfb0d('0x5f')]({'where':{'id':_0x1eeacc['params']['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x4bf73e,null))[_0xfb0d('0x1e')](function(_0x6f7f7){if(_0x6f7f7){return _0x6f7f7[_0xfb0d('0xcd')](_0x1eeacc[_0xfb0d('0xca')]['ids'],_['omit'](_0x1eeacc[_0xfb0d('0xca')],[_0xfb0d('0xce'),'id'])||{});}})['then'](respondWithResult(_0x4bf73e,null))['catch'](handleError(_0x4bf73e,null));};exports[_0xfb0d('0xcf')]=function(_0x20ec1c,_0x14ab5a){var _0x50c636={'raw':![],'where':{}};var _0x30bc4b={};var _0x337024={'count':0x0,'rows':[]};return db[_0xfb0d('0xc4')][_0xfb0d('0x29')]({'where':{'id':_0x20ec1c['params']['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x14ab5a,null))[_0xfb0d('0x1e')](function(_0x23b84f){if(_0x23b84f){_0x30bc4b['model']=_[_0xfb0d('0x3e')](db[_0xfb0d('0xcc')][_0xfb0d('0x37')]);_0x30bc4b[_0xfb0d('0x3d')]=_['keys'](_0x20ec1c[_0xfb0d('0x3d')]);_0x30bc4b[_0xfb0d('0x3f')]=_['intersection'](_0x30bc4b[_0xfb0d('0x3b')],_0x30bc4b[_0xfb0d('0x3d')]);_0x50c636[_0xfb0d('0x42')]=_[_0xfb0d('0x40')](_0x30bc4b['model'],qs['fields'](_0x20ec1c['query'][_0xfb0d('0x41')]));_0x50c636[_0xfb0d('0x42')]=_0x50c636['attributes'][_0xfb0d('0x43')]?_0x50c636[_0xfb0d('0x42')]:_0x30bc4b['model'];if(!_0x20ec1c[_0xfb0d('0x3d')][_0xfb0d('0x44')]('nolimit')){_0x50c636[_0xfb0d('0x18')]=qs['limit'](_0x20ec1c[_0xfb0d('0x3d')][_0xfb0d('0x18')]);_0x50c636[_0xfb0d('0x16')]=qs[_0xfb0d('0x16')](_0x20ec1c['query']['offset']);}_0x50c636[_0xfb0d('0x8d')]=qs[_0xfb0d('0x46')](_0x20ec1c['query'][_0xfb0d('0x46')]);_0x50c636[_0xfb0d('0x47')]=qs[_0xfb0d('0x3f')](_['pick'](_0x20ec1c[_0xfb0d('0x3d')],_0x30bc4b['filters']));_0x50c636[_0xfb0d('0x47')][_0xfb0d('0xbd')]=_0x23b84f['id'];if(_0x20ec1c['query'][_0xfb0d('0x80')]){_0x50c636['where']=_[_0xfb0d('0xc7')](_0x50c636[_0xfb0d('0x47')],{'$or':_[_0xfb0d('0x23')](_0x50c636['attributes'],function(_0x116d55){var _0x3fba44={};_0x3fba44[_0x116d55]={'$like':'%'+_0x20ec1c[_0xfb0d('0x3d')]['filter']+'%'};return _0x3fba44;})});}if(_0x20ec1c[_0xfb0d('0x3d')][_0xfb0d('0x77')]){var _0x4f1f7d=_0x20ec1c[_0xfb0d('0x3d')][_0xfb0d('0x77')]['split'](',');var _0x67a5ec={};_0x67a5ec[_0x4f1f7d[0x0]]={'$gte':moment(_0x4f1f7d[0x1])['format'](_0xfb0d('0xd0'))};_0x50c636['where']=_[_0xfb0d('0xc7')](_0x50c636[_0xfb0d('0x47')],_0x67a5ec);}_0x50c636=_[_0xfb0d('0xc7')]({},_0x50c636,_0x20ec1c[_0xfb0d('0xc8')]);return db[_0xfb0d('0xcc')][_0xfb0d('0x19')]({'where':_0x50c636[_0xfb0d('0x47')]})[_0xfb0d('0x1e')](function(_0x5955b2){_0x337024[_0xfb0d('0x19')]=_0x5955b2;if(_0x20ec1c['query']['includeAll']){_0x50c636[_0xfb0d('0xc6')]=[{'all':!![]}];}return db[_0xfb0d('0xcc')][_0xfb0d('0xd1')](_0x50c636);})[_0xfb0d('0x1e')](function(_0x15f75b){if(_0x20ec1c['query'][_0xfb0d('0xd2')]===_0xfb0d('0xd3')){for(var _0x82c15d=0x0;_0x82c15d<_0x15f75b[_0xfb0d('0x43')];_0x82c15d++){_0x15f75b[_0x82c15d][_0xfb0d('0xca')]=juice(_0x15f75b[_0x82c15d][_0xfb0d('0xca')]);}}_0x337024[_0xfb0d('0xc1')]=_0x15f75b;return _0x337024;});}})[_0xfb0d('0x1e')](respondWithFilteredResult(_0x14ab5a,_0x50c636))[_0xfb0d('0x2f')](handleError(_0x14ab5a,null));};exports[_0xfb0d('0xd4')]=function(_0x29a253,_0x2bb6d9){return db['MailInteraction'][_0xfb0d('0x5f')]({'where':{'id':_0x29a253[_0xfb0d('0xc3')]['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x2bb6d9,null))['then'](function(_0xdd40e5){if(_0xdd40e5){return _0xdd40e5[_0xfb0d('0xd5')](_0x29a253[_0xfb0d('0xca')][_0xfb0d('0xce')],_[_0xfb0d('0xd6')](_0x29a253[_0xfb0d('0xca')],[_0xfb0d('0xce'),'id'])||{})[_0xfb0d('0xd7')](function(){return db[_0xfb0d('0x6e')][_0xfb0d('0xd1')]({'attributes':['id',_0xfb0d('0x3c'),'color'],'where':{'id':_0x29a253[_0xfb0d('0xca')][_0xfb0d('0xce')]}});})[_0xfb0d('0x1e')](function(_0x2932be){socket[_0xfb0d('0xd8')](_0xfb0d('0xd9'),{'id':Number(_0x29a253[_0xfb0d('0xc3')]['id']),'tags':_0x2932be||[]});return{'id':Number(_0x29a253[_0xfb0d('0xc3')]['id']),'tags':_0x2932be||[]};});}})[_0xfb0d('0x1e')](respondWithResult(_0x2bb6d9,null))[_0xfb0d('0x2f')](handleError(_0x2bb6d9,null));};exports[_0xfb0d('0xda')]=function(_0x3d4fe4,_0x2f2f3b){return db[_0xfb0d('0xc4')]['find']({'where':{'id':_0x3d4fe4['params']['id']}})[_0xfb0d('0x1e')](handleEntityNotFound(_0x2f2f3b,null))[_0xfb0d('0x1e')](function(_0x179e00){if(_0x179e00){return _0x179e00[_0xfb0d('0xda')](_0x3d4fe4[_0xfb0d('0x3d')][_0xfb0d('0xce')]);}})[_0xfb0d('0x1e')](respondWithStatusCode(_0x2f2f3b,null))['catch'](handleError(_0x2f2f3b,null));};exports['download']=function(_0xe5d916,_0x39eb3e){var _0x3762e1=moment()[_0xfb0d('0xdb')]()['toString']();var _0x542693=path[_0xfb0d('0xdc')](config[_0xfb0d('0xdd')],_0xfb0d('0xde'),'files','tmp');var _0x2b36d8=path[_0xfb0d('0xdc')](config[_0xfb0d('0xdd')],_0xfb0d('0xde'),_0xfb0d('0xdf'),_0xfb0d('0xe0'));var _0x173a70=path[_0xfb0d('0xdc')](_0x542693,_0x3762e1);var _0x46629f=util['format'](_0xfb0d('0xe1'),_0xe5d916[_0xfb0d('0xc3')]['id'],_0x3762e1);var _0xdb10aa=path[_0xfb0d('0xdc')](_0x542693,_0x46629f);var _0x1c5ebc=[];if(_0xe5d916[_0xfb0d('0x3d')]['attachments']){_0x1c5ebc[_0xfb0d('0x28')]({'model':db['Attachment'],'as':_0xfb0d('0xe2'),'raw':!![]});}var _0x45668e=[{'model':db[_0xfb0d('0xcc')],'as':_0xfb0d('0xe3'),'attributes':['id',_0xfb0d('0xca'),'from','to','cc',_0xfb0d('0xe4'),_0xfb0d('0xe5'),_0xfb0d('0xe6')],'where':{'secret':![]},'order':qs[_0xfb0d('0x46')]('id'),'include':_0x1c5ebc}];return db[_0xfb0d('0xc4')]['find']({'where':{'id':_0xe5d916[_0xfb0d('0xc3')]['id']},'include':_0x45668e})[_0xfb0d('0x1e')](handleEntityNotFound(_0x39eb3e,null))[_0xfb0d('0x1e')](function(_0x255d15){if(_0x255d15&&_0x255d15[_0xfb0d('0xe3')]){var _0xa9d2a=_0x255d15[_0xfb0d('0xe7')]({'plain':!![]});fs[_0xfb0d('0xe8')](_0x173a70);return BPromise[_0xfb0d('0xe9')](_0xa9d2a[_0xfb0d('0xe3')],function(_0x523241,_0x1aae66){var _0x336e87={'from':_0x523241[_0xfb0d('0x4c')],'to':_0x523241['to'],'subject':_0x523241[_0xfb0d('0xe5')],'html':htmlEntities[_0xfb0d('0xea')](_0x523241['body']),'headers':{'Date':moment(_0x523241[_0xfb0d('0xe6')])['format'](_0xfb0d('0xeb'))},'attachments':[]};if(_0x523241['cc']){_0x336e87['headers']['Cc']=_0x523241['cc'];}if(_0x523241['bcc']){_0x336e87[_0xfb0d('0xec')][_0xfb0d('0xed')]=_0x523241[_0xfb0d('0xe4')];}return new BPromise(function(_0x2be77b,_0x251f2d){if(_0x523241[_0xfb0d('0xe2')]){for(var _0x3090d5=0x0;_0x3090d5<_0x523241[_0xfb0d('0xe2')][_0xfb0d('0x43')];_0x3090d5++){var _0x5c08f3=_0x523241[_0xfb0d('0xe2')][_0x3090d5];var _0x520a9e=path['join'](_0x2b36d8,_0x5c08f3[_0xfb0d('0xee')]);if(fs[_0xfb0d('0xef')](_0x520a9e)){_0x336e87[_0xfb0d('0xe0')][_0xfb0d('0x28')]({'name':_0x5c08f3[_0xfb0d('0x3c')],'contentType':_0x5c08f3['type'],'data':fs[_0xfb0d('0xf0')](_0x520a9e)});}}}emlformat[_0xfb0d('0xf1')](_0x336e87,function(_0x23d10a,_0x38feb5){if(_0x23d10a)return _0x251f2d(_0x23d10a);fs[_0xfb0d('0xf2')](path[_0xfb0d('0xdc')](_0x173a70,util['format']('message%d.eml',_0x1aae66)),_0x38feb5);return _0x2be77b(_0x38feb5);});});})['then'](function(){return new BPromise(function(_0x57835b,_0x15c2b5){zipdir(_0x173a70,{'saveTo':_0xdb10aa},function(_0x2844ba,_0x26453e){if(_0x2844ba)return _0x15c2b5(_0x2844ba);return _0x57835b(_0x26453e);});})[_0xfb0d('0x1e')](function(){return new BPromise(function(_0x410666,_0x323c12){rimraf(_0x173a70,function(_0x52fdba){if(_0x52fdba)_0x323c12(_0x52fdba);return _0x410666();});});})[_0xfb0d('0x1e')](function(){return _0x39eb3e['download'](_0xdb10aa,_0x46629f,function(_0x2f70b0){if(!_0x2f70b0)fs[_0xfb0d('0xf3')](_0xdb10aa);});});});}else{return _0x39eb3e['sendStatus'](0xc8);}})[_0xfb0d('0x2f')](handleError(_0x39eb3e,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index 472523d..095629e 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 _0x30b4=['unreadMessages','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','update','remove','getUsers','then','map','findAll','setDataValue'];(function(_0x5140b0,_0x3cab28){var _0x2f2342=function(_0x5e51ce){while(--_0x5e51ce){_0x5140b0['push'](_0x5140b0['shift']());}};_0x2f2342(++_0x3cab28);}(_0x30b4,0x104));var _0x430b=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x30b4[_0x245afe];return _0x4eefde;};'use strict';var EventEmitter=require(_0x430b('0x0'));var MailInteraction=require(_0x430b('0x1'))['db'][_0x430b('0x2')];var MailMessage=require(_0x430b('0x1'))['db'][_0x430b('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x430b('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x430b('0x5'),'afterDestroy':_0x430b('0x6')};function emitEvent(_0x3d500e){return function(_0x481771,_0x414da2,_0x3c15e5){_0x481771[_0x430b('0x7')]({'attributes':['id'],'raw':!![]})[_0x430b('0x8')](function(_0x465596){_0x481771['setDataValue']('Users',_0x465596[_0x430b('0x9')](function(_0x30e910){return{'id':_0x30e910['id']};}));return MailMessage[_0x430b('0xa')]({'where':{'MailInteractionId':_0x481771['id'],'direction':'in','read':![]},'raw':!![]});})[_0x430b('0x8')](function(_0x43d1e2){_0x481771[_0x430b('0xb')](_0x430b('0xc'),_0x43d1e2['length']);MailInteractionEvents[_0x430b('0xd')](_0x3d500e+':'+_0x481771['id'],_0x481771);MailInteractionEvents[_0x430b('0xd')](_0x3d500e,_0x481771);_0x3c15e5(null);})['catch'](_0x3c15e5(null));};}for(var e in events){if(events[_0x430b('0xe')](e)){var event=events[e];MailInteraction[_0x430b('0xf')](e,emitEvent(event));}}module[_0x430b('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0xa9f2=['hook','exports','events','MailInteraction','setMaxListeners','update','getUsers','then','setDataValue','Users','map','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x158be7,_0x173bde){var _0x267860=function(_0x50d53d){while(--_0x50d53d){_0x158be7['push'](_0x158be7['shift']());}};_0x267860(++_0x173bde);}(_0xa9f2,0x1b2));var _0x2a9f=function(_0x3e4715,_0x204383){_0x3e4715=_0x3e4715-0x0;var _0x44969a=_0xa9f2[_0x3e4715];return _0x44969a;};'use strict';var EventEmitter=require(_0x2a9f('0x0'));var MailInteraction=require('../../mysqldb')['db'][_0x2a9f('0x1')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x2a9f('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x2a9f('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248045){return function(_0x2a89b8,_0x4d2070,_0x3d0dfe){_0x2a89b8[_0x2a9f('0x4')]({'attributes':['id'],'raw':!![]})[_0x2a9f('0x5')](function(_0x4f90c4){_0x2a89b8[_0x2a9f('0x6')](_0x2a9f('0x7'),_0x4f90c4[_0x2a9f('0x8')](function(_0x48e903){return{'id':_0x48e903['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x2a89b8['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a9f('0x5')](function(_0x160e67){_0x2a89b8[_0x2a9f('0x6')](_0x2a9f('0x9'),_0x160e67[_0x2a9f('0xa')]);MailInteractionEvents['emit'](_0x248045+':'+_0x2a89b8['id'],_0x2a89b8);MailInteractionEvents[_0x2a9f('0xb')](_0x248045,_0x2a89b8);_0x3d0dfe(null);})[_0x2a9f('0xc')](_0x3d0dfe(null));};}for(var e in events){if(events[_0x2a9f('0xd')](e)){var event=events[e];MailInteraction[_0x2a9f('0xe')](e,emitEvent(event));}}module[_0x2a9f('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 a0077ad..7134aee 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 _0x4d82=['../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','closed','models','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x32249b,_0x902566){var _0x43fec8=function(_0xac80cf){while(--_0xac80cf){_0x32249b['push'](_0x32249b['shift']());}};_0x43fec8(++_0x902566);}(_0x4d82,0x1f0));var _0x24d8=function(_0x4d093a,_0x15d59c){_0x4d093a=_0x4d093a-0x0;var _0x5d7227=_0x4d82[_0x4d093a];return _0x5d7227;};'use strict';var _=require(_0x24d8('0x0'));var util=require('util');var logger=require(_0x24d8('0x1'))(_0x24d8('0x2'));var moment=require(_0x24d8('0x3'));var BPromise=require(_0x24d8('0x4'));var rp=require(_0x24d8('0x5'));var fs=require('fs');var path=require(_0x24d8('0x6'));var rimraf=require(_0x24d8('0x7'));var config=require(_0x24d8('0x8'));var attributes=require(_0x24d8('0x9'));module[_0x24d8('0xa')]=function(_0x4ebfe3,_0x358f68){return _0x4ebfe3[_0x24d8('0xb')]('MailInteraction',attributes,{'tableName':_0x24d8('0xc'),'paranoid':![],'indexes':[{'name':_0x24d8('0xd'),'fields':[_0x24d8('0xe'),'to'],'type':_0x24d8('0xf')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x59b470,_0x55ef56,_0x5e184d){if(_0x59b470[_0x24d8('0x10')]){_0x59b470[_0x24d8('0x11')]=moment()[_0x24d8('0x12')](_0x24d8('0x13'));}if(_0x59b470['closed']){_0x59b470[_0x24d8('0x14')]=moment()[_0x24d8('0x12')](_0x24d8('0x13'));}_0x5e184d(null,_0x55ef56);},'beforeUpdate':function(_0xc379b4,_0x4fbc59,_0x3bc34b){if(_0xc379b4['changed'](_0x24d8('0x10'))){_0xc379b4['substatusAt']=_0xc379b4[_0x24d8('0x10')]?moment()[_0x24d8('0x12')](_0x24d8('0x13')):null;}if(_0xc379b4['changed'](_0x24d8('0x15'))){_0xc379b4['closedAt']=moment()[_0x24d8('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xc379b4[_0x24d8('0x10')]=null;_0xc379b4[_0x24d8('0x11')]=null;}_0x3bc34b(null,_0xc379b4);},'afterUpdate':function(_0x3fba50,_0x5d017a,_0xf4a474){var _0x9265b5=_0x4ebfe3[_0x24d8('0x16')];var _0x4d25b7=_0x3fba50['get']({'plain':!![]});if(_0x4d25b7['closed']){return _0x9265b5[_0x24d8('0x17')][_0x24d8('0x18')]({'read':!![]},{'where':{'MailInteractionId':_0x4d25b7['id']}})['then'](function(){_0xf4a474();})[_0x24d8('0x19')](function(_0x4dd0cc){_0xf4a474(_0x4dd0cc);});}else{_0xf4a474();}}},'charset':_0x24d8('0x1a'),'collate':_0x24d8('0x1b')});}; \ No newline at end of file +var _0xe784=['format','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','changed','models','get','then','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','substatusAt'];(function(_0x9d665e,_0x19b537){var _0x1a09a5=function(_0x24a0f0){while(--_0x24a0f0){_0x9d665e['push'](_0x9d665e['shift']());}};_0x1a09a5(++_0x19b537);}(_0xe784,0x1d5));var _0x4e78=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xe784[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0x4e78('0x0'));var logger=require(_0x4e78('0x1'))('api');var moment=require(_0x4e78('0x2'));var BPromise=require(_0x4e78('0x3'));var rp=require(_0x4e78('0x4'));var fs=require('fs');var path=require(_0x4e78('0x5'));var rimraf=require(_0x4e78('0x6'));var config=require(_0x4e78('0x7'));var attributes=require(_0x4e78('0x8'));module[_0x4e78('0x9')]=function(_0x66563f,_0x5c78e8){return _0x66563f[_0x4e78('0xa')](_0x4e78('0xb'),attributes,{'tableName':_0x4e78('0xc'),'paranoid':![],'indexes':[{'name':_0x4e78('0xd'),'fields':[_0x4e78('0xe'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x194b32,_0x51b8e3,_0x200255){if(_0x194b32[_0x4e78('0xf')]){_0x194b32[_0x4e78('0x10')]=moment()[_0x4e78('0x11')](_0x4e78('0x12'));}if(_0x194b32[_0x4e78('0x13')]){_0x194b32[_0x4e78('0x14')]=moment()[_0x4e78('0x11')]('YYYY-MM-DD\x20HH:mm:ss');}_0x200255(null,_0x51b8e3);},'beforeUpdate':function(_0x57571a,_0x5f1399,_0x2c27e0){if(_0x57571a[_0x4e78('0x15')](_0x4e78('0xf'))){_0x57571a['substatusAt']=_0x57571a[_0x4e78('0xf')]?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x57571a[_0x4e78('0x15')](_0x4e78('0x13'))){_0x57571a[_0x4e78('0x14')]=moment()[_0x4e78('0x11')](_0x4e78('0x12'));_0x57571a[_0x4e78('0xf')]=null;_0x57571a[_0x4e78('0x10')]=null;}_0x2c27e0(null,_0x57571a);},'afterUpdate':function(_0x223096,_0x20a793,_0x3c7891){var _0x53cfbe=_0x66563f[_0x4e78('0x16')];var _0x11c3a0=_0x223096[_0x4e78('0x17')]({'plain':!![]});if(_0x11c3a0[_0x4e78('0x13')]){return _0x53cfbe['MailMessage']['update']({'read':!![]},{'where':{'MailInteractionId':_0x11c3a0['id']}})[_0x4e78('0x18')](function(){_0x3c7891();})['catch'](function(_0x1e60eb){_0x3c7891(_0x1e60eb);});}else{_0x3c7891();}}},'charset':_0x4e78('0x19'),'collate':_0x4e78('0x1a')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 9428401..b5a1762 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 _0xacc6=['../../config/environment','client','http','defaults','localhost','socket.io-emitter','redis','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','update','body','options','raw','where','limit','UpdateMailInteraction','stringify','AddTagsToMailInteraction','MailInteraction','find','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x27f479,_0x27d8a2){var _0x3fc044=function(_0x5c1297){while(--_0x5c1297){_0x27f479['push'](_0x27f479['shift']());}};_0x3fc044(++_0x27d8a2);}(_0xacc6,0x150));var _0x6acc=function(_0x622035,_0x1a4b91){_0x622035=_0x622035-0x0;var _0x326cf2=_0xacc6[_0x622035];return _0x326cf2;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});config['redis']=_[_0x6acc('0xb')](config['redis'],{'host':_0x6acc('0xc'),'port':0x18eb});var socket=require(_0x6acc('0xd'))(new Redis(config[_0x6acc('0xe')]));require(_0x6acc('0xf'))['register'](socket);function respondWithRpcPromise(_0x1343cb,_0x4cf4c7,_0x3c1a24){return new BPromise(function(_0x21b624,_0xb8647d){return client[_0x6acc('0x10')](_0x1343cb,_0x3c1a24)[_0x6acc('0x11')](function(_0x15b64b){logger['info'](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));logger[_0x6acc('0x14')](_0x6acc('0x15'),_0x4cf4c7,_0x6acc('0x13'),JSON['stringify'](_0x15b64b));if(_0x15b64b['error']){if(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x17')]===0x1f4){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0xb8647d(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);return _0x21b624(_0x15b64b[_0x6acc('0x16')][_0x6acc('0x18')]);}else{logger[_0x6acc('0x19')](_0x6acc('0x12'),_0x4cf4c7,_0x6acc('0x13'));_0x21b624(_0x15b64b[_0x6acc('0x1a')]['message']);}})[_0x6acc('0x1b')](function(_0x43b8ca){logger[_0x6acc('0x16')](_0x6acc('0x12'),_0x4cf4c7,_0x43b8ca);_0xb8647d(_0x43b8ca);});});}exports['UpdateMailInteraction']=function(_0x342043){var _0x531f7c=this;return new Promise(function(_0x51dea7,_0x4af9e){return db['MailInteraction'][_0x6acc('0x1c')](_0x342043[_0x6acc('0x1d')],{'raw':_0x342043[_0x6acc('0x1e')]?_0x342043[_0x6acc('0x1e')][_0x6acc('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x342043['options']?_0x342043[_0x6acc('0x1e')][_0x6acc('0x20')]||null:null,'attributes':_0x342043['options']?_0x342043[_0x6acc('0x1e')]['attributes']||null:null,'limit':_0x342043[_0x6acc('0x1e')]?_0x342043[_0x6acc('0x1e')][_0x6acc('0x21')]||null:null})[_0x6acc('0x11')](function(_0x5277b6){logger[_0x6acc('0x19')](_0x6acc('0x22'),_0x342043);logger['debug'](_0x6acc('0x22'),_0x342043,JSON[_0x6acc('0x23')](_0x5277b6));_0x51dea7(_0x5277b6);})[_0x6acc('0x1b')](function(_0x125084){logger[_0x6acc('0x16')](_0x6acc('0x22'),_0x125084[_0x6acc('0x18')],_0x342043);_0x4af9e(_0x531f7c[_0x6acc('0x16')](0x1f4,_0x125084['message']));});});};exports[_0x6acc('0x24')]=function(_0x54519d){return new Promise(function(_0x15be7c,_0x490ce6){return db[_0x6acc('0x25')][_0x6acc('0x26')]({'where':_0x54519d[_0x6acc('0x1e')]?_0x54519d[_0x6acc('0x1e')][_0x6acc('0x20')]||null:null})[_0x6acc('0x11')](function(_0x4b6498){if(_0x4b6498){return _0x4b6498['addTags'](_0x54519d['body']['ids'],_[_0x6acc('0x27')](_0x54519d[_0x6acc('0x1d')],[_0x6acc('0x28'),'id'])||{});}})[_0x6acc('0x29')](function(_0x349f9d){logger[_0x6acc('0x19')]('AddTags',_0x54519d);logger['debug'](_0x6acc('0x2a'),_0x54519d,JSON[_0x6acc('0x23')](_0x349f9d));_0x15be7c(_0x349f9d);})[_0x6acc('0x1b')](function(_0x363cbe){logger['error'](_0x6acc('0x2a'),_0x363cbe[_0x6acc('0x18')],_0x54519d);_0x490ce6(_this['error'](0x1f4,_0x363cbe[_0x6acc('0x18')]));});});}; \ No newline at end of file +var _0xeab8=['jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','MailInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateMailInteraction','MailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','addTags','ids','AddTags','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4cee82,_0x208e67){var _0x200c1d=function(_0x372584){while(--_0x372584){_0x4cee82['push'](_0x4cee82['shift']());}};_0x200c1d(++_0x208e67);}(_0xeab8,0x147));var _0x8eab=function(_0x44a2a5,_0x41b870){_0x44a2a5=_0x44a2a5-0x0;var _0x54c58f=_0xeab8[_0x44a2a5];return _0x54c58f;};'use strict';var _=require(_0x8eab('0x0'));var util=require('util');var moment=require(_0x8eab('0x1'));var BPromise=require(_0x8eab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8eab('0x3'));var db=require(_0x8eab('0x4'))['db'];var utils=require(_0x8eab('0x5'));var logger=require(_0x8eab('0x6'))(_0x8eab('0x7'));var config=require(_0x8eab('0x8'));var jayson=require(_0x8eab('0x9'));var client=jayson[_0x8eab('0xa')]['http']({'port':0x232a});config['redis']=_[_0x8eab('0xb')](config[_0x8eab('0xc')],{'host':_0x8eab('0xd'),'port':0x18eb});var socket=require(_0x8eab('0xe'))(new Redis(config[_0x8eab('0xc')]));require('./mailInteraction.socket')[_0x8eab('0xf')](socket);function respondWithRpcPromise(_0x5947df,_0x42371b,_0x46cde9){return new BPromise(function(_0x195cf8,_0x52fcb0){return client[_0x8eab('0x10')](_0x5947df,_0x46cde9)[_0x8eab('0x11')](function(_0x180093){logger[_0x8eab('0x12')](_0x8eab('0x13'),_0x42371b,'request\x20sent');logger[_0x8eab('0x14')](_0x8eab('0x15'),_0x42371b,_0x8eab('0x16'),JSON[_0x8eab('0x17')](_0x180093));if(_0x180093['error']){if(_0x180093[_0x8eab('0x18')]['code']===0x1f4){logger['error'](_0x8eab('0x13'),_0x42371b,_0x180093[_0x8eab('0x18')][_0x8eab('0x19')]);return _0x52fcb0(_0x180093[_0x8eab('0x18')][_0x8eab('0x19')]);}logger[_0x8eab('0x18')](_0x8eab('0x13'),_0x42371b,_0x180093[_0x8eab('0x18')]['message']);return _0x195cf8(_0x180093['error'][_0x8eab('0x19')]);}else{logger[_0x8eab('0x12')](_0x8eab('0x13'),_0x42371b,_0x8eab('0x16'));_0x195cf8(_0x180093[_0x8eab('0x1a')][_0x8eab('0x19')]);}})['catch'](function(_0x51e324){logger[_0x8eab('0x18')](_0x8eab('0x13'),_0x42371b,_0x51e324);_0x52fcb0(_0x51e324);});});}exports[_0x8eab('0x1b')]=function(_0xa3e5bf){var _0x2a5ccd=this;return new Promise(function(_0x23f7a1,_0x48a2c7){return db[_0x8eab('0x1c')][_0x8eab('0x1d')](_0xa3e5bf[_0x8eab('0x1e')],{'raw':_0xa3e5bf[_0x8eab('0x1f')]?_0xa3e5bf['options'][_0x8eab('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3e5bf[_0x8eab('0x1f')]?_0xa3e5bf['options'][_0x8eab('0x21')]||null:null,'attributes':_0xa3e5bf[_0x8eab('0x1f')]?_0xa3e5bf['options'][_0x8eab('0x22')]||null:null,'limit':_0xa3e5bf[_0x8eab('0x1f')]?_0xa3e5bf[_0x8eab('0x1f')][_0x8eab('0x23')]||null:null})[_0x8eab('0x11')](function(_0x3317f5){logger[_0x8eab('0x12')](_0x8eab('0x1b'),_0xa3e5bf);logger[_0x8eab('0x14')](_0x8eab('0x1b'),_0xa3e5bf,JSON['stringify'](_0x3317f5));_0x23f7a1(_0x3317f5);})['catch'](function(_0x2623ea){logger['error']('UpdateMailInteraction',_0x2623ea[_0x8eab('0x19')],_0xa3e5bf);_0x48a2c7(_0x2a5ccd['error'](0x1f4,_0x2623ea[_0x8eab('0x19')]));});});};exports[_0x8eab('0x24')]=function(_0x446861){return new Promise(function(_0x1676ea,_0x48fe56){return db[_0x8eab('0x1c')][_0x8eab('0x25')]({'where':_0x446861['options']?_0x446861[_0x8eab('0x1f')][_0x8eab('0x21')]||null:null})[_0x8eab('0x11')](function(_0x196727){if(_0x196727){return _0x196727[_0x8eab('0x26')](_0x446861[_0x8eab('0x1e')][_0x8eab('0x27')],_['omit'](_0x446861[_0x8eab('0x1e')],[_0x8eab('0x27'),'id'])||{});}})['spread'](function(_0x4d8a86){logger[_0x8eab('0x12')](_0x8eab('0x28'),_0x446861);logger[_0x8eab('0x14')](_0x8eab('0x28'),_0x446861,JSON[_0x8eab('0x17')](_0x4d8a86));_0x1676ea(_0x4d8a86);})[_0x8eab('0x29')](function(_0x559c03){logger[_0x8eab('0x18')](_0x8eab('0x28'),_0x559c03['message'],_0x446861);_0x48fe56(_this[_0x8eab('0x18')](0x1f4,_0x559c03[_0x8eab('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 82e1cb8..560f011 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 _0x1a1f=['length','mailInteraction:','./mailInteraction.events','remove','update','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1a1f,0xbc));var _0xf1a1=function(_0x42456b,_0xfcab1){_0x42456b=_0x42456b-0x0;var _0x49b031=_0x1a1f[_0x42456b];return _0x49b031;};'use strict';var MailInteractionEvents=require(_0xf1a1('0x0'));var events=['save',_0xf1a1('0x1'),_0xf1a1('0x2')];function createListener(_0x1fd3b7,_0xbd689e){return function(_0x319b4e){_0xbd689e['emit'](_0x1fd3b7,_0x319b4e);};}function removeListener(_0x19a29a,_0x8043b3){return function(){MailInteractionEvents['removeListener'](_0x19a29a,_0x8043b3);};}exports[_0xf1a1('0x3')]=function(_0xcfbff5){for(var _0x485e91=0x0,_0x101e04=events[_0xf1a1('0x4')];_0x485e91<_0x101e04;_0x485e91++){var _0x30de46=events[_0x485e91];var _0xd92bd9=createListener(_0xf1a1('0x5')+_0x30de46,_0xcfbff5);MailInteractionEvents['on'](_0x30de46,_0xd92bd9);}}; \ No newline at end of file +var _0x28ca=['removeListener','mailInteraction:','./mailInteraction.events','emit'];(function(_0x287405,_0x497999){var _0x41c8c4=function(_0x369d98){while(--_0x369d98){_0x287405['push'](_0x287405['shift']());}};_0x41c8c4(++_0x497999);}(_0x28ca,0x10a));var _0xa28c=function(_0x4bba6d,_0x42f7ab){_0x4bba6d=_0x4bba6d-0x0;var _0x32d568=_0x28ca[_0x4bba6d];return _0x32d568;};'use strict';var MailInteractionEvents=require(_0xa28c('0x0'));var events=['save','remove','update'];function createListener(_0x4aabe0,_0x4e3d09){return function(_0x3833e6){_0x4e3d09[_0xa28c('0x1')](_0x4aabe0,_0x3833e6);};}function removeListener(_0x14cb6a,_0x3d8e37){return function(){MailInteractionEvents[_0xa28c('0x2')](_0x14cb6a,_0x3d8e37);};}exports['register']=function(_0x56a628){for(var _0x5ac06a=0x0,_0x2bf143=events['length'];_0x5ac06a<_0x2bf143;_0x5ac06a++){var _0x328d90=events[_0x5ac06a];var _0x5a9c4a=createListener(_0xa28c('0x3')+_0x328d90,_0x56a628);MailInteractionEvents['on'](_0x328d90,_0x5a9c4a);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 6772e09..ae3c006 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 _0x96d9=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','tracked','mail','put','/:id/accept','accept','/:id/reject','reject'];(function(_0x17c46f,_0x353fc3){var _0x4165d7=function(_0x5b3587){while(--_0x5b3587){_0x17c46f['push'](_0x17c46f['shift']());}};_0x4165d7(++_0x353fc3);}(_0x96d9,0xea));var _0x996d=function(_0x45cc4d,_0x665794){_0x45cc4d=_0x45cc4d-0x0;var _0x103d7d=_0x96d9[_0x45cc4d];return _0x103d7d;};'use strict';var multer=require(_0x996d('0x0'));var util=require(_0x996d('0x1'));var path=require(_0x996d('0x2'));var timeout=require(_0x996d('0x3'));var express=require(_0x996d('0x4'));var router=express[_0x996d('0x5')]();var fs_extra=require(_0x996d('0x6'));var auth=require(_0x996d('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x996d('0x8'));var controller=require(_0x996d('0x9'));router[_0x996d('0xa')]('/',auth[_0x996d('0xb')](),controller[_0x996d('0xc')]);router[_0x996d('0xa')](_0x996d('0xd'),auth['isAuthenticated'](),controller[_0x996d('0xe')]);router[_0x996d('0xa')](_0x996d('0xf'),auth[_0x996d('0xb')](),controller[_0x996d('0x10')]);router['get'](_0x996d('0x11'),auth[_0x996d('0xb')](),controller[_0x996d('0x12')]);router[_0x996d('0x13')]('/',auth['isAuthenticated'](),interaction[_0x996d('0x14')](_0x996d('0x15'),'mailmessage:create'),controller['create']);router['put'](_0x996d('0xf'),auth[_0x996d('0xb')](),controller['update']);router[_0x996d('0x16')](_0x996d('0x17'),auth['isAuthenticated'](),controller[_0x996d('0x18')]);router[_0x996d('0x16')](_0x996d('0x19'),auth['isAuthenticated'](),controller[_0x996d('0x1a')]);router['delete'](_0x996d('0xf'),auth[_0x996d('0xb')](),controller[_0x996d('0x1b')]);module[_0x996d('0x1c')]=router; \ No newline at end of file +var _0xea67=['put','update','accept','reject','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','tracked','mail','create'];(function(_0x4690be,_0x175ed3){var _0x5ccee0=function(_0x4434d4){while(--_0x4434d4){_0x4690be['push'](_0x4690be['shift']());}};_0x5ccee0(++_0x175ed3);}(_0xea67,0x172));var _0x7ea6=function(_0x225cac,_0x5ee6d7){_0x225cac=_0x225cac-0x0;var _0x218772=_0xea67[_0x225cac];return _0x218772;};'use strict';var multer=require(_0x7ea6('0x0'));var util=require(_0x7ea6('0x1'));var path=require(_0x7ea6('0x2'));var timeout=require(_0x7ea6('0x3'));var express=require('express');var router=express[_0x7ea6('0x4')]();var fs_extra=require(_0x7ea6('0x5'));var auth=require(_0x7ea6('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7ea6('0x7'));var controller=require(_0x7ea6('0x8'));router[_0x7ea6('0x9')]('/',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xb')]);router[_0x7ea6('0x9')](_0x7ea6('0xc'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0xd')]);router['get'](_0x7ea6('0xe'),auth['isAuthenticated'](),controller[_0x7ea6('0xf')]);router[_0x7ea6('0x9')](_0x7ea6('0x10'),auth[_0x7ea6('0xa')](),controller['download']);router['post']('/',auth[_0x7ea6('0xa')](),interaction[_0x7ea6('0x11')](_0x7ea6('0x12'),'mailmessage:create'),controller[_0x7ea6('0x13')]);router[_0x7ea6('0x14')]('/:id',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x15')]);router[_0x7ea6('0x14')]('/:id/accept',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x16')]);router['put']('/:id/reject',auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x17')]);router[_0x7ea6('0x18')](_0x7ea6('0xe'),auth[_0x7ea6('0xa')](),controller[_0x7ea6('0x19')]);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 f65328c..3eaedc6 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 _0x7462=['BOOLEAN','ENUM','out','STRING','TEXT','DATE','INTEGER','Email','Chat','sequelize','lodash','long'];(function(_0x558e1d,_0x1f072a){var _0x56efe2=function(_0x2468a8){while(--_0x2468a8){_0x558e1d['push'](_0x558e1d['shift']());}};_0x56efe2(++_0x1f072a);}(_0x7462,0x165));var _0x2746=function(_0x11309c,_0xe18a74){_0x11309c=_0x11309c-0x0;var _0x3fea9c=_0x7462[_0x11309c];return _0x3fea9c;};'use strict';var Sequelize=require(_0x2746('0x0'));var _=require(_0x2746('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x2746('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x2746('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x2746('0x4')]('in','out'),'defaultValue':_0x2746('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x2746('0x6')](0x1fe)},'from':{'type':Sequelize[_0x2746('0x6')]},'to':{'type':Sequelize[_0x2746('0x7')](_0x2746('0x2'))},'cc':{'type':Sequelize[_0x2746('0x7')](_0x2746('0x2'))},'bcc':{'type':Sequelize[_0x2746('0x7')](_0x2746('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x2746('0x8')]},'attach':{'type':Sequelize[_0x2746('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'readAt':{'type':Sequelize[_0x2746('0x8')]},'originTo':{'type':Sequelize[_0x2746('0x7')](_0x2746('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0x2746('0x2'))},'originChannel':{'type':Sequelize[_0x2746('0x4')](_0x2746('0xa'),_0x2746('0xb')),'defaultValue':_0x2746('0xa'),'allowNull':![]}}; \ No newline at end of file +var _0x30cc=['TEXT','medium','BOOLEAN','out','STRING','DATE','ENUM','Email','Chat','sequelize','lodash','long'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0x30cc,0x81));var _0xc30c=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x30cc[_0x3ebb69];return _0x421e59;};'use strict';var Sequelize=require(_0xc30c('0x0'));var _=require(_0xc30c('0x1'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xc30c('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xc30c('0x3')](_0xc30c('0x4'))},'read':{'type':Sequelize[_0xc30c('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xc30c('0x6')),'defaultValue':_0xc30c('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0xc30c('0x7')]},'to':{'type':Sequelize[_0xc30c('0x3')]('long')},'cc':{'type':Sequelize[_0xc30c('0x3')]('long')},'bcc':{'type':Sequelize[_0xc30c('0x3')](_0xc30c('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xc30c('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xc30c('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xc30c('0x3')](_0xc30c('0x2'))},'originCc':{'type':Sequelize[_0xc30c('0x3')](_0xc30c('0x2'))},'originChannel':{'type':Sequelize[_0xc30c('0x9')](_0xc30c('0xa'),_0xc30c('0xb')),'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 2824a68..8ff7dfa 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 _0x1875=['Smtp','isNil','host','port','secure','authentication','auth','service','user','attachments','join','root','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','readAt','agent','UserId','get','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','ContactId','Sequelize','SELECT','contact','User','fullname','internal','manual','SIP/%s','channel','event','fromString','acceptmessage','reject','MailInteraction','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','email','interface','motionChannel','EventManager','rejectmessage','download','unix','toString','server','files','tmp','bcc','createdAt','Attachment','Attachments','from','subject','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','type','readFileSync','build','writeFileSync','unlinkSync','eml-format','moment','bluebird','path','lodash','ioredis','html-to-text','../../components/parsers/qs','../../config/logger','api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','client','http','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','offset','undefined','limit','count','set','update','destroy','end','sendStatus','stack','name','send','index','MailMessage','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','findAll','rows','fields','include','find','body','params','describe','create','direction','split','MailAccount','findOne','List','CmContact','Contacts','DESC','MailServerOut'];(function(_0x1c995d,_0x133e90){var _0x57e17d=function(_0x34507b){while(--_0x34507b){_0x1c995d['push'](_0x1c995d['shift']());}};_0x57e17d(++_0x133e90);}(_0x1875,0xf8));var _0x5187=function(_0x26d02a,_0x592533){_0x26d02a=_0x26d02a-0x0;var _0x4419aa=_0x1875[_0x26d02a];return _0x4419aa;};'use strict';var emlformat=require(_0x5187('0x0'));var moment=require(_0x5187('0x1'));var BPromise=require(_0x5187('0x2'));var util=require('util');var path=require(_0x5187('0x3'));var fs=require('fs');var _=require(_0x5187('0x4'));var Redis=require(_0x5187('0x5'));var htmlToText=require(_0x5187('0x6'));var qs=require(_0x5187('0x7'));var logger=require(_0x5187('0x8'))(_0x5187('0x9'));var interaction_log=require(_0x5187('0x8'))(_0x5187('0xa'));var config=require(_0x5187('0xb'));var db=require(_0x5187('0xc'))['db'];config[_0x5187('0xd')]=_[_0x5187('0xe')](config[_0x5187('0xd')],{'host':_0x5187('0xf'),'port':0x18eb});var socket=require(_0x5187('0x10'))(new Redis(config['redis']));var htmlEntities=require('html-entities');require(_0x5187('0x11'))[_0x5187('0x12')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5187('0x13')][_0x5187('0x14')]({'port':0x232c});var client9003=jayson[_0x5187('0x13')][_0x5187('0x14')]({'port':0x232b});var client9002=jayson[_0x5187('0x13')]['http']({'port':0x232a});function respondWithRpcPromise(_0x380528,_0x4e9186,_0x2bc462,_0x65b17c){return new BPromise(function(_0x510d0d,_0x3a0754){var _0x5c6766=_0x65b17c||client;return _0x5c6766['request'](_0x380528,_0x2bc462)[_0x5187('0x15')](function(_0x25bffc){logger[_0x5187('0x16')](_0x5187('0x17'),_0x4e9186,_0x5187('0x18'));logger['debug'](_0x5187('0x19'),_0x4e9186,_0x5187('0x18'),JSON[_0x5187('0x1a')](_0x25bffc));if(_0x25bffc[_0x5187('0x1b')]){if(_0x25bffc[_0x5187('0x1b')]['code']===0x1f4){logger[_0x5187('0x1b')](_0x5187('0x17'),_0x4e9186,_0x25bffc[_0x5187('0x1b')]['message']);return _0x3a0754(_0x25bffc['error']['message']);}logger[_0x5187('0x1b')]('MailMessage,\x20%s,\x20%s',_0x4e9186,_0x25bffc['error'][_0x5187('0x1c')]);return _0x510d0d(_0x25bffc[_0x5187('0x1b')][_0x5187('0x1c')]);}else{logger[_0x5187('0x16')](_0x5187('0x17'),_0x4e9186,_0x5187('0x18'));_0x510d0d(_0x25bffc[_0x5187('0x1d')][_0x5187('0x1c')]);}})[_0x5187('0x1e')](function(_0x26fc03){logger[_0x5187('0x1b')](_0x5187('0x17'),_0x4e9186,_0x26fc03);_0x3a0754(_0x26fc03);});});}function respondWithResult(_0x3c81a0,_0x308707){_0x308707=_0x308707||0xc8;return function(_0x3b166a){if(_0x3b166a){return _0x3c81a0[_0x5187('0x1f')](_0x308707)[_0x5187('0x20')](_0x3b166a);}};}function respondWithFilteredResult(_0x307ce2,_0x43cc60){return function(_0x2000cb){if(_0x2000cb){var _0x179c6c=typeof _0x43cc60[_0x5187('0x21')]===_0x5187('0x22')&&typeof _0x43cc60[_0x5187('0x23')]===_0x5187('0x22');var _0x1abbc6=_0x2000cb[_0x5187('0x24')];var _0x4787de=_0x179c6c?0x0:_0x43cc60[_0x5187('0x21')];var _0x4c29f8=_0x179c6c?_0x2000cb[_0x5187('0x24')]:_0x43cc60[_0x5187('0x21')]+_0x43cc60[_0x5187('0x23')];var _0x237c03;if(_0x4c29f8>=_0x1abbc6){_0x4c29f8=_0x1abbc6;_0x237c03=0xc8;}else{_0x237c03=0xce;}_0x307ce2[_0x5187('0x1f')](_0x237c03);return _0x307ce2[_0x5187('0x25')]('Content-Range',_0x4787de+'-'+_0x4c29f8+'/'+_0x1abbc6)[_0x5187('0x20')](_0x2000cb);}return null;};}function saveUpdates(_0x45d01d){return function(_0x390316){if(_0x390316){return _0x390316[_0x5187('0x26')](_0x45d01d)[_0x5187('0x15')](function(_0x12bd3b){return _0x12bd3b;});}return null;};}function removeEntity(_0x47cf02){return function(_0x2bf110){if(_0x2bf110){return _0x2bf110[_0x5187('0x27')]()['then'](function(){_0x47cf02[_0x5187('0x1f')](0xcc)[_0x5187('0x28')]();});}};}function handleEntityNotFound(_0x11e780){return function(_0x391d94){if(!_0x391d94){_0x11e780[_0x5187('0x29')](0x194);}return _0x391d94;};}function handleError(_0x48fff0,_0x558a79){_0x558a79=_0x558a79||0x1f4;return function(_0x4e8f92){logger[_0x5187('0x1b')](_0x4e8f92[_0x5187('0x2a')]);if(_0x4e8f92[_0x5187('0x2b')]){delete _0x4e8f92[_0x5187('0x2b')];}_0x48fff0[_0x5187('0x1f')](_0x558a79)[_0x5187('0x2c')](_0x4e8f92);};}exports[_0x5187('0x2d')]=function(_0xe12b5d,_0x1b19c5){var _0x1ec271={},_0x4e7c73={},_0x10f021={'count':0x0,'rows':[]};var _0xa7298d=_['map'](db[_0x5187('0x2e')][_0x5187('0x2f')],function(_0x3df269){return{'name':_0x3df269[_0x5187('0x30')],'type':_0x3df269['type'][_0x5187('0x31')]};});_0x4e7c73['model']=_[_0x5187('0x32')](_0xa7298d,_0x5187('0x2b'));_0x4e7c73[_0x5187('0x33')]=_[_0x5187('0x34')](_0xe12b5d[_0x5187('0x33')]);_0x4e7c73[_0x5187('0x35')]=_[_0x5187('0x36')](_0x4e7c73[_0x5187('0x37')],_0x4e7c73[_0x5187('0x33')]);_0x1ec271[_0x5187('0x38')]=_['intersection'](_0x4e7c73['model'],qs['fields'](_0xe12b5d[_0x5187('0x33')]['fields']));_0x1ec271[_0x5187('0x38')]=_0x1ec271[_0x5187('0x38')][_0x5187('0x39')]?_0x1ec271[_0x5187('0x38')]:_0x4e7c73[_0x5187('0x37')];if(!_0xe12b5d[_0x5187('0x33')][_0x5187('0x3a')](_0x5187('0x3b'))){_0x1ec271[_0x5187('0x23')]=qs['limit'](_0xe12b5d['query']['limit']);_0x1ec271['offset']=qs[_0x5187('0x21')](_0xe12b5d[_0x5187('0x33')][_0x5187('0x21')]);}_0x1ec271[_0x5187('0x3c')]=qs[_0x5187('0x3d')](_0xe12b5d[_0x5187('0x33')]['sort']);_0x1ec271['where']=qs[_0x5187('0x35')](_[_0x5187('0x3e')](_0xe12b5d[_0x5187('0x33')],_0x4e7c73[_0x5187('0x35')]),_0xa7298d);if(_0xe12b5d[_0x5187('0x33')][_0x5187('0x3f')]){_0x1ec271[_0x5187('0x40')]=_[_0x5187('0x41')](_0x1ec271[_0x5187('0x40')],{'$or':_[_0x5187('0x32')](_0xa7298d,function(_0x2a2d31){if(_0x2a2d31['type']!=='VIRTUAL'){var _0x1ae5f2={};_0x1ae5f2[_0x2a2d31[_0x5187('0x2b')]]={'$like':'%'+_0xe12b5d['query']['filter']+'%'};return _0x1ae5f2;}})});}_0x1ec271=_['merge']({},_0x1ec271,_0xe12b5d[_0x5187('0x42')]);var _0x9dddff={'where':_0x1ec271[_0x5187('0x40')]};return db[_0x5187('0x2e')][_0x5187('0x24')](_0x9dddff)[_0x5187('0x15')](function(_0x1870e5){_0x10f021[_0x5187('0x24')]=_0x1870e5;if(_0xe12b5d[_0x5187('0x33')][_0x5187('0x43')]){_0x1ec271['include']=[{'all':!![]}];}return db[_0x5187('0x2e')][_0x5187('0x44')](_0x1ec271);})[_0x5187('0x15')](function(_0x5934cf){_0x10f021[_0x5187('0x45')]=_0x5934cf;return _0x10f021;})[_0x5187('0x15')](respondWithFilteredResult(_0x1b19c5,_0x1ec271))['catch'](handleError(_0x1b19c5,null));};exports['show']=function(_0x4b992d,_0x585329){var _0x2e98de={'raw':!![],'where':{'id':_0x4b992d['params']['id']}},_0x1f30c5={};_0x1f30c5[_0x5187('0x37')]=_[_0x5187('0x34')](db[_0x5187('0x2e')]['rawAttributes']);_0x1f30c5[_0x5187('0x33')]=_['keys'](_0x4b992d['query']);_0x1f30c5[_0x5187('0x35')]=_[_0x5187('0x36')](_0x1f30c5['model'],_0x1f30c5[_0x5187('0x33')]);_0x2e98de[_0x5187('0x38')]=_[_0x5187('0x36')](_0x1f30c5[_0x5187('0x37')],qs[_0x5187('0x46')](_0x4b992d[_0x5187('0x33')][_0x5187('0x46')]));_0x2e98de['attributes']=_0x2e98de[_0x5187('0x38')][_0x5187('0x39')]?_0x2e98de[_0x5187('0x38')]:_0x1f30c5[_0x5187('0x37')];if(_0x4b992d[_0x5187('0x33')]['includeAll']){_0x2e98de[_0x5187('0x47')]=[{'all':!![]}];}_0x2e98de=_[_0x5187('0x41')]({},_0x2e98de,_0x4b992d[_0x5187('0x42')]);return db[_0x5187('0x2e')][_0x5187('0x48')](_0x2e98de)[_0x5187('0x15')](handleEntityNotFound(_0x585329,null))[_0x5187('0x15')](respondWithResult(_0x585329,null))[_0x5187('0x1e')](handleError(_0x585329,null));};exports[_0x5187('0x26')]=function(_0x59dc24,_0x5e5ae9){if(_0x59dc24[_0x5187('0x49')]['id']){delete _0x59dc24[_0x5187('0x49')]['id'];}return db[_0x5187('0x2e')][_0x5187('0x48')]({'where':{'id':_0x59dc24['params']['id']}})[_0x5187('0x15')](handleEntityNotFound(_0x5e5ae9,null))['then'](saveUpdates(_0x59dc24[_0x5187('0x49')],null))[_0x5187('0x15')](respondWithResult(_0x5e5ae9,null))[_0x5187('0x1e')](handleError(_0x5e5ae9,null));};exports[_0x5187('0x27')]=function(_0x2b54f4,_0x163ece){return db[_0x5187('0x2e')][_0x5187('0x48')]({'where':{'id':_0x2b54f4[_0x5187('0x4a')]['id']}})[_0x5187('0x15')](handleEntityNotFound(_0x163ece,null))[_0x5187('0x15')](removeEntity(_0x163ece,null))['catch'](handleError(_0x163ece,null));};exports[_0x5187('0x4b')]=function(_0x2174ef,_0x39392d){return db[_0x5187('0x2e')][_0x5187('0x4b')]()[_0x5187('0x15')](respondWithResult(_0x39392d,null))[_0x5187('0x1e')](handleError(_0x39392d,null));};exports[_0x5187('0x4c')]=function(_0x12f1b3,_0x4eec88){return db['MailMessage']['create'](_0x12f1b3[_0x5187('0x49')])[_0x5187('0x15')](function(_0x51e194){if(_0x51e194){if(_0x51e194[_0x5187('0x4d')]==='out'&&!_0x51e194['secret']){var _0x5042f6,_0x2999b6,_0x557b3f;if(_0x12f1b3[_0x5187('0x49')]['to']){_0x2999b6=_0x12f1b3['body']['to'][_0x5187('0x4e')](',')[0x0];}return db[_0x5187('0x4f')][_0x5187('0x50')]({'where':{'id':_0x51e194['MailAccountId']},'include':[{'model':db['CmList'],'as':_0x5187('0x51'),'include':[{'model':db[_0x5187('0x52')],'as':_0x5187('0x53'),'where':{'email':_0x2999b6},'limit':0x1,'order':[['updatedAt',_0x5187('0x54')]]}]},{'model':db[_0x5187('0x55')],'as':_0x5187('0x56'),'raw':!![]}]})[_0x5187('0x15')](function(_0xbbdc73){_0x5042f6=_0xbbdc73;if(_0x5042f6&&_0x5042f6[_0x5187('0x56')]){var _0x23c66f={'tls':{'rejectUnauthorized':![]}};if(_[_0x5187('0x57')](_0x5042f6[_0x5187('0x56')]['service'])){_0x23c66f[_0x5187('0x58')]=_0x5042f6[_0x5187('0x56')]['host'];_0x23c66f[_0x5187('0x59')]=_0x5042f6[_0x5187('0x56')]['port'];_0x23c66f[_0x5187('0x5a')]=_0x5042f6[_0x5187('0x56')]['secure'];if(_0x5042f6[_0x5187('0x56')][_0x5187('0x5b')]){_0x23c66f[_0x5187('0x5c')]={'user':_0x5042f6['Smtp']['user'],'pass':_0x5042f6[_0x5187('0x56')]['pass']};}}else{_0x23c66f['service']=_0x5042f6[_0x5187('0x56')][_0x5187('0x5d')];_0x23c66f[_0x5187('0x5c')]={'user':_0x5042f6[_0x5187('0x56')][_0x5187('0x5e')],'pass':_0x5042f6[_0x5187('0x56')]['pass']};_0x23c66f[_0x5187('0x5a')]=_0x5042f6[_0x5187('0x56')][_0x5187('0x5a')];}if(_0x12f1b3['body']['attachments']&&_0x12f1b3[_0x5187('0x49')][_0x5187('0x5f')][_0x5187('0x39')]){for(var _0x31a206=0x0;_0x31a206<_0x12f1b3[_0x5187('0x49')]['attachments'][_0x5187('0x39')];_0x31a206+=0x1){_0x12f1b3[_0x5187('0x49')]['attachments'][_0x31a206]={'filename':_0x12f1b3[_0x5187('0x49')]['attachments'][_0x31a206][_0x5187('0x2b')],'path':path[_0x5187('0x60')](config[_0x5187('0x61')],_0x5187('0x62'),_0x12f1b3['body'][_0x5187('0x5f')][_0x31a206][_0x5187('0x63')])};}}_0x557b3f={'account':_0x23c66f,'message':_0x12f1b3[_0x5187('0x49')]};return;}})['then'](function(){if(_0x5042f6[_0x5187('0x51')]){if(_0x5042f6['List'][_0x5187('0x53')][_0x5187('0x39')]){return _0x5042f6[_0x5187('0x51')]['Contacts'][0x0];}else{return db[_0x5187('0x52')][_0x5187('0x4c')](_[_0x5187('0xe')](_0x12f1b3[_0x5187('0x49')],{'firstName':_0x12f1b3[_0x5187('0x49')]['to'],'email':_0x12f1b3['body']['to'],'phone':_0x12f1b3[_0x5187('0x49')]['to'],'ListId':_0x5042f6['ListId']}));}}else{throw new Error(_0x5187('0x64'));}})[_0x5187('0x15')](function(){if(_0x557b3f){return respondWithRpcPromise(_0x5187('0x65'),_0x5187('0x66'),_0x557b3f,client9003)[_0x5187('0x15')](function(_0x464365){return _0x51e194[_0x5187('0x26')]({'read':!![],'messageId':_0x464365[_0x5187('0x67')],'sentAt':moment()[_0x5187('0x68')](_0x5187('0x69'))});})[_0x5187('0x1e')](function(_0x47545b){logger['error']('%s',JSON['stringify'](_0x47545b));return _0x51e194;});}return _0x51e194;});}return _0x51e194;}})['then'](respondWithResult(_0x4eec88,0xc9))[_0x5187('0x1e')](handleError(_0x4eec88,null));};exports[_0x5187('0x6a')]=function(_0x142c03,_0x2bf751){var _0x31250c={'agent':{},'channel':_0x5187('0x6b')};if(_0x142c03[_0x5187('0x49')]['id']){delete _0x142c03[_0x5187('0x49')]['id'];}_0x142c03['body']['read']=!![];_0x142c03[_0x5187('0x49')][_0x5187('0x6c')]=moment()[_0x5187('0x68')](_0x5187('0x69'));_0x142c03[_0x5187('0x49')]['UserId']=_0x142c03[_0x5187('0x49')]['UserId']||_0x142c03[_0x5187('0x5e')]['id'];_0x31250c[_0x5187('0x6d')]['id']=_0x142c03['body'][_0x5187('0x6e')];return db[_0x5187('0x2e')][_0x5187('0x48')]({'where':{'id':_0x142c03[_0x5187('0x4a')]['id'],'UserId':null}})[_0x5187('0x15')](handleEntityNotFound(_0x2bf751,null))[_0x5187('0x15')](saveUpdates(_0x142c03['body'],null))[_0x5187('0x15')](function(_0x414d28){if(_0x414d28){_0x31250c[_0x5187('0x1c')]=_0x414d28[_0x5187('0x6f')]({'plain':!![]});return db['MailInteraction'][_0x5187('0x48')]({'where':{'id':_0x414d28['MailInteractionId']}});}return null;})[_0x5187('0x15')](handleEntityNotFound(_0x2bf751,null))[_0x5187('0x15')](function(_0x5f2d57){if(_0x5f2d57){return _0x5f2d57['update']({'UserId':_0x142c03[_0x5187('0x49')][_0x5187('0x6e')],'read1stAt':_[_0x5187('0x57')](_0x5f2d57[_0x5187('0x70')])?moment()[_0x5187('0x68')](_0x5187('0x69')):undefined});}return null;})[_0x5187('0x15')](function(_0x320a69){if(_0x320a69){_0x31250c[_0x5187('0x71')]=_0x320a69['get']({'plain':!![]});interaction_log[_0x5187('0x16')](_0x5187('0x72'),_0x142c03[_0x5187('0x5e')]['id'],_0x142c03['user'][_0x5187('0x2b')],_0x142c03['user'][_0x5187('0x73')],_0x31250c[_0x5187('0x71')]['id'],_0x142c03['body']?JSON[_0x5187('0x1a')](_0x142c03[_0x5187('0x49')]):_0x5187('0x74'));return respondWithRpcPromise('AcceptMessage',_0x5187('0x75'),_0x31250c);}return null;})[_0x5187('0x15')](function(_0x2a0086){var _0x384f63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2a0086['message'][_0x5187('0x76')];return db['sequelize'][_0x5187('0x33')](_0x384f63,{'type':db[_0x5187('0x77')]['QueryTypes'][_0x5187('0x78')],'raw':!![]})['then'](function(_0x451474){return _0x451474;});})[_0x5187('0x15')](function(_0x55fc84){if(_0x55fc84){_0x31250c[_0x5187('0x1c')][_0x5187('0x79')]=_0x55fc84[0x0];if(!_0x142c03[_0x5187('0x49')][_0x5187('0x6e')])return;return db[_0x5187('0x7a')][_0x5187('0x48')]({'where':{'id':_0x142c03[_0x5187('0x49')][_0x5187('0x6e')],'role':_0x5187('0x6d')},'attributes':['id',_0x5187('0x2b'),_0x5187('0x7b'),'email',_0x5187('0x7c')],'raw':!![]});}return null;})[_0x5187('0x15')](function(_0xf8d913){if(!_0xf8d913)return null;_0x31250c[_0x5187('0x1c')]['agent']=_0xf8d913;return _0x31250c;})[_0x5187('0x15')](function(_0x63ac04){if(_0x63ac04){if(_0x142c03[_0x5187('0x49')][_0x5187('0x7d')]){_0x31250c[_0x5187('0x1c')]['interface']=util[_0x5187('0x68')](_0x5187('0x7e'),_0x142c03[_0x5187('0x5e')]['name']);_0x31250c[_0x5187('0x1c')][_0x5187('0x7f')]=_0x31250c['channel'];_0x31250c['message']['motionChannel']=_0x31250c[_0x5187('0x7f')];_0x31250c['message'][_0x5187('0x80')]='accept';_0x31250c['message'][_0x5187('0x49')]=htmlToText[_0x5187('0x81')](_0x31250c[_0x5187('0x1c')][_0x5187('0x49')]);return respondWithRpcPromise('EventManager','EventManager',{'event':_0x5187('0x82'),'message':_0x31250c[_0x5187('0x1c')]},client9002)[_0x5187('0x15')](function(){return _0x31250c;});}return _0x31250c;}return null;})[_0x5187('0x15')](respondWithResult(_0x2bf751,null))['catch'](handleError(_0x2bf751,null));};exports[_0x5187('0x83')]=function(_0x220cd1,_0x5ff152){var _0x507482={'agent':{},'channel':_0x5187('0x6b')};if(_0x220cd1['body']['id']){delete _0x220cd1[_0x5187('0x49')]['id'];}_0x220cd1[_0x5187('0x49')]['UserId']=_0x220cd1[_0x5187('0x49')][_0x5187('0x6e')]||_0x220cd1[_0x5187('0x5e')]['id'];_0x507482[_0x5187('0x6d')]['id']=_0x220cd1[_0x5187('0x49')][_0x5187('0x6e')];return db['MailMessage']['find']({'where':{'id':_0x220cd1[_0x5187('0x4a')]['id'],'UserId':null}})[_0x5187('0x15')](handleEntityNotFound(_0x5ff152,null))[_0x5187('0x15')](function(_0x3fd4a1){if(_0x3fd4a1){_0x507482[_0x5187('0x1c')]=_0x3fd4a1[_0x5187('0x6f')]({'plain':!![]});return db[_0x5187('0x84')][_0x5187('0x48')]({'where':{'id':_0x3fd4a1[_0x5187('0x85')]}});}return null;})[_0x5187('0x15')](handleEntityNotFound(_0x5ff152,null))['then'](function(_0x360c39){if(_0x360c39){_0x507482['interaction']=_0x360c39[_0x5187('0x6f')]({'plain':!![]});interaction_log[_0x5187('0x16')](_0x5187('0x86'),_0x220cd1[_0x5187('0x5e')]['id'],_0x220cd1['user']['name'],_0x220cd1[_0x5187('0x5e')]['role'],_0x507482[_0x5187('0x71')]['id'],_0x220cd1['body']?JSON[_0x5187('0x1a')](_0x220cd1[_0x5187('0x49')]):_0x5187('0x74'));return respondWithRpcPromise(_0x5187('0x87'),'rejectMessage',_0x507482);}return null;})[_0x5187('0x15')](function(_0x1ae477){var _0x38b635=_0x5187('0x88')+_0x1ae477[_0x5187('0x1c')]['ContactId'];return db[_0x5187('0x89')][_0x5187('0x33')](_0x38b635,{'type':db[_0x5187('0x77')][_0x5187('0x8a')]['SELECT'],'raw':!![]})['then'](function(_0x3b5270){return _0x3b5270;});})[_0x5187('0x15')](function(_0x14a712){if(_0x14a712){_0x507482[_0x5187('0x1c')][_0x5187('0x79')]=_0x14a712[0x0];if(!_0x220cd1[_0x5187('0x49')]['UserId'])return;return db[_0x5187('0x7a')][_0x5187('0x48')]({'where':{'id':_0x220cd1[_0x5187('0x49')][_0x5187('0x6e')],'role':_0x5187('0x6d')},'attributes':['id',_0x5187('0x2b'),'fullname',_0x5187('0x8b'),_0x5187('0x7c')],'raw':!![]});}return null;})[_0x5187('0x15')](function(_0x59c875){if(!_0x59c875)return null;_0x507482[_0x5187('0x1c')][_0x5187('0x6d')]=_0x59c875;return _0x507482;})[_0x5187('0x15')](function(_0x51da0e){if(_0x51da0e){_0x51da0e[_0x5187('0x1c')][_0x5187('0x8c')]=util[_0x5187('0x68')](_0x5187('0x7e'),_0x220cd1[_0x5187('0x5e')][_0x5187('0x2b')]);_0x51da0e[_0x5187('0x1c')][_0x5187('0x7f')]=_0x507482['channel'];_0x51da0e[_0x5187('0x1c')][_0x5187('0x8d')]=_0x507482[_0x5187('0x7f')];_0x51da0e[_0x5187('0x1c')][_0x5187('0x80')]=_0x5187('0x83');_0x51da0e[_0x5187('0x1c')][_0x5187('0x49')]=htmlToText['fromString'](_0x507482[_0x5187('0x1c')][_0x5187('0x49')]);respondWithRpcPromise(_0x5187('0x8e'),'EventManager',{'event':_0x5187('0x8f'),'message':_0x51da0e[_0x5187('0x1c')]},client9002);return _0x507482;}return null;})[_0x5187('0x15')](respondWithResult(_0x5ff152,null))['catch'](handleError(_0x5ff152,null));};exports[_0x5187('0x90')]=function(_0x479e6b,_0x2bf769){var _0x3d2473=moment()[_0x5187('0x91')]()[_0x5187('0x92')]();var _0x1013af=path[_0x5187('0x60')](config[_0x5187('0x61')],_0x5187('0x93'),_0x5187('0x94'),_0x5187('0x95'));var _0x166b1a=path[_0x5187('0x60')](config[_0x5187('0x61')],_0x5187('0x93'),'files',_0x5187('0x5f'));var _0x2a6388=util[_0x5187('0x68')]('message-%s.eml',_0x3d2473);return db[_0x5187('0x2e')][_0x5187('0x48')]({'where':{'id':_0x479e6b[_0x5187('0x4a')]['id']},'attributes':['id',_0x5187('0x49'),'from','to','cc',_0x5187('0x96'),'subject',_0x5187('0x97')],'include':_0x479e6b['query'][_0x5187('0x5f')]?[{'model':db[_0x5187('0x98')],'as':_0x5187('0x99')}]:undefined})[_0x5187('0x15')](handleEntityNotFound(_0x2bf769,null))['then'](function(_0x209855){if(_0x209855){var _0x1dc99f=_0x209855;var _0x2c4cec={'from':_0x1dc99f[_0x5187('0x9a')],'to':_0x1dc99f['to'],'subject':_0x1dc99f[_0x5187('0x9b')],'html':htmlEntities[_0x5187('0x9c')](_0x1dc99f[_0x5187('0x49')]),'headers':{'Date':moment(_0x1dc99f[_0x5187('0x97')])['format'](_0x5187('0x9d'))},'attachments':[]};if(_0x209855['cc']){_0x2c4cec[_0x5187('0x9e')]['Cc']=_0x209855['cc'];}if(_0x209855[_0x5187('0x96')]){_0x2c4cec[_0x5187('0x9e')][_0x5187('0x9f')]=_0x209855[_0x5187('0x96')];}return new BPromise(function(_0x12ee29,_0x47ee8a){if(_0x209855[_0x5187('0x99')]){for(var _0x3eb595=0x0;_0x3eb595<_0x209855[_0x5187('0x99')][_0x5187('0x39')];_0x3eb595++){var _0x348eea=_0x209855[_0x5187('0x99')][_0x3eb595];var _0x57d82b=path[_0x5187('0x60')](_0x166b1a,_0x348eea[_0x5187('0x63')]);if(fs[_0x5187('0xa0')](_0x57d82b)){_0x2c4cec['attachments'][_0x5187('0xa1')]({'name':_0x348eea[_0x5187('0x2b')],'contentType':_0x348eea[_0x5187('0xa2')],'data':fs[_0x5187('0xa3')](_0x57d82b)});}}}emlformat[_0x5187('0xa4')](_0x2c4cec,function(_0x263f2a,_0x4ff3ad){if(_0x263f2a)return _0x47ee8a(_0x263f2a);fs[_0x5187('0xa5')](path[_0x5187('0x60')](_0x1013af,_0x2a6388),_0x4ff3ad);return _0x12ee29(_0x4ff3ad);});});}})['then'](function(_0x540afa){if(_0x540afa){return _0x2bf769[_0x5187('0x90')](path[_0x5187('0x60')](_0x1013af,_0x2a6388),_0x2a6388,function(_0xd06e4b){if(!_0xd06e4b)fs[_0x5187('0xa6')](path[_0x5187('0x60')](_0x1013af,_0x2a6388));});}})['catch'](handleError(_0x2bf769,null));}; \ No newline at end of file +var _0x9f4f=['api','mail-interactions','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','html-entities','./mailMessage.socket','register','jayson/promise','client','http','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','status','json','offset','undefined','limit','count','Content-Range','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','length','includeAll','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','server/files/attachments','basename','Contacts','CmContact','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','read','readAt','UserId','agent','params','get','MailInteraction','MailInteractionId','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','ContactId','Sequelize','SELECT','contact','User','fullname','email','interface','SIP/%s','channel','event','fromString','EventManager','acceptmessage','reject','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','internal','rejectmessage','unix','toString','tmp','server','files','message-%s.eml','from','subject','createdAt','Attachment','Attachments','decode','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','readFileSync','build','unlinkSync','eml-format','moment','bluebird','util','path','lodash','ioredis','html-to-text','../../config/logger'];(function(_0xd39959,_0x302d09){var _0x1ff69c=function(_0x17c97f){while(--_0x17c97f){_0xd39959['push'](_0xd39959['shift']());}};_0x1ff69c(++_0x302d09);}(_0x9f4f,0x1e9));var _0xf9f4=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x9f4f[_0x22b8a3];return _0x199a0c;};'use strict';var emlformat=require(_0xf9f4('0x0'));var moment=require(_0xf9f4('0x1'));var BPromise=require(_0xf9f4('0x2'));var util=require(_0xf9f4('0x3'));var path=require(_0xf9f4('0x4'));var fs=require('fs');var _=require(_0xf9f4('0x5'));var Redis=require(_0xf9f4('0x6'));var htmlToText=require(_0xf9f4('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0xf9f4('0x8'))(_0xf9f4('0x9'));var interaction_log=require(_0xf9f4('0x8'))(_0xf9f4('0xa'));var config=require(_0xf9f4('0xb'));var db=require(_0xf9f4('0xc'))['db'];config[_0xf9f4('0xd')]=_[_0xf9f4('0xe')](config[_0xf9f4('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf9f4('0xf'))(new Redis(config[_0xf9f4('0xd')]));var htmlEntities=require(_0xf9f4('0x10'));require(_0xf9f4('0x11'))[_0xf9f4('0x12')](socket);var jayson=require(_0xf9f4('0x13'));var client=jayson[_0xf9f4('0x14')][_0xf9f4('0x15')]({'port':0x232c});var client9003=jayson[_0xf9f4('0x14')][_0xf9f4('0x15')]({'port':0x232b});var client9002=jayson[_0xf9f4('0x14')][_0xf9f4('0x15')]({'port':0x232a});function respondWithRpcPromise(_0x36287f,_0x32f4c4,_0x4b6e7f,_0x52d278){return new BPromise(function(_0x42bb91,_0x4c148e){var _0x5646e5=_0x52d278||client;return _0x5646e5[_0xf9f4('0x16')](_0x36287f,_0x4b6e7f)[_0xf9f4('0x17')](function(_0x443066){logger['info'](_0xf9f4('0x18'),_0x32f4c4,_0xf9f4('0x19'));logger[_0xf9f4('0x1a')](_0xf9f4('0x1b'),_0x32f4c4,_0xf9f4('0x19'),JSON[_0xf9f4('0x1c')](_0x443066));if(_0x443066[_0xf9f4('0x1d')]){if(_0x443066[_0xf9f4('0x1d')]['code']===0x1f4){logger['error'](_0xf9f4('0x18'),_0x32f4c4,_0x443066['error'][_0xf9f4('0x1e')]);return _0x4c148e(_0x443066['error']['message']);}logger[_0xf9f4('0x1d')](_0xf9f4('0x18'),_0x32f4c4,_0x443066[_0xf9f4('0x1d')][_0xf9f4('0x1e')]);return _0x42bb91(_0x443066[_0xf9f4('0x1d')][_0xf9f4('0x1e')]);}else{logger[_0xf9f4('0x1f')](_0xf9f4('0x18'),_0x32f4c4,_0xf9f4('0x19'));_0x42bb91(_0x443066[_0xf9f4('0x20')][_0xf9f4('0x1e')]);}})[_0xf9f4('0x21')](function(_0x1f491b){logger[_0xf9f4('0x1d')]('MailMessage,\x20%s,\x20%s',_0x32f4c4,_0x1f491b);_0x4c148e(_0x1f491b);});});}function respondWithResult(_0x4cb323,_0x42fcd0){_0x42fcd0=_0x42fcd0||0xc8;return function(_0x3697a3){if(_0x3697a3){return _0x4cb323[_0xf9f4('0x22')](_0x42fcd0)[_0xf9f4('0x23')](_0x3697a3);}};}function respondWithFilteredResult(_0x3767af,_0x555f50){return function(_0x1575e7){if(_0x1575e7){var _0x5799df=typeof _0x555f50[_0xf9f4('0x24')]===_0xf9f4('0x25')&&typeof _0x555f50[_0xf9f4('0x26')]==='undefined';var _0xa9eddc=_0x1575e7[_0xf9f4('0x27')];var _0x202bef=_0x5799df?0x0:_0x555f50['offset'];var _0x443d05=_0x5799df?_0x1575e7[_0xf9f4('0x27')]:_0x555f50['offset']+_0x555f50[_0xf9f4('0x26')];var _0x11455c;if(_0x443d05>=_0xa9eddc){_0x443d05=_0xa9eddc;_0x11455c=0xc8;}else{_0x11455c=0xce;}_0x3767af[_0xf9f4('0x22')](_0x11455c);return _0x3767af['set'](_0xf9f4('0x28'),_0x202bef+'-'+_0x443d05+'/'+_0xa9eddc)[_0xf9f4('0x23')](_0x1575e7);}return null;};}function saveUpdates(_0x4b8134){return function(_0x46e3b4){if(_0x46e3b4){return _0x46e3b4['update'](_0x4b8134)[_0xf9f4('0x17')](function(_0x2f4493){return _0x2f4493;});}return null;};}function removeEntity(_0x14ef7f){return function(_0xc11c28){if(_0xc11c28){return _0xc11c28['destroy']()[_0xf9f4('0x17')](function(){_0x14ef7f[_0xf9f4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x137281){return function(_0x1a05e2){if(!_0x1a05e2){_0x137281['sendStatus'](0x194);}return _0x1a05e2;};}function handleError(_0x42ebf3,_0x39c0e1){_0x39c0e1=_0x39c0e1||0x1f4;return function(_0x38704b){logger[_0xf9f4('0x1d')](_0x38704b[_0xf9f4('0x29')]);if(_0x38704b[_0xf9f4('0x2a')]){delete _0x38704b[_0xf9f4('0x2a')];}_0x42ebf3[_0xf9f4('0x22')](_0x39c0e1)[_0xf9f4('0x2b')](_0x38704b);};}exports[_0xf9f4('0x2c')]=function(_0x37716c,_0x260d5b){var _0xcea1e0={},_0x4a3448={},_0x4158ad={'count':0x0,'rows':[]};var _0x3d7e74=_[_0xf9f4('0x2d')](db[_0xf9f4('0x2e')][_0xf9f4('0x2f')],function(_0x4c4b2c){return{'name':_0x4c4b2c[_0xf9f4('0x30')],'type':_0x4c4b2c[_0xf9f4('0x31')][_0xf9f4('0x32')]};});_0x4a3448['model']=_[_0xf9f4('0x2d')](_0x3d7e74,_0xf9f4('0x2a'));_0x4a3448['query']=_[_0xf9f4('0x33')](_0x37716c[_0xf9f4('0x34')]);_0x4a3448[_0xf9f4('0x35')]=_[_0xf9f4('0x36')](_0x4a3448[_0xf9f4('0x37')],_0x4a3448[_0xf9f4('0x34')]);_0xcea1e0['attributes']=_[_0xf9f4('0x36')](_0x4a3448[_0xf9f4('0x37')],qs[_0xf9f4('0x38')](_0x37716c[_0xf9f4('0x34')][_0xf9f4('0x38')]));_0xcea1e0[_0xf9f4('0x39')]=_0xcea1e0['attributes']['length']?_0xcea1e0[_0xf9f4('0x39')]:_0x4a3448[_0xf9f4('0x37')];if(!_0x37716c[_0xf9f4('0x34')][_0xf9f4('0x3a')]('nolimit')){_0xcea1e0[_0xf9f4('0x26')]=qs['limit'](_0x37716c['query']['limit']);_0xcea1e0[_0xf9f4('0x24')]=qs['offset'](_0x37716c[_0xf9f4('0x34')][_0xf9f4('0x24')]);}_0xcea1e0[_0xf9f4('0x3b')]=qs[_0xf9f4('0x3c')](_0x37716c[_0xf9f4('0x34')][_0xf9f4('0x3c')]);_0xcea1e0[_0xf9f4('0x3d')]=qs[_0xf9f4('0x35')](_[_0xf9f4('0x3e')](_0x37716c[_0xf9f4('0x34')],_0x4a3448[_0xf9f4('0x35')]),_0x3d7e74);if(_0x37716c[_0xf9f4('0x34')][_0xf9f4('0x3f')]){_0xcea1e0[_0xf9f4('0x3d')]=_[_0xf9f4('0x40')](_0xcea1e0[_0xf9f4('0x3d')],{'$or':_[_0xf9f4('0x2d')](_0x3d7e74,function(_0x11b45c){if(_0x11b45c[_0xf9f4('0x31')]!==_0xf9f4('0x41')){var _0x434487={};_0x434487[_0x11b45c['name']]={'$like':'%'+_0x37716c['query'][_0xf9f4('0x3f')]+'%'};return _0x434487;}})});}_0xcea1e0=_[_0xf9f4('0x40')]({},_0xcea1e0,_0x37716c[_0xf9f4('0x42')]);var _0x489ff2={'where':_0xcea1e0[_0xf9f4('0x3d')]};return db[_0xf9f4('0x2e')][_0xf9f4('0x27')](_0x489ff2)[_0xf9f4('0x17')](function(_0x34049f){_0x4158ad[_0xf9f4('0x27')]=_0x34049f;if(_0x37716c[_0xf9f4('0x34')]['includeAll']){_0xcea1e0[_0xf9f4('0x43')]=[{'all':!![]}];}return db[_0xf9f4('0x2e')][_0xf9f4('0x44')](_0xcea1e0);})[_0xf9f4('0x17')](function(_0x21c64c){_0x4158ad['rows']=_0x21c64c;return _0x4158ad;})['then'](respondWithFilteredResult(_0x260d5b,_0xcea1e0))[_0xf9f4('0x21')](handleError(_0x260d5b,null));};exports[_0xf9f4('0x45')]=function(_0x3adf75,_0x692cc6){var _0x325043={'raw':!![],'where':{'id':_0x3adf75['params']['id']}},_0x1cbbd0={};_0x1cbbd0[_0xf9f4('0x37')]=_['keys'](db[_0xf9f4('0x2e')][_0xf9f4('0x2f')]);_0x1cbbd0[_0xf9f4('0x34')]=_[_0xf9f4('0x33')](_0x3adf75[_0xf9f4('0x34')]);_0x1cbbd0[_0xf9f4('0x35')]=_[_0xf9f4('0x36')](_0x1cbbd0[_0xf9f4('0x37')],_0x1cbbd0[_0xf9f4('0x34')]);_0x325043[_0xf9f4('0x39')]=_['intersection'](_0x1cbbd0[_0xf9f4('0x37')],qs[_0xf9f4('0x38')](_0x3adf75[_0xf9f4('0x34')][_0xf9f4('0x38')]));_0x325043[_0xf9f4('0x39')]=_0x325043[_0xf9f4('0x39')][_0xf9f4('0x46')]?_0x325043[_0xf9f4('0x39')]:_0x1cbbd0[_0xf9f4('0x37')];if(_0x3adf75[_0xf9f4('0x34')][_0xf9f4('0x47')]){_0x325043[_0xf9f4('0x43')]=[{'all':!![]}];}_0x325043=_[_0xf9f4('0x40')]({},_0x325043,_0x3adf75[_0xf9f4('0x42')]);return db[_0xf9f4('0x2e')][_0xf9f4('0x48')](_0x325043)[_0xf9f4('0x17')](handleEntityNotFound(_0x692cc6,null))[_0xf9f4('0x17')](respondWithResult(_0x692cc6,null))[_0xf9f4('0x21')](handleError(_0x692cc6,null));};exports[_0xf9f4('0x49')]=function(_0x511391,_0xefb103){if(_0x511391[_0xf9f4('0x4a')]['id']){delete _0x511391[_0xf9f4('0x4a')]['id'];}return db[_0xf9f4('0x2e')][_0xf9f4('0x48')]({'where':{'id':_0x511391['params']['id']}})[_0xf9f4('0x17')](handleEntityNotFound(_0xefb103,null))[_0xf9f4('0x17')](saveUpdates(_0x511391[_0xf9f4('0x4a')],null))[_0xf9f4('0x17')](respondWithResult(_0xefb103,null))['catch'](handleError(_0xefb103,null));};exports['destroy']=function(_0x2616a8,_0x3f2a20){return db[_0xf9f4('0x2e')]['find']({'where':{'id':_0x2616a8['params']['id']}})[_0xf9f4('0x17')](handleEntityNotFound(_0x3f2a20,null))[_0xf9f4('0x17')](removeEntity(_0x3f2a20,null))['catch'](handleError(_0x3f2a20,null));};exports[_0xf9f4('0x4b')]=function(_0x52eb67,_0x53f544){return db[_0xf9f4('0x2e')]['describe']()[_0xf9f4('0x17')](respondWithResult(_0x53f544,null))[_0xf9f4('0x21')](handleError(_0x53f544,null));};exports[_0xf9f4('0x4c')]=function(_0x1e3f07,_0x48efb7){return db[_0xf9f4('0x2e')]['create'](_0x1e3f07[_0xf9f4('0x4a')])[_0xf9f4('0x17')](function(_0x3a4f59){if(_0x3a4f59){if(_0x3a4f59[_0xf9f4('0x4d')]===_0xf9f4('0x4e')&&!_0x3a4f59[_0xf9f4('0x4f')]){var _0x31f7c6,_0x4c353d,_0xe87676;if(_0x1e3f07[_0xf9f4('0x4a')]['to']){_0x4c353d=_0x1e3f07[_0xf9f4('0x4a')]['to'][_0xf9f4('0x50')](',')[0x0];}return db[_0xf9f4('0x51')][_0xf9f4('0x52')]({'where':{'id':_0x3a4f59[_0xf9f4('0x53')]},'include':[{'model':db[_0xf9f4('0x54')],'as':_0xf9f4('0x55'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x4c353d},'limit':0x1,'order':[[_0xf9f4('0x56'),'DESC']]}]},{'model':db[_0xf9f4('0x57')],'as':'Smtp','raw':!![]}]})[_0xf9f4('0x17')](function(_0x3ef596){_0x31f7c6=_0x3ef596;if(_0x31f7c6&&_0x31f7c6[_0xf9f4('0x58')]){var _0x17a5dd={'tls':{'rejectUnauthorized':![]}};if(_[_0xf9f4('0x59')](_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5a')])){_0x17a5dd[_0xf9f4('0x5b')]=_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5b')];_0x17a5dd['port']=_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5c')];_0x17a5dd[_0xf9f4('0x5d')]=_0x31f7c6[_0xf9f4('0x58')]['secure'];if(_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5e')]){_0x17a5dd[_0xf9f4('0x5f')]={'user':_0x31f7c6['Smtp'][_0xf9f4('0x60')],'pass':_0x31f7c6[_0xf9f4('0x58')]['pass']};}}else{_0x17a5dd[_0xf9f4('0x5a')]=_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5a')];_0x17a5dd[_0xf9f4('0x5f')]={'user':_0x31f7c6[_0xf9f4('0x58')]['user'],'pass':_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x61')]};_0x17a5dd[_0xf9f4('0x5d')]=_0x31f7c6[_0xf9f4('0x58')][_0xf9f4('0x5d')];}if(_0x1e3f07['body'][_0xf9f4('0x62')]&&_0x1e3f07[_0xf9f4('0x4a')][_0xf9f4('0x62')]['length']){for(var _0x2a2f99=0x0;_0x2a2f99<_0x1e3f07[_0xf9f4('0x4a')][_0xf9f4('0x62')][_0xf9f4('0x46')];_0x2a2f99+=0x1){_0x1e3f07[_0xf9f4('0x4a')][_0xf9f4('0x62')][_0x2a2f99]={'filename':_0x1e3f07[_0xf9f4('0x4a')]['attachments'][_0x2a2f99][_0xf9f4('0x2a')],'path':path[_0xf9f4('0x63')](config[_0xf9f4('0x64')],_0xf9f4('0x65'),_0x1e3f07['body']['attachments'][_0x2a2f99][_0xf9f4('0x66')])};}}_0xe87676={'account':_0x17a5dd,'message':_0x1e3f07[_0xf9f4('0x4a')]};return;}})[_0xf9f4('0x17')](function(){if(_0x31f7c6[_0xf9f4('0x55')]){if(_0x31f7c6[_0xf9f4('0x55')][_0xf9f4('0x67')]['length']){return _0x31f7c6[_0xf9f4('0x55')]['Contacts'][0x0];}else{return db[_0xf9f4('0x68')][_0xf9f4('0x4c')](_[_0xf9f4('0xe')](_0x1e3f07[_0xf9f4('0x4a')],{'firstName':_0x1e3f07[_0xf9f4('0x4a')]['to'],'email':_0x1e3f07[_0xf9f4('0x4a')]['to'],'phone':_0x1e3f07[_0xf9f4('0x4a')]['to'],'ListId':_0x31f7c6['ListId']}));}}else{throw new Error('List\x20not\x20found');}})[_0xf9f4('0x17')](function(){if(_0xe87676){return respondWithRpcPromise(_0xf9f4('0x69'),'sendMail',_0xe87676,client9003)[_0xf9f4('0x17')](function(_0x286e27){return _0x3a4f59[_0xf9f4('0x49')]({'read':!![],'messageId':_0x286e27[_0xf9f4('0x6a')],'sentAt':moment()[_0xf9f4('0x6b')](_0xf9f4('0x6c'))});})[_0xf9f4('0x21')](function(_0x8d77f9){logger[_0xf9f4('0x1d')]('%s',JSON[_0xf9f4('0x1c')](_0x8d77f9));return _0x3a4f59;});}return _0x3a4f59;});}return _0x3a4f59;}})[_0xf9f4('0x17')](respondWithResult(_0x48efb7,0xc9))[_0xf9f4('0x21')](handleError(_0x48efb7,null));};exports[_0xf9f4('0x6d')]=function(_0x17ad5e,_0x432be3){var _0x39b1aa={'agent':{},'channel':'mail'};if(_0x17ad5e[_0xf9f4('0x4a')]['id']){delete _0x17ad5e[_0xf9f4('0x4a')]['id'];}_0x17ad5e[_0xf9f4('0x4a')][_0xf9f4('0x6e')]=!![];_0x17ad5e[_0xf9f4('0x4a')][_0xf9f4('0x6f')]=moment()['format'](_0xf9f4('0x6c'));_0x17ad5e[_0xf9f4('0x4a')]['UserId']=_0x17ad5e['body'][_0xf9f4('0x70')]||_0x17ad5e[_0xf9f4('0x60')]['id'];_0x39b1aa[_0xf9f4('0x71')]['id']=_0x17ad5e[_0xf9f4('0x4a')][_0xf9f4('0x70')];return db[_0xf9f4('0x2e')][_0xf9f4('0x48')]({'where':{'id':_0x17ad5e[_0xf9f4('0x72')]['id'],'UserId':null}})[_0xf9f4('0x17')](handleEntityNotFound(_0x432be3,null))[_0xf9f4('0x17')](saveUpdates(_0x17ad5e['body'],null))[_0xf9f4('0x17')](function(_0x4544c1){if(_0x4544c1){_0x39b1aa['message']=_0x4544c1[_0xf9f4('0x73')]({'plain':!![]});return db[_0xf9f4('0x74')][_0xf9f4('0x48')]({'where':{'id':_0x4544c1[_0xf9f4('0x75')]}});}return null;})[_0xf9f4('0x17')](handleEntityNotFound(_0x432be3,null))[_0xf9f4('0x17')](function(_0x585a12){if(_0x585a12){return _0x585a12['update']({'UserId':_0x17ad5e[_0xf9f4('0x4a')][_0xf9f4('0x70')],'read1stAt':_[_0xf9f4('0x59')](_0x585a12['read1stAt'])?moment()[_0xf9f4('0x6b')](_0xf9f4('0x6c')):undefined});}return null;})[_0xf9f4('0x17')](function(_0x32ac64){if(_0x32ac64){_0x39b1aa[_0xf9f4('0x76')]=_0x32ac64[_0xf9f4('0x73')]({'plain':!![]});interaction_log[_0xf9f4('0x1f')](_0xf9f4('0x77'),_0x17ad5e[_0xf9f4('0x60')]['id'],_0x17ad5e[_0xf9f4('0x60')][_0xf9f4('0x2a')],_0x17ad5e[_0xf9f4('0x60')]['role'],_0x39b1aa[_0xf9f4('0x76')]['id'],_0x17ad5e['body']?JSON['stringify'](_0x17ad5e[_0xf9f4('0x4a')]):_0xf9f4('0x78'));return respondWithRpcPromise(_0xf9f4('0x79'),_0xf9f4('0x7a'),_0x39b1aa);}return null;})[_0xf9f4('0x17')](function(_0x302ef1){var _0x12e859=_0xf9f4('0x7b')+_0x302ef1['message'][_0xf9f4('0x7c')];return db['sequelize'][_0xf9f4('0x34')](_0x12e859,{'type':db[_0xf9f4('0x7d')]['QueryTypes'][_0xf9f4('0x7e')],'raw':!![]})[_0xf9f4('0x17')](function(_0x1ff44b){return _0x1ff44b;});})[_0xf9f4('0x17')](function(_0x8c293d){if(_0x8c293d){_0x39b1aa[_0xf9f4('0x1e')][_0xf9f4('0x7f')]=_0x8c293d[0x0];if(!_0x17ad5e['body'][_0xf9f4('0x70')])return;return db[_0xf9f4('0x80')]['find']({'where':{'id':_0x17ad5e[_0xf9f4('0x4a')]['UserId'],'role':_0xf9f4('0x71')},'attributes':['id',_0xf9f4('0x2a'),_0xf9f4('0x81'),_0xf9f4('0x82'),'internal'],'raw':!![]});}return null;})['then'](function(_0xbec79d){if(!_0xbec79d)return null;_0x39b1aa[_0xf9f4('0x1e')][_0xf9f4('0x71')]=_0xbec79d;return _0x39b1aa;})[_0xf9f4('0x17')](function(_0x1e060d){if(_0x1e060d){if(_0x17ad5e[_0xf9f4('0x4a')]['manual']){_0x39b1aa[_0xf9f4('0x1e')][_0xf9f4('0x83')]=util[_0xf9f4('0x6b')](_0xf9f4('0x84'),_0x17ad5e[_0xf9f4('0x60')][_0xf9f4('0x2a')]);_0x39b1aa[_0xf9f4('0x1e')][_0xf9f4('0x85')]=_0x39b1aa[_0xf9f4('0x85')];_0x39b1aa['message']['motionChannel']=_0x39b1aa[_0xf9f4('0x85')];_0x39b1aa['message'][_0xf9f4('0x86')]=_0xf9f4('0x6d');_0x39b1aa[_0xf9f4('0x1e')][_0xf9f4('0x4a')]=htmlToText[_0xf9f4('0x87')](_0x39b1aa['message'][_0xf9f4('0x4a')]);return respondWithRpcPromise(_0xf9f4('0x88'),_0xf9f4('0x88'),{'event':_0xf9f4('0x89'),'message':_0x39b1aa['message']},client9002)[_0xf9f4('0x17')](function(){return _0x39b1aa;});}return _0x39b1aa;}return null;})[_0xf9f4('0x17')](respondWithResult(_0x432be3,null))[_0xf9f4('0x21')](handleError(_0x432be3,null));};exports[_0xf9f4('0x8a')]=function(_0x4f4207,_0x35f0e6){var _0x360981={'agent':{},'channel':_0xf9f4('0x8b')};if(_0x4f4207[_0xf9f4('0x4a')]['id']){delete _0x4f4207[_0xf9f4('0x4a')]['id'];}_0x4f4207[_0xf9f4('0x4a')][_0xf9f4('0x70')]=_0x4f4207[_0xf9f4('0x4a')][_0xf9f4('0x70')]||_0x4f4207[_0xf9f4('0x60')]['id'];_0x360981['agent']['id']=_0x4f4207['body'][_0xf9f4('0x70')];return db[_0xf9f4('0x2e')][_0xf9f4('0x48')]({'where':{'id':_0x4f4207[_0xf9f4('0x72')]['id'],'UserId':null}})[_0xf9f4('0x17')](handleEntityNotFound(_0x35f0e6,null))[_0xf9f4('0x17')](function(_0x350d11){if(_0x350d11){_0x360981[_0xf9f4('0x1e')]=_0x350d11['get']({'plain':!![]});return db[_0xf9f4('0x74')][_0xf9f4('0x48')]({'where':{'id':_0x350d11[_0xf9f4('0x75')]}});}return null;})[_0xf9f4('0x17')](handleEntityNotFound(_0x35f0e6,null))['then'](function(_0x190f2f){if(_0x190f2f){_0x360981[_0xf9f4('0x76')]=_0x190f2f['get']({'plain':!![]});interaction_log[_0xf9f4('0x1f')](_0xf9f4('0x8c'),_0x4f4207[_0xf9f4('0x60')]['id'],_0x4f4207['user'][_0xf9f4('0x2a')],_0x4f4207['user'][_0xf9f4('0x8d')],_0x360981[_0xf9f4('0x76')]['id'],_0x4f4207[_0xf9f4('0x4a')]?JSON[_0xf9f4('0x1c')](_0x4f4207['body']):_0xf9f4('0x78'));return respondWithRpcPromise(_0xf9f4('0x8e'),_0xf9f4('0x8f'),_0x360981);}return null;})[_0xf9f4('0x17')](function(_0x48fadd){var _0x276722=_0xf9f4('0x7b')+_0x48fadd[_0xf9f4('0x1e')][_0xf9f4('0x7c')];return db['sequelize'][_0xf9f4('0x34')](_0x276722,{'type':db[_0xf9f4('0x7d')]['QueryTypes'][_0xf9f4('0x7e')],'raw':!![]})[_0xf9f4('0x17')](function(_0x27f099){return _0x27f099;});})[_0xf9f4('0x17')](function(_0x51e977){if(_0x51e977){_0x360981[_0xf9f4('0x1e')][_0xf9f4('0x7f')]=_0x51e977[0x0];if(!_0x4f4207[_0xf9f4('0x4a')]['UserId'])return;return db[_0xf9f4('0x80')]['find']({'where':{'id':_0x4f4207[_0xf9f4('0x4a')][_0xf9f4('0x70')],'role':_0xf9f4('0x71')},'attributes':['id',_0xf9f4('0x2a'),_0xf9f4('0x81'),'email',_0xf9f4('0x90')],'raw':!![]});}return null;})[_0xf9f4('0x17')](function(_0x2fe25d){if(!_0x2fe25d)return null;_0x360981['message'][_0xf9f4('0x71')]=_0x2fe25d;return _0x360981;})[_0xf9f4('0x17')](function(_0x59646a){if(_0x59646a){_0x59646a['message']['interface']=util['format'](_0xf9f4('0x84'),_0x4f4207[_0xf9f4('0x60')][_0xf9f4('0x2a')]);_0x59646a['message'][_0xf9f4('0x85')]=_0x360981[_0xf9f4('0x85')];_0x59646a['message']['motionChannel']=_0x360981[_0xf9f4('0x85')];_0x59646a[_0xf9f4('0x1e')][_0xf9f4('0x86')]='reject';_0x59646a[_0xf9f4('0x1e')]['body']=htmlToText[_0xf9f4('0x87')](_0x360981[_0xf9f4('0x1e')][_0xf9f4('0x4a')]);respondWithRpcPromise(_0xf9f4('0x88'),_0xf9f4('0x88'),{'event':_0xf9f4('0x91'),'message':_0x59646a['message']},client9002);return _0x360981;}return null;})[_0xf9f4('0x17')](respondWithResult(_0x35f0e6,null))[_0xf9f4('0x21')](handleError(_0x35f0e6,null));};exports['download']=function(_0xd6fa2e,_0x4f0896){var _0x46398b=moment()[_0xf9f4('0x92')]()[_0xf9f4('0x93')]();var _0x37b744=path[_0xf9f4('0x63')](config[_0xf9f4('0x64')],'server','files',_0xf9f4('0x94'));var _0x72efb1=path[_0xf9f4('0x63')](config[_0xf9f4('0x64')],_0xf9f4('0x95'),_0xf9f4('0x96'),'attachments');var _0x36f525=util[_0xf9f4('0x6b')](_0xf9f4('0x97'),_0x46398b);return db[_0xf9f4('0x2e')][_0xf9f4('0x48')]({'where':{'id':_0xd6fa2e['params']['id']},'attributes':['id','body',_0xf9f4('0x98'),'to','cc','bcc',_0xf9f4('0x99'),_0xf9f4('0x9a')],'include':_0xd6fa2e['query'][_0xf9f4('0x62')]?[{'model':db[_0xf9f4('0x9b')],'as':_0xf9f4('0x9c')}]:undefined})[_0xf9f4('0x17')](handleEntityNotFound(_0x4f0896,null))[_0xf9f4('0x17')](function(_0x53669e){if(_0x53669e){var _0x48d7ee=_0x53669e;var _0x476402={'from':_0x48d7ee[_0xf9f4('0x98')],'to':_0x48d7ee['to'],'subject':_0x48d7ee['subject'],'html':htmlEntities[_0xf9f4('0x9d')](_0x48d7ee[_0xf9f4('0x4a')]),'headers':{'Date':moment(_0x48d7ee[_0xf9f4('0x9a')])['format'](_0xf9f4('0x9e'))},'attachments':[]};if(_0x53669e['cc']){_0x476402[_0xf9f4('0x9f')]['Cc']=_0x53669e['cc'];}if(_0x53669e[_0xf9f4('0xa0')]){_0x476402['headers'][_0xf9f4('0xa1')]=_0x53669e[_0xf9f4('0xa0')];}return new BPromise(function(_0x5a5941,_0x55912c){if(_0x53669e[_0xf9f4('0x9c')]){for(var _0x4c8b39=0x0;_0x4c8b39<_0x53669e[_0xf9f4('0x9c')][_0xf9f4('0x46')];_0x4c8b39++){var _0x5b4a30=_0x53669e[_0xf9f4('0x9c')][_0x4c8b39];var _0x2e9628=path[_0xf9f4('0x63')](_0x72efb1,_0x5b4a30[_0xf9f4('0x66')]);if(fs[_0xf9f4('0xa2')](_0x2e9628)){_0x476402[_0xf9f4('0x62')]['push']({'name':_0x5b4a30['name'],'contentType':_0x5b4a30['type'],'data':fs[_0xf9f4('0xa3')](_0x2e9628)});}}}emlformat[_0xf9f4('0xa4')](_0x476402,function(_0x7857cc,_0x25eb30){if(_0x7857cc)return _0x55912c(_0x7857cc);fs['writeFileSync'](path[_0xf9f4('0x63')](_0x37b744,_0x36f525),_0x25eb30);return _0x5a5941(_0x25eb30);});});}})[_0xf9f4('0x17')](function(_0x11c03f){if(_0x11c03f){return _0x4f0896['download'](path[_0xf9f4('0x63')](_0x37b744,_0x36f525),_0x36f525,function(_0x34ae95){if(!_0x34ae95)fs[_0xf9f4('0xa5')](path[_0xf9f4('0x63')](_0x37b744,_0x36f525));});}})[_0xf9f4('0x21')](handleError(_0x4f0896,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d394ea9..ea3589b 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 _0xdb19=['save','update','emit','hasOwnProperty','hook','events','../../mysqldb','MailMessage','setMaxListeners'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xdb19,0x7a));var _0x9db1=function(_0x10518a,_0x3fa238){_0x10518a=_0x10518a-0x0;var _0x4b9144=_0xdb19[_0x10518a];return _0x4b9144;};'use strict';var EventEmitter=require(_0x9db1('0x0'));var MailMessage=require(_0x9db1('0x1'))['db'][_0x9db1('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x9db1('0x3')](0x0);var events={'afterCreate':_0x9db1('0x4'),'afterUpdate':_0x9db1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x54c336){return function(_0x3a1f08,_0x3af8e8,_0x458909){MailMessageEvents['emit'](_0x54c336+':'+_0x3a1f08['id'],_0x3a1f08);MailMessageEvents[_0x9db1('0x6')](_0x54c336,_0x3a1f08);_0x458909(null);};}for(var e in events){if(events[_0x9db1('0x7')](e)){var event=events[e];MailMessage[_0x9db1('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0x23a9=['remove','emit','hasOwnProperty','hook','exports','events','MailMessage','setMaxListeners','save','update'];(function(_0x48b359,_0xad97bc){var _0x4aa0c0=function(_0x53a78c){while(--_0x53a78c){_0x48b359['push'](_0x48b359['shift']());}};_0x4aa0c0(++_0xad97bc);}(_0x23a9,0x159));var _0x923a=function(_0x10ffe9,_0x25d4ea){_0x10ffe9=_0x10ffe9-0x0;var _0x432ffc=_0x23a9[_0x10ffe9];return _0x432ffc;};'use strict';var EventEmitter=require(_0x923a('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x923a('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x923a('0x2')](0x0);var events={'afterCreate':_0x923a('0x3'),'afterUpdate':_0x923a('0x4'),'afterDestroy':_0x923a('0x5')};function emitEvent(_0x42b13c){return function(_0x3e38ff,_0x18e09a,_0x201313){MailMessageEvents[_0x923a('0x6')](_0x42b13c+':'+_0x3e38ff['id'],_0x3e38ff);MailMessageEvents[_0x923a('0x6')](_0x42b13c,_0x3e38ff);_0x201313(null);};}for(var e in events){if(events[_0x923a('0x7')](e)){var event=events[e];MailMessage[_0x923a('0x8')](e,emitEvent(event));}}module[_0x923a('0x9')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 3c058a1..7c38656 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 _0x61da=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','body','fromString','models','get','direction','out','secret','isNil','UserId','MailInteraction','MailInteractionId','then','update','createdAt','toLowerCase','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports','define'];(function(_0x30cd66,_0xb386c2){var _0x2a5c89=function(_0x184384){while(--_0x184384){_0x30cd66['push'](_0x30cd66['shift']());}};_0x2a5c89(++_0xb386c2);}(_0x61da,0x1bc));var _0xa61d=function(_0x3ae214,_0x2b19b6){_0x3ae214=_0x3ae214-0x0;var _0x4e0967=_0x61da[_0x3ae214];return _0x4e0967;};'use strict';var _=require(_0xa61d('0x0'));var util=require('util');var logger=require(_0xa61d('0x1'))(_0xa61d('0x2'));var moment=require(_0xa61d('0x3'));var BPromise=require(_0xa61d('0x4'));var rp=require(_0xa61d('0x5'));var htmlToText=require(_0xa61d('0x6'));var fs=require('fs');var path=require(_0xa61d('0x7'));var rimraf=require('rimraf');var config=require(_0xa61d('0x8'));var attributes=require(_0xa61d('0x9'));module[_0xa61d('0xa')]=function(_0x1fd704,_0x2d0356){return _0x1fd704[_0xa61d('0xb')](_0xa61d('0xc'),attributes,{'tableName':_0xa61d('0xd'),'paranoid':![],'indexes':[{'name':_0xa61d('0xe'),'fields':[_0xa61d('0xe')]},{'name':_0xa61d('0xf'),'fields':[_0xa61d('0x10'),_0xa61d('0x11')],'type':_0xa61d('0x12')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x175981,_0xe80a69,_0x2b88d0){if(_0x175981[_0xa61d('0x13')]){_0x175981[_0xa61d('0x10')]=htmlToText[_0xa61d('0x14')](_0x175981[_0xa61d('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x2b88d0(null,_0xe80a69);},'afterCreate':function(_0x479650,_0x1192f9,_0x25956d){var _0x1f3f02=_0x1fd704[_0xa61d('0x15')];var _0x36c178=_0x479650[_0xa61d('0x16')]({'plain':!![]});if(_0x36c178['direction']['toLowerCase']()==='in'||_0x36c178[_0xa61d('0x17')]['toLowerCase']()===_0xa61d('0x18')&&!_0x36c178[_0xa61d('0x19')]&&!_[_0xa61d('0x1a')](_0x36c178[_0xa61d('0x1b')])){_0x1f3f02[_0xa61d('0x1c')]['findOne']({'where':{'id':_0x36c178[_0xa61d('0x1d')]}})[_0xa61d('0x1e')](function(_0x4ea6d9){if(_0x4ea6d9){_0x4ea6d9[_0xa61d('0x1f')]({'lastMsgAt':_0x36c178[_0xa61d('0x20')],'lastMsgDirection':_0x36c178[_0xa61d('0x17')][_0xa61d('0x21')]()});}})[_0xa61d('0x22')](function(_0x5e5502){console[_0xa61d('0x23')](_0x5e5502);});}_0x25956d();}},'charset':_0xa61d('0x24'),'collate':_0xa61d('0x25')});}; \ No newline at end of file +var _0x9367=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','define','MailMessage','messageId','plainBody','subject','FULLTEXT','fromString','models','get','toLowerCase','out','MailInteraction','findOne','MailInteractionId','then','update','direction','catch','error','utf8mb4'];(function(_0x5e476a,_0x407b43){var _0x46c9cc=function(_0x4690c4){while(--_0x4690c4){_0x5e476a['push'](_0x5e476a['shift']());}};_0x46c9cc(++_0x407b43);}(_0x9367,0x12a));var _0x7936=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9367[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7936('0x0'));var util=require(_0x7936('0x1'));var logger=require(_0x7936('0x2'))(_0x7936('0x3'));var moment=require(_0x7936('0x4'));var BPromise=require('bluebird');var rp=require(_0x7936('0x5'));var htmlToText=require(_0x7936('0x6'));var fs=require('fs');var path=require(_0x7936('0x7'));var rimraf=require(_0x7936('0x8'));var config=require(_0x7936('0x9'));var attributes=require(_0x7936('0xa'));module[_0x7936('0xb')]=function(_0x1fb2e1,_0x54d066){return _0x1fb2e1[_0x7936('0xc')](_0x7936('0xd'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x7936('0xe')]},{'name':'fti_mail_messages','fields':[_0x7936('0xf'),_0x7936('0x10')],'type':_0x7936('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3ec933,_0xce26a7,_0x45b5ee){if(_0x3ec933['body']){_0x3ec933[_0x7936('0xf')]=htmlToText[_0x7936('0x12')](_0x3ec933['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x45b5ee(null,_0xce26a7);},'afterCreate':function(_0x48d5b5,_0x1d88c7,_0x448d41){var _0x586ffb=_0x1fb2e1[_0x7936('0x13')];var _0x590c84=_0x48d5b5[_0x7936('0x14')]({'plain':!![]});if(_0x590c84['direction'][_0x7936('0x15')]()==='in'||_0x590c84['direction'][_0x7936('0x15')]()===_0x7936('0x16')&&!_0x590c84['secret']&&!_['isNil'](_0x590c84['UserId'])){_0x586ffb[_0x7936('0x17')][_0x7936('0x18')]({'where':{'id':_0x590c84[_0x7936('0x19')]}})[_0x7936('0x1a')](function(_0x12f5f1){if(_0x12f5f1){_0x12f5f1[_0x7936('0x1b')]({'lastMsgAt':_0x590c84['createdAt'],'lastMsgDirection':_0x590c84[_0x7936('0x1c')][_0x7936('0x15')]()});}})[_0x7936('0x1d')](function(_0x3792a6){console[_0x7936('0x1e')](_0x3792a6);});}_0x448d41();}},'charset':_0x7936('0x1f'),'collate':_0x7936('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 1957885..d25b83d 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 _0x36ee=['catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./mailMessage.socket','register','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateMailMessage','MailMessage','create','body','options','debug'];(function(_0x1d9de0,_0x14ea8b){var _0x512147=function(_0x5294d4){while(--_0x5294d4){_0x1d9de0['push'](_0x1d9de0['shift']());}};_0x512147(++_0x14ea8b);}(_0x36ee,0xe8));var _0xe36e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x36ee[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe36e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe36e('0x1'));var fs=require('fs');var Redis=require(_0xe36e('0x2'));var db=require(_0xe36e('0x3'))['db'];var utils=require(_0xe36e('0x4'));var logger=require(_0xe36e('0x5'))(_0xe36e('0x6'));var config=require(_0xe36e('0x7'));var jayson=require(_0xe36e('0x8'));var client=jayson[_0xe36e('0x9')][_0xe36e('0xa')]({'port':0x232a});config[_0xe36e('0xb')]=_[_0xe36e('0xc')](config['redis'],{'host':_0xe36e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe36e('0xb')]));require(_0xe36e('0xe'))[_0xe36e('0xf')](socket);function respondWithRpcPromise(_0x47ce3a,_0xf119e4,_0x48981b){return new BPromise(function(_0x2e968d,_0x2133cf){return client[_0xe36e('0x10')](_0x47ce3a,_0x48981b)[_0xe36e('0x11')](function(_0xce0110){logger[_0xe36e('0x12')](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));logger['debug'](_0xe36e('0x15'),_0xf119e4,_0xe36e('0x14'),JSON[_0xe36e('0x16')](_0xce0110));if(_0xce0110[_0xe36e('0x17')]){if(_0xce0110['error'][_0xe36e('0x18')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2133cf(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}logger[_0xe36e('0x17')](_0xe36e('0x13'),_0xf119e4,_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);return _0x2e968d(_0xce0110[_0xe36e('0x17')][_0xe36e('0x19')]);}else{logger['info'](_0xe36e('0x13'),_0xf119e4,_0xe36e('0x14'));_0x2e968d(_0xce0110['result'][_0xe36e('0x19')]);}})['catch'](function(_0x471400){logger[_0xe36e('0x17')]('MailMessage,\x20%s,\x20%s',_0xf119e4,_0x471400);_0x2133cf(_0x471400);});});}exports[_0xe36e('0x1a')]=function(_0x6aa186){var _0x21efe7=this;return new Promise(function(_0x597331,_0x21e95e){return db[_0xe36e('0x1b')][_0xe36e('0x1c')](_0x6aa186[_0xe36e('0x1d')],{'raw':_0x6aa186[_0xe36e('0x1e')]?_0x6aa186[_0xe36e('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0xe36e('0x11')](function(_0x4f214a){logger[_0xe36e('0x12')](_0xe36e('0x1a'),_0x6aa186);logger[_0xe36e('0x1f')]('CreateMailMessage',_0x6aa186,JSON['stringify'](_0x4f214a));_0x597331(_0x4f214a);})[_0xe36e('0x20')](function(_0x10818d){logger[_0xe36e('0x17')](_0xe36e('0x1a'),_0x10818d[_0xe36e('0x19')],_0x6aa186);_0x21e95e(_0x21efe7[_0xe36e('0x17')](0x1f4,_0x10818d[_0xe36e('0x19')]));});});}; \ No newline at end of file +var _0xd824=['request\x20sent','stringify','error','code','message','MailMessage,\x20%s,\x20%s','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','then','info','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x41d729,_0x1dacdc){var _0x5197ea=function(_0x1c379b){while(--_0x1c379b){_0x41d729['push'](_0x41d729['shift']());}};_0x5197ea(++_0x1dacdc);}(_0xd824,0xc2));var _0x4d82=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xd824[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4d82('0x2'));var fs=require('fs');var Redis=require(_0x4d82('0x3'));var db=require(_0x4d82('0x4'))['db'];var utils=require(_0x4d82('0x5'));var logger=require(_0x4d82('0x6'))(_0x4d82('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4d82('0x8')]['http']({'port':0x232a});config['redis']=_[_0x4d82('0x9')](config[_0x4d82('0xa')],{'host':_0x4d82('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d82('0xa')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x580bbd,_0x27b777,_0x392f17){return new BPromise(function(_0x480c05,_0x318d1d){return client['request'](_0x580bbd,_0x392f17)[_0x4d82('0xc')](function(_0x303645){logger[_0x4d82('0xd')]('MailMessage,\x20%s,\x20%s',_0x27b777,'request\x20sent');logger[_0x4d82('0xe')](_0x4d82('0xf'),_0x27b777,_0x4d82('0x10'),JSON[_0x4d82('0x11')](_0x303645));if(_0x303645['error']){if(_0x303645[_0x4d82('0x12')][_0x4d82('0x13')]===0x1f4){logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')]['message']);return _0x318d1d(_0x303645[_0x4d82('0x12')]['message']);}logger[_0x4d82('0x12')]('MailMessage,\x20%s,\x20%s',_0x27b777,_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);return _0x480c05(_0x303645[_0x4d82('0x12')][_0x4d82('0x14')]);}else{logger[_0x4d82('0xd')](_0x4d82('0x15'),_0x27b777,_0x4d82('0x10'));_0x480c05(_0x303645[_0x4d82('0x16')][_0x4d82('0x14')]);}})['catch'](function(_0x2919b0){logger[_0x4d82('0x12')](_0x4d82('0x15'),_0x27b777,_0x2919b0);_0x318d1d(_0x2919b0);});});}exports[_0x4d82('0x17')]=function(_0xe6260){var _0xd5f47=this;return new Promise(function(_0x1a513d,_0x64669c){return db[_0x4d82('0x18')][_0x4d82('0x19')](_0xe6260[_0x4d82('0x1a')],{'raw':_0xe6260['options']?_0xe6260[_0x4d82('0x1b')][_0x4d82('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x1a419f){logger[_0x4d82('0xd')](_0x4d82('0x17'),_0xe6260);logger[_0x4d82('0xe')](_0x4d82('0x17'),_0xe6260,JSON[_0x4d82('0x11')](_0x1a419f));_0x1a513d(_0x1a419f);})[_0x4d82('0x1d')](function(_0x462258){logger[_0x4d82('0x12')](_0x4d82('0x17'),_0x462258[_0x4d82('0x14')],_0xe6260);_0x64669c(_0xd5f47[_0x4d82('0x12')](0x1f4,_0x462258[_0x4d82('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index dd070d2..8386388 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 _0xd38d=['./mailMessage.events','update','removeListener','register','length','mailMessage:'];(function(_0x3d627d,_0x1c4b6e){var _0x39aa67=function(_0x3de5dc){while(--_0x3de5dc){_0x3d627d['push'](_0x3d627d['shift']());}};_0x39aa67(++_0x1c4b6e);}(_0xd38d,0x150));var _0xdd38=function(_0x1233d2,_0x5416f4){_0x1233d2=_0x1233d2-0x0;var _0x22759e=_0xd38d[_0x1233d2];return _0x22759e;};'use strict';var MailMessageEvents=require(_0xdd38('0x0'));var events=['save','remove',_0xdd38('0x1')];function createListener(_0x2307df,_0x10db9e){return function(_0x260354){_0x10db9e['emit'](_0x2307df,_0x260354);};}function removeListener(_0x45d2ee,_0x5ce6e4){return function(){MailMessageEvents[_0xdd38('0x2')](_0x45d2ee,_0x5ce6e4);};}exports[_0xdd38('0x3')]=function(_0x3ad00e){for(var _0x22433e=0x0,_0x8e21cd=events[_0xdd38('0x4')];_0x22433e<_0x8e21cd;_0x22433e++){var _0x5c48eb=events[_0x22433e];var _0x2ced0=createListener(_0xdd38('0x5')+_0x5c48eb,_0x3ad00e);MailMessageEvents['on'](_0x5c48eb,_0x2ced0);}}; \ No newline at end of file +var _0xd3a6=['./mailMessage.events','remove','update','emit','register','length','mailMessage:'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0xd3a6,0x181));var _0x6d3a=function(_0x259caa,_0x3353ad){_0x259caa=_0x259caa-0x0;var _0x1e7795=_0xd3a6[_0x259caa];return _0x1e7795;};'use strict';var MailMessageEvents=require(_0x6d3a('0x0'));var events=['save',_0x6d3a('0x1'),_0x6d3a('0x2')];function createListener(_0xb4271d,_0x346a6a){return function(_0x51aacb){_0x346a6a[_0x6d3a('0x3')](_0xb4271d,_0x51aacb);};}function removeListener(_0x2f2e4d,_0x14b197){return function(){MailMessageEvents['removeListener'](_0x2f2e4d,_0x14b197);};}exports[_0x6d3a('0x4')]=function(_0x41951b){for(var _0x536a70=0x0,_0x92573=events[_0x6d3a('0x5')];_0x536a70<_0x92573;_0x536a70++){var _0x362fa3=events[_0x536a70];var _0x3775ba=createListener(_0x6d3a('0x6')+_0x362fa3,_0x41951b);MailMessageEvents['on'](_0x362fa3,_0x3775ba);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b13f653..2e395da 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 _0x5fa9=['update','destroy','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','/:id/teams','getTeams','getAgents','post','addTeams','/:id/users','addAgents','put'];(function(_0xfc2a55,_0x4ad9ac){var _0x26ce8d=function(_0x593122){while(--_0x593122){_0xfc2a55['push'](_0xfc2a55['shift']());}};_0x26ce8d(++_0x4ad9ac);}(_0x5fa9,0x186));var _0x95fa=function(_0x47cd7b,_0x5630af){_0x47cd7b=_0x47cd7b-0x0;var _0x3e6dbf=_0x5fa9[_0x47cd7b];return _0x3e6dbf;};'use strict';var multer=require(_0x95fa('0x0'));var util=require(_0x95fa('0x1'));var path=require(_0x95fa('0x2'));var timeout=require(_0x95fa('0x3'));var express=require(_0x95fa('0x4'));var router=express[_0x95fa('0x5')]();var fs_extra=require(_0x95fa('0x6'));var auth=require(_0x95fa('0x7'));var interaction=require(_0x95fa('0x8'));var config=require(_0x95fa('0x9'));var controller=require(_0x95fa('0xa'));router[_0x95fa('0xb')]('/',auth[_0x95fa('0xc')](),controller[_0x95fa('0xd')]);router['get'](_0x95fa('0xe'),auth[_0x95fa('0xc')](),controller[_0x95fa('0xf')]);router[_0x95fa('0xb')](_0x95fa('0x10'),auth[_0x95fa('0xc')](),controller['show']);router[_0x95fa('0xb')](_0x95fa('0x11'),auth[_0x95fa('0xc')](),controller['getMembers']);router[_0x95fa('0xb')](_0x95fa('0x12'),auth['isAuthenticated'](),controller[_0x95fa('0x13')]);router[_0x95fa('0xb')]('/:id/users',auth[_0x95fa('0xc')](),controller[_0x95fa('0x14')]);router[_0x95fa('0x15')]('/',auth[_0x95fa('0xc')](),controller['create']);router[_0x95fa('0x15')](_0x95fa('0x12'),auth[_0x95fa('0xc')](),controller[_0x95fa('0x16')]);router[_0x95fa('0x15')](_0x95fa('0x17'),auth[_0x95fa('0xc')](),controller[_0x95fa('0x18')]);router[_0x95fa('0x19')](_0x95fa('0x10'),auth[_0x95fa('0xc')](),controller[_0x95fa('0x1a')]);router['delete'](_0x95fa('0x10'),auth[_0x95fa('0xc')](),controller[_0x95fa('0x1b')]);router[_0x95fa('0x1c')](_0x95fa('0x12'),auth['isAuthenticated'](),controller[_0x95fa('0x1d')]);router[_0x95fa('0x1c')](_0x95fa('0x17'),auth[_0x95fa('0xc')](),controller[_0x95fa('0x1e')]);module[_0x95fa('0x1f')]=router; \ No newline at end of file +var _0x1e7a=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/members','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','/:id/teams','removeAgents'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x1e7a,0x1b3));var _0xa1e7=function(_0x50a4fc,_0x2a132c){_0x50a4fc=_0x50a4fc-0x0;var _0x1990f5=_0x1e7a[_0x50a4fc];return _0x1990f5;};'use strict';var multer=require(_0xa1e7('0x0'));var util=require(_0xa1e7('0x1'));var path=require(_0xa1e7('0x2'));var timeout=require(_0xa1e7('0x3'));var express=require(_0xa1e7('0x4'));var router=express[_0xa1e7('0x5')]();var fs_extra=require(_0xa1e7('0x6'));var auth=require(_0xa1e7('0x7'));var interaction=require(_0xa1e7('0x8'));var config=require('../../config/environment');var controller=require(_0xa1e7('0x9'));router[_0xa1e7('0xa')]('/',auth['isAuthenticated'](),controller[_0xa1e7('0xb')]);router[_0xa1e7('0xa')](_0xa1e7('0xc'),auth[_0xa1e7('0xd')](),controller[_0xa1e7('0xe')]);router[_0xa1e7('0xa')](_0xa1e7('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xa1e7('0xa')](_0xa1e7('0x10'),auth[_0xa1e7('0xd')](),controller['getMembers']);router['get']('/:id/teams',auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x11')]);router[_0xa1e7('0xa')](_0xa1e7('0x12'),auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x13')]);router[_0xa1e7('0x14')]('/',auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x15')]);router[_0xa1e7('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0xa1e7('0x16')]);router[_0xa1e7('0x14')](_0xa1e7('0x12'),auth['isAuthenticated'](),controller[_0xa1e7('0x17')]);router['put'](_0xa1e7('0xf'),auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x18')]);router[_0xa1e7('0x19')](_0xa1e7('0xf'),auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x1a')]);router[_0xa1e7('0x19')](_0xa1e7('0x1b'),auth[_0xa1e7('0xd')](),controller['removeTeams']);router[_0xa1e7('0x19')](_0xa1e7('0x12'),auth[_0xa1e7('0xd')](),controller[_0xa1e7('0x1c')]);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 c06c58f..1e6bbb0 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 _0xf0bd=['sequelize','exports','STRING','name','ENUM','rrmemory','roundrobin'];(function(_0x182d6e,_0x373aaf){var _0x250f67=function(_0x36b2fe){while(--_0x36b2fe){_0x182d6e['push'](_0x182d6e['shift']());}};_0x250f67(++_0x373aaf);}(_0xf0bd,0x1dc));var _0xdf0b=function(_0x3f15ba,_0x40a208){_0x3f15ba=_0x3f15ba-0x0;var _0x5ecd6c=_0xf0bd[_0x3f15ba];return _0x5ecd6c;};'use strict';var Sequelize=require(_0xdf0b('0x0'));module[_0xdf0b('0x1')]={'name':{'type':Sequelize[_0xdf0b('0x2')],'unique':_0xdf0b('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdf0b('0x4')](_0xdf0b('0x5'),'beepall',_0xdf0b('0x6'))}}; \ No newline at end of file +var _0x4f2f=['name','STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x32f05c,_0x273aef){var _0x4307ed=function(_0x1be4da){while(--_0x1be4da){_0x32f05c['push'](_0x32f05c['shift']());}};_0x4307ed(++_0x273aef);}(_0x4f2f,0x99));var _0xf4f2=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x4f2f[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0xf4f2('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xf4f2('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf4f2('0x2')]},'timeout':{'type':Sequelize[_0xf4f2('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xf4f2('0x4'),_0xf4f2('0x5'),_0xf4f2('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 6263e52..52d1219 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 _0xbefe=['map','filter','options','includeAll','include','findAll','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','MailQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','body','describe','getMembers','findOne','UserMailQueue','sort','MailQueueId','findAndCountAll','UserId','agent','mailPause','createdAt','format','SIP','updatedAt','getTeams','Team','length','hasOwnProperty','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','each','forEach','emit','userMailQueue:save','removeTeams','select','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','push','toString','QueryTypes','SELECT','every','all','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userMailQueue:remove','getAgents','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','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/environment','../../config/license/util','../../mysqldb','redis','./mailQueue.socket','register','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','update','then','destroy','get','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','pick','where','merge'];(function(_0x4d613c,_0x55f220){var _0x301fe3=function(_0x5eec0b){while(--_0x5eec0b){_0x4d613c['push'](_0x4d613c['shift']());}};_0x301fe3(++_0x55f220);}(_0xbefe,0x168));var _0xebef=function(_0x45fb8f,_0x46da98){_0x45fb8f=_0x45fb8f-0x0;var _0x3d906b=_0xbefe[_0x45fb8f];return _0x3d906b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xebef('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xebef('0x1'));var rp=require(_0xebef('0x2'));var moment=require(_0xebef('0x3'));var BPromise=require(_0xebef('0x4'));var Mustache=require(_0xebef('0x5'));var util=require(_0xebef('0x6'));var path=require(_0xebef('0x7'));var sox=require(_0xebef('0x8'));var csv=require('to-csv');var ejs=require(_0xebef('0x9'));var fs=require('fs');var fs_extra=require(_0xebef('0xa'));var _=require(_0xebef('0xb'));var squel=require('squel');var crypto=require(_0xebef('0xc'));var jsforce=require(_0xebef('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xebef('0xe'));var Papa=require(_0xebef('0xf'));var Redis=require(_0xebef('0x10'));var authService=require(_0xebef('0x11'));var qs=require(_0xebef('0x12'));var as=require(_0xebef('0x13'));var hardwareService=require(_0xebef('0x14'));var logger=require(_0xebef('0x15'))('api');var utils=require(_0xebef('0x16'));var config=require(_0xebef('0x17'));var licenseUtil=require(_0xebef('0x18'));var db=require(_0xebef('0x19'))['db'];config[_0xebef('0x1a')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xebef('0x1a')]));require(_0xebef('0x1b'))[_0xebef('0x1c')](socket);function respondWithStatusCode(_0x35cd7a,_0x2f53e5){_0x2f53e5=_0x2f53e5||0xcc;return function(_0x1c0f0a){if(_0x1c0f0a){return _0x35cd7a['sendStatus'](_0x2f53e5);}return _0x35cd7a[_0xebef('0x1d')](_0x2f53e5)[_0xebef('0x1e')]();};}function respondWithResult(_0x1921aa,_0x46849f){_0x46849f=_0x46849f||0xc8;return function(_0x345115){if(_0x345115){return _0x1921aa[_0xebef('0x1d')](_0x46849f)[_0xebef('0x1f')](_0x345115);}};}function respondWithFilteredResult(_0x1e4ddf,_0x2e5efa){return function(_0x16856f){if(_0x16856f){var _0x458e83=typeof _0x2e5efa['offset']===_0xebef('0x20')&&typeof _0x2e5efa[_0xebef('0x21')]===_0xebef('0x20');var _0x502c1e=_0x16856f[_0xebef('0x22')];var _0x3bb263=_0x458e83?0x0:_0x2e5efa[_0xebef('0x23')];var _0x151025=_0x458e83?_0x16856f[_0xebef('0x22')]:_0x2e5efa[_0xebef('0x23')]+_0x2e5efa[_0xebef('0x21')];var _0x4cc18e;if(_0x151025>=_0x502c1e){_0x151025=_0x502c1e;_0x4cc18e=0xc8;}else{_0x4cc18e=0xce;}_0x1e4ddf['status'](_0x4cc18e);return _0x1e4ddf['set'](_0xebef('0x24'),_0x3bb263+'-'+_0x151025+'/'+_0x502c1e)[_0xebef('0x1f')](_0x16856f);}return null;};}function patchUpdates(_0x38f0b8){return function(_0x221a7e){try{jsonpatch[_0xebef('0x25')](_0x221a7e,_0x38f0b8,!![]);}catch(_0x1ee3b){return BPromise[_0xebef('0x26')](_0x1ee3b);}return _0x221a7e['save']();};}function saveUpdates(_0x460104,_0x449767){return function(_0x38b965){if(_0x38b965){return _0x38b965[_0xebef('0x27')](_0x460104)[_0xebef('0x28')](function(_0x27f212){return _0x27f212;});}return null;};}function removeEntity(_0x36ca6b,_0x42d2af){return function(_0x45bb67){if(_0x45bb67){return _0x45bb67[_0xebef('0x29')]()[_0xebef('0x28')](function(){var _0x4fb77f=_0x45bb67[_0xebef('0x2a')]({'plain':!![]});var _0x54fd04='MailQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x54fd04,'resourceId':_0x4fb77f['id']}})['then'](function(){return _0x45bb67;});})['then'](function(){_0x36ca6b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x506e64,_0x5a9249){return function(_0x54001c){if(!_0x54001c){_0x506e64[_0xebef('0x2b')](0x194);}return _0x54001c;};}function handleError(_0x49a6fb,_0x100a20){_0x100a20=_0x100a20||0x1f4;return function(_0x4a0b36){logger[_0xebef('0x2c')](_0x4a0b36[_0xebef('0x2d')]);if(_0x4a0b36['name']){delete _0x4a0b36[_0xebef('0x2e')];}_0x49a6fb['status'](_0x100a20)[_0xebef('0x2f')](_0x4a0b36);};}exports[_0xebef('0x30')]=function(_0x1ef774,_0x34b238){var _0x189886={},_0x455f93={},_0x504136={'count':0x0,'rows':[]};var _0x40bc0a=_['map'](db[_0xebef('0x31')][_0xebef('0x32')],function(_0xd48fc3){return{'name':_0xd48fc3[_0xebef('0x33')],'type':_0xd48fc3[_0xebef('0x34')][_0xebef('0x35')]};});_0x455f93[_0xebef('0x36')]=_['map'](_0x40bc0a,_0xebef('0x2e'));_0x455f93[_0xebef('0x37')]=_[_0xebef('0x38')](_0x1ef774[_0xebef('0x37')]);_0x455f93[_0xebef('0x39')]=_[_0xebef('0x3a')](_0x455f93[_0xebef('0x36')],_0x455f93['query']);_0x189886[_0xebef('0x3b')]=_[_0xebef('0x3a')](_0x455f93['model'],qs[_0xebef('0x3c')](_0x1ef774[_0xebef('0x37')][_0xebef('0x3c')]));_0x189886[_0xebef('0x3b')]=_0x189886[_0xebef('0x3b')]['length']?_0x189886[_0xebef('0x3b')]:_0x455f93[_0xebef('0x36')];if(!_0x1ef774['query']['hasOwnProperty'](_0xebef('0x3d'))){_0x189886['limit']=qs['limit'](_0x1ef774['query'][_0xebef('0x21')]);_0x189886['offset']=qs['offset'](_0x1ef774[_0xebef('0x37')][_0xebef('0x23')]);}_0x189886[_0xebef('0x3e')]=qs['sort'](_0x1ef774[_0xebef('0x37')]['sort']);_0x189886['where']=qs['filters'](_[_0xebef('0x3f')](_0x1ef774['query'],_0x455f93[_0xebef('0x39')]),_0x40bc0a);if(_0x1ef774['query']['filter']){_0x189886[_0xebef('0x40')]=_[_0xebef('0x41')](_0x189886[_0xebef('0x40')],{'$or':_[_0xebef('0x42')](_0x40bc0a,function(_0x3df6df){if(_0x3df6df[_0xebef('0x34')]!=='VIRTUAL'){var _0x249b1b={};_0x249b1b[_0x3df6df[_0xebef('0x2e')]]={'$like':'%'+_0x1ef774[_0xebef('0x37')][_0xebef('0x43')]+'%'};return _0x249b1b;}})});}_0x189886=_[_0xebef('0x41')]({},_0x189886,_0x1ef774[_0xebef('0x44')]);var _0x3c033d={'where':_0x189886[_0xebef('0x40')]};return db[_0xebef('0x31')][_0xebef('0x22')](_0x3c033d)['then'](function(_0x5cf908){_0x504136['count']=_0x5cf908;if(_0x1ef774['query'][_0xebef('0x45')]){_0x189886[_0xebef('0x46')]=[{'all':!![]}];}return db[_0xebef('0x31')][_0xebef('0x47')](_0x189886);})[_0xebef('0x28')](function(_0x4a6706){_0x504136['rows']=_0x4a6706;return _0x504136;})[_0xebef('0x28')](respondWithFilteredResult(_0x34b238,_0x189886))['catch'](handleError(_0x34b238,null));};exports['show']=function(_0x2860bc,_0x14890a){var _0x235e95={'raw':!![],'where':{'id':_0x2860bc[_0xebef('0x48')]['id']}},_0x20423a={};_0x20423a[_0xebef('0x36')]=_[_0xebef('0x38')](db[_0xebef('0x31')][_0xebef('0x32')]);_0x20423a[_0xebef('0x37')]=_[_0xebef('0x38')](_0x2860bc[_0xebef('0x37')]);_0x20423a[_0xebef('0x39')]=_['intersection'](_0x20423a[_0xebef('0x36')],_0x20423a[_0xebef('0x37')]);_0x235e95[_0xebef('0x3b')]=_[_0xebef('0x3a')](_0x20423a[_0xebef('0x36')],qs[_0xebef('0x3c')](_0x2860bc['query'][_0xebef('0x3c')]));_0x235e95[_0xebef('0x3b')]=_0x235e95[_0xebef('0x3b')]['length']?_0x235e95['attributes']:_0x20423a[_0xebef('0x36')];if(_0x2860bc['query'][_0xebef('0x45')]){_0x235e95[_0xebef('0x46')]=[{'all':!![]}];}_0x235e95=_[_0xebef('0x41')]({},_0x235e95,_0x2860bc[_0xebef('0x44')]);return db[_0xebef('0x31')][_0xebef('0x49')](_0x235e95)[_0xebef('0x28')](handleEntityNotFound(_0x14890a,null))['then'](respondWithResult(_0x14890a,null))[_0xebef('0x4a')](handleError(_0x14890a,null));};exports['create']=function(_0x393b46,_0x212592){return db[_0xebef('0x31')][_0xebef('0x4b')](_0x393b46['body'],{})[_0xebef('0x28')](function(_0x52f067){var _0x5f1ce5=_0x393b46[_0xebef('0x4c')][_0xebef('0x2a')]({'plain':!![]});if(!_0x5f1ce5)throw new Error(_0xebef('0x4d'));if(_0x5f1ce5[_0xebef('0x4e')]===_0xebef('0x4c')){var _0x2cc331=_0x52f067[_0xebef('0x2a')]({'plain':!![]});var _0x35a755=_0xebef('0x4f');return db[_0xebef('0x50')][_0xebef('0x49')]({'where':{'name':_0x35a755,'userProfileId':_0x5f1ce5[_0xebef('0x51')]},'raw':!![]})[_0xebef('0x28')](function(_0x766610){if(_0x766610&&_0x766610[_0xebef('0x52')]===0x0){return db[_0xebef('0x53')][_0xebef('0x4b')]({'name':_0x2cc331[_0xebef('0x2e')],'resourceId':_0x2cc331['id'],'type':_0x766610[_0xebef('0x2e')],'sectionId':_0x766610['id']},{})['then'](function(){return _0x52f067;});}else{return _0x52f067;}})['catch'](function(_0x52c43c){logger[_0xebef('0x2c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x52c43c);throw _0x52c43c;});}return _0x52f067;})['then'](respondWithResult(_0x212592,0xc9))[_0xebef('0x4a')](handleError(_0x212592,null));};exports[_0xebef('0x27')]=function(_0x21337b,_0x4c62e9){if(_0x21337b[_0xebef('0x54')]['id']){delete _0x21337b[_0xebef('0x54')]['id'];}return db[_0xebef('0x31')][_0xebef('0x49')]({'where':{'id':_0x21337b[_0xebef('0x48')]['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x4c62e9,null))['then'](saveUpdates(_0x21337b[_0xebef('0x54')],null))[_0xebef('0x28')](respondWithResult(_0x4c62e9,null))['catch'](handleError(_0x4c62e9,null));};exports['destroy']=function(_0x587a9e,_0x1bdfec){return db[_0xebef('0x31')][_0xebef('0x49')]({'where':{'id':_0x587a9e[_0xebef('0x48')]['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x1bdfec,null))[_0xebef('0x28')](removeEntity(_0x1bdfec,null))['catch'](handleError(_0x1bdfec,null));};exports[_0xebef('0x55')]=function(_0xdcc10,_0x233f9f){return db['MailQueue'][_0xebef('0x55')]()['then'](respondWithResult(_0x233f9f,null))['catch'](handleError(_0x233f9f,null));};exports[_0xebef('0x56')]=function(_0x57bca,_0x24bada,_0x380206){var _0x353fe2={'raw':!![],'where':{}},_0x76bf62={},_0xaa08e1;return db['MailQueue'][_0xebef('0x57')]({'where':{'id':_0x57bca[_0xebef('0x48')]['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x24bada,null))[_0xebef('0x28')](function(_0x5bedad){if(_0x5bedad){_0xaa08e1=_0x5bedad[_0xebef('0x2a')]({'plain':!![]});_0x76bf62[_0xebef('0x36')]=_[_0xebef('0x38')](db[_0xebef('0x58')]['rawAttributes']);_0x76bf62[_0xebef('0x37')]=_['keys'](_0x57bca[_0xebef('0x37')]);_0x76bf62['filters']=_[_0xebef('0x3a')](_0x76bf62[_0xebef('0x36')],_0x76bf62[_0xebef('0x37')]);_0x353fe2['attributes']=_[_0xebef('0x3a')](_0x76bf62['model'],qs[_0xebef('0x3c')](_0x57bca[_0xebef('0x37')][_0xebef('0x3c')]));_0x353fe2[_0xebef('0x3b')]=_0x353fe2[_0xebef('0x3b')]['length']?_0x353fe2[_0xebef('0x3b')]:_0x76bf62[_0xebef('0x36')];if(!_0x57bca[_0xebef('0x37')]['hasOwnProperty']('nolimit')){_0x353fe2[_0xebef('0x21')]=qs[_0xebef('0x21')](_0x57bca[_0xebef('0x37')][_0xebef('0x21')]);_0x353fe2[_0xebef('0x23')]=qs[_0xebef('0x23')](_0x57bca[_0xebef('0x37')][_0xebef('0x23')]);}_0x353fe2['order']=qs[_0xebef('0x59')](_0x57bca[_0xebef('0x37')][_0xebef('0x59')]);_0x353fe2[_0xebef('0x40')]=qs[_0xebef('0x39')](_['pick'](_0x57bca['query'],_0x76bf62[_0xebef('0x39')]));_0x353fe2[_0xebef('0x40')][_0xebef('0x5a')]=_0x5bedad['id'];if(_0x57bca['query'][_0xebef('0x43')]){_0x353fe2[_0xebef('0x40')]=_[_0xebef('0x41')](_0x353fe2[_0xebef('0x40')],{'$or':_['map'](_0x353fe2['attributes'],function(_0xbfd116){var _0x8b4edc={};_0x8b4edc[_0xbfd116]={'$like':'%'+_0x57bca[_0xebef('0x37')][_0xebef('0x43')]+'%'};return _0x8b4edc;})});}_0x353fe2=_[_0xebef('0x41')]({},_0x353fe2,_0x57bca[_0xebef('0x44')]);return db[_0xebef('0x58')][_0xebef('0x47')](_0x353fe2);}})[_0xebef('0x28')](function(_0x426f73){if(_0x426f73){return db['User'][_0xebef('0x5b')]({'where':{'id':_[_0xebef('0x42')](_0x426f73,_0xebef('0x5c')),'role':_0xebef('0x5d')},'attributes':['id',_0xebef('0x2e'),_0xebef('0x5e'),'updatedAt',_0xebef('0x5f')]});}})[_0xebef('0x28')](function(_0x16056a){if(_0x16056a){return{'count':_0x16056a['count'],'rows':_[_0xebef('0x42')](_0x16056a['rows'],function(_0x4b65b2){return{'membername':_0x4b65b2[_0xebef('0x2e')],'UserId':_0x4b65b2['id'],'queue_name':_0xaa08e1['name'],'MailQueueId':_0xaa08e1['id'],'interface':util[_0xebef('0x60')]('%s/%s',_0xebef('0x61'),_0x4b65b2[_0xebef('0x2e')]),'penalty':0x0,'paused':_0x4b65b2[_0xebef('0x5e')],'createdAt':_0x4b65b2[_0xebef('0x5f')],'updatedAt':_0x4b65b2[_0xebef('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xebef('0x28')](respondWithFilteredResult(_0x24bada,_0x353fe2))[_0xebef('0x4a')](handleError(_0x24bada,null));};exports[_0xebef('0x63')]=function(_0x242487,_0x2463f9,_0x3673e1){var _0x5960be={};var _0x5128ed={};var _0x572405;var _0x44fc80;return db[_0xebef('0x31')]['findOne']({'where':{'id':_0x242487[_0xebef('0x48')]['id']}})['then'](handleEntityNotFound(_0x2463f9,null))[_0xebef('0x28')](function(_0x20638f){if(_0x20638f){_0x572405=_0x20638f;_0x5128ed[_0xebef('0x36')]=_[_0xebef('0x38')](db[_0xebef('0x64')][_0xebef('0x32')]);_0x5128ed[_0xebef('0x37')]=_[_0xebef('0x38')](_0x242487[_0xebef('0x37')]);_0x5128ed['filters']=_[_0xebef('0x3a')](_0x5128ed['model'],_0x5128ed[_0xebef('0x37')]);_0x5960be['attributes']=_[_0xebef('0x3a')](_0x5128ed[_0xebef('0x36')],qs['fields'](_0x242487[_0xebef('0x37')]['fields']));_0x5960be[_0xebef('0x3b')]=_0x5960be[_0xebef('0x3b')]['length']?_0x5960be[_0xebef('0x3b')]:_0x5128ed['model'];_0x5960be['order']=qs[_0xebef('0x59')](_0x242487[_0xebef('0x37')][_0xebef('0x59')]);_0x5960be[_0xebef('0x40')]=qs[_0xebef('0x39')](_[_0xebef('0x3f')](_0x242487[_0xebef('0x37')],_0x5128ed[_0xebef('0x39')]));if(_0x242487[_0xebef('0x37')][_0xebef('0x43')]){_0x5960be['where']=_['merge'](_0x5960be[_0xebef('0x40')],{'$or':_[_0xebef('0x42')](_0x5960be[_0xebef('0x3b')],function(_0x4921e8){var _0xf0d4e1={};_0xf0d4e1[_0x4921e8]={'$like':'%'+_0x242487[_0xebef('0x37')][_0xebef('0x43')]+'%'};return _0xf0d4e1;})});}_0x5960be=_['merge']({},_0x5960be,_0x242487['options']);return _0x572405['getTeams'](_0x5960be);}})[_0xebef('0x28')](function(_0x3bf20f){if(_0x3bf20f){_0x44fc80=_0x3bf20f[_0xebef('0x65')];if(!_0x242487['query'][_0xebef('0x66')](_0xebef('0x3d'))){_0x5960be[_0xebef('0x21')]=qs[_0xebef('0x21')](_0x242487['query'][_0xebef('0x21')]);_0x5960be[_0xebef('0x23')]=qs['offset'](_0x242487[_0xebef('0x37')][_0xebef('0x23')]);}return _0x572405[_0xebef('0x63')](_0x5960be);}})[_0xebef('0x28')](function(_0x100645){if(_0x100645){return _0x100645?{'count':_0x44fc80,'rows':_0x100645}:null;}})[_0xebef('0x28')](respondWithResult(_0x2463f9,null))[_0xebef('0x4a')](handleError(_0x2463f9,null));};exports[_0xebef('0x67')]=function(_0x37a9de,_0x4557ee,_0x76fb){var _0x36324d=_0x37a9de['body'][_0xebef('0x68')];return db[_0xebef('0x64')][_0xebef('0x47')]({'where':{'id':_0x36324d},'attributes':['id'],'include':[{'model':db[_0xebef('0x69')],'as':_0xebef('0x6a'),'attributes':['id','name',_0xebef('0x6b'),_0xebef('0x6c'),_0xebef('0x6d')],'raw':!![]}]})[_0xebef('0x28')](function(_0x206fc2){if(_0x206fc2){var _0x25d354=_[_0xebef('0x6e')](_0x206fc2,function(_0x37a119){var _0x1d115f=_0x37a119['get']({'plain':!![]});return _0x1d115f[_0xebef('0x6a')];});return db[_0xebef('0x31')][_0xebef('0x49')]({'where':{'id':_0x37a9de['params']['id']}})[_0xebef('0x28')](function(_0x55ce74){return db[_0xebef('0x6f')]['transaction'](function(_0x5edcdf){return _0x55ce74[_0xebef('0x67')](_0x36324d,{'transaction':_0x5edcdf})[_0xebef('0x28')](function(){return BPromise[_0xebef('0x70')](_0x25d354,function(_0x21d995){return db['UserMailQueue']['findOrCreate']({'where':{'UserId':_0x21d995['id'],'MailQueueId':_0x37a9de[_0xebef('0x48')]['id']},'transaction':_0x5edcdf});});})[_0xebef('0x28')](function(){_0x25d354[_0xebef('0x71')](function(_0x2c76a1){socket[_0xebef('0x72')](_0xebef('0x73'),{'UserId':_0x2c76a1['id'],'MailQueueId':_0x55ce74['id']});});});});});}})['then'](respondWithStatusCode(_0x4557ee,null))['catch'](handleError(_0x4557ee,null));};exports[_0xebef('0x74')]=function(_0x19fcff,_0x4b33de,_0x2ccaf4){return db['Team'][_0xebef('0x47')]({'where':{'id':_0x19fcff['query'][_0xebef('0x68')]},'attributes':['id'],'include':[{'model':db[_0xebef('0x69')],'as':_0xebef('0x6a'),'attributes':['id'],'raw':!![]}]})[_0xebef('0x28')](handleEntityNotFound(_0x4b33de,null))[_0xebef('0x28')](function(_0x1ad0bf){var _0x14d662=_[_0xebef('0x42')](_0x1ad0bf,'id');var _0x5d180a=[];var _0x25e58b=[];var _0x366057=squel[_0xebef('0x75')]();_0x366057['field']('tq.TeamId')[_0xebef('0x76')](_0xebef('0x77'),'tq')[_0xebef('0x78')](_0xebef('0x79'),'ut',_0xebef('0x7a'))['where']('MailQueueId\x20=\x20?',_0x19fcff['params']['id']);for(var _0x215e62=0x0;_0x215e62<_0x1ad0bf[_0xebef('0x65')];_0x215e62+=0x1){let _0x499ba7=_0x1ad0bf[_0x215e62];for(var _0x2b6f47=0x0;_0x2b6f47<_0x499ba7['Agents'][_0xebef('0x65')];_0x2b6f47+=0x1){let _0x55b162=_0x499ba7[_0xebef('0x6a')][_0x2b6f47];var _0x46bcf7=_0x366057[_0xebef('0x7b')]();_0x46bcf7[_0xebef('0x40')]('ut.UserId\x20=\x20?',_0x55b162['id']);_0x25e58b[_0xebef('0x7c')](db['sequelize'][_0xebef('0x37')](_0x46bcf7[_0xebef('0x7d')](),{'type':db['sequelize'][_0xebef('0x7e')][_0xebef('0x7f')]})[_0xebef('0x28')](function(_0x4d787c){if(_0x4d787c[_0xebef('0x65')]===0x1){return _0x55b162['id'];}else{var _0x13da62=_[_0xebef('0x80')](_[_0xebef('0x42')](_0x4d787c,'TeamId'),function(_0x2b0b63){return _['includes'](_0x14d662,_0x2b0b63);});if(_0x13da62){return _0x55b162['id'];}}}));}}return BPromise[_0xebef('0x81')](_0x25e58b)['then'](function(_0x60d0c6){_0x5d180a=_(_0x5d180a)[_0xebef('0x82')](_0x60d0c6)[_0xebef('0x83')]()[_0xebef('0x84')]();return db[_0xebef('0x31')]['find']({'where':{'id':_0x19fcff['params']['id']}})[_0xebef('0x28')](function(_0x4a4a58){return db[_0xebef('0x6f')][_0xebef('0x85')](function(_0x58925e){return _0x4a4a58[_0xebef('0x74')](_0x19fcff[_0xebef('0x37')]['ids'],{'transaction':_0x58925e})[_0xebef('0x28')](function(){if(!_[_0xebef('0x86')](_0x5d180a)){return _0x4a4a58[_0xebef('0x87')](_0x5d180a,{'transaction':_0x58925e});}})[_0xebef('0x28')](function(){_0x5d180a[_0xebef('0x71')](function(_0x223828){socket[_0xebef('0x72')]('userMailQueue:remove',{'UserId':_0x223828,'MailQueueId':_0x4a4a58['id']});});});});});});})[_0xebef('0x28')](respondWithStatusCode(_0x4b33de,null))['catch'](handleError(_0x4b33de,null));};exports['addAgents']=function(_0x2ba39c,_0x1454bf,_0x53bd32){return db['MailQueue'][_0xebef('0x49')]({'where':{'id':_0x2ba39c['params']['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x1454bf,null))[_0xebef('0x28')](function(_0x4ccee1){if(_0x4ccee1){return _0x4ccee1[_0xebef('0x88')](_0x2ba39c[_0xebef('0x54')]['ids'],_[_0xebef('0x89')](_0x2ba39c[_0xebef('0x54')],[_0xebef('0x68'),'id'])||{})[_0xebef('0x8a')](function(_0xab28eb){for(var _0x13bd92=0x0;_0x13bd92<_0x2ba39c[_0xebef('0x54')][_0xebef('0x68')][_0xebef('0x65')];_0x13bd92+=0x1){socket['emit'](_0xebef('0x73'),{'UserId':Number(_0x2ba39c['body'][_0xebef('0x68')][_0x13bd92]),'MailQueueId':Number(_0x2ba39c[_0xebef('0x48')]['id'])});}return _0xab28eb;});}})['then'](respondWithResult(_0x1454bf,null))[_0xebef('0x4a')](handleError(_0x1454bf,null));};exports[_0xebef('0x87')]=function(_0x4abda1,_0x4860a7,_0xb5ea14){return db[_0xebef('0x31')]['find']({'where':{'id':_0x4abda1['params']['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x4860a7,null))[_0xebef('0x28')](function(_0x448c5e){if(_0x448c5e){return _0x448c5e[_0xebef('0x87')](_0x4abda1[_0xebef('0x37')]['ids'])[_0xebef('0x28')](function(){if(_[_0xebef('0x8b')](_0x4abda1[_0xebef('0x37')][_0xebef('0x68')])){for(var _0xc550ee=0x0;_0xc550ee<_0x4abda1[_0xebef('0x37')]['ids'][_0xebef('0x65')];_0xc550ee+=0x1){socket[_0xebef('0x72')](_0xebef('0x8c'),{'UserId':Number(_0x4abda1[_0xebef('0x37')][_0xebef('0x68')][_0xc550ee]),'MailQueueId':Number(_0x4abda1[_0xebef('0x48')]['id'])});}}else{socket[_0xebef('0x72')](_0xebef('0x8c'),{'UserId':Number(_0x4abda1[_0xebef('0x37')][_0xebef('0x68')]),'MailQueueId':Number(_0x4abda1['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4860a7,null))[_0xebef('0x4a')](handleError(_0x4860a7,null));};exports[_0xebef('0x8d')]=function(_0x3d5c8d,_0x3bda9e,_0x3ea894){var _0x4f5f70={};var _0x35096a={};var _0x2d1edb;var _0x3a2baf;return db[_0xebef('0x31')]['findOne']({'where':{'id':_0x3d5c8d[_0xebef('0x48')]['id']}})[_0xebef('0x28')](handleEntityNotFound(_0x3bda9e,null))[_0xebef('0x28')](function(_0x43f045){if(_0x43f045){_0x2d1edb=_0x43f045;_0x35096a[_0xebef('0x36')]=_[_0xebef('0x38')](db['User'][_0xebef('0x32')]);_0x35096a[_0xebef('0x37')]=_[_0xebef('0x38')](_0x3d5c8d[_0xebef('0x37')]);_0x35096a[_0xebef('0x39')]=_['intersection'](_0x35096a[_0xebef('0x36')],_0x35096a['query']);_0x4f5f70['attributes']=_[_0xebef('0x3a')](_0x35096a[_0xebef('0x36')],qs[_0xebef('0x3c')](_0x3d5c8d['query'][_0xebef('0x3c')]));_0x4f5f70[_0xebef('0x3b')]=_0x4f5f70[_0xebef('0x3b')][_0xebef('0x65')]?_0x4f5f70[_0xebef('0x3b')]:_0x35096a[_0xebef('0x36')];_0x4f5f70[_0xebef('0x3e')]=qs[_0xebef('0x59')](_0x3d5c8d[_0xebef('0x37')]['sort']);_0x4f5f70[_0xebef('0x40')]=qs[_0xebef('0x39')](_[_0xebef('0x3f')](_0x3d5c8d[_0xebef('0x37')],_0x35096a[_0xebef('0x39')]));if(_0x3d5c8d['query'][_0xebef('0x43')]){_0x4f5f70[_0xebef('0x40')]=_[_0xebef('0x41')](_0x4f5f70[_0xebef('0x40')],{'$or':_[_0xebef('0x42')](_0x4f5f70['attributes'],function(_0x5bee7e){var _0x369838={};_0x369838[_0x5bee7e]={'$like':'%'+_0x3d5c8d[_0xebef('0x37')][_0xebef('0x43')]+'%'};return _0x369838;})});}_0x4f5f70=_['merge']({},_0x4f5f70,_0x3d5c8d['options']);return _0x2d1edb[_0xebef('0x8d')](_0x4f5f70);}})['then'](function(_0x3381bb){if(_0x3381bb){_0x3a2baf=_0x3381bb[_0xebef('0x65')];if(!_0x3d5c8d['query']['hasOwnProperty']('nolimit')){_0x4f5f70[_0xebef('0x21')]=qs[_0xebef('0x21')](_0x3d5c8d['query'][_0xebef('0x21')]);_0x4f5f70[_0xebef('0x23')]=qs[_0xebef('0x23')](_0x3d5c8d['query'][_0xebef('0x23')]);}return _0x2d1edb[_0xebef('0x8d')](_0x4f5f70);}})[_0xebef('0x28')](function(_0x35d9c0){if(_0x35d9c0){return _0x35d9c0?{'count':_0x3a2baf,'rows':_0x35d9c0}:null;}})[_0xebef('0x28')](respondWithResult(_0x3bda9e,null))['catch'](handleError(_0x3bda9e,null));}; \ No newline at end of file +var _0xd82a=['mailPause','createdAt','rows','format','%s/%s','SIP','updatedAt','getTeams','findOne','Team','addTeams','ids','Agents','online','voicePause','interface','each','removeTeams','field','tq.TeamId','from','team_has_mail_queues','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','transaction','isEmpty','removeAgents','forEach','emit','userMailQueue:remove','addAgents','spread','userMailQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./mailQueue.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','destroy','then','get','MailQueues','error','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','type','VIRTUAL','options','include','findAll','catch','show','MailQueue','includeAll','find','create','body','user','userProfileId','autoAssociation','update','params','describe','UserMailQueue','pick','filter','User','findAndCountAll','agent'];(function(_0x25891c,_0x3a47a2){var _0x11d74c=function(_0x3f65ef){while(--_0x3f65ef){_0x25891c['push'](_0x25891c['shift']());}};_0x11d74c(++_0x3a47a2);}(_0xd82a,0xbd));var _0xad82=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xd82a[_0x4c440b];return _0x2d48cf;};'use strict';var emlformat=require(_0xad82('0x0'));var rimraf=require(_0xad82('0x1'));var zipdir=require(_0xad82('0x2'));var jsonpatch=require(_0xad82('0x3'));var rp=require('request-promise');var moment=require(_0xad82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xad82('0x5'));var util=require(_0xad82('0x6'));var path=require(_0xad82('0x7'));var sox=require(_0xad82('0x8'));var csv=require(_0xad82('0x9'));var ejs=require(_0xad82('0xa'));var fs=require('fs');var fs_extra=require(_0xad82('0xb'));var _=require(_0xad82('0xc'));var squel=require(_0xad82('0xd'));var crypto=require(_0xad82('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xad82('0xf'));var toCsv=require(_0xad82('0x9'));var querystring=require(_0xad82('0x10'));var Papa=require(_0xad82('0x11'));var Redis=require(_0xad82('0x12'));var authService=require(_0xad82('0x13'));var qs=require(_0xad82('0x14'));var as=require(_0xad82('0x15'));var hardwareService=require(_0xad82('0x16'));var logger=require(_0xad82('0x17'))(_0xad82('0x18'));var utils=require(_0xad82('0x19'));var config=require(_0xad82('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xad82('0x1b'))['db'];config['redis']=_[_0xad82('0x1c')](config['redis'],{'host':_0xad82('0x1d'),'port':0x18eb});var socket=require(_0xad82('0x1e'))(new Redis(config[_0xad82('0x1f')]));require(_0xad82('0x20'))[_0xad82('0x21')](socket);function respondWithStatusCode(_0x1646e4,_0x4c59de){_0x4c59de=_0x4c59de||0xcc;return function(_0x403079){if(_0x403079){return _0x1646e4['sendStatus'](_0x4c59de);}return _0x1646e4[_0xad82('0x22')](_0x4c59de)[_0xad82('0x23')]();};}function respondWithResult(_0x37cb6a,_0x2f4e1b){_0x2f4e1b=_0x2f4e1b||0xc8;return function(_0x2535e8){if(_0x2535e8){return _0x37cb6a[_0xad82('0x22')](_0x2f4e1b)[_0xad82('0x24')](_0x2535e8);}};}function respondWithFilteredResult(_0x3f682d,_0x176baa){return function(_0x3c95d8){if(_0x3c95d8){var _0xcd4d7b=typeof _0x176baa[_0xad82('0x25')]===_0xad82('0x26')&&typeof _0x176baa[_0xad82('0x27')]===_0xad82('0x26');var _0x1d0218=_0x3c95d8['count'];var _0x9c0f11=_0xcd4d7b?0x0:_0x176baa[_0xad82('0x25')];var _0x4fb871=_0xcd4d7b?_0x3c95d8[_0xad82('0x28')]:_0x176baa['offset']+_0x176baa[_0xad82('0x27')];var _0x11ab07;if(_0x4fb871>=_0x1d0218){_0x4fb871=_0x1d0218;_0x11ab07=0xc8;}else{_0x11ab07=0xce;}_0x3f682d['status'](_0x11ab07);return _0x3f682d[_0xad82('0x29')](_0xad82('0x2a'),_0x9c0f11+'-'+_0x4fb871+'/'+_0x1d0218)[_0xad82('0x24')](_0x3c95d8);}return null;};}function patchUpdates(_0x5bb38b){return function(_0x47b32c){try{jsonpatch[_0xad82('0x2b')](_0x47b32c,_0x5bb38b,!![]);}catch(_0x1857d7){return BPromise['reject'](_0x1857d7);}return _0x47b32c[_0xad82('0x2c')]();};}function saveUpdates(_0x822821,_0x42e9bc){return function(_0x330874){if(_0x330874){return _0x330874['update'](_0x822821)['then'](function(_0x3661ca){return _0x3661ca;});}return null;};}function removeEntity(_0x1630a7,_0x4157d5){return function(_0x4398a3){if(_0x4398a3){return _0x4398a3[_0xad82('0x2d')]()[_0xad82('0x2e')](function(){var _0xac5104=_0x4398a3[_0xad82('0x2f')]({'plain':!![]});var _0x4e4c7b=_0xad82('0x30');return db['UserProfileResource'][_0xad82('0x2d')]({'where':{'type':_0x4e4c7b,'resourceId':_0xac5104['id']}})['then'](function(){return _0x4398a3;});})[_0xad82('0x2e')](function(){_0x1630a7[_0xad82('0x22')](0xcc)[_0xad82('0x23')]();});}};}function handleEntityNotFound(_0x4036dd,_0x5b127e){return function(_0x1fcb5f){if(!_0x1fcb5f){_0x4036dd['sendStatus'](0x194);}return _0x1fcb5f;};}function handleError(_0x104a8d,_0x36236d){_0x36236d=_0x36236d||0x1f4;return function(_0x338e0f){logger[_0xad82('0x31')](_0x338e0f['stack']);if(_0x338e0f[_0xad82('0x32')]){delete _0x338e0f[_0xad82('0x32')];}_0x104a8d[_0xad82('0x22')](_0x36236d)[_0xad82('0x33')](_0x338e0f);};}exports[_0xad82('0x34')]=function(_0x27ffc7,_0x4c01c1){var _0x300141={},_0x1491fd={},_0x538a66={'count':0x0,'rows':[]};var _0x1b3e7b=_['map'](db['MailQueue'][_0xad82('0x35')],function(_0x1f96f9){return{'name':_0x1f96f9[_0xad82('0x36')],'type':_0x1f96f9['type'][_0xad82('0x37')]};});_0x1491fd[_0xad82('0x38')]=_[_0xad82('0x39')](_0x1b3e7b,'name');_0x1491fd['query']=_[_0xad82('0x3a')](_0x27ffc7[_0xad82('0x3b')]);_0x1491fd[_0xad82('0x3c')]=_['intersection'](_0x1491fd[_0xad82('0x38')],_0x1491fd['query']);_0x300141[_0xad82('0x3d')]=_[_0xad82('0x3e')](_0x1491fd[_0xad82('0x38')],qs['fields'](_0x27ffc7['query'][_0xad82('0x3f')]));_0x300141[_0xad82('0x3d')]=_0x300141['attributes'][_0xad82('0x40')]?_0x300141['attributes']:_0x1491fd[_0xad82('0x38')];if(!_0x27ffc7['query'][_0xad82('0x41')](_0xad82('0x42'))){_0x300141[_0xad82('0x27')]=qs[_0xad82('0x27')](_0x27ffc7['query']['limit']);_0x300141[_0xad82('0x25')]=qs[_0xad82('0x25')](_0x27ffc7[_0xad82('0x3b')][_0xad82('0x25')]);}_0x300141[_0xad82('0x43')]=qs[_0xad82('0x44')](_0x27ffc7[_0xad82('0x3b')][_0xad82('0x44')]);_0x300141[_0xad82('0x45')]=qs[_0xad82('0x3c')](_['pick'](_0x27ffc7['query'],_0x1491fd['filters']),_0x1b3e7b);if(_0x27ffc7['query']['filter']){_0x300141[_0xad82('0x45')]=_[_0xad82('0x46')](_0x300141[_0xad82('0x45')],{'$or':_[_0xad82('0x39')](_0x1b3e7b,function(_0x1fd2e8){if(_0x1fd2e8[_0xad82('0x47')]!==_0xad82('0x48')){var _0x483f80={};_0x483f80[_0x1fd2e8['name']]={'$like':'%'+_0x27ffc7[_0xad82('0x3b')]['filter']+'%'};return _0x483f80;}})});}_0x300141=_[_0xad82('0x46')]({},_0x300141,_0x27ffc7[_0xad82('0x49')]);var _0x24a87e={'where':_0x300141[_0xad82('0x45')]};return db['MailQueue'][_0xad82('0x28')](_0x24a87e)[_0xad82('0x2e')](function(_0x3d1f6f){_0x538a66[_0xad82('0x28')]=_0x3d1f6f;if(_0x27ffc7['query']['includeAll']){_0x300141[_0xad82('0x4a')]=[{'all':!![]}];}return db['MailQueue'][_0xad82('0x4b')](_0x300141);})[_0xad82('0x2e')](function(_0xf5243c){_0x538a66['rows']=_0xf5243c;return _0x538a66;})['then'](respondWithFilteredResult(_0x4c01c1,_0x300141))[_0xad82('0x4c')](handleError(_0x4c01c1,null));};exports[_0xad82('0x4d')]=function(_0x550742,_0x42b6df){var _0x34b1df={'raw':!![],'where':{'id':_0x550742['params']['id']}},_0x156d83={};_0x156d83['model']=_['keys'](db[_0xad82('0x4e')][_0xad82('0x35')]);_0x156d83['query']=_[_0xad82('0x3a')](_0x550742[_0xad82('0x3b')]);_0x156d83[_0xad82('0x3c')]=_[_0xad82('0x3e')](_0x156d83['model'],_0x156d83[_0xad82('0x3b')]);_0x34b1df[_0xad82('0x3d')]=_[_0xad82('0x3e')](_0x156d83['model'],qs[_0xad82('0x3f')](_0x550742[_0xad82('0x3b')][_0xad82('0x3f')]));_0x34b1df[_0xad82('0x3d')]=_0x34b1df[_0xad82('0x3d')][_0xad82('0x40')]?_0x34b1df['attributes']:_0x156d83[_0xad82('0x38')];if(_0x550742[_0xad82('0x3b')][_0xad82('0x4f')]){_0x34b1df[_0xad82('0x4a')]=[{'all':!![]}];}_0x34b1df=_['merge']({},_0x34b1df,_0x550742[_0xad82('0x49')]);return db[_0xad82('0x4e')][_0xad82('0x50')](_0x34b1df)[_0xad82('0x2e')](handleEntityNotFound(_0x42b6df,null))[_0xad82('0x2e')](respondWithResult(_0x42b6df,null))[_0xad82('0x4c')](handleError(_0x42b6df,null));};exports[_0xad82('0x51')]=function(_0x38363b,_0x4c789c){return db[_0xad82('0x4e')][_0xad82('0x51')](_0x38363b[_0xad82('0x52')],{})[_0xad82('0x2e')](function(_0x360407){var _0x2a1b72=_0x38363b[_0xad82('0x53')][_0xad82('0x2f')]({'plain':!![]});if(!_0x2a1b72)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a1b72['role']===_0xad82('0x53')){var _0x452ae2=_0x360407[_0xad82('0x2f')]({'plain':!![]});var _0x4b1a36=_0xad82('0x30');return db['UserProfileSection'][_0xad82('0x50')]({'where':{'name':_0x4b1a36,'userProfileId':_0x2a1b72[_0xad82('0x54')]},'raw':!![]})[_0xad82('0x2e')](function(_0x3ce609){if(_0x3ce609&&_0x3ce609[_0xad82('0x55')]===0x0){return db['UserProfileResource']['create']({'name':_0x452ae2[_0xad82('0x32')],'resourceId':_0x452ae2['id'],'type':_0x3ce609[_0xad82('0x32')],'sectionId':_0x3ce609['id']},{})[_0xad82('0x2e')](function(){return _0x360407;});}else{return _0x360407;}})['catch'](function(_0x26341b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x26341b);throw _0x26341b;});}return _0x360407;})[_0xad82('0x2e')](respondWithResult(_0x4c789c,0xc9))[_0xad82('0x4c')](handleError(_0x4c789c,null));};exports[_0xad82('0x56')]=function(_0x19c0fc,_0x5d455a){if(_0x19c0fc['body']['id']){delete _0x19c0fc['body']['id'];}return db[_0xad82('0x4e')][_0xad82('0x50')]({'where':{'id':_0x19c0fc[_0xad82('0x57')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x5d455a,null))[_0xad82('0x2e')](saveUpdates(_0x19c0fc[_0xad82('0x52')],null))[_0xad82('0x2e')](respondWithResult(_0x5d455a,null))['catch'](handleError(_0x5d455a,null));};exports[_0xad82('0x2d')]=function(_0x48ac87,_0x562d69){return db[_0xad82('0x4e')][_0xad82('0x50')]({'where':{'id':_0x48ac87[_0xad82('0x57')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x562d69,null))['then'](removeEntity(_0x562d69,null))[_0xad82('0x4c')](handleError(_0x562d69,null));};exports[_0xad82('0x58')]=function(_0x3c4362,_0xa6a666){return db[_0xad82('0x4e')][_0xad82('0x58')]()[_0xad82('0x2e')](respondWithResult(_0xa6a666,null))[_0xad82('0x4c')](handleError(_0xa6a666,null));};exports['getMembers']=function(_0x227ae7,_0x4b8b37,_0x5421d8){var _0x5e0df7={'raw':!![],'where':{}},_0x443040={},_0x285390;return db['MailQueue']['findOne']({'where':{'id':_0x227ae7[_0xad82('0x57')]['id']}})['then'](handleEntityNotFound(_0x4b8b37,null))[_0xad82('0x2e')](function(_0xaee626){if(_0xaee626){_0x285390=_0xaee626[_0xad82('0x2f')]({'plain':!![]});_0x443040['model']=_[_0xad82('0x3a')](db[_0xad82('0x59')]['rawAttributes']);_0x443040['query']=_[_0xad82('0x3a')](_0x227ae7[_0xad82('0x3b')]);_0x443040[_0xad82('0x3c')]=_[_0xad82('0x3e')](_0x443040[_0xad82('0x38')],_0x443040[_0xad82('0x3b')]);_0x5e0df7[_0xad82('0x3d')]=_[_0xad82('0x3e')](_0x443040[_0xad82('0x38')],qs[_0xad82('0x3f')](_0x227ae7[_0xad82('0x3b')][_0xad82('0x3f')]));_0x5e0df7[_0xad82('0x3d')]=_0x5e0df7[_0xad82('0x3d')][_0xad82('0x40')]?_0x5e0df7['attributes']:_0x443040[_0xad82('0x38')];if(!_0x227ae7[_0xad82('0x3b')][_0xad82('0x41')]('nolimit')){_0x5e0df7[_0xad82('0x27')]=qs['limit'](_0x227ae7['query'][_0xad82('0x27')]);_0x5e0df7[_0xad82('0x25')]=qs[_0xad82('0x25')](_0x227ae7[_0xad82('0x3b')][_0xad82('0x25')]);}_0x5e0df7[_0xad82('0x43')]=qs[_0xad82('0x44')](_0x227ae7[_0xad82('0x3b')][_0xad82('0x44')]);_0x5e0df7[_0xad82('0x45')]=qs[_0xad82('0x3c')](_[_0xad82('0x5a')](_0x227ae7[_0xad82('0x3b')],_0x443040[_0xad82('0x3c')]));_0x5e0df7['where']['MailQueueId']=_0xaee626['id'];if(_0x227ae7['query'][_0xad82('0x5b')]){_0x5e0df7[_0xad82('0x45')]=_[_0xad82('0x46')](_0x5e0df7['where'],{'$or':_[_0xad82('0x39')](_0x5e0df7[_0xad82('0x3d')],function(_0xd8115d){var _0x58f3bb={};_0x58f3bb[_0xd8115d]={'$like':'%'+_0x227ae7[_0xad82('0x3b')]['filter']+'%'};return _0x58f3bb;})});}_0x5e0df7=_[_0xad82('0x46')]({},_0x5e0df7,_0x227ae7[_0xad82('0x49')]);return db['UserMailQueue'][_0xad82('0x4b')](_0x5e0df7);}})['then'](function(_0x4029e7){if(_0x4029e7){return db[_0xad82('0x5c')][_0xad82('0x5d')]({'where':{'id':_[_0xad82('0x39')](_0x4029e7,'UserId'),'role':_0xad82('0x5e')},'attributes':['id',_0xad82('0x32'),_0xad82('0x5f'),'updatedAt',_0xad82('0x60')]});}})[_0xad82('0x2e')](function(_0x5d7330){if(_0x5d7330){return{'count':_0x5d7330[_0xad82('0x28')],'rows':_[_0xad82('0x39')](_0x5d7330[_0xad82('0x61')],function(_0x2ab03a){return{'membername':_0x2ab03a[_0xad82('0x32')],'UserId':_0x2ab03a['id'],'queue_name':_0x285390[_0xad82('0x32')],'MailQueueId':_0x285390['id'],'interface':util[_0xad82('0x62')](_0xad82('0x63'),_0xad82('0x64'),_0x2ab03a['name']),'penalty':0x0,'paused':_0x2ab03a[_0xad82('0x5f')],'createdAt':_0x2ab03a['createdAt'],'updatedAt':_0x2ab03a[_0xad82('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xad82('0x2e')](respondWithFilteredResult(_0x4b8b37,_0x5e0df7))['catch'](handleError(_0x4b8b37,null));};exports[_0xad82('0x66')]=function(_0x49d293,_0x1d7698,_0x50af15){var _0x2b7e76={};var _0x28976f={};var _0x3ecee3;var _0x59e5a7;return db[_0xad82('0x4e')][_0xad82('0x67')]({'where':{'id':_0x49d293['params']['id']}})['then'](handleEntityNotFound(_0x1d7698,null))[_0xad82('0x2e')](function(_0x2b6010){if(_0x2b6010){_0x3ecee3=_0x2b6010;_0x28976f['model']=_['keys'](db[_0xad82('0x68')][_0xad82('0x35')]);_0x28976f[_0xad82('0x3b')]=_['keys'](_0x49d293['query']);_0x28976f[_0xad82('0x3c')]=_[_0xad82('0x3e')](_0x28976f['model'],_0x28976f[_0xad82('0x3b')]);_0x2b7e76[_0xad82('0x3d')]=_[_0xad82('0x3e')](_0x28976f[_0xad82('0x38')],qs[_0xad82('0x3f')](_0x49d293[_0xad82('0x3b')][_0xad82('0x3f')]));_0x2b7e76[_0xad82('0x3d')]=_0x2b7e76[_0xad82('0x3d')][_0xad82('0x40')]?_0x2b7e76['attributes']:_0x28976f[_0xad82('0x38')];_0x2b7e76[_0xad82('0x43')]=qs[_0xad82('0x44')](_0x49d293[_0xad82('0x3b')][_0xad82('0x44')]);_0x2b7e76[_0xad82('0x45')]=qs[_0xad82('0x3c')](_[_0xad82('0x5a')](_0x49d293[_0xad82('0x3b')],_0x28976f[_0xad82('0x3c')]));if(_0x49d293[_0xad82('0x3b')][_0xad82('0x5b')]){_0x2b7e76[_0xad82('0x45')]=_[_0xad82('0x46')](_0x2b7e76[_0xad82('0x45')],{'$or':_[_0xad82('0x39')](_0x2b7e76[_0xad82('0x3d')],function(_0x1e4689){var _0x12a7d9={};_0x12a7d9[_0x1e4689]={'$like':'%'+_0x49d293['query'][_0xad82('0x5b')]+'%'};return _0x12a7d9;})});}_0x2b7e76=_[_0xad82('0x46')]({},_0x2b7e76,_0x49d293['options']);return _0x3ecee3[_0xad82('0x66')](_0x2b7e76);}})[_0xad82('0x2e')](function(_0x20f535){if(_0x20f535){_0x59e5a7=_0x20f535[_0xad82('0x40')];if(!_0x49d293['query'][_0xad82('0x41')](_0xad82('0x42'))){_0x2b7e76[_0xad82('0x27')]=qs[_0xad82('0x27')](_0x49d293['query'][_0xad82('0x27')]);_0x2b7e76[_0xad82('0x25')]=qs['offset'](_0x49d293[_0xad82('0x3b')][_0xad82('0x25')]);}return _0x3ecee3[_0xad82('0x66')](_0x2b7e76);}})[_0xad82('0x2e')](function(_0x178c83){if(_0x178c83){return _0x178c83?{'count':_0x59e5a7,'rows':_0x178c83}:null;}})['then'](respondWithResult(_0x1d7698,null))['catch'](handleError(_0x1d7698,null));};exports[_0xad82('0x69')]=function(_0x130e24,_0xe1b688,_0x46f1dd){var _0x2d3ee2=_0x130e24[_0xad82('0x52')][_0xad82('0x6a')];return db[_0xad82('0x68')][_0xad82('0x4b')]({'where':{'id':_0x2d3ee2},'attributes':['id'],'include':[{'model':db[_0xad82('0x5c')],'as':_0xad82('0x6b'),'attributes':['id','name',_0xad82('0x6c'),_0xad82('0x6d'),_0xad82('0x6e')],'raw':!![]}]})[_0xad82('0x2e')](function(_0x4c9eb1){if(_0x4c9eb1){var _0x323591=_['flatMap'](_0x4c9eb1,function(_0xca815){var _0x3a00d0=_0xca815[_0xad82('0x2f')]({'plain':!![]});return _0x3a00d0['Agents'];});return db[_0xad82('0x4e')][_0xad82('0x50')]({'where':{'id':_0x130e24[_0xad82('0x57')]['id']}})[_0xad82('0x2e')](function(_0xd82425){return db['sequelize']['transaction'](function(_0x2c5308){return _0xd82425[_0xad82('0x69')](_0x2d3ee2,{'transaction':_0x2c5308})[_0xad82('0x2e')](function(){return BPromise[_0xad82('0x6f')](_0x323591,function(_0x5243c7){return db[_0xad82('0x59')]['findOrCreate']({'where':{'UserId':_0x5243c7['id'],'MailQueueId':_0x130e24['params']['id']},'transaction':_0x2c5308});});})[_0xad82('0x2e')](function(){_0x323591['forEach'](function(_0x48aa9a){socket['emit']('userMailQueue:save',{'UserId':_0x48aa9a['id'],'MailQueueId':_0xd82425['id']});});});});});}})[_0xad82('0x2e')](respondWithStatusCode(_0xe1b688,null))[_0xad82('0x4c')](handleError(_0xe1b688,null));};exports[_0xad82('0x70')]=function(_0x4e0b22,_0x4900e3,_0x3f8023){return db['Team'][_0xad82('0x4b')]({'where':{'id':_0x4e0b22[_0xad82('0x3b')][_0xad82('0x6a')]},'attributes':['id'],'include':[{'model':db[_0xad82('0x5c')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xad82('0x2e')](handleEntityNotFound(_0x4900e3,null))[_0xad82('0x2e')](function(_0x3b02cb){var _0xa115f5=_[_0xad82('0x39')](_0x3b02cb,'id');var _0x4e156b=[];var _0x223dcc=[];var _0x909eb=squel['select']();_0x909eb[_0xad82('0x71')](_0xad82('0x72'))[_0xad82('0x73')](_0xad82('0x74'),'tq')['join']('user_has_teams','ut',_0xad82('0x75'))['where'](_0xad82('0x76'),_0x4e0b22['params']['id']);for(var _0x1bb56f=0x0;_0x1bb56f<_0x3b02cb[_0xad82('0x40')];_0x1bb56f+=0x1){let _0x47b68d=_0x3b02cb[_0x1bb56f];for(var _0xf1c489=0x0;_0xf1c489<_0x47b68d['Agents']['length'];_0xf1c489+=0x1){let _0xf8c4dc=_0x47b68d[_0xad82('0x6b')][_0xf1c489];var _0x47a1e9=_0x909eb[_0xad82('0x77')]();_0x47a1e9[_0xad82('0x45')](_0xad82('0x78'),_0xf8c4dc['id']);_0x223dcc[_0xad82('0x79')](db[_0xad82('0x7a')][_0xad82('0x3b')](_0x47a1e9[_0xad82('0x7b')](),{'type':db[_0xad82('0x7a')][_0xad82('0x7c')][_0xad82('0x7d')]})[_0xad82('0x2e')](function(_0x56a768){if(_0x56a768[_0xad82('0x40')]===0x1){return _0xf8c4dc['id'];}else{var _0x52a678=_[_0xad82('0x7e')](_[_0xad82('0x39')](_0x56a768,_0xad82('0x7f')),function(_0x33172c){return _[_0xad82('0x80')](_0xa115f5,_0x33172c);});if(_0x52a678){return _0xf8c4dc['id'];}}}));}}return BPromise[_0xad82('0x81')](_0x223dcc)['then'](function(_0x4b6526){_0x4e156b=_(_0x4e156b)['union'](_0x4b6526)[_0xad82('0x82')]()['value']();return db['MailQueue']['find']({'where':{'id':_0x4e0b22[_0xad82('0x57')]['id']}})['then'](function(_0x145218){return db[_0xad82('0x7a')][_0xad82('0x83')](function(_0x3c135a){return _0x145218[_0xad82('0x70')](_0x4e0b22[_0xad82('0x3b')]['ids'],{'transaction':_0x3c135a})['then'](function(){if(!_[_0xad82('0x84')](_0x4e156b)){return _0x145218[_0xad82('0x85')](_0x4e156b,{'transaction':_0x3c135a});}})[_0xad82('0x2e')](function(){_0x4e156b[_0xad82('0x86')](function(_0x11c786){socket[_0xad82('0x87')](_0xad82('0x88'),{'UserId':_0x11c786,'MailQueueId':_0x145218['id']});});});});});});})[_0xad82('0x2e')](respondWithStatusCode(_0x4900e3,null))['catch'](handleError(_0x4900e3,null));};exports['addAgents']=function(_0x4d1a33,_0x113aff,_0x646af3){return db[_0xad82('0x4e')][_0xad82('0x50')]({'where':{'id':_0x4d1a33['params']['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x113aff,null))[_0xad82('0x2e')](function(_0x307b06){if(_0x307b06){return _0x307b06[_0xad82('0x89')](_0x4d1a33[_0xad82('0x52')]['ids'],_['omit'](_0x4d1a33[_0xad82('0x52')],[_0xad82('0x6a'),'id'])||{})[_0xad82('0x8a')](function(_0x19ee2d){for(var _0x4c8acd=0x0;_0x4c8acd<_0x4d1a33[_0xad82('0x52')][_0xad82('0x6a')][_0xad82('0x40')];_0x4c8acd+=0x1){socket[_0xad82('0x87')](_0xad82('0x8b'),{'UserId':Number(_0x4d1a33[_0xad82('0x52')][_0xad82('0x6a')][_0x4c8acd]),'MailQueueId':Number(_0x4d1a33[_0xad82('0x57')]['id'])});}return _0x19ee2d;});}})[_0xad82('0x2e')](respondWithResult(_0x113aff,null))[_0xad82('0x4c')](handleError(_0x113aff,null));};exports[_0xad82('0x85')]=function(_0x35f6e5,_0x4e85bd,_0x408628){return db['MailQueue'][_0xad82('0x50')]({'where':{'id':_0x35f6e5[_0xad82('0x57')]['id']}})['then'](handleEntityNotFound(_0x4e85bd,null))['then'](function(_0x43c687){if(_0x43c687){return _0x43c687[_0xad82('0x85')](_0x35f6e5[_0xad82('0x3b')]['ids'])[_0xad82('0x2e')](function(){if(_[_0xad82('0x8c')](_0x35f6e5[_0xad82('0x3b')][_0xad82('0x6a')])){for(var _0x299f35=0x0;_0x299f35<_0x35f6e5['query'][_0xad82('0x6a')]['length'];_0x299f35+=0x1){socket[_0xad82('0x87')](_0xad82('0x88'),{'UserId':Number(_0x35f6e5['query'][_0xad82('0x6a')][_0x299f35]),'MailQueueId':Number(_0x35f6e5[_0xad82('0x57')]['id'])});}}else{socket['emit'](_0xad82('0x88'),{'UserId':Number(_0x35f6e5[_0xad82('0x3b')][_0xad82('0x6a')]),'MailQueueId':Number(_0x35f6e5['params']['id'])});}});}})[_0xad82('0x2e')](respondWithStatusCode(_0x4e85bd,null))[_0xad82('0x4c')](handleError(_0x4e85bd,null));};exports['getAgents']=function(_0x34dc39,_0x87caaa,_0x3eb332){var _0x4977ae={};var _0x1eddc8={};var _0x17be62;var _0x2063b2;return db['MailQueue'][_0xad82('0x67')]({'where':{'id':_0x34dc39[_0xad82('0x57')]['id']}})[_0xad82('0x2e')](handleEntityNotFound(_0x87caaa,null))[_0xad82('0x2e')](function(_0x40c1d5){if(_0x40c1d5){_0x17be62=_0x40c1d5;_0x1eddc8[_0xad82('0x38')]=_['keys'](db[_0xad82('0x5c')]['rawAttributes']);_0x1eddc8[_0xad82('0x3b')]=_[_0xad82('0x3a')](_0x34dc39[_0xad82('0x3b')]);_0x1eddc8['filters']=_['intersection'](_0x1eddc8[_0xad82('0x38')],_0x1eddc8[_0xad82('0x3b')]);_0x4977ae[_0xad82('0x3d')]=_['intersection'](_0x1eddc8[_0xad82('0x38')],qs[_0xad82('0x3f')](_0x34dc39[_0xad82('0x3b')][_0xad82('0x3f')]));_0x4977ae[_0xad82('0x3d')]=_0x4977ae[_0xad82('0x3d')][_0xad82('0x40')]?_0x4977ae[_0xad82('0x3d')]:_0x1eddc8[_0xad82('0x38')];_0x4977ae[_0xad82('0x43')]=qs[_0xad82('0x44')](_0x34dc39['query']['sort']);_0x4977ae[_0xad82('0x45')]=qs[_0xad82('0x3c')](_[_0xad82('0x5a')](_0x34dc39[_0xad82('0x3b')],_0x1eddc8[_0xad82('0x3c')]));if(_0x34dc39['query'][_0xad82('0x5b')]){_0x4977ae[_0xad82('0x45')]=_['merge'](_0x4977ae['where'],{'$or':_[_0xad82('0x39')](_0x4977ae[_0xad82('0x3d')],function(_0x281852){var _0x349f1c={};_0x349f1c[_0x281852]={'$like':'%'+_0x34dc39['query'][_0xad82('0x5b')]+'%'};return _0x349f1c;})});}_0x4977ae=_[_0xad82('0x46')]({},_0x4977ae,_0x34dc39[_0xad82('0x49')]);return _0x17be62[_0xad82('0x8d')](_0x4977ae);}})[_0xad82('0x2e')](function(_0x2d662a){if(_0x2d662a){_0x2063b2=_0x2d662a[_0xad82('0x40')];if(!_0x34dc39['query'][_0xad82('0x41')]('nolimit')){_0x4977ae[_0xad82('0x27')]=qs[_0xad82('0x27')](_0x34dc39[_0xad82('0x3b')][_0xad82('0x27')]);_0x4977ae[_0xad82('0x25')]=qs['offset'](_0x34dc39['query'][_0xad82('0x25')]);}return _0x17be62[_0xad82('0x8d')](_0x4977ae);}})['then'](function(_0x45feaf){if(_0x45feaf){return _0x45feaf?{'count':_0x2063b2,'rows':_0x45feaf}:null;}})[_0xad82('0x2e')](respondWithResult(_0x87caaa,null))[_0xad82('0x4c')](handleError(_0x87caaa,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 8e36925..6e26890 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 _0x4d59=['setMaxListeners','save','update','remove','emit','exports','../../mysqldb','MailQueue'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x4d59,0x196));var _0x94d5=function(_0x1702b9,_0x38c4c1){_0x1702b9=_0x1702b9-0x0;var _0x3d6a95=_0x4d59[_0x1702b9];return _0x3d6a95;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x94d5('0x0'))['db'][_0x94d5('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x94d5('0x2')](0x0);var events={'afterCreate':_0x94d5('0x3'),'afterUpdate':_0x94d5('0x4'),'afterDestroy':_0x94d5('0x5')};function emitEvent(_0x1f85d9){return function(_0x122148,_0x4a413c,_0x2efe89){MailQueueEvents[_0x94d5('0x6')](_0x1f85d9+':'+_0x122148['id'],_0x122148);MailQueueEvents[_0x94d5('0x6')](_0x1f85d9,_0x122148);_0x2efe89(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue['hook'](e,emitEvent(event));}}module[_0x94d5('0x7')]=MailQueueEvents; \ No newline at end of file +var _0x3061=['emit','hook','exports','../../mysqldb','MailQueue','save','update','remove'];(function(_0x86d32e,_0x3a0bf1){var _0x50a35e=function(_0x414a12){while(--_0x414a12){_0x86d32e['push'](_0x86d32e['shift']());}};_0x50a35e(++_0x3a0bf1);}(_0x3061,0xe3));var _0x1306=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x3061[_0x4c6d6f];return _0x2d4478;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1306('0x0'))['db'][_0x1306('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1306('0x2'),'afterUpdate':_0x1306('0x3'),'afterDestroy':_0x1306('0x4')};function emitEvent(_0x49f8a2){return function(_0x2e91e2,_0x5f52a5,_0x13e4a7){MailQueueEvents[_0x1306('0x5')](_0x49f8a2+':'+_0x2e91e2['id'],_0x2e91e2);MailQueueEvents['emit'](_0x49f8a2,_0x2e91e2);_0x13e4a7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x1306('0x6')](e,emitEvent(event));}}module[_0x1306('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 3f72f0a..ed1b500 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 _0x9c52=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','./mailQueue.attributes','exports'];(function(_0x35dc09,_0x489738){var _0x146159=function(_0x49613b){while(--_0x49613b){_0x35dc09['push'](_0x35dc09['shift']());}};_0x146159(++_0x489738);}(_0x9c52,0x123));var _0x29c5=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x9c52[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x29c5('0x0'));var util=require(_0x29c5('0x1'));var logger=require(_0x29c5('0x2'))(_0x29c5('0x3'));var moment=require(_0x29c5('0x4'));var BPromise=require('bluebird');var rp=require(_0x29c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x29c5('0x6'));var attributes=require(_0x29c5('0x7'));module[_0x29c5('0x8')]=function(_0x4a4bc0,_0x286ded){return _0x4a4bc0[_0x29c5('0x9')](_0x29c5('0xa'),attributes,{'tableName':_0x29c5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf84d=['define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports'];(function(_0x1f31f6,_0x53921f){var _0x3e3848=function(_0x2deb5f){while(--_0x2deb5f){_0x1f31f6['push'](_0x1f31f6['shift']());}};_0x3e3848(++_0x53921f);}(_0xf84d,0xc7));var _0xdf84=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xf84d[_0x160c73];return _0xd9302;};'use strict';var _=require(_0xdf84('0x0'));var util=require(_0xdf84('0x1'));var logger=require(_0xdf84('0x2'))(_0xdf84('0x3'));var moment=require(_0xdf84('0x4'));var BPromise=require(_0xdf84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf84('0x6'));var rimraf=require(_0xdf84('0x7'));var config=require(_0xdf84('0x8'));var attributes=require(_0xdf84('0x9'));module[_0xdf84('0xa')]=function(_0x1d7c00,_0x438ed9){return _0x1d7c00[_0xdf84('0xb')](_0xdf84('0xc'),attributes,{'tableName':_0xdf84('0xd'),'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 dafc754..282fd23 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 _0x95e6=['MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailQueue','findAll','options','raw','where','attributes','include','map','model','MailQueue','find','debug','ShowMailQueue','lodash','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','info','MailQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x5d5e3b,_0xc516c3){var _0x4d559d=function(_0x3a25ed){while(--_0x3a25ed){_0x5d5e3b['push'](_0x5d5e3b['shift']());}};_0x4d559d(++_0xc516c3);}(_0x95e6,0x171));var _0x695e=function(_0x4893d0,_0x48855a){_0x4893d0=_0x4893d0-0x0;var _0x3db72f=_0x95e6[_0x4893d0];return _0x3db72f;};'use strict';var _=require(_0x695e('0x0'));var util=require('util');var moment=require(_0x695e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x695e('0x2'))['db'];var utils=require(_0x695e('0x3'));var logger=require(_0x695e('0x4'))(_0x695e('0x5'));var config=require('../../config/environment');var jayson=require(_0x695e('0x6'));var client=jayson[_0x695e('0x7')]['http']({'port':0x232a});config[_0x695e('0x8')]=_[_0x695e('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x695e('0xa'))(new Redis(config[_0x695e('0x8')]));require('./mailQueue.socket')[_0x695e('0xb')](socket);function respondWithRpcPromise(_0x58746c,_0x2e8617,_0x2ae69a){return new BPromise(function(_0x3350de,_0x244ea6){return client['request'](_0x58746c,_0x2ae69a)[_0x695e('0xc')](function(_0x5be4fb){logger[_0x695e('0xd')](_0x695e('0xe'),_0x2e8617,_0x695e('0xf'));logger['debug'](_0x695e('0x10'),_0x2e8617,_0x695e('0xf'),JSON[_0x695e('0x11')](_0x5be4fb));if(_0x5be4fb['error']){if(_0x5be4fb[_0x695e('0x12')][_0x695e('0x13')]===0x1f4){logger[_0x695e('0x12')](_0x695e('0xe'),_0x2e8617,_0x5be4fb[_0x695e('0x12')][_0x695e('0x14')]);return _0x244ea6(_0x5be4fb['error']['message']);}logger[_0x695e('0x12')]('MailQueue,\x20%s,\x20%s',_0x2e8617,_0x5be4fb[_0x695e('0x12')][_0x695e('0x14')]);return _0x3350de(_0x5be4fb[_0x695e('0x12')][_0x695e('0x14')]);}else{logger[_0x695e('0xd')]('MailQueue,\x20%s,\x20%s',_0x2e8617,'request\x20sent');_0x3350de(_0x5be4fb['result'][_0x695e('0x14')]);}})[_0x695e('0x15')](function(_0x4b2166){logger[_0x695e('0x12')](_0x695e('0xe'),_0x2e8617,_0x4b2166);_0x244ea6(_0x4b2166);});});}exports[_0x695e('0x16')]=function(_0x4e5b88){var _0x309b8a=this;return new Promise(function(_0x3b1259,_0x5370c8){return db['MailQueue'][_0x695e('0x17')]({'raw':_0x4e5b88[_0x695e('0x18')]?_0x4e5b88[_0x695e('0x18')][_0x695e('0x19')]===undefined?!![]:![]:!![],'where':_0x4e5b88[_0x695e('0x18')]?_0x4e5b88[_0x695e('0x18')][_0x695e('0x1a')]||null:null,'attributes':_0x4e5b88[_0x695e('0x18')]?_0x4e5b88['options'][_0x695e('0x1b')]||null:null,'limit':_0x4e5b88[_0x695e('0x18')]?_0x4e5b88[_0x695e('0x18')]['limit']||null:null,'include':_0x4e5b88['options']?_0x4e5b88[_0x695e('0x18')][_0x695e('0x1c')]?_[_0x695e('0x1d')](_0x4e5b88[_0x695e('0x18')][_0x695e('0x1c')],function(_0x2dea7a){return{'model':db[_0x2dea7a['model']],'as':_0x2dea7a['as'],'attributes':_0x2dea7a[_0x695e('0x1b')],'include':_0x2dea7a[_0x695e('0x1c')]?_[_0x695e('0x1d')](_0x2dea7a[_0x695e('0x1c')],function(_0x34c4d4){return{'model':db[_0x34c4d4[_0x695e('0x1e')]],'as':_0x34c4d4['as'],'attributes':_0x34c4d4[_0x695e('0x1b')],'include':_0x34c4d4[_0x695e('0x1c')]?_[_0x695e('0x1d')](_0x34c4d4['include'],function(_0x355d63){return{'model':db[_0x355d63[_0x695e('0x1e')]],'as':_0x355d63['as'],'attributes':_0x355d63[_0x695e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x695e('0xc')](function(_0x5c1245){logger[_0x695e('0xd')](_0x695e('0x16'),_0x4e5b88);logger['debug'](_0x695e('0x16'),_0x4e5b88,JSON[_0x695e('0x11')](_0x5c1245));_0x3b1259(_0x5c1245);})[_0x695e('0x15')](function(_0x1c8b2a){logger['error']('GetMailQueue',_0x1c8b2a['message'],_0x4e5b88);_0x5370c8(_0x309b8a[_0x695e('0x12')](0x1f4,_0x1c8b2a[_0x695e('0x14')]));});});};exports['ShowMailQueue']=function(_0x436ae5){var _0x343d9f=this;return new Promise(function(_0x3b84e7,_0xc268cf){return db[_0x695e('0x1f')][_0x695e('0x20')]({'raw':_0x436ae5[_0x695e('0x18')]?_0x436ae5[_0x695e('0x18')][_0x695e('0x19')]===undefined?!![]:![]:!![],'where':_0x436ae5[_0x695e('0x18')]?_0x436ae5[_0x695e('0x18')][_0x695e('0x1a')]||null:null,'attributes':_0x436ae5[_0x695e('0x18')]?_0x436ae5[_0x695e('0x18')]['attributes']||null:null,'include':_0x436ae5['options']?_0x436ae5['options']['include']?_[_0x695e('0x1d')](_0x436ae5[_0x695e('0x18')][_0x695e('0x1c')],function(_0x35d28f){return{'model':db[_0x35d28f[_0x695e('0x1e')]],'as':_0x35d28f['as'],'attributes':_0x35d28f[_0x695e('0x1b')],'include':_0x35d28f['include']?_['map'](_0x35d28f[_0x695e('0x1c')],function(_0x12c21e){return{'model':db[_0x12c21e[_0x695e('0x1e')]],'as':_0x12c21e['as'],'attributes':_0x12c21e['attributes'],'include':_0x12c21e[_0x695e('0x1c')]?_[_0x695e('0x1d')](_0x12c21e[_0x695e('0x1c')],function(_0x3853d9){return{'model':db[_0x3853d9['model']],'as':_0x3853d9['as'],'attributes':_0x3853d9['attributes']};}):[]};}):[]};}):[]:[]})[_0x695e('0xc')](function(_0x16cde8){logger['info']('ShowMailQueue',_0x436ae5);logger[_0x695e('0x21')]('ShowMailQueue',_0x436ae5,JSON[_0x695e('0x11')](_0x16cde8));_0x3b84e7(_0x16cde8);})['catch'](function(_0x157750){logger[_0x695e('0x12')](_0x695e('0x22'),_0x157750[_0x695e('0x14')],_0x436ae5);_0xc268cf(_0x343d9f['error'](0x1f4,_0x157750[_0x695e('0x14')]));});});}; \ No newline at end of file +var _0x55b5=['MailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','findAll','options','where','limit','include','map','attributes','model','GetMailQueue','MailQueue','find','raw','then','ShowMailQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','localhost','./mailQueue.socket','request','info'];(function(_0x494b28,_0x1cc247){var _0x2ad0f4=function(_0x29bed4){while(--_0x29bed4){_0x494b28['push'](_0x494b28['shift']());}};_0x2ad0f4(++_0x1cc247);}(_0x55b5,0x11a));var _0x555b=function(_0x55b1a8,_0x588ed6){_0x55b1a8=_0x55b1a8-0x0;var _0x523b26=_0x55b5[_0x55b1a8];return _0x523b26;};'use strict';var _=require(_0x555b('0x0'));var util=require(_0x555b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x555b('0x2'));var fs=require('fs');var Redis=require(_0x555b('0x3'));var db=require(_0x555b('0x4'))['db'];var utils=require(_0x555b('0x5'));var logger=require(_0x555b('0x6'))(_0x555b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x555b('0x8')]({'port':0x232a});config[_0x555b('0x9')]=_['defaults'](config[_0x555b('0x9')],{'host':_0x555b('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x555b('0x9')]));require(_0x555b('0xb'))['register'](socket);function respondWithRpcPromise(_0x3ffcfd,_0x4b235d,_0x35562f){return new BPromise(function(_0x532ffe,_0x5d2b13){return client[_0x555b('0xc')](_0x3ffcfd,_0x35562f)['then'](function(_0xd6b026){logger[_0x555b('0xd')](_0x555b('0xe'),_0x4b235d,_0x555b('0xf'));logger[_0x555b('0x10')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x4b235d,_0x555b('0xf'),JSON[_0x555b('0x11')](_0xd6b026));if(_0xd6b026[_0x555b('0x12')]){if(_0xd6b026[_0x555b('0x12')][_0x555b('0x13')]===0x1f4){logger[_0x555b('0x12')](_0x555b('0xe'),_0x4b235d,_0xd6b026['error'][_0x555b('0x14')]);return _0x5d2b13(_0xd6b026[_0x555b('0x12')][_0x555b('0x14')]);}logger['error'](_0x555b('0xe'),_0x4b235d,_0xd6b026[_0x555b('0x12')][_0x555b('0x14')]);return _0x532ffe(_0xd6b026[_0x555b('0x12')][_0x555b('0x14')]);}else{logger[_0x555b('0xd')]('MailQueue,\x20%s,\x20%s',_0x4b235d,_0x555b('0xf'));_0x532ffe(_0xd6b026[_0x555b('0x15')][_0x555b('0x14')]);}})[_0x555b('0x16')](function(_0x36d37b){logger[_0x555b('0x12')](_0x555b('0xe'),_0x4b235d,_0x36d37b);_0x5d2b13(_0x36d37b);});});}exports['GetMailQueue']=function(_0x22b64e){var _0x4b2209=this;return new Promise(function(_0x4c3d59,_0x2f4214){return db['MailQueue'][_0x555b('0x17')]({'raw':_0x22b64e[_0x555b('0x18')]?_0x22b64e['options']['raw']===undefined?!![]:![]:!![],'where':_0x22b64e['options']?_0x22b64e[_0x555b('0x18')][_0x555b('0x19')]||null:null,'attributes':_0x22b64e[_0x555b('0x18')]?_0x22b64e[_0x555b('0x18')]['attributes']||null:null,'limit':_0x22b64e[_0x555b('0x18')]?_0x22b64e[_0x555b('0x18')][_0x555b('0x1a')]||null:null,'include':_0x22b64e[_0x555b('0x18')]?_0x22b64e[_0x555b('0x18')][_0x555b('0x1b')]?_[_0x555b('0x1c')](_0x22b64e[_0x555b('0x18')][_0x555b('0x1b')],function(_0x335700){return{'model':db[_0x335700['model']],'as':_0x335700['as'],'attributes':_0x335700[_0x555b('0x1d')],'include':_0x335700['include']?_[_0x555b('0x1c')](_0x335700[_0x555b('0x1b')],function(_0x324048){return{'model':db[_0x324048[_0x555b('0x1e')]],'as':_0x324048['as'],'attributes':_0x324048[_0x555b('0x1d')],'include':_0x324048['include']?_[_0x555b('0x1c')](_0x324048[_0x555b('0x1b')],function(_0x75485a){return{'model':db[_0x75485a[_0x555b('0x1e')]],'as':_0x75485a['as'],'attributes':_0x75485a[_0x555b('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32296){logger[_0x555b('0xd')](_0x555b('0x1f'),_0x22b64e);logger['debug'](_0x555b('0x1f'),_0x22b64e,JSON[_0x555b('0x11')](_0x32296));_0x4c3d59(_0x32296);})[_0x555b('0x16')](function(_0x211cd0){logger[_0x555b('0x12')](_0x555b('0x1f'),_0x211cd0['message'],_0x22b64e);_0x2f4214(_0x4b2209[_0x555b('0x12')](0x1f4,_0x211cd0[_0x555b('0x14')]));});});};exports['ShowMailQueue']=function(_0x5c65ea){var _0x42b4eb=this;return new Promise(function(_0x447329,_0x36675f){return db[_0x555b('0x20')][_0x555b('0x21')]({'raw':_0x5c65ea[_0x555b('0x18')]?_0x5c65ea[_0x555b('0x18')][_0x555b('0x22')]===undefined?!![]:![]:!![],'where':_0x5c65ea['options']?_0x5c65ea[_0x555b('0x18')][_0x555b('0x19')]||null:null,'attributes':_0x5c65ea[_0x555b('0x18')]?_0x5c65ea[_0x555b('0x18')][_0x555b('0x1d')]||null:null,'include':_0x5c65ea[_0x555b('0x18')]?_0x5c65ea[_0x555b('0x18')]['include']?_[_0x555b('0x1c')](_0x5c65ea[_0x555b('0x18')][_0x555b('0x1b')],function(_0x2f4777){return{'model':db[_0x2f4777[_0x555b('0x1e')]],'as':_0x2f4777['as'],'attributes':_0x2f4777[_0x555b('0x1d')],'include':_0x2f4777[_0x555b('0x1b')]?_[_0x555b('0x1c')](_0x2f4777[_0x555b('0x1b')],function(_0x7321ea){return{'model':db[_0x7321ea[_0x555b('0x1e')]],'as':_0x7321ea['as'],'attributes':_0x7321ea[_0x555b('0x1d')],'include':_0x7321ea[_0x555b('0x1b')]?_['map'](_0x7321ea[_0x555b('0x1b')],function(_0x988d07){return{'model':db[_0x988d07[_0x555b('0x1e')]],'as':_0x988d07['as'],'attributes':_0x988d07['attributes']};}):[]};}):[]};}):[]:[]})[_0x555b('0x23')](function(_0x4fff59){logger[_0x555b('0xd')](_0x555b('0x24'),_0x5c65ea);logger['debug'](_0x555b('0x24'),_0x5c65ea,JSON[_0x555b('0x11')](_0x4fff59));_0x447329(_0x4fff59);})[_0x555b('0x16')](function(_0x5eba53){logger[_0x555b('0x12')]('ShowMailQueue',_0x5eba53[_0x555b('0x14')],_0x5c65ea);_0x36675f(_0x42b4eb[_0x555b('0x12')](0x1f4,_0x5eba53['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 670599a..e8ea9af 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 _0x80fa=['remove','update','emit','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0x80fa,0x18a));var _0xa80f=function(_0x50935e,_0x5d8ad7){_0x50935e=_0x50935e-0x0;var _0x2ed34b=_0x80fa[_0x50935e];return _0x2ed34b;};'use strict';var MailQueueEvents=require(_0xa80f('0x0'));var events=[_0xa80f('0x1'),_0xa80f('0x2'),_0xa80f('0x3')];function createListener(_0x302858,_0x91a6c3){return function(_0x41f71b){_0x91a6c3[_0xa80f('0x4')](_0x302858,_0x41f71b);};}function removeListener(_0x5e2a30,_0x287251){return function(){MailQueueEvents[_0xa80f('0x5')](_0x5e2a30,_0x287251);};}exports[_0xa80f('0x6')]=function(_0x4bae07){for(var _0x52b315=0x0,_0x32838b=events[_0xa80f('0x7')];_0x52b315<_0x32838b;_0x52b315++){var _0x433726=events[_0x52b315];var _0x858891=createListener(_0xa80f('0x8')+_0x433726,_0x4bae07);MailQueueEvents['on'](_0x433726,_0x858891);}}; \ No newline at end of file +var _0x6212=['length','mailQueue:','save','remove','update','emit','removeListener','register'];(function(_0x202228,_0x3cc916){var _0x11b337=function(_0x598b79){while(--_0x598b79){_0x202228['push'](_0x202228['shift']());}};_0x11b337(++_0x3cc916);}(_0x6212,0x1d2));var _0x2621=function(_0x353eff,_0xccbe19){_0x353eff=_0x353eff-0x0;var _0x177a2a=_0x6212[_0x353eff];return _0x177a2a;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x2621('0x0'),_0x2621('0x1'),_0x2621('0x2')];function createListener(_0x57bd42,_0x25b5df){return function(_0x368b8c){_0x25b5df[_0x2621('0x3')](_0x57bd42,_0x368b8c);};}function removeListener(_0x21118f,_0x2d8d09){return function(){MailQueueEvents[_0x2621('0x4')](_0x21118f,_0x2d8d09);};}exports[_0x2621('0x5')]=function(_0x36216b){for(var _0x1d4bea=0x0,_0x4b592e=events[_0x2621('0x6')];_0x1d4bea<_0x4b592e;_0x1d4bea++){var _0x6f5719=events[_0x1d4bea];var _0x2ff86d=createListener(_0x2621('0x7')+_0x6f5719,_0x36216b);MailQueueEvents['on'](_0x6f5719,_0x2ff86d);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 5d9fba1..6423abf 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 _0x273b=['get','isAuthenticated','index','/describe','describe','post','put','/:id','update','destroy','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x58b018,_0x5ac734){var _0x3ac228=function(_0x2b1a0c){while(--_0x2b1a0c){_0x58b018['push'](_0x58b018['shift']());}};_0x3ac228(++_0x5ac734);}(_0x273b,0x8a));var _0xb273=function(_0x3a8b89,_0x26ca0e){_0x3a8b89=_0x3a8b89-0x0;var _0x3a0c68=_0x273b[_0x3a8b89];return _0x3a0c68;};'use strict';var multer=require('multer');var util=require(_0xb273('0x0'));var path=require('path');var timeout=require(_0xb273('0x1'));var express=require(_0xb273('0x2'));var router=express['Router']();var fs_extra=require(_0xb273('0x3'));var auth=require(_0xb273('0x4'));var interaction=require(_0xb273('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xb273('0x6')]('/',auth[_0xb273('0x7')](),controller[_0xb273('0x8')]);router['get'](_0xb273('0x9'),auth[_0xb273('0x7')](),controller[_0xb273('0xa')]);router[_0xb273('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xb273('0xb')]('/',auth[_0xb273('0x7')](),controller['create']);router[_0xb273('0xc')](_0xb273('0xd'),auth[_0xb273('0x7')](),controller[_0xb273('0xe')]);router['delete'](_0xb273('0xd'),auth[_0xb273('0x7')](),controller[_0xb273('0xf')]);module['exports']=router; \ No newline at end of file +var _0x0610=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','delete','destroy','exports','multer'];(function(_0xb5b75b,_0x49e4a5){var _0x9bd93a=function(_0x2cd87f){while(--_0x2cd87f){_0xb5b75b['push'](_0xb5b75b['shift']());}};_0x9bd93a(++_0x49e4a5);}(_0x0610,0xbf));var _0x0061=function(_0x521cea,_0x22c273){_0x521cea=_0x521cea-0x0;var _0x17d15c=_0x0610[_0x521cea];return _0x17d15c;};'use strict';var multer=require(_0x0061('0x0'));var util=require(_0x0061('0x1'));var path=require(_0x0061('0x2'));var timeout=require(_0x0061('0x3'));var express=require(_0x0061('0x4'));var router=express[_0x0061('0x5')]();var fs_extra=require(_0x0061('0x6'));var auth=require(_0x0061('0x7'));var interaction=require(_0x0061('0x8'));var config=require(_0x0061('0x9'));var controller=require(_0x0061('0xa'));router[_0x0061('0xb')]('/',auth[_0x0061('0xc')](),controller[_0x0061('0xd')]);router['get'](_0x0061('0xe'),auth[_0x0061('0xc')](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x0061('0xf')]);router[_0x0061('0x10')]('/',auth['isAuthenticated'](),controller[_0x0061('0x11')]);router[_0x0061('0x12')](_0x0061('0x13'),auth[_0x0061('0xc')](),controller[_0x0061('0x14')]);router[_0x0061('0x15')](_0x0061('0x13'),auth[_0x0061('0xc')](),controller[_0x0061('0x16')]);module[_0x0061('0x17')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 4f05fff..1bb8af6 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 _0x8cdc=['moment','exports','STRING','DATE'];(function(_0x3e5efa,_0x37ca35){var _0x19dec5=function(_0x175061){while(--_0x175061){_0x3e5efa['push'](_0x3e5efa['shift']());}};_0x19dec5(++_0x37ca35);}(_0x8cdc,0x1ec));var _0xc8cd=function(_0x1699c7,_0x55e15a){_0x1699c7=_0x1699c7-0x0;var _0x23dbd3=_0x8cdc[_0x1699c7];return _0x23dbd3;};'use strict';var moment=require(_0xc8cd('0x0'));var Sequelize=require('sequelize');module[_0xc8cd('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xc8cd('0x2')]},'joinAt':{'type':Sequelize[_0xc8cd('0x3')]},'leaveAt':{'type':Sequelize[_0xc8cd('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xc8cd('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x585b=['DATE','moment','sequelize','exports','STRING'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x585b,0x97));var _0xb585=function(_0x487b0c,_0x14ff74){_0x487b0c=_0x487b0c-0x0;var _0x1adbdc=_0x585b[_0x487b0c];return _0x1adbdc;};'use strict';var moment=require(_0xb585('0x0'));var Sequelize=require(_0xb585('0x1'));module[_0xb585('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb585('0x3')]},'joinAt':{'type':Sequelize[_0xb585('0x4')]},'leaveAt':{'type':Sequelize[_0xb585('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xb585('0x4')]},'reason':{'type':Sequelize[_0xb585('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index be2e4cc..559beb0 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 _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','MailQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x507dd4,_0x2b1a65){var _0x3cf1fa=function(_0x17829b){while(--_0x17829b){_0x507dd4['push'](_0x507dd4['shift']());}};_0x3cf1fa(++_0x2b1a65);}(_0x1a85,0x178));var _0x51a8=function(_0xf34895,_0x21fb70){_0xf34895=_0xf34895-0x0;var _0x143f44=_0x1a85[_0xf34895];return _0x143f44;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':!![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['MailQueueReport'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,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(_0x120475,_0x758f40){var _0x592884=function(_0x469dce){while(--_0x469dce){_0x120475['push'](_0x120475['shift']());}};_0x592884(++_0x758f40);}(_0x2ef3,0xba));var _0x32ef=function(_0x5d1043,_0x37b5cd){_0x5d1043=_0x5d1043-0x0;var _0x809738=_0x2ef3[_0x5d1043];return _0x809738;};'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 e0bd7c9..eec12d8 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 _0x6235=['../../config/environment','exports','define','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x494e72,_0x5f1178){var _0x2d3947=function(_0x165f2b){while(--_0x165f2b){_0x494e72['push'](_0x494e72['shift']());}};_0x2d3947(++_0x5f1178);}(_0x6235,0xd1));var _0x5623=function(_0x38350a,_0x4859e0){_0x38350a=_0x38350a-0x0;var _0x8475b9=_0x6235[_0x38350a];return _0x8475b9;};'use strict';var _=require(_0x5623('0x0'));var util=require(_0x5623('0x1'));var logger=require('../../config/logger')(_0x5623('0x2'));var moment=require(_0x5623('0x3'));var BPromise=require(_0x5623('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5623('0x5'));var rimraf=require(_0x5623('0x6'));var config=require(_0x5623('0x7'));var attributes=require('./mailQueueReport.attributes');module[_0x5623('0x8')]=function(_0x5052ea,_0x2ca108){return _0x5052ea[_0x5623('0x9')]('MailQueueReport',attributes,{'tableName':_0x5623('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x5623('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4128=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./mailQueueReport.attributes','exports','report_mail_queue'];(function(_0x2ed8a5,_0x4ec775){var _0x3e7996=function(_0x128606){while(--_0x128606){_0x2ed8a5['push'](_0x2ed8a5['shift']());}};_0x3e7996(++_0x4ec775);}(_0x4128,0x1a5));var _0x8412=function(_0x6621a0,_0x3a4a13){_0x6621a0=_0x6621a0-0x0;var _0x3a61c6=_0x4128[_0x6621a0];return _0x3a61c6;};'use strict';var _=require(_0x8412('0x0'));var util=require(_0x8412('0x1'));var logger=require(_0x8412('0x2'))(_0x8412('0x3'));var moment=require(_0x8412('0x4'));var BPromise=require(_0x8412('0x5'));var rp=require(_0x8412('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8412('0x7'));var config=require('../../config/environment');var attributes=require(_0x8412('0x8'));module[_0x8412('0x9')]=function(_0x4ee687,_0x30934c){return _0x4ee687['define']('MailQueueReport',attributes,{'tableName':_0x8412('0xa'),'paranoid':![],'indexes':[{'name':_0x8412('0xb'),'fields':[_0x8412('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 2865544..8835911 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(_0x234341,_0x1f0568){var _0x2fd6e9=function(_0x1fd8dd){while(--_0x1fd8dd){_0x234341['push'](_0x234341['shift']());}};_0x2fd6e9(++_0x1f0568);}(_0xdb28,0x106));var _0x8db2=function(_0x502e1c,_0x5e4407){_0x502e1c=_0x502e1c-0x0;var _0x102833=_0xdb28[_0x502e1c];return _0x102833;};'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 _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(_0x39de46,_0x475bc7){var _0x401672=function(_0x550f36){while(--_0x550f36){_0x39de46['push'](_0x39de46['shift']());}};_0x401672(++_0x475bc7);}(_0xdb28,0x106));var _0x8db2=function(_0x3f87cf,_0x4c5100){_0x3f87cf=_0x3f87cf-0x0;var _0x29a173=_0xdb28[_0x3f87cf];return _0x29a173;};'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 diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index e029dc3..ca19508 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(_0x65dc1a,_0x535ab8){var _0xcc4e7a=function(_0x47a6f5){while(--_0x47a6f5){_0x65dc1a['push'](_0x65dc1a['shift']());}};_0xcc4e7a(++_0x535ab8);}(_0xe706,0xa3));var _0x6e70=function(_0x1fb94f,_0x2812e7){_0x1fb94f=_0x1fb94f-0x0;var _0x2a1bd0=_0xe706[_0x1fb94f];return _0x2a1bd0;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1c8489,_0x80368c){var _0x16a60f=function(_0x9629e8){while(--_0x9629e8){_0x1c8489['push'](_0x1c8489['shift']());}};_0x16a60f(++_0x80368c);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 8788224..b02d8c1 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 _0xab7a=['INBOX','exports','BOOLEAN','STRING','INTEGER'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xab7a,0x88));var _0xaab7=function(_0x587b8b,_0x48ffe5){_0x587b8b=_0x587b8b-0x0;var _0x2dbc77=_0xab7a[_0x587b8b];return _0x2dbc77;};'use strict';var Sequelize=require('sequelize');module[_0xaab7('0x0')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xaab7('0x1')],'defaultValue':!![]},'user':{'type':Sequelize[_0xaab7('0x2')]},'password':{'type':Sequelize[_0xaab7('0x2')]},'port':{'type':Sequelize[_0xaab7('0x3')]},'tls':{'type':Sequelize[_0xaab7('0x1')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xaab7('0x2')],'defaultValue':_0xaab7('0x4')},'connTimeout':{'type':Sequelize[_0xaab7('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xae99=['BOOLEAN','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x5de555,_0x3747a2){var _0xdfa467=function(_0xcd9738){while(--_0xcd9738){_0x5de555['push'](_0x5de555['shift']());}};_0xdfa467(++_0x3747a2);}(_0xae99,0x6f));var _0x9ae9=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xae99[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x9ae9('0x0'));module[_0x9ae9('0x1')]={'description':{'type':Sequelize[_0x9ae9('0x2')]},'host':{'type':Sequelize[_0x9ae9('0x2')]},'authentication':{'type':Sequelize[_0x9ae9('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x9ae9('0x2')]},'password':{'type':Sequelize[_0x9ae9('0x2')]},'port':{'type':Sequelize[_0x9ae9('0x4')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x9ae9('0x2')],'defaultValue':_0x9ae9('0x5')},'connTimeout':{'type':Sequelize[_0x9ae9('0x4')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x9ae9('0x4')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']},'modernAuthentication':{'type':Sequelize[_0x9ae9('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 ec38491..a6f6ae5 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 _0xcac0=['../../config/environment','./mailServerIn.attributes','MailServerIn','mail_servers_in','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3b5d4b,_0x39e971){var _0x965b3e=function(_0xcd5cb5){while(--_0xcd5cb5){_0x3b5d4b['push'](_0x3b5d4b['shift']());}};_0x965b3e(++_0x39e971);}(_0xcac0,0x154));var _0x0cac=function(_0x4fb614,_0x3f1fad){_0x4fb614=_0x4fb614-0x0;var _0x1057ca=_0xcac0[_0x4fb614];return _0x1057ca;};'use strict';var _=require(_0x0cac('0x0'));var util=require('util');var logger=require(_0x0cac('0x1'))(_0x0cac('0x2'));var moment=require(_0x0cac('0x3'));var BPromise=require(_0x0cac('0x4'));var rp=require(_0x0cac('0x5'));var fs=require('fs');var path=require(_0x0cac('0x6'));var rimraf=require(_0x0cac('0x7'));var config=require(_0x0cac('0x8'));var attributes=require(_0x0cac('0x9'));module['exports']=function(_0x3be622,_0xd33b03){return _0x3be622['define'](_0x0cac('0xa'),attributes,{'tableName':_0x0cac('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9f60=['../../config/environment','./mailServerIn.attributes','exports','define','mail_servers_in','lodash','util','../../config/logger','request-promise','path','rimraf'];(function(_0x188917,_0x1ec7cf){var _0x4ff346=function(_0x1ee5b2){while(--_0x1ee5b2){_0x188917['push'](_0x188917['shift']());}};_0x4ff346(++_0x1ec7cf);}(_0x9f60,0x1b2));var _0x09f6=function(_0x546324,_0x30c70e){_0x546324=_0x546324-0x0;var _0x2225b1=_0x9f60[_0x546324];return _0x2225b1;};'use strict';var _=require(_0x09f6('0x0'));var util=require(_0x09f6('0x1'));var logger=require(_0x09f6('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x09f6('0x3'));var fs=require('fs');var path=require(_0x09f6('0x4'));var rimraf=require(_0x09f6('0x5'));var config=require(_0x09f6('0x6'));var attributes=require(_0x09f6('0x7'));module[_0x09f6('0x8')]=function(_0x2f23b0,_0x5c41d1){return _0x2f23b0[_0x09f6('0x9')]('MailServerIn',attributes,{'tableName':_0x09f6('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 3543ea8..29dcd3e 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 _0xdcf9=['limit','model','include','map','GetMailServerIn','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','MailServerIn,\x20%s,\x20%s','message','request\x20sent','result','catch','MailServerIn','findAll','options','raw','where','attributes'];(function(_0x11c720,_0x4209bf){var _0x54b2ac=function(_0x47df5e){while(--_0x47df5e){_0x11c720['push'](_0x11c720['shift']());}};_0x54b2ac(++_0x4209bf);}(_0xdcf9,0x101));var _0x9dcf=function(_0x13dd8d,_0x2c9599){_0x13dd8d=_0x13dd8d-0x0;var _0x3a9a21=_0xdcf9[_0x13dd8d];return _0x3a9a21;};'use strict';var _=require(_0x9dcf('0x0'));var util=require(_0x9dcf('0x1'));var moment=require(_0x9dcf('0x2'));var BPromise=require(_0x9dcf('0x3'));var rs=require(_0x9dcf('0x4'));var fs=require('fs');var Redis=require(_0x9dcf('0x5'));var db=require(_0x9dcf('0x6'))['db'];var utils=require(_0x9dcf('0x7'));var logger=require(_0x9dcf('0x8'))(_0x9dcf('0x9'));var config=require(_0x9dcf('0xa'));var jayson=require(_0x9dcf('0xb'));var client=jayson[_0x9dcf('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c6588,_0x5cad6d,_0x19567a){return new BPromise(function(_0x16d36d,_0x1399f2){return client[_0x9dcf('0xd')](_0x4c6588,_0x19567a)[_0x9dcf('0xe')](function(_0x5399cb){logger[_0x9dcf('0xf')]('MailServerIn,\x20%s,\x20%s',_0x5cad6d,'request\x20sent');logger['debug'](_0x9dcf('0x10'),_0x5cad6d,'request\x20sent',JSON[_0x9dcf('0x11')](_0x5399cb));if(_0x5399cb[_0x9dcf('0x12')]){if(_0x5399cb['error'][_0x9dcf('0x13')]===0x1f4){logger[_0x9dcf('0x12')](_0x9dcf('0x14'),_0x5cad6d,_0x5399cb['error'][_0x9dcf('0x15')]);return _0x1399f2(_0x5399cb['error'][_0x9dcf('0x15')]);}logger['error']('MailServerIn,\x20%s,\x20%s',_0x5cad6d,_0x5399cb['error'][_0x9dcf('0x15')]);return _0x16d36d(_0x5399cb[_0x9dcf('0x12')]['message']);}else{logger[_0x9dcf('0xf')]('MailServerIn,\x20%s,\x20%s',_0x5cad6d,_0x9dcf('0x16'));_0x16d36d(_0x5399cb[_0x9dcf('0x17')][_0x9dcf('0x15')]);}})[_0x9dcf('0x18')](function(_0x289bd4){logger[_0x9dcf('0x12')]('MailServerIn,\x20%s,\x20%s',_0x5cad6d,_0x289bd4);_0x1399f2(_0x289bd4);});});}exports['GetMailServerIn']=function(_0x335f63){var _0xf4aced=this;return new Promise(function(_0x4ec571,_0x4dfc39){return db[_0x9dcf('0x19')][_0x9dcf('0x1a')]({'raw':_0x335f63[_0x9dcf('0x1b')]?_0x335f63[_0x9dcf('0x1b')][_0x9dcf('0x1c')]===undefined?!![]:![]:!![],'where':_0x335f63[_0x9dcf('0x1b')]?_0x335f63[_0x9dcf('0x1b')][_0x9dcf('0x1d')]||null:null,'attributes':_0x335f63[_0x9dcf('0x1b')]?_0x335f63[_0x9dcf('0x1b')][_0x9dcf('0x1e')]||null:null,'limit':_0x335f63[_0x9dcf('0x1b')]?_0x335f63['options'][_0x9dcf('0x1f')]||null:null,'include':_0x335f63['options']?_0x335f63['options']['include']?_['map'](_0x335f63[_0x9dcf('0x1b')]['include'],function(_0x364a23){return{'model':db[_0x364a23[_0x9dcf('0x20')]],'as':_0x364a23['as'],'attributes':_0x364a23['attributes'],'include':_0x364a23[_0x9dcf('0x21')]?_[_0x9dcf('0x22')](_0x364a23['include'],function(_0x35e5ee){return{'model':db[_0x35e5ee[_0x9dcf('0x20')]],'as':_0x35e5ee['as'],'attributes':_0x35e5ee[_0x9dcf('0x1e')],'include':_0x35e5ee[_0x9dcf('0x21')]?_['map'](_0x35e5ee[_0x9dcf('0x21')],function(_0x9ab5f){return{'model':db[_0x9ab5f[_0x9dcf('0x20')]],'as':_0x9ab5f['as'],'attributes':_0x9ab5f[_0x9dcf('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9dcf('0xe')](function(_0x5a7b8e){logger['info']('GetMailServerIn',_0x335f63);logger['debug'](_0x9dcf('0x23'),_0x335f63,JSON[_0x9dcf('0x11')](_0x5a7b8e));_0x4ec571(_0x5a7b8e);})[_0x9dcf('0x18')](function(_0x1161ad){logger[_0x9dcf('0x12')](_0x9dcf('0x23'),_0x1161ad[_0x9dcf('0x15')],_0x335f63);_0x4dfc39(_0xf4aced[_0x9dcf('0x12')](0x1f4,_0x1161ad[_0x9dcf('0x15')]));});});}; \ No newline at end of file +var _0xe9ff=['error','code','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','map','model','info','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s'];(function(_0x5c7484,_0x2b5da9){var _0x27bb40=function(_0x44cc2c){while(--_0x44cc2c){_0x5c7484['push'](_0x5c7484['shift']());}};_0x27bb40(++_0x2b5da9);}(_0xe9ff,0x17c));var _0xfe9f=function(_0x12b259,_0x1e1eb1){_0x12b259=_0x12b259-0x0;var _0x228148=_0xe9ff[_0x12b259];return _0x228148;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xfe9f('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe9f('0x1'));var db=require(_0xfe9f('0x2'))['db'];var utils=require(_0xfe9f('0x3'));var logger=require(_0xfe9f('0x4'))(_0xfe9f('0x5'));var config=require(_0xfe9f('0x6'));var jayson=require(_0xfe9f('0x7'));var client=jayson[_0xfe9f('0x8')][_0xfe9f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53767c,_0x8d1b92,_0x4e4857){return new BPromise(function(_0x4a837d,_0xbf526e){return client[_0xfe9f('0xa')](_0x53767c,_0x4e4857)[_0xfe9f('0xb')](function(_0x1d9197){logger['info'](_0xfe9f('0xc'),_0x8d1b92,_0xfe9f('0xd'));logger[_0xfe9f('0xe')](_0xfe9f('0xf'),_0x8d1b92,'request\x20sent',JSON['stringify'](_0x1d9197));if(_0x1d9197[_0xfe9f('0x10')]){if(_0x1d9197[_0xfe9f('0x10')][_0xfe9f('0x11')]===0x1f4){logger[_0xfe9f('0x10')](_0xfe9f('0xc'),_0x8d1b92,_0x1d9197[_0xfe9f('0x10')]['message']);return _0xbf526e(_0x1d9197[_0xfe9f('0x10')][_0xfe9f('0x12')]);}logger[_0xfe9f('0x10')](_0xfe9f('0xc'),_0x8d1b92,_0x1d9197[_0xfe9f('0x10')]['message']);return _0x4a837d(_0x1d9197[_0xfe9f('0x10')][_0xfe9f('0x12')]);}else{logger['info']('MailServerIn,\x20%s,\x20%s',_0x8d1b92,_0xfe9f('0xd'));_0x4a837d(_0x1d9197[_0xfe9f('0x13')][_0xfe9f('0x12')]);}})[_0xfe9f('0x14')](function(_0xb66244){logger['error'](_0xfe9f('0xc'),_0x8d1b92,_0xb66244);_0xbf526e(_0xb66244);});});}exports[_0xfe9f('0x15')]=function(_0x92b2dd){var _0x1296ee=this;return new Promise(function(_0x482355,_0x3c68a1){return db[_0xfe9f('0x16')][_0xfe9f('0x17')]({'raw':_0x92b2dd[_0xfe9f('0x18')]?_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x19')]===undefined?!![]:![]:!![],'where':_0x92b2dd[_0xfe9f('0x18')]?_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x1a')]||null:null,'attributes':_0x92b2dd[_0xfe9f('0x18')]?_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x1b')]||null:null,'limit':_0x92b2dd[_0xfe9f('0x18')]?_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x1c')]||null:null,'include':_0x92b2dd[_0xfe9f('0x18')]?_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x1d')]?_[_0xfe9f('0x1e')](_0x92b2dd[_0xfe9f('0x18')][_0xfe9f('0x1d')],function(_0x56db1f){return{'model':db[_0x56db1f['model']],'as':_0x56db1f['as'],'attributes':_0x56db1f[_0xfe9f('0x1b')],'include':_0x56db1f[_0xfe9f('0x1d')]?_[_0xfe9f('0x1e')](_0x56db1f['include'],function(_0x3f9298){return{'model':db[_0x3f9298[_0xfe9f('0x1f')]],'as':_0x3f9298['as'],'attributes':_0x3f9298['attributes'],'include':_0x3f9298[_0xfe9f('0x1d')]?_[_0xfe9f('0x1e')](_0x3f9298[_0xfe9f('0x1d')],function(_0x90772d){return{'model':db[_0x90772d[_0xfe9f('0x1f')]],'as':_0x90772d['as'],'attributes':_0x90772d[_0xfe9f('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xfe9f('0xb')](function(_0x54f848){logger[_0xfe9f('0x20')](_0xfe9f('0x15'),_0x92b2dd);logger[_0xfe9f('0xe')](_0xfe9f('0x15'),_0x92b2dd,JSON['stringify'](_0x54f848));_0x482355(_0x54f848);})[_0xfe9f('0x14')](function(_0x4ed4da){logger[_0xfe9f('0x10')](_0xfe9f('0x15'),_0x4ed4da['message'],_0x92b2dd);_0x3c68a1(_0x1296ee[_0xfe9f('0x10')](0x1f4,_0x4ed4da[_0xfe9f('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a6fb82b..c017f86 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(_0x4e9628,_0x250573){var _0x27bc8c=function(_0xb3b7ae){while(--_0xb3b7ae){_0x4e9628['push'](_0x4e9628['shift']());}};_0x27bc8c(++_0x250573);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 _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(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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 diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 6591ef6..cec6ca0 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 _0x13f6=['INTEGER','BOOLEAN','sequelize','exports','STRING'];(function(_0x243dd6,_0x44aeb9){var _0x199d45=function(_0x25690f){while(--_0x25690f){_0x243dd6['push'](_0x243dd6['shift']());}};_0x199d45(++_0x44aeb9);}(_0x13f6,0x124));var _0x613f=function(_0x403b65,_0x4ff5e4){_0x403b65=_0x403b65-0x0;var _0x2f61a2=_0x13f6[_0x403b65];return _0x2f61a2;};'use strict';var Sequelize=require(_0x613f('0x0'));module[_0x613f('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x613f('0x2')]},'pass':{'type':Sequelize[_0x613f('0x2')]},'port':{'type':Sequelize[_0x613f('0x3')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0x613f('0x2')]},'authentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0x613f('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xac4a=['exports','STRING','BOOLEAN','sequelize'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xac4a,0x13f));var _0xaac4=function(_0x5f4cfd,_0x4aa043){_0x5f4cfd=_0x5f4cfd-0x0;var _0x1a7d08=_0xac4a[_0x5f4cfd];return _0x1a7d08;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'description':{'type':Sequelize[_0xaac4('0x2')]},'host':{'type':Sequelize[_0xaac4('0x2')]},'user':{'type':Sequelize[_0xaac4('0x2')]},'pass':{'type':Sequelize[_0xaac4('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize[_0xaac4('0x2')]},'authentication':{'type':Sequelize[_0xaac4('0x3')],'defaultValue':!![]},'modernAuthentication':{'type':Sequelize[_0xaac4('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 b63ca91..e0c33d1 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 _0xf1da=['create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','MailServerOut','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','params','rawAttributes','find'];(function(_0x3e8915,_0x26795a){var _0x4bcc0d=function(_0x27a63c){while(--_0x27a63c){_0x3e8915['push'](_0x3e8915['shift']());}};_0x4bcc0d(++_0x26795a);}(_0xf1da,0xe6));var _0xaf1d=function(_0x319310,_0x50b3fc){_0x319310=_0x319310-0x0;var _0x3c8399=_0xf1da[_0x319310];return _0x3c8399;};'use strict';var emlformat=require(_0xaf1d('0x0'));var rimraf=require(_0xaf1d('0x1'));var zipdir=require(_0xaf1d('0x2'));var jsonpatch=require(_0xaf1d('0x3'));var rp=require(_0xaf1d('0x4'));var moment=require('moment');var BPromise=require(_0xaf1d('0x5'));var Mustache=require(_0xaf1d('0x6'));var util=require(_0xaf1d('0x7'));var path=require(_0xaf1d('0x8'));var sox=require(_0xaf1d('0x9'));var csv=require(_0xaf1d('0xa'));var ejs=require(_0xaf1d('0xb'));var fs=require('fs');var fs_extra=require(_0xaf1d('0xc'));var _=require(_0xaf1d('0xd'));var squel=require('squel');var crypto=require(_0xaf1d('0xe'));var jsforce=require(_0xaf1d('0xf'));var deskjs=require(_0xaf1d('0x10'));var toCsv=require(_0xaf1d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaf1d('0x11'));var authService=require(_0xaf1d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaf1d('0x13'));var hardwareService=require(_0xaf1d('0x14'));var logger=require(_0xaf1d('0x15'))('api');var utils=require(_0xaf1d('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaf1d('0x17'))['db'];function respondWithStatusCode(_0x2a7e53,_0x3fa7ea){_0x3fa7ea=_0x3fa7ea||0xcc;return function(_0x524451){if(_0x524451){return _0x2a7e53[_0xaf1d('0x18')](_0x3fa7ea);}return _0x2a7e53[_0xaf1d('0x19')](_0x3fa7ea)[_0xaf1d('0x1a')]();};}function respondWithResult(_0x163453,_0x322d5b){_0x322d5b=_0x322d5b||0xc8;return function(_0x5a31ea){if(_0x5a31ea){return _0x163453[_0xaf1d('0x19')](_0x322d5b)[_0xaf1d('0x1b')](_0x5a31ea);}};}function respondWithFilteredResult(_0x113dbe,_0x3bb721){return function(_0x4d355f){if(_0x4d355f){var _0x456bbf=typeof _0x3bb721[_0xaf1d('0x1c')]===_0xaf1d('0x1d')&&typeof _0x3bb721['limit']===_0xaf1d('0x1d');var _0x3bd657=_0x4d355f[_0xaf1d('0x1e')];var _0xf235fa=_0x456bbf?0x0:_0x3bb721[_0xaf1d('0x1c')];var _0xfbdac=_0x456bbf?_0x4d355f['count']:_0x3bb721['offset']+_0x3bb721['limit'];var _0x10ca16;if(_0xfbdac>=_0x3bd657){_0xfbdac=_0x3bd657;_0x10ca16=0xc8;}else{_0x10ca16=0xce;}_0x113dbe['status'](_0x10ca16);return _0x113dbe[_0xaf1d('0x1f')](_0xaf1d('0x20'),_0xf235fa+'-'+_0xfbdac+'/'+_0x3bd657)[_0xaf1d('0x1b')](_0x4d355f);}return null;};}function patchUpdates(_0x29a6c9){return function(_0x4cf0f7){try{jsonpatch[_0xaf1d('0x21')](_0x4cf0f7,_0x29a6c9,!![]);}catch(_0x50b800){return BPromise[_0xaf1d('0x22')](_0x50b800);}return _0x4cf0f7[_0xaf1d('0x23')]();};}function saveUpdates(_0x536d14,_0x3e044b){return function(_0x3cb1af){if(_0x3cb1af){return _0x3cb1af[_0xaf1d('0x24')](_0x536d14)[_0xaf1d('0x25')](function(_0x3e4d42){return _0x3e4d42;});}return null;};}function removeEntity(_0x36f755,_0x82706){return function(_0x43868c){if(_0x43868c){return _0x43868c[_0xaf1d('0x26')]()['then'](function(){_0x36f755[_0xaf1d('0x19')](0xcc)[_0xaf1d('0x1a')]();});}};}function handleEntityNotFound(_0x3cbeda,_0x530d7a){return function(_0x35954a){if(!_0x35954a){_0x3cbeda['sendStatus'](0x194);}return _0x35954a;};}function handleError(_0x18ba16,_0x1bf62e){_0x1bf62e=_0x1bf62e||0x1f4;return function(_0x4a97c9){logger[_0xaf1d('0x27')](_0x4a97c9[_0xaf1d('0x28')]);if(_0x4a97c9[_0xaf1d('0x29')]){delete _0x4a97c9['name'];}_0x18ba16[_0xaf1d('0x19')](_0x1bf62e)['send'](_0x4a97c9);};}exports[_0xaf1d('0x2a')]=function(_0x30b90d,_0x1552cb){var _0x21c78c={},_0x2f7c2e={},_0x12a0d5={'count':0x0,'rows':[]};var _0x40885c=_['map'](db[_0xaf1d('0x2b')]['rawAttributes'],function(_0x8bc7d3){return{'name':_0x8bc7d3[_0xaf1d('0x2c')],'type':_0x8bc7d3[_0xaf1d('0x2d')]['key']};});_0x2f7c2e[_0xaf1d('0x2e')]=_[_0xaf1d('0x2f')](_0x40885c,'name');_0x2f7c2e[_0xaf1d('0x30')]=_[_0xaf1d('0x31')](_0x30b90d[_0xaf1d('0x30')]);_0x2f7c2e[_0xaf1d('0x32')]=_[_0xaf1d('0x33')](_0x2f7c2e[_0xaf1d('0x2e')],_0x2f7c2e[_0xaf1d('0x30')]);_0x21c78c[_0xaf1d('0x34')]=_[_0xaf1d('0x33')](_0x2f7c2e[_0xaf1d('0x2e')],qs[_0xaf1d('0x35')](_0x30b90d['query'][_0xaf1d('0x35')]));_0x21c78c['attributes']=_0x21c78c[_0xaf1d('0x34')][_0xaf1d('0x36')]?_0x21c78c['attributes']:_0x2f7c2e[_0xaf1d('0x2e')];if(!_0x30b90d[_0xaf1d('0x30')][_0xaf1d('0x37')](_0xaf1d('0x38'))){_0x21c78c[_0xaf1d('0x39')]=qs[_0xaf1d('0x39')](_0x30b90d['query'][_0xaf1d('0x39')]);_0x21c78c[_0xaf1d('0x1c')]=qs[_0xaf1d('0x1c')](_0x30b90d[_0xaf1d('0x30')][_0xaf1d('0x1c')]);}_0x21c78c[_0xaf1d('0x3a')]=qs[_0xaf1d('0x3b')](_0x30b90d[_0xaf1d('0x30')][_0xaf1d('0x3b')]);_0x21c78c[_0xaf1d('0x3c')]=qs[_0xaf1d('0x32')](_[_0xaf1d('0x3d')](_0x30b90d[_0xaf1d('0x30')],_0x2f7c2e[_0xaf1d('0x32')]),_0x40885c);if(_0x30b90d['query'][_0xaf1d('0x3e')]){_0x21c78c[_0xaf1d('0x3c')]=_['merge'](_0x21c78c[_0xaf1d('0x3c')],{'$or':_[_0xaf1d('0x2f')](_0x40885c,function(_0x1d5b94){if(_0x1d5b94[_0xaf1d('0x2d')]!==_0xaf1d('0x3f')){var _0xdf3be6={};_0xdf3be6[_0x1d5b94[_0xaf1d('0x29')]]={'$like':'%'+_0x30b90d[_0xaf1d('0x30')][_0xaf1d('0x3e')]+'%'};return _0xdf3be6;}})});}_0x21c78c=_[_0xaf1d('0x40')]({},_0x21c78c,_0x30b90d[_0xaf1d('0x41')]);var _0x1eaa91={'where':_0x21c78c[_0xaf1d('0x3c')]};return db[_0xaf1d('0x2b')]['count'](_0x1eaa91)[_0xaf1d('0x25')](function(_0x222c99){_0x12a0d5[_0xaf1d('0x1e')]=_0x222c99;if(_0x30b90d[_0xaf1d('0x30')][_0xaf1d('0x42')]){_0x21c78c[_0xaf1d('0x43')]=[{'all':!![]}];}return db[_0xaf1d('0x2b')]['findAll'](_0x21c78c);})[_0xaf1d('0x25')](function(_0x2f0091){_0x12a0d5[_0xaf1d('0x44')]=_0x2f0091;return _0x12a0d5;})[_0xaf1d('0x25')](respondWithFilteredResult(_0x1552cb,_0x21c78c))[_0xaf1d('0x45')](handleError(_0x1552cb,null));};exports[_0xaf1d('0x46')]=function(_0x541a37,_0x3aa5af){var _0x13e8a9={'raw':!![],'where':{'id':_0x541a37[_0xaf1d('0x47')]['id']}},_0x2b5019={};_0x2b5019[_0xaf1d('0x2e')]=_[_0xaf1d('0x31')](db[_0xaf1d('0x2b')][_0xaf1d('0x48')]);_0x2b5019['query']=_[_0xaf1d('0x31')](_0x541a37[_0xaf1d('0x30')]);_0x2b5019[_0xaf1d('0x32')]=_['intersection'](_0x2b5019['model'],_0x2b5019['query']);_0x13e8a9[_0xaf1d('0x34')]=_['intersection'](_0x2b5019[_0xaf1d('0x2e')],qs[_0xaf1d('0x35')](_0x541a37[_0xaf1d('0x30')][_0xaf1d('0x35')]));_0x13e8a9['attributes']=_0x13e8a9[_0xaf1d('0x34')][_0xaf1d('0x36')]?_0x13e8a9[_0xaf1d('0x34')]:_0x2b5019[_0xaf1d('0x2e')];if(_0x541a37[_0xaf1d('0x30')]['includeAll']){_0x13e8a9[_0xaf1d('0x43')]=[{'all':!![]}];}_0x13e8a9=_['merge']({},_0x13e8a9,_0x541a37[_0xaf1d('0x41')]);return db[_0xaf1d('0x2b')][_0xaf1d('0x49')](_0x13e8a9)['then'](handleEntityNotFound(_0x3aa5af,null))[_0xaf1d('0x25')](respondWithResult(_0x3aa5af,null))['catch'](handleError(_0x3aa5af,null));};exports[_0xaf1d('0x4a')]=function(_0x3e4240,_0x3a5a78){return db[_0xaf1d('0x2b')][_0xaf1d('0x4a')](_0x3e4240['body'],{})[_0xaf1d('0x25')](respondWithResult(_0x3a5a78,0xc9))[_0xaf1d('0x45')](handleError(_0x3a5a78,null));};exports[_0xaf1d('0x24')]=function(_0x2162d3,_0x30763a){if(_0x2162d3[_0xaf1d('0x4b')]['id']){delete _0x2162d3[_0xaf1d('0x4b')]['id'];}return db['MailServerOut'][_0xaf1d('0x49')]({'where':{'id':_0x2162d3[_0xaf1d('0x47')]['id']}})[_0xaf1d('0x25')](handleEntityNotFound(_0x30763a,null))['then'](saveUpdates(_0x2162d3['body'],null))[_0xaf1d('0x25')](respondWithResult(_0x30763a,null))[_0xaf1d('0x45')](handleError(_0x30763a,null));};exports[_0xaf1d('0x26')]=function(_0x2b1b8e,_0x43a259){return db[_0xaf1d('0x2b')][_0xaf1d('0x49')]({'where':{'id':_0x2b1b8e[_0xaf1d('0x47')]['id']}})['then'](handleEntityNotFound(_0x43a259,null))[_0xaf1d('0x25')](removeEntity(_0x43a259,null))[_0xaf1d('0x45')](handleError(_0x43a259,null));}; \ No newline at end of file +var _0x39d6=['catch','body','params','eml-format','zip-dir','request-promise','bluebird','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','limit','undefined','count','apply','reject','save','update','destroy','then','sendStatus','stack','name','send','map','MailServerOut','fieldName','key','model','query','attributes','intersection','fields','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','keys','rawAttributes','length','find','create'];(function(_0xe6764a,_0xc556c7){var _0x4c19d8=function(_0x279948){while(--_0x279948){_0xe6764a['push'](_0xe6764a['shift']());}};_0x4c19d8(++_0xc556c7);}(_0x39d6,0x117));var _0x639d=function(_0x295a5c,_0xfd0b5){_0x295a5c=_0x295a5c-0x0;var _0x53339e=_0x39d6[_0x295a5c];return _0x53339e;};'use strict';var emlformat=require(_0x639d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x639d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x639d('0x2'));var moment=require('moment');var BPromise=require(_0x639d('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x639d('0x4'));var sox=require(_0x639d('0x5'));var csv=require('to-csv');var ejs=require(_0x639d('0x6'));var fs=require('fs');var fs_extra=require(_0x639d('0x7'));var _=require(_0x639d('0x8'));var squel=require('squel');var crypto=require(_0x639d('0x9'));var jsforce=require(_0x639d('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x639d('0xb'));var querystring=require('querystring');var Papa=require(_0x639d('0xc'));var Redis=require(_0x639d('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x639d('0xe'));var as=require(_0x639d('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x639d('0x10'))(_0x639d('0x11'));var utils=require(_0x639d('0x12'));var config=require(_0x639d('0x13'));var licenseUtil=require(_0x639d('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4943f9,_0x292d31){_0x292d31=_0x292d31||0xcc;return function(_0x1735a1){if(_0x1735a1){return _0x4943f9['sendStatus'](_0x292d31);}return _0x4943f9[_0x639d('0x15')](_0x292d31)[_0x639d('0x16')]();};}function respondWithResult(_0x515953,_0x40e212){_0x40e212=_0x40e212||0xc8;return function(_0x4dc9ac){if(_0x4dc9ac){return _0x515953[_0x639d('0x15')](_0x40e212)[_0x639d('0x17')](_0x4dc9ac);}};}function respondWithFilteredResult(_0x30f2d6,_0x2abf5d){return function(_0x3af0f6){if(_0x3af0f6){var _0x1d0dbe=typeof _0x2abf5d[_0x639d('0x18')]==='undefined'&&typeof _0x2abf5d[_0x639d('0x19')]===_0x639d('0x1a');var _0x539df2=_0x3af0f6['count'];var _0x43c90a=_0x1d0dbe?0x0:_0x2abf5d['offset'];var _0x5c414e=_0x1d0dbe?_0x3af0f6[_0x639d('0x1b')]:_0x2abf5d[_0x639d('0x18')]+_0x2abf5d[_0x639d('0x19')];var _0x4b8799;if(_0x5c414e>=_0x539df2){_0x5c414e=_0x539df2;_0x4b8799=0xc8;}else{_0x4b8799=0xce;}_0x30f2d6[_0x639d('0x15')](_0x4b8799);return _0x30f2d6['set']('Content-Range',_0x43c90a+'-'+_0x5c414e+'/'+_0x539df2)[_0x639d('0x17')](_0x3af0f6);}return null;};}function patchUpdates(_0x1408e9){return function(_0x59db67){try{jsonpatch[_0x639d('0x1c')](_0x59db67,_0x1408e9,!![]);}catch(_0x323f85){return BPromise[_0x639d('0x1d')](_0x323f85);}return _0x59db67[_0x639d('0x1e')]();};}function saveUpdates(_0x52793e,_0x518dc4){return function(_0x443eb5){if(_0x443eb5){return _0x443eb5[_0x639d('0x1f')](_0x52793e)['then'](function(_0x135c97){return _0x135c97;});}return null;};}function removeEntity(_0x4c235c,_0x452f01){return function(_0x2ecd16){if(_0x2ecd16){return _0x2ecd16[_0x639d('0x20')]()[_0x639d('0x21')](function(){_0x4c235c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1082,_0x401d6b){return function(_0xe7dea1){if(!_0xe7dea1){_0x2d1082[_0x639d('0x22')](0x194);}return _0xe7dea1;};}function handleError(_0x541957,_0x340658){_0x340658=_0x340658||0x1f4;return function(_0x1bf7ab){logger['error'](_0x1bf7ab[_0x639d('0x23')]);if(_0x1bf7ab[_0x639d('0x24')]){delete _0x1bf7ab['name'];}_0x541957[_0x639d('0x15')](_0x340658)[_0x639d('0x25')](_0x1bf7ab);};}exports['index']=function(_0x1e6ed5,_0x1c4cb1){var _0x4fc5b7={},_0xc32f4={},_0x2c1f5b={'count':0x0,'rows':[]};var _0x2bdcf0=_[_0x639d('0x26')](db[_0x639d('0x27')]['rawAttributes'],function(_0x4e0f67){return{'name':_0x4e0f67[_0x639d('0x28')],'type':_0x4e0f67['type'][_0x639d('0x29')]};});_0xc32f4[_0x639d('0x2a')]=_['map'](_0x2bdcf0,_0x639d('0x24'));_0xc32f4[_0x639d('0x2b')]=_['keys'](_0x1e6ed5['query']);_0xc32f4['filters']=_['intersection'](_0xc32f4['model'],_0xc32f4[_0x639d('0x2b')]);_0x4fc5b7[_0x639d('0x2c')]=_[_0x639d('0x2d')](_0xc32f4[_0x639d('0x2a')],qs['fields'](_0x1e6ed5['query'][_0x639d('0x2e')]));_0x4fc5b7[_0x639d('0x2c')]=_0x4fc5b7['attributes']['length']?_0x4fc5b7[_0x639d('0x2c')]:_0xc32f4[_0x639d('0x2a')];if(!_0x1e6ed5['query']['hasOwnProperty'](_0x639d('0x2f'))){_0x4fc5b7[_0x639d('0x19')]=qs[_0x639d('0x19')](_0x1e6ed5['query'][_0x639d('0x19')]);_0x4fc5b7['offset']=qs[_0x639d('0x18')](_0x1e6ed5['query'][_0x639d('0x18')]);}_0x4fc5b7[_0x639d('0x30')]=qs[_0x639d('0x31')](_0x1e6ed5[_0x639d('0x2b')][_0x639d('0x31')]);_0x4fc5b7[_0x639d('0x32')]=qs[_0x639d('0x33')](_[_0x639d('0x34')](_0x1e6ed5[_0x639d('0x2b')],_0xc32f4['filters']),_0x2bdcf0);if(_0x1e6ed5[_0x639d('0x2b')][_0x639d('0x35')]){_0x4fc5b7[_0x639d('0x32')]=_[_0x639d('0x36')](_0x4fc5b7['where'],{'$or':_[_0x639d('0x26')](_0x2bdcf0,function(_0x59a653){if(_0x59a653['type']!==_0x639d('0x37')){var _0x32196c={};_0x32196c[_0x59a653['name']]={'$like':'%'+_0x1e6ed5[_0x639d('0x2b')]['filter']+'%'};return _0x32196c;}})});}_0x4fc5b7=_[_0x639d('0x36')]({},_0x4fc5b7,_0x1e6ed5[_0x639d('0x38')]);var _0x348062={'where':_0x4fc5b7['where']};return db['MailServerOut'][_0x639d('0x1b')](_0x348062)[_0x639d('0x21')](function(_0x40fc59){_0x2c1f5b['count']=_0x40fc59;if(_0x1e6ed5[_0x639d('0x2b')]['includeAll']){_0x4fc5b7[_0x639d('0x39')]=[{'all':!![]}];}return db[_0x639d('0x27')][_0x639d('0x3a')](_0x4fc5b7);})[_0x639d('0x21')](function(_0x2a6040){_0x2c1f5b[_0x639d('0x3b')]=_0x2a6040;return _0x2c1f5b;})[_0x639d('0x21')](respondWithFilteredResult(_0x1c4cb1,_0x4fc5b7))['catch'](handleError(_0x1c4cb1,null));};exports[_0x639d('0x3c')]=function(_0x14652d,_0x2cbab2){var _0x119fbc={'raw':!![],'where':{'id':_0x14652d['params']['id']}},_0x5b9f0f={};_0x5b9f0f[_0x639d('0x2a')]=_[_0x639d('0x3d')](db[_0x639d('0x27')][_0x639d('0x3e')]);_0x5b9f0f[_0x639d('0x2b')]=_[_0x639d('0x3d')](_0x14652d[_0x639d('0x2b')]);_0x5b9f0f[_0x639d('0x33')]=_[_0x639d('0x2d')](_0x5b9f0f['model'],_0x5b9f0f[_0x639d('0x2b')]);_0x119fbc[_0x639d('0x2c')]=_[_0x639d('0x2d')](_0x5b9f0f[_0x639d('0x2a')],qs['fields'](_0x14652d[_0x639d('0x2b')][_0x639d('0x2e')]));_0x119fbc[_0x639d('0x2c')]=_0x119fbc['attributes'][_0x639d('0x3f')]?_0x119fbc[_0x639d('0x2c')]:_0x5b9f0f['model'];if(_0x14652d[_0x639d('0x2b')]['includeAll']){_0x119fbc[_0x639d('0x39')]=[{'all':!![]}];}_0x119fbc=_['merge']({},_0x119fbc,_0x14652d[_0x639d('0x38')]);return db[_0x639d('0x27')][_0x639d('0x40')](_0x119fbc)[_0x639d('0x21')](handleEntityNotFound(_0x2cbab2,null))[_0x639d('0x21')](respondWithResult(_0x2cbab2,null))['catch'](handleError(_0x2cbab2,null));};exports[_0x639d('0x41')]=function(_0xea6030,_0x129acf){return db[_0x639d('0x27')][_0x639d('0x41')](_0xea6030['body'],{})[_0x639d('0x21')](respondWithResult(_0x129acf,0xc9))[_0x639d('0x42')](handleError(_0x129acf,null));};exports[_0x639d('0x1f')]=function(_0x44adb5,_0x535279){if(_0x44adb5[_0x639d('0x43')]['id']){delete _0x44adb5[_0x639d('0x43')]['id'];}return db['MailServerOut'][_0x639d('0x40')]({'where':{'id':_0x44adb5[_0x639d('0x44')]['id']}})['then'](handleEntityNotFound(_0x535279,null))[_0x639d('0x21')](saveUpdates(_0x44adb5[_0x639d('0x43')],null))[_0x639d('0x21')](respondWithResult(_0x535279,null))['catch'](handleError(_0x535279,null));};exports[_0x639d('0x20')]=function(_0x18e436,_0xf000c5){return db[_0x639d('0x27')]['find']({'where':{'id':_0x18e436['params']['id']}})[_0x639d('0x21')](handleEntityNotFound(_0xf000c5,null))['then'](removeEntity(_0xf000c5,null))['catch'](handleError(_0xf000c5,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index c77887d..afe9c41 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 _0xa5d2=['request-promise','path','rimraf','./mailServerOut.attributes','exports','define','MailServerOut','mail_servers_out','lodash','util','../../config/logger','moment'];(function(_0x1e883a,_0x5b6ff9){var _0x36a0d0=function(_0x3c623b){while(--_0x3c623b){_0x1e883a['push'](_0x1e883a['shift']());}};_0x36a0d0(++_0x5b6ff9);}(_0xa5d2,0x11c));var _0x2a5d=function(_0x5bc5a3,_0x3b8908){_0x5bc5a3=_0x5bc5a3-0x0;var _0x49b0f8=_0xa5d2[_0x5bc5a3];return _0x49b0f8;};'use strict';var _=require(_0x2a5d('0x0'));var util=require(_0x2a5d('0x1'));var logger=require(_0x2a5d('0x2'))('api');var moment=require(_0x2a5d('0x3'));var BPromise=require('bluebird');var rp=require(_0x2a5d('0x4'));var fs=require('fs');var path=require(_0x2a5d('0x5'));var rimraf=require(_0x2a5d('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a5d('0x7'));module[_0x2a5d('0x8')]=function(_0x9765e9,_0x3e59e4){return _0x9765e9[_0x2a5d('0x9')](_0x2a5d('0xa'),attributes,{'tableName':_0x2a5d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5a74=['exports','define','mail_servers_out','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./mailServerOut.attributes'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0x5a74,0xb3));var _0x45a7=function(_0x3bc298,_0x583d14){_0x3bc298=_0x3bc298-0x0;var _0x31bf58=_0x5a74[_0x3bc298];return _0x31bf58;};'use strict';var _=require(_0x45a7('0x0'));var util=require(_0x45a7('0x1'));var logger=require(_0x45a7('0x2'))(_0x45a7('0x3'));var moment=require('moment');var BPromise=require(_0x45a7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x45a7('0x5'));var rimraf=require('rimraf');var config=require(_0x45a7('0x6'));var attributes=require(_0x45a7('0x7'));module[_0x45a7('0x8')]=function(_0x516258,_0x2b7b21){return _0x516258[_0x45a7('0x9')]('MailServerOut',attributes,{'tableName':_0x45a7('0xa'),'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 db4cfe5..c480a8b 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x50f39f,_0x7c8f00){_0x50f39f=_0x50f39f-0x0;var _0x3b4784=_0x7a54[_0x50f39f];return _0x3b4784;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x42aeec,_0x4bd293){var _0x2074e3=function(_0x62bf3){while(--_0x62bf3){_0x42aeec['push'](_0x42aeec['shift']());}};_0x2074e3(++_0x4bd293);}(_0xdb28,0x106));var _0x8db2=function(_0x168638,_0x150529){_0x168638=_0x168638-0x0;var _0x12ae1d=_0xdb28[_0x168638];return _0x12ae1d;};'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')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index 0b13a33..d5ac69a 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 _0x4e1c=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','create','put','/:id','update','delete'];(function(_0x5745e3,_0x2b3a14){var _0x65b84f=function(_0x417c76){while(--_0x417c76){_0x5745e3['push'](_0x5745e3['shift']());}};_0x65b84f(++_0x2b3a14);}(_0x4e1c,0xb2));var _0xc4e1=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0x4e1c[_0x330141];return _0x1b68a2;};'use strict';var multer=require(_0xc4e1('0x0'));var util=require(_0xc4e1('0x1'));var path=require(_0xc4e1('0x2'));var timeout=require('connect-timeout');var express=require(_0xc4e1('0x3'));var router=express[_0xc4e1('0x4')]();var fs_extra=require(_0xc4e1('0x5'));var auth=require(_0xc4e1('0x6'));var interaction=require(_0xc4e1('0x7'));var config=require(_0xc4e1('0x8'));var controller=require('./mailSubstatus.controller');router[_0xc4e1('0x9')]('/',auth[_0xc4e1('0xa')](),controller[_0xc4e1('0xb')]);router[_0xc4e1('0x9')](_0xc4e1('0xc'),auth[_0xc4e1('0xa')](),controller[_0xc4e1('0xd')]);router[_0xc4e1('0x9')]('/:id',auth[_0xc4e1('0xa')](),controller[_0xc4e1('0xe')]);router['post']('/',auth[_0xc4e1('0xa')](),controller[_0xc4e1('0xf')]);router[_0xc4e1('0x10')](_0xc4e1('0x11'),auth[_0xc4e1('0xa')](),controller[_0xc4e1('0x12')]);router[_0xc4e1('0x13')]('/:id',auth[_0xc4e1('0xa')](),controller[_0xc4e1('0x14')]);module[_0xc4e1('0x15')]=router; \ No newline at end of file +var _0xb458=['destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','post','update','delete'];(function(_0x263f4c,_0x438626){var _0x3a78d3=function(_0xbdb00f){while(--_0xbdb00f){_0x263f4c['push'](_0x263f4c['shift']());}};_0x3a78d3(++_0x438626);}(_0xb458,0xe6));var _0x8b45=function(_0x16c9fc,_0x41195b){_0x16c9fc=_0x16c9fc-0x0;var _0xdfdba1=_0xb458[_0x16c9fc];return _0xdfdba1;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require(_0x8b45('0x3'));var express=require('express');var router=express[_0x8b45('0x4')]();var fs_extra=require(_0x8b45('0x5'));var auth=require(_0x8b45('0x6'));var interaction=require(_0x8b45('0x7'));var config=require(_0x8b45('0x8'));var controller=require('./mailSubstatus.controller');router[_0x8b45('0x9')]('/',auth[_0x8b45('0xa')](),controller['index']);router[_0x8b45('0x9')]('/describe',auth[_0x8b45('0xa')](),controller[_0x8b45('0xb')]);router[_0x8b45('0x9')](_0x8b45('0xc'),auth['isAuthenticated'](),controller[_0x8b45('0xd')]);router[_0x8b45('0xe')]('/',auth[_0x8b45('0xa')](),controller['create']);router['put'](_0x8b45('0xc'),auth[_0x8b45('0xa')](),controller[_0x8b45('0xf')]);router[_0x8b45('0x10')](_0x8b45('0xc'),auth[_0x8b45('0xa')](),controller[_0x8b45('0x11')]);module[_0x8b45('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 a00224f..4a71276 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 _0x814b=['STRING','name','sequelize','exports'];(function(_0x17d7c3,_0x5f1f56){var _0x217331=function(_0x3192dc){while(--_0x3192dc){_0x17d7c3['push'](_0x17d7c3['shift']());}};_0x217331(++_0x5f1f56);}(_0x814b,0x1a2));var _0xb814=function(_0x1282a0,_0x58b2f9){_0x1282a0=_0x1282a0-0x0;var _0x18af0c=_0x814b[_0x1282a0];return _0x18af0c;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb814('0x2')]}}; \ No newline at end of file +var _0x5fab=['exports','name','STRING','sequelize'];(function(_0x24f5b1,_0x350007){var _0x451a13=function(_0x30d668){while(--_0x30d668){_0x24f5b1['push'](_0x24f5b1['shift']());}};_0x451a13(++_0x350007);}(_0x5fab,0x177));var _0xb5fa=function(_0x5acb94,_0x389dbc){_0x5acb94=_0x5acb94-0x0;var _0x11800a=_0x5fab[_0x5acb94];return _0x11800a;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xb5fa('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 17f7b2f..ae5ed66 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 _0xf819=['destroy','then','stack','name','index','MailSubstatus','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update'];(function(_0x5a9b5b,_0x19bc1c){var _0x2feb4a=function(_0x48db3e){while(--_0x48db3e){_0x5a9b5b['push'](_0x5a9b5b['shift']());}};_0x2feb4a(++_0x19bc1c);}(_0xf819,0xb7));var _0x9f81=function(_0x5a36dd,_0x5b2d2c){_0x5a36dd=_0x5a36dd-0x0;var _0x15503d=_0xf819[_0x5a36dd];return _0x15503d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9f81('0x0'));var zipdir=require(_0x9f81('0x1'));var jsonpatch=require(_0x9f81('0x2'));var rp=require(_0x9f81('0x3'));var moment=require(_0x9f81('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9f81('0x5'));var util=require('util');var path=require(_0x9f81('0x6'));var sox=require('sox');var csv=require(_0x9f81('0x7'));var ejs=require(_0x9f81('0x8'));var fs=require('fs');var fs_extra=require(_0x9f81('0x9'));var _=require('lodash');var squel=require(_0x9f81('0xa'));var crypto=require(_0x9f81('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9f81('0xc'));var toCsv=require(_0x9f81('0x7'));var querystring=require('querystring');var Papa=require(_0x9f81('0xd'));var Redis=require(_0x9f81('0xe'));var authService=require(_0x9f81('0xf'));var qs=require(_0x9f81('0x10'));var as=require(_0x9f81('0x11'));var hardwareService=require(_0x9f81('0x12'));var logger=require(_0x9f81('0x13'))('api');var utils=require(_0x9f81('0x14'));var config=require(_0x9f81('0x15'));var licenseUtil=require(_0x9f81('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c88e1,_0x4e2ab2){_0x4e2ab2=_0x4e2ab2||0xcc;return function(_0x51ff8c){if(_0x51ff8c){return _0x3c88e1[_0x9f81('0x17')](_0x4e2ab2);}return _0x3c88e1[_0x9f81('0x18')](_0x4e2ab2)[_0x9f81('0x19')]();};}function respondWithResult(_0x381149,_0x1bd04c){_0x1bd04c=_0x1bd04c||0xc8;return function(_0x294b75){if(_0x294b75){return _0x381149['status'](_0x1bd04c)[_0x9f81('0x1a')](_0x294b75);}};}function respondWithFilteredResult(_0x16710c,_0x1bb524){return function(_0x178529){if(_0x178529){var _0x339037=typeof _0x1bb524['offset']===_0x9f81('0x1b')&&typeof _0x1bb524[_0x9f81('0x1c')]==='undefined';var _0x51ed09=_0x178529[_0x9f81('0x1d')];var _0x1f3189=_0x339037?0x0:_0x1bb524['offset'];var _0x46d292=_0x339037?_0x178529[_0x9f81('0x1d')]:_0x1bb524[_0x9f81('0x1e')]+_0x1bb524[_0x9f81('0x1c')];var _0x5bfdf6;if(_0x46d292>=_0x51ed09){_0x46d292=_0x51ed09;_0x5bfdf6=0xc8;}else{_0x5bfdf6=0xce;}_0x16710c[_0x9f81('0x18')](_0x5bfdf6);return _0x16710c[_0x9f81('0x1f')](_0x9f81('0x20'),_0x1f3189+'-'+_0x46d292+'/'+_0x51ed09)[_0x9f81('0x1a')](_0x178529);}return null;};}function patchUpdates(_0x417f4b){return function(_0x3e4d3e){try{jsonpatch[_0x9f81('0x21')](_0x3e4d3e,_0x417f4b,!![]);}catch(_0x15746e){return BPromise['reject'](_0x15746e);}return _0x3e4d3e[_0x9f81('0x22')]();};}function saveUpdates(_0x256a6e,_0x3b4411){return function(_0x5bcf00){if(_0x5bcf00){return _0x5bcf00[_0x9f81('0x23')](_0x256a6e)['then'](function(_0x57f66e){return _0x57f66e;});}return null;};}function removeEntity(_0x3f656f,_0x54b564){return function(_0x9f1b57){if(_0x9f1b57){return _0x9f1b57[_0x9f81('0x24')]()[_0x9f81('0x25')](function(){_0x3f656f[_0x9f81('0x18')](0xcc)[_0x9f81('0x19')]();});}};}function handleEntityNotFound(_0x2c4dc0,_0x2f59b5){return function(_0x56f5b3){if(!_0x56f5b3){_0x2c4dc0['sendStatus'](0x194);}return _0x56f5b3;};}function handleError(_0x10a12c,_0x788d3d){_0x788d3d=_0x788d3d||0x1f4;return function(_0x59117c){logger['error'](_0x59117c[_0x9f81('0x26')]);if(_0x59117c[_0x9f81('0x27')]){delete _0x59117c[_0x9f81('0x27')];}_0x10a12c['status'](_0x788d3d)['send'](_0x59117c);};}exports[_0x9f81('0x28')]=function(_0x29352f,_0x410525){var _0x1d4ea1={},_0x114398={},_0x1b6b58={'count':0x0,'rows':[]};var _0x49d64a=_['map'](db[_0x9f81('0x29')]['rawAttributes'],function(_0x4af67a){return{'name':_0x4af67a[_0x9f81('0x2a')],'type':_0x4af67a[_0x9f81('0x2b')][_0x9f81('0x2c')]};});_0x114398['model']=_['map'](_0x49d64a,_0x9f81('0x27'));_0x114398[_0x9f81('0x2d')]=_[_0x9f81('0x2e')](_0x29352f[_0x9f81('0x2d')]);_0x114398[_0x9f81('0x2f')]=_[_0x9f81('0x30')](_0x114398[_0x9f81('0x31')],_0x114398[_0x9f81('0x2d')]);_0x1d4ea1[_0x9f81('0x32')]=_['intersection'](_0x114398[_0x9f81('0x31')],qs[_0x9f81('0x33')](_0x29352f[_0x9f81('0x2d')]['fields']));_0x1d4ea1[_0x9f81('0x32')]=_0x1d4ea1[_0x9f81('0x32')]['length']?_0x1d4ea1[_0x9f81('0x32')]:_0x114398[_0x9f81('0x31')];if(!_0x29352f[_0x9f81('0x2d')][_0x9f81('0x34')]('nolimit')){_0x1d4ea1[_0x9f81('0x1c')]=qs[_0x9f81('0x1c')](_0x29352f[_0x9f81('0x2d')][_0x9f81('0x1c')]);_0x1d4ea1[_0x9f81('0x1e')]=qs['offset'](_0x29352f[_0x9f81('0x2d')]['offset']);}_0x1d4ea1[_0x9f81('0x35')]=qs[_0x9f81('0x36')](_0x29352f[_0x9f81('0x2d')][_0x9f81('0x36')]);_0x1d4ea1['where']=qs[_0x9f81('0x2f')](_[_0x9f81('0x37')](_0x29352f['query'],_0x114398[_0x9f81('0x2f')]),_0x49d64a);if(_0x29352f['query'][_0x9f81('0x38')]){_0x1d4ea1[_0x9f81('0x39')]=_['merge'](_0x1d4ea1[_0x9f81('0x39')],{'$or':_['map'](_0x49d64a,function(_0x4ea69c){if(_0x4ea69c[_0x9f81('0x2b')]!=='VIRTUAL'){var _0x42ec3a={};_0x42ec3a[_0x4ea69c[_0x9f81('0x27')]]={'$like':'%'+_0x29352f[_0x9f81('0x2d')][_0x9f81('0x38')]+'%'};return _0x42ec3a;}})});}_0x1d4ea1=_[_0x9f81('0x3a')]({},_0x1d4ea1,_0x29352f[_0x9f81('0x3b')]);var _0x199a3e={'where':_0x1d4ea1['where']};return db['MailSubstatus']['count'](_0x199a3e)[_0x9f81('0x25')](function(_0x43cb99){_0x1b6b58[_0x9f81('0x1d')]=_0x43cb99;if(_0x29352f[_0x9f81('0x2d')][_0x9f81('0x3c')]){_0x1d4ea1[_0x9f81('0x3d')]=[{'all':!![]}];}return db[_0x9f81('0x29')][_0x9f81('0x3e')](_0x1d4ea1);})['then'](function(_0x569a5d){_0x1b6b58[_0x9f81('0x3f')]=_0x569a5d;return _0x1b6b58;})[_0x9f81('0x25')](respondWithFilteredResult(_0x410525,_0x1d4ea1))[_0x9f81('0x40')](handleError(_0x410525,null));};exports[_0x9f81('0x41')]=function(_0xe8a64,_0x27cee0){var _0x3b9424={'raw':!![],'where':{'id':_0xe8a64[_0x9f81('0x42')]['id']}},_0x102a56={};_0x102a56[_0x9f81('0x31')]=_['keys'](db['MailSubstatus'][_0x9f81('0x43')]);_0x102a56['query']=_[_0x9f81('0x2e')](_0xe8a64[_0x9f81('0x2d')]);_0x102a56[_0x9f81('0x2f')]=_[_0x9f81('0x30')](_0x102a56['model'],_0x102a56[_0x9f81('0x2d')]);_0x3b9424['attributes']=_[_0x9f81('0x30')](_0x102a56[_0x9f81('0x31')],qs['fields'](_0xe8a64[_0x9f81('0x2d')][_0x9f81('0x33')]));_0x3b9424[_0x9f81('0x32')]=_0x3b9424['attributes'][_0x9f81('0x44')]?_0x3b9424[_0x9f81('0x32')]:_0x102a56['model'];if(_0xe8a64[_0x9f81('0x2d')][_0x9f81('0x3c')]){_0x3b9424['include']=[{'all':!![]}];}_0x3b9424=_[_0x9f81('0x3a')]({},_0x3b9424,_0xe8a64[_0x9f81('0x3b')]);return db[_0x9f81('0x29')][_0x9f81('0x45')](_0x3b9424)['then'](handleEntityNotFound(_0x27cee0,null))[_0x9f81('0x25')](respondWithResult(_0x27cee0,null))[_0x9f81('0x40')](handleError(_0x27cee0,null));};exports[_0x9f81('0x46')]=function(_0x1cac58,_0x1e67d8){return db[_0x9f81('0x29')]['create'](_0x1cac58['body'],{})['then'](respondWithResult(_0x1e67d8,0xc9))['catch'](handleError(_0x1e67d8,null));};exports[_0x9f81('0x23')]=function(_0x213bef,_0x46ae9b){if(_0x213bef['body']['id']){delete _0x213bef[_0x9f81('0x47')]['id'];}return db[_0x9f81('0x29')]['find']({'where':{'id':_0x213bef[_0x9f81('0x42')]['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0x46ae9b,null))[_0x9f81('0x25')](saveUpdates(_0x213bef[_0x9f81('0x47')],null))[_0x9f81('0x25')](respondWithResult(_0x46ae9b,null))[_0x9f81('0x40')](handleError(_0x46ae9b,null));};exports[_0x9f81('0x24')]=function(_0x202eb5,_0x5d9676){return db[_0x9f81('0x29')][_0x9f81('0x45')]({'where':{'id':_0x202eb5['params']['id']}})[_0x9f81('0x25')](handleEntityNotFound(_0x5d9676,null))[_0x9f81('0x25')](removeEntity(_0x5d9676,null))['catch'](handleError(_0x5d9676,null));};exports[_0x9f81('0x48')]=function(_0x42a25a,_0x4b5184){return db[_0x9f81('0x29')]['describe']()[_0x9f81('0x25')](respondWithResult(_0x4b5184,null))[_0x9f81('0x40')](handleError(_0x4b5184,null));}; \ No newline at end of file +var _0x853e=['order','sort','where','merge','filter','includeAll','include','rows','catch','show','params','length','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','then','destroy','error','stack','name','index','map','MailSubstatus','rawAttributes','fieldName','type','key','keys','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit'];(function(_0x154f2b,_0x3163ad){var _0x110315=function(_0x2d9e6d){while(--_0x2d9e6d){_0x154f2b['push'](_0x154f2b['shift']());}};_0x110315(++_0x3163ad);}(_0x853e,0x17e));var _0xe853=function(_0x253ac7,_0x34d720){_0x253ac7=_0x253ac7-0x0;var _0x30e284=_0x853e[_0x253ac7];return _0x30e284;};'use strict';var emlformat=require(_0xe853('0x0'));var rimraf=require(_0xe853('0x1'));var zipdir=require(_0xe853('0x2'));var jsonpatch=require(_0xe853('0x3'));var rp=require(_0xe853('0x4'));var moment=require('moment');var BPromise=require(_0xe853('0x5'));var Mustache=require('mustache');var util=require(_0xe853('0x6'));var path=require(_0xe853('0x7'));var sox=require('sox');var csv=require(_0xe853('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe853('0x9'));var _=require(_0xe853('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe853('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe853('0xc'));var Papa=require(_0xe853('0xd'));var Redis=require('ioredis');var authService=require(_0xe853('0xe'));var qs=require(_0xe853('0xf'));var as=require(_0xe853('0x10'));var hardwareService=require(_0xe853('0x11'));var logger=require('../../config/logger')(_0xe853('0x12'));var utils=require(_0xe853('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xe853('0x14'));var db=require(_0xe853('0x15'))['db'];function respondWithStatusCode(_0x1695a5,_0x4726ff){_0x4726ff=_0x4726ff||0xcc;return function(_0x2eb1e9){if(_0x2eb1e9){return _0x1695a5[_0xe853('0x16')](_0x4726ff);}return _0x1695a5[_0xe853('0x17')](_0x4726ff)[_0xe853('0x18')]();};}function respondWithResult(_0x1620f3,_0x5a3bed){_0x5a3bed=_0x5a3bed||0xc8;return function(_0x5b62c8){if(_0x5b62c8){return _0x1620f3['status'](_0x5a3bed)['json'](_0x5b62c8);}};}function respondWithFilteredResult(_0x52d8aa,_0x29720d){return function(_0x205c42){if(_0x205c42){var _0x1c2118=typeof _0x29720d[_0xe853('0x19')]===_0xe853('0x1a')&&typeof _0x29720d['limit']==='undefined';var _0x3c2615=_0x205c42[_0xe853('0x1b')];var _0x19e94e=_0x1c2118?0x0:_0x29720d[_0xe853('0x19')];var _0x368b0e=_0x1c2118?_0x205c42[_0xe853('0x1b')]:_0x29720d['offset']+_0x29720d[_0xe853('0x1c')];var _0x2cd686;if(_0x368b0e>=_0x3c2615){_0x368b0e=_0x3c2615;_0x2cd686=0xc8;}else{_0x2cd686=0xce;}_0x52d8aa[_0xe853('0x17')](_0x2cd686);return _0x52d8aa[_0xe853('0x1d')](_0xe853('0x1e'),_0x19e94e+'-'+_0x368b0e+'/'+_0x3c2615)[_0xe853('0x1f')](_0x205c42);}return null;};}function patchUpdates(_0x4ae2bc){return function(_0x40bfe3){try{jsonpatch['apply'](_0x40bfe3,_0x4ae2bc,!![]);}catch(_0x160fb0){return BPromise[_0xe853('0x20')](_0x160fb0);}return _0x40bfe3[_0xe853('0x21')]();};}function saveUpdates(_0x1da001,_0x52f8d6){return function(_0x5507ad){if(_0x5507ad){return _0x5507ad[_0xe853('0x22')](_0x1da001)[_0xe853('0x23')](function(_0x5588a2){return _0x5588a2;});}return null;};}function removeEntity(_0xf18b2a,_0xbf8eb1){return function(_0x49be22){if(_0x49be22){return _0x49be22[_0xe853('0x24')]()[_0xe853('0x23')](function(){_0xf18b2a[_0xe853('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x585841,_0x3a4f19){return function(_0x461f1c){if(!_0x461f1c){_0x585841[_0xe853('0x16')](0x194);}return _0x461f1c;};}function handleError(_0x185f31,_0x273fdd){_0x273fdd=_0x273fdd||0x1f4;return function(_0x3deff8){logger[_0xe853('0x25')](_0x3deff8[_0xe853('0x26')]);if(_0x3deff8[_0xe853('0x27')]){delete _0x3deff8[_0xe853('0x27')];}_0x185f31[_0xe853('0x17')](_0x273fdd)['send'](_0x3deff8);};}exports[_0xe853('0x28')]=function(_0x1940de,_0x40ad51){var _0x1f6776={},_0x30299b={},_0x54e4ba={'count':0x0,'rows':[]};var _0x23b549=_[_0xe853('0x29')](db[_0xe853('0x2a')][_0xe853('0x2b')],function(_0x2e12a9){return{'name':_0x2e12a9[_0xe853('0x2c')],'type':_0x2e12a9[_0xe853('0x2d')][_0xe853('0x2e')]};});_0x30299b['model']=_[_0xe853('0x29')](_0x23b549,'name');_0x30299b['query']=_[_0xe853('0x2f')](_0x1940de[_0xe853('0x30')]);_0x30299b[_0xe853('0x31')]=_[_0xe853('0x32')](_0x30299b['model'],_0x30299b[_0xe853('0x30')]);_0x1f6776[_0xe853('0x33')]=_[_0xe853('0x32')](_0x30299b[_0xe853('0x34')],qs[_0xe853('0x35')](_0x1940de[_0xe853('0x30')][_0xe853('0x35')]));_0x1f6776[_0xe853('0x33')]=_0x1f6776[_0xe853('0x33')]['length']?_0x1f6776[_0xe853('0x33')]:_0x30299b[_0xe853('0x34')];if(!_0x1940de[_0xe853('0x30')][_0xe853('0x36')](_0xe853('0x37'))){_0x1f6776[_0xe853('0x1c')]=qs[_0xe853('0x1c')](_0x1940de[_0xe853('0x30')][_0xe853('0x1c')]);_0x1f6776[_0xe853('0x19')]=qs[_0xe853('0x19')](_0x1940de[_0xe853('0x30')][_0xe853('0x19')]);}_0x1f6776[_0xe853('0x38')]=qs[_0xe853('0x39')](_0x1940de[_0xe853('0x30')][_0xe853('0x39')]);_0x1f6776[_0xe853('0x3a')]=qs[_0xe853('0x31')](_['pick'](_0x1940de[_0xe853('0x30')],_0x30299b[_0xe853('0x31')]),_0x23b549);if(_0x1940de[_0xe853('0x30')]['filter']){_0x1f6776[_0xe853('0x3a')]=_[_0xe853('0x3b')](_0x1f6776[_0xe853('0x3a')],{'$or':_['map'](_0x23b549,function(_0x1890bb){if(_0x1890bb['type']!=='VIRTUAL'){var _0x45c96c={};_0x45c96c[_0x1890bb['name']]={'$like':'%'+_0x1940de[_0xe853('0x30')][_0xe853('0x3c')]+'%'};return _0x45c96c;}})});}_0x1f6776=_['merge']({},_0x1f6776,_0x1940de['options']);var _0x1bc48e={'where':_0x1f6776[_0xe853('0x3a')]};return db[_0xe853('0x2a')][_0xe853('0x1b')](_0x1bc48e)[_0xe853('0x23')](function(_0xfd3da6){_0x54e4ba[_0xe853('0x1b')]=_0xfd3da6;if(_0x1940de[_0xe853('0x30')][_0xe853('0x3d')]){_0x1f6776[_0xe853('0x3e')]=[{'all':!![]}];}return db[_0xe853('0x2a')]['findAll'](_0x1f6776);})[_0xe853('0x23')](function(_0x5c61dc){_0x54e4ba[_0xe853('0x3f')]=_0x5c61dc;return _0x54e4ba;})[_0xe853('0x23')](respondWithFilteredResult(_0x40ad51,_0x1f6776))[_0xe853('0x40')](handleError(_0x40ad51,null));};exports[_0xe853('0x41')]=function(_0x2b044f,_0x1de93e){var _0x46fe89={'raw':!![],'where':{'id':_0x2b044f[_0xe853('0x42')]['id']}},_0x27a950={};_0x27a950[_0xe853('0x34')]=_['keys'](db['MailSubstatus'][_0xe853('0x2b')]);_0x27a950[_0xe853('0x30')]=_[_0xe853('0x2f')](_0x2b044f[_0xe853('0x30')]);_0x27a950[_0xe853('0x31')]=_[_0xe853('0x32')](_0x27a950['model'],_0x27a950['query']);_0x46fe89[_0xe853('0x33')]=_[_0xe853('0x32')](_0x27a950[_0xe853('0x34')],qs[_0xe853('0x35')](_0x2b044f[_0xe853('0x30')]['fields']));_0x46fe89['attributes']=_0x46fe89[_0xe853('0x33')][_0xe853('0x43')]?_0x46fe89[_0xe853('0x33')]:_0x27a950[_0xe853('0x34')];if(_0x2b044f[_0xe853('0x30')][_0xe853('0x3d')]){_0x46fe89[_0xe853('0x3e')]=[{'all':!![]}];}_0x46fe89=_[_0xe853('0x3b')]({},_0x46fe89,_0x2b044f[_0xe853('0x44')]);return db[_0xe853('0x2a')][_0xe853('0x45')](_0x46fe89)['then'](handleEntityNotFound(_0x1de93e,null))['then'](respondWithResult(_0x1de93e,null))[_0xe853('0x40')](handleError(_0x1de93e,null));};exports[_0xe853('0x46')]=function(_0x4ee2eb,_0x2f8047){return db['MailSubstatus'][_0xe853('0x46')](_0x4ee2eb['body'],{})['then'](respondWithResult(_0x2f8047,0xc9))[_0xe853('0x40')](handleError(_0x2f8047,null));};exports[_0xe853('0x22')]=function(_0x1c7971,_0x363982){if(_0x1c7971['body']['id']){delete _0x1c7971[_0xe853('0x47')]['id'];}return db[_0xe853('0x2a')]['find']({'where':{'id':_0x1c7971[_0xe853('0x42')]['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x363982,null))[_0xe853('0x23')](saveUpdates(_0x1c7971[_0xe853('0x47')],null))[_0xe853('0x23')](respondWithResult(_0x363982,null))[_0xe853('0x40')](handleError(_0x363982,null));};exports[_0xe853('0x24')]=function(_0x5d4c4b,_0x1b2e75){return db[_0xe853('0x2a')]['find']({'where':{'id':_0x5d4c4b['params']['id']}})[_0xe853('0x23')](handleEntityNotFound(_0x1b2e75,null))[_0xe853('0x23')](removeEntity(_0x1b2e75,null))['catch'](handleError(_0x1b2e75,null));};exports[_0xe853('0x48')]=function(_0x3a1b08,_0x358ec6){return db[_0xe853('0x2a')][_0xe853('0x48')]()[_0xe853('0x23')](respondWithResult(_0x358ec6,null))[_0xe853('0x40')](handleError(_0x358ec6,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.events.js b/server/api/mailSubstatus/mailSubstatus.events.js index 2d0695f..1038d00 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 _0x896d=['MailSubstatus','setMaxListeners','emit','hasOwnProperty','events','../../mysqldb'];(function(_0x487b0c,_0x14ff74){var _0x1adbdc=function(_0x2e7b9d){while(--_0x2e7b9d){_0x487b0c['push'](_0x487b0c['shift']());}};_0x1adbdc(++_0x14ff74);}(_0x896d,0x1c0));var _0xd896=function(_0x452f70,_0x204445){_0x452f70=_0x452f70-0x0;var _0x44d233=_0x896d[_0x452f70];return _0x44d233;};'use strict';var EventEmitter=require(_0xd896('0x0'));var MailSubstatus=require(_0xd896('0x1'))['db'][_0xd896('0x2')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents[_0xd896('0x3')](0x0);var events={'afterUpdate':'update'};function emitEvent(_0x5eb136){return function(_0x3638a7,_0x1c2e0f,_0x3878e4){MailSubstatusEvents[_0xd896('0x4')](_0x5eb136+':'+_0x3638a7['id'],_0x3638a7);MailSubstatusEvents[_0xd896('0x4')](_0x5eb136,_0x3638a7);_0x3878e4(null);};}for(var e in events){if(events[_0xd896('0x5')](e)){var event=events[e];MailSubstatus['hook'](e,emitEvent(event));}}module['exports']=MailSubstatusEvents; \ No newline at end of file +var _0x1026=['update','emit','hook','exports','MailSubstatus'];(function(_0x3b0899,_0x4ca518){var _0x43048e=function(_0xf2c4e3){while(--_0xf2c4e3){_0x3b0899['push'](_0x3b0899['shift']());}};_0x43048e(++_0x4ca518);}(_0x1026,0x158));var _0x6102=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x1026[_0x34e752];return _0x7c6347;};'use strict';var EventEmitter=require('events');var MailSubstatus=require('../../mysqldb')['db'][_0x6102('0x0')];var MailSubstatusEvents=new EventEmitter();MailSubstatusEvents['setMaxListeners'](0x0);var events={'afterUpdate':_0x6102('0x1')};function emitEvent(_0x5a4c3a){return function(_0x28a01d,_0x5deabc,_0x470296){MailSubstatusEvents[_0x6102('0x2')](_0x5a4c3a+':'+_0x28a01d['id'],_0x28a01d);MailSubstatusEvents[_0x6102('0x2')](_0x5a4c3a,_0x28a01d);_0x470296(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailSubstatus[_0x6102('0x3')](e,emitEvent(event));}}module[_0x6102('0x4')]=MailSubstatusEvents; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 02b51b8..6e7f49e 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 _0xd598=['models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then','catch','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd598,0x137));var _0x8d59=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd598[_0x14add3];return _0x4a174f;};'use strict';var attributes=require('./mailSubstatus.attributes');module[_0x8d59('0x0')]=function(_0xf2575a){var _0x5f25a9=_0xf2575a[_0x8d59('0x1')];return _0xf2575a[_0x8d59('0x2')](_0x8d59('0x3'),attributes,{'tableName':_0x8d59('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x4d5708,_0x28f489,_0xd4d1f3){return _0x5f25a9[_0x8d59('0x5')][_0x8d59('0x6')]({'value':_0x4d5708[_0x8d59('0x7')]},{'where':{'field':_0x8d59('0x8'),'value':_0x4d5708[_0x8d59('0x9')]['name']}})[_0x8d59('0xa')](function(){_0xd4d1f3();})[_0x8d59('0xb')](function(_0x16e6cd){_0xd4d1f3(_0x16e6cd);});}}});}; \ No newline at end of file +var _0x9a8e=['catch','./mailSubstatus.attributes','exports','models','define','MailSubstatus','mail_substatuses','Condition','update','name','mailSubstatus','_previousDataValues','then'];(function(_0x5b0206,_0x4089cd){var _0x356faf=function(_0x4ea4db){while(--_0x4ea4db){_0x5b0206['push'](_0x5b0206['shift']());}};_0x356faf(++_0x4089cd);}(_0x9a8e,0x90));var _0xe9a8=function(_0x15c34e,_0x1b1731){_0x15c34e=_0x15c34e-0x0;var _0x3b1cd=_0x9a8e[_0x15c34e];return _0x3b1cd;};'use strict';var attributes=require(_0xe9a8('0x0'));module[_0xe9a8('0x1')]=function(_0x4a9e14){var _0x1006e5=_0x4a9e14[_0xe9a8('0x2')];return _0x4a9e14[_0xe9a8('0x3')](_0xe9a8('0x4'),attributes,{'tableName':_0xe9a8('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterUpdate':function(_0x2618d6,_0x47be6d,_0x2d669e){return _0x1006e5[_0xe9a8('0x6')][_0xe9a8('0x7')]({'value':_0x2618d6[_0xe9a8('0x8')]},{'where':{'field':_0xe9a8('0x9'),'value':_0x2618d6[_0xe9a8('0xa')]['name']}})[_0xe9a8('0xb')](function(){_0x2d669e();})[_0xe9a8('0xc')](function(_0x47fafa){_0x2d669e(_0x47fafa);});}}});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 7ea0f5c..3c95dcc 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 _0xf5f8=['error','code','message','MailSubstatus,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','debug','request\x20sent','stringify'];(function(_0x1221e8,_0x2e7229){var _0x3f3041=function(_0x2042c){while(--_0x2042c){_0x1221e8['push'](_0x1221e8['shift']());}};_0x3f3041(++_0x2e7229);}(_0xf5f8,0x1bb));var _0x8f5f=function(_0x32ff18,_0x6b905a){_0x32ff18=_0x32ff18-0x0;var _0x1834dd=_0xf5f8[_0x32ff18];return _0x1834dd;};'use strict';var _=require(_0x8f5f('0x0'));var util=require(_0x8f5f('0x1'));var moment=require(_0x8f5f('0x2'));var BPromise=require(_0x8f5f('0x3'));var rs=require(_0x8f5f('0x4'));var fs=require('fs');var Redis=require(_0x8f5f('0x5'));var db=require(_0x8f5f('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8f5f('0x7'))(_0x8f5f('0x8'));var config=require(_0x8f5f('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8f5f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21ab2f,_0x1f5d87,_0x23256d){return new BPromise(function(_0x224736,_0x5b584a){return client[_0x8f5f('0xb')](_0x21ab2f,_0x23256d)[_0x8f5f('0xc')](function(_0x2e5d72){logger[_0x8f5f('0xd')]('MailSubstatus,\x20%s,\x20%s',_0x1f5d87,'request\x20sent');logger[_0x8f5f('0xe')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x1f5d87,_0x8f5f('0xf'),JSON[_0x8f5f('0x10')](_0x2e5d72));if(_0x2e5d72[_0x8f5f('0x11')]){if(_0x2e5d72[_0x8f5f('0x11')][_0x8f5f('0x12')]===0x1f4){logger[_0x8f5f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f5d87,_0x2e5d72[_0x8f5f('0x11')][_0x8f5f('0x13')]);return _0x5b584a(_0x2e5d72['error']['message']);}logger[_0x8f5f('0x11')]('MailSubstatus,\x20%s,\x20%s',_0x1f5d87,_0x2e5d72['error'][_0x8f5f('0x13')]);return _0x224736(_0x2e5d72[_0x8f5f('0x11')][_0x8f5f('0x13')]);}else{logger[_0x8f5f('0xd')](_0x8f5f('0x14'),_0x1f5d87,_0x8f5f('0xf'));_0x224736(_0x2e5d72[_0x8f5f('0x15')][_0x8f5f('0x13')]);}})[_0x8f5f('0x16')](function(_0x1252b7){logger['error'](_0x8f5f('0x14'),_0x1f5d87,_0x1252b7);_0x5b584a(_0x1252b7);});});} \ No newline at end of file +var _0x5d56=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util','moment'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x5d56,0x6b));var _0x65d5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5d56[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x65d5('0x0'));var util=require(_0x65d5('0x1'));var moment=require(_0x65d5('0x2'));var BPromise=require(_0x65d5('0x3'));var rs=require(_0x65d5('0x4'));var fs=require('fs');var Redis=require(_0x65d5('0x5'));var db=require(_0x65d5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x65d5('0x7'))(_0x65d5('0x8'));var config=require(_0x65d5('0x9'));var jayson=require(_0x65d5('0xa'));var client=jayson['client'][_0x65d5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ee8c8,_0x3f15e4,_0x1a8619){return new BPromise(function(_0x1b9425,_0x58a5c2){return client[_0x65d5('0xc')](_0x1ee8c8,_0x1a8619)[_0x65d5('0xd')](function(_0x44f09f){logger['info'](_0x65d5('0xe'),_0x3f15e4,_0x65d5('0xf'));logger[_0x65d5('0x10')](_0x65d5('0x11'),_0x3f15e4,_0x65d5('0xf'),JSON['stringify'](_0x44f09f));if(_0x44f09f['error']){if(_0x44f09f[_0x65d5('0x12')][_0x65d5('0x13')]===0x1f4){logger['error'](_0x65d5('0xe'),_0x3f15e4,_0x44f09f[_0x65d5('0x12')][_0x65d5('0x14')]);return _0x58a5c2(_0x44f09f[_0x65d5('0x12')][_0x65d5('0x14')]);}logger[_0x65d5('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x3f15e4,_0x44f09f['error']['message']);return _0x1b9425(_0x44f09f[_0x65d5('0x12')][_0x65d5('0x14')]);}else{logger[_0x65d5('0x15')](_0x65d5('0xe'),_0x3f15e4,_0x65d5('0xf'));_0x1b9425(_0x44f09f['result'][_0x65d5('0x14')]);}})['catch'](function(_0x880baa){logger[_0x65d5('0x12')](_0x65d5('0xe'),_0x3f15e4,_0x880baa);_0x58a5c2(_0x880baa);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 4a70c91..bd14813 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 _0xa825=['destroy','exports','util','path','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','create','put','/:id','update','delete'];(function(_0x59f7f3,_0x2bc4f4){var _0x38d01f=function(_0x1d7482){while(--_0x1d7482){_0x59f7f3['push'](_0x59f7f3['shift']());}};_0x38d01f(++_0x2bc4f4);}(_0xa825,0x192));var _0x5a82=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa825[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require('multer');var util=require(_0x5a82('0x0'));var path=require(_0x5a82('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x5a82('0x2'));var auth=require(_0x5a82('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5a82('0x4'));var controller=require('./mailTransferReport.controller');router['get']('/',auth[_0x5a82('0x5')](),controller[_0x5a82('0x6')]);router[_0x5a82('0x7')]('/describe',auth[_0x5a82('0x5')](),controller['describe']);router[_0x5a82('0x7')]('/:id',auth[_0x5a82('0x5')](),controller[_0x5a82('0x8')]);router['post']('/',auth[_0x5a82('0x5')](),controller[_0x5a82('0x9')]);router[_0x5a82('0xa')](_0x5a82('0xb'),auth[_0x5a82('0x5')](),controller[_0x5a82('0xc')]);router[_0x5a82('0xd')](_0x5a82('0xb'),auth['isAuthenticated'](),controller[_0x5a82('0xe')]);module[_0x5a82('0xf')]=router; \ No newline at end of file +var _0xec3b=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./mailTransferReport.controller','get','index','/describe','isAuthenticated','post','create','put','/:id'];(function(_0x167e73,_0x20b7ad){var _0x4ebbdb=function(_0x8f1cbc){while(--_0x8f1cbc){_0x167e73['push'](_0x167e73['shift']());}};_0x4ebbdb(++_0x20b7ad);}(_0xec3b,0xcb));var _0xbec3=function(_0x373586,_0x252bc1){_0x373586=_0x373586-0x0;var _0x1f84d1=_0xec3b[_0x373586];return _0x1f84d1;};'use strict';var multer=require(_0xbec3('0x0'));var util=require(_0xbec3('0x1'));var path=require(_0xbec3('0x2'));var timeout=require(_0xbec3('0x3'));var express=require(_0xbec3('0x4'));var router=express[_0xbec3('0x5')]();var fs_extra=require(_0xbec3('0x6'));var auth=require(_0xbec3('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbec3('0x8'));router[_0xbec3('0x9')]('/',auth['isAuthenticated'](),controller[_0xbec3('0xa')]);router[_0xbec3('0x9')](_0xbec3('0xb'),auth[_0xbec3('0xc')](),controller['describe']);router[_0xbec3('0x9')]('/:id',auth[_0xbec3('0xc')](),controller['show']);router[_0xbec3('0xd')]('/',auth[_0xbec3('0xc')](),controller[_0xbec3('0xe')]);router[_0xbec3('0xf')](_0xbec3('0x10'),auth[_0xbec3('0xc')](),controller[_0xbec3('0x11')]);router[_0xbec3('0x12')](_0xbec3('0x10'),auth[_0xbec3('0xc')](),controller['destroy']);module[_0xbec3('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 4f57463..bad6337 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 _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x136a0d,_0x476fe2){var _0x212ea5=function(_0xa288e){while(--_0xa288e){_0x136a0d['push'](_0x136a0d['shift']());}};_0x212ea5(++_0x476fe2);}(_0xb43b,0x1b2));var _0xbb43=function(_0x41d7e4,_0x34fd05){_0x41d7e4=_0x41d7e4-0x0;var _0x2e7a8b=_0xb43b[_0x41d7e4];return _0x2e7a8b;};'use strict';var moment=require(_0xbb43('0x0'));var Sequelize=require(_0xbb43('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xbb43('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbb43('0x3')](_0xbb43('0x4'),'agent',_0xbb43('0x5')),'allowNull':![],'defaultValue':_0xbb43('0x5')},'transferredAt':{'type':Sequelize[_0xbb43('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xbb43('0x7')]}}; \ No newline at end of file +var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x12581f,_0x10bce4){var _0x62d257=function(_0x17357b){while(--_0x17357b){_0x12581f['push'](_0x12581f['shift']());}};_0x62d257(++_0x10bce4);}(_0xaa88,0x137));var _0x8aa8=function(_0x29e2af,_0x15e2b1){_0x29e2af=_0x29e2af-0x0;var _0x1ea06a=_0xaa88[_0x29e2af];return _0x1ea06a;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index ec10b61..1fd5ab5 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 _0xc580=['count','set','Content-Range','reject','update','then','destroy','error','name','index','map','MailTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','params','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc580,0x190));var _0x0c58=function(_0x114928,_0x1d34ae){_0x114928=_0x114928-0x0;var _0x3e896f=_0xc580[_0x114928];return _0x3e896f;};'use strict';var emlformat=require(_0x0c58('0x0'));var rimraf=require(_0x0c58('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c58('0x2'));var rp=require(_0x0c58('0x3'));var moment=require(_0x0c58('0x4'));var BPromise=require(_0x0c58('0x5'));var Mustache=require(_0x0c58('0x6'));var util=require(_0x0c58('0x7'));var path=require('path');var sox=require(_0x0c58('0x8'));var csv=require(_0x0c58('0x9'));var ejs=require(_0x0c58('0xa'));var fs=require('fs');var fs_extra=require(_0x0c58('0xb'));var _=require(_0x0c58('0xc'));var squel=require(_0x0c58('0xd'));var crypto=require('crypto');var jsforce=require(_0x0c58('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x0c58('0x9'));var querystring=require('querystring');var Papa=require(_0x0c58('0xf'));var Redis=require(_0x0c58('0x10'));var authService=require(_0x0c58('0x11'));var qs=require(_0x0c58('0x12'));var as=require(_0x0c58('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c58('0x14'))('api');var utils=require(_0x0c58('0x15'));var config=require(_0x0c58('0x16'));var licenseUtil=require(_0x0c58('0x17'));var db=require(_0x0c58('0x18'))['db'];function respondWithStatusCode(_0x4473bf,_0x22ce61){_0x22ce61=_0x22ce61||0xcc;return function(_0x28899e){if(_0x28899e){return _0x4473bf[_0x0c58('0x19')](_0x22ce61);}return _0x4473bf[_0x0c58('0x1a')](_0x22ce61)[_0x0c58('0x1b')]();};}function respondWithResult(_0x4e9ca6,_0x182c4e){_0x182c4e=_0x182c4e||0xc8;return function(_0x47d2de){if(_0x47d2de){return _0x4e9ca6[_0x0c58('0x1a')](_0x182c4e)[_0x0c58('0x1c')](_0x47d2de);}};}function respondWithFilteredResult(_0x54af49,_0xb961d9){return function(_0x578998){if(_0x578998){var _0x56bbb5=typeof _0xb961d9[_0x0c58('0x1d')]===_0x0c58('0x1e')&&typeof _0xb961d9[_0x0c58('0x1f')]===_0x0c58('0x1e');var _0x3293c7=_0x578998[_0x0c58('0x20')];var _0x374645=_0x56bbb5?0x0:_0xb961d9[_0x0c58('0x1d')];var _0x570e95=_0x56bbb5?_0x578998['count']:_0xb961d9[_0x0c58('0x1d')]+_0xb961d9[_0x0c58('0x1f')];var _0x32bec6;if(_0x570e95>=_0x3293c7){_0x570e95=_0x3293c7;_0x32bec6=0xc8;}else{_0x32bec6=0xce;}_0x54af49[_0x0c58('0x1a')](_0x32bec6);return _0x54af49[_0x0c58('0x21')](_0x0c58('0x22'),_0x374645+'-'+_0x570e95+'/'+_0x3293c7)[_0x0c58('0x1c')](_0x578998);}return null;};}function patchUpdates(_0x15ee8b){return function(_0x525b83){try{jsonpatch['apply'](_0x525b83,_0x15ee8b,!![]);}catch(_0x228a0e){return BPromise[_0x0c58('0x23')](_0x228a0e);}return _0x525b83['save']();};}function saveUpdates(_0x1f0002,_0x17a606){return function(_0x3ee1fe){if(_0x3ee1fe){return _0x3ee1fe[_0x0c58('0x24')](_0x1f0002)[_0x0c58('0x25')](function(_0x4e18e7){return _0x4e18e7;});}return null;};}function removeEntity(_0x4ada46,_0x2ebe18){return function(_0x3a19db){if(_0x3a19db){return _0x3a19db[_0x0c58('0x26')]()[_0x0c58('0x25')](function(){_0x4ada46[_0x0c58('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x139b6b,_0x306526){return function(_0x1d3613){if(!_0x1d3613){_0x139b6b[_0x0c58('0x19')](0x194);}return _0x1d3613;};}function handleError(_0x5b6409,_0x479a64){_0x479a64=_0x479a64||0x1f4;return function(_0x144c1d){logger[_0x0c58('0x27')](_0x144c1d['stack']);if(_0x144c1d[_0x0c58('0x28')]){delete _0x144c1d[_0x0c58('0x28')];}_0x5b6409[_0x0c58('0x1a')](_0x479a64)['send'](_0x144c1d);};}exports[_0x0c58('0x29')]=function(_0x34094c,_0xa37ebc){var _0x4ea267={},_0x2eb732={},_0x510cfc={'count':0x0,'rows':[]};var _0x2737da=_[_0x0c58('0x2a')](db[_0x0c58('0x2b')][_0x0c58('0x2c')],function(_0x408af1){return{'name':_0x408af1[_0x0c58('0x2d')],'type':_0x408af1[_0x0c58('0x2e')]['key']};});_0x2eb732[_0x0c58('0x2f')]=_['map'](_0x2737da,'name');_0x2eb732[_0x0c58('0x30')]=_[_0x0c58('0x31')](_0x34094c[_0x0c58('0x30')]);_0x2eb732[_0x0c58('0x32')]=_[_0x0c58('0x33')](_0x2eb732[_0x0c58('0x2f')],_0x2eb732[_0x0c58('0x30')]);_0x4ea267['attributes']=_[_0x0c58('0x33')](_0x2eb732[_0x0c58('0x2f')],qs[_0x0c58('0x34')](_0x34094c[_0x0c58('0x30')][_0x0c58('0x34')]));_0x4ea267[_0x0c58('0x35')]=_0x4ea267[_0x0c58('0x35')][_0x0c58('0x36')]?_0x4ea267[_0x0c58('0x35')]:_0x2eb732[_0x0c58('0x2f')];if(!_0x34094c[_0x0c58('0x30')]['hasOwnProperty'](_0x0c58('0x37'))){_0x4ea267[_0x0c58('0x1f')]=qs[_0x0c58('0x1f')](_0x34094c['query'][_0x0c58('0x1f')]);_0x4ea267[_0x0c58('0x1d')]=qs['offset'](_0x34094c['query'][_0x0c58('0x1d')]);}_0x4ea267['order']=qs[_0x0c58('0x38')](_0x34094c['query'][_0x0c58('0x38')]);_0x4ea267[_0x0c58('0x39')]=qs[_0x0c58('0x32')](_[_0x0c58('0x3a')](_0x34094c[_0x0c58('0x30')],_0x2eb732[_0x0c58('0x32')]),_0x2737da);if(_0x34094c['query'][_0x0c58('0x3b')]){_0x4ea267[_0x0c58('0x39')]=_['merge'](_0x4ea267[_0x0c58('0x39')],{'$or':_[_0x0c58('0x2a')](_0x2737da,function(_0x51b036){if(_0x51b036['type']!==_0x0c58('0x3c')){var _0x3ffee5={};_0x3ffee5[_0x51b036[_0x0c58('0x28')]]={'$like':'%'+_0x34094c[_0x0c58('0x30')]['filter']+'%'};return _0x3ffee5;}})});}_0x4ea267=_[_0x0c58('0x3d')]({},_0x4ea267,_0x34094c[_0x0c58('0x3e')]);var _0x4dfef5={'where':_0x4ea267['where']};return db[_0x0c58('0x2b')][_0x0c58('0x20')](_0x4dfef5)[_0x0c58('0x25')](function(_0x2c2e3b){_0x510cfc[_0x0c58('0x20')]=_0x2c2e3b;if(_0x34094c[_0x0c58('0x30')][_0x0c58('0x3f')]){_0x4ea267[_0x0c58('0x40')]=[{'all':!![]}];}return db[_0x0c58('0x2b')]['findAll'](_0x4ea267);})[_0x0c58('0x25')](function(_0x1f0aec){_0x510cfc[_0x0c58('0x41')]=_0x1f0aec;return _0x510cfc;})[_0x0c58('0x25')](respondWithFilteredResult(_0xa37ebc,_0x4ea267))[_0x0c58('0x42')](handleError(_0xa37ebc,null));};exports['show']=function(_0xb84c6,_0x4fe43d){var _0x469248={'raw':!![],'where':{'id':_0xb84c6[_0x0c58('0x43')]['id']}},_0x109af7={};_0x109af7[_0x0c58('0x2f')]=_[_0x0c58('0x31')](db[_0x0c58('0x2b')][_0x0c58('0x2c')]);_0x109af7[_0x0c58('0x30')]=_[_0x0c58('0x31')](_0xb84c6['query']);_0x109af7[_0x0c58('0x32')]=_['intersection'](_0x109af7[_0x0c58('0x2f')],_0x109af7[_0x0c58('0x30')]);_0x469248[_0x0c58('0x35')]=_[_0x0c58('0x33')](_0x109af7[_0x0c58('0x2f')],qs[_0x0c58('0x34')](_0xb84c6[_0x0c58('0x30')][_0x0c58('0x34')]));_0x469248[_0x0c58('0x35')]=_0x469248['attributes'][_0x0c58('0x36')]?_0x469248[_0x0c58('0x35')]:_0x109af7[_0x0c58('0x2f')];if(_0xb84c6[_0x0c58('0x30')][_0x0c58('0x3f')]){_0x469248['include']=[{'all':!![]}];}_0x469248=_[_0x0c58('0x3d')]({},_0x469248,_0xb84c6[_0x0c58('0x3e')]);return db['MailTransferReport'][_0x0c58('0x44')](_0x469248)['then'](handleEntityNotFound(_0x4fe43d,null))['then'](respondWithResult(_0x4fe43d,null))[_0x0c58('0x42')](handleError(_0x4fe43d,null));};exports[_0x0c58('0x45')]=function(_0x23ccdf,_0x184c7f){return db[_0x0c58('0x2b')][_0x0c58('0x45')](_0x23ccdf[_0x0c58('0x46')],{})['then'](respondWithResult(_0x184c7f,0xc9))[_0x0c58('0x42')](handleError(_0x184c7f,null));};exports[_0x0c58('0x24')]=function(_0x3a2a65,_0xef56a0){if(_0x3a2a65['body']['id']){delete _0x3a2a65['body']['id'];}return db['MailTransferReport'][_0x0c58('0x44')]({'where':{'id':_0x3a2a65[_0x0c58('0x43')]['id']}})['then'](handleEntityNotFound(_0xef56a0,null))[_0x0c58('0x25')](saveUpdates(_0x3a2a65[_0x0c58('0x46')],null))['then'](respondWithResult(_0xef56a0,null))[_0x0c58('0x42')](handleError(_0xef56a0,null));};exports[_0x0c58('0x26')]=function(_0x15de77,_0x8bbfac){return db['MailTransferReport'][_0x0c58('0x44')]({'where':{'id':_0x15de77[_0x0c58('0x43')]['id']}})['then'](handleEntityNotFound(_0x8bbfac,null))[_0x0c58('0x25')](removeEntity(_0x8bbfac,null))[_0x0c58('0x42')](handleError(_0x8bbfac,null));};exports[_0x0c58('0x47')]=function(_0x4a9a39,_0x2f5420){return db['MailTransferReport'][_0x0c58('0x47')]()[_0x0c58('0x25')](respondWithResult(_0x2f5420,null))[_0x0c58('0x42')](handleError(_0x2f5420,null));}; \ No newline at end of file +var _0xeca9=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','keys','includeAll','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x11ad65,_0x352d3c){var _0x35590c=function(_0x2c3845){while(--_0x2c3845){_0x11ad65['push'](_0x11ad65['shift']());}};_0x35590c(++_0x352d3c);}(_0xeca9,0x11d));var _0x9eca=function(_0x1e8c41,_0x5865cd){_0x1e8c41=_0x1e8c41-0x0;var _0x30d0ef=_0xeca9[_0x1e8c41];return _0x30d0ef;};'use strict';var emlformat=require(_0x9eca('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9eca('0x1'));var jsonpatch=require(_0x9eca('0x2'));var rp=require(_0x9eca('0x3'));var moment=require(_0x9eca('0x4'));var BPromise=require(_0x9eca('0x5'));var Mustache=require(_0x9eca('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x9eca('0x7'));var ejs=require(_0x9eca('0x8'));var fs=require('fs');var fs_extra=require(_0x9eca('0x9'));var _=require(_0x9eca('0xa'));var squel=require(_0x9eca('0xb'));var crypto=require('crypto');var jsforce=require(_0x9eca('0xc'));var deskjs=require(_0x9eca('0xd'));var toCsv=require(_0x9eca('0x7'));var querystring=require(_0x9eca('0xe'));var Papa=require('papaparse');var Redis=require(_0x9eca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x9eca('0x10'));var as=require(_0x9eca('0x11'));var hardwareService=require(_0x9eca('0x12'));var logger=require('../../config/logger')(_0x9eca('0x13'));var utils=require(_0x9eca('0x14'));var config=require(_0x9eca('0x15'));var licenseUtil=require(_0x9eca('0x16'));var db=require(_0x9eca('0x17'))['db'];function respondWithStatusCode(_0x54876e,_0xdbe38b){_0xdbe38b=_0xdbe38b||0xcc;return function(_0x10424c){if(_0x10424c){return _0x54876e[_0x9eca('0x18')](_0xdbe38b);}return _0x54876e[_0x9eca('0x19')](_0xdbe38b)[_0x9eca('0x1a')]();};}function respondWithResult(_0x4479a2,_0x4560cb){_0x4560cb=_0x4560cb||0xc8;return function(_0x54cc46){if(_0x54cc46){return _0x4479a2['status'](_0x4560cb)['json'](_0x54cc46);}};}function respondWithFilteredResult(_0xbb2ff2,_0x37b9e0){return function(_0x34b9e4){if(_0x34b9e4){var _0x36d975=typeof _0x37b9e0[_0x9eca('0x1b')]===_0x9eca('0x1c')&&typeof _0x37b9e0[_0x9eca('0x1d')]===_0x9eca('0x1c');var _0x5406da=_0x34b9e4[_0x9eca('0x1e')];var _0x311d47=_0x36d975?0x0:_0x37b9e0['offset'];var _0x48c7e2=_0x36d975?_0x34b9e4[_0x9eca('0x1e')]:_0x37b9e0[_0x9eca('0x1b')]+_0x37b9e0[_0x9eca('0x1d')];var _0xae6862;if(_0x48c7e2>=_0x5406da){_0x48c7e2=_0x5406da;_0xae6862=0xc8;}else{_0xae6862=0xce;}_0xbb2ff2['status'](_0xae6862);return _0xbb2ff2[_0x9eca('0x1f')]('Content-Range',_0x311d47+'-'+_0x48c7e2+'/'+_0x5406da)['json'](_0x34b9e4);}return null;};}function patchUpdates(_0x4fc896){return function(_0x47c263){try{jsonpatch[_0x9eca('0x20')](_0x47c263,_0x4fc896,!![]);}catch(_0x3473da){return BPromise[_0x9eca('0x21')](_0x3473da);}return _0x47c263[_0x9eca('0x22')]();};}function saveUpdates(_0x20694c,_0x551005){return function(_0x2081ec){if(_0x2081ec){return _0x2081ec[_0x9eca('0x23')](_0x20694c)[_0x9eca('0x24')](function(_0x2e5415){return _0x2e5415;});}return null;};}function removeEntity(_0xc98681,_0x3eb864){return function(_0x59ea5f){if(_0x59ea5f){return _0x59ea5f[_0x9eca('0x25')]()['then'](function(){_0xc98681['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c06b2,_0x2065a9){return function(_0x52329d){if(!_0x52329d){_0x5c06b2[_0x9eca('0x18')](0x194);}return _0x52329d;};}function handleError(_0x2e366a,_0x2dcdd3){_0x2dcdd3=_0x2dcdd3||0x1f4;return function(_0x2f7cee){logger[_0x9eca('0x26')](_0x2f7cee[_0x9eca('0x27')]);if(_0x2f7cee['name']){delete _0x2f7cee[_0x9eca('0x28')];}_0x2e366a[_0x9eca('0x19')](_0x2dcdd3)[_0x9eca('0x29')](_0x2f7cee);};}exports['index']=function(_0x38a504,_0x4f85a3){var _0x59e4ba={},_0x19080b={},_0x4f6224={'count':0x0,'rows':[]};var _0xbb159b=_[_0x9eca('0x2a')](db[_0x9eca('0x2b')][_0x9eca('0x2c')],function(_0x4b3e78){return{'name':_0x4b3e78[_0x9eca('0x2d')],'type':_0x4b3e78[_0x9eca('0x2e')][_0x9eca('0x2f')]};});_0x19080b[_0x9eca('0x30')]=_[_0x9eca('0x2a')](_0xbb159b,'name');_0x19080b[_0x9eca('0x31')]=_['keys'](_0x38a504[_0x9eca('0x31')]);_0x19080b[_0x9eca('0x32')]=_[_0x9eca('0x33')](_0x19080b['model'],_0x19080b[_0x9eca('0x31')]);_0x59e4ba['attributes']=_['intersection'](_0x19080b['model'],qs[_0x9eca('0x34')](_0x38a504['query'][_0x9eca('0x34')]));_0x59e4ba['attributes']=_0x59e4ba[_0x9eca('0x35')][_0x9eca('0x36')]?_0x59e4ba[_0x9eca('0x35')]:_0x19080b['model'];if(!_0x38a504[_0x9eca('0x31')][_0x9eca('0x37')](_0x9eca('0x38'))){_0x59e4ba[_0x9eca('0x1d')]=qs['limit'](_0x38a504['query'][_0x9eca('0x1d')]);_0x59e4ba[_0x9eca('0x1b')]=qs[_0x9eca('0x1b')](_0x38a504[_0x9eca('0x31')][_0x9eca('0x1b')]);}_0x59e4ba[_0x9eca('0x39')]=qs[_0x9eca('0x3a')](_0x38a504[_0x9eca('0x31')][_0x9eca('0x3a')]);_0x59e4ba[_0x9eca('0x3b')]=qs[_0x9eca('0x32')](_[_0x9eca('0x3c')](_0x38a504[_0x9eca('0x31')],_0x19080b[_0x9eca('0x32')]),_0xbb159b);if(_0x38a504[_0x9eca('0x31')]['filter']){_0x59e4ba['where']=_[_0x9eca('0x3d')](_0x59e4ba[_0x9eca('0x3b')],{'$or':_[_0x9eca('0x2a')](_0xbb159b,function(_0x5dba69){if(_0x5dba69[_0x9eca('0x2e')]!=='VIRTUAL'){var _0x2376ea={};_0x2376ea[_0x5dba69['name']]={'$like':'%'+_0x38a504['query'][_0x9eca('0x3e')]+'%'};return _0x2376ea;}})});}_0x59e4ba=_['merge']({},_0x59e4ba,_0x38a504[_0x9eca('0x3f')]);var _0x3141ff={'where':_0x59e4ba['where']};return db[_0x9eca('0x2b')][_0x9eca('0x1e')](_0x3141ff)['then'](function(_0xde430a){_0x4f6224[_0x9eca('0x1e')]=_0xde430a;if(_0x38a504['query']['includeAll']){_0x59e4ba[_0x9eca('0x40')]=[{'all':!![]}];}return db[_0x9eca('0x2b')][_0x9eca('0x41')](_0x59e4ba);})[_0x9eca('0x24')](function(_0x100c49){_0x4f6224[_0x9eca('0x42')]=_0x100c49;return _0x4f6224;})['then'](respondWithFilteredResult(_0x4f85a3,_0x59e4ba))[_0x9eca('0x43')](handleError(_0x4f85a3,null));};exports[_0x9eca('0x44')]=function(_0xfd261c,_0x4423e3){var _0x3d7437={'raw':!![],'where':{'id':_0xfd261c[_0x9eca('0x45')]['id']}},_0xb6dcfe={};_0xb6dcfe[_0x9eca('0x30')]=_[_0x9eca('0x46')](db['MailTransferReport'][_0x9eca('0x2c')]);_0xb6dcfe[_0x9eca('0x31')]=_[_0x9eca('0x46')](_0xfd261c[_0x9eca('0x31')]);_0xb6dcfe[_0x9eca('0x32')]=_[_0x9eca('0x33')](_0xb6dcfe[_0x9eca('0x30')],_0xb6dcfe[_0x9eca('0x31')]);_0x3d7437['attributes']=_['intersection'](_0xb6dcfe[_0x9eca('0x30')],qs[_0x9eca('0x34')](_0xfd261c['query'][_0x9eca('0x34')]));_0x3d7437['attributes']=_0x3d7437[_0x9eca('0x35')][_0x9eca('0x36')]?_0x3d7437[_0x9eca('0x35')]:_0xb6dcfe[_0x9eca('0x30')];if(_0xfd261c[_0x9eca('0x31')][_0x9eca('0x47')]){_0x3d7437[_0x9eca('0x40')]=[{'all':!![]}];}_0x3d7437=_['merge']({},_0x3d7437,_0xfd261c[_0x9eca('0x3f')]);return db['MailTransferReport']['find'](_0x3d7437)[_0x9eca('0x24')](handleEntityNotFound(_0x4423e3,null))[_0x9eca('0x24')](respondWithResult(_0x4423e3,null))[_0x9eca('0x43')](handleError(_0x4423e3,null));};exports[_0x9eca('0x48')]=function(_0x444c04,_0x238710){return db['MailTransferReport'][_0x9eca('0x48')](_0x444c04['body'],{})[_0x9eca('0x24')](respondWithResult(_0x238710,0xc9))['catch'](handleError(_0x238710,null));};exports[_0x9eca('0x23')]=function(_0x43fb01,_0x4b08af){if(_0x43fb01[_0x9eca('0x49')]['id']){delete _0x43fb01[_0x9eca('0x49')]['id'];}return db[_0x9eca('0x2b')]['find']({'where':{'id':_0x43fb01['params']['id']}})[_0x9eca('0x24')](handleEntityNotFound(_0x4b08af,null))[_0x9eca('0x24')](saveUpdates(_0x43fb01[_0x9eca('0x49')],null))[_0x9eca('0x24')](respondWithResult(_0x4b08af,null))[_0x9eca('0x43')](handleError(_0x4b08af,null));};exports[_0x9eca('0x25')]=function(_0x338aad,_0x34669e){return db[_0x9eca('0x2b')]['find']({'where':{'id':_0x338aad[_0x9eca('0x45')]['id']}})[_0x9eca('0x24')](handleEntityNotFound(_0x34669e,null))['then'](removeEntity(_0x34669e,null))[_0x9eca('0x43')](handleError(_0x34669e,null));};exports[_0x9eca('0x4a')]=function(_0x21e302,_0x151bf6){return db[_0x9eca('0x2b')][_0x9eca('0x4a')]()[_0x9eca('0x24')](respondWithResult(_0x151bf6,null))[_0x9eca('0x43')](handleError(_0x151bf6,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c396d94..8e60639 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 _0x0a25=['./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x0a25,0x68));var _0x50a2=function(_0x4a0b92,_0x1dbd16){_0x4a0b92=_0x4a0b92-0x0;var _0x857610=_0x0a25[_0x4a0b92];return _0x857610;};'use strict';var _=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var logger=require('../../config/logger')(_0x50a2('0x2'));var moment=require(_0x50a2('0x3'));var BPromise=require('bluebird');var rp=require(_0x50a2('0x4'));var fs=require('fs');var path=require(_0x50a2('0x5'));var rimraf=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var attributes=require(_0x50a2('0x8'));module[_0x50a2('0x9')]=function(_0x33fef7,_0x8b6ba4){return _0x33fef7[_0x50a2('0xa')](_0x50a2('0xb'),attributes,{'tableName':_0x50a2('0xc'),'paranoid':![],'indexes':[{'name':_0x50a2('0xd'),'fields':[_0x50a2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd338=['lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','MailTransferReport','report_mail_transfer','uniqueid'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xd338,0x1f4));var _0x8d33=function(_0x42bc91,_0x41f40a){_0x42bc91=_0x42bc91-0x0;var _0x3f5507=_0xd338[_0x42bc91];return _0x3f5507;};'use strict';var _=require(_0x8d33('0x0'));var util=require('util');var logger=require(_0x8d33('0x1'))('api');var moment=require('moment');var BPromise=require(_0x8d33('0x2'));var rp=require(_0x8d33('0x3'));var fs=require('fs');var path=require(_0x8d33('0x4'));var rimraf=require(_0x8d33('0x5'));var config=require(_0x8d33('0x6'));var attributes=require('./mailTransferReport.attributes');module['exports']=function(_0x2cbe6d,_0x50fe18){return _0x2cbe6d['define'](_0x8d33('0x7'),attributes,{'tableName':_0x8d33('0x8'),'paranoid':![],'indexes':[{'name':_0x8d33('0x9'),'fields':[_0x8d33('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 0c92f84..aabb591 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 _0xb1eb=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x1f8b69,_0x321d85){var _0x5b6928=function(_0x1139a3){while(--_0x1139a3){_0x1f8b69['push'](_0x1f8b69['shift']());}};_0x5b6928(++_0x321d85);}(_0xb1eb,0x179));var _0xbb1e=function(_0x2768ca,_0x301b38){_0x2768ca=_0x2768ca-0x0;var _0x4329f2=_0xb1eb[_0x2768ca];return _0x4329f2;};'use strict';var _=require(_0xbb1e('0x0'));var util=require('util');var moment=require(_0xbb1e('0x1'));var BPromise=require('bluebird');var rs=require(_0xbb1e('0x2'));var fs=require('fs');var Redis=require(_0xbb1e('0x3'));var db=require(_0xbb1e('0x4'))['db'];var utils=require(_0xbb1e('0x5'));var logger=require(_0xbb1e('0x6'))('rpc');var config=require(_0xbb1e('0x7'));var jayson=require(_0xbb1e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3ff63e,_0x374abc,_0x56c450){return new BPromise(function(_0x1d57a3,_0x1c94db){return client[_0xbb1e('0x9')](_0x3ff63e,_0x56c450)[_0xbb1e('0xa')](function(_0x27782f){logger[_0xbb1e('0xb')](_0xbb1e('0xc'),_0x374abc,_0xbb1e('0xd'));logger[_0xbb1e('0xe')](_0xbb1e('0xf'),_0x374abc,_0xbb1e('0xd'),JSON['stringify'](_0x27782f));if(_0x27782f['error']){if(_0x27782f[_0xbb1e('0x10')][_0xbb1e('0x11')]===0x1f4){logger[_0xbb1e('0x10')](_0xbb1e('0xc'),_0x374abc,_0x27782f[_0xbb1e('0x10')]['message']);return _0x1c94db(_0x27782f[_0xbb1e('0x10')][_0xbb1e('0x12')]);}logger[_0xbb1e('0x10')](_0xbb1e('0xc'),_0x374abc,_0x27782f[_0xbb1e('0x10')][_0xbb1e('0x12')]);return _0x1d57a3(_0x27782f[_0xbb1e('0x10')][_0xbb1e('0x12')]);}else{logger[_0xbb1e('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x374abc,_0xbb1e('0xd'));_0x1d57a3(_0x27782f[_0xbb1e('0x13')][_0xbb1e('0x12')]);}})[_0xbb1e('0x14')](function(_0x1a2cf0){logger[_0xbb1e('0x10')](_0xbb1e('0xc'),_0x374abc,_0x1a2cf0);_0x1c94db(_0x1a2cf0);});});} \ No newline at end of file +var _0x7221=['MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x243dce,_0x548bcf){var _0x482b9d=function(_0x504104){while(--_0x504104){_0x243dce['push'](_0x243dce['shift']());}};_0x482b9d(++_0x548bcf);}(_0x7221,0x111));var _0x1722=function(_0x168f17,_0x371e7b){_0x168f17=_0x168f17-0x0;var _0x527037=_0x7221[_0x168f17];return _0x527037;};'use strict';var _=require(_0x1722('0x0'));var util=require(_0x1722('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1722('0x2'));var db=require(_0x1722('0x3'))['db'];var utils=require(_0x1722('0x4'));var logger=require('../../config/logger')(_0x1722('0x5'));var config=require(_0x1722('0x6'));var jayson=require(_0x1722('0x7'));var client=jayson[_0x1722('0x8')][_0x1722('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c19cd,_0x4cff43,_0x336150){return new BPromise(function(_0x4d0664,_0x2d0a2b){return client[_0x1722('0xa')](_0x5c19cd,_0x336150)[_0x1722('0xb')](function(_0x2b8f55){logger[_0x1722('0xc')](_0x1722('0xd'),_0x4cff43,_0x1722('0xe'));logger[_0x1722('0xf')](_0x1722('0x10'),_0x4cff43,_0x1722('0xe'),JSON['stringify'](_0x2b8f55));if(_0x2b8f55['error']){if(_0x2b8f55[_0x1722('0x11')][_0x1722('0x12')]===0x1f4){logger[_0x1722('0x11')](_0x1722('0xd'),_0x4cff43,_0x2b8f55[_0x1722('0x11')]['message']);return _0x2d0a2b(_0x2b8f55['error'][_0x1722('0x13')]);}logger[_0x1722('0x11')](_0x1722('0xd'),_0x4cff43,_0x2b8f55[_0x1722('0x11')][_0x1722('0x13')]);return _0x4d0664(_0x2b8f55['error'][_0x1722('0x13')]);}else{logger[_0x1722('0xc')](_0x1722('0xd'),_0x4cff43,_0x1722('0xe'));_0x4d0664(_0x2b8f55[_0x1722('0x14')]['message']);}})[_0x1722('0x15')](function(_0xdef45b){logger[_0x1722('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x4cff43,_0xdef45b);_0x2d0a2b(_0xdef45b);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 5576c42..2aef03f 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 _0x1dab=['/describe','describe','/:id','post','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x12d6d2,_0x5284a3){var _0x1d8228=function(_0xe8a8d9){while(--_0xe8a8d9){_0x12d6d2['push'](_0x12d6d2['shift']());}};_0x1d8228(++_0x5284a3);}(_0x1dab,0xc6));var _0xb1da=function(_0xb2492e,_0xb6db90){_0xb2492e=_0xb2492e-0x0;var _0xa70fb6=_0x1dab[_0xb2492e];return _0xa70fb6;};'use strict';var multer=require('multer');var util=require(_0xb1da('0x0'));var path=require(_0xb1da('0x1'));var timeout=require(_0xb1da('0x2'));var express=require(_0xb1da('0x3'));var router=express[_0xb1da('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb1da('0x5'));var interaction=require(_0xb1da('0x6'));var config=require(_0xb1da('0x7'));var controller=require('./memberReport.controller');router[_0xb1da('0x8')]('/',auth[_0xb1da('0x9')](),controller[_0xb1da('0xa')]);router[_0xb1da('0x8')](_0xb1da('0xb'),auth[_0xb1da('0x9')](),controller[_0xb1da('0xc')]);router[_0xb1da('0x8')](_0xb1da('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xb1da('0xe')]('/',auth[_0xb1da('0x9')](),controller['create']);router[_0xb1da('0xf')]('/:id',auth[_0xb1da('0x9')](),controller['update']);router[_0xb1da('0x10')](_0xb1da('0xd'),auth[_0xb1da('0x9')](),controller[_0xb1da('0x11')]);module[_0xb1da('0x12')]=router; \ No newline at end of file +var _0xc84f=['isAuthenticated','describe','/:id','show','post','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get'];(function(_0x13c09a,_0x51ce7e){var _0x2cfdfd=function(_0x1c344a){while(--_0x1c344a){_0x13c09a['push'](_0x13c09a['shift']());}};_0x2cfdfd(++_0x51ce7e);}(_0xc84f,0x185));var _0xfc84=function(_0x4994b7,_0x46db4){_0x4994b7=_0x4994b7-0x0;var _0x5b28cf=_0xc84f[_0x4994b7];return _0x5b28cf;};'use strict';var multer=require(_0xfc84('0x0'));var util=require(_0xfc84('0x1'));var path=require('path');var timeout=require(_0xfc84('0x2'));var express=require(_0xfc84('0x3'));var router=express[_0xfc84('0x4')]();var fs_extra=require(_0xfc84('0x5'));var auth=require(_0xfc84('0x6'));var interaction=require(_0xfc84('0x7'));var config=require(_0xfc84('0x8'));var controller=require(_0xfc84('0x9'));router[_0xfc84('0xa')]('/',auth[_0xfc84('0xb')](),controller['index']);router[_0xfc84('0xa')]('/describe',auth[_0xfc84('0xb')](),controller[_0xfc84('0xc')]);router['get'](_0xfc84('0xd'),auth[_0xfc84('0xb')](),controller[_0xfc84('0xe')]);router[_0xfc84('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xfc84('0xb')](),controller[_0xfc84('0x10')]);router[_0xfc84('0x11')]('/:id',auth[_0xfc84('0xb')](),controller[_0xfc84('0x12')]);module[_0xfc84('0x13')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index da6e393..5473e0b 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 _0xc3ab=['talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]'];(function(_0x92c9c8,_0x2e6d63){var _0x3f08c5=function(_0x4949a7){while(--_0x4949a7){_0x92c9c8['push'](_0x92c9c8['shift']());}};_0x3f08c5(++_0x2e6d63);}(_0xc3ab,0xc9));var _0xbc3a=function(_0x3d3fcd,_0x429278){_0x3d3fcd=_0x3d3fcd-0x0;var _0x451c5c=_0xc3ab[_0x3d3fcd];return _0x451c5c;};'use strict';var Sequelize=require(_0xbc3a('0x0'));var moment=require(_0xbc3a('0x1'));module[_0xbc3a('0x2')]={'channel':{'type':Sequelize[_0xbc3a('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':_0xbc3a('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0xbc3a('0x5')]},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xbc3a('0x6')],'set':function(_0x473c96){var _0x4989a1=moment(_0x473c96);var _0x577fda=moment(this[_0xbc3a('0x7')](_0xbc3a('0x8')));var _0x44e5f6=_0x4989a1[_0xbc3a('0x9')](_0x577fda,'seconds');this[_0xbc3a('0xa')](_0xbc3a('0xb'),_0x473c96);this[_0xbc3a('0xa')](_0xbc3a('0xc'),_0x44e5f6>=0x0?_0x44e5f6:null);}},'data1':{'type':Sequelize[_0xbc3a('0x3')],'comment':_0xbc3a('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0xbc3a('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0xbc3a('0xf')},'data4':{'type':Sequelize[_0xbc3a('0x3')],'comment':_0xbc3a('0x10')},'data5':{'type':Sequelize[_0xbc3a('0x3')],'comment':_0xbc3a('0x11')},'role':{'type':Sequelize[_0xbc3a('0x3')]},'internal':{'type':Sequelize[_0xbc3a('0x5')]},'uniqueid':{'type':Sequelize[_0xbc3a('0x3')]}}; \ No newline at end of file +var _0xf023=['DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','INTEGER','sequelize','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING'];(function(_0x3e524a,_0x32c5d4){var _0xef55eb=function(_0xd6da71){while(--_0xd6da71){_0x3e524a['push'](_0x3e524a['shift']());}};_0xef55eb(++_0x32c5d4);}(_0xf023,0xb9));var _0x3f02=function(_0xc19eca,_0xae6969){_0xc19eca=_0xc19eca-0x0;var _0x26f2e1=_0xf023[_0xc19eca];return _0x26f2e1;};'use strict';var Sequelize=require(_0x3f02('0x0'));var moment=require('moment');module[_0x3f02('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x3f02('0x2')]},'interface':{'type':Sequelize[_0x3f02('0x2')]},'type':{'type':Sequelize[_0x3f02('0x2')],'defaultValue':_0x3f02('0x3'),'comment':_0x3f02('0x4')},'duration':{'type':Sequelize['INTEGER']},'enterAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3f02('0x5')],'set':function(_0x36f3fb){var _0x31fe3d=moment(_0x36f3fb);var _0x9096ca=moment(this[_0x3f02('0x6')](_0x3f02('0x7')));var _0x498de2=_0x31fe3d[_0x3f02('0x8')](_0x9096ca,_0x3f02('0x9'));this[_0x3f02('0xa')](_0x3f02('0xb'),_0x36f3fb);this[_0x3f02('0xa')](_0x3f02('0xc'),_0x498de2>=0x0?_0x498de2:null);}},'data1':{'type':Sequelize[_0x3f02('0x2')],'comment':_0x3f02('0xd')},'data2':{'type':Sequelize['STRING'],'comment':_0x3f02('0xe')},'data3':{'type':Sequelize['STRING'],'comment':_0x3f02('0xf')},'data4':{'type':Sequelize[_0x3f02('0x2')],'comment':_0x3f02('0x10')},'data5':{'type':Sequelize[_0x3f02('0x2')],'comment':_0x3f02('0x11')},'role':{'type':Sequelize[_0x3f02('0x2')]},'internal':{'type':Sequelize[_0x3f02('0x12')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 0e2b549..40b7af8 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 _0x7217=['query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','filter','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','stack','send','index','map','MemberReport','fieldName','type','model','name','keys'];(function(_0x23f08b,_0x5c3c46){var _0x166dd1=function(_0x21c587){while(--_0x21c587){_0x23f08b['push'](_0x23f08b['shift']());}};_0x166dd1(++_0x5c3c46);}(_0x7217,0x19e));var _0x7721=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0x7217[_0x934425];return _0x31d596;};'use strict';var emlformat=require(_0x7721('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7721('0x1'));var jsonpatch=require(_0x7721('0x2'));var rp=require(_0x7721('0x3'));var moment=require(_0x7721('0x4'));var BPromise=require(_0x7721('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x7721('0x6'));var sox=require(_0x7721('0x7'));var csv=require(_0x7721('0x8'));var ejs=require(_0x7721('0x9'));var fs=require('fs');var fs_extra=require(_0x7721('0xa'));var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x8'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var licenseUtil=require(_0x7721('0x1a'));var db=require(_0x7721('0x1b'))['db'];function respondWithStatusCode(_0x55b4ca,_0x2911ec){_0x2911ec=_0x2911ec||0xcc;return function(_0x199930){if(_0x199930){return _0x55b4ca['sendStatus'](_0x2911ec);}return _0x55b4ca[_0x7721('0x1c')](_0x2911ec)[_0x7721('0x1d')]();};}function respondWithResult(_0x3f01c5,_0x2e9752){_0x2e9752=_0x2e9752||0xc8;return function(_0x5069da){if(_0x5069da){return _0x3f01c5[_0x7721('0x1c')](_0x2e9752)[_0x7721('0x1e')](_0x5069da);}};}function respondWithFilteredResult(_0x534f1b,_0x4e199a){return function(_0x4b183e){if(_0x4b183e){var _0x5ed54=typeof _0x4e199a[_0x7721('0x1f')]===_0x7721('0x20')&&typeof _0x4e199a[_0x7721('0x21')]==='undefined';var _0x20f669=_0x4b183e['count'];var _0x3fc09e=_0x5ed54?0x0:_0x4e199a['offset'];var _0xfec626=_0x5ed54?_0x4b183e[_0x7721('0x22')]:_0x4e199a[_0x7721('0x1f')]+_0x4e199a[_0x7721('0x21')];var _0x2286e5;if(_0xfec626>=_0x20f669){_0xfec626=_0x20f669;_0x2286e5=0xc8;}else{_0x2286e5=0xce;}_0x534f1b[_0x7721('0x1c')](_0x2286e5);return _0x534f1b[_0x7721('0x23')](_0x7721('0x24'),_0x3fc09e+'-'+_0xfec626+'/'+_0x20f669)[_0x7721('0x1e')](_0x4b183e);}return null;};}function patchUpdates(_0xaeccc4){return function(_0x4ce1db){try{jsonpatch[_0x7721('0x25')](_0x4ce1db,_0xaeccc4,!![]);}catch(_0x2c1583){return BPromise[_0x7721('0x26')](_0x2c1583);}return _0x4ce1db[_0x7721('0x27')]();};}function saveUpdates(_0x57140c,_0x28f5a6){return function(_0x512f31){if(_0x512f31){return _0x512f31[_0x7721('0x28')](_0x57140c)[_0x7721('0x29')](function(_0x3e8a4e){return _0x3e8a4e;});}return null;};}function removeEntity(_0x1caad8,_0x121cc4){return function(_0x395b15){if(_0x395b15){return _0x395b15[_0x7721('0x2a')]()['then'](function(){_0x1caad8[_0x7721('0x1c')](0xcc)[_0x7721('0x1d')]();});}};}function handleEntityNotFound(_0x125564,_0x1f67c7){return function(_0x40d550){if(!_0x40d550){_0x125564[_0x7721('0x2b')](0x194);}return _0x40d550;};}function handleError(_0x424e05,_0xf753f1){_0xf753f1=_0xf753f1||0x1f4;return function(_0x40f367){logger['error'](_0x40f367[_0x7721('0x2c')]);if(_0x40f367['name']){delete _0x40f367['name'];}_0x424e05[_0x7721('0x1c')](_0xf753f1)[_0x7721('0x2d')](_0x40f367);};}exports[_0x7721('0x2e')]=function(_0x158d98,_0x1ea4d){var _0x37b9f0={},_0xd7d703={},_0x1da2d8={'count':0x0,'rows':[]};var _0x5c54f0=_[_0x7721('0x2f')](db[_0x7721('0x30')]['rawAttributes'],function(_0x4a25c9){return{'name':_0x4a25c9[_0x7721('0x31')],'type':_0x4a25c9[_0x7721('0x32')]['key']};});_0xd7d703[_0x7721('0x33')]=_[_0x7721('0x2f')](_0x5c54f0,_0x7721('0x34'));_0xd7d703['query']=_[_0x7721('0x35')](_0x158d98[_0x7721('0x36')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],_0xd7d703['query']);_0x37b9f0[_0x7721('0x39')]=_[_0x7721('0x38')](_0xd7d703[_0x7721('0x33')],qs['fields'](_0x158d98[_0x7721('0x36')][_0x7721('0x3a')]));_0x37b9f0['attributes']=_0x37b9f0[_0x7721('0x39')]['length']?_0x37b9f0[_0x7721('0x39')]:_0xd7d703[_0x7721('0x33')];if(!_0x158d98[_0x7721('0x36')][_0x7721('0x3b')](_0x7721('0x3c'))){_0x37b9f0[_0x7721('0x21')]=qs[_0x7721('0x21')](_0x158d98[_0x7721('0x36')][_0x7721('0x21')]);_0x37b9f0[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x158d98['query'][_0x7721('0x1f')]);}_0x37b9f0['order']=qs[_0x7721('0x3d')](_0x158d98[_0x7721('0x36')][_0x7721('0x3d')]);_0x37b9f0[_0x7721('0x3e')]=qs[_0x7721('0x37')](_[_0x7721('0x3f')](_0x158d98['query'],_0xd7d703['filters']),_0x5c54f0);if(_0x158d98['query']['filter']){_0x37b9f0[_0x7721('0x3e')]=_[_0x7721('0x40')](_0x37b9f0[_0x7721('0x3e')],{'$or':_[_0x7721('0x2f')](_0x5c54f0,function(_0x4a90ce){if(_0x4a90ce[_0x7721('0x32')]!=='VIRTUAL'){var _0xfab37b={};_0xfab37b[_0x4a90ce[_0x7721('0x34')]]={'$like':'%'+_0x158d98['query'][_0x7721('0x41')]+'%'};return _0xfab37b;}})});}_0x37b9f0=_[_0x7721('0x40')]({},_0x37b9f0,_0x158d98['options']);var _0x4d0111={'where':_0x37b9f0[_0x7721('0x3e')]};return db[_0x7721('0x30')][_0x7721('0x22')](_0x4d0111)[_0x7721('0x29')](function(_0x577af9){_0x1da2d8[_0x7721('0x22')]=_0x577af9;if(_0x158d98[_0x7721('0x36')][_0x7721('0x42')]){_0x37b9f0[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x30')]['findAll'](_0x37b9f0);})[_0x7721('0x29')](function(_0x4a2c28){_0x1da2d8[_0x7721('0x44')]=_0x4a2c28;return _0x1da2d8;})['then'](respondWithFilteredResult(_0x1ea4d,_0x37b9f0))[_0x7721('0x45')](handleError(_0x1ea4d,null));};exports[_0x7721('0x46')]=function(_0x231dad,_0x49e0c5){var _0x1453d4={'raw':!![],'where':{'id':_0x231dad[_0x7721('0x47')]['id']}},_0x11d853={};_0x11d853['model']=_[_0x7721('0x35')](db[_0x7721('0x30')][_0x7721('0x48')]);_0x11d853[_0x7721('0x36')]=_[_0x7721('0x35')](_0x231dad[_0x7721('0x36')]);_0x11d853[_0x7721('0x37')]=_['intersection'](_0x11d853['model'],_0x11d853[_0x7721('0x36')]);_0x1453d4[_0x7721('0x39')]=_[_0x7721('0x38')](_0x11d853[_0x7721('0x33')],qs[_0x7721('0x3a')](_0x231dad[_0x7721('0x36')][_0x7721('0x3a')]));_0x1453d4[_0x7721('0x39')]=_0x1453d4[_0x7721('0x39')][_0x7721('0x49')]?_0x1453d4['attributes']:_0x11d853['model'];if(_0x231dad[_0x7721('0x36')][_0x7721('0x42')]){_0x1453d4[_0x7721('0x43')]=[{'all':!![]}];}_0x1453d4=_[_0x7721('0x40')]({},_0x1453d4,_0x231dad['options']);return db[_0x7721('0x30')][_0x7721('0x4a')](_0x1453d4)['then'](handleEntityNotFound(_0x49e0c5,null))[_0x7721('0x29')](respondWithResult(_0x49e0c5,null))['catch'](handleError(_0x49e0c5,null));};exports[_0x7721('0x4b')]=function(_0x5c6922,_0x334f23){return db[_0x7721('0x30')][_0x7721('0x4b')](_0x5c6922['body'],{})[_0x7721('0x29')](respondWithResult(_0x334f23,0xc9))[_0x7721('0x45')](handleError(_0x334f23,null));};exports['update']=function(_0x223d93,_0x1196c2){if(_0x223d93[_0x7721('0x4c')]['id']){delete _0x223d93['body']['id'];}return db[_0x7721('0x30')]['find']({'where':{'id':_0x223d93[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x1196c2,null))[_0x7721('0x29')](saveUpdates(_0x223d93[_0x7721('0x4c')],null))[_0x7721('0x29')](respondWithResult(_0x1196c2,null))[_0x7721('0x45')](handleError(_0x1196c2,null));};exports[_0x7721('0x2a')]=function(_0x7fbb73,_0x694d2f){return db[_0x7721('0x30')][_0x7721('0x4a')]({'where':{'id':_0x7fbb73[_0x7721('0x47')]['id']}})[_0x7721('0x29')](handleEntityNotFound(_0x694d2f,null))[_0x7721('0x29')](removeEntity(_0x694d2f,null))[_0x7721('0x45')](handleError(_0x694d2f,null));};exports['describe']=function(_0x474f32,_0x2f6f30){return db[_0x7721('0x30')][_0x7721('0x4d')]()[_0x7721('0x29')](respondWithResult(_0x2f6f30,null))[_0x7721('0x45')](handleError(_0x2f6f30,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(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xedd9,0xfc));var _0x9edd=function(_0x3d3ac8,_0x245da3){_0x3d3ac8=_0x3d3ac8-0x0;var _0x1acb4a=_0xedd9[_0x3d3ac8];return _0x1acb4a;};'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 78041bd..facd394 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 _0x2f15=['membername','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','membername_interface'];(function(_0x11bcb5,_0x52c4b3){var _0x10d12e=function(_0x50022e){while(--_0x50022e){_0x11bcb5['push'](_0x11bcb5['shift']());}};_0x10d12e(++_0x52c4b3);}(_0x2f15,0x6f));var _0x52f1=function(_0x11dbbe,_0x7b04d3){_0x11dbbe=_0x11dbbe-0x0;var _0x475061=_0x2f15[_0x11dbbe];return _0x475061;};'use strict';var _=require('lodash');var util=require(_0x52f1('0x0'));var logger=require('../../config/logger')(_0x52f1('0x1'));var moment=require(_0x52f1('0x2'));var BPromise=require(_0x52f1('0x3'));var rp=require(_0x52f1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x52f1('0x5'));var config=require(_0x52f1('0x6'));var attributes=require('./memberReport.attributes');module[_0x52f1('0x7')]=function(_0x218476,_0x405430){return _0x218476['define']('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x52f1('0x8'),'fields':[_0x52f1('0x9'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb209=['interface','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./memberReport.attributes','define','MemberReport','membername_interface','membername'];(function(_0x365892,_0x1e283b){var _0x15b70a=function(_0x242ef0){while(--_0x242ef0){_0x365892['push'](_0x365892['shift']());}};_0x15b70a(++_0x1e283b);}(_0xb209,0x151));var _0x9b20=function(_0x422ee9,_0x5b7f52){_0x422ee9=_0x422ee9-0x0;var _0x3014d0=_0xb209[_0x422ee9];return _0x3014d0;};'use strict';var _=require(_0x9b20('0x0'));var util=require(_0x9b20('0x1'));var logger=require(_0x9b20('0x2'))(_0x9b20('0x3'));var moment=require(_0x9b20('0x4'));var BPromise=require(_0x9b20('0x5'));var rp=require(_0x9b20('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b20('0x7'));var config=require('../../config/environment');var attributes=require(_0x9b20('0x8'));module['exports']=function(_0x4dcce3,_0x2c0c76){return _0x4dcce3[_0x9b20('0x9')](_0x9b20('0xa'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x9b20('0xb'),'fields':[_0x9b20('0xc'),_0x9b20('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index f61e824..6050215 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 _0x5d17=['include','model','then','CreateMemberReport','MemberReport','create','body','update','attributes','UpdateMemberReport','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message','request\x20sent','result','catch','GetMemberReport','findAll','options','raw','where','map'];(function(_0x243301,_0x3ee94a){var _0x374787=function(_0x22e345){while(--_0x22e345){_0x243301['push'](_0x243301['shift']());}};_0x374787(++_0x3ee94a);}(_0x5d17,0x114));var _0x75d1=function(_0x5200c4,_0x4d59a6){_0x5200c4=_0x5200c4-0x0;var _0x36cb24=_0x5d17[_0x5200c4];return _0x36cb24;};'use strict';var _=require(_0x75d1('0x0'));var util=require(_0x75d1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x75d1('0x2'));var fs=require('fs');var Redis=require(_0x75d1('0x3'));var db=require(_0x75d1('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x75d1('0x5'))(_0x75d1('0x6'));var config=require(_0x75d1('0x7'));var jayson=require(_0x75d1('0x8'));var client=jayson['client'][_0x75d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x116a51,_0x5c957a,_0x1ee61b){return new BPromise(function(_0x3a9d5e,_0x105607){return client[_0x75d1('0xa')](_0x116a51,_0x1ee61b)['then'](function(_0x4cf632){logger[_0x75d1('0xb')]('MemberReport,\x20%s,\x20%s',_0x5c957a,'request\x20sent');logger[_0x75d1('0xc')](_0x75d1('0xd'),_0x5c957a,'request\x20sent',JSON[_0x75d1('0xe')](_0x4cf632));if(_0x4cf632[_0x75d1('0xf')]){if(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x10')]===0x1f4){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x4cf632['error'][_0x75d1('0x12')]);return _0x105607(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}logger[_0x75d1('0xf')]('MemberReport,\x20%s,\x20%s',_0x5c957a,_0x4cf632['error']['message']);return _0x3a9d5e(_0x4cf632[_0x75d1('0xf')][_0x75d1('0x12')]);}else{logger[_0x75d1('0xb')]('MemberReport,\x20%s,\x20%s',_0x5c957a,_0x75d1('0x13'));_0x3a9d5e(_0x4cf632[_0x75d1('0x14')][_0x75d1('0x12')]);}})[_0x75d1('0x15')](function(_0x1160ca){logger[_0x75d1('0xf')](_0x75d1('0x11'),_0x5c957a,_0x1160ca);_0x105607(_0x1160ca);});});}exports[_0x75d1('0x16')]=function(_0x1bc5de){var _0x3d0717=this;return new Promise(function(_0x2c2a6d,_0x5761db){return db['MemberReport'][_0x75d1('0x17')]({'raw':_0x1bc5de[_0x75d1('0x18')]?_0x1bc5de['options'][_0x75d1('0x19')]===undefined?!![]:![]:!![],'where':_0x1bc5de[_0x75d1('0x18')]?_0x1bc5de[_0x75d1('0x18')][_0x75d1('0x1a')]||null:null,'attributes':_0x1bc5de[_0x75d1('0x18')]?_0x1bc5de[_0x75d1('0x18')]['attributes']||null:null,'limit':_0x1bc5de[_0x75d1('0x18')]?_0x1bc5de[_0x75d1('0x18')]['limit']||null:null,'include':_0x1bc5de[_0x75d1('0x18')]?_0x1bc5de[_0x75d1('0x18')]['include']?_[_0x75d1('0x1b')](_0x1bc5de['options'][_0x75d1('0x1c')],function(_0xc256af){return{'model':db[_0xc256af[_0x75d1('0x1d')]],'as':_0xc256af['as'],'attributes':_0xc256af['attributes'],'include':_0xc256af['include']?_[_0x75d1('0x1b')](_0xc256af[_0x75d1('0x1c')],function(_0x315ce5){return{'model':db[_0x315ce5[_0x75d1('0x1d')]],'as':_0x315ce5['as'],'attributes':_0x315ce5['attributes'],'include':_0x315ce5[_0x75d1('0x1c')]?_[_0x75d1('0x1b')](_0x315ce5[_0x75d1('0x1c')],function(_0x51138e){return{'model':db[_0x51138e['model']],'as':_0x51138e['as'],'attributes':_0x51138e['attributes']};}):[]};}):[]};}):[]:[]})[_0x75d1('0x1e')](function(_0x30d9f3){logger[_0x75d1('0xb')](_0x75d1('0x16'),_0x1bc5de);logger[_0x75d1('0xc')]('GetMemberReport',_0x1bc5de,JSON['stringify'](_0x30d9f3));_0x2c2a6d(_0x30d9f3);})[_0x75d1('0x15')](function(_0x197f52){logger['error'](_0x75d1('0x16'),_0x197f52['message'],_0x1bc5de);_0x5761db(_0x3d0717[_0x75d1('0xf')](0x1f4,_0x197f52[_0x75d1('0x12')]));});});};exports[_0x75d1('0x1f')]=function(_0x3fb7b9){var _0x36ae86=this;return new Promise(function(_0x506b93,_0x352a4f){return db[_0x75d1('0x20')][_0x75d1('0x21')](_0x3fb7b9[_0x75d1('0x22')],{'raw':_0x3fb7b9['options']?_0x3fb7b9[_0x75d1('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x75d1('0x1e')](function(_0x31e072){logger['info'](_0x75d1('0x1f'),_0x3fb7b9);logger[_0x75d1('0xc')](_0x75d1('0x1f'),_0x3fb7b9,JSON[_0x75d1('0xe')](_0x31e072));_0x506b93(_0x31e072);})[_0x75d1('0x15')](function(_0x495aa4){logger[_0x75d1('0xf')](_0x75d1('0x1f'),_0x495aa4[_0x75d1('0x12')],_0x3fb7b9);_0x352a4f(_0x36ae86[_0x75d1('0xf')](0x1f4,_0x495aa4['message']));});});};exports['UpdateMemberReport']=function(_0x551723){var _0x3d9275=this;return new Promise(function(_0x29ad6b,_0x40dc07){return db[_0x75d1('0x20')][_0x75d1('0x23')](_0x551723[_0x75d1('0x22')],{'raw':_0x551723[_0x75d1('0x18')]?_0x551723[_0x75d1('0x18')][_0x75d1('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551723['options']?_0x551723[_0x75d1('0x18')][_0x75d1('0x1a')]||null:null,'attributes':_0x551723[_0x75d1('0x18')]?_0x551723[_0x75d1('0x18')][_0x75d1('0x24')]||null:null,'limit':_0x551723['options']?_0x551723['options']['limit']||null:null})[_0x75d1('0x1e')](function(_0x17c0f6){logger[_0x75d1('0xb')](_0x75d1('0x25'),_0x551723);logger[_0x75d1('0xc')](_0x75d1('0x25'),_0x551723,JSON['stringify'](_0x17c0f6));_0x29ad6b(_0x17c0f6);})['catch'](function(_0x5efaea){logger[_0x75d1('0xf')]('UpdateMemberReport',_0x5efaea['message'],_0x551723);_0x40dc07(_0x3d9275[_0x75d1('0xf')](0x1f4,_0x5efaea[_0x75d1('0x12')]));});});}; \ No newline at end of file +var _0x9134=['debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetMemberReport','MemberReport','findAll','options','where','attributes','limit','include','model','map','CreateMemberReport','create','body','raw','update','UpdateMemberReport','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MemberReport,\x20%s,\x20%s'];(function(_0x343559,_0x1a1909){var _0x238ad5=function(_0x46223c){while(--_0x46223c){_0x343559['push'](_0x343559['shift']());}};_0x238ad5(++_0x1a1909);}(_0x9134,0x87));var _0x4913=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9134[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4913('0x0'));var moment=require(_0x4913('0x1'));var BPromise=require(_0x4913('0x2'));var rs=require(_0x4913('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4913('0x4'));var logger=require(_0x4913('0x5'))(_0x4913('0x6'));var config=require(_0x4913('0x7'));var jayson=require(_0x4913('0x8'));var client=jayson[_0x4913('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46e307,_0x177977,_0x16ab4f){return new BPromise(function(_0x5b3acd,_0x2bc829){return client[_0x4913('0xa')](_0x46e307,_0x16ab4f)['then'](function(_0x536f95){logger[_0x4913('0xb')](_0x4913('0xc'),_0x177977,'request\x20sent');logger[_0x4913('0xd')](_0x4913('0xe'),_0x177977,_0x4913('0xf'),JSON[_0x4913('0x10')](_0x536f95));if(_0x536f95[_0x4913('0x11')]){if(_0x536f95['error'][_0x4913('0x12')]===0x1f4){logger['error'](_0x4913('0xc'),_0x177977,_0x536f95['error'][_0x4913('0x13')]);return _0x2bc829(_0x536f95[_0x4913('0x11')][_0x4913('0x13')]);}logger['error'](_0x4913('0xc'),_0x177977,_0x536f95[_0x4913('0x11')]['message']);return _0x5b3acd(_0x536f95['error'][_0x4913('0x13')]);}else{logger[_0x4913('0xb')](_0x4913('0xc'),_0x177977,_0x4913('0xf'));_0x5b3acd(_0x536f95['result'][_0x4913('0x13')]);}})[_0x4913('0x14')](function(_0x59615c){logger[_0x4913('0x11')]('MemberReport,\x20%s,\x20%s',_0x177977,_0x59615c);_0x2bc829(_0x59615c);});});}exports[_0x4913('0x15')]=function(_0x398f2f){var _0x4b07d5=this;return new Promise(function(_0x366045,_0x589f35){return db[_0x4913('0x16')][_0x4913('0x17')]({'raw':_0x398f2f[_0x4913('0x18')]?_0x398f2f['options']['raw']===undefined?!![]:![]:!![],'where':_0x398f2f[_0x4913('0x18')]?_0x398f2f['options'][_0x4913('0x19')]||null:null,'attributes':_0x398f2f[_0x4913('0x18')]?_0x398f2f['options'][_0x4913('0x1a')]||null:null,'limit':_0x398f2f[_0x4913('0x18')]?_0x398f2f[_0x4913('0x18')][_0x4913('0x1b')]||null:null,'include':_0x398f2f[_0x4913('0x18')]?_0x398f2f[_0x4913('0x18')][_0x4913('0x1c')]?_['map'](_0x398f2f[_0x4913('0x18')]['include'],function(_0x3d450f){return{'model':db[_0x3d450f[_0x4913('0x1d')]],'as':_0x3d450f['as'],'attributes':_0x3d450f[_0x4913('0x1a')],'include':_0x3d450f[_0x4913('0x1c')]?_[_0x4913('0x1e')](_0x3d450f[_0x4913('0x1c')],function(_0x8f40a9){return{'model':db[_0x8f40a9[_0x4913('0x1d')]],'as':_0x8f40a9['as'],'attributes':_0x8f40a9[_0x4913('0x1a')],'include':_0x8f40a9[_0x4913('0x1c')]?_[_0x4913('0x1e')](_0x8f40a9[_0x4913('0x1c')],function(_0x5afb75){return{'model':db[_0x5afb75[_0x4913('0x1d')]],'as':_0x5afb75['as'],'attributes':_0x5afb75[_0x4913('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13b7cd){logger[_0x4913('0xb')]('GetMemberReport',_0x398f2f);logger['debug'](_0x4913('0x15'),_0x398f2f,JSON[_0x4913('0x10')](_0x13b7cd));_0x366045(_0x13b7cd);})[_0x4913('0x14')](function(_0x4c68bf){logger[_0x4913('0x11')](_0x4913('0x15'),_0x4c68bf[_0x4913('0x13')],_0x398f2f);_0x589f35(_0x4b07d5[_0x4913('0x11')](0x1f4,_0x4c68bf[_0x4913('0x13')]));});});};exports[_0x4913('0x1f')]=function(_0x465533){var _0x34df3d=this;return new Promise(function(_0x434dad,_0x1f91c4){return db[_0x4913('0x16')][_0x4913('0x20')](_0x465533[_0x4913('0x21')],{'raw':_0x465533[_0x4913('0x18')]?_0x465533['options'][_0x4913('0x22')]===undefined?!![]:![]:!![]})['then'](function(_0x4fadff){logger[_0x4913('0xb')](_0x4913('0x1f'),_0x465533);logger[_0x4913('0xd')](_0x4913('0x1f'),_0x465533,JSON[_0x4913('0x10')](_0x4fadff));_0x434dad(_0x4fadff);})[_0x4913('0x14')](function(_0x2372e9){logger[_0x4913('0x11')](_0x4913('0x1f'),_0x2372e9[_0x4913('0x13')],_0x465533);_0x1f91c4(_0x34df3d['error'](0x1f4,_0x2372e9[_0x4913('0x13')]));});});};exports['UpdateMemberReport']=function(_0x33f19e){var _0x7e86ba=this;return new Promise(function(_0x505335,_0x275abf){return db[_0x4913('0x16')][_0x4913('0x23')](_0x33f19e[_0x4913('0x21')],{'raw':_0x33f19e['options']?_0x33f19e[_0x4913('0x18')][_0x4913('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x33f19e['options']?_0x33f19e[_0x4913('0x18')]['where']||null:null,'attributes':_0x33f19e[_0x4913('0x18')]?_0x33f19e['options']['attributes']||null:null,'limit':_0x33f19e['options']?_0x33f19e[_0x4913('0x18')][_0x4913('0x1b')]||null:null})['then'](function(_0x83bce9){logger['info'](_0x4913('0x24'),_0x33f19e);logger[_0x4913('0xd')](_0x4913('0x24'),_0x33f19e,JSON[_0x4913('0x10')](_0x83bce9));_0x505335(_0x83bce9);})[_0x4913('0x14')](function(_0x328815){logger[_0x4913('0x11')](_0x4913('0x24'),_0x328815[_0x4913('0x13')],_0x33f19e);_0x275abf(_0x7e86ba[_0x4913('0x11')](0x1f4,_0x328815[_0x4913('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 39fa536..0d77db8 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 _0x18af=['./migration.controller','get','exports','multer','path','express','../../components/interaction/service','../../config/environment'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x18af,0x8b));var _0xf18a=function(_0x50c073,_0xd5edc2){_0x50c073=_0x50c073-0x0;var _0x1904c8=_0x18af[_0x50c073];return _0x1904c8;};'use strict';var multer=require(_0xf18a('0x0'));var util=require('util');var path=require(_0xf18a('0x1'));var timeout=require('connect-timeout');var express=require(_0xf18a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xf18a('0x3'));var config=require(_0xf18a('0x4'));var controller=require(_0xf18a('0x5'));router[_0xf18a('0x6')]('/',controller['index']);module[_0xf18a('0x7')]=router; \ No newline at end of file +var _0x2ad6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','exports','multer'];(function(_0x2ee48b,_0x4ee47d){var _0x5a3f3c=function(_0x4ba26b){while(--_0x4ba26b){_0x2ee48b['push'](_0x2ee48b['shift']());}};_0x5a3f3c(++_0x4ee47d);}(_0x2ad6,0x1a1));var _0x62ad=function(_0x1c7a93,_0x11acf2){_0x1c7a93=_0x1c7a93-0x0;var _0x41edb3=_0x2ad6[_0x1c7a93];return _0x41edb3;};'use strict';var multer=require(_0x62ad('0x0'));var util=require('util');var path=require(_0x62ad('0x1'));var timeout=require(_0x62ad('0x2'));var express=require(_0x62ad('0x3'));var router=express[_0x62ad('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62ad('0x5'));var interaction=require(_0x62ad('0x6'));var config=require(_0x62ad('0x7'));var controller=require(_0x62ad('0x8'));router[_0x62ad('0x9')]('/',controller['index']);module[_0x62ad('0xa')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 154a10d..0ecd5f3 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 _0x5cd0=['sequelize','STRING','version'];(function(_0x346a39,_0x2d7ae3){var _0x5d0386=function(_0x4a9bcd){while(--_0x4a9bcd){_0x346a39['push'](_0x346a39['shift']());}};_0x5d0386(++_0x2d7ae3);}(_0x5cd0,0x114));var _0x05cd=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5cd0[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require(_0x05cd('0x0'));module['exports']={'version':{'type':Sequelize[_0x05cd('0x1')],'unique':_0x05cd('0x2')}}; \ No newline at end of file +var _0xfa7f=['sequelize','exports','version'];(function(_0x615573,_0x3adbc4){var _0xb28365=function(_0x4619db){while(--_0x4619db){_0x615573['push'](_0x615573['shift']());}};_0xb28365(++_0x3adbc4);}(_0xfa7f,0xed));var _0xffa7=function(_0x3a69bf,_0x174c3d){_0x3a69bf=_0x3a69bf-0x0;var _0x253ab5=_0xfa7f[_0x3a69bf];return _0x253ab5;};'use strict';var Sequelize=require(_0xffa7('0x0'));module[_0xffa7('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0xffa7('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 7f44af8..0e6c659 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 _0x135c=['request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','Content-Range','json','reject','then','destroy','error','name','send','map','Migration','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','includeAll','rows','catch','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4ea382,_0x1a6f2b){var _0x229f69=function(_0x2d0186){while(--_0x2d0186){_0x4ea382['push'](_0x4ea382['shift']());}};_0x229f69(++_0x1a6f2b);}(_0x135c,0x199));var _0xc135=function(_0x826429,_0x44cef8){_0x826429=_0x826429-0x0;var _0x4016a0=_0x135c[_0x826429];return _0x4016a0;};'use strict';var emlformat=require(_0xc135('0x0'));var rimraf=require(_0xc135('0x1'));var zipdir=require(_0xc135('0x2'));var jsonpatch=require(_0xc135('0x3'));var rp=require(_0xc135('0x4'));var moment=require(_0xc135('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc135('0x6'));var util=require(_0xc135('0x7'));var path=require(_0xc135('0x8'));var sox=require(_0xc135('0x9'));var csv=require(_0xc135('0xa'));var ejs=require(_0xc135('0xb'));var fs=require('fs');var fs_extra=require(_0xc135('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc135('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc135('0xa'));var querystring=require('querystring');var Papa=require(_0xc135('0xe'));var Redis=require(_0xc135('0xf'));var authService=require(_0xc135('0x10'));var qs=require(_0xc135('0x11'));var as=require(_0xc135('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc135('0x13'))(_0xc135('0x14'));var utils=require(_0xc135('0x15'));var config=require(_0xc135('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc135('0x17'))['db'];function respondWithStatusCode(_0x1be9a9,_0x1e67fd){_0x1e67fd=_0x1e67fd||0xcc;return function(_0x13583d){if(_0x13583d){return _0x1be9a9['sendStatus'](_0x1e67fd);}return _0x1be9a9[_0xc135('0x18')](_0x1e67fd)[_0xc135('0x19')]();};}function respondWithResult(_0x112868,_0x306d78){_0x306d78=_0x306d78||0xc8;return function(_0x1a0940){if(_0x1a0940){return _0x112868[_0xc135('0x18')](_0x306d78)['json'](_0x1a0940);}};}function respondWithFilteredResult(_0x244791,_0x557ec6){return function(_0x2ecd2c){if(_0x2ecd2c){var _0x2caad3=typeof _0x557ec6[_0xc135('0x1a')]==='undefined'&&typeof _0x557ec6[_0xc135('0x1b')]===_0xc135('0x1c');var _0x1d3f8f=_0x2ecd2c[_0xc135('0x1d')];var _0x350955=_0x2caad3?0x0:_0x557ec6[_0xc135('0x1a')];var _0x474be1=_0x2caad3?_0x2ecd2c[_0xc135('0x1d')]:_0x557ec6[_0xc135('0x1a')]+_0x557ec6['limit'];var _0x467c69;if(_0x474be1>=_0x1d3f8f){_0x474be1=_0x1d3f8f;_0x467c69=0xc8;}else{_0x467c69=0xce;}_0x244791[_0xc135('0x18')](_0x467c69);return _0x244791['set'](_0xc135('0x1e'),_0x350955+'-'+_0x474be1+'/'+_0x1d3f8f)[_0xc135('0x1f')](_0x2ecd2c);}return null;};}function patchUpdates(_0x56210d){return function(_0x17f8b3){try{jsonpatch['apply'](_0x17f8b3,_0x56210d,!![]);}catch(_0xc09954){return BPromise[_0xc135('0x20')](_0xc09954);}return _0x17f8b3['save']();};}function saveUpdates(_0x279ed8,_0x5b305f){return function(_0x34d047){if(_0x34d047){return _0x34d047['update'](_0x279ed8)[_0xc135('0x21')](function(_0x15a5fa){return _0x15a5fa;});}return null;};}function removeEntity(_0x9ffc2b,_0x1cadef){return function(_0x52a5a6){if(_0x52a5a6){return _0x52a5a6[_0xc135('0x22')]()[_0xc135('0x21')](function(){_0x9ffc2b['status'](0xcc)[_0xc135('0x19')]();});}};}function handleEntityNotFound(_0x363088,_0x9dbecb){return function(_0x3c336d){if(!_0x3c336d){_0x363088['sendStatus'](0x194);}return _0x3c336d;};}function handleError(_0x4ff8bf,_0x58f0a2){_0x58f0a2=_0x58f0a2||0x1f4;return function(_0x294dcc){logger[_0xc135('0x23')](_0x294dcc['stack']);if(_0x294dcc[_0xc135('0x24')]){delete _0x294dcc[_0xc135('0x24')];}_0x4ff8bf[_0xc135('0x18')](_0x58f0a2)[_0xc135('0x25')](_0x294dcc);};}exports['index']=function(_0x100edc,_0x204b14){var _0x341349={},_0x1a9372={},_0x82e36f={'count':0x0,'rows':[]};var _0x4e1e93=_[_0xc135('0x26')](db[_0xc135('0x27')]['rawAttributes'],function(_0x4bbe4b){return{'name':_0x4bbe4b[_0xc135('0x28')],'type':_0x4bbe4b[_0xc135('0x29')][_0xc135('0x2a')]};});_0x1a9372[_0xc135('0x2b')]=_['map'](_0x4e1e93,_0xc135('0x24'));_0x1a9372[_0xc135('0x2c')]=_['keys'](_0x100edc[_0xc135('0x2c')]);_0x1a9372[_0xc135('0x2d')]=_['intersection'](_0x1a9372[_0xc135('0x2b')],_0x1a9372[_0xc135('0x2c')]);_0x341349[_0xc135('0x2e')]=_['intersection'](_0x1a9372[_0xc135('0x2b')],qs['fields'](_0x100edc[_0xc135('0x2c')][_0xc135('0x2f')]));_0x341349[_0xc135('0x2e')]=_0x341349[_0xc135('0x2e')][_0xc135('0x30')]?_0x341349[_0xc135('0x2e')]:_0x1a9372[_0xc135('0x2b')];if(!_0x100edc[_0xc135('0x2c')][_0xc135('0x31')](_0xc135('0x32'))){_0x341349[_0xc135('0x1b')]=qs[_0xc135('0x1b')](_0x100edc[_0xc135('0x2c')]['limit']);_0x341349[_0xc135('0x1a')]=qs[_0xc135('0x1a')](_0x100edc[_0xc135('0x2c')][_0xc135('0x1a')]);}_0x341349[_0xc135('0x33')]=qs[_0xc135('0x34')](_0x100edc['query'][_0xc135('0x34')]);_0x341349[_0xc135('0x35')]=qs[_0xc135('0x2d')](_['pick'](_0x100edc[_0xc135('0x2c')],_0x1a9372['filters']),_0x4e1e93);if(_0x100edc[_0xc135('0x2c')]['filter']){_0x341349['where']=_[_0xc135('0x36')](_0x341349[_0xc135('0x35')],{'$or':_[_0xc135('0x26')](_0x4e1e93,function(_0xcf5582){if(_0xcf5582['type']!=='VIRTUAL'){var _0x1982e6={};_0x1982e6[_0xcf5582[_0xc135('0x24')]]={'$like':'%'+_0x100edc[_0xc135('0x2c')][_0xc135('0x37')]+'%'};return _0x1982e6;}})});}_0x341349=_[_0xc135('0x36')]({},_0x341349,_0x100edc['options']);var _0xf9efa={'where':_0x341349[_0xc135('0x35')]};return db['Migration'][_0xc135('0x1d')](_0xf9efa)[_0xc135('0x21')](function(_0xf6bafa){_0x82e36f[_0xc135('0x1d')]=_0xf6bafa;if(_0x100edc[_0xc135('0x2c')][_0xc135('0x38')]){_0x341349['include']=[{'all':!![]}];}return db[_0xc135('0x27')]['findAll'](_0x341349);})[_0xc135('0x21')](function(_0xb9ec6){_0x82e36f[_0xc135('0x39')]=_0xb9ec6;return _0x82e36f;})[_0xc135('0x21')](respondWithFilteredResult(_0x204b14,_0x341349))[_0xc135('0x3a')](handleError(_0x204b14,null));}; \ No newline at end of file +var _0xff8d=['../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','stack','index','map','Migration','fieldName','type','key','model','name','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','includeAll','findAll','rows','catch','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','fs-extra','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x4aabec,_0xf02f7e){var _0xc4ea3=function(_0x352942){while(--_0x352942){_0x4aabec['push'](_0x4aabec['shift']());}};_0xc4ea3(++_0xf02f7e);}(_0xff8d,0xdf));var _0xdff8=function(_0x10568b,_0x1de89b){_0x10568b=_0x10568b-0x0;var _0x2d1561=_0xff8d[_0x10568b];return _0x2d1561;};'use strict';var emlformat=require(_0xdff8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdff8('0x1'));var jsonpatch=require(_0xdff8('0x2'));var rp=require(_0xdff8('0x3'));var moment=require(_0xdff8('0x4'));var BPromise=require(_0xdff8('0x5'));var Mustache=require('mustache');var util=require(_0xdff8('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xdff8('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdff8('0x8'));var _=require('lodash');var squel=require(_0xdff8('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdff8('0xa'));var toCsv=require(_0xdff8('0x7'));var querystring=require(_0xdff8('0xb'));var Papa=require(_0xdff8('0xc'));var Redis=require(_0xdff8('0xd'));var authService=require(_0xdff8('0xe'));var qs=require(_0xdff8('0xf'));var as=require(_0xdff8('0x10'));var hardwareService=require(_0xdff8('0x11'));var logger=require('../../config/logger')(_0xdff8('0x12'));var utils=require(_0xdff8('0x13'));var config=require(_0xdff8('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xdff8('0x15'))['db'];function respondWithStatusCode(_0x40429f,_0x5bb656){_0x5bb656=_0x5bb656||0xcc;return function(_0x9fe035){if(_0x9fe035){return _0x40429f[_0xdff8('0x16')](_0x5bb656);}return _0x40429f[_0xdff8('0x17')](_0x5bb656)[_0xdff8('0x18')]();};}function respondWithResult(_0x1cf683,_0x3a09d2){_0x3a09d2=_0x3a09d2||0xc8;return function(_0x2b10ba){if(_0x2b10ba){return _0x1cf683['status'](_0x3a09d2)[_0xdff8('0x19')](_0x2b10ba);}};}function respondWithFilteredResult(_0x4735a4,_0x1801ed){return function(_0x4076cb){if(_0x4076cb){var _0x4b690b=typeof _0x1801ed[_0xdff8('0x1a')]===_0xdff8('0x1b')&&typeof _0x1801ed[_0xdff8('0x1c')]==='undefined';var _0x5deda4=_0x4076cb[_0xdff8('0x1d')];var _0x310a17=_0x4b690b?0x0:_0x1801ed[_0xdff8('0x1a')];var _0x24c91c=_0x4b690b?_0x4076cb[_0xdff8('0x1d')]:_0x1801ed[_0xdff8('0x1a')]+_0x1801ed[_0xdff8('0x1c')];var _0x18e824;if(_0x24c91c>=_0x5deda4){_0x24c91c=_0x5deda4;_0x18e824=0xc8;}else{_0x18e824=0xce;}_0x4735a4['status'](_0x18e824);return _0x4735a4[_0xdff8('0x1e')](_0xdff8('0x1f'),_0x310a17+'-'+_0x24c91c+'/'+_0x5deda4)[_0xdff8('0x19')](_0x4076cb);}return null;};}function patchUpdates(_0x128171){return function(_0x5bea2b){try{jsonpatch[_0xdff8('0x20')](_0x5bea2b,_0x128171,!![]);}catch(_0x29bfe9){return BPromise[_0xdff8('0x21')](_0x29bfe9);}return _0x5bea2b['save']();};}function saveUpdates(_0x5b6261,_0x31ebfc){return function(_0x46d2c7){if(_0x46d2c7){return _0x46d2c7['update'](_0x5b6261)[_0xdff8('0x22')](function(_0x51d5ac){return _0x51d5ac;});}return null;};}function removeEntity(_0x569420,_0x443f09){return function(_0x4691c2){if(_0x4691c2){return _0x4691c2[_0xdff8('0x23')]()[_0xdff8('0x22')](function(){_0x569420[_0xdff8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x112c68,_0x58e0f3){return function(_0x291f46){if(!_0x291f46){_0x112c68['sendStatus'](0x194);}return _0x291f46;};}function handleError(_0x1d9691,_0x27d826){_0x27d826=_0x27d826||0x1f4;return function(_0x5df6c6){logger['error'](_0x5df6c6[_0xdff8('0x24')]);if(_0x5df6c6['name']){delete _0x5df6c6['name'];}_0x1d9691[_0xdff8('0x17')](_0x27d826)['send'](_0x5df6c6);};}exports[_0xdff8('0x25')]=function(_0x26ca01,_0x1c4dbb){var _0xad63ad={},_0x43232d={},_0x2f8ddb={'count':0x0,'rows':[]};var _0x1abd1a=_[_0xdff8('0x26')](db[_0xdff8('0x27')]['rawAttributes'],function(_0x4c3548){return{'name':_0x4c3548[_0xdff8('0x28')],'type':_0x4c3548[_0xdff8('0x29')][_0xdff8('0x2a')]};});_0x43232d[_0xdff8('0x2b')]=_[_0xdff8('0x26')](_0x1abd1a,_0xdff8('0x2c'));_0x43232d[_0xdff8('0x2d')]=_['keys'](_0x26ca01[_0xdff8('0x2d')]);_0x43232d['filters']=_[_0xdff8('0x2e')](_0x43232d[_0xdff8('0x2b')],_0x43232d['query']);_0xad63ad[_0xdff8('0x2f')]=_[_0xdff8('0x2e')](_0x43232d['model'],qs[_0xdff8('0x30')](_0x26ca01[_0xdff8('0x2d')][_0xdff8('0x30')]));_0xad63ad['attributes']=_0xad63ad[_0xdff8('0x2f')]['length']?_0xad63ad[_0xdff8('0x2f')]:_0x43232d[_0xdff8('0x2b')];if(!_0x26ca01[_0xdff8('0x2d')][_0xdff8('0x31')]('nolimit')){_0xad63ad[_0xdff8('0x1c')]=qs['limit'](_0x26ca01['query'][_0xdff8('0x1c')]);_0xad63ad['offset']=qs[_0xdff8('0x1a')](_0x26ca01[_0xdff8('0x2d')]['offset']);}_0xad63ad['order']=qs[_0xdff8('0x32')](_0x26ca01['query'][_0xdff8('0x32')]);_0xad63ad[_0xdff8('0x33')]=qs[_0xdff8('0x34')](_[_0xdff8('0x35')](_0x26ca01['query'],_0x43232d[_0xdff8('0x34')]),_0x1abd1a);if(_0x26ca01[_0xdff8('0x2d')][_0xdff8('0x36')]){_0xad63ad['where']=_[_0xdff8('0x37')](_0xad63ad[_0xdff8('0x33')],{'$or':_['map'](_0x1abd1a,function(_0x47750e){if(_0x47750e[_0xdff8('0x29')]!=='VIRTUAL'){var _0xc3f52a={};_0xc3f52a[_0x47750e['name']]={'$like':'%'+_0x26ca01[_0xdff8('0x2d')][_0xdff8('0x36')]+'%'};return _0xc3f52a;}})});}_0xad63ad=_[_0xdff8('0x37')]({},_0xad63ad,_0x26ca01['options']);var _0x411a45={'where':_0xad63ad['where']};return db[_0xdff8('0x27')][_0xdff8('0x1d')](_0x411a45)[_0xdff8('0x22')](function(_0x1afcbe){_0x2f8ddb[_0xdff8('0x1d')]=_0x1afcbe;if(_0x26ca01[_0xdff8('0x2d')][_0xdff8('0x38')]){_0xad63ad['include']=[{'all':!![]}];}return db[_0xdff8('0x27')][_0xdff8('0x39')](_0xad63ad);})['then'](function(_0x1887f2){_0x2f8ddb[_0xdff8('0x3a')]=_0x1887f2;return _0x2f8ddb;})[_0xdff8('0x22')](respondWithFilteredResult(_0x1c4dbb,_0xad63ad))[_0xdff8('0x3b')](handleError(_0x1c4dbb,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 775b7c9..5b63358 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 _0xebe5=['api','moment','request-promise','../../config/environment','./migration.attributes','define','Migration','util','../../config/logger'];(function(_0x27530d,_0x46480a){var _0x59e561=function(_0x395fe9){while(--_0x395fe9){_0x27530d['push'](_0x27530d['shift']());}};_0x59e561(++_0x46480a);}(_0xebe5,0x11e));var _0x5ebe=function(_0x198e65,_0x3bb702){_0x198e65=_0x198e65-0x0;var _0x415e78=_0xebe5[_0x198e65];return _0x415e78;};'use strict';var _=require('lodash');var util=require(_0x5ebe('0x0'));var logger=require(_0x5ebe('0x1'))(_0x5ebe('0x2'));var moment=require(_0x5ebe('0x3'));var BPromise=require('bluebird');var rp=require(_0x5ebe('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ebe('0x5'));var attributes=require(_0x5ebe('0x6'));module['exports']=function(_0x30db12,_0x2ad919){return _0x30db12[_0x5ebe('0x7')](_0x5ebe('0x8'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1556=['util','api','moment','bluebird','request-promise','rimraf','Migration','migrations','lodash'];(function(_0x3d35f3,_0x22fe84){var _0x57d587=function(_0x3d1790){while(--_0x3d1790){_0x3d35f3['push'](_0x3d35f3['shift']());}};_0x57d587(++_0x22fe84);}(_0x1556,0x143));var _0x6155=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1556[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x6155('0x0'));var util=require(_0x6155('0x1'));var logger=require('../../config/logger')(_0x6155('0x2'));var moment=require(_0x6155('0x3'));var BPromise=require(_0x6155('0x4'));var rp=require(_0x6155('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6155('0x6'));var config=require('../../config/environment');var attributes=require('./migration.attributes');module['exports']=function(_0x40ea5a,_0x28d3da){return _0x40ea5a['define'](_0x6155('0x7'),attributes,{'tableName':_0x6155('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 7c930c5..a4c6afc 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 _0xc577=['http','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x262aa3,_0x82fbd0){var _0x24ee46=function(_0x789ffb){while(--_0x789ffb){_0x262aa3['push'](_0x262aa3['shift']());}};_0x24ee46(++_0x82fbd0);}(_0xc577,0x172));var _0x7c57=function(_0x2ff38f,_0xefceba){_0x2ff38f=_0x2ff38f-0x0;var _0x19a75f=_0xc577[_0x2ff38f];return _0x19a75f;};'use strict';var _=require(_0x7c57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7c57('0x1'));var rs=require(_0x7c57('0x2'));var fs=require('fs');var Redis=require(_0x7c57('0x3'));var db=require(_0x7c57('0x4'))['db'];var utils=require(_0x7c57('0x5'));var logger=require(_0x7c57('0x6'))(_0x7c57('0x7'));var config=require('../../config/environment');var jayson=require(_0x7c57('0x8'));var client=jayson[_0x7c57('0x9')][_0x7c57('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bc454,_0x2f2c8f,_0x4bb81b){return new BPromise(function(_0x4e5cb2,_0x5c7ffb){return client[_0x7c57('0xb')](_0x2bc454,_0x4bb81b)['then'](function(_0x3ea732){logger[_0x7c57('0xc')](_0x7c57('0xd'),_0x2f2c8f,_0x7c57('0xe'));logger['debug'](_0x7c57('0xf'),_0x2f2c8f,_0x7c57('0xe'),JSON['stringify'](_0x3ea732));if(_0x3ea732[_0x7c57('0x10')]){if(_0x3ea732[_0x7c57('0x10')][_0x7c57('0x11')]===0x1f4){logger[_0x7c57('0x10')](_0x7c57('0xd'),_0x2f2c8f,_0x3ea732[_0x7c57('0x10')][_0x7c57('0x12')]);return _0x5c7ffb(_0x3ea732['error']['message']);}logger['error'](_0x7c57('0xd'),_0x2f2c8f,_0x3ea732[_0x7c57('0x10')][_0x7c57('0x12')]);return _0x4e5cb2(_0x3ea732[_0x7c57('0x10')][_0x7c57('0x12')]);}else{logger[_0x7c57('0xc')](_0x7c57('0xd'),_0x2f2c8f,_0x7c57('0xe'));_0x4e5cb2(_0x3ea732['result']['message']);}})[_0x7c57('0x13')](function(_0x2975f0){logger[_0x7c57('0x10')](_0x7c57('0xd'),_0x2f2c8f,_0x2975f0);_0x5c7ffb(_0x2975f0);});});} \ No newline at end of file +var _0xcaa3=['Migration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x10faaf,_0x4c4fbb){var _0x3c08c3=function(_0x22747a){while(--_0x22747a){_0x10faaf['push'](_0x10faaf['shift']());}};_0x3c08c3(++_0x4c4fbb);}(_0xcaa3,0xcb));var _0x3caa=function(_0x22bdd3,_0x552e50){_0x22bdd3=_0x22bdd3-0x0;var _0x44d9d9=_0xcaa3[_0x22bdd3];return _0x44d9d9;};'use strict';var _=require(_0x3caa('0x0'));var util=require(_0x3caa('0x1'));var moment=require(_0x3caa('0x2'));var BPromise=require(_0x3caa('0x3'));var rs=require(_0x3caa('0x4'));var fs=require('fs');var Redis=require(_0x3caa('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3caa('0x6'))(_0x3caa('0x7'));var config=require(_0x3caa('0x8'));var jayson=require(_0x3caa('0x9'));var client=jayson[_0x3caa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b2a1a,_0x4450cb,_0x45c12f){return new BPromise(function(_0x4c7b84,_0x1f1661){return client[_0x3caa('0xb')](_0x3b2a1a,_0x45c12f)[_0x3caa('0xc')](function(_0x1a8ee8){logger[_0x3caa('0xd')](_0x3caa('0xe'),_0x4450cb,_0x3caa('0xf'));logger[_0x3caa('0x10')](_0x3caa('0x11'),_0x4450cb,_0x3caa('0xf'),JSON[_0x3caa('0x12')](_0x1a8ee8));if(_0x1a8ee8[_0x3caa('0x13')]){if(_0x1a8ee8['error']['code']===0x1f4){logger[_0x3caa('0x13')](_0x3caa('0xe'),_0x4450cb,_0x1a8ee8['error'][_0x3caa('0x14')]);return _0x1f1661(_0x1a8ee8['error'][_0x3caa('0x14')]);}logger['error'](_0x3caa('0xe'),_0x4450cb,_0x1a8ee8[_0x3caa('0x13')][_0x3caa('0x14')]);return _0x4c7b84(_0x1a8ee8['error'][_0x3caa('0x14')]);}else{logger['info'](_0x3caa('0xe'),_0x4450cb,_0x3caa('0xf'));_0x4c7b84(_0x1a8ee8['result'][_0x3caa('0x14')]);}})[_0x3caa('0x15')](function(_0xd728d2){logger['error'](_0x3caa('0xe'),_0x4450cb,_0xd728d2);_0x1f1661(_0xd728d2);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 9a1e371..be59bcd 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 _0xea7e=['delete','destroy','exports','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x6330a4,_0x31ce3f){var _0x3a9b65=function(_0x5cb8d1){while(--_0x5cb8d1){_0x6330a4['push'](_0x6330a4['shift']());}};_0x3a9b65(++_0x31ce3f);}(_0xea7e,0x143));var _0xeea7=function(_0x254d1a,_0x2ea255){_0x254d1a=_0x254d1a-0x0;var _0x1f3178=_0xea7e[_0x254d1a];return _0x1f3178;};'use strict';var multer=require('multer');var util=require(_0xeea7('0x0'));var path=require(_0xeea7('0x1'));var timeout=require('connect-timeout');var express=require(_0xeea7('0x2'));var router=express[_0xeea7('0x3')]();var fs_extra=require(_0xeea7('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xeea7('0x5'));var config=require(_0xeea7('0x6'));var controller=require(_0xeea7('0x7'));router[_0xeea7('0x8')]('/',auth[_0xeea7('0x9')](),controller[_0xeea7('0xa')]);router[_0xeea7('0x8')](_0xeea7('0xb'),auth[_0xeea7('0x9')](),controller[_0xeea7('0xc')]);router[_0xeea7('0xd')]('/',auth['isAuthenticated'](),controller[_0xeea7('0xe')]);router[_0xeea7('0xf')](_0xeea7('0xb'),auth['isAuthenticated'](),controller[_0xeea7('0x10')]);router[_0xeea7('0x11')]('/:id',auth[_0xeea7('0x9')](),controller[_0xeea7('0x12')]);module[_0xeea7('0x13')]=router; \ No newline at end of file +var _0xfa75=['destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./network.controller','get','isAuthenticated','index','/:id','show','post','create','put','update'];(function(_0x36d209,_0x2e10f1){var _0x19da77=function(_0x8c16fa){while(--_0x8c16fa){_0x36d209['push'](_0x36d209['shift']());}};_0x19da77(++_0x2e10f1);}(_0xfa75,0x1ef));var _0x5fa7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfa75[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x5fa7('0x0'));var util=require(_0x5fa7('0x1'));var path=require(_0x5fa7('0x2'));var timeout=require('connect-timeout');var express=require(_0x5fa7('0x3'));var router=express[_0x5fa7('0x4')]();var fs_extra=require(_0x5fa7('0x5'));var auth=require(_0x5fa7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5fa7('0x7'));var controller=require(_0x5fa7('0x8'));router[_0x5fa7('0x9')]('/',auth[_0x5fa7('0xa')](),controller[_0x5fa7('0xb')]);router['get'](_0x5fa7('0xc'),auth['isAuthenticated'](),controller[_0x5fa7('0xd')]);router[_0x5fa7('0xe')]('/',auth[_0x5fa7('0xa')](),controller[_0x5fa7('0xf')]);router[_0x5fa7('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5fa7('0x11')]);router['delete'](_0x5fa7('0xc'),auth['isAuthenticated'](),controller[_0x5fa7('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index b65e637..2aaaa6a 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 _0x442c=['stun','STRING','sequelize','exports','ENUM','localnet','externip'];(function(_0xef027,_0xc1338d){var _0x8cc999=function(_0xe2e14c){while(--_0xe2e14c){_0xef027['push'](_0xef027['shift']());}};_0x8cc999(++_0xc1338d);}(_0x442c,0xd4));var _0xc442=function(_0x51ef2f,_0x2558b1){_0x51ef2f=_0x51ef2f-0x0;var _0x3fce06=_0x442c[_0x51ef2f];return _0x3fce06;};'use strict';var Sequelize=require(_0xc442('0x0'));module[_0xc442('0x1')]={'type':{'type':Sequelize[_0xc442('0x2')](_0xc442('0x3'),_0xc442('0x4'),_0xc442('0x5'),'turn')},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xc442('0x6')]}}; \ No newline at end of file +var _0x900e=['externip','stun','STRING','sequelize','exports','ENUM','localnet'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x900e,0x1b5));var _0xe900=function(_0x4bd385,_0x3a3e0a){_0x4bd385=_0x4bd385-0x0;var _0x3bbd36=_0x900e[_0x4bd385];return _0x3bbd36;};'use strict';var Sequelize=require(_0xe900('0x0'));module[_0xe900('0x1')]={'type':{'type':Sequelize[_0xe900('0x2')](_0xe900('0x3'),_0xe900('0x4'),_0xe900('0x5'),'turn')},'value':{'type':Sequelize[_0xe900('0x6')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xe900('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index feb71fc..234754d 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 _0x7a5b=['sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','Network','find','transaction','create','toUpperCase','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','Reload','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','body','toLowerCase','chan_sip.so','server/files/templates/turn_multiple.ejs','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','jayson/promise','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order'];(function(_0x3dc894,_0x612562){var _0x15ff52=function(_0x529b62){while(--_0x529b62){_0x3dc894['push'](_0x3dc894['shift']());}};_0x15ff52(++_0x612562);}(_0x7a5b,0x1d7));var _0xb7a5=function(_0x366232,_0x23a6f2){_0x366232=_0x366232-0x0;var _0x2be01d=_0x7a5b[_0x366232];return _0x2be01d;};'use strict';var emlformat=require(_0xb7a5('0x0'));var rimraf=require(_0xb7a5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb7a5('0x2'));var rp=require(_0xb7a5('0x3'));var moment=require(_0xb7a5('0x4'));var BPromise=require(_0xb7a5('0x5'));var Mustache=require('mustache');var util=require(_0xb7a5('0x6'));var path=require(_0xb7a5('0x7'));var sox=require('sox');var csv=require(_0xb7a5('0x8'));var ejs=require(_0xb7a5('0x9'));var fs=require('fs');var fs_extra=require(_0xb7a5('0xa'));var _=require('lodash');var squel=require(_0xb7a5('0xb'));var crypto=require(_0xb7a5('0xc'));var jsforce=require(_0xb7a5('0xd'));var deskjs=require(_0xb7a5('0xe'));var toCsv=require(_0xb7a5('0x8'));var querystring=require(_0xb7a5('0xf'));var Papa=require(_0xb7a5('0x10'));var Redis=require(_0xb7a5('0x11'));var authService=require(_0xb7a5('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7a5('0x13'))('api');var utils=require(_0xb7a5('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xb7a5('0x15'));var client=jayson['client'][_0xb7a5('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x2a0129,_0x2ffe8b,_0x4d6bad,_0x746f12){return new BPromise(function(_0x203651,_0x36437e){var _0x2b6446=_0x746f12||client;return _0x2b6446[_0xb7a5('0x17')](_0x2a0129,_0x4d6bad)[_0xb7a5('0x18')](function(_0x3c435c){logger[_0xb7a5('0x19')](_0xb7a5('0x1a'),_0x2ffe8b,_0xb7a5('0x1b'));logger[_0xb7a5('0x1c')](_0xb7a5('0x1d'),_0x2ffe8b,_0xb7a5('0x1b'),JSON[_0xb7a5('0x1e')](_0x3c435c));if(_0x3c435c[_0xb7a5('0x1f')]){if(_0x3c435c[_0xb7a5('0x1f')][_0xb7a5('0x20')]===0x1f4){logger['error'](_0xb7a5('0x1a'),_0x2ffe8b,_0x3c435c[_0xb7a5('0x1f')][_0xb7a5('0x21')]);return _0x36437e(_0x3c435c[_0xb7a5('0x1f')][_0xb7a5('0x21')]);}logger['error']('Network,\x20%s,\x20%s',_0x2ffe8b,_0x3c435c[_0xb7a5('0x1f')][_0xb7a5('0x21')]);return _0x203651(_0x3c435c[_0xb7a5('0x1f')][_0xb7a5('0x21')]);}else{logger[_0xb7a5('0x19')](_0xb7a5('0x1a'),_0x2ffe8b,_0xb7a5('0x1b'));_0x203651(_0x3c435c[_0xb7a5('0x22')][_0xb7a5('0x21')]);}})[_0xb7a5('0x23')](function(_0x5b4d8b){logger['error'](_0xb7a5('0x1a'),_0x2ffe8b,_0x5b4d8b);_0x36437e(_0x5b4d8b);});});}function respondWithStatusCode(_0x263ebb,_0x3014cd){_0x3014cd=_0x3014cd||0xcc;return function(_0x564bf7){if(_0x564bf7){return _0x263ebb['sendStatus'](_0x3014cd);}return _0x263ebb[_0xb7a5('0x24')](_0x3014cd)[_0xb7a5('0x25')]();};}function respondWithResult(_0x366a01,_0x3f0e4e){_0x3f0e4e=_0x3f0e4e||0xc8;return function(_0x334491){if(_0x334491){return _0x366a01[_0xb7a5('0x24')](_0x3f0e4e)[_0xb7a5('0x26')](_0x334491);}};}function respondWithFilteredResult(_0x2ee6f7,_0x3e5d18){return function(_0x445210){if(_0x445210){var _0x2e48ec=typeof _0x3e5d18[_0xb7a5('0x27')]===_0xb7a5('0x28')&&typeof _0x3e5d18[_0xb7a5('0x29')]===_0xb7a5('0x28');var _0x244858=_0x445210[_0xb7a5('0x2a')];var _0x1ec925=_0x2e48ec?0x0:_0x3e5d18[_0xb7a5('0x27')];var _0x5156a6=_0x2e48ec?_0x445210[_0xb7a5('0x2a')]:_0x3e5d18[_0xb7a5('0x27')]+_0x3e5d18[_0xb7a5('0x29')];var _0x1c96b1;if(_0x5156a6>=_0x244858){_0x5156a6=_0x244858;_0x1c96b1=0xc8;}else{_0x1c96b1=0xce;}_0x2ee6f7[_0xb7a5('0x24')](_0x1c96b1);return _0x2ee6f7[_0xb7a5('0x2b')](_0xb7a5('0x2c'),_0x1ec925+'-'+_0x5156a6+'/'+_0x244858)[_0xb7a5('0x26')](_0x445210);}return null;};}function patchUpdates(_0x21b619){return function(_0x20a052){try{jsonpatch[_0xb7a5('0x2d')](_0x20a052,_0x21b619,!![]);}catch(_0x6106dd){return BPromise[_0xb7a5('0x2e')](_0x6106dd);}return _0x20a052[_0xb7a5('0x2f')]();};}function saveUpdates(_0x15bd08,_0x38f442){return function(_0x201c8c){if(_0x201c8c){return _0x201c8c[_0xb7a5('0x30')](_0x15bd08)[_0xb7a5('0x18')](function(_0x169552){return _0x169552;});}return null;};}function removeEntity(_0x47fce3,_0x5e7666){return function(_0x4ab062){if(_0x4ab062){return _0x4ab062[_0xb7a5('0x31')]()[_0xb7a5('0x18')](function(){_0x47fce3[_0xb7a5('0x24')](0xcc)[_0xb7a5('0x25')]();});}};}function handleEntityNotFound(_0x226648,_0x278e86){return function(_0x213900){if(!_0x213900){_0x226648[_0xb7a5('0x32')](0x194);}return _0x213900;};}function handleError(_0x21e165,_0xecb97){_0xecb97=_0xecb97||0x1f4;return function(_0x50d551){logger['error'](_0x50d551[_0xb7a5('0x33')]);if(_0x50d551[_0xb7a5('0x34')]){delete _0x50d551[_0xb7a5('0x34')];}_0x21e165[_0xb7a5('0x24')](_0xecb97)[_0xb7a5('0x35')](_0x50d551);};}exports[_0xb7a5('0x36')]=function(_0x1b070f,_0x131984){var _0x197a30={},_0x90490e={},_0x3e1314={'count':0x0,'rows':[]};var _0x515179=_[_0xb7a5('0x37')](db['Network'][_0xb7a5('0x38')],function(_0x2af1e4){return{'name':_0x2af1e4['fieldName'],'type':_0x2af1e4[_0xb7a5('0x39')][_0xb7a5('0x3a')]};});_0x90490e['model']=_[_0xb7a5('0x37')](_0x515179,_0xb7a5('0x34'));_0x90490e[_0xb7a5('0x3b')]=_[_0xb7a5('0x3c')](_0x1b070f[_0xb7a5('0x3b')]);_0x90490e['filters']=_[_0xb7a5('0x3d')](_0x90490e[_0xb7a5('0x3e')],_0x90490e[_0xb7a5('0x3b')]);_0x197a30[_0xb7a5('0x3f')]=_['intersection'](_0x90490e[_0xb7a5('0x3e')],qs['fields'](_0x1b070f[_0xb7a5('0x3b')][_0xb7a5('0x40')]));_0x197a30[_0xb7a5('0x3f')]=_0x197a30['attributes'][_0xb7a5('0x41')]?_0x197a30[_0xb7a5('0x3f')]:_0x90490e[_0xb7a5('0x3e')];if(!_0x1b070f['query'][_0xb7a5('0x42')](_0xb7a5('0x43'))){_0x197a30[_0xb7a5('0x29')]=qs[_0xb7a5('0x29')](_0x1b070f[_0xb7a5('0x3b')][_0xb7a5('0x29')]);_0x197a30[_0xb7a5('0x27')]=qs[_0xb7a5('0x27')](_0x1b070f[_0xb7a5('0x3b')][_0xb7a5('0x27')]);}_0x197a30[_0xb7a5('0x44')]=qs[_0xb7a5('0x45')](_0x1b070f[_0xb7a5('0x3b')]['sort']);_0x197a30['where']=qs[_0xb7a5('0x46')](_[_0xb7a5('0x47')](_0x1b070f[_0xb7a5('0x3b')],_0x90490e['filters']),_0x515179);if(_0x1b070f['query'][_0xb7a5('0x48')]){_0x197a30[_0xb7a5('0x49')]=_['merge'](_0x197a30[_0xb7a5('0x49')],{'$or':_[_0xb7a5('0x37')](_0x515179,function(_0x1ad231){if(_0x1ad231[_0xb7a5('0x39')]!==_0xb7a5('0x4a')){var _0x4310c5={};_0x4310c5[_0x1ad231[_0xb7a5('0x34')]]={'$like':'%'+_0x1b070f[_0xb7a5('0x3b')]['filter']+'%'};return _0x4310c5;}})});}_0x197a30=_[_0xb7a5('0x4b')]({},_0x197a30,_0x1b070f[_0xb7a5('0x4c')]);var _0x5ac62e={'where':_0x197a30['where']};return db['Network'][_0xb7a5('0x2a')](_0x5ac62e)[_0xb7a5('0x18')](function(_0x52071c){_0x3e1314[_0xb7a5('0x2a')]=_0x52071c;if(_0x1b070f[_0xb7a5('0x3b')][_0xb7a5('0x4d')]){_0x197a30[_0xb7a5('0x4e')]=[{'all':!![]}];}return db['Network'][_0xb7a5('0x4f')](_0x197a30);})[_0xb7a5('0x18')](function(_0x31ddee){_0x3e1314[_0xb7a5('0x50')]=_0x31ddee;return _0x3e1314;})[_0xb7a5('0x18')](respondWithFilteredResult(_0x131984,_0x197a30))['catch'](handleError(_0x131984,null));};exports[_0xb7a5('0x51')]=function(_0x1e1c0c,_0x52a9c2){var _0x226f1a={'raw':!![],'where':{'id':_0x1e1c0c[_0xb7a5('0x52')]['id']}},_0x3cfd20={};_0x3cfd20[_0xb7a5('0x3e')]=_[_0xb7a5('0x3c')](db['Network'][_0xb7a5('0x38')]);_0x3cfd20[_0xb7a5('0x3b')]=_[_0xb7a5('0x3c')](_0x1e1c0c[_0xb7a5('0x3b')]);_0x3cfd20[_0xb7a5('0x46')]=_[_0xb7a5('0x3d')](_0x3cfd20['model'],_0x3cfd20[_0xb7a5('0x3b')]);_0x226f1a[_0xb7a5('0x3f')]=_['intersection'](_0x3cfd20[_0xb7a5('0x3e')],qs['fields'](_0x1e1c0c[_0xb7a5('0x3b')]['fields']));_0x226f1a[_0xb7a5('0x3f')]=_0x226f1a['attributes'][_0xb7a5('0x41')]?_0x226f1a[_0xb7a5('0x3f')]:_0x3cfd20[_0xb7a5('0x3e')];if(_0x1e1c0c[_0xb7a5('0x3b')][_0xb7a5('0x4d')]){_0x226f1a[_0xb7a5('0x4e')]=[{'all':!![]}];}_0x226f1a=_[_0xb7a5('0x4b')]({},_0x226f1a,_0x1e1c0c['options']);return db[_0xb7a5('0x53')][_0xb7a5('0x54')](_0x226f1a)['then'](handleEntityNotFound(_0x52a9c2,null))[_0xb7a5('0x18')](respondWithResult(_0x52a9c2,null))[_0xb7a5('0x23')](handleError(_0x52a9c2,null));};exports['create']=function(_0x3301eb,_0x243132,_0x30f6de){var _0x3dd1d7;return db['sequelize'][_0xb7a5('0x55')](function(_0x514e03){return db[_0xb7a5('0x53')][_0xb7a5('0x56')](_0x3301eb['body'],{'raw':!![]})['then'](function(_0x32d00d){_0x3dd1d7=_0x32d00d;return db['Network'][_0xb7a5('0x4f')]({'where':{'type':_0x3301eb['body'][_0xb7a5('0x39')]},'raw':!![]});})[_0xb7a5('0x18')](function(_0x9c30b3){if(_0x3dd1d7[_0xb7a5('0x39')][_0xb7a5('0x57')]()==_0xb7a5('0x58')){var _0x5814de=fs['readFileSync'](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],_0xb7a5('0x5b')),_0xb7a5('0x5c'));var _0x4fc3ef=ejs[_0xb7a5('0x5d')](_0x5814de,{'networks':_0x9c30b3||[]});fs[_0xb7a5('0x5e')](_0xb7a5('0x5f'),_0x4fc3ef);return respondWithRpcPromise('Reload',_0xb7a5('0x56'),{'module':_0xb7a5('0x60')});}else if(_0x3dd1d7['type'][_0xb7a5('0x57')]()==_0xb7a5('0x61')){var _0x159e79=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],'server/files/templates/turn_multiple.ejs'),_0xb7a5('0x5c'));var _0x2c9e91=ejs[_0xb7a5('0x5d')](_0x159e79,{'networks':_0x9c30b3||[]});fs[_0xb7a5('0x5e')](_0xb7a5('0x63'),_0x2c9e91);return respondWithRpcPromise(_0xb7a5('0x64'),_0xb7a5('0x56'),{'module':_0xb7a5('0x60')});}else{var _0x20028c=fs['readFileSync'](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],_0xb7a5('0x65')),_0xb7a5('0x5c'));var _0x214b6f=ejs[_0xb7a5('0x5d')](_0x20028c,{'networks':_0x9c30b3||[]});fs[_0xb7a5('0x5e')](util[_0xb7a5('0x66')](_0xb7a5('0x67'),_0x3301eb[_0xb7a5('0x68')][_0xb7a5('0x39')][_0xb7a5('0x69')]()),_0x214b6f);return respondWithRpcPromise(_0xb7a5('0x64'),_0xb7a5('0x56'),{'module':'chan_sip.so'});}return null;})[_0xb7a5('0x18')](function(){return _0x3dd1d7;});})[_0xb7a5('0x18')](respondWithResult(_0x243132,0xc9))[_0xb7a5('0x23')](handleError(_0x243132,null));};exports[_0xb7a5('0x30')]=function(_0x18e237,_0x34dc7f,_0xee95f3){var _0x3f028f;return db['sequelize'][_0xb7a5('0x55')](function(_0x335ad7){return db[_0xb7a5('0x53')][_0xb7a5('0x54')]({'where':{'id':_0x18e237[_0xb7a5('0x52')]['id']}})[_0xb7a5('0x18')](handleEntityNotFound(_0x34dc7f,null))[_0xb7a5('0x18')](saveUpdates(_0x18e237[_0xb7a5('0x68')],null))[_0xb7a5('0x18')](function(_0xafc0df){if(_0xafc0df){_0x3f028f=_0xafc0df;return db[_0xb7a5('0x53')]['findAll']({'where':{'type':_0x3f028f[_0xb7a5('0x39')]},'raw':!![]});}return null;})[_0xb7a5('0x18')](function(_0xf370fa){if(_0x3f028f['type']['toUpperCase']()=='STUN'){var _0x690ef7=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],_0xb7a5('0x5b')),_0xb7a5('0x5c'));var _0x2d749c=ejs[_0xb7a5('0x5d')](_0x690ef7,{'networks':_0xf370fa||[]});fs[_0xb7a5('0x5e')](_0xb7a5('0x5f'),_0x2d749c);return respondWithRpcPromise(_0xb7a5('0x64'),_0xb7a5('0x30'),{'module':_0xb7a5('0x60')});}else if(_0x3f028f[_0xb7a5('0x39')][_0xb7a5('0x57')]()==_0xb7a5('0x61')){var _0x476ec7=fs[_0xb7a5('0x62')](path['join'](config[_0xb7a5('0x5a')],'server/files/templates/turn_multiple.ejs'),_0xb7a5('0x5c'));var _0x1cfe4f=ejs['render'](_0x476ec7,{'networks':_0xf370fa||[]});fs[_0xb7a5('0x5e')](_0xb7a5('0x63'),_0x1cfe4f);return respondWithRpcPromise('Reload','update',{'module':_0xb7a5('0x60')});}else{var _0x210155=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],_0xb7a5('0x65')),_0xb7a5('0x5c'));var _0x5a0b1e=ejs[_0xb7a5('0x5d')](_0x210155,{'networks':_0xf370fa||[]});fs[_0xb7a5('0x5e')](util[_0xb7a5('0x66')](_0xb7a5('0x67'),_0x18e237[_0xb7a5('0x68')]['type'][_0xb7a5('0x69')]()),_0x5a0b1e);return respondWithRpcPromise(_0xb7a5('0x64'),'update',{'module':_0xb7a5('0x6a')});}return null;})['then'](function(_0xa710db){if(_0xa710db){return _0x3f028f;}return null;});})[_0xb7a5('0x18')](respondWithResult(_0x34dc7f,null))['catch'](handleError(_0x34dc7f,null));};exports[_0xb7a5('0x31')]=function(_0x2e57cc,_0x2f76bf,_0x261c60){var _0x33f0e2;return db[_0xb7a5('0x53')][_0xb7a5('0x54')]({'where':{'id':_0x2e57cc[_0xb7a5('0x52')]['id']}})[_0xb7a5('0x18')](function(_0x56d3ac){_0x33f0e2=_0x56d3ac;return _0x56d3ac;})[_0xb7a5('0x18')](handleEntityNotFound(_0x2f76bf,null))[_0xb7a5('0x18')](removeEntity(_0x2f76bf,null))['then'](function(){if(_0x33f0e2){return db[_0xb7a5('0x53')][_0xb7a5('0x4f')]({'where':{'type':_0x33f0e2['type']},'raw':!![]});}})[_0xb7a5('0x18')](function(_0x2cdf59){if(_0x33f0e2['type'][_0xb7a5('0x57')]()==_0xb7a5('0x58')){var _0x5aa051=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config['root'],_0xb7a5('0x5b')),_0xb7a5('0x5c'));var _0x1bb9ef=ejs['render'](_0x5aa051,{'networks':_0x2cdf59||[]});fs[_0xb7a5('0x5e')](_0xb7a5('0x5f'),_0x1bb9ef);return respondWithRpcPromise('Reload',_0xb7a5('0x31'),{'module':_0xb7a5('0x60')});}else if(_0x33f0e2[_0xb7a5('0x39')][_0xb7a5('0x57')]()==_0xb7a5('0x61')){var _0x1bc4f0=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config[_0xb7a5('0x5a')],_0xb7a5('0x6b')),'utf8');var _0x1d3fe0=ejs[_0xb7a5('0x5d')](_0x1bc4f0,{'networks':_0x2cdf59||[]});fs[_0xb7a5('0x5e')]('/etc/asterisk/turn_xcally.conf',_0x1d3fe0);return respondWithRpcPromise(_0xb7a5('0x64'),_0xb7a5('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x494c47=fs[_0xb7a5('0x62')](path[_0xb7a5('0x59')](config['root'],_0xb7a5('0x65')),_0xb7a5('0x5c'));var _0x189989=ejs['render'](_0x494c47,{'networks':_0x2cdf59||[]});fs[_0xb7a5('0x5e')](util[_0xb7a5('0x66')](_0xb7a5('0x67'),_0x2e57cc[_0xb7a5('0x68')][_0xb7a5('0x39')][_0xb7a5('0x69')]()),_0x189989);return respondWithRpcPromise(_0xb7a5('0x64'),'destroy',{'module':'chan_sip.so'});}return null;})['catch'](handleError(_0x2f76bf,null));}; \ No newline at end of file +var _0x8463=['sequelize','TURN','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','Network','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','includeAll','find','create','transaction','body','toUpperCase','STUN','readFileSync','join','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','root','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so'];(function(_0x45d80c,_0x35c0ff){var _0x449a98=function(_0x1b5ab7){while(--_0x1b5ab7){_0x45d80c['push'](_0x45d80c['shift']());}};_0x449a98(++_0x35c0ff);}(_0x8463,0x1b2));var _0x3846=function(_0x51c759,_0x4f2f47){_0x51c759=_0x51c759-0x0;var _0x1817e2=_0x8463[_0x51c759];return _0x1817e2;};'use strict';var emlformat=require(_0x3846('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3846('0x1'));var rp=require(_0x3846('0x2'));var moment=require(_0x3846('0x3'));var BPromise=require(_0x3846('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3846('0x5'));var sox=require(_0x3846('0x6'));var csv=require(_0x3846('0x7'));var ejs=require(_0x3846('0x8'));var fs=require('fs');var fs_extra=require(_0x3846('0x9'));var _=require(_0x3846('0xa'));var squel=require(_0x3846('0xb'));var crypto=require(_0x3846('0xc'));var jsforce=require(_0x3846('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3846('0xe'));var Redis=require(_0x3846('0xf'));var authService=require(_0x3846('0x10'));var qs=require(_0x3846('0x11'));var as=require(_0x3846('0x12'));var hardwareService=require(_0x3846('0x13'));var logger=require(_0x3846('0x14'))(_0x3846('0x15'));var utils=require('../../config/utils');var config=require(_0x3846('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x3846('0x17'))['db'];var jayson=require(_0x3846('0x18'));var client=jayson[_0x3846('0x19')][_0x3846('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x51cc92,_0x23f5ca,_0x1436ac,_0x5128db){return new BPromise(function(_0x41c1b3,_0x2fe740){var _0x33b778=_0x5128db||client;return _0x33b778[_0x3846('0x1b')](_0x51cc92,_0x1436ac)[_0x3846('0x1c')](function(_0x130c7c){logger[_0x3846('0x1d')](_0x3846('0x1e'),_0x23f5ca,_0x3846('0x1f'));logger[_0x3846('0x20')](_0x3846('0x21'),_0x23f5ca,_0x3846('0x1f'),JSON['stringify'](_0x130c7c));if(_0x130c7c[_0x3846('0x22')]){if(_0x130c7c[_0x3846('0x22')]['code']===0x1f4){logger[_0x3846('0x22')](_0x3846('0x1e'),_0x23f5ca,_0x130c7c[_0x3846('0x22')]['message']);return _0x2fe740(_0x130c7c[_0x3846('0x22')][_0x3846('0x23')]);}logger['error'](_0x3846('0x1e'),_0x23f5ca,_0x130c7c[_0x3846('0x22')][_0x3846('0x23')]);return _0x41c1b3(_0x130c7c[_0x3846('0x22')][_0x3846('0x23')]);}else{logger['info'](_0x3846('0x1e'),_0x23f5ca,_0x3846('0x1f'));_0x41c1b3(_0x130c7c['result'][_0x3846('0x23')]);}})['catch'](function(_0x27c686){logger[_0x3846('0x22')](_0x3846('0x1e'),_0x23f5ca,_0x27c686);_0x2fe740(_0x27c686);});});}function respondWithStatusCode(_0x13d9ae,_0x30e794){_0x30e794=_0x30e794||0xcc;return function(_0x4a6e44){if(_0x4a6e44){return _0x13d9ae[_0x3846('0x24')](_0x30e794);}return _0x13d9ae[_0x3846('0x25')](_0x30e794)[_0x3846('0x26')]();};}function respondWithResult(_0x3fabf4,_0x101c02){_0x101c02=_0x101c02||0xc8;return function(_0xf6144e){if(_0xf6144e){return _0x3fabf4[_0x3846('0x25')](_0x101c02)[_0x3846('0x27')](_0xf6144e);}};}function respondWithFilteredResult(_0x3824e5,_0x2283be){return function(_0x19c34c){if(_0x19c34c){var _0x275527=typeof _0x2283be['offset']==='undefined'&&typeof _0x2283be[_0x3846('0x28')]===_0x3846('0x29');var _0x22f660=_0x19c34c[_0x3846('0x2a')];var _0x13648a=_0x275527?0x0:_0x2283be[_0x3846('0x2b')];var _0x404e72=_0x275527?_0x19c34c[_0x3846('0x2a')]:_0x2283be[_0x3846('0x2b')]+_0x2283be[_0x3846('0x28')];var _0x478c24;if(_0x404e72>=_0x22f660){_0x404e72=_0x22f660;_0x478c24=0xc8;}else{_0x478c24=0xce;}_0x3824e5[_0x3846('0x25')](_0x478c24);return _0x3824e5[_0x3846('0x2c')](_0x3846('0x2d'),_0x13648a+'-'+_0x404e72+'/'+_0x22f660)['json'](_0x19c34c);}return null;};}function patchUpdates(_0x36856f){return function(_0x16a3bc){try{jsonpatch[_0x3846('0x2e')](_0x16a3bc,_0x36856f,!![]);}catch(_0x12f970){return BPromise[_0x3846('0x2f')](_0x12f970);}return _0x16a3bc[_0x3846('0x30')]();};}function saveUpdates(_0x19ffaf,_0x56b667){return function(_0x34c8f4){if(_0x34c8f4){return _0x34c8f4[_0x3846('0x31')](_0x19ffaf)[_0x3846('0x1c')](function(_0x401b47){return _0x401b47;});}return null;};}function removeEntity(_0x2ba5a2,_0x3e75fc){return function(_0x31fbda){if(_0x31fbda){return _0x31fbda[_0x3846('0x32')]()[_0x3846('0x1c')](function(){_0x2ba5a2[_0x3846('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fe95e,_0x4f8222){return function(_0x272f1f){if(!_0x272f1f){_0x3fe95e[_0x3846('0x24')](0x194);}return _0x272f1f;};}function handleError(_0x144ad9,_0x4b4d0f){_0x4b4d0f=_0x4b4d0f||0x1f4;return function(_0x1c866b){logger[_0x3846('0x22')](_0x1c866b[_0x3846('0x33')]);if(_0x1c866b[_0x3846('0x34')]){delete _0x1c866b[_0x3846('0x34')];}_0x144ad9['status'](_0x4b4d0f)[_0x3846('0x35')](_0x1c866b);};}exports['index']=function(_0x2691d7,_0x24ef2f){var _0x2a536e={},_0x9c2b0d={},_0x268a43={'count':0x0,'rows':[]};var _0x479c13=_[_0x3846('0x36')](db[_0x3846('0x37')][_0x3846('0x38')],function(_0x371b85){return{'name':_0x371b85['fieldName'],'type':_0x371b85[_0x3846('0x39')][_0x3846('0x3a')]};});_0x9c2b0d[_0x3846('0x3b')]=_[_0x3846('0x36')](_0x479c13,_0x3846('0x34'));_0x9c2b0d[_0x3846('0x3c')]=_['keys'](_0x2691d7['query']);_0x9c2b0d[_0x3846('0x3d')]=_[_0x3846('0x3e')](_0x9c2b0d[_0x3846('0x3b')],_0x9c2b0d[_0x3846('0x3c')]);_0x2a536e[_0x3846('0x3f')]=_[_0x3846('0x3e')](_0x9c2b0d[_0x3846('0x3b')],qs[_0x3846('0x40')](_0x2691d7[_0x3846('0x3c')]['fields']));_0x2a536e[_0x3846('0x3f')]=_0x2a536e[_0x3846('0x3f')][_0x3846('0x41')]?_0x2a536e['attributes']:_0x9c2b0d[_0x3846('0x3b')];if(!_0x2691d7[_0x3846('0x3c')][_0x3846('0x42')](_0x3846('0x43'))){_0x2a536e[_0x3846('0x28')]=qs[_0x3846('0x28')](_0x2691d7['query'][_0x3846('0x28')]);_0x2a536e[_0x3846('0x2b')]=qs[_0x3846('0x2b')](_0x2691d7[_0x3846('0x3c')]['offset']);}_0x2a536e[_0x3846('0x44')]=qs[_0x3846('0x45')](_0x2691d7['query'][_0x3846('0x45')]);_0x2a536e[_0x3846('0x46')]=qs[_0x3846('0x3d')](_['pick'](_0x2691d7[_0x3846('0x3c')],_0x9c2b0d[_0x3846('0x3d')]),_0x479c13);if(_0x2691d7[_0x3846('0x3c')][_0x3846('0x47')]){_0x2a536e[_0x3846('0x46')]=_[_0x3846('0x48')](_0x2a536e[_0x3846('0x46')],{'$or':_[_0x3846('0x36')](_0x479c13,function(_0x4c8190){if(_0x4c8190['type']!==_0x3846('0x49')){var _0x5d86ee={};_0x5d86ee[_0x4c8190[_0x3846('0x34')]]={'$like':'%'+_0x2691d7[_0x3846('0x3c')][_0x3846('0x47')]+'%'};return _0x5d86ee;}})});}_0x2a536e=_['merge']({},_0x2a536e,_0x2691d7[_0x3846('0x4a')]);var _0x32deb2={'where':_0x2a536e[_0x3846('0x46')]};return db['Network']['count'](_0x32deb2)[_0x3846('0x1c')](function(_0x46e138){_0x268a43['count']=_0x46e138;if(_0x2691d7[_0x3846('0x3c')]['includeAll']){_0x2a536e[_0x3846('0x4b')]=[{'all':!![]}];}return db[_0x3846('0x37')][_0x3846('0x4c')](_0x2a536e);})[_0x3846('0x1c')](function(_0x43d43b){_0x268a43[_0x3846('0x4d')]=_0x43d43b;return _0x268a43;})['then'](respondWithFilteredResult(_0x24ef2f,_0x2a536e))[_0x3846('0x4e')](handleError(_0x24ef2f,null));};exports[_0x3846('0x4f')]=function(_0x1fb534,_0x32e9cb){var _0x184d63={'raw':!![],'where':{'id':_0x1fb534[_0x3846('0x50')]['id']}},_0x557879={};_0x557879[_0x3846('0x3b')]=_[_0x3846('0x51')](db[_0x3846('0x37')][_0x3846('0x38')]);_0x557879[_0x3846('0x3c')]=_['keys'](_0x1fb534[_0x3846('0x3c')]);_0x557879[_0x3846('0x3d')]=_[_0x3846('0x3e')](_0x557879['model'],_0x557879[_0x3846('0x3c')]);_0x184d63['attributes']=_[_0x3846('0x3e')](_0x557879[_0x3846('0x3b')],qs[_0x3846('0x40')](_0x1fb534['query']['fields']));_0x184d63[_0x3846('0x3f')]=_0x184d63[_0x3846('0x3f')][_0x3846('0x41')]?_0x184d63['attributes']:_0x557879[_0x3846('0x3b')];if(_0x1fb534[_0x3846('0x3c')][_0x3846('0x52')]){_0x184d63[_0x3846('0x4b')]=[{'all':!![]}];}_0x184d63=_[_0x3846('0x48')]({},_0x184d63,_0x1fb534['options']);return db[_0x3846('0x37')][_0x3846('0x53')](_0x184d63)[_0x3846('0x1c')](handleEntityNotFound(_0x32e9cb,null))[_0x3846('0x1c')](respondWithResult(_0x32e9cb,null))[_0x3846('0x4e')](handleError(_0x32e9cb,null));};exports[_0x3846('0x54')]=function(_0x166b08,_0x2b4b50,_0x271597){var _0x184bea;return db['sequelize'][_0x3846('0x55')](function(_0x454c7d){return db[_0x3846('0x37')]['create'](_0x166b08[_0x3846('0x56')],{'raw':!![]})['then'](function(_0x523ae2){_0x184bea=_0x523ae2;return db['Network']['findAll']({'where':{'type':_0x166b08[_0x3846('0x56')][_0x3846('0x39')]},'raw':!![]});})['then'](function(_0x46d977){if(_0x184bea[_0x3846('0x39')][_0x3846('0x57')]()==_0x3846('0x58')){var _0x5b38bf=fs[_0x3846('0x59')](path[_0x3846('0x5a')](config['root'],_0x3846('0x5b')),_0x3846('0x5c'));var _0x9fc23a=ejs[_0x3846('0x5d')](_0x5b38bf,{'networks':_0x46d977||[]});fs[_0x3846('0x5e')](_0x3846('0x5f'),_0x9fc23a);return respondWithRpcPromise(_0x3846('0x60'),_0x3846('0x54'),{'module':_0x3846('0x61')});}else if(_0x184bea[_0x3846('0x39')][_0x3846('0x57')]()=='TURN'){var _0x32c6b2=fs['readFileSync'](path[_0x3846('0x5a')](config[_0x3846('0x62')],_0x3846('0x63')),_0x3846('0x5c'));var _0x40ea85=ejs[_0x3846('0x5d')](_0x32c6b2,{'networks':_0x46d977||[]});fs['writeFileSync'](_0x3846('0x64'),_0x40ea85);return respondWithRpcPromise(_0x3846('0x60'),'create',{'module':_0x3846('0x61')});}else{var _0x2b0748=fs[_0x3846('0x59')](path[_0x3846('0x5a')](config['root'],_0x3846('0x65')),_0x3846('0x5c'));var _0x5c4767=ejs['render'](_0x2b0748,{'networks':_0x46d977||[]});fs[_0x3846('0x5e')](util[_0x3846('0x66')](_0x3846('0x67'),_0x166b08[_0x3846('0x56')][_0x3846('0x39')][_0x3846('0x68')]()),_0x5c4767);return respondWithRpcPromise(_0x3846('0x60'),_0x3846('0x54'),{'module':_0x3846('0x69')});}return null;})[_0x3846('0x1c')](function(){return _0x184bea;});})[_0x3846('0x1c')](respondWithResult(_0x2b4b50,0xc9))['catch'](handleError(_0x2b4b50,null));};exports[_0x3846('0x31')]=function(_0x3e62b9,_0x433d25,_0x1eb090){var _0x56ab54;return db[_0x3846('0x6a')][_0x3846('0x55')](function(_0x3f6d20){return db[_0x3846('0x37')][_0x3846('0x53')]({'where':{'id':_0x3e62b9[_0x3846('0x50')]['id']}})[_0x3846('0x1c')](handleEntityNotFound(_0x433d25,null))['then'](saveUpdates(_0x3e62b9[_0x3846('0x56')],null))['then'](function(_0x259d1a){if(_0x259d1a){_0x56ab54=_0x259d1a;return db[_0x3846('0x37')][_0x3846('0x4c')]({'where':{'type':_0x56ab54['type']},'raw':!![]});}return null;})[_0x3846('0x1c')](function(_0x20fe21){if(_0x56ab54[_0x3846('0x39')][_0x3846('0x57')]()==_0x3846('0x58')){var _0x55fefe=fs[_0x3846('0x59')](path['join'](config[_0x3846('0x62')],_0x3846('0x5b')),'utf8');var _0x5a8969=ejs['render'](_0x55fefe,{'networks':_0x20fe21||[]});fs[_0x3846('0x5e')](_0x3846('0x5f'),_0x5a8969);return respondWithRpcPromise('Reload',_0x3846('0x31'),{'module':_0x3846('0x61')});}else if(_0x56ab54[_0x3846('0x39')]['toUpperCase']()==_0x3846('0x6b')){var _0x58f443=fs['readFileSync'](path[_0x3846('0x5a')](config[_0x3846('0x62')],_0x3846('0x63')),_0x3846('0x5c'));var _0x48488f=ejs[_0x3846('0x5d')](_0x58f443,{'networks':_0x20fe21||[]});fs['writeFileSync'](_0x3846('0x64'),_0x48488f);return respondWithRpcPromise('Reload','update',{'module':'res_stun_monitor.so'});}else{var _0x1ff313=fs[_0x3846('0x59')](path['join'](config[_0x3846('0x62')],_0x3846('0x65')),_0x3846('0x5c'));var _0x2cdc3d=ejs[_0x3846('0x5d')](_0x1ff313,{'networks':_0x20fe21||[]});fs['writeFileSync'](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x3e62b9[_0x3846('0x56')][_0x3846('0x39')]['toLowerCase']()),_0x2cdc3d);return respondWithRpcPromise('Reload','update',{'module':_0x3846('0x69')});}return null;})[_0x3846('0x1c')](function(_0x5a526b){if(_0x5a526b){return _0x56ab54;}return null;});})[_0x3846('0x1c')](respondWithResult(_0x433d25,null))['catch'](handleError(_0x433d25,null));};exports['destroy']=function(_0x2489ea,_0x2b194e,_0xaf8bef){var _0x5ac2f8;return db[_0x3846('0x37')][_0x3846('0x53')]({'where':{'id':_0x2489ea[_0x3846('0x50')]['id']}})[_0x3846('0x1c')](function(_0x663e6){_0x5ac2f8=_0x663e6;return _0x663e6;})[_0x3846('0x1c')](handleEntityNotFound(_0x2b194e,null))['then'](removeEntity(_0x2b194e,null))[_0x3846('0x1c')](function(){if(_0x5ac2f8){return db[_0x3846('0x37')][_0x3846('0x4c')]({'where':{'type':_0x5ac2f8[_0x3846('0x39')]},'raw':!![]});}})[_0x3846('0x1c')](function(_0x2e5a9c){if(_0x5ac2f8['type'][_0x3846('0x57')]()==_0x3846('0x58')){var _0x459595=fs[_0x3846('0x59')](path[_0x3846('0x5a')](config[_0x3846('0x62')],'server/files/templates/stun_multiple.ejs'),_0x3846('0x5c'));var _0x49fc9b=ejs[_0x3846('0x5d')](_0x459595,{'networks':_0x2e5a9c||[]});fs[_0x3846('0x5e')]('/etc/asterisk/stun_xcally.conf',_0x49fc9b);return respondWithRpcPromise(_0x3846('0x60'),'destroy',{'module':_0x3846('0x61')});}else if(_0x5ac2f8[_0x3846('0x39')][_0x3846('0x57')]()==_0x3846('0x6b')){var _0x53cf56=fs['readFileSync'](path['join'](config[_0x3846('0x62')],_0x3846('0x63')),_0x3846('0x5c'));var _0x1446c3=ejs[_0x3846('0x5d')](_0x53cf56,{'networks':_0x2e5a9c||[]});fs[_0x3846('0x5e')](_0x3846('0x64'),_0x1446c3);return respondWithRpcPromise(_0x3846('0x60'),_0x3846('0x32'),{'module':_0x3846('0x61')});}else{var _0x128e8a=fs['readFileSync'](path[_0x3846('0x5a')](config['root'],_0x3846('0x65')),'utf8');var _0xc2fef7=ejs[_0x3846('0x5d')](_0x128e8a,{'networks':_0x2e5a9c||[]});fs[_0x3846('0x5e')](util[_0x3846('0x66')]('/etc/asterisk/sip_xcally_%s.conf',_0x2489ea[_0x3846('0x56')][_0x3846('0x39')][_0x3846('0x68')]()),_0xc2fef7);return respondWithRpcPromise(_0x3846('0x60'),_0x3846('0x32'),{'module':_0x3846('0x69')});}return null;})[_0x3846('0x4e')](handleError(_0x2b194e,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 25f0f5f..d049bb2 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 _0x235a=['exports','Network','network','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x4083da,_0x7aee27){var _0x46dfcc=function(_0x4daa29){while(--_0x4daa29){_0x4083da['push'](_0x4083da['shift']());}};_0x46dfcc(++_0x7aee27);}(_0x235a,0x1ef));var _0xa235=function(_0x2bb82a,_0x4a934b){_0x2bb82a=_0x2bb82a-0x0;var _0x4e81f7=_0x235a[_0x2bb82a];return _0x4e81f7;};'use strict';var _=require(_0xa235('0x0'));var util=require(_0xa235('0x1'));var logger=require(_0xa235('0x2'))('api');var moment=require(_0xa235('0x3'));var BPromise=require('bluebird');var rp=require(_0xa235('0x4'));var fs=require('fs');var path=require(_0xa235('0x5'));var rimraf=require(_0xa235('0x6'));var config=require(_0xa235('0x7'));var attributes=require(_0xa235('0x8'));module[_0xa235('0x9')]=function(_0x2961c8,_0x1707fc){return _0x2961c8['define'](_0xa235('0xa'),attributes,{'tableName':_0xa235('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd52a=['define','network','util','api','moment','bluebird','path','rimraf','../../config/environment','./network.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd52a,0xca));var _0xad52=function(_0x176ee6,_0x3a885c){_0x176ee6=_0x176ee6-0x0;var _0x494029=_0xd52a[_0x176ee6];return _0x494029;};'use strict';var _=require('lodash');var util=require(_0xad52('0x0'));var logger=require('../../config/logger')(_0xad52('0x1'));var moment=require(_0xad52('0x2'));var BPromise=require(_0xad52('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xad52('0x4'));var rimraf=require(_0xad52('0x5'));var config=require(_0xad52('0x6'));var attributes=require(_0xad52('0x7'));module['exports']=function(_0x525806,_0x51bdaa){return _0x525806[_0xad52('0x8')]('Network',attributes,{'tableName':_0xad52('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 b68bac4..9bfe62b 100644 --- a/server/api/network/network.rpc.js +++ b/server/api/network/network.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0x55a1bb,_0x569f42){_0x55a1bb=_0x55a1bb-0x0;var _0x44f125=_0x7a54[_0x55a1bb];return _0x44f125;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0x7a54=['info','Network,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0xc564d7,_0xef05aa){_0xc564d7=_0xc564d7-0x0;var _0x2e3422=_0x7a54[_0xc564d7];return _0x2e3422;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('Network,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index b8a234f..4b92ea5 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 _0x2253=['create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post'];(function(_0x525c44,_0x48b6cb){var _0x5ad52e=function(_0x2bbfbe){while(--_0x2bbfbe){_0x525c44['push'](_0x525c44['shift']());}};_0x5ad52e(++_0x48b6cb);}(_0x2253,0x118));var _0x3225=function(_0x2ed0e8,_0x5f7e96){_0x2ed0e8=_0x2ed0e8-0x0;var _0x594be7=_0x2253[_0x2ed0e8];return _0x594be7;};'use strict';var multer=require(_0x3225('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x3225('0x1'));var express=require(_0x3225('0x2'));var router=express[_0x3225('0x3')]();var fs_extra=require(_0x3225('0x4'));var auth=require(_0x3225('0x5'));var interaction=require(_0x3225('0x6'));var config=require(_0x3225('0x7'));var controller=require('./openchannelAccount.controller');router[_0x3225('0x8')]('/',auth[_0x3225('0x9')](),controller[_0x3225('0xa')]);router[_0x3225('0x8')](_0x3225('0xb'),auth[_0x3225('0x9')](),controller[_0x3225('0xc')]);router[_0x3225('0x8')](_0x3225('0xd'),auth[_0x3225('0x9')](),controller[_0x3225('0xe')]);router[_0x3225('0x8')](_0x3225('0xf'),auth[_0x3225('0x9')](),controller[_0x3225('0x10')]);router['get']('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x3225('0x11')]);router[_0x3225('0x8')](_0x3225('0x12'),auth[_0x3225('0x9')](),controller[_0x3225('0x13')]);router['get']('/:id/interactions',auth[_0x3225('0x9')](),controller[_0x3225('0x14')]);router['get'](_0x3225('0x15'),auth['isAuthenticated'](),controller[_0x3225('0x16')]);router[_0x3225('0x17')]('/',auth[_0x3225('0x9')](),controller[_0x3225('0x18')]);router[_0x3225('0x17')]('/:id/dispositions',auth[_0x3225('0x9')](),controller[_0x3225('0x19')]);router[_0x3225('0x17')](_0x3225('0x1a'),auth['isAuthenticated'](),controller[_0x3225('0x1b')]);router['post'](_0x3225('0x1c'),controller['notify']);router[_0x3225('0x17')]('/:id/applications',auth[_0x3225('0x9')](),controller[_0x3225('0x1d')]);router[_0x3225('0x17')]('/:id/users',auth[_0x3225('0x9')](),controller[_0x3225('0x1e')]);router[_0x3225('0x17')]('/:id/send',auth[_0x3225('0x9')](),controller['send']);router[_0x3225('0x1f')](_0x3225('0xd'),auth[_0x3225('0x9')](),controller[_0x3225('0x20')]);router['delete'](_0x3225('0xd'),auth[_0x3225('0x9')](),controller[_0x3225('0x21')]);router['delete'](_0x3225('0xf'),auth[_0x3225('0x9')](),controller['removeDispositions']);router[_0x3225('0x22')]('/:id/canned_answers',auth[_0x3225('0x9')](),controller[_0x3225('0x23')]);router[_0x3225('0x22')](_0x3225('0x15'),auth[_0x3225('0x9')](),controller[_0x3225('0x24')]);module[_0x3225('0x25')]=router; \ No newline at end of file +var _0x4994=['/:id','update','delete','removeDispositions','removeAgents','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/applications','getApplications','getInteractions','/:id/users','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/send','send','put'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x4994,0x14f));var _0x4499=function(_0x108d99,_0x1c2b77){_0x108d99=_0x108d99-0x0;var _0x5996c7=_0x4994[_0x108d99];return _0x5996c7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4499('0x0'));var timeout=require('connect-timeout');var express=require(_0x4499('0x1'));var router=express[_0x4499('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x4499('0x3'));var interaction=require(_0x4499('0x4'));var config=require(_0x4499('0x5'));var controller=require(_0x4499('0x6'));router[_0x4499('0x7')]('/',auth[_0x4499('0x8')](),controller[_0x4499('0x9')]);router['get'](_0x4499('0xa'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth['isAuthenticated'](),controller[_0x4499('0xb')]);router['get'](_0x4499('0xc'),auth[_0x4499('0x8')](),controller[_0x4499('0xd')]);router[_0x4499('0x7')]('/:id/canned_answers',auth[_0x4499('0x8')](),controller['getAnswers']);router[_0x4499('0x7')](_0x4499('0xe'),auth[_0x4499('0x8')](),controller[_0x4499('0xf')]);router[_0x4499('0x7')]('/:id/interactions',auth[_0x4499('0x8')](),controller[_0x4499('0x10')]);router['get'](_0x4499('0x11'),auth[_0x4499('0x8')](),controller['getAgents']);router[_0x4499('0x12')]('/',auth[_0x4499('0x8')](),controller[_0x4499('0x13')]);router[_0x4499('0x12')](_0x4499('0xc'),auth['isAuthenticated'](),controller[_0x4499('0x14')]);router['post'](_0x4499('0x15'),auth[_0x4499('0x8')](),controller[_0x4499('0x16')]);router[_0x4499('0x12')](_0x4499('0x17'),controller['notify']);router[_0x4499('0x12')](_0x4499('0xe'),auth['isAuthenticated'](),controller[_0x4499('0x18')]);router[_0x4499('0x12')](_0x4499('0x11'),auth[_0x4499('0x8')](),controller['addAgents']);router[_0x4499('0x12')](_0x4499('0x19'),auth[_0x4499('0x8')](),controller[_0x4499('0x1a')]);router[_0x4499('0x1b')](_0x4499('0x1c'),auth[_0x4499('0x8')](),controller[_0x4499('0x1d')]);router[_0x4499('0x1e')](_0x4499('0x1c'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x4499('0xc'),auth[_0x4499('0x8')](),controller[_0x4499('0x1f')]);router['delete']('/:id/canned_answers',auth[_0x4499('0x8')](),controller['removeAnswers']);router[_0x4499('0x1e')](_0x4499('0x11'),auth['isAuthenticated'](),controller[_0x4499('0x20')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index dd625c8..fc3b017 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 _0xd583=['generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name'];(function(_0x52dcdc,_0x1ef140){var _0x44688d=function(_0x81f695){while(--_0x81f695){_0x52dcdc['push'](_0x52dcdc['shift']());}};_0x44688d(++_0x1ef140);}(_0xd583,0x10d));var _0x3d58=function(_0x271474,_0x248441){_0x271474=_0x271474-0x0;var _0x72f117=_0xd583[_0x271474];return _0x72f117;};'use strict';var Sequelize=require(_0x3d58('0x0'));var rs=require('randomstring');module[_0x3d58('0x1')]={'name':{'type':Sequelize[_0x3d58('0x2')],'unique':_0x3d58('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x3d58('0x2')]},'token':{'type':Sequelize[_0x3d58('0x2')],'defaultValue':function(){return rs[_0x3d58('0x4')]();}},'replyUri':{'type':Sequelize[_0x3d58('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x3d58('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x3d58('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x3d58('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x3d58('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x3d58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3d58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3d58('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3d58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x3d58('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x3d58('0x6')],'defaultValue':![],'comment':_0x3d58('0x9'),'set':function(_0x5cc2e6){if(!_0x5cc2e6)this[_0x3d58('0xa')](_0x3d58('0xb'),null);this[_0x3d58('0xa')](_0x3d58('0xc'),_0x5cc2e6);}}}; \ No newline at end of file +var _0xddd8=['setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','TEXT','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x4d130c,_0x3c0372){var _0x1085ac=function(_0x918459){while(--_0x918459){_0x4d130c['push'](_0x4d130c['shift']());}};_0x1085ac(++_0x3c0372);}(_0xddd8,0xfe));var _0x8ddd=function(_0x38b470,_0x7a7f51){_0x38b470=_0x38b470-0x0;var _0x1e846d=_0xddd8[_0x38b470];return _0x1e846d;};'use strict';var Sequelize=require(_0x8ddd('0x0'));var rs=require(_0x8ddd('0x1'));module['exports']={'name':{'type':Sequelize[_0x8ddd('0x2')],'unique':_0x8ddd('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x8ddd('0x2')]},'token':{'type':Sequelize[_0x8ddd('0x2')],'defaultValue':function(){return rs[_0x8ddd('0x4')]();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x8ddd('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x8ddd('0x5')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x8ddd('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize['STRING']},'queueTransfer':{'type':Sequelize[_0x8ddd('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8ddd('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x8ddd('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x8ddd('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x8ddd('0x9'),'set':function(_0xf3000e){if(!_0xf3000e)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x8ddd('0xa')](_0x8ddd('0xb'),_0xf3000e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 4469f8f..4ddb516 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 _0x1370=['filters','pick','filter','merge','type','options','include','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','length','hasOwnProperty','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','openchannel','CmContact','Sequelize','createdAt','updatedAt','difference','ListId','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','from','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','list','applications','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','addApplications','transaction','sequelize','Transaction','READ_COMMITTED','findAndCountAll','finally','getApplications','nolimit','getInteractions','Contact','Owner','fullname','internal','Tag','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','userOpenchannelAccount:remove','getAgents','send','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelAccount.socket','register','jayson/promise','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','OpenchannelAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','OpenchannelAccount','fieldName','key','model','map','query','keys','intersection','fields','attributes','order','sort','where'];(function(_0x3621ab,_0x15c6ac){var _0x39804f=function(_0x4c606f){while(--_0x4c606f){_0x3621ab['push'](_0x3621ab['shift']());}};_0x39804f(++_0x15c6ac);}(_0x1370,0x1ed));var _0x0137=function(_0x44ae0b,_0x3e9865){_0x44ae0b=_0x44ae0b-0x0;var _0x69232a=_0x1370[_0x44ae0b];return _0x69232a;};'use strict';var emlformat=require(_0x0137('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0137('0x1'));var jsonpatch=require(_0x0137('0x2'));var rp=require(_0x0137('0x3'));var moment=require(_0x0137('0x4'));var BPromise=require(_0x0137('0x5'));var Mustache=require('mustache');var util=require(_0x0137('0x6'));var path=require('path');var sox=require(_0x0137('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0137('0x8'));var _=require(_0x0137('0x9'));var squel=require(_0x0137('0xa'));var crypto=require(_0x0137('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0137('0xc'));var querystring=require(_0x0137('0xd'));var Papa=require('papaparse');var Redis=require(_0x0137('0xe'));var authService=require(_0x0137('0xf'));var qs=require(_0x0137('0x10'));var as=require(_0x0137('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x0137('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x0137('0x13'))['db'];config['redis']=_[_0x0137('0x14')](config[_0x0137('0x15')],{'host':_0x0137('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0137('0x17'))[_0x0137('0x18')](socket);var jayson=require(_0x0137('0x19'));var client=jayson[_0x0137('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x0137('0x1a')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d6ed7,_0x2a5cee,_0xe237eb,_0x1f25e0){return new BPromise(function(_0x23a833,_0x51d2f1){var _0x221e70=_0x1f25e0||client;return _0x221e70[_0x0137('0x1b')](_0x5d6ed7,_0xe237eb)[_0x0137('0x1c')](function(_0x71d210){logger[_0x0137('0x1d')](_0x0137('0x1e'),_0x2a5cee,_0x0137('0x1f'));logger[_0x0137('0x20')](_0x0137('0x21'),_0x2a5cee,_0x0137('0x1f'),JSON[_0x0137('0x22')](_0x71d210));if(_0x71d210['error']){if(_0x71d210[_0x0137('0x23')][_0x0137('0x24')]===0x1f4){logger[_0x0137('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x2a5cee,_0x71d210['error']['message']);return _0x51d2f1(_0x71d210[_0x0137('0x23')][_0x0137('0x25')]);}logger[_0x0137('0x23')](_0x0137('0x1e'),_0x2a5cee,_0x71d210['error'][_0x0137('0x25')]);return _0x23a833(_0x71d210[_0x0137('0x23')]['message']);}else{logger[_0x0137('0x1d')]('OpenchannelAccount,\x20%s,\x20%s',_0x2a5cee,_0x0137('0x1f'));_0x23a833(_0x71d210['result'][_0x0137('0x25')]);}})['catch'](function(_0x819693){logger[_0x0137('0x23')]('OpenchannelAccount,\x20%s,\x20%s',_0x2a5cee,_0x819693);_0x51d2f1(_0x819693);});});}function respondWithStatusCode(_0x3488f6,_0x1fce88){_0x1fce88=_0x1fce88||0xcc;return function(_0x59d294){if(_0x59d294){return _0x3488f6['sendStatus'](_0x1fce88);}return _0x3488f6[_0x0137('0x26')](_0x1fce88)[_0x0137('0x27')]();};}function respondWithResult(_0x44710a,_0x42490b){_0x42490b=_0x42490b||0xc8;return function(_0x5bd193){if(_0x5bd193){return _0x44710a[_0x0137('0x26')](_0x42490b)[_0x0137('0x28')](_0x5bd193);}};}function respondWithFilteredResult(_0x5301f5,_0x563fc9){return function(_0x34f27c){if(_0x34f27c){var _0x4fe0ec=typeof _0x563fc9[_0x0137('0x29')]===_0x0137('0x2a')&&typeof _0x563fc9['limit']===_0x0137('0x2a');var _0x2701b4=_0x34f27c[_0x0137('0x2b')];var _0xa5e23a=_0x4fe0ec?0x0:_0x563fc9[_0x0137('0x29')];var _0x77b82a=_0x4fe0ec?_0x34f27c[_0x0137('0x2b')]:_0x563fc9[_0x0137('0x29')]+_0x563fc9[_0x0137('0x2c')];var _0x3a9ffa;if(_0x77b82a>=_0x2701b4){_0x77b82a=_0x2701b4;_0x3a9ffa=0xc8;}else{_0x3a9ffa=0xce;}_0x5301f5[_0x0137('0x26')](_0x3a9ffa);return _0x5301f5[_0x0137('0x2d')](_0x0137('0x2e'),_0xa5e23a+'-'+_0x77b82a+'/'+_0x2701b4)[_0x0137('0x28')](_0x34f27c);}return null;};}function patchUpdates(_0x427348){return function(_0x250cc8){try{jsonpatch['apply'](_0x250cc8,_0x427348,!![]);}catch(_0x2add93){return BPromise[_0x0137('0x2f')](_0x2add93);}return _0x250cc8['save']();};}function saveUpdates(_0x28bd13,_0x62b6d){return function(_0x35e0af){if(_0x35e0af){return _0x35e0af[_0x0137('0x30')](_0x28bd13)[_0x0137('0x1c')](function(_0x5f3378){return _0x5f3378;});}return null;};}function removeEntity(_0x239514,_0x388e5c){return function(_0x4a9c20){if(_0x4a9c20){return _0x4a9c20[_0x0137('0x31')]()[_0x0137('0x1c')](function(){var _0x3f2bdf=_0x4a9c20['get']({'plain':!![]});var _0x5b90a4=_0x0137('0x32');return db[_0x0137('0x33')][_0x0137('0x31')]({'where':{'type':_0x5b90a4,'resourceId':_0x3f2bdf['id']}})[_0x0137('0x1c')](function(){return _0x4a9c20;});})[_0x0137('0x1c')](function(){_0x239514[_0x0137('0x26')](0xcc)[_0x0137('0x27')]();});}};}function handleEntityNotFound(_0x1e4772,_0x25cdc9){return function(_0x533169){if(!_0x533169){_0x1e4772[_0x0137('0x34')](0x194);}return _0x533169;};}function handleError(_0x455275,_0x2073e5){_0x2073e5=_0x2073e5||0x1f4;return function(_0x5d265c){logger['error'](_0x5d265c[_0x0137('0x35')]);if(_0x5d265c[_0x0137('0x36')]){delete _0x5d265c['name'];}_0x455275[_0x0137('0x26')](_0x2073e5)['send'](_0x5d265c);};}exports[_0x0137('0x37')]=function(_0x2847ac,_0x3227fd){var _0x4f3ab6={'include':[{'model':db[_0x0137('0x38')],'as':_0x0137('0x39')}]},_0x51c3c7={},_0x107236={'count':0x0,'rows':[]};var _0x269cb3=_['map'](db[_0x0137('0x3a')]['rawAttributes'],function(_0x32a41b){return{'name':_0x32a41b[_0x0137('0x3b')],'type':_0x32a41b['type'][_0x0137('0x3c')]};});_0x51c3c7[_0x0137('0x3d')]=_[_0x0137('0x3e')](_0x269cb3,_0x0137('0x36'));_0x51c3c7[_0x0137('0x3f')]=_[_0x0137('0x40')](_0x2847ac[_0x0137('0x3f')]);_0x51c3c7['filters']=_[_0x0137('0x41')](_0x51c3c7['model'],_0x51c3c7[_0x0137('0x3f')]);_0x4f3ab6['attributes']=_[_0x0137('0x41')](_0x51c3c7[_0x0137('0x3d')],qs[_0x0137('0x42')](_0x2847ac['query'][_0x0137('0x42')]));_0x4f3ab6[_0x0137('0x43')]=_0x4f3ab6['attributes']['length']?_0x4f3ab6['attributes']:_0x51c3c7[_0x0137('0x3d')];if(!_0x2847ac[_0x0137('0x3f')]['hasOwnProperty']('nolimit')){_0x4f3ab6[_0x0137('0x2c')]=qs[_0x0137('0x2c')](_0x2847ac[_0x0137('0x3f')][_0x0137('0x2c')]);_0x4f3ab6[_0x0137('0x29')]=qs[_0x0137('0x29')](_0x2847ac[_0x0137('0x3f')][_0x0137('0x29')]);}_0x4f3ab6[_0x0137('0x44')]=qs[_0x0137('0x45')](_0x2847ac['query'][_0x0137('0x45')]);_0x4f3ab6[_0x0137('0x46')]=qs[_0x0137('0x47')](_[_0x0137('0x48')](_0x2847ac[_0x0137('0x3f')],_0x51c3c7['filters']),_0x269cb3);if(_0x2847ac[_0x0137('0x3f')][_0x0137('0x49')]){_0x4f3ab6['where']=_[_0x0137('0x4a')](_0x4f3ab6['where'],{'$or':_[_0x0137('0x3e')](_0x269cb3,function(_0x3e465c){if(_0x3e465c[_0x0137('0x4b')]!=='VIRTUAL'){var _0x588db6={};_0x588db6[_0x3e465c[_0x0137('0x36')]]={'$like':'%'+_0x2847ac[_0x0137('0x3f')]['filter']+'%'};return _0x588db6;}})});}_0x4f3ab6=_[_0x0137('0x4a')]({},_0x4f3ab6,_0x2847ac[_0x0137('0x4c')]);var _0x440fab={'where':_0x4f3ab6['where']};return db[_0x0137('0x3a')][_0x0137('0x2b')](_0x440fab)[_0x0137('0x1c')](function(_0x11dc5c){_0x107236[_0x0137('0x2b')]=_0x11dc5c;if(_0x2847ac[_0x0137('0x3f')]['includeAll']){_0x4f3ab6[_0x0137('0x4d')]=[{'all':!![]}];}return db[_0x0137('0x3a')][_0x0137('0x4e')](_0x4f3ab6);})[_0x0137('0x1c')](function(_0x4a294b){_0x107236[_0x0137('0x4f')]=_0x4a294b;return _0x107236;})[_0x0137('0x1c')](respondWithFilteredResult(_0x3227fd,_0x4f3ab6))[_0x0137('0x50')](handleError(_0x3227fd,null));};exports['show']=function(_0x28bbc8,_0x508905){var _0x2d1d4a={'raw':![],'where':{'id':_0x28bbc8[_0x0137('0x51')]['id']},'include':[{'model':db[_0x0137('0x38')],'as':_0x0137('0x39')}]},_0x49dd07={};_0x49dd07[_0x0137('0x3d')]=_[_0x0137('0x40')](db[_0x0137('0x3a')][_0x0137('0x52')]);_0x49dd07[_0x0137('0x3f')]=_[_0x0137('0x40')](_0x28bbc8[_0x0137('0x3f')]);_0x49dd07[_0x0137('0x47')]=_[_0x0137('0x41')](_0x49dd07[_0x0137('0x3d')],_0x49dd07[_0x0137('0x3f')]);_0x2d1d4a[_0x0137('0x43')]=_[_0x0137('0x41')](_0x49dd07[_0x0137('0x3d')],qs[_0x0137('0x42')](_0x28bbc8['query'][_0x0137('0x42')]));_0x2d1d4a['attributes']=_0x2d1d4a['attributes']['length']?_0x2d1d4a[_0x0137('0x43')]:_0x49dd07[_0x0137('0x3d')];if(_0x28bbc8[_0x0137('0x3f')][_0x0137('0x53')]){_0x2d1d4a[_0x0137('0x4d')]=[{'all':!![]}];}_0x2d1d4a=_['merge']({},_0x2d1d4a,_0x28bbc8[_0x0137('0x4c')]);return db['OpenchannelAccount'][_0x0137('0x54')](_0x2d1d4a)[_0x0137('0x1c')](handleEntityNotFound(_0x508905,null))['then'](respondWithResult(_0x508905,null))[_0x0137('0x50')](handleError(_0x508905,null));};exports[_0x0137('0x55')]=function(_0x47d715,_0x53c471){return db[_0x0137('0x3a')][_0x0137('0x55')](_0x47d715[_0x0137('0x56')],{})[_0x0137('0x1c')](function(_0x31a166){var _0x1063d3=_0x47d715[_0x0137('0x57')][_0x0137('0x58')]({'plain':!![]});if(!_0x1063d3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1063d3[_0x0137('0x59')]===_0x0137('0x57')){var _0x354eeb=_0x31a166[_0x0137('0x58')]({'plain':!![]});var _0x52a7f9='OpenchannelAccounts';return db[_0x0137('0x5a')][_0x0137('0x54')]({'where':{'name':_0x52a7f9,'userProfileId':_0x1063d3[_0x0137('0x5b')]},'raw':!![]})['then'](function(_0x5678f3){if(_0x5678f3&&_0x5678f3['autoAssociation']===0x0){return db[_0x0137('0x33')][_0x0137('0x55')]({'name':_0x354eeb['name'],'resourceId':_0x354eeb['id'],'type':_0x5678f3[_0x0137('0x36')],'sectionId':_0x5678f3['id']},{})[_0x0137('0x1c')](function(){return _0x31a166;});}else{return _0x31a166;}})[_0x0137('0x50')](function(_0x358229){logger[_0x0137('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x358229);throw _0x358229;});}return _0x31a166;})[_0x0137('0x1c')](respondWithResult(_0x53c471,0xc9))['catch'](handleError(_0x53c471,null));};exports[_0x0137('0x30')]=function(_0x71d27f,_0x3cacbf){if(_0x71d27f[_0x0137('0x56')]['id']){delete _0x71d27f[_0x0137('0x56')]['id'];}return db[_0x0137('0x3a')]['find']({'where':{'id':_0x71d27f[_0x0137('0x51')]['id']},'include':[{'model':db[_0x0137('0x38')],'as':_0x0137('0x39')}]})[_0x0137('0x1c')](handleEntityNotFound(_0x3cacbf,null))[_0x0137('0x1c')](saveUpdates(_0x71d27f[_0x0137('0x56')],null))[_0x0137('0x1c')](respondWithResult(_0x3cacbf,null))[_0x0137('0x50')](handleError(_0x3cacbf,null));};exports['destroy']=function(_0x24dbac,_0x36ba5e){return db[_0x0137('0x3a')][_0x0137('0x54')]({'where':{'id':_0x24dbac[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x36ba5e,null))[_0x0137('0x1c')](removeEntity(_0x36ba5e,null))[_0x0137('0x50')](handleError(_0x36ba5e,null));};exports[_0x0137('0x5c')]=function(_0x253297,_0x50704a){return db[_0x0137('0x3a')][_0x0137('0x5c')]()[_0x0137('0x1c')](respondWithResult(_0x50704a,null))[_0x0137('0x50')](handleError(_0x50704a,null));};exports[_0x0137('0x5d')]=function(_0x590fac,_0x21dc31,_0x1bf1fe){if(_0x590fac[_0x0137('0x56')]['id']){delete _0x590fac['body']['id'];}return db[_0x0137('0x3a')][_0x0137('0x54')]({'where':{'id':_0x590fac[_0x0137('0x51')]['id']}})['then'](handleEntityNotFound(_0x21dc31,null))[_0x0137('0x1c')](function(_0x3367a1){if(_0x3367a1){_0x590fac[_0x0137('0x56')][_0x0137('0x5e')]=_0x3367a1['id'];return db[_0x0137('0x5f')][_0x0137('0x55')](_0x590fac[_0x0137('0x56')]);}})[_0x0137('0x1c')](respondWithResult(_0x21dc31,null))[_0x0137('0x50')](handleError(_0x21dc31,null));};exports[_0x0137('0x60')]=function(_0x450ccd,_0x18123e,_0x3c1bb9){var _0x56f9f6={'raw':![],'where':{}};var _0x1ad9a0={};var _0x4436cd={'count':0x0,'rows':[]};return db[_0x0137('0x3a')]['findOne']({'where':{'id':_0x450ccd[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x18123e,null))[_0x0137('0x1c')](function(_0x395b07){if(_0x395b07){_0x1ad9a0[_0x0137('0x3d')]=_[_0x0137('0x40')](db['Disposition'][_0x0137('0x52')]);_0x1ad9a0[_0x0137('0x3f')]=_[_0x0137('0x40')](_0x450ccd[_0x0137('0x3f')]);_0x1ad9a0['filters']=_['intersection'](_0x1ad9a0['model'],_0x1ad9a0['query']);_0x56f9f6['attributes']=_['intersection'](_0x1ad9a0[_0x0137('0x3d')],qs[_0x0137('0x42')](_0x450ccd[_0x0137('0x3f')][_0x0137('0x42')]));_0x56f9f6[_0x0137('0x43')]=_0x56f9f6[_0x0137('0x43')][_0x0137('0x61')]?_0x56f9f6[_0x0137('0x43')]:_0x1ad9a0[_0x0137('0x3d')];if(!_0x450ccd[_0x0137('0x3f')][_0x0137('0x62')]('nolimit')){_0x56f9f6[_0x0137('0x2c')]=qs['limit'](_0x450ccd[_0x0137('0x3f')][_0x0137('0x2c')]);_0x56f9f6[_0x0137('0x29')]=qs[_0x0137('0x29')](_0x450ccd[_0x0137('0x3f')][_0x0137('0x29')]);}_0x56f9f6['order']=qs[_0x0137('0x45')](_0x450ccd[_0x0137('0x3f')][_0x0137('0x45')]);_0x56f9f6[_0x0137('0x46')]=qs[_0x0137('0x47')](_[_0x0137('0x48')](_0x450ccd[_0x0137('0x3f')],_0x1ad9a0[_0x0137('0x47')]));_0x56f9f6[_0x0137('0x46')]['OpenchannelAccountId']=_0x395b07['id'];if(_0x450ccd[_0x0137('0x3f')][_0x0137('0x49')]){_0x56f9f6[_0x0137('0x46')]=_[_0x0137('0x4a')](_0x56f9f6['where'],{'$or':_['map'](_0x56f9f6[_0x0137('0x43')],function(_0x551b35){var _0x308c4f={};_0x308c4f[_0x551b35]={'$like':'%'+_0x450ccd[_0x0137('0x3f')][_0x0137('0x49')]+'%'};return _0x308c4f;})});}_0x56f9f6=_[_0x0137('0x4a')]({},_0x56f9f6,_0x450ccd[_0x0137('0x4c')]);return db[_0x0137('0x5f')]['count']({'where':_0x56f9f6[_0x0137('0x46')]})['then'](function(_0x38ca66){_0x4436cd[_0x0137('0x2b')]=_0x38ca66;if(_0x450ccd['query'][_0x0137('0x53')]){_0x56f9f6['include']=[{'all':!![]}];}return db[_0x0137('0x5f')][_0x0137('0x4e')](_0x56f9f6);})[_0x0137('0x1c')](function(_0x14bc3f){_0x4436cd[_0x0137('0x4f')]=_0x14bc3f;return _0x4436cd;});}})[_0x0137('0x1c')](respondWithFilteredResult(_0x18123e,_0x56f9f6))[_0x0137('0x50')](handleError(_0x18123e,null));};exports['removeDispositions']=function(_0x3796d4,_0x46c9ff,_0x189de6){return db['OpenchannelAccount'][_0x0137('0x54')]({'where':{'id':_0x3796d4[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x46c9ff,null))[_0x0137('0x1c')](function(_0x398bb9){if(_0x398bb9){return _0x398bb9[_0x0137('0x63')](_0x3796d4[_0x0137('0x3f')][_0x0137('0x64')]);}})[_0x0137('0x1c')](respondWithStatusCode(_0x46c9ff,null))[_0x0137('0x50')](handleError(_0x46c9ff,null));};exports[_0x0137('0x65')]=function(_0x533d6a,_0x3b4131,_0x2b8211){if(_0x533d6a['body']['id']){delete _0x533d6a[_0x0137('0x56')]['id'];}return db[_0x0137('0x3a')]['find']({'where':{'id':_0x533d6a[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x3b4131,null))['then'](function(_0x3db142){if(_0x3db142){_0x533d6a[_0x0137('0x56')][_0x0137('0x5e')]=_0x3db142['id'];return db[_0x0137('0x66')][_0x0137('0x55')](_0x533d6a['body']);}})[_0x0137('0x1c')](respondWithResult(_0x3b4131,null))[_0x0137('0x50')](handleError(_0x3b4131,null));};exports[_0x0137('0x67')]=function(_0x1efa89,_0x242496,_0x32c2f5){var _0x5183c6={'raw':![],'where':{}};var _0x3b8ea5={};var _0x438300={'count':0x0,'rows':[]};return db[_0x0137('0x3a')][_0x0137('0x68')]({'where':{'id':_0x1efa89[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x242496,null))[_0x0137('0x1c')](function(_0x22715e){if(_0x22715e){_0x3b8ea5[_0x0137('0x3d')]=_[_0x0137('0x40')](db[_0x0137('0x66')][_0x0137('0x52')]);_0x3b8ea5[_0x0137('0x3f')]=_['keys'](_0x1efa89['query']);_0x3b8ea5[_0x0137('0x47')]=_[_0x0137('0x41')](_0x3b8ea5[_0x0137('0x3d')],_0x3b8ea5['query']);_0x5183c6['attributes']=_[_0x0137('0x41')](_0x3b8ea5['model'],qs['fields'](_0x1efa89['query'][_0x0137('0x42')]));_0x5183c6[_0x0137('0x43')]=_0x5183c6[_0x0137('0x43')][_0x0137('0x61')]?_0x5183c6['attributes']:_0x3b8ea5[_0x0137('0x3d')];if(!_0x1efa89['query']['hasOwnProperty']('nolimit')){_0x5183c6[_0x0137('0x2c')]=qs['limit'](_0x1efa89[_0x0137('0x3f')][_0x0137('0x2c')]);_0x5183c6['offset']=qs[_0x0137('0x29')](_0x1efa89[_0x0137('0x3f')][_0x0137('0x29')]);}_0x5183c6[_0x0137('0x44')]=qs[_0x0137('0x45')](_0x1efa89[_0x0137('0x3f')][_0x0137('0x45')]);_0x5183c6['where']=qs['filters'](_[_0x0137('0x48')](_0x1efa89['query'],_0x3b8ea5['filters']));_0x5183c6[_0x0137('0x46')][_0x0137('0x5e')]=_0x22715e['id'];if(_0x1efa89[_0x0137('0x3f')][_0x0137('0x49')]){_0x5183c6[_0x0137('0x46')]=_[_0x0137('0x4a')](_0x5183c6[_0x0137('0x46')],{'$or':_[_0x0137('0x3e')](_0x5183c6[_0x0137('0x43')],function(_0x52ffd3){var _0x3b7390={};_0x3b7390[_0x52ffd3]={'$like':'%'+_0x1efa89[_0x0137('0x3f')][_0x0137('0x49')]+'%'};return _0x3b7390;})});}_0x5183c6=_[_0x0137('0x4a')]({},_0x5183c6,_0x1efa89[_0x0137('0x4c')]);return db[_0x0137('0x66')][_0x0137('0x2b')]({'where':_0x5183c6[_0x0137('0x46')]})[_0x0137('0x1c')](function(_0x53c997){_0x438300['count']=_0x53c997;if(_0x1efa89[_0x0137('0x3f')][_0x0137('0x53')]){_0x5183c6[_0x0137('0x4d')]=[{'all':!![]}];}return db[_0x0137('0x66')][_0x0137('0x4e')](_0x5183c6);})[_0x0137('0x1c')](function(_0x2fd7a){_0x438300['rows']=_0x2fd7a;return _0x438300;});}})['then'](respondWithFilteredResult(_0x242496,_0x5183c6))['catch'](handleError(_0x242496,null));};exports[_0x0137('0x69')]=function(_0x2bcbd5,_0x14d884,_0x33f5a7){return db[_0x0137('0x3a')][_0x0137('0x54')]({'where':{'id':_0x2bcbd5[_0x0137('0x51')]['id']}})['then'](handleEntityNotFound(_0x14d884,null))[_0x0137('0x1c')](function(_0x1a67cf){if(_0x1a67cf){return _0x1a67cf[_0x0137('0x69')](_0x2bcbd5[_0x0137('0x3f')][_0x0137('0x64')]);}})['then'](respondWithStatusCode(_0x14d884,null))[_0x0137('0x50')](handleError(_0x14d884,null));};exports['notify']=function(_0x244c92,_0x3b5eac,_0x336a9b){var _0x28dd89={'body':_0x244c92[_0x0137('0x56')],'channel':_0x0137('0x6a')};var _0xcb9d4e=[];var _0x3d57c6=[];var _0x4f66ba={};var _0x20cd84=![];return db[_0x0137('0x6b')][_0x0137('0x5c')]()[_0x0137('0x1c')](function(_0x4a76c1){if(!_0x4a76c1){throw new db[(_0x0137('0x6c'))]['ValidationError']('no\x20available\x20attributes');}_0xcb9d4e=_['difference'](_[_0x0137('0x40')](_0x4a76c1),[_0x0137('0x6d'),_0x0137('0x6e')]);_0x3d57c6=_[_0x0137('0x6f')](_[_0x0137('0x40')](_0x4a76c1),[_0x0137('0x6d'),'updatedAt','CompanyId',_0x0137('0x70')]);if(_0x244c92[_0x0137('0x56')]['id']){delete _0x244c92['body']['id'];}if(_[_0x0137('0x71')](_0x244c92[_0x0137('0x56')]['from'])){throw new db['Sequelize']['ValidationError'](_0x0137('0x72'));}if(_['isNil'](_0x244c92['body'][_0x0137('0x56')])||_0x244c92[_0x0137('0x56')][_0x0137('0x56')]===''){throw new db[(_0x0137('0x6c'))][(_0x0137('0x73'))](_0x0137('0x74'));}if(_['isNil'](_0x244c92['body'][_0x0137('0x75')])){throw new db[(_0x0137('0x6c'))][(_0x0137('0x73'))](_0x0137('0x76')+_0x3d57c6);}if(!_[_0x0137('0x77')](_0x3d57c6,_0x244c92['body'][_0x0137('0x75')])){throw new db[(_0x0137('0x6c'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3d57c6);}_0x4f66ba[_0x244c92['body'][_0x0137('0x75')]]=_0x244c92[_0x0137('0x56')][_0x0137('0x78')];})[_0x0137('0x1c')](function(){return db['OpenchannelAccount']['find']({'where':{'id':_0x244c92['params']['id']},'include':[{'model':db[_0x0137('0x79')],'as':_0x0137('0x7a'),'include':[{'model':db[_0x0137('0x6b')],'as':_0x0137('0x7b'),'where':_0x4f66ba,'limit':0x1,'order':[[_0x0137('0x6e'),_0x0137('0x7c')]]}]},{'model':db[_0x0137('0x7d')],'as':_0x0137('0x7e')}]});})[_0x0137('0x1c')](handleEntityNotFound(_0x3b5eac,null))[_0x0137('0x1c')](function(_0x4b2800){if(_0x4b2800&&_0x4b2800[_0x0137('0x7a')]){_0x28dd89['account']=_0x4b2800;_0x28dd89['applications']=_0x4b2800['Applications'];_0x28dd89[_0x0137('0x7f')]=_0x4b2800[_0x0137('0x7a')];_0x28dd89[_0x0137('0x80')]=_[_0x0137('0x81')](_0x28dd89['applications'],[_0x0137('0x82')],[_0x0137('0x83')]);if(_0x28dd89[_0x0137('0x84')][_0x0137('0x7e')]){delete _0x28dd89['account'][_0x0137('0x7e')];}if(_0x28dd89[_0x0137('0x84')][_0x0137('0x7a')]&&_0x28dd89[_0x0137('0x84')][_0x0137('0x7a')][_0x0137('0x7b')][_0x0137('0x61')]){return _0x28dd89[_0x0137('0x84')][_0x0137('0x7a')][_0x0137('0x7b')][0x0];}var _0x37c2ff=_[_0x0137('0x14')](_0x244c92[_0x0137('0x56')],{'firstName':_0x244c92['body'][_0x0137('0x78')],'ListId':_0x4b2800[_0x0137('0x70')]});_0x37c2ff[_0x244c92['body'][_0x0137('0x75')]]=_0x244c92[_0x0137('0x56')]['from'];return db['CmContact'][_0x0137('0x55')](_0x37c2ff,{'fields':_0xcb9d4e,'raw':!![]});}})['then'](handleEntityNotFound(_0x3b5eac,null))[_0x0137('0x1c')](function(_0x4e67ad){_0x28dd89[_0x0137('0x85')]=_0x4e67ad;if(_0x4e67ad){var _0x5b7e4a={'ContactId':_0x4e67ad['id'],'OpenchannelAccountId':_0x244c92[_0x0137('0x51')]['id'],'from':(_0x4e67ad[_0x0137('0x86')]||'')+'\x20'+(_0x4e67ad[_0x0137('0x87')]||'')};var _0x2706a0={'OpenchannelAccountId':_0x244c92[_0x0137('0x51')]['id'],'closed':![]};if(_0x244c92['body'][_0x0137('0x88')]){_0x2706a0[_0x0137('0x88')]=_0x244c92[_0x0137('0x56')]['threadId'];return db[_0x0137('0x89')][_0x0137('0x54')]({'where':_0x2706a0})[_0x0137('0x1c')](function(_0x1e4677){if(_0x1e4677){return[_0x1e4677,![]];}_0x5b7e4a['threadId']=_0x244c92[_0x0137('0x56')][_0x0137('0x88')];_0x5b7e4a[_0x0137('0x8a')]=_0x244c92['body'][_0x0137('0x8a')];return db['OpenchannelInteraction'][_0x0137('0x55')](_0x5b7e4a)[_0x0137('0x1c')](function(_0x280187){return[_0x280187,!![]];});});}else{_0x2706a0['threadId']=null;}_0x2706a0[_0x0137('0x8b')]=_0x4e67ad['id'];return db[_0x0137('0x89')]['find']({'where':_0x2706a0})[_0x0137('0x1c')](function(_0x31e884){if(_0x31e884){return[_0x31e884,![]];}return db['OpenchannelInteraction'][_0x0137('0x55')](_0x5b7e4a)[_0x0137('0x1c')](function(_0x1f761a){return[_0x1f761a,!![]];});});}})[_0x0137('0x8c')](function(_0x22aac3,_0x17b1f4){if(_0x22aac3){_0x20cd84=_0x17b1f4;if(!_0x17b1f4){var _0x4e821a={'from':(_0x28dd89[_0x0137('0x85')][_0x0137('0x86')]||'')+'\x20'+(_0x28dd89[_0x0137('0x85')][_0x0137('0x87')]||'')};if(_0x244c92['body'][_0x0137('0x88')]&&_0x244c92[_0x0137('0x56')][_0x0137('0x8d')]&&_0x244c92[_0x0137('0x56')][_0x0137('0x88')]!=_0x244c92[_0x0137('0x56')][_0x0137('0x8d')]){_0x4e821a[_0x0137('0x88')]=_0x244c92[_0x0137('0x56')][_0x0137('0x8d')];}return _0x22aac3['update'](_0x4e821a);}else{return _0x22aac3;}}})['then'](function(_0x1cce6f){_0x28dd89[_0x0137('0x8e')]=_0x1cce6f[_0x0137('0x58')]({'plain':!![]});_0x28dd89['interaction'][_0x0137('0x8f')]=_0x20cd84;if(_0x28dd89[_0x0137('0x8e')][_0x0137('0x8f')]){if(_0x28dd89[_0x0137('0x84')][_0x0137('0x90')]){_0x28dd89['applications'][_0x0137('0x91')]({'id':0x0,'priority':_0x28dd89['applications']['length']+0x1,'app':_0x0137('0x92'),'appdata':_0x0137('0x93'),'interval':_0x0137('0x94')});}}return db['OpenchannelMessage'][_0x0137('0x55')]({'body':_0x244c92[_0x0137('0x56')][_0x0137('0x56')],'OpenchannelAccountId':_0x244c92['params']['id'],'OpenchannelInteractionId':_0x1cce6f['id'],'direction':'in','ContactId':_0x28dd89[_0x0137('0x85')]['id'],'AttachmentId':_0x244c92['body'][_0x0137('0x95')]});})[_0x0137('0x1c')](function(_0x2cd44a){_0x28dd89['message']=_0x2cd44a;if(_0x28dd89[_0x0137('0x8e')][_0x0137('0x96')]){return db[_0x0137('0x97')]['find']({'attributes':['id',_0x0137('0x36')],'where':{'id':_0x28dd89[_0x0137('0x8e')]['UserId']}})[_0x0137('0x1c')](function(_0x200ad3){if(_0x200ad3){_0x28dd89['applications'][_0x0137('0x98')]({'id':0x0,'priority':0x0,'app':_0x0137('0x99'),'appdata':_0x200ad3[_0x0137('0x36')]+','+(_0x28dd89['account'][_0x0137('0x9a')]||0xa),'interval':_0x0137('0x94')});_0x28dd89[_0x0137('0x9b')]=![];}return respondWithRpcPromise(_0x0137('0x9c'),_0x0137('0x9d'),_0x28dd89);});}return respondWithRpcPromise(_0x0137('0x9c'),_0x0137('0x9d'),_0x28dd89);})[_0x0137('0x1c')](function(_0x49c9f5){respondWithRpcPromise('EventManager',_0x0137('0x9e'),{'event':_0x0137('0x9f'),'message':_0x49c9f5},client9002);return _0x49c9f5;})[_0x0137('0x1c')](respondWithResult(_0x3b5eac,null))[_0x0137('0x50')](handleError(_0x3b5eac,null));};exports[_0x0137('0xa0')]=function(_0x21d2d8,_0x2c6be7){var _0x48593d=_0x21d2d8['params']['id'];var _0x23fa38=_0x21d2d8['body'];var _0x1cb117=0xc8;var _0x38956c=null;return db['sequelize'][_0x0137('0xa1')]({'isolationLevel':db[_0x0137('0xa2')][_0x0137('0xa3')]['ISOLATION_LEVELS'][_0x0137('0xa4')]},function(_0x4fbcef){return db['OpenchannelAccount'][_0x0137('0x68')]({'where':{'id':_0x48593d},'transaction':_0x4fbcef})[_0x0137('0x1c')](function(_0x1117da){if(_0x1117da){return db[_0x0137('0x7d')][_0x0137('0x31')]({'where':{'OpenchannelAccountId':_0x48593d},'transaction':_0x4fbcef})['then'](function(){var _0x478dd8=_[_0x0137('0x3e')](_0x23fa38,function(_0x5cd873){_0x5cd873['OpenchannelAccountId']=_0x48593d;return _0x5cd873;});return db[_0x0137('0x7d')]['bulkCreate'](_0x478dd8,{'transaction':_0x4fbcef});});}else{_0x1cb117=0x194;_0x38956c=[];}});})[_0x0137('0x1c')](function(){if(_0x1cb117!==0x194){return db[_0x0137('0x7d')][_0x0137('0xa5')]({'where':{'OpenchannelAccountId':_0x48593d},'order':_0x0137('0x82')})['then'](function(_0x103d45){_0x38956c=_0x103d45;});}})[_0x0137('0x50')](function(_0x172900){_0x1cb117=0x1f4;logger['error'](_0x172900[_0x0137('0x35')]);if(_0x172900[_0x0137('0x36')]){delete _0x172900[_0x0137('0x36')];}_0x38956c=_0x172900;})[_0x0137('0xa6')](function(){if(_0x38956c===null){_0x2c6be7['sendStatus'](_0x1cb117);}else{if(_0x1cb117===0x1f4){_0x2c6be7[_0x0137('0x26')](_0x1cb117)['send'](_0x38956c);}else{_0x2c6be7[_0x0137('0x26')](_0x1cb117)[_0x0137('0x28')](_0x38956c);}}});};exports[_0x0137('0xa7')]=function(_0x2ec009,_0x2339a1,_0x41af43){var _0x1d5f1a={};var _0x3cacbd={};var _0x478e76;var _0xfa3fc8;return db[_0x0137('0x3a')][_0x0137('0x68')]({'where':{'id':_0x2ec009[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x2339a1,null))[_0x0137('0x1c')](function(_0x3f44f8){if(_0x3f44f8){_0x478e76=_0x3f44f8;_0x3cacbd[_0x0137('0x3d')]=_[_0x0137('0x40')](db[_0x0137('0x7d')][_0x0137('0x52')]);_0x3cacbd[_0x0137('0x3f')]=_[_0x0137('0x40')](_0x2ec009['query']);_0x3cacbd['filters']=_[_0x0137('0x41')](_0x3cacbd[_0x0137('0x3d')],_0x3cacbd[_0x0137('0x3f')]);_0x1d5f1a[_0x0137('0x43')]=_['intersection'](_0x3cacbd['model'],qs[_0x0137('0x42')](_0x2ec009['query'][_0x0137('0x42')]));_0x1d5f1a['attributes']=_0x1d5f1a[_0x0137('0x43')][_0x0137('0x61')]?_0x1d5f1a['attributes']:_0x3cacbd['model'];_0x1d5f1a[_0x0137('0x44')]=qs[_0x0137('0x45')](_0x2ec009[_0x0137('0x3f')][_0x0137('0x45')]);_0x1d5f1a[_0x0137('0x46')]=qs[_0x0137('0x47')](_['pick'](_0x2ec009[_0x0137('0x3f')],_0x3cacbd['filters']));if(_0x2ec009['query']['filter']){_0x1d5f1a[_0x0137('0x46')]=_[_0x0137('0x4a')](_0x1d5f1a['where'],{'$or':_[_0x0137('0x3e')](_0x1d5f1a[_0x0137('0x43')],function(_0x315e51){var _0x2e8ede={};_0x2e8ede[_0x315e51]={'$like':'%'+_0x2ec009[_0x0137('0x3f')]['filter']+'%'};return _0x2e8ede;})});}_0x1d5f1a=_[_0x0137('0x4a')]({},_0x1d5f1a,_0x2ec009[_0x0137('0x4c')]);return _0x478e76[_0x0137('0xa7')](_0x1d5f1a);}})['then'](function(_0x5f3243){if(_0x5f3243){_0xfa3fc8=_0x5f3243[_0x0137('0x61')];if(!_0x2ec009[_0x0137('0x3f')]['hasOwnProperty'](_0x0137('0xa8'))){_0x1d5f1a['limit']=qs[_0x0137('0x2c')](_0x2ec009[_0x0137('0x3f')][_0x0137('0x2c')]);_0x1d5f1a[_0x0137('0x29')]=qs['offset'](_0x2ec009[_0x0137('0x3f')]['offset']);}return _0x478e76[_0x0137('0xa7')](_0x1d5f1a);}})[_0x0137('0x1c')](function(_0x176c92){if(_0x176c92){return _0x176c92?{'count':_0xfa3fc8,'rows':_0x176c92}:null;}})['then'](respondWithResult(_0x2339a1,null))[_0x0137('0x50')](handleError(_0x2339a1,null));};exports[_0x0137('0xa9')]=function(_0x388790,_0x52801e,_0x3736c1){var _0x55b98a={'raw':![],'where':{}};var _0x933119={};var _0x31cb33={'count':0x0,'rows':[]};return db[_0x0137('0x3a')][_0x0137('0x68')]({'where':{'id':_0x388790[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x52801e,null))[_0x0137('0x1c')](function(_0x47dd0b){if(_0x47dd0b){_0x933119[_0x0137('0x3d')]=_['keys'](db[_0x0137('0x89')][_0x0137('0x52')]);_0x933119['query']=_[_0x0137('0x40')](_0x388790[_0x0137('0x3f')]);_0x933119[_0x0137('0x47')]=_[_0x0137('0x41')](_0x933119[_0x0137('0x3d')],_0x933119[_0x0137('0x3f')]);_0x55b98a[_0x0137('0x43')]=_[_0x0137('0x41')](_0x933119[_0x0137('0x3d')],qs['fields'](_0x388790['query']['fields']));_0x55b98a['attributes']=_0x55b98a[_0x0137('0x43')][_0x0137('0x61')]?_0x55b98a[_0x0137('0x43')]:_0x933119[_0x0137('0x3d')];if(!_0x388790[_0x0137('0x3f')][_0x0137('0x62')]('nolimit')){_0x55b98a['limit']=qs['limit'](_0x388790[_0x0137('0x3f')][_0x0137('0x2c')]);_0x55b98a['offset']=qs[_0x0137('0x29')](_0x388790[_0x0137('0x3f')][_0x0137('0x29')]);}_0x55b98a[_0x0137('0x44')]=qs['sort'](_0x388790[_0x0137('0x3f')][_0x0137('0x45')]);_0x55b98a['where']=qs[_0x0137('0x47')](_['pick'](_0x388790[_0x0137('0x3f')],_0x933119[_0x0137('0x47')]));_0x55b98a['where']['OpenchannelAccountId']=_0x47dd0b['id'];if(_0x388790[_0x0137('0x3f')]['filter']){_0x55b98a['where']=_[_0x0137('0x4a')](_0x55b98a[_0x0137('0x46')],{'$or':_[_0x0137('0x3e')](_0x55b98a['attributes'],function(_0x8c6d8a){var _0x535c42={};_0x535c42[_0x8c6d8a]={'$like':'%'+_0x388790['query'][_0x0137('0x49')]+'%'};return _0x535c42;})});}_0x55b98a=_[_0x0137('0x4a')]({},_0x55b98a,_0x388790['options']);return db['OpenchannelInteraction'][_0x0137('0x2b')]({'where':_0x55b98a['where']})[_0x0137('0x1c')](function(_0x319f3b){_0x31cb33[_0x0137('0x2b')]=_0x319f3b;if(_0x388790[_0x0137('0x3f')]['includeAll']){_0x55b98a['include']=[{'model':db[_0x0137('0x6b')],'as':_0x0137('0xaa'),'required':![]},{'model':db[_0x0137('0x97')],'as':_0x0137('0xab'),'attributes':[_0x0137('0x36'),_0x0137('0xac'),_0x0137('0xad')],'required':![]},{'model':db[_0x0137('0xae')],'as':'Tags','attributes':['id',_0x0137('0x36'),_0x0137('0xaf')],'where':_0x388790[_0x0137('0x3f')][_0x0137('0xb0')]?{'id':_0x388790[_0x0137('0x3f')][_0x0137('0xb0')]}:undefined,'required':_0x388790[_0x0137('0x3f')][_0x0137('0xb0')]?!![]:![]}];}return db[_0x0137('0x89')][_0x0137('0x4e')](_0x55b98a);})['then'](function(_0x3dd055){_0x31cb33[_0x0137('0x4f')]=_0x3dd055;return _0x31cb33;});}})[_0x0137('0x1c')](respondWithFilteredResult(_0x52801e,_0x55b98a))['catch'](handleError(_0x52801e,null));};exports[_0x0137('0xb1')]=function(_0x5e80ff,_0x49ddce,_0x1d7bc2){return db['OpenchannelAccount'][_0x0137('0x54')]({'where':{'id':_0x5e80ff[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x49ddce,null))[_0x0137('0x1c')](function(_0x2bfbac){if(_0x2bfbac){return _0x2bfbac[_0x0137('0xb1')](_0x5e80ff['body'][_0x0137('0x64')],_[_0x0137('0xb2')](_0x5e80ff[_0x0137('0x56')],[_0x0137('0x64'),'id'])||{})[_0x0137('0x8c')](function(_0x127f22){for(var _0x4dec0f=0x0;_0x4dec0f<_0x5e80ff['body']['ids'][_0x0137('0x61')];_0x4dec0f+=0x1){socket[_0x0137('0xb3')](_0x0137('0xb4'),{'UserId':Number(_0x5e80ff[_0x0137('0x56')][_0x0137('0x64')][_0x4dec0f]),'OpenchannelAccountId':Number(_0x5e80ff[_0x0137('0x51')]['id'])});}return _0x127f22;});}})['then'](respondWithResult(_0x49ddce,null))[_0x0137('0x50')](handleError(_0x49ddce,null));};exports['removeAgents']=function(_0x12fe4c,_0x5661f4,_0x3373b0){return db[_0x0137('0x3a')][_0x0137('0x54')]({'where':{'id':_0x12fe4c['params']['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x5661f4,null))[_0x0137('0x1c')](function(_0x57fe56){if(_0x57fe56){return _0x57fe56['removeAgents'](_0x12fe4c[_0x0137('0x3f')]['ids'])['then'](function(){if(_['isArray'](_0x12fe4c[_0x0137('0x3f')][_0x0137('0x64')])){for(var _0x29fb21=0x0;_0x29fb21<_0x12fe4c[_0x0137('0x3f')][_0x0137('0x64')][_0x0137('0x61')];_0x29fb21+=0x1){socket['emit'](_0x0137('0xb5'),{'UserId':Number(_0x12fe4c[_0x0137('0x3f')]['ids'][_0x29fb21]),'OpenchannelAccountId':Number(_0x12fe4c['params']['id'])});}}else{socket[_0x0137('0xb3')](_0x0137('0xb5'),{'UserId':Number(_0x12fe4c['query'][_0x0137('0x64')]),'OpenchannelAccountId':Number(_0x12fe4c[_0x0137('0x51')]['id'])});}});}})[_0x0137('0x1c')](respondWithStatusCode(_0x5661f4,null))[_0x0137('0x50')](handleError(_0x5661f4,null));};exports['getAgents']=function(_0x2f1462,_0xbeee55,_0x237947){var _0x4b10b8={};var _0x2dfdd9={};var _0x260169;var _0x820d26;return db['OpenchannelAccount'][_0x0137('0x68')]({'where':{'id':_0x2f1462[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0xbeee55,null))[_0x0137('0x1c')](function(_0x283620){if(_0x283620){_0x260169=_0x283620;_0x2dfdd9[_0x0137('0x3d')]=_[_0x0137('0x40')](db[_0x0137('0x97')][_0x0137('0x52')]);_0x2dfdd9[_0x0137('0x3f')]=_['keys'](_0x2f1462[_0x0137('0x3f')]);_0x2dfdd9[_0x0137('0x47')]=_[_0x0137('0x41')](_0x2dfdd9[_0x0137('0x3d')],_0x2dfdd9[_0x0137('0x3f')]);_0x4b10b8[_0x0137('0x43')]=_[_0x0137('0x41')](_0x2dfdd9[_0x0137('0x3d')],qs[_0x0137('0x42')](_0x2f1462[_0x0137('0x3f')][_0x0137('0x42')]));_0x4b10b8['attributes']=_0x4b10b8['attributes']['length']?_0x4b10b8[_0x0137('0x43')]:_0x2dfdd9['model'];_0x4b10b8[_0x0137('0x44')]=qs['sort'](_0x2f1462[_0x0137('0x3f')][_0x0137('0x45')]);_0x4b10b8[_0x0137('0x46')]=qs[_0x0137('0x47')](_[_0x0137('0x48')](_0x2f1462[_0x0137('0x3f')],_0x2dfdd9['filters']));if(_0x2f1462[_0x0137('0x3f')]['filter']){_0x4b10b8[_0x0137('0x46')]=_[_0x0137('0x4a')](_0x4b10b8[_0x0137('0x46')],{'$or':_['map'](_0x4b10b8[_0x0137('0x43')],function(_0x2bf34c){var _0x35e278={};_0x35e278[_0x2bf34c]={'$like':'%'+_0x2f1462[_0x0137('0x3f')][_0x0137('0x49')]+'%'};return _0x35e278;})});}_0x4b10b8=_[_0x0137('0x4a')]({},_0x4b10b8,_0x2f1462[_0x0137('0x4c')]);return _0x260169['getAgents'](_0x4b10b8);}})[_0x0137('0x1c')](function(_0xdb4619){if(_0xdb4619){_0x820d26=_0xdb4619[_0x0137('0x61')];if(!_0x2f1462[_0x0137('0x3f')][_0x0137('0x62')](_0x0137('0xa8'))){_0x4b10b8[_0x0137('0x2c')]=qs[_0x0137('0x2c')](_0x2f1462[_0x0137('0x3f')][_0x0137('0x2c')]);_0x4b10b8['offset']=qs[_0x0137('0x29')](_0x2f1462[_0x0137('0x3f')]['offset']);}return _0x260169[_0x0137('0xb6')](_0x4b10b8);}})[_0x0137('0x1c')](function(_0x1f57e5){if(_0x1f57e5){return _0x1f57e5?{'count':_0x820d26,'rows':_0x1f57e5}:null;}})['then'](respondWithResult(_0xbeee55,null))['catch'](handleError(_0xbeee55,null));};exports[_0x0137('0xb7')]=function(_0x67eeae,_0x188259,_0x43b3de){var _0x594265,_0x45d8aa,_0x124511;if(_[_0x0137('0x71')](_0x67eeae[_0x0137('0x56')][_0x0137('0x56')])||_0x67eeae['body'][_0x0137('0x56')]===''){throw new db[(_0x0137('0x6c'))][(_0x0137('0x73'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0137('0x71')](_0x67eeae[_0x0137('0x56')]['to'])){}_0x594265=_0x67eeae[_0x0137('0x56')]['to'];return db[_0x0137('0x3a')][_0x0137('0x68')]({'where':{'id':_0x67eeae[_0x0137('0x51')]['id']}})[_0x0137('0x1c')](handleEntityNotFound(_0x188259,null))[_0x0137('0x1c')](function(_0x3d9f5a){if(_0x3d9f5a){return db['OpenchannelAccount']['find']({'where':{'id':_0x3d9f5a['id']},'include':[{'model':db[_0x0137('0x79')],'as':_0x0137('0x7a'),'include':[{'model':db[_0x0137('0x6b')],'as':'Contacts','where':{[_0x3d9f5a[_0x0137('0x75')]]:_0x594265},'limit':0x1,'order':[[_0x0137('0x6e'),_0x0137('0x7c')]]}]}]})[_0x0137('0x1c')](handleEntityNotFound(_0x188259,null))[_0x0137('0x1c')](function(_0x8032a6){if(_0x8032a6&&_0x8032a6[_0x0137('0x7a')]){_0x45d8aa=_0x8032a6[_0x0137('0x58')]({'plain':!![]});if(_0x45d8aa['List']&&_0x45d8aa[_0x0137('0x7a')]['Contacts']['length']){return _0x45d8aa[_0x0137('0x7a')][_0x0137('0x7b')][0x0];}return db[_0x0137('0x6b')][_0x0137('0x55')](_[_0x0137('0x14')](_0x67eeae[_0x0137('0x56')],{'firstName':_0x594265,[_0x8032a6['mapKey']]:_0x594265,'phone':_0x594265,'ListId':_0x45d8aa['ListId']}));}})['then'](handleEntityNotFound(_0x188259,null))[_0x0137('0x1c')](function(_0x229531){if(_0x229531){_0x124511=_0x229531;return db[_0x0137('0x89')][_0x0137('0x54')]({'where':{'ContactId':_0x124511['id'],'closed':![],'OpenchannelAccountId':_0x45d8aa['id']}})[_0x0137('0x1c')](function(_0x236e94){if(_0x236e94){return[_0x236e94,![]];}return db[_0x0137('0x89')]['create']({'UserId':_0x67eeae[_0x0137('0x57')]['id'],'ContactId':_0x124511['id'],'OpenchannelAccountId':_0x45d8aa['id'],'lastMsgDirection':_0x0137('0xb8'),'Messages':[_[_0x0137('0x4a')](_0x67eeae[_0x0137('0x56')],{'read':![],'body':_0x67eeae['body'][_0x0137('0x56')],'OpenchannelAccountId':_0x45d8aa['id'],'UserId':_0x67eeae[_0x0137('0x57')]['id'],'ContactId':_0x124511['id']})]},{'include':[{'model':db[_0x0137('0xb9')],'as':_0x0137('0xba')}]})[_0x0137('0x1c')](function(_0x4bbfe7){return[_0x4bbfe7,!![]];});});}})[_0x0137('0x8c')](function(_0xb1e09b,_0x41c3c2){if(_0x41c3c2){return _0xb1e09b;}return db[_0x0137('0xb9')][_0x0137('0x55')](_[_0x0137('0x4a')](_0x67eeae['body'],{'read':![],'body':_0x67eeae['body'][_0x0137('0x56')],'OpenchannelAccountId':_0x45d8aa['id'],'OpenchannelInteractionId':_0xb1e09b['id'],'UserId':_0x67eeae['user']['id'],'ContactId':_0x124511['id']}))[_0x0137('0x1c')](function(_0x527c35){_0xb1e09b[_0x0137('0xbb')][_0x0137('0xba')]=[];_0xb1e09b[_0x0137('0xbb')]['Messages'][_0x0137('0x91')](_0x527c35['dataValues']);return _0xb1e09b;});});}})[_0x0137('0x1c')](respondWithResult(_0x188259,null))[_0x0137('0x50')](handleError(_0x188259,null));}; \ No newline at end of file +var _0x9da3=['OpenchannelInteraction','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','finally','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tags','tag','addAgents','omit','emit','removeAgents','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./openchannelAccount.socket','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','show','params','mandatoryDispositionPause','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','Disposition','getDispositions','findOne','OpenchannelAccountId','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','notify','openchannel','CmContact','Sequelize','no\x20available\x20attributes','difference','updatedAt','isNil','from\x20is\x20mandatory','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','from','CmList','List','DESC','OpenchannelApplication','Applications','account','applications','list','orderBy','priority','Contacts','ListId','contact','firstName','lastName','threadId','externalUrl'];(function(_0x49a6e6,_0x1cf1e0){var _0x3c026c=function(_0x2ca106){while(--_0x2ca106){_0x49a6e6['push'](_0x49a6e6['shift']());}};_0x3c026c(++_0x1cf1e0);}(_0x9da3,0x1a7));var _0x39da=function(_0x533b33,_0x1690bf){_0x533b33=_0x533b33-0x0;var _0x50d6f6=_0x9da3[_0x533b33];return _0x50d6f6;};'use strict';var emlformat=require(_0x39da('0x0'));var rimraf=require(_0x39da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x39da('0x2'));var rp=require('request-promise');var moment=require(_0x39da('0x3'));var BPromise=require(_0x39da('0x4'));var Mustache=require(_0x39da('0x5'));var util=require(_0x39da('0x6'));var path=require(_0x39da('0x7'));var sox=require('sox');var csv=require(_0x39da('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x39da('0x9'));var _=require(_0x39da('0xa'));var squel=require(_0x39da('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x39da('0xc'));var toCsv=require(_0x39da('0x8'));var querystring=require(_0x39da('0xd'));var Papa=require(_0x39da('0xe'));var Redis=require(_0x39da('0xf'));var authService=require(_0x39da('0x10'));var qs=require(_0x39da('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x39da('0x12'))(_0x39da('0x13'));var utils=require(_0x39da('0x14'));var config=require(_0x39da('0x15'));var licenseUtil=require(_0x39da('0x16'));var db=require(_0x39da('0x17'))['db'];config[_0x39da('0x18')]=_[_0x39da('0x19')](config[_0x39da('0x18')],{'host':_0x39da('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x39da('0x18')]));require(_0x39da('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x39da('0x1c')][_0x39da('0x1d')]({'port':0x232c});var client9002=jayson[_0x39da('0x1c')][_0x39da('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x2505dc,_0x522eff,_0x508cde,_0xe1188b){return new BPromise(function(_0x5154cc,_0x9faed8){var _0x49cb53=_0xe1188b||client;return _0x49cb53['request'](_0x2505dc,_0x508cde)[_0x39da('0x1e')](function(_0x59ace3){logger[_0x39da('0x1f')](_0x39da('0x20'),_0x522eff,_0x39da('0x21'));logger[_0x39da('0x22')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x522eff,_0x39da('0x21'),JSON[_0x39da('0x23')](_0x59ace3));if(_0x59ace3['error']){if(_0x59ace3[_0x39da('0x24')][_0x39da('0x25')]===0x1f4){logger['error'](_0x39da('0x20'),_0x522eff,_0x59ace3[_0x39da('0x24')][_0x39da('0x26')]);return _0x9faed8(_0x59ace3[_0x39da('0x24')]['message']);}logger[_0x39da('0x24')](_0x39da('0x20'),_0x522eff,_0x59ace3[_0x39da('0x24')]['message']);return _0x5154cc(_0x59ace3[_0x39da('0x24')][_0x39da('0x26')]);}else{logger[_0x39da('0x1f')]('OpenchannelAccount,\x20%s,\x20%s',_0x522eff,_0x39da('0x21'));_0x5154cc(_0x59ace3[_0x39da('0x27')]['message']);}})[_0x39da('0x28')](function(_0x2cd1d1){logger['error'](_0x39da('0x20'),_0x522eff,_0x2cd1d1);_0x9faed8(_0x2cd1d1);});});}function respondWithStatusCode(_0xe7689e,_0x250156){_0x250156=_0x250156||0xcc;return function(_0x3d3c8b){if(_0x3d3c8b){return _0xe7689e[_0x39da('0x29')](_0x250156);}return _0xe7689e[_0x39da('0x2a')](_0x250156)[_0x39da('0x2b')]();};}function respondWithResult(_0x141a4d,_0x54d641){_0x54d641=_0x54d641||0xc8;return function(_0x2a5c8a){if(_0x2a5c8a){return _0x141a4d['status'](_0x54d641)[_0x39da('0x2c')](_0x2a5c8a);}};}function respondWithFilteredResult(_0x3458e7,_0x47c84a){return function(_0x56b80b){if(_0x56b80b){var _0x51076d=typeof _0x47c84a[_0x39da('0x2d')]===_0x39da('0x2e')&&typeof _0x47c84a['limit']==='undefined';var _0x658ecf=_0x56b80b[_0x39da('0x2f')];var _0x3796fd=_0x51076d?0x0:_0x47c84a[_0x39da('0x2d')];var _0x714217=_0x51076d?_0x56b80b[_0x39da('0x2f')]:_0x47c84a[_0x39da('0x2d')]+_0x47c84a['limit'];var _0x57e128;if(_0x714217>=_0x658ecf){_0x714217=_0x658ecf;_0x57e128=0xc8;}else{_0x57e128=0xce;}_0x3458e7['status'](_0x57e128);return _0x3458e7[_0x39da('0x30')](_0x39da('0x31'),_0x3796fd+'-'+_0x714217+'/'+_0x658ecf)[_0x39da('0x2c')](_0x56b80b);}return null;};}function patchUpdates(_0x139f47){return function(_0x2cb6c6){try{jsonpatch[_0x39da('0x32')](_0x2cb6c6,_0x139f47,!![]);}catch(_0x450f16){return BPromise[_0x39da('0x33')](_0x450f16);}return _0x2cb6c6[_0x39da('0x34')]();};}function saveUpdates(_0x2d78ea,_0x4cdc54){return function(_0x9770d){if(_0x9770d){return _0x9770d[_0x39da('0x35')](_0x2d78ea)[_0x39da('0x1e')](function(_0x4e06b6){return _0x4e06b6;});}return null;};}function removeEntity(_0x362a4b,_0x39f1ab){return function(_0x15edaf){if(_0x15edaf){return _0x15edaf[_0x39da('0x36')]()['then'](function(){var _0x312c90=_0x15edaf['get']({'plain':!![]});var _0x2197cc=_0x39da('0x37');return db[_0x39da('0x38')][_0x39da('0x36')]({'where':{'type':_0x2197cc,'resourceId':_0x312c90['id']}})['then'](function(){return _0x15edaf;});})[_0x39da('0x1e')](function(){_0x362a4b[_0x39da('0x2a')](0xcc)[_0x39da('0x2b')]();});}};}function handleEntityNotFound(_0x27fc1c,_0x285d48){return function(_0x43ee77){if(!_0x43ee77){_0x27fc1c[_0x39da('0x29')](0x194);}return _0x43ee77;};}function handleError(_0x59e484,_0x10c09d){_0x10c09d=_0x10c09d||0x1f4;return function(_0x21c7a9){logger[_0x39da('0x24')](_0x21c7a9[_0x39da('0x39')]);if(_0x21c7a9['name']){delete _0x21c7a9[_0x39da('0x3a')];}_0x59e484['status'](_0x10c09d)[_0x39da('0x3b')](_0x21c7a9);};}exports[_0x39da('0x3c')]=function(_0x4ae7a6,_0x4d8d6b){var _0x22410c={'include':[{'model':db[_0x39da('0x3d')],'as':'mandatoryDispositionPause'}]},_0x6cad9e={},_0x5f5286={'count':0x0,'rows':[]};var _0x4ec31a=_[_0x39da('0x3e')](db[_0x39da('0x3f')][_0x39da('0x40')],function(_0x2f399c){return{'name':_0x2f399c['fieldName'],'type':_0x2f399c[_0x39da('0x41')][_0x39da('0x42')]};});_0x6cad9e[_0x39da('0x43')]=_[_0x39da('0x3e')](_0x4ec31a,_0x39da('0x3a'));_0x6cad9e[_0x39da('0x44')]=_[_0x39da('0x45')](_0x4ae7a6['query']);_0x6cad9e[_0x39da('0x46')]=_[_0x39da('0x47')](_0x6cad9e[_0x39da('0x43')],_0x6cad9e[_0x39da('0x44')]);_0x22410c[_0x39da('0x48')]=_[_0x39da('0x47')](_0x6cad9e['model'],qs[_0x39da('0x49')](_0x4ae7a6[_0x39da('0x44')][_0x39da('0x49')]));_0x22410c[_0x39da('0x48')]=_0x22410c[_0x39da('0x48')][_0x39da('0x4a')]?_0x22410c[_0x39da('0x48')]:_0x6cad9e[_0x39da('0x43')];if(!_0x4ae7a6[_0x39da('0x44')][_0x39da('0x4b')](_0x39da('0x4c'))){_0x22410c[_0x39da('0x4d')]=qs[_0x39da('0x4d')](_0x4ae7a6[_0x39da('0x44')][_0x39da('0x4d')]);_0x22410c[_0x39da('0x2d')]=qs[_0x39da('0x2d')](_0x4ae7a6[_0x39da('0x44')][_0x39da('0x2d')]);}_0x22410c[_0x39da('0x4e')]=qs[_0x39da('0x4f')](_0x4ae7a6['query'][_0x39da('0x4f')]);_0x22410c[_0x39da('0x50')]=qs[_0x39da('0x46')](_[_0x39da('0x51')](_0x4ae7a6['query'],_0x6cad9e[_0x39da('0x46')]),_0x4ec31a);if(_0x4ae7a6['query'][_0x39da('0x52')]){_0x22410c[_0x39da('0x50')]=_[_0x39da('0x53')](_0x22410c['where'],{'$or':_['map'](_0x4ec31a,function(_0x511899){if(_0x511899[_0x39da('0x41')]!==_0x39da('0x54')){var _0x3cff79={};_0x3cff79[_0x511899[_0x39da('0x3a')]]={'$like':'%'+_0x4ae7a6[_0x39da('0x44')][_0x39da('0x52')]+'%'};return _0x3cff79;}})});}_0x22410c=_['merge']({},_0x22410c,_0x4ae7a6[_0x39da('0x55')]);var _0x296406={'where':_0x22410c[_0x39da('0x50')]};return db[_0x39da('0x3f')]['count'](_0x296406)['then'](function(_0x24dc71){_0x5f5286[_0x39da('0x2f')]=_0x24dc71;if(_0x4ae7a6[_0x39da('0x44')][_0x39da('0x56')]){_0x22410c['include']=[{'all':!![]}];}return db[_0x39da('0x3f')]['findAll'](_0x22410c);})['then'](function(_0x351e0d){_0x5f5286['rows']=_0x351e0d;return _0x5f5286;})[_0x39da('0x1e')](respondWithFilteredResult(_0x4d8d6b,_0x22410c))['catch'](handleError(_0x4d8d6b,null));};exports[_0x39da('0x57')]=function(_0x3d5d1e,_0x542ca9){var _0x3e8c52={'raw':![],'where':{'id':_0x3d5d1e[_0x39da('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x39da('0x59')}]},_0x48668f={};_0x48668f[_0x39da('0x43')]=_[_0x39da('0x45')](db[_0x39da('0x3f')][_0x39da('0x40')]);_0x48668f[_0x39da('0x44')]=_[_0x39da('0x45')](_0x3d5d1e['query']);_0x48668f[_0x39da('0x46')]=_[_0x39da('0x47')](_0x48668f[_0x39da('0x43')],_0x48668f[_0x39da('0x44')]);_0x3e8c52[_0x39da('0x48')]=_['intersection'](_0x48668f['model'],qs[_0x39da('0x49')](_0x3d5d1e[_0x39da('0x44')]['fields']));_0x3e8c52[_0x39da('0x48')]=_0x3e8c52[_0x39da('0x48')][_0x39da('0x4a')]?_0x3e8c52['attributes']:_0x48668f['model'];if(_0x3d5d1e[_0x39da('0x44')]['includeAll']){_0x3e8c52[_0x39da('0x5a')]=[{'all':!![]}];}_0x3e8c52=_[_0x39da('0x53')]({},_0x3e8c52,_0x3d5d1e[_0x39da('0x55')]);return db[_0x39da('0x3f')][_0x39da('0x5b')](_0x3e8c52)[_0x39da('0x1e')](handleEntityNotFound(_0x542ca9,null))[_0x39da('0x1e')](respondWithResult(_0x542ca9,null))[_0x39da('0x28')](handleError(_0x542ca9,null));};exports[_0x39da('0x5c')]=function(_0x507754,_0x405557){return db[_0x39da('0x3f')]['create'](_0x507754[_0x39da('0x5d')],{})[_0x39da('0x1e')](function(_0x4be9e){var _0x1a3058=_0x507754[_0x39da('0x5e')][_0x39da('0x5f')]({'plain':!![]});if(!_0x1a3058)throw new Error(_0x39da('0x60'));if(_0x1a3058[_0x39da('0x61')]==='user'){var _0x471435=_0x4be9e[_0x39da('0x5f')]({'plain':!![]});var _0x5d5dd8=_0x39da('0x37');return db[_0x39da('0x62')][_0x39da('0x5b')]({'where':{'name':_0x5d5dd8,'userProfileId':_0x1a3058[_0x39da('0x63')]},'raw':!![]})['then'](function(_0x4549bd){if(_0x4549bd&&_0x4549bd['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x471435[_0x39da('0x3a')],'resourceId':_0x471435['id'],'type':_0x4549bd[_0x39da('0x3a')],'sectionId':_0x4549bd['id']},{})[_0x39da('0x1e')](function(){return _0x4be9e;});}else{return _0x4be9e;}})['catch'](function(_0x46112f){logger[_0x39da('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46112f);throw _0x46112f;});}return _0x4be9e;})[_0x39da('0x1e')](respondWithResult(_0x405557,0xc9))[_0x39da('0x28')](handleError(_0x405557,null));};exports[_0x39da('0x35')]=function(_0x2a1956,_0x3df62d){if(_0x2a1956[_0x39da('0x5d')]['id']){delete _0x2a1956[_0x39da('0x5d')]['id'];}return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x2a1956[_0x39da('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0x39da('0x59')}]})['then'](handleEntityNotFound(_0x3df62d,null))[_0x39da('0x1e')](saveUpdates(_0x2a1956[_0x39da('0x5d')],null))[_0x39da('0x1e')](respondWithResult(_0x3df62d,null))[_0x39da('0x28')](handleError(_0x3df62d,null));};exports['destroy']=function(_0x17aece,_0x20ba37){return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x17aece[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x20ba37,null))[_0x39da('0x1e')](removeEntity(_0x20ba37,null))[_0x39da('0x28')](handleError(_0x20ba37,null));};exports[_0x39da('0x64')]=function(_0x561f0a,_0x31272c){return db['OpenchannelAccount'][_0x39da('0x64')]()[_0x39da('0x1e')](respondWithResult(_0x31272c,null))[_0x39da('0x28')](handleError(_0x31272c,null));};exports['addDisposition']=function(_0x30aeb8,_0x49aedb,_0x31930e){if(_0x30aeb8[_0x39da('0x5d')]['id']){delete _0x30aeb8[_0x39da('0x5d')]['id'];}return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x30aeb8[_0x39da('0x58')]['id']}})['then'](handleEntityNotFound(_0x49aedb,null))[_0x39da('0x1e')](function(_0x26c1ab){if(_0x26c1ab){_0x30aeb8[_0x39da('0x5d')]['OpenchannelAccountId']=_0x26c1ab['id'];return db[_0x39da('0x65')][_0x39da('0x5c')](_0x30aeb8[_0x39da('0x5d')]);}})[_0x39da('0x1e')](respondWithResult(_0x49aedb,null))[_0x39da('0x28')](handleError(_0x49aedb,null));};exports[_0x39da('0x66')]=function(_0x13408f,_0x25ac7e,_0xe4158f){var _0x139d59={'raw':![],'where':{}};var _0x34c066={};var _0x32263f={'count':0x0,'rows':[]};return db[_0x39da('0x3f')][_0x39da('0x67')]({'where':{'id':_0x13408f[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x25ac7e,null))['then'](function(_0x53a8ea){if(_0x53a8ea){_0x34c066[_0x39da('0x43')]=_['keys'](db[_0x39da('0x65')][_0x39da('0x40')]);_0x34c066[_0x39da('0x44')]=_[_0x39da('0x45')](_0x13408f[_0x39da('0x44')]);_0x34c066[_0x39da('0x46')]=_[_0x39da('0x47')](_0x34c066[_0x39da('0x43')],_0x34c066[_0x39da('0x44')]);_0x139d59[_0x39da('0x48')]=_[_0x39da('0x47')](_0x34c066['model'],qs[_0x39da('0x49')](_0x13408f[_0x39da('0x44')][_0x39da('0x49')]));_0x139d59[_0x39da('0x48')]=_0x139d59[_0x39da('0x48')][_0x39da('0x4a')]?_0x139d59['attributes']:_0x34c066[_0x39da('0x43')];if(!_0x13408f['query']['hasOwnProperty'](_0x39da('0x4c'))){_0x139d59[_0x39da('0x4d')]=qs['limit'](_0x13408f[_0x39da('0x44')]['limit']);_0x139d59[_0x39da('0x2d')]=qs[_0x39da('0x2d')](_0x13408f[_0x39da('0x44')][_0x39da('0x2d')]);}_0x139d59['order']=qs['sort'](_0x13408f[_0x39da('0x44')][_0x39da('0x4f')]);_0x139d59[_0x39da('0x50')]=qs['filters'](_[_0x39da('0x51')](_0x13408f['query'],_0x34c066[_0x39da('0x46')]));_0x139d59[_0x39da('0x50')][_0x39da('0x68')]=_0x53a8ea['id'];if(_0x13408f[_0x39da('0x44')][_0x39da('0x52')]){_0x139d59['where']=_[_0x39da('0x53')](_0x139d59[_0x39da('0x50')],{'$or':_['map'](_0x139d59[_0x39da('0x48')],function(_0x179b46){var _0x10da0d={};_0x10da0d[_0x179b46]={'$like':'%'+_0x13408f[_0x39da('0x44')][_0x39da('0x52')]+'%'};return _0x10da0d;})});}_0x139d59=_[_0x39da('0x53')]({},_0x139d59,_0x13408f[_0x39da('0x55')]);return db[_0x39da('0x65')]['count']({'where':_0x139d59[_0x39da('0x50')]})['then'](function(_0x2cbb37){_0x32263f[_0x39da('0x2f')]=_0x2cbb37;if(_0x13408f[_0x39da('0x44')][_0x39da('0x56')]){_0x139d59['include']=[{'all':!![]}];}return db[_0x39da('0x65')][_0x39da('0x69')](_0x139d59);})[_0x39da('0x1e')](function(_0x2c4a4d){_0x32263f[_0x39da('0x6a')]=_0x2c4a4d;return _0x32263f;});}})[_0x39da('0x1e')](respondWithFilteredResult(_0x25ac7e,_0x139d59))[_0x39da('0x28')](handleError(_0x25ac7e,null));};exports[_0x39da('0x6b')]=function(_0x179e17,_0x5ce7c2,_0x21b9dc){return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x179e17[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x5ce7c2,null))['then'](function(_0x81323c){if(_0x81323c){return _0x81323c[_0x39da('0x6b')](_0x179e17[_0x39da('0x44')][_0x39da('0x6c')]);}})[_0x39da('0x1e')](respondWithStatusCode(_0x5ce7c2,null))[_0x39da('0x28')](handleError(_0x5ce7c2,null));};exports[_0x39da('0x6d')]=function(_0x9a860,_0x756c05,_0x5ce9e8){if(_0x9a860['body']['id']){delete _0x9a860['body']['id'];}return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x9a860[_0x39da('0x58')]['id']}})['then'](handleEntityNotFound(_0x756c05,null))['then'](function(_0x9c0961){if(_0x9c0961){_0x9a860[_0x39da('0x5d')]['OpenchannelAccountId']=_0x9c0961['id'];return db[_0x39da('0x6e')][_0x39da('0x5c')](_0x9a860[_0x39da('0x5d')]);}})[_0x39da('0x1e')](respondWithResult(_0x756c05,null))[_0x39da('0x28')](handleError(_0x756c05,null));};exports[_0x39da('0x6f')]=function(_0x3b6ed7,_0x34e398,_0x14c79c){var _0x47a00c={'raw':![],'where':{}};var _0x55223a={};var _0x22836a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x39da('0x67')]({'where':{'id':_0x3b6ed7['params']['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x34e398,null))['then'](function(_0x256d07){if(_0x256d07){_0x55223a[_0x39da('0x43')]=_['keys'](db[_0x39da('0x6e')][_0x39da('0x40')]);_0x55223a[_0x39da('0x44')]=_['keys'](_0x3b6ed7[_0x39da('0x44')]);_0x55223a['filters']=_['intersection'](_0x55223a[_0x39da('0x43')],_0x55223a[_0x39da('0x44')]);_0x47a00c[_0x39da('0x48')]=_[_0x39da('0x47')](_0x55223a[_0x39da('0x43')],qs[_0x39da('0x49')](_0x3b6ed7['query'][_0x39da('0x49')]));_0x47a00c['attributes']=_0x47a00c[_0x39da('0x48')][_0x39da('0x4a')]?_0x47a00c['attributes']:_0x55223a[_0x39da('0x43')];if(!_0x3b6ed7[_0x39da('0x44')]['hasOwnProperty'](_0x39da('0x4c'))){_0x47a00c[_0x39da('0x4d')]=qs[_0x39da('0x4d')](_0x3b6ed7['query'][_0x39da('0x4d')]);_0x47a00c[_0x39da('0x2d')]=qs['offset'](_0x3b6ed7[_0x39da('0x44')][_0x39da('0x2d')]);}_0x47a00c[_0x39da('0x4e')]=qs[_0x39da('0x4f')](_0x3b6ed7[_0x39da('0x44')][_0x39da('0x4f')]);_0x47a00c[_0x39da('0x50')]=qs[_0x39da('0x46')](_[_0x39da('0x51')](_0x3b6ed7[_0x39da('0x44')],_0x55223a[_0x39da('0x46')]));_0x47a00c[_0x39da('0x50')][_0x39da('0x68')]=_0x256d07['id'];if(_0x3b6ed7['query'][_0x39da('0x52')]){_0x47a00c[_0x39da('0x50')]=_[_0x39da('0x53')](_0x47a00c[_0x39da('0x50')],{'$or':_[_0x39da('0x3e')](_0x47a00c['attributes'],function(_0x520888){var _0x5a4dff={};_0x5a4dff[_0x520888]={'$like':'%'+_0x3b6ed7['query'][_0x39da('0x52')]+'%'};return _0x5a4dff;})});}_0x47a00c=_[_0x39da('0x53')]({},_0x47a00c,_0x3b6ed7[_0x39da('0x55')]);return db['CannedAnswer'][_0x39da('0x2f')]({'where':_0x47a00c['where']})[_0x39da('0x1e')](function(_0x10a0eb){_0x22836a[_0x39da('0x2f')]=_0x10a0eb;if(_0x3b6ed7[_0x39da('0x44')][_0x39da('0x56')]){_0x47a00c[_0x39da('0x5a')]=[{'all':!![]}];}return db[_0x39da('0x6e')]['findAll'](_0x47a00c);})[_0x39da('0x1e')](function(_0x26d2f9){_0x22836a[_0x39da('0x6a')]=_0x26d2f9;return _0x22836a;});}})[_0x39da('0x1e')](respondWithFilteredResult(_0x34e398,_0x47a00c))['catch'](handleError(_0x34e398,null));};exports[_0x39da('0x70')]=function(_0x1c9e2c,_0x19ed4e,_0x37926b){return db['OpenchannelAccount'][_0x39da('0x5b')]({'where':{'id':_0x1c9e2c[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x19ed4e,null))[_0x39da('0x1e')](function(_0x2c63e3){if(_0x2c63e3){return _0x2c63e3[_0x39da('0x70')](_0x1c9e2c[_0x39da('0x44')][_0x39da('0x6c')]);}})[_0x39da('0x1e')](respondWithStatusCode(_0x19ed4e,null))[_0x39da('0x28')](handleError(_0x19ed4e,null));};exports[_0x39da('0x71')]=function(_0xd30b32,_0x47bb52,_0x275946){var _0x10c072={'body':_0xd30b32['body'],'channel':_0x39da('0x72')};var _0x7e0ce0=[];var _0x3161d7=[];var _0x5c453c={};var _0x1815ba=![];return db[_0x39da('0x73')]['describe']()[_0x39da('0x1e')](function(_0x2cd558){if(!_0x2cd558){throw new db[(_0x39da('0x74'))]['ValidationError'](_0x39da('0x75'));}_0x7e0ce0=_[_0x39da('0x76')](_[_0x39da('0x45')](_0x2cd558),['createdAt',_0x39da('0x77')]);_0x3161d7=_[_0x39da('0x76')](_[_0x39da('0x45')](_0x2cd558),['createdAt','updatedAt','CompanyId','ListId']);if(_0xd30b32[_0x39da('0x5d')]['id']){delete _0xd30b32[_0x39da('0x5d')]['id'];}if(_[_0x39da('0x78')](_0xd30b32[_0x39da('0x5d')]['from'])){throw new db[(_0x39da('0x74'))]['ValidationError'](_0x39da('0x79'));}if(_['isNil'](_0xd30b32[_0x39da('0x5d')][_0x39da('0x5d')])||_0xd30b32[_0x39da('0x5d')]['body']===''){throw new db[(_0x39da('0x74'))][(_0x39da('0x7a'))](_0x39da('0x7b'));}if(_['isNil'](_0xd30b32['body'][_0x39da('0x7c')])){throw new db[(_0x39da('0x74'))][(_0x39da('0x7a'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3161d7);}if(!_[_0x39da('0x7d')](_0x3161d7,_0xd30b32[_0x39da('0x5d')][_0x39da('0x7c')])){throw new db[(_0x39da('0x74'))][(_0x39da('0x7a'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3161d7);}_0x5c453c[_0xd30b32[_0x39da('0x5d')]['mapKey']]=_0xd30b32['body'][_0x39da('0x7e')];})[_0x39da('0x1e')](function(){return db['OpenchannelAccount'][_0x39da('0x5b')]({'where':{'id':_0xd30b32[_0x39da('0x58')]['id']},'include':[{'model':db[_0x39da('0x7f')],'as':_0x39da('0x80'),'include':[{'model':db[_0x39da('0x73')],'as':'Contacts','where':_0x5c453c,'limit':0x1,'order':[['updatedAt',_0x39da('0x81')]]}]},{'model':db[_0x39da('0x82')],'as':_0x39da('0x83')}]});})['then'](handleEntityNotFound(_0x47bb52,null))[_0x39da('0x1e')](function(_0x43a4a8){if(_0x43a4a8&&_0x43a4a8['List']){_0x10c072[_0x39da('0x84')]=_0x43a4a8;_0x10c072[_0x39da('0x85')]=_0x43a4a8[_0x39da('0x83')];_0x10c072[_0x39da('0x86')]=_0x43a4a8['List'];_0x10c072[_0x39da('0x85')]=_[_0x39da('0x87')](_0x10c072[_0x39da('0x85')],[_0x39da('0x88')],['asc']);if(_0x10c072[_0x39da('0x84')][_0x39da('0x83')]){delete _0x10c072[_0x39da('0x84')][_0x39da('0x83')];}if(_0x10c072[_0x39da('0x84')][_0x39da('0x80')]&&_0x10c072[_0x39da('0x84')][_0x39da('0x80')][_0x39da('0x89')][_0x39da('0x4a')]){return _0x10c072[_0x39da('0x84')]['List']['Contacts'][0x0];}var _0x44fc47=_[_0x39da('0x19')](_0xd30b32[_0x39da('0x5d')],{'firstName':_0xd30b32[_0x39da('0x5d')]['from'],'ListId':_0x43a4a8[_0x39da('0x8a')]});_0x44fc47[_0xd30b32['body']['mapKey']]=_0xd30b32['body'][_0x39da('0x7e')];return db['CmContact'][_0x39da('0x5c')](_0x44fc47,{'fields':_0x7e0ce0,'raw':!![]});}})[_0x39da('0x1e')](handleEntityNotFound(_0x47bb52,null))[_0x39da('0x1e')](function(_0x501125){_0x10c072[_0x39da('0x8b')]=_0x501125;if(_0x501125){var _0x5afbf2={'ContactId':_0x501125['id'],'OpenchannelAccountId':_0xd30b32[_0x39da('0x58')]['id'],'from':(_0x501125[_0x39da('0x8c')]||'')+'\x20'+(_0x501125[_0x39da('0x8d')]||'')};var _0x431335={'OpenchannelAccountId':_0xd30b32[_0x39da('0x58')]['id'],'closed':![]};if(_0xd30b32[_0x39da('0x5d')]['threadId']){_0x431335[_0x39da('0x8e')]=_0xd30b32[_0x39da('0x5d')][_0x39da('0x8e')];return db['OpenchannelInteraction'][_0x39da('0x5b')]({'where':_0x431335})[_0x39da('0x1e')](function(_0x49d4d3){if(_0x49d4d3){return[_0x49d4d3,![]];}_0x5afbf2[_0x39da('0x8e')]=_0xd30b32[_0x39da('0x5d')][_0x39da('0x8e')];_0x5afbf2[_0x39da('0x8f')]=_0xd30b32[_0x39da('0x5d')][_0x39da('0x8f')];return db[_0x39da('0x90')][_0x39da('0x5c')](_0x5afbf2)[_0x39da('0x1e')](function(_0x496fa7){return[_0x496fa7,!![]];});});}else{_0x431335[_0x39da('0x8e')]=null;}_0x431335[_0x39da('0x91')]=_0x501125['id'];return db[_0x39da('0x90')][_0x39da('0x5b')]({'where':_0x431335})[_0x39da('0x1e')](function(_0x598257){if(_0x598257){return[_0x598257,![]];}return db[_0x39da('0x90')][_0x39da('0x5c')](_0x5afbf2)[_0x39da('0x1e')](function(_0x33a08e){return[_0x33a08e,!![]];});});}})[_0x39da('0x92')](function(_0x2dcd40,_0x1c501a){if(_0x2dcd40){_0x1815ba=_0x1c501a;if(!_0x1c501a){var _0xa6c833={'from':(_0x10c072['contact'][_0x39da('0x8c')]||'')+'\x20'+(_0x10c072['contact'][_0x39da('0x8d')]||'')};if(_0xd30b32[_0x39da('0x5d')]['threadId']&&_0xd30b32[_0x39da('0x5d')][_0x39da('0x93')]&&_0xd30b32['body'][_0x39da('0x8e')]!=_0xd30b32[_0x39da('0x5d')][_0x39da('0x93')]){_0xa6c833[_0x39da('0x8e')]=_0xd30b32['body'][_0x39da('0x93')];}return _0x2dcd40[_0x39da('0x35')](_0xa6c833);}else{return _0x2dcd40;}}})[_0x39da('0x1e')](function(_0x5ab675){_0x10c072[_0x39da('0x94')]=_0x5ab675[_0x39da('0x5f')]({'plain':!![]});_0x10c072[_0x39da('0x94')][_0x39da('0x95')]=_0x1815ba;if(_0x10c072[_0x39da('0x94')]['created']){if(_0x10c072[_0x39da('0x84')][_0x39da('0x96')]){_0x10c072[_0x39da('0x85')][_0x39da('0x97')]({'id':0x0,'priority':_0x10c072[_0x39da('0x85')][_0x39da('0x4a')]+0x1,'app':_0x39da('0x98'),'appdata':_0x39da('0x99'),'interval':_0x39da('0x9a')});}}return db['OpenchannelMessage']['create']({'body':_0xd30b32[_0x39da('0x5d')]['body'],'OpenchannelAccountId':_0xd30b32[_0x39da('0x58')]['id'],'OpenchannelInteractionId':_0x5ab675['id'],'direction':'in','ContactId':_0x10c072[_0x39da('0x8b')]['id'],'AttachmentId':_0xd30b32['body'][_0x39da('0x9b')]});})[_0x39da('0x1e')](function(_0x2a1ece){_0x10c072[_0x39da('0x26')]=_0x2a1ece;if(_0x10c072['interaction'][_0x39da('0x9c')]){return db['User'][_0x39da('0x5b')]({'attributes':['id',_0x39da('0x3a')],'where':{'id':_0x10c072[_0x39da('0x94')][_0x39da('0x9c')]}})[_0x39da('0x1e')](function(_0x4f8272){if(_0x4f8272){_0x10c072[_0x39da('0x85')][_0x39da('0x9d')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4f8272[_0x39da('0x3a')]+','+(_0x10c072[_0x39da('0x84')][_0x39da('0x9e')]||0xa),'interval':_0x39da('0x9a')});_0x10c072[_0x39da('0x9f')]=![];}return respondWithRpcPromise(_0x39da('0xa0'),_0x39da('0xa1'),_0x10c072);});}return respondWithRpcPromise(_0x39da('0xa0'),_0x39da('0xa1'),_0x10c072);})[_0x39da('0x1e')](function(_0x5ea1d1){respondWithRpcPromise(_0x39da('0xa2'),'EventManager',{'event':_0x39da('0x71'),'message':_0x5ea1d1},client9002);return _0x5ea1d1;})[_0x39da('0x1e')](respondWithResult(_0x47bb52,null))['catch'](handleError(_0x47bb52,null));};exports[_0x39da('0xa3')]=function(_0x27e3c4,_0x5e5fd6){var _0x102146=_0x27e3c4['params']['id'];var _0x478978=_0x27e3c4[_0x39da('0x5d')];var _0x2ef656=0xc8;var _0x307c6e=null;return db[_0x39da('0xa4')]['transaction']({'isolationLevel':db[_0x39da('0xa4')]['Transaction'][_0x39da('0xa5')][_0x39da('0xa6')]},function(_0x3faeef){return db[_0x39da('0x3f')][_0x39da('0x67')]({'where':{'id':_0x102146},'transaction':_0x3faeef})[_0x39da('0x1e')](function(_0x16cf63){if(_0x16cf63){return db['OpenchannelApplication'][_0x39da('0x36')]({'where':{'OpenchannelAccountId':_0x102146},'transaction':_0x3faeef})[_0x39da('0x1e')](function(){var _0x1ecef3=_['map'](_0x478978,function(_0x7731d1){_0x7731d1[_0x39da('0x68')]=_0x102146;return _0x7731d1;});return db['OpenchannelApplication'][_0x39da('0xa7')](_0x1ecef3,{'transaction':_0x3faeef});});}else{_0x2ef656=0x194;_0x307c6e=[];}});})[_0x39da('0x1e')](function(){if(_0x2ef656!==0x194){return db[_0x39da('0x82')][_0x39da('0xa8')]({'where':{'OpenchannelAccountId':_0x102146},'order':_0x39da('0x88')})[_0x39da('0x1e')](function(_0x57d793){_0x307c6e=_0x57d793;});}})[_0x39da('0x28')](function(_0x16d6f0){_0x2ef656=0x1f4;logger[_0x39da('0x24')](_0x16d6f0[_0x39da('0x39')]);if(_0x16d6f0['name']){delete _0x16d6f0['name'];}_0x307c6e=_0x16d6f0;})[_0x39da('0xa9')](function(){if(_0x307c6e===null){_0x5e5fd6[_0x39da('0x29')](_0x2ef656);}else{if(_0x2ef656===0x1f4){_0x5e5fd6['status'](_0x2ef656)[_0x39da('0x3b')](_0x307c6e);}else{_0x5e5fd6['status'](_0x2ef656)['json'](_0x307c6e);}}});};exports[_0x39da('0xaa')]=function(_0x8275ce,_0x3413ae,_0x56c33b){var _0x4d9b36={};var _0x4cdb24={};var _0x3e0704;var _0x38d8f2;return db['OpenchannelAccount']['findOne']({'where':{'id':_0x8275ce[_0x39da('0x58')]['id']}})['then'](handleEntityNotFound(_0x3413ae,null))['then'](function(_0x59381d){if(_0x59381d){_0x3e0704=_0x59381d;_0x4cdb24[_0x39da('0x43')]=_[_0x39da('0x45')](db[_0x39da('0x82')][_0x39da('0x40')]);_0x4cdb24[_0x39da('0x44')]=_[_0x39da('0x45')](_0x8275ce['query']);_0x4cdb24['filters']=_[_0x39da('0x47')](_0x4cdb24[_0x39da('0x43')],_0x4cdb24[_0x39da('0x44')]);_0x4d9b36[_0x39da('0x48')]=_[_0x39da('0x47')](_0x4cdb24['model'],qs[_0x39da('0x49')](_0x8275ce[_0x39da('0x44')][_0x39da('0x49')]));_0x4d9b36[_0x39da('0x48')]=_0x4d9b36['attributes'][_0x39da('0x4a')]?_0x4d9b36['attributes']:_0x4cdb24[_0x39da('0x43')];_0x4d9b36[_0x39da('0x4e')]=qs[_0x39da('0x4f')](_0x8275ce[_0x39da('0x44')]['sort']);_0x4d9b36[_0x39da('0x50')]=qs['filters'](_['pick'](_0x8275ce[_0x39da('0x44')],_0x4cdb24['filters']));if(_0x8275ce[_0x39da('0x44')][_0x39da('0x52')]){_0x4d9b36[_0x39da('0x50')]=_[_0x39da('0x53')](_0x4d9b36[_0x39da('0x50')],{'$or':_[_0x39da('0x3e')](_0x4d9b36[_0x39da('0x48')],function(_0x4b039d){var _0x427043={};_0x427043[_0x4b039d]={'$like':'%'+_0x8275ce[_0x39da('0x44')][_0x39da('0x52')]+'%'};return _0x427043;})});}_0x4d9b36=_['merge']({},_0x4d9b36,_0x8275ce[_0x39da('0x55')]);return _0x3e0704['getApplications'](_0x4d9b36);}})['then'](function(_0x4cd1f6){if(_0x4cd1f6){_0x38d8f2=_0x4cd1f6[_0x39da('0x4a')];if(!_0x8275ce[_0x39da('0x44')]['hasOwnProperty'](_0x39da('0x4c'))){_0x4d9b36[_0x39da('0x4d')]=qs['limit'](_0x8275ce[_0x39da('0x44')][_0x39da('0x4d')]);_0x4d9b36[_0x39da('0x2d')]=qs[_0x39da('0x2d')](_0x8275ce[_0x39da('0x44')][_0x39da('0x2d')]);}return _0x3e0704['getApplications'](_0x4d9b36);}})[_0x39da('0x1e')](function(_0x29299c){if(_0x29299c){return _0x29299c?{'count':_0x38d8f2,'rows':_0x29299c}:null;}})['then'](respondWithResult(_0x3413ae,null))[_0x39da('0x28')](handleError(_0x3413ae,null));};exports[_0x39da('0xab')]=function(_0x597c51,_0x174756,_0x3128d2){var _0x1ef0c5={'raw':![],'where':{}};var _0x510af1={};var _0x1eb931={'count':0x0,'rows':[]};return db[_0x39da('0x3f')][_0x39da('0x67')]({'where':{'id':_0x597c51[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x174756,null))[_0x39da('0x1e')](function(_0x400455){if(_0x400455){_0x510af1[_0x39da('0x43')]=_['keys'](db['OpenchannelInteraction'][_0x39da('0x40')]);_0x510af1[_0x39da('0x44')]=_[_0x39da('0x45')](_0x597c51[_0x39da('0x44')]);_0x510af1[_0x39da('0x46')]=_['intersection'](_0x510af1['model'],_0x510af1['query']);_0x1ef0c5['attributes']=_[_0x39da('0x47')](_0x510af1[_0x39da('0x43')],qs[_0x39da('0x49')](_0x597c51['query'][_0x39da('0x49')]));_0x1ef0c5[_0x39da('0x48')]=_0x1ef0c5[_0x39da('0x48')][_0x39da('0x4a')]?_0x1ef0c5[_0x39da('0x48')]:_0x510af1[_0x39da('0x43')];if(!_0x597c51[_0x39da('0x44')]['hasOwnProperty'](_0x39da('0x4c'))){_0x1ef0c5[_0x39da('0x4d')]=qs[_0x39da('0x4d')](_0x597c51[_0x39da('0x44')][_0x39da('0x4d')]);_0x1ef0c5[_0x39da('0x2d')]=qs['offset'](_0x597c51[_0x39da('0x44')][_0x39da('0x2d')]);}_0x1ef0c5[_0x39da('0x4e')]=qs[_0x39da('0x4f')](_0x597c51['query']['sort']);_0x1ef0c5['where']=qs[_0x39da('0x46')](_[_0x39da('0x51')](_0x597c51[_0x39da('0x44')],_0x510af1['filters']));_0x1ef0c5['where'][_0x39da('0x68')]=_0x400455['id'];if(_0x597c51[_0x39da('0x44')][_0x39da('0x52')]){_0x1ef0c5[_0x39da('0x50')]=_[_0x39da('0x53')](_0x1ef0c5[_0x39da('0x50')],{'$or':_[_0x39da('0x3e')](_0x1ef0c5[_0x39da('0x48')],function(_0x12b4b6){var _0xf44330={};_0xf44330[_0x12b4b6]={'$like':'%'+_0x597c51['query']['filter']+'%'};return _0xf44330;})});}_0x1ef0c5=_[_0x39da('0x53')]({},_0x1ef0c5,_0x597c51[_0x39da('0x55')]);return db[_0x39da('0x90')][_0x39da('0x2f')]({'where':_0x1ef0c5[_0x39da('0x50')]})[_0x39da('0x1e')](function(_0x3eb90e){_0x1eb931[_0x39da('0x2f')]=_0x3eb90e;if(_0x597c51[_0x39da('0x44')]['includeAll']){_0x1ef0c5[_0x39da('0x5a')]=[{'model':db[_0x39da('0x73')],'as':_0x39da('0xac'),'required':![]},{'model':db[_0x39da('0xad')],'as':_0x39da('0xae'),'attributes':['name',_0x39da('0xaf'),_0x39da('0xb0')],'required':![]},{'model':db['Tag'],'as':_0x39da('0xb1'),'attributes':['id','name','color'],'where':_0x597c51[_0x39da('0x44')]['tag']?{'id':_0x597c51[_0x39da('0x44')]['tag']}:undefined,'required':_0x597c51[_0x39da('0x44')][_0x39da('0xb2')]?!![]:![]}];}return db[_0x39da('0x90')][_0x39da('0x69')](_0x1ef0c5);})[_0x39da('0x1e')](function(_0x50a966){_0x1eb931[_0x39da('0x6a')]=_0x50a966;return _0x1eb931;});}})[_0x39da('0x1e')](respondWithFilteredResult(_0x174756,_0x1ef0c5))['catch'](handleError(_0x174756,null));};exports[_0x39da('0xb3')]=function(_0x1dbb04,_0xe10673,_0xa21223){return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x1dbb04[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0xe10673,null))[_0x39da('0x1e')](function(_0x2eb5e8){if(_0x2eb5e8){return _0x2eb5e8['addAgents'](_0x1dbb04[_0x39da('0x5d')][_0x39da('0x6c')],_[_0x39da('0xb4')](_0x1dbb04['body'],['ids','id'])||{})[_0x39da('0x92')](function(_0x140990){for(var _0x52a2a6=0x0;_0x52a2a6<_0x1dbb04['body'][_0x39da('0x6c')][_0x39da('0x4a')];_0x52a2a6+=0x1){socket[_0x39da('0xb5')]('userOpenchannelAccount:save',{'UserId':Number(_0x1dbb04[_0x39da('0x5d')][_0x39da('0x6c')][_0x52a2a6]),'OpenchannelAccountId':Number(_0x1dbb04[_0x39da('0x58')]['id'])});}return _0x140990;});}})[_0x39da('0x1e')](respondWithResult(_0xe10673,null))[_0x39da('0x28')](handleError(_0xe10673,null));};exports[_0x39da('0xb6')]=function(_0xa5006d,_0x4f9160,_0x24bc42){return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0xa5006d[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x4f9160,null))['then'](function(_0x8e47c){if(_0x8e47c){return _0x8e47c['removeAgents'](_0xa5006d[_0x39da('0x44')]['ids'])[_0x39da('0x1e')](function(){if(_['isArray'](_0xa5006d[_0x39da('0x44')][_0x39da('0x6c')])){for(var _0x87443b=0x0;_0x87443b<_0xa5006d['query']['ids']['length'];_0x87443b+=0x1){socket[_0x39da('0xb5')](_0x39da('0xb7'),{'UserId':Number(_0xa5006d[_0x39da('0x44')][_0x39da('0x6c')][_0x87443b]),'OpenchannelAccountId':Number(_0xa5006d[_0x39da('0x58')]['id'])});}}else{socket[_0x39da('0xb5')](_0x39da('0xb7'),{'UserId':Number(_0xa5006d[_0x39da('0x44')]['ids']),'OpenchannelAccountId':Number(_0xa5006d[_0x39da('0x58')]['id'])});}});}})[_0x39da('0x1e')](respondWithStatusCode(_0x4f9160,null))['catch'](handleError(_0x4f9160,null));};exports[_0x39da('0xb8')]=function(_0x5559f4,_0x2c80f0,_0x3125d8){var _0x54e821={};var _0x1a7cee={};var _0x11af7a;var _0x275d0c;return db[_0x39da('0x3f')][_0x39da('0x67')]({'where':{'id':_0x5559f4['params']['id']}})['then'](handleEntityNotFound(_0x2c80f0,null))[_0x39da('0x1e')](function(_0xa632c0){if(_0xa632c0){_0x11af7a=_0xa632c0;_0x1a7cee['model']=_[_0x39da('0x45')](db[_0x39da('0xad')]['rawAttributes']);_0x1a7cee[_0x39da('0x44')]=_['keys'](_0x5559f4[_0x39da('0x44')]);_0x1a7cee[_0x39da('0x46')]=_['intersection'](_0x1a7cee[_0x39da('0x43')],_0x1a7cee[_0x39da('0x44')]);_0x54e821[_0x39da('0x48')]=_[_0x39da('0x47')](_0x1a7cee[_0x39da('0x43')],qs[_0x39da('0x49')](_0x5559f4['query'][_0x39da('0x49')]));_0x54e821[_0x39da('0x48')]=_0x54e821[_0x39da('0x48')][_0x39da('0x4a')]?_0x54e821[_0x39da('0x48')]:_0x1a7cee[_0x39da('0x43')];_0x54e821[_0x39da('0x4e')]=qs[_0x39da('0x4f')](_0x5559f4[_0x39da('0x44')][_0x39da('0x4f')]);_0x54e821[_0x39da('0x50')]=qs['filters'](_[_0x39da('0x51')](_0x5559f4[_0x39da('0x44')],_0x1a7cee[_0x39da('0x46')]));if(_0x5559f4[_0x39da('0x44')][_0x39da('0x52')]){_0x54e821[_0x39da('0x50')]=_['merge'](_0x54e821[_0x39da('0x50')],{'$or':_[_0x39da('0x3e')](_0x54e821[_0x39da('0x48')],function(_0xdfbeca){var _0x5799c5={};_0x5799c5[_0xdfbeca]={'$like':'%'+_0x5559f4[_0x39da('0x44')][_0x39da('0x52')]+'%'};return _0x5799c5;})});}_0x54e821=_[_0x39da('0x53')]({},_0x54e821,_0x5559f4[_0x39da('0x55')]);return _0x11af7a[_0x39da('0xb8')](_0x54e821);}})[_0x39da('0x1e')](function(_0x39ed32){if(_0x39ed32){_0x275d0c=_0x39ed32[_0x39da('0x4a')];if(!_0x5559f4[_0x39da('0x44')][_0x39da('0x4b')](_0x39da('0x4c'))){_0x54e821[_0x39da('0x4d')]=qs[_0x39da('0x4d')](_0x5559f4[_0x39da('0x44')]['limit']);_0x54e821[_0x39da('0x2d')]=qs[_0x39da('0x2d')](_0x5559f4[_0x39da('0x44')]['offset']);}return _0x11af7a[_0x39da('0xb8')](_0x54e821);}})[_0x39da('0x1e')](function(_0x41e3d5){if(_0x41e3d5){return _0x41e3d5?{'count':_0x275d0c,'rows':_0x41e3d5}:null;}})[_0x39da('0x1e')](respondWithResult(_0x2c80f0,null))[_0x39da('0x28')](handleError(_0x2c80f0,null));};exports[_0x39da('0x3b')]=function(_0x544311,_0x3f9c8b,_0x30397d){var _0x37fc4d,_0x567751,_0x4af7e5;if(_[_0x39da('0x78')](_0x544311['body'][_0x39da('0x5d')])||_0x544311[_0x39da('0x5d')][_0x39da('0x5d')]===''){throw new db[(_0x39da('0x74'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x39da('0x78')](_0x544311[_0x39da('0x5d')]['to'])){}_0x37fc4d=_0x544311['body']['to'];return db[_0x39da('0x3f')][_0x39da('0x67')]({'where':{'id':_0x544311[_0x39da('0x58')]['id']}})[_0x39da('0x1e')](handleEntityNotFound(_0x3f9c8b,null))['then'](function(_0x1b57db){if(_0x1b57db){return db[_0x39da('0x3f')][_0x39da('0x5b')]({'where':{'id':_0x1b57db['id']},'include':[{'model':db[_0x39da('0x7f')],'as':_0x39da('0x80'),'include':[{'model':db[_0x39da('0x73')],'as':_0x39da('0x89'),'where':{[_0x1b57db[_0x39da('0x7c')]]:_0x37fc4d},'limit':0x1,'order':[[_0x39da('0x77'),'DESC']]}]}]})[_0x39da('0x1e')](handleEntityNotFound(_0x3f9c8b,null))['then'](function(_0x5580d8){if(_0x5580d8&&_0x5580d8[_0x39da('0x80')]){_0x567751=_0x5580d8[_0x39da('0x5f')]({'plain':!![]});if(_0x567751['List']&&_0x567751[_0x39da('0x80')]['Contacts'][_0x39da('0x4a')]){return _0x567751[_0x39da('0x80')]['Contacts'][0x0];}return db['CmContact'][_0x39da('0x5c')](_['defaults'](_0x544311[_0x39da('0x5d')],{'firstName':_0x37fc4d,[_0x5580d8[_0x39da('0x7c')]]:_0x37fc4d,'phone':_0x37fc4d,'ListId':_0x567751[_0x39da('0x8a')]}));}})[_0x39da('0x1e')](handleEntityNotFound(_0x3f9c8b,null))[_0x39da('0x1e')](function(_0x1ad410){if(_0x1ad410){_0x4af7e5=_0x1ad410;return db['OpenchannelInteraction'][_0x39da('0x5b')]({'where':{'ContactId':_0x4af7e5['id'],'closed':![],'OpenchannelAccountId':_0x567751['id']}})[_0x39da('0x1e')](function(_0x1c6dd2){if(_0x1c6dd2){return[_0x1c6dd2,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x544311[_0x39da('0x5e')]['id'],'ContactId':_0x4af7e5['id'],'OpenchannelAccountId':_0x567751['id'],'lastMsgDirection':_0x39da('0xb9'),'Messages':[_[_0x39da('0x53')](_0x544311[_0x39da('0x5d')],{'read':![],'body':_0x544311[_0x39da('0x5d')]['body'],'OpenchannelAccountId':_0x567751['id'],'UserId':_0x544311['user']['id'],'ContactId':_0x4af7e5['id']})]},{'include':[{'model':db[_0x39da('0xba')],'as':_0x39da('0xbb')}]})['then'](function(_0x1e92e4){return[_0x1e92e4,!![]];});});}})[_0x39da('0x92')](function(_0x3ca8af,_0x14a315){if(_0x14a315){return _0x3ca8af;}return db[_0x39da('0xba')]['create'](_['merge'](_0x544311[_0x39da('0x5d')],{'read':![],'body':_0x544311[_0x39da('0x5d')][_0x39da('0x5d')],'OpenchannelAccountId':_0x567751['id'],'OpenchannelInteractionId':_0x3ca8af['id'],'UserId':_0x544311[_0x39da('0x5e')]['id'],'ContactId':_0x4af7e5['id']}))[_0x39da('0x1e')](function(_0x224d2b){_0x3ca8af[_0x39da('0xbc')][_0x39da('0xbb')]=[];_0x3ca8af['dataValues'][_0x39da('0xbb')][_0x39da('0x97')](_0x224d2b[_0x39da('0xbc')]);return _0x3ca8af;});});}})[_0x39da('0x1e')](respondWithResult(_0x3f9c8b,null))[_0x39da('0x28')](handleError(_0x3f9c8b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 8391533..cc49bca 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 _0x6e6c=['../../mysqldb','setMaxListeners','save','emit','hook','exports','events'];(function(_0x3a0a79,_0x10cda2){var _0x13608b=function(_0x50fa63){while(--_0x50fa63){_0x3a0a79['push'](_0x3a0a79['shift']());}};_0x13608b(++_0x10cda2);}(_0x6e6c,0xc3));var _0xc6e6=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6e6c[_0x501510];return _0x1e6ee5;};'use strict';var EventEmitter=require(_0xc6e6('0x0'));var OpenchannelAccount=require(_0xc6e6('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xc6e6('0x2')](0x0);var events={'afterCreate':_0xc6e6('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2e97f5){return function(_0x5a9e2b,_0x40b7e1,_0x4b13f0){OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5+':'+_0x5a9e2b['id'],_0x5a9e2b);OpenchannelAccountEvents[_0xc6e6('0x4')](_0x2e97f5,_0x5a9e2b);_0x4b13f0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xc6e6('0x5')](e,emitEvent(event));}}module[_0xc6e6('0x6')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xe706=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','save','update','remove','emit'];(function(_0x37c1d1,_0x206998){var _0x4df98c=function(_0x4fc5ab){while(--_0x4fc5ab){_0x37c1d1['push'](_0x37c1d1['shift']());}};_0x4df98c(++_0x206998);}(_0xe706,0xa3));var _0x6e70=function(_0x17d76b,_0x54345b){_0x17d76b=_0x17d76b-0x0;var _0x16f3ac=_0xe706[_0x17d76b];return _0x16f3ac;};'use strict';var EventEmitter=require(_0x6e70('0x0'));var OpenchannelAccount=require(_0x6e70('0x1'))['db'][_0x6e70('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6e70('0x3'),'afterUpdate':_0x6e70('0x4'),'afterDestroy':_0x6e70('0x5')};function emitEvent(_0x7dfbc3){return function(_0x142c27,_0x2164a4,_0x376a8d){OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3+':'+_0x142c27['id'],_0x142c27);OpenchannelAccountEvents[_0x6e70('0x6')](_0x7dfbc3,_0x142c27);_0x376a8d(null);};}for(var e in events){if(events[_0x6e70('0x7')](e)){var event=events[e];OpenchannelAccount[_0x6e70('0x8')](e,emitEvent(event));}}module[_0x6e70('0x9')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index b85c2c1..bbbc7f5 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(_0x206ddf,_0x5873bb){var _0x3ee2bc=function(_0x11bc96){while(--_0x11bc96){_0x206ddf['push'](_0x206ddf['shift']());}};_0x3ee2bc(++_0x5873bb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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(_0x40b86e,_0x33fd02){var _0x1defab=function(_0x2fa55f){while(--_0x2fa55f){_0x40b86e['push'](_0x40b86e['shift']());}};_0x1defab(++_0x33fd02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 31d1e15..77408b9 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 _0xb248=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./openchannelAccount.socket','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'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0xb248,0xc6));var _0x8b24=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xb248[_0x3ff085];return _0x2b68c3;};'use strict';var _=require(_0x8b24('0x0'));var util=require('util');var moment=require(_0x8b24('0x1'));var BPromise=require(_0x8b24('0x2'));var rs=require(_0x8b24('0x3'));var fs=require('fs');var Redis=require(_0x8b24('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8b24('0x5'));var logger=require(_0x8b24('0x6'))('rpc');var config=require(_0x8b24('0x7'));var jayson=require(_0x8b24('0x8'));var client=jayson['client'][_0x8b24('0x9')]({'port':0x232a});config[_0x8b24('0xa')]=_['defaults'](config[_0x8b24('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x8b24('0xb'))(new Redis(config[_0x8b24('0xa')]));require(_0x8b24('0xc'))['register'](socket);function respondWithRpcPromise(_0x403adc,_0x285c7b,_0x1775d6){return new BPromise(function(_0x2edeb7,_0x3847bd){return client[_0x8b24('0xd')](_0x403adc,_0x1775d6)[_0x8b24('0xe')](function(_0x641713){logger[_0x8b24('0xf')](_0x8b24('0x10'),_0x285c7b,_0x8b24('0x11'));logger[_0x8b24('0x12')](_0x8b24('0x13'),_0x285c7b,_0x8b24('0x11'),JSON['stringify'](_0x641713));if(_0x641713['error']){if(_0x641713[_0x8b24('0x14')][_0x8b24('0x15')]===0x1f4){logger[_0x8b24('0x14')](_0x8b24('0x10'),_0x285c7b,_0x641713[_0x8b24('0x14')][_0x8b24('0x16')]);return _0x3847bd(_0x641713[_0x8b24('0x14')][_0x8b24('0x16')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x285c7b,_0x641713['error'][_0x8b24('0x16')]);return _0x2edeb7(_0x641713['error']['message']);}else{logger[_0x8b24('0xf')](_0x8b24('0x10'),_0x285c7b,'request\x20sent');_0x2edeb7(_0x641713[_0x8b24('0x17')]['message']);}})[_0x8b24('0x18')](function(_0x56d424){logger[_0x8b24('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x285c7b,_0x56d424);_0x3847bd(_0x56d424);});});} \ No newline at end of file +var _0x2bb0=['lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelAccount,\x20%s,\x20%s','result','catch'];(function(_0x554ae1,_0x40f0b7){var _0x353342=function(_0x3e7287){while(--_0x3e7287){_0x554ae1['push'](_0x554ae1['shift']());}};_0x353342(++_0x40f0b7);}(_0x2bb0,0xf3));var _0x02bb=function(_0xb36b49,_0x22a1ba){_0xb36b49=_0xb36b49-0x0;var _0x36476d=_0x2bb0[_0xb36b49];return _0x36476d;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});config[_0x02bb('0xa')]=_[_0x02bb('0xb')](config['redis'],{'host':_0x02bb('0xc'),'port':0x18eb});var socket=require(_0x02bb('0xd'))(new Redis(config[_0x02bb('0xa')]));require('./openchannelAccount.socket')[_0x02bb('0xe')](socket);function respondWithRpcPromise(_0x5a4a7f,_0x3edabe,_0x1863ec){return new BPromise(function(_0x4d3418,_0x3f861e){return client[_0x02bb('0xf')](_0x5a4a7f,_0x1863ec)[_0x02bb('0x10')](function(_0x523480){logger[_0x02bb('0x11')]('OpenchannelAccount,\x20%s,\x20%s',_0x3edabe,_0x02bb('0x12'));logger[_0x02bb('0x13')](_0x02bb('0x14'),_0x3edabe,'request\x20sent',JSON[_0x02bb('0x15')](_0x523480));if(_0x523480[_0x02bb('0x16')]){if(_0x523480[_0x02bb('0x16')]['code']===0x1f4){logger[_0x02bb('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x3edabe,_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);return _0x3f861e(_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);}logger[_0x02bb('0x16')](_0x02bb('0x18'),_0x3edabe,_0x523480['error']['message']);return _0x4d3418(_0x523480[_0x02bb('0x16')][_0x02bb('0x17')]);}else{logger[_0x02bb('0x11')](_0x02bb('0x18'),_0x3edabe,_0x02bb('0x12'));_0x4d3418(_0x523480[_0x02bb('0x19')]['message']);}})[_0x02bb('0x1a')](function(_0x4b3f78){logger[_0x02bb('0x16')](_0x02bb('0x18'),_0x3edabe,_0x4b3f78);_0x3f861e(_0x4b3f78);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 9c91ffd..68310ff 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 _0x255f=['emit','removeListener','register','openchannelAccount:','./openchannelAccount.events','remove','update'];(function(_0xe75b42,_0x1b5edc){var _0x1b162b=function(_0x49160d){while(--_0x49160d){_0xe75b42['push'](_0xe75b42['shift']());}};_0x1b162b(++_0x1b5edc);}(_0x255f,0x185));var _0xf255=function(_0x680be8,_0x27ad4f){_0x680be8=_0x680be8-0x0;var _0x5ef590=_0x255f[_0x680be8];return _0x5ef590;};'use strict';var OpenchannelAccountEvents=require(_0xf255('0x0'));var events=['save',_0xf255('0x1'),_0xf255('0x2')];function createListener(_0xba19b,_0x4fae55){return function(_0x3984f5){_0x4fae55[_0xf255('0x3')](_0xba19b,_0x3984f5);};}function removeListener(_0x474ac5,_0x151b29){return function(){OpenchannelAccountEvents[_0xf255('0x4')](_0x474ac5,_0x151b29);};}exports[_0xf255('0x5')]=function(_0xc1d19f){for(var _0x5bbed0=0x0,_0x1236fb=events['length'];_0x5bbed0<_0x1236fb;_0x5bbed0++){var _0x481d8c=events[_0x5bbed0];var _0x4a533f=createListener(_0xf255('0x6')+_0x481d8c,_0xc1d19f);OpenchannelAccountEvents['on'](_0x481d8c,_0x4a533f);}}; \ No newline at end of file +var _0xdb13=['length','openchannelAccount:','save','remove','update','removeListener','register'];(function(_0x1bfe2b,_0x34856e){var _0x1477d4=function(_0x1d558c){while(--_0x1d558c){_0x1bfe2b['push'](_0x1bfe2b['shift']());}};_0x1477d4(++_0x34856e);}(_0xdb13,0x10c));var _0x3db1=function(_0x1d364e,_0x52569e){_0x1d364e=_0x1d364e-0x0;var _0x104c54=_0xdb13[_0x1d364e];return _0x104c54;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x3db1('0x0'),_0x3db1('0x1'),_0x3db1('0x2')];function createListener(_0x28e569,_0x32468d){return function(_0xd23f18){_0x32468d['emit'](_0x28e569,_0xd23f18);};}function removeListener(_0x3352e3,_0x41fb5d){return function(){OpenchannelAccountEvents[_0x3db1('0x3')](_0x3352e3,_0x41fb5d);};}exports[_0x3db1('0x4')]=function(_0x342b84){for(var _0x5a2345=0x0,_0x37ae52=events[_0x3db1('0x5')];_0x5a2345<_0x37ae52;_0x5a2345++){var _0x28e7b6=events[_0x5a2345];var _0x379cfb=createListener(_0x3db1('0x6')+_0x28e7b6,_0x342b84);OpenchannelAccountEvents['on'](_0x28e7b6,_0x379cfb);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 8cca200..8c896ea 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 _0x7499=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','post','create','put','/:id','update','destroy','exports'];(function(_0x48abed,_0x2da522){var _0xbec05f=function(_0x448ae8){while(--_0x448ae8){_0x48abed['push'](_0x48abed['shift']());}};_0xbec05f(++_0x2da522);}(_0x7499,0xa0));var _0x9749=function(_0x449e84,_0x505ae7){_0x449e84=_0x449e84-0x0;var _0x72d311=_0x7499[_0x449e84];return _0x72d311;};'use strict';var multer=require('multer');var util=require(_0x9749('0x0'));var path=require(_0x9749('0x1'));var timeout=require(_0x9749('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9749('0x3'));var interaction=require(_0x9749('0x4'));var config=require(_0x9749('0x5'));var controller=require(_0x9749('0x6'));router[_0x9749('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9749('0x7')]('/:id',auth[_0x9749('0x8')](),controller['show']);router[_0x9749('0x9')]('/',auth[_0x9749('0x8')](),controller[_0x9749('0xa')]);router[_0x9749('0xb')](_0x9749('0xc'),auth[_0x9749('0x8')](),controller[_0x9749('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9749('0xe')]);module[_0x9749('0xf')]=router; \ No newline at end of file +var _0x23bf=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router'];(function(_0x21f3ce,_0x16270d){var _0x21fb19=function(_0x51721e){while(--_0x51721e){_0x21f3ce['push'](_0x21f3ce['shift']());}};_0x21fb19(++_0x16270d);}(_0x23bf,0xc3));var _0xf23b=function(_0x178d9a,_0x9abb67){_0x178d9a=_0x178d9a-0x0;var _0x2ab9f5=_0x23bf[_0x178d9a];return _0x2ab9f5;};'use strict';var multer=require(_0xf23b('0x0'));var util=require(_0xf23b('0x1'));var path=require(_0xf23b('0x2'));var timeout=require(_0xf23b('0x3'));var express=require('express');var router=express[_0xf23b('0x4')]();var fs_extra=require(_0xf23b('0x5'));var auth=require(_0xf23b('0x6'));var interaction=require(_0xf23b('0x7'));var config=require('../../config/environment');var controller=require('./openchannelApplication.controller');router[_0xf23b('0x8')]('/',auth[_0xf23b('0x9')](),controller[_0xf23b('0xa')]);router[_0xf23b('0x8')](_0xf23b('0xb'),auth[_0xf23b('0x9')](),controller[_0xf23b('0xc')]);router[_0xf23b('0xd')]('/',auth['isAuthenticated'](),controller[_0xf23b('0xe')]);router[_0xf23b('0xf')](_0xf23b('0xb'),auth[_0xf23b('0x9')](),controller[_0xf23b('0x10')]);router[_0xf23b('0x11')](_0xf23b('0xb'),auth[_0xf23b('0x9')](),controller[_0xf23b('0x12')]);module[_0xf23b('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d678d79..475ed34 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 _0xfcff=['STRING','noop','TEXT','*,*,*,*','sequelize','INTEGER'];(function(_0x557b20,_0x561611){var _0x3d7b29=function(_0x3217dd){while(--_0x3217dd){_0x557b20['push'](_0x557b20['shift']());}};_0x3d7b29(++_0x561611);}(_0xfcff,0x1a8));var _0xffcf=function(_0x162e55,_0x3d2187){_0x162e55=_0x162e55-0x0;var _0x235db4=_0xfcff[_0x162e55];return _0x235db4;};'use strict';var Sequelize=require(_0xffcf('0x0'));module['exports']={'priority':{'type':Sequelize[_0xffcf('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xffcf('0x2')],'allowNull':![],'defaultValue':_0xffcf('0x3')},'appdata':{'type':Sequelize[_0xffcf('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xffcf('0x2')],'defaultValue':_0xffcf('0x5')}}; \ No newline at end of file +var _0xeee6=['exports','INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize'];(function(_0x562faa,_0x23adc7){var _0xc70f59=function(_0x2d7dec){while(--_0x2d7dec){_0x562faa['push'](_0x562faa['shift']());}};_0xc70f59(++_0x23adc7);}(_0xeee6,0x84));var _0x6eee=function(_0x363ab9,_0x24396a){_0x363ab9=_0x363ab9-0x0;var _0x338e49=_0xeee6[_0x363ab9];return _0x338e49;};'use strict';var Sequelize=require(_0x6eee('0x0'));module[_0x6eee('0x1')]={'priority':{'type':Sequelize[_0x6eee('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6eee('0x3')},'appdata':{'type':Sequelize[_0x6eee('0x4')]()},'description':{'type':Sequelize[_0x6eee('0x5')]},'interval':{'type':Sequelize[_0x6eee('0x5')],'defaultValue':_0x6eee('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 0d7be53..d0a00a2 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 _0xe73a=['../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','then','error','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','create','body','update','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0xe73a,0x11c));var _0xae73=function(_0x5b2a15,_0xd200ec){_0x5b2a15=_0x5b2a15-0x0;var _0x33038d=_0xe73a[_0x5b2a15];return _0x33038d;};'use strict';var emlformat=require(_0xae73('0x0'));var rimraf=require(_0xae73('0x1'));var zipdir=require(_0xae73('0x2'));var jsonpatch=require(_0xae73('0x3'));var rp=require('request-promise');var moment=require(_0xae73('0x4'));var BPromise=require(_0xae73('0x5'));var Mustache=require('mustache');var util=require(_0xae73('0x6'));var path=require('path');var sox=require(_0xae73('0x7'));var csv=require(_0xae73('0x8'));var ejs=require(_0xae73('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xae73('0xa'));var squel=require(_0xae73('0xb'));var crypto=require(_0xae73('0xc'));var jsforce=require(_0xae73('0xd'));var deskjs=require(_0xae73('0xe'));var toCsv=require(_0xae73('0x8'));var querystring=require('querystring');var Papa=require(_0xae73('0xf'));var Redis=require('ioredis');var authService=require(_0xae73('0x10'));var qs=require(_0xae73('0x11'));var as=require(_0xae73('0x12'));var hardwareService=require(_0xae73('0x13'));var logger=require(_0xae73('0x14'))(_0xae73('0x15'));var utils=require(_0xae73('0x16'));var config=require(_0xae73('0x17'));var licenseUtil=require(_0xae73('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c9fb2,_0x19bca6){_0x19bca6=_0x19bca6||0xcc;return function(_0xf38391){if(_0xf38391){return _0x5c9fb2[_0xae73('0x19')](_0x19bca6);}return _0x5c9fb2[_0xae73('0x1a')](_0x19bca6)[_0xae73('0x1b')]();};}function respondWithResult(_0x2677ac,_0xb93c2d){_0xb93c2d=_0xb93c2d||0xc8;return function(_0x592158){if(_0x592158){return _0x2677ac['status'](_0xb93c2d)['json'](_0x592158);}};}function respondWithFilteredResult(_0x26228a,_0x23d21a){return function(_0x114863){if(_0x114863){var _0x45ed6d=typeof _0x23d21a['offset']===_0xae73('0x1c')&&typeof _0x23d21a[_0xae73('0x1d')]===_0xae73('0x1c');var _0x697c8a=_0x114863[_0xae73('0x1e')];var _0x3a46b4=_0x45ed6d?0x0:_0x23d21a[_0xae73('0x1f')];var _0xa94428=_0x45ed6d?_0x114863['count']:_0x23d21a[_0xae73('0x1f')]+_0x23d21a[_0xae73('0x1d')];var _0x5b4344;if(_0xa94428>=_0x697c8a){_0xa94428=_0x697c8a;_0x5b4344=0xc8;}else{_0x5b4344=0xce;}_0x26228a[_0xae73('0x1a')](_0x5b4344);return _0x26228a['set'](_0xae73('0x20'),_0x3a46b4+'-'+_0xa94428+'/'+_0x697c8a)[_0xae73('0x21')](_0x114863);}return null;};}function patchUpdates(_0x18606d){return function(_0x17b3fd){try{jsonpatch['apply'](_0x17b3fd,_0x18606d,!![]);}catch(_0x162e76){return BPromise[_0xae73('0x22')](_0x162e76);}return _0x17b3fd[_0xae73('0x23')]();};}function saveUpdates(_0x4fa468,_0x99749c){return function(_0x4d2f6a){if(_0x4d2f6a){return _0x4d2f6a['update'](_0x4fa468)[_0xae73('0x24')](function(_0x2d0c3d){return _0x2d0c3d;});}return null;};}function removeEntity(_0x3edfea,_0x5e9bc4){return function(_0x124e83){if(_0x124e83){return _0x124e83['destroy']()['then'](function(){_0x3edfea['status'](0xcc)[_0xae73('0x1b')]();});}};}function handleEntityNotFound(_0x430ae1,_0x3ee4c9){return function(_0x5ee0c8){if(!_0x5ee0c8){_0x430ae1[_0xae73('0x19')](0x194);}return _0x5ee0c8;};}function handleError(_0x17cf13,_0x396ed6){_0x396ed6=_0x396ed6||0x1f4;return function(_0x28ed4b){logger[_0xae73('0x25')](_0x28ed4b['stack']);if(_0x28ed4b[_0xae73('0x26')]){delete _0x28ed4b['name'];}_0x17cf13[_0xae73('0x1a')](_0x396ed6)[_0xae73('0x27')](_0x28ed4b);};}exports[_0xae73('0x28')]=function(_0x9dad0b,_0x1c05ee){var _0x57cff9={},_0x176c9d={},_0x562edc={'count':0x0,'rows':[]};var _0x111a38=_[_0xae73('0x29')](db[_0xae73('0x2a')][_0xae73('0x2b')],function(_0x51ff1f){return{'name':_0x51ff1f[_0xae73('0x2c')],'type':_0x51ff1f[_0xae73('0x2d')][_0xae73('0x2e')]};});_0x176c9d[_0xae73('0x2f')]=_[_0xae73('0x29')](_0x111a38,'name');_0x176c9d['query']=_['keys'](_0x9dad0b[_0xae73('0x30')]);_0x176c9d[_0xae73('0x31')]=_['intersection'](_0x176c9d[_0xae73('0x2f')],_0x176c9d[_0xae73('0x30')]);_0x57cff9['attributes']=_[_0xae73('0x32')](_0x176c9d['model'],qs[_0xae73('0x33')](_0x9dad0b[_0xae73('0x30')]['fields']));_0x57cff9['attributes']=_0x57cff9[_0xae73('0x34')][_0xae73('0x35')]?_0x57cff9[_0xae73('0x34')]:_0x176c9d['model'];if(!_0x9dad0b[_0xae73('0x30')]['hasOwnProperty'](_0xae73('0x36'))){_0x57cff9[_0xae73('0x1d')]=qs[_0xae73('0x1d')](_0x9dad0b[_0xae73('0x30')][_0xae73('0x1d')]);_0x57cff9['offset']=qs[_0xae73('0x1f')](_0x9dad0b[_0xae73('0x30')]['offset']);}_0x57cff9[_0xae73('0x37')]=qs[_0xae73('0x38')](_0x9dad0b[_0xae73('0x30')][_0xae73('0x38')]);_0x57cff9[_0xae73('0x39')]=qs['filters'](_[_0xae73('0x3a')](_0x9dad0b['query'],_0x176c9d[_0xae73('0x31')]),_0x111a38);if(_0x9dad0b['query'][_0xae73('0x3b')]){_0x57cff9['where']=_[_0xae73('0x3c')](_0x57cff9[_0xae73('0x39')],{'$or':_[_0xae73('0x29')](_0x111a38,function(_0x10b9ce){if(_0x10b9ce[_0xae73('0x2d')]!==_0xae73('0x3d')){var _0x5e6555={};_0x5e6555[_0x10b9ce[_0xae73('0x26')]]={'$like':'%'+_0x9dad0b[_0xae73('0x30')][_0xae73('0x3b')]+'%'};return _0x5e6555;}})});}_0x57cff9=_[_0xae73('0x3c')]({},_0x57cff9,_0x9dad0b[_0xae73('0x3e')]);var _0x601389={'where':_0x57cff9[_0xae73('0x39')]};return db[_0xae73('0x2a')][_0xae73('0x1e')](_0x601389)[_0xae73('0x24')](function(_0x252e87){_0x562edc['count']=_0x252e87;if(_0x9dad0b[_0xae73('0x30')][_0xae73('0x3f')]){_0x57cff9[_0xae73('0x40')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0xae73('0x41')](_0x57cff9);})[_0xae73('0x24')](function(_0x523faf){_0x562edc[_0xae73('0x42')]=_0x523faf;return _0x562edc;})['then'](respondWithFilteredResult(_0x1c05ee,_0x57cff9))['catch'](handleError(_0x1c05ee,null));};exports[_0xae73('0x43')]=function(_0x133045,_0x121cea){var _0x58179b={'raw':!![],'where':{'id':_0x133045[_0xae73('0x44')]['id']}},_0x588f63={};_0x588f63['model']=_['keys'](db[_0xae73('0x2a')][_0xae73('0x2b')]);_0x588f63[_0xae73('0x30')]=_[_0xae73('0x45')](_0x133045[_0xae73('0x30')]);_0x588f63[_0xae73('0x31')]=_[_0xae73('0x32')](_0x588f63[_0xae73('0x2f')],_0x588f63[_0xae73('0x30')]);_0x58179b['attributes']=_[_0xae73('0x32')](_0x588f63['model'],qs[_0xae73('0x33')](_0x133045[_0xae73('0x30')][_0xae73('0x33')]));_0x58179b['attributes']=_0x58179b[_0xae73('0x34')][_0xae73('0x35')]?_0x58179b[_0xae73('0x34')]:_0x588f63['model'];if(_0x133045['query'][_0xae73('0x3f')]){_0x58179b[_0xae73('0x40')]=[{'all':!![]}];}_0x58179b=_[_0xae73('0x3c')]({},_0x58179b,_0x133045[_0xae73('0x3e')]);return db[_0xae73('0x2a')][_0xae73('0x46')](_0x58179b)['then'](handleEntityNotFound(_0x121cea,null))['then'](respondWithResult(_0x121cea,null))[_0xae73('0x47')](handleError(_0x121cea,null));};exports[_0xae73('0x48')]=function(_0x3e2cc1,_0x50ad92){return db[_0xae73('0x2a')][_0xae73('0x48')](_0x3e2cc1[_0xae73('0x49')],{})[_0xae73('0x24')](respondWithResult(_0x50ad92,0xc9))[_0xae73('0x47')](handleError(_0x50ad92,null));};exports[_0xae73('0x4a')]=function(_0xd0b09a,_0x17d92f){if(_0xd0b09a[_0xae73('0x49')]['id']){delete _0xd0b09a[_0xae73('0x49')]['id'];}return db['OpenchannelApplication'][_0xae73('0x46')]({'where':{'id':_0xd0b09a['params']['id']}})[_0xae73('0x24')](handleEntityNotFound(_0x17d92f,null))[_0xae73('0x24')](saveUpdates(_0xd0b09a[_0xae73('0x49')],null))[_0xae73('0x24')](respondWithResult(_0x17d92f,null))['catch'](handleError(_0x17d92f,null));};exports[_0xae73('0x4b')]=function(_0x44d14c,_0x47b980){return db[_0xae73('0x2a')]['find']({'where':{'id':_0x44d14c['params']['id']}})[_0xae73('0x24')](handleEntityNotFound(_0x47b980,null))[_0xae73('0x24')](removeEntity(_0x47b980,null))[_0xae73('0x47')](handleError(_0x47b980,null));}; \ No newline at end of file +var _0xa2dc=['filters','pick','merge','filter','includeAll','findAll','rows','catch','show','params','include','find','create','body','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','send','map','OpenchannelApplication','rawAttributes','fieldName','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xa2dc,0xd7));var _0xca2d=function(_0x43f489,_0x2b4fea){_0x43f489=_0x43f489-0x0;var _0x4134b4=_0xa2dc[_0x43f489];return _0x4134b4;};'use strict';var emlformat=require(_0xca2d('0x0'));var rimraf=require(_0xca2d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xca2d('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xca2d('0x3'));var Mustache=require(_0xca2d('0x4'));var util=require(_0xca2d('0x5'));var path=require(_0xca2d('0x6'));var sox=require(_0xca2d('0x7'));var csv=require(_0xca2d('0x8'));var ejs=require(_0xca2d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xca2d('0xa'));var jsforce=require(_0xca2d('0xb'));var deskjs=require(_0xca2d('0xc'));var toCsv=require(_0xca2d('0x8'));var querystring=require(_0xca2d('0xd'));var Papa=require('papaparse');var Redis=require(_0xca2d('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xca2d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xca2d('0x10'));var utils=require(_0xca2d('0x11'));var config=require(_0xca2d('0x12'));var licenseUtil=require(_0xca2d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2583fd,_0x40fcad){_0x40fcad=_0x40fcad||0xcc;return function(_0x58a1ea){if(_0x58a1ea){return _0x2583fd[_0xca2d('0x14')](_0x40fcad);}return _0x2583fd[_0xca2d('0x15')](_0x40fcad)['end']();};}function respondWithResult(_0x1d7cad,_0x18716b){_0x18716b=_0x18716b||0xc8;return function(_0x306aec){if(_0x306aec){return _0x1d7cad[_0xca2d('0x15')](_0x18716b)['json'](_0x306aec);}};}function respondWithFilteredResult(_0x23e369,_0x417923){return function(_0x5cf4e4){if(_0x5cf4e4){var _0x402fbd=typeof _0x417923[_0xca2d('0x16')]==='undefined'&&typeof _0x417923[_0xca2d('0x17')]===_0xca2d('0x18');var _0x457b4c=_0x5cf4e4['count'];var _0x24abd8=_0x402fbd?0x0:_0x417923[_0xca2d('0x16')];var _0x38cd2d=_0x402fbd?_0x5cf4e4[_0xca2d('0x19')]:_0x417923['offset']+_0x417923[_0xca2d('0x17')];var _0x2fd18b;if(_0x38cd2d>=_0x457b4c){_0x38cd2d=_0x457b4c;_0x2fd18b=0xc8;}else{_0x2fd18b=0xce;}_0x23e369[_0xca2d('0x15')](_0x2fd18b);return _0x23e369['set'](_0xca2d('0x1a'),_0x24abd8+'-'+_0x38cd2d+'/'+_0x457b4c)[_0xca2d('0x1b')](_0x5cf4e4);}return null;};}function patchUpdates(_0x5c0986){return function(_0x127281){try{jsonpatch[_0xca2d('0x1c')](_0x127281,_0x5c0986,!![]);}catch(_0x5bb2ca){return BPromise[_0xca2d('0x1d')](_0x5bb2ca);}return _0x127281[_0xca2d('0x1e')]();};}function saveUpdates(_0x2f4afa,_0x1a6f68){return function(_0x125df4){if(_0x125df4){return _0x125df4[_0xca2d('0x1f')](_0x2f4afa)[_0xca2d('0x20')](function(_0x276b41){return _0x276b41;});}return null;};}function removeEntity(_0x4150d6,_0x137fca){return function(_0x49dfa4){if(_0x49dfa4){return _0x49dfa4[_0xca2d('0x21')]()[_0xca2d('0x20')](function(){_0x4150d6['status'](0xcc)[_0xca2d('0x22')]();});}};}function handleEntityNotFound(_0x3c2e59,_0x3ff999){return function(_0x522468){if(!_0x522468){_0x3c2e59[_0xca2d('0x14')](0x194);}return _0x522468;};}function handleError(_0x1e7ce4,_0x2bdaf2){_0x2bdaf2=_0x2bdaf2||0x1f4;return function(_0x23a3f7){logger[_0xca2d('0x23')](_0x23a3f7[_0xca2d('0x24')]);if(_0x23a3f7['name']){delete _0x23a3f7['name'];}_0x1e7ce4[_0xca2d('0x15')](_0x2bdaf2)[_0xca2d('0x25')](_0x23a3f7);};}exports['index']=function(_0x329ac1,_0x317011){var _0x3e2904={},_0x53044f={},_0x691c84={'count':0x0,'rows':[]};var _0x4ba1d5=_[_0xca2d('0x26')](db[_0xca2d('0x27')][_0xca2d('0x28')],function(_0x50a770){return{'name':_0x50a770[_0xca2d('0x29')],'type':_0x50a770['type']['key']};});_0x53044f[_0xca2d('0x2a')]=_[_0xca2d('0x26')](_0x4ba1d5,_0xca2d('0x2b'));_0x53044f[_0xca2d('0x2c')]=_[_0xca2d('0x2d')](_0x329ac1[_0xca2d('0x2c')]);_0x53044f['filters']=_[_0xca2d('0x2e')](_0x53044f[_0xca2d('0x2a')],_0x53044f[_0xca2d('0x2c')]);_0x3e2904['attributes']=_['intersection'](_0x53044f[_0xca2d('0x2a')],qs['fields'](_0x329ac1['query'][_0xca2d('0x2f')]));_0x3e2904[_0xca2d('0x30')]=_0x3e2904[_0xca2d('0x30')][_0xca2d('0x31')]?_0x3e2904[_0xca2d('0x30')]:_0x53044f['model'];if(!_0x329ac1[_0xca2d('0x2c')][_0xca2d('0x32')]('nolimit')){_0x3e2904[_0xca2d('0x17')]=qs[_0xca2d('0x17')](_0x329ac1[_0xca2d('0x2c')][_0xca2d('0x17')]);_0x3e2904[_0xca2d('0x16')]=qs[_0xca2d('0x16')](_0x329ac1[_0xca2d('0x2c')][_0xca2d('0x16')]);}_0x3e2904['order']=qs[_0xca2d('0x33')](_0x329ac1[_0xca2d('0x2c')][_0xca2d('0x33')]);_0x3e2904[_0xca2d('0x34')]=qs[_0xca2d('0x35')](_[_0xca2d('0x36')](_0x329ac1[_0xca2d('0x2c')],_0x53044f[_0xca2d('0x35')]),_0x4ba1d5);if(_0x329ac1[_0xca2d('0x2c')]['filter']){_0x3e2904[_0xca2d('0x34')]=_[_0xca2d('0x37')](_0x3e2904['where'],{'$or':_[_0xca2d('0x26')](_0x4ba1d5,function(_0x51000d){if(_0x51000d['type']!=='VIRTUAL'){var _0x5cf734={};_0x5cf734[_0x51000d[_0xca2d('0x2b')]]={'$like':'%'+_0x329ac1[_0xca2d('0x2c')][_0xca2d('0x38')]+'%'};return _0x5cf734;}})});}_0x3e2904=_[_0xca2d('0x37')]({},_0x3e2904,_0x329ac1['options']);var _0x5bc40a={'where':_0x3e2904[_0xca2d('0x34')]};return db[_0xca2d('0x27')][_0xca2d('0x19')](_0x5bc40a)[_0xca2d('0x20')](function(_0x53458d){_0x691c84[_0xca2d('0x19')]=_0x53458d;if(_0x329ac1['query'][_0xca2d('0x39')]){_0x3e2904['include']=[{'all':!![]}];}return db['OpenchannelApplication'][_0xca2d('0x3a')](_0x3e2904);})[_0xca2d('0x20')](function(_0xba8b9b){_0x691c84[_0xca2d('0x3b')]=_0xba8b9b;return _0x691c84;})['then'](respondWithFilteredResult(_0x317011,_0x3e2904))[_0xca2d('0x3c')](handleError(_0x317011,null));};exports[_0xca2d('0x3d')]=function(_0x3b70bd,_0x3f6962){var _0x3053e5={'raw':!![],'where':{'id':_0x3b70bd[_0xca2d('0x3e')]['id']}},_0x5d605c={};_0x5d605c[_0xca2d('0x2a')]=_['keys'](db[_0xca2d('0x27')][_0xca2d('0x28')]);_0x5d605c['query']=_['keys'](_0x3b70bd[_0xca2d('0x2c')]);_0x5d605c[_0xca2d('0x35')]=_[_0xca2d('0x2e')](_0x5d605c['model'],_0x5d605c[_0xca2d('0x2c')]);_0x3053e5['attributes']=_[_0xca2d('0x2e')](_0x5d605c[_0xca2d('0x2a')],qs[_0xca2d('0x2f')](_0x3b70bd[_0xca2d('0x2c')][_0xca2d('0x2f')]));_0x3053e5[_0xca2d('0x30')]=_0x3053e5[_0xca2d('0x30')][_0xca2d('0x31')]?_0x3053e5['attributes']:_0x5d605c[_0xca2d('0x2a')];if(_0x3b70bd[_0xca2d('0x2c')][_0xca2d('0x39')]){_0x3053e5[_0xca2d('0x3f')]=[{'all':!![]}];}_0x3053e5=_[_0xca2d('0x37')]({},_0x3053e5,_0x3b70bd['options']);return db[_0xca2d('0x27')][_0xca2d('0x40')](_0x3053e5)[_0xca2d('0x20')](handleEntityNotFound(_0x3f6962,null))[_0xca2d('0x20')](respondWithResult(_0x3f6962,null))[_0xca2d('0x3c')](handleError(_0x3f6962,null));};exports[_0xca2d('0x41')]=function(_0x18c0b6,_0x43d8a3){return db['OpenchannelApplication'][_0xca2d('0x41')](_0x18c0b6[_0xca2d('0x42')],{})[_0xca2d('0x20')](respondWithResult(_0x43d8a3,0xc9))[_0xca2d('0x3c')](handleError(_0x43d8a3,null));};exports['update']=function(_0x3905f5,_0x4258bc){if(_0x3905f5['body']['id']){delete _0x3905f5[_0xca2d('0x42')]['id'];}return db[_0xca2d('0x27')][_0xca2d('0x40')]({'where':{'id':_0x3905f5[_0xca2d('0x3e')]['id']}})[_0xca2d('0x20')](handleEntityNotFound(_0x4258bc,null))[_0xca2d('0x20')](saveUpdates(_0x3905f5[_0xca2d('0x42')],null))[_0xca2d('0x20')](respondWithResult(_0x4258bc,null))[_0xca2d('0x3c')](handleError(_0x4258bc,null));};exports['destroy']=function(_0x7afb36,_0x2f0013){return db[_0xca2d('0x27')][_0xca2d('0x40')]({'where':{'id':_0x7afb36[_0xca2d('0x3e')]['id']}})[_0xca2d('0x20')](handleEntityNotFound(_0x2f0013,null))[_0xca2d('0x20')](removeEntity(_0x2f0013,null))[_0xca2d('0x3c')](handleError(_0x2f0013,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 5c23fc0..a3bbfed 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 _0xd1cf=['utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','OpenchannelApplication','openchannel_applications'];(function(_0x8c2e4e,_0x3c105b){var _0x2286bb=function(_0x31bef7){while(--_0x31bef7){_0x8c2e4e['push'](_0x8c2e4e['shift']());}};_0x2286bb(++_0x3c105b);}(_0xd1cf,0x160));var _0xfd1c=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xd1cf[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xfd1c('0x0'));var util=require(_0xfd1c('0x1'));var logger=require(_0xfd1c('0x2'))(_0xfd1c('0x3'));var moment=require('moment');var BPromise=require(_0xfd1c('0x4'));var rp=require(_0xfd1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd1c('0x6'));var config=require(_0xfd1c('0x7'));var attributes=require('./openchannelApplication.attributes');module[_0xfd1c('0x8')]=function(_0x5d5f52,_0x41f1bd){return _0x5d5f52[_0xfd1c('0x9')](_0xfd1c('0xa'),attributes,{'tableName':_0xfd1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfd1c('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7373=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x7373,0x168));var _0x3737=function(_0x5d2d78,_0x4f041f){_0x5d2d78=_0x5d2d78-0x0;var _0x42abde=_0x7373[_0x5d2d78];return _0x42abde;};'use strict';var _=require(_0x3737('0x0'));var util=require(_0x3737('0x1'));var logger=require('../../config/logger')(_0x3737('0x2'));var moment=require(_0x3737('0x3'));var BPromise=require(_0x3737('0x4'));var rp=require(_0x3737('0x5'));var fs=require('fs');var path=require(_0x3737('0x6'));var rimraf=require(_0x3737('0x7'));var config=require('../../config/environment');var attributes=require(_0x3737('0x8'));module[_0x3737('0x9')]=function(_0x40e243,_0x4af34a){return _0x40e243[_0x3737('0xa')](_0x3737('0xb'),attributes,{'tableName':_0x3737('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3737('0xd'),'collate':_0x3737('0xe')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 80a6527..c2397d1 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 _0x9c89=['client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','body','raw','options','where','attributes','limit','UpdateOpenchannelApplication','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ac6a3,_0x35a245){var _0x61c6a9=function(_0x5104c0){while(--_0x5104c0){_0x2ac6a3['push'](_0x2ac6a3['shift']());}};_0x61c6a9(++_0x35a245);}(_0x9c89,0x9f));var _0x99c8=function(_0x3a6d1a,_0x9bef50){_0x3a6d1a=_0x3a6d1a-0x0;var _0x5165dc=_0x9c89[_0x3a6d1a];return _0x5165dc;};'use strict';var _=require('lodash');var util=require(_0x99c8('0x0'));var moment=require(_0x99c8('0x1'));var BPromise=require(_0x99c8('0x2'));var rs=require(_0x99c8('0x3'));var fs=require('fs');var Redis=require(_0x99c8('0x4'));var db=require(_0x99c8('0x5'))['db'];var utils=require(_0x99c8('0x6'));var logger=require(_0x99c8('0x7'))(_0x99c8('0x8'));var config=require(_0x99c8('0x9'));var jayson=require(_0x99c8('0xa'));var client=jayson[_0x99c8('0xb')][_0x99c8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x533b55,_0x566fd2,_0x301170){return new BPromise(function(_0x2a3db7,_0x137317){return client[_0x99c8('0xd')](_0x533b55,_0x301170)[_0x99c8('0xe')](function(_0x217024){logger[_0x99c8('0xf')](_0x99c8('0x10'),_0x566fd2,_0x99c8('0x11'));logger[_0x99c8('0x12')](_0x99c8('0x13'),_0x566fd2,_0x99c8('0x11'),JSON[_0x99c8('0x14')](_0x217024));if(_0x217024['error']){if(_0x217024[_0x99c8('0x15')][_0x99c8('0x16')]===0x1f4){logger[_0x99c8('0x15')](_0x99c8('0x10'),_0x566fd2,_0x217024['error'][_0x99c8('0x17')]);return _0x137317(_0x217024[_0x99c8('0x15')]['message']);}logger[_0x99c8('0x15')]('OpenchannelApplication,\x20%s,\x20%s',_0x566fd2,_0x217024[_0x99c8('0x15')][_0x99c8('0x17')]);return _0x2a3db7(_0x217024[_0x99c8('0x15')]['message']);}else{logger[_0x99c8('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x566fd2,_0x99c8('0x11'));_0x2a3db7(_0x217024[_0x99c8('0x18')][_0x99c8('0x17')]);}})[_0x99c8('0x19')](function(_0x32a515){logger['error'](_0x99c8('0x10'),_0x566fd2,_0x32a515);_0x137317(_0x32a515);});});}exports['UpdateOpenchannelApplication']=function(_0x36e119){var _0x2af952=this;return new Promise(function(_0xa97b1b,_0x538592){return db[_0x99c8('0x1a')]['update'](_0x36e119[_0x99c8('0x1b')],{'raw':_0x36e119['options']?_0x36e119['options'][_0x99c8('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36e119[_0x99c8('0x1d')]?_0x36e119[_0x99c8('0x1d')][_0x99c8('0x1e')]||null:null,'attributes':_0x36e119[_0x99c8('0x1d')]?_0x36e119[_0x99c8('0x1d')][_0x99c8('0x1f')]||null:null,'limit':_0x36e119['options']?_0x36e119[_0x99c8('0x1d')][_0x99c8('0x20')]||null:null})[_0x99c8('0xe')](function(_0x3bc86d){logger[_0x99c8('0xf')](_0x99c8('0x21'),_0x36e119);logger[_0x99c8('0x12')]('UpdateOpenchannelApplication',_0x36e119,JSON[_0x99c8('0x14')](_0x3bc86d));_0xa97b1b(_0x3bc86d);})[_0x99c8('0x19')](function(_0x24f63a){logger[_0x99c8('0x15')](_0x99c8('0x21'),_0x24f63a['message'],_0x36e119);_0x538592(_0x2af952[_0x99c8('0x15')](0x1f4,_0x24f63a[_0x99c8('0x17')]));});});}; \ No newline at end of file +var _0x3b69=['jayson/promise','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','OpenchannelApplication','options','raw','where','attributes','UpdateOpenchannelApplication','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3b69,0x170));var _0x93b6=function(_0x5d1bb5,_0x164e50){_0x5d1bb5=_0x5d1bb5-0x0;var _0x3f4816=_0x3b69[_0x5d1bb5];return _0x3f4816;};'use strict';var _=require(_0x93b6('0x0'));var util=require(_0x93b6('0x1'));var moment=require(_0x93b6('0x2'));var BPromise=require(_0x93b6('0x3'));var rs=require(_0x93b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x93b6('0x5'))['db'];var utils=require(_0x93b6('0x6'));var logger=require('../../config/logger')(_0x93b6('0x7'));var config=require(_0x93b6('0x8'));var jayson=require(_0x93b6('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xc10528,_0x2b1e8c,_0x339815){return new BPromise(function(_0x31d37e,_0x361a5f){return client[_0x93b6('0xa')](_0xc10528,_0x339815)[_0x93b6('0xb')](function(_0x218dcb){logger[_0x93b6('0xc')](_0x93b6('0xd'),_0x2b1e8c,_0x93b6('0xe'));logger[_0x93b6('0xf')](_0x93b6('0x10'),_0x2b1e8c,'request\x20sent',JSON[_0x93b6('0x11')](_0x218dcb));if(_0x218dcb['error']){if(_0x218dcb[_0x93b6('0x12')][_0x93b6('0x13')]===0x1f4){logger[_0x93b6('0x12')](_0x93b6('0xd'),_0x2b1e8c,_0x218dcb[_0x93b6('0x12')][_0x93b6('0x14')]);return _0x361a5f(_0x218dcb['error'][_0x93b6('0x14')]);}logger[_0x93b6('0x12')]('OpenchannelApplication,\x20%s,\x20%s',_0x2b1e8c,_0x218dcb[_0x93b6('0x12')]['message']);return _0x31d37e(_0x218dcb[_0x93b6('0x12')]['message']);}else{logger[_0x93b6('0xc')](_0x93b6('0xd'),_0x2b1e8c,_0x93b6('0xe'));_0x31d37e(_0x218dcb[_0x93b6('0x15')][_0x93b6('0x14')]);}})['catch'](function(_0x117303){logger['error'](_0x93b6('0xd'),_0x2b1e8c,_0x117303);_0x361a5f(_0x117303);});});}exports['UpdateOpenchannelApplication']=function(_0x3f2942){var _0x171335=this;return new Promise(function(_0x261179,_0xc7ce16){return db[_0x93b6('0x16')]['update'](_0x3f2942['body'],{'raw':_0x3f2942[_0x93b6('0x17')]?_0x3f2942[_0x93b6('0x17')][_0x93b6('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f2942[_0x93b6('0x17')]?_0x3f2942['options'][_0x93b6('0x19')]||null:null,'attributes':_0x3f2942[_0x93b6('0x17')]?_0x3f2942[_0x93b6('0x17')][_0x93b6('0x1a')]||null:null,'limit':_0x3f2942['options']?_0x3f2942[_0x93b6('0x17')]['limit']||null:null})[_0x93b6('0xb')](function(_0x519200){logger['info'](_0x93b6('0x1b'),_0x3f2942);logger[_0x93b6('0xf')](_0x93b6('0x1b'),_0x3f2942,JSON['stringify'](_0x519200));_0x261179(_0x519200);})[_0x93b6('0x1c')](function(_0x55f89e){logger[_0x93b6('0x12')](_0x93b6('0x1b'),_0x55f89e[_0x93b6('0x14')],_0x3f2942);_0xc7ce16(_0x171335[_0x93b6('0x12')](0x1f4,_0x55f89e[_0x93b6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 90d1262..05b86be 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 _0x34f9=['addTags','openchannelinteraction:update','update','openchannelinteraction:destroy','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','post','/:id/tags','tracked','openchannel'];(function(_0x15f1e1,_0x10f485){var _0x48c220=function(_0x44df07){while(--_0x44df07){_0x15f1e1['push'](_0x15f1e1['shift']());}};_0x48c220(++_0x10f485);}(_0x34f9,0x19b));var _0x934f=function(_0x537fd5,_0x3b9d5c){_0x537fd5=_0x537fd5-0x0;var _0xf9ceae=_0x34f9[_0x537fd5];return _0xf9ceae;};'use strict';var multer=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var path=require(_0x934f('0x2'));var timeout=require(_0x934f('0x3'));var express=require(_0x934f('0x4'));var router=express[_0x934f('0x5')]();var fs_extra=require(_0x934f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x934f('0x7'));var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router[_0x934f('0x8')]('/',auth[_0x934f('0x9')](),controller[_0x934f('0xa')]);router[_0x934f('0x8')](_0x934f('0xb'),auth[_0x934f('0x9')](),controller[_0x934f('0xc')]);router[_0x934f('0x8')](_0x934f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x934f('0x8')](_0x934f('0xe'),auth[_0x934f('0x9')](),controller['getMessages']);router[_0x934f('0x8')](_0x934f('0xf'),auth[_0x934f('0x9')](),controller[_0x934f('0x10')]);router[_0x934f('0x11')]('/',auth[_0x934f('0x9')](),controller['create']);router['post'](_0x934f('0xe'),auth['isAuthenticated'](),controller['addMessage']);router['post'](_0x934f('0x12'),auth['isAuthenticated'](),interaction[_0x934f('0x13')](_0x934f('0x14'),'openchannelinteraction:addtags'),controller[_0x934f('0x15')]);router['put'](_0x934f('0xd'),auth[_0x934f('0x9')](),interaction[_0x934f('0x13')](_0x934f('0x14'),_0x934f('0x16')),controller[_0x934f('0x17')]);router['delete'](_0x934f('0xd'),auth[_0x934f('0x9')](),interaction[_0x934f('0x13')](_0x934f('0x14'),_0x934f('0x18')),controller['destroy']);router[_0x934f('0x19')](_0x934f('0x12'),auth[_0x934f('0x9')](),controller['removeTags']);module[_0x934f('0x1a')]=router; \ No newline at end of file +var _0x61f5=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','isAuthenticated','index','/describe','/:id','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','exports','multer','connect-timeout','express'];(function(_0x2e1c02,_0x3be155){var _0x2258a2=function(_0x4f2e5d){while(--_0x4f2e5d){_0x2e1c02['push'](_0x2e1c02['shift']());}};_0x2258a2(++_0x3be155);}(_0x61f5,0x152));var _0x561f=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x61f5[_0x26462c];return _0x509a42;};'use strict';var multer=require(_0x561f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x561f('0x1'));var express=require(_0x561f('0x2'));var router=express[_0x561f('0x3')]();var fs_extra=require(_0x561f('0x4'));var auth=require(_0x561f('0x5'));var interaction=require(_0x561f('0x6'));var config=require(_0x561f('0x7'));var controller=require(_0x561f('0x8'));router[_0x561f('0x9')]('/',auth[_0x561f('0xa')](),controller[_0x561f('0xb')]);router['get'](_0x561f('0xc'),auth[_0x561f('0xa')](),controller['describe']);router['get'](_0x561f('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x561f('0x9')](_0x561f('0xe'),auth['isAuthenticated'](),controller['getMessages']);router[_0x561f('0x9')](_0x561f('0xf'),auth[_0x561f('0xa')](),controller[_0x561f('0x10')]);router[_0x561f('0x11')]('/',auth['isAuthenticated'](),controller[_0x561f('0x12')]);router[_0x561f('0x11')](_0x561f('0xe'),auth[_0x561f('0xa')](),controller[_0x561f('0x13')]);router[_0x561f('0x11')](_0x561f('0x14'),auth[_0x561f('0xa')](),interaction[_0x561f('0x15')](_0x561f('0x16'),_0x561f('0x17')),controller['addTags']);router[_0x561f('0x18')](_0x561f('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0x561f('0x16'),_0x561f('0x19')),controller[_0x561f('0x1a')]);router[_0x561f('0x1b')](_0x561f('0xd'),auth[_0x561f('0xa')](),interaction[_0x561f('0x15')]('openchannel',_0x561f('0x1c')),controller[_0x561f('0x1d')]);router[_0x561f('0x1b')](_0x561f('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x561f('0x1e')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index cb55114..3cdb0f4 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 _0x7345=['BOOLEAN','STRING','DATE','ENUM','out','sequelize','exports'];(function(_0x19cae9,_0xd6039b){var _0x163452=function(_0xee5d92){while(--_0xee5d92){_0x19cae9['push'](_0x19cae9['shift']());}};_0x163452(++_0xd6039b);}(_0x7345,0x163));var _0x5734=function(_0x58b0d8,_0x455db2){_0x58b0d8=_0x58b0d8-0x0;var _0x6d7aa=_0x7345[_0x58b0d8];return _0x6d7aa;};'use strict';var Sequelize=require(_0x5734('0x0'));module[_0x5734('0x1')]={'closed':{'type':Sequelize[_0x5734('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x5734('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x5734('0x3')]},'read1stAt':{'type':Sequelize[_0x5734('0x4')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x5734('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x5734('0x5')]('in',_0x5734('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x5734('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x5734('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xbaad=['STRING','ENUM','out','sequelize','exports','BOOLEAN','DATE'];(function(_0x5bc5d0,_0x4bb39a){var _0x2ace68=function(_0xb4a8ef){while(--_0xb4a8ef){_0x5bc5d0['push'](_0x5bc5d0['shift']());}};_0x2ace68(++_0x4bb39a);}(_0xbaad,0x1e6));var _0xdbaa=function(_0x290b71,_0xb55d95){_0x290b71=_0x290b71-0x0;var _0x1e8747=_0xbaad[_0x290b71];return _0x1e8747;};'use strict';var Sequelize=require(_0xdbaa('0x0'));module[_0xdbaa('0x1')]={'closed':{'type':Sequelize[_0xdbaa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xdbaa('0x3')]},'disposition':{'type':Sequelize[_0xdbaa('0x4')]},'secondDisposition':{'type':Sequelize[_0xdbaa('0x4')]},'thirdDisposition':{'type':Sequelize[_0xdbaa('0x4')]},'note':{'type':Sequelize[_0xdbaa('0x4')]},'read1stAt':{'type':Sequelize[_0xdbaa('0x3')]},'threadId':{'type':Sequelize[_0xdbaa('0x4')]},'externalUrl':{'type':Sequelize[_0xdbaa('0x4')]},'lastMsgAt':{'type':Sequelize[_0xdbaa('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xdbaa('0x5')]('in',_0xdbaa('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xdbaa('0x4')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 63a8694..d68d0c6 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 _0xe2bf=['c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$gte','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)','i.from\x20LIKE\x20?','group','i.id','SELECT','clone','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','agent','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','role','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.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.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','catch','show','includeAll','include','options','create','params','describe','OpenchannelMessage','addMessage','ids','omit','getMessages','format','findAll','rows','addTags','setTags','emit','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','Owner','get','Openchannel','closedAt','YYYY-MM-DD\x20HH:mm:ss','disposition','threadId','Public','Private','basename','existsSync','createReadStream','pipe','createWriteStream','out','System','views','downloadInteraction.ejs','createPdfFromHTML','log','err','unlinkSync','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','sendStatus','error','stack','name','send','Users','fullname','TagIds','split','forEach','Tags','push','waiting','talking','answered','unmanaged','UserId','closed','index','map','OpenchannelInteraction','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue'];(function(_0x397bde,_0x3d168b){var _0x2a84dd=function(_0x44b8b8){while(--_0x44b8b8){_0x397bde['push'](_0x397bde['shift']());}};_0x2a84dd(++_0x3d168b);}(_0xe2bf,0x180));var _0xfe2b=function(_0x57ae2b,_0x257238){_0x57ae2b=_0x57ae2b-0x0;var _0x5272ac=_0xe2bf[_0x57ae2b];return _0x5272ac;};'use strict';var emlformat=require(_0xfe2b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe2b('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe2b('0x2'));var moment=require(_0xfe2b('0x3'));var BPromise=require(_0xfe2b('0x4'));var Mustache=require(_0xfe2b('0x5'));var util=require(_0xfe2b('0x6'));var path=require(_0xfe2b('0x7'));var sox=require(_0xfe2b('0x8'));var csv=require(_0xfe2b('0x9'));var ejs=require(_0xfe2b('0xa'));var fs=require('fs');var fs_extra=require(_0xfe2b('0xb'));var _=require(_0xfe2b('0xc'));var squel=require(_0xfe2b('0xd'));var crypto=require(_0xfe2b('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfe2b('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe2b('0xf'));var authService=require(_0xfe2b('0x10'));var qs=require(_0xfe2b('0x11'));var as=require(_0xfe2b('0x12'));var pdf=require(_0xfe2b('0x13'));var hardwareService=require(_0xfe2b('0x14'));var logger=require(_0xfe2b('0x15'))(_0xfe2b('0x16'));var utils=require('../../config/utils');var config=require(_0xfe2b('0x17'));var licenseUtil=require(_0xfe2b('0x18'));var db=require(_0xfe2b('0x19'))['db'];config[_0xfe2b('0x1a')]=_[_0xfe2b('0x1b')](config['redis'],{'host':_0xfe2b('0x1c'),'port':0x18eb});var socket=require(_0xfe2b('0x1d'))(new Redis(config[_0xfe2b('0x1a')]));require(_0xfe2b('0x1e'))[_0xfe2b('0x1f')](socket);function respondWithStatusCode(_0xf5ae20,_0x2fd274){_0x2fd274=_0x2fd274||0xcc;return function(_0x54701c){if(_0x54701c){return _0xf5ae20['sendStatus'](_0x2fd274);}return _0xf5ae20[_0xfe2b('0x20')](_0x2fd274)[_0xfe2b('0x21')]();};}function respondWithResult(_0x5c190e,_0x39e8d4){_0x39e8d4=_0x39e8d4||0xc8;return function(_0x51c2c2){if(_0x51c2c2){return _0x5c190e['status'](_0x39e8d4)[_0xfe2b('0x22')](_0x51c2c2);}};}function respondWithFilteredResult(_0x52623c,_0x40d24d){return function(_0x566526){if(_0x566526){var _0x58b39c=typeof _0x40d24d[_0xfe2b('0x23')]===_0xfe2b('0x24')&&typeof _0x40d24d[_0xfe2b('0x25')]===_0xfe2b('0x24');var _0x4cd2a7=_0x566526[_0xfe2b('0x26')];var _0x561664=_0x58b39c?0x0:_0x40d24d[_0xfe2b('0x23')];var _0x11ce57=_0x58b39c?_0x566526[_0xfe2b('0x26')]:_0x40d24d[_0xfe2b('0x23')]+_0x40d24d['limit'];var _0x45a7e1;if(_0x11ce57>=_0x4cd2a7){_0x11ce57=_0x4cd2a7;_0x45a7e1=0xc8;}else{_0x45a7e1=0xce;}_0x52623c[_0xfe2b('0x20')](_0x45a7e1);return _0x52623c[_0xfe2b('0x27')](_0xfe2b('0x28'),_0x561664+'-'+_0x11ce57+'/'+_0x4cd2a7)[_0xfe2b('0x22')](_0x566526);}return null;};}function patchUpdates(_0x436b08){return function(_0xb9aa49){try{jsonpatch['apply'](_0xb9aa49,_0x436b08,!![]);}catch(_0x569f69){return BPromise[_0xfe2b('0x29')](_0x569f69);}return _0xb9aa49['save']();};}function saveUpdates(_0x3ec61e,_0x189873){return function(_0x2324ac){if(_0x2324ac){return _0x2324ac[_0xfe2b('0x2a')](_0x3ec61e)['then'](function(_0x1d3f50){return _0x1d3f50;});}return null;};}function removeEntity(_0x20eab0,_0x3601c3){return function(_0x3975b6){if(_0x3975b6){return _0x3975b6[_0xfe2b('0x2b')]()[_0xfe2b('0x2c')](function(){_0x20eab0['status'](0xcc)[_0xfe2b('0x21')]();});}};}function handleEntityNotFound(_0x34f85f,_0x4fee28){return function(_0x1c5046){if(!_0x1c5046){_0x34f85f[_0xfe2b('0x2d')](0x194);}return _0x1c5046;};}function handleError(_0x339812,_0x55285d){_0x55285d=_0x55285d||0x1f4;return function(_0xc0122d){logger[_0xfe2b('0x2e')](_0xc0122d[_0xfe2b('0x2f')]);if(_0xc0122d[_0xfe2b('0x30')]){delete _0xc0122d[_0xfe2b('0x30')];}_0x339812[_0xfe2b('0x20')](_0x55285d)[_0xfe2b('0x31')](_0xc0122d);};}function getInteractionUsers(_0x3fca1a,_0x1ac846){return new BPromise(function(_0x603328,_0x15e73f){try{if(_0x1ac846[_0x3fca1a['id']]){_0x3fca1a[_0xfe2b('0x32')]=_['map'](_0x1ac846[_0x3fca1a['id']],function(_0x17902d){return{'id':_0x17902d['id'],'fullname':_0x17902d[_0xfe2b('0x33')]};});}}catch(_0x44bd3f){_0x15e73f(_0x44bd3f);}_0x603328(_0x3fca1a);});}function getInteractionTags(_0x4f3f9b,_0x6798b8){return new BPromise(function(_0x3906e2,_0x3e5001){try{if(_0x4f3f9b[_0xfe2b('0x34')]){_0x4f3f9b['Tags']=[];_0x4f3f9b[_0xfe2b('0x34')][_0xfe2b('0x35')](',')[_0xfe2b('0x36')](function(_0x360b5b){_0x4f3f9b[_0xfe2b('0x37')][_0xfe2b('0x38')](_0x6798b8[_0x360b5b]);});}delete _0x4f3f9b[_0xfe2b('0x34')];}catch(_0x15b82e){_0x3e5001(_0x15b82e);}_0x3906e2(_0x4f3f9b);});}function updateOpenchannelInteraction(_0x106546,_0x5ac2dc,_0x54112){return new BPromise(function(_0x3faeb1,_0x4779f2){return getInteractionUsers(_0x106546,_0x54112)[_0xfe2b('0x2c')](function(_0x1123c8){return getInteractionTags(_0x1123c8,_0x5ac2dc);})[_0xfe2b('0x2c')](function(_0x391a56){return getStateInteraction(_0x391a56);})[_0xfe2b('0x2c')](function(_0x1e1114){_0x3faeb1(_0x1e1114);})['catch'](function(_0x58c5f1){_0x4779f2(_0x58c5f1);});});}function getStateInteraction(_0x2c8cc9){return new BPromise(function(_0x4f3ec6){_0x2c8cc9[_0xfe2b('0x39')]=0x0;_0x2c8cc9[_0xfe2b('0x3a')]=0x0;_0x2c8cc9[_0xfe2b('0x3b')]=0x0;_0x2c8cc9[_0xfe2b('0x3c')]=0x0;_0x2c8cc9['total']=0x0;if(!_0x2c8cc9['closed']&&!_0x2c8cc9[_0xfe2b('0x3d')]){_0x2c8cc9['waiting']+=0x1;}if(!_0x2c8cc9[_0xfe2b('0x3e')]&&_0x2c8cc9[_0xfe2b('0x3d')]){_0x2c8cc9[_0xfe2b('0x3a')]+=0x1;if(_0x2c8cc9[_0xfe2b('0x39')]){_0x2c8cc9[_0xfe2b('0x39')]-=0x1;}}if(_0x2c8cc9[_0xfe2b('0x3e')]&&_0x2c8cc9[_0xfe2b('0x3d')]){_0x2c8cc9['answered']+=0x1;if(_0x2c8cc9[_0xfe2b('0x3a')]){_0x2c8cc9[_0xfe2b('0x3a')]-=0x1;}}if(_0x2c8cc9[_0xfe2b('0x3e')]&&!_0x2c8cc9['UserId']){_0x2c8cc9[_0xfe2b('0x3c')]+=0x1;if(_0x2c8cc9['waiting']){_0x2c8cc9['waiting']-=0x1;}}_0x2c8cc9['total']+=0x1;_0x4f3ec6(_0x2c8cc9);});}exports[_0xfe2b('0x3f')]=function(_0x492e15,_0x530e9e){var _0x3e1d39={},_0x367dbd={},_0x2867b2={'count':0x0,'rows':[]};var _0x11f2f1=_[_0xfe2b('0x40')](db[_0xfe2b('0x41')][_0xfe2b('0x42')],function(_0x559a99){return{'name':_0x559a99['fieldName'],'type':_0x559a99[_0xfe2b('0x43')][_0xfe2b('0x44')]};});_0x367dbd[_0xfe2b('0x45')]=_[_0xfe2b('0x40')](_0x11f2f1,_0xfe2b('0x30'));_0x367dbd[_0xfe2b('0x46')]=_[_0xfe2b('0x47')](_0x492e15['query']);_0x367dbd[_0xfe2b('0x48')]=_['intersection'](_0x367dbd['model'],_0x367dbd['query']);_0x3e1d39[_0xfe2b('0x49')]=_[_0xfe2b('0x4a')](_0x367dbd[_0xfe2b('0x45')],qs[_0xfe2b('0x4b')](_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x4b')]));_0x3e1d39['attributes']=_0x3e1d39[_0xfe2b('0x49')][_0xfe2b('0x4c')]?_0x3e1d39['attributes']:_0x367dbd['model'];if(!_0x492e15['query'][_0xfe2b('0x4d')](_0xfe2b('0x4e'))){_0x3e1d39[_0xfe2b('0x25')]=qs['limit'](_0x492e15[_0xfe2b('0x46')]['limit']);_0x3e1d39['offset']=qs[_0xfe2b('0x23')](_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x23')]);}_0x3e1d39[_0xfe2b('0x4f')]=qs[_0xfe2b('0x50')](_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x50')]);_0x3e1d39[_0xfe2b('0x51')]=qs[_0xfe2b('0x48')](_[_0xfe2b('0x52')](_0x492e15['query'],_0x367dbd[_0xfe2b('0x48')]),_0x11f2f1);var _0x61341a=[];var _0x4c5229=squel[_0xfe2b('0x53')]()['field']('id')['field'](_0xfe2b('0x30'))[_0xfe2b('0x54')](_0xfe2b('0x55'))['from'](_0xfe2b('0x56'));var _0xf5ff6b=squel[_0xfe2b('0x53')]()['field'](_0xfe2b('0x57'))['field'](_0xfe2b('0x58'))[_0xfe2b('0x54')](_0xfe2b('0x59'))[_0xfe2b('0x5a')](_0xfe2b('0x5b'),'ui')['left_join'](_0xfe2b('0x5c'),'u','u.id\x20=\x20ui.UserId');var _0x2a39f8=squel[_0xfe2b('0x53')]()[_0xfe2b('0x5a')](_0xfe2b('0x5d'),'i')['left_join'](_0xfe2b('0x5e'),'c',_0xfe2b('0x5f'))[_0xfe2b('0x60')](_0xfe2b('0x5c'),'o','o.id\x20=\x20i.UserId')['left_join'](_0xfe2b('0x61'),'a',_0xfe2b('0x62'))['left_join'](_0xfe2b('0x63'),'me','me.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0xfe2b('0x64'),'it',_0xfe2b('0x65'))[_0xfe2b('0x60')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0x3fe992=squel[_0xfe2b('0x66')]();var _0x64fd06=[];var _0x4e471d=squel[_0xfe2b('0x66')]();var _0x25e86a;if(_0x492e15[_0xfe2b('0x46')]['search']){_0x25e86a=as[_0xfe2b('0x67')](_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x68')]);var _0x3e17ca=_0x25e86a[_0xfe2b('0x69')];for(var _0x163764=0x0;_0x163764<_0x25e86a['conditions'][_0xfe2b('0x4c')];_0x163764++){var _0x5bdea6=_0x25e86a[_0xfe2b('0x6a')][_0x163764];var _0x492d2c='i';var _0x1b4235=_[_0xfe2b('0x6b')](_0x11f2f1,[_0xfe2b('0x30'),_0x5bdea6[_0xfe2b('0x54')]]);if(!_0x1b4235){switch(_0x5bdea6[_0xfe2b('0x54')]){case _0xfe2b('0x6c'):if(_0x5bdea6[_0xfe2b('0x6d')]==0x1){_0x2a39f8[_0xfe2b('0x6e')]('`'+_0x5bdea6[_0xfe2b('0x54')]+_0xfe2b('0x6f'));}else{_0x2a39f8['having']('`'+_0x5bdea6[_0xfe2b('0x54')]+_0xfe2b('0x70'));}break;case _0xfe2b('0x71'):if(_0x5bdea6[_0xfe2b('0x72')]===_0xfe2b('0x73')){if(_0x5bdea6['value']['split']('\x20')[_0xfe2b('0x4c')]>0x1){_0x3fe992[_0x3e17ca](_0xfe2b('0x74'),qs[_0xfe2b('0x75')](_0x5bdea6[_0xfe2b('0x6d')]),null);}else{var _0x3d9aa8='%'+_0x5bdea6[_0xfe2b('0x6d')]+'%';_0x3fe992[_0x3e17ca](_0xfe2b('0x76'),_0x3d9aa8,_0x3d9aa8,_0x3d9aa8);}}else{_0x1b4235=_[_0xfe2b('0x6b')](_0x11f2f1,['name',_0xfe2b('0x77')]);_0x5bdea6[_0xfe2b('0x54')]=_0xfe2b('0x77');_0x242fdb=as[_0xfe2b('0x78')](_0x492d2c,_0x1b4235['type'],_0x5bdea6);_0x3fe992[_0x3e17ca](_0x242fdb[_0xfe2b('0x79')],_0x242fdb['value'][_0xfe2b('0x7a')],_0x242fdb[_0xfe2b('0x6d')][_0xfe2b('0x21')]);}break;case _0xfe2b('0x7b'):var _0x31f5b3=_0x5bdea6[_0xfe2b('0x6d')][_0xfe2b('0x35')](',')[_0xfe2b('0x40')](function(_0x527111){return Number(_0x527111);});_0x31f5b3[_0xfe2b('0x36')](function(_0x1e9e71){_0x4e471d['or'](_0xfe2b('0x7c'),'%,'+_0x1e9e71+',%');});_0x64fd06=_['union'](_0x64fd06,_0x31f5b3);break;case _0xfe2b('0x7d'):if(_0x5bdea6[_0xfe2b('0x72')]===_0xfe2b('0x73')){_0x3fe992[_0x3e17ca](_0xfe2b('0x7e'),'%'+_0x5bdea6[_0xfe2b('0x6d')]+'%',null);}else{_0x1b4235=_['find'](_0x11f2f1,[_0xfe2b('0x30'),_0xfe2b('0x3d')]);_0x5bdea6[_0xfe2b('0x54')]=_0xfe2b('0x3d');_0x242fdb=as[_0xfe2b('0x78')](_0x492d2c,_0x1b4235[_0xfe2b('0x43')],_0x5bdea6);_0x3fe992[_0x3e17ca](_0x242fdb[_0xfe2b('0x79')],_0x242fdb[_0xfe2b('0x6d')][_0xfe2b('0x7a')],_0x242fdb[_0xfe2b('0x6d')][_0xfe2b('0x21')]);}break;case _0xfe2b('0x7f'):_0x242fdb=as[_0xfe2b('0x78')]('me',null,_0x5bdea6);_0x3fe992[_0x3e17ca](_0x242fdb[_0xfe2b('0x79')],_0x242fdb[_0xfe2b('0x6d')]['start'],_0x242fdb[_0xfe2b('0x6d')]['end']);break;}}else{var _0x242fdb=as[_0xfe2b('0x78')](_0x492d2c,_0x1b4235[_0xfe2b('0x43')],_0x5bdea6);_0x3fe992[_0x3e17ca](_0x242fdb[_0xfe2b('0x79')],_0x242fdb[_0xfe2b('0x6d')][_0xfe2b('0x7a')],_0x242fdb[_0xfe2b('0x6d')][_0xfe2b('0x21')]);}}}else{var _0x54b667=_(_0x492e15[_0xfe2b('0x46')])[_0xfe2b('0x47')]()[_0xfe2b('0x40')](function(_0xa54a9c){return _[_0xfe2b('0x80')](_0x11f2f1,[_0xfe2b('0x30'),_0xa54a9c])?_0xa54a9c:undefined;})[_0xfe2b('0x81')]()[_0xfe2b('0x6d')]();if(!_[_0xfe2b('0x82')](_0x54b667)){_0x54b667[_0xfe2b('0x36')](function(_0x3c80de){if(_0x3c80de===_0xfe2b('0x83')){_0x2a39f8[_0xfe2b('0x51')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x492e15[_0xfe2b('0x46')][_0x3c80de]));}else if(_0x3c80de===_0xfe2b('0x84')){var _0x7540ce=JSON[_0xfe2b('0x85')](_0x492e15[_0xfe2b('0x46')][_0x3c80de])[_0xfe2b('0x86')];var _0x239db8=JSON[_0xfe2b('0x85')](_0x492e15[_0xfe2b('0x46')][_0x3c80de])['$lte'];_0x2a39f8[_0xfe2b('0x51')](_0xfe2b('0x87'),_0x7540ce,_0x239db8);}else{if(_0x492e15[_0xfe2b('0x46')][_0x3c80de]===_0xfe2b('0x88')){_0x2a39f8[_0xfe2b('0x51')]('i.'+_0x3c80de+_0xfe2b('0x89'));}else{_0x2a39f8[_0xfe2b('0x51')]('i.'+_0x3c80de+_0xfe2b('0x8a'),_0x492e15[_0xfe2b('0x46')][_0x3c80de]);}}});}if(_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8b')]){if(_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8b')]==0x1){_0x2a39f8[_0xfe2b('0x6e')](_0xfe2b('0x8c'));}else{_0x2a39f8[_0xfe2b('0x6e')]('`unreadMessages`\x20>\x200');}}if(_0x492e15['query'][_0xfe2b('0x8d')]){_0x64fd06=_[_0xfe2b('0x8e')](_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8d')])?_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8d')]:new Array(_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8d')]);_0x64fd06[_0xfe2b('0x36')](function(_0x21a334){_0x4e471d['or'](_0xfe2b('0x7c'),'%,'+_0x21a334+',%');});}if(_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x8f')]){var _0x20ac0c=_0x492e15['query'][_0xfe2b('0x8f')][_0xfe2b('0x90')]('\x5c','\x5c\x5c')[_0xfe2b('0x90')](/'/g,'\x27\x27');if(qs[_0xfe2b('0x91')](_0x20ac0c)){_0x3fe992['or'](_0xfe2b('0x92'),_0x20ac0c+'%');}else{_0x3fe992['or'](_0xfe2b('0x93'),qs['getFullTextValue'](_0x20ac0c))['or'](_0xfe2b('0x94'),_0x20ac0c+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x20ac0c+'%');}}}_0x2a39f8[_0xfe2b('0x51')](_0x3fe992);_0x2a39f8[_0xfe2b('0x95')](_0xfe2b('0x96'));var _0x4103fe={'type':db['Sequelize']['QueryTypes'][_0xfe2b('0x97')],'raw':!![]};var _0x55fb2e=_0x2a39f8[_0xfe2b('0x98')]();_0x55fb2e[_0xfe2b('0x54')](_0xfe2b('0x96'));_0x55fb2e[_0xfe2b('0x54')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfe2b('0x6c'));if(_0x3e1d39['order']){_0x3e1d39[_0xfe2b('0x4f')][_0xfe2b('0x36')](function(_0x4b0f94){var _0x29e018=_0x4b0f94[0x0]===_0xfe2b('0x99')?_0x4b0f94[0x0]:'i.'+_0x4b0f94[0x0];_0x2a39f8['order'](_0x29e018,_0x4b0f94[0x1]===_0xfe2b('0x9a')?![]:!![]);});}if(!_[_0xfe2b('0x82')](_0x64fd06)){_0x2a39f8[_0xfe2b('0x6e')](_0x4e471d);_0x55fb2e[_0xfe2b('0x51')](_0xfe2b('0x9b'),_0x64fd06);}BPromise[_0xfe2b('0x9c')]()[_0xfe2b('0x2c')](function(){if(!_0x25e86a){if(_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x83')])return;_0x55fb2e[_0xfe2b('0x51')](_0xfe2b('0x9d'));_0x2a39f8[_0xfe2b('0x51')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x492e15[_0xfe2b('0x9e')]['role']!==_0xfe2b('0x9f'))return;return _0x492e15[_0xfe2b('0x9e')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0x3db8b5){if(_['isEmpty'](_0x3db8b5)){_0x55fb2e[_0xfe2b('0x51')](_0xfe2b('0xa0'));_0x2a39f8[_0xfe2b('0x51')](_0xfe2b('0xa0'));}else{_0x55fb2e[_0xfe2b('0x51')]('i.OpenchannelAccountId\x20IN\x20?',_[_0xfe2b('0x40')](_0x3db8b5,'id'));_0x2a39f8[_0xfe2b('0x51')](_0xfe2b('0xa1'),_['map'](_0x3db8b5,'id'));}});})[_0xfe2b('0x2c')](function(){if(_0x492e15[_0xfe2b('0x9e')][_0xfe2b('0xa2')]==='agent'&&!_0x25e86a&&!_0x492e15[_0xfe2b('0x46')][_0xfe2b('0x83')])return[];return db['sequelize'][_0xfe2b('0x46')](_0x55fb2e[_0xfe2b('0xa3')](),_0x4103fe);})[_0xfe2b('0x2c')](function(_0x591c71){_0x2867b2[_0xfe2b('0x26')]=_0x591c71[_0xfe2b('0x4c')];if(_0x2867b2[_0xfe2b('0x26')]===0x0)return[];return db[_0xfe2b('0xa4')][_0xfe2b('0x46')](_0x4c5229['toString'](),_0x4103fe)[_0xfe2b('0x2c')](function(_0x2bbbf9){_0x61341a=_[_0xfe2b('0xa5')](_0x2bbbf9,'id');_0x4103fe=_[_0xfe2b('0xa6')](_0x4103fe,{'model':db[_0xfe2b('0x41')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x492e15[_0xfe2b('0x46')]['fields']){_0x3e1d39[_0xfe2b('0x49')]['forEach'](function(_0x285942){_0x2a39f8['field']('i.'+_0x285942);});}else{_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xa7'),'unreadMessages');_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xa8'),_0xfe2b('0xa9'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xaa'),_0xfe2b('0xab'));_0x2a39f8['field'](_0xfe2b('0xac'),_0xfe2b('0x99'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xad'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xae'),_0xfe2b('0xaf'));_0x2a39f8[_0xfe2b('0x54')]('c.lastName','Contact.lastName');_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xb0'),'Contact.email');_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xb1'),_0xfe2b('0xb2'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xb3'),'Contact.mobile');_0x2a39f8[_0xfe2b('0x54')]('c.fax',_0xfe2b('0xb4'));_0x2a39f8['field'](_0xfe2b('0xb5'),_0xfe2b('0xb6'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xb7'),_0xfe2b('0xb8'));_0x2a39f8[_0xfe2b('0x54')](_0xfe2b('0xb9'),_0xfe2b('0x34'));}if(_0x3e1d39['limit'])_0x2a39f8[_0xfe2b('0x25')](_0x3e1d39[_0xfe2b('0x25')]);if(_0x3e1d39['offset'])_0x2a39f8['offset'](_0x3e1d39[_0xfe2b('0x23')]);return db['sequelize']['query'](_0x2a39f8['toString'](),_0x4103fe);})[_0xfe2b('0x2c')](function(_0x17b844){if(_0x17b844[_0xfe2b('0x4c')]>0x0)_0xf5ff6b['where'](_0xfe2b('0xba'),_[_0xfe2b('0x40')](_0x17b844,'id'));return db[_0xfe2b('0xa4')][_0xfe2b('0x46')](_0xf5ff6b[_0xfe2b('0xa3')](),_0x4103fe)[_0xfe2b('0x2c')](function(_0x8e5c5e){var _0x117920=_[_0xfe2b('0xbb')](_0x8e5c5e,_0xfe2b('0xbc'));var _0xcc0977=[];_0x17b844[_0xfe2b('0x36')](function(_0x23b73e){_0xcc0977['push'](updateOpenchannelInteraction(_0x23b73e,_0x61341a,_0x117920));});return BPromise[_0xfe2b('0xbd')](_0xcc0977);});});})['then'](function(_0x5117e6){_0x2867b2['rows']=_0x5117e6;return _0x2867b2;})[_0xfe2b('0x2c')](respondWithFilteredResult(_0x530e9e,_0x3e1d39))[_0xfe2b('0xbe')](handleError(_0x530e9e,null));};exports[_0xfe2b('0xbf')]=function(_0x3ffafa,_0x189bf7){var _0x1011da={};if(_0x3ffafa[_0xfe2b('0x46')][_0xfe2b('0x43')]&&_0x3ffafa[_0xfe2b('0x46')]['type']==='from'){_0x1011da[_0xfe2b('0x5a')]=_0x3ffafa['params']['id'];}else{_0x1011da['id']=_0x3ffafa['params']['id'];}var _0x3f9171={'raw':![],'where':_0x1011da},_0x39e73f={};_0x39e73f['model']=_[_0xfe2b('0x47')](db['OpenchannelInteraction']['rawAttributes']);_0x39e73f[_0xfe2b('0x46')]=_[_0xfe2b('0x47')](_0x3ffafa[_0xfe2b('0x46')]);_0x39e73f['filters']=_[_0xfe2b('0x4a')](_0x39e73f[_0xfe2b('0x45')],_0x39e73f[_0xfe2b('0x46')]);_0x3f9171[_0xfe2b('0x49')]=_[_0xfe2b('0x4a')](_0x39e73f['model'],qs[_0xfe2b('0x4b')](_0x3ffafa[_0xfe2b('0x46')][_0xfe2b('0x4b')]));_0x3f9171[_0xfe2b('0x49')]=_0x3f9171['attributes'][_0xfe2b('0x4c')]?_0x3f9171[_0xfe2b('0x49')]:_0x39e73f[_0xfe2b('0x45')];if(_0x3ffafa['query'][_0xfe2b('0xc0')]){_0x3f9171[_0xfe2b('0xc1')]=[{'all':!![]}];}_0x3f9171=_[_0xfe2b('0xa6')]({},_0x3f9171,_0x3ffafa[_0xfe2b('0xc2')]);return db[_0xfe2b('0x41')][_0xfe2b('0x6b')](_0x3f9171)['then'](handleEntityNotFound(_0x189bf7,null))[_0xfe2b('0x2c')](respondWithResult(_0x189bf7,null))['catch'](handleError(_0x189bf7,null));};exports[_0xfe2b('0xc3')]=function(_0x5f368a,_0x44d2f7){return db[_0xfe2b('0x41')][_0xfe2b('0xc3')](_0x5f368a[_0xfe2b('0x7f')],{})['then'](respondWithResult(_0x44d2f7,0xc9))[_0xfe2b('0xbe')](handleError(_0x44d2f7,null));};exports[_0xfe2b('0x2a')]=function(_0x24a303,_0x18b452){if(_0x24a303['body']['id']){delete _0x24a303[_0xfe2b('0x7f')]['id'];}return db[_0xfe2b('0x41')]['find']({'where':{'id':_0x24a303[_0xfe2b('0xc4')]['id']}})[_0xfe2b('0x2c')](handleEntityNotFound(_0x18b452,null))[_0xfe2b('0x2c')](saveUpdates(_0x24a303['body'],null))['then'](respondWithResult(_0x18b452,null))[_0xfe2b('0xbe')](handleError(_0x18b452,null));};exports[_0xfe2b('0x2b')]=function(_0x12e77f,_0xf8257f){return db['OpenchannelInteraction'][_0xfe2b('0x6b')]({'where':{'id':_0x12e77f['params']['id']}})['then'](handleEntityNotFound(_0xf8257f,null))[_0xfe2b('0x2c')](removeEntity(_0xf8257f,null))['catch'](handleError(_0xf8257f,null));};exports[_0xfe2b('0xc5')]=function(_0x3f2efd,_0x49d901){return db['OpenchannelInteraction'][_0xfe2b('0xc5')]()[_0xfe2b('0x2c')](respondWithResult(_0x49d901,null))[_0xfe2b('0xbe')](handleError(_0x49d901,null));};exports['addMessage']=function(_0x233da3,_0x119749,_0x4e1503){return db[_0xfe2b('0xc6')][_0xfe2b('0x6b')]({'where':{'id':_0x233da3[_0xfe2b('0xc4')]['id']}})[_0xfe2b('0x2c')](handleEntityNotFound(_0x119749,null))['then'](function(_0x201bcd){if(_0x201bcd){return _0x201bcd[_0xfe2b('0xc7')](_0x233da3['body'][_0xfe2b('0xc8')],_[_0xfe2b('0xc9')](_0x233da3['body'],[_0xfe2b('0xc8'),'id'])||{});}})[_0xfe2b('0x2c')](respondWithResult(_0x119749,null))['catch'](handleError(_0x119749,null));};exports[_0xfe2b('0xca')]=function(_0x2c428c,_0x3ccfaf,_0x461902){var _0x361260={'raw':![],'where':{}};var _0x4ee6b5={};var _0x7ab35e={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x2c428c[_0xfe2b('0xc4')]['id']}})['then'](handleEntityNotFound(_0x3ccfaf,null))[_0xfe2b('0x2c')](function(_0x16cf8e){if(_0x16cf8e){_0x4ee6b5['model']=_[_0xfe2b('0x47')](db[_0xfe2b('0xc6')][_0xfe2b('0x42')]);_0x4ee6b5[_0xfe2b('0x46')]=_[_0xfe2b('0x47')](_0x2c428c[_0xfe2b('0x46')]);_0x4ee6b5[_0xfe2b('0x48')]=_[_0xfe2b('0x4a')](_0x4ee6b5['model'],_0x4ee6b5['query']);_0x361260['attributes']=_[_0xfe2b('0x4a')](_0x4ee6b5['model'],qs[_0xfe2b('0x4b')](_0x2c428c['query'][_0xfe2b('0x4b')]));_0x361260[_0xfe2b('0x49')]=_0x361260[_0xfe2b('0x49')][_0xfe2b('0x4c')]?_0x361260[_0xfe2b('0x49')]:_0x4ee6b5[_0xfe2b('0x45')];if(!_0x2c428c['query'][_0xfe2b('0x4d')](_0xfe2b('0x4e'))){_0x361260[_0xfe2b('0x25')]=qs[_0xfe2b('0x25')](_0x2c428c[_0xfe2b('0x46')]['limit']);_0x361260[_0xfe2b('0x23')]=qs['offset'](_0x2c428c[_0xfe2b('0x46')]['offset']);}_0x361260[_0xfe2b('0x4f')]=qs[_0xfe2b('0x50')](_0x2c428c['query'][_0xfe2b('0x50')]);_0x361260[_0xfe2b('0x51')]=qs[_0xfe2b('0x48')](_['pick'](_0x2c428c['query'],_0x4ee6b5['filters']));_0x361260['where'][_0xfe2b('0xbc')]=_0x16cf8e['id'];if(_0x2c428c[_0xfe2b('0x46')][_0xfe2b('0x8f')]){_0x361260[_0xfe2b('0x51')]=_[_0xfe2b('0xa6')](_0x361260[_0xfe2b('0x51')],{'$or':_[_0xfe2b('0x40')](_0x361260[_0xfe2b('0x49')],function(_0x4a8c87){var _0x18a385={};_0x18a385[_0x4a8c87]={'$like':'%'+_0x2c428c['query'][_0xfe2b('0x8f')]+'%'};return _0x18a385;})});}if(_0x2c428c[_0xfe2b('0x46')]['$gte']){var _0x1dcf23=_0x2c428c['query'][_0xfe2b('0x86')][_0xfe2b('0x35')](',');var _0x5a473e={};_0x5a473e[_0x1dcf23[0x0]]={'$gte':moment(_0x1dcf23[0x1])[_0xfe2b('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x361260[_0xfe2b('0x51')]=_[_0xfe2b('0xa6')](_0x361260[_0xfe2b('0x51')],_0x5a473e);}_0x361260=_[_0xfe2b('0xa6')]({},_0x361260,_0x2c428c[_0xfe2b('0xc2')]);return db[_0xfe2b('0xc6')][_0xfe2b('0x26')]({'where':_0x361260[_0xfe2b('0x51')]})[_0xfe2b('0x2c')](function(_0x41fd13){_0x7ab35e[_0xfe2b('0x26')]=_0x41fd13;if(_0x2c428c[_0xfe2b('0x46')][_0xfe2b('0xc0')]){_0x361260[_0xfe2b('0xc1')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xfe2b('0xcc')](_0x361260);})[_0xfe2b('0x2c')](function(_0x469a64){_0x7ab35e[_0xfe2b('0xcd')]=_0x469a64;return _0x7ab35e;});}})[_0xfe2b('0x2c')](respondWithFilteredResult(_0x3ccfaf,_0x361260))[_0xfe2b('0xbe')](handleError(_0x3ccfaf,null));};exports[_0xfe2b('0xce')]=function(_0x328c68,_0x35ce9d,_0x13c0b8){return db['OpenchannelInteraction'][_0xfe2b('0x6b')]({'where':{'id':_0x328c68[_0xfe2b('0xc4')]['id']}})[_0xfe2b('0x2c')](handleEntityNotFound(_0x35ce9d,null))[_0xfe2b('0x2c')](function(_0x171ab2){if(_0x171ab2){return _0x171ab2[_0xfe2b('0xcf')](_0x328c68['body']['ids'],_[_0xfe2b('0xc9')](_0x328c68[_0xfe2b('0x7f')],[_0xfe2b('0xc8'),'id'])||{})['spread'](function(){return db[_0xfe2b('0x7b')][_0xfe2b('0xcc')]({'attributes':['id','name',_0xfe2b('0x55')],'where':{'id':_0x328c68[_0xfe2b('0x7f')][_0xfe2b('0xc8')]}});})['then'](function(_0x4e6abd){socket[_0xfe2b('0xd0')](_0xfe2b('0xd1'),{'id':Number(_0x328c68['params']['id']),'tags':_0x4e6abd||[]});return{'id':Number(_0x328c68[_0xfe2b('0xc4')]['id']),'tags':_0x4e6abd||[]};});}})[_0xfe2b('0x2c')](respondWithResult(_0x35ce9d,null))[_0xfe2b('0xbe')](handleError(_0x35ce9d,null));};exports[_0xfe2b('0xd2')]=function(_0x299349,_0x2d635e,_0x56c915){return db['OpenchannelInteraction'][_0xfe2b('0x6b')]({'where':{'id':_0x299349[_0xfe2b('0xc4')]['id']}})[_0xfe2b('0x2c')](handleEntityNotFound(_0x2d635e,null))['then'](function(_0x3022d8){if(_0x3022d8){return _0x3022d8[_0xfe2b('0xd2')](_0x299349[_0xfe2b('0x46')][_0xfe2b('0xc8')]);}})[_0xfe2b('0x2c')](respondWithStatusCode(_0x2d635e,null))['catch'](handleError(_0x2d635e,null));};exports[_0xfe2b('0xd3')]=function(_0x130b04,_0x4eb321){var _0xc65aef=moment()[_0xfe2b('0xd4')]()[_0xfe2b('0xa3')]();var _0x1547af=path[_0xfe2b('0xd5')](config[_0xfe2b('0xd6')],_0xfe2b('0xd7'),_0xfe2b('0xd8'),_0xfe2b('0xd9'));var _0x2473f6=path[_0xfe2b('0xd5')](config[_0xfe2b('0xd6')],'server',_0xfe2b('0xd8'),_0xfe2b('0xda'));var _0x1c2bfc=path[_0xfe2b('0xd5')](_0x1547af,_0xc65aef);var _0x2ff573=util[_0xfe2b('0xcb')](_0xfe2b('0xdb'),_0x130b04[_0xfe2b('0xc4')]['id'],_0xc65aef);var _0x287085=path['join'](_0x1547af,_0x2ff573);var _0x533624=[];_0x533624[_0xfe2b('0x38')]({'model':db[_0xfe2b('0x7d')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x533624[_0xfe2b('0x38')]({'model':db[_0xfe2b('0xdc')],'as':_0xfe2b('0x71'),'attributes':['id',_0xfe2b('0xdd'),_0xfe2b('0xde')],'raw':!![]});if(_0x130b04['query']['attachments']){_0x533624['push']({'model':db[_0xfe2b('0xdf')],'as':'Attachment','raw':!![]});}var _0x419d2c=[{'model':db[_0xfe2b('0xc6')],'as':_0xfe2b('0xe0'),'attributes':['id',_0xfe2b('0x7f'),_0xfe2b('0x84'),_0xfe2b('0xe1'),_0xfe2b('0xe2'),'read'],'include':_0x533624}];_0x419d2c['push']({'model':db[_0xfe2b('0xe3')],'as':_0xfe2b('0xe4'),'attributes':['id',_0xfe2b('0x30')]});_0x419d2c[_0xfe2b('0x38')]({'model':db[_0xfe2b('0x7d')],'as':_0xfe2b('0xe5'),'attributes':['id','fullname']});return db[_0xfe2b('0x41')]['find']({'where':{'id':_0x130b04[_0xfe2b('0xc4')]['id']},'include':_0x419d2c})[_0xfe2b('0x2c')](handleEntityNotFound(_0x4eb321,null))['then'](function(_0x46381e){if(_0x46381e){var _0x2cbdf6=_0x46381e[_0xfe2b('0xe6')]({'plain':!![]});fs['mkdirSync'](_0x1c2bfc);var _0x54bf5e={'channel':_0xfe2b('0xe7'),'account':_0x2cbdf6['Account'][_0xfe2b('0x30')],'agent':_0x2cbdf6[_0xfe2b('0xe5')]?_0x2cbdf6[_0xfe2b('0xe5')][_0xfe2b('0x33')]:'N.A.','createdAt':moment(_0x2cbdf6['createdAt'])[_0xfe2b('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfe2b('0xa3')](),'closedAt':_0x2cbdf6['closed']?moment(_0x2cbdf6[_0xfe2b('0xe8')])[_0xfe2b('0xcb')](_0xfe2b('0xe9'))[_0xfe2b('0xa3')]():'','disposition':_0x2cbdf6[_0xfe2b('0xea')],'visibility':_0x2cbdf6[_0xfe2b('0xeb')]?_0xfe2b('0xec'):_0xfe2b('0xed'),'messages':_(_0x2cbdf6[_0xfe2b('0xe0')])[_0xfe2b('0x8f')]({'secret':![]})[_0xfe2b('0x40')](function(_0xf9d924){if(_0xf9d924[_0xfe2b('0xdf')]){var _0x3aab6b=path[_0xfe2b('0xd5')](_0x2473f6,_0xf9d924[_0xfe2b('0xdf')][_0xfe2b('0xee')]);if(fs[_0xfe2b('0xef')](_0x3aab6b)){fs[_0xfe2b('0xf0')](_0x3aab6b)[_0xfe2b('0xf1')](fs[_0xfe2b('0xf2')](path['join'](_0x1c2bfc,_0xf9d924[_0xfe2b('0xdf')][_0xfe2b('0xee')])));}}return{'date':moment(_0xf9d924['createdAt'])['format'](_0xfe2b('0xe9'))['toString'](),'sender':_0xf9d924[_0xfe2b('0xe1')]===_0xfe2b('0xf3')?_0xf9d924['User']?_0xf9d924[_0xfe2b('0x7d')][_0xfe2b('0x33')]:_0xfe2b('0xf4'):_0xf9d924['Contact'][_0xfe2b('0xdd')]+(_0xf9d924[_0xfe2b('0x71')]['lastName']?'\x20'+_0xf9d924['Contact'][_0xfe2b('0xde')]:''),'body':_0xf9d924[_0xfe2b('0xdf')]?_0xf9d924[_0xfe2b('0xdf')][_0xfe2b('0xee')]:_0xf9d924['body'],'direction':_0xf9d924[_0xfe2b('0xe1')]===_0xfe2b('0xf3')?'A':'C','secret':_0xf9d924[_0xfe2b('0xe2')],'read':_0xf9d924[_0xfe2b('0x8b')],'attachment':_0xf9d924['Attachment']};})[_0xfe2b('0x6d')]()};return ejs['renderFile'](path['join'](config[_0xfe2b('0xd6')],'server',_0xfe2b('0xf5'),_0xfe2b('0xf6')),{'interaction':_0x54bf5e})[_0xfe2b('0x2c')](function(_0x445fda){var _0x19de49=path[_0xfe2b('0xd5')](_0x1c2bfc,'transcript-'+_0x2cbdf6['id']+'-'+_0xc65aef+'.pdf');var _0x338290={'path':_0x19de49,'channel':_0xfe2b('0xe7'),'interactionId':_0x2cbdf6['id']};return pdf[_0xfe2b('0xf7')](_0x445fda,_0x338290);})[_0xfe2b('0x2c')](function(){return new BPromise(function(_0x385d29,_0x1026c5){zipdir(_0x1c2bfc,{'saveTo':_0x287085},function(_0x56bf50,_0x2467e7){if(_0x56bf50)return _0x1026c5(_0x56bf50);return _0x385d29(_0x2467e7);});})['then'](function(){return new BPromise(function(_0x193970,_0x1f17ac){rimraf(_0x1c2bfc,function(_0xe7b4be){if(_0xe7b4be)_0x1f17ac(_0xe7b4be);return _0x193970();});});})[_0xfe2b('0x2c')](function(){return _0x4eb321[_0xfe2b('0xd3')](_0x287085,_0x2ff573,function(_0x38b672){if(_0x38b672){console[_0xfe2b('0xf8')](_0xfe2b('0xf9'),_0x38b672);}else{fs[_0xfe2b('0xfa')](_0x287085);}});});});}else{return _0x4eb321[_0xfe2b('0x2d')](0xc8);}})['catch'](handleError(_0x4eb321,null));}; \ No newline at end of file +var _0x062d=['waiting','total','map','OpenchannelInteraction','rawAttributes','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','unreadMessages','value','`\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','find','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','isEmpty','forEach','OpenchannelAccountId','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','i.from\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','toString','sequelize','merge','a.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','rows','show','params','includeAll','include','options','create','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','transcript-%d-%s.zip','push','CmContact','lastName','attachments','Attachment','Messages','direction','secret','OpenchannelAccount','Owner','mkdirSync','Openchannel','Account','N.A.','disposition','threadId','Private','basename','existsSync','createReadStream','createWriteStream','firstName','out','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','end','status','limit','undefined','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','Users','fullname','Tags','TagIds','split','catch','talking','answered','unmanaged','closed','UserId'];(function(_0x579e41,_0x311045){var _0x54421c=function(_0x5a1f99){while(--_0x5a1f99){_0x579e41['push'](_0x579e41['shift']());}};_0x54421c(++_0x311045);}(_0x062d,0x1a2));var _0xd062=function(_0x6fbc80,_0x355ace){_0x6fbc80=_0x6fbc80-0x0;var _0x57c2ff=_0x062d[_0x6fbc80];return _0x57c2ff;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd062('0x0'));var zipdir=require(_0xd062('0x1'));var jsonpatch=require(_0xd062('0x2'));var rp=require(_0xd062('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd062('0x4'));var util=require(_0xd062('0x5'));var path=require(_0xd062('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd062('0x7'));var fs=require('fs');var fs_extra=require(_0xd062('0x8'));var _=require(_0xd062('0x9'));var squel=require(_0xd062('0xa'));var crypto=require('crypto');var jsforce=require(_0xd062('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd062('0xc'));var Papa=require(_0xd062('0xd'));var Redis=require(_0xd062('0xe'));var authService=require(_0xd062('0xf'));var qs=require(_0xd062('0x10'));var as=require(_0xd062('0x11'));var pdf=require(_0xd062('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd062('0x13'))(_0xd062('0x14'));var utils=require(_0xd062('0x15'));var config=require(_0xd062('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd062('0x17'))['db'];config['redis']=_[_0xd062('0x18')](config[_0xd062('0x19')],{'host':_0xd062('0x1a'),'port':0x18eb});var socket=require(_0xd062('0x1b'))(new Redis(config['redis']));require(_0xd062('0x1c'))[_0xd062('0x1d')](socket);function respondWithStatusCode(_0x2f9a63,_0x6ae26d){_0x6ae26d=_0x6ae26d||0xcc;return function(_0x56ac86){if(_0x56ac86){return _0x2f9a63[_0xd062('0x1e')](_0x6ae26d);}return _0x2f9a63['status'](_0x6ae26d)[_0xd062('0x1f')]();};}function respondWithResult(_0x419bf1,_0x13d4da){_0x13d4da=_0x13d4da||0xc8;return function(_0x2d7819){if(_0x2d7819){return _0x419bf1[_0xd062('0x20')](_0x13d4da)['json'](_0x2d7819);}};}function respondWithFilteredResult(_0x16a400,_0x28b1a3){return function(_0x14ac87){if(_0x14ac87){var _0x58371a=typeof _0x28b1a3['offset']==='undefined'&&typeof _0x28b1a3[_0xd062('0x21')]===_0xd062('0x22');var _0x3cd904=_0x14ac87[_0xd062('0x23')];var _0x34ffab=_0x58371a?0x0:_0x28b1a3[_0xd062('0x24')];var _0x3d0def=_0x58371a?_0x14ac87['count']:_0x28b1a3[_0xd062('0x24')]+_0x28b1a3[_0xd062('0x21')];var _0xf4ed8b;if(_0x3d0def>=_0x3cd904){_0x3d0def=_0x3cd904;_0xf4ed8b=0xc8;}else{_0xf4ed8b=0xce;}_0x16a400['status'](_0xf4ed8b);return _0x16a400[_0xd062('0x25')](_0xd062('0x26'),_0x34ffab+'-'+_0x3d0def+'/'+_0x3cd904)[_0xd062('0x27')](_0x14ac87);}return null;};}function patchUpdates(_0x2dd1fb){return function(_0x33ee65){try{jsonpatch[_0xd062('0x28')](_0x33ee65,_0x2dd1fb,!![]);}catch(_0x58e99b){return BPromise['reject'](_0x58e99b);}return _0x33ee65[_0xd062('0x29')]();};}function saveUpdates(_0xe5fe09,_0x2250b9){return function(_0x13fff5){if(_0x13fff5){return _0x13fff5[_0xd062('0x2a')](_0xe5fe09)[_0xd062('0x2b')](function(_0x49283d){return _0x49283d;});}return null;};}function removeEntity(_0x1f93c7,_0x46e9f4){return function(_0x4b53b2){if(_0x4b53b2){return _0x4b53b2[_0xd062('0x2c')]()['then'](function(){_0x1f93c7['status'](0xcc)[_0xd062('0x1f')]();});}};}function handleEntityNotFound(_0xd5fd41,_0x49df31){return function(_0xf9f1d0){if(!_0xf9f1d0){_0xd5fd41[_0xd062('0x1e')](0x194);}return _0xf9f1d0;};}function handleError(_0x2bcb60,_0xfa6b4c){_0xfa6b4c=_0xfa6b4c||0x1f4;return function(_0x53ebcd){logger[_0xd062('0x2d')](_0x53ebcd[_0xd062('0x2e')]);if(_0x53ebcd[_0xd062('0x2f')]){delete _0x53ebcd[_0xd062('0x2f')];}_0x2bcb60['status'](_0xfa6b4c)[_0xd062('0x30')](_0x53ebcd);};}function getInteractionUsers(_0x23f539,_0x29ca00){return new BPromise(function(_0x29cb84,_0x291e9a){try{if(_0x29ca00[_0x23f539['id']]){_0x23f539[_0xd062('0x31')]=_['map'](_0x29ca00[_0x23f539['id']],function(_0xb16e8c){return{'id':_0xb16e8c['id'],'fullname':_0xb16e8c[_0xd062('0x32')]};});}}catch(_0x4be50d){_0x291e9a(_0x4be50d);}_0x29cb84(_0x23f539);});}function getInteractionTags(_0x4fbb18,_0x16bfb1){return new BPromise(function(_0x25a824,_0x1d325d){try{if(_0x4fbb18['TagIds']){_0x4fbb18[_0xd062('0x33')]=[];_0x4fbb18[_0xd062('0x34')][_0xd062('0x35')](',')['forEach'](function(_0x5674f3){_0x4fbb18[_0xd062('0x33')]['push'](_0x16bfb1[_0x5674f3]);});}delete _0x4fbb18[_0xd062('0x34')];}catch(_0x41bb9a){_0x1d325d(_0x41bb9a);}_0x25a824(_0x4fbb18);});}function updateOpenchannelInteraction(_0x30402f,_0xcd12aa,_0x5edd36){return new BPromise(function(_0x2afaa4,_0x106d36){return getInteractionUsers(_0x30402f,_0x5edd36)[_0xd062('0x2b')](function(_0xef2efe){return getInteractionTags(_0xef2efe,_0xcd12aa);})['then'](function(_0x3520f0){return getStateInteraction(_0x3520f0);})[_0xd062('0x2b')](function(_0x3b8cd9){_0x2afaa4(_0x3b8cd9);})[_0xd062('0x36')](function(_0x579f69){_0x106d36(_0x579f69);});});}function getStateInteraction(_0x5cad9c){return new BPromise(function(_0xcbde93){_0x5cad9c['waiting']=0x0;_0x5cad9c[_0xd062('0x37')]=0x0;_0x5cad9c[_0xd062('0x38')]=0x0;_0x5cad9c[_0xd062('0x39')]=0x0;_0x5cad9c['total']=0x0;if(!_0x5cad9c[_0xd062('0x3a')]&&!_0x5cad9c[_0xd062('0x3b')]){_0x5cad9c[_0xd062('0x3c')]+=0x1;}if(!_0x5cad9c[_0xd062('0x3a')]&&_0x5cad9c['UserId']){_0x5cad9c[_0xd062('0x37')]+=0x1;if(_0x5cad9c[_0xd062('0x3c')]){_0x5cad9c['waiting']-=0x1;}}if(_0x5cad9c[_0xd062('0x3a')]&&_0x5cad9c[_0xd062('0x3b')]){_0x5cad9c[_0xd062('0x38')]+=0x1;if(_0x5cad9c[_0xd062('0x37')]){_0x5cad9c[_0xd062('0x37')]-=0x1;}}if(_0x5cad9c['closed']&&!_0x5cad9c['UserId']){_0x5cad9c['unmanaged']+=0x1;if(_0x5cad9c['waiting']){_0x5cad9c[_0xd062('0x3c')]-=0x1;}}_0x5cad9c[_0xd062('0x3d')]+=0x1;_0xcbde93(_0x5cad9c);});}exports['index']=function(_0x27a4b4,_0x2d203f){var _0x4aa32a={},_0x3d6346={},_0x1a002c={'count':0x0,'rows':[]};var _0x15b11a=_[_0xd062('0x3e')](db[_0xd062('0x3f')][_0xd062('0x40')],function(_0x594af9){return{'name':_0x594af9['fieldName'],'type':_0x594af9['type'][_0xd062('0x41')]};});_0x3d6346['model']=_[_0xd062('0x3e')](_0x15b11a,_0xd062('0x2f'));_0x3d6346[_0xd062('0x42')]=_[_0xd062('0x43')](_0x27a4b4[_0xd062('0x42')]);_0x3d6346[_0xd062('0x44')]=_['intersection'](_0x3d6346[_0xd062('0x45')],_0x3d6346['query']);_0x4aa32a[_0xd062('0x46')]=_[_0xd062('0x47')](_0x3d6346[_0xd062('0x45')],qs[_0xd062('0x48')](_0x27a4b4[_0xd062('0x42')][_0xd062('0x48')]));_0x4aa32a[_0xd062('0x46')]=_0x4aa32a['attributes'][_0xd062('0x49')]?_0x4aa32a[_0xd062('0x46')]:_0x3d6346[_0xd062('0x45')];if(!_0x27a4b4[_0xd062('0x42')][_0xd062('0x4a')](_0xd062('0x4b'))){_0x4aa32a[_0xd062('0x21')]=qs[_0xd062('0x21')](_0x27a4b4[_0xd062('0x42')][_0xd062('0x21')]);_0x4aa32a['offset']=qs[_0xd062('0x24')](_0x27a4b4[_0xd062('0x42')][_0xd062('0x24')]);}_0x4aa32a[_0xd062('0x4c')]=qs['sort'](_0x27a4b4[_0xd062('0x42')][_0xd062('0x4d')]);_0x4aa32a[_0xd062('0x4e')]=qs[_0xd062('0x44')](_[_0xd062('0x4f')](_0x27a4b4[_0xd062('0x42')],_0x3d6346[_0xd062('0x44')]),_0x15b11a);var _0x509b83=[];var _0x57e25f=squel[_0xd062('0x50')]()[_0xd062('0x51')]('id')[_0xd062('0x51')]('name')[_0xd062('0x51')](_0xd062('0x52'))[_0xd062('0x53')](_0xd062('0x54'));var _0x47640e=squel['select']()[_0xd062('0x51')](_0xd062('0x55'))[_0xd062('0x51')](_0xd062('0x56'))['field'](_0xd062('0x57'))[_0xd062('0x53')]('user_has_openchannel_interactions','ui')[_0xd062('0x58')](_0xd062('0x59'),'u',_0xd062('0x5a'));var _0x36e4fe=squel['select']()[_0xd062('0x53')]('openchannel_interactions','i')[_0xd062('0x58')]('cm_contacts','c',_0xd062('0x5b'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xd062('0x58')](_0xd062('0x5c'),'a',_0xd062('0x5d'))[_0xd062('0x58')](_0xd062('0x5e'),'me',_0xd062('0x5f'))[_0xd062('0x58')]('openchannel_interaction_has_tags','it',_0xd062('0x60'))['left_join'](_0xd062('0x54'),'t','t.id\x20=\x20it.TagId');var _0x2272d9=squel[_0xd062('0x61')]();var _0x230227=[];var _0x360fdb=squel[_0xd062('0x61')]();var _0x3bd7fb;if(_0x27a4b4['query'][_0xd062('0x62')]){_0x3bd7fb=as['parseSearch'](_0x27a4b4[_0xd062('0x42')][_0xd062('0x62')]);var _0x51d643=_0x3bd7fb[_0xd062('0x63')];for(var _0x1d608a=0x0;_0x1d608a<_0x3bd7fb[_0xd062('0x64')][_0xd062('0x49')];_0x1d608a++){var _0x31afeb=_0x3bd7fb[_0xd062('0x64')][_0x1d608a];var _0x19049b='i';var _0x3d1ebb=_['find'](_0x15b11a,[_0xd062('0x2f'),_0x31afeb[_0xd062('0x51')]]);if(!_0x3d1ebb){switch(_0x31afeb[_0xd062('0x51')]){case _0xd062('0x65'):if(_0x31afeb[_0xd062('0x66')]==0x1){_0x36e4fe['having']('`'+_0x31afeb['field']+'`\x20=\x200');}else{_0x36e4fe['having']('`'+_0x31afeb['field']+_0xd062('0x67'));}break;case _0xd062('0x68'):if(_0x31afeb[_0xd062('0x69')]===_0xd062('0x6a')){if(_0x31afeb[_0xd062('0x66')][_0xd062('0x35')]('\x20')[_0xd062('0x49')]>0x1){_0x2272d9[_0x51d643](_0xd062('0x6b'),qs[_0xd062('0x6c')](_0x31afeb['value']),null);}else{var _0x4925dc='%'+_0x31afeb[_0xd062('0x66')]+'%';_0x2272d9[_0x51d643]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4925dc,_0x4925dc,_0x4925dc);}}else{_0x3d1ebb=_[_0xd062('0x6d')](_0x15b11a,[_0xd062('0x2f'),'ContactId']);_0x31afeb['field']=_0xd062('0x6e');_0x1565a8=as[_0xd062('0x6f')](_0x19049b,_0x3d1ebb[_0xd062('0x70')],_0x31afeb);_0x2272d9[_0x51d643](_0x1565a8[_0xd062('0x71')],_0x1565a8[_0xd062('0x66')][_0xd062('0x72')],_0x1565a8[_0xd062('0x66')][_0xd062('0x1f')]);}break;case _0xd062('0x73'):var _0xe582f1=_0x31afeb[_0xd062('0x66')]['split'](',')['map'](function(_0x566aba){return Number(_0x566aba);});_0xe582f1['forEach'](function(_0x15dbd3){_0x360fdb['or'](_0xd062('0x74'),'%,'+_0x15dbd3+',%');});_0x230227=_[_0xd062('0x75')](_0x230227,_0xe582f1);break;case _0xd062('0x76'):if(_0x31afeb[_0xd062('0x69')]===_0xd062('0x6a')){_0x2272d9[_0x51d643](_0xd062('0x77'),'%'+_0x31afeb[_0xd062('0x66')]+'%',null);}else{_0x3d1ebb=_[_0xd062('0x6d')](_0x15b11a,[_0xd062('0x2f'),_0xd062('0x3b')]);_0x31afeb[_0xd062('0x51')]='UserId';_0x1565a8=as[_0xd062('0x6f')](_0x19049b,_0x3d1ebb['type'],_0x31afeb);_0x2272d9[_0x51d643](_0x1565a8[_0xd062('0x71')],_0x1565a8[_0xd062('0x66')]['start'],_0x1565a8['value'][_0xd062('0x1f')]);}break;case _0xd062('0x78'):_0x1565a8=as['buildExpression']('me',null,_0x31afeb);_0x2272d9[_0x51d643](_0x1565a8['text'],_0x1565a8[_0xd062('0x66')]['start'],_0x1565a8[_0xd062('0x66')]['end']);break;}}else{var _0x1565a8=as[_0xd062('0x6f')](_0x19049b,_0x3d1ebb[_0xd062('0x70')],_0x31afeb);_0x2272d9[_0x51d643](_0x1565a8[_0xd062('0x71')],_0x1565a8[_0xd062('0x66')]['start'],_0x1565a8[_0xd062('0x66')]['end']);}}}else{var _0x1ed971=_(_0x27a4b4[_0xd062('0x42')])['keys']()[_0xd062('0x3e')](function(_0x26824e){return _[_0xd062('0x79')](_0x15b11a,[_0xd062('0x2f'),_0x26824e])?_0x26824e:undefined;})['compact']()['value']();if(!_[_0xd062('0x7a')](_0x1ed971)){_0x1ed971[_0xd062('0x7b')](function(_0x39d1b7){if(_0x39d1b7===_0xd062('0x7c')){_0x36e4fe[_0xd062('0x4e')]('i.OpenchannelAccountId\x20IN\x20?',[][_0xd062('0x7d')](_0x27a4b4[_0xd062('0x42')][_0x39d1b7]));}else if(_0x39d1b7===_0xd062('0x7e')){var _0x9841ef=JSON[_0xd062('0x7f')](_0x27a4b4[_0xd062('0x42')][_0x39d1b7])[_0xd062('0x80')];var _0x1867bc=JSON[_0xd062('0x7f')](_0x27a4b4[_0xd062('0x42')][_0x39d1b7])[_0xd062('0x81')];_0x36e4fe[_0xd062('0x4e')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x9841ef,_0x1867bc);}else{if(_0x27a4b4[_0xd062('0x42')][_0x39d1b7]===_0xd062('0x82')){_0x36e4fe['where']('i.'+_0x39d1b7+_0xd062('0x83'));}else{_0x36e4fe['where']('i.'+_0x39d1b7+_0xd062('0x84'),_0x27a4b4[_0xd062('0x42')][_0x39d1b7]);}}});}if(_0x27a4b4[_0xd062('0x42')][_0xd062('0x85')]){if(_0x27a4b4[_0xd062('0x42')][_0xd062('0x85')]==0x1){_0x36e4fe[_0xd062('0x86')](_0xd062('0x87'));}else{_0x36e4fe[_0xd062('0x86')](_0xd062('0x88'));}}if(_0x27a4b4[_0xd062('0x42')][_0xd062('0x89')]){_0x230227=_['isArray'](_0x27a4b4['query'][_0xd062('0x89')])?_0x27a4b4[_0xd062('0x42')][_0xd062('0x89')]:new Array(_0x27a4b4[_0xd062('0x42')]['tag']);_0x230227[_0xd062('0x7b')](function(_0x3a06a5){_0x360fdb['or'](_0xd062('0x74'),'%,'+_0x3a06a5+',%');});}if(_0x27a4b4[_0xd062('0x42')][_0xd062('0x8a')]){var _0x432d1c=_0x27a4b4[_0xd062('0x42')]['filter'][_0xd062('0x8b')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd062('0x8c')](_0x432d1c)){_0x2272d9['or']('i.id\x20LIKE\x20?',_0x432d1c+'%');}else{_0x2272d9['or'](_0xd062('0x8d'),qs['getFullTextValue'](_0x432d1c))['or'](_0xd062('0x8e'),_0x432d1c+'%')['or'](_0xd062('0x8f'),_0x432d1c+'%');}}}_0x36e4fe[_0xd062('0x4e')](_0x2272d9);_0x36e4fe[_0xd062('0x90')]('i.id');var _0x16b58={'type':db['Sequelize'][_0xd062('0x91')][_0xd062('0x92')],'raw':!![]};var _0x364510=_0x36e4fe['clone']();_0x364510[_0xd062('0x51')]('i.id');_0x364510[_0xd062('0x51')](_0xd062('0x93'),_0xd062('0x65'));if(_0x4aa32a[_0xd062('0x4c')]){_0x4aa32a['order'][_0xd062('0x7b')](function(_0xa56e76){var _0x3a2d86=_0xa56e76[0x0]===_0xd062('0x94')?_0xa56e76[0x0]:'i.'+_0xa56e76[0x0];_0x36e4fe[_0xd062('0x4c')](_0x3a2d86,_0xa56e76[0x1]===_0xd062('0x95')?![]:!![]);});}if(!_['isEmpty'](_0x230227)){_0x36e4fe[_0xd062('0x86')](_0x360fdb);_0x364510[_0xd062('0x4e')](_0xd062('0x96'),_0x230227);}BPromise[_0xd062('0x97')]()['then'](function(){if(!_0x3bd7fb){if(_0x27a4b4[_0xd062('0x42')][_0xd062('0x7c')])return;_0x364510['where'](_0xd062('0x98'));_0x36e4fe[_0xd062('0x4e')]('i.OpenchannelAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x27a4b4['user'][_0xd062('0x99')]!==_0xd062('0x9a'))return;return _0x27a4b4[_0xd062('0x9b')][_0xd062('0x9c')]({'attributes':['id'],'raw':!![]})[_0xd062('0x2b')](function(_0x417275){if(_[_0xd062('0x7a')](_0x417275)){_0x364510[_0xd062('0x4e')](_0xd062('0x9d'));_0x36e4fe[_0xd062('0x4e')](_0xd062('0x9d'));}else{_0x364510[_0xd062('0x4e')](_0xd062('0x9e'),_[_0xd062('0x3e')](_0x417275,'id'));_0x36e4fe[_0xd062('0x4e')](_0xd062('0x9e'),_[_0xd062('0x3e')](_0x417275,'id'));}});})[_0xd062('0x2b')](function(){if(_0x27a4b4[_0xd062('0x9b')]['role']===_0xd062('0x9a')&&!_0x3bd7fb&&!_0x27a4b4[_0xd062('0x42')]['OpenchannelAccountId'])return[];return db['sequelize'][_0xd062('0x42')](_0x364510[_0xd062('0x9f')](),_0x16b58);})[_0xd062('0x2b')](function(_0x195262){_0x1a002c[_0xd062('0x23')]=_0x195262['length'];if(_0x1a002c[_0xd062('0x23')]===0x0)return[];return db[_0xd062('0xa0')][_0xd062('0x42')](_0x57e25f[_0xd062('0x9f')](),_0x16b58)[_0xd062('0x2b')](function(_0x2c0992){_0x509b83=_['keyBy'](_0x2c0992,'id');_0x16b58=_[_0xd062('0xa1')](_0x16b58,{'model':db[_0xd062('0x3f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x27a4b4['query']['fields']){_0x4aa32a[_0xd062('0x46')][_0xd062('0x7b')](function(_0x359ad9){_0x36e4fe[_0xd062('0x51')]('i.'+_0x359ad9);});}else{_0x36e4fe[_0xd062('0x51')](_0xd062('0x93'),_0xd062('0x65'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xa2'),'Account.key');_0x36e4fe[_0xd062('0x51')]('a.mandatoryDisposition',_0xd062('0xa3'));_0x36e4fe['field']('CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END',_0xd062('0x94'));_0x36e4fe['field'](_0xd062('0xa4'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xa5'),_0xd062('0xa6'));_0x36e4fe[_0xd062('0x51')]('c.lastName','Contact.lastName');_0x36e4fe[_0xd062('0x51')](_0xd062('0xa7'),'Contact.email');_0x36e4fe[_0xd062('0x51')]('c.phone',_0xd062('0xa8'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xa9'),_0xd062('0xaa'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xab'),_0xd062('0xac'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xad'),_0xd062('0xae'));_0x36e4fe[_0xd062('0x51')](_0xd062('0xaf'),'Owner.internal');_0x36e4fe[_0xd062('0x51')](_0xd062('0xb0'),_0xd062('0x34'));}if(_0x4aa32a['limit'])_0x36e4fe[_0xd062('0x21')](_0x4aa32a[_0xd062('0x21')]);if(_0x4aa32a[_0xd062('0x24')])_0x36e4fe['offset'](_0x4aa32a['offset']);return db['sequelize'][_0xd062('0x42')](_0x36e4fe[_0xd062('0x9f')](),_0x16b58);})['then'](function(_0x13ceeb){if(_0x13ceeb[_0xd062('0x49')]>0x0)_0x47640e['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0xd062('0x3e')](_0x13ceeb,'id'));return db[_0xd062('0xa0')][_0xd062('0x42')](_0x47640e[_0xd062('0x9f')](),_0x16b58)['then'](function(_0x4217cc){var _0x577653=_[_0xd062('0xb1')](_0x4217cc,_0xd062('0xb2'));var _0x4bcd8b=[];_0x13ceeb[_0xd062('0x7b')](function(_0x1418c6){_0x4bcd8b['push'](updateOpenchannelInteraction(_0x1418c6,_0x509b83,_0x577653));});return BPromise['all'](_0x4bcd8b);});});})[_0xd062('0x2b')](function(_0x375639){_0x1a002c[_0xd062('0xb3')]=_0x375639;return _0x1a002c;})['then'](respondWithFilteredResult(_0x2d203f,_0x4aa32a))['catch'](handleError(_0x2d203f,null));};exports[_0xd062('0xb4')]=function(_0xc330f0,_0x1e02e1){var _0x4ab7b0={};if(_0xc330f0[_0xd062('0x42')][_0xd062('0x70')]&&_0xc330f0[_0xd062('0x42')]['type']==='from'){_0x4ab7b0[_0xd062('0x53')]=_0xc330f0[_0xd062('0xb5')]['id'];}else{_0x4ab7b0['id']=_0xc330f0[_0xd062('0xb5')]['id'];}var _0x19f96d={'raw':![],'where':_0x4ab7b0},_0x1fe10b={};_0x1fe10b[_0xd062('0x45')]=_[_0xd062('0x43')](db['OpenchannelInteraction'][_0xd062('0x40')]);_0x1fe10b[_0xd062('0x42')]=_['keys'](_0xc330f0[_0xd062('0x42')]);_0x1fe10b['filters']=_[_0xd062('0x47')](_0x1fe10b[_0xd062('0x45')],_0x1fe10b[_0xd062('0x42')]);_0x19f96d['attributes']=_[_0xd062('0x47')](_0x1fe10b['model'],qs[_0xd062('0x48')](_0xc330f0['query'][_0xd062('0x48')]));_0x19f96d[_0xd062('0x46')]=_0x19f96d[_0xd062('0x46')][_0xd062('0x49')]?_0x19f96d[_0xd062('0x46')]:_0x1fe10b[_0xd062('0x45')];if(_0xc330f0[_0xd062('0x42')][_0xd062('0xb6')]){_0x19f96d[_0xd062('0xb7')]=[{'all':!![]}];}_0x19f96d=_[_0xd062('0xa1')]({},_0x19f96d,_0xc330f0[_0xd062('0xb8')]);return db[_0xd062('0x3f')][_0xd062('0x6d')](_0x19f96d)[_0xd062('0x2b')](handleEntityNotFound(_0x1e02e1,null))[_0xd062('0x2b')](respondWithResult(_0x1e02e1,null))['catch'](handleError(_0x1e02e1,null));};exports[_0xd062('0xb9')]=function(_0x135405,_0x20a265){return db[_0xd062('0x3f')][_0xd062('0xb9')](_0x135405[_0xd062('0x78')],{})[_0xd062('0x2b')](respondWithResult(_0x20a265,0xc9))[_0xd062('0x36')](handleError(_0x20a265,null));};exports[_0xd062('0x2a')]=function(_0x503129,_0xc8d0b){if(_0x503129[_0xd062('0x78')]['id']){delete _0x503129[_0xd062('0x78')]['id'];}return db[_0xd062('0x3f')][_0xd062('0x6d')]({'where':{'id':_0x503129[_0xd062('0xb5')]['id']}})[_0xd062('0x2b')](handleEntityNotFound(_0xc8d0b,null))[_0xd062('0x2b')](saveUpdates(_0x503129[_0xd062('0x78')],null))['then'](respondWithResult(_0xc8d0b,null))[_0xd062('0x36')](handleError(_0xc8d0b,null));};exports['destroy']=function(_0x54fc65,_0x36d187){return db['OpenchannelInteraction']['find']({'where':{'id':_0x54fc65['params']['id']}})[_0xd062('0x2b')](handleEntityNotFound(_0x36d187,null))['then'](removeEntity(_0x36d187,null))['catch'](handleError(_0x36d187,null));};exports[_0xd062('0xba')]=function(_0xf3ab0f,_0x15a96d){return db[_0xd062('0x3f')][_0xd062('0xba')]()[_0xd062('0x2b')](respondWithResult(_0x15a96d,null))[_0xd062('0x36')](handleError(_0x15a96d,null));};exports[_0xd062('0xbb')]=function(_0x189222,_0x189ba0,_0x5808ac){return db['OpenchannelMessage'][_0xd062('0x6d')]({'where':{'id':_0x189222[_0xd062('0xb5')]['id']}})['then'](handleEntityNotFound(_0x189ba0,null))[_0xd062('0x2b')](function(_0x12a047){if(_0x12a047){return _0x12a047['addMessage'](_0x189222[_0xd062('0x78')][_0xd062('0xbc')],_[_0xd062('0xbd')](_0x189222[_0xd062('0x78')],[_0xd062('0xbc'),'id'])||{});}})[_0xd062('0x2b')](respondWithResult(_0x189ba0,null))[_0xd062('0x36')](handleError(_0x189ba0,null));};exports[_0xd062('0xbe')]=function(_0x289558,_0x37e1ea,_0x1d7b1f){var _0x3e3cf7={'raw':![],'where':{}};var _0x4b3f40={};var _0x3b636f={'count':0x0,'rows':[]};return db[_0xd062('0x3f')]['findOne']({'where':{'id':_0x289558[_0xd062('0xb5')]['id']}})[_0xd062('0x2b')](handleEntityNotFound(_0x37e1ea,null))['then'](function(_0xeafa05){if(_0xeafa05){_0x4b3f40['model']=_[_0xd062('0x43')](db[_0xd062('0xbf')][_0xd062('0x40')]);_0x4b3f40[_0xd062('0x42')]=_[_0xd062('0x43')](_0x289558[_0xd062('0x42')]);_0x4b3f40[_0xd062('0x44')]=_[_0xd062('0x47')](_0x4b3f40['model'],_0x4b3f40[_0xd062('0x42')]);_0x3e3cf7[_0xd062('0x46')]=_[_0xd062('0x47')](_0x4b3f40['model'],qs[_0xd062('0x48')](_0x289558[_0xd062('0x42')]['fields']));_0x3e3cf7[_0xd062('0x46')]=_0x3e3cf7[_0xd062('0x46')][_0xd062('0x49')]?_0x3e3cf7[_0xd062('0x46')]:_0x4b3f40[_0xd062('0x45')];if(!_0x289558['query'][_0xd062('0x4a')](_0xd062('0x4b'))){_0x3e3cf7[_0xd062('0x21')]=qs[_0xd062('0x21')](_0x289558[_0xd062('0x42')][_0xd062('0x21')]);_0x3e3cf7[_0xd062('0x24')]=qs[_0xd062('0x24')](_0x289558[_0xd062('0x42')][_0xd062('0x24')]);}_0x3e3cf7[_0xd062('0x4c')]=qs[_0xd062('0x4d')](_0x289558[_0xd062('0x42')][_0xd062('0x4d')]);_0x3e3cf7[_0xd062('0x4e')]=qs[_0xd062('0x44')](_[_0xd062('0x4f')](_0x289558['query'],_0x4b3f40['filters']));_0x3e3cf7[_0xd062('0x4e')][_0xd062('0xb2')]=_0xeafa05['id'];if(_0x289558[_0xd062('0x42')][_0xd062('0x8a')]){_0x3e3cf7[_0xd062('0x4e')]=_['merge'](_0x3e3cf7[_0xd062('0x4e')],{'$or':_[_0xd062('0x3e')](_0x3e3cf7['attributes'],function(_0x4d75d4){var _0x5e6d7b={};_0x5e6d7b[_0x4d75d4]={'$like':'%'+_0x289558[_0xd062('0x42')][_0xd062('0x8a')]+'%'};return _0x5e6d7b;})});}if(_0x289558[_0xd062('0x42')][_0xd062('0x80')]){var _0x5cf740=_0x289558[_0xd062('0x42')][_0xd062('0x80')][_0xd062('0x35')](',');var _0xa191bb={};_0xa191bb[_0x5cf740[0x0]]={'$gte':moment(_0x5cf740[0x1])[_0xd062('0xc0')](_0xd062('0xc1'))};_0x3e3cf7[_0xd062('0x4e')]=_[_0xd062('0xa1')](_0x3e3cf7[_0xd062('0x4e')],_0xa191bb);}_0x3e3cf7=_[_0xd062('0xa1')]({},_0x3e3cf7,_0x289558[_0xd062('0xb8')]);return db['OpenchannelMessage']['count']({'where':_0x3e3cf7[_0xd062('0x4e')]})[_0xd062('0x2b')](function(_0x532b1b){_0x3b636f[_0xd062('0x23')]=_0x532b1b;if(_0x289558[_0xd062('0x42')][_0xd062('0xb6')]){_0x3e3cf7['include']=[{'all':!![]}];}return db[_0xd062('0xbf')][_0xd062('0xc2')](_0x3e3cf7);})['then'](function(_0xdf3513){_0x3b636f['rows']=_0xdf3513;return _0x3b636f;});}})[_0xd062('0x2b')](respondWithFilteredResult(_0x37e1ea,_0x3e3cf7))[_0xd062('0x36')](handleError(_0x37e1ea,null));};exports[_0xd062('0xc3')]=function(_0x1bb63c,_0x1a8639,_0x165a4c){return db[_0xd062('0x3f')][_0xd062('0x6d')]({'where':{'id':_0x1bb63c[_0xd062('0xb5')]['id']}})['then'](handleEntityNotFound(_0x1a8639,null))['then'](function(_0x5ba670){if(_0x5ba670){return _0x5ba670[_0xd062('0xc4')](_0x1bb63c[_0xd062('0x78')]['ids'],_[_0xd062('0xbd')](_0x1bb63c['body'],[_0xd062('0xbc'),'id'])||{})[_0xd062('0xc5')](function(){return db[_0xd062('0x73')][_0xd062('0xc2')]({'attributes':['id',_0xd062('0x2f'),'color'],'where':{'id':_0x1bb63c['body'][_0xd062('0xbc')]}});})[_0xd062('0x2b')](function(_0x3222cb){socket['emit'](_0xd062('0xc6'),{'id':Number(_0x1bb63c[_0xd062('0xb5')]['id']),'tags':_0x3222cb||[]});return{'id':Number(_0x1bb63c[_0xd062('0xb5')]['id']),'tags':_0x3222cb||[]};});}})[_0xd062('0x2b')](respondWithResult(_0x1a8639,null))[_0xd062('0x36')](handleError(_0x1a8639,null));};exports[_0xd062('0xc7')]=function(_0x592f77,_0x14cbce,_0x59de59){return db['OpenchannelInteraction'][_0xd062('0x6d')]({'where':{'id':_0x592f77[_0xd062('0xb5')]['id']}})['then'](handleEntityNotFound(_0x14cbce,null))[_0xd062('0x2b')](function(_0x4dd536){if(_0x4dd536){return _0x4dd536[_0xd062('0xc7')](_0x592f77['query'][_0xd062('0xbc')]);}})[_0xd062('0x2b')](respondWithStatusCode(_0x14cbce,null))['catch'](handleError(_0x14cbce,null));};exports[_0xd062('0xc8')]=function(_0x39553a,_0x15fdcc){var _0x435184=moment()[_0xd062('0xc9')]()[_0xd062('0x9f')]();var _0x14482b=path[_0xd062('0xca')](config[_0xd062('0xcb')],_0xd062('0xcc'),_0xd062('0xcd'),_0xd062('0xce'));var _0x3f2852=path[_0xd062('0xca')](config[_0xd062('0xcb')],_0xd062('0xcc'),_0xd062('0xcd'),'attachments');var _0x1e9ed8=path[_0xd062('0xca')](_0x14482b,_0x435184);var _0x1d2751=util[_0xd062('0xc0')](_0xd062('0xcf'),_0x39553a[_0xd062('0xb5')]['id'],_0x435184);var _0x24800c=path['join'](_0x14482b,_0x1d2751);var _0x5b359e=[];_0x5b359e[_0xd062('0xd0')]({'model':db['User'],'as':'User','attributes':['id',_0xd062('0x32')],'raw':!![]});_0x5b359e[_0xd062('0xd0')]({'model':db[_0xd062('0xd1')],'as':'Contact','attributes':['id','firstName',_0xd062('0xd2')],'raw':!![]});if(_0x39553a[_0xd062('0x42')][_0xd062('0xd3')]){_0x5b359e[_0xd062('0xd0')]({'model':db[_0xd062('0xd4')],'as':'Attachment','raw':!![]});}var _0x14812c=[{'model':db['OpenchannelMessage'],'as':_0xd062('0xd5'),'attributes':['id',_0xd062('0x78'),_0xd062('0x7e'),_0xd062('0xd6'),_0xd062('0xd7'),_0xd062('0x85')],'include':_0x5b359e}];_0x14812c[_0xd062('0xd0')]({'model':db[_0xd062('0xd8')],'as':'Account','attributes':['id',_0xd062('0x2f')]});_0x14812c[_0xd062('0xd0')]({'model':db['User'],'as':_0xd062('0xd9'),'attributes':['id',_0xd062('0x32')]});return db['OpenchannelInteraction'][_0xd062('0x6d')]({'where':{'id':_0x39553a[_0xd062('0xb5')]['id']},'include':_0x14812c})[_0xd062('0x2b')](handleEntityNotFound(_0x15fdcc,null))[_0xd062('0x2b')](function(_0x51855f){if(_0x51855f){var _0x5ee5c3=_0x51855f['get']({'plain':!![]});fs[_0xd062('0xda')](_0x1e9ed8);var _0x2fd875={'channel':_0xd062('0xdb'),'account':_0x5ee5c3[_0xd062('0xdc')]['name'],'agent':_0x5ee5c3[_0xd062('0xd9')]?_0x5ee5c3[_0xd062('0xd9')][_0xd062('0x32')]:_0xd062('0xdd'),'createdAt':moment(_0x5ee5c3['createdAt'])['format'](_0xd062('0xc1'))['toString'](),'closedAt':_0x5ee5c3[_0xd062('0x3a')]?moment(_0x5ee5c3['closedAt'])[_0xd062('0xc0')](_0xd062('0xc1'))[_0xd062('0x9f')]():'','disposition':_0x5ee5c3[_0xd062('0xde')],'visibility':_0x5ee5c3[_0xd062('0xdf')]?'Public':_0xd062('0xe0'),'messages':_(_0x5ee5c3['Messages'])['filter']({'secret':![]})['map'](function(_0x4d4fd9){if(_0x4d4fd9['Attachment']){var _0x8b5a1a=path['join'](_0x3f2852,_0x4d4fd9[_0xd062('0xd4')][_0xd062('0xe1')]);if(fs[_0xd062('0xe2')](_0x8b5a1a)){fs[_0xd062('0xe3')](_0x8b5a1a)['pipe'](fs[_0xd062('0xe4')](path[_0xd062('0xca')](_0x1e9ed8,_0x4d4fd9[_0xd062('0xd4')][_0xd062('0xe1')])));}}return{'date':moment(_0x4d4fd9['createdAt'])[_0xd062('0xc0')](_0xd062('0xc1'))[_0xd062('0x9f')](),'sender':_0x4d4fd9[_0xd062('0xd6')]==='out'?_0x4d4fd9[_0xd062('0x76')]?_0x4d4fd9[_0xd062('0x76')][_0xd062('0x32')]:'System':_0x4d4fd9[_0xd062('0x68')][_0xd062('0xe5')]+(_0x4d4fd9[_0xd062('0x68')][_0xd062('0xd2')]?'\x20'+_0x4d4fd9[_0xd062('0x68')][_0xd062('0xd2')]:''),'body':_0x4d4fd9['Attachment']?_0x4d4fd9['Attachment']['basename']:_0x4d4fd9[_0xd062('0x78')],'direction':_0x4d4fd9['direction']===_0xd062('0xe6')?'A':'C','secret':_0x4d4fd9[_0xd062('0xd7')],'read':_0x4d4fd9['read'],'attachment':_0x4d4fd9[_0xd062('0xd4')]};})[_0xd062('0x66')]()};return ejs[_0xd062('0xe7')](path[_0xd062('0xca')](config[_0xd062('0xcb')],_0xd062('0xcc'),_0xd062('0xe8'),_0xd062('0xe9')),{'interaction':_0x2fd875})[_0xd062('0x2b')](function(_0x3bfba0){var _0x444dcb=path['join'](_0x1e9ed8,'transcript-'+_0x5ee5c3['id']+'-'+_0x435184+_0xd062('0xea'));var _0x21f274={'path':_0x444dcb,'channel':_0xd062('0xdb'),'interactionId':_0x5ee5c3['id']};return pdf[_0xd062('0xeb')](_0x3bfba0,_0x21f274);})[_0xd062('0x2b')](function(){return new BPromise(function(_0x153357,_0x1dfaf8){zipdir(_0x1e9ed8,{'saveTo':_0x24800c},function(_0x3e4f36,_0x10ff91){if(_0x3e4f36)return _0x1dfaf8(_0x3e4f36);return _0x153357(_0x10ff91);});})[_0xd062('0x2b')](function(){return new BPromise(function(_0x3f5288,_0x16e9f0){rimraf(_0x1e9ed8,function(_0x27b448){if(_0x27b448)_0x16e9f0(_0x27b448);return _0x3f5288();});});})[_0xd062('0x2b')](function(){return _0x15fdcc[_0xd062('0xc8')](_0x24800c,_0x1d2751,function(_0x57fc0b){if(_0x57fc0b){console[_0xd062('0xec')](_0xd062('0xed'),_0x57fc0b);}else{fs[_0xd062('0xee')](_0x24800c);}});});});}else{return _0x15fdcc[_0xd062('0x1e')](0xc8);}})['catch'](handleError(_0x15fdcc,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 5e71a7f..4548f1e 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 _0x7ae1=['map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','../../mysqldb','OpenchannelInteraction','save','update','getUsers','then','setDataValue','Users'];(function(_0x11bfa1,_0x35d9f2){var _0x5491bf=function(_0x56f21f){while(--_0x56f21f){_0x11bfa1['push'](_0x11bfa1['shift']());}};_0x5491bf(++_0x35d9f2);}(_0x7ae1,0xe8));var _0x17ae=function(_0x41f000,_0x43a5bf){_0x41f000=_0x41f000-0x0;var _0x581131=_0x7ae1[_0x41f000];return _0x581131;};'use strict';var EventEmitter=require('events');var OpenchannelInteraction=require(_0x17ae('0x0'))['db'][_0x17ae('0x1')];var OpenchannelMessage=require(_0x17ae('0x0'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x17ae('0x2'),'afterUpdate':_0x17ae('0x3'),'afterDestroy':'remove'};function emitEvent(_0xcfb70f){return function(_0x490bb3,_0x2c0af0,_0x2daa95){_0x490bb3[_0x17ae('0x4')]({'attributes':['id'],'raw':!![]})[_0x17ae('0x5')](function(_0x2f2640){_0x490bb3[_0x17ae('0x6')](_0x17ae('0x7'),_0x2f2640[_0x17ae('0x8')](function(_0x29228b){return{'id':_0x29228b['id']};}));return OpenchannelMessage[_0x17ae('0x9')]({'where':{'OpenchannelInteractionId':_0x490bb3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x17ae('0x5')](function(_0xf99271){_0x490bb3['setDataValue'](_0x17ae('0xa'),_0xf99271[_0x17ae('0xb')]);OpenchannelInteractionEvents[_0x17ae('0xc')](_0xcfb70f+':'+_0x490bb3['id'],_0x490bb3);OpenchannelInteractionEvents[_0x17ae('0xc')](_0xcfb70f,_0x490bb3);_0x2daa95(null);})[_0x17ae('0xd')](_0x2daa95(null));};}for(var e in events){if(events[_0x17ae('0xe')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module['exports']=OpenchannelInteractionEvents; \ No newline at end of file +var _0x0ede=['then','setDataValue','Users','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','remove'];(function(_0x29b974,_0x4d7e73){var _0x33e066=function(_0x1b1363){while(--_0x1b1363){_0x29b974['push'](_0x29b974['shift']());}};_0x33e066(++_0x4d7e73);}(_0x0ede,0x168));var _0xe0ed=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x0ede[_0x2dafbe];return _0x58a45a;};'use strict';var EventEmitter=require(_0xe0ed('0x0'));var OpenchannelInteraction=require('../../mysqldb')['db']['OpenchannelInteraction'];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe0ed('0x1')](0x0);var events={'afterCreate':_0xe0ed('0x2'),'afterUpdate':'update','afterDestroy':_0xe0ed('0x3')};function emitEvent(_0x8e204f){return function(_0x536f46,_0x243221,_0x3cf43f){_0x536f46['getUsers']({'attributes':['id'],'raw':!![]})[_0xe0ed('0x4')](function(_0x411b28){_0x536f46[_0xe0ed('0x5')](_0xe0ed('0x6'),_0x411b28['map'](function(_0x8521c3){return{'id':_0x8521c3['id']};}));return OpenchannelMessage[_0xe0ed('0x7')]({'where':{'OpenchannelInteractionId':_0x536f46['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe0ed('0x4')](function(_0x51854a){_0x536f46[_0xe0ed('0x5')](_0xe0ed('0x8'),_0x51854a[_0xe0ed('0x9')]);OpenchannelInteractionEvents[_0xe0ed('0xa')](_0x8e204f+':'+_0x536f46['id'],_0x536f46);OpenchannelInteractionEvents[_0xe0ed('0xa')](_0x8e204f,_0x536f46);_0x3cf43f(null);})['catch'](_0x3cf43f(null));};}for(var e in events){if(events[_0xe0ed('0xb')](e)){var event=events[e];OpenchannelInteraction[_0xe0ed('0xc')](e,emitEvent(event));}}module[_0xe0ed('0xd')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 73c60c7..8482035 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 _0x9ba4=['moment','rimraf','../../config/environment','exports','define','OpenchannelInteraction','utf8mb4','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x1a3169,_0x299225){var _0x1a4373=function(_0x13fb11){while(--_0x13fb11){_0x1a3169['push'](_0x1a3169['shift']());}};_0x1a4373(++_0x299225);}(_0x9ba4,0x11c));var _0x49ba=function(_0xa09ba9,_0x1a963d){_0xa09ba9=_0xa09ba9-0x0;var _0x5a14cb=_0x9ba4[_0xa09ba9];return _0x5a14cb;};'use strict';var _=require(_0x49ba('0x0'));var util=require(_0x49ba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x49ba('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x49ba('0x3'));var config=require(_0x49ba('0x4'));var attributes=require('./openchannelInteraction.attributes');module[_0x49ba('0x5')]=function(_0x4aa74d,_0x27f03a){return _0x4aa74d[_0x49ba('0x6')](_0x49ba('0x7'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x49ba('0x8'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x4dd121,_0x25aea6,_0x2d71e5){if(_0x4dd121[_0x49ba('0x9')](_0x49ba('0xa'))){_0x4dd121[_0x49ba('0xb')]=moment()['format'](_0x49ba('0xc'));}_0x2d71e5(null,_0x4dd121);}}});}; \ No newline at end of file +var _0xe69d=['OpenchannelInteraction','openchannel_interactions','utf8mb4','utf8mb4_unicode_ci','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','path','rimraf','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe69d,0x169));var _0xde69=function(_0x4089d2,_0x3ddcff){_0x4089d2=_0x4089d2-0x0;var _0x4ad7f1=_0xe69d[_0x4089d2];return _0x4ad7f1;};'use strict';var _=require(_0xde69('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xde69('0x1'));var moment=require(_0xde69('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xde69('0x3'));var rimraf=require(_0xde69('0x4'));var config=require('../../config/environment');var attributes=require('./openchannelInteraction.attributes');module[_0xde69('0x5')]=function(_0x2e2afb,_0x54563b){return _0x2e2afb[_0xde69('0x6')](_0xde69('0x7'),attributes,{'tableName':_0xde69('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde69('0x9'),'collate':_0xde69('0xa'),'hooks':{'beforeUpdate':function(_0x30d61c,_0x1dc9d1,_0x4c70ca){if(_0x30d61c[_0xde69('0xb')](_0xde69('0xc'))){_0x30d61c[_0xde69('0xd')]=moment()[_0xde69('0xe')](_0xde69('0xf'));}_0x4c70ca(null,_0x30d61c);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 0a4521b..d34c56a 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 _0x80b5=['defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','UpdateOpenchannelInteraction','body','options','raw','where','attributes','limit','stringify','AddTagsToOpenchannelInteraction','OpenchannelInteraction','addTags','omit','AddTags','catch','lodash','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3b2ee5,_0x36b671){var _0xc49e42=function(_0x2c4748){while(--_0x2c4748){_0x3b2ee5['push'](_0x3b2ee5['shift']());}};_0xc49e42(++_0x36b671);}(_0x80b5,0xb0));var _0x580b=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x80b5[_0x1b8e60];return _0x363363;};'use strict';var _=require(_0x580b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x580b('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x580b('0x2'));var logger=require('../../config/logger')(_0x580b('0x3'));var config=require(_0x580b('0x4'));var jayson=require(_0x580b('0x5'));var client=jayson[_0x580b('0x6')][_0x580b('0x7')]({'port':0x232a});config[_0x580b('0x8')]=_[_0x580b('0x9')](config[_0x580b('0x8')],{'host':_0x580b('0xa'),'port':0x18eb});var socket=require(_0x580b('0xb'))(new Redis(config[_0x580b('0x8')]));require('./openchannelInteraction.socket')[_0x580b('0xc')](socket);function respondWithRpcPromise(_0x2930db,_0x4960f7,_0x158de4){return new BPromise(function(_0x2c9616,_0x8bb1dc){return client[_0x580b('0xd')](_0x2930db,_0x158de4)[_0x580b('0xe')](function(_0x5b3dee){logger[_0x580b('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x4960f7,_0x580b('0x10'));logger[_0x580b('0x11')](_0x580b('0x12'),_0x4960f7,'request\x20sent',JSON['stringify'](_0x5b3dee));if(_0x5b3dee[_0x580b('0x13')]){if(_0x5b3dee[_0x580b('0x13')][_0x580b('0x14')]===0x1f4){logger[_0x580b('0x13')](_0x580b('0x15'),_0x4960f7,_0x5b3dee[_0x580b('0x13')][_0x580b('0x16')]);return _0x8bb1dc(_0x5b3dee[_0x580b('0x13')][_0x580b('0x16')]);}logger['error'](_0x580b('0x15'),_0x4960f7,_0x5b3dee[_0x580b('0x13')][_0x580b('0x16')]);return _0x2c9616(_0x5b3dee['error'][_0x580b('0x16')]);}else{logger['info'](_0x580b('0x15'),_0x4960f7,_0x580b('0x10'));_0x2c9616(_0x5b3dee['result']['message']);}})['catch'](function(_0x2afc25){logger[_0x580b('0x13')](_0x580b('0x15'),_0x4960f7,_0x2afc25);_0x8bb1dc(_0x2afc25);});});}exports[_0x580b('0x17')]=function(_0xb0a635){var _0x27246f=this;return new Promise(function(_0xa9ead9,_0x45e0bf){return db['OpenchannelInteraction']['update'](_0xb0a635[_0x580b('0x18')],{'raw':_0xb0a635[_0x580b('0x19')]?_0xb0a635[_0x580b('0x19')][_0x580b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xb0a635[_0x580b('0x19')]?_0xb0a635[_0x580b('0x19')][_0x580b('0x1b')]||null:null,'attributes':_0xb0a635[_0x580b('0x19')]?_0xb0a635['options'][_0x580b('0x1c')]||null:null,'limit':_0xb0a635['options']?_0xb0a635[_0x580b('0x19')][_0x580b('0x1d')]||null:null})['then'](function(_0x40239f){logger[_0x580b('0xf')](_0x580b('0x17'),_0xb0a635);logger['debug']('UpdateOpenchannelInteraction',_0xb0a635,JSON[_0x580b('0x1e')](_0x40239f));_0xa9ead9(_0x40239f);})['catch'](function(_0x390753){logger[_0x580b('0x13')](_0x580b('0x17'),_0x390753[_0x580b('0x16')],_0xb0a635);_0x45e0bf(_0x27246f[_0x580b('0x13')](0x1f4,_0x390753[_0x580b('0x16')]));});});};exports[_0x580b('0x1f')]=function(_0x876a93){return new Promise(function(_0x451cd3,_0x6bfa19){return db[_0x580b('0x20')]['find']({'where':_0x876a93[_0x580b('0x19')]?_0x876a93[_0x580b('0x19')]['where']||null:null})[_0x580b('0xe')](function(_0x292f71){if(_0x292f71){return _0x292f71[_0x580b('0x21')](_0x876a93[_0x580b('0x18')]['ids'],_[_0x580b('0x22')](_0x876a93[_0x580b('0x18')],['ids','id'])||{});}})['spread'](function(_0x59d71f){logger['info']('AddTags',_0x876a93);logger[_0x580b('0x11')](_0x580b('0x23'),_0x876a93,JSON[_0x580b('0x1e')](_0x59d71f));_0x451cd3(_0x59d71f);})[_0x580b('0x24')](function(_0x58a0a1){logger[_0x580b('0x13')](_0x580b('0x23'),_0x58a0a1['message'],_0x876a93);_0x6bfa19(_this[_0x580b('0x13')](0x1f4,_0x58a0a1[_0x580b('0x16')]));});});}; \ No newline at end of file +var _0x4a9b=['request','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','OpenchannelInteraction','options','raw','where','limit','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','addTags','body','ids','omit','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','register'];(function(_0x5a03d3,_0x55147f){var _0x53eecd=function(_0x286e32){while(--_0x286e32){_0x5a03d3['push'](_0x5a03d3['shift']());}};_0x53eecd(++_0x55147f);}(_0x4a9b,0x10a));var _0xb4a9=function(_0x128be0,_0x1ce0cf){_0x128be0=_0x128be0-0x0;var _0x1b0788=_0x4a9b[_0x128be0];return _0x1b0788;};'use strict';var _=require(_0xb4a9('0x0'));var util=require(_0xb4a9('0x1'));var moment=require('moment');var BPromise=require(_0xb4a9('0x2'));var rs=require(_0xb4a9('0x3'));var fs=require('fs');var Redis=require(_0xb4a9('0x4'));var db=require(_0xb4a9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb4a9('0x6'))(_0xb4a9('0x7'));var config=require(_0xb4a9('0x8'));var jayson=require(_0xb4a9('0x9'));var client=jayson['client'][_0xb4a9('0xa')]({'port':0x232a});config[_0xb4a9('0xb')]=_['defaults'](config[_0xb4a9('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb4a9('0xc'))(new Redis(config[_0xb4a9('0xb')]));require('./openchannelInteraction.socket')[_0xb4a9('0xd')](socket);function respondWithRpcPromise(_0x5a70c3,_0x37d7c1,_0x199042){return new BPromise(function(_0x409a37,_0x172493){return client[_0xb4a9('0xe')](_0x5a70c3,_0x199042)[_0xb4a9('0xf')](function(_0x23a995){logger[_0xb4a9('0x10')](_0xb4a9('0x11'),_0x37d7c1,_0xb4a9('0x12'));logger[_0xb4a9('0x13')](_0xb4a9('0x14'),_0x37d7c1,_0xb4a9('0x12'),JSON['stringify'](_0x23a995));if(_0x23a995[_0xb4a9('0x15')]){if(_0x23a995[_0xb4a9('0x15')][_0xb4a9('0x16')]===0x1f4){logger[_0xb4a9('0x15')]('OpenchannelInteraction,\x20%s,\x20%s',_0x37d7c1,_0x23a995['error'][_0xb4a9('0x17')]);return _0x172493(_0x23a995[_0xb4a9('0x15')][_0xb4a9('0x17')]);}logger[_0xb4a9('0x15')](_0xb4a9('0x11'),_0x37d7c1,_0x23a995[_0xb4a9('0x15')]['message']);return _0x409a37(_0x23a995[_0xb4a9('0x15')]['message']);}else{logger[_0xb4a9('0x10')](_0xb4a9('0x11'),_0x37d7c1,_0xb4a9('0x12'));_0x409a37(_0x23a995[_0xb4a9('0x18')]['message']);}})[_0xb4a9('0x19')](function(_0x4fa012){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x37d7c1,_0x4fa012);_0x172493(_0x4fa012);});});}exports['UpdateOpenchannelInteraction']=function(_0x36295f){var _0x1d63cf=this;return new Promise(function(_0x4e23c9,_0x44cf41){return db[_0xb4a9('0x1a')]['update'](_0x36295f['body'],{'raw':_0x36295f[_0xb4a9('0x1b')]?_0x36295f[_0xb4a9('0x1b')][_0xb4a9('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36295f[_0xb4a9('0x1b')]?_0x36295f[_0xb4a9('0x1b')][_0xb4a9('0x1d')]||null:null,'attributes':_0x36295f['options']?_0x36295f['options']['attributes']||null:null,'limit':_0x36295f[_0xb4a9('0x1b')]?_0x36295f['options'][_0xb4a9('0x1e')]||null:null})[_0xb4a9('0xf')](function(_0x38b804){logger['info'](_0xb4a9('0x1f'),_0x36295f);logger['debug'](_0xb4a9('0x1f'),_0x36295f,JSON[_0xb4a9('0x20')](_0x38b804));_0x4e23c9(_0x38b804);})[_0xb4a9('0x19')](function(_0x3462bf){logger[_0xb4a9('0x15')](_0xb4a9('0x1f'),_0x3462bf[_0xb4a9('0x17')],_0x36295f);_0x44cf41(_0x1d63cf[_0xb4a9('0x15')](0x1f4,_0x3462bf[_0xb4a9('0x17')]));});});};exports[_0xb4a9('0x21')]=function(_0x1ca1a7){return new Promise(function(_0x3dc161,_0x97c44a){return db[_0xb4a9('0x1a')][_0xb4a9('0x22')]({'where':_0x1ca1a7[_0xb4a9('0x1b')]?_0x1ca1a7[_0xb4a9('0x1b')]['where']||null:null})['then'](function(_0x5e7099){if(_0x5e7099){return _0x5e7099[_0xb4a9('0x23')](_0x1ca1a7[_0xb4a9('0x24')][_0xb4a9('0x25')],_[_0xb4a9('0x26')](_0x1ca1a7[_0xb4a9('0x24')],['ids','id'])||{});}})['spread'](function(_0x2db37f){logger['info'](_0xb4a9('0x27'),_0x1ca1a7);logger[_0xb4a9('0x13')](_0xb4a9('0x27'),_0x1ca1a7,JSON[_0xb4a9('0x20')](_0x2db37f));_0x3dc161(_0x2db37f);})[_0xb4a9('0x19')](function(_0x4a2e59){logger['error'](_0xb4a9('0x27'),_0x4a2e59[_0xb4a9('0x17')],_0x1ca1a7);_0x97c44a(_this[_0xb4a9('0x15')](0x1f4,_0x4a2e59[_0xb4a9('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index aef1aed..cd81223 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 _0x8e15=['save','update','removeListener','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x533827,_0x5a1e45){var _0x2df704=function(_0x21d6ba){while(--_0x21d6ba){_0x533827['push'](_0x533827['shift']());}};_0x2df704(++_0x5a1e45);}(_0x8e15,0x6b));var _0x58e1=function(_0x20e40d,_0x2a9f0f){_0x20e40d=_0x20e40d-0x0;var _0x558350=_0x8e15[_0x20e40d];return _0x558350;};'use strict';var OpenchannelInteractionEvents=require(_0x58e1('0x0'));var events=[_0x58e1('0x1'),'remove',_0x58e1('0x2')];function createListener(_0x45c6cb,_0x25b1dc){return function(_0x498d01){_0x25b1dc['emit'](_0x45c6cb,_0x498d01);};}function removeListener(_0x4fe6da,_0xc8ef23){return function(){OpenchannelInteractionEvents[_0x58e1('0x3')](_0x4fe6da,_0xc8ef23);};}exports[_0x58e1('0x4')]=function(_0x3ea698){for(var _0x2dc402=0x0,_0x51e3b8=events['length'];_0x2dc402<_0x51e3b8;_0x2dc402++){var _0x3faf83=events[_0x2dc402];var _0x48c02b=createListener(_0x58e1('0x5')+_0x3faf83,_0x3ea698);OpenchannelInteractionEvents['on'](_0x3faf83,_0x48c02b);}}; \ No newline at end of file +var _0xb85c=['removeListener','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0xd5bc30,_0x5af4cc){var _0x3976c3=function(_0x3a1ca5){while(--_0x3a1ca5){_0xd5bc30['push'](_0xd5bc30['shift']());}};_0x3976c3(++_0x5af4cc);}(_0xb85c,0xc7));var _0xcb85=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0xb85c[_0x576170];return _0x397c70;};'use strict';var OpenchannelInteractionEvents=require(_0xcb85('0x0'));var events=['save','remove','update'];function createListener(_0x29d4fd,_0x46b9bc){return function(_0x488c66){_0x46b9bc['emit'](_0x29d4fd,_0x488c66);};}function removeListener(_0x342f51,_0x47bd1a){return function(){OpenchannelInteractionEvents[_0xcb85('0x1')](_0x342f51,_0x47bd1a);};}exports[_0xcb85('0x2')]=function(_0x33679a){for(var _0x141d92=0x0,_0x35fbf1=events['length'];_0x141d92<_0x35fbf1;_0x141d92++){var _0xf64e6f=events[_0x141d92];var _0x34328d=createListener(_0xcb85('0x3')+_0xf64e6f,_0x33679a);OpenchannelInteractionEvents['on'](_0xf64e6f,_0x34328d);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 0f81b07..12719f7 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 _0xa9e0=['index','/describe','show','post','isAuthenticated','tracked','openchannel','openchannelmessage:create','update','put','/:id/accept','accept','reject','delete','/:id','destroy','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get'];(function(_0x1fbbcd,_0x138a99){var _0x386197=function(_0x2f9eed){while(--_0x2f9eed){_0x1fbbcd['push'](_0x1fbbcd['shift']());}};_0x386197(++_0x138a99);}(_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')](),interaction[_0x0a9e('0xe')](_0x0a9e('0xf'),_0x0a9e('0x10')),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0x11')]);router[_0x0a9e('0x12')](_0x0a9e('0x13'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);router[_0x0a9e('0x12')]('/:id/reject',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x15')]);router[_0x0a9e('0x16')](_0x0a9e('0x17'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x18')]);module['exports']=router; \ No newline at end of file +var _0xcb91=['openchannelmessage:create','put','update','/:id/reject','reject','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','index','isAuthenticated','describe','/:id','post','tracked','openchannel'];(function(_0x4cd00b,_0x483633){var _0x488623=function(_0xe10309){while(--_0xe10309){_0x4cd00b['push'](_0x4cd00b['shift']());}};_0x488623(++_0x483633);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x474d97,_0x5909ce){_0x474d97=_0x474d97-0x0;var _0x1edf25=_0xcb91[_0x474d97];return _0x1edf25;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/describe',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x9')](),interaction[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x1cb9('0xf')),controller['create']);router[_0x1cb9('0x10')](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x11')]);router[_0x1cb9('0x10')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1cb9('0x10')](_0x1cb9('0x12'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x13')]);router['delete'](_0x1cb9('0xb'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);module[_0x1cb9('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index a88e3b4..dceb080 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 _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x251e8c,_0x277c33){var _0x1e0c1d=function(_0x20b89c){while(--_0x20b89c){_0x251e8c['push'](_0x251e8c['shift']());}};_0x1e0c1d(++_0x277c33);}(_0x0447,0x8b));var _0x7044=function(_0x1b612f,_0x8dac64){_0x1b612f=_0x1b612f-0x0;var _0x3af369=_0x0447[_0x1b612f];return _0x3af369;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}}; \ No newline at end of file +var _0x4dd2=['out','DATE','STRING','exports','TEXT','medium','BOOLEAN'];(function(_0x23d0d7,_0xd71339){var _0x4c28a6=function(_0xae20bf){while(--_0xae20bf){_0x23d0d7['push'](_0x23d0d7['shift']());}};_0x4c28a6(++_0xd71339);}(_0x4dd2,0xf1));var _0x24dd=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x4dd2[_0x3430aa];return _0x2ac5c;};'use strict';var Sequelize=require('sequelize');module[_0x24dd('0x0')]={'body':{'type':Sequelize[_0x24dd('0x1')](_0x24dd('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x24dd('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x24dd('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x24dd('0x5')]},'providerName':{'type':Sequelize[_0x24dd('0x6')]},'providerResponse':{'type':Sequelize[_0x24dd('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 1ab09e8..9f9388d 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 _0xfbd2=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','findAll','catch','show','params','include','options','update','body','describe','openchannel-interactions','openchannel','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','find','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','interaction','stringify','null','AcceptMessage','acceptMessage','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','interface','SIP/%s','channel','accept','EventManager','../../config/logger','reject','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','fullname','motionChannel','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./openchannelMessage.socket','client','request','then','request\x20sent','debug','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','sendStatus','end','json','offset','undefined','count','limit','status','set','apply','save','destroy','stack','name','map','OpenchannelMessage'];(function(_0x232cbf,_0x3e2f33){var _0x1cd460=function(_0x29b4f3){while(--_0x29b4f3){_0x232cbf['push'](_0x232cbf['shift']());}};_0x1cd460(++_0x3e2f33);}(_0xfbd2,0x143));var _0x2fbd=function(_0x156c95,_0x1760cf){_0x156c95=_0x156c95-0x0;var _0x1a8cf5=_0xfbd2[_0x156c95];return _0x1a8cf5;};'use strict';var emlformat=require(_0x2fbd('0x0'));var rimraf=require(_0x2fbd('0x1'));var zipdir=require(_0x2fbd('0x2'));var jsonpatch=require(_0x2fbd('0x3'));var rp=require(_0x2fbd('0x4'));var moment=require(_0x2fbd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2fbd('0x6'));var util=require('util');var path=require(_0x2fbd('0x7'));var sox=require(_0x2fbd('0x8'));var csv=require('to-csv');var ejs=require(_0x2fbd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2fbd('0xa'));var squel=require(_0x2fbd('0xb'));var crypto=require(_0x2fbd('0xc'));var jsforce=require(_0x2fbd('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x2fbd('0xe'));var querystring=require(_0x2fbd('0xf'));var Papa=require(_0x2fbd('0x10'));var Redis=require(_0x2fbd('0x11'));var authService=require(_0x2fbd('0x12'));var qs=require(_0x2fbd('0x13'));var as=require(_0x2fbd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x2fbd('0x15'));var utils=require(_0x2fbd('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x2fbd('0x17'));var db=require(_0x2fbd('0x18'))['db'];config[_0x2fbd('0x19')]=_['defaults'](config[_0x2fbd('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fbd('0x1a'))(new Redis(config[_0x2fbd('0x19')]));require(_0x2fbd('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x2fbd('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x2fbd('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f11d6,_0x58e904,_0x5da074,_0x21ebdd){return new BPromise(function(_0x5d712e,_0x59ebd4){var _0x14c948=_0x21ebdd||client;return _0x14c948[_0x2fbd('0x1d')](_0x4f11d6,_0x5da074)[_0x2fbd('0x1e')](function(_0xc39169){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x58e904,_0x2fbd('0x1f'));logger[_0x2fbd('0x20')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x58e904,_0x2fbd('0x1f'),JSON['stringify'](_0xc39169));if(_0xc39169[_0x2fbd('0x21')]){if(_0xc39169['error'][_0x2fbd('0x22')]===0x1f4){logger[_0x2fbd('0x21')](_0x2fbd('0x23'),_0x58e904,_0xc39169[_0x2fbd('0x21')][_0x2fbd('0x24')]);return _0x59ebd4(_0xc39169[_0x2fbd('0x21')][_0x2fbd('0x24')]);}logger[_0x2fbd('0x21')](_0x2fbd('0x23'),_0x58e904,_0xc39169[_0x2fbd('0x21')]['message']);return _0x5d712e(_0xc39169[_0x2fbd('0x21')][_0x2fbd('0x24')]);}else{logger[_0x2fbd('0x25')](_0x2fbd('0x23'),_0x58e904,'request\x20sent');_0x5d712e(_0xc39169[_0x2fbd('0x26')]['message']);}})['catch'](function(_0x4a5b18){logger['error'](_0x2fbd('0x23'),_0x58e904,_0x4a5b18);_0x59ebd4(_0x4a5b18);});});}function respondWithStatusCode(_0x2bbae0,_0x377904){_0x377904=_0x377904||0xcc;return function(_0x4c227c){if(_0x4c227c){return _0x2bbae0[_0x2fbd('0x27')](_0x377904);}return _0x2bbae0['status'](_0x377904)[_0x2fbd('0x28')]();};}function respondWithResult(_0x23241c,_0x5a9865){_0x5a9865=_0x5a9865||0xc8;return function(_0x3b9780){if(_0x3b9780){return _0x23241c['status'](_0x5a9865)[_0x2fbd('0x29')](_0x3b9780);}};}function respondWithFilteredResult(_0x4d58fe,_0x534058){return function(_0x270375){if(_0x270375){var _0x2048f0=typeof _0x534058[_0x2fbd('0x2a')]==='undefined'&&typeof _0x534058['limit']===_0x2fbd('0x2b');var _0x1b4c6=_0x270375[_0x2fbd('0x2c')];var _0x26306f=_0x2048f0?0x0:_0x534058[_0x2fbd('0x2a')];var _0x50e480=_0x2048f0?_0x270375[_0x2fbd('0x2c')]:_0x534058['offset']+_0x534058[_0x2fbd('0x2d')];var _0x20c2b6;if(_0x50e480>=_0x1b4c6){_0x50e480=_0x1b4c6;_0x20c2b6=0xc8;}else{_0x20c2b6=0xce;}_0x4d58fe[_0x2fbd('0x2e')](_0x20c2b6);return _0x4d58fe[_0x2fbd('0x2f')]('Content-Range',_0x26306f+'-'+_0x50e480+'/'+_0x1b4c6)[_0x2fbd('0x29')](_0x270375);}return null;};}function patchUpdates(_0x58aba2){return function(_0x4a0006){try{jsonpatch[_0x2fbd('0x30')](_0x4a0006,_0x58aba2,!![]);}catch(_0x52cdac){return BPromise['reject'](_0x52cdac);}return _0x4a0006[_0x2fbd('0x31')]();};}function saveUpdates(_0x4fa531,_0x5f42bb){return function(_0x5ea8e6){if(_0x5ea8e6){return _0x5ea8e6['update'](_0x4fa531)['then'](function(_0x8ada2f){return _0x8ada2f;});}return null;};}function removeEntity(_0x4fbc10,_0x4f89ca){return function(_0x4fe0bd){if(_0x4fe0bd){return _0x4fe0bd[_0x2fbd('0x32')]()[_0x2fbd('0x1e')](function(){_0x4fbc10[_0x2fbd('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x367105,_0x5c81d0){return function(_0x310da8){if(!_0x310da8){_0x367105['sendStatus'](0x194);}return _0x310da8;};}function handleError(_0x39a5b8,_0x5e95f2){_0x5e95f2=_0x5e95f2||0x1f4;return function(_0x117eda){logger[_0x2fbd('0x21')](_0x117eda[_0x2fbd('0x33')]);if(_0x117eda[_0x2fbd('0x34')]){delete _0x117eda[_0x2fbd('0x34')];}_0x39a5b8['status'](_0x5e95f2)['send'](_0x117eda);};}exports['index']=function(_0xf55f1,_0x8ef1c3){var _0x36a848={},_0x5c37ae={},_0x393197={'count':0x0,'rows':[]};var _0x546b0a=_[_0x2fbd('0x35')](db[_0x2fbd('0x36')][_0x2fbd('0x37')],function(_0x1e6048){return{'name':_0x1e6048[_0x2fbd('0x38')],'type':_0x1e6048[_0x2fbd('0x39')][_0x2fbd('0x3a')]};});_0x5c37ae[_0x2fbd('0x3b')]=_[_0x2fbd('0x35')](_0x546b0a,_0x2fbd('0x34'));_0x5c37ae[_0x2fbd('0x3c')]=_[_0x2fbd('0x3d')](_0xf55f1[_0x2fbd('0x3c')]);_0x5c37ae[_0x2fbd('0x3e')]=_[_0x2fbd('0x3f')](_0x5c37ae[_0x2fbd('0x3b')],_0x5c37ae[_0x2fbd('0x3c')]);_0x36a848[_0x2fbd('0x40')]=_[_0x2fbd('0x3f')](_0x5c37ae['model'],qs['fields'](_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x41')]));_0x36a848[_0x2fbd('0x40')]=_0x36a848['attributes'][_0x2fbd('0x42')]?_0x36a848[_0x2fbd('0x40')]:_0x5c37ae[_0x2fbd('0x3b')];if(!_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x43')](_0x2fbd('0x44'))){_0x36a848[_0x2fbd('0x2d')]=qs['limit'](_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x2d')]);_0x36a848[_0x2fbd('0x2a')]=qs[_0x2fbd('0x2a')](_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x2a')]);}_0x36a848['order']=qs[_0x2fbd('0x45')](_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x45')]);_0x36a848[_0x2fbd('0x46')]=qs[_0x2fbd('0x3e')](_[_0x2fbd('0x47')](_0xf55f1[_0x2fbd('0x3c')],_0x5c37ae[_0x2fbd('0x3e')]),_0x546b0a);if(_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x48')]){_0x36a848[_0x2fbd('0x46')]=_['merge'](_0x36a848[_0x2fbd('0x46')],{'$or':_[_0x2fbd('0x35')](_0x546b0a,function(_0x519fa5){if(_0x519fa5[_0x2fbd('0x39')]!==_0x2fbd('0x49')){var _0x96d701={};_0x96d701[_0x519fa5['name']]={'$like':'%'+_0xf55f1[_0x2fbd('0x3c')][_0x2fbd('0x48')]+'%'};return _0x96d701;}})});}_0x36a848=_[_0x2fbd('0x4a')]({},_0x36a848,_0xf55f1['options']);var _0x175208={'where':_0x36a848[_0x2fbd('0x46')]};return db[_0x2fbd('0x36')][_0x2fbd('0x2c')](_0x175208)['then'](function(_0x191a69){_0x393197[_0x2fbd('0x2c')]=_0x191a69;if(_0xf55f1[_0x2fbd('0x3c')]['includeAll']){_0x36a848['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0x2fbd('0x4b')](_0x36a848);})[_0x2fbd('0x1e')](function(_0x306583){_0x393197['rows']=_0x306583;return _0x393197;})['then'](respondWithFilteredResult(_0x8ef1c3,_0x36a848))[_0x2fbd('0x4c')](handleError(_0x8ef1c3,null));};exports[_0x2fbd('0x4d')]=function(_0x186ce2,_0x3b776e){var _0x3e1eef={'raw':!![],'where':{'id':_0x186ce2[_0x2fbd('0x4e')]['id']}},_0x129684={};_0x129684[_0x2fbd('0x3b')]=_['keys'](db[_0x2fbd('0x36')][_0x2fbd('0x37')]);_0x129684[_0x2fbd('0x3c')]=_[_0x2fbd('0x3d')](_0x186ce2['query']);_0x129684[_0x2fbd('0x3e')]=_['intersection'](_0x129684[_0x2fbd('0x3b')],_0x129684[_0x2fbd('0x3c')]);_0x3e1eef[_0x2fbd('0x40')]=_[_0x2fbd('0x3f')](_0x129684[_0x2fbd('0x3b')],qs[_0x2fbd('0x41')](_0x186ce2['query'][_0x2fbd('0x41')]));_0x3e1eef[_0x2fbd('0x40')]=_0x3e1eef[_0x2fbd('0x40')][_0x2fbd('0x42')]?_0x3e1eef[_0x2fbd('0x40')]:_0x129684['model'];if(_0x186ce2['query']['includeAll']){_0x3e1eef[_0x2fbd('0x4f')]=[{'all':!![]}];}_0x3e1eef=_['merge']({},_0x3e1eef,_0x186ce2[_0x2fbd('0x50')]);return db[_0x2fbd('0x36')]['find'](_0x3e1eef)[_0x2fbd('0x1e')](handleEntityNotFound(_0x3b776e,null))[_0x2fbd('0x1e')](respondWithResult(_0x3b776e,null))[_0x2fbd('0x4c')](handleError(_0x3b776e,null));};exports['create']=function(_0x212715,_0x45b721){return db[_0x2fbd('0x36')]['create'](_0x212715['body'],{})[_0x2fbd('0x1e')](respondWithResult(_0x45b721,0xc9))[_0x2fbd('0x4c')](handleError(_0x45b721,null));};exports[_0x2fbd('0x51')]=function(_0x36c86a,_0x47d45c){if(_0x36c86a['body']['id']){delete _0x36c86a[_0x2fbd('0x52')]['id'];}return db[_0x2fbd('0x36')]['find']({'where':{'id':_0x36c86a['params']['id']}})[_0x2fbd('0x1e')](handleEntityNotFound(_0x47d45c,null))[_0x2fbd('0x1e')](saveUpdates(_0x36c86a[_0x2fbd('0x52')],null))[_0x2fbd('0x1e')](respondWithResult(_0x47d45c,null))[_0x2fbd('0x4c')](handleError(_0x47d45c,null));};exports['destroy']=function(_0xc56dc,_0x2a233e){return db[_0x2fbd('0x36')]['find']({'where':{'id':_0xc56dc[_0x2fbd('0x4e')]['id']}})[_0x2fbd('0x1e')](handleEntityNotFound(_0x2a233e,null))[_0x2fbd('0x1e')](removeEntity(_0x2a233e,null))[_0x2fbd('0x4c')](handleError(_0x2a233e,null));};exports[_0x2fbd('0x53')]=function(_0x3852c5,_0x34bb35){return db[_0x2fbd('0x36')][_0x2fbd('0x53')]()[_0x2fbd('0x1e')](respondWithResult(_0x34bb35,null))[_0x2fbd('0x4c')](handleError(_0x34bb35,null));};var interaction_log=require('../../config/logger')(_0x2fbd('0x54'));exports['accept']=function(_0x133164,_0x29c99c,_0x373b19){var _0x4eafb4={'agent':{},'channel':_0x2fbd('0x55')};if(_0x133164[_0x2fbd('0x52')]['id']){delete _0x133164[_0x2fbd('0x52')]['id'];}_0x133164['body']['read']=!![];_0x133164[_0x2fbd('0x52')][_0x2fbd('0x56')]=moment()[_0x2fbd('0x57')](_0x2fbd('0x58'));_0x133164[_0x2fbd('0x52')][_0x2fbd('0x59')]=_0x133164[_0x2fbd('0x52')][_0x2fbd('0x59')]||_0x133164[_0x2fbd('0x5a')]['id'];_0x4eafb4[_0x2fbd('0x5b')]['id']=_0x133164[_0x2fbd('0x52')][_0x2fbd('0x59')];return db[_0x2fbd('0x36')][_0x2fbd('0x5c')]({'where':{'id':_0x133164['params']['id'],'UserId':null}})[_0x2fbd('0x1e')](handleEntityNotFound(_0x29c99c,null))['then'](saveUpdates(_0x133164[_0x2fbd('0x52')],null))[_0x2fbd('0x1e')](function(_0x56dd3b){if(_0x56dd3b){_0x4eafb4[_0x2fbd('0x24')]=_0x56dd3b[_0x2fbd('0x5d')]({'plain':!![]});return db[_0x2fbd('0x5e')][_0x2fbd('0x5c')]({'where':{'id':_0x56dd3b[_0x2fbd('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x29c99c,null))[_0x2fbd('0x1e')](function(_0x31ce19){if(_0x31ce19){return _0x31ce19[_0x2fbd('0x51')]({'UserId':_0x133164[_0x2fbd('0x52')]['UserId'],'read1stAt':_[_0x2fbd('0x60')](_0x31ce19['read1stAt'])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x2fbd('0x1e')](function(_0x172819){if(_0x172819){_0x4eafb4[_0x2fbd('0x61')]=_0x172819[_0x2fbd('0x5d')]({'plain':!![]});interaction_log[_0x2fbd('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x133164[_0x2fbd('0x5a')]['id'],_0x133164[_0x2fbd('0x5a')][_0x2fbd('0x34')],_0x133164[_0x2fbd('0x5a')]['role'],_0x4eafb4[_0x2fbd('0x61')]['id'],_0x133164[_0x2fbd('0x52')]?JSON[_0x2fbd('0x62')](_0x133164['body']):_0x2fbd('0x63'));return respondWithRpcPromise(_0x2fbd('0x64'),_0x2fbd('0x65'),_0x4eafb4);}return null;})[_0x2fbd('0x1e')](function(_0x248d31){var _0x76c552='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x248d31[_0x2fbd('0x24')]['ContactId'];return db[_0x2fbd('0x66')][_0x2fbd('0x3c')](_0x76c552,{'type':db['Sequelize'][_0x2fbd('0x67')][_0x2fbd('0x68')],'raw':!![]})[_0x2fbd('0x1e')](function(_0x252ffe){return _0x252ffe;});})[_0x2fbd('0x1e')](function(_0x3140ae){if(_0x3140ae){_0x4eafb4['message'][_0x2fbd('0x69')]=_0x3140ae[0x0];if(!_0x133164[_0x2fbd('0x52')][_0x2fbd('0x59')])return;return db[_0x2fbd('0x6a')][_0x2fbd('0x5c')]({'where':{'id':_0x133164['body'][_0x2fbd('0x59')],'role':_0x2fbd('0x5b')},'attributes':['id',_0x2fbd('0x34'),'fullname',_0x2fbd('0x6b'),_0x2fbd('0x6c')],'raw':!![]});}return null;})[_0x2fbd('0x1e')](function(_0x154dca){if(!_0x154dca)return null;_0x4eafb4[_0x2fbd('0x24')][_0x2fbd('0x5b')]=_0x154dca;return _0x4eafb4;})[_0x2fbd('0x1e')](function(_0x3cfda9){if(_0x3cfda9){if(_0x133164[_0x2fbd('0x52')][_0x2fbd('0x6d')]){_0x4eafb4[_0x2fbd('0x24')][_0x2fbd('0x6e')]=util['format'](_0x2fbd('0x6f'),_0x133164['user']['name']);_0x4eafb4[_0x2fbd('0x24')][_0x2fbd('0x70')]=_0x4eafb4[_0x2fbd('0x70')];_0x4eafb4[_0x2fbd('0x24')]['motionChannel']=_0x4eafb4[_0x2fbd('0x70')];_0x4eafb4['message']['event']=_0x2fbd('0x71');return respondWithRpcPromise(_0x2fbd('0x72'),'EventManager',{'event':'acceptmessage','message':_0x4eafb4[_0x2fbd('0x24')]},client9002)[_0x2fbd('0x1e')](function(){return _0x4eafb4;});}return _0x4eafb4;}return null;})[_0x2fbd('0x1e')](respondWithResult(_0x29c99c,null))[_0x2fbd('0x4c')](handleError(_0x29c99c,null));};var interaction_log=require(_0x2fbd('0x73'))(_0x2fbd('0x54'));exports[_0x2fbd('0x74')]=function(_0x30df48,_0x583699,_0x5ebbe8){var _0x87c78c={'agent':{},'channel':_0x2fbd('0x55')};if(_0x30df48[_0x2fbd('0x52')]['id']){delete _0x30df48[_0x2fbd('0x52')]['id'];}_0x30df48['body'][_0x2fbd('0x59')]=_0x30df48[_0x2fbd('0x52')][_0x2fbd('0x59')]||_0x30df48[_0x2fbd('0x5a')]['id'];_0x87c78c[_0x2fbd('0x5b')]['id']=_0x30df48['body'][_0x2fbd('0x59')];return db[_0x2fbd('0x36')][_0x2fbd('0x5c')]({'where':{'id':_0x30df48[_0x2fbd('0x4e')]['id'],'UserId':null}})[_0x2fbd('0x1e')](handleEntityNotFound(_0x583699,null))[_0x2fbd('0x1e')](function(_0x2a8e5a){if(_0x2a8e5a){_0x87c78c[_0x2fbd('0x24')]=_0x2a8e5a[_0x2fbd('0x5d')]({'plain':!![]});return db['OpenchannelInteraction'][_0x2fbd('0x5c')]({'where':{'id':_0x2a8e5a[_0x2fbd('0x5f')]}});}return null;})[_0x2fbd('0x1e')](handleEntityNotFound(_0x583699,null))['then'](function(_0xf5abf7){if(_0xf5abf7){_0x87c78c[_0x2fbd('0x61')]=_0xf5abf7[_0x2fbd('0x5d')]({'plain':!![]});interaction_log[_0x2fbd('0x25')](_0x2fbd('0x75'),_0x30df48[_0x2fbd('0x5a')]['id'],_0x30df48[_0x2fbd('0x5a')][_0x2fbd('0x34')],_0x30df48[_0x2fbd('0x5a')]['role'],_0x87c78c[_0x2fbd('0x61')]['id'],_0x30df48[_0x2fbd('0x52')]?JSON['stringify'](_0x30df48[_0x2fbd('0x52')]):'null');return respondWithRpcPromise('RejectMessage',_0x2fbd('0x76'),_0x87c78c);}return null;})[_0x2fbd('0x1e')](function(_0x1daece){var _0x5e19b0=_0x2fbd('0x77')+_0x1daece[_0x2fbd('0x24')][_0x2fbd('0x78')];return db[_0x2fbd('0x66')][_0x2fbd('0x3c')](_0x5e19b0,{'type':db[_0x2fbd('0x79')]['QueryTypes'][_0x2fbd('0x68')],'raw':!![]})[_0x2fbd('0x1e')](function(_0x5dc2b6){return _0x5dc2b6;});})[_0x2fbd('0x1e')](function(_0x454ccf){if(_0x454ccf){_0x87c78c[_0x2fbd('0x24')][_0x2fbd('0x69')]=_0x454ccf[0x0];if(!_0x30df48[_0x2fbd('0x52')][_0x2fbd('0x59')])return;return db[_0x2fbd('0x6a')][_0x2fbd('0x5c')]({'where':{'id':_0x30df48[_0x2fbd('0x52')][_0x2fbd('0x59')],'role':_0x2fbd('0x5b')},'attributes':['id',_0x2fbd('0x34'),_0x2fbd('0x7a'),'email',_0x2fbd('0x6c')],'raw':!![]});}return null;})[_0x2fbd('0x1e')](function(_0x4038f7){if(!_0x4038f7)return null;_0x87c78c['message'][_0x2fbd('0x5b')]=_0x4038f7;return _0x87c78c;})[_0x2fbd('0x1e')](function(_0x533ae9){if(_0x533ae9){_0x533ae9[_0x2fbd('0x24')][_0x2fbd('0x6e')]=util[_0x2fbd('0x57')]('SIP/%s',_0x30df48['user']['name']);_0x533ae9['message']['channel']=_0x87c78c[_0x2fbd('0x70')];_0x533ae9[_0x2fbd('0x24')][_0x2fbd('0x7b')]=_0x87c78c[_0x2fbd('0x70')];_0x533ae9[_0x2fbd('0x24')][_0x2fbd('0x7c')]=_0x2fbd('0x74');respondWithRpcPromise(_0x2fbd('0x72'),_0x2fbd('0x72'),{'event':_0x2fbd('0x7d'),'message':_0x533ae9[_0x2fbd('0x24')]},client9002);return _0x87c78c;}return null;})['then'](respondWithResult(_0x583699,null))[_0x2fbd('0x4c')](handleError(_0x583699,null));}; \ No newline at end of file +var _0x0b9b=['user','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','get','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','QueryTypes','SELECT','User','agent','fullname','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','ContactId','internal','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','http','client','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','stack','name','send','index','OpenchannelMessage','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','count','includeAll','findAll','rows','show','params','length','include','find','create','update','body','destroy','describe','openchannel-interactions','accept','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId'];(function(_0x625a73,_0x50ae08){var _0x3eceb5=function(_0x9e9500){while(--_0x9e9500){_0x625a73['push'](_0x625a73['shift']());}};_0x3eceb5(++_0x50ae08);}(_0x0b9b,0x1b9));var _0xb0b9=function(_0x590628,_0x1c4faa){_0x590628=_0x590628-0x0;var _0x3ab398=_0x0b9b[_0x590628];return _0x3ab398;};'use strict';var emlformat=require(_0xb0b9('0x0'));var rimraf=require(_0xb0b9('0x1'));var zipdir=require(_0xb0b9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb0b9('0x3'));var moment=require(_0xb0b9('0x4'));var BPromise=require(_0xb0b9('0x5'));var Mustache=require('mustache');var util=require(_0xb0b9('0x6'));var path=require(_0xb0b9('0x7'));var sox=require(_0xb0b9('0x8'));var csv=require(_0xb0b9('0x9'));var ejs=require(_0xb0b9('0xa'));var fs=require('fs');var fs_extra=require(_0xb0b9('0xb'));var _=require('lodash');var squel=require(_0xb0b9('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0b9('0xd'));var toCsv=require(_0xb0b9('0x9'));var querystring=require('querystring');var Papa=require(_0xb0b9('0xe'));var Redis=require(_0xb0b9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb0b9('0x10'));var as=require(_0xb0b9('0x11'));var hardwareService=require(_0xb0b9('0x12'));var logger=require('../../config/logger')(_0xb0b9('0x13'));var utils=require(_0xb0b9('0x14'));var config=require(_0xb0b9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb0b9('0x16'))['db'];config['redis']=_[_0xb0b9('0x17')](config[_0xb0b9('0x18')],{'host':_0xb0b9('0x19'),'port':0x18eb});var socket=require(_0xb0b9('0x1a'))(new Redis(config[_0xb0b9('0x18')]));require(_0xb0b9('0x1b'))[_0xb0b9('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb0b9('0x1d')]({'port':0x232c});var client9002=jayson[_0xb0b9('0x1e')][_0xb0b9('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x54b4db,_0x4f9b65,_0x4e8d34,_0x765604){return new BPromise(function(_0x2c146a,_0x4f2f50){var _0x31a23a=_0x765604||client;return _0x31a23a[_0xb0b9('0x1f')](_0x54b4db,_0x4e8d34)[_0xb0b9('0x20')](function(_0x401cf8){logger[_0xb0b9('0x21')](_0xb0b9('0x22'),_0x4f9b65,_0xb0b9('0x23'));logger[_0xb0b9('0x24')](_0xb0b9('0x25'),_0x4f9b65,_0xb0b9('0x23'),JSON[_0xb0b9('0x26')](_0x401cf8));if(_0x401cf8[_0xb0b9('0x27')]){if(_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x28')]===0x1f4){logger[_0xb0b9('0x27')](_0xb0b9('0x22'),_0x4f9b65,_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);return _0x4f2f50(_0x401cf8['error']['message']);}logger[_0xb0b9('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f9b65,_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);return _0x2c146a(_0x401cf8[_0xb0b9('0x27')][_0xb0b9('0x29')]);}else{logger[_0xb0b9('0x21')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f9b65,_0xb0b9('0x23'));_0x2c146a(_0x401cf8[_0xb0b9('0x2a')]['message']);}})[_0xb0b9('0x2b')](function(_0x45e7c6){logger[_0xb0b9('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0x4f9b65,_0x45e7c6);_0x4f2f50(_0x45e7c6);});});}function respondWithStatusCode(_0x47ad25,_0x120773){_0x120773=_0x120773||0xcc;return function(_0x6c4af6){if(_0x6c4af6){return _0x47ad25[_0xb0b9('0x2c')](_0x120773);}return _0x47ad25[_0xb0b9('0x2d')](_0x120773)[_0xb0b9('0x2e')]();};}function respondWithResult(_0xc6092c,_0x4c2588){_0x4c2588=_0x4c2588||0xc8;return function(_0x8c4aec){if(_0x8c4aec){return _0xc6092c[_0xb0b9('0x2d')](_0x4c2588)[_0xb0b9('0x2f')](_0x8c4aec);}};}function respondWithFilteredResult(_0x3b5fd4,_0xf24747){return function(_0x45c791){if(_0x45c791){var _0x215d41=typeof _0xf24747[_0xb0b9('0x30')]===_0xb0b9('0x31')&&typeof _0xf24747['limit']===_0xb0b9('0x31');var _0x31f8b5=_0x45c791['count'];var _0x26bfda=_0x215d41?0x0:_0xf24747[_0xb0b9('0x30')];var _0x395908=_0x215d41?_0x45c791['count']:_0xf24747['offset']+_0xf24747[_0xb0b9('0x32')];var _0x16bd7a;if(_0x395908>=_0x31f8b5){_0x395908=_0x31f8b5;_0x16bd7a=0xc8;}else{_0x16bd7a=0xce;}_0x3b5fd4[_0xb0b9('0x2d')](_0x16bd7a);return _0x3b5fd4[_0xb0b9('0x33')](_0xb0b9('0x34'),_0x26bfda+'-'+_0x395908+'/'+_0x31f8b5)[_0xb0b9('0x2f')](_0x45c791);}return null;};}function patchUpdates(_0x5c7082){return function(_0x580fad){try{jsonpatch[_0xb0b9('0x35')](_0x580fad,_0x5c7082,!![]);}catch(_0xcbe3b4){return BPromise[_0xb0b9('0x36')](_0xcbe3b4);}return _0x580fad['save']();};}function saveUpdates(_0x70a8b0,_0x768adc){return function(_0x553929){if(_0x553929){return _0x553929['update'](_0x70a8b0)['then'](function(_0x5c87aa){return _0x5c87aa;});}return null;};}function removeEntity(_0x1e7553,_0x173e79){return function(_0x248671){if(_0x248671){return _0x248671['destroy']()[_0xb0b9('0x20')](function(){_0x1e7553[_0xb0b9('0x2d')](0xcc)[_0xb0b9('0x2e')]();});}};}function handleEntityNotFound(_0x53b428,_0x1b980e){return function(_0x526c1d){if(!_0x526c1d){_0x53b428[_0xb0b9('0x2c')](0x194);}return _0x526c1d;};}function handleError(_0x4f841d,_0x5a5093){_0x5a5093=_0x5a5093||0x1f4;return function(_0xd88394){logger[_0xb0b9('0x27')](_0xd88394[_0xb0b9('0x37')]);if(_0xd88394[_0xb0b9('0x38')]){delete _0xd88394[_0xb0b9('0x38')];}_0x4f841d[_0xb0b9('0x2d')](_0x5a5093)[_0xb0b9('0x39')](_0xd88394);};}exports[_0xb0b9('0x3a')]=function(_0x16e6b3,_0x25a9cb){var _0x335d8b={},_0x35a56f={},_0x50676d={'count':0x0,'rows':[]};var _0x565005=_['map'](db[_0xb0b9('0x3b')][_0xb0b9('0x3c')],function(_0x1dfbde){return{'name':_0x1dfbde[_0xb0b9('0x3d')],'type':_0x1dfbde[_0xb0b9('0x3e')][_0xb0b9('0x3f')]};});_0x35a56f['model']=_['map'](_0x565005,_0xb0b9('0x38'));_0x35a56f[_0xb0b9('0x40')]=_[_0xb0b9('0x41')](_0x16e6b3[_0xb0b9('0x40')]);_0x35a56f[_0xb0b9('0x42')]=_[_0xb0b9('0x43')](_0x35a56f['model'],_0x35a56f[_0xb0b9('0x40')]);_0x335d8b[_0xb0b9('0x44')]=_[_0xb0b9('0x43')](_0x35a56f[_0xb0b9('0x45')],qs[_0xb0b9('0x46')](_0x16e6b3['query'][_0xb0b9('0x46')]));_0x335d8b[_0xb0b9('0x44')]=_0x335d8b[_0xb0b9('0x44')]['length']?_0x335d8b[_0xb0b9('0x44')]:_0x35a56f[_0xb0b9('0x45')];if(!_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x47')](_0xb0b9('0x48'))){_0x335d8b[_0xb0b9('0x32')]=qs[_0xb0b9('0x32')](_0x16e6b3[_0xb0b9('0x40')]['limit']);_0x335d8b[_0xb0b9('0x30')]=qs[_0xb0b9('0x30')](_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x30')]);}_0x335d8b[_0xb0b9('0x49')]=qs[_0xb0b9('0x4a')](_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x4a')]);_0x335d8b[_0xb0b9('0x4b')]=qs['filters'](_[_0xb0b9('0x4c')](_0x16e6b3[_0xb0b9('0x40')],_0x35a56f[_0xb0b9('0x42')]),_0x565005);if(_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x4d')]){_0x335d8b[_0xb0b9('0x4b')]=_['merge'](_0x335d8b['where'],{'$or':_[_0xb0b9('0x4e')](_0x565005,function(_0x4f9d21){if(_0x4f9d21[_0xb0b9('0x3e')]!==_0xb0b9('0x4f')){var _0x5373e8={};_0x5373e8[_0x4f9d21[_0xb0b9('0x38')]]={'$like':'%'+_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x4d')]+'%'};return _0x5373e8;}})});}_0x335d8b=_['merge']({},_0x335d8b,_0x16e6b3[_0xb0b9('0x50')]);var _0x2c2b6c={'where':_0x335d8b[_0xb0b9('0x4b')]};return db[_0xb0b9('0x3b')][_0xb0b9('0x51')](_0x2c2b6c)[_0xb0b9('0x20')](function(_0x53ee25){_0x50676d['count']=_0x53ee25;if(_0x16e6b3[_0xb0b9('0x40')][_0xb0b9('0x52')]){_0x335d8b['include']=[{'all':!![]}];}return db['OpenchannelMessage'][_0xb0b9('0x53')](_0x335d8b);})['then'](function(_0xbf0376){_0x50676d[_0xb0b9('0x54')]=_0xbf0376;return _0x50676d;})[_0xb0b9('0x20')](respondWithFilteredResult(_0x25a9cb,_0x335d8b))[_0xb0b9('0x2b')](handleError(_0x25a9cb,null));};exports[_0xb0b9('0x55')]=function(_0x9854fa,_0x3563f1){var _0x314a33={'raw':!![],'where':{'id':_0x9854fa[_0xb0b9('0x56')]['id']}},_0x525a85={};_0x525a85[_0xb0b9('0x45')]=_[_0xb0b9('0x41')](db[_0xb0b9('0x3b')][_0xb0b9('0x3c')]);_0x525a85[_0xb0b9('0x40')]=_['keys'](_0x9854fa[_0xb0b9('0x40')]);_0x525a85[_0xb0b9('0x42')]=_[_0xb0b9('0x43')](_0x525a85[_0xb0b9('0x45')],_0x525a85[_0xb0b9('0x40')]);_0x314a33[_0xb0b9('0x44')]=_['intersection'](_0x525a85['model'],qs[_0xb0b9('0x46')](_0x9854fa[_0xb0b9('0x40')]['fields']));_0x314a33[_0xb0b9('0x44')]=_0x314a33[_0xb0b9('0x44')][_0xb0b9('0x57')]?_0x314a33[_0xb0b9('0x44')]:_0x525a85['model'];if(_0x9854fa[_0xb0b9('0x40')][_0xb0b9('0x52')]){_0x314a33[_0xb0b9('0x58')]=[{'all':!![]}];}_0x314a33=_['merge']({},_0x314a33,_0x9854fa[_0xb0b9('0x50')]);return db[_0xb0b9('0x3b')][_0xb0b9('0x59')](_0x314a33)[_0xb0b9('0x20')](handleEntityNotFound(_0x3563f1,null))['then'](respondWithResult(_0x3563f1,null))[_0xb0b9('0x2b')](handleError(_0x3563f1,null));};exports[_0xb0b9('0x5a')]=function(_0x24d6a3,_0x55ae69){return db[_0xb0b9('0x3b')][_0xb0b9('0x5a')](_0x24d6a3['body'],{})[_0xb0b9('0x20')](respondWithResult(_0x55ae69,0xc9))[_0xb0b9('0x2b')](handleError(_0x55ae69,null));};exports[_0xb0b9('0x5b')]=function(_0x5960c0,_0x2a658f){if(_0x5960c0[_0xb0b9('0x5c')]['id']){delete _0x5960c0[_0xb0b9('0x5c')]['id'];}return db[_0xb0b9('0x3b')][_0xb0b9('0x59')]({'where':{'id':_0x5960c0[_0xb0b9('0x56')]['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x2a658f,null))[_0xb0b9('0x20')](saveUpdates(_0x5960c0[_0xb0b9('0x5c')],null))[_0xb0b9('0x20')](respondWithResult(_0x2a658f,null))[_0xb0b9('0x2b')](handleError(_0x2a658f,null));};exports[_0xb0b9('0x5d')]=function(_0x1e6ee4,_0x3d358f){return db[_0xb0b9('0x3b')][_0xb0b9('0x59')]({'where':{'id':_0x1e6ee4['params']['id']}})[_0xb0b9('0x20')](handleEntityNotFound(_0x3d358f,null))[_0xb0b9('0x20')](removeEntity(_0x3d358f,null))[_0xb0b9('0x2b')](handleError(_0x3d358f,null));};exports[_0xb0b9('0x5e')]=function(_0x353f08,_0x324189){return db[_0xb0b9('0x3b')][_0xb0b9('0x5e')]()[_0xb0b9('0x20')](respondWithResult(_0x324189,null))[_0xb0b9('0x2b')](handleError(_0x324189,null));};var interaction_log=require('../../config/logger')(_0xb0b9('0x5f'));exports[_0xb0b9('0x60')]=function(_0x97cdef,_0x1ecfcf,_0x7cdf2a){var _0x5baf82={'agent':{},'channel':_0xb0b9('0x61')};if(_0x97cdef[_0xb0b9('0x5c')]['id']){delete _0x97cdef[_0xb0b9('0x5c')]['id'];}_0x97cdef['body'][_0xb0b9('0x62')]=!![];_0x97cdef['body'][_0xb0b9('0x63')]=moment()[_0xb0b9('0x64')](_0xb0b9('0x65'));_0x97cdef[_0xb0b9('0x5c')]['UserId']=_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x66')]||_0x97cdef[_0xb0b9('0x67')]['id'];_0x5baf82['agent']['id']=_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x66')];return db[_0xb0b9('0x3b')][_0xb0b9('0x59')]({'where':{'id':_0x97cdef[_0xb0b9('0x56')]['id'],'UserId':null}})[_0xb0b9('0x20')](handleEntityNotFound(_0x1ecfcf,null))['then'](saveUpdates(_0x97cdef[_0xb0b9('0x5c')],null))[_0xb0b9('0x20')](function(_0x493aa5){if(_0x493aa5){_0x5baf82['message']=_0x493aa5['get']({'plain':!![]});return db[_0xb0b9('0x68')][_0xb0b9('0x59')]({'where':{'id':_0x493aa5[_0xb0b9('0x69')]}});}return null;})['then'](handleEntityNotFound(_0x1ecfcf,null))[_0xb0b9('0x20')](function(_0x1098f9){if(_0x1098f9){return _0x1098f9[_0xb0b9('0x5b')]({'UserId':_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x66')],'read1stAt':_[_0xb0b9('0x6a')](_0x1098f9[_0xb0b9('0x6b')])?moment()[_0xb0b9('0x64')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb0b9('0x20')](function(_0x4e572e){if(_0x4e572e){_0x5baf82[_0xb0b9('0x6c')]=_0x4e572e[_0xb0b9('0x6d')]({'plain':!![]});interaction_log[_0xb0b9('0x21')](_0xb0b9('0x6e'),_0x97cdef[_0xb0b9('0x67')]['id'],_0x97cdef[_0xb0b9('0x67')][_0xb0b9('0x38')],_0x97cdef[_0xb0b9('0x67')][_0xb0b9('0x6f')],_0x5baf82['interaction']['id'],_0x97cdef['body']?JSON['stringify'](_0x97cdef[_0xb0b9('0x5c')]):_0xb0b9('0x70'));return respondWithRpcPromise(_0xb0b9('0x71'),_0xb0b9('0x72'),_0x5baf82);}return null;})[_0xb0b9('0x20')](function(_0x2907ed){var _0x9f1b50=_0xb0b9('0x73')+_0x2907ed[_0xb0b9('0x29')]['ContactId'];return db[_0xb0b9('0x74')][_0xb0b9('0x40')](_0x9f1b50,{'type':db[_0xb0b9('0x75')][_0xb0b9('0x76')][_0xb0b9('0x77')],'raw':!![]})[_0xb0b9('0x20')](function(_0x520e53){return _0x520e53;});})[_0xb0b9('0x20')](function(_0x20ddee){if(_0x20ddee){_0x5baf82['message']['contact']=_0x20ddee[0x0];if(!_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x66')])return;return db[_0xb0b9('0x78')][_0xb0b9('0x59')]({'where':{'id':_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x66')],'role':_0xb0b9('0x79')},'attributes':['id','name',_0xb0b9('0x7a'),'email','internal'],'raw':!![]});}return null;})[_0xb0b9('0x20')](function(_0x4a75b9){if(!_0x4a75b9)return null;_0x5baf82['message'][_0xb0b9('0x79')]=_0x4a75b9;return _0x5baf82;})[_0xb0b9('0x20')](function(_0x1a43b2){if(_0x1a43b2){if(_0x97cdef[_0xb0b9('0x5c')][_0xb0b9('0x7b')]){_0x5baf82['message'][_0xb0b9('0x7c')]=util[_0xb0b9('0x64')](_0xb0b9('0x7d'),_0x97cdef[_0xb0b9('0x67')][_0xb0b9('0x38')]);_0x5baf82['message'][_0xb0b9('0x7e')]=_0x5baf82['channel'];_0x5baf82[_0xb0b9('0x29')][_0xb0b9('0x7f')]=_0x5baf82[_0xb0b9('0x7e')];_0x5baf82[_0xb0b9('0x29')][_0xb0b9('0x80')]=_0xb0b9('0x60');return respondWithRpcPromise('EventManager',_0xb0b9('0x81'),{'event':_0xb0b9('0x82'),'message':_0x5baf82[_0xb0b9('0x29')]},client9002)['then'](function(){return _0x5baf82;});}return _0x5baf82;}return null;})[_0xb0b9('0x20')](respondWithResult(_0x1ecfcf,null))[_0xb0b9('0x2b')](handleError(_0x1ecfcf,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xb0b9('0x36')]=function(_0xf7a89c,_0x428489,_0x41ae30){var _0x3c7b44={'agent':{},'channel':_0xb0b9('0x61')};if(_0xf7a89c[_0xb0b9('0x5c')]['id']){delete _0xf7a89c['body']['id'];}_0xf7a89c[_0xb0b9('0x5c')][_0xb0b9('0x66')]=_0xf7a89c[_0xb0b9('0x5c')][_0xb0b9('0x66')]||_0xf7a89c[_0xb0b9('0x67')]['id'];_0x3c7b44[_0xb0b9('0x79')]['id']=_0xf7a89c[_0xb0b9('0x5c')][_0xb0b9('0x66')];return db['OpenchannelMessage'][_0xb0b9('0x59')]({'where':{'id':_0xf7a89c[_0xb0b9('0x56')]['id'],'UserId':null}})[_0xb0b9('0x20')](handleEntityNotFound(_0x428489,null))[_0xb0b9('0x20')](function(_0x466b62){if(_0x466b62){_0x3c7b44[_0xb0b9('0x29')]=_0x466b62[_0xb0b9('0x6d')]({'plain':!![]});return db[_0xb0b9('0x68')]['find']({'where':{'id':_0x466b62['OpenchannelInteractionId']}});}return null;})[_0xb0b9('0x20')](handleEntityNotFound(_0x428489,null))[_0xb0b9('0x20')](function(_0x3f07ae){if(_0x3f07ae){_0x3c7b44['interaction']=_0x3f07ae[_0xb0b9('0x6d')]({'plain':!![]});interaction_log['info'](_0xb0b9('0x83'),_0xf7a89c[_0xb0b9('0x67')]['id'],_0xf7a89c['user'][_0xb0b9('0x38')],_0xf7a89c['user'][_0xb0b9('0x6f')],_0x3c7b44[_0xb0b9('0x6c')]['id'],_0xf7a89c[_0xb0b9('0x5c')]?JSON['stringify'](_0xf7a89c[_0xb0b9('0x5c')]):_0xb0b9('0x70'));return respondWithRpcPromise(_0xb0b9('0x84'),'rejectMessage',_0x3c7b44);}return null;})[_0xb0b9('0x20')](function(_0x2a43ec){var _0x400adf=_0xb0b9('0x73')+_0x2a43ec[_0xb0b9('0x29')][_0xb0b9('0x85')];return db[_0xb0b9('0x74')]['query'](_0x400adf,{'type':db[_0xb0b9('0x75')]['QueryTypes'][_0xb0b9('0x77')],'raw':!![]})[_0xb0b9('0x20')](function(_0x449cb6){return _0x449cb6;});})[_0xb0b9('0x20')](function(_0x45fda1){if(_0x45fda1){_0x3c7b44['message']['contact']=_0x45fda1[0x0];if(!_0xf7a89c[_0xb0b9('0x5c')][_0xb0b9('0x66')])return;return db[_0xb0b9('0x78')][_0xb0b9('0x59')]({'where':{'id':_0xf7a89c[_0xb0b9('0x5c')][_0xb0b9('0x66')],'role':_0xb0b9('0x79')},'attributes':['id',_0xb0b9('0x38'),_0xb0b9('0x7a'),'email',_0xb0b9('0x86')],'raw':!![]});}return null;})['then'](function(_0x4e7906){if(!_0x4e7906)return null;_0x3c7b44['message']['agent']=_0x4e7906;return _0x3c7b44;})['then'](function(_0x54ecad){if(_0x54ecad){_0x54ecad[_0xb0b9('0x29')][_0xb0b9('0x7c')]=util[_0xb0b9('0x64')]('SIP/%s',_0xf7a89c['user']['name']);_0x54ecad[_0xb0b9('0x29')][_0xb0b9('0x7e')]=_0x3c7b44[_0xb0b9('0x7e')];_0x54ecad[_0xb0b9('0x29')][_0xb0b9('0x7f')]=_0x3c7b44[_0xb0b9('0x7e')];_0x54ecad[_0xb0b9('0x29')][_0xb0b9('0x80')]=_0xb0b9('0x36');respondWithRpcPromise(_0xb0b9('0x81'),_0xb0b9('0x81'),{'event':_0xb0b9('0x87'),'message':_0x54ecad[_0xb0b9('0x29')]},client9002);return _0x3c7b44;}return null;})[_0xb0b9('0x20')](respondWithResult(_0x428489,null))[_0xb0b9('0x2b')](handleError(_0x428489,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 62616c9..ce3f172 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 _0x62c6=['emit','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','remove'];(function(_0x4989d9,_0x4eeee1){var _0x4b4691=function(_0x7526c4){while(--_0x7526c4){_0x4989d9['push'](_0x4989d9['shift']());}};_0x4b4691(++_0x4eeee1);}(_0x62c6,0x12c));var _0x662c=function(_0xc046a,_0x3d5e5f){_0xc046a=_0xc046a-0x0;var _0xf8132c=_0x62c6[_0xc046a];return _0xf8132c;};'use strict';var EventEmitter=require(_0x662c('0x0'));var OpenchannelMessage=require(_0x662c('0x1'))['db'][_0x662c('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x662c('0x3')](0x0);var events={'afterCreate':_0x662c('0x4'),'afterUpdate':'update','afterDestroy':_0x662c('0x5')};function emitEvent(_0x2a4c56){return function(_0x21d10c,_0x11bf9f,_0x24ac14){OpenchannelMessageEvents[_0x662c('0x6')](_0x2a4c56+':'+_0x21d10c['id'],_0x21d10c);OpenchannelMessageEvents[_0x662c('0x6')](_0x2a4c56,_0x21d10c);_0x24ac14(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x662c('0x7')](e,emitEvent(event));}}module[_0x662c('0x8')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x87b5=['hasOwnProperty','hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x87b5,0x113));var _0x587b=function(_0x1ed42d,_0x332e3d){_0x1ed42d=_0x1ed42d-0x0;var _0x1c9f64=_0x87b5[_0x1ed42d];return _0x1c9f64;};'use strict';var EventEmitter=require(_0x587b('0x0'));var OpenchannelMessage=require(_0x587b('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x587b('0x2'),'afterUpdate':_0x587b('0x3'),'afterDestroy':'remove'};function emitEvent(_0x515f7c){return function(_0x1bcece,_0x3f691d,_0x20c3a0){OpenchannelMessageEvents[_0x587b('0x4')](_0x515f7c+':'+_0x1bcece['id'],_0x1bcece);OpenchannelMessageEvents[_0x587b('0x4')](_0x515f7c,_0x1bcece);_0x20c3a0(null);};}for(var e in events){if(events[_0x587b('0x5')](e)){var event=events[e];OpenchannelMessage[_0x587b('0x6')](e,emitEvent(event));}}module[_0x587b('0x7')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 9f885ea..f634e41 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 _0x8f4c=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','secret','isNil','UserId','findOne','OpenchannelInteractionId','then','update','createdAt','catch','error','direction','describe','OpenchannelAccount','find','OpenchannelAccountId','OpenchannelInteraction','Interactions','CmContact','Contact','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4_unicode_ci'];(function(_0x505d34,_0x5c6c0b){var _0x501a53=function(_0x4ac80a){while(--_0x4ac80a){_0x505d34['push'](_0x505d34['shift']());}};_0x501a53(++_0x5c6c0b);}(_0x8f4c,0x113));var _0xc8f4=function(_0x1eabe2,_0x24666c){_0x1eabe2=_0x1eabe2-0x0;var _0x39adc0=_0x8f4c[_0x1eabe2];return _0x39adc0;};'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('./openchannelMessage.attributes');module[_0xc8f4('0x9')]=function(_0x5208da,_0x4c86f8){return _0x5208da['define'](_0xc8f4('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc8f4('0xb'),'fields':[_0xc8f4('0xc')],'type':_0xc8f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39ed63,_0x34f05f,_0x599de3){var _0x38c41b=_0x5208da[_0xc8f4('0xe')];var _0x2fba62=_0x39ed63[_0xc8f4('0xf')]({'plain':!![]});if(_0x2fba62['direction'][_0xc8f4('0x10')]()==='in'||_0x2fba62['direction'][_0xc8f4('0x10')]()===_0xc8f4('0x11')&&!_0x2fba62[_0xc8f4('0x12')]&&!_[_0xc8f4('0x13')](_0x2fba62[_0xc8f4('0x14')])){_0x38c41b['OpenchannelInteraction'][_0xc8f4('0x15')]({'where':{'id':_0x2fba62[_0xc8f4('0x16')]}})[_0xc8f4('0x17')](function(_0x14bc11){if(_0x14bc11){_0x14bc11[_0xc8f4('0x18')]({'lastMsgAt':_0x2fba62[_0xc8f4('0x19')],'lastMsgDirection':_0x2fba62['direction'][_0xc8f4('0x10')]()});}})[_0xc8f4('0x1a')](function(_0x1518a6){console[_0xc8f4('0x1b')](_0x1518a6);});}if(_0x2fba62[_0xc8f4('0x1c')]==='out'&&!_0x2fba62[_0xc8f4('0x12')]){var _0x4d2b77;_0x38c41b['CmContact'][_0xc8f4('0x1d')]()[_0xc8f4('0x17')](function(_0x108076){return _0x38c41b[_0xc8f4('0x1e')][_0xc8f4('0x1f')]({'where':{'id':_0x2fba62[_0xc8f4('0x20')]},'include':[{'model':_0x38c41b[_0xc8f4('0x21')],'as':_0xc8f4('0x22'),'where':{'id':_0x2fba62[_0xc8f4('0x16')]},'limit':0x1,'include':[{'model':_0x38c41b[_0xc8f4('0x23')],'as':_0xc8f4('0x24'),'attributes':_[_0xc8f4('0x25')](_0x108076)}]}]});})[_0xc8f4('0x17')](function(_0x5f3264){_0x4d2b77=_0x5f3264[_0xc8f4('0xf')]({'plain':!![]});if(_0x4d2b77&&_0x4d2b77[_0xc8f4('0x26')]){logger[_0xc8f4('0x27')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x2b'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x4d2b77['Interactions']&&_0x4d2b77[_0xc8f4('0x22')][_0xc8f4('0x2c')]){_0x2fba62[_0xc8f4('0x2d')]=_[_0xc8f4('0x2e')](_0x4d2b77['Interactions'][0x0],_0xc8f4('0x24'));_0x2fba62['Contact']=_0x4d2b77[_0xc8f4('0x22')][0x0]['Contact'];}var _0x34f05f={'method':_0xc8f4('0x2f'),'uri':encodeURI(_0x4d2b77['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34f05f[_0xc8f4('0x30')]){case _0xc8f4('0x31'):_0x34f05f['qs']=_0x2fba62;break;case _0xc8f4('0x2f'):_0x34f05f[_0xc8f4('0xc')]=_0x2fba62;break;}return rp(_0x34f05f)['then'](function(_0x3db490){logger[_0xc8f4('0x27')]('OpenchannelMessage,\x20%s,\x20%s',_0xc8f4('0x29'),util[_0xc8f4('0x2a')](_0xc8f4('0x32'),_0x2fba62['id'],_0x4d2b77[_0xc8f4('0x26')]));if(_0x3db490[_0xc8f4('0xc')][_0xc8f4('0x33')]&&_0x3db490['body'][_0xc8f4('0x33')]!=_0x2fba62[_0xc8f4('0x2d')][_0xc8f4('0x33')]){return _0x38c41b['OpenchannelInteraction'][_0xc8f4('0x18')]({'threadId':_0x3db490[_0xc8f4('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x2fba62['Interaction']['id']}});}else{return;}})['then'](function(){return _0x39ed63[_0xc8f4('0x18')]({'read':!![]});})[_0xc8f4('0x1a')](function(_0x2e9a2a){logger[_0xc8f4('0x1b')](_0xc8f4('0x28'),_0xc8f4('0x29'),util[_0xc8f4('0x34')](_0x2e9a2a,{'showHidden':![],'depth':null}));_0x599de3();});}else{_0x599de3();}})[_0xc8f4('0x35')](function(){_0x599de3();});}else{_0x599de3();}}},'charset':'utf8mb4','collate':_0xc8f4('0x36')});}; \ No newline at end of file +var _0x5f66=['catch','error','secret','CmContact','describe','OpenchannelAccount','find','Interactions','keys','replyUri','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','length','Interaction','Contact','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','FULLTEXT','models','get','toLowerCase','out','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','direction'];(function(_0x4600f3,_0x343fec){var _0x35767f=function(_0x21daae){while(--_0x21daae){_0x4600f3['push'](_0x4600f3['shift']());}};_0x35767f(++_0x343fec);}(_0x5f66,0x1a0));var _0x65f6=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5f66[_0x502c7d];return _0x30b7ed;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var logger=require('../../config/logger')(_0x65f6('0x1'));var moment=require(_0x65f6('0x2'));var BPromise=require(_0x65f6('0x3'));var rp=require(_0x65f6('0x4'));var fs=require('fs');var path=require(_0x65f6('0x5'));var rimraf=require('rimraf');var config=require(_0x65f6('0x6'));var attributes=require('./openchannelMessage.attributes');module[_0x65f6('0x7')]=function(_0x22b017,_0x4ec221){return _0x22b017['define'](_0x65f6('0x8'),attributes,{'tableName':_0x65f6('0x9'),'paranoid':![],'indexes':[{'name':_0x65f6('0xa'),'fields':[_0x65f6('0xb')],'type':_0x65f6('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14f4c7,_0x48d85c,_0x5123ee){var _0x18fea1=_0x22b017[_0x65f6('0xd')];var _0x264647=_0x14f4c7[_0x65f6('0xe')]({'plain':!![]});if(_0x264647['direction'][_0x65f6('0xf')]()==='in'||_0x264647['direction']['toLowerCase']()===_0x65f6('0x10')&&!_0x264647['secret']&&!_[_0x65f6('0x11')](_0x264647['UserId'])){_0x18fea1[_0x65f6('0x12')][_0x65f6('0x13')]({'where':{'id':_0x264647[_0x65f6('0x14')]}})[_0x65f6('0x15')](function(_0x369f96){if(_0x369f96){_0x369f96[_0x65f6('0x16')]({'lastMsgAt':_0x264647[_0x65f6('0x17')],'lastMsgDirection':_0x264647[_0x65f6('0x18')][_0x65f6('0xf')]()});}})[_0x65f6('0x19')](function(_0x59154e){console[_0x65f6('0x1a')](_0x59154e);});}if(_0x264647['direction']==='out'&&!_0x264647[_0x65f6('0x1b')]){var _0x5c69f8;_0x18fea1[_0x65f6('0x1c')][_0x65f6('0x1d')]()[_0x65f6('0x15')](function(_0x1f974c){return _0x18fea1[_0x65f6('0x1e')][_0x65f6('0x1f')]({'where':{'id':_0x264647['OpenchannelAccountId']},'include':[{'model':_0x18fea1['OpenchannelInteraction'],'as':_0x65f6('0x20'),'where':{'id':_0x264647['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x18fea1['CmContact'],'as':'Contact','attributes':_[_0x65f6('0x21')](_0x1f974c)}]}]});})[_0x65f6('0x15')](function(_0x5114a4){_0x5c69f8=_0x5114a4[_0x65f6('0xe')]({'plain':!![]});if(_0x5c69f8&&_0x5c69f8[_0x65f6('0x22')]){logger[_0x65f6('0x23')](_0x65f6('0x24'),_0x65f6('0x25'),util[_0x65f6('0x26')]('Forwarding\x20message\x20%d\x20to\x20%s',_0x264647['id'],_0x5c69f8[_0x65f6('0x22')]));if(_0x5c69f8['Interactions']&&_0x5c69f8['Interactions'][_0x65f6('0x27')]){_0x264647[_0x65f6('0x28')]=_['omit'](_0x5c69f8[_0x65f6('0x20')][0x0],_0x65f6('0x29'));_0x264647[_0x65f6('0x29')]=_0x5c69f8[_0x65f6('0x20')][0x0]['Contact'];}var _0x48d85c={'method':_0x65f6('0x2a'),'uri':encodeURI(_0x5c69f8[_0x65f6('0x22')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x48d85c['method']){case'GET':_0x48d85c['qs']=_0x264647;break;case'POST':_0x48d85c[_0x65f6('0xb')]=_0x264647;break;}return rp(_0x48d85c)[_0x65f6('0x15')](function(_0x4b2292){logger[_0x65f6('0x23')](_0x65f6('0x24'),'afterCreate',util[_0x65f6('0x26')](_0x65f6('0x2b'),_0x264647['id'],_0x5c69f8[_0x65f6('0x22')]));if(_0x4b2292['body']['threadId']&&_0x4b2292['body'][_0x65f6('0x2c')]!=_0x264647[_0x65f6('0x28')][_0x65f6('0x2c')]){return _0x18fea1[_0x65f6('0x12')][_0x65f6('0x16')]({'threadId':_0x4b2292[_0x65f6('0xb')][_0x65f6('0x2c')]},{'logging':!![],'where':{'id':_0x264647['Interaction']['id']}});}else{return;}})['then'](function(){return _0x14f4c7[_0x65f6('0x16')]({'read':!![]});})[_0x65f6('0x19')](function(_0x5878bc){logger['error'](_0x65f6('0x24'),_0x65f6('0x25'),util[_0x65f6('0x2d')](_0x5878bc,{'showHidden':![],'depth':null}));_0x5123ee();});}else{_0x5123ee();}})[_0x65f6('0x2e')](function(){_0x5123ee();});}else{_0x5123ee();}}},'charset':_0x65f6('0x2f'),'collate':_0x65f6('0x30')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 98cfd5d..9a3c344 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x5c5652,_0x28003b){var _0x4e9e12=function(_0xa2c4d5){while(--_0xa2c4d5){_0x5c5652['push'](_0x5c5652['shift']());}};_0x4e9e12(++_0x28003b);}(_0x7a54,0x106));var _0x47a5=function(_0x2b0fd0,_0x272c1d){_0x2b0fd0=_0x2b0fd0-0x0;var _0x3360f5=_0x7a54[_0x2b0fd0];return _0x3360f5;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x2ef3=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','code','error','message','result','catch','CreateOpenchannelMessage','create','options','info'];(function(_0x12f08d,_0x5f13b3){var _0x3a49cd=function(_0x39c753){while(--_0x39c753){_0x12f08d['push'](_0x12f08d['shift']());}};_0x3a49cd(++_0x5f13b3);}(_0x2ef3,0xba));var _0x32ef=function(_0x51fdb6,_0x3fa9aa){_0x51fdb6=_0x51fdb6-0x0;var _0x4793fd=_0x2ef3[_0x51fdb6];return _0x4793fd;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x32ef('0xa')]=_[_0x32ef('0xb')](config[_0x32ef('0xa')],{'host':_0x32ef('0xc'),'port':0x18eb});var socket=require(_0x32ef('0xd'))(new Redis(config[_0x32ef('0xa')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);function respondWithRpcPromise(_0x28275c,_0x77df79,_0x56eb42){return new BPromise(function(_0x5780e9,_0x401d0b){return client[_0x32ef('0x10')](_0x28275c,_0x56eb42)[_0x32ef('0x11')](function(_0x1499c2){logger['info'](_0x32ef('0x12'),_0x77df79,'request\x20sent');logger[_0x32ef('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x77df79,_0x32ef('0x14'),JSON[_0x32ef('0x15')](_0x1499c2));if(_0x1499c2['error']){if(_0x1499c2['error'][_0x32ef('0x16')]===0x1f4){logger['error'](_0x32ef('0x12'),_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x401d0b(_0x1499c2[_0x32ef('0x17')]['message']);}logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x77df79,_0x1499c2[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5780e9(_0x1499c2[_0x32ef('0x17')]['message']);}else{logger['info'](_0x32ef('0x12'),_0x77df79,_0x32ef('0x14'));_0x5780e9(_0x1499c2[_0x32ef('0x19')]['message']);}})[_0x32ef('0x1a')](function(_0x33e230){logger['error'](_0x32ef('0x12'),_0x77df79,_0x33e230);_0x401d0b(_0x33e230);});});}exports[_0x32ef('0x1b')]=function(_0x26aff3){var _0x251084=this;return new Promise(function(_0x445cda,_0x3aec05){return db['OpenchannelMessage'][_0x32ef('0x1c')](_0x26aff3['body'],{'raw':_0x26aff3[_0x32ef('0x1d')]?_0x26aff3[_0x32ef('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x32ef('0x11')](function(_0x97780){logger[_0x32ef('0x1e')]('CreateOpenchannelMessage',_0x26aff3);logger['debug'](_0x32ef('0x1b'),_0x26aff3,JSON[_0x32ef('0x15')](_0x97780));_0x445cda(_0x97780);})[_0x32ef('0x1a')](function(_0x478bef){logger['error'](_0x32ef('0x1b'),_0x478bef['message'],_0x26aff3);_0x3aec05(_0x251084['error'](0x1f4,_0x478bef[_0x32ef('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index ebe3aa5..0b118a9 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 _0xd101=['emit','register','length','openchannelMessage:','./openchannelMessage.events','remove','update'];(function(_0x37bd26,_0x5ad346){var _0xe83dc4=function(_0x1ac229){while(--_0x1ac229){_0x37bd26['push'](_0x37bd26['shift']());}};_0xe83dc4(++_0x5ad346);}(_0xd101,0xc1));var _0x1d10=function(_0x1a58a6,_0x540697){_0x1a58a6=_0x1a58a6-0x0;var _0x4136cd=_0xd101[_0x1a58a6];return _0x4136cd;};'use strict';var OpenchannelMessageEvents=require(_0x1d10('0x0'));var events=['save',_0x1d10('0x1'),_0x1d10('0x2')];function createListener(_0x1142f8,_0x21b32e){return function(_0xaa1d24){_0x21b32e[_0x1d10('0x3')](_0x1142f8,_0xaa1d24);};}function removeListener(_0x12c320,_0x1e83e0){return function(){OpenchannelMessageEvents['removeListener'](_0x12c320,_0x1e83e0);};}exports[_0x1d10('0x4')]=function(_0x203072){for(var _0x2a4e2d=0x0,_0x27d569=events[_0x1d10('0x5')];_0x2a4e2d<_0x27d569;_0x2a4e2d++){var _0x36335e=events[_0x2a4e2d];var _0x6d6def=createListener(_0x1d10('0x6')+_0x36335e,_0x203072);OpenchannelMessageEvents['on'](_0x36335e,_0x6d6def);}}; \ No newline at end of file +var _0x1d8d=['remove','update','emit','removeListener','register','length','openchannelMessage:','./openchannelMessage.events'];(function(_0x44fb32,_0x59986a){var _0x4cf312=function(_0x456f8d){while(--_0x456f8d){_0x44fb32['push'](_0x44fb32['shift']());}};_0x4cf312(++_0x59986a);}(_0x1d8d,0x1e7));var _0xd1d8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d8d[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelMessageEvents=require(_0xd1d8('0x0'));var events=['save',_0xd1d8('0x1'),_0xd1d8('0x2')];function createListener(_0x19b1c5,_0xf25258){return function(_0x5adb7b){_0xf25258[_0xd1d8('0x3')](_0x19b1c5,_0x5adb7b);};}function removeListener(_0x5922f5,_0x1e47ef){return function(){OpenchannelMessageEvents[_0xd1d8('0x4')](_0x5922f5,_0x1e47ef);};}exports[_0xd1d8('0x5')]=function(_0x4e5ce3){for(var _0x3402cd=0x0,_0x373664=events[_0xd1d8('0x6')];_0x3402cd<_0x373664;_0x3402cd++){var _0x4278d1=events[_0x3402cd];var _0x2339fa=createListener(_0xd1d8('0x7')+_0x4278d1,_0x4e5ce3);OpenchannelMessageEvents['on'](_0x4278d1,_0x2339fa);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 473eacf..e69b64d 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 _0x0078=['addAgents','update','delete','destroy','/:id/users','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','getAgents','post','/:id/teams'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x0078,0xe7));var _0x8007=function(_0x46b7c6,_0x8284d5){_0x46b7c6=_0x46b7c6-0x0;var _0x4f0eae=_0x0078[_0x46b7c6];return _0x4f0eae;};'use strict';var multer=require('multer');var util=require(_0x8007('0x0'));var path=require(_0x8007('0x1'));var timeout=require(_0x8007('0x2'));var express=require(_0x8007('0x3'));var router=express[_0x8007('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x8007('0x5'));var interaction=require(_0x8007('0x6'));var config=require(_0x8007('0x7'));var controller=require(_0x8007('0x8'));router[_0x8007('0x9')]('/',auth[_0x8007('0xa')](),controller[_0x8007('0xb')]);router[_0x8007('0x9')](_0x8007('0xc'),auth[_0x8007('0xa')](),controller[_0x8007('0xd')]);router['get'](_0x8007('0xe'),auth[_0x8007('0xa')](),controller[_0x8007('0xf')]);router[_0x8007('0x9')](_0x8007('0x10'),auth['isAuthenticated'](),controller[_0x8007('0x11')]);router[_0x8007('0x9')]('/:id/teams',auth[_0x8007('0xa')](),controller['getTeams']);router['get']('/:id/users',auth[_0x8007('0xa')](),controller[_0x8007('0x12')]);router['post']('/',auth[_0x8007('0xa')](),controller['create']);router[_0x8007('0x13')](_0x8007('0x14'),auth[_0x8007('0xa')](),controller['addTeams']);router[_0x8007('0x13')]('/:id/users',auth[_0x8007('0xa')](),controller[_0x8007('0x15')]);router['put'](_0x8007('0xe'),auth[_0x8007('0xa')](),controller[_0x8007('0x16')]);router[_0x8007('0x17')](_0x8007('0xe'),auth['isAuthenticated'](),controller[_0x8007('0x18')]);router['delete'](_0x8007('0x14'),auth[_0x8007('0xa')](),controller['removeTeams']);router['delete'](_0x8007('0x19'),auth[_0x8007('0xa')](),controller[_0x8007('0x1a')]);module[_0x8007('0x1b')]=router; \ No newline at end of file +var _0xa7fd=['/:id/users','post','create','addTeams','addAgents','put','/:id','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','getMembers','/:id/teams'];(function(_0x332379,_0x3575eb){var _0xf79c60=function(_0x247329){while(--_0x247329){_0x332379['push'](_0x332379['shift']());}};_0xf79c60(++_0x3575eb);}(_0xa7fd,0x11b));var _0xda7f=function(_0x398689,_0x498702){_0x398689=_0x398689-0x0;var _0x1e9bae=_0xa7fd[_0x398689];return _0x1e9bae;};'use strict';var multer=require(_0xda7f('0x0'));var util=require('util');var path=require(_0xda7f('0x1'));var timeout=require('connect-timeout');var express=require(_0xda7f('0x2'));var router=express[_0xda7f('0x3')]();var fs_extra=require(_0xda7f('0x4'));var auth=require(_0xda7f('0x5'));var interaction=require(_0xda7f('0x6'));var config=require('../../config/environment');var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0xda7f('0x7')](),controller[_0xda7f('0x8')]);router['get'](_0xda7f('0x9'),auth[_0xda7f('0x7')](),controller[_0xda7f('0xa')]);router[_0xda7f('0xb')]('/:id',auth[_0xda7f('0x7')](),controller['show']);router[_0xda7f('0xb')]('/:id/members',auth['isAuthenticated'](),controller[_0xda7f('0xc')]);router[_0xda7f('0xb')](_0xda7f('0xd'),auth[_0xda7f('0x7')](),controller['getTeams']);router[_0xda7f('0xb')](_0xda7f('0xe'),auth['isAuthenticated'](),controller['getAgents']);router[_0xda7f('0xf')]('/',auth[_0xda7f('0x7')](),controller[_0xda7f('0x10')]);router['post']('/:id/teams',auth[_0xda7f('0x7')](),controller[_0xda7f('0x11')]);router[_0xda7f('0xf')]('/:id/users',auth[_0xda7f('0x7')](),controller[_0xda7f('0x12')]);router[_0xda7f('0x13')](_0xda7f('0x14'),auth[_0xda7f('0x7')](),controller[_0xda7f('0x15')]);router[_0xda7f('0x16')](_0xda7f('0x14'),auth[_0xda7f('0x7')](),controller[_0xda7f('0x17')]);router[_0xda7f('0x16')](_0xda7f('0xd'),auth['isAuthenticated'](),controller[_0xda7f('0x18')]);router[_0xda7f('0x16')](_0xda7f('0xe'),auth[_0xda7f('0x7')](),controller[_0xda7f('0x19')]);module[_0xda7f('0x1a')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index aece4a5..d4ce063 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 _0xb0f1=['sequelize','STRING','name','ENUM','rrmemory','beepall'];(function(_0x1745b5,_0x139804){var _0x284a1b=function(_0x5e9a19){while(--_0x5e9a19){_0x1745b5['push'](_0x1745b5['shift']());}};_0x284a1b(++_0x139804);}(_0xb0f1,0x90));var _0x1b0f=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xb0f1[_0x52085a];return _0x5afc1a;};'use strict';var Sequelize=require(_0x1b0f('0x0'));module['exports']={'name':{'type':Sequelize[_0x1b0f('0x1')],'unique':_0x1b0f('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1b0f('0x3')](_0x1b0f('0x4'),_0x1b0f('0x5'),'roundrobin')}}; \ No newline at end of file +var _0xa885=['beepall','roundrobin','sequelize','exports','STRING','rrmemory'];(function(_0x4db728,_0x461849){var _0x3ca8dd=function(_0xd11433){while(--_0xd11433){_0x4db728['push'](_0x4db728['shift']());}};_0x3ca8dd(++_0x461849);}(_0xa885,0x1ee));var _0x5a88=function(_0x13ad56,_0x7868be){_0x13ad56=_0x13ad56-0x0;var _0x280727=_0xa885[_0x13ad56];return _0x280727;};'use strict';var Sequelize=require(_0x5a88('0x0'));module[_0x5a88('0x1')]={'name':{'type':Sequelize[_0x5a88('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x5a88('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x5a88('0x3'),_0x5a88('0x4'),_0x5a88('0x5'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 5419b9d..e6f9191 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 _0xd503=['params','keys','fields','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','OpenchannelQueues','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','rawAttributes','hasOwnProperty','OpenchannelQueueId','options','UserOpenchannelQueue','User','findAndCountAll','UserId','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','Agents','online','voicePause','interface','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?','toString','QueryTypes','every','includes','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','register','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','OpenchannelQueue','fieldName','type','key','model','map','filters','intersection','query','attributes','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xd503,0x168));var _0x3d50=function(_0x3d987b,_0x10d309){_0x3d987b=_0x3d987b-0x0;var _0x3c53b6=_0xd503[_0x3d987b];return _0x3c53b6;};'use strict';var emlformat=require(_0x3d50('0x0'));var rimraf=require(_0x3d50('0x1'));var zipdir=require(_0x3d50('0x2'));var jsonpatch=require(_0x3d50('0x3'));var rp=require(_0x3d50('0x4'));var moment=require(_0x3d50('0x5'));var BPromise=require(_0x3d50('0x6'));var Mustache=require(_0x3d50('0x7'));var util=require('util');var path=require(_0x3d50('0x8'));var sox=require(_0x3d50('0x9'));var csv=require('to-csv');var ejs=require(_0x3d50('0xa'));var fs=require('fs');var fs_extra=require(_0x3d50('0xb'));var _=require(_0x3d50('0xc'));var squel=require(_0x3d50('0xd'));var crypto=require(_0x3d50('0xe'));var jsforce=require(_0x3d50('0xf'));var deskjs=require(_0x3d50('0x10'));var toCsv=require('to-csv');var querystring=require(_0x3d50('0x11'));var Papa=require(_0x3d50('0x12'));var Redis=require(_0x3d50('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3d50('0x14'));var hardwareService=require(_0x3d50('0x15'));var logger=require(_0x3d50('0x16'))(_0x3d50('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3d50('0x18'));var db=require(_0x3d50('0x19'))['db'];config[_0x3d50('0x1a')]=_[_0x3d50('0x1b')](config[_0x3d50('0x1a')],{'host':_0x3d50('0x1c'),'port':0x18eb});var socket=require(_0x3d50('0x1d'))(new Redis(config[_0x3d50('0x1a')]));require(_0x3d50('0x1e'))[_0x3d50('0x1f')](socket);function respondWithStatusCode(_0x53fb9a,_0x348b43){_0x348b43=_0x348b43||0xcc;return function(_0x58c594){if(_0x58c594){return _0x53fb9a['sendStatus'](_0x348b43);}return _0x53fb9a[_0x3d50('0x20')](_0x348b43)[_0x3d50('0x21')]();};}function respondWithResult(_0x5a78d2,_0x27dfc1){_0x27dfc1=_0x27dfc1||0xc8;return function(_0x2d23e1){if(_0x2d23e1){return _0x5a78d2['status'](_0x27dfc1)[_0x3d50('0x22')](_0x2d23e1);}};}function respondWithFilteredResult(_0x1bb56b,_0x3c68da){return function(_0x21601c){if(_0x21601c){var _0x23f0e9=typeof _0x3c68da['offset']===_0x3d50('0x23')&&typeof _0x3c68da[_0x3d50('0x24')]===_0x3d50('0x23');var _0x313263=_0x21601c[_0x3d50('0x25')];var _0x5f155b=_0x23f0e9?0x0:_0x3c68da[_0x3d50('0x26')];var _0x2c99d4=_0x23f0e9?_0x21601c[_0x3d50('0x25')]:_0x3c68da['offset']+_0x3c68da[_0x3d50('0x24')];var _0x457ef1;if(_0x2c99d4>=_0x313263){_0x2c99d4=_0x313263;_0x457ef1=0xc8;}else{_0x457ef1=0xce;}_0x1bb56b[_0x3d50('0x20')](_0x457ef1);return _0x1bb56b[_0x3d50('0x27')](_0x3d50('0x28'),_0x5f155b+'-'+_0x2c99d4+'/'+_0x313263)[_0x3d50('0x22')](_0x21601c);}return null;};}function patchUpdates(_0x1d4a42){return function(_0x4637fc){try{jsonpatch[_0x3d50('0x29')](_0x4637fc,_0x1d4a42,!![]);}catch(_0x1f8118){return BPromise[_0x3d50('0x2a')](_0x1f8118);}return _0x4637fc['save']();};}function saveUpdates(_0x1acfee,_0x5dbed0){return function(_0x27847a){if(_0x27847a){return _0x27847a['update'](_0x1acfee)[_0x3d50('0x2b')](function(_0x57d7f3){return _0x57d7f3;});}return null;};}function removeEntity(_0x8d1e07,_0x659489){return function(_0x518aed){if(_0x518aed){return _0x518aed['destroy']()[_0x3d50('0x2b')](function(){var _0x517007=_0x518aed[_0x3d50('0x2c')]({'plain':!![]});var _0x1be3ea='OpenchannelQueues';return db[_0x3d50('0x2d')][_0x3d50('0x2e')]({'where':{'type':_0x1be3ea,'resourceId':_0x517007['id']}})[_0x3d50('0x2b')](function(){return _0x518aed;});})[_0x3d50('0x2b')](function(){_0x8d1e07[_0x3d50('0x20')](0xcc)[_0x3d50('0x21')]();});}};}function handleEntityNotFound(_0x1c812d,_0x130b5f){return function(_0x34b8b4){if(!_0x34b8b4){_0x1c812d[_0x3d50('0x2f')](0x194);}return _0x34b8b4;};}function handleError(_0x17d511,_0x5487dd){_0x5487dd=_0x5487dd||0x1f4;return function(_0x170cdc){logger[_0x3d50('0x30')](_0x170cdc[_0x3d50('0x31')]);if(_0x170cdc[_0x3d50('0x32')]){delete _0x170cdc[_0x3d50('0x32')];}_0x17d511['status'](_0x5487dd)[_0x3d50('0x33')](_0x170cdc);};}exports[_0x3d50('0x34')]=function(_0x13eafa,_0x5e32e0){var _0x5897be={},_0x2a7d7a={},_0x5f31ce={'count':0x0,'rows':[]};var _0x166d7e=_['map'](db[_0x3d50('0x35')]['rawAttributes'],function(_0x42b9be){return{'name':_0x42b9be[_0x3d50('0x36')],'type':_0x42b9be[_0x3d50('0x37')][_0x3d50('0x38')]};});_0x2a7d7a[_0x3d50('0x39')]=_[_0x3d50('0x3a')](_0x166d7e,_0x3d50('0x32'));_0x2a7d7a['query']=_['keys'](_0x13eafa['query']);_0x2a7d7a[_0x3d50('0x3b')]=_[_0x3d50('0x3c')](_0x2a7d7a['model'],_0x2a7d7a[_0x3d50('0x3d')]);_0x5897be[_0x3d50('0x3e')]=_['intersection'](_0x2a7d7a[_0x3d50('0x39')],qs['fields'](_0x13eafa[_0x3d50('0x3d')]['fields']));_0x5897be[_0x3d50('0x3e')]=_0x5897be['attributes'][_0x3d50('0x3f')]?_0x5897be[_0x3d50('0x3e')]:_0x2a7d7a[_0x3d50('0x39')];if(!_0x13eafa[_0x3d50('0x3d')]['hasOwnProperty'](_0x3d50('0x40'))){_0x5897be[_0x3d50('0x24')]=qs[_0x3d50('0x24')](_0x13eafa[_0x3d50('0x3d')][_0x3d50('0x24')]);_0x5897be['offset']=qs[_0x3d50('0x26')](_0x13eafa['query']['offset']);}_0x5897be[_0x3d50('0x41')]=qs[_0x3d50('0x42')](_0x13eafa[_0x3d50('0x3d')][_0x3d50('0x42')]);_0x5897be['where']=qs['filters'](_[_0x3d50('0x43')](_0x13eafa['query'],_0x2a7d7a['filters']),_0x166d7e);if(_0x13eafa['query'][_0x3d50('0x44')]){_0x5897be[_0x3d50('0x45')]=_[_0x3d50('0x46')](_0x5897be['where'],{'$or':_[_0x3d50('0x3a')](_0x166d7e,function(_0x196118){if(_0x196118[_0x3d50('0x37')]!==_0x3d50('0x47')){var _0x471598={};_0x471598[_0x196118[_0x3d50('0x32')]]={'$like':'%'+_0x13eafa['query'][_0x3d50('0x44')]+'%'};return _0x471598;}})});}_0x5897be=_['merge']({},_0x5897be,_0x13eafa['options']);var _0xf0bd78={'where':_0x5897be[_0x3d50('0x45')]};return db[_0x3d50('0x35')]['count'](_0xf0bd78)[_0x3d50('0x2b')](function(_0x36e1d3){_0x5f31ce[_0x3d50('0x25')]=_0x36e1d3;if(_0x13eafa['query'][_0x3d50('0x48')]){_0x5897be[_0x3d50('0x49')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x3d50('0x4a')](_0x5897be);})['then'](function(_0x4d3530){_0x5f31ce[_0x3d50('0x4b')]=_0x4d3530;return _0x5f31ce;})['then'](respondWithFilteredResult(_0x5e32e0,_0x5897be))[_0x3d50('0x4c')](handleError(_0x5e32e0,null));};exports[_0x3d50('0x4d')]=function(_0x25cdfe,_0x3b7db4){var _0x53d124={'raw':!![],'where':{'id':_0x25cdfe[_0x3d50('0x4e')]['id']}},_0x54cac8={};_0x54cac8[_0x3d50('0x39')]=_[_0x3d50('0x4f')](db['OpenchannelQueue']['rawAttributes']);_0x54cac8['query']=_[_0x3d50('0x4f')](_0x25cdfe[_0x3d50('0x3d')]);_0x54cac8[_0x3d50('0x3b')]=_[_0x3d50('0x3c')](_0x54cac8['model'],_0x54cac8[_0x3d50('0x3d')]);_0x53d124[_0x3d50('0x3e')]=_[_0x3d50('0x3c')](_0x54cac8['model'],qs[_0x3d50('0x50')](_0x25cdfe['query'][_0x3d50('0x50')]));_0x53d124[_0x3d50('0x3e')]=_0x53d124[_0x3d50('0x3e')][_0x3d50('0x3f')]?_0x53d124[_0x3d50('0x3e')]:_0x54cac8['model'];if(_0x25cdfe[_0x3d50('0x3d')]['includeAll']){_0x53d124['include']=[{'all':!![]}];}_0x53d124=_[_0x3d50('0x46')]({},_0x53d124,_0x25cdfe['options']);return db[_0x3d50('0x35')][_0x3d50('0x51')](_0x53d124)['then'](handleEntityNotFound(_0x3b7db4,null))[_0x3d50('0x2b')](respondWithResult(_0x3b7db4,null))[_0x3d50('0x4c')](handleError(_0x3b7db4,null));};exports['create']=function(_0xf763a3,_0x2a7cde){return db[_0x3d50('0x35')]['create'](_0xf763a3[_0x3d50('0x52')],{})[_0x3d50('0x2b')](function(_0x24e6bb){var _0x17d9e5=_0xf763a3[_0x3d50('0x53')][_0x3d50('0x2c')]({'plain':!![]});if(!_0x17d9e5)throw new Error(_0x3d50('0x54'));if(_0x17d9e5['role']===_0x3d50('0x53')){var _0x3595ef=_0x24e6bb[_0x3d50('0x2c')]({'plain':!![]});var _0x9972e2=_0x3d50('0x55');return db['UserProfileSection'][_0x3d50('0x51')]({'where':{'name':_0x9972e2,'userProfileId':_0x17d9e5['userProfileId']},'raw':!![]})[_0x3d50('0x2b')](function(_0xea94ce){if(_0xea94ce&&_0xea94ce['autoAssociation']===0x0){return db['UserProfileResource'][_0x3d50('0x56')]({'name':_0x3595ef[_0x3d50('0x32')],'resourceId':_0x3595ef['id'],'type':_0xea94ce[_0x3d50('0x32')],'sectionId':_0xea94ce['id']},{})[_0x3d50('0x2b')](function(){return _0x24e6bb;});}else{return _0x24e6bb;}})[_0x3d50('0x4c')](function(_0x299027){logger['error'](_0x3d50('0x57'),_0x299027);throw _0x299027;});}return _0x24e6bb;})[_0x3d50('0x2b')](respondWithResult(_0x2a7cde,0xc9))[_0x3d50('0x4c')](handleError(_0x2a7cde,null));};exports[_0x3d50('0x58')]=function(_0x4241f2,_0x4253bd){if(_0x4241f2[_0x3d50('0x52')]['id']){delete _0x4241f2[_0x3d50('0x52')]['id'];}return db[_0x3d50('0x35')][_0x3d50('0x51')]({'where':{'id':_0x4241f2[_0x3d50('0x4e')]['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x4253bd,null))[_0x3d50('0x2b')](saveUpdates(_0x4241f2[_0x3d50('0x52')],null))[_0x3d50('0x2b')](respondWithResult(_0x4253bd,null))['catch'](handleError(_0x4253bd,null));};exports[_0x3d50('0x2e')]=function(_0x56cef6,_0x1c4278){return db['OpenchannelQueue']['find']({'where':{'id':_0x56cef6['params']['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x1c4278,null))[_0x3d50('0x2b')](removeEntity(_0x1c4278,null))[_0x3d50('0x4c')](handleError(_0x1c4278,null));};exports[_0x3d50('0x59')]=function(_0x33e374,_0x10e2f9){return db['OpenchannelQueue'][_0x3d50('0x59')]()[_0x3d50('0x2b')](respondWithResult(_0x10e2f9,null))[_0x3d50('0x4c')](handleError(_0x10e2f9,null));};exports[_0x3d50('0x5a')]=function(_0x554559,_0x55116b,_0xc0a8f9){var _0x366593={'raw':!![],'where':{}},_0x22f1c5={},_0x4e756a;return db[_0x3d50('0x35')][_0x3d50('0x5b')]({'where':{'id':_0x554559[_0x3d50('0x4e')]['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x55116b,null))[_0x3d50('0x2b')](function(_0x231b3e){if(_0x231b3e){_0x4e756a=_0x231b3e[_0x3d50('0x2c')]({'plain':!![]});_0x22f1c5[_0x3d50('0x39')]=_['keys'](db['UserOpenchannelQueue'][_0x3d50('0x5c')]);_0x22f1c5[_0x3d50('0x3d')]=_[_0x3d50('0x4f')](_0x554559[_0x3d50('0x3d')]);_0x22f1c5[_0x3d50('0x3b')]=_[_0x3d50('0x3c')](_0x22f1c5[_0x3d50('0x39')],_0x22f1c5[_0x3d50('0x3d')]);_0x366593['attributes']=_[_0x3d50('0x3c')](_0x22f1c5[_0x3d50('0x39')],qs['fields'](_0x554559['query'][_0x3d50('0x50')]));_0x366593[_0x3d50('0x3e')]=_0x366593[_0x3d50('0x3e')][_0x3d50('0x3f')]?_0x366593[_0x3d50('0x3e')]:_0x22f1c5[_0x3d50('0x39')];if(!_0x554559[_0x3d50('0x3d')][_0x3d50('0x5d')](_0x3d50('0x40'))){_0x366593['limit']=qs['limit'](_0x554559[_0x3d50('0x3d')][_0x3d50('0x24')]);_0x366593[_0x3d50('0x26')]=qs['offset'](_0x554559['query']['offset']);}_0x366593[_0x3d50('0x41')]=qs[_0x3d50('0x42')](_0x554559['query']['sort']);_0x366593[_0x3d50('0x45')]=qs[_0x3d50('0x3b')](_[_0x3d50('0x43')](_0x554559[_0x3d50('0x3d')],_0x22f1c5[_0x3d50('0x3b')]));_0x366593[_0x3d50('0x45')][_0x3d50('0x5e')]=_0x231b3e['id'];if(_0x554559[_0x3d50('0x3d')][_0x3d50('0x44')]){_0x366593[_0x3d50('0x45')]=_[_0x3d50('0x46')](_0x366593['where'],{'$or':_[_0x3d50('0x3a')](_0x366593['attributes'],function(_0x44bf0f){var _0x468448={};_0x468448[_0x44bf0f]={'$like':'%'+_0x554559[_0x3d50('0x3d')][_0x3d50('0x44')]+'%'};return _0x468448;})});}_0x366593=_[_0x3d50('0x46')]({},_0x366593,_0x554559[_0x3d50('0x5f')]);return db[_0x3d50('0x60')][_0x3d50('0x4a')](_0x366593);}})[_0x3d50('0x2b')](function(_0xd251d3){if(_0xd251d3){return db[_0x3d50('0x61')][_0x3d50('0x62')]({'where':{'id':_[_0x3d50('0x3a')](_0xd251d3,_0x3d50('0x63')),'role':'agent'},'attributes':['id',_0x3d50('0x32'),_0x3d50('0x64'),_0x3d50('0x65'),_0x3d50('0x66')]});}})[_0x3d50('0x2b')](function(_0x173a9c){if(_0x173a9c){return{'count':_0x173a9c[_0x3d50('0x25')],'rows':_['map'](_0x173a9c[_0x3d50('0x4b')],function(_0x208029){return{'membername':_0x208029[_0x3d50('0x32')],'UserId':_0x208029['id'],'queue_name':_0x4e756a[_0x3d50('0x32')],'OpenchannelQueueId':_0x4e756a['id'],'interface':util[_0x3d50('0x67')](_0x3d50('0x68'),_0x3d50('0x69'),_0x208029[_0x3d50('0x32')]),'penalty':0x0,'paused':_0x208029[_0x3d50('0x64')],'createdAt':_0x208029[_0x3d50('0x66')],'updatedAt':_0x208029[_0x3d50('0x65')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x55116b,_0x366593))[_0x3d50('0x4c')](handleError(_0x55116b,null));};exports[_0x3d50('0x6a')]=function(_0x2d7baf,_0x39834d,_0x3ee30f){var _0x1ab83d={};var _0x2ce239={};var _0x219c6b;var _0x23b26e;return db['OpenchannelQueue'][_0x3d50('0x5b')]({'where':{'id':_0x2d7baf['params']['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x39834d,null))[_0x3d50('0x2b')](function(_0x49885d){if(_0x49885d){_0x219c6b=_0x49885d;_0x2ce239[_0x3d50('0x39')]=_[_0x3d50('0x4f')](db['Team'][_0x3d50('0x5c')]);_0x2ce239['query']=_[_0x3d50('0x4f')](_0x2d7baf[_0x3d50('0x3d')]);_0x2ce239[_0x3d50('0x3b')]=_['intersection'](_0x2ce239[_0x3d50('0x39')],_0x2ce239[_0x3d50('0x3d')]);_0x1ab83d['attributes']=_['intersection'](_0x2ce239['model'],qs[_0x3d50('0x50')](_0x2d7baf[_0x3d50('0x3d')][_0x3d50('0x50')]));_0x1ab83d[_0x3d50('0x3e')]=_0x1ab83d[_0x3d50('0x3e')][_0x3d50('0x3f')]?_0x1ab83d['attributes']:_0x2ce239[_0x3d50('0x39')];_0x1ab83d[_0x3d50('0x41')]=qs[_0x3d50('0x42')](_0x2d7baf[_0x3d50('0x3d')][_0x3d50('0x42')]);_0x1ab83d[_0x3d50('0x45')]=qs[_0x3d50('0x3b')](_[_0x3d50('0x43')](_0x2d7baf[_0x3d50('0x3d')],_0x2ce239[_0x3d50('0x3b')]));if(_0x2d7baf[_0x3d50('0x3d')][_0x3d50('0x44')]){_0x1ab83d[_0x3d50('0x45')]=_[_0x3d50('0x46')](_0x1ab83d[_0x3d50('0x45')],{'$or':_['map'](_0x1ab83d[_0x3d50('0x3e')],function(_0x3dbe94){var _0x3aa2ae={};_0x3aa2ae[_0x3dbe94]={'$like':'%'+_0x2d7baf['query'][_0x3d50('0x44')]+'%'};return _0x3aa2ae;})});}_0x1ab83d=_['merge']({},_0x1ab83d,_0x2d7baf[_0x3d50('0x5f')]);return _0x219c6b['getTeams'](_0x1ab83d);}})['then'](function(_0x3124f1){if(_0x3124f1){_0x23b26e=_0x3124f1[_0x3d50('0x3f')];if(!_0x2d7baf[_0x3d50('0x3d')][_0x3d50('0x5d')](_0x3d50('0x40'))){_0x1ab83d[_0x3d50('0x24')]=qs['limit'](_0x2d7baf[_0x3d50('0x3d')][_0x3d50('0x24')]);_0x1ab83d[_0x3d50('0x26')]=qs[_0x3d50('0x26')](_0x2d7baf[_0x3d50('0x3d')]['offset']);}return _0x219c6b[_0x3d50('0x6a')](_0x1ab83d);}})[_0x3d50('0x2b')](function(_0x5afd6e){if(_0x5afd6e){return _0x5afd6e?{'count':_0x23b26e,'rows':_0x5afd6e}:null;}})[_0x3d50('0x2b')](respondWithResult(_0x39834d,null))[_0x3d50('0x4c')](handleError(_0x39834d,null));};exports[_0x3d50('0x6b')]=function(_0x3812ed,_0xe8cf8e,_0x3d228f){var _0x4bce7d=_0x3812ed[_0x3d50('0x52')][_0x3d50('0x6c')];return db[_0x3d50('0x6d')][_0x3d50('0x4a')]({'where':{'id':_0x4bce7d},'attributes':['id'],'include':[{'model':db[_0x3d50('0x61')],'as':_0x3d50('0x6e'),'attributes':['id',_0x3d50('0x32'),_0x3d50('0x6f'),_0x3d50('0x70'),_0x3d50('0x71')],'raw':!![]}]})['then'](function(_0x3240ae){if(_0x3240ae){var _0x2c93ea=_['flatMap'](_0x3240ae,function(_0x1b9cce){var _0x25224e=_0x1b9cce[_0x3d50('0x2c')]({'plain':!![]});return _0x25224e[_0x3d50('0x6e')];});return db[_0x3d50('0x35')][_0x3d50('0x51')]({'where':{'id':_0x3812ed[_0x3d50('0x4e')]['id']}})['then'](function(_0x19dcf8){return db[_0x3d50('0x72')][_0x3d50('0x73')](function(_0x21113f){return _0x19dcf8[_0x3d50('0x6b')](_0x4bce7d,{'transaction':_0x21113f})[_0x3d50('0x2b')](function(){return BPromise[_0x3d50('0x74')](_0x2c93ea,function(_0x200885){return db[_0x3d50('0x60')][_0x3d50('0x75')]({'where':{'UserId':_0x200885['id'],'OpenchannelQueueId':_0x3812ed['params']['id']},'transaction':_0x21113f});});})[_0x3d50('0x2b')](function(){_0x2c93ea[_0x3d50('0x76')](function(_0x4a13db){socket[_0x3d50('0x77')](_0x3d50('0x78'),{'UserId':_0x4a13db['id'],'OpenchannelQueueId':_0x19dcf8['id']});});});});});}})[_0x3d50('0x2b')](respondWithStatusCode(_0xe8cf8e,null))['catch'](handleError(_0xe8cf8e,null));};exports[_0x3d50('0x79')]=function(_0x1809a0,_0x26f948,_0x39cd89){return db[_0x3d50('0x6d')]['findAll']({'where':{'id':_0x1809a0['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x3d50('0x61')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x3d50('0x2b')](handleEntityNotFound(_0x26f948,null))[_0x3d50('0x2b')](function(_0x49a65b){var _0x15100a=_[_0x3d50('0x3a')](_0x49a65b,'id');var _0x3427f1=[];var _0x1714ed=[];var _0x30215d=squel[_0x3d50('0x7a')]();_0x30215d[_0x3d50('0x7b')](_0x3d50('0x7c'))[_0x3d50('0x7d')](_0x3d50('0x7e'),'tq')[_0x3d50('0x7f')](_0x3d50('0x80'),'ut',_0x3d50('0x81'))[_0x3d50('0x45')](_0x3d50('0x82'),_0x1809a0[_0x3d50('0x4e')]['id']);for(var _0x3ffe0e=0x0;_0x3ffe0e<_0x49a65b[_0x3d50('0x3f')];_0x3ffe0e+=0x1){let _0x3ec63b=_0x49a65b[_0x3ffe0e];for(var _0x344d32=0x0;_0x344d32<_0x3ec63b[_0x3d50('0x6e')][_0x3d50('0x3f')];_0x344d32+=0x1){let _0x126b59=_0x3ec63b[_0x3d50('0x6e')][_0x344d32];var _0xb0ca62=_0x30215d[_0x3d50('0x83')]();_0xb0ca62['where'](_0x3d50('0x84'),_0x126b59['id']);_0x1714ed['push'](db[_0x3d50('0x72')][_0x3d50('0x3d')](_0xb0ca62[_0x3d50('0x85')](),{'type':db['sequelize'][_0x3d50('0x86')]['SELECT']})[_0x3d50('0x2b')](function(_0x9aea2c){if(_0x9aea2c['length']===0x1){return _0x126b59['id'];}else{var _0x5407a7=_[_0x3d50('0x87')](_['map'](_0x9aea2c,'TeamId'),function(_0x4c1e50){return _[_0x3d50('0x88')](_0x15100a,_0x4c1e50);});if(_0x5407a7){return _0x126b59['id'];}}}));}}return BPromise['all'](_0x1714ed)[_0x3d50('0x2b')](function(_0x1957a7){_0x3427f1=_(_0x3427f1)[_0x3d50('0x89')](_0x1957a7)[_0x3d50('0x8a')]()[_0x3d50('0x8b')]();return db[_0x3d50('0x35')][_0x3d50('0x51')]({'where':{'id':_0x1809a0[_0x3d50('0x4e')]['id']}})['then'](function(_0x1db2f4){return db[_0x3d50('0x72')]['transaction'](function(_0x4819a3){return _0x1db2f4[_0x3d50('0x79')](_0x1809a0[_0x3d50('0x3d')][_0x3d50('0x6c')],{'transaction':_0x4819a3})[_0x3d50('0x2b')](function(){if(!_['isEmpty'](_0x3427f1)){return _0x1db2f4[_0x3d50('0x8c')](_0x3427f1,{'transaction':_0x4819a3});}})[_0x3d50('0x2b')](function(){_0x3427f1[_0x3d50('0x76')](function(_0x1d6c38){socket[_0x3d50('0x77')](_0x3d50('0x8d'),{'UserId':_0x1d6c38,'OpenchannelQueueId':_0x1db2f4['id']});});});});});});})['then'](respondWithStatusCode(_0x26f948,null))[_0x3d50('0x4c')](handleError(_0x26f948,null));};exports[_0x3d50('0x8e')]=function(_0x518a37,_0x563746,_0x44e977){return db['OpenchannelQueue'][_0x3d50('0x51')]({'where':{'id':_0x518a37[_0x3d50('0x4e')]['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x563746,null))[_0x3d50('0x2b')](function(_0x488c1d){if(_0x488c1d){return _0x488c1d['addAgents'](_0x518a37['body']['ids'],_[_0x3d50('0x8f')](_0x518a37[_0x3d50('0x52')],[_0x3d50('0x6c'),'id'])||{})['spread'](function(_0x210649){for(var _0x103caf=0x0;_0x103caf<_0x518a37[_0x3d50('0x52')][_0x3d50('0x6c')]['length'];_0x103caf+=0x1){socket[_0x3d50('0x77')](_0x3d50('0x78'),{'UserId':Number(_0x518a37[_0x3d50('0x52')]['ids'][_0x103caf]),'OpenchannelQueueId':Number(_0x518a37[_0x3d50('0x4e')]['id'])});}return _0x210649;});}})[_0x3d50('0x2b')](respondWithResult(_0x563746,null))[_0x3d50('0x4c')](handleError(_0x563746,null));};exports[_0x3d50('0x8c')]=function(_0x351abf,_0x4a3506,_0x5657b3){return db[_0x3d50('0x35')][_0x3d50('0x51')]({'where':{'id':_0x351abf[_0x3d50('0x4e')]['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x4a3506,null))[_0x3d50('0x2b')](function(_0xbf2a6){if(_0xbf2a6){return _0xbf2a6['removeAgents'](_0x351abf[_0x3d50('0x3d')][_0x3d50('0x6c')])[_0x3d50('0x2b')](function(){if(_[_0x3d50('0x90')](_0x351abf[_0x3d50('0x3d')][_0x3d50('0x6c')])){for(var _0x4e8efd=0x0;_0x4e8efd<_0x351abf['query'][_0x3d50('0x6c')][_0x3d50('0x3f')];_0x4e8efd+=0x1){socket[_0x3d50('0x77')](_0x3d50('0x8d'),{'UserId':Number(_0x351abf[_0x3d50('0x3d')]['ids'][_0x4e8efd]),'OpenchannelQueueId':Number(_0x351abf[_0x3d50('0x4e')]['id'])});}}else{socket[_0x3d50('0x77')]('userOpenchannelQueue:remove',{'UserId':Number(_0x351abf['query'][_0x3d50('0x6c')]),'OpenchannelQueueId':Number(_0x351abf['params']['id'])});}});}})[_0x3d50('0x2b')](respondWithStatusCode(_0x4a3506,null))[_0x3d50('0x4c')](handleError(_0x4a3506,null));};exports[_0x3d50('0x91')]=function(_0x44234b,_0x5b6e5f,_0x3a586d){var _0x602a74={};var _0x5c10b5={};var _0x4c526e;var _0x515619;return db[_0x3d50('0x35')]['findOne']({'where':{'id':_0x44234b[_0x3d50('0x4e')]['id']}})[_0x3d50('0x2b')](handleEntityNotFound(_0x5b6e5f,null))['then'](function(_0x49ecc6){if(_0x49ecc6){_0x4c526e=_0x49ecc6;_0x5c10b5['model']=_['keys'](db[_0x3d50('0x61')][_0x3d50('0x5c')]);_0x5c10b5[_0x3d50('0x3d')]=_['keys'](_0x44234b[_0x3d50('0x3d')]);_0x5c10b5[_0x3d50('0x3b')]=_[_0x3d50('0x3c')](_0x5c10b5[_0x3d50('0x39')],_0x5c10b5['query']);_0x602a74[_0x3d50('0x3e')]=_[_0x3d50('0x3c')](_0x5c10b5[_0x3d50('0x39')],qs[_0x3d50('0x50')](_0x44234b[_0x3d50('0x3d')][_0x3d50('0x50')]));_0x602a74[_0x3d50('0x3e')]=_0x602a74[_0x3d50('0x3e')]['length']?_0x602a74['attributes']:_0x5c10b5['model'];_0x602a74[_0x3d50('0x41')]=qs[_0x3d50('0x42')](_0x44234b[_0x3d50('0x3d')]['sort']);_0x602a74[_0x3d50('0x45')]=qs['filters'](_['pick'](_0x44234b[_0x3d50('0x3d')],_0x5c10b5['filters']));if(_0x44234b[_0x3d50('0x3d')]['filter']){_0x602a74[_0x3d50('0x45')]=_[_0x3d50('0x46')](_0x602a74[_0x3d50('0x45')],{'$or':_[_0x3d50('0x3a')](_0x602a74[_0x3d50('0x3e')],function(_0x3a02a9){var _0x580f1e={};_0x580f1e[_0x3a02a9]={'$like':'%'+_0x44234b[_0x3d50('0x3d')][_0x3d50('0x44')]+'%'};return _0x580f1e;})});}_0x602a74=_[_0x3d50('0x46')]({},_0x602a74,_0x44234b[_0x3d50('0x5f')]);return _0x4c526e[_0x3d50('0x91')](_0x602a74);}})[_0x3d50('0x2b')](function(_0x25c0d5){if(_0x25c0d5){_0x515619=_0x25c0d5[_0x3d50('0x3f')];if(!_0x44234b[_0x3d50('0x3d')][_0x3d50('0x5d')](_0x3d50('0x40'))){_0x602a74[_0x3d50('0x24')]=qs['limit'](_0x44234b[_0x3d50('0x3d')]['limit']);_0x602a74['offset']=qs[_0x3d50('0x26')](_0x44234b[_0x3d50('0x3d')]['offset']);}return _0x4c526e[_0x3d50('0x91')](_0x602a74);}})[_0x3d50('0x2b')](function(_0x2117d9){if(_0x2117d9){return _0x2117d9?{'count':_0x515619,'rows':_0x2117d9}:null;}})[_0x3d50('0x2b')](respondWithResult(_0x5b6e5f,null))[_0x3d50('0x4c')](handleError(_0x5b6e5f,null));}; \ No newline at end of file +var _0xd50e=['apply','reject','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','OpenchannelQueue','includeAll','findAll','rows','catch','include','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','update','params','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','User','findAndCountAll','UserId','agent','createdAt','format','%s/%s','SIP','updatedAt','getTeams','addTeams','Team','online','voicePause','flatMap','Agents','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','ids','select','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','TeamId','includes','all','value','removeAgents','userOpenchannelQueue:remove','addAgents','omit','getAgents','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd50e,0x1eb));var _0xed50=function(_0x4dfbd6,_0x527344){_0x4dfbd6=_0x4dfbd6-0x0;var _0x2031f9=_0xd50e[_0x4dfbd6];return _0x2031f9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xed50('0x0'));var zipdir=require(_0xed50('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xed50('0x2'));var moment=require(_0xed50('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xed50('0x4'));var util=require(_0xed50('0x5'));var path=require('path');var sox=require(_0xed50('0x6'));var csv=require(_0xed50('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xed50('0x8'));var _=require(_0xed50('0x9'));var squel=require(_0xed50('0xa'));var crypto=require(_0xed50('0xb'));var jsforce=require(_0xed50('0xc'));var deskjs=require(_0xed50('0xd'));var toCsv=require(_0xed50('0x7'));var querystring=require('querystring');var Papa=require(_0xed50('0xe'));var Redis=require(_0xed50('0xf'));var authService=require(_0xed50('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xed50('0x11'));var hardwareService=require(_0xed50('0x12'));var logger=require(_0xed50('0x13'))('api');var utils=require(_0xed50('0x14'));var config=require(_0xed50('0x15'));var licenseUtil=require(_0xed50('0x16'));var db=require('../../mysqldb')['db'];config[_0xed50('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xed50('0x18'))(new Redis(config[_0xed50('0x17')]));require(_0xed50('0x19'))[_0xed50('0x1a')](socket);function respondWithStatusCode(_0x474e42,_0x22344b){_0x22344b=_0x22344b||0xcc;return function(_0x3f14c2){if(_0x3f14c2){return _0x474e42[_0xed50('0x1b')](_0x22344b);}return _0x474e42[_0xed50('0x1c')](_0x22344b)[_0xed50('0x1d')]();};}function respondWithResult(_0x4a4f3c,_0x41c7aa){_0x41c7aa=_0x41c7aa||0xc8;return function(_0x534d3a){if(_0x534d3a){return _0x4a4f3c['status'](_0x41c7aa)[_0xed50('0x1e')](_0x534d3a);}};}function respondWithFilteredResult(_0x35466e,_0x191478){return function(_0x4ee9a6){if(_0x4ee9a6){var _0x154724=typeof _0x191478[_0xed50('0x1f')]===_0xed50('0x20')&&typeof _0x191478['limit']===_0xed50('0x20');var _0x42edea=_0x4ee9a6['count'];var _0x498761=_0x154724?0x0:_0x191478['offset'];var _0x47e97b=_0x154724?_0x4ee9a6[_0xed50('0x21')]:_0x191478[_0xed50('0x1f')]+_0x191478[_0xed50('0x22')];var _0x20d72b;if(_0x47e97b>=_0x42edea){_0x47e97b=_0x42edea;_0x20d72b=0xc8;}else{_0x20d72b=0xce;}_0x35466e[_0xed50('0x1c')](_0x20d72b);return _0x35466e[_0xed50('0x23')](_0xed50('0x24'),_0x498761+'-'+_0x47e97b+'/'+_0x42edea)[_0xed50('0x1e')](_0x4ee9a6);}return null;};}function patchUpdates(_0x2307e0){return function(_0x352482){try{jsonpatch[_0xed50('0x25')](_0x352482,_0x2307e0,!![]);}catch(_0x3486e7){return BPromise[_0xed50('0x26')](_0x3486e7);}return _0x352482[_0xed50('0x27')]();};}function saveUpdates(_0x2cc4f8,_0x5428a8){return function(_0x521f5d){if(_0x521f5d){return _0x521f5d['update'](_0x2cc4f8)[_0xed50('0x28')](function(_0xbab28d){return _0xbab28d;});}return null;};}function removeEntity(_0x1b6c4a,_0x34afcf){return function(_0x1fc3d0){if(_0x1fc3d0){return _0x1fc3d0[_0xed50('0x29')]()[_0xed50('0x28')](function(){var _0x41adda=_0x1fc3d0[_0xed50('0x2a')]({'plain':!![]});var _0x515c47=_0xed50('0x2b');return db[_0xed50('0x2c')][_0xed50('0x29')]({'where':{'type':_0x515c47,'resourceId':_0x41adda['id']}})[_0xed50('0x28')](function(){return _0x1fc3d0;});})[_0xed50('0x28')](function(){_0x1b6c4a[_0xed50('0x1c')](0xcc)[_0xed50('0x1d')]();});}};}function handleEntityNotFound(_0x4228ff,_0x519a3b){return function(_0x161ff2){if(!_0x161ff2){_0x4228ff[_0xed50('0x1b')](0x194);}return _0x161ff2;};}function handleError(_0x5e03d6,_0x5dffc8){_0x5dffc8=_0x5dffc8||0x1f4;return function(_0xc788db){logger[_0xed50('0x2d')](_0xc788db[_0xed50('0x2e')]);if(_0xc788db[_0xed50('0x2f')]){delete _0xc788db['name'];}_0x5e03d6['status'](_0x5dffc8)[_0xed50('0x30')](_0xc788db);};}exports['index']=function(_0x248b36,_0x4d2cb6){var _0x5d009b={},_0x35d4bd={},_0x5c674d={'count':0x0,'rows':[]};var _0xe5958a=_[_0xed50('0x31')](db['OpenchannelQueue'][_0xed50('0x32')],function(_0x41d937){return{'name':_0x41d937['fieldName'],'type':_0x41d937[_0xed50('0x33')][_0xed50('0x34')]};});_0x35d4bd['model']=_[_0xed50('0x31')](_0xe5958a,_0xed50('0x2f'));_0x35d4bd[_0xed50('0x35')]=_[_0xed50('0x36')](_0x248b36[_0xed50('0x35')]);_0x35d4bd[_0xed50('0x37')]=_[_0xed50('0x38')](_0x35d4bd[_0xed50('0x39')],_0x35d4bd[_0xed50('0x35')]);_0x5d009b['attributes']=_[_0xed50('0x38')](_0x35d4bd[_0xed50('0x39')],qs['fields'](_0x248b36[_0xed50('0x35')][_0xed50('0x3a')]));_0x5d009b[_0xed50('0x3b')]=_0x5d009b[_0xed50('0x3b')][_0xed50('0x3c')]?_0x5d009b['attributes']:_0x35d4bd[_0xed50('0x39')];if(!_0x248b36[_0xed50('0x35')][_0xed50('0x3d')](_0xed50('0x3e'))){_0x5d009b[_0xed50('0x22')]=qs[_0xed50('0x22')](_0x248b36[_0xed50('0x35')][_0xed50('0x22')]);_0x5d009b[_0xed50('0x1f')]=qs[_0xed50('0x1f')](_0x248b36[_0xed50('0x35')][_0xed50('0x1f')]);}_0x5d009b[_0xed50('0x3f')]=qs[_0xed50('0x40')](_0x248b36[_0xed50('0x35')][_0xed50('0x40')]);_0x5d009b[_0xed50('0x41')]=qs[_0xed50('0x37')](_[_0xed50('0x42')](_0x248b36[_0xed50('0x35')],_0x35d4bd[_0xed50('0x37')]),_0xe5958a);if(_0x248b36[_0xed50('0x35')][_0xed50('0x43')]){_0x5d009b[_0xed50('0x41')]=_[_0xed50('0x44')](_0x5d009b[_0xed50('0x41')],{'$or':_[_0xed50('0x31')](_0xe5958a,function(_0x4eb7bf){if(_0x4eb7bf[_0xed50('0x33')]!==_0xed50('0x45')){var _0x39de3b={};_0x39de3b[_0x4eb7bf['name']]={'$like':'%'+_0x248b36[_0xed50('0x35')]['filter']+'%'};return _0x39de3b;}})});}_0x5d009b=_['merge']({},_0x5d009b,_0x248b36['options']);var _0x2ddbfb={'where':_0x5d009b[_0xed50('0x41')]};return db[_0xed50('0x46')][_0xed50('0x21')](_0x2ddbfb)[_0xed50('0x28')](function(_0x2ecba4){_0x5c674d[_0xed50('0x21')]=_0x2ecba4;if(_0x248b36[_0xed50('0x35')][_0xed50('0x47')]){_0x5d009b['include']=[{'all':!![]}];}return db[_0xed50('0x46')][_0xed50('0x48')](_0x5d009b);})[_0xed50('0x28')](function(_0x2cf0dc){_0x5c674d[_0xed50('0x49')]=_0x2cf0dc;return _0x5c674d;})[_0xed50('0x28')](respondWithFilteredResult(_0x4d2cb6,_0x5d009b))[_0xed50('0x4a')](handleError(_0x4d2cb6,null));};exports['show']=function(_0x50221a,_0x434884){var _0x275f56={'raw':!![],'where':{'id':_0x50221a['params']['id']}},_0x5d9e24={};_0x5d9e24[_0xed50('0x39')]=_[_0xed50('0x36')](db[_0xed50('0x46')][_0xed50('0x32')]);_0x5d9e24[_0xed50('0x35')]=_[_0xed50('0x36')](_0x50221a[_0xed50('0x35')]);_0x5d9e24[_0xed50('0x37')]=_[_0xed50('0x38')](_0x5d9e24[_0xed50('0x39')],_0x5d9e24[_0xed50('0x35')]);_0x275f56[_0xed50('0x3b')]=_['intersection'](_0x5d9e24[_0xed50('0x39')],qs['fields'](_0x50221a[_0xed50('0x35')][_0xed50('0x3a')]));_0x275f56[_0xed50('0x3b')]=_0x275f56[_0xed50('0x3b')][_0xed50('0x3c')]?_0x275f56[_0xed50('0x3b')]:_0x5d9e24[_0xed50('0x39')];if(_0x50221a[_0xed50('0x35')][_0xed50('0x47')]){_0x275f56[_0xed50('0x4b')]=[{'all':!![]}];}_0x275f56=_[_0xed50('0x44')]({},_0x275f56,_0x50221a[_0xed50('0x4c')]);return db[_0xed50('0x46')][_0xed50('0x4d')](_0x275f56)['then'](handleEntityNotFound(_0x434884,null))[_0xed50('0x28')](respondWithResult(_0x434884,null))[_0xed50('0x4a')](handleError(_0x434884,null));};exports[_0xed50('0x4e')]=function(_0x48e7c8,_0x35ccb8){return db[_0xed50('0x46')][_0xed50('0x4e')](_0x48e7c8[_0xed50('0x4f')],{})[_0xed50('0x28')](function(_0x5ceee7){var _0x9c69a5=_0x48e7c8['user']['get']({'plain':!![]});if(!_0x9c69a5)throw new Error(_0xed50('0x50'));if(_0x9c69a5[_0xed50('0x51')]===_0xed50('0x52')){var _0x4603c0=_0x5ceee7['get']({'plain':!![]});var _0x29fd50=_0xed50('0x2b');return db['UserProfileSection'][_0xed50('0x4d')]({'where':{'name':_0x29fd50,'userProfileId':_0x9c69a5[_0xed50('0x53')]},'raw':!![]})['then'](function(_0x36aa4a){if(_0x36aa4a&&_0x36aa4a[_0xed50('0x54')]===0x0){return db[_0xed50('0x2c')][_0xed50('0x4e')]({'name':_0x4603c0[_0xed50('0x2f')],'resourceId':_0x4603c0['id'],'type':_0x36aa4a[_0xed50('0x2f')],'sectionId':_0x36aa4a['id']},{})['then'](function(){return _0x5ceee7;});}else{return _0x5ceee7;}})[_0xed50('0x4a')](function(_0x1346ba){logger[_0xed50('0x2d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1346ba);throw _0x1346ba;});}return _0x5ceee7;})[_0xed50('0x28')](respondWithResult(_0x35ccb8,0xc9))[_0xed50('0x4a')](handleError(_0x35ccb8,null));};exports[_0xed50('0x55')]=function(_0xd03744,_0x18073c){if(_0xd03744[_0xed50('0x4f')]['id']){delete _0xd03744[_0xed50('0x4f')]['id'];}return db['OpenchannelQueue'][_0xed50('0x4d')]({'where':{'id':_0xd03744[_0xed50('0x56')]['id']}})[_0xed50('0x28')](handleEntityNotFound(_0x18073c,null))['then'](saveUpdates(_0xd03744[_0xed50('0x4f')],null))[_0xed50('0x28')](respondWithResult(_0x18073c,null))[_0xed50('0x4a')](handleError(_0x18073c,null));};exports[_0xed50('0x29')]=function(_0x3375d4,_0x28fcbf){return db['OpenchannelQueue'][_0xed50('0x4d')]({'where':{'id':_0x3375d4[_0xed50('0x56')]['id']}})['then'](handleEntityNotFound(_0x28fcbf,null))[_0xed50('0x28')](removeEntity(_0x28fcbf,null))['catch'](handleError(_0x28fcbf,null));};exports['describe']=function(_0x69c534,_0x2ee020){return db[_0xed50('0x46')][_0xed50('0x57')]()['then'](respondWithResult(_0x2ee020,null))[_0xed50('0x4a')](handleError(_0x2ee020,null));};exports[_0xed50('0x58')]=function(_0x2c3c04,_0x19d58d,_0x1a7712){var _0x466032={'raw':!![],'where':{}},_0x35c7ae={},_0x84db56;return db[_0xed50('0x46')][_0xed50('0x59')]({'where':{'id':_0x2c3c04[_0xed50('0x56')]['id']}})['then'](handleEntityNotFound(_0x19d58d,null))['then'](function(_0x54c3f0){if(_0x54c3f0){_0x84db56=_0x54c3f0[_0xed50('0x2a')]({'plain':!![]});_0x35c7ae['model']=_[_0xed50('0x36')](db[_0xed50('0x5a')][_0xed50('0x32')]);_0x35c7ae[_0xed50('0x35')]=_[_0xed50('0x36')](_0x2c3c04[_0xed50('0x35')]);_0x35c7ae['filters']=_['intersection'](_0x35c7ae[_0xed50('0x39')],_0x35c7ae[_0xed50('0x35')]);_0x466032['attributes']=_['intersection'](_0x35c7ae[_0xed50('0x39')],qs[_0xed50('0x3a')](_0x2c3c04['query'][_0xed50('0x3a')]));_0x466032[_0xed50('0x3b')]=_0x466032[_0xed50('0x3b')][_0xed50('0x3c')]?_0x466032['attributes']:_0x35c7ae['model'];if(!_0x2c3c04[_0xed50('0x35')][_0xed50('0x3d')](_0xed50('0x3e'))){_0x466032[_0xed50('0x22')]=qs[_0xed50('0x22')](_0x2c3c04[_0xed50('0x35')]['limit']);_0x466032[_0xed50('0x1f')]=qs[_0xed50('0x1f')](_0x2c3c04['query'][_0xed50('0x1f')]);}_0x466032[_0xed50('0x3f')]=qs[_0xed50('0x40')](_0x2c3c04[_0xed50('0x35')][_0xed50('0x40')]);_0x466032[_0xed50('0x41')]=qs[_0xed50('0x37')](_[_0xed50('0x42')](_0x2c3c04[_0xed50('0x35')],_0x35c7ae[_0xed50('0x37')]));_0x466032[_0xed50('0x41')][_0xed50('0x5b')]=_0x54c3f0['id'];if(_0x2c3c04['query'][_0xed50('0x43')]){_0x466032[_0xed50('0x41')]=_[_0xed50('0x44')](_0x466032['where'],{'$or':_['map'](_0x466032[_0xed50('0x3b')],function(_0x16082a){var _0xd97128={};_0xd97128[_0x16082a]={'$like':'%'+_0x2c3c04[_0xed50('0x35')][_0xed50('0x43')]+'%'};return _0xd97128;})});}_0x466032=_['merge']({},_0x466032,_0x2c3c04[_0xed50('0x4c')]);return db[_0xed50('0x5a')][_0xed50('0x48')](_0x466032);}})[_0xed50('0x28')](function(_0x355d53){if(_0x355d53){return db[_0xed50('0x5c')][_0xed50('0x5d')]({'where':{'id':_[_0xed50('0x31')](_0x355d53,_0xed50('0x5e')),'role':_0xed50('0x5f')},'attributes':['id',_0xed50('0x2f'),'openchannelPause','updatedAt',_0xed50('0x60')]});}})[_0xed50('0x28')](function(_0x2bed7c){if(_0x2bed7c){return{'count':_0x2bed7c[_0xed50('0x21')],'rows':_[_0xed50('0x31')](_0x2bed7c[_0xed50('0x49')],function(_0x5c6161){return{'membername':_0x5c6161[_0xed50('0x2f')],'UserId':_0x5c6161['id'],'queue_name':_0x84db56['name'],'OpenchannelQueueId':_0x84db56['id'],'interface':util[_0xed50('0x61')](_0xed50('0x62'),_0xed50('0x63'),_0x5c6161['name']),'penalty':0x0,'paused':_0x5c6161['openchannelPause'],'createdAt':_0x5c6161[_0xed50('0x60')],'updatedAt':_0x5c6161[_0xed50('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xed50('0x28')](respondWithFilteredResult(_0x19d58d,_0x466032))[_0xed50('0x4a')](handleError(_0x19d58d,null));};exports[_0xed50('0x65')]=function(_0x5bc7b9,_0x2670a1,_0x5d7bf5){var _0x7b494b={};var _0x42b306={};var _0x5623a4;var _0x26fde9;return db[_0xed50('0x46')][_0xed50('0x59')]({'where':{'id':_0x5bc7b9[_0xed50('0x56')]['id']}})['then'](handleEntityNotFound(_0x2670a1,null))[_0xed50('0x28')](function(_0x5a7f3d){if(_0x5a7f3d){_0x5623a4=_0x5a7f3d;_0x42b306[_0xed50('0x39')]=_[_0xed50('0x36')](db['Team'][_0xed50('0x32')]);_0x42b306['query']=_[_0xed50('0x36')](_0x5bc7b9[_0xed50('0x35')]);_0x42b306[_0xed50('0x37')]=_[_0xed50('0x38')](_0x42b306[_0xed50('0x39')],_0x42b306[_0xed50('0x35')]);_0x7b494b[_0xed50('0x3b')]=_[_0xed50('0x38')](_0x42b306[_0xed50('0x39')],qs[_0xed50('0x3a')](_0x5bc7b9[_0xed50('0x35')][_0xed50('0x3a')]));_0x7b494b[_0xed50('0x3b')]=_0x7b494b[_0xed50('0x3b')][_0xed50('0x3c')]?_0x7b494b[_0xed50('0x3b')]:_0x42b306[_0xed50('0x39')];_0x7b494b[_0xed50('0x3f')]=qs['sort'](_0x5bc7b9['query'][_0xed50('0x40')]);_0x7b494b['where']=qs[_0xed50('0x37')](_[_0xed50('0x42')](_0x5bc7b9[_0xed50('0x35')],_0x42b306[_0xed50('0x37')]));if(_0x5bc7b9[_0xed50('0x35')][_0xed50('0x43')]){_0x7b494b['where']=_[_0xed50('0x44')](_0x7b494b[_0xed50('0x41')],{'$or':_[_0xed50('0x31')](_0x7b494b[_0xed50('0x3b')],function(_0x5a85f0){var _0x202262={};_0x202262[_0x5a85f0]={'$like':'%'+_0x5bc7b9[_0xed50('0x35')]['filter']+'%'};return _0x202262;})});}_0x7b494b=_[_0xed50('0x44')]({},_0x7b494b,_0x5bc7b9['options']);return _0x5623a4[_0xed50('0x65')](_0x7b494b);}})[_0xed50('0x28')](function(_0x59c98a){if(_0x59c98a){_0x26fde9=_0x59c98a[_0xed50('0x3c')];if(!_0x5bc7b9[_0xed50('0x35')][_0xed50('0x3d')](_0xed50('0x3e'))){_0x7b494b[_0xed50('0x22')]=qs[_0xed50('0x22')](_0x5bc7b9[_0xed50('0x35')][_0xed50('0x22')]);_0x7b494b[_0xed50('0x1f')]=qs['offset'](_0x5bc7b9[_0xed50('0x35')][_0xed50('0x1f')]);}return _0x5623a4[_0xed50('0x65')](_0x7b494b);}})[_0xed50('0x28')](function(_0x46afea){if(_0x46afea){return _0x46afea?{'count':_0x26fde9,'rows':_0x46afea}:null;}})['then'](respondWithResult(_0x2670a1,null))[_0xed50('0x4a')](handleError(_0x2670a1,null));};exports[_0xed50('0x66')]=function(_0x318920,_0x1af5a1,_0x10c70d){var _0xee3cf5=_0x318920[_0xed50('0x4f')]['ids'];return db[_0xed50('0x67')][_0xed50('0x48')]({'where':{'id':_0xee3cf5},'attributes':['id'],'include':[{'model':db[_0xed50('0x5c')],'as':'Agents','attributes':['id',_0xed50('0x2f'),_0xed50('0x68'),_0xed50('0x69'),'interface'],'raw':!![]}]})[_0xed50('0x28')](function(_0x551245){if(_0x551245){var _0x204480=_[_0xed50('0x6a')](_0x551245,function(_0x19409f){var _0x571659=_0x19409f[_0xed50('0x2a')]({'plain':!![]});return _0x571659[_0xed50('0x6b')];});return db[_0xed50('0x46')][_0xed50('0x4d')]({'where':{'id':_0x318920[_0xed50('0x56')]['id']}})[_0xed50('0x28')](function(_0x4512c9){return db[_0xed50('0x6c')][_0xed50('0x6d')](function(_0x124f0a){return _0x4512c9[_0xed50('0x66')](_0xee3cf5,{'transaction':_0x124f0a})['then'](function(){return BPromise[_0xed50('0x6e')](_0x204480,function(_0x534c35){return db[_0xed50('0x5a')][_0xed50('0x6f')]({'where':{'UserId':_0x534c35['id'],'OpenchannelQueueId':_0x318920[_0xed50('0x56')]['id']},'transaction':_0x124f0a});});})['then'](function(){_0x204480[_0xed50('0x70')](function(_0x82bcfe){socket[_0xed50('0x71')](_0xed50('0x72'),{'UserId':_0x82bcfe['id'],'OpenchannelQueueId':_0x4512c9['id']});});});});});}})[_0xed50('0x28')](respondWithStatusCode(_0x1af5a1,null))[_0xed50('0x4a')](handleError(_0x1af5a1,null));};exports[_0xed50('0x73')]=function(_0x2c7a7d,_0x5e69fc,_0x6bf976){return db['Team'][_0xed50('0x48')]({'where':{'id':_0x2c7a7d[_0xed50('0x35')][_0xed50('0x74')]},'attributes':['id'],'include':[{'model':db[_0xed50('0x5c')],'as':_0xed50('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xed50('0x28')](handleEntityNotFound(_0x5e69fc,null))[_0xed50('0x28')](function(_0x3822d5){var _0x2bb45a=_[_0xed50('0x31')](_0x3822d5,'id');var _0x4f4cb9=[];var _0xee4f8c=[];var _0x3408a6=squel[_0xed50('0x75')]();_0x3408a6['field']('tq.TeamId')['from']('team_has_openchannel_queues','tq')[_0xed50('0x76')](_0xed50('0x77'),'ut',_0xed50('0x78'))[_0xed50('0x41')]('OpenchannelQueueId\x20=\x20?',_0x2c7a7d[_0xed50('0x56')]['id']);for(var _0x1b8922=0x0;_0x1b8922<_0x3822d5[_0xed50('0x3c')];_0x1b8922+=0x1){let _0x3a136d=_0x3822d5[_0x1b8922];for(var _0x1f1140=0x0;_0x1f1140<_0x3a136d[_0xed50('0x6b')][_0xed50('0x3c')];_0x1f1140+=0x1){let _0x3fcbe0=_0x3a136d['Agents'][_0x1f1140];var _0x124a0e=_0x3408a6['clone']();_0x124a0e[_0xed50('0x41')](_0xed50('0x79'),_0x3fcbe0['id']);_0xee4f8c[_0xed50('0x7a')](db[_0xed50('0x6c')][_0xed50('0x35')](_0x124a0e['toString'](),{'type':db[_0xed50('0x6c')]['QueryTypes']['SELECT']})[_0xed50('0x28')](function(_0x326432){if(_0x326432[_0xed50('0x3c')]===0x1){return _0x3fcbe0['id'];}else{var _0x1bc75b=_['every'](_[_0xed50('0x31')](_0x326432,_0xed50('0x7b')),function(_0x490652){return _[_0xed50('0x7c')](_0x2bb45a,_0x490652);});if(_0x1bc75b){return _0x3fcbe0['id'];}}}));}}return BPromise[_0xed50('0x7d')](_0xee4f8c)[_0xed50('0x28')](function(_0x1101d2){_0x4f4cb9=_(_0x4f4cb9)['union'](_0x1101d2)['compact']()[_0xed50('0x7e')]();return db['OpenchannelQueue']['find']({'where':{'id':_0x2c7a7d['params']['id']}})['then'](function(_0x6090dd){return db[_0xed50('0x6c')][_0xed50('0x6d')](function(_0x413269){return _0x6090dd[_0xed50('0x73')](_0x2c7a7d[_0xed50('0x35')][_0xed50('0x74')],{'transaction':_0x413269})[_0xed50('0x28')](function(){if(!_['isEmpty'](_0x4f4cb9)){return _0x6090dd[_0xed50('0x7f')](_0x4f4cb9,{'transaction':_0x413269});}})['then'](function(){_0x4f4cb9[_0xed50('0x70')](function(_0x16dfee){socket[_0xed50('0x71')](_0xed50('0x80'),{'UserId':_0x16dfee,'OpenchannelQueueId':_0x6090dd['id']});});});});});});})['then'](respondWithStatusCode(_0x5e69fc,null))['catch'](handleError(_0x5e69fc,null));};exports['addAgents']=function(_0x4621f1,_0x2bbcc6,_0x4cb2be){return db[_0xed50('0x46')][_0xed50('0x4d')]({'where':{'id':_0x4621f1['params']['id']}})[_0xed50('0x28')](handleEntityNotFound(_0x2bbcc6,null))[_0xed50('0x28')](function(_0x83ec41){if(_0x83ec41){return _0x83ec41[_0xed50('0x81')](_0x4621f1[_0xed50('0x4f')]['ids'],_[_0xed50('0x82')](_0x4621f1['body'],['ids','id'])||{})['spread'](function(_0x56e259){for(var _0x4e4abf=0x0;_0x4e4abf<_0x4621f1[_0xed50('0x4f')]['ids'][_0xed50('0x3c')];_0x4e4abf+=0x1){socket[_0xed50('0x71')](_0xed50('0x72'),{'UserId':Number(_0x4621f1[_0xed50('0x4f')][_0xed50('0x74')][_0x4e4abf]),'OpenchannelQueueId':Number(_0x4621f1[_0xed50('0x56')]['id'])});}return _0x56e259;});}})[_0xed50('0x28')](respondWithResult(_0x2bbcc6,null))[_0xed50('0x4a')](handleError(_0x2bbcc6,null));};exports['removeAgents']=function(_0x21740a,_0x1871e1,_0x358de0){return db[_0xed50('0x46')]['find']({'where':{'id':_0x21740a['params']['id']}})[_0xed50('0x28')](handleEntityNotFound(_0x1871e1,null))[_0xed50('0x28')](function(_0x5be79e){if(_0x5be79e){return _0x5be79e[_0xed50('0x7f')](_0x21740a['query']['ids'])[_0xed50('0x28')](function(){if(_['isArray'](_0x21740a[_0xed50('0x35')][_0xed50('0x74')])){for(var _0x44de35=0x0;_0x44de35<_0x21740a['query'][_0xed50('0x74')][_0xed50('0x3c')];_0x44de35+=0x1){socket['emit'](_0xed50('0x80'),{'UserId':Number(_0x21740a['query'][_0xed50('0x74')][_0x44de35]),'OpenchannelQueueId':Number(_0x21740a[_0xed50('0x56')]['id'])});}}else{socket[_0xed50('0x71')](_0xed50('0x80'),{'UserId':Number(_0x21740a[_0xed50('0x35')][_0xed50('0x74')]),'OpenchannelQueueId':Number(_0x21740a[_0xed50('0x56')]['id'])});}});}})[_0xed50('0x28')](respondWithStatusCode(_0x1871e1,null))['catch'](handleError(_0x1871e1,null));};exports[_0xed50('0x83')]=function(_0x138960,_0x548b1a,_0x56c8ef){var _0x2a70a6={};var _0x1c3ae6={};var _0x12321a;var _0x35a286;return db[_0xed50('0x46')]['findOne']({'where':{'id':_0x138960[_0xed50('0x56')]['id']}})['then'](handleEntityNotFound(_0x548b1a,null))['then'](function(_0x48f0f4){if(_0x48f0f4){_0x12321a=_0x48f0f4;_0x1c3ae6[_0xed50('0x39')]=_[_0xed50('0x36')](db[_0xed50('0x5c')][_0xed50('0x32')]);_0x1c3ae6['query']=_[_0xed50('0x36')](_0x138960[_0xed50('0x35')]);_0x1c3ae6['filters']=_[_0xed50('0x38')](_0x1c3ae6[_0xed50('0x39')],_0x1c3ae6[_0xed50('0x35')]);_0x2a70a6[_0xed50('0x3b')]=_['intersection'](_0x1c3ae6['model'],qs['fields'](_0x138960[_0xed50('0x35')][_0xed50('0x3a')]));_0x2a70a6[_0xed50('0x3b')]=_0x2a70a6[_0xed50('0x3b')][_0xed50('0x3c')]?_0x2a70a6[_0xed50('0x3b')]:_0x1c3ae6[_0xed50('0x39')];_0x2a70a6['order']=qs[_0xed50('0x40')](_0x138960[_0xed50('0x35')]['sort']);_0x2a70a6['where']=qs[_0xed50('0x37')](_[_0xed50('0x42')](_0x138960[_0xed50('0x35')],_0x1c3ae6[_0xed50('0x37')]));if(_0x138960[_0xed50('0x35')][_0xed50('0x43')]){_0x2a70a6[_0xed50('0x41')]=_[_0xed50('0x44')](_0x2a70a6[_0xed50('0x41')],{'$or':_[_0xed50('0x31')](_0x2a70a6['attributes'],function(_0x54b204){var _0x40c0e9={};_0x40c0e9[_0x54b204]={'$like':'%'+_0x138960[_0xed50('0x35')][_0xed50('0x43')]+'%'};return _0x40c0e9;})});}_0x2a70a6=_[_0xed50('0x44')]({},_0x2a70a6,_0x138960[_0xed50('0x4c')]);return _0x12321a[_0xed50('0x83')](_0x2a70a6);}})[_0xed50('0x28')](function(_0x29b5d0){if(_0x29b5d0){_0x35a286=_0x29b5d0[_0xed50('0x3c')];if(!_0x138960[_0xed50('0x35')][_0xed50('0x3d')](_0xed50('0x3e'))){_0x2a70a6[_0xed50('0x22')]=qs[_0xed50('0x22')](_0x138960[_0xed50('0x35')][_0xed50('0x22')]);_0x2a70a6[_0xed50('0x1f')]=qs['offset'](_0x138960[_0xed50('0x35')][_0xed50('0x1f')]);}return _0x12321a[_0xed50('0x83')](_0x2a70a6);}})[_0xed50('0x28')](function(_0x1638fa){if(_0x1638fa){return _0x1638fa?{'count':_0x35a286,'rows':_0x1638fa}:null;}})[_0xed50('0x28')](respondWithResult(_0x548b1a,null))[_0xed50('0x4a')](handleError(_0x548b1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 0cd03be..2394e54 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 _0xd8cc=['../../mysqldb','OpenchannelQueue','save','update','remove','emit','hasOwnProperty','events'];(function(_0x1b2446,_0x546cc1){var _0x2236eb=function(_0x44f4af){while(--_0x44f4af){_0x1b2446['push'](_0x1b2446['shift']());}};_0x2236eb(++_0x546cc1);}(_0xd8cc,0x87));var _0xcd8c=function(_0x257b0e,_0x563d7e){_0x257b0e=_0x257b0e-0x0;var _0x27ac2a=_0xd8cc[_0x257b0e];return _0x27ac2a;};'use strict';var EventEmitter=require(_0xcd8c('0x0'));var OpenchannelQueue=require(_0xcd8c('0x1'))['db'][_0xcd8c('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd8c('0x3'),'afterUpdate':_0xcd8c('0x4'),'afterDestroy':_0xcd8c('0x5')};function emitEvent(_0x3e0a8b){return function(_0x134170,_0x32e5f7,_0x2061d6){OpenchannelQueueEvents[_0xcd8c('0x6')](_0x3e0a8b+':'+_0x134170['id'],_0x134170);OpenchannelQueueEvents[_0xcd8c('0x6')](_0x3e0a8b,_0x134170);_0x2061d6(null);};}for(var e in events){if(events[_0xcd8c('0x7')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x017d=['hasOwnProperty','hook','exports','events','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0x436349,_0x39881b){var _0x2d6dad=function(_0x667247){while(--_0x667247){_0x436349['push'](_0x436349['shift']());}};_0x2d6dad(++_0x39881b);}(_0x017d,0x1b1));var _0xd017=function(_0x67adc0,_0x1fd4cb){_0x67adc0=_0x67adc0-0x0;var _0x31323d=_0x017d[_0x67adc0];return _0x31323d;};'use strict';var EventEmitter=require(_0xd017('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xd017('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd017('0x2')](0x0);var events={'afterCreate':_0xd017('0x3'),'afterUpdate':_0xd017('0x4'),'afterDestroy':_0xd017('0x5')};function emitEvent(_0x46aeb7){return function(_0x35e851,_0x3dd385,_0x21ae56){OpenchannelQueueEvents[_0xd017('0x6')](_0x46aeb7+':'+_0x35e851['id'],_0x35e851);OpenchannelQueueEvents[_0xd017('0x6')](_0x46aeb7,_0x35e851);_0x21ae56(null);};}for(var e in events){if(events[_0xd017('0x7')](e)){var event=events[e];OpenchannelQueue[_0xd017('0x8')](e,emitEvent(event));}}module[_0xd017('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 8767f1a..5b1834d 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 _0xcac1=['define','OpenchannelQueue','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports'];(function(_0x490bca,_0x1a1826){var _0x33666c=function(_0x5eac58){while(--_0x5eac58){_0x490bca['push'](_0x490bca['shift']());}};_0x33666c(++_0x1a1826);}(_0xcac1,0x141));var _0x1cac=function(_0x227901,_0x1d8fca){_0x227901=_0x227901-0x0;var _0x5a55e4=_0xcac1[_0x227901];return _0x5a55e4;};'use strict';var _=require('lodash');var util=require(_0x1cac('0x0'));var logger=require('../../config/logger')(_0x1cac('0x1'));var moment=require('moment');var BPromise=require(_0x1cac('0x2'));var rp=require(_0x1cac('0x3'));var fs=require('fs');var path=require(_0x1cac('0x4'));var rimraf=require(_0x1cac('0x5'));var config=require(_0x1cac('0x6'));var attributes=require(_0x1cac('0x7'));module[_0x1cac('0x8')]=function(_0x53a5f4,_0x5b531a){return _0x53a5f4[_0x1cac('0x9')](_0x1cac('0xa'),attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cf6=['openchannel_queues','lodash','util','api','moment','bluebird','path','../../config/environment','./openchannelQueue.attributes','exports','OpenchannelQueue'];(function(_0x258fb0,_0x5362dc){var _0x4d1afe=function(_0x1c8f24){while(--_0x1c8f24){_0x258fb0['push'](_0x258fb0['shift']());}};_0x4d1afe(++_0x5362dc);}(_0x3cf6,0x6f));var _0x63cf=function(_0x2720cc,_0x348f3b){_0x2720cc=_0x2720cc-0x0;var _0x15b35c=_0x3cf6[_0x2720cc];return _0x15b35c;};'use strict';var _=require(_0x63cf('0x0'));var util=require(_0x63cf('0x1'));var logger=require('../../config/logger')(_0x63cf('0x2'));var moment=require(_0x63cf('0x3'));var BPromise=require(_0x63cf('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x63cf('0x5'));var rimraf=require('rimraf');var config=require(_0x63cf('0x6'));var attributes=require(_0x63cf('0x7'));module[_0x63cf('0x8')]=function(_0x1edc7e,_0x317519){return _0x1edc7e['define'](_0x63cf('0x9'),attributes,{'tableName':_0x63cf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 9c71698..20c07fc 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 _0xb6f9=['OpenchannelQueue','findAll','options','raw','where','attributes','include','map','model','info','ShowOpenchannelQueue','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','then','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetOpenchannelQueue'];(function(_0x1b97c6,_0x337ad0){var _0x243850=function(_0x539f2f){while(--_0x539f2f){_0x1b97c6['push'](_0x1b97c6['shift']());}};_0x243850(++_0x337ad0);}(_0xb6f9,0x1cb));var _0x9b6f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb6f9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x9b6f('0x0'));var fs=require('fs');var Redis=require(_0x9b6f('0x1'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9b6f('0x2'))('rpc');var config=require(_0x9b6f('0x3'));var jayson=require(_0x9b6f('0x4'));var client=jayson[_0x9b6f('0x5')][_0x9b6f('0x6')]({'port':0x232a});config[_0x9b6f('0x7')]=_[_0x9b6f('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9b6f('0x9'))(new Redis(config[_0x9b6f('0x7')]));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x477722,_0x4115d2,_0x1ba92a){return new BPromise(function(_0x4f05eb,_0xcf3d5){return client['request'](_0x477722,_0x1ba92a)[_0x9b6f('0xa')](function(_0x821780){logger['info'](_0x9b6f('0xb'),_0x4115d2,'request\x20sent');logger[_0x9b6f('0xc')](_0x9b6f('0xd'),_0x4115d2,_0x9b6f('0xe'),JSON[_0x9b6f('0xf')](_0x821780));if(_0x821780[_0x9b6f('0x10')]){if(_0x821780[_0x9b6f('0x10')][_0x9b6f('0x11')]===0x1f4){logger[_0x9b6f('0x10')]('OpenchannelQueue,\x20%s,\x20%s',_0x4115d2,_0x821780['error'][_0x9b6f('0x12')]);return _0xcf3d5(_0x821780[_0x9b6f('0x10')][_0x9b6f('0x12')]);}logger[_0x9b6f('0x10')](_0x9b6f('0xb'),_0x4115d2,_0x821780[_0x9b6f('0x10')][_0x9b6f('0x12')]);return _0x4f05eb(_0x821780[_0x9b6f('0x10')]['message']);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4115d2,_0x9b6f('0xe'));_0x4f05eb(_0x821780['result'][_0x9b6f('0x12')]);}})[_0x9b6f('0x13')](function(_0x4d63db){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4115d2,_0x4d63db);_0xcf3d5(_0x4d63db);});});}exports[_0x9b6f('0x14')]=function(_0x4284ec){var _0x6e0027=this;return new Promise(function(_0x30a742,_0xca2dcc){return db[_0x9b6f('0x15')][_0x9b6f('0x16')]({'raw':_0x4284ec[_0x9b6f('0x17')]?_0x4284ec[_0x9b6f('0x17')][_0x9b6f('0x18')]===undefined?!![]:![]:!![],'where':_0x4284ec[_0x9b6f('0x17')]?_0x4284ec['options'][_0x9b6f('0x19')]||null:null,'attributes':_0x4284ec[_0x9b6f('0x17')]?_0x4284ec[_0x9b6f('0x17')][_0x9b6f('0x1a')]||null:null,'limit':_0x4284ec['options']?_0x4284ec['options']['limit']||null:null,'include':_0x4284ec['options']?_0x4284ec['options'][_0x9b6f('0x1b')]?_[_0x9b6f('0x1c')](_0x4284ec['options'][_0x9b6f('0x1b')],function(_0x2e2f10){return{'model':db[_0x2e2f10[_0x9b6f('0x1d')]],'as':_0x2e2f10['as'],'attributes':_0x2e2f10[_0x9b6f('0x1a')],'include':_0x2e2f10[_0x9b6f('0x1b')]?_[_0x9b6f('0x1c')](_0x2e2f10['include'],function(_0x25f654){return{'model':db[_0x25f654[_0x9b6f('0x1d')]],'as':_0x25f654['as'],'attributes':_0x25f654[_0x9b6f('0x1a')],'include':_0x25f654[_0x9b6f('0x1b')]?_[_0x9b6f('0x1c')](_0x25f654[_0x9b6f('0x1b')],function(_0x4683e8){return{'model':db[_0x4683e8[_0x9b6f('0x1d')]],'as':_0x4683e8['as'],'attributes':_0x4683e8[_0x9b6f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5cf0d4){logger[_0x9b6f('0x1e')](_0x9b6f('0x14'),_0x4284ec);logger[_0x9b6f('0xc')](_0x9b6f('0x14'),_0x4284ec,JSON['stringify'](_0x5cf0d4));_0x30a742(_0x5cf0d4);})['catch'](function(_0x331ee5){logger['error'](_0x9b6f('0x14'),_0x331ee5[_0x9b6f('0x12')],_0x4284ec);_0xca2dcc(_0x6e0027[_0x9b6f('0x10')](0x1f4,_0x331ee5[_0x9b6f('0x12')]));});});};exports[_0x9b6f('0x1f')]=function(_0x9aba6a){var _0x3991d4=this;return new Promise(function(_0x3f6989,_0x3c0ae3){return db[_0x9b6f('0x15')]['find']({'raw':_0x9aba6a[_0x9b6f('0x17')]?_0x9aba6a['options'][_0x9b6f('0x18')]===undefined?!![]:![]:!![],'where':_0x9aba6a[_0x9b6f('0x17')]?_0x9aba6a[_0x9b6f('0x17')][_0x9b6f('0x19')]||null:null,'attributes':_0x9aba6a[_0x9b6f('0x17')]?_0x9aba6a[_0x9b6f('0x17')][_0x9b6f('0x1a')]||null:null,'include':_0x9aba6a[_0x9b6f('0x17')]?_0x9aba6a[_0x9b6f('0x17')][_0x9b6f('0x1b')]?_['map'](_0x9aba6a[_0x9b6f('0x17')][_0x9b6f('0x1b')],function(_0x4c85ab){return{'model':db[_0x4c85ab[_0x9b6f('0x1d')]],'as':_0x4c85ab['as'],'attributes':_0x4c85ab[_0x9b6f('0x1a')],'include':_0x4c85ab['include']?_[_0x9b6f('0x1c')](_0x4c85ab[_0x9b6f('0x1b')],function(_0x4d065e){return{'model':db[_0x4d065e['model']],'as':_0x4d065e['as'],'attributes':_0x4d065e[_0x9b6f('0x1a')],'include':_0x4d065e[_0x9b6f('0x1b')]?_[_0x9b6f('0x1c')](_0x4d065e['include'],function(_0x50eb2d){return{'model':db[_0x50eb2d[_0x9b6f('0x1d')]],'as':_0x50eb2d['as'],'attributes':_0x50eb2d[_0x9b6f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9b6f('0xa')](function(_0x5d6c0a){logger[_0x9b6f('0x1e')]('ShowOpenchannelQueue',_0x9aba6a);logger[_0x9b6f('0xc')](_0x9b6f('0x1f'),_0x9aba6a,JSON[_0x9b6f('0xf')](_0x5d6c0a));_0x3f6989(_0x5d6c0a);})[_0x9b6f('0x13')](function(_0x4fe947){logger['error'](_0x9b6f('0x1f'),_0x4fe947[_0x9b6f('0x12')],_0x9aba6a);_0x3c0ae3(_0x3991d4[_0x9b6f('0x10')](0x1f4,_0x4fe947[_0x9b6f('0x12')]));});});}; \ No newline at end of file +var _0x233f=['map','model','GetOpenchannelQueue','ShowOpenchannelQueue','find','then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','redis','defaults','localhost','socket.io-emitter','register','request','OpenchannelQueue,\x20%s,\x20%s','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','OpenchannelQueue','findAll','options','where','attributes','limit','include'];(function(_0x5a776b,_0x46f785){var _0xbbef59=function(_0x38313e){while(--_0x38313e){_0x5a776b['push'](_0x5a776b['shift']());}};_0xbbef59(++_0x46f785);}(_0x233f,0x9e));var _0xf233=function(_0x263943,_0x322f80){_0x263943=_0x263943-0x0;var _0x154afb=_0x233f[_0x263943];return _0x154afb;};'use strict';var _=require(_0xf233('0x0'));var util=require(_0xf233('0x1'));var moment=require('moment');var BPromise=require(_0xf233('0x2'));var rs=require(_0xf233('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf233('0x4'))['db'];var utils=require(_0xf233('0x5'));var logger=require(_0xf233('0x6'))(_0xf233('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xf233('0x8')]({'port':0x232a});config[_0xf233('0x9')]=_[_0xf233('0xa')](config[_0xf233('0x9')],{'host':_0xf233('0xb'),'port':0x18eb});var socket=require(_0xf233('0xc'))(new Redis(config[_0xf233('0x9')]));require('./openchannelQueue.socket')[_0xf233('0xd')](socket);function respondWithRpcPromise(_0x42df94,_0x4ea546,_0x4ecef1){return new BPromise(function(_0xc87b7c,_0x35f5d8){return client[_0xf233('0xe')](_0x42df94,_0x4ecef1)['then'](function(_0x34ac62){logger['info'](_0xf233('0xf'),_0x4ea546,'request\x20sent');logger[_0xf233('0x10')](_0xf233('0x11'),_0x4ea546,'request\x20sent',JSON[_0xf233('0x12')](_0x34ac62));if(_0x34ac62['error']){if(_0x34ac62[_0xf233('0x13')][_0xf233('0x14')]===0x1f4){logger[_0xf233('0x13')](_0xf233('0xf'),_0x4ea546,_0x34ac62[_0xf233('0x13')][_0xf233('0x15')]);return _0x35f5d8(_0x34ac62[_0xf233('0x13')]['message']);}logger[_0xf233('0x13')](_0xf233('0xf'),_0x4ea546,_0x34ac62[_0xf233('0x13')][_0xf233('0x15')]);return _0xc87b7c(_0x34ac62[_0xf233('0x13')][_0xf233('0x15')]);}else{logger[_0xf233('0x16')](_0xf233('0xf'),_0x4ea546,'request\x20sent');_0xc87b7c(_0x34ac62[_0xf233('0x17')][_0xf233('0x15')]);}})[_0xf233('0x18')](function(_0x19f785){logger['error'](_0xf233('0xf'),_0x4ea546,_0x19f785);_0x35f5d8(_0x19f785);});});}exports['GetOpenchannelQueue']=function(_0x36e20d){var _0x9a9349=this;return new Promise(function(_0x2df426,_0xba1ca3){return db[_0xf233('0x19')][_0xf233('0x1a')]({'raw':_0x36e20d[_0xf233('0x1b')]?_0x36e20d[_0xf233('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x36e20d[_0xf233('0x1b')]?_0x36e20d[_0xf233('0x1b')][_0xf233('0x1c')]||null:null,'attributes':_0x36e20d[_0xf233('0x1b')]?_0x36e20d[_0xf233('0x1b')][_0xf233('0x1d')]||null:null,'limit':_0x36e20d[_0xf233('0x1b')]?_0x36e20d[_0xf233('0x1b')][_0xf233('0x1e')]||null:null,'include':_0x36e20d[_0xf233('0x1b')]?_0x36e20d[_0xf233('0x1b')][_0xf233('0x1f')]?_[_0xf233('0x20')](_0x36e20d[_0xf233('0x1b')]['include'],function(_0x23ee6c){return{'model':db[_0x23ee6c[_0xf233('0x21')]],'as':_0x23ee6c['as'],'attributes':_0x23ee6c[_0xf233('0x1d')],'include':_0x23ee6c[_0xf233('0x1f')]?_[_0xf233('0x20')](_0x23ee6c[_0xf233('0x1f')],function(_0x3dbe4f){return{'model':db[_0x3dbe4f[_0xf233('0x21')]],'as':_0x3dbe4f['as'],'attributes':_0x3dbe4f[_0xf233('0x1d')],'include':_0x3dbe4f['include']?_[_0xf233('0x20')](_0x3dbe4f['include'],function(_0x38d99a){return{'model':db[_0x38d99a[_0xf233('0x21')]],'as':_0x38d99a['as'],'attributes':_0x38d99a[_0xf233('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2cf403){logger['info'](_0xf233('0x22'),_0x36e20d);logger[_0xf233('0x10')](_0xf233('0x22'),_0x36e20d,JSON[_0xf233('0x12')](_0x2cf403));_0x2df426(_0x2cf403);})[_0xf233('0x18')](function(_0x28371d){logger['error'](_0xf233('0x22'),_0x28371d[_0xf233('0x15')],_0x36e20d);_0xba1ca3(_0x9a9349[_0xf233('0x13')](0x1f4,_0x28371d[_0xf233('0x15')]));});});};exports[_0xf233('0x23')]=function(_0x4b923e){var _0x166c64=this;return new Promise(function(_0x12c6b3,_0x26d3af){return db[_0xf233('0x19')][_0xf233('0x24')]({'raw':_0x4b923e[_0xf233('0x1b')]?_0x4b923e['options']['raw']===undefined?!![]:![]:!![],'where':_0x4b923e[_0xf233('0x1b')]?_0x4b923e[_0xf233('0x1b')][_0xf233('0x1c')]||null:null,'attributes':_0x4b923e[_0xf233('0x1b')]?_0x4b923e['options'][_0xf233('0x1d')]||null:null,'include':_0x4b923e['options']?_0x4b923e[_0xf233('0x1b')][_0xf233('0x1f')]?_[_0xf233('0x20')](_0x4b923e[_0xf233('0x1b')][_0xf233('0x1f')],function(_0x4b5a11){return{'model':db[_0x4b5a11[_0xf233('0x21')]],'as':_0x4b5a11['as'],'attributes':_0x4b5a11[_0xf233('0x1d')],'include':_0x4b5a11[_0xf233('0x1f')]?_[_0xf233('0x20')](_0x4b5a11[_0xf233('0x1f')],function(_0x341fcf){return{'model':db[_0x341fcf[_0xf233('0x21')]],'as':_0x341fcf['as'],'attributes':_0x341fcf[_0xf233('0x1d')],'include':_0x341fcf[_0xf233('0x1f')]?_[_0xf233('0x20')](_0x341fcf[_0xf233('0x1f')],function(_0x5d5374){return{'model':db[_0x5d5374[_0xf233('0x21')]],'as':_0x5d5374['as'],'attributes':_0x5d5374[_0xf233('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf233('0x25')](function(_0x55b777){logger[_0xf233('0x16')](_0xf233('0x23'),_0x4b923e);logger[_0xf233('0x10')](_0xf233('0x23'),_0x4b923e,JSON['stringify'](_0x55b777));_0x12c6b3(_0x55b777);})[_0xf233('0x18')](function(_0x2e4e6f){logger['error'](_0xf233('0x23'),_0x2e4e6f[_0xf233('0x15')],_0x4b923e);_0x26d3af(_0x166c64['error'](0x1f4,_0x2e4e6f['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 3eb4ba2..528b37a 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 _0xb688=['removeListener','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x18ea99,_0x5d0dc6){var _0x4e1a63=function(_0x560366){while(--_0x560366){_0x18ea99['push'](_0x18ea99['shift']());}};_0x4e1a63(++_0x5d0dc6);}(_0xb688,0xa6));var _0x8b68=function(_0x2e9a25,_0x283732){_0x2e9a25=_0x2e9a25-0x0;var _0x241aaf=_0xb688[_0x2e9a25];return _0x241aaf;};'use strict';var OpenchannelQueueEvents=require(_0x8b68('0x0'));var events=[_0x8b68('0x1'),'remove','update'];function createListener(_0x30aff9,_0x97a314){return function(_0x4c4c25){_0x97a314['emit'](_0x30aff9,_0x4c4c25);};}function removeListener(_0x423295,_0xfac6ab){return function(){OpenchannelQueueEvents[_0x8b68('0x2')](_0x423295,_0xfac6ab);};}exports[_0x8b68('0x3')]=function(_0x2b781e){for(var _0x2da287=0x0,_0x2f319f=events[_0x8b68('0x4')];_0x2da287<_0x2f319f;_0x2da287++){var _0x37de21=events[_0x2da287];var _0x45834a=createListener(_0x8b68('0x5')+_0x37de21,_0x2b781e);OpenchannelQueueEvents['on'](_0x37de21,_0x45834a);}}; \ No newline at end of file +var _0x66c0=['update','emit','register','length','openchannelQueue:','./openchannelQueue.events','save'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x66c0,0x194));var _0x066c=function(_0x1bf1f3,_0xfcffa7){_0x1bf1f3=_0x1bf1f3-0x0;var _0x2c3af5=_0x66c0[_0x1bf1f3];return _0x2c3af5;};'use strict';var OpenchannelQueueEvents=require(_0x066c('0x0'));var events=[_0x066c('0x1'),'remove',_0x066c('0x2')];function createListener(_0x5191b1,_0x132b9e){return function(_0x257d42){_0x132b9e[_0x066c('0x3')](_0x5191b1,_0x257d42);};}function removeListener(_0x37ab65,_0x38b675){return function(){OpenchannelQueueEvents['removeListener'](_0x37ab65,_0x38b675);};}exports[_0x066c('0x4')]=function(_0x5a28cb){for(var _0x308a01=0x0,_0x1bb234=events[_0x066c('0x5')];_0x308a01<_0x1bb234;_0x308a01++){var _0x742f71=events[_0x308a01];var _0x145d40=createListener(_0x066c('0x6')+_0x742f71,_0x5a28cb);OpenchannelQueueEvents['on'](_0x742f71,_0x145d40);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 2555b0c..71ce47d 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 _0x9d27=['../../config/environment','get','/describe','isAuthenticated','describe','create','put','/:id','delete','exports','multer','util','path','express','../../components/interaction/service'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9d27,0xeb));var _0x79d2=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0x9d27[_0x163040];return _0x364667;};'use strict';var multer=require(_0x79d2('0x0'));var util=require(_0x79d2('0x1'));var path=require(_0x79d2('0x2'));var timeout=require('connect-timeout');var express=require(_0x79d2('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x79d2('0x4'));var config=require(_0x79d2('0x5'));var controller=require('./openchannelQueueReport.controller');router[_0x79d2('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x79d2('0x6')](_0x79d2('0x7'),auth[_0x79d2('0x8')](),controller[_0x79d2('0x9')]);router[_0x79d2('0x6')]('/:id',auth[_0x79d2('0x8')](),controller['show']);router['post']('/',auth[_0x79d2('0x8')](),controller[_0x79d2('0xa')]);router[_0x79d2('0xb')](_0x79d2('0xc'),auth[_0x79d2('0x8')](),controller['update']);router[_0x79d2('0xd')](_0x79d2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x79d2('0xe')]=router; \ No newline at end of file +var _0xd04d=['isAuthenticated','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','index','get','describe','/:id','show','post','create','put'];(function(_0x2d34c9,_0x5e8ffd){var _0x41741e=function(_0x36fbe6){while(--_0x36fbe6){_0x2d34c9['push'](_0x2d34c9['shift']());}};_0x41741e(++_0x5e8ffd);}(_0xd04d,0xd6));var _0xdd04=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd04d[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xdd04('0x0'));var util=require(_0xdd04('0x1'));var path=require('path');var timeout=require(_0xdd04('0x2'));var express=require(_0xdd04('0x3'));var router=express[_0xdd04('0x4')]();var fs_extra=require(_0xdd04('0x5'));var auth=require(_0xdd04('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xdd04('0x7'));var controller=require(_0xdd04('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xdd04('0x9')]);router[_0xdd04('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xdd04('0xb')]);router['get'](_0xdd04('0xc'),auth['isAuthenticated'](),controller[_0xdd04('0xd')]);router[_0xdd04('0xe')]('/',auth['isAuthenticated'](),controller[_0xdd04('0xf')]);router[_0xdd04('0x10')](_0xdd04('0xc'),auth[_0xdd04('0x11')](),controller[_0xdd04('0x12')]);router[_0xdd04('0x13')](_0xdd04('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xdd04('0x14')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 5f6e7f7..cef4f0d 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 _0xf6e4=['DATE','STRING','moment','sequelize','exports'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0xf6e4,0x129));var _0x4f6e=function(_0xad3e3c,_0x263aab){_0xad3e3c=_0xad3e3c-0x0;var _0x33ab60=_0xf6e4[_0xad3e3c];return _0x33ab60;};'use strict';var moment=require(_0x4f6e('0x0'));var Sequelize=require(_0x4f6e('0x1'));module[_0x4f6e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4f6e('0x3')]},'leaveAt':{'type':Sequelize[_0x4f6e('0x3')]},'acceptAt':{'type':Sequelize[_0x4f6e('0x3')]},'exitAt':{'type':Sequelize[_0x4f6e('0x3')]},'reason':{'type':Sequelize[_0x4f6e('0x4')]}}; \ No newline at end of file +var _0x1be4=['exports','STRING','DATE','moment','sequelize'];(function(_0x4025b8,_0x2c1397){var _0x24ac0c=function(_0x59d1a1){while(--_0x59d1a1){_0x4025b8['push'](_0x4025b8['shift']());}};_0x24ac0c(++_0x2c1397);}(_0x1be4,0x198));var _0x41be=function(_0x484bf4,_0x2b975c){_0x484bf4=_0x484bf4-0x0;var _0x31c683=_0x1be4[_0x484bf4];return _0x31c683;};'use strict';var moment=require(_0x41be('0x0'));var Sequelize=require(_0x41be('0x1'));module[_0x41be('0x2')]={'uniqueid':{'type':Sequelize[_0x41be('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x41be('0x3')]},'joinAt':{'type':Sequelize[_0x41be('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x41be('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x41be('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 45ba043..570350c 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 _0x1f31=['describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','catch','show','params','find','create','body','destroy'];(function(_0x49fd23,_0x1ae00d){var _0x2c7e15=function(_0x43b26f){while(--_0x43b26f){_0x49fd23['push'](_0x49fd23['shift']());}};_0x2c7e15(++_0x1ae00d);}(_0x1f31,0x9b));var _0x11f3=function(_0x2cc594,_0x4d727b){_0x2cc594=_0x2cc594-0x0;var _0x4abff7=_0x1f31[_0x2cc594];return _0x4abff7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x11f3('0x0'));var zipdir=require(_0x11f3('0x1'));var jsonpatch=require(_0x11f3('0x2'));var rp=require(_0x11f3('0x3'));var moment=require(_0x11f3('0x4'));var BPromise=require(_0x11f3('0x5'));var Mustache=require(_0x11f3('0x6'));var util=require(_0x11f3('0x7'));var path=require(_0x11f3('0x8'));var sox=require(_0x11f3('0x9'));var csv=require('to-csv');var ejs=require(_0x11f3('0xa'));var fs=require('fs');var fs_extra=require(_0x11f3('0xb'));var _=require('lodash');var squel=require(_0x11f3('0xc'));var crypto=require('crypto');var jsforce=require(_0x11f3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x11f3('0xe'));var Redis=require(_0x11f3('0xf'));var authService=require(_0x11f3('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x11f3('0x11'));var hardwareService=require(_0x11f3('0x12'));var logger=require(_0x11f3('0x13'))('api');var utils=require(_0x11f3('0x14'));var config=require(_0x11f3('0x15'));var licenseUtil=require(_0x11f3('0x16'));var db=require(_0x11f3('0x17'))['db'];function respondWithStatusCode(_0x594e29,_0xcee214){_0xcee214=_0xcee214||0xcc;return function(_0x48f44e){if(_0x48f44e){return _0x594e29[_0x11f3('0x18')](_0xcee214);}return _0x594e29[_0x11f3('0x19')](_0xcee214)[_0x11f3('0x1a')]();};}function respondWithResult(_0xf3e7af,_0x23abb3){_0x23abb3=_0x23abb3||0xc8;return function(_0x105ce1){if(_0x105ce1){return _0xf3e7af[_0x11f3('0x19')](_0x23abb3)['json'](_0x105ce1);}};}function respondWithFilteredResult(_0x3bfa3e,_0x4b8ce2){return function(_0x14d47a){if(_0x14d47a){var _0x55527c=typeof _0x4b8ce2[_0x11f3('0x1b')]===_0x11f3('0x1c')&&typeof _0x4b8ce2[_0x11f3('0x1d')]===_0x11f3('0x1c');var _0x261639=_0x14d47a[_0x11f3('0x1e')];var _0x9c0ee9=_0x55527c?0x0:_0x4b8ce2[_0x11f3('0x1b')];var _0x39a964=_0x55527c?_0x14d47a['count']:_0x4b8ce2['offset']+_0x4b8ce2['limit'];var _0x24f4a1;if(_0x39a964>=_0x261639){_0x39a964=_0x261639;_0x24f4a1=0xc8;}else{_0x24f4a1=0xce;}_0x3bfa3e[_0x11f3('0x19')](_0x24f4a1);return _0x3bfa3e[_0x11f3('0x1f')](_0x11f3('0x20'),_0x9c0ee9+'-'+_0x39a964+'/'+_0x261639)[_0x11f3('0x21')](_0x14d47a);}return null;};}function patchUpdates(_0x335960){return function(_0x1f39f1){try{jsonpatch[_0x11f3('0x22')](_0x1f39f1,_0x335960,!![]);}catch(_0x10a342){return BPromise[_0x11f3('0x23')](_0x10a342);}return _0x1f39f1[_0x11f3('0x24')]();};}function saveUpdates(_0x4988a8,_0x2b4bfe){return function(_0x5b66f8){if(_0x5b66f8){return _0x5b66f8[_0x11f3('0x25')](_0x4988a8)['then'](function(_0x34bc5d){return _0x34bc5d;});}return null;};}function removeEntity(_0x2cb78b,_0x156c41){return function(_0x3ff6c1){if(_0x3ff6c1){return _0x3ff6c1['destroy']()[_0x11f3('0x26')](function(){_0x2cb78b[_0x11f3('0x19')](0xcc)[_0x11f3('0x1a')]();});}};}function handleEntityNotFound(_0x38fb97,_0x38a6e3){return function(_0x49af3b){if(!_0x49af3b){_0x38fb97[_0x11f3('0x18')](0x194);}return _0x49af3b;};}function handleError(_0x4c46a7,_0x241e16){_0x241e16=_0x241e16||0x1f4;return function(_0x4881fc){logger[_0x11f3('0x27')](_0x4881fc[_0x11f3('0x28')]);if(_0x4881fc[_0x11f3('0x29')]){delete _0x4881fc[_0x11f3('0x29')];}_0x4c46a7[_0x11f3('0x19')](_0x241e16)[_0x11f3('0x2a')](_0x4881fc);};}exports[_0x11f3('0x2b')]=function(_0x265bc4,_0x3778f7){var _0x5a8789={},_0x337edd={},_0x56dce6={'count':0x0,'rows':[]};var _0x194b37=_[_0x11f3('0x2c')](db[_0x11f3('0x2d')][_0x11f3('0x2e')],function(_0x4088d3){return{'name':_0x4088d3[_0x11f3('0x2f')],'type':_0x4088d3['type'][_0x11f3('0x30')]};});_0x337edd[_0x11f3('0x31')]=_[_0x11f3('0x2c')](_0x194b37,'name');_0x337edd[_0x11f3('0x32')]=_[_0x11f3('0x33')](_0x265bc4['query']);_0x337edd[_0x11f3('0x34')]=_['intersection'](_0x337edd[_0x11f3('0x31')],_0x337edd[_0x11f3('0x32')]);_0x5a8789[_0x11f3('0x35')]=_[_0x11f3('0x36')](_0x337edd[_0x11f3('0x31')],qs[_0x11f3('0x37')](_0x265bc4[_0x11f3('0x32')][_0x11f3('0x37')]));_0x5a8789[_0x11f3('0x35')]=_0x5a8789[_0x11f3('0x35')][_0x11f3('0x38')]?_0x5a8789[_0x11f3('0x35')]:_0x337edd[_0x11f3('0x31')];if(!_0x265bc4[_0x11f3('0x32')][_0x11f3('0x39')](_0x11f3('0x3a'))){_0x5a8789[_0x11f3('0x1d')]=qs[_0x11f3('0x1d')](_0x265bc4[_0x11f3('0x32')][_0x11f3('0x1d')]);_0x5a8789[_0x11f3('0x1b')]=qs[_0x11f3('0x1b')](_0x265bc4[_0x11f3('0x32')][_0x11f3('0x1b')]);}_0x5a8789['order']=qs[_0x11f3('0x3b')](_0x265bc4[_0x11f3('0x32')][_0x11f3('0x3b')]);_0x5a8789[_0x11f3('0x3c')]=qs['filters'](_[_0x11f3('0x3d')](_0x265bc4[_0x11f3('0x32')],_0x337edd['filters']),_0x194b37);if(_0x265bc4['query'][_0x11f3('0x3e')]){_0x5a8789[_0x11f3('0x3c')]=_[_0x11f3('0x3f')](_0x5a8789['where'],{'$or':_['map'](_0x194b37,function(_0x38c449){if(_0x38c449[_0x11f3('0x40')]!==_0x11f3('0x41')){var _0x2bb496={};_0x2bb496[_0x38c449[_0x11f3('0x29')]]={'$like':'%'+_0x265bc4[_0x11f3('0x32')][_0x11f3('0x3e')]+'%'};return _0x2bb496;}})});}_0x5a8789=_['merge']({},_0x5a8789,_0x265bc4['options']);var _0x45d845={'where':_0x5a8789[_0x11f3('0x3c')]};return db['OpenchannelQueueReport'][_0x11f3('0x1e')](_0x45d845)[_0x11f3('0x26')](function(_0x50bd8a){_0x56dce6[_0x11f3('0x1e')]=_0x50bd8a;if(_0x265bc4['query'][_0x11f3('0x42')]){_0x5a8789[_0x11f3('0x43')]=[{'all':!![]}];}return db[_0x11f3('0x2d')][_0x11f3('0x44')](_0x5a8789);})['then'](function(_0x333e58){_0x56dce6['rows']=_0x333e58;return _0x56dce6;})['then'](respondWithFilteredResult(_0x3778f7,_0x5a8789))[_0x11f3('0x45')](handleError(_0x3778f7,null));};exports[_0x11f3('0x46')]=function(_0x3e3ede,_0x301665){var _0x1c9a50={'raw':!![],'where':{'id':_0x3e3ede[_0x11f3('0x47')]['id']}},_0x12679b={};_0x12679b[_0x11f3('0x31')]=_['keys'](db[_0x11f3('0x2d')][_0x11f3('0x2e')]);_0x12679b[_0x11f3('0x32')]=_[_0x11f3('0x33')](_0x3e3ede[_0x11f3('0x32')]);_0x12679b['filters']=_['intersection'](_0x12679b[_0x11f3('0x31')],_0x12679b['query']);_0x1c9a50['attributes']=_[_0x11f3('0x36')](_0x12679b[_0x11f3('0x31')],qs['fields'](_0x3e3ede['query'][_0x11f3('0x37')]));_0x1c9a50[_0x11f3('0x35')]=_0x1c9a50[_0x11f3('0x35')]['length']?_0x1c9a50[_0x11f3('0x35')]:_0x12679b[_0x11f3('0x31')];if(_0x3e3ede['query'][_0x11f3('0x42')]){_0x1c9a50['include']=[{'all':!![]}];}_0x1c9a50=_[_0x11f3('0x3f')]({},_0x1c9a50,_0x3e3ede['options']);return db[_0x11f3('0x2d')][_0x11f3('0x48')](_0x1c9a50)['then'](handleEntityNotFound(_0x301665,null))[_0x11f3('0x26')](respondWithResult(_0x301665,null))[_0x11f3('0x45')](handleError(_0x301665,null));};exports[_0x11f3('0x49')]=function(_0x25b3ea,_0x15d137){return db['OpenchannelQueueReport'][_0x11f3('0x49')](_0x25b3ea[_0x11f3('0x4a')],{})['then'](respondWithResult(_0x15d137,0xc9))[_0x11f3('0x45')](handleError(_0x15d137,null));};exports[_0x11f3('0x25')]=function(_0x286a2b,_0x1f5977){if(_0x286a2b['body']['id']){delete _0x286a2b[_0x11f3('0x4a')]['id'];}return db[_0x11f3('0x2d')][_0x11f3('0x48')]({'where':{'id':_0x286a2b[_0x11f3('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f5977,null))['then'](saveUpdates(_0x286a2b[_0x11f3('0x4a')],null))[_0x11f3('0x26')](respondWithResult(_0x1f5977,null))[_0x11f3('0x45')](handleError(_0x1f5977,null));};exports[_0x11f3('0x4b')]=function(_0x26798e,_0x472035){return db[_0x11f3('0x2d')][_0x11f3('0x48')]({'where':{'id':_0x26798e['params']['id']}})[_0x11f3('0x26')](handleEntityNotFound(_0x472035,null))[_0x11f3('0x26')](removeEntity(_0x472035,null))[_0x11f3('0x45')](handleError(_0x472035,null));};exports[_0x11f3('0x4c')]=function(_0x307bb0,_0x117e62){return db[_0x11f3('0x2d')][_0x11f3('0x4c')]()[_0x11f3('0x26')](respondWithResult(_0x117e62,null))['catch'](handleError(_0x117e62,null));}; \ No newline at end of file +var _0xc8fa=['end','status','offset','undefined','count','limit','set','Content-Range','json','reject','save','update','name','send','index','OpenchannelQueueReport','fieldName','model','map','keys','query','intersection','attributes','length','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','then','include','findAll','rows','catch','show','rawAttributes','fields','includeAll','find','create','body','params','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x15a996,_0x2fda19){var _0xccb501=function(_0x49471e){while(--_0x49471e){_0x15a996['push'](_0x15a996['shift']());}};_0xccb501(++_0x2fda19);}(_0xc8fa,0x159));var _0xac8f=function(_0x442e64,_0x552e29){_0x442e64=_0x442e64-0x0;var _0x107c16=_0xc8fa[_0x442e64];return _0x107c16;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xac8f('0x0'));var zipdir=require(_0xac8f('0x1'));var jsonpatch=require(_0xac8f('0x2'));var rp=require(_0xac8f('0x3'));var moment=require(_0xac8f('0x4'));var BPromise=require(_0xac8f('0x5'));var Mustache=require('mustache');var util=require(_0xac8f('0x6'));var path=require(_0xac8f('0x7'));var sox=require(_0xac8f('0x8'));var csv=require(_0xac8f('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac8f('0xa'));var _=require(_0xac8f('0xb'));var squel=require(_0xac8f('0xc'));var crypto=require('crypto');var jsforce=require(_0xac8f('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xac8f('0x9'));var querystring=require(_0xac8f('0xe'));var Papa=require('papaparse');var Redis=require(_0xac8f('0xf'));var authService=require(_0xac8f('0x10'));var qs=require(_0xac8f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac8f('0x12'));var logger=require(_0xac8f('0x13'))(_0xac8f('0x14'));var utils=require(_0xac8f('0x15'));var config=require(_0xac8f('0x16'));var licenseUtil=require(_0xac8f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x333f39,_0x1151e3){_0x1151e3=_0x1151e3||0xcc;return function(_0xf44895){if(_0xf44895){return _0x333f39[_0xac8f('0x18')](_0x1151e3);}return _0x333f39['status'](_0x1151e3)[_0xac8f('0x19')]();};}function respondWithResult(_0x5bb218,_0x194ef7){_0x194ef7=_0x194ef7||0xc8;return function(_0x4e2863){if(_0x4e2863){return _0x5bb218[_0xac8f('0x1a')](_0x194ef7)['json'](_0x4e2863);}};}function respondWithFilteredResult(_0x365c87,_0x18ab25){return function(_0x4f63f4){if(_0x4f63f4){var _0x2c2102=typeof _0x18ab25[_0xac8f('0x1b')]==='undefined'&&typeof _0x18ab25['limit']===_0xac8f('0x1c');var _0x490c0f=_0x4f63f4[_0xac8f('0x1d')];var _0x31584d=_0x2c2102?0x0:_0x18ab25[_0xac8f('0x1b')];var _0x3638a1=_0x2c2102?_0x4f63f4[_0xac8f('0x1d')]:_0x18ab25[_0xac8f('0x1b')]+_0x18ab25[_0xac8f('0x1e')];var _0x2f9374;if(_0x3638a1>=_0x490c0f){_0x3638a1=_0x490c0f;_0x2f9374=0xc8;}else{_0x2f9374=0xce;}_0x365c87['status'](_0x2f9374);return _0x365c87[_0xac8f('0x1f')](_0xac8f('0x20'),_0x31584d+'-'+_0x3638a1+'/'+_0x490c0f)[_0xac8f('0x21')](_0x4f63f4);}return null;};}function patchUpdates(_0x11dc4a){return function(_0x19c0c2){try{jsonpatch['apply'](_0x19c0c2,_0x11dc4a,!![]);}catch(_0xf54ede){return BPromise[_0xac8f('0x22')](_0xf54ede);}return _0x19c0c2[_0xac8f('0x23')]();};}function saveUpdates(_0x1fb923,_0x3f86f7){return function(_0x93a86f){if(_0x93a86f){return _0x93a86f[_0xac8f('0x24')](_0x1fb923)['then'](function(_0xf0e10c){return _0xf0e10c;});}return null;};}function removeEntity(_0x4ff6ce,_0x2d2f1d){return function(_0x5d3419){if(_0x5d3419){return _0x5d3419['destroy']()['then'](function(){_0x4ff6ce[_0xac8f('0x1a')](0xcc)[_0xac8f('0x19')]();});}};}function handleEntityNotFound(_0x5287b7,_0x3588b0){return function(_0x37c058){if(!_0x37c058){_0x5287b7[_0xac8f('0x18')](0x194);}return _0x37c058;};}function handleError(_0x3e6ef5,_0x58af97){_0x58af97=_0x58af97||0x1f4;return function(_0xfdf368){logger['error'](_0xfdf368['stack']);if(_0xfdf368[_0xac8f('0x25')]){delete _0xfdf368[_0xac8f('0x25')];}_0x3e6ef5[_0xac8f('0x1a')](_0x58af97)[_0xac8f('0x26')](_0xfdf368);};}exports[_0xac8f('0x27')]=function(_0x2846f2,_0x543e66){var _0x1fc502={},_0x2175aa={},_0x3d8e19={'count':0x0,'rows':[]};var _0x334c37=_['map'](db[_0xac8f('0x28')]['rawAttributes'],function(_0x38228d){return{'name':_0x38228d[_0xac8f('0x29')],'type':_0x38228d['type']['key']};});_0x2175aa[_0xac8f('0x2a')]=_[_0xac8f('0x2b')](_0x334c37,_0xac8f('0x25'));_0x2175aa['query']=_[_0xac8f('0x2c')](_0x2846f2[_0xac8f('0x2d')]);_0x2175aa['filters']=_[_0xac8f('0x2e')](_0x2175aa[_0xac8f('0x2a')],_0x2175aa[_0xac8f('0x2d')]);_0x1fc502['attributes']=_[_0xac8f('0x2e')](_0x2175aa['model'],qs['fields'](_0x2846f2[_0xac8f('0x2d')]['fields']));_0x1fc502[_0xac8f('0x2f')]=_0x1fc502['attributes'][_0xac8f('0x30')]?_0x1fc502[_0xac8f('0x2f')]:_0x2175aa['model'];if(!_0x2846f2[_0xac8f('0x2d')]['hasOwnProperty']('nolimit')){_0x1fc502[_0xac8f('0x1e')]=qs[_0xac8f('0x1e')](_0x2846f2[_0xac8f('0x2d')][_0xac8f('0x1e')]);_0x1fc502[_0xac8f('0x1b')]=qs['offset'](_0x2846f2[_0xac8f('0x2d')][_0xac8f('0x1b')]);}_0x1fc502[_0xac8f('0x31')]=qs['sort'](_0x2846f2[_0xac8f('0x2d')][_0xac8f('0x32')]);_0x1fc502[_0xac8f('0x33')]=qs[_0xac8f('0x34')](_[_0xac8f('0x35')](_0x2846f2['query'],_0x2175aa[_0xac8f('0x34')]),_0x334c37);if(_0x2846f2[_0xac8f('0x2d')][_0xac8f('0x36')]){_0x1fc502['where']=_[_0xac8f('0x37')](_0x1fc502[_0xac8f('0x33')],{'$or':_['map'](_0x334c37,function(_0x1a4546){if(_0x1a4546[_0xac8f('0x38')]!==_0xac8f('0x39')){var _0x1c59da={};_0x1c59da[_0x1a4546[_0xac8f('0x25')]]={'$like':'%'+_0x2846f2[_0xac8f('0x2d')][_0xac8f('0x36')]+'%'};return _0x1c59da;}})});}_0x1fc502=_[_0xac8f('0x37')]({},_0x1fc502,_0x2846f2[_0xac8f('0x3a')]);var _0x3cf8e1={'where':_0x1fc502['where']};return db['OpenchannelQueueReport'][_0xac8f('0x1d')](_0x3cf8e1)[_0xac8f('0x3b')](function(_0x3d8019){_0x3d8e19[_0xac8f('0x1d')]=_0x3d8019;if(_0x2846f2[_0xac8f('0x2d')]['includeAll']){_0x1fc502[_0xac8f('0x3c')]=[{'all':!![]}];}return db['OpenchannelQueueReport'][_0xac8f('0x3d')](_0x1fc502);})[_0xac8f('0x3b')](function(_0x11a81b){_0x3d8e19[_0xac8f('0x3e')]=_0x11a81b;return _0x3d8e19;})[_0xac8f('0x3b')](respondWithFilteredResult(_0x543e66,_0x1fc502))[_0xac8f('0x3f')](handleError(_0x543e66,null));};exports[_0xac8f('0x40')]=function(_0xd21f5c,_0x498f60){var _0x4d2c2b={'raw':!![],'where':{'id':_0xd21f5c['params']['id']}},_0x32b1a7={};_0x32b1a7[_0xac8f('0x2a')]=_['keys'](db[_0xac8f('0x28')][_0xac8f('0x41')]);_0x32b1a7[_0xac8f('0x2d')]=_[_0xac8f('0x2c')](_0xd21f5c['query']);_0x32b1a7[_0xac8f('0x34')]=_[_0xac8f('0x2e')](_0x32b1a7[_0xac8f('0x2a')],_0x32b1a7[_0xac8f('0x2d')]);_0x4d2c2b[_0xac8f('0x2f')]=_[_0xac8f('0x2e')](_0x32b1a7[_0xac8f('0x2a')],qs[_0xac8f('0x42')](_0xd21f5c[_0xac8f('0x2d')]['fields']));_0x4d2c2b[_0xac8f('0x2f')]=_0x4d2c2b[_0xac8f('0x2f')][_0xac8f('0x30')]?_0x4d2c2b['attributes']:_0x32b1a7['model'];if(_0xd21f5c[_0xac8f('0x2d')][_0xac8f('0x43')]){_0x4d2c2b['include']=[{'all':!![]}];}_0x4d2c2b=_[_0xac8f('0x37')]({},_0x4d2c2b,_0xd21f5c['options']);return db[_0xac8f('0x28')][_0xac8f('0x44')](_0x4d2c2b)[_0xac8f('0x3b')](handleEntityNotFound(_0x498f60,null))[_0xac8f('0x3b')](respondWithResult(_0x498f60,null))[_0xac8f('0x3f')](handleError(_0x498f60,null));};exports[_0xac8f('0x45')]=function(_0x5184f0,_0x23f059){return db[_0xac8f('0x28')][_0xac8f('0x45')](_0x5184f0['body'],{})[_0xac8f('0x3b')](respondWithResult(_0x23f059,0xc9))['catch'](handleError(_0x23f059,null));};exports['update']=function(_0x4d4e91,_0x382288){if(_0x4d4e91[_0xac8f('0x46')]['id']){delete _0x4d4e91[_0xac8f('0x46')]['id'];}return db['OpenchannelQueueReport'][_0xac8f('0x44')]({'where':{'id':_0x4d4e91[_0xac8f('0x47')]['id']}})[_0xac8f('0x3b')](handleEntityNotFound(_0x382288,null))[_0xac8f('0x3b')](saveUpdates(_0x4d4e91[_0xac8f('0x46')],null))['then'](respondWithResult(_0x382288,null))['catch'](handleError(_0x382288,null));};exports[_0xac8f('0x48')]=function(_0x399b5f,_0x14ae3d){return db['OpenchannelQueueReport'][_0xac8f('0x44')]({'where':{'id':_0x399b5f[_0xac8f('0x47')]['id']}})[_0xac8f('0x3b')](handleEntityNotFound(_0x14ae3d,null))['then'](removeEntity(_0x14ae3d,null))[_0xac8f('0x3f')](handleError(_0x14ae3d,null));};exports[_0xac8f('0x49')]=function(_0x3ebbae,_0x341417){return db[_0xac8f('0x28')]['describe']()[_0xac8f('0x3b')](respondWithResult(_0x341417,null))[_0xac8f('0x3f')](handleError(_0x341417,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index ad01334..314d09b 100644 --- a/server/api/openchannelQueueReport/openchannelQueueReport.model.js +++ b/server/api/openchannelQueueReport/openchannelQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['bluebird','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','moment'];(function(_0x203ffd,_0x2a2baf){var _0x34bdb8=function(_0x243fe1){while(--_0x243fe1){_0x203ffd['push'](_0x203ffd['shift']());}};_0x34bdb8(++_0x2a2baf);}(_0xe14b,0x93));var _0xbe14=function(_0x492984,_0x50cd48){_0x492984=_0x492984-0x0;var _0x3c24d7=_0xe14b[_0x492984];return _0x3c24d7;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x3e9c52,_0xa9d6f1){var _0x53ba19=function(_0x5e6631){while(--_0x5e6631){_0x3e9c52['push'](_0x3e9c52['shift']());}};_0x53ba19(++_0xa9d6f1);}(_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'));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 7a91b20..468186c 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 _0xa7fa=['info','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','update','raw','where','limit','UpdateOpenchannelQueueReport','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5ea030,_0x4b0f71){var _0xfaa477=function(_0x35259e){while(--_0x35259e){_0x5ea030['push'](_0x5ea030['shift']());}};_0xfaa477(++_0x4b0f71);}(_0xa7fa,0xfc));var _0xaa7f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa7fa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xaa7f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa7f('0x1'));var rs=require(_0xaa7f('0x2'));var fs=require('fs');var Redis=require(_0xaa7f('0x3'));var db=require(_0xaa7f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaa7f('0x5'))(_0xaa7f('0x6'));var config=require(_0xaa7f('0x7'));var jayson=require(_0xaa7f('0x8'));var client=jayson['client'][_0xaa7f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48105b,_0x50bab6,_0x3898a3){return new BPromise(function(_0x506a91,_0x3ac236){return client[_0xaa7f('0xa')](_0x48105b,_0x3898a3)[_0xaa7f('0xb')](function(_0x2dbcb6){logger['info'](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));logger['debug'](_0xaa7f('0xe'),_0x50bab6,_0xaa7f('0xd'),JSON[_0xaa7f('0xf')](_0x2dbcb6));if(_0x2dbcb6[_0xaa7f('0x10')]){if(_0x2dbcb6['error']['code']===0x1f4){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);return _0x3ac236(_0x2dbcb6[_0xaa7f('0x10')][_0xaa7f('0x11')]);}logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x2dbcb6[_0xaa7f('0x10')]['message']);return _0x506a91(_0x2dbcb6[_0xaa7f('0x10')]['message']);}else{logger[_0xaa7f('0x12')](_0xaa7f('0xc'),_0x50bab6,_0xaa7f('0xd'));_0x506a91(_0x2dbcb6['result'][_0xaa7f('0x11')]);}})[_0xaa7f('0x13')](function(_0x1bd3f9){logger[_0xaa7f('0x10')](_0xaa7f('0xc'),_0x50bab6,_0x1bd3f9);_0x3ac236(_0x1bd3f9);});});}exports[_0xaa7f('0x14')]=function(_0x2c17c4){var _0x4fbd09=this;return new Promise(function(_0x90863a,_0x1e18a6){return db[_0xaa7f('0x15')][_0xaa7f('0x16')](_0x2c17c4['body'],{'raw':_0x2c17c4['options']?_0x2c17c4[_0xaa7f('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xaa7f('0xb')](function(_0x21e870){logger['info'](_0xaa7f('0x14'),_0x2c17c4);logger['debug'](_0xaa7f('0x14'),_0x2c17c4,JSON[_0xaa7f('0xf')](_0x21e870));_0x90863a(_0x21e870);})[_0xaa7f('0x13')](function(_0x516d7e){logger[_0xaa7f('0x10')](_0xaa7f('0x14'),_0x516d7e[_0xaa7f('0x11')],_0x2c17c4);_0x1e18a6(_0x4fbd09[_0xaa7f('0x10')](0x1f4,_0x516d7e['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x28d627){var _0x3effde=this;return new Promise(function(_0x3076f4,_0x246a18){return db[_0xaa7f('0x15')][_0xaa7f('0x18')](_0x28d627['body'],{'raw':_0x28d627['options']?_0x28d627['options'][_0xaa7f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28d627['options']?_0x28d627[_0xaa7f('0x17')][_0xaa7f('0x1a')]||null:null,'attributes':_0x28d627['options']?_0x28d627[_0xaa7f('0x17')]['attributes']||null:null,'limit':_0x28d627[_0xaa7f('0x17')]?_0x28d627[_0xaa7f('0x17')][_0xaa7f('0x1b')]||null:null})[_0xaa7f('0xb')](function(_0x223321){logger['info'](_0xaa7f('0x1c'),_0x28d627);logger[_0xaa7f('0x1d')](_0xaa7f('0x1c'),_0x28d627,JSON['stringify'](_0x223321));_0x3076f4(_0x223321);})[_0xaa7f('0x13')](function(_0x1b17e2){logger[_0xaa7f('0x10')](_0xaa7f('0x1c'),_0x1b17e2[_0xaa7f('0x11')],_0x28d627);_0x246a18(_0x3effde[_0xaa7f('0x10')](0x1f4,_0x1b17e2['message']));});});}; \ No newline at end of file +var _0xae60=['rpc','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','UpdateOpenchannelQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xae60,0x1c7));var _0x0ae6=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xae60[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0x0ae6('0x0'));var util=require(_0x0ae6('0x1'));var moment=require(_0x0ae6('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ae6('0x3'));var fs=require('fs');var Redis=require(_0x0ae6('0x4'));var db=require(_0x0ae6('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0ae6('0x6'))(_0x0ae6('0x7'));var config=require('../../config/environment');var jayson=require(_0x0ae6('0x8'));var client=jayson[_0x0ae6('0x9')][_0x0ae6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x46fed4,_0xbb596c,_0x447a1d){return new BPromise(function(_0x120910,_0x1b5e80){return client['request'](_0x46fed4,_0x447a1d)[_0x0ae6('0xb')](function(_0x36a5e0){logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,'request\x20sent');logger[_0x0ae6('0xe')](_0x0ae6('0xf'),_0xbb596c,_0x0ae6('0x10'),JSON[_0x0ae6('0x11')](_0x36a5e0));if(_0x36a5e0[_0x0ae6('0x12')]){if(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x13')]===0x1f4){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x1b5e80(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}logger[_0x0ae6('0x12')]('OpenchannelQueueReport,\x20%s,\x20%s',_0xbb596c,_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);return _0x120910(_0x36a5e0[_0x0ae6('0x12')][_0x0ae6('0x14')]);}else{logger[_0x0ae6('0xc')](_0x0ae6('0xd'),_0xbb596c,_0x0ae6('0x10'));_0x120910(_0x36a5e0[_0x0ae6('0x15')][_0x0ae6('0x14')]);}})[_0x0ae6('0x16')](function(_0x8a4c9a){logger[_0x0ae6('0x12')](_0x0ae6('0xd'),_0xbb596c,_0x8a4c9a);_0x1b5e80(_0x8a4c9a);});});}exports[_0x0ae6('0x17')]=function(_0xda4f01){var _0x3f5c41=this;return new Promise(function(_0x2fdf25,_0x1735ba){return db[_0x0ae6('0x18')][_0x0ae6('0x19')](_0xda4f01[_0x0ae6('0x1a')],{'raw':_0xda4f01[_0x0ae6('0x1b')]?_0xda4f01['options'][_0x0ae6('0x1c')]===undefined?!![]:![]:!![]})[_0x0ae6('0xb')](function(_0x140a3b){logger[_0x0ae6('0xc')](_0x0ae6('0x17'),_0xda4f01);logger[_0x0ae6('0xe')](_0x0ae6('0x17'),_0xda4f01,JSON[_0x0ae6('0x11')](_0x140a3b));_0x2fdf25(_0x140a3b);})['catch'](function(_0x39b22e){logger[_0x0ae6('0x12')](_0x0ae6('0x17'),_0x39b22e[_0x0ae6('0x14')],_0xda4f01);_0x1735ba(_0x3f5c41[_0x0ae6('0x12')](0x1f4,_0x39b22e['message']));});});};exports[_0x0ae6('0x1d')]=function(_0x4e1242){var _0xccd1c5=this;return new Promise(function(_0x3955d8,_0x3c43d8){return db[_0x0ae6('0x18')]['update'](_0x4e1242[_0x0ae6('0x1a')],{'raw':_0x4e1242[_0x0ae6('0x1b')]?_0x4e1242['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e1242[_0x0ae6('0x1b')]?_0x4e1242[_0x0ae6('0x1b')][_0x0ae6('0x1e')]||null:null,'attributes':_0x4e1242['options']?_0x4e1242[_0x0ae6('0x1b')][_0x0ae6('0x1f')]||null:null,'limit':_0x4e1242[_0x0ae6('0x1b')]?_0x4e1242['options'][_0x0ae6('0x20')]||null:null})[_0x0ae6('0xb')](function(_0x449c33){logger[_0x0ae6('0xc')](_0x0ae6('0x1d'),_0x4e1242);logger[_0x0ae6('0xe')]('UpdateOpenchannelQueueReport',_0x4e1242,JSON['stringify'](_0x449c33));_0x3955d8(_0x449c33);})[_0x0ae6('0x16')](function(_0x419384){logger['error']('UpdateOpenchannelQueueReport',_0x419384[_0x0ae6('0x14')],_0x4e1242);_0x3c43d8(_0xccd1c5[_0x0ae6('0x12')](0x1f4,_0x419384[_0x0ae6('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 79b7c98..2672d40 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 _0x923c=['../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','update','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1c942f,_0x1de7e6){var _0x1c9ac9=function(_0x3f330a){while(--_0x3f330a){_0x1c942f['push'](_0x1c942f['shift']());}};_0x1c9ac9(++_0x1de7e6);}(_0x923c,0x93));var _0xc923=function(_0x204834,_0x28b373){_0x204834=_0x204834-0x0;var _0x1614c5=_0x923c[_0x204834];return _0x1614c5;};'use strict';var multer=require(_0xc923('0x0'));var util=require(_0xc923('0x1'));var path=require(_0xc923('0x2'));var timeout=require('connect-timeout');var express=require(_0xc923('0x3'));var router=express[_0xc923('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xc923('0x5'));var interaction=require(_0xc923('0x6'));var config=require(_0xc923('0x7'));var controller=require(_0xc923('0x8'));router[_0xc923('0x9')]('/',auth[_0xc923('0xa')](),controller[_0xc923('0xb')]);router[_0xc923('0x9')](_0xc923('0xc'),auth[_0xc923('0xa')](),controller[_0xc923('0xd')]);router[_0xc923('0x9')]('/:id',auth[_0xc923('0xa')](),controller[_0xc923('0xe')]);router[_0xc923('0xf')]('/',auth[_0xc923('0xa')](),controller[_0xc923('0x10')]);router['put']('/:id',auth[_0xc923('0xa')](),controller[_0xc923('0x11')]);router[_0xc923('0x12')](_0xc923('0x13'),auth[_0xc923('0xa')](),controller[_0xc923('0x14')]);module[_0xc923('0x15')]=router; \ No newline at end of file +var _0x51c9=['/:id','delete','destroy','exports','multer','util','fs-extra','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','show','post','put'];(function(_0x27e902,_0xf85733){var _0x5146f8=function(_0x33484b){while(--_0x33484b){_0x27e902['push'](_0x27e902['shift']());}};_0x5146f8(++_0xf85733);}(_0x51c9,0x144));var _0x951c=function(_0x952c5d,_0x22319f){_0x952c5d=_0x952c5d-0x0;var _0x159fd8=_0x51c9[_0x952c5d];return _0x159fd8;};'use strict';var multer=require(_0x951c('0x0'));var util=require(_0x951c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x951c('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x951c('0x3'));var config=require('../../config/environment');var controller=require('./openchannelTransferReport.controller');router[_0x951c('0x4')]('/',auth[_0x951c('0x5')](),controller[_0x951c('0x6')]);router['get'](_0x951c('0x7'),auth[_0x951c('0x5')](),controller[_0x951c('0x8')]);router['get']('/:id',auth[_0x951c('0x5')](),controller[_0x951c('0x9')]);router[_0x951c('0xa')]('/',auth[_0x951c('0x5')](),controller['create']);router[_0x951c('0xb')](_0x951c('0xc'),auth[_0x951c('0x5')](),controller['update']);router[_0x951c('0xd')](_0x951c('0xc'),auth[_0x951c('0x5')](),controller[_0x951c('0xe')]);module[_0x951c('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index 0e6c9d4..8fe4bfe 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(_0x580730,_0x423233){var _0xf5629a=function(_0x5f3d05){while(--_0x5f3d05){_0x580730['push'](_0x580730['shift']());}};_0xf5629a(++_0x423233);}(_0x008c,0x188));var _0xc008=function(_0x2ae22a,_0x4fe753){_0x2ae22a=_0x2ae22a-0x0;var _0x286a82=_0x008c[_0x2ae22a];return _0x286a82;};'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 _0x34e8=['queue','DATE','NOW','moment','sequelize','exports','STRING','account','agent'];(function(_0x3572b3,_0x593ffe){var _0x55e4aa=function(_0x5a6b53){while(--_0x5a6b53){_0x3572b3['push'](_0x3572b3['shift']());}};_0x55e4aa(++_0x593ffe);}(_0x34e8,0x12c));var _0x834e=function(_0x3366d7,_0x79eac9){_0x3366d7=_0x3366d7-0x0;var _0x96a769=_0x34e8[_0x3366d7];return _0x96a769;};'use strict';var moment=require(_0x834e('0x0'));var Sequelize=require(_0x834e('0x1'));module[_0x834e('0x2')]={'uniqueid':{'type':Sequelize[_0x834e('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x834e('0x4'),_0x834e('0x5'),_0x834e('0x6')),'allowNull':![],'defaultValue':_0x834e('0x6')},'transferredAt':{'type':Sequelize[_0x834e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x834e('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 5bd2b78..fc329af 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 _0x6d77=['length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','keys','find','create','update','body','describe','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields'];(function(_0x4790c1,_0x4d7f45){var _0x49ca90=function(_0x486afa){while(--_0x486afa){_0x4790c1['push'](_0x4790c1['shift']());}};_0x49ca90(++_0x4d7f45);}(_0x6d77,0x13c));var _0x76d7=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x6d77[_0xfae23b];return _0x200640;};'use strict';var emlformat=require(_0x76d7('0x0'));var rimraf=require(_0x76d7('0x1'));var zipdir=require(_0x76d7('0x2'));var jsonpatch=require(_0x76d7('0x3'));var rp=require(_0x76d7('0x4'));var moment=require(_0x76d7('0x5'));var BPromise=require(_0x76d7('0x6'));var Mustache=require(_0x76d7('0x7'));var util=require(_0x76d7('0x8'));var path=require(_0x76d7('0x9'));var sox=require('sox');var csv=require(_0x76d7('0xa'));var ejs=require(_0x76d7('0xb'));var fs=require('fs');var fs_extra=require(_0x76d7('0xc'));var _=require(_0x76d7('0xd'));var squel=require(_0x76d7('0xe'));var crypto=require(_0x76d7('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x76d7('0x10'));var toCsv=require(_0x76d7('0xa'));var querystring=require(_0x76d7('0x11'));var Papa=require(_0x76d7('0x12'));var Redis=require(_0x76d7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x76d7('0x14'))(_0x76d7('0x15'));var utils=require(_0x76d7('0x16'));var config=require(_0x76d7('0x17'));var licenseUtil=require(_0x76d7('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10637b,_0x733e91){_0x733e91=_0x733e91||0xcc;return function(_0x3bf6a7){if(_0x3bf6a7){return _0x10637b[_0x76d7('0x19')](_0x733e91);}return _0x10637b[_0x76d7('0x1a')](_0x733e91)[_0x76d7('0x1b')]();};}function respondWithResult(_0x4258f3,_0x3485b6){_0x3485b6=_0x3485b6||0xc8;return function(_0x1ad0f6){if(_0x1ad0f6){return _0x4258f3[_0x76d7('0x1a')](_0x3485b6)[_0x76d7('0x1c')](_0x1ad0f6);}};}function respondWithFilteredResult(_0x469b02,_0x247697){return function(_0x826ac){if(_0x826ac){var _0x30a00c=typeof _0x247697[_0x76d7('0x1d')]===_0x76d7('0x1e')&&typeof _0x247697[_0x76d7('0x1f')]===_0x76d7('0x1e');var _0x11f28c=_0x826ac[_0x76d7('0x20')];var _0xead0b=_0x30a00c?0x0:_0x247697[_0x76d7('0x1d')];var _0x5681ec=_0x30a00c?_0x826ac['count']:_0x247697[_0x76d7('0x1d')]+_0x247697['limit'];var _0x1cbfac;if(_0x5681ec>=_0x11f28c){_0x5681ec=_0x11f28c;_0x1cbfac=0xc8;}else{_0x1cbfac=0xce;}_0x469b02[_0x76d7('0x1a')](_0x1cbfac);return _0x469b02[_0x76d7('0x21')](_0x76d7('0x22'),_0xead0b+'-'+_0x5681ec+'/'+_0x11f28c)[_0x76d7('0x1c')](_0x826ac);}return null;};}function patchUpdates(_0x210c1f){return function(_0x3f2ed6){try{jsonpatch[_0x76d7('0x23')](_0x3f2ed6,_0x210c1f,!![]);}catch(_0x46f42a){return BPromise[_0x76d7('0x24')](_0x46f42a);}return _0x3f2ed6['save']();};}function saveUpdates(_0x4f1a4d,_0x3768fa){return function(_0x32012d){if(_0x32012d){return _0x32012d['update'](_0x4f1a4d)[_0x76d7('0x25')](function(_0x17755e){return _0x17755e;});}return null;};}function removeEntity(_0x293565,_0x12d323){return function(_0x55e952){if(_0x55e952){return _0x55e952[_0x76d7('0x26')]()[_0x76d7('0x25')](function(){_0x293565[_0x76d7('0x1a')](0xcc)[_0x76d7('0x1b')]();});}};}function handleEntityNotFound(_0x4064f6,_0x472b9f){return function(_0x4454ad){if(!_0x4454ad){_0x4064f6[_0x76d7('0x19')](0x194);}return _0x4454ad;};}function handleError(_0x432d2a,_0x5917b8){_0x5917b8=_0x5917b8||0x1f4;return function(_0x19ea1a){logger[_0x76d7('0x27')](_0x19ea1a['stack']);if(_0x19ea1a[_0x76d7('0x28')]){delete _0x19ea1a['name'];}_0x432d2a[_0x76d7('0x1a')](_0x5917b8)[_0x76d7('0x29')](_0x19ea1a);};}exports[_0x76d7('0x2a')]=function(_0x5601e6,_0x1c6901){var _0x4ddfb5={},_0x1fe232={},_0x1a0174={'count':0x0,'rows':[]};var _0x3908dd=_[_0x76d7('0x2b')](db[_0x76d7('0x2c')][_0x76d7('0x2d')],function(_0x3f1d36){return{'name':_0x3f1d36['fieldName'],'type':_0x3f1d36[_0x76d7('0x2e')][_0x76d7('0x2f')]};});_0x1fe232[_0x76d7('0x30')]=_[_0x76d7('0x2b')](_0x3908dd,_0x76d7('0x28'));_0x1fe232[_0x76d7('0x31')]=_['keys'](_0x5601e6['query']);_0x1fe232[_0x76d7('0x32')]=_['intersection'](_0x1fe232['model'],_0x1fe232[_0x76d7('0x31')]);_0x4ddfb5[_0x76d7('0x33')]=_[_0x76d7('0x34')](_0x1fe232[_0x76d7('0x30')],qs[_0x76d7('0x35')](_0x5601e6['query'][_0x76d7('0x35')]));_0x4ddfb5[_0x76d7('0x33')]=_0x4ddfb5['attributes'][_0x76d7('0x36')]?_0x4ddfb5['attributes']:_0x1fe232[_0x76d7('0x30')];if(!_0x5601e6[_0x76d7('0x31')]['hasOwnProperty'](_0x76d7('0x37'))){_0x4ddfb5[_0x76d7('0x1f')]=qs[_0x76d7('0x1f')](_0x5601e6['query'][_0x76d7('0x1f')]);_0x4ddfb5['offset']=qs[_0x76d7('0x1d')](_0x5601e6['query'][_0x76d7('0x1d')]);}_0x4ddfb5[_0x76d7('0x38')]=qs['sort'](_0x5601e6[_0x76d7('0x31')]['sort']);_0x4ddfb5['where']=qs[_0x76d7('0x32')](_[_0x76d7('0x39')](_0x5601e6[_0x76d7('0x31')],_0x1fe232[_0x76d7('0x32')]),_0x3908dd);if(_0x5601e6[_0x76d7('0x31')][_0x76d7('0x3a')]){_0x4ddfb5[_0x76d7('0x3b')]=_[_0x76d7('0x3c')](_0x4ddfb5['where'],{'$or':_[_0x76d7('0x2b')](_0x3908dd,function(_0x1c78f0){if(_0x1c78f0[_0x76d7('0x2e')]!==_0x76d7('0x3d')){var _0x2bfd43={};_0x2bfd43[_0x1c78f0[_0x76d7('0x28')]]={'$like':'%'+_0x5601e6['query'][_0x76d7('0x3a')]+'%'};return _0x2bfd43;}})});}_0x4ddfb5=_['merge']({},_0x4ddfb5,_0x5601e6[_0x76d7('0x3e')]);var _0x4b87a7={'where':_0x4ddfb5[_0x76d7('0x3b')]};return db[_0x76d7('0x2c')]['count'](_0x4b87a7)['then'](function(_0x537501){_0x1a0174[_0x76d7('0x20')]=_0x537501;if(_0x5601e6[_0x76d7('0x31')][_0x76d7('0x3f')]){_0x4ddfb5['include']=[{'all':!![]}];}return db[_0x76d7('0x2c')]['findAll'](_0x4ddfb5);})[_0x76d7('0x25')](function(_0x231634){_0x1a0174[_0x76d7('0x40')]=_0x231634;return _0x1a0174;})[_0x76d7('0x25')](respondWithFilteredResult(_0x1c6901,_0x4ddfb5))[_0x76d7('0x41')](handleError(_0x1c6901,null));};exports[_0x76d7('0x42')]=function(_0x211771,_0x1ad781){var _0x2d5bb5={'raw':!![],'where':{'id':_0x211771[_0x76d7('0x43')]['id']}},_0x474bb2={};_0x474bb2[_0x76d7('0x30')]=_[_0x76d7('0x44')](db[_0x76d7('0x2c')][_0x76d7('0x2d')]);_0x474bb2['query']=_[_0x76d7('0x44')](_0x211771[_0x76d7('0x31')]);_0x474bb2[_0x76d7('0x32')]=_[_0x76d7('0x34')](_0x474bb2[_0x76d7('0x30')],_0x474bb2['query']);_0x2d5bb5[_0x76d7('0x33')]=_[_0x76d7('0x34')](_0x474bb2[_0x76d7('0x30')],qs[_0x76d7('0x35')](_0x211771[_0x76d7('0x31')]['fields']));_0x2d5bb5[_0x76d7('0x33')]=_0x2d5bb5[_0x76d7('0x33')][_0x76d7('0x36')]?_0x2d5bb5[_0x76d7('0x33')]:_0x474bb2[_0x76d7('0x30')];if(_0x211771[_0x76d7('0x31')][_0x76d7('0x3f')]){_0x2d5bb5['include']=[{'all':!![]}];}_0x2d5bb5=_[_0x76d7('0x3c')]({},_0x2d5bb5,_0x211771['options']);return db['OpenchannelTransferReport'][_0x76d7('0x45')](_0x2d5bb5)['then'](handleEntityNotFound(_0x1ad781,null))['then'](respondWithResult(_0x1ad781,null))[_0x76d7('0x41')](handleError(_0x1ad781,null));};exports[_0x76d7('0x46')]=function(_0x4aafea,_0x1452a4){return db[_0x76d7('0x2c')][_0x76d7('0x46')](_0x4aafea['body'],{})[_0x76d7('0x25')](respondWithResult(_0x1452a4,0xc9))[_0x76d7('0x41')](handleError(_0x1452a4,null));};exports[_0x76d7('0x47')]=function(_0x4e853c,_0x4d515c){if(_0x4e853c[_0x76d7('0x48')]['id']){delete _0x4e853c[_0x76d7('0x48')]['id'];}return db['OpenchannelTransferReport'][_0x76d7('0x45')]({'where':{'id':_0x4e853c['params']['id']}})[_0x76d7('0x25')](handleEntityNotFound(_0x4d515c,null))[_0x76d7('0x25')](saveUpdates(_0x4e853c['body'],null))[_0x76d7('0x25')](respondWithResult(_0x4d515c,null))[_0x76d7('0x41')](handleError(_0x4d515c,null));};exports['destroy']=function(_0x891afa,_0x96b898){return db['OpenchannelTransferReport'][_0x76d7('0x45')]({'where':{'id':_0x891afa['params']['id']}})[_0x76d7('0x25')](handleEntityNotFound(_0x96b898,null))['then'](removeEntity(_0x96b898,null))[_0x76d7('0x41')](handleError(_0x96b898,null));};exports[_0x76d7('0x49')]=function(_0x3ec4d5,_0x1bb510){return db[_0x76d7('0x2c')][_0x76d7('0x49')]()['then'](respondWithResult(_0x1bb510,null))[_0x76d7('0x41')](handleError(_0x1bb510,null));}; \ No newline at end of file +var _0x0f6c=['key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','filter','where','merge','map','options','includeAll','include','params','length','find','create','body','catch','destroy','describe','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','save','update','then','error','name','send','index','OpenchannelTransferReport','rawAttributes','fieldName','type'];(function(_0x59f451,_0x1e91f4){var _0x194bad=function(_0x413ef6){while(--_0x413ef6){_0x59f451['push'](_0x59f451['shift']());}};_0x194bad(++_0x1e91f4);}(_0x0f6c,0xf0));var _0xc0f6=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x0f6c[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc0f6('0x0'));var zipdir=require(_0xc0f6('0x1'));var jsonpatch=require(_0xc0f6('0x2'));var rp=require('request-promise');var moment=require(_0xc0f6('0x3'));var BPromise=require(_0xc0f6('0x4'));var Mustache=require(_0xc0f6('0x5'));var util=require(_0xc0f6('0x6'));var path=require(_0xc0f6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc0f6('0x8'));var fs=require('fs');var fs_extra=require(_0xc0f6('0x9'));var _=require(_0xc0f6('0xa'));var squel=require(_0xc0f6('0xb'));var crypto=require(_0xc0f6('0xc'));var jsforce=require(_0xc0f6('0xd'));var deskjs=require(_0xc0f6('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc0f6('0xf'));var Papa=require(_0xc0f6('0x10'));var Redis=require(_0xc0f6('0x11'));var authService=require(_0xc0f6('0x12'));var qs=require(_0xc0f6('0x13'));var as=require(_0xc0f6('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc0f6('0x15'))(_0xc0f6('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x301a8e,_0x5d40a2){_0x5d40a2=_0x5d40a2||0xcc;return function(_0xb1a6f9){if(_0xb1a6f9){return _0x301a8e[_0xc0f6('0x17')](_0x5d40a2);}return _0x301a8e[_0xc0f6('0x18')](_0x5d40a2)[_0xc0f6('0x19')]();};}function respondWithResult(_0x521740,_0x3a2062){_0x3a2062=_0x3a2062||0xc8;return function(_0x2bcc10){if(_0x2bcc10){return _0x521740[_0xc0f6('0x18')](_0x3a2062)[_0xc0f6('0x1a')](_0x2bcc10);}};}function respondWithFilteredResult(_0x1848eb,_0x5498c4){return function(_0x154d40){if(_0x154d40){var _0x306078=typeof _0x5498c4[_0xc0f6('0x1b')]==='undefined'&&typeof _0x5498c4[_0xc0f6('0x1c')]===_0xc0f6('0x1d');var _0x200de4=_0x154d40[_0xc0f6('0x1e')];var _0x3fafb6=_0x306078?0x0:_0x5498c4[_0xc0f6('0x1b')];var _0xbba22=_0x306078?_0x154d40[_0xc0f6('0x1e')]:_0x5498c4['offset']+_0x5498c4['limit'];var _0x257d3b;if(_0xbba22>=_0x200de4){_0xbba22=_0x200de4;_0x257d3b=0xc8;}else{_0x257d3b=0xce;}_0x1848eb['status'](_0x257d3b);return _0x1848eb['set'](_0xc0f6('0x1f'),_0x3fafb6+'-'+_0xbba22+'/'+_0x200de4)[_0xc0f6('0x1a')](_0x154d40);}return null;};}function patchUpdates(_0x3192e7){return function(_0xd8fb87){try{jsonpatch[_0xc0f6('0x20')](_0xd8fb87,_0x3192e7,!![]);}catch(_0x50fcac){return BPromise['reject'](_0x50fcac);}return _0xd8fb87[_0xc0f6('0x21')]();};}function saveUpdates(_0x2d4af6,_0x117f34){return function(_0x495ea9){if(_0x495ea9){return _0x495ea9[_0xc0f6('0x22')](_0x2d4af6)['then'](function(_0x4acff5){return _0x4acff5;});}return null;};}function removeEntity(_0x11d5d7,_0x431706){return function(_0x2cff1d){if(_0x2cff1d){return _0x2cff1d['destroy']()[_0xc0f6('0x23')](function(){_0x11d5d7[_0xc0f6('0x18')](0xcc)[_0xc0f6('0x19')]();});}};}function handleEntityNotFound(_0x4e81bc,_0x257a98){return function(_0x37a349){if(!_0x37a349){_0x4e81bc['sendStatus'](0x194);}return _0x37a349;};}function handleError(_0x1db526,_0x2dc679){_0x2dc679=_0x2dc679||0x1f4;return function(_0x3c34f2){logger[_0xc0f6('0x24')](_0x3c34f2['stack']);if(_0x3c34f2[_0xc0f6('0x25')]){delete _0x3c34f2[_0xc0f6('0x25')];}_0x1db526[_0xc0f6('0x18')](_0x2dc679)[_0xc0f6('0x26')](_0x3c34f2);};}exports[_0xc0f6('0x27')]=function(_0x35420f,_0x1b68d0){var _0x444e3c={},_0x289369={},_0x1ad3bd={'count':0x0,'rows':[]};var _0x4b54ec=_['map'](db[_0xc0f6('0x28')][_0xc0f6('0x29')],function(_0x4ca337){return{'name':_0x4ca337[_0xc0f6('0x2a')],'type':_0x4ca337[_0xc0f6('0x2b')][_0xc0f6('0x2c')]};});_0x289369[_0xc0f6('0x2d')]=_['map'](_0x4b54ec,'name');_0x289369[_0xc0f6('0x2e')]=_[_0xc0f6('0x2f')](_0x35420f['query']);_0x289369[_0xc0f6('0x30')]=_['intersection'](_0x289369[_0xc0f6('0x2d')],_0x289369[_0xc0f6('0x2e')]);_0x444e3c['attributes']=_[_0xc0f6('0x31')](_0x289369[_0xc0f6('0x2d')],qs[_0xc0f6('0x32')](_0x35420f[_0xc0f6('0x2e')]['fields']));_0x444e3c[_0xc0f6('0x33')]=_0x444e3c['attributes']['length']?_0x444e3c[_0xc0f6('0x33')]:_0x289369[_0xc0f6('0x2d')];if(!_0x35420f['query'][_0xc0f6('0x34')](_0xc0f6('0x35'))){_0x444e3c[_0xc0f6('0x1c')]=qs[_0xc0f6('0x1c')](_0x35420f[_0xc0f6('0x2e')][_0xc0f6('0x1c')]);_0x444e3c[_0xc0f6('0x1b')]=qs['offset'](_0x35420f['query'][_0xc0f6('0x1b')]);}_0x444e3c[_0xc0f6('0x36')]=qs['sort'](_0x35420f[_0xc0f6('0x2e')][_0xc0f6('0x37')]);_0x444e3c['where']=qs[_0xc0f6('0x30')](_['pick'](_0x35420f[_0xc0f6('0x2e')],_0x289369['filters']),_0x4b54ec);if(_0x35420f[_0xc0f6('0x2e')][_0xc0f6('0x38')]){_0x444e3c[_0xc0f6('0x39')]=_[_0xc0f6('0x3a')](_0x444e3c[_0xc0f6('0x39')],{'$or':_[_0xc0f6('0x3b')](_0x4b54ec,function(_0xc8e53b){if(_0xc8e53b[_0xc0f6('0x2b')]!=='VIRTUAL'){var _0x5dda6b={};_0x5dda6b[_0xc8e53b['name']]={'$like':'%'+_0x35420f[_0xc0f6('0x2e')][_0xc0f6('0x38')]+'%'};return _0x5dda6b;}})});}_0x444e3c=_[_0xc0f6('0x3a')]({},_0x444e3c,_0x35420f[_0xc0f6('0x3c')]);var _0x1ceede={'where':_0x444e3c[_0xc0f6('0x39')]};return db[_0xc0f6('0x28')]['count'](_0x1ceede)[_0xc0f6('0x23')](function(_0x4e5b60){_0x1ad3bd[_0xc0f6('0x1e')]=_0x4e5b60;if(_0x35420f[_0xc0f6('0x2e')][_0xc0f6('0x3d')]){_0x444e3c[_0xc0f6('0x3e')]=[{'all':!![]}];}return db[_0xc0f6('0x28')]['findAll'](_0x444e3c);})['then'](function(_0x19bbca){_0x1ad3bd['rows']=_0x19bbca;return _0x1ad3bd;})['then'](respondWithFilteredResult(_0x1b68d0,_0x444e3c))['catch'](handleError(_0x1b68d0,null));};exports['show']=function(_0x4122d4,_0x5a2f46){var _0x4e5811={'raw':!![],'where':{'id':_0x4122d4[_0xc0f6('0x3f')]['id']}},_0x214667={};_0x214667[_0xc0f6('0x2d')]=_[_0xc0f6('0x2f')](db[_0xc0f6('0x28')][_0xc0f6('0x29')]);_0x214667['query']=_['keys'](_0x4122d4[_0xc0f6('0x2e')]);_0x214667[_0xc0f6('0x30')]=_[_0xc0f6('0x31')](_0x214667[_0xc0f6('0x2d')],_0x214667[_0xc0f6('0x2e')]);_0x4e5811[_0xc0f6('0x33')]=_['intersection'](_0x214667[_0xc0f6('0x2d')],qs[_0xc0f6('0x32')](_0x4122d4[_0xc0f6('0x2e')][_0xc0f6('0x32')]));_0x4e5811[_0xc0f6('0x33')]=_0x4e5811[_0xc0f6('0x33')][_0xc0f6('0x40')]?_0x4e5811['attributes']:_0x214667[_0xc0f6('0x2d')];if(_0x4122d4['query']['includeAll']){_0x4e5811[_0xc0f6('0x3e')]=[{'all':!![]}];}_0x4e5811=_[_0xc0f6('0x3a')]({},_0x4e5811,_0x4122d4['options']);return db[_0xc0f6('0x28')][_0xc0f6('0x41')](_0x4e5811)[_0xc0f6('0x23')](handleEntityNotFound(_0x5a2f46,null))[_0xc0f6('0x23')](respondWithResult(_0x5a2f46,null))['catch'](handleError(_0x5a2f46,null));};exports['create']=function(_0x48adf7,_0xb77737){return db['OpenchannelTransferReport'][_0xc0f6('0x42')](_0x48adf7[_0xc0f6('0x43')],{})[_0xc0f6('0x23')](respondWithResult(_0xb77737,0xc9))['catch'](handleError(_0xb77737,null));};exports[_0xc0f6('0x22')]=function(_0x1cca2a,_0x4246be){if(_0x1cca2a[_0xc0f6('0x43')]['id']){delete _0x1cca2a[_0xc0f6('0x43')]['id'];}return db[_0xc0f6('0x28')][_0xc0f6('0x41')]({'where':{'id':_0x1cca2a['params']['id']}})[_0xc0f6('0x23')](handleEntityNotFound(_0x4246be,null))[_0xc0f6('0x23')](saveUpdates(_0x1cca2a['body'],null))[_0xc0f6('0x23')](respondWithResult(_0x4246be,null))[_0xc0f6('0x44')](handleError(_0x4246be,null));};exports[_0xc0f6('0x45')]=function(_0x13138c,_0xc2d6b3){return db[_0xc0f6('0x28')][_0xc0f6('0x41')]({'where':{'id':_0x13138c[_0xc0f6('0x3f')]['id']}})[_0xc0f6('0x23')](handleEntityNotFound(_0xc2d6b3,null))[_0xc0f6('0x23')](removeEntity(_0xc2d6b3,null))[_0xc0f6('0x44')](handleError(_0xc2d6b3,null));};exports[_0xc0f6('0x46')]=function(_0x553ce2,_0x4d3041){return db[_0xc0f6('0x28')][_0xc0f6('0x46')]()[_0xc0f6('0x23')](respondWithResult(_0x4d3041,null))['catch'](handleError(_0x4d3041,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 5e407a9..c3edacb 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 _0x067e=['util','../../config/logger','bluebird','request-promise','path','./openchannelTransferReport.attributes','define','report_openchannel_transfer','uniqueid','lodash'];(function(_0x10d1b3,_0x2f106d){var _0x5c1716=function(_0x4f436a){while(--_0x4f436a){_0x10d1b3['push'](_0x10d1b3['shift']());}};_0x5c1716(++_0x2f106d);}(_0x067e,0xd1));var _0xe067=function(_0x3e15b3,_0x4cae8c){_0x3e15b3=_0x3e15b3-0x0;var _0x205bdf=_0x067e[_0x3e15b3];return _0x205bdf;};'use strict';var _=require(_0xe067('0x0'));var util=require(_0xe067('0x1'));var logger=require(_0xe067('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe067('0x3'));var rp=require(_0xe067('0x4'));var fs=require('fs');var path=require(_0xe067('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe067('0x6'));module['exports']=function(_0x546e8b,_0x10e0f4){return _0x546e8b[_0xe067('0x7')]('OpenchannelTransferReport',attributes,{'tableName':_0xe067('0x8'),'paranoid':![],'indexes':[{'name':_0xe067('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x1da0=['OpenchannelTransferReport','report_openchannel_transfer','uniqueid','lodash','util','api','bluebird','path','../../config/environment','./openchannelTransferReport.attributes','exports'];(function(_0x4e8a84,_0x547f8e){var _0x41f6f4=function(_0x5ec835){while(--_0x5ec835){_0x4e8a84['push'](_0x4e8a84['shift']());}};_0x41f6f4(++_0x547f8e);}(_0x1da0,0xdf));var _0x01da=function(_0x29c3b2,_0x3c12ac){_0x29c3b2=_0x29c3b2-0x0;var _0x4b3aa7=_0x1da0[_0x29c3b2];return _0x4b3aa7;};'use strict';var _=require(_0x01da('0x0'));var util=require(_0x01da('0x1'));var logger=require('../../config/logger')(_0x01da('0x2'));var moment=require('moment');var BPromise=require(_0x01da('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x01da('0x4'));var rimraf=require('rimraf');var config=require(_0x01da('0x5'));var attributes=require(_0x01da('0x6'));module[_0x01da('0x7')]=function(_0x56313d,_0x1050be){return _0x56313d['define'](_0x01da('0x8'),attributes,{'tableName':_0x01da('0x9'),'paranoid':![],'indexes':[{'name':_0x01da('0xa'),'fields':[_0x01da('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index b124051..1b154b8 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 _0x45d1=['randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','OpenchannelTransferReport,\x20%s,\x20%s','result','lodash','util','bluebird'];(function(_0x25c73d,_0x986f2b){var _0x4c0313=function(_0x60c73a){while(--_0x60c73a){_0x25c73d['push'](_0x25c73d['shift']());}};_0x4c0313(++_0x986f2b);}(_0x45d1,0x1cb));var _0x145d=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x45d1[_0x35b87c];return _0x24795b;};'use strict';var _=require(_0x145d('0x0'));var util=require(_0x145d('0x1'));var moment=require('moment');var BPromise=require(_0x145d('0x2'));var rs=require(_0x145d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x145d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x145d('0x5'))(_0x145d('0x6'));var config=require(_0x145d('0x7'));var jayson=require(_0x145d('0x8'));var client=jayson[_0x145d('0x9')][_0x145d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbc4161,_0x45ff66,_0x46a729){return new BPromise(function(_0x47eadc,_0x4ef552){return client['request'](_0xbc4161,_0x46a729)[_0x145d('0xb')](function(_0x183afe){logger[_0x145d('0xc')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x145d('0xd'));logger['debug'](_0x145d('0xe'),_0x45ff66,_0x145d('0xd'),JSON[_0x145d('0xf')](_0x183afe));if(_0x183afe[_0x145d('0x10')]){if(_0x183afe['error'][_0x145d('0x11')]===0x1f4){logger[_0x145d('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x4ef552(_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);}logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x45ff66,_0x183afe[_0x145d('0x10')][_0x145d('0x12')]);return _0x47eadc(_0x183afe[_0x145d('0x10')]['message']);}else{logger[_0x145d('0xc')](_0x145d('0x13'),_0x45ff66,_0x145d('0xd'));_0x47eadc(_0x183afe[_0x145d('0x14')][_0x145d('0x12')]);}})['catch'](function(_0x1c9ee2){logger[_0x145d('0x10')](_0x145d('0x13'),_0x45ff66,_0x1c9ee2);_0x4ef552(_0x1c9ee2);});});} \ No newline at end of file +var _0x9206=['randomstring','ioredis','../../config/logger','rpc','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9206,0x176));var _0x6920=function(_0x5d901b,_0x204a0d){_0x5d901b=_0x5d901b-0x0;var _0x34beaa=_0x9206[_0x5d901b];return _0x34beaa;};'use strict';var _=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var moment=require(_0x6920('0x2'));var BPromise=require(_0x6920('0x3'));var rs=require(_0x6920('0x4'));var fs=require('fs');var Redis=require(_0x6920('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6920('0x6'))(_0x6920('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6920('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21fb21,_0x31966d,_0x2aad51){return new BPromise(function(_0xef5d38,_0x56bb75){return client['request'](_0x21fb21,_0x2aad51)[_0x6920('0x9')](function(_0xc578c6){logger[_0x6920('0xa')](_0x6920('0xb'),_0x31966d,_0x6920('0xc'));logger[_0x6920('0xd')](_0x6920('0xe'),_0x31966d,_0x6920('0xc'),JSON[_0x6920('0xf')](_0xc578c6));if(_0xc578c6[_0x6920('0x10')]){if(_0xc578c6[_0x6920('0x10')][_0x6920('0x11')]===0x1f4){logger[_0x6920('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x31966d,_0xc578c6['error'][_0x6920('0x12')]);return _0x56bb75(_0xc578c6[_0x6920('0x10')]['message']);}logger[_0x6920('0x10')](_0x6920('0xb'),_0x31966d,_0xc578c6[_0x6920('0x10')][_0x6920('0x12')]);return _0xef5d38(_0xc578c6[_0x6920('0x10')]['message']);}else{logger[_0x6920('0xa')](_0x6920('0xb'),_0x31966d,_0x6920('0xc'));_0xef5d38(_0xc578c6[_0x6920('0x13')][_0x6920('0x12')]);}})[_0x6920('0x14')](function(_0x3452a4){logger[_0x6920('0x10')](_0x6920('0xb'),_0x31966d,_0x3452a4);_0x56bb75(_0x3452a4);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 6ec9337..1ab579e 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 _0x66f3=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','isAuthenticated','show','create','/:id','update','delete','destroy','exports','multer','util','path','express'];(function(_0x52e7a2,_0x5501fe){var _0x23ca66=function(_0x1f6f2f){while(--_0x1f6f2f){_0x52e7a2['push'](_0x52e7a2['shift']());}};_0x23ca66(++_0x5501fe);}(_0x66f3,0xba));var _0x366f=function(_0x397843,_0xa7173e){_0x397843=_0x397843-0x0;var _0x2ba028=_0x66f3[_0x397843];return _0x2ba028;};'use strict';var multer=require(_0x366f('0x0'));var util=require(_0x366f('0x1'));var path=require(_0x366f('0x2'));var timeout=require('connect-timeout');var express=require(_0x366f('0x3'));var router=express[_0x366f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x366f('0x5'));var interaction=require(_0x366f('0x6'));var config=require(_0x366f('0x7'));var controller=require(_0x366f('0x8'));router[_0x366f('0x9')]('/',auth['isAuthenticated'](),controller[_0x366f('0xa')]);router[_0x366f('0x9')]('/:id',auth[_0x366f('0xb')](),controller[_0x366f('0xc')]);router['post']('/',auth[_0x366f('0xb')](),controller[_0x366f('0xd')]);router['put'](_0x366f('0xe'),auth[_0x366f('0xb')](),controller[_0x366f('0xf')]);router[_0x366f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x366f('0x11')]);module[_0x366f('0x12')]=router; \ No newline at end of file +var _0x4de7=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x51b111,_0x34eec5){var _0x17537f=function(_0x4b3e6a){while(--_0x4b3e6a){_0x51b111['push'](_0x51b111['shift']());}};_0x17537f(++_0x34eec5);}(_0x4de7,0x1f3));var _0x74de=function(_0x2ad977,_0x300dcf){_0x2ad977=_0x2ad977-0x0;var _0x239517=_0x4de7[_0x2ad977];return _0x239517;};'use strict';var multer=require(_0x74de('0x0'));var util=require('util');var path=require(_0x74de('0x1'));var timeout=require(_0x74de('0x2'));var express=require(_0x74de('0x3'));var router=express[_0x74de('0x4')]();var fs_extra=require(_0x74de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x74de('0x6'));var config=require(_0x74de('0x7'));var controller=require(_0x74de('0x8'));router['get']('/',auth[_0x74de('0x9')](),controller[_0x74de('0xa')]);router[_0x74de('0xb')](_0x74de('0xc'),auth[_0x74de('0x9')](),controller[_0x74de('0xd')]);router[_0x74de('0xe')]('/',auth[_0x74de('0x9')](),controller[_0x74de('0xf')]);router[_0x74de('0x10')]('/:id',auth[_0x74de('0x9')](),controller['update']);router[_0x74de('0x11')](_0x74de('0xc'),auth['isAuthenticated'](),controller[_0x74de('0x12')]);module[_0x74de('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 f3c8e11..46c5f45 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 _0x7585=['STRING','name','sequelize'];(function(_0x111080,_0x4284b1){var _0x456be4=function(_0x533af9){while(--_0x533af9){_0x111080['push'](_0x111080['shift']());}};_0x456be4(++_0x4284b1);}(_0x7585,0xcb));var _0x5758=function(_0x1370be,_0x21d472){_0x1370be=_0x1370be-0x0;var _0x1f5522=_0x7585[_0x1370be];return _0x1f5522;};'use strict';var Sequelize=require(_0x5758('0x0'));module['exports']={'name':{'type':Sequelize[_0x5758('0x1')],'unique':_0x5758('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x5758('0x1')]}}; \ No newline at end of file +var _0x3474=['name','STRING','sequelize','exports'];(function(_0x2cc017,_0x25b198){var _0x509276=function(_0x156ef1){while(--_0x156ef1){_0x2cc017['push'](_0x2cc017['shift']());}};_0x509276(++_0x25b198);}(_0x3474,0xca));var _0x4347=function(_0x231dc6,_0x31d9f2){_0x231dc6=_0x231dc6-0x0;var _0xebaf37=_0x3474[_0x231dc6];return _0xebaf37;};'use strict';var Sequelize=require(_0x4347('0x0'));module[_0x4347('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4347('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x4347('0x3')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index e8f5a70..d7e7a56 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 _0x238c=['util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','count','offset','status','apply','reject','save','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','show','params','rawAttributes','Pause','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x346a45,_0xdfe57a){var _0x5280f2=function(_0x538714){while(--_0x538714){_0x346a45['push'](_0x346a45['shift']());}};_0x5280f2(++_0xdfe57a);}(_0x238c,0xa1));var _0xc238=function(_0x1dc337,_0x163446){_0x1dc337=_0x1dc337-0x0;var _0x2c4d04=_0x238c[_0x1dc337];return _0x2c4d04;};'use strict';var emlformat=require(_0xc238('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc238('0x1'));var jsonpatch=require(_0xc238('0x2'));var rp=require(_0xc238('0x3'));var moment=require(_0xc238('0x4'));var BPromise=require(_0xc238('0x5'));var Mustache=require(_0xc238('0x6'));var util=require(_0xc238('0x7'));var path=require(_0xc238('0x8'));var sox=require('sox');var csv=require(_0xc238('0x9'));var ejs=require(_0xc238('0xa'));var fs=require('fs');var fs_extra=require(_0xc238('0xb'));var _=require(_0xc238('0xc'));var squel=require(_0xc238('0xd'));var crypto=require(_0xc238('0xe'));var jsforce=require(_0xc238('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc238('0x10'));var Redis=require(_0xc238('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc238('0x12'));var hardwareService=require(_0xc238('0x13'));var logger=require('../../config/logger')(_0xc238('0x14'));var utils=require(_0xc238('0x15'));var config=require(_0xc238('0x16'));var licenseUtil=require(_0xc238('0x17'));var db=require(_0xc238('0x18'))['db'];function respondWithStatusCode(_0x4c804c,_0x50d11e){_0x50d11e=_0x50d11e||0xcc;return function(_0x253748){if(_0x253748){return _0x4c804c[_0xc238('0x19')](_0x50d11e);}return _0x4c804c['status'](_0x50d11e)[_0xc238('0x1a')]();};}function respondWithResult(_0x1bd694,_0x1ebd9d){_0x1ebd9d=_0x1ebd9d||0xc8;return function(_0x25af90){if(_0x25af90){return _0x1bd694['status'](_0x1ebd9d)[_0xc238('0x1b')](_0x25af90);}};}function respondWithFilteredResult(_0x1aa67d,_0x15f5d8){return function(_0x19219f){if(_0x19219f){var _0x1762ad=typeof _0x15f5d8['offset']===_0xc238('0x1c')&&typeof _0x15f5d8[_0xc238('0x1d')]===_0xc238('0x1c');var _0xb439c5=_0x19219f[_0xc238('0x1e')];var _0x3d48e9=_0x1762ad?0x0:_0x15f5d8['offset'];var _0x527752=_0x1762ad?_0x19219f['count']:_0x15f5d8[_0xc238('0x1f')]+_0x15f5d8[_0xc238('0x1d')];var _0x5e92fc;if(_0x527752>=_0xb439c5){_0x527752=_0xb439c5;_0x5e92fc=0xc8;}else{_0x5e92fc=0xce;}_0x1aa67d[_0xc238('0x20')](_0x5e92fc);return _0x1aa67d['set']('Content-Range',_0x3d48e9+'-'+_0x527752+'/'+_0xb439c5)['json'](_0x19219f);}return null;};}function patchUpdates(_0x105e15){return function(_0x48ddcf){try{jsonpatch[_0xc238('0x21')](_0x48ddcf,_0x105e15,!![]);}catch(_0x331701){return BPromise[_0xc238('0x22')](_0x331701);}return _0x48ddcf[_0xc238('0x23')]();};}function saveUpdates(_0x460a1d,_0x4ef770){return function(_0x54ddf4){if(_0x54ddf4){return _0x54ddf4['update'](_0x460a1d)[_0xc238('0x24')](function(_0x1b0969){return _0x1b0969;});}return null;};}function removeEntity(_0x5a1b46,_0x4466bd){return function(_0x539150){if(_0x539150){return _0x539150[_0xc238('0x25')]()[_0xc238('0x24')](function(){var _0x5a2577=_0x539150[_0xc238('0x26')]({'plain':!![]});var _0x5ce845=_0xc238('0x27');return db[_0xc238('0x28')][_0xc238('0x25')]({'where':{'type':_0x5ce845,'resourceId':_0x5a2577['id']}})[_0xc238('0x24')](function(){return _0x539150;});})[_0xc238('0x24')](function(){_0x5a1b46[_0xc238('0x20')](0xcc)[_0xc238('0x1a')]();});}};}function handleEntityNotFound(_0x49d771,_0x2912c3){return function(_0x167381){if(!_0x167381){_0x49d771['sendStatus'](0x194);}return _0x167381;};}function handleError(_0x441f52,_0x363b4f){_0x363b4f=_0x363b4f||0x1f4;return function(_0x10db24){logger[_0xc238('0x29')](_0x10db24[_0xc238('0x2a')]);if(_0x10db24[_0xc238('0x2b')]){delete _0x10db24[_0xc238('0x2b')];}_0x441f52[_0xc238('0x20')](_0x363b4f)[_0xc238('0x2c')](_0x10db24);};}exports[_0xc238('0x2d')]=function(_0xfaeddd,_0x4279fc){var _0x44ec6d={},_0x5e8d59={},_0x29dad0={'count':0x0,'rows':[]};var _0x4c3b00=_[_0xc238('0x2e')](db['Pause']['rawAttributes'],function(_0x4213f3){return{'name':_0x4213f3[_0xc238('0x2f')],'type':_0x4213f3[_0xc238('0x30')][_0xc238('0x31')]};});_0x5e8d59[_0xc238('0x32')]=_[_0xc238('0x2e')](_0x4c3b00,_0xc238('0x2b'));_0x5e8d59[_0xc238('0x33')]=_[_0xc238('0x34')](_0xfaeddd['query']);_0x5e8d59['filters']=_[_0xc238('0x35')](_0x5e8d59[_0xc238('0x32')],_0x5e8d59['query']);_0x44ec6d[_0xc238('0x36')]=_['intersection'](_0x5e8d59[_0xc238('0x32')],qs[_0xc238('0x37')](_0xfaeddd['query'][_0xc238('0x37')]));_0x44ec6d['attributes']=_0x44ec6d[_0xc238('0x36')][_0xc238('0x38')]?_0x44ec6d[_0xc238('0x36')]:_0x5e8d59[_0xc238('0x32')];if(!_0xfaeddd[_0xc238('0x33')][_0xc238('0x39')](_0xc238('0x3a'))){_0x44ec6d[_0xc238('0x1d')]=qs[_0xc238('0x1d')](_0xfaeddd[_0xc238('0x33')][_0xc238('0x1d')]);_0x44ec6d[_0xc238('0x1f')]=qs[_0xc238('0x1f')](_0xfaeddd[_0xc238('0x33')][_0xc238('0x1f')]);}_0x44ec6d[_0xc238('0x3b')]=qs[_0xc238('0x3c')](_0xfaeddd[_0xc238('0x33')][_0xc238('0x3c')]);_0x44ec6d[_0xc238('0x3d')]=qs[_0xc238('0x3e')](_[_0xc238('0x3f')](_0xfaeddd[_0xc238('0x33')],_0x5e8d59[_0xc238('0x3e')]),_0x4c3b00);if(_0xfaeddd[_0xc238('0x33')][_0xc238('0x40')]){_0x44ec6d['where']=_[_0xc238('0x41')](_0x44ec6d[_0xc238('0x3d')],{'$or':_[_0xc238('0x2e')](_0x4c3b00,function(_0x2eada6){if(_0x2eada6['type']!==_0xc238('0x42')){var _0x96102c={};_0x96102c[_0x2eada6['name']]={'$like':'%'+_0xfaeddd['query'][_0xc238('0x40')]+'%'};return _0x96102c;}})});}_0x44ec6d=_[_0xc238('0x41')]({},_0x44ec6d,_0xfaeddd[_0xc238('0x43')]);var _0x5032d9={'where':_0x44ec6d[_0xc238('0x3d')]};return db['Pause'][_0xc238('0x1e')](_0x5032d9)[_0xc238('0x24')](function(_0x50bf5c){_0x29dad0['count']=_0x50bf5c;if(_0xfaeddd[_0xc238('0x33')]['includeAll']){_0x44ec6d[_0xc238('0x44')]=[{'all':!![]}];}return db['Pause']['findAll'](_0x44ec6d);})[_0xc238('0x24')](function(_0x173541){_0x29dad0[_0xc238('0x45')]=_0x173541;return _0x29dad0;})['then'](respondWithFilteredResult(_0x4279fc,_0x44ec6d))['catch'](handleError(_0x4279fc,null));};exports[_0xc238('0x46')]=function(_0x57a083,_0x4cf4ec){var _0x3bc246={'raw':!![],'where':{'id':_0x57a083[_0xc238('0x47')]['id']}},_0x4fed6e={};_0x4fed6e[_0xc238('0x32')]=_[_0xc238('0x34')](db['Pause'][_0xc238('0x48')]);_0x4fed6e[_0xc238('0x33')]=_[_0xc238('0x34')](_0x57a083[_0xc238('0x33')]);_0x4fed6e[_0xc238('0x3e')]=_['intersection'](_0x4fed6e[_0xc238('0x32')],_0x4fed6e['query']);_0x3bc246[_0xc238('0x36')]=_[_0xc238('0x35')](_0x4fed6e['model'],qs[_0xc238('0x37')](_0x57a083['query'][_0xc238('0x37')]));_0x3bc246[_0xc238('0x36')]=_0x3bc246[_0xc238('0x36')]['length']?_0x3bc246[_0xc238('0x36')]:_0x4fed6e['model'];if(_0x57a083[_0xc238('0x33')]['includeAll']){_0x3bc246['include']=[{'all':!![]}];}_0x3bc246=_[_0xc238('0x41')]({},_0x3bc246,_0x57a083[_0xc238('0x43')]);return db[_0xc238('0x49')][_0xc238('0x4a')](_0x3bc246)['then'](handleEntityNotFound(_0x4cf4ec,null))[_0xc238('0x24')](respondWithResult(_0x4cf4ec,null))[_0xc238('0x4b')](handleError(_0x4cf4ec,null));};exports[_0xc238('0x4c')]=function(_0xe1cb44,_0x4ebe91){return db['Pause']['create'](_0xe1cb44[_0xc238('0x4d')],{})[_0xc238('0x24')](function(_0xe8e9a){var _0xad7ed8=_0xe1cb44[_0xc238('0x4e')][_0xc238('0x26')]({'plain':!![]});if(!_0xad7ed8)throw new Error(_0xc238('0x4f'));if(_0xad7ed8['role']===_0xc238('0x4e')){var _0x59787b=_0xe8e9a[_0xc238('0x26')]({'plain':!![]});var _0x3501c0=_0xc238('0x27');return db[_0xc238('0x50')][_0xc238('0x4a')]({'where':{'name':_0x3501c0,'userProfileId':_0xad7ed8[_0xc238('0x51')]},'raw':!![]})[_0xc238('0x24')](function(_0x7f0b42){if(_0x7f0b42&&_0x7f0b42[_0xc238('0x52')]===0x0){return db[_0xc238('0x28')]['create']({'name':_0x59787b[_0xc238('0x2b')],'resourceId':_0x59787b['id'],'type':_0x7f0b42[_0xc238('0x2b')],'sectionId':_0x7f0b42['id']},{})[_0xc238('0x24')](function(){return _0xe8e9a;});}else{return _0xe8e9a;}})[_0xc238('0x4b')](function(_0x15c17e){logger['error'](_0xc238('0x53'),_0x15c17e);throw _0x15c17e;});}return _0xe8e9a;})[_0xc238('0x24')](respondWithResult(_0x4ebe91,0xc9))[_0xc238('0x4b')](handleError(_0x4ebe91,null));};exports['update']=function(_0x56dfbb,_0x520381){if(_0x56dfbb[_0xc238('0x4d')]['id']){delete _0x56dfbb[_0xc238('0x4d')]['id'];}return db['Pause']['find']({'where':{'id':_0x56dfbb[_0xc238('0x47')]['id']}})['then'](handleEntityNotFound(_0x520381,null))['then'](saveUpdates(_0x56dfbb[_0xc238('0x4d')],null))[_0xc238('0x24')](respondWithResult(_0x520381,null))[_0xc238('0x4b')](handleError(_0x520381,null));};exports[_0xc238('0x25')]=function(_0x50ee6b,_0x32d328){return db[_0xc238('0x49')]['find']({'where':{'id':_0x50ee6b[_0xc238('0x47')]['id']}})['then'](handleEntityNotFound(_0x32d328,null))[_0xc238('0x24')](removeEntity(_0x32d328,null))[_0xc238('0x4b')](handleError(_0x32d328,null));}; \ No newline at end of file +var _0x6d77=['crypto','jsforce','querystring','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','count','Content-Range','apply','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','index','Pause','type','map','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','mustache','util','to-csv','ejs','lodash','squel'];(function(_0x44330c,_0x22f9b5){var _0x5b3cd9=function(_0x3fa058){while(--_0x3fa058){_0x44330c['push'](_0x44330c['shift']());}};_0x5b3cd9(++_0x22f9b5);}(_0x6d77,0x186));var _0x76d7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6d77[_0x42cae2];return _0x5f256f;};'use strict';var emlformat=require(_0x76d7('0x0'));var rimraf=require(_0x76d7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x76d7('0x2'));var moment=require(_0x76d7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x76d7('0x4'));var util=require(_0x76d7('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x76d7('0x6'));var ejs=require(_0x76d7('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x76d7('0x8'));var squel=require(_0x76d7('0x9'));var crypto=require(_0x76d7('0xa'));var jsforce=require(_0x76d7('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x76d7('0x6'));var querystring=require(_0x76d7('0xc'));var Papa=require('papaparse');var Redis=require(_0x76d7('0xd'));var authService=require(_0x76d7('0xe'));var qs=require(_0x76d7('0xf'));var as=require(_0x76d7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x76d7('0x11'))(_0x76d7('0x12'));var utils=require(_0x76d7('0x13'));var config=require(_0x76d7('0x14'));var licenseUtil=require(_0x76d7('0x15'));var db=require(_0x76d7('0x16'))['db'];function respondWithStatusCode(_0x3e31e9,_0x23d843){_0x23d843=_0x23d843||0xcc;return function(_0x44e9ec){if(_0x44e9ec){return _0x3e31e9[_0x76d7('0x17')](_0x23d843);}return _0x3e31e9[_0x76d7('0x18')](_0x23d843)[_0x76d7('0x19')]();};}function respondWithResult(_0x50ea7b,_0x212ff3){_0x212ff3=_0x212ff3||0xc8;return function(_0x36899b){if(_0x36899b){return _0x50ea7b[_0x76d7('0x18')](_0x212ff3)[_0x76d7('0x1a')](_0x36899b);}};}function respondWithFilteredResult(_0x1dc3d8,_0x27eed6){return function(_0x1b6731){if(_0x1b6731){var _0x3d6456=typeof _0x27eed6[_0x76d7('0x1b')]===_0x76d7('0x1c')&&typeof _0x27eed6[_0x76d7('0x1d')]===_0x76d7('0x1c');var _0x42e9b7=_0x1b6731[_0x76d7('0x1e')];var _0xd49275=_0x3d6456?0x0:_0x27eed6[_0x76d7('0x1b')];var _0x441a9c=_0x3d6456?_0x1b6731[_0x76d7('0x1e')]:_0x27eed6['offset']+_0x27eed6[_0x76d7('0x1d')];var _0x18e40a;if(_0x441a9c>=_0x42e9b7){_0x441a9c=_0x42e9b7;_0x18e40a=0xc8;}else{_0x18e40a=0xce;}_0x1dc3d8[_0x76d7('0x18')](_0x18e40a);return _0x1dc3d8['set'](_0x76d7('0x1f'),_0xd49275+'-'+_0x441a9c+'/'+_0x42e9b7)[_0x76d7('0x1a')](_0x1b6731);}return null;};}function patchUpdates(_0x4aba19){return function(_0x170b7d){try{jsonpatch[_0x76d7('0x20')](_0x170b7d,_0x4aba19,!![]);}catch(_0x1363fb){return BPromise['reject'](_0x1363fb);}return _0x170b7d['save']();};}function saveUpdates(_0x1756d0,_0x1997df){return function(_0xf202b6){if(_0xf202b6){return _0xf202b6[_0x76d7('0x21')](_0x1756d0)[_0x76d7('0x22')](function(_0x4dcf81){return _0x4dcf81;});}return null;};}function removeEntity(_0x552539,_0x4afc1b){return function(_0x3ddd1f){if(_0x3ddd1f){return _0x3ddd1f[_0x76d7('0x23')]()['then'](function(){var _0x44fc37=_0x3ddd1f[_0x76d7('0x24')]({'plain':!![]});var _0x3ec48a=_0x76d7('0x25');return db[_0x76d7('0x26')][_0x76d7('0x23')]({'where':{'type':_0x3ec48a,'resourceId':_0x44fc37['id']}})[_0x76d7('0x22')](function(){return _0x3ddd1f;});})[_0x76d7('0x22')](function(){_0x552539[_0x76d7('0x18')](0xcc)[_0x76d7('0x19')]();});}};}function handleEntityNotFound(_0x2f3c44,_0x479585){return function(_0x24f151){if(!_0x24f151){_0x2f3c44[_0x76d7('0x17')](0x194);}return _0x24f151;};}function handleError(_0x272b32,_0x352032){_0x352032=_0x352032||0x1f4;return function(_0x4e61da){logger[_0x76d7('0x27')](_0x4e61da[_0x76d7('0x28')]);if(_0x4e61da[_0x76d7('0x29')]){delete _0x4e61da[_0x76d7('0x29')];}_0x272b32[_0x76d7('0x18')](_0x352032)[_0x76d7('0x2a')](_0x4e61da);};}exports[_0x76d7('0x2b')]=function(_0x3c3636,_0x1cb832){var _0x115069={},_0xe62031={},_0x6dba03={'count':0x0,'rows':[]};var _0x178574=_['map'](db[_0x76d7('0x2c')]['rawAttributes'],function(_0xf4a3dd){return{'name':_0xf4a3dd['fieldName'],'type':_0xf4a3dd[_0x76d7('0x2d')]['key']};});_0xe62031['model']=_[_0x76d7('0x2e')](_0x178574,_0x76d7('0x29'));_0xe62031[_0x76d7('0x2f')]=_[_0x76d7('0x30')](_0x3c3636[_0x76d7('0x2f')]);_0xe62031['filters']=_[_0x76d7('0x31')](_0xe62031[_0x76d7('0x32')],_0xe62031[_0x76d7('0x2f')]);_0x115069[_0x76d7('0x33')]=_[_0x76d7('0x31')](_0xe62031['model'],qs[_0x76d7('0x34')](_0x3c3636[_0x76d7('0x2f')][_0x76d7('0x34')]));_0x115069[_0x76d7('0x33')]=_0x115069[_0x76d7('0x33')][_0x76d7('0x35')]?_0x115069[_0x76d7('0x33')]:_0xe62031[_0x76d7('0x32')];if(!_0x3c3636[_0x76d7('0x2f')]['hasOwnProperty'](_0x76d7('0x36'))){_0x115069[_0x76d7('0x1d')]=qs['limit'](_0x3c3636[_0x76d7('0x2f')][_0x76d7('0x1d')]);_0x115069[_0x76d7('0x1b')]=qs['offset'](_0x3c3636[_0x76d7('0x2f')][_0x76d7('0x1b')]);}_0x115069[_0x76d7('0x37')]=qs[_0x76d7('0x38')](_0x3c3636[_0x76d7('0x2f')]['sort']);_0x115069[_0x76d7('0x39')]=qs[_0x76d7('0x3a')](_[_0x76d7('0x3b')](_0x3c3636[_0x76d7('0x2f')],_0xe62031['filters']),_0x178574);if(_0x3c3636[_0x76d7('0x2f')][_0x76d7('0x3c')]){_0x115069[_0x76d7('0x39')]=_[_0x76d7('0x3d')](_0x115069['where'],{'$or':_['map'](_0x178574,function(_0x9b82c4){if(_0x9b82c4[_0x76d7('0x2d')]!==_0x76d7('0x3e')){var _0x1bd05c={};_0x1bd05c[_0x9b82c4[_0x76d7('0x29')]]={'$like':'%'+_0x3c3636[_0x76d7('0x2f')][_0x76d7('0x3c')]+'%'};return _0x1bd05c;}})});}_0x115069=_[_0x76d7('0x3d')]({},_0x115069,_0x3c3636[_0x76d7('0x3f')]);var _0x3a4385={'where':_0x115069[_0x76d7('0x39')]};return db[_0x76d7('0x2c')]['count'](_0x3a4385)[_0x76d7('0x22')](function(_0x396719){_0x6dba03[_0x76d7('0x1e')]=_0x396719;if(_0x3c3636['query'][_0x76d7('0x40')]){_0x115069[_0x76d7('0x41')]=[{'all':!![]}];}return db[_0x76d7('0x2c')][_0x76d7('0x42')](_0x115069);})[_0x76d7('0x22')](function(_0x33605d){_0x6dba03[_0x76d7('0x43')]=_0x33605d;return _0x6dba03;})['then'](respondWithFilteredResult(_0x1cb832,_0x115069))[_0x76d7('0x44')](handleError(_0x1cb832,null));};exports[_0x76d7('0x45')]=function(_0x544e0c,_0x1a6a1d){var _0x1cdabc={'raw':!![],'where':{'id':_0x544e0c[_0x76d7('0x46')]['id']}},_0x59bbc9={};_0x59bbc9[_0x76d7('0x32')]=_[_0x76d7('0x30')](db[_0x76d7('0x2c')][_0x76d7('0x47')]);_0x59bbc9[_0x76d7('0x2f')]=_[_0x76d7('0x30')](_0x544e0c[_0x76d7('0x2f')]);_0x59bbc9[_0x76d7('0x3a')]=_[_0x76d7('0x31')](_0x59bbc9[_0x76d7('0x32')],_0x59bbc9['query']);_0x1cdabc[_0x76d7('0x33')]=_[_0x76d7('0x31')](_0x59bbc9[_0x76d7('0x32')],qs[_0x76d7('0x34')](_0x544e0c[_0x76d7('0x2f')][_0x76d7('0x34')]));_0x1cdabc[_0x76d7('0x33')]=_0x1cdabc[_0x76d7('0x33')]['length']?_0x1cdabc[_0x76d7('0x33')]:_0x59bbc9[_0x76d7('0x32')];if(_0x544e0c[_0x76d7('0x2f')][_0x76d7('0x40')]){_0x1cdabc[_0x76d7('0x41')]=[{'all':!![]}];}_0x1cdabc=_[_0x76d7('0x3d')]({},_0x1cdabc,_0x544e0c[_0x76d7('0x3f')]);return db[_0x76d7('0x2c')][_0x76d7('0x48')](_0x1cdabc)[_0x76d7('0x22')](handleEntityNotFound(_0x1a6a1d,null))[_0x76d7('0x22')](respondWithResult(_0x1a6a1d,null))[_0x76d7('0x44')](handleError(_0x1a6a1d,null));};exports[_0x76d7('0x49')]=function(_0x419a24,_0x21e9c3){return db['Pause'][_0x76d7('0x49')](_0x419a24[_0x76d7('0x4a')],{})[_0x76d7('0x22')](function(_0x5236d4){var _0x5d72b2=_0x419a24[_0x76d7('0x4b')][_0x76d7('0x24')]({'plain':!![]});if(!_0x5d72b2)throw new Error(_0x76d7('0x4c'));if(_0x5d72b2['role']===_0x76d7('0x4b')){var _0x4e5ae6=_0x5236d4['get']({'plain':!![]});var _0x6744eb='Pauses';return db[_0x76d7('0x4d')][_0x76d7('0x48')]({'where':{'name':_0x6744eb,'userProfileId':_0x5d72b2['userProfileId']},'raw':!![]})[_0x76d7('0x22')](function(_0x54e422){if(_0x54e422&&_0x54e422[_0x76d7('0x4e')]===0x0){return db[_0x76d7('0x26')][_0x76d7('0x49')]({'name':_0x4e5ae6[_0x76d7('0x29')],'resourceId':_0x4e5ae6['id'],'type':_0x54e422[_0x76d7('0x29')],'sectionId':_0x54e422['id']},{})['then'](function(){return _0x5236d4;});}else{return _0x5236d4;}})[_0x76d7('0x44')](function(_0x97df8a){logger[_0x76d7('0x27')](_0x76d7('0x4f'),_0x97df8a);throw _0x97df8a;});}return _0x5236d4;})[_0x76d7('0x22')](respondWithResult(_0x21e9c3,0xc9))[_0x76d7('0x44')](handleError(_0x21e9c3,null));};exports[_0x76d7('0x21')]=function(_0xa790d8,_0x49a4d6){if(_0xa790d8[_0x76d7('0x4a')]['id']){delete _0xa790d8['body']['id'];}return db[_0x76d7('0x2c')][_0x76d7('0x48')]({'where':{'id':_0xa790d8[_0x76d7('0x46')]['id']}})[_0x76d7('0x22')](handleEntityNotFound(_0x49a4d6,null))[_0x76d7('0x22')](saveUpdates(_0xa790d8[_0x76d7('0x4a')],null))[_0x76d7('0x22')](respondWithResult(_0x49a4d6,null))['catch'](handleError(_0x49a4d6,null));};exports[_0x76d7('0x23')]=function(_0x2145be,_0x55b62c){return db[_0x76d7('0x2c')][_0x76d7('0x48')]({'where':{'id':_0x2145be[_0x76d7('0x46')]['id']}})['then'](handleEntityNotFound(_0x55b62c,null))['then'](removeEntity(_0x55b62c,null))['catch'](handleError(_0x55b62c,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 4d4b591..ebe57e1 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 _0x326f=['tools_pauses','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','define','Pause'];(function(_0x15a076,_0x551d39){var _0x100ff0=function(_0xaca72a){while(--_0xaca72a){_0x15a076['push'](_0x15a076['shift']());}};_0x100ff0(++_0x551d39);}(_0x326f,0xd1));var _0xf326=function(_0x52c24f,_0x428aba){_0x52c24f=_0x52c24f-0x0;var _0x56e767=_0x326f[_0x52c24f];return _0x56e767;};'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':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./pause.attributes','exports','define','Pause','tools_pauses','lodash','util','../../config/logger','api','moment'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xc4aa[_0x3ab51d];return _0x29a04e;};'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 diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index 69baf88..056b07d 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(_0x3d1e25,_0x251b4d){var _0x78b4d5=function(_0x47618f){while(--_0x47618f){_0x3d1e25['push'](_0x3d1e25['shift']());}};_0x78b4d5(++_0x251b4d);}(_0x7a54,0x106));var _0x47a5=function(_0x254f9c,_0x511f49){_0x254f9c=_0x254f9c-0x0;var _0x4e5247=_0x7a54[_0x254f9c];return _0x4e5247;};'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(_0x3bb3b7,_0x512808){var _0x46aafc=function(_0x20642e){while(--_0x20642e){_0x3bb3b7['push'](_0x3bb3b7['shift']());}};_0x46aafc(++_0x512808);}(_0x7a54,0x106));var _0x47a5=function(_0x174fc6,_0x85456){_0x174fc6=_0x174fc6-0x0;var _0x77d98e=_0x7a54[_0x174fc6];return _0x77d98e;};'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 f691d9b..c16a9f4 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 _0xb458=['show','/:id/download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','isAuthenticated'];(function(_0x547c63,_0x38c9d4){var _0x27a995=function(_0x5285e2){while(--_0x5285e2){_0x547c63['push'](_0x547c63['shift']());}};_0x27a995(++_0x38c9d4);}(_0xb458,0x103));var _0x8b45=function(_0x58e504,_0x8ec848){_0x58e504=_0x58e504-0x0;var _0x31917f=_0xb458[_0x58e504];return _0x31917f;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),controller[_0x8b45('0xb')]);router[_0x8b45('0x9')]('/:id',auth[_0x8b45('0xc')](),controller[_0x8b45('0xd')]);router[_0x8b45('0x9')](_0x8b45('0xe'),auth[_0x8b45('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x8b45('0xf')]({'destination':function(_0x7cc49b,_0x57faf9,_0x5316af){_0x5316af(null,path['join'](config['root'],_0x8b45('0x10')));},'filename':function(_0x285728,_0x37c220,_0x52c4db){_0x37c220[_0x8b45('0x11')]=_0x37c220[_0x8b45('0x11')][_0x8b45('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52c4db(null,util[_0x8b45('0x13')](_0x8b45('0x14'),path[_0x8b45('0x15')](_0x37c220['originalname'],path['extname'](_0x37c220[_0x8b45('0x11')])),Date[_0x8b45('0x16')](),path[_0x8b45('0x17')](_0x37c220[_0x8b45('0x11')])));}})});router[_0x8b45('0x18')]('/',upload[_0x8b45('0x19')](_0x8b45('0x1a')),controller[_0x8b45('0x1b')]);router[_0x8b45('0x18')](_0x8b45('0xa'),controller[_0x8b45('0x1c')]);router[_0x8b45('0x1d')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller[_0x8b45('0x1f')]);router[_0x8b45('0x20')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller['delete']);module[_0x8b45('0x21')]=router; \ No newline at end of file +var _0x2123=['join','root','server/files/plugins','originalname','replace','format','%s-%s%s','basename','extname','now','single','file','upload','post','webhookPost','put','update','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./plugin.controller','get','index','/webhook','isAuthenticated','show','/:id/download','diskStorage'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x2123,0x190));var _0x3212=function(_0x238b4b,_0x2fe72d){_0x238b4b=_0x238b4b-0x0;var _0x4fe904=_0x2123[_0x238b4b];return _0x4fe904;};'use strict';var multer=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var path=require(_0x3212('0x2'));var timeout=require(_0x3212('0x3'));var express=require(_0x3212('0x4'));var router=express[_0x3212('0x5')]();var fs_extra=require(_0x3212('0x6'));var auth=require(_0x3212('0x7'));var interaction=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var controller=require(_0x3212('0xa'));router[_0x3212('0xb')]('/',auth['isAuthenticated'](),controller[_0x3212('0xc')]);router[_0x3212('0xb')](_0x3212('0xd'),controller['webhookGet']);router[_0x3212('0xb')]('/:id',auth[_0x3212('0xe')](),controller[_0x3212('0xf')]);router[_0x3212('0xb')](_0x3212('0x10'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x3212('0x11')]({'destination':function(_0xf166c2,_0x1a3b2f,_0x23f7e3){_0x23f7e3(null,path[_0x3212('0x12')](config[_0x3212('0x13')],_0x3212('0x14')));},'filename':function(_0x359cef,_0x26c1c8,_0x2d5fce){_0x26c1c8[_0x3212('0x15')]=_0x26c1c8[_0x3212('0x15')][_0x3212('0x16')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2d5fce(null,util[_0x3212('0x17')](_0x3212('0x18'),path[_0x3212('0x19')](_0x26c1c8[_0x3212('0x15')],path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])),Date[_0x3212('0x1b')](),path[_0x3212('0x1a')](_0x26c1c8[_0x3212('0x15')])));}})});router['post']('/',upload[_0x3212('0x1c')](_0x3212('0x1d')),controller[_0x3212('0x1e')]);router[_0x3212('0x1f')](_0x3212('0xd'),controller[_0x3212('0x20')]);router[_0x3212('0x21')]('/:id',auth['isAuthenticated'](),controller[_0x3212('0x22')]);router['delete'](_0x3212('0x23'),auth[_0x3212('0xe')](),controller[_0x3212('0x24')]);module[_0x3212('0x25')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 8e5833f..f63f11a 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 _0x9dd1=['STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','html','script','TEXT'];(function(_0x44c325,_0x19c625){var _0x55f09e=function(_0x322d1b){while(--_0x322d1b){_0x44c325['push'](_0x44c325['shift']());}};_0x55f09e(++_0x19c625);}(_0x9dd1,0x12f));var _0x19dd=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0x9dd1[_0x1627ae];return _0x34b38f;};'use strict';var Sequelize=require(_0x19dd('0x0'));module[_0x19dd('0x1')]={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x19dd('0x2'),_0x19dd('0x3'))},'description':{'type':Sequelize[_0x19dd('0x4')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x19dd('0x5')],'comment':_0x19dd('0x6')},'active':{'type':Sequelize[_0x19dd('0x7')],'defaultValue':0x0,'comment':_0x19dd('0x8')},'sidebar':{'type':Sequelize[_0x19dd('0x9')](_0x19dd('0xa'),'agentOnly','always',_0x19dd('0xb')),'defaultValue':_0x19dd('0xc'),'comment':_0x19dd('0xd')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x19dd('0x5')]},'agentUrl':{'type':Sequelize[_0x19dd('0x5')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x726f=['STRING','ENUM','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x1031cd,_0x25100d){var _0x51793e=function(_0xffd5cd){while(--_0xffd5cd){_0x1031cd['push'](_0x1031cd['shift']());}};_0x51793e(++_0x25100d);}(_0x726f,0xc6));var _0xf726=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x726f[_0x53ccf2];return _0x5a2964;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf726('0x0')]},'type':{'type':Sequelize[_0xf726('0x1')]('html',_0xf726('0x2'))},'description':{'type':Sequelize[_0xf726('0x3')]},'version':{'type':Sequelize[_0xf726('0x3')]},'path':{'type':Sequelize[_0xf726('0x0')],'comment':_0xf726('0x4')},'active':{'type':Sequelize[_0xf726('0x5')],'defaultValue':0x0,'comment':_0xf726('0x6')},'sidebar':{'type':Sequelize[_0xf726('0x1')]('adminOnly',_0xf726('0x7'),_0xf726('0x8'),_0xf726('0x9')),'defaultValue':_0xf726('0x8'),'comment':_0xf726('0xa')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0xf726('0x0')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0xf726('0x0')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b31bca4..5de9e4e 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 _0x115e=['json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','Plugins','UserProfileResource','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','keys','fields','find','path','join','root','server/files/plugins','format','createWriteStream','warning','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','dirname','basename','node_modules/**/*','attachments/**/*','finalize','close','download','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','chmodSync','readdirSync','length','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','manifest.json','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','Invalid\x20manifest:\x20parameters\x20missing','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','test','plugins','script','create','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Extracted\x20folder\x20removed','update','delete','webhookGet','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','statusCode','webhookPost','resolve','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./plugin.socket','register','sendStatus','status'];(function(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0x115e,0x1df));var _0xe115=function(_0x54b7d1,_0x51504c){_0x54b7d1=_0x54b7d1-0x0;var _0x38ad9b=_0x115e[_0x54b7d1];return _0x38ad9b;};'use strict';var emlformat=require(_0xe115('0x0'));var rimraf=require(_0xe115('0x1'));var zipdir=require(_0xe115('0x2'));var jsonpatch=require(_0xe115('0x3'));var rp=require(_0xe115('0x4'));var moment=require(_0xe115('0x5'));var BPromise=require(_0xe115('0x6'));var Mustache=require(_0xe115('0x7'));var util=require(_0xe115('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xe115('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe115('0xa'));var _=require(_0xe115('0xb'));var squel=require('squel');var crypto=require(_0xe115('0xc'));var jsforce=require(_0xe115('0xd'));var deskjs=require(_0xe115('0xe'));var toCsv=require(_0xe115('0x9'));var querystring=require(_0xe115('0xf'));var Papa=require(_0xe115('0x10'));var extract=require(_0xe115('0x11'));var rimraf=require('rimraf');var archiver=require(_0xe115('0x12'));var Redis=require('ioredis');var authService=require(_0xe115('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe115('0x14'));var hardwareService=require(_0xe115('0x15'));var logger=require(_0xe115('0x16'))(_0xe115('0x17'));var utils=require(_0xe115('0x18'));var config=require(_0xe115('0x19'));var licenseUtil=require(_0xe115('0x1a'));var db=require(_0xe115('0x1b'))['db'];config[_0xe115('0x1c')]=_[_0xe115('0x1d')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe115('0x1e'))[_0xe115('0x1f')](socket);function respondWithStatusCode(_0x100220,_0xab38a4){_0xab38a4=_0xab38a4||0xcc;return function(_0x212e85){if(_0x212e85){return _0x100220[_0xe115('0x20')](_0xab38a4);}return _0x100220[_0xe115('0x21')](_0xab38a4)['end']();};}function respondWithResult(_0x2f962b,_0x30ecc2){_0x30ecc2=_0x30ecc2||0xc8;return function(_0x5959fa){if(_0x5959fa){return _0x2f962b[_0xe115('0x21')](_0x30ecc2)[_0xe115('0x22')](_0x5959fa);}};}function respondWithFilteredResult(_0x11ba99,_0xcc03de){return function(_0x5eb04e){if(_0x5eb04e){var _0x5233f4=typeof _0xcc03de[_0xe115('0x23')]===_0xe115('0x24')&&typeof _0xcc03de[_0xe115('0x25')]===_0xe115('0x24');var _0x92c414=_0x5eb04e['count'];var _0x57ddbb=_0x5233f4?0x0:_0xcc03de[_0xe115('0x23')];var _0x513d53=_0x5233f4?_0x5eb04e[_0xe115('0x26')]:_0xcc03de[_0xe115('0x23')]+_0xcc03de[_0xe115('0x25')];var _0x74496d;if(_0x513d53>=_0x92c414){_0x513d53=_0x92c414;_0x74496d=0xc8;}else{_0x74496d=0xce;}_0x11ba99[_0xe115('0x21')](_0x74496d);return _0x11ba99[_0xe115('0x27')](_0xe115('0x28'),_0x57ddbb+'-'+_0x513d53+'/'+_0x92c414)[_0xe115('0x22')](_0x5eb04e);}return null;};}function patchUpdates(_0x141c81){return function(_0x2d6fa9){try{jsonpatch[_0xe115('0x29')](_0x2d6fa9,_0x141c81,!![]);}catch(_0x3e0d80){return BPromise[_0xe115('0x2a')](_0x3e0d80);}return _0x2d6fa9[_0xe115('0x2b')]();};}function saveUpdates(_0x314091,_0x1fc576){return function(_0x53644c){if(_0x53644c){return _0x53644c['update'](_0x314091)[_0xe115('0x2c')](function(_0x1f38eb){return _0x1f38eb;});}return null;};}function removeEntity(_0xfb59e,_0x17ad83){return function(_0x2b5110){if(_0x2b5110){return _0x2b5110[_0xe115('0x2d')]()['then'](function(){var _0x3fac52=_0x2b5110['get']({'plain':!![]});var _0x1db6fd=_0xe115('0x2e');return db[_0xe115('0x2f')][_0xe115('0x2d')]({'where':{'type':_0x1db6fd,'resourceId':_0x3fac52['id']}})['then'](function(){return _0x2b5110;});})[_0xe115('0x2c')](function(){_0xfb59e[_0xe115('0x21')](0xcc)[_0xe115('0x30')]();});}};}function handleEntityNotFound(_0x38916d,_0x27fdc1){return function(_0x130380){if(!_0x130380){_0x38916d[_0xe115('0x20')](0x194);}return _0x130380;};}function handleError(_0x1d0a18,_0x3a9916){_0x3a9916=_0x3a9916||0x1f4;return function(_0xc9310d){logger[_0xe115('0x31')](_0xc9310d[_0xe115('0x32')]);if(_0xc9310d[_0xe115('0x33')]){delete _0xc9310d[_0xe115('0x33')];}_0x1d0a18[_0xe115('0x21')](_0x3a9916)[_0xe115('0x34')](_0xc9310d);};}exports[_0xe115('0x35')]=function(_0x589dbd,_0x91db91){var _0x1f82f7={},_0x21b11d={},_0x1957d2={'count':0x0,'rows':[]};var _0x500301=_[_0xe115('0x36')](db[_0xe115('0x37')][_0xe115('0x38')],function(_0x4f9758){return{'name':_0x4f9758[_0xe115('0x39')],'type':_0x4f9758[_0xe115('0x3a')][_0xe115('0x3b')]};});_0x21b11d[_0xe115('0x3c')]=_[_0xe115('0x36')](_0x500301,_0xe115('0x33'));_0x21b11d[_0xe115('0x3d')]=_['keys'](_0x589dbd[_0xe115('0x3d')]);_0x21b11d[_0xe115('0x3e')]=_[_0xe115('0x3f')](_0x21b11d[_0xe115('0x3c')],_0x21b11d[_0xe115('0x3d')]);_0x1f82f7['attributes']=_[_0xe115('0x3f')](_0x21b11d[_0xe115('0x3c')],qs['fields'](_0x589dbd[_0xe115('0x3d')]['fields']));_0x1f82f7[_0xe115('0x40')]=_0x1f82f7[_0xe115('0x40')]['length']?_0x1f82f7['attributes']:_0x21b11d[_0xe115('0x3c')];if(!_0x589dbd['query'][_0xe115('0x41')](_0xe115('0x42'))){_0x1f82f7[_0xe115('0x25')]=qs[_0xe115('0x25')](_0x589dbd[_0xe115('0x3d')]['limit']);_0x1f82f7[_0xe115('0x23')]=qs[_0xe115('0x23')](_0x589dbd[_0xe115('0x3d')][_0xe115('0x23')]);}_0x1f82f7['order']=qs['sort'](_0x589dbd[_0xe115('0x3d')][_0xe115('0x43')]);_0x1f82f7[_0xe115('0x44')]=qs[_0xe115('0x3e')](_[_0xe115('0x45')](_0x589dbd[_0xe115('0x3d')],_0x21b11d[_0xe115('0x3e')]),_0x500301);if(_0x589dbd[_0xe115('0x3d')][_0xe115('0x46')]){_0x1f82f7[_0xe115('0x44')]=_[_0xe115('0x47')](_0x1f82f7[_0xe115('0x44')],{'$or':_[_0xe115('0x36')](_0x500301,function(_0x13c300){if(_0x13c300['type']!==_0xe115('0x48')){var _0x3e3b15={};_0x3e3b15[_0x13c300[_0xe115('0x33')]]={'$like':'%'+_0x589dbd['query'][_0xe115('0x46')]+'%'};return _0x3e3b15;}})});}_0x1f82f7=_[_0xe115('0x47')]({},_0x1f82f7,_0x589dbd['options']);var _0x3099ed={'where':_0x1f82f7['where']};return db['Plugin']['count'](_0x3099ed)[_0xe115('0x2c')](function(_0x40df64){_0x1957d2[_0xe115('0x26')]=_0x40df64;if(_0x589dbd[_0xe115('0x3d')][_0xe115('0x49')]){_0x1f82f7[_0xe115('0x4a')]=[{'all':!![]}];}return db[_0xe115('0x37')]['findAll'](_0x1f82f7);})[_0xe115('0x2c')](function(_0x421eb5){_0x1957d2[_0xe115('0x4b')]=_0x421eb5;return _0x1957d2;})[_0xe115('0x2c')](respondWithFilteredResult(_0x91db91,_0x1f82f7))[_0xe115('0x4c')](handleError(_0x91db91,null));};exports['show']=function(_0x1e18a0,_0x4911d0){var _0x331b8a={'raw':!![],'where':{'id':_0x1e18a0[_0xe115('0x4d')]['id']}},_0x11a2c6={};_0x11a2c6[_0xe115('0x3c')]=_[_0xe115('0x4e')](db[_0xe115('0x37')][_0xe115('0x38')]);_0x11a2c6[_0xe115('0x3d')]=_[_0xe115('0x4e')](_0x1e18a0[_0xe115('0x3d')]);_0x11a2c6[_0xe115('0x3e')]=_[_0xe115('0x3f')](_0x11a2c6['model'],_0x11a2c6[_0xe115('0x3d')]);_0x331b8a[_0xe115('0x40')]=_[_0xe115('0x3f')](_0x11a2c6[_0xe115('0x3c')],qs[_0xe115('0x4f')](_0x1e18a0['query'][_0xe115('0x4f')]));_0x331b8a['attributes']=_0x331b8a[_0xe115('0x40')]['length']?_0x331b8a[_0xe115('0x40')]:_0x11a2c6[_0xe115('0x3c')];if(_0x1e18a0[_0xe115('0x3d')]['includeAll']){_0x331b8a['include']=[{'all':!![]}];}_0x331b8a=_['merge']({},_0x331b8a,_0x1e18a0['options']);return db[_0xe115('0x37')][_0xe115('0x50')](_0x331b8a)[_0xe115('0x2c')](handleEntityNotFound(_0x4911d0,null))['then'](respondWithResult(_0x4911d0,null))['catch'](handleError(_0x4911d0,null));};exports['download']=function(_0x58adac,_0x5aa11c,_0x289ff5){return db[_0xe115('0x37')][_0xe115('0x50')]({'where':{'id':_0x58adac[_0xe115('0x4d')]['id']},'attributes':[_0xe115('0x33'),_0xe115('0x51')],'raw':!![]})['then'](handleEntityNotFound(_0x5aa11c,null))[_0xe115('0x2c')](function(_0x354ea6){if(_0x354ea6){var _0x2ad32b=path[_0xe115('0x52')](config[_0xe115('0x53')],_0xe115('0x54'),util[_0xe115('0x55')]('%s.zip',path['basename'](_0x354ea6[_0xe115('0x51')])));var _0xe61f6d=fs[_0xe115('0x56')](_0x2ad32b);var _0x1a16ee=archiver('zip',{'zlib':{'level':0x9}});_0x1a16ee['on'](_0xe115('0x57'),function(_0x26c9b6){if(_0x26c9b6['code']===_0xe115('0x58')){logger[_0xe115('0x31')](_0x26c9b6);}else{throw new db[(_0xe115('0x59'))][(_0xe115('0x5a'))](_0xe115('0x5b'));}});_0x1a16ee['on']('error',function(_0x248247){throw new db['Sequelize'][(_0xe115('0x5a'))](_0xe115('0x5b'));});_0x1a16ee[_0xe115('0x5c')](_0xe61f6d);_0x1a16ee[_0xe115('0x5d')](_0xe115('0x5e'),{'cwd':path['join'](config[_0xe115('0x53')],_0xe115('0x54'),path[_0xe115('0x5f')](_0x354ea6['path'])),'ignore':[path[_0xe115('0x52')](path[_0xe115('0x60')](_0x354ea6[_0xe115('0x51')]),_0xe115('0x61')),path[_0xe115('0x52')](path[_0xe115('0x60')](_0x354ea6['path']),_0xe115('0x62'))],'nodir':!![]})[_0xe115('0x63')]();_0xe61f6d['on'](_0xe115('0x64'),function(){if(!fs['existsSync'](_0x2ad32b)){throw new db[(_0xe115('0x59'))][(_0xe115('0x5a'))]('Plugin\x20not\x20found');}return _0x5aa11c[_0xe115('0x65')](_0x2ad32b,util[_0xe115('0x55')]('%s.zip',path[_0xe115('0x60')](_0x354ea6[_0xe115('0x51')])),function(_0x1c2b9e){if(_0x1c2b9e){throw new db[(_0xe115('0x59'))][(_0xe115('0x5a'))](_0xe115('0x66'));}fs[_0xe115('0x67')](_0x2ad32b);logger['info'](_0xe115('0x68'));logger[_0xe115('0x69')](_0xe115('0x6a'));});});}return null;})[_0xe115('0x4c')](handleError(_0x5aa11c,null));};exports[_0xe115('0x6b')]=function(_0x3b9999,_0x5500cf,_0x177b33){var _0x122ca2=path['basename'](_0x3b9999[_0xe115('0x6c')][_0xe115('0x6d')],path['extname'](_0x3b9999[_0xe115('0x6c')][_0xe115('0x6d')]));var _0x183c9c=path[_0xe115('0x52')](config[_0xe115('0x53')],_0xe115('0x54'),_0x3b9999[_0xe115('0x6c')][_0xe115('0x6d')]);var _0x334dd0=path[_0xe115('0x52')](config[_0xe115('0x53')],_0xe115('0x54'),_0x122ca2);logger[_0xe115('0x69')](_0xe115('0x6e'),_0x183c9c);logger[_0xe115('0x69')]('Plugin\x20upload\x20destination:\x20%s',_0x334dd0);try{fs[_0xe115('0x6f')](_0x183c9c,parseInt('0777',0x8));extract(_0x183c9c,{'dir':_0x334dd0},function(_0x5bc5be){if(_0x5bc5be){logger[_0xe115('0x31')](_0x5bc5be);handleError(_0x5bc5be,!![]);};var _0x4aa606=fs[_0xe115('0x70')](_0x334dd0);if(_0x4aa606[_0xe115('0x71')]>0x1){removeReferences(_0x183c9c,_0x334dd0);logger[_0xe115('0x31')]('Invalid\x20plugin\x20structure');return _0x177b33(new Error(_0xe115('0x72')));}var _0x3474be=fs[_0xe115('0x73')](path[_0xe115('0x52')](_0x334dd0,_0x4aa606[0x0]));if(_0x3474be['isFile']()){removeReferences(_0x183c9c,_0x334dd0);logger[_0xe115('0x31')](_0xe115('0x72'));return _0x177b33(new Error(_0xe115('0x72')));}if(_0x3474be[_0xe115('0x74')]()){var _0x18120e=fs[_0xe115('0x70')](path[_0xe115('0x52')](_0x334dd0,_0x4aa606[0x0]));if(_0x18120e[_0xe115('0x71')]===0x0){removeReferences(_0x183c9c,_0x334dd0);logger[_0xe115('0x31')](_0xe115('0x72'));return _0x177b33(new Error(_0xe115('0x72')));}var _0x135d30=_0x18120e[_0xe115('0x75')](function(_0x5f33c7){return _0x5f33c7===_0xe115('0x76');});if(!_0x135d30){return _0x177b33(new Error('Plugin\x20manifest\x20missing'));}var _0x5e9e63=fs['readFileSync'](path[_0xe115('0x52')](_0x334dd0,_0x4aa606[0x0],_0xe115('0x76')));var _0xa3ec09=JSON[_0xe115('0x77')](_0x5e9e63);if(_0xe115('0x24')==typeof _0xa3ec09['name']){return _0x177b33(new Error(_0xe115('0x78')));}if('undefined'==typeof _0xa3ec09[_0xe115('0x3a')]){return _0x177b33(new Error(_0xe115('0x79')));}if(_0xe115('0x24')==typeof _0xa3ec09[_0xe115('0x7a')]){return _0x177b33(new Error(_0xe115('0x7b')));}if(_0xe115('0x24')==typeof _0xa3ec09['parameters']){return _0x177b33(new Error(_0xe115('0x7c')));}if(_0xa3ec09[_0xe115('0x3a')]==='html'){if(_0xe115('0x24')==typeof _0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')]){return _0x177b33(new Error(_0xe115('0x7f')));}if(_0xe115('0x24')==typeof _0xa3ec09[_0xe115('0x7d')]['views'][_0xe115('0x80')]&&_0xe115('0x24')==typeof _0xa3ec09['parameters'][_0xe115('0x7e')][_0xe115('0x81')]){return _0x177b33(new Error(_0xe115('0x82')));}}else if(_0xa3ec09[_0xe115('0x3a')]==='script'){if(_0xe115('0x24')==typeof _0xa3ec09['parameters'][_0xe115('0x83')]){return _0x177b33(new Error(_0xe115('0x84')));}if(_0xe115('0x24')==typeof _0xa3ec09[_0xe115('0x7d')][_0xe115('0x85')]){return _0x177b33(new Error(_0xe115('0x86')));}}else{return _0x177b33(new Error(_0xe115('0x87')));}var _0x1303d9=_0xa3ec09[_0xe115('0x33')];var _0x5db435=_0xa3ec09[_0xe115('0x88')];var _0xd51cb4=_0xa3ec09['type'];var _0x32844c=_0xa3ec09[_0xe115('0x89')]?_0xa3ec09[_0xe115('0x89')]:_0xe115('0x8a');var _0x223fe0=_0xa3ec09[_0xe115('0x8b')]?_0xa3ec09[_0xe115('0x8b')]:_0xe115('0x8c');var _0x333514='';var _0x30471a='';var _0x58fe20='';var _0x8a3cba='';var _0x972ec7=_0xa3ec09[_0xe115('0x7a')];if(_0xd51cb4===_0xe115('0x8d')){if('undefined'!=typeof _0xa3ec09['parameters'][_0xe115('0x7e')][_0xe115('0x80')]){var _0x278388=_0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xe115('0x8e')](_0x278388)){_0x333514=path[_0xe115('0x52')]('plugins',_0x122ca2,_0x4aa606[0x0],_0x278388);}else{_0x333514=_0x278388;}}else{logger['info']('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xe115('0x24')!=typeof _0xa3ec09[_0xe115('0x7d')]['views']['agent']){var _0x55ad9c=_0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')][_0xe115('0x81')];if(!/^(f|ht)tps?:\/\//i['test'](_0x55ad9c)){_0x30471a=path[_0xe115('0x52')](_0xe115('0x8f'),_0x122ca2,_0x4aa606[0x0],_0x55ad9c);}else{_0x30471a=_0x55ad9c;}}else{logger[_0xe115('0x69')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xd51cb4===_0xe115('0x90')){_0x58fe20=_0xa3ec09[_0xe115('0x7d')][_0xe115('0x83')];_0x8a3cba=_0xa3ec09[_0xe115('0x7d')][_0xe115('0x85')];if(_0xe115('0x24')!=typeof _0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')]){if(_0xe115('0x24')!=typeof _0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')][_0xe115('0x80')]){var _0x278388=_0xa3ec09['parameters'][_0xe115('0x7e')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xe115('0x8e')](_0x278388)){_0x333514=path[_0xe115('0x52')](_0xe115('0x8f'),_0x122ca2,_0x4aa606[0x0],_0x278388);}else{_0x333514=_0x278388;}}if(_0xe115('0x24')!=typeof _0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')][_0xe115('0x81')]){var _0x55ad9c=_0xa3ec09[_0xe115('0x7d')][_0xe115('0x7e')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xe115('0x8e')](_0x55ad9c)){_0x30471a=path[_0xe115('0x52')]('plugins',_0x122ca2,_0x4aa606[0x0],_0x55ad9c);}else{_0x30471a=_0x55ad9c;}}}}var _0x3b3ae8={'name':_0x1303d9,'description':_0x5db435,'path':path['join'](_0x122ca2,_0x4aa606[0x0]),'type':_0xd51cb4,'sidebar':_0x32844c,'icon':_0x223fe0,'adminUrl':_0x333514,'agentUrl':_0x30471a,'scriptName':_0x58fe20,'scriptPath':_0x8a3cba,'version':_0x972ec7};removeReferences(_0x183c9c,null);return db['Plugin'][_0xe115('0x91')](_0x3b3ae8)[_0xe115('0x2c')](function(_0x2ecae4){var _0x5de5a8={'role':_0x3b9999['body']['role'],'userProfileId':_0x3b9999[_0xe115('0x92')][_0xe115('0x93')]};if(!_0x5de5a8)throw new Error(_0xe115('0x94'));if(_0x5de5a8[_0xe115('0x95')]===_0xe115('0x96')){var _0x52b8ef=_0x2ecae4[_0xe115('0x97')]({'plain':!![]});return db[_0xe115('0x98')][_0xe115('0x50')]({'where':{'name':_0xe115('0x2e'),'userProfileId':_0x5de5a8['userProfileId']},'raw':!![]})['then'](function(_0x4aac85){if(_0x4aac85&&_0x4aac85['autoAssociation']===0x0){return db[_0xe115('0x2f')][_0xe115('0x91')]({'name':_0x52b8ef[_0xe115('0x33')],'resourceId':_0x52b8ef['id'],'type':_0x4aac85['name'],'sectionId':_0x4aac85['id']},{})[_0xe115('0x2c')](function(){return _0x2ecae4;});}else{return _0x2ecae4;}})['catch'](function(_0x466cc3){logger[_0xe115('0x31')](_0xe115('0x99'),_0x466cc3);throw _0x466cc3;});}return _0x2ecae4;})[_0xe115('0x2c')](respondWithResult(_0x5500cf,null))[_0xe115('0x4c')](handleError(_0x5500cf,null));}});}catch(_0x5d024c){_0x5500cf['status'](0x1f4)[_0xe115('0x34')](_0x5d024c);}};function removeReferences(_0x321889,_0x307f35){try{if(_0x321889){fs[_0xe115('0x67')](_0x321889);logger['info']('Zip\x20archive\x20removed');}if(_0x307f35){rimraf(_0x307f35,function(){});logger[_0xe115('0x69')](_0xe115('0x9a'));}}catch(_0x33b4c2){logger[_0xe115('0x31')](_0x33b4c2);}}exports[_0xe115('0x9b')]=function(_0x484098,_0x5e5778,_0x16e707){return db['Plugin'][_0xe115('0x50')]({'where':{'id':_0x484098[_0xe115('0x4d')]['id']}})[_0xe115('0x2c')](handleEntityNotFound(_0x5e5778,null))[_0xe115('0x2c')](saveUpdates(_0x484098['body'],null))[_0xe115('0x2c')](respondWithResult(_0x5e5778,null))[_0xe115('0x4c')](handleError(_0x5e5778,null));};exports[_0xe115('0x9c')]=function(_0xe87760,_0x1186cc,_0x2d7b89){return db[_0xe115('0x37')][_0xe115('0x50')]({'where':{'id':_0xe87760['params']['id']}})['then'](function(_0x372ff2){if(_0x372ff2){return _0x372ff2[_0xe115('0x2d')]();}})['then'](function(_0xc44ad8){rimraf(path['join'](config[_0xe115('0x53')],_0xe115('0x54'),path[_0xe115('0x5f')](_0xc44ad8[_0xe115('0x51')])),function(){});return _0xc44ad8;})['then'](handleEntityNotFound(_0x1186cc,null))[_0xe115('0x2c')](respondWithStatusCode(_0x1186cc,null))['catch'](handleError(_0x1186cc,null));};exports[_0xe115('0x9d')]=function(_0x2ced65,_0x52304f,_0x3a4ef5){return BPromise['resolve']()[_0xe115('0x2c')](function(){if(!_0x2ced65[_0xe115('0x3d')][_0xe115('0x51')]){throw new Error(_0xe115('0x9e'));}if(!_0x2ced65[_0xe115('0x3d')][_0xe115('0x9f')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x2b1a5f=_0x2ced65['query'][_0xe115('0xa0')]?_0x2ced65[_0xe115('0x3d')][_0xe115('0xa0')]+':'+_0x2ced65[_0xe115('0x3d')][_0xe115('0x9f')]:_0xe115('0xa1')+_0x2ced65[_0xe115('0x3d')][_0xe115('0x9f')];var _0x598344=_0x2ced65[_0xe115('0x3d')][_0xe115('0x22')]?_0x2ced65[_0xe115('0x3d')][_0xe115('0x22')]:!![];var _0x1c5b29=_0x2ced65[_0xe115('0x3d')][_0xe115('0xa2')]?_0x2ced65[_0xe115('0x3d')]['encoding']:null;var _0x668464={'method':_0x2ced65[_0xe115('0xa3')],'uri':util['format'](_0xe115('0xa4'),_0x2b1a5f,_0x2ced65[_0xe115('0x3d')]['path']),'json':_0x598344,'resolveWithFullResponse':!![],'encoding':_0x1c5b29,'qs':_0x2ced65[_0xe115('0x3d')]};if(_0x2ced65[_0xe115('0xa5')]){_0x668464[_0xe115('0xa5')]=_0x2ced65[_0xe115('0xa5')];if(_0x668464['headers'][_0xe115('0xa6')]){delete _0x668464[_0xe115('0xa5')][_0xe115('0xa6')];}}if(_0x668464[_0xe115('0xa5')][_0xe115('0xa7')]){delete _0x668464['headers'][_0xe115('0xa7')];}return rp(_0x668464);})['then'](function(_0x17f05a){if(_0x17f05a){_0x52304f[_0xe115('0x27')](_0x17f05a[_0xe115('0xa5')]);logger[_0xe115('0x69')](_0x17f05a[_0xe115('0x92')]);if(_['endsWith'](_0x2ced65[_0xe115('0x3d')][_0xe115('0x51')],_0xe115('0x65'))&&_0x17f05a[_0xe115('0xa8')]==0x1f4){return _0x52304f[_0xe115('0x20')](_0x17f05a[_0xe115('0xa8')]);}else{return _0x52304f[_0xe115('0x21')](_0x17f05a[_0xe115('0xa8')])['send'](_0x17f05a[_0xe115('0x92')]);}}else{return _0x52304f[_0xe115('0x20')](0xc8);}})[_0xe115('0x4c')](handleError(_0x52304f,null));};exports[_0xe115('0xa9')]=function(_0x4a8da2,_0x5565eb,_0x3e2419){return BPromise[_0xe115('0xaa')]()['then'](function(){if(!_0x4a8da2['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4a8da2['query']['port']){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x4651df=_0x4a8da2[_0xe115('0x3d')][_0xe115('0xa0')]?_0x4a8da2['query'][_0xe115('0xa0')]+':'+_0x4a8da2[_0xe115('0x3d')][_0xe115('0x9f')]:_0xe115('0xa1')+_0x4a8da2[_0xe115('0x3d')][_0xe115('0x9f')];var _0x93b7e6=_0x4a8da2[_0xe115('0x3d')]['json']?_0x4a8da2['query'][_0xe115('0x22')]:!![];var _0x42f02b=_0x4a8da2[_0xe115('0x3d')]['encoding']?_0x4a8da2['query']['encoding']:null;var _0x53fb05={'method':_0x4a8da2[_0xe115('0xa3')],'uri':util[_0xe115('0x55')]('%s%s',_0x4651df,_0x4a8da2[_0xe115('0x3d')]['path']),'json':_0x93b7e6,'resolveWithFullResponse':!![],'encoding':_0x42f02b,'body':_0x4a8da2['body']};if(_0x4a8da2['headers']){_0x53fb05[_0xe115('0xa5')]=_0x4a8da2[_0xe115('0xa5')];if(_0x53fb05['headers'][_0xe115('0xa6')]){delete _0x53fb05['headers'][_0xe115('0xa6')];}}if(_0x53fb05[_0xe115('0xa5')]['content-type']){delete _0x53fb05[_0xe115('0xa5')][_0xe115('0xa7')];}return rp(_0x53fb05);})['then'](function(_0x5bb455){if(_0x5bb455){_0x5565eb['set'](_0x5bb455['headers']);logger['info'](_0x5bb455['body']);return _0x5565eb[_0xe115('0x21')](_0x5bb455[_0xe115('0xa8')])[_0xe115('0x34')](_0x5bb455[_0xe115('0x92')]);}else{return _0x5565eb[_0xe115('0x20')](0xc8);}})[_0xe115('0x4c')](handleError(_0x5565eb,null));}; \ No newline at end of file +var _0x6e2b=['fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','extract-zip','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Plugins','UserProfileResource','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','rows','catch','params','find','download','join','root','server/files/plugins','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','error','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','pipe','glob','**/*','dirname','node_modules/**/*','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','format','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','views','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','admin','test','agent','plugins','Warning:\x20agent\x20view\x20not\x20specified','scriptPath','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','http://localhost:','encoding','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x478515,_0x42d701){var _0x2444d4=function(_0x127dbe){while(--_0x127dbe){_0x478515['push'](_0x478515['shift']());}};_0x2444d4(++_0x42d701);}(_0x6e2b,0xa7));var _0xb6e2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e2b[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb6e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb6e2('0x1'));var jsonpatch=require(_0xb6e2('0x2'));var rp=require(_0xb6e2('0x3'));var moment=require(_0xb6e2('0x4'));var BPromise=require(_0xb6e2('0x5'));var Mustache=require('mustache');var util=require(_0xb6e2('0x6'));var path=require(_0xb6e2('0x7'));var sox=require(_0xb6e2('0x8'));var csv=require(_0xb6e2('0x9'));var ejs=require(_0xb6e2('0xa'));var fs=require('fs');var fs_extra=require(_0xb6e2('0xb'));var _=require(_0xb6e2('0xc'));var squel=require(_0xb6e2('0xd'));var crypto=require(_0xb6e2('0xe'));var jsforce=require(_0xb6e2('0xf'));var deskjs=require(_0xb6e2('0x10'));var toCsv=require(_0xb6e2('0x9'));var querystring=require(_0xb6e2('0x11'));var Papa=require(_0xb6e2('0x12'));var extract=require(_0xb6e2('0x13'));var rimraf=require('rimraf');var archiver=require(_0xb6e2('0x14'));var Redis=require(_0xb6e2('0x15'));var authService=require('../../components/auth/service');var qs=require(_0xb6e2('0x16'));var as=require(_0xb6e2('0x17'));var hardwareService=require(_0xb6e2('0x18'));var logger=require(_0xb6e2('0x19'))('api');var utils=require('../../config/utils');var config=require(_0xb6e2('0x1a'));var licenseUtil=require(_0xb6e2('0x1b'));var db=require(_0xb6e2('0x1c'))['db'];config[_0xb6e2('0x1d')]=_[_0xb6e2('0x1e')](config[_0xb6e2('0x1d')],{'host':_0xb6e2('0x1f'),'port':0x18eb});var socket=require(_0xb6e2('0x20'))(new Redis(config['redis']));require(_0xb6e2('0x21'))[_0xb6e2('0x22')](socket);function respondWithStatusCode(_0x3ff3ae,_0x4c7eac){_0x4c7eac=_0x4c7eac||0xcc;return function(_0x35432e){if(_0x35432e){return _0x3ff3ae[_0xb6e2('0x23')](_0x4c7eac);}return _0x3ff3ae['status'](_0x4c7eac)[_0xb6e2('0x24')]();};}function respondWithResult(_0x9ca1b6,_0x2b0af7){_0x2b0af7=_0x2b0af7||0xc8;return function(_0x4da4f9){if(_0x4da4f9){return _0x9ca1b6[_0xb6e2('0x25')](_0x2b0af7)[_0xb6e2('0x26')](_0x4da4f9);}};}function respondWithFilteredResult(_0x12a22a,_0x1cb53c){return function(_0x5436fe){if(_0x5436fe){var _0x5cb09c=typeof _0x1cb53c[_0xb6e2('0x27')]==='undefined'&&typeof _0x1cb53c[_0xb6e2('0x28')]===_0xb6e2('0x29');var _0x17c9aa=_0x5436fe[_0xb6e2('0x2a')];var _0x3be302=_0x5cb09c?0x0:_0x1cb53c[_0xb6e2('0x27')];var _0x1a8ea5=_0x5cb09c?_0x5436fe[_0xb6e2('0x2a')]:_0x1cb53c['offset']+_0x1cb53c['limit'];var _0x1e2390;if(_0x1a8ea5>=_0x17c9aa){_0x1a8ea5=_0x17c9aa;_0x1e2390=0xc8;}else{_0x1e2390=0xce;}_0x12a22a['status'](_0x1e2390);return _0x12a22a[_0xb6e2('0x2b')](_0xb6e2('0x2c'),_0x3be302+'-'+_0x1a8ea5+'/'+_0x17c9aa)['json'](_0x5436fe);}return null;};}function patchUpdates(_0x5863fc){return function(_0x2ad062){try{jsonpatch[_0xb6e2('0x2d')](_0x2ad062,_0x5863fc,!![]);}catch(_0x54c550){return BPromise[_0xb6e2('0x2e')](_0x54c550);}return _0x2ad062[_0xb6e2('0x2f')]();};}function saveUpdates(_0x5aa12e,_0x1cceab){return function(_0x1d5b63){if(_0x1d5b63){return _0x1d5b63[_0xb6e2('0x30')](_0x5aa12e)['then'](function(_0x38ca94){return _0x38ca94;});}return null;};}function removeEntity(_0x3f3b29,_0x100fbb){return function(_0x74b7b2){if(_0x74b7b2){return _0x74b7b2[_0xb6e2('0x31')]()[_0xb6e2('0x32')](function(){var _0x310e7d=_0x74b7b2[_0xb6e2('0x33')]({'plain':!![]});var _0x315dc6=_0xb6e2('0x34');return db[_0xb6e2('0x35')][_0xb6e2('0x31')]({'where':{'type':_0x315dc6,'resourceId':_0x310e7d['id']}})[_0xb6e2('0x32')](function(){return _0x74b7b2;});})['then'](function(){_0x3f3b29[_0xb6e2('0x25')](0xcc)[_0xb6e2('0x24')]();});}};}function handleEntityNotFound(_0x438639,_0x4491e9){return function(_0xd88a49){if(!_0xd88a49){_0x438639[_0xb6e2('0x23')](0x194);}return _0xd88a49;};}function handleError(_0x25ae7c,_0x3556e8){_0x3556e8=_0x3556e8||0x1f4;return function(_0xba746d){logger['error'](_0xba746d[_0xb6e2('0x36')]);if(_0xba746d[_0xb6e2('0x37')]){delete _0xba746d[_0xb6e2('0x37')];}_0x25ae7c[_0xb6e2('0x25')](_0x3556e8)['send'](_0xba746d);};}exports[_0xb6e2('0x38')]=function(_0xd38553,_0x5a699f){var _0x4e87f1={},_0x2498b3={},_0x2f3842={'count':0x0,'rows':[]};var _0x1427e4=_[_0xb6e2('0x39')](db['Plugin'][_0xb6e2('0x3a')],function(_0x4ac0be){return{'name':_0x4ac0be[_0xb6e2('0x3b')],'type':_0x4ac0be[_0xb6e2('0x3c')][_0xb6e2('0x3d')]};});_0x2498b3[_0xb6e2('0x3e')]=_['map'](_0x1427e4,_0xb6e2('0x37'));_0x2498b3[_0xb6e2('0x3f')]=_[_0xb6e2('0x40')](_0xd38553[_0xb6e2('0x3f')]);_0x2498b3['filters']=_['intersection'](_0x2498b3[_0xb6e2('0x3e')],_0x2498b3[_0xb6e2('0x3f')]);_0x4e87f1[_0xb6e2('0x41')]=_[_0xb6e2('0x42')](_0x2498b3[_0xb6e2('0x3e')],qs[_0xb6e2('0x43')](_0xd38553[_0xb6e2('0x3f')]['fields']));_0x4e87f1[_0xb6e2('0x41')]=_0x4e87f1[_0xb6e2('0x41')][_0xb6e2('0x44')]?_0x4e87f1[_0xb6e2('0x41')]:_0x2498b3[_0xb6e2('0x3e')];if(!_0xd38553[_0xb6e2('0x3f')][_0xb6e2('0x45')]('nolimit')){_0x4e87f1[_0xb6e2('0x28')]=qs['limit'](_0xd38553['query'][_0xb6e2('0x28')]);_0x4e87f1['offset']=qs['offset'](_0xd38553[_0xb6e2('0x3f')][_0xb6e2('0x27')]);}_0x4e87f1[_0xb6e2('0x46')]=qs[_0xb6e2('0x47')](_0xd38553[_0xb6e2('0x3f')][_0xb6e2('0x47')]);_0x4e87f1[_0xb6e2('0x48')]=qs['filters'](_[_0xb6e2('0x49')](_0xd38553[_0xb6e2('0x3f')],_0x2498b3['filters']),_0x1427e4);if(_0xd38553['query'][_0xb6e2('0x4a')]){_0x4e87f1[_0xb6e2('0x48')]=_[_0xb6e2('0x4b')](_0x4e87f1[_0xb6e2('0x48')],{'$or':_[_0xb6e2('0x39')](_0x1427e4,function(_0x46ef68){if(_0x46ef68[_0xb6e2('0x3c')]!==_0xb6e2('0x4c')){var _0x302050={};_0x302050[_0x46ef68[_0xb6e2('0x37')]]={'$like':'%'+_0xd38553[_0xb6e2('0x3f')][_0xb6e2('0x4a')]+'%'};return _0x302050;}})});}_0x4e87f1=_['merge']({},_0x4e87f1,_0xd38553[_0xb6e2('0x4d')]);var _0xf257fe={'where':_0x4e87f1['where']};return db[_0xb6e2('0x4e')]['count'](_0xf257fe)[_0xb6e2('0x32')](function(_0x215df3){_0x2f3842[_0xb6e2('0x2a')]=_0x215df3;if(_0xd38553['query'][_0xb6e2('0x4f')]){_0x4e87f1[_0xb6e2('0x50')]=[{'all':!![]}];}return db[_0xb6e2('0x4e')][_0xb6e2('0x51')](_0x4e87f1);})[_0xb6e2('0x32')](function(_0x5d7bd5){_0x2f3842[_0xb6e2('0x52')]=_0x5d7bd5;return _0x2f3842;})[_0xb6e2('0x32')](respondWithFilteredResult(_0x5a699f,_0x4e87f1))[_0xb6e2('0x53')](handleError(_0x5a699f,null));};exports['show']=function(_0x3282b1,_0x2273d8){var _0x4c8125={'raw':!![],'where':{'id':_0x3282b1[_0xb6e2('0x54')]['id']}},_0x5b53c7={};_0x5b53c7[_0xb6e2('0x3e')]=_[_0xb6e2('0x40')](db['Plugin'][_0xb6e2('0x3a')]);_0x5b53c7['query']=_[_0xb6e2('0x40')](_0x3282b1[_0xb6e2('0x3f')]);_0x5b53c7['filters']=_[_0xb6e2('0x42')](_0x5b53c7[_0xb6e2('0x3e')],_0x5b53c7[_0xb6e2('0x3f')]);_0x4c8125['attributes']=_[_0xb6e2('0x42')](_0x5b53c7[_0xb6e2('0x3e')],qs[_0xb6e2('0x43')](_0x3282b1[_0xb6e2('0x3f')]['fields']));_0x4c8125[_0xb6e2('0x41')]=_0x4c8125['attributes']['length']?_0x4c8125['attributes']:_0x5b53c7[_0xb6e2('0x3e')];if(_0x3282b1['query'][_0xb6e2('0x4f')]){_0x4c8125[_0xb6e2('0x50')]=[{'all':!![]}];}_0x4c8125=_[_0xb6e2('0x4b')]({},_0x4c8125,_0x3282b1[_0xb6e2('0x4d')]);return db[_0xb6e2('0x4e')][_0xb6e2('0x55')](_0x4c8125)[_0xb6e2('0x32')](handleEntityNotFound(_0x2273d8,null))[_0xb6e2('0x32')](respondWithResult(_0x2273d8,null))[_0xb6e2('0x53')](handleError(_0x2273d8,null));};exports[_0xb6e2('0x56')]=function(_0x2ba098,_0x825664,_0x2509e1){return db['Plugin']['find']({'where':{'id':_0x2ba098[_0xb6e2('0x54')]['id']},'attributes':[_0xb6e2('0x37'),'path'],'raw':!![]})[_0xb6e2('0x32')](handleEntityNotFound(_0x825664,null))[_0xb6e2('0x32')](function(_0x2744dc){if(_0x2744dc){var _0x1bccc9=path[_0xb6e2('0x57')](config[_0xb6e2('0x58')],_0xb6e2('0x59'),util['format'](_0xb6e2('0x5a'),path[_0xb6e2('0x5b')](_0x2744dc[_0xb6e2('0x7')])));var _0x2ede84=fs[_0xb6e2('0x5c')](_0x1bccc9);var _0x3a4441=archiver(_0xb6e2('0x5d'),{'zlib':{'level':0x9}});_0x3a4441['on'](_0xb6e2('0x5e'),function(_0x56caec){if(_0x56caec[_0xb6e2('0x5f')]===_0xb6e2('0x60')){logger[_0xb6e2('0x61')](_0x56caec);}else{throw new db['Sequelize'][(_0xb6e2('0x62'))](_0xb6e2('0x63'));}});_0x3a4441['on'](_0xb6e2('0x61'),function(_0x4f7ce3){throw new db[(_0xb6e2('0x64'))][(_0xb6e2('0x62'))](_0xb6e2('0x63'));});_0x3a4441[_0xb6e2('0x65')](_0x2ede84);_0x3a4441[_0xb6e2('0x66')](_0xb6e2('0x67'),{'cwd':path[_0xb6e2('0x57')](config['root'],'server/files/plugins',path[_0xb6e2('0x68')](_0x2744dc[_0xb6e2('0x7')])),'ignore':[path[_0xb6e2('0x57')](path[_0xb6e2('0x5b')](_0x2744dc['path']),_0xb6e2('0x69')),path[_0xb6e2('0x57')](path[_0xb6e2('0x5b')](_0x2744dc[_0xb6e2('0x7')]),_0xb6e2('0x6a'))],'nodir':!![]})[_0xb6e2('0x6b')]();_0x2ede84['on'](_0xb6e2('0x6c'),function(){if(!fs[_0xb6e2('0x6d')](_0x1bccc9)){throw new db['Sequelize'][(_0xb6e2('0x62'))](_0xb6e2('0x6e'));}return _0x825664[_0xb6e2('0x56')](_0x1bccc9,util[_0xb6e2('0x6f')]('%s.zip',path[_0xb6e2('0x5b')](_0x2744dc[_0xb6e2('0x7')])),function(_0x3651c5){if(_0x3651c5){throw new db[(_0xb6e2('0x64'))][(_0xb6e2('0x62'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xb6e2('0x70')](_0x1bccc9);logger[_0xb6e2('0x71')](_0xb6e2('0x72'));logger['info'](_0xb6e2('0x73'));});});}return null;})[_0xb6e2('0x53')](handleError(_0x825664,null));};exports['upload']=function(_0x14f529,_0x1db84d,_0x186409){var _0xc93853=path[_0xb6e2('0x5b')](_0x14f529[_0xb6e2('0x74')][_0xb6e2('0x75')],path[_0xb6e2('0x76')](_0x14f529['file'][_0xb6e2('0x75')]));var _0x51da87=path[_0xb6e2('0x57')](config[_0xb6e2('0x58')],_0xb6e2('0x59'),_0x14f529['file'][_0xb6e2('0x75')]);var _0x1d7b7c=path[_0xb6e2('0x57')](config[_0xb6e2('0x58')],_0xb6e2('0x59'),_0xc93853);logger['info'](_0xb6e2('0x77'),_0x51da87);logger[_0xb6e2('0x71')](_0xb6e2('0x78'),_0x1d7b7c);try{fs[_0xb6e2('0x79')](_0x51da87,parseInt(_0xb6e2('0x7a'),0x8));extract(_0x51da87,{'dir':_0x1d7b7c},function(_0x5650ef){if(_0x5650ef){logger[_0xb6e2('0x61')](_0x5650ef);handleError(_0x5650ef,!![]);};var _0x2bb7e0=fs[_0xb6e2('0x7b')](_0x1d7b7c);if(_0x2bb7e0[_0xb6e2('0x44')]>0x1){removeReferences(_0x51da87,_0x1d7b7c);logger[_0xb6e2('0x61')](_0xb6e2('0x7c'));return _0x186409(new Error('Invalid\x20plugin\x20structure'));}var _0x3a4690=fs['lstatSync'](path['join'](_0x1d7b7c,_0x2bb7e0[0x0]));if(_0x3a4690[_0xb6e2('0x7d')]()){removeReferences(_0x51da87,_0x1d7b7c);logger[_0xb6e2('0x61')](_0xb6e2('0x7c'));return _0x186409(new Error(_0xb6e2('0x7c')));}if(_0x3a4690[_0xb6e2('0x7e')]()){var _0x20ea9c=fs['readdirSync'](path[_0xb6e2('0x57')](_0x1d7b7c,_0x2bb7e0[0x0]));if(_0x20ea9c[_0xb6e2('0x44')]===0x0){removeReferences(_0x51da87,_0x1d7b7c);logger[_0xb6e2('0x61')]('Invalid\x20plugin\x20structure');return _0x186409(new Error(_0xb6e2('0x7c')));}var _0x92d20e=_0x20ea9c[_0xb6e2('0x7f')](function(_0x4d8e14){return _0x4d8e14===_0xb6e2('0x80');});if(!_0x92d20e){return _0x186409(new Error(_0xb6e2('0x81')));}var _0x417441=fs[_0xb6e2('0x82')](path[_0xb6e2('0x57')](_0x1d7b7c,_0x2bb7e0[0x0],_0xb6e2('0x80')));var _0x23a594=JSON['parse'](_0x417441);if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x37')]){return _0x186409(new Error(_0xb6e2('0x83')));}if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x3c')]){return _0x186409(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0xb6e2('0x29')==typeof _0x23a594['version']){return _0x186409(new Error(_0xb6e2('0x84')));}if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x85')]){return _0x186409(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x23a594[_0xb6e2('0x3c')]===_0xb6e2('0x86')){if('undefined'==typeof _0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')]){return _0x186409(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')]['admin']&&'undefined'==typeof _0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')]['agent']){return _0x186409(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x23a594['type']===_0xb6e2('0x88')){if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x85')][_0xb6e2('0x89')]){return _0x186409(new Error(_0xb6e2('0x8a')));}if(_0xb6e2('0x29')==typeof _0x23a594[_0xb6e2('0x85')]['scriptPath']){return _0x186409(new Error(_0xb6e2('0x8b')));}}else{return _0x186409(new Error(_0xb6e2('0x8c')));}var _0x407aed=_0x23a594['name'];var _0x27f129=_0x23a594[_0xb6e2('0x8d')];var _0x53d3c3=_0x23a594[_0xb6e2('0x3c')];var _0x319e09=_0x23a594[_0xb6e2('0x8e')]?_0x23a594['sidebar']:_0xb6e2('0x8f');var _0x1f9ca5=_0x23a594[_0xb6e2('0x90')]?_0x23a594['icon']:_0xb6e2('0x91');var _0x2b1e97='';var _0x34b5a8='';var _0x1b7558='';var _0x47219c='';var _0x41ef71=_0x23a594['version'];if(_0x53d3c3===_0xb6e2('0x86')){if(_0xb6e2('0x29')!=typeof _0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')][_0xb6e2('0x92')]){var _0x3eb2d6=_0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xb6e2('0x93')](_0x3eb2d6)){_0x2b1e97=path[_0xb6e2('0x57')]('plugins',_0xc93853,_0x2bb7e0[0x0],_0x3eb2d6);}else{_0x2b1e97=_0x3eb2d6;}}else{logger[_0xb6e2('0x71')]('Warning:\x20admin\x20view\x20not\x20specified');}if(_0xb6e2('0x29')!=typeof _0x23a594['parameters'][_0xb6e2('0x87')][_0xb6e2('0x94')]){var _0x5e1b90=_0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')][_0xb6e2('0x94')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5e1b90)){_0x34b5a8=path[_0xb6e2('0x57')](_0xb6e2('0x95'),_0xc93853,_0x2bb7e0[0x0],_0x5e1b90);}else{_0x34b5a8=_0x5e1b90;}}else{logger['info'](_0xb6e2('0x96'));}}else if(_0x53d3c3===_0xb6e2('0x88')){_0x1b7558=_0x23a594[_0xb6e2('0x85')][_0xb6e2('0x89')];_0x47219c=_0x23a594[_0xb6e2('0x85')][_0xb6e2('0x97')];if(_0xb6e2('0x29')!=typeof _0x23a594['parameters'][_0xb6e2('0x87')]){if(_0xb6e2('0x29')!=typeof _0x23a594[_0xb6e2('0x85')]['views'][_0xb6e2('0x92')]){var _0x3eb2d6=_0x23a594['parameters'][_0xb6e2('0x87')][_0xb6e2('0x92')];if(!/^(f|ht)tps?:\/\//i[_0xb6e2('0x93')](_0x3eb2d6)){_0x2b1e97=path['join'](_0xb6e2('0x95'),_0xc93853,_0x2bb7e0[0x0],_0x3eb2d6);}else{_0x2b1e97=_0x3eb2d6;}}if('undefined'!=typeof _0x23a594['parameters'][_0xb6e2('0x87')][_0xb6e2('0x94')]){var _0x5e1b90=_0x23a594[_0xb6e2('0x85')][_0xb6e2('0x87')][_0xb6e2('0x94')];if(!/^(f|ht)tps?:\/\//i[_0xb6e2('0x93')](_0x5e1b90)){_0x34b5a8=path[_0xb6e2('0x57')](_0xb6e2('0x95'),_0xc93853,_0x2bb7e0[0x0],_0x5e1b90);}else{_0x34b5a8=_0x5e1b90;}}}}var _0x3a4da4={'name':_0x407aed,'description':_0x27f129,'path':path['join'](_0xc93853,_0x2bb7e0[0x0]),'type':_0x53d3c3,'sidebar':_0x319e09,'icon':_0x1f9ca5,'adminUrl':_0x2b1e97,'agentUrl':_0x34b5a8,'scriptName':_0x1b7558,'scriptPath':_0x47219c,'version':_0x41ef71};removeReferences(_0x51da87,null);return db[_0xb6e2('0x4e')][_0xb6e2('0x98')](_0x3a4da4)[_0xb6e2('0x32')](function(_0x20c8a8){var _0x5702b4={'role':_0x14f529[_0xb6e2('0x99')][_0xb6e2('0x9a')],'userProfileId':_0x14f529['body']['userProfileId']};if(!_0x5702b4)throw new Error(_0xb6e2('0x9b'));if(_0x5702b4[_0xb6e2('0x9a')]===_0xb6e2('0x9c')){var _0x30479a=_0x20c8a8[_0xb6e2('0x33')]({'plain':!![]});return db[_0xb6e2('0x9d')]['find']({'where':{'name':_0xb6e2('0x34'),'userProfileId':_0x5702b4[_0xb6e2('0x9e')]},'raw':!![]})['then'](function(_0x32f25c){if(_0x32f25c&&_0x32f25c[_0xb6e2('0x9f')]===0x0){return db['UserProfileResource'][_0xb6e2('0x98')]({'name':_0x30479a[_0xb6e2('0x37')],'resourceId':_0x30479a['id'],'type':_0x32f25c[_0xb6e2('0x37')],'sectionId':_0x32f25c['id']},{})[_0xb6e2('0x32')](function(){return _0x20c8a8;});}else{return _0x20c8a8;}})['catch'](function(_0x3569f5){logger[_0xb6e2('0x61')](_0xb6e2('0xa0'),_0x3569f5);throw _0x3569f5;});}return _0x20c8a8;})[_0xb6e2('0x32')](respondWithResult(_0x1db84d,null))[_0xb6e2('0x53')](handleError(_0x1db84d,null));}});}catch(_0x1c57be){_0x1db84d[_0xb6e2('0x25')](0x1f4)['send'](_0x1c57be);}};function removeReferences(_0x2c0fa7,_0x197f0c){try{if(_0x2c0fa7){fs[_0xb6e2('0x70')](_0x2c0fa7);logger[_0xb6e2('0x71')](_0xb6e2('0xa1'));}if(_0x197f0c){rimraf(_0x197f0c,function(){});logger[_0xb6e2('0x71')](_0xb6e2('0xa2'));}}catch(_0x763d55){logger[_0xb6e2('0x61')](_0x763d55);}}exports[_0xb6e2('0x30')]=function(_0x51803b,_0x563a51,_0x194955){return db['Plugin'][_0xb6e2('0x55')]({'where':{'id':_0x51803b[_0xb6e2('0x54')]['id']}})[_0xb6e2('0x32')](handleEntityNotFound(_0x563a51,null))['then'](saveUpdates(_0x51803b[_0xb6e2('0x99')],null))['then'](respondWithResult(_0x563a51,null))[_0xb6e2('0x53')](handleError(_0x563a51,null));};exports['delete']=function(_0x445e3a,_0x592e55,_0x363a41){return db[_0xb6e2('0x4e')][_0xb6e2('0x55')]({'where':{'id':_0x445e3a[_0xb6e2('0x54')]['id']}})[_0xb6e2('0x32')](function(_0xdf9704){if(_0xdf9704){return _0xdf9704[_0xb6e2('0x31')]();}})['then'](function(_0x4a1eb7){rimraf(path[_0xb6e2('0x57')](config['root'],_0xb6e2('0x59'),path[_0xb6e2('0x68')](_0x4a1eb7[_0xb6e2('0x7')])),function(){});return _0x4a1eb7;})[_0xb6e2('0x32')](handleEntityNotFound(_0x592e55,null))['then'](respondWithStatusCode(_0x592e55,null))[_0xb6e2('0x53')](handleError(_0x592e55,null));};exports[_0xb6e2('0xa3')]=function(_0x38f255,_0x1532ce,_0x1c1db0){return BPromise[_0xb6e2('0xa4')]()[_0xb6e2('0x32')](function(){if(!_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0x7')]){throw new Error(_0xb6e2('0xa5'));}if(!_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0xa6')]){throw new Error(_0xb6e2('0xa7'));}var _0x5086b2=_0x38f255[_0xb6e2('0x3f')]['hostname']?_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0xa8')]+':'+_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0xa6')]:'http://localhost:'+_0x38f255[_0xb6e2('0x3f')]['port'];var _0x1419ef=_0x38f255[_0xb6e2('0x3f')]['json']?_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0x26')]:!![];var _0xc439c8=_0x38f255['query']['encoding']?_0x38f255[_0xb6e2('0x3f')]['encoding']:null;var _0x5ad389={'method':_0x38f255[_0xb6e2('0xa9')],'uri':util[_0xb6e2('0x6f')]('%s%s',_0x5086b2,_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0x7')]),'json':_0x1419ef,'resolveWithFullResponse':!![],'encoding':_0xc439c8,'qs':_0x38f255[_0xb6e2('0x3f')]};if(_0x38f255[_0xb6e2('0xaa')]){_0x5ad389['headers']=_0x38f255[_0xb6e2('0xaa')];if(_0x5ad389[_0xb6e2('0xaa')][_0xb6e2('0xab')]){delete _0x5ad389[_0xb6e2('0xaa')][_0xb6e2('0xab')];}}if(_0x5ad389[_0xb6e2('0xaa')]['content-type']){delete _0x5ad389[_0xb6e2('0xaa')][_0xb6e2('0xac')];}return rp(_0x5ad389);})[_0xb6e2('0x32')](function(_0x233836){if(_0x233836){_0x1532ce[_0xb6e2('0x2b')](_0x233836['headers']);logger['info'](_0x233836[_0xb6e2('0x99')]);if(_[_0xb6e2('0xad')](_0x38f255[_0xb6e2('0x3f')][_0xb6e2('0x7')],'download')&&_0x233836[_0xb6e2('0xae')]==0x1f4){return _0x1532ce[_0xb6e2('0x23')](_0x233836[_0xb6e2('0xae')]);}else{return _0x1532ce['status'](_0x233836[_0xb6e2('0xae')])['send'](_0x233836[_0xb6e2('0x99')]);}}else{return _0x1532ce[_0xb6e2('0x23')](0xc8);}})['catch'](handleError(_0x1532ce,null));};exports[_0xb6e2('0xaf')]=function(_0xfae8be,_0x37535d,_0xc35634){return BPromise[_0xb6e2('0xa4')]()[_0xb6e2('0x32')](function(){if(!_0xfae8be['query'][_0xb6e2('0x7')]){throw new Error(_0xb6e2('0xa5'));}if(!_0xfae8be[_0xb6e2('0x3f')]['port']){throw new Error(_0xb6e2('0xa7'));}var _0x2b3b51=_0xfae8be[_0xb6e2('0x3f')][_0xb6e2('0xa8')]?_0xfae8be['query']['hostname']+':'+_0xfae8be['query'][_0xb6e2('0xa6')]:_0xb6e2('0xb0')+_0xfae8be['query'][_0xb6e2('0xa6')];var _0x402bb8=_0xfae8be[_0xb6e2('0x3f')][_0xb6e2('0x26')]?_0xfae8be[_0xb6e2('0x3f')][_0xb6e2('0x26')]:!![];var _0x10538d=_0xfae8be[_0xb6e2('0x3f')][_0xb6e2('0xb1')]?_0xfae8be[_0xb6e2('0x3f')]['encoding']:null;var _0x1480fe={'method':_0xfae8be[_0xb6e2('0xa9')],'uri':util[_0xb6e2('0x6f')]('%s%s',_0x2b3b51,_0xfae8be['query'][_0xb6e2('0x7')]),'json':_0x402bb8,'resolveWithFullResponse':!![],'encoding':_0x10538d,'body':_0xfae8be[_0xb6e2('0x99')]};if(_0xfae8be['headers']){_0x1480fe['headers']=_0xfae8be[_0xb6e2('0xaa')];if(_0x1480fe[_0xb6e2('0xaa')]['content-length']){delete _0x1480fe[_0xb6e2('0xaa')][_0xb6e2('0xab')];}}if(_0x1480fe[_0xb6e2('0xaa')][_0xb6e2('0xac')]){delete _0x1480fe[_0xb6e2('0xaa')]['content-type'];}return rp(_0x1480fe);})[_0xb6e2('0x32')](function(_0xac077b){if(_0xac077b){_0x37535d[_0xb6e2('0x2b')](_0xac077b[_0xb6e2('0xaa')]);logger[_0xb6e2('0x71')](_0xac077b['body']);return _0x37535d['status'](_0xac077b[_0xb6e2('0xae')])['send'](_0xac077b[_0xb6e2('0x99')]);}else{return _0x37535d[_0xb6e2('0x23')](0xc8);}})[_0xb6e2('0x53')](handleError(_0x37535d,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 8bc5f0e..bf78ebb 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 _0x5e17=['events','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d6bf6,_0x1ecad1){var _0x2c7929=function(_0x2ea51d){while(--_0x2ea51d){_0x3d6bf6['push'](_0x3d6bf6['shift']());}};_0x2c7929(++_0x1ecad1);}(_0x5e17,0x17a));var _0x75e1=function(_0xdc5e95,_0x28d4f1){_0xdc5e95=_0xdc5e95-0x0;var _0x131988=_0x5e17[_0xdc5e95];return _0x131988;};'use strict';var EventEmitter=require(_0x75e1('0x0'));var Plugin=require('../../mysqldb')['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x75e1('0x1')};function emitEvent(_0x25fc55){return function(_0x23ec49,_0x1e8819,_0x3954d0){PluginEvents[_0x75e1('0x2')](_0x25fc55+':'+_0x23ec49['id'],_0x23ec49);PluginEvents[_0x75e1('0x2')](_0x25fc55,_0x23ec49);_0x3954d0(null);};}for(var e in events){if(events[_0x75e1('0x3')](e)){var event=events[e];Plugin[_0x75e1('0x4')](e,emitEvent(event));}}module[_0x75e1('0x5')]=PluginEvents; \ No newline at end of file +var _0x6bfc=['exports','../../mysqldb','Plugin','setMaxListeners','update','emit','hasOwnProperty','hook'];(function(_0x1e4360,_0x930b9b){var _0x31e6b4=function(_0x49dd8e){while(--_0x49dd8e){_0x1e4360['push'](_0x1e4360['shift']());}};_0x31e6b4(++_0x930b9b);}(_0x6bfc,0x159));var _0xc6bf=function(_0x1cc0f4,_0x105835){_0x1cc0f4=_0x1cc0f4-0x0;var _0x2e360f=_0x6bfc[_0x1cc0f4];return _0x2e360f;};'use strict';var EventEmitter=require('events');var Plugin=require(_0xc6bf('0x0'))['db'][_0xc6bf('0x1')];var PluginEvents=new EventEmitter();PluginEvents[_0xc6bf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc6bf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x196d6b){return function(_0x4a6de4,_0x15b991,_0xe23c7e){PluginEvents[_0xc6bf('0x4')](_0x196d6b+':'+_0x4a6de4['id'],_0x4a6de4);PluginEvents['emit'](_0x196d6b,_0x4a6de4);_0xe23c7e(null);};}for(var e in events){if(events[_0xc6bf('0x5')](e)){var event=events[e];Plugin[_0xc6bf('0x6')](e,emitEvent(event));}}module[_0xc6bf('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 1293b12..ed1f51d 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 _0x2f74=['define','Plugin','plugins','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x169c06,_0xd3d054){var _0x5067da=function(_0x33ff96){while(--_0x33ff96){_0x169c06['push'](_0x169c06['shift']());}};_0x5067da(++_0xd3d054);}(_0x2f74,0x7b));var _0x42f7=function(_0x32e9e9,_0x3df5aa){_0x32e9e9=_0x32e9e9-0x0;var _0x400b63=_0x2f74[_0x32e9e9];return _0x400b63;};'use strict';var _=require(_0x42f7('0x0'));var util=require('util');var logger=require(_0x42f7('0x1'))(_0x42f7('0x2'));var moment=require(_0x42f7('0x3'));var BPromise=require(_0x42f7('0x4'));var rp=require(_0x42f7('0x5'));var fs=require('fs');var path=require(_0x42f7('0x6'));var rimraf=require(_0x42f7('0x7'));var config=require(_0x42f7('0x8'));var attributes=require('./plugin.attributes');module['exports']=function(_0x540e53,_0x250aa9){return _0x540e53[_0x42f7('0x9')](_0x42f7('0xa'),attributes,{'tableName':_0x42f7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8d3=['api','moment','bluebird','request-promise','path','rimraf','./plugin.attributes','exports','define','plugins','lodash','util'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0xe8d3,0x9a));var _0x3e8d=function(_0x6aa606,_0x410638){_0x6aa606=_0x6aa606-0x0;var _0x3f18ed=_0xe8d3[_0x6aa606];return _0x3f18ed;};'use strict';var _=require(_0x3e8d('0x0'));var util=require(_0x3e8d('0x1'));var logger=require('../../config/logger')(_0x3e8d('0x2'));var moment=require(_0x3e8d('0x3'));var BPromise=require(_0x3e8d('0x4'));var rp=require(_0x3e8d('0x5'));var fs=require('fs');var path=require(_0x3e8d('0x6'));var rimraf=require(_0x3e8d('0x7'));var config=require('../../config/environment');var attributes=require(_0x3e8d('0x8'));module[_0x3e8d('0x9')]=function(_0x3a2fce,_0xd961b7){return _0x3a2fce[_0x3e8d('0xa')]('Plugin',attributes,{'tableName':_0x3e8d('0xb'),'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 da1c837..25c0c9b 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 _0xa66e=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','redis','localhost','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','Plugin,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','stringify','lodash'];(function(_0x3f9e82,_0x2b89b5){var _0xc6837f=function(_0x8cc7b7){while(--_0x8cc7b7){_0x3f9e82['push'](_0x3f9e82['shift']());}};_0xc6837f(++_0x2b89b5);}(_0xa66e,0xf4));var _0xea66=function(_0x1b038a,_0x5aa253){_0x1b038a=_0x1b038a-0x0;var _0x5c40b7=_0xa66e[_0x1b038a];return _0x5c40b7;};'use strict';var _=require(_0xea66('0x0'));var util=require(_0xea66('0x1'));var moment=require(_0xea66('0x2'));var BPromise=require(_0xea66('0x3'));var rs=require(_0xea66('0x4'));var fs=require('fs');var Redis=require(_0xea66('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xea66('0x6'));var logger=require(_0xea66('0x7'))(_0xea66('0x8'));var config=require(_0xea66('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xea66('0xa')][_0xea66('0xb')]({'port':0x232a});config['redis']=_[_0xea66('0xc')](config[_0xea66('0xd')],{'host':_0xea66('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xea66('0xf'))[_0xea66('0x10')](socket);function respondWithRpcPromise(_0xf61055,_0x2ec80d,_0x4688d5){return new BPromise(function(_0xfdac30,_0x594c75){return client[_0xea66('0x11')](_0xf61055,_0x4688d5)['then'](function(_0x326382){logger[_0xea66('0x12')](_0xea66('0x13'),_0x2ec80d,_0xea66('0x14'));logger['debug'](_0xea66('0x15'),_0x2ec80d,_0xea66('0x14'),JSON['stringify'](_0x326382));if(_0x326382[_0xea66('0x16')]){if(_0x326382[_0xea66('0x16')][_0xea66('0x17')]===0x1f4){logger['error'](_0xea66('0x13'),_0x2ec80d,_0x326382[_0xea66('0x16')]['message']);return _0x594c75(_0x326382[_0xea66('0x16')][_0xea66('0x18')]);}logger['error'](_0xea66('0x13'),_0x2ec80d,_0x326382[_0xea66('0x16')]['message']);return _0xfdac30(_0x326382[_0xea66('0x16')][_0xea66('0x18')]);}else{logger[_0xea66('0x12')](_0xea66('0x13'),_0x2ec80d,'request\x20sent');_0xfdac30(_0x326382[_0xea66('0x19')][_0xea66('0x18')]);}})[_0xea66('0x1a')](function(_0x3e0f3d){logger[_0xea66('0x16')](_0xea66('0x13'),_0x2ec80d,_0x3e0f3d);_0x594c75(_0x3e0f3d);});});}exports[_0xea66('0x1b')]=function(_0x18ae2b){var _0x3b3f0e=this;return new Promise(function(_0x4dfb5d,_0x5a269b){return db[_0xea66('0x1c')][_0xea66('0x1d')](_0x18ae2b[_0xea66('0x1e')],{'raw':_0x18ae2b[_0xea66('0x1f')]?_0x18ae2b[_0xea66('0x1f')][_0xea66('0x20')]===undefined?!![]:![]:!![]})[_0xea66('0x21')](function(_0x2a4378){logger[_0xea66('0x12')]('CreatePlugin',_0x18ae2b);logger['debug']('CreatePlugin',_0x18ae2b,JSON[_0xea66('0x22')](_0x2a4378));_0x4dfb5d(_0x2a4378);})['catch'](function(_0x521746){logger[_0xea66('0x16')](_0xea66('0x1b'),_0x521746['message'],_0x18ae2b);_0x5a269b(_0x3b3f0e[_0xea66('0x16')](0x1f4,_0x521746[_0xea66('0x18')]));});});}; \ No newline at end of file +var _0xe664=['create','options','raw','CreatePlugin','lodash','util','randomstring','ioredis','rpc','../../config/environment','client','defaults','redis','localhost','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','catch','Plugin'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe664,0x1c4));var _0x4e66=function(_0x63235a,_0x281c96){_0x63235a=_0x63235a-0x0;var _0x19cf51=_0xe664[_0x63235a];return _0x19cf51;};'use strict';var _=require(_0x4e66('0x0'));var util=require(_0x4e66('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e66('0x2'));var fs=require('fs');var Redis=require(_0x4e66('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4e66('0x4'));var config=require(_0x4e66('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4e66('0x6')]['http']({'port':0x232a});config['redis']=_[_0x4e66('0x7')](config[_0x4e66('0x8')],{'host':_0x4e66('0x9'),'port':0x18eb});var socket=require(_0x4e66('0xa'))(new Redis(config[_0x4e66('0x8')]));require(_0x4e66('0xb'))[_0x4e66('0xc')](socket);function respondWithRpcPromise(_0x3e3762,_0x121b16,_0x4f2434){return new BPromise(function(_0x3324b4,_0x2818a4){return client['request'](_0x3e3762,_0x4f2434)[_0x4e66('0xd')](function(_0x3cbeed){logger[_0x4e66('0xe')](_0x4e66('0xf'),_0x121b16,'request\x20sent');logger[_0x4e66('0x10')]('Plugin,\x20%s,\x20%s,\x20%s',_0x121b16,'request\x20sent',JSON[_0x4e66('0x11')](_0x3cbeed));if(_0x3cbeed[_0x4e66('0x12')]){if(_0x3cbeed[_0x4e66('0x12')][_0x4e66('0x13')]===0x1f4){logger[_0x4e66('0x12')](_0x4e66('0xf'),_0x121b16,_0x3cbeed[_0x4e66('0x12')][_0x4e66('0x14')]);return _0x2818a4(_0x3cbeed[_0x4e66('0x12')][_0x4e66('0x14')]);}logger[_0x4e66('0x12')](_0x4e66('0xf'),_0x121b16,_0x3cbeed['error'][_0x4e66('0x14')]);return _0x3324b4(_0x3cbeed[_0x4e66('0x12')]['message']);}else{logger[_0x4e66('0xe')]('Plugin,\x20%s,\x20%s',_0x121b16,_0x4e66('0x15'));_0x3324b4(_0x3cbeed['result']['message']);}})[_0x4e66('0x16')](function(_0x1a25e8){logger[_0x4e66('0x12')](_0x4e66('0xf'),_0x121b16,_0x1a25e8);_0x2818a4(_0x1a25e8);});});}exports['CreatePlugin']=function(_0x4dc48c){var _0xd8d21d=this;return new Promise(function(_0x53aa90,_0x2fb0ef){return db[_0x4e66('0x17')][_0x4e66('0x18')](_0x4dc48c['body'],{'raw':_0x4dc48c[_0x4e66('0x19')]?_0x4dc48c[_0x4e66('0x19')][_0x4e66('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x2dcb0f){logger['info'](_0x4e66('0x1b'),_0x4dc48c);logger[_0x4e66('0x10')](_0x4e66('0x1b'),_0x4dc48c,JSON[_0x4e66('0x11')](_0x2dcb0f));_0x53aa90(_0x2dcb0f);})[_0x4e66('0x16')](function(_0x104bfe){logger[_0x4e66('0x12')](_0x4e66('0x1b'),_0x104bfe[_0x4e66('0x14')],_0x4dc48c);_0x2fb0ef(_0xd8d21d[_0x4e66('0x12')](0x1f4,_0x104bfe[_0x4e66('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index fc59ad7..de6b1fa 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 _0x0a0a=['removeListener','register','plugin:','./plugin.events','save','remove','update'];(function(_0x523adf,_0x3e1620){var _0x283870=function(_0xa0e816){while(--_0xa0e816){_0x523adf['push'](_0x523adf['shift']());}};_0x283870(++_0x3e1620);}(_0x0a0a,0x130));var _0xa0a0=function(_0x36c848,_0x305c9a){_0x36c848=_0x36c848-0x0;var _0x421cfb=_0x0a0a[_0x36c848];return _0x421cfb;};'use strict';var PluginEvents=require(_0xa0a0('0x0'));var events=[_0xa0a0('0x1'),_0xa0a0('0x2'),_0xa0a0('0x3')];function createListener(_0x15bc36,_0x27fd48){return function(_0x5ac2bc){_0x27fd48['emit'](_0x15bc36,_0x5ac2bc);};}function removeListener(_0x11cc6c,_0x5adb0b){return function(){PluginEvents[_0xa0a0('0x4')](_0x11cc6c,_0x5adb0b);};}exports[_0xa0a0('0x5')]=function(_0x5d0045){for(var _0x49b492=0x0,_0x3b5886=events['length'];_0x49b492<_0x3b5886;_0x49b492++){var _0x3487e1=events[_0x49b492];var _0x4f931c=createListener(_0xa0a0('0x6')+_0x3487e1,_0x5d0045);PluginEvents['on'](_0x3487e1,_0x4f931c);}}; \ No newline at end of file +var _0x0158=['./plugin.events','save','remove','update','removeListener','length','plugin:'];(function(_0x4fa0ea,_0x2cd534){var _0x51d027=function(_0xe67342){while(--_0xe67342){_0x4fa0ea['push'](_0x4fa0ea['shift']());}};_0x51d027(++_0x2cd534);}(_0x0158,0x173));var _0x8015=function(_0x309fa0,_0x4c604d){_0x309fa0=_0x309fa0-0x0;var _0x3b898b=_0x0158[_0x309fa0];return _0x3b898b;};'use strict';var PluginEvents=require(_0x8015('0x0'));var events=[_0x8015('0x1'),_0x8015('0x2'),_0x8015('0x3')];function createListener(_0x69e67f,_0x57dd50){return function(_0x2f146b){_0x57dd50['emit'](_0x69e67f,_0x2f146b);};}function removeListener(_0x3e0e7d,_0x453f3c){return function(){PluginEvents[_0x8015('0x4')](_0x3e0e7d,_0x453f3c);};}exports['register']=function(_0x13ef05){for(var _0xed2881=0x0,_0x98bc22=events[_0x8015('0x5')];_0xed2881<_0x98bc22;_0xed2881++){var _0x3506b0=events[_0xed2881];var _0x2521a0=createListener(_0x8015('0x6')+_0x3506b0,_0x13ef05);PluginEvents['on'](_0x3506b0,_0x2521a0);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index bb21c2f..8b02184 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(_0x5f0604,_0x59aabf){var _0x427f0d=function(_0x38b84f){while(--_0x38b84f){_0x5f0604['push'](_0x5f0604['shift']());}};_0x427f0d(++_0x59aabf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0xa9e0[_0x3a6efd];return _0x487b9a;};'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(_0x253c4a,_0x81eaeb){var _0x3b4eb1=function(_0x926655){while(--_0x926655){_0x253c4a['push'](_0x253c4a['shift']());}};_0x3b4eb1(++_0x81eaeb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'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 11f4874..c481e7c 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 _0xcb91=['describe','create','body','../../files/plugins','cwd','chdir','dirname','dump','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','params','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/logger','api','path','child_process','bluebird','sendStatus','json','name','status','send','npm\x20install','info','list','then','reject','express','length','catch','show'];(function(_0x33a7c1,_0x13a851){var _0x449462=function(_0x7a71b6){while(--_0x7a71b6){_0x33a7c1['push'](_0x33a7c1['shift']());}};_0x449462(++_0x13a851);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2a5099,_0x329e92){_0x2a5099=_0x2a5099-0x0;var _0x2802f1=_0xcb91[_0x2a5099];return _0x2802f1;};'use strict';var _=require('lodash');var pm2=require('../../config/pm2');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var path=require(_0x1cb9('0x2'));var exec=require(_0x1cb9('0x3'))['exec'];var BPromise=require(_0x1cb9('0x4'));function handleEntityNotFound(_0x2c17b8,_0x545a34){return function(_0x13d5fd){if(!_0x13d5fd){_0x2c17b8[_0x1cb9('0x5')](0x194);;}return _0x13d5fd;};}function respondWithResult(_0x53ffbd,_0x226b69){_0x226b69=_0x226b69||0xc8;return function(_0x3f7deb){if(_0x3f7deb){return _0x53ffbd['status'](_0x226b69)[_0x1cb9('0x6')](_0x3f7deb);}return null;};}function handleError(_0x12567c,_0x59d1be){_0x59d1be=_0x59d1be||0x1f4;return function(_0x3ae0f1){logger['error'](_0x3ae0f1['stack']);if(_0x3ae0f1[_0x1cb9('0x7')]){delete _0x3ae0f1[_0x1cb9('0x7')];}_0x12567c[_0x1cb9('0x8')](_0x59d1be)[_0x1cb9('0x9')](_0x3ae0f1);};}function execChildProcess(){return new BPromise(function(_0x2fc627,_0x50ce71){exec(_0x1cb9('0xa'),function(_0x44a6b4,_0x3af35f,_0x3fdd83){logger[_0x1cb9('0xb')](_0x3af35f);logger['info'](_0x3fdd83);if(_0x44a6b4){logger['error'](_0x44a6b4);return _0x50ce71(_0x44a6b4);}return _0x2fc627(_0x3af35f);});});}exports['index']=function(_0x358866,_0x282bc6){return pm2[_0x1cb9('0xc')]()[_0x1cb9('0xd')](function(_0x56884d){if(_0x56884d){var _0x397727=_[_0x1cb9('0xe')](_0x56884d,function(_0x1b3cd7){return _0x1b3cd7[_0x1cb9('0x7')]===_0x1cb9('0xf')||_0x1b3cd7['name']==='motion2';});return{'rows':_0x397727,'count':_0x397727[_0x1cb9('0x10')]};}return null;})[_0x1cb9('0xd')](respondWithResult(_0x282bc6,null))[_0x1cb9('0x11')](handleError(_0x282bc6,null));};exports[_0x1cb9('0x12')]=function(_0x3e21e0,_0xf22920){return pm2[_0x1cb9('0x13')](_0x3e21e0['params']['id'])['then'](respondWithResult(_0xf22920,null))[_0x1cb9('0xd')](handleEntityNotFound(_0xf22920,null))[_0x1cb9('0x11')](handleError(_0xf22920,null));};exports[_0x1cb9('0x14')]=function(_0x31481a,_0x280a84){if(_0x31481a[_0x1cb9('0x15')][_0x1cb9('0x7')]&&_0x31481a['body']['script']){var _0x1a5a72=path['join'](__dirname,_0x1cb9('0x16'),_0x31481a[_0x1cb9('0x15')]['script']);var _0x599275=process[_0x1cb9('0x17')]();process[_0x1cb9('0x18')](path[_0x1cb9('0x19')](_0x1a5a72));return execChildProcess()[_0x1cb9('0xd')](function(_0x45b8d3){process[_0x1cb9('0x18')](_0x599275);return pm2['start']({'name':_0x31481a['body'][_0x1cb9('0x7')],'script':_0x1a5a72});})['then'](function(_0x10a419){pm2[_0x1cb9('0x1a')]();return _0x10a419[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x280a84,0xc9))[_0x1cb9('0x11')](handleError(_0x280a84,null));}else{return _0x280a84[_0x1cb9('0x8')](0x1f4)['send']({'message':_0x1cb9('0x1b')});}};exports[_0x1cb9('0x1c')]=function(_0x4c8d76,_0xd6891c){if(_0x4c8d76[_0x1cb9('0x15')]['id']){delete _0x4c8d76[_0x1cb9('0x15')]['id'];}var _0x1804fd={'online':_0x1cb9('0x1d'),'stopped':_0x1cb9('0x1e')};if(_0x1804fd[_0x1cb9('0x1f')](_0x4c8d76[_0x1cb9('0x15')][_0x1cb9('0x8')])){return pm2[_0x1804fd[_0x4c8d76[_0x1cb9('0x15')]['status']]](_0x4c8d76[_0x1cb9('0x20')]['id'])['then'](respondWithResult(_0xd6891c,0xc8))[_0x1cb9('0x11')](handleError(_0xd6891c,null));}else{return _0xd6891c['status'](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x21')});}};exports[_0x1cb9('0x22')]=function(_0x2038aa,_0x561d89){if(_0x2038aa[_0x1cb9('0x15')]['id']){delete _0x2038aa['body']['id'];}if(_0x2038aa[_0x1cb9('0x20')]['id']){return pm2[_0x1cb9('0x23')](_0x2038aa[_0x1cb9('0x20')]['id'])['then'](function(_0xae4c7a){pm2['dump']();return _0xae4c7a[0x0];})[_0x1cb9('0xd')](respondWithResult(_0x561d89,null))['catch'](handleError(_0x561d89,null));}else{return _0x561d89[_0x1cb9('0x8')](0x1f4)[_0x1cb9('0x9')]({'message':_0x1cb9('0x24')});}}; \ No newline at end of file +var _0xb9a7=['name','npm\x20install','info','error','index','list','reject','express','motion2','length','catch','describe','params','then','create','body','../../files/plugins','script','cwd','dirname','chdir','start','dump','Missing\x20name\x20and/or\x20path','update','restart','Unknown\x20status','destroy','Unknown\x20id','../../config/pm2','child_process','bluebird','sendStatus','status','json'];(function(_0x939ecd,_0x1b7367){var _0x16891a=function(_0x4f83be){while(--_0x4f83be){_0x939ecd['push'](_0x939ecd['shift']());}};_0x16891a(++_0x1b7367);}(_0xb9a7,0x112));var _0x7b9a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xb9a7[_0x88cd7b];return _0x56fcc8;};'use strict';var _=require('lodash');var pm2=require(_0x7b9a('0x0'));var logger=require('../../config/logger')('api');var path=require('path');var exec=require(_0x7b9a('0x1'))['exec'];var BPromise=require(_0x7b9a('0x2'));function handleEntityNotFound(_0x40ef7d,_0x37b25b){return function(_0x24cae3){if(!_0x24cae3){_0x40ef7d[_0x7b9a('0x3')](0x194);;}return _0x24cae3;};}function respondWithResult(_0xf6dae2,_0x22764f){_0x22764f=_0x22764f||0xc8;return function(_0x7019fd){if(_0x7019fd){return _0xf6dae2[_0x7b9a('0x4')](_0x22764f)[_0x7b9a('0x5')](_0x7019fd);}return null;};}function handleError(_0x4d3f20,_0x43d8e2){_0x43d8e2=_0x43d8e2||0x1f4;return function(_0x3e84f1){logger['error'](_0x3e84f1['stack']);if(_0x3e84f1['name']){delete _0x3e84f1[_0x7b9a('0x6')];}_0x4d3f20[_0x7b9a('0x4')](_0x43d8e2)['send'](_0x3e84f1);};}function execChildProcess(){return new BPromise(function(_0x32c85d,_0x5b13f3){exec(_0x7b9a('0x7'),function(_0x597732,_0x3af176,_0x1584a2){logger[_0x7b9a('0x8')](_0x3af176);logger['info'](_0x1584a2);if(_0x597732){logger[_0x7b9a('0x9')](_0x597732);return _0x5b13f3(_0x597732);}return _0x32c85d(_0x3af176);});});}exports[_0x7b9a('0xa')]=function(_0x5e3875,_0x67553c){return pm2[_0x7b9a('0xb')]()['then'](function(_0xb157e5){if(_0xb157e5){var _0xde180d=_[_0x7b9a('0xc')](_0xb157e5,function(_0x2853f2){return _0x2853f2[_0x7b9a('0x6')]===_0x7b9a('0xd')||_0x2853f2[_0x7b9a('0x6')]===_0x7b9a('0xe');});return{'rows':_0xde180d,'count':_0xde180d[_0x7b9a('0xf')]};}return null;})['then'](respondWithResult(_0x67553c,null))[_0x7b9a('0x10')](handleError(_0x67553c,null));};exports['show']=function(_0x123921,_0xa217cb){return pm2[_0x7b9a('0x11')](_0x123921[_0x7b9a('0x12')]['id'])[_0x7b9a('0x13')](respondWithResult(_0xa217cb,null))[_0x7b9a('0x13')](handleEntityNotFound(_0xa217cb,null))[_0x7b9a('0x10')](handleError(_0xa217cb,null));};exports[_0x7b9a('0x14')]=function(_0x2064a0,_0x588c48){if(_0x2064a0[_0x7b9a('0x15')][_0x7b9a('0x6')]&&_0x2064a0[_0x7b9a('0x15')]['script']){var _0x993048=path['join'](__dirname,_0x7b9a('0x16'),_0x2064a0['body'][_0x7b9a('0x17')]);var _0x331ae6=process[_0x7b9a('0x18')]();process['chdir'](path[_0x7b9a('0x19')](_0x993048));return execChildProcess()[_0x7b9a('0x13')](function(_0x5705b2){process[_0x7b9a('0x1a')](_0x331ae6);return pm2[_0x7b9a('0x1b')]({'name':_0x2064a0[_0x7b9a('0x15')][_0x7b9a('0x6')],'script':_0x993048});})[_0x7b9a('0x13')](function(_0x5b2f52){pm2[_0x7b9a('0x1c')]();return _0x5b2f52[0x0];})[_0x7b9a('0x13')](respondWithResult(_0x588c48,0xc9))['catch'](handleError(_0x588c48,null));}else{return _0x588c48[_0x7b9a('0x4')](0x1f4)['send']({'message':_0x7b9a('0x1d')});}};exports[_0x7b9a('0x1e')]=function(_0x4c2271,_0x55d01c){if(_0x4c2271[_0x7b9a('0x15')]['id']){delete _0x4c2271['body']['id'];}var _0x54df8a={'online':_0x7b9a('0x1f'),'stopped':'stop'};if(_0x54df8a['hasOwnProperty'](_0x4c2271[_0x7b9a('0x15')]['status'])){return pm2[_0x54df8a[_0x4c2271[_0x7b9a('0x15')][_0x7b9a('0x4')]]](_0x4c2271['params']['id'])[_0x7b9a('0x13')](respondWithResult(_0x55d01c,0xc8))[_0x7b9a('0x10')](handleError(_0x55d01c,null));}else{return _0x55d01c[_0x7b9a('0x4')](0x1f4)['send']({'message':_0x7b9a('0x20')});}};exports[_0x7b9a('0x21')]=function(_0x181e9c,_0x6c8b1f){if(_0x181e9c[_0x7b9a('0x15')]['id']){delete _0x181e9c[_0x7b9a('0x15')]['id'];}if(_0x181e9c['params']['id']){return pm2['delete'](_0x181e9c[_0x7b9a('0x12')]['id'])[_0x7b9a('0x13')](function(_0x6daf3c){pm2['dump']();return _0x6daf3c[0x0];})[_0x7b9a('0x13')](respondWithResult(_0x6c8b1f,null))[_0x7b9a('0x10')](handleError(_0x6c8b1f,null));}else{return _0x6c8b1f['status'](0x1f4)['send']({'message':_0x7b9a('0x22')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 7437afc..637181c 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 _0x10be=['get','/agents','isAuthenticated','/queues','Router','../../components/auth/service','./realtime.controller'];(function(_0xe97116,_0x46e3c6){var _0x3ba5da=function(_0x5bb058){while(--_0x5bb058){_0xe97116['push'](_0xe97116['shift']());}};_0x3ba5da(++_0x46e3c6);}(_0x10be,0x1a8));var _0xe10b=function(_0x3311bd,_0x3a9643){_0x3311bd=_0x3311bd-0x0;var _0xf063db=_0x10be[_0x3311bd];return _0xf063db;};'use strict';var express=require('express');var router=express[_0xe10b('0x0')]();var auth=require(_0xe10b('0x1'));var controller=require(_0xe10b('0x2'));router[_0xe10b('0x3')](_0xe10b('0x4'),auth[_0xe10b('0x5')](),controller['getAgents']);router[_0xe10b('0x3')](_0xe10b('0x6'),auth[_0xe10b('0x5')](),controller['getQueues']);module['exports']=router; \ No newline at end of file +var _0x6bbc=['Router','../../components/auth/service','./realtime.controller','get','isAuthenticated','/queues','getQueues','exports','express'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0x6bbc,0xa1));var _0xc6bb=function(_0x593500,_0x31ef0d){_0x593500=_0x593500-0x0;var _0x548eea=_0x6bbc[_0x593500];return _0x548eea;};'use strict';var express=require(_0xc6bb('0x0'));var router=express[_0xc6bb('0x1')]();var auth=require(_0xc6bb('0x2'));var controller=require(_0xc6bb('0x3'));router[_0xc6bb('0x4')]('/agents',auth[_0xc6bb('0x5')](),controller['getAgents']);router[_0xc6bb('0x4')](_0xc6bb('0x6'),auth[_0xc6bb('0x5')](),controller[_0xc6bb('0x7')]);module[_0xc6bb('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 3efb8e8..3585808 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 _0x36b9=['unknown','unavailable','ringing','chatPause','faxPause','smsPause','voicePause','whatsappPause','every','voiceStatus','chatStatus','faxStatus','smsStatus','pause','*pause','getAgents','userpic','lastPauseAt','address','openchannelPause','mailPause','chatCapacity','openchannelCapacity','smsCapacity','whatsappCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','whatsappCurrentCapacity','faxCurrentCapacity','openchannelStatus','whatsappStatus','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','voiceStatusTime','destconnectedlinenum','screenrecording','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','rawAttributes','type','key','query','role','getOptions','raw','user','userProfileId','agent','nolimit','sort','UserProfile','getResources','findAndCountAll','rows','pick','omit','globalStatus','pauseType','pauseTypeFilter','getQueues','chat','sms','openchannel','whatsapp','resolve','channel','includes','toLowerCase','Invalid\x20channel','fieldName','QueueCampaigns','all','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','client','limit','undefined','count','offset','status','set','Content-Range','json','error','stack','name','send','request','Agents','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','loggedIn','available','waiting','talking','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','map','get','loggedInDb','voice','find','filter','queue','internal','toString','getMembers','length','UserId','online','busy','User','startCase','Queue','findAll','QueueId','agents','idle'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x36b9,0xe7));var _0x936b=function(_0x5824ce,_0x4b6098){_0x5824ce=_0x5824ce-0x0;var _0x488193=_0x36b9[_0x5824ce];return _0x488193;};'use strict';var util=require(_0x936b('0x0'));var _=require('lodash');var jayson=require(_0x936b('0x1'));var qs=require(_0x936b('0x2'));var logger=require(_0x936b('0x3'))(_0x936b('0x4'));var db=require(_0x936b('0x5'))['db'];var amiClient=jayson['client'][_0x936b('0x6')]({'port':0x232a});var routingClient=jayson[_0x936b('0x7')][_0x936b('0x6')]({'port':0x232c});function respondWithFilteredResult(_0x71af19,_0x71ad6f){return function(_0x2554af){if(_0x2554af){var _0x4d4e82=typeof _0x71ad6f['offset']==='undefined'&&typeof _0x71ad6f[_0x936b('0x8')]===_0x936b('0x9');var _0x6f37d4=_0x2554af[_0x936b('0xa')];var _0x5767b8=_0x4d4e82?0x0:_0x71ad6f[_0x936b('0xb')];var _0x3b6f85=_0x4d4e82?_0x2554af[_0x936b('0xa')]:_0x71ad6f[_0x936b('0xb')]+_0x71ad6f['limit'];var _0x7745f0;if(_0x3b6f85>=_0x6f37d4){_0x3b6f85=_0x6f37d4;_0x7745f0=0xc8;}else{_0x7745f0=0xce;}_0x71af19[_0x936b('0xc')](_0x7745f0);return _0x71af19[_0x936b('0xd')](_0x936b('0xe'),_0x5767b8+'-'+_0x3b6f85+'/'+_0x6f37d4)[_0x936b('0xf')](_0x2554af);}return null;};}function handleError(_0x5843a9,_0xe85ef6){_0xe85ef6=_0xe85ef6||0x1f4;return function(_0x245ad6){logger[_0x936b('0x10')](_0x245ad6[_0x936b('0x11')]);if(_0x245ad6[_0x936b('0x12')]){delete _0x245ad6[_0x936b('0x12')];}_0x5843a9['status'](_0xe85ef6)[_0x936b('0x13')](_0x245ad6);};}function getRealtimeAgents(){return new Promise(function(_0xe53a8d,_0x2745d5){return amiClient[_0x936b('0x14')](_0x936b('0x15'),{})[_0x936b('0x16')](function(_0x6bd6c9){if(_0x6bd6c9[_0x936b('0x10')])throw new Error(_0x936b('0x17'));var _0x38f8d3=_0x6bd6c9[_0x936b('0x18')];return routingClient[_0x936b('0x14')](_0x936b('0x15'),{})[_0x936b('0x16')](function(_0x2af32a){if(_0x2af32a[_0x936b('0x10')])throw new Error(_0x936b('0x19'));var _0x2c6745=_0x2af32a[_0x936b('0x18')];return _0xe53a8d(_[_0x936b('0x1a')]({},_0x38f8d3,_0x2c6745));});})[_0x936b('0x1b')](function(_0x2d053c){_0x2745d5(_0x2d053c);});});}function getRealtimeQueues(_0x3ac64e,_0x2f8d02){return new Promise(function(_0x433bd1,_0x25cc41){var _0xeab486=_0x2f8d02==='voice'?amiClient:routingClient;return _0xeab486['request'](_['startCase'](_0x2f8d02)+_0x936b('0x1c'),_0x3ac64e)['then'](function(_0x29605d){if(_0x29605d[_0x936b('0x10')])throw new Error(util[_0x936b('0x1d')](_0x936b('0x1e'),_0x2f8d02));return _0x433bd1(_0x29605d[_0x936b('0x18')]);})[_0x936b('0x1b')](function(_0x346621){_0x25cc41(_0x346621);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x22b5bd,_0x2d13a8){return amiClient['request'](_0x936b('0x1f'),{})['then'](function(_0x591094){if(_0x591094[_0x936b('0x10')])throw new Error('Unable\x20to\x20retrieve\x20voice\x20queues\x20channels');return _0x22b5bd(_0x591094['result']);})['catch'](function(_0x5460f6){_0x2d13a8(_0x5460f6);});});}function initializeQueues(_0x94b80b,_0x5448f5,_0x18fb59,_0x2676e1){var _0x1f21ad=[_0x936b('0x20'),_0x936b('0x21'),_0x936b('0x22'),_0x936b('0x23'),_0x936b('0x24')];if(_0x18fb59==='voice'&&_0x2676e1===_0x936b('0x25')){_0x1f21ad[_0x936b('0x26')](_0x936b('0x27'),_0x936b('0x28'),_0x936b('0x29'),_0x936b('0x2a'),_0x936b('0x2b'),_0x936b('0x2c'),_0x936b('0x2d'),_0x936b('0x2e'),_0x936b('0x2f'),_0x936b('0x30'),_0x936b('0x31'),'erlangBusyFactor',_0x936b('0x32'),'dialPredictiveIntervalMaxThreshold',_0x936b('0x33'),_0x936b('0x34'),'predictiveIntervalTotalCalls',_0x936b('0x35'),_0x936b('0x36'),_0x936b('0x37'),_0x936b('0x38'),_0x936b('0x39'));}return _0x94b80b[_0x936b('0x3a')](function(_0x399bfe){var _0x570cf9=_0x399bfe[_0x936b('0x3b')]({'plain':!![]});_0x570cf9['agents']=[];_0x570cf9[_0x936b('0x24')]=0x0;_0x570cf9[_0x936b('0x3c')]=0x0;_0x570cf9['loggedIn']=0x0;_0x570cf9[_0x936b('0x21')]=0x0;_0x570cf9[_0x936b('0x22')]=0x0;if(_0x18fb59===_0x936b('0x3d')){_0x570cf9[_0x936b('0x23')]=0x0;_0x570cf9['busy']=0x0;if(_0x2676e1==='outbound'){_0x570cf9['pTalking']=0x0;_0x570cf9['originated']=0x0;}}var _0x26477c=_[_0x936b('0x3e')](_0x5448f5,['id',_0x570cf9['id']]);if(_0x26477c)_[_0x936b('0x1a')](_0x570cf9,_['pick'](_0x26477c,_0x1f21ad));return _0x570cf9;});}function updateAgentVoiceStatus(_0x48f167,_0x2f860b,_0x8c8632){var _0x5e79fa=_[_0x936b('0x3f')](_0x8c8632,[_0x936b('0x40'),_0x2f860b[_0x936b('0x12')]]);if(_0x5e79fa['length']===0x0)return _0x48f167['busy']=!![];if(_['some'](_0x5e79fa,['connectedlinenum',_0x48f167[_0x936b('0x41')][_0x936b('0x42')]()]))return _0x48f167[_0x936b('0x23')]=!![];if(!_0x48f167[_0x936b('0x23')])return _0x48f167['busy']=!![];}function getVoiceQueueAgents(_0x14f6f9,_0x3e1789,_0x5d7145,_0x460cf9){var _0x354493=_['find'](_0x3e1789,['id',_0x14f6f9['id']]);if(!_0x354493)return _0x14f6f9;return _0x354493[_0x936b('0x43')]({'raw':!![]})[_0x936b('0x16')](function(_0x15b198){for(var _0x12511e=0x0;_0x12511e<_0x15b198[_0x936b('0x44')];_0x12511e++){var _0x217741=_['find'](_0x5d7145,['id',_0x15b198[_0x12511e][_0x936b('0x45')]]);if(!_0x217741){_0x217741={'id':_0x15b198[_0x12511e][_0x936b('0x45')],'name':_0x15b198[_0x12511e]['UserId'],'accountcode':'','online':![]};}var _0x2e766f={'id':_0x217741['id'],'name':_0x217741[_0x936b('0x12')],'internal':_0x217741['accountcode'],'online':Boolean(_0x217741['online']),'paused':Boolean(_0x15b198[_0x12511e][_0x936b('0x24')])};if(_0x217741['voiceStatus']==='talking')updateAgentVoiceStatus(_0x2e766f,_0x14f6f9,_0x460cf9);if(_0x2e766f[_0x936b('0x46')])_0x14f6f9[_0x936b('0x3c')]++;if(_0x2e766f[_0x936b('0x47')])_0x14f6f9['busy']++;if(_0x2e766f[_0x936b('0x24')]&&!_0x2e766f[_0x936b('0x47')]&&!_0x2e766f[_0x936b('0x23')])_0x14f6f9[_0x936b('0x24')]++;_0x14f6f9['agents']['push'](_0x2e766f);}return _0x14f6f9;});}function getQueueAgents(_0x2fd46a,_0x5e85bf,_0x3c6bc8){var _0x15dcc3=_0x936b('0x48')+_[_0x936b('0x49')](_0x3c6bc8)+_0x936b('0x4a');var _0x4018b3=_0x3c6bc8+'Pause';return db[_0x15dcc3][_0x936b('0x4b')]({'where':{[_['startCase'](_0x3c6bc8)+_0x936b('0x4c')]:_0x2fd46a['id']},'raw':!![]})[_0x936b('0x16')](function(_0x12066c){for(var _0x581b0b=0x0;_0x581b0b<_0x12066c[_0x936b('0x44')];_0x581b0b++){var _0x19c23e=_[_0x936b('0x3e')](_0x5e85bf,['id',_0x12066c[_0x581b0b][_0x936b('0x45')]]);if(!_0x19c23e){_0x19c23e={'id':_0x12066c[_0x581b0b]['UserId'],'name':_0x12066c[_0x581b0b][_0x936b('0x45')],'online':![],['pauseField']:![]};}var _0x4112b5={'id':_0x19c23e['id'],'name':_0x19c23e[_0x936b('0x12')],'online':Boolean(_0x19c23e[_0x936b('0x46')]),'paused':Boolean(_0x19c23e[_0x4018b3])};if(_0x4112b5[_0x936b('0x46')])_0x2fd46a[_0x936b('0x3c')]++;_0x2fd46a[_0x936b('0x4d')][_0x936b('0x26')](_0x4112b5);}return _0x2fd46a;});}function isIdle(_0x3b70a5){return _0x3b70a5===_0x936b('0x4e')||_0x3b70a5===_0x936b('0x4f')||_0x3b70a5===_0x936b('0x50')||_0x3b70a5===_0x936b('0x51')||_['isNil'](_0x3b70a5);}function isAgentPaused(_0x2072f6,_0x23f6ae){var _0x49f1fc=[_0x2072f6[_0x936b('0x52')],_0x2072f6[_0x936b('0x53')],_0x2072f6['mailPause'],_0x2072f6['openchannelPause'],_0x2072f6[_0x936b('0x54')],_0x2072f6[_0x936b('0x55')],_0x2072f6[_0x936b('0x56')]];if(!_0x23f6ae)return _[_0x936b('0x57')](_0x49f1fc);var _0x5ee627=_['filter'](_0x49f1fc);return _0x5ee627['length']>0x0&&_0x5ee627[_0x936b('0x44')]<_0x49f1fc['length']?!![]:![];}function isAgentIdle(_0x5a33fb){if(_0x5a33fb[_0x936b('0x58')]!==_0x936b('0x4e')&&_0x5a33fb['voicePause']){_0x5a33fb[_0x936b('0x58')]='pause';return![];}return _['every']([_0x5a33fb[_0x936b('0x59')],_0x5a33fb[_0x936b('0x5a')],_0x5a33fb['mailStatus'],_0x5a33fb['openchannelStatus'],_0x5a33fb[_0x936b('0x5b')],_0x5a33fb[_0x936b('0x58')],_0x5a33fb['whatsappStatus']],isIdle);}function getAgentStatus(_0x1dbccf){var _0x28f7f0='unknown';if(isAgentPaused(_0x1dbccf))_0x28f7f0=_0x936b('0x5c');else if(isAgentPaused(_0x1dbccf,!![]))_0x28f7f0=_0x936b('0x5d');else if(isAgentIdle(_0x1dbccf))_0x28f7f0='idle';else _0x28f7f0=_0x936b('0x47');return _0x28f7f0;}exports[_0x936b('0x5e')]=function(_0x13429f,_0x5c5f3a){var _0x386722={'count':0x0,'rows':[]},_0x26dfd4={},_0x97fe8b,_0x28f0d7,_0x274c3a=[_0x936b('0x5f'),'online','lastLoginAt',_0x936b('0x60'),'pauseType',_0x936b('0x60'),_0x936b('0x41'),_0x936b('0x61'),_0x936b('0x52'),_0x936b('0x62'),_0x936b('0x63'),'smsPause','whatsappPause',_0x936b('0x53'),_0x936b('0x55'),_0x936b('0x64'),_0x936b('0x65'),'mailCapacity',_0x936b('0x66'),_0x936b('0x67'),'faxCapacity','chatCurrentCapacity',_0x936b('0x68'),_0x936b('0x69'),_0x936b('0x6a'),_0x936b('0x6b'),_0x936b('0x6c'),_0x936b('0x59'),_0x936b('0x6d'),'mailStatus',_0x936b('0x5b'),_0x936b('0x6e'),'faxStatus',_0x936b('0x58'),_0x936b('0x6f'),_0x936b('0x70'),'mailStatusTime',_0x936b('0x71'),_0x936b('0x72'),'faxStatusTime',_0x936b('0x73'),_0x936b('0x40'),_0x936b('0x74'),_0x936b('0x75'),_0x936b('0x76'),_0x936b('0x77'),_0x936b('0x78')],_0x54a774=[_0x936b('0x52'),'openchannelPause',_0x936b('0x63'),_0x936b('0x54'),_0x936b('0x56'),'faxPause',_0x936b('0x55'),_0x936b('0x46')];Promise['resolve']()[_0x936b('0x16')](function(){var _0x12325d=_[_0x936b('0x3a')](db[_0x936b('0x48')][_0x936b('0x79')],function(_0x5a8392){return{'name':_0x5a8392['fieldName'],'type':_0x5a8392[_0x936b('0x7a')][_0x936b('0x7b')]};});_0x13429f[_0x936b('0x7c')][_0x936b('0x7d')]='agent';_0x13429f[_0x936b('0x7c')]['online']=!![];_0x26dfd4=qs[_0x936b('0x7e')](_0x12325d,_0x13429f);_0x26dfd4[_0x936b('0x7f')]=!![];if(_0x13429f['user'][_0x936b('0x7d')]===_0x936b('0x80')){var _0x293288={'params':{'id':_0x13429f[_0x936b('0x80')][_0x936b('0x81')]},'query':{'section':_0x936b('0x15'),'role':_0x936b('0x82'),'online':!![],'nolimit':_0x13429f[_0x936b('0x7c')][_0x936b('0x83')],'sort':_0x13429f['query'][_0x936b('0x84')],'filter':_0x13429f[_0x936b('0x7c')]['filter']},'raw':!![]};return db[_0x936b('0x85')][_0x936b('0x86')](_0x293288);}return db[_0x936b('0x48')][_0x936b('0x87')](_0x26dfd4);})[_0x936b('0x16')](function(_0x15d180){_0x386722['count']=_0x15d180[_0x936b('0xa')];_0x97fe8b=_0x15d180[_0x936b('0x88')];return getRealtimeAgents();})[_0x936b('0x16')](function(_0x170268){_0x28f0d7=_0x170268[_0x936b('0x88')];return _0x97fe8b[_0x936b('0x3a')](function(_0x544f6c){var _0x513776=_[_0x936b('0x3e')](_0x28f0d7,['id',_0x544f6c['id']]);if(_0x513776)_[_0x936b('0x1a')](_0x544f6c,_[_0x936b('0x89')](_[_0x936b('0x8a')](_0x513776,_0x54a774),_0x274c3a));_0x544f6c[_0x936b('0x8b')]=getAgentStatus(_0x544f6c);return _0x544f6c;});})[_0x936b('0x16')](function(_0x5b2a75){if(_0x13429f[_0x936b('0x7c')]['globalStatusFilter']){var _0x9b8000=_[_0x936b('0x3f')](_0x5b2a75,[_0x936b('0x8b'),_0x13429f['query']['globalStatusFilter']]);if(_0x13429f[_0x936b('0x7c')]['pauseTypeFilter']){_0x9b8000=_[_0x936b('0x3f')](_0x9b8000,[_0x936b('0x8c'),_0x13429f[_0x936b('0x7c')][_0x936b('0x8d')]]);}}_0x386722[_0x936b('0x88')]=_0x9b8000||_0x5b2a75;return _0x386722;})[_0x936b('0x16')](respondWithFilteredResult(_0x5c5f3a,_0x26dfd4))[_0x936b('0x1b')](handleError(_0x5c5f3a,null));};exports[_0x936b('0x8e')]=function(_0xf1ca69,_0x4fffe1){var _0x70fc82=['mail',_0x936b('0x8f'),_0x936b('0x90'),_0x936b('0x91'),'fax',_0x936b('0x92'),_0x936b('0x3d')];var _0x47764b={'count':0x0,'rows':[]},_0x48389c={},_0x60b2b,_0x3411fa,_0x24e4a7,_0x2d4d58,_0x41b053;Promise[_0x936b('0x93')]()[_0x936b('0x16')](function(){if(_0xf1ca69[_0x936b('0x7c')][_0x936b('0x94')]){if(!_[_0x936b('0x95')](_0x70fc82,_0xf1ca69['query']['channel'][_0x936b('0x96')]()))throw new Error(_0x936b('0x97'));_0x60b2b=_0xf1ca69[_0x936b('0x7c')]['channel'][_0x936b('0x96')]();}var _0x3b947e=_[_0x936b('0x49')](_0x60b2b)+_0x936b('0x4a');var _0xa70ba1=_[_0x936b('0x3a')](db[_0x3b947e][_0x936b('0x79')],function(_0x103d5c){return{'name':_0x103d5c[_0x936b('0x98')],'type':_0x103d5c[_0x936b('0x7a')]['key']};});_0x48389c=qs[_0x936b('0x7e')](_0xa70ba1,_0xf1ca69);if(_0xf1ca69['user'][_0x936b('0x7d')]===_0x936b('0x80')){var _0x3fd077={'params':{'id':_0xf1ca69[_0x936b('0x80')][_0x936b('0x81')]},'query':{'section':_0x60b2b===_0x936b('0x3d')&&_0xf1ca69['query']['type']==='outbound'?_0x936b('0x99'):_[_0x936b('0x49')](_0x60b2b)+_0x936b('0x1c'),'type':_0xf1ca69[_0x936b('0x7c')][_0x936b('0x7a')],'nolimit':!![],'sort':_0x936b('0x12'),'filter':_0xf1ca69[_0x936b('0x7c')]['filter']}};return db['UserProfile'][_0x936b('0x86')](_0x3fd077);}return db[_0x3b947e][_0x936b('0x87')](_0x48389c);})[_0x936b('0x16')](function(_0x150527){_0x47764b[_0x936b('0xa')]=_0x150527[_0x936b('0xa')];_0x3411fa=_0x150527[_0x936b('0x88')];return getRealtimeQueues(_0xf1ca69,_0x60b2b);})['then'](function(_0xd0ad13){_0x2d4d58=_0xd0ad13['rows'];return getRealtimeAgents();})[_0x936b('0x16')](function(_0x2efd55){_0x24e4a7=_0x2efd55[_0x936b('0x88')];if(_0x60b2b!=_0x936b('0x3d'))return;return getRealtimeVoiceQueueChannels();})[_0x936b('0x16')](function(_0x43d764){_0x41b053=_0x43d764?_0x43d764[_0x936b('0x88')]:[];return initializeQueues(_0x3411fa,_0x2d4d58,_0x60b2b,_0xf1ca69['query'][_0x936b('0x7a')]);})[_0x936b('0x16')](function(_0x15d5e3){var _0x3b2731=_0x15d5e3[_0x936b('0x3a')](function(_0x6e432e){if(_0x60b2b==='voice')return getVoiceQueueAgents(_0x6e432e,_0x3411fa,_0x24e4a7,_0x41b053);else return getQueueAgents(_0x6e432e,_0x24e4a7,_0x60b2b);});return Promise[_0x936b('0x9a')](_0x3b2731);})[_0x936b('0x16')](function(_0x434b0f){_0x47764b['rows']=_0x434b0f;return _0x47764b;})[_0x936b('0x16')](respondWithFilteredResult(_0x4fffe1,_0x48389c))[_0x936b('0x1b')](handleError(_0x4fffe1,null));}; \ No newline at end of file +var _0xcc5a=['faxPause','mailPause','openchannelPause','voicePause','whatsappPause','every','chatStatus','faxStatus','mailStatus','openchannelStatus','smsStatus','pause','lastLoginAt','pauseType','chatPause','smsPause','openchannelCapacity','mailCapacity','whatsappCapacity','faxCapacity','chatCurrentCapacity','openchannelCurrentCapacity','mailCurrentCapacity','smsCurrentCapacity','faxCurrentCapacity','chatStatusTime','openchannelStatusTime','smsStatusTime','whatsappStatusTime','faxStatusTime','voiceStatusTime','destconnectedlinenum','phoneBarEnableScreenRecordingByAgent','phoneBarEnableAutomaticScreenRecording','routealias','resolve','map','rawAttributes','fieldName','type','key','query','role','agent','raw','user','userProfileId','nolimit','sort','rows','omit','globalStatusFilter','pauseTypeFilter','getQueues','mail','chat','sms','openchannel','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','QueueCampaigns','getResources','findAndCountAll','util','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','http','client','undefined','limit','count','offset','status','set','Content-Range','error','name','request','then','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','result','Agents','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','merge','catch','voice','startCase','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','VoiceQueuesChannels','Unable\x20to\x20retrieve\x20voice\x20queues\x20channels','loggedIn','available','waiting','paused','outbound','push','pTalking','originated','message','dialActive','dialMethod','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialPredictiveInterval','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','agents','loggedInDb','talking','busy','find','pick','filter','queue','length','some','connectedlinenum','internal','toString','getMembers','UserId','accountcode','online','voiceStatus','User','Queue','findAll','QueueId','idle','unknown','unavailable','ringing','isNil'];(function(_0x1648f7,_0x5eb62d){var _0x32585e=function(_0x1b6409){while(--_0x1b6409){_0x1648f7['push'](_0x1648f7['shift']());}};_0x32585e(++_0x5eb62d);}(_0xcc5a,0x16e));var _0xacc5=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xcc5a[_0x1602ef];return _0x5870ee;};'use strict';var util=require(_0xacc5('0x0'));var _=require('lodash');var jayson=require(_0xacc5('0x1'));var qs=require(_0xacc5('0x2'));var logger=require(_0xacc5('0x3'))(_0xacc5('0x4'));var db=require(_0xacc5('0x5'))['db'];var amiClient=jayson['client'][_0xacc5('0x6')]({'port':0x232a});var routingClient=jayson[_0xacc5('0x7')]['http']({'port':0x232c});function respondWithFilteredResult(_0x4e491a,_0x9f8962){return function(_0x482321){if(_0x482321){var _0x25146a=typeof _0x9f8962['offset']===_0xacc5('0x8')&&typeof _0x9f8962[_0xacc5('0x9')]===_0xacc5('0x8');var _0x27da44=_0x482321[_0xacc5('0xa')];var _0x4361eb=_0x25146a?0x0:_0x9f8962[_0xacc5('0xb')];var _0x2710d2=_0x25146a?_0x482321[_0xacc5('0xa')]:_0x9f8962[_0xacc5('0xb')]+_0x9f8962['limit'];var _0x2c5c66;if(_0x2710d2>=_0x27da44){_0x2710d2=_0x27da44;_0x2c5c66=0xc8;}else{_0x2c5c66=0xce;}_0x4e491a[_0xacc5('0xc')](_0x2c5c66);return _0x4e491a[_0xacc5('0xd')](_0xacc5('0xe'),_0x4361eb+'-'+_0x2710d2+'/'+_0x27da44)['json'](_0x482321);}return null;};}function handleError(_0x2d2ed2,_0x4528d3){_0x4528d3=_0x4528d3||0x1f4;return function(_0x320e45){logger[_0xacc5('0xf')](_0x320e45['stack']);if(_0x320e45[_0xacc5('0x10')]){delete _0x320e45[_0xacc5('0x10')];}_0x2d2ed2[_0xacc5('0xc')](_0x4528d3)['send'](_0x320e45);};}function getRealtimeAgents(){return new Promise(function(_0x2f54be,_0x48bf39){return amiClient[_0xacc5('0x11')]('Agents',{})[_0xacc5('0x12')](function(_0x3957c1){if(_0x3957c1['error'])throw new Error(_0xacc5('0x13'));var _0x550284=_0x3957c1[_0xacc5('0x14')];return routingClient[_0xacc5('0x11')](_0xacc5('0x15'),{})[_0xacc5('0x12')](function(_0xb38da0){if(_0xb38da0[_0xacc5('0xf')])throw new Error(_0xacc5('0x16'));var _0x466ab1=_0xb38da0[_0xacc5('0x14')];return _0x2f54be(_[_0xacc5('0x17')]({},_0x550284,_0x466ab1));});})[_0xacc5('0x18')](function(_0x347d4b){_0x48bf39(_0x347d4b);});});}function getRealtimeQueues(_0x5ce086,_0x72ef2c){return new Promise(function(_0x287993,_0x2ce42a){var _0xd228f9=_0x72ef2c===_0xacc5('0x19')?amiClient:routingClient;return _0xd228f9['request'](_[_0xacc5('0x1a')](_0x72ef2c)+_0xacc5('0x1b'),_0x5ce086)[_0xacc5('0x12')](function(_0x2b8c0c){if(_0x2b8c0c[_0xacc5('0xf')])throw new Error(util[_0xacc5('0x1c')](_0xacc5('0x1d'),_0x72ef2c));return _0x287993(_0x2b8c0c[_0xacc5('0x14')]);})[_0xacc5('0x18')](function(_0x402498){_0x2ce42a(_0x402498);});});}function getRealtimeVoiceQueueChannels(){return new Promise(function(_0x1b0a3a,_0x1fa3f9){return amiClient['request'](_0xacc5('0x1e'),{})[_0xacc5('0x12')](function(_0x438288){if(_0x438288[_0xacc5('0xf')])throw new Error(_0xacc5('0x1f'));return _0x1b0a3a(_0x438288['result']);})['catch'](function(_0x1057bb){_0x1fa3f9(_0x1057bb);});});}function initializeQueues(_0x2b1317,_0x28480e,_0x5f042b,_0x35b384){var _0x22e627=[_0xacc5('0x20'),_0xacc5('0x21'),_0xacc5('0x22'),'talking',_0xacc5('0x23')];if(_0x5f042b===_0xacc5('0x19')&&_0x35b384===_0xacc5('0x24')){_0x22e627[_0xacc5('0x25')](_0xacc5('0x26'),_0xacc5('0x27'),_0xacc5('0x28'),_0xacc5('0x29'),_0xacc5('0x2a'),'Trunk',_0xacc5('0x2b'),_0xacc5('0x2c'),_0xacc5('0x2d'),_0xacc5('0x2e'),_0xacc5('0x2f'),'erlangBusyFactor',_0xacc5('0x30'),_0xacc5('0x31'),_0xacc5('0x32'),_0xacc5('0x33'),_0xacc5('0x34'),_0xacc5('0x35'),_0xacc5('0x36'),'predictiveIntervalDroppedCallsCallersExit',_0xacc5('0x37'),_0xacc5('0x38'));}return _0x2b1317['map'](function(_0x2040fb){var _0x2262eb=_0x2040fb['get']({'plain':!![]});_0x2262eb[_0xacc5('0x39')]=[];_0x2262eb[_0xacc5('0x23')]=0x0;_0x2262eb[_0xacc5('0x3a')]=0x0;_0x2262eb['loggedIn']=0x0;_0x2262eb[_0xacc5('0x21')]=0x0;_0x2262eb['waiting']=0x0;if(_0x5f042b===_0xacc5('0x19')){_0x2262eb[_0xacc5('0x3b')]=0x0;_0x2262eb[_0xacc5('0x3c')]=0x0;if(_0x35b384===_0xacc5('0x24')){_0x2262eb['pTalking']=0x0;_0x2262eb['originated']=0x0;}}var _0x229070=_[_0xacc5('0x3d')](_0x28480e,['id',_0x2262eb['id']]);if(_0x229070)_[_0xacc5('0x17')](_0x2262eb,_[_0xacc5('0x3e')](_0x229070,_0x22e627));return _0x2262eb;});}function updateAgentVoiceStatus(_0x49b72a,_0x2e0a50,_0x2525e9){var _0x403928=_[_0xacc5('0x3f')](_0x2525e9,[_0xacc5('0x40'),_0x2e0a50[_0xacc5('0x10')]]);if(_0x403928[_0xacc5('0x41')]===0x0)return _0x49b72a[_0xacc5('0x3c')]=!![];if(_[_0xacc5('0x42')](_0x403928,[_0xacc5('0x43'),_0x49b72a[_0xacc5('0x44')][_0xacc5('0x45')]()]))return _0x49b72a['talking']=!![];if(!_0x49b72a[_0xacc5('0x3b')])return _0x49b72a[_0xacc5('0x3c')]=!![];}function getVoiceQueueAgents(_0x5e8c3e,_0x3014a5,_0x529855,_0x19ef90){var _0x5873fb=_[_0xacc5('0x3d')](_0x3014a5,['id',_0x5e8c3e['id']]);if(!_0x5873fb)return _0x5e8c3e;return _0x5873fb[_0xacc5('0x46')]({'raw':!![]})[_0xacc5('0x12')](function(_0x5a13cf){for(var _0xc95ee0=0x0;_0xc95ee0<_0x5a13cf[_0xacc5('0x41')];_0xc95ee0++){var _0x34a3d7=_[_0xacc5('0x3d')](_0x529855,['id',_0x5a13cf[_0xc95ee0]['UserId']]);if(!_0x34a3d7){_0x34a3d7={'id':_0x5a13cf[_0xc95ee0][_0xacc5('0x47')],'name':_0x5a13cf[_0xc95ee0][_0xacc5('0x47')],'accountcode':'','online':![]};}var _0x14ab75={'id':_0x34a3d7['id'],'name':_0x34a3d7['name'],'internal':_0x34a3d7[_0xacc5('0x48')],'online':Boolean(_0x34a3d7[_0xacc5('0x49')]),'paused':Boolean(_0x5a13cf[_0xc95ee0][_0xacc5('0x23')])};if(_0x34a3d7[_0xacc5('0x4a')]===_0xacc5('0x3b'))updateAgentVoiceStatus(_0x14ab75,_0x5e8c3e,_0x19ef90);if(_0x14ab75['online'])_0x5e8c3e[_0xacc5('0x3a')]++;if(_0x14ab75['busy'])_0x5e8c3e[_0xacc5('0x3c')]++;if(_0x14ab75['paused']&&!_0x14ab75['busy']&&!_0x14ab75[_0xacc5('0x3b')])_0x5e8c3e['paused']++;_0x5e8c3e[_0xacc5('0x39')][_0xacc5('0x25')](_0x14ab75);}return _0x5e8c3e;});}function getQueueAgents(_0x14e1f6,_0xb72905,_0x2cf413){var _0x404abc=_0xacc5('0x4b')+_['startCase'](_0x2cf413)+_0xacc5('0x4c');var _0x3a97a4=_0x2cf413+'Pause';return db[_0x404abc][_0xacc5('0x4d')]({'where':{[_['startCase'](_0x2cf413)+_0xacc5('0x4e')]:_0x14e1f6['id']},'raw':!![]})[_0xacc5('0x12')](function(_0x196be6){for(var _0x4356cd=0x0;_0x4356cd<_0x196be6[_0xacc5('0x41')];_0x4356cd++){var _0x262729=_[_0xacc5('0x3d')](_0xb72905,['id',_0x196be6[_0x4356cd][_0xacc5('0x47')]]);if(!_0x262729){_0x262729={'id':_0x196be6[_0x4356cd][_0xacc5('0x47')],'name':_0x196be6[_0x4356cd][_0xacc5('0x47')],'online':![],['pauseField']:![]};}var _0x414336={'id':_0x262729['id'],'name':_0x262729['name'],'online':Boolean(_0x262729[_0xacc5('0x49')]),'paused':Boolean(_0x262729[_0x3a97a4])};if(_0x414336['online'])_0x14e1f6[_0xacc5('0x3a')]++;_0x14e1f6[_0xacc5('0x39')]['push'](_0x414336);}return _0x14e1f6;});}function isIdle(_0x470a52){return _0x470a52===_0xacc5('0x4f')||_0x470a52===_0xacc5('0x50')||_0x470a52===_0xacc5('0x51')||_0x470a52===_0xacc5('0x52')||_[_0xacc5('0x53')](_0x470a52);}function isAgentPaused(_0x2321fb,_0x517524){var _0x2d9677=[_0x2321fb['chatPause'],_0x2321fb[_0xacc5('0x54')],_0x2321fb[_0xacc5('0x55')],_0x2321fb[_0xacc5('0x56')],_0x2321fb['smsPause'],_0x2321fb[_0xacc5('0x57')],_0x2321fb[_0xacc5('0x58')]];if(!_0x517524)return _[_0xacc5('0x59')](_0x2d9677);var _0x2b39dc=_['filter'](_0x2d9677);return _0x2b39dc['length']>0x0&&_0x2b39dc[_0xacc5('0x41')]<_0x2d9677['length']?!![]:![];}function isAgentIdle(_0x5a3847){if(_0x5a3847[_0xacc5('0x4a')]!==_0xacc5('0x4f')&&_0x5a3847['voicePause']){_0x5a3847[_0xacc5('0x4a')]='pause';return![];}return _[_0xacc5('0x59')]([_0x5a3847[_0xacc5('0x5a')],_0x5a3847[_0xacc5('0x5b')],_0x5a3847[_0xacc5('0x5c')],_0x5a3847[_0xacc5('0x5d')],_0x5a3847[_0xacc5('0x5e')],_0x5a3847['voiceStatus'],_0x5a3847['whatsappStatus']],isIdle);}function getAgentStatus(_0x585b8e){var _0x60d639=_0xacc5('0x50');if(isAgentPaused(_0x585b8e))_0x60d639=_0xacc5('0x5f');else if(isAgentPaused(_0x585b8e,!![]))_0x60d639='*pause';else if(isAgentIdle(_0x585b8e))_0x60d639=_0xacc5('0x4f');else _0x60d639=_0xacc5('0x3c');return _0x60d639;}exports['getAgents']=function(_0x27cc18,_0x175409){var _0x423f7a={'count':0x0,'rows':[]},_0x110ce8={},_0x293ff5,_0x499cbb,_0x11a26b=['userpic',_0xacc5('0x49'),_0xacc5('0x60'),'lastPauseAt',_0xacc5('0x61'),'lastPauseAt',_0xacc5('0x44'),'address',_0xacc5('0x62'),_0xacc5('0x56'),_0xacc5('0x55'),_0xacc5('0x63'),_0xacc5('0x58'),_0xacc5('0x54'),_0xacc5('0x57'),'chatCapacity',_0xacc5('0x64'),_0xacc5('0x65'),'smsCapacity',_0xacc5('0x66'),_0xacc5('0x67'),_0xacc5('0x68'),_0xacc5('0x69'),_0xacc5('0x6a'),_0xacc5('0x6b'),'whatsappCurrentCapacity',_0xacc5('0x6c'),'chatStatus',_0xacc5('0x5d'),_0xacc5('0x5c'),_0xacc5('0x5e'),'whatsappStatus','faxStatus',_0xacc5('0x4a'),_0xacc5('0x6d'),_0xacc5('0x6e'),'mailStatusTime',_0xacc5('0x6f'),_0xacc5('0x70'),_0xacc5('0x71'),_0xacc5('0x72'),_0xacc5('0x40'),_0xacc5('0x73'),'screenrecording',_0xacc5('0x74'),_0xacc5('0x75'),_0xacc5('0x76')],_0x547a95=[_0xacc5('0x62'),_0xacc5('0x56'),_0xacc5('0x55'),_0xacc5('0x63'),_0xacc5('0x58'),_0xacc5('0x54'),'voicePause','online'];Promise[_0xacc5('0x77')]()[_0xacc5('0x12')](function(){var _0x3f2d47=_[_0xacc5('0x78')](db[_0xacc5('0x4b')][_0xacc5('0x79')],function(_0x509711){return{'name':_0x509711[_0xacc5('0x7a')],'type':_0x509711[_0xacc5('0x7b')][_0xacc5('0x7c')]};});_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x7e')]=_0xacc5('0x7f');_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x49')]=!![];_0x110ce8=qs['getOptions'](_0x3f2d47,_0x27cc18);_0x110ce8[_0xacc5('0x80')]=!![];if(_0x27cc18[_0xacc5('0x81')]['role']===_0xacc5('0x81')){var _0x225671={'params':{'id':_0x27cc18['user'][_0xacc5('0x82')]},'query':{'section':_0xacc5('0x15'),'role':_0xacc5('0x7f'),'online':!![],'nolimit':_0x27cc18['query'][_0xacc5('0x83')],'sort':_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x84')],'filter':_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x3f')]},'raw':!![]};return db['UserProfile']['getResources'](_0x225671);}return db[_0xacc5('0x4b')]['findAndCountAll'](_0x110ce8);})[_0xacc5('0x12')](function(_0x125dae){_0x423f7a[_0xacc5('0xa')]=_0x125dae[_0xacc5('0xa')];_0x293ff5=_0x125dae[_0xacc5('0x85')];return getRealtimeAgents();})[_0xacc5('0x12')](function(_0x479042){_0x499cbb=_0x479042[_0xacc5('0x85')];return _0x293ff5[_0xacc5('0x78')](function(_0x180d2a){var _0x312d1b=_[_0xacc5('0x3d')](_0x499cbb,['id',_0x180d2a['id']]);if(_0x312d1b)_[_0xacc5('0x17')](_0x180d2a,_[_0xacc5('0x3e')](_[_0xacc5('0x86')](_0x312d1b,_0x547a95),_0x11a26b));_0x180d2a['globalStatus']=getAgentStatus(_0x180d2a);return _0x180d2a;});})[_0xacc5('0x12')](function(_0x40ddae){if(_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x87')]){var _0x58916d=_[_0xacc5('0x3f')](_0x40ddae,['globalStatus',_0x27cc18['query'][_0xacc5('0x87')]]);if(_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x88')]){_0x58916d=_[_0xacc5('0x3f')](_0x58916d,[_0xacc5('0x61'),_0x27cc18[_0xacc5('0x7d')][_0xacc5('0x88')]]);}}_0x423f7a['rows']=_0x58916d||_0x40ddae;return _0x423f7a;})[_0xacc5('0x12')](respondWithFilteredResult(_0x175409,_0x110ce8))[_0xacc5('0x18')](handleError(_0x175409,null));};exports[_0xacc5('0x89')]=function(_0x2670b2,_0x21ae1d){var _0x3bd66a=[_0xacc5('0x8a'),_0xacc5('0x8b'),_0xacc5('0x8c'),_0xacc5('0x8d'),_0xacc5('0x8e'),_0xacc5('0x8f'),_0xacc5('0x19')];var _0x5201ff={'count':0x0,'rows':[]},_0x1360ad={},_0x598fb8,_0x580bc9,_0x32480a,_0x2ef00d,_0x50e39b;Promise[_0xacc5('0x77')]()['then'](function(){if(_0x2670b2[_0xacc5('0x7d')][_0xacc5('0x90')]){if(!_['includes'](_0x3bd66a,_0x2670b2['query'][_0xacc5('0x90')][_0xacc5('0x91')]()))throw new Error(_0xacc5('0x92'));_0x598fb8=_0x2670b2[_0xacc5('0x7d')]['channel']['toLowerCase']();}var _0x382c37=_[_0xacc5('0x1a')](_0x598fb8)+'Queue';var _0x2e1eba=_[_0xacc5('0x78')](db[_0x382c37][_0xacc5('0x79')],function(_0x2a8286){return{'name':_0x2a8286[_0xacc5('0x7a')],'type':_0x2a8286[_0xacc5('0x7b')][_0xacc5('0x7c')]};});_0x1360ad=qs['getOptions'](_0x2e1eba,_0x2670b2);if(_0x2670b2[_0xacc5('0x81')][_0xacc5('0x7e')]===_0xacc5('0x81')){var _0x500ff5={'params':{'id':_0x2670b2[_0xacc5('0x81')][_0xacc5('0x82')]},'query':{'section':_0x598fb8==='voice'&&_0x2670b2[_0xacc5('0x7d')][_0xacc5('0x7b')]===_0xacc5('0x24')?_0xacc5('0x93'):_[_0xacc5('0x1a')](_0x598fb8)+_0xacc5('0x1b'),'type':_0x2670b2['query'][_0xacc5('0x7b')],'nolimit':!![],'sort':'name','filter':_0x2670b2['query'][_0xacc5('0x3f')]}};return db['UserProfile'][_0xacc5('0x94')](_0x500ff5);}return db[_0x382c37][_0xacc5('0x95')](_0x1360ad);})[_0xacc5('0x12')](function(_0x504114){_0x5201ff[_0xacc5('0xa')]=_0x504114['count'];_0x580bc9=_0x504114['rows'];return getRealtimeQueues(_0x2670b2,_0x598fb8);})['then'](function(_0xc2bb78){_0x2ef00d=_0xc2bb78[_0xacc5('0x85')];return getRealtimeAgents();})['then'](function(_0x3bdaa3){_0x32480a=_0x3bdaa3[_0xacc5('0x85')];if(_0x598fb8!=_0xacc5('0x19'))return;return getRealtimeVoiceQueueChannels();})[_0xacc5('0x12')](function(_0x2323e5){_0x50e39b=_0x2323e5?_0x2323e5['rows']:[];return initializeQueues(_0x580bc9,_0x2ef00d,_0x598fb8,_0x2670b2[_0xacc5('0x7d')][_0xacc5('0x7b')]);})['then'](function(_0x59787b){var _0x346e58=_0x59787b['map'](function(_0x387a5d){if(_0x598fb8===_0xacc5('0x19'))return getVoiceQueueAgents(_0x387a5d,_0x580bc9,_0x32480a,_0x50e39b);else return getQueueAgents(_0x387a5d,_0x32480a,_0x598fb8);});return Promise['all'](_0x346e58);})['then'](function(_0xe564a2){_0x5201ff[_0xacc5('0x85')]=_0xe564a2;return _0x5201ff;})[_0xacc5('0x12')](respondWithFilteredResult(_0x21ae1d,_0x1360ad))[_0xacc5('0x18')](handleError(_0x21ae1d,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 2dbbc94..e398350 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x5197c0,_0x11a3c7){var _0x438a97=function(_0x2f11d5){while(--_0x2f11d5){_0x5197c0['push'](_0x5197c0['shift']());}};_0x438a97(++_0x11a3c7);}(_0xe706,0xa3));var _0x6e70=function(_0xbab353,_0x37e159){_0xbab353=_0xbab353-0x0;var _0x56871e=_0xe706[_0xbab353];return _0x56871e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x5eb9a1,_0xe00f0f){var _0x45d6c7=function(_0x5c6b8d){while(--_0x5c6b8d){_0x5eb9a1['push'](_0x5eb9a1['shift']());}};_0x45d6c7(++_0xe00f0f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 34b57bf..4926959 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 _0xf569=['exports','INTEGER','STRING','DATE'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xf569,0xd0));var _0x9f56=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xf569[_0x5ddaac];return _0x2a9c58;};'use strict';var Sequelize=require('sequelize');module[_0x9f56('0x0')]={'state':{'type':Sequelize[_0x9f56('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x9f56('0x2')]},'scheduledat':{'type':Sequelize[_0x9f56('0x3')]},'uniqueid':{'type':Sequelize[_0x9f56('0x2')]},'starttime':{'type':Sequelize[_0x9f56('0x3')]},'responsetime':{'type':Sequelize[_0x9f56('0x3')]},'ringtime':{'type':Sequelize[_0x9f56('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x9f56('0x2')]},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7958=['exports','STRING','DATE','INTEGER','sequelize'];(function(_0x600385,_0x1ac77c){var _0x3819fe=function(_0xfec55f){while(--_0xfec55f){_0x600385['push'](_0x600385['shift']());}};_0x3819fe(++_0x1ac77c);}(_0x7958,0x126));var _0x8795=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7958[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x8795('0x0'));module[_0x8795('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8795('0x2')]},'scheduledat':{'type':Sequelize[_0x8795('0x3')]},'uniqueid':{'type':Sequelize[_0x8795('0x2')]},'starttime':{'type':Sequelize[_0x8795('0x3')]},'responsetime':{'type':Sequelize[_0x8795('0x3')]},'ringtime':{'type':Sequelize[_0x8795('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x8795('0x2')]},'campaigntype':{'type':Sequelize[_0x8795('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 67a8fac..4ccc24b 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 _0xb6c6=['rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xb6c6,0x199));var _0x6b6c=function(_0x411bc9,_0xb208c1){_0x411bc9=_0x411bc9-0x0;var _0xde55dd=_0xb6c6[_0x411bc9];return _0xde55dd;};'use strict';var _=require(_0x6b6c('0x0'));var util=require(_0x6b6c('0x1'));var logger=require(_0x6b6c('0x2'))(_0x6b6c('0x3'));var moment=require(_0x6b6c('0x4'));var BPromise=require(_0x6b6c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b6c('0x6'));var rimraf=require(_0x6b6c('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b6c('0x8'));module[_0x6b6c('0x9')]=function(_0x45941b,_0x1790af){return _0x45941b[_0x6b6c('0xa')](_0x6b6c('0xb'),attributes,{'tableName':_0x6b6c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaed5=['moment','request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','lodash','util'];(function(_0x19149d,_0xe6a18a){var _0x2c84a4=function(_0x4f81d7){while(--_0x4f81d7){_0x19149d['push'](_0x19149d['shift']());}};_0x2c84a4(++_0xe6a18a);}(_0xaed5,0x77));var _0x5aed=function(_0x46e6b5,_0x448d8b){_0x46e6b5=_0x46e6b5-0x0;var _0x52461d=_0xaed5[_0x46e6b5];return _0x52461d;};'use strict';var _=require(_0x5aed('0x0'));var util=require(_0x5aed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5aed('0x2'));var BPromise=require('bluebird');var rp=require(_0x5aed('0x3'));var fs=require('fs');var path=require(_0x5aed('0x4'));var rimraf=require(_0x5aed('0x5'));var config=require(_0x5aed('0x6'));var attributes=require(_0x5aed('0x7'));module['exports']=function(_0x281b3c,_0x23423f){return _0x281b3c[_0x5aed('0x8')](_0x5aed('0x9'),attributes,{'tableName':_0x5aed('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 23b970f..4fec59d 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 _0x849b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','debug','catch','lodash','util','moment'];(function(_0x1734d5,_0xb600ad){var _0x305dcc=function(_0x1e4573){while(--_0x1e4573){_0x1734d5['push'](_0x1734d5['shift']());}};_0x305dcc(++_0xb600ad);}(_0x849b,0xbd));var _0xb849=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x849b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb849('0x0'));var util=require(_0xb849('0x1'));var moment=require(_0xb849('0x2'));var BPromise=require(_0xb849('0x3'));var rs=require(_0xb849('0x4'));var fs=require('fs');var Redis=require(_0xb849('0x5'));var db=require(_0xb849('0x6'))['db'];var utils=require(_0xb849('0x7'));var logger=require(_0xb849('0x8'))(_0xb849('0x9'));var config=require(_0xb849('0xa'));var jayson=require(_0xb849('0xb'));var client=jayson[_0xb849('0xc')][_0xb849('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x23c021,_0x34095b,_0xf8886f){return new BPromise(function(_0x4c638b,_0x4322ff){return client[_0xb849('0xe')](_0x23c021,_0xf8886f)[_0xb849('0xf')](function(_0x34e0a1){logger['info'](_0xb849('0x10'),_0x34095b,_0xb849('0x11'));logger['debug']('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x34095b,_0xb849('0x11'),JSON[_0xb849('0x12')](_0x34e0a1));if(_0x34e0a1[_0xb849('0x13')]){if(_0x34e0a1[_0xb849('0x13')][_0xb849('0x14')]===0x1f4){logger[_0xb849('0x13')](_0xb849('0x10'),_0x34095b,_0x34e0a1[_0xb849('0x13')]['message']);return _0x4322ff(_0x34e0a1[_0xb849('0x13')][_0xb849('0x15')]);}logger['error'](_0xb849('0x10'),_0x34095b,_0x34e0a1[_0xb849('0x13')][_0xb849('0x15')]);return _0x4c638b(_0x34e0a1[_0xb849('0x13')]['message']);}else{logger[_0xb849('0x16')](_0xb849('0x10'),_0x34095b,'request\x20sent');_0x4c638b(_0x34e0a1[_0xb849('0x17')][_0xb849('0x15')]);}})['catch'](function(_0x5afa23){logger[_0xb849('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x34095b,_0x5afa23);_0x4322ff(_0x5afa23);});});}exports[_0xb849('0x18')]=function(_0xaecfff){var _0x4a3a68=this;return new Promise(function(_0x51a786,_0x319139){return db[_0xb849('0x19')][_0xb849('0x1a')](_0xaecfff[_0xb849('0x1b')],{'raw':_0xaecfff['options']?_0xaecfff[_0xb849('0x1c')][_0xb849('0x1d')]===undefined?!![]:![]:!![]})[_0xb849('0xf')](function(_0x21a930){logger[_0xb849('0x16')](_0xb849('0x18'),_0xaecfff);logger[_0xb849('0x1e')](_0xb849('0x18'),_0xaecfff,JSON[_0xb849('0x12')](_0x21a930));_0x51a786(_0x21a930);})[_0xb849('0x1f')](function(_0x40d65f){logger[_0xb849('0x13')](_0xb849('0x18'),_0x40d65f['message'],_0xaecfff);_0x319139(_0x4a3a68[_0xb849('0x13')](0x1f4,_0x40d65f[_0xb849('0x15')]));});});}; \ No newline at end of file +var _0xd25f=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ReportAgentPreview','create','body','options','raw','debug','CreateReportAgentPreview','lodash','util','moment','ioredis'];(function(_0x41a1d8,_0x430df2){var _0xa19f6e=function(_0x44c587){while(--_0x44c587){_0x41a1d8['push'](_0x41a1d8['shift']());}};_0xa19f6e(++_0x430df2);}(_0xd25f,0xdc));var _0xfd25=function(_0x1ec65c,_0x354923){_0x1ec65c=_0x1ec65c-0x0;var _0x5249c2=_0xd25f[_0x1ec65c];return _0x5249c2;};'use strict';var _=require(_0xfd25('0x0'));var util=require(_0xfd25('0x1'));var moment=require(_0xfd25('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd25('0x3'));var db=require(_0xfd25('0x4'))['db'];var utils=require(_0xfd25('0x5'));var logger=require('../../config/logger')(_0xfd25('0x6'));var config=require('../../config/environment');var jayson=require(_0xfd25('0x7'));var client=jayson[_0xfd25('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x148f8b,_0x3d178a,_0x3cac5d){return new BPromise(function(_0x131dea,_0x3cbf18){return client[_0xfd25('0x9')](_0x148f8b,_0x3cac5d)[_0xfd25('0xa')](function(_0x2b7752){logger[_0xfd25('0xb')](_0xfd25('0xc'),_0x3d178a,_0xfd25('0xd'));logger['debug'](_0xfd25('0xe'),_0x3d178a,_0xfd25('0xd'),JSON[_0xfd25('0xf')](_0x2b7752));if(_0x2b7752['error']){if(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x11')]===0x1f4){logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);return _0x3cbf18(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);}logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);return _0x131dea(_0x2b7752[_0xfd25('0x10')][_0xfd25('0x12')]);}else{logger[_0xfd25('0xb')](_0xfd25('0xc'),_0x3d178a,'request\x20sent');_0x131dea(_0x2b7752[_0xfd25('0x13')][_0xfd25('0x12')]);}})[_0xfd25('0x14')](function(_0x38f3f4){logger[_0xfd25('0x10')](_0xfd25('0xc'),_0x3d178a,_0x38f3f4);_0x3cbf18(_0x38f3f4);});});}exports['CreateReportAgentPreview']=function(_0x562ce3){var _0x43c792=this;return new Promise(function(_0x53235e,_0x22e240){return db[_0xfd25('0x15')][_0xfd25('0x16')](_0x562ce3[_0xfd25('0x17')],{'raw':_0x562ce3['options']?_0x562ce3[_0xfd25('0x18')][_0xfd25('0x19')]===undefined?!![]:![]:!![]})[_0xfd25('0xa')](function(_0x375242){logger[_0xfd25('0xb')]('CreateReportAgentPreview',_0x562ce3);logger[_0xfd25('0x1a')]('CreateReportAgentPreview',_0x562ce3,JSON[_0xfd25('0xf')](_0x375242));_0x53235e(_0x375242);})[_0xfd25('0x14')](function(_0x5388b8){logger[_0xfd25('0x10')](_0xfd25('0x1b'),_0x5388b8[_0xfd25('0x12')],_0x562ce3);_0x22e240(_0x43c792[_0xfd25('0x10')](0x1f4,_0x5388b8[_0xfd25('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 72bfe51..da4199f 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 _0x975f=['/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','/agents/:id/notify','agentNotify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','/fax/queues','faxQueues','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','showVoiceQueues','put','/voice/queues/:id','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','agentCapacity','/telephones','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel'];(function(_0x46d27a,_0x30d83b){var _0x25f5d6=function(_0x2157a1){while(--_0x2157a1){_0x46d27a['push'](_0x46d27a['shift']());}};_0x25f5d6(++_0x30d83b);}(_0x975f,0x10c));var _0xf975=function(_0x339129,_0x86dcc6){_0x339129=_0x339129-0x0;var _0x1570df=_0x975f[_0x339129];return _0x1570df;};'use strict';var multer=require('multer');var util=require(_0xf975('0x0'));var path=require(_0xf975('0x1'));var express=require(_0xf975('0x2'));var router=express[_0xf975('0x3')]();var auth=require(_0xf975('0x4'));var controller=require(_0xf975('0x5'));router[_0xf975('0x6')](_0xf975('0x7'),auth[_0xf975('0x8')](),controller[_0xf975('0x9')]);router[_0xf975('0x6')](_0xf975('0xa'),auth[_0xf975('0x8')](),controller['voiceChannelMixMonitor']);router[_0xf975('0x6')](_0xf975('0xb'),auth[_0xf975('0x8')](),controller[_0xf975('0xc')]);router[_0xf975('0x6')](_0xf975('0xd'),auth[_0xf975('0x8')](),controller[_0xf975('0xe')]);router[_0xf975('0x6')](_0xf975('0xf'),auth['isAuthenticated'](),controller['chatQueues']);router['get']('/mail/queues',auth[_0xf975('0x8')](),controller[_0xf975('0x10')]);router[_0xf975('0x6')](_0xf975('0x11'),auth['isAuthenticated'](),controller['mailAccounts']);router['get'](_0xf975('0x12'),auth['isAuthenticated'](),controller[_0xf975('0x13')]);router['get'](_0xf975('0x14'),auth[_0xf975('0x8')](),controller[_0xf975('0x15')]);router['get'](_0xf975('0x16'),auth[_0xf975('0x8')](),controller[_0xf975('0x17')]);router[_0xf975('0x6')](_0xf975('0x18'),auth[_0xf975('0x8')](),controller[_0xf975('0x19')]);router[_0xf975('0x6')]('/voice/queues/preview/:id',auth[_0xf975('0x8')](),controller[_0xf975('0x1a')]);router['get']('/voice/queues/channels',auth[_0xf975('0x8')](),controller[_0xf975('0x1b')]);router[_0xf975('0x6')](_0xf975('0x1c'),auth[_0xf975('0x8')](),controller[_0xf975('0x1d')]);router[_0xf975('0x6')](_0xf975('0x1e'),auth[_0xf975('0x8')](),controller[_0xf975('0x1f')]);router['get'](_0xf975('0x20'),auth[_0xf975('0x8')](),controller['voiceQueuesChannelRedirect']);router[_0xf975('0x6')]('/voice/queues/:id',auth[_0xf975('0x8')](),controller[_0xf975('0x21')]);router[_0xf975('0x22')](_0xf975('0x23'),auth[_0xf975('0x8')](),controller[_0xf975('0x24')]);router[_0xf975('0x6')](_0xf975('0x25'),auth['isAuthenticated'](),controller[_0xf975('0x26')]);router[_0xf975('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller[_0xf975('0x27')]);router[_0xf975('0x6')](_0xf975('0x28'),auth[_0xf975('0x8')](),controller[_0xf975('0x29')]);router[_0xf975('0x22')]('/agents/:id/capacity',auth[_0xf975('0x8')](),controller[_0xf975('0x2a')]);router[_0xf975('0x6')](_0xf975('0x2b'),auth[_0xf975('0x8')](),controller[_0xf975('0x2c')]);router[_0xf975('0x6')]('/trunks',auth[_0xf975('0x8')](),controller[_0xf975('0x2d')]);router[_0xf975('0x6')]('/campaigns',auth[_0xf975('0x8')](),controller[_0xf975('0x2e')]);router['get'](_0xf975('0x2f'),auth[_0xf975('0x8')](),controller[_0xf975('0x30')]);router[_0xf975('0x6')](_0xf975('0x31'),auth[_0xf975('0x8')](),controller[_0xf975('0x32')]);router[_0xf975('0x6')](_0xf975('0x33'),auth[_0xf975('0x8')](),controller[_0xf975('0x34')]);router[_0xf975('0x6')](_0xf975('0x35'),auth[_0xf975('0x8')](),controller[_0xf975('0x36')]);router[_0xf975('0x6')](_0xf975('0x37'),auth['isAuthenticated'](),controller[_0xf975('0x38')]);router['get']('/sms/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0xf975('0x39')]);router['get'](_0xf975('0x3a'),auth['isAuthenticated'](),controller[_0xf975('0x3b')]);router['get']('/fax/queues/waitinginteractions',auth[_0xf975('0x8')](),controller[_0xf975('0x3c')]);router[_0xf975('0x3d')](_0xf975('0x3e'),auth[_0xf975('0x8')](),controller['queueNotify'](_0xf975('0x3f')));router[_0xf975('0x6')](_0xf975('0x40'),auth['isAuthenticated'](),controller[_0xf975('0x41')]);router[_0xf975('0x3d')](_0xf975('0x42'),auth[_0xf975('0x8')](),controller[_0xf975('0x43')](_0xf975('0x44')));router[_0xf975('0x6')]('/chat/queues/:id',auth[_0xf975('0x8')](),controller[_0xf975('0x45')]);router[_0xf975('0x3d')](_0xf975('0x46'),auth[_0xf975('0x8')](),controller[_0xf975('0x43')](_0xf975('0x47')));router[_0xf975('0x6')](_0xf975('0x48'),auth[_0xf975('0x8')](),controller[_0xf975('0x49')]);router[_0xf975('0x3d')](_0xf975('0x4a'),auth[_0xf975('0x8')](),controller[_0xf975('0x43')](_0xf975('0x4b')));router['get'](_0xf975('0x4c'),auth[_0xf975('0x8')](),controller[_0xf975('0x4d')]);router['post'](_0xf975('0x4e'),auth[_0xf975('0x8')](),controller[_0xf975('0x43')](_0xf975('0x4f')));router[_0xf975('0x3d')]('/whatsapp/queues/:id/notify',auth[_0xf975('0x8')](),controller[_0xf975('0x43')]('whatsapp'));router[_0xf975('0x6')](_0xf975('0x50'),auth[_0xf975('0x8')](),controller[_0xf975('0x51')]);router[_0xf975('0x6')](_0xf975('0x52'),auth['isAuthenticated'](),controller['showWhatsappQueues']);router[_0xf975('0x3d')](_0xf975('0x53'),auth[_0xf975('0x8')](),controller[_0xf975('0x54')]);module[_0xf975('0x55')]=router; \ No newline at end of file +var _0x83d0=['openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','mail','showMailQueues','/chat/queues/:id/notify','queueNotify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','whatsapp','showSmsQueues','/whatsapp/queues/:id','agentNotify','util','Router','../../components/auth/service','./rpc.controller','get','isAuthenticated','voiceChannels','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','whatsappQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','updateVoiceQueue','/outbound','outbound','outboundChannels','/agents','agents','put','/agents/:id/capacity','agentCapacity','/telephones','/trunks','trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x83d0,0x1ef));var _0x083d=function(_0x605591,_0x55d689){_0x605591=_0x605591-0x0;var _0x503f26=_0x83d0[_0x605591];return _0x503f26;};'use strict';var multer=require('multer');var util=require(_0x083d('0x0'));var path=require('path');var express=require('express');var router=express[_0x083d('0x1')]();var auth=require(_0x083d('0x2'));var controller=require(_0x083d('0x3'));router[_0x083d('0x4')]('/voice/channels',auth[_0x083d('0x5')](),controller[_0x083d('0x6')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth['isAuthenticated'](),controller[_0x083d('0x7')]);router[_0x083d('0x4')](_0x083d('0x8'),auth[_0x083d('0x5')](),controller[_0x083d('0x9')]);router[_0x083d('0x4')](_0x083d('0xa'),auth[_0x083d('0x5')](),controller[_0x083d('0xb')]);router[_0x083d('0x4')]('/chat/queues',auth[_0x083d('0x5')](),controller['chatQueues']);router[_0x083d('0x4')](_0x083d('0xc'),auth[_0x083d('0x5')](),controller[_0x083d('0xd')]);router['get'](_0x083d('0xe'),auth[_0x083d('0x5')](),controller[_0x083d('0xf')]);router[_0x083d('0x4')](_0x083d('0x10'),auth[_0x083d('0x5')](),controller[_0x083d('0x11')]);router[_0x083d('0x4')](_0x083d('0x12'),auth[_0x083d('0x5')](),controller[_0x083d('0x13')]);router[_0x083d('0x4')]('/whatsapp/queues',auth[_0x083d('0x5')](),controller[_0x083d('0x14')]);router[_0x083d('0x4')](_0x083d('0x15'),auth['isAuthenticated'](),controller[_0x083d('0x16')]);router[_0x083d('0x4')](_0x083d('0x17'),auth[_0x083d('0x5')](),controller[_0x083d('0x18')]);router[_0x083d('0x4')]('/voice/queues/channels',auth[_0x083d('0x5')](),controller[_0x083d('0x19')]);router[_0x083d('0x4')]('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x083d('0x1a')]);router[_0x083d('0x4')](_0x083d('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelHangup']);router[_0x083d('0x4')](_0x083d('0x1c'),auth[_0x083d('0x5')](),controller['voiceQueuesChannelRedirect']);router['get'](_0x083d('0x1d'),auth[_0x083d('0x5')](),controller[_0x083d('0x1e')]);router['put']('/voice/queues/:id',auth[_0x083d('0x5')](),controller[_0x083d('0x1f')]);router[_0x083d('0x4')](_0x083d('0x20'),auth[_0x083d('0x5')](),controller[_0x083d('0x21')]);router[_0x083d('0x4')]('/outbound/channels',auth[_0x083d('0x5')](),controller[_0x083d('0x22')]);router[_0x083d('0x4')](_0x083d('0x23'),auth[_0x083d('0x5')](),controller[_0x083d('0x24')]);router[_0x083d('0x25')](_0x083d('0x26'),auth[_0x083d('0x5')](),controller[_0x083d('0x27')]);router['get'](_0x083d('0x28'),auth['isAuthenticated'](),controller['telephones']);router[_0x083d('0x4')](_0x083d('0x29'),auth[_0x083d('0x5')](),controller[_0x083d('0x2a')]);router[_0x083d('0x4')](_0x083d('0x2b'),auth[_0x083d('0x5')](),controller[_0x083d('0x2c')]);router[_0x083d('0x4')](_0x083d('0x2d'),auth[_0x083d('0x5')](),controller[_0x083d('0x2e')]);router[_0x083d('0x4')](_0x083d('0x2f'),auth[_0x083d('0x5')](),controller['chatQueuesWaitingInteractions']);router[_0x083d('0x4')](_0x083d('0x30'),auth['isAuthenticated'](),controller[_0x083d('0x31')]);router[_0x083d('0x4')](_0x083d('0x32'),auth['isAuthenticated'](),controller[_0x083d('0x33')]);router[_0x083d('0x4')](_0x083d('0x34'),auth['isAuthenticated'](),controller[_0x083d('0x35')]);router[_0x083d('0x4')]('/sms/queues/waitinginteractions',auth[_0x083d('0x5')](),controller[_0x083d('0x36')]);router[_0x083d('0x4')](_0x083d('0x37'),auth['isAuthenticated'](),controller[_0x083d('0x38')]);router[_0x083d('0x4')](_0x083d('0x39'),auth['isAuthenticated'](),controller[_0x083d('0x3a')]);router[_0x083d('0x3b')]('/mail/queues/:id/notify',auth[_0x083d('0x5')](),controller['queueNotify'](_0x083d('0x3c')));router['get']('/mail/queues/:id',auth['isAuthenticated'](),controller[_0x083d('0x3d')]);router[_0x083d('0x3b')](_0x083d('0x3e'),auth[_0x083d('0x5')](),controller[_0x083d('0x3f')](_0x083d('0x40')));router[_0x083d('0x4')]('/chat/queues/:id',auth[_0x083d('0x5')](),controller[_0x083d('0x41')]);router[_0x083d('0x3b')](_0x083d('0x42'),auth[_0x083d('0x5')](),controller[_0x083d('0x3f')](_0x083d('0x43')));router[_0x083d('0x4')](_0x083d('0x44'),auth['isAuthenticated'](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x083d('0x5')](),controller[_0x083d('0x3f')](_0x083d('0x45')));router[_0x083d('0x4')](_0x083d('0x46'),auth[_0x083d('0x5')](),controller[_0x083d('0x47')]);router[_0x083d('0x3b')]('/sms/queues/:id/notify',auth[_0x083d('0x5')](),controller[_0x083d('0x3f')](_0x083d('0x48')));router[_0x083d('0x3b')](_0x083d('0x49'),auth[_0x083d('0x5')](),controller[_0x083d('0x3f')](_0x083d('0x4a')));router[_0x083d('0x4')]('/sms/queues/:id',auth['isAuthenticated'](),controller[_0x083d('0x4b')]);router[_0x083d('0x4')](_0x083d('0x4c'),auth[_0x083d('0x5')](),controller['showWhatsappQueues']);router[_0x083d('0x3b')]('/agents/:id/notify',auth[_0x083d('0x5')](),controller[_0x083d('0x4d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 716a6c6..bf5af85 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 _0x24ca=['telephones','Telephones','trunks','chatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','queue','MessageId','InteractionId','From','QueueId','Start','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','Agent\x20not\x20found','messageId','\x20Message\x20not\x20found','TransferReport','create','agentTransferTimeout','bluebird','lodash','util','../../mysqldb','api','jayson/promise','client','http','request','error','code','message','result','json','sendStatus','stack','status','send','isNil','rows','voiceChannels','VoiceChannels','query','then','VoiceChannelMixMonitor','merge','params','catch','VoiceQueues','showVoiceQueues','updateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','interaction','user','name','hasOwnProperty','MemberReport','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','findOrCreate','interface','SIP/%s','agent','internal','AgentCapacity','capacity'];(function(_0x4a55c6,_0x50086d){var _0x38250b=function(_0x1d0f7a){while(--_0x1d0f7a){_0x4a55c6['push'](_0x4a55c6['shift']());}};_0x38250b(++_0x50086d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x24ca[_0x46ae5a];return _0x434986;};'use strict';var BPromise=require(_0xa24c('0x0'));var moment=require('moment');var _=require(_0xa24c('0x1'));var util=require(_0xa24c('0x2'));var db=require(_0xa24c('0x3'))['db'];var logger=require('../../config/logger')(_0xa24c('0x4'));var jayson=require(_0xa24c('0x5'));var amiClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232a});var mailClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232b});var routingClient=jayson[_0xa24c('0x6')][_0xa24c('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x2dd348,_0x257264,_0x9a5013){return new BPromise(function(_0x481196,_0x42d89c){var _0x3a5727=_0x9a5013?_0x9a5013:amiClient;return _0x3a5727[_0xa24c('0x8')](_0x2dd348,_0x257264)['then'](function(_0x399f32){if(_0x399f32[_0xa24c('0x9')]){if(_0x399f32[_0xa24c('0x9')][_0xa24c('0xa')]===0x1f4){return _0x42d89c(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}return _0x481196(_0x399f32[_0xa24c('0x9')][_0xa24c('0xb')]);}else{_0x481196(_0x399f32[_0xa24c('0xc')]);}})['catch'](function(_0x43bcd3){_0x42d89c(_0x43bcd3);});});}function respondWithResult(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xc8;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['status'](_0xcee4fe)[_0xa24c('0xd')](_0x2c2af8);}return _0x11090c[_0xa24c('0xe')](0x194);};}function handleError(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0x1f4;return function(_0x1cb08e){logger[_0xa24c('0x9')](_0x1cb08e[_0xa24c('0xf')]);if(_0x1cb08e['name']){delete _0x1cb08e['name'];}_0x26ff28[_0xa24c('0x10')](_0x2fcd8b)[_0xa24c('0x11')](_0x1cb08e);};}function findById(_0x49ce53){return function(_0x5babb5){if(!_[_0xa24c('0x12')](_0x49ce53)&&!_[_0xa24c('0x12')](_0x5babb5)&&!_['isNil'](_0x5babb5[_0xa24c('0x13')])){return _['find'](_0x5babb5[_0xa24c('0x13')],function(_0x2a610a){return _0x2a610a['id']==_0x49ce53;});}return null;};}exports[_0xa24c('0x14')]=function(_0xefdbd9,_0x4ff97c){return respondWithRpcPromise(_0xa24c('0x15'),_0xefdbd9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x4ff97c,null))['catch'](handleError(_0x4ff97c,null));};exports['voiceChannelMixMonitor']=function(_0x506424,_0x4cd77e){return respondWithRpcPromise(_0xa24c('0x18'),_[_0xa24c('0x19')](_0x506424[_0xa24c('0x16')],_0x506424[_0xa24c('0x1a')]))['then'](respondWithResult(_0x4cd77e,null))[_0xa24c('0x1b')](handleError(_0x4cd77e,null));};exports['voiceChannelStopMixMonitor']=function(_0x224bca,_0xb81d97){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0xa24c('0x19')](_0x224bca[_0xa24c('0x16')],_0x224bca[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0xb81d97,null))[_0xa24c('0x1b')](handleError(_0xb81d97,null));};exports['voiceQueues']=function(_0xec9167,_0x5cc9cb){return respondWithRpcPromise(_0xa24c('0x1c'),_0xec9167[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x5cc9cb,null))['catch'](handleError(_0x5cc9cb,null));};exports[_0xa24c('0x1d')]=function(_0x31c4d9,_0x14fd5a){return respondWithRpcPromise(_0xa24c('0x1c'),_0x31c4d9[_0xa24c('0x16')])[_0xa24c('0x17')](findById(_0x31c4d9[_0xa24c('0x1a')]['id']))['then'](respondWithResult(_0x14fd5a,null))[_0xa24c('0x1b')](handleError(_0x14fd5a,null));};exports[_0xa24c('0x1e')]=function(_0x152120,_0x12dbdc){return respondWithRpcPromise('UpdateVoiceQueue',_[_0xa24c('0x19')](_0x152120[_0xa24c('0x1f')],_0x152120[_0xa24c('0x1a')]))['then'](respondWithResult(_0x12dbdc,null))[_0xa24c('0x1b')](handleError(_0x12dbdc,null));};exports[_0xa24c('0x20')]=function(_0x253d83,_0x4ae35c){return respondWithRpcPromise(_0xa24c('0x21'),_['merge'](_0x253d83[_0xa24c('0x16')],_0x253d83[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x4ae35c,null))['catch'](handleError(_0x4ae35c,null));};exports[_0xa24c('0x22')]=function(_0x53f90,_0x1d0379){return respondWithRpcPromise('VoiceQueuesChannels',_0x53f90[_0xa24c('0x16')])['then'](respondWithResult(_0x1d0379,null))[_0xa24c('0x1b')](handleError(_0x1d0379,null));};exports[_0xa24c('0x23')]=function(_0x592198,_0x5680f5){return respondWithRpcPromise(_0xa24c('0x24'),_[_0xa24c('0x19')](_0x592198[_0xa24c('0x16')],_0x592198[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x5680f5,null))[_0xa24c('0x1b')](handleError(_0x5680f5,null));};exports[_0xa24c('0x25')]=function(_0x4b4dc2,_0x39f146){return respondWithRpcPromise(_0xa24c('0x26'),_[_0xa24c('0x19')](_0x4b4dc2[_0xa24c('0x16')],_0x4b4dc2[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x39f146,null))[_0xa24c('0x1b')](handleError(_0x39f146,null));};exports[_0xa24c('0x27')]=function(_0x1ea166,_0x129bb9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xa24c('0x19')](_0x1ea166[_0xa24c('0x16')],_0x1ea166[_0xa24c('0x1a')]))[_0xa24c('0x17')](respondWithResult(_0x129bb9,null))['catch'](handleError(_0x129bb9,null));};exports['outbound']=function(_0x19a65f,_0x56ef4d){return respondWithRpcPromise(_0xa24c('0x28'),_0x19a65f[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x56ef4d,null))[_0xa24c('0x1b')](handleError(_0x56ef4d,null));};exports[_0xa24c('0x29')]=function(_0x4c0fb9,_0x532875){return respondWithRpcPromise(_0xa24c('0x2a'),_0x4c0fb9[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x532875,null))[_0xa24c('0x1b')](handleError(_0x532875,null));};exports[_0xa24c('0x2b')]=function(_0x472912,_0x5080d0){var _0x56f392;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912[_0xa24c('0x16')])[_0xa24c('0x17')](function(_0x2101f8){_0x56f392=_0x2101f8;return respondWithRpcPromise(_0xa24c('0x2c'),_0x472912['query'],routingClient);})[_0xa24c('0x17')](function(_0x7895e){return _['merge']({},_0x7895e,_0x56f392);})['then'](respondWithResult(_0x5080d0,null))[_0xa24c('0x1b')](handleError(_0x5080d0,null));};exports[_0xa24c('0x2d')]=function(_0x231eea,_0x537849){if(_0x231eea['body']&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]&&_0x231eea[_0xa24c('0x2f')]&&_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')]){for(var _0x1b7faf in _0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')]){if(_0x231eea['body']['interaction'][_0xa24c('0x31')](_0x1b7faf)){db[_0xa24c('0x32')][_0xa24c('0x33')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea['user'][_0xa24c('0x30')],'type':_0xa24c('0x34'),'exitAt':null,'uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]&&_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')]?{'$notIn':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf]}:{'$ne':null}}})[_0xa24c('0x17')](function(_0x4bbf93){var _0xb8c7a5=moment()[_0xa24c('0x36')](_0xa24c('0x37'));for(var _0x5aa2b2=0x0,_0x3a85cb=_0x4bbf93[_0xa24c('0x35')];_0x5aa2b2<_0x3a85cb;_0x5aa2b2+=0x1){_0x4bbf93[_0x5aa2b2][_0xa24c('0x38')]({'exitAt':_0xb8c7a5});}});for(var _0x31f05b=0x0;_0x31f05b<_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0xa24c('0x35')];_0x31f05b+=0x1){db[_0xa24c('0x32')][_0xa24c('0x39')]({'where':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'type':'INTERACTION','uniqueid':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x2e')][_0x1b7faf][_0x31f05b],'exitAt':null},'defaults':{'channel':_0x1b7faf,'membername':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x30')],'interface':_[_0xa24c('0x12')](_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3a')])?util[_0xa24c('0x36')](_0xa24c('0x3b'),_0x231eea['user']['name']):_0x231eea[_0xa24c('0x2f')]['interface'],'type':_0xa24c('0x34'),'enterAt':moment()[_0xa24c('0x36')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xa24c('0x3c'),'internal':_0x231eea[_0xa24c('0x2f')][_0xa24c('0x3d')],'uniqueid':_0x231eea['body']['interaction'][_0x1b7faf][_0x31f05b]}});}}}}return respondWithRpcPromise(_0xa24c('0x3e'),{'id':_0x231eea['params']['id'],'capacity':_0x231eea[_0xa24c('0x1f')][_0xa24c('0x3f')]},routingClient)[_0xa24c('0x17')](respondWithResult(_0x537849,null))[_0xa24c('0x1b')](handleError(_0x537849,null));};exports[_0xa24c('0x40')]=function(_0x1fa739,_0x3f3ce6){return respondWithRpcPromise(_0xa24c('0x41'),_0x1fa739[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x3f3ce6,null))['catch'](handleError(_0x3f3ce6,null));};exports[_0xa24c('0x42')]=function(_0x2759c1,_0x233f8e){return respondWithRpcPromise('Trunks',_0x2759c1['query'])['then'](respondWithResult(_0x233f8e,null))[_0xa24c('0x1b')](handleError(_0x233f8e,null));};exports['campaigns']=function(_0x4757ff,_0x21d0fc){return respondWithRpcPromise('Campaigns',_0x4757ff[_0xa24c('0x16')])[_0xa24c('0x17')](respondWithResult(_0x21d0fc,null))[_0xa24c('0x1b')](handleError(_0x21d0fc,null));};exports[_0xa24c('0x43')]=function(_0x162a11,_0x3a72e3){return respondWithRpcPromise(_0xa24c('0x44'),_0x162a11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x3a72e3,null))[_0xa24c('0x1b')](handleError(_0x3a72e3,null));};exports['showChatQueues']=function(_0x5abd45,_0x565f0a){return respondWithRpcPromise('ChatQueues',_0x5abd45['query'],routingClient)[_0xa24c('0x17')](findById(_0x5abd45['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x565f0a,null))[_0xa24c('0x1b')](handleError(_0x565f0a,null));};exports[_0xa24c('0x45')]=function(_0x1a5f17,_0xa371d2){return respondWithRpcPromise(_0xa24c('0x46'),_0x1a5f17[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0xa371d2,null))[_0xa24c('0x1b')](handleError(_0xa371d2,null));};exports[_0xa24c('0x47')]=function(_0x303b7d,_0x37dbbd){return respondWithRpcPromise(_0xa24c('0x46'),_0x303b7d[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0x303b7d['params']['id']))[_0xa24c('0x17')](respondWithResult(_0x37dbbd,null))[_0xa24c('0x1b')](handleError(_0x37dbbd,null));};exports['mailAccounts']=function(_0x1e08bb,_0x179ae1){return respondWithRpcPromise(_0xa24c('0x48'),_0x1e08bb[_0xa24c('0x16')],mailClient)['then'](respondWithResult(_0x179ae1,null))['catch'](handleError(_0x179ae1,null));};exports[_0xa24c('0x49')]=function(_0x5e9631,_0x486040){return respondWithRpcPromise(_0xa24c('0x4a'),_0x5e9631[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x486040,null))[_0xa24c('0x1b')](handleError(_0x486040,null));};exports['showOpenchannelQueues']=function(_0x48a7b2,_0x29b836){return respondWithRpcPromise('OpenchannelQueues',_0x48a7b2['query'],routingClient)[_0xa24c('0x17')](findById(_0x48a7b2[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x29b836,null))['catch'](handleError(_0x29b836,null));};exports[_0xa24c('0x4b')]=function(_0x128e5b,_0x5c3285){return respondWithRpcPromise(_0xa24c('0x4c'),_0x128e5b[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x5c3285,null))['catch'](handleError(_0x5c3285,null));};exports[_0xa24c('0x4d')]=function(_0x34e261,_0x21439a){return respondWithRpcPromise(_0xa24c('0x4c'),_0x34e261[_0xa24c('0x16')],routingClient)['then'](findById(_0x34e261[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x21439a,null))[_0xa24c('0x1b')](handleError(_0x21439a,null));};exports[_0xa24c('0x4e')]=function(_0xab5260,_0x2ca3fa){return respondWithRpcPromise(_0xa24c('0x4f'),_0xab5260['query'],routingClient)[_0xa24c('0x17')](respondWithResult(_0x2ca3fa,null))[_0xa24c('0x1b')](handleError(_0x2ca3fa,null));};exports['showWhatsappQueues']=function(_0xb1048a,_0x3e455b){return respondWithRpcPromise(_0xa24c('0x4f'),_0xb1048a[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xb1048a[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x3e455b,null))[_0xa24c('0x1b')](handleError(_0x3e455b,null));};exports[_0xa24c('0x50')]=function(_0x32ddc3,_0x50141e){return respondWithRpcPromise(_0xa24c('0x51'),_0x32ddc3[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x50141e,null))['catch'](handleError(_0x50141e,null));};exports[_0xa24c('0x52')]=function(_0xfd57fb,_0x2cc592){return respondWithRpcPromise('FaxQueues',_0xfd57fb[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](findById(_0xfd57fb[_0xa24c('0x1a')]['id']))[_0xa24c('0x17')](respondWithResult(_0x2cc592,null))[_0xa24c('0x1b')](handleError(_0x2cc592,null));};exports[_0xa24c('0x53')]=function(_0x4f9b56,_0x4c374d){return respondWithRpcPromise(_0xa24c('0x54'),_0x4f9b56['query'])[_0xa24c('0x17')](respondWithResult(_0x4c374d,null))[_0xa24c('0x1b')](handleError(_0x4c374d,null));};exports[_0xa24c('0x55')]=function(_0x4073c5,_0x12d715){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x4073c5[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x12d715,null))[_0xa24c('0x1b')](handleError(_0x12d715,null));};exports[_0xa24c('0x56')]=function(_0x987aca,_0x389c08){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x987aca[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x389c08,null))[_0xa24c('0x1b')](handleError(_0x389c08,null));};exports[_0xa24c('0x57')]=function(_0x5ebdd1,_0x403bf1){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x5ebdd1[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x403bf1,null))[_0xa24c('0x1b')](handleError(_0x403bf1,null));};exports[_0xa24c('0x58')]=function(_0x5726e1,_0x2e612d){return respondWithRpcPromise(_0xa24c('0x59'),_0x5726e1['query'],routingClient)[_0xa24c('0x17')](function(_0x168a8b){if(_0x5726e1[_0xa24c('0x16')][_0xa24c('0x5a')]!==undefined){var _0x8bd3fb=_(_0x168a8b[_0xa24c('0x13')])[_0xa24c('0x5b')]([_0x5726e1[_0xa24c('0x16')]['type'],_0x5726e1[_0xa24c('0x1a')]['id']])[_0xa24c('0x5c')](_0xa24c('0x5d'))[_0xa24c('0x5e')]()[_0xa24c('0x5f')]();return _0x168a8b[_0xa24c('0x13')][_0xa24c('0x5b')](function(_0x13dbef){return _0x8bd3fb[_0xa24c('0x60')](_0x13dbef[_0xa24c('0x5d')])>-0x1;});}else{return _0x168a8b[_0xa24c('0x13')]['filter'](function(_0x283c5b){return _0x283c5b[_0xa24c('0x5d')]===parseInt(_0x5726e1['params']['id']);});}})[_0xa24c('0x17')](respondWithResult(_0x2e612d,null))[_0xa24c('0x1b')](handleError(_0x2e612d,null));};exports[_0xa24c('0x61')]=function(_0x4f0f11,_0x5b4468){return respondWithRpcPromise(_0xa24c('0x62'),_0x4f0f11[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x5b4468,null))[_0xa24c('0x1b')](handleError(_0x5b4468,null));};exports[_0xa24c('0x63')]=function(_0x106178,_0x27a666){return respondWithRpcPromise(_0xa24c('0x64'),_0x106178[_0xa24c('0x16')],routingClient)['then'](respondWithResult(_0x27a666,null))['catch'](handleError(_0x27a666,null));};exports['faxQueuesWaitingInteractions']=function(_0x263dab,_0x521894){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x263dab[_0xa24c('0x16')],routingClient)[_0xa24c('0x17')](respondWithResult(_0x521894,null))[_0xa24c('0x1b')](handleError(_0x521894,null));};exports[_0xa24c('0x65')]=function(_0x84ddcc){return function(_0x45b2fe,_0x16f93a){var _0x170b65,_0x2544fc;var _0x4ee10d=_[_0xa24c('0x66')](_0x84ddcc);var _0xa077c8=_0x84ddcc===_0xa24c('0x67')?_0xa24c('0x68'):_0xa24c('0x69');return db[_0x4ee10d+_0xa24c('0x6a')][_0xa24c('0x6b')]({'raw':!![],'where':{'id':_0x45b2fe[_0xa24c('0x1a')]['id']}})[_0xa24c('0x17')](function(_0x3c5495){if(_[_0xa24c('0x12')](_0x3c5495)){throw new Error(_0x4ee10d+_0xa24c('0x6c'));}_0x170b65=_0x3c5495;return db[_0x4ee10d+'Message'][_0xa24c('0x6b')]({'where':{'id':_0x45b2fe[_0xa24c('0x1f')]['messageId']},'include':[{'model':db[_0x4ee10d+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x4ee10d+_0xa077c8],'as':_0xa24c('0x69')}]});})['then'](function(_0x549e07){if(_[_0xa24c('0x12')](_0x549e07)){throw new Error(_0x4ee10d+'\x20Message\x20not\x20found');}_0x2544fc=_0x549e07;return _0x549e07[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4c108f={'uniqueid':_0x84ddcc+'.'+_0x2544fc['id']+'.'+_0x2544fc['Interaction']['id'],'FromUserId':_0x45b2fe[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f')};_0x4c108f[_0x4ee10d+_0xa24c('0x70')]=_0x2544fc['id'];_0x4c108f[_0x4ee10d+_0xa24c('0x71')]=_0x2544fc['Interaction']['id'];_0x4c108f[_0xa24c('0x72')+_0x4ee10d+_0xa077c8+'Id']=_0x2544fc[_0xa24c('0x69')]['id'];_0x4c108f['To'+_0x4ee10d+_0xa24c('0x73')]=_0x170b65['id'];return db[_0x4ee10d+'TransferReport']['create'](_0x4c108f);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x84ddcc,'interaction':_0x2544fc[_0xa24c('0x6d')],'message':_0x2544fc,'account':_0x2544fc['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x170b65[_0xa24c('0x30')]+','+(_0x2544fc['Account']['queueTransferTimeout']||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x16f93a,null))[_0xa24c('0x1b')](handleError(_0x16f93a,null));};};exports[_0xa24c('0x75')]=function(_0xd23eb3,_0x890e15){var _0x12836d,_0x280fa2;if(_[_0xa24c('0x12')](_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x76')])){throw new Error(_0xa24c('0x77'));}var _0x24b28c=_0xd23eb3['body'][_0xa24c('0x76')];var _0x292c22=_['capitalize'](_0x24b28c);var _0x2fd4a2=_0x24b28c==='chat'?'Website':'Account';return db[_0xa24c('0x78')]['findOne']({'raw':!![],'where':{'id':_0xd23eb3[_0xa24c('0x1a')]['id'],'role':'agent'}})[_0xa24c('0x17')](function(_0x144c3b){if(_['isNil'](_0x144c3b)){throw new Error(_0xa24c('0x79'));}_0x12836d=_0x144c3b;return db[_0x292c22+'Message'][_0xa24c('0x6b')]({'where':{'id':_0xd23eb3[_0xa24c('0x1f')][_0xa24c('0x7a')]},'include':[{'model':db[_0x292c22+_0xa24c('0x6d')],'as':_0xa24c('0x6d')},{'model':db[_0x292c22+_0x2fd4a2],'as':'Account'}]});})[_0xa24c('0x17')](function(_0x5774d2){if(_[_0xa24c('0x12')](_0x5774d2)){throw new Error(_0x292c22+_0xa24c('0x7b'));}_0x280fa2=_0x5774d2;return _0x5774d2[_0xa24c('0x6e')]({'read':0x0,'readAt':null,'UserId':null});})[_0xa24c('0x17')](function(){var _0x4b848d={'uniqueid':_0x24b28c+'.'+_0x280fa2['id']+'.'+_0x280fa2[_0xa24c('0x6d')]['id'],'FromUserId':_0xd23eb3[_0xa24c('0x2f')]['id'],'type':_0xa24c('0x6f'),'ToUserId':_0x12836d['id']};_0x4b848d[_0x292c22+_0xa24c('0x70')]=_0x280fa2['id'];_0x4b848d[_0x292c22+'InteractionId']=_0x280fa2[_0xa24c('0x6d')]['id'];_0x4b848d[_0xa24c('0x72')+_0x292c22+_0x2fd4a2+'Id']=_0x280fa2[_0xa24c('0x69')]['id'];return db[_0x292c22+_0xa24c('0x7c')][_0xa24c('0x7d')](_0x4b848d);})[_0xa24c('0x17')](function(){return respondWithRpcPromise(_0xa24c('0x74'),{'channel':_0x24b28c,'interaction':_0x280fa2[_0xa24c('0x6d')],'message':_0x280fa2,'account':_0x280fa2[_0xa24c('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0xa24c('0x3c'),'appdata':_0x12836d[_0xa24c('0x30')]+','+(_0x280fa2[_0xa24c('0x69')][_0xa24c('0x7e')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xa24c('0x17')](respondWithResult(_0x890e15,null))[_0xa24c('0x1b')](handleError(_0x890e15,null));}; \ No newline at end of file +var _0xa630=['user','interaction','hasOwnProperty','MemberReport','findAll','INTERACTION','format','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','agent','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','uniq','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','queue','MessageId','InteractionId','From','Account','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','channel','Channel\x20field\x20is\x20mandatory','update','agentTransferTimeout','bluebird','moment','../../mysqldb','api','client','http','then','error','code','message','result','json','stack','name','status','isNil','rows','find','voiceChannels','VoiceChannels','catch','VoiceChannelMixMonitor','merge','query','params','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','outboundChannels','OutboundChannels','agents','agentCapacity'];(function(_0x19ac90,_0x554f04){var _0x4b9d7d=function(_0x3efc03){while(--_0x3efc03){_0x19ac90['push'](_0x19ac90['shift']());}};_0x4b9d7d(++_0x554f04);}(_0xa630,0xbe));var _0x0a63=function(_0x42cdf9,_0xe979ab){_0x42cdf9=_0x42cdf9-0x0;var _0x2e03e4=_0xa630[_0x42cdf9];return _0x2e03e4;};'use strict';var BPromise=require(_0x0a63('0x0'));var moment=require(_0x0a63('0x1'));var _=require('lodash');var util=require('util');var db=require(_0x0a63('0x2'))['db'];var logger=require('../../config/logger')(_0x0a63('0x3'));var jayson=require('jayson/promise');var amiClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232a});var mailClient=jayson[_0x0a63('0x4')][_0x0a63('0x5')]({'port':0x232b});var routingClient=jayson[_0x0a63('0x4')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){var _0x2a1bd7=_0xc2dcd7?_0xc2dcd7:amiClient;return _0x2a1bd7['request'](_0x2760b0,_0x3d5f0b)[_0x0a63('0x6')](function(_0xb714c7){if(_0xb714c7[_0x0a63('0x7')]){if(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x8')]===0x1f4){return _0x12a7df(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}return _0x41d21d(_0xb714c7[_0x0a63('0x7')][_0x0a63('0x9')]);}else{_0x41d21d(_0xb714c7[_0x0a63('0xa')]);}})['catch'](function(_0x345f56){_0x12a7df(_0x345f56);});});}function respondWithResult(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xc8;return function(_0x3d6323){if(_0x3d6323){return _0x420043['status'](_0x2fce86)[_0x0a63('0xb')](_0x3d6323);}return _0x420043['sendStatus'](0x194);};}function handleError(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0x1f4;return function(_0x26b2bc){logger[_0x0a63('0x7')](_0x26b2bc[_0x0a63('0xc')]);if(_0x26b2bc[_0x0a63('0xd')]){delete _0x26b2bc[_0x0a63('0xd')];}_0x331e99[_0x0a63('0xe')](_0x19e922)['send'](_0x26b2bc);};}function findById(_0x47788e){return function(_0x56b314){if(!_[_0x0a63('0xf')](_0x47788e)&&!_[_0x0a63('0xf')](_0x56b314)&&!_[_0x0a63('0xf')](_0x56b314[_0x0a63('0x10')])){return _[_0x0a63('0x11')](_0x56b314[_0x0a63('0x10')],function(_0x30f292){return _0x30f292['id']==_0x47788e;});}return null;};}exports[_0x0a63('0x12')]=function(_0x2fd06c,_0x3cc74d){return respondWithRpcPromise(_0x0a63('0x13'),_0x2fd06c['query'])['then'](respondWithResult(_0x3cc74d,null))[_0x0a63('0x14')](handleError(_0x3cc74d,null));};exports['voiceChannelMixMonitor']=function(_0x2fc87c,_0x5937df){return respondWithRpcPromise(_0x0a63('0x15'),_[_0x0a63('0x16')](_0x2fc87c[_0x0a63('0x17')],_0x2fc87c[_0x0a63('0x18')]))['then'](respondWithResult(_0x5937df,null))[_0x0a63('0x14')](handleError(_0x5937df,null));};exports['voiceChannelStopMixMonitor']=function(_0x3a7f9d,_0x11fe64){return respondWithRpcPromise(_0x0a63('0x19'),_[_0x0a63('0x16')](_0x3a7f9d[_0x0a63('0x17')],_0x3a7f9d[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x11fe64,null))[_0x0a63('0x14')](handleError(_0x11fe64,null));};exports['voiceQueues']=function(_0x5e5987,_0x55fb70){return respondWithRpcPromise('VoiceQueues',_0x5e5987[_0x0a63('0x17')])['then'](respondWithResult(_0x55fb70,null))['catch'](handleError(_0x55fb70,null));};exports[_0x0a63('0x1a')]=function(_0x1d5448,_0x362d6a){return respondWithRpcPromise(_0x0a63('0x1b'),_0x1d5448['query'])[_0x0a63('0x6')](findById(_0x1d5448[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x362d6a,null))['catch'](handleError(_0x362d6a,null));};exports[_0x0a63('0x1c')]=function(_0xcf409,_0x1b7bdb){return respondWithRpcPromise(_0x0a63('0x1d'),_[_0x0a63('0x16')](_0xcf409[_0x0a63('0x1e')],_0xcf409[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x1b7bdb,null))['catch'](handleError(_0x1b7bdb,null));};exports[_0x0a63('0x1f')]=function(_0x574c06,_0x151cb6){return respondWithRpcPromise(_0x0a63('0x20'),_[_0x0a63('0x16')](_0x574c06[_0x0a63('0x17')],_0x574c06[_0x0a63('0x18')]))['then'](respondWithResult(_0x151cb6,null))[_0x0a63('0x14')](handleError(_0x151cb6,null));};exports[_0x0a63('0x21')]=function(_0x33a717,_0x46fb40){return respondWithRpcPromise('VoiceQueuesChannels',_0x33a717[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x46fb40,null))['catch'](handleError(_0x46fb40,null));};exports['voiceQueuesChannel']=function(_0x34a170,_0x51d959){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x0a63('0x16')](_0x34a170[_0x0a63('0x17')],_0x34a170['params']))[_0x0a63('0x6')](respondWithResult(_0x51d959,null))[_0x0a63('0x14')](handleError(_0x51d959,null));};exports[_0x0a63('0x22')]=function(_0x333130,_0x395cce){return respondWithRpcPromise('VoiceQueuesChannelHangup',_['merge'](_0x333130[_0x0a63('0x17')],_0x333130[_0x0a63('0x18')]))[_0x0a63('0x6')](respondWithResult(_0x395cce,null))[_0x0a63('0x14')](handleError(_0x395cce,null));};exports[_0x0a63('0x23')]=function(_0x273bcf,_0x59912d){return respondWithRpcPromise(_0x0a63('0x24'),_[_0x0a63('0x16')](_0x273bcf['query'],_0x273bcf[_0x0a63('0x18')]))['then'](respondWithResult(_0x59912d,null))['catch'](handleError(_0x59912d,null));};exports[_0x0a63('0x25')]=function(_0x232388,_0xdc602c){return respondWithRpcPromise('Outbound',_0x232388[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0xdc602c,null))[_0x0a63('0x14')](handleError(_0xdc602c,null));};exports[_0x0a63('0x26')]=function(_0x3f88a1,_0x876bc6){return respondWithRpcPromise(_0x0a63('0x27'),_0x3f88a1['query'])[_0x0a63('0x6')](respondWithResult(_0x876bc6,null))[_0x0a63('0x14')](handleError(_0x876bc6,null));};exports[_0x0a63('0x28')]=function(_0x53d034,_0x5d9952){var _0x28f904;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')])[_0x0a63('0x6')](function(_0x128e9e){_0x28f904=_0x128e9e;return respondWithRpcPromise('Agents',_0x53d034[_0x0a63('0x17')],routingClient);})[_0x0a63('0x6')](function(_0x46b6ee){return _[_0x0a63('0x16')]({},_0x46b6ee,_0x28f904);})['then'](respondWithResult(_0x5d9952,null))[_0x0a63('0x14')](handleError(_0x5d9952,null));};exports[_0x0a63('0x29')]=function(_0x4234cd,_0x2ccd99){if(_0x4234cd[_0x0a63('0x1e')]&&_0x4234cd[_0x0a63('0x1e')]['interaction']&&_0x4234cd[_0x0a63('0x2a')]&&_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')]){for(var _0x793502 in _0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')]){if(_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x0a63('0x2c')](_0x793502)){db[_0x0a63('0x2d')][_0x0a63('0x2e')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'exitAt':null,'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]&&_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502]['length']?{'$notIn':_0x4234cd[_0x0a63('0x1e')]['interaction'][_0x793502]}:{'$ne':null}}})['then'](function(_0xd9eddc){var _0x223ecf=moment()[_0x0a63('0x30')](_0x0a63('0x31'));for(var _0xd9149d=0x0,_0x9c89ed=_0xd9eddc[_0x0a63('0x32')];_0xd9149d<_0x9c89ed;_0xd9149d+=0x1){_0xd9eddc[_0xd9149d][_0x0a63('0x33')]({'exitAt':_0x223ecf});}});for(var _0x3d0667=0x0;_0x3d0667<_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x0a63('0x32')];_0x3d0667+=0x1){db[_0x0a63('0x2d')][_0x0a63('0x34')]({'where':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')][_0x0a63('0xd')],'type':_0x0a63('0x2f'),'uniqueid':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x2b')][_0x793502][_0x3d0667],'exitAt':null},'defaults':{'channel':_0x793502,'membername':_0x4234cd[_0x0a63('0x2a')]['name'],'interface':_[_0x0a63('0xf')](_0x4234cd[_0x0a63('0x2a')]['interface'])?util['format']('SIP/%s',_0x4234cd['user'][_0x0a63('0xd')]):_0x4234cd[_0x0a63('0x2a')]['interface'],'type':_0x0a63('0x2f'),'enterAt':moment()['format'](_0x0a63('0x31')),'role':_0x0a63('0x35'),'internal':_0x4234cd['user']['internal'],'uniqueid':_0x4234cd['body'][_0x0a63('0x2b')][_0x793502][_0x3d0667]}});}}}}return respondWithRpcPromise(_0x0a63('0x36'),{'id':_0x4234cd[_0x0a63('0x18')]['id'],'capacity':_0x4234cd[_0x0a63('0x1e')][_0x0a63('0x37')]},routingClient)['then'](respondWithResult(_0x2ccd99,null))[_0x0a63('0x14')](handleError(_0x2ccd99,null));};exports[_0x0a63('0x38')]=function(_0x22b3ea,_0x10adf1){return respondWithRpcPromise(_0x0a63('0x39'),_0x22b3ea['query'])[_0x0a63('0x6')](respondWithResult(_0x10adf1,null))[_0x0a63('0x14')](handleError(_0x10adf1,null));};exports[_0x0a63('0x3a')]=function(_0x1fbd2b,_0x4f3414){return respondWithRpcPromise(_0x0a63('0x3b'),_0x1fbd2b[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4f3414,null))[_0x0a63('0x14')](handleError(_0x4f3414,null));};exports[_0x0a63('0x3c')]=function(_0x258ed3,_0x4d4e20){return respondWithRpcPromise(_0x0a63('0x3d'),_0x258ed3[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x4d4e20,null))[_0x0a63('0x14')](handleError(_0x4d4e20,null));};exports['chatQueues']=function(_0x4c1e34,_0x2ac98b){return respondWithRpcPromise(_0x0a63('0x3e'),_0x4c1e34[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x2ac98b,null))[_0x0a63('0x14')](handleError(_0x2ac98b,null));};exports['showChatQueues']=function(_0x5e6aae,_0x58b3a8){return respondWithRpcPromise(_0x0a63('0x3e'),_0x5e6aae['query'],routingClient)[_0x0a63('0x6')](findById(_0x5e6aae[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x58b3a8,null))['catch'](handleError(_0x58b3a8,null));};exports['mailQueues']=function(_0x2d63c6,_0x226279){return respondWithRpcPromise(_0x0a63('0x3f'),_0x2d63c6[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x226279,null))[_0x0a63('0x14')](handleError(_0x226279,null));};exports[_0x0a63('0x40')]=function(_0xc3415c,_0xe454ef){return respondWithRpcPromise(_0x0a63('0x3f'),_0xc3415c[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0xc3415c[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0xe454ef,null))['catch'](handleError(_0xe454ef,null));};exports['mailAccounts']=function(_0x1adea6,_0x24c9e0){return respondWithRpcPromise('MailAccounts',_0x1adea6[_0x0a63('0x17')],mailClient)[_0x0a63('0x6')](respondWithResult(_0x24c9e0,null))['catch'](handleError(_0x24c9e0,null));};exports[_0x0a63('0x41')]=function(_0x3053e4,_0x5e5495){return respondWithRpcPromise('OpenchannelQueues',_0x3053e4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5e5495,null))[_0x0a63('0x14')](handleError(_0x5e5495,null));};exports['showOpenchannelQueues']=function(_0x116e05,_0x375acd){return respondWithRpcPromise(_0x0a63('0x42'),_0x116e05[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x116e05['params']['id']))[_0x0a63('0x6')](respondWithResult(_0x375acd,null))[_0x0a63('0x14')](handleError(_0x375acd,null));};exports[_0x0a63('0x43')]=function(_0x1fa9cd,_0x295c06){return respondWithRpcPromise(_0x0a63('0x44'),_0x1fa9cd[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x295c06,null))[_0x0a63('0x14')](handleError(_0x295c06,null));};exports[_0x0a63('0x45')]=function(_0x252f70,_0x1155f1){return respondWithRpcPromise(_0x0a63('0x44'),_0x252f70[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x252f70[_0x0a63('0x18')]['id']))['then'](respondWithResult(_0x1155f1,null))['catch'](handleError(_0x1155f1,null));};exports[_0x0a63('0x46')]=function(_0x30e5f0,_0x4137bc){return respondWithRpcPromise(_0x0a63('0x47'),_0x30e5f0[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x4137bc,null))[_0x0a63('0x14')](handleError(_0x4137bc,null));};exports[_0x0a63('0x48')]=function(_0x1aefc4,_0x2a2f1b){return respondWithRpcPromise(_0x0a63('0x47'),_0x1aefc4[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x1aefc4[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x2a2f1b,null))[_0x0a63('0x14')](handleError(_0x2a2f1b,null));};exports[_0x0a63('0x49')]=function(_0x485969,_0x25276f){return respondWithRpcPromise('FaxQueues',_0x485969[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x25276f,null))['catch'](handleError(_0x25276f,null));};exports['showFaxQueues']=function(_0x480acb,_0x31481f){return respondWithRpcPromise(_0x0a63('0x4a'),_0x480acb[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](findById(_0x480acb[_0x0a63('0x18')]['id']))[_0x0a63('0x6')](respondWithResult(_0x31481f,null))['catch'](handleError(_0x31481f,null));};exports['faxAccounts']=function(_0x5cb325,_0x1213a5){return respondWithRpcPromise(_0x0a63('0x4b'),_0x5cb325[_0x0a63('0x17')])[_0x0a63('0x6')](respondWithResult(_0x1213a5,null))['catch'](handleError(_0x1213a5,null));};exports[_0x0a63('0x4c')]=function(_0x5ed2db,_0x5de3de){return respondWithRpcPromise(_0x0a63('0x4d'),_0x5ed2db['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x5de3de,null))[_0x0a63('0x14')](handleError(_0x5de3de,null));};exports['mailQueuesWaitingInteractions']=function(_0x267583,_0x4d1e35){return respondWithRpcPromise(_0x0a63('0x4e'),_0x267583['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x4d1e35,null))[_0x0a63('0x14')](handleError(_0x4d1e35,null));};exports[_0x0a63('0x4f')]=function(_0x4fba49,_0x3b8442){return respondWithRpcPromise(_0x0a63('0x50'),_0x4fba49[_0x0a63('0x17')],routingClient)[_0x0a63('0x6')](respondWithResult(_0x3b8442,null))[_0x0a63('0x14')](handleError(_0x3b8442,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x55174c,_0x550dbb){return respondWithRpcPromise(_0x0a63('0x50'),_0x55174c['query'],routingClient)[_0x0a63('0x6')](function(_0xa27da4){if(_0x55174c[_0x0a63('0x17')][_0x0a63('0x51')]!==undefined){var _0x5540c6=_(_0xa27da4[_0x0a63('0x10')])[_0x0a63('0x52')]([_0x55174c['query'][_0x0a63('0x51')],_0x55174c[_0x0a63('0x18')]['id']])[_0x0a63('0x53')](_0x0a63('0x54'))[_0x0a63('0x55')]()['value']();return _0xa27da4[_0x0a63('0x10')][_0x0a63('0x52')](function(_0x3941f6){return _0x5540c6['indexOf'](_0x3941f6['queue_id'])>-0x1;});}else{return _0xa27da4['rows'][_0x0a63('0x52')](function(_0x3b94ae){return _0x3b94ae[_0x0a63('0x54')]===parseInt(_0x55174c[_0x0a63('0x18')]['id']);});}})[_0x0a63('0x6')](respondWithResult(_0x550dbb,null))[_0x0a63('0x14')](handleError(_0x550dbb,null));};exports[_0x0a63('0x56')]=function(_0x37255d,_0x1dc593){return respondWithRpcPromise(_0x0a63('0x57'),_0x37255d['query'],routingClient)[_0x0a63('0x6')](respondWithResult(_0x1dc593,null))[_0x0a63('0x14')](handleError(_0x1dc593,null));};exports[_0x0a63('0x58')]=function(_0x229954,_0x3d62ca){return respondWithRpcPromise(_0x0a63('0x59'),_0x229954['query'],routingClient)['then'](respondWithResult(_0x3d62ca,null))[_0x0a63('0x14')](handleError(_0x3d62ca,null));};exports[_0x0a63('0x5a')]=function(_0x425c8c,_0x3caea6){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x425c8c[_0x0a63('0x17')],routingClient)['then'](respondWithResult(_0x3caea6,null))[_0x0a63('0x14')](handleError(_0x3caea6,null));};exports[_0x0a63('0x5b')]=function(_0x1e256e){return function(_0xee586,_0x486ffc){var _0x3710fa,_0x2173ee;var _0x430065=_[_0x0a63('0x5c')](_0x1e256e);var _0x540953=_0x1e256e==='chat'?_0x0a63('0x5d'):'Account';return db[_0x430065+_0x0a63('0x5e')][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0xee586[_0x0a63('0x18')]['id']}})[_0x0a63('0x6')](function(_0x65a390){if(_['isNil'](_0x65a390)){throw new Error(_0x430065+_0x0a63('0x60'));}_0x3710fa=_0x65a390;return db[_0x430065+_0x0a63('0x61')][_0x0a63('0x5f')]({'where':{'id':_0xee586[_0x0a63('0x1e')][_0x0a63('0x62')]},'include':[{'model':db[_0x430065+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x430065+_0x540953],'as':'Account'}]});})[_0x0a63('0x6')](function(_0x1a329c){if(_[_0x0a63('0xf')](_0x1a329c)){throw new Error(_0x430065+_0x0a63('0x64'));}_0x2173ee=_0x1a329c;return _0x1a329c['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x0a63('0x6')](function(){var _0x148bbd={'uniqueid':_0x1e256e+'.'+_0x2173ee['id']+'.'+_0x2173ee[_0x0a63('0x63')]['id'],'FromUserId':_0xee586['user']['id'],'type':_0x0a63('0x65')};_0x148bbd[_0x430065+_0x0a63('0x66')]=_0x2173ee['id'];_0x148bbd[_0x430065+_0x0a63('0x67')]=_0x2173ee['Interaction']['id'];_0x148bbd[_0x0a63('0x68')+_0x430065+_0x540953+'Id']=_0x2173ee[_0x0a63('0x69')]['id'];_0x148bbd['To'+_0x430065+_0x0a63('0x6a')]=_0x3710fa['id'];return db[_0x430065+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x148bbd);})[_0x0a63('0x6')](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x1e256e,'interaction':_0x2173ee[_0x0a63('0x63')],'message':_0x2173ee,'account':_0x2173ee[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x65'),'appdata':_0x3710fa[_0x0a63('0xd')]+','+(_0x2173ee[_0x0a63('0x69')][_0x0a63('0x6e')]||0x12c),'interval':_0x0a63('0x6f')}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x486ffc,null))[_0x0a63('0x14')](handleError(_0x486ffc,null));};};exports['agentNotify']=function(_0x3ddf5e,_0x5f0510){var _0x19a46f,_0x36fd48;if(_['isNil'](_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')])){throw new Error(_0x0a63('0x71'));}var _0x2e1dc6=_0x3ddf5e[_0x0a63('0x1e')][_0x0a63('0x70')];var _0x1030f7=_[_0x0a63('0x5c')](_0x2e1dc6);var _0x393399=_0x2e1dc6==='chat'?_0x0a63('0x5d'):'Account';return db['User'][_0x0a63('0x5f')]({'raw':!![],'where':{'id':_0x3ddf5e[_0x0a63('0x18')]['id'],'role':_0x0a63('0x35')}})[_0x0a63('0x6')](function(_0x5e1f76){if(_[_0x0a63('0xf')](_0x5e1f76)){throw new Error('Agent\x20not\x20found');}_0x19a46f=_0x5e1f76;return db[_0x1030f7+'Message'][_0x0a63('0x5f')]({'where':{'id':_0x3ddf5e['body']['messageId']},'include':[{'model':db[_0x1030f7+_0x0a63('0x63')],'as':_0x0a63('0x63')},{'model':db[_0x1030f7+_0x393399],'as':_0x0a63('0x69')}]});})[_0x0a63('0x6')](function(_0x52488a){if(_[_0x0a63('0xf')](_0x52488a)){throw new Error(_0x1030f7+'\x20Message\x20not\x20found');}_0x36fd48=_0x52488a;return _0x52488a[_0x0a63('0x72')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x11dd21={'uniqueid':_0x2e1dc6+'.'+_0x36fd48['id']+'.'+_0x36fd48['Interaction']['id'],'FromUserId':_0x3ddf5e[_0x0a63('0x2a')]['id'],'type':_0x0a63('0x65'),'ToUserId':_0x19a46f['id']};_0x11dd21[_0x1030f7+_0x0a63('0x66')]=_0x36fd48['id'];_0x11dd21[_0x1030f7+_0x0a63('0x67')]=_0x36fd48[_0x0a63('0x63')]['id'];_0x11dd21[_0x0a63('0x68')+_0x1030f7+_0x393399+'Id']=_0x36fd48[_0x0a63('0x69')]['id'];return db[_0x1030f7+_0x0a63('0x6b')][_0x0a63('0x6c')](_0x11dd21);})['then'](function(){return respondWithRpcPromise(_0x0a63('0x6d'),{'channel':_0x2e1dc6,'interaction':_0x36fd48['Interaction'],'message':_0x36fd48,'account':_0x36fd48[_0x0a63('0x69')],'applications':[{'id':0x0,'priority':0x1,'app':_0x0a63('0x35'),'appdata':_0x19a46f[_0x0a63('0xd')]+','+(_0x36fd48[_0x0a63('0x69')][_0x0a63('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x0a63('0x6')](respondWithResult(_0x5f0510,null))[_0x0a63('0x14')](handleError(_0x5f0510,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 5fa8c91..53218b2 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 _0x5b0c=['path','connect-timeout','fs-extra','../../components/interaction/service','./schedule.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x2e7a43,_0x3b3df4){var _0x52e9e1=function(_0x2c08cf){while(--_0x2c08cf){_0x2e7a43['push'](_0x2e7a43['shift']());}};_0x52e9e1(++_0x3b3df4);}(_0x5b0c,0x1ce));var _0xc5b0=function(_0x392dc2,_0x47c3f3){_0x392dc2=_0x392dc2-0x0;var _0x14150f=_0x5b0c[_0x392dc2];return _0x14150f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc5b0('0x0'));var timeout=require(_0xc5b0('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xc5b0('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xc5b0('0x3'));var config=require('../../config/environment');var controller=require(_0xc5b0('0x4'));router['get']('/',auth[_0xc5b0('0x5')](),controller[_0xc5b0('0x6')]);router['get'](_0xc5b0('0x7'),auth[_0xc5b0('0x5')](),controller['show']);router['get']('/:id/run',auth[_0xc5b0('0x5')](),controller['run']);router[_0xc5b0('0x8')]('/',auth[_0xc5b0('0x5')](),controller[_0xc5b0('0x9')]);router[_0xc5b0('0xa')](_0xc5b0('0x7'),auth[_0xc5b0('0x5')](),controller[_0xc5b0('0xb')]);router[_0xc5b0('0xc')](_0xc5b0('0x7'),auth[_0xc5b0('0x5')](),controller[_0xc5b0('0xd')]);module['exports']=router; \ No newline at end of file +var _0x64a7=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x292037,_0x3fbd07){var _0x4e3bff=function(_0x43e77e){while(--_0x43e77e){_0x292037['push'](_0x292037['shift']());}};_0x4e3bff(++_0x3fbd07);}(_0x64a7,0x12c));var _0x764a=function(_0x433518,_0x201847){_0x433518=_0x433518-0x0;var _0x73c5cf=_0x64a7[_0x433518];return _0x73c5cf;};'use strict';var multer=require(_0x764a('0x0'));var util=require(_0x764a('0x1'));var path=require(_0x764a('0x2'));var timeout=require(_0x764a('0x3'));var express=require(_0x764a('0x4'));var router=express[_0x764a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x764a('0x6'));var interaction=require(_0x764a('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router[_0x764a('0x8')]('/',auth[_0x764a('0x9')](),controller[_0x764a('0xa')]);router['get'](_0x764a('0xb'),auth['isAuthenticated'](),controller[_0x764a('0xc')]);router[_0x764a('0x8')]('/:id/run',auth[_0x764a('0x9')](),controller['run']);router['post']('/',auth[_0x764a('0x9')](),controller['create']);router[_0x764a('0xd')](_0x764a('0xb'),auth[_0x764a('0x9')](),controller[_0x764a('0xe')]);router['delete'](_0x764a('0xb'),auth['isAuthenticated'](),controller[_0x764a('0xf')]);module[_0x764a('0x10')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index f248aef..c17e761 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 _0x1bcd=['years','days','hours','minutes','csv','xlsx','custom','TEXT','sequelize','exports','STRING','BOOLEAN','DATE','INTEGER','ENUM'];(function(_0x343219,_0x39eabe){var _0x4e8f32=function(_0x43f6dd){while(--_0x43f6dd){_0x343219['push'](_0x343219['shift']());}};_0x4e8f32(++_0x39eabe);}(_0x1bcd,0xad));var _0xd1bc=function(_0x32e4b6,_0x1717e7){_0x32e4b6=_0x32e4b6-0x0;var _0x48ef36=_0x1bcd[_0x32e4b6];return _0x48ef36;};'use strict';var Sequelize=require(_0xd1bc('0x0'));module[_0xd1bc('0x1')]={'name':{'type':Sequelize[_0xd1bc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd1bc('0x2')]},'active':{'type':Sequelize[_0xd1bc('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'0\x200\x20*\x20*\x20*'},'startAt':{'type':Sequelize[_0xd1bc('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0xd1bc('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xd1bc('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xd1bc('0x6')](_0xd1bc('0x7'),'quarters','months','weeks',_0xd1bc('0x8'),_0xd1bc('0x9'),_0xd1bc('0xa')),'allowNull':![],'defaultValue':_0xd1bc('0x8')},'output':{'type':Sequelize[_0xd1bc('0x6')](_0xd1bc('0xb'),'pdf',_0xd1bc('0xc')),'allowNull':![],'defaultValue':_0xd1bc('0xb')},'type':{'type':Sequelize[_0xd1bc('0x6')]('custom','default'),'allowNull':![],'defaultValue':_0xd1bc('0xd')},'sendMail':{'type':Sequelize[_0xd1bc('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xd1bc('0xe')]},'sendIfEmpty':{'type':Sequelize[_0xd1bc('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0xbe22=['DATE','INTEGER','years','quarters','months','weeks','days','hours','ENUM','csv','pdf','xlsx','custom','sequelize','STRING','BOOLEAN','0\x200\x20*\x20*\x20*'];(function(_0x5b7ac1,_0x1746e7){var _0x3a7db6=function(_0x496573){while(--_0x496573){_0x5b7ac1['push'](_0x5b7ac1['shift']());}};_0x3a7db6(++_0x1746e7);}(_0xbe22,0x12e));var _0x2be2=function(_0xca7e5b,_0x10f5f2){_0xca7e5b=_0xca7e5b-0x0;var _0x712872=_0xbe22[_0xca7e5b];return _0x712872;};'use strict';var Sequelize=require(_0x2be2('0x0'));module['exports']={'name':{'type':Sequelize[_0x2be2('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2be2('0x1')]},'active':{'type':Sequelize[_0x2be2('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x2be2('0x1')],'allowNull':![],'defaultValue':_0x2be2('0x3')},'startAt':{'type':Sequelize[_0x2be2('0x4')],'allowNull':![]},'endAt':{'type':Sequelize[_0x2be2('0x4')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x2be2('0x5')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x2be2('0x6'),_0x2be2('0x7'),_0x2be2('0x8'),_0x2be2('0x9'),_0x2be2('0xa'),_0x2be2('0xb'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x2be2('0xc')](_0x2be2('0xd'),_0x2be2('0xe'),_0x2be2('0xf')),'allowNull':![],'defaultValue':_0x2be2('0xd')},'type':{'type':Sequelize[_0x2be2('0xc')](_0x2be2('0x10'),'default'),'allowNull':![],'defaultValue':_0x2be2('0x10')},'sendMail':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x2be2('0x1')]},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x2be2('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 0971ae8..cf432a5 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 _0xf0e6=['apply','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','params','keys','find','create','body','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','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','end','status','undefined','count','offset','set'];(function(_0x18f279,_0x2d7a35){var _0x2cc87f=function(_0x1b41d0){while(--_0x1b41d0){_0x18f279['push'](_0x18f279['shift']());}};_0x2cc87f(++_0x2d7a35);}(_0xf0e6,0x83));var _0x6f0e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf0e6[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x6f0e('0x0'));var rimraf=require(_0x6f0e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6f0e('0x2'));var rp=require(_0x6f0e('0x3'));var moment=require('moment');var BPromise=require(_0x6f0e('0x4'));var Mustache=require(_0x6f0e('0x5'));var util=require('util');var path=require(_0x6f0e('0x6'));var sox=require('sox');var csv=require(_0x6f0e('0x7'));var ejs=require(_0x6f0e('0x8'));var fs=require('fs');var fs_extra=require(_0x6f0e('0x9'));var _=require(_0x6f0e('0xa'));var squel=require(_0x6f0e('0xb'));var crypto=require(_0x6f0e('0xc'));var jsforce=require(_0x6f0e('0xd'));var deskjs=require(_0x6f0e('0xe'));var toCsv=require(_0x6f0e('0x7'));var querystring=require(_0x6f0e('0xf'));var Papa=require('papaparse');var Redis=require(_0x6f0e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6f0e('0x11'));var as=require(_0x6f0e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6f0e('0x13'))(_0x6f0e('0x14'));var utils=require(_0x6f0e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6f0e('0x16'))['db'];function respondWithStatusCode(_0x150d77,_0x4da912){_0x4da912=_0x4da912||0xcc;return function(_0x430a0a){if(_0x430a0a){return _0x150d77['sendStatus'](_0x4da912);}return _0x150d77['status'](_0x4da912)[_0x6f0e('0x17')]();};}function respondWithResult(_0x5b271c,_0x318862){_0x318862=_0x318862||0xc8;return function(_0x50975a){if(_0x50975a){return _0x5b271c[_0x6f0e('0x18')](_0x318862)['json'](_0x50975a);}};}function respondWithFilteredResult(_0xb51041,_0x3da4c1){return function(_0x358c42){if(_0x358c42){var _0x394789=typeof _0x3da4c1['offset']===_0x6f0e('0x19')&&typeof _0x3da4c1['limit']===_0x6f0e('0x19');var _0x33d18a=_0x358c42[_0x6f0e('0x1a')];var _0x13c261=_0x394789?0x0:_0x3da4c1[_0x6f0e('0x1b')];var _0x138c49=_0x394789?_0x358c42[_0x6f0e('0x1a')]:_0x3da4c1[_0x6f0e('0x1b')]+_0x3da4c1['limit'];var _0x3c596e;if(_0x138c49>=_0x33d18a){_0x138c49=_0x33d18a;_0x3c596e=0xc8;}else{_0x3c596e=0xce;}_0xb51041[_0x6f0e('0x18')](_0x3c596e);return _0xb51041[_0x6f0e('0x1c')]('Content-Range',_0x13c261+'-'+_0x138c49+'/'+_0x33d18a)['json'](_0x358c42);}return null;};}function patchUpdates(_0x13a62b){return function(_0x257c04){try{jsonpatch[_0x6f0e('0x1d')](_0x257c04,_0x13a62b,!![]);}catch(_0x4aaedf){return BPromise[_0x6f0e('0x1e')](_0x4aaedf);}return _0x257c04[_0x6f0e('0x1f')]();};}function saveUpdates(_0x28da97,_0x2793d5){return function(_0xa1b94a){if(_0xa1b94a){return _0xa1b94a[_0x6f0e('0x20')](_0x28da97)[_0x6f0e('0x21')](function(_0x192184){return _0x192184;});}return null;};}function removeEntity(_0x5ac908,_0x38c1d3){return function(_0x92c31c){if(_0x92c31c){return _0x92c31c[_0x6f0e('0x22')]()[_0x6f0e('0x21')](function(){var _0x3f314b=_0x92c31c[_0x6f0e('0x23')]({'plain':!![]});var _0x4d5b3c=_0x6f0e('0x24');return db[_0x6f0e('0x25')][_0x6f0e('0x22')]({'where':{'type':_0x4d5b3c,'resourceId':_0x3f314b['id']}})[_0x6f0e('0x21')](function(){return _0x92c31c;});})[_0x6f0e('0x21')](function(){_0x5ac908[_0x6f0e('0x18')](0xcc)[_0x6f0e('0x17')]();});}};}function handleEntityNotFound(_0x32460d,_0x653d1a){return function(_0x450c0b){if(!_0x450c0b){_0x32460d[_0x6f0e('0x26')](0x194);}return _0x450c0b;};}function handleError(_0x318d57,_0x1d14bf){_0x1d14bf=_0x1d14bf||0x1f4;return function(_0x1bfaa0){logger[_0x6f0e('0x27')](_0x1bfaa0[_0x6f0e('0x28')]);if(_0x1bfaa0[_0x6f0e('0x29')]){delete _0x1bfaa0[_0x6f0e('0x29')];}_0x318d57['status'](_0x1d14bf)[_0x6f0e('0x2a')](_0x1bfaa0);};}exports[_0x6f0e('0x2b')]=function(_0x433b71,_0x124d7b){var _0x572df6={},_0x390831={},_0x53ae1c={'count':0x0,'rows':[]};var _0x4986e0=_[_0x6f0e('0x2c')](db[_0x6f0e('0x2d')][_0x6f0e('0x2e')],function(_0x332657){return{'name':_0x332657[_0x6f0e('0x2f')],'type':_0x332657[_0x6f0e('0x30')][_0x6f0e('0x31')]};});_0x390831[_0x6f0e('0x32')]=_['map'](_0x4986e0,'name');_0x390831[_0x6f0e('0x33')]=_['keys'](_0x433b71[_0x6f0e('0x33')]);_0x390831[_0x6f0e('0x34')]=_[_0x6f0e('0x35')](_0x390831[_0x6f0e('0x32')],_0x390831['query']);_0x572df6[_0x6f0e('0x36')]=_['intersection'](_0x390831['model'],qs[_0x6f0e('0x37')](_0x433b71['query'][_0x6f0e('0x37')]));_0x572df6[_0x6f0e('0x36')]=_0x572df6[_0x6f0e('0x36')][_0x6f0e('0x38')]?_0x572df6[_0x6f0e('0x36')]:_0x390831[_0x6f0e('0x32')];if(!_0x433b71[_0x6f0e('0x33')][_0x6f0e('0x39')]('nolimit')){_0x572df6[_0x6f0e('0x3a')]=qs[_0x6f0e('0x3a')](_0x433b71[_0x6f0e('0x33')][_0x6f0e('0x3a')]);_0x572df6[_0x6f0e('0x1b')]=qs['offset'](_0x433b71[_0x6f0e('0x33')][_0x6f0e('0x1b')]);}_0x572df6[_0x6f0e('0x3b')]=qs[_0x6f0e('0x3c')](_0x433b71[_0x6f0e('0x33')][_0x6f0e('0x3c')]);_0x572df6[_0x6f0e('0x3d')]=qs[_0x6f0e('0x34')](_['pick'](_0x433b71[_0x6f0e('0x33')],_0x390831[_0x6f0e('0x34')]),_0x4986e0);if(_0x433b71['query'][_0x6f0e('0x3e')]){_0x572df6['where']=_[_0x6f0e('0x3f')](_0x572df6[_0x6f0e('0x3d')],{'$or':_['map'](_0x4986e0,function(_0x1cb312){if(_0x1cb312[_0x6f0e('0x30')]!==_0x6f0e('0x40')){var _0x2c4716={};_0x2c4716[_0x1cb312[_0x6f0e('0x29')]]={'$like':'%'+_0x433b71['query'][_0x6f0e('0x3e')]+'%'};return _0x2c4716;}})});}_0x572df6=_[_0x6f0e('0x3f')]({},_0x572df6,_0x433b71[_0x6f0e('0x41')]);var _0x343ec2={'where':_0x572df6[_0x6f0e('0x3d')]};return db[_0x6f0e('0x2d')]['count'](_0x343ec2)[_0x6f0e('0x21')](function(_0x5f5227){_0x53ae1c[_0x6f0e('0x1a')]=_0x5f5227;if(_0x433b71['query']['includeAll']){_0x572df6[_0x6f0e('0x42')]=[{'all':!![]}];}return db[_0x6f0e('0x2d')][_0x6f0e('0x43')](_0x572df6);})[_0x6f0e('0x21')](function(_0x3eefc0){_0x53ae1c[_0x6f0e('0x44')]=_0x3eefc0;return _0x53ae1c;})[_0x6f0e('0x21')](respondWithFilteredResult(_0x124d7b,_0x572df6))[_0x6f0e('0x45')](handleError(_0x124d7b,null));};exports['show']=function(_0x512b19,_0x4ba21e){var _0x4d3397={'raw':![],'where':{'id':_0x512b19[_0x6f0e('0x46')]['id']}},_0x19f8ee={};_0x19f8ee[_0x6f0e('0x32')]=_[_0x6f0e('0x47')](db[_0x6f0e('0x2d')][_0x6f0e('0x2e')]);_0x19f8ee[_0x6f0e('0x33')]=_[_0x6f0e('0x47')](_0x512b19[_0x6f0e('0x33')]);_0x19f8ee[_0x6f0e('0x34')]=_[_0x6f0e('0x35')](_0x19f8ee[_0x6f0e('0x32')],_0x19f8ee[_0x6f0e('0x33')]);_0x4d3397[_0x6f0e('0x36')]=_[_0x6f0e('0x35')](_0x19f8ee[_0x6f0e('0x32')],qs[_0x6f0e('0x37')](_0x512b19['query'][_0x6f0e('0x37')]));_0x4d3397[_0x6f0e('0x36')]=_0x4d3397[_0x6f0e('0x36')][_0x6f0e('0x38')]?_0x4d3397[_0x6f0e('0x36')]:_0x19f8ee['model'];if(_0x512b19[_0x6f0e('0x33')]['includeAll']){_0x4d3397[_0x6f0e('0x42')]=[{'all':!![]}];}_0x4d3397=_[_0x6f0e('0x3f')]({},_0x4d3397,_0x512b19[_0x6f0e('0x41')]);return db[_0x6f0e('0x2d')][_0x6f0e('0x48')](_0x4d3397)[_0x6f0e('0x21')](handleEntityNotFound(_0x4ba21e,null))[_0x6f0e('0x21')](respondWithResult(_0x4ba21e,null))[_0x6f0e('0x45')](handleError(_0x4ba21e,null));};exports[_0x6f0e('0x49')]=function(_0x105e41,_0x1edabb){return db[_0x6f0e('0x2d')][_0x6f0e('0x49')](_0x105e41[_0x6f0e('0x4a')],{})['then'](function(_0x42d5a1){var _0x545b43=_0x105e41['user'][_0x6f0e('0x23')]({'plain':!![]});if(!_0x545b43)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x545b43['role']===_0x6f0e('0x4b')){var _0x405a91=_0x42d5a1['get']({'plain':!![]});var _0x164daa=_0x6f0e('0x24');return db[_0x6f0e('0x4c')]['find']({'where':{'name':_0x164daa,'userProfileId':_0x545b43[_0x6f0e('0x4d')]},'raw':!![]})[_0x6f0e('0x21')](function(_0x52443f){if(_0x52443f&&_0x52443f['autoAssociation']===0x0){return db['UserProfileResource'][_0x6f0e('0x49')]({'name':_0x405a91[_0x6f0e('0x29')],'resourceId':_0x405a91['id'],'type':_0x52443f[_0x6f0e('0x29')],'sectionId':_0x52443f['id']},{})[_0x6f0e('0x21')](function(){return _0x42d5a1;});}else{return _0x42d5a1;}})[_0x6f0e('0x45')](function(_0x2b89b6){logger[_0x6f0e('0x27')](_0x6f0e('0x4e'),_0x2b89b6);throw _0x2b89b6;});}return _0x42d5a1;})[_0x6f0e('0x21')](respondWithResult(_0x1edabb,0xc9))[_0x6f0e('0x45')](handleError(_0x1edabb,null));};exports['update']=function(_0x23d7f4,_0x426157){if(_0x23d7f4[_0x6f0e('0x4a')]['id']){delete _0x23d7f4[_0x6f0e('0x4a')]['id'];}return db['Schedule'][_0x6f0e('0x48')]({'where':{'id':_0x23d7f4[_0x6f0e('0x46')]['id']}})[_0x6f0e('0x21')](handleEntityNotFound(_0x426157,null))['then'](saveUpdates(_0x23d7f4[_0x6f0e('0x4a')],null))[_0x6f0e('0x21')](respondWithResult(_0x426157,null))[_0x6f0e('0x45')](handleError(_0x426157,null));};exports[_0x6f0e('0x22')]=function(_0x4a246f,_0x204148){return db[_0x6f0e('0x2d')]['find']({'where':{'id':_0x4a246f[_0x6f0e('0x46')]['id']}})[_0x6f0e('0x21')](handleEntityNotFound(_0x204148,null))[_0x6f0e('0x21')](removeEntity(_0x204148,null))[_0x6f0e('0x45')](handleError(_0x204148,null));};exports[_0x6f0e('0x4f')]=function(_0x58bcca,_0x35ad47,_0x4c09db){var _0x372b05=require('../../config/schedule');return db['Schedule'][_0x6f0e('0x48')]({'where':{'id':_0x58bcca[_0x6f0e('0x46')]['id']},'raw':!![]})[_0x6f0e('0x21')](handleEntityNotFound(_0x35ad47,null))[_0x6f0e('0x21')](function(){_0x372b05[_0x6f0e('0x4f')](_0x58bcca[_0x6f0e('0x46')]['id']);})[_0x6f0e('0x21')](respondWithStatusCode(_0x35ad47,null))[_0x6f0e('0x45')](handleError(_0x35ad47,null));}; \ No newline at end of file +var _0x988a=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','run','../../config/schedule','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','Scheduler','UserProfileResource','error','stack','name','index','map','Schedule','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter'];(function(_0xf24612,_0x288e25){var _0x3388ee=function(_0x97ed23){while(--_0x97ed23){_0xf24612['push'](_0xf24612['shift']());}};_0x3388ee(++_0x288e25);}(_0x988a,0x128));var _0xa988=function(_0x4d4bb3,_0x89f578){_0x4d4bb3=_0x4d4bb3-0x0;var _0x10ef5b=_0x988a[_0x4d4bb3];return _0x10ef5b;};'use strict';var emlformat=require(_0xa988('0x0'));var rimraf=require(_0xa988('0x1'));var zipdir=require(_0xa988('0x2'));var jsonpatch=require(_0xa988('0x3'));var rp=require('request-promise');var moment=require(_0xa988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa988('0x5'));var util=require(_0xa988('0x6'));var path=require(_0xa988('0x7'));var sox=require(_0xa988('0x8'));var csv=require(_0xa988('0x9'));var ejs=require(_0xa988('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa988('0xb'));var squel=require(_0xa988('0xc'));var crypto=require(_0xa988('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa988('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa988('0xf'));var Papa=require('papaparse');var Redis=require(_0xa988('0x10'));var authService=require(_0xa988('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa988('0x12'));var hardwareService=require(_0xa988('0x13'));var logger=require(_0xa988('0x14'))(_0xa988('0x15'));var utils=require(_0xa988('0x16'));var config=require(_0xa988('0x17'));var licenseUtil=require(_0xa988('0x18'));var db=require(_0xa988('0x19'))['db'];function respondWithStatusCode(_0x13282a,_0x365271){_0x365271=_0x365271||0xcc;return function(_0x6f1ac2){if(_0x6f1ac2){return _0x13282a[_0xa988('0x1a')](_0x365271);}return _0x13282a[_0xa988('0x1b')](_0x365271)[_0xa988('0x1c')]();};}function respondWithResult(_0x207e03,_0xe5c674){_0xe5c674=_0xe5c674||0xc8;return function(_0x11ecc4){if(_0x11ecc4){return _0x207e03[_0xa988('0x1b')](_0xe5c674)[_0xa988('0x1d')](_0x11ecc4);}};}function respondWithFilteredResult(_0x29a86a,_0x288f15){return function(_0x186a4e){if(_0x186a4e){var _0x5d9d3f=typeof _0x288f15[_0xa988('0x1e')]===_0xa988('0x1f')&&typeof _0x288f15['limit']==='undefined';var _0x453863=_0x186a4e[_0xa988('0x20')];var _0x436b08=_0x5d9d3f?0x0:_0x288f15[_0xa988('0x1e')];var _0x54bb61=_0x5d9d3f?_0x186a4e[_0xa988('0x20')]:_0x288f15[_0xa988('0x1e')]+_0x288f15[_0xa988('0x21')];var _0x2ad7e1;if(_0x54bb61>=_0x453863){_0x54bb61=_0x453863;_0x2ad7e1=0xc8;}else{_0x2ad7e1=0xce;}_0x29a86a[_0xa988('0x1b')](_0x2ad7e1);return _0x29a86a[_0xa988('0x22')](_0xa988('0x23'),_0x436b08+'-'+_0x54bb61+'/'+_0x453863)[_0xa988('0x1d')](_0x186a4e);}return null;};}function patchUpdates(_0x151358){return function(_0x556851){try{jsonpatch['apply'](_0x556851,_0x151358,!![]);}catch(_0x2ffafe){return BPromise[_0xa988('0x24')](_0x2ffafe);}return _0x556851[_0xa988('0x25')]();};}function saveUpdates(_0x208ad7,_0x49f0be){return function(_0x5a8909){if(_0x5a8909){return _0x5a8909[_0xa988('0x26')](_0x208ad7)[_0xa988('0x27')](function(_0x26196e){return _0x26196e;});}return null;};}function removeEntity(_0x1bcb76,_0x20b5e5){return function(_0x530cb9){if(_0x530cb9){return _0x530cb9[_0xa988('0x28')]()['then'](function(){var _0xdef786=_0x530cb9[_0xa988('0x29')]({'plain':!![]});var _0x45f5e9=_0xa988('0x2a');return db[_0xa988('0x2b')][_0xa988('0x28')]({'where':{'type':_0x45f5e9,'resourceId':_0xdef786['id']}})['then'](function(){return _0x530cb9;});})[_0xa988('0x27')](function(){_0x1bcb76[_0xa988('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xee242c,_0xe5252b){return function(_0x316687){if(!_0x316687){_0xee242c[_0xa988('0x1a')](0x194);}return _0x316687;};}function handleError(_0xd5ff7e,_0x2d5038){_0x2d5038=_0x2d5038||0x1f4;return function(_0x32ed29){logger[_0xa988('0x2c')](_0x32ed29[_0xa988('0x2d')]);if(_0x32ed29[_0xa988('0x2e')]){delete _0x32ed29[_0xa988('0x2e')];}_0xd5ff7e[_0xa988('0x1b')](_0x2d5038)['send'](_0x32ed29);};}exports[_0xa988('0x2f')]=function(_0x564fa1,_0x4afdaf){var _0x53f07f={},_0x2c7034={},_0x41223a={'count':0x0,'rows':[]};var _0x24bc67=_[_0xa988('0x30')](db[_0xa988('0x31')]['rawAttributes'],function(_0x7df37b){return{'name':_0x7df37b[_0xa988('0x32')],'type':_0x7df37b[_0xa988('0x33')][_0xa988('0x34')]};});_0x2c7034['model']=_['map'](_0x24bc67,_0xa988('0x2e'));_0x2c7034[_0xa988('0x35')]=_[_0xa988('0x36')](_0x564fa1[_0xa988('0x35')]);_0x2c7034['filters']=_[_0xa988('0x37')](_0x2c7034[_0xa988('0x38')],_0x2c7034[_0xa988('0x35')]);_0x53f07f[_0xa988('0x39')]=_[_0xa988('0x37')](_0x2c7034[_0xa988('0x38')],qs[_0xa988('0x3a')](_0x564fa1[_0xa988('0x35')][_0xa988('0x3a')]));_0x53f07f['attributes']=_0x53f07f[_0xa988('0x39')][_0xa988('0x3b')]?_0x53f07f['attributes']:_0x2c7034[_0xa988('0x38')];if(!_0x564fa1[_0xa988('0x35')][_0xa988('0x3c')](_0xa988('0x3d'))){_0x53f07f[_0xa988('0x21')]=qs[_0xa988('0x21')](_0x564fa1[_0xa988('0x35')][_0xa988('0x21')]);_0x53f07f[_0xa988('0x1e')]=qs[_0xa988('0x1e')](_0x564fa1['query'][_0xa988('0x1e')]);}_0x53f07f[_0xa988('0x3e')]=qs[_0xa988('0x3f')](_0x564fa1[_0xa988('0x35')][_0xa988('0x3f')]);_0x53f07f[_0xa988('0x40')]=qs['filters'](_[_0xa988('0x41')](_0x564fa1[_0xa988('0x35')],_0x2c7034[_0xa988('0x42')]),_0x24bc67);if(_0x564fa1[_0xa988('0x35')][_0xa988('0x43')]){_0x53f07f[_0xa988('0x40')]=_['merge'](_0x53f07f['where'],{'$or':_[_0xa988('0x30')](_0x24bc67,function(_0x149bc3){if(_0x149bc3[_0xa988('0x33')]!==_0xa988('0x44')){var _0x4a8450={};_0x4a8450[_0x149bc3[_0xa988('0x2e')]]={'$like':'%'+_0x564fa1['query'][_0xa988('0x43')]+'%'};return _0x4a8450;}})});}_0x53f07f=_[_0xa988('0x45')]({},_0x53f07f,_0x564fa1[_0xa988('0x46')]);var _0x1bd840={'where':_0x53f07f[_0xa988('0x40')]};return db[_0xa988('0x31')][_0xa988('0x20')](_0x1bd840)['then'](function(_0x36c660){_0x41223a[_0xa988('0x20')]=_0x36c660;if(_0x564fa1[_0xa988('0x35')][_0xa988('0x47')]){_0x53f07f['include']=[{'all':!![]}];}return db['Schedule'][_0xa988('0x48')](_0x53f07f);})[_0xa988('0x27')](function(_0x3d2f06){_0x41223a[_0xa988('0x49')]=_0x3d2f06;return _0x41223a;})[_0xa988('0x27')](respondWithFilteredResult(_0x4afdaf,_0x53f07f))[_0xa988('0x4a')](handleError(_0x4afdaf,null));};exports[_0xa988('0x4b')]=function(_0x34c762,_0x652e45){var _0x1bada3={'raw':![],'where':{'id':_0x34c762['params']['id']}},_0x22420e={};_0x22420e[_0xa988('0x38')]=_[_0xa988('0x36')](db['Schedule'][_0xa988('0x4c')]);_0x22420e['query']=_[_0xa988('0x36')](_0x34c762[_0xa988('0x35')]);_0x22420e[_0xa988('0x42')]=_[_0xa988('0x37')](_0x22420e[_0xa988('0x38')],_0x22420e[_0xa988('0x35')]);_0x1bada3[_0xa988('0x39')]=_[_0xa988('0x37')](_0x22420e[_0xa988('0x38')],qs[_0xa988('0x3a')](_0x34c762[_0xa988('0x35')]['fields']));_0x1bada3[_0xa988('0x39')]=_0x1bada3[_0xa988('0x39')][_0xa988('0x3b')]?_0x1bada3[_0xa988('0x39')]:_0x22420e[_0xa988('0x38')];if(_0x34c762['query']['includeAll']){_0x1bada3[_0xa988('0x4d')]=[{'all':!![]}];}_0x1bada3=_['merge']({},_0x1bada3,_0x34c762['options']);return db[_0xa988('0x31')][_0xa988('0x4e')](_0x1bada3)[_0xa988('0x27')](handleEntityNotFound(_0x652e45,null))[_0xa988('0x27')](respondWithResult(_0x652e45,null))[_0xa988('0x4a')](handleError(_0x652e45,null));};exports[_0xa988('0x4f')]=function(_0x1c48a4,_0x4b91b3){return db[_0xa988('0x31')][_0xa988('0x4f')](_0x1c48a4['body'],{})[_0xa988('0x27')](function(_0x2a65ec){var _0x1f8080=_0x1c48a4[_0xa988('0x50')][_0xa988('0x29')]({'plain':!![]});if(!_0x1f8080)throw new Error(_0xa988('0x51'));if(_0x1f8080[_0xa988('0x52')]===_0xa988('0x50')){var _0x4c5d1e=_0x2a65ec['get']({'plain':!![]});var _0x5d228c=_0xa988('0x2a');return db[_0xa988('0x53')][_0xa988('0x4e')]({'where':{'name':_0x5d228c,'userProfileId':_0x1f8080[_0xa988('0x54')]},'raw':!![]})[_0xa988('0x27')](function(_0x281430){if(_0x281430&&_0x281430[_0xa988('0x55')]===0x0){return db[_0xa988('0x2b')]['create']({'name':_0x4c5d1e[_0xa988('0x2e')],'resourceId':_0x4c5d1e['id'],'type':_0x281430[_0xa988('0x2e')],'sectionId':_0x281430['id']},{})['then'](function(){return _0x2a65ec;});}else{return _0x2a65ec;}})['catch'](function(_0xdbfc82){logger[_0xa988('0x2c')](_0xa988('0x56'),_0xdbfc82);throw _0xdbfc82;});}return _0x2a65ec;})['then'](respondWithResult(_0x4b91b3,0xc9))[_0xa988('0x4a')](handleError(_0x4b91b3,null));};exports[_0xa988('0x26')]=function(_0x1f6c07,_0x1c9d9d){if(_0x1f6c07[_0xa988('0x57')]['id']){delete _0x1f6c07[_0xa988('0x57')]['id'];}return db[_0xa988('0x31')][_0xa988('0x4e')]({'where':{'id':_0x1f6c07[_0xa988('0x58')]['id']}})['then'](handleEntityNotFound(_0x1c9d9d,null))[_0xa988('0x27')](saveUpdates(_0x1f6c07['body'],null))[_0xa988('0x27')](respondWithResult(_0x1c9d9d,null))[_0xa988('0x4a')](handleError(_0x1c9d9d,null));};exports['destroy']=function(_0x4334a6,_0x4cd7cb){return db[_0xa988('0x31')][_0xa988('0x4e')]({'where':{'id':_0x4334a6[_0xa988('0x58')]['id']}})['then'](handleEntityNotFound(_0x4cd7cb,null))['then'](removeEntity(_0x4cd7cb,null))[_0xa988('0x4a')](handleError(_0x4cd7cb,null));};exports[_0xa988('0x59')]=function(_0x5de866,_0x559f1a,_0x5ac93f){var _0x4390e2=require(_0xa988('0x5a'));return db[_0xa988('0x31')][_0xa988('0x4e')]({'where':{'id':_0x5de866[_0xa988('0x58')]['id']},'raw':!![]})[_0xa988('0x27')](handleEntityNotFound(_0x559f1a,null))[_0xa988('0x27')](function(){_0x4390e2[_0xa988('0x59')](_0x5de866['params']['id']);})[_0xa988('0x27')](respondWithStatusCode(_0x559f1a,null))[_0xa988('0x4a')](handleError(_0x559f1a,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 986690f..0c0ae9e 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 _0x7419=['tools_schedules','lodash','util','api','bluebird','request-promise','path','rimraf','./schedule.attributes','Schedule'];(function(_0x45dbab,_0x37bb50){var _0x15ca6d=function(_0x19181d){while(--_0x19181d){_0x45dbab['push'](_0x45dbab['shift']());}};_0x15ca6d(++_0x37bb50);}(_0x7419,0xfb));var _0x9741=function(_0x171bd7,_0x388b78){_0x171bd7=_0x171bd7-0x0;var _0x2cc8d4=_0x7419[_0x171bd7];return _0x2cc8d4;};'use strict';var _=require(_0x9741('0x0'));var util=require(_0x9741('0x1'));var logger=require('../../config/logger')(_0x9741('0x2'));var moment=require('moment');var BPromise=require(_0x9741('0x3'));var rp=require(_0x9741('0x4'));var fs=require('fs');var path=require(_0x9741('0x5'));var rimraf=require(_0x9741('0x6'));var config=require('../../config/environment');var attributes=require(_0x9741('0x7'));module['exports']=function(_0x58a649,_0x56beca){return _0x58a649['define'](_0x9741('0x8'),attributes,{'tableName':_0x9741('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b4b=['moment','./schedule.attributes','exports','define','Schedule','lodash','util','../../config/logger','api'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6b4b,0xd4));var _0xb6b4=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x6b4b[_0x725b8e];return _0x43ac45;};'use strict';var _=require(_0xb6b4('0x0'));var util=require(_0xb6b4('0x1'));var logger=require(_0xb6b4('0x2'))(_0xb6b4('0x3'));var moment=require(_0xb6b4('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('../../config/environment');var attributes=require(_0xb6b4('0x5'));module[_0xb6b4('0x6')]=function(_0x571f7a,_0x583748){return _0x571f7a[_0xb6b4('0x7')](_0xb6b4('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 44b662b..dbe2199 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 _0xdb95=['Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdb95,0x131));var _0x5db9=function(_0x2c2e84,_0x4a3cc2){_0x2c2e84=_0x2c2e84-0x0;var _0x110c6b=_0xdb95[_0x2c2e84];return _0x110c6b;};'use strict';var _=require(_0x5db9('0x0'));var util=require(_0x5db9('0x1'));var moment=require(_0x5db9('0x2'));var BPromise=require(_0x5db9('0x3'));var rs=require(_0x5db9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5db9('0x5'));var logger=require(_0x5db9('0x6'))(_0x5db9('0x7'));var config=require('../../config/environment');var jayson=require(_0x5db9('0x8'));var client=jayson[_0x5db9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13bec3,_0x391dd8,_0x472ec5){return new BPromise(function(_0x6e06f1,_0x29af9b){return client[_0x5db9('0xa')](_0x13bec3,_0x472ec5)['then'](function(_0x115bc4){logger[_0x5db9('0xb')](_0x5db9('0xc'),_0x391dd8,_0x5db9('0xd'));logger[_0x5db9('0xe')](_0x5db9('0xf'),_0x391dd8,_0x5db9('0xd'),JSON[_0x5db9('0x10')](_0x115bc4));if(_0x115bc4['error']){if(_0x115bc4[_0x5db9('0x11')]['code']===0x1f4){logger[_0x5db9('0x11')]('Schedule,\x20%s,\x20%s',_0x391dd8,_0x115bc4['error']['message']);return _0x29af9b(_0x115bc4[_0x5db9('0x11')]['message']);}logger[_0x5db9('0x11')]('Schedule,\x20%s,\x20%s',_0x391dd8,_0x115bc4[_0x5db9('0x11')][_0x5db9('0x12')]);return _0x6e06f1(_0x115bc4['error'][_0x5db9('0x12')]);}else{logger[_0x5db9('0xb')](_0x5db9('0xc'),_0x391dd8,_0x5db9('0xd'));_0x6e06f1(_0x115bc4['result'][_0x5db9('0x12')]);}})[_0x5db9('0x13')](function(_0x31df29){logger[_0x5db9('0x11')](_0x5db9('0xc'),_0x391dd8,_0x31df29);_0x29af9b(_0x31df29);});});} \ No newline at end of file +var _0xb26a=['stringify','error','code','message','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xb26a,0x1bf));var _0xab26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb26a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xab26('0x0'));var util=require(_0xab26('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xab26('0x2'));var db=require(_0xab26('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xab26('0x4'))(_0xab26('0x5'));var config=require(_0xab26('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xab26('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x572d84,_0x2f76ce,_0x3cd7ab){return new BPromise(function(_0x44cea6,_0x34245f){return client[_0xab26('0x8')](_0x572d84,_0x3cd7ab)[_0xab26('0x9')](function(_0x9bb3f3){logger[_0xab26('0xa')](_0xab26('0xb'),_0x2f76ce,_0xab26('0xc'));logger[_0xab26('0xd')](_0xab26('0xe'),_0x2f76ce,_0xab26('0xc'),JSON[_0xab26('0xf')](_0x9bb3f3));if(_0x9bb3f3[_0xab26('0x10')]){if(_0x9bb3f3[_0xab26('0x10')][_0xab26('0x11')]===0x1f4){logger[_0xab26('0x10')](_0xab26('0xb'),_0x2f76ce,_0x9bb3f3['error'][_0xab26('0x12')]);return _0x34245f(_0x9bb3f3[_0xab26('0x10')][_0xab26('0x12')]);}logger['error'](_0xab26('0xb'),_0x2f76ce,_0x9bb3f3['error'][_0xab26('0x12')]);return _0x44cea6(_0x9bb3f3[_0xab26('0x10')][_0xab26('0x12')]);}else{logger[_0xab26('0xa')]('Schedule,\x20%s,\x20%s',_0x2f76ce,_0xab26('0xc'));_0x44cea6(_0x9bb3f3[_0xab26('0x13')]['message']);}})[_0xab26('0x14')](function(_0x56aa1b){logger[_0xab26('0x10')](_0xab26('0xb'),_0x2f76ce,_0x56aa1b);_0x34245f(_0x56aa1b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index d8963c7..65d076b 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 _0xf8e1=['get','index','/describe','isAuthenticated','describe','show','/:id/download','download','post','create','put','/:id','update','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller'];(function(_0x334f9a,_0x542f01){var _0x2b219d=function(_0x25bb3e){while(--_0x25bb3e){_0x334f9a['push'](_0x334f9a['shift']());}};_0x2b219d(++_0x542f01);}(_0xf8e1,0x167));var _0x1f8e=function(_0x42bc01,_0x4411c3){_0x42bc01=_0x42bc01-0x0;var _0x2848f1=_0xf8e1[_0x42bc01];return _0x2848f1;};'use strict';var multer=require(_0x1f8e('0x0'));var util=require(_0x1f8e('0x1'));var path=require(_0x1f8e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1f8e('0x3')]();var fs_extra=require(_0x1f8e('0x4'));var auth=require(_0x1f8e('0x5'));var interaction=require(_0x1f8e('0x6'));var config=require(_0x1f8e('0x7'));var controller=require(_0x1f8e('0x8'));router[_0x1f8e('0x9')]('/',auth['isAuthenticated'](),controller[_0x1f8e('0xa')]);router[_0x1f8e('0x9')](_0x1f8e('0xb'),auth[_0x1f8e('0xc')](),controller[_0x1f8e('0xd')]);router[_0x1f8e('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1f8e('0xe')]);router['get'](_0x1f8e('0xf'),auth['isAuthenticated'](),controller[_0x1f8e('0x10')]);router[_0x1f8e('0x11')]('/',auth['isAuthenticated'](),controller[_0x1f8e('0x12')]);router[_0x1f8e('0x13')](_0x1f8e('0x14'),auth[_0x1f8e('0xc')](),controller[_0x1f8e('0x15')]);router['delete'](_0x1f8e('0x14'),auth[_0x1f8e('0xc')](),controller['destroy']);module[_0x1f8e('0x16')]=router; \ No newline at end of file +var _0x4869=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','show','download','post'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x4869,0x165));var _0x9486=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x4869[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require(_0x9486('0x0'));var path=require(_0x9486('0x1'));var timeout=require(_0x9486('0x2'));var express=require(_0x9486('0x3'));var router=express[_0x9486('0x4')]();var fs_extra=require(_0x9486('0x5'));var auth=require(_0x9486('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x9486('0x7'));var controller=require(_0x9486('0x8'));router[_0x9486('0x9')]('/',auth[_0x9486('0xa')](),controller[_0x9486('0xb')]);router[_0x9486('0x9')]('/describe',auth[_0x9486('0xa')](),controller[_0x9486('0xc')]);router[_0x9486('0x9')](_0x9486('0xd'),auth[_0x9486('0xa')](),controller[_0x9486('0xe')]);router[_0x9486('0x9')]('/:id/download',auth[_0x9486('0xa')](),controller[_0x9486('0xf')]);router[_0x9486('0x10')]('/',auth[_0x9486('0xa')](),controller[_0x9486('0x11')]);router[_0x9486('0x12')](_0x9486('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x9486('0x13')](_0x9486('0xd'),auth[_0x9486('0xa')](),controller[_0x9486('0x14')]);module[_0x9486('0x15')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index a9a91ca..9cf2593 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 _0x9a2a=['DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration'];(function(_0x69c7ab,_0x674f04){var _0x482d87=function(_0x3e57e2){while(--_0x3e57e2){_0x69c7ab['push'](_0x69c7ab['shift']());}};_0x482d87(++_0x674f04);}(_0x9a2a,0xa7));var _0xa9a2=function(_0x479f6f,_0x1c26c4){_0x479f6f=_0x479f6f-0x0;var _0x24e701=_0x9a2a[_0x479f6f];return _0x24e701;};'use strict';var Sequelize=require(_0xa9a2('0x0'));var moment=require(_0xa9a2('0x1'));var path=require(_0xa9a2('0x2'));var config=require('../../config/environment');module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xa9a2('0x3')](_0xa9a2('0x4'))?path[_0xa9a2('0x5')](this[_0xa9a2('0x3')](_0xa9a2('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xa9a2('0x6')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x388689){var _0xb51739=_0x388689[_0xa9a2('0x7')](/\\/g,'/');this[_0xa9a2('0x8')](_0xa9a2('0x4'),_0xb51739);}},'rating':{'type':Sequelize[_0xa9a2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xa9a2('0x9')],'set':function(_0x26f1ce){this[_0xa9a2('0x8')]('startedAt',moment()[_0xa9a2('0xa')](_0x26f1ce,'ms'));this[_0xa9a2('0x8')](_0xa9a2('0xb'),moment());this[_0xa9a2('0x8')](_0xa9a2('0xc'),_0x26f1ce);}},'startedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0xe')))[_0xa9a2('0xf')](_0xa9a2('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0xb')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}},'createdAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this[_0xa9a2('0x3')](_0xa9a2('0x12')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}},'updatedAt':{'type':Sequelize[_0xa9a2('0xd')],'get':function(){return moment(this['getDataValue'](_0xa9a2('0x13')))[_0xa9a2('0xf')](_0xa9a2('0x10'))[_0xa9a2('0x11')]();}}}; \ No newline at end of file +var _0xcd2f=['updatedAt','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','subtract','closedAt','duration','toString','DATE','format','createdAt','MM-DD-YYYY\x20HH:mm'];(function(_0x194da8,_0x410245){var _0x335389=function(_0x57ca58){while(--_0x57ca58){_0x194da8['push'](_0x194da8['shift']());}};_0x335389(++_0x410245);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcd2f[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');var path=require('path');var config=require(_0xfcd2('0x0'));module[_0xfcd2('0x1')]={'format':{'type':Sequelize[_0xfcd2('0x2')],'get':function(){return this[_0xfcd2('0x3')](_0xfcd2('0x4'))?path[_0xfcd2('0x5')](this[_0xfcd2('0x3')](_0xfcd2('0x4'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xfcd2('0x6')]},'value':{'type':Sequelize[_0xfcd2('0x6')],'set':function(_0x41e836){var _0x20ac59=_0x41e836[_0xfcd2('0x7')](/\\/g,'/');this[_0xfcd2('0x8')](_0xfcd2('0x4'),_0x20ac59);}},'rating':{'type':Sequelize[_0xfcd2('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xfcd2('0x9')],'set':function(_0x358fb4){this[_0xfcd2('0x8')]('startedAt',moment()[_0xfcd2('0xa')](_0x358fb4,'ms'));this[_0xfcd2('0x8')](_0xfcd2('0xb'),moment());this[_0xfcd2('0x8')](_0xfcd2('0xc'),_0x358fb4);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this['getDataValue']('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')[_0xfcd2('0xd')]();}},'closedAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this['getDataValue'](_0xfcd2('0xb')))[_0xfcd2('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'createdAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this[_0xfcd2('0x3')](_0xfcd2('0x10')))[_0xfcd2('0xf')](_0xfcd2('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xfcd2('0xe')],'get':function(){return moment(this[_0xfcd2('0x3')](_0xfcd2('0x12')))[_0xfcd2('0xf')](_0xfcd2('0x11'))[_0xfcd2('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 295ae77..863a1dd 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 _0x9c5a=['ScreenRecording','includeAll','findAll','rows','catch','params','include','find','create','body','duration','createdAt','closedAt','value','describe','download','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','recording','existsSync','Sequelize','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','stack','name','send','map','rawAttributes','fieldName','key','model','format','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x5ba5d9,_0x7e4ea2){_0x5ba5d9=_0x5ba5d9-0x0;var _0x34854a=_0x9c5a[_0x5ba5d9];return _0x34854a;};'use strict';var emlformat=require(_0xa9c5('0x0'));var rimraf=require(_0xa9c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa9c5('0x2'));var rp=require(_0xa9c5('0x3'));var moment=require(_0xa9c5('0x4'));var BPromise=require(_0xa9c5('0x5'));var Mustache=require('mustache');var util=require(_0xa9c5('0x6'));var path=require(_0xa9c5('0x7'));var sox=require('sox');var csv=require(_0xa9c5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa9c5('0x9'));var _=require(_0xa9c5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa9c5('0xb'));var deskjs=require(_0xa9c5('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa9c5('0xd'));var Papa=require(_0xa9c5('0xe'));var Redis=require('ioredis');var authService=require(_0xa9c5('0xf'));var qs=require(_0xa9c5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa9c5('0x11'))(_0xa9c5('0x12'));var utils=require(_0xa9c5('0x13'));var config=require(_0xa9c5('0x14'));var licenseUtil=require(_0xa9c5('0x15'));var db=require(_0xa9c5('0x16'))['db'];function respondWithStatusCode(_0x51c8d,_0x42d5cf){_0x42d5cf=_0x42d5cf||0xcc;return function(_0x3c5ac7){if(_0x3c5ac7){return _0x51c8d[_0xa9c5('0x17')](_0x42d5cf);}return _0x51c8d['status'](_0x42d5cf)[_0xa9c5('0x18')]();};}function respondWithResult(_0x1276d2,_0x7df76d){_0x7df76d=_0x7df76d||0xc8;return function(_0x3806c4){if(_0x3806c4){return _0x1276d2[_0xa9c5('0x19')](_0x7df76d)[_0xa9c5('0x1a')](_0x3806c4);}};}function respondWithFilteredResult(_0x251099,_0x40b001){return function(_0x19a43e){if(_0x19a43e){var _0xcf13f2=typeof _0x40b001['offset']===_0xa9c5('0x1b')&&typeof _0x40b001[_0xa9c5('0x1c')]===_0xa9c5('0x1b');var _0x55cce5=_0x19a43e[_0xa9c5('0x1d')];var _0x1142d9=_0xcf13f2?0x0:_0x40b001[_0xa9c5('0x1e')];var _0x3b8cf7=_0xcf13f2?_0x19a43e[_0xa9c5('0x1d')]:_0x40b001[_0xa9c5('0x1e')]+_0x40b001[_0xa9c5('0x1c')];var _0x1e5ce6;if(_0x3b8cf7>=_0x55cce5){_0x3b8cf7=_0x55cce5;_0x1e5ce6=0xc8;}else{_0x1e5ce6=0xce;}_0x251099[_0xa9c5('0x19')](_0x1e5ce6);return _0x251099[_0xa9c5('0x1f')](_0xa9c5('0x20'),_0x1142d9+'-'+_0x3b8cf7+'/'+_0x55cce5)[_0xa9c5('0x1a')](_0x19a43e);}return null;};}function patchUpdates(_0x54f8b9){return function(_0x1115ad){try{jsonpatch[_0xa9c5('0x21')](_0x1115ad,_0x54f8b9,!![]);}catch(_0x541c77){return BPromise['reject'](_0x541c77);}return _0x1115ad[_0xa9c5('0x22')]();};}function saveUpdates(_0x366f5c,_0x10b208){return function(_0x3b497a){if(_0x3b497a){return _0x3b497a[_0xa9c5('0x23')](_0x366f5c)[_0xa9c5('0x24')](function(_0x48e2cb){return _0x48e2cb;});}return null;};}function removeEntity(_0x4fa280,_0x3d4e1b){return function(_0x11d395){if(_0x11d395){return _0x11d395['destroy']()[_0xa9c5('0x24')](function(){_0x4fa280[_0xa9c5('0x19')](0xcc)[_0xa9c5('0x18')]();});}};}function handleEntityNotFound(_0x32fc7d,_0x4cbba1){return function(_0x40f08b){if(!_0x40f08b){_0x32fc7d[_0xa9c5('0x17')](0x194);}return _0x40f08b;};}function handleError(_0x51b64a,_0x4e8a7f){_0x4e8a7f=_0x4e8a7f||0x1f4;return function(_0x242771){logger['error'](_0x242771[_0xa9c5('0x25')]);if(_0x242771[_0xa9c5('0x26')]){delete _0x242771['name'];}_0x51b64a[_0xa9c5('0x19')](_0x4e8a7f)[_0xa9c5('0x27')](_0x242771);};}exports['index']=function(_0x413edf,_0x32baf9){var _0x198cdf={},_0x185eb8={},_0x325c65={'count':0x0,'rows':[]};var _0x4f6e70=_[_0xa9c5('0x28')](db['ScreenRecording'][_0xa9c5('0x29')],function(_0x1ef388){return{'name':_0x1ef388[_0xa9c5('0x2a')],'type':_0x1ef388['type'][_0xa9c5('0x2b')]};});_0x185eb8[_0xa9c5('0x2c')]=_['differenceBy'](_[_0xa9c5('0x28')](_0x4f6e70,_0xa9c5('0x26')),[_0xa9c5('0x2d')]);_0x185eb8[_0xa9c5('0x2e')]=_[_0xa9c5('0x2f')](_0x413edf[_0xa9c5('0x2e')]);_0x185eb8[_0xa9c5('0x30')]=_['intersection'](_0x185eb8[_0xa9c5('0x2c')],_0x185eb8[_0xa9c5('0x2e')]);_0x198cdf[_0xa9c5('0x31')]=_[_0xa9c5('0x32')](_0x185eb8[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x33')]));_0x198cdf['attributes']=_0x198cdf['attributes'][_0xa9c5('0x34')]?_0x198cdf[_0xa9c5('0x31')]:_0x185eb8[_0xa9c5('0x2c')];if(!_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x35')](_0xa9c5('0x36'))){_0x198cdf['limit']=qs['limit'](_0x413edf['query'][_0xa9c5('0x1c')]);_0x198cdf[_0xa9c5('0x1e')]=qs['offset'](_0x413edf[_0xa9c5('0x2e')]['offset']);}_0x198cdf[_0xa9c5('0x37')]=qs[_0xa9c5('0x38')](_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x38')]);_0x198cdf['where']=qs[_0xa9c5('0x30')](_[_0xa9c5('0x39')](_0x413edf[_0xa9c5('0x2e')],_0x185eb8[_0xa9c5('0x30')]),_0x4f6e70);if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x3a')]){_0x198cdf[_0xa9c5('0x3b')]=_[_0xa9c5('0x3c')](_0x198cdf['where'],{'$or':_[_0xa9c5('0x28')](_0x4f6e70,function(_0x46e5d2){if(_0x46e5d2[_0xa9c5('0x3d')]!==_0xa9c5('0x3e')){var _0x1132e0={};_0x1132e0[_0x46e5d2[_0xa9c5('0x26')]]={'$like':'%'+_0x413edf['query'][_0xa9c5('0x3a')]+'%'};return _0x1132e0;}})});}_0x198cdf=_['merge']({},_0x198cdf,_0x413edf[_0xa9c5('0x3f')]);var _0x5c89e7={'where':_0x198cdf[_0xa9c5('0x3b')]};return db[_0xa9c5('0x40')][_0xa9c5('0x1d')](_0x5c89e7)['then'](function(_0x12e19c){_0x325c65[_0xa9c5('0x1d')]=_0x12e19c;if(_0x413edf[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x198cdf['include']=[{'all':!![]}];}return db[_0xa9c5('0x40')][_0xa9c5('0x42')](_0x198cdf);})[_0xa9c5('0x24')](function(_0x45668e){_0x325c65[_0xa9c5('0x43')]=_0x45668e;return _0x325c65;})['then'](respondWithFilteredResult(_0x32baf9,_0x198cdf))[_0xa9c5('0x44')](handleError(_0x32baf9,null));};exports['show']=function(_0x1de605,_0x397614){var _0x2998ad={'raw':![],'where':{'id':_0x1de605[_0xa9c5('0x45')]['id']}},_0xc8fca4={};_0xc8fca4[_0xa9c5('0x2c')]=_[_0xa9c5('0x2f')](db[_0xa9c5('0x40')][_0xa9c5('0x29')]);_0xc8fca4[_0xa9c5('0x2e')]=_['keys'](_0x1de605[_0xa9c5('0x2e')]);_0xc8fca4[_0xa9c5('0x30')]=_[_0xa9c5('0x32')](_0xc8fca4[_0xa9c5('0x2c')],_0xc8fca4[_0xa9c5('0x2e')]);_0x2998ad[_0xa9c5('0x31')]=_['intersection'](_0xc8fca4[_0xa9c5('0x2c')],qs[_0xa9c5('0x33')](_0x1de605['query']['fields']));_0x2998ad['attributes']=_0x2998ad['attributes']['length']?_0x2998ad[_0xa9c5('0x31')]:_0xc8fca4[_0xa9c5('0x2c')];if(_0x1de605[_0xa9c5('0x2e')][_0xa9c5('0x41')]){_0x2998ad[_0xa9c5('0x46')]=[{'all':!![]}];}_0x2998ad=_[_0xa9c5('0x3c')]({},_0x2998ad,_0x1de605[_0xa9c5('0x3f')]);return db[_0xa9c5('0x40')][_0xa9c5('0x47')](_0x2998ad)[_0xa9c5('0x24')](handleEntityNotFound(_0x397614,null))[_0xa9c5('0x24')](respondWithResult(_0x397614,null))[_0xa9c5('0x44')](handleError(_0x397614,null));};exports[_0xa9c5('0x48')]=function(_0x4bf8b4,_0x1108f0){return db['ScreenRecording'][_0xa9c5('0x48')](_0x4bf8b4[_0xa9c5('0x49')],{})['then'](respondWithResult(_0x1108f0,0xc9))['catch'](handleError(_0x1108f0,null));};exports[_0xa9c5('0x23')]=function(_0x32e64a,_0xeb0720){if(_0x32e64a['body']['id']){delete _0x32e64a['body']['id'];}delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4a')];delete _0x32e64a['body'][_0xa9c5('0x4b')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4c')];delete _0x32e64a[_0xa9c5('0x49')][_0xa9c5('0x4d')];return db[_0xa9c5('0x40')]['find']({'where':{'id':_0x32e64a['params']['id']}})['then'](handleEntityNotFound(_0xeb0720,null))[_0xa9c5('0x24')](saveUpdates(_0x32e64a[_0xa9c5('0x49')],null))[_0xa9c5('0x24')](respondWithResult(_0xeb0720,null))[_0xa9c5('0x44')](handleError(_0xeb0720,null));};exports[_0xa9c5('0x4e')]=function(_0x15d044,_0x56bc1d){return db[_0xa9c5('0x40')][_0xa9c5('0x4e')]()[_0xa9c5('0x24')](respondWithResult(_0x56bc1d,null))[_0xa9c5('0x44')](handleError(_0x56bc1d,null));};exports[_0xa9c5('0x4f')]=function(_0x242e8a,_0x547654,_0x4fcc44){var _0x10ff6b=require('../../components/encryptor');var _0x1b158f=![];var _0x5ea9b0={};if(_0x242e8a[_0xa9c5('0x2e')][_0xa9c5('0x3d')]&&_0x242e8a[_0xa9c5('0x2e')]['type']===_0xa9c5('0x50')){_0x5ea9b0[_0xa9c5('0x50')]=_0x242e8a[_0xa9c5('0x45')]['id'];}else{_0x5ea9b0['id']=_0x242e8a[_0xa9c5('0x45')]['id'];}return db['ScreenRecording']['find']({'where':_0x5ea9b0,'attributes':['id',_0xa9c5('0x4d')],'raw':!![]})[_0xa9c5('0x24')](handleEntityNotFound(_0x547654,null))[_0xa9c5('0x24')](function(_0x5b4323){if(_0x5b4323){var _0x31e12e=path[_0xa9c5('0x51')](config[_0xa9c5('0x52')],_0xa9c5('0x53'),_0x5b4323[_0xa9c5('0x4d')]);var _0x29b198=util[_0xa9c5('0x2d')](_0xa9c5('0x54'),_0x31e12e);if(fs['existsSync'](_0x29b198)){_0x1b158f=!![];return _0x10ff6b[_0xa9c5('0x55')](_0x29b198,_0x31e12e,config['secrets'][_0xa9c5('0x56')])[_0xa9c5('0x24')](function(){return _0x5b4323;});}return _0x5b4323;}})[_0xa9c5('0x24')](function(_0x4dfe3a){if(_0x4dfe3a){var _0x4d475a=path[_0xa9c5('0x51')](config['root'],_0xa9c5('0x53'),_0x4dfe3a[_0xa9c5('0x4d')]);if(!fs[_0xa9c5('0x57')](_0x4d475a)){throw new db[(_0xa9c5('0x58'))]['ValidationError'](_0xa9c5('0x59'));}if(_0x4dfe3a[_0xa9c5('0x5a')]){return _0x547654[_0xa9c5('0x4f')](_0x4d475a,_0x4dfe3a[_0xa9c5('0x5a')]+path['extname'](_0x4d475a),function(){if(_0x1b158f){fs['unlink'](_0x4d475a);}});}else{return _0x547654[_0xa9c5('0x4f')](_0x4d475a,function(_0x3deb64){if(_0x1b158f){fs[_0xa9c5('0x5b')](_0x4d475a);}});}}})[_0xa9c5('0x44')](function(_0x279a26){if(_0x279a26[_0xa9c5('0x5c')]==='ScreenRecording\x20not\x20found'){_0x547654[_0xa9c5('0x19')](0x194)[_0xa9c5('0x27')](_0xa9c5('0x5d'));}else{return handleError(_0x547654,null);}});};exports[_0xa9c5('0x5e')]=function(_0x2b8575,_0x372ab9){return db[_0xa9c5('0x40')][_0xa9c5('0x47')]({'where':{'id':_0x2b8575[_0xa9c5('0x45')]['id']}})[_0xa9c5('0x24')](function(_0x50d438){if(_['isNil'](_0x50d438)){throw new ReferenceError(_0xa9c5('0x5f'));}return _0x50d438;})[_0xa9c5('0x24')](function(_0x3322cc){var _0x47afaa=path['join'](config[_0xa9c5('0x52')],'server/files/screen_recordings',_0x3322cc[_0xa9c5('0x4d')]);logger[_0xa9c5('0x60')](_0xa9c5('0x61'),_0x47afaa);if(!_[_0xa9c5('0x62')](_0x3322cc[_0xa9c5('0x4d')])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}_0x47afaa=_0x47afaa+_0xa9c5('0x66');if(!_[_0xa9c5('0x62')](_0x3322cc['value'])&&fs[_0xa9c5('0x57')](_0x47afaa)){logger[_0xa9c5('0x60')](_0xa9c5('0x63')+_0x47afaa+_0xa9c5('0x64'));fs[_0xa9c5('0x65')](_0x47afaa);}return _0x3322cc;})[_0xa9c5('0x24')](function(_0x28ba54){if(!_0x28ba54)throw new InternalError();return _0x28ba54['destroy']();})['then'](function(){_0x372ab9[_0xa9c5('0x19')](0xcc)['end']();})[_0xa9c5('0x44')](handleError(_0x372ab9,null));}; \ No newline at end of file +var _0xd6d6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','include','findAll','catch','find','create','body','duration','createdAt','closedAt','value','params','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','Entity\x20not\x20found','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','isNil','File:\x20\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4636d1,_0x26c189){var _0x312a80=function(_0x4c3440){while(--_0x4c3440){_0x4636d1['push'](_0x4636d1['shift']());}};_0x312a80(++_0x26c189);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x27a277,_0x202d47){_0x27a277=_0x27a277-0x0;var _0x2cad3c=_0xd6d6[_0x27a277];return _0x2cad3c;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];function respondWithStatusCode(_0x32146d,_0xe61c36){_0xe61c36=_0xe61c36||0xcc;return function(_0x3f8542){if(_0x3f8542){return _0x32146d[_0x6d6d('0x19')](_0xe61c36);}return _0x32146d[_0x6d6d('0x1a')](_0xe61c36)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x2cb2dd,_0x5f4154){_0x5f4154=_0x5f4154||0xc8;return function(_0xd09ea7){if(_0xd09ea7){return _0x2cb2dd[_0x6d6d('0x1a')](_0x5f4154)[_0x6d6d('0x1c')](_0xd09ea7);}};}function respondWithFilteredResult(_0xa3b05d,_0x29cbd8){return function(_0x5d80c0){if(_0x5d80c0){var _0x2e6fdb=typeof _0x29cbd8['offset']===_0x6d6d('0x1d')&&typeof _0x29cbd8[_0x6d6d('0x1e')]===_0x6d6d('0x1d');var _0x4bb3d1=_0x5d80c0['count'];var _0x9e1e18=_0x2e6fdb?0x0:_0x29cbd8[_0x6d6d('0x1f')];var _0x2b59d4=_0x2e6fdb?_0x5d80c0[_0x6d6d('0x20')]:_0x29cbd8['offset']+_0x29cbd8['limit'];var _0x474873;if(_0x2b59d4>=_0x4bb3d1){_0x2b59d4=_0x4bb3d1;_0x474873=0xc8;}else{_0x474873=0xce;}_0xa3b05d['status'](_0x474873);return _0xa3b05d[_0x6d6d('0x21')](_0x6d6d('0x22'),_0x9e1e18+'-'+_0x2b59d4+'/'+_0x4bb3d1)[_0x6d6d('0x1c')](_0x5d80c0);}return null;};}function patchUpdates(_0x450352){return function(_0x40d35b){try{jsonpatch[_0x6d6d('0x23')](_0x40d35b,_0x450352,!![]);}catch(_0x164c67){return BPromise[_0x6d6d('0x24')](_0x164c67);}return _0x40d35b[_0x6d6d('0x25')]();};}function saveUpdates(_0x6f64e3,_0x24b10d){return function(_0x6e58e3){if(_0x6e58e3){return _0x6e58e3[_0x6d6d('0x26')](_0x6f64e3)[_0x6d6d('0x27')](function(_0x1f7f88){return _0x1f7f88;});}return null;};}function removeEntity(_0x25a02e,_0xced622){return function(_0x583b10){if(_0x583b10){return _0x583b10[_0x6d6d('0x28')]()[_0x6d6d('0x27')](function(){_0x25a02e[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0xf0df7f,_0x12fab2){return function(_0x554f8e){if(!_0x554f8e){_0xf0df7f[_0x6d6d('0x19')](0x194);}return _0x554f8e;};}function handleError(_0x2b5e31,_0x235451){_0x235451=_0x235451||0x1f4;return function(_0x126ac8){logger[_0x6d6d('0x29')](_0x126ac8[_0x6d6d('0x2a')]);if(_0x126ac8[_0x6d6d('0x2b')]){delete _0x126ac8['name'];}_0x2b5e31[_0x6d6d('0x1a')](_0x235451)[_0x6d6d('0x2c')](_0x126ac8);};}exports['index']=function(_0x553645,_0x3edcce){var _0x5273cd={},_0x8a9a84={},_0x57341f={'count':0x0,'rows':[]};var _0xde3272=_[_0x6d6d('0x2d')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')],function(_0x64d1f7){return{'name':_0x64d1f7[_0x6d6d('0x30')],'type':_0x64d1f7[_0x6d6d('0x31')][_0x6d6d('0x32')]};});_0x8a9a84[_0x6d6d('0x33')]=_[_0x6d6d('0x34')](_['map'](_0xde3272,_0x6d6d('0x2b')),['format']);_0x8a9a84[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x553645[_0x6d6d('0x35')]);_0x8a9a84[_0x6d6d('0x37')]=_['intersection'](_0x8a9a84[_0x6d6d('0x33')],_0x8a9a84['query']);_0x5273cd[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x8a9a84['model'],qs[_0x6d6d('0x3a')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3a')]));_0x5273cd[_0x6d6d('0x38')]=_0x5273cd[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x5273cd[_0x6d6d('0x38')]:_0x8a9a84[_0x6d6d('0x33')];if(!_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3c')](_0x6d6d('0x3d'))){_0x5273cd[_0x6d6d('0x1e')]=qs[_0x6d6d('0x1e')](_0x553645[_0x6d6d('0x35')]['limit']);_0x5273cd[_0x6d6d('0x1f')]=qs[_0x6d6d('0x1f')](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x1f')]);}_0x5273cd['order']=qs['sort'](_0x553645[_0x6d6d('0x35')][_0x6d6d('0x3e')]);_0x5273cd[_0x6d6d('0x3f')]=qs['filters'](_[_0x6d6d('0x40')](_0x553645[_0x6d6d('0x35')],_0x8a9a84[_0x6d6d('0x37')]),_0xde3272);if(_0x553645[_0x6d6d('0x35')]['filter']){_0x5273cd['where']=_['merge'](_0x5273cd[_0x6d6d('0x3f')],{'$or':_[_0x6d6d('0x2d')](_0xde3272,function(_0x33c8f2){if(_0x33c8f2[_0x6d6d('0x31')]!=='VIRTUAL'){var _0x253416={};_0x253416[_0x33c8f2[_0x6d6d('0x2b')]]={'$like':'%'+_0x553645[_0x6d6d('0x35')][_0x6d6d('0x41')]+'%'};return _0x253416;}})});}_0x5273cd=_[_0x6d6d('0x42')]({},_0x5273cd,_0x553645[_0x6d6d('0x43')]);var _0x4b457d={'where':_0x5273cd[_0x6d6d('0x3f')]};return db[_0x6d6d('0x2e')][_0x6d6d('0x20')](_0x4b457d)[_0x6d6d('0x27')](function(_0x32275b){_0x57341f[_0x6d6d('0x20')]=_0x32275b;if(_0x553645[_0x6d6d('0x35')]['includeAll']){_0x5273cd[_0x6d6d('0x44')]=[{'all':!![]}];}return db[_0x6d6d('0x2e')][_0x6d6d('0x45')](_0x5273cd);})[_0x6d6d('0x27')](function(_0xe1aa77){_0x57341f['rows']=_0xe1aa77;return _0x57341f;})[_0x6d6d('0x27')](respondWithFilteredResult(_0x3edcce,_0x5273cd))[_0x6d6d('0x46')](handleError(_0x3edcce,null));};exports['show']=function(_0x452de2,_0x50dc17){var _0x15bf62={'raw':![],'where':{'id':_0x452de2['params']['id']}},_0x43c03c={};_0x43c03c[_0x6d6d('0x33')]=_[_0x6d6d('0x36')](db[_0x6d6d('0x2e')][_0x6d6d('0x2f')]);_0x43c03c[_0x6d6d('0x35')]=_['keys'](_0x452de2['query']);_0x43c03c[_0x6d6d('0x37')]=_['intersection'](_0x43c03c['model'],_0x43c03c[_0x6d6d('0x35')]);_0x15bf62[_0x6d6d('0x38')]=_[_0x6d6d('0x39')](_0x43c03c['model'],qs[_0x6d6d('0x3a')](_0x452de2['query'][_0x6d6d('0x3a')]));_0x15bf62[_0x6d6d('0x38')]=_0x15bf62[_0x6d6d('0x38')][_0x6d6d('0x3b')]?_0x15bf62[_0x6d6d('0x38')]:_0x43c03c[_0x6d6d('0x33')];if(_0x452de2[_0x6d6d('0x35')]['includeAll']){_0x15bf62[_0x6d6d('0x44')]=[{'all':!![]}];}_0x15bf62=_[_0x6d6d('0x42')]({},_0x15bf62,_0x452de2[_0x6d6d('0x43')]);return db[_0x6d6d('0x2e')][_0x6d6d('0x47')](_0x15bf62)[_0x6d6d('0x27')](handleEntityNotFound(_0x50dc17,null))[_0x6d6d('0x27')](respondWithResult(_0x50dc17,null))[_0x6d6d('0x46')](handleError(_0x50dc17,null));};exports[_0x6d6d('0x48')]=function(_0x5e4c04,_0x4d78bb){return db[_0x6d6d('0x2e')][_0x6d6d('0x48')](_0x5e4c04[_0x6d6d('0x49')],{})[_0x6d6d('0x27')](respondWithResult(_0x4d78bb,0xc9))[_0x6d6d('0x46')](handleError(_0x4d78bb,null));};exports['update']=function(_0x47170d,_0x27b396){if(_0x47170d[_0x6d6d('0x49')]['id']){delete _0x47170d[_0x6d6d('0x49')]['id'];}delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4a')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4b')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4c')];delete _0x47170d[_0x6d6d('0x49')][_0x6d6d('0x4d')];return db['ScreenRecording'][_0x6d6d('0x47')]({'where':{'id':_0x47170d[_0x6d6d('0x4e')]['id']}})[_0x6d6d('0x27')](handleEntityNotFound(_0x27b396,null))[_0x6d6d('0x27')](saveUpdates(_0x47170d[_0x6d6d('0x49')],null))['then'](respondWithResult(_0x27b396,null))[_0x6d6d('0x46')](handleError(_0x27b396,null));};exports[_0x6d6d('0x4f')]=function(_0x45340b,_0x4e4c3e){return db['ScreenRecording'][_0x6d6d('0x4f')]()['then'](respondWithResult(_0x4e4c3e,null))[_0x6d6d('0x46')](handleError(_0x4e4c3e,null));};exports[_0x6d6d('0x50')]=function(_0x32aaae,_0x268361,_0x4777a5){var _0x18e2de=require(_0x6d6d('0x51'));var _0x26c23a=![];var _0x1a8f33={};if(_0x32aaae[_0x6d6d('0x35')]['type']&&_0x32aaae[_0x6d6d('0x35')][_0x6d6d('0x31')]===_0x6d6d('0x52')){_0x1a8f33[_0x6d6d('0x52')]=_0x32aaae[_0x6d6d('0x4e')]['id'];}else{_0x1a8f33['id']=_0x32aaae[_0x6d6d('0x4e')]['id'];}return db[_0x6d6d('0x2e')]['find']({'where':_0x1a8f33,'attributes':['id','value'],'raw':!![]})[_0x6d6d('0x27')](handleEntityNotFound(_0x268361,null))[_0x6d6d('0x27')](function(_0x5cc644){if(_0x5cc644){var _0x3e98a0=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x5cc644[_0x6d6d('0x4d')]);var _0xc6b96e=util[_0x6d6d('0x56')](_0x6d6d('0x57'),_0x3e98a0);if(fs[_0x6d6d('0x58')](_0xc6b96e)){_0x26c23a=!![];return _0x18e2de[_0x6d6d('0x59')](_0xc6b96e,_0x3e98a0,config[_0x6d6d('0x5a')][_0x6d6d('0x5b')])[_0x6d6d('0x27')](function(){return _0x5cc644;});}return _0x5cc644;}})[_0x6d6d('0x27')](function(_0x3065ea){if(_0x3065ea){var _0x50d8dd=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],'server/files/screen_recordings',_0x3065ea[_0x6d6d('0x4d')]);if(!fs[_0x6d6d('0x58')](_0x50d8dd)){throw new db[(_0x6d6d('0x5c'))][(_0x6d6d('0x5d'))](_0x6d6d('0x5e'));}if(_0x3065ea[_0x6d6d('0x5f')]){return _0x268361[_0x6d6d('0x50')](_0x50d8dd,_0x3065ea[_0x6d6d('0x5f')]+path[_0x6d6d('0x60')](_0x50d8dd),function(){if(_0x26c23a){fs['unlink'](_0x50d8dd);}});}else{return _0x268361['download'](_0x50d8dd,function(_0x22c3a1){if(_0x26c23a){fs[_0x6d6d('0x61')](_0x50d8dd);}});}}})[_0x6d6d('0x46')](function(_0x5de33f){if(_0x5de33f['message']===_0x6d6d('0x5e')){_0x268361['status'](0x194)[_0x6d6d('0x2c')]('Not\x20found');}else{return handleError(_0x268361,null);}});};exports[_0x6d6d('0x28')]=function(_0x367a6f,_0x21f14c){return db[_0x6d6d('0x2e')][_0x6d6d('0x47')]({'where':{'id':_0x367a6f[_0x6d6d('0x4e')]['id']}})['then'](function(_0x41e576){if(_['isNil'](_0x41e576)){throw new ReferenceError(_0x6d6d('0x62'));}return _0x41e576;})['then'](function(_0x2a21d8){var _0x3e48f7=path[_0x6d6d('0x53')](config[_0x6d6d('0x54')],_0x6d6d('0x55'),_0x2a21d8[_0x6d6d('0x4d')]);logger[_0x6d6d('0x63')]('cancellazione\x20fisica\x20documento\x20%s',_0x3e48f7);if(!_['isNil'](_0x2a21d8[_0x6d6d('0x4d')])&&fs['existsSync'](_0x3e48f7)){logger[_0x6d6d('0x63')]('File:\x20\x22'+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}_0x3e48f7=_0x3e48f7+_0x6d6d('0x66');if(!_[_0x6d6d('0x67')](_0x2a21d8[_0x6d6d('0x4d')])&&fs[_0x6d6d('0x58')](_0x3e48f7)){logger['info'](_0x6d6d('0x68')+_0x3e48f7+_0x6d6d('0x64'));fs[_0x6d6d('0x65')](_0x3e48f7);}return _0x2a21d8;})[_0x6d6d('0x27')](function(_0x1ba731){if(!_0x1ba731)throw new InternalError();return _0x1ba731[_0x6d6d('0x28')]();})[_0x6d6d('0x27')](function(){_0x21f14c['status'](0xcc)[_0x6d6d('0x1b')]();})[_0x6d6d('0x46')](handleError(_0x21f14c,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 3be525a..a943de0 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 _0x71e6=['define','ScreenRecording','screen_recordings','interactionid','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x3463b9,_0x55270d){var _0xa528ad=function(_0x5deac7){while(--_0x5deac7){_0x3463b9['push'](_0x3463b9['shift']());}};_0xa528ad(++_0x55270d);}(_0x71e6,0xac));var _0x671e=function(_0x57cfc6,_0xe0a1b9){_0x57cfc6=_0x57cfc6-0x0;var _0x3f9b40=_0x71e6[_0x57cfc6];return _0x3f9b40;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x671e('0x0'))('api');var moment=require('moment');var BPromise=require(_0x671e('0x1'));var rp=require(_0x671e('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x671e('0x3'));var attributes=require('./screenRecording.attributes');module['exports']=function(_0x4eb487,_0x260fb0){return _0x4eb487[_0x671e('0x4')](_0x671e('0x5'),attributes,{'tableName':_0x671e('0x6'),'paranoid':![],'indexes':[{'name':_0x671e('0x7'),'fields':[_0x671e('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d39=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger'];(function(_0x1ee7d6,_0x3eeffc){var _0x50dc8e=function(_0x457d9e){while(--_0x457d9e){_0x1ee7d6['push'](_0x1ee7d6['shift']());}};_0x50dc8e(++_0x3eeffc);}(_0x2d39,0x176));var _0x92d3=function(_0xdcb9d,_0x4031cb){_0xdcb9d=_0xdcb9d-0x0;var _0x6d9f1=_0x2d39[_0xdcb9d];return _0x6d9f1;};'use strict';var _=require(_0x92d3('0x0'));var util=require(_0x92d3('0x1'));var logger=require(_0x92d3('0x2'))('api');var moment=require(_0x92d3('0x3'));var BPromise=require(_0x92d3('0x4'));var rp=require(_0x92d3('0x5'));var fs=require('fs');var path=require(_0x92d3('0x6'));var rimraf=require(_0x92d3('0x7'));var config=require(_0x92d3('0x8'));var attributes=require('./screenRecording.attributes');module[_0x92d3('0x9')]=function(_0x1cb6b0,_0x12a667){return _0x1cb6b0['define'](_0x92d3('0xa'),attributes,{'tableName':_0x92d3('0xb'),'paranoid':![],'indexes':[{'name':_0x92d3('0xc'),'fields':[_0x92d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 7ad6a37..6b27126 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 _0xc729=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x461730,_0x5d5d51){var _0x358954=function(_0x45e35f){while(--_0x45e35f){_0x461730['push'](_0x461730['shift']());}};_0x358954(++_0x5d5d51);}(_0xc729,0x1c8));var _0x9c72=function(_0x36e25f,_0x373b27){_0x36e25f=_0x36e25f-0x0;var _0x5226e3=_0xc729[_0x36e25f];return _0x5226e3;};'use strict';var _=require('lodash');var util=require(_0x9c72('0x0'));var moment=require(_0x9c72('0x1'));var BPromise=require(_0x9c72('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9c72('0x3'))['db'];var utils=require(_0x9c72('0x4'));var logger=require(_0x9c72('0x5'))('rpc');var config=require(_0x9c72('0x6'));var jayson=require(_0x9c72('0x7'));var client=jayson[_0x9c72('0x8')][_0x9c72('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x175eb1,_0x19d4f2,_0x4375b0){return new BPromise(function(_0x363c35,_0x3a0c13){return client['request'](_0x175eb1,_0x4375b0)[_0x9c72('0xa')](function(_0x41f6e8){logger['info'](_0x9c72('0xb'),_0x19d4f2,_0x9c72('0xc'));logger[_0x9c72('0xd')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x19d4f2,_0x9c72('0xc'),JSON[_0x9c72('0xe')](_0x41f6e8));if(_0x41f6e8[_0x9c72('0xf')]){if(_0x41f6e8['error']['code']===0x1f4){logger[_0x9c72('0xf')](_0x9c72('0xb'),_0x19d4f2,_0x41f6e8[_0x9c72('0xf')]['message']);return _0x3a0c13(_0x41f6e8[_0x9c72('0xf')]['message']);}logger['error'](_0x9c72('0xb'),_0x19d4f2,_0x41f6e8[_0x9c72('0xf')][_0x9c72('0x10')]);return _0x363c35(_0x41f6e8[_0x9c72('0xf')][_0x9c72('0x10')]);}else{logger['info'](_0x9c72('0xb'),_0x19d4f2,_0x9c72('0xc'));_0x363c35(_0x41f6e8[_0x9c72('0x11')][_0x9c72('0x10')]);}})[_0x9c72('0x12')](function(_0x55c562){logger[_0x9c72('0xf')](_0x9c72('0xb'),_0x19d4f2,_0x55c562);_0x3a0c13(_0x55c562);});});} \ No newline at end of file +var _0x686e=['result','lodash','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0x1f2f18,_0x31ffde){var _0x1ba2e6=function(_0x5b04d2){while(--_0x5b04d2){_0x1f2f18['push'](_0x1f2f18['shift']());}};_0x1ba2e6(++_0x31ffde);}(_0x686e,0x16a));var _0xe686=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x686e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe686('0x0'));var util=require(_0xe686('0x1'));var moment=require('moment');var BPromise=require(_0xe686('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe686('0x3'));var db=require(_0xe686('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe686('0x5'));var config=require(_0xe686('0x6'));var jayson=require(_0xe686('0x7'));var client=jayson[_0xe686('0x8')][_0xe686('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a3e89,_0x519441,_0x5f1bf7){return new BPromise(function(_0x37bf50,_0x253462){return client['request'](_0x4a3e89,_0x5f1bf7)[_0xe686('0xa')](function(_0x301441){logger[_0xe686('0xb')](_0xe686('0xc'),_0x519441,_0xe686('0xd'));logger[_0xe686('0xe')]('ScreenRecording,\x20%s,\x20%s,\x20%s',_0x519441,_0xe686('0xd'),JSON[_0xe686('0xf')](_0x301441));if(_0x301441[_0xe686('0x10')]){if(_0x301441[_0xe686('0x10')]['code']===0x1f4){logger[_0xe686('0x10')](_0xe686('0xc'),_0x519441,_0x301441['error'][_0xe686('0x11')]);return _0x253462(_0x301441[_0xe686('0x10')][_0xe686('0x11')]);}logger['error'](_0xe686('0xc'),_0x519441,_0x301441[_0xe686('0x10')][_0xe686('0x11')]);return _0x37bf50(_0x301441[_0xe686('0x10')][_0xe686('0x11')]);}else{logger[_0xe686('0xb')](_0xe686('0xc'),_0x519441,_0xe686('0xd'));_0x37bf50(_0x301441[_0xe686('0x12')][_0xe686('0x11')]);}})['catch'](function(_0x4c99ad){logger[_0xe686('0x10')]('ScreenRecording,\x20%s,\x20%s',_0x519441,_0x4c99ad);_0x253462(_0x4c99ad);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 920adda..e785541 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 _0x7f5c=['addLogoLogin','join','preferred','addPreferred','favicon','/:id/favicon','put','update','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./setting.controller','get','isAuthenticated','index','/now','getDate','/:id','getLogo','getLogoLogin','gdpr','getFavicon','diskStorage','root','server/files/images/logos/','format','%s%s','logo','extname','originalname','/:id/logo','single','addLogo','logologin','post','file'];(function(_0x24d50c,_0x4557c7){var _0x3935e9=function(_0x314c2d){while(--_0x314c2d){_0x24d50c['push'](_0x24d50c['shift']());}};_0x3935e9(++_0x4557c7);}(_0x7f5c,0x17a));var _0xc7f5=function(_0x22876b,_0x533e49){_0x22876b=_0x22876b-0x0;var _0x3a6dff=_0x7f5c[_0x22876b];return _0x3a6dff;};'use strict';var multer=require(_0xc7f5('0x0'));var util=require(_0xc7f5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc7f5('0x2'));var router=express[_0xc7f5('0x3')]();var fs_extra=require(_0xc7f5('0x4'));var auth=require(_0xc7f5('0x5'));var interaction=require(_0xc7f5('0x6'));var config=require('../../config/environment');var controller=require(_0xc7f5('0x7'));router[_0xc7f5('0x8')]('/',auth[_0xc7f5('0x9')](),controller[_0xc7f5('0xa')]);router['get'](_0xc7f5('0xb'),controller[_0xc7f5('0xc')]);router[_0xc7f5('0x8')](_0xc7f5('0xd'),controller['show']);router[_0xc7f5('0x8')]('/:id/logo',controller[_0xc7f5('0xe')]);router[_0xc7f5('0x8')]('/:id/logo_login',controller[_0xc7f5('0xf')]);router[_0xc7f5('0x8')]('/:id/gdpr',controller[_0xc7f5('0x10')]);router[_0xc7f5('0x8')]('/:id/preferred',controller['getPreferred']);router[_0xc7f5('0x8')]('/:id/favicon',controller[_0xc7f5('0x11')]);var upload=multer({'storage':multer[_0xc7f5('0x12')]({'destination':function(_0x395fa0,_0x17b8ea,_0x5346b2){_0x5346b2(null,path['join'](config[_0xc7f5('0x13')],_0xc7f5('0x14')));},'filename':function(_0xa80701,_0x47dfd6,_0x2015a1){_0x2015a1(null,util[_0xc7f5('0x15')](_0xc7f5('0x16'),_0xc7f5('0x17'),path[_0xc7f5('0x18')](_0x47dfd6[_0xc7f5('0x19')])));}})});router['post'](_0xc7f5('0x1a'),upload[_0xc7f5('0x1b')]('file'),controller[_0xc7f5('0x1c')]);var upload=multer({'storage':multer[_0xc7f5('0x12')]({'destination':function(_0x5cbf38,_0xb7860,_0x539f90){_0x539f90(null,path['join'](config[_0xc7f5('0x13')],_0xc7f5('0x14')));},'filename':function(_0x1fdedd,_0x4090a5,_0x270735){_0x270735(null,util[_0xc7f5('0x15')](_0xc7f5('0x16'),_0xc7f5('0x1d'),path[_0xc7f5('0x18')](_0x4090a5[_0xc7f5('0x19')])));}})});router[_0xc7f5('0x1e')]('/:id/logo_login',upload[_0xc7f5('0x1b')](_0xc7f5('0x1f')),controller[_0xc7f5('0x20')]);var upload=multer({'storage':multer[_0xc7f5('0x12')]({'destination':function(_0x5ce3d6,_0x5095c2,_0x1dc475){_0x1dc475(null,path[_0xc7f5('0x21')](config[_0xc7f5('0x13')],_0xc7f5('0x14')));},'filename':function(_0x54924f,_0x5c61c5,_0x4e05d8){_0x4e05d8(null,util[_0xc7f5('0x15')](_0xc7f5('0x16'),_0xc7f5('0x22'),path['extname'](_0x5c61c5[_0xc7f5('0x19')])));}})});router['post']('/:id/preferred',upload[_0xc7f5('0x1b')](_0xc7f5('0x1f')),controller[_0xc7f5('0x23')]);var upload=multer({'storage':multer[_0xc7f5('0x12')]({'destination':function(_0x34eba,_0x2d8019,_0xf50410){_0xf50410(null,path[_0xc7f5('0x21')](config[_0xc7f5('0x13')],'server/files/images/logos/'));},'filename':function(_0xca6cbf,_0x3a2d77,_0x4d068e){_0x4d068e(null,util[_0xc7f5('0x15')](_0xc7f5('0x16'),_0xc7f5('0x24'),path[_0xc7f5('0x18')](_0x3a2d77[_0xc7f5('0x19')])));}})});router['post'](_0xc7f5('0x25'),upload[_0xc7f5('0x1b')](_0xc7f5('0x1f')),controller['addFavicon']);router[_0xc7f5('0x26')](_0xc7f5('0xd'),auth[_0xc7f5('0x9')](),controller[_0xc7f5('0x27')]);module[_0xc7f5('0x28')]=router; \ No newline at end of file +var _0x6ef5=['file','addLogoLogin','preferred','single','addPreferred','favicon','addFavicon','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./setting.controller','get','index','/:id','show','/:id/logo','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','extname','post','addLogo','logologin','originalname'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6ef5,0x1ae));var _0x56ef=function(_0x103635,_0x4a6c42){_0x103635=_0x103635-0x0;var _0x4448c4=_0x6ef5[_0x103635];return _0x4448c4;};'use strict';var multer=require(_0x56ef('0x0'));var util=require(_0x56ef('0x1'));var path=require(_0x56ef('0x2'));var timeout=require(_0x56ef('0x3'));var express=require(_0x56ef('0x4'));var router=express[_0x56ef('0x5')]();var fs_extra=require(_0x56ef('0x6'));var auth=require(_0x56ef('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x56ef('0x8'));router[_0x56ef('0x9')]('/',auth['isAuthenticated'](),controller[_0x56ef('0xa')]);router[_0x56ef('0x9')]('/now',controller['getDate']);router[_0x56ef('0x9')](_0x56ef('0xb'),controller[_0x56ef('0xc')]);router[_0x56ef('0x9')](_0x56ef('0xd'),controller['getLogo']);router[_0x56ef('0x9')](_0x56ef('0xe'),controller[_0x56ef('0xf')]);router[_0x56ef('0x9')]('/:id/gdpr',controller[_0x56ef('0x10')]);router['get'](_0x56ef('0x11'),controller['getPreferred']);router[_0x56ef('0x9')](_0x56ef('0x12'),controller[_0x56ef('0x13')]);var upload=multer({'storage':multer[_0x56ef('0x14')]({'destination':function(_0x5f21b1,_0x5c0239,_0x4be654){_0x4be654(null,path[_0x56ef('0x15')](config[_0x56ef('0x16')],_0x56ef('0x17')));},'filename':function(_0x342d09,_0x5618f0,_0x1d5919){_0x1d5919(null,util[_0x56ef('0x18')](_0x56ef('0x19'),_0x56ef('0x1a'),path[_0x56ef('0x1b')](_0x5618f0['originalname'])));}})});router[_0x56ef('0x1c')]('/:id/logo',upload['single']('file'),controller[_0x56ef('0x1d')]);var upload=multer({'storage':multer[_0x56ef('0x14')]({'destination':function(_0x3b3772,_0x4d2507,_0x26f7cc){_0x26f7cc(null,path[_0x56ef('0x15')](config[_0x56ef('0x16')],'server/files/images/logos/'));},'filename':function(_0x455843,_0x125d32,_0x46d680){_0x46d680(null,util[_0x56ef('0x18')]('%s%s',_0x56ef('0x1e'),path[_0x56ef('0x1b')](_0x125d32[_0x56ef('0x1f')])));}})});router['post'](_0x56ef('0xe'),upload['single'](_0x56ef('0x20')),controller[_0x56ef('0x21')]);var upload=multer({'storage':multer[_0x56ef('0x14')]({'destination':function(_0x5a794c,_0x43f535,_0x39af1e){_0x39af1e(null,path[_0x56ef('0x15')](config['root'],_0x56ef('0x17')));},'filename':function(_0x5329cf,_0x10b104,_0x285277){_0x285277(null,util[_0x56ef('0x18')]('%s%s',_0x56ef('0x22'),path[_0x56ef('0x1b')](_0x10b104[_0x56ef('0x1f')])));}})});router[_0x56ef('0x1c')]('/:id/preferred',upload[_0x56ef('0x23')](_0x56ef('0x20')),controller[_0x56ef('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5aeee4,_0x59e624,_0x5a59e5){_0x5a59e5(null,path[_0x56ef('0x15')](config[_0x56ef('0x16')],_0x56ef('0x17')));},'filename':function(_0x56b761,_0xb167fe,_0x314682){_0x314682(null,util[_0x56ef('0x18')]('%s%s',_0x56ef('0x25'),path[_0x56ef('0x1b')](_0xb167fe[_0x56ef('0x1f')])));}})});router['post'](_0x56ef('0x12'),upload[_0x56ef('0x23')](_0x56ef('0x20')),controller[_0x56ef('0x26')]);router['put'](_0x56ef('0xb'),auth[_0x56ef('0x27')](),controller[_0x56ef('0x28')]);module[_0x56ef('0x29')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 4dbb031..333ab5c 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(_0x32fbf1,_0x10e6cf){var _0x52cb7d=function(_0x2b0308){while(--_0x2b0308){_0x32fbf1['push'](_0x32fbf1['shift']());}};_0x52cb7d(++_0x10e6cf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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':!![]}}; \ 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(_0x2c1524,_0x311a60){var _0x4ddd51=function(_0x2f7fa5){while(--_0x2f7fa5){_0x2c1524['push'](_0x2c1524['shift']());}};_0x4ddd51(++_0x311a60);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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':!![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index b11de11..44fa212 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 _0xa8e7=['undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','Setting','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','find','body','addLogo','file','filename','params','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','logo','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','default','gdpr','addPreferred','getPreferred','favicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa8e7,0xd2));var _0x7a8e=function(_0x278db6,_0x1696ae){_0x278db6=_0x278db6-0x0;var _0x30898f=_0xa8e7[_0x278db6];return _0x30898f;};'use strict';var emlformat=require(_0x7a8e('0x0'));var rimraf=require(_0x7a8e('0x1'));var zipdir=require(_0x7a8e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7a8e('0x3'));var moment=require(_0x7a8e('0x4'));var BPromise=require(_0x7a8e('0x5'));var Mustache=require(_0x7a8e('0x6'));var util=require(_0x7a8e('0x7'));var path=require('path');var sox=require(_0x7a8e('0x8'));var csv=require(_0x7a8e('0x9'));var ejs=require(_0x7a8e('0xa'));var fs=require('fs');var fs_extra=require(_0x7a8e('0xb'));var _=require(_0x7a8e('0xc'));var squel=require(_0x7a8e('0xd'));var crypto=require(_0x7a8e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x7a8e('0x9'));var querystring=require(_0x7a8e('0xf'));var Papa=require(_0x7a8e('0x10'));var Redis=require(_0x7a8e('0x11'));var authService=require(_0x7a8e('0x12'));var qs=require(_0x7a8e('0x13'));var as=require(_0x7a8e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7a8e('0x15'))(_0x7a8e('0x16'));var utils=require(_0x7a8e('0x17'));var config=require(_0x7a8e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x7a8e('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x7a8e('0x1a')][_0x7a8e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x18b3ef,_0x156226,_0xbc30e4,_0x403e72){return new BPromise(function(_0x5e9ef5,_0x43ffca){var _0x1ba4d8=_0x403e72||client;return _0x1ba4d8[_0x7a8e('0x1c')](_0x18b3ef,_0xbc30e4)[_0x7a8e('0x1d')](function(_0x54b30b){logger[_0x7a8e('0x1e')](_0x7a8e('0x1f'),_0x156226,_0x7a8e('0x20'));logger['debug'](_0x7a8e('0x21'),_0x156226,_0x7a8e('0x20'),JSON[_0x7a8e('0x22')](_0x54b30b));if(_0x54b30b[_0x7a8e('0x23')]){if(_0x54b30b[_0x7a8e('0x23')][_0x7a8e('0x24')]===0x1f4){logger[_0x7a8e('0x23')](_0x7a8e('0x1f'),_0x156226,_0x54b30b[_0x7a8e('0x23')][_0x7a8e('0x25')]);return _0x43ffca(_0x54b30b[_0x7a8e('0x23')][_0x7a8e('0x25')]);}logger['error'](_0x7a8e('0x1f'),_0x156226,_0x54b30b['error'][_0x7a8e('0x25')]);return _0x5e9ef5(_0x54b30b['error'][_0x7a8e('0x25')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x156226,_0x7a8e('0x20'));_0x5e9ef5(_0x54b30b[_0x7a8e('0x26')][_0x7a8e('0x25')]);}})['catch'](function(_0x3780fc){logger[_0x7a8e('0x23')](_0x7a8e('0x1f'),_0x156226,_0x3780fc);_0x43ffca(_0x3780fc);});});}function respondWithStatusCode(_0x256dbd,_0x25c6cf){_0x25c6cf=_0x25c6cf||0xcc;return function(_0x4a2ab3){if(_0x4a2ab3){return _0x256dbd[_0x7a8e('0x27')](_0x25c6cf);}return _0x256dbd[_0x7a8e('0x28')](_0x25c6cf)[_0x7a8e('0x29')]();};}function respondWithResult(_0x534f1d,_0x4d972e){_0x4d972e=_0x4d972e||0xc8;return function(_0x30b089){if(_0x30b089){return _0x534f1d['status'](_0x4d972e)[_0x7a8e('0x2a')](_0x30b089);}};}function respondWithFilteredResult(_0x6aa7d8,_0x3f1cfe){return function(_0xf0a4ae){if(_0xf0a4ae){var _0x442612=typeof _0x3f1cfe[_0x7a8e('0x2b')]===_0x7a8e('0x2c')&&typeof _0x3f1cfe[_0x7a8e('0x2d')]==='undefined';var _0x42158b=_0xf0a4ae[_0x7a8e('0x2e')];var _0x17b94d=_0x442612?0x0:_0x3f1cfe['offset'];var _0x1411ae=_0x442612?_0xf0a4ae[_0x7a8e('0x2e')]:_0x3f1cfe['offset']+_0x3f1cfe[_0x7a8e('0x2d')];var _0x5ee4ce;if(_0x1411ae>=_0x42158b){_0x1411ae=_0x42158b;_0x5ee4ce=0xc8;}else{_0x5ee4ce=0xce;}_0x6aa7d8[_0x7a8e('0x28')](_0x5ee4ce);return _0x6aa7d8[_0x7a8e('0x2f')](_0x7a8e('0x30'),_0x17b94d+'-'+_0x1411ae+'/'+_0x42158b)[_0x7a8e('0x2a')](_0xf0a4ae);}return null;};}function patchUpdates(_0x5d376a){return function(_0xc67a2e){try{jsonpatch[_0x7a8e('0x31')](_0xc67a2e,_0x5d376a,!![]);}catch(_0x3915ba){return BPromise[_0x7a8e('0x32')](_0x3915ba);}return _0xc67a2e[_0x7a8e('0x33')]();};}function saveUpdates(_0x313413,_0x188df9){return function(_0x1ecfe6){if(_0x1ecfe6){return _0x1ecfe6[_0x7a8e('0x34')](_0x313413)[_0x7a8e('0x1d')](function(_0xdbfbf){return _0xdbfbf;});}return null;};}function removeEntity(_0x4cab61,_0x513294){return function(_0x19ed0b){if(_0x19ed0b){return _0x19ed0b[_0x7a8e('0x35')]()[_0x7a8e('0x1d')](function(){_0x4cab61['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x17cea8,_0x1d0022){return function(_0x5a04ea){if(!_0x5a04ea){_0x17cea8[_0x7a8e('0x27')](0x194);}return _0x5a04ea;};}function handleError(_0x319992,_0x305924){_0x305924=_0x305924||0x1f4;return function(_0x597d13){logger[_0x7a8e('0x23')](_0x597d13[_0x7a8e('0x36')]);if(_0x597d13['name']){delete _0x597d13[_0x7a8e('0x37')];}_0x319992['status'](_0x305924)[_0x7a8e('0x38')](_0x597d13);};}exports[_0x7a8e('0x39')]=function(_0x1dfd64,_0x53a4d1){var _0x29f9fb={},_0x4578fe={},_0x8fb8c1={'count':0x0,'rows':[]};var _0x131ca2=_[_0x7a8e('0x3a')](db[_0x7a8e('0x3b')][_0x7a8e('0x3c')],function(_0x577634){return{'name':_0x577634['fieldName'],'type':_0x577634[_0x7a8e('0x3d')][_0x7a8e('0x3e')]};});_0x4578fe[_0x7a8e('0x3f')]=_[_0x7a8e('0x3a')](_0x131ca2,_0x7a8e('0x37'));_0x4578fe[_0x7a8e('0x40')]=_[_0x7a8e('0x41')](_0x1dfd64['query']);_0x4578fe[_0x7a8e('0x42')]=_[_0x7a8e('0x43')](_0x4578fe[_0x7a8e('0x3f')],_0x4578fe[_0x7a8e('0x40')]);_0x29f9fb[_0x7a8e('0x44')]=_[_0x7a8e('0x43')](_0x4578fe[_0x7a8e('0x3f')],qs[_0x7a8e('0x45')](_0x1dfd64[_0x7a8e('0x40')][_0x7a8e('0x45')]));_0x29f9fb['attributes']=_0x29f9fb[_0x7a8e('0x44')][_0x7a8e('0x46')]?_0x29f9fb[_0x7a8e('0x44')]:_0x4578fe['model'];if(!_0x1dfd64[_0x7a8e('0x40')][_0x7a8e('0x47')](_0x7a8e('0x48'))){_0x29f9fb[_0x7a8e('0x2d')]=qs['limit'](_0x1dfd64['query'][_0x7a8e('0x2d')]);_0x29f9fb[_0x7a8e('0x2b')]=qs[_0x7a8e('0x2b')](_0x1dfd64['query'][_0x7a8e('0x2b')]);}_0x29f9fb['order']=qs[_0x7a8e('0x49')](_0x1dfd64[_0x7a8e('0x40')][_0x7a8e('0x49')]);_0x29f9fb[_0x7a8e('0x4a')]=qs[_0x7a8e('0x42')](_[_0x7a8e('0x4b')](_0x1dfd64[_0x7a8e('0x40')],_0x4578fe[_0x7a8e('0x42')]),_0x131ca2);if(_0x1dfd64[_0x7a8e('0x40')]['filter']){_0x29f9fb[_0x7a8e('0x4a')]=_[_0x7a8e('0x4c')](_0x29f9fb[_0x7a8e('0x4a')],{'$or':_[_0x7a8e('0x3a')](_0x131ca2,function(_0x3ff18b){if(_0x3ff18b[_0x7a8e('0x3d')]!=='VIRTUAL'){var _0x4d228b={};_0x4d228b[_0x3ff18b[_0x7a8e('0x37')]]={'$like':'%'+_0x1dfd64['query'][_0x7a8e('0x4d')]+'%'};return _0x4d228b;}})});}_0x29f9fb=_['merge']({},_0x29f9fb,_0x1dfd64[_0x7a8e('0x4e')]);var _0x384778={'where':_0x29f9fb[_0x7a8e('0x4a')]};return db[_0x7a8e('0x3b')][_0x7a8e('0x2e')](_0x384778)[_0x7a8e('0x1d')](function(_0x67b5f7){_0x8fb8c1[_0x7a8e('0x2e')]=_0x67b5f7;if(_0x1dfd64[_0x7a8e('0x40')][_0x7a8e('0x4f')]){_0x29f9fb[_0x7a8e('0x50')]=[{'all':!![]}];}return db['Setting']['findAll'](_0x29f9fb);})[_0x7a8e('0x1d')](function(_0x176c38){_0x8fb8c1[_0x7a8e('0x51')]=_0x176c38;return _0x8fb8c1;})[_0x7a8e('0x1d')](respondWithFilteredResult(_0x53a4d1,_0x29f9fb))[_0x7a8e('0x52')](handleError(_0x53a4d1,null));};exports[_0x7a8e('0x53')]=function(_0x28b6c5,_0x52db6b){var _0x2b8a9f={'raw':![],'where':{'id':_0x28b6c5['params']['id']}},_0x5278e9={};_0x5278e9[_0x7a8e('0x3f')]=_[_0x7a8e('0x41')](db['Setting'][_0x7a8e('0x3c')]);_0x5278e9[_0x7a8e('0x40')]=_[_0x7a8e('0x41')](_0x28b6c5[_0x7a8e('0x40')]);_0x5278e9[_0x7a8e('0x42')]=_[_0x7a8e('0x43')](_0x5278e9['model'],_0x5278e9[_0x7a8e('0x40')]);_0x2b8a9f[_0x7a8e('0x44')]=_['intersection'](_0x5278e9['model'],qs[_0x7a8e('0x45')](_0x28b6c5['query']['fields']));_0x2b8a9f['attributes']=_0x2b8a9f[_0x7a8e('0x44')][_0x7a8e('0x46')]?_0x2b8a9f[_0x7a8e('0x44')]:_0x5278e9[_0x7a8e('0x3f')];if(_0x28b6c5[_0x7a8e('0x40')][_0x7a8e('0x4f')]){_0x2b8a9f[_0x7a8e('0x50')]=[{'all':!![]}];}_0x2b8a9f=_[_0x7a8e('0x4c')]({},_0x2b8a9f,_0x28b6c5[_0x7a8e('0x4e')]);return db[_0x7a8e('0x3b')][_0x7a8e('0x54')](_0x2b8a9f)['then'](handleEntityNotFound(_0x52db6b,null))['then'](respondWithResult(_0x52db6b,null))[_0x7a8e('0x52')](handleError(_0x52db6b,null));};exports[_0x7a8e('0x34')]=function(_0x3a0959,_0x24a5d9){if(_0x3a0959[_0x7a8e('0x55')]['id']){delete _0x3a0959[_0x7a8e('0x55')]['id'];}return db['Setting']['find']({'where':{'id':_0x3a0959['params']['id']}})[_0x7a8e('0x1d')](handleEntityNotFound(_0x24a5d9,null))['then'](saveUpdates(_0x3a0959[_0x7a8e('0x55')],null))['then'](respondWithResult(_0x24a5d9,null))['catch'](handleError(_0x24a5d9,null));};exports[_0x7a8e('0x56')]=function(_0x44ecf6,_0x5338a5,_0x3f0b3f){if(_0x44ecf6[_0x7a8e('0x57')]&&_0x44ecf6[_0x7a8e('0x57')][_0x7a8e('0x58')]){_0x44ecf6['body']['logo']=_0x44ecf6[_0x7a8e('0x57')][_0x7a8e('0x58')];}return db[_0x7a8e('0x3b')]['find']({'where':{'id':_0x44ecf6[_0x7a8e('0x59')]['id']}})['then'](handleEntityNotFound(_0x5338a5,null))['then'](saveUpdates(_0x44ecf6['body'],null))['then'](respondWithResult(_0x5338a5,null))[_0x7a8e('0x52')](handleError(_0x5338a5,null));};exports[_0x7a8e('0x5a')]=function(_0x4d5e18,_0x31e9a2,_0x692f35){if(_0x4d5e18[_0x7a8e('0x57')]&&_0x4d5e18[_0x7a8e('0x57')]['filename']){_0x4d5e18[_0x7a8e('0x55')][_0x7a8e('0x5b')]=_0x4d5e18[_0x7a8e('0x57')]['filename'];}return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x4d5e18['params']['id']}})['then'](handleEntityNotFound(_0x31e9a2,null))['then'](saveUpdates(_0x4d5e18[_0x7a8e('0x55')],null))['then'](respondWithResult(_0x31e9a2,null))[_0x7a8e('0x52')](handleError(_0x31e9a2,null));};var utilLicense=require(_0x7a8e('0x5c'));exports['getLogo']=function(_0x3d0847,_0x46132f,_0x229a41){var _0x53bc39=_0x7a8e('0x5d');var _0x572307={'custom':![]};return utilLicense[_0x7a8e('0x5e')]()[_0x7a8e('0x1d')](function(_0x2becbe){if(_0x2becbe){_0x572307=_0x2becbe;}return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x3d0847[_0x7a8e('0x59')]['id']},'attributes':[_0x7a8e('0x5f'),'loginLogo',_0x7a8e('0x60'),'favicon',_0x7a8e('0x61'),_0x7a8e('0x62'),_0x7a8e('0x63'),_0x7a8e('0x64')],'raw':!![]});})[_0x7a8e('0x1d')](handleEntityNotFound(_0x46132f,null))[_0x7a8e('0x1d')](function(_0x40f7fa){if(_0x40f7fa){var _0x1ad083=_0x40f7fa[_0x7a8e('0x5f')]&&fs[_0x7a8e('0x65')](path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x53bc39,_[_0x7a8e('0x68')](_0x40f7fa[_0x7a8e('0x5f')])))?path[_0x7a8e('0x66')](config['root'],_0x53bc39,_[_0x7a8e('0x68')](_0x40f7fa['logo'])):path[_0x7a8e('0x66')](config['root'],_0x53bc39,_[_0x7a8e('0x68')](_0x7a8e('0x69')));var _0x26d538='default'+_[_0x7a8e('0x6a')](_0x7a8e('0x5f'));if(_0x40f7fa[_0x26d538]||!_0x572307[_0x7a8e('0x6b')]){_0x1ad083=path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x53bc39,_[_0x7a8e('0x68')](_0x7a8e('0x69')));}if(!fs[_0x7a8e('0x65')](_0x1ad083)){throw new db[(_0x7a8e('0x6c'))][(_0x7a8e('0x6d'))](_['upperFirst']('logo')+_0x7a8e('0x6e'));}return _0x46132f[_0x7a8e('0x6f')](_0x1ad083);}})[_0x7a8e('0x52')](handleError(_0x46132f,null));};var utilLicense=require(_0x7a8e('0x5c'));exports[_0x7a8e('0x70')]=function(_0x2c05fc,_0x11dee3,_0x1481f1){var _0x3c6b4c=_0x7a8e('0x5d');var _0x2c5281={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x169226){if(_0x169226){_0x2c5281=_0x169226;}return db[_0x7a8e('0x3b')]['find']({'where':{'id':_0x2c05fc[_0x7a8e('0x59')]['id']},'attributes':[_0x7a8e('0x5f'),_0x7a8e('0x5b'),_0x7a8e('0x60'),'favicon',_0x7a8e('0x61'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x7a8e('0x1d')](handleEntityNotFound(_0x11dee3,null))[_0x7a8e('0x1d')](function(_0x3069b8){if(_0x3069b8){var _0x3a3f44=_0x3069b8['loginLogo']&&fs['existsSync'](path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x3c6b4c,_[_0x7a8e('0x68')](_0x3069b8[_0x7a8e('0x5b')])))?path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x3c6b4c,_['toLower'](_0x3069b8[_0x7a8e('0x5b')])):path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x3c6b4c,_[_0x7a8e('0x68')](_0x7a8e('0x71')));var _0x3e2fc5=_0x7a8e('0x72')+_['upperFirst'](_0x7a8e('0x5b'));if(_0x3069b8[_0x3e2fc5]||!_0x2c5281[_0x7a8e('0x6b')]){_0x3a3f44=path['join'](config[_0x7a8e('0x67')],_0x3c6b4c,_[_0x7a8e('0x68')](_0x7a8e('0x71')));}if(!fs[_0x7a8e('0x65')](_0x3a3f44)){throw new db[(_0x7a8e('0x6c'))][(_0x7a8e('0x6d'))](_[_0x7a8e('0x6a')](_0x7a8e('0x5b'))+'\x20not\x20found');}return _0x11dee3[_0x7a8e('0x6f')](_0x3a3f44);}})[_0x7a8e('0x52')](handleError(_0x11dee3,null));};exports[_0x7a8e('0x73')]=function(_0x394bb5,_0xb3d2d7){return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x394bb5[_0x7a8e('0x59')]['id']},'attributes':['securePassword']})[_0x7a8e('0x1d')](respondWithResult(_0xb3d2d7,null))[_0x7a8e('0x52')](handleError(_0xb3d2d7,null));};exports[_0x7a8e('0x74')]=function(_0x39af0c,_0x122d27,_0x502a3a){if(_0x39af0c[_0x7a8e('0x57')]&&_0x39af0c[_0x7a8e('0x57')][_0x7a8e('0x58')]){_0x39af0c[_0x7a8e('0x55')][_0x7a8e('0x60')]=_0x39af0c[_0x7a8e('0x57')][_0x7a8e('0x58')];}return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x39af0c[_0x7a8e('0x59')]['id']}})[_0x7a8e('0x1d')](handleEntityNotFound(_0x122d27,null))[_0x7a8e('0x1d')](saveUpdates(_0x39af0c['body'],null))['then'](respondWithResult(_0x122d27,null))[_0x7a8e('0x52')](handleError(_0x122d27,null));};var utilLicense=require(_0x7a8e('0x5c'));exports[_0x7a8e('0x75')]=function(_0x3a609b,_0x48fe8b,_0x233eb0){var _0xf416d1='server/files/images/logos';var _0x3430e8={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x449a24){if(_0x449a24){_0x3430e8=_0x449a24;}return db['Setting'][_0x7a8e('0x54')]({'where':{'id':_0x3a609b[_0x7a8e('0x59')]['id']},'attributes':['logo','loginLogo',_0x7a8e('0x60'),_0x7a8e('0x76'),_0x7a8e('0x61'),_0x7a8e('0x62'),_0x7a8e('0x63'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x48fe8b,null))[_0x7a8e('0x1d')](function(_0x236e90){if(_0x236e90){var _0x21c282=_0x236e90['preferred']&&fs['existsSync'](path[_0x7a8e('0x66')](config['root'],_0xf416d1,_[_0x7a8e('0x68')](_0x236e90[_0x7a8e('0x60')])))?path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0xf416d1,_[_0x7a8e('0x68')](_0x236e90[_0x7a8e('0x60')])):path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0xf416d1,_[_0x7a8e('0x68')](_0x7a8e('0x77')));var _0x5ec62e=_0x7a8e('0x72')+_[_0x7a8e('0x6a')](_0x7a8e('0x60'));if(_0x236e90[_0x5ec62e]||!_0x3430e8[_0x7a8e('0x6b')]||!_0x3430e8[_0x7a8e('0x60')]){_0x21c282=path['join'](config[_0x7a8e('0x67')],_0xf416d1,_[_0x7a8e('0x68')](_0x7a8e('0x77')));}if(!fs['existsSync'](_0x21c282)){throw new db[(_0x7a8e('0x6c'))][(_0x7a8e('0x6d'))](_[_0x7a8e('0x6a')](_0x7a8e('0x60'))+'\x20not\x20found');}return _0x48fe8b[_0x7a8e('0x6f')](_0x21c282);}})[_0x7a8e('0x52')](handleError(_0x48fe8b,null));};exports[_0x7a8e('0x78')]=function(_0x13f03e,_0x5a4181,_0x410246){if(_0x13f03e[_0x7a8e('0x57')]&&_0x13f03e['file'][_0x7a8e('0x58')]){_0x13f03e[_0x7a8e('0x55')]['favicon']=_0x13f03e['file'][_0x7a8e('0x58')];}return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x13f03e[_0x7a8e('0x59')]['id']}})[_0x7a8e('0x1d')](handleEntityNotFound(_0x5a4181,null))[_0x7a8e('0x1d')](saveUpdates(_0x13f03e[_0x7a8e('0x55')],null))['then'](respondWithResult(_0x5a4181,null))[_0x7a8e('0x52')](handleError(_0x5a4181,null));};var utilLicense=require(_0x7a8e('0x5c'));exports[_0x7a8e('0x79')]=function(_0x29b194,_0x43356d,_0x48620b){var _0x84e5bf='server/files/images/logos';var _0x2ebd60={'custom':![]};return utilLicense[_0x7a8e('0x5e')]()[_0x7a8e('0x1d')](function(_0x1e62f0){if(_0x1e62f0){_0x2ebd60=_0x1e62f0;}return db[_0x7a8e('0x3b')][_0x7a8e('0x54')]({'where':{'id':_0x29b194['params']['id']},'attributes':[_0x7a8e('0x5f'),_0x7a8e('0x5b'),'preferred',_0x7a8e('0x76'),'defaultLogo',_0x7a8e('0x62'),_0x7a8e('0x63'),_0x7a8e('0x64')],'raw':!![]});})['then'](handleEntityNotFound(_0x43356d,null))[_0x7a8e('0x1d')](function(_0x4e1cd0){if(_0x4e1cd0){var _0x3df061=_0x4e1cd0[_0x7a8e('0x76')]&&fs[_0x7a8e('0x65')](path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x84e5bf,_[_0x7a8e('0x68')](_0x4e1cd0['favicon'])))?path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x84e5bf,_[_0x7a8e('0x68')](_0x4e1cd0[_0x7a8e('0x76')])):path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x84e5bf,_['toLower'](_0x7a8e('0x7a')));var _0xe9066c=_0x7a8e('0x72')+_[_0x7a8e('0x6a')](_0x7a8e('0x76'));if(_0x4e1cd0[_0xe9066c]||!_0x2ebd60[_0x7a8e('0x6b')]){_0x3df061=path[_0x7a8e('0x66')](config[_0x7a8e('0x67')],_0x84e5bf,_['toLower'](_0x7a8e('0x7a')));}if(!fs[_0x7a8e('0x65')](_0x3df061)){throw new db['Sequelize'][(_0x7a8e('0x6d'))](_['upperFirst']('favicon')+'\x20not\x20found');}return _0x43356d[_0x7a8e('0x6f')](_0x3df061);}})[_0x7a8e('0x52')](handleError(_0x43356d,null));};exports[_0x7a8e('0x7b')]=function(_0x156782,_0x5f52b4){var _0x46bd1a={'offset':moment()[_0x7a8e('0x7c')]()};_0x46bd1a[_0x7a8e('0x7d')]=moment()['utcOffset'](_0x46bd1a[_0x7a8e('0x2b')])['format'](_0x7a8e('0x7e'));return _0x5f52b4[_0x7a8e('0x28')](0xc8)[_0x7a8e('0x38')](_0x46bd1a);}; \ No newline at end of file +var _0xdd32=['count','apply','reject','save','update','destroy','end','stack','send','index','map','Setting','rawAttributes','fieldName','model','name','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','type','VIRTUAL','merge','options','include','findAll','rows','params','keys','catch','body','find','addLogo','file','logo','filename','addLogoLogin','loginLogo','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','existsSync','root','toLower','join','default_logo.svg','default','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','defaultPreferred','defaultFavicon','default_loginLogo.svg','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','sendStatus','status','json','offset','undefined','limit'];(function(_0x4c1b9d,_0x51cb8d){var _0x1fbc4c=function(_0x599ddc){while(--_0x599ddc){_0x4c1b9d['push'](_0x4c1b9d['shift']());}};_0x1fbc4c(++_0x51cb8d);}(_0xdd32,0x14a));var _0x2dd3=function(_0x1c4f7a,_0x1283c8){_0x1c4f7a=_0x1c4f7a-0x0;var _0xf4b0de=_0xdd32[_0x1c4f7a];return _0xf4b0de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2dd3('0x0'));var zipdir=require(_0x2dd3('0x1'));var jsonpatch=require(_0x2dd3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2dd3('0x3'));var Mustache=require(_0x2dd3('0x4'));var util=require(_0x2dd3('0x5'));var path=require(_0x2dd3('0x6'));var sox=require(_0x2dd3('0x7'));var csv=require(_0x2dd3('0x8'));var ejs=require(_0x2dd3('0x9'));var fs=require('fs');var fs_extra=require(_0x2dd3('0xa'));var _=require(_0x2dd3('0xb'));var squel=require(_0x2dd3('0xc'));var crypto=require(_0x2dd3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2dd3('0xe'));var toCsv=require(_0x2dd3('0x8'));var querystring=require(_0x2dd3('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2dd3('0x10'));var qs=require(_0x2dd3('0x11'));var as=require(_0x2dd3('0x12'));var hardwareService=require(_0x2dd3('0x13'));var logger=require(_0x2dd3('0x14'))(_0x2dd3('0x15'));var utils=require(_0x2dd3('0x16'));var config=require(_0x2dd3('0x17'));var licenseUtil=require(_0x2dd3('0x18'));var db=require(_0x2dd3('0x19'))['db'];var jayson=require(_0x2dd3('0x1a'));var client=jayson[_0x2dd3('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57b256,_0x4e4bda,_0x270b3b,_0x48f274){return new BPromise(function(_0x38ba74,_0x2c6dc2){var _0x10238e=_0x48f274||client;return _0x10238e[_0x2dd3('0x1c')](_0x57b256,_0x270b3b)[_0x2dd3('0x1d')](function(_0x1533b6){logger[_0x2dd3('0x1e')](_0x2dd3('0x1f'),_0x4e4bda,_0x2dd3('0x20'));logger[_0x2dd3('0x21')](_0x2dd3('0x22'),_0x4e4bda,_0x2dd3('0x20'),JSON['stringify'](_0x1533b6));if(_0x1533b6[_0x2dd3('0x23')]){if(_0x1533b6[_0x2dd3('0x23')][_0x2dd3('0x24')]===0x1f4){logger[_0x2dd3('0x23')](_0x2dd3('0x1f'),_0x4e4bda,_0x1533b6[_0x2dd3('0x23')][_0x2dd3('0x25')]);return _0x2c6dc2(_0x1533b6[_0x2dd3('0x23')]['message']);}logger[_0x2dd3('0x23')](_0x2dd3('0x1f'),_0x4e4bda,_0x1533b6['error'][_0x2dd3('0x25')]);return _0x38ba74(_0x1533b6[_0x2dd3('0x23')][_0x2dd3('0x25')]);}else{logger[_0x2dd3('0x1e')](_0x2dd3('0x1f'),_0x4e4bda,'request\x20sent');_0x38ba74(_0x1533b6[_0x2dd3('0x26')][_0x2dd3('0x25')]);}})['catch'](function(_0xead5cb){logger[_0x2dd3('0x23')](_0x2dd3('0x1f'),_0x4e4bda,_0xead5cb);_0x2c6dc2(_0xead5cb);});});}function respondWithStatusCode(_0x59d8a7,_0x39215b){_0x39215b=_0x39215b||0xcc;return function(_0x197723){if(_0x197723){return _0x59d8a7[_0x2dd3('0x27')](_0x39215b);}return _0x59d8a7[_0x2dd3('0x28')](_0x39215b)['end']();};}function respondWithResult(_0x232668,_0x5bec7c){_0x5bec7c=_0x5bec7c||0xc8;return function(_0x23fe2c){if(_0x23fe2c){return _0x232668[_0x2dd3('0x28')](_0x5bec7c)[_0x2dd3('0x29')](_0x23fe2c);}};}function respondWithFilteredResult(_0x218090,_0x4c56a1){return function(_0x5da71a){if(_0x5da71a){var _0x521be8=typeof _0x4c56a1[_0x2dd3('0x2a')]===_0x2dd3('0x2b')&&typeof _0x4c56a1[_0x2dd3('0x2c')]===_0x2dd3('0x2b');var _0x11cefc=_0x5da71a[_0x2dd3('0x2d')];var _0x5ac309=_0x521be8?0x0:_0x4c56a1[_0x2dd3('0x2a')];var _0x2bee20=_0x521be8?_0x5da71a[_0x2dd3('0x2d')]:_0x4c56a1[_0x2dd3('0x2a')]+_0x4c56a1[_0x2dd3('0x2c')];var _0x1c88dd;if(_0x2bee20>=_0x11cefc){_0x2bee20=_0x11cefc;_0x1c88dd=0xc8;}else{_0x1c88dd=0xce;}_0x218090['status'](_0x1c88dd);return _0x218090['set']('Content-Range',_0x5ac309+'-'+_0x2bee20+'/'+_0x11cefc)[_0x2dd3('0x29')](_0x5da71a);}return null;};}function patchUpdates(_0x2675e9){return function(_0x523c49){try{jsonpatch[_0x2dd3('0x2e')](_0x523c49,_0x2675e9,!![]);}catch(_0x39402b){return BPromise[_0x2dd3('0x2f')](_0x39402b);}return _0x523c49[_0x2dd3('0x30')]();};}function saveUpdates(_0x459975,_0x5d2fac){return function(_0x453121){if(_0x453121){return _0x453121[_0x2dd3('0x31')](_0x459975)['then'](function(_0x5530aa){return _0x5530aa;});}return null;};}function removeEntity(_0x33b6d4,_0x75c3b8){return function(_0x39127b){if(_0x39127b){return _0x39127b[_0x2dd3('0x32')]()[_0x2dd3('0x1d')](function(){_0x33b6d4[_0x2dd3('0x28')](0xcc)[_0x2dd3('0x33')]();});}};}function handleEntityNotFound(_0x22c23d,_0x1d384d){return function(_0x2eeb28){if(!_0x2eeb28){_0x22c23d[_0x2dd3('0x27')](0x194);}return _0x2eeb28;};}function handleError(_0xfe199b,_0x482df5){_0x482df5=_0x482df5||0x1f4;return function(_0x25d76c){logger['error'](_0x25d76c[_0x2dd3('0x34')]);if(_0x25d76c['name']){delete _0x25d76c['name'];}_0xfe199b[_0x2dd3('0x28')](_0x482df5)[_0x2dd3('0x35')](_0x25d76c);};}exports[_0x2dd3('0x36')]=function(_0xb7ac95,_0x3e1660){var _0x5e92b0={},_0x53fec3={},_0x569dda={'count':0x0,'rows':[]};var _0x1ac610=_[_0x2dd3('0x37')](db[_0x2dd3('0x38')][_0x2dd3('0x39')],function(_0x267bee){return{'name':_0x267bee[_0x2dd3('0x3a')],'type':_0x267bee['type']['key']};});_0x53fec3[_0x2dd3('0x3b')]=_['map'](_0x1ac610,_0x2dd3('0x3c'));_0x53fec3[_0x2dd3('0x3d')]=_['keys'](_0xb7ac95[_0x2dd3('0x3d')]);_0x53fec3[_0x2dd3('0x3e')]=_[_0x2dd3('0x3f')](_0x53fec3[_0x2dd3('0x3b')],_0x53fec3[_0x2dd3('0x3d')]);_0x5e92b0[_0x2dd3('0x40')]=_[_0x2dd3('0x3f')](_0x53fec3[_0x2dd3('0x3b')],qs[_0x2dd3('0x41')](_0xb7ac95[_0x2dd3('0x3d')]['fields']));_0x5e92b0[_0x2dd3('0x40')]=_0x5e92b0[_0x2dd3('0x40')][_0x2dd3('0x42')]?_0x5e92b0['attributes']:_0x53fec3[_0x2dd3('0x3b')];if(!_0xb7ac95['query'][_0x2dd3('0x43')]('nolimit')){_0x5e92b0[_0x2dd3('0x2c')]=qs[_0x2dd3('0x2c')](_0xb7ac95[_0x2dd3('0x3d')][_0x2dd3('0x2c')]);_0x5e92b0['offset']=qs['offset'](_0xb7ac95[_0x2dd3('0x3d')][_0x2dd3('0x2a')]);}_0x5e92b0[_0x2dd3('0x44')]=qs[_0x2dd3('0x45')](_0xb7ac95[_0x2dd3('0x3d')]['sort']);_0x5e92b0['where']=qs['filters'](_[_0x2dd3('0x46')](_0xb7ac95[_0x2dd3('0x3d')],_0x53fec3[_0x2dd3('0x3e')]),_0x1ac610);if(_0xb7ac95['query']['filter']){_0x5e92b0[_0x2dd3('0x47')]=_['merge'](_0x5e92b0[_0x2dd3('0x47')],{'$or':_[_0x2dd3('0x37')](_0x1ac610,function(_0x1517e5){if(_0x1517e5[_0x2dd3('0x48')]!==_0x2dd3('0x49')){var _0x1135eb={};_0x1135eb[_0x1517e5[_0x2dd3('0x3c')]]={'$like':'%'+_0xb7ac95[_0x2dd3('0x3d')]['filter']+'%'};return _0x1135eb;}})});}_0x5e92b0=_[_0x2dd3('0x4a')]({},_0x5e92b0,_0xb7ac95[_0x2dd3('0x4b')]);var _0x168667={'where':_0x5e92b0['where']};return db['Setting'][_0x2dd3('0x2d')](_0x168667)['then'](function(_0x54368d){_0x569dda[_0x2dd3('0x2d')]=_0x54368d;if(_0xb7ac95[_0x2dd3('0x3d')]['includeAll']){_0x5e92b0[_0x2dd3('0x4c')]=[{'all':!![]}];}return db[_0x2dd3('0x38')][_0x2dd3('0x4d')](_0x5e92b0);})['then'](function(_0x54037b){_0x569dda[_0x2dd3('0x4e')]=_0x54037b;return _0x569dda;})[_0x2dd3('0x1d')](respondWithFilteredResult(_0x3e1660,_0x5e92b0))['catch'](handleError(_0x3e1660,null));};exports['show']=function(_0x341c3b,_0x1d2e80){var _0x485856={'raw':![],'where':{'id':_0x341c3b[_0x2dd3('0x4f')]['id']}},_0x405fbf={};_0x405fbf[_0x2dd3('0x3b')]=_['keys'](db['Setting']['rawAttributes']);_0x405fbf['query']=_[_0x2dd3('0x50')](_0x341c3b[_0x2dd3('0x3d')]);_0x405fbf[_0x2dd3('0x3e')]=_[_0x2dd3('0x3f')](_0x405fbf['model'],_0x405fbf[_0x2dd3('0x3d')]);_0x485856[_0x2dd3('0x40')]=_[_0x2dd3('0x3f')](_0x405fbf['model'],qs[_0x2dd3('0x41')](_0x341c3b['query']['fields']));_0x485856['attributes']=_0x485856[_0x2dd3('0x40')]['length']?_0x485856['attributes']:_0x405fbf[_0x2dd3('0x3b')];if(_0x341c3b[_0x2dd3('0x3d')]['includeAll']){_0x485856[_0x2dd3('0x4c')]=[{'all':!![]}];}_0x485856=_[_0x2dd3('0x4a')]({},_0x485856,_0x341c3b[_0x2dd3('0x4b')]);return db[_0x2dd3('0x38')]['find'](_0x485856)[_0x2dd3('0x1d')](handleEntityNotFound(_0x1d2e80,null))['then'](respondWithResult(_0x1d2e80,null))[_0x2dd3('0x51')](handleError(_0x1d2e80,null));};exports[_0x2dd3('0x31')]=function(_0x8561,_0xd0ddb4){if(_0x8561[_0x2dd3('0x52')]['id']){delete _0x8561['body']['id'];}return db['Setting'][_0x2dd3('0x53')]({'where':{'id':_0x8561[_0x2dd3('0x4f')]['id']}})['then'](handleEntityNotFound(_0xd0ddb4,null))[_0x2dd3('0x1d')](saveUpdates(_0x8561[_0x2dd3('0x52')],null))[_0x2dd3('0x1d')](respondWithResult(_0xd0ddb4,null))['catch'](handleError(_0xd0ddb4,null));};exports[_0x2dd3('0x54')]=function(_0x5078c5,_0x3d4b40,_0x55a037){if(_0x5078c5[_0x2dd3('0x55')]&&_0x5078c5[_0x2dd3('0x55')]['filename']){_0x5078c5[_0x2dd3('0x52')][_0x2dd3('0x56')]=_0x5078c5['file'][_0x2dd3('0x57')];}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x5078c5[_0x2dd3('0x4f')]['id']}})[_0x2dd3('0x1d')](handleEntityNotFound(_0x3d4b40,null))[_0x2dd3('0x1d')](saveUpdates(_0x5078c5[_0x2dd3('0x52')],null))['then'](respondWithResult(_0x3d4b40,null))[_0x2dd3('0x51')](handleError(_0x3d4b40,null));};exports[_0x2dd3('0x58')]=function(_0x3dc22f,_0x1fd822,_0x166cbd){if(_0x3dc22f[_0x2dd3('0x55')]&&_0x3dc22f[_0x2dd3('0x55')][_0x2dd3('0x57')]){_0x3dc22f[_0x2dd3('0x52')][_0x2dd3('0x59')]=_0x3dc22f[_0x2dd3('0x55')][_0x2dd3('0x57')];}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x3dc22f[_0x2dd3('0x4f')]['id']}})[_0x2dd3('0x1d')](handleEntityNotFound(_0x1fd822,null))[_0x2dd3('0x1d')](saveUpdates(_0x3dc22f[_0x2dd3('0x52')],null))['then'](respondWithResult(_0x1fd822,null))['catch'](handleError(_0x1fd822,null));};var utilLicense=require(_0x2dd3('0x18'));exports[_0x2dd3('0x5a')]=function(_0x2db5da,_0x46a885,_0x55c490){var _0x1d0931=_0x2dd3('0x5b');var _0xed1127={'custom':![]};return utilLicense[_0x2dd3('0x5c')]()[_0x2dd3('0x1d')](function(_0x43268a){if(_0x43268a){_0xed1127=_0x43268a;}return db[_0x2dd3('0x38')]['find']({'where':{'id':_0x2db5da[_0x2dd3('0x4f')]['id']},'attributes':[_0x2dd3('0x56'),_0x2dd3('0x59'),_0x2dd3('0x5d'),_0x2dd3('0x5e'),_0x2dd3('0x5f'),_0x2dd3('0x60'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x2dd3('0x1d')](handleEntityNotFound(_0x46a885,null))[_0x2dd3('0x1d')](function(_0x215dfb){if(_0x215dfb){var _0x508874=_0x215dfb['logo']&&fs[_0x2dd3('0x61')](path['join'](config[_0x2dd3('0x62')],_0x1d0931,_[_0x2dd3('0x63')](_0x215dfb[_0x2dd3('0x56')])))?path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x1d0931,_[_0x2dd3('0x63')](_0x215dfb[_0x2dd3('0x56')])):path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x1d0931,_['toLower'](_0x2dd3('0x65')));var _0x34fd54=_0x2dd3('0x66')+_[_0x2dd3('0x67')](_0x2dd3('0x56'));if(_0x215dfb[_0x34fd54]||!_0xed1127[_0x2dd3('0x68')]){_0x508874=path['join'](config[_0x2dd3('0x62')],_0x1d0931,_[_0x2dd3('0x63')](_0x2dd3('0x65')));}if(!fs[_0x2dd3('0x61')](_0x508874)){throw new db[(_0x2dd3('0x69'))]['ValidationError'](_[_0x2dd3('0x67')](_0x2dd3('0x56'))+_0x2dd3('0x6a'));}return _0x46a885[_0x2dd3('0x6b')](_0x508874);}})[_0x2dd3('0x51')](handleError(_0x46a885,null));};var utilLicense=require('../../config/license/util');exports[_0x2dd3('0x6c')]=function(_0x763b4c,_0x30626c,_0x15d832){var _0x53e7ae=_0x2dd3('0x5b');var _0x57db4c={'custom':![]};return utilLicense[_0x2dd3('0x5c')]()[_0x2dd3('0x1d')](function(_0x53ef16){if(_0x53ef16){_0x57db4c=_0x53ef16;}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x763b4c['params']['id']},'attributes':['logo',_0x2dd3('0x59'),'preferred',_0x2dd3('0x5e'),'defaultLogo',_0x2dd3('0x60'),_0x2dd3('0x6d'),_0x2dd3('0x6e')],'raw':!![]});})[_0x2dd3('0x1d')](handleEntityNotFound(_0x30626c,null))[_0x2dd3('0x1d')](function(_0x42810d){if(_0x42810d){var _0x55fb8f=_0x42810d[_0x2dd3('0x59')]&&fs[_0x2dd3('0x61')](path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x53e7ae,_[_0x2dd3('0x63')](_0x42810d[_0x2dd3('0x59')])))?path['join'](config[_0x2dd3('0x62')],_0x53e7ae,_['toLower'](_0x42810d[_0x2dd3('0x59')])):path['join'](config[_0x2dd3('0x62')],_0x53e7ae,_['toLower'](_0x2dd3('0x6f')));var _0x715f8f=_0x2dd3('0x66')+_['upperFirst']('loginLogo');if(_0x42810d[_0x715f8f]||!_0x57db4c[_0x2dd3('0x68')]){_0x55fb8f=path[_0x2dd3('0x64')](config['root'],_0x53e7ae,_[_0x2dd3('0x63')](_0x2dd3('0x6f')));}if(!fs[_0x2dd3('0x61')](_0x55fb8f)){throw new db[(_0x2dd3('0x69'))][(_0x2dd3('0x70'))](_[_0x2dd3('0x67')](_0x2dd3('0x59'))+_0x2dd3('0x6a'));}return _0x30626c[_0x2dd3('0x6b')](_0x55fb8f);}})[_0x2dd3('0x51')](handleError(_0x30626c,null));};exports[_0x2dd3('0x71')]=function(_0x4c7285,_0x1383fa){return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x4c7285['params']['id']},'attributes':[_0x2dd3('0x72')]})['then'](respondWithResult(_0x1383fa,null))[_0x2dd3('0x51')](handleError(_0x1383fa,null));};exports[_0x2dd3('0x73')]=function(_0x39d58d,_0x17b358,_0x4fe5f0){if(_0x39d58d['file']&&_0x39d58d[_0x2dd3('0x55')][_0x2dd3('0x57')]){_0x39d58d[_0x2dd3('0x52')][_0x2dd3('0x5d')]=_0x39d58d[_0x2dd3('0x55')][_0x2dd3('0x57')];}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x39d58d[_0x2dd3('0x4f')]['id']}})[_0x2dd3('0x1d')](handleEntityNotFound(_0x17b358,null))[_0x2dd3('0x1d')](saveUpdates(_0x39d58d[_0x2dd3('0x52')],null))[_0x2dd3('0x1d')](respondWithResult(_0x17b358,null))['catch'](handleError(_0x17b358,null));};var utilLicense=require(_0x2dd3('0x18'));exports[_0x2dd3('0x74')]=function(_0x466d5c,_0xcad13,_0x29a46f){var _0x306e61=_0x2dd3('0x5b');var _0x43377b={'custom':![]};return utilLicense[_0x2dd3('0x5c')]()[_0x2dd3('0x1d')](function(_0xaced0c){if(_0xaced0c){_0x43377b=_0xaced0c;}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x466d5c[_0x2dd3('0x4f')]['id']},'attributes':['logo','loginLogo',_0x2dd3('0x5d'),_0x2dd3('0x5e'),'defaultLogo',_0x2dd3('0x60'),_0x2dd3('0x6d'),_0x2dd3('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0xcad13,null))[_0x2dd3('0x1d')](function(_0xaa0f51){if(_0xaa0f51){var _0x45555e=_0xaa0f51['preferred']&&fs['existsSync'](path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x306e61,_[_0x2dd3('0x63')](_0xaa0f51['preferred'])))?path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x306e61,_[_0x2dd3('0x63')](_0xaa0f51[_0x2dd3('0x5d')])):path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x306e61,_[_0x2dd3('0x63')](_0x2dd3('0x75')));var _0x3ea39c='default'+_[_0x2dd3('0x67')](_0x2dd3('0x5d'));if(_0xaa0f51[_0x3ea39c]||!_0x43377b[_0x2dd3('0x68')]||!_0x43377b[_0x2dd3('0x5d')]){_0x45555e=path['join'](config[_0x2dd3('0x62')],_0x306e61,_[_0x2dd3('0x63')]('default_preferred.png'));}if(!fs['existsSync'](_0x45555e)){throw new db[(_0x2dd3('0x69'))]['ValidationError'](_['upperFirst'](_0x2dd3('0x5d'))+_0x2dd3('0x6a'));}return _0xcad13[_0x2dd3('0x6b')](_0x45555e);}})[_0x2dd3('0x51')](handleError(_0xcad13,null));};exports[_0x2dd3('0x76')]=function(_0x4dedfd,_0x21c383,_0xea0ecd){if(_0x4dedfd['file']&&_0x4dedfd[_0x2dd3('0x55')][_0x2dd3('0x57')]){_0x4dedfd[_0x2dd3('0x52')]['favicon']=_0x4dedfd[_0x2dd3('0x55')][_0x2dd3('0x57')];}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x4dedfd['params']['id']}})[_0x2dd3('0x1d')](handleEntityNotFound(_0x21c383,null))['then'](saveUpdates(_0x4dedfd[_0x2dd3('0x52')],null))[_0x2dd3('0x1d')](respondWithResult(_0x21c383,null))['catch'](handleError(_0x21c383,null));};var utilLicense=require('../../config/license/util');exports[_0x2dd3('0x77')]=function(_0x682d8c,_0x1990a8,_0x13cd9e){var _0x430129=_0x2dd3('0x5b');var _0x5554e6={'custom':![]};return utilLicense[_0x2dd3('0x5c')]()['then'](function(_0x130b75){if(_0x130b75){_0x5554e6=_0x130b75;}return db[_0x2dd3('0x38')][_0x2dd3('0x53')]({'where':{'id':_0x682d8c[_0x2dd3('0x4f')]['id']},'attributes':['logo',_0x2dd3('0x59'),_0x2dd3('0x5d'),_0x2dd3('0x5e'),_0x2dd3('0x5f'),_0x2dd3('0x60'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x1990a8,null))['then'](function(_0x4cccef){if(_0x4cccef){var _0x2adbf2=_0x4cccef[_0x2dd3('0x5e')]&&fs[_0x2dd3('0x61')](path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x430129,_[_0x2dd3('0x63')](_0x4cccef[_0x2dd3('0x5e')])))?path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x430129,_[_0x2dd3('0x63')](_0x4cccef[_0x2dd3('0x5e')])):path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x430129,_[_0x2dd3('0x63')](_0x2dd3('0x78')));var _0x19f5cc='default'+_[_0x2dd3('0x67')](_0x2dd3('0x5e'));if(_0x4cccef[_0x19f5cc]||!_0x5554e6['custom']){_0x2adbf2=path[_0x2dd3('0x64')](config[_0x2dd3('0x62')],_0x430129,_['toLower'](_0x2dd3('0x78')));}if(!fs[_0x2dd3('0x61')](_0x2adbf2)){throw new db[(_0x2dd3('0x69'))][(_0x2dd3('0x70'))](_[_0x2dd3('0x67')]('favicon')+'\x20not\x20found');}return _0x1990a8['download'](_0x2adbf2);}})[_0x2dd3('0x51')](handleError(_0x1990a8,null));};exports[_0x2dd3('0x79')]=function(_0x5de014,_0x55815b){var _0x3d7474={'offset':moment()[_0x2dd3('0x7a')]()};_0x3d7474[_0x2dd3('0x7b')]=moment()[_0x2dd3('0x7a')](_0x3d7474[_0x2dd3('0x2a')])[_0x2dd3('0x7c')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x55815b['status'](0xc8)['send'](_0x3d7474);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 1f2531a..3035fbc 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(_0x3a4071,_0x5dc8c2){var _0x2a1fa8=function(_0x16f06b){while(--_0x16f06b){_0x3a4071['push'](_0x3a4071['shift']());}};_0x2a1fa8(++_0x5dc8c2);}(_0xedd9,0xfc));var _0x9edd=function(_0x37f56a,_0xbc6767){_0x37f56a=_0x37f56a-0x0;var _0x5669ce=_0xedd9[_0x37f56a];return _0x5669ce;};'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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x24502f,_0x134350){var _0x402fd9=function(_0x5e90b2){while(--_0x5e90b2){_0x24502f['push'](_0x24502f['shift']());}};_0x402fd9(++_0x134350);}(_0x008c,0x188));var _0xc008=function(_0x37d5ff,_0x5ee83b){_0x37d5ff=_0x37d5ff-0x0;var _0x146b37=_0x008c[_0x37d5ff];return _0x146b37;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));module[_0xc008('0xa')]=function(_0x13aa7,_0x39bb5e){return _0x13aa7[_0xc008('0xb')]('Setting',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 5876025..ca9229e 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 _0xc6bb=['message','result','catch','Setting','find','options','attributes','include','map','model','then','ShowSetting','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','client','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc6bb,0x1ec));var _0xbc6b=function(_0x1497f2,_0xc53563){_0x1497f2=_0x1497f2-0x0;var _0x5de0a9=_0xc6bb[_0x1497f2];return _0x5de0a9;};'use strict';var _=require(_0xbc6b('0x0'));var util=require(_0xbc6b('0x1'));var moment=require(_0xbc6b('0x2'));var BPromise=require(_0xbc6b('0x3'));var rs=require(_0xbc6b('0x4'));var fs=require('fs');var Redis=require(_0xbc6b('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xbc6b('0x6'))(_0xbc6b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbc6b('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20e805,_0x4a7652,_0x585e00){return new BPromise(function(_0x2429d5,_0x2314b5){return client[_0xbc6b('0x9')](_0x20e805,_0x585e00)['then'](function(_0x2cebd1){logger[_0xbc6b('0xa')](_0xbc6b('0xb'),_0x4a7652,_0xbc6b('0xc'));logger[_0xbc6b('0xd')](_0xbc6b('0xe'),_0x4a7652,_0xbc6b('0xc'),JSON[_0xbc6b('0xf')](_0x2cebd1));if(_0x2cebd1['error']){if(_0x2cebd1[_0xbc6b('0x10')][_0xbc6b('0x11')]===0x1f4){logger[_0xbc6b('0x10')]('Setting,\x20%s,\x20%s',_0x4a7652,_0x2cebd1[_0xbc6b('0x10')]['message']);return _0x2314b5(_0x2cebd1[_0xbc6b('0x10')][_0xbc6b('0x12')]);}logger[_0xbc6b('0x10')]('Setting,\x20%s,\x20%s',_0x4a7652,_0x2cebd1[_0xbc6b('0x10')][_0xbc6b('0x12')]);return _0x2429d5(_0x2cebd1['error'][_0xbc6b('0x12')]);}else{logger[_0xbc6b('0xa')](_0xbc6b('0xb'),_0x4a7652,_0xbc6b('0xc'));_0x2429d5(_0x2cebd1[_0xbc6b('0x13')][_0xbc6b('0x12')]);}})[_0xbc6b('0x14')](function(_0x1f96cb){logger[_0xbc6b('0x10')](_0xbc6b('0xb'),_0x4a7652,_0x1f96cb);_0x2314b5(_0x1f96cb);});});}exports['ShowSetting']=function(_0x2db024){var _0x48f6dc=this;return new Promise(function(_0x5a5319,_0x2e2ac4){return db[_0xbc6b('0x15')][_0xbc6b('0x16')]({'raw':_0x2db024[_0xbc6b('0x17')]?_0x2db024['options']['raw']===undefined?!![]:![]:!![],'where':_0x2db024['options']?_0x2db024[_0xbc6b('0x17')]['where']||null:null,'attributes':_0x2db024[_0xbc6b('0x17')]?_0x2db024[_0xbc6b('0x17')][_0xbc6b('0x18')]||null:null,'include':_0x2db024[_0xbc6b('0x17')]?_0x2db024[_0xbc6b('0x17')][_0xbc6b('0x19')]?_['map'](_0x2db024['options']['include'],function(_0x2ee74f){return{'model':db[_0x2ee74f['model']],'as':_0x2ee74f['as'],'attributes':_0x2ee74f[_0xbc6b('0x18')],'include':_0x2ee74f[_0xbc6b('0x19')]?_['map'](_0x2ee74f[_0xbc6b('0x19')],function(_0x1b372d){return{'model':db[_0x1b372d['model']],'as':_0x1b372d['as'],'attributes':_0x1b372d[_0xbc6b('0x18')],'include':_0x1b372d['include']?_[_0xbc6b('0x1a')](_0x1b372d[_0xbc6b('0x19')],function(_0x52a0f7){return{'model':db[_0x52a0f7[_0xbc6b('0x1b')]],'as':_0x52a0f7['as'],'attributes':_0x52a0f7[_0xbc6b('0x18')]};}):[]};}):[]};}):[]:[]})[_0xbc6b('0x1c')](function(_0x49f77b){logger[_0xbc6b('0xa')](_0xbc6b('0x1d'),_0x2db024);logger['debug'](_0xbc6b('0x1d'),_0x2db024,JSON[_0xbc6b('0xf')](_0x49f77b));_0x5a5319(_0x49f77b);})[_0xbc6b('0x14')](function(_0x5192d1){logger[_0xbc6b('0x10')]('ShowSetting',_0x5192d1[_0xbc6b('0x12')],_0x2db024);_0x2e2ac4(_0x48f6dc['error'](0x1f4,_0x5192d1[_0xbc6b('0x12')]));});});}; \ No newline at end of file +var _0xac99=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','debug','stringify','error','code','Setting,\x20%s,\x20%s','message','info','request\x20sent','result','catch','ShowSetting','Setting','find','options','raw','attributes','include','model','map','moment'];(function(_0x5b51d2,_0xd3846c){var _0x1ecc32=function(_0x26c8a1){while(--_0x26c8a1){_0x5b51d2['push'](_0x5b51d2['shift']());}};_0x1ecc32(++_0xd3846c);}(_0xac99,0xd1));var _0x9ac9=function(_0x42f9a1,_0x229b92){_0x42f9a1=_0x42f9a1-0x0;var _0x2c3462=_0xac99[_0x42f9a1];return _0x2c3462;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9ac9('0x0'));var BPromise=require(_0x9ac9('0x1'));var rs=require(_0x9ac9('0x2'));var fs=require('fs');var Redis=require(_0x9ac9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9ac9('0x4'));var logger=require(_0x9ac9('0x5'))(_0x9ac9('0x6'));var config=require('../../config/environment');var jayson=require(_0x9ac9('0x7'));var client=jayson[_0x9ac9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x397ca9,_0x453b09,_0x3dad74){return new BPromise(function(_0x29b42e,_0x2ab88c){return client[_0x9ac9('0x9')](_0x397ca9,_0x3dad74)[_0x9ac9('0xa')](function(_0x376dfc){logger['info']('Setting,\x20%s,\x20%s',_0x453b09,'request\x20sent');logger[_0x9ac9('0xb')]('Setting,\x20%s,\x20%s,\x20%s',_0x453b09,'request\x20sent',JSON[_0x9ac9('0xc')](_0x376dfc));if(_0x376dfc[_0x9ac9('0xd')]){if(_0x376dfc['error'][_0x9ac9('0xe')]===0x1f4){logger[_0x9ac9('0xd')](_0x9ac9('0xf'),_0x453b09,_0x376dfc[_0x9ac9('0xd')]['message']);return _0x2ab88c(_0x376dfc[_0x9ac9('0xd')]['message']);}logger[_0x9ac9('0xd')](_0x9ac9('0xf'),_0x453b09,_0x376dfc[_0x9ac9('0xd')][_0x9ac9('0x10')]);return _0x29b42e(_0x376dfc[_0x9ac9('0xd')][_0x9ac9('0x10')]);}else{logger[_0x9ac9('0x11')](_0x9ac9('0xf'),_0x453b09,_0x9ac9('0x12'));_0x29b42e(_0x376dfc[_0x9ac9('0x13')]['message']);}})[_0x9ac9('0x14')](function(_0x20a867){logger[_0x9ac9('0xd')](_0x9ac9('0xf'),_0x453b09,_0x20a867);_0x2ab88c(_0x20a867);});});}exports[_0x9ac9('0x15')]=function(_0x394168){var _0x2b7a66=this;return new Promise(function(_0xaa656f,_0x2e2e13){return db[_0x9ac9('0x16')][_0x9ac9('0x17')]({'raw':_0x394168[_0x9ac9('0x18')]?_0x394168[_0x9ac9('0x18')][_0x9ac9('0x19')]===undefined?!![]:![]:!![],'where':_0x394168[_0x9ac9('0x18')]?_0x394168[_0x9ac9('0x18')]['where']||null:null,'attributes':_0x394168['options']?_0x394168[_0x9ac9('0x18')][_0x9ac9('0x1a')]||null:null,'include':_0x394168[_0x9ac9('0x18')]?_0x394168[_0x9ac9('0x18')][_0x9ac9('0x1b')]?_['map'](_0x394168[_0x9ac9('0x18')][_0x9ac9('0x1b')],function(_0x5eacb8){return{'model':db[_0x5eacb8['model']],'as':_0x5eacb8['as'],'attributes':_0x5eacb8['attributes'],'include':_0x5eacb8[_0x9ac9('0x1b')]?_['map'](_0x5eacb8[_0x9ac9('0x1b')],function(_0x3417aa){return{'model':db[_0x3417aa[_0x9ac9('0x1c')]],'as':_0x3417aa['as'],'attributes':_0x3417aa[_0x9ac9('0x1a')],'include':_0x3417aa[_0x9ac9('0x1b')]?_[_0x9ac9('0x1d')](_0x3417aa['include'],function(_0x15514c){return{'model':db[_0x15514c[_0x9ac9('0x1c')]],'as':_0x15514c['as'],'attributes':_0x15514c[_0x9ac9('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x9ac9('0xa')](function(_0xfebdf2){logger['info'](_0x9ac9('0x15'),_0x394168);logger[_0x9ac9('0xb')]('ShowSetting',_0x394168,JSON[_0x9ac9('0xc')](_0xfebdf2));_0xaa656f(_0xfebdf2);})[_0x9ac9('0x14')](function(_0x2fa7f4){logger[_0x9ac9('0xd')](_0x9ac9('0x15'),_0x2fa7f4['message'],_0x394168);_0x2e2e13(_0x2b7a66['error'](0x1f4,_0x2fa7f4[_0x9ac9('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 78c481d..9d91c76 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 _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(_0x43319c,_0x57abc9){var _0x2ad404=function(_0x3edd39){while(--_0x3edd39){_0x43319c['push'](_0x43319c['shift']());}};_0x2ad404(++_0x57abc9);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/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 +var _0x8ef6=['addApplications','/:id/send','send','status','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsAccount.controller','get','/describe','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/status','statusGet','/:id/users','getAgents','create','post','addDisposition','addAnswer','notify'];(function(_0x1c643f,_0x328c4c){var _0x28af2d=function(_0x59d4f4){while(--_0x59d4f4){_0x1c643f['push'](_0x1c643f['shift']());}};_0x28af2d(++_0x328c4c);}(_0x8ef6,0xf2));var _0x68ef=function(_0x213c1e,_0x1de77e){_0x213c1e=_0x213c1e-0x0;var _0x5a7aef=_0x8ef6[_0x213c1e];return _0x5a7aef;};'use strict';var multer=require(_0x68ef('0x0'));var util=require(_0x68ef('0x1'));var path=require(_0x68ef('0x2'));var timeout=require(_0x68ef('0x3'));var express=require(_0x68ef('0x4'));var router=express[_0x68ef('0x5')]();var fs_extra=require(_0x68ef('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x68ef('0x7'));var config=require(_0x68ef('0x8'));var controller=require(_0x68ef('0x9'));router[_0x68ef('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x68ef('0xa')](_0x68ef('0xb'),auth[_0x68ef('0xc')](),controller['describe']);router[_0x68ef('0xa')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0xe')]);router[_0x68ef('0xa')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x10')]);router[_0x68ef('0xa')](_0x68ef('0x11'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x12')]);router['get'](_0x68ef('0x13'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x14')]);router[_0x68ef('0xa')](_0x68ef('0x15'),auth[_0x68ef('0xc')](),controller['getInteractions']);router[_0x68ef('0xa')](_0x68ef('0x16'),controller[_0x68ef('0x17')]);router['get'](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x19')]);router['post']('/',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1a')]);router[_0x68ef('0x1b')](_0x68ef('0xf'),auth['isAuthenticated'](),controller[_0x68ef('0x1c')]);router['post']('/:id/canned_answers',auth[_0x68ef('0xc')](),controller[_0x68ef('0x1d')]);router['post']('/:id/notify',controller[_0x68ef('0x1e')]);router[_0x68ef('0x1b')](_0x68ef('0x13'),auth['isAuthenticated'](),controller[_0x68ef('0x1f')]);router[_0x68ef('0x1b')](_0x68ef('0x20'),auth['isAuthenticated'](),controller[_0x68ef('0x21')]);router[_0x68ef('0x1b')]('/:id/status',controller[_0x68ef('0x22')]);router[_0x68ef('0x1b')](_0x68ef('0x18'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x23')]);router[_0x68ef('0x24')](_0x68ef('0xd'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x25')]);router[_0x68ef('0x24')](_0x68ef('0xf'),auth[_0x68ef('0xc')](),controller['removeDispositions']);router[_0x68ef('0x24')]('/:id/canned_answers',auth['isAuthenticated'](),controller['removeAnswers']);router[_0x68ef('0x24')](_0x68ef('0x18'),auth[_0x68ef('0xc')](),controller[_0x68ef('0x26')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 59a489c..2345d4e 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 _0xf21f=['ENUM','skebby','connectel','clickatell','bandwidth','infobip','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','generate'];(function(_0x27bb81,_0x23b0f7){var _0x181bb1=function(_0x22d3f3){while(--_0x22d3f3){_0x27bb81['push'](_0x27bb81['shift']());}};_0x181bb1(++_0x23b0f7);}(_0xf21f,0x1c8));var _0xff21=function(_0x3c05be,_0x5cd7c6){_0x3c05be=_0x3c05be-0x0;var _0x1453b9=_0xf21f[_0x3c05be];return _0x1453b9;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xff21('0x0')]={'name':{'type':Sequelize[_0xff21('0x1')],'unique':'name','allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0xff21('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xff21('0x1')],'defaultValue':function(){return rs[_0xff21('0x2')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xff21('0x3')]('twilio',_0xff21('0x4'),_0xff21('0x5'),'clicksend','plivo',_0xff21('0x6'),_0xff21('0x7'),'csc',_0xff21('0x8'),'intelepeer')},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0xff21('0x1')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xff21('0x3')]('SI','TI','GP')},'username':{'type':Sequelize[_0xff21('0x1')]},'password':{'type':Sequelize[_0xff21('0x1')]},'apiKey':{'type':Sequelize[_0xff21('0x1')]},'applicationId':{'type':Sequelize[_0xff21('0x1')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0xff21('0x1')]},'deliveryReport':{'type':Sequelize[_0xff21('0x9')],'defaultValue':![]},'description':{'type':Sequelize[_0xff21('0x1')]},'notificationTemplate':{'type':Sequelize[_0xff21('0xa')],'defaultValue':function(){return _0xff21('0xb');}},'notificationSound':{'type':Sequelize[_0xff21('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xff21('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff21('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xff21('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xff21('0x1')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff21('0xc')],'comment':_0xff21('0xd')},'mandatoryDisposition':{'type':Sequelize[_0xff21('0x9')],'defaultValue':![],'comment':_0xff21('0xe'),'set':function(_0x10b86a){if(!_0x10b86a)this[_0xff21('0xf')]('mandatoryDispositionPauseId',null);this[_0xff21('0xf')](_0xff21('0x10'),_0x10b86a);}}}; \ No newline at end of file +var _0x8e03=['TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','skebby','connectel','clicksend','bandwidth','csc','infobip','intelepeer','BOOLEAN'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8e03,0x1c0));var _0x38e0=function(_0x340917,_0x11ec34){_0x340917=_0x340917-0x0;var _0x446539=_0x8e03[_0x340917];return _0x446539;};'use strict';var Sequelize=require(_0x38e0('0x0'));var rs=require(_0x38e0('0x1'));module[_0x38e0('0x2')]={'name':{'type':Sequelize[_0x38e0('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x38e0('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x38e0('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x38e0('0x3')],'defaultValue':function(){return rs[_0x38e0('0x4')]();}},'phone':{'type':Sequelize[_0x38e0('0x3')]},'type':{'type':Sequelize[_0x38e0('0x5')]('twilio',_0x38e0('0x6'),_0x38e0('0x7'),_0x38e0('0x8'),'plivo','clickatell',_0x38e0('0x9'),_0x38e0('0xa'),_0x38e0('0xb'),_0x38e0('0xc'))},'accountSid':{'type':Sequelize[_0x38e0('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x38e0('0x3')]},'smsMethod':{'type':Sequelize[_0x38e0('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0x38e0('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x38e0('0x3')]},'applicationId':{'type':Sequelize[_0x38e0('0x3')]},'accountId':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize[_0x38e0('0x3')]},'deliveryReport':{'type':Sequelize[_0x38e0('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x38e0('0x3')]},'notificationTemplate':{'type':Sequelize[_0x38e0('0xe')],'defaultValue':function(){return _0x38e0('0xf');}},'notificationSound':{'type':Sequelize[_0x38e0('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x38e0('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x38e0('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x38e0('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x38e0('0x3')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x38e0('0x10')],'comment':_0x38e0('0x11')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x38e0('0x12'),'set':function(_0x41e849){if(!_0x41e849)this[_0x38e0('0x13')]('mandatoryDispositionPauseId',null);this[_0x38e0('0x13')](_0x38e0('0x14'),_0x41e849);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 58d711a..5aba5ec 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 _0x1145=['ContactId','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','info','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','twilio','set','Content-Type','\x0a','addApplications','transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','finally','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','inspect','connectel','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','request','then','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','destroy','get','SmsAccounts','stack','name','send','index','SmsAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','Pause','mandatoryDispositionPause','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','findOne','pick','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','from','Body','messageId','MessageSid','skebby','sender','clicksend','message_id','From','Text','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','bandwidth','intelepeer','refid','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','omit','contact','SmsInteraction','spread','created','autoclose','close','unmanaged','*,*,*,*','interaction','SmsMessage'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x1145,0x125));var _0x5114=function(_0x5a91db,_0x402e1b){_0x5a91db=_0x5a91db-0x0;var _0x35fcd4=_0x1145[_0x5a91db];return _0x35fcd4;};'use strict';var emlformat=require(_0x5114('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5114('0x1'));var BPromise=require(_0x5114('0x2'));var Mustache=require('mustache');var util=require(_0x5114('0x3'));var path=require(_0x5114('0x4'));var sox=require(_0x5114('0x5'));var csv=require(_0x5114('0x6'));var ejs=require(_0x5114('0x7'));var fs=require('fs');var fs_extra=require(_0x5114('0x8'));var _=require(_0x5114('0x9'));var squel=require('squel');var crypto=require(_0x5114('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5114('0x6'));var querystring=require(_0x5114('0xb'));var Papa=require(_0x5114('0xc'));var Redis=require(_0x5114('0xd'));var authService=require(_0x5114('0xe'));var qs=require(_0x5114('0xf'));var as=require(_0x5114('0x10'));var hardwareService=require(_0x5114('0x11'));var logger=require(_0x5114('0x12'))('api');var utils=require(_0x5114('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x5114('0x14'));var db=require(_0x5114('0x15'))['db'];config[_0x5114('0x16')]=_[_0x5114('0x17')](config[_0x5114('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x5114('0x18'))(new Redis(config[_0x5114('0x16')]));require(_0x5114('0x19'))[_0x5114('0x1a')](socket);var jayson=require(_0x5114('0x1b'));var client=jayson[_0x5114('0x1c')][_0x5114('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xd2974e,_0x53a247,_0x3fd0c6,_0x3b8c26){return new BPromise(function(_0x31a34f,_0x1e10a5){var _0x3ca651=_0x3b8c26||client;return _0x3ca651[_0x5114('0x1e')](_0xd2974e,_0x3fd0c6)[_0x5114('0x1f')](function(_0x37d436){logger['info'](_0x5114('0x20'),_0x53a247,'request\x20sent');logger['debug'](_0x5114('0x21'),_0x53a247,_0x5114('0x22'),JSON[_0x5114('0x23')](_0x37d436));if(_0x37d436[_0x5114('0x24')]){if(_0x37d436[_0x5114('0x24')][_0x5114('0x25')]===0x1f4){logger[_0x5114('0x24')](_0x5114('0x20'),_0x53a247,_0x37d436[_0x5114('0x24')][_0x5114('0x26')]);return _0x1e10a5(_0x37d436['error'][_0x5114('0x26')]);}logger[_0x5114('0x24')](_0x5114('0x20'),_0x53a247,_0x37d436[_0x5114('0x24')][_0x5114('0x26')]);return _0x31a34f(_0x37d436[_0x5114('0x24')][_0x5114('0x26')]);}else{logger['info'](_0x5114('0x20'),_0x53a247,'request\x20sent');_0x31a34f(_0x37d436[_0x5114('0x27')]['message']);}})['catch'](function(_0x1d388c){logger[_0x5114('0x24')](_0x5114('0x20'),_0x53a247,_0x1d388c);_0x1e10a5(_0x1d388c);});});}function respondWithStatusCode(_0x4f12ad,_0x70c2ec){_0x70c2ec=_0x70c2ec||0xcc;return function(_0x1c0cb5){if(_0x1c0cb5){return _0x4f12ad[_0x5114('0x28')](_0x70c2ec);}return _0x4f12ad[_0x5114('0x29')](_0x70c2ec)[_0x5114('0x2a')]();};}function respondWithResult(_0x23df64,_0x5479dd){_0x5479dd=_0x5479dd||0xc8;return function(_0x2a49d0){if(_0x2a49d0){return _0x23df64['status'](_0x5479dd)[_0x5114('0x2b')](_0x2a49d0);}};}function respondWithFilteredResult(_0x21134f,_0x5ba0b0){return function(_0x57d556){if(_0x57d556){var _0x44290c=typeof _0x5ba0b0[_0x5114('0x2c')]===_0x5114('0x2d')&&typeof _0x5ba0b0[_0x5114('0x2e')]==='undefined';var _0x521c1a=_0x57d556['count'];var _0x25c8fa=_0x44290c?0x0:_0x5ba0b0[_0x5114('0x2c')];var _0x46ad66=_0x44290c?_0x57d556[_0x5114('0x2f')]:_0x5ba0b0[_0x5114('0x2c')]+_0x5ba0b0[_0x5114('0x2e')];var _0x589217;if(_0x46ad66>=_0x521c1a){_0x46ad66=_0x521c1a;_0x589217=0xc8;}else{_0x589217=0xce;}_0x21134f['status'](_0x589217);return _0x21134f['set']('Content-Range',_0x25c8fa+'-'+_0x46ad66+'/'+_0x521c1a)[_0x5114('0x2b')](_0x57d556);}return null;};}function patchUpdates(_0x4c284c){return function(_0x50c17e){try{jsonpatch[_0x5114('0x30')](_0x50c17e,_0x4c284c,!![]);}catch(_0x4dc65a){return BPromise[_0x5114('0x31')](_0x4dc65a);}return _0x50c17e[_0x5114('0x32')]();};}function saveUpdates(_0x508aff,_0x591662){return function(_0x3acb0e){if(_0x3acb0e){return _0x3acb0e[_0x5114('0x33')](_0x508aff)[_0x5114('0x1f')](function(_0x426395){return _0x426395;});}return null;};}function removeEntity(_0x38d379,_0x4aef26){return function(_0x193a15){if(_0x193a15){return _0x193a15[_0x5114('0x34')]()[_0x5114('0x1f')](function(){var _0x504216=_0x193a15[_0x5114('0x35')]({'plain':!![]});var _0x299edc=_0x5114('0x36');return db['UserProfileResource'][_0x5114('0x34')]({'where':{'type':_0x299edc,'resourceId':_0x504216['id']}})[_0x5114('0x1f')](function(){return _0x193a15;});})['then'](function(){_0x38d379[_0x5114('0x29')](0xcc)[_0x5114('0x2a')]();});}};}function handleEntityNotFound(_0x40d7eb,_0x244620){return function(_0x418bc4){if(!_0x418bc4){_0x40d7eb[_0x5114('0x28')](0x194);}return _0x418bc4;};}function handleError(_0xf93903,_0x494a9d){_0x494a9d=_0x494a9d||0x1f4;return function(_0x19aaf6){logger[_0x5114('0x24')](_0x19aaf6[_0x5114('0x37')]);if(_0x19aaf6['name']){delete _0x19aaf6[_0x5114('0x38')];}_0xf93903['status'](_0x494a9d)[_0x5114('0x39')](_0x19aaf6);};}exports[_0x5114('0x3a')]=function(_0x186119,_0x446c42){var _0xc808c3={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x25e7e9={},_0x42baa8={'count':0x0,'rows':[]};var _0x4fc0ca=_['map'](db[_0x5114('0x3b')][_0x5114('0x3c')],function(_0x1a3418){return{'name':_0x1a3418[_0x5114('0x3d')],'type':_0x1a3418[_0x5114('0x3e')]['key']};});_0x25e7e9[_0x5114('0x3f')]=_[_0x5114('0x40')](_0x4fc0ca,'name');_0x25e7e9[_0x5114('0x41')]=_[_0x5114('0x42')](_0x186119['query']);_0x25e7e9[_0x5114('0x43')]=_[_0x5114('0x44')](_0x25e7e9[_0x5114('0x3f')],_0x25e7e9[_0x5114('0x41')]);_0xc808c3[_0x5114('0x45')]=_['intersection'](_0x25e7e9[_0x5114('0x3f')],qs['fields'](_0x186119['query'][_0x5114('0x46')]));_0xc808c3[_0x5114('0x45')]=_0xc808c3[_0x5114('0x45')]['length']?_0xc808c3[_0x5114('0x45')]:_0x25e7e9[_0x5114('0x3f')];if(!_0x186119[_0x5114('0x41')][_0x5114('0x47')](_0x5114('0x48'))){_0xc808c3[_0x5114('0x2e')]=qs[_0x5114('0x2e')](_0x186119['query']['limit']);_0xc808c3[_0x5114('0x2c')]=qs[_0x5114('0x2c')](_0x186119['query']['offset']);}_0xc808c3[_0x5114('0x49')]=qs[_0x5114('0x4a')](_0x186119[_0x5114('0x41')][_0x5114('0x4a')]);_0xc808c3[_0x5114('0x4b')]=qs[_0x5114('0x43')](_['pick'](_0x186119[_0x5114('0x41')],_0x25e7e9[_0x5114('0x43')]),_0x4fc0ca);if(_0x186119[_0x5114('0x41')][_0x5114('0x4c')]){_0xc808c3[_0x5114('0x4b')]=_[_0x5114('0x4d')](_0xc808c3[_0x5114('0x4b')],{'$or':_[_0x5114('0x40')](_0x4fc0ca,function(_0x403ade){if(_0x403ade[_0x5114('0x3e')]!==_0x5114('0x4e')){var _0x1781d1={};_0x1781d1[_0x403ade[_0x5114('0x38')]]={'$like':'%'+_0x186119['query'][_0x5114('0x4c')]+'%'};return _0x1781d1;}})});}_0xc808c3=_['merge']({},_0xc808c3,_0x186119[_0x5114('0x4f')]);var _0x152da0={'where':_0xc808c3[_0x5114('0x4b')]};return db[_0x5114('0x3b')][_0x5114('0x2f')](_0x152da0)[_0x5114('0x1f')](function(_0x4202ba){_0x42baa8[_0x5114('0x2f')]=_0x4202ba;if(_0x186119[_0x5114('0x41')][_0x5114('0x50')]){_0xc808c3['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0xc808c3);})[_0x5114('0x1f')](function(_0x26ebfb){_0x42baa8[_0x5114('0x51')]=_0x26ebfb;return _0x42baa8;})[_0x5114('0x1f')](respondWithFilteredResult(_0x446c42,_0xc808c3))[_0x5114('0x52')](handleError(_0x446c42,null));};exports[_0x5114('0x53')]=function(_0x49a2d0,_0x25d81f){var _0x33d66a={'raw':![],'where':{'id':_0x49a2d0[_0x5114('0x54')]['id']},'include':[{'model':db[_0x5114('0x55')],'as':_0x5114('0x56')}]},_0x37bf22={};_0x37bf22[_0x5114('0x3f')]=_['keys'](db[_0x5114('0x3b')][_0x5114('0x3c')]);_0x37bf22[_0x5114('0x41')]=_[_0x5114('0x42')](_0x49a2d0[_0x5114('0x41')]);_0x37bf22[_0x5114('0x43')]=_['intersection'](_0x37bf22[_0x5114('0x3f')],_0x37bf22[_0x5114('0x41')]);_0x33d66a['attributes']=_['intersection'](_0x37bf22[_0x5114('0x3f')],qs[_0x5114('0x46')](_0x49a2d0['query']['fields']));_0x33d66a['attributes']=_0x33d66a['attributes'][_0x5114('0x57')]?_0x33d66a[_0x5114('0x45')]:_0x37bf22['model'];if(_0x49a2d0[_0x5114('0x41')][_0x5114('0x50')]){_0x33d66a[_0x5114('0x58')]=[{'all':!![]}];}_0x33d66a=_['merge']({},_0x33d66a,_0x49a2d0[_0x5114('0x4f')]);return db[_0x5114('0x3b')][_0x5114('0x59')](_0x33d66a)['then'](handleEntityNotFound(_0x25d81f,null))['then'](respondWithResult(_0x25d81f,null))[_0x5114('0x52')](handleError(_0x25d81f,null));};exports[_0x5114('0x5a')]=function(_0x592988,_0x3f68cd){return db['SmsAccount'][_0x5114('0x5a')](_0x592988[_0x5114('0x5b')],{})[_0x5114('0x1f')](function(_0x34122a){var _0xb41e10=_0x592988['user'][_0x5114('0x35')]({'plain':!![]});if(!_0xb41e10)throw new Error(_0x5114('0x5c'));if(_0xb41e10[_0x5114('0x5d')]===_0x5114('0x5e')){var _0x11402c=_0x34122a[_0x5114('0x35')]({'plain':!![]});var _0x15f408=_0x5114('0x36');return db[_0x5114('0x5f')]['find']({'where':{'name':_0x15f408,'userProfileId':_0xb41e10[_0x5114('0x60')]},'raw':!![]})[_0x5114('0x1f')](function(_0x12104f){if(_0x12104f&&_0x12104f['autoAssociation']===0x0){return db['UserProfileResource'][_0x5114('0x5a')]({'name':_0x11402c[_0x5114('0x38')],'resourceId':_0x11402c['id'],'type':_0x12104f[_0x5114('0x38')],'sectionId':_0x12104f['id']},{})[_0x5114('0x1f')](function(){return _0x34122a;});}else{return _0x34122a;}})['catch'](function(_0x4d4da8){logger[_0x5114('0x24')](_0x5114('0x61'),_0x4d4da8);throw _0x4d4da8;});}return _0x34122a;})['then'](respondWithResult(_0x3f68cd,0xc9))[_0x5114('0x52')](handleError(_0x3f68cd,null));};exports['update']=function(_0x2e0063,_0x8ee1e1){if(_0x2e0063['body']['id']){delete _0x2e0063[_0x5114('0x5b')]['id'];}return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x2e0063[_0x5114('0x54')]['id']},'include':[{'model':db[_0x5114('0x55')],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x8ee1e1,null))[_0x5114('0x1f')](saveUpdates(_0x2e0063[_0x5114('0x5b')],null))[_0x5114('0x1f')](respondWithResult(_0x8ee1e1,null))[_0x5114('0x52')](handleError(_0x8ee1e1,null));};exports[_0x5114('0x34')]=function(_0x70e1d5,_0xfd1e1c){return db['SmsAccount'][_0x5114('0x59')]({'where':{'id':_0x70e1d5['params']['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0xfd1e1c,null))[_0x5114('0x1f')](removeEntity(_0xfd1e1c,null))[_0x5114('0x52')](handleError(_0xfd1e1c,null));};exports[_0x5114('0x62')]=function(_0x3bd3ef,_0x2df671){return db[_0x5114('0x3b')][_0x5114('0x62')]()[_0x5114('0x1f')](respondWithResult(_0x2df671,null))[_0x5114('0x52')](handleError(_0x2df671,null));};exports[_0x5114('0x63')]=function(_0x381891,_0x2e934c,_0x1a4389){if(_0x381891[_0x5114('0x5b')]['id']){delete _0x381891[_0x5114('0x5b')]['id'];}return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x381891[_0x5114('0x54')]['id']}})['then'](handleEntityNotFound(_0x2e934c,null))['then'](function(_0x1279eb){if(_0x1279eb){_0x381891[_0x5114('0x5b')][_0x5114('0x64')]=_0x1279eb['id'];return db[_0x5114('0x65')][_0x5114('0x5a')](_0x381891[_0x5114('0x5b')]);}})[_0x5114('0x1f')](respondWithResult(_0x2e934c,null))[_0x5114('0x52')](handleError(_0x2e934c,null));};exports['getDispositions']=function(_0x4dfe6b,_0x5813a1,_0x1bbe3a){var _0x438e6a={'raw':![],'where':{}};var _0x208ecc={};var _0x8602c6={'count':0x0,'rows':[]};return db['SmsAccount'][_0x5114('0x66')]({'where':{'id':_0x4dfe6b['params']['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x5813a1,null))[_0x5114('0x1f')](function(_0x34d246){if(_0x34d246){_0x208ecc[_0x5114('0x3f')]=_[_0x5114('0x42')](db['Disposition'][_0x5114('0x3c')]);_0x208ecc[_0x5114('0x41')]=_['keys'](_0x4dfe6b['query']);_0x208ecc[_0x5114('0x43')]=_[_0x5114('0x44')](_0x208ecc[_0x5114('0x3f')],_0x208ecc[_0x5114('0x41')]);_0x438e6a[_0x5114('0x45')]=_['intersection'](_0x208ecc[_0x5114('0x3f')],qs[_0x5114('0x46')](_0x4dfe6b[_0x5114('0x41')][_0x5114('0x46')]));_0x438e6a[_0x5114('0x45')]=_0x438e6a[_0x5114('0x45')]['length']?_0x438e6a[_0x5114('0x45')]:_0x208ecc['model'];if(!_0x4dfe6b[_0x5114('0x41')]['hasOwnProperty'](_0x5114('0x48'))){_0x438e6a[_0x5114('0x2e')]=qs['limit'](_0x4dfe6b[_0x5114('0x41')][_0x5114('0x2e')]);_0x438e6a[_0x5114('0x2c')]=qs[_0x5114('0x2c')](_0x4dfe6b['query'][_0x5114('0x2c')]);}_0x438e6a[_0x5114('0x49')]=qs[_0x5114('0x4a')](_0x4dfe6b[_0x5114('0x41')]['sort']);_0x438e6a['where']=qs[_0x5114('0x43')](_[_0x5114('0x67')](_0x4dfe6b[_0x5114('0x41')],_0x208ecc[_0x5114('0x43')]));_0x438e6a[_0x5114('0x4b')][_0x5114('0x64')]=_0x34d246['id'];if(_0x4dfe6b['query'][_0x5114('0x4c')]){_0x438e6a[_0x5114('0x4b')]=_['merge'](_0x438e6a[_0x5114('0x4b')],{'$or':_['map'](_0x438e6a[_0x5114('0x45')],function(_0x4e3e49){var _0x4ee45c={};_0x4ee45c[_0x4e3e49]={'$like':'%'+_0x4dfe6b['query']['filter']+'%'};return _0x4ee45c;})});}_0x438e6a=_[_0x5114('0x4d')]({},_0x438e6a,_0x4dfe6b['options']);return db['Disposition'][_0x5114('0x2f')]({'where':_0x438e6a[_0x5114('0x4b')]})[_0x5114('0x1f')](function(_0x56a3c6){_0x8602c6[_0x5114('0x2f')]=_0x56a3c6;if(_0x4dfe6b[_0x5114('0x41')]['includeAll']){_0x438e6a[_0x5114('0x58')]=[{'all':!![]}];}return db[_0x5114('0x65')][_0x5114('0x68')](_0x438e6a);})[_0x5114('0x1f')](function(_0x3af209){_0x8602c6[_0x5114('0x51')]=_0x3af209;return _0x8602c6;});}})[_0x5114('0x1f')](respondWithFilteredResult(_0x5813a1,_0x438e6a))[_0x5114('0x52')](handleError(_0x5813a1,null));};exports[_0x5114('0x69')]=function(_0x5298aa,_0x5a86c3,_0x21aae3){return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x5298aa[_0x5114('0x54')]['id']}})['then'](handleEntityNotFound(_0x5a86c3,null))['then'](function(_0x36aba5){if(_0x36aba5){return _0x36aba5[_0x5114('0x69')](_0x5298aa[_0x5114('0x41')]['ids']);}})[_0x5114('0x1f')](respondWithStatusCode(_0x5a86c3,null))[_0x5114('0x52')](handleError(_0x5a86c3,null));};exports[_0x5114('0x6a')]=function(_0x3149cf,_0x5b5b27,_0x362ee8){if(_0x3149cf[_0x5114('0x5b')]['id']){delete _0x3149cf['body']['id'];}return db['SmsAccount'][_0x5114('0x59')]({'where':{'id':_0x3149cf[_0x5114('0x54')]['id']}})['then'](handleEntityNotFound(_0x5b5b27,null))[_0x5114('0x1f')](function(_0x1338a6){if(_0x1338a6){_0x3149cf[_0x5114('0x5b')]['SmsAccountId']=_0x1338a6['id'];return db[_0x5114('0x6b')][_0x5114('0x5a')](_0x3149cf[_0x5114('0x5b')]);}})[_0x5114('0x1f')](respondWithResult(_0x5b5b27,null))[_0x5114('0x52')](handleError(_0x5b5b27,null));};exports[_0x5114('0x6c')]=function(_0x47ef89,_0x4049b,_0x33c03d){var _0x256d81={'raw':![],'where':{}};var _0x489c2c={};var _0x253e2f={'count':0x0,'rows':[]};return db[_0x5114('0x3b')][_0x5114('0x66')]({'where':{'id':_0x47ef89[_0x5114('0x54')]['id']}})['then'](handleEntityNotFound(_0x4049b,null))[_0x5114('0x1f')](function(_0x4ce70a){if(_0x4ce70a){_0x489c2c[_0x5114('0x3f')]=_[_0x5114('0x42')](db[_0x5114('0x6b')][_0x5114('0x3c')]);_0x489c2c[_0x5114('0x41')]=_['keys'](_0x47ef89['query']);_0x489c2c[_0x5114('0x43')]=_['intersection'](_0x489c2c[_0x5114('0x3f')],_0x489c2c[_0x5114('0x41')]);_0x256d81[_0x5114('0x45')]=_[_0x5114('0x44')](_0x489c2c[_0x5114('0x3f')],qs[_0x5114('0x46')](_0x47ef89[_0x5114('0x41')][_0x5114('0x46')]));_0x256d81[_0x5114('0x45')]=_0x256d81[_0x5114('0x45')][_0x5114('0x57')]?_0x256d81[_0x5114('0x45')]:_0x489c2c['model'];if(!_0x47ef89[_0x5114('0x41')][_0x5114('0x47')](_0x5114('0x48'))){_0x256d81[_0x5114('0x2e')]=qs[_0x5114('0x2e')](_0x47ef89[_0x5114('0x41')][_0x5114('0x2e')]);_0x256d81[_0x5114('0x2c')]=qs['offset'](_0x47ef89[_0x5114('0x41')][_0x5114('0x2c')]);}_0x256d81[_0x5114('0x49')]=qs[_0x5114('0x4a')](_0x47ef89[_0x5114('0x41')][_0x5114('0x4a')]);_0x256d81[_0x5114('0x4b')]=qs[_0x5114('0x43')](_[_0x5114('0x67')](_0x47ef89[_0x5114('0x41')],_0x489c2c['filters']));_0x256d81[_0x5114('0x4b')][_0x5114('0x64')]=_0x4ce70a['id'];if(_0x47ef89[_0x5114('0x41')]['filter']){_0x256d81[_0x5114('0x4b')]=_['merge'](_0x256d81[_0x5114('0x4b')],{'$or':_['map'](_0x256d81['attributes'],function(_0x814a3b){var _0x4b9a3c={};_0x4b9a3c[_0x814a3b]={'$like':'%'+_0x47ef89['query'][_0x5114('0x4c')]+'%'};return _0x4b9a3c;})});}_0x256d81=_[_0x5114('0x4d')]({},_0x256d81,_0x47ef89['options']);return db[_0x5114('0x6b')][_0x5114('0x2f')]({'where':_0x256d81[_0x5114('0x4b')]})[_0x5114('0x1f')](function(_0x2e7ebd){_0x253e2f[_0x5114('0x2f')]=_0x2e7ebd;if(_0x47ef89[_0x5114('0x41')][_0x5114('0x50')]){_0x256d81[_0x5114('0x58')]=[{'all':!![]}];}return db[_0x5114('0x6b')][_0x5114('0x68')](_0x256d81);})['then'](function(_0x4a73c0){_0x253e2f['rows']=_0x4a73c0;return _0x253e2f;});}})[_0x5114('0x1f')](respondWithFilteredResult(_0x4049b,_0x256d81))['catch'](handleError(_0x4049b,null));};exports[_0x5114('0x6d')]=function(_0x5a3d03,_0x2ac64e,_0xd2a815){return db['SmsAccount'][_0x5114('0x59')]({'where':{'id':_0x5a3d03[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x2ac64e,null))[_0x5114('0x1f')](function(_0x7bc1e){if(_0x7bc1e){return _0x7bc1e[_0x5114('0x6d')](_0x5a3d03[_0x5114('0x41')][_0x5114('0x6e')]);}})[_0x5114('0x1f')](respondWithStatusCode(_0x2ac64e,null))['catch'](handleError(_0x2ac64e,null));};exports['notify']=function(_0x2e8fba,_0x38bc75,_0x2e64fa){var _0x566af6={'channel':_0x5114('0x6f')};var _0x2cbdf6=[];var _0x4c5ab9=[];var _0x2b26d1={};return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x2e8fba[_0x5114('0x54')]['id']},'include':[{'model':db[_0x5114('0x70')],'as':_0x5114('0x71')}]})[_0x5114('0x1f')](handleEntityNotFound(_0x38bc75,null))['then'](function(_0x48bfad){_0x566af6[_0x5114('0x72')]=_0x48bfad;_0x566af6[_0x5114('0x73')]=_[_0x5114('0x74')](_0x48bfad[_0x5114('0x71')],[_0x5114('0x75')],[_0x5114('0x76')]);if(_0x566af6[_0x5114('0x72')][_0x5114('0x71')]){delete _0x566af6[_0x5114('0x72')][_0x5114('0x71')];}return db['CmContact'][_0x5114('0x62')]();})[_0x5114('0x1f')](function(_0xe44f13){if(!_0xe44f13){throw new db[(_0x5114('0x77'))][(_0x5114('0x78'))](_0x5114('0x79'));}_0x2cbdf6=_[_0x5114('0x7a')](_['keys'](_0xe44f13),[_0x5114('0x7b'),_0x5114('0x7c')]);_0x4c5ab9=_['difference'](_['keys'](_0xe44f13),['createdAt','updatedAt',_0x5114('0x7d'),_0x5114('0x7e')]);_0x566af6[_0x5114('0x5b')]={'mapKey':_0x5114('0x7f')};if(_0x566af6[_0x5114('0x72')][_0x5114('0x3e')]){switch(_0x566af6[_0x5114('0x72')][_0x5114('0x3e')]){case'twilio':_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')]['From'];_0x566af6['body'][_0x5114('0x5b')]=_0x2e8fba['body'][_0x5114('0x81')];_0x566af6[_0x5114('0x5b')][_0x5114('0x82')]=_0x2e8fba['body'][_0x5114('0x83')];break;case _0x5114('0x84'):_0x566af6[_0x5114('0x5b')]['from']='+'+_0x2e8fba[_0x5114('0x5b')][_0x5114('0x85')];_0x566af6[_0x5114('0x5b')][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')]['text'];break;case'connectel':_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x80')];_0x566af6['body'][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')]['message'];break;case _0x5114('0x86'):_0x566af6[_0x5114('0x5b')]['from']=_0x2e8fba['body'][_0x5114('0x80')];_0x566af6['body'][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')]['body'];_0x566af6[_0x5114('0x5b')][_0x5114('0x82')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x87')];break;case'plivo':_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x88')];_0x566af6[_0x5114('0x5b')][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x89')];_0x566af6[_0x5114('0x5b')]['messageId']=_0x2e8fba[_0x5114('0x5b')]['MessageUUID'];break;case _0x5114('0x8a'):_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]='+'+_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8b')][0x0]['from'];_0x566af6['body'][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8b')][0x0][_0x5114('0x8c')];_0x566af6[_0x5114('0x5b')][_0x5114('0x82')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8b')][0x0][_0x5114('0x82')];break;case _0x5114('0x8d'):_0x566af6['body'][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8e')];_0x566af6[_0x5114('0x5b')]['body']=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8f')][_0x5114('0x26')];break;case _0x5114('0x90'):_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]=_0x2e8fba['body']['fromNumber'];_0x566af6['body'][_0x5114('0x5b')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x8c')];_0x566af6['body'][_0x5114('0x82')]=_0x2e8fba[_0x5114('0x5b')]['replyMessageId'];break;case _0x5114('0x91'):_0x566af6['body'][_0x5114('0x82')]=_0x2e8fba[_0x5114('0x5b')][0x0]['message']['id'];_0x566af6[_0x5114('0x5b')][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')][0x0]['message']['from'];_0x566af6[_0x5114('0x5b')]['body']=_0x2e8fba[_0x5114('0x5b')][0x0][_0x5114('0x26')][_0x5114('0x8c')];break;case _0x5114('0x92'):_0x566af6['body'][_0x5114('0x80')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x80')];_0x566af6[_0x5114('0x5b')]['body']=_0x2e8fba['body'][_0x5114('0x26')];_0x566af6['body'][_0x5114('0x82')]=_0x2e8fba[_0x5114('0x5b')][_0x5114('0x93')];break;}}if(_0x566af6['body']['id']){delete _0x566af6[_0x5114('0x5b')]['id'];}if(_[_0x5114('0x94')](_0x566af6[_0x5114('0x5b')][_0x5114('0x80')])){throw new db[(_0x5114('0x77'))][(_0x5114('0x78'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x566af6[_0x5114('0x5b')]['body'])||_0x566af6[_0x5114('0x5b')][_0x5114('0x5b')]===''){throw new db[(_0x5114('0x77'))]['ValidationError'](_0x5114('0x95'));}if(_['isNil'](_0x566af6[_0x5114('0x5b')][_0x5114('0x96')])){throw new db[(_0x5114('0x77'))][(_0x5114('0x78'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4c5ab9);}if(!_['includes'](_0x4c5ab9,_0x566af6['body'][_0x5114('0x96')])){throw new db[(_0x5114('0x77'))]['ValidationError'](_0x5114('0x97')+_0x4c5ab9);}_0x2b26d1[_0x566af6[_0x5114('0x5b')][_0x5114('0x96')]]=_0x566af6[_0x5114('0x5b')][_0x5114('0x80')];return db[_0x5114('0x98')][_0x5114('0x59')]({'where':{'id':_0x566af6[_0x5114('0x72')]['ListId']},'include':[{'model':db[_0x5114('0x99')],'as':_0x5114('0x9a'),'where':_0x2b26d1,'limit':0x1,'order':[[_0x5114('0x7c'),_0x5114('0x9b')]]}]});})['then'](handleEntityNotFound(_0x38bc75,null))[_0x5114('0x1f')](function(_0x1a5eb5){if(_0x1a5eb5){_0x566af6['list']=_[_0x5114('0x9c')](_0x1a5eb5,[_0x5114('0x9a')]);if(_0x1a5eb5[_0x5114('0x9a')]['length']){return _0x1a5eb5[_0x5114('0x9a')][0x0];}var _0x4ef136=_['defaults'](_0x566af6['body'],{'firstName':_0x566af6['body'][_0x5114('0x80')],'ListId':_0x1a5eb5['id']});_0x4ef136[_0x566af6['body'][_0x5114('0x96')]]=_0x566af6[_0x5114('0x5b')][_0x5114('0x80')];return db[_0x5114('0x99')][_0x5114('0x5a')](_0x4ef136,{'fields':_0x2cbdf6,'raw':!![]});}})[_0x5114('0x1f')](handleEntityNotFound(_0x38bc75,null))[_0x5114('0x1f')](function(_0x28803c){if(_0x28803c){_0x566af6[_0x5114('0x9d')]=_0x28803c;var _0x4ae12f={'ContactId':_0x28803c['id'],'phone':_0x566af6['body']['from'],'SmsAccountId':_0x2e8fba['params']['id']};var _0x150151={'ContactId':_0x28803c['id'],'SmsAccountId':_0x2e8fba[_0x5114('0x54')]['id'],'closed':![]};return db['SmsInteraction'][_0x5114('0x59')]({'where':_0x150151})[_0x5114('0x1f')](function(_0x969420){if(_0x969420){return[_0x969420,![]];}return db[_0x5114('0x9e')]['create'](_0x4ae12f)[_0x5114('0x1f')](function(_0x32a4c3){return[_0x32a4c3,!![]];});});}})[_0x5114('0x9f')](function(_0x1a68ca,_0x229d91){_0x566af6['interaction']=_0x1a68ca['get']({'plain':!![]});_0x566af6['interaction'][_0x5114('0xa0')]=![];if(_0x229d91){if(_0x566af6[_0x5114('0x72')][_0x5114('0xa1')]){_0x566af6[_0x5114('0x73')]['push']({'id':0x0,'priority':_0x566af6[_0x5114('0x73')][_0x5114('0x57')]+0x1,'app':_0x5114('0xa2'),'appdata':_0x5114('0xa3'),'interval':_0x5114('0xa4')});}_0x566af6[_0x5114('0xa5')]['created']=!![];}return db[_0x5114('0xa6')]['create']({'phone':_0x566af6[_0x5114('0x5b')][_0x5114('0x80')],'messageId':_0x566af6['body'][_0x5114('0x82')],'body':_0x566af6[_0x5114('0x5b')][_0x5114('0x5b')],'SmsAccountId':_0x2e8fba[_0x5114('0x54')]['id'],'SmsInteractionId':_0x1a68ca['id'],'direction':'in','ContactId':_0x1a68ca[_0x5114('0xa7')],'AttachmentId':_0x566af6['body'][_0x5114('0xa8')]});})[_0x5114('0x1f')](function(_0x474f53){_0x566af6[_0x5114('0x26')]=_0x474f53;if(_0x566af6[_0x5114('0xa5')][_0x5114('0xa9')]){return db[_0x5114('0xaa')]['find']({'attributes':['id','name'],'where':{'id':_0x566af6[_0x5114('0xa5')][_0x5114('0xa9')]}})[_0x5114('0x1f')](function(_0x200f4b){if(_0x200f4b){_0x566af6[_0x5114('0x73')][_0x5114('0xab')]({'id':0x0,'priority':0x0,'app':_0x5114('0xac'),'appdata':_0x200f4b[_0x5114('0x38')]+','+(_0x566af6[_0x5114('0x72')][_0x5114('0xad')]||0xa),'interval':_0x5114('0xa4')});}return respondWithRpcPromise(_0x5114('0xae'),_0x5114('0xaf'),_0x566af6);});}return respondWithRpcPromise(_0x5114('0xae'),_0x5114('0xaf'),_0x566af6);})[_0x5114('0x1f')](function(_0x32db33){if(_0x32db33){var _0x259dfa=0xc8;var _0xa456de=_0x5114('0xb0');logger[_0x5114('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xa456de,_0x259dfa,_0x5114('0xb2'));logger[_0x5114('0xb3')](_0x5114('0xb4'),_0xa456de,_0x259dfa,_0x5114('0xb2'),JSON[_0x5114('0x23')](_0x32db33));if(_0x566af6[_0x5114('0x72')]['type']===_0x5114('0xb5')){return _0x38bc75[_0x5114('0x29')](_0x259dfa)[_0x5114('0xb6')](_0x5114('0xb7'),'text/xml')[_0x5114('0x39')](_0x5114('0xb8'));}else{return _0x38bc75[_0x5114('0x29')](_0x259dfa)[_0x5114('0x2b')](_0x32db33);}}})[_0x5114('0x52')](handleError(_0x38bc75,null));};exports[_0x5114('0xb9')]=function(_0x4e98f0,_0x4ad17c){var _0x394cb7=_0x4e98f0[_0x5114('0x54')]['id'];var _0x45bc49=_0x4e98f0['body'];var _0x28ec27=0xc8;var _0x24feb3=null;return db['sequelize'][_0x5114('0xba')]({'isolationLevel':db['sequelize']['Transaction'][_0x5114('0xbb')][_0x5114('0xbc')]},function(_0x44c9e5){return db[_0x5114('0x3b')][_0x5114('0x66')]({'where':{'id':_0x394cb7},'transaction':_0x44c9e5})['then'](function(_0x2ffbfb){if(_0x2ffbfb){return db[_0x5114('0x70')][_0x5114('0x34')]({'where':{'SmsAccountId':_0x394cb7},'transaction':_0x44c9e5})[_0x5114('0x1f')](function(){var _0x18722f=_[_0x5114('0x40')](_0x45bc49,function(_0xabbb0d){_0xabbb0d['SmsAccountId']=_0x394cb7;return _0xabbb0d;});return db[_0x5114('0x70')][_0x5114('0xbd')](_0x18722f,{'transaction':_0x44c9e5});});}else{_0x28ec27=0x194;_0x24feb3=[];}});})[_0x5114('0x1f')](function(){if(_0x28ec27!==0x194){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x394cb7},'order':_0x5114('0x75')})['then'](function(_0x1583f2){_0x24feb3=_0x1583f2;});}})[_0x5114('0x52')](function(_0x352204){_0x28ec27=0x1f4;logger[_0x5114('0x24')](_0x352204['stack']);if(_0x352204['name']){delete _0x352204['name'];}_0x24feb3=_0x352204;})[_0x5114('0xbe')](function(){if(_0x24feb3===null){_0x4ad17c[_0x5114('0x28')](_0x28ec27);}else{if(_0x28ec27===0x1f4){_0x4ad17c[_0x5114('0x29')](_0x28ec27)[_0x5114('0x39')](_0x24feb3);}else{_0x4ad17c[_0x5114('0x29')](_0x28ec27)['json'](_0x24feb3);}}});};exports[_0x5114('0xbf')]=function(_0x5847d2,_0x24574a,_0x156dea){var _0xd0bede={};var _0x3a461d={};var _0xdb6610;var _0x1d584e;return db['SmsAccount'][_0x5114('0x66')]({'where':{'id':_0x5847d2[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x24574a,null))[_0x5114('0x1f')](function(_0x13211e){if(_0x13211e){_0xdb6610=_0x13211e;_0x3a461d['model']=_[_0x5114('0x42')](db[_0x5114('0x70')][_0x5114('0x3c')]);_0x3a461d['query']=_[_0x5114('0x42')](_0x5847d2['query']);_0x3a461d[_0x5114('0x43')]=_['intersection'](_0x3a461d['model'],_0x3a461d['query']);_0xd0bede[_0x5114('0x45')]=_['intersection'](_0x3a461d['model'],qs[_0x5114('0x46')](_0x5847d2[_0x5114('0x41')][_0x5114('0x46')]));_0xd0bede[_0x5114('0x45')]=_0xd0bede[_0x5114('0x45')]['length']?_0xd0bede[_0x5114('0x45')]:_0x3a461d[_0x5114('0x3f')];_0xd0bede['order']=qs[_0x5114('0x4a')](_0x5847d2[_0x5114('0x41')]['sort']);_0xd0bede[_0x5114('0x4b')]=qs['filters'](_[_0x5114('0x67')](_0x5847d2[_0x5114('0x41')],_0x3a461d[_0x5114('0x43')]));if(_0x5847d2['query'][_0x5114('0x4c')]){_0xd0bede[_0x5114('0x4b')]=_[_0x5114('0x4d')](_0xd0bede[_0x5114('0x4b')],{'$or':_[_0x5114('0x40')](_0xd0bede['attributes'],function(_0x106307){var _0x13f538={};_0x13f538[_0x106307]={'$like':'%'+_0x5847d2[_0x5114('0x41')][_0x5114('0x4c')]+'%'};return _0x13f538;})});}_0xd0bede=_[_0x5114('0x4d')]({},_0xd0bede,_0x5847d2[_0x5114('0x4f')]);return _0xdb6610[_0x5114('0xbf')](_0xd0bede);}})['then'](function(_0xa861d4){if(_0xa861d4){_0x1d584e=_0xa861d4[_0x5114('0x57')];if(!_0x5847d2[_0x5114('0x41')][_0x5114('0x47')]('nolimit')){_0xd0bede[_0x5114('0x2e')]=qs[_0x5114('0x2e')](_0x5847d2['query']['limit']);_0xd0bede[_0x5114('0x2c')]=qs[_0x5114('0x2c')](_0x5847d2[_0x5114('0x41')]['offset']);}return _0xdb6610[_0x5114('0xbf')](_0xd0bede);}})['then'](function(_0x6b52ba){if(_0x6b52ba){return _0x6b52ba?{'count':_0x1d584e,'rows':_0x6b52ba}:null;}})[_0x5114('0x1f')](respondWithResult(_0x24574a,null))[_0x5114('0x52')](handleError(_0x24574a,null));};exports[_0x5114('0xc0')]=function(_0x1c2182,_0x5708ee,_0x5d52f1){var _0x243b27={'raw':![],'where':{}};var _0x119404={};var _0x33a946={'count':0x0,'rows':[]};return db[_0x5114('0x3b')][_0x5114('0x66')]({'where':{'id':_0x1c2182[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x5708ee,null))[_0x5114('0x1f')](function(_0x271230){if(_0x271230){_0x119404[_0x5114('0x3f')]=_[_0x5114('0x42')](db[_0x5114('0x9e')][_0x5114('0x3c')]);_0x119404[_0x5114('0x41')]=_['keys'](_0x1c2182[_0x5114('0x41')]);_0x119404[_0x5114('0x43')]=_[_0x5114('0x44')](_0x119404['model'],_0x119404[_0x5114('0x41')]);_0x243b27['attributes']=_[_0x5114('0x44')](_0x119404[_0x5114('0x3f')],qs['fields'](_0x1c2182[_0x5114('0x41')]['fields']));_0x243b27[_0x5114('0x45')]=_0x243b27[_0x5114('0x45')]['length']?_0x243b27['attributes']:_0x119404[_0x5114('0x3f')];if(!_0x1c2182[_0x5114('0x41')][_0x5114('0x47')](_0x5114('0x48'))){_0x243b27[_0x5114('0x2e')]=qs['limit'](_0x1c2182[_0x5114('0x41')]['limit']);_0x243b27[_0x5114('0x2c')]=qs[_0x5114('0x2c')](_0x1c2182[_0x5114('0x41')]['offset']);}_0x243b27['order']=qs[_0x5114('0x4a')](_0x1c2182[_0x5114('0x41')][_0x5114('0x4a')]);_0x243b27[_0x5114('0x4b')]=qs['filters'](_[_0x5114('0x67')](_0x1c2182[_0x5114('0x41')],_0x119404['filters']));_0x243b27[_0x5114('0x4b')][_0x5114('0x64')]=_0x271230['id'];if(_0x1c2182[_0x5114('0x41')][_0x5114('0x4c')]){_0x243b27[_0x5114('0x4b')]=_['merge'](_0x243b27[_0x5114('0x4b')],{'$or':_[_0x5114('0x40')](_0x243b27[_0x5114('0x45')],function(_0x3ae612){var _0x1db978={};_0x1db978[_0x3ae612]={'$like':'%'+_0x1c2182[_0x5114('0x41')][_0x5114('0x4c')]+'%'};return _0x1db978;})});}_0x243b27=_[_0x5114('0x4d')]({},_0x243b27,_0x1c2182[_0x5114('0x4f')]);return db[_0x5114('0x9e')][_0x5114('0x2f')]({'where':_0x243b27['where']})['then'](function(_0x13d594){_0x33a946[_0x5114('0x2f')]=_0x13d594;if(_0x1c2182[_0x5114('0x41')][_0x5114('0x50')]){_0x243b27[_0x5114('0x58')]=[{'model':db[_0x5114('0x99')],'as':_0x5114('0xc1'),'required':![]},{'model':db[_0x5114('0xaa')],'as':'Owner','attributes':[_0x5114('0x38'),_0x5114('0xc2'),_0x5114('0xc3')],'required':![]},{'model':db[_0x5114('0xc4')],'as':_0x5114('0xc5'),'attributes':['id',_0x5114('0x38'),_0x5114('0xc6')],'where':_0x1c2182[_0x5114('0x41')]['tag']?{'id':_0x1c2182[_0x5114('0x41')]['tag']}:undefined,'required':_0x1c2182['query'][_0x5114('0xc7')]?!![]:![]}];}return db[_0x5114('0x9e')][_0x5114('0x68')](_0x243b27);})[_0x5114('0x1f')](function(_0x580100){_0x33a946['rows']=_0x580100;return _0x33a946;});}})[_0x5114('0x1f')](respondWithFilteredResult(_0x5708ee,_0x243b27))[_0x5114('0x52')](handleError(_0x5708ee,null));};exports[_0x5114('0x39')]=function(_0x5962cb,_0x17980a,_0x12de78){var _0x512cb7,_0x4d8d0e,_0x1e9b93;if(_[_0x5114('0x94')](_0x5962cb[_0x5114('0x5b')]['body'])||_0x5962cb[_0x5114('0x5b')][_0x5114('0x5b')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x5114('0x94')](_0x5962cb[_0x5114('0x5b')]['to'])){throw new db[(_0x5114('0x77'))][(_0x5114('0x78'))]('to\x20is\x20mandatory');}_0x512cb7=_0x5962cb[_0x5114('0x5b')]['to'];return db['SmsAccount']['find']({'where':{'id':_0x5962cb[_0x5114('0x54')]['id']},'include':[{'model':db[_0x5114('0x98')],'as':_0x5114('0xc8'),'include':[{'model':db[_0x5114('0x99')],'as':_0x5114('0x9a'),'where':{'mobile':_0x512cb7},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})[_0x5114('0x1f')](handleEntityNotFound(_0x17980a,null))[_0x5114('0x1f')](function(_0x3336a8){if(_0x3336a8&&_0x3336a8[_0x5114('0xc8')]){_0x4d8d0e=_0x3336a8[_0x5114('0x35')]({'plain':!![]});if(_0x4d8d0e[_0x5114('0xc8')]&&_0x4d8d0e['List']['Contacts'][_0x5114('0x57')]){return _0x4d8d0e[_0x5114('0xc8')][_0x5114('0x9a')][0x0];}return db[_0x5114('0x99')][_0x5114('0x5a')](_[_0x5114('0x17')](_0x5962cb['body'],{'firstName':_0x512cb7,'mobile':_0x512cb7,'phone':_0x512cb7,'ListId':_0x4d8d0e[_0x5114('0x7e')]}));}})[_0x5114('0x1f')](handleEntityNotFound(_0x17980a,null))[_0x5114('0x1f')](function(_0x2ce3ac){if(_0x2ce3ac){_0x1e9b93=_0x2ce3ac;return db[_0x5114('0x9e')][_0x5114('0x59')]({'where':{'ContactId':_0x1e9b93['id'],'closed':![],'SmsAccountId':_0x4d8d0e['id']}})[_0x5114('0x1f')](function(_0x32ad47){if(_0x32ad47){return[_0x32ad47,![]];}return db[_0x5114('0x9e')][_0x5114('0x5a')]({'UserId':_0x5962cb[_0x5114('0x5e')]['id'],'ContactId':_0x1e9b93['id'],'SmsAccountId':_0x4d8d0e['id'],'phone':_0x512cb7,'firstMsgDirection':_0x5114('0xc9'),'Messages':[_[_0x5114('0x4d')](_0x5962cb[_0x5114('0x5b')],{'read':![],'body':_0x5962cb['body'][_0x5114('0x5b')],'phone':_0x512cb7,'SmsAccountId':_0x4d8d0e['id'],'UserId':_0x5962cb[_0x5114('0x5e')]['id'],'ContactId':_0x1e9b93['id']})]},{'include':[{'model':db[_0x5114('0xa6')],'as':_0x5114('0xca')}]})[_0x5114('0x1f')](function(_0x5d0427){return[_0x5d0427,!![]];});});}})[_0x5114('0x9f')](function(_0x439de2,_0x45bf3b){if(_0x45bf3b){return _0x439de2;}return db[_0x5114('0xa6')][_0x5114('0x5a')](_[_0x5114('0x4d')](_0x5962cb[_0x5114('0x5b')],{'read':![],'body':_0x5962cb[_0x5114('0x5b')]['body'],'phone':_0x512cb7,'SmsAccountId':_0x4d8d0e['id'],'SmsInteractionId':_0x439de2['id'],'UserId':_0x5962cb[_0x5114('0x5e')]['id'],'ContactId':_0x1e9b93['id']}))['then'](function(_0x433d77){_0x439de2[_0x5114('0xcb')][_0x5114('0xca')]=[];_0x439de2[_0x5114('0xcb')]['Messages'][_0x5114('0xcc')](_0x433d77['dataValues']);return _0x439de2;});})['then'](respondWithResult(_0x17980a,null))['catch'](handleError(_0x17980a,null));};exports[_0x5114('0x29')]=function(_0x24a9f4,_0x4b6d0d,_0x49edb8){if(_0x24a9f4[_0x5114('0x5b')]['id']){delete _0x24a9f4['body']['id'];}var _0x113729,_0x1aacf0,_0x429e49;return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x24a9f4[_0x5114('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b6d0d,null))['then'](function(_0x200bea){if(_0x200bea){_0x429e49=_0x200bea;logger[_0x5114('0xb3')](_0x5114('0x21'),_0x5114('0x29'),_0x5114('0xcd'),_0x200bea[_0x5114('0x3e')],util['inspect'](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));switch(_0x200bea['type']){case _0x5114('0x84'):if(_0x24a9f4[_0x5114('0x5b')][_0x5114('0xce')]&&_0x24a9f4[_0x5114('0x5b')][_0x5114('0x29')]){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')]['status'];return db[_0x5114('0xa6')]['find']({'where':{'messageId':_0x24a9f4[_0x5114('0x5b')][_0x5114('0xce')]}});}break;case'connectel':if(_0x24a9f4[_0x5114('0x5b')][_0x5114('0xcf')]&&_0x24a9f4[_0x5114('0x5b')][_0x5114('0xd0')]){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')]['statusInt'];return db[_0x5114('0xa6')]['find']({'where':{'messageId':_0x24a9f4[_0x5114('0x5b')][_0x5114('0xcf')]}});}break;case _0x5114('0x86'):if(_0x24a9f4['body']['message_id']&&_0x24a9f4[_0x5114('0x5b')][_0x5114('0xd1')]){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')][_0x5114('0xd1')];return db[_0x5114('0xa6')]['find']({'where':{'messageId':_0x24a9f4['body'][_0x5114('0x87')]}});}break;case'infobip':var _0x17085f=_0x24a9f4[_0x5114('0x5b')][_0x5114('0x8b')][0x0];if(_0x17085f[_0x5114('0x82')]&&_0x17085f['status'][_0x5114('0xd2')]===_0x5114('0xd3')){_0x1aacf0=_0x17085f[_0x5114('0x29')][_0x5114('0xd2')];return db[_0x5114('0xa6')][_0x5114('0x59')]({'where':{'messageId':_0x17085f[_0x5114('0x82')]}});}break;case _0x5114('0x90'):if(_0x24a9f4['body'][_0x5114('0x82')]&&_0x24a9f4[_0x5114('0x5b')][_0x5114('0x29')]){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')]['status'];return db['SmsMessage'][_0x5114('0x59')]({'where':{'messageId':_0x24a9f4[_0x5114('0x5b')][_0x5114('0x82')]}});}break;case _0x5114('0x91'):if(_0x24a9f4['body'][0x0][_0x5114('0x26')]['id']){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')][0x0][_0x5114('0x3e')];return db[_0x5114('0xa6')][_0x5114('0x59')]({'where':{'messageId':_0x24a9f4['body'][0x0][_0x5114('0x26')]['id']}});}break;case _0x5114('0x92'):if(_0x24a9f4[_0x5114('0x5b')][_0x5114('0xd4')]&&_0x24a9f4[_0x5114('0x5b')][_0x5114('0x29')]){_0x1aacf0=_0x24a9f4[_0x5114('0x5b')][_0x5114('0x29')];return db[_0x5114('0xa6')][_0x5114('0x59')]({'where':{'messageId':_0x24a9f4[_0x5114('0x5b')][_0x5114('0xd4')]}});}break;}}})[_0x5114('0x1f')](handleEntityNotFound(_0x4b6d0d,null))[_0x5114('0x1f')](function(_0x177788){if(_0x177788){_0x113729=_0x177788;switch(_0x429e49[_0x5114('0x3e')]){case _0x5114('0x84'):if(_0x1aacf0==='DELIVERED'){return _0x113729[_0x5114('0x33')]({'read':!![]});}else{logger[_0x5114('0x24')](_0x5114('0x21'),_0x5114('0x29'),_0x5114('0x84'),util[_0x5114('0xd5')](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5114('0xd6'):if(_0x1aacf0==='1'){return _0x113729[_0x5114('0x33')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5114('0x29'),'skebby',util['inspect'](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5114('0x86'):if(!_0x24a9f4[_0x5114('0x5b')]['error_code']&&_0x1aacf0>=0xc8&&_0x1aacf0<=0xce){return _0x113729[_0x5114('0x33')]({'read':!![]});}else{logger[_0x5114('0x24')](_0x5114('0x21'),_0x5114('0x29'),_0x5114('0x86'),util[_0x5114('0xd5')](_0x24a9f4['body'],{'showHidden':![],'depth':null}));}break;case _0x5114('0x8a'):var _0x309203=_0x24a9f4[_0x5114('0x5b')][_0x5114('0x8b')][0x0];if(_0x309203['status']['groupName']===_0x5114('0xd3')){return _0x113729[_0x5114('0x33')]({'read':!![]});}else{logger[_0x5114('0x24')](_0x5114('0x21'),_0x5114('0x29'),'infobip',util[_0x5114('0xd5')](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5114('0x90'):if(_0x1aacf0==_0x5114('0xd7')||_0x1aacf0==_0x5114('0xd8')){return _0x113729['update']({'read':!![]});}else{logger[_0x5114('0x24')](_0x5114('0x21'),'status',_0x5114('0x90'),util[_0x5114('0xd5')](_0x24a9f4['body'],{'showHidden':![],'depth':null}));}break;case _0x5114('0x91'):if(_0x1aacf0==_0x5114('0xd9')){return _0x113729[_0x5114('0x33')]({'read':!![]});}else{logger['error'](_0x5114('0x21'),_0x5114('0x29'),_0x5114('0x91'),util[_0x5114('0xd5')](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x5114('0x92'):if(_0x1aacf0===_0x5114('0xda')||_0x1aacf0===_0x5114('0xdb')){return _0x113729['update']({'read':!![]});}else{logger[_0x5114('0x24')](_0x5114('0x21'),'status',_0x5114('0x92'),util['inspect'](_0x24a9f4[_0x5114('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x113729;}})[_0x5114('0x1f')](respondWithResult(_0x4b6d0d,null))[_0x5114('0x52')](handleError(_0x4b6d0d,null));};exports[_0x5114('0xdc')]=function(_0x1f1e18,_0x2fb014,_0x40f80f){var _0x1232c8,_0x17e4cf,_0x1b8280;return db[_0x5114('0x3b')][_0x5114('0x59')]({'where':{'id':_0x1f1e18[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x2fb014,null))[_0x5114('0x1f')](function(_0x3bce17){if(_0x3bce17){_0x1b8280=_0x3bce17;logger[_0x5114('0xb3')](_0x5114('0x21'),_0x5114('0x29'),_0x5114('0xcd'),_0x3bce17[_0x5114('0x3e')],util[_0x5114('0xd5')](_0x1f1e18[_0x5114('0x41')],{'showHidden':![],'depth':null}));switch(_0x3bce17[_0x5114('0x3e')]){case'csc':if(_0x1f1e18[_0x5114('0x41')][_0x5114('0xdd')]&&_0x1f1e18[_0x5114('0x41')][_0x5114('0xde')]){_0x17e4cf=_0x1f1e18[_0x5114('0x41')][_0x5114('0xde')];return db[_0x5114('0xa6')][_0x5114('0x59')]({'where':{'messageId':_0x1f1e18[_0x5114('0x41')][_0x5114('0xdd')]}});}break;}}})[_0x5114('0x1f')](handleEntityNotFound(_0x2fb014,null))[_0x5114('0x1f')](function(_0x29f540){if(_0x29f540){_0x1232c8=_0x29f540;switch(_0x1b8280[_0x5114('0x3e')]){case _0x5114('0x8d'):if(_0x17e4cf==='2'||_0x17e4cf==='6'){return _0x1232c8[_0x5114('0x33')]({'read':!![]});}else{logger[_0x5114('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x5114('0x29'),_0x5114('0x8d'),util['inspect'](_0x1f1e18[_0x5114('0x41')],{'showHidden':![],'depth':null}));};break;}return _0x1232c8;}})[_0x5114('0x1f')](respondWithResult(_0x2fb014,null))[_0x5114('0x52')](handleError(_0x2fb014,null));};exports[_0x5114('0xdf')]=function(_0x7e179b,_0x4cec58,_0x3267d0){return db[_0x5114('0x3b')]['find']({'where':{'id':_0x7e179b[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x4cec58,null))['then'](function(_0x5746d4){if(_0x5746d4){return _0x5746d4[_0x5114('0xdf')](_0x7e179b[_0x5114('0x5b')][_0x5114('0x6e')],_[_0x5114('0x9c')](_0x7e179b['body'],[_0x5114('0x6e'),'id'])||{})[_0x5114('0x9f')](function(_0x428adb){for(var _0x651943=0x0;_0x651943<_0x7e179b['body'][_0x5114('0x6e')]['length'];_0x651943+=0x1){socket[_0x5114('0xe0')](_0x5114('0xe1'),{'UserId':Number(_0x7e179b[_0x5114('0x5b')][_0x5114('0x6e')][_0x651943]),'SmsAccountId':Number(_0x7e179b['params']['id'])});}return _0x428adb;});}})[_0x5114('0x1f')](respondWithResult(_0x4cec58,null))[_0x5114('0x52')](handleError(_0x4cec58,null));};exports[_0x5114('0xe2')]=function(_0x280fe8,_0xc07ce0,_0x4fbc86){return db[_0x5114('0x3b')]['find']({'where':{'id':_0x280fe8[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0xc07ce0,null))[_0x5114('0x1f')](function(_0x127fba){if(_0x127fba){return _0x127fba[_0x5114('0xe2')](_0x280fe8[_0x5114('0x41')][_0x5114('0x6e')])[_0x5114('0x1f')](function(){if(_[_0x5114('0xe3')](_0x280fe8[_0x5114('0x41')][_0x5114('0x6e')])){for(var _0x30b5eb=0x0;_0x30b5eb<_0x280fe8[_0x5114('0x41')][_0x5114('0x6e')][_0x5114('0x57')];_0x30b5eb+=0x1){socket[_0x5114('0xe0')](_0x5114('0xe4'),{'UserId':Number(_0x280fe8[_0x5114('0x41')][_0x5114('0x6e')][_0x30b5eb]),'SmsAccountId':Number(_0x280fe8[_0x5114('0x54')]['id'])});}}else{socket['emit'](_0x5114('0xe4'),{'UserId':Number(_0x280fe8['query']['ids']),'SmsAccountId':Number(_0x280fe8[_0x5114('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0xc07ce0,null))['catch'](handleError(_0xc07ce0,null));};exports['getAgents']=function(_0x18f6f9,_0x457cd7,_0x2a6820){var _0x2b2cf1={};var _0x43e87e={};var _0x477d9b;var _0x3e4703;return db[_0x5114('0x3b')][_0x5114('0x66')]({'where':{'id':_0x18f6f9[_0x5114('0x54')]['id']}})[_0x5114('0x1f')](handleEntityNotFound(_0x457cd7,null))[_0x5114('0x1f')](function(_0x7353bf){if(_0x7353bf){_0x477d9b=_0x7353bf;_0x43e87e[_0x5114('0x3f')]=_[_0x5114('0x42')](db[_0x5114('0xaa')][_0x5114('0x3c')]);_0x43e87e[_0x5114('0x41')]=_[_0x5114('0x42')](_0x18f6f9[_0x5114('0x41')]);_0x43e87e[_0x5114('0x43')]=_['intersection'](_0x43e87e[_0x5114('0x3f')],_0x43e87e[_0x5114('0x41')]);_0x2b2cf1['attributes']=_[_0x5114('0x44')](_0x43e87e['model'],qs['fields'](_0x18f6f9['query'][_0x5114('0x46')]));_0x2b2cf1[_0x5114('0x45')]=_0x2b2cf1[_0x5114('0x45')]['length']?_0x2b2cf1[_0x5114('0x45')]:_0x43e87e['model'];_0x2b2cf1['order']=qs[_0x5114('0x4a')](_0x18f6f9['query'][_0x5114('0x4a')]);_0x2b2cf1[_0x5114('0x4b')]=qs[_0x5114('0x43')](_[_0x5114('0x67')](_0x18f6f9['query'],_0x43e87e[_0x5114('0x43')]));if(_0x18f6f9[_0x5114('0x41')]['filter']){_0x2b2cf1[_0x5114('0x4b')]=_[_0x5114('0x4d')](_0x2b2cf1[_0x5114('0x4b')],{'$or':_['map'](_0x2b2cf1[_0x5114('0x45')],function(_0x49601a){var _0xedca86={};_0xedca86[_0x49601a]={'$like':'%'+_0x18f6f9[_0x5114('0x41')][_0x5114('0x4c')]+'%'};return _0xedca86;})});}_0x2b2cf1=_['merge']({},_0x2b2cf1,_0x18f6f9['options']);return _0x477d9b[_0x5114('0xe5')](_0x2b2cf1);}})[_0x5114('0x1f')](function(_0x10f027){if(_0x10f027){_0x3e4703=_0x10f027[_0x5114('0x57')];if(!_0x18f6f9[_0x5114('0x41')][_0x5114('0x47')](_0x5114('0x48'))){_0x2b2cf1[_0x5114('0x2e')]=qs[_0x5114('0x2e')](_0x18f6f9[_0x5114('0x41')]['limit']);_0x2b2cf1['offset']=qs[_0x5114('0x2c')](_0x18f6f9[_0x5114('0x41')]['offset']);}return _0x477d9b['getAgents'](_0x2b2cf1);}})[_0x5114('0x1f')](function(_0x2df99d){if(_0x2df99d){return _0x2df99d?{'count':_0x3e4703,'rows':_0x2df99d}:null;}})[_0x5114('0x1f')](respondWithResult(_0x457cd7,null))['catch'](handleError(_0x457cd7,null));}; \ No newline at end of file +var _0x1f47=['redif','DELIVERED','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','csc','message-id','state','addAgents','emit','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','./smsAccount.socket','register','client','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','then','destroy','get','SmsAccounts','sendStatus','name','index','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','include','findAll','rows','Pause','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','catch','params','describe','addDisposition','Disposition','findOne','hasOwnProperty','SmsAccountId','includeAll','ids','CannedAnswer','order','removeAnswers','notify','sms','SmsApplication','Applications','account','applications','priority','asc','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','mobile','From','Body','messageId','MessageSid','from','sender','text','connectel','clicksend','message_id','plivo','Text','MessageUUID','infobip','results','originatingAddress','segmentedMessage','clickatell','bandwidth','from\x20is\x20mandatory','isNil','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','close','unmanaged','interaction','created','SmsMessage','ContactId','AttachmentId','UserId','User','unshift','agent','*,*,*,*','Start','startRouting','receiveMessage','entity\x20found','twilio','Content-Type','text/xml','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','bulkCreate','stack','send','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','push','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','intelepeer'];(function(_0x2bf840,_0x5c4e18){var _0x5106c3=function(_0x54b198){while(--_0x54b198){_0x2bf840['push'](_0x2bf840['shift']());}};_0x5106c3(++_0x5c4e18);}(_0x1f47,0x1d1));var _0x71f4=function(_0x19d6c0,_0x14a1c6){_0x19d6c0=_0x19d6c0-0x0;var _0x926ad4=_0x1f47[_0x19d6c0];return _0x926ad4;};'use strict';var emlformat=require(_0x71f4('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x71f4('0x1'));var rp=require(_0x71f4('0x2'));var moment=require('moment');var BPromise=require(_0x71f4('0x3'));var Mustache=require(_0x71f4('0x4'));var util=require(_0x71f4('0x5'));var path=require(_0x71f4('0x6'));var sox=require(_0x71f4('0x7'));var csv=require('to-csv');var ejs=require(_0x71f4('0x8'));var fs=require('fs');var fs_extra=require(_0x71f4('0x9'));var _=require(_0x71f4('0xa'));var squel=require('squel');var crypto=require(_0x71f4('0xb'));var jsforce=require(_0x71f4('0xc'));var deskjs=require(_0x71f4('0xd'));var toCsv=require(_0x71f4('0xe'));var querystring=require(_0x71f4('0xf'));var Papa=require(_0x71f4('0x10'));var Redis=require(_0x71f4('0x11'));var authService=require(_0x71f4('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x71f4('0x13'));var hardwareService=require(_0x71f4('0x14'));var logger=require(_0x71f4('0x15'))('api');var utils=require(_0x71f4('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x71f4('0x17'));var db=require(_0x71f4('0x18'))['db'];config[_0x71f4('0x19')]=_['defaults'](config[_0x71f4('0x19')],{'host':_0x71f4('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x71f4('0x19')]));require(_0x71f4('0x1b'))[_0x71f4('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0x71f4('0x1d')]['http']({'port':0x232c});function respondWithRpcPromise(_0x254c56,_0x10bbd9,_0x5ae5c3,_0x4e29e2){return new BPromise(function(_0x56b3d7,_0x122f18){var _0x2ec79b=_0x4e29e2||client;return _0x2ec79b[_0x71f4('0x1e')](_0x254c56,_0x5ae5c3)['then'](function(_0x63608a){logger[_0x71f4('0x1f')](_0x71f4('0x20'),_0x10bbd9,_0x71f4('0x21'));logger[_0x71f4('0x22')](_0x71f4('0x23'),_0x10bbd9,'request\x20sent',JSON[_0x71f4('0x24')](_0x63608a));if(_0x63608a[_0x71f4('0x25')]){if(_0x63608a[_0x71f4('0x25')][_0x71f4('0x26')]===0x1f4){logger['error'](_0x71f4('0x20'),_0x10bbd9,_0x63608a['error'][_0x71f4('0x27')]);return _0x122f18(_0x63608a[_0x71f4('0x25')][_0x71f4('0x27')]);}logger[_0x71f4('0x25')]('SmsAccount,\x20%s,\x20%s',_0x10bbd9,_0x63608a[_0x71f4('0x25')][_0x71f4('0x27')]);return _0x56b3d7(_0x63608a[_0x71f4('0x25')][_0x71f4('0x27')]);}else{logger[_0x71f4('0x1f')](_0x71f4('0x20'),_0x10bbd9,_0x71f4('0x21'));_0x56b3d7(_0x63608a[_0x71f4('0x28')][_0x71f4('0x27')]);}})['catch'](function(_0x22e723){logger['error']('SmsAccount,\x20%s,\x20%s',_0x10bbd9,_0x22e723);_0x122f18(_0x22e723);});});}function respondWithStatusCode(_0x4d4eb3,_0x2a5bbe){_0x2a5bbe=_0x2a5bbe||0xcc;return function(_0x3ad8be){if(_0x3ad8be){return _0x4d4eb3['sendStatus'](_0x2a5bbe);}return _0x4d4eb3[_0x71f4('0x29')](_0x2a5bbe)[_0x71f4('0x2a')]();};}function respondWithResult(_0xa48814,_0x171c78){_0x171c78=_0x171c78||0xc8;return function(_0x2217f5){if(_0x2217f5){return _0xa48814[_0x71f4('0x29')](_0x171c78)['json'](_0x2217f5);}};}function respondWithFilteredResult(_0x2357af,_0x556747){return function(_0x51b0a1){if(_0x51b0a1){var _0xbf15cd=typeof _0x556747[_0x71f4('0x2b')]===_0x71f4('0x2c')&&typeof _0x556747[_0x71f4('0x2d')]===_0x71f4('0x2c');var _0x52a542=_0x51b0a1[_0x71f4('0x2e')];var _0x2b0737=_0xbf15cd?0x0:_0x556747[_0x71f4('0x2b')];var _0x2a85c0=_0xbf15cd?_0x51b0a1[_0x71f4('0x2e')]:_0x556747['offset']+_0x556747[_0x71f4('0x2d')];var _0x7aad05;if(_0x2a85c0>=_0x52a542){_0x2a85c0=_0x52a542;_0x7aad05=0xc8;}else{_0x7aad05=0xce;}_0x2357af[_0x71f4('0x29')](_0x7aad05);return _0x2357af[_0x71f4('0x2f')](_0x71f4('0x30'),_0x2b0737+'-'+_0x2a85c0+'/'+_0x52a542)[_0x71f4('0x31')](_0x51b0a1);}return null;};}function patchUpdates(_0x4c32b9){return function(_0xf2cd55){try{jsonpatch['apply'](_0xf2cd55,_0x4c32b9,!![]);}catch(_0x21fd4c){return BPromise[_0x71f4('0x32')](_0x21fd4c);}return _0xf2cd55[_0x71f4('0x33')]();};}function saveUpdates(_0x37a4f2,_0x39fe7c){return function(_0x7366cf){if(_0x7366cf){return _0x7366cf[_0x71f4('0x34')](_0x37a4f2)[_0x71f4('0x35')](function(_0x59acf2){return _0x59acf2;});}return null;};}function removeEntity(_0x48bf51,_0x110a06){return function(_0x59e4f3){if(_0x59e4f3){return _0x59e4f3[_0x71f4('0x36')]()[_0x71f4('0x35')](function(){var _0x4b67d1=_0x59e4f3[_0x71f4('0x37')]({'plain':!![]});var _0x315a37=_0x71f4('0x38');return db['UserProfileResource'][_0x71f4('0x36')]({'where':{'type':_0x315a37,'resourceId':_0x4b67d1['id']}})['then'](function(){return _0x59e4f3;});})[_0x71f4('0x35')](function(){_0x48bf51[_0x71f4('0x29')](0xcc)[_0x71f4('0x2a')]();});}};}function handleEntityNotFound(_0x43d0d6,_0x5045d1){return function(_0x4a3318){if(!_0x4a3318){_0x43d0d6[_0x71f4('0x39')](0x194);}return _0x4a3318;};}function handleError(_0x5c86ea,_0x5a6ad8){_0x5a6ad8=_0x5a6ad8||0x1f4;return function(_0x1e6390){logger['error'](_0x1e6390['stack']);if(_0x1e6390[_0x71f4('0x3a')]){delete _0x1e6390[_0x71f4('0x3a')];}_0x5c86ea[_0x71f4('0x29')](_0x5a6ad8)['send'](_0x1e6390);};}exports[_0x71f4('0x3b')]=function(_0x322e99,_0x14b207){var _0xf3ba86={'include':[{'model':db['Pause'],'as':_0x71f4('0x3c')}]},_0x52c5d6={},_0x3d84e2={'count':0x0,'rows':[]};var _0x4c05a5=_[_0x71f4('0x3d')](db[_0x71f4('0x3e')][_0x71f4('0x3f')],function(_0x743aa3){return{'name':_0x743aa3[_0x71f4('0x40')],'type':_0x743aa3[_0x71f4('0x41')][_0x71f4('0x42')]};});_0x52c5d6[_0x71f4('0x43')]=_['map'](_0x4c05a5,_0x71f4('0x3a'));_0x52c5d6[_0x71f4('0x44')]=_['keys'](_0x322e99['query']);_0x52c5d6[_0x71f4('0x45')]=_['intersection'](_0x52c5d6[_0x71f4('0x43')],_0x52c5d6[_0x71f4('0x44')]);_0xf3ba86['attributes']=_[_0x71f4('0x46')](_0x52c5d6['model'],qs[_0x71f4('0x47')](_0x322e99['query']['fields']));_0xf3ba86[_0x71f4('0x48')]=_0xf3ba86['attributes'][_0x71f4('0x49')]?_0xf3ba86['attributes']:_0x52c5d6[_0x71f4('0x43')];if(!_0x322e99[_0x71f4('0x44')]['hasOwnProperty'](_0x71f4('0x4a'))){_0xf3ba86[_0x71f4('0x2d')]=qs['limit'](_0x322e99[_0x71f4('0x44')][_0x71f4('0x2d')]);_0xf3ba86[_0x71f4('0x2b')]=qs[_0x71f4('0x2b')](_0x322e99['query']['offset']);}_0xf3ba86['order']=qs[_0x71f4('0x4b')](_0x322e99[_0x71f4('0x44')][_0x71f4('0x4b')]);_0xf3ba86[_0x71f4('0x4c')]=qs[_0x71f4('0x45')](_[_0x71f4('0x4d')](_0x322e99[_0x71f4('0x44')],_0x52c5d6[_0x71f4('0x45')]),_0x4c05a5);if(_0x322e99[_0x71f4('0x44')][_0x71f4('0x4e')]){_0xf3ba86[_0x71f4('0x4c')]=_[_0x71f4('0x4f')](_0xf3ba86[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0x4c05a5,function(_0xe5c7ef){if(_0xe5c7ef[_0x71f4('0x41')]!=='VIRTUAL'){var _0x34583c={};_0x34583c[_0xe5c7ef[_0x71f4('0x3a')]]={'$like':'%'+_0x322e99[_0x71f4('0x44')][_0x71f4('0x4e')]+'%'};return _0x34583c;}})});}_0xf3ba86=_[_0x71f4('0x4f')]({},_0xf3ba86,_0x322e99['options']);var _0x11f231={'where':_0xf3ba86['where']};return db['SmsAccount'][_0x71f4('0x2e')](_0x11f231)[_0x71f4('0x35')](function(_0x248c6f){_0x3d84e2[_0x71f4('0x2e')]=_0x248c6f;if(_0x322e99[_0x71f4('0x44')]['includeAll']){_0xf3ba86[_0x71f4('0x50')]=[{'all':!![]}];}return db[_0x71f4('0x3e')][_0x71f4('0x51')](_0xf3ba86);})[_0x71f4('0x35')](function(_0x4d7f62){_0x3d84e2[_0x71f4('0x52')]=_0x4d7f62;return _0x3d84e2;})['then'](respondWithFilteredResult(_0x14b207,_0xf3ba86))['catch'](handleError(_0x14b207,null));};exports['show']=function(_0x10ad4e,_0x3ec70e){var _0x11fbb9={'raw':![],'where':{'id':_0x10ad4e['params']['id']},'include':[{'model':db[_0x71f4('0x53')],'as':'mandatoryDispositionPause'}]},_0x230d47={};_0x230d47[_0x71f4('0x43')]=_[_0x71f4('0x54')](db[_0x71f4('0x3e')][_0x71f4('0x3f')]);_0x230d47[_0x71f4('0x44')]=_[_0x71f4('0x54')](_0x10ad4e[_0x71f4('0x44')]);_0x230d47['filters']=_[_0x71f4('0x46')](_0x230d47[_0x71f4('0x43')],_0x230d47['query']);_0x11fbb9['attributes']=_[_0x71f4('0x46')](_0x230d47[_0x71f4('0x43')],qs[_0x71f4('0x47')](_0x10ad4e[_0x71f4('0x44')][_0x71f4('0x47')]));_0x11fbb9[_0x71f4('0x48')]=_0x11fbb9['attributes'][_0x71f4('0x49')]?_0x11fbb9['attributes']:_0x230d47['model'];if(_0x10ad4e['query']['includeAll']){_0x11fbb9[_0x71f4('0x50')]=[{'all':!![]}];}_0x11fbb9=_['merge']({},_0x11fbb9,_0x10ad4e[_0x71f4('0x55')]);return db[_0x71f4('0x3e')][_0x71f4('0x56')](_0x11fbb9)['then'](handleEntityNotFound(_0x3ec70e,null))[_0x71f4('0x35')](respondWithResult(_0x3ec70e,null))['catch'](handleError(_0x3ec70e,null));};exports['create']=function(_0x50f6bc,_0x582246){return db[_0x71f4('0x3e')][_0x71f4('0x57')](_0x50f6bc[_0x71f4('0x58')],{})[_0x71f4('0x35')](function(_0x32d642){var _0x2f9599=_0x50f6bc[_0x71f4('0x59')][_0x71f4('0x37')]({'plain':!![]});if(!_0x2f9599)throw new Error(_0x71f4('0x5a'));if(_0x2f9599['role']===_0x71f4('0x59')){var _0x22a593=_0x32d642[_0x71f4('0x37')]({'plain':!![]});var _0x2bc3e0=_0x71f4('0x38');return db[_0x71f4('0x5b')][_0x71f4('0x56')]({'where':{'name':_0x2bc3e0,'userProfileId':_0x2f9599[_0x71f4('0x5c')]},'raw':!![]})[_0x71f4('0x35')](function(_0x4319fc){if(_0x4319fc&&_0x4319fc['autoAssociation']===0x0){return db[_0x71f4('0x5d')][_0x71f4('0x57')]({'name':_0x22a593[_0x71f4('0x3a')],'resourceId':_0x22a593['id'],'type':_0x4319fc['name'],'sectionId':_0x4319fc['id']},{})['then'](function(){return _0x32d642;});}else{return _0x32d642;}})[_0x71f4('0x5e')](function(_0x44cd01){logger[_0x71f4('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44cd01);throw _0x44cd01;});}return _0x32d642;})[_0x71f4('0x35')](respondWithResult(_0x582246,0xc9))['catch'](handleError(_0x582246,null));};exports['update']=function(_0x3bd584,_0x567a8a){if(_0x3bd584['body']['id']){delete _0x3bd584[_0x71f4('0x58')]['id'];}return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x3bd584['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x567a8a,null))[_0x71f4('0x35')](saveUpdates(_0x3bd584['body'],null))[_0x71f4('0x35')](respondWithResult(_0x567a8a,null))[_0x71f4('0x5e')](handleError(_0x567a8a,null));};exports[_0x71f4('0x36')]=function(_0x12671c,_0x15a402){return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x12671c[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x15a402,null))[_0x71f4('0x35')](removeEntity(_0x15a402,null))['catch'](handleError(_0x15a402,null));};exports[_0x71f4('0x60')]=function(_0x59f78f,_0x4b8794){return db['SmsAccount'][_0x71f4('0x60')]()[_0x71f4('0x35')](respondWithResult(_0x4b8794,null))[_0x71f4('0x5e')](handleError(_0x4b8794,null));};exports[_0x71f4('0x61')]=function(_0x35b9d3,_0xa5c232,_0x2162c2){if(_0x35b9d3[_0x71f4('0x58')]['id']){delete _0x35b9d3[_0x71f4('0x58')]['id'];}return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x35b9d3[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0xa5c232,null))['then'](function(_0x577cb1){if(_0x577cb1){_0x35b9d3[_0x71f4('0x58')]['SmsAccountId']=_0x577cb1['id'];return db[_0x71f4('0x62')][_0x71f4('0x57')](_0x35b9d3[_0x71f4('0x58')]);}})['then'](respondWithResult(_0xa5c232,null))[_0x71f4('0x5e')](handleError(_0xa5c232,null));};exports['getDispositions']=function(_0x56b2a0,_0x285a99,_0x16a315){var _0x80e8a={'raw':![],'where':{}};var _0x384e6e={};var _0x56a876={'count':0x0,'rows':[]};return db['SmsAccount'][_0x71f4('0x63')]({'where':{'id':_0x56b2a0[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x285a99,null))[_0x71f4('0x35')](function(_0x417ae2){if(_0x417ae2){_0x384e6e[_0x71f4('0x43')]=_[_0x71f4('0x54')](db[_0x71f4('0x62')]['rawAttributes']);_0x384e6e['query']=_[_0x71f4('0x54')](_0x56b2a0[_0x71f4('0x44')]);_0x384e6e['filters']=_[_0x71f4('0x46')](_0x384e6e[_0x71f4('0x43')],_0x384e6e['query']);_0x80e8a[_0x71f4('0x48')]=_[_0x71f4('0x46')](_0x384e6e[_0x71f4('0x43')],qs['fields'](_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x47')]));_0x80e8a[_0x71f4('0x48')]=_0x80e8a[_0x71f4('0x48')][_0x71f4('0x49')]?_0x80e8a[_0x71f4('0x48')]:_0x384e6e[_0x71f4('0x43')];if(!_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x64')](_0x71f4('0x4a'))){_0x80e8a[_0x71f4('0x2d')]=qs[_0x71f4('0x2d')](_0x56b2a0[_0x71f4('0x44')]['limit']);_0x80e8a[_0x71f4('0x2b')]=qs[_0x71f4('0x2b')](_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x2b')]);}_0x80e8a['order']=qs[_0x71f4('0x4b')](_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x4b')]);_0x80e8a[_0x71f4('0x4c')]=qs[_0x71f4('0x45')](_[_0x71f4('0x4d')](_0x56b2a0['query'],_0x384e6e[_0x71f4('0x45')]));_0x80e8a[_0x71f4('0x4c')][_0x71f4('0x65')]=_0x417ae2['id'];if(_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x4e')]){_0x80e8a['where']=_['merge'](_0x80e8a[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0x80e8a[_0x71f4('0x48')],function(_0x5f2929){var _0x4c9326={};_0x4c9326[_0x5f2929]={'$like':'%'+_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x4e')]+'%'};return _0x4c9326;})});}_0x80e8a=_['merge']({},_0x80e8a,_0x56b2a0['options']);return db[_0x71f4('0x62')]['count']({'where':_0x80e8a[_0x71f4('0x4c')]})['then'](function(_0x1fb39f){_0x56a876[_0x71f4('0x2e')]=_0x1fb39f;if(_0x56b2a0[_0x71f4('0x44')][_0x71f4('0x66')]){_0x80e8a[_0x71f4('0x50')]=[{'all':!![]}];}return db[_0x71f4('0x62')]['findAll'](_0x80e8a);})[_0x71f4('0x35')](function(_0x5caeb4){_0x56a876[_0x71f4('0x52')]=_0x5caeb4;return _0x56a876;});}})['then'](respondWithFilteredResult(_0x285a99,_0x80e8a))[_0x71f4('0x5e')](handleError(_0x285a99,null));};exports['removeDispositions']=function(_0x31e31c,_0x554942,_0x32558c){return db[_0x71f4('0x3e')]['find']({'where':{'id':_0x31e31c[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x554942,null))[_0x71f4('0x35')](function(_0x1441dc){if(_0x1441dc){return _0x1441dc['removeDispositions'](_0x31e31c['query'][_0x71f4('0x67')]);}})['then'](respondWithStatusCode(_0x554942,null))[_0x71f4('0x5e')](handleError(_0x554942,null));};exports['addAnswer']=function(_0x580799,_0x3ecaf7,_0x16eeca){if(_0x580799['body']['id']){delete _0x580799[_0x71f4('0x58')]['id'];}return db['SmsAccount'][_0x71f4('0x56')]({'where':{'id':_0x580799[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x3ecaf7,null))['then'](function(_0x539545){if(_0x539545){_0x580799['body'][_0x71f4('0x65')]=_0x539545['id'];return db[_0x71f4('0x68')][_0x71f4('0x57')](_0x580799[_0x71f4('0x58')]);}})[_0x71f4('0x35')](respondWithResult(_0x3ecaf7,null))['catch'](handleError(_0x3ecaf7,null));};exports['getAnswers']=function(_0x34f728,_0x4ab3d6,_0x145455){var _0x5371c8={'raw':![],'where':{}};var _0x4ba834={};var _0x1051c5={'count':0x0,'rows':[]};return db[_0x71f4('0x3e')][_0x71f4('0x63')]({'where':{'id':_0x34f728[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x4ab3d6,null))['then'](function(_0x1f76ce){if(_0x1f76ce){_0x4ba834[_0x71f4('0x43')]=_[_0x71f4('0x54')](db[_0x71f4('0x68')][_0x71f4('0x3f')]);_0x4ba834[_0x71f4('0x44')]=_['keys'](_0x34f728['query']);_0x4ba834[_0x71f4('0x45')]=_[_0x71f4('0x46')](_0x4ba834[_0x71f4('0x43')],_0x4ba834[_0x71f4('0x44')]);_0x5371c8[_0x71f4('0x48')]=_[_0x71f4('0x46')](_0x4ba834['model'],qs[_0x71f4('0x47')](_0x34f728[_0x71f4('0x44')][_0x71f4('0x47')]));_0x5371c8[_0x71f4('0x48')]=_0x5371c8[_0x71f4('0x48')][_0x71f4('0x49')]?_0x5371c8['attributes']:_0x4ba834[_0x71f4('0x43')];if(!_0x34f728[_0x71f4('0x44')][_0x71f4('0x64')](_0x71f4('0x4a'))){_0x5371c8[_0x71f4('0x2d')]=qs[_0x71f4('0x2d')](_0x34f728[_0x71f4('0x44')][_0x71f4('0x2d')]);_0x5371c8[_0x71f4('0x2b')]=qs[_0x71f4('0x2b')](_0x34f728[_0x71f4('0x44')][_0x71f4('0x2b')]);}_0x5371c8[_0x71f4('0x69')]=qs['sort'](_0x34f728[_0x71f4('0x44')][_0x71f4('0x4b')]);_0x5371c8[_0x71f4('0x4c')]=qs[_0x71f4('0x45')](_[_0x71f4('0x4d')](_0x34f728[_0x71f4('0x44')],_0x4ba834['filters']));_0x5371c8[_0x71f4('0x4c')][_0x71f4('0x65')]=_0x1f76ce['id'];if(_0x34f728[_0x71f4('0x44')]['filter']){_0x5371c8[_0x71f4('0x4c')]=_[_0x71f4('0x4f')](_0x5371c8[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0x5371c8['attributes'],function(_0x5ca570){var _0x165a36={};_0x165a36[_0x5ca570]={'$like':'%'+_0x34f728[_0x71f4('0x44')][_0x71f4('0x4e')]+'%'};return _0x165a36;})});}_0x5371c8=_[_0x71f4('0x4f')]({},_0x5371c8,_0x34f728[_0x71f4('0x55')]);return db[_0x71f4('0x68')]['count']({'where':_0x5371c8['where']})[_0x71f4('0x35')](function(_0x390f79){_0x1051c5[_0x71f4('0x2e')]=_0x390f79;if(_0x34f728['query'][_0x71f4('0x66')]){_0x5371c8[_0x71f4('0x50')]=[{'all':!![]}];}return db[_0x71f4('0x68')][_0x71f4('0x51')](_0x5371c8);})[_0x71f4('0x35')](function(_0x4f12c9){_0x1051c5[_0x71f4('0x52')]=_0x4f12c9;return _0x1051c5;});}})['then'](respondWithFilteredResult(_0x4ab3d6,_0x5371c8))[_0x71f4('0x5e')](handleError(_0x4ab3d6,null));};exports[_0x71f4('0x6a')]=function(_0x4a03d5,_0x2ead11,_0x33f352){return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x4a03d5[_0x71f4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x2ead11,null))[_0x71f4('0x35')](function(_0x11cd6c){if(_0x11cd6c){return _0x11cd6c[_0x71f4('0x6a')](_0x4a03d5['query'][_0x71f4('0x67')]);}})['then'](respondWithStatusCode(_0x2ead11,null))[_0x71f4('0x5e')](handleError(_0x2ead11,null));};exports[_0x71f4('0x6b')]=function(_0x8596a9,_0x48f4c8,_0x24f0b0){var _0x442008={'channel':_0x71f4('0x6c')};var _0x5a0e03=[];var _0x29c2c1=[];var _0x48a6c8={};return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x8596a9[_0x71f4('0x5f')]['id']},'include':[{'model':db[_0x71f4('0x6d')],'as':_0x71f4('0x6e')}]})['then'](handleEntityNotFound(_0x48f4c8,null))['then'](function(_0x485018){_0x442008[_0x71f4('0x6f')]=_0x485018;_0x442008[_0x71f4('0x70')]=_['orderBy'](_0x485018['Applications'],[_0x71f4('0x71')],[_0x71f4('0x72')]);if(_0x442008['account'][_0x71f4('0x6e')]){delete _0x442008[_0x71f4('0x6f')]['Applications'];}return db['CmContact'][_0x71f4('0x60')]();})[_0x71f4('0x35')](function(_0x29ef31){if(!_0x29ef31){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))](_0x71f4('0x75'));}_0x5a0e03=_['difference'](_[_0x71f4('0x54')](_0x29ef31),[_0x71f4('0x76'),_0x71f4('0x77')]);_0x29c2c1=_['difference'](_[_0x71f4('0x54')](_0x29ef31),[_0x71f4('0x76'),_0x71f4('0x77'),_0x71f4('0x78'),_0x71f4('0x79')]);_0x442008[_0x71f4('0x58')]={'mapKey':_0x71f4('0x7a')};if(_0x442008[_0x71f4('0x6f')]['type']){switch(_0x442008[_0x71f4('0x6f')]['type']){case'twilio':_0x442008[_0x71f4('0x58')]['from']=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x7b')];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x7c')];_0x442008[_0x71f4('0x58')][_0x71f4('0x7d')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x7e')];break;case'skebby':_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]='+'+_0x8596a9['body'][_0x71f4('0x80')];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9['body'][_0x71f4('0x81')];break;case _0x71f4('0x82'):_0x442008[_0x71f4('0x58')]['from']=_0x8596a9[_0x71f4('0x58')]['from'];_0x442008['body']['body']=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x27')];break;case _0x71f4('0x83'):_0x442008['body']['from']=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x7f')];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9['body'][_0x71f4('0x58')];_0x442008['body'][_0x71f4('0x7d')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x84')];break;case _0x71f4('0x85'):_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]=_0x8596a9['body'][_0x71f4('0x7b')];_0x442008['body'][_0x71f4('0x58')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x86')];_0x442008[_0x71f4('0x58')][_0x71f4('0x7d')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x87')];break;case _0x71f4('0x88'):_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]='+'+_0x8596a9[_0x71f4('0x58')]['results'][0x0][_0x71f4('0x7f')];_0x442008[_0x71f4('0x58')]['body']=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x89')][0x0][_0x71f4('0x81')];_0x442008['body'][_0x71f4('0x7d')]=_0x8596a9[_0x71f4('0x58')]['results'][0x0][_0x71f4('0x7d')];break;case'csc':_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x8a')];_0x442008[_0x71f4('0x58')]['body']=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x8b')][_0x71f4('0x27')];break;case _0x71f4('0x8c'):_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]=_0x8596a9[_0x71f4('0x58')]['fromNumber'];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x81')];_0x442008[_0x71f4('0x58')]['messageId']=_0x8596a9[_0x71f4('0x58')]['replyMessageId'];break;case _0x71f4('0x8d'):_0x442008['body'][_0x71f4('0x7d')]=_0x8596a9[_0x71f4('0x58')][0x0][_0x71f4('0x27')]['id'];_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]=_0x8596a9['body'][0x0][_0x71f4('0x27')][_0x71f4('0x7f')];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9[_0x71f4('0x58')][0x0][_0x71f4('0x27')][_0x71f4('0x81')];break;case'intelepeer':_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x7f')];_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]=_0x8596a9[_0x71f4('0x58')][_0x71f4('0x27')];_0x442008['body']['messageId']=_0x8596a9[_0x71f4('0x58')]['refid'];break;}}if(_0x442008[_0x71f4('0x58')]['id']){delete _0x442008[_0x71f4('0x58')]['id'];}if(_['isNil'](_0x442008[_0x71f4('0x58')]['from'])){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))](_0x71f4('0x8e'));}if(_[_0x71f4('0x8f')](_0x442008['body']['body'])||_0x442008[_0x71f4('0x58')][_0x71f4('0x58')]===''){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x442008['body']['mapKey'])){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))](_0x71f4('0x90')+_0x29c2c1);}if(!_[_0x71f4('0x91')](_0x29c2c1,_0x442008['body'][_0x71f4('0x92')])){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))](_0x71f4('0x93')+_0x29c2c1);}_0x48a6c8[_0x442008['body'][_0x71f4('0x92')]]=_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')];return db[_0x71f4('0x94')]['find']({'where':{'id':_0x442008[_0x71f4('0x6f')]['ListId']},'include':[{'model':db[_0x71f4('0x95')],'as':_0x71f4('0x96'),'where':_0x48a6c8,'limit':0x1,'order':[['updatedAt',_0x71f4('0x97')]]}]});})[_0x71f4('0x35')](handleEntityNotFound(_0x48f4c8,null))[_0x71f4('0x35')](function(_0x525f53){if(_0x525f53){_0x442008[_0x71f4('0x98')]=_['omit'](_0x525f53,[_0x71f4('0x96')]);if(_0x525f53[_0x71f4('0x96')][_0x71f4('0x49')]){return _0x525f53['Contacts'][0x0];}var _0x547409=_[_0x71f4('0x99')](_0x442008[_0x71f4('0x58')],{'firstName':_0x442008[_0x71f4('0x58')][_0x71f4('0x7f')],'ListId':_0x525f53['id']});_0x547409[_0x442008['body'][_0x71f4('0x92')]]=_0x442008['body'][_0x71f4('0x7f')];return db[_0x71f4('0x95')][_0x71f4('0x57')](_0x547409,{'fields':_0x5a0e03,'raw':!![]});}})[_0x71f4('0x35')](handleEntityNotFound(_0x48f4c8,null))[_0x71f4('0x35')](function(_0x40c892){if(_0x40c892){_0x442008[_0x71f4('0x9a')]=_0x40c892;var _0x3d66d6={'ContactId':_0x40c892['id'],'phone':_0x442008['body'][_0x71f4('0x7f')],'SmsAccountId':_0x8596a9[_0x71f4('0x5f')]['id']};var _0x28e4bf={'ContactId':_0x40c892['id'],'SmsAccountId':_0x8596a9[_0x71f4('0x5f')]['id'],'closed':![]};return db['SmsInteraction'][_0x71f4('0x56')]({'where':_0x28e4bf})[_0x71f4('0x35')](function(_0x2cc4fb){if(_0x2cc4fb){return[_0x2cc4fb,![]];}return db[_0x71f4('0x9b')][_0x71f4('0x57')](_0x3d66d6)[_0x71f4('0x35')](function(_0x6b117e){return[_0x6b117e,!![]];});});}})[_0x71f4('0x9c')](function(_0x1e6e4e,_0x4a1dce){_0x442008['interaction']=_0x1e6e4e['get']({'plain':!![]});_0x442008['interaction']['created']=![];if(_0x4a1dce){if(_0x442008['account']['autoclose']){_0x442008[_0x71f4('0x70')]['push']({'id':0x0,'priority':_0x442008[_0x71f4('0x70')]['length']+0x1,'app':_0x71f4('0x9d'),'appdata':_0x71f4('0x9e'),'interval':'*,*,*,*'});}_0x442008[_0x71f4('0x9f')][_0x71f4('0xa0')]=!![];}return db[_0x71f4('0xa1')][_0x71f4('0x57')]({'phone':_0x442008['body']['from'],'messageId':_0x442008[_0x71f4('0x58')][_0x71f4('0x7d')],'body':_0x442008[_0x71f4('0x58')]['body'],'SmsAccountId':_0x8596a9['params']['id'],'SmsInteractionId':_0x1e6e4e['id'],'direction':'in','ContactId':_0x1e6e4e[_0x71f4('0xa2')],'AttachmentId':_0x442008[_0x71f4('0x58')][_0x71f4('0xa3')]});})[_0x71f4('0x35')](function(_0x3fc5c4){_0x442008[_0x71f4('0x27')]=_0x3fc5c4;if(_0x442008[_0x71f4('0x9f')][_0x71f4('0xa4')]){return db[_0x71f4('0xa5')][_0x71f4('0x56')]({'attributes':['id',_0x71f4('0x3a')],'where':{'id':_0x442008[_0x71f4('0x9f')][_0x71f4('0xa4')]}})[_0x71f4('0x35')](function(_0x5e09a1){if(_0x5e09a1){_0x442008[_0x71f4('0x70')][_0x71f4('0xa6')]({'id':0x0,'priority':0x0,'app':_0x71f4('0xa7'),'appdata':_0x5e09a1['name']+','+(_0x442008[_0x71f4('0x6f')]['waitForTheAssignedAgent']||0xa),'interval':_0x71f4('0xa8')});}return respondWithRpcPromise(_0x71f4('0xa9'),_0x71f4('0xaa'),_0x442008);});}return respondWithRpcPromise(_0x71f4('0xa9'),_0x71f4('0xaa'),_0x442008);})[_0x71f4('0x35')](function(_0x58b903){if(_0x58b903){var _0x1cd3ce=0xc8;var _0x29a71d=_0x71f4('0xab');logger['info'](_0x71f4('0x23'),_0x29a71d,_0x1cd3ce,_0x71f4('0xac'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x29a71d,_0x1cd3ce,_0x71f4('0xac'),JSON[_0x71f4('0x24')](_0x58b903));if(_0x442008[_0x71f4('0x6f')][_0x71f4('0x41')]===_0x71f4('0xad')){return _0x48f4c8['status'](_0x1cd3ce)[_0x71f4('0x2f')](_0x71f4('0xae'),_0x71f4('0xaf'))['send']('\x0a');}else{return _0x48f4c8['status'](_0x1cd3ce)[_0x71f4('0x31')](_0x58b903);}}})['catch'](handleError(_0x48f4c8,null));};exports[_0x71f4('0xb0')]=function(_0x495456,_0x1fbfb9){var _0x80e615=_0x495456[_0x71f4('0x5f')]['id'];var _0x3c9fd1=_0x495456[_0x71f4('0x58')];var _0x232855=0xc8;var _0x3f4288=null;return db[_0x71f4('0xb1')][_0x71f4('0xb2')]({'isolationLevel':db[_0x71f4('0xb1')][_0x71f4('0xb3')][_0x71f4('0xb4')]['READ_COMMITTED']},function(_0x390486){return db[_0x71f4('0x3e')][_0x71f4('0x63')]({'where':{'id':_0x80e615},'transaction':_0x390486})[_0x71f4('0x35')](function(_0x41dd8a){if(_0x41dd8a){return db[_0x71f4('0x6d')]['destroy']({'where':{'SmsAccountId':_0x80e615},'transaction':_0x390486})[_0x71f4('0x35')](function(){var _0x2cf20a=_[_0x71f4('0x3d')](_0x3c9fd1,function(_0x28f6bc){_0x28f6bc[_0x71f4('0x65')]=_0x80e615;return _0x28f6bc;});return db[_0x71f4('0x6d')][_0x71f4('0xb5')](_0x2cf20a,{'transaction':_0x390486});});}else{_0x232855=0x194;_0x3f4288=[];}});})[_0x71f4('0x35')](function(){if(_0x232855!==0x194){return db[_0x71f4('0x6d')]['findAndCountAll']({'where':{'SmsAccountId':_0x80e615},'order':'priority'})[_0x71f4('0x35')](function(_0x4c62b0){_0x3f4288=_0x4c62b0;});}})[_0x71f4('0x5e')](function(_0x272b56){_0x232855=0x1f4;logger[_0x71f4('0x25')](_0x272b56[_0x71f4('0xb6')]);if(_0x272b56['name']){delete _0x272b56[_0x71f4('0x3a')];}_0x3f4288=_0x272b56;})['finally'](function(){if(_0x3f4288===null){_0x1fbfb9[_0x71f4('0x39')](_0x232855);}else{if(_0x232855===0x1f4){_0x1fbfb9[_0x71f4('0x29')](_0x232855)[_0x71f4('0xb7')](_0x3f4288);}else{_0x1fbfb9[_0x71f4('0x29')](_0x232855)[_0x71f4('0x31')](_0x3f4288);}}});};exports[_0x71f4('0xb8')]=function(_0x4206fb,_0x299249,_0x54908b){var _0x5361a5={};var _0x18b5af={};var _0xc338a;var _0x379871;return db[_0x71f4('0x3e')][_0x71f4('0x63')]({'where':{'id':_0x4206fb[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x299249,null))['then'](function(_0x34dd81){if(_0x34dd81){_0xc338a=_0x34dd81;_0x18b5af[_0x71f4('0x43')]=_[_0x71f4('0x54')](db['SmsApplication'][_0x71f4('0x3f')]);_0x18b5af[_0x71f4('0x44')]=_[_0x71f4('0x54')](_0x4206fb[_0x71f4('0x44')]);_0x18b5af[_0x71f4('0x45')]=_[_0x71f4('0x46')](_0x18b5af[_0x71f4('0x43')],_0x18b5af['query']);_0x5361a5[_0x71f4('0x48')]=_['intersection'](_0x18b5af['model'],qs[_0x71f4('0x47')](_0x4206fb[_0x71f4('0x44')]['fields']));_0x5361a5['attributes']=_0x5361a5[_0x71f4('0x48')][_0x71f4('0x49')]?_0x5361a5['attributes']:_0x18b5af[_0x71f4('0x43')];_0x5361a5[_0x71f4('0x69')]=qs[_0x71f4('0x4b')](_0x4206fb['query'][_0x71f4('0x4b')]);_0x5361a5['where']=qs['filters'](_[_0x71f4('0x4d')](_0x4206fb['query'],_0x18b5af[_0x71f4('0x45')]));if(_0x4206fb[_0x71f4('0x44')]['filter']){_0x5361a5['where']=_[_0x71f4('0x4f')](_0x5361a5[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0x5361a5[_0x71f4('0x48')],function(_0x4872bc){var _0x550541={};_0x550541[_0x4872bc]={'$like':'%'+_0x4206fb[_0x71f4('0x44')]['filter']+'%'};return _0x550541;})});}_0x5361a5=_[_0x71f4('0x4f')]({},_0x5361a5,_0x4206fb[_0x71f4('0x55')]);return _0xc338a[_0x71f4('0xb8')](_0x5361a5);}})[_0x71f4('0x35')](function(_0x2fb6ad){if(_0x2fb6ad){_0x379871=_0x2fb6ad[_0x71f4('0x49')];if(!_0x4206fb[_0x71f4('0x44')]['hasOwnProperty'](_0x71f4('0x4a'))){_0x5361a5[_0x71f4('0x2d')]=qs[_0x71f4('0x2d')](_0x4206fb[_0x71f4('0x44')][_0x71f4('0x2d')]);_0x5361a5[_0x71f4('0x2b')]=qs[_0x71f4('0x2b')](_0x4206fb[_0x71f4('0x44')][_0x71f4('0x2b')]);}return _0xc338a['getApplications'](_0x5361a5);}})['then'](function(_0x57a0b1){if(_0x57a0b1){return _0x57a0b1?{'count':_0x379871,'rows':_0x57a0b1}:null;}})[_0x71f4('0x35')](respondWithResult(_0x299249,null))['catch'](handleError(_0x299249,null));};exports[_0x71f4('0xb9')]=function(_0x537095,_0x14fd13,_0x73d995){var _0x290edc={'raw':![],'where':{}};var _0x5aba8f={};var _0x433fec={'count':0x0,'rows':[]};return db[_0x71f4('0x3e')][_0x71f4('0x63')]({'where':{'id':_0x537095[_0x71f4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x14fd13,null))['then'](function(_0x3df4ad){if(_0x3df4ad){_0x5aba8f[_0x71f4('0x43')]=_[_0x71f4('0x54')](db[_0x71f4('0x9b')][_0x71f4('0x3f')]);_0x5aba8f[_0x71f4('0x44')]=_[_0x71f4('0x54')](_0x537095[_0x71f4('0x44')]);_0x5aba8f[_0x71f4('0x45')]=_[_0x71f4('0x46')](_0x5aba8f[_0x71f4('0x43')],_0x5aba8f[_0x71f4('0x44')]);_0x290edc[_0x71f4('0x48')]=_[_0x71f4('0x46')](_0x5aba8f[_0x71f4('0x43')],qs['fields'](_0x537095['query']['fields']));_0x290edc[_0x71f4('0x48')]=_0x290edc[_0x71f4('0x48')][_0x71f4('0x49')]?_0x290edc[_0x71f4('0x48')]:_0x5aba8f['model'];if(!_0x537095['query']['hasOwnProperty']('nolimit')){_0x290edc['limit']=qs[_0x71f4('0x2d')](_0x537095[_0x71f4('0x44')]['limit']);_0x290edc['offset']=qs['offset'](_0x537095[_0x71f4('0x44')][_0x71f4('0x2b')]);}_0x290edc['order']=qs[_0x71f4('0x4b')](_0x537095[_0x71f4('0x44')][_0x71f4('0x4b')]);_0x290edc[_0x71f4('0x4c')]=qs[_0x71f4('0x45')](_[_0x71f4('0x4d')](_0x537095[_0x71f4('0x44')],_0x5aba8f[_0x71f4('0x45')]));_0x290edc[_0x71f4('0x4c')][_0x71f4('0x65')]=_0x3df4ad['id'];if(_0x537095[_0x71f4('0x44')][_0x71f4('0x4e')]){_0x290edc[_0x71f4('0x4c')]=_[_0x71f4('0x4f')](_0x290edc[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0x290edc[_0x71f4('0x48')],function(_0x5a80cf){var _0x3cc787={};_0x3cc787[_0x5a80cf]={'$like':'%'+_0x537095[_0x71f4('0x44')][_0x71f4('0x4e')]+'%'};return _0x3cc787;})});}_0x290edc=_[_0x71f4('0x4f')]({},_0x290edc,_0x537095[_0x71f4('0x55')]);return db[_0x71f4('0x9b')][_0x71f4('0x2e')]({'where':_0x290edc[_0x71f4('0x4c')]})[_0x71f4('0x35')](function(_0x45d2da){_0x433fec['count']=_0x45d2da;if(_0x537095[_0x71f4('0x44')][_0x71f4('0x66')]){_0x290edc[_0x71f4('0x50')]=[{'model':db[_0x71f4('0x95')],'as':_0x71f4('0xba'),'required':![]},{'model':db[_0x71f4('0xa5')],'as':_0x71f4('0xbb'),'attributes':['name',_0x71f4('0xbc'),_0x71f4('0xbd')],'required':![]},{'model':db[_0x71f4('0xbe')],'as':_0x71f4('0xbf'),'attributes':['id',_0x71f4('0x3a'),_0x71f4('0xc0')],'where':_0x537095[_0x71f4('0x44')]['tag']?{'id':_0x537095[_0x71f4('0x44')][_0x71f4('0xc1')]}:undefined,'required':_0x537095[_0x71f4('0x44')][_0x71f4('0xc1')]?!![]:![]}];}return db[_0x71f4('0x9b')][_0x71f4('0x51')](_0x290edc);})[_0x71f4('0x35')](function(_0x45f87d){_0x433fec['rows']=_0x45f87d;return _0x433fec;});}})[_0x71f4('0x35')](respondWithFilteredResult(_0x14fd13,_0x290edc))['catch'](handleError(_0x14fd13,null));};exports['send']=function(_0x4afe2e,_0x359902,_0x47771e){var _0x43a27b,_0x14a77d,_0x5694ee;if(_['isNil'](_0x4afe2e[_0x71f4('0x58')][_0x71f4('0x58')])||_0x4afe2e[_0x71f4('0x58')]['body']===''){throw new db[(_0x71f4('0x73'))][(_0x71f4('0x74'))](_0x71f4('0xc2'));}if(_[_0x71f4('0x8f')](_0x4afe2e[_0x71f4('0x58')]['to'])){throw new db[(_0x71f4('0x73'))]['ValidationError'](_0x71f4('0xc3'));}_0x43a27b=_0x4afe2e[_0x71f4('0x58')]['to'];return db['SmsAccount'][_0x71f4('0x56')]({'where':{'id':_0x4afe2e[_0x71f4('0x5f')]['id']},'include':[{'model':db[_0x71f4('0x94')],'as':_0x71f4('0xc4'),'include':[{'model':db[_0x71f4('0x95')],'as':_0x71f4('0x96'),'where':{'mobile':_0x43a27b},'limit':0x1,'order':[[_0x71f4('0x77'),_0x71f4('0x97')]]}]}]})[_0x71f4('0x35')](handleEntityNotFound(_0x359902,null))[_0x71f4('0x35')](function(_0x6c885e){if(_0x6c885e&&_0x6c885e[_0x71f4('0xc4')]){_0x14a77d=_0x6c885e[_0x71f4('0x37')]({'plain':!![]});if(_0x14a77d[_0x71f4('0xc4')]&&_0x14a77d[_0x71f4('0xc4')][_0x71f4('0x96')][_0x71f4('0x49')]){return _0x14a77d[_0x71f4('0xc4')][_0x71f4('0x96')][0x0];}return db[_0x71f4('0x95')][_0x71f4('0x57')](_[_0x71f4('0x99')](_0x4afe2e[_0x71f4('0x58')],{'firstName':_0x43a27b,'mobile':_0x43a27b,'phone':_0x43a27b,'ListId':_0x14a77d[_0x71f4('0x79')]}));}})['then'](handleEntityNotFound(_0x359902,null))[_0x71f4('0x35')](function(_0x14fe71){if(_0x14fe71){_0x5694ee=_0x14fe71;return db[_0x71f4('0x9b')][_0x71f4('0x56')]({'where':{'ContactId':_0x5694ee['id'],'closed':![],'SmsAccountId':_0x14a77d['id']}})[_0x71f4('0x35')](function(_0x43839f){if(_0x43839f){return[_0x43839f,![]];}return db['SmsInteraction'][_0x71f4('0x57')]({'UserId':_0x4afe2e[_0x71f4('0x59')]['id'],'ContactId':_0x5694ee['id'],'SmsAccountId':_0x14a77d['id'],'phone':_0x43a27b,'firstMsgDirection':_0x71f4('0xc5'),'Messages':[_[_0x71f4('0x4f')](_0x4afe2e['body'],{'read':![],'body':_0x4afe2e[_0x71f4('0x58')][_0x71f4('0x58')],'phone':_0x43a27b,'SmsAccountId':_0x14a77d['id'],'UserId':_0x4afe2e[_0x71f4('0x59')]['id'],'ContactId':_0x5694ee['id']})]},{'include':[{'model':db[_0x71f4('0xa1')],'as':_0x71f4('0xc6')}]})[_0x71f4('0x35')](function(_0x5c204b){return[_0x5c204b,!![]];});});}})[_0x71f4('0x9c')](function(_0x20fd31,_0x5cfc7c){if(_0x5cfc7c){return _0x20fd31;}return db[_0x71f4('0xa1')][_0x71f4('0x57')](_[_0x71f4('0x4f')](_0x4afe2e[_0x71f4('0x58')],{'read':![],'body':_0x4afe2e[_0x71f4('0x58')][_0x71f4('0x58')],'phone':_0x43a27b,'SmsAccountId':_0x14a77d['id'],'SmsInteractionId':_0x20fd31['id'],'UserId':_0x4afe2e[_0x71f4('0x59')]['id'],'ContactId':_0x5694ee['id']}))['then'](function(_0x1d7178){_0x20fd31[_0x71f4('0xc7')][_0x71f4('0xc6')]=[];_0x20fd31['dataValues'][_0x71f4('0xc6')][_0x71f4('0xc8')](_0x1d7178[_0x71f4('0xc7')]);return _0x20fd31;});})[_0x71f4('0x35')](respondWithResult(_0x359902,null))[_0x71f4('0x5e')](handleError(_0x359902,null));};exports[_0x71f4('0x29')]=function(_0x3233c2,_0x5b125c,_0x1e114a){if(_0x3233c2[_0x71f4('0x58')]['id']){delete _0x3233c2['body']['id'];}var _0x143012,_0x2f7102,_0x230a42;return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x3233c2['params']['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x5b125c,null))[_0x71f4('0x35')](function(_0x1a08b3){if(_0x1a08b3){_0x230a42=_0x1a08b3;logger[_0x71f4('0x22')](_0x71f4('0x23'),_0x71f4('0x29'),_0x71f4('0xc9'),_0x1a08b3['type'],util[_0x71f4('0xca')](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));switch(_0x1a08b3[_0x71f4('0x41')]){case _0x71f4('0xcb'):if(_0x3233c2['body'][_0x71f4('0xcc')]&&_0x3233c2['body'][_0x71f4('0x29')]){_0x2f7102=_0x3233c2[_0x71f4('0x58')]['status'];return db['SmsMessage'][_0x71f4('0x56')]({'where':{'messageId':_0x3233c2[_0x71f4('0x58')]['skebby_dispatch_id']}});}break;case _0x71f4('0x82'):if(_0x3233c2['body'][_0x71f4('0xcd')]&&_0x3233c2['body'][_0x71f4('0xce')]){_0x2f7102=_0x3233c2[_0x71f4('0x58')]['statusInt'];return db[_0x71f4('0xa1')][_0x71f4('0x56')]({'where':{'messageId':_0x3233c2[_0x71f4('0x58')][_0x71f4('0xcd')]}});}break;case'clicksend':if(_0x3233c2['body'][_0x71f4('0x84')]&&_0x3233c2[_0x71f4('0x58')][_0x71f4('0xcf')]){_0x2f7102=_0x3233c2[_0x71f4('0x58')][_0x71f4('0xcf')];return db[_0x71f4('0xa1')][_0x71f4('0x56')]({'where':{'messageId':_0x3233c2[_0x71f4('0x58')][_0x71f4('0x84')]}});}break;case _0x71f4('0x88'):var _0x507755=_0x3233c2[_0x71f4('0x58')]['results'][0x0];if(_0x507755[_0x71f4('0x7d')]&&_0x507755[_0x71f4('0x29')][_0x71f4('0xd0')]==='DELIVERED'){_0x2f7102=_0x507755['status'][_0x71f4('0xd0')];return db['SmsMessage'][_0x71f4('0x56')]({'where':{'messageId':_0x507755[_0x71f4('0x7d')]}});}break;case'clickatell':if(_0x3233c2[_0x71f4('0x58')][_0x71f4('0x7d')]&&_0x3233c2[_0x71f4('0x58')]['status']){_0x2f7102=_0x3233c2[_0x71f4('0x58')][_0x71f4('0x29')];return db[_0x71f4('0xa1')]['find']({'where':{'messageId':_0x3233c2[_0x71f4('0x58')][_0x71f4('0x7d')]}});}break;case _0x71f4('0x8d'):if(_0x3233c2[_0x71f4('0x58')][0x0][_0x71f4('0x27')]['id']){_0x2f7102=_0x3233c2['body'][0x0]['type'];return db[_0x71f4('0xa1')][_0x71f4('0x56')]({'where':{'messageId':_0x3233c2[_0x71f4('0x58')][0x0][_0x71f4('0x27')]['id']}});}break;case _0x71f4('0xd1'):if(_0x3233c2[_0x71f4('0x58')][_0x71f4('0xd2')]&&_0x3233c2[_0x71f4('0x58')][_0x71f4('0x29')]){_0x2f7102=_0x3233c2[_0x71f4('0x58')]['status'];return db[_0x71f4('0xa1')]['find']({'where':{'messageId':_0x3233c2[_0x71f4('0x58')][_0x71f4('0xd2')]}});}break;}}})[_0x71f4('0x35')](handleEntityNotFound(_0x5b125c,null))[_0x71f4('0x35')](function(_0x6958b8){if(_0x6958b8){_0x143012=_0x6958b8;switch(_0x230a42[_0x71f4('0x41')]){case _0x71f4('0xcb'):if(_0x2f7102===_0x71f4('0xd3')){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger['error'](_0x71f4('0x23'),'status',_0x71f4('0xcb'),util['inspect'](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;case _0x71f4('0x82'):if(_0x2f7102==='1'){return _0x143012['update']({'read':!![]});}else{logger['error'](_0x71f4('0x23'),_0x71f4('0x29'),_0x71f4('0xcb'),util['inspect'](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;case _0x71f4('0x83'):if(!_0x3233c2[_0x71f4('0x58')][_0x71f4('0xd4')]&&_0x2f7102>=0xc8&&_0x2f7102<=0xce){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x71f4('0x29'),'clicksend',util[_0x71f4('0xca')](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;case _0x71f4('0x88'):var _0x36370a=_0x3233c2['body'][_0x71f4('0x89')][0x0];if(_0x36370a[_0x71f4('0x29')][_0x71f4('0xd0')]===_0x71f4('0xd3')){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger[_0x71f4('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x71f4('0x88'),util['inspect'](_0x3233c2['body'],{'showHidden':![],'depth':null}));}break;case _0x71f4('0x8c'):if(_0x2f7102==_0x71f4('0xd5')||_0x2f7102=='RECEIVED_BY_RECIPIENT'){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x71f4('0x29'),'clickatell',util[_0x71f4('0xca')](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;case _0x71f4('0x8d'):if(_0x2f7102=='message-delivered'){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger[_0x71f4('0x25')](_0x71f4('0x23'),'status',_0x71f4('0x8d'),util[_0x71f4('0xca')](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;case _0x71f4('0xd1'):if(_0x2f7102===_0x71f4('0xd6')||_0x2f7102===_0x71f4('0xd7')){return _0x143012[_0x71f4('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x71f4('0x29'),'intelepeer',util['inspect'](_0x3233c2[_0x71f4('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x143012;}})[_0x71f4('0x35')](respondWithResult(_0x5b125c,null))['catch'](handleError(_0x5b125c,null));};exports[_0x71f4('0xd8')]=function(_0x2c5cc9,_0x117e15,_0x10ae18){var _0x3a7433,_0x53c713,_0x165934;return db[_0x71f4('0x3e')]['find']({'where':{'id':_0x2c5cc9[_0x71f4('0x5f')]['id']}})['then'](handleEntityNotFound(_0x117e15,null))[_0x71f4('0x35')](function(_0x4a12c9){if(_0x4a12c9){_0x165934=_0x4a12c9;logger[_0x71f4('0x22')](_0x71f4('0x23'),_0x71f4('0x29'),_0x71f4('0xc9'),_0x4a12c9['type'],util[_0x71f4('0xca')](_0x2c5cc9['query'],{'showHidden':![],'depth':null}));switch(_0x4a12c9[_0x71f4('0x41')]){case _0x71f4('0xd9'):if(_0x2c5cc9[_0x71f4('0x44')][_0x71f4('0xda')]&&_0x2c5cc9[_0x71f4('0x44')]['state']){_0x53c713=_0x2c5cc9[_0x71f4('0x44')][_0x71f4('0xdb')];return db[_0x71f4('0xa1')][_0x71f4('0x56')]({'where':{'messageId':_0x2c5cc9['query'][_0x71f4('0xda')]}});}break;}}})[_0x71f4('0x35')](handleEntityNotFound(_0x117e15,null))[_0x71f4('0x35')](function(_0x2ef17e){if(_0x2ef17e){_0x3a7433=_0x2ef17e;switch(_0x165934['type']){case _0x71f4('0xd9'):if(_0x53c713==='2'||_0x53c713==='6'){return _0x3a7433['update']({'read':!![]});}else{logger[_0x71f4('0x25')](_0x71f4('0x23'),_0x71f4('0x29'),_0x71f4('0xd9'),util['inspect'](_0x2c5cc9[_0x71f4('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x3a7433;}})[_0x71f4('0x35')](respondWithResult(_0x117e15,null))['catch'](handleError(_0x117e15,null));};exports[_0x71f4('0xdc')]=function(_0x20d4cf,_0x39bb89,_0x3192ee){return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x20d4cf['params']['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x39bb89,null))[_0x71f4('0x35')](function(_0x3227d7){if(_0x3227d7){return _0x3227d7[_0x71f4('0xdc')](_0x20d4cf[_0x71f4('0x58')][_0x71f4('0x67')],_['omit'](_0x20d4cf['body'],['ids','id'])||{})[_0x71f4('0x9c')](function(_0x7a6a89){for(var _0x5464d0=0x0;_0x5464d0<_0x20d4cf['body'][_0x71f4('0x67')][_0x71f4('0x49')];_0x5464d0+=0x1){socket[_0x71f4('0xdd')]('userSmsAccount:save',{'UserId':Number(_0x20d4cf['body'][_0x71f4('0x67')][_0x5464d0]),'SmsAccountId':Number(_0x20d4cf['params']['id'])});}return _0x7a6a89;});}})['then'](respondWithResult(_0x39bb89,null))[_0x71f4('0x5e')](handleError(_0x39bb89,null));};exports['removeAgents']=function(_0x467061,_0xcfd500,_0x568de0){return db[_0x71f4('0x3e')][_0x71f4('0x56')]({'where':{'id':_0x467061['params']['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0xcfd500,null))[_0x71f4('0x35')](function(_0x43a3ec){if(_0x43a3ec){return _0x43a3ec['removeAgents'](_0x467061[_0x71f4('0x44')][_0x71f4('0x67')])[_0x71f4('0x35')](function(){if(_[_0x71f4('0xde')](_0x467061[_0x71f4('0x44')][_0x71f4('0x67')])){for(var _0x2072de=0x0;_0x2072de<_0x467061[_0x71f4('0x44')][_0x71f4('0x67')][_0x71f4('0x49')];_0x2072de+=0x1){socket['emit'](_0x71f4('0xdf'),{'UserId':Number(_0x467061[_0x71f4('0x44')][_0x71f4('0x67')][_0x2072de]),'SmsAccountId':Number(_0x467061[_0x71f4('0x5f')]['id'])});}}else{socket[_0x71f4('0xdd')](_0x71f4('0xdf'),{'UserId':Number(_0x467061['query'][_0x71f4('0x67')]),'SmsAccountId':Number(_0x467061[_0x71f4('0x5f')]['id'])});}});}})[_0x71f4('0x35')](respondWithStatusCode(_0xcfd500,null))[_0x71f4('0x5e')](handleError(_0xcfd500,null));};exports['getAgents']=function(_0x34b44b,_0x232fff,_0x5ba377){var _0xd15030={};var _0x185cee={};var _0x3ead4b;var _0x31cb00;return db['SmsAccount'][_0x71f4('0x63')]({'where':{'id':_0x34b44b[_0x71f4('0x5f')]['id']}})[_0x71f4('0x35')](handleEntityNotFound(_0x232fff,null))[_0x71f4('0x35')](function(_0x36e418){if(_0x36e418){_0x3ead4b=_0x36e418;_0x185cee['model']=_[_0x71f4('0x54')](db['User'][_0x71f4('0x3f')]);_0x185cee[_0x71f4('0x44')]=_['keys'](_0x34b44b[_0x71f4('0x44')]);_0x185cee['filters']=_[_0x71f4('0x46')](_0x185cee[_0x71f4('0x43')],_0x185cee['query']);_0xd15030[_0x71f4('0x48')]=_[_0x71f4('0x46')](_0x185cee[_0x71f4('0x43')],qs[_0x71f4('0x47')](_0x34b44b[_0x71f4('0x44')]['fields']));_0xd15030[_0x71f4('0x48')]=_0xd15030[_0x71f4('0x48')][_0x71f4('0x49')]?_0xd15030['attributes']:_0x185cee[_0x71f4('0x43')];_0xd15030[_0x71f4('0x69')]=qs[_0x71f4('0x4b')](_0x34b44b[_0x71f4('0x44')][_0x71f4('0x4b')]);_0xd15030[_0x71f4('0x4c')]=qs[_0x71f4('0x45')](_['pick'](_0x34b44b['query'],_0x185cee['filters']));if(_0x34b44b['query'][_0x71f4('0x4e')]){_0xd15030[_0x71f4('0x4c')]=_[_0x71f4('0x4f')](_0xd15030[_0x71f4('0x4c')],{'$or':_[_0x71f4('0x3d')](_0xd15030[_0x71f4('0x48')],function(_0x1f0393){var _0x50fb87={};_0x50fb87[_0x1f0393]={'$like':'%'+_0x34b44b[_0x71f4('0x44')][_0x71f4('0x4e')]+'%'};return _0x50fb87;})});}_0xd15030=_[_0x71f4('0x4f')]({},_0xd15030,_0x34b44b[_0x71f4('0x55')]);return _0x3ead4b['getAgents'](_0xd15030);}})[_0x71f4('0x35')](function(_0x57d680){if(_0x57d680){_0x31cb00=_0x57d680[_0x71f4('0x49')];if(!_0x34b44b['query'][_0x71f4('0x64')]('nolimit')){_0xd15030[_0x71f4('0x2d')]=qs[_0x71f4('0x2d')](_0x34b44b[_0x71f4('0x44')][_0x71f4('0x2d')]);_0xd15030[_0x71f4('0x2b')]=qs['offset'](_0x34b44b[_0x71f4('0x44')][_0x71f4('0x2b')]);}return _0x3ead4b[_0x71f4('0xe0')](_0xd15030);}})[_0x71f4('0x35')](function(_0x531b11){if(_0x531b11){return _0x531b11?{'count':_0x31cb00,'rows':_0x531b11}:null;}})[_0x71f4('0x35')](respondWithResult(_0x232fff,null))[_0x71f4('0x5e')](handleError(_0x232fff,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 54c7939..f0b2a1f 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 _0x6c36=['events','SmsAccount','setMaxListeners','save','emit','hasOwnProperty','hook','exports'];(function(_0x565c49,_0x54acd0){var _0x20ca34=function(_0x42f7e1){while(--_0x42f7e1){_0x565c49['push'](_0x565c49['shift']());}};_0x20ca34(++_0x54acd0);}(_0x6c36,0x138));var _0x66c3=function(_0x1c6473,_0x15a5f3){_0x1c6473=_0x1c6473-0x0;var _0x326bb4=_0x6c36[_0x1c6473];return _0x326bb4;};'use strict';var EventEmitter=require(_0x66c3('0x0'));var SmsAccount=require('../../mysqldb')['db'][_0x66c3('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x66c3('0x2')](0x0);var events={'afterCreate':_0x66c3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x484347){return function(_0x4a28d6,_0xe69e9b,_0x11279b){SmsAccountEvents[_0x66c3('0x4')](_0x484347+':'+_0x4a28d6['id'],_0x4a28d6);SmsAccountEvents['emit'](_0x484347,_0x4a28d6);_0x11279b(null);};}for(var e in events){if(events[_0x66c3('0x5')](e)){var event=events[e];SmsAccount[_0x66c3('0x6')](e,emitEvent(event));}}module[_0x66c3('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x0194=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','events'];(function(_0x500824,_0x188f1c){var _0x1ddb2b=function(_0xcd5915){while(--_0xcd5915){_0x500824['push'](_0x500824['shift']());}};_0x1ddb2b(++_0x188f1c);}(_0x0194,0x137));var _0x4019=function(_0x249b0b,_0x4f7737){_0x249b0b=_0x249b0b-0x0;var _0x5b5de9=_0x0194[_0x249b0b];return _0x5b5de9;};'use strict';var EventEmitter=require(_0x4019('0x0'));var SmsAccount=require(_0x4019('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x4019('0x2')](0x0);var events={'afterCreate':_0x4019('0x3'),'afterUpdate':_0x4019('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4bb45d){return function(_0x252da8,_0x47e427,_0x587474){SmsAccountEvents[_0x4019('0x5')](_0x4bb45d+':'+_0x252da8['id'],_0x252da8);SmsAccountEvents[_0x4019('0x5')](_0x4bb45d,_0x252da8);_0x587474(null);};}for(var e in events){if(events[_0x4019('0x6')](e)){var event=events[e];SmsAccount[_0x4019('0x7')](e,emitEvent(event));}}module['exports']=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 2ac8d09..35a142d 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 _0x5daf=['path','./smsAccount.attributes','exports','define','SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5ad0db,_0x17ccfc){var _0x5706ef=function(_0x24cff0){while(--_0x24cff0){_0x5ad0db['push'](_0x5ad0db['shift']());}};_0x5706ef(++_0x17ccfc);}(_0x5daf,0x10a));var _0xf5da=function(_0x54de27,_0x4adb9d){_0x54de27=_0x54de27-0x0;var _0x28e0c3=_0x5daf[_0x54de27];return _0x28e0c3;};'use strict';var _=require(_0xf5da('0x0'));var util=require(_0xf5da('0x1'));var logger=require(_0xf5da('0x2'))(_0xf5da('0x3'));var moment=require(_0xf5da('0x4'));var BPromise=require(_0xf5da('0x5'));var rp=require(_0xf5da('0x6'));var fs=require('fs');var path=require(_0xf5da('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5da('0x8'));module[_0xf5da('0x9')]=function(_0x332bb4,_0x5786b0){return _0x332bb4[_0xf5da('0xa')](_0xf5da('0xb'),attributes,{'tableName':_0xf5da('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb150=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','sms_accounts'];(function(_0x396178,_0x5acfb3){var _0x4229a3=function(_0x21f0e1){while(--_0x21f0e1){_0x396178['push'](_0x396178['shift']());}};_0x4229a3(++_0x5acfb3);}(_0xb150,0xd1));var _0x0b15=function(_0x30e914,_0x37949c){_0x30e914=_0x30e914-0x0;var _0x5021d9=_0xb150[_0x30e914];return _0x5021d9;};'use strict';var _=require('lodash');var util=require(_0x0b15('0x0'));var logger=require(_0x0b15('0x1'))(_0x0b15('0x2'));var moment=require(_0x0b15('0x3'));var BPromise=require(_0x0b15('0x4'));var rp=require(_0x0b15('0x5'));var fs=require('fs');var path=require(_0x0b15('0x6'));var rimraf=require(_0x0b15('0x7'));var config=require(_0x0b15('0x8'));var attributes=require('./smsAccount.attributes');module[_0x0b15('0x9')]=function(_0x5bc366,_0x24ea1a){return _0x5bc366['define']('SmsAccount',attributes,{'tableName':_0x0b15('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index b38076f..44f7234 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 _0xa4fe=['message','catch','SmsAccount','find','raw','options','attributes','include','map','model','ShowSmsAccount','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x205631,_0x2415c1){var _0x59c36d=function(_0x4d7ccd){while(--_0x4d7ccd){_0x205631['push'](_0x205631['shift']());}};_0x59c36d(++_0x2415c1);}(_0xa4fe,0x94));var _0xea4f=function(_0x2642bf,_0x2fbb91){_0x2642bf=_0x2642bf-0x0;var _0x434fd2=_0xa4fe[_0x2642bf];return _0x434fd2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xea4f('0x0'));var rs=require(_0xea4f('0x1'));var fs=require('fs');var Redis=require(_0xea4f('0x2'));var db=require(_0xea4f('0x3'))['db'];var utils=require(_0xea4f('0x4'));var logger=require(_0xea4f('0x5'))(_0xea4f('0x6'));var config=require(_0xea4f('0x7'));var jayson=require(_0xea4f('0x8'));var client=jayson['client'][_0xea4f('0x9')]({'port':0x232a});config[_0xea4f('0xa')]=_[_0xea4f('0xb')](config[_0xea4f('0xa')],{'host':_0xea4f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xea4f('0xa')]));require(_0xea4f('0xd'))['register'](socket);function respondWithRpcPromise(_0x3f8f80,_0x1193e9,_0x5e0f86){return new BPromise(function(_0x6f03de,_0x5c6172){return client['request'](_0x3f8f80,_0x5e0f86)[_0xea4f('0xe')](function(_0x9e6c1a){logger[_0xea4f('0xf')](_0xea4f('0x10'),_0x1193e9,_0xea4f('0x11'));logger[_0xea4f('0x12')](_0xea4f('0x13'),_0x1193e9,_0xea4f('0x11'),JSON['stringify'](_0x9e6c1a));if(_0x9e6c1a[_0xea4f('0x14')]){if(_0x9e6c1a[_0xea4f('0x14')][_0xea4f('0x15')]===0x1f4){logger['error'](_0xea4f('0x10'),_0x1193e9,_0x9e6c1a[_0xea4f('0x14')][_0xea4f('0x16')]);return _0x5c6172(_0x9e6c1a[_0xea4f('0x14')][_0xea4f('0x16')]);}logger[_0xea4f('0x14')](_0xea4f('0x10'),_0x1193e9,_0x9e6c1a[_0xea4f('0x14')][_0xea4f('0x16')]);return _0x6f03de(_0x9e6c1a[_0xea4f('0x14')][_0xea4f('0x16')]);}else{logger[_0xea4f('0xf')](_0xea4f('0x10'),_0x1193e9,_0xea4f('0x11'));_0x6f03de(_0x9e6c1a['result'][_0xea4f('0x16')]);}})[_0xea4f('0x17')](function(_0x51eac5){logger['error'](_0xea4f('0x10'),_0x1193e9,_0x51eac5);_0x5c6172(_0x51eac5);});});}exports['ShowSmsAccount']=function(_0xcb48de){var _0x2e819a=this;return new Promise(function(_0x31b07,_0x10143e){return db[_0xea4f('0x18')][_0xea4f('0x19')]({'raw':_0xcb48de['options']?_0xcb48de['options'][_0xea4f('0x1a')]===undefined?!![]:![]:!![],'where':_0xcb48de[_0xea4f('0x1b')]?_0xcb48de[_0xea4f('0x1b')]['where']||null:null,'attributes':_0xcb48de['options']?_0xcb48de[_0xea4f('0x1b')][_0xea4f('0x1c')]||null:null,'include':_0xcb48de[_0xea4f('0x1b')]?_0xcb48de[_0xea4f('0x1b')][_0xea4f('0x1d')]?_[_0xea4f('0x1e')](_0xcb48de[_0xea4f('0x1b')][_0xea4f('0x1d')],function(_0x31e630){return{'model':db[_0x31e630['model']],'as':_0x31e630['as'],'attributes':_0x31e630['attributes'],'include':_0x31e630[_0xea4f('0x1d')]?_[_0xea4f('0x1e')](_0x31e630[_0xea4f('0x1d')],function(_0xac7d74){return{'model':db[_0xac7d74['model']],'as':_0xac7d74['as'],'attributes':_0xac7d74[_0xea4f('0x1c')],'include':_0xac7d74['include']?_[_0xea4f('0x1e')](_0xac7d74[_0xea4f('0x1d')],function(_0x1652e5){return{'model':db[_0x1652e5[_0xea4f('0x1f')]],'as':_0x1652e5['as'],'attributes':_0x1652e5[_0xea4f('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xea4f('0xe')](function(_0x5eee64){logger[_0xea4f('0xf')](_0xea4f('0x20'),_0xcb48de);logger[_0xea4f('0x12')]('ShowSmsAccount',_0xcb48de,JSON[_0xea4f('0x21')](_0x5eee64));_0x31b07(_0x5eee64);})['catch'](function(_0x1a57f6){logger[_0xea4f('0x14')]('ShowSmsAccount',_0x1a57f6[_0xea4f('0x16')],_0xcb48de);_0x10143e(_0x2e819a['error'](0x1f4,_0x1a57f6[_0xea4f('0x16')]));});});}; \ No newline at end of file +var _0x9057=['map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','SmsAccount','find','options','raw','attributes','include'];(function(_0x165785,_0x249128){var _0x20bdd5=function(_0x383c40){while(--_0x383c40){_0x165785['push'](_0x165785['shift']());}};_0x20bdd5(++_0x249128);}(_0x9057,0xcf));var _0x7905=function(_0x743701,_0x3e67bb){_0x743701=_0x743701-0x0;var _0x5a141d=_0x9057[_0x743701];return _0x5a141d;};'use strict';var _=require(_0x7905('0x0'));var util=require(_0x7905('0x1'));var moment=require(_0x7905('0x2'));var BPromise=require(_0x7905('0x3'));var rs=require(_0x7905('0x4'));var fs=require('fs');var Redis=require(_0x7905('0x5'));var db=require(_0x7905('0x6'))['db'];var utils=require(_0x7905('0x7'));var logger=require(_0x7905('0x8'))(_0x7905('0x9'));var config=require(_0x7905('0xa'));var jayson=require(_0x7905('0xb'));var client=jayson[_0x7905('0xc')][_0x7905('0xd')]({'port':0x232a});config[_0x7905('0xe')]=_[_0x7905('0xf')](config[_0x7905('0xe')],{'host':_0x7905('0x10'),'port':0x18eb});var socket=require(_0x7905('0x11'))(new Redis(config[_0x7905('0xe')]));require(_0x7905('0x12'))[_0x7905('0x13')](socket);function respondWithRpcPromise(_0x1be422,_0x109650,_0x21264e){return new BPromise(function(_0x1fa71a,_0x2d974e){return client['request'](_0x1be422,_0x21264e)[_0x7905('0x14')](function(_0x343c0c){logger[_0x7905('0x15')](_0x7905('0x16'),_0x109650,'request\x20sent');logger[_0x7905('0x17')](_0x7905('0x18'),_0x109650,_0x7905('0x19'),JSON[_0x7905('0x1a')](_0x343c0c));if(_0x343c0c['error']){if(_0x343c0c[_0x7905('0x1b')][_0x7905('0x1c')]===0x1f4){logger['error'](_0x7905('0x16'),_0x109650,_0x343c0c[_0x7905('0x1b')][_0x7905('0x1d')]);return _0x2d974e(_0x343c0c['error'][_0x7905('0x1d')]);}logger[_0x7905('0x1b')](_0x7905('0x16'),_0x109650,_0x343c0c[_0x7905('0x1b')][_0x7905('0x1d')]);return _0x1fa71a(_0x343c0c[_0x7905('0x1b')][_0x7905('0x1d')]);}else{logger[_0x7905('0x15')](_0x7905('0x16'),_0x109650,_0x7905('0x19'));_0x1fa71a(_0x343c0c[_0x7905('0x1e')][_0x7905('0x1d')]);}})[_0x7905('0x1f')](function(_0x55f08f){logger[_0x7905('0x1b')](_0x7905('0x16'),_0x109650,_0x55f08f);_0x2d974e(_0x55f08f);});});}exports[_0x7905('0x20')]=function(_0x359fe2){var _0x4c77dc=this;return new Promise(function(_0x2d1fd5,_0x354655){return db[_0x7905('0x21')][_0x7905('0x22')]({'raw':_0x359fe2[_0x7905('0x23')]?_0x359fe2[_0x7905('0x23')][_0x7905('0x24')]===undefined?!![]:![]:!![],'where':_0x359fe2[_0x7905('0x23')]?_0x359fe2['options']['where']||null:null,'attributes':_0x359fe2['options']?_0x359fe2['options'][_0x7905('0x25')]||null:null,'include':_0x359fe2[_0x7905('0x23')]?_0x359fe2['options'][_0x7905('0x26')]?_[_0x7905('0x27')](_0x359fe2['options'][_0x7905('0x26')],function(_0x3a7514){return{'model':db[_0x3a7514[_0x7905('0x28')]],'as':_0x3a7514['as'],'attributes':_0x3a7514[_0x7905('0x25')],'include':_0x3a7514[_0x7905('0x26')]?_[_0x7905('0x27')](_0x3a7514[_0x7905('0x26')],function(_0x203385){return{'model':db[_0x203385[_0x7905('0x28')]],'as':_0x203385['as'],'attributes':_0x203385[_0x7905('0x25')],'include':_0x203385[_0x7905('0x26')]?_[_0x7905('0x27')](_0x203385[_0x7905('0x26')],function(_0x10f27b){return{'model':db[_0x10f27b[_0x7905('0x28')]],'as':_0x10f27b['as'],'attributes':_0x10f27b[_0x7905('0x25')]};}):[]};}):[]};}):[]:[]})[_0x7905('0x14')](function(_0x146602){logger['info'](_0x7905('0x20'),_0x359fe2);logger['debug'](_0x7905('0x20'),_0x359fe2,JSON[_0x7905('0x1a')](_0x146602));_0x2d1fd5(_0x146602);})['catch'](function(_0x4781ca){logger[_0x7905('0x1b')](_0x7905('0x20'),_0x4781ca[_0x7905('0x1d')],_0x359fe2);_0x354655(_0x4c77dc[_0x7905('0x1b')](0x1f4,_0x4781ca[_0x7905('0x1d')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index f4d8032..1107c23 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'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 4e4e714..9a2e3ae 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 _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x459c09,_0x596ed4){var _0x2aee20=function(_0x113d25){while(--_0x113d25){_0x459c09['push'](_0x459c09['shift']());}};_0x2aee20(++_0x596ed4);}(_0x34e8,0x12c));var _0x834e=function(_0x399a39,_0x1b275a){_0x399a39=_0x399a39-0x0;var _0xbb278f=_0x34e8[_0x399a39];return _0xbb278f;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file +var _0x34e8=['../../config/environment','./smsApplication.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5a5678,_0x1f6eae){var _0x3138e9=function(_0x451dcd){while(--_0x451dcd){_0x5a5678['push'](_0x5a5678['shift']());}};_0x3138e9(++_0x1f6eae);}(_0x34e8,0x12c));var _0x834e=function(_0x132f24,_0x2e6bb7){_0x132f24=_0x132f24-0x0;var _0x5fe7bb=_0x34e8[_0x132f24];return _0x5fe7bb;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var fs_extra=require(_0x834e('0x5'));var auth=require(_0x834e('0x6'));var interaction=require(_0x834e('0x7'));var config=require(_0x834e('0x8'));var controller=require(_0x834e('0x9'));router[_0x834e('0xa')]('/',auth['isAuthenticated'](),controller[_0x834e('0xb')]);router['get'](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0xe')]);router[_0x834e('0xf')]('/',auth[_0x834e('0xd')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x12')]);router[_0x834e('0x13')](_0x834e('0xc'),auth[_0x834e('0xd')](),controller[_0x834e('0x14')]);module[_0x834e('0x15')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index ca95544..e9d5cbc 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 _0x3c57=['*,*,*,*','sequelize','INTEGER','TEXT','STRING'];(function(_0x2074db,_0x10b81b){var _0x27324c=function(_0x5c3d5c){while(--_0x5c3d5c){_0x2074db['push'](_0x2074db['shift']());}};_0x27324c(++_0x10b81b);}(_0x3c57,0xb0));var _0x73c5=function(_0x160ed6,_0x21f311){_0x160ed6=_0x160ed6-0x0;var _0x2736ef=_0x3c57[_0x160ed6];return _0x2736ef;};'use strict';var Sequelize=require(_0x73c5('0x0'));module['exports']={'priority':{'type':Sequelize[_0x73c5('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x73c5('0x2')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x73c5('0x3')],'defaultValue':_0x73c5('0x4')}}; \ No newline at end of file +var _0x89e6=['exports','STRING','noop','*,*,*,*'];(function(_0x1151f4,_0x3a36b5){var _0x2c068d=function(_0x3c2288){while(--_0x3c2288){_0x1151f4['push'](_0x1151f4['shift']());}};_0x2c068d(++_0x3a36b5);}(_0x89e6,0x108));var _0x689e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89e6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x689e('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x689e('0x1')],'allowNull':![],'defaultValue':_0x689e('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x689e('0x1')]},'interval':{'type':Sequelize[_0x689e('0x1')],'defaultValue':_0x689e('0x3')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index c2641e8..2f23d70 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 _0x11e8=['lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','end','name','index','map','SmsApplication','rawAttributes','fieldName','key','model','query','filters','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x11e8,0x80));var _0x811e=function(_0x3203be,_0x5aec04){_0x3203be=_0x3203be-0x0;var _0x19fca4=_0x11e8[_0x3203be];return _0x19fca4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x811e('0x0'));var zipdir=require(_0x811e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x811e('0x2'));var BPromise=require(_0x811e('0x3'));var Mustache=require(_0x811e('0x4'));var util=require('util');var path=require(_0x811e('0x5'));var sox=require(_0x811e('0x6'));var csv=require(_0x811e('0x7'));var ejs=require(_0x811e('0x8'));var fs=require('fs');var fs_extra=require(_0x811e('0x9'));var _=require(_0x811e('0xa'));var squel=require('squel');var crypto=require(_0x811e('0xb'));var jsforce=require(_0x811e('0xc'));var deskjs=require(_0x811e('0xd'));var toCsv=require(_0x811e('0x7'));var querystring=require(_0x811e('0xe'));var Papa=require('papaparse');var Redis=require(_0x811e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x811e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x811e('0x11'));var utils=require(_0x811e('0x12'));var config=require(_0x811e('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x811e('0x14'))['db'];function respondWithStatusCode(_0x253b9f,_0x277124){_0x277124=_0x277124||0xcc;return function(_0x2613d5){if(_0x2613d5){return _0x253b9f[_0x811e('0x15')](_0x277124);}return _0x253b9f['status'](_0x277124)['end']();};}function respondWithResult(_0x3d4130,_0x4fd445){_0x4fd445=_0x4fd445||0xc8;return function(_0x40a94e){if(_0x40a94e){return _0x3d4130[_0x811e('0x16')](_0x4fd445)[_0x811e('0x17')](_0x40a94e);}};}function respondWithFilteredResult(_0x135c95,_0x3c0865){return function(_0x46ccfa){if(_0x46ccfa){var _0xdc3838=typeof _0x3c0865[_0x811e('0x18')]==='undefined'&&typeof _0x3c0865['limit']===_0x811e('0x19');var _0x4ac123=_0x46ccfa['count'];var _0xdc5c00=_0xdc3838?0x0:_0x3c0865['offset'];var _0x48d554=_0xdc3838?_0x46ccfa[_0x811e('0x1a')]:_0x3c0865[_0x811e('0x18')]+_0x3c0865[_0x811e('0x1b')];var _0x43499f;if(_0x48d554>=_0x4ac123){_0x48d554=_0x4ac123;_0x43499f=0xc8;}else{_0x43499f=0xce;}_0x135c95[_0x811e('0x16')](_0x43499f);return _0x135c95[_0x811e('0x1c')](_0x811e('0x1d'),_0xdc5c00+'-'+_0x48d554+'/'+_0x4ac123)[_0x811e('0x17')](_0x46ccfa);}return null;};}function patchUpdates(_0x51dc06){return function(_0x176092){try{jsonpatch['apply'](_0x176092,_0x51dc06,!![]);}catch(_0x47324a){return BPromise[_0x811e('0x1e')](_0x47324a);}return _0x176092[_0x811e('0x1f')]();};}function saveUpdates(_0x30bd42,_0x584e14){return function(_0x4aba14){if(_0x4aba14){return _0x4aba14[_0x811e('0x20')](_0x30bd42)[_0x811e('0x21')](function(_0x272a2a){return _0x272a2a;});}return null;};}function removeEntity(_0x4b7e6e,_0x4f23ac){return function(_0x2a9bb8){if(_0x2a9bb8){return _0x2a9bb8[_0x811e('0x22')]()[_0x811e('0x21')](function(){_0x4b7e6e[_0x811e('0x16')](0xcc)[_0x811e('0x23')]();});}};}function handleEntityNotFound(_0x5c8469,_0x1df807){return function(_0x201055){if(!_0x201055){_0x5c8469['sendStatus'](0x194);}return _0x201055;};}function handleError(_0x49dd37,_0x14e458){_0x14e458=_0x14e458||0x1f4;return function(_0x5d6fe8){logger['error'](_0x5d6fe8['stack']);if(_0x5d6fe8[_0x811e('0x24')]){delete _0x5d6fe8[_0x811e('0x24')];}_0x49dd37[_0x811e('0x16')](_0x14e458)['send'](_0x5d6fe8);};}exports[_0x811e('0x25')]=function(_0x559f8a,_0x394ef9){var _0x52c709={},_0x352f60={},_0x3b9d8b={'count':0x0,'rows':[]};var _0x1c7cd5=_[_0x811e('0x26')](db[_0x811e('0x27')][_0x811e('0x28')],function(_0xfc8838){return{'name':_0xfc8838[_0x811e('0x29')],'type':_0xfc8838['type'][_0x811e('0x2a')]};});_0x352f60[_0x811e('0x2b')]=_[_0x811e('0x26')](_0x1c7cd5,_0x811e('0x24'));_0x352f60[_0x811e('0x2c')]=_['keys'](_0x559f8a[_0x811e('0x2c')]);_0x352f60[_0x811e('0x2d')]=_['intersection'](_0x352f60[_0x811e('0x2b')],_0x352f60[_0x811e('0x2c')]);_0x52c709['attributes']=_['intersection'](_0x352f60['model'],qs[_0x811e('0x2e')](_0x559f8a[_0x811e('0x2c')]['fields']));_0x52c709[_0x811e('0x2f')]=_0x52c709[_0x811e('0x2f')][_0x811e('0x30')]?_0x52c709[_0x811e('0x2f')]:_0x352f60[_0x811e('0x2b')];if(!_0x559f8a[_0x811e('0x2c')][_0x811e('0x31')]('nolimit')){_0x52c709[_0x811e('0x1b')]=qs[_0x811e('0x1b')](_0x559f8a['query'][_0x811e('0x1b')]);_0x52c709[_0x811e('0x18')]=qs[_0x811e('0x18')](_0x559f8a[_0x811e('0x2c')][_0x811e('0x18')]);}_0x52c709[_0x811e('0x32')]=qs[_0x811e('0x33')](_0x559f8a[_0x811e('0x2c')][_0x811e('0x33')]);_0x52c709[_0x811e('0x34')]=qs['filters'](_[_0x811e('0x35')](_0x559f8a['query'],_0x352f60[_0x811e('0x2d')]),_0x1c7cd5);if(_0x559f8a[_0x811e('0x2c')][_0x811e('0x36')]){_0x52c709[_0x811e('0x34')]=_[_0x811e('0x37')](_0x52c709[_0x811e('0x34')],{'$or':_[_0x811e('0x26')](_0x1c7cd5,function(_0x5ad18c){if(_0x5ad18c[_0x811e('0x38')]!==_0x811e('0x39')){var _0x160d6c={};_0x160d6c[_0x5ad18c[_0x811e('0x24')]]={'$like':'%'+_0x559f8a[_0x811e('0x2c')]['filter']+'%'};return _0x160d6c;}})});}_0x52c709=_[_0x811e('0x37')]({},_0x52c709,_0x559f8a[_0x811e('0x3a')]);var _0x5ebb6e={'where':_0x52c709['where']};return db[_0x811e('0x27')][_0x811e('0x1a')](_0x5ebb6e)[_0x811e('0x21')](function(_0x3f33fb){_0x3b9d8b[_0x811e('0x1a')]=_0x3f33fb;if(_0x559f8a[_0x811e('0x2c')][_0x811e('0x3b')]){_0x52c709[_0x811e('0x3c')]=[{'all':!![]}];}return db[_0x811e('0x27')]['findAll'](_0x52c709);})[_0x811e('0x21')](function(_0x510332){_0x3b9d8b[_0x811e('0x3d')]=_0x510332;return _0x3b9d8b;})[_0x811e('0x21')](respondWithFilteredResult(_0x394ef9,_0x52c709))[_0x811e('0x3e')](handleError(_0x394ef9,null));};exports[_0x811e('0x3f')]=function(_0x400ba7,_0x52f994){var _0xb040fc={'raw':!![],'where':{'id':_0x400ba7[_0x811e('0x40')]['id']}},_0x373251={};_0x373251['model']=_['keys'](db['SmsApplication'][_0x811e('0x28')]);_0x373251[_0x811e('0x2c')]=_[_0x811e('0x41')](_0x400ba7[_0x811e('0x2c')]);_0x373251['filters']=_['intersection'](_0x373251[_0x811e('0x2b')],_0x373251[_0x811e('0x2c')]);_0xb040fc[_0x811e('0x2f')]=_['intersection'](_0x373251[_0x811e('0x2b')],qs[_0x811e('0x2e')](_0x400ba7[_0x811e('0x2c')][_0x811e('0x2e')]));_0xb040fc[_0x811e('0x2f')]=_0xb040fc[_0x811e('0x2f')][_0x811e('0x30')]?_0xb040fc[_0x811e('0x2f')]:_0x373251[_0x811e('0x2b')];if(_0x400ba7[_0x811e('0x2c')][_0x811e('0x3b')]){_0xb040fc[_0x811e('0x3c')]=[{'all':!![]}];}_0xb040fc=_[_0x811e('0x37')]({},_0xb040fc,_0x400ba7[_0x811e('0x3a')]);return db[_0x811e('0x27')][_0x811e('0x42')](_0xb040fc)[_0x811e('0x21')](handleEntityNotFound(_0x52f994,null))[_0x811e('0x21')](respondWithResult(_0x52f994,null))[_0x811e('0x3e')](handleError(_0x52f994,null));};exports[_0x811e('0x43')]=function(_0x5aa9e9,_0x100159){return db['SmsApplication'][_0x811e('0x43')](_0x5aa9e9[_0x811e('0x44')],{})[_0x811e('0x21')](respondWithResult(_0x100159,0xc9))[_0x811e('0x3e')](handleError(_0x100159,null));};exports[_0x811e('0x20')]=function(_0x1522f1,_0x1dd443){if(_0x1522f1[_0x811e('0x44')]['id']){delete _0x1522f1[_0x811e('0x44')]['id'];}return db[_0x811e('0x27')][_0x811e('0x42')]({'where':{'id':_0x1522f1['params']['id']}})[_0x811e('0x21')](handleEntityNotFound(_0x1dd443,null))[_0x811e('0x21')](saveUpdates(_0x1522f1[_0x811e('0x44')],null))[_0x811e('0x21')](respondWithResult(_0x1dd443,null))['catch'](handleError(_0x1dd443,null));};exports[_0x811e('0x22')]=function(_0x9dde76,_0x11eb3d){return db[_0x811e('0x27')][_0x811e('0x42')]({'where':{'id':_0x9dde76['params']['id']}})[_0x811e('0x21')](handleEntityNotFound(_0x11eb3d,null))[_0x811e('0x21')](removeEntity(_0x11eb3d,null))[_0x811e('0x3e')](handleError(_0x11eb3d,null));}; \ No newline at end of file +var _0xe696=['api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','SmsApplication','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe696,0x19f));var _0x6e69=function(_0x50cc76,_0x59a49c){_0x50cc76=_0x50cc76-0x0;var _0x3807f9=_0xe696[_0x50cc76];return _0x3807f9;};'use strict';var emlformat=require(_0x6e69('0x0'));var rimraf=require(_0x6e69('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e69('0x2'));var rp=require(_0x6e69('0x3'));var moment=require('moment');var BPromise=require(_0x6e69('0x4'));var Mustache=require(_0x6e69('0x5'));var util=require(_0x6e69('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6e69('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6e69('0x8'));var _=require(_0x6e69('0x9'));var squel=require(_0x6e69('0xa'));var crypto=require('crypto');var jsforce=require(_0x6e69('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6e69('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6e69('0xc'));var authService=require(_0x6e69('0xd'));var qs=require(_0x6e69('0xe'));var as=require(_0x6e69('0xf'));var hardwareService=require(_0x6e69('0x10'));var logger=require('../../config/logger')(_0x6e69('0x11'));var utils=require(_0x6e69('0x12'));var config=require(_0x6e69('0x13'));var licenseUtil=require(_0x6e69('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fcdef,_0x262d6a){_0x262d6a=_0x262d6a||0xcc;return function(_0x249cbb){if(_0x249cbb){return _0x3fcdef[_0x6e69('0x15')](_0x262d6a);}return _0x3fcdef[_0x6e69('0x16')](_0x262d6a)[_0x6e69('0x17')]();};}function respondWithResult(_0x4b04a0,_0x25c662){_0x25c662=_0x25c662||0xc8;return function(_0x5e256b){if(_0x5e256b){return _0x4b04a0[_0x6e69('0x16')](_0x25c662)[_0x6e69('0x18')](_0x5e256b);}};}function respondWithFilteredResult(_0x39d611,_0x3bfd03){return function(_0x122e00){if(_0x122e00){var _0x4e6be6=typeof _0x3bfd03[_0x6e69('0x19')]===_0x6e69('0x1a')&&typeof _0x3bfd03[_0x6e69('0x1b')]==='undefined';var _0x45a82e=_0x122e00[_0x6e69('0x1c')];var _0x3f999a=_0x4e6be6?0x0:_0x3bfd03[_0x6e69('0x19')];var _0x20a3e6=_0x4e6be6?_0x122e00[_0x6e69('0x1c')]:_0x3bfd03[_0x6e69('0x19')]+_0x3bfd03[_0x6e69('0x1b')];var _0x15fc4f;if(_0x20a3e6>=_0x45a82e){_0x20a3e6=_0x45a82e;_0x15fc4f=0xc8;}else{_0x15fc4f=0xce;}_0x39d611[_0x6e69('0x16')](_0x15fc4f);return _0x39d611[_0x6e69('0x1d')]('Content-Range',_0x3f999a+'-'+_0x20a3e6+'/'+_0x45a82e)[_0x6e69('0x18')](_0x122e00);}return null;};}function patchUpdates(_0xef225c){return function(_0x5135b3){try{jsonpatch[_0x6e69('0x1e')](_0x5135b3,_0xef225c,!![]);}catch(_0x4294f1){return BPromise[_0x6e69('0x1f')](_0x4294f1);}return _0x5135b3[_0x6e69('0x20')]();};}function saveUpdates(_0x2adb90,_0x14757a){return function(_0x1ca155){if(_0x1ca155){return _0x1ca155[_0x6e69('0x21')](_0x2adb90)[_0x6e69('0x22')](function(_0x3f7a05){return _0x3f7a05;});}return null;};}function removeEntity(_0x3a55f2,_0x22a0d7){return function(_0x3a1908){if(_0x3a1908){return _0x3a1908[_0x6e69('0x23')]()['then'](function(){_0x3a55f2[_0x6e69('0x16')](0xcc)[_0x6e69('0x17')]();});}};}function handleEntityNotFound(_0x5d8f48,_0x1d60c9){return function(_0x16fc64){if(!_0x16fc64){_0x5d8f48[_0x6e69('0x15')](0x194);}return _0x16fc64;};}function handleError(_0x24290f,_0x3cf153){_0x3cf153=_0x3cf153||0x1f4;return function(_0x2d4e95){logger[_0x6e69('0x24')](_0x2d4e95[_0x6e69('0x25')]);if(_0x2d4e95[_0x6e69('0x26')]){delete _0x2d4e95[_0x6e69('0x26')];}_0x24290f['status'](_0x3cf153)[_0x6e69('0x27')](_0x2d4e95);};}exports[_0x6e69('0x28')]=function(_0x3a0406,_0x33bfd3){var _0x396345={},_0x5d405c={},_0x56edba={'count':0x0,'rows':[]};var _0x1c7223=_[_0x6e69('0x29')](db[_0x6e69('0x2a')]['rawAttributes'],function(_0x4b7be3){return{'name':_0x4b7be3[_0x6e69('0x2b')],'type':_0x4b7be3[_0x6e69('0x2c')][_0x6e69('0x2d')]};});_0x5d405c[_0x6e69('0x2e')]=_['map'](_0x1c7223,_0x6e69('0x26'));_0x5d405c[_0x6e69('0x2f')]=_[_0x6e69('0x30')](_0x3a0406[_0x6e69('0x2f')]);_0x5d405c['filters']=_[_0x6e69('0x31')](_0x5d405c[_0x6e69('0x2e')],_0x5d405c[_0x6e69('0x2f')]);_0x396345['attributes']=_['intersection'](_0x5d405c['model'],qs[_0x6e69('0x32')](_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x32')]));_0x396345[_0x6e69('0x33')]=_0x396345[_0x6e69('0x33')][_0x6e69('0x34')]?_0x396345['attributes']:_0x5d405c['model'];if(!_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x35')](_0x6e69('0x36'))){_0x396345[_0x6e69('0x1b')]=qs[_0x6e69('0x1b')](_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x1b')]);_0x396345[_0x6e69('0x19')]=qs[_0x6e69('0x19')](_0x3a0406['query'][_0x6e69('0x19')]);}_0x396345[_0x6e69('0x37')]=qs[_0x6e69('0x38')](_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x38')]);_0x396345[_0x6e69('0x39')]=qs[_0x6e69('0x3a')](_[_0x6e69('0x3b')](_0x3a0406['query'],_0x5d405c['filters']),_0x1c7223);if(_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x3c')]){_0x396345['where']=_[_0x6e69('0x3d')](_0x396345['where'],{'$or':_[_0x6e69('0x29')](_0x1c7223,function(_0x4d6c6d){if(_0x4d6c6d[_0x6e69('0x2c')]!==_0x6e69('0x3e')){var _0x8900fc={};_0x8900fc[_0x4d6c6d[_0x6e69('0x26')]]={'$like':'%'+_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x3c')]+'%'};return _0x8900fc;}})});}_0x396345=_[_0x6e69('0x3d')]({},_0x396345,_0x3a0406['options']);var _0x1e6d3a={'where':_0x396345[_0x6e69('0x39')]};return db[_0x6e69('0x2a')][_0x6e69('0x1c')](_0x1e6d3a)['then'](function(_0x2dfdf7){_0x56edba[_0x6e69('0x1c')]=_0x2dfdf7;if(_0x3a0406[_0x6e69('0x2f')][_0x6e69('0x3f')]){_0x396345[_0x6e69('0x40')]=[{'all':!![]}];}return db[_0x6e69('0x2a')]['findAll'](_0x396345);})[_0x6e69('0x22')](function(_0x568fba){_0x56edba[_0x6e69('0x41')]=_0x568fba;return _0x56edba;})[_0x6e69('0x22')](respondWithFilteredResult(_0x33bfd3,_0x396345))[_0x6e69('0x42')](handleError(_0x33bfd3,null));};exports['show']=function(_0x1c7d25,_0x245a3e){var _0x78cfa2={'raw':!![],'where':{'id':_0x1c7d25[_0x6e69('0x43')]['id']}},_0x5cdfa2={};_0x5cdfa2[_0x6e69('0x2e')]=_[_0x6e69('0x30')](db['SmsApplication']['rawAttributes']);_0x5cdfa2['query']=_['keys'](_0x1c7d25[_0x6e69('0x2f')]);_0x5cdfa2[_0x6e69('0x3a')]=_[_0x6e69('0x31')](_0x5cdfa2[_0x6e69('0x2e')],_0x5cdfa2[_0x6e69('0x2f')]);_0x78cfa2[_0x6e69('0x33')]=_[_0x6e69('0x31')](_0x5cdfa2[_0x6e69('0x2e')],qs[_0x6e69('0x32')](_0x1c7d25['query'][_0x6e69('0x32')]));_0x78cfa2[_0x6e69('0x33')]=_0x78cfa2['attributes'][_0x6e69('0x34')]?_0x78cfa2[_0x6e69('0x33')]:_0x5cdfa2[_0x6e69('0x2e')];if(_0x1c7d25[_0x6e69('0x2f')][_0x6e69('0x3f')]){_0x78cfa2['include']=[{'all':!![]}];}_0x78cfa2=_[_0x6e69('0x3d')]({},_0x78cfa2,_0x1c7d25[_0x6e69('0x44')]);return db[_0x6e69('0x2a')]['find'](_0x78cfa2)[_0x6e69('0x22')](handleEntityNotFound(_0x245a3e,null))['then'](respondWithResult(_0x245a3e,null))['catch'](handleError(_0x245a3e,null));};exports[_0x6e69('0x45')]=function(_0x14db9e,_0x5d7ccb){return db[_0x6e69('0x2a')][_0x6e69('0x45')](_0x14db9e[_0x6e69('0x46')],{})[_0x6e69('0x22')](respondWithResult(_0x5d7ccb,0xc9))[_0x6e69('0x42')](handleError(_0x5d7ccb,null));};exports[_0x6e69('0x21')]=function(_0x378ab5,_0x3a46c1){if(_0x378ab5['body']['id']){delete _0x378ab5['body']['id'];}return db[_0x6e69('0x2a')]['find']({'where':{'id':_0x378ab5[_0x6e69('0x43')]['id']}})[_0x6e69('0x22')](handleEntityNotFound(_0x3a46c1,null))[_0x6e69('0x22')](saveUpdates(_0x378ab5[_0x6e69('0x46')],null))[_0x6e69('0x22')](respondWithResult(_0x3a46c1,null))[_0x6e69('0x42')](handleError(_0x3a46c1,null));};exports['destroy']=function(_0x201290,_0x3a3f4e){return db['SmsApplication'][_0x6e69('0x47')]({'where':{'id':_0x201290[_0x6e69('0x43')]['id']}})[_0x6e69('0x22')](handleEntityNotFound(_0x3a3f4e,null))[_0x6e69('0x22')](removeEntity(_0x3a3f4e,null))[_0x6e69('0x42')](handleError(_0x3a3f4e,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index d642f7d..e875901 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 _0xe826=['SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./smsApplication.attributes','exports','define'];(function(_0x2e44a0,_0x19bf8d){var _0x4425ea=function(_0x11ab88){while(--_0x11ab88){_0x2e44a0['push'](_0x2e44a0['shift']());}};_0x4425ea(++_0x19bf8d);}(_0xe826,0x14e));var _0x6e82=function(_0x5c625c,_0x48a028){_0x5c625c=_0x5c625c-0x0;var _0xa145af=_0xe826[_0x5c625c];return _0xa145af;};'use strict';var _=require(_0x6e82('0x0'));var util=require(_0x6e82('0x1'));var logger=require(_0x6e82('0x2'))('api');var moment=require(_0x6e82('0x3'));var BPromise=require(_0x6e82('0x4'));var rp=require(_0x6e82('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6e82('0x6'));var config=require(_0x6e82('0x7'));var attributes=require(_0x6e82('0x8'));module[_0x6e82('0x9')]=function(_0x3364ac,_0x31efeb){return _0x3364ac[_0x6e82('0xa')](_0x6e82('0xb'),attributes,{'tableName':_0x6e82('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e82('0xd'),'collate':_0x6e82('0xe')});}; \ No newline at end of file +var _0x2975=['moment','bluebird','request-promise','./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x143c08,_0x4ddf4e){var _0x574237=function(_0x4c6e43){while(--_0x4c6e43){_0x143c08['push'](_0x143c08['shift']());}};_0x574237(++_0x4ddf4e);}(_0x2975,0x1c5));var _0x5297=function(_0xd266f4,_0x2b6bc2){_0xd266f4=_0xd266f4-0x0;var _0x22ee10=_0x2975[_0xd266f4];return _0x22ee10;};'use strict';var _=require('lodash');var util=require(_0x5297('0x0'));var logger=require(_0x5297('0x1'))(_0x5297('0x2'));var moment=require(_0x5297('0x3'));var BPromise=require(_0x5297('0x4'));var rp=require(_0x5297('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5297('0x6'));module[_0x5297('0x7')]=function(_0x11a43d,_0x3da9c6){return _0x11a43d[_0x5297('0x8')](_0x5297('0x9'),attributes,{'tableName':_0x5297('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x5297('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 4ee4b06..92971a9 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 _0x1c01=['catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x4605a6,_0x4ee25f){var _0x18bc7a=function(_0x2f1228){while(--_0x2f1228){_0x4605a6['push'](_0x4605a6['shift']());}};_0x18bc7a(++_0x4ee25f);}(_0x1c01,0x190));var _0x11c0=function(_0x50e443,_0x491a83){_0x50e443=_0x50e443-0x0;var _0x57526c=_0x1c01[_0x50e443];return _0x57526c;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var moment=require(_0x11c0('0x2'));var BPromise=require(_0x11c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11c0('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x11c0('0x5'))(_0x11c0('0x6'));var config=require(_0x11c0('0x7'));var jayson=require(_0x11c0('0x8'));var client=jayson[_0x11c0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b0c3,_0x599423,_0x1d0199){return new BPromise(function(_0x558a37,_0x127b2f){return client['request'](_0x41b0c3,_0x1d0199)[_0x11c0('0xa')](function(_0x5578e8){logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');logger[_0x11c0('0xc')](_0x11c0('0xd'),_0x599423,_0x11c0('0xe'),JSON[_0x11c0('0xf')](_0x5578e8));if(_0x5578e8[_0x11c0('0x10')]){if(_0x5578e8['error'][_0x11c0('0x11')]===0x1f4){logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')]['message']);return _0x127b2f(_0x5578e8['error'][_0x11c0('0x12')]);}logger[_0x11c0('0x10')](_0x11c0('0xb'),_0x599423,_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);return _0x558a37(_0x5578e8[_0x11c0('0x10')][_0x11c0('0x12')]);}else{logger['info'](_0x11c0('0xb'),_0x599423,'request\x20sent');_0x558a37(_0x5578e8[_0x11c0('0x13')]['message']);}})[_0x11c0('0x14')](function(_0x45131a){logger[_0x11c0('0x10')]('SmsApplication,\x20%s,\x20%s',_0x599423,_0x45131a);_0x127b2f(_0x45131a);});});} \ No newline at end of file +var _0xe1d7=['stringify','error','code','message','result','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s'];(function(_0x1e8934,_0x2f41b3){var _0x4bb2c5=function(_0x4e4944){while(--_0x4e4944){_0x1e8934['push'](_0x1e8934['shift']());}};_0x4bb2c5(++_0x2f41b3);}(_0xe1d7,0x1a9));var _0x7e1d=function(_0x5a5ffb,_0x3aaf44){_0x5a5ffb=_0x5a5ffb-0x0;var _0x12d821=_0xe1d7[_0x5a5ffb];return _0x12d821;};'use strict';var _=require('lodash');var util=require(_0x7e1d('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7e1d('0x1'));var db=require(_0x7e1d('0x2'))['db'];var utils=require(_0x7e1d('0x3'));var logger=require('../../config/logger')(_0x7e1d('0x4'));var config=require(_0x7e1d('0x5'));var jayson=require(_0x7e1d('0x6'));var client=jayson[_0x7e1d('0x7')][_0x7e1d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x491c61,_0x2f7577,_0x2c3efa){return new BPromise(function(_0x4ba560,_0x38eafe){return client[_0x7e1d('0x9')](_0x491c61,_0x2c3efa)['then'](function(_0x538aa1){logger[_0x7e1d('0xa')](_0x7e1d('0xb'),_0x2f7577,_0x7e1d('0xc'));logger[_0x7e1d('0xd')](_0x7e1d('0xe'),_0x2f7577,_0x7e1d('0xc'),JSON[_0x7e1d('0xf')](_0x538aa1));if(_0x538aa1['error']){if(_0x538aa1[_0x7e1d('0x10')][_0x7e1d('0x11')]===0x1f4){logger[_0x7e1d('0x10')](_0x7e1d('0xb'),_0x2f7577,_0x538aa1['error'][_0x7e1d('0x12')]);return _0x38eafe(_0x538aa1[_0x7e1d('0x10')][_0x7e1d('0x12')]);}logger['error'](_0x7e1d('0xb'),_0x2f7577,_0x538aa1[_0x7e1d('0x10')]['message']);return _0x4ba560(_0x538aa1['error'][_0x7e1d('0x12')]);}else{logger[_0x7e1d('0xa')](_0x7e1d('0xb'),_0x2f7577,'request\x20sent');_0x4ba560(_0x538aa1[_0x7e1d('0x13')][_0x7e1d('0x12')]);}})['catch'](function(_0xa97c68){logger[_0x7e1d('0x10')](_0x7e1d('0xb'),_0x2f7577,_0xa97c68);_0x38eafe(_0xa97c68);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c947605..1715718 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 _0xefda=['../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','index','/describe','isAuthenticated','/:id','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','sms','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','removeTags','exports','multer','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x2292cd,_0x1b1b99){var _0x596a84=function(_0x41935e){while(--_0x41935e){_0x2292cd['push'](_0x2292cd['shift']());}};_0x596a84(++_0x1b1b99);}(_0xefda,0x96));var _0xaefd=function(_0x3eefc4,_0x13da29){_0x3eefc4=_0x3eefc4-0x0;var _0x390870=_0xefda[_0x3eefc4];return _0x390870;};'use strict';var multer=require(_0xaefd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaefd('0x1'));var express=require(_0xaefd('0x2'));var router=express['Router']();var fs_extra=require(_0xaefd('0x3'));var auth=require(_0xaefd('0x4'));var interaction=require(_0xaefd('0x5'));var config=require(_0xaefd('0x6'));var controller=require(_0xaefd('0x7'));router[_0xaefd('0x8')]('/',auth['isAuthenticated'](),controller[_0xaefd('0x9')]);router[_0xaefd('0x8')](_0xaefd('0xa'),auth[_0xaefd('0xb')](),controller['describe']);router[_0xaefd('0x8')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),controller['show']);router['get']('/:id/messages',auth[_0xaefd('0xb')](),controller[_0xaefd('0xd')]);router[_0xaefd('0x8')](_0xaefd('0xe'),auth[_0xaefd('0xb')](),controller[_0xaefd('0xf')]);router[_0xaefd('0x10')]('/',auth[_0xaefd('0xb')](),controller[_0xaefd('0x11')]);router[_0xaefd('0x10')](_0xaefd('0x12'),auth['isAuthenticated'](),controller[_0xaefd('0x13')]);router['post'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),'smsinteraction:addtags'),controller[_0xaefd('0x17')]);router[_0xaefd('0x18')](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x19')),controller[_0xaefd('0x1a')]);router['delete'](_0xaefd('0xc'),auth[_0xaefd('0xb')](),interaction[_0xaefd('0x15')](_0xaefd('0x16'),_0xaefd('0x1b')),controller[_0xaefd('0x1c')]);router['delete'](_0xaefd('0x14'),auth[_0xaefd('0xb')](),controller[_0xaefd('0x1d')]);module[_0xaefd('0x1e')]=router; \ No newline at end of file +var _0x0972=['tracked','sms','addTags','put','update','delete','smsinteraction:destroy','destroy','removeTags','exports','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags'];(function(_0x196427,_0x359c1f){var _0x3e07bf=function(_0x2ee4e8){while(--_0x2ee4e8){_0x196427['push'](_0x196427['shift']());}};_0x3e07bf(++_0x359c1f);}(_0x0972,0x64));var _0x2097=function(_0x3968b0,_0x2b73f4){_0x3968b0=_0x3968b0-0x0;var _0x257a57=_0x0972[_0x3968b0];return _0x257a57;};'use strict';var multer=require('multer');var util=require(_0x2097('0x0'));var path=require('path');var timeout=require(_0x2097('0x1'));var express=require('express');var router=express[_0x2097('0x2')]();var fs_extra=require(_0x2097('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x2097('0x4'));var config=require(_0x2097('0x5'));var controller=require(_0x2097('0x6'));router[_0x2097('0x7')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x9')]);router[_0x2097('0x7')]('/describe',auth[_0x2097('0x8')](),controller[_0x2097('0xa')]);router[_0x2097('0x7')](_0x2097('0xb'),auth[_0x2097('0x8')](),controller['show']);router[_0x2097('0x7')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0xd')]);router[_0x2097('0x7')](_0x2097('0xe'),auth[_0x2097('0x8')](),controller[_0x2097('0xf')]);router[_0x2097('0x10')]('/',auth[_0x2097('0x8')](),controller[_0x2097('0x11')]);router[_0x2097('0x10')](_0x2097('0xc'),auth[_0x2097('0x8')](),controller[_0x2097('0x12')]);router[_0x2097('0x10')](_0x2097('0x13'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')](_0x2097('0x15'),'smsinteraction:addtags'),controller[_0x2097('0x16')]);router[_0x2097('0x17')]('/:id',auth['isAuthenticated'](),interaction['tracked'](_0x2097('0x15'),'smsinteraction:update'),controller[_0x2097('0x18')]);router[_0x2097('0x19')](_0x2097('0xb'),auth[_0x2097('0x8')](),interaction[_0x2097('0x14')]('sms',_0x2097('0x1a')),controller[_0x2097('0x1b')]);router[_0x2097('0x19')](_0x2097('0x13'),auth[_0x2097('0x8')](),controller[_0x2097('0x1c')]);module[_0x2097('0x1d')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index ece3701..a048b2c 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 _0xb4c7=['out','ENUM','sequelize','moment','exports','BOOLEAN','DATE','STRING'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4b7e96,_0x483aa5){_0x4b7e96=_0x4b7e96-0x0;var _0x31e3ca=_0xb4c7[_0x4b7e96];return _0x31e3ca;};'use strict';var Sequelize=require(_0x7b4c('0x0'));var moment=require(_0x7b4c('0x1'));module[_0x7b4c('0x2')]={'closed':{'type':Sequelize[_0x7b4c('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x7b4c('0x4')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x7b4c('0x5')]},'thirdDisposition':{'type':Sequelize[_0x7b4c('0x5')]},'note':{'type':Sequelize[_0x7b4c('0x5')]},'phone':{'type':Sequelize[_0x7b4c('0x5')]},'read1stAt':{'type':Sequelize[_0x7b4c('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x7b4c('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x7b4c('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x7b4c('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x7b4c('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3cd8=['sequelize','moment','exports','BOOLEAN','DATE','STRING','ENUM','out'];(function(_0xa59efb,_0x34f859){var _0x5851f0=function(_0x3e2854){while(--_0x3e2854){_0xa59efb['push'](_0xa59efb['shift']());}};_0x5851f0(++_0x34f859);}(_0x3cd8,0x150));var _0x83cd=function(_0x71b765,_0x3053f8){_0x71b765=_0x71b765-0x0;var _0x34cb24=_0x3cd8[_0x71b765];return _0x34cb24;};'use strict';var Sequelize=require(_0x83cd('0x0'));var moment=require(_0x83cd('0x1'));module[_0x83cd('0x2')]={'closed':{'type':Sequelize[_0x83cd('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x83cd('0x4')]},'disposition':{'type':Sequelize[_0x83cd('0x5')]},'secondDisposition':{'type':Sequelize[_0x83cd('0x5')]},'thirdDisposition':{'type':Sequelize[_0x83cd('0x5')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x83cd('0x5')]},'read1stAt':{'type':Sequelize[_0x83cd('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x83cd('0x6')]('in',_0x83cd('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x83cd('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x83cd('0x6')]('in',_0x83cd('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x83cd('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 b37c971..f52861e 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 _0x57a4=['expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','Contact','$substring','value','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','some','i.SmsAccountId\x20IN\x20?','$gte','parse','$lte','where','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','i.SmsAccountId\x20IS\x20NULL','agent','SmsAccountId','sequelize','toString','keyBy','merge','SmsInteraction','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','contactName','i.*','Contact.firstName','c.lastName','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','params','includeAll','include','options','create','update','describe','addMessage','omit','ids','getMessages','SmsMessage','pick','SmsInteractionId','findAll','spread','color','smsInteractionTags:save','removeTags','unix','join','server','files','tmp','attachments','format','transcript-%d-%s.zip','CmContact','firstName','Messages','secret','SmsAccount','Account','mkdirSync','Sms','Owner','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closedAt','disposition','direction','out','System','lastName','renderFile','views','downloadInteraction.ejs','.pdf','log','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','end','name','send','Users','map','fullname','TagIds','Tags','split','push','catch','waiting','talking','total','closed','UserId','answered','index','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','select','field','from','tools_tags','u.id','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','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','t.id\x20=\x20it.TagId'];(function(_0x4ba2d2,_0x9f2ef){var _0x179cc9=function(_0x89e18f){while(--_0x89e18f){_0x4ba2d2['push'](_0x4ba2d2['shift']());}};_0x179cc9(++_0x9f2ef);}(_0x57a4,0x8a));var _0x457a=function(_0x31638e,_0x15a4ed){_0x31638e=_0x31638e-0x0;var _0x4b6aeb=_0x57a4[_0x31638e];return _0x4b6aeb;};'use strict';var emlformat=require(_0x457a('0x0'));var rimraf=require(_0x457a('0x1'));var zipdir=require(_0x457a('0x2'));var jsonpatch=require(_0x457a('0x3'));var rp=require(_0x457a('0x4'));var moment=require(_0x457a('0x5'));var BPromise=require(_0x457a('0x6'));var Mustache=require(_0x457a('0x7'));var util=require('util');var path=require(_0x457a('0x8'));var sox=require(_0x457a('0x9'));var csv=require(_0x457a('0xa'));var ejs=require(_0x457a('0xb'));var fs=require('fs');var fs_extra=require(_0x457a('0xc'));var _=require('lodash');var squel=require(_0x457a('0xd'));var crypto=require(_0x457a('0xe'));var jsforce=require(_0x457a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x457a('0x10'));var Redis=require(_0x457a('0x11'));var authService=require(_0x457a('0x12'));var qs=require(_0x457a('0x13'));var as=require(_0x457a('0x14'));var pdf=require('../../components/export/pdf');var hardwareService=require(_0x457a('0x15'));var logger=require('../../config/logger')(_0x457a('0x16'));var utils=require(_0x457a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x457a('0x18'));var db=require(_0x457a('0x19'))['db'];config[_0x457a('0x1a')]=_['defaults'](config[_0x457a('0x1a')],{'host':_0x457a('0x1b'),'port':0x18eb});var socket=require(_0x457a('0x1c'))(new Redis(config[_0x457a('0x1a')]));require(_0x457a('0x1d'))[_0x457a('0x1e')](socket);function respondWithStatusCode(_0x2e372b,_0x314c34){_0x314c34=_0x314c34||0xcc;return function(_0xda00e8){if(_0xda00e8){return _0x2e372b[_0x457a('0x1f')](_0x314c34);}return _0x2e372b[_0x457a('0x20')](_0x314c34)['end']();};}function respondWithResult(_0x344bd2,_0x25b81d){_0x25b81d=_0x25b81d||0xc8;return function(_0x4a4cd2){if(_0x4a4cd2){return _0x344bd2['status'](_0x25b81d)[_0x457a('0x21')](_0x4a4cd2);}};}function respondWithFilteredResult(_0x2aba42,_0x1aff73){return function(_0x475711){if(_0x475711){var _0x206c45=typeof _0x1aff73[_0x457a('0x22')]===_0x457a('0x23')&&typeof _0x1aff73[_0x457a('0x24')]===_0x457a('0x23');var _0x5c5308=_0x475711['count'];var _0x39d6ba=_0x206c45?0x0:_0x1aff73[_0x457a('0x22')];var _0x8e401d=_0x206c45?_0x475711[_0x457a('0x25')]:_0x1aff73['offset']+_0x1aff73[_0x457a('0x24')];var _0x409f5b;if(_0x8e401d>=_0x5c5308){_0x8e401d=_0x5c5308;_0x409f5b=0xc8;}else{_0x409f5b=0xce;}_0x2aba42['status'](_0x409f5b);return _0x2aba42[_0x457a('0x26')](_0x457a('0x27'),_0x39d6ba+'-'+_0x8e401d+'/'+_0x5c5308)[_0x457a('0x21')](_0x475711);}return null;};}function patchUpdates(_0x1367ed){return function(_0x45041a){try{jsonpatch[_0x457a('0x28')](_0x45041a,_0x1367ed,!![]);}catch(_0x373152){return BPromise[_0x457a('0x29')](_0x373152);}return _0x45041a[_0x457a('0x2a')]();};}function saveUpdates(_0x3b875b,_0xf6f486){return function(_0x439bca){if(_0x439bca){return _0x439bca['update'](_0x3b875b)[_0x457a('0x2b')](function(_0x3122f7){return _0x3122f7;});}return null;};}function removeEntity(_0x121699,_0x1483b1){return function(_0x5dc3ce){if(_0x5dc3ce){return _0x5dc3ce[_0x457a('0x2c')]()[_0x457a('0x2b')](function(){_0x121699['status'](0xcc)[_0x457a('0x2d')]();});}};}function handleEntityNotFound(_0x200ddb,_0x204050){return function(_0x19f0be){if(!_0x19f0be){_0x200ddb[_0x457a('0x1f')](0x194);}return _0x19f0be;};}function handleError(_0x1cffc3,_0xc0c5b){_0xc0c5b=_0xc0c5b||0x1f4;return function(_0x5905d2){logger['error'](_0x5905d2['stack']);if(_0x5905d2[_0x457a('0x2e')]){delete _0x5905d2[_0x457a('0x2e')];}_0x1cffc3[_0x457a('0x20')](_0xc0c5b)[_0x457a('0x2f')](_0x5905d2);};}function getInteractionUsers(_0x5758c5,_0x2131ef){return new BPromise(function(_0x24afec,_0x1b3772){try{if(_0x2131ef[_0x5758c5['id']]){_0x5758c5[_0x457a('0x30')]=_[_0x457a('0x31')](_0x2131ef[_0x5758c5['id']],function(_0x1e0d42){return{'id':_0x1e0d42['id'],'fullname':_0x1e0d42[_0x457a('0x32')]};});}}catch(_0x3323b3){_0x1b3772(_0x3323b3);}_0x24afec(_0x5758c5);});}function getInteractionTags(_0x44b716,_0x4840c7){return new BPromise(function(_0x430dca,_0x535282){try{if(_0x44b716[_0x457a('0x33')]){_0x44b716[_0x457a('0x34')]=[];_0x44b716[_0x457a('0x33')][_0x457a('0x35')](',')['forEach'](function(_0x49878f){_0x44b716[_0x457a('0x34')][_0x457a('0x36')](_0x4840c7[_0x49878f]);});}delete _0x44b716[_0x457a('0x33')];}catch(_0xb30734){_0x535282(_0xb30734);}_0x430dca(_0x44b716);});}function updateSmsInteraction(_0xccc418,_0x263db0,_0x3255c7){return new BPromise(function(_0x4b1de1,_0x6971d2){return getInteractionUsers(_0xccc418,_0x3255c7)[_0x457a('0x2b')](function(_0x3f8fd5){return getInteractionTags(_0x3f8fd5,_0x263db0);})[_0x457a('0x2b')](function(_0x357321){return getStateInteraction(_0x357321);})['then'](function(_0x210771){_0x4b1de1(_0x210771);})[_0x457a('0x37')](function(_0x4d58c1){_0x6971d2(_0x4d58c1);});});}function getStateInteraction(_0x7da17a){return new BPromise(function(_0x1cdd20){_0x7da17a[_0x457a('0x38')]=0x0;_0x7da17a[_0x457a('0x39')]=0x0;_0x7da17a['answered']=0x0;_0x7da17a['unmanaged']=0x0;_0x7da17a[_0x457a('0x3a')]=0x0;if(!_0x7da17a[_0x457a('0x3b')]&&!_0x7da17a[_0x457a('0x3c')]){_0x7da17a[_0x457a('0x38')]+=0x1;}if(!_0x7da17a['closed']&&_0x7da17a[_0x457a('0x3c')]){_0x7da17a[_0x457a('0x39')]+=0x1;if(_0x7da17a[_0x457a('0x38')]){_0x7da17a[_0x457a('0x38')]-=0x1;}}if(_0x7da17a[_0x457a('0x3b')]&&_0x7da17a[_0x457a('0x3c')]){_0x7da17a[_0x457a('0x3d')]+=0x1;if(_0x7da17a['talking']){_0x7da17a[_0x457a('0x39')]-=0x1;}}if(_0x7da17a[_0x457a('0x3b')]&&!_0x7da17a['UserId']){_0x7da17a['unmanaged']+=0x1;if(_0x7da17a[_0x457a('0x38')]){_0x7da17a[_0x457a('0x38')]-=0x1;}}_0x7da17a[_0x457a('0x3a')]+=0x1;_0x1cdd20(_0x7da17a);});}exports[_0x457a('0x3e')]=function(_0x398de0,_0x1bdac6){var _0x38667a={},_0x53cd96={},_0x41f27e={'count':0x0,'rows':[]};var _0x3f4553=_[_0x457a('0x31')](db['SmsInteraction'][_0x457a('0x3f')],function(_0x1e2991){return{'name':_0x1e2991['fieldName'],'type':_0x1e2991[_0x457a('0x40')][_0x457a('0x41')]};});_0x53cd96[_0x457a('0x42')]=_[_0x457a('0x31')](_0x3f4553,_0x457a('0x2e'));_0x53cd96[_0x457a('0x43')]=_[_0x457a('0x44')](_0x398de0[_0x457a('0x43')]);_0x53cd96[_0x457a('0x45')]=_['intersection'](_0x53cd96[_0x457a('0x42')],_0x53cd96[_0x457a('0x43')]);_0x38667a[_0x457a('0x46')]=_[_0x457a('0x47')](_0x53cd96[_0x457a('0x42')],qs[_0x457a('0x48')](_0x398de0[_0x457a('0x43')]['fields']));_0x38667a[_0x457a('0x46')]=_0x38667a['attributes'][_0x457a('0x49')]?_0x38667a['attributes']:_0x53cd96[_0x457a('0x42')];if(!_0x398de0[_0x457a('0x43')][_0x457a('0x4a')](_0x457a('0x4b'))){_0x38667a[_0x457a('0x24')]=qs[_0x457a('0x24')](_0x398de0[_0x457a('0x43')]['limit']);_0x38667a[_0x457a('0x22')]=qs['offset'](_0x398de0[_0x457a('0x43')][_0x457a('0x22')]);}_0x38667a[_0x457a('0x4c')]=qs[_0x457a('0x4d')](_0x398de0[_0x457a('0x43')][_0x457a('0x4d')]);_0x38667a['where']=qs[_0x457a('0x45')](_['pick'](_0x398de0['query'],_0x53cd96[_0x457a('0x45')]),_0x3f4553);var _0x8b1d45=[];var _0xafa729=squel[_0x457a('0x4e')]()[_0x457a('0x4f')]('id')['field']('name')['field']('color')[_0x457a('0x50')](_0x457a('0x51'));var _0x55ab3b=squel[_0x457a('0x4e')]()[_0x457a('0x4f')](_0x457a('0x52'))[_0x457a('0x4f')](_0x457a('0x53'))[_0x457a('0x4f')](_0x457a('0x54'))[_0x457a('0x50')](_0x457a('0x55'),'ui')[_0x457a('0x56')](_0x457a('0x57'),'u',_0x457a('0x58'));var _0x63ab65=squel['select']()[_0x457a('0x50')]('sms_interactions','i')[_0x457a('0x56')]('cm_contacts','c',_0x457a('0x59'))[_0x457a('0x56')](_0x457a('0x57'),'o',_0x457a('0x5a'))[_0x457a('0x56')](_0x457a('0x5b'),'a',_0x457a('0x5c'))[_0x457a('0x56')](_0x457a('0x5d'),'me',_0x457a('0x5e'))[_0x457a('0x56')]('sms_interaction_has_tags','it','it.SmsInteractionId\x20=\x20i.id')['left_join'](_0x457a('0x51'),'t',_0x457a('0x5f'));var _0x5500b8=squel[_0x457a('0x60')]();var _0x98a3ba=[];var _0x619809=squel[_0x457a('0x60')]();var _0x155d70;if(_0x398de0[_0x457a('0x43')][_0x457a('0x61')]){_0x155d70=as[_0x457a('0x62')](_0x398de0['query']['search']);var _0x4d8838=_0x155d70[_0x457a('0x63')];for(var _0x1cfe70=0x0;_0x1cfe70<_0x155d70[_0x457a('0x64')]['length'];_0x1cfe70++){var _0x211018=_0x155d70[_0x457a('0x64')][_0x1cfe70];var _0x2385cc='i';var _0x1fc2b4=_[_0x457a('0x65')](_0x3f4553,['name',_0x211018['field']]);if(!_0x1fc2b4){switch(_0x211018[_0x457a('0x4f')]){case _0x457a('0x66'):if(_0x211018['value']==0x1){_0x63ab65[_0x457a('0x67')]('`'+_0x211018[_0x457a('0x4f')]+_0x457a('0x68'));}else{_0x63ab65[_0x457a('0x67')]('`'+_0x211018['field']+_0x457a('0x69'));}break;case _0x457a('0x6a'):if(_0x211018['operator']===_0x457a('0x6b')){if(_0x211018[_0x457a('0x6c')]['split']('\x20')['length']>0x1){_0x5500b8[_0x4d8838]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x457a('0x6d')](_0x211018[_0x457a('0x6c')]),null);}else{var _0x5d4ac1='%'+_0x211018[_0x457a('0x6c')]+'%';_0x5500b8[_0x4d8838](_0x457a('0x6e'),_0x5d4ac1,_0x5d4ac1,_0x5d4ac1);}}else{_0x1fc2b4=_['find'](_0x3f4553,[_0x457a('0x2e'),_0x457a('0x6f')]);_0x211018['field']=_0x457a('0x6f');_0x47b288=as[_0x457a('0x70')](_0x2385cc,_0x1fc2b4[_0x457a('0x40')],_0x211018);_0x5500b8[_0x4d8838](_0x47b288[_0x457a('0x71')],_0x47b288['value'][_0x457a('0x72')],_0x47b288[_0x457a('0x6c')][_0x457a('0x2d')]);}break;case _0x457a('0x73'):var _0x50e8f4=_0x211018[_0x457a('0x6c')][_0x457a('0x35')](',')[_0x457a('0x31')](function(_0x35883c){return Number(_0x35883c);});_0x50e8f4[_0x457a('0x74')](function(_0x421001){_0x619809['or'](_0x457a('0x75'),'%,'+_0x421001+',%');});_0x98a3ba=_['union'](_0x98a3ba,_0x50e8f4);break;case _0x457a('0x76'):if(_0x211018[_0x457a('0x77')]===_0x457a('0x6b')){_0x5500b8[_0x4d8838](_0x457a('0x78'),'%'+_0x211018['value']+'%',null);}else{_0x1fc2b4=_[_0x457a('0x65')](_0x3f4553,[_0x457a('0x2e'),_0x457a('0x3c')]);_0x211018[_0x457a('0x4f')]=_0x457a('0x3c');_0x47b288=as['buildExpression'](_0x2385cc,_0x1fc2b4[_0x457a('0x40')],_0x211018);_0x5500b8[_0x4d8838](_0x47b288[_0x457a('0x71')],_0x47b288[_0x457a('0x6c')][_0x457a('0x72')],_0x47b288[_0x457a('0x6c')][_0x457a('0x2d')]);}break;case _0x457a('0x79'):_0x47b288=as['buildExpression']('me',null,_0x211018);_0x5500b8[_0x4d8838](_0x47b288[_0x457a('0x71')],_0x47b288[_0x457a('0x6c')]['start'],_0x47b288[_0x457a('0x6c')][_0x457a('0x2d')]);break;}}else{var _0x47b288=as[_0x457a('0x70')](_0x2385cc,_0x1fc2b4[_0x457a('0x40')],_0x211018);_0x5500b8[_0x4d8838](_0x47b288['text'],_0x47b288[_0x457a('0x6c')]['start'],_0x47b288[_0x457a('0x6c')][_0x457a('0x2d')]);}}}else{var _0x56fe1d=_(_0x398de0['query'])[_0x457a('0x44')]()[_0x457a('0x31')](function(_0x48cb92){return _[_0x457a('0x7a')](_0x3f4553,[_0x457a('0x2e'),_0x48cb92])?_0x48cb92:undefined;})['compact']()[_0x457a('0x6c')]();if(!_['isEmpty'](_0x56fe1d)){_0x56fe1d['forEach'](function(_0x43d55b){if(_0x43d55b==='SmsAccountId'){_0x63ab65['where'](_0x457a('0x7b'),[]['concat'](_0x398de0['query'][_0x43d55b]));}else if(_0x43d55b==='createdAt'){var _0x2a4a7e=JSON['parse'](_0x398de0[_0x457a('0x43')][_0x43d55b])[_0x457a('0x7c')];var _0x1a4fbc=JSON[_0x457a('0x7d')](_0x398de0[_0x457a('0x43')][_0x43d55b])[_0x457a('0x7e')];_0x63ab65[_0x457a('0x7f')](_0x457a('0x80'),_0x2a4a7e,_0x1a4fbc);}else{if(_0x398de0[_0x457a('0x43')][_0x43d55b]===_0x457a('0x81')){_0x63ab65[_0x457a('0x7f')]('i.'+_0x43d55b+_0x457a('0x82'));}else{_0x63ab65[_0x457a('0x7f')]('i.'+_0x43d55b+_0x457a('0x83'),_0x398de0['query'][_0x43d55b]);}}});}if(_0x398de0[_0x457a('0x43')]['read']){if(_0x398de0[_0x457a('0x43')][_0x457a('0x84')]==0x1){_0x63ab65['having'](_0x457a('0x85'));}else{_0x63ab65[_0x457a('0x67')](_0x457a('0x86'));}}if(_0x398de0[_0x457a('0x43')]['tag']){_0x98a3ba=_[_0x457a('0x87')](_0x398de0['query'][_0x457a('0x88')])?_0x398de0[_0x457a('0x43')][_0x457a('0x88')]:new Array(_0x398de0[_0x457a('0x43')][_0x457a('0x88')]);_0x98a3ba[_0x457a('0x74')](function(_0x2bfcdb){_0x619809['or'](_0x457a('0x75'),'%,'+_0x2bfcdb+',%');});}if(_0x398de0[_0x457a('0x43')][_0x457a('0x89')]){var _0x53eb7a=_0x398de0[_0x457a('0x43')][_0x457a('0x89')][_0x457a('0x8a')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x53eb7a)){_0x5500b8['or']('i.id\x20LIKE\x20?',_0x53eb7a+'%')['or'](_0x457a('0x8b'),_0x53eb7a+'%');}else{_0x5500b8['or'](_0x457a('0x8c'),qs['getFullTextValue'](_0x53eb7a))['or'](_0x457a('0x8d'),_0x53eb7a+'%');}}}_0x63ab65['where'](_0x5500b8);_0x63ab65[_0x457a('0x8e')](_0x457a('0x8f'));var _0x487194={'type':db[_0x457a('0x90')]['QueryTypes'][_0x457a('0x91')],'raw':!![]};var _0x3f3052=_0x63ab65[_0x457a('0x92')]();_0x3f3052[_0x457a('0x4f')]('i.id');_0x3f3052[_0x457a('0x4f')](_0x457a('0x93'),'unreadMessages');if(_0x38667a[_0x457a('0x4c')]){_0x38667a['order'][_0x457a('0x74')](function(_0xa5eb57){var _0x1b8895=_0xa5eb57[0x0]==='contactName'?_0xa5eb57[0x0]:'i.'+_0xa5eb57[0x0];_0x63ab65[_0x457a('0x4c')](_0x1b8895,_0xa5eb57[0x1]===_0x457a('0x94')?![]:!![]);});}if(!_['isEmpty'](_0x98a3ba)){_0x63ab65[_0x457a('0x67')](_0x619809);_0x3f3052[_0x457a('0x7f')](_0x457a('0x95'),_0x98a3ba);}BPromise[_0x457a('0x96')]()[_0x457a('0x2b')](function(){if(!_0x155d70){if(_0x398de0['query']['SmsAccountId'])return;_0x3f3052[_0x457a('0x7f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x63ab65[_0x457a('0x7f')](_0x457a('0x97'));return;}if(_0x398de0[_0x457a('0x98')][_0x457a('0x99')]!=='agent')return;return _0x398de0[_0x457a('0x98')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x457a('0x2b')](function(_0x50e3c1){if(_['isEmpty'](_0x50e3c1)){_0x3f3052[_0x457a('0x7f')]('i.SmsAccountId\x20IS\x20NULL');_0x63ab65[_0x457a('0x7f')](_0x457a('0x9a'));}else{_0x3f3052[_0x457a('0x7f')]('i.SmsAccountId\x20IN\x20?',_[_0x457a('0x31')](_0x50e3c1,'id'));_0x63ab65['where'](_0x457a('0x7b'),_[_0x457a('0x31')](_0x50e3c1,'id'));}});})[_0x457a('0x2b')](function(){if(_0x398de0['user'][_0x457a('0x99')]===_0x457a('0x9b')&&!_0x155d70&&!_0x398de0[_0x457a('0x43')][_0x457a('0x9c')])return[];return db[_0x457a('0x9d')][_0x457a('0x43')](_0x3f3052[_0x457a('0x9e')](),_0x487194);})[_0x457a('0x2b')](function(_0x45f430){_0x41f27e[_0x457a('0x25')]=_0x45f430[_0x457a('0x49')];if(_0x41f27e[_0x457a('0x25')]===0x0)return[];return db[_0x457a('0x9d')]['query'](_0xafa729['toString'](),_0x487194)['then'](function(_0x4be750){_0x8b1d45=_[_0x457a('0x9f')](_0x4be750,'id');_0x487194=_[_0x457a('0xa0')](_0x487194,{'model':db[_0x457a('0xa1')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x398de0[_0x457a('0x43')][_0x457a('0x48')]){_0x38667a[_0x457a('0x46')][_0x457a('0x74')](function(_0x3dd193){_0x63ab65[_0x457a('0x4f')]('i.'+_0x3dd193);});}else{_0x63ab65[_0x457a('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x63ab65[_0x457a('0x4f')]('a.key',_0x457a('0xa2'));_0x63ab65[_0x457a('0x4f')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x63ab65[_0x457a('0x4f')](_0x457a('0xa3'),_0x457a('0xa4'));_0x63ab65['field'](_0x457a('0xa5'));_0x63ab65['field']('c.firstName',_0x457a('0xa6'));_0x63ab65['field'](_0x457a('0xa7'),'Contact.lastName');_0x63ab65[_0x457a('0x4f')]('c.email',_0x457a('0xa8'));_0x63ab65['field']('c.phone',_0x457a('0xa9'));_0x63ab65[_0x457a('0x4f')](_0x457a('0xaa'),_0x457a('0xab'));_0x63ab65[_0x457a('0x4f')](_0x457a('0xac'),_0x457a('0xad'));_0x63ab65['field'](_0x457a('0xae'),_0x457a('0xaf'));_0x63ab65[_0x457a('0x4f')](_0x457a('0xb0'),'Owner.internal');_0x63ab65[_0x457a('0x4f')](_0x457a('0xb1'),_0x457a('0x33'));}if(_0x38667a['limit'])_0x63ab65['limit'](_0x38667a['limit']);if(_0x38667a['offset'])_0x63ab65[_0x457a('0x22')](_0x38667a[_0x457a('0x22')]);return db[_0x457a('0x9d')]['query'](_0x63ab65[_0x457a('0x9e')](),_0x487194);})['then'](function(_0x32728a){if(_0x32728a[_0x457a('0x49')]>0x0)_0x55ab3b['where'](_0x457a('0xb2'),_[_0x457a('0x31')](_0x32728a,'id'));return db['sequelize'][_0x457a('0x43')](_0x55ab3b[_0x457a('0x9e')](),_0x487194)[_0x457a('0x2b')](function(_0x345d82){var _0x2d79c1=_[_0x457a('0xb3')](_0x345d82,'SmsInteractionId');var _0x5a71ac=[];_0x32728a['forEach'](function(_0x4d5108){_0x5a71ac[_0x457a('0x36')](updateSmsInteraction(_0x4d5108,_0x8b1d45,_0x2d79c1));});return BPromise[_0x457a('0xb4')](_0x5a71ac);});});})[_0x457a('0x2b')](function(_0x4bb71c){_0x41f27e[_0x457a('0xb5')]=_0x4bb71c;return _0x41f27e;})[_0x457a('0x2b')](respondWithFilteredResult(_0x1bdac6,_0x38667a))['catch'](handleError(_0x1bdac6,null));};exports[_0x457a('0xb6')]=function(_0x43d054,_0x2ec32c){var _0x28e134={'raw':![],'where':{'id':_0x43d054[_0x457a('0xb7')]['id']}},_0x4fb69b={};_0x4fb69b[_0x457a('0x42')]=_[_0x457a('0x44')](db[_0x457a('0xa1')][_0x457a('0x3f')]);_0x4fb69b[_0x457a('0x43')]=_[_0x457a('0x44')](_0x43d054['query']);_0x4fb69b[_0x457a('0x45')]=_[_0x457a('0x47')](_0x4fb69b[_0x457a('0x42')],_0x4fb69b[_0x457a('0x43')]);_0x28e134['attributes']=_[_0x457a('0x47')](_0x4fb69b[_0x457a('0x42')],qs['fields'](_0x43d054[_0x457a('0x43')][_0x457a('0x48')]));_0x28e134['attributes']=_0x28e134[_0x457a('0x46')]['length']?_0x28e134[_0x457a('0x46')]:_0x4fb69b[_0x457a('0x42')];if(_0x43d054[_0x457a('0x43')][_0x457a('0xb8')]){_0x28e134[_0x457a('0xb9')]=[{'all':!![]}];}_0x28e134=_[_0x457a('0xa0')]({},_0x28e134,_0x43d054[_0x457a('0xba')]);return db[_0x457a('0xa1')][_0x457a('0x65')](_0x28e134)[_0x457a('0x2b')](handleEntityNotFound(_0x2ec32c,null))[_0x457a('0x2b')](respondWithResult(_0x2ec32c,null))['catch'](handleError(_0x2ec32c,null));};exports[_0x457a('0xbb')]=function(_0x4b7671,_0x56ad20){return db['SmsInteraction'][_0x457a('0xbb')](_0x4b7671[_0x457a('0x79')],{})[_0x457a('0x2b')](respondWithResult(_0x56ad20,0xc9))['catch'](handleError(_0x56ad20,null));};exports[_0x457a('0xbc')]=function(_0x141d3a,_0x58197e){if(_0x141d3a[_0x457a('0x79')]['id']){delete _0x141d3a[_0x457a('0x79')]['id'];}return db[_0x457a('0xa1')][_0x457a('0x65')]({'where':{'id':_0x141d3a[_0x457a('0xb7')]['id']}})[_0x457a('0x2b')](handleEntityNotFound(_0x58197e,null))[_0x457a('0x2b')](saveUpdates(_0x141d3a[_0x457a('0x79')],null))[_0x457a('0x2b')](respondWithResult(_0x58197e,null))[_0x457a('0x37')](handleError(_0x58197e,null));};exports[_0x457a('0x2c')]=function(_0x396424,_0x301c91){return db[_0x457a('0xa1')][_0x457a('0x65')]({'where':{'id':_0x396424['params']['id']}})[_0x457a('0x2b')](handleEntityNotFound(_0x301c91,null))[_0x457a('0x2b')](removeEntity(_0x301c91,null))[_0x457a('0x37')](handleError(_0x301c91,null));};exports['describe']=function(_0x28a66b,_0x542163){return db[_0x457a('0xa1')][_0x457a('0xbd')]()[_0x457a('0x2b')](respondWithResult(_0x542163,null))[_0x457a('0x37')](handleError(_0x542163,null));};exports['addMessage']=function(_0x25d314,_0x9158d,_0x52d962){return db['SmsMessage'][_0x457a('0x65')]({'where':{'id':_0x25d314['params']['id']}})['then'](handleEntityNotFound(_0x9158d,null))[_0x457a('0x2b')](function(_0x1d4890){if(_0x1d4890){return _0x1d4890[_0x457a('0xbe')](_0x25d314[_0x457a('0x79')]['ids'],_[_0x457a('0xbf')](_0x25d314[_0x457a('0x79')],[_0x457a('0xc0'),'id'])||{});}})[_0x457a('0x2b')](respondWithResult(_0x9158d,null))['catch'](handleError(_0x9158d,null));};exports[_0x457a('0xc1')]=function(_0x31aab3,_0x216714,_0xbc898b){var _0x45ab4b={'raw':![],'where':{}};var _0x3cdf08={};var _0xc40f84={'count':0x0,'rows':[]};return db[_0x457a('0xa1')]['findOne']({'where':{'id':_0x31aab3['params']['id']}})[_0x457a('0x2b')](handleEntityNotFound(_0x216714,null))[_0x457a('0x2b')](function(_0x3fbc97){if(_0x3fbc97){_0x3cdf08[_0x457a('0x42')]=_[_0x457a('0x44')](db[_0x457a('0xc2')][_0x457a('0x3f')]);_0x3cdf08[_0x457a('0x43')]=_[_0x457a('0x44')](_0x31aab3[_0x457a('0x43')]);_0x3cdf08['filters']=_[_0x457a('0x47')](_0x3cdf08[_0x457a('0x42')],_0x3cdf08['query']);_0x45ab4b['attributes']=_[_0x457a('0x47')](_0x3cdf08[_0x457a('0x42')],qs[_0x457a('0x48')](_0x31aab3[_0x457a('0x43')][_0x457a('0x48')]));_0x45ab4b[_0x457a('0x46')]=_0x45ab4b[_0x457a('0x46')]['length']?_0x45ab4b[_0x457a('0x46')]:_0x3cdf08[_0x457a('0x42')];if(!_0x31aab3[_0x457a('0x43')][_0x457a('0x4a')](_0x457a('0x4b'))){_0x45ab4b['limit']=qs[_0x457a('0x24')](_0x31aab3[_0x457a('0x43')][_0x457a('0x24')]);_0x45ab4b[_0x457a('0x22')]=qs[_0x457a('0x22')](_0x31aab3['query'][_0x457a('0x22')]);}_0x45ab4b[_0x457a('0x4c')]=qs[_0x457a('0x4d')](_0x31aab3['query'][_0x457a('0x4d')]);_0x45ab4b[_0x457a('0x7f')]=qs[_0x457a('0x45')](_[_0x457a('0xc3')](_0x31aab3[_0x457a('0x43')],_0x3cdf08[_0x457a('0x45')]));_0x45ab4b['where'][_0x457a('0xc4')]=_0x3fbc97['id'];if(_0x31aab3['query'][_0x457a('0x89')]){_0x45ab4b[_0x457a('0x7f')]=_[_0x457a('0xa0')](_0x45ab4b['where'],{'$or':_[_0x457a('0x31')](_0x45ab4b['attributes'],function(_0xe0a25a){var _0x106563={};_0x106563[_0xe0a25a]={'$like':'%'+_0x31aab3[_0x457a('0x43')]['filter']+'%'};return _0x106563;})});}if(_0x31aab3[_0x457a('0x43')][_0x457a('0x7c')]){var _0x134036=_0x31aab3[_0x457a('0x43')]['$gte']['split'](',');var _0x1b1b1d={};_0x1b1b1d[_0x134036[0x0]]={'$gte':moment(_0x134036[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x45ab4b[_0x457a('0x7f')]=_['merge'](_0x45ab4b[_0x457a('0x7f')],_0x1b1b1d);}_0x45ab4b=_['merge']({},_0x45ab4b,_0x31aab3[_0x457a('0xba')]);return db[_0x457a('0xc2')][_0x457a('0x25')]({'where':_0x45ab4b[_0x457a('0x7f')]})[_0x457a('0x2b')](function(_0x4aa5d7){_0xc40f84['count']=_0x4aa5d7;if(_0x31aab3[_0x457a('0x43')][_0x457a('0xb8')]){_0x45ab4b[_0x457a('0xb9')]=[{'all':!![]}];}return db[_0x457a('0xc2')][_0x457a('0xc5')](_0x45ab4b);})[_0x457a('0x2b')](function(_0x70edb2){_0xc40f84[_0x457a('0xb5')]=_0x70edb2;return _0xc40f84;});}})['then'](respondWithFilteredResult(_0x216714,_0x45ab4b))[_0x457a('0x37')](handleError(_0x216714,null));};exports['addTags']=function(_0x98d580,_0x22d8ac,_0x4c6cf9){return db[_0x457a('0xa1')]['find']({'where':{'id':_0x98d580[_0x457a('0xb7')]['id']}})[_0x457a('0x2b')](handleEntityNotFound(_0x22d8ac,null))[_0x457a('0x2b')](function(_0x3bf304){if(_0x3bf304){return _0x3bf304['setTags'](_0x98d580['body'][_0x457a('0xc0')],_['omit'](_0x98d580[_0x457a('0x79')],[_0x457a('0xc0'),'id'])||{})[_0x457a('0xc6')](function(){return db[_0x457a('0x73')][_0x457a('0xc5')]({'attributes':['id',_0x457a('0x2e'),_0x457a('0xc7')],'where':{'id':_0x98d580[_0x457a('0x79')]['ids']}});})[_0x457a('0x2b')](function(_0x4634ff){socket['emit'](_0x457a('0xc8'),{'id':Number(_0x98d580[_0x457a('0xb7')]['id']),'tags':_0x4634ff||[]});return{'id':Number(_0x98d580['params']['id']),'tags':_0x4634ff||[]};});}})[_0x457a('0x2b')](respondWithResult(_0x22d8ac,null))[_0x457a('0x37')](handleError(_0x22d8ac,null));};exports[_0x457a('0xc9')]=function(_0x442f2a,_0x993a73,_0xc42d81){return db[_0x457a('0xa1')][_0x457a('0x65')]({'where':{'id':_0x442f2a[_0x457a('0xb7')]['id']}})['then'](handleEntityNotFound(_0x993a73,null))[_0x457a('0x2b')](function(_0x2c7ef7){if(_0x2c7ef7){return _0x2c7ef7['removeTags'](_0x442f2a[_0x457a('0x43')][_0x457a('0xc0')]);}})[_0x457a('0x2b')](respondWithStatusCode(_0x993a73,null))[_0x457a('0x37')](handleError(_0x993a73,null));};exports['download']=function(_0x44f198,_0x2695df){var _0x1b6699=moment()[_0x457a('0xca')]()[_0x457a('0x9e')]();var _0x5185f3=path[_0x457a('0xcb')](config['root'],_0x457a('0xcc'),_0x457a('0xcd'),_0x457a('0xce'));var _0x25b7a0=path[_0x457a('0xcb')](config['root'],'server',_0x457a('0xcd'),_0x457a('0xcf'));var _0x44a1a4=path['join'](_0x5185f3,_0x1b6699);var _0x12b22e=util[_0x457a('0xd0')](_0x457a('0xd1'),_0x44f198[_0x457a('0xb7')]['id'],_0x1b6699);var _0x4be9ae=path[_0x457a('0xcb')](_0x5185f3,_0x12b22e);var _0x4a6e93=[];_0x4a6e93[_0x457a('0x36')]({'model':db['User'],'as':_0x457a('0x76'),'attributes':['id',_0x457a('0x32')],'raw':!![]});_0x4a6e93[_0x457a('0x36')]({'model':db[_0x457a('0xd2')],'as':_0x457a('0x6a'),'attributes':['id',_0x457a('0xd3'),'lastName'],'raw':!![]});var _0x48a921=[{'model':db[_0x457a('0xc2')],'as':_0x457a('0xd4'),'attributes':['id','body','createdAt','direction',_0x457a('0xd5'),_0x457a('0x84')],'include':_0x4a6e93}];_0x48a921['push']({'model':db[_0x457a('0xd6')],'as':_0x457a('0xd7'),'attributes':['id','name']});_0x48a921[_0x457a('0x36')]({'model':db[_0x457a('0x76')],'as':'Owner','attributes':['id','fullname']});return db[_0x457a('0xa1')][_0x457a('0x65')]({'where':{'id':_0x44f198[_0x457a('0xb7')]['id']},'include':_0x48a921})['then'](handleEntityNotFound(_0x2695df,null))[_0x457a('0x2b')](function(_0x304598){if(_0x304598){var _0x448f2e=_0x304598['get']({'plain':!![]});fs[_0x457a('0xd8')](_0x44a1a4);var _0x5e7bba={'channel':_0x457a('0xd9'),'account':_0x448f2e['Account'][_0x457a('0x2e')],'agent':_0x448f2e[_0x457a('0xda')]?_0x448f2e[_0x457a('0xda')][_0x457a('0x32')]:_0x457a('0xdb'),'createdAt':moment(_0x448f2e[_0x457a('0xdc')])[_0x457a('0xd0')](_0x457a('0xdd'))[_0x457a('0x9e')](),'closedAt':_0x448f2e[_0x457a('0x3b')]?moment(_0x448f2e[_0x457a('0xde')])[_0x457a('0xd0')]('YYYY-MM-DD\x20HH:mm:ss')[_0x457a('0x9e')]():'','disposition':_0x448f2e[_0x457a('0xdf')],'messages':_(_0x448f2e[_0x457a('0xd4')])['filter']({'secret':![]})[_0x457a('0x31')](function(_0x5a740c){return{'date':moment(_0x5a740c[_0x457a('0xdc')])[_0x457a('0xd0')](_0x457a('0xdd'))[_0x457a('0x9e')](),'sender':_0x5a740c[_0x457a('0xe0')]===_0x457a('0xe1')?_0x5a740c[_0x457a('0x76')]?_0x5a740c[_0x457a('0x76')]['fullname']:_0x457a('0xe2'):_0x5a740c[_0x457a('0x6a')][_0x457a('0xd3')]+(_0x5a740c[_0x457a('0x6a')][_0x457a('0xe3')]?'\x20'+_0x5a740c['Contact'][_0x457a('0xe3')]:''),'body':_0x5a740c[_0x457a('0x79')],'direction':_0x5a740c[_0x457a('0xe0')]==='out'?'A':'C','secret':_0x5a740c['secret'],'read':_0x5a740c[_0x457a('0x84')]};})[_0x457a('0x6c')]()};return ejs[_0x457a('0xe4')](path[_0x457a('0xcb')](config['root'],_0x457a('0xcc'),_0x457a('0xe5'),_0x457a('0xe6')),{'interaction':_0x5e7bba})[_0x457a('0x2b')](function(_0x2051dc){var _0x45f0fc=path[_0x457a('0xcb')](_0x44a1a4,'transcript-'+_0x448f2e['id']+'-'+_0x1b6699+_0x457a('0xe7'));var _0x3d3409={'path':_0x45f0fc,'channel':_0x457a('0xd9'),'interactionId':_0x448f2e['id']};return pdf['createPdfFromHTML'](_0x2051dc,_0x3d3409);})[_0x457a('0x2b')](function(){return new BPromise(function(_0x4d2942,_0x29b087){zipdir(_0x44a1a4,{'saveTo':_0x4be9ae},function(_0x304c80,_0x51ef4e){if(_0x304c80)return _0x29b087(_0x304c80);return _0x4d2942(_0x51ef4e);});})[_0x457a('0x2b')](function(){return new BPromise(function(_0x5f4a87,_0x4c9088){rimraf(_0x44a1a4,function(_0x47655f){if(_0x47655f)_0x4c9088(_0x47655f);return _0x5f4a87();});});})['then'](function(){return _0x2695df['download'](_0x4be9ae,_0x12b22e,function(_0x52b167){if(_0x52b167){console[_0x457a('0xe8')]('err',_0x52b167);}else{fs[_0x457a('0xe9')](_0x4be9ae);}});});});}else{return _0x2695df[_0x457a('0x1f')](0xc8);}})[_0x457a('0x37')](handleError(_0x2695df,null));}; \ No newline at end of file +var _0xb616=['sort','where','field','color','tools_tags','select','u.fullname','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','from','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','expr','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','start','some','compact','isEmpty','SmsAccountId','parse','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)','group','i.id','Sequelize','QueryTypes','SELECT','clone','order','contactName','DESC','t.id\x20IN\x20?','role','agent','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SmsInteraction','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','rows','show','includeAll','include','options','body','params','describe','addMessage','omit','ids','findOne','SmsMessage','pick','SmsInteractionId','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','removeTags','join','root','files','tmp','attachments','Contact','firstName','lastName','createdAt','direction','SmsAccount','get','Sms','N.A.','disposition','Messages','out','System','secret','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','./smsInteraction.socket','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','talking','unmanaged','closed','UserId','answered','total','index','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x28e9c4,_0x70bd03){var _0x52d93e=function(_0x4b62e0){while(--_0x4b62e0){_0x28e9c4['push'](_0x28e9c4['shift']());}};_0x52d93e(++_0x70bd03);}(_0xb616,0x9e));var _0x6b61=function(_0xbbbf0d,_0x2318c7){_0xbbbf0d=_0xbbbf0d-0x0;var _0x569a1a=_0xb616[_0xbbbf0d];return _0x569a1a;};'use strict';var emlformat=require(_0x6b61('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6b61('0x1'));var jsonpatch=require(_0x6b61('0x2'));var rp=require('request-promise');var moment=require(_0x6b61('0x3'));var BPromise=require(_0x6b61('0x4'));var Mustache=require(_0x6b61('0x5'));var util=require(_0x6b61('0x6'));var path=require(_0x6b61('0x7'));var sox=require(_0x6b61('0x8'));var csv=require(_0x6b61('0x9'));var ejs=require(_0x6b61('0xa'));var fs=require('fs');var fs_extra=require(_0x6b61('0xb'));var _=require(_0x6b61('0xc'));var squel=require(_0x6b61('0xd'));var crypto=require(_0x6b61('0xe'));var jsforce=require(_0x6b61('0xf'));var deskjs=require(_0x6b61('0x10'));var toCsv=require(_0x6b61('0x9'));var querystring=require(_0x6b61('0x11'));var Papa=require(_0x6b61('0x12'));var Redis=require(_0x6b61('0x13'));var authService=require(_0x6b61('0x14'));var qs=require(_0x6b61('0x15'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x6b61('0x16'));var hardwareService=require(_0x6b61('0x17'));var logger=require(_0x6b61('0x18'))(_0x6b61('0x19'));var utils=require(_0x6b61('0x1a'));var config=require(_0x6b61('0x1b'));var licenseUtil=require(_0x6b61('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b61('0x1d')]));require(_0x6b61('0x1e'))[_0x6b61('0x1f')](socket);function respondWithStatusCode(_0x501c30,_0x26ad67){_0x26ad67=_0x26ad67||0xcc;return function(_0x20655a){if(_0x20655a){return _0x501c30[_0x6b61('0x20')](_0x26ad67);}return _0x501c30['status'](_0x26ad67)[_0x6b61('0x21')]();};}function respondWithResult(_0x1e26aa,_0x1c47dc){_0x1c47dc=_0x1c47dc||0xc8;return function(_0x19036a){if(_0x19036a){return _0x1e26aa[_0x6b61('0x22')](_0x1c47dc)[_0x6b61('0x23')](_0x19036a);}};}function respondWithFilteredResult(_0x31921e,_0x2d2a8d){return function(_0x49e703){if(_0x49e703){var _0x1e99b1=typeof _0x2d2a8d[_0x6b61('0x24')]===_0x6b61('0x25')&&typeof _0x2d2a8d[_0x6b61('0x26')]==='undefined';var _0x3fb884=_0x49e703[_0x6b61('0x27')];var _0x596ba3=_0x1e99b1?0x0:_0x2d2a8d[_0x6b61('0x24')];var _0x78f3ea=_0x1e99b1?_0x49e703[_0x6b61('0x27')]:_0x2d2a8d[_0x6b61('0x24')]+_0x2d2a8d[_0x6b61('0x26')];var _0x2c5444;if(_0x78f3ea>=_0x3fb884){_0x78f3ea=_0x3fb884;_0x2c5444=0xc8;}else{_0x2c5444=0xce;}_0x31921e[_0x6b61('0x22')](_0x2c5444);return _0x31921e[_0x6b61('0x28')](_0x6b61('0x29'),_0x596ba3+'-'+_0x78f3ea+'/'+_0x3fb884)[_0x6b61('0x23')](_0x49e703);}return null;};}function patchUpdates(_0x257e97){return function(_0x2a85cd){try{jsonpatch[_0x6b61('0x2a')](_0x2a85cd,_0x257e97,!![]);}catch(_0x1b4918){return BPromise['reject'](_0x1b4918);}return _0x2a85cd['save']();};}function saveUpdates(_0x46ea27,_0x14fe0a){return function(_0x2b9bdd){if(_0x2b9bdd){return _0x2b9bdd[_0x6b61('0x2b')](_0x46ea27)['then'](function(_0x4b703c){return _0x4b703c;});}return null;};}function removeEntity(_0x35bc82,_0x43e674){return function(_0x23d2fc){if(_0x23d2fc){return _0x23d2fc[_0x6b61('0x2c')]()[_0x6b61('0x2d')](function(){_0x35bc82[_0x6b61('0x22')](0xcc)[_0x6b61('0x21')]();});}};}function handleEntityNotFound(_0x5e9787,_0x1ea729){return function(_0x51dbda){if(!_0x51dbda){_0x5e9787[_0x6b61('0x20')](0x194);}return _0x51dbda;};}function handleError(_0x114d08,_0x4c0d85){_0x4c0d85=_0x4c0d85||0x1f4;return function(_0x1fe2c7){logger[_0x6b61('0x2e')](_0x1fe2c7[_0x6b61('0x2f')]);if(_0x1fe2c7[_0x6b61('0x30')]){delete _0x1fe2c7['name'];}_0x114d08[_0x6b61('0x22')](_0x4c0d85)[_0x6b61('0x31')](_0x1fe2c7);};}function getInteractionUsers(_0x33246c,_0x76f8b7){return new BPromise(function(_0x2d5dab,_0x272958){try{if(_0x76f8b7[_0x33246c['id']]){_0x33246c[_0x6b61('0x32')]=_[_0x6b61('0x33')](_0x76f8b7[_0x33246c['id']],function(_0x23e629){return{'id':_0x23e629['id'],'fullname':_0x23e629[_0x6b61('0x34')]};});}}catch(_0x3f1b9c){_0x272958(_0x3f1b9c);}_0x2d5dab(_0x33246c);});}function getInteractionTags(_0x338b84,_0x2c6797){return new BPromise(function(_0x315e8b,_0x58b22d){try{if(_0x338b84[_0x6b61('0x35')]){_0x338b84[_0x6b61('0x36')]=[];_0x338b84[_0x6b61('0x35')][_0x6b61('0x37')](',')[_0x6b61('0x38')](function(_0x3e57eb){_0x338b84[_0x6b61('0x36')][_0x6b61('0x39')](_0x2c6797[_0x3e57eb]);});}delete _0x338b84['TagIds'];}catch(_0x3c14ac){_0x58b22d(_0x3c14ac);}_0x315e8b(_0x338b84);});}function updateSmsInteraction(_0x1bf527,_0x24c445,_0x8f8db8){return new BPromise(function(_0x5f06a7,_0x19747a){return getInteractionUsers(_0x1bf527,_0x8f8db8)[_0x6b61('0x2d')](function(_0x35b3a5){return getInteractionTags(_0x35b3a5,_0x24c445);})['then'](function(_0x269562){return getStateInteraction(_0x269562);})[_0x6b61('0x2d')](function(_0x570c47){_0x5f06a7(_0x570c47);})[_0x6b61('0x3a')](function(_0x57f278){_0x19747a(_0x57f278);});});}function getStateInteraction(_0x278be7){return new BPromise(function(_0x28e9a6){_0x278be7['waiting']=0x0;_0x278be7[_0x6b61('0x3b')]=0x0;_0x278be7['answered']=0x0;_0x278be7[_0x6b61('0x3c')]=0x0;_0x278be7['total']=0x0;if(!_0x278be7[_0x6b61('0x3d')]&&!_0x278be7['UserId']){_0x278be7['waiting']+=0x1;}if(!_0x278be7[_0x6b61('0x3d')]&&_0x278be7['UserId']){_0x278be7[_0x6b61('0x3b')]+=0x1;if(_0x278be7['waiting']){_0x278be7['waiting']-=0x1;}}if(_0x278be7['closed']&&_0x278be7[_0x6b61('0x3e')]){_0x278be7[_0x6b61('0x3f')]+=0x1;if(_0x278be7[_0x6b61('0x3b')]){_0x278be7[_0x6b61('0x3b')]-=0x1;}}if(_0x278be7['closed']&&!_0x278be7[_0x6b61('0x3e')]){_0x278be7[_0x6b61('0x3c')]+=0x1;if(_0x278be7['waiting']){_0x278be7['waiting']-=0x1;}}_0x278be7[_0x6b61('0x40')]+=0x1;_0x28e9a6(_0x278be7);});}exports[_0x6b61('0x41')]=function(_0x7779ad,_0x2dde81){var _0x1ec8a9={},_0xdb26f8={},_0xba022f={'count':0x0,'rows':[]};var _0x40237c=_['map'](db['SmsInteraction'][_0x6b61('0x42')],function(_0x4637d9){return{'name':_0x4637d9['fieldName'],'type':_0x4637d9['type'][_0x6b61('0x43')]};});_0xdb26f8[_0x6b61('0x44')]=_[_0x6b61('0x33')](_0x40237c,_0x6b61('0x30'));_0xdb26f8[_0x6b61('0x45')]=_[_0x6b61('0x46')](_0x7779ad['query']);_0xdb26f8[_0x6b61('0x47')]=_[_0x6b61('0x48')](_0xdb26f8[_0x6b61('0x44')],_0xdb26f8[_0x6b61('0x45')]);_0x1ec8a9[_0x6b61('0x49')]=_[_0x6b61('0x48')](_0xdb26f8[_0x6b61('0x44')],qs[_0x6b61('0x4a')](_0x7779ad[_0x6b61('0x45')][_0x6b61('0x4a')]));_0x1ec8a9['attributes']=_0x1ec8a9['attributes'][_0x6b61('0x4b')]?_0x1ec8a9[_0x6b61('0x49')]:_0xdb26f8[_0x6b61('0x44')];if(!_0x7779ad[_0x6b61('0x45')][_0x6b61('0x4c')](_0x6b61('0x4d'))){_0x1ec8a9[_0x6b61('0x26')]=qs[_0x6b61('0x26')](_0x7779ad[_0x6b61('0x45')][_0x6b61('0x26')]);_0x1ec8a9[_0x6b61('0x24')]=qs[_0x6b61('0x24')](_0x7779ad['query'][_0x6b61('0x24')]);}_0x1ec8a9['order']=qs[_0x6b61('0x4e')](_0x7779ad['query'][_0x6b61('0x4e')]);_0x1ec8a9[_0x6b61('0x4f')]=qs[_0x6b61('0x47')](_['pick'](_0x7779ad['query'],_0xdb26f8[_0x6b61('0x47')]),_0x40237c);var _0x198702=[];var _0x325532=squel['select']()[_0x6b61('0x50')]('id')[_0x6b61('0x50')](_0x6b61('0x30'))[_0x6b61('0x50')](_0x6b61('0x51'))['from'](_0x6b61('0x52'));var _0x29b3bc=squel[_0x6b61('0x53')]()[_0x6b61('0x50')]('u.id')[_0x6b61('0x50')](_0x6b61('0x54'))[_0x6b61('0x50')](_0x6b61('0x55'))['from'](_0x6b61('0x56'),'ui')[_0x6b61('0x57')](_0x6b61('0x58'),'u','u.id\x20=\x20ui.UserId');var _0x8fa5a=squel['select']()[_0x6b61('0x59')](_0x6b61('0x5a'),'i')[_0x6b61('0x57')]('cm_contacts','c',_0x6b61('0x5b'))[_0x6b61('0x57')](_0x6b61('0x58'),'o',_0x6b61('0x5c'))[_0x6b61('0x57')]('sms_accounts','a',_0x6b61('0x5d'))['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0x6b61('0x5e'),'it',_0x6b61('0x5f'))[_0x6b61('0x57')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0xf71e3c=squel[_0x6b61('0x60')]();var _0x5895af=[];var _0x55c95b=squel[_0x6b61('0x60')]();var _0x2f88ca;if(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x61')]){_0x2f88ca=as['parseSearch'](_0x7779ad[_0x6b61('0x45')]['search']);var _0x1d7d68=_0x2f88ca['sqlOperator'];for(var _0x33eff1=0x0;_0x33eff1<_0x2f88ca['conditions'][_0x6b61('0x4b')];_0x33eff1++){var _0x4cdd33=_0x2f88ca[_0x6b61('0x62')][_0x33eff1];var _0x11a419='i';var _0x3b4a55=_['find'](_0x40237c,[_0x6b61('0x30'),_0x4cdd33[_0x6b61('0x50')]]);if(!_0x3b4a55){switch(_0x4cdd33['field']){case _0x6b61('0x63'):if(_0x4cdd33[_0x6b61('0x64')]==0x1){_0x8fa5a[_0x6b61('0x65')]('`'+_0x4cdd33[_0x6b61('0x50')]+_0x6b61('0x66'));}else{_0x8fa5a[_0x6b61('0x65')]('`'+_0x4cdd33['field']+_0x6b61('0x67'));}break;case'Contact':if(_0x4cdd33[_0x6b61('0x68')]===_0x6b61('0x69')){if(_0x4cdd33[_0x6b61('0x64')][_0x6b61('0x37')]('\x20')[_0x6b61('0x4b')]>0x1){_0xf71e3c[_0x1d7d68](_0x6b61('0x6a'),qs[_0x6b61('0x6b')](_0x4cdd33['value']),null);}else{var _0x5cd799='%'+_0x4cdd33['value']+'%';_0xf71e3c[_0x1d7d68](_0x6b61('0x6c'),_0x5cd799,_0x5cd799,_0x5cd799);}}else{_0x3b4a55=_['find'](_0x40237c,['name',_0x6b61('0x6d')]);_0x4cdd33[_0x6b61('0x50')]=_0x6b61('0x6d');_0x31a158=as[_0x6b61('0x6e')](_0x11a419,_0x3b4a55[_0x6b61('0x6f')],_0x4cdd33);_0xf71e3c[_0x1d7d68](_0x31a158[_0x6b61('0x70')],_0x31a158[_0x6b61('0x64')]['start'],_0x31a158[_0x6b61('0x64')][_0x6b61('0x21')]);}break;case _0x6b61('0x71'):var _0x4bfe58=_0x4cdd33['value'][_0x6b61('0x37')](',')[_0x6b61('0x33')](function(_0x205e01){return Number(_0x205e01);});_0x4bfe58[_0x6b61('0x38')](function(_0x5b7afe){_0x55c95b['or'](_0x6b61('0x72'),'%,'+_0x5b7afe+',%');});_0x5895af=_['union'](_0x5895af,_0x4bfe58);break;case _0x6b61('0x73'):if(_0x4cdd33[_0x6b61('0x68')]===_0x6b61('0x69')){_0xf71e3c[_0x1d7d68](_0x6b61('0x74'),'%'+_0x4cdd33[_0x6b61('0x64')]+'%',null);}else{_0x3b4a55=_[_0x6b61('0x75')](_0x40237c,[_0x6b61('0x30'),_0x6b61('0x3e')]);_0x4cdd33[_0x6b61('0x50')]='UserId';_0x31a158=as[_0x6b61('0x6e')](_0x11a419,_0x3b4a55['type'],_0x4cdd33);_0xf71e3c[_0x1d7d68](_0x31a158[_0x6b61('0x70')],_0x31a158[_0x6b61('0x64')][_0x6b61('0x76')],_0x31a158[_0x6b61('0x64')]['end']);}break;case'body':_0x31a158=as['buildExpression']('me',null,_0x4cdd33);_0xf71e3c[_0x1d7d68](_0x31a158[_0x6b61('0x70')],_0x31a158[_0x6b61('0x64')][_0x6b61('0x76')],_0x31a158['value'][_0x6b61('0x21')]);break;}}else{var _0x31a158=as[_0x6b61('0x6e')](_0x11a419,_0x3b4a55['type'],_0x4cdd33);_0xf71e3c[_0x1d7d68](_0x31a158[_0x6b61('0x70')],_0x31a158[_0x6b61('0x64')][_0x6b61('0x76')],_0x31a158[_0x6b61('0x64')][_0x6b61('0x21')]);}}}else{var _0x4aabc1=_(_0x7779ad[_0x6b61('0x45')])[_0x6b61('0x46')]()[_0x6b61('0x33')](function(_0x2b7d5c){return _[_0x6b61('0x77')](_0x40237c,[_0x6b61('0x30'),_0x2b7d5c])?_0x2b7d5c:undefined;})[_0x6b61('0x78')]()[_0x6b61('0x64')]();if(!_[_0x6b61('0x79')](_0x4aabc1)){_0x4aabc1[_0x6b61('0x38')](function(_0x25aac5){if(_0x25aac5===_0x6b61('0x7a')){_0x8fa5a['where']('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x7779ad[_0x6b61('0x45')][_0x25aac5]));}else if(_0x25aac5==='createdAt'){var _0x849e28=JSON[_0x6b61('0x7b')](_0x7779ad[_0x6b61('0x45')][_0x25aac5])['$gte'];var _0xf1c344=JSON[_0x6b61('0x7b')](_0x7779ad[_0x6b61('0x45')][_0x25aac5])['$lte'];_0x8fa5a[_0x6b61('0x4f')](_0x6b61('0x7c'),_0x849e28,_0xf1c344);}else{if(_0x7779ad['query'][_0x25aac5]===_0x6b61('0x7d')){_0x8fa5a[_0x6b61('0x4f')]('i.'+_0x25aac5+_0x6b61('0x7e'));}else{_0x8fa5a['where']('i.'+_0x25aac5+_0x6b61('0x7f'),_0x7779ad[_0x6b61('0x45')][_0x25aac5]);}}});}if(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x80')]){if(_0x7779ad[_0x6b61('0x45')]['read']==0x1){_0x8fa5a[_0x6b61('0x65')](_0x6b61('0x81'));}else{_0x8fa5a[_0x6b61('0x65')](_0x6b61('0x82'));}}if(_0x7779ad['query']['tag']){_0x5895af=_[_0x6b61('0x83')](_0x7779ad[_0x6b61('0x45')][_0x6b61('0x84')])?_0x7779ad['query']['tag']:new Array(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x84')]);_0x5895af[_0x6b61('0x38')](function(_0x78ed91){_0x55c95b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x78ed91+',%');});}if(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x85')]){var _0x146db5=_0x7779ad[_0x6b61('0x45')][_0x6b61('0x85')]['replace']('\x5c','\x5c\x5c')[_0x6b61('0x86')](/'/g,'\x27\x27');if(qs[_0x6b61('0x87')](_0x146db5)){_0xf71e3c['or'](_0x6b61('0x88'),_0x146db5+'%')['or'](_0x6b61('0x89'),_0x146db5+'%');}else{_0xf71e3c['or'](_0x6b61('0x8a'),qs['getFullTextValue'](_0x146db5))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x146db5+'%');}}}_0x8fa5a[_0x6b61('0x4f')](_0xf71e3c);_0x8fa5a[_0x6b61('0x8b')](_0x6b61('0x8c'));var _0x80f45a={'type':db[_0x6b61('0x8d')][_0x6b61('0x8e')][_0x6b61('0x8f')],'raw':!![]};var _0x19ca28=_0x8fa5a[_0x6b61('0x90')]();_0x19ca28[_0x6b61('0x50')](_0x6b61('0x8c'));_0x19ca28[_0x6b61('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6b61('0x63'));if(_0x1ec8a9[_0x6b61('0x91')]){_0x1ec8a9['order']['forEach'](function(_0x3bceac){var _0x5c0fe1=_0x3bceac[0x0]===_0x6b61('0x92')?_0x3bceac[0x0]:'i.'+_0x3bceac[0x0];_0x8fa5a[_0x6b61('0x91')](_0x5c0fe1,_0x3bceac[0x1]===_0x6b61('0x93')?![]:!![]);});}if(!_[_0x6b61('0x79')](_0x5895af)){_0x8fa5a[_0x6b61('0x65')](_0x55c95b);_0x19ca28[_0x6b61('0x4f')](_0x6b61('0x94'),_0x5895af);}BPromise['resolve']()[_0x6b61('0x2d')](function(){if(!_0x2f88ca){if(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x7a')])return;_0x19ca28[_0x6b61('0x4f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');_0x8fa5a[_0x6b61('0x4f')]('i.SmsAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x7779ad['user'][_0x6b61('0x95')]!==_0x6b61('0x96'))return;return _0x7779ad[_0x6b61('0x97')][_0x6b61('0x98')]({'attributes':['id'],'raw':!![]})['then'](function(_0xc5fda){if(_[_0x6b61('0x79')](_0xc5fda)){_0x19ca28['where'](_0x6b61('0x99'));_0x8fa5a[_0x6b61('0x4f')](_0x6b61('0x99'));}else{_0x19ca28[_0x6b61('0x4f')](_0x6b61('0x9a'),_[_0x6b61('0x33')](_0xc5fda,'id'));_0x8fa5a[_0x6b61('0x4f')](_0x6b61('0x9a'),_[_0x6b61('0x33')](_0xc5fda,'id'));}});})[_0x6b61('0x2d')](function(){if(_0x7779ad[_0x6b61('0x97')][_0x6b61('0x95')]==='agent'&&!_0x2f88ca&&!_0x7779ad[_0x6b61('0x45')]['SmsAccountId'])return[];return db[_0x6b61('0x9b')]['query'](_0x19ca28[_0x6b61('0x9c')](),_0x80f45a);})[_0x6b61('0x2d')](function(_0x505513){_0xba022f[_0x6b61('0x27')]=_0x505513[_0x6b61('0x4b')];if(_0xba022f[_0x6b61('0x27')]===0x0)return[];return db[_0x6b61('0x9b')][_0x6b61('0x45')](_0x325532[_0x6b61('0x9c')](),_0x80f45a)[_0x6b61('0x2d')](function(_0x456e60){_0x198702=_[_0x6b61('0x9d')](_0x456e60,'id');_0x80f45a=_[_0x6b61('0x9e')](_0x80f45a,{'model':db[_0x6b61('0x9f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x7779ad[_0x6b61('0x45')][_0x6b61('0x4a')]){_0x1ec8a9[_0x6b61('0x49')][_0x6b61('0x38')](function(_0x3d332b){_0x8fa5a[_0x6b61('0x50')]('i.'+_0x3d332b);});}else{_0x8fa5a[_0x6b61('0x50')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x6b61('0x63'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa0'),_0x6b61('0xa1'));_0x8fa5a['field'](_0x6b61('0xa2'),'Account.mandatoryDisposition');_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa3'),_0x6b61('0x92'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa4'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa5'),'Contact.firstName');_0x8fa5a[_0x6b61('0x50')]('c.lastName',_0x6b61('0xa6'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa7'),_0x6b61('0xa8'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xa9'),_0x6b61('0xaa'));_0x8fa5a['field'](_0x6b61('0xab'),_0x6b61('0xac'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xad'),_0x6b61('0xae'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xaf'),_0x6b61('0xb0'));_0x8fa5a['field'](_0x6b61('0xb1'),_0x6b61('0xb2'));_0x8fa5a[_0x6b61('0x50')](_0x6b61('0xb3'),_0x6b61('0x35'));}if(_0x1ec8a9[_0x6b61('0x26')])_0x8fa5a[_0x6b61('0x26')](_0x1ec8a9['limit']);if(_0x1ec8a9[_0x6b61('0x24')])_0x8fa5a[_0x6b61('0x24')](_0x1ec8a9['offset']);return db[_0x6b61('0x9b')][_0x6b61('0x45')](_0x8fa5a[_0x6b61('0x9c')](),_0x80f45a);})[_0x6b61('0x2d')](function(_0x3271c0){if(_0x3271c0[_0x6b61('0x4b')]>0x0)_0x29b3bc[_0x6b61('0x4f')](_0x6b61('0xb4'),_[_0x6b61('0x33')](_0x3271c0,'id'));return db['sequelize'][_0x6b61('0x45')](_0x29b3bc['toString'](),_0x80f45a)[_0x6b61('0x2d')](function(_0x2965ff){var _0xf62a6f=_[_0x6b61('0xb5')](_0x2965ff,'SmsInteractionId');var _0x534975=[];_0x3271c0[_0x6b61('0x38')](function(_0x492871){_0x534975[_0x6b61('0x39')](updateSmsInteraction(_0x492871,_0x198702,_0xf62a6f));});return BPromise[_0x6b61('0xb6')](_0x534975);});});})[_0x6b61('0x2d')](function(_0x3f4470){_0xba022f[_0x6b61('0xb7')]=_0x3f4470;return _0xba022f;})['then'](respondWithFilteredResult(_0x2dde81,_0x1ec8a9))[_0x6b61('0x3a')](handleError(_0x2dde81,null));};exports[_0x6b61('0xb8')]=function(_0x3958b2,_0x12ddca){var _0x479f07={'raw':![],'where':{'id':_0x3958b2['params']['id']}},_0x426e41={};_0x426e41[_0x6b61('0x44')]=_[_0x6b61('0x46')](db[_0x6b61('0x9f')][_0x6b61('0x42')]);_0x426e41[_0x6b61('0x45')]=_['keys'](_0x3958b2[_0x6b61('0x45')]);_0x426e41['filters']=_[_0x6b61('0x48')](_0x426e41[_0x6b61('0x44')],_0x426e41[_0x6b61('0x45')]);_0x479f07[_0x6b61('0x49')]=_[_0x6b61('0x48')](_0x426e41[_0x6b61('0x44')],qs[_0x6b61('0x4a')](_0x3958b2['query']['fields']));_0x479f07[_0x6b61('0x49')]=_0x479f07['attributes']['length']?_0x479f07[_0x6b61('0x49')]:_0x426e41[_0x6b61('0x44')];if(_0x3958b2[_0x6b61('0x45')][_0x6b61('0xb9')]){_0x479f07[_0x6b61('0xba')]=[{'all':!![]}];}_0x479f07=_[_0x6b61('0x9e')]({},_0x479f07,_0x3958b2[_0x6b61('0xbb')]);return db[_0x6b61('0x9f')]['find'](_0x479f07)[_0x6b61('0x2d')](handleEntityNotFound(_0x12ddca,null))[_0x6b61('0x2d')](respondWithResult(_0x12ddca,null))['catch'](handleError(_0x12ddca,null));};exports['create']=function(_0xabedf2,_0x563e1b){return db['SmsInteraction']['create'](_0xabedf2['body'],{})[_0x6b61('0x2d')](respondWithResult(_0x563e1b,0xc9))[_0x6b61('0x3a')](handleError(_0x563e1b,null));};exports[_0x6b61('0x2b')]=function(_0x408524,_0x1766c0){if(_0x408524['body']['id']){delete _0x408524[_0x6b61('0xbc')]['id'];}return db[_0x6b61('0x9f')]['find']({'where':{'id':_0x408524[_0x6b61('0xbd')]['id']}})['then'](handleEntityNotFound(_0x1766c0,null))['then'](saveUpdates(_0x408524['body'],null))[_0x6b61('0x2d')](respondWithResult(_0x1766c0,null))[_0x6b61('0x3a')](handleError(_0x1766c0,null));};exports[_0x6b61('0x2c')]=function(_0x14079e,_0x359434){return db[_0x6b61('0x9f')][_0x6b61('0x75')]({'where':{'id':_0x14079e[_0x6b61('0xbd')]['id']}})[_0x6b61('0x2d')](handleEntityNotFound(_0x359434,null))['then'](removeEntity(_0x359434,null))['catch'](handleError(_0x359434,null));};exports['describe']=function(_0x5ddffe,_0x2df63a){return db[_0x6b61('0x9f')][_0x6b61('0xbe')]()['then'](respondWithResult(_0x2df63a,null))[_0x6b61('0x3a')](handleError(_0x2df63a,null));};exports[_0x6b61('0xbf')]=function(_0x4aa1fa,_0x1219d4,_0x4935ac){return db['SmsMessage'][_0x6b61('0x75')]({'where':{'id':_0x4aa1fa['params']['id']}})[_0x6b61('0x2d')](handleEntityNotFound(_0x1219d4,null))[_0x6b61('0x2d')](function(_0x448311){if(_0x448311){return _0x448311[_0x6b61('0xbf')](_0x4aa1fa[_0x6b61('0xbc')]['ids'],_[_0x6b61('0xc0')](_0x4aa1fa[_0x6b61('0xbc')],[_0x6b61('0xc1'),'id'])||{});}})[_0x6b61('0x2d')](respondWithResult(_0x1219d4,null))[_0x6b61('0x3a')](handleError(_0x1219d4,null));};exports['getMessages']=function(_0x54559a,_0x3cb885,_0x23bee8){var _0x2d00d8={'raw':![],'where':{}};var _0x424dcd={};var _0x222c52={'count':0x0,'rows':[]};return db[_0x6b61('0x9f')][_0x6b61('0xc2')]({'where':{'id':_0x54559a[_0x6b61('0xbd')]['id']}})[_0x6b61('0x2d')](handleEntityNotFound(_0x3cb885,null))[_0x6b61('0x2d')](function(_0x5a094e){if(_0x5a094e){_0x424dcd[_0x6b61('0x44')]=_[_0x6b61('0x46')](db[_0x6b61('0xc3')][_0x6b61('0x42')]);_0x424dcd[_0x6b61('0x45')]=_[_0x6b61('0x46')](_0x54559a[_0x6b61('0x45')]);_0x424dcd[_0x6b61('0x47')]=_[_0x6b61('0x48')](_0x424dcd['model'],_0x424dcd[_0x6b61('0x45')]);_0x2d00d8['attributes']=_[_0x6b61('0x48')](_0x424dcd[_0x6b61('0x44')],qs[_0x6b61('0x4a')](_0x54559a[_0x6b61('0x45')][_0x6b61('0x4a')]));_0x2d00d8[_0x6b61('0x49')]=_0x2d00d8['attributes'][_0x6b61('0x4b')]?_0x2d00d8[_0x6b61('0x49')]:_0x424dcd[_0x6b61('0x44')];if(!_0x54559a[_0x6b61('0x45')][_0x6b61('0x4c')](_0x6b61('0x4d'))){_0x2d00d8['limit']=qs[_0x6b61('0x26')](_0x54559a['query'][_0x6b61('0x26')]);_0x2d00d8[_0x6b61('0x24')]=qs[_0x6b61('0x24')](_0x54559a[_0x6b61('0x45')][_0x6b61('0x24')]);}_0x2d00d8[_0x6b61('0x91')]=qs[_0x6b61('0x4e')](_0x54559a[_0x6b61('0x45')][_0x6b61('0x4e')]);_0x2d00d8[_0x6b61('0x4f')]=qs[_0x6b61('0x47')](_[_0x6b61('0xc4')](_0x54559a['query'],_0x424dcd['filters']));_0x2d00d8['where'][_0x6b61('0xc5')]=_0x5a094e['id'];if(_0x54559a[_0x6b61('0x45')][_0x6b61('0x85')]){_0x2d00d8['where']=_[_0x6b61('0x9e')](_0x2d00d8[_0x6b61('0x4f')],{'$or':_['map'](_0x2d00d8[_0x6b61('0x49')],function(_0x449683){var _0x18bf10={};_0x18bf10[_0x449683]={'$like':'%'+_0x54559a['query']['filter']+'%'};return _0x18bf10;})});}if(_0x54559a[_0x6b61('0x45')][_0x6b61('0xc6')]){var _0x4f180b=_0x54559a[_0x6b61('0x45')][_0x6b61('0xc6')][_0x6b61('0x37')](',');var _0x39babd={};_0x39babd[_0x4f180b[0x0]]={'$gte':moment(_0x4f180b[0x1])[_0x6b61('0xc7')](_0x6b61('0xc8'))};_0x2d00d8['where']=_[_0x6b61('0x9e')](_0x2d00d8[_0x6b61('0x4f')],_0x39babd);}_0x2d00d8=_[_0x6b61('0x9e')]({},_0x2d00d8,_0x54559a['options']);return db['SmsMessage'][_0x6b61('0x27')]({'where':_0x2d00d8['where']})[_0x6b61('0x2d')](function(_0x3bc0c5){_0x222c52[_0x6b61('0x27')]=_0x3bc0c5;if(_0x54559a['query'][_0x6b61('0xb9')]){_0x2d00d8['include']=[{'all':!![]}];}return db[_0x6b61('0xc3')][_0x6b61('0xc9')](_0x2d00d8);})[_0x6b61('0x2d')](function(_0x356154){_0x222c52[_0x6b61('0xb7')]=_0x356154;return _0x222c52;});}})[_0x6b61('0x2d')](respondWithFilteredResult(_0x3cb885,_0x2d00d8))[_0x6b61('0x3a')](handleError(_0x3cb885,null));};exports[_0x6b61('0xca')]=function(_0x1e4c47,_0x730899,_0x33d44c){return db[_0x6b61('0x9f')][_0x6b61('0x75')]({'where':{'id':_0x1e4c47[_0x6b61('0xbd')]['id']}})[_0x6b61('0x2d')](handleEntityNotFound(_0x730899,null))[_0x6b61('0x2d')](function(_0x58aa89){if(_0x58aa89){return _0x58aa89[_0x6b61('0xcb')](_0x1e4c47[_0x6b61('0xbc')][_0x6b61('0xc1')],_[_0x6b61('0xc0')](_0x1e4c47['body'],[_0x6b61('0xc1'),'id'])||{})[_0x6b61('0xcc')](function(){return db[_0x6b61('0x71')][_0x6b61('0xc9')]({'attributes':['id',_0x6b61('0x30'),'color'],'where':{'id':_0x1e4c47[_0x6b61('0xbc')][_0x6b61('0xc1')]}});})[_0x6b61('0x2d')](function(_0x2802cd){socket[_0x6b61('0xcd')]('smsInteractionTags:save',{'id':Number(_0x1e4c47[_0x6b61('0xbd')]['id']),'tags':_0x2802cd||[]});return{'id':Number(_0x1e4c47[_0x6b61('0xbd')]['id']),'tags':_0x2802cd||[]};});}})[_0x6b61('0x2d')](respondWithResult(_0x730899,null))[_0x6b61('0x3a')](handleError(_0x730899,null));};exports[_0x6b61('0xce')]=function(_0x3b4917,_0x4a5d37,_0x5ea24c){return db[_0x6b61('0x9f')][_0x6b61('0x75')]({'where':{'id':_0x3b4917[_0x6b61('0xbd')]['id']}})['then'](handleEntityNotFound(_0x4a5d37,null))[_0x6b61('0x2d')](function(_0x3489b0){if(_0x3489b0){return _0x3489b0[_0x6b61('0xce')](_0x3b4917[_0x6b61('0x45')][_0x6b61('0xc1')]);}})['then'](respondWithStatusCode(_0x4a5d37,null))[_0x6b61('0x3a')](handleError(_0x4a5d37,null));};exports['download']=function(_0x4873d9,_0x2e5ed9){var _0x4c13b2=moment()['unix']()[_0x6b61('0x9c')]();var _0x28394e=path[_0x6b61('0xcf')](config[_0x6b61('0xd0')],'server',_0x6b61('0xd1'),_0x6b61('0xd2'));var _0x3dae21=path[_0x6b61('0xcf')](config['root'],'server',_0x6b61('0xd1'),_0x6b61('0xd3'));var _0x39c3a6=path[_0x6b61('0xcf')](_0x28394e,_0x4c13b2);var _0x48b874=util[_0x6b61('0xc7')]('transcript-%d-%s.zip',_0x4873d9[_0x6b61('0xbd')]['id'],_0x4c13b2);var _0x5edf7d=path['join'](_0x28394e,_0x48b874);var _0x369166=[];_0x369166[_0x6b61('0x39')]({'model':db['User'],'as':_0x6b61('0x73'),'attributes':['id',_0x6b61('0x34')],'raw':!![]});_0x369166[_0x6b61('0x39')]({'model':db['CmContact'],'as':_0x6b61('0xd4'),'attributes':['id',_0x6b61('0xd5'),_0x6b61('0xd6')],'raw':!![]});var _0x46670f=[{'model':db[_0x6b61('0xc3')],'as':'Messages','attributes':['id',_0x6b61('0xbc'),_0x6b61('0xd7'),_0x6b61('0xd8'),'secret',_0x6b61('0x80')],'include':_0x369166}];_0x46670f['push']({'model':db[_0x6b61('0xd9')],'as':'Account','attributes':['id',_0x6b61('0x30')]});_0x46670f[_0x6b61('0x39')]({'model':db['User'],'as':'Owner','attributes':['id',_0x6b61('0x34')]});return db[_0x6b61('0x9f')]['find']({'where':{'id':_0x4873d9[_0x6b61('0xbd')]['id']},'include':_0x46670f})[_0x6b61('0x2d')](handleEntityNotFound(_0x2e5ed9,null))['then'](function(_0x4c2c7b){if(_0x4c2c7b){var _0x39f9e7=_0x4c2c7b[_0x6b61('0xda')]({'plain':!![]});fs['mkdirSync'](_0x39c3a6);var _0x1ce966={'channel':_0x6b61('0xdb'),'account':_0x39f9e7['Account'][_0x6b61('0x30')],'agent':_0x39f9e7['Owner']?_0x39f9e7['Owner']['fullname']:_0x6b61('0xdc'),'createdAt':moment(_0x39f9e7[_0x6b61('0xd7')])['format'](_0x6b61('0xc8'))[_0x6b61('0x9c')](),'closedAt':_0x39f9e7[_0x6b61('0x3d')]?moment(_0x39f9e7['closedAt'])[_0x6b61('0xc7')](_0x6b61('0xc8'))[_0x6b61('0x9c')]():'','disposition':_0x39f9e7[_0x6b61('0xdd')],'messages':_(_0x39f9e7[_0x6b61('0xde')])['filter']({'secret':![]})[_0x6b61('0x33')](function(_0x4ed0f5){return{'date':moment(_0x4ed0f5[_0x6b61('0xd7')])[_0x6b61('0xc7')](_0x6b61('0xc8'))[_0x6b61('0x9c')](),'sender':_0x4ed0f5['direction']===_0x6b61('0xdf')?_0x4ed0f5[_0x6b61('0x73')]?_0x4ed0f5['User'][_0x6b61('0x34')]:_0x6b61('0xe0'):_0x4ed0f5['Contact'][_0x6b61('0xd5')]+(_0x4ed0f5[_0x6b61('0xd4')]['lastName']?'\x20'+_0x4ed0f5[_0x6b61('0xd4')][_0x6b61('0xd6')]:''),'body':_0x4ed0f5['body'],'direction':_0x4ed0f5[_0x6b61('0xd8')]==='out'?'A':'C','secret':_0x4ed0f5[_0x6b61('0xe1')],'read':_0x4ed0f5[_0x6b61('0x80')]};})[_0x6b61('0x64')]()};return ejs[_0x6b61('0xe2')](path[_0x6b61('0xcf')](config[_0x6b61('0xd0')],_0x6b61('0xe3'),_0x6b61('0xe4'),_0x6b61('0xe5')),{'interaction':_0x1ce966})[_0x6b61('0x2d')](function(_0x297664){var _0x3d9b42=path[_0x6b61('0xcf')](_0x39c3a6,'transcript-'+_0x39f9e7['id']+'-'+_0x4c13b2+_0x6b61('0xe6'));var _0x1e045f={'path':_0x3d9b42,'channel':_0x6b61('0xdb'),'interactionId':_0x39f9e7['id']};return pdf[_0x6b61('0xe7')](_0x297664,_0x1e045f);})['then'](function(){return new BPromise(function(_0x4cc1c7,_0x201eca){zipdir(_0x39c3a6,{'saveTo':_0x5edf7d},function(_0x3ba99f,_0x4e97a0){if(_0x3ba99f)return _0x201eca(_0x3ba99f);return _0x4cc1c7(_0x4e97a0);});})[_0x6b61('0x2d')](function(){return new BPromise(function(_0x4d1c5c,_0x26bc04){rimraf(_0x39c3a6,function(_0x39a29e){if(_0x39a29e)_0x26bc04(_0x39a29e);return _0x4d1c5c();});});})[_0x6b61('0x2d')](function(){return _0x2e5ed9[_0x6b61('0xe8')](_0x5edf7d,_0x48b874,function(_0x21ead6){if(_0x21ead6){console[_0x6b61('0xe9')](_0x6b61('0xea'),_0x21ead6);}else{fs[_0x6b61('0xeb')](_0x5edf7d);}});});});}else{return _0x2e5ed9[_0x6b61('0x20')](0xc8);}})['catch'](handleError(_0x2e5ed9,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 4e34b4f..d67ee7b 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 _0x0abf=['Users','map','emit','catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','save','remove','getUsers','then','setDataValue'];(function(_0x2a67a2,_0x48fa81){var _0x33bc64=function(_0x166d86){while(--_0x166d86){_0x2a67a2['push'](_0x2a67a2['shift']());}};_0x33bc64(++_0x48fa81);}(_0x0abf,0xe8));var _0xf0ab=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x0abf[_0xbca1b1];return _0x4e1686;};'use strict';var EventEmitter=require(_0xf0ab('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xf0ab('0x1')];var SmsMessage=require(_0xf0ab('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf0ab('0x3'),'afterUpdate':'update','afterDestroy':_0xf0ab('0x4')};function emitEvent(_0x3be05e){return function(_0x2efe43,_0xbb1f91,_0x2ab7d6){_0x2efe43[_0xf0ab('0x5')]({'attributes':['id'],'raw':!![]})[_0xf0ab('0x6')](function(_0x57ff3b){_0x2efe43[_0xf0ab('0x7')](_0xf0ab('0x8'),_0x57ff3b[_0xf0ab('0x9')](function(_0x236b07){return{'id':_0x236b07['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x2efe43['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf0ab('0x6')](function(_0x4688d8){_0x2efe43[_0xf0ab('0x7')]('unreadMessages',_0x4688d8['length']);SmsInteractionEvents[_0xf0ab('0xa')](_0x3be05e+':'+_0x2efe43['id'],_0x2efe43);SmsInteractionEvents['emit'](_0x3be05e,_0x2efe43);_0x2ab7d6(null);})[_0xf0ab('0xb')](_0x2ab7d6(null));};}for(var e in events){if(events[_0xf0ab('0xc')](e)){var event=events[e];SmsInteraction[_0xf0ab('0xd')](e,emitEvent(event));}}module[_0xf0ab('0xe')]=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(_0x53f884,_0x254864){var _0x499ed3=function(_0x217065){while(--_0x217065){_0x53f884['push'](_0x53f884['shift']());}};_0x499ed3(++_0x254864);}(_0x5fdc,0x127));var _0xc5fd=function(_0x51a6d7,_0x332d39){_0x51a6d7=_0x51a6d7-0x0;var _0x3cfc41=_0x5fdc[_0x51a6d7];return _0x3cfc41;};'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 e481fd6..8472cf5 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 _0x6296=['moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x96f957,_0x28cfd2){var _0x57340a=function(_0x29ad78){while(--_0x29ad78){_0x96f957['push'](_0x96f957['shift']());}};_0x57340a(++_0x28cfd2);}(_0x6296,0xc2));var _0x6629=function(_0x16ac73,_0x1a1474){_0x16ac73=_0x16ac73-0x0;var _0x44477e=_0x6296[_0x16ac73];return _0x44477e;};'use strict';var _=require(_0x6629('0x0'));var util=require(_0x6629('0x1'));var logger=require(_0x6629('0x2'))(_0x6629('0x3'));var moment=require(_0x6629('0x4'));var BPromise=require(_0x6629('0x5'));var rp=require(_0x6629('0x6'));var fs=require('fs');var path=require(_0x6629('0x7'));var rimraf=require('rimraf');var config=require(_0x6629('0x8'));var attributes=require(_0x6629('0x9'));module[_0x6629('0xa')]=function(_0x4e81f7,_0x10db7f){return _0x4e81f7[_0x6629('0xb')](_0x6629('0xc'),attributes,{'tableName':_0x6629('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x597631,_0x5730b3,_0xd1d556){if(_0x597631['changed'](_0x6629('0xe'))){_0x597631[_0x6629('0xf')]=moment()[_0x6629('0x10')](_0x6629('0x11'));}_0xd1d556(null,_0x597631);}}});}; \ No newline at end of file +var _0x94d3=['api','bluebird','request-promise','path','rimraf','exports','define','SmsInteraction','sms_interactions','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x86527a,_0x2787c6){var _0x2f14b6=function(_0x4f1613){while(--_0x4f1613){_0x86527a['push'](_0x86527a['shift']());}};_0x2f14b6(++_0x2787c6);}(_0x94d3,0xec));var _0x394d=function(_0xac8a7e,_0x235858){_0xac8a7e=_0xac8a7e-0x0;var _0x479a84=_0x94d3[_0xac8a7e];return _0x479a84;};'use strict';var _=require(_0x394d('0x0'));var util=require(_0x394d('0x1'));var logger=require('../../config/logger')(_0x394d('0x2'));var moment=require('moment');var BPromise=require(_0x394d('0x3'));var rp=require(_0x394d('0x4'));var fs=require('fs');var path=require(_0x394d('0x5'));var rimraf=require(_0x394d('0x6'));var config=require('../../config/environment');var attributes=require('./smsInteraction.attributes');module[_0x394d('0x7')]=function(_0x45ef82,_0x251222){return _0x45ef82[_0x394d('0x8')](_0x394d('0x9'),attributes,{'tableName':_0x394d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45e09d,_0x32badf,_0x5ebdc6){if(_0x45e09d['changed'](_0x394d('0xb'))){_0x45e09d['closedAt']=moment()[_0x394d('0xc')](_0x394d('0xd'));}_0x5ebdc6(null,_0x45e09d);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9f9ad86..0b52a9f 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 _0x6a91=['addTags','body','omit','ids','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','SmsInteraction,\x20%s,\x20%s','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','attributes','limit','AddTagsToSmsInteraction'];(function(_0x3e602b,_0x445e6f){var _0x100ee8=function(_0xf222f8){while(--_0xf222f8){_0x3e602b['push'](_0x3e602b['shift']());}};_0x100ee8(++_0x445e6f);}(_0x6a91,0xfc));var _0x16a9=function(_0x22340d,_0x29e79b){_0x22340d=_0x22340d-0x0;var _0xac4f48=_0x6a91[_0x22340d];return _0xac4f48;};'use strict';var _=require(_0x16a9('0x0'));var util=require('util');var moment=require(_0x16a9('0x1'));var BPromise=require(_0x16a9('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16a9('0x3'));var db=require(_0x16a9('0x4'))['db'];var utils=require(_0x16a9('0x5'));var logger=require(_0x16a9('0x6'))(_0x16a9('0x7'));var config=require(_0x16a9('0x8'));var jayson=require(_0x16a9('0x9'));var client=jayson[_0x16a9('0xa')][_0x16a9('0xb')]({'port':0x232a});config[_0x16a9('0xc')]=_[_0x16a9('0xd')](config[_0x16a9('0xc')],{'host':_0x16a9('0xe'),'port':0x18eb});var socket=require(_0x16a9('0xf'))(new Redis(config[_0x16a9('0xc')]));require('./smsInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x449058,_0x1132a3,_0x1ab724){return new BPromise(function(_0x220e46,_0x24f8dd){return client[_0x16a9('0x10')](_0x449058,_0x1ab724)['then'](function(_0x2a2650){logger[_0x16a9('0x11')](_0x16a9('0x12'),_0x1132a3,'request\x20sent');logger[_0x16a9('0x13')](_0x16a9('0x14'),_0x1132a3,_0x16a9('0x15'),JSON[_0x16a9('0x16')](_0x2a2650));if(_0x2a2650[_0x16a9('0x17')]){if(_0x2a2650[_0x16a9('0x17')][_0x16a9('0x18')]===0x1f4){logger[_0x16a9('0x17')](_0x16a9('0x12'),_0x1132a3,_0x2a2650['error'][_0x16a9('0x19')]);return _0x24f8dd(_0x2a2650['error'][_0x16a9('0x19')]);}logger[_0x16a9('0x17')](_0x16a9('0x12'),_0x1132a3,_0x2a2650[_0x16a9('0x17')]['message']);return _0x220e46(_0x2a2650[_0x16a9('0x17')][_0x16a9('0x19')]);}else{logger['info'](_0x16a9('0x12'),_0x1132a3,'request\x20sent');_0x220e46(_0x2a2650[_0x16a9('0x1a')][_0x16a9('0x19')]);}})[_0x16a9('0x1b')](function(_0x3241f4){logger[_0x16a9('0x17')](_0x16a9('0x12'),_0x1132a3,_0x3241f4);_0x24f8dd(_0x3241f4);});});}exports[_0x16a9('0x1c')]=function(_0x103cba){var _0x4f2ba9=this;return new Promise(function(_0x186840,_0x49d9d0){return db[_0x16a9('0x1d')][_0x16a9('0x1e')](_0x103cba['body'],{'raw':_0x103cba[_0x16a9('0x1f')]?_0x103cba[_0x16a9('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x103cba['options']?_0x103cba['options']['where']||null:null,'attributes':_0x103cba[_0x16a9('0x1f')]?_0x103cba[_0x16a9('0x1f')][_0x16a9('0x20')]||null:null,'limit':_0x103cba[_0x16a9('0x1f')]?_0x103cba[_0x16a9('0x1f')][_0x16a9('0x21')]||null:null})['then'](function(_0x26a4d2){logger['info']('UpdateSmsInteraction',_0x103cba);logger['debug']('UpdateSmsInteraction',_0x103cba,JSON[_0x16a9('0x16')](_0x26a4d2));_0x186840(_0x26a4d2);})[_0x16a9('0x1b')](function(_0xc5cc32){logger[_0x16a9('0x17')](_0x16a9('0x1c'),_0xc5cc32[_0x16a9('0x19')],_0x103cba);_0x49d9d0(_0x4f2ba9[_0x16a9('0x17')](0x1f4,_0xc5cc32[_0x16a9('0x19')]));});});};exports[_0x16a9('0x22')]=function(_0xf7ebad){return new Promise(function(_0x540e93,_0x5c0d65){return db['SmsInteraction']['find']({'where':_0xf7ebad['options']?_0xf7ebad['options']['where']||null:null})['then'](function(_0x236e98){if(_0x236e98){return _0x236e98[_0x16a9('0x23')](_0xf7ebad[_0x16a9('0x24')]['ids'],_[_0x16a9('0x25')](_0xf7ebad[_0x16a9('0x24')],[_0x16a9('0x26'),'id'])||{});}})[_0x16a9('0x27')](function(_0x297c1e){logger[_0x16a9('0x11')](_0x16a9('0x28'),_0xf7ebad);logger[_0x16a9('0x13')]('AddTags',_0xf7ebad,JSON[_0x16a9('0x16')](_0x297c1e));_0x540e93(_0x297c1e);})['catch'](function(_0x48e37d){logger['error'](_0x16a9('0x28'),_0x48e37d[_0x16a9('0x19')],_0xf7ebad);_0x5c0d65(_this['error'](0x1f4,_0x48e37d[_0x16a9('0x19')]));});});}; \ No newline at end of file +var _0x8d97=['result','catch','SmsInteraction','update','body','options','raw','where','attributes','limit','UpdateSmsInteraction','find','addTags','ids','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./smsInteraction.socket','register','then','info','SmsInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SmsInteraction,\x20%s,\x20%s','message'];(function(_0x1bd323,_0x1c16ab){var _0x13097b=function(_0x4cc5de){while(--_0x4cc5de){_0x1bd323['push'](_0x1bd323['shift']());}};_0x13097b(++_0x1c16ab);}(_0x8d97,0x181));var _0x78d9=function(_0x35c7ae,_0x5dd223){_0x35c7ae=_0x35c7ae-0x0;var _0x5a7764=_0x8d97[_0x35c7ae];return _0x5a7764;};'use strict';var _=require(_0x78d9('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x78d9('0x1'));var rs=require(_0x78d9('0x2'));var fs=require('fs');var Redis=require(_0x78d9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x78d9('0x4'));var logger=require('../../config/logger')(_0x78d9('0x5'));var config=require(_0x78d9('0x6'));var jayson=require(_0x78d9('0x7'));var client=jayson[_0x78d9('0x8')][_0x78d9('0x9')]({'port':0x232a});config['redis']=_[_0x78d9('0xa')](config['redis'],{'host':_0x78d9('0xb'),'port':0x18eb});var socket=require(_0x78d9('0xc'))(new Redis(config[_0x78d9('0xd')]));require(_0x78d9('0xe'))[_0x78d9('0xf')](socket);function respondWithRpcPromise(_0x2db2c1,_0x5f0ee5,_0x11131b){return new BPromise(function(_0x14203b,_0x532edc){return client['request'](_0x2db2c1,_0x11131b)[_0x78d9('0x10')](function(_0xf26248){logger[_0x78d9('0x11')]('SmsInteraction,\x20%s,\x20%s',_0x5f0ee5,'request\x20sent');logger['debug'](_0x78d9('0x12'),_0x5f0ee5,_0x78d9('0x13'),JSON[_0x78d9('0x14')](_0xf26248));if(_0xf26248[_0x78d9('0x15')]){if(_0xf26248[_0x78d9('0x15')][_0x78d9('0x16')]===0x1f4){logger[_0x78d9('0x15')](_0x78d9('0x17'),_0x5f0ee5,_0xf26248[_0x78d9('0x15')][_0x78d9('0x18')]);return _0x532edc(_0xf26248['error']['message']);}logger['error'](_0x78d9('0x17'),_0x5f0ee5,_0xf26248[_0x78d9('0x15')][_0x78d9('0x18')]);return _0x14203b(_0xf26248[_0x78d9('0x15')]['message']);}else{logger[_0x78d9('0x11')](_0x78d9('0x17'),_0x5f0ee5,_0x78d9('0x13'));_0x14203b(_0xf26248[_0x78d9('0x19')][_0x78d9('0x18')]);}})[_0x78d9('0x1a')](function(_0x17cc95){logger['error']('SmsInteraction,\x20%s,\x20%s',_0x5f0ee5,_0x17cc95);_0x532edc(_0x17cc95);});});}exports['UpdateSmsInteraction']=function(_0x5a4cf9){var _0x4752d6=this;return new Promise(function(_0x221632,_0x4fdf89){return db[_0x78d9('0x1b')][_0x78d9('0x1c')](_0x5a4cf9[_0x78d9('0x1d')],{'raw':_0x5a4cf9[_0x78d9('0x1e')]?_0x5a4cf9[_0x78d9('0x1e')][_0x78d9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a4cf9[_0x78d9('0x1e')]?_0x5a4cf9[_0x78d9('0x1e')][_0x78d9('0x20')]||null:null,'attributes':_0x5a4cf9['options']?_0x5a4cf9[_0x78d9('0x1e')][_0x78d9('0x21')]||null:null,'limit':_0x5a4cf9[_0x78d9('0x1e')]?_0x5a4cf9[_0x78d9('0x1e')][_0x78d9('0x22')]||null:null})[_0x78d9('0x10')](function(_0x46d12e){logger[_0x78d9('0x11')](_0x78d9('0x23'),_0x5a4cf9);logger['debug'](_0x78d9('0x23'),_0x5a4cf9,JSON[_0x78d9('0x14')](_0x46d12e));_0x221632(_0x46d12e);})['catch'](function(_0x1e37bd){logger[_0x78d9('0x15')](_0x78d9('0x23'),_0x1e37bd[_0x78d9('0x18')],_0x5a4cf9);_0x4fdf89(_0x4752d6[_0x78d9('0x15')](0x1f4,_0x1e37bd[_0x78d9('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x190db2){return new Promise(function(_0x1526e3,_0x54a98f){return db[_0x78d9('0x1b')][_0x78d9('0x24')]({'where':_0x190db2['options']?_0x190db2[_0x78d9('0x1e')][_0x78d9('0x20')]||null:null})['then'](function(_0x193c73){if(_0x193c73){return _0x193c73[_0x78d9('0x25')](_0x190db2[_0x78d9('0x1d')][_0x78d9('0x26')],_['omit'](_0x190db2[_0x78d9('0x1d')],['ids','id'])||{});}})[_0x78d9('0x27')](function(_0x32d94b){logger['info'](_0x78d9('0x28'),_0x190db2);logger['debug'](_0x78d9('0x28'),_0x190db2,JSON[_0x78d9('0x14')](_0x32d94b));_0x1526e3(_0x32d94b);})[_0x78d9('0x1a')](function(_0x32ea74){logger[_0x78d9('0x15')]('AddTags',_0x32ea74[_0x78d9('0x18')],_0x190db2);_0x54a98f(_this[_0x78d9('0x15')](0x1f4,_0x32ea74[_0x78d9('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 4076589..521d402 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 _0x47b2=['update','emit','register','smsInteraction:','./smsInteraction.events','save','remove'];(function(_0x185053,_0x36cd7a){var _0x50eb9c=function(_0x59f20f){while(--_0x59f20f){_0x185053['push'](_0x185053['shift']());}};_0x50eb9c(++_0x36cd7a);}(_0x47b2,0x17e));var _0x247b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47b2[_0x3dd15e];return _0x231fd0;};'use strict';var SmsInteractionEvents=require(_0x247b('0x0'));var events=[_0x247b('0x1'),_0x247b('0x2'),_0x247b('0x3')];function createListener(_0x522d5a,_0xdb6033){return function(_0x23db72){_0xdb6033[_0x247b('0x4')](_0x522d5a,_0x23db72);};}function removeListener(_0x3da2c4,_0x7846a9){return function(){SmsInteractionEvents['removeListener'](_0x3da2c4,_0x7846a9);};}exports[_0x247b('0x5')]=function(_0x242014){for(var _0x19abc4=0x0,_0x51affc=events['length'];_0x19abc4<_0x51affc;_0x19abc4++){var _0x3f6232=events[_0x19abc4];var _0x22b962=createListener(_0x247b('0x6')+_0x3f6232,_0x242014);SmsInteractionEvents['on'](_0x3f6232,_0x22b962);}}; \ No newline at end of file +var _0xd38a=['save','remove','update','emit','removeListener','register','length','./smsInteraction.events'];(function(_0x6962e6,_0x121343){var _0x6fbaa6=function(_0x581026){while(--_0x581026){_0x6962e6['push'](_0x6962e6['shift']());}};_0x6fbaa6(++_0x121343);}(_0xd38a,0xf7));var _0xad38=function(_0x34133f,_0x44d184){_0x34133f=_0x34133f-0x0;var _0x161141=_0xd38a[_0x34133f];return _0x161141;};'use strict';var SmsInteractionEvents=require(_0xad38('0x0'));var events=[_0xad38('0x1'),_0xad38('0x2'),_0xad38('0x3')];function createListener(_0x10587d,_0x12f21f){return function(_0x5738b0){_0x12f21f[_0xad38('0x4')](_0x10587d,_0x5738b0);};}function removeListener(_0xe0e626,_0x4537a8){return function(){SmsInteractionEvents[_0xad38('0x5')](_0xe0e626,_0x4537a8);};}exports[_0xad38('0x6')]=function(_0x5ee063){for(var _0x49a95f=0x0,_0x585504=events[_0xad38('0x7')];_0x49a95f<_0x585504;_0x49a95f++){var _0x4fd91c=events[_0x49a95f];var _0x4d41ec=createListener('smsInteraction:'+_0x4fd91c,_0x5ee063);SmsInteractionEvents['on'](_0x4fd91c,_0x4d41ec);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 39bfd8c..53efc66 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 _0x9480=['put','update','accept','reject','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','sms','smsmessage:create','create','/:id/status'];(function(_0x4f21da,_0x3aac70){var _0x9096f1=function(_0x27fcde){while(--_0x27fcde){_0x4f21da['push'](_0x4f21da['shift']());}};_0x9096f1(++_0x3aac70);}(_0x9480,0x77));var _0x0948=function(_0x1599b5,_0x28b24b){_0x1599b5=_0x1599b5-0x0;var _0x22b161=_0x9480[_0x1599b5];return _0x22b161;};'use strict';var multer=require(_0x0948('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0948('0x1'));var express=require(_0x0948('0x2'));var router=express[_0x0948('0x3')]();var fs_extra=require(_0x0948('0x4'));var auth=require(_0x0948('0x5'));var interaction=require(_0x0948('0x6'));var config=require(_0x0948('0x7'));var controller=require(_0x0948('0x8'));router[_0x0948('0x9')]('/',auth[_0x0948('0xa')](),controller[_0x0948('0xb')]);router[_0x0948('0x9')](_0x0948('0xc'),auth[_0x0948('0xa')](),controller[_0x0948('0xd')]);router['get'](_0x0948('0xe'),auth[_0x0948('0xa')](),controller[_0x0948('0xf')]);router[_0x0948('0x10')]('/',auth[_0x0948('0xa')](),interaction['tracked'](_0x0948('0x11'),_0x0948('0x12')),controller[_0x0948('0x13')]);router[_0x0948('0x10')](_0x0948('0x14'),controller['status']);router[_0x0948('0x15')]('/:id',auth[_0x0948('0xa')](),controller[_0x0948('0x16')]);router[_0x0948('0x15')]('/:id/accept',auth[_0x0948('0xa')](),controller[_0x0948('0x17')]);router[_0x0948('0x15')]('/:id/reject',auth[_0x0948('0xa')](),controller[_0x0948('0x18')]);router[_0x0948('0x19')](_0x0948('0xe'),auth[_0x0948('0xa')](),controller[_0x0948('0x1a')]);module[_0x0948('0x1b')]=router; \ No newline at end of file +var _0x59a5=['../../config/environment','isAuthenticated','index','get','/describe','post','sms','smsmessage:create','/:id/status','status','/:id','update','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1efa42,_0x319836){var _0x3a92db=function(_0x3734a4){while(--_0x3734a4){_0x1efa42['push'](_0x1efa42['shift']());}};_0x3a92db(++_0x319836);}(_0x59a5,0x157));var _0x559a=function(_0x198253,_0x394bc9){_0x198253=_0x198253-0x0;var _0x42c90e=_0x59a5[_0x198253];return _0x42c90e;};'use strict';var multer=require(_0x559a('0x0'));var util=require(_0x559a('0x1'));var path=require(_0x559a('0x2'));var timeout=require(_0x559a('0x3'));var express=require(_0x559a('0x4'));var router=express[_0x559a('0x5')]();var fs_extra=require(_0x559a('0x6'));var auth=require(_0x559a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x559a('0x8'));var controller=require('./smsMessage.controller');router['get']('/',auth[_0x559a('0x9')](),controller[_0x559a('0xa')]);router[_0x559a('0xb')](_0x559a('0xc'),auth[_0x559a('0x9')](),controller['describe']);router[_0x559a('0xb')]('/:id',auth[_0x559a('0x9')](),controller['show']);router[_0x559a('0xd')]('/',auth[_0x559a('0x9')](),interaction['tracked'](_0x559a('0xe'),_0x559a('0xf')),controller['create']);router['post'](_0x559a('0x10'),controller[_0x559a('0x11')]);router['put'](_0x559a('0x12'),auth[_0x559a('0x9')](),controller[_0x559a('0x13')]);router[_0x559a('0x14')](_0x559a('0x15'),auth[_0x559a('0x9')](),controller[_0x559a('0x16')]);router[_0x559a('0x14')](_0x559a('0x17'),auth[_0x559a('0x9')](),controller[_0x559a('0x18')]);router[_0x559a('0x19')]('/:id',auth[_0x559a('0x9')](),controller[_0x559a('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 7027ccb..39adce0 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 _0x1d01=['out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x1d01,0xb7));var _0x11d0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1d01[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x11d0('0x0'));module[_0x11d0('0x1')]={'body':{'type':Sequelize[_0x11d0('0x2')](_0x11d0('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x11d0('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x11d0('0x5')]('in',_0x11d0('0x6')),'defaultValue':_0x11d0('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x11d0('0x7')](0xbe)},'phone':{'type':Sequelize[_0x11d0('0x7')]},'readAt':{'type':Sequelize[_0x11d0('0x8')]},'secret':{'type':Sequelize[_0x11d0('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x11d0('0x7')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x37cb=['ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x44e94e,_0x58f002){var _0x585cc2=function(_0x5bcc9d){while(--_0x5bcc9d){_0x44e94e['push'](_0x44e94e['shift']());}};_0x585cc2(++_0x58f002);}(_0x37cb,0x12d));var _0xb37c=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0x37cb[_0x26f702];return _0x11417d;};'use strict';var Sequelize=require(_0xb37c('0x0'));module[_0xb37c('0x1')]={'body':{'type':Sequelize[_0xb37c('0x2')](_0xb37c('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xb37c('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xb37c('0x5')]('in',_0xb37c('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xb37c('0x7')]},'readAt':{'type':Sequelize[_0xb37c('0x8')]},'secret':{'type':Sequelize[_0xb37c('0x4')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xb37c('0x7')]},'providerResponse':{'type':Sequelize[_0xb37c('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 2d76e0b..61565c6 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 _0xdf62=['User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','null','contact','email','reject','SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','inspect','plivo','MessageUUID','messageId','indexOf','sent','delivered','Status','plivio','infobip','results','groupName','DELIVERED','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./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','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','includeAll','include','findAll','rows','show','params','SmsMessage','rawAttributes','merge','options','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','interaction','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT'];(function(_0x5e15bd,_0x18be10){var _0x1080e8=function(_0x455759){while(--_0x455759){_0x5e15bd['push'](_0x5e15bd['shift']());}};_0x1080e8(++_0x18be10);}(_0xdf62,0x151));var _0x2df6=function(_0x22ee3b,_0x58189b){_0x22ee3b=_0x22ee3b-0x0;var _0xe500f4=_0xdf62[_0x22ee3b];return _0xe500f4;};'use strict';var emlformat=require(_0x2df6('0x0'));var rimraf=require(_0x2df6('0x1'));var zipdir=require(_0x2df6('0x2'));var jsonpatch=require(_0x2df6('0x3'));var rp=require(_0x2df6('0x4'));var moment=require(_0x2df6('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2df6('0x6'));var path=require(_0x2df6('0x7'));var sox=require(_0x2df6('0x8'));var csv=require(_0x2df6('0x9'));var ejs=require(_0x2df6('0xa'));var fs=require('fs');var fs_extra=require(_0x2df6('0xb'));var _=require(_0x2df6('0xc'));var squel=require('squel');var crypto=require(_0x2df6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2df6('0xe'));var toCsv=require(_0x2df6('0x9'));var querystring=require(_0x2df6('0xf'));var Papa=require(_0x2df6('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2df6('0x11'));var as=require(_0x2df6('0x12'));var hardwareService=require(_0x2df6('0x13'));var logger=require(_0x2df6('0x14'))('api');var utils=require(_0x2df6('0x15'));var config=require(_0x2df6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x2df6('0x17'))['db'];config[_0x2df6('0x18')]=_[_0x2df6('0x19')](config[_0x2df6('0x18')],{'host':_0x2df6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2df6('0x18')]));require(_0x2df6('0x1b'))[_0x2df6('0x1c')](socket);var jayson=require(_0x2df6('0x1d'));var client=jayson[_0x2df6('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x2df6('0x1e')][_0x2df6('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x2cb57c,_0x3cee69,_0x42aea0,_0x496547){return new BPromise(function(_0x1be726,_0x207189){var _0x407fc5=_0x496547||client;return _0x407fc5[_0x2df6('0x20')](_0x2cb57c,_0x42aea0)[_0x2df6('0x21')](function(_0x568f45){logger[_0x2df6('0x22')](_0x2df6('0x23'),_0x3cee69,_0x2df6('0x24'));logger[_0x2df6('0x25')](_0x2df6('0x26'),_0x3cee69,_0x2df6('0x24'),JSON[_0x2df6('0x27')](_0x568f45));if(_0x568f45['error']){if(_0x568f45[_0x2df6('0x28')][_0x2df6('0x29')]===0x1f4){logger[_0x2df6('0x28')]('SmsMessage,\x20%s,\x20%s',_0x3cee69,_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);return _0x207189(_0x568f45[_0x2df6('0x28')]['message']);}logger[_0x2df6('0x28')](_0x2df6('0x23'),_0x3cee69,_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);return _0x1be726(_0x568f45[_0x2df6('0x28')][_0x2df6('0x2a')]);}else{logger[_0x2df6('0x22')](_0x2df6('0x23'),_0x3cee69,_0x2df6('0x24'));_0x1be726(_0x568f45[_0x2df6('0x2b')][_0x2df6('0x2a')]);}})[_0x2df6('0x2c')](function(_0x5b597f){logger['error'](_0x2df6('0x23'),_0x3cee69,_0x5b597f);_0x207189(_0x5b597f);});});}function respondWithStatusCode(_0x3f3d95,_0x1a017b){_0x1a017b=_0x1a017b||0xcc;return function(_0x50af3b){if(_0x50af3b){return _0x3f3d95[_0x2df6('0x2d')](_0x1a017b);}return _0x3f3d95[_0x2df6('0x2e')](_0x1a017b)['end']();};}function respondWithResult(_0x453549,_0x480735){_0x480735=_0x480735||0xc8;return function(_0x97891b){if(_0x97891b){return _0x453549['status'](_0x480735)[_0x2df6('0x2f')](_0x97891b);}};}function respondWithFilteredResult(_0x5b0a98,_0x6f25e5){return function(_0x432363){if(_0x432363){var _0x32e693=typeof _0x6f25e5[_0x2df6('0x30')]==='undefined'&&typeof _0x6f25e5[_0x2df6('0x31')]==='undefined';var _0x596e08=_0x432363[_0x2df6('0x32')];var _0x10cb77=_0x32e693?0x0:_0x6f25e5[_0x2df6('0x30')];var _0x5e0d31=_0x32e693?_0x432363[_0x2df6('0x32')]:_0x6f25e5[_0x2df6('0x30')]+_0x6f25e5[_0x2df6('0x31')];var _0x3b4727;if(_0x5e0d31>=_0x596e08){_0x5e0d31=_0x596e08;_0x3b4727=0xc8;}else{_0x3b4727=0xce;}_0x5b0a98[_0x2df6('0x2e')](_0x3b4727);return _0x5b0a98[_0x2df6('0x33')](_0x2df6('0x34'),_0x10cb77+'-'+_0x5e0d31+'/'+_0x596e08)['json'](_0x432363);}return null;};}function patchUpdates(_0x240045){return function(_0x391918){try{jsonpatch[_0x2df6('0x35')](_0x391918,_0x240045,!![]);}catch(_0xadb1d9){return BPromise['reject'](_0xadb1d9);}return _0x391918[_0x2df6('0x36')]();};}function saveUpdates(_0x485610,_0x5cb066){return function(_0x38f523){if(_0x38f523){return _0x38f523[_0x2df6('0x37')](_0x485610)[_0x2df6('0x21')](function(_0x880bbe){return _0x880bbe;});}return null;};}function removeEntity(_0x52f913,_0x1f29b1){return function(_0x8cf54b){if(_0x8cf54b){return _0x8cf54b[_0x2df6('0x38')]()[_0x2df6('0x21')](function(){_0x52f913[_0x2df6('0x2e')](0xcc)[_0x2df6('0x39')]();});}};}function handleEntityNotFound(_0x5a2ae5,_0xb50c95){return function(_0xa7f7dd){if(!_0xa7f7dd){_0x5a2ae5['sendStatus'](0x194);}return _0xa7f7dd;};}function handleError(_0x303cc3,_0x3835b3){_0x3835b3=_0x3835b3||0x1f4;return function(_0x2e7b71){logger[_0x2df6('0x28')](_0x2e7b71[_0x2df6('0x3a')]);if(_0x2e7b71[_0x2df6('0x3b')]){delete _0x2e7b71['name'];}_0x303cc3[_0x2df6('0x2e')](_0x3835b3)[_0x2df6('0x3c')](_0x2e7b71);};}exports[_0x2df6('0x3d')]=function(_0x20f627,_0x392d46){var _0x3dabfd={},_0x5f16c3={},_0x53c32d={'count':0x0,'rows':[]};var _0x2334c9=_['map'](db['SmsMessage']['rawAttributes'],function(_0x25163d){return{'name':_0x25163d[_0x2df6('0x3e')],'type':_0x25163d['type'][_0x2df6('0x3f')]};});_0x5f16c3[_0x2df6('0x40')]=_[_0x2df6('0x41')](_0x2334c9,_0x2df6('0x3b'));_0x5f16c3[_0x2df6('0x42')]=_[_0x2df6('0x43')](_0x20f627['query']);_0x5f16c3['filters']=_['intersection'](_0x5f16c3[_0x2df6('0x40')],_0x5f16c3[_0x2df6('0x42')]);_0x3dabfd['attributes']=_[_0x2df6('0x44')](_0x5f16c3[_0x2df6('0x40')],qs[_0x2df6('0x45')](_0x20f627['query'][_0x2df6('0x45')]));_0x3dabfd[_0x2df6('0x46')]=_0x3dabfd[_0x2df6('0x46')][_0x2df6('0x47')]?_0x3dabfd['attributes']:_0x5f16c3[_0x2df6('0x40')];if(!_0x20f627[_0x2df6('0x42')][_0x2df6('0x48')](_0x2df6('0x49'))){_0x3dabfd[_0x2df6('0x31')]=qs['limit'](_0x20f627[_0x2df6('0x42')][_0x2df6('0x31')]);_0x3dabfd[_0x2df6('0x30')]=qs['offset'](_0x20f627[_0x2df6('0x42')][_0x2df6('0x30')]);}_0x3dabfd['order']=qs[_0x2df6('0x4a')](_0x20f627[_0x2df6('0x42')][_0x2df6('0x4a')]);_0x3dabfd[_0x2df6('0x4b')]=qs[_0x2df6('0x4c')](_[_0x2df6('0x4d')](_0x20f627[_0x2df6('0x42')],_0x5f16c3[_0x2df6('0x4c')]),_0x2334c9);if(_0x20f627['query'][_0x2df6('0x4e')]){_0x3dabfd['where']=_['merge'](_0x3dabfd[_0x2df6('0x4b')],{'$or':_[_0x2df6('0x41')](_0x2334c9,function(_0x41ad7f){if(_0x41ad7f[_0x2df6('0x4f')]!==_0x2df6('0x50')){var _0x47d2ef={};_0x47d2ef[_0x41ad7f['name']]={'$like':'%'+_0x20f627[_0x2df6('0x42')]['filter']+'%'};return _0x47d2ef;}})});}_0x3dabfd=_['merge']({},_0x3dabfd,_0x20f627['options']);var _0x20c032={'where':_0x3dabfd[_0x2df6('0x4b')]};return db['SmsMessage'][_0x2df6('0x32')](_0x20c032)[_0x2df6('0x21')](function(_0x5af9f8){_0x53c32d['count']=_0x5af9f8;if(_0x20f627[_0x2df6('0x42')][_0x2df6('0x51')]){_0x3dabfd[_0x2df6('0x52')]=[{'all':!![]}];}return db['SmsMessage'][_0x2df6('0x53')](_0x3dabfd);})[_0x2df6('0x21')](function(_0x16bcce){_0x53c32d[_0x2df6('0x54')]=_0x16bcce;return _0x53c32d;})[_0x2df6('0x21')](respondWithFilteredResult(_0x392d46,_0x3dabfd))['catch'](handleError(_0x392d46,null));};exports[_0x2df6('0x55')]=function(_0x5933af,_0x428db0){var _0x192ad7={'raw':!![],'where':{'id':_0x5933af[_0x2df6('0x56')]['id']}},_0xcd49ce={};_0xcd49ce[_0x2df6('0x40')]=_['keys'](db[_0x2df6('0x57')][_0x2df6('0x58')]);_0xcd49ce[_0x2df6('0x42')]=_[_0x2df6('0x43')](_0x5933af['query']);_0xcd49ce['filters']=_[_0x2df6('0x44')](_0xcd49ce[_0x2df6('0x40')],_0xcd49ce[_0x2df6('0x42')]);_0x192ad7[_0x2df6('0x46')]=_[_0x2df6('0x44')](_0xcd49ce['model'],qs['fields'](_0x5933af[_0x2df6('0x42')][_0x2df6('0x45')]));_0x192ad7['attributes']=_0x192ad7['attributes']['length']?_0x192ad7['attributes']:_0xcd49ce['model'];if(_0x5933af[_0x2df6('0x42')]['includeAll']){_0x192ad7[_0x2df6('0x52')]=[{'all':!![]}];}_0x192ad7=_[_0x2df6('0x59')]({},_0x192ad7,_0x5933af[_0x2df6('0x5a')]);return db[_0x2df6('0x57')][_0x2df6('0x5b')](_0x192ad7)[_0x2df6('0x21')](handleEntityNotFound(_0x428db0,null))[_0x2df6('0x21')](respondWithResult(_0x428db0,null))[_0x2df6('0x2c')](handleError(_0x428db0,null));};exports[_0x2df6('0x5c')]=function(_0x5d2f50,_0x1d59c4){return db[_0x2df6('0x57')][_0x2df6('0x5c')](_0x5d2f50[_0x2df6('0x5d')],{})['then'](respondWithResult(_0x1d59c4,0xc9))['catch'](handleError(_0x1d59c4,null));};exports['update']=function(_0x22005b,_0x45a633){if(_0x22005b[_0x2df6('0x5d')]['id']){delete _0x22005b['body']['id'];}return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x22005b[_0x2df6('0x56')]['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x45a633,null))[_0x2df6('0x21')](saveUpdates(_0x22005b[_0x2df6('0x5d')],null))[_0x2df6('0x21')](respondWithResult(_0x45a633,null))[_0x2df6('0x2c')](handleError(_0x45a633,null));};exports[_0x2df6('0x38')]=function(_0x2d67f4,_0x4da05d){return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x2d67f4[_0x2df6('0x56')]['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x4da05d,null))[_0x2df6('0x21')](removeEntity(_0x4da05d,null))['catch'](handleError(_0x4da05d,null));};exports['describe']=function(_0xfcf4d8,_0x326a20){return db[_0x2df6('0x57')][_0x2df6('0x5e')]()[_0x2df6('0x21')](respondWithResult(_0x326a20,null))[_0x2df6('0x2c')](handleError(_0x326a20,null));};var interaction_log=require(_0x2df6('0x14'))(_0x2df6('0x5f'));exports[_0x2df6('0x60')]=function(_0x2a3fb1,_0x387399,_0x3de4fe){var _0x42c4f9={'agent':{},'channel':_0x2df6('0x61')};if(_0x2a3fb1[_0x2df6('0x5d')]['id']){delete _0x2a3fb1[_0x2df6('0x5d')]['id'];}_0x2a3fb1['body'][_0x2df6('0x62')]=!![];_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x63')]=moment()[_0x2df6('0x64')](_0x2df6('0x65'));_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')]=_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')]||_0x2a3fb1[_0x2df6('0x67')]['id'];_0x42c4f9[_0x2df6('0x68')]['id']=_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')];return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x2a3fb1['params']['id'],'UserId':null}})[_0x2df6('0x21')](handleEntityNotFound(_0x387399,null))['then'](saveUpdates(_0x2a3fb1[_0x2df6('0x5d')],null))[_0x2df6('0x21')](function(_0x2b29c7){if(_0x2b29c7){_0x42c4f9[_0x2df6('0x2a')]=_0x2b29c7[_0x2df6('0x69')]({'plain':!![]});return db[_0x2df6('0x6a')][_0x2df6('0x5b')]({'where':{'id':_0x2b29c7[_0x2df6('0x6b')]}});}return null;})[_0x2df6('0x21')](handleEntityNotFound(_0x387399,null))[_0x2df6('0x21')](function(_0xf5aa49){if(_0xf5aa49){return _0xf5aa49['update']({'UserId':_0x2a3fb1['body'][_0x2df6('0x66')],'read1stAt':_[_0x2df6('0x6c')](_0xf5aa49['read1stAt'])?moment()[_0x2df6('0x64')](_0x2df6('0x65')):undefined});}return null;})[_0x2df6('0x21')](function(_0x310015){if(_0x310015){_0x42c4f9[_0x2df6('0x6d')]=_0x310015['get']({'plain':!![]});interaction_log[_0x2df6('0x22')]('[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2a3fb1[_0x2df6('0x67')]['id'],_0x2a3fb1[_0x2df6('0x67')][_0x2df6('0x3b')],_0x2a3fb1[_0x2df6('0x67')][_0x2df6('0x6e')],_0x42c4f9[_0x2df6('0x6d')]['id'],_0x2a3fb1[_0x2df6('0x5d')]?JSON['stringify'](_0x2a3fb1['body']):'null');return respondWithRpcPromise(_0x2df6('0x6f'),_0x2df6('0x70'),_0x42c4f9);}return null;})['then'](function(_0x47bb6d){var _0x12fee0=_0x2df6('0x71')+_0x47bb6d[_0x2df6('0x2a')][_0x2df6('0x72')];return db[_0x2df6('0x73')][_0x2df6('0x42')](_0x12fee0,{'type':db[_0x2df6('0x74')][_0x2df6('0x75')][_0x2df6('0x76')],'raw':!![]})['then'](function(_0x387b97){return _0x387b97;});})[_0x2df6('0x21')](function(_0x2750f0){if(_0x2750f0){_0x42c4f9[_0x2df6('0x2a')]['contact']=_0x2750f0[0x0];if(!_0x2a3fb1[_0x2df6('0x5d')]['UserId'])return;return db[_0x2df6('0x77')]['find']({'where':{'id':_0x2a3fb1[_0x2df6('0x5d')][_0x2df6('0x66')],'role':_0x2df6('0x68')},'attributes':['id',_0x2df6('0x3b'),_0x2df6('0x78'),'email',_0x2df6('0x79')],'raw':!![]});}return null;})['then'](function(_0x36ec0a){if(!_0x36ec0a)return null;_0x42c4f9[_0x2df6('0x2a')]['agent']=_0x36ec0a;return _0x42c4f9;})[_0x2df6('0x21')](function(_0x49a920){if(_0x49a920){if(_0x2a3fb1['body'][_0x2df6('0x7a')]){_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7b')]=util[_0x2df6('0x64')](_0x2df6('0x7c'),_0x2a3fb1['user'][_0x2df6('0x3b')]);_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7d')]=_0x42c4f9[_0x2df6('0x7d')];_0x42c4f9[_0x2df6('0x2a')][_0x2df6('0x7e')]=_0x42c4f9[_0x2df6('0x7d')];_0x42c4f9['message'][_0x2df6('0x7f')]=_0x2df6('0x60');return respondWithRpcPromise(_0x2df6('0x80'),_0x2df6('0x80'),{'event':'acceptmessage','message':_0x42c4f9[_0x2df6('0x2a')]},client9002)[_0x2df6('0x21')](function(){return _0x42c4f9;});}return _0x42c4f9;}return null;})[_0x2df6('0x21')](respondWithResult(_0x387399,null))['catch'](handleError(_0x387399,null));};var interaction_log=require(_0x2df6('0x14'))('sms-interactions');exports['reject']=function(_0x440df6,_0x2d4ccc,_0x383310){var _0x1bf46f={'agent':{},'channel':_0x2df6('0x61')};if(_0x440df6[_0x2df6('0x5d')]['id']){delete _0x440df6[_0x2df6('0x5d')]['id'];}_0x440df6['body'][_0x2df6('0x66')]=_0x440df6[_0x2df6('0x5d')][_0x2df6('0x66')]||_0x440df6[_0x2df6('0x67')]['id'];_0x1bf46f[_0x2df6('0x68')]['id']=_0x440df6[_0x2df6('0x5d')]['UserId'];return db[_0x2df6('0x57')][_0x2df6('0x5b')]({'where':{'id':_0x440df6[_0x2df6('0x56')]['id'],'UserId':null}})[_0x2df6('0x21')](handleEntityNotFound(_0x2d4ccc,null))[_0x2df6('0x21')](function(_0x5a0b3c){if(_0x5a0b3c){_0x1bf46f[_0x2df6('0x2a')]=_0x5a0b3c['get']({'plain':!![]});return db['SmsInteraction'][_0x2df6('0x5b')]({'where':{'id':_0x5a0b3c['SmsInteractionId']}});}return null;})[_0x2df6('0x21')](handleEntityNotFound(_0x2d4ccc,null))[_0x2df6('0x21')](function(_0x1f50c7){if(_0x1f50c7){_0x1bf46f[_0x2df6('0x6d')]=_0x1f50c7[_0x2df6('0x69')]({'plain':!![]});interaction_log[_0x2df6('0x22')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x440df6[_0x2df6('0x67')]['id'],_0x440df6['user']['name'],_0x440df6[_0x2df6('0x67')]['role'],_0x1bf46f[_0x2df6('0x6d')]['id'],_0x440df6['body']?JSON[_0x2df6('0x27')](_0x440df6[_0x2df6('0x5d')]):_0x2df6('0x81'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x1bf46f);}return null;})[_0x2df6('0x21')](function(_0x13169f){var _0x366d63='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x13169f[_0x2df6('0x2a')][_0x2df6('0x72')];return db[_0x2df6('0x73')][_0x2df6('0x42')](_0x366d63,{'type':db[_0x2df6('0x74')][_0x2df6('0x75')][_0x2df6('0x76')],'raw':!![]})[_0x2df6('0x21')](function(_0xe72303){return _0xe72303;});})['then'](function(_0x331ead){if(_0x331ead){_0x1bf46f[_0x2df6('0x2a')][_0x2df6('0x82')]=_0x331ead[0x0];if(!_0x440df6[_0x2df6('0x5d')][_0x2df6('0x66')])return;return db[_0x2df6('0x77')][_0x2df6('0x5b')]({'where':{'id':_0x440df6['body'][_0x2df6('0x66')],'role':'agent'},'attributes':['id',_0x2df6('0x3b'),_0x2df6('0x78'),_0x2df6('0x83'),_0x2df6('0x79')],'raw':!![]});}return null;})[_0x2df6('0x21')](function(_0x36881c){if(!_0x36881c)return null;_0x1bf46f[_0x2df6('0x2a')][_0x2df6('0x68')]=_0x36881c;return _0x1bf46f;})[_0x2df6('0x21')](function(_0xb30064){if(_0xb30064){_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7b')]=util[_0x2df6('0x64')](_0x2df6('0x7c'),_0x440df6[_0x2df6('0x67')][_0x2df6('0x3b')]);_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7d')]=_0x1bf46f[_0x2df6('0x7d')];_0xb30064[_0x2df6('0x2a')][_0x2df6('0x7e')]=_0x1bf46f['channel'];_0xb30064[_0x2df6('0x2a')]['event']=_0x2df6('0x84');respondWithRpcPromise(_0x2df6('0x80'),'EventManager',{'event':'rejectmessage','message':_0xb30064[_0x2df6('0x2a')]},client9002);return _0x1bf46f;}return null;})[_0x2df6('0x21')](respondWithResult(_0x2d4ccc,null))['catch'](handleError(_0x2d4ccc,null));};exports['status']=function(_0x385521,_0x1e116b,_0x2c3dbd){if(_0x385521['body']['id']){delete _0x385521[_0x2df6('0x5d')]['id'];}var _0x481235;return db['SmsMessage'][_0x2df6('0x5b')]({'where':{'id':_0x385521['params']['id']}})[_0x2df6('0x21')](handleEntityNotFound(_0x1e116b,null))[_0x2df6('0x21')](function(_0x3dbe98){if(_0x3dbe98){_0x481235=_0x3dbe98;return db[_0x2df6('0x85')][_0x2df6('0x5b')]({'where':{'id':_0x3dbe98[_0x2df6('0x86')]}});}})['then'](handleEntityNotFound(_0x1e116b,null))[_0x2df6('0x21')](function(_0x3f81c4){if(_0x3f81c4){logger[_0x2df6('0x25')](_0x2df6('0x26'),_0x2df6('0x2e'),_0x2df6('0x87'),_0x3f81c4[_0x2df6('0x4f')],util['inspect'](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));switch(_0x3f81c4[_0x2df6('0x4f')]){case _0x2df6('0x88'):if(_0x385521[_0x2df6('0x5d')]['MessageSid']&&_0x385521[_0x2df6('0x5d')][_0x2df6('0x89')]===_0x481235['messageId']){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error'](_0x2df6('0x8a'),_0x2df6('0x2e'),_0x2df6('0x88'),util[_0x2df6('0x8b')](_0x385521['body'],{'showHidden':![],'depth':null}));}break;case _0x2df6('0x8c'):if(_0x385521[_0x2df6('0x5d')][_0x2df6('0x8d')]&&_0x385521['body'][_0x2df6('0x8d')]===_0x481235[_0x2df6('0x8e')]&&_[_0x2df6('0x8f')]([_0x2df6('0x90'),_0x2df6('0x91')],_0x385521[_0x2df6('0x5d')][_0x2df6('0x92')])>=0x0){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error'](_0x2df6('0x8a'),_0x2df6('0x2e'),_0x2df6('0x93'),util[_0x2df6('0x8b')](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x2df6('0x94'):var _0x4688f7=_0x385521['body'][_0x2df6('0x95')][0x0];if(_0x4688f7['status'][_0x2df6('0x96')]===_0x2df6('0x97')){return _0x481235[_0x2df6('0x37')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x2df6('0x94'),util[_0x2df6('0x8b')](_0x385521[_0x2df6('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0x481235;}})[_0x2df6('0x21')](respondWithResult(_0x1e116b,null))[_0x2df6('0x2c')](handleError(_0x1e116b,null));}; \ No newline at end of file +var _0xd1d3=['merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','body','describe','sms-interactions','accept','sms','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','SmsInteraction','format','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','stringify','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','User','fullname','internal','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','get','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','QueryTypes','contact','email','motionChannel','rejectmessage','SmsAccountId','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','twilio','MessageSid','messageId','plivo','MessageUUID','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','infobip','results','groupName','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','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','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','map','SmsMessage','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter'];(function(_0xbca1eb,_0x1372e9){var _0x1b80b6=function(_0xbcd483){while(--_0xbcd483){_0xbca1eb['push'](_0xbca1eb['shift']());}};_0x1b80b6(++_0x1372e9);}(_0xd1d3,0xd7));var _0x3d1d=function(_0x2991d8,_0x3cd07f){_0x2991d8=_0x2991d8-0x0;var _0x2c1363=_0xd1d3[_0x2991d8];return _0x2c1363;};'use strict';var emlformat=require(_0x3d1d('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3d1d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3d1d('0x2'));var moment=require(_0x3d1d('0x3'));var BPromise=require(_0x3d1d('0x4'));var Mustache=require(_0x3d1d('0x5'));var util=require(_0x3d1d('0x6'));var path=require('path');var sox=require(_0x3d1d('0x7'));var csv=require(_0x3d1d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3d1d('0x9'));var _=require(_0x3d1d('0xa'));var squel=require('squel');var crypto=require(_0x3d1d('0xb'));var jsforce=require(_0x3d1d('0xc'));var deskjs=require(_0x3d1d('0xd'));var toCsv=require(_0x3d1d('0x8'));var querystring=require(_0x3d1d('0xe'));var Papa=require(_0x3d1d('0xf'));var Redis=require(_0x3d1d('0x10'));var authService=require(_0x3d1d('0x11'));var qs=require(_0x3d1d('0x12'));var as=require(_0x3d1d('0x13'));var hardwareService=require(_0x3d1d('0x14'));var logger=require(_0x3d1d('0x15'))(_0x3d1d('0x16'));var utils=require(_0x3d1d('0x17'));var config=require(_0x3d1d('0x18'));var licenseUtil=require(_0x3d1d('0x19'));var db=require(_0x3d1d('0x1a'))['db'];config[_0x3d1d('0x1b')]=_[_0x3d1d('0x1c')](config['redis'],{'host':_0x3d1d('0x1d'),'port':0x18eb});var socket=require(_0x3d1d('0x1e'))(new Redis(config[_0x3d1d('0x1b')]));require(_0x3d1d('0x1f'))[_0x3d1d('0x20')](socket);var jayson=require(_0x3d1d('0x21'));var client=jayson[_0x3d1d('0x22')][_0x3d1d('0x23')]({'port':0x232c});var client9002=jayson['client'][_0x3d1d('0x23')]({'port':0x232a});function respondWithRpcPromise(_0x128f51,_0x5d6a51,_0x5786df,_0x3b30bd){return new BPromise(function(_0x2c9c51,_0x1e71cf){var _0x2f984c=_0x3b30bd||client;return _0x2f984c['request'](_0x128f51,_0x5786df)[_0x3d1d('0x24')](function(_0x46bc02){logger[_0x3d1d('0x25')](_0x3d1d('0x26'),_0x5d6a51,_0x3d1d('0x27'));logger[_0x3d1d('0x28')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x5d6a51,'request\x20sent',JSON['stringify'](_0x46bc02));if(_0x46bc02[_0x3d1d('0x29')]){if(_0x46bc02[_0x3d1d('0x29')][_0x3d1d('0x2a')]===0x1f4){logger[_0x3d1d('0x29')](_0x3d1d('0x26'),_0x5d6a51,_0x46bc02[_0x3d1d('0x29')][_0x3d1d('0x2b')]);return _0x1e71cf(_0x46bc02[_0x3d1d('0x29')][_0x3d1d('0x2b')]);}logger['error'](_0x3d1d('0x26'),_0x5d6a51,_0x46bc02[_0x3d1d('0x29')][_0x3d1d('0x2b')]);return _0x2c9c51(_0x46bc02[_0x3d1d('0x29')]['message']);}else{logger[_0x3d1d('0x25')](_0x3d1d('0x26'),_0x5d6a51,_0x3d1d('0x27'));_0x2c9c51(_0x46bc02[_0x3d1d('0x2c')][_0x3d1d('0x2b')]);}})['catch'](function(_0xb56ae1){logger[_0x3d1d('0x29')](_0x3d1d('0x26'),_0x5d6a51,_0xb56ae1);_0x1e71cf(_0xb56ae1);});});}function respondWithStatusCode(_0x2e0339,_0x2f644c){_0x2f644c=_0x2f644c||0xcc;return function(_0xbda25a){if(_0xbda25a){return _0x2e0339['sendStatus'](_0x2f644c);}return _0x2e0339['status'](_0x2f644c)['end']();};}function respondWithResult(_0x2feb04,_0x2a983f){_0x2a983f=_0x2a983f||0xc8;return function(_0x1a09ca){if(_0x1a09ca){return _0x2feb04[_0x3d1d('0x2d')](_0x2a983f)['json'](_0x1a09ca);}};}function respondWithFilteredResult(_0x4a4623,_0x8aaf8){return function(_0x5ea525){if(_0x5ea525){var _0x181d71=typeof _0x8aaf8[_0x3d1d('0x2e')]===_0x3d1d('0x2f')&&typeof _0x8aaf8[_0x3d1d('0x30')]===_0x3d1d('0x2f');var _0x151ded=_0x5ea525[_0x3d1d('0x31')];var _0x635ca5=_0x181d71?0x0:_0x8aaf8[_0x3d1d('0x2e')];var _0x58b541=_0x181d71?_0x5ea525[_0x3d1d('0x31')]:_0x8aaf8[_0x3d1d('0x2e')]+_0x8aaf8[_0x3d1d('0x30')];var _0xdaab2;if(_0x58b541>=_0x151ded){_0x58b541=_0x151ded;_0xdaab2=0xc8;}else{_0xdaab2=0xce;}_0x4a4623[_0x3d1d('0x2d')](_0xdaab2);return _0x4a4623[_0x3d1d('0x32')](_0x3d1d('0x33'),_0x635ca5+'-'+_0x58b541+'/'+_0x151ded)[_0x3d1d('0x34')](_0x5ea525);}return null;};}function patchUpdates(_0x4cb019){return function(_0x2b3bd3){try{jsonpatch[_0x3d1d('0x35')](_0x2b3bd3,_0x4cb019,!![]);}catch(_0xf53b40){return BPromise[_0x3d1d('0x36')](_0xf53b40);}return _0x2b3bd3[_0x3d1d('0x37')]();};}function saveUpdates(_0x26033e,_0x148c7c){return function(_0x67334f){if(_0x67334f){return _0x67334f[_0x3d1d('0x38')](_0x26033e)[_0x3d1d('0x24')](function(_0x5d81bc){return _0x5d81bc;});}return null;};}function removeEntity(_0x277e30,_0xe89e2c){return function(_0x144f00){if(_0x144f00){return _0x144f00[_0x3d1d('0x39')]()[_0x3d1d('0x24')](function(){_0x277e30[_0x3d1d('0x2d')](0xcc)[_0x3d1d('0x3a')]();});}};}function handleEntityNotFound(_0x2cdf4,_0x3bc7fc){return function(_0xe1cb4b){if(!_0xe1cb4b){_0x2cdf4[_0x3d1d('0x3b')](0x194);}return _0xe1cb4b;};}function handleError(_0x42070c,_0x55f854){_0x55f854=_0x55f854||0x1f4;return function(_0x375022){logger[_0x3d1d('0x29')](_0x375022[_0x3d1d('0x3c')]);if(_0x375022['name']){delete _0x375022[_0x3d1d('0x3d')];}_0x42070c[_0x3d1d('0x2d')](_0x55f854)[_0x3d1d('0x3e')](_0x375022);};}exports['index']=function(_0x4c9b95,_0x242493){var _0x4ed442={},_0x55dbfe={},_0xa29477={'count':0x0,'rows':[]};var _0x1b9a64=_[_0x3d1d('0x3f')](db[_0x3d1d('0x40')]['rawAttributes'],function(_0x2fd994){return{'name':_0x2fd994[_0x3d1d('0x41')],'type':_0x2fd994[_0x3d1d('0x42')]['key']};});_0x55dbfe[_0x3d1d('0x43')]=_[_0x3d1d('0x3f')](_0x1b9a64,_0x3d1d('0x3d'));_0x55dbfe[_0x3d1d('0x44')]=_[_0x3d1d('0x45')](_0x4c9b95[_0x3d1d('0x44')]);_0x55dbfe[_0x3d1d('0x46')]=_['intersection'](_0x55dbfe[_0x3d1d('0x43')],_0x55dbfe[_0x3d1d('0x44')]);_0x4ed442[_0x3d1d('0x47')]=_[_0x3d1d('0x48')](_0x55dbfe[_0x3d1d('0x43')],qs[_0x3d1d('0x49')](_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x49')]));_0x4ed442[_0x3d1d('0x47')]=_0x4ed442[_0x3d1d('0x47')][_0x3d1d('0x4a')]?_0x4ed442[_0x3d1d('0x47')]:_0x55dbfe['model'];if(!_0x4c9b95['query'][_0x3d1d('0x4b')]('nolimit')){_0x4ed442[_0x3d1d('0x30')]=qs['limit'](_0x4c9b95['query'][_0x3d1d('0x30')]);_0x4ed442[_0x3d1d('0x2e')]=qs[_0x3d1d('0x2e')](_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x2e')]);}_0x4ed442[_0x3d1d('0x4c')]=qs[_0x3d1d('0x4d')](_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x4d')]);_0x4ed442[_0x3d1d('0x4e')]=qs[_0x3d1d('0x46')](_[_0x3d1d('0x4f')](_0x4c9b95[_0x3d1d('0x44')],_0x55dbfe['filters']),_0x1b9a64);if(_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x50')]){_0x4ed442[_0x3d1d('0x4e')]=_[_0x3d1d('0x51')](_0x4ed442[_0x3d1d('0x4e')],{'$or':_[_0x3d1d('0x3f')](_0x1b9a64,function(_0x3b4c8b){if(_0x3b4c8b['type']!=='VIRTUAL'){var _0x49d438={};_0x49d438[_0x3b4c8b[_0x3d1d('0x3d')]]={'$like':'%'+_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x50')]+'%'};return _0x49d438;}})});}_0x4ed442=_['merge']({},_0x4ed442,_0x4c9b95[_0x3d1d('0x52')]);var _0x594c4b={'where':_0x4ed442[_0x3d1d('0x4e')]};return db[_0x3d1d('0x40')][_0x3d1d('0x31')](_0x594c4b)[_0x3d1d('0x24')](function(_0x46dd5a){_0xa29477[_0x3d1d('0x31')]=_0x46dd5a;if(_0x4c9b95[_0x3d1d('0x44')][_0x3d1d('0x53')]){_0x4ed442[_0x3d1d('0x54')]=[{'all':!![]}];}return db[_0x3d1d('0x40')][_0x3d1d('0x55')](_0x4ed442);})['then'](function(_0x48c88f){_0xa29477[_0x3d1d('0x56')]=_0x48c88f;return _0xa29477;})[_0x3d1d('0x24')](respondWithFilteredResult(_0x242493,_0x4ed442))['catch'](handleError(_0x242493,null));};exports[_0x3d1d('0x57')]=function(_0x27e811,_0x1d63a3){var _0xe4673={'raw':!![],'where':{'id':_0x27e811[_0x3d1d('0x58')]['id']}},_0x157625={};_0x157625[_0x3d1d('0x43')]=_[_0x3d1d('0x45')](db[_0x3d1d('0x40')][_0x3d1d('0x59')]);_0x157625['query']=_[_0x3d1d('0x45')](_0x27e811[_0x3d1d('0x44')]);_0x157625['filters']=_[_0x3d1d('0x48')](_0x157625[_0x3d1d('0x43')],_0x157625[_0x3d1d('0x44')]);_0xe4673['attributes']=_[_0x3d1d('0x48')](_0x157625['model'],qs['fields'](_0x27e811['query'][_0x3d1d('0x49')]));_0xe4673[_0x3d1d('0x47')]=_0xe4673[_0x3d1d('0x47')][_0x3d1d('0x4a')]?_0xe4673[_0x3d1d('0x47')]:_0x157625['model'];if(_0x27e811[_0x3d1d('0x44')][_0x3d1d('0x53')]){_0xe4673['include']=[{'all':!![]}];}_0xe4673=_['merge']({},_0xe4673,_0x27e811[_0x3d1d('0x52')]);return db[_0x3d1d('0x40')][_0x3d1d('0x5a')](_0xe4673)['then'](handleEntityNotFound(_0x1d63a3,null))[_0x3d1d('0x24')](respondWithResult(_0x1d63a3,null))[_0x3d1d('0x5b')](handleError(_0x1d63a3,null));};exports['create']=function(_0x7c50a4,_0x2f5a9d){return db[_0x3d1d('0x40')]['create'](_0x7c50a4[_0x3d1d('0x5c')],{})[_0x3d1d('0x24')](respondWithResult(_0x2f5a9d,0xc9))[_0x3d1d('0x5b')](handleError(_0x2f5a9d,null));};exports['update']=function(_0x29fe3b,_0x4ca554){if(_0x29fe3b['body']['id']){delete _0x29fe3b[_0x3d1d('0x5c')]['id'];}return db[_0x3d1d('0x40')]['find']({'where':{'id':_0x29fe3b[_0x3d1d('0x58')]['id']}})['then'](handleEntityNotFound(_0x4ca554,null))[_0x3d1d('0x24')](saveUpdates(_0x29fe3b['body'],null))[_0x3d1d('0x24')](respondWithResult(_0x4ca554,null))['catch'](handleError(_0x4ca554,null));};exports[_0x3d1d('0x39')]=function(_0x4847c0,_0xbab993){return db[_0x3d1d('0x40')][_0x3d1d('0x5a')]({'where':{'id':_0x4847c0[_0x3d1d('0x58')]['id']}})[_0x3d1d('0x24')](handleEntityNotFound(_0xbab993,null))[_0x3d1d('0x24')](removeEntity(_0xbab993,null))['catch'](handleError(_0xbab993,null));};exports[_0x3d1d('0x5d')]=function(_0x202677,_0x186529){return db[_0x3d1d('0x40')]['describe']()[_0x3d1d('0x24')](respondWithResult(_0x186529,null))[_0x3d1d('0x5b')](handleError(_0x186529,null));};var interaction_log=require(_0x3d1d('0x15'))(_0x3d1d('0x5e'));exports[_0x3d1d('0x5f')]=function(_0x2fbbff,_0x4d05cf,_0x417600){var _0x5d3015={'agent':{},'channel':_0x3d1d('0x60')};if(_0x2fbbff[_0x3d1d('0x5c')]['id']){delete _0x2fbbff[_0x3d1d('0x5c')]['id'];}_0x2fbbff[_0x3d1d('0x5c')]['read']=!![];_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x61')]=moment()['format'](_0x3d1d('0x62'));_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x63')]=_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x63')]||_0x2fbbff['user']['id'];_0x5d3015[_0x3d1d('0x64')]['id']=_0x2fbbff['body'][_0x3d1d('0x63')];return db[_0x3d1d('0x40')][_0x3d1d('0x5a')]({'where':{'id':_0x2fbbff[_0x3d1d('0x58')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4d05cf,null))['then'](saveUpdates(_0x2fbbff['body'],null))[_0x3d1d('0x24')](function(_0x4b8066){if(_0x4b8066){_0x5d3015[_0x3d1d('0x2b')]=_0x4b8066['get']({'plain':!![]});return db[_0x3d1d('0x65')][_0x3d1d('0x5a')]({'where':{'id':_0x4b8066['SmsInteractionId']}});}return null;})[_0x3d1d('0x24')](handleEntityNotFound(_0x4d05cf,null))[_0x3d1d('0x24')](function(_0x4ad51b){if(_0x4ad51b){return _0x4ad51b[_0x3d1d('0x38')]({'UserId':_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x63')],'read1stAt':_['isNil'](_0x4ad51b['read1stAt'])?moment()[_0x3d1d('0x66')](_0x3d1d('0x62')):undefined});}return null;})['then'](function(_0x4c60cf){if(_0x4c60cf){_0x5d3015['interaction']=_0x4c60cf['get']({'plain':!![]});interaction_log[_0x3d1d('0x25')](_0x3d1d('0x67'),_0x2fbbff['user']['id'],_0x2fbbff[_0x3d1d('0x68')][_0x3d1d('0x3d')],_0x2fbbff[_0x3d1d('0x68')][_0x3d1d('0x69')],_0x5d3015[_0x3d1d('0x6a')]['id'],_0x2fbbff[_0x3d1d('0x5c')]?JSON[_0x3d1d('0x6b')](_0x2fbbff['body']):_0x3d1d('0x6c'));return respondWithRpcPromise(_0x3d1d('0x6d'),_0x3d1d('0x6e'),_0x5d3015);}return null;})['then'](function(_0x531e23){var _0x38fdc3=_0x3d1d('0x6f')+_0x531e23[_0x3d1d('0x2b')][_0x3d1d('0x70')];return db[_0x3d1d('0x71')][_0x3d1d('0x44')](_0x38fdc3,{'type':db[_0x3d1d('0x72')]['QueryTypes']['SELECT'],'raw':!![]})[_0x3d1d('0x24')](function(_0x2b352a){return _0x2b352a;});})[_0x3d1d('0x24')](function(_0x5e166b){if(_0x5e166b){_0x5d3015[_0x3d1d('0x2b')]['contact']=_0x5e166b[0x0];if(!_0x2fbbff['body'][_0x3d1d('0x63')])return;return db[_0x3d1d('0x73')][_0x3d1d('0x5a')]({'where':{'id':_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x63')],'role':'agent'},'attributes':['id',_0x3d1d('0x3d'),_0x3d1d('0x74'),'email',_0x3d1d('0x75')],'raw':!![]});}return null;})['then'](function(_0x4bdee5){if(!_0x4bdee5)return null;_0x5d3015['message']['agent']=_0x4bdee5;return _0x5d3015;})[_0x3d1d('0x24')](function(_0x31089b){if(_0x31089b){if(_0x2fbbff[_0x3d1d('0x5c')][_0x3d1d('0x76')]){_0x5d3015[_0x3d1d('0x2b')][_0x3d1d('0x77')]=util[_0x3d1d('0x66')](_0x3d1d('0x78'),_0x2fbbff[_0x3d1d('0x68')][_0x3d1d('0x3d')]);_0x5d3015['message'][_0x3d1d('0x79')]=_0x5d3015['channel'];_0x5d3015[_0x3d1d('0x2b')]['motionChannel']=_0x5d3015[_0x3d1d('0x79')];_0x5d3015[_0x3d1d('0x2b')][_0x3d1d('0x7a')]=_0x3d1d('0x5f');return respondWithRpcPromise('EventManager',_0x3d1d('0x7b'),{'event':_0x3d1d('0x7c'),'message':_0x5d3015['message']},client9002)[_0x3d1d('0x24')](function(){return _0x5d3015;});}return _0x5d3015;}return null;})[_0x3d1d('0x24')](respondWithResult(_0x4d05cf,null))[_0x3d1d('0x5b')](handleError(_0x4d05cf,null));};var interaction_log=require('../../config/logger')(_0x3d1d('0x5e'));exports[_0x3d1d('0x36')]=function(_0x2ccf95,_0x4e429b,_0x297a2c){var _0x2c4d94={'agent':{},'channel':_0x3d1d('0x60')};if(_0x2ccf95[_0x3d1d('0x5c')]['id']){delete _0x2ccf95['body']['id'];}_0x2ccf95[_0x3d1d('0x5c')][_0x3d1d('0x63')]=_0x2ccf95[_0x3d1d('0x5c')]['UserId']||_0x2ccf95['user']['id'];_0x2c4d94[_0x3d1d('0x64')]['id']=_0x2ccf95['body']['UserId'];return db[_0x3d1d('0x40')][_0x3d1d('0x5a')]({'where':{'id':_0x2ccf95['params']['id'],'UserId':null}})[_0x3d1d('0x24')](handleEntityNotFound(_0x4e429b,null))[_0x3d1d('0x24')](function(_0x4859fb){if(_0x4859fb){_0x2c4d94[_0x3d1d('0x2b')]=_0x4859fb[_0x3d1d('0x7d')]({'plain':!![]});return db[_0x3d1d('0x65')][_0x3d1d('0x5a')]({'where':{'id':_0x4859fb['SmsInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4e429b,null))['then'](function(_0x46338d){if(_0x46338d){_0x2c4d94[_0x3d1d('0x6a')]=_0x46338d[_0x3d1d('0x7d')]({'plain':!![]});interaction_log[_0x3d1d('0x25')](_0x3d1d('0x7e'),_0x2ccf95['user']['id'],_0x2ccf95['user']['name'],_0x2ccf95[_0x3d1d('0x68')][_0x3d1d('0x69')],_0x2c4d94[_0x3d1d('0x6a')]['id'],_0x2ccf95[_0x3d1d('0x5c')]?JSON[_0x3d1d('0x6b')](_0x2ccf95[_0x3d1d('0x5c')]):'null');return respondWithRpcPromise(_0x3d1d('0x7f'),'rejectMessage',_0x2c4d94);}return null;})[_0x3d1d('0x24')](function(_0x46da03){var _0x579dbd=_0x3d1d('0x6f')+_0x46da03['message'][_0x3d1d('0x70')];return db['sequelize'][_0x3d1d('0x44')](_0x579dbd,{'type':db[_0x3d1d('0x72')][_0x3d1d('0x80')]['SELECT'],'raw':!![]})[_0x3d1d('0x24')](function(_0x322989){return _0x322989;});})[_0x3d1d('0x24')](function(_0x24e4d1){if(_0x24e4d1){_0x2c4d94[_0x3d1d('0x2b')][_0x3d1d('0x81')]=_0x24e4d1[0x0];if(!_0x2ccf95[_0x3d1d('0x5c')][_0x3d1d('0x63')])return;return db['User'][_0x3d1d('0x5a')]({'where':{'id':_0x2ccf95[_0x3d1d('0x5c')][_0x3d1d('0x63')],'role':'agent'},'attributes':['id',_0x3d1d('0x3d'),'fullname',_0x3d1d('0x82'),_0x3d1d('0x75')],'raw':!![]});}return null;})[_0x3d1d('0x24')](function(_0x19bdb8){if(!_0x19bdb8)return null;_0x2c4d94['message'][_0x3d1d('0x64')]=_0x19bdb8;return _0x2c4d94;})[_0x3d1d('0x24')](function(_0x49fc82){if(_0x49fc82){_0x49fc82[_0x3d1d('0x2b')]['interface']=util[_0x3d1d('0x66')]('SIP/%s',_0x2ccf95['user'][_0x3d1d('0x3d')]);_0x49fc82['message'][_0x3d1d('0x79')]=_0x2c4d94[_0x3d1d('0x79')];_0x49fc82[_0x3d1d('0x2b')][_0x3d1d('0x83')]=_0x2c4d94[_0x3d1d('0x79')];_0x49fc82[_0x3d1d('0x2b')][_0x3d1d('0x7a')]=_0x3d1d('0x36');respondWithRpcPromise(_0x3d1d('0x7b'),'EventManager',{'event':_0x3d1d('0x84'),'message':_0x49fc82['message']},client9002);return _0x2c4d94;}return null;})[_0x3d1d('0x24')](respondWithResult(_0x4e429b,null))[_0x3d1d('0x5b')](handleError(_0x4e429b,null));};exports[_0x3d1d('0x2d')]=function(_0x3b6cc7,_0x5c6a36,_0x23a40c){if(_0x3b6cc7[_0x3d1d('0x5c')]['id']){delete _0x3b6cc7[_0x3d1d('0x5c')]['id'];}var _0x34ec81;return db[_0x3d1d('0x40')][_0x3d1d('0x5a')]({'where':{'id':_0x3b6cc7[_0x3d1d('0x58')]['id']}})[_0x3d1d('0x24')](handleEntityNotFound(_0x5c6a36,null))[_0x3d1d('0x24')](function(_0x164831){if(_0x164831){_0x34ec81=_0x164831;return db['SmsAccount'][_0x3d1d('0x5a')]({'where':{'id':_0x164831[_0x3d1d('0x85')]}});}})[_0x3d1d('0x24')](handleEntityNotFound(_0x5c6a36,null))[_0x3d1d('0x24')](function(_0xafe17a){if(_0xafe17a){logger[_0x3d1d('0x28')](_0x3d1d('0x86'),_0x3d1d('0x2d'),'received\x20delivery\x20report\x20from',_0xafe17a[_0x3d1d('0x42')],util[_0x3d1d('0x87')](_0x3b6cc7[_0x3d1d('0x5c')],{'showHidden':![],'depth':null}));switch(_0xafe17a[_0x3d1d('0x42')]){case _0x3d1d('0x88'):if(_0x3b6cc7[_0x3d1d('0x5c')]['MessageSid']&&_0x3b6cc7[_0x3d1d('0x5c')][_0x3d1d('0x89')]===_0x34ec81[_0x3d1d('0x8a')]){return _0x34ec81['update']({'read':!![]});}else{logger[_0x3d1d('0x29')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3d1d('0x2d'),_0x3d1d('0x88'),util[_0x3d1d('0x87')](_0x3b6cc7[_0x3d1d('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x3d1d('0x8b'):if(_0x3b6cc7[_0x3d1d('0x5c')]['MessageUUID']&&_0x3b6cc7[_0x3d1d('0x5c')][_0x3d1d('0x8c')]===_0x34ec81['messageId']&&_['indexOf']([_0x3d1d('0x8d'),_0x3d1d('0x8e')],_0x3b6cc7[_0x3d1d('0x5c')][_0x3d1d('0x8f')])>=0x0){return _0x34ec81[_0x3d1d('0x38')]({'read':!![]});}else{logger[_0x3d1d('0x29')](_0x3d1d('0x90'),'status','plivio',util['inspect'](_0x3b6cc7['body'],{'showHidden':![],'depth':null}));}break;case _0x3d1d('0x91'):var _0x53364f=_0x3b6cc7[_0x3d1d('0x5c')][_0x3d1d('0x92')][0x0];if(_0x53364f[_0x3d1d('0x2d')][_0x3d1d('0x93')]==='DELIVERED'){return _0x34ec81[_0x3d1d('0x38')]({'read':!![]});}else{logger['error'](_0x3d1d('0x90'),_0x3d1d('0x2d'),_0x3d1d('0x91'),util[_0x3d1d('0x87')](_0x3b6cc7['body'],{'showHidden':![],'depth':null}));}break;}return _0x34ec81;}})['then'](respondWithResult(_0x5c6a36,null))[_0x3d1d('0x5b')](handleError(_0x5c6a36,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 8a35e32..b85c61f 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 _0x5a54=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5a54,0x157));var _0x45a5=function(_0x579ed8,_0x19443f){_0x579ed8=_0x579ed8-0x0;var _0x256135=_0x5a54[_0x579ed8];return _0x256135;};'use strict';var EventEmitter=require('events');var SmsMessage=require(_0x45a5('0x0'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x45a5('0x1')](0x0);var events={'afterCreate':_0x45a5('0x2'),'afterUpdate':_0x45a5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5bf23f){return function(_0xc84879,_0x56e296,_0x5590d0){SmsMessageEvents[_0x45a5('0x4')](_0x5bf23f+':'+_0xc84879['id'],_0xc84879);SmsMessageEvents[_0x45a5('0x4')](_0x5bf23f,_0xc84879);_0x5590d0(null);};}for(var e in events){if(events[_0x45a5('0x5')](e)){var event=events[e];SmsMessage[_0x45a5('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x615c=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x615c,0x1b8));var _0xc615=function(_0x1992cd,_0x57d364){_0x1992cd=_0x1992cd-0x0;var _0x33c636=_0x615c[_0x1992cd];return _0x33c636;};'use strict';var EventEmitter=require(_0xc615('0x0'));var SmsMessage=require(_0xc615('0x1'))['db'][_0xc615('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc615('0x3')](0x0);var events={'afterCreate':_0xc615('0x4'),'afterUpdate':_0xc615('0x5'),'afterDestroy':_0xc615('0x6')};function emitEvent(_0x1f4ac0){return function(_0x34f26a,_0x5c905c,_0x277982){SmsMessageEvents[_0xc615('0x7')](_0x1f4ac0+':'+_0x34f26a['id'],_0x34f26a);SmsMessageEvents[_0xc615('0x7')](_0x1f4ac0,_0x34f26a);_0x277982(null);};}for(var e in events){if(events[_0xc615('0x8')](e)){var event=events[e];SmsMessage[_0xc615('0x9')](e,emitEvent(event));}}module[_0xc615('0xa')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index 85ffef1..ade075c 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 _0x0272=['POST','session_key','total_sent','read','afterCreate','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','deliveryReport','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','/api/sms/messages/','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','sender','text','timestamp','keys','sort','length','createHash','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','bandwidth','https://messaging.bandwidth.com/api/v2/users/','applicationId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','application/json','https://api.intelepeer.com/_rest/v4/app/sms/mdr','message','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','path','rimraf','./smsMessage.attributes','exports','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','SmsInteractionId','SmsInteraction','findOne','then','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','messages','phone','remote','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','login?username=','&password=','GET','split','sms'];(function(_0x42e435,_0x29ed2c){var _0xee277=function(_0xe66cb7){while(--_0xe66cb7){_0x42e435['push'](_0x42e435['shift']());}};_0xee277(++_0x29ed2c);}(_0x0272,0xc3));var _0x2027=function(_0x1d36cc,_0x45d025){_0x1d36cc=_0x1d36cc-0x0;var _0x3040a9=_0x0272[_0x1d36cc];return _0x3040a9;};'use strict';var _=require(_0x2027('0x0'));var util=require(_0x2027('0x1'));var logger=require('../../config/logger')(_0x2027('0x2'));var moment=require(_0x2027('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2027('0x4'));var rimraf=require(_0x2027('0x5'));var config=require('../../config/environment');var attributes=require(_0x2027('0x6'));module[_0x2027('0x7')]=function(_0x4bf78f,_0x19d7de){return _0x4bf78f[_0x2027('0x8')](_0x2027('0x9'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':'messageId','fields':[_0x2027('0xa')]},{'name':_0x2027('0xb'),'fields':[_0x2027('0xc')],'type':_0x2027('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x38356a,_0x163787,_0x2aaf92){var _0x1bc0e8=_0x4bf78f['models'];var _0x3db41a=_0x38356a[_0x2027('0xe')]({'plain':!![]});if(_0x3db41a[_0x2027('0xf')][_0x2027('0x10')]()==='in'||_0x3db41a['direction'][_0x2027('0x10')]()===_0x2027('0x11')&&!_0x3db41a[_0x2027('0x12')]&&!_[_0x2027('0x13')](_0x3db41a['UserId'])&&!_[_0x2027('0x13')](_0x3db41a[_0x2027('0x14')])){_0x1bc0e8[_0x2027('0x15')][_0x2027('0x16')]({'where':{'id':_0x3db41a[_0x2027('0x14')]}})[_0x2027('0x17')](function(_0x39ae0f){if(_0x39ae0f){_0x39ae0f[_0x2027('0x18')]({'lastMsgAt':_0x3db41a['createdAt'],'lastMsgDirection':_0x3db41a[_0x2027('0xf')][_0x2027('0x10')]()});}})[_0x2027('0x19')](function(_0x52ae55){console['error'](_0x52ae55);});}if(_0x3db41a[_0x2027('0xf')]===_0x2027('0x11')&&!_0x3db41a['secret']){var _0xa5f3a5;_0x1bc0e8[_0x2027('0x1a')][_0x2027('0x1b')]({'where':{'id':_0x3db41a[_0x2027('0x1c')]},'raw':!![]})[_0x2027('0x17')](function(_0xb14193){_0xa5f3a5=_0xb14193;if(_0xa5f3a5&&_0xa5f3a5[_0x2027('0x1d')]){switch(_0xa5f3a5[_0x2027('0x1d')]){case _0x2027('0x1e'):var _0x4d3de5=require(_0x2027('0x1e'));if(_0xa5f3a5[_0x2027('0x1f')]&&_0xa5f3a5[_0x2027('0x20')]&&_0xa5f3a5['phone']){var _0x3257e6=new _0x4d3de5(_0xa5f3a5[_0x2027('0x1f')],_0xa5f3a5['authToken']);_0x3257e6[_0x2027('0x21')]['create']({'body':_0x3db41a[_0x2027('0xc')],'to':_0x3db41a[_0x2027('0x22')],'from':_0xa5f3a5[_0x2027('0x22')],'statusCallback':_0xa5f3a5[_0x2027('0x23')]+'/api/sms/messages/'+_0x3db41a['id']+_0x2027('0x24')+_0xa5f3a5[_0x2027('0x25')]})[_0x2027('0x17')](function(_0x34fe26){if(_0x34fe26[_0x2027('0x26')]){return _0x38356a['update']({'messageId':_0x34fe26[_0x2027('0x26')]});}})[_0x2027('0x19')](function(_0x1f7999){logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate',_0x2027('0x1e'),util[_0x2027('0x29')](_0x1f7999,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate',_0x2027('0x1e'),_0x2027('0x2a'));}break;case _0x2027('0x2b'):var _0x56861a=_0x2027('0x2c');if(_0xa5f3a5[_0x2027('0x2d')]&&_0xa5f3a5[_0x2027('0x2e')]){var _0x3e5378={'recipient':[_0x3db41a[_0x2027('0x22')]],'message':_0x3db41a['body'],'message_type':_0xa5f3a5[_0x2027('0x2f')]};if(_0xa5f3a5[_0x2027('0x2f')]&&_0xa5f3a5[_0x2027('0x2f')]!=='SI'){_0x3e5378['sender']=_0xa5f3a5['phone'];}var _0x503b62={'url':_0x56861a+_0x2027('0x30')+_0xa5f3a5['username']+_0x2027('0x31')+_0xa5f3a5[_0x2027('0x2e')],'method':_0x2027('0x32')};rp(_0x503b62)[_0x2027('0x17')](function(_0x2479e5){var _0x20291f=_0x2479e5[_0x2027('0x33')](';');var _0x2f6d8f={'user_key':_0x20291f[0x0],'session_key':_0x20291f[0x1]};_0x503b62={'url':_0x56861a+_0x2027('0x34'),'method':_0x2027('0x35'),'headers':{'user_key':_0x2f6d8f['user_key'],'Session_key':_0x2f6d8f[_0x2027('0x36')]},'json':!![],'body':_0x3e5378};return rp(_0x503b62);})['then'](function(_0x291cf5){if(_0x291cf5[_0x2027('0x37')]>=0x1){var _0x44624f={'messageId':_0x291cf5['internal_order_id']};if(_0xa5f3a5[_0x2027('0x2f')]!=='GP'||!_0xa5f3a5['deliveryReport']){_0x44624f[_0x2027('0x38')]=!![];}return _0x38356a[_0x2027('0x18')](_0x44624f);}else{return logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x2b'),util[_0x2027('0x29')](_0x291cf5,{'showHidden':![],'depth':null}));}})[_0x2027('0x19')](function(_0xf234b9){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x2b'),util['inspect'](_0xf234b9,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate','skebby',_0x2027('0x3a'));}break;case _0x2027('0x3b'):if(_0xa5f3a5[_0x2027('0x20')]){var _0x14da0f={'recipient':_0x3db41a['phone'],'message':_0x3db41a[_0x2027('0xc')],'sender':_0xa5f3a5[_0x2027('0x3c')]||_0xa5f3a5[_0x2027('0x22')],'authorization':_0xa5f3a5[_0x2027('0x20')]};var _0x163787={'method':_0x2027('0x35'),'uri':_0x2027('0x3d'),'body':_0x14da0f,'json':!![]};rp(_0x163787)[_0x2027('0x17')](function(_0x187fcd){var _0x200a56={'messageId':_0x187fcd['requestid']};if(!_0xa5f3a5['deliveryReport']){_0x200a56['read']=!![];}return _0x38356a[_0x2027('0x18')](_0x200a56);})[_0x2027('0x19')](function(_0x2c24bf){logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate','connectel',util[_0x2027('0x29')](_0x2c24bf,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x3b'),_0x2027('0x3e'));}break;case _0x2027('0x3f'):if(_0xa5f3a5[_0x2027('0x2d')]&&_0xa5f3a5['password']){var _0x14da0f={'messages':[{'source':_0x2027('0x40'),'to':_0x3db41a[_0x2027('0x22')],'body':_0x3db41a[_0x2027('0xc')],'from':_0xa5f3a5[_0x2027('0x3c')]||_0xa5f3a5[_0x2027('0x22')]}]};var _0x117086=util['format']('%s:%s',_0xa5f3a5['username'],_0xa5f3a5[_0x2027('0x2e')]);var _0x163787={'method':_0x2027('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x14da0f,'headers':{'Authorization':util[_0x2027('0x41')](_0x2027('0x42'),new Buffer(_0x117086)[_0x2027('0x43')](_0x2027('0x44')))},'json':!![]};rp(_0x163787)[_0x2027('0x17')](function(_0x11b917){if(_0x11b917[_0x2027('0x45')]>=0xc8&&_0x11b917[_0x2027('0x45')]<=0xce){if(_0x11b917[_0x2027('0x46')]&&_0x11b917[_0x2027('0x46')][_0x2027('0x47')]>0x0){var _0x5e7759=_[_0x2027('0x48')](_0x11b917[_0x2027('0x46')][_0x2027('0x21')]);var _0x2e1739={'messageId':_0x5e7759['message_id']};if(!_0xa5f3a5[_0x2027('0x49')]){_0x2e1739[_0x2027('0x38')]=!![];}return _0x38356a['update'](_0x2e1739);}else{logger['error'](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x4a'),util[_0x2027('0x29')](_0x11b917,{'showHidden':![],'depth':null}));}}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x4a'),util[_0x2027('0x29')](_0x11b917,{'showHidden':![],'depth':null}));}})[_0x2027('0x19')](function(_0x1273fb){logger['error'](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x4a'),util[_0x2027('0x29')](_0x1273fb,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),'clickSend','Missing\x20parameters:\x20username,\x20password');}break;case _0x2027('0x4b'):if(_0xa5f3a5[_0x2027('0x4c')]&&_0xa5f3a5[_0x2027('0x20')]){var _0x14da0f={'dst':_0x3db41a[_0x2027('0x22')],'text':_0x3db41a[_0x2027('0xc')],'src':_0xa5f3a5[_0x2027('0x3c')]||_0xa5f3a5['phone'],'url':_0xa5f3a5['remote']+'/api/sms/messages/'+_0x3db41a['id']+_0x2027('0x24')+_0xa5f3a5['token']};var _0x117086=util[_0x2027('0x41')](_0x2027('0x4d'),_0xa5f3a5[_0x2027('0x4c')],_0xa5f3a5[_0x2027('0x20')]);var _0x163787={'method':_0x2027('0x35'),'uri':util[_0x2027('0x41')](_0x2027('0x4e'),_0xa5f3a5[_0x2027('0x4c')]),'body':_0x14da0f,'headers':{'Authorization':util['format'](_0x2027('0x42'),new Buffer(_0x117086)[_0x2027('0x43')](_0x2027('0x44')))},'json':!![]};rp(_0x163787)['then'](function(_0x10dfc8){var _0x103c60={'messageId':_0x10dfc8[_0x2027('0x4f')][0x0]};return _0x38356a[_0x2027('0x18')](_0x103c60);})[_0x2027('0x19')](function(_0x74673a){logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2027('0x4b'),util['inspect'](_0x74673a,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x4b'),_0x2027('0x50'));}break;case _0x2027('0x51'):if(_0xa5f3a5['username']&&_0xa5f3a5[_0x2027('0x2e')]){if(_0xa5f3a5[_0x2027('0x52')]){var _0x640df={'method':_0x2027('0x35'),'uri':_0xa5f3a5[_0x2027('0x52')]+_0x2027('0x53'),'body':{'username':_0xa5f3a5['username'],'password':_0xa5f3a5[_0x2027('0x2e')]},'json':!![]};return rp(_0x640df)[_0x2027('0x17')](function(_0xad0925){var _0x1347f8={'method':_0x2027('0x35'),'uri':_0xa5f3a5['baseUrl']+_0x2027('0x54'),'body':{'messages':[{'from':_0xa5f3a5[_0x2027('0x22')],'destinations':[{'to':_0x3db41a[_0x2027('0x22')]}],'text':_0x3db41a['body'],'notifyUrl':_0xa5f3a5['remote']+_0x2027('0x55')+_0x3db41a['id']+'/status?token='+_0xa5f3a5['token'],'notifyContentType':'application/json','callbackData':_0xa5f3a5[_0x2027('0x22')]+';'+_0x3db41a[_0x2027('0xc')]}]},'headers':{'Authorization':_0x2027('0x56')+_0xad0925[_0x2027('0x25')]},'json':!![]};return rp(_0x1347f8)[_0x2027('0x17')](function(_0x24dda1){if(_0x24dda1[_0x2027('0x21')]){var _0x96c3b5={'messageId':_0x24dda1[_0x2027('0x21')][0x0][_0x2027('0xa')]};if(!_0xa5f3a5[_0x2027('0x49')]){_0x96c3b5[_0x2027('0x38')]=!![];}return _0x38356a['update'](_0x96c3b5);}else{return logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x51'),util[_0x2027('0x29')](_0x24dda1,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1d55dd){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x2027('0x51'),util['inspect'](_0x1d55dd,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),'infobip',_0x2027('0x57'));}}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x51'),_0x2027('0x3a'));}break;case _0x2027('0x58'):var _0x4fd535=require(_0x2027('0x59'));if(_0xa5f3a5[_0x2027('0x5a')]){var _0x252d64={};_0x252d64[_0x2027('0x5b')]=_0xa5f3a5[_0x2027('0x2d')];_0x252d64[_0x2027('0x22')]=_0x3db41a['phone'];_0x252d64[_0x2027('0x5c')]=_0xa5f3a5[_0x2027('0x22')];_0x252d64[_0x2027('0x5d')]=_0x3db41a['body'];_0x252d64[_0x2027('0x5e')]=+new Date();var _0x524f9d='';var _0x1d4a16='';var _0x323112=Object[_0x2027('0x5f')](_0x252d64);_0x323112[_0x2027('0x60')]();for(var _0x1e7e28=0x0;_0x1e7e28<_0x323112[_0x2027('0x61')];_0x1e7e28++){if(_0x524f9d!=''){_0x524f9d+='&';}_0x524f9d+=_0x323112[_0x1e7e28]+'='+encodeURIComponent(_0x252d64[_0x323112[_0x1e7e28]]);_0x1d4a16+=_0x252d64[_0x323112[_0x1e7e28]];}_0x1d4a16+=_0xa5f3a5['apiKey'];_0x1d4a16=_0x4fd535[_0x2027('0x62')]('md5')[_0x2027('0x18')](_0x1d4a16)[_0x2027('0x63')](_0x2027('0x64'));if(_0x524f9d!==''){_0x524f9d+='&';}_0x524f9d+=_0x2027('0x65')+_0x1d4a16;var _0x503b62={'method':_0x2027('0x32'),'uri':_0xa5f3a5[_0x2027('0x52')]+_0x2027('0x66')+_0x524f9d,'json':!![]};return rp(_0x503b62)[_0x2027('0x17')](function(_0x4428a6){var _0x37237e=Object[_0x2027('0x5f')](_0x4428a6);if(_0x4428a6[_0x37237e[0x0]]['error']&&parseInt(_0x4428a6[_0x37237e[0x0]][_0x2027('0x27')])===0x0){var _0x2e4c7={'messageId':_0x4428a6[_0x37237e[0x0]][_0x2027('0x67')]};if(!_0xa5f3a5['deliveryReport']){_0x2e4c7[_0x2027('0x38')]=!![];}return _0x38356a[_0x2027('0x18')](_0x2e4c7);}else{return logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x58'),util[_0x2027('0x29')](_0x4428a6['error'],{'showHidden':![],'depth':null}));}})['catch'](function(_0x55ed15){return logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x58'),util[_0x2027('0x29')](_0x55ed15,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x58'),_0x2027('0x68'));}break;case _0x2027('0x69'):if(_0xa5f3a5['apiKey']){var _0xf7dd85={'method':_0x2027('0x35'),'uri':_0x2027('0x6a'),'headers':{'Authorization':_0xa5f3a5[_0x2027('0x5a')]},'body':{'content':_0x3db41a[_0x2027('0xc')],'to':[_0x3db41a[_0x2027('0x22')]],'from':_0xa5f3a5['phone'],'binary':![],'clientMessageId':_0x2027('0x6b'),'charset':_0x2027('0x6c')},'json':!![]};rp(_0xf7dd85)[_0x2027('0x17')](function(_0x2f7069){if(!_0x2f7069[_0x2027('0x27')]){var _0x32907f={'messageId':_0x2f7069[_0x2027('0x21')][0x0][_0x2027('0x6d')]};if(!_0xa5f3a5['deliveryReport']){_0x32907f[_0x2027('0x38')]=!![];}return _0x38356a['update'](_0x32907f);}else{return logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x69'),util[_0x2027('0x29')](_0x2f7069['error'],{'showHidden':![],'depth':null}));}})[_0x2027('0x19')](function(_0x5f02a0){return logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate',_0x2027('0x69'),util[_0x2027('0x29')](_0x5f02a0,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x69'),'Missing\x20parameters:\x20apiKey');}break;case _0x2027('0x6e'):if(_0xa5f3a5['username']&&_0xa5f3a5[_0x2027('0x2e')]){var _0x117086=util['format']('%s:%s',_0xa5f3a5[_0x2027('0x2d')],_0xa5f3a5[_0x2027('0x2e')]);var _0x163787={'method':'POST','uri':_0x2027('0x6f')+_0xa5f3a5['accountId']+'/messages','body':{'to':[_0x3db41a['phone']],'text':_0x3db41a[_0x2027('0xc')],'from':_0xa5f3a5[_0x2027('0x22')],'applicationId':_0xa5f3a5[_0x2027('0x70')]},'headers':{'Authorization':util[_0x2027('0x41')]('Basic\x20%s',new Buffer(_0x117086)[_0x2027('0x43')]('base64'))},'json':!![]};rp(_0x163787)[_0x2027('0x17')](function(_0x37094d){if(_0x37094d['id']){var _0x4f2c50={'messageId':_0x37094d['id']};return _0x38356a[_0x2027('0x18')](_0x4f2c50);}else{logger['error'](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x6e'),util[_0x2027('0x29')](_0x37094d,{'showHidden':![],'depth':null}));}})[_0x2027('0x19')](function(_0x5f2799){logger['error'](_0x2027('0x28'),_0x2027('0x39'),'bandwidth',util[_0x2027('0x29')](_0x5f2799,{'showHidden':![],'depth':null}));});}else{logger[_0x2027('0x27')](_0x2027('0x28'),'afterCreate',_0x2027('0x6e'),_0x2027('0x3a'));}break;case _0x2027('0x71'):if(_0xa5f3a5[_0x2027('0x5a')]){var _0x4ba8be={};var _0x503b62={'method':_0x2027('0x35'),'uri':_0x2027('0x72'),'headers':{'Authorization':_0x2027('0x73')+_0xa5f3a5['apiKey'],'Content-Type':_0x2027('0x74')},'body':{'from':_0xa5f3a5[_0x2027('0x22')],'to':_0x3db41a[_0x2027('0x22')],'text':_0x3db41a[_0x2027('0xc')]},'json':!![]};return rp(_0x503b62)[_0x2027('0x17')](function(_0x41f3bb){if(_0x41f3bb['code']==0xca){_0x4ba8be['message']=_0x41f3bb;var _0x41a1ac={'method':'POST','uri':_0x2027('0x75'),'headers':{'Authorization':_0x2027('0x73')+_0xa5f3a5[_0x2027('0x5a')],'Content-Type':_0x2027('0x74')},'body':{'refid':_0x4ba8be[_0x2027('0x76')]['refid']},'json':!![]};return rp(_0x41a1ac)['then'](function(_0x8405d){_0x4ba8be[_0x2027('0x77')]=_0x8405d;var _0x269816={'messageId':_0x4ba8be['message']['refid'],'read':!![]};return _0x38356a['update'](_0x269816);});}else{return logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x71'),util[_0x2027('0x29')](_0x41f3bb,{'showHidden':![],'depth':null}));}})[_0x2027('0x19')](function(_0x1d2042){return logger[_0x2027('0x27')](_0x2027('0x28'),_0x2027('0x39'),_0x2027('0x71'),util[_0x2027('0x29')](_0x1d2042,{'showHidden':![],'depth':null}));});}else{return logger[_0x2027('0x27')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x2027('0x39'),_0x2027('0x71'),_0x2027('0x78'));}break;}}})[_0x2027('0x79')](function(){_0x2aaf92();});}else{_0x2aaf92();}}},'charset':_0x2027('0x7a'),'collate':_0x2027('0x7b')});}; \ No newline at end of file +var _0x4599=['code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','SmsInteractionId','SmsInteraction','findOne','then','update','createdAt','error','find','SmsAccountId','type','twilio','accountSid','authToken','phone','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','&password=','password','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','connectel','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','senderString','format','toString','http_code','data','head','messages','message_id','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','remote','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','apiKey','login','timestamp','keys','sort','length','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','uuid','UTF-8','clickatell','accountId','/messages','applicationId','bandwidth','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20'];(function(_0xe15270,_0x227d06){var _0x1e813b=function(_0x1d590d){while(--_0x1d590d){_0xe15270['push'](_0xe15270['shift']());}};_0x1e813b(++_0x227d06);}(_0x4599,0x1e3));var _0x9459=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4599[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x9459('0x0'));var util=require(_0x9459('0x1'));var logger=require(_0x9459('0x2'))(_0x9459('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9459('0x4'));var fs=require('fs');var path=require(_0x9459('0x5'));var rimraf=require('rimraf');var config=require(_0x9459('0x6'));var attributes=require('./smsMessage.attributes');module[_0x9459('0x7')]=function(_0x23178b,_0x323388){return _0x23178b['define'](_0x9459('0x8'),attributes,{'tableName':_0x9459('0x9'),'paranoid':![],'indexes':[{'name':_0x9459('0xa'),'fields':[_0x9459('0xa')]},{'name':_0x9459('0xb'),'fields':[_0x9459('0xc')],'type':_0x9459('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x207eea,_0x3a1d85,_0x1bbaeb){var _0x3f4706=_0x23178b[_0x9459('0xe')];var _0x35831c=_0x207eea['get']({'plain':!![]});if(_0x35831c[_0x9459('0xf')][_0x9459('0x10')]()==='in'||_0x35831c[_0x9459('0xf')][_0x9459('0x10')]()===_0x9459('0x11')&&!_0x35831c[_0x9459('0x12')]&&!_[_0x9459('0x13')](_0x35831c[_0x9459('0x14')])&&!_[_0x9459('0x13')](_0x35831c[_0x9459('0x15')])){_0x3f4706[_0x9459('0x16')][_0x9459('0x17')]({'where':{'id':_0x35831c[_0x9459('0x15')]}})[_0x9459('0x18')](function(_0x5b30ab){if(_0x5b30ab){_0x5b30ab[_0x9459('0x19')]({'lastMsgAt':_0x35831c[_0x9459('0x1a')],'lastMsgDirection':_0x35831c[_0x9459('0xf')]['toLowerCase']()});}})['catch'](function(_0x59fd26){console[_0x9459('0x1b')](_0x59fd26);});}if(_0x35831c[_0x9459('0xf')]===_0x9459('0x11')&&!_0x35831c[_0x9459('0x12')]){var _0x454939;_0x3f4706['SmsAccount'][_0x9459('0x1c')]({'where':{'id':_0x35831c[_0x9459('0x1d')]},'raw':!![]})['then'](function(_0x6c388c){_0x454939=_0x6c388c;if(_0x454939&&_0x454939[_0x9459('0x1e')]){switch(_0x454939['type']){case _0x9459('0x1f'):var _0x668461=require('twilio');if(_0x454939[_0x9459('0x20')]&&_0x454939[_0x9459('0x21')]&&_0x454939['phone']){var _0x552d6c=new _0x668461(_0x454939[_0x9459('0x20')],_0x454939[_0x9459('0x21')]);_0x552d6c['messages']['create']({'body':_0x35831c[_0x9459('0xc')],'to':_0x35831c[_0x9459('0x22')],'from':_0x454939[_0x9459('0x22')],'statusCallback':_0x454939['remote']+_0x9459('0x23')+_0x35831c['id']+_0x9459('0x24')+_0x454939[_0x9459('0x25')]})['then'](function(_0x498abe){if(_0x498abe[_0x9459('0x26')]){return _0x207eea[_0x9459('0x19')]({'messageId':_0x498abe[_0x9459('0x26')]});}})[_0x9459('0x27')](function(_0x41a01b){logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate','twilio',util[_0x9459('0x29')](_0x41a01b,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x1f'),_0x9459('0x2b'));}break;case _0x9459('0x2c'):var _0x33db3d=_0x9459('0x2d');if(_0x454939[_0x9459('0x2e')]&&_0x454939['password']){var _0x70c8a6={'recipient':[_0x35831c[_0x9459('0x22')]],'message':_0x35831c[_0x9459('0xc')],'message_type':_0x454939[_0x9459('0x2f')]};if(_0x454939[_0x9459('0x2f')]&&_0x454939[_0x9459('0x2f')]!=='SI'){_0x70c8a6[_0x9459('0x30')]=_0x454939['phone'];}var _0x3e723b={'url':_0x33db3d+'login?username='+_0x454939['username']+_0x9459('0x31')+_0x454939[_0x9459('0x32')],'method':'GET'};rp(_0x3e723b)[_0x9459('0x18')](function(_0x545686){var _0x4865f6=_0x545686[_0x9459('0x33')](';');var _0x11f24e={'user_key':_0x4865f6[0x0],'session_key':_0x4865f6[0x1]};_0x3e723b={'url':_0x33db3d+_0x9459('0x34'),'method':_0x9459('0x35'),'headers':{'user_key':_0x11f24e[_0x9459('0x36')],'Session_key':_0x11f24e[_0x9459('0x37')]},'json':!![],'body':_0x70c8a6};return rp(_0x3e723b);})['then'](function(_0x117f9e){if(_0x117f9e[_0x9459('0x38')]>=0x1){var _0x53724c={'messageId':_0x117f9e[_0x9459('0x39')]};if(_0x454939[_0x9459('0x2f')]!=='GP'||!_0x454939[_0x9459('0x3a')]){_0x53724c[_0x9459('0x3b')]=!![];}return _0x207eea[_0x9459('0x19')](_0x53724c);}else{return logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x2c'),util[_0x9459('0x29')](_0x117f9e,{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x3ea297){return logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate',_0x9459('0x2c'),util['inspect'](_0x3ea297,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9459('0x28'),'afterCreate',_0x9459('0x2c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9459('0x3c'):if(_0x454939[_0x9459('0x21')]){var _0x16ee58={'recipient':_0x35831c[_0x9459('0x22')],'message':_0x35831c['body'],'sender':_0x454939['senderString']||_0x454939[_0x9459('0x22')],'authorization':_0x454939[_0x9459('0x21')]};var _0x3a1d85={'method':_0x9459('0x35'),'uri':_0x9459('0x3d'),'body':_0x16ee58,'json':!![]};rp(_0x3a1d85)[_0x9459('0x18')](function(_0x2ac7e0){var _0x439efa={'messageId':_0x2ac7e0[_0x9459('0x3e')]};if(!_0x454939[_0x9459('0x3a')]){_0x439efa[_0x9459('0x3b')]=!![];}return _0x207eea[_0x9459('0x19')](_0x439efa);})[_0x9459('0x27')](function(_0x322598){logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x3c'),util['inspect'](_0x322598,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x3c'),_0x9459('0x3f'));}break;case'clicksend':if(_0x454939[_0x9459('0x2e')]&&_0x454939[_0x9459('0x32')]){var _0x16ee58={'messages':[{'source':_0x9459('0x40'),'to':_0x35831c[_0x9459('0x22')],'body':_0x35831c['body'],'from':_0x454939[_0x9459('0x41')]||_0x454939[_0x9459('0x22')]}]};var _0x2bb717=util[_0x9459('0x42')]('%s:%s',_0x454939['username'],_0x454939[_0x9459('0x32')]);var _0x3a1d85={'method':_0x9459('0x35'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x16ee58,'headers':{'Authorization':util[_0x9459('0x42')]('Basic\x20%s',new Buffer(_0x2bb717)[_0x9459('0x43')]('base64'))},'json':!![]};rp(_0x3a1d85)[_0x9459('0x18')](function(_0x4e020a){if(_0x4e020a[_0x9459('0x44')]>=0xc8&&_0x4e020a[_0x9459('0x44')]<=0xce){if(_0x4e020a['data']&&_0x4e020a[_0x9459('0x45')]['queued_count']>0x0){var _0x2460af=_[_0x9459('0x46')](_0x4e020a['data'][_0x9459('0x47')]);var _0x1ab5ab={'messageId':_0x2460af[_0x9459('0x48')]};if(!_0x454939[_0x9459('0x3a')]){_0x1ab5ab[_0x9459('0x3b')]=!![];}return _0x207eea['update'](_0x1ab5ab);}else{logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x49'),util['inspect'](_0x4e020a,{'showHidden':![],'depth':null}));}}else{logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate','clickSend',util[_0x9459('0x29')](_0x4e020a,{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x22324c){logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate',_0x9459('0x49'),util[_0x9459('0x29')](_0x22324c,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x49'),_0x9459('0x4a'));}break;case _0x9459('0x4b'):if(_0x454939[_0x9459('0x4c')]&&_0x454939[_0x9459('0x21')]){var _0x16ee58={'dst':_0x35831c['phone'],'text':_0x35831c[_0x9459('0xc')],'src':_0x454939[_0x9459('0x41')]||_0x454939[_0x9459('0x22')],'url':_0x454939['remote']+_0x9459('0x23')+_0x35831c['id']+_0x9459('0x24')+_0x454939[_0x9459('0x25')]};var _0x2bb717=util[_0x9459('0x42')](_0x9459('0x4d'),_0x454939['authId'],_0x454939[_0x9459('0x21')]);var _0x3a1d85={'method':_0x9459('0x35'),'uri':util[_0x9459('0x42')](_0x9459('0x4e'),_0x454939[_0x9459('0x4c')]),'body':_0x16ee58,'headers':{'Authorization':util[_0x9459('0x42')](_0x9459('0x4f'),new Buffer(_0x2bb717)[_0x9459('0x43')](_0x9459('0x50')))},'json':!![]};rp(_0x3a1d85)['then'](function(_0x3dd950){var _0x18713e={'messageId':_0x3dd950['message_uuid'][0x0]};return _0x207eea[_0x9459('0x19')](_0x18713e);})[_0x9459('0x27')](function(_0x1dc011){logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate',_0x9459('0x4b'),util['inspect'](_0x1dc011,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x4b'),_0x9459('0x51'));}break;case _0x9459('0x52'):if(_0x454939[_0x9459('0x2e')]&&_0x454939[_0x9459('0x32')]){if(_0x454939['baseUrl']){var _0x2aea14={'method':'POST','uri':_0x454939[_0x9459('0x53')]+_0x9459('0x54'),'body':{'username':_0x454939[_0x9459('0x2e')],'password':_0x454939[_0x9459('0x32')]},'json':!![]};return rp(_0x2aea14)['then'](function(_0x4addce){var _0x2548e1={'method':_0x9459('0x35'),'uri':_0x454939[_0x9459('0x53')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x454939['phone'],'destinations':[{'to':_0x35831c[_0x9459('0x22')]}],'text':_0x35831c['body'],'notifyUrl':_0x454939[_0x9459('0x55')]+_0x9459('0x23')+_0x35831c['id']+_0x9459('0x24')+_0x454939['token'],'notifyContentType':_0x9459('0x56'),'callbackData':_0x454939[_0x9459('0x22')]+';'+_0x35831c[_0x9459('0xc')]}]},'headers':{'Authorization':_0x9459('0x57')+_0x4addce['token']},'json':!![]};return rp(_0x2548e1)[_0x9459('0x18')](function(_0x59429e){if(_0x59429e[_0x9459('0x47')]){var _0x711490={'messageId':_0x59429e[_0x9459('0x47')][0x0]['messageId']};if(!_0x454939[_0x9459('0x3a')]){_0x711490[_0x9459('0x3b')]=!![];}return _0x207eea[_0x9459('0x19')](_0x711490);}else{return logger['error'](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x52'),util[_0x9459('0x29')](_0x59429e,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x1fd3da){return logger['error'](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x52'),util[_0x9459('0x29')](_0x1fd3da,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x52'),_0x9459('0x58'));}}else{logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),'infobip',_0x9459('0x4a'));}break;case _0x9459('0x59'):var _0x495c90=require(_0x9459('0x5a'));if(_0x454939[_0x9459('0x5b')]){var _0x3fd9da={};_0x3fd9da[_0x9459('0x5c')]=_0x454939[_0x9459('0x2e')];_0x3fd9da[_0x9459('0x22')]=_0x35831c['phone'];_0x3fd9da[_0x9459('0x30')]=_0x454939[_0x9459('0x22')];_0x3fd9da['text']=_0x35831c['body'];_0x3fd9da[_0x9459('0x5d')]=+new Date();var _0x390a81='';var _0x3f6174='';var _0x7c753c=Object[_0x9459('0x5e')](_0x3fd9da);_0x7c753c[_0x9459('0x5f')]();for(var _0x3f8eec=0x0;_0x3f8eec<_0x7c753c[_0x9459('0x60')];_0x3f8eec++){if(_0x390a81!=''){_0x390a81+='&';}_0x390a81+=_0x7c753c[_0x3f8eec]+'='+encodeURIComponent(_0x3fd9da[_0x7c753c[_0x3f8eec]]);_0x3f6174+=_0x3fd9da[_0x7c753c[_0x3f8eec]];}_0x3f6174+=_0x454939[_0x9459('0x5b')];_0x3f6174=_0x495c90['createHash']('md5')[_0x9459('0x19')](_0x3f6174)['digest']('hex');if(_0x390a81!==''){_0x390a81+='&';}_0x390a81+=_0x9459('0x61')+_0x3f6174;var _0x3e723b={'method':_0x9459('0x62'),'uri':_0x454939[_0x9459('0x53')]+_0x9459('0x63')+_0x390a81,'json':!![]};return rp(_0x3e723b)[_0x9459('0x18')](function(_0x41126a){var _0x593f87=Object['keys'](_0x41126a);if(_0x41126a[_0x593f87[0x0]]['error']&&parseInt(_0x41126a[_0x593f87[0x0]][_0x9459('0x1b')])===0x0){var _0x417600={'messageId':_0x41126a[_0x593f87[0x0]][_0x9459('0x64')]};if(!_0x454939[_0x9459('0x3a')]){_0x417600[_0x9459('0x3b')]=!![];}return _0x207eea[_0x9459('0x19')](_0x417600);}else{return logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x59'),util[_0x9459('0x29')](_0x41126a[_0x9459('0x1b')],{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x38373b){return logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x59'),util[_0x9459('0x29')](_0x38373b,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x9459('0x28'),'afterCreate',_0x9459('0x59'),_0x9459('0x65'));}break;case'clickatell':if(_0x454939[_0x9459('0x5b')]){var _0x494dac={'method':_0x9459('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x454939['apiKey']},'body':{'content':_0x35831c[_0x9459('0xc')],'to':[_0x35831c[_0x9459('0x22')]],'from':_0x454939[_0x9459('0x22')],'binary':![],'clientMessageId':_0x9459('0x66'),'charset':_0x9459('0x67')},'json':!![]};rp(_0x494dac)['then'](function(_0x550dd6){if(!_0x550dd6[_0x9459('0x1b')]){var _0x199ea7={'messageId':_0x550dd6[_0x9459('0x47')][0x0]['apiMessageId']};if(!_0x454939['deliveryReport']){_0x199ea7[_0x9459('0x3b')]=!![];}return _0x207eea[_0x9459('0x19')](_0x199ea7);}else{return logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x68'),util[_0x9459('0x29')](_0x550dd6['error'],{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x3e06bb){return logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x68'),util[_0x9459('0x29')](_0x3e06bb,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),'clickatell','Missing\x20parameters:\x20apiKey');}break;case'bandwidth':if(_0x454939[_0x9459('0x2e')]&&_0x454939[_0x9459('0x32')]){var _0x2bb717=util['format'](_0x9459('0x4d'),_0x454939[_0x9459('0x2e')],_0x454939[_0x9459('0x32')]);var _0x3a1d85={'method':'POST','uri':'https://messaging.bandwidth.com/api/v2/users/'+_0x454939[_0x9459('0x69')]+_0x9459('0x6a'),'body':{'to':[_0x35831c[_0x9459('0x22')]],'text':_0x35831c[_0x9459('0xc')],'from':_0x454939[_0x9459('0x22')],'applicationId':_0x454939[_0x9459('0x6b')]},'headers':{'Authorization':util[_0x9459('0x42')](_0x9459('0x4f'),new Buffer(_0x2bb717)[_0x9459('0x43')](_0x9459('0x50')))},'json':!![]};rp(_0x3a1d85)['then'](function(_0x2f6c40){if(_0x2f6c40['id']){var _0x4c4617={'messageId':_0x2f6c40['id']};return _0x207eea[_0x9459('0x19')](_0x4c4617);}else{logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x6c'),util[_0x9459('0x29')](_0x2f6c40,{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x3e73aa){logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),'bandwidth',util[_0x9459('0x29')](_0x3e73aa,{'showHidden':![],'depth':null}));});}else{logger[_0x9459('0x1b')](_0x9459('0x28'),'afterCreate',_0x9459('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x9459('0x6d'):if(_0x454939[_0x9459('0x5b')]){var _0x4f2cf0={};var _0x3e723b={'method':_0x9459('0x35'),'uri':_0x9459('0x6e'),'headers':{'Authorization':_0x9459('0x6f')+_0x454939[_0x9459('0x5b')],'Content-Type':_0x9459('0x56')},'body':{'from':_0x454939[_0x9459('0x22')],'to':_0x35831c[_0x9459('0x22')],'text':_0x35831c[_0x9459('0xc')]},'json':!![]};return rp(_0x3e723b)[_0x9459('0x18')](function(_0x1df1a3){if(_0x1df1a3[_0x9459('0x70')]==0xca){_0x4f2cf0[_0x9459('0x71')]=_0x1df1a3;var _0xd82a83={'method':_0x9459('0x35'),'uri':_0x9459('0x72'),'headers':{'Authorization':_0x9459('0x6f')+_0x454939['apiKey'],'Content-Type':_0x9459('0x56')},'body':{'refid':_0x4f2cf0[_0x9459('0x71')][_0x9459('0x73')]},'json':!![]};return rp(_0xd82a83)[_0x9459('0x18')](function(_0x3e5620){_0x4f2cf0[_0x9459('0x74')]=_0x3e5620;var _0x2c602f={'messageId':_0x4f2cf0[_0x9459('0x71')][_0x9459('0x73')],'read':!![]};return _0x207eea[_0x9459('0x19')](_0x2c602f);});}else{return logger[_0x9459('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x9459('0x2a'),_0x9459('0x6d'),util[_0x9459('0x29')](_0x1df1a3,{'showHidden':![],'depth':null}));}})[_0x9459('0x27')](function(_0x59cb29){return logger[_0x9459('0x1b')](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x6d'),util[_0x9459('0x29')](_0x59cb29,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0x9459('0x28'),_0x9459('0x2a'),_0x9459('0x6d'),_0x9459('0x75'));}break;}}})['finally'](function(){_0x1bbaeb();});}else{_0x1bbaeb();}}},'charset':'utf8mb4','collate':_0x9459('0x76')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 46a4c89..deced77 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 _0x9558=['catch','CreateSmsMessage','SmsMessage','body','options','raw','debug','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x9558,0xee));var _0x8955=function(_0x33055e,_0x54dff9){_0x33055e=_0x33055e-0x0;var _0x41dfb4=_0x9558[_0x33055e];return _0x41dfb4;};'use strict';var _=require(_0x8955('0x0'));var util=require('util');var moment=require(_0x8955('0x1'));var BPromise=require('bluebird');var rs=require(_0x8955('0x2'));var fs=require('fs');var Redis=require(_0x8955('0x3'));var db=require(_0x8955('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8955('0x5'));var config=require(_0x8955('0x6'));var jayson=require(_0x8955('0x7'));var client=jayson[_0x8955('0x8')]['http']({'port':0x232a});config[_0x8955('0x9')]=_[_0x8955('0xa')](config[_0x8955('0x9')],{'host':_0x8955('0xb'),'port':0x18eb});var socket=require(_0x8955('0xc'))(new Redis(config['redis']));require(_0x8955('0xd'))[_0x8955('0xe')](socket);function respondWithRpcPromise(_0x1cd661,_0x2b8938,_0x12cd7a){return new BPromise(function(_0x40fd42,_0x4f6573){return client[_0x8955('0xf')](_0x1cd661,_0x12cd7a)[_0x8955('0x10')](function(_0xb46926){logger[_0x8955('0x11')](_0x8955('0x12'),_0x2b8938,'request\x20sent');logger['debug'](_0x8955('0x13'),_0x2b8938,_0x8955('0x14'),JSON[_0x8955('0x15')](_0xb46926));if(_0xb46926[_0x8955('0x16')]){if(_0xb46926[_0x8955('0x16')][_0x8955('0x17')]===0x1f4){logger['error'](_0x8955('0x12'),_0x2b8938,_0xb46926[_0x8955('0x16')][_0x8955('0x18')]);return _0x4f6573(_0xb46926['error']['message']);}logger[_0x8955('0x16')](_0x8955('0x12'),_0x2b8938,_0xb46926[_0x8955('0x16')][_0x8955('0x18')]);return _0x40fd42(_0xb46926[_0x8955('0x16')][_0x8955('0x18')]);}else{logger[_0x8955('0x11')](_0x8955('0x12'),_0x2b8938,_0x8955('0x14'));_0x40fd42(_0xb46926[_0x8955('0x19')][_0x8955('0x18')]);}})[_0x8955('0x1a')](function(_0x5cb26e){logger['error']('SmsMessage,\x20%s,\x20%s',_0x2b8938,_0x5cb26e);_0x4f6573(_0x5cb26e);});});}exports[_0x8955('0x1b')]=function(_0x3ddecb){var _0x559e48=this;return new Promise(function(_0xaaba22,_0x1eeb37){return db[_0x8955('0x1c')]['create'](_0x3ddecb[_0x8955('0x1d')],{'raw':_0x3ddecb[_0x8955('0x1e')]?_0x3ddecb['options'][_0x8955('0x1f')]===undefined?!![]:![]:!![]})['then'](function(_0x27fd67){logger[_0x8955('0x11')](_0x8955('0x1b'),_0x3ddecb);logger[_0x8955('0x20')](_0x8955('0x1b'),_0x3ddecb,JSON[_0x8955('0x15')](_0x27fd67));_0xaaba22(_0x27fd67);})[_0x8955('0x1a')](function(_0x49f7b2){logger[_0x8955('0x16')](_0x8955('0x1b'),_0x49f7b2[_0x8955('0x18')],_0x3ddecb);_0x1eeb37(_0x559e48['error'](0x1f4,_0x49f7b2[_0x8955('0x18')]));});});}; \ No newline at end of file +var _0x72d9=['redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateSmsMessage','body','options','raw','then','debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x72d9,0x10d));var _0x972d=function(_0xd0a847,_0x72562b){_0xd0a847=_0xd0a847-0x0;var _0x2536ec=_0x72d9[_0xd0a847];return _0x2536ec;};'use strict';var _=require(_0x972d('0x0'));var util=require('util');var moment=require(_0x972d('0x1'));var BPromise=require(_0x972d('0x2'));var rs=require(_0x972d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x972d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x972d('0x5'))('rpc');var config=require(_0x972d('0x6'));var jayson=require(_0x972d('0x7'));var client=jayson[_0x972d('0x8')][_0x972d('0x9')]({'port':0x232a});config[_0x972d('0xa')]=_[_0x972d('0xb')](config[_0x972d('0xa')],{'host':_0x972d('0xc'),'port':0x18eb});var socket=require(_0x972d('0xd'))(new Redis(config[_0x972d('0xa')]));require(_0x972d('0xe'))['register'](socket);function respondWithRpcPromise(_0x2b380b,_0x9197e9,_0x505d08){return new BPromise(function(_0x59c1a2,_0x329081){return client[_0x972d('0xf')](_0x2b380b,_0x505d08)['then'](function(_0x3cbc91){logger[_0x972d('0x10')](_0x972d('0x11'),_0x9197e9,_0x972d('0x12'));logger['debug'](_0x972d('0x13'),_0x9197e9,_0x972d('0x12'),JSON[_0x972d('0x14')](_0x3cbc91));if(_0x3cbc91['error']){if(_0x3cbc91[_0x972d('0x15')][_0x972d('0x16')]===0x1f4){logger[_0x972d('0x15')](_0x972d('0x11'),_0x9197e9,_0x3cbc91[_0x972d('0x15')][_0x972d('0x17')]);return _0x329081(_0x3cbc91[_0x972d('0x15')][_0x972d('0x17')]);}logger['error'](_0x972d('0x11'),_0x9197e9,_0x3cbc91[_0x972d('0x15')][_0x972d('0x17')]);return _0x59c1a2(_0x3cbc91[_0x972d('0x15')][_0x972d('0x17')]);}else{logger[_0x972d('0x10')]('SmsMessage,\x20%s,\x20%s',_0x9197e9,_0x972d('0x12'));_0x59c1a2(_0x3cbc91['result'][_0x972d('0x17')]);}})[_0x972d('0x18')](function(_0x457205){logger[_0x972d('0x15')]('SmsMessage,\x20%s,\x20%s',_0x9197e9,_0x457205);_0x329081(_0x457205);});});}exports[_0x972d('0x19')]=function(_0x2e74ef){var _0x149176=this;return new Promise(function(_0x469603,_0x1fbec4){return db['SmsMessage']['create'](_0x2e74ef[_0x972d('0x1a')],{'raw':_0x2e74ef[_0x972d('0x1b')]?_0x2e74ef[_0x972d('0x1b')][_0x972d('0x1c')]===undefined?!![]:![]:!![]})[_0x972d('0x1d')](function(_0x2fefa8){logger[_0x972d('0x10')]('CreateSmsMessage',_0x2e74ef);logger[_0x972d('0x1e')](_0x972d('0x19'),_0x2e74ef,JSON[_0x972d('0x14')](_0x2fefa8));_0x469603(_0x2fefa8);})['catch'](function(_0x3598e5){logger[_0x972d('0x15')]('CreateSmsMessage',_0x3598e5[_0x972d('0x17')],_0x2e74ef);_0x1fbec4(_0x149176[_0x972d('0x15')](0x1f4,_0x3598e5['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index f6c6261..d1e63f3 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 _0x8b26=['save','remove','update','emit','removeListener','register','length','./smsMessage.events'];(function(_0x2adc2d,_0x5a378c){var _0x558162=function(_0x18c640){while(--_0x18c640){_0x2adc2d['push'](_0x2adc2d['shift']());}};_0x558162(++_0x5a378c);}(_0x8b26,0x1df));var _0x68b2=function(_0x589fb1,_0x5d8fb5){_0x589fb1=_0x589fb1-0x0;var _0x12195c=_0x8b26[_0x589fb1];return _0x12195c;};'use strict';var SmsMessageEvents=require(_0x68b2('0x0'));var events=[_0x68b2('0x1'),_0x68b2('0x2'),_0x68b2('0x3')];function createListener(_0x11d6b7,_0x2b7674){return function(_0xca81b9){_0x2b7674[_0x68b2('0x4')](_0x11d6b7,_0xca81b9);};}function removeListener(_0x5c3194,_0x350142){return function(){SmsMessageEvents[_0x68b2('0x5')](_0x5c3194,_0x350142);};}exports[_0x68b2('0x6')]=function(_0x181e13){for(var _0x1a991e=0x0,_0xddce3e=events[_0x68b2('0x7')];_0x1a991e<_0xddce3e;_0x1a991e++){var _0x3df58a=events[_0x1a991e];var _0x2e22e3=createListener('smsMessage:'+_0x3df58a,_0x181e13);SmsMessageEvents['on'](_0x3df58a,_0x2e22e3);}}; \ No newline at end of file +var _0x96e6=['update','emit','removeListener','./smsMessage.events','remove'];(function(_0x1fa841,_0x37a70c){var _0x384b67=function(_0x248c40){while(--_0x248c40){_0x1fa841['push'](_0x1fa841['shift']());}};_0x384b67(++_0x37a70c);}(_0x96e6,0x17f));var _0x696e=function(_0x25634c,_0x1e1c8d){_0x25634c=_0x25634c-0x0;var _0x5d1001=_0x96e6[_0x25634c];return _0x5d1001;};'use strict';var SmsMessageEvents=require(_0x696e('0x0'));var events=['save',_0x696e('0x1'),_0x696e('0x2')];function createListener(_0x7b1e6f,_0x3b945b){return function(_0x441fe1){_0x3b945b[_0x696e('0x3')](_0x7b1e6f,_0x441fe1);};}function removeListener(_0x1a3acd,_0x51f33d){return function(){SmsMessageEvents[_0x696e('0x4')](_0x1a3acd,_0x51f33d);};}exports['register']=function(_0x58aaed){for(var _0x55b46b=0x0,_0x3cb2b4=events['length'];_0x55b46b<_0x3cb2b4;_0x55b46b++){var _0x26e628=events[_0x55b46b];var _0x48ee27=createListener('smsMessage:'+_0x26e628,_0x58aaed);SmsMessageEvents['on'](_0x26e628,_0x48ee27);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index c4f4f36..47ec5ed 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 _0x5b16=['../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','describe','show','getMembers','/:id/users','getAgents','post','create','/:id/teams','addTeams','addAgents','put','/:id','update','destroy','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x462d89,_0x36bf80){var _0x355f58=function(_0x58422d){while(--_0x58422d){_0x462d89['push'](_0x462d89['shift']());}};_0x355f58(++_0x36bf80);}(_0x5b16,0x6a));var _0x65b1=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x5b16[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x65b1('0x0'));var util=require(_0x65b1('0x1'));var path=require('path');var timeout=require(_0x65b1('0x2'));var express=require(_0x65b1('0x3'));var router=express['Router']();var fs_extra=require(_0x65b1('0x4'));var auth=require(_0x65b1('0x5'));var interaction=require(_0x65b1('0x6'));var config=require(_0x65b1('0x7'));var controller=require(_0x65b1('0x8'));router['get']('/',auth[_0x65b1('0x9')](),controller[_0x65b1('0xa')]);router[_0x65b1('0xb')]('/describe',auth[_0x65b1('0x9')](),controller[_0x65b1('0xc')]);router[_0x65b1('0xb')]('/:id',auth[_0x65b1('0x9')](),controller[_0x65b1('0xd')]);router[_0x65b1('0xb')]('/:id/members',auth[_0x65b1('0x9')](),controller[_0x65b1('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0x65b1('0xb')](_0x65b1('0xf'),auth[_0x65b1('0x9')](),controller[_0x65b1('0x10')]);router[_0x65b1('0x11')]('/',auth['isAuthenticated'](),controller[_0x65b1('0x12')]);router[_0x65b1('0x11')](_0x65b1('0x13'),auth[_0x65b1('0x9')](),controller[_0x65b1('0x14')]);router[_0x65b1('0x11')]('/:id/users',auth['isAuthenticated'](),controller[_0x65b1('0x15')]);router[_0x65b1('0x16')](_0x65b1('0x17'),auth[_0x65b1('0x9')](),controller[_0x65b1('0x18')]);router['delete'](_0x65b1('0x17'),auth['isAuthenticated'](),controller[_0x65b1('0x19')]);router['delete'](_0x65b1('0x13'),auth[_0x65b1('0x9')](),controller['removeTeams']);router[_0x65b1('0x1a')](_0x65b1('0xf'),auth[_0x65b1('0x9')](),controller['removeAgents']);module[_0x65b1('0x1b')]=router; \ No newline at end of file +var _0x7cb2=['delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','addAgents','/:id','update'];(function(_0x51caf0,_0x223bfe){var _0x485afa=function(_0x2e3ba1){while(--_0x2e3ba1){_0x51caf0['push'](_0x51caf0['shift']());}};_0x485afa(++_0x223bfe);}(_0x7cb2,0x1c5));var _0x27cb=function(_0x31ff00,_0x5a8061){_0x31ff00=_0x31ff00-0x0;var _0x368dfc=_0x7cb2[_0x31ff00];return _0x368dfc;};'use strict';var multer=require(_0x27cb('0x0'));var util=require(_0x27cb('0x1'));var path=require(_0x27cb('0x2'));var timeout=require(_0x27cb('0x3'));var express=require(_0x27cb('0x4'));var router=express[_0x27cb('0x5')]();var fs_extra=require(_0x27cb('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x27cb('0x7'));var config=require('../../config/environment');var controller=require('./smsQueue.controller');router[_0x27cb('0x8')]('/',auth[_0x27cb('0x9')](),controller['index']);router[_0x27cb('0x8')](_0x27cb('0xa'),auth[_0x27cb('0x9')](),controller[_0x27cb('0xb')]);router[_0x27cb('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x27cb('0xc'),auth[_0x27cb('0x9')](),controller[_0x27cb('0xd')]);router['get']('/:id/teams',auth[_0x27cb('0x9')](),controller[_0x27cb('0xe')]);router['get'](_0x27cb('0xf'),auth['isAuthenticated'](),controller[_0x27cb('0x10')]);router[_0x27cb('0x11')]('/',auth[_0x27cb('0x9')](),controller['create']);router[_0x27cb('0x11')](_0x27cb('0x12'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x13')]);router[_0x27cb('0x11')](_0x27cb('0xf'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x14')]);router['put'](_0x27cb('0x15'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x16')]);router[_0x27cb('0x17')](_0x27cb('0x15'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x18')]);router[_0x27cb('0x17')](_0x27cb('0x12'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x19')]);router[_0x27cb('0x17')](_0x27cb('0xf'),auth[_0x27cb('0x9')](),controller[_0x27cb('0x1a')]);module[_0x27cb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 657eb33..a16829f 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 _0x388f=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1082ee,_0x18607a){var _0x88187e=function(_0x2b2c51){while(--_0x2b2c51){_0x1082ee['push'](_0x1082ee['shift']());}};_0x88187e(++_0x18607a);}(_0x388f,0x1a7));var _0xf388=function(_0x4d7f3f,_0x4d2803){_0x4d7f3f=_0x4d7f3f-0x0;var _0x5d67cc=_0x388f[_0x4d7f3f];return _0x5d67cc;};'use strict';var Sequelize=require(_0xf388('0x0'));module[_0xf388('0x1')]={'name':{'type':Sequelize[_0xf388('0x2')],'unique':_0xf388('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xf388('0x2')]},'timeout':{'type':Sequelize[_0xf388('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xf388('0x5')](_0xf388('0x6'),_0xf388('0x7'),_0xf388('0x8'))}}; \ No newline at end of file +var _0xc701=['ENUM','rrmemory','beepall','sequelize','STRING','INTEGER'];(function(_0xc07c84,_0xdcb1c5){var _0x2c56d5=function(_0x13b487){while(--_0x13b487){_0xc07c84['push'](_0xc07c84['shift']());}};_0x2c56d5(++_0xdcb1c5);}(_0xc701,0xa5));var _0x1c70=function(_0x277eb4,_0x3076f9){_0x277eb4=_0x277eb4-0x0;var _0x41dfb7=_0xc701[_0x277eb4];return _0x41dfb7;};'use strict';var Sequelize=require(_0x1c70('0x0'));module['exports']={'name':{'type':Sequelize[_0x1c70('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1c70('0x1')]},'timeout':{'type':Sequelize[_0x1c70('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1c70('0x3')](_0x1c70('0x4'),_0x1c70('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f446d9c..e986b6f 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 _0x71b3=['sort','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','format','SIP','getTeams','findOne','order','addTeams','ids','Team','Agents','online','interface','flatMap','transaction','each','findOrCreate','emit','userSmsQueue:save','select','team_has_sms_queues','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','sequelize','QueryTypes','every','TeamId','includes','all','value','removeTeams','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','get','SmsQueues','UserProfileResource','destroy','end','error','stack','name','send','map','rawAttributes','type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','where','pick','filter','merge','options','includeAll','include','SmsQueue','findAll','rows','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','UserSmsQueue','hasOwnProperty'];(function(_0x1a574a,_0x5c1b4f){var _0x1d3ccb=function(_0x2d265a){while(--_0x2d265a){_0x1a574a['push'](_0x1a574a['shift']());}};_0x1d3ccb(++_0x5c1b4f);}(_0x71b3,0x137));var _0x371b=function(_0x52ad5f,_0x5e6c6e){_0x52ad5f=_0x52ad5f-0x0;var _0x1a7926=_0x71b3[_0x52ad5f];return _0x1a7926;};'use strict';var emlformat=require(_0x371b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x371b('0x1'));var jsonpatch=require(_0x371b('0x2'));var rp=require(_0x371b('0x3'));var moment=require(_0x371b('0x4'));var BPromise=require(_0x371b('0x5'));var Mustache=require(_0x371b('0x6'));var util=require(_0x371b('0x7'));var path=require('path');var sox=require(_0x371b('0x8'));var csv=require(_0x371b('0x9'));var ejs=require(_0x371b('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x371b('0xb'));var squel=require(_0x371b('0xc'));var crypto=require(_0x371b('0xd'));var jsforce=require(_0x371b('0xe'));var deskjs=require(_0x371b('0xf'));var toCsv=require('to-csv');var querystring=require(_0x371b('0x10'));var Papa=require(_0x371b('0x11'));var Redis=require(_0x371b('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x371b('0x13'));var as=require(_0x371b('0x14'));var hardwareService=require(_0x371b('0x15'));var logger=require(_0x371b('0x16'))(_0x371b('0x17'));var utils=require('../../config/utils');var config=require(_0x371b('0x18'));var licenseUtil=require(_0x371b('0x19'));var db=require(_0x371b('0x1a'))['db'];config[_0x371b('0x1b')]=_['defaults'](config[_0x371b('0x1b')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x371b('0x1b')]));require('./smsQueue.socket')['register'](socket);function respondWithStatusCode(_0x38b37f,_0x5662a7){_0x5662a7=_0x5662a7||0xcc;return function(_0x646f9){if(_0x646f9){return _0x38b37f[_0x371b('0x1c')](_0x5662a7);}return _0x38b37f['status'](_0x5662a7)['end']();};}function respondWithResult(_0x37429c,_0x3ef6b8){_0x3ef6b8=_0x3ef6b8||0xc8;return function(_0x44221d){if(_0x44221d){return _0x37429c[_0x371b('0x1d')](_0x3ef6b8)['json'](_0x44221d);}};}function respondWithFilteredResult(_0x46a33b,_0x59819c){return function(_0x21a1a1){if(_0x21a1a1){var _0x2b4831=typeof _0x59819c[_0x371b('0x1e')]===_0x371b('0x1f')&&typeof _0x59819c[_0x371b('0x20')]===_0x371b('0x1f');var _0x48dc6c=_0x21a1a1['count'];var _0x268005=_0x2b4831?0x0:_0x59819c[_0x371b('0x1e')];var _0x6f4be6=_0x2b4831?_0x21a1a1[_0x371b('0x21')]:_0x59819c[_0x371b('0x1e')]+_0x59819c[_0x371b('0x20')];var _0xae80eb;if(_0x6f4be6>=_0x48dc6c){_0x6f4be6=_0x48dc6c;_0xae80eb=0xc8;}else{_0xae80eb=0xce;}_0x46a33b[_0x371b('0x1d')](_0xae80eb);return _0x46a33b[_0x371b('0x22')](_0x371b('0x23'),_0x268005+'-'+_0x6f4be6+'/'+_0x48dc6c)[_0x371b('0x24')](_0x21a1a1);}return null;};}function patchUpdates(_0x123fc3){return function(_0x157107){try{jsonpatch[_0x371b('0x25')](_0x157107,_0x123fc3,!![]);}catch(_0x4fef78){return BPromise['reject'](_0x4fef78);}return _0x157107[_0x371b('0x26')]();};}function saveUpdates(_0x1f998b,_0x299075){return function(_0x3cf268){if(_0x3cf268){return _0x3cf268['update'](_0x1f998b)[_0x371b('0x27')](function(_0x155b8e){return _0x155b8e;});}return null;};}function removeEntity(_0x13be24,_0x1ea0d7){return function(_0x5a7cdd){if(_0x5a7cdd){return _0x5a7cdd['destroy']()[_0x371b('0x27')](function(){var _0x3290e8=_0x5a7cdd[_0x371b('0x28')]({'plain':!![]});var _0x58138d=_0x371b('0x29');return db[_0x371b('0x2a')][_0x371b('0x2b')]({'where':{'type':_0x58138d,'resourceId':_0x3290e8['id']}})[_0x371b('0x27')](function(){return _0x5a7cdd;});})[_0x371b('0x27')](function(){_0x13be24[_0x371b('0x1d')](0xcc)[_0x371b('0x2c')]();});}};}function handleEntityNotFound(_0x9e8152,_0x2f2570){return function(_0x36a341){if(!_0x36a341){_0x9e8152[_0x371b('0x1c')](0x194);}return _0x36a341;};}function handleError(_0x2136fe,_0x10303d){_0x10303d=_0x10303d||0x1f4;return function(_0x2aa073){logger[_0x371b('0x2d')](_0x2aa073[_0x371b('0x2e')]);if(_0x2aa073[_0x371b('0x2f')]){delete _0x2aa073[_0x371b('0x2f')];}_0x2136fe[_0x371b('0x1d')](_0x10303d)[_0x371b('0x30')](_0x2aa073);};}exports['index']=function(_0x151c8b,_0x19c168){var _0x16e510={},_0x442471={},_0x4c677d={'count':0x0,'rows':[]};var _0x103e36=_[_0x371b('0x31')](db['SmsQueue'][_0x371b('0x32')],function(_0x5ea895){return{'name':_0x5ea895['fieldName'],'type':_0x5ea895[_0x371b('0x33')][_0x371b('0x34')]};});_0x442471[_0x371b('0x35')]=_[_0x371b('0x31')](_0x103e36,_0x371b('0x2f'));_0x442471['query']=_[_0x371b('0x36')](_0x151c8b['query']);_0x442471[_0x371b('0x37')]=_[_0x371b('0x38')](_0x442471[_0x371b('0x35')],_0x442471[_0x371b('0x39')]);_0x16e510[_0x371b('0x3a')]=_[_0x371b('0x38')](_0x442471['model'],qs['fields'](_0x151c8b['query'][_0x371b('0x3b')]));_0x16e510[_0x371b('0x3a')]=_0x16e510['attributes'][_0x371b('0x3c')]?_0x16e510[_0x371b('0x3a')]:_0x442471[_0x371b('0x35')];if(!_0x151c8b[_0x371b('0x39')]['hasOwnProperty'](_0x371b('0x3d'))){_0x16e510[_0x371b('0x20')]=qs[_0x371b('0x20')](_0x151c8b[_0x371b('0x39')][_0x371b('0x20')]);_0x16e510[_0x371b('0x1e')]=qs[_0x371b('0x1e')](_0x151c8b[_0x371b('0x39')]['offset']);}_0x16e510['order']=qs['sort'](_0x151c8b[_0x371b('0x39')]['sort']);_0x16e510[_0x371b('0x3e')]=qs['filters'](_[_0x371b('0x3f')](_0x151c8b[_0x371b('0x39')],_0x442471[_0x371b('0x37')]),_0x103e36);if(_0x151c8b[_0x371b('0x39')][_0x371b('0x40')]){_0x16e510[_0x371b('0x3e')]=_[_0x371b('0x41')](_0x16e510['where'],{'$or':_[_0x371b('0x31')](_0x103e36,function(_0x26b17d){if(_0x26b17d[_0x371b('0x33')]!=='VIRTUAL'){var _0x184aa2={};_0x184aa2[_0x26b17d[_0x371b('0x2f')]]={'$like':'%'+_0x151c8b[_0x371b('0x39')][_0x371b('0x40')]+'%'};return _0x184aa2;}})});}_0x16e510=_[_0x371b('0x41')]({},_0x16e510,_0x151c8b[_0x371b('0x42')]);var _0x46adfa={'where':_0x16e510[_0x371b('0x3e')]};return db['SmsQueue'][_0x371b('0x21')](_0x46adfa)[_0x371b('0x27')](function(_0x103cc9){_0x4c677d[_0x371b('0x21')]=_0x103cc9;if(_0x151c8b['query'][_0x371b('0x43')]){_0x16e510[_0x371b('0x44')]=[{'all':!![]}];}return db[_0x371b('0x45')][_0x371b('0x46')](_0x16e510);})[_0x371b('0x27')](function(_0xb44284){_0x4c677d[_0x371b('0x47')]=_0xb44284;return _0x4c677d;})[_0x371b('0x27')](respondWithFilteredResult(_0x19c168,_0x16e510))['catch'](handleError(_0x19c168,null));};exports['show']=function(_0x13b5a9,_0x4c4c58){var _0x2aa59d={'raw':!![],'where':{'id':_0x13b5a9[_0x371b('0x48')]['id']}},_0x1d4371={};_0x1d4371[_0x371b('0x35')]=_[_0x371b('0x36')](db['SmsQueue'][_0x371b('0x32')]);_0x1d4371['query']=_['keys'](_0x13b5a9[_0x371b('0x39')]);_0x1d4371[_0x371b('0x37')]=_[_0x371b('0x38')](_0x1d4371[_0x371b('0x35')],_0x1d4371['query']);_0x2aa59d[_0x371b('0x3a')]=_[_0x371b('0x38')](_0x1d4371[_0x371b('0x35')],qs['fields'](_0x13b5a9[_0x371b('0x39')][_0x371b('0x3b')]));_0x2aa59d[_0x371b('0x3a')]=_0x2aa59d[_0x371b('0x3a')][_0x371b('0x3c')]?_0x2aa59d[_0x371b('0x3a')]:_0x1d4371['model'];if(_0x13b5a9[_0x371b('0x39')][_0x371b('0x43')]){_0x2aa59d[_0x371b('0x44')]=[{'all':!![]}];}_0x2aa59d=_[_0x371b('0x41')]({},_0x2aa59d,_0x13b5a9[_0x371b('0x42')]);return db['SmsQueue'][_0x371b('0x49')](_0x2aa59d)['then'](handleEntityNotFound(_0x4c4c58,null))[_0x371b('0x27')](respondWithResult(_0x4c4c58,null))[_0x371b('0x4a')](handleError(_0x4c4c58,null));};exports[_0x371b('0x4b')]=function(_0xd0443a,_0x368f9d){return db[_0x371b('0x45')]['create'](_0xd0443a['body'],{})[_0x371b('0x27')](function(_0x20119b){var _0x361117=_0xd0443a[_0x371b('0x4c')][_0x371b('0x28')]({'plain':!![]});if(!_0x361117)throw new Error(_0x371b('0x4d'));if(_0x361117[_0x371b('0x4e')]===_0x371b('0x4c')){var _0x4925e1=_0x20119b[_0x371b('0x28')]({'plain':!![]});var _0x4e2328=_0x371b('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x4e2328,'userProfileId':_0x361117['userProfileId']},'raw':!![]})[_0x371b('0x27')](function(_0x46dc4a){if(_0x46dc4a&&_0x46dc4a['autoAssociation']===0x0){return db[_0x371b('0x2a')][_0x371b('0x4b')]({'name':_0x4925e1[_0x371b('0x2f')],'resourceId':_0x4925e1['id'],'type':_0x46dc4a[_0x371b('0x2f')],'sectionId':_0x46dc4a['id']},{})[_0x371b('0x27')](function(){return _0x20119b;});}else{return _0x20119b;}})['catch'](function(_0x50153f){logger['error'](_0x371b('0x4f'),_0x50153f);throw _0x50153f;});}return _0x20119b;})['then'](respondWithResult(_0x368f9d,0xc9))[_0x371b('0x4a')](handleError(_0x368f9d,null));};exports[_0x371b('0x50')]=function(_0x4b0adb,_0x2bf2e0){if(_0x4b0adb[_0x371b('0x51')]['id']){delete _0x4b0adb['body']['id'];}return db['SmsQueue']['find']({'where':{'id':_0x4b0adb[_0x371b('0x48')]['id']}})['then'](handleEntityNotFound(_0x2bf2e0,null))[_0x371b('0x27')](saveUpdates(_0x4b0adb['body'],null))[_0x371b('0x27')](respondWithResult(_0x2bf2e0,null))['catch'](handleError(_0x2bf2e0,null));};exports[_0x371b('0x2b')]=function(_0x317987,_0x501e32){return db['SmsQueue'][_0x371b('0x49')]({'where':{'id':_0x317987['params']['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x501e32,null))[_0x371b('0x27')](removeEntity(_0x501e32,null))[_0x371b('0x4a')](handleError(_0x501e32,null));};exports['describe']=function(_0x13b42c,_0x300556){return db['SmsQueue'][_0x371b('0x52')]()[_0x371b('0x27')](respondWithResult(_0x300556,null))[_0x371b('0x4a')](handleError(_0x300556,null));};exports['getMembers']=function(_0xef9528,_0x25acd0,_0x3afb1a){var _0x226be2={'raw':!![],'where':{}},_0x4a69ed={},_0x333e73;return db[_0x371b('0x45')]['findOne']({'where':{'id':_0xef9528[_0x371b('0x48')]['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x25acd0,null))['then'](function(_0x207ca2){if(_0x207ca2){_0x333e73=_0x207ca2[_0x371b('0x28')]({'plain':!![]});_0x4a69ed[_0x371b('0x35')]=_[_0x371b('0x36')](db[_0x371b('0x53')][_0x371b('0x32')]);_0x4a69ed[_0x371b('0x39')]=_[_0x371b('0x36')](_0xef9528[_0x371b('0x39')]);_0x4a69ed[_0x371b('0x37')]=_[_0x371b('0x38')](_0x4a69ed[_0x371b('0x35')],_0x4a69ed[_0x371b('0x39')]);_0x226be2[_0x371b('0x3a')]=_['intersection'](_0x4a69ed[_0x371b('0x35')],qs[_0x371b('0x3b')](_0xef9528[_0x371b('0x39')][_0x371b('0x3b')]));_0x226be2[_0x371b('0x3a')]=_0x226be2[_0x371b('0x3a')][_0x371b('0x3c')]?_0x226be2[_0x371b('0x3a')]:_0x4a69ed[_0x371b('0x35')];if(!_0xef9528['query'][_0x371b('0x54')](_0x371b('0x3d'))){_0x226be2['limit']=qs[_0x371b('0x20')](_0xef9528['query']['limit']);_0x226be2['offset']=qs['offset'](_0xef9528[_0x371b('0x39')][_0x371b('0x1e')]);}_0x226be2['order']=qs[_0x371b('0x55')](_0xef9528['query'][_0x371b('0x55')]);_0x226be2[_0x371b('0x3e')]=qs[_0x371b('0x37')](_[_0x371b('0x3f')](_0xef9528[_0x371b('0x39')],_0x4a69ed[_0x371b('0x37')]));_0x226be2[_0x371b('0x3e')][_0x371b('0x56')]=_0x207ca2['id'];if(_0xef9528['query'][_0x371b('0x40')]){_0x226be2[_0x371b('0x3e')]=_[_0x371b('0x41')](_0x226be2['where'],{'$or':_[_0x371b('0x31')](_0x226be2[_0x371b('0x3a')],function(_0x1062f0){var _0x3b8158={};_0x3b8158[_0x1062f0]={'$like':'%'+_0xef9528[_0x371b('0x39')][_0x371b('0x40')]+'%'};return _0x3b8158;})});}_0x226be2=_['merge']({},_0x226be2,_0xef9528['options']);return db[_0x371b('0x53')][_0x371b('0x46')](_0x226be2);}})[_0x371b('0x27')](function(_0x47e4f8){if(_0x47e4f8){return db[_0x371b('0x57')]['findAndCountAll']({'where':{'id':_[_0x371b('0x31')](_0x47e4f8,_0x371b('0x58')),'role':'agent'},'attributes':['id',_0x371b('0x2f'),_0x371b('0x59'),_0x371b('0x5a'),_0x371b('0x5b')]});}})['then'](function(_0x18b395){if(_0x18b395){return{'count':_0x18b395[_0x371b('0x21')],'rows':_[_0x371b('0x31')](_0x18b395['rows'],function(_0x29cf79){return{'membername':_0x29cf79[_0x371b('0x2f')],'UserId':_0x29cf79['id'],'queue_name':_0x333e73[_0x371b('0x2f')],'SmsQueueId':_0x333e73['id'],'interface':util[_0x371b('0x5c')]('%s/%s',_0x371b('0x5d'),_0x29cf79[_0x371b('0x2f')]),'penalty':0x0,'paused':_0x29cf79[_0x371b('0x59')],'createdAt':_0x29cf79[_0x371b('0x5b')],'updatedAt':_0x29cf79[_0x371b('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x371b('0x27')](respondWithFilteredResult(_0x25acd0,_0x226be2))[_0x371b('0x4a')](handleError(_0x25acd0,null));};exports[_0x371b('0x5e')]=function(_0x59adc5,_0x1bc116,_0x247d60){var _0x2a337b={};var _0x36ecd3={};var _0x49364d;var _0x34117e;return db[_0x371b('0x45')][_0x371b('0x5f')]({'where':{'id':_0x59adc5[_0x371b('0x48')]['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x1bc116,null))[_0x371b('0x27')](function(_0x121121){if(_0x121121){_0x49364d=_0x121121;_0x36ecd3[_0x371b('0x35')]=_[_0x371b('0x36')](db['Team'][_0x371b('0x32')]);_0x36ecd3[_0x371b('0x39')]=_['keys'](_0x59adc5['query']);_0x36ecd3[_0x371b('0x37')]=_[_0x371b('0x38')](_0x36ecd3[_0x371b('0x35')],_0x36ecd3[_0x371b('0x39')]);_0x2a337b[_0x371b('0x3a')]=_['intersection'](_0x36ecd3['model'],qs[_0x371b('0x3b')](_0x59adc5[_0x371b('0x39')][_0x371b('0x3b')]));_0x2a337b[_0x371b('0x3a')]=_0x2a337b['attributes'][_0x371b('0x3c')]?_0x2a337b[_0x371b('0x3a')]:_0x36ecd3[_0x371b('0x35')];_0x2a337b[_0x371b('0x60')]=qs['sort'](_0x59adc5[_0x371b('0x39')][_0x371b('0x55')]);_0x2a337b[_0x371b('0x3e')]=qs[_0x371b('0x37')](_['pick'](_0x59adc5[_0x371b('0x39')],_0x36ecd3[_0x371b('0x37')]));if(_0x59adc5[_0x371b('0x39')]['filter']){_0x2a337b[_0x371b('0x3e')]=_[_0x371b('0x41')](_0x2a337b[_0x371b('0x3e')],{'$or':_[_0x371b('0x31')](_0x2a337b[_0x371b('0x3a')],function(_0x4ea895){var _0x127dc7={};_0x127dc7[_0x4ea895]={'$like':'%'+_0x59adc5[_0x371b('0x39')][_0x371b('0x40')]+'%'};return _0x127dc7;})});}_0x2a337b=_[_0x371b('0x41')]({},_0x2a337b,_0x59adc5[_0x371b('0x42')]);return _0x49364d[_0x371b('0x5e')](_0x2a337b);}})[_0x371b('0x27')](function(_0xf170f7){if(_0xf170f7){_0x34117e=_0xf170f7[_0x371b('0x3c')];if(!_0x59adc5[_0x371b('0x39')][_0x371b('0x54')](_0x371b('0x3d'))){_0x2a337b[_0x371b('0x20')]=qs[_0x371b('0x20')](_0x59adc5[_0x371b('0x39')][_0x371b('0x20')]);_0x2a337b[_0x371b('0x1e')]=qs['offset'](_0x59adc5[_0x371b('0x39')][_0x371b('0x1e')]);}return _0x49364d['getTeams'](_0x2a337b);}})[_0x371b('0x27')](function(_0x547740){if(_0x547740){return _0x547740?{'count':_0x34117e,'rows':_0x547740}:null;}})[_0x371b('0x27')](respondWithResult(_0x1bc116,null))[_0x371b('0x4a')](handleError(_0x1bc116,null));};exports[_0x371b('0x61')]=function(_0x33c65b,_0x79745,_0x434ed6){var _0x49dc34=_0x33c65b[_0x371b('0x51')][_0x371b('0x62')];return db[_0x371b('0x63')][_0x371b('0x46')]({'where':{'id':_0x49dc34},'attributes':['id'],'include':[{'model':db['User'],'as':_0x371b('0x64'),'attributes':['id',_0x371b('0x2f'),_0x371b('0x65'),'voicePause',_0x371b('0x66')],'raw':!![]}]})[_0x371b('0x27')](function(_0x242a13){if(_0x242a13){var _0x4548f0=_[_0x371b('0x67')](_0x242a13,function(_0x59fc02){var _0x15899d=_0x59fc02[_0x371b('0x28')]({'plain':!![]});return _0x15899d[_0x371b('0x64')];});return db[_0x371b('0x45')][_0x371b('0x49')]({'where':{'id':_0x33c65b['params']['id']}})[_0x371b('0x27')](function(_0x35c6f1){return db['sequelize'][_0x371b('0x68')](function(_0x12f237){return _0x35c6f1[_0x371b('0x61')](_0x49dc34,{'transaction':_0x12f237})[_0x371b('0x27')](function(){return BPromise[_0x371b('0x69')](_0x4548f0,function(_0x2425b9){return db[_0x371b('0x53')][_0x371b('0x6a')]({'where':{'UserId':_0x2425b9['id'],'SmsQueueId':_0x33c65b[_0x371b('0x48')]['id']},'transaction':_0x12f237});});})[_0x371b('0x27')](function(){_0x4548f0['forEach'](function(_0x27b4d5){socket[_0x371b('0x6b')](_0x371b('0x6c'),{'UserId':_0x27b4d5['id'],'SmsQueueId':_0x35c6f1['id']});});});});});}})[_0x371b('0x27')](respondWithStatusCode(_0x79745,null))[_0x371b('0x4a')](handleError(_0x79745,null));};exports['removeTeams']=function(_0x2fbce8,_0x3c780c,_0x2bf0e6){return db[_0x371b('0x63')][_0x371b('0x46')]({'where':{'id':_0x2fbce8[_0x371b('0x39')][_0x371b('0x62')]},'attributes':['id'],'include':[{'model':db[_0x371b('0x57')],'as':_0x371b('0x64'),'attributes':['id'],'raw':!![]}]})[_0x371b('0x27')](handleEntityNotFound(_0x3c780c,null))[_0x371b('0x27')](function(_0x200000){var _0x3e2712=_['map'](_0x200000,'id');var _0x2953b8=[];var _0x568454=[];var _0x4af4be=squel[_0x371b('0x6d')]();_0x4af4be['field']('tq.TeamId')['from'](_0x371b('0x6e'),'tq')['join']('user_has_teams','ut',_0x371b('0x6f'))[_0x371b('0x3e')](_0x371b('0x70'),_0x2fbce8[_0x371b('0x48')]['id']);for(var _0x35c351=0x0;_0x35c351<_0x200000[_0x371b('0x3c')];_0x35c351+=0x1){let _0x501471=_0x200000[_0x35c351];for(var _0x431ea5=0x0;_0x431ea5<_0x501471['Agents'][_0x371b('0x3c')];_0x431ea5+=0x1){let _0x552467=_0x501471['Agents'][_0x431ea5];var _0x4e9a55=_0x4af4be[_0x371b('0x71')]();_0x4e9a55[_0x371b('0x3e')](_0x371b('0x72'),_0x552467['id']);_0x568454[_0x371b('0x73')](db['sequelize'][_0x371b('0x39')](_0x4e9a55[_0x371b('0x74')](),{'type':db[_0x371b('0x75')][_0x371b('0x76')]['SELECT']})['then'](function(_0x1b7a9d){if(_0x1b7a9d[_0x371b('0x3c')]===0x1){return _0x552467['id'];}else{var _0x5118dd=_[_0x371b('0x77')](_[_0x371b('0x31')](_0x1b7a9d,_0x371b('0x78')),function(_0x48656e){return _[_0x371b('0x79')](_0x3e2712,_0x48656e);});if(_0x5118dd){return _0x552467['id'];}}}));}}return BPromise[_0x371b('0x7a')](_0x568454)[_0x371b('0x27')](function(_0x39c709){_0x2953b8=_(_0x2953b8)['union'](_0x39c709)['compact']()[_0x371b('0x7b')]();return db[_0x371b('0x45')][_0x371b('0x49')]({'where':{'id':_0x2fbce8[_0x371b('0x48')]['id']}})['then'](function(_0x4fefaa){return db[_0x371b('0x75')][_0x371b('0x68')](function(_0x55dbf6){return _0x4fefaa[_0x371b('0x7c')](_0x2fbce8[_0x371b('0x39')][_0x371b('0x62')],{'transaction':_0x55dbf6})[_0x371b('0x27')](function(){if(!_['isEmpty'](_0x2953b8)){return _0x4fefaa[_0x371b('0x7d')](_0x2953b8,{'transaction':_0x55dbf6});}})[_0x371b('0x27')](function(){_0x2953b8['forEach'](function(_0x347be6){socket[_0x371b('0x6b')](_0x371b('0x7e'),{'UserId':_0x347be6,'SmsQueueId':_0x4fefaa['id']});});});});});});})['then'](respondWithStatusCode(_0x3c780c,null))[_0x371b('0x4a')](handleError(_0x3c780c,null));};exports[_0x371b('0x7f')]=function(_0x2877c6,_0x4035a5,_0x1f339c){return db[_0x371b('0x45')][_0x371b('0x49')]({'where':{'id':_0x2877c6['params']['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x4035a5,null))[_0x371b('0x27')](function(_0x4ef9bb){if(_0x4ef9bb){return _0x4ef9bb[_0x371b('0x7f')](_0x2877c6[_0x371b('0x51')][_0x371b('0x62')],_[_0x371b('0x80')](_0x2877c6['body'],['ids','id'])||{})[_0x371b('0x81')](function(_0x229e11){for(var _0x1b2688=0x0;_0x1b2688<_0x2877c6[_0x371b('0x51')][_0x371b('0x62')][_0x371b('0x3c')];_0x1b2688+=0x1){socket[_0x371b('0x6b')](_0x371b('0x6c'),{'UserId':Number(_0x2877c6[_0x371b('0x51')][_0x371b('0x62')][_0x1b2688]),'SmsQueueId':Number(_0x2877c6[_0x371b('0x48')]['id'])});}return _0x229e11;});}})[_0x371b('0x27')](respondWithResult(_0x4035a5,null))[_0x371b('0x4a')](handleError(_0x4035a5,null));};exports['removeAgents']=function(_0x52906a,_0x1111d9,_0x19a0b8){return db[_0x371b('0x45')][_0x371b('0x49')]({'where':{'id':_0x52906a[_0x371b('0x48')]['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x1111d9,null))['then'](function(_0x395f2c){if(_0x395f2c){return _0x395f2c[_0x371b('0x7d')](_0x52906a['query'][_0x371b('0x62')])[_0x371b('0x27')](function(){if(_[_0x371b('0x82')](_0x52906a[_0x371b('0x39')][_0x371b('0x62')])){for(var _0x1a224f=0x0;_0x1a224f<_0x52906a[_0x371b('0x39')][_0x371b('0x62')][_0x371b('0x3c')];_0x1a224f+=0x1){socket[_0x371b('0x6b')]('userSmsQueue:remove',{'UserId':Number(_0x52906a[_0x371b('0x39')][_0x371b('0x62')][_0x1a224f]),'SmsQueueId':Number(_0x52906a[_0x371b('0x48')]['id'])});}}else{socket[_0x371b('0x6b')](_0x371b('0x7e'),{'UserId':Number(_0x52906a[_0x371b('0x39')][_0x371b('0x62')]),'SmsQueueId':Number(_0x52906a['params']['id'])});}});}})['then'](respondWithStatusCode(_0x1111d9,null))['catch'](handleError(_0x1111d9,null));};exports[_0x371b('0x83')]=function(_0x2c3f9c,_0x548784,_0x4d6716){var _0x1d834d={};var _0x143a1a={};var _0x4cda4d;var _0x49cc24;return db[_0x371b('0x45')][_0x371b('0x5f')]({'where':{'id':_0x2c3f9c['params']['id']}})[_0x371b('0x27')](handleEntityNotFound(_0x548784,null))['then'](function(_0x2c825f){if(_0x2c825f){_0x4cda4d=_0x2c825f;_0x143a1a[_0x371b('0x35')]=_[_0x371b('0x36')](db[_0x371b('0x57')]['rawAttributes']);_0x143a1a[_0x371b('0x39')]=_['keys'](_0x2c3f9c[_0x371b('0x39')]);_0x143a1a[_0x371b('0x37')]=_[_0x371b('0x38')](_0x143a1a[_0x371b('0x35')],_0x143a1a[_0x371b('0x39')]);_0x1d834d['attributes']=_[_0x371b('0x38')](_0x143a1a['model'],qs[_0x371b('0x3b')](_0x2c3f9c['query'][_0x371b('0x3b')]));_0x1d834d[_0x371b('0x3a')]=_0x1d834d[_0x371b('0x3a')][_0x371b('0x3c')]?_0x1d834d[_0x371b('0x3a')]:_0x143a1a[_0x371b('0x35')];_0x1d834d[_0x371b('0x60')]=qs[_0x371b('0x55')](_0x2c3f9c[_0x371b('0x39')][_0x371b('0x55')]);_0x1d834d['where']=qs[_0x371b('0x37')](_[_0x371b('0x3f')](_0x2c3f9c[_0x371b('0x39')],_0x143a1a[_0x371b('0x37')]));if(_0x2c3f9c[_0x371b('0x39')][_0x371b('0x40')]){_0x1d834d[_0x371b('0x3e')]=_['merge'](_0x1d834d['where'],{'$or':_[_0x371b('0x31')](_0x1d834d[_0x371b('0x3a')],function(_0x28862c){var _0x18a1bd={};_0x18a1bd[_0x28862c]={'$like':'%'+_0x2c3f9c[_0x371b('0x39')][_0x371b('0x40')]+'%'};return _0x18a1bd;})});}_0x1d834d=_[_0x371b('0x41')]({},_0x1d834d,_0x2c3f9c[_0x371b('0x42')]);return _0x4cda4d[_0x371b('0x83')](_0x1d834d);}})[_0x371b('0x27')](function(_0x38661a){if(_0x38661a){_0x49cc24=_0x38661a[_0x371b('0x3c')];if(!_0x2c3f9c[_0x371b('0x39')]['hasOwnProperty'](_0x371b('0x3d'))){_0x1d834d['limit']=qs[_0x371b('0x20')](_0x2c3f9c[_0x371b('0x39')][_0x371b('0x20')]);_0x1d834d[_0x371b('0x1e')]=qs['offset'](_0x2c3f9c['query'][_0x371b('0x1e')]);}return _0x4cda4d[_0x371b('0x83')](_0x1d834d);}})[_0x371b('0x27')](function(_0x48e799){if(_0x48e799){return _0x48e799?{'count':_0x49cc24,'rows':_0x48e799}:null;}})['then'](respondWithResult(_0x548784,null))[_0x371b('0x4a')](handleError(_0x548784,null));}; \ No newline at end of file +var _0x291e=['json','offset','undefined','limit','count','set','reject','save','update','then','destroy','get','error','stack','name','send','map','SmsQueue','rawAttributes','fieldName','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','SmsQueues','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','order','options','UserSmsQueue','User','findAndCountAll','agent','smsPause','updatedAt','rows','createdAt','getTeams','findOne','Team','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','select','field','tq.TeamId','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','userSmsQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status'];(function(_0x25ebef,_0x34893b){var _0x871e1b=function(_0x155523){while(--_0x155523){_0x25ebef['push'](_0x25ebef['shift']());}};_0x871e1b(++_0x34893b);}(_0x291e,0xeb));var _0xe291=function(_0x5769d4,_0x145ab7){_0x5769d4=_0x5769d4-0x0;var _0x2edc93=_0x291e[_0x5769d4];return _0x2edc93;};'use strict';var emlformat=require(_0xe291('0x0'));var rimraf=require(_0xe291('0x1'));var zipdir=require(_0xe291('0x2'));var jsonpatch=require(_0xe291('0x3'));var rp=require(_0xe291('0x4'));var moment=require(_0xe291('0x5'));var BPromise=require(_0xe291('0x6'));var Mustache=require(_0xe291('0x7'));var util=require('util');var path=require(_0xe291('0x8'));var sox=require(_0xe291('0x9'));var csv=require('to-csv');var ejs=require(_0xe291('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe291('0xb'));var crypto=require(_0xe291('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe291('0xd'));var toCsv=require(_0xe291('0xe'));var querystring=require(_0xe291('0xf'));var Papa=require(_0xe291('0x10'));var Redis=require(_0xe291('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe291('0x12'));var hardwareService=require(_0xe291('0x13'));var logger=require(_0xe291('0x14'))('api');var utils=require(_0xe291('0x15'));var config=require(_0xe291('0x16'));var licenseUtil=require(_0xe291('0x17'));var db=require('../../mysqldb')['db'];config[_0xe291('0x18')]=_[_0xe291('0x19')](config[_0xe291('0x18')],{'host':_0xe291('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe291('0x18')]));require(_0xe291('0x1b'))[_0xe291('0x1c')](socket);function respondWithStatusCode(_0x44dec8,_0x1fd50f){_0x1fd50f=_0x1fd50f||0xcc;return function(_0x45f68c){if(_0x45f68c){return _0x44dec8[_0xe291('0x1d')](_0x1fd50f);}return _0x44dec8[_0xe291('0x1e')](_0x1fd50f)['end']();};}function respondWithResult(_0x9b4dd9,_0x67ae66){_0x67ae66=_0x67ae66||0xc8;return function(_0x2b8952){if(_0x2b8952){return _0x9b4dd9[_0xe291('0x1e')](_0x67ae66)[_0xe291('0x1f')](_0x2b8952);}};}function respondWithFilteredResult(_0x580cec,_0x18137d){return function(_0x3b4453){if(_0x3b4453){var _0x116d36=typeof _0x18137d[_0xe291('0x20')]===_0xe291('0x21')&&typeof _0x18137d[_0xe291('0x22')]==='undefined';var _0x397ebe=_0x3b4453[_0xe291('0x23')];var _0x306517=_0x116d36?0x0:_0x18137d[_0xe291('0x20')];var _0x2c1578=_0x116d36?_0x3b4453['count']:_0x18137d[_0xe291('0x20')]+_0x18137d[_0xe291('0x22')];var _0x33a196;if(_0x2c1578>=_0x397ebe){_0x2c1578=_0x397ebe;_0x33a196=0xc8;}else{_0x33a196=0xce;}_0x580cec[_0xe291('0x1e')](_0x33a196);return _0x580cec[_0xe291('0x24')]('Content-Range',_0x306517+'-'+_0x2c1578+'/'+_0x397ebe)[_0xe291('0x1f')](_0x3b4453);}return null;};}function patchUpdates(_0x40ba71){return function(_0x88d521){try{jsonpatch['apply'](_0x88d521,_0x40ba71,!![]);}catch(_0x16e7e0){return BPromise[_0xe291('0x25')](_0x16e7e0);}return _0x88d521[_0xe291('0x26')]();};}function saveUpdates(_0x151cc6,_0xde3df6){return function(_0x38c12f){if(_0x38c12f){return _0x38c12f[_0xe291('0x27')](_0x151cc6)[_0xe291('0x28')](function(_0x317f75){return _0x317f75;});}return null;};}function removeEntity(_0x364164,_0x562fce){return function(_0x1ea944){if(_0x1ea944){return _0x1ea944[_0xe291('0x29')]()[_0xe291('0x28')](function(){var _0x3c946c=_0x1ea944[_0xe291('0x2a')]({'plain':!![]});var _0xc61d73='SmsQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0xc61d73,'resourceId':_0x3c946c['id']}})[_0xe291('0x28')](function(){return _0x1ea944;});})['then'](function(){_0x364164[_0xe291('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x498c78,_0x195f30){return function(_0x5afffa){if(!_0x5afffa){_0x498c78['sendStatus'](0x194);}return _0x5afffa;};}function handleError(_0xdaf764,_0x3c468c){_0x3c468c=_0x3c468c||0x1f4;return function(_0x58db8a){logger[_0xe291('0x2b')](_0x58db8a[_0xe291('0x2c')]);if(_0x58db8a[_0xe291('0x2d')]){delete _0x58db8a[_0xe291('0x2d')];}_0xdaf764[_0xe291('0x1e')](_0x3c468c)[_0xe291('0x2e')](_0x58db8a);};}exports['index']=function(_0x5e45fa,_0x40d06b){var _0x26f09e={},_0x3ce5ff={},_0x443f9e={'count':0x0,'rows':[]};var _0x2f0c41=_[_0xe291('0x2f')](db[_0xe291('0x30')][_0xe291('0x31')],function(_0x1e9c12){return{'name':_0x1e9c12[_0xe291('0x32')],'type':_0x1e9c12['type'][_0xe291('0x33')]};});_0x3ce5ff['model']=_[_0xe291('0x2f')](_0x2f0c41,_0xe291('0x2d'));_0x3ce5ff[_0xe291('0x34')]=_[_0xe291('0x35')](_0x5e45fa['query']);_0x3ce5ff['filters']=_[_0xe291('0x36')](_0x3ce5ff['model'],_0x3ce5ff[_0xe291('0x34')]);_0x26f09e[_0xe291('0x37')]=_[_0xe291('0x36')](_0x3ce5ff[_0xe291('0x38')],qs[_0xe291('0x39')](_0x5e45fa[_0xe291('0x34')][_0xe291('0x39')]));_0x26f09e[_0xe291('0x37')]=_0x26f09e[_0xe291('0x37')][_0xe291('0x3a')]?_0x26f09e['attributes']:_0x3ce5ff['model'];if(!_0x5e45fa['query'][_0xe291('0x3b')](_0xe291('0x3c'))){_0x26f09e[_0xe291('0x22')]=qs[_0xe291('0x22')](_0x5e45fa[_0xe291('0x34')][_0xe291('0x22')]);_0x26f09e[_0xe291('0x20')]=qs[_0xe291('0x20')](_0x5e45fa['query'][_0xe291('0x20')]);}_0x26f09e['order']=qs[_0xe291('0x3d')](_0x5e45fa[_0xe291('0x34')][_0xe291('0x3d')]);_0x26f09e[_0xe291('0x3e')]=qs[_0xe291('0x3f')](_[_0xe291('0x40')](_0x5e45fa['query'],_0x3ce5ff[_0xe291('0x3f')]),_0x2f0c41);if(_0x5e45fa[_0xe291('0x34')][_0xe291('0x41')]){_0x26f09e[_0xe291('0x3e')]=_[_0xe291('0x42')](_0x26f09e[_0xe291('0x3e')],{'$or':_['map'](_0x2f0c41,function(_0x98b527){if(_0x98b527['type']!==_0xe291('0x43')){var _0x59be2e={};_0x59be2e[_0x98b527[_0xe291('0x2d')]]={'$like':'%'+_0x5e45fa[_0xe291('0x34')][_0xe291('0x41')]+'%'};return _0x59be2e;}})});}_0x26f09e=_[_0xe291('0x42')]({},_0x26f09e,_0x5e45fa['options']);var _0x2665be={'where':_0x26f09e['where']};return db[_0xe291('0x30')][_0xe291('0x23')](_0x2665be)[_0xe291('0x28')](function(_0x41af9d){_0x443f9e[_0xe291('0x23')]=_0x41af9d;if(_0x5e45fa[_0xe291('0x34')][_0xe291('0x44')]){_0x26f09e[_0xe291('0x45')]=[{'all':!![]}];}return db[_0xe291('0x30')][_0xe291('0x46')](_0x26f09e);})[_0xe291('0x28')](function(_0x224bfa){_0x443f9e['rows']=_0x224bfa;return _0x443f9e;})[_0xe291('0x28')](respondWithFilteredResult(_0x40d06b,_0x26f09e))[_0xe291('0x47')](handleError(_0x40d06b,null));};exports['show']=function(_0x4e2685,_0x49a826){var _0xacaa8d={'raw':!![],'where':{'id':_0x4e2685[_0xe291('0x48')]['id']}},_0x411fc4={};_0x411fc4[_0xe291('0x38')]=_[_0xe291('0x35')](db[_0xe291('0x30')][_0xe291('0x31')]);_0x411fc4[_0xe291('0x34')]=_['keys'](_0x4e2685[_0xe291('0x34')]);_0x411fc4[_0xe291('0x3f')]=_['intersection'](_0x411fc4[_0xe291('0x38')],_0x411fc4[_0xe291('0x34')]);_0xacaa8d[_0xe291('0x37')]=_['intersection'](_0x411fc4[_0xe291('0x38')],qs[_0xe291('0x39')](_0x4e2685[_0xe291('0x34')][_0xe291('0x39')]));_0xacaa8d[_0xe291('0x37')]=_0xacaa8d[_0xe291('0x37')]['length']?_0xacaa8d[_0xe291('0x37')]:_0x411fc4[_0xe291('0x38')];if(_0x4e2685[_0xe291('0x34')][_0xe291('0x44')]){_0xacaa8d['include']=[{'all':!![]}];}_0xacaa8d=_['merge']({},_0xacaa8d,_0x4e2685['options']);return db[_0xe291('0x30')]['find'](_0xacaa8d)[_0xe291('0x28')](handleEntityNotFound(_0x49a826,null))[_0xe291('0x28')](respondWithResult(_0x49a826,null))[_0xe291('0x47')](handleError(_0x49a826,null));};exports[_0xe291('0x49')]=function(_0x16bdbb,_0x5b9867){return db[_0xe291('0x30')]['create'](_0x16bdbb[_0xe291('0x4a')],{})[_0xe291('0x28')](function(_0x2aee2f){var _0x190b37=_0x16bdbb[_0xe291('0x4b')][_0xe291('0x2a')]({'plain':!![]});if(!_0x190b37)throw new Error(_0xe291('0x4c'));if(_0x190b37[_0xe291('0x4d')]===_0xe291('0x4b')){var _0x34b74b=_0x2aee2f[_0xe291('0x2a')]({'plain':!![]});var _0x20bfbe=_0xe291('0x4e');return db['UserProfileSection'][_0xe291('0x4f')]({'where':{'name':_0x20bfbe,'userProfileId':_0x190b37[_0xe291('0x50')]},'raw':!![]})[_0xe291('0x28')](function(_0x46259e){if(_0x46259e&&_0x46259e['autoAssociation']===0x0){return db[_0xe291('0x51')]['create']({'name':_0x34b74b['name'],'resourceId':_0x34b74b['id'],'type':_0x46259e[_0xe291('0x2d')],'sectionId':_0x46259e['id']},{})['then'](function(){return _0x2aee2f;});}else{return _0x2aee2f;}})['catch'](function(_0x5aae72){logger[_0xe291('0x2b')](_0xe291('0x52'),_0x5aae72);throw _0x5aae72;});}return _0x2aee2f;})[_0xe291('0x28')](respondWithResult(_0x5b9867,0xc9))[_0xe291('0x47')](handleError(_0x5b9867,null));};exports[_0xe291('0x27')]=function(_0x187ef9,_0x56b4a4){if(_0x187ef9['body']['id']){delete _0x187ef9[_0xe291('0x4a')]['id'];}return db[_0xe291('0x30')]['find']({'where':{'id':_0x187ef9[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x56b4a4,null))[_0xe291('0x28')](saveUpdates(_0x187ef9[_0xe291('0x4a')],null))[_0xe291('0x28')](respondWithResult(_0x56b4a4,null))[_0xe291('0x47')](handleError(_0x56b4a4,null));};exports['destroy']=function(_0x504cd1,_0x425cd1){return db['SmsQueue']['find']({'where':{'id':_0x504cd1['params']['id']}})['then'](handleEntityNotFound(_0x425cd1,null))['then'](removeEntity(_0x425cd1,null))[_0xe291('0x47')](handleError(_0x425cd1,null));};exports['describe']=function(_0x3daf0e,_0x2866f7){return db['SmsQueue'][_0xe291('0x53')]()[_0xe291('0x28')](respondWithResult(_0x2866f7,null))[_0xe291('0x47')](handleError(_0x2866f7,null));};exports[_0xe291('0x54')]=function(_0x38f23a,_0x2886b3,_0x32d3ac){var _0x1a3471={'raw':!![],'where':{}},_0x409730={},_0x694fd9;return db[_0xe291('0x30')]['findOne']({'where':{'id':_0x38f23a[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x2886b3,null))[_0xe291('0x28')](function(_0x3fbb48){if(_0x3fbb48){_0x694fd9=_0x3fbb48['get']({'plain':!![]});_0x409730[_0xe291('0x38')]=_[_0xe291('0x35')](db['UserSmsQueue']['rawAttributes']);_0x409730[_0xe291('0x34')]=_[_0xe291('0x35')](_0x38f23a[_0xe291('0x34')]);_0x409730[_0xe291('0x3f')]=_['intersection'](_0x409730['model'],_0x409730[_0xe291('0x34')]);_0x1a3471[_0xe291('0x37')]=_[_0xe291('0x36')](_0x409730[_0xe291('0x38')],qs[_0xe291('0x39')](_0x38f23a[_0xe291('0x34')][_0xe291('0x39')]));_0x1a3471[_0xe291('0x37')]=_0x1a3471[_0xe291('0x37')][_0xe291('0x3a')]?_0x1a3471['attributes']:_0x409730[_0xe291('0x38')];if(!_0x38f23a[_0xe291('0x34')][_0xe291('0x3b')]('nolimit')){_0x1a3471[_0xe291('0x22')]=qs[_0xe291('0x22')](_0x38f23a[_0xe291('0x34')][_0xe291('0x22')]);_0x1a3471['offset']=qs[_0xe291('0x20')](_0x38f23a['query']['offset']);}_0x1a3471[_0xe291('0x55')]=qs['sort'](_0x38f23a['query'][_0xe291('0x3d')]);_0x1a3471[_0xe291('0x3e')]=qs['filters'](_[_0xe291('0x40')](_0x38f23a[_0xe291('0x34')],_0x409730[_0xe291('0x3f')]));_0x1a3471[_0xe291('0x3e')]['SmsQueueId']=_0x3fbb48['id'];if(_0x38f23a[_0xe291('0x34')][_0xe291('0x41')]){_0x1a3471[_0xe291('0x3e')]=_[_0xe291('0x42')](_0x1a3471[_0xe291('0x3e')],{'$or':_[_0xe291('0x2f')](_0x1a3471[_0xe291('0x37')],function(_0x3c9571){var _0x55fe8a={};_0x55fe8a[_0x3c9571]={'$like':'%'+_0x38f23a[_0xe291('0x34')]['filter']+'%'};return _0x55fe8a;})});}_0x1a3471=_[_0xe291('0x42')]({},_0x1a3471,_0x38f23a[_0xe291('0x56')]);return db[_0xe291('0x57')]['findAll'](_0x1a3471);}})[_0xe291('0x28')](function(_0x4da99d){if(_0x4da99d){return db[_0xe291('0x58')][_0xe291('0x59')]({'where':{'id':_[_0xe291('0x2f')](_0x4da99d,'UserId'),'role':_0xe291('0x5a')},'attributes':['id',_0xe291('0x2d'),_0xe291('0x5b'),_0xe291('0x5c'),'createdAt']});}})['then'](function(_0x1ad82a){if(_0x1ad82a){return{'count':_0x1ad82a[_0xe291('0x23')],'rows':_[_0xe291('0x2f')](_0x1ad82a[_0xe291('0x5d')],function(_0xc21710){return{'membername':_0xc21710[_0xe291('0x2d')],'UserId':_0xc21710['id'],'queue_name':_0x694fd9[_0xe291('0x2d')],'SmsQueueId':_0x694fd9['id'],'interface':util['format']('%s/%s','SIP',_0xc21710[_0xe291('0x2d')]),'penalty':0x0,'paused':_0xc21710['smsPause'],'createdAt':_0xc21710[_0xe291('0x5e')],'updatedAt':_0xc21710[_0xe291('0x5c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe291('0x28')](respondWithFilteredResult(_0x2886b3,_0x1a3471))[_0xe291('0x47')](handleError(_0x2886b3,null));};exports[_0xe291('0x5f')]=function(_0x2736aa,_0x5c232a,_0x4add67){var _0x4e99f0={};var _0x527ee3={};var _0x9d90cd;var _0x26c217;return db[_0xe291('0x30')][_0xe291('0x60')]({'where':{'id':_0x2736aa[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x5c232a,null))[_0xe291('0x28')](function(_0xaa9cf1){if(_0xaa9cf1){_0x9d90cd=_0xaa9cf1;_0x527ee3[_0xe291('0x38')]=_['keys'](db[_0xe291('0x61')][_0xe291('0x31')]);_0x527ee3[_0xe291('0x34')]=_[_0xe291('0x35')](_0x2736aa[_0xe291('0x34')]);_0x527ee3[_0xe291('0x3f')]=_[_0xe291('0x36')](_0x527ee3[_0xe291('0x38')],_0x527ee3[_0xe291('0x34')]);_0x4e99f0['attributes']=_[_0xe291('0x36')](_0x527ee3[_0xe291('0x38')],qs['fields'](_0x2736aa[_0xe291('0x34')][_0xe291('0x39')]));_0x4e99f0[_0xe291('0x37')]=_0x4e99f0['attributes'][_0xe291('0x3a')]?_0x4e99f0[_0xe291('0x37')]:_0x527ee3['model'];_0x4e99f0[_0xe291('0x55')]=qs[_0xe291('0x3d')](_0x2736aa[_0xe291('0x34')][_0xe291('0x3d')]);_0x4e99f0[_0xe291('0x3e')]=qs[_0xe291('0x3f')](_[_0xe291('0x40')](_0x2736aa['query'],_0x527ee3[_0xe291('0x3f')]));if(_0x2736aa['query']['filter']){_0x4e99f0[_0xe291('0x3e')]=_[_0xe291('0x42')](_0x4e99f0[_0xe291('0x3e')],{'$or':_[_0xe291('0x2f')](_0x4e99f0[_0xe291('0x37')],function(_0x32ee6a){var _0x27062e={};_0x27062e[_0x32ee6a]={'$like':'%'+_0x2736aa[_0xe291('0x34')][_0xe291('0x41')]+'%'};return _0x27062e;})});}_0x4e99f0=_['merge']({},_0x4e99f0,_0x2736aa[_0xe291('0x56')]);return _0x9d90cd[_0xe291('0x5f')](_0x4e99f0);}})['then'](function(_0x3fac2e){if(_0x3fac2e){_0x26c217=_0x3fac2e['length'];if(!_0x2736aa[_0xe291('0x34')]['hasOwnProperty'](_0xe291('0x3c'))){_0x4e99f0['limit']=qs[_0xe291('0x22')](_0x2736aa['query'][_0xe291('0x22')]);_0x4e99f0[_0xe291('0x20')]=qs[_0xe291('0x20')](_0x2736aa[_0xe291('0x34')]['offset']);}return _0x9d90cd[_0xe291('0x5f')](_0x4e99f0);}})[_0xe291('0x28')](function(_0x4a536c){if(_0x4a536c){return _0x4a536c?{'count':_0x26c217,'rows':_0x4a536c}:null;}})[_0xe291('0x28')](respondWithResult(_0x5c232a,null))[_0xe291('0x47')](handleError(_0x5c232a,null));};exports['addTeams']=function(_0x35e4f8,_0x375307,_0x24e063){var _0x3dfa58=_0x35e4f8[_0xe291('0x4a')][_0xe291('0x62')];return db[_0xe291('0x61')][_0xe291('0x46')]({'where':{'id':_0x3dfa58},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe291('0x63'),'attributes':['id',_0xe291('0x2d'),_0xe291('0x64'),'voicePause',_0xe291('0x65')],'raw':!![]}]})['then'](function(_0x34256b){if(_0x34256b){var _0x4ccb7a=_[_0xe291('0x66')](_0x34256b,function(_0x849c99){var _0x2d835e=_0x849c99[_0xe291('0x2a')]({'plain':!![]});return _0x2d835e[_0xe291('0x63')];});return db[_0xe291('0x30')][_0xe291('0x4f')]({'where':{'id':_0x35e4f8[_0xe291('0x48')]['id']}})[_0xe291('0x28')](function(_0x16c1e4){return db[_0xe291('0x67')][_0xe291('0x68')](function(_0x3166c3){return _0x16c1e4[_0xe291('0x69')](_0x3dfa58,{'transaction':_0x3166c3})[_0xe291('0x28')](function(){return BPromise[_0xe291('0x6a')](_0x4ccb7a,function(_0xba9b3e){return db['UserSmsQueue'][_0xe291('0x6b')]({'where':{'UserId':_0xba9b3e['id'],'SmsQueueId':_0x35e4f8[_0xe291('0x48')]['id']},'transaction':_0x3166c3});});})[_0xe291('0x28')](function(){_0x4ccb7a[_0xe291('0x6c')](function(_0x32cb05){socket[_0xe291('0x6d')](_0xe291('0x6e'),{'UserId':_0x32cb05['id'],'SmsQueueId':_0x16c1e4['id']});});});});});}})[_0xe291('0x28')](respondWithStatusCode(_0x375307,null))[_0xe291('0x47')](handleError(_0x375307,null));};exports[_0xe291('0x6f')]=function(_0x31fbe9,_0x53079c,_0x567b70){return db['Team']['findAll']({'where':{'id':_0x31fbe9[_0xe291('0x34')][_0xe291('0x62')]},'attributes':['id'],'include':[{'model':db[_0xe291('0x58')],'as':_0xe291('0x63'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x53079c,null))[_0xe291('0x28')](function(_0x2b2d1a){var _0x25de81=_[_0xe291('0x2f')](_0x2b2d1a,'id');var _0x2b9c70=[];var _0x5b160d=[];var _0x6dc41=squel[_0xe291('0x70')]();_0x6dc41[_0xe291('0x71')](_0xe291('0x72'))['from'](_0xe291('0x73'),'tq')[_0xe291('0x74')]('user_has_teams','ut',_0xe291('0x75'))[_0xe291('0x3e')](_0xe291('0x76'),_0x31fbe9[_0xe291('0x48')]['id']);for(var _0x471542=0x0;_0x471542<_0x2b2d1a['length'];_0x471542+=0x1){let _0x2c3954=_0x2b2d1a[_0x471542];for(var _0x3a99d3=0x0;_0x3a99d3<_0x2c3954[_0xe291('0x63')]['length'];_0x3a99d3+=0x1){let _0x77d271=_0x2c3954['Agents'][_0x3a99d3];var _0x632be0=_0x6dc41[_0xe291('0x77')]();_0x632be0[_0xe291('0x3e')](_0xe291('0x78'),_0x77d271['id']);_0x5b160d[_0xe291('0x79')](db[_0xe291('0x67')]['query'](_0x632be0['toString'](),{'type':db[_0xe291('0x67')][_0xe291('0x7a')][_0xe291('0x7b')]})[_0xe291('0x28')](function(_0x57b37b){if(_0x57b37b[_0xe291('0x3a')]===0x1){return _0x77d271['id'];}else{var _0x3bfe98=_[_0xe291('0x7c')](_[_0xe291('0x2f')](_0x57b37b,_0xe291('0x7d')),function(_0x44d5af){return _['includes'](_0x25de81,_0x44d5af);});if(_0x3bfe98){return _0x77d271['id'];}}}));}}return BPromise['all'](_0x5b160d)[_0xe291('0x28')](function(_0x207dd2){_0x2b9c70=_(_0x2b9c70)['union'](_0x207dd2)['compact']()['value']();return db[_0xe291('0x30')][_0xe291('0x4f')]({'where':{'id':_0x31fbe9[_0xe291('0x48')]['id']}})[_0xe291('0x28')](function(_0x15e733){return db[_0xe291('0x67')][_0xe291('0x68')](function(_0x3d87ed){return _0x15e733[_0xe291('0x6f')](_0x31fbe9[_0xe291('0x34')][_0xe291('0x62')],{'transaction':_0x3d87ed})[_0xe291('0x28')](function(){if(!_['isEmpty'](_0x2b9c70)){return _0x15e733['removeAgents'](_0x2b9c70,{'transaction':_0x3d87ed});}})[_0xe291('0x28')](function(){_0x2b9c70['forEach'](function(_0x17c48c){socket[_0xe291('0x6d')](_0xe291('0x7e'),{'UserId':_0x17c48c,'SmsQueueId':_0x15e733['id']});});});});});});})[_0xe291('0x28')](respondWithStatusCode(_0x53079c,null))[_0xe291('0x47')](handleError(_0x53079c,null));};exports[_0xe291('0x7f')]=function(_0x55c1b0,_0x13e968,_0x5c7d93){return db[_0xe291('0x30')][_0xe291('0x4f')]({'where':{'id':_0x55c1b0[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x13e968,null))['then'](function(_0xb41f3c){if(_0xb41f3c){return _0xb41f3c[_0xe291('0x7f')](_0x55c1b0[_0xe291('0x4a')][_0xe291('0x62')],_[_0xe291('0x80')](_0x55c1b0[_0xe291('0x4a')],['ids','id'])||{})[_0xe291('0x81')](function(_0x4a4cd6){for(var _0x19d062=0x0;_0x19d062<_0x55c1b0[_0xe291('0x4a')][_0xe291('0x62')][_0xe291('0x3a')];_0x19d062+=0x1){socket[_0xe291('0x6d')](_0xe291('0x6e'),{'UserId':Number(_0x55c1b0[_0xe291('0x4a')][_0xe291('0x62')][_0x19d062]),'SmsQueueId':Number(_0x55c1b0['params']['id'])});}return _0x4a4cd6;});}})[_0xe291('0x28')](respondWithResult(_0x13e968,null))[_0xe291('0x47')](handleError(_0x13e968,null));};exports[_0xe291('0x82')]=function(_0x43d75a,_0x25097a,_0x41d2ce){return db[_0xe291('0x30')]['find']({'where':{'id':_0x43d75a[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x25097a,null))['then'](function(_0x24dceb){if(_0x24dceb){return _0x24dceb['removeAgents'](_0x43d75a[_0xe291('0x34')][_0xe291('0x62')])[_0xe291('0x28')](function(){if(_[_0xe291('0x83')](_0x43d75a[_0xe291('0x34')][_0xe291('0x62')])){for(var _0x3dcd60=0x0;_0x3dcd60<_0x43d75a[_0xe291('0x34')]['ids'][_0xe291('0x3a')];_0x3dcd60+=0x1){socket[_0xe291('0x6d')](_0xe291('0x7e'),{'UserId':Number(_0x43d75a['query']['ids'][_0x3dcd60]),'SmsQueueId':Number(_0x43d75a[_0xe291('0x48')]['id'])});}}else{socket['emit'](_0xe291('0x7e'),{'UserId':Number(_0x43d75a[_0xe291('0x34')][_0xe291('0x62')]),'SmsQueueId':Number(_0x43d75a[_0xe291('0x48')]['id'])});}});}})[_0xe291('0x28')](respondWithStatusCode(_0x25097a,null))[_0xe291('0x47')](handleError(_0x25097a,null));};exports[_0xe291('0x84')]=function(_0x1e8f8b,_0x4de069,_0x545187){var _0x502fae={};var _0x5f13e3={};var _0x2ac0bc;var _0x566864;return db['SmsQueue'][_0xe291('0x60')]({'where':{'id':_0x1e8f8b[_0xe291('0x48')]['id']}})[_0xe291('0x28')](handleEntityNotFound(_0x4de069,null))[_0xe291('0x28')](function(_0x373ca4){if(_0x373ca4){_0x2ac0bc=_0x373ca4;_0x5f13e3[_0xe291('0x38')]=_[_0xe291('0x35')](db[_0xe291('0x58')]['rawAttributes']);_0x5f13e3['query']=_['keys'](_0x1e8f8b[_0xe291('0x34')]);_0x5f13e3[_0xe291('0x3f')]=_[_0xe291('0x36')](_0x5f13e3[_0xe291('0x38')],_0x5f13e3[_0xe291('0x34')]);_0x502fae['attributes']=_[_0xe291('0x36')](_0x5f13e3[_0xe291('0x38')],qs[_0xe291('0x39')](_0x1e8f8b[_0xe291('0x34')][_0xe291('0x39')]));_0x502fae[_0xe291('0x37')]=_0x502fae[_0xe291('0x37')]['length']?_0x502fae[_0xe291('0x37')]:_0x5f13e3[_0xe291('0x38')];_0x502fae[_0xe291('0x55')]=qs[_0xe291('0x3d')](_0x1e8f8b[_0xe291('0x34')]['sort']);_0x502fae[_0xe291('0x3e')]=qs[_0xe291('0x3f')](_[_0xe291('0x40')](_0x1e8f8b[_0xe291('0x34')],_0x5f13e3[_0xe291('0x3f')]));if(_0x1e8f8b[_0xe291('0x34')][_0xe291('0x41')]){_0x502fae[_0xe291('0x3e')]=_['merge'](_0x502fae[_0xe291('0x3e')],{'$or':_[_0xe291('0x2f')](_0x502fae[_0xe291('0x37')],function(_0x59b9b7){var _0x376e6d={};_0x376e6d[_0x59b9b7]={'$like':'%'+_0x1e8f8b['query']['filter']+'%'};return _0x376e6d;})});}_0x502fae=_[_0xe291('0x42')]({},_0x502fae,_0x1e8f8b[_0xe291('0x56')]);return _0x2ac0bc['getAgents'](_0x502fae);}})[_0xe291('0x28')](function(_0xa9c7a2){if(_0xa9c7a2){_0x566864=_0xa9c7a2[_0xe291('0x3a')];if(!_0x1e8f8b[_0xe291('0x34')][_0xe291('0x3b')](_0xe291('0x3c'))){_0x502fae[_0xe291('0x22')]=qs[_0xe291('0x22')](_0x1e8f8b[_0xe291('0x34')][_0xe291('0x22')]);_0x502fae[_0xe291('0x20')]=qs[_0xe291('0x20')](_0x1e8f8b[_0xe291('0x34')][_0xe291('0x20')]);}return _0x2ac0bc[_0xe291('0x84')](_0x502fae);}})[_0xe291('0x28')](function(_0x2e7e26){if(_0x2e7e26){return _0x2e7e26?{'count':_0x566864,'rows':_0x2e7e26}:null;}})[_0xe291('0x28')](respondWithResult(_0x4de069,null))[_0xe291('0x47')](handleError(_0x4de069,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 1b8431f..badb8f9 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 _0x526c=['SmsQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb'];(function(_0x93f68a,_0x286428){var _0x1ce9fe=function(_0x4f1ff1){while(--_0x4f1ff1){_0x93f68a['push'](_0x93f68a['shift']());}};_0x1ce9fe(++_0x286428);}(_0x526c,0xbc));var _0xc526=function(_0x46428c,_0x20ab75){_0x46428c=_0x46428c-0x0;var _0x16a677=_0x526c[_0x46428c];return _0x16a677;};'use strict';var EventEmitter=require(_0xc526('0x0'));var SmsQueue=require(_0xc526('0x1'))['db'][_0xc526('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xc526('0x3')](0x0);var events={'afterCreate':_0xc526('0x4'),'afterUpdate':_0xc526('0x5'),'afterDestroy':_0xc526('0x6')};function emitEvent(_0x318ba3){return function(_0x1a2b21,_0x641c14,_0x644990){SmsQueueEvents['emit'](_0x318ba3+':'+_0x1a2b21['id'],_0x1a2b21);SmsQueueEvents[_0xc526('0x7')](_0x318ba3,_0x1a2b21);_0x644990(null);};}for(var e in events){if(events[_0xc526('0x8')](e)){var event=events[e];SmsQueue[_0xc526('0x9')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xf5cb=['save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x1c5064,_0x575d62){var _0x5c0d00=function(_0x25755e){while(--_0x25755e){_0x1c5064['push'](_0x1c5064['shift']());}};_0x5c0d00(++_0x575d62);}(_0xf5cb,0x115));var _0xbf5c=function(_0x4e9c78,_0x4d150a){_0x4e9c78=_0x4e9c78-0x0;var _0x580ba9=_0xf5cb[_0x4e9c78];return _0x580ba9;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xbf5c('0x0'))['db'][_0xbf5c('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xbf5c('0x2')](0x0);var events={'afterCreate':_0xbf5c('0x3'),'afterUpdate':_0xbf5c('0x4'),'afterDestroy':_0xbf5c('0x5')};function emitEvent(_0x27f43a){return function(_0x161140,_0x1c61d2,_0x517018){SmsQueueEvents[_0xbf5c('0x6')](_0x27f43a+':'+_0x161140['id'],_0x161140);SmsQueueEvents[_0xbf5c('0x6')](_0x27f43a,_0x161140);_0x517018(null);};}for(var e in events){if(events[_0xbf5c('0x7')](e)){var event=events[e];SmsQueue[_0xbf5c('0x8')](e,emitEvent(event));}}module[_0xbf5c('0x9')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index ba732a6..024619e 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 _0xb429=['exports','define','SmsQueue','sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3f8684,_0x1d1801){var _0x442c7e=function(_0x4c6e87){while(--_0x4c6e87){_0x3f8684['push'](_0x3f8684['shift']());}};_0x442c7e(++_0x1d1801);}(_0xb429,0x178));var _0x9b42=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xb429[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x9b42('0x0'));var util=require(_0x9b42('0x1'));var logger=require(_0x9b42('0x2'))('api');var moment=require(_0x9b42('0x3'));var BPromise=require(_0x9b42('0x4'));var rp=require(_0x9b42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9b42('0x6'));var config=require(_0x9b42('0x7'));var attributes=require('./smsQueue.attributes');module[_0x9b42('0x8')]=function(_0x4c8d46,_0x141094){return _0x4c8d46[_0x9b42('0x9')](_0x9b42('0xa'),attributes,{'tableName':_0x9b42('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x617d=['./smsQueue.attributes','exports','define','sms_queues','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x5b0c7d,_0x4ad3e2){var _0x42aab8=function(_0x5dce29){while(--_0x5dce29){_0x5b0c7d['push'](_0x5b0c7d['shift']());}};_0x42aab8(++_0x4ad3e2);}(_0x617d,0x94));var _0xd617=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x617d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd617('0x0'));var util=require(_0xd617('0x1'));var logger=require('../../config/logger')(_0xd617('0x2'));var moment=require(_0xd617('0x3'));var BPromise=require(_0xd617('0x4'));var rp=require(_0xd617('0x5'));var fs=require('fs');var path=require(_0xd617('0x6'));var rimraf=require('rimraf');var config=require(_0xd617('0x7'));var attributes=require(_0xd617('0x8'));module[_0xd617('0x9')]=function(_0x3714f9,_0x1dfa10){return _0x3714f9[_0xd617('0xa')]('SmsQueue',attributes,{'tableName':_0xd617('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 4db8005..9d07af4 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 _0xc16b=['find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetSmsQueue','findAll','options','where','attributes','limit','include','model','map','debug','catch','ShowSmsQueue','SmsQueue'];(function(_0x407db1,_0x4bca19){var _0x39b212=function(_0x2ad889){while(--_0x2ad889){_0x407db1['push'](_0x407db1['shift']());}};_0x39b212(++_0x4bca19);}(_0xc16b,0x1ba));var _0xbc16=function(_0x26c8d8,_0x6cf710){_0x26c8d8=_0x26c8d8-0x0;var _0x1410b5=_0xc16b[_0x26c8d8];return _0x1410b5;};'use strict';var _=require(_0xbc16('0x0'));var util=require(_0xbc16('0x1'));var moment=require(_0xbc16('0x2'));var BPromise=require(_0xbc16('0x3'));var rs=require(_0xbc16('0x4'));var fs=require('fs');var Redis=require(_0xbc16('0x5'));var db=require(_0xbc16('0x6'))['db'];var utils=require(_0xbc16('0x7'));var logger=require(_0xbc16('0x8'))(_0xbc16('0x9'));var config=require(_0xbc16('0xa'));var jayson=require(_0xbc16('0xb'));var client=jayson[_0xbc16('0xc')][_0xbc16('0xd')]({'port':0x232a});config[_0xbc16('0xe')]=_['defaults'](config[_0xbc16('0xe')],{'host':_0xbc16('0xf'),'port':0x18eb});var socket=require(_0xbc16('0x10'))(new Redis(config[_0xbc16('0xe')]));require('./smsQueue.socket')[_0xbc16('0x11')](socket);function respondWithRpcPromise(_0x3908d3,_0xc1c3cd,_0x31740c){return new BPromise(function(_0x4e68c0,_0x20ddb6){return client[_0xbc16('0x12')](_0x3908d3,_0x31740c)[_0xbc16('0x13')](function(_0x4ce9d5){logger[_0xbc16('0x14')](_0xbc16('0x15'),_0xc1c3cd,_0xbc16('0x16'));logger['debug'](_0xbc16('0x17'),_0xc1c3cd,_0xbc16('0x16'),JSON[_0xbc16('0x18')](_0x4ce9d5));if(_0x4ce9d5[_0xbc16('0x19')]){if(_0x4ce9d5[_0xbc16('0x19')][_0xbc16('0x1a')]===0x1f4){logger[_0xbc16('0x19')](_0xbc16('0x15'),_0xc1c3cd,_0x4ce9d5[_0xbc16('0x19')][_0xbc16('0x1b')]);return _0x20ddb6(_0x4ce9d5[_0xbc16('0x19')][_0xbc16('0x1b')]);}logger['error'](_0xbc16('0x15'),_0xc1c3cd,_0x4ce9d5[_0xbc16('0x19')][_0xbc16('0x1b')]);return _0x4e68c0(_0x4ce9d5[_0xbc16('0x19')][_0xbc16('0x1b')]);}else{logger[_0xbc16('0x14')](_0xbc16('0x15'),_0xc1c3cd,_0xbc16('0x16'));_0x4e68c0(_0x4ce9d5[_0xbc16('0x1c')][_0xbc16('0x1b')]);}})['catch'](function(_0x4734ba){logger[_0xbc16('0x19')]('SmsQueue,\x20%s,\x20%s',_0xc1c3cd,_0x4734ba);_0x20ddb6(_0x4734ba);});});}exports[_0xbc16('0x1d')]=function(_0x1d0b84){var _0x119409=this;return new Promise(function(_0x4b7123,_0x329212){return db['SmsQueue'][_0xbc16('0x1e')]({'raw':_0x1d0b84['options']?_0x1d0b84['options']['raw']===undefined?!![]:![]:!![],'where':_0x1d0b84[_0xbc16('0x1f')]?_0x1d0b84['options'][_0xbc16('0x20')]||null:null,'attributes':_0x1d0b84[_0xbc16('0x1f')]?_0x1d0b84[_0xbc16('0x1f')][_0xbc16('0x21')]||null:null,'limit':_0x1d0b84[_0xbc16('0x1f')]?_0x1d0b84[_0xbc16('0x1f')][_0xbc16('0x22')]||null:null,'include':_0x1d0b84[_0xbc16('0x1f')]?_0x1d0b84[_0xbc16('0x1f')][_0xbc16('0x23')]?_['map'](_0x1d0b84[_0xbc16('0x1f')][_0xbc16('0x23')],function(_0x316607){return{'model':db[_0x316607[_0xbc16('0x24')]],'as':_0x316607['as'],'attributes':_0x316607[_0xbc16('0x21')],'include':_0x316607[_0xbc16('0x23')]?_[_0xbc16('0x25')](_0x316607['include'],function(_0x114b24){return{'model':db[_0x114b24[_0xbc16('0x24')]],'as':_0x114b24['as'],'attributes':_0x114b24[_0xbc16('0x21')],'include':_0x114b24[_0xbc16('0x23')]?_[_0xbc16('0x25')](_0x114b24[_0xbc16('0x23')],function(_0x31a7c1){return{'model':db[_0x31a7c1[_0xbc16('0x24')]],'as':_0x31a7c1['as'],'attributes':_0x31a7c1['attributes']};}):[]};}):[]};}):[]:[]})[_0xbc16('0x13')](function(_0x16bdd6){logger[_0xbc16('0x14')](_0xbc16('0x1d'),_0x1d0b84);logger[_0xbc16('0x26')](_0xbc16('0x1d'),_0x1d0b84,JSON[_0xbc16('0x18')](_0x16bdd6));_0x4b7123(_0x16bdd6);})[_0xbc16('0x27')](function(_0x145580){logger['error'](_0xbc16('0x1d'),_0x145580[_0xbc16('0x1b')],_0x1d0b84);_0x329212(_0x119409['error'](0x1f4,_0x145580['message']));});});};exports[_0xbc16('0x28')]=function(_0x279afb){var _0x2db504=this;return new Promise(function(_0x1f96e7,_0x38e3b1){return db[_0xbc16('0x29')][_0xbc16('0x2a')]({'raw':_0x279afb['options']?_0x279afb[_0xbc16('0x1f')][_0xbc16('0x2b')]===undefined?!![]:![]:!![],'where':_0x279afb[_0xbc16('0x1f')]?_0x279afb[_0xbc16('0x1f')]['where']||null:null,'attributes':_0x279afb[_0xbc16('0x1f')]?_0x279afb[_0xbc16('0x1f')][_0xbc16('0x21')]||null:null,'include':_0x279afb['options']?_0x279afb[_0xbc16('0x1f')][_0xbc16('0x23')]?_[_0xbc16('0x25')](_0x279afb['options'][_0xbc16('0x23')],function(_0x29c7fa){return{'model':db[_0x29c7fa[_0xbc16('0x24')]],'as':_0x29c7fa['as'],'attributes':_0x29c7fa[_0xbc16('0x21')],'include':_0x29c7fa['include']?_[_0xbc16('0x25')](_0x29c7fa[_0xbc16('0x23')],function(_0x258b71){return{'model':db[_0x258b71[_0xbc16('0x24')]],'as':_0x258b71['as'],'attributes':_0x258b71[_0xbc16('0x21')],'include':_0x258b71['include']?_[_0xbc16('0x25')](_0x258b71[_0xbc16('0x23')],function(_0x306784){return{'model':db[_0x306784['model']],'as':_0x306784['as'],'attributes':_0x306784[_0xbc16('0x21')]};}):[]};}):[]};}):[]:[]})[_0xbc16('0x13')](function(_0x3a1e16){logger[_0xbc16('0x14')](_0xbc16('0x28'),_0x279afb);logger[_0xbc16('0x26')]('ShowSmsQueue',_0x279afb,JSON[_0xbc16('0x18')](_0x3a1e16));_0x1f96e7(_0x3a1e16);})[_0xbc16('0x27')](function(_0x3e3813){logger[_0xbc16('0x19')]('ShowSmsQueue',_0x3e3813[_0xbc16('0x1b')],_0x279afb);_0x38e3b1(_0x2db504['error'](0x1f4,_0x3e3813[_0xbc16('0x1b')]));});});}; \ No newline at end of file +var _0x7441=['socket.io-emitter','./smsQueue.socket','request','then','info','SmsQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','GetSmsQueue','SmsQueue','options','limit','include','attributes','map','model','ShowSmsQueue','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x5909bb,_0x32ee6b){var _0x1adac0=function(_0x129b48){while(--_0x129b48){_0x5909bb['push'](_0x5909bb['shift']());}};_0x1adac0(++_0x32ee6b);}(_0x7441,0xaf));var _0x1744=function(_0x4859e9,_0x15a2a6){_0x4859e9=_0x4859e9-0x0;var _0xdaff65=_0x7441[_0x4859e9];return _0xdaff65;};'use strict';var _=require(_0x1744('0x0'));var util=require(_0x1744('0x1'));var moment=require(_0x1744('0x2'));var BPromise=require(_0x1744('0x3'));var rs=require(_0x1744('0x4'));var fs=require('fs');var Redis=require(_0x1744('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1744('0x6'));var logger=require(_0x1744('0x7'))(_0x1744('0x8'));var config=require(_0x1744('0x9'));var jayson=require(_0x1744('0xa'));var client=jayson['client'][_0x1744('0xb')]({'port':0x232a});config[_0x1744('0xc')]=_[_0x1744('0xd')](config[_0x1744('0xc')],{'host':_0x1744('0xe'),'port':0x18eb});var socket=require(_0x1744('0xf'))(new Redis(config['redis']));require(_0x1744('0x10'))['register'](socket);function respondWithRpcPromise(_0x5af3f0,_0x18fb66,_0x160986){return new BPromise(function(_0xb6d722,_0x7810ed){return client[_0x1744('0x11')](_0x5af3f0,_0x160986)[_0x1744('0x12')](function(_0x478243){logger[_0x1744('0x13')](_0x1744('0x14'),_0x18fb66,'request\x20sent');logger[_0x1744('0x15')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x18fb66,_0x1744('0x16'),JSON[_0x1744('0x17')](_0x478243));if(_0x478243[_0x1744('0x18')]){if(_0x478243[_0x1744('0x18')]['code']===0x1f4){logger[_0x1744('0x18')](_0x1744('0x14'),_0x18fb66,_0x478243[_0x1744('0x18')][_0x1744('0x19')]);return _0x7810ed(_0x478243[_0x1744('0x18')][_0x1744('0x19')]);}logger[_0x1744('0x18')](_0x1744('0x14'),_0x18fb66,_0x478243[_0x1744('0x18')][_0x1744('0x19')]);return _0xb6d722(_0x478243[_0x1744('0x18')]['message']);}else{logger[_0x1744('0x13')](_0x1744('0x14'),_0x18fb66,'request\x20sent');_0xb6d722(_0x478243[_0x1744('0x1a')][_0x1744('0x19')]);}})[_0x1744('0x1b')](function(_0x1ccbe7){logger[_0x1744('0x18')](_0x1744('0x14'),_0x18fb66,_0x1ccbe7);_0x7810ed(_0x1ccbe7);});});}exports[_0x1744('0x1c')]=function(_0x163622){var _0x4ee8b3=this;return new Promise(function(_0x35d05f,_0x42539f){return db[_0x1744('0x1d')]['findAll']({'raw':_0x163622['options']?_0x163622[_0x1744('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x163622[_0x1744('0x1e')]?_0x163622['options']['where']||null:null,'attributes':_0x163622[_0x1744('0x1e')]?_0x163622['options']['attributes']||null:null,'limit':_0x163622[_0x1744('0x1e')]?_0x163622['options'][_0x1744('0x1f')]||null:null,'include':_0x163622[_0x1744('0x1e')]?_0x163622[_0x1744('0x1e')][_0x1744('0x20')]?_['map'](_0x163622[_0x1744('0x1e')]['include'],function(_0x5e8316){return{'model':db[_0x5e8316['model']],'as':_0x5e8316['as'],'attributes':_0x5e8316[_0x1744('0x21')],'include':_0x5e8316['include']?_[_0x1744('0x22')](_0x5e8316[_0x1744('0x20')],function(_0x1610b4){return{'model':db[_0x1610b4[_0x1744('0x23')]],'as':_0x1610b4['as'],'attributes':_0x1610b4[_0x1744('0x21')],'include':_0x1610b4[_0x1744('0x20')]?_[_0x1744('0x22')](_0x1610b4['include'],function(_0x54d733){return{'model':db[_0x54d733['model']],'as':_0x54d733['as'],'attributes':_0x54d733[_0x1744('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x48b90b){logger[_0x1744('0x13')](_0x1744('0x1c'),_0x163622);logger[_0x1744('0x15')](_0x1744('0x1c'),_0x163622,JSON[_0x1744('0x17')](_0x48b90b));_0x35d05f(_0x48b90b);})[_0x1744('0x1b')](function(_0x3c830d){logger['error'](_0x1744('0x1c'),_0x3c830d[_0x1744('0x19')],_0x163622);_0x42539f(_0x4ee8b3[_0x1744('0x18')](0x1f4,_0x3c830d[_0x1744('0x19')]));});});};exports[_0x1744('0x24')]=function(_0x8c9cad){var _0x56aa25=this;return new Promise(function(_0x5f1648,_0xb62488){return db[_0x1744('0x1d')]['find']({'raw':_0x8c9cad[_0x1744('0x1e')]?_0x8c9cad[_0x1744('0x1e')][_0x1744('0x25')]===undefined?!![]:![]:!![],'where':_0x8c9cad[_0x1744('0x1e')]?_0x8c9cad[_0x1744('0x1e')]['where']||null:null,'attributes':_0x8c9cad['options']?_0x8c9cad[_0x1744('0x1e')]['attributes']||null:null,'include':_0x8c9cad[_0x1744('0x1e')]?_0x8c9cad[_0x1744('0x1e')][_0x1744('0x20')]?_[_0x1744('0x22')](_0x8c9cad['options'][_0x1744('0x20')],function(_0x2b065a){return{'model':db[_0x2b065a[_0x1744('0x23')]],'as':_0x2b065a['as'],'attributes':_0x2b065a['attributes'],'include':_0x2b065a['include']?_[_0x1744('0x22')](_0x2b065a[_0x1744('0x20')],function(_0x10906a){return{'model':db[_0x10906a['model']],'as':_0x10906a['as'],'attributes':_0x10906a[_0x1744('0x21')],'include':_0x10906a[_0x1744('0x20')]?_[_0x1744('0x22')](_0x10906a['include'],function(_0x3e0050){return{'model':db[_0x3e0050['model']],'as':_0x3e0050['as'],'attributes':_0x3e0050['attributes']};}):[]};}):[]};}):[]:[]})[_0x1744('0x12')](function(_0x268de7){logger[_0x1744('0x13')]('ShowSmsQueue',_0x8c9cad);logger[_0x1744('0x15')]('ShowSmsQueue',_0x8c9cad,JSON['stringify'](_0x268de7));_0x5f1648(_0x268de7);})['catch'](function(_0x1170a6){logger[_0x1744('0x18')](_0x1744('0x24'),_0x1170a6[_0x1744('0x19')],_0x8c9cad);_0xb62488(_0x56aa25[_0x1744('0x18')](0x1f4,_0x1170a6[_0x1744('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 5b818e4..b5c029e 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 _0x360c=['update','removeListener','smsQueue:','./smsQueue.events','save'];(function(_0x36cc52,_0x35b85e){var _0x3d0436=function(_0x227384){while(--_0x227384){_0x36cc52['push'](_0x36cc52['shift']());}};_0x3d0436(++_0x35b85e);}(_0x360c,0xc6));var _0xc360=function(_0x46b321,_0x320f73){_0x46b321=_0x46b321-0x0;var _0xa98fef=_0x360c[_0x46b321];return _0xa98fef;};'use strict';var SmsQueueEvents=require(_0xc360('0x0'));var events=[_0xc360('0x1'),'remove',_0xc360('0x2')];function createListener(_0x21d724,_0xfdcb09){return function(_0x44d175){_0xfdcb09['emit'](_0x21d724,_0x44d175);};}function removeListener(_0xd759da,_0x8118e8){return function(){SmsQueueEvents[_0xc360('0x3')](_0xd759da,_0x8118e8);};}exports['register']=function(_0x465e4a){for(var _0x4ee54b=0x0,_0xc801aa=events['length'];_0x4ee54b<_0xc801aa;_0x4ee54b++){var _0x9f7594=events[_0x4ee54b];var _0x308dfb=createListener(_0xc360('0x4')+_0x9f7594,_0x465e4a);SmsQueueEvents['on'](_0x9f7594,_0x308dfb);}}; \ No newline at end of file +var _0x0ac3=['update','emit','removeListener','length','smsQueue:','./smsQueue.events','save','remove'];(function(_0x2a9d28,_0x2ac1e3){var _0xc00d7e=function(_0x10b879){while(--_0x10b879){_0x2a9d28['push'](_0x2a9d28['shift']());}};_0xc00d7e(++_0x2ac1e3);}(_0x0ac3,0x13d));var _0x30ac=function(_0x205d0f,_0x48fc1b){_0x205d0f=_0x205d0f-0x0;var _0x5a1e0e=_0x0ac3[_0x205d0f];return _0x5a1e0e;};'use strict';var SmsQueueEvents=require(_0x30ac('0x0'));var events=[_0x30ac('0x1'),_0x30ac('0x2'),_0x30ac('0x3')];function createListener(_0x5e2277,_0x2e9175){return function(_0xd1d96e){_0x2e9175[_0x30ac('0x4')](_0x5e2277,_0xd1d96e);};}function removeListener(_0x23307f,_0x174a1f){return function(){SmsQueueEvents[_0x30ac('0x5')](_0x23307f,_0x174a1f);};}exports['register']=function(_0x4be1f5){for(var _0x3d3c36=0x0,_0x55877a=events[_0x30ac('0x6')];_0x3d3c36<_0x55877a;_0x3d3c36++){var _0x18e449=events[_0x3d3c36];var _0x5737c8=createListener(_0x30ac('0x7')+_0x18e449,_0x4be1f5);SmsQueueEvents['on'](_0x18e449,_0x5737c8);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 2ece9ea..c43b36c 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 _0x3be5=['post','create','put','update','exports','multer','path','connect-timeout','express','fs-extra','./smsQueueReport.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x260cf1,_0x4baacd){var _0x30ac60=function(_0x11efb9){while(--_0x11efb9){_0x260cf1['push'](_0x260cf1['shift']());}};_0x30ac60(++_0x4baacd);}(_0x3be5,0x155));var _0x53be=function(_0x52b74a,_0x503870){_0x52b74a=_0x52b74a-0x0;var _0x21962c=_0x3be5[_0x52b74a];return _0x21962c;};'use strict';var multer=require(_0x53be('0x0'));var util=require('util');var path=require(_0x53be('0x1'));var timeout=require(_0x53be('0x2'));var express=require(_0x53be('0x3'));var router=express['Router']();var fs_extra=require(_0x53be('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x53be('0x5'));router[_0x53be('0x6')]('/',auth[_0x53be('0x7')](),controller[_0x53be('0x8')]);router[_0x53be('0x6')](_0x53be('0x9'),auth[_0x53be('0x7')](),controller['describe']);router['get'](_0x53be('0xa'),auth[_0x53be('0x7')](),controller['show']);router[_0x53be('0xb')]('/',auth[_0x53be('0x7')](),controller[_0x53be('0xc')]);router[_0x53be('0xd')]('/:id',auth[_0x53be('0x7')](),controller[_0x53be('0xe')]);router['delete']('/:id',auth[_0x53be('0x7')](),controller['destroy']);module[_0x53be('0xf')]=router; \ No newline at end of file +var _0x850f=['../../config/environment','./smsQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xa4f0c8,_0x452f30){var _0x286f16=function(_0x1111ad){while(--_0x1111ad){_0xa4f0c8['push'](_0xa4f0c8['shift']());}};_0x286f16(++_0x452f30);}(_0x850f,0xff));var _0xf850=function(_0x320fe0,_0x403300){_0x320fe0=_0x320fe0-0x0;var _0x1e2e70=_0x850f[_0x320fe0];return _0x1e2e70;};'use strict';var multer=require(_0xf850('0x0'));var util=require(_0xf850('0x1'));var path=require(_0xf850('0x2'));var timeout=require(_0xf850('0x3'));var express=require(_0xf850('0x4'));var router=express[_0xf850('0x5')]();var fs_extra=require(_0xf850('0x6'));var auth=require(_0xf850('0x7'));var interaction=require(_0xf850('0x8'));var config=require(_0xf850('0x9'));var controller=require(_0xf850('0xa'));router[_0xf850('0xb')]('/',auth[_0xf850('0xc')](),controller[_0xf850('0xd')]);router[_0xf850('0xb')](_0xf850('0xe'),auth[_0xf850('0xc')](),controller[_0xf850('0xf')]);router[_0xf850('0xb')]('/:id',auth[_0xf850('0xc')](),controller['show']);router[_0xf850('0x10')]('/',auth['isAuthenticated'](),controller[_0xf850('0x11')]);router[_0xf850('0x12')](_0xf850('0x13'),auth[_0xf850('0xc')](),controller[_0xf850('0x14')]);router[_0xf850('0x15')](_0xf850('0x13'),auth[_0xf850('0xc')](),controller[_0xf850('0x16')]);module[_0xf850('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 641ce53..57fe049 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 _0xe681=['exports','STRING','DATE','moment','sequelize'];(function(_0x3256de,_0x250727){var _0x379db6=function(_0x4aebc2){while(--_0x4aebc2){_0x3256de['push'](_0x3256de['shift']());}};_0x379db6(++_0x250727);}(_0xe681,0xf8));var _0x1e68=function(_0x14fec1,_0x3a4d8b){_0x14fec1=_0x14fec1-0x0;var _0x350739=_0xe681[_0x14fec1];return _0x350739;};'use strict';var moment=require(_0x1e68('0x0'));var Sequelize=require(_0x1e68('0x1'));module[_0x1e68('0x2')]={'uniqueid':{'type':Sequelize[_0x1e68('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1e68('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1e68('0x4')]},'acceptAt':{'type':Sequelize[_0x1e68('0x4')]},'exitAt':{'type':Sequelize[_0x1e68('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf367=['exports','STRING','DATE','moment','sequelize'];(function(_0x2fa123,_0x5e0ff7){var _0x523a2c=function(_0x546dec){while(--_0x546dec){_0x2fa123['push'](_0x2fa123['shift']());}};_0x523a2c(++_0x5e0ff7);}(_0xf367,0x1ac));var _0x7f36=function(_0x90e71e,_0x88b765){_0x90e71e=_0x90e71e-0x0;var _0x41c9de=_0xf367[_0x90e71e];return _0x41c9de;};'use strict';var moment=require(_0x7f36('0x0'));var Sequelize=require(_0x7f36('0x1'));module[_0x7f36('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x7f36('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7f36('0x4')]},'exitAt':{'type':Sequelize[_0x7f36('0x4')]},'reason':{'type':Sequelize[_0x7f36('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 37aca60..ee55597 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 _0x0c12=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','SmsQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0c12,0xe9));var _0x20c1=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0c12[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x20c1('0x0'));var zipdir=require(_0x20c1('0x1'));var jsonpatch=require(_0x20c1('0x2'));var rp=require(_0x20c1('0x3'));var moment=require('moment');var BPromise=require(_0x20c1('0x4'));var Mustache=require(_0x20c1('0x5'));var util=require(_0x20c1('0x6'));var path=require('path');var sox=require(_0x20c1('0x7'));var csv=require(_0x20c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x20c1('0x9'));var _=require('lodash');var squel=require(_0x20c1('0xa'));var crypto=require(_0x20c1('0xb'));var jsforce=require(_0x20c1('0xc'));var deskjs=require(_0x20c1('0xd'));var toCsv=require(_0x20c1('0x8'));var querystring=require(_0x20c1('0xe'));var Papa=require(_0x20c1('0xf'));var Redis=require('ioredis');var authService=require(_0x20c1('0x10'));var qs=require(_0x20c1('0x11'));var as=require(_0x20c1('0x12'));var hardwareService=require(_0x20c1('0x13'));var logger=require('../../config/logger')(_0x20c1('0x14'));var utils=require('../../config/utils');var config=require(_0x20c1('0x15'));var licenseUtil=require(_0x20c1('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a9a6b,_0x11f041){_0x11f041=_0x11f041||0xcc;return function(_0x436aa5){if(_0x436aa5){return _0x4a9a6b[_0x20c1('0x17')](_0x11f041);}return _0x4a9a6b[_0x20c1('0x18')](_0x11f041)[_0x20c1('0x19')]();};}function respondWithResult(_0x230249,_0x5b839f){_0x5b839f=_0x5b839f||0xc8;return function(_0x2aefaa){if(_0x2aefaa){return _0x230249[_0x20c1('0x18')](_0x5b839f)[_0x20c1('0x1a')](_0x2aefaa);}};}function respondWithFilteredResult(_0x4f9025,_0x19ccd3){return function(_0x23b100){if(_0x23b100){var _0x4a5cf2=typeof _0x19ccd3[_0x20c1('0x1b')]===_0x20c1('0x1c')&&typeof _0x19ccd3[_0x20c1('0x1d')]===_0x20c1('0x1c');var _0x43e4fa=_0x23b100[_0x20c1('0x1e')];var _0x37cca9=_0x4a5cf2?0x0:_0x19ccd3['offset'];var _0x255231=_0x4a5cf2?_0x23b100['count']:_0x19ccd3[_0x20c1('0x1b')]+_0x19ccd3[_0x20c1('0x1d')];var _0x1c327a;if(_0x255231>=_0x43e4fa){_0x255231=_0x43e4fa;_0x1c327a=0xc8;}else{_0x1c327a=0xce;}_0x4f9025['status'](_0x1c327a);return _0x4f9025['set'](_0x20c1('0x1f'),_0x37cca9+'-'+_0x255231+'/'+_0x43e4fa)[_0x20c1('0x1a')](_0x23b100);}return null;};}function patchUpdates(_0xa74aab){return function(_0x18e5f3){try{jsonpatch[_0x20c1('0x20')](_0x18e5f3,_0xa74aab,!![]);}catch(_0x1e483c){return BPromise[_0x20c1('0x21')](_0x1e483c);}return _0x18e5f3[_0x20c1('0x22')]();};}function saveUpdates(_0x1df839,_0x510b32){return function(_0x4c71cc){if(_0x4c71cc){return _0x4c71cc[_0x20c1('0x23')](_0x1df839)[_0x20c1('0x24')](function(_0xa13d09){return _0xa13d09;});}return null;};}function removeEntity(_0x2bad37,_0x24c40b){return function(_0x120b63){if(_0x120b63){return _0x120b63[_0x20c1('0x25')]()[_0x20c1('0x24')](function(){_0x2bad37['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b5a1e,_0x3b17d2){return function(_0x4ca6ae){if(!_0x4ca6ae){_0x2b5a1e[_0x20c1('0x17')](0x194);}return _0x4ca6ae;};}function handleError(_0x1dbc48,_0x67a164){_0x67a164=_0x67a164||0x1f4;return function(_0x1a755f){logger['error'](_0x1a755f[_0x20c1('0x26')]);if(_0x1a755f[_0x20c1('0x27')]){delete _0x1a755f[_0x20c1('0x27')];}_0x1dbc48[_0x20c1('0x18')](_0x67a164)['send'](_0x1a755f);};}exports['index']=function(_0x2992e5,_0x2f5446){var _0x128c82={},_0x4006ba={},_0x52a333={'count':0x0,'rows':[]};var _0x58abaf=_[_0x20c1('0x28')](db[_0x20c1('0x29')][_0x20c1('0x2a')],function(_0x2f2a72){return{'name':_0x2f2a72[_0x20c1('0x2b')],'type':_0x2f2a72['type'][_0x20c1('0x2c')]};});_0x4006ba['model']=_['map'](_0x58abaf,_0x20c1('0x27'));_0x4006ba[_0x20c1('0x2d')]=_[_0x20c1('0x2e')](_0x2992e5['query']);_0x4006ba[_0x20c1('0x2f')]=_[_0x20c1('0x30')](_0x4006ba[_0x20c1('0x31')],_0x4006ba[_0x20c1('0x2d')]);_0x128c82[_0x20c1('0x32')]=_[_0x20c1('0x30')](_0x4006ba[_0x20c1('0x31')],qs[_0x20c1('0x33')](_0x2992e5[_0x20c1('0x2d')]['fields']));_0x128c82['attributes']=_0x128c82[_0x20c1('0x32')][_0x20c1('0x34')]?_0x128c82[_0x20c1('0x32')]:_0x4006ba[_0x20c1('0x31')];if(!_0x2992e5[_0x20c1('0x2d')]['hasOwnProperty'](_0x20c1('0x35'))){_0x128c82[_0x20c1('0x1d')]=qs[_0x20c1('0x1d')](_0x2992e5[_0x20c1('0x2d')][_0x20c1('0x1d')]);_0x128c82['offset']=qs['offset'](_0x2992e5[_0x20c1('0x2d')][_0x20c1('0x1b')]);}_0x128c82['order']=qs[_0x20c1('0x36')](_0x2992e5[_0x20c1('0x2d')][_0x20c1('0x36')]);_0x128c82[_0x20c1('0x37')]=qs[_0x20c1('0x2f')](_[_0x20c1('0x38')](_0x2992e5[_0x20c1('0x2d')],_0x4006ba[_0x20c1('0x2f')]),_0x58abaf);if(_0x2992e5[_0x20c1('0x2d')][_0x20c1('0x39')]){_0x128c82[_0x20c1('0x37')]=_[_0x20c1('0x3a')](_0x128c82[_0x20c1('0x37')],{'$or':_['map'](_0x58abaf,function(_0x3b854b){if(_0x3b854b[_0x20c1('0x3b')]!==_0x20c1('0x3c')){var _0x1cd758={};_0x1cd758[_0x3b854b[_0x20c1('0x27')]]={'$like':'%'+_0x2992e5[_0x20c1('0x2d')]['filter']+'%'};return _0x1cd758;}})});}_0x128c82=_[_0x20c1('0x3a')]({},_0x128c82,_0x2992e5[_0x20c1('0x3d')]);var _0x317267={'where':_0x128c82['where']};return db[_0x20c1('0x29')][_0x20c1('0x1e')](_0x317267)[_0x20c1('0x24')](function(_0x45944e){_0x52a333[_0x20c1('0x1e')]=_0x45944e;if(_0x2992e5[_0x20c1('0x2d')][_0x20c1('0x3e')]){_0x128c82[_0x20c1('0x3f')]=[{'all':!![]}];}return db[_0x20c1('0x29')][_0x20c1('0x40')](_0x128c82);})[_0x20c1('0x24')](function(_0x457a7e){_0x52a333[_0x20c1('0x41')]=_0x457a7e;return _0x52a333;})['then'](respondWithFilteredResult(_0x2f5446,_0x128c82))[_0x20c1('0x42')](handleError(_0x2f5446,null));};exports['show']=function(_0x1f5490,_0x836496){var _0x4728aa={'raw':!![],'where':{'id':_0x1f5490['params']['id']}},_0x41e8cb={};_0x41e8cb[_0x20c1('0x31')]=_[_0x20c1('0x2e')](db[_0x20c1('0x29')]['rawAttributes']);_0x41e8cb['query']=_[_0x20c1('0x2e')](_0x1f5490[_0x20c1('0x2d')]);_0x41e8cb[_0x20c1('0x2f')]=_[_0x20c1('0x30')](_0x41e8cb[_0x20c1('0x31')],_0x41e8cb[_0x20c1('0x2d')]);_0x4728aa[_0x20c1('0x32')]=_[_0x20c1('0x30')](_0x41e8cb[_0x20c1('0x31')],qs[_0x20c1('0x33')](_0x1f5490['query'][_0x20c1('0x33')]));_0x4728aa[_0x20c1('0x32')]=_0x4728aa[_0x20c1('0x32')][_0x20c1('0x34')]?_0x4728aa[_0x20c1('0x32')]:_0x41e8cb[_0x20c1('0x31')];if(_0x1f5490[_0x20c1('0x2d')]['includeAll']){_0x4728aa[_0x20c1('0x3f')]=[{'all':!![]}];}_0x4728aa=_['merge']({},_0x4728aa,_0x1f5490[_0x20c1('0x3d')]);return db['SmsQueueReport'][_0x20c1('0x43')](_0x4728aa)[_0x20c1('0x24')](handleEntityNotFound(_0x836496,null))[_0x20c1('0x24')](respondWithResult(_0x836496,null))[_0x20c1('0x42')](handleError(_0x836496,null));};exports['create']=function(_0x5549bb,_0xf2629c){return db[_0x20c1('0x29')][_0x20c1('0x44')](_0x5549bb[_0x20c1('0x45')],{})[_0x20c1('0x24')](respondWithResult(_0xf2629c,0xc9))['catch'](handleError(_0xf2629c,null));};exports[_0x20c1('0x23')]=function(_0x192315,_0x511389){if(_0x192315[_0x20c1('0x45')]['id']){delete _0x192315['body']['id'];}return db['SmsQueueReport'][_0x20c1('0x43')]({'where':{'id':_0x192315[_0x20c1('0x46')]['id']}})[_0x20c1('0x24')](handleEntityNotFound(_0x511389,null))['then'](saveUpdates(_0x192315[_0x20c1('0x45')],null))[_0x20c1('0x24')](respondWithResult(_0x511389,null))['catch'](handleError(_0x511389,null));};exports[_0x20c1('0x25')]=function(_0x2766b9,_0x44de65){return db['SmsQueueReport'][_0x20c1('0x43')]({'where':{'id':_0x2766b9[_0x20c1('0x46')]['id']}})['then'](handleEntityNotFound(_0x44de65,null))[_0x20c1('0x24')](removeEntity(_0x44de65,null))[_0x20c1('0x42')](handleError(_0x44de65,null));};exports[_0x20c1('0x47')]=function(_0x59f19e,_0x32b6cd){return db[_0x20c1('0x29')][_0x20c1('0x47')]()[_0x20c1('0x24')](respondWithResult(_0x32b6cd,null))[_0x20c1('0x42')](handleError(_0x32b6cd,null));}; \ No newline at end of file +var _0x4d4a=['fields','length','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','include','findAll','show','params','includeAll','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','destroy','then','error','stack','name','map','SmsQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes'];(function(_0x202e96,_0x4567ba){var _0x466b00=function(_0x4c07e3){while(--_0x4c07e3){_0x202e96['push'](_0x202e96['shift']());}};_0x466b00(++_0x4567ba);}(_0x4d4a,0x1e9));var _0xa4d4=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x4d4a[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0xa4d4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa4d4('0x1'));var jsonpatch=require(_0xa4d4('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa4d4('0x3'));var Mustache=require(_0xa4d4('0x4'));var util=require('util');var path=require('path');var sox=require(_0xa4d4('0x5'));var csv=require(_0xa4d4('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa4d4('0x7'));var _=require(_0xa4d4('0x8'));var squel=require(_0xa4d4('0x9'));var crypto=require(_0xa4d4('0xa'));var jsforce=require(_0xa4d4('0xb'));var deskjs=require(_0xa4d4('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa4d4('0xd'));var Papa=require('papaparse');var Redis=require(_0xa4d4('0xe'));var authService=require(_0xa4d4('0xf'));var qs=require(_0xa4d4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa4d4('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xa4d4('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x442db0,_0x3928fd){_0x3928fd=_0x3928fd||0xcc;return function(_0x4d94b7){if(_0x4d94b7){return _0x442db0[_0xa4d4('0x13')](_0x3928fd);}return _0x442db0['status'](_0x3928fd)[_0xa4d4('0x14')]();};}function respondWithResult(_0x34bc6c,_0x5796fe){_0x5796fe=_0x5796fe||0xc8;return function(_0xcd4002){if(_0xcd4002){return _0x34bc6c[_0xa4d4('0x15')](_0x5796fe)['json'](_0xcd4002);}};}function respondWithFilteredResult(_0x86af5d,_0x2ce2e3){return function(_0x19d0a8){if(_0x19d0a8){var _0x1e355c=typeof _0x2ce2e3[_0xa4d4('0x16')]===_0xa4d4('0x17')&&typeof _0x2ce2e3[_0xa4d4('0x18')]==='undefined';var _0x47295b=_0x19d0a8['count'];var _0x4d31d7=_0x1e355c?0x0:_0x2ce2e3['offset'];var _0x2c1bd3=_0x1e355c?_0x19d0a8[_0xa4d4('0x19')]:_0x2ce2e3[_0xa4d4('0x16')]+_0x2ce2e3[_0xa4d4('0x18')];var _0x445b01;if(_0x2c1bd3>=_0x47295b){_0x2c1bd3=_0x47295b;_0x445b01=0xc8;}else{_0x445b01=0xce;}_0x86af5d[_0xa4d4('0x15')](_0x445b01);return _0x86af5d['set'](_0xa4d4('0x1a'),_0x4d31d7+'-'+_0x2c1bd3+'/'+_0x47295b)[_0xa4d4('0x1b')](_0x19d0a8);}return null;};}function patchUpdates(_0x47923a){return function(_0x31edd1){try{jsonpatch['apply'](_0x31edd1,_0x47923a,!![]);}catch(_0x59945d){return BPromise[_0xa4d4('0x1c')](_0x59945d);}return _0x31edd1[_0xa4d4('0x1d')]();};}function saveUpdates(_0x45a6a7,_0x2d46fd){return function(_0x3d56c0){if(_0x3d56c0){return _0x3d56c0[_0xa4d4('0x1e')](_0x45a6a7)['then'](function(_0x54bc27){return _0x54bc27;});}return null;};}function removeEntity(_0x45ac36,_0x560c45){return function(_0x1ee73d){if(_0x1ee73d){return _0x1ee73d[_0xa4d4('0x1f')]()[_0xa4d4('0x20')](function(){_0x45ac36[_0xa4d4('0x15')](0xcc)[_0xa4d4('0x14')]();});}};}function handleEntityNotFound(_0x24377b,_0x2aca6f){return function(_0xe1c547){if(!_0xe1c547){_0x24377b[_0xa4d4('0x13')](0x194);}return _0xe1c547;};}function handleError(_0x4f1863,_0x5237a8){_0x5237a8=_0x5237a8||0x1f4;return function(_0x422cf6){logger[_0xa4d4('0x21')](_0x422cf6[_0xa4d4('0x22')]);if(_0x422cf6['name']){delete _0x422cf6[_0xa4d4('0x23')];}_0x4f1863[_0xa4d4('0x15')](_0x5237a8)['send'](_0x422cf6);};}exports['index']=function(_0x2b9d1e,_0x597b1b){var _0x2d583a={},_0x418ee3={},_0x4c49f6={'count':0x0,'rows':[]};var _0x4e4d5a=_[_0xa4d4('0x24')](db[_0xa4d4('0x25')][_0xa4d4('0x26')],function(_0x1fe558){return{'name':_0x1fe558[_0xa4d4('0x27')],'type':_0x1fe558[_0xa4d4('0x28')]['key']};});_0x418ee3[_0xa4d4('0x29')]=_[_0xa4d4('0x24')](_0x4e4d5a,_0xa4d4('0x23'));_0x418ee3[_0xa4d4('0x2a')]=_[_0xa4d4('0x2b')](_0x2b9d1e[_0xa4d4('0x2a')]);_0x418ee3[_0xa4d4('0x2c')]=_[_0xa4d4('0x2d')](_0x418ee3['model'],_0x418ee3[_0xa4d4('0x2a')]);_0x2d583a[_0xa4d4('0x2e')]=_[_0xa4d4('0x2d')](_0x418ee3[_0xa4d4('0x29')],qs[_0xa4d4('0x2f')](_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x2f')]));_0x2d583a[_0xa4d4('0x2e')]=_0x2d583a[_0xa4d4('0x2e')][_0xa4d4('0x30')]?_0x2d583a[_0xa4d4('0x2e')]:_0x418ee3[_0xa4d4('0x29')];if(!_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x31')]('nolimit')){_0x2d583a[_0xa4d4('0x18')]=qs['limit'](_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x18')]);_0x2d583a['offset']=qs['offset'](_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x16')]);}_0x2d583a[_0xa4d4('0x32')]=qs[_0xa4d4('0x33')](_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x33')]);_0x2d583a['where']=qs[_0xa4d4('0x2c')](_['pick'](_0x2b9d1e[_0xa4d4('0x2a')],_0x418ee3[_0xa4d4('0x2c')]),_0x4e4d5a);if(_0x2b9d1e[_0xa4d4('0x2a')][_0xa4d4('0x34')]){_0x2d583a['where']=_['merge'](_0x2d583a[_0xa4d4('0x35')],{'$or':_[_0xa4d4('0x24')](_0x4e4d5a,function(_0x84c4dc){if(_0x84c4dc[_0xa4d4('0x28')]!==_0xa4d4('0x36')){var _0x4c3593={};_0x4c3593[_0x84c4dc[_0xa4d4('0x23')]]={'$like':'%'+_0x2b9d1e[_0xa4d4('0x2a')]['filter']+'%'};return _0x4c3593;}})});}_0x2d583a=_[_0xa4d4('0x37')]({},_0x2d583a,_0x2b9d1e[_0xa4d4('0x38')]);var _0x8e355a={'where':_0x2d583a[_0xa4d4('0x35')]};return db[_0xa4d4('0x25')][_0xa4d4('0x19')](_0x8e355a)[_0xa4d4('0x20')](function(_0x39a544){_0x4c49f6[_0xa4d4('0x19')]=_0x39a544;if(_0x2b9d1e[_0xa4d4('0x2a')]['includeAll']){_0x2d583a[_0xa4d4('0x39')]=[{'all':!![]}];}return db[_0xa4d4('0x25')][_0xa4d4('0x3a')](_0x2d583a);})[_0xa4d4('0x20')](function(_0x222357){_0x4c49f6['rows']=_0x222357;return _0x4c49f6;})[_0xa4d4('0x20')](respondWithFilteredResult(_0x597b1b,_0x2d583a))['catch'](handleError(_0x597b1b,null));};exports[_0xa4d4('0x3b')]=function(_0x37d003,_0x4821bf){var _0x2efb45={'raw':!![],'where':{'id':_0x37d003[_0xa4d4('0x3c')]['id']}},_0x62803={};_0x62803[_0xa4d4('0x29')]=_[_0xa4d4('0x2b')](db['SmsQueueReport'][_0xa4d4('0x26')]);_0x62803[_0xa4d4('0x2a')]=_['keys'](_0x37d003[_0xa4d4('0x2a')]);_0x62803[_0xa4d4('0x2c')]=_[_0xa4d4('0x2d')](_0x62803[_0xa4d4('0x29')],_0x62803['query']);_0x2efb45[_0xa4d4('0x2e')]=_[_0xa4d4('0x2d')](_0x62803[_0xa4d4('0x29')],qs[_0xa4d4('0x2f')](_0x37d003['query'][_0xa4d4('0x2f')]));_0x2efb45[_0xa4d4('0x2e')]=_0x2efb45[_0xa4d4('0x2e')][_0xa4d4('0x30')]?_0x2efb45[_0xa4d4('0x2e')]:_0x62803[_0xa4d4('0x29')];if(_0x37d003['query'][_0xa4d4('0x3d')]){_0x2efb45[_0xa4d4('0x39')]=[{'all':!![]}];}_0x2efb45=_[_0xa4d4('0x37')]({},_0x2efb45,_0x37d003['options']);return db['SmsQueueReport'][_0xa4d4('0x3e')](_0x2efb45)[_0xa4d4('0x20')](handleEntityNotFound(_0x4821bf,null))['then'](respondWithResult(_0x4821bf,null))[_0xa4d4('0x3f')](handleError(_0x4821bf,null));};exports[_0xa4d4('0x40')]=function(_0x9bc2a5,_0x1dac18){return db['SmsQueueReport'][_0xa4d4('0x40')](_0x9bc2a5[_0xa4d4('0x41')],{})[_0xa4d4('0x20')](respondWithResult(_0x1dac18,0xc9))[_0xa4d4('0x3f')](handleError(_0x1dac18,null));};exports[_0xa4d4('0x1e')]=function(_0x4e68b8,_0x2917e0){if(_0x4e68b8[_0xa4d4('0x41')]['id']){delete _0x4e68b8[_0xa4d4('0x41')]['id'];}return db[_0xa4d4('0x25')][_0xa4d4('0x3e')]({'where':{'id':_0x4e68b8[_0xa4d4('0x3c')]['id']}})[_0xa4d4('0x20')](handleEntityNotFound(_0x2917e0,null))[_0xa4d4('0x20')](saveUpdates(_0x4e68b8['body'],null))['then'](respondWithResult(_0x2917e0,null))[_0xa4d4('0x3f')](handleError(_0x2917e0,null));};exports['destroy']=function(_0x3a6ceb,_0x28fde4){return db['SmsQueueReport'][_0xa4d4('0x3e')]({'where':{'id':_0x3a6ceb[_0xa4d4('0x3c')]['id']}})[_0xa4d4('0x20')](handleEntityNotFound(_0x28fde4,null))[_0xa4d4('0x20')](removeEntity(_0x28fde4,null))[_0xa4d4('0x3f')](handleError(_0x28fde4,null));};exports['describe']=function(_0xac7045,_0x142c95){return db[_0xa4d4('0x25')][_0xa4d4('0x42')]()['then'](respondWithResult(_0x142c95,null))[_0xa4d4('0x3f')](handleError(_0x142c95,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index d250995..5f967c5 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 _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x226923,_0x2ba9f6){var _0x535356=function(_0x613aa4){while(--_0x613aa4){_0x226923['push'](_0x226923['shift']());}};_0x535356(++_0x2ba9f6);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xcb91[_0x35e75a];return _0xb23c7f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xcb91=['path','rimraf','./smsQueueReport.attributes','exports','define','report_sms_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3d4ea9,_0xf796bd){var _0xc37efe=function(_0x5ec8ca){while(--_0x5ec8ca){_0x3d4ea9['push'](_0x3d4ea9['shift']());}};_0xc37efe(++_0xf796bd);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0xcb91[_0x56825b];return _0x69ce77;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('SmsQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 01793c8..4103fe3 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 _0xd666=['catch','UpdateSmsQueueReport','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','stringify'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0xd666,0x65));var _0x6d66=function(_0x1f2dda,_0x539c5f){_0x1f2dda=_0x1f2dda-0x0;var _0x29b49e=_0xd666[_0x1f2dda];return _0x29b49e;};'use strict';var _=require(_0x6d66('0x0'));var util=require(_0x6d66('0x1'));var moment=require(_0x6d66('0x2'));var BPromise=require(_0x6d66('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d66('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6d66('0x5'));var logger=require(_0x6d66('0x6'))(_0x6d66('0x7'));var config=require('../../config/environment');var jayson=require(_0x6d66('0x8'));var client=jayson[_0x6d66('0x9')][_0x6d66('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x287fa4,_0x2b85c8,_0x3f5ccb){return new BPromise(function(_0x5d2dc4,_0xf03bad){return client['request'](_0x287fa4,_0x3f5ccb)[_0x6d66('0xb')](function(_0x34ee9c){logger['info'](_0x6d66('0xc'),_0x2b85c8,_0x6d66('0xd'));logger[_0x6d66('0xe')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x2b85c8,_0x6d66('0xd'),JSON['stringify'](_0x34ee9c));if(_0x34ee9c[_0x6d66('0xf')]){if(_0x34ee9c['error'][_0x6d66('0x10')]===0x1f4){logger[_0x6d66('0xf')](_0x6d66('0xc'),_0x2b85c8,_0x34ee9c[_0x6d66('0xf')][_0x6d66('0x11')]);return _0xf03bad(_0x34ee9c[_0x6d66('0xf')]['message']);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x2b85c8,_0x34ee9c[_0x6d66('0xf')]['message']);return _0x5d2dc4(_0x34ee9c[_0x6d66('0xf')][_0x6d66('0x11')]);}else{logger[_0x6d66('0x12')]('SmsQueueReport,\x20%s,\x20%s',_0x2b85c8,'request\x20sent');_0x5d2dc4(_0x34ee9c[_0x6d66('0x13')][_0x6d66('0x11')]);}})['catch'](function(_0x32dcb6){logger[_0x6d66('0xf')](_0x6d66('0xc'),_0x2b85c8,_0x32dcb6);_0xf03bad(_0x32dcb6);});});}exports[_0x6d66('0x14')]=function(_0x471ccf){var _0x5d7ceb=this;return new Promise(function(_0x56a643,_0x317ef8){return db[_0x6d66('0x15')][_0x6d66('0x16')](_0x471ccf[_0x6d66('0x17')],{'raw':_0x471ccf[_0x6d66('0x18')]?_0x471ccf['options'][_0x6d66('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x427b14){logger['info'](_0x6d66('0x14'),_0x471ccf);logger[_0x6d66('0xe')](_0x6d66('0x14'),_0x471ccf,JSON[_0x6d66('0x1a')](_0x427b14));_0x56a643(_0x427b14);})[_0x6d66('0x1b')](function(_0x959069){logger[_0x6d66('0xf')](_0x6d66('0x14'),_0x959069[_0x6d66('0x11')],_0x471ccf);_0x317ef8(_0x5d7ceb[_0x6d66('0xf')](0x1f4,_0x959069[_0x6d66('0x11')]));});});};exports[_0x6d66('0x1c')]=function(_0x9416a6){var _0x24d68e=this;return new Promise(function(_0x525c55,_0x25de3b){return db[_0x6d66('0x15')]['update'](_0x9416a6['body'],{'raw':_0x9416a6[_0x6d66('0x18')]?_0x9416a6[_0x6d66('0x18')][_0x6d66('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9416a6['options']?_0x9416a6['options'][_0x6d66('0x1d')]||null:null,'attributes':_0x9416a6['options']?_0x9416a6[_0x6d66('0x18')][_0x6d66('0x1e')]||null:null,'limit':_0x9416a6[_0x6d66('0x18')]?_0x9416a6[_0x6d66('0x18')][_0x6d66('0x1f')]||null:null})[_0x6d66('0xb')](function(_0x1b32a1){logger[_0x6d66('0x12')]('UpdateSmsQueueReport',_0x9416a6);logger[_0x6d66('0xe')](_0x6d66('0x1c'),_0x9416a6,JSON['stringify'](_0x1b32a1));_0x525c55(_0x1b32a1);})[_0x6d66('0x1b')](function(_0x491ebf){logger[_0x6d66('0xf')]('UpdateSmsQueueReport',_0x491ebf[_0x6d66('0x11')],_0x9416a6);_0x25de3b(_0x24d68e[_0x6d66('0xf')](0x1f4,_0x491ebf[_0x6d66('0x11')]));});});}; \ No newline at end of file +var _0x43d1=['body','where','limit','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','options','raw','UpdateSmsQueueReport','update'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x43d1,0xb8));var _0x143d=function(_0x174663,_0x275342){_0x174663=_0x174663-0x0;var _0x210e37=_0x43d1[_0x174663];return _0x210e37;};'use strict';var _=require(_0x143d('0x0'));var util=require(_0x143d('0x1'));var moment=require(_0x143d('0x2'));var BPromise=require(_0x143d('0x3'));var rs=require(_0x143d('0x4'));var fs=require('fs');var Redis=require(_0x143d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x143d('0x6'));var logger=require(_0x143d('0x7'))(_0x143d('0x8'));var config=require(_0x143d('0x9'));var jayson=require(_0x143d('0xa'));var client=jayson[_0x143d('0xb')][_0x143d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ab8a8,_0x2cd538,_0x3f02bc){return new BPromise(function(_0x44cba0,_0x2ea265){return client[_0x143d('0xd')](_0x5ab8a8,_0x3f02bc)['then'](function(_0x40bb2e){logger[_0x143d('0xe')](_0x143d('0xf'),_0x2cd538,_0x143d('0x10'));logger[_0x143d('0x11')](_0x143d('0x12'),_0x2cd538,'request\x20sent',JSON[_0x143d('0x13')](_0x40bb2e));if(_0x40bb2e[_0x143d('0x14')]){if(_0x40bb2e[_0x143d('0x14')][_0x143d('0x15')]===0x1f4){logger[_0x143d('0x14')]('SmsQueueReport,\x20%s,\x20%s',_0x2cd538,_0x40bb2e[_0x143d('0x14')]['message']);return _0x2ea265(_0x40bb2e[_0x143d('0x14')][_0x143d('0x16')]);}logger[_0x143d('0x14')](_0x143d('0xf'),_0x2cd538,_0x40bb2e[_0x143d('0x14')][_0x143d('0x16')]);return _0x44cba0(_0x40bb2e[_0x143d('0x14')][_0x143d('0x16')]);}else{logger['info'](_0x143d('0xf'),_0x2cd538,_0x143d('0x10'));_0x44cba0(_0x40bb2e[_0x143d('0x17')][_0x143d('0x16')]);}})[_0x143d('0x18')](function(_0x3ad1ba){logger[_0x143d('0x14')](_0x143d('0xf'),_0x2cd538,_0x3ad1ba);_0x2ea265(_0x3ad1ba);});});}exports[_0x143d('0x19')]=function(_0x265163){var _0x13c01a=this;return new Promise(function(_0x5a2db4,_0x3fb3ac){return db[_0x143d('0x1a')][_0x143d('0x1b')](_0x265163['body'],{'raw':_0x265163[_0x143d('0x1c')]?_0x265163[_0x143d('0x1c')][_0x143d('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x3251fd){logger[_0x143d('0xe')](_0x143d('0x19'),_0x265163);logger[_0x143d('0x11')]('CreateSmsQueueReport',_0x265163,JSON['stringify'](_0x3251fd));_0x5a2db4(_0x3251fd);})[_0x143d('0x18')](function(_0x4d4f32){logger['error']('CreateSmsQueueReport',_0x4d4f32['message'],_0x265163);_0x3fb3ac(_0x13c01a[_0x143d('0x14')](0x1f4,_0x4d4f32[_0x143d('0x16')]));});});};exports[_0x143d('0x1e')]=function(_0x494372){var _0x396765=this;return new Promise(function(_0x49859e,_0x4ca61b){return db[_0x143d('0x1a')][_0x143d('0x1f')](_0x494372[_0x143d('0x20')],{'raw':_0x494372[_0x143d('0x1c')]?_0x494372[_0x143d('0x1c')][_0x143d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x494372['options']?_0x494372[_0x143d('0x1c')][_0x143d('0x21')]||null:null,'attributes':_0x494372[_0x143d('0x1c')]?_0x494372['options']['attributes']||null:null,'limit':_0x494372[_0x143d('0x1c')]?_0x494372[_0x143d('0x1c')][_0x143d('0x22')]||null:null})[_0x143d('0x23')](function(_0x115a41){logger[_0x143d('0xe')](_0x143d('0x1e'),_0x494372);logger[_0x143d('0x11')](_0x143d('0x1e'),_0x494372,JSON[_0x143d('0x13')](_0x115a41));_0x49859e(_0x115a41);})[_0x143d('0x18')](function(_0x9c582d){logger[_0x143d('0x14')]('UpdateSmsQueueReport',_0x9c582d[_0x143d('0x16')],_0x494372);_0x4ca61b(_0x396765[_0x143d('0x14')](0x1f4,_0x9c582d[_0x143d('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 094e7bb..9ca7c8a 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 _0x0bde=['create','update','destroy','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x2c003e,_0x287972){var _0x2d8b69=function(_0x531fcb){while(--_0x531fcb){_0x2c003e['push'](_0x2c003e['shift']());}};_0x2d8b69(++_0x287972);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var multer=require('multer');var util=require(_0xe0bd('0x0'));var path=require('path');var timeout=require(_0xe0bd('0x1'));var express=require(_0xe0bd('0x2'));var router=express[_0xe0bd('0x3')]();var fs_extra=require(_0xe0bd('0x4'));var auth=require(_0xe0bd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0bd('0x6'));var controller=require(_0xe0bd('0x7'));router[_0xe0bd('0x8')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xa')]);router[_0xe0bd('0x8')](_0xe0bd('0xb'),auth['isAuthenticated'](),controller[_0xe0bd('0xc')]);router[_0xe0bd('0x8')](_0xe0bd('0xd'),auth[_0xe0bd('0x9')](),controller[_0xe0bd('0xe')]);router[_0xe0bd('0xf')]('/',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x10')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe0bd('0x11')]);router['delete']('/:id',auth[_0xe0bd('0x9')](),controller[_0xe0bd('0x12')]);module['exports']=router; \ No newline at end of file +var _0x24ca=['create','update','delete','destroy','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./smsTransferReport.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x3fea87,_0x5917e4){var _0x5c5a53=function(_0x3b8ceb){while(--_0x3b8ceb){_0x3fea87['push'](_0x3fea87['shift']());}};_0x5c5a53(++_0x5917e4);}(_0x24ca,0x8c));var _0xa24c=function(_0x3a78a0,_0x44985f){_0x3a78a0=_0x3a78a0-0x0;var _0x48e917=_0x24ca[_0x3a78a0];return _0x48e917;};'use strict';var multer=require(_0xa24c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa24c('0x1'));var express=require('express');var router=express[_0xa24c('0x2')]();var fs_extra=require(_0xa24c('0x3'));var auth=require(_0xa24c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xa24c('0x5'));var controller=require(_0xa24c('0x6'));router[_0xa24c('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xa24c('0x8'),auth[_0xa24c('0x9')](),controller[_0xa24c('0xa')]);router[_0xa24c('0x7')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller['show']);router[_0xa24c('0xc')]('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xd')]);router['put']('/:id',auth[_0xa24c('0x9')](),controller[_0xa24c('0xe')]);router[_0xa24c('0xf')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index effe816..c482d87 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(_0x571a3f,_0x1287ee){var _0x434eed=function(_0x49e042){while(--_0x49e042){_0x571a3f['push'](_0x571a3f['shift']());}};_0x434eed(++_0x1287ee);}(_0xf4eb,0xec));var _0xbf4e=function(_0x35f326,_0x58367c){_0x35f326=_0x35f326-0x0;var _0x27caf4=_0xf4eb[_0x35f326];return _0x27caf4;};'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 _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0xb68695,_0x1881a4){var _0x15a817=function(_0x4d04d6){while(--_0x4d04d6){_0xb68695['push'](_0xb68695['shift']());}};_0x15a817(++_0x1881a4);}(_0x54ef,0x112));var _0xf54e=function(_0x4212ce,_0x4c043d){_0x4212ce=_0x4212ce-0x0;var _0x1f6a30=_0x54ef[_0x4212ce];return _0x1f6a30;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 14b2e55..ae5ad16 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 _0xf7bb=['length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','find','create','body','update','params','describe','eml-format','rimraf','request-promise','moment','util','sox','to-csv','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','sendStatus','error','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','key','model','query','intersection','fields','attributes'];(function(_0x29fec7,_0x4818d3){var _0x391415=function(_0x554cd4){while(--_0x554cd4){_0x29fec7['push'](_0x29fec7['shift']());}};_0x391415(++_0x4818d3);}(_0xf7bb,0xab));var _0xbf7b=function(_0x12efc5,_0x34b7d3){_0x12efc5=_0x12efc5-0x0;var _0x43e07c=_0xf7bb[_0x12efc5];return _0x43e07c;};'use strict';var emlformat=require(_0xbf7b('0x0'));var rimraf=require(_0xbf7b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf7b('0x2'));var moment=require(_0xbf7b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf7b('0x4'));var path=require('path');var sox=require(_0xbf7b('0x5'));var csv=require(_0xbf7b('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbf7b('0x7'));var _=require('lodash');var squel=require(_0xbf7b('0x8'));var crypto=require(_0xbf7b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf7b('0x6'));var querystring=require(_0xbf7b('0xa'));var Papa=require(_0xbf7b('0xb'));var Redis=require(_0xbf7b('0xc'));var authService=require(_0xbf7b('0xd'));var qs=require(_0xbf7b('0xe'));var as=require(_0xbf7b('0xf'));var hardwareService=require(_0xbf7b('0x10'));var logger=require(_0xbf7b('0x11'))('api');var utils=require(_0xbf7b('0x12'));var config=require(_0xbf7b('0x13'));var licenseUtil=require(_0xbf7b('0x14'));var db=require(_0xbf7b('0x15'))['db'];function respondWithStatusCode(_0x2d50d6,_0x1df1b5){_0x1df1b5=_0x1df1b5||0xcc;return function(_0x219f2f){if(_0x219f2f){return _0x2d50d6['sendStatus'](_0x1df1b5);}return _0x2d50d6[_0xbf7b('0x16')](_0x1df1b5)[_0xbf7b('0x17')]();};}function respondWithResult(_0x5d75c2,_0x3a0a93){_0x3a0a93=_0x3a0a93||0xc8;return function(_0xc85a1a){if(_0xc85a1a){return _0x5d75c2[_0xbf7b('0x16')](_0x3a0a93)[_0xbf7b('0x18')](_0xc85a1a);}};}function respondWithFilteredResult(_0x493273,_0x560697){return function(_0x30ba28){if(_0x30ba28){var _0xb1db5a=typeof _0x560697[_0xbf7b('0x19')]===_0xbf7b('0x1a')&&typeof _0x560697[_0xbf7b('0x1b')]===_0xbf7b('0x1a');var _0x1ccef4=_0x30ba28[_0xbf7b('0x1c')];var _0x19de58=_0xb1db5a?0x0:_0x560697[_0xbf7b('0x19')];var _0x55aa11=_0xb1db5a?_0x30ba28[_0xbf7b('0x1c')]:_0x560697[_0xbf7b('0x19')]+_0x560697[_0xbf7b('0x1b')];var _0x6589c4;if(_0x55aa11>=_0x1ccef4){_0x55aa11=_0x1ccef4;_0x6589c4=0xc8;}else{_0x6589c4=0xce;}_0x493273['status'](_0x6589c4);return _0x493273[_0xbf7b('0x1d')](_0xbf7b('0x1e'),_0x19de58+'-'+_0x55aa11+'/'+_0x1ccef4)['json'](_0x30ba28);}return null;};}function patchUpdates(_0x52674e){return function(_0x10c789){try{jsonpatch['apply'](_0x10c789,_0x52674e,!![]);}catch(_0x22d291){return BPromise[_0xbf7b('0x1f')](_0x22d291);}return _0x10c789[_0xbf7b('0x20')]();};}function saveUpdates(_0x4088b2,_0x2c6073){return function(_0x104ec3){if(_0x104ec3){return _0x104ec3['update'](_0x4088b2)[_0xbf7b('0x21')](function(_0x3c315e){return _0x3c315e;});}return null;};}function removeEntity(_0x75a88d,_0x530079){return function(_0x509a4e){if(_0x509a4e){return _0x509a4e[_0xbf7b('0x22')]()[_0xbf7b('0x21')](function(){_0x75a88d['status'](0xcc)[_0xbf7b('0x17')]();});}};}function handleEntityNotFound(_0x46d79f,_0x5b9394){return function(_0x43cd50){if(!_0x43cd50){_0x46d79f[_0xbf7b('0x23')](0x194);}return _0x43cd50;};}function handleError(_0x2bf39a,_0x229187){_0x229187=_0x229187||0x1f4;return function(_0x35f73d){logger[_0xbf7b('0x24')](_0x35f73d['stack']);if(_0x35f73d[_0xbf7b('0x25')]){delete _0x35f73d[_0xbf7b('0x25')];}_0x2bf39a[_0xbf7b('0x16')](_0x229187)[_0xbf7b('0x26')](_0x35f73d);};}exports[_0xbf7b('0x27')]=function(_0x13b518,_0x111c4c){var _0x4767d1={},_0x1360fd={},_0xbaa933={'count':0x0,'rows':[]};var _0x2b0e91=_[_0xbf7b('0x28')](db[_0xbf7b('0x29')][_0xbf7b('0x2a')],function(_0x16254b){return{'name':_0x16254b[_0xbf7b('0x2b')],'type':_0x16254b[_0xbf7b('0x2c')][_0xbf7b('0x2d')]};});_0x1360fd[_0xbf7b('0x2e')]=_[_0xbf7b('0x28')](_0x2b0e91,'name');_0x1360fd[_0xbf7b('0x2f')]=_['keys'](_0x13b518['query']);_0x1360fd['filters']=_[_0xbf7b('0x30')](_0x1360fd[_0xbf7b('0x2e')],_0x1360fd['query']);_0x4767d1['attributes']=_['intersection'](_0x1360fd['model'],qs[_0xbf7b('0x31')](_0x13b518[_0xbf7b('0x2f')]['fields']));_0x4767d1[_0xbf7b('0x32')]=_0x4767d1[_0xbf7b('0x32')][_0xbf7b('0x33')]?_0x4767d1['attributes']:_0x1360fd['model'];if(!_0x13b518[_0xbf7b('0x2f')][_0xbf7b('0x34')]('nolimit')){_0x4767d1['limit']=qs['limit'](_0x13b518[_0xbf7b('0x2f')][_0xbf7b('0x1b')]);_0x4767d1[_0xbf7b('0x19')]=qs[_0xbf7b('0x19')](_0x13b518[_0xbf7b('0x2f')][_0xbf7b('0x19')]);}_0x4767d1[_0xbf7b('0x35')]=qs[_0xbf7b('0x36')](_0x13b518[_0xbf7b('0x2f')][_0xbf7b('0x36')]);_0x4767d1[_0xbf7b('0x37')]=qs[_0xbf7b('0x38')](_[_0xbf7b('0x39')](_0x13b518['query'],_0x1360fd['filters']),_0x2b0e91);if(_0x13b518[_0xbf7b('0x2f')]['filter']){_0x4767d1[_0xbf7b('0x37')]=_[_0xbf7b('0x3a')](_0x4767d1['where'],{'$or':_[_0xbf7b('0x28')](_0x2b0e91,function(_0x5836eb){if(_0x5836eb[_0xbf7b('0x2c')]!==_0xbf7b('0x3b')){var _0x2bb572={};_0x2bb572[_0x5836eb[_0xbf7b('0x25')]]={'$like':'%'+_0x13b518[_0xbf7b('0x2f')][_0xbf7b('0x3c')]+'%'};return _0x2bb572;}})});}_0x4767d1=_[_0xbf7b('0x3a')]({},_0x4767d1,_0x13b518[_0xbf7b('0x3d')]);var _0x26c488={'where':_0x4767d1[_0xbf7b('0x37')]};return db['SmsTransferReport'][_0xbf7b('0x1c')](_0x26c488)[_0xbf7b('0x21')](function(_0x2c0ecb){_0xbaa933[_0xbf7b('0x1c')]=_0x2c0ecb;if(_0x13b518[_0xbf7b('0x2f')]['includeAll']){_0x4767d1[_0xbf7b('0x3e')]=[{'all':!![]}];}return db[_0xbf7b('0x29')][_0xbf7b('0x3f')](_0x4767d1);})['then'](function(_0x4b1a22){_0xbaa933[_0xbf7b('0x40')]=_0x4b1a22;return _0xbaa933;})[_0xbf7b('0x21')](respondWithFilteredResult(_0x111c4c,_0x4767d1))[_0xbf7b('0x41')](handleError(_0x111c4c,null));};exports[_0xbf7b('0x42')]=function(_0x39eb77,_0x115650){var _0x179573={'raw':!![],'where':{'id':_0x39eb77['params']['id']}},_0x474c75={};_0x474c75[_0xbf7b('0x2e')]=_[_0xbf7b('0x43')](db[_0xbf7b('0x29')][_0xbf7b('0x2a')]);_0x474c75[_0xbf7b('0x2f')]=_[_0xbf7b('0x43')](_0x39eb77[_0xbf7b('0x2f')]);_0x474c75[_0xbf7b('0x38')]=_[_0xbf7b('0x30')](_0x474c75[_0xbf7b('0x2e')],_0x474c75['query']);_0x179573['attributes']=_[_0xbf7b('0x30')](_0x474c75['model'],qs[_0xbf7b('0x31')](_0x39eb77[_0xbf7b('0x2f')][_0xbf7b('0x31')]));_0x179573[_0xbf7b('0x32')]=_0x179573['attributes'][_0xbf7b('0x33')]?_0x179573[_0xbf7b('0x32')]:_0x474c75[_0xbf7b('0x2e')];if(_0x39eb77[_0xbf7b('0x2f')]['includeAll']){_0x179573[_0xbf7b('0x3e')]=[{'all':!![]}];}_0x179573=_[_0xbf7b('0x3a')]({},_0x179573,_0x39eb77[_0xbf7b('0x3d')]);return db[_0xbf7b('0x29')][_0xbf7b('0x44')](_0x179573)['then'](handleEntityNotFound(_0x115650,null))['then'](respondWithResult(_0x115650,null))['catch'](handleError(_0x115650,null));};exports[_0xbf7b('0x45')]=function(_0x44e13c,_0x2afcb2){return db[_0xbf7b('0x29')][_0xbf7b('0x45')](_0x44e13c[_0xbf7b('0x46')],{})[_0xbf7b('0x21')](respondWithResult(_0x2afcb2,0xc9))[_0xbf7b('0x41')](handleError(_0x2afcb2,null));};exports[_0xbf7b('0x47')]=function(_0x4ecd70,_0x5e89ae){if(_0x4ecd70[_0xbf7b('0x46')]['id']){delete _0x4ecd70[_0xbf7b('0x46')]['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x4ecd70[_0xbf7b('0x48')]['id']}})['then'](handleEntityNotFound(_0x5e89ae,null))[_0xbf7b('0x21')](saveUpdates(_0x4ecd70[_0xbf7b('0x46')],null))[_0xbf7b('0x21')](respondWithResult(_0x5e89ae,null))[_0xbf7b('0x41')](handleError(_0x5e89ae,null));};exports[_0xbf7b('0x22')]=function(_0x4be042,_0x4a392a){return db[_0xbf7b('0x29')][_0xbf7b('0x44')]({'where':{'id':_0x4be042[_0xbf7b('0x48')]['id']}})[_0xbf7b('0x21')](handleEntityNotFound(_0x4a392a,null))['then'](removeEntity(_0x4a392a,null))['catch'](handleError(_0x4a392a,null));};exports[_0xbf7b('0x49')]=function(_0x27cebd,_0x2ac2ce){return db[_0xbf7b('0x29')][_0xbf7b('0x49')]()[_0xbf7b('0x21')](respondWithResult(_0x2ac2ce,null))[_0xbf7b('0x41')](handleError(_0x2ac2ce,null));}; \ No newline at end of file +var _0x031d=['rawAttributes','length','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','update','then','end','error','stack','name','send','index','map','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','SmsTransferReport','includeAll','include','catch','params','keys'];(function(_0x49112e,_0x43146b){var _0x3dc9c3=function(_0x2b1d3d){while(--_0x2b1d3d){_0x49112e['push'](_0x49112e['shift']());}};_0x3dc9c3(++_0x43146b);}(_0x031d,0x16e));var _0xd031=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x031d[_0x38eb23];return _0x48506a;};'use strict';var emlformat=require(_0xd031('0x0'));var rimraf=require(_0xd031('0x1'));var zipdir=require(_0xd031('0x2'));var jsonpatch=require(_0xd031('0x3'));var rp=require('request-promise');var moment=require(_0xd031('0x4'));var BPromise=require(_0xd031('0x5'));var Mustache=require(_0xd031('0x6'));var util=require(_0xd031('0x7'));var path=require(_0xd031('0x8'));var sox=require(_0xd031('0x9'));var csv=require('to-csv');var ejs=require(_0xd031('0xa'));var fs=require('fs');var fs_extra=require(_0xd031('0xb'));var _=require(_0xd031('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd031('0xd'));var Redis=require(_0xd031('0xe'));var authService=require(_0xd031('0xf'));var qs=require(_0xd031('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd031('0x11'));var logger=require(_0xd031('0x12'))(_0xd031('0x13'));var utils=require(_0xd031('0x14'));var config=require(_0xd031('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xd031('0x16'))['db'];function respondWithStatusCode(_0x455618,_0x1941d1){_0x1941d1=_0x1941d1||0xcc;return function(_0x448e8d){if(_0x448e8d){return _0x455618[_0xd031('0x17')](_0x1941d1);}return _0x455618[_0xd031('0x18')](_0x1941d1)['end']();};}function respondWithResult(_0x48cb31,_0x594a9c){_0x594a9c=_0x594a9c||0xc8;return function(_0x2d3c72){if(_0x2d3c72){return _0x48cb31['status'](_0x594a9c)[_0xd031('0x19')](_0x2d3c72);}};}function respondWithFilteredResult(_0x3389fd,_0xb2a6e8){return function(_0x4bb6cd){if(_0x4bb6cd){var _0x51b1a2=typeof _0xb2a6e8[_0xd031('0x1a')]===_0xd031('0x1b')&&typeof _0xb2a6e8[_0xd031('0x1c')]===_0xd031('0x1b');var _0x3fd5e5=_0x4bb6cd[_0xd031('0x1d')];var _0x5e74a9=_0x51b1a2?0x0:_0xb2a6e8[_0xd031('0x1a')];var _0x24d2dd=_0x51b1a2?_0x4bb6cd['count']:_0xb2a6e8['offset']+_0xb2a6e8[_0xd031('0x1c')];var _0x1ef5ab;if(_0x24d2dd>=_0x3fd5e5){_0x24d2dd=_0x3fd5e5;_0x1ef5ab=0xc8;}else{_0x1ef5ab=0xce;}_0x3389fd['status'](_0x1ef5ab);return _0x3389fd[_0xd031('0x1e')]('Content-Range',_0x5e74a9+'-'+_0x24d2dd+'/'+_0x3fd5e5)[_0xd031('0x19')](_0x4bb6cd);}return null;};}function patchUpdates(_0x21a0f2){return function(_0x5cf7f4){try{jsonpatch[_0xd031('0x1f')](_0x5cf7f4,_0x21a0f2,!![]);}catch(_0x3bf862){return BPromise[_0xd031('0x20')](_0x3bf862);}return _0x5cf7f4['save']();};}function saveUpdates(_0x301513,_0x350f2b){return function(_0x2a11f5){if(_0x2a11f5){return _0x2a11f5[_0xd031('0x21')](_0x301513)[_0xd031('0x22')](function(_0x5d8459){return _0x5d8459;});}return null;};}function removeEntity(_0x3e8cff,_0x10185b){return function(_0x4140f6){if(_0x4140f6){return _0x4140f6['destroy']()[_0xd031('0x22')](function(){_0x3e8cff[_0xd031('0x18')](0xcc)[_0xd031('0x23')]();});}};}function handleEntityNotFound(_0x262c9f,_0x4a246c){return function(_0x2678d4){if(!_0x2678d4){_0x262c9f['sendStatus'](0x194);}return _0x2678d4;};}function handleError(_0x1532c1,_0x49d28e){_0x49d28e=_0x49d28e||0x1f4;return function(_0x51333f){logger[_0xd031('0x24')](_0x51333f[_0xd031('0x25')]);if(_0x51333f[_0xd031('0x26')]){delete _0x51333f[_0xd031('0x26')];}_0x1532c1[_0xd031('0x18')](_0x49d28e)[_0xd031('0x27')](_0x51333f);};}exports[_0xd031('0x28')]=function(_0x188c2b,_0x580094){var _0xd2cf1a={},_0x12626f={},_0x3b9772={'count':0x0,'rows':[]};var _0x375335=_[_0xd031('0x29')](db['SmsTransferReport']['rawAttributes'],function(_0x472753){return{'name':_0x472753['fieldName'],'type':_0x472753[_0xd031('0x2a')][_0xd031('0x2b')]};});_0x12626f[_0xd031('0x2c')]=_['map'](_0x375335,_0xd031('0x26'));_0x12626f[_0xd031('0x2d')]=_['keys'](_0x188c2b[_0xd031('0x2d')]);_0x12626f[_0xd031('0x2e')]=_[_0xd031('0x2f')](_0x12626f['model'],_0x12626f[_0xd031('0x2d')]);_0xd2cf1a[_0xd031('0x30')]=_[_0xd031('0x2f')](_0x12626f[_0xd031('0x2c')],qs['fields'](_0x188c2b[_0xd031('0x2d')][_0xd031('0x31')]));_0xd2cf1a[_0xd031('0x30')]=_0xd2cf1a['attributes']['length']?_0xd2cf1a[_0xd031('0x30')]:_0x12626f[_0xd031('0x2c')];if(!_0x188c2b[_0xd031('0x2d')][_0xd031('0x32')](_0xd031('0x33'))){_0xd2cf1a[_0xd031('0x1c')]=qs[_0xd031('0x1c')](_0x188c2b[_0xd031('0x2d')][_0xd031('0x1c')]);_0xd2cf1a[_0xd031('0x1a')]=qs[_0xd031('0x1a')](_0x188c2b[_0xd031('0x2d')][_0xd031('0x1a')]);}_0xd2cf1a[_0xd031('0x34')]=qs[_0xd031('0x35')](_0x188c2b[_0xd031('0x2d')][_0xd031('0x35')]);_0xd2cf1a['where']=qs[_0xd031('0x2e')](_[_0xd031('0x36')](_0x188c2b[_0xd031('0x2d')],_0x12626f['filters']),_0x375335);if(_0x188c2b[_0xd031('0x2d')][_0xd031('0x37')]){_0xd2cf1a[_0xd031('0x38')]=_[_0xd031('0x39')](_0xd2cf1a[_0xd031('0x38')],{'$or':_['map'](_0x375335,function(_0x5dbceb){if(_0x5dbceb[_0xd031('0x2a')]!==_0xd031('0x3a')){var _0x240251={};_0x240251[_0x5dbceb[_0xd031('0x26')]]={'$like':'%'+_0x188c2b[_0xd031('0x2d')][_0xd031('0x37')]+'%'};return _0x240251;}})});}_0xd2cf1a=_[_0xd031('0x39')]({},_0xd2cf1a,_0x188c2b[_0xd031('0x3b')]);var _0x109683={'where':_0xd2cf1a[_0xd031('0x38')]};return db[_0xd031('0x3c')][_0xd031('0x1d')](_0x109683)['then'](function(_0x496b15){_0x3b9772['count']=_0x496b15;if(_0x188c2b[_0xd031('0x2d')][_0xd031('0x3d')]){_0xd2cf1a[_0xd031('0x3e')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0xd2cf1a);})[_0xd031('0x22')](function(_0x49a023){_0x3b9772['rows']=_0x49a023;return _0x3b9772;})[_0xd031('0x22')](respondWithFilteredResult(_0x580094,_0xd2cf1a))[_0xd031('0x3f')](handleError(_0x580094,null));};exports['show']=function(_0x5d6f3a,_0x1547b5){var _0x7237a={'raw':!![],'where':{'id':_0x5d6f3a[_0xd031('0x40')]['id']}},_0x301de5={};_0x301de5[_0xd031('0x2c')]=_[_0xd031('0x41')](db['SmsTransferReport'][_0xd031('0x42')]);_0x301de5[_0xd031('0x2d')]=_[_0xd031('0x41')](_0x5d6f3a['query']);_0x301de5['filters']=_['intersection'](_0x301de5[_0xd031('0x2c')],_0x301de5[_0xd031('0x2d')]);_0x7237a[_0xd031('0x30')]=_[_0xd031('0x2f')](_0x301de5[_0xd031('0x2c')],qs['fields'](_0x5d6f3a[_0xd031('0x2d')][_0xd031('0x31')]));_0x7237a[_0xd031('0x30')]=_0x7237a[_0xd031('0x30')][_0xd031('0x43')]?_0x7237a['attributes']:_0x301de5['model'];if(_0x5d6f3a[_0xd031('0x2d')][_0xd031('0x3d')]){_0x7237a[_0xd031('0x3e')]=[{'all':!![]}];}_0x7237a=_['merge']({},_0x7237a,_0x5d6f3a[_0xd031('0x3b')]);return db[_0xd031('0x3c')][_0xd031('0x44')](_0x7237a)[_0xd031('0x22')](handleEntityNotFound(_0x1547b5,null))[_0xd031('0x22')](respondWithResult(_0x1547b5,null))[_0xd031('0x3f')](handleError(_0x1547b5,null));};exports[_0xd031('0x45')]=function(_0x598196,_0x1151cf){return db[_0xd031('0x3c')][_0xd031('0x45')](_0x598196[_0xd031('0x46')],{})[_0xd031('0x22')](respondWithResult(_0x1151cf,0xc9))[_0xd031('0x3f')](handleError(_0x1151cf,null));};exports[_0xd031('0x21')]=function(_0x2c8cb7,_0x17f901){if(_0x2c8cb7['body']['id']){delete _0x2c8cb7[_0xd031('0x46')]['id'];}return db['SmsTransferReport'][_0xd031('0x44')]({'where':{'id':_0x2c8cb7[_0xd031('0x40')]['id']}})[_0xd031('0x22')](handleEntityNotFound(_0x17f901,null))['then'](saveUpdates(_0x2c8cb7[_0xd031('0x46')],null))['then'](respondWithResult(_0x17f901,null))[_0xd031('0x3f')](handleError(_0x17f901,null));};exports['destroy']=function(_0x2641f1,_0x4b86b9){return db[_0xd031('0x3c')][_0xd031('0x44')]({'where':{'id':_0x2641f1[_0xd031('0x40')]['id']}})[_0xd031('0x22')](handleEntityNotFound(_0x4b86b9,null))[_0xd031('0x22')](removeEntity(_0x4b86b9,null))[_0xd031('0x3f')](handleError(_0x4b86b9,null));};exports[_0xd031('0x47')]=function(_0x3a32fd,_0x29ea70){return db[_0xd031('0x3c')][_0xd031('0x47')]()[_0xd031('0x22')](respondWithResult(_0x29ea70,null))[_0xd031('0x3f')](handleError(_0x29ea70,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 365374b..0dbb5ce 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 _0x6611=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','SmsTransferReport','report_sms_transfer'];(function(_0x594b8b,_0x38bdb3){var _0x1e97ca=function(_0x5d6d60){while(--_0x5d6d60){_0x594b8b['push'](_0x594b8b['shift']());}};_0x1e97ca(++_0x38bdb3);}(_0x6611,0xdd));var _0x1661=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6611[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x1661('0x0'));var logger=require(_0x1661('0x1'))(_0x1661('0x2'));var moment=require(_0x1661('0x3'));var BPromise=require(_0x1661('0x4'));var rp=require(_0x1661('0x5'));var fs=require('fs');var path=require(_0x1661('0x6'));var rimraf=require(_0x1661('0x7'));var config=require(_0x1661('0x8'));var attributes=require(_0x1661('0x9'));module[_0x1661('0xa')]=function(_0x1e5dab,_0x58781d){return _0x1e5dab['define'](_0x1661('0xb'),attributes,{'tableName':_0x1661('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f17=['exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0f17,0x8b));var _0x70f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0f17[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x70f1('0x0'));var util=require(_0x70f1('0x1'));var logger=require(_0x70f1('0x2'))(_0x70f1('0x3'));var moment=require(_0x70f1('0x4'));var BPromise=require(_0x70f1('0x5'));var rp=require(_0x70f1('0x6'));var fs=require('fs');var path=require(_0x70f1('0x7'));var rimraf=require(_0x70f1('0x8'));var config=require(_0x70f1('0x9'));var attributes=require(_0x70f1('0xa'));module[_0x70f1('0xb')]=function(_0x16a576,_0x880fc){return _0x16a576[_0x70f1('0xc')](_0x70f1('0xd'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x70f1('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 9fa6258..aaac742 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 _0x9a22=['debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent'];(function(_0x44948e,_0x100c79){var _0xc851cf=function(_0xea8225){while(--_0xea8225){_0x44948e['push'](_0x44948e['shift']());}};_0xc851cf(++_0x100c79);}(_0x9a22,0x75));var _0x29a2=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x9a22[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x29a2('0x0'));var util=require(_0x29a2('0x1'));var moment=require(_0x29a2('0x2'));var BPromise=require(_0x29a2('0x3'));var rs=require(_0x29a2('0x4'));var fs=require('fs');var Redis=require(_0x29a2('0x5'));var db=require(_0x29a2('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x29a2('0x7'));var config=require(_0x29a2('0x8'));var jayson=require(_0x29a2('0x9'));var client=jayson[_0x29a2('0xa')][_0x29a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xfb91e8,_0x41ea7c,_0x2887e1){return new BPromise(function(_0x4b55de,_0x2d7d97){return client[_0x29a2('0xc')](_0xfb91e8,_0x2887e1)['then'](function(_0x3d9a5c){logger[_0x29a2('0xd')]('SmsTransferReport,\x20%s,\x20%s',_0x41ea7c,_0x29a2('0xe'));logger[_0x29a2('0xf')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x41ea7c,_0x29a2('0xe'),JSON[_0x29a2('0x10')](_0x3d9a5c));if(_0x3d9a5c[_0x29a2('0x11')]){if(_0x3d9a5c[_0x29a2('0x11')][_0x29a2('0x12')]===0x1f4){logger[_0x29a2('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x41ea7c,_0x3d9a5c[_0x29a2('0x11')][_0x29a2('0x13')]);return _0x2d7d97(_0x3d9a5c[_0x29a2('0x11')][_0x29a2('0x13')]);}logger[_0x29a2('0x11')](_0x29a2('0x14'),_0x41ea7c,_0x3d9a5c[_0x29a2('0x11')]['message']);return _0x4b55de(_0x3d9a5c[_0x29a2('0x11')][_0x29a2('0x13')]);}else{logger[_0x29a2('0xd')](_0x29a2('0x14'),_0x41ea7c,'request\x20sent');_0x4b55de(_0x3d9a5c['result'][_0x29a2('0x13')]);}})[_0x29a2('0x15')](function(_0x1b712c){logger[_0x29a2('0x11')](_0x29a2('0x14'),_0x41ea7c,_0x1b712c);_0x2d7d97(_0x1b712c);});});} \ No newline at end of file +var _0xbe52=['stringify','error','code','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SmsTransferReport,\x20%s,\x20%s','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x49e489,_0x198e41){var _0xcc7a16=function(_0x2bf324){while(--_0x2bf324){_0x49e489['push'](_0x49e489['shift']());}};_0xcc7a16(++_0x198e41);}(_0xbe52,0x164));var _0x2be5=function(_0x5106fa,_0x32d9c2){_0x5106fa=_0x5106fa-0x0;var _0x5718db=_0xbe52[_0x5106fa];return _0x5718db;};'use strict';var _=require(_0x2be5('0x0'));var util=require(_0x2be5('0x1'));var moment=require(_0x2be5('0x2'));var BPromise=require(_0x2be5('0x3'));var rs=require(_0x2be5('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2be5('0x5'))['db'];var utils=require(_0x2be5('0x6'));var logger=require(_0x2be5('0x7'))(_0x2be5('0x8'));var config=require(_0x2be5('0x9'));var jayson=require(_0x2be5('0xa'));var client=jayson[_0x2be5('0xb')][_0x2be5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2ca6a7,_0x58980d,_0x1f346a){return new BPromise(function(_0x3169b3,_0x4a86d1){return client[_0x2be5('0xd')](_0x2ca6a7,_0x1f346a)[_0x2be5('0xe')](function(_0x3bdce2){logger['info'](_0x2be5('0xf'),_0x58980d,'request\x20sent');logger['debug'](_0x2be5('0x10'),_0x58980d,_0x2be5('0x11'),JSON[_0x2be5('0x12')](_0x3bdce2));if(_0x3bdce2[_0x2be5('0x13')]){if(_0x3bdce2['error'][_0x2be5('0x14')]===0x1f4){logger[_0x2be5('0x13')]('SmsTransferReport,\x20%s,\x20%s',_0x58980d,_0x3bdce2['error'][_0x2be5('0x15')]);return _0x4a86d1(_0x3bdce2[_0x2be5('0x13')]['message']);}logger[_0x2be5('0x13')](_0x2be5('0xf'),_0x58980d,_0x3bdce2[_0x2be5('0x13')][_0x2be5('0x15')]);return _0x3169b3(_0x3bdce2[_0x2be5('0x13')][_0x2be5('0x15')]);}else{logger['info']('SmsTransferReport,\x20%s,\x20%s',_0x58980d,_0x2be5('0x11'));_0x3169b3(_0x3bdce2['result'][_0x2be5('0x15')]);}})['catch'](function(_0x31bcbc){logger[_0x2be5('0x13')](_0x2be5('0xf'),_0x58980d,_0x31bcbc);_0x4a86d1(_0x31bcbc);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index eb9e379..53ad7b7 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 _0xc980=['show','/:id/download','download','diskStorage','join','root','originalname','replace','basename','extname','now','post','single','file','put','/:id','update','delete','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index'];(function(_0x334c7d,_0x17c008){var _0x155409=function(_0x33314b){while(--_0x33314b){_0x334c7d['push'](_0x334c7d['shift']());}};_0x155409(++_0x17c008);}(_0xc980,0xfa));var _0x0c98=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0xc980[_0x2e4aa2];return _0x5e6092;};'use strict';var multer=require(_0x0c98('0x0'));var util=require(_0x0c98('0x1'));var path=require(_0x0c98('0x2'));var timeout=require(_0x0c98('0x3'));var express=require('express');var router=express[_0x0c98('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x0c98('0x5'));var config=require(_0x0c98('0x6'));var controller=require(_0x0c98('0x7'));router[_0x0c98('0x8')]('/',auth[_0x0c98('0x9')](),controller[_0x0c98('0xa')]);router[_0x0c98('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0c98('0xb')]);router['get'](_0x0c98('0xc'),auth[_0x0c98('0x9')](),controller[_0x0c98('0xd')]);var upload=multer({'storage':multer[_0x0c98('0xe')]({'destination':function(_0x37edbe,_0x4dd022,_0x197946){_0x197946(null,path[_0x0c98('0xf')](config[_0x0c98('0x10')],'server/files/sounds/original/'));},'filename':function(_0x543087,_0x2b8ca6,_0x5aed99){_0x2b8ca6[_0x0c98('0x11')]=_0x2b8ca6['originalname'][_0x0c98('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5aed99(null,util['format']('%s-%s%s',path[_0x0c98('0x13')](_0x2b8ca6[_0x0c98('0x11')],path[_0x0c98('0x14')](_0x2b8ca6[_0x0c98('0x11')])),Date[_0x0c98('0x15')](),path['extname'](_0x2b8ca6[_0x0c98('0x11')])));}})});router[_0x0c98('0x16')]('/',upload[_0x0c98('0x17')](_0x0c98('0x18')),controller['create']);router[_0x0c98('0x19')](_0x0c98('0x1a'),auth[_0x0c98('0x9')](),controller[_0x0c98('0x1b')]);router[_0x0c98('0x1c')]('/:id',auth['isAuthenticated'](),controller['delete']);module['exports']=router; \ No newline at end of file +var _0x5a06=['create','/:id','update','delete','multer','util','connect-timeout','express','Router','get','isAuthenticated','index','show','/:id/download','download','diskStorage','join','server/files/sounds/original/','originalname','replace','basename','now','extname','post','single'];(function(_0x3c340a,_0x2e54ea){var _0x30651e=function(_0x17555f){while(--_0x17555f){_0x3c340a['push'](_0x3c340a['shift']());}};_0x30651e(++_0x2e54ea);}(_0x5a06,0xfe));var _0x65a0=function(_0x16dbcd,_0x274516){_0x16dbcd=_0x16dbcd-0x0;var _0x34706e=_0x5a06[_0x16dbcd];return _0x34706e;};'use strict';var multer=require(_0x65a0('0x0'));var util=require(_0x65a0('0x1'));var path=require('path');var timeout=require(_0x65a0('0x2'));var express=require(_0x65a0('0x3'));var router=express[_0x65a0('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router[_0x65a0('0x5')]('/',auth[_0x65a0('0x6')](),controller[_0x65a0('0x7')]);router[_0x65a0('0x5')]('/:id',auth[_0x65a0('0x6')](),controller[_0x65a0('0x8')]);router['get'](_0x65a0('0x9'),auth[_0x65a0('0x6')](),controller[_0x65a0('0xa')]);var upload=multer({'storage':multer[_0x65a0('0xb')]({'destination':function(_0x4f1dcd,_0x4dc157,_0x179e23){_0x179e23(null,path[_0x65a0('0xc')](config['root'],_0x65a0('0xd')));},'filename':function(_0x331098,_0x39ec18,_0x537452){_0x39ec18['originalname']=_0x39ec18[_0x65a0('0xe')][_0x65a0('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x537452(null,util['format']('%s-%s%s',path[_0x65a0('0x10')](_0x39ec18['originalname'],path['extname'](_0x39ec18[_0x65a0('0xe')])),Date[_0x65a0('0x11')](),path[_0x65a0('0x12')](_0x39ec18['originalname'])));}})});router[_0x65a0('0x13')]('/',upload[_0x65a0('0x14')]('file'),controller[_0x65a0('0x15')]);router['put'](_0x65a0('0x16'),auth[_0x65a0('0x6')](),controller[_0x65a0('0x17')]);router[_0x65a0('0x18')](_0x65a0('0x16'),auth[_0x65a0('0x6')](),controller[_0x65a0('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index c9bfac5..1b7d768 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 _0xd51e=['INTEGER','sequelize','STRING','FLOAT','BIGINT'];(function(_0x4722f7,_0x5d7998){var _0x2ec286=function(_0x428ff3){while(--_0x428ff3){_0x4722f7['push'](_0x4722f7['shift']());}};_0x2ec286(++_0x5d7998);}(_0xd51e,0xc9));var _0xed51=function(_0x1c81be,_0x38517f){_0x1c81be=_0x1c81be-0x0;var _0x3be677=_0xd51e[_0x1c81be];return _0x3be677;};'use strict';var Sequelize=require(_0xed51('0x0'));module['exports']={'name':{'type':Sequelize[_0xed51('0x1')],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize[_0xed51('0x1')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xed51('0x2')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize[_0xed51('0x3')]},'original_sampleRate':{'type':Sequelize[_0xed51('0x4')]},'converted_format':{'type':Sequelize[_0xed51('0x1')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0xed51('0x3')]},'converted_channelCount':{'type':Sequelize[_0xed51('0x4')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0xed51('0x4')]}}; \ No newline at end of file +var _0x3167=['name','FLOAT','INTEGER','BIGINT','sequelize','exports','STRING'];(function(_0x3902c1,_0x1c9eb2){var _0x1266cc=function(_0x50c2c5){while(--_0x50c2c5){_0x3902c1['push'](_0x3902c1['shift']());}};_0x1266cc(++_0x1c9eb2);}(_0x3167,0x14d));var _0x7316=function(_0xab9f3d,_0xb336fa){_0xab9f3d=_0xab9f3d-0x0;var _0x5283bf=_0x3167[_0xab9f3d];return _0x5283bf;};'use strict';var Sequelize=require(_0x7316('0x0'));module[_0x7316('0x1')]={'name':{'type':Sequelize[_0x7316('0x2')],'unique':_0x7316('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x7316('0x2')]},'display_name':{'type':Sequelize[_0x7316('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0x7316('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x7316('0x5')]},'original_bitRate':{'type':Sequelize[_0x7316('0x6')]},'original_sampleRate':{'type':Sequelize[_0x7316('0x5')]},'converted_format':{'type':Sequelize[_0x7316('0x2')]},'converted_duration':{'type':Sequelize[_0x7316('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x7316('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x7316('0x6')]},'converted_sampleRate':{'type':Sequelize[_0x7316('0x5')]}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index c0072b0..82d595a 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 _0x4bae=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','Sound','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','download','converted_format','existsSync','server/files/sounds/converted','save_name','ValidationError','join','root','%s.%s','format','create','basename','file','originalname','extname','substring','wav','server/files/sounds/original','filename','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','0777','transcode','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','get','UserProfileSection','autoAssociation','UserProfileResource','start','description','delete','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring'];(function(_0x4c7001,_0x5a66cf){var _0x1d552c=function(_0x470b46){while(--_0x470b46){_0x4c7001['push'](_0x4c7001['shift']());}};_0x1d552c(++_0x5a66cf);}(_0x4bae,0xe0));var _0xe4ba=function(_0x43e4b3,_0x1444de){_0x43e4b3=_0x43e4b3-0x0;var _0x10c655=_0x4bae[_0x43e4b3];return _0x10c655;};'use strict';var emlformat=require(_0xe4ba('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe4ba('0x1'));var rp=require(_0xe4ba('0x2'));var moment=require(_0xe4ba('0x3'));var BPromise=require(_0xe4ba('0x4'));var Mustache=require(_0xe4ba('0x5'));var util=require('util');var path=require(_0xe4ba('0x6'));var sox=require(_0xe4ba('0x7'));var csv=require(_0xe4ba('0x8'));var ejs=require(_0xe4ba('0x9'));var fs=require('fs');var fs_extra=require(_0xe4ba('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xe4ba('0xb'));var jsforce=require(_0xe4ba('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe4ba('0x8'));var querystring=require(_0xe4ba('0xd'));var Papa=require(_0xe4ba('0xe'));var Redis=require('ioredis');var authService=require(_0xe4ba('0xf'));var qs=require(_0xe4ba('0x10'));var as=require(_0xe4ba('0x11'));var hardwareService=require(_0xe4ba('0x12'));var logger=require(_0xe4ba('0x13'))(_0xe4ba('0x14'));var utils=require(_0xe4ba('0x15'));var config=require(_0xe4ba('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4ba('0x17'))['db'];function respondWithStatusCode(_0x3d5ec1,_0x2243e8){_0x2243e8=_0x2243e8||0xcc;return function(_0x39307d){if(_0x39307d){return _0x3d5ec1['sendStatus'](_0x2243e8);}return _0x3d5ec1[_0xe4ba('0x18')](_0x2243e8)[_0xe4ba('0x19')]();};}function respondWithResult(_0x4e7ae8,_0x1f5334){_0x1f5334=_0x1f5334||0xc8;return function(_0x12a2a0){if(_0x12a2a0){return _0x4e7ae8[_0xe4ba('0x18')](_0x1f5334)[_0xe4ba('0x1a')](_0x12a2a0);}};}function respondWithFilteredResult(_0xebb8b6,_0x3a065f){return function(_0x535b88){if(_0x535b88){var _0x25ce9d=typeof _0x3a065f[_0xe4ba('0x1b')]===_0xe4ba('0x1c')&&typeof _0x3a065f[_0xe4ba('0x1d')]===_0xe4ba('0x1c');var _0x444689=_0x535b88[_0xe4ba('0x1e')];var _0x19feac=_0x25ce9d?0x0:_0x3a065f[_0xe4ba('0x1b')];var _0xed3f5e=_0x25ce9d?_0x535b88[_0xe4ba('0x1e')]:_0x3a065f[_0xe4ba('0x1b')]+_0x3a065f[_0xe4ba('0x1d')];var _0x25ba3b;if(_0xed3f5e>=_0x444689){_0xed3f5e=_0x444689;_0x25ba3b=0xc8;}else{_0x25ba3b=0xce;}_0xebb8b6[_0xe4ba('0x18')](_0x25ba3b);return _0xebb8b6['set'](_0xe4ba('0x1f'),_0x19feac+'-'+_0xed3f5e+'/'+_0x444689)[_0xe4ba('0x1a')](_0x535b88);}return null;};}function patchUpdates(_0x57832c){return function(_0x313ea4){try{jsonpatch['apply'](_0x313ea4,_0x57832c,!![]);}catch(_0x11d30a){return BPromise['reject'](_0x11d30a);}return _0x313ea4[_0xe4ba('0x20')]();};}function saveUpdates(_0x16f251,_0x386e07){return function(_0x22a8d8){if(_0x22a8d8){return _0x22a8d8[_0xe4ba('0x21')](_0x16f251)[_0xe4ba('0x22')](function(_0x169a49){return _0x169a49;});}return null;};}function removeEntity(_0x233e34,_0x34bfbe){return function(_0x2ddb3e){if(_0x2ddb3e){return _0x2ddb3e['destroy']()[_0xe4ba('0x22')](function(){var _0x4bdb70=_0x2ddb3e['get']({'plain':!![]});var _0x29d8b5='Sounds';return db['UserProfileResource'][_0xe4ba('0x23')]({'where':{'type':_0x29d8b5,'resourceId':_0x4bdb70['id']}})[_0xe4ba('0x22')](function(){return _0x2ddb3e;});})[_0xe4ba('0x22')](function(){_0x233e34['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x80185c,_0x4d020d){return function(_0x45ca9b){if(!_0x45ca9b){_0x80185c[_0xe4ba('0x24')](0x194);}return _0x45ca9b;};}function handleError(_0x285240,_0x50d582){_0x50d582=_0x50d582||0x1f4;return function(_0x2bf607){logger[_0xe4ba('0x25')](_0x2bf607[_0xe4ba('0x26')]);if(_0x2bf607[_0xe4ba('0x27')]){delete _0x2bf607[_0xe4ba('0x27')];}_0x285240[_0xe4ba('0x18')](_0x50d582)[_0xe4ba('0x28')](_0x2bf607);};}exports[_0xe4ba('0x29')]=function(_0x5033e7,_0x3061ae){var _0x2c4e02={},_0x5c7ebc={},_0x22199d={'count':0x0,'rows':[]};var _0x20e081=_[_0xe4ba('0x2a')](db[_0xe4ba('0x2b')]['rawAttributes'],function(_0xdf8784){return{'name':_0xdf8784[_0xe4ba('0x2c')],'type':_0xdf8784[_0xe4ba('0x2d')]['key']};});_0x5c7ebc[_0xe4ba('0x2e')]=_[_0xe4ba('0x2a')](_0x20e081,'name');_0x5c7ebc[_0xe4ba('0x2f')]=_[_0xe4ba('0x30')](_0x5033e7[_0xe4ba('0x2f')]);_0x5c7ebc[_0xe4ba('0x31')]=_[_0xe4ba('0x32')](_0x5c7ebc[_0xe4ba('0x2e')],_0x5c7ebc[_0xe4ba('0x2f')]);_0x2c4e02[_0xe4ba('0x33')]=_['intersection'](_0x5c7ebc[_0xe4ba('0x2e')],qs[_0xe4ba('0x34')](_0x5033e7['query'][_0xe4ba('0x34')]));_0x2c4e02[_0xe4ba('0x33')]=_0x2c4e02[_0xe4ba('0x33')][_0xe4ba('0x35')]?_0x2c4e02[_0xe4ba('0x33')]:_0x5c7ebc[_0xe4ba('0x2e')];if(!_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x36')]('nolimit')){_0x2c4e02[_0xe4ba('0x1d')]=qs['limit'](_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x1d')]);_0x2c4e02[_0xe4ba('0x1b')]=qs['offset'](_0x5033e7[_0xe4ba('0x2f')]['offset']);}_0x2c4e02['order']=qs[_0xe4ba('0x37')](_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x37')]);_0x2c4e02[_0xe4ba('0x38')]=qs['filters'](_['pick'](_0x5033e7[_0xe4ba('0x2f')],_0x5c7ebc[_0xe4ba('0x31')]),_0x20e081);if(_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x39')]){_0x2c4e02[_0xe4ba('0x38')]=_[_0xe4ba('0x3a')](_0x2c4e02['where'],{'$or':_[_0xe4ba('0x2a')](_0x20e081,function(_0x306f91){if(_0x306f91[_0xe4ba('0x2d')]!==_0xe4ba('0x3b')){var _0x595d71={};_0x595d71[_0x306f91[_0xe4ba('0x27')]]={'$like':'%'+_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x39')]+'%'};return _0x595d71;}})});}_0x2c4e02=_[_0xe4ba('0x3a')]({},_0x2c4e02,_0x5033e7[_0xe4ba('0x3c')]);var _0x25ecc1={'where':_0x2c4e02[_0xe4ba('0x38')]};return db[_0xe4ba('0x2b')][_0xe4ba('0x1e')](_0x25ecc1)[_0xe4ba('0x22')](function(_0x13ed0b){_0x22199d[_0xe4ba('0x1e')]=_0x13ed0b;if(_0x5033e7[_0xe4ba('0x2f')][_0xe4ba('0x3d')]){_0x2c4e02[_0xe4ba('0x3e')]=[{'all':!![]}];}return db[_0xe4ba('0x2b')][_0xe4ba('0x3f')](_0x2c4e02);})[_0xe4ba('0x22')](function(_0x178feb){_0x22199d[_0xe4ba('0x40')]=_0x178feb;return _0x22199d;})[_0xe4ba('0x22')](respondWithFilteredResult(_0x3061ae,_0x2c4e02))[_0xe4ba('0x41')](handleError(_0x3061ae,null));};exports[_0xe4ba('0x42')]=function(_0x11515a,_0x2bc26f){var _0x5827e2={'raw':!![],'where':{'id':_0x11515a[_0xe4ba('0x43')]['id']}},_0x3ac9d5={};_0x3ac9d5[_0xe4ba('0x2e')]=_[_0xe4ba('0x30')](db[_0xe4ba('0x2b')]['rawAttributes']);_0x3ac9d5[_0xe4ba('0x2f')]=_[_0xe4ba('0x30')](_0x11515a[_0xe4ba('0x2f')]);_0x3ac9d5['filters']=_[_0xe4ba('0x32')](_0x3ac9d5[_0xe4ba('0x2e')],_0x3ac9d5[_0xe4ba('0x2f')]);_0x5827e2['attributes']=_[_0xe4ba('0x32')](_0x3ac9d5['model'],qs[_0xe4ba('0x34')](_0x11515a[_0xe4ba('0x2f')]['fields']));_0x5827e2[_0xe4ba('0x33')]=_0x5827e2[_0xe4ba('0x33')][_0xe4ba('0x35')]?_0x5827e2[_0xe4ba('0x33')]:_0x3ac9d5[_0xe4ba('0x2e')];if(_0x11515a[_0xe4ba('0x2f')][_0xe4ba('0x3d')]){_0x5827e2[_0xe4ba('0x3e')]=[{'all':!![]}];}_0x5827e2=_[_0xe4ba('0x3a')]({},_0x5827e2,_0x11515a[_0xe4ba('0x3c')]);return db[_0xe4ba('0x2b')][_0xe4ba('0x44')](_0x5827e2)['then'](handleEntityNotFound(_0x2bc26f,null))[_0xe4ba('0x22')](respondWithResult(_0x2bc26f,null))[_0xe4ba('0x41')](handleError(_0x2bc26f,null));};exports[_0xe4ba('0x45')]=function(_0x3d39ba,_0x5a83fc,_0xbc7d24){return db[_0xe4ba('0x2b')][_0xe4ba('0x44')]({'where':{'id':_0x3d39ba[_0xe4ba('0x43')]['id']},'attributes':[_0xe4ba('0x27'),'save_name',_0xe4ba('0x46')],'raw':!![]})[_0xe4ba('0x22')](handleEntityNotFound(_0x5a83fc,null))[_0xe4ba('0x22')](function(_0x19c390){if(_0x19c390){if(!fs[_0xe4ba('0x47')](path['join'](config['root'],_0xe4ba('0x48'),_0x19c390[_0xe4ba('0x49')]+'.'+_0x19c390[_0xe4ba('0x46')]))){throw new db['Sequelize'][(_0xe4ba('0x4a'))]('Sound\x20not\x20found');}return _0x5a83fc[_0xe4ba('0x45')](path[_0xe4ba('0x4b')](config[_0xe4ba('0x4c')],_0xe4ba('0x48'),util['format'](_0xe4ba('0x4d'),_0x19c390['save_name'],_0x19c390[_0xe4ba('0x46')])),util[_0xe4ba('0x4e')]('%s.%s',_0x19c390[_0xe4ba('0x27')],_0x19c390[_0xe4ba('0x46')]));}return null;})['catch'](handleError(_0x5a83fc,null));};exports[_0xe4ba('0x4f')]=function(_0x88c862,_0x4d0c2b,_0x21b912){var _0x359a53={'name':path[_0xe4ba('0x50')](_0x88c862[_0xe4ba('0x51')]['originalname'],path['extname'](_0x88c862['file'][_0xe4ba('0x52')])),'save_name':path['basename'](_0x88c862[_0xe4ba('0x51')]['filename'],path[_0xe4ba('0x53')](_0x88c862['file']['filename'])),'original_format':path[_0xe4ba('0x53')](_0x88c862[_0xe4ba('0x51')]['originalname'])[_0xe4ba('0x54')](0x1),'converted_format':_0xe4ba('0x55')};var _0xe4b1ad=path['join'](config[_0xe4ba('0x4c')],_0xe4ba('0x56'),_0x88c862[_0xe4ba('0x51')][_0xe4ba('0x57')]);var _0x1fb047=path[_0xe4ba('0x4b')](config[_0xe4ba('0x4c')],_0xe4ba('0x48'),util['format'](_0xe4ba('0x4d'),path[_0xe4ba('0x50')](_0x88c862[_0xe4ba('0x51')][_0xe4ba('0x57')],path[_0xe4ba('0x53')](_0x88c862[_0xe4ba('0x51')][_0xe4ba('0x57')])),_0x359a53[_0xe4ba('0x46')]));logger[_0xe4ba('0x58')](_0xe4ba('0x59'),_0xe4b1ad);logger[_0xe4ba('0x58')]('Sound\x20upload\x20destination:\x20%s',_0x1fb047);try{fs[_0xe4ba('0x5a')](_0xe4b1ad,parseInt(_0xe4ba('0x5b'),0x8));var _0x27dd25=sox[_0xe4ba('0x5c')](_0xe4b1ad,_0x1fb047,{'sampleRate':0x1f40,'format':_0xe4ba('0x55'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x27dd25['on'](_0xe4ba('0x25'),function(_0x4c1de8){fs[_0xe4ba('0x5d')](_0xe4b1ad);_0x4d0c2b['status'](0x1f4)[_0xe4ba('0x28')](_0x4c1de8);});_0x27dd25['on']('src',function(_0x2e41f4){_0x359a53[_0xe4ba('0x5e')]=isNaN(_0x2e41f4[_0xe4ba('0x5f')])?null:_0x2e41f4['duration']*0x3e8;_0x359a53[_0xe4ba('0x60')]=isNaN(_0x2e41f4[_0xe4ba('0x61')])?null:_0x2e41f4[_0xe4ba('0x61')];_0x359a53[_0xe4ba('0x62')]=isNaN(_0x2e41f4['channelCount'])?null:_0x2e41f4[_0xe4ba('0x63')];_0x359a53['original_bitRate']=isNaN(_0x2e41f4[_0xe4ba('0x64')])?null:_0x2e41f4[_0xe4ba('0x64')];_0x359a53['original_sampleRate']=isNaN(_0x2e41f4[_0xe4ba('0x65')])?null:_0x2e41f4['sampleRate'];});_0x27dd25['on'](_0xe4ba('0x66'),function(_0x48e915){_0x359a53[_0xe4ba('0x67')]=isNaN(_0x48e915[_0xe4ba('0x5f')])?null:_0x48e915['duration']*0x3e8;_0x359a53[_0xe4ba('0x68')]=isNaN(_0x48e915['sampleCount'])?null:_0x48e915['sampleCount'];_0x359a53[_0xe4ba('0x69')]=isNaN(_0x48e915['channelCount'])?null:_0x48e915['channelCount'];_0x359a53[_0xe4ba('0x6a')]=isNaN(_0x48e915[_0xe4ba('0x64')])?null:_0x48e915['bitRate'];_0x359a53[_0xe4ba('0x6b')]=isNaN(_0x48e915[_0xe4ba('0x65')])?null:_0x48e915[_0xe4ba('0x65')];});_0x27dd25['on'](_0xe4ba('0x19'),function(){fs[_0xe4ba('0x5a')](_0x1fb047,parseInt(_0xe4ba('0x5b'),0x8));return db[_0xe4ba('0x2b')][_0xe4ba('0x4f')](_0x359a53)[_0xe4ba('0x22')](function(_0x17c739){var _0x5031af={'role':_0x88c862[_0xe4ba('0x6c')][_0xe4ba('0x6d')],'userProfileId':_0x88c862[_0xe4ba('0x6c')][_0xe4ba('0x6e')]};if(!_0x5031af)throw new Error(_0xe4ba('0x6f'));if(_0x5031af[_0xe4ba('0x6d')]==='user'){var _0x30e6a7=_0x17c739[_0xe4ba('0x70')]({'plain':!![]});return db[_0xe4ba('0x71')][_0xe4ba('0x44')]({'where':{'name':'Sounds','userProfileId':_0x5031af[_0xe4ba('0x6e')]},'raw':!![]})[_0xe4ba('0x22')](function(_0x445a48){if(_0x445a48&&_0x445a48[_0xe4ba('0x72')]===0x0){return db[_0xe4ba('0x73')]['create']({'name':_0x30e6a7['name'],'resourceId':_0x30e6a7['id'],'type':_0x445a48[_0xe4ba('0x27')],'sectionId':_0x445a48['id']},{})['then'](function(){return _0x17c739;});}else{return _0x17c739;}})[_0xe4ba('0x41')](function(_0xb5092b){logger[_0xe4ba('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xb5092b);throw _0xb5092b;});}return _0x17c739;})['then'](respondWithResult(_0x4d0c2b,null))[_0xe4ba('0x41')](handleError(_0x4d0c2b,null));});_0x27dd25[_0xe4ba('0x74')]();}catch(_0x364c48){_0x4d0c2b[_0xe4ba('0x18')](0x1f4)[_0xe4ba('0x28')](_0x364c48);}};exports[_0xe4ba('0x21')]=function(_0x281590,_0x3a2914,_0x76d6e2){return db[_0xe4ba('0x2b')][_0xe4ba('0x44')]({'where':{'id':_0x281590[_0xe4ba('0x43')]['id']}})[_0xe4ba('0x22')](handleEntityNotFound(_0x3a2914,null))[_0xe4ba('0x22')](saveUpdates(_['pick'](_0x281590[_0xe4ba('0x6c')],['name',_0xe4ba('0x75')]),null))[_0xe4ba('0x22')](respondWithResult(_0x3a2914,null))[_0xe4ba('0x41')](handleError(_0x3a2914,null));};exports[_0xe4ba('0x76')]=function(_0x1bc3c1,_0x194060,_0x341345){return db[_0xe4ba('0x2b')][_0xe4ba('0x44')]({'where':{'id':_0x1bc3c1[_0xe4ba('0x43')]['id']}})[_0xe4ba('0x22')](function(_0x3dc2a8){if(_0x3dc2a8){return _0x3dc2a8['destroy']();}})[_0xe4ba('0x22')](function(_0x4f06fb){var _0x54009c=path[_0xe4ba('0x4b')](config['root'],_0xe4ba('0x56'),util[_0xe4ba('0x4e')](_0xe4ba('0x4d'),_0x4f06fb['save_name'],_0x4f06fb['original_format']));var _0x1439a1=path[_0xe4ba('0x4b')](config[_0xe4ba('0x4c')],_0xe4ba('0x48'),util[_0xe4ba('0x4e')](_0xe4ba('0x4d'),_0x4f06fb[_0xe4ba('0x49')],_0x4f06fb[_0xe4ba('0x46')]));fs['unlinkSync'](_0x54009c);fs[_0xe4ba('0x5d')](_0x1439a1);return _0x4f06fb;})['then'](function(_0xc565f4){if(_0xc565f4){return _0x194060[_0xe4ba('0x18')](0xcc)['end']();}})[_0xe4ba('0x22')](handleEntityNotFound(_0x194060,null))[_0xe4ba('0x41')](handleError(_0x194060,null));}; \ No newline at end of file +var _0x25fb=['originalname','extname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','sampleRate','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','body','role','userProfileId','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','pick','original_format','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','Sounds','UserProfileResource','error','stack','name','status','send','index','map','Sound','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','where','merge','type','includeAll','include','findAll','catch','show','options','find','download','params','save_name','converted_format','join','root','server/files/sounds/converted','Sequelize','ValidationError','format','%s.%s','create','basename','file'];(function(_0x2d82a5,_0x14e1f6){var _0xe3b73a=function(_0x3b1196){while(--_0x3b1196){_0x2d82a5['push'](_0x2d82a5['shift']());}};_0xe3b73a(++_0x14e1f6);}(_0x25fb,0x97));var _0xb25f=function(_0x114e43,_0xf580b2){_0x114e43=_0x114e43-0x0;var _0x58b1fb=_0x25fb[_0x114e43];return _0x58b1fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb25f('0x0'));var zipdir=require(_0xb25f('0x1'));var jsonpatch=require(_0xb25f('0x2'));var rp=require(_0xb25f('0x3'));var moment=require(_0xb25f('0x4'));var BPromise=require(_0xb25f('0x5'));var Mustache=require(_0xb25f('0x6'));var util=require(_0xb25f('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb25f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb25f('0x9'));var squel=require(_0xb25f('0xa'));var crypto=require(_0xb25f('0xb'));var jsforce=require(_0xb25f('0xc'));var deskjs=require(_0xb25f('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb25f('0xe'));var Papa=require(_0xb25f('0xf'));var Redis=require(_0xb25f('0x10'));var authService=require(_0xb25f('0x11'));var qs=require(_0xb25f('0x12'));var as=require(_0xb25f('0x13'));var hardwareService=require(_0xb25f('0x14'));var logger=require(_0xb25f('0x15'))('api');var utils=require(_0xb25f('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x26dbaa,_0x4d389d){_0x4d389d=_0x4d389d||0xcc;return function(_0x5ee511){if(_0x5ee511){return _0x26dbaa[_0xb25f('0x17')](_0x4d389d);}return _0x26dbaa['status'](_0x4d389d)[_0xb25f('0x18')]();};}function respondWithResult(_0x9275b,_0x477752){_0x477752=_0x477752||0xc8;return function(_0x2dd921){if(_0x2dd921){return _0x9275b['status'](_0x477752)[_0xb25f('0x19')](_0x2dd921);}};}function respondWithFilteredResult(_0x2f1b94,_0x3e2bb7){return function(_0x4862a6){if(_0x4862a6){var _0x4e5d72=typeof _0x3e2bb7[_0xb25f('0x1a')]===_0xb25f('0x1b')&&typeof _0x3e2bb7[_0xb25f('0x1c')]===_0xb25f('0x1b');var _0x29f277=_0x4862a6[_0xb25f('0x1d')];var _0x4c2916=_0x4e5d72?0x0:_0x3e2bb7['offset'];var _0x272d84=_0x4e5d72?_0x4862a6[_0xb25f('0x1d')]:_0x3e2bb7[_0xb25f('0x1a')]+_0x3e2bb7[_0xb25f('0x1c')];var _0x2839ca;if(_0x272d84>=_0x29f277){_0x272d84=_0x29f277;_0x2839ca=0xc8;}else{_0x2839ca=0xce;}_0x2f1b94['status'](_0x2839ca);return _0x2f1b94[_0xb25f('0x1e')]('Content-Range',_0x4c2916+'-'+_0x272d84+'/'+_0x29f277)['json'](_0x4862a6);}return null;};}function patchUpdates(_0x548668){return function(_0x5e457a){try{jsonpatch['apply'](_0x5e457a,_0x548668,!![]);}catch(_0x476e6f){return BPromise[_0xb25f('0x1f')](_0x476e6f);}return _0x5e457a['save']();};}function saveUpdates(_0x4a945d,_0x23b534){return function(_0x45b59c){if(_0x45b59c){return _0x45b59c[_0xb25f('0x20')](_0x4a945d)[_0xb25f('0x21')](function(_0x1b1529){return _0x1b1529;});}return null;};}function removeEntity(_0x4f9c25,_0x4c9319){return function(_0xf9ba1d){if(_0xf9ba1d){return _0xf9ba1d[_0xb25f('0x22')]()[_0xb25f('0x21')](function(){var _0x26369f=_0xf9ba1d[_0xb25f('0x23')]({'plain':!![]});var _0xcc2abd=_0xb25f('0x24');return db[_0xb25f('0x25')][_0xb25f('0x22')]({'where':{'type':_0xcc2abd,'resourceId':_0x26369f['id']}})[_0xb25f('0x21')](function(){return _0xf9ba1d;});})['then'](function(){_0x4f9c25['status'](0xcc)[_0xb25f('0x18')]();});}};}function handleEntityNotFound(_0x389bd3,_0x2507bb){return function(_0x43edc5){if(!_0x43edc5){_0x389bd3[_0xb25f('0x17')](0x194);}return _0x43edc5;};}function handleError(_0xc07bc8,_0x454b40){_0x454b40=_0x454b40||0x1f4;return function(_0x3e8b2d){logger[_0xb25f('0x26')](_0x3e8b2d[_0xb25f('0x27')]);if(_0x3e8b2d[_0xb25f('0x28')]){delete _0x3e8b2d[_0xb25f('0x28')];}_0xc07bc8[_0xb25f('0x29')](_0x454b40)[_0xb25f('0x2a')](_0x3e8b2d);};}exports[_0xb25f('0x2b')]=function(_0x436be0,_0x5325a8){var _0x48ee59={},_0x698de1={},_0x582772={'count':0x0,'rows':[]};var _0x557886=_[_0xb25f('0x2c')](db[_0xb25f('0x2d')][_0xb25f('0x2e')],function(_0x253b25){return{'name':_0x253b25[_0xb25f('0x2f')],'type':_0x253b25['type'][_0xb25f('0x30')]};});_0x698de1[_0xb25f('0x31')]=_[_0xb25f('0x2c')](_0x557886,_0xb25f('0x28'));_0x698de1[_0xb25f('0x32')]=_[_0xb25f('0x33')](_0x436be0[_0xb25f('0x32')]);_0x698de1['filters']=_[_0xb25f('0x34')](_0x698de1[_0xb25f('0x31')],_0x698de1[_0xb25f('0x32')]);_0x48ee59[_0xb25f('0x35')]=_[_0xb25f('0x34')](_0x698de1[_0xb25f('0x31')],qs[_0xb25f('0x36')](_0x436be0['query'][_0xb25f('0x36')]));_0x48ee59['attributes']=_0x48ee59['attributes'][_0xb25f('0x37')]?_0x48ee59[_0xb25f('0x35')]:_0x698de1[_0xb25f('0x31')];if(!_0x436be0[_0xb25f('0x32')][_0xb25f('0x38')]('nolimit')){_0x48ee59[_0xb25f('0x1c')]=qs[_0xb25f('0x1c')](_0x436be0['query'][_0xb25f('0x1c')]);_0x48ee59['offset']=qs[_0xb25f('0x1a')](_0x436be0[_0xb25f('0x32')]['offset']);}_0x48ee59[_0xb25f('0x39')]=qs[_0xb25f('0x3a')](_0x436be0[_0xb25f('0x32')]['sort']);_0x48ee59['where']=qs[_0xb25f('0x3b')](_['pick'](_0x436be0[_0xb25f('0x32')],_0x698de1[_0xb25f('0x3b')]),_0x557886);if(_0x436be0[_0xb25f('0x32')][_0xb25f('0x3c')]){_0x48ee59[_0xb25f('0x3d')]=_[_0xb25f('0x3e')](_0x48ee59[_0xb25f('0x3d')],{'$or':_['map'](_0x557886,function(_0x34ce67){if(_0x34ce67[_0xb25f('0x3f')]!=='VIRTUAL'){var _0x213dc6={};_0x213dc6[_0x34ce67[_0xb25f('0x28')]]={'$like':'%'+_0x436be0[_0xb25f('0x32')]['filter']+'%'};return _0x213dc6;}})});}_0x48ee59=_[_0xb25f('0x3e')]({},_0x48ee59,_0x436be0['options']);var _0x332ae1={'where':_0x48ee59[_0xb25f('0x3d')]};return db[_0xb25f('0x2d')]['count'](_0x332ae1)[_0xb25f('0x21')](function(_0x5d8174){_0x582772[_0xb25f('0x1d')]=_0x5d8174;if(_0x436be0[_0xb25f('0x32')][_0xb25f('0x40')]){_0x48ee59[_0xb25f('0x41')]=[{'all':!![]}];}return db['Sound'][_0xb25f('0x42')](_0x48ee59);})['then'](function(_0x3c9e52){_0x582772['rows']=_0x3c9e52;return _0x582772;})['then'](respondWithFilteredResult(_0x5325a8,_0x48ee59))[_0xb25f('0x43')](handleError(_0x5325a8,null));};exports[_0xb25f('0x44')]=function(_0x29053d,_0x31502d){var _0x37bc19={'raw':!![],'where':{'id':_0x29053d['params']['id']}},_0x3ea6b9={};_0x3ea6b9[_0xb25f('0x31')]=_['keys'](db[_0xb25f('0x2d')]['rawAttributes']);_0x3ea6b9[_0xb25f('0x32')]=_[_0xb25f('0x33')](_0x29053d['query']);_0x3ea6b9[_0xb25f('0x3b')]=_[_0xb25f('0x34')](_0x3ea6b9[_0xb25f('0x31')],_0x3ea6b9['query']);_0x37bc19[_0xb25f('0x35')]=_[_0xb25f('0x34')](_0x3ea6b9['model'],qs['fields'](_0x29053d[_0xb25f('0x32')]['fields']));_0x37bc19['attributes']=_0x37bc19[_0xb25f('0x35')][_0xb25f('0x37')]?_0x37bc19['attributes']:_0x3ea6b9[_0xb25f('0x31')];if(_0x29053d[_0xb25f('0x32')][_0xb25f('0x40')]){_0x37bc19[_0xb25f('0x41')]=[{'all':!![]}];}_0x37bc19=_[_0xb25f('0x3e')]({},_0x37bc19,_0x29053d[_0xb25f('0x45')]);return db[_0xb25f('0x2d')][_0xb25f('0x46')](_0x37bc19)[_0xb25f('0x21')](handleEntityNotFound(_0x31502d,null))['then'](respondWithResult(_0x31502d,null))[_0xb25f('0x43')](handleError(_0x31502d,null));};exports[_0xb25f('0x47')]=function(_0x1ab472,_0x4ba584,_0x36f9d2){return db[_0xb25f('0x2d')][_0xb25f('0x46')]({'where':{'id':_0x1ab472[_0xb25f('0x48')]['id']},'attributes':[_0xb25f('0x28'),_0xb25f('0x49'),_0xb25f('0x4a')],'raw':!![]})['then'](handleEntityNotFound(_0x4ba584,null))['then'](function(_0x54da02){if(_0x54da02){if(!fs['existsSync'](path[_0xb25f('0x4b')](config[_0xb25f('0x4c')],_0xb25f('0x4d'),_0x54da02[_0xb25f('0x49')]+'.'+_0x54da02['converted_format']))){throw new db[(_0xb25f('0x4e'))][(_0xb25f('0x4f'))]('Sound\x20not\x20found');}return _0x4ba584['download'](path['join'](config[_0xb25f('0x4c')],_0xb25f('0x4d'),util[_0xb25f('0x50')](_0xb25f('0x51'),_0x54da02[_0xb25f('0x49')],_0x54da02['converted_format'])),util[_0xb25f('0x50')](_0xb25f('0x51'),_0x54da02[_0xb25f('0x28')],_0x54da02[_0xb25f('0x4a')]));}return null;})['catch'](handleError(_0x4ba584,null));};exports[_0xb25f('0x52')]=function(_0x2d0a6c,_0x567e70,_0x3bc8f0){var _0x66138e={'name':path[_0xb25f('0x53')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x55')],path[_0xb25f('0x56')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x55')])),'save_name':path[_0xb25f('0x53')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x57')],path[_0xb25f('0x56')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x57')])),'original_format':path[_0xb25f('0x56')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x55')])[_0xb25f('0x58')](0x1),'converted_format':_0xb25f('0x59')};var _0x4b42d4=path[_0xb25f('0x4b')](config[_0xb25f('0x4c')],_0xb25f('0x5a'),_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x57')]);var _0x377432=path[_0xb25f('0x4b')](config[_0xb25f('0x4c')],_0xb25f('0x4d'),util[_0xb25f('0x50')]('%s.%s',path[_0xb25f('0x53')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x57')],path[_0xb25f('0x56')](_0x2d0a6c[_0xb25f('0x54')][_0xb25f('0x57')])),_0x66138e[_0xb25f('0x4a')]));logger[_0xb25f('0x5b')]('Sound\x20upload\x20filepath:\x20%s',_0x4b42d4);logger[_0xb25f('0x5b')](_0xb25f('0x5c'),_0x377432);try{fs['chmodSync'](_0x4b42d4,parseInt('0777',0x8));var _0x2497b6=sox[_0xb25f('0x5d')](_0x4b42d4,_0x377432,{'sampleRate':0x1f40,'format':_0xb25f('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2497b6['on'](_0xb25f('0x26'),function(_0x3d7f7b){fs['unlinkSync'](_0x4b42d4);_0x567e70[_0xb25f('0x29')](0x1f4)[_0xb25f('0x2a')](_0x3d7f7b);});_0x2497b6['on'](_0xb25f('0x5e'),function(_0x39f264){_0x66138e['original_duration']=isNaN(_0x39f264[_0xb25f('0x5f')])?null:_0x39f264[_0xb25f('0x5f')]*0x3e8;_0x66138e[_0xb25f('0x60')]=isNaN(_0x39f264['sampleCount'])?null:_0x39f264[_0xb25f('0x61')];_0x66138e[_0xb25f('0x62')]=isNaN(_0x39f264[_0xb25f('0x63')])?null:_0x39f264[_0xb25f('0x63')];_0x66138e['original_bitRate']=isNaN(_0x39f264['bitRate'])?null:_0x39f264['bitRate'];_0x66138e['original_sampleRate']=isNaN(_0x39f264[_0xb25f('0x64')])?null:_0x39f264[_0xb25f('0x64')];});_0x2497b6['on']('dest',function(_0x2c4799){_0x66138e[_0xb25f('0x65')]=isNaN(_0x2c4799['duration'])?null:_0x2c4799['duration']*0x3e8;_0x66138e[_0xb25f('0x66')]=isNaN(_0x2c4799[_0xb25f('0x61')])?null:_0x2c4799['sampleCount'];_0x66138e[_0xb25f('0x67')]=isNaN(_0x2c4799[_0xb25f('0x63')])?null:_0x2c4799[_0xb25f('0x63')];_0x66138e[_0xb25f('0x68')]=isNaN(_0x2c4799['bitRate'])?null:_0x2c4799['bitRate'];_0x66138e[_0xb25f('0x69')]=isNaN(_0x2c4799[_0xb25f('0x64')])?null:_0x2c4799[_0xb25f('0x64')];});_0x2497b6['on'](_0xb25f('0x18'),function(){fs['chmodSync'](_0x377432,parseInt(_0xb25f('0x6a'),0x8));return db[_0xb25f('0x2d')][_0xb25f('0x52')](_0x66138e)[_0xb25f('0x21')](function(_0x5e24d4){var _0x7b7999={'role':_0x2d0a6c[_0xb25f('0x6b')][_0xb25f('0x6c')],'userProfileId':_0x2d0a6c['body'][_0xb25f('0x6d')]};if(!_0x7b7999)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7b7999[_0xb25f('0x6c')]===_0xb25f('0x6e')){var _0x26e3e5=_0x5e24d4['get']({'plain':!![]});return db[_0xb25f('0x6f')][_0xb25f('0x46')]({'where':{'name':'Sounds','userProfileId':_0x7b7999['userProfileId']},'raw':!![]})[_0xb25f('0x21')](function(_0x5c7227){if(_0x5c7227&&_0x5c7227[_0xb25f('0x70')]===0x0){return db[_0xb25f('0x25')]['create']({'name':_0x26e3e5[_0xb25f('0x28')],'resourceId':_0x26e3e5['id'],'type':_0x5c7227[_0xb25f('0x28')],'sectionId':_0x5c7227['id']},{})['then'](function(){return _0x5e24d4;});}else{return _0x5e24d4;}})[_0xb25f('0x43')](function(_0x9e5454){logger[_0xb25f('0x26')](_0xb25f('0x71'),_0x9e5454);throw _0x9e5454;});}return _0x5e24d4;})[_0xb25f('0x21')](respondWithResult(_0x567e70,null))[_0xb25f('0x43')](handleError(_0x567e70,null));});_0x2497b6[_0xb25f('0x72')]();}catch(_0x2fd2bc){_0x567e70[_0xb25f('0x29')](0x1f4)[_0xb25f('0x2a')](_0x2fd2bc);}};exports[_0xb25f('0x20')]=function(_0x1415d3,_0x50e7a4,_0xa61615){return db[_0xb25f('0x2d')][_0xb25f('0x46')]({'where':{'id':_0x1415d3[_0xb25f('0x48')]['id']}})[_0xb25f('0x21')](handleEntityNotFound(_0x50e7a4,null))['then'](saveUpdates(_[_0xb25f('0x73')](_0x1415d3[_0xb25f('0x6b')],[_0xb25f('0x28'),'description']),null))['then'](respondWithResult(_0x50e7a4,null))['catch'](handleError(_0x50e7a4,null));};exports['delete']=function(_0x3c2138,_0x486796,_0x4ad653){return db[_0xb25f('0x2d')][_0xb25f('0x46')]({'where':{'id':_0x3c2138[_0xb25f('0x48')]['id']}})[_0xb25f('0x21')](function(_0x4d0c33){if(_0x4d0c33){return _0x4d0c33[_0xb25f('0x22')]();}})[_0xb25f('0x21')](function(_0x14021c){var _0x302b72=path['join'](config['root'],_0xb25f('0x5a'),util['format'](_0xb25f('0x51'),_0x14021c[_0xb25f('0x49')],_0x14021c[_0xb25f('0x74')]));var _0x274e3e=path[_0xb25f('0x4b')](config[_0xb25f('0x4c')],'server/files/sounds/converted',util[_0xb25f('0x50')](_0xb25f('0x51'),_0x14021c[_0xb25f('0x49')],_0x14021c[_0xb25f('0x4a')]));fs[_0xb25f('0x75')](_0x302b72);fs[_0xb25f('0x75')](_0x274e3e);return _0x14021c;})[_0xb25f('0x21')](function(_0x3165f4){if(_0x3165f4){return _0x486796[_0xb25f('0x29')](0xcc)[_0xb25f('0x18')]();}})['then'](handleEntityNotFound(_0x486796,null))[_0xb25f('0x43')](handleError(_0x486796,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 17fb31e..558038a 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 _0x8353=['path','../../config/environment','./sound.attributes','exports','define','tools_sounds','lodash','../../config/logger','api','moment','bluebird'];(function(_0x5aef12,_0x1edd9d){var _0x245089=function(_0x11dafd){while(--_0x11dafd){_0x5aef12['push'](_0x5aef12['shift']());}};_0x245089(++_0x1edd9d);}(_0x8353,0x103));var _0x3835=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x8353[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0x3835('0x0'));var util=require('util');var logger=require(_0x3835('0x1'))(_0x3835('0x2'));var moment=require(_0x3835('0x3'));var BPromise=require(_0x3835('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3835('0x5'));var rimraf=require('rimraf');var config=require(_0x3835('0x6'));var attributes=require(_0x3835('0x7'));module[_0x3835('0x8')]=function(_0x123bfe,_0x31032f){return _0x123bfe[_0x3835('0x9')]('Sound',attributes,{'tableName':_0x3835('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x484b=['moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','tools_sounds','lodash','util','../../config/logger','api'];(function(_0x100e36,_0x4da225){var _0x1df0c9=function(_0xe4b84f){while(--_0xe4b84f){_0x100e36['push'](_0x100e36['shift']());}};_0x1df0c9(++_0x4da225);}(_0x484b,0x75));var _0xb484=function(_0x11eded,_0xc83b52){_0x11eded=_0x11eded-0x0;var _0x19c6a3=_0x484b[_0x11eded];return _0x19c6a3;};'use strict';var _=require(_0xb484('0x0'));var util=require(_0xb484('0x1'));var logger=require(_0xb484('0x2'))(_0xb484('0x3'));var moment=require(_0xb484('0x4'));var BPromise=require(_0xb484('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb484('0x6'));var rimraf=require(_0xb484('0x7'));var config=require(_0xb484('0x8'));var attributes=require(_0xb484('0x9'));module['exports']=function(_0x385397,_0x5aeb32){return _0x385397['define']('Sound',attributes,{'tableName':_0xb484('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 5c43cb1..1b0989a 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 _0x63cb=['result','catch','ShowSound','find','raw','options','where','attributes','include','model','map','stringify','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x263bfb,_0x52bab0){var _0xd8c2d9=function(_0x407e36){while(--_0x407e36){_0x263bfb['push'](_0x263bfb['shift']());}};_0xd8c2d9(++_0x52bab0);}(_0x63cb,0xec));var _0xb63c=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0x63cb[_0x4a3898];return _0x25ceb0;};'use strict';var _=require(_0xb63c('0x0'));var util=require(_0xb63c('0x1'));var moment=require(_0xb63c('0x2'));var BPromise=require(_0xb63c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb63c('0x4'))['db'];var utils=require(_0xb63c('0x5'));var logger=require('../../config/logger')(_0xb63c('0x6'));var config=require(_0xb63c('0x7'));var jayson=require(_0xb63c('0x8'));var client=jayson[_0xb63c('0x9')][_0xb63c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4148c7,_0x5ee323,_0x95f430){return new BPromise(function(_0x28c864,_0x308e77){return client['request'](_0x4148c7,_0x95f430)[_0xb63c('0xb')](function(_0x1424af){logger[_0xb63c('0xc')](_0xb63c('0xd'),_0x5ee323,_0xb63c('0xe'));logger[_0xb63c('0xf')](_0xb63c('0x10'),_0x5ee323,_0xb63c('0xe'),JSON['stringify'](_0x1424af));if(_0x1424af[_0xb63c('0x11')]){if(_0x1424af[_0xb63c('0x11')][_0xb63c('0x12')]===0x1f4){logger[_0xb63c('0x11')](_0xb63c('0xd'),_0x5ee323,_0x1424af[_0xb63c('0x11')][_0xb63c('0x13')]);return _0x308e77(_0x1424af[_0xb63c('0x11')][_0xb63c('0x13')]);}logger[_0xb63c('0x11')](_0xb63c('0xd'),_0x5ee323,_0x1424af['error'][_0xb63c('0x13')]);return _0x28c864(_0x1424af['error'][_0xb63c('0x13')]);}else{logger['info'](_0xb63c('0xd'),_0x5ee323,_0xb63c('0xe'));_0x28c864(_0x1424af[_0xb63c('0x14')][_0xb63c('0x13')]);}})[_0xb63c('0x15')](function(_0x563c8b){logger[_0xb63c('0x11')]('Sound,\x20%s,\x20%s',_0x5ee323,_0x563c8b);_0x308e77(_0x563c8b);});});}exports[_0xb63c('0x16')]=function(_0x723664){var _0x1591cf=this;return new Promise(function(_0x2bab47,_0x43fe3a){return db['Sound'][_0xb63c('0x17')]({'raw':_0x723664['options']?_0x723664['options'][_0xb63c('0x18')]===undefined?!![]:![]:!![],'where':_0x723664[_0xb63c('0x19')]?_0x723664[_0xb63c('0x19')][_0xb63c('0x1a')]||null:null,'attributes':_0x723664['options']?_0x723664[_0xb63c('0x19')][_0xb63c('0x1b')]||null:null,'include':_0x723664['options']?_0x723664['options'][_0xb63c('0x1c')]?_['map'](_0x723664[_0xb63c('0x19')][_0xb63c('0x1c')],function(_0x44d758){return{'model':db[_0x44d758[_0xb63c('0x1d')]],'as':_0x44d758['as'],'attributes':_0x44d758['attributes'],'include':_0x44d758[_0xb63c('0x1c')]?_['map'](_0x44d758[_0xb63c('0x1c')],function(_0x108501){return{'model':db[_0x108501[_0xb63c('0x1d')]],'as':_0x108501['as'],'attributes':_0x108501[_0xb63c('0x1b')],'include':_0x108501[_0xb63c('0x1c')]?_[_0xb63c('0x1e')](_0x108501[_0xb63c('0x1c')],function(_0x2a2019){return{'model':db[_0x2a2019[_0xb63c('0x1d')]],'as':_0x2a2019['as'],'attributes':_0x2a2019[_0xb63c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xb63c('0xb')](function(_0x42aec5){logger[_0xb63c('0xc')](_0xb63c('0x16'),_0x723664);logger[_0xb63c('0xf')]('ShowSound',_0x723664,JSON[_0xb63c('0x1f')](_0x42aec5));_0x2bab47(_0x42aec5);})[_0xb63c('0x15')](function(_0x59d90c){logger[_0xb63c('0x11')](_0xb63c('0x16'),_0x59d90c[_0xb63c('0x13')],_0x723664);_0x43fe3a(_0x1591cf[_0xb63c('0x11')](0x1f4,_0x59d90c[_0xb63c('0x13')]));});});}; \ No newline at end of file +var _0xff97=['../../config/environment','jayson/promise','client','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','util','moment','bluebird','randomstring','../../config/utils','rpc'];(function(_0x8c6164,_0x1dc7db){var _0x1ca172=function(_0x1c8d48){while(--_0x1c8d48){_0x8c6164['push'](_0x8c6164['shift']());}};_0x1ca172(++_0x1dc7db);}(_0xff97,0x11a));var _0x7ff9=function(_0x1d67e4,_0x24ced0){_0x1d67e4=_0x1d67e4-0x0;var _0x1c2699=_0xff97[_0x1d67e4];return _0x1c2699;};'use strict';var _=require('lodash');var util=require(_0x7ff9('0x0'));var moment=require(_0x7ff9('0x1'));var BPromise=require(_0x7ff9('0x2'));var rs=require(_0x7ff9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7ff9('0x4'));var logger=require('../../config/logger')(_0x7ff9('0x5'));var config=require(_0x7ff9('0x6'));var jayson=require(_0x7ff9('0x7'));var client=jayson[_0x7ff9('0x8')][_0x7ff9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x908100,_0x28f920,_0x4b73e7){return new BPromise(function(_0xe3af02,_0x1c913b){return client[_0x7ff9('0xa')](_0x908100,_0x4b73e7)[_0x7ff9('0xb')](function(_0x5f0dbc){logger[_0x7ff9('0xc')](_0x7ff9('0xd'),_0x28f920,_0x7ff9('0xe'));logger[_0x7ff9('0xf')](_0x7ff9('0x10'),_0x28f920,_0x7ff9('0xe'),JSON[_0x7ff9('0x11')](_0x5f0dbc));if(_0x5f0dbc[_0x7ff9('0x12')]){if(_0x5f0dbc['error']['code']===0x1f4){logger['error'](_0x7ff9('0xd'),_0x28f920,_0x5f0dbc[_0x7ff9('0x12')][_0x7ff9('0x13')]);return _0x1c913b(_0x5f0dbc[_0x7ff9('0x12')]['message']);}logger[_0x7ff9('0x12')](_0x7ff9('0xd'),_0x28f920,_0x5f0dbc[_0x7ff9('0x12')][_0x7ff9('0x13')]);return _0xe3af02(_0x5f0dbc[_0x7ff9('0x12')][_0x7ff9('0x13')]);}else{logger[_0x7ff9('0xc')]('Sound,\x20%s,\x20%s',_0x28f920,'request\x20sent');_0xe3af02(_0x5f0dbc[_0x7ff9('0x14')][_0x7ff9('0x13')]);}})[_0x7ff9('0x15')](function(_0x13e62d){logger[_0x7ff9('0x12')](_0x7ff9('0xd'),_0x28f920,_0x13e62d);_0x1c913b(_0x13e62d);});});}exports[_0x7ff9('0x16')]=function(_0x212ef5){var _0x426d0a=this;return new Promise(function(_0x1cca0b,_0x2c3774){return db[_0x7ff9('0x17')][_0x7ff9('0x18')]({'raw':_0x212ef5[_0x7ff9('0x19')]?_0x212ef5[_0x7ff9('0x19')][_0x7ff9('0x1a')]===undefined?!![]:![]:!![],'where':_0x212ef5[_0x7ff9('0x19')]?_0x212ef5[_0x7ff9('0x19')][_0x7ff9('0x1b')]||null:null,'attributes':_0x212ef5['options']?_0x212ef5[_0x7ff9('0x19')][_0x7ff9('0x1c')]||null:null,'include':_0x212ef5['options']?_0x212ef5[_0x7ff9('0x19')][_0x7ff9('0x1d')]?_[_0x7ff9('0x1e')](_0x212ef5[_0x7ff9('0x19')][_0x7ff9('0x1d')],function(_0x2b7ec1){return{'model':db[_0x2b7ec1[_0x7ff9('0x1f')]],'as':_0x2b7ec1['as'],'attributes':_0x2b7ec1['attributes'],'include':_0x2b7ec1['include']?_['map'](_0x2b7ec1['include'],function(_0x252b81){return{'model':db[_0x252b81[_0x7ff9('0x1f')]],'as':_0x252b81['as'],'attributes':_0x252b81[_0x7ff9('0x1c')],'include':_0x252b81[_0x7ff9('0x1d')]?_[_0x7ff9('0x1e')](_0x252b81[_0x7ff9('0x1d')],function(_0x3b7802){return{'model':db[_0x3b7802[_0x7ff9('0x1f')]],'as':_0x3b7802['as'],'attributes':_0x3b7802['attributes']};}):[]};}):[]};}):[]:[]})[_0x7ff9('0xb')](function(_0x537155){logger[_0x7ff9('0xc')](_0x7ff9('0x16'),_0x212ef5);logger[_0x7ff9('0xf')]('ShowSound',_0x212ef5,JSON[_0x7ff9('0x11')](_0x537155));_0x1cca0b(_0x537155);})['catch'](function(_0x7825f4){logger[_0x7ff9('0x12')]('ShowSound',_0x7825f4['message'],_0x212ef5);_0x2c3774(_0x426d0a[_0x7ff9('0x12')](0x1f4,_0x7825f4[_0x7ff9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 9460ddf..9510c22 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 _0x4fc2=['show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./squareMessage.controller','isAuthenticated','index','/:id'];(function(_0x16af15,_0x55bc76){var _0xfeda8a=function(_0x13ad56){while(--_0x13ad56){_0x16af15['push'](_0x16af15['shift']());}};_0xfeda8a(++_0x55bc76);}(_0x4fc2,0x111));var _0x24fc=function(_0x39914e,_0x1ec745){_0x39914e=_0x39914e-0x0;var _0x56350b=_0x4fc2[_0x39914e];return _0x56350b;};'use strict';var multer=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var path=require(_0x24fc('0x2'));var timeout=require(_0x24fc('0x3'));var express=require('express');var router=express[_0x24fc('0x4')]();var fs_extra=require(_0x24fc('0x5'));var auth=require(_0x24fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x24fc('0x7'));var controller=require(_0x24fc('0x8'));router['get']('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xa')]);router['get'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xc')]);router[_0x24fc('0xd')]('/',auth[_0x24fc('0x9')](),controller[_0x24fc('0xe')]);router['put'](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0xf')]);router[_0x24fc('0x10')](_0x24fc('0xb'),auth[_0x24fc('0x9')](),controller[_0x24fc('0x11')]);module[_0x24fc('0x12')]=router; \ No newline at end of file +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(_0x5d7d1b,_0x444af8){var _0x437da8=function(_0x1e7786){while(--_0x1e7786){_0x5d7d1b['push'](_0x5d7d1b['shift']());}};_0x437da8(++_0x444af8);}(_0xb10b,0x12a));var _0xbb10=function(_0x50c7d6,_0x43aaed){_0x50c7d6=_0x50c7d6-0x0;var _0x4e1b11=_0xb10b[_0x50c7d6];return _0x4e1b11;};'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 0591da3..ef2c048 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 _0x425d=['exports','STRING','medium','out','TEXT','sequelize'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x425d,0x1bb));var _0xd425=function(_0x2fd897,_0x1b5305){_0x2fd897=_0x2fd897-0x0;var _0x1de92f=_0x425d[_0x2fd897];return _0x1de92f;};'use strict';var Sequelize=require(_0xd425('0x0'));module[_0xd425('0x1')]={'uniqueid':{'type':Sequelize[_0xd425('0x2')]},'body':{'type':Sequelize['TEXT'](_0xd425('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd425('0x4')),'defaultValue':_0xd425('0x4'),'allowNull':![]},'providerName':{'type':Sequelize[_0xd425('0x2')]},'providerResponse':{'type':Sequelize[_0xd425('0x5')]}}; \ No newline at end of file +var _0xce64=['STRING','medium','ENUM','out','TEXT','exports'];(function(_0x299ba0,_0x564b81){var _0x13eb0d=function(_0x26ed80){while(--_0x26ed80){_0x299ba0['push'](_0x299ba0['shift']());}};_0x13eb0d(++_0x564b81);}(_0xce64,0xb9));var _0x4ce6=function(_0x21b536,_0x430136){_0x21b536=_0x21b536-0x0;var _0x36f1cc=_0xce64[_0x21b536];return _0x36f1cc;};'use strict';var Sequelize=require('sequelize');module[_0x4ce6('0x0')]={'uniqueid':{'type':Sequelize[_0x4ce6('0x1')]},'body':{'type':Sequelize['TEXT'](_0x4ce6('0x2')),'allowNull':![]},'direction':{'type':Sequelize[_0x4ce6('0x3')]('in',_0x4ce6('0x4')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x4ce6('0x1')]},'providerResponse':{'type':Sequelize[_0x4ce6('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 5d6ba71..e1723ac 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 _0xca2c=['save','then','sendStatus','error','stack','name','send','map','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareMessage','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json'];(function(_0x1a9fc1,_0x18f66b){var _0x3c4ee8=function(_0x58f251){while(--_0x58f251){_0x1a9fc1['push'](_0x1a9fc1['shift']());}};_0x3c4ee8(++_0x18f66b);}(_0xca2c,0xfd));var _0xcca2=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0xca2c[_0xb0f7c3];return _0x28ea68;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcca2('0x0'));var zipdir=require(_0xcca2('0x1'));var jsonpatch=require(_0xcca2('0x2'));var rp=require('request-promise');var moment=require(_0xcca2('0x3'));var BPromise=require(_0xcca2('0x4'));var Mustache=require(_0xcca2('0x5'));var util=require(_0xcca2('0x6'));var path=require(_0xcca2('0x7'));var sox=require(_0xcca2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcca2('0x9'));var squel=require(_0xcca2('0xa'));var crypto=require(_0xcca2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcca2('0xc'));var toCsv=require(_0xcca2('0xd'));var querystring=require('querystring');var Papa=require(_0xcca2('0xe'));var Redis=require(_0xcca2('0xf'));var authService=require(_0xcca2('0x10'));var qs=require(_0xcca2('0x11'));var as=require(_0xcca2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcca2('0x13'));var licenseUtil=require(_0xcca2('0x14'));var db=require(_0xcca2('0x15'))['db'];function respondWithStatusCode(_0x227da4,_0x545c88){_0x545c88=_0x545c88||0xcc;return function(_0x3dc7ef){if(_0x3dc7ef){return _0x227da4['sendStatus'](_0x545c88);}return _0x227da4[_0xcca2('0x16')](_0x545c88)[_0xcca2('0x17')]();};}function respondWithResult(_0x5a94b2,_0x5be476){_0x5be476=_0x5be476||0xc8;return function(_0x5bf871){if(_0x5bf871){return _0x5a94b2[_0xcca2('0x16')](_0x5be476)['json'](_0x5bf871);}};}function respondWithFilteredResult(_0x2a7f9b,_0x1356da){return function(_0x23f6c8){if(_0x23f6c8){var _0x136237=typeof _0x1356da['offset']===_0xcca2('0x18')&&typeof _0x1356da[_0xcca2('0x19')]===_0xcca2('0x18');var _0x246f5c=_0x23f6c8['count'];var _0x2ed0af=_0x136237?0x0:_0x1356da[_0xcca2('0x1a')];var _0x8e18e1=_0x136237?_0x23f6c8[_0xcca2('0x1b')]:_0x1356da[_0xcca2('0x1a')]+_0x1356da[_0xcca2('0x19')];var _0x18d321;if(_0x8e18e1>=_0x246f5c){_0x8e18e1=_0x246f5c;_0x18d321=0xc8;}else{_0x18d321=0xce;}_0x2a7f9b[_0xcca2('0x16')](_0x18d321);return _0x2a7f9b[_0xcca2('0x1c')](_0xcca2('0x1d'),_0x2ed0af+'-'+_0x8e18e1+'/'+_0x246f5c)[_0xcca2('0x1e')](_0x23f6c8);}return null;};}function patchUpdates(_0x109d8d){return function(_0x125f9c){try{jsonpatch['apply'](_0x125f9c,_0x109d8d,!![]);}catch(_0x13c8ba){return BPromise['reject'](_0x13c8ba);}return _0x125f9c[_0xcca2('0x1f')]();};}function saveUpdates(_0x1e666f,_0x536273){return function(_0x501e48){if(_0x501e48){return _0x501e48['update'](_0x1e666f)[_0xcca2('0x20')](function(_0x2ea5f4){return _0x2ea5f4;});}return null;};}function removeEntity(_0x351899,_0x5ca2e9){return function(_0x40ee7e){if(_0x40ee7e){return _0x40ee7e['destroy']()[_0xcca2('0x20')](function(){_0x351899['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x677211,_0x24ae4a){return function(_0x2a2839){if(!_0x2a2839){_0x677211[_0xcca2('0x21')](0x194);}return _0x2a2839;};}function handleError(_0x4678e0,_0x19451b){_0x19451b=_0x19451b||0x1f4;return function(_0x2c918e){logger[_0xcca2('0x22')](_0x2c918e[_0xcca2('0x23')]);if(_0x2c918e['name']){delete _0x2c918e[_0xcca2('0x24')];}_0x4678e0[_0xcca2('0x16')](_0x19451b)[_0xcca2('0x25')](_0x2c918e);};}exports['index']=function(_0x4c5972,_0x2801d2){var _0x510c32={},_0x40a0e6={},_0xa84342={'count':0x0,'rows':[]};var _0x41e2b4=_[_0xcca2('0x26')](db['SquareMessage']['rawAttributes'],function(_0x4882ba){return{'name':_0x4882ba[_0xcca2('0x27')],'type':_0x4882ba['type'][_0xcca2('0x28')]};});_0x40a0e6[_0xcca2('0x29')]=_[_0xcca2('0x26')](_0x41e2b4,_0xcca2('0x24'));_0x40a0e6[_0xcca2('0x2a')]=_[_0xcca2('0x2b')](_0x4c5972[_0xcca2('0x2a')]);_0x40a0e6[_0xcca2('0x2c')]=_[_0xcca2('0x2d')](_0x40a0e6[_0xcca2('0x29')],_0x40a0e6['query']);_0x510c32['attributes']=_['intersection'](_0x40a0e6['model'],qs[_0xcca2('0x2e')](_0x4c5972['query']['fields']));_0x510c32[_0xcca2('0x2f')]=_0x510c32['attributes']['length']?_0x510c32[_0xcca2('0x2f')]:_0x40a0e6['model'];if(!_0x4c5972['query']['hasOwnProperty'](_0xcca2('0x30'))){_0x510c32[_0xcca2('0x19')]=qs[_0xcca2('0x19')](_0x4c5972['query']['limit']);_0x510c32[_0xcca2('0x1a')]=qs[_0xcca2('0x1a')](_0x4c5972[_0xcca2('0x2a')]['offset']);}_0x510c32['order']=qs[_0xcca2('0x31')](_0x4c5972[_0xcca2('0x2a')][_0xcca2('0x31')]);_0x510c32[_0xcca2('0x32')]=qs[_0xcca2('0x2c')](_[_0xcca2('0x33')](_0x4c5972[_0xcca2('0x2a')],_0x40a0e6[_0xcca2('0x2c')]),_0x41e2b4);if(_0x4c5972[_0xcca2('0x2a')][_0xcca2('0x34')]){_0x510c32[_0xcca2('0x32')]=_[_0xcca2('0x35')](_0x510c32[_0xcca2('0x32')],{'$or':_[_0xcca2('0x26')](_0x41e2b4,function(_0x14bf3c){if(_0x14bf3c[_0xcca2('0x36')]!==_0xcca2('0x37')){var _0xaf2ce4={};_0xaf2ce4[_0x14bf3c[_0xcca2('0x24')]]={'$like':'%'+_0x4c5972[_0xcca2('0x2a')][_0xcca2('0x34')]+'%'};return _0xaf2ce4;}})});}_0x510c32=_['merge']({},_0x510c32,_0x4c5972[_0xcca2('0x38')]);var _0x158be4={'where':_0x510c32[_0xcca2('0x32')]};return db[_0xcca2('0x39')][_0xcca2('0x1b')](_0x158be4)[_0xcca2('0x20')](function(_0x536c19){_0xa84342[_0xcca2('0x1b')]=_0x536c19;if(_0x4c5972['query'][_0xcca2('0x3a')]){_0x510c32[_0xcca2('0x3b')]=[{'all':!![]}];}return db[_0xcca2('0x39')][_0xcca2('0x3c')](_0x510c32);})[_0xcca2('0x20')](function(_0x43ee7b){_0xa84342[_0xcca2('0x3d')]=_0x43ee7b;return _0xa84342;})['then'](respondWithFilteredResult(_0x2801d2,_0x510c32))[_0xcca2('0x3e')](handleError(_0x2801d2,null));};exports[_0xcca2('0x3f')]=function(_0x3f578c,_0x406129){var _0x519e66={'raw':!![],'where':{'id':_0x3f578c['params']['id']}},_0x19f69a={};_0x19f69a[_0xcca2('0x29')]=_['keys'](db['SquareMessage'][_0xcca2('0x40')]);_0x19f69a[_0xcca2('0x2a')]=_[_0xcca2('0x2b')](_0x3f578c[_0xcca2('0x2a')]);_0x19f69a[_0xcca2('0x2c')]=_[_0xcca2('0x2d')](_0x19f69a[_0xcca2('0x29')],_0x19f69a[_0xcca2('0x2a')]);_0x519e66[_0xcca2('0x2f')]=_[_0xcca2('0x2d')](_0x19f69a['model'],qs[_0xcca2('0x2e')](_0x3f578c[_0xcca2('0x2a')][_0xcca2('0x2e')]));_0x519e66[_0xcca2('0x2f')]=_0x519e66[_0xcca2('0x2f')][_0xcca2('0x41')]?_0x519e66[_0xcca2('0x2f')]:_0x19f69a[_0xcca2('0x29')];if(_0x3f578c['query'][_0xcca2('0x3a')]){_0x519e66[_0xcca2('0x3b')]=[{'all':!![]}];}_0x519e66=_[_0xcca2('0x35')]({},_0x519e66,_0x3f578c['options']);return db[_0xcca2('0x39')][_0xcca2('0x42')](_0x519e66)['then'](handleEntityNotFound(_0x406129,null))[_0xcca2('0x20')](respondWithResult(_0x406129,null))[_0xcca2('0x3e')](handleError(_0x406129,null));};exports['create']=function(_0x338174,_0x1f71ba){return db[_0xcca2('0x39')][_0xcca2('0x43')](_0x338174[_0xcca2('0x44')],{})[_0xcca2('0x20')](respondWithResult(_0x1f71ba,0xc9))['catch'](handleError(_0x1f71ba,null));};exports[_0xcca2('0x45')]=function(_0x1a77df,_0x5538f9){if(_0x1a77df[_0xcca2('0x44')]['id']){delete _0x1a77df['body']['id'];}return db[_0xcca2('0x39')][_0xcca2('0x42')]({'where':{'id':_0x1a77df[_0xcca2('0x46')]['id']}})[_0xcca2('0x20')](handleEntityNotFound(_0x5538f9,null))['then'](saveUpdates(_0x1a77df[_0xcca2('0x44')],null))[_0xcca2('0x20')](respondWithResult(_0x5538f9,null))[_0xcca2('0x3e')](handleError(_0x5538f9,null));};exports['destroy']=function(_0x24a619,_0x560ff5){return db[_0xcca2('0x39')]['find']({'where':{'id':_0x24a619[_0xcca2('0x46')]['id']}})[_0xcca2('0x20')](handleEntityNotFound(_0x560ff5,null))[_0xcca2('0x20')](removeEntity(_0x560ff5,null))['catch'](handleError(_0x560ff5,null));}; \ No newline at end of file +var _0xda04=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','offset','count','apply','reject','save','then','destroy','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','update','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xda04,0x1be));var _0x4da0=function(_0x25acfe,_0x3797bc){_0x25acfe=_0x25acfe-0x0;var _0x547928=_0xda04[_0x25acfe];return _0x547928;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4da0('0x0'));var jsonpatch=require(_0x4da0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4da0('0x2'));var Mustache=require(_0x4da0('0x3'));var util=require(_0x4da0('0x4'));var path=require(_0x4da0('0x5'));var sox=require(_0x4da0('0x6'));var csv=require(_0x4da0('0x7'));var ejs=require(_0x4da0('0x8'));var fs=require('fs');var fs_extra=require(_0x4da0('0x9'));var _=require(_0x4da0('0xa'));var squel=require(_0x4da0('0xb'));var crypto=require(_0x4da0('0xc'));var jsforce=require(_0x4da0('0xd'));var deskjs=require(_0x4da0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x4da0('0xf'));var Papa=require(_0x4da0('0x10'));var Redis=require(_0x4da0('0x11'));var authService=require(_0x4da0('0x12'));var qs=require(_0x4da0('0x13'));var as=require(_0x4da0('0x14'));var hardwareService=require(_0x4da0('0x15'));var logger=require(_0x4da0('0x16'))('api');var utils=require(_0x4da0('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4da0('0x18'));var db=require(_0x4da0('0x19'))['db'];function respondWithStatusCode(_0xaf0ea3,_0x1d9c02){_0x1d9c02=_0x1d9c02||0xcc;return function(_0x3e4489){if(_0x3e4489){return _0xaf0ea3[_0x4da0('0x1a')](_0x1d9c02);}return _0xaf0ea3[_0x4da0('0x1b')](_0x1d9c02)[_0x4da0('0x1c')]();};}function respondWithResult(_0x54649b,_0x34b61e){_0x34b61e=_0x34b61e||0xc8;return function(_0x2f007e){if(_0x2f007e){return _0x54649b[_0x4da0('0x1b')](_0x34b61e)['json'](_0x2f007e);}};}function respondWithFilteredResult(_0x112190,_0x4b9d75){return function(_0x4ca390){if(_0x4ca390){var _0xc0e827=typeof _0x4b9d75['offset']===_0x4da0('0x1d')&&typeof _0x4b9d75[_0x4da0('0x1e')]===_0x4da0('0x1d');var _0x19bb53=_0x4ca390['count'];var _0x26853a=_0xc0e827?0x0:_0x4b9d75[_0x4da0('0x1f')];var _0x5a5ed7=_0xc0e827?_0x4ca390[_0x4da0('0x20')]:_0x4b9d75[_0x4da0('0x1f')]+_0x4b9d75[_0x4da0('0x1e')];var _0x341c58;if(_0x5a5ed7>=_0x19bb53){_0x5a5ed7=_0x19bb53;_0x341c58=0xc8;}else{_0x341c58=0xce;}_0x112190[_0x4da0('0x1b')](_0x341c58);return _0x112190['set']('Content-Range',_0x26853a+'-'+_0x5a5ed7+'/'+_0x19bb53)['json'](_0x4ca390);}return null;};}function patchUpdates(_0x533f80){return function(_0x18a4fc){try{jsonpatch[_0x4da0('0x21')](_0x18a4fc,_0x533f80,!![]);}catch(_0x3c7734){return BPromise[_0x4da0('0x22')](_0x3c7734);}return _0x18a4fc[_0x4da0('0x23')]();};}function saveUpdates(_0x14f352,_0x38d07d){return function(_0x178492){if(_0x178492){return _0x178492['update'](_0x14f352)[_0x4da0('0x24')](function(_0x5f4ccd){return _0x5f4ccd;});}return null;};}function removeEntity(_0x2a9150,_0x4b2eae){return function(_0x1eff05){if(_0x1eff05){return _0x1eff05[_0x4da0('0x25')]()[_0x4da0('0x24')](function(){_0x2a9150[_0x4da0('0x1b')](0xcc)[_0x4da0('0x1c')]();});}};}function handleEntityNotFound(_0x5200eb,_0x4dbfd4){return function(_0x113f91){if(!_0x113f91){_0x5200eb['sendStatus'](0x194);}return _0x113f91;};}function handleError(_0x3c550f,_0x3cf2d1){_0x3cf2d1=_0x3cf2d1||0x1f4;return function(_0x5238b7){logger[_0x4da0('0x26')](_0x5238b7[_0x4da0('0x27')]);if(_0x5238b7[_0x4da0('0x28')]){delete _0x5238b7[_0x4da0('0x28')];}_0x3c550f[_0x4da0('0x1b')](_0x3cf2d1)[_0x4da0('0x29')](_0x5238b7);};}exports[_0x4da0('0x2a')]=function(_0x28d2f5,_0x2eb88c){var _0x2803d4={},_0x5f18={},_0x5443a1={'count':0x0,'rows':[]};var _0x27f44a=_[_0x4da0('0x2b')](db[_0x4da0('0x2c')][_0x4da0('0x2d')],function(_0x3df826){return{'name':_0x3df826[_0x4da0('0x2e')],'type':_0x3df826[_0x4da0('0x2f')][_0x4da0('0x30')]};});_0x5f18[_0x4da0('0x31')]=_[_0x4da0('0x2b')](_0x27f44a,_0x4da0('0x28'));_0x5f18[_0x4da0('0x32')]=_['keys'](_0x28d2f5['query']);_0x5f18[_0x4da0('0x33')]=_[_0x4da0('0x34')](_0x5f18[_0x4da0('0x31')],_0x5f18[_0x4da0('0x32')]);_0x2803d4[_0x4da0('0x35')]=_[_0x4da0('0x34')](_0x5f18[_0x4da0('0x31')],qs['fields'](_0x28d2f5[_0x4da0('0x32')][_0x4da0('0x36')]));_0x2803d4[_0x4da0('0x35')]=_0x2803d4[_0x4da0('0x35')][_0x4da0('0x37')]?_0x2803d4['attributes']:_0x5f18[_0x4da0('0x31')];if(!_0x28d2f5['query'][_0x4da0('0x38')]('nolimit')){_0x2803d4[_0x4da0('0x1e')]=qs[_0x4da0('0x1e')](_0x28d2f5[_0x4da0('0x32')]['limit']);_0x2803d4[_0x4da0('0x1f')]=qs[_0x4da0('0x1f')](_0x28d2f5[_0x4da0('0x32')][_0x4da0('0x1f')]);}_0x2803d4[_0x4da0('0x39')]=qs['sort'](_0x28d2f5[_0x4da0('0x32')][_0x4da0('0x3a')]);_0x2803d4[_0x4da0('0x3b')]=qs[_0x4da0('0x33')](_[_0x4da0('0x3c')](_0x28d2f5['query'],_0x5f18[_0x4da0('0x33')]),_0x27f44a);if(_0x28d2f5[_0x4da0('0x32')][_0x4da0('0x3d')]){_0x2803d4[_0x4da0('0x3b')]=_[_0x4da0('0x3e')](_0x2803d4[_0x4da0('0x3b')],{'$or':_[_0x4da0('0x2b')](_0x27f44a,function(_0x1357b8){if(_0x1357b8['type']!==_0x4da0('0x3f')){var _0x2cf45f={};_0x2cf45f[_0x1357b8['name']]={'$like':'%'+_0x28d2f5[_0x4da0('0x32')][_0x4da0('0x3d')]+'%'};return _0x2cf45f;}})});}_0x2803d4=_[_0x4da0('0x3e')]({},_0x2803d4,_0x28d2f5['options']);var _0x454ebe={'where':_0x2803d4[_0x4da0('0x3b')]};return db[_0x4da0('0x2c')][_0x4da0('0x20')](_0x454ebe)[_0x4da0('0x24')](function(_0x256f15){_0x5443a1[_0x4da0('0x20')]=_0x256f15;if(_0x28d2f5['query'][_0x4da0('0x40')]){_0x2803d4[_0x4da0('0x41')]=[{'all':!![]}];}return db[_0x4da0('0x2c')][_0x4da0('0x42')](_0x2803d4);})['then'](function(_0xf983c){_0x5443a1[_0x4da0('0x43')]=_0xf983c;return _0x5443a1;})[_0x4da0('0x24')](respondWithFilteredResult(_0x2eb88c,_0x2803d4))[_0x4da0('0x44')](handleError(_0x2eb88c,null));};exports[_0x4da0('0x45')]=function(_0x3f9d2a,_0x1138b4){var _0x563284={'raw':!![],'where':{'id':_0x3f9d2a[_0x4da0('0x46')]['id']}},_0xa4c428={};_0xa4c428[_0x4da0('0x31')]=_[_0x4da0('0x47')](db[_0x4da0('0x2c')][_0x4da0('0x2d')]);_0xa4c428[_0x4da0('0x32')]=_['keys'](_0x3f9d2a[_0x4da0('0x32')]);_0xa4c428[_0x4da0('0x33')]=_[_0x4da0('0x34')](_0xa4c428[_0x4da0('0x31')],_0xa4c428[_0x4da0('0x32')]);_0x563284[_0x4da0('0x35')]=_[_0x4da0('0x34')](_0xa4c428['model'],qs[_0x4da0('0x36')](_0x3f9d2a[_0x4da0('0x32')][_0x4da0('0x36')]));_0x563284[_0x4da0('0x35')]=_0x563284['attributes'][_0x4da0('0x37')]?_0x563284[_0x4da0('0x35')]:_0xa4c428[_0x4da0('0x31')];if(_0x3f9d2a[_0x4da0('0x32')][_0x4da0('0x40')]){_0x563284[_0x4da0('0x41')]=[{'all':!![]}];}_0x563284=_['merge']({},_0x563284,_0x3f9d2a[_0x4da0('0x48')]);return db[_0x4da0('0x2c')][_0x4da0('0x49')](_0x563284)[_0x4da0('0x24')](handleEntityNotFound(_0x1138b4,null))[_0x4da0('0x24')](respondWithResult(_0x1138b4,null))['catch'](handleError(_0x1138b4,null));};exports[_0x4da0('0x4a')]=function(_0x1a3e65,_0x91b464){return db['SquareMessage'][_0x4da0('0x4a')](_0x1a3e65[_0x4da0('0x4b')],{})[_0x4da0('0x24')](respondWithResult(_0x91b464,0xc9))[_0x4da0('0x44')](handleError(_0x91b464,null));};exports[_0x4da0('0x4c')]=function(_0xe9dd7c,_0x5f0b96){if(_0xe9dd7c['body']['id']){delete _0xe9dd7c[_0x4da0('0x4b')]['id'];}return db['SquareMessage'][_0x4da0('0x49')]({'where':{'id':_0xe9dd7c['params']['id']}})[_0x4da0('0x24')](handleEntityNotFound(_0x5f0b96,null))[_0x4da0('0x24')](saveUpdates(_0xe9dd7c[_0x4da0('0x4b')],null))[_0x4da0('0x24')](respondWithResult(_0x5f0b96,null))['catch'](handleError(_0x5f0b96,null));};exports['destroy']=function(_0x385c8f,_0x2451e1){return db['SquareMessage'][_0x4da0('0x49')]({'where':{'id':_0x385c8f[_0x4da0('0x46')]['id']}})[_0x4da0('0x24')](handleEntityNotFound(_0x2451e1,null))['then'](removeEntity(_0x2451e1,null))[_0x4da0('0x44')](handleError(_0x2451e1,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d63d2c5..e76d967 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 _0xd7c4=['path','rimraf','../../config/environment','define','SquareMessage','square_messages','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x30664f,_0x39b0f6){var _0x5ae3ff=function(_0x4ab96e){while(--_0x4ab96e){_0x30664f['push'](_0x30664f['shift']());}};_0x5ae3ff(++_0x39b0f6);}(_0xd7c4,0x132));var _0x4d7c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd7c4[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x4d7c('0x0'));var util=require(_0x4d7c('0x1'));var logger=require(_0x4d7c('0x2'))(_0x4d7c('0x3'));var moment=require('moment');var BPromise=require(_0x4d7c('0x4'));var rp=require(_0x4d7c('0x5'));var fs=require('fs');var path=require(_0x4d7c('0x6'));var rimraf=require(_0x4d7c('0x7'));var config=require(_0x4d7c('0x8'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x1e7d2c,_0x98ca2f){return _0x1e7d2c[_0x4d7c('0x9')](_0x4d7c('0xa'),attributes,{'tableName':_0x4d7c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x007e=['../../config/environment','./squareMessage.attributes','exports','define','square_messages','lodash','moment','bluebird','request-promise','rimraf'];(function(_0x4d6d5d,_0x16f947){var _0x138668=function(_0xc2b7ba){while(--_0xc2b7ba){_0x4d6d5d['push'](_0x4d6d5d['shift']());}};_0x138668(++_0x16f947);}(_0x007e,0x1bd));var _0xe007=function(_0x4b633d,_0x5b0be7){_0x4b633d=_0x4b633d-0x0;var _0x532534=_0x007e[_0x4b633d];return _0x532534;};'use strict';var _=require(_0xe007('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe007('0x1'));var BPromise=require(_0xe007('0x2'));var rp=require(_0xe007('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe007('0x4'));var config=require(_0xe007('0x5'));var attributes=require(_0xe007('0x6'));module[_0xe007('0x7')]=function(_0x1faec8,_0xeff2da){return _0x1faec8[_0xe007('0x8')]('SquareMessage',attributes,{'tableName':_0xe007('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index a0898f1..9cfc6d1 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 _0x258e=['info','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SquareMessage,\x20%s,\x20%s','result','catch','CreateSquareMessage','body','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x258e,0xc3));var _0xe258=function(_0x471888,_0x60dad5){_0x471888=_0x471888-0x0;var _0x220b5a=_0x258e[_0x471888];return _0x220b5a;};'use strict';var _=require(_0xe258('0x0'));var util=require(_0xe258('0x1'));var moment=require(_0xe258('0x2'));var BPromise=require(_0xe258('0x3'));var rs=require(_0xe258('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe258('0x5'));var logger=require(_0xe258('0x6'))('rpc');var config=require(_0xe258('0x7'));var jayson=require(_0xe258('0x8'));var client=jayson[_0xe258('0x9')][_0xe258('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf62011,_0x16eafb,_0xb5995){return new BPromise(function(_0x262a1e,_0x20eb97){return client[_0xe258('0xb')](_0xf62011,_0xb5995)[_0xe258('0xc')](function(_0x3cbd14){logger[_0xe258('0xd')]('SquareMessage,\x20%s,\x20%s',_0x16eafb,'request\x20sent');logger[_0xe258('0xe')](_0xe258('0xf'),_0x16eafb,_0xe258('0x10'),JSON[_0xe258('0x11')](_0x3cbd14));if(_0x3cbd14['error']){if(_0x3cbd14[_0xe258('0x12')][_0xe258('0x13')]===0x1f4){logger[_0xe258('0x12')]('SquareMessage,\x20%s,\x20%s',_0x16eafb,_0x3cbd14[_0xe258('0x12')][_0xe258('0x14')]);return _0x20eb97(_0x3cbd14['error']['message']);}logger[_0xe258('0x12')](_0xe258('0x15'),_0x16eafb,_0x3cbd14[_0xe258('0x12')]['message']);return _0x262a1e(_0x3cbd14[_0xe258('0x12')][_0xe258('0x14')]);}else{logger[_0xe258('0xd')]('SquareMessage,\x20%s,\x20%s',_0x16eafb,_0xe258('0x10'));_0x262a1e(_0x3cbd14[_0xe258('0x16')][_0xe258('0x14')]);}})[_0xe258('0x17')](function(_0x252ec2){logger[_0xe258('0x12')](_0xe258('0x15'),_0x16eafb,_0x252ec2);_0x20eb97(_0x252ec2);});});}exports[_0xe258('0x18')]=function(_0x50442b){var _0x2d62e0=this;return new Promise(function(_0x397b9f,_0x7ac5a6){return db['SquareMessage']['create'](_0x50442b[_0xe258('0x19')],{'raw':_0x50442b['options']?_0x50442b['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x274b17){logger[_0xe258('0xd')](_0xe258('0x18'),_0x50442b);logger[_0xe258('0xe')](_0xe258('0x18'),_0x50442b,JSON[_0xe258('0x11')](_0x274b17));_0x397b9f(_0x274b17);})[_0xe258('0x17')](function(_0x2b8b9e){logger[_0xe258('0x12')](_0xe258('0x18'),_0x2b8b9e['message'],_0x50442b);_0x7ac5a6(_0x2d62e0[_0xe258('0x12')](0x1f4,_0x2b8b9e[_0xe258('0x14')]));});});}; \ No newline at end of file +var _0x1c0a=['rpc','../../config/environment','jayson/promise','client','http','request','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','CreateSquareMessage','create','body','options','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x220dae,_0x2dff58){var _0x4c6598=function(_0x3cdce1){while(--_0x3cdce1){_0x220dae['push'](_0x220dae['shift']());}};_0x4c6598(++_0x2dff58);}(_0x1c0a,0xb5));var _0xa1c0=function(_0x3fe6c6,_0x12ff2c){_0x3fe6c6=_0x3fe6c6-0x0;var _0x13e849=_0x1c0a[_0x3fe6c6];return _0x13e849;};'use strict';var _=require(_0xa1c0('0x0'));var util=require(_0xa1c0('0x1'));var moment=require(_0xa1c0('0x2'));var BPromise=require(_0xa1c0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa1c0('0x4'));var db=require(_0xa1c0('0x5'))['db'];var utils=require(_0xa1c0('0x6'));var logger=require(_0xa1c0('0x7'))(_0xa1c0('0x8'));var config=require(_0xa1c0('0x9'));var jayson=require(_0xa1c0('0xa'));var client=jayson[_0xa1c0('0xb')][_0xa1c0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x12f51d,_0x2eca4b,_0x11a2a7){return new BPromise(function(_0x2a9b97,_0x2de814){return client[_0xa1c0('0xd')](_0x12f51d,_0x11a2a7)['then'](function(_0x4311f3){logger[_0xa1c0('0xe')](_0xa1c0('0xf'),_0x2eca4b,_0xa1c0('0x10'));logger[_0xa1c0('0x11')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x2eca4b,_0xa1c0('0x10'),JSON['stringify'](_0x4311f3));if(_0x4311f3[_0xa1c0('0x12')]){if(_0x4311f3[_0xa1c0('0x12')][_0xa1c0('0x13')]===0x1f4){logger[_0xa1c0('0x12')](_0xa1c0('0xf'),_0x2eca4b,_0x4311f3[_0xa1c0('0x12')][_0xa1c0('0x14')]);return _0x2de814(_0x4311f3[_0xa1c0('0x12')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x2eca4b,_0x4311f3[_0xa1c0('0x12')][_0xa1c0('0x14')]);return _0x2a9b97(_0x4311f3['error'][_0xa1c0('0x14')]);}else{logger[_0xa1c0('0xe')]('SquareMessage,\x20%s,\x20%s',_0x2eca4b,_0xa1c0('0x10'));_0x2a9b97(_0x4311f3[_0xa1c0('0x15')][_0xa1c0('0x14')]);}})[_0xa1c0('0x16')](function(_0x5e9091){logger['error']('SquareMessage,\x20%s,\x20%s',_0x2eca4b,_0x5e9091);_0x2de814(_0x5e9091);});});}exports[_0xa1c0('0x17')]=function(_0x40a0eb){var _0x2d34f8=this;return new Promise(function(_0x158b28,_0x164390){return db['SquareMessage'][_0xa1c0('0x18')](_0x40a0eb[_0xa1c0('0x19')],{'raw':_0x40a0eb[_0xa1c0('0x1a')]?_0x40a0eb['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2e5e7f){logger[_0xa1c0('0xe')](_0xa1c0('0x17'),_0x40a0eb);logger['debug'](_0xa1c0('0x17'),_0x40a0eb,JSON['stringify'](_0x2e5e7f));_0x158b28(_0x2e5e7f);})[_0xa1c0('0x16')](function(_0x123b23){logger[_0xa1c0('0x12')](_0xa1c0('0x17'),_0x123b23[_0xa1c0('0x14')],_0x40a0eb);_0x164390(_0x2d34f8[_0xa1c0('0x12')](0x1f4,_0x123b23[_0xa1c0('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9ad650c..1f33194 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 _0x3fec=['update','delete','exports','multer','util','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','index','get','/:id','show','/:id/test','isAuthenticated','15s','test','post','create','put'];(function(_0x348681,_0x486a1d){var _0x30d4b7=function(_0x4b6cb1){while(--_0x4b6cb1){_0x348681['push'](_0x348681['shift']());}};_0x30d4b7(++_0x486a1d);}(_0x3fec,0x81));var _0xc3fe=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3fec[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xc3fe('0x0'));var util=require(_0xc3fe('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc3fe('0x2')]();var fs_extra=require(_0xc3fe('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xc3fe('0x4'));var config=require(_0xc3fe('0x5'));var controller=require(_0xc3fe('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xc3fe('0x7')]);router[_0xc3fe('0x8')](_0xc3fe('0x9'),auth['isAuthenticated'](),controller[_0xc3fe('0xa')]);router[_0xc3fe('0x8')](_0xc3fe('0xb'),auth[_0xc3fe('0xc')](),timeout(_0xc3fe('0xd')),controller[_0xc3fe('0xe')]);router[_0xc3fe('0xf')]('/',auth[_0xc3fe('0xc')](),controller[_0xc3fe('0x10')]);router[_0xc3fe('0x11')](_0xc3fe('0x9'),auth[_0xc3fe('0xc')](),controller[_0xc3fe('0x12')]);router[_0xc3fe('0x13')](_0xc3fe('0x9'),auth[_0xc3fe('0xc')](),controller['destroy']);module[_0xc3fe('0x14')]=router; \ No newline at end of file +var _0x4ca5=['express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','test','post','create','put','update','delete','destroy','exports','util','connect-timeout'];(function(_0x595e41,_0x1735b9){var _0x4285c8=function(_0x1634a9){while(--_0x1634a9){_0x595e41['push'](_0x595e41['shift']());}};_0x4285c8(++_0x1735b9);}(_0x4ca5,0xc4));var _0x54ca=function(_0x41545c,_0x218504){_0x41545c=_0x41545c-0x0;var _0x4e08d6=_0x4ca5[_0x41545c];return _0x4e08d6;};'use strict';var multer=require('multer');var util=require(_0x54ca('0x0'));var path=require('path');var timeout=require(_0x54ca('0x1'));var express=require(_0x54ca('0x2'));var router=express[_0x54ca('0x3')]();var fs_extra=require(_0x54ca('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x54ca('0x5'));var config=require(_0x54ca('0x6'));var controller=require(_0x54ca('0x7'));router[_0x54ca('0x8')]('/',auth[_0x54ca('0x9')](),controller[_0x54ca('0xa')]);router['get'](_0x54ca('0xb'),auth['isAuthenticated'](),controller[_0x54ca('0xc')]);router['get'](_0x54ca('0xd'),auth[_0x54ca('0x9')](),timeout('15s'),controller[_0x54ca('0xe')]);router[_0x54ca('0xf')]('/',auth[_0x54ca('0x9')](),controller[_0x54ca('0x10')]);router[_0x54ca('0x11')](_0x54ca('0xb'),auth[_0x54ca('0x9')](),controller[_0x54ca('0x12')]);router[_0x54ca('0x13')](_0x54ca('0xb'),auth[_0x54ca('0x9')](),controller[_0x54ca('0x14')]);module[_0x54ca('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 00d5177..97efded 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 _0x2521=['STRING','sequelize','exports'];(function(_0x4ac0ee,_0x10f50c){var _0x49afa4=function(_0x12780d){while(--_0x12780d){_0x4ac0ee['push'](_0x4ac0ee['shift']());}};_0x49afa4(++_0x10f50c);}(_0x2521,0xa0));var _0x1252=function(_0x45fe9c,_0x55e0d7){_0x45fe9c=_0x45fe9c-0x0;var _0x233d48=_0x2521[_0x45fe9c];return _0x233d48;};'use strict';var Sequelize=require(_0x1252('0x0'));module[_0x1252('0x1')]={'name':{'type':Sequelize[_0x1252('0x2')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0x1252('0x2')]},'description':{'type':Sequelize[_0x1252('0x2')]}}; \ No newline at end of file +var _0xf83f=['exports','name','STRING'];(function(_0x1c4cc5,_0xf6050a){var _0x44a455=function(_0x10eddb){while(--_0x10eddb){_0x1c4cc5['push'](_0x1c4cc5['shift']());}};_0x44a455(++_0xf6050a);}(_0xf83f,0x1e6));var _0xff83=function(_0x3afa5b,_0x4e7903){_0x3afa5b=_0x3afa5b-0x0;var _0x3a5ad5=_0xf83f[_0x3afa5b];return _0x3a5ad5;};'use strict';var Sequelize=require('sequelize');module[_0xff83('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xff83('0x1'),'allowNull':![]},'dsn':{'type':Sequelize[_0xff83('0x2')]},'description':{'type':Sequelize[_0xff83('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 6e08726..8c0aa57 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 _0xe489=['fields','merge','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','dsn','odbc','openSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','ODBC','UserProfileResource','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','options','includeAll','include','rows','catch','show','params'];(function(_0x3d4dc8,_0x2d46b6){var _0x368ac5=function(_0x54c8f5){while(--_0x54c8f5){_0x3d4dc8['push'](_0x3d4dc8['shift']());}};_0x368ac5(++_0x2d46b6);}(_0xe489,0xbe));var _0x9e48=function(_0x387b27,_0x35104b){_0x387b27=_0x387b27-0x0;var _0x135e15=_0xe489[_0x387b27];return _0x135e15;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9e48('0x0'));var zipdir=require(_0x9e48('0x1'));var jsonpatch=require(_0x9e48('0x2'));var rp=require(_0x9e48('0x3'));var moment=require(_0x9e48('0x4'));var BPromise=require(_0x9e48('0x5'));var Mustache=require(_0x9e48('0x6'));var util=require(_0x9e48('0x7'));var path=require(_0x9e48('0x8'));var sox=require('sox');var csv=require(_0x9e48('0x9'));var ejs=require(_0x9e48('0xa'));var fs=require('fs');var fs_extra=require(_0x9e48('0xb'));var _=require(_0x9e48('0xc'));var squel=require(_0x9e48('0xd'));var crypto=require(_0x9e48('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9e48('0xf'));var toCsv=require(_0x9e48('0x9'));var querystring=require(_0x9e48('0x10'));var Papa=require('papaparse');var Redis=require(_0x9e48('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x9e48('0x12'));var as=require(_0x9e48('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e48('0x14'))(_0x9e48('0x15'));var utils=require(_0x9e48('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9e48('0x17'));var db=require(_0x9e48('0x18'))['db'];function respondWithStatusCode(_0x28e04e,_0x5585d0){_0x5585d0=_0x5585d0||0xcc;return function(_0x3da585){if(_0x3da585){return _0x28e04e[_0x9e48('0x19')](_0x5585d0);}return _0x28e04e[_0x9e48('0x1a')](_0x5585d0)['end']();};}function respondWithResult(_0x2c6e2d,_0x2868ae){_0x2868ae=_0x2868ae||0xc8;return function(_0x191a90){if(_0x191a90){return _0x2c6e2d[_0x9e48('0x1a')](_0x2868ae)['json'](_0x191a90);}};}function respondWithFilteredResult(_0xaf705,_0x5e994b){return function(_0x440fae){if(_0x440fae){var _0x43f3ea=typeof _0x5e994b[_0x9e48('0x1b')]===_0x9e48('0x1c')&&typeof _0x5e994b['limit']===_0x9e48('0x1c');var _0x1944bb=_0x440fae['count'];var _0x5d8b39=_0x43f3ea?0x0:_0x5e994b[_0x9e48('0x1b')];var _0x1e7596=_0x43f3ea?_0x440fae[_0x9e48('0x1d')]:_0x5e994b[_0x9e48('0x1b')]+_0x5e994b[_0x9e48('0x1e')];var _0x163669;if(_0x1e7596>=_0x1944bb){_0x1e7596=_0x1944bb;_0x163669=0xc8;}else{_0x163669=0xce;}_0xaf705[_0x9e48('0x1a')](_0x163669);return _0xaf705[_0x9e48('0x1f')](_0x9e48('0x20'),_0x5d8b39+'-'+_0x1e7596+'/'+_0x1944bb)[_0x9e48('0x21')](_0x440fae);}return null;};}function patchUpdates(_0x4fe989){return function(_0x409a5b){try{jsonpatch[_0x9e48('0x22')](_0x409a5b,_0x4fe989,!![]);}catch(_0x58b20e){return BPromise[_0x9e48('0x23')](_0x58b20e);}return _0x409a5b[_0x9e48('0x24')]();};}function saveUpdates(_0x3bc81f,_0x1a16f4){return function(_0xe44f59){if(_0xe44f59){return _0xe44f59['update'](_0x3bc81f)[_0x9e48('0x25')](function(_0x5be959){return _0x5be959;});}return null;};}function removeEntity(_0x510481,_0x2a46b8){return function(_0x3b68ab){if(_0x3b68ab){return _0x3b68ab[_0x9e48('0x26')]()[_0x9e48('0x25')](function(){var _0xcd017=_0x3b68ab['get']({'plain':!![]});var _0x3b1df1=_0x9e48('0x27');return db[_0x9e48('0x28')]['destroy']({'where':{'type':_0x3b1df1,'resourceId':_0xcd017['id']}})[_0x9e48('0x25')](function(){return _0x3b68ab;});})[_0x9e48('0x25')](function(){_0x510481[_0x9e48('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9658ba,_0x4ecf09){return function(_0x3fdaee){if(!_0x3fdaee){_0x9658ba['sendStatus'](0x194);}return _0x3fdaee;};}function handleError(_0x2a3ab3,_0x2dcc27){_0x2dcc27=_0x2dcc27||0x1f4;return function(_0x4877ab){logger['error'](_0x4877ab[_0x9e48('0x29')]);if(_0x4877ab[_0x9e48('0x2a')]){delete _0x4877ab[_0x9e48('0x2a')];}_0x2a3ab3[_0x9e48('0x1a')](_0x2dcc27)[_0x9e48('0x2b')](_0x4877ab);};}exports[_0x9e48('0x2c')]=function(_0xe5a3cc,_0x35254d){var _0x44c069={},_0x217027={},_0x3fe90c={'count':0x0,'rows':[]};var _0x2047c4=_['map'](db[_0x9e48('0x2d')][_0x9e48('0x2e')],function(_0x185197){return{'name':_0x185197[_0x9e48('0x2f')],'type':_0x185197[_0x9e48('0x30')]['key']};});_0x217027[_0x9e48('0x31')]=_['map'](_0x2047c4,'name');_0x217027[_0x9e48('0x32')]=_[_0x9e48('0x33')](_0xe5a3cc[_0x9e48('0x32')]);_0x217027[_0x9e48('0x34')]=_['intersection'](_0x217027['model'],_0x217027[_0x9e48('0x32')]);_0x44c069['attributes']=_[_0x9e48('0x35')](_0x217027[_0x9e48('0x31')],qs['fields'](_0xe5a3cc[_0x9e48('0x32')]['fields']));_0x44c069[_0x9e48('0x36')]=_0x44c069['attributes'][_0x9e48('0x37')]?_0x44c069[_0x9e48('0x36')]:_0x217027[_0x9e48('0x31')];if(!_0xe5a3cc[_0x9e48('0x32')][_0x9e48('0x38')](_0x9e48('0x39'))){_0x44c069['limit']=qs['limit'](_0xe5a3cc[_0x9e48('0x32')][_0x9e48('0x1e')]);_0x44c069[_0x9e48('0x1b')]=qs[_0x9e48('0x1b')](_0xe5a3cc['query']['offset']);}_0x44c069[_0x9e48('0x3a')]=qs[_0x9e48('0x3b')](_0xe5a3cc[_0x9e48('0x32')][_0x9e48('0x3b')]);_0x44c069[_0x9e48('0x3c')]=qs[_0x9e48('0x34')](_[_0x9e48('0x3d')](_0xe5a3cc['query'],_0x217027[_0x9e48('0x34')]),_0x2047c4);if(_0xe5a3cc[_0x9e48('0x32')][_0x9e48('0x3e')]){_0x44c069[_0x9e48('0x3c')]=_['merge'](_0x44c069[_0x9e48('0x3c')],{'$or':_[_0x9e48('0x3f')](_0x2047c4,function(_0x4b3fc4){if(_0x4b3fc4['type']!=='VIRTUAL'){var _0x34f8d1={};_0x34f8d1[_0x4b3fc4[_0x9e48('0x2a')]]={'$like':'%'+_0xe5a3cc['query'][_0x9e48('0x3e')]+'%'};return _0x34f8d1;}})});}_0x44c069=_['merge']({},_0x44c069,_0xe5a3cc[_0x9e48('0x40')]);var _0x571390={'where':_0x44c069[_0x9e48('0x3c')]};return db['SquareOdbc'][_0x9e48('0x1d')](_0x571390)['then'](function(_0x324f10){_0x3fe90c[_0x9e48('0x1d')]=_0x324f10;if(_0xe5a3cc[_0x9e48('0x32')][_0x9e48('0x41')]){_0x44c069[_0x9e48('0x42')]=[{'all':!![]}];}return db['SquareOdbc']['findAll'](_0x44c069);})[_0x9e48('0x25')](function(_0xc7fcbd){_0x3fe90c[_0x9e48('0x43')]=_0xc7fcbd;return _0x3fe90c;})['then'](respondWithFilteredResult(_0x35254d,_0x44c069))[_0x9e48('0x44')](handleError(_0x35254d,null));};exports[_0x9e48('0x45')]=function(_0x218bd1,_0x301ec8){var _0x32b011={'raw':!![],'where':{'id':_0x218bd1[_0x9e48('0x46')]['id']}},_0x14fe25={};_0x14fe25[_0x9e48('0x31')]=_[_0x9e48('0x33')](db['SquareOdbc'][_0x9e48('0x2e')]);_0x14fe25[_0x9e48('0x32')]=_[_0x9e48('0x33')](_0x218bd1[_0x9e48('0x32')]);_0x14fe25['filters']=_[_0x9e48('0x35')](_0x14fe25['model'],_0x14fe25[_0x9e48('0x32')]);_0x32b011[_0x9e48('0x36')]=_[_0x9e48('0x35')](_0x14fe25['model'],qs[_0x9e48('0x47')](_0x218bd1['query'][_0x9e48('0x47')]));_0x32b011['attributes']=_0x32b011[_0x9e48('0x36')]['length']?_0x32b011['attributes']:_0x14fe25['model'];if(_0x218bd1[_0x9e48('0x32')]['includeAll']){_0x32b011[_0x9e48('0x42')]=[{'all':!![]}];}_0x32b011=_[_0x9e48('0x48')]({},_0x32b011,_0x218bd1['options']);return db[_0x9e48('0x2d')][_0x9e48('0x49')](_0x32b011)['then'](handleEntityNotFound(_0x301ec8,null))['then'](respondWithResult(_0x301ec8,null))[_0x9e48('0x44')](handleError(_0x301ec8,null));};exports[_0x9e48('0x4a')]=function(_0x1d0e71,_0x43ac97){return db[_0x9e48('0x2d')]['create'](_0x1d0e71['body'],{})[_0x9e48('0x25')](function(_0x284b29){var _0x4a810d=_0x1d0e71[_0x9e48('0x4b')][_0x9e48('0x4c')]({'plain':!![]});if(!_0x4a810d)throw new Error(_0x9e48('0x4d'));if(_0x4a810d[_0x9e48('0x4e')]==='user'){var _0x106897=_0x284b29['get']({'plain':!![]});var _0x3a99ae=_0x9e48('0x27');return db[_0x9e48('0x4f')][_0x9e48('0x49')]({'where':{'name':_0x3a99ae,'userProfileId':_0x4a810d[_0x9e48('0x50')]},'raw':!![]})['then'](function(_0x445649){if(_0x445649&&_0x445649['autoAssociation']===0x0){return db[_0x9e48('0x28')][_0x9e48('0x4a')]({'name':_0x106897[_0x9e48('0x2a')],'resourceId':_0x106897['id'],'type':_0x445649[_0x9e48('0x2a')],'sectionId':_0x445649['id']},{})[_0x9e48('0x25')](function(){return _0x284b29;});}else{return _0x284b29;}})['catch'](function(_0x5cfc70){logger['error'](_0x9e48('0x51'),_0x5cfc70);throw _0x5cfc70;});}return _0x284b29;})['then'](respondWithResult(_0x43ac97,0xc9))[_0x9e48('0x44')](handleError(_0x43ac97,null));};exports[_0x9e48('0x52')]=function(_0xf19816,_0x294d68){if(_0xf19816['body']['id']){delete _0xf19816[_0x9e48('0x53')]['id'];}return db[_0x9e48('0x2d')][_0x9e48('0x49')]({'where':{'id':_0xf19816[_0x9e48('0x46')]['id']}})['then'](handleEntityNotFound(_0x294d68,null))['then'](saveUpdates(_0xf19816[_0x9e48('0x53')],null))[_0x9e48('0x25')](respondWithResult(_0x294d68,null))[_0x9e48('0x44')](handleError(_0x294d68,null));};exports[_0x9e48('0x26')]=function(_0x4b6bc6,_0x34f7aa){return db[_0x9e48('0x2d')][_0x9e48('0x49')]({'where':{'id':_0x4b6bc6[_0x9e48('0x46')]['id']}})[_0x9e48('0x25')](handleEntityNotFound(_0x34f7aa,null))[_0x9e48('0x25')](removeEntity(_0x34f7aa,null))[_0x9e48('0x44')](handleError(_0x34f7aa,null));};exports['test']=function(_0x928332,_0x2e4220,_0x5f53ea){var _0x40177e;return db['SquareOdbc']['find']({'where':{'id':_0x928332[_0x9e48('0x46')]['id']},'attributes':['id',_0x9e48('0x54')]})[_0x9e48('0x25')](handleEntityNotFound(_0x2e4220,null))[_0x9e48('0x25')](function(_0x535b25){if(_0x535b25){var _0x355716=require(_0x9e48('0x55'))();_0x355716[_0x9e48('0x56')](_0x535b25[_0x9e48('0x54')]);_0x355716['closeSync']();return _0x535b25;}})['then'](respondWithResult(_0x2e4220,null))[_0x9e48('0x44')](handleError(_0x2e4220,null));}; \ No newline at end of file +var _0x6d5a=['eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','role','ODBC','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','dsn','openSync','closeSync'];(function(_0x1723a9,_0x21d3df){var _0x17a72f=function(_0x31c59a){while(--_0x31c59a){_0x1723a9['push'](_0x1723a9['shift']());}};_0x17a72f(++_0x21d3df);}(_0x6d5a,0xac));var _0xa6d5=function(_0xdfe76,_0x41c0fd){_0xdfe76=_0xdfe76-0x0;var _0x37552b=_0x6d5a[_0xdfe76];return _0x37552b;};'use strict';var emlformat=require(_0xa6d5('0x0'));var rimraf=require(_0xa6d5('0x1'));var zipdir=require(_0xa6d5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa6d5('0x3'));var BPromise=require(_0xa6d5('0x4'));var Mustache=require(_0xa6d5('0x5'));var util=require('util');var path=require(_0xa6d5('0x6'));var sox=require(_0xa6d5('0x7'));var csv=require(_0xa6d5('0x8'));var ejs=require(_0xa6d5('0x9'));var fs=require('fs');var fs_extra=require(_0xa6d5('0xa'));var _=require(_0xa6d5('0xb'));var squel=require(_0xa6d5('0xc'));var crypto=require(_0xa6d5('0xd'));var jsforce=require(_0xa6d5('0xe'));var deskjs=require(_0xa6d5('0xf'));var toCsv=require(_0xa6d5('0x8'));var querystring=require(_0xa6d5('0x10'));var Papa=require(_0xa6d5('0x11'));var Redis=require(_0xa6d5('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa6d5('0x13'));var as=require(_0xa6d5('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xa6d5('0x15'));var config=require(_0xa6d5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa6d5('0x17'))['db'];function respondWithStatusCode(_0x476b79,_0x565489){_0x565489=_0x565489||0xcc;return function(_0x149044){if(_0x149044){return _0x476b79['sendStatus'](_0x565489);}return _0x476b79['status'](_0x565489)['end']();};}function respondWithResult(_0x1894bc,_0x2c5860){_0x2c5860=_0x2c5860||0xc8;return function(_0x282c67){if(_0x282c67){return _0x1894bc[_0xa6d5('0x18')](_0x2c5860)[_0xa6d5('0x19')](_0x282c67);}};}function respondWithFilteredResult(_0x151df8,_0xa6739f){return function(_0x276419){if(_0x276419){var _0x2c896e=typeof _0xa6739f[_0xa6d5('0x1a')]===_0xa6d5('0x1b')&&typeof _0xa6739f[_0xa6d5('0x1c')]===_0xa6d5('0x1b');var _0x585f26=_0x276419[_0xa6d5('0x1d')];var _0x4c534a=_0x2c896e?0x0:_0xa6739f[_0xa6d5('0x1a')];var _0x42cf37=_0x2c896e?_0x276419[_0xa6d5('0x1d')]:_0xa6739f['offset']+_0xa6739f[_0xa6d5('0x1c')];var _0x365884;if(_0x42cf37>=_0x585f26){_0x42cf37=_0x585f26;_0x365884=0xc8;}else{_0x365884=0xce;}_0x151df8[_0xa6d5('0x18')](_0x365884);return _0x151df8[_0xa6d5('0x1e')](_0xa6d5('0x1f'),_0x4c534a+'-'+_0x42cf37+'/'+_0x585f26)['json'](_0x276419);}return null;};}function patchUpdates(_0x37b039){return function(_0x154c80){try{jsonpatch['apply'](_0x154c80,_0x37b039,!![]);}catch(_0x264f5c){return BPromise[_0xa6d5('0x20')](_0x264f5c);}return _0x154c80[_0xa6d5('0x21')]();};}function saveUpdates(_0x128a14,_0x28ae68){return function(_0x4387f2){if(_0x4387f2){return _0x4387f2[_0xa6d5('0x22')](_0x128a14)[_0xa6d5('0x23')](function(_0x345c2e){return _0x345c2e;});}return null;};}function removeEntity(_0x166b46,_0x25751a){return function(_0xcd82fd){if(_0xcd82fd){return _0xcd82fd['destroy']()['then'](function(){var _0x3b2917=_0xcd82fd['get']({'plain':!![]});var _0x1c58f1='ODBC';return db[_0xa6d5('0x24')][_0xa6d5('0x25')]({'where':{'type':_0x1c58f1,'resourceId':_0x3b2917['id']}})[_0xa6d5('0x23')](function(){return _0xcd82fd;});})['then'](function(){_0x166b46[_0xa6d5('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f0cdf,_0x3fa0d4){return function(_0x17ad47){if(!_0x17ad47){_0x2f0cdf[_0xa6d5('0x26')](0x194);}return _0x17ad47;};}function handleError(_0x4724b9,_0x7d98d){_0x7d98d=_0x7d98d||0x1f4;return function(_0xa65606){logger[_0xa6d5('0x27')](_0xa65606[_0xa6d5('0x28')]);if(_0xa65606[_0xa6d5('0x29')]){delete _0xa65606[_0xa6d5('0x29')];}_0x4724b9['status'](_0x7d98d)[_0xa6d5('0x2a')](_0xa65606);};}exports[_0xa6d5('0x2b')]=function(_0x18eb78,_0x5a6458){var _0x22a979={},_0x1017b7={},_0x123e4={'count':0x0,'rows':[]};var _0x5c5d4b=_['map'](db[_0xa6d5('0x2c')][_0xa6d5('0x2d')],function(_0x4ac7bf){return{'name':_0x4ac7bf[_0xa6d5('0x2e')],'type':_0x4ac7bf[_0xa6d5('0x2f')][_0xa6d5('0x30')]};});_0x1017b7[_0xa6d5('0x31')]=_[_0xa6d5('0x32')](_0x5c5d4b,_0xa6d5('0x29'));_0x1017b7[_0xa6d5('0x33')]=_[_0xa6d5('0x34')](_0x18eb78['query']);_0x1017b7[_0xa6d5('0x35')]=_[_0xa6d5('0x36')](_0x1017b7['model'],_0x1017b7['query']);_0x22a979['attributes']=_['intersection'](_0x1017b7[_0xa6d5('0x31')],qs[_0xa6d5('0x37')](_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x37')]));_0x22a979[_0xa6d5('0x38')]=_0x22a979[_0xa6d5('0x38')][_0xa6d5('0x39')]?_0x22a979[_0xa6d5('0x38')]:_0x1017b7[_0xa6d5('0x31')];if(!_0x18eb78[_0xa6d5('0x33')]['hasOwnProperty'](_0xa6d5('0x3a'))){_0x22a979[_0xa6d5('0x1c')]=qs['limit'](_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x1c')]);_0x22a979[_0xa6d5('0x1a')]=qs[_0xa6d5('0x1a')](_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x1a')]);}_0x22a979['order']=qs[_0xa6d5('0x3b')](_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x3b')]);_0x22a979[_0xa6d5('0x3c')]=qs['filters'](_[_0xa6d5('0x3d')](_0x18eb78[_0xa6d5('0x33')],_0x1017b7['filters']),_0x5c5d4b);if(_0x18eb78['query'][_0xa6d5('0x3e')]){_0x22a979['where']=_[_0xa6d5('0x3f')](_0x22a979[_0xa6d5('0x3c')],{'$or':_[_0xa6d5('0x32')](_0x5c5d4b,function(_0x5beb3e){if(_0x5beb3e[_0xa6d5('0x2f')]!=='VIRTUAL'){var _0x54de7e={};_0x54de7e[_0x5beb3e[_0xa6d5('0x29')]]={'$like':'%'+_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x3e')]+'%'};return _0x54de7e;}})});}_0x22a979=_[_0xa6d5('0x3f')]({},_0x22a979,_0x18eb78[_0xa6d5('0x40')]);var _0x37b24e={'where':_0x22a979[_0xa6d5('0x3c')]};return db['SquareOdbc'][_0xa6d5('0x1d')](_0x37b24e)[_0xa6d5('0x23')](function(_0x1c8fef){_0x123e4['count']=_0x1c8fef;if(_0x18eb78[_0xa6d5('0x33')][_0xa6d5('0x41')]){_0x22a979[_0xa6d5('0x42')]=[{'all':!![]}];}return db['SquareOdbc'][_0xa6d5('0x43')](_0x22a979);})[_0xa6d5('0x23')](function(_0x2c9321){_0x123e4[_0xa6d5('0x44')]=_0x2c9321;return _0x123e4;})['then'](respondWithFilteredResult(_0x5a6458,_0x22a979))[_0xa6d5('0x45')](handleError(_0x5a6458,null));};exports[_0xa6d5('0x46')]=function(_0x50febb,_0x435797){var _0x31ae64={'raw':!![],'where':{'id':_0x50febb[_0xa6d5('0x47')]['id']}},_0x268b87={};_0x268b87[_0xa6d5('0x31')]=_[_0xa6d5('0x34')](db[_0xa6d5('0x2c')][_0xa6d5('0x2d')]);_0x268b87[_0xa6d5('0x33')]=_[_0xa6d5('0x34')](_0x50febb[_0xa6d5('0x33')]);_0x268b87[_0xa6d5('0x35')]=_[_0xa6d5('0x36')](_0x268b87['model'],_0x268b87[_0xa6d5('0x33')]);_0x31ae64[_0xa6d5('0x38')]=_[_0xa6d5('0x36')](_0x268b87['model'],qs[_0xa6d5('0x37')](_0x50febb[_0xa6d5('0x33')][_0xa6d5('0x37')]));_0x31ae64[_0xa6d5('0x38')]=_0x31ae64['attributes'][_0xa6d5('0x39')]?_0x31ae64['attributes']:_0x268b87['model'];if(_0x50febb[_0xa6d5('0x33')][_0xa6d5('0x41')]){_0x31ae64[_0xa6d5('0x42')]=[{'all':!![]}];}_0x31ae64=_[_0xa6d5('0x3f')]({},_0x31ae64,_0x50febb[_0xa6d5('0x40')]);return db[_0xa6d5('0x2c')][_0xa6d5('0x48')](_0x31ae64)[_0xa6d5('0x23')](handleEntityNotFound(_0x435797,null))[_0xa6d5('0x23')](respondWithResult(_0x435797,null))['catch'](handleError(_0x435797,null));};exports[_0xa6d5('0x49')]=function(_0x54808f,_0x5dba2b){return db['SquareOdbc'][_0xa6d5('0x49')](_0x54808f[_0xa6d5('0x4a')],{})[_0xa6d5('0x23')](function(_0x1873b0){var _0x7c69d5=_0x54808f[_0xa6d5('0x4b')][_0xa6d5('0x4c')]({'plain':!![]});if(!_0x7c69d5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7c69d5[_0xa6d5('0x4d')]===_0xa6d5('0x4b')){var _0x12243b=_0x1873b0[_0xa6d5('0x4c')]({'plain':!![]});var _0x2ad857=_0xa6d5('0x4e');return db[_0xa6d5('0x4f')][_0xa6d5('0x48')]({'where':{'name':_0x2ad857,'userProfileId':_0x7c69d5[_0xa6d5('0x50')]},'raw':!![]})[_0xa6d5('0x23')](function(_0x7e29f9){if(_0x7e29f9&&_0x7e29f9['autoAssociation']===0x0){return db[_0xa6d5('0x24')]['create']({'name':_0x12243b[_0xa6d5('0x29')],'resourceId':_0x12243b['id'],'type':_0x7e29f9[_0xa6d5('0x29')],'sectionId':_0x7e29f9['id']},{})[_0xa6d5('0x23')](function(){return _0x1873b0;});}else{return _0x1873b0;}})[_0xa6d5('0x45')](function(_0x1f8f5e){logger[_0xa6d5('0x27')](_0xa6d5('0x51'),_0x1f8f5e);throw _0x1f8f5e;});}return _0x1873b0;})[_0xa6d5('0x23')](respondWithResult(_0x5dba2b,0xc9))['catch'](handleError(_0x5dba2b,null));};exports[_0xa6d5('0x22')]=function(_0x4dc4b1,_0x516473){if(_0x4dc4b1[_0xa6d5('0x4a')]['id']){delete _0x4dc4b1[_0xa6d5('0x4a')]['id'];}return db[_0xa6d5('0x2c')]['find']({'where':{'id':_0x4dc4b1[_0xa6d5('0x47')]['id']}})[_0xa6d5('0x23')](handleEntityNotFound(_0x516473,null))[_0xa6d5('0x23')](saveUpdates(_0x4dc4b1['body'],null))[_0xa6d5('0x23')](respondWithResult(_0x516473,null))['catch'](handleError(_0x516473,null));};exports[_0xa6d5('0x25')]=function(_0x3b470f,_0x3119e0){return db[_0xa6d5('0x2c')]['find']({'where':{'id':_0x3b470f['params']['id']}})['then'](handleEntityNotFound(_0x3119e0,null))[_0xa6d5('0x23')](removeEntity(_0x3119e0,null))[_0xa6d5('0x45')](handleError(_0x3119e0,null));};exports[_0xa6d5('0x52')]=function(_0x3e1969,_0x11274e,_0x53ece1){var _0x43c1ff;return db[_0xa6d5('0x2c')]['find']({'where':{'id':_0x3e1969['params']['id']},'attributes':['id',_0xa6d5('0x53')]})[_0xa6d5('0x23')](handleEntityNotFound(_0x11274e,null))[_0xa6d5('0x23')](function(_0x2c5d71){if(_0x2c5d71){var _0x4dfc64=require('odbc')();_0x4dfc64[_0xa6d5('0x54')](_0x2c5d71[_0xa6d5('0x53')]);_0x4dfc64[_0xa6d5('0x55')]();return _0x2c5d71;}})[_0xa6d5('0x23')](respondWithResult(_0x11274e,null))[_0xa6d5('0x45')](handleError(_0x11274e,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 923b9da..1f275f0 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 _0xe76f=['request-promise','path','rimraf','define','SquareOdbc','square_odbc','lodash','util','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xe76f,0x1df));var _0xfe76=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xe76f[_0xbd08b4];return _0x314f1e;};'use strict';var _=require(_0xfe76('0x0'));var util=require(_0xfe76('0x1'));var logger=require('../../config/logger')(_0xfe76('0x2'));var moment=require(_0xfe76('0x3'));var BPromise=require(_0xfe76('0x4'));var rp=require(_0xfe76('0x5'));var fs=require('fs');var path=require(_0xfe76('0x6'));var rimraf=require(_0xfe76('0x7'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module['exports']=function(_0x11adb2,_0xb4ef09){return _0x11adb2[_0xfe76('0x8')](_0xfe76('0x9'),attributes,{'tableName':_0xfe76('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbbe2=['util','../../config/logger','moment','request-promise','path','../../config/environment','./squareOdbc.attributes','exports','lodash'];(function(_0x5f519b,_0x5b606f){var _0x2461e2=function(_0x510241){while(--_0x510241){_0x5f519b['push'](_0x5f519b['shift']());}};_0x2461e2(++_0x5b606f);}(_0xbbe2,0x116));var _0x2bbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbe2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2bbe('0x0'));var util=require(_0x2bbe('0x1'));var logger=require(_0x2bbe('0x2'))('api');var moment=require(_0x2bbe('0x3'));var BPromise=require('bluebird');var rp=require(_0x2bbe('0x4'));var fs=require('fs');var path=require(_0x2bbe('0x5'));var rimraf=require('rimraf');var config=require(_0x2bbe('0x6'));var attributes=require(_0x2bbe('0x7'));module[_0x2bbe('0x8')]=function(_0x8d81a7,_0x457109){return _0x8d81a7['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index f9993a7..b08e7ee 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 _0x0fc4=['request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowSquareOdbc','SquareOdbc','find','options','raw','where','attributes','include','map','model','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','request','then','info','SquareOdbc,\x20%s,\x20%s'];(function(_0x46d14b,_0x147907){var _0x367dfd=function(_0x117d8e){while(--_0x117d8e){_0x46d14b['push'](_0x46d14b['shift']());}};_0x367dfd(++_0x147907);}(_0x0fc4,0x13c));var _0x40fc=function(_0x11a55c,_0x4eced9){_0x11a55c=_0x11a55c-0x0;var _0x26c390=_0x0fc4[_0x11a55c];return _0x26c390;};'use strict';var _=require(_0x40fc('0x0'));var util=require(_0x40fc('0x1'));var moment=require(_0x40fc('0x2'));var BPromise=require(_0x40fc('0x3'));var rs=require(_0x40fc('0x4'));var fs=require('fs');var Redis=require(_0x40fc('0x5'));var db=require(_0x40fc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x40fc('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x40fc('0x8')][_0x40fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x104902,_0x1e23ea,_0xc5c607){return new BPromise(function(_0x2b7a43,_0x42df2b){return client[_0x40fc('0xa')](_0x104902,_0xc5c607)[_0x40fc('0xb')](function(_0x298ffa){logger[_0x40fc('0xc')](_0x40fc('0xd'),_0x1e23ea,_0x40fc('0xe'));logger[_0x40fc('0xf')](_0x40fc('0x10'),_0x1e23ea,_0x40fc('0xe'),JSON[_0x40fc('0x11')](_0x298ffa));if(_0x298ffa[_0x40fc('0x12')]){if(_0x298ffa['error'][_0x40fc('0x13')]===0x1f4){logger['error'](_0x40fc('0xd'),_0x1e23ea,_0x298ffa[_0x40fc('0x12')][_0x40fc('0x14')]);return _0x42df2b(_0x298ffa[_0x40fc('0x12')]['message']);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x1e23ea,_0x298ffa[_0x40fc('0x12')]['message']);return _0x2b7a43(_0x298ffa[_0x40fc('0x12')][_0x40fc('0x14')]);}else{logger[_0x40fc('0xc')](_0x40fc('0xd'),_0x1e23ea,_0x40fc('0xe'));_0x2b7a43(_0x298ffa[_0x40fc('0x15')][_0x40fc('0x14')]);}})['catch'](function(_0x2ef46e){logger[_0x40fc('0x12')](_0x40fc('0xd'),_0x1e23ea,_0x2ef46e);_0x42df2b(_0x2ef46e);});});}exports[_0x40fc('0x16')]=function(_0x15dd92){var _0x5b2c6a=this;return new Promise(function(_0x243ceb,_0x1f5a3e){return db[_0x40fc('0x17')][_0x40fc('0x18')]({'raw':_0x15dd92[_0x40fc('0x19')]?_0x15dd92[_0x40fc('0x19')][_0x40fc('0x1a')]===undefined?!![]:![]:!![],'where':_0x15dd92[_0x40fc('0x19')]?_0x15dd92[_0x40fc('0x19')][_0x40fc('0x1b')]||null:null,'attributes':_0x15dd92[_0x40fc('0x19')]?_0x15dd92[_0x40fc('0x19')][_0x40fc('0x1c')]||null:null,'include':_0x15dd92[_0x40fc('0x19')]?_0x15dd92[_0x40fc('0x19')][_0x40fc('0x1d')]?_[_0x40fc('0x1e')](_0x15dd92[_0x40fc('0x19')]['include'],function(_0x373e01){return{'model':db[_0x373e01['model']],'as':_0x373e01['as'],'attributes':_0x373e01['attributes'],'include':_0x373e01[_0x40fc('0x1d')]?_[_0x40fc('0x1e')](_0x373e01[_0x40fc('0x1d')],function(_0x5c17cc){return{'model':db[_0x5c17cc[_0x40fc('0x1f')]],'as':_0x5c17cc['as'],'attributes':_0x5c17cc[_0x40fc('0x1c')],'include':_0x5c17cc[_0x40fc('0x1d')]?_['map'](_0x5c17cc['include'],function(_0x174e46){return{'model':db[_0x174e46[_0x40fc('0x1f')]],'as':_0x174e46['as'],'attributes':_0x174e46[_0x40fc('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17f0e2){logger['info'](_0x40fc('0x16'),_0x15dd92);logger[_0x40fc('0xf')](_0x40fc('0x16'),_0x15dd92,JSON[_0x40fc('0x11')](_0x17f0e2));_0x243ceb(_0x17f0e2);})[_0x40fc('0x20')](function(_0xbc75a9){logger['error'](_0x40fc('0x16'),_0xbc75a9[_0x40fc('0x14')],_0x15dd92);_0x1f5a3e(_0x5b2c6a[_0x40fc('0x12')](0x1f4,_0xbc75a9[_0x40fc('0x14')]));});});}; \ No newline at end of file +var _0x1142=['jayson/promise','client','request','debug','request\x20sent','stringify','error','code','SquareOdbc,\x20%s,\x20%s','message','info','result','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','then','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment'];(function(_0x2c793c,_0xc2f3c){var _0x5a8544=function(_0x6fd7ca){while(--_0x6fd7ca){_0x2c793c['push'](_0x2c793c['shift']());}};_0x5a8544(++_0xc2f3c);}(_0x1142,0x18b));var _0x2114=function(_0x43662c,_0x59edfe){_0x43662c=_0x43662c-0x0;var _0x4cdee9=_0x1142[_0x43662c];return _0x4cdee9;};'use strict';var _=require('lodash');var util=require(_0x2114('0x0'));var moment=require(_0x2114('0x1'));var BPromise=require(_0x2114('0x2'));var rs=require(_0x2114('0x3'));var fs=require('fs');var Redis=require(_0x2114('0x4'));var db=require(_0x2114('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2114('0x6'))('rpc');var config=require(_0x2114('0x7'));var jayson=require(_0x2114('0x8'));var client=jayson[_0x2114('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54c7c4,_0x220c41,_0x5ca68e){return new BPromise(function(_0x54a9b7,_0x5ab4c9){return client[_0x2114('0xa')](_0x54c7c4,_0x5ca68e)['then'](function(_0x54397c){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x220c41,'request\x20sent');logger[_0x2114('0xb')]('SquareOdbc,\x20%s,\x20%s,\x20%s',_0x220c41,_0x2114('0xc'),JSON[_0x2114('0xd')](_0x54397c));if(_0x54397c[_0x2114('0xe')]){if(_0x54397c[_0x2114('0xe')][_0x2114('0xf')]===0x1f4){logger[_0x2114('0xe')](_0x2114('0x10'),_0x220c41,_0x54397c[_0x2114('0xe')][_0x2114('0x11')]);return _0x5ab4c9(_0x54397c[_0x2114('0xe')][_0x2114('0x11')]);}logger[_0x2114('0xe')](_0x2114('0x10'),_0x220c41,_0x54397c['error'][_0x2114('0x11')]);return _0x54a9b7(_0x54397c[_0x2114('0xe')]['message']);}else{logger[_0x2114('0x12')](_0x2114('0x10'),_0x220c41,_0x2114('0xc'));_0x54a9b7(_0x54397c[_0x2114('0x13')]['message']);}})['catch'](function(_0x17a459){logger[_0x2114('0xe')](_0x2114('0x10'),_0x220c41,_0x17a459);_0x5ab4c9(_0x17a459);});});}exports[_0x2114('0x14')]=function(_0x14d4e0){var _0x9fb550=this;return new Promise(function(_0x392fe6,_0xb85a83){return db['SquareOdbc'][_0x2114('0x15')]({'raw':_0x14d4e0[_0x2114('0x16')]?_0x14d4e0['options'][_0x2114('0x17')]===undefined?!![]:![]:!![],'where':_0x14d4e0[_0x2114('0x16')]?_0x14d4e0['options'][_0x2114('0x18')]||null:null,'attributes':_0x14d4e0[_0x2114('0x16')]?_0x14d4e0[_0x2114('0x16')][_0x2114('0x19')]||null:null,'include':_0x14d4e0[_0x2114('0x16')]?_0x14d4e0[_0x2114('0x16')][_0x2114('0x1a')]?_[_0x2114('0x1b')](_0x14d4e0[_0x2114('0x16')][_0x2114('0x1a')],function(_0x4fe509){return{'model':db[_0x4fe509[_0x2114('0x1c')]],'as':_0x4fe509['as'],'attributes':_0x4fe509['attributes'],'include':_0x4fe509['include']?_[_0x2114('0x1b')](_0x4fe509[_0x2114('0x1a')],function(_0x304511){return{'model':db[_0x304511[_0x2114('0x1c')]],'as':_0x304511['as'],'attributes':_0x304511[_0x2114('0x19')],'include':_0x304511[_0x2114('0x1a')]?_[_0x2114('0x1b')](_0x304511[_0x2114('0x1a')],function(_0x506bfd){return{'model':db[_0x506bfd[_0x2114('0x1c')]],'as':_0x506bfd['as'],'attributes':_0x506bfd[_0x2114('0x19')]};}):[]};}):[]};}):[]:[]})[_0x2114('0x1d')](function(_0x1390a9){logger[_0x2114('0x12')](_0x2114('0x14'),_0x14d4e0);logger[_0x2114('0xb')]('ShowSquareOdbc',_0x14d4e0,JSON[_0x2114('0xd')](_0x1390a9));_0x392fe6(_0x1390a9);})[_0x2114('0x1e')](function(_0x69d27b){logger['error']('ShowSquareOdbc',_0x69d27b[_0x2114('0x11')],_0x14d4e0);_0xb85a83(_0x9fb550[_0x2114('0xe')](0x1f4,_0x69d27b['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index abe0c09..38ec6d3 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 _0x2b10=['Router','fs-extra','../../components/interaction/service','get','isAuthenticated','index','show','/:id/users','getUsers','post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x2e8b34,_0x575db6){var _0xdeb292=function(_0x3a07c1){while(--_0x3a07c1){_0x2e8b34['push'](_0x2e8b34['shift']());}};_0xdeb292(++_0x575db6);}(_0x2b10,0x114));var _0x02b1=function(_0x48ddb9,_0x169add){_0x48ddb9=_0x48ddb9-0x0;var _0x48ff05=_0x2b10[_0x48ddb9];return _0x48ff05;};'use strict';var multer=require(_0x02b1('0x0'));var util=require('util');var path=require(_0x02b1('0x1'));var timeout=require(_0x02b1('0x2'));var express=require(_0x02b1('0x3'));var router=express[_0x02b1('0x4')]();var fs_extra=require(_0x02b1('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x02b1('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x02b1('0x7')]('/',auth[_0x02b1('0x8')](),controller[_0x02b1('0x9')]);router[_0x02b1('0x7')]('/:id',auth[_0x02b1('0x8')](),controller[_0x02b1('0xa')]);router[_0x02b1('0x7')](_0x02b1('0xb'),auth[_0x02b1('0x8')](),controller[_0x02b1('0xc')]);router[_0x02b1('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x02b1('0xd')](_0x02b1('0xb'),auth[_0x02b1('0x8')](),controller['addUsers']);router[_0x02b1('0xe')](_0x02b1('0xf'),auth[_0x02b1('0x8')](),controller[_0x02b1('0x10')]);router[_0x02b1('0x11')]('/:id',auth[_0x02b1('0x8')](),controller[_0x02b1('0x12')]);router['delete'](_0x02b1('0xb'),auth[_0x02b1('0x8')](),controller['removeUsers']);module[_0x02b1('0x13')]=router; \ No newline at end of file +var _0xeee9=['index','/:id','show','/:id/users','getUsers','post','create','addUsers','put','update','destroy','delete','removeUsers','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x13e300,_0x1bcb41){var _0x5a3eea=function(_0x2dfd2a){while(--_0x2dfd2a){_0x13e300['push'](_0x13e300['shift']());}};_0x5a3eea(++_0x1bcb41);}(_0xeee9,0x153));var _0x9eee=function(_0x51eb95,_0x1a7169){_0x51eb95=_0x51eb95-0x0;var _0x93729c=_0xeee9[_0x51eb95];return _0x93729c;};'use strict';var multer=require('multer');var util=require(_0x9eee('0x0'));var path=require(_0x9eee('0x1'));var timeout=require(_0x9eee('0x2'));var express=require(_0x9eee('0x3'));var router=express[_0x9eee('0x4')]();var fs_extra=require(_0x9eee('0x5'));var auth=require(_0x9eee('0x6'));var interaction=require(_0x9eee('0x7'));var config=require(_0x9eee('0x8'));var controller=require('./squareProject.controller');router[_0x9eee('0x9')]('/',auth[_0x9eee('0xa')](),controller[_0x9eee('0xb')]);router[_0x9eee('0x9')](_0x9eee('0xc'),auth['isAuthenticated'](),controller[_0x9eee('0xd')]);router[_0x9eee('0x9')](_0x9eee('0xe'),auth[_0x9eee('0xa')](),controller[_0x9eee('0xf')]);router[_0x9eee('0x10')]('/',auth['isAuthenticated'](),controller[_0x9eee('0x11')]);router[_0x9eee('0x10')](_0x9eee('0xe'),auth[_0x9eee('0xa')](),controller[_0x9eee('0x12')]);router[_0x9eee('0x13')](_0x9eee('0xc'),auth[_0x9eee('0xa')](),controller[_0x9eee('0x14')]);router['delete'](_0x9eee('0xc'),auth[_0x9eee('0xa')](),controller[_0x9eee('0x15')]);router[_0x9eee('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0x9eee('0x17')]);module[_0x9eee('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 295df01..b4068f8 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 _0xc613=['getDataValue','toString','long','utf8','DATE','sequelize','TEXT','BLOB'];(function(_0x16d5e8,_0x2f0188){var _0x204ec3=function(_0x2201e2){while(--_0x2201e2){_0x16d5e8['push'](_0x16d5e8['shift']());}};_0x204ec3(++_0x2f0188);}(_0xc613,0x115));var _0x3c61=function(_0x33470c,_0x5cebb){_0x33470c=_0x33470c-0x0;var _0x27d614=_0xc613[_0x33470c];return _0x27d614;};'use strict';var Sequelize=require(_0x3c61('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize[_0x3c61('0x1')]},'preproduction':{'type':Sequelize[_0x3c61('0x2')]('long'),'get':function(){if(this[_0x3c61('0x3')]('preproduction')){return this[_0x3c61('0x3')]('preproduction')[_0x3c61('0x4')]('utf8');}}},'production':{'type':Sequelize[_0x3c61('0x2')](_0x3c61('0x5')),'get':function(){if(this['getDataValue']('production')){return this[_0x3c61('0x3')]('production')[_0x3c61('0x4')](_0x3c61('0x6'));}}},'savedAt':{'type':Sequelize[_0x3c61('0x7')]},'publishedAt':{'type':Sequelize[_0x3c61('0x7')]}}; \ No newline at end of file +var _0x2533=['toString','long','production','utf8','DATE','sequelize','exports','STRING','BLOB','getDataValue','preproduction'];(function(_0x40b5b9,_0x5b5c46){var _0x57a439=function(_0x144102){while(--_0x144102){_0x40b5b9['push'](_0x40b5b9['shift']());}};_0x57a439(++_0x5b5c46);}(_0x2533,0x68));var _0x3253=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0x2533[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require(_0x3253('0x0'));module[_0x3253('0x1')]={'name':{'type':Sequelize[_0x3253('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3253('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3253('0x3')]('long'),'get':function(){if(this[_0x3253('0x4')](_0x3253('0x5'))){return this[_0x3253('0x4')](_0x3253('0x5'))[_0x3253('0x6')]('utf8');}}},'production':{'type':Sequelize[_0x3253('0x3')](_0x3253('0x7')),'get':function(){if(this[_0x3253('0x4')](_0x3253('0x8'))){return this[_0x3253('0x4')]('production')[_0x3253('0x6')](_0x3253('0x9'));}}},'savedAt':{'type':Sequelize[_0x3253('0xa')]},'publishedAt':{'type':Sequelize[_0x3253('0xa')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index c811a02..15e0cf9 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 _0x9e2e=['register','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','reject','save','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','index','map','SquareProject','rawAttributes','type','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','options','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','create','update','addUsers','removeUsers','ids','isArray','emit','userSquareProject:remove','User','order','getUsers','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter'];(function(_0x4beb3e,_0x31e777){var _0x28fe3a=function(_0xfed2fc){while(--_0xfed2fc){_0x4beb3e['push'](_0x4beb3e['shift']());}};_0x28fe3a(++_0x31e777);}(_0x9e2e,0x1b3));var _0xe9e2=function(_0x3d290c,_0xd4c2a9){_0x3d290c=_0x3d290c-0x0;var _0x5013bf=_0x9e2e[_0x3d290c];return _0x5013bf;};'use strict';var emlformat=require(_0xe9e2('0x0'));var rimraf=require(_0xe9e2('0x1'));var zipdir=require(_0xe9e2('0x2'));var jsonpatch=require(_0xe9e2('0x3'));var rp=require('request-promise');var moment=require(_0xe9e2('0x4'));var BPromise=require(_0xe9e2('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9e2('0x6'));var sox=require(_0xe9e2('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9e2('0x8'));var _=require('lodash');var squel=require(_0xe9e2('0x9'));var crypto=require(_0xe9e2('0xa'));var jsforce=require(_0xe9e2('0xb'));var deskjs=require(_0xe9e2('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe9e2('0xd'));var Papa=require(_0xe9e2('0xe'));var Redis=require(_0xe9e2('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9e2('0x10'));var hardwareService=require(_0xe9e2('0x11'));var logger=require(_0xe9e2('0x12'))('api');var utils=require(_0xe9e2('0x13'));var config=require(_0xe9e2('0x14'));var licenseUtil=require(_0xe9e2('0x15'));var db=require(_0xe9e2('0x16'))['db'];config[_0xe9e2('0x17')]=_['defaults'](config[_0xe9e2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9e2('0x18'))(new Redis(config[_0xe9e2('0x17')]));require('./squareProject.socket')[_0xe9e2('0x19')](socket);function respondWithStatusCode(_0x3d3c42,_0x2d6814){_0x2d6814=_0x2d6814||0xcc;return function(_0x70fcfe){if(_0x70fcfe){return _0x3d3c42[_0xe9e2('0x1a')](_0x2d6814);}return _0x3d3c42[_0xe9e2('0x1b')](_0x2d6814)[_0xe9e2('0x1c')]();};}function respondWithResult(_0x407c77,_0x1f12dd){_0x1f12dd=_0x1f12dd||0xc8;return function(_0x2d90a8){if(_0x2d90a8){return _0x407c77[_0xe9e2('0x1b')](_0x1f12dd)[_0xe9e2('0x1d')](_0x2d90a8);}};}function respondWithFilteredResult(_0x147336,_0x199cea){return function(_0x249101){if(_0x249101){var _0x37e5e4=typeof _0x199cea[_0xe9e2('0x1e')]===_0xe9e2('0x1f')&&typeof _0x199cea[_0xe9e2('0x20')]===_0xe9e2('0x1f');var _0x312b72=_0x249101['count'];var _0x2381da=_0x37e5e4?0x0:_0x199cea[_0xe9e2('0x1e')];var _0x2d9857=_0x37e5e4?_0x249101['count']:_0x199cea[_0xe9e2('0x1e')]+_0x199cea['limit'];var _0x33c26c;if(_0x2d9857>=_0x312b72){_0x2d9857=_0x312b72;_0x33c26c=0xc8;}else{_0x33c26c=0xce;}_0x147336[_0xe9e2('0x1b')](_0x33c26c);return _0x147336[_0xe9e2('0x21')](_0xe9e2('0x22'),_0x2381da+'-'+_0x2d9857+'/'+_0x312b72)[_0xe9e2('0x1d')](_0x249101);}return null;};}function patchUpdates(_0x14cc91){return function(_0x2f6cd2){try{jsonpatch['apply'](_0x2f6cd2,_0x14cc91,!![]);}catch(_0x46fc7e){return BPromise[_0xe9e2('0x23')](_0x46fc7e);}return _0x2f6cd2[_0xe9e2('0x24')]();};}function saveUpdates(_0x2adadf,_0x24eadb){return function(_0x329576){if(_0x329576){return _0x329576['update'](_0x2adadf)[_0xe9e2('0x25')](function(_0x29d791){return _0x29d791;});}return null;};}function removeEntity(_0x3f9661,_0x593d19){return function(_0x544ba1){if(_0x544ba1){return _0x544ba1[_0xe9e2('0x26')]()[_0xe9e2('0x25')](function(){var _0x55ac48=_0x544ba1[_0xe9e2('0x27')]({'plain':!![]});var _0x2a482b=_0xe9e2('0x28');return db[_0xe9e2('0x29')]['destroy']({'where':{'type':_0x2a482b,'resourceId':_0x55ac48['id']}})[_0xe9e2('0x25')](function(){return _0x544ba1;});})[_0xe9e2('0x25')](function(){_0x3f9661[_0xe9e2('0x1b')](0xcc)[_0xe9e2('0x1c')]();});}};}function handleEntityNotFound(_0x32f8c6,_0x4da60c){return function(_0x51c82c){if(!_0x51c82c){_0x32f8c6['sendStatus'](0x194);}return _0x51c82c;};}function handleError(_0x31ee56,_0x22c407){_0x22c407=_0x22c407||0x1f4;return function(_0x462352){logger[_0xe9e2('0x2a')](_0x462352[_0xe9e2('0x2b')]);if(_0x462352[_0xe9e2('0x2c')]){delete _0x462352[_0xe9e2('0x2c')];}_0x31ee56[_0xe9e2('0x1b')](_0x22c407)['send'](_0x462352);};}exports[_0xe9e2('0x2d')]=function(_0x33d818,_0x1f59f5){var _0x554fa1={},_0x291681={},_0x2924c0={'count':0x0,'rows':[]};var _0x1dbd10=_[_0xe9e2('0x2e')](db[_0xe9e2('0x2f')][_0xe9e2('0x30')],function(_0x59a2d9){return{'name':_0x59a2d9['fieldName'],'type':_0x59a2d9[_0xe9e2('0x31')]['key']};});_0x291681[_0xe9e2('0x32')]=_[_0xe9e2('0x2e')](_0x1dbd10,_0xe9e2('0x2c'));_0x291681['query']=_[_0xe9e2('0x33')](_0x33d818['query']);_0x291681[_0xe9e2('0x34')]=_[_0xe9e2('0x35')](_0x291681['model'],_0x291681[_0xe9e2('0x36')]);_0x554fa1[_0xe9e2('0x37')]=_[_0xe9e2('0x35')](_0x291681[_0xe9e2('0x32')],qs[_0xe9e2('0x38')](_0x33d818['query'][_0xe9e2('0x38')]));_0x554fa1[_0xe9e2('0x37')]=_0x554fa1[_0xe9e2('0x37')][_0xe9e2('0x39')]?_0x554fa1[_0xe9e2('0x37')]:_0x291681[_0xe9e2('0x32')];if(!_0x33d818[_0xe9e2('0x36')][_0xe9e2('0x3a')]('nolimit')){_0x554fa1[_0xe9e2('0x20')]=qs['limit'](_0x33d818['query']['limit']);_0x554fa1[_0xe9e2('0x1e')]=qs[_0xe9e2('0x1e')](_0x33d818['query'][_0xe9e2('0x1e')]);}_0x554fa1['order']=qs[_0xe9e2('0x3b')](_0x33d818[_0xe9e2('0x36')]['sort']);_0x554fa1[_0xe9e2('0x3c')]=qs[_0xe9e2('0x34')](_[_0xe9e2('0x3d')](_0x33d818['query'],_0x291681[_0xe9e2('0x34')]),_0x1dbd10);if(_0x33d818[_0xe9e2('0x36')][_0xe9e2('0x3e')]){_0x554fa1[_0xe9e2('0x3c')]=_['merge'](_0x554fa1[_0xe9e2('0x3c')],{'$or':_[_0xe9e2('0x2e')](_0x1dbd10,function(_0x3ab157){if(_0x3ab157['type']!=='VIRTUAL'){var _0x3b712e={};_0x3b712e[_0x3ab157[_0xe9e2('0x2c')]]={'$like':'%'+_0x33d818[_0xe9e2('0x36')][_0xe9e2('0x3e')]+'%'};return _0x3b712e;}})});}_0x554fa1=_[_0xe9e2('0x3f')]({},_0x554fa1,_0x33d818['options']);var _0x23f41c={'where':_0x554fa1['where']};return db[_0xe9e2('0x2f')][_0xe9e2('0x40')](_0x23f41c)[_0xe9e2('0x25')](function(_0x9763c3){_0x2924c0['count']=_0x9763c3;if(_0x33d818[_0xe9e2('0x36')][_0xe9e2('0x41')]){_0x554fa1[_0xe9e2('0x42')]=[{'all':!![]}];}return db[_0xe9e2('0x2f')][_0xe9e2('0x43')](_0x554fa1);})[_0xe9e2('0x25')](function(_0x118236){_0x2924c0[_0xe9e2('0x44')]=_0x118236;return _0x2924c0;})['then'](respondWithFilteredResult(_0x1f59f5,_0x554fa1))[_0xe9e2('0x45')](handleError(_0x1f59f5,null));};exports[_0xe9e2('0x46')]=function(_0x2cb7de,_0xfc2002){var _0xb6dfd0={'raw':![],'where':{'id':_0x2cb7de[_0xe9e2('0x47')]['id']}},_0xc4b5bf={};_0xc4b5bf[_0xe9e2('0x32')]=_[_0xe9e2('0x33')](db[_0xe9e2('0x2f')][_0xe9e2('0x30')]);_0xc4b5bf['query']=_[_0xe9e2('0x33')](_0x2cb7de[_0xe9e2('0x36')]);_0xc4b5bf['filters']=_[_0xe9e2('0x35')](_0xc4b5bf['model'],_0xc4b5bf[_0xe9e2('0x36')]);_0xb6dfd0[_0xe9e2('0x37')]=_[_0xe9e2('0x35')](_0xc4b5bf['model'],qs[_0xe9e2('0x38')](_0x2cb7de[_0xe9e2('0x36')][_0xe9e2('0x38')]));_0xb6dfd0[_0xe9e2('0x37')]=_0xb6dfd0['attributes'][_0xe9e2('0x39')]?_0xb6dfd0[_0xe9e2('0x37')]:_0xc4b5bf[_0xe9e2('0x32')];if(_0x2cb7de['query'][_0xe9e2('0x41')]){_0xb6dfd0[_0xe9e2('0x42')]=[{'all':!![]}];}_0xb6dfd0=_['merge']({},_0xb6dfd0,_0x2cb7de[_0xe9e2('0x48')]);return db['SquareProject']['find'](_0xb6dfd0)[_0xe9e2('0x25')](handleEntityNotFound(_0xfc2002,null))['then'](respondWithResult(_0xfc2002,null))[_0xe9e2('0x45')](handleError(_0xfc2002,null));};exports['create']=function(_0x29a2fe,_0x3a798a){return db['SquareProject']['create'](_0x29a2fe[_0xe9e2('0x49')],{})['then'](function(_0x28b41e){var _0x293f83=_0x29a2fe[_0xe9e2('0x4a')][_0xe9e2('0x27')]({'plain':!![]});if(!_0x293f83)throw new Error(_0xe9e2('0x4b'));if(_0x293f83[_0xe9e2('0x4c')]===_0xe9e2('0x4a')){var _0x625c4d=_0x28b41e[_0xe9e2('0x27')]({'plain':!![]});var _0x7c8676=_0xe9e2('0x28');return db['UserProfileSection'][_0xe9e2('0x4d')]({'where':{'name':_0x7c8676,'userProfileId':_0x293f83[_0xe9e2('0x4e')]},'raw':!![]})['then'](function(_0x246860){if(_0x246860&&_0x246860[_0xe9e2('0x4f')]===0x0){return db['UserProfileResource'][_0xe9e2('0x50')]({'name':_0x625c4d[_0xe9e2('0x2c')],'resourceId':_0x625c4d['id'],'type':_0x246860[_0xe9e2('0x2c')],'sectionId':_0x246860['id']},{})[_0xe9e2('0x25')](function(){return _0x28b41e;});}else{return _0x28b41e;}})[_0xe9e2('0x45')](function(_0x5c8f2f){logger[_0xe9e2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5c8f2f);throw _0x5c8f2f;});}return _0x28b41e;})['then'](respondWithResult(_0x3a798a,0xc9))[_0xe9e2('0x45')](handleError(_0x3a798a,null));};exports[_0xe9e2('0x51')]=function(_0x30d9d0,_0x4ad6de){if(_0x30d9d0[_0xe9e2('0x49')]['id']){delete _0x30d9d0[_0xe9e2('0x49')]['id'];}return db[_0xe9e2('0x2f')][_0xe9e2('0x4d')]({'where':{'id':_0x30d9d0[_0xe9e2('0x47')]['id']}})[_0xe9e2('0x25')](handleEntityNotFound(_0x4ad6de,null))[_0xe9e2('0x25')](saveUpdates(_0x30d9d0['body'],null))[_0xe9e2('0x25')](respondWithResult(_0x4ad6de,null))[_0xe9e2('0x45')](handleError(_0x4ad6de,null));};exports['destroy']=function(_0x7c1b03,_0x2eb675){return db[_0xe9e2('0x2f')]['find']({'where':{'id':_0x7c1b03[_0xe9e2('0x47')]['id']}})[_0xe9e2('0x25')](handleEntityNotFound(_0x2eb675,null))[_0xe9e2('0x25')](removeEntity(_0x2eb675,null))[_0xe9e2('0x45')](handleError(_0x2eb675,null));};exports[_0xe9e2('0x52')]=function(_0x357f5c,_0x349c41,_0x4243e7){return db[_0xe9e2('0x2f')][_0xe9e2('0x4d')]({'where':{'id':_0x357f5c[_0xe9e2('0x47')]['id']}})[_0xe9e2('0x25')](handleEntityNotFound(_0x349c41,null))[_0xe9e2('0x25')](function(_0x27d0d7){if(_0x27d0d7){return _0x27d0d7['addUsers'](_0x357f5c[_0xe9e2('0x49')]['ids'],_['omit'](_0x357f5c[_0xe9e2('0x49')],['ids','id'])||{});}})[_0xe9e2('0x25')](respondWithResult(_0x349c41,null))[_0xe9e2('0x45')](handleError(_0x349c41,null));};exports[_0xe9e2('0x53')]=function(_0x3308b4,_0x5c7fd4,_0x136f99){return db[_0xe9e2('0x2f')][_0xe9e2('0x4d')]({'where':{'id':_0x3308b4[_0xe9e2('0x47')]['id']}})[_0xe9e2('0x25')](handleEntityNotFound(_0x5c7fd4,null))[_0xe9e2('0x25')](function(_0x281ceb){if(_0x281ceb){return _0x281ceb[_0xe9e2('0x53')](_0x3308b4[_0xe9e2('0x36')][_0xe9e2('0x54')])[_0xe9e2('0x25')](function(){if(_[_0xe9e2('0x55')](_0x3308b4['query']['ids'])){for(var _0x1d4a59=0x0;_0x1d4a59<_0x3308b4['query'][_0xe9e2('0x54')][_0xe9e2('0x39')];_0x1d4a59+=0x1){socket[_0xe9e2('0x56')](_0xe9e2('0x57'),{'UserId':Number(_0x3308b4[_0xe9e2('0x36')][_0xe9e2('0x54')][_0x1d4a59]),'SquareProjectId':Number(_0x3308b4[_0xe9e2('0x47')]['id'])});}}else{socket[_0xe9e2('0x56')](_0xe9e2('0x57'),{'UserId':Number(_0x3308b4[_0xe9e2('0x36')][_0xe9e2('0x54')]),'SquareProjectId':Number(_0x3308b4[_0xe9e2('0x47')]['id'])});}});}})[_0xe9e2('0x25')](respondWithStatusCode(_0x5c7fd4,null))[_0xe9e2('0x45')](handleError(_0x5c7fd4,null));};exports['getUsers']=function(_0x39ba6c,_0x19ab9f,_0x32da69){var _0x8256da={};var _0x590037={};var _0x50279b;var _0x3ea502;return db[_0xe9e2('0x2f')]['findOne']({'where':{'id':_0x39ba6c[_0xe9e2('0x47')]['id']}})[_0xe9e2('0x25')](handleEntityNotFound(_0x19ab9f,null))[_0xe9e2('0x25')](function(_0x32a561){if(_0x32a561){_0x50279b=_0x32a561;_0x590037[_0xe9e2('0x32')]=_['keys'](db[_0xe9e2('0x58')][_0xe9e2('0x30')]);_0x590037[_0xe9e2('0x36')]=_['keys'](_0x39ba6c['query']);_0x590037[_0xe9e2('0x34')]=_[_0xe9e2('0x35')](_0x590037[_0xe9e2('0x32')],_0x590037[_0xe9e2('0x36')]);_0x8256da[_0xe9e2('0x37')]=_[_0xe9e2('0x35')](_0x590037[_0xe9e2('0x32')],qs['fields'](_0x39ba6c[_0xe9e2('0x36')][_0xe9e2('0x38')]));_0x8256da[_0xe9e2('0x37')]=_0x8256da[_0xe9e2('0x37')][_0xe9e2('0x39')]?_0x8256da[_0xe9e2('0x37')]:_0x590037[_0xe9e2('0x32')];_0x8256da[_0xe9e2('0x59')]=qs[_0xe9e2('0x3b')](_0x39ba6c['query'][_0xe9e2('0x3b')]);_0x8256da['where']=qs['filters'](_[_0xe9e2('0x3d')](_0x39ba6c['query'],_0x590037[_0xe9e2('0x34')]));if(_0x39ba6c[_0xe9e2('0x36')][_0xe9e2('0x3e')]){_0x8256da[_0xe9e2('0x3c')]=_[_0xe9e2('0x3f')](_0x8256da['where'],{'$or':_[_0xe9e2('0x2e')](_0x8256da[_0xe9e2('0x37')],function(_0x1ed82f){var _0x30aa9f={};_0x30aa9f[_0x1ed82f]={'$like':'%'+_0x39ba6c[_0xe9e2('0x36')][_0xe9e2('0x3e')]+'%'};return _0x30aa9f;})});}_0x8256da=_['merge']({},_0x8256da,_0x39ba6c[_0xe9e2('0x48')]);return _0x50279b[_0xe9e2('0x5a')](_0x8256da);}})[_0xe9e2('0x25')](function(_0x4f7a06){if(_0x4f7a06){_0x3ea502=_0x4f7a06[_0xe9e2('0x39')];if(!_0x39ba6c[_0xe9e2('0x36')][_0xe9e2('0x3a')](_0xe9e2('0x5b'))){_0x8256da[_0xe9e2('0x20')]=qs['limit'](_0x39ba6c['query']['limit']);_0x8256da[_0xe9e2('0x1e')]=qs[_0xe9e2('0x1e')](_0x39ba6c[_0xe9e2('0x36')][_0xe9e2('0x1e')]);}return _0x50279b[_0xe9e2('0x5a')](_0x8256da);}})[_0xe9e2('0x25')](function(_0x5897aa){if(_0x5897aa){return _0x5897aa?{'count':_0x3ea502,'rows':_0x5897aa}:null;}})[_0xe9e2('0x25')](respondWithResult(_0x19ab9f,null))['catch'](handleError(_0x19ab9f,null));}; \ No newline at end of file +var _0xa2ce=['name','send','index','SquareProject','rawAttributes','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','findOne','User','order','hasOwnProperty','getUsers','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','get','SquareProjects','UserProfileResource','destroy','end'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xa2ce,0x1b1));var _0xea2c=function(_0x57e8e9,_0x59b275){_0x57e8e9=_0x57e8e9-0x0;var _0x1f1a6d=_0xa2ce[_0x57e8e9];return _0x1f1a6d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xea2c('0x0'));var zipdir=require(_0xea2c('0x1'));var jsonpatch=require(_0xea2c('0x2'));var rp=require(_0xea2c('0x3'));var moment=require(_0xea2c('0x4'));var BPromise=require(_0xea2c('0x5'));var Mustache=require(_0xea2c('0x6'));var util=require(_0xea2c('0x7'));var path=require('path');var sox=require(_0xea2c('0x8'));var csv=require(_0xea2c('0x9'));var ejs=require(_0xea2c('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xea2c('0xb'));var squel=require(_0xea2c('0xc'));var crypto=require('crypto');var jsforce=require(_0xea2c('0xd'));var deskjs=require(_0xea2c('0xe'));var toCsv=require(_0xea2c('0x9'));var querystring=require(_0xea2c('0xf'));var Papa=require('papaparse');var Redis=require(_0xea2c('0x10'));var authService=require(_0xea2c('0x11'));var qs=require(_0xea2c('0x12'));var as=require(_0xea2c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xea2c('0x14'));var config=require(_0xea2c('0x15'));var licenseUtil=require(_0xea2c('0x16'));var db=require(_0xea2c('0x17'))['db'];config[_0xea2c('0x18')]=_[_0xea2c('0x19')](config['redis'],{'host':_0xea2c('0x1a'),'port':0x18eb});var socket=require(_0xea2c('0x1b'))(new Redis(config[_0xea2c('0x18')]));require(_0xea2c('0x1c'))[_0xea2c('0x1d')](socket);function respondWithStatusCode(_0x323743,_0x4f2584){_0x4f2584=_0x4f2584||0xcc;return function(_0x4142ac){if(_0x4142ac){return _0x323743[_0xea2c('0x1e')](_0x4f2584);}return _0x323743['status'](_0x4f2584)['end']();};}function respondWithResult(_0x1dd3f4,_0x551cc3){_0x551cc3=_0x551cc3||0xc8;return function(_0x486168){if(_0x486168){return _0x1dd3f4[_0xea2c('0x1f')](_0x551cc3)['json'](_0x486168);}};}function respondWithFilteredResult(_0xd1a4e2,_0x20f504){return function(_0x907b69){if(_0x907b69){var _0x2db0e8=typeof _0x20f504[_0xea2c('0x20')]===_0xea2c('0x21')&&typeof _0x20f504[_0xea2c('0x22')]===_0xea2c('0x21');var _0x466ac1=_0x907b69[_0xea2c('0x23')];var _0x176025=_0x2db0e8?0x0:_0x20f504['offset'];var _0x36d630=_0x2db0e8?_0x907b69['count']:_0x20f504[_0xea2c('0x20')]+_0x20f504[_0xea2c('0x22')];var _0x23bc93;if(_0x36d630>=_0x466ac1){_0x36d630=_0x466ac1;_0x23bc93=0xc8;}else{_0x23bc93=0xce;}_0xd1a4e2[_0xea2c('0x1f')](_0x23bc93);return _0xd1a4e2[_0xea2c('0x24')](_0xea2c('0x25'),_0x176025+'-'+_0x36d630+'/'+_0x466ac1)['json'](_0x907b69);}return null;};}function patchUpdates(_0x20b377){return function(_0x28dfd6){try{jsonpatch[_0xea2c('0x26')](_0x28dfd6,_0x20b377,!![]);}catch(_0x1f2c1e){return BPromise[_0xea2c('0x27')](_0x1f2c1e);}return _0x28dfd6['save']();};}function saveUpdates(_0x412445,_0x2c410d){return function(_0x15ca4e){if(_0x15ca4e){return _0x15ca4e[_0xea2c('0x28')](_0x412445)[_0xea2c('0x29')](function(_0x14767c){return _0x14767c;});}return null;};}function removeEntity(_0x510513,_0x2871aa){return function(_0x1024c3){if(_0x1024c3){return _0x1024c3['destroy']()[_0xea2c('0x29')](function(){var _0x4e2f03=_0x1024c3[_0xea2c('0x2a')]({'plain':!![]});var _0x3f9cfe=_0xea2c('0x2b');return db[_0xea2c('0x2c')][_0xea2c('0x2d')]({'where':{'type':_0x3f9cfe,'resourceId':_0x4e2f03['id']}})[_0xea2c('0x29')](function(){return _0x1024c3;});})[_0xea2c('0x29')](function(){_0x510513[_0xea2c('0x1f')](0xcc)[_0xea2c('0x2e')]();});}};}function handleEntityNotFound(_0x539222,_0x1f542e){return function(_0x4afacb){if(!_0x4afacb){_0x539222[_0xea2c('0x1e')](0x194);}return _0x4afacb;};}function handleError(_0x21b786,_0x5b7bb3){_0x5b7bb3=_0x5b7bb3||0x1f4;return function(_0x5a4b3f){logger['error'](_0x5a4b3f['stack']);if(_0x5a4b3f[_0xea2c('0x2f')]){delete _0x5a4b3f[_0xea2c('0x2f')];}_0x21b786[_0xea2c('0x1f')](_0x5b7bb3)[_0xea2c('0x30')](_0x5a4b3f);};}exports[_0xea2c('0x31')]=function(_0x34b5f5,_0x5a2876){var _0x4f90b5={},_0x6704aa={},_0x3064fc={'count':0x0,'rows':[]};var _0xa3b2fd=_['map'](db[_0xea2c('0x32')][_0xea2c('0x33')],function(_0xb78cf1){return{'name':_0xb78cf1['fieldName'],'type':_0xb78cf1['type'][_0xea2c('0x34')]};});_0x6704aa[_0xea2c('0x35')]=_[_0xea2c('0x36')](_0xa3b2fd,'name');_0x6704aa[_0xea2c('0x37')]=_[_0xea2c('0x38')](_0x34b5f5[_0xea2c('0x37')]);_0x6704aa[_0xea2c('0x39')]=_[_0xea2c('0x3a')](_0x6704aa[_0xea2c('0x35')],_0x6704aa[_0xea2c('0x37')]);_0x4f90b5[_0xea2c('0x3b')]=_['intersection'](_0x6704aa[_0xea2c('0x35')],qs[_0xea2c('0x3c')](_0x34b5f5[_0xea2c('0x37')][_0xea2c('0x3c')]));_0x4f90b5['attributes']=_0x4f90b5[_0xea2c('0x3b')][_0xea2c('0x3d')]?_0x4f90b5[_0xea2c('0x3b')]:_0x6704aa[_0xea2c('0x35')];if(!_0x34b5f5[_0xea2c('0x37')]['hasOwnProperty'](_0xea2c('0x3e'))){_0x4f90b5[_0xea2c('0x22')]=qs[_0xea2c('0x22')](_0x34b5f5[_0xea2c('0x37')][_0xea2c('0x22')]);_0x4f90b5[_0xea2c('0x20')]=qs[_0xea2c('0x20')](_0x34b5f5['query'][_0xea2c('0x20')]);}_0x4f90b5['order']=qs[_0xea2c('0x3f')](_0x34b5f5[_0xea2c('0x37')][_0xea2c('0x3f')]);_0x4f90b5['where']=qs[_0xea2c('0x39')](_['pick'](_0x34b5f5[_0xea2c('0x37')],_0x6704aa[_0xea2c('0x39')]),_0xa3b2fd);if(_0x34b5f5['query'][_0xea2c('0x40')]){_0x4f90b5[_0xea2c('0x41')]=_[_0xea2c('0x42')](_0x4f90b5['where'],{'$or':_[_0xea2c('0x36')](_0xa3b2fd,function(_0x2ccab4){if(_0x2ccab4['type']!==_0xea2c('0x43')){var _0x4e23c7={};_0x4e23c7[_0x2ccab4['name']]={'$like':'%'+_0x34b5f5[_0xea2c('0x37')][_0xea2c('0x40')]+'%'};return _0x4e23c7;}})});}_0x4f90b5=_[_0xea2c('0x42')]({},_0x4f90b5,_0x34b5f5[_0xea2c('0x44')]);var _0x1a2a63={'where':_0x4f90b5[_0xea2c('0x41')]};return db[_0xea2c('0x32')][_0xea2c('0x23')](_0x1a2a63)[_0xea2c('0x29')](function(_0x172618){_0x3064fc[_0xea2c('0x23')]=_0x172618;if(_0x34b5f5[_0xea2c('0x37')]['includeAll']){_0x4f90b5[_0xea2c('0x45')]=[{'all':!![]}];}return db[_0xea2c('0x32')][_0xea2c('0x46')](_0x4f90b5);})[_0xea2c('0x29')](function(_0x14e904){_0x3064fc[_0xea2c('0x47')]=_0x14e904;return _0x3064fc;})[_0xea2c('0x29')](respondWithFilteredResult(_0x5a2876,_0x4f90b5))[_0xea2c('0x48')](handleError(_0x5a2876,null));};exports[_0xea2c('0x49')]=function(_0x52fff5,_0x30f8c5){var _0x57c79a={'raw':![],'where':{'id':_0x52fff5[_0xea2c('0x4a')]['id']}},_0x9a57e3={};_0x9a57e3[_0xea2c('0x35')]=_[_0xea2c('0x38')](db[_0xea2c('0x32')][_0xea2c('0x33')]);_0x9a57e3[_0xea2c('0x37')]=_[_0xea2c('0x38')](_0x52fff5[_0xea2c('0x37')]);_0x9a57e3[_0xea2c('0x39')]=_[_0xea2c('0x3a')](_0x9a57e3['model'],_0x9a57e3[_0xea2c('0x37')]);_0x57c79a[_0xea2c('0x3b')]=_['intersection'](_0x9a57e3[_0xea2c('0x35')],qs['fields'](_0x52fff5['query'][_0xea2c('0x3c')]));_0x57c79a[_0xea2c('0x3b')]=_0x57c79a[_0xea2c('0x3b')][_0xea2c('0x3d')]?_0x57c79a[_0xea2c('0x3b')]:_0x9a57e3[_0xea2c('0x35')];if(_0x52fff5[_0xea2c('0x37')][_0xea2c('0x4b')]){_0x57c79a['include']=[{'all':!![]}];}_0x57c79a=_['merge']({},_0x57c79a,_0x52fff5[_0xea2c('0x44')]);return db[_0xea2c('0x32')][_0xea2c('0x4c')](_0x57c79a)['then'](handleEntityNotFound(_0x30f8c5,null))['then'](respondWithResult(_0x30f8c5,null))['catch'](handleError(_0x30f8c5,null));};exports[_0xea2c('0x4d')]=function(_0xc44b2c,_0x248859){return db[_0xea2c('0x32')][_0xea2c('0x4d')](_0xc44b2c[_0xea2c('0x4e')],{})[_0xea2c('0x29')](function(_0x4db4b6){var _0x2e1f23=_0xc44b2c[_0xea2c('0x4f')]['get']({'plain':!![]});if(!_0x2e1f23)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2e1f23[_0xea2c('0x50')]==='user'){var _0x4fb8ca=_0x4db4b6[_0xea2c('0x2a')]({'plain':!![]});var _0x2c5e13='SquareProjects';return db[_0xea2c('0x51')][_0xea2c('0x4c')]({'where':{'name':_0x2c5e13,'userProfileId':_0x2e1f23['userProfileId']},'raw':!![]})['then'](function(_0x2a8bbe){if(_0x2a8bbe&&_0x2a8bbe['autoAssociation']===0x0){return db[_0xea2c('0x2c')][_0xea2c('0x4d')]({'name':_0x4fb8ca['name'],'resourceId':_0x4fb8ca['id'],'type':_0x2a8bbe['name'],'sectionId':_0x2a8bbe['id']},{})[_0xea2c('0x29')](function(){return _0x4db4b6;});}else{return _0x4db4b6;}})[_0xea2c('0x48')](function(_0x179252){logger[_0xea2c('0x52')](_0xea2c('0x53'),_0x179252);throw _0x179252;});}return _0x4db4b6;})[_0xea2c('0x29')](respondWithResult(_0x248859,0xc9))['catch'](handleError(_0x248859,null));};exports[_0xea2c('0x28')]=function(_0x4e8ad1,_0x421c3d){if(_0x4e8ad1[_0xea2c('0x4e')]['id']){delete _0x4e8ad1[_0xea2c('0x4e')]['id'];}return db[_0xea2c('0x32')][_0xea2c('0x4c')]({'where':{'id':_0x4e8ad1['params']['id']}})[_0xea2c('0x29')](handleEntityNotFound(_0x421c3d,null))[_0xea2c('0x29')](saveUpdates(_0x4e8ad1['body'],null))[_0xea2c('0x29')](respondWithResult(_0x421c3d,null))[_0xea2c('0x48')](handleError(_0x421c3d,null));};exports[_0xea2c('0x2d')]=function(_0x5469cc,_0x2b2995){return db[_0xea2c('0x32')][_0xea2c('0x4c')]({'where':{'id':_0x5469cc['params']['id']}})[_0xea2c('0x29')](handleEntityNotFound(_0x2b2995,null))['then'](removeEntity(_0x2b2995,null))[_0xea2c('0x48')](handleError(_0x2b2995,null));};exports[_0xea2c('0x54')]=function(_0x17ab2f,_0x4de576,_0x53ad33){return db[_0xea2c('0x32')]['find']({'where':{'id':_0x17ab2f[_0xea2c('0x4a')]['id']}})[_0xea2c('0x29')](handleEntityNotFound(_0x4de576,null))[_0xea2c('0x29')](function(_0x31ee36){if(_0x31ee36){return _0x31ee36[_0xea2c('0x54')](_0x17ab2f[_0xea2c('0x4e')][_0xea2c('0x55')],_[_0xea2c('0x56')](_0x17ab2f['body'],['ids','id'])||{});}})[_0xea2c('0x29')](respondWithResult(_0x4de576,null))['catch'](handleError(_0x4de576,null));};exports[_0xea2c('0x57')]=function(_0x49ce77,_0x5ed301,_0x34c5fc){return db[_0xea2c('0x32')][_0xea2c('0x4c')]({'where':{'id':_0x49ce77[_0xea2c('0x4a')]['id']}})[_0xea2c('0x29')](handleEntityNotFound(_0x5ed301,null))[_0xea2c('0x29')](function(_0x15022c){if(_0x15022c){return _0x15022c[_0xea2c('0x57')](_0x49ce77[_0xea2c('0x37')][_0xea2c('0x55')])[_0xea2c('0x29')](function(){if(_[_0xea2c('0x58')](_0x49ce77['query'][_0xea2c('0x55')])){for(var _0x413bab=0x0;_0x413bab<_0x49ce77['query'][_0xea2c('0x55')][_0xea2c('0x3d')];_0x413bab+=0x1){socket[_0xea2c('0x59')](_0xea2c('0x5a'),{'UserId':Number(_0x49ce77[_0xea2c('0x37')][_0xea2c('0x55')][_0x413bab]),'SquareProjectId':Number(_0x49ce77[_0xea2c('0x4a')]['id'])});}}else{socket[_0xea2c('0x59')](_0xea2c('0x5a'),{'UserId':Number(_0x49ce77[_0xea2c('0x37')][_0xea2c('0x55')]),'SquareProjectId':Number(_0x49ce77[_0xea2c('0x4a')]['id'])});}});}})[_0xea2c('0x29')](respondWithStatusCode(_0x5ed301,null))[_0xea2c('0x48')](handleError(_0x5ed301,null));};exports['getUsers']=function(_0x5c2c6b,_0x382ceb,_0x7b3796){var _0x5c9f87={};var _0x4c64b1={};var _0x894395;var _0xb4390a;return db[_0xea2c('0x32')][_0xea2c('0x5b')]({'where':{'id':_0x5c2c6b[_0xea2c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x382ceb,null))['then'](function(_0x4a9eef){if(_0x4a9eef){_0x894395=_0x4a9eef;_0x4c64b1[_0xea2c('0x35')]=_['keys'](db[_0xea2c('0x5c')]['rawAttributes']);_0x4c64b1[_0xea2c('0x37')]=_[_0xea2c('0x38')](_0x5c2c6b['query']);_0x4c64b1[_0xea2c('0x39')]=_[_0xea2c('0x3a')](_0x4c64b1[_0xea2c('0x35')],_0x4c64b1['query']);_0x5c9f87[_0xea2c('0x3b')]=_[_0xea2c('0x3a')](_0x4c64b1['model'],qs[_0xea2c('0x3c')](_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x3c')]));_0x5c9f87[_0xea2c('0x3b')]=_0x5c9f87['attributes'][_0xea2c('0x3d')]?_0x5c9f87[_0xea2c('0x3b')]:_0x4c64b1['model'];_0x5c9f87[_0xea2c('0x5d')]=qs['sort'](_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x3f')]);_0x5c9f87['where']=qs[_0xea2c('0x39')](_['pick'](_0x5c2c6b['query'],_0x4c64b1['filters']));if(_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x40')]){_0x5c9f87[_0xea2c('0x41')]=_[_0xea2c('0x42')](_0x5c9f87['where'],{'$or':_[_0xea2c('0x36')](_0x5c9f87['attributes'],function(_0x3850a0){var _0x10abf3={};_0x10abf3[_0x3850a0]={'$like':'%'+_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x40')]+'%'};return _0x10abf3;})});}_0x5c9f87=_[_0xea2c('0x42')]({},_0x5c9f87,_0x5c2c6b['options']);return _0x894395['getUsers'](_0x5c9f87);}})[_0xea2c('0x29')](function(_0x49a4ad){if(_0x49a4ad){_0xb4390a=_0x49a4ad[_0xea2c('0x3d')];if(!_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x5e')](_0xea2c('0x3e'))){_0x5c9f87[_0xea2c('0x22')]=qs[_0xea2c('0x22')](_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x22')]);_0x5c9f87[_0xea2c('0x20')]=qs['offset'](_0x5c2c6b[_0xea2c('0x37')][_0xea2c('0x20')]);}return _0x894395[_0xea2c('0x5f')](_0x5c9f87);}})[_0xea2c('0x29')](function(_0x33ef19){if(_0x33ef19){return _0x33ef19?{'count':_0xb4390a,'rows':_0x33ef19}:null;}})[_0xea2c('0x29')](respondWithResult(_0x382ceb,null))[_0xea2c('0x48')](handleError(_0x382ceb,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 7e44593..0e6562c 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 _0xa339=['SquareProject','save','remove','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0x5c7970,_0x30716f){var _0x5e0466=function(_0x1469ea){while(--_0x1469ea){_0x5c7970['push'](_0x5c7970['shift']());}};_0x5e0466(++_0x30716f);}(_0xa339,0x19e));var _0x9a33=function(_0x496ee0,_0x5e592f){_0x496ee0=_0x496ee0-0x0;var _0x5bc3f9=_0xa339[_0x496ee0];return _0x5bc3f9;};'use strict';var EventEmitter=require(_0x9a33('0x0'));var SquareProject=require(_0x9a33('0x1'))['db'][_0x9a33('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a33('0x3'),'afterUpdate':'update','afterDestroy':_0x9a33('0x4')};function emitEvent(_0x1812a0){return function(_0x1d294a,_0x3628b2,_0x34e6a1){SquareProjectEvents['emit'](_0x1812a0+':'+_0x1d294a['id'],_0x1d294a);SquareProjectEvents[_0x9a33('0x5')](_0x1812a0,_0x1d294a);_0x34e6a1(null);};}for(var e in events){if(events[_0x9a33('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0x9a33('0x7')]=SquareProjectEvents; \ No newline at end of file +var _0x2d13=['setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x2d13,0x11f));var _0x32d1=function(_0x3c9712,_0x17de56){_0x3c9712=_0x3c9712-0x0;var _0x3bbe83=_0x2d13[_0x3c9712];return _0x3bbe83;};'use strict';var EventEmitter=require(_0x32d1('0x0'));var SquareProject=require(_0x32d1('0x1'))['db'][_0x32d1('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x32d1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32d1('0x4'),'afterDestroy':_0x32d1('0x5')};function emitEvent(_0x4c890d){return function(_0xd8c566,_0x50d800,_0x279485){SquareProjectEvents['emit'](_0x4c890d+':'+_0xd8c566['id'],_0xd8c566);SquareProjectEvents[_0x32d1('0x6')](_0x4c890d,_0xd8c566);_0x279485(null);};}for(var e in events){if(events[_0x32d1('0x7')](e)){var event=events[e];SquareProject[_0x32d1('0x8')](e,emitEvent(event));}}module[_0x32d1('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 f2a748e..3a9177a 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 _0x39f8=['define','SquareProject','square_projects','changed','preproduction','savedAt','format','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x52cbe0,_0x332b2e){var _0x4bb9da=function(_0x4f8008){while(--_0x4f8008){_0x52cbe0['push'](_0x52cbe0['shift']());}};_0x4bb9da(++_0x332b2e);}(_0x39f8,0x1bf));var _0x839f=function(_0x4b9de6,_0x13df0b){_0x4b9de6=_0x4b9de6-0x0;var _0xe412e0=_0x39f8[_0x4b9de6];return _0xe412e0;};'use strict';var _=require('lodash');var util=require(_0x839f('0x0'));var logger=require(_0x839f('0x1'))('api');var moment=require(_0x839f('0x2'));var BPromise=require(_0x839f('0x3'));var rp=require(_0x839f('0x4'));var fs=require('fs');var path=require(_0x839f('0x5'));var rimraf=require(_0x839f('0x6'));var config=require(_0x839f('0x7'));var attributes=require('./squareProject.attributes');module[_0x839f('0x8')]=function(_0x52bcbe,_0x45449a){return _0x52bcbe[_0x839f('0x9')](_0x839f('0xa'),attributes,{'tableName':_0x839f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x520605,_0x458641,_0x4dfd05){if(_0x520605[_0x839f('0xc')](_0x839f('0xd'))){_0x520605[_0x839f('0xe')]=moment()[_0x839f('0xf')](_0x839f('0x10'));}if(_0x520605[_0x839f('0xc')](_0x839f('0x11'))){_0x520605[_0x839f('0x12')]=moment()[_0x839f('0xf')](_0x839f('0x10'));}_0x4dfd05(null,_0x520605);}}});}; \ No newline at end of file +var _0x7cd2=['../../config/environment','./squareProject.attributes','exports','SquareProject','changed','preproduction','savedAt','YYYY-MM-DD\x20HH:mm:ss','production','publishedAt','util','../../config/logger','api','request-promise','rimraf'];(function(_0x299edd,_0x3c304b){var _0x143905=function(_0x3f46e9){while(--_0x3f46e9){_0x299edd['push'](_0x299edd['shift']());}};_0x143905(++_0x3c304b);}(_0x7cd2,0x118));var _0x27cd=function(_0x490d93,_0xdeee67){_0x490d93=_0x490d93-0x0;var _0x3535df=_0x7cd2[_0x490d93];return _0x3535df;};'use strict';var _=require('lodash');var util=require(_0x27cd('0x0'));var logger=require(_0x27cd('0x1'))(_0x27cd('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x27cd('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x27cd('0x4'));var config=require(_0x27cd('0x5'));var attributes=require(_0x27cd('0x6'));module[_0x27cd('0x7')]=function(_0x2646a9,_0x38098b){return _0x2646a9['define'](_0x27cd('0x8'),attributes,{'tableName':'square_projects','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x401122,_0x24a922,_0x5a248c){if(_0x401122[_0x27cd('0x9')](_0x27cd('0xa'))){_0x401122[_0x27cd('0xb')]=moment()['format'](_0x27cd('0xc'));}if(_0x401122[_0x27cd('0x9')](_0x27cd('0xd'))){_0x401122[_0x27cd('0xe')]=moment()['format'](_0x27cd('0xc'));}_0x5a248c(null,_0x401122);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 6d1465e..16c6b58 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 _0x2e69=['stringify','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./squareProject.socket','register','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','ShowSquareProject','SquareProject','find','options','raw','attributes','include','map','model'];(function(_0x3d889d,_0x4b153d){var _0x13edaf=function(_0x540b7d){while(--_0x540b7d){_0x3d889d['push'](_0x3d889d['shift']());}};_0x13edaf(++_0x4b153d);}(_0x2e69,0x158));var _0x92e6=function(_0x48d393,_0x383205){_0x48d393=_0x48d393-0x0;var _0x2e0312=_0x2e69[_0x48d393];return _0x2e0312;};'use strict';var _=require(_0x92e6('0x0'));var util=require(_0x92e6('0x1'));var moment=require(_0x92e6('0x2'));var BPromise=require(_0x92e6('0x3'));var rs=require(_0x92e6('0x4'));var fs=require('fs');var Redis=require(_0x92e6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x92e6('0x6'));var logger=require('../../config/logger')(_0x92e6('0x7'));var config=require(_0x92e6('0x8'));var jayson=require(_0x92e6('0x9'));var client=jayson[_0x92e6('0xa')][_0x92e6('0xb')]({'port':0x232a});config['redis']=_[_0x92e6('0xc')](config[_0x92e6('0xd')],{'host':_0x92e6('0xe'),'port':0x18eb});var socket=require(_0x92e6('0xf'))(new Redis(config[_0x92e6('0xd')]));require(_0x92e6('0x10'))[_0x92e6('0x11')](socket);function respondWithRpcPromise(_0x1536cf,_0x1b0a85,_0x11f24f){return new BPromise(function(_0x17452e,_0x35ae52){return client['request'](_0x1536cf,_0x11f24f)[_0x92e6('0x12')](function(_0x5432aa){logger['info'](_0x92e6('0x13'),_0x1b0a85,_0x92e6('0x14'));logger[_0x92e6('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x1b0a85,'request\x20sent',JSON['stringify'](_0x5432aa));if(_0x5432aa[_0x92e6('0x16')]){if(_0x5432aa[_0x92e6('0x16')][_0x92e6('0x17')]===0x1f4){logger[_0x92e6('0x16')](_0x92e6('0x13'),_0x1b0a85,_0x5432aa[_0x92e6('0x16')]['message']);return _0x35ae52(_0x5432aa['error'][_0x92e6('0x18')]);}logger[_0x92e6('0x16')](_0x92e6('0x13'),_0x1b0a85,_0x5432aa['error'][_0x92e6('0x18')]);return _0x17452e(_0x5432aa[_0x92e6('0x16')]['message']);}else{logger[_0x92e6('0x19')](_0x92e6('0x13'),_0x1b0a85,_0x92e6('0x14'));_0x17452e(_0x5432aa[_0x92e6('0x1a')][_0x92e6('0x18')]);}})['catch'](function(_0x1c24d6){logger[_0x92e6('0x16')](_0x92e6('0x13'),_0x1b0a85,_0x1c24d6);_0x35ae52(_0x1c24d6);});});}exports[_0x92e6('0x1b')]=function(_0x52405c){var _0x2fc89c=this;return new Promise(function(_0x53ea65,_0x56c7fe){return db[_0x92e6('0x1c')][_0x92e6('0x1d')]({'raw':_0x52405c[_0x92e6('0x1e')]?_0x52405c[_0x92e6('0x1e')][_0x92e6('0x1f')]===undefined?!![]:![]:!![],'where':_0x52405c['options']?_0x52405c[_0x92e6('0x1e')]['where']||null:null,'attributes':_0x52405c[_0x92e6('0x1e')]?_0x52405c['options'][_0x92e6('0x20')]||null:null,'include':_0x52405c['options']?_0x52405c[_0x92e6('0x1e')][_0x92e6('0x21')]?_[_0x92e6('0x22')](_0x52405c[_0x92e6('0x1e')][_0x92e6('0x21')],function(_0xb83a92){return{'model':db[_0xb83a92[_0x92e6('0x23')]],'as':_0xb83a92['as'],'attributes':_0xb83a92[_0x92e6('0x20')],'include':_0xb83a92[_0x92e6('0x21')]?_[_0x92e6('0x22')](_0xb83a92[_0x92e6('0x21')],function(_0x457a8b){return{'model':db[_0x457a8b[_0x92e6('0x23')]],'as':_0x457a8b['as'],'attributes':_0x457a8b['attributes'],'include':_0x457a8b[_0x92e6('0x21')]?_[_0x92e6('0x22')](_0x457a8b[_0x92e6('0x21')],function(_0x577b34){return{'model':db[_0x577b34[_0x92e6('0x23')]],'as':_0x577b34['as'],'attributes':_0x577b34[_0x92e6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x92e6('0x12')](function(_0x428ce3){logger['info']('ShowSquareProject',_0x52405c);logger[_0x92e6('0x15')]('ShowSquareProject',_0x52405c,JSON[_0x92e6('0x24')](_0x428ce3));_0x53ea65(_0x428ce3);})[_0x92e6('0x25')](function(_0x2b3f08){logger['error'](_0x92e6('0x1b'),_0x2b3f08[_0x92e6('0x18')],_0x52405c);_0x56c7fe(_0x2fc89c[_0x92e6('0x16')](0x1f4,_0x2b3f08[_0x92e6('0x18')]));});});}; \ No newline at end of file +var _0x72ad=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','result','find','options','raw','where','attributes','map','model','include','ShowSquareProject','catch','lodash','util','moment','bluebird','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x5c9865,_0x1a299a){var _0x54c22b=function(_0x538537){while(--_0x538537){_0x5c9865['push'](_0x5c9865['shift']());}};_0x54c22b(++_0x1a299a);}(_0x72ad,0x1d4));var _0xd72a=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x72ad[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0xd72a('0x0'));var util=require(_0xd72a('0x1'));var moment=require(_0xd72a('0x2'));var BPromise=require(_0xd72a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd72a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd72a('0x5'));var jayson=require(_0xd72a('0x6'));var client=jayson['client'][_0xd72a('0x7')]({'port':0x232a});config[_0xd72a('0x8')]=_[_0xd72a('0x9')](config[_0xd72a('0x8')],{'host':_0xd72a('0xa'),'port':0x18eb});var socket=require(_0xd72a('0xb'))(new Redis(config[_0xd72a('0x8')]));require(_0xd72a('0xc'))[_0xd72a('0xd')](socket);function respondWithRpcPromise(_0x3d2a2d,_0x7620de,_0x100c0c){return new BPromise(function(_0xe60830,_0x1e5e2d){return client['request'](_0x3d2a2d,_0x100c0c)[_0xd72a('0xe')](function(_0x41c384){logger[_0xd72a('0xf')](_0xd72a('0x10'),_0x7620de,_0xd72a('0x11'));logger[_0xd72a('0x12')](_0xd72a('0x13'),_0x7620de,'request\x20sent',JSON[_0xd72a('0x14')](_0x41c384));if(_0x41c384['error']){if(_0x41c384[_0xd72a('0x15')]['code']===0x1f4){logger[_0xd72a('0x15')](_0xd72a('0x10'),_0x7620de,_0x41c384['error'][_0xd72a('0x16')]);return _0x1e5e2d(_0x41c384['error'][_0xd72a('0x16')]);}logger[_0xd72a('0x15')](_0xd72a('0x10'),_0x7620de,_0x41c384[_0xd72a('0x15')][_0xd72a('0x16')]);return _0xe60830(_0x41c384['error'][_0xd72a('0x16')]);}else{logger[_0xd72a('0xf')]('SquareProject,\x20%s,\x20%s',_0x7620de,_0xd72a('0x11'));_0xe60830(_0x41c384[_0xd72a('0x17')]['message']);}})['catch'](function(_0x2047e7){logger['error']('SquareProject,\x20%s,\x20%s',_0x7620de,_0x2047e7);_0x1e5e2d(_0x2047e7);});});}exports['ShowSquareProject']=function(_0x5c05f9){var _0x347c21=this;return new Promise(function(_0x4ea0d7,_0x50fbed){return db['SquareProject'][_0xd72a('0x18')]({'raw':_0x5c05f9[_0xd72a('0x19')]?_0x5c05f9[_0xd72a('0x19')][_0xd72a('0x1a')]===undefined?!![]:![]:!![],'where':_0x5c05f9[_0xd72a('0x19')]?_0x5c05f9['options'][_0xd72a('0x1b')]||null:null,'attributes':_0x5c05f9[_0xd72a('0x19')]?_0x5c05f9[_0xd72a('0x19')][_0xd72a('0x1c')]||null:null,'include':_0x5c05f9[_0xd72a('0x19')]?_0x5c05f9[_0xd72a('0x19')]['include']?_[_0xd72a('0x1d')](_0x5c05f9[_0xd72a('0x19')]['include'],function(_0x357a8a){return{'model':db[_0x357a8a[_0xd72a('0x1e')]],'as':_0x357a8a['as'],'attributes':_0x357a8a[_0xd72a('0x1c')],'include':_0x357a8a[_0xd72a('0x1f')]?_[_0xd72a('0x1d')](_0x357a8a[_0xd72a('0x1f')],function(_0xecfaf9){return{'model':db[_0xecfaf9['model']],'as':_0xecfaf9['as'],'attributes':_0xecfaf9[_0xd72a('0x1c')],'include':_0xecfaf9['include']?_[_0xd72a('0x1d')](_0xecfaf9['include'],function(_0x1eda88){return{'model':db[_0x1eda88[_0xd72a('0x1e')]],'as':_0x1eda88['as'],'attributes':_0x1eda88[_0xd72a('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xd72a('0xe')](function(_0x2128b7){logger[_0xd72a('0xf')](_0xd72a('0x20'),_0x5c05f9);logger[_0xd72a('0x12')](_0xd72a('0x20'),_0x5c05f9,JSON[_0xd72a('0x14')](_0x2128b7));_0x4ea0d7(_0x2128b7);})[_0xd72a('0x21')](function(_0x266a70){logger[_0xd72a('0x15')]('ShowSquareProject',_0x266a70[_0xd72a('0x16')],_0x5c05f9);_0x50fbed(_0x347c21[_0xd72a('0x15')](0x1f4,_0x266a70['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 5688607..c353e55 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 _0xb9ae=['removeListener','register','length','squareProject:','remove','update','emit'];(function(_0x37b643,_0x2b3368){var _0xeda57e=function(_0x1e3d22){while(--_0x1e3d22){_0x37b643['push'](_0x37b643['shift']());}};_0xeda57e(++_0x2b3368);}(_0xb9ae,0x6d));var _0xeb9a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xb9ae[_0x42cae2];return _0x5f256f;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=['save',_0xeb9a('0x0'),_0xeb9a('0x1')];function createListener(_0x61629b,_0x53938f){return function(_0x34aa0f){_0x53938f[_0xeb9a('0x2')](_0x61629b,_0x34aa0f);};}function removeListener(_0x4fca5a,_0x542138){return function(){SquareProjectEvents[_0xeb9a('0x3')](_0x4fca5a,_0x542138);};}exports[_0xeb9a('0x4')]=function(_0x18b8de){for(var _0x17bcb9=0x0,_0x1b6af8=events[_0xeb9a('0x5')];_0x17bcb9<_0x1b6af8;_0x17bcb9++){var _0x36346c=events[_0x17bcb9];var _0x1ef27f=createListener(_0xeb9a('0x6')+_0x36346c,_0x18b8de);SquareProjectEvents['on'](_0x36346c,_0x1ef27f);}}; \ No newline at end of file +var _0x0fa4=['save','remove','update','emit','removeListener','register','squareProject:','./squareProject.events'];(function(_0x4dea5a,_0x3cb27f){var _0x5e04e5=function(_0xbc4cc1){while(--_0xbc4cc1){_0x4dea5a['push'](_0x4dea5a['shift']());}};_0x5e04e5(++_0x3cb27f);}(_0x0fa4,0xff));var _0x40fa=function(_0x17c731,_0x5af764){_0x17c731=_0x17c731-0x0;var _0x1a4ac2=_0x0fa4[_0x17c731];return _0x1a4ac2;};'use strict';var SquareProjectEvents=require(_0x40fa('0x0'));var events=[_0x40fa('0x1'),_0x40fa('0x2'),_0x40fa('0x3')];function createListener(_0x2c24c5,_0x2b896a){return function(_0x472182){_0x2b896a[_0x40fa('0x4')](_0x2c24c5,_0x472182);};}function removeListener(_0x5802cd,_0x1502ec){return function(){SquareProjectEvents[_0x40fa('0x5')](_0x5802cd,_0x1502ec);};}exports[_0x40fa('0x6')]=function(_0x3e3282){for(var _0x1add71=0x0,_0x52f923=events['length'];_0x1add71<_0x52f923;_0x1add71++){var _0x2f3826=events[_0x1add71];var _0x283fc8=createListener(_0x40fa('0x7')+_0x2f3826,_0x3e3282);SquareProjectEvents['on'](_0x2f3826,_0x283fc8);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index dbaa3ab..1290509 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 _0x1cb9=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put'];(function(_0x1b5302,_0x3c9d1e){var _0x312786=function(_0x39f064){while(--_0x39f064){_0x1b5302['push'](_0x1b5302['shift']());}};_0x312786(++_0x3c9d1e);}(_0x1cb9,0x14e));var _0x91cb=function(_0x26260e,_0x415ae4){_0x26260e=_0x26260e-0x0;var _0x451339=_0x1cb9[_0x26260e];return _0x451339;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['get'](_0x91cb('0xd'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);router[_0x91cb('0x11')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x12')]);router[_0x91cb('0x13')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0x14')]);module[_0x91cb('0x15')]=router; \ No newline at end of file +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(_0x36bc97,_0x134cd0){var _0x580445=function(_0x7353db){while(--_0x7353db){_0x36bc97['push'](_0x36bc97['shift']());}};_0x580445(++_0x134cd0);}(_0xf494,0x1c6));var _0x4f49=function(_0x9e63eb,_0x31c75b){_0x9e63eb=_0x9e63eb-0x0;var _0x1a5206=_0xf494[_0x9e63eb];return _0x1a5206;};'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 diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index aac6ee6..ecdbccd 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 _0x032e=['VIRTUAL','getDataValue','savePath','substring','lastIndexOf','sequelize','STRING'];(function(_0x534001,_0x4af37c){var _0x268837=function(_0x495dc6){while(--_0x495dc6){_0x534001['push'](_0x534001['shift']());}};_0x268837(++_0x4af37c);}(_0x032e,0x124));var _0xe032=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x032e[_0x47a7d0];return _0xb9bd08;};'use strict';var Sequelize=require(_0xe032('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe032('0x1')]},'callerid':{'type':Sequelize[_0xe032('0x1')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xe032('0x1')]},'priority':{'type':Sequelize[_0xe032('0x1')]},'accountcode':{'type':Sequelize[_0xe032('0x1')]},'dnid':{'type':Sequelize[_0xe032('0x1')]},'projectName':{'type':Sequelize[_0xe032('0x1')]},'saveName':{'type':Sequelize[_0xe032('0x1')]},'filename':{'type':Sequelize[_0xe032('0x1')]},'savePath':{'type':Sequelize[_0xe032('0x1')]},'format':{'type':Sequelize[_0xe032('0x2')],'get':function(){var _0x1576c8='';var _0x3289b0=this[_0xe032('0x3')](_0xe032('0x4'));if(_0x3289b0){_0x1576c8=_0x3289b0[_0xe032('0x5')](_0x3289b0[_0xe032('0x6')]('.'));}return _0x1576c8;}}}; \ No newline at end of file +var _0x8ef6=['VIRTUAL','savePath','substring','lastIndexOf','sequelize','exports','STRING'];(function(_0x99facc,_0x548cd6){var _0xd39ed0=function(_0x207e47){while(--_0x207e47){_0x99facc['push'](_0x99facc['shift']());}};_0xd39ed0(++_0x548cd6);}(_0x8ef6,0xf2));var _0x68ef=function(_0xcd0af4,_0x59f54b){_0xcd0af4=_0xcd0af4-0x0;var _0x29c3a9=_0x8ef6[_0xcd0af4];return _0x29c3a9;};'use strict';var Sequelize=require(_0x68ef('0x0'));module[_0x68ef('0x1')]={'uniqueid':{'type':Sequelize[_0x68ef('0x2')]},'callerid':{'type':Sequelize[_0x68ef('0x2')]},'calleridname':{'type':Sequelize[_0x68ef('0x2')]},'context':{'type':Sequelize[_0x68ef('0x2')]},'extension':{'type':Sequelize[_0x68ef('0x2')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x68ef('0x2')]},'dnid':{'type':Sequelize[_0x68ef('0x2')]},'projectName':{'type':Sequelize[_0x68ef('0x2')]},'saveName':{'type':Sequelize[_0x68ef('0x2')]},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x68ef('0x3')],'get':function(){var _0x4740e8='';var _0x2de776=this['getDataValue'](_0x68ef('0x4'));if(_0x2de776){_0x4740e8=_0x2de776[_0x68ef('0x5')](_0x2de776[_0x68ef('0x6')]('.'));}return _0x4740e8;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 568cc70..c45f933 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 _0x08dc=['decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','message','destroy','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SquareRecording','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','format','existsSync'];(function(_0x140202,_0x4245c7){var _0x3037c2=function(_0x525d19){while(--_0x525d19){_0x140202['push'](_0x140202['shift']());}};_0x3037c2(++_0x4245c7);}(_0x08dc,0x77));var _0xc08d=function(_0x2fb3d9,_0x453475){_0x2fb3d9=_0x2fb3d9-0x0;var _0x4048d5=_0x08dc[_0x2fb3d9];return _0x4048d5;};'use strict';var emlformat=require(_0xc08d('0x0'));var rimraf=require(_0xc08d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc08d('0x2'));var rp=require(_0xc08d('0x3'));var moment=require(_0xc08d('0x4'));var BPromise=require(_0xc08d('0x5'));var Mustache=require(_0xc08d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc08d('0x7'));var _=require(_0xc08d('0x8'));var squel=require(_0xc08d('0x9'));var crypto=require(_0xc08d('0xa'));var jsforce=require(_0xc08d('0xb'));var deskjs=require(_0xc08d('0xc'));var toCsv=require(_0xc08d('0xd'));var querystring=require(_0xc08d('0xe'));var Papa=require(_0xc08d('0xf'));var Redis=require(_0xc08d('0x10'));var authService=require(_0xc08d('0x11'));var qs=require(_0xc08d('0x12'));var as=require(_0xc08d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc08d('0x14'))(_0xc08d('0x15'));var utils=require('../../config/utils');var config=require(_0xc08d('0x16'));var licenseUtil=require(_0xc08d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5dc876,_0x2bf1e9){_0x2bf1e9=_0x2bf1e9||0xcc;return function(_0x5498f6){if(_0x5498f6){return _0x5dc876[_0xc08d('0x18')](_0x2bf1e9);}return _0x5dc876['status'](_0x2bf1e9)[_0xc08d('0x19')]();};}function respondWithResult(_0x122e3d,_0x284b95){_0x284b95=_0x284b95||0xc8;return function(_0x566477){if(_0x566477){return _0x122e3d[_0xc08d('0x1a')](_0x284b95)['json'](_0x566477);}};}function respondWithFilteredResult(_0x49728f,_0x40c9d9){return function(_0x5d123c){if(_0x5d123c){var _0x48a100=typeof _0x40c9d9[_0xc08d('0x1b')]===_0xc08d('0x1c')&&typeof _0x40c9d9[_0xc08d('0x1d')]===_0xc08d('0x1c');var _0x48c4c2=_0x5d123c[_0xc08d('0x1e')];var _0x4f58c1=_0x48a100?0x0:_0x40c9d9[_0xc08d('0x1b')];var _0x14c8ad=_0x48a100?_0x5d123c['count']:_0x40c9d9['offset']+_0x40c9d9[_0xc08d('0x1d')];var _0x469d19;if(_0x14c8ad>=_0x48c4c2){_0x14c8ad=_0x48c4c2;_0x469d19=0xc8;}else{_0x469d19=0xce;}_0x49728f[_0xc08d('0x1a')](_0x469d19);return _0x49728f[_0xc08d('0x1f')](_0xc08d('0x20'),_0x4f58c1+'-'+_0x14c8ad+'/'+_0x48c4c2)[_0xc08d('0x21')](_0x5d123c);}return null;};}function patchUpdates(_0x199819){return function(_0x27d5af){try{jsonpatch[_0xc08d('0x22')](_0x27d5af,_0x199819,!![]);}catch(_0x449c3c){return BPromise[_0xc08d('0x23')](_0x449c3c);}return _0x27d5af[_0xc08d('0x24')]();};}function saveUpdates(_0xecf6da,_0x449cc9){return function(_0x239ec0){if(_0x239ec0){return _0x239ec0[_0xc08d('0x25')](_0xecf6da)[_0xc08d('0x26')](function(_0x5ee213){return _0x5ee213;});}return null;};}function removeEntity(_0x2cecfe,_0x52cd0d){return function(_0x1adfb0){if(_0x1adfb0){return _0x1adfb0['destroy']()[_0xc08d('0x26')](function(){_0x2cecfe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x115deb,_0x53fd34){return function(_0x46993f){if(!_0x46993f){_0x115deb['sendStatus'](0x194);}return _0x46993f;};}function handleError(_0x14c0ba,_0x34e4bc){_0x34e4bc=_0x34e4bc||0x1f4;return function(_0x20bdc3){logger[_0xc08d('0x27')](_0x20bdc3[_0xc08d('0x28')]);if(_0x20bdc3[_0xc08d('0x29')]){delete _0x20bdc3[_0xc08d('0x29')];}_0x14c0ba['status'](_0x34e4bc)[_0xc08d('0x2a')](_0x20bdc3);};}exports[_0xc08d('0x2b')]=function(_0x5ebb81,_0x366c24){var _0x1c596a={},_0xa6c8f={},_0xa14f50={'count':0x0,'rows':[]};var _0x4bd35a=_[_0xc08d('0x2c')](db[_0xc08d('0x2d')][_0xc08d('0x2e')],function(_0x963d25){return{'name':_0x963d25['fieldName'],'type':_0x963d25[_0xc08d('0x2f')][_0xc08d('0x30')]};});_0xa6c8f[_0xc08d('0x31')]=_[_0xc08d('0x2c')](_0x4bd35a,_0xc08d('0x29'));_0xa6c8f[_0xc08d('0x32')]=_[_0xc08d('0x33')](_0x5ebb81['query']);_0xa6c8f[_0xc08d('0x34')]=_[_0xc08d('0x35')](_0xa6c8f[_0xc08d('0x31')],_0xa6c8f[_0xc08d('0x32')]);_0x1c596a['attributes']=_[_0xc08d('0x35')](_0xa6c8f[_0xc08d('0x31')],qs['fields'](_0x5ebb81[_0xc08d('0x32')][_0xc08d('0x36')]));_0x1c596a[_0xc08d('0x37')]=_0x1c596a[_0xc08d('0x37')][_0xc08d('0x38')]?_0x1c596a[_0xc08d('0x37')]:_0xa6c8f['model'];if(!_0x5ebb81[_0xc08d('0x32')]['hasOwnProperty'](_0xc08d('0x39'))){_0x1c596a[_0xc08d('0x1d')]=qs[_0xc08d('0x1d')](_0x5ebb81[_0xc08d('0x32')][_0xc08d('0x1d')]);_0x1c596a[_0xc08d('0x1b')]=qs[_0xc08d('0x1b')](_0x5ebb81[_0xc08d('0x32')][_0xc08d('0x1b')]);}_0x1c596a[_0xc08d('0x3a')]=qs['sort'](_0x5ebb81[_0xc08d('0x32')][_0xc08d('0x3b')]);_0x1c596a['where']=qs[_0xc08d('0x34')](_[_0xc08d('0x3c')](_0x5ebb81['query'],_0xa6c8f[_0xc08d('0x34')]),_0x4bd35a);if(_0x5ebb81[_0xc08d('0x32')]['filter']){_0x1c596a[_0xc08d('0x3d')]=_[_0xc08d('0x3e')](_0x1c596a[_0xc08d('0x3d')],{'$or':_[_0xc08d('0x2c')](_0x4bd35a,function(_0x1835b2){if(_0x1835b2[_0xc08d('0x2f')]!=='VIRTUAL'){var _0x568e01={};_0x568e01[_0x1835b2['name']]={'$like':'%'+_0x5ebb81['query'][_0xc08d('0x3f')]+'%'};return _0x568e01;}})});}_0x1c596a=_[_0xc08d('0x3e')]({},_0x1c596a,_0x5ebb81[_0xc08d('0x40')]);var _0x31d38a={'where':_0x1c596a['where']};return db['SquareRecording'][_0xc08d('0x1e')](_0x31d38a)[_0xc08d('0x26')](function(_0x12a9bb){_0xa14f50[_0xc08d('0x1e')]=_0x12a9bb;if(_0x5ebb81[_0xc08d('0x32')][_0xc08d('0x41')]){_0x1c596a[_0xc08d('0x42')]=[{'all':!![]}];}return db[_0xc08d('0x2d')][_0xc08d('0x43')](_0x1c596a);})['then'](function(_0x34c773){_0xa14f50[_0xc08d('0x44')]=_0x34c773;return _0xa14f50;})[_0xc08d('0x26')](respondWithFilteredResult(_0x366c24,_0x1c596a))[_0xc08d('0x45')](handleError(_0x366c24,null));};exports[_0xc08d('0x46')]=function(_0x2b4b22,_0x373f33){var _0x37e561={'raw':!![],'where':{'id':_0x2b4b22[_0xc08d('0x47')]['id']}},_0x414d79={};_0x414d79[_0xc08d('0x31')]=_[_0xc08d('0x33')](db[_0xc08d('0x2d')][_0xc08d('0x2e')]);_0x414d79[_0xc08d('0x32')]=_[_0xc08d('0x33')](_0x2b4b22[_0xc08d('0x32')]);_0x414d79[_0xc08d('0x34')]=_['intersection'](_0x414d79[_0xc08d('0x31')],_0x414d79[_0xc08d('0x32')]);_0x37e561['attributes']=_[_0xc08d('0x35')](_0x414d79[_0xc08d('0x31')],qs['fields'](_0x2b4b22['query']['fields']));_0x37e561[_0xc08d('0x37')]=_0x37e561[_0xc08d('0x37')][_0xc08d('0x38')]?_0x37e561[_0xc08d('0x37')]:_0x414d79[_0xc08d('0x31')];if(_0x2b4b22[_0xc08d('0x32')]['includeAll']){_0x37e561['include']=[{'all':!![]}];}_0x37e561=_[_0xc08d('0x3e')]({},_0x37e561,_0x2b4b22['options']);return db['SquareRecording'][_0xc08d('0x48')](_0x37e561)[_0xc08d('0x26')](handleEntityNotFound(_0x373f33,null))[_0xc08d('0x26')](respondWithResult(_0x373f33,null))['catch'](handleError(_0x373f33,null));};exports[_0xc08d('0x49')]=function(_0x4059c8,_0x5b9e0e){return db['SquareRecording'][_0xc08d('0x49')](_0x4059c8['body'],{})[_0xc08d('0x26')](respondWithResult(_0x5b9e0e,0xc9))[_0xc08d('0x45')](handleError(_0x5b9e0e,null));};exports[_0xc08d('0x25')]=function(_0x3393d2,_0x5597b5){if(_0x3393d2[_0xc08d('0x4a')]['id']){delete _0x3393d2[_0xc08d('0x4a')]['id'];}return db[_0xc08d('0x2d')]['find']({'where':{'id':_0x3393d2[_0xc08d('0x47')]['id']}})[_0xc08d('0x26')](handleEntityNotFound(_0x5597b5,null))[_0xc08d('0x26')](saveUpdates(_0x3393d2[_0xc08d('0x4a')],null))[_0xc08d('0x26')](respondWithResult(_0x5597b5,null))[_0xc08d('0x45')](handleError(_0x5597b5,null));};exports[_0xc08d('0x4b')]=function(_0x2a988a,_0x584313,_0x29c0a6){var _0x4d4e99=require(_0xc08d('0x4c'));var _0x55978c=![];var _0x2d1231={};if(_0x2a988a[_0xc08d('0x32')][_0xc08d('0x2f')]&&_0x2a988a[_0xc08d('0x32')]['type']==='uniqueid'){_0x2d1231[_0xc08d('0x4d')]=_0x2a988a[_0xc08d('0x47')]['id'];}else{_0x2d1231['id']=_0x2a988a[_0xc08d('0x47')]['id'];}return db[_0xc08d('0x2d')][_0xc08d('0x48')]({'where':_0x2d1231,'attributes':['id',_0xc08d('0x4e'),'filename'],'raw':!![]})[_0xc08d('0x26')](handleEntityNotFound(_0x584313,null))['then'](function(_0x28d9f0){if(_0x28d9f0){var _0x3dd042=_0x28d9f0[_0xc08d('0x4e')];var _0x501e6a=util[_0xc08d('0x4f')]('%s.cypher',_0x3dd042);if(fs[_0xc08d('0x50')](_0x501e6a)){_0x55978c=!![];return _0x4d4e99[_0xc08d('0x51')](_0x501e6a,_0x3dd042,config[_0xc08d('0x52')][_0xc08d('0x53')])[_0xc08d('0x26')](function(){return _0x28d9f0;});}return _0x28d9f0;}})[_0xc08d('0x26')](function(_0x30e371){if(_0x30e371){var _0x260458=_0x30e371[_0xc08d('0x4e')];if(!fs[_0xc08d('0x50')](_0x260458)){throw new db[(_0xc08d('0x54'))][(_0xc08d('0x55'))](_0xc08d('0x56'));}if(_0x30e371[_0xc08d('0x57')]){return _0x584313[_0xc08d('0x4b')](_0x260458,_0x30e371[_0xc08d('0x57')]+path[_0xc08d('0x58')](_0x260458),function(){if(_0x55978c){fs[_0xc08d('0x59')](_0x260458);}});}else{return _0x584313[_0xc08d('0x4b')](_0x260458,function(_0x3b977c){if(_0x55978c){fs['unlink'](_0x260458);}});}}})[_0xc08d('0x45')](function(_0x50bde7){if(_0x50bde7[_0xc08d('0x5a')]==='SquareRecording\x20not\x20found'){_0x584313[_0xc08d('0x1a')](0x194)['send']('Not\x20found');}else{return handleError(_0x584313,null);}});};exports[_0xc08d('0x5b')]=function(_0x3c7cee,_0x5067cd){return db[_0xc08d('0x2d')][_0xc08d('0x48')]({'where':{'id':_0x3c7cee['params']['id']}})[_0xc08d('0x26')](function(_0x479770){if(_[_0xc08d('0x5c')](_0x479770)){throw new ReferenceError(_0xc08d('0x5d'));}return _0x479770;})[_0xc08d('0x26')](function(_0x12183d){var _0x565ea7=_0x12183d[_0xc08d('0x4e')];logger[_0xc08d('0x5e')](_0xc08d('0x5f'),_0x565ea7);if(!_['isNil'](_0x12183d[_0xc08d('0x4e')])&&fs[_0xc08d('0x50')](_0x565ea7)){logger['info'](_0xc08d('0x60')+_0x565ea7+_0xc08d('0x61'));fs[_0xc08d('0x62')](_0x565ea7);}_0x565ea7=_0x565ea7+_0xc08d('0x63');if(!_[_0xc08d('0x5c')](_0x12183d['savePath'])&&fs[_0xc08d('0x50')](_0x565ea7)){logger['info'](_0xc08d('0x60')+_0x565ea7+_0xc08d('0x61'));fs['unlinkSync'](_0x565ea7);}return _0x12183d;})[_0xc08d('0x26')](function(_0x4b51df){if(!_0x4b51df)throw new InternalError();return _0x4b51df['destroy']();})[_0xc08d('0x26')](function(){_0x5067cd[_0xc08d('0x1a')](0xcc)[_0xc08d('0x19')]();})[_0xc08d('0x45')](handleError(_0x5067cd,null));}; \ No newline at end of file +var _0x79bc=['then','destroy','error','stack','name','send','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','catch','create','body','update','find','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','recording','download','extname','unlink','SquareRecording\x20not\x20found','Not\x20found','isNil','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','save'];(function(_0x323104,_0x2cb57e){var _0x4437f6=function(_0x265107){while(--_0x265107){_0x323104['push'](_0x323104['shift']());}};_0x4437f6(++_0x2cb57e);}(_0x79bc,0x9b));var _0xc79b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x79bc[_0x40a045];return _0x1a687c;};'use strict';var emlformat=require(_0xc79b('0x0'));var rimraf=require(_0xc79b('0x1'));var zipdir=require(_0xc79b('0x2'));var jsonpatch=require(_0xc79b('0x3'));var rp=require(_0xc79b('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc79b('0x5'));var util=require(_0xc79b('0x6'));var path=require(_0xc79b('0x7'));var sox=require('sox');var csv=require(_0xc79b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc79b('0x9'));var _=require(_0xc79b('0xa'));var squel=require(_0xc79b('0xb'));var crypto=require(_0xc79b('0xc'));var jsforce=require(_0xc79b('0xd'));var deskjs=require(_0xc79b('0xe'));var toCsv=require(_0xc79b('0x8'));var querystring=require(_0xc79b('0xf'));var Papa=require(_0xc79b('0x10'));var Redis=require(_0xc79b('0x11'));var authService=require(_0xc79b('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc79b('0x13'));var logger=require('../../config/logger')(_0xc79b('0x14'));var utils=require('../../config/utils');var config=require(_0xc79b('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14ae83,_0x517667){_0x517667=_0x517667||0xcc;return function(_0x5c3cdf){if(_0x5c3cdf){return _0x14ae83[_0xc79b('0x16')](_0x517667);}return _0x14ae83[_0xc79b('0x17')](_0x517667)[_0xc79b('0x18')]();};}function respondWithResult(_0x5d2027,_0x226a2e){_0x226a2e=_0x226a2e||0xc8;return function(_0x9c8d5f){if(_0x9c8d5f){return _0x5d2027['status'](_0x226a2e)['json'](_0x9c8d5f);}};}function respondWithFilteredResult(_0x2ae738,_0x2b3137){return function(_0x1990b2){if(_0x1990b2){var _0x4fd1b6=typeof _0x2b3137[_0xc79b('0x19')]===_0xc79b('0x1a')&&typeof _0x2b3137['limit']===_0xc79b('0x1a');var _0x94d6e4=_0x1990b2['count'];var _0x7e629a=_0x4fd1b6?0x0:_0x2b3137[_0xc79b('0x19')];var _0x2d60fe=_0x4fd1b6?_0x1990b2[_0xc79b('0x1b')]:_0x2b3137['offset']+_0x2b3137['limit'];var _0x39e81e;if(_0x2d60fe>=_0x94d6e4){_0x2d60fe=_0x94d6e4;_0x39e81e=0xc8;}else{_0x39e81e=0xce;}_0x2ae738['status'](_0x39e81e);return _0x2ae738[_0xc79b('0x1c')](_0xc79b('0x1d'),_0x7e629a+'-'+_0x2d60fe+'/'+_0x94d6e4)[_0xc79b('0x1e')](_0x1990b2);}return null;};}function patchUpdates(_0x338f86){return function(_0x5913fe){try{jsonpatch[_0xc79b('0x1f')](_0x5913fe,_0x338f86,!![]);}catch(_0x31d0dd){return BPromise['reject'](_0x31d0dd);}return _0x5913fe[_0xc79b('0x20')]();};}function saveUpdates(_0x2ac359,_0x452f8f){return function(_0x2ca807){if(_0x2ca807){return _0x2ca807['update'](_0x2ac359)[_0xc79b('0x21')](function(_0x2a50eb){return _0x2a50eb;});}return null;};}function removeEntity(_0x58a503,_0x1f649b){return function(_0x5a409d){if(_0x5a409d){return _0x5a409d[_0xc79b('0x22')]()[_0xc79b('0x21')](function(){_0x58a503[_0xc79b('0x17')](0xcc)[_0xc79b('0x18')]();});}};}function handleEntityNotFound(_0x37a427,_0xc0048d){return function(_0x2e0eff){if(!_0x2e0eff){_0x37a427[_0xc79b('0x16')](0x194);}return _0x2e0eff;};}function handleError(_0x26f28f,_0x1f2848){_0x1f2848=_0x1f2848||0x1f4;return function(_0x16f3b5){logger[_0xc79b('0x23')](_0x16f3b5[_0xc79b('0x24')]);if(_0x16f3b5[_0xc79b('0x25')]){delete _0x16f3b5[_0xc79b('0x25')];}_0x26f28f['status'](_0x1f2848)[_0xc79b('0x26')](_0x16f3b5);};}exports[_0xc79b('0x27')]=function(_0x370f0f,_0x468f0f){var _0x496a93={},_0x2a7bd7={},_0x51114e={'count':0x0,'rows':[]};var _0x4d5dc2=_[_0xc79b('0x28')](db[_0xc79b('0x29')][_0xc79b('0x2a')],function(_0x5375db){return{'name':_0x5375db[_0xc79b('0x2b')],'type':_0x5375db[_0xc79b('0x2c')][_0xc79b('0x2d')]};});_0x2a7bd7[_0xc79b('0x2e')]=_['map'](_0x4d5dc2,_0xc79b('0x25'));_0x2a7bd7['query']=_[_0xc79b('0x2f')](_0x370f0f[_0xc79b('0x30')]);_0x2a7bd7[_0xc79b('0x31')]=_[_0xc79b('0x32')](_0x2a7bd7[_0xc79b('0x2e')],_0x2a7bd7[_0xc79b('0x30')]);_0x496a93[_0xc79b('0x33')]=_[_0xc79b('0x32')](_0x2a7bd7[_0xc79b('0x2e')],qs['fields'](_0x370f0f[_0xc79b('0x30')][_0xc79b('0x34')]));_0x496a93[_0xc79b('0x33')]=_0x496a93[_0xc79b('0x33')][_0xc79b('0x35')]?_0x496a93[_0xc79b('0x33')]:_0x2a7bd7[_0xc79b('0x2e')];if(!_0x370f0f[_0xc79b('0x30')]['hasOwnProperty'](_0xc79b('0x36'))){_0x496a93['limit']=qs['limit'](_0x370f0f[_0xc79b('0x30')][_0xc79b('0x37')]);_0x496a93[_0xc79b('0x19')]=qs[_0xc79b('0x19')](_0x370f0f[_0xc79b('0x30')]['offset']);}_0x496a93[_0xc79b('0x38')]=qs[_0xc79b('0x39')](_0x370f0f[_0xc79b('0x30')][_0xc79b('0x39')]);_0x496a93[_0xc79b('0x3a')]=qs[_0xc79b('0x31')](_[_0xc79b('0x3b')](_0x370f0f[_0xc79b('0x30')],_0x2a7bd7[_0xc79b('0x31')]),_0x4d5dc2);if(_0x370f0f[_0xc79b('0x30')][_0xc79b('0x3c')]){_0x496a93[_0xc79b('0x3a')]=_[_0xc79b('0x3d')](_0x496a93[_0xc79b('0x3a')],{'$or':_[_0xc79b('0x28')](_0x4d5dc2,function(_0x31a8da){if(_0x31a8da[_0xc79b('0x2c')]!==_0xc79b('0x3e')){var _0x95d6b4={};_0x95d6b4[_0x31a8da[_0xc79b('0x25')]]={'$like':'%'+_0x370f0f[_0xc79b('0x30')][_0xc79b('0x3c')]+'%'};return _0x95d6b4;}})});}_0x496a93=_[_0xc79b('0x3d')]({},_0x496a93,_0x370f0f[_0xc79b('0x3f')]);var _0x3b3684={'where':_0x496a93[_0xc79b('0x3a')]};return db[_0xc79b('0x29')][_0xc79b('0x1b')](_0x3b3684)[_0xc79b('0x21')](function(_0x3e627d){_0x51114e[_0xc79b('0x1b')]=_0x3e627d;if(_0x370f0f[_0xc79b('0x30')][_0xc79b('0x40')]){_0x496a93[_0xc79b('0x41')]=[{'all':!![]}];}return db[_0xc79b('0x29')][_0xc79b('0x42')](_0x496a93);})['then'](function(_0x4fa98c){_0x51114e['rows']=_0x4fa98c;return _0x51114e;})[_0xc79b('0x21')](respondWithFilteredResult(_0x468f0f,_0x496a93))['catch'](handleError(_0x468f0f,null));};exports[_0xc79b('0x43')]=function(_0x12b2ea,_0x165a77){var _0x312d69={'raw':!![],'where':{'id':_0x12b2ea[_0xc79b('0x44')]['id']}},_0x4c4d3c={};_0x4c4d3c[_0xc79b('0x2e')]=_['keys'](db[_0xc79b('0x29')][_0xc79b('0x2a')]);_0x4c4d3c[_0xc79b('0x30')]=_[_0xc79b('0x2f')](_0x12b2ea['query']);_0x4c4d3c[_0xc79b('0x31')]=_[_0xc79b('0x32')](_0x4c4d3c['model'],_0x4c4d3c[_0xc79b('0x30')]);_0x312d69[_0xc79b('0x33')]=_['intersection'](_0x4c4d3c[_0xc79b('0x2e')],qs['fields'](_0x12b2ea['query']['fields']));_0x312d69[_0xc79b('0x33')]=_0x312d69[_0xc79b('0x33')][_0xc79b('0x35')]?_0x312d69[_0xc79b('0x33')]:_0x4c4d3c[_0xc79b('0x2e')];if(_0x12b2ea['query'][_0xc79b('0x40')]){_0x312d69['include']=[{'all':!![]}];}_0x312d69=_[_0xc79b('0x3d')]({},_0x312d69,_0x12b2ea['options']);return db['SquareRecording']['find'](_0x312d69)[_0xc79b('0x21')](handleEntityNotFound(_0x165a77,null))['then'](respondWithResult(_0x165a77,null))[_0xc79b('0x45')](handleError(_0x165a77,null));};exports[_0xc79b('0x46')]=function(_0x3cea68,_0x1f7f51){return db['SquareRecording'][_0xc79b('0x46')](_0x3cea68[_0xc79b('0x47')],{})['then'](respondWithResult(_0x1f7f51,0xc9))['catch'](handleError(_0x1f7f51,null));};exports[_0xc79b('0x48')]=function(_0xa34e4f,_0x5cd6f8){if(_0xa34e4f[_0xc79b('0x47')]['id']){delete _0xa34e4f['body']['id'];}return db[_0xc79b('0x29')][_0xc79b('0x49')]({'where':{'id':_0xa34e4f[_0xc79b('0x44')]['id']}})[_0xc79b('0x21')](handleEntityNotFound(_0x5cd6f8,null))[_0xc79b('0x21')](saveUpdates(_0xa34e4f['body'],null))[_0xc79b('0x21')](respondWithResult(_0x5cd6f8,null))[_0xc79b('0x45')](handleError(_0x5cd6f8,null));};exports['download']=function(_0x373ab4,_0x36b1c6,_0x2c547a){var _0x333d2c=require(_0xc79b('0x4a'));var _0x4f13d4=![];var _0x4278a2={};if(_0x373ab4[_0xc79b('0x30')]['type']&&_0x373ab4[_0xc79b('0x30')]['type']===_0xc79b('0x4b')){_0x4278a2[_0xc79b('0x4b')]=_0x373ab4['params']['id'];}else{_0x4278a2['id']=_0x373ab4[_0xc79b('0x44')]['id'];}return db[_0xc79b('0x29')][_0xc79b('0x49')]({'where':_0x4278a2,'attributes':['id',_0xc79b('0x4c'),_0xc79b('0x4d')],'raw':!![]})[_0xc79b('0x21')](handleEntityNotFound(_0x36b1c6,null))['then'](function(_0x3b461e){if(_0x3b461e){var _0x1e4a5d=_0x3b461e[_0xc79b('0x4c')];var _0x3afb79=util[_0xc79b('0x4e')](_0xc79b('0x4f'),_0x1e4a5d);if(fs[_0xc79b('0x50')](_0x3afb79)){_0x4f13d4=!![];return _0x333d2c[_0xc79b('0x51')](_0x3afb79,_0x1e4a5d,config['secrets'][_0xc79b('0x52')])[_0xc79b('0x21')](function(){return _0x3b461e;});}return _0x3b461e;}})['then'](function(_0x1d6032){if(_0x1d6032){var _0x1b77a3=_0x1d6032['savePath'];if(!fs[_0xc79b('0x50')](_0x1b77a3)){throw new db['Sequelize']['ValidationError']('SquareRecording\x20not\x20found');}if(_0x1d6032[_0xc79b('0x4d')]){return _0x36b1c6[_0xc79b('0x53')](_0x1b77a3,_0x1d6032[_0xc79b('0x4d')]+path[_0xc79b('0x54')](_0x1b77a3),function(){if(_0x4f13d4){fs[_0xc79b('0x55')](_0x1b77a3);}});}else{return _0x36b1c6['download'](_0x1b77a3,function(_0x7fa950){if(_0x4f13d4){fs[_0xc79b('0x55')](_0x1b77a3);}});}}})[_0xc79b('0x45')](function(_0x2fe850){if(_0x2fe850['message']===_0xc79b('0x56')){_0x36b1c6[_0xc79b('0x17')](0x194)['send'](_0xc79b('0x57'));}else{return handleError(_0x36b1c6,null);}});};exports[_0xc79b('0x22')]=function(_0x271b19,_0x384db4){return db['SquareRecording'][_0xc79b('0x49')]({'where':{'id':_0x271b19[_0xc79b('0x44')]['id']}})[_0xc79b('0x21')](function(_0x56c0b7){if(_[_0xc79b('0x58')](_0x56c0b7)){throw new ReferenceError(_0xc79b('0x59'));}return _0x56c0b7;})[_0xc79b('0x21')](function(_0x339e54){var _0x2732ea=_0x339e54[_0xc79b('0x4c')];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x2732ea);if(!_[_0xc79b('0x58')](_0x339e54['savePath'])&&fs[_0xc79b('0x50')](_0x2732ea)){logger[_0xc79b('0x5a')](_0xc79b('0x5b')+_0x2732ea+_0xc79b('0x5c'));fs[_0xc79b('0x5d')](_0x2732ea);}_0x2732ea=_0x2732ea+'.cypher';if(!_['isNil'](_0x339e54[_0xc79b('0x4c')])&&fs[_0xc79b('0x50')](_0x2732ea)){logger[_0xc79b('0x5a')](_0xc79b('0x5b')+_0x2732ea+_0xc79b('0x5c'));fs[_0xc79b('0x5d')](_0x2732ea);}return _0x339e54;})[_0xc79b('0x21')](function(_0x594740){if(!_0x594740)throw new InternalError();return _0x594740[_0xc79b('0x22')]();})[_0xc79b('0x21')](function(){_0x384db4[_0xc79b('0x17')](0xcc)[_0xc79b('0x18')]();})['catch'](handleError(_0x384db4,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index da95abe..d039da2 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 _0xfef9=['square_recordings','lodash','util','api','moment','request-promise','rimraf','./squareRecording.attributes','exports','define'];(function(_0x201ab2,_0x19ba32){var _0x440db9=function(_0x363a62){while(--_0x363a62){_0x201ab2['push'](_0x201ab2['shift']());}};_0x440db9(++_0x19ba32);}(_0xfef9,0xd3));var _0x9fef=function(_0x35b7d4,_0x5a5c43){_0x35b7d4=_0x35b7d4-0x0;var _0x4e8cee=_0xfef9[_0x35b7d4];return _0x4e8cee;};'use strict';var _=require(_0x9fef('0x0'));var util=require(_0x9fef('0x1'));var logger=require('../../config/logger')(_0x9fef('0x2'));var moment=require(_0x9fef('0x3'));var BPromise=require('bluebird');var rp=require(_0x9fef('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9fef('0x5'));var config=require('../../config/environment');var attributes=require(_0x9fef('0x6'));module[_0x9fef('0x7')]=function(_0x4d86cb,_0x366ea9){return _0x4d86cb[_0x9fef('0x8')]('SquareRecording',attributes,{'tableName':_0x9fef('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0af5=['rimraf','../../config/environment','./squareRecording.attributes','exports','SquareRecording','square_recordings','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x49b65d,_0x141c57){var _0x4b5eb6=function(_0x5a88dc){while(--_0x5a88dc){_0x49b65d['push'](_0x49b65d['shift']());}};_0x4b5eb6(++_0x141c57);}(_0x0af5,0x158));var _0x50af=function(_0x3f3cba,_0x118c78){_0x3f3cba=_0x3f3cba-0x0;var _0x2db6c0=_0x0af5[_0x3f3cba];return _0x2db6c0;};'use strict';var _=require('lodash');var util=require(_0x50af('0x0'));var logger=require(_0x50af('0x1'))(_0x50af('0x2'));var moment=require(_0x50af('0x3'));var BPromise=require(_0x50af('0x4'));var rp=require(_0x50af('0x5'));var fs=require('fs');var path=require(_0x50af('0x6'));var rimraf=require(_0x50af('0x7'));var config=require(_0x50af('0x8'));var attributes=require(_0x50af('0x9'));module[_0x50af('0xa')]=function(_0xe37b1,_0x5e94f8){return _0xe37b1['define'](_0x50af('0xb'),attributes,{'tableName':_0x50af('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index dd4524d..af20262 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 _0x127c=['error','code','SquareRecording,\x20%s,\x20%s','message','result','catch','CreateSquareRecording','SquareRecording','body','options','raw','lodash','util','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4e7987,_0x2b665b){var _0x153cbe=function(_0x579a4d){while(--_0x579a4d){_0x4e7987['push'](_0x4e7987['shift']());}};_0x153cbe(++_0x2b665b);}(_0x127c,0x177));var _0xc127=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x127c[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xc127('0x0'));var util=require(_0xc127('0x1'));var moment=require(_0xc127('0x2'));var BPromise=require('bluebird');var rs=require(_0xc127('0x3'));var fs=require('fs');var Redis=require(_0xc127('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc127('0x5'));var logger=require('../../config/logger')(_0xc127('0x6'));var config=require(_0xc127('0x7'));var jayson=require(_0xc127('0x8'));var client=jayson[_0xc127('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d4c69,_0x4931e0,_0x5ac547){return new BPromise(function(_0xa46a94,_0x2d888b){return client[_0xc127('0xa')](_0x3d4c69,_0x5ac547)[_0xc127('0xb')](function(_0xa2450d){logger[_0xc127('0xc')]('SquareRecording,\x20%s,\x20%s',_0x4931e0,'request\x20sent');logger[_0xc127('0xd')](_0xc127('0xe'),_0x4931e0,_0xc127('0xf'),JSON[_0xc127('0x10')](_0xa2450d));if(_0xa2450d['error']){if(_0xa2450d[_0xc127('0x11')][_0xc127('0x12')]===0x1f4){logger[_0xc127('0x11')](_0xc127('0x13'),_0x4931e0,_0xa2450d['error'][_0xc127('0x14')]);return _0x2d888b(_0xa2450d[_0xc127('0x11')][_0xc127('0x14')]);}logger[_0xc127('0x11')]('SquareRecording,\x20%s,\x20%s',_0x4931e0,_0xa2450d[_0xc127('0x11')][_0xc127('0x14')]);return _0xa46a94(_0xa2450d[_0xc127('0x11')][_0xc127('0x14')]);}else{logger[_0xc127('0xc')](_0xc127('0x13'),_0x4931e0,_0xc127('0xf'));_0xa46a94(_0xa2450d[_0xc127('0x15')][_0xc127('0x14')]);}})[_0xc127('0x16')](function(_0x79f6a2){logger[_0xc127('0x11')](_0xc127('0x13'),_0x4931e0,_0x79f6a2);_0x2d888b(_0x79f6a2);});});}exports[_0xc127('0x17')]=function(_0x332acc){var _0x55cdb5=this;return new Promise(function(_0x3edec2,_0x3e4482){return db[_0xc127('0x18')]['create'](_0x332acc[_0xc127('0x19')],{'raw':_0x332acc[_0xc127('0x1a')]?_0x332acc[_0xc127('0x1a')][_0xc127('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x26ddd6){logger['info'](_0xc127('0x17'),_0x332acc);logger['debug'](_0xc127('0x17'),_0x332acc,JSON[_0xc127('0x10')](_0x26ddd6));_0x3edec2(_0x26ddd6);})[_0xc127('0x16')](function(_0x200f6d){logger['error'](_0xc127('0x17'),_0x200f6d[_0xc127('0x14')],_0x332acc);_0x3e4482(_0x55cdb5[_0xc127('0x11')](0x1f4,_0x200f6d[_0xc127('0x14')]));});});}; \ No newline at end of file +var _0xbaf5=['raw','debug','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSquareRecording','SquareRecording','create','body','options'];(function(_0x16f4cd,_0x125cb3){var _0x3bb8fa=function(_0x30d406){while(--_0x30d406){_0x16f4cd['push'](_0x16f4cd['shift']());}};_0x3bb8fa(++_0x125cb3);}(_0xbaf5,0x1de));var _0x5baf=function(_0x5a7e3c,_0xdc9219){_0x5a7e3c=_0x5a7e3c-0x0;var _0x59252b=_0xbaf5[_0x5a7e3c];return _0x59252b;};'use strict';var _=require('lodash');var util=require(_0x5baf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5baf('0x1'));var fs=require('fs');var Redis=require(_0x5baf('0x2'));var db=require(_0x5baf('0x3'))['db'];var utils=require(_0x5baf('0x4'));var logger=require('../../config/logger')(_0x5baf('0x5'));var config=require(_0x5baf('0x6'));var jayson=require(_0x5baf('0x7'));var client=jayson[_0x5baf('0x8')][_0x5baf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x26263e,_0x4b3674,_0x28ff4f){return new BPromise(function(_0x4f46df,_0x814f76){return client['request'](_0x26263e,_0x28ff4f)[_0x5baf('0xa')](function(_0x14021e){logger[_0x5baf('0xb')](_0x5baf('0xc'),_0x4b3674,_0x5baf('0xd'));logger['debug'](_0x5baf('0xe'),_0x4b3674,_0x5baf('0xd'),JSON[_0x5baf('0xf')](_0x14021e));if(_0x14021e[_0x5baf('0x10')]){if(_0x14021e[_0x5baf('0x10')][_0x5baf('0x11')]===0x1f4){logger['error'](_0x5baf('0xc'),_0x4b3674,_0x14021e[_0x5baf('0x10')][_0x5baf('0x12')]);return _0x814f76(_0x14021e[_0x5baf('0x10')][_0x5baf('0x12')]);}logger[_0x5baf('0x10')]('SquareRecording,\x20%s,\x20%s',_0x4b3674,_0x14021e[_0x5baf('0x10')][_0x5baf('0x12')]);return _0x4f46df(_0x14021e['error'][_0x5baf('0x12')]);}else{logger['info'](_0x5baf('0xc'),_0x4b3674,_0x5baf('0xd'));_0x4f46df(_0x14021e[_0x5baf('0x13')][_0x5baf('0x12')]);}})[_0x5baf('0x14')](function(_0x111f34){logger['error'](_0x5baf('0xc'),_0x4b3674,_0x111f34);_0x814f76(_0x111f34);});});}exports[_0x5baf('0x15')]=function(_0x6a8647){var _0x143844=this;return new Promise(function(_0x468756,_0x278566){return db[_0x5baf('0x16')][_0x5baf('0x17')](_0x6a8647[_0x5baf('0x18')],{'raw':_0x6a8647[_0x5baf('0x19')]?_0x6a8647[_0x5baf('0x19')][_0x5baf('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1cda07){logger['info'](_0x5baf('0x15'),_0x6a8647);logger[_0x5baf('0x1b')](_0x5baf('0x15'),_0x6a8647,JSON[_0x5baf('0xf')](_0x1cda07));_0x468756(_0x1cda07);})[_0x5baf('0x14')](function(_0x4f23b2){logger[_0x5baf('0x10')]('CreateSquareRecording',_0x4f23b2[_0x5baf('0x12')],_0x6a8647);_0x278566(_0x143844[_0x5baf('0x10')](0x1f4,_0x4f23b2[_0x5baf('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 942cc26..63feed8 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x21bab6,_0x1649d6){var _0x499be7=function(_0x14ed4b){while(--_0x14ed4b){_0x21bab6['push'](_0x21bab6['shift']());}};_0x499be7(++_0x1649d6);}(_0xe706,0xa3));var _0x6e70=function(_0x133ae7,_0x31bfd9){_0x133ae7=_0x133ae7-0x0;var _0x48677e=_0xe706[_0x133ae7];return _0x48677e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file +var _0xe706=['/describe','describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x250d30,_0x47671e){var _0x55326a=function(_0xde3c2){while(--_0xde3c2){_0x250d30['push'](_0x250d30['shift']());}};_0x55326a(++_0x47671e);}(_0xe706,0xa3));var _0x6e70=function(_0x2cc374,_0x21c582){_0x2cc374=_0x2cc374-0x0;var _0x306658=_0xe706[_0x2cc374];return _0x306658;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var controller=require(_0x6e70('0x9'));router[_0x6e70('0xa')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0xc')]);router[_0x6e70('0xa')](_0x6e70('0xd'),auth[_0x6e70('0xb')](),controller[_0x6e70('0xe')]);router[_0x6e70('0xa')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x10')]);router[_0x6e70('0x11')]('/',auth[_0x6e70('0xb')](),controller[_0x6e70('0x12')]);router[_0x6e70('0x13')](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller['update']);router['delete'](_0x6e70('0xf'),auth[_0x6e70('0xb')](),controller[_0x6e70('0x14')]);module[_0x6e70('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 282cd37..39e8b80 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 _0xa408=['BOOLEAN','STRING','DATE'];(function(_0x3db682,_0x41b272){var _0x417b88=function(_0x48265f){while(--_0x48265f){_0x3db682['push'](_0x3db682['shift']());}};_0x417b88(++_0x41b272);}(_0xa408,0xac));var _0x8a40=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xa408[_0x51020b];return _0x371e47;};'use strict';var Sequelize=require('sequelize');module['exports']={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x8a40('0x0')]},'request':{'type':Sequelize[_0x8a40('0x0')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8a40('0x0')]},'type':{'type':Sequelize[_0x8a40('0x0')]},'uniqueid':{'type':Sequelize[_0x8a40('0x0')]},'version':{'type':Sequelize[_0x8a40('0x0')]},'callerid':{'type':Sequelize[_0x8a40('0x0')]},'calleridname':{'type':Sequelize[_0x8a40('0x0')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x8a40('0x0')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x8a40('0x0')]},'rdnis':{'type':Sequelize[_0x8a40('0x0')]},'context':{'type':Sequelize[_0x8a40('0x0')]},'extension':{'type':Sequelize[_0x8a40('0x0')]},'priority':{'type':Sequelize[_0x8a40('0x0')]},'enhanced':{'type':Sequelize[_0x8a40('0x0')]},'accountcode':{'type':Sequelize[_0x8a40('0x0')]},'threadid':{'type':Sequelize[_0x8a40('0x0')]},'project_name':{'type':Sequelize[_0x8a40('0x0')]},'joinAt':{'type':Sequelize[_0x8a40('0x1')]},'leaveAt':{'type':Sequelize[_0x8a40('0x1')]},'bot':{'type':Sequelize[_0x8a40('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x5b01=['exports','STRING','DATE','sequelize'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0x5b01,0x10b));var _0x15b0=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x5b01[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require(_0x15b0('0x0'));module[_0x15b0('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x15b0('0x2')]},'request':{'type':Sequelize[_0x15b0('0x2')]},'channel':{'type':Sequelize[_0x15b0('0x2')]},'language':{'type':Sequelize[_0x15b0('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x15b0('0x2')]},'version':{'type':Sequelize[_0x15b0('0x2')]},'callerid':{'type':Sequelize[_0x15b0('0x2')]},'calleridname':{'type':Sequelize[_0x15b0('0x2')]},'callingpres':{'type':Sequelize[_0x15b0('0x2')]},'callingani2':{'type':Sequelize[_0x15b0('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x15b0('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x15b0('0x2')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize[_0x15b0('0x2')]},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x15b0('0x3')]},'leaveAt':{'type':Sequelize[_0x15b0('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 9f2ac8b..30bd637 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 _0x5c9f=['options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','send','index','SquareReport','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','pick','where','merge','VIRTUAL','filter'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5c9f,0x125));var _0xf5c9=function(_0x15ea09,_0x2f30ab){_0x15ea09=_0x15ea09-0x0;var _0x3e9c78=_0x5c9f[_0x15ea09];return _0x3e9c78;};'use strict';var emlformat=require(_0xf5c9('0x0'));var rimraf=require(_0xf5c9('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5c9('0x2'));var rp=require(_0xf5c9('0x3'));var moment=require(_0xf5c9('0x4'));var BPromise=require(_0xf5c9('0x5'));var Mustache=require(_0xf5c9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xf5c9('0x7'));var csv=require(_0xf5c9('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf5c9('0x9'));var _=require(_0xf5c9('0xa'));var squel=require(_0xf5c9('0xb'));var crypto=require('crypto');var jsforce=require(_0xf5c9('0xc'));var deskjs=require(_0xf5c9('0xd'));var toCsv=require(_0xf5c9('0x8'));var querystring=require(_0xf5c9('0xe'));var Papa=require(_0xf5c9('0xf'));var Redis=require('ioredis');var authService=require(_0xf5c9('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xf5c9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5c9('0x12'))('api');var utils=require(_0xf5c9('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e3769,_0x514034){_0x514034=_0x514034||0xcc;return function(_0x7e7dc1){if(_0x7e7dc1){return _0x1e3769[_0xf5c9('0x14')](_0x514034);}return _0x1e3769['status'](_0x514034)['end']();};}function respondWithResult(_0x406456,_0x2087d5){_0x2087d5=_0x2087d5||0xc8;return function(_0x27377e){if(_0x27377e){return _0x406456[_0xf5c9('0x15')](_0x2087d5)[_0xf5c9('0x16')](_0x27377e);}};}function respondWithFilteredResult(_0x370efe,_0x26251e){return function(_0x47e8e7){if(_0x47e8e7){var _0x4f34a6=typeof _0x26251e[_0xf5c9('0x17')]==='undefined'&&typeof _0x26251e[_0xf5c9('0x18')]==='undefined';var _0x5c1fce=_0x47e8e7['count'];var _0x50945d=_0x4f34a6?0x0:_0x26251e[_0xf5c9('0x17')];var _0x38b007=_0x4f34a6?_0x47e8e7[_0xf5c9('0x19')]:_0x26251e[_0xf5c9('0x17')]+_0x26251e['limit'];var _0x347952;if(_0x38b007>=_0x5c1fce){_0x38b007=_0x5c1fce;_0x347952=0xc8;}else{_0x347952=0xce;}_0x370efe['status'](_0x347952);return _0x370efe['set'](_0xf5c9('0x1a'),_0x50945d+'-'+_0x38b007+'/'+_0x5c1fce)[_0xf5c9('0x16')](_0x47e8e7);}return null;};}function patchUpdates(_0x35237b){return function(_0x294f3c){try{jsonpatch[_0xf5c9('0x1b')](_0x294f3c,_0x35237b,!![]);}catch(_0x3f1ada){return BPromise[_0xf5c9('0x1c')](_0x3f1ada);}return _0x294f3c[_0xf5c9('0x1d')]();};}function saveUpdates(_0x121669,_0x4bac76){return function(_0x306cd1){if(_0x306cd1){return _0x306cd1[_0xf5c9('0x1e')](_0x121669)[_0xf5c9('0x1f')](function(_0x123fde){return _0x123fde;});}return null;};}function removeEntity(_0x26c6e0,_0x3c74cc){return function(_0x102185){if(_0x102185){return _0x102185[_0xf5c9('0x20')]()['then'](function(){_0x26c6e0['status'](0xcc)[_0xf5c9('0x21')]();});}};}function handleEntityNotFound(_0x3db944,_0x472478){return function(_0x5b8268){if(!_0x5b8268){_0x3db944[_0xf5c9('0x14')](0x194);}return _0x5b8268;};}function handleError(_0x239fc3,_0x25d1db){_0x25d1db=_0x25d1db||0x1f4;return function(_0x51354d){logger['error'](_0x51354d[_0xf5c9('0x22')]);if(_0x51354d[_0xf5c9('0x23')]){delete _0x51354d[_0xf5c9('0x23')];}_0x239fc3[_0xf5c9('0x15')](_0x25d1db)[_0xf5c9('0x24')](_0x51354d);};}exports[_0xf5c9('0x25')]=function(_0x52d2f0,_0x40ef89){var _0x34423a={},_0x3a1df0={},_0x211776={'count':0x0,'rows':[]};var _0x522f93=_['map'](db[_0xf5c9('0x26')]['rawAttributes'],function(_0x3476b1){return{'name':_0x3476b1[_0xf5c9('0x27')],'type':_0x3476b1[_0xf5c9('0x28')]['key']};});_0x3a1df0[_0xf5c9('0x29')]=_[_0xf5c9('0x2a')](_0x522f93,_0xf5c9('0x23'));_0x3a1df0[_0xf5c9('0x2b')]=_[_0xf5c9('0x2c')](_0x52d2f0[_0xf5c9('0x2b')]);_0x3a1df0[_0xf5c9('0x2d')]=_[_0xf5c9('0x2e')](_0x3a1df0['model'],_0x3a1df0[_0xf5c9('0x2b')]);_0x34423a[_0xf5c9('0x2f')]=_[_0xf5c9('0x2e')](_0x3a1df0[_0xf5c9('0x29')],qs[_0xf5c9('0x30')](_0x52d2f0['query'][_0xf5c9('0x30')]));_0x34423a[_0xf5c9('0x2f')]=_0x34423a[_0xf5c9('0x2f')][_0xf5c9('0x31')]?_0x34423a[_0xf5c9('0x2f')]:_0x3a1df0[_0xf5c9('0x29')];if(!_0x52d2f0[_0xf5c9('0x2b')]['hasOwnProperty'](_0xf5c9('0x32'))){_0x34423a[_0xf5c9('0x18')]=qs[_0xf5c9('0x18')](_0x52d2f0['query']['limit']);_0x34423a[_0xf5c9('0x17')]=qs[_0xf5c9('0x17')](_0x52d2f0[_0xf5c9('0x2b')][_0xf5c9('0x17')]);}_0x34423a['order']=qs[_0xf5c9('0x33')](_0x52d2f0[_0xf5c9('0x2b')][_0xf5c9('0x33')]);_0x34423a['where']=qs[_0xf5c9('0x2d')](_[_0xf5c9('0x34')](_0x52d2f0[_0xf5c9('0x2b')],_0x3a1df0[_0xf5c9('0x2d')]),_0x522f93);if(_0x52d2f0[_0xf5c9('0x2b')]['filter']){_0x34423a[_0xf5c9('0x35')]=_[_0xf5c9('0x36')](_0x34423a[_0xf5c9('0x35')],{'$or':_[_0xf5c9('0x2a')](_0x522f93,function(_0x2cca18){if(_0x2cca18[_0xf5c9('0x28')]!==_0xf5c9('0x37')){var _0xca96db={};_0xca96db[_0x2cca18[_0xf5c9('0x23')]]={'$like':'%'+_0x52d2f0[_0xf5c9('0x2b')][_0xf5c9('0x38')]+'%'};return _0xca96db;}})});}_0x34423a=_['merge']({},_0x34423a,_0x52d2f0[_0xf5c9('0x39')]);var _0x73eaaf={'where':_0x34423a[_0xf5c9('0x35')]};return db['SquareReport'][_0xf5c9('0x19')](_0x73eaaf)[_0xf5c9('0x1f')](function(_0x44ea2b){_0x211776['count']=_0x44ea2b;if(_0x52d2f0[_0xf5c9('0x2b')]['includeAll']){_0x34423a[_0xf5c9('0x3a')]=[{'all':!![]}];}return db[_0xf5c9('0x26')][_0xf5c9('0x3b')](_0x34423a);})[_0xf5c9('0x1f')](function(_0x4c5273){_0x211776[_0xf5c9('0x3c')]=_0x4c5273;return _0x211776;})[_0xf5c9('0x1f')](respondWithFilteredResult(_0x40ef89,_0x34423a))[_0xf5c9('0x3d')](handleError(_0x40ef89,null));};exports[_0xf5c9('0x3e')]=function(_0x3a6a91,_0x29fcd2){var _0x4047c0={'raw':!![],'where':{'id':_0x3a6a91[_0xf5c9('0x3f')]['id']}},_0x386e8c={};_0x386e8c[_0xf5c9('0x29')]=_[_0xf5c9('0x2c')](db[_0xf5c9('0x26')][_0xf5c9('0x40')]);_0x386e8c[_0xf5c9('0x2b')]=_['keys'](_0x3a6a91['query']);_0x386e8c[_0xf5c9('0x2d')]=_[_0xf5c9('0x2e')](_0x386e8c[_0xf5c9('0x29')],_0x386e8c[_0xf5c9('0x2b')]);_0x4047c0[_0xf5c9('0x2f')]=_[_0xf5c9('0x2e')](_0x386e8c[_0xf5c9('0x29')],qs['fields'](_0x3a6a91['query']['fields']));_0x4047c0[_0xf5c9('0x2f')]=_0x4047c0[_0xf5c9('0x2f')]['length']?_0x4047c0['attributes']:_0x386e8c['model'];if(_0x3a6a91[_0xf5c9('0x2b')][_0xf5c9('0x41')]){_0x4047c0[_0xf5c9('0x3a')]=[{'all':!![]}];}_0x4047c0=_[_0xf5c9('0x36')]({},_0x4047c0,_0x3a6a91[_0xf5c9('0x39')]);return db[_0xf5c9('0x26')][_0xf5c9('0x42')](_0x4047c0)['then'](handleEntityNotFound(_0x29fcd2,null))[_0xf5c9('0x1f')](respondWithResult(_0x29fcd2,null))['catch'](handleError(_0x29fcd2,null));};exports[_0xf5c9('0x43')]=function(_0x530503,_0x4365fc){return db[_0xf5c9('0x26')][_0xf5c9('0x43')](_0x530503['body'],{})[_0xf5c9('0x1f')](respondWithResult(_0x4365fc,0xc9))[_0xf5c9('0x3d')](handleError(_0x4365fc,null));};exports[_0xf5c9('0x1e')]=function(_0x4a93ab,_0x63eb2d){if(_0x4a93ab['body']['id']){delete _0x4a93ab['body']['id'];}return db[_0xf5c9('0x26')][_0xf5c9('0x42')]({'where':{'id':_0x4a93ab[_0xf5c9('0x3f')]['id']}})[_0xf5c9('0x1f')](handleEntityNotFound(_0x63eb2d,null))[_0xf5c9('0x1f')](saveUpdates(_0x4a93ab[_0xf5c9('0x44')],null))[_0xf5c9('0x1f')](respondWithResult(_0x63eb2d,null))['catch'](handleError(_0x63eb2d,null));};exports['destroy']=function(_0x29cbed,_0x5ed1d8){return db[_0xf5c9('0x26')][_0xf5c9('0x42')]({'where':{'id':_0x29cbed['params']['id']}})[_0xf5c9('0x1f')](handleEntityNotFound(_0x5ed1d8,null))[_0xf5c9('0x1f')](removeEntity(_0x5ed1d8,null))['catch'](handleError(_0x5ed1d8,null));};exports[_0xf5c9('0x45')]=function(_0x1d60d8,_0x5568e7){return db['SquareReport'][_0xf5c9('0x45')]()['then'](respondWithResult(_0x5568e7,null))['catch'](handleError(_0x5568e7,null));}; \ No newline at end of file +var _0x07d8=['rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','end','error','name','index','SquareReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','describe'];(function(_0x2af58a,_0x512dfc){var _0x94f235=function(_0x7a4f05){while(--_0x7a4f05){_0x2af58a['push'](_0x2af58a['shift']());}};_0x94f235(++_0x512dfc);}(_0x07d8,0xe7));var _0x807d=function(_0x2bb612,_0xaedf28){_0x2bb612=_0x2bb612-0x0;var _0x4ef64c=_0x07d8[_0x2bb612];return _0x4ef64c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x807d('0x0'));var zipdir=require(_0x807d('0x1'));var jsonpatch=require(_0x807d('0x2'));var rp=require(_0x807d('0x3'));var moment=require('moment');var BPromise=require(_0x807d('0x4'));var Mustache=require(_0x807d('0x5'));var util=require(_0x807d('0x6'));var path=require(_0x807d('0x7'));var sox=require(_0x807d('0x8'));var csv=require(_0x807d('0x9'));var ejs=require(_0x807d('0xa'));var fs=require('fs');var fs_extra=require(_0x807d('0xb'));var _=require(_0x807d('0xc'));var squel=require(_0x807d('0xd'));var crypto=require('crypto');var jsforce=require(_0x807d('0xe'));var deskjs=require(_0x807d('0xf'));var toCsv=require('to-csv');var querystring=require(_0x807d('0x10'));var Papa=require(_0x807d('0x11'));var Redis=require('ioredis');var authService=require(_0x807d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x807d('0x13'));var hardwareService=require(_0x807d('0x14'));var logger=require(_0x807d('0x15'))(_0x807d('0x16'));var utils=require(_0x807d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x807d('0x18'));var db=require(_0x807d('0x19'))['db'];function respondWithStatusCode(_0x5d5ce2,_0x108f2a){_0x108f2a=_0x108f2a||0xcc;return function(_0x1d1002){if(_0x1d1002){return _0x5d5ce2[_0x807d('0x1a')](_0x108f2a);}return _0x5d5ce2[_0x807d('0x1b')](_0x108f2a)['end']();};}function respondWithResult(_0x3a6369,_0x55920e){_0x55920e=_0x55920e||0xc8;return function(_0x229cb1){if(_0x229cb1){return _0x3a6369[_0x807d('0x1b')](_0x55920e)[_0x807d('0x1c')](_0x229cb1);}};}function respondWithFilteredResult(_0x4fdaa0,_0x24871d){return function(_0x4640eb){if(_0x4640eb){var _0x2eb8d0=typeof _0x24871d[_0x807d('0x1d')]===_0x807d('0x1e')&&typeof _0x24871d['limit']==='undefined';var _0x26901d=_0x4640eb[_0x807d('0x1f')];var _0x2b33c6=_0x2eb8d0?0x0:_0x24871d['offset'];var _0xf3b563=_0x2eb8d0?_0x4640eb['count']:_0x24871d[_0x807d('0x1d')]+_0x24871d[_0x807d('0x20')];var _0x3e397d;if(_0xf3b563>=_0x26901d){_0xf3b563=_0x26901d;_0x3e397d=0xc8;}else{_0x3e397d=0xce;}_0x4fdaa0[_0x807d('0x1b')](_0x3e397d);return _0x4fdaa0[_0x807d('0x21')]('Content-Range',_0x2b33c6+'-'+_0xf3b563+'/'+_0x26901d)[_0x807d('0x1c')](_0x4640eb);}return null;};}function patchUpdates(_0x31dda4){return function(_0x292708){try{jsonpatch[_0x807d('0x22')](_0x292708,_0x31dda4,!![]);}catch(_0x172588){return BPromise[_0x807d('0x23')](_0x172588);}return _0x292708[_0x807d('0x24')]();};}function saveUpdates(_0x4579c4,_0x5c1992){return function(_0x432de8){if(_0x432de8){return _0x432de8[_0x807d('0x25')](_0x4579c4)[_0x807d('0x26')](function(_0x3a148a){return _0x3a148a;});}return null;};}function removeEntity(_0x1ab873,_0x3ddaf9){return function(_0x4133a4){if(_0x4133a4){return _0x4133a4['destroy']()[_0x807d('0x26')](function(){_0x1ab873['status'](0xcc)[_0x807d('0x27')]();});}};}function handleEntityNotFound(_0x3119f5,_0x12fd31){return function(_0x3b78a9){if(!_0x3b78a9){_0x3119f5[_0x807d('0x1a')](0x194);}return _0x3b78a9;};}function handleError(_0x2146d7,_0x460d50){_0x460d50=_0x460d50||0x1f4;return function(_0x48cccf){logger[_0x807d('0x28')](_0x48cccf['stack']);if(_0x48cccf[_0x807d('0x29')]){delete _0x48cccf[_0x807d('0x29')];}_0x2146d7[_0x807d('0x1b')](_0x460d50)['send'](_0x48cccf);};}exports[_0x807d('0x2a')]=function(_0x5323ef,_0x30d7a9){var _0x1138a1={},_0x115b98={},_0x139f06={'count':0x0,'rows':[]};var _0x543bf3=_['map'](db[_0x807d('0x2b')][_0x807d('0x2c')],function(_0x4fe93c){return{'name':_0x4fe93c[_0x807d('0x2d')],'type':_0x4fe93c[_0x807d('0x2e')]['key']};});_0x115b98[_0x807d('0x2f')]=_[_0x807d('0x30')](_0x543bf3,_0x807d('0x29'));_0x115b98[_0x807d('0x31')]=_[_0x807d('0x32')](_0x5323ef[_0x807d('0x31')]);_0x115b98[_0x807d('0x33')]=_[_0x807d('0x34')](_0x115b98['model'],_0x115b98[_0x807d('0x31')]);_0x1138a1[_0x807d('0x35')]=_['intersection'](_0x115b98['model'],qs[_0x807d('0x36')](_0x5323ef[_0x807d('0x31')][_0x807d('0x36')]));_0x1138a1['attributes']=_0x1138a1[_0x807d('0x35')][_0x807d('0x37')]?_0x1138a1['attributes']:_0x115b98[_0x807d('0x2f')];if(!_0x5323ef['query'][_0x807d('0x38')](_0x807d('0x39'))){_0x1138a1[_0x807d('0x20')]=qs[_0x807d('0x20')](_0x5323ef[_0x807d('0x31')][_0x807d('0x20')]);_0x1138a1[_0x807d('0x1d')]=qs[_0x807d('0x1d')](_0x5323ef[_0x807d('0x31')]['offset']);}_0x1138a1[_0x807d('0x3a')]=qs[_0x807d('0x3b')](_0x5323ef['query'][_0x807d('0x3b')]);_0x1138a1['where']=qs[_0x807d('0x33')](_[_0x807d('0x3c')](_0x5323ef[_0x807d('0x31')],_0x115b98[_0x807d('0x33')]),_0x543bf3);if(_0x5323ef[_0x807d('0x31')][_0x807d('0x3d')]){_0x1138a1[_0x807d('0x3e')]=_[_0x807d('0x3f')](_0x1138a1[_0x807d('0x3e')],{'$or':_[_0x807d('0x30')](_0x543bf3,function(_0x45b1f4){if(_0x45b1f4[_0x807d('0x2e')]!==_0x807d('0x40')){var _0x24ebe6={};_0x24ebe6[_0x45b1f4['name']]={'$like':'%'+_0x5323ef[_0x807d('0x31')][_0x807d('0x3d')]+'%'};return _0x24ebe6;}})});}_0x1138a1=_[_0x807d('0x3f')]({},_0x1138a1,_0x5323ef['options']);var _0x2f9fb8={'where':_0x1138a1['where']};return db[_0x807d('0x2b')]['count'](_0x2f9fb8)[_0x807d('0x26')](function(_0xef1abb){_0x139f06['count']=_0xef1abb;if(_0x5323ef[_0x807d('0x31')][_0x807d('0x41')]){_0x1138a1[_0x807d('0x42')]=[{'all':!![]}];}return db[_0x807d('0x2b')][_0x807d('0x43')](_0x1138a1);})['then'](function(_0x455045){_0x139f06[_0x807d('0x44')]=_0x455045;return _0x139f06;})['then'](respondWithFilteredResult(_0x30d7a9,_0x1138a1))[_0x807d('0x45')](handleError(_0x30d7a9,null));};exports[_0x807d('0x46')]=function(_0x53cf1d,_0x123498){var _0x5ee4de={'raw':!![],'where':{'id':_0x53cf1d[_0x807d('0x47')]['id']}},_0x2ddad6={};_0x2ddad6['model']=_['keys'](db[_0x807d('0x2b')][_0x807d('0x2c')]);_0x2ddad6[_0x807d('0x31')]=_['keys'](_0x53cf1d[_0x807d('0x31')]);_0x2ddad6[_0x807d('0x33')]=_[_0x807d('0x34')](_0x2ddad6[_0x807d('0x2f')],_0x2ddad6['query']);_0x5ee4de[_0x807d('0x35')]=_[_0x807d('0x34')](_0x2ddad6['model'],qs[_0x807d('0x36')](_0x53cf1d[_0x807d('0x31')][_0x807d('0x36')]));_0x5ee4de[_0x807d('0x35')]=_0x5ee4de[_0x807d('0x35')]['length']?_0x5ee4de['attributes']:_0x2ddad6[_0x807d('0x2f')];if(_0x53cf1d[_0x807d('0x31')]['includeAll']){_0x5ee4de[_0x807d('0x42')]=[{'all':!![]}];}_0x5ee4de=_[_0x807d('0x3f')]({},_0x5ee4de,_0x53cf1d['options']);return db[_0x807d('0x2b')]['find'](_0x5ee4de)[_0x807d('0x26')](handleEntityNotFound(_0x123498,null))['then'](respondWithResult(_0x123498,null))['catch'](handleError(_0x123498,null));};exports[_0x807d('0x48')]=function(_0xe8e86f,_0x2e6618){return db[_0x807d('0x2b')][_0x807d('0x48')](_0xe8e86f[_0x807d('0x49')],{})[_0x807d('0x26')](respondWithResult(_0x2e6618,0xc9))[_0x807d('0x45')](handleError(_0x2e6618,null));};exports['update']=function(_0x26db3f,_0x16a1e9){if(_0x26db3f[_0x807d('0x49')]['id']){delete _0x26db3f[_0x807d('0x49')]['id'];}return db[_0x807d('0x2b')][_0x807d('0x4a')]({'where':{'id':_0x26db3f['params']['id']}})[_0x807d('0x26')](handleEntityNotFound(_0x16a1e9,null))[_0x807d('0x26')](saveUpdates(_0x26db3f[_0x807d('0x49')],null))['then'](respondWithResult(_0x16a1e9,null))['catch'](handleError(_0x16a1e9,null));};exports[_0x807d('0x4b')]=function(_0x1ec49a,_0x1455c5){return db[_0x807d('0x2b')]['find']({'where':{'id':_0x1ec49a[_0x807d('0x47')]['id']}})[_0x807d('0x26')](handleEntityNotFound(_0x1455c5,null))[_0x807d('0x26')](removeEntity(_0x1455c5,null))[_0x807d('0x45')](handleError(_0x1455c5,null));};exports['describe']=function(_0x26183b,_0x11790e){return db[_0x807d('0x2b')][_0x807d('0x4c')]()[_0x807d('0x26')](respondWithResult(_0x11790e,null))[_0x807d('0x45')](handleError(_0x11790e,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index aa04956..6bee18c 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 _0x9fe1=['leaveAt','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','SquareReport','report_square','uniqueid','project_name'];(function(_0x5bdc5e,_0x342a67){var _0x1c22ac=function(_0x20b1d5){while(--_0x20b1d5){_0x5bdc5e['push'](_0x5bdc5e['shift']());}};_0x1c22ac(++_0x342a67);}(_0x9fe1,0x17b));var _0x19fe=function(_0x25790d,_0x5b9f1f){_0x25790d=_0x25790d-0x0;var _0xc42288=_0x9fe1[_0x25790d];return _0xc42288;};'use strict';var _=require('lodash');var util=require(_0x19fe('0x0'));var logger=require(_0x19fe('0x1'))('api');var moment=require(_0x19fe('0x2'));var BPromise=require(_0x19fe('0x3'));var rp=require(_0x19fe('0x4'));var fs=require('fs');var path=require(_0x19fe('0x5'));var rimraf=require(_0x19fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x19fe('0x7'));module[_0x19fe('0x8')]=function(_0x88cf50,_0x5aed55){return _0x88cf50['define'](_0x19fe('0x9'),attributes,{'tableName':_0x19fe('0xa'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x19fe('0xb'),_0x19fe('0xc')]},{'name':_0x19fe('0xd'),'fields':[_0x19fe('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x941a=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./squareReport.attributes','exports','define','uid_pname','leaveAt'];(function(_0x58c851,_0x1f3d96){var _0x534d8a=function(_0x10c1a0){while(--_0x10c1a0){_0x58c851['push'](_0x58c851['shift']());}};_0x534d8a(++_0x1f3d96);}(_0x941a,0x1a4));var _0xa941=function(_0x436422,_0x37e582){_0x436422=_0x436422-0x0;var _0x190fa3=_0x941a[_0x436422];return _0x190fa3;};'use strict';var _=require(_0xa941('0x0'));var util=require('util');var logger=require(_0xa941('0x1'))(_0xa941('0x2'));var moment=require('moment');var BPromise=require(_0xa941('0x3'));var rp=require(_0xa941('0x4'));var fs=require('fs');var path=require(_0xa941('0x5'));var rimraf=require(_0xa941('0x6'));var config=require('../../config/environment');var attributes=require(_0xa941('0x7'));module[_0xa941('0x8')]=function(_0x3582ee,_0x32a512){return _0x3582ee[_0xa941('0x9')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0xa941('0xa'),'fields':['uniqueid','project_name']},{'name':_0xa941('0xb'),'fields':[_0xa941('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index abf0290..4e3bdba 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 _0xd20a=['result','SquareReport','create','body','options','raw','CreateSquareReport','UpdateSquareReport','where','limit','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','debug','stringify','error','code','message','SquareReport,\x20%s,\x20%s','request\x20sent'];(function(_0x53e64c,_0x5b7d92){var _0x4da66d=function(_0x2b67f1){while(--_0x2b67f1){_0x53e64c['push'](_0x53e64c['shift']());}};_0x4da66d(++_0x5b7d92);}(_0xd20a,0xcb));var _0xad20=function(_0x19ca62,_0x5e90ef){_0x19ca62=_0x19ca62-0x0;var _0x5907cc=_0xd20a[_0x19ca62];return _0x5907cc;};'use strict';var _=require(_0xad20('0x0'));var util=require(_0xad20('0x1'));var moment=require('moment');var BPromise=require(_0xad20('0x2'));var rs=require(_0xad20('0x3'));var fs=require('fs');var Redis=require(_0xad20('0x4'));var db=require(_0xad20('0x5'))['db'];var utils=require(_0xad20('0x6'));var logger=require(_0xad20('0x7'))('rpc');var config=require(_0xad20('0x8'));var jayson=require(_0xad20('0x9'));var client=jayson['client'][_0xad20('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34dd6c,_0x52f034,_0x168e95){return new BPromise(function(_0xd19b61,_0x5eaaff){return client[_0xad20('0xb')](_0x34dd6c,_0x168e95)[_0xad20('0xc')](function(_0x138842){logger[_0xad20('0xd')]('SquareReport,\x20%s,\x20%s',_0x52f034,'request\x20sent');logger[_0xad20('0xe')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x52f034,'request\x20sent',JSON[_0xad20('0xf')](_0x138842));if(_0x138842[_0xad20('0x10')]){if(_0x138842[_0xad20('0x10')][_0xad20('0x11')]===0x1f4){logger[_0xad20('0x10')]('SquareReport,\x20%s,\x20%s',_0x52f034,_0x138842[_0xad20('0x10')][_0xad20('0x12')]);return _0x5eaaff(_0x138842[_0xad20('0x10')][_0xad20('0x12')]);}logger[_0xad20('0x10')](_0xad20('0x13'),_0x52f034,_0x138842[_0xad20('0x10')][_0xad20('0x12')]);return _0xd19b61(_0x138842[_0xad20('0x10')][_0xad20('0x12')]);}else{logger[_0xad20('0xd')](_0xad20('0x13'),_0x52f034,_0xad20('0x14'));_0xd19b61(_0x138842[_0xad20('0x15')][_0xad20('0x12')]);}})['catch'](function(_0x195c3c){logger[_0xad20('0x10')](_0xad20('0x13'),_0x52f034,_0x195c3c);_0x5eaaff(_0x195c3c);});});}exports['CreateSquareReport']=function(_0x15b138){var _0x50f38c=this;return new Promise(function(_0x1565dc,_0x10f539){return db[_0xad20('0x16')][_0xad20('0x17')](_0x15b138[_0xad20('0x18')],{'raw':_0x15b138['options']?_0x15b138[_0xad20('0x19')][_0xad20('0x1a')]===undefined?!![]:![]:!![]})[_0xad20('0xc')](function(_0x14dd5b){logger[_0xad20('0xd')]('CreateSquareReport',_0x15b138);logger['debug'](_0xad20('0x1b'),_0x15b138,JSON[_0xad20('0xf')](_0x14dd5b));_0x1565dc(_0x14dd5b);})['catch'](function(_0xb4c6c2){logger[_0xad20('0x10')]('CreateSquareReport',_0xb4c6c2[_0xad20('0x12')],_0x15b138);_0x10f539(_0x50f38c['error'](0x1f4,_0xb4c6c2[_0xad20('0x12')]));});});};exports[_0xad20('0x1c')]=function(_0x56fc64){var _0x31086a=this;return new Promise(function(_0x4b3658,_0x1e44fa){return db[_0xad20('0x16')]['update'](_0x56fc64[_0xad20('0x18')],{'raw':_0x56fc64[_0xad20('0x19')]?_0x56fc64['options'][_0xad20('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x56fc64[_0xad20('0x19')]?_0x56fc64[_0xad20('0x19')][_0xad20('0x1d')]||null:null,'attributes':_0x56fc64['options']?_0x56fc64[_0xad20('0x19')]['attributes']||null:null,'limit':_0x56fc64[_0xad20('0x19')]?_0x56fc64[_0xad20('0x19')][_0xad20('0x1e')]||null:null})[_0xad20('0xc')](function(_0x860552){logger[_0xad20('0xd')]('UpdateSquareReport',_0x56fc64);logger[_0xad20('0xe')]('UpdateSquareReport',_0x56fc64,JSON[_0xad20('0xf')](_0x860552));_0x4b3658(_0x860552);})[_0xad20('0x1f')](function(_0x181513){logger[_0xad20('0x10')](_0xad20('0x1c'),_0x181513[_0xad20('0x12')],_0x56fc64);_0x1e44fa(_0x31086a[_0xad20('0x10')](0x1f4,_0x181513[_0xad20('0x12')]));});});}; \ No newline at end of file +var _0xec1d=['stringify','error','code','message','catch','CreateSquareReport','create','options','then','UpdateSquareReport','raw','where','attributes','limit','lodash','util','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x36c282,_0x1c77f6){var _0x4bf721=function(_0x559284){while(--_0x559284){_0x36c282['push'](_0x36c282['shift']());}};_0x4bf721(++_0x1c77f6);}(_0xec1d,0x90));var _0xdec1=function(_0x2536cf,_0x581b3a){_0x2536cf=_0x2536cf-0x0;var _0x551550=_0xec1d[_0x2536cf];return _0x551550;};'use strict';var _=require(_0xdec1('0x0'));var util=require(_0xdec1('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdec1('0x2'))['db'];var utils=require(_0xdec1('0x3'));var logger=require('../../config/logger')(_0xdec1('0x4'));var config=require('../../config/environment');var jayson=require(_0xdec1('0x5'));var client=jayson[_0xdec1('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c3d8e,_0x11e26f,_0x2e98cf){return new BPromise(function(_0x2b37dd,_0x2509ec){return client[_0xdec1('0x7')](_0x5c3d8e,_0x2e98cf)['then'](function(_0x4f9ead){logger[_0xdec1('0x8')](_0xdec1('0x9'),_0x11e26f,_0xdec1('0xa'));logger[_0xdec1('0xb')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x11e26f,_0xdec1('0xa'),JSON[_0xdec1('0xc')](_0x4f9ead));if(_0x4f9ead[_0xdec1('0xd')]){if(_0x4f9ead[_0xdec1('0xd')][_0xdec1('0xe')]===0x1f4){logger[_0xdec1('0xd')](_0xdec1('0x9'),_0x11e26f,_0x4f9ead[_0xdec1('0xd')][_0xdec1('0xf')]);return _0x2509ec(_0x4f9ead[_0xdec1('0xd')][_0xdec1('0xf')]);}logger[_0xdec1('0xd')](_0xdec1('0x9'),_0x11e26f,_0x4f9ead[_0xdec1('0xd')]['message']);return _0x2b37dd(_0x4f9ead[_0xdec1('0xd')][_0xdec1('0xf')]);}else{logger[_0xdec1('0x8')](_0xdec1('0x9'),_0x11e26f,'request\x20sent');_0x2b37dd(_0x4f9ead['result'][_0xdec1('0xf')]);}})[_0xdec1('0x10')](function(_0x45b387){logger[_0xdec1('0xd')](_0xdec1('0x9'),_0x11e26f,_0x45b387);_0x2509ec(_0x45b387);});});}exports[_0xdec1('0x11')]=function(_0x136aee){var _0x2f317b=this;return new Promise(function(_0x5c7424,_0x5ab114){return db['SquareReport'][_0xdec1('0x12')](_0x136aee['body'],{'raw':_0x136aee['options']?_0x136aee[_0xdec1('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xdec1('0x14')](function(_0x232796){logger[_0xdec1('0x8')]('CreateSquareReport',_0x136aee);logger[_0xdec1('0xb')](_0xdec1('0x11'),_0x136aee,JSON[_0xdec1('0xc')](_0x232796));_0x5c7424(_0x232796);})[_0xdec1('0x10')](function(_0x54d898){logger[_0xdec1('0xd')]('CreateSquareReport',_0x54d898[_0xdec1('0xf')],_0x136aee);_0x5ab114(_0x2f317b[_0xdec1('0xd')](0x1f4,_0x54d898[_0xdec1('0xf')]));});});};exports[_0xdec1('0x15')]=function(_0x3f33e0){var _0x355e15=this;return new Promise(function(_0x2b9677,_0x41aa38){return db['SquareReport']['update'](_0x3f33e0['body'],{'raw':_0x3f33e0[_0xdec1('0x13')]?_0x3f33e0[_0xdec1('0x13')][_0xdec1('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3f33e0[_0xdec1('0x13')]?_0x3f33e0[_0xdec1('0x13')][_0xdec1('0x17')]||null:null,'attributes':_0x3f33e0[_0xdec1('0x13')]?_0x3f33e0['options'][_0xdec1('0x18')]||null:null,'limit':_0x3f33e0[_0xdec1('0x13')]?_0x3f33e0[_0xdec1('0x13')][_0xdec1('0x19')]||null:null})[_0xdec1('0x14')](function(_0x2c2474){logger[_0xdec1('0x8')](_0xdec1('0x15'),_0x3f33e0);logger[_0xdec1('0xb')](_0xdec1('0x15'),_0x3f33e0,JSON[_0xdec1('0xc')](_0x2c2474));_0x2b9677(_0x2c2474);})[_0xdec1('0x10')](function(_0x43e702){logger[_0xdec1('0xd')](_0xdec1('0x15'),_0x43e702[_0xdec1('0xf')],_0x3f33e0);_0x41aa38(_0x355e15['error'](0x1f4,_0x43e702[_0xdec1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index a47b035..3ce01ef 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 _0x0789=['put','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','/describe','describe','/:id','post','create'];(function(_0x727dfa,_0x2327cf){var _0x1562ad=function(_0x47cd05){while(--_0x47cd05){_0x727dfa['push'](_0x727dfa['shift']());}};_0x1562ad(++_0x2327cf);}(_0x0789,0x180));var _0x9078=function(_0x556097,_0x2c556c){_0x556097=_0x556097-0x0;var _0x1d9fc5=_0x0789[_0x556097];return _0x1d9fc5;};'use strict';var multer=require(_0x9078('0x0'));var util=require(_0x9078('0x1'));var path=require(_0x9078('0x2'));var timeout=require('connect-timeout');var express=require(_0x9078('0x3'));var router=express['Router']();var fs_extra=require(_0x9078('0x4'));var auth=require(_0x9078('0x5'));var interaction=require(_0x9078('0x6'));var config=require(_0x9078('0x7'));var controller=require(_0x9078('0x8'));router[_0x9078('0x9')]('/',auth[_0x9078('0xa')](),controller['index']);router[_0x9078('0x9')](_0x9078('0xb'),auth[_0x9078('0xa')](),controller[_0x9078('0xc')]);router[_0x9078('0x9')](_0x9078('0xd'),auth[_0x9078('0xa')](),controller['show']);router[_0x9078('0xe')]('/',auth[_0x9078('0xa')](),controller[_0x9078('0xf')]);router[_0x9078('0x10')](_0x9078('0xd'),auth[_0x9078('0xa')](),controller[_0x9078('0x11')]);router[_0x9078('0x12')](_0x9078('0xd'),auth[_0x9078('0xa')](),controller['destroy']);module[_0x9078('0x13')]=router; \ No newline at end of file +var _0x4109=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x4b7c81,_0x4bc8a8){var _0xe1b246=function(_0x4dc279){while(--_0x4dc279){_0x4b7c81['push'](_0x4b7c81['shift']());}};_0xe1b246(++_0x4bc8a8);}(_0x4109,0x1c2));var _0x9410=function(_0x43b5d4,_0x35796e){_0x43b5d4=_0x43b5d4-0x0;var _0x59f61b=_0x4109[_0x43b5d4];return _0x59f61b;};'use strict';var multer=require(_0x9410('0x0'));var util=require('util');var path=require(_0x9410('0x1'));var timeout=require('connect-timeout');var express=require(_0x9410('0x2'));var router=express['Router']();var fs_extra=require(_0x9410('0x3'));var auth=require(_0x9410('0x4'));var interaction=require(_0x9410('0x5'));var config=require(_0x9410('0x6'));var controller=require('./squareReportDetail.controller');router[_0x9410('0x7')]('/',auth[_0x9410('0x8')](),controller[_0x9410('0x9')]);router[_0x9410('0x7')](_0x9410('0xa'),auth[_0x9410('0x8')](),controller[_0x9410('0xb')]);router['get'](_0x9410('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x9410('0x8')](),controller[_0x9410('0xd')]);router[_0x9410('0xe')](_0x9410('0xc'),auth['isAuthenticated'](),controller[_0x9410('0xf')]);router[_0x9410('0x10')](_0x9410('0xc'),auth['isAuthenticated'](),controller[_0x9410('0x11')]);module[_0x9410('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 5ee45d3..517c9f6 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 _0x706d=['TEXT','sequelize','exports','STRING'];(function(_0x574337,_0x3aea7a){var _0x26179c=function(_0x194e86){while(--_0x194e86){_0x574337['push'](_0x574337['shift']());}};_0x26179c(++_0x3aea7a);}(_0x706d,0x1cd));var _0xd706=function(_0x407080,_0x3bc784){_0x407080=_0x407080-0x0;var _0x52acd6=_0x706d[_0x407080];return _0x52acd6;};'use strict';var Sequelize=require(_0xd706('0x0'));module[_0xd706('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xd706('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0xd706('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xd706('0x2')]}}; \ No newline at end of file +var _0x0a05=['STRING','exports'];(function(_0x404530,_0x5c9347){var _0x24d7d0=function(_0x1bb5c1){while(--_0x1bb5c1){_0x404530['push'](_0x404530['shift']());}};_0x24d7d0(++_0x5c9347);}(_0x0a05,0x111));var _0x50a0=function(_0x401a4d,_0x4bb835){_0x401a4d=_0x401a4d-0x0;var _0x1faaff=_0x0a05[_0x401a4d];return _0x1faaff;};'use strict';var Sequelize=require('sequelize');module[_0x50a0('0x0')]={'uniqueid':{'type':Sequelize[_0x50a0('0x1')]},'node':{'type':Sequelize[_0x50a0('0x1')]},'application':{'type':Sequelize[_0x50a0('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x50a0('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index c2f6dd8..2b1a79f 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 _0x3920=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','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','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','end','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','SquareDetailsReport','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','describe'];(function(_0x27f93c,_0x2d81db){var _0x4a3fed=function(_0x19dd97){while(--_0x19dd97){_0x27f93c['push'](_0x27f93c['shift']());}};_0x4a3fed(++_0x2d81db);}(_0x3920,0x144));var _0x0392=function(_0x5910a8,_0x256174){_0x5910a8=_0x5910a8-0x0;var _0x341554=_0x3920[_0x5910a8];return _0x341554;};'use strict';var emlformat=require(_0x0392('0x0'));var rimraf=require(_0x0392('0x1'));var zipdir=require(_0x0392('0x2'));var jsonpatch=require(_0x0392('0x3'));var rp=require(_0x0392('0x4'));var moment=require(_0x0392('0x5'));var BPromise=require(_0x0392('0x6'));var Mustache=require(_0x0392('0x7'));var util=require(_0x0392('0x8'));var path=require(_0x0392('0x9'));var sox=require('sox');var csv=require(_0x0392('0xa'));var ejs=require(_0x0392('0xb'));var fs=require('fs');var fs_extra=require(_0x0392('0xc'));var _=require(_0x0392('0xd'));var squel=require(_0x0392('0xe'));var crypto=require('crypto');var jsforce=require(_0x0392('0xf'));var deskjs=require(_0x0392('0x10'));var toCsv=require(_0x0392('0xa'));var querystring=require('querystring');var Papa=require(_0x0392('0x11'));var Redis=require(_0x0392('0x12'));var authService=require(_0x0392('0x13'));var qs=require(_0x0392('0x14'));var as=require(_0x0392('0x15'));var hardwareService=require(_0x0392('0x16'));var logger=require(_0x0392('0x17'))(_0x0392('0x18'));var utils=require(_0x0392('0x19'));var config=require(_0x0392('0x1a'));var licenseUtil=require(_0x0392('0x1b'));var db=require(_0x0392('0x1c'))['db'];function respondWithStatusCode(_0x5b9357,_0x4545e9){_0x4545e9=_0x4545e9||0xcc;return function(_0x52b105){if(_0x52b105){return _0x5b9357['sendStatus'](_0x4545e9);}return _0x5b9357[_0x0392('0x1d')](_0x4545e9)['end']();};}function respondWithResult(_0x70670d,_0x2ca93c){_0x2ca93c=_0x2ca93c||0xc8;return function(_0x83b774){if(_0x83b774){return _0x70670d[_0x0392('0x1d')](_0x2ca93c)[_0x0392('0x1e')](_0x83b774);}};}function respondWithFilteredResult(_0x374446,_0x5c5e67){return function(_0x893afd){if(_0x893afd){var _0x2cf95f=typeof _0x5c5e67[_0x0392('0x1f')]===_0x0392('0x20')&&typeof _0x5c5e67[_0x0392('0x21')]==='undefined';var _0x3c1688=_0x893afd[_0x0392('0x22')];var _0x5241bb=_0x2cf95f?0x0:_0x5c5e67[_0x0392('0x1f')];var _0x3c4297=_0x2cf95f?_0x893afd['count']:_0x5c5e67['offset']+_0x5c5e67[_0x0392('0x21')];var _0x57107e;if(_0x3c4297>=_0x3c1688){_0x3c4297=_0x3c1688;_0x57107e=0xc8;}else{_0x57107e=0xce;}_0x374446[_0x0392('0x1d')](_0x57107e);return _0x374446['set'](_0x0392('0x23'),_0x5241bb+'-'+_0x3c4297+'/'+_0x3c1688)[_0x0392('0x1e')](_0x893afd);}return null;};}function patchUpdates(_0x56f5f9){return function(_0x56161d){try{jsonpatch[_0x0392('0x24')](_0x56161d,_0x56f5f9,!![]);}catch(_0x45b369){return BPromise[_0x0392('0x25')](_0x45b369);}return _0x56161d[_0x0392('0x26')]();};}function saveUpdates(_0x4e5a75,_0x20e06b){return function(_0x1dde2d){if(_0x1dde2d){return _0x1dde2d['update'](_0x4e5a75)[_0x0392('0x27')](function(_0x505fb0){return _0x505fb0;});}return null;};}function removeEntity(_0x23c584,_0x4bf62f){return function(_0x2f0649){if(_0x2f0649){return _0x2f0649[_0x0392('0x28')]()[_0x0392('0x27')](function(){_0x23c584[_0x0392('0x1d')](0xcc)[_0x0392('0x29')]();});}};}function handleEntityNotFound(_0x411d8d,_0x2d3101){return function(_0x186000){if(!_0x186000){_0x411d8d[_0x0392('0x2a')](0x194);}return _0x186000;};}function handleError(_0x328437,_0x5329e9){_0x5329e9=_0x5329e9||0x1f4;return function(_0x2847b9){logger[_0x0392('0x2b')](_0x2847b9[_0x0392('0x2c')]);if(_0x2847b9[_0x0392('0x2d')]){delete _0x2847b9['name'];}_0x328437[_0x0392('0x1d')](_0x5329e9)[_0x0392('0x2e')](_0x2847b9);};}exports['index']=function(_0x56aa1c,_0x538973){var _0x3801c4={},_0x5eae2e={},_0x32d86a={'count':0x0,'rows':[]};var _0x2e49f6=_[_0x0392('0x2f')](db['SquareDetailsReport'][_0x0392('0x30')],function(_0x5cc4be){return{'name':_0x5cc4be[_0x0392('0x31')],'type':_0x5cc4be[_0x0392('0x32')][_0x0392('0x33')]};});_0x5eae2e[_0x0392('0x34')]=_['map'](_0x2e49f6,'name');_0x5eae2e[_0x0392('0x35')]=_[_0x0392('0x36')](_0x56aa1c[_0x0392('0x35')]);_0x5eae2e[_0x0392('0x37')]=_['intersection'](_0x5eae2e[_0x0392('0x34')],_0x5eae2e['query']);_0x3801c4[_0x0392('0x38')]=_[_0x0392('0x39')](_0x5eae2e[_0x0392('0x34')],qs[_0x0392('0x3a')](_0x56aa1c[_0x0392('0x35')][_0x0392('0x3a')]));_0x3801c4['attributes']=_0x3801c4['attributes'][_0x0392('0x3b')]?_0x3801c4['attributes']:_0x5eae2e[_0x0392('0x34')];if(!_0x56aa1c[_0x0392('0x35')][_0x0392('0x3c')](_0x0392('0x3d'))){_0x3801c4[_0x0392('0x21')]=qs[_0x0392('0x21')](_0x56aa1c[_0x0392('0x35')][_0x0392('0x21')]);_0x3801c4['offset']=qs[_0x0392('0x1f')](_0x56aa1c[_0x0392('0x35')]['offset']);}_0x3801c4['order']=qs['sort'](_0x56aa1c[_0x0392('0x35')][_0x0392('0x3e')]);_0x3801c4[_0x0392('0x3f')]=qs[_0x0392('0x37')](_['pick'](_0x56aa1c['query'],_0x5eae2e[_0x0392('0x37')]),_0x2e49f6);if(_0x56aa1c[_0x0392('0x35')][_0x0392('0x40')]){_0x3801c4[_0x0392('0x3f')]=_[_0x0392('0x41')](_0x3801c4[_0x0392('0x3f')],{'$or':_[_0x0392('0x2f')](_0x2e49f6,function(_0x687fd6){if(_0x687fd6[_0x0392('0x32')]!==_0x0392('0x42')){var _0x517f3e={};_0x517f3e[_0x687fd6[_0x0392('0x2d')]]={'$like':'%'+_0x56aa1c['query'][_0x0392('0x40')]+'%'};return _0x517f3e;}})});}_0x3801c4=_['merge']({},_0x3801c4,_0x56aa1c[_0x0392('0x43')]);var _0xe1dec4={'where':_0x3801c4[_0x0392('0x3f')]};return db[_0x0392('0x44')][_0x0392('0x22')](_0xe1dec4)[_0x0392('0x27')](function(_0x2032c4){_0x32d86a[_0x0392('0x22')]=_0x2032c4;if(_0x56aa1c['query'][_0x0392('0x45')]){_0x3801c4[_0x0392('0x46')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x0392('0x47')](_0x3801c4);})[_0x0392('0x27')](function(_0x4a41d8){_0x32d86a[_0x0392('0x48')]=_0x4a41d8;return _0x32d86a;})[_0x0392('0x27')](respondWithFilteredResult(_0x538973,_0x3801c4))[_0x0392('0x49')](handleError(_0x538973,null));};exports[_0x0392('0x4a')]=function(_0x527857,_0xbd67b2){var _0x1a9d3a={'raw':!![],'where':{'id':_0x527857[_0x0392('0x4b')]['id']}},_0x57f087={};_0x57f087[_0x0392('0x34')]=_[_0x0392('0x36')](db[_0x0392('0x44')][_0x0392('0x30')]);_0x57f087[_0x0392('0x35')]=_['keys'](_0x527857[_0x0392('0x35')]);_0x57f087[_0x0392('0x37')]=_[_0x0392('0x39')](_0x57f087[_0x0392('0x34')],_0x57f087[_0x0392('0x35')]);_0x1a9d3a[_0x0392('0x38')]=_['intersection'](_0x57f087[_0x0392('0x34')],qs[_0x0392('0x3a')](_0x527857['query']['fields']));_0x1a9d3a['attributes']=_0x1a9d3a[_0x0392('0x38')][_0x0392('0x3b')]?_0x1a9d3a[_0x0392('0x38')]:_0x57f087[_0x0392('0x34')];if(_0x527857['query']['includeAll']){_0x1a9d3a['include']=[{'all':!![]}];}_0x1a9d3a=_[_0x0392('0x41')]({},_0x1a9d3a,_0x527857['options']);return db[_0x0392('0x44')][_0x0392('0x4c')](_0x1a9d3a)[_0x0392('0x27')](handleEntityNotFound(_0xbd67b2,null))[_0x0392('0x27')](respondWithResult(_0xbd67b2,null))[_0x0392('0x49')](handleError(_0xbd67b2,null));};exports[_0x0392('0x4d')]=function(_0x539f7d,_0x1100ef){return db[_0x0392('0x44')][_0x0392('0x4d')](_0x539f7d[_0x0392('0x4e')],{})[_0x0392('0x27')](respondWithResult(_0x1100ef,0xc9))[_0x0392('0x49')](handleError(_0x1100ef,null));};exports[_0x0392('0x4f')]=function(_0x26d6d2,_0x1ce99a){if(_0x26d6d2[_0x0392('0x4e')]['id']){delete _0x26d6d2[_0x0392('0x4e')]['id'];}return db[_0x0392('0x44')][_0x0392('0x4c')]({'where':{'id':_0x26d6d2[_0x0392('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1ce99a,null))[_0x0392('0x27')](saveUpdates(_0x26d6d2['body'],null))[_0x0392('0x27')](respondWithResult(_0x1ce99a,null))[_0x0392('0x49')](handleError(_0x1ce99a,null));};exports[_0x0392('0x28')]=function(_0x152617,_0x5af52a){return db[_0x0392('0x44')]['find']({'where':{'id':_0x152617['params']['id']}})[_0x0392('0x27')](handleEntityNotFound(_0x5af52a,null))[_0x0392('0x27')](removeEntity(_0x5af52a,null))[_0x0392('0x49')](handleError(_0x5af52a,null));};exports[_0x0392('0x50')]=function(_0x624e47,_0x223cd6){return db['SquareDetailsReport'][_0x0392('0x50')]()[_0x0392('0x27')](respondWithResult(_0x223cd6,null))[_0x0392('0x49')](handleError(_0x223cd6,null));}; \ No newline at end of file +var _0x7f68=['ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','intersection','includeAll','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox'];(function(_0x54afef,_0x36a843){var _0x23a9d0=function(_0x477178){while(--_0x477178){_0x54afef['push'](_0x54afef['shift']());}};_0x23a9d0(++_0x36a843);}(_0x7f68,0xcb));var _0x87f6=function(_0x838813,_0x448f0f){_0x838813=_0x838813-0x0;var _0x2bd32d=_0x7f68[_0x838813];return _0x2bd32d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x87f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x87f6('0x1'));var rp=require(_0x87f6('0x2'));var moment=require(_0x87f6('0x3'));var BPromise=require(_0x87f6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x87f6('0x5'));var sox=require(_0x87f6('0x6'));var csv=require('to-csv');var ejs=require(_0x87f6('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x87f6('0x8'));var jsforce=require(_0x87f6('0x9'));var deskjs=require(_0x87f6('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x87f6('0xb'));var Redis=require(_0x87f6('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x87f6('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x87f6('0xe'));var logger=require(_0x87f6('0xf'))('api');var utils=require(_0x87f6('0x10'));var config=require(_0x87f6('0x11'));var licenseUtil=require(_0x87f6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4118af,_0x25a5f3){_0x25a5f3=_0x25a5f3||0xcc;return function(_0x58c3e0){if(_0x58c3e0){return _0x4118af[_0x87f6('0x13')](_0x25a5f3);}return _0x4118af[_0x87f6('0x14')](_0x25a5f3)['end']();};}function respondWithResult(_0x26c73d,_0x3d003f){_0x3d003f=_0x3d003f||0xc8;return function(_0x1c3027){if(_0x1c3027){return _0x26c73d['status'](_0x3d003f)[_0x87f6('0x15')](_0x1c3027);}};}function respondWithFilteredResult(_0x17af3a,_0x309405){return function(_0x13b176){if(_0x13b176){var _0x4883d4=typeof _0x309405[_0x87f6('0x16')]===_0x87f6('0x17')&&typeof _0x309405[_0x87f6('0x18')]===_0x87f6('0x17');var _0x57aa3f=_0x13b176[_0x87f6('0x19')];var _0x30d61b=_0x4883d4?0x0:_0x309405[_0x87f6('0x16')];var _0x51c7be=_0x4883d4?_0x13b176[_0x87f6('0x19')]:_0x309405[_0x87f6('0x16')]+_0x309405[_0x87f6('0x18')];var _0x500138;if(_0x51c7be>=_0x57aa3f){_0x51c7be=_0x57aa3f;_0x500138=0xc8;}else{_0x500138=0xce;}_0x17af3a[_0x87f6('0x14')](_0x500138);return _0x17af3a[_0x87f6('0x1a')](_0x87f6('0x1b'),_0x30d61b+'-'+_0x51c7be+'/'+_0x57aa3f)[_0x87f6('0x15')](_0x13b176);}return null;};}function patchUpdates(_0x22bde8){return function(_0x13a207){try{jsonpatch['apply'](_0x13a207,_0x22bde8,!![]);}catch(_0x2cbecc){return BPromise['reject'](_0x2cbecc);}return _0x13a207[_0x87f6('0x1c')]();};}function saveUpdates(_0x164d31,_0x20ded8){return function(_0x4f7b2b){if(_0x4f7b2b){return _0x4f7b2b[_0x87f6('0x1d')](_0x164d31)[_0x87f6('0x1e')](function(_0x57d946){return _0x57d946;});}return null;};}function removeEntity(_0xc5be56,_0x4da7d9){return function(_0x2528dc){if(_0x2528dc){return _0x2528dc[_0x87f6('0x1f')]()[_0x87f6('0x1e')](function(){_0xc5be56['status'](0xcc)[_0x87f6('0x20')]();});}};}function handleEntityNotFound(_0xbf4d33,_0x438ac4){return function(_0x55abea){if(!_0x55abea){_0xbf4d33['sendStatus'](0x194);}return _0x55abea;};}function handleError(_0xa7be26,_0x29ec17){_0x29ec17=_0x29ec17||0x1f4;return function(_0x26bc59){logger[_0x87f6('0x21')](_0x26bc59[_0x87f6('0x22')]);if(_0x26bc59[_0x87f6('0x23')]){delete _0x26bc59[_0x87f6('0x23')];}_0xa7be26['status'](_0x29ec17)[_0x87f6('0x24')](_0x26bc59);};}exports[_0x87f6('0x25')]=function(_0x44d9b9,_0x2de8c0){var _0x38b6ff={},_0x3d16c1={},_0x16064b={'count':0x0,'rows':[]};var _0x912a2f=_[_0x87f6('0x26')](db[_0x87f6('0x27')][_0x87f6('0x28')],function(_0xb0fb49){return{'name':_0xb0fb49[_0x87f6('0x29')],'type':_0xb0fb49[_0x87f6('0x2a')][_0x87f6('0x2b')]};});_0x3d16c1[_0x87f6('0x2c')]=_[_0x87f6('0x26')](_0x912a2f,_0x87f6('0x23'));_0x3d16c1['query']=_[_0x87f6('0x2d')](_0x44d9b9[_0x87f6('0x2e')]);_0x3d16c1[_0x87f6('0x2f')]=_['intersection'](_0x3d16c1[_0x87f6('0x2c')],_0x3d16c1[_0x87f6('0x2e')]);_0x38b6ff[_0x87f6('0x30')]=_['intersection'](_0x3d16c1[_0x87f6('0x2c')],qs[_0x87f6('0x31')](_0x44d9b9[_0x87f6('0x2e')][_0x87f6('0x31')]));_0x38b6ff['attributes']=_0x38b6ff['attributes'][_0x87f6('0x32')]?_0x38b6ff[_0x87f6('0x30')]:_0x3d16c1['model'];if(!_0x44d9b9[_0x87f6('0x2e')][_0x87f6('0x33')](_0x87f6('0x34'))){_0x38b6ff[_0x87f6('0x18')]=qs[_0x87f6('0x18')](_0x44d9b9[_0x87f6('0x2e')][_0x87f6('0x18')]);_0x38b6ff[_0x87f6('0x16')]=qs['offset'](_0x44d9b9[_0x87f6('0x2e')]['offset']);}_0x38b6ff['order']=qs[_0x87f6('0x35')](_0x44d9b9[_0x87f6('0x2e')][_0x87f6('0x35')]);_0x38b6ff[_0x87f6('0x36')]=qs[_0x87f6('0x2f')](_[_0x87f6('0x37')](_0x44d9b9[_0x87f6('0x2e')],_0x3d16c1[_0x87f6('0x2f')]),_0x912a2f);if(_0x44d9b9['query'][_0x87f6('0x38')]){_0x38b6ff['where']=_['merge'](_0x38b6ff['where'],{'$or':_[_0x87f6('0x26')](_0x912a2f,function(_0x4f136c){if(_0x4f136c[_0x87f6('0x2a')]!==_0x87f6('0x39')){var _0x526fde={};_0x526fde[_0x4f136c[_0x87f6('0x23')]]={'$like':'%'+_0x44d9b9['query']['filter']+'%'};return _0x526fde;}})});}_0x38b6ff=_[_0x87f6('0x3a')]({},_0x38b6ff,_0x44d9b9[_0x87f6('0x3b')]);var _0x3d2c6f={'where':_0x38b6ff['where']};return db['SquareDetailsReport'][_0x87f6('0x19')](_0x3d2c6f)[_0x87f6('0x1e')](function(_0x2be623){_0x16064b['count']=_0x2be623;if(_0x44d9b9[_0x87f6('0x2e')]['includeAll']){_0x38b6ff[_0x87f6('0x3c')]=[{'all':!![]}];}return db[_0x87f6('0x27')]['findAll'](_0x38b6ff);})[_0x87f6('0x1e')](function(_0x1e7fac){_0x16064b[_0x87f6('0x3d')]=_0x1e7fac;return _0x16064b;})['then'](respondWithFilteredResult(_0x2de8c0,_0x38b6ff))[_0x87f6('0x3e')](handleError(_0x2de8c0,null));};exports['show']=function(_0x3cceed,_0x3ff556){var _0x3d9b78={'raw':!![],'where':{'id':_0x3cceed[_0x87f6('0x3f')]['id']}},_0x1ef8b4={};_0x1ef8b4[_0x87f6('0x2c')]=_['keys'](db['SquareDetailsReport']['rawAttributes']);_0x1ef8b4[_0x87f6('0x2e')]=_[_0x87f6('0x2d')](_0x3cceed[_0x87f6('0x2e')]);_0x1ef8b4[_0x87f6('0x2f')]=_[_0x87f6('0x40')](_0x1ef8b4[_0x87f6('0x2c')],_0x1ef8b4[_0x87f6('0x2e')]);_0x3d9b78[_0x87f6('0x30')]=_[_0x87f6('0x40')](_0x1ef8b4[_0x87f6('0x2c')],qs['fields'](_0x3cceed['query'][_0x87f6('0x31')]));_0x3d9b78[_0x87f6('0x30')]=_0x3d9b78[_0x87f6('0x30')]['length']?_0x3d9b78['attributes']:_0x1ef8b4[_0x87f6('0x2c')];if(_0x3cceed['query'][_0x87f6('0x41')]){_0x3d9b78[_0x87f6('0x3c')]=[{'all':!![]}];}_0x3d9b78=_[_0x87f6('0x3a')]({},_0x3d9b78,_0x3cceed['options']);return db[_0x87f6('0x27')][_0x87f6('0x42')](_0x3d9b78)[_0x87f6('0x1e')](handleEntityNotFound(_0x3ff556,null))[_0x87f6('0x1e')](respondWithResult(_0x3ff556,null))[_0x87f6('0x3e')](handleError(_0x3ff556,null));};exports[_0x87f6('0x43')]=function(_0x5ce9d8,_0x7db17a){return db[_0x87f6('0x27')][_0x87f6('0x43')](_0x5ce9d8[_0x87f6('0x44')],{})[_0x87f6('0x1e')](respondWithResult(_0x7db17a,0xc9))[_0x87f6('0x3e')](handleError(_0x7db17a,null));};exports[_0x87f6('0x1d')]=function(_0x110b69,_0x4da1f5){if(_0x110b69[_0x87f6('0x44')]['id']){delete _0x110b69['body']['id'];}return db[_0x87f6('0x27')][_0x87f6('0x42')]({'where':{'id':_0x110b69[_0x87f6('0x3f')]['id']}})[_0x87f6('0x1e')](handleEntityNotFound(_0x4da1f5,null))[_0x87f6('0x1e')](saveUpdates(_0x110b69['body'],null))[_0x87f6('0x1e')](respondWithResult(_0x4da1f5,null))[_0x87f6('0x3e')](handleError(_0x4da1f5,null));};exports['destroy']=function(_0x4711e8,_0xd28f7d){return db['SquareDetailsReport']['find']({'where':{'id':_0x4711e8['params']['id']}})[_0x87f6('0x1e')](handleEntityNotFound(_0xd28f7d,null))[_0x87f6('0x1e')](removeEntity(_0xd28f7d,null))[_0x87f6('0x3e')](handleError(_0xd28f7d,null));};exports[_0x87f6('0x45')]=function(_0x128de5,_0x3d1338){return db[_0x87f6('0x27')][_0x87f6('0x45')]()[_0x87f6('0x1e')](respondWithResult(_0x3d1338,null))['catch'](handleError(_0x3d1338,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 392ac6d..d416a2c 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 _0x3cea=['api','moment','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','util','../../config/logger'];(function(_0x2118ad,_0xe8e3fd){var _0x4b5715=function(_0x399f72){while(--_0x399f72){_0x2118ad['push'](_0x2118ad['shift']());}};_0x4b5715(++_0xe8e3fd);}(_0x3cea,0x1e9));var _0xa3ce=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3cea[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xa3ce('0x0'));var util=require(_0xa3ce('0x1'));var logger=require(_0xa3ce('0x2'))(_0xa3ce('0x3'));var moment=require(_0xa3ce('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3ce('0x5'));var rimraf=require('rimraf');var config=require(_0xa3ce('0x6'));var attributes=require(_0xa3ce('0x7'));module[_0xa3ce('0x8')]=function(_0x4dc9d6,_0x20e7dd){return _0x4dc9d6[_0xa3ce('0x9')](_0xa3ce('0xa'),attributes,{'tableName':_0xa3ce('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe7e8=['path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport','report_square_details','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x55f219,_0x15d034){var _0x11c582=function(_0x435420){while(--_0x435420){_0x55f219['push'](_0x55f219['shift']());}};_0x11c582(++_0x15d034);}(_0xe7e8,0x15a));var _0x8e7e=function(_0xf79bae,_0x263b2a){_0xf79bae=_0xf79bae-0x0;var _0x5d2cb7=_0xe7e8[_0xf79bae];return _0x5d2cb7;};'use strict';var _=require(_0x8e7e('0x0'));var util=require('util');var logger=require(_0x8e7e('0x1'))(_0x8e7e('0x2'));var moment=require('moment');var BPromise=require(_0x8e7e('0x3'));var rp=require(_0x8e7e('0x4'));var fs=require('fs');var path=require(_0x8e7e('0x5'));var rimraf=require(_0x8e7e('0x6'));var config=require(_0x8e7e('0x7'));var attributes=require(_0x8e7e('0x8'));module[_0x8e7e('0x9')]=function(_0x472299,_0x3b12b5){return _0x472299[_0x8e7e('0xa')](_0x8e7e('0xb'),attributes,{'tableName':_0x8e7e('0xc'),'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 7d3e23d..d248aab 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','util','moment'];(function(_0x4ec9e3,_0x15fbf4){var _0x2883ce=function(_0x3e9998){while(--_0x3e9998){_0x4ec9e3['push'](_0x4ec9e3['shift']());}};_0x2883ce(++_0x15fbf4);}(_0xda2d,0x102));var _0xdda2=function(_0x14044a,_0x4fac58){_0x14044a=_0x14044a-0x0;var _0x5dc008=_0xda2d[_0x14044a];return _0x5dc008;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('SquareDetailsReport,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});}exports[_0xdda2('0x14')]=function(_0x1a3b35){var _0x335fb5=this;return new Promise(function(_0x2b6ee8,_0x8d44b7){return db[_0xdda2('0x15')][_0xdda2('0x16')](_0x1a3b35[_0xdda2('0x17')],{'raw':_0x1a3b35[_0xdda2('0x18')]?_0x1a3b35[_0xdda2('0x18')][_0xdda2('0x19')]===undefined?!![]:![]:!![]})[_0xdda2('0xa')](function(_0x4eed30){logger[_0xdda2('0x12')]('CreateSquareDetailsReport',_0x1a3b35);logger[_0xdda2('0xd')](_0xdda2('0x14'),_0x1a3b35,JSON[_0xdda2('0xf')](_0x4eed30));_0x2b6ee8(_0x4eed30);})['catch'](function(_0x347ee6){logger['error'](_0xdda2('0x14'),_0x347ee6[_0xdda2('0x11')],_0x1a3b35);_0x8d44b7(_0x335fb5['error'](0x1f4,_0x347ee6[_0xdda2('0x11')]));});});}; \ No newline at end of file +var _0xa1cc=['then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result','catch','CreateSquareDetailsReport','SquareDetailsReport','body','options'];(function(_0x19eccd,_0x460dc2){var _0x163b9d=function(_0x19538e){while(--_0x19538e){_0x19eccd['push'](_0x19eccd['shift']());}};_0x163b9d(++_0x460dc2);}(_0xa1cc,0x10f));var _0xca1c=function(_0x55fb34,_0x4a94c4){_0x55fb34=_0x55fb34-0x0;var _0x1d5ff4=_0xa1cc[_0x55fb34];return _0x1d5ff4;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var moment=require(_0xca1c('0x2'));var BPromise=require('bluebird');var rs=require(_0xca1c('0x3'));var fs=require('fs');var Redis=require(_0xca1c('0x4'));var db=require(_0xca1c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xca1c('0x6'))('rpc');var config=require(_0xca1c('0x7'));var jayson=require(_0xca1c('0x8'));var client=jayson[_0xca1c('0x9')][_0xca1c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5d5101,_0x5132e2,_0x4ff3f7){return new BPromise(function(_0x8fc787,_0x21f118){return client['request'](_0x5d5101,_0x4ff3f7)['then'](function(_0x57807b){logger[_0xca1c('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x5132e2,_0xca1c('0xc'));logger[_0xca1c('0xd')](_0xca1c('0xe'),_0x5132e2,_0xca1c('0xc'),JSON[_0xca1c('0xf')](_0x57807b));if(_0x57807b['error']){if(_0x57807b[_0xca1c('0x10')][_0xca1c('0x11')]===0x1f4){logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b['error'][_0xca1c('0x13')]);return _0x21f118(_0x57807b[_0xca1c('0x10')][_0xca1c('0x13')]);}logger['error'](_0xca1c('0x12'),_0x5132e2,_0x57807b[_0xca1c('0x10')]['message']);return _0x8fc787(_0x57807b['error'][_0xca1c('0x13')]);}else{logger[_0xca1c('0xb')](_0xca1c('0x12'),_0x5132e2,_0xca1c('0xc'));_0x8fc787(_0x57807b[_0xca1c('0x14')][_0xca1c('0x13')]);}})[_0xca1c('0x15')](function(_0x357321){logger[_0xca1c('0x10')](_0xca1c('0x12'),_0x5132e2,_0x357321);_0x21f118(_0x357321);});});}exports[_0xca1c('0x16')]=function(_0x10b126){var _0x14480c=this;return new Promise(function(_0x447547,_0x329244){return db[_0xca1c('0x17')]['create'](_0x10b126[_0xca1c('0x18')],{'raw':_0x10b126[_0xca1c('0x19')]?_0x10b126['options']['raw']===undefined?!![]:![]:!![]})[_0xca1c('0x1a')](function(_0x10f801){logger[_0xca1c('0xb')](_0xca1c('0x16'),_0x10b126);logger[_0xca1c('0xd')](_0xca1c('0x16'),_0x10b126,JSON[_0xca1c('0xf')](_0x10f801));_0x447547(_0x10f801);})['catch'](function(_0x115b4d){logger['error'](_0xca1c('0x16'),_0x115b4d[_0xca1c('0x13')],_0x10b126);_0x329244(_0x14480c[_0xca1c('0x10')](0x1f4,_0x115b4d[_0xca1c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e716f52..6794c20 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 _0x38ca=['index','killProcess','exports','./system.controller','isAuthenticated'];(function(_0x42ebba,_0x4cbf87){var _0x3fd2af=function(_0x26d999){while(--_0x26d999){_0x42ebba['push'](_0x42ebba['shift']());}};_0x3fd2af(++_0x4cbf87);}(_0x38ca,0x1f2));var _0xa38c=function(_0x4963e2,_0x4dcacf){_0x4963e2=_0x4963e2-0x0;var _0x55494e=_0x38ca[_0x4963e2];return _0x55494e;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0xa38c('0x0'));router['get']('/',auth[_0xa38c('0x1')](),controller[_0xa38c('0x2')]);router['get']('/process/:pid/kill',auth[_0xa38c('0x1')](),controller[_0xa38c('0x3')]);module[_0xa38c('0x4')]=router; \ No newline at end of file +var _0x2c0b=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x106699,_0x3983c7){var _0x58a575=function(_0x1516e1){while(--_0x1516e1){_0x106699['push'](_0x106699['shift']());}};_0x58a575(++_0x3983c7);}(_0x2c0b,0x179));var _0xb2c0=function(_0x1e1622,_0x2794b3){_0x1e1622=_0x1e1622-0x0;var _0x3dd174=_0x2c0b[_0x1e1622];return _0x3dd174;};'use strict';var express=require(_0xb2c0('0x0'));var router=express[_0xb2c0('0x1')]();var auth=require(_0xb2c0('0x2'));var controller=require(_0xb2c0('0x3'));router[_0xb2c0('0x4')]('/',auth[_0xb2c0('0x5')](),controller[_0xb2c0('0x6')]);router[_0xb2c0('0x4')](_0xb2c0('0x7'),auth['isAuthenticated'](),controller[_0xb2c0('0x8')]);module[_0xb2c0('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 56b718b..f73eef3 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 _0xf5b5=['api','util','lodash','error','inspect','status','send','index','getAllData','then','catch','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','params','SIGINT','json','Process\x20with\x20pid\x20%s\x20killed\x20correctly','killProcess','systeminformation','exec','../../config/logger'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0xf5b5,0x7a));var _0x5f5b=function(_0x2fb573,_0x1a13b4){_0x2fb573=_0x2fb573-0x0;var _0x46dde5=_0xf5b5[_0x2fb573];return _0x46dde5;};'use strict';var info=require(_0x5f5b('0x0'));var exec=require('child_process')[_0x5f5b('0x1')];var logger=require(_0x5f5b('0x2'))(_0x5f5b('0x3'));var util=require(_0x5f5b('0x4'));var BPromise=require('bluebird');var _=require(_0x5f5b('0x5'));function handleError(_0x50198c,_0x570afa,_0x5ee3c3){_0x570afa=_0x570afa||0x1f4;return function(_0x1da77e){logger[_0x5f5b('0x6')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x5ee3c3,_0x570afa,util[_0x5f5b('0x7')](_0x1da77e,{'showHidden':![],'depth':null}));delete _0x1da77e['name'];_0x50198c[_0x5f5b('0x8')](_0x570afa)[_0x5f5b('0x9')](_0x1da77e);};}exports[_0x5f5b('0xa')]=function(_0x5b1852,_0x54e8e0){return info[_0x5f5b('0xb')]()[_0x5f5b('0xc')](function(_0x3c3487){return _0x54e8e0[_0x5f5b('0x8')](0xc8)['json'](_0x3c3487);})[_0x5f5b('0xd')](function(_0x473c7c){return _0x54e8e0[_0x5f5b('0x8')](0x1f4)['json'](_0x473c7c);});};exports['killProcess']=function(_0x317e39,_0xc56075){var _0x342f25=['components/import/cm'];return new BPromise(function(_0x24a06a,_0x320358){return exec(util[_0x5f5b('0xe')](_0x5f5b('0xf'),_0x317e39['params'][_0x5f5b('0x10')]),function(_0x22a5f2,_0x273c26,_0xd20cc9){if(_0x22a5f2){return _0x320358(_0x22a5f2);}return _0x24a06a(_0x273c26);});})[_0x5f5b('0xc')](function(_0x219aec){var _0x48c8c5=![];var _0x2782e5=_0x219aec[_0x5f5b('0x11')](/\n/);for(var _0x584eca=0x0,_0x5787aa=_0x342f25[_0x5f5b('0x12')];_0x584eca<_0x5787aa,_0x48c8c5===![];_0x584eca+=0x1){if(_0x219aec['indexOf'](_0x342f25[_0x584eca])>=0x0){_0x48c8c5=!![];}}if(!_0x48c8c5){throw new Error(util[_0x5f5b('0xe')](_0x5f5b('0x13'),_0x317e39[_0x5f5b('0x14')]['pid']));}process['kill'](_0x317e39[_0x5f5b('0x14')][_0x5f5b('0x10')],_0x5f5b('0x15'));return _0xc56075['status'](0xc8)[_0x5f5b('0x16')]({'message':util['format'](_0x5f5b('0x17'),_0x317e39[_0x5f5b('0x14')]['pid'])});})[_0x5f5b('0xd')](handleError(_0xc56075,null,_0x5f5b('0x18')));}; \ No newline at end of file +var _0x633d=['exec','../../config/logger','api','bluebird','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','getAllData','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill','systeminformation','child_process'];(function(_0x503836,_0x221be0){var _0x4ffc8e=function(_0x58a932){while(--_0x58a932){_0x503836['push'](_0x503836['shift']());}};_0x4ffc8e(++_0x221be0);}(_0x633d,0x102));var _0xd633=function(_0x313b8f,_0x845e2d){_0x313b8f=_0x313b8f-0x0;var _0x5bc1fa=_0x633d[_0x313b8f];return _0x5bc1fa;};'use strict';var info=require(_0xd633('0x0'));var exec=require(_0xd633('0x1'))[_0xd633('0x2')];var logger=require(_0xd633('0x3'))(_0xd633('0x4'));var util=require('util');var BPromise=require(_0xd633('0x5'));var _=require('lodash');function handleError(_0x2e4f7e,_0x54494a,_0xc07b7e){_0x54494a=_0x54494a||0x1f4;return function(_0x46ed40){logger[_0xd633('0x6')](_0xd633('0x7'),_0xc07b7e,_0x54494a,util[_0xd633('0x8')](_0x46ed40,{'showHidden':![],'depth':null}));delete _0x46ed40[_0xd633('0x9')];_0x2e4f7e[_0xd633('0xa')](_0x54494a)[_0xd633('0xb')](_0x46ed40);};}exports[_0xd633('0xc')]=function(_0x2c2fd3,_0x4cc00b){return info[_0xd633('0xd')]()[_0xd633('0xe')](function(_0x2412d8){return _0x4cc00b['status'](0xc8)[_0xd633('0xf')](_0x2412d8);})[_0xd633('0x10')](function(_0x315166){return _0x4cc00b[_0xd633('0xa')](0x1f4)[_0xd633('0xf')](_0x315166);});};exports[_0xd633('0x11')]=function(_0x27266e,_0x75b508){var _0xba4ea5=[_0xd633('0x12')];return new BPromise(function(_0xc67748,_0x2b0645){return exec(util[_0xd633('0x13')](_0xd633('0x14'),_0x27266e[_0xd633('0x15')]['pid']),function(_0xdbfa2e,_0x2287e4,_0x53ae83){if(_0xdbfa2e){return _0x2b0645(_0xdbfa2e);}return _0xc67748(_0x2287e4);});})[_0xd633('0xe')](function(_0x29d43c){var _0x5d0539=![];var _0x7ed9c2=_0x29d43c['split'](/\n/);for(var _0x260f4d=0x0,_0x235c7f=_0xba4ea5['length'];_0x260f4d<_0x235c7f,_0x5d0539===![];_0x260f4d+=0x1){if(_0x29d43c[_0xd633('0x16')](_0xba4ea5[_0x260f4d])>=0x0){_0x5d0539=!![];}}if(!_0x5d0539){throw new Error(util[_0xd633('0x13')](_0xd633('0x17'),_0x27266e[_0xd633('0x15')][_0xd633('0x18')]));}process[_0xd633('0x19')](_0x27266e[_0xd633('0x15')][_0xd633('0x18')],'SIGINT');return _0x75b508[_0xd633('0xa')](0xc8)[_0xd633('0xf')]({'message':util[_0xd633('0x13')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27266e[_0xd633('0x15')][_0xd633('0x18')])});})['catch'](handleError(_0x75b508,null,_0xd633('0x11')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 688be21..e305ca9 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 _0xb2f2=['multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy'];(function(_0x5993a7,_0x5cfa8e){var _0x4ae1f7=function(_0x445724){while(--_0x445724){_0x5993a7['push'](_0x5993a7['shift']());}};_0x4ae1f7(++_0x5cfa8e);}(_0xb2f2,0xc8));var _0x2b2f=function(_0x4dd685,_0x1dcc5b){_0x4dd685=_0x4dd685-0x0;var _0x16d2cc=_0xb2f2[_0x4dd685];return _0x16d2cc;};'use strict';var multer=require(_0x2b2f('0x0'));var util=require(_0x2b2f('0x1'));var path=require('path');var timeout=require(_0x2b2f('0x2'));var express=require(_0x2b2f('0x3'));var router=express[_0x2b2f('0x4')]();var fs_extra=require(_0x2b2f('0x5'));var auth=require(_0x2b2f('0x6'));var interaction=require(_0x2b2f('0x7'));var config=require(_0x2b2f('0x8'));var controller=require('./tag.controller');router[_0x2b2f('0x9')]('/',auth[_0x2b2f('0xa')](),controller[_0x2b2f('0xb')]);router[_0x2b2f('0x9')]('/:id',auth[_0x2b2f('0xa')](),controller[_0x2b2f('0xc')]);router[_0x2b2f('0xd')]('/',auth[_0x2b2f('0xa')](),controller[_0x2b2f('0xe')]);router[_0x2b2f('0xf')](_0x2b2f('0x10'),auth[_0x2b2f('0xa')](),controller[_0x2b2f('0x11')]);router[_0x2b2f('0x12')]('/:id',auth[_0x2b2f('0xa')](),controller[_0x2b2f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3ef1=['util','express','fs-extra','../../components/auth/service','../../config/environment','index','/:id','show','isAuthenticated','put','update','delete','exports','multer'];(function(_0x3f49df,_0x120b17){var _0x3fffb5=function(_0xd3dbc7){while(--_0xd3dbc7){_0x3f49df['push'](_0x3f49df['shift']());}};_0x3fffb5(++_0x120b17);}(_0x3ef1,0x187));var _0x13ef=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x3ef1[_0x53ccf2];return _0x5a2964;};'use strict';var multer=require(_0x13ef('0x0'));var util=require(_0x13ef('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x13ef('0x2'));var router=express['Router']();var fs_extra=require(_0x13ef('0x3'));var auth=require(_0x13ef('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x13ef('0x5'));var controller=require('./tag.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x13ef('0x6')]);router['get'](_0x13ef('0x7'),auth['isAuthenticated'](),controller[_0x13ef('0x8')]);router['post']('/',auth[_0x13ef('0x9')](),controller['create']);router[_0x13ef('0xa')](_0x13ef('0x7'),auth[_0x13ef('0x9')](),controller[_0x13ef('0xb')]);router[_0x13ef('0xc')](_0x13ef('0x7'),auth[_0x13ef('0x9')](),controller['destroy']);module[_0x13ef('0xd')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 897d99e..5f63f70 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 _0x8ce8=['STRING','name','#0091EA','sequelize'];(function(_0x4d9abc,_0x58f7e9){var _0x5f1320=function(_0x571cd9){while(--_0x571cd9){_0x4d9abc['push'](_0x4d9abc['shift']());}};_0x5f1320(++_0x58f7e9);}(_0x8ce8,0xd3));var _0x88ce=function(_0x4fd674,_0x23e4e8){_0x4fd674=_0x4fd674-0x0;var _0x44596c=_0x8ce8[_0x4fd674];return _0x44596c;};'use strict';var Sequelize=require(_0x88ce('0x0'));module['exports']={'name':{'type':Sequelize[_0x88ce('0x1')],'unique':_0x88ce('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x88ce('0x1')],'defaultValue':_0x88ce('0x3')},'description':{'type':Sequelize[_0x88ce('0x1')]}}; \ No newline at end of file +var _0x9656=['name','#0091EA','sequelize','STRING'];(function(_0x2b6e7c,_0xdb7ac4){var _0x29b018=function(_0x2dae14){while(--_0x2dae14){_0x2b6e7c['push'](_0x2b6e7c['shift']());}};_0x29b018(++_0xdb7ac4);}(_0x9656,0x15e));var _0x6965=function(_0x276842,_0x1922af){_0x276842=_0x276842-0x0;var _0x1522b4=_0x9656[_0x276842];return _0x1522b4;};'use strict';var Sequelize=require(_0x6965('0x0'));module['exports']={'name':{'type':Sequelize[_0x6965('0x1')],'unique':_0x6965('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x6965('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 696fc03..0ce9672 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 _0xf021=['autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','offset','limit','reject','save','update','then','Tags','end','error','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','Tag','count','includeAll','include','rows','catch','show','intersection','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf021,0x18f));var _0x1f02=function(_0x561432,_0x21ec65){_0x561432=_0x561432-0x0;var _0x3485b6=_0xf021[_0x561432];return _0x3485b6;};'use strict';var emlformat=require(_0x1f02('0x0'));var rimraf=require(_0x1f02('0x1'));var zipdir=require(_0x1f02('0x2'));var jsonpatch=require(_0x1f02('0x3'));var rp=require(_0x1f02('0x4'));var moment=require('moment');var BPromise=require(_0x1f02('0x5'));var Mustache=require('mustache');var util=require(_0x1f02('0x6'));var path=require(_0x1f02('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f02('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1f02('0x9'));var squel=require(_0x1f02('0xa'));var crypto=require(_0x1f02('0xb'));var jsforce=require(_0x1f02('0xc'));var deskjs=require(_0x1f02('0xd'));var toCsv=require('to-csv');var querystring=require(_0x1f02('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1f02('0xf'));var as=require(_0x1f02('0x10'));var hardwareService=require(_0x1f02('0x11'));var logger=require(_0x1f02('0x12'))(_0x1f02('0x13'));var utils=require('../../config/utils');var config=require(_0x1f02('0x14'));var licenseUtil=require(_0x1f02('0x15'));var db=require(_0x1f02('0x16'))['db'];function respondWithStatusCode(_0x56a2c2,_0x24e9b8){_0x24e9b8=_0x24e9b8||0xcc;return function(_0x1ac6eb){if(_0x1ac6eb){return _0x56a2c2[_0x1f02('0x17')](_0x24e9b8);}return _0x56a2c2['status'](_0x24e9b8)['end']();};}function respondWithResult(_0x4974bd,_0x11ba7e){_0x11ba7e=_0x11ba7e||0xc8;return function(_0x2c08ad){if(_0x2c08ad){return _0x4974bd[_0x1f02('0x18')](_0x11ba7e)[_0x1f02('0x19')](_0x2c08ad);}};}function respondWithFilteredResult(_0x1c16ce,_0x45bae1){return function(_0x440328){if(_0x440328){var _0x3b0a3d=typeof _0x45bae1['offset']===_0x1f02('0x1a')&&typeof _0x45bae1['limit']==='undefined';var _0x4a66a5=_0x440328['count'];var _0x4d1e4f=_0x3b0a3d?0x0:_0x45bae1[_0x1f02('0x1b')];var _0x3033a2=_0x3b0a3d?_0x440328['count']:_0x45bae1[_0x1f02('0x1b')]+_0x45bae1[_0x1f02('0x1c')];var _0x356444;if(_0x3033a2>=_0x4a66a5){_0x3033a2=_0x4a66a5;_0x356444=0xc8;}else{_0x356444=0xce;}_0x1c16ce[_0x1f02('0x18')](_0x356444);return _0x1c16ce['set']('Content-Range',_0x4d1e4f+'-'+_0x3033a2+'/'+_0x4a66a5)[_0x1f02('0x19')](_0x440328);}return null;};}function patchUpdates(_0x37393a){return function(_0x5e78c2){try{jsonpatch['apply'](_0x5e78c2,_0x37393a,!![]);}catch(_0x339c29){return BPromise[_0x1f02('0x1d')](_0x339c29);}return _0x5e78c2[_0x1f02('0x1e')]();};}function saveUpdates(_0xbabbd7,_0x480297){return function(_0x12c4af){if(_0x12c4af){return _0x12c4af[_0x1f02('0x1f')](_0xbabbd7)[_0x1f02('0x20')](function(_0x2f422c){return _0x2f422c;});}return null;};}function removeEntity(_0x43b3e7,_0x134398){return function(_0x1328ea){if(_0x1328ea){return _0x1328ea['destroy']()[_0x1f02('0x20')](function(){var _0x3a8c57=_0x1328ea['get']({'plain':!![]});var _0x25a8d1=_0x1f02('0x21');return db['UserProfileResource']['destroy']({'where':{'type':_0x25a8d1,'resourceId':_0x3a8c57['id']}})[_0x1f02('0x20')](function(){return _0x1328ea;});})[_0x1f02('0x20')](function(){_0x43b3e7[_0x1f02('0x18')](0xcc)[_0x1f02('0x22')]();});}};}function handleEntityNotFound(_0x3f5c5e,_0x3f5577){return function(_0x297cf4){if(!_0x297cf4){_0x3f5c5e['sendStatus'](0x194);}return _0x297cf4;};}function handleError(_0x4d5f7e,_0x4e04f2){_0x4e04f2=_0x4e04f2||0x1f4;return function(_0x3ef4bf){logger[_0x1f02('0x23')](_0x3ef4bf[_0x1f02('0x24')]);if(_0x3ef4bf['name']){delete _0x3ef4bf['name'];}_0x4d5f7e[_0x1f02('0x18')](_0x4e04f2)[_0x1f02('0x25')](_0x3ef4bf);};}exports[_0x1f02('0x26')]=function(_0x433a1e,_0x220345){var _0x3080a6={},_0x442333={},_0x23fa22={'count':0x0,'rows':[]};var _0x1c2a0d=_[_0x1f02('0x27')](db['Tag'][_0x1f02('0x28')],function(_0x5ab7a2){return{'name':_0x5ab7a2[_0x1f02('0x29')],'type':_0x5ab7a2[_0x1f02('0x2a')][_0x1f02('0x2b')]};});_0x442333[_0x1f02('0x2c')]=_[_0x1f02('0x27')](_0x1c2a0d,_0x1f02('0x2d'));_0x442333['query']=_['keys'](_0x433a1e[_0x1f02('0x2e')]);_0x442333[_0x1f02('0x2f')]=_['intersection'](_0x442333[_0x1f02('0x2c')],_0x442333['query']);_0x3080a6[_0x1f02('0x30')]=_['intersection'](_0x442333[_0x1f02('0x2c')],qs['fields'](_0x433a1e['query'][_0x1f02('0x31')]));_0x3080a6[_0x1f02('0x30')]=_0x3080a6[_0x1f02('0x30')][_0x1f02('0x32')]?_0x3080a6['attributes']:_0x442333[_0x1f02('0x2c')];if(!_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x33')]('nolimit')){_0x3080a6[_0x1f02('0x1c')]=qs[_0x1f02('0x1c')](_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x1c')]);_0x3080a6[_0x1f02('0x1b')]=qs[_0x1f02('0x1b')](_0x433a1e['query'][_0x1f02('0x1b')]);}_0x3080a6[_0x1f02('0x34')]=qs[_0x1f02('0x35')](_0x433a1e['query'][_0x1f02('0x35')]);_0x3080a6['where']=qs[_0x1f02('0x2f')](_['pick'](_0x433a1e['query'],_0x442333[_0x1f02('0x2f')]),_0x1c2a0d);if(_0x433a1e['query']['filter']){_0x3080a6[_0x1f02('0x36')]=_[_0x1f02('0x37')](_0x3080a6[_0x1f02('0x36')],{'$or':_[_0x1f02('0x27')](_0x1c2a0d,function(_0x47ee27){if(_0x47ee27[_0x1f02('0x2a')]!=='VIRTUAL'){var _0x2cd179={};_0x2cd179[_0x47ee27[_0x1f02('0x2d')]]={'$like':'%'+_0x433a1e[_0x1f02('0x2e')][_0x1f02('0x38')]+'%'};return _0x2cd179;}})});}_0x3080a6=_[_0x1f02('0x37')]({},_0x3080a6,_0x433a1e[_0x1f02('0x39')]);var _0xb4fac5={'where':_0x3080a6[_0x1f02('0x36')]};return db[_0x1f02('0x3a')]['count'](_0xb4fac5)[_0x1f02('0x20')](function(_0x5aab10){_0x23fa22[_0x1f02('0x3b')]=_0x5aab10;if(_0x433a1e['query'][_0x1f02('0x3c')]){_0x3080a6[_0x1f02('0x3d')]=[{'all':!![]}];}return db[_0x1f02('0x3a')]['findAll'](_0x3080a6);})['then'](function(_0x1c3f09){_0x23fa22[_0x1f02('0x3e')]=_0x1c3f09;return _0x23fa22;})[_0x1f02('0x20')](respondWithFilteredResult(_0x220345,_0x3080a6))[_0x1f02('0x3f')](handleError(_0x220345,null));};exports[_0x1f02('0x40')]=function(_0x15fb49,_0x23733c){var _0x11f31f={'raw':!![],'where':{'id':_0x15fb49['params']['id']}},_0x391b57={};_0x391b57[_0x1f02('0x2c')]=_['keys'](db['Tag'][_0x1f02('0x28')]);_0x391b57['query']=_['keys'](_0x15fb49[_0x1f02('0x2e')]);_0x391b57['filters']=_['intersection'](_0x391b57[_0x1f02('0x2c')],_0x391b57[_0x1f02('0x2e')]);_0x11f31f['attributes']=_[_0x1f02('0x41')](_0x391b57[_0x1f02('0x2c')],qs[_0x1f02('0x31')](_0x15fb49[_0x1f02('0x2e')]['fields']));_0x11f31f[_0x1f02('0x30')]=_0x11f31f[_0x1f02('0x30')][_0x1f02('0x32')]?_0x11f31f[_0x1f02('0x30')]:_0x391b57[_0x1f02('0x2c')];if(_0x15fb49[_0x1f02('0x2e')][_0x1f02('0x3c')]){_0x11f31f[_0x1f02('0x3d')]=[{'all':!![]}];}_0x11f31f=_[_0x1f02('0x37')]({},_0x11f31f,_0x15fb49[_0x1f02('0x39')]);return db[_0x1f02('0x3a')][_0x1f02('0x42')](_0x11f31f)[_0x1f02('0x20')](handleEntityNotFound(_0x23733c,null))[_0x1f02('0x20')](respondWithResult(_0x23733c,null))['catch'](handleError(_0x23733c,null));};exports[_0x1f02('0x43')]=function(_0x50d5ed,_0x37759d){return db['Tag'][_0x1f02('0x43')](_0x50d5ed[_0x1f02('0x44')],{})[_0x1f02('0x20')](function(_0x32dac3){var _0x40bf99=_0x50d5ed[_0x1f02('0x45')][_0x1f02('0x46')]({'plain':!![]});if(!_0x40bf99)throw new Error(_0x1f02('0x47'));if(_0x40bf99[_0x1f02('0x48')]===_0x1f02('0x45')){var _0x1241c5=_0x32dac3['get']({'plain':!![]});var _0x45e71d=_0x1f02('0x21');return db[_0x1f02('0x49')][_0x1f02('0x42')]({'where':{'name':_0x45e71d,'userProfileId':_0x40bf99[_0x1f02('0x4a')]},'raw':!![]})[_0x1f02('0x20')](function(_0x2201b4){if(_0x2201b4&&_0x2201b4[_0x1f02('0x4b')]===0x0){return db[_0x1f02('0x4c')]['create']({'name':_0x1241c5[_0x1f02('0x2d')],'resourceId':_0x1241c5['id'],'type':_0x2201b4[_0x1f02('0x2d')],'sectionId':_0x2201b4['id']},{})[_0x1f02('0x20')](function(){return _0x32dac3;});}else{return _0x32dac3;}})[_0x1f02('0x3f')](function(_0x3cdf8c){logger['error'](_0x1f02('0x4d'),_0x3cdf8c);throw _0x3cdf8c;});}return _0x32dac3;})['then'](respondWithResult(_0x37759d,0xc9))[_0x1f02('0x3f')](handleError(_0x37759d,null));};exports[_0x1f02('0x1f')]=function(_0x2240d1,_0x18d80d){if(_0x2240d1[_0x1f02('0x44')]['id']){delete _0x2240d1[_0x1f02('0x44')]['id'];}return db[_0x1f02('0x3a')][_0x1f02('0x42')]({'where':{'id':_0x2240d1[_0x1f02('0x4e')]['id']}})[_0x1f02('0x20')](handleEntityNotFound(_0x18d80d,null))['then'](saveUpdates(_0x2240d1['body'],null))['then'](respondWithResult(_0x18d80d,null))[_0x1f02('0x3f')](handleError(_0x18d80d,null));};exports['destroy']=function(_0x238911,_0x449d58){return db['Tag'][_0x1f02('0x42')]({'where':{'id':_0x238911['params']['id']}})['then'](handleEntityNotFound(_0x449d58,null))['then'](removeEntity(_0x449d58,null))[_0x1f02('0x3f')](handleError(_0x449d58,null));}; \ No newline at end of file +var _0x2e54=['apply','reject','save','then','get','Tags','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','Tag','includeAll','include','findAll','rows','catch','show','params','keys','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4d62c5,_0x248e0a){var _0x11d0b4=function(_0x35b3d4){while(--_0x35b3d4){_0x4d62c5['push'](_0x4d62c5['shift']());}};_0x11d0b4(++_0x248e0a);}(_0x2e54,0x1dd));var _0x42e5=function(_0x24e5e8,_0x25a4c6){_0x24e5e8=_0x24e5e8-0x0;var _0xa08d7c=_0x2e54[_0x24e5e8];return _0xa08d7c;};'use strict';var emlformat=require(_0x42e5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x42e5('0x1'));var rp=require(_0x42e5('0x2'));var moment=require(_0x42e5('0x3'));var BPromise=require(_0x42e5('0x4'));var Mustache=require(_0x42e5('0x5'));var util=require(_0x42e5('0x6'));var path=require(_0x42e5('0x7'));var sox=require('sox');var csv=require(_0x42e5('0x8'));var ejs=require(_0x42e5('0x9'));var fs=require('fs');var fs_extra=require(_0x42e5('0xa'));var _=require('lodash');var squel=require(_0x42e5('0xb'));var crypto=require('crypto');var jsforce=require(_0x42e5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x42e5('0x8'));var querystring=require(_0x42e5('0xd'));var Papa=require(_0x42e5('0xe'));var Redis=require(_0x42e5('0xf'));var authService=require(_0x42e5('0x10'));var qs=require(_0x42e5('0x11'));var as=require(_0x42e5('0x12'));var hardwareService=require(_0x42e5('0x13'));var logger=require(_0x42e5('0x14'))('api');var utils=require(_0x42e5('0x15'));var config=require(_0x42e5('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x42e5('0x17'))['db'];function respondWithStatusCode(_0x12385d,_0x4530ba){_0x4530ba=_0x4530ba||0xcc;return function(_0x41598d){if(_0x41598d){return _0x12385d[_0x42e5('0x18')](_0x4530ba);}return _0x12385d[_0x42e5('0x19')](_0x4530ba)[_0x42e5('0x1a')]();};}function respondWithResult(_0x96fae2,_0x447648){_0x447648=_0x447648||0xc8;return function(_0x23957f){if(_0x23957f){return _0x96fae2['status'](_0x447648)[_0x42e5('0x1b')](_0x23957f);}};}function respondWithFilteredResult(_0x1d8e52,_0x4034bd){return function(_0x388300){if(_0x388300){var _0x2f4999=typeof _0x4034bd[_0x42e5('0x1c')]===_0x42e5('0x1d')&&typeof _0x4034bd[_0x42e5('0x1e')]===_0x42e5('0x1d');var _0x3c7b79=_0x388300[_0x42e5('0x1f')];var _0x38282d=_0x2f4999?0x0:_0x4034bd[_0x42e5('0x1c')];var _0x23fe09=_0x2f4999?_0x388300['count']:_0x4034bd[_0x42e5('0x1c')]+_0x4034bd['limit'];var _0x5f4428;if(_0x23fe09>=_0x3c7b79){_0x23fe09=_0x3c7b79;_0x5f4428=0xc8;}else{_0x5f4428=0xce;}_0x1d8e52[_0x42e5('0x19')](_0x5f4428);return _0x1d8e52[_0x42e5('0x20')]('Content-Range',_0x38282d+'-'+_0x23fe09+'/'+_0x3c7b79)[_0x42e5('0x1b')](_0x388300);}return null;};}function patchUpdates(_0x39a3e2){return function(_0x1c2169){try{jsonpatch[_0x42e5('0x21')](_0x1c2169,_0x39a3e2,!![]);}catch(_0x1150f4){return BPromise[_0x42e5('0x22')](_0x1150f4);}return _0x1c2169[_0x42e5('0x23')]();};}function saveUpdates(_0x58eee5,_0x4da508){return function(_0x283d44){if(_0x283d44){return _0x283d44['update'](_0x58eee5)[_0x42e5('0x24')](function(_0x2e9574){return _0x2e9574;});}return null;};}function removeEntity(_0x37d10e,_0x49490f){return function(_0x32380f){if(_0x32380f){return _0x32380f['destroy']()[_0x42e5('0x24')](function(){var _0xf29221=_0x32380f[_0x42e5('0x25')]({'plain':!![]});var _0x275c80=_0x42e5('0x26');return db['UserProfileResource']['destroy']({'where':{'type':_0x275c80,'resourceId':_0xf29221['id']}})[_0x42e5('0x24')](function(){return _0x32380f;});})['then'](function(){_0x37d10e['status'](0xcc)[_0x42e5('0x1a')]();});}};}function handleEntityNotFound(_0x5b1727,_0x392c6b){return function(_0x2d9e65){if(!_0x2d9e65){_0x5b1727[_0x42e5('0x18')](0x194);}return _0x2d9e65;};}function handleError(_0x1c8ee4,_0x27ae27){_0x27ae27=_0x27ae27||0x1f4;return function(_0x2f1edc){logger['error'](_0x2f1edc[_0x42e5('0x27')]);if(_0x2f1edc[_0x42e5('0x28')]){delete _0x2f1edc[_0x42e5('0x28')];}_0x1c8ee4[_0x42e5('0x19')](_0x27ae27)[_0x42e5('0x29')](_0x2f1edc);};}exports[_0x42e5('0x2a')]=function(_0x383e97,_0x282cbf){var _0x5a4930={},_0x2ba9ef={},_0x2c7542={'count':0x0,'rows':[]};var _0x3d9e8b=_[_0x42e5('0x2b')](db['Tag'][_0x42e5('0x2c')],function(_0xf5a3dc){return{'name':_0xf5a3dc[_0x42e5('0x2d')],'type':_0xf5a3dc[_0x42e5('0x2e')]['key']};});_0x2ba9ef['model']=_[_0x42e5('0x2b')](_0x3d9e8b,'name');_0x2ba9ef[_0x42e5('0x2f')]=_['keys'](_0x383e97[_0x42e5('0x2f')]);_0x2ba9ef[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0x2ba9ef['model'],_0x2ba9ef[_0x42e5('0x2f')]);_0x5a4930[_0x42e5('0x32')]=_['intersection'](_0x2ba9ef[_0x42e5('0x33')],qs['fields'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x5a4930[_0x42e5('0x32')]=_0x5a4930[_0x42e5('0x32')][_0x42e5('0x35')]?_0x5a4930[_0x42e5('0x32')]:_0x2ba9ef[_0x42e5('0x33')];if(!_0x383e97['query']['hasOwnProperty'](_0x42e5('0x36'))){_0x5a4930[_0x42e5('0x1e')]=qs[_0x42e5('0x1e')](_0x383e97['query']['limit']);_0x5a4930['offset']=qs['offset'](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x1c')]);}_0x5a4930[_0x42e5('0x37')]=qs[_0x42e5('0x38')](_0x383e97[_0x42e5('0x2f')][_0x42e5('0x38')]);_0x5a4930[_0x42e5('0x39')]=qs[_0x42e5('0x30')](_['pick'](_0x383e97[_0x42e5('0x2f')],_0x2ba9ef['filters']),_0x3d9e8b);if(_0x383e97[_0x42e5('0x2f')][_0x42e5('0x3a')]){_0x5a4930[_0x42e5('0x39')]=_[_0x42e5('0x3b')](_0x5a4930[_0x42e5('0x39')],{'$or':_[_0x42e5('0x2b')](_0x3d9e8b,function(_0xd5e7f5){if(_0xd5e7f5['type']!==_0x42e5('0x3c')){var _0x356ff6={};_0x356ff6[_0xd5e7f5['name']]={'$like':'%'+_0x383e97[_0x42e5('0x2f')]['filter']+'%'};return _0x356ff6;}})});}_0x5a4930=_['merge']({},_0x5a4930,_0x383e97['options']);var _0x1105ea={'where':_0x5a4930[_0x42e5('0x39')]};return db[_0x42e5('0x3d')][_0x42e5('0x1f')](_0x1105ea)[_0x42e5('0x24')](function(_0x77aa22){_0x2c7542[_0x42e5('0x1f')]=_0x77aa22;if(_0x383e97['query'][_0x42e5('0x3e')]){_0x5a4930[_0x42e5('0x3f')]=[{'all':!![]}];}return db['Tag'][_0x42e5('0x40')](_0x5a4930);})[_0x42e5('0x24')](function(_0x5db771){_0x2c7542[_0x42e5('0x41')]=_0x5db771;return _0x2c7542;})[_0x42e5('0x24')](respondWithFilteredResult(_0x282cbf,_0x5a4930))[_0x42e5('0x42')](handleError(_0x282cbf,null));};exports[_0x42e5('0x43')]=function(_0x424304,_0x4d32f4){var _0x41e1fd={'raw':!![],'where':{'id':_0x424304[_0x42e5('0x44')]['id']}},_0xc34e51={};_0xc34e51[_0x42e5('0x33')]=_['keys'](db[_0x42e5('0x3d')][_0x42e5('0x2c')]);_0xc34e51[_0x42e5('0x2f')]=_[_0x42e5('0x45')](_0x424304[_0x42e5('0x2f')]);_0xc34e51[_0x42e5('0x30')]=_[_0x42e5('0x31')](_0xc34e51[_0x42e5('0x33')],_0xc34e51['query']);_0x41e1fd[_0x42e5('0x32')]=_['intersection'](_0xc34e51['model'],qs[_0x42e5('0x34')](_0x424304[_0x42e5('0x2f')][_0x42e5('0x34')]));_0x41e1fd[_0x42e5('0x32')]=_0x41e1fd[_0x42e5('0x32')][_0x42e5('0x35')]?_0x41e1fd[_0x42e5('0x32')]:_0xc34e51['model'];if(_0x424304[_0x42e5('0x2f')][_0x42e5('0x3e')]){_0x41e1fd[_0x42e5('0x3f')]=[{'all':!![]}];}_0x41e1fd=_[_0x42e5('0x3b')]({},_0x41e1fd,_0x424304[_0x42e5('0x46')]);return db[_0x42e5('0x3d')][_0x42e5('0x47')](_0x41e1fd)[_0x42e5('0x24')](handleEntityNotFound(_0x4d32f4,null))['then'](respondWithResult(_0x4d32f4,null))[_0x42e5('0x42')](handleError(_0x4d32f4,null));};exports[_0x42e5('0x48')]=function(_0x3616f4,_0x48757e){return db[_0x42e5('0x3d')][_0x42e5('0x48')](_0x3616f4[_0x42e5('0x49')],{})[_0x42e5('0x24')](function(_0x2586b0){var _0x528ddd=_0x3616f4[_0x42e5('0x4a')]['get']({'plain':!![]});if(!_0x528ddd)throw new Error(_0x42e5('0x4b'));if(_0x528ddd[_0x42e5('0x4c')]===_0x42e5('0x4a')){var _0x48b63b=_0x2586b0['get']({'plain':!![]});var _0x4f0639=_0x42e5('0x26');return db[_0x42e5('0x4d')][_0x42e5('0x47')]({'where':{'name':_0x4f0639,'userProfileId':_0x528ddd[_0x42e5('0x4e')]},'raw':!![]})['then'](function(_0x3ae9de){if(_0x3ae9de&&_0x3ae9de[_0x42e5('0x4f')]===0x0){return db[_0x42e5('0x50')]['create']({'name':_0x48b63b[_0x42e5('0x28')],'resourceId':_0x48b63b['id'],'type':_0x3ae9de['name'],'sectionId':_0x3ae9de['id']},{})[_0x42e5('0x24')](function(){return _0x2586b0;});}else{return _0x2586b0;}})[_0x42e5('0x42')](function(_0x53e29b){logger[_0x42e5('0x51')](_0x42e5('0x52'),_0x53e29b);throw _0x53e29b;});}return _0x2586b0;})[_0x42e5('0x24')](respondWithResult(_0x48757e,0xc9))[_0x42e5('0x42')](handleError(_0x48757e,null));};exports[_0x42e5('0x53')]=function(_0x3f043f,_0x41c1dc){if(_0x3f043f[_0x42e5('0x49')]['id']){delete _0x3f043f[_0x42e5('0x49')]['id'];}return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x3f043f[_0x42e5('0x44')]['id']}})[_0x42e5('0x24')](handleEntityNotFound(_0x41c1dc,null))[_0x42e5('0x24')](saveUpdates(_0x3f043f[_0x42e5('0x49')],null))[_0x42e5('0x24')](respondWithResult(_0x41c1dc,null))['catch'](handleError(_0x41c1dc,null));};exports[_0x42e5('0x54')]=function(_0x2b226f,_0x40b633){return db[_0x42e5('0x3d')]['find']({'where':{'id':_0x2b226f['params']['id']}})['then'](handleEntityNotFound(_0x40b633,null))[_0x42e5('0x24')](removeEntity(_0x40b633,null))[_0x42e5('0x42')](handleError(_0x40b633,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index a615cb1..208080d 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 _0x4528=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','tools_tags','lodash'];(function(_0x2223e5,_0x235e44){var _0x351014=function(_0xfc8709){while(--_0xfc8709){_0x2223e5['push'](_0x2223e5['shift']());}};_0x351014(++_0x235e44);}(_0x4528,0x1a3));var _0x8452=function(_0x128d05,_0x3ca321){_0x128d05=_0x128d05-0x0;var _0x247c76=_0x4528[_0x128d05];return _0x247c76;};'use strict';var _=require(_0x8452('0x0'));var util=require(_0x8452('0x1'));var logger=require(_0x8452('0x2'))('api');var moment=require(_0x8452('0x3'));var BPromise=require(_0x8452('0x4'));var rp=require(_0x8452('0x5'));var fs=require('fs');var path=require(_0x8452('0x6'));var rimraf=require(_0x8452('0x7'));var config=require(_0x8452('0x8'));var attributes=require('./tag.attributes');module[_0x8452('0x9')]=function(_0x2abe59,_0x377985){return _0x2abe59[_0x8452('0xa')]('Tag',attributes,{'tableName':_0x8452('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb06=['exports','define','Tag','tools_tags','util','../../config/logger','api','moment','request-promise','path','rimraf','./tag.attributes'];(function(_0x4da9ec,_0x1d6e00){var _0x4a1ccf=function(_0x5796bc){while(--_0x5796bc){_0x4da9ec['push'](_0x4da9ec['shift']());}};_0x4a1ccf(++_0x1d6e00);}(_0xdb06,0x1e4));var _0x6db0=function(_0x56025c,_0x4f2a56){_0x56025c=_0x56025c-0x0;var _0x5e90cd=_0xdb06[_0x56025c];return _0x5e90cd;};'use strict';var _=require('lodash');var util=require(_0x6db0('0x0'));var logger=require(_0x6db0('0x1'))(_0x6db0('0x2'));var moment=require(_0x6db0('0x3'));var BPromise=require('bluebird');var rp=require(_0x6db0('0x4'));var fs=require('fs');var path=require(_0x6db0('0x5'));var rimraf=require(_0x6db0('0x6'));var config=require('../../config/environment');var attributes=require(_0x6db0('0x7'));module[_0x6db0('0x8')]=function(_0x2cdb11,_0x57b9e9){return _0x2cdb11[_0x6db0('0x9')](_0x6db0('0xa'),attributes,{'tableName':_0x6db0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/tag/tag.rpc.js b/server/api/tag/tag.rpc.js index 98bfb69..0883f24 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 _0x6282=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3c1099,_0x4cd808){var _0x1ae4bf=function(_0x1406fc){while(--_0x1406fc){_0x3c1099['push'](_0x3c1099['shift']());}};_0x1ae4bf(++_0x4cd808);}(_0x6282,0x76));var _0x2628=function(_0x23d177,_0x2f5fde){_0x23d177=_0x23d177-0x0;var _0x5d6445=_0x6282[_0x23d177];return _0x5d6445;};'use strict';var _=require(_0x2628('0x0'));var util=require(_0x2628('0x1'));var moment=require(_0x2628('0x2'));var BPromise=require(_0x2628('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2628('0x4'))['db'];var utils=require(_0x2628('0x5'));var logger=require('../../config/logger')(_0x2628('0x6'));var config=require(_0x2628('0x7'));var jayson=require(_0x2628('0x8'));var client=jayson[_0x2628('0x9')][_0x2628('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50412a,_0xb6b945,_0x144ae8){return new BPromise(function(_0x2170a7,_0xbae7c3){return client[_0x2628('0xb')](_0x50412a,_0x144ae8)[_0x2628('0xc')](function(_0x403569){logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));logger[_0x2628('0x10')](_0x2628('0x11'),_0xb6b945,_0x2628('0xf'),JSON[_0x2628('0x12')](_0x403569));if(_0x403569[_0x2628('0x13')]){if(_0x403569['error']['code']===0x1f4){logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0xbae7c3(_0x403569['error']['message']);}logger[_0x2628('0x13')](_0x2628('0xe'),_0xb6b945,_0x403569[_0x2628('0x13')][_0x2628('0x14')]);return _0x2170a7(_0x403569[_0x2628('0x13')]['message']);}else{logger[_0x2628('0xd')](_0x2628('0xe'),_0xb6b945,_0x2628('0xf'));_0x2170a7(_0x403569['result'][_0x2628('0x14')]);}})[_0x2628('0x15')](function(_0x51df16){logger[_0x2628('0x13')]('Tag,\x20%s,\x20%s',_0xb6b945,_0x51df16);_0xbae7c3(_0x51df16);});});} \ No newline at end of file +var _0xc818=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x75c3eb,_0x271b5a){var _0x6e6585=function(_0x3d48f5){while(--_0x3d48f5){_0x75c3eb['push'](_0x75c3eb['shift']());}};_0x6e6585(++_0x271b5a);}(_0xc818,0x1e3));var _0x8c81=function(_0x18b676,_0x537b43){_0x18b676=_0x18b676-0x0;var _0x5c26cc=_0xc818[_0x18b676];return _0x5c26cc;};'use strict';var _=require(_0x8c81('0x0'));var util=require(_0x8c81('0x1'));var moment=require(_0x8c81('0x2'));var BPromise=require(_0x8c81('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8c81('0x4'));var db=require(_0x8c81('0x5'))['db'];var utils=require(_0x8c81('0x6'));var logger=require(_0x8c81('0x7'))(_0x8c81('0x8'));var config=require(_0x8c81('0x9'));var jayson=require(_0x8c81('0xa'));var client=jayson['client'][_0x8c81('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d663e,_0x32cf31,_0x43d142){return new BPromise(function(_0x501240,_0x1173cf){return client[_0x8c81('0xc')](_0x3d663e,_0x43d142)[_0x8c81('0xd')](function(_0x15ebff){logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));logger['debug'](_0x8c81('0x11'),_0x32cf31,_0x8c81('0x10'),JSON[_0x8c81('0x12')](_0x15ebff));if(_0x15ebff[_0x8c81('0x13')]){if(_0x15ebff['error'][_0x8c81('0x14')]===0x1f4){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);return _0x1173cf(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x15ebff['error']['message']);return _0x501240(_0x15ebff[_0x8c81('0x13')][_0x8c81('0x15')]);}else{logger[_0x8c81('0xe')](_0x8c81('0xf'),_0x32cf31,_0x8c81('0x10'));_0x501240(_0x15ebff[_0x8c81('0x16')]['message']);}})[_0x8c81('0x17')](function(_0x29ccb0){logger[_0x8c81('0x13')](_0x8c81('0xf'),_0x32cf31,_0x29ccb0);_0x1173cf(_0x29ccb0);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index eae5619..c4278e1 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(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 4a4614a..40662c2 100644 --- a/server/api/team/team.attributes.js +++ b/server/api/team/team.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['name','sequelize','STRING'];(function(_0x2df2eb,_0x3fa8db){var _0x374f2a=function(_0x5b4af4){while(--_0x5b4af4){_0x2df2eb['push'](_0x2df2eb['shift']());}};_0x374f2a(++_0x3fa8db);}(_0xb10b,0x12a));var _0xbb10=function(_0x354fc7,_0x10bd45){_0x354fc7=_0x354fc7-0x0;var _0x462135=_0xb10b[_0x354fc7];return _0x462135;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'allowNull':![],'unique':_0xbb10('0x2')},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x4af182,_0x246ea5){var _0x4a3a87=function(_0x391e48){while(--_0x391e48){_0x4af182['push'](_0x4af182['shift']());}};_0x4a3a87(++_0x246ea5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 503af7f..7eca9a5 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 _0x81df=['save','update','error','stack','name','send','index','map','Team','rawAttributes','type','key','model','keys','filters','attributes','fields','query','length','hasOwnProperty','order','sort','pick','where','filter','merge','then','count','includeAll','include','findAll','rows','catch','intersection','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','transaction','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','sequelize','Sequelize','QueryTypes','UserId','SELECT\x20VoiceQueueId\x20FROM\x20team_has_voice_queues\x20WHERE\x20TeamId\x20=\x20','SELECT','SELECT\x20MailQueueId\x20FROM\x20team_has_mail_queues\x20WHERE\x20TeamId\x20=\x20','MailQueueId','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','destroy','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','UserFaxQueue','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20','WhatsappQueueId','TeamVoicePrefix','VoicePrefixId','getQueues','findOne','channel','isValidChannel','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','Unknown\x20channel','add','ids','removeQueues','remove','addAgents','Voice','Mail','Sms','Fax','Openchannel','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','UserVoicePrefix','spread','removeAgents','getAgents','options','nolimit','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','offset','limit','Content-Range','apply','reject'];(function(_0x4d8666,_0x2ff19d){var _0x37175b=function(_0x1b8de6){while(--_0x1b8de6){_0x4d8666['push'](_0x4d8666['shift']());}};_0x37175b(++_0x2ff19d);}(_0x81df,0x19c));var _0xf81d=function(_0x9ed48a,_0x71a9b5){_0x9ed48a=_0x9ed48a-0x0;var _0x38188e=_0x81df[_0x9ed48a];return _0x38188e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf81d('0x0'));var zipdir=require(_0xf81d('0x1'));var jsonpatch=require(_0xf81d('0x2'));var rp=require(_0xf81d('0x3'));var moment=require('moment');var BPromise=require(_0xf81d('0x4'));var Mustache=require(_0xf81d('0x5'));var util=require(_0xf81d('0x6'));var path=require('path');var sox=require(_0xf81d('0x7'));var csv=require(_0xf81d('0x8'));var ejs=require(_0xf81d('0x9'));var fs=require('fs');var fs_extra=require(_0xf81d('0xa'));var _=require(_0xf81d('0xb'));var squel=require(_0xf81d('0xc'));var crypto=require('crypto');var jsforce=require(_0xf81d('0xd'));var deskjs=require(_0xf81d('0xe'));var toCsv=require(_0xf81d('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf81d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf81d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf81d('0x11'));var logger=require(_0xf81d('0x12'))(_0xf81d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf81d('0x14'));var db=require(_0xf81d('0x15'))['db'];config[_0xf81d('0x16')]=_[_0xf81d('0x17')](config[_0xf81d('0x16')],{'host':_0xf81d('0x18'),'port':0x18eb});var socket=require(_0xf81d('0x19'))(new Redis(config[_0xf81d('0x16')]));require(_0xf81d('0x1a'))[_0xf81d('0x1b')](socket);function respondWithStatusCode(_0x5b246e,_0x47b845){_0x47b845=_0x47b845||0xcc;return function(_0xd071d8){if(_0xd071d8){return _0x5b246e[_0xf81d('0x1c')](_0x47b845);}return _0x5b246e[_0xf81d('0x1d')](_0x47b845)['end']();};}function respondWithResult(_0x457669,_0x210138){_0x210138=_0x210138||0xc8;return function(_0x473be2){if(_0x473be2){return _0x457669['status'](_0x210138)['json'](_0x473be2);}};}function respondWithFilteredResult(_0x41db89,_0xa4e02e){return function(_0x2629e2){if(_0x2629e2){var _0xf65988=typeof _0xa4e02e[_0xf81d('0x1e')]==='undefined'&&typeof _0xa4e02e[_0xf81d('0x1f')]==='undefined';var _0x5d225a=_0x2629e2['count'];var _0x546f7a=_0xf65988?0x0:_0xa4e02e[_0xf81d('0x1e')];var _0x558d2b=_0xf65988?_0x2629e2['count']:_0xa4e02e[_0xf81d('0x1e')]+_0xa4e02e[_0xf81d('0x1f')];var _0x1bbeda;if(_0x558d2b>=_0x5d225a){_0x558d2b=_0x5d225a;_0x1bbeda=0xc8;}else{_0x1bbeda=0xce;}_0x41db89[_0xf81d('0x1d')](_0x1bbeda);return _0x41db89['set'](_0xf81d('0x20'),_0x546f7a+'-'+_0x558d2b+'/'+_0x5d225a)['json'](_0x2629e2);}return null;};}function patchUpdates(_0x10e482){return function(_0xa2f76e){try{jsonpatch[_0xf81d('0x21')](_0xa2f76e,_0x10e482,!![]);}catch(_0x282faf){return BPromise[_0xf81d('0x22')](_0x282faf);}return _0xa2f76e[_0xf81d('0x23')]();};}function saveUpdates(_0x32b59e,_0x461449){return function(_0x1f12f0){if(_0x1f12f0){return _0x1f12f0[_0xf81d('0x24')](_0x32b59e)['then'](function(_0x317cbc){return _0x317cbc;});}return null;};}function handleEntityNotFound(_0x3184f2,_0xd88c93){return function(_0x4be950){if(!_0x4be950){_0x3184f2[_0xf81d('0x1c')](0x194);}return _0x4be950;};}function handleError(_0x172f04,_0x565cf7){_0x565cf7=_0x565cf7||0x1f4;return function(_0x4dd578){logger[_0xf81d('0x25')](_0x4dd578[_0xf81d('0x26')]);if(_0x4dd578[_0xf81d('0x27')]){delete _0x4dd578[_0xf81d('0x27')];}_0x172f04['status'](_0x565cf7)[_0xf81d('0x28')](_0x4dd578);};}exports[_0xf81d('0x29')]=function(_0x2001ce,_0x1f051f){var _0x3437a9={},_0x4d262d={},_0x3fdfea={'count':0x0,'rows':[]};var _0xc74ddb=_[_0xf81d('0x2a')](db[_0xf81d('0x2b')][_0xf81d('0x2c')],function(_0x22851b){return{'name':_0x22851b['fieldName'],'type':_0x22851b[_0xf81d('0x2d')][_0xf81d('0x2e')]};});_0x4d262d[_0xf81d('0x2f')]=_[_0xf81d('0x2a')](_0xc74ddb,_0xf81d('0x27'));_0x4d262d['query']=_[_0xf81d('0x30')](_0x2001ce['query']);_0x4d262d[_0xf81d('0x31')]=_['intersection'](_0x4d262d['model'],_0x4d262d['query']);_0x3437a9[_0xf81d('0x32')]=_['intersection'](_0x4d262d[_0xf81d('0x2f')],qs[_0xf81d('0x33')](_0x2001ce[_0xf81d('0x34')]['fields']));_0x3437a9['attributes']=_0x3437a9[_0xf81d('0x32')][_0xf81d('0x35')]?_0x3437a9[_0xf81d('0x32')]:_0x4d262d[_0xf81d('0x2f')];if(!_0x2001ce['query'][_0xf81d('0x36')]('nolimit')){_0x3437a9[_0xf81d('0x1f')]=qs[_0xf81d('0x1f')](_0x2001ce['query'][_0xf81d('0x1f')]);_0x3437a9['offset']=qs[_0xf81d('0x1e')](_0x2001ce[_0xf81d('0x34')][_0xf81d('0x1e')]);}_0x3437a9[_0xf81d('0x37')]=qs[_0xf81d('0x38')](_0x2001ce[_0xf81d('0x34')]['sort']);_0x3437a9['where']=qs['filters'](_[_0xf81d('0x39')](_0x2001ce['query'],_0x4d262d[_0xf81d('0x31')]),_0xc74ddb);if(_0x2001ce[_0xf81d('0x34')]['filter']){_0x3437a9['where']=_['merge'](_0x3437a9[_0xf81d('0x3a')],{'$or':_['map'](_0xc74ddb,function(_0x2e4623){if(_0x2e4623[_0xf81d('0x2d')]!=='VIRTUAL'){var _0x10cc00={};_0x10cc00[_0x2e4623[_0xf81d('0x27')]]={'$like':'%'+_0x2001ce[_0xf81d('0x34')][_0xf81d('0x3b')]+'%'};return _0x10cc00;}})});}_0x3437a9=_[_0xf81d('0x3c')]({},_0x3437a9,_0x2001ce['options']);var _0x338327={'where':_0x3437a9['where']};return db[_0xf81d('0x2b')]['count'](_0x338327)[_0xf81d('0x3d')](function(_0x4f1f57){_0x3fdfea[_0xf81d('0x3e')]=_0x4f1f57;if(_0x2001ce[_0xf81d('0x34')][_0xf81d('0x3f')]){_0x3437a9[_0xf81d('0x40')]=[{'all':!![]}];}return db[_0xf81d('0x2b')][_0xf81d('0x41')](_0x3437a9);})[_0xf81d('0x3d')](function(_0x42df05){_0x3fdfea[_0xf81d('0x42')]=_0x42df05;return _0x3fdfea;})[_0xf81d('0x3d')](respondWithFilteredResult(_0x1f051f,_0x3437a9))[_0xf81d('0x43')](handleError(_0x1f051f,null));};exports['show']=function(_0x26b164,_0x5e1bd2){var _0x5265ba={'raw':![],'where':{'id':_0x26b164['params']['id']}},_0x57f003={};_0x57f003[_0xf81d('0x2f')]=_['keys'](db['Team'][_0xf81d('0x2c')]);_0x57f003[_0xf81d('0x34')]=_[_0xf81d('0x30')](_0x26b164[_0xf81d('0x34')]);_0x57f003[_0xf81d('0x31')]=_[_0xf81d('0x44')](_0x57f003[_0xf81d('0x2f')],_0x57f003[_0xf81d('0x34')]);_0x5265ba[_0xf81d('0x32')]=_[_0xf81d('0x44')](_0x57f003['model'],qs['fields'](_0x26b164['query'][_0xf81d('0x33')]));_0x5265ba[_0xf81d('0x32')]=_0x5265ba['attributes']['length']?_0x5265ba[_0xf81d('0x32')]:_0x57f003[_0xf81d('0x2f')];if(_0x26b164[_0xf81d('0x34')][_0xf81d('0x3f')]){_0x5265ba[_0xf81d('0x40')]=[{'all':!![]}];}_0x5265ba=_[_0xf81d('0x3c')]({},_0x5265ba,_0x26b164['options']);return db[_0xf81d('0x2b')][_0xf81d('0x45')](_0x5265ba)[_0xf81d('0x3d')](handleEntityNotFound(_0x5e1bd2,null))[_0xf81d('0x3d')](respondWithResult(_0x5e1bd2,null))['catch'](handleError(_0x5e1bd2,null));};exports['create']=function(_0x80bf2a,_0x48dc58){return db[_0xf81d('0x2b')][_0xf81d('0x46')](_0x80bf2a['body'],{})[_0xf81d('0x3d')](function(_0x3cab44){var _0x228bfa=_0x80bf2a['user'][_0xf81d('0x47')]({'plain':!![]});if(!_0x228bfa)throw new Error(_0xf81d('0x48'));if(_0x228bfa[_0xf81d('0x49')]===_0xf81d('0x4a')){var _0x274d6c=_0x3cab44[_0xf81d('0x47')]({'plain':!![]});var _0x3b8dd9=_0xf81d('0x4b');return db[_0xf81d('0x4c')][_0xf81d('0x45')]({'where':{'name':_0x3b8dd9,'userProfileId':_0x228bfa[_0xf81d('0x4d')]},'raw':!![]})[_0xf81d('0x3d')](function(_0x391688){if(_0x391688&&_0x391688['autoAssociation']===0x0){return db[_0xf81d('0x4e')][_0xf81d('0x46')]({'name':_0x274d6c['name'],'resourceId':_0x274d6c['id'],'type':_0x391688[_0xf81d('0x27')],'sectionId':_0x391688['id']},{})['then'](function(){return _0x3cab44;});}else{return _0x3cab44;}})[_0xf81d('0x43')](function(_0x144fd8){logger[_0xf81d('0x25')](_0xf81d('0x4f'),_0x144fd8);throw _0x144fd8;});}return _0x3cab44;})[_0xf81d('0x3d')](respondWithResult(_0x48dc58,0xc9))[_0xf81d('0x43')](handleError(_0x48dc58,null));};exports[_0xf81d('0x24')]=function(_0x2c8bf7,_0x32dc5d){if(_0x2c8bf7[_0xf81d('0x50')]['id']){delete _0x2c8bf7[_0xf81d('0x50')]['id'];}return db[_0xf81d('0x2b')][_0xf81d('0x45')]({'where':{'id':_0x2c8bf7[_0xf81d('0x51')]['id']}})[_0xf81d('0x3d')](handleEntityNotFound(_0x32dc5d,null))[_0xf81d('0x3d')](saveUpdates(_0x2c8bf7[_0xf81d('0x50')],null))[_0xf81d('0x3d')](respondWithResult(_0x32dc5d,null))[_0xf81d('0x43')](handleError(_0x32dc5d,null));};exports['destroy']=function(_0x5eda16,_0x2b53b3){var _0x1c01d9=_0x5eda16[_0xf81d('0x51')]['id'];var _0x2c89ac=[];return db['sequelize'][_0xf81d('0x52')](function(_0x14dacd){var _0x2b3386=_0xf81d('0x53')+_0x1c01d9;return db[_0xf81d('0x54')][_0xf81d('0x34')](_0x2b3386,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')]['SELECT'],'raw':!![],'transaction':_0x14dacd})[_0xf81d('0x3d')](function(_0xe2f76e){_0x2c89ac=_[_0xf81d('0x2a')](_0xe2f76e,function(_0x458d7b){return Number(_0x458d7b[_0xf81d('0x57')]);});})[_0xf81d('0x3d')](function(){var _0x5a7c35=_0xf81d('0x58')+_0x1c01d9;return db[_0xf81d('0x54')][_0xf81d('0x34')](_0x5a7c35,{'type':db[_0xf81d('0x55')]['QueryTypes'][_0xf81d('0x59')],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x16959f){var _0x34cef9=_[_0xf81d('0x2a')](_0x16959f,function(_0x23a58c){return Number(_0x23a58c['VoiceQueueId']);});return db['UserVoiceQueue']['destroy']({'where':{'UserId':{'$in':_0x2c89ac},'VoiceQueueId':{'$in':_0x34cef9}},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){var _0x3b5ce3=_0xf81d('0x5a')+_0x1c01d9;return db[_0xf81d('0x54')][_0xf81d('0x34')](_0x3b5ce3,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')][_0xf81d('0x59')],'raw':!![],'transaction':_0x14dacd});})['then'](function(_0x2107d5){var _0x29c567=_[_0xf81d('0x2a')](_0x2107d5,function(_0x928f0c){return Number(_0x928f0c[_0xf81d('0x5b')]);});return db['UserMailQueue']['destroy']({'where':{'UserId':{'$in':_0x2c89ac},'MailQueueId':{'$in':_0x29c567}},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){var _0x43edfe=_0xf81d('0x5c')+_0x1c01d9;return db[_0xf81d('0x54')][_0xf81d('0x34')](_0x43edfe,{'type':db['Sequelize'][_0xf81d('0x56')]['SELECT'],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x3b94b3){var _0x59f810=_[_0xf81d('0x2a')](_0x3b94b3,function(_0x34aa85){return Number(_0x34aa85[_0xf81d('0x5d')]);});return db['UserSmsQueue'][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'SmsQueueId':{'$in':_0x59f810}},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){var _0x384032=_0xf81d('0x5f')+_0x1c01d9;return db[_0xf81d('0x54')]['query'](_0x384032,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')]['SELECT'],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x70129d){var _0x504ef5=_[_0xf81d('0x2a')](_0x70129d,function(_0x21e1b5){return Number(_0x21e1b5['ChatQueueId']);});return db[_0xf81d('0x60')][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'ChatQueueId':{'$in':_0x504ef5}},'transaction':_0x14dacd});})['then'](function(){var _0x260af2=_0xf81d('0x61')+_0x1c01d9;return db['sequelize'][_0xf81d('0x34')](_0x260af2,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')][_0xf81d('0x59')],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x21fab2){var _0x2e8262=_[_0xf81d('0x2a')](_0x21fab2,function(_0x180958){return Number(_0x180958[_0xf81d('0x62')]);});return db[_0xf81d('0x63')][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'FaxQueueId':{'$in':_0x2e8262}},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){var _0x217894=_0xf81d('0x64')+_0x1c01d9;return db[_0xf81d('0x54')]['query'](_0x217894,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')]['SELECT'],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x1d6231){var _0x1318d8=_[_0xf81d('0x2a')](_0x1d6231,function(_0x145f01){return Number(_0x145f01['OpenchannelQueueId']);});return db[_0xf81d('0x65')][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'OpenchannelQueueId':{'$in':_0x1318d8}},'transaction':_0x14dacd});})['then'](function(){var _0x36b5d7=_0xf81d('0x66')+_0x1c01d9;return db[_0xf81d('0x54')][_0xf81d('0x34')](_0x36b5d7,{'type':db[_0xf81d('0x55')][_0xf81d('0x56')][_0xf81d('0x59')],'raw':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x18c5b1){var _0xb1862e=_[_0xf81d('0x2a')](_0x18c5b1,function(_0x5b3644){return Number(_0x5b3644[_0xf81d('0x67')]);});return db['UserWhatsappQueue'][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'WhatsappQueueId':{'$in':_0xb1862e}},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){return db[_0xf81d('0x68')][_0xf81d('0x45')]({'where':{'TeamId':_0x1c01d9}});})[_0xf81d('0x3d')](function(_0x1f5487){if(_0x1f5487===null){return;}return db['UserVoicePrefix'][_0xf81d('0x5e')]({'where':{'UserId':{'$in':_0x2c89ac},'VoicePrefixId':_0x1f5487[_0xf81d('0x69')]},'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(){return db[_0xf81d('0x2b')]['destroy']({'where':{'id':_0x1c01d9},'cascade':!![],'transaction':_0x14dacd});})[_0xf81d('0x3d')](function(_0x2078c3){if(_0x2078c3===0x0){_0x2b53b3[_0xf81d('0x1c')](0x194);}else{return db[_0xf81d('0x4e')][_0xf81d('0x5e')]({'where':{'type':_0xf81d('0x4b'),'resourceId':_0x1c01d9},'cascade':!![],'transaction':_0x14dacd})[_0xf81d('0x3d')](function(){_0x2b53b3[_0xf81d('0x1d')](0xcc)['end']();});}})[_0xf81d('0x43')](function(_0x50c7a0){_0x2b53b3[_0xf81d('0x1d')](0x1f4)[_0xf81d('0x28')](_0x50c7a0);});});};exports[_0xf81d('0x6a')]=function(_0x195a3e,_0x4958c1,_0x45bf18){return db[_0xf81d('0x2b')][_0xf81d('0x6b')]({'where':{'id':_0x195a3e[_0xf81d('0x51')]['id']}})[_0xf81d('0x3d')](handleEntityNotFound(_0x4958c1,null))[_0xf81d('0x3d')](function(_0x5279f8){if(!_0x195a3e[_0xf81d('0x34')][_0xf81d('0x6c')]||!utils[_0xf81d('0x6d')](_0x195a3e['query']['channel'])){throw new db['Sequelize'][(_0xf81d('0x6e'))]('Unknown\x20channel');}var _0x17280b={};var _0x1b8351={};_0x1b8351[_0xf81d('0x2f')]=_[_0xf81d('0x30')](db[_[_0xf81d('0x6f')](_0x195a3e['query'][_0xf81d('0x6c')][_0xf81d('0x70')]())+_0xf81d('0x71')][_0xf81d('0x2c')]);_0x1b8351[_0xf81d('0x34')]=_[_0xf81d('0x30')](_0x195a3e['query']);_0x1b8351[_0xf81d('0x31')]=_[_0xf81d('0x44')](_0x1b8351['model'],_0x1b8351[_0xf81d('0x34')]);_0x17280b[_0xf81d('0x32')]=_[_0xf81d('0x44')](_0x1b8351[_0xf81d('0x2f')],qs['fields'](_0x195a3e['query'][_0xf81d('0x33')]));_0x17280b[_0xf81d('0x32')]=_0x17280b[_0xf81d('0x32')]['length']?_0x17280b[_0xf81d('0x32')]:_0x1b8351[_0xf81d('0x2f')];_0x17280b[_0xf81d('0x1f')]=qs[_0xf81d('0x1f')](_0x195a3e['query'][_0xf81d('0x1f')]);_0x17280b[_0xf81d('0x1e')]=qs['offset'](_0x195a3e[_0xf81d('0x34')][_0xf81d('0x1e')]);_0x17280b[_0xf81d('0x37')]=qs['sort'](_0x195a3e[_0xf81d('0x34')][_0xf81d('0x38')]);_0x17280b[_0xf81d('0x3a')]=qs[_0xf81d('0x31')](_[_0xf81d('0x39')](_0x195a3e[_0xf81d('0x34')],_0x1b8351[_0xf81d('0x31')]));_0x17280b=_['merge']({},_0x17280b,_0x195a3e['options']);return _0x5279f8[_0xf81d('0x47')+_[_0xf81d('0x6f')](_0x195a3e[_0xf81d('0x34')]['channel']['toLowerCase']())+_0xf81d('0x72')](_0x17280b);})['then'](respondWithResult(_0x4958c1,null))[_0xf81d('0x43')](handleError(_0x4958c1,null));};exports[_0xf81d('0x73')]=function(_0x1a1d71,_0x50a41e,_0x257958){return db['Team'][_0xf81d('0x6b')]({'where':{'id':_0x1a1d71['params']['id']}})[_0xf81d('0x3d')](function(_0x143f94){if(_0x143f94){if(!_0x1a1d71[_0xf81d('0x50')]['channel']||!utils[_0xf81d('0x6d')](_0x1a1d71['body'][_0xf81d('0x6c')])){throw new db[(_0xf81d('0x55'))][(_0xf81d('0x6e'))](_0xf81d('0x74'));}return _0x143f94[_0xf81d('0x75')+_[_0xf81d('0x6f')](_0x1a1d71[_0xf81d('0x50')]['channel'][_0xf81d('0x70')]())+_0xf81d('0x72')](_0x1a1d71[_0xf81d('0x50')][_0xf81d('0x76')]);}return null;})[_0xf81d('0x3d')](handleEntityNotFound(_0x50a41e,null))[_0xf81d('0x3d')](respondWithStatusCode(_0x50a41e,null))[_0xf81d('0x43')](handleError(_0x50a41e,null));};exports[_0xf81d('0x77')]=function(_0x5b2ea7,_0x2db1dd,_0x4bdc04){return db[_0xf81d('0x2b')]['findOne']({'where':{'id':_0x5b2ea7[_0xf81d('0x51')]['id']}})[_0xf81d('0x3d')](function(_0x1c6f68){if(_0x1c6f68){if(!_0x5b2ea7[_0xf81d('0x34')][_0xf81d('0x6c')]||!utils[_0xf81d('0x6d')](_0x5b2ea7[_0xf81d('0x34')][_0xf81d('0x6c')])){throw new db[(_0xf81d('0x55'))][(_0xf81d('0x6e'))](_0xf81d('0x74'));}return _0x1c6f68[_0xf81d('0x78')+_['capitalize'](_0x5b2ea7['query']['channel'][_0xf81d('0x70')]())+_0xf81d('0x72')](_0x5b2ea7['query']['ids']);}return null;})[_0xf81d('0x3d')](handleEntityNotFound(_0x2db1dd,null))['then'](respondWithStatusCode(_0x2db1dd,null))['catch'](handleError(_0x2db1dd,null));};exports[_0xf81d('0x79')]=function(_0xa6c389,_0x4393f5){var _0x344408=_['isArray'](_0xa6c389[_0xf81d('0x50')][_0xf81d('0x76')])?_0xa6c389[_0xf81d('0x50')][_0xf81d('0x76')]:[_0xa6c389[_0xf81d('0x50')][_0xf81d('0x76')]];var _0x217348=_0xa6c389[_0xf81d('0x51')]['id'];return db[_0xf81d('0x2b')][_0xf81d('0x45')]({'where':{'id':_0x217348}})[_0xf81d('0x3d')](handleEntityNotFound(_0x4393f5,null))['then'](function(_0x4e9341){if(_0x4e9341){var _0x4fbbdd=[_0xf81d('0x7a'),'Chat',_0xf81d('0x7b'),_0xf81d('0x7c'),_0xf81d('0x7d'),_0xf81d('0x7e'),'Whatsapp'];return db[_0xf81d('0x54')]['transaction'](function(_0x5e57bd){var _0x18f594=_['map'](_0x4fbbdd,function(_0x3c71c2){var _0x27918b={'attributes':['id',_0xf81d('0x27')]};if(_0x3c71c2===_0xf81d('0x7a')){_0x27918b[_0xf81d('0x7f')]={'attributes':[_0xf81d('0x80')]};}return _0x4e9341[_0xf81d('0x47')+_0x3c71c2+'Queues'](_0x27918b)[_0xf81d('0x3d')](function(_0x28c020){var _0x47930b=_[_0xf81d('0x2a')](_0x28c020,function(_0x1f3aff){var _0x482aea=_['map'](_0x344408,function(_0x1e398b){var _0x4f535b={'where':{'UserId':_0x1e398b,[_0x3c71c2+_0xf81d('0x81')]:_0x1f3aff['id']},'transaction':_0x5e57bd};if(_0x3c71c2==='Voice'){_0x4f535b['defaults']={'penalty':_0x1f3aff[_0xf81d('0x82')][_0xf81d('0x80')]};}return db[_0xf81d('0x83')+_0x3c71c2+'Queue'][_0xf81d('0x84')](_0x4f535b)['then'](function(){socket[_0xf81d('0x85')](_0xf81d('0x4a')+_0x3c71c2+'Queue:save',{'UserId':_0x1e398b,[_0x3c71c2+'QueueId']:_0x1f3aff['id']});if(_0x3c71c2!=='Voice'){return;}return db[_0xf81d('0x83')]['findAll']({'where':{'id':_0x344408,'online':0x1},'attributes':['id',_0xf81d('0x27'),_0xf81d('0x86'),_0xf81d('0x87'),_0xf81d('0x88')],'raw':!![]})['then'](function(_0x23e1c7){var _0x3d341b=_[_0xf81d('0x2a')](_0x23e1c7,function(_0x2568a7){return db[_0xf81d('0x89')][_0xf81d('0x8a')]({'membername':_0x2568a7[_0xf81d('0x27')],'UserId':_0x2568a7['id'],'queue_name':_0x1f3aff[_0xf81d('0x27')],'VoiceQueueId':_0x1f3aff['id'],'interface':_[_0xf81d('0x8b')](_0x2568a7[_0xf81d('0x88')])?util[_0xf81d('0x8c')](_0xf81d('0x8d'),_0x2568a7['name']):_0x2568a7['interface'],'paused':_0x2568a7['voicePause']||![],'penalty':_0x1f3aff[_0xf81d('0x82')][_0xf81d('0x80')]},{'transaction':_0x5e57bd});});return Promise[_0xf81d('0x8e')](_0x3d341b);});});});return Promise[_0xf81d('0x8e')](_0x482aea);});return Promise[_0xf81d('0x8e')](_0x47930b);})[_0xf81d('0x3d')](function(){return db[_0xf81d('0x68')][_0xf81d('0x6b')]({'where':{'teamId':_0x217348}})['then'](function(_0x2a64db){if(_0x2a64db){var _0x585f0c=_['map'](_0x344408,function(_0x1add43){db[_0xf81d('0x8f')][_0xf81d('0x8a')]({'UserId':_0x1add43,'VoicePrefixId':_0x2a64db[_0xf81d('0x69')]});});return Promise[_0xf81d('0x8e')](_0x585f0c);}});});});return Promise[_0xf81d('0x8e')](_0x18f594)[_0xf81d('0x3d')](function(){return _0x4e9341[_0xf81d('0x79')](_0x344408,{'transaction':_0x5e57bd})[_0xf81d('0x90')](function(_0x433db3){return _0x433db3;});});});}})[_0xf81d('0x3d')](respondWithResult(_0x4393f5,null))[_0xf81d('0x43')](handleError(_0x4393f5,null));};exports['removeAgents']=function(_0x5a3d8b,_0x16e128){var _0x284cc9=_['isArray'](_0x5a3d8b[_0xf81d('0x34')]['ids'])?_0x5a3d8b[_0xf81d('0x34')]['ids']:[_0x5a3d8b[_0xf81d('0x34')][_0xf81d('0x76')]];var _0x5e647e=_0x5a3d8b[_0xf81d('0x51')]['id'];return db[_0xf81d('0x2b')]['find']({'where':{'id':_0x5e647e}})[_0xf81d('0x3d')](handleEntityNotFound(_0x16e128,null))['then'](function(_0x1f403a){if(_0x1f403a){var _0xb947a4=[_0xf81d('0x7a'),'Chat',_0xf81d('0x7b'),'Sms',_0xf81d('0x7d'),_0xf81d('0x7e'),'Whatsapp'];return db['sequelize'][_0xf81d('0x52')](function(_0x1245f4){var _0x6ac8bd=_['map'](_0xb947a4,function(_0x35a955){var _0x1927e2={'attributes':['id',_0xf81d('0x27')]};return _0x1f403a[_0xf81d('0x47')+_0x35a955+_0xf81d('0x72')](_0x1927e2)[_0xf81d('0x3d')](function(_0x1c88fb){var _0x31c619=_[_0xf81d('0x2a')](_0x1c88fb,function(_0x5696ad){return _0x5696ad[_0xf81d('0x91')](_0x284cc9,{'transaction':_0x1245f4})[_0xf81d('0x3d')](function(){var _0x373120=_[_0xf81d('0x2a')](_0x284cc9,function(_0x300e8f){socket[_0xf81d('0x85')]('user'+_0x35a955+'Queue:remove',{'UserId':Number(_0x300e8f),[_0x35a955+_0xf81d('0x81')]:_0x5696ad['id']});if(_0x35a955!=='Voice'){return;}return db[_0xf81d('0x89')][_0xf81d('0x5e')]({'where':{'VoiceQueueId':_0x5696ad['id'],'UserId':_0x300e8f},'transaction':_0x1245f4});});return Promise[_0xf81d('0x8e')](_0x373120);});});return Promise['all'](_0x31c619);});});return Promise[_0xf81d('0x8e')](_0x6ac8bd)[_0xf81d('0x3d')](function(){return _0x1f403a['removeAgents'](_0x284cc9,{'transaction':_0x1245f4});})['then'](function(){return db[_0xf81d('0x68')][_0xf81d('0x6b')]({'where':{'teamId':_0x5e647e}})[_0xf81d('0x3d')](function(_0x390a4b){if(_0x390a4b){var _0x12faf9=_['map'](_0x284cc9,function(_0x72758e){db['UserVoicePrefix']['destroy']({'where':{'UserId':_0x72758e,'VoicePrefixId':_0x390a4b[_0xf81d('0x69')]}});});return Promise['all'](_0x12faf9);}});});});}})[_0xf81d('0x3d')](respondWithStatusCode(_0x16e128,null))['catch'](handleError(_0x16e128,null));};exports[_0xf81d('0x92')]=function(_0x416ab5,_0x3e64e7,_0x1600fc){var _0x4c576e={};var _0x3557da={};var _0x568e90;var _0x4a34ca;return db[_0xf81d('0x2b')][_0xf81d('0x6b')]({'where':{'id':_0x416ab5[_0xf81d('0x51')]['id']}})[_0xf81d('0x3d')](handleEntityNotFound(_0x3e64e7,null))[_0xf81d('0x3d')](function(_0x394cc5){if(_0x394cc5){_0x568e90=_0x394cc5;_0x3557da['model']=_[_0xf81d('0x30')](db[_0xf81d('0x83')][_0xf81d('0x2c')]);_0x3557da[_0xf81d('0x34')]=_[_0xf81d('0x30')](_0x416ab5['query']);_0x3557da['filters']=_[_0xf81d('0x44')](_0x3557da['model'],_0x3557da[_0xf81d('0x34')]);_0x4c576e[_0xf81d('0x32')]=_['intersection'](_0x3557da[_0xf81d('0x2f')],qs[_0xf81d('0x33')](_0x416ab5[_0xf81d('0x34')]['fields']));_0x4c576e['attributes']=_0x4c576e[_0xf81d('0x32')][_0xf81d('0x35')]?_0x4c576e[_0xf81d('0x32')]:_0x3557da[_0xf81d('0x2f')];_0x4c576e['order']=qs['sort'](_0x416ab5[_0xf81d('0x34')]['sort']);_0x4c576e[_0xf81d('0x3a')]=qs[_0xf81d('0x31')](_[_0xf81d('0x39')](_0x416ab5[_0xf81d('0x34')],_0x3557da['filters']));if(_0x416ab5['query'][_0xf81d('0x3b')]){_0x4c576e[_0xf81d('0x3a')]=_[_0xf81d('0x3c')](_0x4c576e[_0xf81d('0x3a')],{'$or':_[_0xf81d('0x2a')](_0x4c576e[_0xf81d('0x32')],function(_0x702abc){var _0x406d0f={};_0x406d0f[_0x702abc]={'$like':'%'+_0x416ab5['query']['filter']+'%'};return _0x406d0f;})});}_0x4c576e=_[_0xf81d('0x3c')]({},_0x4c576e,_0x416ab5[_0xf81d('0x93')]);return _0x568e90[_0xf81d('0x92')](_0x4c576e);}})['then'](function(_0x1c1822){if(_0x1c1822){_0x4a34ca=_0x1c1822[_0xf81d('0x35')];if(!_0x416ab5['query']['hasOwnProperty'](_0xf81d('0x94'))){_0x4c576e[_0xf81d('0x1f')]=qs[_0xf81d('0x1f')](_0x416ab5['query'][_0xf81d('0x1f')]);_0x4c576e[_0xf81d('0x1e')]=qs[_0xf81d('0x1e')](_0x416ab5['query'][_0xf81d('0x1e')]);}return _0x568e90['getAgents'](_0x4c576e);}})['then'](function(_0x21185c){if(_0x21185c){return _0x21185c?{'count':_0x4a34ca,'rows':_0x21185c}:null;}})[_0xf81d('0x3d')](respondWithResult(_0x3e64e7,null))[_0xf81d('0x43')](handleError(_0x3e64e7,null));}; \ No newline at end of file +var _0xe88d=['Sequelize','QueryTypes','MailQueueId','UserMailQueue','SELECT\x20SmsQueueId\x20FROM\x20team_has_sms_queues\x20WHERE\x20TeamId\x20=\x20','SmsQueueId','UserSmsQueue','SELECT\x20ChatQueueId\x20FROM\x20team_has_chat_queues\x20WHERE\x20TeamId\x20=\x20','ChatQueueId','UserChatQueue','SELECT\x20FaxQueueId\x20FROM\x20team_has_fax_queues\x20WHERE\x20TeamId\x20=\x20','FaxQueueId','SELECT\x20OpenchannelQueueId\x20FROM\x20team_has_openchannel_queues\x20WHERE\x20TeamId\x20=\x20','UserOpenchannelQueue','WhatsappQueueId','UserWhatsappQueue','TeamVoicePrefix','VoicePrefixId','findOne','channel','isValidChannel','Unknown\x20channel','capitalize','toLowerCase','Queue','order','Queues','addQueues','ValidationError','ids','removeQueues','remove','addAgents','isArray','Voice','Mail','Sms','Openchannel','Whatsapp','through','penalty','QueueId','TeamVoiceQueue','User','findOrCreate','emit','Queue:save','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','removeAgents','Fax','transaction','Queue:remove','UserVoicePrefix','getAgents','options','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./team.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Team','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','sequelize','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','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'];(function(_0x5a425f,_0x439447){var _0x1ab39e=function(_0x36829a){while(--_0x36829a){_0x5a425f['push'](_0x5a425f['shift']());}};_0x1ab39e(++_0x439447);}(_0xe88d,0xdd));var _0xde88=function(_0x20cb20,_0x256051){_0x20cb20=_0x20cb20-0x0;var _0x2fcf4b=_0xe88d[_0x20cb20];return _0x2fcf4b;};'use strict';var emlformat=require(_0xde88('0x0'));var rimraf=require(_0xde88('0x1'));var zipdir=require(_0xde88('0x2'));var jsonpatch=require(_0xde88('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xde88('0x4'));var Mustache=require(_0xde88('0x5'));var util=require(_0xde88('0x6'));var path=require(_0xde88('0x7'));var sox=require(_0xde88('0x8'));var csv=require(_0xde88('0x9'));var ejs=require(_0xde88('0xa'));var fs=require('fs');var fs_extra=require(_0xde88('0xb'));var _=require('lodash');var squel=require(_0xde88('0xc'));var crypto=require(_0xde88('0xd'));var jsforce=require(_0xde88('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xde88('0x9'));var querystring=require(_0xde88('0xf'));var Papa=require('papaparse');var Redis=require(_0xde88('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xde88('0x11'));var hardwareService=require(_0xde88('0x12'));var logger=require(_0xde88('0x13'))(_0xde88('0x14'));var utils=require('../../config/utils');var config=require(_0xde88('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xde88('0x16'))['db'];config[_0xde88('0x17')]=_[_0xde88('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xde88('0x19'))(new Redis(config[_0xde88('0x17')]));require(_0xde88('0x1a'))['register'](socket);function respondWithStatusCode(_0x9c327d,_0x215987){_0x215987=_0x215987||0xcc;return function(_0x20098e){if(_0x20098e){return _0x9c327d[_0xde88('0x1b')](_0x215987);}return _0x9c327d[_0xde88('0x1c')](_0x215987)[_0xde88('0x1d')]();};}function respondWithResult(_0x23f85e,_0x22af14){_0x22af14=_0x22af14||0xc8;return function(_0x29e775){if(_0x29e775){return _0x23f85e[_0xde88('0x1c')](_0x22af14)[_0xde88('0x1e')](_0x29e775);}};}function respondWithFilteredResult(_0x537a80,_0x5e8456){return function(_0x567cdb){if(_0x567cdb){var _0x1626bb=typeof _0x5e8456[_0xde88('0x1f')]===_0xde88('0x20')&&typeof _0x5e8456[_0xde88('0x21')]===_0xde88('0x20');var _0x197bfb=_0x567cdb[_0xde88('0x22')];var _0x4bb708=_0x1626bb?0x0:_0x5e8456[_0xde88('0x1f')];var _0x4bee46=_0x1626bb?_0x567cdb[_0xde88('0x22')]:_0x5e8456[_0xde88('0x1f')]+_0x5e8456['limit'];var _0x38b497;if(_0x4bee46>=_0x197bfb){_0x4bee46=_0x197bfb;_0x38b497=0xc8;}else{_0x38b497=0xce;}_0x537a80[_0xde88('0x1c')](_0x38b497);return _0x537a80[_0xde88('0x23')](_0xde88('0x24'),_0x4bb708+'-'+_0x4bee46+'/'+_0x197bfb)[_0xde88('0x1e')](_0x567cdb);}return null;};}function patchUpdates(_0x586210){return function(_0x711dbd){try{jsonpatch[_0xde88('0x25')](_0x711dbd,_0x586210,!![]);}catch(_0x510b21){return BPromise[_0xde88('0x26')](_0x510b21);}return _0x711dbd[_0xde88('0x27')]();};}function saveUpdates(_0x396c18,_0x4a95aa){return function(_0x455178){if(_0x455178){return _0x455178['update'](_0x396c18)[_0xde88('0x28')](function(_0x446396){return _0x446396;});}return null;};}function handleEntityNotFound(_0x7f46d2,_0x36c82d){return function(_0x5553c2){if(!_0x5553c2){_0x7f46d2[_0xde88('0x1b')](0x194);}return _0x5553c2;};}function handleError(_0x418fc6,_0x908729){_0x908729=_0x908729||0x1f4;return function(_0xdf9a98){logger[_0xde88('0x29')](_0xdf9a98[_0xde88('0x2a')]);if(_0xdf9a98[_0xde88('0x2b')]){delete _0xdf9a98[_0xde88('0x2b')];}_0x418fc6['status'](_0x908729)[_0xde88('0x2c')](_0xdf9a98);};}exports['index']=function(_0x4a4506,_0x46a398){var _0x1b31d2={},_0x4684ed={},_0x106880={'count':0x0,'rows':[]};var _0x57fa6f=_['map'](db[_0xde88('0x2d')][_0xde88('0x2e')],function(_0x4c504e){return{'name':_0x4c504e[_0xde88('0x2f')],'type':_0x4c504e[_0xde88('0x30')][_0xde88('0x31')]};});_0x4684ed[_0xde88('0x32')]=_[_0xde88('0x33')](_0x57fa6f,_0xde88('0x2b'));_0x4684ed[_0xde88('0x34')]=_[_0xde88('0x35')](_0x4a4506[_0xde88('0x34')]);_0x4684ed[_0xde88('0x36')]=_['intersection'](_0x4684ed[_0xde88('0x32')],_0x4684ed[_0xde88('0x34')]);_0x1b31d2[_0xde88('0x37')]=_[_0xde88('0x38')](_0x4684ed[_0xde88('0x32')],qs[_0xde88('0x39')](_0x4a4506[_0xde88('0x34')]['fields']));_0x1b31d2[_0xde88('0x37')]=_0x1b31d2[_0xde88('0x37')][_0xde88('0x3a')]?_0x1b31d2[_0xde88('0x37')]:_0x4684ed['model'];if(!_0x4a4506['query'][_0xde88('0x3b')](_0xde88('0x3c'))){_0x1b31d2[_0xde88('0x21')]=qs['limit'](_0x4a4506[_0xde88('0x34')][_0xde88('0x21')]);_0x1b31d2[_0xde88('0x1f')]=qs[_0xde88('0x1f')](_0x4a4506[_0xde88('0x34')][_0xde88('0x1f')]);}_0x1b31d2['order']=qs[_0xde88('0x3d')](_0x4a4506['query'][_0xde88('0x3d')]);_0x1b31d2[_0xde88('0x3e')]=qs[_0xde88('0x36')](_[_0xde88('0x3f')](_0x4a4506[_0xde88('0x34')],_0x4684ed['filters']),_0x57fa6f);if(_0x4a4506[_0xde88('0x34')][_0xde88('0x40')]){_0x1b31d2[_0xde88('0x3e')]=_[_0xde88('0x41')](_0x1b31d2[_0xde88('0x3e')],{'$or':_[_0xde88('0x33')](_0x57fa6f,function(_0x46692a){if(_0x46692a[_0xde88('0x30')]!==_0xde88('0x42')){var _0x42e81c={};_0x42e81c[_0x46692a[_0xde88('0x2b')]]={'$like':'%'+_0x4a4506[_0xde88('0x34')][_0xde88('0x40')]+'%'};return _0x42e81c;}})});}_0x1b31d2=_[_0xde88('0x41')]({},_0x1b31d2,_0x4a4506['options']);var _0x43b56e={'where':_0x1b31d2[_0xde88('0x3e')]};return db['Team']['count'](_0x43b56e)[_0xde88('0x28')](function(_0x2cde6c){_0x106880[_0xde88('0x22')]=_0x2cde6c;if(_0x4a4506[_0xde88('0x34')][_0xde88('0x43')]){_0x1b31d2[_0xde88('0x44')]=[{'all':!![]}];}return db[_0xde88('0x2d')][_0xde88('0x45')](_0x1b31d2);})['then'](function(_0x5c3d79){_0x106880[_0xde88('0x46')]=_0x5c3d79;return _0x106880;})['then'](respondWithFilteredResult(_0x46a398,_0x1b31d2))[_0xde88('0x47')](handleError(_0x46a398,null));};exports[_0xde88('0x48')]=function(_0x49b1f3,_0x990dc4){var _0x439b05={'raw':![],'where':{'id':_0x49b1f3[_0xde88('0x49')]['id']}},_0x2bfaaf={};_0x2bfaaf[_0xde88('0x32')]=_[_0xde88('0x35')](db['Team'][_0xde88('0x2e')]);_0x2bfaaf[_0xde88('0x34')]=_[_0xde88('0x35')](_0x49b1f3[_0xde88('0x34')]);_0x2bfaaf[_0xde88('0x36')]=_['intersection'](_0x2bfaaf[_0xde88('0x32')],_0x2bfaaf['query']);_0x439b05[_0xde88('0x37')]=_[_0xde88('0x38')](_0x2bfaaf['model'],qs[_0xde88('0x39')](_0x49b1f3[_0xde88('0x34')][_0xde88('0x39')]));_0x439b05[_0xde88('0x37')]=_0x439b05[_0xde88('0x37')][_0xde88('0x3a')]?_0x439b05[_0xde88('0x37')]:_0x2bfaaf['model'];if(_0x49b1f3[_0xde88('0x34')][_0xde88('0x43')]){_0x439b05[_0xde88('0x44')]=[{'all':!![]}];}_0x439b05=_[_0xde88('0x41')]({},_0x439b05,_0x49b1f3['options']);return db[_0xde88('0x2d')][_0xde88('0x4a')](_0x439b05)[_0xde88('0x28')](handleEntityNotFound(_0x990dc4,null))['then'](respondWithResult(_0x990dc4,null))[_0xde88('0x47')](handleError(_0x990dc4,null));};exports['create']=function(_0x2bdf76,_0x62a487){return db[_0xde88('0x2d')][_0xde88('0x4b')](_0x2bdf76[_0xde88('0x4c')],{})[_0xde88('0x28')](function(_0x6083b2){var _0x294cf4=_0x2bdf76[_0xde88('0x4d')][_0xde88('0x4e')]({'plain':!![]});if(!_0x294cf4)throw new Error(_0xde88('0x4f'));if(_0x294cf4[_0xde88('0x50')]===_0xde88('0x4d')){var _0x3e7dc2=_0x6083b2[_0xde88('0x4e')]({'plain':!![]});var _0x1f2c18=_0xde88('0x51');return db[_0xde88('0x52')][_0xde88('0x4a')]({'where':{'name':_0x1f2c18,'userProfileId':_0x294cf4['userProfileId']},'raw':!![]})[_0xde88('0x28')](function(_0x5bd31b){if(_0x5bd31b&&_0x5bd31b['autoAssociation']===0x0){return db[_0xde88('0x53')][_0xde88('0x4b')]({'name':_0x3e7dc2[_0xde88('0x2b')],'resourceId':_0x3e7dc2['id'],'type':_0x5bd31b[_0xde88('0x2b')],'sectionId':_0x5bd31b['id']},{})[_0xde88('0x28')](function(){return _0x6083b2;});}else{return _0x6083b2;}})[_0xde88('0x47')](function(_0x2c8da8){logger[_0xde88('0x29')](_0xde88('0x54'),_0x2c8da8);throw _0x2c8da8;});}return _0x6083b2;})[_0xde88('0x28')](respondWithResult(_0x62a487,0xc9))['catch'](handleError(_0x62a487,null));};exports[_0xde88('0x55')]=function(_0x914e00,_0x3e1f3d){if(_0x914e00[_0xde88('0x4c')]['id']){delete _0x914e00[_0xde88('0x4c')]['id'];}return db[_0xde88('0x2d')][_0xde88('0x4a')]({'where':{'id':_0x914e00['params']['id']}})['then'](handleEntityNotFound(_0x3e1f3d,null))['then'](saveUpdates(_0x914e00[_0xde88('0x4c')],null))[_0xde88('0x28')](respondWithResult(_0x3e1f3d,null))[_0xde88('0x47')](handleError(_0x3e1f3d,null));};exports[_0xde88('0x56')]=function(_0x3e8a3c,_0x3d7895){var _0x1ed4b8=_0x3e8a3c[_0xde88('0x49')]['id'];var _0x30ee36=[];return db[_0xde88('0x57')]['transaction'](function(_0x3a1ff7){var _0x55665d=_0xde88('0x58')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x55665d,{'type':db['Sequelize']['QueryTypes'][_0xde88('0x59')],'raw':!![],'transaction':_0x3a1ff7})[_0xde88('0x28')](function(_0x29f48c){_0x30ee36=_[_0xde88('0x33')](_0x29f48c,function(_0x500090){return Number(_0x500090[_0xde88('0x5a')]);});})[_0xde88('0x28')](function(){var _0x30f210=_0xde88('0x5b')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x30f210,{'type':db['Sequelize']['QueryTypes'][_0xde88('0x59')],'raw':!![],'transaction':_0x3a1ff7});})['then'](function(_0x35dea7){var _0x500815=_['map'](_0x35dea7,function(_0x2a1678){return Number(_0x2a1678[_0xde88('0x5c')]);});return db[_0xde88('0x5d')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'VoiceQueueId':{'$in':_0x500815}},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){var _0x26ad60=_0xde88('0x5e')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x26ad60,{'type':db[_0xde88('0x5f')][_0xde88('0x60')]['SELECT'],'raw':!![],'transaction':_0x3a1ff7});})['then'](function(_0x48230b){var _0x93b111=_['map'](_0x48230b,function(_0x3774be){return Number(_0x3774be[_0xde88('0x61')]);});return db[_0xde88('0x62')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'MailQueueId':{'$in':_0x93b111}},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){var _0x351fe9=_0xde88('0x63')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x351fe9,{'type':db[_0xde88('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3a1ff7});})['then'](function(_0x294dd3){var _0x4f78e8=_[_0xde88('0x33')](_0x294dd3,function(_0x49d728){return Number(_0x49d728[_0xde88('0x64')]);});return db[_0xde88('0x65')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'SmsQueueId':{'$in':_0x4f78e8}},'transaction':_0x3a1ff7});})['then'](function(){var _0x1d59fc=_0xde88('0x66')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x1d59fc,{'type':db[_0xde88('0x5f')][_0xde88('0x60')][_0xde88('0x59')],'raw':!![],'transaction':_0x3a1ff7});})['then'](function(_0x37ba1e){var _0x2027c4=_[_0xde88('0x33')](_0x37ba1e,function(_0x199f36){return Number(_0x199f36[_0xde88('0x67')]);});return db[_0xde88('0x68')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'ChatQueueId':{'$in':_0x2027c4}},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){var _0xd0fe23=_0xde88('0x69')+_0x1ed4b8;return db['sequelize']['query'](_0xd0fe23,{'type':db[_0xde88('0x5f')]['QueryTypes'][_0xde88('0x59')],'raw':!![],'transaction':_0x3a1ff7});})['then'](function(_0x207149){var _0x1d851c=_['map'](_0x207149,function(_0x4ff335){return Number(_0x4ff335[_0xde88('0x6a')]);});return db['UserFaxQueue'][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'FaxQueueId':{'$in':_0x1d851c}},'transaction':_0x3a1ff7});})['then'](function(){var _0x35ec5f=_0xde88('0x6b')+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x35ec5f,{'type':db[_0xde88('0x5f')]['QueryTypes']['SELECT'],'raw':!![],'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(_0x544651){var _0x47e67a=_[_0xde88('0x33')](_0x544651,function(_0x2dc65b){return Number(_0x2dc65b['OpenchannelQueueId']);});return db[_0xde88('0x6c')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'OpenchannelQueueId':{'$in':_0x47e67a}},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){var _0x11b3c0='SELECT\x20WhatsappQueueId\x20FROM\x20team_has_whatsapp_queues\x20WHERE\x20TeamId\x20=\x20'+_0x1ed4b8;return db[_0xde88('0x57')][_0xde88('0x34')](_0x11b3c0,{'type':db[_0xde88('0x5f')]['QueryTypes'][_0xde88('0x59')],'raw':!![],'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(_0x5a6c60){var _0xe9528=_[_0xde88('0x33')](_0x5a6c60,function(_0x5c21b6){return Number(_0x5c21b6[_0xde88('0x6d')]);});return db[_0xde88('0x6e')][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'WhatsappQueueId':{'$in':_0xe9528}},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){return db[_0xde88('0x6f')]['find']({'where':{'TeamId':_0x1ed4b8}});})[_0xde88('0x28')](function(_0x5e31bb){if(_0x5e31bb===null){return;}return db['UserVoicePrefix'][_0xde88('0x56')]({'where':{'UserId':{'$in':_0x30ee36},'VoicePrefixId':_0x5e31bb[_0xde88('0x70')]},'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(){return db[_0xde88('0x2d')][_0xde88('0x56')]({'where':{'id':_0x1ed4b8},'cascade':!![],'transaction':_0x3a1ff7});})[_0xde88('0x28')](function(_0x1864a5){if(_0x1864a5===0x0){_0x3d7895[_0xde88('0x1b')](0x194);}else{return db[_0xde88('0x53')][_0xde88('0x56')]({'where':{'type':_0xde88('0x51'),'resourceId':_0x1ed4b8},'cascade':!![],'transaction':_0x3a1ff7})['then'](function(){_0x3d7895[_0xde88('0x1c')](0xcc)[_0xde88('0x1d')]();});}})[_0xde88('0x47')](function(_0x28045d){_0x3d7895[_0xde88('0x1c')](0x1f4)['send'](_0x28045d);});});};exports['getQueues']=function(_0x2cffc8,_0x50d364,_0x31d766){return db[_0xde88('0x2d')][_0xde88('0x71')]({'where':{'id':_0x2cffc8[_0xde88('0x49')]['id']}})['then'](handleEntityNotFound(_0x50d364,null))[_0xde88('0x28')](function(_0x3d840e){if(!_0x2cffc8['query'][_0xde88('0x72')]||!utils[_0xde88('0x73')](_0x2cffc8['query'][_0xde88('0x72')])){throw new db[(_0xde88('0x5f'))]['ValidationError'](_0xde88('0x74'));}var _0x43c335={};var _0x331be2={};_0x331be2[_0xde88('0x32')]=_[_0xde88('0x35')](db[_[_0xde88('0x75')](_0x2cffc8[_0xde88('0x34')]['channel'][_0xde88('0x76')]())+_0xde88('0x77')][_0xde88('0x2e')]);_0x331be2[_0xde88('0x34')]=_[_0xde88('0x35')](_0x2cffc8[_0xde88('0x34')]);_0x331be2[_0xde88('0x36')]=_['intersection'](_0x331be2['model'],_0x331be2[_0xde88('0x34')]);_0x43c335[_0xde88('0x37')]=_[_0xde88('0x38')](_0x331be2['model'],qs[_0xde88('0x39')](_0x2cffc8[_0xde88('0x34')][_0xde88('0x39')]));_0x43c335['attributes']=_0x43c335[_0xde88('0x37')]['length']?_0x43c335['attributes']:_0x331be2[_0xde88('0x32')];_0x43c335[_0xde88('0x21')]=qs[_0xde88('0x21')](_0x2cffc8[_0xde88('0x34')][_0xde88('0x21')]);_0x43c335[_0xde88('0x1f')]=qs[_0xde88('0x1f')](_0x2cffc8[_0xde88('0x34')]['offset']);_0x43c335[_0xde88('0x78')]=qs[_0xde88('0x3d')](_0x2cffc8[_0xde88('0x34')][_0xde88('0x3d')]);_0x43c335[_0xde88('0x3e')]=qs[_0xde88('0x36')](_[_0xde88('0x3f')](_0x2cffc8[_0xde88('0x34')],_0x331be2[_0xde88('0x36')]));_0x43c335=_[_0xde88('0x41')]({},_0x43c335,_0x2cffc8['options']);return _0x3d840e[_0xde88('0x4e')+_[_0xde88('0x75')](_0x2cffc8[_0xde88('0x34')][_0xde88('0x72')][_0xde88('0x76')]())+_0xde88('0x79')](_0x43c335);})[_0xde88('0x28')](respondWithResult(_0x50d364,null))[_0xde88('0x47')](handleError(_0x50d364,null));};exports[_0xde88('0x7a')]=function(_0x419730,_0x174fd7,_0x31a07f){return db[_0xde88('0x2d')][_0xde88('0x71')]({'where':{'id':_0x419730[_0xde88('0x49')]['id']}})[_0xde88('0x28')](function(_0x163563){if(_0x163563){if(!_0x419730[_0xde88('0x4c')][_0xde88('0x72')]||!utils[_0xde88('0x73')](_0x419730[_0xde88('0x4c')]['channel'])){throw new db['Sequelize'][(_0xde88('0x7b'))](_0xde88('0x74'));}return _0x163563['add'+_[_0xde88('0x75')](_0x419730[_0xde88('0x4c')][_0xde88('0x72')][_0xde88('0x76')]())+_0xde88('0x79')](_0x419730[_0xde88('0x4c')][_0xde88('0x7c')]);}return null;})[_0xde88('0x28')](handleEntityNotFound(_0x174fd7,null))[_0xde88('0x28')](respondWithStatusCode(_0x174fd7,null))[_0xde88('0x47')](handleError(_0x174fd7,null));};exports[_0xde88('0x7d')]=function(_0xe17374,_0x544480,_0x175ebb){return db['Team'][_0xde88('0x71')]({'where':{'id':_0xe17374[_0xde88('0x49')]['id']}})[_0xde88('0x28')](function(_0x4c336b){if(_0x4c336b){if(!_0xe17374[_0xde88('0x34')]['channel']||!utils['isValidChannel'](_0xe17374['query'][_0xde88('0x72')])){throw new db[(_0xde88('0x5f'))][(_0xde88('0x7b'))](_0xde88('0x74'));}return _0x4c336b[_0xde88('0x7e')+_[_0xde88('0x75')](_0xe17374[_0xde88('0x34')][_0xde88('0x72')][_0xde88('0x76')]())+_0xde88('0x79')](_0xe17374['query'][_0xde88('0x7c')]);}return null;})[_0xde88('0x28')](handleEntityNotFound(_0x544480,null))['then'](respondWithStatusCode(_0x544480,null))[_0xde88('0x47')](handleError(_0x544480,null));};exports[_0xde88('0x7f')]=function(_0xecc9af,_0x576d10){var _0x116eb4=_[_0xde88('0x80')](_0xecc9af['body']['ids'])?_0xecc9af[_0xde88('0x4c')][_0xde88('0x7c')]:[_0xecc9af['body']['ids']];var _0x18ed61=_0xecc9af['params']['id'];return db[_0xde88('0x2d')]['find']({'where':{'id':_0x18ed61}})[_0xde88('0x28')](handleEntityNotFound(_0x576d10,null))[_0xde88('0x28')](function(_0x27bf05){if(_0x27bf05){var _0x3a0ba8=[_0xde88('0x81'),'Chat',_0xde88('0x82'),_0xde88('0x83'),'Fax',_0xde88('0x84'),_0xde88('0x85')];return db[_0xde88('0x57')]['transaction'](function(_0x5c8072){var _0x237142=_['map'](_0x3a0ba8,function(_0x384338){var _0x18f75e={'attributes':['id','name']};if(_0x384338===_0xde88('0x81')){_0x18f75e[_0xde88('0x86')]={'attributes':[_0xde88('0x87')]};}return _0x27bf05['get'+_0x384338+'Queues'](_0x18f75e)['then'](function(_0x1f6d0d){var _0x5584df=_[_0xde88('0x33')](_0x1f6d0d,function(_0x19c0b0){var _0x39fa97=_[_0xde88('0x33')](_0x116eb4,function(_0x5678ee){var _0x17c227={'where':{'UserId':_0x5678ee,[_0x384338+_0xde88('0x88')]:_0x19c0b0['id']},'transaction':_0x5c8072};if(_0x384338===_0xde88('0x81')){_0x17c227[_0xde88('0x18')]={'penalty':_0x19c0b0[_0xde88('0x89')][_0xde88('0x87')]};}return db[_0xde88('0x8a')+_0x384338+'Queue'][_0xde88('0x8b')](_0x17c227)[_0xde88('0x28')](function(){socket[_0xde88('0x8c')]('user'+_0x384338+_0xde88('0x8d'),{'UserId':_0x5678ee,[_0x384338+'QueueId']:_0x19c0b0['id']});if(_0x384338!=='Voice'){return;}return db[_0xde88('0x8a')][_0xde88('0x45')]({'where':{'id':_0x116eb4,'online':0x1},'attributes':['id',_0xde88('0x2b'),_0xde88('0x8e'),_0xde88('0x8f'),_0xde88('0x90')],'raw':!![]})[_0xde88('0x28')](function(_0x45cca4){var _0x1fdb9c=_[_0xde88('0x33')](_0x45cca4,function(_0x132ec4){return db[_0xde88('0x91')][_0xde88('0x92')]({'membername':_0x132ec4[_0xde88('0x2b')],'UserId':_0x132ec4['id'],'queue_name':_0x19c0b0[_0xde88('0x2b')],'VoiceQueueId':_0x19c0b0['id'],'interface':_[_0xde88('0x93')](_0x132ec4['interface'])?util[_0xde88('0x94')](_0xde88('0x95'),_0x132ec4['name']):_0x132ec4[_0xde88('0x90')],'paused':_0x132ec4[_0xde88('0x8f')]||![],'penalty':_0x19c0b0[_0xde88('0x89')][_0xde88('0x87')]},{'transaction':_0x5c8072});});return Promise[_0xde88('0x96')](_0x1fdb9c);});});});return Promise['all'](_0x39fa97);});return Promise[_0xde88('0x96')](_0x5584df);})[_0xde88('0x28')](function(){return db[_0xde88('0x6f')][_0xde88('0x71')]({'where':{'teamId':_0x18ed61}})[_0xde88('0x28')](function(_0x9db9ce){if(_0x9db9ce){var _0x2fafd1=_[_0xde88('0x33')](_0x116eb4,function(_0x34b202){db['UserVoicePrefix'][_0xde88('0x92')]({'UserId':_0x34b202,'VoicePrefixId':_0x9db9ce['VoicePrefixId']});});return Promise[_0xde88('0x96')](_0x2fafd1);}});});});return Promise[_0xde88('0x96')](_0x237142)[_0xde88('0x28')](function(){return _0x27bf05[_0xde88('0x7f')](_0x116eb4,{'transaction':_0x5c8072})['spread'](function(_0x45fe40){return _0x45fe40;});});});}})['then'](respondWithResult(_0x576d10,null))[_0xde88('0x47')](handleError(_0x576d10,null));};exports[_0xde88('0x97')]=function(_0x6b97d5,_0x3c7f3a){var _0x40ca46=_[_0xde88('0x80')](_0x6b97d5['query'][_0xde88('0x7c')])?_0x6b97d5[_0xde88('0x34')][_0xde88('0x7c')]:[_0x6b97d5['query'][_0xde88('0x7c')]];var _0x41e80f=_0x6b97d5[_0xde88('0x49')]['id'];return db[_0xde88('0x2d')][_0xde88('0x4a')]({'where':{'id':_0x41e80f}})['then'](handleEntityNotFound(_0x3c7f3a,null))[_0xde88('0x28')](function(_0x3e2ab9){if(_0x3e2ab9){var _0x12e8e0=[_0xde88('0x81'),'Chat',_0xde88('0x82'),'Sms',_0xde88('0x98'),_0xde88('0x84'),_0xde88('0x85')];return db[_0xde88('0x57')][_0xde88('0x99')](function(_0x26d686){var _0x34d521=_[_0xde88('0x33')](_0x12e8e0,function(_0x3213d1){var _0x1f7e98={'attributes':['id',_0xde88('0x2b')]};return _0x3e2ab9[_0xde88('0x4e')+_0x3213d1+_0xde88('0x79')](_0x1f7e98)[_0xde88('0x28')](function(_0x5051e4){var _0x4b730d=_[_0xde88('0x33')](_0x5051e4,function(_0x500a9c){return _0x500a9c[_0xde88('0x97')](_0x40ca46,{'transaction':_0x26d686})[_0xde88('0x28')](function(){var _0x1a864a=_[_0xde88('0x33')](_0x40ca46,function(_0x4571c6){socket[_0xde88('0x8c')](_0xde88('0x4d')+_0x3213d1+_0xde88('0x9a'),{'UserId':Number(_0x4571c6),[_0x3213d1+_0xde88('0x88')]:_0x500a9c['id']});if(_0x3213d1!==_0xde88('0x81')){return;}return db[_0xde88('0x91')][_0xde88('0x56')]({'where':{'VoiceQueueId':_0x500a9c['id'],'UserId':_0x4571c6},'transaction':_0x26d686});});return Promise[_0xde88('0x96')](_0x1a864a);});});return Promise['all'](_0x4b730d);});});return Promise[_0xde88('0x96')](_0x34d521)[_0xde88('0x28')](function(){return _0x3e2ab9[_0xde88('0x97')](_0x40ca46,{'transaction':_0x26d686});})[_0xde88('0x28')](function(){return db[_0xde88('0x6f')][_0xde88('0x71')]({'where':{'teamId':_0x41e80f}})[_0xde88('0x28')](function(_0x259314){if(_0x259314){var _0x456210=_['map'](_0x40ca46,function(_0x59fe6b){db[_0xde88('0x9b')][_0xde88('0x56')]({'where':{'UserId':_0x59fe6b,'VoicePrefixId':_0x259314[_0xde88('0x70')]}});});return Promise[_0xde88('0x96')](_0x456210);}});});});}})[_0xde88('0x28')](respondWithStatusCode(_0x3c7f3a,null))['catch'](handleError(_0x3c7f3a,null));};exports[_0xde88('0x9c')]=function(_0xdd18fd,_0x4c7cca,_0x5193aa){var _0x3bf456={};var _0x303b0c={};var _0x15b6dc;var _0x113e5d;return db[_0xde88('0x2d')]['findOne']({'where':{'id':_0xdd18fd[_0xde88('0x49')]['id']}})[_0xde88('0x28')](handleEntityNotFound(_0x4c7cca,null))[_0xde88('0x28')](function(_0x16ce83){if(_0x16ce83){_0x15b6dc=_0x16ce83;_0x303b0c[_0xde88('0x32')]=_[_0xde88('0x35')](db[_0xde88('0x8a')][_0xde88('0x2e')]);_0x303b0c[_0xde88('0x34')]=_[_0xde88('0x35')](_0xdd18fd[_0xde88('0x34')]);_0x303b0c[_0xde88('0x36')]=_['intersection'](_0x303b0c[_0xde88('0x32')],_0x303b0c['query']);_0x3bf456[_0xde88('0x37')]=_[_0xde88('0x38')](_0x303b0c[_0xde88('0x32')],qs[_0xde88('0x39')](_0xdd18fd['query'][_0xde88('0x39')]));_0x3bf456['attributes']=_0x3bf456['attributes'][_0xde88('0x3a')]?_0x3bf456[_0xde88('0x37')]:_0x303b0c[_0xde88('0x32')];_0x3bf456['order']=qs[_0xde88('0x3d')](_0xdd18fd[_0xde88('0x34')][_0xde88('0x3d')]);_0x3bf456['where']=qs['filters'](_[_0xde88('0x3f')](_0xdd18fd[_0xde88('0x34')],_0x303b0c['filters']));if(_0xdd18fd[_0xde88('0x34')]['filter']){_0x3bf456[_0xde88('0x3e')]=_[_0xde88('0x41')](_0x3bf456['where'],{'$or':_['map'](_0x3bf456[_0xde88('0x37')],function(_0x5d9833){var _0x45b899={};_0x45b899[_0x5d9833]={'$like':'%'+_0xdd18fd[_0xde88('0x34')][_0xde88('0x40')]+'%'};return _0x45b899;})});}_0x3bf456=_[_0xde88('0x41')]({},_0x3bf456,_0xdd18fd[_0xde88('0x9d')]);return _0x15b6dc[_0xde88('0x9c')](_0x3bf456);}})[_0xde88('0x28')](function(_0x4fad0a){if(_0x4fad0a){_0x113e5d=_0x4fad0a[_0xde88('0x3a')];if(!_0xdd18fd[_0xde88('0x34')][_0xde88('0x3b')](_0xde88('0x3c'))){_0x3bf456[_0xde88('0x21')]=qs[_0xde88('0x21')](_0xdd18fd[_0xde88('0x34')][_0xde88('0x21')]);_0x3bf456[_0xde88('0x1f')]=qs['offset'](_0xdd18fd[_0xde88('0x34')][_0xde88('0x1f')]);}return _0x15b6dc[_0xde88('0x9c')](_0x3bf456);}})[_0xde88('0x28')](function(_0x3b3f1d){if(_0x3b3f1d){return _0x3b3f1d?{'count':_0x113e5d,'rows':_0x3b3f1d}:null;}})[_0xde88('0x28')](respondWithResult(_0x4c7cca,null))[_0xde88('0x47')](handleError(_0x4c7cca,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 89e658a..887196a 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 _0x70e4=['hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x554d9b,_0x2ff157){var _0x24c6dd=function(_0x5f1070){while(--_0x5f1070){_0x554d9b['push'](_0x554d9b['shift']());}};_0x24c6dd(++_0x2ff157);}(_0x70e4,0x9b));var _0x470e=function(_0x52b7b9,_0x43ed4b){_0x52b7b9=_0x52b7b9-0x0;var _0x5b5d30=_0x70e4[_0x52b7b9];return _0x5b5d30;};'use strict';var EventEmitter=require(_0x470e('0x0'));var Team=require(_0x470e('0x1'))['db'][_0x470e('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x470e('0x3')](0x0);var events={'afterCreate':_0x470e('0x4'),'afterUpdate':_0x470e('0x5'),'afterDestroy':_0x470e('0x6')};function emitEvent(_0xdec83f){return function(_0x5da8d8,_0x450c46,_0x1646a0){TeamEvents['emit'](_0xdec83f+':'+_0x5da8d8['id'],_0x5da8d8);TeamEvents['emit'](_0xdec83f,_0x5da8d8);_0x1646a0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x470e('0x7')](e,emitEvent(event));}}module[_0x470e('0x8')]=TeamEvents; \ No newline at end of file +var _0x2542=['update','remove','emit','hasOwnProperty','hook','../../mysqldb','Team','setMaxListeners','save'];(function(_0x4d15d1,_0x249659){var _0x2d1133=function(_0x31ac11){while(--_0x31ac11){_0x4d15d1['push'](_0x4d15d1['shift']());}};_0x2d1133(++_0x249659);}(_0x2542,0x11c));var _0x2254=function(_0x4dc578,_0x2441bc){_0x4dc578=_0x4dc578-0x0;var _0x1caca5=_0x2542[_0x4dc578];return _0x1caca5;};'use strict';var EventEmitter=require('events');var Team=require(_0x2254('0x0'))['db'][_0x2254('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2254('0x2')](0x0);var events={'afterCreate':_0x2254('0x3'),'afterUpdate':_0x2254('0x4'),'afterDestroy':_0x2254('0x5')};function emitEvent(_0x5d5334){return function(_0x4da533,_0x47cb9a,_0x724571){TeamEvents[_0x2254('0x6')](_0x5d5334+':'+_0x4da533['id'],_0x4da533);TeamEvents['emit'](_0x5d5334,_0x4da533);_0x724571(null);};}for(var e in events){if(events[_0x2254('0x7')](e)){var event=events[e];Team[_0x2254('0x8')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index aaa0b5a..902573f 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 _0xbbed=['teams','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports'];(function(_0x51edca,_0x18ad70){var _0x2b77ec=function(_0x55a549){while(--_0x55a549){_0x51edca['push'](_0x51edca['shift']());}};_0x2b77ec(++_0x18ad70);}(_0xbbed,0x169));var _0xdbbe=function(_0x306763,_0x2ea5a8){_0x306763=_0x306763-0x0;var _0x4723f1=_0xbbed[_0x306763];return _0x4723f1;};'use strict';var _=require(_0xdbbe('0x0'));var util=require(_0xdbbe('0x1'));var logger=require(_0xdbbe('0x2'))('api');var moment=require(_0xdbbe('0x3'));var BPromise=require(_0xdbbe('0x4'));var rp=require(_0xdbbe('0x5'));var fs=require('fs');var path=require(_0xdbbe('0x6'));var rimraf=require(_0xdbbe('0x7'));var config=require(_0xdbbe('0x8'));var attributes=require(_0xdbbe('0x9'));module[_0xdbbe('0xa')]=function(_0x2a83ef,_0x1293ac){return _0x2a83ef['define']('Team',attributes,{'tableName':_0xdbbe('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x88d3=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','Team','teams'];(function(_0x77515e,_0x1c0bde){var _0x39e05e=function(_0x54648f){while(--_0x54648f){_0x77515e['push'](_0x77515e['shift']());}};_0x39e05e(++_0x1c0bde);}(_0x88d3,0xf0));var _0x388d=function(_0x5526a1,_0x346cd1){_0x5526a1=_0x5526a1-0x0;var _0x52243c=_0x88d3[_0x5526a1];return _0x52243c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x388d('0x0'))(_0x388d('0x1'));var moment=require(_0x388d('0x2'));var BPromise=require(_0x388d('0x3'));var rp=require(_0x388d('0x4'));var fs=require('fs');var path=require(_0x388d('0x5'));var rimraf=require(_0x388d('0x6'));var config=require(_0x388d('0x7'));var attributes=require(_0x388d('0x8'));module[_0x388d('0x9')]=function(_0x11c9a7,_0x3b658b){return _0x11c9a7['define'](_0x388d('0xa'),attributes,{'tableName':_0x388d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a524e28..68ee0f7 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 _0x23ae=['http','defaults','redis','localhost','socket.io-emitter','./team.socket','register','request','then','Team,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','lodash','moment','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client'];(function(_0x2ac71a,_0x1d2a02){var _0x3ee904=function(_0x5c902a){while(--_0x5c902a){_0x2ac71a['push'](_0x2ac71a['shift']());}};_0x3ee904(++_0x1d2a02);}(_0x23ae,0x13d));var _0xe23a=function(_0x2f31f7,_0x3a0fc4){_0x2f31f7=_0x2f31f7-0x0;var _0x4023b0=_0x23ae[_0x2f31f7];return _0x4023b0;};'use strict';var _=require(_0xe23a('0x0'));var util=require('util');var moment=require(_0xe23a('0x1'));var BPromise=require('bluebird');var rs=require(_0xe23a('0x2'));var fs=require('fs');var Redis=require(_0xe23a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe23a('0x4'));var logger=require('../../config/logger')(_0xe23a('0x5'));var config=require(_0xe23a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xe23a('0x7')][_0xe23a('0x8')]({'port':0x232a});config['redis']=_[_0xe23a('0x9')](config[_0xe23a('0xa')],{'host':_0xe23a('0xb'),'port':0x18eb});var socket=require(_0xe23a('0xc'))(new Redis(config[_0xe23a('0xa')]));require(_0xe23a('0xd'))[_0xe23a('0xe')](socket);function respondWithRpcPromise(_0x4b1dbc,_0x27c9e5,_0x48bf43){return new BPromise(function(_0x39e6e2,_0x40d381){return client[_0xe23a('0xf')](_0x4b1dbc,_0x48bf43)[_0xe23a('0x10')](function(_0x60319a){logger['info'](_0xe23a('0x11'),_0x27c9e5,_0xe23a('0x12'));logger[_0xe23a('0x13')]('Team,\x20%s,\x20%s,\x20%s',_0x27c9e5,_0xe23a('0x12'),JSON[_0xe23a('0x14')](_0x60319a));if(_0x60319a[_0xe23a('0x15')]){if(_0x60319a[_0xe23a('0x15')][_0xe23a('0x16')]===0x1f4){logger[_0xe23a('0x15')](_0xe23a('0x11'),_0x27c9e5,_0x60319a[_0xe23a('0x15')][_0xe23a('0x17')]);return _0x40d381(_0x60319a[_0xe23a('0x15')][_0xe23a('0x17')]);}logger[_0xe23a('0x15')]('Team,\x20%s,\x20%s',_0x27c9e5,_0x60319a[_0xe23a('0x15')]['message']);return _0x39e6e2(_0x60319a[_0xe23a('0x15')][_0xe23a('0x17')]);}else{logger[_0xe23a('0x18')](_0xe23a('0x11'),_0x27c9e5,_0xe23a('0x12'));_0x39e6e2(_0x60319a['result'][_0xe23a('0x17')]);}})['catch'](function(_0x41c904){logger['error'](_0xe23a('0x11'),_0x27c9e5,_0x41c904);_0x40d381(_0x41c904);});});} \ No newline at end of file +var _0xdf66=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','socket.io-emitter','./team.socket','then','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x304c83,_0x109fa8){var _0x1aff92=function(_0x22c8c4){while(--_0x22c8c4){_0x304c83['push'](_0x304c83['shift']());}};_0x1aff92(++_0x109fa8);}(_0xdf66,0x178));var _0x6df6=function(_0x24dfd2,_0x504fac){_0x24dfd2=_0x24dfd2-0x0;var _0x3abda1=_0xdf66[_0x24dfd2];return _0x3abda1;};'use strict';var _=require(_0x6df6('0x0'));var util=require(_0x6df6('0x1'));var moment=require(_0x6df6('0x2'));var BPromise=require(_0x6df6('0x3'));var rs=require(_0x6df6('0x4'));var fs=require('fs');var Redis=require(_0x6df6('0x5'));var db=require(_0x6df6('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6df6('0x7'))(_0x6df6('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6df6('0x9')][_0x6df6('0xa')]({'port':0x232a});config['redis']=_[_0x6df6('0xb')](config[_0x6df6('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x6df6('0xd'))(new Redis(config[_0x6df6('0xc')]));require(_0x6df6('0xe'))['register'](socket);function respondWithRpcPromise(_0x5abfdc,_0x10ba14,_0x8df302){return new BPromise(function(_0x4aaaf5,_0xde03e3){return client['request'](_0x5abfdc,_0x8df302)[_0x6df6('0xf')](function(_0x5094b0){logger[_0x6df6('0x10')](_0x6df6('0x11'),_0x10ba14,_0x6df6('0x12'));logger[_0x6df6('0x13')](_0x6df6('0x14'),_0x10ba14,_0x6df6('0x12'),JSON[_0x6df6('0x15')](_0x5094b0));if(_0x5094b0[_0x6df6('0x16')]){if(_0x5094b0[_0x6df6('0x16')][_0x6df6('0x17')]===0x1f4){logger[_0x6df6('0x16')](_0x6df6('0x11'),_0x10ba14,_0x5094b0['error']['message']);return _0xde03e3(_0x5094b0[_0x6df6('0x16')][_0x6df6('0x18')]);}logger[_0x6df6('0x16')](_0x6df6('0x11'),_0x10ba14,_0x5094b0[_0x6df6('0x16')][_0x6df6('0x18')]);return _0x4aaaf5(_0x5094b0[_0x6df6('0x16')][_0x6df6('0x18')]);}else{logger[_0x6df6('0x10')](_0x6df6('0x11'),_0x10ba14,_0x6df6('0x12'));_0x4aaaf5(_0x5094b0[_0x6df6('0x19')][_0x6df6('0x18')]);}})[_0x6df6('0x1a')](function(_0x58d13a){logger['error'](_0x6df6('0x11'),_0x10ba14,_0x58d13a);_0xde03e3(_0x58d13a);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 687a224..e6eae7a 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 _0xeea2=['./team.events','emit','removeListener','register','length','team:'];(function(_0x983c5f,_0x189ee2){var _0x59fe74=function(_0x1eebc1){while(--_0x1eebc1){_0x983c5f['push'](_0x983c5f['shift']());}};_0x59fe74(++_0x189ee2);}(_0xeea2,0x192));var _0x2eea=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xeea2[_0x556927];return _0x5f1235;};'use strict';var TeamEvents=require(_0x2eea('0x0'));var events=['save','remove','update'];function createListener(_0x32cb09,_0x10d7a7){return function(_0x33ec50){_0x10d7a7[_0x2eea('0x1')](_0x32cb09,_0x33ec50);};}function removeListener(_0x1180d5,_0x142cbf){return function(){TeamEvents[_0x2eea('0x2')](_0x1180d5,_0x142cbf);};}exports[_0x2eea('0x3')]=function(_0xa9626f){for(var _0x283447=0x0,_0x22085e=events[_0x2eea('0x4')];_0x283447<_0x22085e;_0x283447++){var _0x4ca727=events[_0x283447];var _0xe90267=createListener(_0x2eea('0x5')+_0x4ca727,_0xa9626f);TeamEvents['on'](_0x4ca727,_0xe90267);}}; \ No newline at end of file +var _0x4f01=['update','emit','register','length','team:','save','remove'];(function(_0x2c4bb3,_0x433e85){var _0x11b8d2=function(_0x2daac5){while(--_0x2daac5){_0x2c4bb3['push'](_0x2c4bb3['shift']());}};_0x11b8d2(++_0x433e85);}(_0x4f01,0xe5));var _0x14f0=function(_0xafc866,_0x17a0e9){_0xafc866=_0xafc866-0x0;var _0x395939=_0x4f01[_0xafc866];return _0x395939;};'use strict';var TeamEvents=require('./team.events');var events=[_0x14f0('0x0'),_0x14f0('0x1'),_0x14f0('0x2')];function createListener(_0x1c0cdb,_0x3ba042){return function(_0x2727f6){_0x3ba042[_0x14f0('0x3')](_0x1c0cdb,_0x2727f6);};}function removeListener(_0x2c2070,_0x17d681){return function(){TeamEvents['removeListener'](_0x2c2070,_0x17d681);};}exports[_0x14f0('0x4')]=function(_0x36bc10){for(var _0x5c4969=0x0,_0xcf2512=events[_0x14f0('0x5')];_0x5c4969<_0xcf2512;_0x5c4969++){var _0xb1e01a=events[_0x5c4969];var _0xf71652=createListener(_0x14f0('0x6')+_0xb1e01a,_0x36bc10);TeamEvents['on'](_0xb1e01a,_0xf71652);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index e51c8ee..f1e7e99 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 _0xae75=['INTEGER','sequelize','exports'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xae75,0x1a8));var _0x5ae7=function(_0x1d1c1b,_0x260761){_0x1d1c1b=_0x1d1c1b-0x0;var _0x197857=_0xae75[_0x1d1c1b];return _0x197857;};'use strict';var Sequelize=require(_0x5ae7('0x0'));module[_0x5ae7('0x1')]={'TeamId':{'type':Sequelize[_0x5ae7('0x2')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x450a=['sequelize','exports'];(function(_0x1884bd,_0x239c85){var _0x4d0d27=function(_0x369b84){while(--_0x369b84){_0x1884bd['push'](_0x1884bd['shift']());}};_0x4d0d27(++_0x239c85);}(_0x450a,0x11c));var _0xa450=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x450a[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0xa450('0x0'));module[_0xa450('0x1')]={'TeamId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 8cc2eee..a7eef30 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 _0x49db=['util','../../config/logger','api','moment','request-promise','path','rimraf','./teamVoicePrefix.attributes','define','TeamVoicePrefix','lodash'];(function(_0x4a618b,_0x11d42e){var _0x1a006d=function(_0x18c914){while(--_0x18c914){_0x4a618b['push'](_0x4a618b['shift']());}};_0x1a006d(++_0x11d42e);}(_0x49db,0xc5));var _0xb49d=function(_0x10d644,_0x54b120){_0x10d644=_0x10d644-0x0;var _0x4d9626=_0x49db[_0x10d644];return _0x4d9626;};'use strict';var _=require(_0xb49d('0x0'));var util=require(_0xb49d('0x1'));var logger=require(_0xb49d('0x2'))(_0xb49d('0x3'));var moment=require(_0xb49d('0x4'));var BPromise=require('bluebird');var rp=require(_0xb49d('0x5'));var fs=require('fs');var path=require(_0xb49d('0x6'));var rimraf=require(_0xb49d('0x7'));var config=require('../../config/environment');var attributes=require(_0xb49d('0x8'));module['exports']=function(_0x4c6887,_0x144a9a){return _0x4c6887[_0xb49d('0x9')](_0xb49d('0xa'),attributes,{'tableName':'team_has_voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf53d=['util','api','moment','bluebird','path','../../config/environment','define','TeamVoicePrefix','team_has_voice_prefixes','lodash'];(function(_0x212bf5,_0x165cbd){var _0xfcad21=function(_0x4a4e6e){while(--_0x4a4e6e){_0x212bf5['push'](_0x212bf5['shift']());}};_0xfcad21(++_0x165cbd);}(_0xf53d,0x199));var _0xdf53=function(_0x547151,_0x57a948){_0x547151=_0x547151-0x0;var _0x960534=_0xf53d[_0x547151];return _0x960534;};'use strict';var _=require(_0xdf53('0x0'));var util=require(_0xdf53('0x1'));var logger=require('../../config/logger')(_0xdf53('0x2'));var moment=require(_0xdf53('0x3'));var BPromise=require(_0xdf53('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf53('0x5'));var rimraf=require('rimraf');var config=require(_0xdf53('0x6'));var attributes=require('./teamVoicePrefix.attributes');module['exports']=function(_0xa9fb11,_0x4cf8d5){return _0xa9fb11[_0xdf53('0x7')](_0xdf53('0x8'),attributes,{'tableName':_0xdf53('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index b9e0068..7efbb49 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x50ffbb,_0x21a925){var _0x576a1c=function(_0x8e27e6){while(--_0x8e27e6){_0x50ffbb['push'](_0x50ffbb['shift']());}};_0x576a1c(++_0x21a925);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x29206f,_0x390f1b){var _0x1de118=function(_0x2de279){while(--_0x2de279){_0x29206f['push'](_0x29206f['shift']());}};_0x1de118(++_0x390f1b);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index 13f6d8f..60d87e2 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 _0x2eac=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2eac,0x1aa));var _0xc2ea=function(_0x4fb27f,_0x56ce0e){_0x4fb27f=_0x4fb27f-0x0;var _0x171457=_0x2eac[_0x4fb27f];return _0x171457;};'use strict';var Sequelize=require(_0xc2ea('0x0'));module[_0xc2ea('0x1')]={'penalty':{'type':Sequelize[_0xc2ea('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5395=['sequelize','INTEGER'];(function(_0x810025,_0x34bb04){var _0x4dbc81=function(_0x2c3907){while(--_0x2c3907){_0x810025['push'](_0x810025['shift']());}};_0x4dbc81(++_0x34bb04);}(_0x5395,0x150));var _0x5539=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5395[_0xfae23b];return _0x200640;};'use strict';var Sequelize=require(_0x5539('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x5539('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 1415a93..2adb318 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 _0x8cfd=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./teamVoiceQueue.attributes','exports','team_has_voice_queues'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8cfd,0xe4));var _0xd8cf=function(_0x20a68a,_0x54502e){_0x20a68a=_0x20a68a-0x0;var _0x56c5d4=_0x8cfd[_0x20a68a];return _0x56c5d4;};'use strict';var _=require(_0xd8cf('0x0'));var util=require(_0xd8cf('0x1'));var logger=require(_0xd8cf('0x2'))(_0xd8cf('0x3'));var moment=require(_0xd8cf('0x4'));var BPromise=require(_0xd8cf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd8cf('0x6'));var rimraf=require(_0xd8cf('0x7'));var config=require(_0xd8cf('0x8'));var attributes=require(_0xd8cf('0x9'));module[_0xd8cf('0xa')]=function(_0x318a72,_0x305768){return _0x318a72['define']('TeamVoiceQueue',attributes,{'tableName':_0xd8cf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe57e=['lodash','../../config/logger','api','moment','path','../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe57e,0xf2));var _0xee57=function(_0x1728b1,_0x108a7d){_0x1728b1=_0x1728b1-0x0;var _0x668970=_0xe57e[_0x1728b1];return _0x668970;};'use strict';var _=require(_0xee57('0x0'));var util=require('util');var logger=require(_0xee57('0x1'))(_0xee57('0x2'));var moment=require(_0xee57('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xee57('0x4'));var rimraf=require('rimraf');var config=require(_0xee57('0x5'));var attributes=require(_0xee57('0x6'));module[_0xee57('0x7')]=function(_0x4e21c4,_0x491334){return _0x4e21c4[_0xee57('0x8')](_0xee57('0x9'),attributes,{'tableName':_0xee57('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js b/server/api/teamVoiceQueue/teamVoiceQueue.rpc.js index 8a529e8..5dc7a7a 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 _0xc041=['request','info','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x154a6d,_0x23c132){var _0x288660=function(_0x456659){while(--_0x456659){_0x154a6d['push'](_0x154a6d['shift']());}};_0x288660(++_0x23c132);}(_0xc041,0x1ea));var _0x1c04=function(_0x27095e,_0x108608){_0x27095e=_0x27095e-0x0;var _0x186df1=_0xc041[_0x27095e];return _0x186df1;};'use strict';var _=require(_0x1c04('0x0'));var util=require(_0x1c04('0x1'));var moment=require('moment');var BPromise=require(_0x1c04('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c04('0x3'));var db=require(_0x1c04('0x4'))['db'];var utils=require(_0x1c04('0x5'));var logger=require(_0x1c04('0x6'))(_0x1c04('0x7'));var config=require(_0x1c04('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1c04('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x524f85,_0x9507a,_0x3613fe){return new BPromise(function(_0x41a0d3,_0x1c2e7e){return client[_0x1c04('0xa')](_0x524f85,_0x3613fe)['then'](function(_0x536a46){logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));logger[_0x1c04('0xe')](_0x1c04('0xf'),_0x9507a,_0x1c04('0xd'),JSON[_0x1c04('0x10')](_0x536a46));if(_0x536a46[_0x1c04('0x11')]){if(_0x536a46['error'][_0x1c04('0x12')]===0x1f4){logger['error'](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')]['message']);return _0x1c2e7e(_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);}logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x536a46[_0x1c04('0x11')][_0x1c04('0x13')]);return _0x41a0d3(_0x536a46[_0x1c04('0x11')]['message']);}else{logger[_0x1c04('0xb')](_0x1c04('0xc'),_0x9507a,_0x1c04('0xd'));_0x41a0d3(_0x536a46['result'][_0x1c04('0x13')]);}})['catch'](function(_0x26cbfa){logger[_0x1c04('0x11')](_0x1c04('0xc'),_0x9507a,_0x26cbfa);_0x1c2e7e(_0x26cbfa);});});} \ No newline at end of file +var _0xff91=['TeamVoiceQueue,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then','info','request\x20sent','debug','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message'];(function(_0x4862a3,_0x421f68){var _0x5a9df4=function(_0x302b86){while(--_0x302b86){_0x4862a3['push'](_0x4862a3['shift']());}};_0x5a9df4(++_0x421f68);}(_0xff91,0x1d1));var _0x1ff9=function(_0x18365c,_0x355873){_0x18365c=_0x18365c-0x0;var _0x2d8c0e=_0xff91[_0x18365c];return _0x2d8c0e;};'use strict';var _=require('lodash');var util=require(_0x1ff9('0x0'));var moment=require(_0x1ff9('0x1'));var BPromise=require(_0x1ff9('0x2'));var rs=require(_0x1ff9('0x3'));var fs=require('fs');var Redis=require(_0x1ff9('0x4'));var db=require(_0x1ff9('0x5'))['db'];var utils=require(_0x1ff9('0x6'));var logger=require(_0x1ff9('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ff9('0x8')][_0x1ff9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x264914,_0x5324b1,_0x42443a){return new BPromise(function(_0x197cd0,_0x23e68b){return client[_0x1ff9('0xa')](_0x264914,_0x42443a)[_0x1ff9('0xb')](function(_0x1021e2){logger[_0x1ff9('0xc')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5324b1,_0x1ff9('0xd'));logger[_0x1ff9('0xe')](_0x1ff9('0xf'),_0x5324b1,_0x1ff9('0xd'),JSON['stringify'](_0x1021e2));if(_0x1021e2[_0x1ff9('0x10')]){if(_0x1021e2['error'][_0x1ff9('0x11')]===0x1f4){logger[_0x1ff9('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5324b1,_0x1021e2[_0x1ff9('0x10')]['message']);return _0x23e68b(_0x1021e2[_0x1ff9('0x10')][_0x1ff9('0x12')]);}logger[_0x1ff9('0x10')](_0x1ff9('0x13'),_0x5324b1,_0x1021e2[_0x1ff9('0x10')][_0x1ff9('0x12')]);return _0x197cd0(_0x1021e2[_0x1ff9('0x10')][_0x1ff9('0x12')]);}else{logger[_0x1ff9('0xc')](_0x1ff9('0x13'),_0x5324b1,_0x1ff9('0xd'));_0x197cd0(_0x1021e2[_0x1ff9('0x14')][_0x1ff9('0x12')]);}})[_0x1ff9('0x15')](function(_0x2c959e){logger[_0x1ff9('0x10')]('TeamVoiceQueue,\x20%s,\x20%s',_0x5324b1,_0x2c959e);_0x23e68b(_0x2c959e);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 91675c2..015c552 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 _0xf65d=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','get','index','isAuthenticated','show','post','create','put','delete','/:id','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf65d,0x9f));var _0xdf65=function(_0x5d4aff,_0x4d58e9){_0x5d4aff=_0x5d4aff-0x0;var _0x28ef30=_0xf65d[_0x5d4aff];return _0x28ef30;};'use strict';var multer=require(_0xdf65('0x0'));var util=require('util');var path=require(_0xdf65('0x1'));var timeout=require(_0xdf65('0x2'));var express=require(_0xdf65('0x3'));var router=express[_0xdf65('0x4')]();var fs_extra=require(_0xdf65('0x5'));var auth=require(_0xdf65('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router[_0xdf65('0x7')]('/',auth['isAuthenticated'](),controller[_0xdf65('0x8')]);router[_0xdf65('0x7')]('/:id',auth[_0xdf65('0x9')](),controller[_0xdf65('0xa')]);router[_0xdf65('0xb')]('/',auth[_0xdf65('0x9')](),controller[_0xdf65('0xc')]);router[_0xdf65('0xd')]('/:id',auth[_0xdf65('0x9')](),controller['update']);router[_0xdf65('0xe')](_0xdf65('0xf'),auth[_0xdf65('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x543b=['path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','multer','util'];(function(_0x3430aa,_0x57cd92){var _0x2ac5c=function(_0x3068dd){while(--_0x3068dd){_0x3430aa['push'](_0x3430aa['shift']());}};_0x2ac5c(++_0x57cd92);}(_0x543b,0x18d));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xb543('0x0'));var util=require(_0xb543('0x1'));var path=require(_0xb543('0x2'));var timeout=require('connect-timeout');var express=require(_0xb543('0x3'));var router=express[_0xb543('0x4')]();var fs_extra=require(_0xb543('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb543('0x6'));var config=require(_0xb543('0x7'));var controller=require(_0xb543('0x8'));router[_0xb543('0x9')]('/',auth[_0xb543('0xa')](),controller[_0xb543('0xb')]);router[_0xb543('0x9')](_0xb543('0xc'),auth[_0xb543('0xa')](),controller[_0xb543('0xd')]);router[_0xb543('0xe')]('/',auth[_0xb543('0xa')](),controller['create']);router[_0xb543('0xf')]('/:id',auth[_0xb543('0xa')](),controller[_0xb543('0x10')]);router[_0xb543('0x11')](_0xb543('0xc'),auth[_0xb543('0xa')](),controller[_0xb543('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 596c1a7..e1c8e74 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 _0xe53c=['exports','STRING','TEXT','sequelize'];(function(_0x5f5057,_0x916bf3){var _0x213460=function(_0x1a9b3a){while(--_0x1a9b3a){_0x5f5057['push'](_0x5f5057['shift']());}};_0x213460(++_0x916bf3);}(_0xe53c,0x77));var _0xce53=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0xe53c[_0x3e618a];return _0x1f3d61;};'use strict';var Sequelize=require(_0xce53('0x0'));module[_0xce53('0x1')]={'name':{'type':Sequelize[_0xce53('0x2')]},'description':{'type':Sequelize[_0xce53('0x2')]},'html':{'type':Sequelize[_0xce53('0x3')]}}; \ No newline at end of file +var _0x481f=['sequelize','exports','TEXT'];(function(_0xdc15b4,_0x3f274f){var _0x4904d5=function(_0x49313a){while(--_0x49313a){_0xdc15b4['push'](_0xdc15b4['shift']());}};_0x4904d5(++_0x3f274f);}(_0x481f,0x1a1));var _0xf481=function(_0x531ad7,_0xc51ceb){_0x531ad7=_0x531ad7-0x0;var _0x55f577=_0x481f[_0x531ad7];return _0x55f577;};'use strict';var Sequelize=require(_0xf481('0x0'));module[_0xf481('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xf481('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 08877ee..5a25705 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 _0xe265=['sendStatus','error','stack','name','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','Template','include','findAll','catch','show','params','keys','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Templates','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','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','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','UserProfileResource'];(function(_0x2e725c,_0x2bf203){var _0x5f0153=function(_0x7f3f9e){while(--_0x7f3f9e){_0x2e725c['push'](_0x2e725c['shift']());}};_0x5f0153(++_0x2bf203);}(_0xe265,0x1ba));var _0x5e26=function(_0x1a0244,_0x1ab5fe){_0x1a0244=_0x1a0244-0x0;var _0x570e86=_0xe265[_0x1a0244];return _0x570e86;};'use strict';var emlformat=require(_0x5e26('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5e26('0x1'));var jsonpatch=require(_0x5e26('0x2'));var rp=require(_0x5e26('0x3'));var moment=require(_0x5e26('0x4'));var BPromise=require(_0x5e26('0x5'));var Mustache=require('mustache');var util=require(_0x5e26('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5e26('0x7'));var ejs=require(_0x5e26('0x8'));var fs=require('fs');var fs_extra=require(_0x5e26('0x9'));var _=require(_0x5e26('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5e26('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5e26('0x7'));var querystring=require(_0x5e26('0xc'));var Papa=require(_0x5e26('0xd'));var Redis=require(_0x5e26('0xe'));var authService=require(_0x5e26('0xf'));var qs=require(_0x5e26('0x10'));var as=require(_0x5e26('0x11'));var hardwareService=require(_0x5e26('0x12'));var logger=require(_0x5e26('0x13'))(_0x5e26('0x14'));var utils=require(_0x5e26('0x15'));var config=require(_0x5e26('0x16'));var licenseUtil=require(_0x5e26('0x17'));var db=require(_0x5e26('0x18'))['db'];function respondWithStatusCode(_0x7416ee,_0x22d6b3){_0x22d6b3=_0x22d6b3||0xcc;return function(_0x5325f3){if(_0x5325f3){return _0x7416ee['sendStatus'](_0x22d6b3);}return _0x7416ee[_0x5e26('0x19')](_0x22d6b3)['end']();};}function respondWithResult(_0x419ec3,_0x58306a){_0x58306a=_0x58306a||0xc8;return function(_0x4c9f78){if(_0x4c9f78){return _0x419ec3['status'](_0x58306a)[_0x5e26('0x1a')](_0x4c9f78);}};}function respondWithFilteredResult(_0x31930c,_0x5f4ed0){return function(_0x341949){if(_0x341949){var _0x550863=typeof _0x5f4ed0[_0x5e26('0x1b')]===_0x5e26('0x1c')&&typeof _0x5f4ed0[_0x5e26('0x1d')]===_0x5e26('0x1c');var _0x46f5b6=_0x341949[_0x5e26('0x1e')];var _0x5ae084=_0x550863?0x0:_0x5f4ed0[_0x5e26('0x1b')];var _0x2d1e88=_0x550863?_0x341949[_0x5e26('0x1e')]:_0x5f4ed0[_0x5e26('0x1b')]+_0x5f4ed0[_0x5e26('0x1d')];var _0x303c01;if(_0x2d1e88>=_0x46f5b6){_0x2d1e88=_0x46f5b6;_0x303c01=0xc8;}else{_0x303c01=0xce;}_0x31930c[_0x5e26('0x19')](_0x303c01);return _0x31930c[_0x5e26('0x1f')](_0x5e26('0x20'),_0x5ae084+'-'+_0x2d1e88+'/'+_0x46f5b6)['json'](_0x341949);}return null;};}function patchUpdates(_0x93e87c){return function(_0x1b7c7b){try{jsonpatch['apply'](_0x1b7c7b,_0x93e87c,!![]);}catch(_0x52bcb6){return BPromise['reject'](_0x52bcb6);}return _0x1b7c7b[_0x5e26('0x21')]();};}function saveUpdates(_0x54ac98,_0x1392d4){return function(_0x3d1e4b){if(_0x3d1e4b){return _0x3d1e4b[_0x5e26('0x22')](_0x54ac98)[_0x5e26('0x23')](function(_0x4bd90d){return _0x4bd90d;});}return null;};}function removeEntity(_0xeade86,_0x55e2af){return function(_0x2c3257){if(_0x2c3257){return _0x2c3257[_0x5e26('0x24')]()[_0x5e26('0x23')](function(){var _0x5bf1f6=_0x2c3257['get']({'plain':!![]});var _0x98337b='Templates';return db[_0x5e26('0x25')][_0x5e26('0x24')]({'where':{'type':_0x98337b,'resourceId':_0x5bf1f6['id']}})[_0x5e26('0x23')](function(){return _0x2c3257;});})[_0x5e26('0x23')](function(){_0xeade86['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd7bf4c,_0xdd1456){return function(_0x40044a){if(!_0x40044a){_0xd7bf4c[_0x5e26('0x26')](0x194);}return _0x40044a;};}function handleError(_0x43dba5,_0x42f2d5){_0x42f2d5=_0x42f2d5||0x1f4;return function(_0x531bf7){logger[_0x5e26('0x27')](_0x531bf7[_0x5e26('0x28')]);if(_0x531bf7[_0x5e26('0x29')]){delete _0x531bf7[_0x5e26('0x29')];}_0x43dba5[_0x5e26('0x19')](_0x42f2d5)['send'](_0x531bf7);};}exports[_0x5e26('0x2a')]=function(_0x284e18,_0x568c47){var _0xc32ca1={},_0x22f980={},_0x566c1a={'count':0x0,'rows':[]};var _0x2214a2=_[_0x5e26('0x2b')](db['Template'][_0x5e26('0x2c')],function(_0x1686a3){return{'name':_0x1686a3['fieldName'],'type':_0x1686a3[_0x5e26('0x2d')][_0x5e26('0x2e')]};});_0x22f980[_0x5e26('0x2f')]=_[_0x5e26('0x2b')](_0x2214a2,_0x5e26('0x29'));_0x22f980[_0x5e26('0x30')]=_['keys'](_0x284e18[_0x5e26('0x30')]);_0x22f980[_0x5e26('0x31')]=_[_0x5e26('0x32')](_0x22f980['model'],_0x22f980[_0x5e26('0x30')]);_0xc32ca1[_0x5e26('0x33')]=_['intersection'](_0x22f980[_0x5e26('0x2f')],qs[_0x5e26('0x34')](_0x284e18[_0x5e26('0x30')][_0x5e26('0x34')]));_0xc32ca1[_0x5e26('0x33')]=_0xc32ca1[_0x5e26('0x33')][_0x5e26('0x35')]?_0xc32ca1['attributes']:_0x22f980[_0x5e26('0x2f')];if(!_0x284e18[_0x5e26('0x30')][_0x5e26('0x36')](_0x5e26('0x37'))){_0xc32ca1['limit']=qs['limit'](_0x284e18[_0x5e26('0x30')]['limit']);_0xc32ca1[_0x5e26('0x1b')]=qs[_0x5e26('0x1b')](_0x284e18[_0x5e26('0x30')]['offset']);}_0xc32ca1[_0x5e26('0x38')]=qs[_0x5e26('0x39')](_0x284e18[_0x5e26('0x30')][_0x5e26('0x39')]);_0xc32ca1[_0x5e26('0x3a')]=qs[_0x5e26('0x31')](_[_0x5e26('0x3b')](_0x284e18[_0x5e26('0x30')],_0x22f980[_0x5e26('0x31')]),_0x2214a2);if(_0x284e18[_0x5e26('0x30')][_0x5e26('0x3c')]){_0xc32ca1[_0x5e26('0x3a')]=_['merge'](_0xc32ca1[_0x5e26('0x3a')],{'$or':_[_0x5e26('0x2b')](_0x2214a2,function(_0x490ea9){if(_0x490ea9[_0x5e26('0x2d')]!=='VIRTUAL'){var _0xdb7254={};_0xdb7254[_0x490ea9[_0x5e26('0x29')]]={'$like':'%'+_0x284e18[_0x5e26('0x30')]['filter']+'%'};return _0xdb7254;}})});}_0xc32ca1=_[_0x5e26('0x3d')]({},_0xc32ca1,_0x284e18[_0x5e26('0x3e')]);var _0x141204={'where':_0xc32ca1['where']};return db[_0x5e26('0x3f')][_0x5e26('0x1e')](_0x141204)[_0x5e26('0x23')](function(_0x5af31b){_0x566c1a['count']=_0x5af31b;if(_0x284e18[_0x5e26('0x30')]['includeAll']){_0xc32ca1[_0x5e26('0x40')]=[{'all':!![]}];}return db[_0x5e26('0x3f')][_0x5e26('0x41')](_0xc32ca1);})['then'](function(_0x21c88e){_0x566c1a['rows']=_0x21c88e;return _0x566c1a;})[_0x5e26('0x23')](respondWithFilteredResult(_0x568c47,_0xc32ca1))[_0x5e26('0x42')](handleError(_0x568c47,null));};exports[_0x5e26('0x43')]=function(_0x2252b8,_0xbe833c){var _0x2859a1={'raw':!![],'where':{'id':_0x2252b8[_0x5e26('0x44')]['id']}},_0x5f1037={};_0x5f1037[_0x5e26('0x2f')]=_[_0x5e26('0x45')](db[_0x5e26('0x3f')][_0x5e26('0x2c')]);_0x5f1037[_0x5e26('0x30')]=_[_0x5e26('0x45')](_0x2252b8['query']);_0x5f1037[_0x5e26('0x31')]=_['intersection'](_0x5f1037[_0x5e26('0x2f')],_0x5f1037[_0x5e26('0x30')]);_0x2859a1[_0x5e26('0x33')]=_[_0x5e26('0x32')](_0x5f1037['model'],qs[_0x5e26('0x34')](_0x2252b8[_0x5e26('0x30')][_0x5e26('0x34')]));_0x2859a1['attributes']=_0x2859a1[_0x5e26('0x33')][_0x5e26('0x35')]?_0x2859a1['attributes']:_0x5f1037[_0x5e26('0x2f')];if(_0x2252b8['query']['includeAll']){_0x2859a1['include']=[{'all':!![]}];}_0x2859a1=_['merge']({},_0x2859a1,_0x2252b8['options']);return db[_0x5e26('0x3f')]['find'](_0x2859a1)[_0x5e26('0x23')](handleEntityNotFound(_0xbe833c,null))[_0x5e26('0x23')](respondWithResult(_0xbe833c,null))['catch'](handleError(_0xbe833c,null));};exports[_0x5e26('0x46')]=function(_0x5bbfd6,_0x2057b1){return db[_0x5e26('0x3f')][_0x5e26('0x46')](_0x5bbfd6['body'],{})[_0x5e26('0x23')](function(_0x517ac5){var _0x6bdaa8=_0x5bbfd6[_0x5e26('0x47')][_0x5e26('0x48')]({'plain':!![]});if(!_0x6bdaa8)throw new Error(_0x5e26('0x49'));if(_0x6bdaa8[_0x5e26('0x4a')]===_0x5e26('0x47')){var _0x3ad46d=_0x517ac5[_0x5e26('0x48')]({'plain':!![]});var _0x4b068f=_0x5e26('0x4b');return db['UserProfileSection'][_0x5e26('0x4c')]({'where':{'name':_0x4b068f,'userProfileId':_0x6bdaa8['userProfileId']},'raw':!![]})[_0x5e26('0x23')](function(_0x257218){if(_0x257218&&_0x257218[_0x5e26('0x4d')]===0x0){return db[_0x5e26('0x25')][_0x5e26('0x46')]({'name':_0x3ad46d['name'],'resourceId':_0x3ad46d['id'],'type':_0x257218['name'],'sectionId':_0x257218['id']},{})[_0x5e26('0x23')](function(){return _0x517ac5;});}else{return _0x517ac5;}})[_0x5e26('0x42')](function(_0xaf8921){logger[_0x5e26('0x27')](_0x5e26('0x4e'),_0xaf8921);throw _0xaf8921;});}return _0x517ac5;})['then'](respondWithResult(_0x2057b1,0xc9))[_0x5e26('0x42')](handleError(_0x2057b1,null));};exports[_0x5e26('0x22')]=function(_0x562f39,_0x19a255){if(_0x562f39['body']['id']){delete _0x562f39[_0x5e26('0x4f')]['id'];}return db[_0x5e26('0x3f')]['find']({'where':{'id':_0x562f39[_0x5e26('0x44')]['id']}})[_0x5e26('0x23')](handleEntityNotFound(_0x19a255,null))['then'](saveUpdates(_0x562f39[_0x5e26('0x4f')],null))[_0x5e26('0x23')](respondWithResult(_0x19a255,null))['catch'](handleError(_0x19a255,null));};exports[_0x5e26('0x24')]=function(_0x1ab2ec,_0x164d60){return db['Template'][_0x5e26('0x4c')]({'where':{'id':_0x1ab2ec[_0x5e26('0x44')]['id']}})[_0x5e26('0x23')](handleEntityNotFound(_0x164d60,null))[_0x5e26('0x23')](removeEntity(_0x164d60,null))[_0x5e26('0x42')](handleError(_0x164d60,null));}; \ No newline at end of file +var _0xd521=['count','include','rows','catch','show','params','rawAttributes','includeAll','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','limit','undefined','set','Content-Range','apply','reject','update','then','get','Templates','UserProfileResource','error','stack','name','send','map','Template','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','filter','where','VIRTUAL'];(function(_0x3eae7f,_0x33064f){var _0x353603=function(_0x127d6b){while(--_0x127d6b){_0x3eae7f['push'](_0x3eae7f['shift']());}};_0x353603(++_0x33064f);}(_0xd521,0x107));var _0x1d52=function(_0xaf52f9,_0x3608bc){_0xaf52f9=_0xaf52f9-0x0;var _0xd9e03e=_0xd521[_0xaf52f9];return _0xd9e03e;};'use strict';var emlformat=require(_0x1d52('0x0'));var rimraf=require(_0x1d52('0x1'));var zipdir=require(_0x1d52('0x2'));var jsonpatch=require(_0x1d52('0x3'));var rp=require(_0x1d52('0x4'));var moment=require(_0x1d52('0x5'));var BPromise=require(_0x1d52('0x6'));var Mustache=require(_0x1d52('0x7'));var util=require(_0x1d52('0x8'));var path=require('path');var sox=require(_0x1d52('0x9'));var csv=require(_0x1d52('0xa'));var ejs=require(_0x1d52('0xb'));var fs=require('fs');var fs_extra=require(_0x1d52('0xc'));var _=require('lodash');var squel=require(_0x1d52('0xd'));var crypto=require(_0x1d52('0xe'));var jsforce=require(_0x1d52('0xf'));var deskjs=require(_0x1d52('0x10'));var toCsv=require(_0x1d52('0xa'));var querystring=require(_0x1d52('0x11'));var Papa=require(_0x1d52('0x12'));var Redis=require('ioredis');var authService=require(_0x1d52('0x13'));var qs=require(_0x1d52('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d52('0x15'));var logger=require(_0x1d52('0x16'))(_0x1d52('0x17'));var utils=require(_0x1d52('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x1d52('0x19'));var db=require(_0x1d52('0x1a'))['db'];function respondWithStatusCode(_0x155f7d,_0x248f68){_0x248f68=_0x248f68||0xcc;return function(_0x287451){if(_0x287451){return _0x155f7d[_0x1d52('0x1b')](_0x248f68);}return _0x155f7d['status'](_0x248f68)[_0x1d52('0x1c')]();};}function respondWithResult(_0x5e21a5,_0x3e0c3d){_0x3e0c3d=_0x3e0c3d||0xc8;return function(_0x5755f0){if(_0x5755f0){return _0x5e21a5[_0x1d52('0x1d')](_0x3e0c3d)[_0x1d52('0x1e')](_0x5755f0);}};}function respondWithFilteredResult(_0x5a2625,_0xa448da){return function(_0x21e6fb){if(_0x21e6fb){var _0x26e66d=typeof _0xa448da[_0x1d52('0x1f')]==='undefined'&&typeof _0xa448da[_0x1d52('0x20')]===_0x1d52('0x21');var _0x5845bc=_0x21e6fb['count'];var _0x1e9482=_0x26e66d?0x0:_0xa448da['offset'];var _0x50b5ab=_0x26e66d?_0x21e6fb['count']:_0xa448da['offset']+_0xa448da['limit'];var _0x42f02c;if(_0x50b5ab>=_0x5845bc){_0x50b5ab=_0x5845bc;_0x42f02c=0xc8;}else{_0x42f02c=0xce;}_0x5a2625[_0x1d52('0x1d')](_0x42f02c);return _0x5a2625[_0x1d52('0x22')](_0x1d52('0x23'),_0x1e9482+'-'+_0x50b5ab+'/'+_0x5845bc)[_0x1d52('0x1e')](_0x21e6fb);}return null;};}function patchUpdates(_0x175625){return function(_0x52ab38){try{jsonpatch[_0x1d52('0x24')](_0x52ab38,_0x175625,!![]);}catch(_0x168d2c){return BPromise[_0x1d52('0x25')](_0x168d2c);}return _0x52ab38['save']();};}function saveUpdates(_0x34d132,_0x45d582){return function(_0x3a3f5e){if(_0x3a3f5e){return _0x3a3f5e[_0x1d52('0x26')](_0x34d132)['then'](function(_0x290b60){return _0x290b60;});}return null;};}function removeEntity(_0x5c7d5e,_0x44925e){return function(_0x1d0c0d){if(_0x1d0c0d){return _0x1d0c0d['destroy']()[_0x1d52('0x27')](function(){var _0x333d6f=_0x1d0c0d[_0x1d52('0x28')]({'plain':!![]});var _0x11ebb1=_0x1d52('0x29');return db[_0x1d52('0x2a')]['destroy']({'where':{'type':_0x11ebb1,'resourceId':_0x333d6f['id']}})['then'](function(){return _0x1d0c0d;});})[_0x1d52('0x27')](function(){_0x5c7d5e[_0x1d52('0x1d')](0xcc)[_0x1d52('0x1c')]();});}};}function handleEntityNotFound(_0x4f0221,_0x532265){return function(_0x4ae6a2){if(!_0x4ae6a2){_0x4f0221[_0x1d52('0x1b')](0x194);}return _0x4ae6a2;};}function handleError(_0x3f95d7,_0x56cd5f){_0x56cd5f=_0x56cd5f||0x1f4;return function(_0x53f0f1){logger[_0x1d52('0x2b')](_0x53f0f1[_0x1d52('0x2c')]);if(_0x53f0f1[_0x1d52('0x2d')]){delete _0x53f0f1[_0x1d52('0x2d')];}_0x3f95d7[_0x1d52('0x1d')](_0x56cd5f)[_0x1d52('0x2e')](_0x53f0f1);};}exports['index']=function(_0x40c89c,_0x4d3c67){var _0x1924f7={},_0x2fd2ed={},_0x42615b={'count':0x0,'rows':[]};var _0x5909b4=_[_0x1d52('0x2f')](db[_0x1d52('0x30')]['rawAttributes'],function(_0x5c1752){return{'name':_0x5c1752[_0x1d52('0x31')],'type':_0x5c1752[_0x1d52('0x32')][_0x1d52('0x33')]};});_0x2fd2ed[_0x1d52('0x34')]=_[_0x1d52('0x2f')](_0x5909b4,'name');_0x2fd2ed[_0x1d52('0x35')]=_[_0x1d52('0x36')](_0x40c89c[_0x1d52('0x35')]);_0x2fd2ed[_0x1d52('0x37')]=_[_0x1d52('0x38')](_0x2fd2ed['model'],_0x2fd2ed['query']);_0x1924f7[_0x1d52('0x39')]=_[_0x1d52('0x38')](_0x2fd2ed[_0x1d52('0x34')],qs['fields'](_0x40c89c[_0x1d52('0x35')][_0x1d52('0x3a')]));_0x1924f7[_0x1d52('0x39')]=_0x1924f7[_0x1d52('0x39')][_0x1d52('0x3b')]?_0x1924f7[_0x1d52('0x39')]:_0x2fd2ed[_0x1d52('0x34')];if(!_0x40c89c[_0x1d52('0x35')]['hasOwnProperty'](_0x1d52('0x3c'))){_0x1924f7[_0x1d52('0x20')]=qs[_0x1d52('0x20')](_0x40c89c[_0x1d52('0x35')]['limit']);_0x1924f7[_0x1d52('0x1f')]=qs['offset'](_0x40c89c[_0x1d52('0x35')][_0x1d52('0x1f')]);}_0x1924f7[_0x1d52('0x3d')]=qs['sort'](_0x40c89c['query']['sort']);_0x1924f7['where']=qs['filters'](_['pick'](_0x40c89c[_0x1d52('0x35')],_0x2fd2ed[_0x1d52('0x37')]),_0x5909b4);if(_0x40c89c[_0x1d52('0x35')][_0x1d52('0x3e')]){_0x1924f7['where']=_['merge'](_0x1924f7[_0x1d52('0x3f')],{'$or':_[_0x1d52('0x2f')](_0x5909b4,function(_0x469ae2){if(_0x469ae2['type']!==_0x1d52('0x40')){var _0x3b9076={};_0x3b9076[_0x469ae2[_0x1d52('0x2d')]]={'$like':'%'+_0x40c89c['query']['filter']+'%'};return _0x3b9076;}})});}_0x1924f7=_['merge']({},_0x1924f7,_0x40c89c['options']);var _0x3d3c1a={'where':_0x1924f7[_0x1d52('0x3f')]};return db[_0x1d52('0x30')][_0x1d52('0x41')](_0x3d3c1a)[_0x1d52('0x27')](function(_0x5728dd){_0x42615b['count']=_0x5728dd;if(_0x40c89c['query']['includeAll']){_0x1924f7[_0x1d52('0x42')]=[{'all':!![]}];}return db[_0x1d52('0x30')]['findAll'](_0x1924f7);})[_0x1d52('0x27')](function(_0x1ec4df){_0x42615b[_0x1d52('0x43')]=_0x1ec4df;return _0x42615b;})['then'](respondWithFilteredResult(_0x4d3c67,_0x1924f7))[_0x1d52('0x44')](handleError(_0x4d3c67,null));};exports[_0x1d52('0x45')]=function(_0x1c64bf,_0x3ada86){var _0x11c23d={'raw':!![],'where':{'id':_0x1c64bf[_0x1d52('0x46')]['id']}},_0x383c10={};_0x383c10[_0x1d52('0x34')]=_[_0x1d52('0x36')](db[_0x1d52('0x30')][_0x1d52('0x47')]);_0x383c10[_0x1d52('0x35')]=_['keys'](_0x1c64bf[_0x1d52('0x35')]);_0x383c10[_0x1d52('0x37')]=_[_0x1d52('0x38')](_0x383c10[_0x1d52('0x34')],_0x383c10[_0x1d52('0x35')]);_0x11c23d['attributes']=_[_0x1d52('0x38')](_0x383c10[_0x1d52('0x34')],qs[_0x1d52('0x3a')](_0x1c64bf[_0x1d52('0x35')][_0x1d52('0x3a')]));_0x11c23d['attributes']=_0x11c23d['attributes'][_0x1d52('0x3b')]?_0x11c23d[_0x1d52('0x39')]:_0x383c10[_0x1d52('0x34')];if(_0x1c64bf[_0x1d52('0x35')][_0x1d52('0x48')]){_0x11c23d[_0x1d52('0x42')]=[{'all':!![]}];}_0x11c23d=_[_0x1d52('0x49')]({},_0x11c23d,_0x1c64bf['options']);return db['Template'][_0x1d52('0x4a')](_0x11c23d)[_0x1d52('0x27')](handleEntityNotFound(_0x3ada86,null))[_0x1d52('0x27')](respondWithResult(_0x3ada86,null))[_0x1d52('0x44')](handleError(_0x3ada86,null));};exports[_0x1d52('0x4b')]=function(_0x3b7b71,_0x3ae027){return db[_0x1d52('0x30')][_0x1d52('0x4b')](_0x3b7b71[_0x1d52('0x4c')],{})['then'](function(_0x7d25a0){var _0x3d33af=_0x3b7b71[_0x1d52('0x4d')][_0x1d52('0x28')]({'plain':!![]});if(!_0x3d33af)throw new Error(_0x1d52('0x4e'));if(_0x3d33af[_0x1d52('0x4f')]===_0x1d52('0x4d')){var _0x49f185=_0x7d25a0['get']({'plain':!![]});var _0x4abd54='Templates';return db['UserProfileSection'][_0x1d52('0x4a')]({'where':{'name':_0x4abd54,'userProfileId':_0x3d33af[_0x1d52('0x50')]},'raw':!![]})[_0x1d52('0x27')](function(_0x4a3373){if(_0x4a3373&&_0x4a3373['autoAssociation']===0x0){return db['UserProfileResource'][_0x1d52('0x4b')]({'name':_0x49f185[_0x1d52('0x2d')],'resourceId':_0x49f185['id'],'type':_0x4a3373[_0x1d52('0x2d')],'sectionId':_0x4a3373['id']},{})[_0x1d52('0x27')](function(){return _0x7d25a0;});}else{return _0x7d25a0;}})[_0x1d52('0x44')](function(_0x2bda91){logger[_0x1d52('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2bda91);throw _0x2bda91;});}return _0x7d25a0;})[_0x1d52('0x27')](respondWithResult(_0x3ae027,0xc9))[_0x1d52('0x44')](handleError(_0x3ae027,null));};exports['update']=function(_0x49a2c6,_0x439212){if(_0x49a2c6['body']['id']){delete _0x49a2c6[_0x1d52('0x4c')]['id'];}return db[_0x1d52('0x30')]['find']({'where':{'id':_0x49a2c6['params']['id']}})[_0x1d52('0x27')](handleEntityNotFound(_0x439212,null))[_0x1d52('0x27')](saveUpdates(_0x49a2c6[_0x1d52('0x4c')],null))[_0x1d52('0x27')](respondWithResult(_0x439212,null))['catch'](handleError(_0x439212,null));};exports[_0x1d52('0x51')]=function(_0x239e8b,_0x51cdb3){return db['Template'][_0x1d52('0x4a')]({'where':{'id':_0x239e8b['params']['id']}})[_0x1d52('0x27')](handleEntityNotFound(_0x51cdb3,null))[_0x1d52('0x27')](removeEntity(_0x51cdb3,null))[_0x1d52('0x44')](handleError(_0x51cdb3,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index aa46a74..14da81b 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 _0xdcd1=['Template','tools_templates','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','exports','define'];(function(_0x51a6d6,_0x3c9c49){var _0x5ef1a8=function(_0x8ff84a){while(--_0x8ff84a){_0x51a6d6['push'](_0x51a6d6['shift']());}};_0x5ef1a8(++_0x3c9c49);}(_0xdcd1,0x84));var _0x1dcd=function(_0x281fe8,_0xda712){_0x281fe8=_0x281fe8-0x0;var _0x3175b1=_0xdcd1[_0x281fe8];return _0x3175b1;};'use strict';var _=require(_0x1dcd('0x0'));var util=require('util');var logger=require(_0x1dcd('0x1'))('api');var moment=require(_0x1dcd('0x2'));var BPromise=require(_0x1dcd('0x3'));var rp=require(_0x1dcd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1dcd('0x5'));var config=require('../../config/environment');var attributes=require('./template.attributes');module[_0x1dcd('0x6')]=function(_0x30cab3,_0x3a5051){return _0x30cab3[_0x1dcd('0x7')](_0x1dcd('0x8'),attributes,{'tableName':_0x1dcd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0610=['bluebird','request-promise','path','rimraf','./template.attributes','define','Template','lodash','util','../../config/logger','moment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0610,0x80));var _0x0061=function(_0x1fceef,_0x579b88){_0x1fceef=_0x1fceef-0x0;var _0x7176ed=_0x0610[_0x1fceef];return _0x7176ed;};'use strict';var _=require(_0x0061('0x0'));var util=require(_0x0061('0x1'));var logger=require(_0x0061('0x2'))('api');var moment=require(_0x0061('0x3'));var BPromise=require(_0x0061('0x4'));var rp=require(_0x0061('0x5'));var fs=require('fs');var path=require(_0x0061('0x6'));var rimraf=require(_0x0061('0x7'));var config=require('../../config/environment');var attributes=require(_0x0061('0x8'));module['exports']=function(_0x35ef10,_0x5141d9){return _0x35ef10[_0x0061('0x9')](_0x0061('0xa'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index ee1f2b1..c73d279 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 _0xa5d5=['../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','GetTemplate','Template','findAll','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0xa5d5,0x1a6));var _0x5a5d=function(_0x344cfb,_0x2836b8){_0x344cfb=_0x344cfb-0x0;var _0x1d1ee7=_0xa5d5[_0x344cfb];return _0x1d1ee7;};'use strict';var _=require(_0x5a5d('0x0'));var util=require(_0x5a5d('0x1'));var moment=require('moment');var BPromise=require(_0x5a5d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5a5d('0x3'));var db=require(_0x5a5d('0x4'))['db'];var utils=require(_0x5a5d('0x5'));var logger=require('../../config/logger')(_0x5a5d('0x6'));var config=require(_0x5a5d('0x7'));var jayson=require(_0x5a5d('0x8'));var client=jayson[_0x5a5d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e2802,_0x585313,_0x51cc84){return new BPromise(function(_0x26b93c,_0x36e63a){return client[_0x5a5d('0xa')](_0x3e2802,_0x51cc84)[_0x5a5d('0xb')](function(_0x2a3247){logger[_0x5a5d('0xc')](_0x5a5d('0xd'),_0x585313,_0x5a5d('0xe'));logger[_0x5a5d('0xf')]('Template,\x20%s,\x20%s,\x20%s',_0x585313,'request\x20sent',JSON[_0x5a5d('0x10')](_0x2a3247));if(_0x2a3247['error']){if(_0x2a3247['error'][_0x5a5d('0x11')]===0x1f4){logger['error'](_0x5a5d('0xd'),_0x585313,_0x2a3247[_0x5a5d('0x12')][_0x5a5d('0x13')]);return _0x36e63a(_0x2a3247[_0x5a5d('0x12')][_0x5a5d('0x13')]);}logger[_0x5a5d('0x12')]('Template,\x20%s,\x20%s',_0x585313,_0x2a3247[_0x5a5d('0x12')]['message']);return _0x26b93c(_0x2a3247[_0x5a5d('0x12')][_0x5a5d('0x13')]);}else{logger[_0x5a5d('0xc')](_0x5a5d('0xd'),_0x585313,_0x5a5d('0xe'));_0x26b93c(_0x2a3247[_0x5a5d('0x14')][_0x5a5d('0x13')]);}})[_0x5a5d('0x15')](function(_0x28c7a7){logger[_0x5a5d('0x12')](_0x5a5d('0xd'),_0x585313,_0x28c7a7);_0x36e63a(_0x28c7a7);});});}exports[_0x5a5d('0x16')]=function(_0x3793f9){var _0x56a3b0=this;return new Promise(function(_0x215107,_0x207460){return db[_0x5a5d('0x17')][_0x5a5d('0x18')]({'raw':_0x3793f9[_0x5a5d('0x19')]?_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1a')]===undefined?!![]:![]:!![],'where':_0x3793f9[_0x5a5d('0x19')]?_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1b')]||null:null,'attributes':_0x3793f9[_0x5a5d('0x19')]?_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1c')]||null:null,'limit':_0x3793f9[_0x5a5d('0x19')]?_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1d')]||null:null,'include':_0x3793f9[_0x5a5d('0x19')]?_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1e')]?_[_0x5a5d('0x1f')](_0x3793f9[_0x5a5d('0x19')][_0x5a5d('0x1e')],function(_0x49e1fb){return{'model':db[_0x49e1fb[_0x5a5d('0x20')]],'as':_0x49e1fb['as'],'attributes':_0x49e1fb[_0x5a5d('0x1c')],'include':_0x49e1fb[_0x5a5d('0x1e')]?_['map'](_0x49e1fb[_0x5a5d('0x1e')],function(_0xd07b05){return{'model':db[_0xd07b05['model']],'as':_0xd07b05['as'],'attributes':_0xd07b05[_0x5a5d('0x1c')],'include':_0xd07b05[_0x5a5d('0x1e')]?_[_0x5a5d('0x1f')](_0xd07b05[_0x5a5d('0x1e')],function(_0x2bad56){return{'model':db[_0x2bad56[_0x5a5d('0x20')]],'as':_0x2bad56['as'],'attributes':_0x2bad56[_0x5a5d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5a5d('0xb')](function(_0x1f6975){logger[_0x5a5d('0xc')]('GetTemplate',_0x3793f9);logger['debug'](_0x5a5d('0x16'),_0x3793f9,JSON[_0x5a5d('0x10')](_0x1f6975));_0x215107(_0x1f6975);})[_0x5a5d('0x15')](function(_0x324bba){logger[_0x5a5d('0x12')](_0x5a5d('0x16'),_0x324bba['message'],_0x3793f9);_0x207460(_0x56a3b0[_0x5a5d('0x12')](0x1f4,_0x324bba[_0x5a5d('0x13')]));});});}; \ No newline at end of file +var _0x26d5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Template,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetTemplate','Template','findAll','options','limit','include','attributes','model','map','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0xffbc0b,_0x2e5f2d){var _0x44cfe8=function(_0x533dff){while(--_0x533dff){_0xffbc0b['push'](_0xffbc0b['shift']());}};_0x44cfe8(++_0x2e5f2d);}(_0x26d5,0x14f));var _0x526d=function(_0x416f89,_0x6a920b){_0x416f89=_0x416f89-0x0;var _0xfe98f6=_0x26d5[_0x416f89];return _0xfe98f6;};'use strict';var _=require('lodash');var util=require(_0x526d('0x0'));var moment=require(_0x526d('0x1'));var BPromise=require(_0x526d('0x2'));var rs=require(_0x526d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x526d('0x4'))['db'];var utils=require(_0x526d('0x5'));var logger=require(_0x526d('0x6'))(_0x526d('0x7'));var config=require(_0x526d('0x8'));var jayson=require(_0x526d('0x9'));var client=jayson[_0x526d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c6497,_0x5886b0,_0x2eda62){return new BPromise(function(_0x542a46,_0x113f77){return client[_0x526d('0xb')](_0x1c6497,_0x2eda62)['then'](function(_0x4ffd58){logger[_0x526d('0xc')](_0x526d('0xd'),_0x5886b0,_0x526d('0xe'));logger['debug']('Template,\x20%s,\x20%s,\x20%s',_0x5886b0,_0x526d('0xe'),JSON[_0x526d('0xf')](_0x4ffd58));if(_0x4ffd58[_0x526d('0x10')]){if(_0x4ffd58['error'][_0x526d('0x11')]===0x1f4){logger['error'](_0x526d('0xd'),_0x5886b0,_0x4ffd58[_0x526d('0x10')][_0x526d('0x12')]);return _0x113f77(_0x4ffd58[_0x526d('0x10')][_0x526d('0x12')]);}logger['error'](_0x526d('0xd'),_0x5886b0,_0x4ffd58[_0x526d('0x10')][_0x526d('0x12')]);return _0x542a46(_0x4ffd58[_0x526d('0x10')][_0x526d('0x12')]);}else{logger[_0x526d('0xc')]('Template,\x20%s,\x20%s',_0x5886b0,'request\x20sent');_0x542a46(_0x4ffd58[_0x526d('0x13')][_0x526d('0x12')]);}})[_0x526d('0x14')](function(_0x2f5a61){logger[_0x526d('0x10')](_0x526d('0xd'),_0x5886b0,_0x2f5a61);_0x113f77(_0x2f5a61);});});}exports[_0x526d('0x15')]=function(_0x4f70a2){var _0xaf60df=this;return new Promise(function(_0x11f606,_0x5785ea){return db[_0x526d('0x16')][_0x526d('0x17')]({'raw':_0x4f70a2[_0x526d('0x18')]?_0x4f70a2[_0x526d('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4f70a2['options']?_0x4f70a2['options']['where']||null:null,'attributes':_0x4f70a2['options']?_0x4f70a2[_0x526d('0x18')]['attributes']||null:null,'limit':_0x4f70a2['options']?_0x4f70a2[_0x526d('0x18')][_0x526d('0x19')]||null:null,'include':_0x4f70a2['options']?_0x4f70a2[_0x526d('0x18')][_0x526d('0x1a')]?_['map'](_0x4f70a2[_0x526d('0x18')]['include'],function(_0x1ee5b7){return{'model':db[_0x1ee5b7['model']],'as':_0x1ee5b7['as'],'attributes':_0x1ee5b7[_0x526d('0x1b')],'include':_0x1ee5b7[_0x526d('0x1a')]?_['map'](_0x1ee5b7[_0x526d('0x1a')],function(_0x40f30f){return{'model':db[_0x40f30f[_0x526d('0x1c')]],'as':_0x40f30f['as'],'attributes':_0x40f30f['attributes'],'include':_0x40f30f[_0x526d('0x1a')]?_[_0x526d('0x1d')](_0x40f30f[_0x526d('0x1a')],function(_0x4a0b07){return{'model':db[_0x4a0b07[_0x526d('0x1c')]],'as':_0x4a0b07['as'],'attributes':_0x4a0b07[_0x526d('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x21aaa2){logger[_0x526d('0xc')]('GetTemplate',_0x4f70a2);logger[_0x526d('0x1e')]('GetTemplate',_0x4f70a2,JSON[_0x526d('0xf')](_0x21aaa2));_0x11f606(_0x21aaa2);})[_0x526d('0x14')](function(_0x25a2ac){logger['error'](_0x526d('0x15'),_0x25a2ac['message'],_0x4f70a2);_0x5785ea(_0xaf60df[_0x526d('0x10')](0x1f4,_0x25a2ac[_0x526d('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7aad0d1..7211069 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 _0x64f8=['connect-timeout','Router','fs-extra','../../components/interaction/service','isAuthenticated','index','get','/:id/all_conditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/any_conditions','addAnyCondition','addAction','put','/:id','update','delete','destroy','multer','util'];(function(_0x2102bb,_0xe3868f){var _0x33f835=function(_0x25a7f3){while(--_0x25a7f3){_0x2102bb['push'](_0x2102bb['shift']());}};_0x33f835(++_0xe3868f);}(_0x64f8,0x140));var _0x864f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64f8[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x864f('0x0'));var util=require(_0x864f('0x1'));var path=require('path');var timeout=require(_0x864f('0x2'));var express=require('express');var router=express[_0x864f('0x3')]();var fs_extra=require(_0x864f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x864f('0x5'));var config=require('../../config/environment');var controller=require('./trigger.controller');router['get']('/',auth[_0x864f('0x6')](),controller[_0x864f('0x7')]);router[_0x864f('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x864f('0x8')](_0x864f('0x9'),auth[_0x864f('0x6')](),controller['getAllConditions']);router[_0x864f('0x8')]('/:id/any_conditions',auth[_0x864f('0x6')](),controller[_0x864f('0xa')]);router[_0x864f('0x8')](_0x864f('0xb'),auth['isAuthenticated'](),controller[_0x864f('0xc')]);router[_0x864f('0xd')]('/',auth[_0x864f('0x6')](),controller[_0x864f('0xe')]);router['post']('/:id/all_conditions',auth[_0x864f('0x6')](),controller['addAllCondition']);router[_0x864f('0xd')](_0x864f('0xf'),auth[_0x864f('0x6')](),controller[_0x864f('0x10')]);router[_0x864f('0xd')]('/:id/actions',auth[_0x864f('0x6')](),controller[_0x864f('0x11')]);router[_0x864f('0x12')](_0x864f('0x13'),auth[_0x864f('0x6')](),controller[_0x864f('0x14')]);router[_0x864f('0x15')](_0x864f('0x13'),auth[_0x864f('0x6')](),controller[_0x864f('0x16')]);module['exports']=router; \ No newline at end of file +var _0xf93d=['index','isAuthenticated','show','/:id/all_conditions','get','/:id/any_conditions','/:id/actions','getActions','post','create','addAllCondition','addAnyCondition','addAction','put','/:id','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller'];(function(_0x19326c,_0x215b2e){var _0x1014d1=function(_0x5c02d3){while(--_0x5c02d3){_0x19326c['push'](_0x19326c['shift']());}};_0x1014d1(++_0x215b2e);}(_0xf93d,0x11f));var _0xdf93=function(_0x24a236,_0x11761e){_0x24a236=_0x24a236-0x0;var _0x1cd26f=_0xf93d[_0x24a236];return _0x1cd26f;};'use strict';var multer=require('multer');var util=require(_0xdf93('0x0'));var path=require(_0xdf93('0x1'));var timeout=require(_0xdf93('0x2'));var express=require(_0xdf93('0x3'));var router=express[_0xdf93('0x4')]();var fs_extra=require(_0xdf93('0x5'));var auth=require(_0xdf93('0x6'));var interaction=require(_0xdf93('0x7'));var config=require(_0xdf93('0x8'));var controller=require(_0xdf93('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xdf93('0xa')]);router['get']('/:id',auth[_0xdf93('0xb')](),controller[_0xdf93('0xc')]);router['get'](_0xdf93('0xd'),auth['isAuthenticated'](),controller['getAllConditions']);router[_0xdf93('0xe')](_0xdf93('0xf'),auth[_0xdf93('0xb')](),controller['getAnyConditions']);router['get'](_0xdf93('0x10'),auth[_0xdf93('0xb')](),controller[_0xdf93('0x11')]);router[_0xdf93('0x12')]('/',auth[_0xdf93('0xb')](),controller[_0xdf93('0x13')]);router[_0xdf93('0x12')](_0xdf93('0xd'),auth['isAuthenticated'](),controller[_0xdf93('0x14')]);router[_0xdf93('0x12')](_0xdf93('0xf'),auth['isAuthenticated'](),controller[_0xdf93('0x15')]);router[_0xdf93('0x12')]('/:id/actions',auth['isAuthenticated'](),controller[_0xdf93('0x16')]);router[_0xdf93('0x17')](_0xdf93('0x18'),auth[_0xdf93('0xb')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xdf93('0x19')]);module[_0xdf93('0x1a')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index cc227db..129af79 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 _0xe8a0=['BOOLEAN','exports','STRING'];(function(_0x1f8c5d,_0xf46077){var _0x23fb07=function(_0x48f13a){while(--_0x48f13a){_0x1f8c5d['push'](_0x1f8c5d['shift']());}};_0x23fb07(++_0xf46077);}(_0xe8a0,0x70));var _0x0e8a=function(_0x2e1b12,_0x3ccf61){_0x2e1b12=_0x2e1b12-0x0;var _0x2822a9=_0xe8a0[_0x2e1b12];return _0x2822a9;};'use strict';var Sequelize=require('sequelize');module[_0x0e8a('0x0')]={'name':{'type':Sequelize[_0x0e8a('0x1')]},'channel':{'type':Sequelize[_0x0e8a('0x1')]},'description':{'type':Sequelize[_0x0e8a('0x1')]},'status':{'type':Sequelize[_0x0e8a('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xc475=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1a595a,_0x263824){var _0x33f008=function(_0x1e2f9c){while(--_0x1e2f9c){_0x1a595a['push'](_0x1a595a['shift']());}};_0x33f008(++_0x263824);}(_0xc475,0x13c));var _0x5c47=function(_0x40d483,_0x161e55){_0x40d483=_0x40d483-0x0;var _0x52fc06=_0xc475[_0x40d483];return _0x52fc06;};'use strict';var Sequelize=require(_0x5c47('0x0'));module[_0x5c47('0x1')]={'name':{'type':Sequelize[_0x5c47('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c47('0x2')]},'status':{'type':Sequelize[_0x5c47('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 14ef7a9..2c2cdde 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 _0x91d1=['get','Triggers','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','model','intersection','fields','attributes','length','sort','pick','filter','merge','where','VIRTUAL','Trigger','includeAll','include','rows','catch','options','create','body','role','UserProfileSection','find','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addAllCondition','Condition','addAnyCondition','getAllConditions','order','hasOwnProperty','getAnyConditions','findOne','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy'];(function(_0x1f49d2,_0x7a4694){var _0x21cac5=function(_0x2ff92b){while(--_0x2ff92b){_0x1f49d2['push'](_0x1f49d2['shift']());}};_0x21cac5(++_0x7a4694);}(_0x91d1,0x94));var _0x191d=function(_0x296bf7,_0x1e6c16){_0x296bf7=_0x296bf7-0x0;var _0x20c693=_0x91d1[_0x296bf7];return _0x20c693;};'use strict';var emlformat=require(_0x191d('0x0'));var rimraf=require(_0x191d('0x1'));var zipdir=require(_0x191d('0x2'));var jsonpatch=require(_0x191d('0x3'));var rp=require(_0x191d('0x4'));var moment=require(_0x191d('0x5'));var BPromise=require(_0x191d('0x6'));var Mustache=require(_0x191d('0x7'));var util=require(_0x191d('0x8'));var path=require(_0x191d('0x9'));var sox=require(_0x191d('0xa'));var csv=require(_0x191d('0xb'));var ejs=require(_0x191d('0xc'));var fs=require('fs');var fs_extra=require(_0x191d('0xd'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x191d('0xe'));var jsforce=require(_0x191d('0xf'));var deskjs=require(_0x191d('0x10'));var toCsv=require(_0x191d('0xb'));var querystring=require('querystring');var Papa=require(_0x191d('0x11'));var Redis=require(_0x191d('0x12'));var authService=require(_0x191d('0x13'));var qs=require(_0x191d('0x14'));var as=require(_0x191d('0x15'));var hardwareService=require(_0x191d('0x16'));var logger=require(_0x191d('0x17'))('api');var utils=require(_0x191d('0x18'));var config=require(_0x191d('0x19'));var licenseUtil=require(_0x191d('0x1a'));var db=require(_0x191d('0x1b'))['db'];function respondWithStatusCode(_0x3835eb,_0x17f1fe){_0x17f1fe=_0x17f1fe||0xcc;return function(_0x3cdab){if(_0x3cdab){return _0x3835eb[_0x191d('0x1c')](_0x17f1fe);}return _0x3835eb[_0x191d('0x1d')](_0x17f1fe)[_0x191d('0x1e')]();};}function respondWithResult(_0x61194,_0x32f9ce){_0x32f9ce=_0x32f9ce||0xc8;return function(_0x5138ac){if(_0x5138ac){return _0x61194[_0x191d('0x1d')](_0x32f9ce)[_0x191d('0x1f')](_0x5138ac);}};}function respondWithFilteredResult(_0x5385df,_0xd13e0f){return function(_0x81f5ce){if(_0x81f5ce){var _0x8d3b54=typeof _0xd13e0f[_0x191d('0x20')]===_0x191d('0x21')&&typeof _0xd13e0f[_0x191d('0x22')]===_0x191d('0x21');var _0x177318=_0x81f5ce[_0x191d('0x23')];var _0x5ea812=_0x8d3b54?0x0:_0xd13e0f['offset'];var _0x3e3307=_0x8d3b54?_0x81f5ce[_0x191d('0x23')]:_0xd13e0f[_0x191d('0x20')]+_0xd13e0f['limit'];var _0x195a65;if(_0x3e3307>=_0x177318){_0x3e3307=_0x177318;_0x195a65=0xc8;}else{_0x195a65=0xce;}_0x5385df['status'](_0x195a65);return _0x5385df[_0x191d('0x24')](_0x191d('0x25'),_0x5ea812+'-'+_0x3e3307+'/'+_0x177318)[_0x191d('0x1f')](_0x81f5ce);}return null;};}function patchUpdates(_0xa55ca4){return function(_0x303fc3){try{jsonpatch[_0x191d('0x26')](_0x303fc3,_0xa55ca4,!![]);}catch(_0x133fd2){return BPromise['reject'](_0x133fd2);}return _0x303fc3[_0x191d('0x27')]();};}function saveUpdates(_0x48eb27,_0x12d743){return function(_0x1ec4a1){if(_0x1ec4a1){return _0x1ec4a1['update'](_0x48eb27)[_0x191d('0x28')](function(_0x4f634c){return _0x4f634c;});}return null;};}function removeEntity(_0x2c2bac,_0x545dc2){return function(_0x117096){if(_0x117096){return _0x117096[_0x191d('0x29')]()[_0x191d('0x28')](function(){var _0x3350d7=_0x117096[_0x191d('0x2a')]({'plain':!![]});var _0x68179f=_0x191d('0x2b');return db['UserProfileResource'][_0x191d('0x29')]({'where':{'type':_0x68179f,'resourceId':_0x3350d7['id']}})[_0x191d('0x28')](function(){return _0x117096;});})['then'](function(){_0x2c2bac[_0x191d('0x1d')](0xcc)[_0x191d('0x1e')]();});}};}function handleEntityNotFound(_0x4af29a,_0x273134){return function(_0x4cbb3f){if(!_0x4cbb3f){_0x4af29a[_0x191d('0x1c')](0x194);}return _0x4cbb3f;};}function handleError(_0x322c47,_0x3bebf7){_0x3bebf7=_0x3bebf7||0x1f4;return function(_0x232f80){logger[_0x191d('0x2c')](_0x232f80[_0x191d('0x2d')]);if(_0x232f80[_0x191d('0x2e')]){delete _0x232f80['name'];}_0x322c47['status'](_0x3bebf7)[_0x191d('0x2f')](_0x232f80);};}exports[_0x191d('0x30')]=function(_0x3b7b5d,_0x12b1ec){var _0x50165e={},_0x5cb451={},_0x1ac9b0={'count':0x0,'rows':[]};var _0x52c55d=_[_0x191d('0x31')](db['Trigger'][_0x191d('0x32')],function(_0x2bb3fe){return{'name':_0x2bb3fe[_0x191d('0x33')],'type':_0x2bb3fe[_0x191d('0x34')]['key']};});_0x5cb451['model']=_['map'](_0x52c55d,_0x191d('0x2e'));_0x5cb451[_0x191d('0x35')]=_[_0x191d('0x36')](_0x3b7b5d['query']);_0x5cb451[_0x191d('0x37')]=_['intersection'](_0x5cb451[_0x191d('0x38')],_0x5cb451[_0x191d('0x35')]);_0x50165e['attributes']=_[_0x191d('0x39')](_0x5cb451[_0x191d('0x38')],qs[_0x191d('0x3a')](_0x3b7b5d[_0x191d('0x35')][_0x191d('0x3a')]));_0x50165e[_0x191d('0x3b')]=_0x50165e['attributes'][_0x191d('0x3c')]?_0x50165e[_0x191d('0x3b')]:_0x5cb451[_0x191d('0x38')];if(!_0x3b7b5d['query']['hasOwnProperty']('nolimit')){_0x50165e[_0x191d('0x22')]=qs[_0x191d('0x22')](_0x3b7b5d[_0x191d('0x35')][_0x191d('0x22')]);_0x50165e['offset']=qs[_0x191d('0x20')](_0x3b7b5d['query'][_0x191d('0x20')]);}_0x50165e['order']=qs[_0x191d('0x3d')](_0x3b7b5d['query'][_0x191d('0x3d')]);_0x50165e['where']=qs[_0x191d('0x37')](_[_0x191d('0x3e')](_0x3b7b5d['query'],_0x5cb451[_0x191d('0x37')]),_0x52c55d);if(_0x3b7b5d[_0x191d('0x35')][_0x191d('0x3f')]){_0x50165e['where']=_[_0x191d('0x40')](_0x50165e[_0x191d('0x41')],{'$or':_[_0x191d('0x31')](_0x52c55d,function(_0x37acb8){if(_0x37acb8[_0x191d('0x34')]!==_0x191d('0x42')){var _0xaba88c={};_0xaba88c[_0x37acb8[_0x191d('0x2e')]]={'$like':'%'+_0x3b7b5d[_0x191d('0x35')]['filter']+'%'};return _0xaba88c;}})});}_0x50165e=_[_0x191d('0x40')]({},_0x50165e,_0x3b7b5d['options']);var _0xc508f7={'where':_0x50165e['where']};return db[_0x191d('0x43')][_0x191d('0x23')](_0xc508f7)[_0x191d('0x28')](function(_0x5bc9fb){_0x1ac9b0[_0x191d('0x23')]=_0x5bc9fb;if(_0x3b7b5d['query'][_0x191d('0x44')]){_0x50165e[_0x191d('0x45')]=[{'all':!![]}];}return db[_0x191d('0x43')]['findAll'](_0x50165e);})[_0x191d('0x28')](function(_0x20d578){_0x1ac9b0[_0x191d('0x46')]=_0x20d578;return _0x1ac9b0;})[_0x191d('0x28')](respondWithFilteredResult(_0x12b1ec,_0x50165e))[_0x191d('0x47')](handleError(_0x12b1ec,null));};exports['show']=function(_0x408a64,_0x3cc235){var _0x5bf5f6={'raw':![],'where':{'id':_0x408a64['params']['id']}},_0x51243c={};_0x51243c['model']=_['keys'](db[_0x191d('0x43')][_0x191d('0x32')]);_0x51243c[_0x191d('0x35')]=_[_0x191d('0x36')](_0x408a64[_0x191d('0x35')]);_0x51243c['filters']=_['intersection'](_0x51243c[_0x191d('0x38')],_0x51243c['query']);_0x5bf5f6[_0x191d('0x3b')]=_[_0x191d('0x39')](_0x51243c[_0x191d('0x38')],qs['fields'](_0x408a64[_0x191d('0x35')][_0x191d('0x3a')]));_0x5bf5f6[_0x191d('0x3b')]=_0x5bf5f6[_0x191d('0x3b')]['length']?_0x5bf5f6['attributes']:_0x51243c['model'];if(_0x408a64[_0x191d('0x35')]['includeAll']){_0x5bf5f6[_0x191d('0x45')]=[{'all':!![]}];}_0x5bf5f6=_[_0x191d('0x40')]({},_0x5bf5f6,_0x408a64[_0x191d('0x48')]);return db['Trigger']['find'](_0x5bf5f6)[_0x191d('0x28')](handleEntityNotFound(_0x3cc235,null))[_0x191d('0x28')](respondWithResult(_0x3cc235,null))[_0x191d('0x47')](handleError(_0x3cc235,null));};exports[_0x191d('0x49')]=function(_0x41eca7,_0x3e895b){return db[_0x191d('0x43')][_0x191d('0x49')](_0x41eca7[_0x191d('0x4a')],{})[_0x191d('0x28')](function(_0x34c9f3){var _0x39e2bf=_0x41eca7['user'][_0x191d('0x2a')]({'plain':!![]});if(!_0x39e2bf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x39e2bf[_0x191d('0x4b')]==='user'){var _0x38e302=_0x34c9f3[_0x191d('0x2a')]({'plain':!![]});var _0x4b889f=_0x191d('0x2b');return db[_0x191d('0x4c')][_0x191d('0x4d')]({'where':{'name':_0x4b889f,'userProfileId':_0x39e2bf[_0x191d('0x4e')]},'raw':!![]})['then'](function(_0x2da630){if(_0x2da630&&_0x2da630['autoAssociation']===0x0){return db[_0x191d('0x4f')][_0x191d('0x49')]({'name':_0x38e302['name'],'resourceId':_0x38e302['id'],'type':_0x2da630[_0x191d('0x2e')],'sectionId':_0x2da630['id']},{})['then'](function(){return _0x34c9f3;});}else{return _0x34c9f3;}})['catch'](function(_0x1d4bd4){logger[_0x191d('0x2c')](_0x191d('0x50'),_0x1d4bd4);throw _0x1d4bd4;});}return _0x34c9f3;})[_0x191d('0x28')](respondWithResult(_0x3e895b,0xc9))[_0x191d('0x47')](handleError(_0x3e895b,null));};exports[_0x191d('0x51')]=function(_0x5867f4,_0x1d40cf){if(_0x5867f4[_0x191d('0x4a')]['id']){delete _0x5867f4[_0x191d('0x4a')]['id'];}return db[_0x191d('0x43')][_0x191d('0x4d')]({'where':{'id':_0x5867f4[_0x191d('0x52')]['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x1d40cf,null))[_0x191d('0x28')](saveUpdates(_0x5867f4[_0x191d('0x4a')],null))[_0x191d('0x28')](respondWithResult(_0x1d40cf,null))['catch'](handleError(_0x1d40cf,null));};exports[_0x191d('0x29')]=function(_0x329a5c,_0x592319){return db[_0x191d('0x43')]['find']({'where':{'id':_0x329a5c[_0x191d('0x52')]['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x592319,null))[_0x191d('0x28')](removeEntity(_0x592319,null))['catch'](handleError(_0x592319,null));};exports[_0x191d('0x53')]=function(_0x560ff1,_0x30ac2f,_0x4cf086){if(_0x560ff1[_0x191d('0x4a')]['id']){delete _0x560ff1['body']['id'];}return db[_0x191d('0x43')][_0x191d('0x4d')]({'where':{'id':_0x560ff1[_0x191d('0x52')]['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x30ac2f,null))[_0x191d('0x28')](function(_0x5cef1c){if(_0x5cef1c){_0x560ff1[_0x191d('0x4a')]['TriggerAllId']=_0x5cef1c['id'];return db[_0x191d('0x54')]['create'](_0x560ff1[_0x191d('0x4a')]);}})[_0x191d('0x28')](respondWithResult(_0x30ac2f,null))[_0x191d('0x47')](handleError(_0x30ac2f,null));};exports[_0x191d('0x55')]=function(_0x1d5a68,_0x129f1e,_0x429148){if(_0x1d5a68['body']['id']){delete _0x1d5a68[_0x191d('0x4a')]['id'];}return db[_0x191d('0x43')][_0x191d('0x4d')]({'where':{'id':_0x1d5a68['params']['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x129f1e,null))[_0x191d('0x28')](function(_0x594c4f){if(_0x594c4f){_0x1d5a68[_0x191d('0x4a')]['TriggerAnyId']=_0x594c4f['id'];return db[_0x191d('0x54')][_0x191d('0x49')](_0x1d5a68[_0x191d('0x4a')]);}})[_0x191d('0x28')](respondWithResult(_0x129f1e,null))[_0x191d('0x47')](handleError(_0x129f1e,null));};exports[_0x191d('0x56')]=function(_0x1e17ba,_0x46b5ae,_0x35e4c5){var _0x1b716c={};var _0x26a0d7={};var _0x3dc460;var _0x9781c2;return db[_0x191d('0x43')]['findOne']({'where':{'id':_0x1e17ba[_0x191d('0x52')]['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x46b5ae,null))[_0x191d('0x28')](function(_0x1eb7dc){if(_0x1eb7dc){_0x3dc460=_0x1eb7dc;_0x26a0d7['model']=_[_0x191d('0x36')](db[_0x191d('0x54')][_0x191d('0x32')]);_0x26a0d7[_0x191d('0x35')]=_[_0x191d('0x36')](_0x1e17ba['query']);_0x26a0d7[_0x191d('0x37')]=_[_0x191d('0x39')](_0x26a0d7[_0x191d('0x38')],_0x26a0d7['query']);_0x1b716c['attributes']=_[_0x191d('0x39')](_0x26a0d7[_0x191d('0x38')],qs[_0x191d('0x3a')](_0x1e17ba[_0x191d('0x35')]['fields']));_0x1b716c[_0x191d('0x3b')]=_0x1b716c['attributes'][_0x191d('0x3c')]?_0x1b716c[_0x191d('0x3b')]:_0x26a0d7[_0x191d('0x38')];_0x1b716c[_0x191d('0x57')]=qs[_0x191d('0x3d')](_0x1e17ba[_0x191d('0x35')]['sort']);_0x1b716c[_0x191d('0x41')]=qs['filters'](_[_0x191d('0x3e')](_0x1e17ba[_0x191d('0x35')],_0x26a0d7[_0x191d('0x37')]));if(_0x1e17ba[_0x191d('0x35')][_0x191d('0x3f')]){_0x1b716c['where']=_[_0x191d('0x40')](_0x1b716c[_0x191d('0x41')],{'$or':_[_0x191d('0x31')](_0x1b716c['attributes'],function(_0x5187a5){var _0xb6026e={};_0xb6026e[_0x5187a5]={'$like':'%'+_0x1e17ba[_0x191d('0x35')][_0x191d('0x3f')]+'%'};return _0xb6026e;})});}_0x1b716c=_[_0x191d('0x40')]({},_0x1b716c,_0x1e17ba['options']);return _0x3dc460['getAllConditions'](_0x1b716c);}})['then'](function(_0x4ed001){if(_0x4ed001){_0x9781c2=_0x4ed001[_0x191d('0x3c')];if(!_0x1e17ba[_0x191d('0x35')][_0x191d('0x58')]('nolimit')){_0x1b716c[_0x191d('0x22')]=qs[_0x191d('0x22')](_0x1e17ba[_0x191d('0x35')]['limit']);_0x1b716c['offset']=qs[_0x191d('0x20')](_0x1e17ba['query'][_0x191d('0x20')]);}return _0x3dc460['getAllConditions'](_0x1b716c);}})['then'](function(_0x43f9eb){if(_0x43f9eb){return _0x43f9eb?{'count':_0x9781c2,'rows':_0x43f9eb}:null;}})['then'](respondWithResult(_0x46b5ae,null))[_0x191d('0x47')](handleError(_0x46b5ae,null));};exports[_0x191d('0x59')]=function(_0x142784,_0x1bb806,_0x4ea20a){var _0x302e35={};var _0x23cdc4={};var _0x2a243f;var _0x480251;return db[_0x191d('0x43')][_0x191d('0x5a')]({'where':{'id':_0x142784['params']['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x1bb806,null))[_0x191d('0x28')](function(_0x1dfecf){if(_0x1dfecf){_0x2a243f=_0x1dfecf;_0x23cdc4['model']=_[_0x191d('0x36')](db['Condition'][_0x191d('0x32')]);_0x23cdc4['query']=_['keys'](_0x142784[_0x191d('0x35')]);_0x23cdc4[_0x191d('0x37')]=_[_0x191d('0x39')](_0x23cdc4[_0x191d('0x38')],_0x23cdc4[_0x191d('0x35')]);_0x302e35['attributes']=_[_0x191d('0x39')](_0x23cdc4['model'],qs[_0x191d('0x3a')](_0x142784[_0x191d('0x35')][_0x191d('0x3a')]));_0x302e35['attributes']=_0x302e35[_0x191d('0x3b')][_0x191d('0x3c')]?_0x302e35[_0x191d('0x3b')]:_0x23cdc4[_0x191d('0x38')];_0x302e35[_0x191d('0x57')]=qs[_0x191d('0x3d')](_0x142784[_0x191d('0x35')][_0x191d('0x3d')]);_0x302e35['where']=qs['filters'](_[_0x191d('0x3e')](_0x142784[_0x191d('0x35')],_0x23cdc4[_0x191d('0x37')]));if(_0x142784['query'][_0x191d('0x3f')]){_0x302e35[_0x191d('0x41')]=_['merge'](_0x302e35[_0x191d('0x41')],{'$or':_[_0x191d('0x31')](_0x302e35[_0x191d('0x3b')],function(_0x3dfc2b){var _0x55f1a2={};_0x55f1a2[_0x3dfc2b]={'$like':'%'+_0x142784['query'][_0x191d('0x3f')]+'%'};return _0x55f1a2;})});}_0x302e35=_[_0x191d('0x40')]({},_0x302e35,_0x142784[_0x191d('0x48')]);return _0x2a243f[_0x191d('0x59')](_0x302e35);}})[_0x191d('0x28')](function(_0x22e9c4){if(_0x22e9c4){_0x480251=_0x22e9c4[_0x191d('0x3c')];if(!_0x142784[_0x191d('0x35')]['hasOwnProperty']('nolimit')){_0x302e35[_0x191d('0x22')]=qs[_0x191d('0x22')](_0x142784[_0x191d('0x35')][_0x191d('0x22')]);_0x302e35[_0x191d('0x20')]=qs['offset'](_0x142784[_0x191d('0x35')][_0x191d('0x20')]);}return _0x2a243f['getAnyConditions'](_0x302e35);}})[_0x191d('0x28')](function(_0x34d40e){if(_0x34d40e){return _0x34d40e?{'count':_0x480251,'rows':_0x34d40e}:null;}})['then'](respondWithResult(_0x1bb806,null))[_0x191d('0x47')](handleError(_0x1bb806,null));};exports[_0x191d('0x5b')]=function(_0x2e0c0d,_0x149cb0,_0x2e494f){if(_0x2e0c0d[_0x191d('0x4a')]['id']){delete _0x2e0c0d[_0x191d('0x4a')]['id'];}return db['Trigger'][_0x191d('0x4d')]({'where':{'id':_0x2e0c0d['params']['id']}})['then'](handleEntityNotFound(_0x149cb0,null))[_0x191d('0x28')](function(_0x2ac48a){if(_0x2ac48a){_0x2e0c0d[_0x191d('0x4a')][_0x191d('0x5c')]=_0x2ac48a['id'];return db['Action']['create'](_0x2e0c0d[_0x191d('0x4a')]);}})[_0x191d('0x28')](respondWithResult(_0x149cb0,null))[_0x191d('0x47')](handleError(_0x149cb0,null));};exports['getActions']=function(_0x58a613,_0x590c81,_0x1ed678){var _0x130684={};var _0x424df9={};var _0x135c69;var _0x51dcee;return db[_0x191d('0x43')][_0x191d('0x5a')]({'where':{'id':_0x58a613[_0x191d('0x52')]['id']}})[_0x191d('0x28')](handleEntityNotFound(_0x590c81,null))['then'](function(_0x3d9d33){if(_0x3d9d33){_0x135c69=_0x3d9d33;_0x424df9['model']=_[_0x191d('0x36')](db[_0x191d('0x5d')][_0x191d('0x32')]);_0x424df9[_0x191d('0x35')]=_['keys'](_0x58a613[_0x191d('0x35')]);_0x424df9[_0x191d('0x37')]=_[_0x191d('0x39')](_0x424df9[_0x191d('0x38')],_0x424df9[_0x191d('0x35')]);_0x130684[_0x191d('0x3b')]=_['intersection'](_0x424df9[_0x191d('0x38')],qs[_0x191d('0x3a')](_0x58a613[_0x191d('0x35')][_0x191d('0x3a')]));_0x130684['attributes']=_0x130684[_0x191d('0x3b')][_0x191d('0x3c')]?_0x130684[_0x191d('0x3b')]:_0x424df9[_0x191d('0x38')];_0x130684[_0x191d('0x57')]=qs[_0x191d('0x3d')](_0x58a613['query']['sort']);_0x130684['where']=qs[_0x191d('0x37')](_[_0x191d('0x3e')](_0x58a613[_0x191d('0x35')],_0x424df9[_0x191d('0x37')]));if(_0x58a613['query'][_0x191d('0x3f')]){_0x130684[_0x191d('0x41')]=_[_0x191d('0x40')](_0x130684[_0x191d('0x41')],{'$or':_[_0x191d('0x31')](_0x130684[_0x191d('0x3b')],function(_0x333f62){var _0x338897={};_0x338897[_0x333f62]={'$like':'%'+_0x58a613[_0x191d('0x35')]['filter']+'%'};return _0x338897;})});}_0x130684=_[_0x191d('0x40')]({},_0x130684,_0x58a613[_0x191d('0x48')]);return _0x135c69[_0x191d('0x5e')](_0x130684);}})['then'](function(_0x4e433f){if(_0x4e433f){_0x51dcee=_0x4e433f['length'];if(!_0x58a613[_0x191d('0x35')][_0x191d('0x58')]('nolimit')){_0x130684[_0x191d('0x22')]=qs[_0x191d('0x22')](_0x58a613['query'][_0x191d('0x22')]);_0x130684['offset']=qs[_0x191d('0x20')](_0x58a613[_0x191d('0x35')][_0x191d('0x20')]);}return _0x135c69[_0x191d('0x5e')](_0x130684);}})['then'](function(_0x5a7114){if(_0x5a7114){return _0x5a7114?{'count':_0x51dcee,'rows':_0x5a7114}:null;}})[_0x191d('0x28')](respondWithResult(_0x590c81,null))[_0x191d('0x47')](handleError(_0x590c81,null));}; \ No newline at end of file +var _0x462b=['destroy','get','Triggers','UserProfileResource','end','sendStatus','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','addAllCondition','Condition','addAnyCondition','TriggerAnyId','getAllConditions','hasOwnProperty','nolimit','getAnyConditions','findOne','pick','addAction','TriggerId','getActions','Action','eml-format','fast-json-patch','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x3654f7,_0x372acf){var _0x395aa5=function(_0x187ec0){while(--_0x187ec0){_0x3654f7['push'](_0x3654f7['shift']());}};_0x395aa5(++_0x372acf);}(_0x462b,0xf2));var _0xb462=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x462b[_0x2c91e9];return _0x13f0ff;};'use strict';var emlformat=require(_0xb462('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb462('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb462('0x2'));var path=require('path');var sox=require(_0xb462('0x3'));var csv=require('to-csv');var ejs=require(_0xb462('0x4'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb462('0x5'));var squel=require(_0xb462('0x6'));var crypto=require(_0xb462('0x7'));var jsforce=require(_0xb462('0x8'));var deskjs=require(_0xb462('0x9'));var toCsv=require(_0xb462('0xa'));var querystring=require(_0xb462('0xb'));var Papa=require(_0xb462('0xc'));var Redis=require(_0xb462('0xd'));var authService=require(_0xb462('0xe'));var qs=require(_0xb462('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb462('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb462('0x11'));var licenseUtil=require(_0xb462('0x12'));var db=require(_0xb462('0x13'))['db'];function respondWithStatusCode(_0x51930f,_0x4433b3){_0x4433b3=_0x4433b3||0xcc;return function(_0x1bb333){if(_0x1bb333){return _0x51930f['sendStatus'](_0x4433b3);}return _0x51930f[_0xb462('0x14')](_0x4433b3)['end']();};}function respondWithResult(_0x467749,_0x392233){_0x392233=_0x392233||0xc8;return function(_0x1b9f5f){if(_0x1b9f5f){return _0x467749[_0xb462('0x14')](_0x392233)['json'](_0x1b9f5f);}};}function respondWithFilteredResult(_0x24faf5,_0x2acb2e){return function(_0x301d0c){if(_0x301d0c){var _0x524fc9=typeof _0x2acb2e[_0xb462('0x15')]===_0xb462('0x16')&&typeof _0x2acb2e[_0xb462('0x17')]===_0xb462('0x16');var _0x36dd26=_0x301d0c[_0xb462('0x18')];var _0x4d79dc=_0x524fc9?0x0:_0x2acb2e[_0xb462('0x15')];var _0x3c1fba=_0x524fc9?_0x301d0c[_0xb462('0x18')]:_0x2acb2e['offset']+_0x2acb2e[_0xb462('0x17')];var _0x3e6e10;if(_0x3c1fba>=_0x36dd26){_0x3c1fba=_0x36dd26;_0x3e6e10=0xc8;}else{_0x3e6e10=0xce;}_0x24faf5[_0xb462('0x14')](_0x3e6e10);return _0x24faf5[_0xb462('0x19')](_0xb462('0x1a'),_0x4d79dc+'-'+_0x3c1fba+'/'+_0x36dd26)['json'](_0x301d0c);}return null;};}function patchUpdates(_0x54849e){return function(_0x187b2d){try{jsonpatch[_0xb462('0x1b')](_0x187b2d,_0x54849e,!![]);}catch(_0x216816){return BPromise['reject'](_0x216816);}return _0x187b2d[_0xb462('0x1c')]();};}function saveUpdates(_0x5cdb84,_0x1e1fbd){return function(_0x5a15e8){if(_0x5a15e8){return _0x5a15e8[_0xb462('0x1d')](_0x5cdb84)[_0xb462('0x1e')](function(_0x19e767){return _0x19e767;});}return null;};}function removeEntity(_0x5de92e,_0x2a924e){return function(_0x5d7fbc){if(_0x5d7fbc){return _0x5d7fbc[_0xb462('0x1f')]()[_0xb462('0x1e')](function(){var _0x4d4679=_0x5d7fbc[_0xb462('0x20')]({'plain':!![]});var _0x17b185=_0xb462('0x21');return db[_0xb462('0x22')][_0xb462('0x1f')]({'where':{'type':_0x17b185,'resourceId':_0x4d4679['id']}})[_0xb462('0x1e')](function(){return _0x5d7fbc;});})[_0xb462('0x1e')](function(){_0x5de92e[_0xb462('0x14')](0xcc)[_0xb462('0x23')]();});}};}function handleEntityNotFound(_0x491353,_0x311bfc){return function(_0x41c322){if(!_0x41c322){_0x491353[_0xb462('0x24')](0x194);}return _0x41c322;};}function handleError(_0x5f0f44,_0x407836){_0x407836=_0x407836||0x1f4;return function(_0x274525){logger['error'](_0x274525[_0xb462('0x25')]);if(_0x274525[_0xb462('0x26')]){delete _0x274525[_0xb462('0x26')];}_0x5f0f44[_0xb462('0x14')](_0x407836)[_0xb462('0x27')](_0x274525);};}exports[_0xb462('0x28')]=function(_0x2162bf,_0x5a95be){var _0x1d9d9a={},_0x1ad72d={},_0x4fabc4={'count':0x0,'rows':[]};var _0x11fa93=_['map'](db[_0xb462('0x29')][_0xb462('0x2a')],function(_0x102b43){return{'name':_0x102b43[_0xb462('0x2b')],'type':_0x102b43[_0xb462('0x2c')][_0xb462('0x2d')]};});_0x1ad72d[_0xb462('0x2e')]=_[_0xb462('0x2f')](_0x11fa93,_0xb462('0x26'));_0x1ad72d[_0xb462('0x30')]=_[_0xb462('0x31')](_0x2162bf['query']);_0x1ad72d[_0xb462('0x32')]=_['intersection'](_0x1ad72d[_0xb462('0x2e')],_0x1ad72d[_0xb462('0x30')]);_0x1d9d9a[_0xb462('0x33')]=_[_0xb462('0x34')](_0x1ad72d[_0xb462('0x2e')],qs[_0xb462('0x35')](_0x2162bf['query'][_0xb462('0x35')]));_0x1d9d9a['attributes']=_0x1d9d9a[_0xb462('0x33')][_0xb462('0x36')]?_0x1d9d9a[_0xb462('0x33')]:_0x1ad72d[_0xb462('0x2e')];if(!_0x2162bf['query']['hasOwnProperty']('nolimit')){_0x1d9d9a[_0xb462('0x17')]=qs[_0xb462('0x17')](_0x2162bf[_0xb462('0x30')][_0xb462('0x17')]);_0x1d9d9a[_0xb462('0x15')]=qs['offset'](_0x2162bf['query'][_0xb462('0x15')]);}_0x1d9d9a[_0xb462('0x37')]=qs[_0xb462('0x38')](_0x2162bf['query'][_0xb462('0x38')]);_0x1d9d9a[_0xb462('0x39')]=qs[_0xb462('0x32')](_['pick'](_0x2162bf[_0xb462('0x30')],_0x1ad72d[_0xb462('0x32')]),_0x11fa93);if(_0x2162bf[_0xb462('0x30')][_0xb462('0x3a')]){_0x1d9d9a[_0xb462('0x39')]=_[_0xb462('0x3b')](_0x1d9d9a[_0xb462('0x39')],{'$or':_[_0xb462('0x2f')](_0x11fa93,function(_0x453652){if(_0x453652[_0xb462('0x2c')]!==_0xb462('0x3c')){var _0x3ebe90={};_0x3ebe90[_0x453652['name']]={'$like':'%'+_0x2162bf[_0xb462('0x30')][_0xb462('0x3a')]+'%'};return _0x3ebe90;}})});}_0x1d9d9a=_[_0xb462('0x3b')]({},_0x1d9d9a,_0x2162bf[_0xb462('0x3d')]);var _0xa5eca2={'where':_0x1d9d9a['where']};return db[_0xb462('0x29')][_0xb462('0x18')](_0xa5eca2)['then'](function(_0x2c4446){_0x4fabc4[_0xb462('0x18')]=_0x2c4446;if(_0x2162bf[_0xb462('0x30')][_0xb462('0x3e')]){_0x1d9d9a[_0xb462('0x3f')]=[{'all':!![]}];}return db['Trigger'][_0xb462('0x40')](_0x1d9d9a);})[_0xb462('0x1e')](function(_0x56ff8c){_0x4fabc4[_0xb462('0x41')]=_0x56ff8c;return _0x4fabc4;})[_0xb462('0x1e')](respondWithFilteredResult(_0x5a95be,_0x1d9d9a))[_0xb462('0x42')](handleError(_0x5a95be,null));};exports['show']=function(_0x178ba4,_0x177f75){var _0x16c6f6={'raw':![],'where':{'id':_0x178ba4[_0xb462('0x43')]['id']}},_0x5f57f5={};_0x5f57f5[_0xb462('0x2e')]=_['keys'](db[_0xb462('0x29')][_0xb462('0x2a')]);_0x5f57f5['query']=_[_0xb462('0x31')](_0x178ba4[_0xb462('0x30')]);_0x5f57f5['filters']=_[_0xb462('0x34')](_0x5f57f5[_0xb462('0x2e')],_0x5f57f5[_0xb462('0x30')]);_0x16c6f6[_0xb462('0x33')]=_[_0xb462('0x34')](_0x5f57f5[_0xb462('0x2e')],qs[_0xb462('0x35')](_0x178ba4[_0xb462('0x30')][_0xb462('0x35')]));_0x16c6f6['attributes']=_0x16c6f6[_0xb462('0x33')][_0xb462('0x36')]?_0x16c6f6[_0xb462('0x33')]:_0x5f57f5[_0xb462('0x2e')];if(_0x178ba4[_0xb462('0x30')][_0xb462('0x3e')]){_0x16c6f6[_0xb462('0x3f')]=[{'all':!![]}];}_0x16c6f6=_[_0xb462('0x3b')]({},_0x16c6f6,_0x178ba4[_0xb462('0x3d')]);return db['Trigger']['find'](_0x16c6f6)[_0xb462('0x1e')](handleEntityNotFound(_0x177f75,null))[_0xb462('0x1e')](respondWithResult(_0x177f75,null))[_0xb462('0x42')](handleError(_0x177f75,null));};exports[_0xb462('0x44')]=function(_0x16af95,_0x256370){return db[_0xb462('0x29')][_0xb462('0x44')](_0x16af95[_0xb462('0x45')],{})[_0xb462('0x1e')](function(_0x30a9d8){var _0x367b7d=_0x16af95[_0xb462('0x46')][_0xb462('0x20')]({'plain':!![]});if(!_0x367b7d)throw new Error(_0xb462('0x47'));if(_0x367b7d[_0xb462('0x48')]===_0xb462('0x46')){var _0x491483=_0x30a9d8[_0xb462('0x20')]({'plain':!![]});var _0x327b1b=_0xb462('0x21');return db[_0xb462('0x49')]['find']({'where':{'name':_0x327b1b,'userProfileId':_0x367b7d['userProfileId']},'raw':!![]})[_0xb462('0x1e')](function(_0x18355e){if(_0x18355e&&_0x18355e['autoAssociation']===0x0){return db[_0xb462('0x22')][_0xb462('0x44')]({'name':_0x491483[_0xb462('0x26')],'resourceId':_0x491483['id'],'type':_0x18355e['name'],'sectionId':_0x18355e['id']},{})[_0xb462('0x1e')](function(){return _0x30a9d8;});}else{return _0x30a9d8;}})['catch'](function(_0x452964){logger[_0xb462('0x4a')](_0xb462('0x4b'),_0x452964);throw _0x452964;});}return _0x30a9d8;})['then'](respondWithResult(_0x256370,0xc9))[_0xb462('0x42')](handleError(_0x256370,null));};exports[_0xb462('0x1d')]=function(_0x1ce2ec,_0x158c43){if(_0x1ce2ec[_0xb462('0x45')]['id']){delete _0x1ce2ec[_0xb462('0x45')]['id'];}return db[_0xb462('0x29')]['find']({'where':{'id':_0x1ce2ec[_0xb462('0x43')]['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x158c43,null))[_0xb462('0x1e')](saveUpdates(_0x1ce2ec[_0xb462('0x45')],null))[_0xb462('0x1e')](respondWithResult(_0x158c43,null))[_0xb462('0x42')](handleError(_0x158c43,null));};exports[_0xb462('0x1f')]=function(_0x2c896d,_0x2a37b2){return db[_0xb462('0x29')][_0xb462('0x4c')]({'where':{'id':_0x2c896d[_0xb462('0x43')]['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x2a37b2,null))[_0xb462('0x1e')](removeEntity(_0x2a37b2,null))[_0xb462('0x42')](handleError(_0x2a37b2,null));};exports[_0xb462('0x4d')]=function(_0xdec11a,_0x31419c,_0x22bf79){if(_0xdec11a[_0xb462('0x45')]['id']){delete _0xdec11a[_0xb462('0x45')]['id'];}return db[_0xb462('0x29')][_0xb462('0x4c')]({'where':{'id':_0xdec11a[_0xb462('0x43')]['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x31419c,null))[_0xb462('0x1e')](function(_0x466170){if(_0x466170){_0xdec11a[_0xb462('0x45')]['TriggerAllId']=_0x466170['id'];return db[_0xb462('0x4e')][_0xb462('0x44')](_0xdec11a[_0xb462('0x45')]);}})['then'](respondWithResult(_0x31419c,null))[_0xb462('0x42')](handleError(_0x31419c,null));};exports[_0xb462('0x4f')]=function(_0x2f231a,_0x170d7e,_0x3a6418){if(_0x2f231a['body']['id']){delete _0x2f231a[_0xb462('0x45')]['id'];}return db[_0xb462('0x29')][_0xb462('0x4c')]({'where':{'id':_0x2f231a[_0xb462('0x43')]['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x170d7e,null))[_0xb462('0x1e')](function(_0x44bd57){if(_0x44bd57){_0x2f231a['body'][_0xb462('0x50')]=_0x44bd57['id'];return db[_0xb462('0x4e')][_0xb462('0x44')](_0x2f231a[_0xb462('0x45')]);}})[_0xb462('0x1e')](respondWithResult(_0x170d7e,null))[_0xb462('0x42')](handleError(_0x170d7e,null));};exports[_0xb462('0x51')]=function(_0x2fb277,_0x3c4691,_0xea6e28){var _0x21fc71={};var _0x859fd4={};var _0x120d11;var _0x752469;return db[_0xb462('0x29')]['findOne']({'where':{'id':_0x2fb277[_0xb462('0x43')]['id']}})['then'](handleEntityNotFound(_0x3c4691,null))[_0xb462('0x1e')](function(_0x2d4359){if(_0x2d4359){_0x120d11=_0x2d4359;_0x859fd4[_0xb462('0x2e')]=_['keys'](db[_0xb462('0x4e')][_0xb462('0x2a')]);_0x859fd4[_0xb462('0x30')]=_[_0xb462('0x31')](_0x2fb277[_0xb462('0x30')]);_0x859fd4[_0xb462('0x32')]=_[_0xb462('0x34')](_0x859fd4[_0xb462('0x2e')],_0x859fd4[_0xb462('0x30')]);_0x21fc71['attributes']=_['intersection'](_0x859fd4[_0xb462('0x2e')],qs[_0xb462('0x35')](_0x2fb277[_0xb462('0x30')][_0xb462('0x35')]));_0x21fc71[_0xb462('0x33')]=_0x21fc71['attributes'][_0xb462('0x36')]?_0x21fc71[_0xb462('0x33')]:_0x859fd4[_0xb462('0x2e')];_0x21fc71[_0xb462('0x37')]=qs['sort'](_0x2fb277[_0xb462('0x30')][_0xb462('0x38')]);_0x21fc71[_0xb462('0x39')]=qs[_0xb462('0x32')](_['pick'](_0x2fb277[_0xb462('0x30')],_0x859fd4['filters']));if(_0x2fb277[_0xb462('0x30')][_0xb462('0x3a')]){_0x21fc71['where']=_['merge'](_0x21fc71[_0xb462('0x39')],{'$or':_[_0xb462('0x2f')](_0x21fc71['attributes'],function(_0x501ce9){var _0x48ccaf={};_0x48ccaf[_0x501ce9]={'$like':'%'+_0x2fb277[_0xb462('0x30')][_0xb462('0x3a')]+'%'};return _0x48ccaf;})});}_0x21fc71=_[_0xb462('0x3b')]({},_0x21fc71,_0x2fb277[_0xb462('0x3d')]);return _0x120d11[_0xb462('0x51')](_0x21fc71);}})[_0xb462('0x1e')](function(_0x145d97){if(_0x145d97){_0x752469=_0x145d97['length'];if(!_0x2fb277[_0xb462('0x30')][_0xb462('0x52')](_0xb462('0x53'))){_0x21fc71[_0xb462('0x17')]=qs[_0xb462('0x17')](_0x2fb277[_0xb462('0x30')][_0xb462('0x17')]);_0x21fc71[_0xb462('0x15')]=qs[_0xb462('0x15')](_0x2fb277[_0xb462('0x30')]['offset']);}return _0x120d11[_0xb462('0x51')](_0x21fc71);}})['then'](function(_0xf67c6c){if(_0xf67c6c){return _0xf67c6c?{'count':_0x752469,'rows':_0xf67c6c}:null;}})[_0xb462('0x1e')](respondWithResult(_0x3c4691,null))[_0xb462('0x42')](handleError(_0x3c4691,null));};exports[_0xb462('0x54')]=function(_0x34bb29,_0xd39b6c,_0xe32d69){var _0x526386={};var _0x19c26f={};var _0x1dd737;var _0x28b181;return db[_0xb462('0x29')][_0xb462('0x55')]({'where':{'id':_0x34bb29[_0xb462('0x43')]['id']}})['then'](handleEntityNotFound(_0xd39b6c,null))[_0xb462('0x1e')](function(_0x1cf08e){if(_0x1cf08e){_0x1dd737=_0x1cf08e;_0x19c26f[_0xb462('0x2e')]=_['keys'](db[_0xb462('0x4e')][_0xb462('0x2a')]);_0x19c26f[_0xb462('0x30')]=_['keys'](_0x34bb29[_0xb462('0x30')]);_0x19c26f[_0xb462('0x32')]=_[_0xb462('0x34')](_0x19c26f['model'],_0x19c26f[_0xb462('0x30')]);_0x526386[_0xb462('0x33')]=_['intersection'](_0x19c26f[_0xb462('0x2e')],qs[_0xb462('0x35')](_0x34bb29[_0xb462('0x30')]['fields']));_0x526386[_0xb462('0x33')]=_0x526386[_0xb462('0x33')]['length']?_0x526386[_0xb462('0x33')]:_0x19c26f['model'];_0x526386[_0xb462('0x37')]=qs[_0xb462('0x38')](_0x34bb29[_0xb462('0x30')]['sort']);_0x526386['where']=qs[_0xb462('0x32')](_[_0xb462('0x56')](_0x34bb29[_0xb462('0x30')],_0x19c26f[_0xb462('0x32')]));if(_0x34bb29[_0xb462('0x30')][_0xb462('0x3a')]){_0x526386[_0xb462('0x39')]=_[_0xb462('0x3b')](_0x526386[_0xb462('0x39')],{'$or':_[_0xb462('0x2f')](_0x526386['attributes'],function(_0x516b79){var _0x1bc5c0={};_0x1bc5c0[_0x516b79]={'$like':'%'+_0x34bb29[_0xb462('0x30')][_0xb462('0x3a')]+'%'};return _0x1bc5c0;})});}_0x526386=_[_0xb462('0x3b')]({},_0x526386,_0x34bb29[_0xb462('0x3d')]);return _0x1dd737[_0xb462('0x54')](_0x526386);}})[_0xb462('0x1e')](function(_0x337996){if(_0x337996){_0x28b181=_0x337996[_0xb462('0x36')];if(!_0x34bb29[_0xb462('0x30')][_0xb462('0x52')]('nolimit')){_0x526386[_0xb462('0x17')]=qs[_0xb462('0x17')](_0x34bb29[_0xb462('0x30')][_0xb462('0x17')]);_0x526386[_0xb462('0x15')]=qs[_0xb462('0x15')](_0x34bb29['query'][_0xb462('0x15')]);}return _0x1dd737[_0xb462('0x54')](_0x526386);}})[_0xb462('0x1e')](function(_0x163a1f){if(_0x163a1f){return _0x163a1f?{'count':_0x28b181,'rows':_0x163a1f}:null;}})[_0xb462('0x1e')](respondWithResult(_0xd39b6c,null))[_0xb462('0x42')](handleError(_0xd39b6c,null));};exports[_0xb462('0x57')]=function(_0x2d856c,_0x32e19c,_0x260394){if(_0x2d856c[_0xb462('0x45')]['id']){delete _0x2d856c[_0xb462('0x45')]['id'];}return db['Trigger'][_0xb462('0x4c')]({'where':{'id':_0x2d856c['params']['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x32e19c,null))['then'](function(_0x125f81){if(_0x125f81){_0x2d856c['body'][_0xb462('0x58')]=_0x125f81['id'];return db['Action'][_0xb462('0x44')](_0x2d856c[_0xb462('0x45')]);}})[_0xb462('0x1e')](respondWithResult(_0x32e19c,null))[_0xb462('0x42')](handleError(_0x32e19c,null));};exports[_0xb462('0x59')]=function(_0x347cb6,_0x3eceeb,_0x523dd0){var _0xc4e18d={};var _0xb567c0={};var _0x3665a6;var _0x523ad9;return db[_0xb462('0x29')][_0xb462('0x55')]({'where':{'id':_0x347cb6[_0xb462('0x43')]['id']}})[_0xb462('0x1e')](handleEntityNotFound(_0x3eceeb,null))[_0xb462('0x1e')](function(_0x2ac354){if(_0x2ac354){_0x3665a6=_0x2ac354;_0xb567c0[_0xb462('0x2e')]=_[_0xb462('0x31')](db[_0xb462('0x5a')]['rawAttributes']);_0xb567c0[_0xb462('0x30')]=_[_0xb462('0x31')](_0x347cb6[_0xb462('0x30')]);_0xb567c0['filters']=_[_0xb462('0x34')](_0xb567c0[_0xb462('0x2e')],_0xb567c0[_0xb462('0x30')]);_0xc4e18d[_0xb462('0x33')]=_[_0xb462('0x34')](_0xb567c0['model'],qs['fields'](_0x347cb6[_0xb462('0x30')][_0xb462('0x35')]));_0xc4e18d[_0xb462('0x33')]=_0xc4e18d['attributes'][_0xb462('0x36')]?_0xc4e18d[_0xb462('0x33')]:_0xb567c0['model'];_0xc4e18d[_0xb462('0x37')]=qs[_0xb462('0x38')](_0x347cb6[_0xb462('0x30')]['sort']);_0xc4e18d[_0xb462('0x39')]=qs[_0xb462('0x32')](_[_0xb462('0x56')](_0x347cb6[_0xb462('0x30')],_0xb567c0[_0xb462('0x32')]));if(_0x347cb6[_0xb462('0x30')]['filter']){_0xc4e18d['where']=_[_0xb462('0x3b')](_0xc4e18d[_0xb462('0x39')],{'$or':_['map'](_0xc4e18d['attributes'],function(_0x50cc7f){var _0x42c3c8={};_0x42c3c8[_0x50cc7f]={'$like':'%'+_0x347cb6[_0xb462('0x30')][_0xb462('0x3a')]+'%'};return _0x42c3c8;})});}_0xc4e18d=_[_0xb462('0x3b')]({},_0xc4e18d,_0x347cb6['options']);return _0x3665a6[_0xb462('0x59')](_0xc4e18d);}})[_0xb462('0x1e')](function(_0x454e8b){if(_0x454e8b){_0x523ad9=_0x454e8b['length'];if(!_0x347cb6[_0xb462('0x30')][_0xb462('0x52')](_0xb462('0x53'))){_0xc4e18d[_0xb462('0x17')]=qs['limit'](_0x347cb6['query'][_0xb462('0x17')]);_0xc4e18d[_0xb462('0x15')]=qs[_0xb462('0x15')](_0x347cb6[_0xb462('0x30')]['offset']);}return _0x3665a6[_0xb462('0x59')](_0xc4e18d);}})[_0xb462('0x1e')](function(_0x7ac6b6){if(_0x7ac6b6){return _0x7ac6b6?{'count':_0x523ad9,'rows':_0x7ac6b6}:null;}})['then'](respondWithResult(_0x3eceeb,null))['catch'](handleError(_0x3eceeb,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 43d7dfa..4d8b7c3 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 _0x8ebf=['lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','Trigger','tools_triggers'];(function(_0x2e7915,_0x5cbbe8){var _0x4acb50=function(_0x4ecae1){while(--_0x4ecae1){_0x2e7915['push'](_0x2e7915['shift']());}};_0x4acb50(++_0x5cbbe8);}(_0x8ebf,0x15c));var _0xf8eb=function(_0x342700,_0x569f75){_0x342700=_0x342700-0x0;var _0x53406f=_0x8ebf[_0x342700];return _0x53406f;};'use strict';var _=require(_0xf8eb('0x0'));var util=require(_0xf8eb('0x1'));var logger=require(_0xf8eb('0x2'))('api');var moment=require(_0xf8eb('0x3'));var BPromise=require(_0xf8eb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8eb('0x5'));var rimraf=require(_0xf8eb('0x6'));var config=require(_0xf8eb('0x7'));var attributes=require('./trigger.attributes');module[_0xf8eb('0x8')]=function(_0x36fde3,_0x4cbeaa){return _0x36fde3[_0xf8eb('0x9')](_0xf8eb('0xa'),attributes,{'tableName':_0xf8eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ce1=['bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','exports','define','Trigger','lodash','util','../../config/logger','api','moment'];(function(_0x37a45b,_0x1056ef){var _0x35f3bb=function(_0x5d73cd){while(--_0x5d73cd){_0x37a45b['push'](_0x37a45b['shift']());}};_0x35f3bb(++_0x1056ef);}(_0x8ce1,0x183));var _0x18ce=function(_0x587b01,_0x2f8f33){_0x587b01=_0x587b01-0x0;var _0x5620cd=_0x8ce1[_0x587b01];return _0x5620cd;};'use strict';var _=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var logger=require(_0x18ce('0x2'))(_0x18ce('0x3'));var moment=require(_0x18ce('0x4'));var BPromise=require(_0x18ce('0x5'));var rp=require(_0x18ce('0x6'));var fs=require('fs');var path=require(_0x18ce('0x7'));var rimraf=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var attributes=require(_0x18ce('0xa'));module[_0x18ce('0xb')]=function(_0x13ff9d,_0x36f8db){return _0x13ff9d[_0x18ce('0xc')](_0x18ce('0xd'),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 80797af..5ff0d6e 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 _0xc7fc=['GetTrigger','debug','ShowTrigger','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Trigger','options','raw','where','attributes','limit','map','include','model'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xc7fc,0xf9));var _0xcc7f=function(_0x5b8320,_0x2ab5e5){_0x5b8320=_0x5b8320-0x0;var _0x5239ff=_0xc7fc[_0x5b8320];return _0x5239ff;};'use strict';var _=require('lodash');var util=require(_0xcc7f('0x0'));var moment=require(_0xcc7f('0x1'));var BPromise=require(_0xcc7f('0x2'));var rs=require(_0xcc7f('0x3'));var fs=require('fs');var Redis=require(_0xcc7f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xcc7f('0x5'));var logger=require(_0xcc7f('0x6'))(_0xcc7f('0x7'));var config=require(_0xcc7f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcc7f('0x9')][_0xcc7f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3ea0a2,_0x492498,_0xad2b39){return new BPromise(function(_0xa0fb75,_0x265a02){return client[_0xcc7f('0xb')](_0x3ea0a2,_0xad2b39)[_0xcc7f('0xc')](function(_0x38bc0e){logger[_0xcc7f('0xd')]('Trigger,\x20%s,\x20%s',_0x492498,_0xcc7f('0xe'));logger['debug'](_0xcc7f('0xf'),_0x492498,_0xcc7f('0xe'),JSON[_0xcc7f('0x10')](_0x38bc0e));if(_0x38bc0e[_0xcc7f('0x11')]){if(_0x38bc0e['error'][_0xcc7f('0x12')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x492498,_0x38bc0e[_0xcc7f('0x11')][_0xcc7f('0x13')]);return _0x265a02(_0x38bc0e[_0xcc7f('0x11')]['message']);}logger[_0xcc7f('0x11')]('Trigger,\x20%s,\x20%s',_0x492498,_0x38bc0e[_0xcc7f('0x11')][_0xcc7f('0x13')]);return _0xa0fb75(_0x38bc0e['error'][_0xcc7f('0x13')]);}else{logger[_0xcc7f('0xd')]('Trigger,\x20%s,\x20%s',_0x492498,_0xcc7f('0xe'));_0xa0fb75(_0x38bc0e[_0xcc7f('0x14')][_0xcc7f('0x13')]);}})[_0xcc7f('0x15')](function(_0x4c5274){logger['error']('Trigger,\x20%s,\x20%s',_0x492498,_0x4c5274);_0x265a02(_0x4c5274);});});}exports['GetTrigger']=function(_0x5f41d4){var _0x48c347=this;return new Promise(function(_0x250349,_0x16004c){return db[_0xcc7f('0x16')]['findAll']({'raw':_0x5f41d4[_0xcc7f('0x17')]?_0x5f41d4[_0xcc7f('0x17')][_0xcc7f('0x18')]===undefined?!![]:![]:!![],'where':_0x5f41d4['options']?_0x5f41d4[_0xcc7f('0x17')][_0xcc7f('0x19')]||null:null,'attributes':_0x5f41d4[_0xcc7f('0x17')]?_0x5f41d4[_0xcc7f('0x17')][_0xcc7f('0x1a')]||null:null,'limit':_0x5f41d4[_0xcc7f('0x17')]?_0x5f41d4[_0xcc7f('0x17')][_0xcc7f('0x1b')]||null:null,'include':_0x5f41d4[_0xcc7f('0x17')]?_0x5f41d4['options']['include']?_[_0xcc7f('0x1c')](_0x5f41d4['options'][_0xcc7f('0x1d')],function(_0x5a6220){return{'model':db[_0x5a6220[_0xcc7f('0x1e')]],'as':_0x5a6220['as'],'attributes':_0x5a6220[_0xcc7f('0x1a')],'include':_0x5a6220[_0xcc7f('0x1d')]?_['map'](_0x5a6220[_0xcc7f('0x1d')],function(_0x3ba129){return{'model':db[_0x3ba129[_0xcc7f('0x1e')]],'as':_0x3ba129['as'],'attributes':_0x3ba129[_0xcc7f('0x1a')],'include':_0x3ba129[_0xcc7f('0x1d')]?_[_0xcc7f('0x1c')](_0x3ba129[_0xcc7f('0x1d')],function(_0x2e3aa0){return{'model':db[_0x2e3aa0[_0xcc7f('0x1e')]],'as':_0x2e3aa0['as'],'attributes':_0x2e3aa0[_0xcc7f('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xcc7f('0xc')](function(_0xaf0e06){logger['info'](_0xcc7f('0x1f'),_0x5f41d4);logger[_0xcc7f('0x20')](_0xcc7f('0x1f'),_0x5f41d4,JSON[_0xcc7f('0x10')](_0xaf0e06));_0x250349(_0xaf0e06);})['catch'](function(_0x306b5d){logger[_0xcc7f('0x11')](_0xcc7f('0x1f'),_0x306b5d[_0xcc7f('0x13')],_0x5f41d4);_0x16004c(_0x48c347[_0xcc7f('0x11')](0x1f4,_0x306b5d['message']));});});};exports[_0xcc7f('0x21')]=function(_0x2f595c){var _0x45acb8=this;return new Promise(function(_0x2f355e,_0x1f97eb){return db['Trigger'][_0xcc7f('0x22')]({'raw':_0x2f595c[_0xcc7f('0x17')]?_0x2f595c[_0xcc7f('0x17')][_0xcc7f('0x18')]===undefined?!![]:![]:!![],'where':_0x2f595c[_0xcc7f('0x17')]?_0x2f595c['options'][_0xcc7f('0x19')]||null:null,'attributes':_0x2f595c[_0xcc7f('0x17')]?_0x2f595c[_0xcc7f('0x17')]['attributes']||null:null,'include':_0x2f595c[_0xcc7f('0x17')]?_0x2f595c['options'][_0xcc7f('0x1d')]?_['map'](_0x2f595c[_0xcc7f('0x17')][_0xcc7f('0x1d')],function(_0x35c17f){return{'model':db[_0x35c17f[_0xcc7f('0x1e')]],'as':_0x35c17f['as'],'attributes':_0x35c17f['attributes'],'include':_0x35c17f[_0xcc7f('0x1d')]?_['map'](_0x35c17f[_0xcc7f('0x1d')],function(_0x455013){return{'model':db[_0x455013['model']],'as':_0x455013['as'],'attributes':_0x455013[_0xcc7f('0x1a')],'include':_0x455013[_0xcc7f('0x1d')]?_[_0xcc7f('0x1c')](_0x455013['include'],function(_0x28d61a){return{'model':db[_0x28d61a[_0xcc7f('0x1e')]],'as':_0x28d61a['as'],'attributes':_0x28d61a[_0xcc7f('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce610){logger[_0xcc7f('0xd')](_0xcc7f('0x21'),_0x2f595c);logger[_0xcc7f('0x20')]('ShowTrigger',_0x2f595c,JSON['stringify'](_0x1ce610));_0x2f355e(_0x1ce610);})[_0xcc7f('0x15')](function(_0x4eb80f){logger[_0xcc7f('0x11')](_0xcc7f('0x21'),_0x4eb80f['message'],_0x2f595c);_0x1f97eb(_0x45acb8[_0xcc7f('0x11')](0x1f4,_0x4eb80f[_0xcc7f('0x13')]));});});}; \ No newline at end of file +var _0x6585=['model','GetTrigger','ShowTrigger','find','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','info','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','Trigger','findAll','options','where','attributes','limit','include','map'];(function(_0x502be5,_0x55e06b){var _0x820b75=function(_0x16f30a){while(--_0x16f30a){_0x502be5['push'](_0x502be5['shift']());}};_0x820b75(++_0x55e06b);}(_0x6585,0x14f));var _0x5658=function(_0x310926,_0x226e01){_0x310926=_0x310926-0x0;var _0x205927=_0x6585[_0x310926];return _0x205927;};'use strict';var _=require(_0x5658('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5658('0x1'));var rs=require(_0x5658('0x2'));var fs=require('fs');var Redis=require(_0x5658('0x3'));var db=require(_0x5658('0x4'))['db'];var utils=require(_0x5658('0x5'));var logger=require(_0x5658('0x6'))(_0x5658('0x7'));var config=require(_0x5658('0x8'));var jayson=require(_0x5658('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2ad63a,_0x2f9bd2,_0x246e38){return new BPromise(function(_0x2a8658,_0x548cde){return client['request'](_0x2ad63a,_0x246e38)['then'](function(_0x5850c3){logger[_0x5658('0xa')](_0x5658('0xb'),_0x2f9bd2,_0x5658('0xc'));logger[_0x5658('0xd')](_0x5658('0xe'),_0x2f9bd2,_0x5658('0xc'),JSON[_0x5658('0xf')](_0x5850c3));if(_0x5850c3[_0x5658('0x10')]){if(_0x5850c3['error'][_0x5658('0x11')]===0x1f4){logger[_0x5658('0x10')](_0x5658('0xb'),_0x2f9bd2,_0x5850c3[_0x5658('0x10')]['message']);return _0x548cde(_0x5850c3[_0x5658('0x10')][_0x5658('0x12')]);}logger['error'](_0x5658('0xb'),_0x2f9bd2,_0x5850c3[_0x5658('0x10')]['message']);return _0x2a8658(_0x5850c3[_0x5658('0x10')][_0x5658('0x12')]);}else{logger[_0x5658('0xa')](_0x5658('0xb'),_0x2f9bd2,_0x5658('0xc'));_0x2a8658(_0x5850c3['result']['message']);}})[_0x5658('0x13')](function(_0x299368){logger[_0x5658('0x10')](_0x5658('0xb'),_0x2f9bd2,_0x299368);_0x548cde(_0x299368);});});}exports['GetTrigger']=function(_0x1c2f98){var _0x5ac262=this;return new Promise(function(_0x134ddd,_0x21a44b){return db[_0x5658('0x14')][_0x5658('0x15')]({'raw':_0x1c2f98[_0x5658('0x16')]?_0x1c2f98[_0x5658('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1c2f98['options']?_0x1c2f98[_0x5658('0x16')][_0x5658('0x17')]||null:null,'attributes':_0x1c2f98[_0x5658('0x16')]?_0x1c2f98[_0x5658('0x16')][_0x5658('0x18')]||null:null,'limit':_0x1c2f98[_0x5658('0x16')]?_0x1c2f98[_0x5658('0x16')][_0x5658('0x19')]||null:null,'include':_0x1c2f98[_0x5658('0x16')]?_0x1c2f98[_0x5658('0x16')][_0x5658('0x1a')]?_[_0x5658('0x1b')](_0x1c2f98[_0x5658('0x16')][_0x5658('0x1a')],function(_0x1ea9e1){return{'model':db[_0x1ea9e1[_0x5658('0x1c')]],'as':_0x1ea9e1['as'],'attributes':_0x1ea9e1[_0x5658('0x18')],'include':_0x1ea9e1[_0x5658('0x1a')]?_['map'](_0x1ea9e1[_0x5658('0x1a')],function(_0x5868ba){return{'model':db[_0x5868ba['model']],'as':_0x5868ba['as'],'attributes':_0x5868ba[_0x5658('0x18')],'include':_0x5868ba['include']?_[_0x5658('0x1b')](_0x5868ba['include'],function(_0x59d879){return{'model':db[_0x59d879['model']],'as':_0x59d879['as'],'attributes':_0x59d879[_0x5658('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x107d11){logger[_0x5658('0xa')]('GetTrigger',_0x1c2f98);logger['debug'](_0x5658('0x1d'),_0x1c2f98,JSON[_0x5658('0xf')](_0x107d11));_0x134ddd(_0x107d11);})[_0x5658('0x13')](function(_0x3d1909){logger[_0x5658('0x10')](_0x5658('0x1d'),_0x3d1909[_0x5658('0x12')],_0x1c2f98);_0x21a44b(_0x5ac262[_0x5658('0x10')](0x1f4,_0x3d1909['message']));});});};exports[_0x5658('0x1e')]=function(_0x1df54a){var _0x445861=this;return new Promise(function(_0x761ba6,_0x250503){return db['Trigger'][_0x5658('0x1f')]({'raw':_0x1df54a[_0x5658('0x16')]?_0x1df54a[_0x5658('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1df54a[_0x5658('0x16')]?_0x1df54a[_0x5658('0x16')][_0x5658('0x17')]||null:null,'attributes':_0x1df54a[_0x5658('0x16')]?_0x1df54a['options']['attributes']||null:null,'include':_0x1df54a[_0x5658('0x16')]?_0x1df54a[_0x5658('0x16')][_0x5658('0x1a')]?_[_0x5658('0x1b')](_0x1df54a[_0x5658('0x16')]['include'],function(_0x568c19){return{'model':db[_0x568c19[_0x5658('0x1c')]],'as':_0x568c19['as'],'attributes':_0x568c19[_0x5658('0x18')],'include':_0x568c19[_0x5658('0x1a')]?_[_0x5658('0x1b')](_0x568c19[_0x5658('0x1a')],function(_0x339a99){return{'model':db[_0x339a99[_0x5658('0x1c')]],'as':_0x339a99['as'],'attributes':_0x339a99[_0x5658('0x18')],'include':_0x339a99[_0x5658('0x1a')]?_['map'](_0x339a99[_0x5658('0x1a')],function(_0x1a2c1a){return{'model':db[_0x1a2c1a[_0x5658('0x1c')]],'as':_0x1a2c1a['as'],'attributes':_0x1a2c1a['attributes']};}):[]};}):[]};}):[]:[]})[_0x5658('0x20')](function(_0x3c88b4){logger[_0x5658('0xa')](_0x5658('0x1e'),_0x1df54a);logger[_0x5658('0xd')](_0x5658('0x1e'),_0x1df54a,JSON['stringify'](_0x3c88b4));_0x761ba6(_0x3c88b4);})[_0x5658('0x13')](function(_0x540dfa){logger[_0x5658('0x10')]('ShowTrigger',_0x540dfa[_0x5658('0x12')],_0x1df54a);_0x250503(_0x445861[_0x5658('0x10')](0x1f4,_0x540dfa[_0x5658('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index d72efa5..57d657b 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 _0x5caf=['create','put','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id','show','post','/:id/clone'];(function(_0x3f9576,_0x13e949){var _0x468b01=function(_0xbfc4b3){while(--_0xbfc4b3){_0x3f9576['push'](_0x3f9576['shift']());}};_0x468b01(++_0x13e949);}(_0x5caf,0x17e));var _0xf5ca=function(_0x2e3f7f,_0x31f7df){_0x2e3f7f=_0x2e3f7f-0x0;var _0x3bf2b5=_0x5caf[_0x2e3f7f];return _0x3bf2b5;};'use strict';var multer=require(_0xf5ca('0x0'));var util=require(_0xf5ca('0x1'));var path=require(_0xf5ca('0x2'));var timeout=require(_0xf5ca('0x3'));var express=require('express');var router=express[_0xf5ca('0x4')]();var fs_extra=require(_0xf5ca('0x5'));var auth=require(_0xf5ca('0x6'));var interaction=require(_0xf5ca('0x7'));var config=require(_0xf5ca('0x8'));var controller=require(_0xf5ca('0x9'));router[_0xf5ca('0xa')]('/',auth[_0xf5ca('0xb')](),controller[_0xf5ca('0xc')]);router['get'](_0xf5ca('0xd'),auth[_0xf5ca('0xb')](),controller[_0xf5ca('0xe')]);router[_0xf5ca('0xf')](_0xf5ca('0x10'),auth[_0xf5ca('0xb')](),controller['clone']);router[_0xf5ca('0xf')]('/',auth[_0xf5ca('0xb')](),controller[_0xf5ca('0x11')]);router[_0xf5ca('0x12')](_0xf5ca('0xd'),auth[_0xf5ca('0xb')](),controller['update']);router[_0xf5ca('0x13')](_0xf5ca('0xd'),auth[_0xf5ca('0xb')](),controller[_0xf5ca('0x14')]);module['exports']=router; \ No newline at end of file +var _0xfe9b=['get','isAuthenticated','index','/:id','show','/:id/clone','clone','post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./trunk.controller'];(function(_0x21da27,_0x4a7829){var _0x10e1b0=function(_0x34c0a1){while(--_0x34c0a1){_0x21da27['push'](_0x21da27['shift']());}};_0x10e1b0(++_0x4a7829);}(_0xfe9b,0x1b0));var _0xbfe9=function(_0xb7e5ce,_0x5b8fcf){_0xb7e5ce=_0xb7e5ce-0x0;var _0x10233d=_0xfe9b[_0xb7e5ce];return _0x10233d;};'use strict';var multer=require(_0xbfe9('0x0'));var util=require(_0xbfe9('0x1'));var path=require(_0xbfe9('0x2'));var timeout=require(_0xbfe9('0x3'));var express=require(_0xbfe9('0x4'));var router=express[_0xbfe9('0x5')]();var fs_extra=require(_0xbfe9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbfe9('0x7'));var controller=require(_0xbfe9('0x8'));router[_0xbfe9('0x9')]('/',auth[_0xbfe9('0xa')](),controller[_0xbfe9('0xb')]);router[_0xbfe9('0x9')](_0xbfe9('0xc'),auth[_0xbfe9('0xa')](),controller[_0xbfe9('0xd')]);router['post'](_0xbfe9('0xe'),auth['isAuthenticated'](),controller[_0xbfe9('0xf')]);router[_0xbfe9('0x10')]('/',auth[_0xbfe9('0xa')](),controller[_0xbfe9('0x11')]);router['put'](_0xbfe9('0xc'),auth[_0xbfe9('0xa')](),controller[_0xbfe9('0x12')]);router[_0xbfe9('0x13')](_0xbfe9('0xc'),auth[_0xbfe9('0xa')](),controller['destroy']);module[_0xbfe9('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4dca2eb..4b28b76 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 _0xc764=['info','shortinfo','inband','auto','nonat','outgoing','join','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','yes','port,invite','insecure','INTEGER','\x22\x22\x20<>','always','accept','uac','uas','fingerprint','certificate','active','passive','actpass','dynamic','update','update,nonat','sequelize','exports','STRING','name','ENUM','friend','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','setDataValue','transport','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833'];(function(_0x118593,_0x1bd29d){var _0x365db0=function(_0x11d7c4){while(--_0x11d7c4){_0x118593['push'](_0x118593['shift']());}};_0x365db0(++_0x1bd29d);}(_0xc764,0x81));var _0x4c76=function(_0x28568d,_0x5772a7){_0x28568d=_0x28568d-0x0;var _0xb47329=_0xc764[_0x28568d];return _0xb47329;};'use strict';var Sequelize=require(_0x4c76('0x0'));module[_0x4c76('0x1')]={'name':{'type':Sequelize[_0x4c76('0x2')],'allowNull':![],'unique':_0x4c76('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x5'),'user',_0x4c76('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x4c76('0x2')],'allowNull':![],'defaultValue':_0x4c76('0x7')},'callingpres':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x8'),_0x4c76('0x9'),_0x4c76('0xa'),_0x4c76('0xb'),_0x4c76('0xc'),_0x4c76('0xd'),_0x4c76('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x4c76('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize[_0x4c76('0x2')]},'remotesecret':{'type':Sequelize[_0x4c76('0x2')]},'transport':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':'udp','set':function(_0x5074ad){this[_0x4c76('0xf')](_0x4c76('0x10'),_0x5074ad?_0x5074ad['join'](','):null);},'get':function(){return this[_0x4c76('0x11')]('transport')?this[_0x4c76('0x11')](_0x4c76('0x10'))[_0x4c76('0x12')](','):null;},'comment':_0x4c76('0x13')},'dtmfmode':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x14'),_0x4c76('0x15'),_0x4c76('0x16'),_0x4c76('0x17'),_0x4c76('0x18')),'defaultValue':_0x4c76('0x14')},'directmedia':{'type':Sequelize[_0x4c76('0x4')]('yes','no',_0x4c76('0x19'),'update',_0x4c76('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x4c76('0x2')]},'directmediadeny':{'type':Sequelize[_0x4c76('0x2')]},'nat':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x1a9ca0){this[_0x4c76('0xf')]('nat',_0x1a9ca0?_0x1a9ca0[_0x4c76('0x1b')](','):null);},'get':function(){return this[_0x4c76('0x11')](_0x4c76('0x1c'))?this['getDataValue'](_0x4c76('0x1c'))[_0x4c76('0x12')](','):null;},'comment':_0x4c76('0x1d')},'callgroup':{'type':Sequelize[_0x4c76('0x2')]},'namedcallgroup':{'type':Sequelize[_0x4c76('0x2')]},'pickupgroup':{'type':Sequelize[_0x4c76('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x4c76('0x2')]},'language':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x4c76('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize[_0x4c76('0x2')],'allowNull':![],'defaultValue':_0x4c76('0x1e'),'set':function(_0x3d3f81){this['setDataValue']('allow',_0x3d3f81?_0x3d3f81[_0x4c76('0x1b')](';'):_0x4c76('0x1e'));},'get':function(){return this[_0x4c76('0x11')](_0x4c76('0x1f'))?this[_0x4c76('0x11')](_0x4c76('0x1f'))[_0x4c76('0x12')](';'):null;},'comment':_0x4c76('0x20')},'autoframing':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no')},'insecure':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':_0x4c76('0x22'),'set':function(_0x3a6988){this[_0x4c76('0xf')](_0x4c76('0x23'),_0x3a6988?_0x3a6988['join'](','):null);},'get':function(){return this[_0x4c76('0x11')](_0x4c76('0x23'))?this[_0x4c76('0x11')](_0x4c76('0x23'))[_0x4c76('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no','never')},'promiscredir':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'useclientcode':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no')},'accountcode':{'type':Sequelize[_0x4c76('0x24')](0xb)},'setvar':{'type':Sequelize[_0x4c76('0x2')]},'callerid':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':_0x4c76('0x25')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no'),'defaultValue':_0x4c76('0x21')},'busylevel':{'type':Sequelize[_0x4c76('0x24')](0xb)},'allowoverlap':{'type':Sequelize[_0x4c76('0x4')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x4c76('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'ignoresdpversion':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x4c76('0x2')]},'videosupport':{'type':Sequelize[_0x4c76('0x4')]('yes','no',_0x4c76('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x4c76('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x4c76('0x4')]('yes','no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x27'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x4c76('0x24')](0xb)},'session_minse':{'type':Sequelize[_0x4c76('0x24')](0xb)},'session_refresher':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x28'),_0x4c76('0x29')),'defaultValue':_0x4c76('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0x4c76('0x2')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize['STRING']},'fromuser':{'type':Sequelize[_0x4c76('0x2')]},'port':{'type':Sequelize['INTEGER'](0x5)},'qualify':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no'),'defaultValue':_0x4c76('0x21')},'keepalive':{'type':Sequelize[_0x4c76('0x24')](0xb)},'defaultip':{'type':Sequelize[_0x4c76('0x2')]},'defaultuser':{'type':Sequelize[_0x4c76('0x2')]},'rtptimeout':{'type':Sequelize[_0x4c76('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x4c76('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x4c76('0x24')](0xb)},'sendrpid':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x4c76('0x2')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0x4c76('0x24')](0xb)},'timerb':{'type':Sequelize[_0x4c76('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x4c76('0x2')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x4c76('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x4c76('0x24')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no')},'force_avp':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'icesupport':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'dtlsenable':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'dtlsverify':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no',_0x4c76('0x2a'),_0x4c76('0x2b'))},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x4c76('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0x4c76('0x2')]},'dtlscipher':{'type':Sequelize[_0x4c76('0x2')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize[_0x4c76('0x2')]},'dtlssetup':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x2c'),_0x4c76('0x2d'),_0x4c76('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING']},'usereqphone':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x4c76('0x2')]},'recordofffeature':{'type':Sequelize[_0x4c76('0x2')]},'call_limit':{'type':Sequelize[_0x4c76('0x24')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x4c76('0x4')](_0x4c76('0x21'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x4c76('0x21'),'no')},'vmexten':{'type':Sequelize[_0x4c76('0x2')]},'mohinterpret':{'type':Sequelize[_0x4c76('0x2')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x4c76('0x2')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x4c76('0x2')],'defaultValue':_0x4c76('0x2f')},'canreinvite':{'type':Sequelize[_0x4c76('0x4')]('yes','no',_0x4c76('0x19'),_0x4c76('0x30'),_0x4c76('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x4c76('0x2')]},'otherFields':{'type':Sequelize[_0x4c76('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x5d81=['ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','allow','port,invite','insecure','yes','never','INTEGER','accept','refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','update,nonat','exports','STRING','name','peer','ENUM','ALLOWED_NOT_SCREENED'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x5d81,0x135));var _0x15d8=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x5d81[_0x24f31b];return _0x488401;};'use strict';var Sequelize=require('sequelize');module[_0x15d8('0x0')]={'name':{'type':Sequelize[_0x15d8('0x1')],'allowNull':![],'unique':_0x15d8('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('friend','user',_0x15d8('0x3')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x5'),'ALLOWED_PASSED_SCREEN',_0x15d8('0x6'),_0x15d8('0x7'),_0x15d8('0x8'),'PROHIB_PASSED_SCREEN',_0x15d8('0x9'),_0x15d8('0xa'))},'deny':{'type':Sequelize[_0x15d8('0x1')]},'permit':{'type':Sequelize[_0x15d8('0x1')]},'secret':{'type':Sequelize[_0x15d8('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':'udp','set':function(_0x1d5191){this[_0x15d8('0xb')]('transport',_0x1d5191?_0x1d5191[_0x15d8('0xc')](','):null);},'get':function(){return this[_0x15d8('0xd')](_0x15d8('0xe'))?this[_0x15d8('0xd')](_0x15d8('0xe'))[_0x15d8('0xf')](','):null;},'comment':_0x15d8('0x10')},'dtmfmode':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x11'),_0x15d8('0x12'),_0x15d8('0x13'),_0x15d8('0x14'),_0x15d8('0x15')),'defaultValue':_0x15d8('0x11')},'directmedia':{'type':Sequelize[_0x15d8('0x4')]('yes','no',_0x15d8('0x16'),_0x15d8('0x17'),_0x15d8('0x18')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x15d8('0x4')]('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize[_0x15d8('0x1')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x15d8('0x19'),'set':function(_0x20332b){this[_0x15d8('0xb')](_0x15d8('0x1a'),_0x20332b?_0x20332b[_0x15d8('0xc')](','):null);},'get':function(){return this[_0x15d8('0xd')](_0x15d8('0x1a'))?this[_0x15d8('0xd')](_0x15d8('0x1a'))[_0x15d8('0xf')](','):null;},'comment':_0x15d8('0x1b')},'callgroup':{'type':Sequelize[_0x15d8('0x1')]},'namedcallgroup':{'type':Sequelize[_0x15d8('0x1')]},'pickupgroup':{'type':Sequelize[_0x15d8('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x15d8('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x15d8('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0xaffbb3){this['setDataValue'](_0x15d8('0x1c'),_0xaffbb3?_0xaffbb3[_0x15d8('0xc')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0x15d8('0x1c'))?this[_0x15d8('0xd')](_0x15d8('0x1c'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x15d8('0x4')]('yes','no')},'insecure':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':_0x15d8('0x1d'),'set':function(_0x537e99){this[_0x15d8('0xb')](_0x15d8('0x1e'),_0x537e99?_0x537e99[_0x15d8('0xc')](','):null);},'get':function(){return this['getDataValue'](_0x15d8('0x1e'))?this[_0x15d8('0xd')](_0x15d8('0x1e'))[_0x15d8('0xf')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0x15d8('0x1f'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x15d8('0x1f'),'no',_0x15d8('0x20'))},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'accountcode':{'type':Sequelize[_0x15d8('0x21')](0xb)},'setvar':{'type':Sequelize[_0x15d8('0x1')]},'callerid':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x15d8('0x1')]},'callcounter':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no'),'defaultValue':'yes'},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'allowsubscribe':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'allowtransfer':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'ignoresdpversion':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'subscribecontext':{'type':Sequelize[_0x15d8('0x1')]},'template':{'type':Sequelize[_0x15d8('0x1')]},'videosupport':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'mailbox':{'type':Sequelize['STRING']},'session_timers':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x22'),_0x15d8('0x23'),_0x15d8('0x24'))},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0x15d8('0x21')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x15d8('0x25'),_0x15d8('0x26')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x15d8('0x1')]},'regexten':{'type':Sequelize[_0x15d8('0x1')]},'fromdomain':{'type':Sequelize[_0x15d8('0x1')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x15d8('0x21')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0x15d8('0x1f'),'no'),'defaultValue':_0x15d8('0x1f')},'keepalive':{'type':Sequelize[_0x15d8('0x21')](0xb)},'defaultip':{'type':Sequelize[_0x15d8('0x1')]},'defaultuser':{'type':Sequelize[_0x15d8('0x1')]},'rtptimeout':{'type':Sequelize[_0x15d8('0x21')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x15d8('0x21')](0xb)},'sendrpid':{'type':Sequelize[_0x15d8('0x4')]('yes','no',_0x15d8('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x15d8('0x1')]},'callbackextension':{'type':Sequelize[_0x15d8('0x1')]},'timert1':{'type':Sequelize[_0x15d8('0x21')](0xb)},'timerb':{'type':Sequelize[_0x15d8('0x21')](0xb)},'qualifyfreq':{'type':Sequelize[_0x15d8('0x21')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x15d8('0x1')]},'contactacl':{'type':Sequelize[_0x15d8('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x15d8('0x1')]},'use_q850_reason':{'type':Sequelize[_0x15d8('0x1')]},'maxforwards':{'type':Sequelize[_0x15d8('0x21')](0xb)},'encryption':{'type':Sequelize[_0x15d8('0x4')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'force_avp':{'type':Sequelize[_0x15d8('0x4')]('yes','no')},'icesupport':{'type':Sequelize['ENUM'](_0x15d8('0x1f'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0x15d8('0x1f'),'no')},'dtlsverify':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no',_0x15d8('0x28'),'certificate')},'dtlsrekey':{'type':Sequelize[_0x15d8('0x21')](0xb)},'dtlscertfile':{'type':Sequelize[_0x15d8('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x15d8('0x1')]},'dtlscipher':{'type':Sequelize[_0x15d8('0x1')]},'dtlscafile':{'type':Sequelize[_0x15d8('0x1')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x29'),_0x15d8('0x2a'),_0x15d8('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x15d8('0x1')]},'usereqphone':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x15d8('0x1')]},'recordofffeature':{'type':Sequelize[_0x15d8('0x1')]},'call_limit':{'type':Sequelize[_0x15d8('0x21')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no')},'subscribemwi':{'type':Sequelize[_0x15d8('0x4')]('yes','no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x15d8('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x15d8('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x15d8('0x4')](_0x15d8('0x1f'),'no',_0x15d8('0x16'),_0x15d8('0x17'),_0x15d8('0x2c')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x15d8('0x1')]},'otherFields':{'type':Sequelize[_0x15d8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x15d8('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index 485e4f5..0ee2fb0 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 _0xf2ca=['omit','createdAt','body','updatedAt','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','registry','/etc/asterisk/sip_xcally_registers.conf','Unable\x20to\x20retrieve\x20the\x20current\x20user','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','count','set','Content-Range','apply','save','update','destroy','get','Trunks','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','show','params','Trunk','find','clone'];(function(_0xee472,_0x1d6c22){var _0x40cfd4=function(_0x27dfcc){while(--_0x27dfcc){_0xee472['push'](_0xee472['shift']());}};_0x40cfd4(++_0x1d6c22);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x558e45,_0x4f5e4f){_0x558e45=_0x558e45-0x0;var _0x3e9075=_0xf2ca[_0x558e45];return _0x3e9075;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];var jayson=require(_0xaf2c('0x18'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x15ccb4,_0x8eaf9b,_0x935959,_0x18a8a5){return new BPromise(function(_0x293ca6,_0x152c73){var _0x214f47=_0x18a8a5||client;return _0x214f47[_0xaf2c('0x19')](_0x15ccb4,_0x935959)[_0xaf2c('0x1a')](function(_0x1d0633){logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,_0xaf2c('0x1d'));logger[_0xaf2c('0x1e')](_0xaf2c('0x1f'),_0x8eaf9b,'request\x20sent',JSON[_0xaf2c('0x20')](_0x1d0633));if(_0x1d0633['error']){if(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x22')]===0x1f4){logger[_0xaf2c('0x21')]('Trunk,\x20%s,\x20%s',_0x8eaf9b,_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);return _0x152c73(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}logger[_0xaf2c('0x21')](_0xaf2c('0x1c'),_0x8eaf9b,_0x1d0633['error'][_0xaf2c('0x23')]);return _0x293ca6(_0x1d0633[_0xaf2c('0x21')][_0xaf2c('0x23')]);}else{logger[_0xaf2c('0x1b')](_0xaf2c('0x1c'),_0x8eaf9b,'request\x20sent');_0x293ca6(_0x1d0633[_0xaf2c('0x24')][_0xaf2c('0x23')]);}})[_0xaf2c('0x25')](function(_0x4be6ed){logger['error'](_0xaf2c('0x1c'),_0x8eaf9b,_0x4be6ed);_0x152c73(_0x4be6ed);});});}function respondWithStatusCode(_0x303546,_0x1cafad){_0x1cafad=_0x1cafad||0xcc;return function(_0x99f78d){if(_0x99f78d){return _0x303546['sendStatus'](_0x1cafad);}return _0x303546[_0xaf2c('0x26')](_0x1cafad)[_0xaf2c('0x27')]();};}function respondWithResult(_0x3a0145,_0x3c1ae6){_0x3c1ae6=_0x3c1ae6||0xc8;return function(_0xe929b5){if(_0xe929b5){return _0x3a0145[_0xaf2c('0x26')](_0x3c1ae6)[_0xaf2c('0x28')](_0xe929b5);}};}function respondWithFilteredResult(_0x4a8dd8,_0x29f8b0){return function(_0x2051be){if(_0x2051be){var _0x36f37c=typeof _0x29f8b0[_0xaf2c('0x29')]==='undefined'&&typeof _0x29f8b0[_0xaf2c('0x2a')]==='undefined';var _0x38db1b=_0x2051be[_0xaf2c('0x2b')];var _0x15466b=_0x36f37c?0x0:_0x29f8b0['offset'];var _0x2747bb=_0x36f37c?_0x2051be[_0xaf2c('0x2b')]:_0x29f8b0[_0xaf2c('0x29')]+_0x29f8b0['limit'];var _0xe18ba7;if(_0x2747bb>=_0x38db1b){_0x2747bb=_0x38db1b;_0xe18ba7=0xc8;}else{_0xe18ba7=0xce;}_0x4a8dd8[_0xaf2c('0x26')](_0xe18ba7);return _0x4a8dd8[_0xaf2c('0x2c')](_0xaf2c('0x2d'),_0x15466b+'-'+_0x2747bb+'/'+_0x38db1b)['json'](_0x2051be);}return null;};}function patchUpdates(_0x3da072){return function(_0x4072ff){try{jsonpatch[_0xaf2c('0x2e')](_0x4072ff,_0x3da072,!![]);}catch(_0x51a49c){return BPromise['reject'](_0x51a49c);}return _0x4072ff[_0xaf2c('0x2f')]();};}function saveUpdates(_0x4c9b4f,_0x39c0ed){return function(_0x5e7247){if(_0x5e7247){return _0x5e7247[_0xaf2c('0x30')](_0x4c9b4f)[_0xaf2c('0x1a')](function(_0x4ffbb9){return _0x4ffbb9;});}return null;};}function removeEntity(_0x1408e3,_0x5403f8){return function(_0x54db57){if(_0x54db57){return _0x54db57[_0xaf2c('0x31')]()[_0xaf2c('0x1a')](function(){var _0x211a69=_0x54db57[_0xaf2c('0x32')]({'plain':!![]});var _0x2d6ed7=_0xaf2c('0x33');return db['UserProfileResource'][_0xaf2c('0x31')]({'where':{'type':_0x2d6ed7,'resourceId':_0x211a69['id']}})['then'](function(){return _0x54db57;});})[_0xaf2c('0x1a')](function(){_0x1408e3['status'](0xcc)[_0xaf2c('0x27')]();});}};}function handleEntityNotFound(_0x59f686,_0x2f3d16){return function(_0x4e877e){if(!_0x4e877e){_0x59f686[_0xaf2c('0x34')](0x194);}return _0x4e877e;};}function handleError(_0x4b9c6b,_0x30fd87){_0x30fd87=_0x30fd87||0x1f4;return function(_0x356402){logger[_0xaf2c('0x21')](_0x356402[_0xaf2c('0x35')]);if(_0x356402[_0xaf2c('0x36')]){delete _0x356402['name'];}_0x4b9c6b['status'](_0x30fd87)[_0xaf2c('0x37')](_0x356402);};}exports[_0xaf2c('0x38')]=function(_0x409700,_0xa44813){var _0x4eeecf={},_0x316238={},_0x573db3={'count':0x0,'rows':[]};var _0xa1248e=_[_0xaf2c('0x39')](db['Trunk'][_0xaf2c('0x3a')],function(_0x24668d){return{'name':_0x24668d[_0xaf2c('0x3b')],'type':_0x24668d[_0xaf2c('0x3c')][_0xaf2c('0x3d')]};});_0x316238[_0xaf2c('0x3e')]=_[_0xaf2c('0x39')](_0xa1248e,_0xaf2c('0x36'));_0x316238[_0xaf2c('0x3f')]=_[_0xaf2c('0x40')](_0x409700[_0xaf2c('0x3f')]);_0x316238[_0xaf2c('0x41')]=_[_0xaf2c('0x42')](_0x316238['model'],_0x316238['query']);_0x4eeecf['attributes']=_[_0xaf2c('0x42')](_0x316238[_0xaf2c('0x3e')],qs[_0xaf2c('0x43')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x4eeecf[_0xaf2c('0x44')]=_0x4eeecf['attributes'][_0xaf2c('0x45')]?_0x4eeecf[_0xaf2c('0x44')]:_0x316238[_0xaf2c('0x3e')];if(!_0x409700['query']['hasOwnProperty'](_0xaf2c('0x46'))){_0x4eeecf['limit']=qs[_0xaf2c('0x2a')](_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x2a')]);_0x4eeecf[_0xaf2c('0x29')]=qs['offset'](_0x409700[_0xaf2c('0x3f')]['offset']);}_0x4eeecf[_0xaf2c('0x47')]=qs[_0xaf2c('0x48')](_0x409700['query'][_0xaf2c('0x48')]);_0x4eeecf['where']=qs[_0xaf2c('0x41')](_[_0xaf2c('0x49')](_0x409700[_0xaf2c('0x3f')],_0x316238[_0xaf2c('0x41')]),_0xa1248e);if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]){_0x4eeecf[_0xaf2c('0x4b')]=_[_0xaf2c('0x4c')](_0x4eeecf[_0xaf2c('0x4b')],{'$or':_['map'](_0xa1248e,function(_0x51d751){if(_0x51d751[_0xaf2c('0x3c')]!=='VIRTUAL'){var _0x4ad36e={};_0x4ad36e[_0x51d751['name']]={'$like':'%'+_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4a')]+'%'};return _0x4ad36e;}})});}_0x4eeecf=_[_0xaf2c('0x4c')]({},_0x4eeecf,_0x409700[_0xaf2c('0x4d')]);var _0x599b2d={'where':_0x4eeecf[_0xaf2c('0x4b')]};return db['Trunk'][_0xaf2c('0x2b')](_0x599b2d)['then'](function(_0x166c26){_0x573db3[_0xaf2c('0x2b')]=_0x166c26;if(_0x409700[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x4eeecf[_0xaf2c('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xaf2c('0x50')](_0x4eeecf);})[_0xaf2c('0x1a')](function(_0x4b3ca4){_0x573db3['rows']=_0x4b3ca4;return _0x573db3;})[_0xaf2c('0x1a')](respondWithFilteredResult(_0xa44813,_0x4eeecf))['catch'](handleError(_0xa44813,null));};exports[_0xaf2c('0x51')]=function(_0x23642b,_0x17b9ec){var _0x315b9f={'raw':![],'where':{'id':_0x23642b[_0xaf2c('0x52')]['id']}},_0x367112={};_0x367112[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x367112[_0xaf2c('0x3f')]=_['keys'](_0x23642b[_0xaf2c('0x3f')]);_0x367112[_0xaf2c('0x41')]=_['intersection'](_0x367112['model'],_0x367112['query']);_0x315b9f[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x367112['model'],qs[_0xaf2c('0x43')](_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x315b9f[_0xaf2c('0x44')]=_0x315b9f[_0xaf2c('0x44')][_0xaf2c('0x45')]?_0x315b9f[_0xaf2c('0x44')]:_0x367112['model'];if(_0x23642b[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x315b9f['include']=[{'all':!![]}];}_0x315b9f=_[_0xaf2c('0x4c')]({},_0x315b9f,_0x23642b[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x315b9f)[_0xaf2c('0x1a')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x1a')](respondWithResult(_0x17b9ec,null))[_0xaf2c('0x25')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x55')]=function(_0x19b82d,_0x300254){var _0x133678={'where':{'id':_0x19b82d[_0xaf2c('0x52')]['id']}},_0x10a270={};_0x10a270[_0xaf2c('0x3e')]=_[_0xaf2c('0x40')](db[_0xaf2c('0x53')][_0xaf2c('0x3a')]);_0x133678[_0xaf2c('0x44')]=_[_0xaf2c('0x42')](_0x10a270[_0xaf2c('0x3e')],qs['fields'](_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x43')]));_0x133678[_0xaf2c('0x44')]=_0x133678['attributes'][_0xaf2c('0x45')]?_0x133678['attributes']:_0x10a270[_0xaf2c('0x3e')];if(_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]){_0x133678[_0xaf2c('0x4f')]=[{'all':!![]}];}_0x133678=_[_0xaf2c('0x4c')]({},_0x133678,_0x19b82d[_0xaf2c('0x4d')]);return db[_0xaf2c('0x53')][_0xaf2c('0x54')](_0x133678)[_0xaf2c('0x1a')](handleEntityNotFound(_0x300254,null))['then'](function(_0x41d08b){if(_0x41d08b){var _0x400dcd=_0x41d08b[_0xaf2c('0x32')]({'plain':!![]});_0x400dcd=qs[_0xaf2c('0x56')](_0x400dcd,['id',_0xaf2c('0x57'),'updatedAt']);_0x19b82d[_0xaf2c('0x58')]=_[_0xaf2c('0x56')](_0x19b82d['body'],['id',_0xaf2c('0x57'),_0xaf2c('0x59')]);return db['Trunk']['create'](_[_0xaf2c('0x4c')](_0x400dcd,_0x19b82d[_0xaf2c('0x58')]),{'include':_0x19b82d[_0xaf2c('0x3f')][_0xaf2c('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x36b6f0){var _0x3f48f1=_0x19b82d['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3f48f1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f48f1[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x16e9f4=_0x36b6f0[_0xaf2c('0x32')]({'plain':!![]});var _0x1a297e=_0xaf2c('0x33');return db[_0xaf2c('0x5c')][_0xaf2c('0x54')]({'where':{'name':_0x1a297e,'userProfileId':_0x3f48f1[_0xaf2c('0x5d')]},'raw':!![]})[_0xaf2c('0x1a')](function(_0x53ba41){if(_0x53ba41&&_0x53ba41[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')][_0xaf2c('0x60')]({'name':_0x16e9f4[_0xaf2c('0x36')],'resourceId':_0x16e9f4['id'],'type':_0x53ba41[_0xaf2c('0x36')],'sectionId':_0x53ba41['id']},{})['then'](function(){return _0x36b6f0;});}else{return _0x36b6f0;}})[_0xaf2c('0x25')](function(_0x28b09f){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x28b09f);throw _0x28b09f;});}return _0x36b6f0;});}})[_0xaf2c('0x1a')](respondWithResult(_0x300254,0xc9))['catch'](handleError(_0x300254,null));};exports['create']=function(_0x1166c9,_0x1ead61,_0x5849f8){var _0xf96361;return db[_0xaf2c('0x53')][_0xaf2c('0x60')](_0x1166c9['body'],{'raw':!![]})[_0xaf2c('0x1a')](function(_0x2bd845){_0xf96361=_0x2bd845;return db[_0xaf2c('0x53')][_0xaf2c('0x50')]({'raw':!![]});})['then'](function(_0x32d552){var _0x26129c=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2767c7=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x5d965c=ejs[_0xaf2c('0x67')](_0x26129c,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')]('/etc/asterisk/sip_xcally_trunks.conf',_0x5d965c);if(_0xf96361[_0xaf2c('0x69')]){var _0x5a95ac=ejs['render'](_0x2767c7,{'trunks':_0x32d552||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6a'),_0x5a95ac);}})[_0xaf2c('0x1a')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0xaf2c('0x1a')](function(){var _0x3e972c=_0x1166c9['user'][_0xaf2c('0x32')]({'plain':!![]});if(!_0x3e972c)throw new Error(_0xaf2c('0x6b'));if(_0x3e972c[_0xaf2c('0x5a')]===_0xaf2c('0x5b')){var _0x6e1837=_0xf96361[_0xaf2c('0x32')]({'plain':!![]});return db['UserProfileSection'][_0xaf2c('0x54')]({'where':{'name':_0xaf2c('0x33'),'userProfileId':_0x3e972c[_0xaf2c('0x5d')]},'raw':!![]})['then'](function(_0xc9dd21){if(_0xc9dd21&&_0xc9dd21[_0xaf2c('0x5e')]===0x0){return db[_0xaf2c('0x5f')]['create']({'name':_0x6e1837[_0xaf2c('0x36')],'resourceId':_0x6e1837['id'],'type':_0xc9dd21[_0xaf2c('0x36')],'sectionId':_0xc9dd21['id']},{})[_0xaf2c('0x1a')](function(){return _0xf96361;});}else{return _0xf96361;}})[_0xaf2c('0x25')](function(_0x491160){logger[_0xaf2c('0x21')](_0xaf2c('0x61'),_0x491160);throw _0x491160;});}return _0xf96361;})[_0xaf2c('0x1a')](respondWithResult(_0x1ead61,0xc9))['catch'](handleError(_0x1ead61,null));};exports['update']=function(_0x427ece,_0x1b7dc1,_0x5571eb){var _0x3675d9;return db[_0xaf2c('0x53')]['find']({'where':{'id':_0x427ece[_0xaf2c('0x52')]['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1b7dc1,null))[_0xaf2c('0x1a')](saveUpdates(_0x427ece[_0xaf2c('0x58')],null))[_0xaf2c('0x1a')](function(_0x4af252){if(_0x4af252){_0x3675d9=_0x4af252;return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});}})[_0xaf2c('0x1a')](function(_0x55b568){if(_0x55b568){var _0x4f378e=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x4b9fdc=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x6c')),_0xaf2c('0x66'));var _0x41c707=ejs['render'](_0x4f378e,{'trunks':_0x55b568||[]});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x41c707);var _0x483774=ejs['render'](_0x4b9fdc,{'trunks':_0x55b568||[]});fs['writeFileSync'](_0xaf2c('0x6a'),_0x483774);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x30'),{'module':_0xaf2c('0x6f')});}return null;})['then'](function(_0x19fbd5){if(_0x19fbd5){return _0x3675d9;}})[_0xaf2c('0x1a')](respondWithResult(_0x1b7dc1,null))[_0xaf2c('0x25')](handleError(_0x1b7dc1,null));};exports[_0xaf2c('0x31')]=function(_0x4ddf95,_0x1e8fc0,_0x23aeac){var _0x41590;return db[_0xaf2c('0x53')][_0xaf2c('0x54')]({'where':{'id':_0x4ddf95['params']['id']}})[_0xaf2c('0x1a')](handleEntityNotFound(_0x1e8fc0,null))[_0xaf2c('0x1a')](removeEntity(_0x1e8fc0,null))['then'](function(){return db['Trunk'][_0xaf2c('0x50')]({'raw':!![]});})[_0xaf2c('0x1a')](function(_0x5bce65){var _0x1e6a12=fs[_0xaf2c('0x62')](path[_0xaf2c('0x63')](config[_0xaf2c('0x64')],_0xaf2c('0x65')),_0xaf2c('0x66'));var _0x2a3cb4=fs[_0xaf2c('0x62')](path['join'](config[_0xaf2c('0x64')],'server/files/templates/registry.ejs'),_0xaf2c('0x66'));var _0x7724cc=ejs['render'](_0x1e6a12,{'trunks':_0x5bce65});var _0x4a9ea8=ejs[_0xaf2c('0x67')](_0x2a3cb4,{'trunks':_0x5bce65});fs[_0xaf2c('0x68')](_0xaf2c('0x6d'),_0x7724cc);fs['writeFileSync'](_0xaf2c('0x6a'),_0x4a9ea8);return respondWithRpcPromise(_0xaf2c('0x6e'),_0xaf2c('0x31'),{'module':'chan_sip.so'});})['catch'](handleError(_0x1e8fc0,null));}; \ No newline at end of file +var _0x81bd=['/etc/asterisk/sip_xcally_trunks.conf','registry','render','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','update','server/files/templates/trunk.ejs','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','destroy','UserProfileResource','name','index','Trunk','rawAttributes','fieldName','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','clone','find','get','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Trunks','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','server/files/templates/registry.ejs','utf8','writeFileSync'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x81bd,0x7c));var _0xd81b=function(_0x2bf8f2,_0x27c758){_0x2bf8f2=_0x2bf8f2-0x0;var _0x1ba2fa=_0x81bd[_0x2bf8f2];return _0x1ba2fa;};'use strict';var emlformat=require(_0xd81b('0x0'));var rimraf=require(_0xd81b('0x1'));var zipdir=require(_0xd81b('0x2'));var jsonpatch=require(_0xd81b('0x3'));var rp=require(_0xd81b('0x4'));var moment=require(_0xd81b('0x5'));var BPromise=require(_0xd81b('0x6'));var Mustache=require('mustache');var util=require(_0xd81b('0x7'));var path=require(_0xd81b('0x8'));var sox=require(_0xd81b('0x9'));var csv=require('to-csv');var ejs=require(_0xd81b('0xa'));var fs=require('fs');var fs_extra=require(_0xd81b('0xb'));var _=require(_0xd81b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd81b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd81b('0xe'));var querystring=require(_0xd81b('0xf'));var Papa=require(_0xd81b('0x10'));var Redis=require(_0xd81b('0x11'));var authService=require(_0xd81b('0x12'));var qs=require(_0xd81b('0x13'));var as=require(_0xd81b('0x14'));var hardwareService=require(_0xd81b('0x15'));var logger=require(_0xd81b('0x16'))(_0xd81b('0x17'));var utils=require(_0xd81b('0x18'));var config=require(_0xd81b('0x19'));var licenseUtil=require(_0xd81b('0x1a'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd81b('0x1b'));var client=jayson['client'][_0xd81b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0xe75568,_0x5f0b6b,_0x35a053,_0x47dd04){return new BPromise(function(_0x13dd00,_0x41bf7a){var _0x6c6041=_0x47dd04||client;return _0x6c6041[_0xd81b('0x1d')](_0xe75568,_0x35a053)[_0xd81b('0x1e')](function(_0x552215){logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');logger[_0xd81b('0x21')](_0xd81b('0x22'),_0x5f0b6b,_0xd81b('0x23'),JSON[_0xd81b('0x24')](_0x552215));if(_0x552215[_0xd81b('0x25')]){if(_0x552215[_0xd81b('0x25')][_0xd81b('0x26')]===0x1f4){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);return _0x41bf7a(_0x552215[_0xd81b('0x25')][_0xd81b('0x27')]);}logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0x552215[_0xd81b('0x25')]['message']);return _0x13dd00(_0x552215['error'][_0xd81b('0x27')]);}else{logger[_0xd81b('0x1f')](_0xd81b('0x20'),_0x5f0b6b,'request\x20sent');_0x13dd00(_0x552215[_0xd81b('0x28')][_0xd81b('0x27')]);}})['catch'](function(_0xcd6474){logger[_0xd81b('0x25')](_0xd81b('0x20'),_0x5f0b6b,_0xcd6474);_0x41bf7a(_0xcd6474);});});}function respondWithStatusCode(_0x1ad65c,_0x279176){_0x279176=_0x279176||0xcc;return function(_0xcb4f91){if(_0xcb4f91){return _0x1ad65c[_0xd81b('0x29')](_0x279176);}return _0x1ad65c[_0xd81b('0x2a')](_0x279176)[_0xd81b('0x2b')]();};}function respondWithResult(_0x212c4e,_0x2ccedf){_0x2ccedf=_0x2ccedf||0xc8;return function(_0x1bf351){if(_0x1bf351){return _0x212c4e['status'](_0x2ccedf)[_0xd81b('0x2c')](_0x1bf351);}};}function respondWithFilteredResult(_0x99dbc9,_0xe3637a){return function(_0x31b9fd){if(_0x31b9fd){var _0x3266c2=typeof _0xe3637a[_0xd81b('0x2d')]===_0xd81b('0x2e')&&typeof _0xe3637a[_0xd81b('0x2f')]===_0xd81b('0x2e');var _0x483a3d=_0x31b9fd[_0xd81b('0x30')];var _0x4e2eff=_0x3266c2?0x0:_0xe3637a['offset'];var _0xb9ff9f=_0x3266c2?_0x31b9fd[_0xd81b('0x30')]:_0xe3637a['offset']+_0xe3637a['limit'];var _0x4093c8;if(_0xb9ff9f>=_0x483a3d){_0xb9ff9f=_0x483a3d;_0x4093c8=0xc8;}else{_0x4093c8=0xce;}_0x99dbc9[_0xd81b('0x2a')](_0x4093c8);return _0x99dbc9[_0xd81b('0x31')](_0xd81b('0x32'),_0x4e2eff+'-'+_0xb9ff9f+'/'+_0x483a3d)[_0xd81b('0x2c')](_0x31b9fd);}return null;};}function patchUpdates(_0x4654ba){return function(_0x5527ed){try{jsonpatch[_0xd81b('0x33')](_0x5527ed,_0x4654ba,!![]);}catch(_0x26f629){return BPromise['reject'](_0x26f629);}return _0x5527ed['save']();};}function saveUpdates(_0x165892,_0x1966b1){return function(_0x50472a){if(_0x50472a){return _0x50472a['update'](_0x165892)['then'](function(_0x322991){return _0x322991;});}return null;};}function removeEntity(_0x3ead68,_0x1d2f46){return function(_0x1c4cf7){if(_0x1c4cf7){return _0x1c4cf7[_0xd81b('0x34')]()[_0xd81b('0x1e')](function(){var _0x29aabf=_0x1c4cf7['get']({'plain':!![]});var _0x28782f='Trunks';return db[_0xd81b('0x35')][_0xd81b('0x34')]({'where':{'type':_0x28782f,'resourceId':_0x29aabf['id']}})[_0xd81b('0x1e')](function(){return _0x1c4cf7;});})[_0xd81b('0x1e')](function(){_0x3ead68[_0xd81b('0x2a')](0xcc)[_0xd81b('0x2b')]();});}};}function handleEntityNotFound(_0x1c20d3,_0x2d23b9){return function(_0xf9d1a5){if(!_0xf9d1a5){_0x1c20d3[_0xd81b('0x29')](0x194);}return _0xf9d1a5;};}function handleError(_0x1be4e2,_0x3c8371){_0x3c8371=_0x3c8371||0x1f4;return function(_0x346038){logger['error'](_0x346038['stack']);if(_0x346038[_0xd81b('0x36')]){delete _0x346038[_0xd81b('0x36')];}_0x1be4e2[_0xd81b('0x2a')](_0x3c8371)['send'](_0x346038);};}exports[_0xd81b('0x37')]=function(_0x37ba34,_0x5a236a){var _0x46f058={},_0xaa9e97={},_0x512e39={'count':0x0,'rows':[]};var _0xed5272=_['map'](db[_0xd81b('0x38')][_0xd81b('0x39')],function(_0x203365){return{'name':_0x203365[_0xd81b('0x3a')],'type':_0x203365['type'][_0xd81b('0x3b')]};});_0xaa9e97[_0xd81b('0x3c')]=_[_0xd81b('0x3d')](_0xed5272,_0xd81b('0x36'));_0xaa9e97[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x37ba34[_0xd81b('0x3e')]);_0xaa9e97['filters']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],_0xaa9e97[_0xd81b('0x3e')]);_0x46f058['attributes']=_[_0xd81b('0x40')](_0xaa9e97[_0xd81b('0x3c')],qs[_0xd81b('0x41')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x46f058['attributes']=_0x46f058[_0xd81b('0x42')][_0xd81b('0x43')]?_0x46f058[_0xd81b('0x42')]:_0xaa9e97[_0xd81b('0x3c')];if(!_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x44')](_0xd81b('0x45'))){_0x46f058[_0xd81b('0x2f')]=qs[_0xd81b('0x2f')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2f')]);_0x46f058['offset']=qs[_0xd81b('0x2d')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x2d')]);}_0x46f058[_0xd81b('0x46')]=qs[_0xd81b('0x47')](_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x47')]);_0x46f058[_0xd81b('0x48')]=qs['filters'](_['pick'](_0x37ba34[_0xd81b('0x3e')],_0xaa9e97[_0xd81b('0x49')]),_0xed5272);if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]){_0x46f058[_0xd81b('0x48')]=_[_0xd81b('0x4b')](_0x46f058[_0xd81b('0x48')],{'$or':_[_0xd81b('0x3d')](_0xed5272,function(_0x2fa588){if(_0x2fa588[_0xd81b('0x4c')]!==_0xd81b('0x4d')){var _0x38e436={};_0x38e436[_0x2fa588['name']]={'$like':'%'+_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4a')]+'%'};return _0x38e436;}})});}_0x46f058=_[_0xd81b('0x4b')]({},_0x46f058,_0x37ba34[_0xd81b('0x4e')]);var _0x105a48={'where':_0x46f058[_0xd81b('0x48')]};return db[_0xd81b('0x38')][_0xd81b('0x30')](_0x105a48)[_0xd81b('0x1e')](function(_0x53ea36){_0x512e39[_0xd81b('0x30')]=_0x53ea36;if(_0x37ba34[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x46f058[_0xd81b('0x50')]=[{'all':!![]}];}return db['Trunk'][_0xd81b('0x51')](_0x46f058);})[_0xd81b('0x1e')](function(_0x15030b){_0x512e39[_0xd81b('0x52')]=_0x15030b;return _0x512e39;})[_0xd81b('0x1e')](respondWithFilteredResult(_0x5a236a,_0x46f058))[_0xd81b('0x53')](handleError(_0x5a236a,null));};exports[_0xd81b('0x54')]=function(_0x43d7ce,_0x133a76){var _0x49cba6={'raw':![],'where':{'id':_0x43d7ce[_0xd81b('0x55')]['id']}},_0x534d10={};_0x534d10[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db[_0xd81b('0x38')][_0xd81b('0x39')]);_0x534d10[_0xd81b('0x3e')]=_[_0xd81b('0x3f')](_0x43d7ce[_0xd81b('0x3e')]);_0x534d10['filters']=_[_0xd81b('0x40')](_0x534d10[_0xd81b('0x3c')],_0x534d10[_0xd81b('0x3e')]);_0x49cba6[_0xd81b('0x42')]=_[_0xd81b('0x40')](_0x534d10['model'],qs[_0xd81b('0x41')](_0x43d7ce[_0xd81b('0x3e')]['fields']));_0x49cba6[_0xd81b('0x42')]=_0x49cba6[_0xd81b('0x42')][_0xd81b('0x43')]?_0x49cba6[_0xd81b('0x42')]:_0x534d10[_0xd81b('0x3c')];if(_0x43d7ce[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x49cba6[_0xd81b('0x50')]=[{'all':!![]}];}_0x49cba6=_[_0xd81b('0x4b')]({},_0x49cba6,_0x43d7ce[_0xd81b('0x4e')]);return db[_0xd81b('0x38')]['find'](_0x49cba6)[_0xd81b('0x1e')](handleEntityNotFound(_0x133a76,null))['then'](respondWithResult(_0x133a76,null))[_0xd81b('0x53')](handleError(_0x133a76,null));};exports[_0xd81b('0x56')]=function(_0x390db6,_0x3c2a9f){var _0x34d2a2={'where':{'id':_0x390db6['params']['id']}},_0x1e9f73={};_0x1e9f73[_0xd81b('0x3c')]=_[_0xd81b('0x3f')](db['Trunk']['rawAttributes']);_0x34d2a2[_0xd81b('0x42')]=_['intersection'](_0x1e9f73[_0xd81b('0x3c')],qs['fields'](_0x390db6[_0xd81b('0x3e')][_0xd81b('0x41')]));_0x34d2a2[_0xd81b('0x42')]=_0x34d2a2['attributes'][_0xd81b('0x43')]?_0x34d2a2[_0xd81b('0x42')]:_0x1e9f73['model'];if(_0x390db6[_0xd81b('0x3e')][_0xd81b('0x4f')]){_0x34d2a2['include']=[{'all':!![]}];}_0x34d2a2=_[_0xd81b('0x4b')]({},_0x34d2a2,_0x390db6['options']);return db[_0xd81b('0x38')][_0xd81b('0x57')](_0x34d2a2)[_0xd81b('0x1e')](handleEntityNotFound(_0x3c2a9f,null))[_0xd81b('0x1e')](function(_0x4add79){if(_0x4add79){var _0x32eab4=_0x4add79[_0xd81b('0x58')]({'plain':!![]});_0x32eab4=qs[_0xd81b('0x59')](_0x32eab4,['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);_0x390db6['body']=_[_0xd81b('0x59')](_0x390db6[_0xd81b('0x5c')],['id',_0xd81b('0x5a'),_0xd81b('0x5b')]);return db[_0xd81b('0x38')][_0xd81b('0x5d')](_[_0xd81b('0x4b')](_0x32eab4,_0x390db6['body']),{'include':_0x390db6['query']['includeAll']?[{'all':!![]}]:undefined})[_0xd81b('0x1e')](function(_0x12b0bf){var _0x37507e=_0x390db6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x37507e)throw new Error(_0xd81b('0x5f'));if(_0x37507e[_0xd81b('0x60')]==='user'){var _0x3fcd8c=_0x12b0bf[_0xd81b('0x58')]({'plain':!![]});var _0x35c9cf=_0xd81b('0x61');return db[_0xd81b('0x62')][_0xd81b('0x57')]({'where':{'name':_0x35c9cf,'userProfileId':_0x37507e[_0xd81b('0x63')]},'raw':!![]})['then'](function(_0x14b187){if(_0x14b187&&_0x14b187[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x3fcd8c[_0xd81b('0x36')],'resourceId':_0x3fcd8c['id'],'type':_0x14b187[_0xd81b('0x36')],'sectionId':_0x14b187['id']},{})[_0xd81b('0x1e')](function(){return _0x12b0bf;});}else{return _0x12b0bf;}})[_0xd81b('0x53')](function(_0x8fa8cd){logger[_0xd81b('0x25')](_0xd81b('0x65'),_0x8fa8cd);throw _0x8fa8cd;});}return _0x12b0bf;});}})[_0xd81b('0x1e')](respondWithResult(_0x3c2a9f,0xc9))['catch'](handleError(_0x3c2a9f,null));};exports[_0xd81b('0x5d')]=function(_0x5358a6,_0x2e7141,_0x6fa974){var _0x414f40;return db[_0xd81b('0x38')][_0xd81b('0x5d')](_0x5358a6[_0xd81b('0x5c')],{'raw':!![]})[_0xd81b('0x1e')](function(_0x18f2ac){_0x414f40=_0x18f2ac;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0xfa2a13){var _0x344c32=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x3274d2=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),_0xd81b('0x6a'));var _0xaee7e3=ejs['render'](_0x344c32,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0xaee7e3);if(_0x414f40[_0xd81b('0x6d')]){var _0x1c6ec8=ejs[_0xd81b('0x6e')](_0x3274d2,{'trunks':_0xfa2a13||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x1c6ec8);}})[_0xd81b('0x1e')](function(){return respondWithRpcPromise(_0xd81b('0x70'),'create',{'module':_0xd81b('0x71')});})[_0xd81b('0x1e')](function(){var _0x3858eb=_0x5358a6[_0xd81b('0x5e')][_0xd81b('0x58')]({'plain':!![]});if(!_0x3858eb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3858eb[_0xd81b('0x60')]===_0xd81b('0x5e')){var _0x4cc440=_0x414f40[_0xd81b('0x58')]({'plain':!![]});return db[_0xd81b('0x62')]['find']({'where':{'name':_0xd81b('0x61'),'userProfileId':_0x3858eb[_0xd81b('0x63')]},'raw':!![]})[_0xd81b('0x1e')](function(_0x483026){if(_0x483026&&_0x483026[_0xd81b('0x64')]===0x0){return db[_0xd81b('0x35')][_0xd81b('0x5d')]({'name':_0x4cc440['name'],'resourceId':_0x4cc440['id'],'type':_0x483026['name'],'sectionId':_0x483026['id']},{})[_0xd81b('0x1e')](function(){return _0x414f40;});}else{return _0x414f40;}})[_0xd81b('0x53')](function(_0x36c694){logger['error'](_0xd81b('0x65'),_0x36c694);throw _0x36c694;});}return _0x414f40;})[_0xd81b('0x1e')](respondWithResult(_0x2e7141,0xc9))[_0xd81b('0x53')](handleError(_0x2e7141,null));};exports[_0xd81b('0x72')]=function(_0x524196,_0x4f69a7,_0x42ae01){var _0x256696;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x524196['params']['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x4f69a7,null))[_0xd81b('0x1e')](saveUpdates(_0x524196['body'],null))[_0xd81b('0x1e')](function(_0x4e5bf4){if(_0x4e5bf4){_0x256696=_0x4e5bf4;return db[_0xd81b('0x38')][_0xd81b('0x51')]({'raw':!![]});}})['then'](function(_0x1be0e6){if(_0x1be0e6){var _0x9a9634=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],'server/files/templates/trunk.ejs'),_0xd81b('0x6a'));var _0xc0e137=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config[_0xd81b('0x68')],_0xd81b('0x69')),'utf8');var _0x5c8ea0=ejs[_0xd81b('0x6e')](_0x9a9634,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6c'),_0x5c8ea0);var _0x15aed5=ejs['render'](_0xc0e137,{'trunks':_0x1be0e6||[]});fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x15aed5);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x72'),{'module':_0xd81b('0x71')});}return null;})['then'](function(_0x3744bf){if(_0x3744bf){return _0x256696;}})[_0xd81b('0x1e')](respondWithResult(_0x4f69a7,null))[_0xd81b('0x53')](handleError(_0x4f69a7,null));};exports[_0xd81b('0x34')]=function(_0x1d596c,_0x288124,_0x402eb9){var _0x57179a;return db[_0xd81b('0x38')][_0xd81b('0x57')]({'where':{'id':_0x1d596c[_0xd81b('0x55')]['id']}})[_0xd81b('0x1e')](handleEntityNotFound(_0x288124,null))[_0xd81b('0x1e')](removeEntity(_0x288124,null))[_0xd81b('0x1e')](function(){return db['Trunk'][_0xd81b('0x51')]({'raw':!![]});})['then'](function(_0x11e590){var _0x9e6e05=fs[_0xd81b('0x66')](path['join'](config[_0xd81b('0x68')],_0xd81b('0x73')),_0xd81b('0x6a'));var _0x5060dc=fs[_0xd81b('0x66')](path[_0xd81b('0x67')](config['root'],_0xd81b('0x69')),'utf8');var _0x5f5514=ejs[_0xd81b('0x6e')](_0x9e6e05,{'trunks':_0x11e590});var _0x428317=ejs[_0xd81b('0x6e')](_0x5060dc,{'trunks':_0x11e590});fs['writeFileSync'](_0xd81b('0x6c'),_0x5f5514);fs[_0xd81b('0x6b')](_0xd81b('0x6f'),_0x428317);return respondWithRpcPromise(_0xd81b('0x70'),_0xd81b('0x34'),{'module':_0xd81b('0x71')});})['catch'](handleError(_0x288124,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 2597b9f..210eaa9 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 _0x8af9=['bluebird','request-promise','path','rimraf','exports','Trunk','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8af9,0xf0));var _0x98af=function(_0x4bdde7,_0x2f3748){_0x4bdde7=_0x4bdde7-0x0;var _0x5c280d=_0x8af9[_0x4bdde7];return _0x5c280d;};'use strict';var _=require(_0x98af('0x0'));var util=require(_0x98af('0x1'));var logger=require('../../config/logger')(_0x98af('0x2'));var moment=require('moment');var BPromise=require(_0x98af('0x3'));var rp=require(_0x98af('0x4'));var fs=require('fs');var path=require(_0x98af('0x5'));var rimraf=require(_0x98af('0x6'));var config=require('../../config/environment');var attributes=require('./trunk.attributes');module[_0x98af('0x7')]=function(_0x37d01e,_0x4e10b1){return _0x37d01e['define'](_0x98af('0x8'),attributes,{'tableName':'tools_trunks','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd2a=['bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','Trunk','lodash','util','../../config/logger','moment'];(function(_0x1e6ef6,_0x56d4a3){var _0x1ae1f3=function(_0x45ff40){while(--_0x45ff40){_0x1e6ef6['push'](_0x1e6ef6['shift']());}};_0x1ae1f3(++_0x56d4a3);}(_0xcd2a,0xe0));var _0xacd2=function(_0x208961,_0x5e6cf6){_0x208961=_0x208961-0x0;var _0x4236f5=_0xcd2a[_0x208961];return _0x4236f5;};'use strict';var _=require(_0xacd2('0x0'));var util=require(_0xacd2('0x1'));var logger=require(_0xacd2('0x2'))('api');var moment=require(_0xacd2('0x3'));var BPromise=require(_0xacd2('0x4'));var rp=require(_0xacd2('0x5'));var fs=require('fs');var path=require(_0xacd2('0x6'));var rimraf=require(_0xacd2('0x7'));var config=require(_0xacd2('0x8'));var attributes=require(_0xacd2('0x9'));module[_0xacd2('0xa')]=function(_0x5c3938,_0x4b203){return _0x5c3938['define'](_0xacd2('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 9acb423..2d8beac 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 _0x23b7=['where','attributes','include','model','map','then','GetTrunk','catch','Trunk','find','ShowTrunk','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','options','raw'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x23b7,0x17d));var _0x723b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x23b7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x723b('0x0'));var util=require(_0x723b('0x1'));var moment=require(_0x723b('0x2'));var BPromise=require(_0x723b('0x3'));var rs=require(_0x723b('0x4'));var fs=require('fs');var Redis=require(_0x723b('0x5'));var db=require(_0x723b('0x6'))['db'];var utils=require(_0x723b('0x7'));var logger=require(_0x723b('0x8'))(_0x723b('0x9'));var config=require('../../config/environment');var jayson=require(_0x723b('0xa'));var client=jayson[_0x723b('0xb')][_0x723b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xd8201e,_0x4eae5d,_0x5171f6){return new BPromise(function(_0x5796bd,_0x426108){return client[_0x723b('0xd')](_0xd8201e,_0x5171f6)['then'](function(_0x1e02eb){logger['info'](_0x723b('0xe'),_0x4eae5d,_0x723b('0xf'));logger[_0x723b('0x10')](_0x723b('0x11'),_0x4eae5d,_0x723b('0xf'),JSON[_0x723b('0x12')](_0x1e02eb));if(_0x1e02eb[_0x723b('0x13')]){if(_0x1e02eb[_0x723b('0x13')][_0x723b('0x14')]===0x1f4){logger[_0x723b('0x13')](_0x723b('0xe'),_0x4eae5d,_0x1e02eb[_0x723b('0x13')]['message']);return _0x426108(_0x1e02eb[_0x723b('0x13')]['message']);}logger['error'](_0x723b('0xe'),_0x4eae5d,_0x1e02eb[_0x723b('0x13')][_0x723b('0x15')]);return _0x5796bd(_0x1e02eb[_0x723b('0x13')][_0x723b('0x15')]);}else{logger[_0x723b('0x16')](_0x723b('0xe'),_0x4eae5d,_0x723b('0xf'));_0x5796bd(_0x1e02eb[_0x723b('0x17')]['message']);}})['catch'](function(_0x53a898){logger['error'](_0x723b('0xe'),_0x4eae5d,_0x53a898);_0x426108(_0x53a898);});});}exports['GetTrunk']=function(_0x2a25aa){var _0x3c9cdc=this;return new Promise(function(_0x3b5627,_0x62c560){return db['Trunk']['findAll']({'raw':_0x2a25aa[_0x723b('0x18')]?_0x2a25aa[_0x723b('0x18')][_0x723b('0x19')]===undefined?!![]:![]:!![],'where':_0x2a25aa[_0x723b('0x18')]?_0x2a25aa[_0x723b('0x18')][_0x723b('0x1a')]||null:null,'attributes':_0x2a25aa[_0x723b('0x18')]?_0x2a25aa['options'][_0x723b('0x1b')]||null:null,'limit':_0x2a25aa[_0x723b('0x18')]?_0x2a25aa[_0x723b('0x18')]['limit']||null:null,'include':_0x2a25aa[_0x723b('0x18')]?_0x2a25aa[_0x723b('0x18')][_0x723b('0x1c')]?_['map'](_0x2a25aa[_0x723b('0x18')][_0x723b('0x1c')],function(_0x12bd3c){return{'model':db[_0x12bd3c[_0x723b('0x1d')]],'as':_0x12bd3c['as'],'attributes':_0x12bd3c[_0x723b('0x1b')],'include':_0x12bd3c['include']?_[_0x723b('0x1e')](_0x12bd3c[_0x723b('0x1c')],function(_0x1f871b){return{'model':db[_0x1f871b[_0x723b('0x1d')]],'as':_0x1f871b['as'],'attributes':_0x1f871b[_0x723b('0x1b')],'include':_0x1f871b[_0x723b('0x1c')]?_[_0x723b('0x1e')](_0x1f871b[_0x723b('0x1c')],function(_0x18fb5d){return{'model':db[_0x18fb5d[_0x723b('0x1d')]],'as':_0x18fb5d['as'],'attributes':_0x18fb5d[_0x723b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x723b('0x1f')](function(_0x29877d){logger[_0x723b('0x16')](_0x723b('0x20'),_0x2a25aa);logger['debug']('GetTrunk',_0x2a25aa,JSON[_0x723b('0x12')](_0x29877d));_0x3b5627(_0x29877d);})[_0x723b('0x21')](function(_0x832a17){logger[_0x723b('0x13')](_0x723b('0x20'),_0x832a17[_0x723b('0x15')],_0x2a25aa);_0x62c560(_0x3c9cdc['error'](0x1f4,_0x832a17[_0x723b('0x15')]));});});};exports['ShowTrunk']=function(_0x16b8e5){var _0x2fa69b=this;return new Promise(function(_0x1c12cd,_0x523d42){return db[_0x723b('0x22')][_0x723b('0x23')]({'raw':_0x16b8e5['options']?_0x16b8e5[_0x723b('0x18')][_0x723b('0x19')]===undefined?!![]:![]:!![],'where':_0x16b8e5[_0x723b('0x18')]?_0x16b8e5['options'][_0x723b('0x1a')]||null:null,'attributes':_0x16b8e5[_0x723b('0x18')]?_0x16b8e5[_0x723b('0x18')][_0x723b('0x1b')]||null:null,'include':_0x16b8e5['options']?_0x16b8e5[_0x723b('0x18')][_0x723b('0x1c')]?_[_0x723b('0x1e')](_0x16b8e5[_0x723b('0x18')][_0x723b('0x1c')],function(_0x2c2869){return{'model':db[_0x2c2869[_0x723b('0x1d')]],'as':_0x2c2869['as'],'attributes':_0x2c2869['attributes'],'include':_0x2c2869['include']?_[_0x723b('0x1e')](_0x2c2869[_0x723b('0x1c')],function(_0x3b38f6){return{'model':db[_0x3b38f6[_0x723b('0x1d')]],'as':_0x3b38f6['as'],'attributes':_0x3b38f6[_0x723b('0x1b')],'include':_0x3b38f6[_0x723b('0x1c')]?_[_0x723b('0x1e')](_0x3b38f6['include'],function(_0x9c8a5b){return{'model':db[_0x9c8a5b['model']],'as':_0x9c8a5b['as'],'attributes':_0x9c8a5b['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ae2d8){logger['info'](_0x723b('0x24'),_0x16b8e5);logger['debug'](_0x723b('0x24'),_0x16b8e5,JSON['stringify'](_0x2ae2d8));_0x1c12cd(_0x2ae2d8);})[_0x723b('0x21')](function(_0x157de3){logger[_0x723b('0x13')](_0x723b('0x24'),_0x157de3[_0x723b('0x15')],_0x16b8e5);_0x523d42(_0x2fa69b[_0x723b('0x13')](0x1f4,_0x157de3[_0x723b('0x15')]));});});}; \ No newline at end of file +var _0xc94c=['limit','include','attributes','map','model','debug','ShowTrunk','find','info','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','Trunk,\x20%s,\x20%s','message','result','catch','GetTrunk','Trunk','findAll','options','raw','where'];(function(_0x3c0a7a,_0x5aff7a){var _0x411c7b=function(_0x5a30cc){while(--_0x5a30cc){_0x3c0a7a['push'](_0x3c0a7a['shift']());}};_0x411c7b(++_0x5aff7a);}(_0xc94c,0x7c));var _0xcc94=function(_0x1ccb4b,_0x1c5bdc){_0x1ccb4b=_0x1ccb4b-0x0;var _0x2fd92c=_0xc94c[_0x1ccb4b];return _0x2fd92c;};'use strict';var _=require(_0xcc94('0x0'));var util=require('util');var moment=require(_0xcc94('0x1'));var BPromise=require('bluebird');var rs=require(_0xcc94('0x2'));var fs=require('fs');var Redis=require(_0xcc94('0x3'));var db=require(_0xcc94('0x4'))['db'];var utils=require(_0xcc94('0x5'));var logger=require(_0xcc94('0x6'))(_0xcc94('0x7'));var config=require(_0xcc94('0x8'));var jayson=require(_0xcc94('0x9'));var client=jayson[_0xcc94('0xa')][_0xcc94('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x732395,_0x5a7c8e,_0x396362){return new BPromise(function(_0x3ab14b,_0x57855f){return client[_0xcc94('0xc')](_0x732395,_0x396362)[_0xcc94('0xd')](function(_0x598583){logger['info']('Trunk,\x20%s,\x20%s',_0x5a7c8e,'request\x20sent');logger['debug'](_0xcc94('0xe'),_0x5a7c8e,_0xcc94('0xf'),JSON['stringify'](_0x598583));if(_0x598583[_0xcc94('0x10')]){if(_0x598583[_0xcc94('0x10')][_0xcc94('0x11')]===0x1f4){logger['error'](_0xcc94('0x12'),_0x5a7c8e,_0x598583[_0xcc94('0x10')][_0xcc94('0x13')]);return _0x57855f(_0x598583[_0xcc94('0x10')][_0xcc94('0x13')]);}logger[_0xcc94('0x10')](_0xcc94('0x12'),_0x5a7c8e,_0x598583['error'][_0xcc94('0x13')]);return _0x3ab14b(_0x598583['error']['message']);}else{logger['info'](_0xcc94('0x12'),_0x5a7c8e,_0xcc94('0xf'));_0x3ab14b(_0x598583[_0xcc94('0x14')][_0xcc94('0x13')]);}})[_0xcc94('0x15')](function(_0x5ba8e7){logger['error']('Trunk,\x20%s,\x20%s',_0x5a7c8e,_0x5ba8e7);_0x57855f(_0x5ba8e7);});});}exports[_0xcc94('0x16')]=function(_0x6b5639){var _0x4d7bcf=this;return new Promise(function(_0x2aa82b,_0x1d779a){return db[_0xcc94('0x17')][_0xcc94('0x18')]({'raw':_0x6b5639[_0xcc94('0x19')]?_0x6b5639[_0xcc94('0x19')][_0xcc94('0x1a')]===undefined?!![]:![]:!![],'where':_0x6b5639[_0xcc94('0x19')]?_0x6b5639['options'][_0xcc94('0x1b')]||null:null,'attributes':_0x6b5639[_0xcc94('0x19')]?_0x6b5639[_0xcc94('0x19')]['attributes']||null:null,'limit':_0x6b5639[_0xcc94('0x19')]?_0x6b5639[_0xcc94('0x19')][_0xcc94('0x1c')]||null:null,'include':_0x6b5639[_0xcc94('0x19')]?_0x6b5639['options'][_0xcc94('0x1d')]?_['map'](_0x6b5639[_0xcc94('0x19')][_0xcc94('0x1d')],function(_0x1a048c){return{'model':db[_0x1a048c['model']],'as':_0x1a048c['as'],'attributes':_0x1a048c[_0xcc94('0x1e')],'include':_0x1a048c[_0xcc94('0x1d')]?_[_0xcc94('0x1f')](_0x1a048c['include'],function(_0x4efccc){return{'model':db[_0x4efccc[_0xcc94('0x20')]],'as':_0x4efccc['as'],'attributes':_0x4efccc['attributes'],'include':_0x4efccc['include']?_[_0xcc94('0x1f')](_0x4efccc['include'],function(_0x572413){return{'model':db[_0x572413[_0xcc94('0x20')]],'as':_0x572413['as'],'attributes':_0x572413[_0xcc94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc94('0xd')](function(_0x5b828f){logger['info'](_0xcc94('0x16'),_0x6b5639);logger[_0xcc94('0x21')](_0xcc94('0x16'),_0x6b5639,JSON['stringify'](_0x5b828f));_0x2aa82b(_0x5b828f);})['catch'](function(_0x11b217){logger[_0xcc94('0x10')](_0xcc94('0x16'),_0x11b217[_0xcc94('0x13')],_0x6b5639);_0x1d779a(_0x4d7bcf[_0xcc94('0x10')](0x1f4,_0x11b217['message']));});});};exports[_0xcc94('0x22')]=function(_0x4eb0bb){var _0x343466=this;return new Promise(function(_0xcf00af,_0x36d64c){return db[_0xcc94('0x17')][_0xcc94('0x23')]({'raw':_0x4eb0bb[_0xcc94('0x19')]?_0x4eb0bb['options']['raw']===undefined?!![]:![]:!![],'where':_0x4eb0bb[_0xcc94('0x19')]?_0x4eb0bb[_0xcc94('0x19')][_0xcc94('0x1b')]||null:null,'attributes':_0x4eb0bb['options']?_0x4eb0bb['options'][_0xcc94('0x1e')]||null:null,'include':_0x4eb0bb[_0xcc94('0x19')]?_0x4eb0bb[_0xcc94('0x19')][_0xcc94('0x1d')]?_['map'](_0x4eb0bb[_0xcc94('0x19')][_0xcc94('0x1d')],function(_0x476153){return{'model':db[_0x476153[_0xcc94('0x20')]],'as':_0x476153['as'],'attributes':_0x476153[_0xcc94('0x1e')],'include':_0x476153[_0xcc94('0x1d')]?_[_0xcc94('0x1f')](_0x476153[_0xcc94('0x1d')],function(_0x57f12d){return{'model':db[_0x57f12d[_0xcc94('0x20')]],'as':_0x57f12d['as'],'attributes':_0x57f12d[_0xcc94('0x1e')],'include':_0x57f12d[_0xcc94('0x1d')]?_['map'](_0x57f12d[_0xcc94('0x1d')],function(_0x43fb8c){return{'model':db[_0x43fb8c[_0xcc94('0x20')]],'as':_0x43fb8c['as'],'attributes':_0x43fb8c[_0xcc94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xcc94('0xd')](function(_0x5d437c){logger[_0xcc94('0x24')]('ShowTrunk',_0x4eb0bb);logger['debug'](_0xcc94('0x22'),_0x4eb0bb,JSON[_0xcc94('0x25')](_0x5d437c));_0xcf00af(_0x5d437c);})[_0xcc94('0x15')](function(_0x442f8e){logger[_0xcc94('0x10')](_0xcc94('0x22'),_0x442f8e['message'],_0x4eb0bb);_0x36d64c(_0x343466[_0xcc94('0x10')](0x1f4,_0x442f8e[_0xcc94('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index f0cd04e..35fee2c 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 _0xe05a=['/:id/queues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getWhatsappInteractions','/:id/teams','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','getSquareProjects','/:id/scheduled_calls','/:id/api_key','post','/:id/contacts','addContacts','create','bulkCreate','root','server/files/images/','format','%s-%s','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addWhatsappInteractions','addFaxAccounts','addMailAccounts','addSmsAccounts','/:id/chat_websites','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','put','/:id','update','/:id/password','delete','removeQueues','destroy','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','/:id/square_projects','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','get','describe','/whoami','whoami','/presence','getPresence','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts'];(function(_0x8b7ecc,_0x5ca24d){var _0x2c2bcb=function(_0x4cf31b){while(--_0x4cf31b){_0x8b7ecc['push'](_0x8b7ecc['shift']());}};_0x2c2bcb(++_0x5ca24d);}(_0xe05a,0x149));var _0xae05=function(_0x5dc845,_0x3ae9b1){_0x5dc845=_0x5dc845-0x0;var _0x45ebac=_0xe05a[_0x5dc845];return _0x45ebac;};'use strict';var multer=require(_0xae05('0x0'));var util=require(_0xae05('0x1'));var path=require(_0xae05('0x2'));var timeout=require(_0xae05('0x3'));var express=require(_0xae05('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xae05('0x5'));var interaction=require(_0xae05('0x6'));var config=require(_0xae05('0x7'));var controller=require(_0xae05('0x8'));router['get']('/',auth[_0xae05('0x9')](),controller['index']);router[_0xae05('0xa')]('/describe',auth[_0xae05('0x9')](),controller[_0xae05('0xb')]);router[_0xae05('0xa')](_0xae05('0xc'),auth[_0xae05('0x9')](),controller[_0xae05('0xd')]);router[_0xae05('0xa')](_0xae05('0xe'),auth[_0xae05('0x9')](),controller[_0xae05('0xf')]);router[_0xae05('0xa')]('/:id',auth[_0xae05('0x9')](),controller[_0xae05('0x10')]);router[_0xae05('0xa')](_0xae05('0x11'),controller[_0xae05('0x12')]);router[_0xae05('0xa')](_0xae05('0x13'),auth[_0xae05('0x9')](),controller[_0xae05('0x14')]);router[_0xae05('0xa')]('/:id/contacts',auth[_0xae05('0x9')](),controller[_0xae05('0x15')]);router[_0xae05('0xa')](_0xae05('0x16'),auth[_0xae05('0x9')](),controller['getQueues']);router[_0xae05('0xa')](_0xae05('0x17'),auth[_0xae05('0x9')](),controller[_0xae05('0x18')]);router['get']('/:id/groups',auth['isAuthenticated'](),controller[_0xae05('0x19')]);router[_0xae05('0xa')](_0xae05('0x1a'),auth[_0xae05('0x9')](),controller[_0xae05('0x1b')]);router['get'](_0xae05('0x1c'),auth[_0xae05('0x9')](),controller[_0xae05('0x1d')]);router[_0xae05('0xa')](_0xae05('0x1e'),auth[_0xae05('0x9')](),controller['getChatInteractions']);router[_0xae05('0xa')](_0xae05('0x1f'),auth[_0xae05('0x9')](),controller[_0xae05('0x20')]);router[_0xae05('0xa')]('/:id/mail/interactions',auth[_0xae05('0x9')](),controller[_0xae05('0x21')]);router[_0xae05('0xa')](_0xae05('0x22'),auth[_0xae05('0x9')](),controller[_0xae05('0x23')]);router[_0xae05('0xa')](_0xae05('0x24'),auth[_0xae05('0x9')](),controller[_0xae05('0x25')]);router[_0xae05('0xa')]('/:id/whatsapp/interactions',auth['isAuthenticated'](),controller[_0xae05('0x26')]);router['get'](_0xae05('0x27'),auth['isAuthenticated'](),controller[_0xae05('0x28')]);router[_0xae05('0xa')](_0xae05('0x29'),auth[_0xae05('0x9')](),controller['getLists']);router[_0xae05('0xa')](_0xae05('0x2a'),auth[_0xae05('0x9')](),controller[_0xae05('0x2b')]);router[_0xae05('0xa')](_0xae05('0x2c'),auth[_0xae05('0x9')](),controller['getVoicePrefixes']);router[_0xae05('0xa')](_0xae05('0x2d'),auth[_0xae05('0x9')](),controller[_0xae05('0x2e')]);router[_0xae05('0xa')](_0xae05('0x2f'),auth[_0xae05('0x9')](),controller['getMailAccounts']);router[_0xae05('0xa')](_0xae05('0x30'),auth['isAuthenticated'](),controller[_0xae05('0x31')]);router[_0xae05('0xa')](_0xae05('0x32'),auth[_0xae05('0x9')](),controller['getSmsAccounts']);router['get']('/:id/chat_websites',auth[_0xae05('0x9')](),controller[_0xae05('0x33')]);router['get'](_0xae05('0x34'),auth[_0xae05('0x9')](),controller[_0xae05('0x35')]);router[_0xae05('0xa')]('/:id/square_projects',auth['isAuthenticated'](),controller[_0xae05('0x36')]);router[_0xae05('0xa')](_0xae05('0x37'),auth['isAuthenticated'](),controller['getScheduledCalls']);router[_0xae05('0xa')](_0xae05('0x38'),auth['isAuthenticated'](),controller['getApiKey']);router[_0xae05('0x39')](_0xae05('0x3a'),auth[_0xae05('0x9')](),controller[_0xae05('0x3b')]);router[_0xae05('0x39')]('/',auth[_0xae05('0x9')](),controller[_0xae05('0x3c')]);router[_0xae05('0x39')]('/create_many',auth[_0xae05('0x9')](),controller[_0xae05('0x3d')]);router[_0xae05('0x39')](_0xae05('0x16'),auth['isAuthenticated'](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x586881,_0x1b2936,_0x3a1a70){_0x3a1a70(null,path['join'](config[_0xae05('0x3e')],_0xae05('0x3f')));},'filename':function(_0x1a4890,_0x16f832,_0x2fbebd){_0x2fbebd(null,util[_0xae05('0x40')](_0xae05('0x41'),Date['now'](),_0x16f832[_0xae05('0x42')]));}})});router[_0xae05('0x39')](_0xae05('0x11'),upload[_0xae05('0x43')](_0xae05('0x44')),controller[_0xae05('0x45')]);router[_0xae05('0x39')](_0xae05('0x46'),auth[_0xae05('0x9')](),controller[_0xae05('0x47')]);router[_0xae05('0x39')](_0xae05('0x48'),auth[_0xae05('0x9')](),controller['logout']);router['post'](_0xae05('0x49'),auth['isAuthenticated'](),controller[_0xae05('0x4a')]);router[_0xae05('0x39')](_0xae05('0x4b'),auth[_0xae05('0x9')](),controller[_0xae05('0x4c')]);router[_0xae05('0x39')](_0xae05('0x27'),auth['isAuthenticated'](),controller['addTeams']);router[_0xae05('0x39')](_0xae05('0x4d'),auth[_0xae05('0x9')](),controller[_0xae05('0x4e')]);router[_0xae05('0x39')]('/:id/mail_interactions',auth['isAuthenticated'](),controller['addMailInteractions']);router[_0xae05('0x39')](_0xae05('0x4f'),auth[_0xae05('0x9')](),controller[_0xae05('0x50')]);router[_0xae05('0x39')]('/:id/sms_interactions',auth[_0xae05('0x9')](),controller[_0xae05('0x51')]);router[_0xae05('0x39')](_0xae05('0x52'),auth[_0xae05('0x9')](),controller[_0xae05('0x53')]);router['post'](_0xae05('0x54'),auth[_0xae05('0x9')](),controller[_0xae05('0x55')]);router[_0xae05('0x39')](_0xae05('0x2d'),auth[_0xae05('0x9')](),controller[_0xae05('0x56')]);router['post'](_0xae05('0x2f'),auth[_0xae05('0x9')](),controller[_0xae05('0x57')]);router[_0xae05('0x39')](_0xae05('0x30'),auth[_0xae05('0x9')](),controller['addOpenchannelAccounts']);router[_0xae05('0x39')](_0xae05('0x32'),auth[_0xae05('0x9')](),controller[_0xae05('0x58')]);router['post'](_0xae05('0x59'),auth[_0xae05('0x9')](),controller[_0xae05('0x5a')]);router['post']('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0xae05('0x5b')]);router[_0xae05('0x39')]('/:id/square_projects',auth[_0xae05('0x9')](),controller[_0xae05('0x5c')]);router[_0xae05('0x39')](_0xae05('0x38'),auth[_0xae05('0x9')](),controller[_0xae05('0x5d')]);router[_0xae05('0x5e')](_0xae05('0x5f'),auth[_0xae05('0x9')](),controller[_0xae05('0x60')]);router[_0xae05('0x5e')](_0xae05('0x61'),auth[_0xae05('0x9')](),controller['changePassword']);router[_0xae05('0x62')](_0xae05('0x16'),auth[_0xae05('0x9')](),controller[_0xae05('0x63')]);router['delete'](_0xae05('0x27'),auth[_0xae05('0x9')](),controller['removeTeams']);router['delete'](_0xae05('0x5f'),auth[_0xae05('0x9')](),controller[_0xae05('0x64')]);router[_0xae05('0x62')](_0xae05('0x4d'),auth[_0xae05('0x9')](),controller[_0xae05('0x65')]);router[_0xae05('0x62')](_0xae05('0x66'),auth[_0xae05('0x9')](),controller[_0xae05('0x67')]);router[_0xae05('0x62')](_0xae05('0x4f'),auth['isAuthenticated'](),controller[_0xae05('0x68')]);router['delete'](_0xae05('0x69'),auth[_0xae05('0x9')](),controller[_0xae05('0x6a')]);router[_0xae05('0x62')](_0xae05('0x52'),auth[_0xae05('0x9')](),controller[_0xae05('0x6b')]);router[_0xae05('0x62')](_0xae05('0x54'),auth['isAuthenticated'](),controller[_0xae05('0x6c')]);router['delete'](_0xae05('0x2d'),auth[_0xae05('0x9')](),controller[_0xae05('0x6d')]);router[_0xae05('0x62')]('/:id/mail_accounts',auth[_0xae05('0x9')](),controller[_0xae05('0x6e')]);router[_0xae05('0x62')]('/:id/openchannel_accounts',auth[_0xae05('0x9')](),controller['removeOpenchannelAccounts']);router[_0xae05('0x62')]('/:id/sms_accounts',auth[_0xae05('0x9')](),controller[_0xae05('0x6f')]);router[_0xae05('0x62')](_0xae05('0x59'),auth['isAuthenticated'](),controller[_0xae05('0x70')]);router[_0xae05('0x62')](_0xae05('0x34'),auth[_0xae05('0x9')](),controller[_0xae05('0x71')]);router[_0xae05('0x62')](_0xae05('0x72'),auth[_0xae05('0x9')](),controller[_0xae05('0x73')]);router['delete'](_0xae05('0x38'),auth[_0xae05('0x9')](),controller[_0xae05('0x74')]);module['exports']=router; \ No newline at end of file +var _0x016a=['addChatWebsites','addWhatsappAccounts','addSquareProjects','put','update','delete','removeQueues','removeTeams','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./user.controller','get','isAuthenticated','index','/describe','describe','/whoami','whoami','getPresence','/:id','show','/:id/avatar','getAvatar','getOpenTabs','/:id/contacts','getContacts','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','post','create','/create_many','bulkCreate','/:id/queues','addQueues','root','server/files/images/','format','%s-%s','originalname','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','/:id/whatsapp_interactions','addWhatsappInteractions','addMailAccounts','addOpenchannelAccounts','addSmsAccounts'];(function(_0x5287a5,_0x3ff0ad){var _0x158a73=function(_0x351f02){while(--_0x351f02){_0x5287a5['push'](_0x5287a5['shift']());}};_0x158a73(++_0x3ff0ad);}(_0x016a,0x1e9));var _0xa016=function(_0x245afe,_0x319cde){_0x245afe=_0x245afe-0x0;var _0x4eefde=_0x016a[_0x245afe];return _0x4eefde;};'use strict';var multer=require(_0xa016('0x0'));var util=require('util');var path=require(_0xa016('0x1'));var timeout=require(_0xa016('0x2'));var express=require(_0xa016('0x3'));var router=express['Router']();var fs_extra=require(_0xa016('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa016('0x5'));var config=require(_0xa016('0x6'));var controller=require(_0xa016('0x7'));router[_0xa016('0x8')]('/',auth[_0xa016('0x9')](),controller[_0xa016('0xa')]);router[_0xa016('0x8')](_0xa016('0xb'),auth[_0xa016('0x9')](),controller[_0xa016('0xc')]);router[_0xa016('0x8')](_0xa016('0xd'),auth[_0xa016('0x9')](),controller[_0xa016('0xe')]);router[_0xa016('0x8')]('/presence',auth[_0xa016('0x9')](),controller[_0xa016('0xf')]);router['get'](_0xa016('0x10'),auth[_0xa016('0x9')](),controller[_0xa016('0x11')]);router[_0xa016('0x8')](_0xa016('0x12'),controller[_0xa016('0x13')]);router[_0xa016('0x8')]('/:id/open_tabs',auth[_0xa016('0x9')](),controller[_0xa016('0x14')]);router[_0xa016('0x8')](_0xa016('0x15'),auth['isAuthenticated'](),controller[_0xa016('0x16')]);router[_0xa016('0x8')]('/:id/queues',auth[_0xa016('0x9')](),controller[_0xa016('0x17')]);router['get']('/:id/queues_rt',auth[_0xa016('0x9')](),controller[_0xa016('0x18')]);router[_0xa016('0x8')](_0xa016('0x19'),auth[_0xa016('0x9')](),controller[_0xa016('0x1a')]);router[_0xa016('0x8')](_0xa016('0x1b'),auth[_0xa016('0x9')](),controller['getRecordings']);router['get'](_0xa016('0x1c'),auth[_0xa016('0x9')](),controller[_0xa016('0x1d')]);router[_0xa016('0x8')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0xa016('0x1e')]);router['get'](_0xa016('0x1f'),auth[_0xa016('0x9')](),controller[_0xa016('0x20')]);router['get'](_0xa016('0x21'),auth['isAuthenticated'](),controller[_0xa016('0x22')]);router[_0xa016('0x8')](_0xa016('0x23'),auth[_0xa016('0x9')](),controller[_0xa016('0x24')]);router[_0xa016('0x8')](_0xa016('0x25'),auth['isAuthenticated'](),controller[_0xa016('0x26')]);router[_0xa016('0x8')](_0xa016('0x27'),auth[_0xa016('0x9')](),controller['getWhatsappInteractions']);router[_0xa016('0x8')](_0xa016('0x28'),auth['isAuthenticated'](),controller[_0xa016('0x29')]);router[_0xa016('0x8')](_0xa016('0x2a'),auth[_0xa016('0x9')](),controller[_0xa016('0x2b')]);router[_0xa016('0x8')](_0xa016('0x2c'),auth[_0xa016('0x9')](),controller[_0xa016('0x2d')]);router[_0xa016('0x8')]('/:id/prefixes',auth[_0xa016('0x9')](),controller['getVoicePrefixes']);router[_0xa016('0x8')](_0xa016('0x2e'),auth[_0xa016('0x9')](),controller['getFaxAccounts']);router[_0xa016('0x8')](_0xa016('0x2f'),auth[_0xa016('0x9')](),controller[_0xa016('0x30')]);router['get'](_0xa016('0x31'),auth['isAuthenticated'](),controller[_0xa016('0x32')]);router[_0xa016('0x8')](_0xa016('0x33'),auth[_0xa016('0x9')](),controller[_0xa016('0x34')]);router[_0xa016('0x8')](_0xa016('0x35'),auth['isAuthenticated'](),controller[_0xa016('0x36')]);router[_0xa016('0x8')](_0xa016('0x37'),auth[_0xa016('0x9')](),controller[_0xa016('0x38')]);router[_0xa016('0x8')](_0xa016('0x39'),auth['isAuthenticated'](),controller[_0xa016('0x3a')]);router['get'](_0xa016('0x3b'),auth[_0xa016('0x9')](),controller[_0xa016('0x3c')]);router[_0xa016('0x8')](_0xa016('0x3d'),auth[_0xa016('0x9')](),controller['getApiKey']);router[_0xa016('0x3e')](_0xa016('0x15'),auth['isAuthenticated'](),controller['addContacts']);router['post']('/',auth[_0xa016('0x9')](),controller[_0xa016('0x3f')]);router[_0xa016('0x3e')](_0xa016('0x40'),auth[_0xa016('0x9')](),controller[_0xa016('0x41')]);router['post'](_0xa016('0x42'),auth[_0xa016('0x9')](),controller[_0xa016('0x43')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5e9a28,_0xb4b143,_0x23b182){_0x23b182(null,path['join'](config[_0xa016('0x44')],_0xa016('0x45')));},'filename':function(_0x2c749e,_0x38676f,_0x5cdb87){_0x5cdb87(null,util[_0xa016('0x46')](_0xa016('0x47'),Date['now'](),_0x38676f[_0xa016('0x48')]));}})});router[_0xa016('0x3e')](_0xa016('0x12'),upload['single'](_0xa016('0x49')),controller[_0xa016('0x4a')]);router[_0xa016('0x3e')](_0xa016('0x4b'),auth['isAuthenticated'](),controller[_0xa016('0x4c')]);router[_0xa016('0x3e')]('/:id/logout',auth[_0xa016('0x9')](),controller[_0xa016('0x4d')]);router['post'](_0xa016('0x4e'),auth[_0xa016('0x9')](),controller[_0xa016('0x4f')]);router[_0xa016('0x3e')](_0xa016('0x50'),auth[_0xa016('0x9')](),controller[_0xa016('0x51')]);router[_0xa016('0x3e')]('/:id/teams',auth[_0xa016('0x9')](),controller[_0xa016('0x52')]);router[_0xa016('0x3e')](_0xa016('0x53'),auth[_0xa016('0x9')](),controller[_0xa016('0x54')]);router[_0xa016('0x3e')](_0xa016('0x55'),auth[_0xa016('0x9')](),controller['addMailInteractions']);router['post'](_0xa016('0x56'),auth[_0xa016('0x9')](),controller[_0xa016('0x57')]);router['post'](_0xa016('0x58'),auth[_0xa016('0x9')](),controller[_0xa016('0x59')]);router[_0xa016('0x3e')](_0xa016('0x5a'),auth[_0xa016('0x9')](),controller['addOpenchannelInteractions']);router[_0xa016('0x3e')](_0xa016('0x5b'),auth['isAuthenticated'](),controller[_0xa016('0x5c')]);router[_0xa016('0x3e')](_0xa016('0x2e'),auth[_0xa016('0x9')](),controller['addFaxAccounts']);router[_0xa016('0x3e')]('/:id/mail_accounts',auth[_0xa016('0x9')](),controller[_0xa016('0x5d')]);router[_0xa016('0x3e')](_0xa016('0x31'),auth['isAuthenticated'](),controller[_0xa016('0x5e')]);router[_0xa016('0x3e')]('/:id/sms_accounts',auth[_0xa016('0x9')](),controller[_0xa016('0x5f')]);router['post'](_0xa016('0x35'),auth[_0xa016('0x9')](),controller[_0xa016('0x60')]);router['post'](_0xa016('0x37'),auth['isAuthenticated'](),controller[_0xa016('0x61')]);router[_0xa016('0x3e')](_0xa016('0x39'),auth[_0xa016('0x9')](),controller[_0xa016('0x62')]);router['post'](_0xa016('0x3d'),auth[_0xa016('0x9')](),controller['createApiKey']);router[_0xa016('0x63')](_0xa016('0x10'),auth['isAuthenticated'](),controller[_0xa016('0x64')]);router[_0xa016('0x63')]('/:id/password',auth[_0xa016('0x9')](),controller['changePassword']);router[_0xa016('0x65')](_0xa016('0x42'),auth[_0xa016('0x9')](),controller[_0xa016('0x66')]);router['delete']('/:id/teams',auth[_0xa016('0x9')](),controller[_0xa016('0x67')]);router['delete'](_0xa016('0x10'),auth['isAuthenticated'](),controller['destroy']);router[_0xa016('0x65')](_0xa016('0x53'),auth[_0xa016('0x9')](),controller[_0xa016('0x68')]);router[_0xa016('0x65')](_0xa016('0x55'),auth[_0xa016('0x9')](),controller[_0xa016('0x69')]);router['delete'](_0xa016('0x56'),auth[_0xa016('0x9')](),controller[_0xa016('0x6a')]);router[_0xa016('0x65')](_0xa016('0x58'),auth[_0xa016('0x9')](),controller[_0xa016('0x6b')]);router[_0xa016('0x65')](_0xa016('0x5a'),auth[_0xa016('0x9')](),controller[_0xa016('0x6c')]);router[_0xa016('0x65')](_0xa016('0x5b'),auth[_0xa016('0x9')](),controller[_0xa016('0x6d')]);router[_0xa016('0x65')](_0xa016('0x2e'),auth[_0xa016('0x9')](),controller[_0xa016('0x6e')]);router['delete']('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0xa016('0x6f')]);router[_0xa016('0x65')](_0xa016('0x31'),auth[_0xa016('0x9')](),controller[_0xa016('0x70')]);router[_0xa016('0x65')](_0xa016('0x33'),auth[_0xa016('0x9')](),controller['removeSmsAccounts']);router[_0xa016('0x65')](_0xa016('0x35'),auth['isAuthenticated'](),controller[_0xa016('0x71')]);router['delete']('/:id/whatsapp_accounts',auth[_0xa016('0x9')](),controller['removeWhatsappAccounts']);router[_0xa016('0x65')](_0xa016('0x39'),auth[_0xa016('0x9')](),controller[_0xa016('0x72')]);router[_0xa016('0x65')](_0xa016('0x3d'),auth[_0xa016('0x9')](),controller[_0xa016('0x73')]);module[_0xa016('0x74')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index cf2052c..6b98178 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 _0x17ca=['STRING','setDataValue','name','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','internal','email','toLowerCase','admin','telephone','accountcode','format','\x22%s\x22\x20<%s>','BOOLEAN','DATE','DEFAULT\x20PAUSE','INTEGER','dynamic','friend','peer','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','auto','yes','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','actpass','nonat','update','update,nonat','TEXT','showWebBar','get','isArray','wss','encryption','force_avp','icesupport','dtlsenable','dtlsverify','dtlsprivatekey','rtcp_mux','avpf','dtlssetup','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','screenrecording','loginAttempts','blockedAt','UNSIGNED','moment','util'];(function(_0x61c887,_0x5522c2){var _0x200c44=function(_0x4d4448){while(--_0x4d4448){_0x61c887['push'](_0x61c887['shift']());}};_0x200c44(++_0x5522c2);}(_0x17ca,0x16e));var _0xa17c=function(_0x13c0d5,_0x4141df){_0x13c0d5=_0x13c0d5-0x0;var _0x34aaa1=_0x17ca[_0x13c0d5];return _0x34aaa1;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa17c('0x0'));var util=require(_0xa17c('0x1'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0xa17c('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x5c9851){this[_0xa17c('0x3')](_0xa17c('0x4'),_0x5c9851);this[_0xa17c('0x3')](_0xa17c('0x5'),_0x5c9851);},'comment':_0xa17c('0x6')},'fullname':{'type':Sequelize[_0xa17c('0x2')],'allowNull':![],'set':function(_0x310dc3){this[_0xa17c('0x3')](_0xa17c('0x7'),_0x310dc3);this[_0xa17c('0x3')](_0xa17c('0x8'),util['format']('\x22%s\x22\x20<%s>',_0x310dc3,this['getDataValue'](_0xa17c('0x9'))));}},'alias':{'type':Sequelize[_0xa17c('0x2')]},'email':{'type':Sequelize[_0xa17c('0x2')],'allowNull':![],'unique':_0xa17c('0xa'),'validate':{'isEmail':!![]},'set':function(_0x3dc989){if(_0x3dc989){this[_0xa17c('0x3')](_0xa17c('0xa'),_0x3dc989[_0xa17c('0xb')]());}}},'role':{'type':Sequelize['ENUM'](_0xa17c('0xc'),'user','agent',_0xa17c('0xd')),'allowNull':![]},'password':{'type':Sequelize[_0xa17c('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xa17c('0x2')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':'internal','set':function(_0x6284b8){this['setDataValue'](_0xa17c('0x9'),_0x6284b8);this[_0xa17c('0x3')](_0xa17c('0xe'),_0x6284b8);this[_0xa17c('0x3')]('callerid',util[_0xa17c('0xf')](_0xa17c('0x10'),this['getDataValue'](_0xa17c('0x7')),_0x6284b8));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa17c('0x2')]},'mobile':{'type':Sequelize[_0xa17c('0x2')]},'address':{'type':Sequelize[_0xa17c('0x2')]},'zipcode':{'type':Sequelize['STRING']},'userpic':{'type':Sequelize[_0xa17c('0x2')]},'city':{'type':Sequelize[_0xa17c('0x2')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0xa17c('0x12')]},'voicePause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':_0xa17c('0x13')},'lastPauseAt':{'type':Sequelize[_0xa17c('0x12')]},'chatCapacity':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xa17c('0x14')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'description':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'host':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'defaultValue':_0xa17c('0x15')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0xa17c('0x14')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'regserver':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0xa17c('0x16'),'user',_0xa17c('0x17')),'allowNull':!![],'defaultValue':'friend'},'context':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'defaultValue':'from-sip'},'callingpres':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x19'),'ALLOWED_PASSED_SCREEN',_0xa17c('0x1a'),_0xa17c('0x1b'),_0xa17c('0x1c'),_0xa17c('0x1d'),_0xa17c('0x1e'),_0xa17c('0x1f')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize['STRING'],'allowNull':!![]},'secret':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'transport':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'defaultValue':_0xa17c('0x20'),'set':function(_0x4d321d){this[_0xa17c('0x3')]('transport',_0x4d321d?_0x4d321d[_0xa17c('0x21')](','):null);},'get':function(){return this[_0xa17c('0x22')](_0xa17c('0x23'))?this[_0xa17c('0x22')]('transport')[_0xa17c('0x24')](','):null;},'comment':_0xa17c('0x25')},'dtmfmode':{'type':Sequelize['ENUM'](_0xa17c('0x26'),_0xa17c('0x27'),'shortinfo','inband',_0xa17c('0x28')),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no','nonat','update',_0xa17c('0x2a')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING'],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'nat':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0xd30945){this[_0xa17c('0x3')](_0xa17c('0x2b'),_0xd30945?_0xd30945[_0xa17c('0x21')](','):null);},'get':function(){return this['getDataValue'](_0xa17c('0x2b'))?this[_0xa17c('0x22')](_0xa17c('0x2b'))['split'](','):null;},'comment':_0xa17c('0x2c')},'callgroup':{'type':Sequelize[_0xa17c('0x2')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0xa17c('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xa17c('0x2')]},'language':{'type':Sequelize[_0xa17c('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa17c('0x2d')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa17c('0x2e'),'set':function(_0x64fa5c){this[_0xa17c('0x3')](_0xa17c('0x2f'),_0x64fa5c?_0x64fa5c[_0xa17c('0x21')](';'):'ulaw;alaw;gsm');},'get':function(){return this[_0xa17c('0x22')]('allow')?this[_0xa17c('0x22')](_0xa17c('0x2f'))[_0xa17c('0x24')](';'):null;},'comment':_0xa17c('0x30')},'autoframing':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'set':function(_0x2ad1f5){this[_0xa17c('0x3')](_0xa17c('0x31'),_0x2ad1f5?_0x2ad1f5[_0xa17c('0x21')](','):null);},'get':function(){return this[_0xa17c('0x22')](_0xa17c('0x31'))?this['getDataValue'](_0xa17c('0x31'))[_0xa17c('0x24')](','):null;},'comment':_0xa17c('0x32')},'trustrpid':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM']('yes','no',_0xa17c('0x33')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xa17c('0x18')]('yes','no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'callerid':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![],'defaultValue':_0xa17c('0x34')},'amaflags':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':_0xa17c('0x29')},'busylevel':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xa17c('0x18')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0xa17c('0x18')]('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'template':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no','always'),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0xa17c('0x35'),_0xa17c('0x36'),_0xa17c('0x37')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xa17c('0x38'),_0xa17c('0x39')),'allowNull':!![],'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':_0xa17c('0x29')},'keepalive':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'defaultuser':{'type':Sequelize['STRING'],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'timert1':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'contactdeny':{'type':Sequelize['STRING'],'allowNull':!![]},'contactacl':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no',_0xa17c('0x3a'),_0xa17c('0x3b')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xa17c('0x14')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0xa17c('0x3c'),_0xa17c('0x3d')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'mohinterpret':{'type':Sequelize['STRING'],'allowNull':!![]},'mohsuggest':{'type':Sequelize['STRING'],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0xa17c('0x18')]('yes','no',_0xa17c('0x3e'),_0xa17c('0x3f'),_0xa17c('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xa17c('0x2')]},'resetPasswordExpires':{'type':Sequelize[_0xa17c('0x12')]},'passwordResetAt':{'type':Sequelize['DATE'],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xa17c('0x41')]},'showWebBar':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0,'set':function(_0xfb0f3b){this[_0xa17c('0x3')](_0xa17c('0x42'),_0xfb0f3b);var _0x42d1e3=this[_0xa17c('0x43')]({'plain':!![]});switch(_0xfb0f3b){case 0x0:case 0x1:var _0x321dda=_0x42d1e3['transport']?_[_0xa17c('0x44')](_0x42d1e3[_0xa17c('0x23')])?_0x42d1e3[_0xa17c('0x23')][_0xa17c('0x21')]():_0x42d1e3['transport']:_0xa17c('0x20');if(_0x321dda===_0xa17c('0x45')){_0x321dda=_0xa17c('0x20');}this[_0xa17c('0x3')](_0xa17c('0x23'),_0x321dda);this[_0xa17c('0x3')](_0xa17c('0x46'),'no');this['setDataValue']('avpf',null);this[_0xa17c('0x3')](_0xa17c('0x47'),null);this[_0xa17c('0x3')](_0xa17c('0x48'),null);this[_0xa17c('0x3')](_0xa17c('0x49'),null);this[_0xa17c('0x3')](_0xa17c('0x4a'),null);this[_0xa17c('0x3')]('dtlssetup',null);this[_0xa17c('0x3')]('dtlscertfile',null);this[_0xa17c('0x3')](_0xa17c('0x4b'),null);this[_0xa17c('0x3')](_0xa17c('0x4c'),'no');break;case 0x2:this[_0xa17c('0x3')](_0xa17c('0x23'),_0xa17c('0x45'));this[_0xa17c('0x3')]('encryption',_0xa17c('0x29'));this[_0xa17c('0x3')](_0xa17c('0x4d'),'yes');this[_0xa17c('0x3')]('force_avp',_0xa17c('0x29'));this[_0xa17c('0x3')](_0xa17c('0x48'),_0xa17c('0x29'));this[_0xa17c('0x3')]('dtlsenable',_0xa17c('0x29'));this['setDataValue'](_0xa17c('0x4a'),'no');this[_0xa17c('0x3')](_0xa17c('0x4e'),_0xa17c('0x3d'));this['setDataValue'](_0xa17c('0x4f'),_0x42d1e3[_0xa17c('0x4f')]||_0xa17c('0x50'));this[_0xa17c('0x3')]('dtlsprivatekey',_0x42d1e3[_0xa17c('0x4b')]||_0xa17c('0x51'));this[_0xa17c('0x3')](_0xa17c('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0xa17c('0x41')],'set':function(_0x5436fe){this[_0xa17c('0x3')](_0xa17c('0x52'),_0x5436fe?_0x5436fe[_0xa17c('0x21')](','):[]);},'get':function(){return this[_0xa17c('0x22')](_0xa17c('0x52'))?_[_0xa17c('0x53')](this[_0xa17c('0x22')]('permissions')['split'](','),function(_0x1bc7bb){return parseInt(_0x1bc7bb,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xa17c('0x2')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0xa17c('0x2')]},'phoneBarUnconditional':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xa17c('0x2')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xa17c('0x18')](_0xa17c('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xa17c('0x2')]},'phoneBarEnableJaws':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0xa17c('0x54')],'get':function(){return this[_0xa17c('0x22')](_0xa17c('0x55'))?this['getDataValue'](_0xa17c('0x55')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'interface':{'type':Sequelize[_0xa17c('0x2')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xa17c('0x2')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![],'set':function(_0x345feb){if(typeof _0x345feb===_0xa17c('0x56')){var _0x117bc8=_0x345feb==='1'?!![]:_0x345feb==='0'?![]:_0x345feb===_0xa17c('0x57')?!![]:_0x345feb==='false'?![]:![];this[_0xa17c('0x3')]('screenrecording',_0x117bc8);}else{this[_0xa17c('0x3')](_0xa17c('0x58'),_0x345feb);}}},'blocked':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![],'set':function(_0x577d58){this[_0xa17c('0x3')]('blocked',_0x577d58);if(_0x577d58===!![]){this[_0xa17c('0x3')]('blockedAt',moment());this['setDataValue'](_0xa17c('0x59'),0x0);}else{this[_0xa17c('0x3')](_0xa17c('0x5a'),null);}}},'blockedAt':{'type':Sequelize[_0xa17c('0x12')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xa17c('0x14')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xa17c('0x14')](0x5)[_0xa17c('0x5b')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xa17c('0x11')],'defaultValue':![]}}; \ No newline at end of file +var _0x227d=['PROHIB','udp','transport','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','join','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','refuse','originate','uac','uas','fingerprint','certificate','active','passive','actpass','update,nonat','TEXT','showWebBar','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','phoneBarEnableScreenRecordingByAgent','false','screenrecording','blocked','loginAttempts','UNSIGNED','sequelize','moment','util','exports','STRING','name','setDataValue','The\x20name\x20of\x20the\x20user','fullname','format','\x22%s\x22\x20<%s>','getDataValue','internal','toLowerCase','user','agent','telephone','accountcode','callerid','BOOLEAN','DEFAULT\x20PAUSE','DATE','INTEGER','dynamic','peer','friend','from-sip','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN'];(function(_0x108631,_0x48c5ec){var _0x453fd8=function(_0x11c20f){while(--_0x11c20f){_0x108631['push'](_0x108631['shift']());}};_0x453fd8(++_0x48c5ec);}(_0x227d,0x9a));var _0xd227=function(_0x3c51d4,_0x36ba53){_0x3c51d4=_0x3c51d4-0x0;var _0x53c45f=_0x227d[_0x3c51d4];return _0x53c45f;};'use strict';var Sequelize=require(_0xd227('0x0'));var moment=require(_0xd227('0x1'));var util=require(_0xd227('0x2'));var _=require('lodash');module[_0xd227('0x3')]={'name':{'type':Sequelize[_0xd227('0x4')],'allowNull':![],'unique':_0xd227('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x520c5e){this['setDataValue'](_0xd227('0x5'),_0x520c5e);this[_0xd227('0x6')]('defaultuser',_0x520c5e);},'comment':_0xd227('0x7')},'fullname':{'type':Sequelize[_0xd227('0x4')],'allowNull':![],'set':function(_0x35ecc9){this['setDataValue'](_0xd227('0x8'),_0x35ecc9);this[_0xd227('0x6')]('callerid',util[_0xd227('0x9')](_0xd227('0xa'),_0x35ecc9,this[_0xd227('0xb')](_0xd227('0xc'))));}},'alias':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0xd227('0x4')],'allowNull':![],'unique':'email','validate':{'isEmail':!![]},'set':function(_0x1b8330){if(_0x1b8330){this[_0xd227('0x6')]('email',_0x1b8330[_0xd227('0xd')]());}}},'role':{'type':Sequelize['ENUM']('admin',_0xd227('0xe'),_0xd227('0xf'),_0xd227('0x10')),'allowNull':![]},'password':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0xd227('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0xd227('0xc'),'set':function(_0x524863){this[_0xd227('0x6')]('internal',_0x524863);this['setDataValue'](_0xd227('0x11'),_0x524863);this[_0xd227('0x6')](_0xd227('0x12'),util[_0xd227('0x9')](_0xd227('0xa'),this['getDataValue'](_0xd227('0x8')),_0x524863));}},'salt':{'type':Sequelize[_0xd227('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0xd227('0x4')]},'address':{'type':Sequelize[_0xd227('0x4')]},'zipcode':{'type':Sequelize[_0xd227('0x4')]},'userpic':{'type':Sequelize[_0xd227('0x4')]},'city':{'type':Sequelize[_0xd227('0x4')]},'country':{'type':Sequelize[_0xd227('0x4')]},'online':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize['DATE']},'voicePause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'faxPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'smsPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0xd227('0x4')],'defaultValue':_0xd227('0x14')},'lastPauseAt':{'type':Sequelize[_0xd227('0x15')]},'chatCapacity':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0xd227('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'description':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![],'defaultValue':_0xd227('0x17')},'ipaddr':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0xd227('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize['STRING'],'allowNull':!![]},'regserver':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend','user',_0xd227('0x18')),'allowNull':!![],'defaultValue':_0xd227('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd227('0x1a')},'callingpres':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x1c'),_0xd227('0x1d'),'ALLOWED_FAILED_SCREEN',_0xd227('0x1e'),_0xd227('0x1f'),_0xd227('0x20'),_0xd227('0x21'),_0xd227('0x22')),'allowNull':!![]},'deny':{'type':Sequelize['STRING'],'allowNull':!![]},'permit':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'transport':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0xd227('0x23'),'set':function(_0x5519ca){this[_0xd227('0x6')](_0xd227('0x24'),_0x5519ca?_0x5519ca['join'](','):null);},'get':function(){return this['getDataValue']('transport')?this[_0xd227('0xb')](_0xd227('0x24'))['split'](','):null;},'comment':_0xd227('0x25')},'dtmfmode':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x26'),_0xd227('0x27'),_0xd227('0x28'),_0xd227('0x29'),'auto'),'allowNull':!![],'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no',_0xd227('0x2b'),_0xd227('0x2c'),_0xd227('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd227('0x1b')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'nat':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![],'defaultValue':_0xd227('0x2e'),'set':function(_0x249bfe){this['setDataValue'](_0xd227('0x2f'),_0x249bfe?_0x249bfe[_0xd227('0x30')](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0xd227('0x2f'))[_0xd227('0x31')](','):null;},'comment':_0xd227('0x32')},'callgroup':{'type':Sequelize['STRING']},'namedcallgroup':{'type':Sequelize[_0xd227('0x4')]},'pickupgroup':{'type':Sequelize[_0xd227('0x4')]},'namedpickupgroup':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd227('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xd227('0x4')]},'disallow':{'type':Sequelize[_0xd227('0x4')],'allowNull':![],'defaultValue':_0xd227('0x33')},'allow':{'type':Sequelize[_0xd227('0x4')],'allowNull':![],'defaultValue':_0xd227('0x34'),'set':function(_0x4bd575){this[_0xd227('0x6')](_0xd227('0x35'),_0x4bd575?_0x4bd575[_0xd227('0x30')](';'):'ulaw;alaw;gsm');},'get':function(){return this['getDataValue'](_0xd227('0x35'))?this[_0xd227('0xb')](_0xd227('0x35'))['split'](';'):null;},'comment':_0xd227('0x36')},'autoframing':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![],'set':function(_0x173e00){this[_0xd227('0x6')](_0xd227('0x37'),_0x173e00?_0x173e00[_0xd227('0x30')](','):null);},'get':function(){return this['getDataValue'](_0xd227('0x37'))?this[_0xd227('0xb')](_0xd227('0x37'))[_0xd227('0x31')](','):null;},'comment':_0xd227('0x38')},'trustrpid':{'type':Sequelize['ENUM'](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xd227('0x2a'),'no',_0xd227('0x39')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize['STRING'],'allowNull':!![]},'callerid':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![],'defaultValue':_0xd227('0x3a')},'amaflags':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':_0xd227('0x2a')},'busylevel':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0xd227('0x1b')]('yes','no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0xd227('0x1b')]('yes','no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no',_0xd227('0x3b')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0xd227('0x1b')]('accept',_0xd227('0x3c'),_0xd227('0x3d')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0xd227('0x3e'),_0xd227('0x3f')),'allowNull':!![],'defaultValue':_0xd227('0x3f')},'t38pt_usertpsource':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'qualify':{'type':Sequelize[_0xd227('0x1b')]('yes','no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM']('yes','no',_0xd227('0x40'),_0xd227('0x41')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x42'),_0xd227('0x43'),_0xd227('0x44')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize[_0xd227('0x16')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0xd227('0x1b')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM'](_0xd227('0x2a'),'no',_0xd227('0x2b'),_0xd227('0x2c'),_0xd227('0x45')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0xd227('0x4')]},'resetPasswordExpires':{'type':Sequelize[_0xd227('0x15')]},'passwordResetAt':{'type':Sequelize[_0xd227('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0xd227('0x46')]},'showWebBar':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0,'set':function(_0x10a737){this[_0xd227('0x6')](_0xd227('0x47'),_0x10a737);var _0x865651=this['get']({'plain':!![]});switch(_0x10a737){case 0x0:case 0x1:var _0xc8a194=_0x865651[_0xd227('0x24')]?_[_0xd227('0x48')](_0x865651[_0xd227('0x24')])?_0x865651['transport'][_0xd227('0x30')]():_0x865651[_0xd227('0x24')]:_0xd227('0x23');if(_0xc8a194===_0xd227('0x49')){_0xc8a194=_0xd227('0x23');}this['setDataValue'](_0xd227('0x24'),_0xc8a194);this['setDataValue'](_0xd227('0x4a'),'no');this['setDataValue'](_0xd227('0x4b'),null);this[_0xd227('0x6')](_0xd227('0x4c'),null);this['setDataValue'](_0xd227('0x4d'),null);this['setDataValue'](_0xd227('0x4e'),null);this[_0xd227('0x6')](_0xd227('0x4f'),null);this['setDataValue'](_0xd227('0x50'),null);this['setDataValue'](_0xd227('0x51'),null);this[_0xd227('0x6')]('dtlsprivatekey',null);this[_0xd227('0x6')](_0xd227('0x52'),'no');break;case 0x2:this['setDataValue']('transport',_0xd227('0x49'));this['setDataValue']('encryption',_0xd227('0x2a'));this[_0xd227('0x6')](_0xd227('0x4b'),_0xd227('0x2a'));this[_0xd227('0x6')]('force_avp',_0xd227('0x2a'));this[_0xd227('0x6')](_0xd227('0x4d'),_0xd227('0x2a'));this[_0xd227('0x6')]('dtlsenable','yes');this['setDataValue'](_0xd227('0x4f'),'no');this[_0xd227('0x6')](_0xd227('0x50'),_0xd227('0x44'));this[_0xd227('0x6')]('dtlscertfile',_0x865651[_0xd227('0x51')]||_0xd227('0x53'));this[_0xd227('0x6')](_0xd227('0x54'),_0x865651[_0xd227('0x54')]||_0xd227('0x55'));this[_0xd227('0x6')](_0xd227('0x52'),_0xd227('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0xd227('0x46')],'set':function(_0x1963f7){this['setDataValue'](_0xd227('0x56'),_0x1963f7?_0x1963f7['join'](','):[]);},'get':function(){return this['getDataValue'](_0xd227('0x56'))?_[_0xd227('0x57')](this[_0xd227('0xb')]('permissions')[_0xd227('0x31')](','),function(_0x42498c){return parseInt(_0x42498c,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0xd227('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0xd227('0x4')]},'phoneBarBusyNumber':{'type':Sequelize[_0xd227('0x4')]},'phoneBarUnconditional':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0xd227('0x4')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0xd227('0x1b')](_0xd227('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0xd227('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xd227('0xb')]('phoneBarEnableScreenRecordingByAgent')?this['getDataValue'](_0xd227('0x58')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'interface':{'type':Sequelize[_0xd227('0x4')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0xd227('0x4')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![],'set':function(_0x1248c6){if(typeof _0x1248c6==='string'){var _0x2049cf=_0x1248c6==='1'?!![]:_0x1248c6==='0'?![]:_0x1248c6==='true'?!![]:_0x1248c6===_0xd227('0x59')?![]:![];this[_0xd227('0x6')]('screenrecording',_0x2049cf);}else{this[_0xd227('0x6')](_0xd227('0x5a'),_0x1248c6);}}},'blocked':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![],'set':function(_0x5a9d1e){this[_0xd227('0x6')](_0xd227('0x5b'),_0x5a9d1e);if(_0x5a9d1e===!![]){this[_0xd227('0x6')]('blockedAt',moment());this['setDataValue'](_0xd227('0x5c'),0x0);}else{this[_0xd227('0x6')]('blockedAt',null);}}},'blockedAt':{'type':Sequelize[_0xd227('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0xd227('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0xd227('0x16')](0x5)[_0xd227('0x5d')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xd227('0x13')],'defaultValue':!![]},'ignorePauseForPreviewCalls':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'selectRecallMeCampaign':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]},'adSsoEnabled':{'type':Sequelize[_0xd227('0x13')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 936fc69..89b353f 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 _0x2ef3=['OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','getWhatsappInteractions','phone','mobile','format','LOCAL/%s@from-sip/n','intrf','user:%s','headers','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','device','LOGININPAUSE','concat','isMiddleware','resolve','pause','QueuePause','PAUSE','updateAttributes','getChannels','DEFAULT\x20PAUSE','mailPause','chatPause','faxPause','pauseType','lastPauseAt','unpause','manual','%s%s','Pause','getTeams','Team','addTeams','setDataValue','getChatQueues','Chat','Mail','getSmsQueues','Sms','Whatsapp','Fax','Openchannel','flatten','transaction','addAgent','getDataValue','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getMailQueues','getWhatsappQueues','getOpenchannelQueues','Voice','getLists','getAgents','values','You\x20can\x27t\x20delete\x20yourself','user_has_chat_interactions:save','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','VoicePrefix','getVoicePrefixes','FaxAccount','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','OpenchannelAccount','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getWhatsappAccounts','WhatsappAccount','addWhatsappAccounts','removeWhatsappAccounts','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$like','$notLike','$iLike','$notILike','$contains','$contained','$any','CmHopper','firstName','lastName','Contact','VoiceQueue','getApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','token','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','Unable\x20to\x20retrieve\x20the\x20current\x20user','getPresence','teams','queues','inbound','lower','col','asc','desc','substring','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','http','idle','unavailable','voiceStatus','busy','slice','toUpperCase','QueryTypes','select','field','ui.','InteractionId','ui.createdAt','_interactions','ui.UserId\x20=\x20?','toString','moment','bluebird','util','path','lodash','squel','ioredis','../../components/auth/service','../../config/logger','api','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','register','defaults','localhost','request','info','debug','request\x20sent','stringify','error','message','User,\x20%s,\x20%s','result','catch','sendStatus','end','json','offset','undefined','count','limit','status','set','update','then','destroy','get','role','admin','user','agent','Telephones','filter','ignore','map','value','find','name','UserProfileResource','send','index','rawAttributes','type','key','includes','password','salt','getOptions','where','query','includeAll','include','attributes','push','User','findAll','rows','openTabs','length','chat','dataValues','sms','fax','mail','openchannel','all','show','params','differenceBy','keys','filters','intersection','model','fields','merge','options','true','whatsapp','body','addContacts','omit','internal','Setting','securePassword','validatePasswordPattern','max','isNil','min_internal','sequelize','SELECT','from','VoiceMail','email','permissions','102','103','104','106','108','109','100','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','settingsEnabled','userProfileId','UserProfileSection','Agents','create','bulkCreate','some','each','telephone','isEmpty','autoAssociation','compact','oldPassword','newPassword','ValidationError','authenticate','Sequelize','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','enforcePasswordHistory','previousPasswords','validatePasswordHistory','passwordHistoryLimit','updatePasswordsHistory','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','add','capitalize','toLowerCase','penalty','spread','ids','QueueId','emit','voice','SIP/%s','upsert','Unknown\x20channel','remove','Queue:remove','UserVoiceQueueRt','userpic','filename','root','server/files/images/logos/default_profile.png','download','existsSync','join','getOpenTabs','ChatOpenTabs','CHAT','FaxOpenTabs','FAX','createdAt','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','findOne','order','pick','hasOwnProperty','CmList','List','Tag','Tags','color','nolimit','Queue','Unknown\x20role','Queues','getVoiceQueuesRt','sort','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording','getScreenRecordings','ScreenRecording','ChatInteraction','getChatInteractions','getOpenchannelInteractions'];(function(_0x57862e,_0x2c787f){var _0x1f44ba=function(_0x25aa7e){while(--_0x25aa7e){_0x57862e['push'](_0x57862e['shift']());}};_0x1f44ba(++_0x2c787f);}(_0x2ef3,0xba));var _0x32ef=function(_0x1539cc,_0x44824c){_0x1539cc=_0x1539cc-0x0;var _0x3a1c4e=_0x2ef3[_0x1539cc];return _0x3a1c4e;};'use strict';var moment=require(_0x32ef('0x0'));var BPromise=require(_0x32ef('0x1'));var util=require(_0x32ef('0x2'));var path=require(_0x32ef('0x3'));var fs=require('fs');var _=require(_0x32ef('0x4'));var squel=require(_0x32ef('0x5'));var jayson=require('jayson/promise');var Redis=require(_0x32ef('0x6'));var authService=require(_0x32ef('0x7'));var qs=require('../../components/parsers/qs');var logger=require(_0x32ef('0x8'))(_0x32ef('0x9'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0xa'));var db=require(_0x32ef('0xb'))['db'];var socket=require(_0x32ef('0xc'))(new Redis(config[_0x32ef('0xd')]));require(_0x32ef('0xe'))[_0x32ef('0xf')](socket);config[_0x32ef('0xd')]=_[_0x32ef('0x10')](config[_0x32ef('0xd')],{'host':_0x32ef('0x11'),'port':0x18eb});var client=jayson['client']['http']({'port':0x232a});var values;function respondWithRpcPromise(_0x401d0b,_0x33281d,_0x45bfd5,_0x1499c2){return new BPromise(function(_0x5af651,_0x193714){var _0x5afcc2=_0x1499c2||client;return _0x5afcc2[_0x32ef('0x12')](_0x401d0b,_0x45bfd5)['then'](function(_0x3e98df){logger[_0x32ef('0x13')]('User,\x20%s,\x20%s',_0x33281d,'request\x20sent');logger[_0x32ef('0x14')]('User,\x20%s,\x20%s,\x20%s',_0x33281d,_0x32ef('0x15'),JSON[_0x32ef('0x16')](_0x3e98df));if(_0x3e98df[_0x32ef('0x17')]){if(_0x3e98df[_0x32ef('0x17')]['code']===0x1f4){logger['error']('User,\x20%s,\x20%s',_0x33281d,_0x3e98df[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x193714(_0x3e98df[_0x32ef('0x17')]['message']);}logger['error'](_0x32ef('0x19'),_0x33281d,_0x3e98df[_0x32ef('0x17')][_0x32ef('0x18')]);return _0x5af651(_0x3e98df['error'][_0x32ef('0x18')]);}else{logger[_0x32ef('0x13')]('User,\x20%s,\x20%s',_0x33281d,_0x32ef('0x15'));_0x5af651(_0x3e98df[_0x32ef('0x1a')][_0x32ef('0x18')]);}})[_0x32ef('0x1b')](function(_0x445cda){logger[_0x32ef('0x17')]('User,\x20%s,\x20%s',_0x33281d,_0x445cda);_0x193714(_0x445cda);});});}function respondWithStatusCode(_0x3c5b78,_0x5cc3ef){_0x5cc3ef=_0x5cc3ef||0xcc;return function(_0x309866){if(_0x309866){return _0x3c5b78[_0x32ef('0x1c')](_0x5cc3ef);}return _0x3c5b78['status'](_0x5cc3ef)[_0x32ef('0x1d')]();};}function respondWithResult(_0x97780,_0x5e8898){_0x5e8898=_0x5e8898||0xc8;return function(_0x55f7f2){if(_0x55f7f2){return _0x97780['status'](_0x5e8898)[_0x32ef('0x1e')](_0x55f7f2);}};}function respondWithFilteredResult(_0xb30fab,_0x225feb){return function(_0x478bef){if(_0x478bef){var _0x59585f=typeof _0x225feb[_0x32ef('0x1f')]==='undefined'&&typeof _0x225feb['limit']===_0x32ef('0x20');var _0x14d4b3=_0x478bef[_0x32ef('0x21')];var _0x1dbe98=_0x59585f?0x0:_0x225feb[_0x32ef('0x1f')];var _0x234175=_0x59585f?_0x478bef[_0x32ef('0x21')]:_0x225feb[_0x32ef('0x1f')]+_0x225feb[_0x32ef('0x22')];var _0x2f52d7;if(_0x234175>=_0x14d4b3){_0x234175=_0x14d4b3;_0x2f52d7=0xc8;}else{_0x2f52d7=0xce;}_0xb30fab[_0x32ef('0x23')](_0x2f52d7);return _0xb30fab[_0x32ef('0x24')]('Content-Range',_0x1dbe98+'-'+_0x234175+'/'+_0x14d4b3)[_0x32ef('0x1e')](_0x478bef);}return null;};}function saveUpdates(_0x2f5d06){return function(_0x5a04cd){if(_0x5a04cd){return _0x5a04cd[_0x32ef('0x25')](_0x2f5d06)[_0x32ef('0x26')](function(_0x30b250){return _0x30b250;});}return null;};}function removeEntity(_0x26e207){return function(_0x50a95b){if(_0x50a95b){return _0x50a95b[_0x32ef('0x27')]()[_0x32ef('0x26')](function(){var _0x31dbc3=_0x50a95b[_0x32ef('0x28')]({'plain':!![]});if(_0x31dbc3[_0x32ef('0x29')]===_0x32ef('0x2a'))return;var _0x1a122d=[{'name':'Users','value':_0x32ef('0x2b'),'ignore':!![]},{'name':'Agents','value':_0x32ef('0x2c'),'ignore':![]},{'name':_0x32ef('0x2d'),'value':'telephone','ignore':![]}];var _0xcc2efb=_(_0x1a122d)[_0x32ef('0x2e')](_0x32ef('0x2f'))[_0x32ef('0x30')](_0x32ef('0x31'))['value']();if(_['includes'](_0xcc2efb,_0x31dbc3[_0x32ef('0x29')])){return;}var _0x5dadf7=_[_0x32ef('0x32')](_0x1a122d,[_0x32ef('0x31'),_0x31dbc3[_0x32ef('0x29')]])[_0x32ef('0x33')];return db[_0x32ef('0x34')][_0x32ef('0x27')]({'where':{'type':_0x5dadf7,'resourceId':_0x31dbc3['id']}})['then'](function(){return _0x50a95b;});})['then'](function(){_0x26e207['status'](0xcc)[_0x32ef('0x1d')]();});}};}function handleEntityNotFound(_0x3c4651){return function(_0x136b02){if(!_0x136b02){_0x3c4651['sendStatus'](0x194);}return _0x136b02;};}function handleError(_0x4fb402,_0x1c3633){_0x1c3633=_0x1c3633||0x1f4;return function(_0x2bd8a9){logger[_0x32ef('0x17')](_0x2bd8a9['stack']);if(_0x2bd8a9['name']){delete _0x2bd8a9[_0x32ef('0x33')];}_0x4fb402[_0x32ef('0x23')](_0x1c3633)[_0x32ef('0x35')](_0x2bd8a9);};}exports[_0x32ef('0x36')]=function(_0x3a7c49,_0x211c79){var _0x3223d5={},_0x21da90={'count':0x0,'rows':[]};var _0x7f2319=_(db['User'][_0x32ef('0x37')])[_0x32ef('0x30')](function(_0x14b54f){return{'name':_0x14b54f['fieldName'],'type':_0x14b54f[_0x32ef('0x38')][_0x32ef('0x39')]};})[_0x32ef('0x2e')](function(_0x393a89){return!_[_0x32ef('0x3a')]([_0x32ef('0x3b'),_0x32ef('0x3c')],_0x393a89[_0x32ef('0x33')]);})[_0x32ef('0x31')]();_0x3223d5=qs[_0x32ef('0x3d')](_0x7f2319,_0x3a7c49);var _0xb4db74={'where':_0x3223d5[_0x32ef('0x3e')]};return db['User'][_0x32ef('0x21')](_0xb4db74)[_0x32ef('0x26')](function(_0x26a40f){_0x21da90[_0x32ef('0x21')]=_0x26a40f;if(_0x3a7c49[_0x32ef('0x3f')][_0x32ef('0x40')]){_0x3223d5[_0x32ef('0x41')]=[{'all':!![]}];}if(!_['includes'](_0x3223d5['attributes'],'id')){_0x3223d5[_0x32ef('0x42')][_0x32ef('0x43')]('id');}return db[_0x32ef('0x44')][_0x32ef('0x45')](_0x3223d5);})['then'](function(_0x2901a1){_0x21da90[_0x32ef('0x46')]=_0x2901a1;if(_0x3a7c49['query'][_0x32ef('0x47')]==='true'){var _0xcb3c08=[];for(var _0x100ec7=0x0;_0x100ec7<_0x21da90[_0x32ef('0x46')][_0x32ef('0x48')];_0x100ec7++){_0xcb3c08[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x49'),_0x21da90[_0x32ef('0x46')][_0x100ec7][_0x32ef('0x4a')]));_0xcb3c08[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4b'),_0x21da90['rows'][_0x100ec7][_0x32ef('0x4a')]));_0xcb3c08['push'](get_open_tabs(_0x32ef('0x4c'),_0x21da90[_0x32ef('0x46')][_0x100ec7][_0x32ef('0x4a')]));_0xcb3c08['push'](get_open_tabs(_0x32ef('0x4d'),_0x21da90[_0x32ef('0x46')][_0x100ec7][_0x32ef('0x4a')]));_0xcb3c08[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4e'),_0x21da90[_0x32ef('0x46')][_0x100ec7][_0x32ef('0x4a')]));_0xcb3c08['push'](get_open_tabs('whatsapp',_0x21da90[_0x32ef('0x46')][_0x100ec7][_0x32ef('0x4a')]));}return BPromise[_0x32ef('0x4f')](_0xcb3c08)[_0x32ef('0x26')](function(_0x209361){return _0x21da90;});}else{return _0x21da90;}})[_0x32ef('0x26')](respondWithFilteredResult(_0x211c79,_0x3223d5))[_0x32ef('0x1b')](handleError(_0x211c79,null));};exports[_0x32ef('0x50')]=function(_0xc10e7,_0x1ebedf){var _0x35a294={'raw':![],'where':{'id':_0xc10e7[_0x32ef('0x51')]['id']}},_0x30ad49={};_0x30ad49['model']=_[_0x32ef('0x52')](_[_0x32ef('0x53')](db[_0x32ef('0x44')][_0x32ef('0x37')]),[_0x32ef('0x3b'),_0x32ef('0x3c')]);_0x30ad49[_0x32ef('0x3f')]=_[_0x32ef('0x53')](_0xc10e7[_0x32ef('0x3f')]);_0x30ad49[_0x32ef('0x54')]=_[_0x32ef('0x55')](_0x30ad49[_0x32ef('0x56')],_0x30ad49[_0x32ef('0x3f')]);_0x35a294[_0x32ef('0x42')]=_[_0x32ef('0x55')](_0x30ad49[_0x32ef('0x56')],qs[_0x32ef('0x57')](_0xc10e7[_0x32ef('0x3f')]['fields']));_0x35a294['attributes']=_0x35a294[_0x32ef('0x42')][_0x32ef('0x48')]?_0x35a294[_0x32ef('0x42')]:_0x30ad49[_0x32ef('0x56')];if(_0xc10e7[_0x32ef('0x3f')][_0x32ef('0x40')]){_0x35a294[_0x32ef('0x41')]=[{'all':!![]}];}_0x35a294=_[_0x32ef('0x58')]({},_0x35a294,_0xc10e7[_0x32ef('0x59')]);if(!_[_0x32ef('0x3a')](_0x35a294[_0x32ef('0x42')],'id')){_0x35a294['attributes'][_0x32ef('0x43')]('id');}return db[_0x32ef('0x44')][_0x32ef('0x32')](_0x35a294)[_0x32ef('0x26')](handleEntityNotFound(_0x1ebedf,null))[_0x32ef('0x26')](function(_0x387cf0){var _0x52c588=[];values=_0x387cf0;if(_0xc10e7[_0x32ef('0x3f')][_0x32ef('0x47')]===_0x32ef('0x5a')){_0x52c588['push'](get_open_tabs(_0x32ef('0x49'),_0x387cf0['dataValues']));_0x52c588[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4b'),_0x387cf0['dataValues']));_0x52c588[_0x32ef('0x43')](get_open_tabs('openchannel',_0x387cf0[_0x32ef('0x4a')]));_0x52c588[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x5b'),_0x387cf0[_0x32ef('0x4a')]));_0x52c588[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4c'),_0x387cf0[_0x32ef('0x4a')]));_0x52c588['push'](get_open_tabs('mail',_0x387cf0[_0x32ef('0x4a')]));return BPromise['all'](_0x52c588);}else{return values;}})['then'](function(_0xb519e9){return values;})[_0x32ef('0x26')](respondWithResult(_0x1ebedf,null))[_0x32ef('0x1b')](handleError(_0x1ebedf,null));};exports[_0x32ef('0x25')]=function(_0x2468e6,_0x356704){if(_0x2468e6[_0x32ef('0x5c')]['id']){delete _0x2468e6[_0x32ef('0x5c')]['id'];}delete _0x2468e6[_0x32ef('0x5c')][_0x32ef('0x29')];return db['User']['find']({'where':{'id':_0x2468e6[_0x32ef('0x51')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x356704,null))['then'](saveUpdates(_0x2468e6[_0x32ef('0x5c')],null))[_0x32ef('0x26')](respondWithResult(_0x356704,null))[_0x32ef('0x1b')](handleError(_0x356704,null));};exports['describe']=function(_0x2ac877,_0x3c31d0){return db[_0x32ef('0x44')]['describe']()['then'](respondWithResult(_0x3c31d0,null))[_0x32ef('0x1b')](handleError(_0x3c31d0,null));};exports['addContacts']=function(_0x17f447,_0x5bb114){return db['User'][_0x32ef('0x32')]({'where':{'id':_0x17f447[_0x32ef('0x51')]['id']}})[_0x32ef('0x26')](handleEntityNotFound(_0x5bb114,null))['then'](function(_0x9c89a2){if(_0x9c89a2){return _0x9c89a2[_0x32ef('0x5d')](_0x17f447[_0x32ef('0x5c')]['ids'],_[_0x32ef('0x5e')](_0x17f447[_0x32ef('0x5c')],['ids','id'])||{});}})['then'](respondWithResult(_0x5bb114,null))[_0x32ef('0x1b')](handleError(_0x5bb114,null));};function validateUser(_0x3a6697){return new BPromise(function(_0x2518a0,_0x339625){if(_0x3a6697[_0x32ef('0x5f')])return _0x2518a0(_0x3a6697);return db[_0x32ef('0x60')]['findById'](0x1)[_0x32ef('0x26')](function(_0x63b65){if(_0x63b65[_0x32ef('0x61')])authService[_0x32ef('0x62')](_0x3a6697[_0x32ef('0x3b')]);db[_0x32ef('0x44')][_0x32ef('0x63')](_0x32ef('0x5f'))[_0x32ef('0x26')](function(_0x4fa4df){if(_[_0x32ef('0x64')](_0x4fa4df)){_0x3a6697[_0x32ef('0x5f')]=_0x63b65[_0x32ef('0x65')]||0x1;return;}if(_[_0x32ef('0x64')](_0x63b65[_0x32ef('0x65')])||_0x63b65['min_internal']===_0x4fa4df){_0x3a6697['internal']=_0x4fa4df+0x1;return;}if(_0x63b65[_0x32ef('0x65')]>_0x4fa4df){_0x3a6697[_0x32ef('0x5f')]=_0x63b65[_0x32ef('0x65')];return;}return db[_0x32ef('0x66')][_0x32ef('0x3f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x32ef('0x66')]['QueryTypes'][_0x32ef('0x67')]})[_0x32ef('0x26')](function(_0x48b6f4){if(_0x48b6f4&&_0x48b6f4['length']){for(var _0x2c9f7a=0x0,_0x1538d0=_0x48b6f4[_0x32ef('0x48')];_0x2c9f7a<_0x1538d0&&_['isNil'](_0x3a6697['internal']);_0x2c9f7a++){if(_0x63b65[_0x32ef('0x65')]<=_0x48b6f4[_0x2c9f7a][_0x32ef('0x68')]){_0x3a6697[_0x32ef('0x5f')]=_0x48b6f4[_0x2c9f7a][_0x32ef('0x68')];}else if(_0x63b65['min_internal']>_0x48b6f4[_0x2c9f7a][_0x32ef('0x68')]&&_0x63b65[_0x32ef('0x65')]<=_0x48b6f4[_0x2c9f7a]['to']){_0x3a6697[_0x32ef('0x5f')]=_0x63b65[_0x32ef('0x65')];}}}if(_[_0x32ef('0x64')](_0x3a6697[_0x32ef('0x5f')])){_0x3a6697[_0x32ef('0x5f')]=_0x4fa4df+0x1;}return _0x2518a0(_0x3a6697);});});})[_0x32ef('0x1b')](function(_0x3cdfe6){_0x339625(_0x3cdfe6);});});}function updateUser(_0x1d0448){return new BPromise(function(_0x132d9f,_0x3978cb){try{if(_0x1d0448['voicemail']){_0x1d0448['mailbox']=_0x1d0448[_0x32ef('0x5f')];_0x1d0448[_0x32ef('0x69')]={'mailbox':_0x1d0448['internal'],'password':_0x1d0448[_0x32ef('0x3b')],'fullname':_0x1d0448['fullname'],'email':_0x1d0448[_0x32ef('0x6a')]};}if(_0x1d0448[_0x32ef('0x29')]===_0x32ef('0x2c')){if(!_0x1d0448['permissions'])_0x1d0448[_0x32ef('0x6b')]=['101',_0x32ef('0x6c'),_0x32ef('0x6d'),'113','110',_0x32ef('0x6e'),'105',_0x32ef('0x6f'),'107',_0x32ef('0x70'),_0x32ef('0x71'),_0x32ef('0x72'),'111','114','115'];}_0x132d9f(_0x1d0448);}catch(_0x574fb3){_0x3978cb(_0x574fb3);}});}exports['create']=function(_0x267364,_0x13a374){if(_0x267364[_0x32ef('0x2b')][_0x32ef('0x29')]===_0x32ef('0x2c'))throw new Error(_0x32ef('0x73'));if(_0x267364['body'][_0x32ef('0x29')]==='user'&&_0x267364['user'][_0x32ef('0x29')]!=='admin'){throw new Error(_0x32ef('0x74'));}if(_0x267364[_0x32ef('0x5c')]['role']===_0x32ef('0x2a')&&_0x267364[_0x32ef('0x2b')][_0x32ef('0x29')]!==_0x32ef('0x2a')){throw new Error(_0x32ef('0x75'));}return licenseUtil[_0x32ef('0x76')]([_0x267364['body']])['then'](function(){return validateUser(_0x267364[_0x32ef('0x5c')]);})['then'](function(_0x41bbe1){return updateUser(_0x41bbe1)[_0x32ef('0x26')](function(_0x114d8e){if(_0x114d8e[_0x32ef('0x29')]===_0x32ef('0x2a')){_0x114d8e[_0x32ef('0x77')]=_0x267364['user'][_0x32ef('0x77')];delete _0x114d8e[_0x32ef('0x78')];}return _0x114d8e;});})[_0x32ef('0x26')](function(_0x2aeb11){return db[_0x32ef('0x44')]['create'](_0x2aeb11,{'include':[{'model':db['VoiceMail'],'as':_0x32ef('0x69')}]});})[_0x32ef('0x26')](function(_0x54d7ea){if(_0x267364[_0x32ef('0x5c')][_0x32ef('0x29')]===_0x32ef('0x2b'))return _0x54d7ea;if(_0x267364[_0x32ef('0x2b')][_0x32ef('0x29')]!==_0x32ef('0x2b'))return _0x54d7ea;return db[_0x32ef('0x79')][_0x32ef('0x32')]({'where':{'name':_0x54d7ea[_0x32ef('0x29')]==='agent'?_0x32ef('0x7a'):_0x32ef('0x2d'),'userProfileId':_0x267364['user'][_0x32ef('0x78')]},'raw':!![]})['then'](function(_0x18f96c){if(!_0x18f96c||_0x18f96c['autoAssociation']!=0x0)return _0x54d7ea;return db[_0x32ef('0x34')][_0x32ef('0x7b')]({'name':_0x54d7ea[_0x32ef('0x33')],'resourceId':_0x54d7ea['id'],'type':_0x18f96c[_0x32ef('0x33')],'sectionId':_0x18f96c['id']},{})['then'](function(){return _0x54d7ea;});})[_0x32ef('0x1b')](function(_0x31cff1){logger[_0x32ef('0x17')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x31cff1);throw _0x31cff1;});})['then'](respondWithResult(_0x13a374,0xc9))['catch'](handleError(_0x13a374,null));};exports[_0x32ef('0x7c')]=function(_0x12f5ef,_0x1ec12d){var _0x34fd2b=_0x12f5ef[_0x32ef('0x5c')];var _0x5a1696=[];if(_0x12f5ef[_0x32ef('0x2b')]['role']===_0x32ef('0x2c'))throw new Error(_0x32ef('0x73'));if(_[_0x32ef('0x7d')](_0x34fd2b,['role',_0x32ef('0x2b')])&&_0x12f5ef[_0x32ef('0x2b')][_0x32ef('0x29')]!==_0x32ef('0x2a')){throw new Error(_0x32ef('0x74'));}if(_['some'](_0x34fd2b,[_0x32ef('0x29'),'admin'])&&_0x12f5ef[_0x32ef('0x2b')][_0x32ef('0x29')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x32ef('0x76')](_0x34fd2b)[_0x32ef('0x26')](function(){return validateUser(_0x34fd2b[0x0]);})[_0x32ef('0x26')](function(){for(var _0x3b9896=0x1;_0x3b9896<_0x34fd2b['length'];_0x3b9896++){var _0x356fd4=_0x34fd2b[_0x3b9896-0x1]['internal'];if(!_0x34fd2b[_0x3b9896]['internal'])_0x34fd2b[_0x3b9896][_0x32ef('0x5f')]=_0x356fd4+0x1;_0x5a1696['push'](validateUser(_0x34fd2b[_0x3b9896]));}return BPromise[_0x32ef('0x4f')](_0x5a1696);})[_0x32ef('0x26')](function(){_0x5a1696=[];for(var _0x20a92b=0x0;_0x20a92b<_0x34fd2b['length'];_0x20a92b++){_0x5a1696['push'](updateUser(_0x34fd2b[_0x20a92b]));}return BPromise[_0x32ef('0x4f')](_0x5a1696);})[_0x32ef('0x26')](function(){return BPromise[_0x32ef('0x7e')](_0x34fd2b,function(_0x3741f8){return db[_0x32ef('0x44')][_0x32ef('0x7b')](_0x3741f8,{'include':[{'model':db[_0x32ef('0x69')],'as':'VoiceMail'}]})[_0x32ef('0x26')](function(_0x8f0436){_0x3741f8['id']=_0x8f0436['id'];return _0x3741f8;});});})[_0x32ef('0x26')](function(_0x143ced){if(_0x12f5ef['body']['role']===_0x32ef('0x2b'))return _0x143ced;if(_0x12f5ef['user'][_0x32ef('0x29')]!==_0x32ef('0x2b'))return _0x143ced;var _0x50f13b=_['some'](_0x143ced,function(_0x5f2637){return _0x5f2637[_0x32ef('0x29')]===_0x32ef('0x2c')||_0x5f2637[_0x32ef('0x29')]===_0x32ef('0x7f');});if(!_0x50f13b)return _0x143ced;return db['UserProfileSection'][_0x32ef('0x45')]({'where':{'name':{'$or':[_0x32ef('0x7a'),_0x32ef('0x2d')]},'userProfileId':_0x12f5ef['user'][_0x32ef('0x78')]},'raw':!![]})['then'](function(_0x1b0063){if(_[_0x32ef('0x80')](_0x1b0063)||!_['some'](_0x1b0063,['autoAssociation',0x0]))return _0x143ced;_0x5a1696=[];var _0x2d6a9a=_(_0x1b0063)[_0x32ef('0x30')](function(_0x435538){if(_0x435538[_0x32ef('0x81')]===0x1)return;return _0x435538[_0x32ef('0x33')]===_0x32ef('0x7a')?_0x32ef('0x2c'):_0x32ef('0x7f');})[_0x32ef('0x82')]()['value']();for(var _0x10594a=0x0;_0x10594a<_0x143ced['length'];_0x10594a++){if(!_[_0x32ef('0x3a')](_0x2d6a9a,_0x143ced[_0x10594a][_0x32ef('0x29')]))return;var _0x1d9d57=_0x143ced[_0x10594a][_0x32ef('0x29')]===_0x32ef('0x2c')?'Agents':_0x32ef('0x2d');_0x5a1696[_0x32ef('0x43')](db[_0x32ef('0x34')][_0x32ef('0x7b')]({'name':_0x143ced[_0x10594a][_0x32ef('0x33')],'resourceId':_0x143ced[_0x10594a]['id'],'type':_0x1d9d57,'sectionId':_[_0x32ef('0x32')](_0x1b0063,[_0x32ef('0x33'),_0x1d9d57])['id']},{}));}return BPromise[_0x32ef('0x4f')](_0x5a1696);});})[_0x32ef('0x26')](respondWithResult(_0x1ec12d,0xc9))['catch'](handleError(_0x1ec12d,null));};exports['changePassword']=function(_0x4fb09e,_0x2e01fa){if(_0x4fb09e[_0x32ef('0x5c')]['id']){delete _0x4fb09e['body']['id'];}return db[_0x32ef('0x44')]['find']({'where':{'id':_0x4fb09e[_0x32ef('0x51')]['id']}})['then'](function(_0x519eda){if(!_0x519eda)return null;if(_0x519eda['id']===_0x4fb09e[_0x32ef('0x2b')]['id']){if(!_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x83')]||!_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x84')]){throw new db['Sequelize'][(_0x32ef('0x85'))]('Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword');}if(!_0x519eda[_0x32ef('0x86')](_0x4fb09e['body']['oldPassword'])){throw new db['Sequelize']['ValidationError']('Wrong\x20credentials');}if(_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x83')]===_0x4fb09e['body'][_0x32ef('0x84')]){throw new db[(_0x32ef('0x87'))][(_0x32ef('0x85'))](_0x32ef('0x88'));}}else if(_0x4fb09e[_0x32ef('0x2b')][_0x32ef('0x29')]==='admin'){if(!_0x4fb09e[_0x32ef('0x5c')]['newPassword']){throw new db[(_0x32ef('0x87'))][(_0x32ef('0x85'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}}else if(_0x4fb09e[_0x32ef('0x2b')]['role']===_0x32ef('0x2b')){if(!_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x84')]){throw new db[(_0x32ef('0x87'))]['ValidationError'](_0x32ef('0x89'));}if(_0x519eda[_0x32ef('0x29')]!==_0x32ef('0x2c')){throw new db[(_0x32ef('0x87'))]['ValidationError'](_0x32ef('0x73'));}}else{throw new db['Sequelize'][(_0x32ef('0x85'))](_0x32ef('0x73'));}return _0x519eda;})[_0x32ef('0x26')](handleEntityNotFound(_0x2e01fa,null))[_0x32ef('0x26')](function(_0x1cbb24){return db[_0x32ef('0x60')]['findOne']({'attributes':['id',_0x32ef('0x61'),'enforcePasswordHistory','passwordHistoryLimit']})[_0x32ef('0x26')](function(_0x1e5237){if(_0x1e5237[_0x32ef('0x61')])authService[_0x32ef('0x62')](_0x4fb09e['body'][_0x32ef('0x84')]);if(!_0x1e5237[_0x32ef('0x8a')]||!_0x1cbb24[_0x32ef('0x8b')])return _0x1cbb24;authService[_0x32ef('0x8c')](_0x4fb09e['body']['newPassword'],_0x1cbb24['previousPasswords'],_0x1e5237[_0x32ef('0x8d')]);return _0x1cbb24;})[_0x32ef('0x26')](saveUpdates({'password':_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x84')],'passwordResetAt':_0x4fb09e[_0x32ef('0x2b')]['id']==_0x4fb09e[_0x32ef('0x51')]['id']?moment():null,'previousPasswords':authService[_0x32ef('0x8e')](_0x4fb09e[_0x32ef('0x5c')][_0x32ef('0x84')],_0x1cbb24[_0x32ef('0x8b')])},null));})[_0x32ef('0x26')](respondWithResult(_0x2e01fa,null))['catch'](handleError(_0x2e01fa,null));};exports[_0x32ef('0x8f')]=function(_0x7c2649,_0x42d79b){var _0x349e03=_0x7c2649[_0x32ef('0x5c')][_0x32ef('0x90')];return db['User'][_0x32ef('0x32')]({'where':{'id':_0x7c2649[_0x32ef('0x51')]['id']},'attributes':['id',_0x32ef('0x33'),_0x32ef('0x29'),_0x32ef('0x91'),_0x32ef('0x92'),_0x32ef('0x93'),_0x32ef('0x94')]})[_0x32ef('0x26')](handleEntityNotFound(_0x42d79b,null))[_0x32ef('0x26')](function(_0x439146){if(_0x439146){if(!utils[_0x32ef('0x95')](_0x349e03)){throw new db[(_0x32ef('0x87'))][(_0x32ef('0x85'))]('Unknown\x20channel');}return _0x439146[_0x32ef('0x96')+_[_0x32ef('0x97')](_0x349e03[_0x32ef('0x98')]())+'Queues'](_0x7c2649[_0x32ef('0x5c')]['ids'],{'penalty':_0x7c2649[_0x32ef('0x5c')][_0x32ef('0x99')]||0x0})[_0x32ef('0x9a')](function(_0x5c2733){for(var _0x27aff9=0x0;_0x27aff9<_0x7c2649['body'][_0x32ef('0x9b')][_0x32ef('0x48')];_0x27aff9+=0x1){var _0x5b753c={'UserId':Number(_0x7c2649[_0x32ef('0x51')]['id'])};_0x5b753c[_[_0x32ef('0x97')](_0x349e03[_0x32ef('0x98')]())+_0x32ef('0x9c')]=Number(_0x7c2649[_0x32ef('0x5c')][_0x32ef('0x9b')][_0x27aff9]);socket[_0x32ef('0x9d')]('user'+_['capitalize'](_0x349e03[_0x32ef('0x98')]())+'Queue:save',_0x5b753c);}return _0x5c2733;})[_0x32ef('0x26')](function(){if(_0x349e03===_0x32ef('0x9e')){return db['VoiceQueue'][_0x32ef('0x45')]({'where':{'id':_0x7c2649[_0x32ef('0x5c')]['ids']||[]},'raw':!![],'attributes':['id',_0x32ef('0x33')]});}})[_0x32ef('0x26')](function(_0x3f09c9){var _0xa5f787=_0x439146[_0x32ef('0x28')]({'plain':!![]});var _0x599b18=[];if(_0x349e03===_0x32ef('0x9e')&&_0xa5f787[_0x32ef('0x29')]==='agent'&&_0xa5f787[_0x32ef('0x91')]){for(var _0xe7df49=0x0;_0xe7df49<_0x3f09c9[_0x32ef('0x48')];_0xe7df49+=0x1){_0x599b18[_0x32ef('0x43')]({'membername':_0xa5f787[_0x32ef('0x33')],'UserId':_0xa5f787['id'],'queue_name':_0x3f09c9[_0xe7df49]['name'],'VoiceQueueId':_0x3f09c9[_0xe7df49]['id'],'interface':_[_0x32ef('0x64')](_0xa5f787[_0x32ef('0x94')])?util['format'](_0x32ef('0x9f'),_0xa5f787[_0x32ef('0x33')]):_0xa5f787[_0x32ef('0x94')],'paused':_0xa5f787[_0x32ef('0x93')]||![],'penalty':_0x7c2649[_0x32ef('0x5c')][_0x32ef('0x99')]||0x0});}return BPromise[_0x32ef('0x7e')](_0x599b18,function(_0x482c46){return db['UserVoiceQueueRt'][_0x32ef('0xa0')](_0x482c46);});}return _0x439146;});}})[_0x32ef('0x26')](respondWithStatusCode(_0x42d79b,null))[_0x32ef('0x1b')](handleError(_0x42d79b,null));};exports['removeQueues']=function(_0x10c38e,_0x32fe54){var _0x49fef2;return db[_0x32ef('0x44')][_0x32ef('0x32')]({'where':{'id':_0x10c38e['params']['id']},'attributes':['id','name',_0x32ef('0x29')]})[_0x32ef('0x26')](handleEntityNotFound(_0x32fe54,null))[_0x32ef('0x26')](function(_0x5a86f6){if(_0x5a86f6){_0x49fef2=_0x5a86f6;if(!_0x10c38e['query']['channel']||!utils[_0x32ef('0x95')](_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x90')])){throw new db['Sequelize'][(_0x32ef('0x85'))](_0x32ef('0xa1'));}return _0x5a86f6[_0x32ef('0xa2')+_['capitalize'](_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x90')]['toLowerCase']())+'Queues'](_0x10c38e[_0x32ef('0x3f')]['ids']);}})[_0x32ef('0x26')](function(_0x286ce3){if(_['isArray'](_0x10c38e['query'][_0x32ef('0x9b')])){for(var _0x4bb644=0x0;_0x4bb644<_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x9b')][_0x32ef('0x48')];_0x4bb644+=0x1){var _0x28d85a={'UserId':Number(_0x10c38e[_0x32ef('0x51')]['id'])};_0x28d85a[_[_0x32ef('0x97')](_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x90')][_0x32ef('0x98')]())+_0x32ef('0x9c')]=Number(_0x10c38e['query']['ids'][_0x4bb644]);socket[_0x32ef('0x9d')](_0x32ef('0x2b')+_[_0x32ef('0x97')](_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x90')][_0x32ef('0x98')]())+_0x32ef('0xa3'),_0x28d85a);}}else{var _0x28d85a={'UserId':Number(_0x10c38e[_0x32ef('0x51')]['id'])};_0x28d85a[_[_0x32ef('0x97')](_0x10c38e['query'][_0x32ef('0x90')][_0x32ef('0x98')]())+_0x32ef('0x9c')]=Number(_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x9b')]);socket[_0x32ef('0x9d')](_0x32ef('0x2b')+_[_0x32ef('0x97')](_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x90')][_0x32ef('0x98')]())+_0x32ef('0xa3'),_0x28d85a);}return _0x286ce3;})[_0x32ef('0x26')](function(){if(_0x10c38e['query'][_0x32ef('0x90')]===_0x32ef('0x9e')){return db[_0x32ef('0xa4')][_0x32ef('0x27')]({'where':{'UserId':_0x10c38e[_0x32ef('0x51')]['id'],'VoiceQueueId':_0x10c38e[_0x32ef('0x3f')][_0x32ef('0x9b')]},'individualHooks':!![]})[_0x32ef('0x26')](function(){return _0x49fef2;});}return _0x49fef2;})[_0x32ef('0x26')](respondWithStatusCode(_0x32fe54,null))[_0x32ef('0x1b')](handleError(_0x32fe54,null));};exports['addAvatar']=function(_0x1d7329,_0x85c779){_0x1d7329[_0x32ef('0x5c')][_0x32ef('0xa5')]=_0x1d7329['file'][_0x32ef('0xa6')];return db[_0x32ef('0x44')]['find']({'where':{'id':_0x1d7329['params']['id']}})['then'](handleEntityNotFound(_0x85c779,null))[_0x32ef('0x26')](saveUpdates(_0x1d7329[_0x32ef('0x5c')],null))[_0x32ef('0x26')](respondWithResult(_0x85c779,null))[_0x32ef('0x1b')](handleError(_0x85c779,null));};exports['getAvatar']=function(_0x5f2996,_0x1fc685){var _0x4f9e0a=path['join'](config[_0x32ef('0xa7')],_0x32ef('0xa8'));return db[_0x32ef('0x44')]['find']({'where':{'id':_0x5f2996['params']['id']},'attributes':['id','userpic'],'raw':!![]})[_0x32ef('0x26')](handleEntityNotFound(_0x1fc685,null))[_0x32ef('0x26')](function(_0x419764){if(_0x419764){if(_[_0x32ef('0x64')](_0x419764[_0x32ef('0xa5')])){return _0x1fc685[_0x32ef('0xa9')](_0x4f9e0a);}else{if(!fs[_0x32ef('0xaa')](path[_0x32ef('0xab')](config[_0x32ef('0xa7')],'server/files/images/',_0x419764['userpic']))){return _0x1fc685['download'](_0x4f9e0a);}return _0x1fc685[_0x32ef('0xa9')](path[_0x32ef('0xab')](config['root'],'server/files/images/',_0x419764[_0x32ef('0xa5')]));}}})['catch'](handleError(_0x1fc685,null));};exports[_0x32ef('0xac')]=function(_0x40e8d7,_0x7f710){return db[_0x32ef('0x44')]['find']({'where':{'id':_0x40e8d7[_0x32ef('0x51')]['id']},'attributes':['id']})[_0x32ef('0x26')](handleEntityNotFound(_0x7f710,null))[_0x32ef('0x26')](function(_0x2e710c){var _0x5f290e=[];values=_0x2e710c[_0x32ef('0x4a')];_0x5f290e[_0x32ef('0x43')](get_open_tabs('chat',_0x2e710c['dataValues']));_0x5f290e[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4b'),_0x2e710c[_0x32ef('0x4a')]));_0x5f290e[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4e'),_0x2e710c[_0x32ef('0x4a')]));_0x5f290e[_0x32ef('0x43')](get_open_tabs('whatsapp',_0x2e710c[_0x32ef('0x4a')]));_0x5f290e[_0x32ef('0x43')](get_open_tabs(_0x32ef('0x4c'),_0x2e710c[_0x32ef('0x4a')]));_0x5f290e['push'](get_open_tabs('mail',_0x2e710c[_0x32ef('0x4a')]));return BPromise['all'](_0x5f290e);})[_0x32ef('0x26')](function(_0x62f5c6){var _0x323880=[];if(_0x62f5c6){for(var _0x451621=0x0;_0x451621=_0x1a0261){_0x3cb2f2=_0x1a0261;_0x3712cf=0xc8;}else{_0x3712cf=0xce;}_0xbf6c58[_0xb687('0x21')](_0x3712cf);return _0xbf6c58[_0xb687('0x28')](_0xb687('0x29'),_0x4136c9+'-'+_0x3cb2f2+'/'+_0x1a0261)[_0xb687('0x23')](_0xf48ba4);}return null;};}function saveUpdates(_0x173c58){return function(_0x4e9a06){if(_0x4e9a06){return _0x4e9a06[_0xb687('0x2a')](_0x173c58)['then'](function(_0x360429){return _0x360429;});}return null;};}function removeEntity(_0x40f35c){return function(_0x6df7a2){if(_0x6df7a2){return _0x6df7a2[_0xb687('0x2b')]()[_0xb687('0x2c')](function(){var _0x43d20d=_0x6df7a2[_0xb687('0x2d')]({'plain':!![]});if(_0x43d20d['role']===_0xb687('0x2e'))return;var _0xe3428f=[{'name':_0xb687('0x2f'),'value':_0xb687('0x30'),'ignore':!![]},{'name':_0xb687('0x31'),'value':_0xb687('0x32'),'ignore':![]},{'name':_0xb687('0x33'),'value':_0xb687('0x34'),'ignore':![]}];var _0x3551df=_(_0xe3428f)[_0xb687('0x35')](_0xb687('0x36'))['map']('value')[_0xb687('0x37')]();if(_[_0xb687('0x38')](_0x3551df,_0x43d20d[_0xb687('0x39')])){return;}var _0x32abc4=_['find'](_0xe3428f,['value',_0x43d20d[_0xb687('0x39')]])[_0xb687('0x3a')];return db['UserProfileResource'][_0xb687('0x2b')]({'where':{'type':_0x32abc4,'resourceId':_0x43d20d['id']}})[_0xb687('0x2c')](function(){return _0x6df7a2;});})['then'](function(){_0x40f35c[_0xb687('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16e195){return function(_0x24f34e){if(!_0x24f34e){_0x16e195[_0xb687('0x20')](0x194);}return _0x24f34e;};}function handleError(_0x3e146a,_0x32d66c){_0x32d66c=_0x32d66c||0x1f4;return function(_0x28087e){logger['error'](_0x28087e[_0xb687('0x3b')]);if(_0x28087e[_0xb687('0x3a')]){delete _0x28087e[_0xb687('0x3a')];}_0x3e146a[_0xb687('0x21')](_0x32d66c)['send'](_0x28087e);};}exports[_0xb687('0x3c')]=function(_0x100f4a,_0x1f1c88){var _0xce9624={},_0xa3f0f9={'count':0x0,'rows':[]};var _0x58c214=_(db[_0xb687('0x3d')][_0xb687('0x3e')])[_0xb687('0x3f')](function(_0xdf57ff){return{'name':_0xdf57ff[_0xb687('0x40')],'type':_0xdf57ff[_0xb687('0x41')]['key']};})['filter'](function(_0x43f29c){return!_['includes']([_0xb687('0x42'),_0xb687('0x43')],_0x43f29c['name']);})[_0xb687('0x37')]();_0xce9624=qs[_0xb687('0x44')](_0x58c214,_0x100f4a);var _0x57776b={'where':_0xce9624[_0xb687('0x45')]};return db[_0xb687('0x3d')][_0xb687('0x26')](_0x57776b)['then'](function(_0x66fabe){_0xa3f0f9[_0xb687('0x26')]=_0x66fabe;if(_0x100f4a[_0xb687('0x46')][_0xb687('0x47')]){_0xce9624[_0xb687('0x48')]=[{'all':!![]}];}if(!_[_0xb687('0x38')](_0xce9624[_0xb687('0x49')],'id')){_0xce9624['attributes'][_0xb687('0x4a')]('id');}return db['User']['findAll'](_0xce9624);})[_0xb687('0x2c')](function(_0x430364){_0xa3f0f9['rows']=_0x430364;if(_0x100f4a[_0xb687('0x46')]['openTabs']===_0xb687('0x4b')){var _0x385c95=[];for(var _0x5c89a3=0x0;_0x5c89a3<_0xa3f0f9[_0xb687('0x4c')][_0xb687('0x4d')];_0x5c89a3++){_0x385c95['push'](get_open_tabs(_0xb687('0x4e'),_0xa3f0f9[_0xb687('0x4c')][_0x5c89a3][_0xb687('0x4f')]));_0x385c95[_0xb687('0x4a')](get_open_tabs(_0xb687('0x50'),_0xa3f0f9[_0xb687('0x4c')][_0x5c89a3][_0xb687('0x4f')]));_0x385c95[_0xb687('0x4a')](get_open_tabs(_0xb687('0x51'),_0xa3f0f9[_0xb687('0x4c')][_0x5c89a3][_0xb687('0x4f')]));_0x385c95[_0xb687('0x4a')](get_open_tabs('mail',_0xa3f0f9[_0xb687('0x4c')][_0x5c89a3]['dataValues']));_0x385c95[_0xb687('0x4a')](get_open_tabs(_0xb687('0x52'),_0xa3f0f9[_0xb687('0x4c')][_0x5c89a3][_0xb687('0x4f')]));_0x385c95[_0xb687('0x4a')](get_open_tabs(_0xb687('0x53'),_0xa3f0f9['rows'][_0x5c89a3]['dataValues']));}return BPromise[_0xb687('0x54')](_0x385c95)[_0xb687('0x2c')](function(_0x40558a){return _0xa3f0f9;});}else{return _0xa3f0f9;}})[_0xb687('0x2c')](respondWithFilteredResult(_0x1f1c88,_0xce9624))['catch'](handleError(_0x1f1c88,null));};exports[_0xb687('0x55')]=function(_0x302d6d,_0x19a828){var _0x2413c8={'raw':![],'where':{'id':_0x302d6d[_0xb687('0x56')]['id']}},_0x535c00={};_0x535c00[_0xb687('0x57')]=_[_0xb687('0x58')](_[_0xb687('0x59')](db['User']['rawAttributes']),[_0xb687('0x42'),_0xb687('0x43')]);_0x535c00[_0xb687('0x46')]=_['keys'](_0x302d6d['query']);_0x535c00[_0xb687('0x5a')]=_[_0xb687('0x5b')](_0x535c00[_0xb687('0x57')],_0x535c00[_0xb687('0x46')]);_0x2413c8[_0xb687('0x49')]=_[_0xb687('0x5b')](_0x535c00[_0xb687('0x57')],qs[_0xb687('0x5c')](_0x302d6d['query'][_0xb687('0x5c')]));_0x2413c8[_0xb687('0x49')]=_0x2413c8[_0xb687('0x49')]['length']?_0x2413c8['attributes']:_0x535c00['model'];if(_0x302d6d['query'][_0xb687('0x47')]){_0x2413c8[_0xb687('0x48')]=[{'all':!![]}];}_0x2413c8=_[_0xb687('0x5d')]({},_0x2413c8,_0x302d6d[_0xb687('0x5e')]);if(!_[_0xb687('0x38')](_0x2413c8[_0xb687('0x49')],'id')){_0x2413c8[_0xb687('0x49')][_0xb687('0x4a')]('id');}return db[_0xb687('0x3d')][_0xb687('0x5f')](_0x2413c8)[_0xb687('0x2c')](handleEntityNotFound(_0x19a828,null))[_0xb687('0x2c')](function(_0x22c4b4){var _0xbffa37=[];values=_0x22c4b4;if(_0x302d6d[_0xb687('0x46')][_0xb687('0x60')]===_0xb687('0x4b')){_0xbffa37['push'](get_open_tabs('chat',_0x22c4b4[_0xb687('0x4f')]));_0xbffa37[_0xb687('0x4a')](get_open_tabs(_0xb687('0x50'),_0x22c4b4[_0xb687('0x4f')]));_0xbffa37['push'](get_open_tabs(_0xb687('0x52'),_0x22c4b4[_0xb687('0x4f')]));_0xbffa37['push'](get_open_tabs(_0xb687('0x53'),_0x22c4b4['dataValues']));_0xbffa37[_0xb687('0x4a')](get_open_tabs(_0xb687('0x51'),_0x22c4b4['dataValues']));_0xbffa37['push'](get_open_tabs(_0xb687('0x61'),_0x22c4b4[_0xb687('0x4f')]));return BPromise['all'](_0xbffa37);}else{return values;}})[_0xb687('0x2c')](function(_0x318be6){return values;})[_0xb687('0x2c')](respondWithResult(_0x19a828,null))['catch'](handleError(_0x19a828,null));};exports[_0xb687('0x2a')]=function(_0x5b3c93,_0xb20c08){if(_0x5b3c93[_0xb687('0x62')]['id']){delete _0x5b3c93[_0xb687('0x62')]['id'];}delete _0x5b3c93[_0xb687('0x62')][_0xb687('0x39')];return db['User']['find']({'where':{'id':_0x5b3c93[_0xb687('0x56')]['id']}})['then'](handleEntityNotFound(_0xb20c08,null))['then'](saveUpdates(_0x5b3c93['body'],null))['then'](respondWithResult(_0xb20c08,null))[_0xb687('0x1f')](handleError(_0xb20c08,null));};exports[_0xb687('0x63')]=function(_0xbc3a94,_0x4bc18f){return db[_0xb687('0x3d')][_0xb687('0x63')]()[_0xb687('0x2c')](respondWithResult(_0x4bc18f,null))[_0xb687('0x1f')](handleError(_0x4bc18f,null));};exports[_0xb687('0x64')]=function(_0x17505c,_0x132e3a){return db['User']['find']({'where':{'id':_0x17505c[_0xb687('0x56')]['id']}})['then'](handleEntityNotFound(_0x132e3a,null))[_0xb687('0x2c')](function(_0x1840f3){if(_0x1840f3){return _0x1840f3[_0xb687('0x64')](_0x17505c[_0xb687('0x62')][_0xb687('0x65')],_['omit'](_0x17505c[_0xb687('0x62')],['ids','id'])||{});}})[_0xb687('0x2c')](respondWithResult(_0x132e3a,null))[_0xb687('0x1f')](handleError(_0x132e3a,null));};function validateUser(_0x18993a){return new BPromise(function(_0x24f42b,_0x3fe455){if(_0x18993a[_0xb687('0x66')])return _0x24f42b(_0x18993a);return db[_0xb687('0x67')]['findById'](0x1)[_0xb687('0x2c')](function(_0x31ed20){if(_0x31ed20[_0xb687('0x68')])authService[_0xb687('0x69')](_0x18993a[_0xb687('0x42')]);db['User'][_0xb687('0x6a')](_0xb687('0x66'))[_0xb687('0x2c')](function(_0x319038){if(_[_0xb687('0x6b')](_0x319038)){_0x18993a[_0xb687('0x66')]=_0x31ed20[_0xb687('0x6c')]||0x1;return;}if(_[_0xb687('0x6b')](_0x31ed20[_0xb687('0x6c')])||_0x31ed20[_0xb687('0x6c')]===_0x319038){_0x18993a[_0xb687('0x66')]=_0x319038+0x1;return;}if(_0x31ed20['min_internal']>_0x319038){_0x18993a[_0xb687('0x66')]=_0x31ed20[_0xb687('0x6c')];return;}return db[_0xb687('0x6d')][_0xb687('0x46')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xb687('0x6d')][_0xb687('0x6e')]['SELECT']})[_0xb687('0x2c')](function(_0x1acfed){if(_0x1acfed&&_0x1acfed[_0xb687('0x4d')]){for(var _0x5eeb75=0x0,_0x451d2f=_0x1acfed[_0xb687('0x4d')];_0x5eeb75<_0x451d2f&&_['isNil'](_0x18993a[_0xb687('0x66')]);_0x5eeb75++){if(_0x31ed20[_0xb687('0x6c')]<=_0x1acfed[_0x5eeb75][_0xb687('0x6f')]){_0x18993a[_0xb687('0x66')]=_0x1acfed[_0x5eeb75]['from'];}else if(_0x31ed20[_0xb687('0x6c')]>_0x1acfed[_0x5eeb75][_0xb687('0x6f')]&&_0x31ed20['min_internal']<=_0x1acfed[_0x5eeb75]['to']){_0x18993a[_0xb687('0x66')]=_0x31ed20[_0xb687('0x6c')];}}}if(_['isNil'](_0x18993a['internal'])){_0x18993a[_0xb687('0x66')]=_0x319038+0x1;}return _0x24f42b(_0x18993a);});});})['catch'](function(_0x2921ab){_0x3fe455(_0x2921ab);});});}function updateUser(_0x11f1ab){return new BPromise(function(_0x32ae66,_0x35525f){try{if(_0x11f1ab[_0xb687('0x70')]){_0x11f1ab[_0xb687('0x71')]=_0x11f1ab[_0xb687('0x66')];_0x11f1ab[_0xb687('0x72')]={'mailbox':_0x11f1ab['internal'],'password':_0x11f1ab[_0xb687('0x42')],'fullname':_0x11f1ab[_0xb687('0x73')],'email':_0x11f1ab[_0xb687('0x74')]};}if(_0x11f1ab[_0xb687('0x39')]===_0xb687('0x32')){if(!_0x11f1ab[_0xb687('0x75')])_0x11f1ab['permissions']=[_0xb687('0x76'),_0xb687('0x77'),'103',_0xb687('0x78'),_0xb687('0x79'),_0xb687('0x7a'),_0xb687('0x7b'),'106',_0xb687('0x7c'),'108','109',_0xb687('0x7d'),'111','114',_0xb687('0x7e')];}_0x32ae66(_0x11f1ab);}catch(_0x5d127a){_0x35525f(_0x5d127a);}});}exports[_0xb687('0x7f')]=function(_0x1ea8d3,_0x58fcb7){if(_0x1ea8d3[_0xb687('0x30')][_0xb687('0x39')]==='agent')throw new Error(_0xb687('0x80'));if(_0x1ea8d3[_0xb687('0x62')][_0xb687('0x39')]===_0xb687('0x30')&&_0x1ea8d3[_0xb687('0x30')][_0xb687('0x39')]!==_0xb687('0x2e')){throw new Error(_0xb687('0x81'));}if(_0x1ea8d3[_0xb687('0x62')][_0xb687('0x39')]===_0xb687('0x2e')&&_0x1ea8d3['user'][_0xb687('0x39')]!=='admin'){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil[_0xb687('0x82')]([_0x1ea8d3[_0xb687('0x62')]])[_0xb687('0x2c')](function(){return validateUser(_0x1ea8d3[_0xb687('0x62')]);})[_0xb687('0x2c')](function(_0x594254){return updateUser(_0x594254)['then'](function(_0x29e27e){if(_0x29e27e[_0xb687('0x39')]===_0xb687('0x2e')){_0x29e27e[_0xb687('0x83')]=_0x1ea8d3['user'][_0xb687('0x83')];delete _0x29e27e[_0xb687('0x84')];}return _0x29e27e;});})[_0xb687('0x2c')](function(_0xb95ee2){return db[_0xb687('0x3d')][_0xb687('0x7f')](_0xb95ee2,{'include':[{'model':db[_0xb687('0x72')],'as':_0xb687('0x72')}]});})[_0xb687('0x2c')](function(_0x55dd40){if(_0x1ea8d3[_0xb687('0x62')][_0xb687('0x39')]===_0xb687('0x30'))return _0x55dd40;if(_0x1ea8d3[_0xb687('0x30')][_0xb687('0x39')]!=='user')return _0x55dd40;return db[_0xb687('0x85')][_0xb687('0x5f')]({'where':{'name':_0x55dd40['role']===_0xb687('0x32')?'Agents':_0xb687('0x33'),'userProfileId':_0x1ea8d3[_0xb687('0x30')]['userProfileId']},'raw':!![]})[_0xb687('0x2c')](function(_0x229b60){if(!_0x229b60||_0x229b60['autoAssociation']!=0x0)return _0x55dd40;return db[_0xb687('0x86')][_0xb687('0x7f')]({'name':_0x55dd40[_0xb687('0x3a')],'resourceId':_0x55dd40['id'],'type':_0x229b60[_0xb687('0x3a')],'sectionId':_0x229b60['id']},{})[_0xb687('0x2c')](function(){return _0x55dd40;});})[_0xb687('0x1f')](function(_0x49b97a){logger[_0xb687('0x1b')](_0xb687('0x87'),_0x49b97a);throw _0x49b97a;});})[_0xb687('0x2c')](respondWithResult(_0x58fcb7,0xc9))[_0xb687('0x1f')](handleError(_0x58fcb7,null));};exports[_0xb687('0x88')]=function(_0x465b81,_0x233230){var _0x255a97=_0x465b81[_0xb687('0x62')];var _0x361222=[];if(_0x465b81[_0xb687('0x30')]['role']===_0xb687('0x32'))throw new Error('Unauthorized');if(_[_0xb687('0x89')](_0x255a97,[_0xb687('0x39'),'user'])&&_0x465b81['user'][_0xb687('0x39')]!==_0xb687('0x2e')){throw new Error(_0xb687('0x81'));}if(_[_0xb687('0x89')](_0x255a97,[_0xb687('0x39'),_0xb687('0x2e')])&&_0x465b81[_0xb687('0x30')][_0xb687('0x39')]!==_0xb687('0x2e')){throw new Error(_0xb687('0x8a'));}return licenseUtil[_0xb687('0x82')](_0x255a97)[_0xb687('0x2c')](function(){return validateUser(_0x255a97[0x0]);})[_0xb687('0x2c')](function(){for(var _0x1ea6fd=0x1;_0x1ea6fd<_0x255a97[_0xb687('0x4d')];_0x1ea6fd++){var _0x3f45b7=_0x255a97[_0x1ea6fd-0x1]['internal'];if(!_0x255a97[_0x1ea6fd]['internal'])_0x255a97[_0x1ea6fd][_0xb687('0x66')]=_0x3f45b7+0x1;_0x361222['push'](validateUser(_0x255a97[_0x1ea6fd]));}return BPromise['all'](_0x361222);})[_0xb687('0x2c')](function(){_0x361222=[];for(var _0x385d2d=0x0;_0x385d2d<_0x255a97['length'];_0x385d2d++){_0x361222[_0xb687('0x4a')](updateUser(_0x255a97[_0x385d2d]));}return BPromise[_0xb687('0x54')](_0x361222);})['then'](function(){return BPromise[_0xb687('0x8b')](_0x255a97,function(_0x2127be){return db[_0xb687('0x3d')][_0xb687('0x7f')](_0x2127be,{'include':[{'model':db[_0xb687('0x72')],'as':_0xb687('0x72')}]})[_0xb687('0x2c')](function(_0x4501f5){_0x2127be['id']=_0x4501f5['id'];return _0x2127be;});});})[_0xb687('0x2c')](function(_0x4c79f7){if(_0x465b81[_0xb687('0x62')][_0xb687('0x39')]==='user')return _0x4c79f7;if(_0x465b81[_0xb687('0x30')]['role']!==_0xb687('0x30'))return _0x4c79f7;var _0x3eedb2=_['some'](_0x4c79f7,function(_0x2aff54){return _0x2aff54[_0xb687('0x39')]===_0xb687('0x32')||_0x2aff54[_0xb687('0x39')]===_0xb687('0x34');});if(!_0x3eedb2)return _0x4c79f7;return db[_0xb687('0x85')][_0xb687('0x8c')]({'where':{'name':{'$or':['Agents','Telephones']},'userProfileId':_0x465b81[_0xb687('0x30')]['userProfileId']},'raw':!![]})[_0xb687('0x2c')](function(_0x3e45b8){if(_[_0xb687('0x8d')](_0x3e45b8)||!_[_0xb687('0x89')](_0x3e45b8,['autoAssociation',0x0]))return _0x4c79f7;_0x361222=[];var _0x3cd107=_(_0x3e45b8)[_0xb687('0x3f')](function(_0x5854d4){if(_0x5854d4[_0xb687('0x8e')]===0x1)return;return _0x5854d4[_0xb687('0x3a')]===_0xb687('0x31')?_0xb687('0x32'):_0xb687('0x34');})[_0xb687('0x8f')]()['value']();for(var _0xa51ef8=0x0;_0xa51ef8<_0x4c79f7[_0xb687('0x4d')];_0xa51ef8++){if(!_[_0xb687('0x38')](_0x3cd107,_0x4c79f7[_0xa51ef8][_0xb687('0x39')]))return;var _0x1482d4=_0x4c79f7[_0xa51ef8][_0xb687('0x39')]===_0xb687('0x32')?_0xb687('0x31'):_0xb687('0x33');_0x361222[_0xb687('0x4a')](db['UserProfileResource']['create']({'name':_0x4c79f7[_0xa51ef8][_0xb687('0x3a')],'resourceId':_0x4c79f7[_0xa51ef8]['id'],'type':_0x1482d4,'sectionId':_[_0xb687('0x5f')](_0x3e45b8,[_0xb687('0x3a'),_0x1482d4])['id']},{}));}return BPromise[_0xb687('0x54')](_0x361222);});})[_0xb687('0x2c')](respondWithResult(_0x233230,0xc9))[_0xb687('0x1f')](handleError(_0x233230,null));};exports[_0xb687('0x90')]=function(_0x11f925,_0x24d2c8){if(_0x11f925['body']['id']){delete _0x11f925['body']['id'];}return db['User'][_0xb687('0x5f')]({'where':{'id':_0x11f925[_0xb687('0x56')]['id']}})[_0xb687('0x2c')](function(_0x44152f){if(!_0x44152f)return null;if(_0x44152f['id']===_0x11f925[_0xb687('0x30')]['id']){if(!_0x11f925[_0xb687('0x62')][_0xb687('0x91')]||!_0x11f925[_0xb687('0x62')]['newPassword']){throw new db[(_0xb687('0x92'))][(_0xb687('0x93'))](_0xb687('0x94'));}if(!_0x44152f[_0xb687('0x95')](_0x11f925[_0xb687('0x62')][_0xb687('0x91')])){throw new db[(_0xb687('0x92'))][(_0xb687('0x93'))]('Wrong\x20credentials');}if(_0x11f925[_0xb687('0x62')]['oldPassword']===_0x11f925[_0xb687('0x62')][_0xb687('0x96')]){throw new db['Sequelize'][(_0xb687('0x93'))](_0xb687('0x97'));}}else if(_0x11f925[_0xb687('0x30')]['role']===_0xb687('0x2e')){if(!_0x11f925[_0xb687('0x62')][_0xb687('0x96')]){throw new db[(_0xb687('0x92'))][(_0xb687('0x93'))](_0xb687('0x98'));}}else if(_0x11f925[_0xb687('0x30')]['role']===_0xb687('0x30')){if(!_0x11f925[_0xb687('0x62')][_0xb687('0x96')]){throw new db[(_0xb687('0x92'))][(_0xb687('0x93'))]('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x44152f[_0xb687('0x39')]!==_0xb687('0x32')){throw new db[(_0xb687('0x92'))]['ValidationError'](_0xb687('0x80'));}}else{throw new db['Sequelize'][(_0xb687('0x93'))](_0xb687('0x80'));}return _0x44152f;})['then'](handleEntityNotFound(_0x24d2c8,null))[_0xb687('0x2c')](function(_0x25ff49){return db[_0xb687('0x67')]['findOne']({'attributes':['id',_0xb687('0x68'),_0xb687('0x99'),_0xb687('0x9a')]})[_0xb687('0x2c')](function(_0x2ab30a){if(_0x2ab30a[_0xb687('0x68')])authService[_0xb687('0x69')](_0x11f925[_0xb687('0x62')][_0xb687('0x96')]);if(!_0x2ab30a['enforcePasswordHistory']||!_0x25ff49[_0xb687('0x9b')])return _0x25ff49;authService[_0xb687('0x9c')](_0x11f925[_0xb687('0x62')]['newPassword'],_0x25ff49['previousPasswords'],_0x2ab30a[_0xb687('0x9a')]);return _0x25ff49;})['then'](saveUpdates({'password':_0x11f925[_0xb687('0x62')][_0xb687('0x96')],'passwordResetAt':_0x11f925[_0xb687('0x30')]['id']==_0x11f925['params']['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x11f925[_0xb687('0x62')][_0xb687('0x96')],_0x25ff49[_0xb687('0x9b')])},null));})[_0xb687('0x2c')](respondWithResult(_0x24d2c8,null))[_0xb687('0x1f')](handleError(_0x24d2c8,null));};exports['addQueues']=function(_0x25f3e5,_0x6abfcf){var _0x522304=_0x25f3e5[_0xb687('0x62')][_0xb687('0x9d')];return db['User'][_0xb687('0x5f')]({'where':{'id':_0x25f3e5[_0xb687('0x56')]['id']},'attributes':['id','name',_0xb687('0x39'),_0xb687('0x9e'),_0xb687('0x9f'),_0xb687('0xa0'),_0xb687('0xa1')]})[_0xb687('0x2c')](handleEntityNotFound(_0x6abfcf,null))[_0xb687('0x2c')](function(_0x532201){if(_0x532201){if(!utils[_0xb687('0xa2')](_0x522304)){throw new db['Sequelize'][(_0xb687('0x93'))](_0xb687('0xa3'));}return _0x532201[_0xb687('0xa4')+_[_0xb687('0xa5')](_0x522304['toLowerCase']())+_0xb687('0xa6')](_0x25f3e5['body']['ids'],{'penalty':_0x25f3e5[_0xb687('0x62')][_0xb687('0xa7')]||0x0})[_0xb687('0xa8')](function(_0x4845fd){for(var _0x258497=0x0;_0x258497<_0x25f3e5[_0xb687('0x62')]['ids'][_0xb687('0x4d')];_0x258497+=0x1){var _0x4d6054={'UserId':Number(_0x25f3e5[_0xb687('0x56')]['id'])};_0x4d6054[_[_0xb687('0xa5')](_0x522304['toLowerCase']())+_0xb687('0xa9')]=Number(_0x25f3e5['body'][_0xb687('0x65')][_0x258497]);socket['emit']('user'+_[_0xb687('0xa5')](_0x522304[_0xb687('0xaa')]())+'Queue:save',_0x4d6054);}return _0x4845fd;})[_0xb687('0x2c')](function(){if(_0x522304==='voice'){return db[_0xb687('0xab')][_0xb687('0x8c')]({'where':{'id':_0x25f3e5[_0xb687('0x62')]['ids']||[]},'raw':!![],'attributes':['id',_0xb687('0x3a')]});}})[_0xb687('0x2c')](function(_0x1e1133){var _0x1f2f2b=_0x532201[_0xb687('0x2d')]({'plain':!![]});var _0x53163e=[];if(_0x522304==='voice'&&_0x1f2f2b[_0xb687('0x39')]===_0xb687('0x32')&&_0x1f2f2b[_0xb687('0x9e')]){for(var _0x39af6a=0x0;_0x39af6a<_0x1e1133[_0xb687('0x4d')];_0x39af6a+=0x1){_0x53163e['push']({'membername':_0x1f2f2b['name'],'UserId':_0x1f2f2b['id'],'queue_name':_0x1e1133[_0x39af6a][_0xb687('0x3a')],'VoiceQueueId':_0x1e1133[_0x39af6a]['id'],'interface':_[_0xb687('0x6b')](_0x1f2f2b[_0xb687('0xa1')])?util[_0xb687('0xac')](_0xb687('0xad'),_0x1f2f2b[_0xb687('0x3a')]):_0x1f2f2b[_0xb687('0xa1')],'paused':_0x1f2f2b['voicePause']||![],'penalty':_0x25f3e5[_0xb687('0x62')][_0xb687('0xa7')]||0x0});}return BPromise[_0xb687('0x8b')](_0x53163e,function(_0x53f78b){return db[_0xb687('0xae')][_0xb687('0xaf')](_0x53f78b);});}return _0x532201;});}})[_0xb687('0x2c')](respondWithStatusCode(_0x6abfcf,null))['catch'](handleError(_0x6abfcf,null));};exports[_0xb687('0xb0')]=function(_0x42bccd,_0x5d6de9){var _0x4523e5;return db[_0xb687('0x3d')][_0xb687('0x5f')]({'where':{'id':_0x42bccd[_0xb687('0x56')]['id']},'attributes':['id','name',_0xb687('0x39')]})[_0xb687('0x2c')](handleEntityNotFound(_0x5d6de9,null))[_0xb687('0x2c')](function(_0x398109){if(_0x398109){_0x4523e5=_0x398109;if(!_0x42bccd[_0xb687('0x46')]['channel']||!utils[_0xb687('0xa2')](_0x42bccd[_0xb687('0x46')]['channel'])){throw new db[(_0xb687('0x92'))][(_0xb687('0x93'))]('Unknown\x20channel');}return _0x398109[_0xb687('0xb1')+_[_0xb687('0xa5')](_0x42bccd[_0xb687('0x46')]['channel'][_0xb687('0xaa')]())+_0xb687('0xa6')](_0x42bccd['query']['ids']);}})['then'](function(_0x7685cb){if(_['isArray'](_0x42bccd[_0xb687('0x46')][_0xb687('0x65')])){for(var _0x40ece3=0x0;_0x40ece3<_0x42bccd[_0xb687('0x46')][_0xb687('0x65')]['length'];_0x40ece3+=0x1){var _0x520b30={'UserId':Number(_0x42bccd[_0xb687('0x56')]['id'])};_0x520b30[_[_0xb687('0xa5')](_0x42bccd[_0xb687('0x46')][_0xb687('0x9d')][_0xb687('0xaa')]())+_0xb687('0xa9')]=Number(_0x42bccd[_0xb687('0x46')]['ids'][_0x40ece3]);socket['emit']('user'+_[_0xb687('0xa5')](_0x42bccd[_0xb687('0x46')][_0xb687('0x9d')]['toLowerCase']())+'Queue:remove',_0x520b30);}}else{var _0x520b30={'UserId':Number(_0x42bccd[_0xb687('0x56')]['id'])};_0x520b30[_['capitalize'](_0x42bccd[_0xb687('0x46')][_0xb687('0x9d')][_0xb687('0xaa')]())+_0xb687('0xa9')]=Number(_0x42bccd[_0xb687('0x46')][_0xb687('0x65')]);socket['emit']('user'+_['capitalize'](_0x42bccd[_0xb687('0x46')][_0xb687('0x9d')][_0xb687('0xaa')]())+_0xb687('0xb2'),_0x520b30);}return _0x7685cb;})[_0xb687('0x2c')](function(){if(_0x42bccd[_0xb687('0x46')][_0xb687('0x9d')]==='voice'){return db[_0xb687('0xae')][_0xb687('0x2b')]({'where':{'UserId':_0x42bccd[_0xb687('0x56')]['id'],'VoiceQueueId':_0x42bccd[_0xb687('0x46')][_0xb687('0x65')]},'individualHooks':!![]})['then'](function(){return _0x4523e5;});}return _0x4523e5;})[_0xb687('0x2c')](respondWithStatusCode(_0x5d6de9,null))[_0xb687('0x1f')](handleError(_0x5d6de9,null));};exports[_0xb687('0xb3')]=function(_0x56cf07,_0x38e520){_0x56cf07[_0xb687('0x62')][_0xb687('0xb4')]=_0x56cf07[_0xb687('0xb5')][_0xb687('0xb6')];return db[_0xb687('0x3d')][_0xb687('0x5f')]({'where':{'id':_0x56cf07[_0xb687('0x56')]['id']}})[_0xb687('0x2c')](handleEntityNotFound(_0x38e520,null))[_0xb687('0x2c')](saveUpdates(_0x56cf07[_0xb687('0x62')],null))[_0xb687('0x2c')](respondWithResult(_0x38e520,null))[_0xb687('0x1f')](handleError(_0x38e520,null));};exports[_0xb687('0xb7')]=function(_0x35952a,_0x47b395){var _0x3803a1=path[_0xb687('0xb8')](config[_0xb687('0xb9')],'server/files/images/logos/default_profile.png');return db[_0xb687('0x3d')][_0xb687('0x5f')]({'where':{'id':_0x35952a['params']['id']},'attributes':['id',_0xb687('0xb4')],'raw':!![]})['then'](handleEntityNotFound(_0x47b395,null))[_0xb687('0x2c')](function(_0xbdb992){if(_0xbdb992){if(_[_0xb687('0x6b')](_0xbdb992['userpic'])){return _0x47b395[_0xb687('0xba')](_0x3803a1);}else{if(!fs[_0xb687('0xbb')](path[_0xb687('0xb8')](config[_0xb687('0xb9')],'server/files/images/',_0xbdb992['userpic']))){return _0x47b395[_0xb687('0xba')](_0x3803a1);}return _0x47b395[_0xb687('0xba')](path[_0xb687('0xb8')](config[_0xb687('0xb9')],_0xb687('0xbc'),_0xbdb992[_0xb687('0xb4')]));}}})['catch'](handleError(_0x47b395,null));};exports[_0xb687('0xbd')]=function(_0x1e9331,_0x1c68e6){return db['User'][_0xb687('0x5f')]({'where':{'id':_0x1e9331[_0xb687('0x56')]['id']},'attributes':['id']})[_0xb687('0x2c')](handleEntityNotFound(_0x1c68e6,null))['then'](function(_0x4a2cdb){var _0x49a56c=[];values=_0x4a2cdb[_0xb687('0x4f')];_0x49a56c['push'](get_open_tabs('chat',_0x4a2cdb['dataValues']));_0x49a56c[_0xb687('0x4a')](get_open_tabs(_0xb687('0x50'),_0x4a2cdb[_0xb687('0x4f')]));_0x49a56c['push'](get_open_tabs(_0xb687('0x52'),_0x4a2cdb[_0xb687('0x4f')]));_0x49a56c[_0xb687('0x4a')](get_open_tabs(_0xb687('0x53'),_0x4a2cdb[_0xb687('0x4f')]));_0x49a56c[_0xb687('0x4a')](get_open_tabs(_0xb687('0x51'),_0x4a2cdb[_0xb687('0x4f')]));_0x49a56c[_0xb687('0x4a')](get_open_tabs(_0xb687('0x61'),_0x4a2cdb[_0xb687('0x4f')]));return BPromise[_0xb687('0x54')](_0x49a56c);})[_0xb687('0x2c')](function(_0x131615){var _0x1e876c=[];if(_0x131615){for(var _0x17dd0c=0x0;_0x17dd0c=_0x5cb034[_0x6169('0x51')]){throw new Error(_0x6169('0x52'));}})[_0x6169('0x29')](function(){if(_0x16d4bc){return db[_0x6169('0x47')]['destroy']({'where':{'membername':_0x16d4bc[_0x6169('0x2c')]},'individualHooks':!![]});}})[_0x6169('0x29')](function(){if(_0x16d4bc){return _0x16d4bc[_0x6169('0x53')]({'raw':!![]});}})[_0x6169('0x29')](function(_0x16cba9){if(_0x16d4bc){if(_0x16cba9){var _0x37b6a2=[];_0x2f561b=_0x16cba9;if(_0x2f561b['length']){for(var _0x5fbee3=0x0;_0x5fbee3<_0x2f561b[_0x6169('0x2e')];_0x5fbee3++){_0x37b6a2['push'](db['UserVoiceQueueRt']['upsert']({'membername':_0x16d4bc[_0x6169('0x2c')],'UserId':_0x16d4bc['id'],'queue_name':_0x2f561b[_0x5fbee3][_0x6169('0x2c')],'VoiceQueueId':_0x2f561b[_0x5fbee3]['id'],'interface':_0x28f6a0,'paused':_0x16d4bc['loginInPause']||![],'penalty':_0x2f561b[_0x5fbee3][_0x6169('0x54')]||0x0}));}return BPromise[_0x6169('0x48')](_0x37b6a2);}}}})['then'](function(){if(_0x16d4bc){return db['MemberReport']['findAll']({'where':{'membername':_0x16d4bc['name'],'exitAt':null}});}})['then'](function(_0xe22898){if(_0x16d4bc){if(_0xe22898&&_0xe22898[_0x6169('0x2e')]){var _0x4fb13f=[];_0xe22898[_0x6169('0x4a')](function(_0x2e8d61){_0x4fb13f[_0x6169('0x32')](_0x2e8d61[_0x6169('0x2a')]({'exitAt':moment()[_0x6169('0x35')](_0x6169('0x2f'))}));});return BPromise[_0x6169('0x48')](_0x4fb13f);}}})['then'](function(_0x734eec){if(_0x16d4bc){var _0x7257a8=[];var _0x3f1c6b=[];var _0x410d2f=utils[_0x6169('0x31')]();var _0xe45ed5={'membername':_0x16d4bc[_0x6169('0x2c')],'interface':_0x28f6a0,'enterAt':moment()['format'](_0x6169('0x2f')),'role':_0x16d4bc[_0x6169('0x39')],'internal':_0x16d4bc[_0x6169('0x27')]};_0x410d2f[_0x6169('0x4a')](function(_0x3f2fb6){_0x7257a8[_0x6169('0x32')](_[_0x6169('0x55')]({'channel':_0x3f2fb6,'type':_0x6169('0x56'),'data1':'callysquare','data2':_0x28f6a0},_0xe45ed5));if(_0x16d4bc[_0x6169('0x57')]){_0x3f1c6b[_0x6169('0x32')](_[_0x6169('0x55')]({'channel':_0x3f2fb6,'type':_0x6169('0x2d'),'data1':_0x6169('0x58')},_0xe45ed5));}});return db[_0x6169('0x2b')][_0x6169('0x3a')](_0x7257a8['concat'](_0x3f1c6b),{'individualHooks':!![]});}})[_0x6169('0x29')](function(){if(_0x16d4bc){return _0x16d4bc['update']({'online':!![],'lastLoginAt':moment()[_0x6169('0x35')](_0x6169('0x2f')),'voicePause':_0x16d4bc['loginInPause']||![],'mailPause':_0x16d4bc['loginInPause']||![],'chatPause':_0x16d4bc[_0x6169('0x57')]||![],'faxPause':_0x16d4bc[_0x6169('0x57')]||![],'smsPause':_0x16d4bc[_0x6169('0x57')]||![],'openchannelPause':_0x16d4bc[_0x6169('0x57')]||![],'pauseType':_0x16d4bc[_0x6169('0x57')]?_0x6169('0x58'):null,'lastPauseAt':moment()[_0x6169('0x35')](_0x6169('0x2f')),'interface':_0x28f6a0});}})[_0x6169('0x29')](function(_0xa3f2dc){_0x5c258b(_0xa3f2dc);})[_0x6169('0x22')](function(_0x201396){_0x31e771(_0x5bd6e0[_0x6169('0x12')](0x1f4,_0x201396['message']));});});}; \ No newline at end of file +var _0x7067=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./user.socket','register','request','then','info','User,\x20%s,\x20%s','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetUser','User','options','raw','where','attributes','include','model','map','ShowUser','PauseUser','internal','update','MemberReport','name','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','push','SIP/%s','type','role','bulkCreate','body','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','Unknown\x20channel','UserVoiceQueueRt','find','system','mail','chat','fax','sms','openchannel','whatsapp','set','%s%s','Pause','findAll','all','destroy','LoginUser','mobile','loginInPause','interface','count','agent','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','getVoiceQueues','upsert','UserVoiceQueue.penalty','getChannels','merge','callysquare','LOGININPAUSE'];(function(_0x1b7cbf,_0x2cd045){var _0x343230=function(_0x5ea2e3){while(--_0x5ea2e3){_0x1b7cbf['push'](_0x1b7cbf['shift']());}};_0x343230(++_0x2cd045);}(_0x7067,0x111));var _0x7706=function(_0x3aa60d,_0x4c06b2){_0x3aa60d=_0x3aa60d-0x0;var _0xb3696b=_0x7067[_0x3aa60d];return _0xb3696b;};'use strict';var _=require(_0x7706('0x0'));var util=require(_0x7706('0x1'));var moment=require(_0x7706('0x2'));var BPromise=require(_0x7706('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7706('0x4'));var db=require(_0x7706('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7706('0x6'));var jayson=require(_0x7706('0x7'));var client=jayson[_0x7706('0x8')][_0x7706('0x9')]({'port':0x232a});config[_0x7706('0xa')]=_[_0x7706('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7706('0xc'))(new Redis(config[_0x7706('0xa')]));require(_0x7706('0xd'))[_0x7706('0xe')](socket);function respondWithRpcPromise(_0x26327f,_0x2eae4a,_0x21a839){return new BPromise(function(_0x3e7f93,_0x47c716){return client[_0x7706('0xf')](_0x26327f,_0x21a839)[_0x7706('0x10')](function(_0x43c68d){logger[_0x7706('0x11')](_0x7706('0x12'),_0x2eae4a,'request\x20sent');logger[_0x7706('0x13')](_0x7706('0x14'),_0x2eae4a,_0x7706('0x15'),JSON[_0x7706('0x16')](_0x43c68d));if(_0x43c68d[_0x7706('0x17')]){if(_0x43c68d[_0x7706('0x17')]['code']===0x1f4){logger[_0x7706('0x17')](_0x7706('0x12'),_0x2eae4a,_0x43c68d[_0x7706('0x17')]['message']);return _0x47c716(_0x43c68d['error'][_0x7706('0x18')]);}logger[_0x7706('0x17')]('User,\x20%s,\x20%s',_0x2eae4a,_0x43c68d['error'][_0x7706('0x18')]);return _0x3e7f93(_0x43c68d[_0x7706('0x17')][_0x7706('0x18')]);}else{logger[_0x7706('0x11')](_0x7706('0x12'),_0x2eae4a,'request\x20sent');_0x3e7f93(_0x43c68d[_0x7706('0x19')]['message']);}})[_0x7706('0x1a')](function(_0x2c3030){logger['error'](_0x7706('0x12'),_0x2eae4a,_0x2c3030);_0x47c716(_0x2c3030);});});}exports[_0x7706('0x1b')]=function(_0xfef6e0){var _0x5efaf6=this;return new Promise(function(_0x24bed1,_0x39bff5){return db[_0x7706('0x1c')]['findAll']({'raw':_0xfef6e0[_0x7706('0x1d')]?_0xfef6e0[_0x7706('0x1d')][_0x7706('0x1e')]===undefined?!![]:![]:!![],'where':_0xfef6e0[_0x7706('0x1d')]?_0xfef6e0[_0x7706('0x1d')][_0x7706('0x1f')]||null:null,'attributes':_0xfef6e0[_0x7706('0x1d')]?_0xfef6e0[_0x7706('0x1d')][_0x7706('0x20')]||null:null,'limit':_0xfef6e0['options']?_0xfef6e0[_0x7706('0x1d')]['limit']||null:null,'include':_0xfef6e0[_0x7706('0x1d')]?_0xfef6e0['options'][_0x7706('0x21')]?_['map'](_0xfef6e0[_0x7706('0x1d')][_0x7706('0x21')],function(_0x482ac5){return{'model':db[_0x482ac5[_0x7706('0x22')]],'as':_0x482ac5['as'],'attributes':_0x482ac5[_0x7706('0x20')],'include':_0x482ac5['include']?_[_0x7706('0x23')](_0x482ac5['include'],function(_0x38f6ff){return{'model':db[_0x38f6ff[_0x7706('0x22')]],'as':_0x38f6ff['as'],'attributes':_0x38f6ff['attributes'],'include':_0x38f6ff['include']?_[_0x7706('0x23')](_0x38f6ff['include'],function(_0x26f7d2){return{'model':db[_0x26f7d2[_0x7706('0x22')]],'as':_0x26f7d2['as'],'attributes':_0x26f7d2[_0x7706('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7706('0x10')](function(_0x578071){logger[_0x7706('0x11')]('GetUser',_0xfef6e0);logger[_0x7706('0x13')](_0x7706('0x1b'),_0xfef6e0,JSON['stringify'](_0x578071));_0x24bed1(_0x578071);})['catch'](function(_0x5e8c59){logger['error'](_0x7706('0x1b'),_0x5e8c59[_0x7706('0x18')],_0xfef6e0);_0x39bff5(_0x5efaf6[_0x7706('0x17')](0x1f4,_0x5e8c59[_0x7706('0x18')]));});});};exports[_0x7706('0x24')]=function(_0x2f8117){var _0x506b88=this;return new Promise(function(_0x1578f0,_0x20d850){return db[_0x7706('0x1c')]['find']({'raw':_0x2f8117['options']?_0x2f8117[_0x7706('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2f8117[_0x7706('0x1d')]?_0x2f8117[_0x7706('0x1d')]['where']||null:null,'attributes':_0x2f8117[_0x7706('0x1d')]?_0x2f8117[_0x7706('0x1d')][_0x7706('0x20')]||null:null,'include':_0x2f8117[_0x7706('0x1d')]?_0x2f8117[_0x7706('0x1d')][_0x7706('0x21')]?_[_0x7706('0x23')](_0x2f8117['options'][_0x7706('0x21')],function(_0x3a20fc){return{'model':db[_0x3a20fc[_0x7706('0x22')]],'as':_0x3a20fc['as'],'attributes':_0x3a20fc[_0x7706('0x20')],'include':_0x3a20fc[_0x7706('0x21')]?_[_0x7706('0x23')](_0x3a20fc['include'],function(_0x53648c){return{'model':db[_0x53648c[_0x7706('0x22')]],'as':_0x53648c['as'],'attributes':_0x53648c['attributes'],'include':_0x53648c[_0x7706('0x21')]?_[_0x7706('0x23')](_0x53648c[_0x7706('0x21')],function(_0x43044d){return{'model':db[_0x43044d['model']],'as':_0x43044d['as'],'attributes':_0x43044d[_0x7706('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7706('0x10')](function(_0x440827){logger[_0x7706('0x11')]('ShowUser',_0x2f8117);logger[_0x7706('0x13')](_0x7706('0x24'),_0x2f8117,JSON[_0x7706('0x16')](_0x440827));_0x1578f0(_0x440827);})[_0x7706('0x1a')](function(_0x21ade3){logger['error'](_0x7706('0x24'),_0x21ade3[_0x7706('0x18')],_0x2f8117);_0x20d850(_0x506b88[_0x7706('0x17')](0x1f4,_0x21ade3[_0x7706('0x18')]));});});};exports[_0x7706('0x25')]=function(_0x5e3579){var _0x358466=this;return new Promise(function(_0x228db7,_0x2acd6d){var _0x241289;return db[_0x7706('0x1c')]['find']({'where':_0x5e3579[_0x7706('0x1d')]['where']||{},'attributes':['id','name','role',_0x7706('0x26'),'interface']})[_0x7706('0x10')](function(_0x3be5f6){if(_0x3be5f6){_0x241289=_0x3be5f6;return db['UserVoiceQueueRt'][_0x7706('0x27')]({'paused':0x1},{'where':{'UserId':_0x241289['id']},'individualHooks':!![]});}})[_0x7706('0x10')](function(){if(_0x241289){return db[_0x7706('0x28')]['findAll']({'where':{'membername':_0x241289[_0x7706('0x29')],'type':_0x7706('0x2a'),'exitAt':null}});}})[_0x7706('0x10')](function(_0x4df13f){if(_0x241289){if(_0x4df13f&&_0x4df13f[_0x7706('0x2b')]){var _0x5a1044=moment()[_0x7706('0x2c')](_0x7706('0x2d'));for(var _0x1a5b2b=0x0,_0x31f88a=_0x4df13f[_0x7706('0x2b')];_0x1a5b2b<_0x31f88a;_0x1a5b2b++){_0x4df13f[_0x1a5b2b][_0x7706('0x2e')]({'exitAt':_0x5a1044});}}}})[_0x7706('0x10')](function(){if(_0x241289){var _0x1c6459=[];var _0x523796=utils['getChannels']();_0x523796[_0x7706('0x2f')](function(_0x95999a){_0x1c6459[_0x7706('0x30')]({'channel':_0x95999a,'membername':_0x241289['name'],'interface':_['isNil'](_0x241289['interface'])?util['format'](_0x7706('0x31'),_0x241289['name']):_0x241289['interface'],'type':_0x7706('0x2a'),'enterAt':moment()[_0x7706('0x2c')](_0x7706('0x2d')),'data1':_0x5e3579['body'][_0x7706('0x32')]||'DEFAULT\x20PAUSE','role':_0x241289[_0x7706('0x33')],'internal':_0x241289[_0x7706('0x26')],'uniqueid':_0x5e3579['body']['uniqueid']||null});});return db[_0x7706('0x28')][_0x7706('0x34')](_0x1c6459,{'individualHooks':!![]});}})[_0x7706('0x10')](function(){if(_0x241289){return _0x241289[_0x7706('0x27')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5e3579[_0x7706('0x35')]['type']||_0x7706('0x36'),'lastPauseAt':moment()[_0x7706('0x2c')](_0x7706('0x2d'))});}})[_0x7706('0x10')](function(_0x372e43){_0x228db7(_0x372e43);})['catch'](function(_0x5ae283){_0x2acd6d(_0x358466[_0x7706('0x17')](0x1f4,_0x5ae283['message']));});});};exports[_0x7706('0x37')]=function(_0x3e0140){var _0x55cccf=this;return new Promise(function(_0x15b408,_0x32ce24){var _0x3b8e84;return db[_0x7706('0x1c')][_0x7706('0x38')]({'where':_0x3e0140[_0x7706('0x1d')][_0x7706('0x1f')]||{},'attributes':['id',_0x7706('0x29')]})[_0x7706('0x10')](function(_0x5de805){if(_0x5de805){_0x3b8e84=_0x5de805;if(_0x3e0140['body']['channel']&&!utils['isValidChannel'](_0x3e0140[_0x7706('0x35')][_0x7706('0x39')])){throw new Error(_0x7706('0x3a'));}switch(_0x3e0140[_0x7706('0x35')][_0x7706('0x39')]){case'voice':return db[_0x7706('0x3b')][_0x7706('0x27')]({'paused':0x0},{'where':{'UserId':_0x3b8e84['id']}})[_0x7706('0x10')](function(){return db['MemberReport'][_0x7706('0x3c')]({'where':{'channel':_0x3e0140[_0x7706('0x35')]['channel'],'membername':_0x3b8e84[_0x7706('0x29')],'type':_0x7706('0x2a'),'exitAt':null}});})[_0x7706('0x10')](function(_0x3ace0f){if(_0x3ace0f){return _0x3ace0f[_0x7706('0x27')]({'exitAt':moment()[_0x7706('0x2c')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7706('0x3d')},{'individualHooks':!![]});}return null;})[_0x7706('0x10')](function(){return _0x3b8e84[_0x7706('0x27')]({'voicePause':![]});});case _0x7706('0x3e'):case _0x7706('0x3f'):case _0x7706('0x40'):case _0x7706('0x41'):case _0x7706('0x42'):case _0x7706('0x43'):return db['MemberReport']['find']({'where':{'channel':_0x3e0140['body'][_0x7706('0x39')],'membername':_0x3b8e84[_0x7706('0x29')],'type':_0x7706('0x2a'),'exitAt':null}})[_0x7706('0x10')](function(_0x4e0115){return _0x4e0115[_0x7706('0x27')]({'exitAt':moment()[_0x7706('0x2c')](_0x7706('0x2d')),'data2':'system'},{'individualHooks':!![]});})[_0x7706('0x10')](function(){var _0x1c498d={};_[_0x7706('0x44')](_0x1c498d,util[_0x7706('0x2c')](_0x7706('0x45'),_0x3e0140['body'][_0x7706('0x39')],_0x7706('0x46')),![]);return _0x3b8e84[_0x7706('0x27')](_0x1c498d);});default:return db['UserVoiceQueueRt'][_0x7706('0x27')]({'paused':0x0},{'where':{'UserId':_0x3b8e84['id']}})[_0x7706('0x10')](function(){return db[_0x7706('0x28')][_0x7706('0x47')]({'where':{'membername':_0x3b8e84[_0x7706('0x29')],'type':_0x7706('0x2a'),'exitAt':null}});})[_0x7706('0x10')](function(_0x16d62d){var _0x377423=[];_0x16d62d[_0x7706('0x2f')](function(_0x364bce){_0x377423[_0x7706('0x30')](_0x364bce[_0x7706('0x27')]({'exitAt':moment()['format'](_0x7706('0x2d')),'data2':_0x7706('0x3d')}));});return BPromise[_0x7706('0x48')](_0x377423);})['then'](function(){return _0x3b8e84[_0x7706('0x27')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})[_0x7706('0x10')](function(_0x28c2d6){_0x15b408(_0x28c2d6);})['catch'](function(_0x563368){_0x32ce24(_0x55cccf[_0x7706('0x17')](0x1f4,_0x563368['message']));});});};exports['LogoutUser']=function(_0x1cfea1){var _0xb79186=this;return new Promise(function(_0x5421ee,_0x20e5f1){var _0x2b8795;return db[_0x7706('0x1c')][_0x7706('0x38')]({'where':_0x1cfea1[_0x7706('0x1d')]['where']||{},'attributes':['id',_0x7706('0x29')]})[_0x7706('0x10')](function(_0x23000c){if(_0x23000c){_0x2b8795=_0x23000c;return db['UserVoiceQueueRt'][_0x7706('0x49')]({'where':{'membername':_0x2b8795['name']},'individualHooks':!![]});}})[_0x7706('0x10')](function(){if(_0x2b8795){return db[_0x7706('0x28')][_0x7706('0x47')]({'where':{'membername':_0x2b8795['name'],'exitAt':null}});}})[_0x7706('0x10')](function(_0x3a393d){if(_0x2b8795){if(_0x3a393d&&_0x3a393d[_0x7706('0x2b')]){var _0x7f8f62=[];_0x3a393d[_0x7706('0x2f')](function(_0x5031bf){_0x7f8f62['push'](_0x5031bf[_0x7706('0x27')]({'exitAt':moment()['format'](_0x7706('0x2d'))}));});return BPromise[_0x7706('0x48')](_0x7f8f62);}}})[_0x7706('0x10')](function(){if(_0x2b8795){return _0x2b8795['update']({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x261f70){_0x5421ee(_0x261f70);})[_0x7706('0x1a')](function(_0x89ad9f){_0x20e5f1(_0xb79186[_0x7706('0x17')](0x1f4,_0x89ad9f[_0x7706('0x18')]));});});};exports[_0x7706('0x4a')]=function(_0x5553a3){var _0x2b89e6=this;return new Promise(function(_0x497d37,_0x266c3e){var _0x3249d0;var _0x409329;var _0x2260ad;var _0x583625;return db['User']['findOne']({'where':_0x5553a3[_0x7706('0x1d')][_0x7706('0x1f')]||{},'attributes':['id','name','role',_0x7706('0x4b'),'phone',_0x7706('0x26'),_0x7706('0x4c'),'interface']})[_0x7706('0x10')](function(_0x446958){if(_0x446958){_0x3249d0=_0x446958;_0x583625=_0x5553a3['body'][_0x7706('0x4d')]?_0x5553a3['body'][_0x7706('0x4d')]:util[_0x7706('0x2c')](_0x7706('0x31'),_0x3249d0[_0x7706('0x29')]);return db[_0x7706('0x1c')][_0x7706('0x4e')]({'where':{'role':_0x7706('0x4f'),'online':!![],'id':{'$ne':_0x3249d0['id']}}});}})[_0x7706('0x10')](function(_0x48cabd){if(_0x48cabd){_0x2260ad=_0x48cabd;return require(_0x7706('0x50'))[_0x7706('0x51')]();}})['then'](function(_0x49810b){if(_0x49810b&&_0x49810b[_0x7706('0x52')]&&_0x2260ad>=_0x49810b['agents']){throw new Error(_0x7706('0x53'));}})[_0x7706('0x10')](function(){if(_0x3249d0){return db['UserVoiceQueueRt'][_0x7706('0x49')]({'where':{'membername':_0x3249d0['name']},'individualHooks':!![]});}})[_0x7706('0x10')](function(){if(_0x3249d0){return _0x3249d0[_0x7706('0x54')]({'raw':!![]});}})['then'](function(_0x4cca92){if(_0x3249d0){if(_0x4cca92){var _0x335af3=[];_0x409329=_0x4cca92;if(_0x409329[_0x7706('0x2b')]){for(var _0x2a8c15=0x0;_0x2a8c15<_0x409329['length'];_0x2a8c15++){_0x335af3[_0x7706('0x30')](db[_0x7706('0x3b')][_0x7706('0x55')]({'membername':_0x3249d0[_0x7706('0x29')],'UserId':_0x3249d0['id'],'queue_name':_0x409329[_0x2a8c15]['name'],'VoiceQueueId':_0x409329[_0x2a8c15]['id'],'interface':_0x583625,'paused':_0x3249d0['loginInPause']||![],'penalty':_0x409329[_0x2a8c15][_0x7706('0x56')]||0x0}));}return BPromise[_0x7706('0x48')](_0x335af3);}}}})[_0x7706('0x10')](function(){if(_0x3249d0){return db['MemberReport'][_0x7706('0x47')]({'where':{'membername':_0x3249d0[_0x7706('0x29')],'exitAt':null}});}})[_0x7706('0x10')](function(_0x2e7b0a){if(_0x3249d0){if(_0x2e7b0a&&_0x2e7b0a[_0x7706('0x2b')]){var _0x4053fd=[];_0x2e7b0a[_0x7706('0x2f')](function(_0x531932){_0x4053fd[_0x7706('0x30')](_0x531932[_0x7706('0x27')]({'exitAt':moment()[_0x7706('0x2c')](_0x7706('0x2d'))}));});return BPromise[_0x7706('0x48')](_0x4053fd);}}})[_0x7706('0x10')](function(_0x17a449){if(_0x3249d0){var _0xdacaf2=[];var _0x56a485=[];var _0x3a5de0=utils[_0x7706('0x57')]();var _0x5c58ba={'membername':_0x3249d0[_0x7706('0x29')],'interface':_0x583625,'enterAt':moment()['format'](_0x7706('0x2d')),'role':_0x3249d0[_0x7706('0x33')],'internal':_0x3249d0['internal']};_0x3a5de0[_0x7706('0x2f')](function(_0x460e54){_0xdacaf2['push'](_[_0x7706('0x58')]({'channel':_0x460e54,'type':'LOGIN','data1':_0x7706('0x59'),'data2':_0x583625},_0x5c58ba));if(_0x3249d0[_0x7706('0x4c')]){_0x56a485['push'](_[_0x7706('0x58')]({'channel':_0x460e54,'type':_0x7706('0x2a'),'data1':_0x7706('0x5a')},_0x5c58ba));}});return db['MemberReport']['bulkCreate'](_0xdacaf2['concat'](_0x56a485),{'individualHooks':!![]});}})['then'](function(){if(_0x3249d0){return _0x3249d0[_0x7706('0x27')]({'online':!![],'lastLoginAt':moment()['format'](_0x7706('0x2d')),'voicePause':_0x3249d0[_0x7706('0x4c')]||![],'mailPause':_0x3249d0[_0x7706('0x4c')]||![],'chatPause':_0x3249d0[_0x7706('0x4c')]||![],'faxPause':_0x3249d0[_0x7706('0x4c')]||![],'smsPause':_0x3249d0[_0x7706('0x4c')]||![],'openchannelPause':_0x3249d0['loginInPause']||![],'pauseType':_0x3249d0[_0x7706('0x4c')]?_0x7706('0x5a'):null,'lastPauseAt':moment()['format'](_0x7706('0x2d')),'interface':_0x583625});}})[_0x7706('0x10')](function(_0x19af99){_0x497d37(_0x19af99);})[_0x7706('0x1a')](function(_0x6d803a){_0x266c3e(_0x2b89e6[_0x7706('0x17')](0x1f4,_0x6d803a[_0x7706('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 30142ee..7f1dc5f 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 _0x3d2f=['register','length','./user.events','save','remove','emit','removeListener'];(function(_0x40b493,_0x4050de){var _0x548365=function(_0x8ceba7){while(--_0x8ceba7){_0x40b493['push'](_0x40b493['shift']());}};_0x548365(++_0x4050de);}(_0x3d2f,0xf7));var _0xf3d2=function(_0x18ffb2,_0x458055){_0x18ffb2=_0x18ffb2-0x0;var _0x4a48c0=_0x3d2f[_0x18ffb2];return _0x4a48c0;};'use strict';var UserEvents=require(_0xf3d2('0x0'));var events=[_0xf3d2('0x1'),_0xf3d2('0x2'),'update'];function createListener(_0x3b6467,_0x1dd145){return function(_0x27f6bf){_0x1dd145[_0xf3d2('0x3')](_0x3b6467,_0x27f6bf);};}function removeListener(_0x4130e4,_0x15fa4a){return function(){UserEvents[_0xf3d2('0x4')](_0x4130e4,_0x15fa4a);};}exports[_0xf3d2('0x5')]=function(_0x1c7941){for(var _0x4ef98c=0x0,_0x11cf32=events[_0xf3d2('0x6')];_0x4ef98c<_0x11cf32;_0x4ef98c++){var _0x10abf6=events[_0x4ef98c];var _0x716d56=createListener('user:'+_0x10abf6,_0x1c7941);UserEvents['on'](_0x10abf6,_0x716d56);}}; \ No newline at end of file +var _0x20b5=['register','length','./user.events','save','remove','update','emit'];(function(_0x5f12c9,_0x999e31){var _0x53cbaf=function(_0x2a47c7){while(--_0x2a47c7){_0x5f12c9['push'](_0x5f12c9['shift']());}};_0x53cbaf(++_0x999e31);}(_0x20b5,0x12f));var _0x520b=function(_0x22835e,_0x14ffec){_0x22835e=_0x22835e-0x0;var _0xb85ef9=_0x20b5[_0x22835e];return _0xb85ef9;};'use strict';var UserEvents=require(_0x520b('0x0'));var events=[_0x520b('0x1'),_0x520b('0x2'),_0x520b('0x3')];function createListener(_0x247132,_0x5c2405){return function(_0x11e4f0){_0x5c2405[_0x520b('0x4')](_0x247132,_0x11e4f0);};}function removeListener(_0x47d5ca,_0x39d30b){return function(){UserEvents['removeListener'](_0x47d5ca,_0x39d30b);};}exports[_0x520b('0x5')]=function(_0x5ec5d2){for(var _0x530d2d=0x0,_0x5b7410=events[_0x520b('0x6')];_0x530d2d<_0x5b7410;_0x530d2d++){var _0x4dd0df=events[_0x530d2d];var _0x112f61=createListener('user:'+_0x4dd0df,_0x5ec5d2);UserEvents['on'](_0x4dd0df,_0x112f61);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 9e0acf0..5d041a6 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0xfe2ba1,_0x4677fc){var _0x37082c=function(_0x5304a2){while(--_0x5304a2){_0xfe2ba1['push'](_0xfe2ba1['shift']());}};_0x37082c(++_0x4677fc);}(_0xedd9,0xfc));var _0x9edd=function(_0x22c0ff,_0x30a86e){_0x22c0ff=_0x22c0ff-0x0;var _0x8831c9=_0xedd9[_0x22c0ff];return _0x8831c9;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x241c39,_0x29aa3c){var _0x4f2ccc=function(_0x41ef24){while(--_0x41ef24){_0x241c39['push'](_0x241c39['shift']());}};_0x4f2ccc(++_0x29aa3c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x590851,_0x496bee){_0x590851=_0x590851-0x0;var _0x3b0115=_0xcb91[_0x590851];return _0x3b0115;};'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/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 250ef7e..4ac373e 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 _0x45ec=['INTEGER','sequelize','exports'];(function(_0x33e2ec,_0xa04eb){var _0x5f031f=function(_0xa35e32){while(--_0xa35e32){_0x33e2ec['push'](_0x33e2ec['shift']());}};_0x5f031f(++_0xa04eb);}(_0x45ec,0xa3));var _0xc45e=function(_0xcf941e,_0x1c2d23){_0xcf941e=_0xcf941e-0x0;var _0xced5be=_0x45ec[_0xcf941e];return _0xced5be;};'use strict';var Sequelize=require(_0xc45e('0x0'));module[_0xc45e('0x1')]={'penalty':{'type':Sequelize[_0xc45e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xfbab=['sequelize','exports','INTEGER'];(function(_0x32e3b0,_0x355860){var _0x5c863d=function(_0x4077c6){while(--_0x4077c6){_0x32e3b0['push'](_0x32e3b0['shift']());}};_0x5c863d(++_0x355860);}(_0xfbab,0x1da));var _0xbfba=function(_0x1b4b59,_0x4fffc3){_0x1b4b59=_0x1b4b59-0x0;var _0x5c9f08=_0xfbab[_0x1b4b59];return _0x5c9f08;};'use strict';var Sequelize=require(_0xbfba('0x0'));module[_0xbfba('0x1')]={'penalty':{'type':Sequelize[_0xbfba('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 23fc552..1d1e265 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 _0x164e=['exports','define','UserChatQueue','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes'];(function(_0x32bafe,_0x18e4da){var _0x3e35c7=function(_0x52198d){while(--_0x52198d){_0x32bafe['push'](_0x32bafe['shift']());}};_0x3e35c7(++_0x18e4da);}(_0x164e,0x162));var _0xe164=function(_0x2f551b,_0x2f371f){_0x2f551b=_0x2f551b-0x0;var _0x5948ba=_0x164e[_0x2f551b];return _0x5948ba;};'use strict';var _=require(_0xe164('0x0'));var util=require(_0xe164('0x1'));var logger=require(_0xe164('0x2'))(_0xe164('0x3'));var moment=require(_0xe164('0x4'));var BPromise=require('bluebird');var rp=require(_0xe164('0x5'));var fs=require('fs');var path=require(_0xe164('0x6'));var rimraf=require(_0xe164('0x7'));var config=require(_0xe164('0x8'));var attributes=require(_0xe164('0x9'));module[_0xe164('0xa')]=function(_0x2c169e,_0x47d4b4){return _0x2c169e[_0xe164('0xb')](_0xe164('0xc'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe1e9=['path','../../config/environment','./userChatQueue.attributes','define','UserChatQueue','user_has_chat_queues','util','../../config/logger','bluebird'];(function(_0x1e21c5,_0x5c2d41){var _0x2931f5=function(_0x5e3cc1){while(--_0x5e3cc1){_0x1e21c5['push'](_0x1e21c5['shift']());}};_0x2931f5(++_0x5c2d41);}(_0xe1e9,0xb1));var _0x9e1e=function(_0x33965f,_0x7bb4b5){_0x33965f=_0x33965f-0x0;var _0x36389d=_0xe1e9[_0x33965f];return _0x36389d;};'use strict';var _=require('lodash');var util=require(_0x9e1e('0x0'));var logger=require(_0x9e1e('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9e1e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9e1e('0x3'));var rimraf=require('rimraf');var config=require(_0x9e1e('0x4'));var attributes=require(_0x9e1e('0x5'));module['exports']=function(_0x4e8957,_0x5dfc29){return _0x4e8957[_0x9e1e('0x6')](_0x9e1e('0x7'),attributes,{'tableName':_0x9e1e('0x8'),'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 661c613..cf3572b 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 _0x49d4=['../../config/environment','jayson/promise','client','request','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x49d4,0x1c2));var _0x449d=function(_0x41116d,_0x274187){_0x41116d=_0x41116d-0x0;var _0x344dfa=_0x49d4[_0x41116d];return _0x344dfa;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x449d('0x0'));var BPromise=require('bluebird');var rs=require(_0x449d('0x1'));var fs=require('fs');var Redis=require(_0x449d('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x449d('0x3'));var logger=require(_0x449d('0x4'))(_0x449d('0x5'));var config=require(_0x449d('0x6'));var jayson=require(_0x449d('0x7'));var client=jayson[_0x449d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a73e8,_0x18123b,_0x4d7cd4){return new BPromise(function(_0xc211d5,_0x312477){return client[_0x449d('0x9')](_0x1a73e8,_0x4d7cd4)['then'](function(_0x304bd4){logger[_0x449d('0xa')](_0x449d('0xb'),_0x18123b,_0x449d('0xc'));logger[_0x449d('0xd')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x18123b,_0x449d('0xc'),JSON['stringify'](_0x304bd4));if(_0x304bd4['error']){if(_0x304bd4[_0x449d('0xe')][_0x449d('0xf')]===0x1f4){logger[_0x449d('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x18123b,_0x304bd4['error'][_0x449d('0x10')]);return _0x312477(_0x304bd4[_0x449d('0xe')][_0x449d('0x10')]);}logger[_0x449d('0xe')]('UserChatQueue,\x20%s,\x20%s',_0x18123b,_0x304bd4['error']['message']);return _0xc211d5(_0x304bd4['error']['message']);}else{logger[_0x449d('0xa')](_0x449d('0xb'),_0x18123b,_0x449d('0xc'));_0xc211d5(_0x304bd4[_0x449d('0x11')]['message']);}})[_0x449d('0x12')](function(_0x2fad45){logger[_0x449d('0xe')](_0x449d('0xb'),_0x18123b,_0x2fad45);_0x312477(_0x2fad45);});});} \ No newline at end of file +var _0xe954=['error','code','message','lodash','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','client','http','request','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s'];(function(_0xb3b6b8,_0xd10d80){var _0x1b007d=function(_0x1c1f2b){while(--_0x1c1f2b){_0xb3b6b8['push'](_0xb3b6b8['shift']());}};_0x1b007d(++_0xd10d80);}(_0xe954,0x192));var _0x4e95=function(_0x5080dc,_0x560d81){_0x5080dc=_0x5080dc-0x0;var _0x5c0281=_0xe954[_0x5080dc];return _0x5c0281;};'use strict';var _=require(_0x4e95('0x0'));var util=require(_0x4e95('0x1'));var moment=require('moment');var BPromise=require(_0x4e95('0x2'));var rs=require(_0x4e95('0x3'));var fs=require('fs');var Redis=require(_0x4e95('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4e95('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e95('0x6'));var client=jayson[_0x4e95('0x7')][_0x4e95('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25f769,_0x307ac8,_0x52fe8e){return new BPromise(function(_0x313979,_0x44c281){return client[_0x4e95('0x9')](_0x25f769,_0x52fe8e)[_0x4e95('0xa')](function(_0x2ef133){logger[_0x4e95('0xb')](_0x4e95('0xc'),_0x307ac8,_0x4e95('0xd'));logger[_0x4e95('0xe')](_0x4e95('0xf'),_0x307ac8,_0x4e95('0xd'),JSON['stringify'](_0x2ef133));if(_0x2ef133[_0x4e95('0x10')]){if(_0x2ef133[_0x4e95('0x10')][_0x4e95('0x11')]===0x1f4){logger['error'](_0x4e95('0xc'),_0x307ac8,_0x2ef133[_0x4e95('0x10')]['message']);return _0x44c281(_0x2ef133[_0x4e95('0x10')][_0x4e95('0x12')]);}logger[_0x4e95('0x10')](_0x4e95('0xc'),_0x307ac8,_0x2ef133['error'][_0x4e95('0x12')]);return _0x313979(_0x2ef133[_0x4e95('0x10')][_0x4e95('0x12')]);}else{logger[_0x4e95('0xb')](_0x4e95('0xc'),_0x307ac8,_0x4e95('0xd'));_0x313979(_0x2ef133['result'][_0x4e95('0x12')]);}})['catch'](function(_0x2f4c64){logger[_0x4e95('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x307ac8,_0x2f4c64);_0x44c281(_0x2f4c64);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index da5b10e..3034445 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(_0x416928,_0x1078dc){var _0x21f8d6=function(_0x5125eb){while(--_0x5125eb){_0x416928['push'](_0x416928['shift']());}};_0x21f8d6(++_0x1078dc);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x54d2fb,_0x31fd9e){var _0x10cb87=function(_0x1a8716){while(--_0x1a8716){_0x54d2fb['push'](_0x54d2fb['shift']());}};_0x10cb87(++_0x31fd9e);}(_0x9c44,0x178));var _0x49c4=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x9c44[_0x6cf19c];return _0xce14f3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index fd33499..c052770 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 _0xec5d=['exports','INTEGER','STRING'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xec5d,0x189));var _0xdec5=function(_0x3f3447,_0x344586){_0x3f3447=_0x3f3447-0x0;var _0x4d5e63=_0xec5d[_0x3f3447];return _0x4d5e63;};'use strict';var Sequelize=require('sequelize');module[_0xdec5('0x0')]={'penalty':{'type':Sequelize[_0xdec5('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdec5('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdec5('0x2')]}}; \ No newline at end of file +var _0x2dbb=['INTEGER','sequelize','exports'];(function(_0x17002c,_0x11f295){var _0x120893=function(_0x3f3d35){while(--_0x3f3d35){_0x17002c['push'](_0x17002c['shift']());}};_0x120893(++_0x11f295);}(_0x2dbb,0x17e));var _0xb2db=function(_0xab1fdb,_0x272760){_0xab1fdb=_0xab1fdb-0x0;var _0x280d9=_0x2dbb[_0xab1fdb];return _0x280d9;};'use strict';var Sequelize=require(_0xb2db('0x0'));module[_0xb2db('0x1')]={'penalty':{'type':Sequelize[_0xb2db('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb2db('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8f3096a..b128dd0 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 _0x35bc=['rimraf','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0xa2cc71,_0x560838){var _0x46b0fa=function(_0x6b30ad){while(--_0x6b30ad){_0xa2cc71['push'](_0xa2cc71['shift']());}};_0x46b0fa(++_0x560838);}(_0x35bc,0x7d));var _0xc35b=function(_0x182b41,_0x3710ca){_0x182b41=_0x182b41-0x0;var _0x39e4dc=_0x35bc[_0x182b41];return _0x39e4dc;};'use strict';var _=require(_0xc35b('0x0'));var util=require(_0xc35b('0x1'));var logger=require('../../config/logger')(_0xc35b('0x2'));var moment=require(_0xc35b('0x3'));var BPromise=require(_0xc35b('0x4'));var rp=require(_0xc35b('0x5'));var fs=require('fs');var path=require(_0xc35b('0x6'));var rimraf=require(_0xc35b('0x7'));var config=require('../../config/environment');var attributes=require(_0xc35b('0x8'));module[_0xc35b('0x9')]=function(_0x572a29,_0x78c203){return _0x572a29[_0xc35b('0xa')]('UserFaxQueue',attributes,{'tableName':_0xc35b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f4=['UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports'];(function(_0x36729a,_0x35ff88){var _0x4e454d=function(_0x5b81e8){while(--_0x5b81e8){_0x36729a['push'](_0x36729a['shift']());}};_0x4e454d(++_0x35ff88);}(_0x30f4,0x147));var _0x430f=function(_0x5ea9e1,_0x27b1e9){_0x5ea9e1=_0x5ea9e1-0x0;var _0x5a2e4c=_0x30f4[_0x5ea9e1];return _0x5a2e4c;};'use strict';var _=require(_0x430f('0x0'));var util=require(_0x430f('0x1'));var logger=require(_0x430f('0x2'))(_0x430f('0x3'));var moment=require(_0x430f('0x4'));var BPromise=require('bluebird');var rp=require(_0x430f('0x5'));var fs=require('fs');var path=require(_0x430f('0x6'));var rimraf=require(_0x430f('0x7'));var config=require(_0x430f('0x8'));var attributes=require(_0x430f('0x9'));module[_0x430f('0xa')]=function(_0xbf132d,_0x53502b){return _0xbf132d['define'](_0x430f('0xb'),attributes,{'tableName':_0x430f('0xc'),'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 68af875..a802e29 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 _0xb918=['http','request','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x2ca2d0,_0x3ea8e4){var _0x521c23=function(_0x5b0731){while(--_0x5b0731){_0x2ca2d0['push'](_0x2ca2d0['shift']());}};_0x521c23(++_0x3ea8e4);}(_0xb918,0x1af));var _0x8b91=function(_0x4f3b27,_0xab58f){_0x4f3b27=_0x4f3b27-0x0;var _0x23193f=_0xb918[_0x4f3b27];return _0x23193f;};'use strict';var _=require(_0x8b91('0x0'));var util=require('util');var moment=require(_0x8b91('0x1'));var BPromise=require(_0x8b91('0x2'));var rs=require(_0x8b91('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b91('0x4'))['db'];var utils=require(_0x8b91('0x5'));var logger=require(_0x8b91('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8b91('0x7'));var client=jayson[_0x8b91('0x8')][_0x8b91('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x337f13,_0x345ee0,_0x32772f){return new BPromise(function(_0x523635,_0x4ebf5d){return client[_0x8b91('0xa')](_0x337f13,_0x32772f)[_0x8b91('0xb')](function(_0x46d263){logger[_0x8b91('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x345ee0,_0x8b91('0xd'));logger[_0x8b91('0xe')](_0x8b91('0xf'),_0x345ee0,_0x8b91('0xd'),JSON[_0x8b91('0x10')](_0x46d263));if(_0x46d263[_0x8b91('0x11')]){if(_0x46d263[_0x8b91('0x11')]['code']===0x1f4){logger[_0x8b91('0x11')](_0x8b91('0x12'),_0x345ee0,_0x46d263[_0x8b91('0x11')][_0x8b91('0x13')]);return _0x4ebf5d(_0x46d263['error'][_0x8b91('0x13')]);}logger[_0x8b91('0x11')](_0x8b91('0x12'),_0x345ee0,_0x46d263['error'][_0x8b91('0x13')]);return _0x523635(_0x46d263[_0x8b91('0x11')][_0x8b91('0x13')]);}else{logger['info'](_0x8b91('0x12'),_0x345ee0,_0x8b91('0xd'));_0x523635(_0x46d263[_0x8b91('0x14')][_0x8b91('0x13')]);}})[_0x8b91('0x15')](function(_0x1bda32){logger[_0x8b91('0x11')](_0x8b91('0x12'),_0x345ee0,_0x1bda32);_0x4ebf5d(_0x1bda32);});});} \ No newline at end of file +var _0x34f4=['code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','request\x20sent','stringify','error'];(function(_0x29ee24,_0x574dec){var _0x3d67a9=function(_0x2b9b5c){while(--_0x2b9b5c){_0x29ee24['push'](_0x29ee24['shift']());}};_0x3d67a9(++_0x574dec);}(_0x34f4,0x75));var _0x434f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x34f4[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require(_0x434f('0x0'));var moment=require(_0x434f('0x1'));var BPromise=require(_0x434f('0x2'));var rs=require(_0x434f('0x3'));var fs=require('fs');var Redis=require(_0x434f('0x4'));var db=require(_0x434f('0x5'))['db'];var utils=require(_0x434f('0x6'));var logger=require(_0x434f('0x7'))(_0x434f('0x8'));var config=require(_0x434f('0x9'));var jayson=require(_0x434f('0xa'));var client=jayson[_0x434f('0xb')][_0x434f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x49ec00,_0xebd241,_0x48327d){return new BPromise(function(_0x36c084,_0x4ee7f9){return client[_0x434f('0xd')](_0x49ec00,_0x48327d)[_0x434f('0xe')](function(_0x45b1f0){logger[_0x434f('0xf')](_0x434f('0x10'),_0xebd241,'request\x20sent');logger[_0x434f('0x11')]('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0xebd241,_0x434f('0x12'),JSON[_0x434f('0x13')](_0x45b1f0));if(_0x45b1f0[_0x434f('0x14')]){if(_0x45b1f0[_0x434f('0x14')][_0x434f('0x15')]===0x1f4){logger[_0x434f('0x14')](_0x434f('0x10'),_0xebd241,_0x45b1f0[_0x434f('0x14')][_0x434f('0x16')]);return _0x4ee7f9(_0x45b1f0[_0x434f('0x14')][_0x434f('0x16')]);}logger[_0x434f('0x14')](_0x434f('0x10'),_0xebd241,_0x45b1f0[_0x434f('0x14')][_0x434f('0x16')]);return _0x36c084(_0x45b1f0['error'][_0x434f('0x16')]);}else{logger[_0x434f('0xf')]('UserFaxQueue,\x20%s,\x20%s',_0xebd241,_0x434f('0x12'));_0x36c084(_0x45b1f0['result'][_0x434f('0x16')]);}})['catch'](function(_0x4c1b78){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0xebd241,_0x4c1b78);_0x4ee7f9(_0x4c1b78);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index f3fe403..87645f3 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3299a8,_0x2c3774){var _0x49a2c4=function(_0x50a54c){while(--_0x50a54c){_0x3299a8['push'](_0x3299a8['shift']());}};_0x49a2c4(++_0x2c3774);}(_0x70e0,0x17b));var _0x070e=function(_0x548ebe,_0x456281){_0x548ebe=_0x548ebe-0x0;var _0x290def=_0x70e0[_0x548ebe];return _0x290def;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x2902cc,_0x4d1d00){var _0x5f418f=function(_0x5e3846){while(--_0x5e3846){_0x2902cc['push'](_0x2902cc['shift']());}};_0x5f418f(++_0x4d1d00);}(_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/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index b0c6977..18d65aa 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 _0x808d=['sequelize','INTEGER'];(function(_0xdd1153,_0x374259){var _0x182c45=function(_0x5666f3){while(--_0x5666f3){_0xdd1153['push'](_0xdd1153['shift']());}};_0x182c45(++_0x374259);}(_0x808d,0x1c2));var _0xd808=function(_0x598b13,_0x53e8aa){_0x598b13=_0x598b13-0x0;var _0x13b3bb=_0x808d[_0x598b13];return _0x13b3bb;};'use strict';var Sequelize=require(_0xd808('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xd808('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7b5b=['INTEGER','exports'];(function(_0x37eb1f,_0x4792dd){var _0x2b675b=function(_0x1c2093){while(--_0x1c2093){_0x37eb1f['push'](_0x37eb1f['shift']());}};_0x2b675b(++_0x4792dd);}(_0x7b5b,0x127));var _0xb7b5=function(_0x34d545,_0x376905){_0x34d545=_0x34d545-0x0;var _0x58b9b8=_0x7b5b[_0x34d545];return _0x58b9b8;};'use strict';var Sequelize=require('sequelize');module[_0xb7b5('0x0')]={'penalty':{'type':Sequelize[_0xb7b5('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index fbe4475..19f3dc4 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 _0x3be3=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userMailQueue.attributes','exports','UserMailQueue','user_has_mail_queues','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3be3,0x192));var _0x33be=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0x3be3[_0x5ebc04];return _0x17845c;};'use strict';var _=require(_0x33be('0x0'));var util=require(_0x33be('0x1'));var logger=require(_0x33be('0x2'))(_0x33be('0x3'));var moment=require(_0x33be('0x4'));var BPromise=require(_0x33be('0x5'));var rp=require(_0x33be('0x6'));var fs=require('fs');var path=require(_0x33be('0x7'));var rimraf=require(_0x33be('0x8'));var config=require('../../config/environment');var attributes=require(_0x33be('0x9'));module[_0x33be('0xa')]=function(_0x4a9f45,_0x30c79a){return _0x4a9f45['define'](_0x33be('0xb'),attributes,{'tableName':_0x33be('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b0c=['UserMailQueue','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x0b0c,0x6d));var _0xc0b0=function(_0x1bb47b,_0x54e02e){_0x1bb47b=_0x1bb47b-0x0;var _0x566418=_0x0b0c[_0x1bb47b];return _0x566418;};'use strict';var _=require(_0xc0b0('0x0'));var util=require(_0xc0b0('0x1'));var logger=require(_0xc0b0('0x2'))(_0xc0b0('0x3'));var moment=require(_0xc0b0('0x4'));var BPromise=require(_0xc0b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0b0('0x6'));var rimraf=require(_0xc0b0('0x7'));var config=require(_0xc0b0('0x8'));var attributes=require(_0xc0b0('0x9'));module[_0xc0b0('0xa')]=function(_0x48a5d1,_0x517f78){return _0x48a5d1['define'](_0xc0b0('0xb'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index e4a0acf..a789d52 100644 --- a/server/api/userMailQueue/userMailQueue.rpc.js +++ b/server/api/userMailQueue/userMailQueue.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b84=['../../config/logger','rpc','http','then','info','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','UserMailQueue,\x20%s,\x20%s','message','lodash','util','randomstring','../../config/utils'];(function(_0xaede4a,_0x44f7d7){var _0x10e86d=function(_0x47ce67){while(--_0x47ce67){_0xaede4a['push'](_0xaede4a['shift']());}};_0x10e86d(++_0x44f7d7);}(_0x4b84,0x1cc));var _0x44b8=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x4b84[_0x3e531a];return _0x3c2574;};'use strict';var _=require(_0x44b8('0x0'));var util=require(_0x44b8('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x44b8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x44b8('0x3'));var logger=require(_0x44b8('0x4'))(_0x44b8('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x44b8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x54274b,_0x327f59,_0x5947f7){return new BPromise(function(_0x3e87c5,_0x5a2353){return client['request'](_0x54274b,_0x5947f7)[_0x44b8('0x7')](function(_0x42319d){logger[_0x44b8('0x8')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x44b8('0x9'));logger[_0x44b8('0xa')](_0x44b8('0xb'),_0x327f59,_0x44b8('0x9'),JSON[_0x44b8('0xc')](_0x42319d));if(_0x42319d[_0x44b8('0xd')]){if(_0x42319d[_0x44b8('0xd')]['code']===0x1f4){logger[_0x44b8('0xd')](_0x44b8('0xe'),_0x327f59,_0x42319d['error'][_0x44b8('0xf')]);return _0x5a2353(_0x42319d['error'][_0x44b8('0xf')]);}logger[_0x44b8('0xd')]('UserMailQueue,\x20%s,\x20%s',_0x327f59,_0x42319d[_0x44b8('0xd')]['message']);return _0x3e87c5(_0x42319d['error'][_0x44b8('0xf')]);}else{logger[_0x44b8('0x8')](_0x44b8('0xe'),_0x327f59,_0x44b8('0x9'));_0x3e87c5(_0x42319d['result']['message']);}})['catch'](function(_0x3fe9fb){logger['error'](_0x44b8('0xe'),_0x327f59,_0x3fe9fb);_0x5a2353(_0x3fe9fb);});});} \ No newline at end of file +var _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xb276ce,_0x39e5ae){var _0x1ec888=function(_0x397ac2){while(--_0x397ac2){_0xb276ce['push'](_0xb276ce['shift']());}};_0x1ec888(++_0x39e5ae);}(_0x34e8,0x12c));var _0x834e=function(_0x557d1f,_0x21f0fe){_0x557d1f=_0x557d1f-0x0;var _0x8de5b5=_0x34e8[_0x557d1f];return _0x8de5b5;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file diff --git a/server/api/userNotification/index.js b/server/api/userNotification/index.js index 726af6b..7a0c840 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 _0xc2ee=['isAuthenticated','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller'];(function(_0x1c66f1,_0x53c85c){var _0x682d89=function(_0x2e0036){while(--_0x2e0036){_0x1c66f1['push'](_0x1c66f1['shift']());}};_0x682d89(++_0x53c85c);}(_0xc2ee,0x196));var _0xec2e=function(_0x2b77ae,_0x49e8fb){_0x2b77ae=_0x2b77ae-0x0;var _0x5a3cc5=_0xc2ee[_0x2b77ae];return _0x5a3cc5;};'use strict';var multer=require(_0xec2e('0x0'));var util=require(_0xec2e('0x1'));var path=require(_0xec2e('0x2'));var timeout=require(_0xec2e('0x3'));var express=require(_0xec2e('0x4'));var router=express[_0xec2e('0x5')]();var fs_extra=require(_0xec2e('0x6'));var auth=require(_0xec2e('0x7'));var interaction=require(_0xec2e('0x8'));var config=require('../../config/environment');var controller=require(_0xec2e('0x9'));router['post']('/',auth[_0xec2e('0xa')](),controller[_0xec2e('0xb')]);module[_0xec2e('0xc')]=router; \ No newline at end of file +var _0xe69a=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./userNotification.controller','post','isAuthenticated','exports'];(function(_0x43a42e,_0x46cd2f){var _0x27c036=function(_0x5adf94){while(--_0x5adf94){_0x43a42e['push'](_0x43a42e['shift']());}};_0x27c036(++_0x46cd2f);}(_0xe69a,0x1b8));var _0xae69=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0xe69a[_0x279d37];return _0x530173;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xae69('0x0'));var timeout=require(_0xae69('0x1'));var express=require('express');var router=express[_0xae69('0x2')]();var fs_extra=require(_0xae69('0x3'));var auth=require(_0xae69('0x4'));var interaction=require(_0xae69('0x5'));var config=require('../../config/environment');var controller=require(_0xae69('0x6'));router[_0xae69('0x7')]('/',auth[_0xae69('0x8')](),controller['sendUserNotification']);module[_0xae69('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index d8c6c75..66d557d 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 _0x5f18=['BOOLEAN','TEXT','STRING'];(function(_0xa42398,_0x404222){var _0x1badd7=function(_0x1dd771){while(--_0x1dd771){_0xa42398['push'](_0xa42398['shift']());}};_0x1badd7(++_0x404222);}(_0x5f18,0x14e));var _0x85f1=function(_0x41adfe,_0x2b52c0){_0x41adfe=_0x41adfe-0x0;var _0x37af8f=_0x5f18[_0x41adfe];return _0x37af8f;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0x85f1('0x0')]},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x85f1('0x1')]},'beep':{'type':Sequelize[_0x85f1('0x2')]}}; \ No newline at end of file +var _0x6557=['STRING','BOOLEAN','sequelize','TEXT'];(function(_0x466f2e,_0x5e2a7f){var _0x22dfbb=function(_0x308bbf){while(--_0x308bbf){_0x466f2e['push'](_0x466f2e['shift']());}};_0x22dfbb(++_0x5e2a7f);}(_0x6557,0x8e));var _0x7655=function(_0x5f099b,_0x806d19){_0x5f099b=_0x5f099b-0x0;var _0x29a3f1=_0x6557[_0x5f099b];return _0x29a3f1;};'use strict';var Sequelize=require(_0x7655('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']},'senderName':{'type':Sequelize['STRING']},'recipientsId':{'type':Sequelize[_0x7655('0x1')]},'recipientsDescription':{'type':Sequelize[_0x7655('0x2')]},'beep':{'type':Sequelize[_0x7655('0x3')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index e0b0dd0..87d558b 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 _0xc3ea=['save','update','then','destroy','sendStatus','name','send','sendUserNotification','body','text','hasOwnProperty','TemplateId','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','view','Sequelize','recipients','Missing\x20\x27recipients\x27\x20parameter','parse','error','chatqueue','mailqueue','whatsappqueue','team','user','some','includes','senderName','fullname','recipientsDescription','isEmpty','beep','SenderId','recipientsId','sortBy','sequelize','transaction','UserNotification','create','forEach','recipient','emit','catch','findOne','html','render','model','toLowerCase','User','union','ids','Queue','push','all','flatten','getAgents','map','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','status','end','json','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x2b1063,_0xbeecf6){var _0x2b79cb=function(_0x3c069e){while(--_0x3c069e){_0x2b1063['push'](_0x2b1063['shift']());}};_0x2b79cb(++_0xbeecf6);}(_0xc3ea,0x99));var _0xac3e=function(_0x4e0eb6,_0x240784){_0x4e0eb6=_0x4e0eb6-0x0;var _0x46e432=_0xc3ea[_0x4e0eb6];return _0x46e432;};'use strict';var emlformat=require(_0xac3e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xac3e('0x1'));var jsonpatch=require(_0xac3e('0x2'));var rp=require(_0xac3e('0x3'));var moment=require('moment');var BPromise=require(_0xac3e('0x4'));var Mustache=require(_0xac3e('0x5'));var util=require(_0xac3e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xac3e('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xac3e('0x8'));var _=require(_0xac3e('0x9'));var squel=require(_0xac3e('0xa'));var crypto=require('crypto');var jsforce=require(_0xac3e('0xb'));var deskjs=require(_0xac3e('0xc'));var toCsv=require('to-csv');var querystring=require(_0xac3e('0xd'));var Papa=require('papaparse');var Redis=require(_0xac3e('0xe'));var authService=require(_0xac3e('0xf'));var qs=require(_0xac3e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xac3e('0x11'));var logger=require(_0xac3e('0x12'))(_0xac3e('0x13'));var utils=require('../../config/utils');var config=require(_0xac3e('0x14'));var licenseUtil=require(_0xac3e('0x15'));var db=require(_0xac3e('0x16'))['db'];config[_0xac3e('0x17')]=_[_0xac3e('0x18')](config['redis'],{'host':_0xac3e('0x19'),'port':0x18eb});var socket=require(_0xac3e('0x1a'))(new Redis(config[_0xac3e('0x17')]));require(_0xac3e('0x1b'))[_0xac3e('0x1c')](socket);function respondWithStatusCode(_0x10faa3,_0x35cba1){_0x35cba1=_0x35cba1||0xcc;return function(_0x352cbf){if(_0x352cbf){return _0x10faa3['sendStatus'](_0x35cba1);}return _0x10faa3[_0xac3e('0x1d')](_0x35cba1)[_0xac3e('0x1e')]();};}function respondWithResult(_0x3a6d0a,_0x38f6fd){_0x38f6fd=_0x38f6fd||0xc8;return function(_0x3220b7){if(_0x3220b7){return _0x3a6d0a[_0xac3e('0x1d')](_0x38f6fd)[_0xac3e('0x1f')](_0x3220b7);}};}function respondWithFilteredResult(_0x2da10f,_0x56413a){return function(_0x20ab59){if(_0x20ab59){var _0x26de14=typeof _0x56413a[_0xac3e('0x20')]===_0xac3e('0x21')&&typeof _0x56413a[_0xac3e('0x22')]===_0xac3e('0x21');var _0x25f62d=_0x20ab59[_0xac3e('0x23')];var _0x30f6c2=_0x26de14?0x0:_0x56413a[_0xac3e('0x20')];var _0x26d45e=_0x26de14?_0x20ab59[_0xac3e('0x23')]:_0x56413a[_0xac3e('0x20')]+_0x56413a[_0xac3e('0x22')];var _0x5e423c;if(_0x26d45e>=_0x25f62d){_0x26d45e=_0x25f62d;_0x5e423c=0xc8;}else{_0x5e423c=0xce;}_0x2da10f[_0xac3e('0x1d')](_0x5e423c);return _0x2da10f[_0xac3e('0x24')](_0xac3e('0x25'),_0x30f6c2+'-'+_0x26d45e+'/'+_0x25f62d)[_0xac3e('0x1f')](_0x20ab59);}return null;};}function patchUpdates(_0x3c928d){return function(_0x4a841d){try{jsonpatch[_0xac3e('0x26')](_0x4a841d,_0x3c928d,!![]);}catch(_0x17ee70){return BPromise['reject'](_0x17ee70);}return _0x4a841d[_0xac3e('0x27')]();};}function saveUpdates(_0x29557f,_0x3ac8c6){return function(_0x20c5c5){if(_0x20c5c5){return _0x20c5c5[_0xac3e('0x28')](_0x29557f)[_0xac3e('0x29')](function(_0x26a8c5){return _0x26a8c5;});}return null;};}function removeEntity(_0x2d57e4,_0x970a2b){return function(_0x2e22da){if(_0x2e22da){return _0x2e22da[_0xac3e('0x2a')]()[_0xac3e('0x29')](function(){_0x2d57e4['status'](0xcc)[_0xac3e('0x1e')]();});}};}function handleEntityNotFound(_0x3bb3f2,_0x52383d){return function(_0x3f6cea){if(!_0x3f6cea){_0x3bb3f2[_0xac3e('0x2b')](0x194);}return _0x3f6cea;};}function handleError(_0x560cd2,_0x5eba9e){_0x5eba9e=_0x5eba9e||0x1f4;return function(_0x364b04){logger['error'](_0x364b04['stack']);if(_0x364b04[_0xac3e('0x2c')]){delete _0x364b04[_0xac3e('0x2c')];}_0x560cd2[_0xac3e('0x1d')](_0x5eba9e)[_0xac3e('0x2d')](_0x364b04);};}exports[_0xac3e('0x2e')]=function(_0x5d97c7,_0x467f1a,_0xb3a72c){if(!_0x5d97c7[_0xac3e('0x2f')]['hasOwnProperty'](_0xac3e('0x30'))&&!_0x5d97c7['body'][_0xac3e('0x31')](_0xac3e('0x32'))){throw new db['Sequelize'][(_0xac3e('0x33'))](_0xac3e('0x34'));}else{if(_0x5d97c7[_0xac3e('0x2f')]['hasOwnProperty']('TemplateId')&&!_0x5d97c7['body'][_0xac3e('0x31')](_0xac3e('0x35'))){throw new db[(_0xac3e('0x36'))][(_0xac3e('0x33'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x5d97c7[_0xac3e('0x2f')][_0xac3e('0x31')](_0xac3e('0x37'))){throw new db[(_0xac3e('0x36'))][(_0xac3e('0x33'))](_0xac3e('0x38'));}else{try{var _0x2bb9b0=JSON[_0xac3e('0x39')](_0x5d97c7[_0xac3e('0x2f')][_0xac3e('0x37')]);}catch(_0x20b6e0){logger[_0xac3e('0x3a')](_0x20b6e0);throw new db['Sequelize']['ValidationError']('Invalid\x20\x27recipients\x27\x20object');}var _0xfabca2=[_0xac3e('0x3b'),'faxqueue',_0xac3e('0x3c'),'openchannelqueue','smsqueue','voicequeue',_0xac3e('0x3d'),_0xac3e('0x3e'),_0xac3e('0x3f')];if(_[_0xac3e('0x40')](_0x2bb9b0,function(_0x14c057){return!_[_0xac3e('0x41')](_0xfabca2,_0x14c057['model']['toLowerCase']());})){throw new db['Sequelize'][(_0xac3e('0x33'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x17d073={};_0x17d073[_0xac3e('0x42')]=_0x5d97c7[_0xac3e('0x2f')]['hasOwnProperty'](_0xac3e('0x42'))?_0x5d97c7[_0xac3e('0x2f')]['senderName']:_0x5d97c7[_0xac3e('0x3f')][_0xac3e('0x43')];_0x17d073[_0xac3e('0x44')]=_[_0xac3e('0x45')](_0x5d97c7[_0xac3e('0x2f')][_0xac3e('0x44')])?null:_0x5d97c7[_0xac3e('0x2f')][_0xac3e('0x44')];_0x17d073[_0xac3e('0x46')]=_0x5d97c7[_0xac3e('0x2f')]['beep']||![];_0x17d073[_0xac3e('0x47')]=_0x5d97c7[_0xac3e('0x3f')]['id'];return getContent(_0x5d97c7[_0xac3e('0x2f')])[_0xac3e('0x29')](function(_0x4f601b){_0x17d073[_0xac3e('0x2f')]=_0x4f601b;return getRecipients(_0x2bb9b0);})[_0xac3e('0x29')](function(_0x25ffba){_0x17d073[_0xac3e('0x48')]=_[_0xac3e('0x49')](_0x25ffba)['join'](',');return db[_0xac3e('0x4a')][_0xac3e('0x4b')](function(_0x167a8f){return db[_0xac3e('0x4c')][_0xac3e('0x4d')](_0x17d073,{'raw':!![],'transaction':_0x167a8f})[_0xac3e('0x29')](function(_0x122d15){var _0x151b52={'sender':_0x17d073[_0xac3e('0x42')],'description':_0x17d073[_0xac3e('0x44')],'content':_0x17d073[_0xac3e('0x2f')],'beep':_0x17d073[_0xac3e('0x46')]};_0x25ffba[_0xac3e('0x4e')](function(_0x1bcea0){_0x151b52[_0xac3e('0x4f')]=_0x1bcea0;socket[_0xac3e('0x50')]('userNotification:send',_0x151b52);});return _0x122d15;});});})[_0xac3e('0x29')](respondWithResult(_0x467f1a,0xc9))[_0xac3e('0x51')](handleError(_0x467f1a,null));};function getContent(_0x26bb5a){return new BPromise(function(_0x2d6f49,_0x588388){if(_0x26bb5a[_0xac3e('0x30')]){_0x2d6f49(_0x26bb5a['text']);return;}return db['Template'][_0xac3e('0x52')]({'attributes':[_0xac3e('0x53')],'where':{'id':_0x26bb5a[_0xac3e('0x32')]},'raw':!![]})[_0xac3e('0x29')](function(_0x3e263d){if(!_0x3e263d)throw new db[(_0xac3e('0x36'))][(_0xac3e('0x33'))]('Invalid\x20\x27TemplateId\x27\x20parameter');var _0x361e62=Mustache[_0xac3e('0x54')](_0x3e263d['html'],_0x26bb5a['view']);_0x2d6f49(_0x361e62);})[_0xac3e('0x51')](function(_0x4c4515){_0x588388(_0x4c4515);});});}function getRecipients(_0x2d9701){return new BPromise(function(_0x575cb5,_0x335a28){var _0x295788=[];var _0x1de2c0=[];_0x2d9701[_0xac3e('0x4e')](function(_0x529aee){var _0x2f762d=_['startCase'](_0x529aee[_0xac3e('0x55')][_0xac3e('0x56')]());if(_0x2f762d===_0xac3e('0x57')){_0x295788=_[_0xac3e('0x58')](_0x295788,_0x529aee[_0xac3e('0x59')]);}else{if(_['includes'](_0x2f762d,'queue'))_0x2f762d=_0x2f762d['replace']('queue',_0xac3e('0x5a'));_0x529aee[_0xac3e('0x59')][_0xac3e('0x4e')](function(_0x393b9a){_0x1de2c0[_0xac3e('0x5b')](getAgents(_0x2f762d,_0x393b9a));});}});return BPromise[_0xac3e('0x5c')](_0x1de2c0)['then'](function(_0x34dc9d){_0x295788=_['union'](_0x295788,_[_0xac3e('0x5d')](_0x34dc9d));_0x575cb5(_0x295788);})[_0xac3e('0x51')](function(_0x335de8){_0x335a28(_0x335de8);});});}function getAgents(_0x65b3a0,_0x51ec41){return new BPromise(function(_0x2b77ee,_0x433f20){return db[_0x65b3a0][_0xac3e('0x52')]({'where':{'id':_0x51ec41}})[_0xac3e('0x29')](function(_0x12020c){return _0x12020c[_0xac3e('0x5e')]({'attributes':['id'],'raw':!![]})[_0xac3e('0x29')](function(_0x34f5e2){var _0x2574cc=_[_0xac3e('0x5f')](_0x34f5e2,'id');_0x2b77ee(_0x2574cc);});})[_0xac3e('0x51')](function(_0x2a39c4){_0x433f20(_0x2a39c4);});});} \ No newline at end of file +var _0x8d49=['recipientsId','sortBy','join','sequelize','UserNotification','create','forEach','emit','userNotification:send','catch','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','queue','replace','ids','push','flatten','getAgents','map','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','update','then','destroy','error','stack','name','send','sendUserNotification','body','hasOwnProperty','text','Sequelize','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','mailqueue','openchannelqueue','voicequeue','team','includes','model','toLowerCase','senderName','user','fullname','recipientsDescription','isEmpty','beep','SenderId'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x8d49,0x138));var _0x98d4=function(_0xf07e0a,_0x35d370){_0xf07e0a=_0xf07e0a-0x0;var _0x391cf5=_0x8d49[_0xf07e0a];return _0x391cf5;};'use strict';var emlformat=require(_0x98d4('0x0'));var rimraf=require(_0x98d4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x98d4('0x2'));var moment=require('moment');var BPromise=require(_0x98d4('0x3'));var Mustache=require('mustache');var util=require(_0x98d4('0x4'));var path=require(_0x98d4('0x5'));var sox=require(_0x98d4('0x6'));var csv=require(_0x98d4('0x7'));var ejs=require(_0x98d4('0x8'));var fs=require('fs');var fs_extra=require(_0x98d4('0x9'));var _=require(_0x98d4('0xa'));var squel=require(_0x98d4('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98d4('0x7'));var querystring=require('querystring');var Papa=require(_0x98d4('0xc'));var Redis=require(_0x98d4('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x98d4('0xe'));var hardwareService=require(_0x98d4('0xf'));var logger=require('../../config/logger')(_0x98d4('0x10'));var utils=require(_0x98d4('0x11'));var config=require(_0x98d4('0x12'));var licenseUtil=require(_0x98d4('0x13'));var db=require(_0x98d4('0x14'))['db'];config[_0x98d4('0x15')]=_[_0x98d4('0x16')](config[_0x98d4('0x15')],{'host':_0x98d4('0x17'),'port':0x18eb});var socket=require(_0x98d4('0x18'))(new Redis(config['redis']));require(_0x98d4('0x19'))[_0x98d4('0x1a')](socket);function respondWithStatusCode(_0x66a522,_0x2774a9){_0x2774a9=_0x2774a9||0xcc;return function(_0x491d80){if(_0x491d80){return _0x66a522[_0x98d4('0x1b')](_0x2774a9);}return _0x66a522[_0x98d4('0x1c')](_0x2774a9)[_0x98d4('0x1d')]();};}function respondWithResult(_0x43860d,_0x4c7a52){_0x4c7a52=_0x4c7a52||0xc8;return function(_0x5ea699){if(_0x5ea699){return _0x43860d[_0x98d4('0x1c')](_0x4c7a52)[_0x98d4('0x1e')](_0x5ea699);}};}function respondWithFilteredResult(_0x740291,_0x7ae217){return function(_0xa5f9d7){if(_0xa5f9d7){var _0x507d46=typeof _0x7ae217[_0x98d4('0x1f')]==='undefined'&&typeof _0x7ae217['limit']===_0x98d4('0x20');var _0x5bc5bf=_0xa5f9d7[_0x98d4('0x21')];var _0x1f330b=_0x507d46?0x0:_0x7ae217[_0x98d4('0x1f')];var _0x16adf2=_0x507d46?_0xa5f9d7['count']:_0x7ae217[_0x98d4('0x1f')]+_0x7ae217[_0x98d4('0x22')];var _0x1dc979;if(_0x16adf2>=_0x5bc5bf){_0x16adf2=_0x5bc5bf;_0x1dc979=0xc8;}else{_0x1dc979=0xce;}_0x740291['status'](_0x1dc979);return _0x740291['set']('Content-Range',_0x1f330b+'-'+_0x16adf2+'/'+_0x5bc5bf)[_0x98d4('0x1e')](_0xa5f9d7);}return null;};}function patchUpdates(_0xbae0ff){return function(_0x5873f7){try{jsonpatch[_0x98d4('0x23')](_0x5873f7,_0xbae0ff,!![]);}catch(_0x3028d0){return BPromise[_0x98d4('0x24')](_0x3028d0);}return _0x5873f7['save']();};}function saveUpdates(_0x32a9fd,_0x1b1642){return function(_0x89dc1a){if(_0x89dc1a){return _0x89dc1a[_0x98d4('0x25')](_0x32a9fd)[_0x98d4('0x26')](function(_0x35f6eb){return _0x35f6eb;});}return null;};}function removeEntity(_0x14da62,_0x5ac79c){return function(_0x3de4b1){if(_0x3de4b1){return _0x3de4b1[_0x98d4('0x27')]()[_0x98d4('0x26')](function(){_0x14da62['status'](0xcc)[_0x98d4('0x1d')]();});}};}function handleEntityNotFound(_0x123044,_0x59f6b4){return function(_0x4533ec){if(!_0x4533ec){_0x123044[_0x98d4('0x1b')](0x194);}return _0x4533ec;};}function handleError(_0x5c9a70,_0x1753fd){_0x1753fd=_0x1753fd||0x1f4;return function(_0x2005c9){logger[_0x98d4('0x28')](_0x2005c9[_0x98d4('0x29')]);if(_0x2005c9[_0x98d4('0x2a')]){delete _0x2005c9[_0x98d4('0x2a')];}_0x5c9a70[_0x98d4('0x1c')](_0x1753fd)[_0x98d4('0x2b')](_0x2005c9);};}exports[_0x98d4('0x2c')]=function(_0xeda977,_0xf313bd,_0x5421e7){if(!_0xeda977[_0x98d4('0x2d')][_0x98d4('0x2e')](_0x98d4('0x2f'))&&!_0xeda977[_0x98d4('0x2d')][_0x98d4('0x2e')]('TemplateId')){throw new db[(_0x98d4('0x30'))][(_0x98d4('0x31'))](_0x98d4('0x32'));}else{if(_0xeda977[_0x98d4('0x2d')][_0x98d4('0x2e')](_0x98d4('0x33'))&&!_0xeda977[_0x98d4('0x2d')][_0x98d4('0x2e')](_0x98d4('0x34'))){throw new db[(_0x98d4('0x30'))][(_0x98d4('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0xeda977[_0x98d4('0x2d')]['hasOwnProperty'](_0x98d4('0x35'))){throw new db['Sequelize'][(_0x98d4('0x31'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x41725d=JSON[_0x98d4('0x36')](_0xeda977[_0x98d4('0x2d')][_0x98d4('0x35')]);}catch(_0x2f2b78){logger['error'](_0x2f2b78);throw new db[(_0x98d4('0x30'))][(_0x98d4('0x31'))](_0x98d4('0x37'));}var _0x5f2c81=[_0x98d4('0x38'),_0x98d4('0x39'),_0x98d4('0x3a'),_0x98d4('0x3b'),'smsqueue',_0x98d4('0x3c'),'whatsappqueue',_0x98d4('0x3d'),'user'];if(_['some'](_0x41725d,function(_0x57c78d){return!_[_0x98d4('0x3e')](_0x5f2c81,_0x57c78d[_0x98d4('0x3f')][_0x98d4('0x40')]());})){throw new db[(_0x98d4('0x30'))][(_0x98d4('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x25b175={};_0x25b175[_0x98d4('0x41')]=_0xeda977[_0x98d4('0x2d')][_0x98d4('0x2e')](_0x98d4('0x41'))?_0xeda977[_0x98d4('0x2d')]['senderName']:_0xeda977[_0x98d4('0x42')][_0x98d4('0x43')];_0x25b175[_0x98d4('0x44')]=_[_0x98d4('0x45')](_0xeda977[_0x98d4('0x2d')][_0x98d4('0x44')])?null:_0xeda977['body'][_0x98d4('0x44')];_0x25b175[_0x98d4('0x46')]=_0xeda977[_0x98d4('0x2d')][_0x98d4('0x46')]||![];_0x25b175[_0x98d4('0x47')]=_0xeda977[_0x98d4('0x42')]['id'];return getContent(_0xeda977['body'])['then'](function(_0x52c4e5){_0x25b175[_0x98d4('0x2d')]=_0x52c4e5;return getRecipients(_0x41725d);})[_0x98d4('0x26')](function(_0x1bcfd4){_0x25b175[_0x98d4('0x48')]=_[_0x98d4('0x49')](_0x1bcfd4)[_0x98d4('0x4a')](',');return db[_0x98d4('0x4b')]['transaction'](function(_0x349f2c){return db[_0x98d4('0x4c')][_0x98d4('0x4d')](_0x25b175,{'raw':!![],'transaction':_0x349f2c})[_0x98d4('0x26')](function(_0x3afbc3){var _0x3eb0ee={'sender':_0x25b175['senderName'],'description':_0x25b175['recipientsDescription'],'content':_0x25b175[_0x98d4('0x2d')],'beep':_0x25b175[_0x98d4('0x46')]};_0x1bcfd4[_0x98d4('0x4e')](function(_0x594648){_0x3eb0ee['recipient']=_0x594648;socket[_0x98d4('0x4f')](_0x98d4('0x50'),_0x3eb0ee);});return _0x3afbc3;});});})['then'](respondWithResult(_0xf313bd,0xc9))[_0x98d4('0x51')](handleError(_0xf313bd,null));};function getContent(_0x2d100d){return new BPromise(function(_0x37d5c3,_0x43502e){if(_0x2d100d[_0x98d4('0x2f')]){_0x37d5c3(_0x2d100d[_0x98d4('0x2f')]);return;}return db['Template'][_0x98d4('0x52')]({'attributes':['html'],'where':{'id':_0x2d100d[_0x98d4('0x33')]},'raw':!![]})[_0x98d4('0x26')](function(_0x568e12){if(!_0x568e12)throw new db[(_0x98d4('0x30'))][(_0x98d4('0x31'))](_0x98d4('0x53'));var _0x8d4a0a=Mustache[_0x98d4('0x54')](_0x568e12[_0x98d4('0x55')],_0x2d100d['view']);_0x37d5c3(_0x8d4a0a);})[_0x98d4('0x51')](function(_0x233348){_0x43502e(_0x233348);});});}function getRecipients(_0x266840){return new BPromise(function(_0xc2523b,_0x32f5bc){var _0x300a1c=[];var _0x4529f3=[];_0x266840[_0x98d4('0x4e')](function(_0x26c4a4){var _0xd62162=_[_0x98d4('0x56')](_0x26c4a4[_0x98d4('0x3f')][_0x98d4('0x40')]());if(_0xd62162===_0x98d4('0x57')){_0x300a1c=_[_0x98d4('0x58')](_0x300a1c,_0x26c4a4['ids']);}else{if(_[_0x98d4('0x3e')](_0xd62162,_0x98d4('0x59')))_0xd62162=_0xd62162[_0x98d4('0x5a')](_0x98d4('0x59'),'Queue');_0x26c4a4[_0x98d4('0x5b')][_0x98d4('0x4e')](function(_0x396495){_0x4529f3[_0x98d4('0x5c')](getAgents(_0xd62162,_0x396495));});}});return BPromise['all'](_0x4529f3)[_0x98d4('0x26')](function(_0x3240a1){_0x300a1c=_[_0x98d4('0x58')](_0x300a1c,_[_0x98d4('0x5d')](_0x3240a1));_0xc2523b(_0x300a1c);})['catch'](function(_0x4ec4e5){_0x32f5bc(_0x4ec4e5);});});}function getAgents(_0x326e1d,_0x3dea20){return new BPromise(function(_0x4d579e,_0x296c3f){return db[_0x326e1d][_0x98d4('0x52')]({'where':{'id':_0x3dea20}})[_0x98d4('0x26')](function(_0x267338){return _0x267338[_0x98d4('0x5e')]({'attributes':['id'],'raw':!![]})[_0x98d4('0x26')](function(_0x45da16){var _0x233629=_[_0x98d4('0x5f')](_0x45da16,'id');_0x4d579e(_0x233629);});})['catch'](function(_0xb8418b){_0x296c3f(_0xb8418b);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index b4df688..b2123a6 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 _0x6031=['save','update','remove','emit','hasOwnProperty','hook','exports','events','UserNotification','setMaxListeners'];(function(_0x17f982,_0x5675aa){var _0x4314b2=function(_0x132495){while(--_0x132495){_0x17f982['push'](_0x17f982['shift']());}};_0x4314b2(++_0x5675aa);}(_0x6031,0x151));var _0x1603=function(_0x4fbff6,_0x3680e2){_0x4fbff6=_0x4fbff6-0x0;var _0x1ff250=_0x6031[_0x4fbff6];return _0x1ff250;};'use strict';var EventEmitter=require(_0x1603('0x0'));var UserNotification=require('../../mysqldb')['db'][_0x1603('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0x1603('0x2')](0x0);var events={'afterCreate':_0x1603('0x3'),'afterUpdate':_0x1603('0x4'),'afterDestroy':_0x1603('0x5')};function emitEvent(_0x45d0bf){return function(_0x58000c,_0x29796d,_0x29c332){UserNotificationEvents[_0x1603('0x6')](_0x45d0bf+':'+_0x58000c['id'],_0x58000c);UserNotificationEvents[_0x1603('0x6')](_0x45d0bf,_0x58000c);_0x29c332(null);};}for(var e in events){if(events[_0x1603('0x7')](e)){var event=events[e];UserNotification[_0x1603('0x8')](e,emitEvent(event));}}module[_0x1603('0x9')]=UserNotificationEvents; \ No newline at end of file +var _0xc67d=['emit','exports','events','UserNotification','setMaxListeners','save'];(function(_0x130f99,_0x4a31d8){var _0x4f4785=function(_0x3e7271){while(--_0x3e7271){_0x130f99['push'](_0x130f99['shift']());}};_0x4f4785(++_0x4a31d8);}(_0xc67d,0x1dc));var _0xdc67=function(_0x130c42,_0x59a602){_0x130c42=_0x130c42-0x0;var _0x52f5ba=_0xc67d[_0x130c42];return _0x52f5ba;};'use strict';var EventEmitter=require(_0xdc67('0x0'));var UserNotification=require('../../mysqldb')['db'][_0xdc67('0x1')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents[_0xdc67('0x2')](0x0);var events={'afterCreate':_0xdc67('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x143fbc){return function(_0x201aa1,_0x551b0b,_0x2007b3){UserNotificationEvents[_0xdc67('0x4')](_0x143fbc+':'+_0x201aa1['id'],_0x201aa1);UserNotificationEvents[_0xdc67('0x4')](_0x143fbc,_0x201aa1);_0x2007b3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserNotification['hook'](e,emitEvent(event));}}module[_0xdc67('0x5')]=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index d2c4308..351c504 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 _0xdc25=['../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x4ab534,_0x1748bc){var _0x38f986=function(_0x142275){while(--_0x142275){_0x4ab534['push'](_0x4ab534['shift']());}};_0x38f986(++_0x1748bc);}(_0xdc25,0x128));var _0x5dc2=function(_0x406619,_0x263bc6){_0x406619=_0x406619-0x0;var _0x13df9b=_0xdc25[_0x406619];return _0x13df9b;};'use strict';var _=require(_0x5dc2('0x0'));var util=require(_0x5dc2('0x1'));var logger=require(_0x5dc2('0x2'))(_0x5dc2('0x3'));var moment=require('moment');var BPromise=require(_0x5dc2('0x4'));var rp=require(_0x5dc2('0x5'));var fs=require('fs');var path=require(_0x5dc2('0x6'));var rimraf=require(_0x5dc2('0x7'));var config=require(_0x5dc2('0x8'));var attributes=require(_0x5dc2('0x9'));module[_0x5dc2('0xa')]=function(_0x31da5f,_0x13c1fd){return _0x31da5f[_0x5dc2('0xb')](_0x5dc2('0xc'),attributes,{'tableName':_0x5dc2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5dc2('0xe'),'collate':_0x5dc2('0xf')});}; \ No newline at end of file +var _0xe873=['rimraf','../../config/environment','./userNotification.attributes','define','UserNotification','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x23a672,_0x479807){var _0x5035aa=function(_0x2f8a44){while(--_0x2f8a44){_0x23a672['push'](_0x23a672['shift']());}};_0x5035aa(++_0x479807);}(_0xe873,0xae));var _0x3e87=function(_0x2d0b1f,_0x5c8f62){_0x2d0b1f=_0x2d0b1f-0x0;var _0x244cb5=_0xe873[_0x2d0b1f];return _0x244cb5;};'use strict';var _=require(_0x3e87('0x0'));var util=require(_0x3e87('0x1'));var logger=require(_0x3e87('0x2'))(_0x3e87('0x3'));var moment=require(_0x3e87('0x4'));var BPromise=require(_0x3e87('0x5'));var rp=require(_0x3e87('0x6'));var fs=require('fs');var path=require(_0x3e87('0x7'));var rimraf=require(_0x3e87('0x8'));var config=require(_0x3e87('0x9'));var attributes=require(_0x3e87('0xa'));module['exports']=function(_0x303e89,_0x56e5ea){return _0x303e89[_0x3e87('0xb')](_0x3e87('0xc'),attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3e87('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index 28d9c76..9cebcd3 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 _0x4239=['defaults','localhost','./userNotification.socket','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x3ecf65,_0x3bac13){var _0x1907df=function(_0x247dd9){while(--_0x247dd9){_0x3ecf65['push'](_0x3ecf65['shift']());}};_0x1907df(++_0x3bac13);}(_0x4239,0x196));var _0x9423=function(_0x18b344,_0x271f68){_0x18b344=_0x18b344-0x0;var _0x5ef6bb=_0x4239[_0x18b344];return _0x5ef6bb;};'use strict';var _=require(_0x9423('0x0'));var util=require(_0x9423('0x1'));var moment=require(_0x9423('0x2'));var BPromise=require('bluebird');var rs=require(_0x9423('0x3'));var fs=require('fs');var Redis=require(_0x9423('0x4'));var db=require(_0x9423('0x5'))['db'];var utils=require(_0x9423('0x6'));var logger=require(_0x9423('0x7'))(_0x9423('0x8'));var config=require(_0x9423('0x9'));var jayson=require(_0x9423('0xa'));var client=jayson[_0x9423('0xb')][_0x9423('0xc')]({'port':0x232a});config[_0x9423('0xd')]=_[_0x9423('0xe')](config[_0x9423('0xd')],{'host':_0x9423('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9423('0x10'))['register'](socket);function respondWithRpcPromise(_0x207f16,_0x789392,_0x493e02){return new BPromise(function(_0x49df36,_0x28bc84){return client[_0x9423('0x11')](_0x207f16,_0x493e02)[_0x9423('0x12')](function(_0x3ab883){logger[_0x9423('0x13')](_0x9423('0x14'),_0x789392,_0x9423('0x15'));logger[_0x9423('0x16')](_0x9423('0x17'),_0x789392,'request\x20sent',JSON[_0x9423('0x18')](_0x3ab883));if(_0x3ab883[_0x9423('0x19')]){if(_0x3ab883[_0x9423('0x19')][_0x9423('0x1a')]===0x1f4){logger[_0x9423('0x19')]('UserNotification,\x20%s,\x20%s',_0x789392,_0x3ab883['error'][_0x9423('0x1b')]);return _0x28bc84(_0x3ab883[_0x9423('0x19')][_0x9423('0x1b')]);}logger[_0x9423('0x19')]('UserNotification,\x20%s,\x20%s',_0x789392,_0x3ab883[_0x9423('0x19')][_0x9423('0x1b')]);return _0x49df36(_0x3ab883[_0x9423('0x19')][_0x9423('0x1b')]);}else{logger['info'](_0x9423('0x14'),_0x789392,'request\x20sent');_0x49df36(_0x3ab883[_0x9423('0x1c')][_0x9423('0x1b')]);}})[_0x9423('0x1d')](function(_0x45ab82){logger[_0x9423('0x19')](_0x9423('0x14'),_0x789392,_0x45ab82);_0x28bc84(_0x45ab82);});});} \ No newline at end of file +var _0x57d0=['message','result','catch','lodash','util','moment','bluebird','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','register','request','then','info','UserNotification,\x20%s,\x20%s','request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x48cb7c,_0x10dfd1){var _0x26721c=function(_0x1b1b3e){while(--_0x1b1b3e){_0x48cb7c['push'](_0x48cb7c['shift']());}};_0x26721c(++_0x10dfd1);}(_0x57d0,0x111));var _0x057d=function(_0x48168a,_0xf9dfe5){_0x48168a=_0x48168a-0x0;var _0x346d98=_0x57d0[_0x48168a];return _0x346d98;};'use strict';var _=require(_0x057d('0x0'));var util=require(_0x057d('0x1'));var moment=require(_0x057d('0x2'));var BPromise=require(_0x057d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x057d('0x4'))(_0x057d('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x057d('0x6')][_0x057d('0x7')]({'port':0x232a});config[_0x057d('0x8')]=_[_0x057d('0x9')](config[_0x057d('0x8')],{'host':_0x057d('0xa'),'port':0x18eb});var socket=require(_0x057d('0xb'))(new Redis(config[_0x057d('0x8')]));require(_0x057d('0xc'))[_0x057d('0xd')](socket);function respondWithRpcPromise(_0x409e27,_0x233c85,_0x43686b){return new BPromise(function(_0x19f5ce,_0x35206a){return client[_0x057d('0xe')](_0x409e27,_0x43686b)[_0x057d('0xf')](function(_0x2b75d2){logger[_0x057d('0x10')](_0x057d('0x11'),_0x233c85,_0x057d('0x12'));logger[_0x057d('0x13')](_0x057d('0x14'),_0x233c85,_0x057d('0x12'),JSON[_0x057d('0x15')](_0x2b75d2));if(_0x2b75d2[_0x057d('0x16')]){if(_0x2b75d2[_0x057d('0x16')][_0x057d('0x17')]===0x1f4){logger[_0x057d('0x16')](_0x057d('0x11'),_0x233c85,_0x2b75d2[_0x057d('0x16')][_0x057d('0x18')]);return _0x35206a(_0x2b75d2['error'][_0x057d('0x18')]);}logger['error']('UserNotification,\x20%s,\x20%s',_0x233c85,_0x2b75d2[_0x057d('0x16')][_0x057d('0x18')]);return _0x19f5ce(_0x2b75d2[_0x057d('0x16')][_0x057d('0x18')]);}else{logger['info']('UserNotification,\x20%s,\x20%s',_0x233c85,_0x057d('0x12'));_0x19f5ce(_0x2b75d2[_0x057d('0x19')][_0x057d('0x18')]);}})[_0x057d('0x1a')](function(_0x577a29){logger[_0x057d('0x16')]('UserNotification,\x20%s,\x20%s',_0x233c85,_0x577a29);_0x35206a(_0x577a29);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index b4849ed..24988b4 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 _0xdaab=['./userNotification.events','save','remove','update','emit','removeListener','length','userNotification:'];(function(_0x203103,_0xdc38d4){var _0x3ad35a=function(_0x8ae662){while(--_0x8ae662){_0x203103['push'](_0x203103['shift']());}};_0x3ad35a(++_0xdc38d4);}(_0xdaab,0xf8));var _0xbdaa=function(_0x13965d,_0x399bea){_0x13965d=_0x13965d-0x0;var _0x28e06f=_0xdaab[_0x13965d];return _0x28e06f;};'use strict';var UserNotificationEvents=require(_0xbdaa('0x0'));var events=[_0xbdaa('0x1'),_0xbdaa('0x2'),_0xbdaa('0x3')];function createListener(_0x25a443,_0x4db5b6){return function(_0x2c7840){_0x4db5b6[_0xbdaa('0x4')](_0x25a443,_0x2c7840);};}function removeListener(_0x2822f6,_0x4f142d){return function(){UserNotificationEvents[_0xbdaa('0x5')](_0x2822f6,_0x4f142d);};}exports['register']=function(_0x128b35){for(var _0x15a618=0x0,_0x32c342=events[_0xbdaa('0x6')];_0x15a618<_0x32c342;_0x15a618++){var _0x458129=events[_0x15a618];var _0x1b09d6=createListener(_0xbdaa('0x7')+_0x458129,_0x128b35);UserNotificationEvents['on'](_0x458129,_0x1b09d6);}}; \ No newline at end of file +var _0x3f8e=['emit','removeListener','register','length','userNotification:','./userNotification.events','save','update'];(function(_0x27cf57,_0x2f61cc){var _0x1032b=function(_0x2950a8){while(--_0x2950a8){_0x27cf57['push'](_0x27cf57['shift']());}};_0x1032b(++_0x2f61cc);}(_0x3f8e,0x85));var _0xe3f8=function(_0x404f2a,_0x17cc81){_0x404f2a=_0x404f2a-0x0;var _0x529aaf=_0x3f8e[_0x404f2a];return _0x529aaf;};'use strict';var UserNotificationEvents=require(_0xe3f8('0x0'));var events=[_0xe3f8('0x1'),'remove',_0xe3f8('0x2')];function createListener(_0x319549,_0x5e0cc7){return function(_0x1b3642){_0x5e0cc7[_0xe3f8('0x3')](_0x319549,_0x1b3642);};}function removeListener(_0x4d91b9,_0x1cd675){return function(){UserNotificationEvents[_0xe3f8('0x4')](_0x4d91b9,_0x1cd675);};}exports[_0xe3f8('0x5')]=function(_0x56f605){for(var _0x10aaa0=0x0,_0x4d8da7=events[_0xe3f8('0x6')];_0x10aaa0<_0x4d8da7;_0x10aaa0++){var _0x4937bb=events[_0x10aaa0];var _0x3f55ad=createListener(_0xe3f8('0x7')+_0x4937bb,_0x56f605);UserNotificationEvents['on'](_0x4937bb,_0x3f55ad);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 422f2c1..133d7be 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 _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x590120,_0x6bf68c){var _0x577b3b=function(_0x4788c6){while(--_0x4788c6){_0x590120['push'](_0x590120['shift']());}};_0x577b3b(++_0x6bf68c);}(_0xedd9,0xfc));var _0x9edd=function(_0x3ab21f,_0x1ffc45){_0x3ab21f=_0x3ab21f-0x0;var _0x342e38=_0xedd9[_0x3ab21f];return _0x342e38;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');module[_0x9edd('0x8')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x175620,_0x2c749d){var _0x1148f1=function(_0x356026){while(--_0x356026){_0x175620['push'](_0x175620['shift']());}};_0x1148f1(++_0x2c749d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4b6778,_0x505a76){_0x4b6778=_0x4b6778-0x0;var _0x22dbb9=_0xcb91[_0x4b6778];return _0x22dbb9;};'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/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 26851f6..dfea7aa 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 _0xcd9e=['exports','INTEGER','sequelize'];(function(_0x824c75,_0x55889c){var _0x423ee8=function(_0x4a2d98){while(--_0x4a2d98){_0x824c75['push'](_0x824c75['shift']());}};_0x423ee8(++_0x55889c);}(_0xcd9e,0x6e));var _0xecd9=function(_0x314d10,_0x32bb27){_0x314d10=_0x314d10-0x0;var _0x2e6dc8=_0xcd9e[_0x314d10];return _0x2e6dc8;};'use strict';var Sequelize=require(_0xecd9('0x0'));module[_0xecd9('0x1')]={'penalty':{'type':Sequelize[_0xecd9('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xcbf6=['sequelize','INTEGER'];(function(_0x3dcdb9,_0x37a99e){var _0x3d9e38=function(_0x36cac4){while(--_0x36cac4){_0x3dcdb9['push'](_0x3dcdb9['shift']());}};_0x3d9e38(++_0x37a99e);}(_0xcbf6,0xd8));var _0x6cbf=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xcbf6[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require(_0x6cbf('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x6cbf('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 4254c59..1ed2ef7 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 _0xdcfa=['../../config/logger','api','moment','bluebird','path','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util'];(function(_0x4c030e,_0x57ae03){var _0x3115c3=function(_0x1c2931){while(--_0x1c2931){_0x4c030e['push'](_0x4c030e['shift']());}};_0x3115c3(++_0x57ae03);}(_0xdcfa,0x142));var _0xadcf=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xdcfa[_0x836465];return _0x2150ea;};'use strict';var _=require(_0xadcf('0x0'));var util=require(_0xadcf('0x1'));var logger=require(_0xadcf('0x2'))(_0xadcf('0x3'));var moment=require(_0xadcf('0x4'));var BPromise=require(_0xadcf('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xadcf('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xadcf('0x7'));module[_0xadcf('0x8')]=function(_0x55807c,_0x34180b){return _0x55807c[_0xadcf('0x9')](_0xadcf('0xa'),attributes,{'tableName':_0xadcf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2e62=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x2e62,0x12c));var _0x22e6=function(_0x21c694,_0x118ea1){_0x21c694=_0x21c694-0x0;var _0x408a0f=_0x2e62[_0x21c694];return _0x408a0f;};'use strict';var _=require(_0x22e6('0x0'));var util=require(_0x22e6('0x1'));var logger=require(_0x22e6('0x2'))(_0x22e6('0x3'));var moment=require(_0x22e6('0x4'));var BPromise=require(_0x22e6('0x5'));var rp=require(_0x22e6('0x6'));var fs=require('fs');var path=require(_0x22e6('0x7'));var rimraf=require(_0x22e6('0x8'));var config=require(_0x22e6('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module[_0x22e6('0xa')]=function(_0x5c889b,_0x50181e){return _0x5c889b[_0x22e6('0xb')](_0x22e6('0xc'),attributes,{'tableName':_0x22e6('0xd'),'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 793ef21..47ae83c 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 _0x57c5=['stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x57c5,0x1a9));var _0x557c=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x57c5[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x557c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x557c('0x1'));var rs=require(_0x557c('0x2'));var fs=require('fs');var Redis=require(_0x557c('0x3'));var db=require(_0x557c('0x4'))['db'];var utils=require(_0x557c('0x5'));var logger=require('../../config/logger')(_0x557c('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x557c('0x7')][_0x557c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3cde7a,_0x6e9c6c,_0x3a9ccd){return new BPromise(function(_0x27cde9,_0x4e84ca){return client[_0x557c('0x9')](_0x3cde7a,_0x3a9ccd)[_0x557c('0xa')](function(_0xfd5ee9){logger[_0x557c('0xb')](_0x557c('0xc'),_0x6e9c6c,_0x557c('0xd'));logger[_0x557c('0xe')]('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x6e9c6c,_0x557c('0xd'),JSON[_0x557c('0xf')](_0xfd5ee9));if(_0xfd5ee9['error']){if(_0xfd5ee9[_0x557c('0x10')][_0x557c('0x11')]===0x1f4){logger[_0x557c('0x10')](_0x557c('0xc'),_0x6e9c6c,_0xfd5ee9[_0x557c('0x10')]['message']);return _0x4e84ca(_0xfd5ee9[_0x557c('0x10')]['message']);}logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x6e9c6c,_0xfd5ee9[_0x557c('0x10')][_0x557c('0x12')]);return _0x27cde9(_0xfd5ee9[_0x557c('0x10')][_0x557c('0x12')]);}else{logger[_0x557c('0xb')](_0x557c('0xc'),_0x6e9c6c,_0x557c('0xd'));_0x27cde9(_0xfd5ee9[_0x557c('0x13')][_0x557c('0x12')]);}})['catch'](function(_0x4afe29){logger[_0x557c('0x10')](_0x557c('0xc'),_0x6e9c6c,_0x4afe29);_0x4e84ca(_0x4afe29);});});} \ No newline at end of file +var _0xc1c8=['moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','http','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','util'];(function(_0xb5e222,_0x431ee4){var _0xb8501a=function(_0x60a936){while(--_0x60a936){_0xb5e222['push'](_0xb5e222['shift']());}};_0xb8501a(++_0x431ee4);}(_0xc1c8,0x1a7));var _0x8c1c=function(_0x27e581,_0x411df4){_0x27e581=_0x27e581-0x0;var _0x58db9d=_0xc1c8[_0x27e581];return _0x58db9d;};'use strict';var _=require(_0x8c1c('0x0'));var util=require(_0x8c1c('0x1'));var moment=require(_0x8c1c('0x2'));var BPromise=require(_0x8c1c('0x3'));var rs=require(_0x8c1c('0x4'));var fs=require('fs');var Redis=require(_0x8c1c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8c1c('0x6'));var logger=require('../../config/logger')(_0x8c1c('0x7'));var config=require('../../config/environment');var jayson=require(_0x8c1c('0x8'));var client=jayson['client'][_0x8c1c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x166c1f,_0x2fdb3a,_0x4a9384){return new BPromise(function(_0x595463,_0x8ad846){return client['request'](_0x166c1f,_0x4a9384)['then'](function(_0x5f8930){logger['info'](_0x8c1c('0xa'),_0x2fdb3a,_0x8c1c('0xb'));logger['debug'](_0x8c1c('0xc'),_0x2fdb3a,_0x8c1c('0xb'),JSON['stringify'](_0x5f8930));if(_0x5f8930[_0x8c1c('0xd')]){if(_0x5f8930['error'][_0x8c1c('0xe')]===0x1f4){logger[_0x8c1c('0xd')](_0x8c1c('0xa'),_0x2fdb3a,_0x5f8930['error'][_0x8c1c('0xf')]);return _0x8ad846(_0x5f8930[_0x8c1c('0xd')]['message']);}logger[_0x8c1c('0xd')](_0x8c1c('0xa'),_0x2fdb3a,_0x5f8930['error'][_0x8c1c('0xf')]);return _0x595463(_0x5f8930[_0x8c1c('0xd')]['message']);}else{logger[_0x8c1c('0x10')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fdb3a,_0x8c1c('0xb'));_0x595463(_0x5f8930['result'][_0x8c1c('0xf')]);}})['catch'](function(_0x1dcc37){logger['error']('UserOpenchannelQueue,\x20%s,\x20%s',_0x2fdb3a,_0x1dcc37);_0x8ad846(_0x1dcc37);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 7f468fb..193c919 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 _0xe3c5=['update','delete','/:id','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','show','/:id/sections','getSections','/:id/resources','post','/:id/clone','clone','addSections','addResources','put'];(function(_0x3d80be,_0x5a0749){var _0x33abd6=function(_0x1b28ed){while(--_0x1b28ed){_0x3d80be['push'](_0x3d80be['shift']());}};_0x33abd6(++_0x5a0749);}(_0xe3c5,0x17d));var _0x5e3c=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0xe3c5[_0x1c6ef2];return _0x404b8c;};'use strict';var multer=require(_0x5e3c('0x0'));var util=require(_0x5e3c('0x1'));var path=require(_0x5e3c('0x2'));var timeout=require(_0x5e3c('0x3'));var express=require(_0x5e3c('0x4'));var router=express[_0x5e3c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x5e3c('0x6'));var interaction=require(_0x5e3c('0x7'));var config=require(_0x5e3c('0x8'));var controller=require(_0x5e3c('0x9'));router[_0x5e3c('0xa')]('/',auth[_0x5e3c('0xb')](),controller[_0x5e3c('0xc')]);router[_0x5e3c('0xa')](_0x5e3c('0xd'),auth[_0x5e3c('0xb')](),controller[_0x5e3c('0xe')]);router[_0x5e3c('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x5e3c('0xf')]);router[_0x5e3c('0xa')](_0x5e3c('0x10'),auth[_0x5e3c('0xb')](),controller[_0x5e3c('0x11')]);router['get'](_0x5e3c('0x12'),auth[_0x5e3c('0xb')](),controller['getResources']);router[_0x5e3c('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5e3c('0x13')](_0x5e3c('0x14'),auth[_0x5e3c('0xb')](),controller[_0x5e3c('0x15')]);router[_0x5e3c('0x13')](_0x5e3c('0x10'),auth[_0x5e3c('0xb')](),controller[_0x5e3c('0x16')]);router['post']('/:id/resources',auth[_0x5e3c('0xb')](),controller[_0x5e3c('0x17')]);router[_0x5e3c('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x5e3c('0x19')]);router[_0x5e3c('0x1a')](_0x5e3c('0x1b'),auth[_0x5e3c('0xb')](),controller['destroy']);router['delete'](_0x5e3c('0x10'),auth['isAuthenticated'](),controller['removeSections']);router[_0x5e3c('0x1a')]('/:id/resources',auth['isAuthenticated'](),controller['removeResources']);module[_0x5e3c('0x1c')]=router; \ No newline at end of file +var _0x613a=['/describe','isAuthenticated','describe','/:id','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','addResources','put','update','delete','destroy','removeSections','removeResources','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index'];(function(_0x2a6732,_0xab0429){var _0x16698c=function(_0x200659){while(--_0x200659){_0x2a6732['push'](_0x2a6732['shift']());}};_0x16698c(++_0xab0429);}(_0x613a,0xba));var _0xa613=function(_0x195452,_0x36395f){_0x195452=_0x195452-0x0;var _0x2bce82=_0x613a[_0x195452];return _0x2bce82;};'use strict';var multer=require('multer');var util=require(_0xa613('0x0'));var path=require(_0xa613('0x1'));var timeout=require(_0xa613('0x2'));var express=require(_0xa613('0x3'));var router=express[_0xa613('0x4')]();var fs_extra=require(_0xa613('0x5'));var auth=require(_0xa613('0x6'));var interaction=require(_0xa613('0x7'));var config=require(_0xa613('0x8'));var controller=require(_0xa613('0x9'));router[_0xa613('0xa')]('/',auth['isAuthenticated'](),controller[_0xa613('0xb')]);router[_0xa613('0xa')](_0xa613('0xc'),auth[_0xa613('0xd')](),controller[_0xa613('0xe')]);router[_0xa613('0xa')](_0xa613('0xf'),auth[_0xa613('0xd')](),controller['show']);router[_0xa613('0xa')]('/:id/sections',auth[_0xa613('0xd')](),controller[_0xa613('0x10')]);router['get'](_0xa613('0x11'),auth[_0xa613('0xd')](),controller[_0xa613('0x12')]);router[_0xa613('0x13')]('/',auth['isAuthenticated'](),controller[_0xa613('0x14')]);router['post'](_0xa613('0x15'),auth[_0xa613('0xd')](),controller[_0xa613('0x16')]);router['post'](_0xa613('0x17'),auth[_0xa613('0xd')](),controller[_0xa613('0x18')]);router[_0xa613('0x13')](_0xa613('0x11'),auth[_0xa613('0xd')](),controller[_0xa613('0x19')]);router[_0xa613('0x1a')](_0xa613('0xf'),auth[_0xa613('0xd')](),controller[_0xa613('0x1b')]);router[_0xa613('0x1c')]('/:id',auth[_0xa613('0xd')](),controller[_0xa613('0x1d')]);router[_0xa613('0x1c')](_0xa613('0x17'),auth[_0xa613('0xd')](),controller[_0xa613('0x1e')]);router[_0xa613('0x1c')](_0xa613('0x11'),auth[_0xa613('0xd')](),controller[_0xa613('0x1f')]);module[_0xa613('0x20')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 4ee94cc..eb5503b 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 _0x7d5f=['setDataValue','join','getDataValue','crudPermissions','split','BOOLEAN','STRING','name'];(function(_0x1f4f7b,_0x4f0ce1){var _0x3d6de8=function(_0x1130b8){while(--_0x1130b8){_0x1f4f7b['push'](_0x1f4f7b['shift']());}};_0x3d6de8(++_0x4f0ce1);}(_0x7d5f,0x66));var _0xf7d5=function(_0x3b4cb0,_0x316abe){_0x3b4cb0=_0x3b4cb0-0x0;var _0x35ab63=_0x7d5f[_0x3b4cb0];return _0x35ab63;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xf7d5('0x0')],'allowNull':![],'unique':_0xf7d5('0x1')},'crudPermissions':{'type':Sequelize[_0xf7d5('0x0')],'set':function(_0x40cc71){this[_0xf7d5('0x2')]('crudPermissions',_0x40cc71?_0x40cc71[_0xf7d5('0x3')](''):[]);},'get':function(){return this[_0xf7d5('0x4')]('crudPermissions')?this[_0xf7d5('0x4')](_0xf7d5('0x5'))[_0xf7d5('0x6')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xf7d5('0x0')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0xf7d5('0x7')],'defaultValue':!![]}}; \ No newline at end of file +var _0xff04=['name','crudPermissions','join','BOOLEAN','sequelize','exports','STRING'];(function(_0xadbaeb,_0x13c8c9){var _0x3bb7f2=function(_0x4b4eb8){while(--_0x4b4eb8){_0xadbaeb['push'](_0xadbaeb['shift']());}};_0x3bb7f2(++_0x13c8c9);}(_0xff04,0x12a));var _0x4ff0=function(_0xba0b21,_0x4fd3be){_0xba0b21=_0xba0b21-0x0;var _0x11ddf0=_0xff04[_0xba0b21];return _0x11ddf0;};'use strict';var Sequelize=require(_0x4ff0('0x0'));module[_0x4ff0('0x1')]={'name':{'type':Sequelize[_0x4ff0('0x2')],'allowNull':![],'unique':_0x4ff0('0x3')},'crudPermissions':{'type':Sequelize[_0x4ff0('0x2')],'set':function(_0x2721cb){this['setDataValue'](_0x4ff0('0x4'),_0x2721cb?_0x2721cb[_0x4ff0('0x5')](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this['getDataValue'](_0x4ff0('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x4ff0('0x6')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index a5d2828..1c85c85 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 _0x8fcd=['name','send','index','map','UserProfile','fieldName','type','model','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','options','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','merge','create','body','find','omit','createdAt','updatedAt','sequelize','get','each','autoAssociation','UserProfileResource','userProfileId','Resources','UserProfileSection','describe','addSections','sectionId','push','removeSections','includes','isEmpty','subsections','enabled','forEach','resourceId','Plugin','addResources','transaction','bulkCreate','removeResources','ids','Missing\x20section\x20parameter','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','sendStatus'];(function(_0x42b8f5,_0x4b9730){var _0x31ca50=function(_0x2060a){while(--_0x2060a){_0x42b8f5['push'](_0x42b8f5['shift']());}};_0x31ca50(++_0x4b9730);}(_0x8fcd,0xa1));var _0xd8fc=function(_0x449e56,_0x19d35a){_0x449e56=_0x449e56-0x0;var _0xf780ec=_0x8fcd[_0x449e56];return _0xf780ec;};'use strict';var emlformat=require(_0xd8fc('0x0'));var rimraf=require(_0xd8fc('0x1'));var zipdir=require(_0xd8fc('0x2'));var jsonpatch=require(_0xd8fc('0x3'));var rp=require(_0xd8fc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd8fc('0x5'));var util=require(_0xd8fc('0x6'));var path=require(_0xd8fc('0x7'));var sox=require(_0xd8fc('0x8'));var csv=require(_0xd8fc('0x9'));var ejs=require(_0xd8fc('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xd8fc('0xb'));var crypto=require('crypto');var jsforce=require(_0xd8fc('0xc'));var deskjs=require(_0xd8fc('0xd'));var toCsv=require(_0xd8fc('0x9'));var querystring=require(_0xd8fc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd8fc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd8fc('0x10'));var logger=require(_0xd8fc('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd8fc('0x12'));var licenseUtil=require(_0xd8fc('0x13'));var db=require('../../mysqldb')['db'];config[_0xd8fc('0x14')]=_[_0xd8fc('0x15')](config[_0xd8fc('0x14')],{'host':_0xd8fc('0x16'),'port':0x18eb});var socket=require(_0xd8fc('0x17'))(new Redis(config['redis']));require(_0xd8fc('0x18'))['register'](socket);function respondWithStatusCode(_0x4761f,_0x231ea3){_0x231ea3=_0x231ea3||0xcc;return function(_0x3216bf){if(_0x3216bf){return _0x4761f['sendStatus'](_0x231ea3);}return _0x4761f[_0xd8fc('0x19')](_0x231ea3)[_0xd8fc('0x1a')]();};}function respondWithResult(_0x57838b,_0x49c450){_0x49c450=_0x49c450||0xc8;return function(_0x234cfd){if(_0x234cfd){return _0x57838b[_0xd8fc('0x19')](_0x49c450)[_0xd8fc('0x1b')](_0x234cfd);}};}function respondWithFilteredResult(_0x4daf69,_0x1dad5b){return function(_0x1c744d){if(_0x1c744d){var _0x461f85=typeof _0x1dad5b[_0xd8fc('0x1c')]===_0xd8fc('0x1d')&&typeof _0x1dad5b[_0xd8fc('0x1e')]===_0xd8fc('0x1d');var _0x1d7e77=_0x1c744d[_0xd8fc('0x1f')];var _0x509961=_0x461f85?0x0:_0x1dad5b[_0xd8fc('0x1c')];var _0x46c902=_0x461f85?_0x1c744d[_0xd8fc('0x1f')]:_0x1dad5b[_0xd8fc('0x1c')]+_0x1dad5b[_0xd8fc('0x1e')];var _0xd24b3f;if(_0x46c902>=_0x1d7e77){_0x46c902=_0x1d7e77;_0xd24b3f=0xc8;}else{_0xd24b3f=0xce;}_0x4daf69['status'](_0xd24b3f);return _0x4daf69[_0xd8fc('0x20')](_0xd8fc('0x21'),_0x509961+'-'+_0x46c902+'/'+_0x1d7e77)['json'](_0x1c744d);}return null;};}function patchUpdates(_0x37a93b){return function(_0x4fb847){try{jsonpatch[_0xd8fc('0x22')](_0x4fb847,_0x37a93b,!![]);}catch(_0x370a62){return BPromise['reject'](_0x370a62);}return _0x4fb847['save']();};}function saveUpdates(_0x47ccff,_0xc0202b){return function(_0x1539b0){if(_0x1539b0){return _0x1539b0[_0xd8fc('0x23')](_0x47ccff)[_0xd8fc('0x24')](function(_0x495bd2){return _0x495bd2;});}return null;};}function removeEntity(_0x71dcc1,_0x45ac21){return function(_0x54f1a5){if(_0x54f1a5){return _0x54f1a5[_0xd8fc('0x25')]()['then'](function(){_0x71dcc1[_0xd8fc('0x19')](0xcc)[_0xd8fc('0x1a')]();});}};}function handleEntityNotFound(_0x454a77,_0xb4077f){return function(_0x58718b){if(!_0x58718b){_0x454a77[_0xd8fc('0x26')](0x194);}return _0x58718b;};}function handleError(_0x51d0d0,_0x1f4577){_0x1f4577=_0x1f4577||0x1f4;return function(_0x1692d0){logger['error'](_0x1692d0['stack']);if(_0x1692d0['name']){delete _0x1692d0[_0xd8fc('0x27')];}_0x51d0d0[_0xd8fc('0x19')](_0x1f4577)[_0xd8fc('0x28')](_0x1692d0);};}exports[_0xd8fc('0x29')]=function(_0x28c80d,_0x281559){var _0x55bfcc={},_0x1346b1={},_0x446609={'count':0x0,'rows':[]};var _0x5e2e11=_[_0xd8fc('0x2a')](db[_0xd8fc('0x2b')]['rawAttributes'],function(_0x417fb7){return{'name':_0x417fb7[_0xd8fc('0x2c')],'type':_0x417fb7[_0xd8fc('0x2d')]['key']};});_0x1346b1[_0xd8fc('0x2e')]=_[_0xd8fc('0x2a')](_0x5e2e11,_0xd8fc('0x27'));_0x1346b1['query']=_['keys'](_0x28c80d['query']);_0x1346b1[_0xd8fc('0x2f')]=_[_0xd8fc('0x30')](_0x1346b1[_0xd8fc('0x2e')],_0x1346b1[_0xd8fc('0x31')]);_0x55bfcc[_0xd8fc('0x32')]=_[_0xd8fc('0x30')](_0x1346b1[_0xd8fc('0x2e')],qs[_0xd8fc('0x33')](_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x33')]));_0x55bfcc['attributes']=_0x55bfcc[_0xd8fc('0x32')]['length']?_0x55bfcc[_0xd8fc('0x32')]:_0x1346b1['model'];if(!_0x28c80d['query'][_0xd8fc('0x34')](_0xd8fc('0x35'))){_0x55bfcc[_0xd8fc('0x1e')]=qs[_0xd8fc('0x1e')](_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x1e')]);_0x55bfcc['offset']=qs[_0xd8fc('0x1c')](_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x1c')]);}_0x55bfcc['order']=qs[_0xd8fc('0x36')](_0x28c80d[_0xd8fc('0x31')]['sort']);_0x55bfcc['where']=qs[_0xd8fc('0x2f')](_['pick'](_0x28c80d[_0xd8fc('0x31')],_0x1346b1['filters']),_0x5e2e11);if(_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x37')]){_0x55bfcc[_0xd8fc('0x38')]=_['merge'](_0x55bfcc[_0xd8fc('0x38')],{'$or':_['map'](_0x5e2e11,function(_0xbb9ee5){if(_0xbb9ee5[_0xd8fc('0x2d')]!=='VIRTUAL'){var _0xfea683={};_0xfea683[_0xbb9ee5[_0xd8fc('0x27')]]={'$like':'%'+_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x37')]+'%'};return _0xfea683;}})});}_0x55bfcc=_['merge']({},_0x55bfcc,_0x28c80d[_0xd8fc('0x39')]);var _0x1b709d={'where':_0x55bfcc[_0xd8fc('0x38')]};return db['UserProfile']['count'](_0x1b709d)['then'](function(_0x17ffbb){_0x446609[_0xd8fc('0x1f')]=_0x17ffbb;if(_0x28c80d[_0xd8fc('0x31')][_0xd8fc('0x3a')]){_0x55bfcc['include']=[{'all':!![]}];}return db[_0xd8fc('0x2b')][_0xd8fc('0x3b')](_0x55bfcc);})[_0xd8fc('0x24')](function(_0x126ff4){_0x446609[_0xd8fc('0x3c')]=_0x126ff4;return _0x446609;})[_0xd8fc('0x24')](respondWithFilteredResult(_0x281559,_0x55bfcc))[_0xd8fc('0x3d')](handleError(_0x281559,null));};exports['show']=function(_0x4dedad,_0x1f0de2){var _0x50c84e={'raw':![],'where':{'id':_0x4dedad[_0xd8fc('0x3e')]['id']}},_0xa1de09={};_0xa1de09[_0xd8fc('0x2e')]=_[_0xd8fc('0x3f')](db[_0xd8fc('0x2b')][_0xd8fc('0x40')]);_0xa1de09[_0xd8fc('0x31')]=_[_0xd8fc('0x3f')](_0x4dedad[_0xd8fc('0x31')]);_0xa1de09[_0xd8fc('0x2f')]=_[_0xd8fc('0x30')](_0xa1de09[_0xd8fc('0x2e')],_0xa1de09[_0xd8fc('0x31')]);_0x50c84e[_0xd8fc('0x32')]=_['intersection'](_0xa1de09['model'],qs['fields'](_0x4dedad[_0xd8fc('0x31')][_0xd8fc('0x33')]));_0x50c84e[_0xd8fc('0x32')]=_0x50c84e[_0xd8fc('0x32')]['length']?_0x50c84e[_0xd8fc('0x32')]:_0xa1de09[_0xd8fc('0x2e')];if(_0x4dedad[_0xd8fc('0x31')][_0xd8fc('0x3a')]){_0x50c84e[_0xd8fc('0x41')]=[{'all':!![]}];}_0x50c84e=_[_0xd8fc('0x42')]({},_0x50c84e,_0x4dedad[_0xd8fc('0x39')]);return db['UserProfile']['find'](_0x50c84e)['then'](handleEntityNotFound(_0x1f0de2,null))[_0xd8fc('0x24')](respondWithResult(_0x1f0de2,null))[_0xd8fc('0x3d')](handleError(_0x1f0de2,null));};exports[_0xd8fc('0x43')]=function(_0x13cd5d,_0x2dd8e0){return db[_0xd8fc('0x2b')][_0xd8fc('0x43')](_0x13cd5d[_0xd8fc('0x44')],{})[_0xd8fc('0x24')](respondWithResult(_0x2dd8e0,0xc9))['catch'](handleError(_0x2dd8e0,null));};exports['clone']=function(_0x2c3295,_0x5363c5){var _0xae7f7d={'where':{'id':_0x2c3295[_0xd8fc('0x3e')]['id']}},_0x4f5f4b={};_0x4f5f4b[_0xd8fc('0x2e')]=_['keys'](db[_0xd8fc('0x2b')][_0xd8fc('0x40')]);_0xae7f7d[_0xd8fc('0x32')]=_[_0xd8fc('0x30')](_0x4f5f4b[_0xd8fc('0x2e')],qs[_0xd8fc('0x33')](_0x2c3295[_0xd8fc('0x31')]['fields']));_0xae7f7d[_0xd8fc('0x32')]=_0xae7f7d[_0xd8fc('0x32')]['length']?_0xae7f7d['attributes']:_0x4f5f4b[_0xd8fc('0x2e')];if(_0x2c3295['query'][_0xd8fc('0x3a')]){_0xae7f7d[_0xd8fc('0x41')]=[{'all':!![]}];}_0xae7f7d=_[_0xd8fc('0x42')]({},_0xae7f7d,_0x2c3295[_0xd8fc('0x39')]);return db[_0xd8fc('0x2b')][_0xd8fc('0x45')](_0xae7f7d)[_0xd8fc('0x24')](handleEntityNotFound(_0x5363c5,null))['then'](function(_0x1b9087){if(_0x1b9087){var _0x56cdbf=_0x1b9087['get']({'plain':!![]});_0x56cdbf=qs[_0xd8fc('0x46')](_0x56cdbf,['id',_0xd8fc('0x47'),_0xd8fc('0x48'),'crudPermissions']);_0x2c3295[_0xd8fc('0x44')]=_[_0xd8fc('0x46')](_0x2c3295[_0xd8fc('0x44')],['id','createdAt',_0xd8fc('0x48')]);return db[_0xd8fc('0x49')]['transaction'](function(_0x5dd2ba){return db[_0xd8fc('0x2b')][_0xd8fc('0x43')](_[_0xd8fc('0x42')](_0x56cdbf,_0x2c3295[_0xd8fc('0x44')]),{'include':_0x2c3295[_0xd8fc('0x31')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x5dd2ba})['then'](function(_0x2bf939){var _0x1635a0=_0x2bf939[_0xd8fc('0x4a')]({'plain':!![]});return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x2c3295[_0xd8fc('0x3e')]['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x4a48d0){if(_0x4a48d0){return BPromise[_0xd8fc('0x4b')](_0x4a48d0,function(_0x49b8de){return new BPromise(function(_0x5e5677,_0x69f17e){if(_0x49b8de[_0xd8fc('0x4c')]===null||_0x49b8de[_0xd8fc('0x4c')]===0x1)_0x5e5677(null);return db[_0xd8fc('0x4d')][_0xd8fc('0x3b')]({'where':{'sectionId':_0x49b8de['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x50434a){var _0x24b5f7=_['map'](_0x50434a,function(_0xfd073e){return qs[_0xd8fc('0x46')](_0xfd073e,['id',_0xd8fc('0x47'),_0xd8fc('0x48'),'sectionId']);});_0x5e5677(_0x24b5f7);})[_0xd8fc('0x3d')](function(_0x15f761){_0x69f17e(_0x15f761);});})[_0xd8fc('0x24')](function(_0x2e02bc){var _0x3e70e6=qs['omit'](_0x49b8de,['id',_0xd8fc('0x47'),_0xd8fc('0x48')]);_0x3e70e6[_0xd8fc('0x4e')]=_0x1635a0['id'];if(_0x2e02bc)_0x3e70e6[_0xd8fc('0x4f')]=_0x2e02bc;return _0x3e70e6;})[_0xd8fc('0x24')](function(_0x1882c6){return db[_0xd8fc('0x50')][_0xd8fc('0x43')](_0x1882c6,{'include':[{'model':db[_0xd8fc('0x4d')],'as':_0xd8fc('0x4f')}],'raw':!![],'transaction':_0x5dd2ba});});})['then'](function(){return _0x1635a0;});}});});});}})['then'](respondWithResult(_0x5363c5,0xc9))[_0xd8fc('0x3d')](handleError(_0x5363c5,null));};exports['update']=function(_0x471d2c,_0xbfd466){if(_0x471d2c[_0xd8fc('0x44')]['id']){delete _0x471d2c[_0xd8fc('0x44')]['id'];}return db[_0xd8fc('0x2b')]['find']({'where':{'id':_0x471d2c['params']['id']}})[_0xd8fc('0x24')](handleEntityNotFound(_0xbfd466,null))[_0xd8fc('0x24')](saveUpdates(_0x471d2c[_0xd8fc('0x44')],null))[_0xd8fc('0x24')](respondWithResult(_0xbfd466,null))[_0xd8fc('0x3d')](handleError(_0xbfd466,null));};exports[_0xd8fc('0x25')]=function(_0xcf304c,_0x51920d){return db['UserProfile'][_0xd8fc('0x45')]({'where':{'id':_0xcf304c[_0xd8fc('0x3e')]['id']}})[_0xd8fc('0x24')](handleEntityNotFound(_0x51920d,null))[_0xd8fc('0x24')](removeEntity(_0x51920d,null))[_0xd8fc('0x3d')](handleError(_0x51920d,null));};exports[_0xd8fc('0x51')]=function(_0x13ea39,_0x311d96){return db[_0xd8fc('0x2b')][_0xd8fc('0x51')]()[_0xd8fc('0x24')](respondWithResult(_0x311d96,null))['catch'](handleError(_0x311d96,null));};exports[_0xd8fc('0x52')]=function(_0x4e7d9b,_0x7d902c){var _0x12af0c=_0x4e7d9b[_0xd8fc('0x44')];return db['UserProfile'][_0xd8fc('0x45')]({'where':{'id':_0x4e7d9b['params']['id']}})[_0xd8fc('0x24')](handleEntityNotFound(_0x7d902c,null))[_0xd8fc('0x24')](function(_0x16d26e){if(_0x16d26e){return db[_0xd8fc('0x49')]['transaction'](function(_0xdd32f2){return db[_0xd8fc('0x50')][_0xd8fc('0x25')]({'where':{'userProfileId':_0x4e7d9b[_0xd8fc('0x3e')]['id'],'sectionId':_['map'](_0x12af0c,function(_0x52bbbe){return _0x52bbbe[_0xd8fc('0x53')];})},'transaction':_0xdd32f2})[_0xd8fc('0x24')](function(){var _0x51f1a7=_['map'](_0x12af0c,function(_0x3267bd){_0x3267bd[_0xd8fc('0x4e')]=_0x4e7d9b[_0xd8fc('0x3e')]['id'];return _0x3267bd;});var _0x184983=[];return BPromise[_0xd8fc('0x4b')](_0x51f1a7,function(_0x22c99d){return db[_0xd8fc('0x50')][_0xd8fc('0x43')](_0x22c99d,{'include':[{'model':db[_0xd8fc('0x4d')],'as':'Resources'}],'raw':!![],'transaction':_0xdd32f2})[_0xd8fc('0x24')](function(_0x4b081e){_0x184983[_0xd8fc('0x54')](_0x4b081e[_0xd8fc('0x4a')]({'plain':!![]}));});})[_0xd8fc('0x24')](function(){return _0x184983;});});});}})['then'](function(_0x21afc6){return _0x21afc6;})[_0xd8fc('0x24')](respondWithResult(_0x7d902c,null))[_0xd8fc('0x3d')](handleError(_0x7d902c,null));};exports[_0xd8fc('0x55')]=function(_0x1e516f,_0x5df319){var _0x22a584;return db[_0xd8fc('0x2b')][_0xd8fc('0x45')]({'where':{'id':_0x1e516f[_0xd8fc('0x3e')]['id']},'attributes':['id',_0xd8fc('0x27')]})[_0xd8fc('0x24')](handleEntityNotFound(_0x5df319,null))['then'](function(_0x4f1cab){if(_0x4f1cab){_0x22a584=_0x4f1cab;return db[_0xd8fc('0x50')][_0xd8fc('0x25')]({'where':{'userProfileId':_0x1e516f[_0xd8fc('0x3e')]['id'],'sectionId':_0x1e516f[_0xd8fc('0x31')]['ids']}});}})['then'](function(){return _0x22a584;})[_0xd8fc('0x24')](respondWithStatusCode(_0x5df319,null))[_0xd8fc('0x3d')](handleError(_0x5df319,null));};exports['getSections']=function(_0x37bae7,_0x5cd848){var _0x5790f2=[];var _0x1b59cd=[];return db[_0xd8fc('0x50')][_0xd8fc('0x3b')]({'where':{'userProfileId':_0x37bae7[_0xd8fc('0x3e')]['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x3c6a72){_0x5790f2=_[_0xd8fc('0x37')](_0x3c6a72,function(_0x28ad47){return _0x28ad47['enabled']===0x1||_[_0xd8fc('0x56')]([0x3eb,0x709],_0x28ad47[_0xd8fc('0x53')]);});if(!_[_0xd8fc('0x57')](_0x5790f2)){return _[_0xd8fc('0x2a')](_0x5790f2,function(_0x49dbab){return _0x49dbab[_0xd8fc('0x53')];});}else{return;}})[_0xd8fc('0x24')](function(_0x4b9a9c){if(_0x4b9a9c)_0x1b59cd=_0x4b9a9c;if(_[_0xd8fc('0x56')](_0x1b59cd,0x64)){var _0x195910=_[_0xd8fc('0x45')](_0x5790f2,{'sectionId':0x64});return hasDefaultDashboard(_0x195910)[_0xd8fc('0x24')](function(_0x5d720b){return _['map'](_0x5790f2,function(_0x35abbb){if(_0x35abbb['sectionId']===0x64){_0x35abbb[_0xd8fc('0x58')]=_0x5d720b;}return _0x35abbb;});});}else{return;}})['then'](function(_0x144a81){if(_0x144a81)_0x5790f2=_0x144a81;if(_['includes'](_0x1b59cd,0x3eb)){var _0x142c4d=_[_0xd8fc('0x45')](_0x5790f2,{'sectionId':0x3eb});return getCustomDashboards(_0x142c4d)[_0xd8fc('0x24')](function(_0x21abf3){return _[_0xd8fc('0x2a')](_0x5790f2,function(_0x3520ee){if(_0x142c4d[_0xd8fc('0x59')]){if(_0x3520ee[_0xd8fc('0x53')]===0x3eb){_0x3520ee['subsections']=_0x21abf3;}}else{if(_0x3520ee[_0xd8fc('0x53')]===0x64){_0x3520ee[_0xd8fc('0x58')]=_0x21abf3;}}return _0x3520ee;});});}else{return;}})[_0xd8fc('0x24')](function(_0x508ca5){if(_0x508ca5)_0x5790f2=_0x508ca5;if(_['includes'](_0x1b59cd,0x709)){var _0x1120a5=_[_0xd8fc('0x45')](_0x5790f2,{'sectionId':0x709});return getPlugins(_0x1120a5)[_0xd8fc('0x24')](function(_0x1dada8){if(_0x1120a5[_0xd8fc('0x59')]){return _[_0xd8fc('0x2a')](_0x5790f2,function(_0x27c2d4){if(_0x27c2d4['sectionId']===0x709){_0x27c2d4['subsections']=_0x1dada8;}return _0x27c2d4;});}else{var _0x19766b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x1dada8};var _0xf12af3=_[_0xd8fc('0x2a')](_0x5790f2);_0xf12af3[_0xd8fc('0x54')](_0x19766b);return _0xf12af3;}});}else{return;}})[_0xd8fc('0x24')](function(_0x36ec78){if(_0x36ec78)_0x5790f2=_0x36ec78;return _[_0xd8fc('0x37')](_0x5790f2,[_0xd8fc('0x59'),0x1]);})['then'](respondWithResult(_0x5cd848,null))[_0xd8fc('0x3d')](handleError(_0x5cd848,null));};function hasDefaultDashboard(_0xa869b2){var _0x225710=[0x65];return new BPromise(function(_0xeecc35,_0x578905){try{if(_0xa869b2[_0xd8fc('0x4c')]){_0xeecc35(_0x225710);}else{return db[_0xd8fc('0x4d')]['findOne']({'where':{'sectionId':_0xa869b2['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x7b06de){_0x7b06de?_0xeecc35(_0x225710):_0xeecc35();});}}catch(_0x1054c2){_0x578905(_0x1054c2);}});}function getCustomDashboards(_0x573026){var _0x6782f2=[];return new BPromise(function(_0x2ce5dc,_0x3bd269){try{if(_0x573026[_0xd8fc('0x4c')]){return db['Dashboard']['findAll']({'raw':!![]})[_0xd8fc('0x24')](function(_0x1bce77){_0x1bce77['forEach'](function(_0x17f2bd){_0x6782f2[_0xd8fc('0x54')](_0x17f2bd['id']+0x1869f);});_0x2ce5dc(_0x6782f2);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x573026['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x471234){_0x471234[_0xd8fc('0x5a')](function(_0x1c3289){_0x6782f2[_0xd8fc('0x54')](_0x1c3289[_0xd8fc('0x5b')]+0x1869f);});_0x2ce5dc(_0x6782f2);});}}catch(_0x252bfc){_0x3bd269(_0x252bfc);}});}function getPlugins(_0x10c787){var _0x5ad6eb=[];return new BPromise(function(_0x4e89c0,_0x26985f){try{if(_0x10c787[_0xd8fc('0x4c')]){return db[_0xd8fc('0x5c')][_0xd8fc('0x3b')]({'raw':!![]})[_0xd8fc('0x24')](function(_0xbb74b5){_0xbb74b5[_0xd8fc('0x5a')](function(_0x5a3f87){_0x5ad6eb[_0xd8fc('0x54')](_0x5a3f87['id']+0x15b38);});_0x4e89c0(_0x5ad6eb);});}else{return db['UserProfileResource'][_0xd8fc('0x3b')]({'where':{'sectionId':_0x10c787['id']},'raw':!![]})[_0xd8fc('0x24')](function(_0x3c6467){_0x3c6467[_0xd8fc('0x5a')](function(_0x9f4ddc){_0x5ad6eb['push'](_0x9f4ddc['resourceId']+0x15b38);});_0x4e89c0(_0x5ad6eb);});}}catch(_0xbffb4c){_0x26985f(_0xbffb4c);}});}exports[_0xd8fc('0x5d')]=function(_0x921f5,_0x35d845){return db[_0xd8fc('0x2b')]['find']({'where':{'id':_0x921f5[_0xd8fc('0x3e')]['id']}})[_0xd8fc('0x24')](handleEntityNotFound(_0x35d845,null))[_0xd8fc('0x24')](function(_0x3d70aa){if(_0x3d70aa){return db['sequelize'][_0xd8fc('0x5e')](function(_0x593b44){return db[_0xd8fc('0x50')][_0xd8fc('0x3b')]({'where':{'userProfileId':_0x921f5[_0xd8fc('0x3e')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x2572b2){if(_0x2572b2){return db[_0xd8fc('0x50')]['destroy']({'where':{'userProfileId':_0x921f5[_0xd8fc('0x3e')]['id'],'id':_['map'](_0x2572b2,function(_0x4f7ea2){return _0x4f7ea2['id'];})},'transaction':_0x593b44});}})['then'](function(_0x6616e5){var _0x32926e=_[_0xd8fc('0x2a')](_0x921f5[_0xd8fc('0x44')],function(_0x209d8c){_0x209d8c['userProfileId']=_0x921f5['params']['id'];return _0x209d8c;});return db['UserProfileSection'][_0xd8fc('0x5f')](_0x32926e,{'raw':!![],'transaction':_0x593b44});})[_0xd8fc('0x24')](function(_0x4d4b4a){var _0xebcd0c=_['filter'](_[_0xd8fc('0x2a')](_0x4d4b4a,function(_0x594d28){return _0x594d28[_0xd8fc('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0xebcd0c){return db[_0xd8fc('0x50')]['findAll']({'where':{'userProfileId':_0x921f5['params']['id'],'sectionId':_['map'](_0xebcd0c,function(_0x3aaf4f){return _0x3aaf4f['sectionId'];})},'attributes':['id',_0xd8fc('0x53')],'raw':!![]})[_0xd8fc('0x24')](function(_0x17ffe9){var _0x4ab10c=_['map'](_0x921f5['body'],function(_0x1f3cf9){_0x1f3cf9[_0xd8fc('0x4e')]=_0x921f5[_0xd8fc('0x3e')]['id'];return _0x1f3cf9;});return db[_0xd8fc('0x4d')][_0xd8fc('0x5f')](_0x4ab10c,{'raw':!![],'transaction':_0x593b44});});}})[_0xd8fc('0x3d')](handleError(_0x35d845,null));});}})['then'](function(_0x1e5ee2){var _0x3c220e=_['map'](_0x1e5ee2,function(_0x3e0650){return _0x3e0650[_0xd8fc('0x4a')]({'plain':!![]});});})[_0xd8fc('0x24')](respondWithResult(_0x35d845,null))['catch'](handleError(_0x35d845,null));};exports[_0xd8fc('0x60')]=function(_0x2e024e,_0x262695,_0x57cfdd){return db[_0xd8fc('0x2b')][_0xd8fc('0x45')]({'where':{'id':_0x2e024e['params']['id']}})[_0xd8fc('0x24')](handleEntityNotFound(_0x262695,null))[_0xd8fc('0x24')](function(_0x25692a){if(_0x25692a){return _0x25692a[_0xd8fc('0x60')](_0x2e024e[_0xd8fc('0x31')][_0xd8fc('0x61')]);}})['then'](respondWithStatusCode(_0x262695,null))[_0xd8fc('0x3d')](handleError(_0x262695,null));};exports['getResources']=function(_0x5833b6,_0x106506){var _0x2d2785={};if(!_0x5833b6[_0xd8fc('0x31')]['section'])throw new Error(_0xd8fc('0x62'));if(!_0x5833b6[_0xd8fc('0x31')]['hasOwnProperty']('nolimit')){_0x2d2785[_0xd8fc('0x1e')]=qs['limit'](_0x5833b6['query'][_0xd8fc('0x1e')]);_0x2d2785[_0xd8fc('0x1c')]=qs[_0xd8fc('0x1c')](_0x5833b6[_0xd8fc('0x31')]['offset']);}return db['UserProfile'][_0xd8fc('0x45')]({'where':{'id':_0x5833b6['params']['id']}})[_0xd8fc('0x24')](function(_0x106663){if(!_0x106663)throw new Error(_0xd8fc('0x63')+_0x5833b6[_0xd8fc('0x3e')]['id']);return db[_0xd8fc('0x2b')]['getResources'](_0x5833b6);})['then'](respondWithFilteredResult(_0x106506,_0x2d2785))[_0xd8fc('0x3d')](handleError(_0x106506,null));}; \ No newline at end of file +var _0x202a=['redis','localhost','socket.io-emitter','./userProfile.socket','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','Resources','describe','addSections','sectionId','userProfileId','push','removeSections','ids','getSections','enabled','includes','isEmpty','subsections','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','Missing\x20section\x20parameter','rimraf','zip-dir','fast-json-patch','moment','path','sox','fs-extra','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','defaults'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x202a,0xc0));var _0xa202=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x202a[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa202('0x0'));var zipdir=require(_0xa202('0x1'));var jsonpatch=require(_0xa202('0x2'));var rp=require('request-promise');var moment=require(_0xa202('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xa202('0x4'));var sox=require(_0xa202('0x5'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa202('0x6'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa202('0x7'));var deskjs=require(_0xa202('0x8'));var toCsv=require(_0xa202('0x9'));var querystring=require(_0xa202('0xa'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa202('0xb'));var qs=require(_0xa202('0xc'));var as=require(_0xa202('0xd'));var hardwareService=require(_0xa202('0xe'));var logger=require('../../config/logger')(_0xa202('0xf'));var utils=require('../../config/utils');var config=require(_0xa202('0x10'));var licenseUtil=require(_0xa202('0x11'));var db=require(_0xa202('0x12'))['db'];config['redis']=_[_0xa202('0x13')](config[_0xa202('0x14')],{'host':_0xa202('0x15'),'port':0x18eb});var socket=require(_0xa202('0x16'))(new Redis(config[_0xa202('0x14')]));require(_0xa202('0x17'))['register'](socket);function respondWithStatusCode(_0x13510c,_0x3b3ec9){_0x3b3ec9=_0x3b3ec9||0xcc;return function(_0x3880ad){if(_0x3880ad){return _0x13510c[_0xa202('0x18')](_0x3b3ec9);}return _0x13510c[_0xa202('0x19')](_0x3b3ec9)['end']();};}function respondWithResult(_0x331df8,_0x30b18b){_0x30b18b=_0x30b18b||0xc8;return function(_0x1221a2){if(_0x1221a2){return _0x331df8[_0xa202('0x19')](_0x30b18b)[_0xa202('0x1a')](_0x1221a2);}};}function respondWithFilteredResult(_0x214a08,_0x5d348c){return function(_0x44a1b6){if(_0x44a1b6){var _0x53ff78=typeof _0x5d348c[_0xa202('0x1b')]==='undefined'&&typeof _0x5d348c[_0xa202('0x1c')]===_0xa202('0x1d');var _0x130c45=_0x44a1b6[_0xa202('0x1e')];var _0x391e82=_0x53ff78?0x0:_0x5d348c['offset'];var _0x1da0e2=_0x53ff78?_0x44a1b6[_0xa202('0x1e')]:_0x5d348c[_0xa202('0x1b')]+_0x5d348c[_0xa202('0x1c')];var _0x188195;if(_0x1da0e2>=_0x130c45){_0x1da0e2=_0x130c45;_0x188195=0xc8;}else{_0x188195=0xce;}_0x214a08['status'](_0x188195);return _0x214a08[_0xa202('0x1f')](_0xa202('0x20'),_0x391e82+'-'+_0x1da0e2+'/'+_0x130c45)[_0xa202('0x1a')](_0x44a1b6);}return null;};}function patchUpdates(_0x44801a){return function(_0x5845f5){try{jsonpatch[_0xa202('0x21')](_0x5845f5,_0x44801a,!![]);}catch(_0x192d3c){return BPromise['reject'](_0x192d3c);}return _0x5845f5['save']();};}function saveUpdates(_0x7991c7,_0x2f5714){return function(_0x47ceb1){if(_0x47ceb1){return _0x47ceb1[_0xa202('0x22')](_0x7991c7)['then'](function(_0x5373b6){return _0x5373b6;});}return null;};}function removeEntity(_0x72fe3e,_0x268ee9){return function(_0x397553){if(_0x397553){return _0x397553[_0xa202('0x23')]()[_0xa202('0x24')](function(){_0x72fe3e[_0xa202('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x571571,_0x55f478){return function(_0x4d33fe){if(!_0x4d33fe){_0x571571[_0xa202('0x18')](0x194);}return _0x4d33fe;};}function handleError(_0x23d7cd,_0x3db218){_0x3db218=_0x3db218||0x1f4;return function(_0x57f049){logger[_0xa202('0x25')](_0x57f049[_0xa202('0x26')]);if(_0x57f049[_0xa202('0x27')]){delete _0x57f049[_0xa202('0x27')];}_0x23d7cd[_0xa202('0x19')](_0x3db218)[_0xa202('0x28')](_0x57f049);};}exports[_0xa202('0x29')]=function(_0x9382a7,_0x22ba67){var _0x106b89={},_0x213749={},_0x144afd={'count':0x0,'rows':[]};var _0xb0fda6=_[_0xa202('0x2a')](db[_0xa202('0x2b')][_0xa202('0x2c')],function(_0x5b3b40){return{'name':_0x5b3b40[_0xa202('0x2d')],'type':_0x5b3b40[_0xa202('0x2e')][_0xa202('0x2f')]};});_0x213749[_0xa202('0x30')]=_[_0xa202('0x2a')](_0xb0fda6,_0xa202('0x27'));_0x213749['query']=_[_0xa202('0x31')](_0x9382a7[_0xa202('0x32')]);_0x213749['filters']=_[_0xa202('0x33')](_0x213749[_0xa202('0x30')],_0x213749['query']);_0x106b89['attributes']=_['intersection'](_0x213749[_0xa202('0x30')],qs[_0xa202('0x34')](_0x9382a7[_0xa202('0x32')][_0xa202('0x34')]));_0x106b89[_0xa202('0x35')]=_0x106b89['attributes'][_0xa202('0x36')]?_0x106b89['attributes']:_0x213749[_0xa202('0x30')];if(!_0x9382a7[_0xa202('0x32')][_0xa202('0x37')]('nolimit')){_0x106b89[_0xa202('0x1c')]=qs['limit'](_0x9382a7['query'][_0xa202('0x1c')]);_0x106b89[_0xa202('0x1b')]=qs['offset'](_0x9382a7[_0xa202('0x32')]['offset']);}_0x106b89['order']=qs[_0xa202('0x38')](_0x9382a7[_0xa202('0x32')]['sort']);_0x106b89[_0xa202('0x39')]=qs[_0xa202('0x3a')](_[_0xa202('0x3b')](_0x9382a7['query'],_0x213749[_0xa202('0x3a')]),_0xb0fda6);if(_0x9382a7[_0xa202('0x32')][_0xa202('0x3c')]){_0x106b89[_0xa202('0x39')]=_[_0xa202('0x3d')](_0x106b89[_0xa202('0x39')],{'$or':_[_0xa202('0x2a')](_0xb0fda6,function(_0x3c480f){if(_0x3c480f[_0xa202('0x2e')]!==_0xa202('0x3e')){var _0x387764={};_0x387764[_0x3c480f[_0xa202('0x27')]]={'$like':'%'+_0x9382a7['query']['filter']+'%'};return _0x387764;}})});}_0x106b89=_[_0xa202('0x3d')]({},_0x106b89,_0x9382a7[_0xa202('0x3f')]);var _0x24d2ae={'where':_0x106b89[_0xa202('0x39')]};return db[_0xa202('0x2b')][_0xa202('0x1e')](_0x24d2ae)[_0xa202('0x24')](function(_0x3bca66){_0x144afd[_0xa202('0x1e')]=_0x3bca66;if(_0x9382a7[_0xa202('0x32')]['includeAll']){_0x106b89[_0xa202('0x40')]=[{'all':!![]}];}return db[_0xa202('0x2b')]['findAll'](_0x106b89);})['then'](function(_0x4f783c){_0x144afd[_0xa202('0x41')]=_0x4f783c;return _0x144afd;})[_0xa202('0x24')](respondWithFilteredResult(_0x22ba67,_0x106b89))[_0xa202('0x42')](handleError(_0x22ba67,null));};exports[_0xa202('0x43')]=function(_0x5035e2,_0x211c1b){var _0x220888={'raw':![],'where':{'id':_0x5035e2[_0xa202('0x44')]['id']}},_0x19714b={};_0x19714b['model']=_[_0xa202('0x31')](db[_0xa202('0x2b')][_0xa202('0x2c')]);_0x19714b['query']=_[_0xa202('0x31')](_0x5035e2[_0xa202('0x32')]);_0x19714b[_0xa202('0x3a')]=_[_0xa202('0x33')](_0x19714b[_0xa202('0x30')],_0x19714b[_0xa202('0x32')]);_0x220888[_0xa202('0x35')]=_[_0xa202('0x33')](_0x19714b[_0xa202('0x30')],qs[_0xa202('0x34')](_0x5035e2[_0xa202('0x32')][_0xa202('0x34')]));_0x220888['attributes']=_0x220888[_0xa202('0x35')][_0xa202('0x36')]?_0x220888[_0xa202('0x35')]:_0x19714b[_0xa202('0x30')];if(_0x5035e2[_0xa202('0x32')][_0xa202('0x45')]){_0x220888[_0xa202('0x40')]=[{'all':!![]}];}_0x220888=_[_0xa202('0x3d')]({},_0x220888,_0x5035e2['options']);return db[_0xa202('0x2b')][_0xa202('0x46')](_0x220888)[_0xa202('0x24')](handleEntityNotFound(_0x211c1b,null))['then'](respondWithResult(_0x211c1b,null))[_0xa202('0x42')](handleError(_0x211c1b,null));};exports[_0xa202('0x47')]=function(_0xc72f62,_0x55cfc5){return db[_0xa202('0x2b')][_0xa202('0x47')](_0xc72f62[_0xa202('0x48')],{})[_0xa202('0x24')](respondWithResult(_0x55cfc5,0xc9))[_0xa202('0x42')](handleError(_0x55cfc5,null));};exports[_0xa202('0x49')]=function(_0x1d118b,_0x3f972b){var _0x2bf061={'where':{'id':_0x1d118b[_0xa202('0x44')]['id']}},_0x17407e={};_0x17407e['model']=_[_0xa202('0x31')](db[_0xa202('0x2b')][_0xa202('0x2c')]);_0x2bf061['attributes']=_['intersection'](_0x17407e[_0xa202('0x30')],qs[_0xa202('0x34')](_0x1d118b['query'][_0xa202('0x34')]));_0x2bf061[_0xa202('0x35')]=_0x2bf061['attributes'][_0xa202('0x36')]?_0x2bf061[_0xa202('0x35')]:_0x17407e[_0xa202('0x30')];if(_0x1d118b[_0xa202('0x32')]['includeAll']){_0x2bf061[_0xa202('0x40')]=[{'all':!![]}];}_0x2bf061=_['merge']({},_0x2bf061,_0x1d118b['options']);return db[_0xa202('0x2b')]['find'](_0x2bf061)['then'](handleEntityNotFound(_0x3f972b,null))[_0xa202('0x24')](function(_0x51953a){if(_0x51953a){var _0x56da5b=_0x51953a[_0xa202('0x4a')]({'plain':!![]});_0x56da5b=qs[_0xa202('0x4b')](_0x56da5b,['id',_0xa202('0x4c'),_0xa202('0x4d'),_0xa202('0x4e')]);_0x1d118b[_0xa202('0x48')]=_[_0xa202('0x4b')](_0x1d118b['body'],['id',_0xa202('0x4c'),_0xa202('0x4d')]);return db[_0xa202('0x4f')][_0xa202('0x50')](function(_0x188480){return db[_0xa202('0x2b')][_0xa202('0x47')](_['merge'](_0x56da5b,_0x1d118b[_0xa202('0x48')]),{'include':_0x1d118b[_0xa202('0x32')][_0xa202('0x45')]?[{'all':!![]}]:undefined,'transaction':_0x188480})['then'](function(_0x511033){var _0x5ba827=_0x511033[_0xa202('0x4a')]({'plain':!![]});return db[_0xa202('0x51')][_0xa202('0x52')]({'where':{'userProfileId':_0x1d118b[_0xa202('0x44')]['id']},'raw':!![]})[_0xa202('0x24')](function(_0x1bc9bc){if(_0x1bc9bc){return BPromise[_0xa202('0x53')](_0x1bc9bc,function(_0x1f3677){return new BPromise(function(_0x42bb2f,_0x590ebe){if(_0x1f3677[_0xa202('0x54')]===null||_0x1f3677['autoAssociation']===0x1)_0x42bb2f(null);return db[_0xa202('0x55')][_0xa202('0x52')]({'where':{'sectionId':_0x1f3677['id']},'raw':!![]})[_0xa202('0x24')](function(_0x1893bf){var _0x30fc65=_['map'](_0x1893bf,function(_0xa742bf){return qs[_0xa202('0x4b')](_0xa742bf,['id','createdAt',_0xa202('0x4d'),'sectionId']);});_0x42bb2f(_0x30fc65);})[_0xa202('0x42')](function(_0x530b90){_0x590ebe(_0x530b90);});})['then'](function(_0x248d1c){var _0x24e526=qs[_0xa202('0x4b')](_0x1f3677,['id',_0xa202('0x4c'),_0xa202('0x4d')]);_0x24e526['userProfileId']=_0x5ba827['id'];if(_0x248d1c)_0x24e526['Resources']=_0x248d1c;return _0x24e526;})['then'](function(_0x584072){return db[_0xa202('0x51')][_0xa202('0x47')](_0x584072,{'include':[{'model':db[_0xa202('0x55')],'as':_0xa202('0x56')}],'raw':!![],'transaction':_0x188480});});})['then'](function(){return _0x5ba827;});}});});});}})['then'](respondWithResult(_0x3f972b,0xc9))['catch'](handleError(_0x3f972b,null));};exports[_0xa202('0x22')]=function(_0x34eab8,_0x4c0fa7){if(_0x34eab8[_0xa202('0x48')]['id']){delete _0x34eab8[_0xa202('0x48')]['id'];}return db['UserProfile']['find']({'where':{'id':_0x34eab8[_0xa202('0x44')]['id']}})['then'](handleEntityNotFound(_0x4c0fa7,null))[_0xa202('0x24')](saveUpdates(_0x34eab8[_0xa202('0x48')],null))[_0xa202('0x24')](respondWithResult(_0x4c0fa7,null))['catch'](handleError(_0x4c0fa7,null));};exports[_0xa202('0x23')]=function(_0xa51569,_0xe7e475){return db['UserProfile'][_0xa202('0x46')]({'where':{'id':_0xa51569[_0xa202('0x44')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0xe7e475,null))[_0xa202('0x24')](removeEntity(_0xe7e475,null))['catch'](handleError(_0xe7e475,null));};exports[_0xa202('0x57')]=function(_0x588f96,_0x4794e2){return db[_0xa202('0x2b')][_0xa202('0x57')]()['then'](respondWithResult(_0x4794e2,null))['catch'](handleError(_0x4794e2,null));};exports[_0xa202('0x58')]=function(_0x771f2e,_0x5496b7){var _0x5ac40c=_0x771f2e['body'];return db[_0xa202('0x2b')]['find']({'where':{'id':_0x771f2e[_0xa202('0x44')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x5496b7,null))[_0xa202('0x24')](function(_0x14d17d){if(_0x14d17d){return db[_0xa202('0x4f')][_0xa202('0x50')](function(_0x3c731c){return db[_0xa202('0x51')][_0xa202('0x23')]({'where':{'userProfileId':_0x771f2e[_0xa202('0x44')]['id'],'sectionId':_[_0xa202('0x2a')](_0x5ac40c,function(_0x2ba7d9){return _0x2ba7d9[_0xa202('0x59')];})},'transaction':_0x3c731c})[_0xa202('0x24')](function(){var _0x9fc61a=_[_0xa202('0x2a')](_0x5ac40c,function(_0x282fc5){_0x282fc5[_0xa202('0x5a')]=_0x771f2e['params']['id'];return _0x282fc5;});var _0x369061=[];return BPromise[_0xa202('0x53')](_0x9fc61a,function(_0x105c94){return db['UserProfileSection']['create'](_0x105c94,{'include':[{'model':db[_0xa202('0x55')],'as':_0xa202('0x56')}],'raw':!![],'transaction':_0x3c731c})[_0xa202('0x24')](function(_0x2e42d9){_0x369061[_0xa202('0x5b')](_0x2e42d9[_0xa202('0x4a')]({'plain':!![]}));});})[_0xa202('0x24')](function(){return _0x369061;});});});}})[_0xa202('0x24')](function(_0x245b2a){return _0x245b2a;})[_0xa202('0x24')](respondWithResult(_0x5496b7,null))[_0xa202('0x42')](handleError(_0x5496b7,null));};exports[_0xa202('0x5c')]=function(_0x874371,_0x268914){var _0x573bd8;return db[_0xa202('0x2b')][_0xa202('0x46')]({'where':{'id':_0x874371['params']['id']},'attributes':['id',_0xa202('0x27')]})[_0xa202('0x24')](handleEntityNotFound(_0x268914,null))['then'](function(_0x4afce1){if(_0x4afce1){_0x573bd8=_0x4afce1;return db[_0xa202('0x51')][_0xa202('0x23')]({'where':{'userProfileId':_0x874371['params']['id'],'sectionId':_0x874371[_0xa202('0x32')][_0xa202('0x5d')]}});}})['then'](function(){return _0x573bd8;})['then'](respondWithStatusCode(_0x268914,null))[_0xa202('0x42')](handleError(_0x268914,null));};exports[_0xa202('0x5e')]=function(_0x4dad05,_0x23ade2){var _0x52cfc2=[];var _0x3990c9=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x4dad05['params']['id']},'raw':!![]})[_0xa202('0x24')](function(_0x5c7a71){_0x52cfc2=_[_0xa202('0x3c')](_0x5c7a71,function(_0x5080e1){return _0x5080e1[_0xa202('0x5f')]===0x1||_[_0xa202('0x60')]([0x3eb,0x709],_0x5080e1[_0xa202('0x59')]);});if(!_[_0xa202('0x61')](_0x52cfc2)){return _[_0xa202('0x2a')](_0x52cfc2,function(_0x3009e6){return _0x3009e6['sectionId'];});}else{return;}})[_0xa202('0x24')](function(_0x28bb11){if(_0x28bb11)_0x3990c9=_0x28bb11;if(_[_0xa202('0x60')](_0x3990c9,0x64)){var _0x1ee182=_[_0xa202('0x46')](_0x52cfc2,{'sectionId':0x64});return hasDefaultDashboard(_0x1ee182)[_0xa202('0x24')](function(_0x20e056){return _[_0xa202('0x2a')](_0x52cfc2,function(_0x4e2851){if(_0x4e2851['sectionId']===0x64){_0x4e2851[_0xa202('0x62')]=_0x20e056;}return _0x4e2851;});});}else{return;}})[_0xa202('0x24')](function(_0x31f58c){if(_0x31f58c)_0x52cfc2=_0x31f58c;if(_['includes'](_0x3990c9,0x3eb)){var _0x6316df=_[_0xa202('0x46')](_0x52cfc2,{'sectionId':0x3eb});return getCustomDashboards(_0x6316df)['then'](function(_0x123a12){return _[_0xa202('0x2a')](_0x52cfc2,function(_0x37c633){if(_0x6316df['enabled']){if(_0x37c633[_0xa202('0x59')]===0x3eb){_0x37c633['subsections']=_0x123a12;}}else{if(_0x37c633['sectionId']===0x64){_0x37c633[_0xa202('0x62')]=_0x123a12;}}return _0x37c633;});});}else{return;}})['then'](function(_0x211521){if(_0x211521)_0x52cfc2=_0x211521;if(_[_0xa202('0x60')](_0x3990c9,0x709)){var _0x40c2a7=_['find'](_0x52cfc2,{'sectionId':0x709});return getPlugins(_0x40c2a7)[_0xa202('0x24')](function(_0x51d20b){if(_0x40c2a7['enabled']){return _[_0xa202('0x2a')](_0x52cfc2,function(_0x3f8607){if(_0x3f8607['sectionId']===0x709){_0x3f8607[_0xa202('0x62')]=_0x51d20b;}return _0x3f8607;});}else{var _0x33d43d={'sectionId':0x76c,'enabled':0x1,'subsections':_0x51d20b};var _0x204b0d=_['map'](_0x52cfc2);_0x204b0d[_0xa202('0x5b')](_0x33d43d);return _0x204b0d;}});}else{return;}})[_0xa202('0x24')](function(_0x46b74d){if(_0x46b74d)_0x52cfc2=_0x46b74d;return _[_0xa202('0x3c')](_0x52cfc2,[_0xa202('0x5f'),0x1]);})[_0xa202('0x24')](respondWithResult(_0x23ade2,null))[_0xa202('0x42')](handleError(_0x23ade2,null));};function hasDefaultDashboard(_0x446cdb){var _0x5b1a30=[0x65];return new BPromise(function(_0x14a5db,_0x57a47a){try{if(_0x446cdb['autoAssociation']){_0x14a5db(_0x5b1a30);}else{return db[_0xa202('0x55')]['findOne']({'where':{'sectionId':_0x446cdb['id']},'raw':!![]})['then'](function(_0x490881){_0x490881?_0x14a5db(_0x5b1a30):_0x14a5db();});}}catch(_0x207191){_0x57a47a(_0x207191);}});}function getCustomDashboards(_0x18a0a4){var _0x406805=[];return new BPromise(function(_0x5c5aee,_0x1c397e){try{if(_0x18a0a4[_0xa202('0x54')]){return db['Dashboard'][_0xa202('0x52')]({'raw':!![]})[_0xa202('0x24')](function(_0x526805){_0x526805[_0xa202('0x63')](function(_0x41c54f){_0x406805['push'](_0x41c54f['id']+0x1869f);});_0x5c5aee(_0x406805);});}else{return db['UserProfileResource'][_0xa202('0x52')]({'where':{'sectionId':_0x18a0a4['id']},'raw':!![]})[_0xa202('0x24')](function(_0x3b0664){_0x3b0664['forEach'](function(_0x451059){_0x406805[_0xa202('0x5b')](_0x451059['resourceId']+0x1869f);});_0x5c5aee(_0x406805);});}}catch(_0x1c2c22){_0x1c397e(_0x1c2c22);}});}function getPlugins(_0x1d1898){var _0x3c4e2d=[];return new BPromise(function(_0x25fb32,_0x346d6a){try{if(_0x1d1898[_0xa202('0x54')]){return db['Plugin']['findAll']({'raw':!![]})[_0xa202('0x24')](function(_0x25352c){_0x25352c['forEach'](function(_0x490054){_0x3c4e2d[_0xa202('0x5b')](_0x490054['id']+0x15b38);});_0x25fb32(_0x3c4e2d);});}else{return db[_0xa202('0x55')][_0xa202('0x52')]({'where':{'sectionId':_0x1d1898['id']},'raw':!![]})[_0xa202('0x24')](function(_0x48ebc3){_0x48ebc3[_0xa202('0x63')](function(_0x41f18c){_0x3c4e2d[_0xa202('0x5b')](_0x41f18c[_0xa202('0x64')]+0x15b38);});_0x25fb32(_0x3c4e2d);});}}catch(_0x1806f9){_0x346d6a(_0x1806f9);}});}exports[_0xa202('0x65')]=function(_0x3f3dca,_0x3adb2c){return db['UserProfile']['find']({'where':{'id':_0x3f3dca[_0xa202('0x44')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x3adb2c,null))['then'](function(_0x5a5d3f){if(_0x5a5d3f){return db['sequelize']['transaction'](function(_0x312b7b){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3f3dca['params']['id']},'attributes':['id'],'raw':!![]})[_0xa202('0x24')](function(_0x571b78){if(_0x571b78){return db[_0xa202('0x51')][_0xa202('0x23')]({'where':{'userProfileId':_0x3f3dca[_0xa202('0x44')]['id'],'id':_[_0xa202('0x2a')](_0x571b78,function(_0x2e4c31){return _0x2e4c31['id'];})},'transaction':_0x312b7b});}})[_0xa202('0x24')](function(_0x20d7f0){var _0xb640e2=_['map'](_0x3f3dca[_0xa202('0x48')],function(_0x3329ef){_0x3329ef[_0xa202('0x5a')]=_0x3f3dca[_0xa202('0x44')]['id'];return _0x3329ef;});return db[_0xa202('0x51')][_0xa202('0x66')](_0xb640e2,{'raw':!![],'transaction':_0x312b7b});})[_0xa202('0x24')](function(_0x5426ee){var _0x34e925=_[_0xa202('0x3c')](_['map'](_0x5426ee,function(_0x138203){return _0x138203[_0xa202('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x34e925){return db[_0xa202('0x51')][_0xa202('0x52')]({'where':{'userProfileId':_0x3f3dca[_0xa202('0x44')]['id'],'sectionId':_[_0xa202('0x2a')](_0x34e925,function(_0x258b46){return _0x258b46[_0xa202('0x59')];})},'attributes':['id',_0xa202('0x59')],'raw':!![]})['then'](function(_0x23a649){var _0x1a2d95=_['map'](_0x3f3dca['body'],function(_0x12ee5c){_0x12ee5c[_0xa202('0x5a')]=_0x3f3dca[_0xa202('0x44')]['id'];return _0x12ee5c;});return db['UserProfileResource']['bulkCreate'](_0x1a2d95,{'raw':!![],'transaction':_0x312b7b});});}})[_0xa202('0x42')](handleError(_0x3adb2c,null));});}})[_0xa202('0x24')](function(_0x2b8e79){var _0xc4a75=_['map'](_0x2b8e79,function(_0x564e39){return _0x564e39[_0xa202('0x4a')]({'plain':!![]});});})[_0xa202('0x24')](respondWithResult(_0x3adb2c,null))[_0xa202('0x42')](handleError(_0x3adb2c,null));};exports[_0xa202('0x67')]=function(_0x144a30,_0x1e26f0,_0x5c0b2f){return db[_0xa202('0x2b')][_0xa202('0x46')]({'where':{'id':_0x144a30[_0xa202('0x44')]['id']}})[_0xa202('0x24')](handleEntityNotFound(_0x1e26f0,null))[_0xa202('0x24')](function(_0x868a4e){if(_0x868a4e){return _0x868a4e['removeResources'](_0x144a30[_0xa202('0x32')][_0xa202('0x5d')]);}})[_0xa202('0x24')](respondWithStatusCode(_0x1e26f0,null))[_0xa202('0x42')](handleError(_0x1e26f0,null));};exports[_0xa202('0x68')]=function(_0x5c52a7,_0x46cd39){var _0x3b18a5={};if(!_0x5c52a7[_0xa202('0x32')]['section'])throw new Error(_0xa202('0x69'));if(!_0x5c52a7['query']['hasOwnProperty']('nolimit')){_0x3b18a5[_0xa202('0x1c')]=qs[_0xa202('0x1c')](_0x5c52a7[_0xa202('0x32')][_0xa202('0x1c')]);_0x3b18a5[_0xa202('0x1b')]=qs[_0xa202('0x1b')](_0x5c52a7[_0xa202('0x32')]['offset']);}return db['UserProfile'][_0xa202('0x46')]({'where':{'id':_0x5c52a7[_0xa202('0x44')]['id']}})[_0xa202('0x24')](function(_0x166ab7){if(!_0x166ab7)throw new Error('No\x20User\x20Profile\x20found\x20for\x20id\x20'+_0x5c52a7[_0xa202('0x44')]['id']);return db[_0xa202('0x2b')][_0xa202('0x68')](_0x5c52a7);})[_0xa202('0x24')](respondWithFilteredResult(_0x46cd39,_0x3b18a5))[_0xa202('0x42')](handleError(_0x46cd39,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 75bbc6d..321dde8 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 _0xacc6=['emit','hasOwnProperty','exports','events','../../mysqldb','UserProfile','setMaxListeners','save','remove'];(function(_0x32f6b9,_0x2d4aa9){var _0x267d52=function(_0x10f74f){while(--_0x10f74f){_0x32f6b9['push'](_0x32f6b9['shift']());}};_0x267d52(++_0x2d4aa9);}(_0xacc6,0x150));var _0x6acc=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xacc6[_0x1d9aa0];return _0x226868;};'use strict';var EventEmitter=require(_0x6acc('0x0'));var UserProfile=require(_0x6acc('0x1'))['db'][_0x6acc('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x6acc('0x3')](0x0);var events={'afterCreate':_0x6acc('0x4'),'afterUpdate':'update','afterDestroy':_0x6acc('0x5')};function emitEvent(_0x14a0d1){return function(_0x2ff2ff,_0x53dcdb,_0x148455){UserProfileEvents['emit'](_0x14a0d1+':'+_0x2ff2ff['id'],_0x2ff2ff);UserProfileEvents[_0x6acc('0x6')](_0x14a0d1,_0x2ff2ff);_0x148455(null);};}for(var e in events){if(events[_0x6acc('0x7')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x6acc('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x6003=['../../mysqldb','UserProfile','setMaxListeners','remove','emit','hasOwnProperty','events'];(function(_0x760e86,_0x3c615d){var _0x2cd949=function(_0x493495){while(--_0x493495){_0x760e86['push'](_0x760e86['shift']());}};_0x2cd949(++_0x3c615d);}(_0x6003,0xae));var _0x3600=function(_0x536c29,_0x5abbfb){_0x536c29=_0x536c29-0x0;var _0xb01ef3=_0x6003[_0x536c29];return _0xb01ef3;};'use strict';var EventEmitter=require(_0x3600('0x0'));var UserProfile=require(_0x3600('0x1'))['db'][_0x3600('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x3600('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3600('0x4')};function emitEvent(_0x3fb36b){return function(_0x29c0fd,_0x47b8b3,_0x29fadd){UserProfileEvents[_0x3600('0x5')](_0x3fb36b+':'+_0x29c0fd['id'],_0x29c0fd);UserProfileEvents['emit'](_0x3fb36b,_0x29c0fd);_0x29fadd(null);};}for(var e in events){if(events[_0x3600('0x6')](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 324296a..7f8c0d7 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 _0xdb28=['slice','Sequelize','QueryTypes','SELECT','ui.','InteractionId','ui.createdAt','user_has_','_interactions','where','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','mergeResources','Invalid\x20section\x20\x27','length','push','UserProfileSection','find','all','isEmpty','union','ignore','autoAssociation','keys','filters','intersection','attributes','fields','nolimit','limit','offset','order','sort','merge','key','VIRTUAL','foreignKey','forEach','options','includeAll','include','reportType','default','DefaultReports','custom','CustomReports','rows','count','Tags','color','tag','ThroughTags','Agents','openTabs','chat','dataValues','fax','mail','openchannel','lodash','./userProfile.attributes','../../components/parsers/qs','squel','models','filter','field','value','findAll','then','map','catch','model','associatedResources','name','resolve','UserProfileResource','AnalyticExtractedReport','resourceId','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projectName','JscriptyProject','contacts','CmContact','Lists','ListId','lists','CmList','CmCompany','globalcustomfields','chatqueues','ChatQueue','chatwebsites','FaxQueue','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','inbound','QueueCampaigns','VoiceQueue','type','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','users','agents','telephones','Users','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','sounds','Sound','Tag','templates','Template','Trigger','trunks','Trunk','variables','Variable','plugins','Plugin','Reports','reportId','AnalyticMetric','charAt','toUpperCase'];(function(_0x2e1b4e,_0x464045){var _0x3ce7a9=function(_0x24ead3){while(--_0x24ead3){_0x2e1b4e['push'](_0x2e1b4e['shift']());}};_0x3ce7a9(++_0x464045);}(_0xdb28,0x106));var _0x8db2=function(_0x18e63c,_0x298adb){_0x18e63c=_0x18e63c-0x0;var _0x275284=_0xdb28[_0x18e63c];return _0x275284;};'use strict';var _=require(_0x8db2('0x0'));var attributes=require(_0x8db2('0x1'));var qs=require(_0x8db2('0x2'));var squel=require(_0x8db2('0x3'));module['exports']=function(_0x1f4c45){var _0x11c26d=_0x1f4c45[_0x8db2('0x4')];function _0x4426fe(_0x11109e,_0x52bf99){return new Promise(function(_0x21a03e,_0x1d2dd3){if(!_0x52bf99)return _0x21a03e(null);var _0x5f42ee=_0x52bf99['filter']?{[_0x52bf99[_0x8db2('0x5')][_0x8db2('0x6')]]:_0x52bf99[_0x8db2('0x5')][_0x8db2('0x7')]}:undefined;return _0x11c26d[_0x11109e][_0x8db2('0x8')]({'where':_0x5f42ee,'raw':!![]})[_0x8db2('0x9')](function(_0x126c78){_0x52bf99['associatedResources']=_[_0x8db2('0xa')](_0x126c78,'id');_0x21a03e(_0x52bf99);})[_0x8db2('0xb')](function(_0x1f62af){_0x1d2dd3(_0x1f62af);});});}function _0x57015f(_0x1d9371,_0x150942){return new Promise(function(_0x576475,_0x41beda){var _0x3b2faa=_0x1d9371[_0x8db2('0x5')]?{[_0x1d9371[_0x8db2('0x5')][_0x8db2('0x6')]]:_0x1d9371['filter']['value']}:undefined;return _0x11c26d[_0x1d9371[_0x8db2('0xc')]][_0x8db2('0x8')]({'where':_0x3b2faa,'raw':!![]})[_0x8db2('0x9')](function(_0x1d6a15){_0x150942[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x1d6a15,function(_0x2f177a){return _0x2f177a[_0x8db2('0xe')];});_0x576475(_0x150942);})[_0x8db2('0xb')](function(_0x16c8c2){_0x41beda(_0x16c8c2);});});}function _0x5489a9(_0x13b0f5,_0x24da1b,_0x48101e){if(!_0x24da1b)return Promise[_0x8db2('0xf')](null);return new Promise(function(_0x44957d,_0x21db8c){return _0x11c26d[_0x8db2('0x10')][_0x8db2('0x8')]({'where':{'sectionId':_0x24da1b['id']},'raw':!![]})[_0x8db2('0x9')](function(_0x51d60d){if(_0x13b0f5['field']&&_0x13b0f5[_0x8db2('0x6')]!=='id'){_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x1b64e4){return _0x1b64e4[_0x13b0f5['field']];});}else{if(_0x48101e===_0x8db2('0x11')){_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x297ba3){return{'id':_0x297ba3[_0x8db2('0x12')],'type':_0x297ba3['type']};});}else{_0x24da1b[_0x8db2('0xd')]=_[_0x8db2('0xa')](_0x51d60d,function(_0x18f69c){return _0x18f69c[_0x8db2('0x12')];});}}_0x44957d(_0x24da1b);})[_0x8db2('0xb')](function(_0x21704c){_0x21db8c(_0x21704c);});});}function _0x796ec1(_0x5c6614,_0x256202){var _0x4f6516={'parentSections':[]};switch(_0x5c6614['toLowerCase']()){case'squareprojects':_0x4f6516['childModel']=_0x8db2('0x13');break;case _0x8db2('0x14'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x16');break;case _0x8db2('0x17'):_0x4f6516[_0x8db2('0x15')]='SquareRecording';_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x19'),'field':_0x8db2('0xe'),'foreignKey':_0x8db2('0x1a')}];break;case'projects':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x1b');break;case _0x8db2('0x1c'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x1d');_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x1e'),'field':'id','foreignKey':_0x8db2('0x1f')}];break;case _0x8db2('0x20'):_0x4f6516['childModel']=_0x8db2('0x21');break;case'companies':_0x4f6516['childModel']=_0x8db2('0x22');break;case _0x8db2('0x23'):_0x4f6516[_0x8db2('0x15')]='CmCustomField';break;case _0x8db2('0x24'):_0x4f6516['childModel']=_0x8db2('0x25');break;case _0x8db2('0x26'):_0x4f6516[_0x8db2('0x15')]='ChatWebsite';break;case'faxqueues':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x27');break;case'faxaccounts':_0x4f6516['childModel']=_0x8db2('0x28');break;case _0x8db2('0x29'):case _0x8db2('0x2a'):case _0x8db2('0x2b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x2c');break;case _0x8db2('0x2d'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x2e');break;case _0x8db2('0x2f'):_0x4f6516['childModel']=_0x8db2('0x30');break;case _0x8db2('0x31'):_0x4f6516['childModel']=_0x8db2('0x32');_0x4f6516[_0x8db2('0x18')]=[{'name':'Agents','field':'name','foreignKey':_0x8db2('0x33'),'model':'User','filter':{'field':_0x8db2('0x34'),'value':[_0x8db2('0x35')]}},{'name':_0x8db2('0x36'),'field':_0x8db2('0xe'),'foreignKey':'membername','model':_0x8db2('0x37'),'filter':{'field':'role','value':[_0x8db2('0x38')]}},{'name':_0x8db2('0x39'),'field':_0x8db2('0xe'),'foreignKey':_0x8db2('0x3a'),'model':'VoiceQueue','filter':{'field':'type','value':[_0x8db2('0x3b')]}},{'name':_0x8db2('0x3c'),'field':'name','foreignKey':_0x8db2('0x3a'),'model':_0x8db2('0x3d'),'filter':{'field':_0x8db2('0x3e'),'value':['outbound']}}];break;case _0x8db2('0x3f'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x40');break;case _0x8db2('0x41'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x42');break;case _0x8db2('0x43'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x44');break;case _0x8db2('0x45'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x46');break;case _0x8db2('0x47'):_0x4f6516['childModel']=_0x8db2('0x48');break;case _0x8db2('0x49'):_0x4f6516['childModel']='MailAccount';break;case _0x8db2('0x4a'):_0x4f6516['childModel']=_0x8db2('0x4b');break;case _0x8db2('0x4c'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x4d');break;case _0x8db2('0x4e'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x4f');break;case'smsqueues':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x50');break;case _0x8db2('0x51'):_0x4f6516[_0x8db2('0x15')]='SmsAccount';break;case _0x8db2('0x52'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x53');break;case _0x8db2('0x54'):_0x4f6516['childModel']=_0x8db2('0x55');break;case'teams':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x56');break;case _0x8db2('0x57'):case'queuecampaigns':_0x4f6516['childModel']=_0x8db2('0x3d');if(_0x256202){_0x4f6516['parentSections']=[{'name':_0x8db2('0x39')},{'name':_0x8db2('0x3c')}];}break;case _0x8db2('0x58'):case _0x8db2('0x59'):case _0x8db2('0x5a'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x37');if(_0x256202){_0x4f6516[_0x8db2('0x18')]=[{'name':_0x8db2('0x5b'),'filter':{'field':_0x8db2('0x34'),'value':[_0x8db2('0x5c'),_0x8db2('0x5d')]},'ignore':!![]},{'name':'Agents'},{'name':_0x8db2('0x36')}];}break;case _0x8db2('0x5e'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x5f');break;case'salesforceaccounts':_0x4f6516['childModel']=_0x8db2('0x60');break;case _0x8db2('0x61'):_0x4f6516[_0x8db2('0x15')]='FreshdeskAccount';break;case'sugarcrmaccounts':_0x4f6516['childModel']=_0x8db2('0x62');break;case _0x8db2('0x63'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x64');break;case _0x8db2('0x65'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x66');break;case'vtigeraccounts':_0x4f6516['childModel']=_0x8db2('0x37');break;case _0x8db2('0x67'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x68');break;case _0x8db2('0x69'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6a');break;case _0x8db2('0x6b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6c');break;case _0x8db2('0x6d'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x6e');break;case _0x8db2('0x6f'):_0x4f6516[_0x8db2('0x15')]='Pause';break;case _0x8db2('0x70'):_0x4f6516[_0x8db2('0x15')]='Schedule';break;case _0x8db2('0x71'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x72');break;case'tags':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x73');break;case _0x8db2('0x74'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x75');break;case'triggers':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x76');break;case _0x8db2('0x77'):_0x4f6516['childModel']=_0x8db2('0x78');break;case _0x8db2('0x79'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7a');break;case _0x8db2('0x7b'):_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7c');break;case'extractedreports':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x11');_0x4f6516['parentSections']=[{'name':_0x8db2('0x7d'),'field':'id','foreignKey':_0x8db2('0x7e')}];break;case'metrics':_0x4f6516[_0x8db2('0x15')]=_0x8db2('0x7f');break;}return _0x4f6516;}function _0x63e8f7(_0x30f4f3,_0x42b941){var _0x3c7d8c=_0x30f4f3[_0x8db2('0x80')](0x0)[_0x8db2('0x81')]()+_0x30f4f3[_0x8db2('0x82')](0x1);var _0x173a5e={'type':_0x11c26d[_0x8db2('0x83')][_0x8db2('0x84')][_0x8db2('0x85')],'raw':!![]};return new Promise(function(_0x1ce89f,_0x64ec90){var _0x105a53=squel['select']()[_0x8db2('0x6')](_0x8db2('0x86')+_0x3c7d8c+_0x8db2('0x87'),'id')[_0x8db2('0x6')](_0x8db2('0x88'))['from'](_0x8db2('0x89')+_0x30f4f3+_0x8db2('0x8a'),'ui')[_0x8db2('0x8b')](_0x8db2('0x8c'),_0x42b941['id']);return _0x11c26d[_0x8db2('0x8d')][_0x8db2('0x8e')](_0x105a53[_0x8db2('0x8f')](),_0x173a5e)[_0x8db2('0x9')](function(_0x24cfe9){_0x42b941[_0x3c7d8c+_0x8db2('0x90')]=_0x24cfe9;_0x1ce89f(_0x24cfe9);})[_0x8db2('0xb')](function(_0xfe6bac){_0x64ec90(_0xfe6bac);});});}return _0x1f4c45[_0x8db2('0x91')](_0x8db2('0x92'),attributes,{'tableName':_0x8db2('0x93'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x270fc0){var _0x1d7862={'raw':![],'where':{}};var _0xefb12={};var _0x5a719f={'count':0x0,'rows':[]};var _0x3273dd=_0x270fc0['query'][_0x8db2('0x94')];var _0x570c53=_0x270fc0[_0x8db2('0x8e')][_0x8db2('0x95')]||![];var _0xe4fd6a=_0x796ec1(_0x3273dd,_0x570c53);if(!_0xe4fd6a[_0x8db2('0x15')])throw new Error(_0x8db2('0x96')+_0x3273dd+'\x27');var _0x59a32e=[{'name':_0x3273dd}];if(!_['isEmpty'](_0xe4fd6a[_0x8db2('0x18')]))_0x59a32e=_0xe4fd6a[_0x8db2('0x18')];var _0x21ec87=[];for(var _0x3ba1d2=0x0;_0x3ba1d2<_0x59a32e[_0x8db2('0x97')];_0x3ba1d2++){_0x21ec87[_0x8db2('0x98')](_0x11c26d[_0x8db2('0x99')][_0x8db2('0x9a')]({'where':{'userProfileId':_0x270fc0['params']['id'],'name':_0x59a32e[_0x3ba1d2][_0x8db2('0xe')]},'raw':!![]}));}return Promise[_0x8db2('0x9b')](_0x21ec87)[_0x8db2('0x9')](function(_0x21521c){var _0x250150=_[_0x8db2('0x5')](_0x21521c,function(_0x451746){return _0x451746?_0x451746:undefined;});var _0x20caf0=_['filter'](_0x59a32e,['ignore',!![]]);var _0x358009=_[_0x8db2('0x9c')](_0x250150)&&_[_0x8db2('0x9c')](_0x20caf0)?null:_[_0x8db2('0x9d')](_0x20caf0,_0x250150);if(!_0x358009)return null;var _0x412801=[];for(var _0x5a074e=0x0;_0x5a074e<_0x358009['length'];_0x5a074e++){var _0x3611da=_[_0x8db2('0x9a')](_0x59a32e,function(_0x54f0d4){return _0x358009[_0x5a074e]?_0x54f0d4[_0x8db2('0xe')]===_0x358009[_0x5a074e][_0x8db2('0xe')]:null;});if(_0x3611da){if(_0x358009[_0x5a074e][_0x8db2('0x9e')]){_0x412801['push'](_0x4426fe(_0xe4fd6a[_0x8db2('0x15')],_0x358009[_0x5a074e]));}else{if(!_0x358009[_0x5a074e][_0x8db2('0x9f')]){_0x412801[_0x8db2('0x98')](_0x5489a9(_0x3611da,_0x358009[_0x5a074e],_0xe4fd6a['childModel']));}else{if(_0x3611da[_0x8db2('0xc')]){_0x412801[_0x8db2('0x98')](_0x57015f(_0x3611da,_0x358009[_0x5a074e]));}}}}}return Promise[_0x8db2('0x9b')](_0x412801);})[_0x8db2('0x9')](function(_0x3a0946){var _0x5923b3=_0x3a0946;var _0x3c9af4=null;if(_0x5923b3){_0x3c9af4=_0x5923b3[_0x8db2('0x97')]===0x1?_0x5923b3[0x0]:null;}if(!_0x3c9af4&&!_0x5923b3)return _0x5a719f;var _0x150439=_0x11c26d[_0xe4fd6a['childModel']]['rawAttributes'];_0xefb12[_0x8db2('0xc')]=_[_0x8db2('0xa0')](_0x150439);_0xefb12['query']=_[_0x8db2('0xa0')](_0x270fc0[_0x8db2('0x8e')]);_0xefb12[_0x8db2('0xa1')]=_[_0x8db2('0xa2')](_0xefb12[_0x8db2('0xc')],_0xefb12[_0x8db2('0x8e')]);_0x1d7862[_0x8db2('0xa3')]=_[_0x8db2('0xa2')](_0xefb12[_0x8db2('0xc')],qs[_0x8db2('0xa4')](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa4')]));_0x1d7862[_0x8db2('0xa3')]=_0x1d7862['attributes'][_0x8db2('0x97')]?_0x1d7862['attributes']:_0xefb12[_0x8db2('0xc')];if(!_0x270fc0[_0x8db2('0x8e')]['hasOwnProperty'](_0x8db2('0xa5'))){_0x1d7862[_0x8db2('0xa6')]=qs['limit'](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa6')]);_0x1d7862[_0x8db2('0xa7')]=qs[_0x8db2('0xa7')](_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xa7')]);}_0x1d7862[_0x8db2('0xa8')]=qs[_0x8db2('0xa9')](_0x270fc0[_0x8db2('0x8e')]['sort']);_0x1d7862['where']=qs[_0x8db2('0xa1')](_['pick'](_0x270fc0[_0x8db2('0x8e')],_0xefb12[_0x8db2('0xa1')]));if(_0x270fc0[_0x8db2('0x8e')]['filter']){_0x1d7862[_0x8db2('0x8b')]=_[_0x8db2('0xaa')](_0x1d7862[_0x8db2('0x8b')],{'$or':_['map'](_0x150439,function(_0x3ae18c){if(_0x3ae18c[_0x8db2('0x3e')][_0x8db2('0xab')]!==_0x8db2('0xac')){var _0x48a618={};_0x48a618[_0x3ae18c[_0x8db2('0x6')]]={'$like':'%'+_0x270fc0[_0x8db2('0x8e')][_0x8db2('0x5')]+'%'};return _0x48a618;}})});}var _0x1edb1a=[];var _0xcf1c42=null;var _0x15fd4={};if(_0x3c9af4){_0xcf1c42=_[_0x8db2('0x9a')](_0x59a32e,[_0x8db2('0xe'),_0x3c9af4[_0x8db2('0xe')]]);if(_0xcf1c42[_0x8db2('0x6')]){_0x15fd4={};if(_0xe4fd6a[_0x8db2('0x15')]==='AnalyticExtractedReport'){_0x15fd4[_0xcf1c42[_0x8db2('0xad')]]=_[_0x8db2('0xa')](_0x3c9af4[_0x8db2('0xd')],'id');}else{_0x15fd4[_0xcf1c42['foreignKey']]=_0x3c9af4['associatedResources'];}_0x1edb1a['push'](_0x15fd4);}else{_0x1d7862[_0x8db2('0x8b')]['id']=_0x3c9af4[_0x8db2('0xd')];}}else{for(var _0x3191c8=0x0;_0x3191c8<_0x5923b3[_0x8db2('0x97')];_0x3191c8++){_0xcf1c42=_[_0x8db2('0x9a')](_0x59a32e,[_0x8db2('0xe'),_0x5923b3[_0x3191c8][_0x8db2('0xe')]]);if(_0xcf1c42[_0x8db2('0x6')]){_0x15fd4={};_0x15fd4[_0xcf1c42[_0x8db2('0xad')]]=_0x5923b3[_0x3191c8][_0x8db2('0xd')];_0x1edb1a[_0x8db2('0x98')](_0x15fd4);}else{if(!_0x1d7862['where']['id'])_0x1d7862[_0x8db2('0x8b')]['id']=[];_0x5923b3[_0x3191c8][_0x8db2('0xd')][_0x8db2('0xae')](function(_0x2fb169){_0x1d7862['where']['id']['push'](_0x2fb169);});}}}if(!_[_0x8db2('0x9c')](_0x1edb1a)){_0x1d7862[_0x8db2('0x8b')]=_['merge'](_0x1d7862[_0x8db2('0x8b')],{'$and':{'$or':_0x1edb1a}});}_0x1d7862=_[_0x8db2('0xaa')]({},_0x1d7862,_0x270fc0[_0x8db2('0xaf')]);if(_0x3c9af4&&!_0x3c9af4['autoAssociation']&&_0xe4fd6a['childModel']==='AnalyticExtractedReport'){if(_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xb0')]){_0x1d7862[_0x8db2('0xb1')]=[{'all':!![]}];}return _0x11c26d[_0xe4fd6a[_0x8db2('0x15')]][_0x8db2('0x8')](_0x1d7862)['then'](function(_0x30930a){var _0x5e349c=[];_0x30930a[_0x8db2('0xae')](function(_0x353101){var _0xa083b1;switch(_0x353101[_0x8db2('0xb2')]){case _0x8db2('0xb3'):_0xa083b1=_['find'](_0x3c9af4['associatedResources'],function(_0x45cce8){return _0x45cce8['id']===_0x353101['reportId']&&_0x45cce8[_0x8db2('0x3e')]===_0x8db2('0xb4');});break;case _0x8db2('0xb5'):_0xa083b1=_[_0x8db2('0x9a')](_0x3c9af4[_0x8db2('0xd')],function(_0x456d5e){return _0x456d5e['id']===_0x353101['reportId']&&_0x456d5e[_0x8db2('0x3e')]===_0x8db2('0xb6');});break;}if(_0xa083b1)_0x5e349c[_0x8db2('0x98')](_0x353101);});_0x5a719f['count']=_0x5e349c[_0x8db2('0x97')];_0x5a719f[_0x8db2('0xb7')]=_0x5e349c;return _0x5a719f;});}else{return _0x11c26d[_0xe4fd6a['childModel']][_0x8db2('0xb8')]({'where':_0x1d7862[_0x8db2('0x8b')]})[_0x8db2('0x9')](function(_0x15307d){_0x5a719f[_0x8db2('0xb8')]=_0x15307d;if(_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xb0')]){if(_0xe4fd6a[_0x8db2('0x15')]===_0x8db2('0x1d')){_0x1d7862['include']=[{'model':_0x11c26d[_0x8db2('0x73')],'as':_0x8db2('0xb9'),'attributes':['id',_0x8db2('0xe'),_0x8db2('0xba')],'required':_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbb')]?!![]:![]},{'model':_0x11c26d[_0x8db2('0x73')],'as':_0x8db2('0xbc'),'attributes':['id',_0x8db2('0xe'),_0x8db2('0xba')],'through':_0x270fc0['query'][_0x8db2('0xbb')]?{'attributes':[],'where':{'TagId':_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbb')]||undefined}}:{},'required':_0x270fc0[_0x8db2('0x8e')]['tag']?!![]:![]}];}else{_0x1d7862[_0x8db2('0xb1')]=[{'all':!![]}];}}return _0x11c26d[_0xe4fd6a[_0x8db2('0x15')]][_0x8db2('0x8')](_0x1d7862);})['then'](function(_0x59fbe1){_0x5a719f[_0x8db2('0xb7')]=_0x59fbe1;if(_0x3273dd===_0x8db2('0xbd')&&_0x270fc0[_0x8db2('0x8e')][_0x8db2('0xbe')]==='true'){var _0xaa2661=[];for(var _0x3a0e7e=0x0;_0x3a0e7e<_0x5a719f[_0x8db2('0xb7')][_0x8db2('0x97')];_0x3a0e7e++){_0xaa2661['push'](_0x63e8f7(_0x8db2('0xbf'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661['push'](_0x63e8f7('sms',_0x5a719f['rows'][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661[_0x8db2('0x98')](_0x63e8f7(_0x8db2('0xc1'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e]['dataValues']));_0xaa2661['push'](_0x63e8f7(_0x8db2('0xc2'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));_0xaa2661[_0x8db2('0x98')](_0x63e8f7(_0x8db2('0xc3'),_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e]['dataValues']));_0xaa2661[_0x8db2('0x98')](_0x63e8f7('whatsapp',_0x5a719f[_0x8db2('0xb7')][_0x3a0e7e][_0x8db2('0xc0')]));}return Promise[_0x8db2('0x9b')](_0xaa2661)[_0x8db2('0x9')](function(){return _0x5a719f;});}return _0x5a719f;});}});}}});}; \ No newline at end of file +var _0xfdbd=['OpenTabs','UserProfile','user_profiles','section','length','push','find','params','all','ignore','isEmpty','union','autoAssociation','rawAttributes','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','offset','sort','merge','foreignKey','forEach','options','includeAll','include','default','reportId','DefaultReports','custom','count','rows','CmContact','Tags','color','tag','ThroughTags','openTabs','true','chat','dataValues','sms','mail','whatsapp','lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','value','then','associatedResources','map','catch','field','model','findAll','name','resolve','AnalyticExtractedReport','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','squarerecordings','parentSections','SquareProjects','projects','JscriptyProject','contacts','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','membername','User','role','agent','Telephones','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','SmsAccount','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','voicequeues','VoiceQueues','users','agents','telephones','Users','admin','user','Agents','zendeskaccounts','salesforceaccounts','SalesforceAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','Tag','templates','Template','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','AnalyticMetric','charAt','toUpperCase','slice','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','where','sequelize','query'];(function(_0x17616b,_0x2e20d1){var _0x17b948=function(_0x39286a){while(--_0x39286a){_0x17616b['push'](_0x17616b['shift']());}};_0x17b948(++_0x2e20d1);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x47d493,_0x3bedfb){_0x47d493=_0x47d493-0x0;var _0x50242a=_0xfdbd[_0x47d493];return _0x50242a;};'use strict';var _=require(_0xdfdb('0x0'));var attributes=require(_0xdfdb('0x1'));var qs=require(_0xdfdb('0x2'));var squel=require(_0xdfdb('0x3'));module[_0xdfdb('0x4')]=function(_0x3078f0){var _0x11218a=_0x3078f0[_0xdfdb('0x5')];function _0x330ad3(_0x5945e0,_0x3f5b2d){return new Promise(function(_0x4a4a3f,_0x453ef6){if(!_0x3f5b2d)return _0x4a4a3f(null);var _0x41bd5e=_0x3f5b2d['filter']?{[_0x3f5b2d['filter']['field']]:_0x3f5b2d[_0xdfdb('0x6')][_0xdfdb('0x7')]}:undefined;return _0x11218a[_0x5945e0]['findAll']({'where':_0x41bd5e,'raw':!![]})[_0xdfdb('0x8')](function(_0x444c19){_0x3f5b2d[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x444c19,'id');_0x4a4a3f(_0x3f5b2d);})[_0xdfdb('0xb')](function(_0x1ace28){_0x453ef6(_0x1ace28);});});}function _0x2bb8d4(_0x47dccc,_0x28a9f3){return new Promise(function(_0x1972db,_0x527c05){var _0x293714=_0x47dccc[_0xdfdb('0x6')]?{[_0x47dccc[_0xdfdb('0x6')][_0xdfdb('0xc')]]:_0x47dccc[_0xdfdb('0x6')][_0xdfdb('0x7')]}:undefined;return _0x11218a[_0x47dccc[_0xdfdb('0xd')]][_0xdfdb('0xe')]({'where':_0x293714,'raw':!![]})['then'](function(_0x48a66a){_0x28a9f3[_0xdfdb('0x9')]=_['map'](_0x48a66a,function(_0x471ddc){return _0x471ddc[_0xdfdb('0xf')];});_0x1972db(_0x28a9f3);})[_0xdfdb('0xb')](function(_0x40bc8a){_0x527c05(_0x40bc8a);});});}function _0x3bfd81(_0x1cdb8b,_0x54ff23,_0x4fd3d5){if(!_0x54ff23)return Promise[_0xdfdb('0x10')](null);return new Promise(function(_0x8b9193,_0x2c1070){return _0x11218a['UserProfileResource'][_0xdfdb('0xe')]({'where':{'sectionId':_0x54ff23['id']},'raw':!![]})[_0xdfdb('0x8')](function(_0x467653){if(_0x1cdb8b[_0xdfdb('0xc')]&&_0x1cdb8b[_0xdfdb('0xc')]!=='id'){_0x54ff23[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x467653,function(_0x29a639){return _0x29a639[_0x1cdb8b['field']];});}else{if(_0x4fd3d5===_0xdfdb('0x11')){_0x54ff23[_0xdfdb('0x9')]=_[_0xdfdb('0xa')](_0x467653,function(_0x5cc70b){return{'id':_0x5cc70b[_0xdfdb('0x12')],'type':_0x5cc70b[_0xdfdb('0x13')]};});}else{_0x54ff23[_0xdfdb('0x9')]=_['map'](_0x467653,function(_0x280e53){return _0x280e53[_0xdfdb('0x12')];});}}_0x8b9193(_0x54ff23);})[_0xdfdb('0xb')](function(_0x489fd4){_0x2c1070(_0x489fd4);});});}function _0x2a80c1(_0x526057,_0x2db1c1){var _0x145350={'parentSections':[]};switch(_0x526057[_0xdfdb('0x14')]()){case _0xdfdb('0x15'):_0x145350['childModel']=_0xdfdb('0x16');break;case _0xdfdb('0x17'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x19');break;case _0xdfdb('0x1a'):_0x145350[_0xdfdb('0x18')]='SquareRecording';_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x1c'),'field':_0xdfdb('0xf'),'foreignKey':'projectName'}];break;case _0xdfdb('0x1d'):_0x145350['childModel']=_0xdfdb('0x1e');break;case _0xdfdb('0x1f'):_0x145350[_0xdfdb('0x18')]='CmContact';_0x145350['parentSections']=[{'name':_0xdfdb('0x20'),'field':'id','foreignKey':_0xdfdb('0x21')}];break;case _0xdfdb('0x22'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x23');break;case _0xdfdb('0x24'):_0x145350['childModel']=_0xdfdb('0x25');break;case _0xdfdb('0x26'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x27');break;case _0xdfdb('0x28'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x29');break;case _0xdfdb('0x2a'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x2b');break;case _0xdfdb('0x2c'):_0x145350['childModel']='FaxQueue';break;case _0xdfdb('0x2d'):_0x145350['childModel']=_0xdfdb('0x2e');break;case _0xdfdb('0x2f'):case _0xdfdb('0x30'):case _0xdfdb('0x31'):_0x145350['childModel']=_0xdfdb('0x32');break;case'contexts':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x33');break;case _0xdfdb('0x34'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x35');break;case _0xdfdb('0x36'):_0x145350['childModel']=_0xdfdb('0x37');_0x145350[_0xdfdb('0x1b')]=[{'name':'Agents','field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x38'),'model':_0xdfdb('0x39'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x3b')]}},{'name':_0xdfdb('0x3c'),'field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x38'),'model':_0xdfdb('0x39'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x3d')]}},{'name':'VoiceQueues','field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x3e'),'model':_0xdfdb('0x3f'),'filter':{'field':_0xdfdb('0x13'),'value':[_0xdfdb('0x40')]}},{'name':_0xdfdb('0x41'),'field':_0xdfdb('0xf'),'foreignKey':_0xdfdb('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xdfdb('0x42')]}}];break;case _0xdfdb('0x43'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x44');break;case _0xdfdb('0x45'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x46');break;case _0xdfdb('0x47'):_0x145350[_0xdfdb('0x18')]='VoicePrefix';break;case _0xdfdb('0x48'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x49');break;case _0xdfdb('0x4a'):_0x145350[_0xdfdb('0x18')]='MailQueue';break;case _0xdfdb('0x4b'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x4c');break;case _0xdfdb('0x4d'):_0x145350[_0xdfdb('0x18')]='MailSubstatus';break;case _0xdfdb('0x4e'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x4f');break;case'openchannelaccounts':_0x145350[_0xdfdb('0x18')]='OpenchannelAccount';break;case _0xdfdb('0x50'):_0x145350['childModel']=_0xdfdb('0x51');break;case _0xdfdb('0x52'):_0x145350['childModel']=_0xdfdb('0x53');break;case'whatsappqueues':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x54');break;case _0xdfdb('0x55'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x56');break;case'teams':_0x145350['childModel']=_0xdfdb('0x57');break;case _0xdfdb('0x58'):case'queuecampaigns':_0x145350[_0xdfdb('0x18')]='VoiceQueue';if(_0x2db1c1){_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x59')},{'name':_0xdfdb('0x41')}];}break;case _0xdfdb('0x5a'):case _0xdfdb('0x5b'):case _0xdfdb('0x5c'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x39');if(_0x2db1c1){_0x145350[_0xdfdb('0x1b')]=[{'name':_0xdfdb('0x5d'),'filter':{'field':_0xdfdb('0x3a'),'value':[_0xdfdb('0x5e'),_0xdfdb('0x5f')]},'ignore':!![]},{'name':_0xdfdb('0x60')},{'name':_0xdfdb('0x3c')}];}break;case _0xdfdb('0x61'):_0x145350['childModel']='ZendeskAccount';break;case _0xdfdb('0x62'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x63');break;case'freshdeskaccounts':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x64');break;case _0xdfdb('0x65'):_0x145350[_0xdfdb('0x18')]='SugarcrmAccount';break;case _0xdfdb('0x66'):_0x145350[_0xdfdb('0x18')]='DeskAccount';break;case _0xdfdb('0x67'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x68');break;case _0xdfdb('0x69'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x39');break;case _0xdfdb('0x6a'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6b');break;case'dispositions':_0x145350[_0xdfdb('0x18')]='Disposition';break;case _0xdfdb('0x6c'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6d');break;case _0xdfdb('0x6e'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x6f');break;case _0xdfdb('0x70'):_0x145350['childModel']=_0xdfdb('0x71');break;case _0xdfdb('0x72'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x73');break;case _0xdfdb('0x74'):_0x145350['childModel']=_0xdfdb('0x75');break;case'tags':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x76');break;case _0xdfdb('0x77'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x78');break;case'triggers':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x79');break;case'trunks':_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x7a');break;case _0xdfdb('0x7b'):_0x145350['childModel']=_0xdfdb('0x7c');break;case _0xdfdb('0x7d'):_0x145350[_0xdfdb('0x18')]=_0xdfdb('0x7e');break;case _0xdfdb('0x7f'):_0x145350[_0xdfdb('0x18')]='AnalyticExtractedReport';_0x145350['parentSections']=[{'name':_0xdfdb('0x80'),'field':'id','foreignKey':'reportId'}];break;case'metrics':_0x145350['childModel']=_0xdfdb('0x81');break;}return _0x145350;}function _0x273afa(_0x1a9541,_0x1b5f17){var _0x8bd5c0=_0x1a9541[_0xdfdb('0x82')](0x0)[_0xdfdb('0x83')]()+_0x1a9541[_0xdfdb('0x84')](0x1);var _0xb43af={'type':_0x11218a['Sequelize']['QueryTypes'][_0xdfdb('0x85')],'raw':!![]};return new Promise(function(_0x4a9654,_0x3e9f7e){var _0x10fd62=squel[_0xdfdb('0x86')]()['field'](_0xdfdb('0x87')+_0x8bd5c0+_0xdfdb('0x88'),'id')[_0xdfdb('0xc')](_0xdfdb('0x89'))[_0xdfdb('0x8a')](_0xdfdb('0x8b')+_0x1a9541+_0xdfdb('0x8c'),'ui')[_0xdfdb('0x8d')]('ui.UserId\x20=\x20?',_0x1b5f17['id']);return _0x11218a[_0xdfdb('0x8e')][_0xdfdb('0x8f')](_0x10fd62['toString'](),_0xb43af)[_0xdfdb('0x8')](function(_0x425307){_0x1b5f17[_0x8bd5c0+_0xdfdb('0x90')]=_0x425307;_0x4a9654(_0x425307);})[_0xdfdb('0xb')](function(_0x4ca57b){_0x3e9f7e(_0x4ca57b);});});}return _0x3078f0['define'](_0xdfdb('0x91'),attributes,{'tableName':_0xdfdb('0x92'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x4cd890){var _0x1dea5d={'raw':![],'where':{}};var _0x2b8776={};var _0x1cb63d={'count':0x0,'rows':[]};var _0x5ef75a=_0x4cd890['query'][_0xdfdb('0x93')];var _0x4f29b9=_0x4cd890['query']['mergeResources']||![];var _0x1339a9=_0x2a80c1(_0x5ef75a,_0x4f29b9);if(!_0x1339a9['childModel'])throw new Error('Invalid\x20section\x20\x27'+_0x5ef75a+'\x27');var _0x90d435=[{'name':_0x5ef75a}];if(!_['isEmpty'](_0x1339a9[_0xdfdb('0x1b')]))_0x90d435=_0x1339a9[_0xdfdb('0x1b')];var _0x59498e=[];for(var _0x4816bc=0x0;_0x4816bc<_0x90d435[_0xdfdb('0x94')];_0x4816bc++){_0x59498e[_0xdfdb('0x95')](_0x11218a['UserProfileSection'][_0xdfdb('0x96')]({'where':{'userProfileId':_0x4cd890[_0xdfdb('0x97')]['id'],'name':_0x90d435[_0x4816bc][_0xdfdb('0xf')]},'raw':!![]}));}return Promise[_0xdfdb('0x98')](_0x59498e)[_0xdfdb('0x8')](function(_0x5f2942){var _0x5eba53=_[_0xdfdb('0x6')](_0x5f2942,function(_0x2d6be9){return _0x2d6be9?_0x2d6be9:undefined;});var _0x25fd98=_[_0xdfdb('0x6')](_0x90d435,[_0xdfdb('0x99'),!![]]);var _0xe1461f=_['isEmpty'](_0x5eba53)&&_[_0xdfdb('0x9a')](_0x25fd98)?null:_[_0xdfdb('0x9b')](_0x25fd98,_0x5eba53);if(!_0xe1461f)return null;var _0x2662bf=[];for(var _0x30054b=0x0;_0x30054b<_0xe1461f[_0xdfdb('0x94')];_0x30054b++){var _0x1bcfdd=_[_0xdfdb('0x96')](_0x90d435,function(_0x4cdcdc){return _0xe1461f[_0x30054b]?_0x4cdcdc[_0xdfdb('0xf')]===_0xe1461f[_0x30054b][_0xdfdb('0xf')]:null;});if(_0x1bcfdd){if(_0xe1461f[_0x30054b]['ignore']){_0x2662bf[_0xdfdb('0x95')](_0x330ad3(_0x1339a9[_0xdfdb('0x18')],_0xe1461f[_0x30054b]));}else{if(!_0xe1461f[_0x30054b][_0xdfdb('0x9c')]){_0x2662bf[_0xdfdb('0x95')](_0x3bfd81(_0x1bcfdd,_0xe1461f[_0x30054b],_0x1339a9[_0xdfdb('0x18')]));}else{if(_0x1bcfdd['model']){_0x2662bf[_0xdfdb('0x95')](_0x2bb8d4(_0x1bcfdd,_0xe1461f[_0x30054b]));}}}}}return Promise[_0xdfdb('0x98')](_0x2662bf);})[_0xdfdb('0x8')](function(_0x1a31b9){var _0x4999c4=_0x1a31b9;var _0x4769b4=null;if(_0x4999c4){_0x4769b4=_0x4999c4[_0xdfdb('0x94')]===0x1?_0x4999c4[0x0]:null;}if(!_0x4769b4&&!_0x4999c4)return _0x1cb63d;var _0x2b4c29=_0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0x9d')];_0x2b8776[_0xdfdb('0xd')]=_[_0xdfdb('0x9e')](_0x2b4c29);_0x2b8776[_0xdfdb('0x8f')]=_[_0xdfdb('0x9e')](_0x4cd890[_0xdfdb('0x8f')]);_0x2b8776[_0xdfdb('0x9f')]=_['intersection'](_0x2b8776[_0xdfdb('0xd')],_0x2b8776[_0xdfdb('0x8f')]);_0x1dea5d['attributes']=_[_0xdfdb('0xa0')](_0x2b8776[_0xdfdb('0xd')],qs[_0xdfdb('0xa1')](_0x4cd890['query']['fields']));_0x1dea5d['attributes']=_0x1dea5d[_0xdfdb('0xa2')][_0xdfdb('0x94')]?_0x1dea5d[_0xdfdb('0xa2')]:_0x2b8776[_0xdfdb('0xd')];if(!_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa3')](_0xdfdb('0xa4'))){_0x1dea5d['limit']=qs[_0xdfdb('0xa5')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa5')]);_0x1dea5d[_0xdfdb('0xa6')]=qs[_0xdfdb('0xa6')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa6')]);}_0x1dea5d['order']=qs[_0xdfdb('0xa7')](_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xa7')]);_0x1dea5d[_0xdfdb('0x8d')]=qs[_0xdfdb('0x9f')](_['pick'](_0x4cd890[_0xdfdb('0x8f')],_0x2b8776['filters']));if(_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0x6')]){_0x1dea5d[_0xdfdb('0x8d')]=_[_0xdfdb('0xa8')](_0x1dea5d[_0xdfdb('0x8d')],{'$or':_['map'](_0x2b4c29,function(_0x3361b1){if(_0x3361b1[_0xdfdb('0x13')]['key']!=='VIRTUAL'){var _0x284439={};_0x284439[_0x3361b1['field']]={'$like':'%'+_0x4cd890['query'][_0xdfdb('0x6')]+'%'};return _0x284439;}})});}var _0x36d46e=[];var _0x17e4d2=null;var _0x278bff={};if(_0x4769b4){_0x17e4d2=_[_0xdfdb('0x96')](_0x90d435,[_0xdfdb('0xf'),_0x4769b4[_0xdfdb('0xf')]]);if(_0x17e4d2[_0xdfdb('0xc')]){_0x278bff={};if(_0x1339a9['childModel']===_0xdfdb('0x11')){_0x278bff[_0x17e4d2['foreignKey']]=_[_0xdfdb('0xa')](_0x4769b4[_0xdfdb('0x9')],'id');}else{_0x278bff[_0x17e4d2[_0xdfdb('0xa9')]]=_0x4769b4[_0xdfdb('0x9')];}_0x36d46e[_0xdfdb('0x95')](_0x278bff);}else{_0x1dea5d['where']['id']=_0x4769b4[_0xdfdb('0x9')];}}else{for(var _0x64639f=0x0;_0x64639f<_0x4999c4[_0xdfdb('0x94')];_0x64639f++){_0x17e4d2=_[_0xdfdb('0x96')](_0x90d435,[_0xdfdb('0xf'),_0x4999c4[_0x64639f]['name']]);if(_0x17e4d2['field']){_0x278bff={};_0x278bff[_0x17e4d2[_0xdfdb('0xa9')]]=_0x4999c4[_0x64639f][_0xdfdb('0x9')];_0x36d46e['push'](_0x278bff);}else{if(!_0x1dea5d[_0xdfdb('0x8d')]['id'])_0x1dea5d['where']['id']=[];_0x4999c4[_0x64639f][_0xdfdb('0x9')][_0xdfdb('0xaa')](function(_0xeadf25){_0x1dea5d['where']['id'][_0xdfdb('0x95')](_0xeadf25);});}}}if(!_['isEmpty'](_0x36d46e)){_0x1dea5d['where']=_[_0xdfdb('0xa8')](_0x1dea5d['where'],{'$and':{'$or':_0x36d46e}});}_0x1dea5d=_[_0xdfdb('0xa8')]({},_0x1dea5d,_0x4cd890[_0xdfdb('0xab')]);if(_0x4769b4&&!_0x4769b4[_0xdfdb('0x9c')]&&_0x1339a9[_0xdfdb('0x18')]===_0xdfdb('0x11')){if(_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xac')]){_0x1dea5d[_0xdfdb('0xad')]=[{'all':!![]}];}return _0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0xe')](_0x1dea5d)['then'](function(_0x5d2dc1){var _0xb48246=[];_0x5d2dc1['forEach'](function(_0x58e7ba){var _0x5542da;switch(_0x58e7ba['reportType']){case _0xdfdb('0xae'):_0x5542da=_[_0xdfdb('0x96')](_0x4769b4[_0xdfdb('0x9')],function(_0x3fe730){return _0x3fe730['id']===_0x58e7ba[_0xdfdb('0xaf')]&&_0x3fe730[_0xdfdb('0x13')]===_0xdfdb('0xb0');});break;case _0xdfdb('0xb1'):_0x5542da=_[_0xdfdb('0x96')](_0x4769b4[_0xdfdb('0x9')],function(_0x396b3a){return _0x396b3a['id']===_0x58e7ba[_0xdfdb('0xaf')]&&_0x396b3a[_0xdfdb('0x13')]==='CustomReports';});break;}if(_0x5542da)_0xb48246['push'](_0x58e7ba);});_0x1cb63d[_0xdfdb('0xb2')]=_0xb48246[_0xdfdb('0x94')];_0x1cb63d[_0xdfdb('0xb3')]=_0xb48246;return _0x1cb63d;});}else{return _0x11218a[_0x1339a9[_0xdfdb('0x18')]][_0xdfdb('0xb2')]({'where':_0x1dea5d[_0xdfdb('0x8d')]})[_0xdfdb('0x8')](function(_0x421578){_0x1cb63d[_0xdfdb('0xb2')]=_0x421578;if(_0x4cd890['query'][_0xdfdb('0xac')]){if(_0x1339a9[_0xdfdb('0x18')]===_0xdfdb('0xb4')){_0x1dea5d[_0xdfdb('0xad')]=[{'model':_0x11218a[_0xdfdb('0x76')],'as':_0xdfdb('0xb5'),'attributes':['id','name',_0xdfdb('0xb6')],'required':_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb7')]?!![]:![]},{'model':_0x11218a[_0xdfdb('0x76')],'as':_0xdfdb('0xb8'),'attributes':['id',_0xdfdb('0xf'),'color'],'through':_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb7')]?{'attributes':[],'where':{'TagId':_0x4cd890[_0xdfdb('0x8f')]['tag']||undefined}}:{},'required':_0x4cd890['query'][_0xdfdb('0xb7')]?!![]:![]}];}else{_0x1dea5d['include']=[{'all':!![]}];}}return _0x11218a[_0x1339a9['childModel']][_0xdfdb('0xe')](_0x1dea5d);})[_0xdfdb('0x8')](function(_0x57d5e3){_0x1cb63d['rows']=_0x57d5e3;if(_0x5ef75a===_0xdfdb('0x60')&&_0x4cd890[_0xdfdb('0x8f')][_0xdfdb('0xb9')]===_0xdfdb('0xba')){var _0x36b01e=[];for(var _0x5b883b=0x0;_0x5b883b<_0x1cb63d['rows'][_0xdfdb('0x94')];_0x5b883b++){_0x36b01e['push'](_0x273afa(_0xdfdb('0xbb'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e['push'](_0x273afa(_0xdfdb('0xbd'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e[_0xdfdb('0x95')](_0x273afa('fax',_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e[_0xdfdb('0x95')](_0x273afa(_0xdfdb('0xbe'),_0x1cb63d['rows'][_0x5b883b][_0xdfdb('0xbc')]));_0x36b01e['push'](_0x273afa('openchannel',_0x1cb63d['rows'][_0x5b883b]['dataValues']));_0x36b01e['push'](_0x273afa(_0xdfdb('0xbf'),_0x1cb63d[_0xdfdb('0xb3')][_0x5b883b][_0xdfdb('0xbc')]));}return Promise[_0xdfdb('0x98')](_0x36b01e)[_0xdfdb('0x8')](function(){return _0x1cb63d;});}return _0x1cb63d;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index abd5270..b11a6e7 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 _0x6a0b=['./userProfile.socket','then','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x32d597,_0x27fb69){var _0xfa6bfe=function(_0x4a8dff){while(--_0x4a8dff){_0x32d597['push'](_0x32d597['shift']());}};_0xfa6bfe(++_0x27fb69);}(_0x6a0b,0xf6));var _0xb6a0=function(_0x5e4d08,_0x3fcf71){_0x5e4d08=_0x5e4d08-0x0;var _0x2abaf5=_0x6a0b[_0x5e4d08];return _0x2abaf5;};'use strict';var _=require(_0xb6a0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb6a0('0x1'));var rs=require(_0xb6a0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb6a0('0x3'))['db'];var utils=require(_0xb6a0('0x4'));var logger=require(_0xb6a0('0x5'))(_0xb6a0('0x6'));var config=require(_0xb6a0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb6a0('0x8')][_0xb6a0('0x9')]({'port':0x232a});config[_0xb6a0('0xa')]=_[_0xb6a0('0xb')](config[_0xb6a0('0xa')],{'host':_0xb6a0('0xc'),'port':0x18eb});var socket=require(_0xb6a0('0xd'))(new Redis(config[_0xb6a0('0xa')]));require(_0xb6a0('0xe'))['register'](socket);function respondWithRpcPromise(_0x490a5e,_0x5cf7a2,_0x4cb12b){return new BPromise(function(_0x5e093b,_0x3d6d0e){return client['request'](_0x490a5e,_0x4cb12b)[_0xb6a0('0xf')](function(_0x1df08c){logger['info'](_0xb6a0('0x10'),_0x5cf7a2,_0xb6a0('0x11'));logger[_0xb6a0('0x12')](_0xb6a0('0x13'),_0x5cf7a2,_0xb6a0('0x11'),JSON[_0xb6a0('0x14')](_0x1df08c));if(_0x1df08c[_0xb6a0('0x15')]){if(_0x1df08c[_0xb6a0('0x15')][_0xb6a0('0x16')]===0x1f4){logger[_0xb6a0('0x15')]('UserProfile,\x20%s,\x20%s',_0x5cf7a2,_0x1df08c[_0xb6a0('0x15')][_0xb6a0('0x17')]);return _0x3d6d0e(_0x1df08c[_0xb6a0('0x15')][_0xb6a0('0x17')]);}logger[_0xb6a0('0x15')](_0xb6a0('0x10'),_0x5cf7a2,_0x1df08c[_0xb6a0('0x15')][_0xb6a0('0x17')]);return _0x5e093b(_0x1df08c[_0xb6a0('0x15')]['message']);}else{logger[_0xb6a0('0x18')](_0xb6a0('0x10'),_0x5cf7a2,_0xb6a0('0x11'));_0x5e093b(_0x1df08c['result'][_0xb6a0('0x17')]);}})[_0xb6a0('0x19')](function(_0x1708e4){logger[_0xb6a0('0x15')](_0xb6a0('0x10'),_0x5cf7a2,_0x1708e4);_0x3d6d0e(_0x1708e4);});});} \ No newline at end of file +var _0xe08b=['lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./userProfile.socket','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0xf2e8ae,_0xda1eda){var _0x30e58d=function(_0x5c3935){while(--_0x5c3935){_0xf2e8ae['push'](_0xf2e8ae['shift']());}};_0x30e58d(++_0xda1eda);}(_0xe08b,0x10e));var _0xbe08=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xe08b[_0x28394f];return _0x2618d2;};'use strict';var _=require(_0xbe08('0x0'));var util=require('util');var moment=require(_0xbe08('0x1'));var BPromise=require(_0xbe08('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe08('0x3'));var db=require(_0xbe08('0x4'))['db'];var utils=require(_0xbe08('0x5'));var logger=require(_0xbe08('0x6'))(_0xbe08('0x7'));var config=require(_0xbe08('0x8'));var jayson=require(_0xbe08('0x9'));var client=jayson[_0xbe08('0xa')][_0xbe08('0xb')]({'port':0x232a});config[_0xbe08('0xc')]=_[_0xbe08('0xd')](config[_0xbe08('0xc')],{'host':_0xbe08('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe08('0xc')]));require(_0xbe08('0xf'))['register'](socket);function respondWithRpcPromise(_0xb4e69a,_0xed8e0c,_0x47ca8d){return new BPromise(function(_0xc5824c,_0x202fec){return client['request'](_0xb4e69a,_0x47ca8d)[_0xbe08('0x10')](function(_0x133725){logger[_0xbe08('0x11')](_0xbe08('0x12'),_0xed8e0c,'request\x20sent');logger[_0xbe08('0x13')]('UserProfile,\x20%s,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'),JSON[_0xbe08('0x15')](_0x133725));if(_0x133725[_0xbe08('0x16')]){if(_0x133725[_0xbe08('0x16')][_0xbe08('0x17')]===0x1f4){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0x202fec(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);return _0xc5824c(_0x133725[_0xbe08('0x16')][_0xbe08('0x18')]);}else{logger[_0xbe08('0x11')]('UserProfile,\x20%s,\x20%s',_0xed8e0c,_0xbe08('0x14'));_0xc5824c(_0x133725[_0xbe08('0x19')][_0xbe08('0x18')]);}})[_0xbe08('0x1a')](function(_0x1c9379){logger[_0xbe08('0x16')](_0xbe08('0x12'),_0xed8e0c,_0x1c9379);_0x202fec(_0x1c9379);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 7fd069d..8b28433 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 _0x0024=['emit','removeListener','length','userProfile:','./userProfile.events','save','remove','update'];(function(_0x34ebc6,_0x201e65){var _0x16f800=function(_0x2c72fc){while(--_0x2c72fc){_0x34ebc6['push'](_0x34ebc6['shift']());}};_0x16f800(++_0x201e65);}(_0x0024,0x174));var _0x4002=function(_0x5283d4,_0x134a3b){_0x5283d4=_0x5283d4-0x0;var _0x2d0300=_0x0024[_0x5283d4];return _0x2d0300;};'use strict';var UserProfileEvents=require(_0x4002('0x0'));var events=[_0x4002('0x1'),_0x4002('0x2'),_0x4002('0x3')];function createListener(_0x53fc4e,_0x7e3eda){return function(_0x2a6257){_0x7e3eda[_0x4002('0x4')](_0x53fc4e,_0x2a6257);};}function removeListener(_0x3826ef,_0x301d3b){return function(){UserProfileEvents[_0x4002('0x5')](_0x3826ef,_0x301d3b);};}exports['register']=function(_0x12bca8){for(var _0x1ec6a5=0x0,_0x4cd6da=events[_0x4002('0x6')];_0x1ec6a5<_0x4cd6da;_0x1ec6a5++){var _0x2271ed=events[_0x1ec6a5];var _0x41eeb4=createListener(_0x4002('0x7')+_0x2271ed,_0x12bca8);UserProfileEvents['on'](_0x2271ed,_0x41eeb4);}}; \ No newline at end of file +var _0xa66b=['register','length','userProfile:','./userProfile.events','save','remove','update','emit'];(function(_0x450763,_0x4e19a5){var _0x5c56e9=function(_0x5e3ab1){while(--_0x5e3ab1){_0x450763['push'](_0x450763['shift']());}};_0x5c56e9(++_0x4e19a5);}(_0xa66b,0x9b));var _0xba66=function(_0x43bc0e,_0x18864e){_0x43bc0e=_0x43bc0e-0x0;var _0x5b4081=_0xa66b[_0x43bc0e];return _0x5b4081;};'use strict';var UserProfileEvents=require(_0xba66('0x0'));var events=[_0xba66('0x1'),_0xba66('0x2'),_0xba66('0x3')];function createListener(_0x203934,_0x1864ae){return function(_0x14b12a){_0x1864ae[_0xba66('0x4')](_0x203934,_0x14b12a);};}function removeListener(_0x3487b4,_0x3886f8){return function(){UserProfileEvents['removeListener'](_0x3487b4,_0x3886f8);};}exports[_0xba66('0x5')]=function(_0x38c6af){for(var _0xd9c999=0x0,_0x274511=events[_0xba66('0x6')];_0xd9c999<_0x274511;_0xd9c999++){var _0x9c90c7=events[_0xd9c999];var _0x4ebd06=createListener(_0xba66('0x7')+_0x9c90c7,_0x38c6af);UserProfileEvents['on'](_0x9c90c7,_0x4ebd06);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2ce97af..f921ef3 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 _0x6069=['update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6069,0xd4));var _0x9606=function(_0x3ff576,_0x1abf45){_0x3ff576=_0x3ff576-0x0;var _0x19eb8a=_0x6069[_0x3ff576];return _0x19eb8a;};'use strict';var multer=require(_0x9606('0x0'));var util=require(_0x9606('0x1'));var path=require(_0x9606('0x2'));var timeout=require(_0x9606('0x3'));var express=require(_0x9606('0x4'));var router=express[_0x9606('0x5')]();var fs_extra=require(_0x9606('0x6'));var auth=require(_0x9606('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x9606('0x8'));var controller=require(_0x9606('0x9'));router[_0x9606('0xa')]('/',auth[_0x9606('0xb')](),controller['index']);router['get'](_0x9606('0xc'),auth[_0x9606('0xb')](),controller[_0x9606('0xd')]);router[_0x9606('0xa')](_0x9606('0xe'),auth[_0x9606('0xb')](),controller[_0x9606('0xf')]);router['post']('/',auth[_0x9606('0xb')](),controller['create']);router['put'](_0x9606('0xe'),auth[_0x9606('0xb')](),controller[_0x9606('0x10')]);router[_0x9606('0x11')]('/:id',auth[_0x9606('0xb')](),controller['destroy']);module[_0x9606('0x12')]=router; \ No newline at end of file +var _0xe3b3=['put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create'];(function(_0x539bb6,_0x51deda){var _0x558add=function(_0x3e2b7d){while(--_0x3e2b7d){_0x539bb6['push'](_0x539bb6['shift']());}};_0x558add(++_0x51deda);}(_0xe3b3,0xac));var _0x3e3b=function(_0x2e711c,_0x4bb19c){_0x2e711c=_0x2e711c-0x0;var _0x1d6e13=_0xe3b3[_0x2e711c];return _0x1d6e13;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express['Router']();var fs_extra=require(_0x3e3b('0x5'));var auth=require(_0x3e3b('0x6'));var interaction=require(_0x3e3b('0x7'));var config=require('../../config/environment');var controller=require(_0x3e3b('0x8'));router[_0x3e3b('0x9')]('/',auth[_0x3e3b('0xa')](),controller['index']);router[_0x3e3b('0x9')](_0x3e3b('0xb'),auth[_0x3e3b('0xa')](),controller[_0x3e3b('0xc')]);router[_0x3e3b('0x9')](_0x3e3b('0xd'),auth['isAuthenticated'](),controller[_0x3e3b('0xe')]);router[_0x3e3b('0xf')]('/',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x10')]);router[_0x3e3b('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x3e3b('0x12')]);router['delete']('/:id',auth[_0x3e3b('0xa')](),controller[_0x3e3b('0x13')]);module[_0x3e3b('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index eeefc73..2859c5b 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 _0xc6d4=['STRING','INTEGER','exports'];(function(_0x2ab2a4,_0x51e312){var _0x466941=function(_0x1a3e11){while(--_0x1a3e11){_0x2ab2a4['push'](_0x2ab2a4['shift']());}};_0x466941(++_0x51e312);}(_0xc6d4,0x13a));var _0x4c6d=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xc6d4[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require('sequelize');module[_0x4c6d('0x0')]={'name':{'type':Sequelize[_0x4c6d('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4c6d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x4c6d('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xc820=['sequelize','exports','INTEGER','STRING'];(function(_0x524bf7,_0x525019){var _0x4e53e8=function(_0x38c6fc){while(--_0x38c6fc){_0x524bf7['push'](_0x524bf7['shift']());}};_0x4e53e8(++_0x525019);}(_0xc820,0x1e4));var _0x0c82=function(_0x563e90,_0x72e394){_0x563e90=_0x563e90-0x0;var _0x3ccd6b=_0xc820[_0x563e90];return _0x3ccd6b;};'use strict';var Sequelize=require(_0x0c82('0x0'));module[_0x0c82('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x0c82('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0c82('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 14fcf25..4f97984 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 _0x6343=['VIRTUAL','options','UserProfileResource','then','rows','catch','show','params','keys','includeAll','include','create','body','find','describe','zip-dir','fast-json-patch','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','json','apply','reject','save','update','destroy','stack','send','map','rawAttributes','fieldName','type','key','model','name','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filter','merge'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_0x6343,0x168));var _0x3634=function(_0xba430,_0x4f4195){_0xba430=_0xba430-0x0;var _0x3c8d83=_0x6343[_0xba430];return _0x3c8d83;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3634('0x0'));var jsonpatch=require(_0x3634('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3634('0x2'));var path=require(_0x3634('0x3'));var sox=require('sox');var csv=require(_0x3634('0x4'));var ejs=require(_0x3634('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3634('0x6'));var squel=require(_0x3634('0x7'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3634('0x8'));var toCsv=require(_0x3634('0x4'));var querystring=require(_0x3634('0x9'));var Papa=require(_0x3634('0xa'));var Redis=require(_0x3634('0xb'));var authService=require(_0x3634('0xc'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3634('0xd'));var logger=require(_0x3634('0xe'))('api');var utils=require(_0x3634('0xf'));var config=require(_0x3634('0x10'));var licenseUtil=require(_0x3634('0x11'));var db=require(_0x3634('0x12'))['db'];function respondWithStatusCode(_0x1e6a04,_0x151c8c){_0x151c8c=_0x151c8c||0xcc;return function(_0x35ae07){if(_0x35ae07){return _0x1e6a04[_0x3634('0x13')](_0x151c8c);}return _0x1e6a04[_0x3634('0x14')](_0x151c8c)[_0x3634('0x15')]();};}function respondWithResult(_0x299e53,_0x71d09b){_0x71d09b=_0x71d09b||0xc8;return function(_0x7e4801){if(_0x7e4801){return _0x299e53[_0x3634('0x14')](_0x71d09b)['json'](_0x7e4801);}};}function respondWithFilteredResult(_0x167247,_0x48787f){return function(_0x69609d){if(_0x69609d){var _0x18285c=typeof _0x48787f[_0x3634('0x16')]===_0x3634('0x17')&&typeof _0x48787f[_0x3634('0x18')]==='undefined';var _0x3121a3=_0x69609d['count'];var _0x50350d=_0x18285c?0x0:_0x48787f[_0x3634('0x16')];var _0x4b2115=_0x18285c?_0x69609d[_0x3634('0x19')]:_0x48787f[_0x3634('0x16')]+_0x48787f[_0x3634('0x18')];var _0x5603d2;if(_0x4b2115>=_0x3121a3){_0x4b2115=_0x3121a3;_0x5603d2=0xc8;}else{_0x5603d2=0xce;}_0x167247[_0x3634('0x14')](_0x5603d2);return _0x167247[_0x3634('0x1a')]('Content-Range',_0x50350d+'-'+_0x4b2115+'/'+_0x3121a3)[_0x3634('0x1b')](_0x69609d);}return null;};}function patchUpdates(_0x506281){return function(_0x742e56){try{jsonpatch[_0x3634('0x1c')](_0x742e56,_0x506281,!![]);}catch(_0x5b77a7){return BPromise[_0x3634('0x1d')](_0x5b77a7);}return _0x742e56[_0x3634('0x1e')]();};}function saveUpdates(_0x206c8e,_0x505026){return function(_0x22b7ef){if(_0x22b7ef){return _0x22b7ef[_0x3634('0x1f')](_0x206c8e)['then'](function(_0x3936ee){return _0x3936ee;});}return null;};}function removeEntity(_0x596acb,_0x5e9188){return function(_0x3a8c41){if(_0x3a8c41){return _0x3a8c41[_0x3634('0x20')]()['then'](function(){_0x596acb[_0x3634('0x14')](0xcc)[_0x3634('0x15')]();});}};}function handleEntityNotFound(_0x17db44,_0x225ddc){return function(_0x363ca2){if(!_0x363ca2){_0x17db44[_0x3634('0x13')](0x194);}return _0x363ca2;};}function handleError(_0x38e863,_0x4762b1){_0x4762b1=_0x4762b1||0x1f4;return function(_0x22f1f1){logger['error'](_0x22f1f1[_0x3634('0x21')]);if(_0x22f1f1['name']){delete _0x22f1f1['name'];}_0x38e863['status'](_0x4762b1)[_0x3634('0x22')](_0x22f1f1);};}exports['index']=function(_0x3bf28b,_0x12b80e){var _0x49804f={},_0x55a77f={},_0x282f73={'count':0x0,'rows':[]};var _0x5bd4e0=_[_0x3634('0x23')](db['UserProfileResource'][_0x3634('0x24')],function(_0x3d7322){return{'name':_0x3d7322[_0x3634('0x25')],'type':_0x3d7322[_0x3634('0x26')][_0x3634('0x27')]};});_0x55a77f[_0x3634('0x28')]=_[_0x3634('0x23')](_0x5bd4e0,_0x3634('0x29'));_0x55a77f['query']=_['keys'](_0x3bf28b['query']);_0x55a77f[_0x3634('0x2a')]=_['intersection'](_0x55a77f[_0x3634('0x28')],_0x55a77f[_0x3634('0x2b')]);_0x49804f[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x55a77f[_0x3634('0x28')],qs[_0x3634('0x2e')](_0x3bf28b['query'][_0x3634('0x2e')]));_0x49804f[_0x3634('0x2c')]=_0x49804f[_0x3634('0x2c')][_0x3634('0x2f')]?_0x49804f[_0x3634('0x2c')]:_0x55a77f[_0x3634('0x28')];if(!_0x3bf28b[_0x3634('0x2b')][_0x3634('0x30')](_0x3634('0x31'))){_0x49804f['limit']=qs[_0x3634('0x18')](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x18')]);_0x49804f[_0x3634('0x16')]=qs['offset'](_0x3bf28b[_0x3634('0x2b')][_0x3634('0x16')]);}_0x49804f[_0x3634('0x32')]=qs['sort'](_0x3bf28b['query']['sort']);_0x49804f[_0x3634('0x33')]=qs[_0x3634('0x2a')](_['pick'](_0x3bf28b[_0x3634('0x2b')],_0x55a77f[_0x3634('0x2a')]),_0x5bd4e0);if(_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]){_0x49804f[_0x3634('0x33')]=_[_0x3634('0x35')](_0x49804f[_0x3634('0x33')],{'$or':_['map'](_0x5bd4e0,function(_0x416987){if(_0x416987['type']!==_0x3634('0x36')){var _0x3ae966={};_0x3ae966[_0x416987[_0x3634('0x29')]]={'$like':'%'+_0x3bf28b[_0x3634('0x2b')][_0x3634('0x34')]+'%'};return _0x3ae966;}})});}_0x49804f=_['merge']({},_0x49804f,_0x3bf28b[_0x3634('0x37')]);var _0x33af29={'where':_0x49804f[_0x3634('0x33')]};return db[_0x3634('0x38')][_0x3634('0x19')](_0x33af29)[_0x3634('0x39')](function(_0x28c8d0){_0x282f73[_0x3634('0x19')]=_0x28c8d0;if(_0x3bf28b[_0x3634('0x2b')]['includeAll']){_0x49804f['include']=[{'all':!![]}];}return db[_0x3634('0x38')]['findAll'](_0x49804f);})['then'](function(_0x5948db){_0x282f73[_0x3634('0x3a')]=_0x5948db;return _0x282f73;})['then'](respondWithFilteredResult(_0x12b80e,_0x49804f))[_0x3634('0x3b')](handleError(_0x12b80e,null));};exports[_0x3634('0x3c')]=function(_0x53c1ea,_0x505be7){var _0x4896ab={'raw':![],'where':{'id':_0x53c1ea[_0x3634('0x3d')]['id']}},_0x324970={};_0x324970['model']=_[_0x3634('0x3e')](db[_0x3634('0x38')][_0x3634('0x24')]);_0x324970[_0x3634('0x2b')]=_[_0x3634('0x3e')](_0x53c1ea['query']);_0x324970['filters']=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],_0x324970[_0x3634('0x2b')]);_0x4896ab[_0x3634('0x2c')]=_[_0x3634('0x2d')](_0x324970[_0x3634('0x28')],qs['fields'](_0x53c1ea[_0x3634('0x2b')][_0x3634('0x2e')]));_0x4896ab[_0x3634('0x2c')]=_0x4896ab['attributes']['length']?_0x4896ab[_0x3634('0x2c')]:_0x324970[_0x3634('0x28')];if(_0x53c1ea[_0x3634('0x2b')][_0x3634('0x3f')]){_0x4896ab[_0x3634('0x40')]=[{'all':!![]}];}_0x4896ab=_[_0x3634('0x35')]({},_0x4896ab,_0x53c1ea[_0x3634('0x37')]);return db[_0x3634('0x38')]['find'](_0x4896ab)[_0x3634('0x39')](handleEntityNotFound(_0x505be7,null))[_0x3634('0x39')](respondWithResult(_0x505be7,null))[_0x3634('0x3b')](handleError(_0x505be7,null));};exports[_0x3634('0x41')]=function(_0x615276,_0x151654){return db[_0x3634('0x38')][_0x3634('0x41')](_0x615276[_0x3634('0x42')],{})['then'](respondWithResult(_0x151654,0xc9))[_0x3634('0x3b')](handleError(_0x151654,null));};exports[_0x3634('0x1f')]=function(_0x4a4a94,_0x3c356b){if(_0x4a4a94[_0x3634('0x42')]['id']){delete _0x4a4a94[_0x3634('0x42')]['id'];}return db[_0x3634('0x38')][_0x3634('0x43')]({'where':{'id':_0x4a4a94[_0x3634('0x3d')]['id']}})['then'](handleEntityNotFound(_0x3c356b,null))[_0x3634('0x39')](saveUpdates(_0x4a4a94[_0x3634('0x42')],null))[_0x3634('0x39')](respondWithResult(_0x3c356b,null))[_0x3634('0x3b')](handleError(_0x3c356b,null));};exports[_0x3634('0x20')]=function(_0x582475,_0x66f6a4){return db[_0x3634('0x38')]['find']({'where':{'id':_0x582475['params']['id']}})[_0x3634('0x39')](handleEntityNotFound(_0x66f6a4,null))['then'](removeEntity(_0x66f6a4,null))[_0x3634('0x3b')](handleError(_0x66f6a4,null));};exports[_0x3634('0x44')]=function(_0x1943a5,_0x1834a3){return db['UserProfileResource'][_0x3634('0x44')]()[_0x3634('0x39')](respondWithResult(_0x1834a3,null))[_0x3634('0x3b')](handleError(_0x1834a3,null));}; \ No newline at end of file +var _0xacf4=['findAll','rows','catch','show','params','intersection','length','includeAll','find','create','body','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include'];(function(_0x3fe042,_0x1106f7){var _0x7d4a1f=function(_0x2df987){while(--_0x2df987){_0x3fe042['push'](_0x3fe042['shift']());}};_0x7d4a1f(++_0x1106f7);}(_0xacf4,0xe7));var _0x4acf=function(_0xad8f02,_0x3b94bf){_0xad8f02=_0xad8f02-0x0;var _0x36ab56=_0xacf4[_0xad8f02];return _0x36ab56;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['UserProfileResource'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['UserProfileResource']['create'](_0x1bd7d0[_0x4acf('0x47')],{})[_0x4acf('0x21')](respondWithResult(_0x2d946c,0xc9))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x287406,_0x859247){if(_0x287406[_0x4acf('0x47')]['id']){delete _0x287406[_0x4acf('0x47')]['id'];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x287406[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x859247,null))['then'](saveUpdates(_0x287406[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x859247,null))[_0x4acf('0x3f')](handleError(_0x859247,null));};exports[_0x4acf('0x22')]=function(_0x392dac,_0x3cf54a){return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'id':_0x392dac[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x3cf54a,null))[_0x4acf('0x21')](removeEntity(_0x3cf54a,null))[_0x4acf('0x3f')](handleError(_0x3cf54a,null));};exports[_0x4acf('0x48')]=function(_0x2b62bc,_0x113425){return db[_0x4acf('0x29')]['describe']()[_0x4acf('0x21')](respondWithResult(_0x113425,null))[_0x4acf('0x3f')](handleError(_0x113425,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index bb17e03..416d0a6 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 _0x1f85=['sectionId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x1f85,0x88));var _0x51f8=function(_0x255984,_0x46e231){_0x255984=_0x255984-0x0;var _0x3b8658=_0x1f85[_0x255984];return _0x3b8658;};'use strict';var _=require(_0x51f8('0x0'));var util=require(_0x51f8('0x1'));var logger=require(_0x51f8('0x2'))(_0x51f8('0x3'));var moment=require(_0x51f8('0x4'));var BPromise=require(_0x51f8('0x5'));var rp=require(_0x51f8('0x6'));var fs=require('fs');var path=require(_0x51f8('0x7'));var rimraf=require('rimraf');var config=require(_0x51f8('0x8'));var attributes=require(_0x51f8('0x9'));module[_0x51f8('0xa')]=function(_0x124130,_0x470abb){return _0x124130[_0x51f8('0xb')](_0x51f8('0xc'),attributes,{'tableName':_0x51f8('0xd'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x51f8('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc37c=['./userProfileResource.attributes','exports','define','compositeIndex','resourceId','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4e2e46,_0x2e7086){var _0x332409=function(_0x5cbf98){while(--_0x5cbf98){_0x4e2e46['push'](_0x4e2e46['shift']());}};_0x332409(++_0x2e7086);}(_0xc37c,0xb9));var _0xcc37=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0xc37c[_0x3acee8];return _0x5046cc;};'use strict';var _=require(_0xcc37('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xcc37('0x1'));var BPromise=require(_0xcc37('0x2'));var rp=require(_0xcc37('0x3'));var fs=require('fs');var path=require(_0xcc37('0x4'));var rimraf=require(_0xcc37('0x5'));var config=require(_0xcc37('0x6'));var attributes=require(_0xcc37('0x7'));module[_0xcc37('0x8')]=function(_0x26a61d,_0xfe1ecf){return _0x26a61d[_0xcc37('0x9')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0xcc37('0xa'),'fields':[_0xcc37('0xb'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 69cb916..afc9b5f 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 _0xbab2=['debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent'];(function(_0x569fef,_0x49c37a){var _0x11f20b=function(_0x3721d8){while(--_0x3721d8){_0x569fef['push'](_0x569fef['shift']());}};_0x11f20b(++_0x49c37a);}(_0xbab2,0x1ea));var _0x2bab=function(_0x3dee76,_0x3623ec){_0x3dee76=_0x3dee76-0x0;var _0x2c0faf=_0xbab2[_0x3dee76];return _0x2c0faf;};'use strict';var _=require('lodash');var util=require(_0x2bab('0x0'));var moment=require(_0x2bab('0x1'));var BPromise=require('bluebird');var rs=require(_0x2bab('0x2'));var fs=require('fs');var Redis=require(_0x2bab('0x3'));var db=require(_0x2bab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2bab('0x5'))(_0x2bab('0x6'));var config=require(_0x2bab('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2bab('0x8')][_0x2bab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ab11b,_0x9332a1,_0x58164f){return new BPromise(function(_0x2e301b,_0x32ab52){return client['request'](_0x2ab11b,_0x58164f)[_0x2bab('0xa')](function(_0x258223){logger[_0x2bab('0xb')](_0x2bab('0xc'),_0x9332a1,_0x2bab('0xd'));logger[_0x2bab('0xe')](_0x2bab('0xf'),_0x9332a1,_0x2bab('0xd'),JSON[_0x2bab('0x10')](_0x258223));if(_0x258223[_0x2bab('0x11')]){if(_0x258223[_0x2bab('0x11')]['code']===0x1f4){logger[_0x2bab('0x11')](_0x2bab('0xc'),_0x9332a1,_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);return _0x32ab52(_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);}logger[_0x2bab('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x9332a1,_0x258223[_0x2bab('0x11')]['message']);return _0x2e301b(_0x258223[_0x2bab('0x11')][_0x2bab('0x12')]);}else{logger[_0x2bab('0xb')](_0x2bab('0xc'),_0x9332a1,_0x2bab('0xd'));_0x2e301b(_0x258223[_0x2bab('0x13')][_0x2bab('0x12')]);}})[_0x2bab('0x14')](function(_0x3113b2){logger[_0x2bab('0x11')](_0x2bab('0xc'),_0x9332a1,_0x3113b2);_0x32ab52(_0x3113b2);});});} \ No newline at end of file +var _0xd020=['jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','stringify','error','result','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x22a092,_0x326d72){var _0x1c6dc3=function(_0x523650){while(--_0x523650){_0x22a092['push'](_0x22a092['shift']());}};_0x1c6dc3(++_0x326d72);}(_0xd020,0x1ac));var _0x0d02=function(_0x1b9764,_0x361ac4){_0x1b9764=_0x1b9764-0x0;var _0x4303c3=_0xd020[_0x1b9764];return _0x4303c3;};'use strict';var _=require(_0x0d02('0x0'));var util=require(_0x0d02('0x1'));var moment=require(_0x0d02('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d02('0x3'));var fs=require('fs');var Redis=require(_0x0d02('0x4'));var db=require(_0x0d02('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0d02('0x6'))(_0x0d02('0x7'));var config=require(_0x0d02('0x8'));var jayson=require(_0x0d02('0x9'));var client=jayson[_0x0d02('0xa')][_0x0d02('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47c4ec,_0x50efe4,_0xb3bbfc){return new BPromise(function(_0x357d06,_0x4deb18){return client[_0x0d02('0xc')](_0x47c4ec,_0xb3bbfc)[_0x0d02('0xd')](function(_0x4a14bd){logger[_0x0d02('0xe')](_0x0d02('0xf'),_0x50efe4,_0x0d02('0x10'));logger[_0x0d02('0x11')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x50efe4,'request\x20sent',JSON[_0x0d02('0x12')](_0x4a14bd));if(_0x4a14bd[_0x0d02('0x13')]){if(_0x4a14bd['error']['code']===0x1f4){logger['error'](_0x0d02('0xf'),_0x50efe4,_0x4a14bd[_0x0d02('0x13')]['message']);return _0x4deb18(_0x4a14bd[_0x0d02('0x13')]['message']);}logger[_0x0d02('0x13')]('UserProfileResource,\x20%s,\x20%s',_0x50efe4,_0x4a14bd[_0x0d02('0x13')]['message']);return _0x357d06(_0x4a14bd[_0x0d02('0x13')]['message']);}else{logger[_0x0d02('0xe')](_0x0d02('0xf'),_0x50efe4,_0x0d02('0x10'));_0x357d06(_0x4a14bd[_0x0d02('0x14')][_0x0d02('0x15')]);}})[_0x0d02('0x16')](function(_0x6dcc1f){logger[_0x0d02('0x13')](_0x0d02('0xf'),_0x50efe4,_0x6dcc1f);_0x4deb18(_0x6dcc1f);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 8dd05b8..e1a9653 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 _0x75a9=['multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update'];(function(_0x363b81,_0x81e6ca){var _0x1d92fb=function(_0x129644){while(--_0x129644){_0x363b81['push'](_0x363b81['shift']());}};_0x1d92fb(++_0x81e6ca);}(_0x75a9,0x64));var _0x975a=function(_0x2cb48f,_0x635d88){_0x2cb48f=_0x2cb48f-0x0;var _0x567c30=_0x75a9[_0x2cb48f];return _0x567c30;};'use strict';var multer=require(_0x975a('0x0'));var util=require(_0x975a('0x1'));var path=require(_0x975a('0x2'));var timeout=require(_0x975a('0x3'));var express=require('express');var router=express[_0x975a('0x4')]();var fs_extra=require(_0x975a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x975a('0x6'));var config=require(_0x975a('0x7'));var controller=require(_0x975a('0x8'));router[_0x975a('0x9')]('/',auth['isAuthenticated'](),controller[_0x975a('0xa')]);router[_0x975a('0x9')](_0x975a('0xb'),auth[_0x975a('0xc')](),controller[_0x975a('0xd')]);router[_0x975a('0x9')](_0x975a('0xe'),auth[_0x975a('0xc')](),controller[_0x975a('0xf')]);router[_0x975a('0x10')]('/',auth[_0x975a('0xc')](),controller[_0x975a('0x11')]);router[_0x975a('0x12')]('/:id',auth[_0x975a('0xc')](),controller[_0x975a('0x13')]);router['delete'](_0x975a('0xe'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x4941=['show','post','create','put','update','destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','isAuthenticated','index','/describe','describe','get','/:id'];(function(_0x509273,_0x13fc9f){var _0x38ef40=function(_0xf8d4c9){while(--_0xf8d4c9){_0x509273['push'](_0x509273['shift']());}};_0x38ef40(++_0x13fc9f);}(_0x4941,0x1ea));var _0x1494=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x4941[_0x3f94f9];return _0x46f84f;};'use strict';var multer=require(_0x1494('0x0'));var util=require(_0x1494('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1494('0x2'));var router=express['Router']();var fs_extra=require(_0x1494('0x3'));var auth=require(_0x1494('0x4'));var interaction=require(_0x1494('0x5'));var config=require(_0x1494('0x6'));var controller=require(_0x1494('0x7'));router['get']('/',auth[_0x1494('0x8')](),controller[_0x1494('0x9')]);router['get'](_0x1494('0xa'),auth[_0x1494('0x8')](),controller[_0x1494('0xb')]);router[_0x1494('0xc')](_0x1494('0xd'),auth['isAuthenticated'](),controller[_0x1494('0xe')]);router[_0x1494('0xf')]('/',auth[_0x1494('0x8')](),controller[_0x1494('0x10')]);router[_0x1494('0x11')](_0x1494('0xd'),auth[_0x1494('0x8')](),controller[_0x1494('0x12')]);router['delete'](_0x1494('0xd'),auth['isAuthenticated'](),controller[_0x1494('0x13')]);module[_0x1494('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 1e7a2d3..612a0c8 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 _0x0972=['crudPermissions','join','getDataValue','split','exports','STRING','BOOLEAN','setDataValue'];(function(_0x1da527,_0x2dc953){var _0x40fc7c=function(_0x9949f5){while(--_0x9949f5){_0x1da527['push'](_0x1da527['shift']());}};_0x40fc7c(++_0x2dc953);}(_0x0972,0x64));var _0x2097=function(_0x1f06ae,_0x15284c){_0x1f06ae=_0x1f06ae-0x0;var _0x3dabae=_0x0972[_0x1f06ae];return _0x3dabae;};'use strict';var Sequelize=require('sequelize');module[_0x2097('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'category':{'type':Sequelize[_0x2097('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x2097('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x348ad8){this[_0x2097('0x3')](_0x2097('0x4'),_0x348ad8?_0x348ad8[_0x2097('0x5')](''):[]);},'get':function(){return this[_0x2097('0x6')](_0x2097('0x4'))?this[_0x2097('0x6')]('crudPermissions')[_0x2097('0x7')](''):[];}}}; \ No newline at end of file +var _0x5eb8=['STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x107c2a,_0x38cf63){var _0x18fca1=function(_0x5f02f6){while(--_0x5f02f6){_0x107c2a['push'](_0x107c2a['shift']());}};_0x18fca1(++_0x38cf63);}(_0x5eb8,0xb0));var _0x85eb=function(_0x471268,_0x5ce885){_0x471268=_0x471268-0x0;var _0x1298f3=_0x5eb8[_0x471268];return _0x1298f3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x85eb('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x85eb('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x85eb('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x85eb('0x0')],'set':function(_0x13b1df){this[_0x85eb('0x3')](_0x85eb('0x4'),_0x13b1df?_0x13b1df[_0x85eb('0x5')](''):[]);},'get':function(){return this[_0x85eb('0x6')](_0x85eb('0x4'))?this['getDataValue'](_0x85eb('0x4'))[_0x85eb('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index b0f2658..bb0b198 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 _0x59fc=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filters','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','UserProfileSection','options','create','body','find','describe','eml-format','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x59fc,0x17a));var _0xc59f=function(_0x582eb8,_0x52ecaa){_0x582eb8=_0x582eb8-0x0;var _0xe6aa8a=_0x59fc[_0x582eb8];return _0xe6aa8a;};'use strict';var emlformat=require(_0xc59f('0x0'));var rimraf=require(_0xc59f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc59f('0x2'));var rp=require(_0xc59f('0x3'));var moment=require(_0xc59f('0x4'));var BPromise=require(_0xc59f('0x5'));var Mustache=require(_0xc59f('0x6'));var util=require(_0xc59f('0x7'));var path=require('path');var sox=require(_0xc59f('0x8'));var csv=require(_0xc59f('0x9'));var ejs=require(_0xc59f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc59f('0xb'));var squel=require(_0xc59f('0xc'));var crypto=require('crypto');var jsforce=require(_0xc59f('0xd'));var deskjs=require(_0xc59f('0xe'));var toCsv=require(_0xc59f('0x9'));var querystring=require(_0xc59f('0xf'));var Papa=require(_0xc59f('0x10'));var Redis=require('ioredis');var authService=require(_0xc59f('0x11'));var qs=require(_0xc59f('0x12'));var as=require(_0xc59f('0x13'));var hardwareService=require(_0xc59f('0x14'));var logger=require(_0xc59f('0x15'))(_0xc59f('0x16'));var utils=require(_0xc59f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc59f('0x18'));var db=require(_0xc59f('0x19'))['db'];function respondWithStatusCode(_0xfe07ec,_0x4ae851){_0x4ae851=_0x4ae851||0xcc;return function(_0x5da837){if(_0x5da837){return _0xfe07ec[_0xc59f('0x1a')](_0x4ae851);}return _0xfe07ec['status'](_0x4ae851)[_0xc59f('0x1b')]();};}function respondWithResult(_0x17ab7d,_0x2da690){_0x2da690=_0x2da690||0xc8;return function(_0x2d04e7){if(_0x2d04e7){return _0x17ab7d[_0xc59f('0x1c')](_0x2da690)['json'](_0x2d04e7);}};}function respondWithFilteredResult(_0x44d56f,_0x341e87){return function(_0xb8f9ac){if(_0xb8f9ac){var _0x26e0fd=typeof _0x341e87['offset']==='undefined'&&typeof _0x341e87[_0xc59f('0x1d')]===_0xc59f('0x1e');var _0x3af75f=_0xb8f9ac['count'];var _0xd9b163=_0x26e0fd?0x0:_0x341e87['offset'];var _0x435211=_0x26e0fd?_0xb8f9ac[_0xc59f('0x1f')]:_0x341e87['offset']+_0x341e87[_0xc59f('0x1d')];var _0x38cf66;if(_0x435211>=_0x3af75f){_0x435211=_0x3af75f;_0x38cf66=0xc8;}else{_0x38cf66=0xce;}_0x44d56f[_0xc59f('0x1c')](_0x38cf66);return _0x44d56f['set'](_0xc59f('0x20'),_0xd9b163+'-'+_0x435211+'/'+_0x3af75f)[_0xc59f('0x21')](_0xb8f9ac);}return null;};}function patchUpdates(_0xafff19){return function(_0x22b017){try{jsonpatch[_0xc59f('0x22')](_0x22b017,_0xafff19,!![]);}catch(_0x4522d3){return BPromise[_0xc59f('0x23')](_0x4522d3);}return _0x22b017[_0xc59f('0x24')]();};}function saveUpdates(_0x23b302,_0x274ff3){return function(_0xd7eb0c){if(_0xd7eb0c){return _0xd7eb0c[_0xc59f('0x25')](_0x23b302)['then'](function(_0x436221){return _0x436221;});}return null;};}function removeEntity(_0x13bc3f,_0x835ff7){return function(_0x336a36){if(_0x336a36){return _0x336a36[_0xc59f('0x26')]()[_0xc59f('0x27')](function(){_0x13bc3f[_0xc59f('0x1c')](0xcc)[_0xc59f('0x1b')]();});}};}function handleEntityNotFound(_0x2ee478,_0x1bfada){return function(_0x4ca4e3){if(!_0x4ca4e3){_0x2ee478[_0xc59f('0x1a')](0x194);}return _0x4ca4e3;};}function handleError(_0x3071d6,_0xd349b0){_0xd349b0=_0xd349b0||0x1f4;return function(_0x5204d7){logger[_0xc59f('0x28')](_0x5204d7[_0xc59f('0x29')]);if(_0x5204d7[_0xc59f('0x2a')]){delete _0x5204d7[_0xc59f('0x2a')];}_0x3071d6['status'](_0xd349b0)['send'](_0x5204d7);};}exports[_0xc59f('0x2b')]=function(_0x29869e,_0x28b059){var _0x5b7d19={},_0x555542={},_0x46fbac={'count':0x0,'rows':[]};var _0x11a4cf=_[_0xc59f('0x2c')](db['UserProfileSection']['rawAttributes'],function(_0x40ef28){return{'name':_0x40ef28[_0xc59f('0x2d')],'type':_0x40ef28[_0xc59f('0x2e')][_0xc59f('0x2f')]};});_0x555542[_0xc59f('0x30')]=_[_0xc59f('0x2c')](_0x11a4cf,_0xc59f('0x2a'));_0x555542[_0xc59f('0x31')]=_[_0xc59f('0x32')](_0x29869e['query']);_0x555542['filters']=_[_0xc59f('0x33')](_0x555542[_0xc59f('0x30')],_0x555542[_0xc59f('0x31')]);_0x5b7d19[_0xc59f('0x34')]=_[_0xc59f('0x33')](_0x555542['model'],qs[_0xc59f('0x35')](_0x29869e['query'][_0xc59f('0x35')]));_0x5b7d19['attributes']=_0x5b7d19[_0xc59f('0x34')]['length']?_0x5b7d19[_0xc59f('0x34')]:_0x555542[_0xc59f('0x30')];if(!_0x29869e[_0xc59f('0x31')][_0xc59f('0x36')](_0xc59f('0x37'))){_0x5b7d19[_0xc59f('0x1d')]=qs[_0xc59f('0x1d')](_0x29869e['query'][_0xc59f('0x1d')]);_0x5b7d19[_0xc59f('0x38')]=qs[_0xc59f('0x38')](_0x29869e[_0xc59f('0x31')][_0xc59f('0x38')]);}_0x5b7d19['order']=qs[_0xc59f('0x39')](_0x29869e[_0xc59f('0x31')][_0xc59f('0x39')]);_0x5b7d19[_0xc59f('0x3a')]=qs[_0xc59f('0x3b')](_[_0xc59f('0x3c')](_0x29869e[_0xc59f('0x31')],_0x555542[_0xc59f('0x3b')]),_0x11a4cf);if(_0x29869e[_0xc59f('0x31')][_0xc59f('0x3d')]){_0x5b7d19[_0xc59f('0x3a')]=_[_0xc59f('0x3e')](_0x5b7d19['where'],{'$or':_[_0xc59f('0x2c')](_0x11a4cf,function(_0x5c4110){if(_0x5c4110[_0xc59f('0x2e')]!=='VIRTUAL'){var _0x486a05={};_0x486a05[_0x5c4110[_0xc59f('0x2a')]]={'$like':'%'+_0x29869e[_0xc59f('0x31')]['filter']+'%'};return _0x486a05;}})});}_0x5b7d19=_[_0xc59f('0x3e')]({},_0x5b7d19,_0x29869e['options']);var _0x2917d5={'where':_0x5b7d19[_0xc59f('0x3a')]};return db['UserProfileSection'][_0xc59f('0x1f')](_0x2917d5)[_0xc59f('0x27')](function(_0x52ca82){_0x46fbac['count']=_0x52ca82;if(_0x29869e['query'][_0xc59f('0x3f')]){_0x5b7d19[_0xc59f('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xc59f('0x41')](_0x5b7d19);})[_0xc59f('0x27')](function(_0x13c749){_0x46fbac[_0xc59f('0x42')]=_0x13c749;return _0x46fbac;})['then'](respondWithFilteredResult(_0x28b059,_0x5b7d19))[_0xc59f('0x43')](handleError(_0x28b059,null));};exports[_0xc59f('0x44')]=function(_0x5cbb72,_0x18f3c9){var _0x53e906={'raw':![],'where':{'id':_0x5cbb72[_0xc59f('0x45')]['id']}},_0xf29518={};_0xf29518[_0xc59f('0x30')]=_[_0xc59f('0x32')](db[_0xc59f('0x46')]['rawAttributes']);_0xf29518['query']=_[_0xc59f('0x32')](_0x5cbb72['query']);_0xf29518[_0xc59f('0x3b')]=_['intersection'](_0xf29518[_0xc59f('0x30')],_0xf29518[_0xc59f('0x31')]);_0x53e906[_0xc59f('0x34')]=_[_0xc59f('0x33')](_0xf29518[_0xc59f('0x30')],qs[_0xc59f('0x35')](_0x5cbb72[_0xc59f('0x31')][_0xc59f('0x35')]));_0x53e906['attributes']=_0x53e906[_0xc59f('0x34')]['length']?_0x53e906[_0xc59f('0x34')]:_0xf29518[_0xc59f('0x30')];if(_0x5cbb72[_0xc59f('0x31')][_0xc59f('0x3f')]){_0x53e906[_0xc59f('0x40')]=[{'all':!![]}];}_0x53e906=_[_0xc59f('0x3e')]({},_0x53e906,_0x5cbb72[_0xc59f('0x47')]);return db[_0xc59f('0x46')]['find'](_0x53e906)[_0xc59f('0x27')](handleEntityNotFound(_0x18f3c9,null))[_0xc59f('0x27')](respondWithResult(_0x18f3c9,null))[_0xc59f('0x43')](handleError(_0x18f3c9,null));};exports[_0xc59f('0x48')]=function(_0x5f327a,_0x561b0c){return db[_0xc59f('0x46')][_0xc59f('0x48')](_0x5f327a[_0xc59f('0x49')],{})[_0xc59f('0x27')](respondWithResult(_0x561b0c,0xc9))[_0xc59f('0x43')](handleError(_0x561b0c,null));};exports[_0xc59f('0x25')]=function(_0x2a9e5d,_0x2c2a48){if(_0x2a9e5d['body']['id']){delete _0x2a9e5d[_0xc59f('0x49')]['id'];}return db[_0xc59f('0x46')][_0xc59f('0x4a')]({'where':{'id':_0x2a9e5d[_0xc59f('0x45')]['id']}})[_0xc59f('0x27')](handleEntityNotFound(_0x2c2a48,null))['then'](saveUpdates(_0x2a9e5d['body'],null))['then'](respondWithResult(_0x2c2a48,null))[_0xc59f('0x43')](handleError(_0x2c2a48,null));};exports[_0xc59f('0x26')]=function(_0x3d7a85,_0x35cad4){return db[_0xc59f('0x46')][_0xc59f('0x4a')]({'where':{'id':_0x3d7a85[_0xc59f('0x45')]['id']}})['then'](handleEntityNotFound(_0x35cad4,null))[_0xc59f('0x27')](removeEntity(_0x35cad4,null))[_0xc59f('0x43')](handleError(_0x35cad4,null));};exports['describe']=function(_0x2c55c0,_0x6755ee){return db[_0xc59f('0x46')][_0xc59f('0x4b')]()['then'](respondWithResult(_0x6755ee,null))[_0xc59f('0x43')](handleError(_0x6755ee,null));}; \ No newline at end of file +var _0x38d0=['filters','filter','map','VIRTUAL','merge','options','UserProfileSection','includeAll','include','findAll','rows','catch','keys','find','create','body','params','destroy','describe','eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','undefined','limit','count','set','reject','save','update','then','stack','name','send','index','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick'];(function(_0x228ed3,_0x2cba1f){var _0x28cfbb=function(_0x541a3a){while(--_0x541a3a){_0x228ed3['push'](_0x228ed3['shift']());}};_0x28cfbb(++_0x2cba1f);}(_0x38d0,0x1ab));var _0x038d=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x38d0[_0x5c2e3e];return _0x53f64a;};'use strict';var emlformat=require(_0x038d('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x038d('0x1'));var moment=require(_0x038d('0x2'));var BPromise=require(_0x038d('0x3'));var Mustache=require(_0x038d('0x4'));var util=require(_0x038d('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x038d('0x6'));var ejs=require(_0x038d('0x7'));var fs=require('fs');var fs_extra=require(_0x038d('0x8'));var _=require(_0x038d('0x9'));var squel=require(_0x038d('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x038d('0xb'));var toCsv=require(_0x038d('0x6'));var querystring=require(_0x038d('0xc'));var Papa=require('papaparse');var Redis=require(_0x038d('0xd'));var authService=require(_0x038d('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x038d('0xf'));var hardwareService=require(_0x038d('0x10'));var logger=require(_0x038d('0x11'))(_0x038d('0x12'));var utils=require(_0x038d('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x038d('0x14'))['db'];function respondWithStatusCode(_0x1efb2d,_0x57eef5){_0x57eef5=_0x57eef5||0xcc;return function(_0x3e2481){if(_0x3e2481){return _0x1efb2d[_0x038d('0x15')](_0x57eef5);}return _0x1efb2d[_0x038d('0x16')](_0x57eef5)['end']();};}function respondWithResult(_0x24bb54,_0x489771){_0x489771=_0x489771||0xc8;return function(_0x8bb0e3){if(_0x8bb0e3){return _0x24bb54[_0x038d('0x16')](_0x489771)['json'](_0x8bb0e3);}};}function respondWithFilteredResult(_0x29bb15,_0x256cc6){return function(_0x3ac5e2){if(_0x3ac5e2){var _0x30345e=typeof _0x256cc6['offset']===_0x038d('0x17')&&typeof _0x256cc6[_0x038d('0x18')]===_0x038d('0x17');var _0x15ea46=_0x3ac5e2[_0x038d('0x19')];var _0x223bf7=_0x30345e?0x0:_0x256cc6['offset'];var _0x177eac=_0x30345e?_0x3ac5e2[_0x038d('0x19')]:_0x256cc6['offset']+_0x256cc6['limit'];var _0x385f51;if(_0x177eac>=_0x15ea46){_0x177eac=_0x15ea46;_0x385f51=0xc8;}else{_0x385f51=0xce;}_0x29bb15[_0x038d('0x16')](_0x385f51);return _0x29bb15[_0x038d('0x1a')]('Content-Range',_0x223bf7+'-'+_0x177eac+'/'+_0x15ea46)['json'](_0x3ac5e2);}return null;};}function patchUpdates(_0x14f0e2){return function(_0x3aab49){try{jsonpatch['apply'](_0x3aab49,_0x14f0e2,!![]);}catch(_0x243fc9){return BPromise[_0x038d('0x1b')](_0x243fc9);}return _0x3aab49[_0x038d('0x1c')]();};}function saveUpdates(_0x52362c,_0x42f055){return function(_0xdeddf6){if(_0xdeddf6){return _0xdeddf6[_0x038d('0x1d')](_0x52362c)[_0x038d('0x1e')](function(_0x246d22){return _0x246d22;});}return null;};}function removeEntity(_0x294d4e,_0x124db7){return function(_0x3bd8db){if(_0x3bd8db){return _0x3bd8db['destroy']()[_0x038d('0x1e')](function(){_0x294d4e[_0x038d('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa4dd37,_0x314a77){return function(_0x1406ce){if(!_0x1406ce){_0xa4dd37['sendStatus'](0x194);}return _0x1406ce;};}function handleError(_0x47725d,_0x27018d){_0x27018d=_0x27018d||0x1f4;return function(_0x426954){logger['error'](_0x426954[_0x038d('0x1f')]);if(_0x426954[_0x038d('0x20')]){delete _0x426954[_0x038d('0x20')];}_0x47725d[_0x038d('0x16')](_0x27018d)[_0x038d('0x21')](_0x426954);};}exports[_0x038d('0x22')]=function(_0x6c6577,_0x31c636){var _0x486565={},_0x34caf6={},_0x236ea7={'count':0x0,'rows':[]};var _0x39bf17=_['map'](db['UserProfileSection']['rawAttributes'],function(_0x203d70){return{'name':_0x203d70['fieldName'],'type':_0x203d70[_0x038d('0x23')][_0x038d('0x24')]};});_0x34caf6['model']=_['map'](_0x39bf17,'name');_0x34caf6[_0x038d('0x25')]=_['keys'](_0x6c6577[_0x038d('0x25')]);_0x34caf6['filters']=_[_0x038d('0x26')](_0x34caf6[_0x038d('0x27')],_0x34caf6[_0x038d('0x25')]);_0x486565[_0x038d('0x28')]=_[_0x038d('0x26')](_0x34caf6[_0x038d('0x27')],qs[_0x038d('0x29')](_0x6c6577[_0x038d('0x25')]['fields']));_0x486565[_0x038d('0x28')]=_0x486565[_0x038d('0x28')][_0x038d('0x2a')]?_0x486565[_0x038d('0x28')]:_0x34caf6['model'];if(!_0x6c6577['query'][_0x038d('0x2b')](_0x038d('0x2c'))){_0x486565[_0x038d('0x18')]=qs['limit'](_0x6c6577[_0x038d('0x25')][_0x038d('0x18')]);_0x486565[_0x038d('0x2d')]=qs[_0x038d('0x2d')](_0x6c6577['query'][_0x038d('0x2d')]);}_0x486565['order']=qs[_0x038d('0x2e')](_0x6c6577['query']['sort']);_0x486565[_0x038d('0x2f')]=qs['filters'](_[_0x038d('0x30')](_0x6c6577[_0x038d('0x25')],_0x34caf6[_0x038d('0x31')]),_0x39bf17);if(_0x6c6577[_0x038d('0x25')][_0x038d('0x32')]){_0x486565[_0x038d('0x2f')]=_['merge'](_0x486565[_0x038d('0x2f')],{'$or':_[_0x038d('0x33')](_0x39bf17,function(_0x4aa03b){if(_0x4aa03b[_0x038d('0x23')]!==_0x038d('0x34')){var _0x1aa045={};_0x1aa045[_0x4aa03b['name']]={'$like':'%'+_0x6c6577[_0x038d('0x25')]['filter']+'%'};return _0x1aa045;}})});}_0x486565=_[_0x038d('0x35')]({},_0x486565,_0x6c6577[_0x038d('0x36')]);var _0xc4a3f7={'where':_0x486565[_0x038d('0x2f')]};return db[_0x038d('0x37')][_0x038d('0x19')](_0xc4a3f7)[_0x038d('0x1e')](function(_0x2093d5){_0x236ea7['count']=_0x2093d5;if(_0x6c6577[_0x038d('0x25')][_0x038d('0x38')]){_0x486565[_0x038d('0x39')]=[{'all':!![]}];}return db['UserProfileSection'][_0x038d('0x3a')](_0x486565);})['then'](function(_0x2a892b){_0x236ea7[_0x038d('0x3b')]=_0x2a892b;return _0x236ea7;})[_0x038d('0x1e')](respondWithFilteredResult(_0x31c636,_0x486565))[_0x038d('0x3c')](handleError(_0x31c636,null));};exports['show']=function(_0x253168,_0x937481){var _0x4c7041={'raw':![],'where':{'id':_0x253168['params']['id']}},_0x5d88ee={};_0x5d88ee[_0x038d('0x27')]=_[_0x038d('0x3d')](db[_0x038d('0x37')]['rawAttributes']);_0x5d88ee[_0x038d('0x25')]=_[_0x038d('0x3d')](_0x253168[_0x038d('0x25')]);_0x5d88ee[_0x038d('0x31')]=_['intersection'](_0x5d88ee[_0x038d('0x27')],_0x5d88ee[_0x038d('0x25')]);_0x4c7041[_0x038d('0x28')]=_[_0x038d('0x26')](_0x5d88ee[_0x038d('0x27')],qs['fields'](_0x253168[_0x038d('0x25')][_0x038d('0x29')]));_0x4c7041[_0x038d('0x28')]=_0x4c7041[_0x038d('0x28')][_0x038d('0x2a')]?_0x4c7041['attributes']:_0x5d88ee['model'];if(_0x253168[_0x038d('0x25')][_0x038d('0x38')]){_0x4c7041[_0x038d('0x39')]=[{'all':!![]}];}_0x4c7041=_[_0x038d('0x35')]({},_0x4c7041,_0x253168[_0x038d('0x36')]);return db[_0x038d('0x37')][_0x038d('0x3e')](_0x4c7041)[_0x038d('0x1e')](handleEntityNotFound(_0x937481,null))[_0x038d('0x1e')](respondWithResult(_0x937481,null))['catch'](handleError(_0x937481,null));};exports[_0x038d('0x3f')]=function(_0x56ff4e,_0x2057bf){return db[_0x038d('0x37')][_0x038d('0x3f')](_0x56ff4e[_0x038d('0x40')],{})[_0x038d('0x1e')](respondWithResult(_0x2057bf,0xc9))[_0x038d('0x3c')](handleError(_0x2057bf,null));};exports[_0x038d('0x1d')]=function(_0x2bf21e,_0x11366c){if(_0x2bf21e['body']['id']){delete _0x2bf21e['body']['id'];}return db['UserProfileSection'][_0x038d('0x3e')]({'where':{'id':_0x2bf21e[_0x038d('0x41')]['id']}})[_0x038d('0x1e')](handleEntityNotFound(_0x11366c,null))[_0x038d('0x1e')](saveUpdates(_0x2bf21e[_0x038d('0x40')],null))[_0x038d('0x1e')](respondWithResult(_0x11366c,null))[_0x038d('0x3c')](handleError(_0x11366c,null));};exports[_0x038d('0x42')]=function(_0x33a309,_0x53b08b){return db[_0x038d('0x37')][_0x038d('0x3e')]({'where':{'id':_0x33a309[_0x038d('0x41')]['id']}})[_0x038d('0x1e')](handleEntityNotFound(_0x53b08b,null))[_0x038d('0x1e')](removeEntity(_0x53b08b,null))[_0x038d('0x3c')](handleError(_0x53b08b,null));};exports['describe']=function(_0x331aea,_0x3d4a68){return db[_0x038d('0x37')][_0x038d('0x43')]()[_0x038d('0x1e')](respondWithResult(_0x3d4a68,null))['catch'](handleError(_0x3d4a68,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 040bcf9..8135b67 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 _0xa59b=['user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa59b,0x104));var _0xba59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa59b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba59('0x0'));var util=require('util');var logger=require(_0xba59('0x1'))(_0xba59('0x2'));var moment=require(_0xba59('0x3'));var BPromise=require(_0xba59('0x4'));var rp=require(_0xba59('0x5'));var fs=require('fs');var path=require(_0xba59('0x6'));var rimraf=require('rimraf');var config=require(_0xba59('0x7'));var attributes=require(_0xba59('0x8'));module[_0xba59('0x9')]=function(_0x393090,_0x28e28b){return _0x393090[_0xba59('0xa')](_0xba59('0xb'),attributes,{'tableName':_0xba59('0xc'),'paranoid':![],'indexes':[{'name':_0xba59('0xd'),'fields':[_0xba59('0xe'),_0xba59('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x263f=['lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','compositeIndex','sectionId','userProfileId'];(function(_0x172061,_0x2d833e){var _0x41e8be=function(_0x2b5e6c){while(--_0x2b5e6c){_0x172061['push'](_0x172061['shift']());}};_0x41e8be(++_0x2d833e);}(_0x263f,0x1a0));var _0xf263=function(_0x560ed4,_0x42e65c){_0x560ed4=_0x560ed4-0x0;var _0x12ad88=_0x263f[_0x560ed4];return _0x12ad88;};'use strict';var _=require(_0xf263('0x0'));var util=require('util');var logger=require(_0xf263('0x1'))(_0xf263('0x2'));var moment=require(_0xf263('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf263('0x4'));var rimraf=require(_0xf263('0x5'));var config=require(_0xf263('0x6'));var attributes=require(_0xf263('0x7'));module[_0xf263('0x8')]=function(_0x147d0e,_0x5132f6){return _0x147d0e['define'](_0xf263('0x9'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0xf263('0xa'),'fields':[_0xf263('0xb'),_0xf263('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 7a155a7..b25b917 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 _0x191b=['UserProfileSection,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x206f4b,_0x346117){var _0x20599c=function(_0x2f15b3){while(--_0x2f15b3){_0x206f4b['push'](_0x206f4b['shift']());}};_0x20599c(++_0x346117);}(_0x191b,0x95));var _0xb191=function(_0x488729,_0xf22356){_0x488729=_0x488729-0x0;var _0x1e028b=_0x191b[_0x488729];return _0x1e028b;};'use strict';var _=require(_0xb191('0x0'));var util=require(_0xb191('0x1'));var moment=require('moment');var BPromise=require(_0xb191('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb191('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb191('0x4'))(_0xb191('0x5'));var config=require('../../config/environment');var jayson=require(_0xb191('0x6'));var client=jayson[_0xb191('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20b6e1,_0x421d56,_0x2e04cc){return new BPromise(function(_0x2c9cdf,_0xa1e70b){return client[_0xb191('0x8')](_0x20b6e1,_0x2e04cc)['then'](function(_0x94a53a){logger[_0xb191('0x9')](_0xb191('0xa'),_0x421d56,_0xb191('0xb'));logger[_0xb191('0xc')](_0xb191('0xd'),_0x421d56,_0xb191('0xb'),JSON['stringify'](_0x94a53a));if(_0x94a53a['error']){if(_0x94a53a[_0xb191('0xe')]['code']===0x1f4){logger[_0xb191('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x421d56,_0x94a53a[_0xb191('0xe')][_0xb191('0xf')]);return _0xa1e70b(_0x94a53a[_0xb191('0xe')][_0xb191('0xf')]);}logger[_0xb191('0xe')](_0xb191('0xa'),_0x421d56,_0x94a53a[_0xb191('0xe')][_0xb191('0xf')]);return _0x2c9cdf(_0x94a53a['error'][_0xb191('0xf')]);}else{logger[_0xb191('0x9')](_0xb191('0xa'),_0x421d56,'request\x20sent');_0x2c9cdf(_0x94a53a[_0xb191('0x10')]['message']);}})[_0xb191('0x11')](function(_0x146dd1){logger[_0xb191('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x421d56,_0x146dd1);_0xa1e70b(_0x146dd1);});});} \ No newline at end of file +var _0x9bce=['../../config/logger','../../config/environment','jayson/promise','client','then','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x222697,_0x1aabaf){var _0x3797cd=function(_0x172dc0){while(--_0x172dc0){_0x222697['push'](_0x222697['shift']());}};_0x3797cd(++_0x1aabaf);}(_0x9bce,0x125));var _0xe9bc=function(_0xc72fd6,_0x20945f){_0xc72fd6=_0xc72fd6-0x0;var _0x1c08b7=_0x9bce[_0xc72fd6];return _0x1c08b7;};'use strict';var _=require(_0xe9bc('0x0'));var util=require(_0xe9bc('0x1'));var moment=require(_0xe9bc('0x2'));var BPromise=require('bluebird');var rs=require(_0xe9bc('0x3'));var fs=require('fs');var Redis=require(_0xe9bc('0x4'));var db=require(_0xe9bc('0x5'))['db'];var utils=require(_0xe9bc('0x6'));var logger=require(_0xe9bc('0x7'))('rpc');var config=require(_0xe9bc('0x8'));var jayson=require(_0xe9bc('0x9'));var client=jayson[_0xe9bc('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x319a0c,_0xd89519,_0x792104){return new BPromise(function(_0x1cfc0d,_0x4fe28b){return client['request'](_0x319a0c,_0x792104)[_0xe9bc('0xb')](function(_0xb71998){logger[_0xe9bc('0xc')](_0xe9bc('0xd'),_0xd89519,_0xe9bc('0xe'));logger[_0xe9bc('0xf')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0xd89519,'request\x20sent',JSON[_0xe9bc('0x10')](_0xb71998));if(_0xb71998[_0xe9bc('0x11')]){if(_0xb71998[_0xe9bc('0x11')][_0xe9bc('0x12')]===0x1f4){logger[_0xe9bc('0x11')]('UserProfileSection,\x20%s,\x20%s',_0xd89519,_0xb71998['error'][_0xe9bc('0x13')]);return _0x4fe28b(_0xb71998[_0xe9bc('0x11')][_0xe9bc('0x13')]);}logger[_0xe9bc('0x11')](_0xe9bc('0xd'),_0xd89519,_0xb71998['error'][_0xe9bc('0x13')]);return _0x1cfc0d(_0xb71998['error'][_0xe9bc('0x13')]);}else{logger[_0xe9bc('0xc')](_0xe9bc('0xd'),_0xd89519,_0xe9bc('0xe'));_0x1cfc0d(_0xb71998['result'][_0xe9bc('0x13')]);}})['catch'](function(_0x133e3c){logger['error'](_0xe9bc('0xd'),_0xd89519,_0x133e3c);_0x4fe28b(_0x133e3c);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index e5f5414..7dcf0ef 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(_0x51d22e,_0x276640){var _0x275be3=function(_0x52d368){while(--_0x52d368){_0x51d22e['push'](_0x51d22e['shift']());}};_0x275be3(++_0x276640);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x66da3a,_0x12ba4f){var _0x354bdf=function(_0x58fb10){while(--_0x58fb10){_0x66da3a['push'](_0x66da3a['shift']());}};_0x354bdf(++_0x12ba4f);}(_0xe706,0xa3));var _0x6e70=function(_0x1cfb6e,_0x33de88){_0x1cfb6e=_0x1cfb6e-0x0;var _0x12d65c=_0xe706[_0x1cfb6e];return _0x12d65c;};'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/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index ebc2395..8ae4442 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 _0xcbc5=['sequelize','exports','INTEGER'];(function(_0x820843,_0x4b6f7e){var _0x2077c2=function(_0x26e103){while(--_0x26e103){_0x820843['push'](_0x820843['shift']());}};_0x2077c2(++_0x4b6f7e);}(_0xcbc5,0x7b));var _0x5cbc=function(_0x5b740b,_0x381833){_0x5b740b=_0x5b740b-0x0;var _0x6f8f4e=_0xcbc5[_0x5b740b];return _0x6f8f4e;};'use strict';var Sequelize=require(_0x5cbc('0x0'));module[_0x5cbc('0x1')]={'penalty':{'type':Sequelize[_0x5cbc('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0a18=['exports','INTEGER'];(function(_0x58a2a2,_0x172369){var _0x9edfdb=function(_0xd8f3fd){while(--_0xd8f3fd){_0x58a2a2['push'](_0x58a2a2['shift']());}};_0x9edfdb(++_0x172369);}(_0x0a18,0x158));var _0x80a1=function(_0x40a825,_0x3bac79){_0x40a825=_0x40a825-0x0;var _0x273a54=_0x0a18[_0x40a825];return _0x273a54;};'use strict';var Sequelize=require('sequelize');module[_0x80a1('0x0')]={'penalty':{'type':Sequelize[_0x80a1('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 4738d91..affb527 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 _0x9582=['bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','user_has_sms_queues','lodash','util','../../config/logger','api','moment'];(function(_0x33b62d,_0x507d01){var _0x215d79=function(_0x3b7c4f){while(--_0x3b7c4f){_0x33b62d['push'](_0x33b62d['shift']());}};_0x215d79(++_0x507d01);}(_0x9582,0x95));var _0x2958=function(_0xa30984,_0x544485){_0xa30984=_0xa30984-0x0;var _0x18a60d=_0x9582[_0xa30984];return _0x18a60d;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var logger=require(_0x2958('0x2'))(_0x2958('0x3'));var moment=require(_0x2958('0x4'));var BPromise=require(_0x2958('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2958('0x6'));var rimraf=require(_0x2958('0x7'));var config=require(_0x2958('0x8'));var attributes=require(_0x2958('0x9'));module[_0x2958('0xa')]=function(_0xbde128,_0x88ffaa){return _0xbde128[_0x2958('0xb')](_0x2958('0xc'),attributes,{'tableName':_0x2958('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ec2=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','user_has_sms_queues'];(function(_0x2ec2bf,_0x64e983){var _0x2c279c=function(_0x41fe42){while(--_0x41fe42){_0x2ec2bf['push'](_0x2ec2bf['shift']());}};_0x2c279c(++_0x64e983);}(_0x6ec2,0x78));var _0x26ec=function(_0x301e0b,_0x5025e8){_0x301e0b=_0x301e0b-0x0;var _0x541d89=_0x6ec2[_0x301e0b];return _0x541d89;};'use strict';var _=require(_0x26ec('0x0'));var util=require(_0x26ec('0x1'));var logger=require(_0x26ec('0x2'))(_0x26ec('0x3'));var moment=require(_0x26ec('0x4'));var BPromise=require(_0x26ec('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x26ec('0x6'));var rimraf=require(_0x26ec('0x7'));var config=require(_0x26ec('0x8'));var attributes=require(_0x26ec('0x9'));module[_0x26ec('0xa')]=function(_0x4ce209,_0x3b5955){return _0x4ce209['define']('UserSmsQueue',attributes,{'tableName':_0x26ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index 3f2053f..d12df90 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 _0x5bbe=['http','request','then','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','info','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0x5bbe,0x1c0));var _0xe5bb=function(_0x17d613,_0x27b2c4){_0x17d613=_0x17d613-0x0;var _0x18c280=_0x5bbe[_0x17d613];return _0x18c280;};'use strict';var _=require(_0xe5bb('0x0'));var util=require(_0xe5bb('0x1'));var moment=require(_0xe5bb('0x2'));var BPromise=require('bluebird');var rs=require(_0xe5bb('0x3'));var fs=require('fs');var Redis=require(_0xe5bb('0x4'));var db=require(_0xe5bb('0x5'))['db'];var utils=require(_0xe5bb('0x6'));var logger=require(_0xe5bb('0x7'))(_0xe5bb('0x8'));var config=require(_0xe5bb('0x9'));var jayson=require(_0xe5bb('0xa'));var client=jayson[_0xe5bb('0xb')][_0xe5bb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x29a53f,_0x2287df,_0x199aff){return new BPromise(function(_0xb4a97f,_0x4d3229){return client[_0xe5bb('0xd')](_0x29a53f,_0x199aff)[_0xe5bb('0xe')](function(_0x1f5c2c){logger['info'](_0xe5bb('0xf'),_0x2287df,_0xe5bb('0x10'));logger[_0xe5bb('0x11')](_0xe5bb('0x12'),_0x2287df,'request\x20sent',JSON[_0xe5bb('0x13')](_0x1f5c2c));if(_0x1f5c2c[_0xe5bb('0x14')]){if(_0x1f5c2c['error']['code']===0x1f4){logger[_0xe5bb('0x14')](_0xe5bb('0xf'),_0x2287df,_0x1f5c2c['error'][_0xe5bb('0x15')]);return _0x4d3229(_0x1f5c2c['error'][_0xe5bb('0x15')]);}logger[_0xe5bb('0x14')](_0xe5bb('0xf'),_0x2287df,_0x1f5c2c[_0xe5bb('0x14')][_0xe5bb('0x15')]);return _0xb4a97f(_0x1f5c2c[_0xe5bb('0x14')]['message']);}else{logger[_0xe5bb('0x16')]('UserSmsQueue,\x20%s,\x20%s',_0x2287df,_0xe5bb('0x10'));_0xb4a97f(_0x1f5c2c['result']['message']);}})['catch'](function(_0xc36d56){logger[_0xe5bb('0x14')](_0xe5bb('0xf'),_0x2287df,_0xc36d56);_0x4d3229(_0xc36d56);});});} \ No newline at end of file +var _0x1300=['request\x20sent','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserSmsQueue,\x20%s,\x20%s'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x1300,0x90));var _0x0130=function(_0x5209d9,_0x40846f){_0x5209d9=_0x5209d9-0x0;var _0x200544=_0x1300[_0x5209d9];return _0x200544;};'use strict';var _=require(_0x0130('0x0'));var util=require(_0x0130('0x1'));var moment=require(_0x0130('0x2'));var BPromise=require(_0x0130('0x3'));var rs=require(_0x0130('0x4'));var fs=require('fs');var Redis=require(_0x0130('0x5'));var db=require(_0x0130('0x6'))['db'];var utils=require(_0x0130('0x7'));var logger=require(_0x0130('0x8'))(_0x0130('0x9'));var config=require(_0x0130('0xa'));var jayson=require(_0x0130('0xb'));var client=jayson[_0x0130('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a3054,_0x5b7bd1,_0x1555b4){return new BPromise(function(_0x43ce97,_0x3e36e7){return client['request'](_0x1a3054,_0x1555b4)[_0x0130('0xd')](function(_0x1ef09c){logger[_0x0130('0xe')](_0x0130('0xf'),_0x5b7bd1,_0x0130('0x10'));logger['debug']('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x5b7bd1,_0x0130('0x10'),JSON['stringify'](_0x1ef09c));if(_0x1ef09c[_0x0130('0x11')]){if(_0x1ef09c[_0x0130('0x11')]['code']===0x1f4){logger[_0x0130('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x5b7bd1,_0x1ef09c[_0x0130('0x11')][_0x0130('0x12')]);return _0x3e36e7(_0x1ef09c['error'][_0x0130('0x12')]);}logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x5b7bd1,_0x1ef09c[_0x0130('0x11')]['message']);return _0x43ce97(_0x1ef09c[_0x0130('0x11')][_0x0130('0x12')]);}else{logger[_0x0130('0xe')](_0x0130('0xf'),_0x5b7bd1,_0x0130('0x10'));_0x43ce97(_0x1ef09c['result'][_0x0130('0x12')]);}})[_0x0130('0x13')](function(_0x2d10df){logger[_0x0130('0x11')](_0x0130('0xf'),_0x5b7bd1,_0x2d10df);_0x3e36e7(_0x2d10df);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index f2cb0eb..a954fa0 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 _0x4a93=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a93,0xde));var _0x34a9=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x4a93[_0x8a969d];return _0x1d8dc7;};'use strict';var Sequelize=require(_0x34a9('0x0'));module[_0x34a9('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0x34a9('0x2')]}}; \ No newline at end of file +var _0x6eed=['sequelize','exports'];(function(_0x5508db,_0x22ecbe){var _0x54ce94=function(_0x389047){while(--_0x389047){_0x5508db['push'](_0x5508db['shift']());}};_0x54ce94(++_0x22ecbe);}(_0x6eed,0xce));var _0xd6ee=function(_0x27ec8a,_0x461b20){_0x27ec8a=_0x27ec8a-0x0;var _0x3f9b92=_0x6eed[_0x27ec8a];return _0x3f9b92;};'use strict';var Sequelize=require(_0xd6ee('0x0'));module[_0xd6ee('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index a44524b..e42417d 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(_0x28e86d,_0x6d293a){var _0x150f8b=function(_0x22f5a2){while(--_0x22f5a2){_0x28e86d['push'](_0x28e86d['shift']());}};_0x150f8b(++_0x6d293a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xa9e0[_0x433a86];return _0x23000c;};'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(_0x2d7d7f,_0x20db32){var _0x5d4a88=function(_0x3692aa){while(--_0x3692aa){_0x2d7d7f['push'](_0x2d7d7f['shift']());}};_0x5d4a88(++_0x20db32);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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 94e5c1c..1352694 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 _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x245711,_0x3a6f29){var _0x109c02=function(_0x2dd816){while(--_0x2dd816){_0x245711['push'](_0x245711['shift']());}};_0x109c02(++_0x3a6f29);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x53bcc3,_0x364374){_0x53bcc3=_0x53bcc3-0x0;var _0x47c959=_0xcb91[_0x53bcc3];return _0x47c959;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x699049,_0x51d7d6){var _0x5e25e4=function(_0x331b29){while(--_0x331b29){_0x699049['push'](_0x699049['shift']());}};_0x5e25e4(++_0x51d7d6);}(_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/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index a865cbd..a666676 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 _0x25ea=['INTEGER','sequelize','exports'];(function(_0x552e94,_0x110f92){var _0x12587b=function(_0x36c87e){while(--_0x36c87e){_0x552e94['push'](_0x552e94['shift']());}};_0x12587b(++_0x110f92);}(_0x25ea,0xc4));var _0xa25e=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x25ea[_0x1778e1];return _0x2bc4c6;};'use strict';var Sequelize=require(_0xa25e('0x0'));module[_0xa25e('0x1')]={'penalty':{'type':Sequelize[_0xa25e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe5ff=['exports','sequelize'];(function(_0x4169d8,_0x3d7cd4){var _0x32084a=function(_0x5f59c6){while(--_0x5f59c6){_0x4169d8['push'](_0x4169d8['shift']());}};_0x32084a(++_0x3d7cd4);}(_0xe5ff,0xf7));var _0xfe5f=function(_0x595681,_0x571351){_0x595681=_0x595681-0x0;var _0x12dc7d=_0xe5ff[_0x595681];return _0x12dc7d;};'use strict';var Sequelize=require(_0xfe5f('0x0'));module[_0xfe5f('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 03ce331..f9165e9 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 _0xcc34=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueue.attributes','define','UserVoiceQueue','lodash','util','../../config/logger'];(function(_0x36cc1e,_0x5ba614){var _0x2c174a=function(_0x1da06e){while(--_0x1da06e){_0x36cc1e['push'](_0x36cc1e['shift']());}};_0x2c174a(++_0x5ba614);}(_0xcc34,0x195));var _0x4cc3=function(_0x7ecab,_0x27236b){_0x7ecab=_0x7ecab-0x0;var _0x2b7468=_0xcc34[_0x7ecab];return _0x2b7468;};'use strict';var _=require(_0x4cc3('0x0'));var util=require(_0x4cc3('0x1'));var logger=require(_0x4cc3('0x2'))(_0x4cc3('0x3'));var moment=require('moment');var BPromise=require(_0x4cc3('0x4'));var rp=require(_0x4cc3('0x5'));var fs=require('fs');var path=require(_0x4cc3('0x6'));var rimraf=require(_0x4cc3('0x7'));var config=require(_0x4cc3('0x8'));var attributes=require(_0x4cc3('0x9'));module['exports']=function(_0x5552d9,_0x25dbf3){return _0x5552d9[_0x4cc3('0xa')](_0x4cc3('0xb'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b4b=['rimraf','../../config/environment','./userVoiceQueue.attributes','exports','define','UserVoiceQueue','user_has_voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1c3d63,_0x55118e){var _0x4921d2=function(_0x37ef21){while(--_0x37ef21){_0x1c3d63['push'](_0x1c3d63['shift']());}};_0x4921d2(++_0x55118e);}(_0x8b4b,0x142));var _0xb8b4=function(_0x1f4271,_0x149336){_0x1f4271=_0x1f4271-0x0;var _0x367b53=_0x8b4b[_0x1f4271];return _0x367b53;};'use strict';var _=require(_0xb8b4('0x0'));var util=require(_0xb8b4('0x1'));var logger=require(_0xb8b4('0x2'))(_0xb8b4('0x3'));var moment=require(_0xb8b4('0x4'));var BPromise=require(_0xb8b4('0x5'));var rp=require(_0xb8b4('0x6'));var fs=require('fs');var path=require(_0xb8b4('0x7'));var rimraf=require(_0xb8b4('0x8'));var config=require(_0xb8b4('0x9'));var attributes=require(_0xb8b4('0xa'));module[_0xb8b4('0xb')]=function(_0x1f3383,_0x5ce02d){return _0x1f3383[_0xb8b4('0xc')](_0xb8b4('0xd'),attributes,{'tableName':_0xb8b4('0xe'),'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 73cbad2..40a035c 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 _0xda7e=['jayson/promise','client','http','then','info','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x5d802b,_0x5264b7){var _0x364618=function(_0x17d8d1){while(--_0x17d8d1){_0x5d802b['push'](_0x5d802b['shift']());}};_0x364618(++_0x5264b7);}(_0xda7e,0xa8));var _0xeda7=function(_0xb7a459,_0xc13228){_0xb7a459=_0xb7a459-0x0;var _0x104ab5=_0xda7e[_0xb7a459];return _0x104ab5;};'use strict';var _=require(_0xeda7('0x0'));var util=require(_0xeda7('0x1'));var moment=require(_0xeda7('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeda7('0x3'))['db'];var utils=require(_0xeda7('0x4'));var logger=require(_0xeda7('0x5'))(_0xeda7('0x6'));var config=require(_0xeda7('0x7'));var jayson=require(_0xeda7('0x8'));var client=jayson[_0xeda7('0x9')][_0xeda7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d6630,_0x15bfb9,_0xb85867){return new BPromise(function(_0x326f46,_0x4857d4){return client['request'](_0x3d6630,_0xb85867)[_0xeda7('0xb')](function(_0x47375b){logger[_0xeda7('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x15bfb9,_0xeda7('0xd'));logger[_0xeda7('0xe')](_0xeda7('0xf'),_0x15bfb9,_0xeda7('0xd'),JSON[_0xeda7('0x10')](_0x47375b));if(_0x47375b[_0xeda7('0x11')]){if(_0x47375b[_0xeda7('0x11')][_0xeda7('0x12')]===0x1f4){logger[_0xeda7('0x11')](_0xeda7('0x13'),_0x15bfb9,_0x47375b[_0xeda7('0x11')]['message']);return _0x4857d4(_0x47375b[_0xeda7('0x11')]['message']);}logger[_0xeda7('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x15bfb9,_0x47375b[_0xeda7('0x11')][_0xeda7('0x14')]);return _0x326f46(_0x47375b[_0xeda7('0x11')][_0xeda7('0x14')]);}else{logger['info'](_0xeda7('0x13'),_0x15bfb9,_0xeda7('0xd'));_0x326f46(_0x47375b[_0xeda7('0x15')][_0xeda7('0x14')]);}})['catch'](function(_0x3dc4cf){logger[_0xeda7('0x11')](_0xeda7('0x13'),_0x15bfb9,_0x3dc4cf);_0x4857d4(_0x3dc4cf);});});} \ No newline at end of file +var _0xb607=['then','UserVoiceQueue,\x20%s,\x20%s,\x20%s','error','code','UserVoiceQueue,\x20%s,\x20%s','message','info','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','request'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0xb607,0x1d8));var _0x7b60=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xb607[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x7b60('0x0'));var util=require(_0x7b60('0x1'));var moment=require(_0x7b60('0x2'));var BPromise=require('bluebird');var rs=require(_0x7b60('0x3'));var fs=require('fs');var Redis=require(_0x7b60('0x4'));var db=require(_0x7b60('0x5'))['db'];var utils=require(_0x7b60('0x6'));var logger=require('../../config/logger')(_0x7b60('0x7'));var config=require(_0x7b60('0x8'));var jayson=require(_0x7b60('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x31f0c5,_0x4fbdc1,_0x105adc){return new BPromise(function(_0x346456,_0x204343){return client[_0x7b60('0xa')](_0x31f0c5,_0x105adc)[_0x7b60('0xb')](function(_0x2dbd96){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x4fbdc1,'request\x20sent');logger['debug'](_0x7b60('0xc'),_0x4fbdc1,'request\x20sent',JSON['stringify'](_0x2dbd96));if(_0x2dbd96[_0x7b60('0xd')]){if(_0x2dbd96[_0x7b60('0xd')][_0x7b60('0xe')]===0x1f4){logger[_0x7b60('0xd')](_0x7b60('0xf'),_0x4fbdc1,_0x2dbd96[_0x7b60('0xd')]['message']);return _0x204343(_0x2dbd96[_0x7b60('0xd')][_0x7b60('0x10')]);}logger['error'](_0x7b60('0xf'),_0x4fbdc1,_0x2dbd96[_0x7b60('0xd')][_0x7b60('0x10')]);return _0x346456(_0x2dbd96['error'][_0x7b60('0x10')]);}else{logger[_0x7b60('0x11')](_0x7b60('0xf'),_0x4fbdc1,_0x7b60('0x12'));_0x346456(_0x2dbd96[_0x7b60('0x13')][_0x7b60('0x10')]);}})[_0x7b60('0x14')](function(_0x2d9e63){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x4fbdc1,_0x2d9e63);_0x204343(_0x2d9e63);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index d430dd0..3005d09 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 _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x19119e,_0x2253a9){var _0x37734d=function(_0xb40dd1){while(--_0xb40dd1){_0x19119e['push'](_0x19119e['shift']());}};_0x37734d(++_0x2253a9);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file +var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1b735a,_0x2ccf39){var _0x27570e=function(_0x51b86b){while(--_0x51b86b){_0x1b735a['push'](_0x1b735a['shift']());}};_0x27570e(++_0x2ccf39);}(_0x9c44,0x178));var _0x49c4=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x9c44[_0x255d5b];return _0x3e141a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 1d37320..cbd2b1d 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 _0xc000=['INTEGER','STRING','queue_interface','sequelize','exports','Required\x20by\x20Asterisk'];(function(_0xc42a73,_0x232b84){var _0x108cf9=function(_0x5ea709){while(--_0x5ea709){_0xc42a73['push'](_0xc42a73['shift']());}};_0x108cf9(++_0x232b84);}(_0xc000,0x1cb));var _0x0c00=function(_0x48a7e4,_0x5f50a3){_0x48a7e4=_0x48a7e4-0x0;var _0x11206c=_0xc000[_0x48a7e4];return _0x11206c;};'use strict';var Sequelize=require(_0x0c00('0x0'));module[_0x0c00('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0c00('0x2')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0c00('0x2')},'UserId':{'type':Sequelize[_0x0c00('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0c00('0x4')],'allowNull':![],'unique':_0x0c00('0x5'),'comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x0c00('0x3')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0c00('0x5'),'comment':_0x0c00('0x2')},'penalty':{'type':Sequelize[_0x0c00('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x0c00('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0x35c8=['STRING','Required\x20by\x20Asterisk','INTEGER'];(function(_0x499eaf,_0x560a5a){var _0x2fa121=function(_0x286a7b){while(--_0x286a7b){_0x499eaf['push'](_0x499eaf['shift']());}};_0x2fa121(++_0x560a5a);}(_0x35c8,0x125));var _0x835c=function(_0x53df78,_0x3a76f9){_0x53df78=_0x53df78-0x0;var _0x23fac6=_0x35c8[_0x53df78];return _0x23fac6;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x835c('0x0')],'primaryKey':!![],'autoIncrement':!![],'comment':'Required\x20by\x20Asterisk'},'membername':{'type':Sequelize[_0x835c('0x1')],'allowNull':![],'comment':_0x835c('0x2')},'UserId':{'type':Sequelize[_0x835c('0x0')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x835c('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x835c('0x1')],'allowNull':![],'unique':'queue_interface','comment':_0x835c('0x2')},'penalty':{'type':Sequelize[_0x835c('0x0')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x835c('0x0')](0xb),'defaultValue':0x0,'comment':_0x835c('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 3e7adc7..69ce779 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 _0xce28=['../../mysqldb','UserVoiceQueueRt','update','emit','hasOwnProperty','events'];(function(_0x544e6f,_0x513bc5){var _0x38e3b2=function(_0x501550){while(--_0x501550){_0x544e6f['push'](_0x544e6f['shift']());}};_0x38e3b2(++_0x513bc5);}(_0xce28,0xb9));var _0x8ce2=function(_0x45b034,_0x3a57dd){_0x45b034=_0x45b034-0x0;var _0x509cb0=_0xce28[_0x45b034];return _0x509cb0;};'use strict';var EventEmitter=require(_0x8ce2('0x0'));var UserVoiceQueueRt=require(_0x8ce2('0x1'))['db'][_0x8ce2('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x8ce2('0x3'),'afterDestroy':'remove'};function emitEvent(_0x471cd1){return function(_0x5b3688,_0x3be473,_0x307bc1){UserVoiceQueueRtEvents[_0x8ce2('0x4')](_0x471cd1+':'+_0x5b3688['id'],_0x5b3688);UserVoiceQueueRtEvents['emit'](_0x471cd1,_0x5b3688);_0x307bc1(null);};}for(var e in events){if(events[_0x8ce2('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module['exports']=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xdd91=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','UserVoiceQueueRt'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xdd91,0x1c9));var _0x1dd9=function(_0x40e9af,_0x2f6037){_0x40e9af=_0x40e9af-0x0;var _0x21a55d=_0xdd91[_0x40e9af];return _0x21a55d;};'use strict';var EventEmitter=require(_0x1dd9('0x0'));var UserVoiceQueueRt=require('../../mysqldb')['db'][_0x1dd9('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x1dd9('0x2')](0x0);var events={'afterCreate':_0x1dd9('0x3'),'afterUpdate':_0x1dd9('0x4'),'afterDestroy':'remove'};function emitEvent(_0x9c5193){return function(_0xb64abc,_0x4f59d9,_0x231fea){UserVoiceQueueRtEvents['emit'](_0x9c5193+':'+_0xb64abc['id'],_0xb64abc);UserVoiceQueueRtEvents[_0x1dd9('0x5')](_0x9c5193,_0xb64abc);_0x231fea(null);};}for(var e in events){if(events[_0x1dd9('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x1dd9('0x7')](e,emitEvent(event));}}module[_0x1dd9('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index f74ae54..731e42d 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 _0x6ed0=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x31e4c6,_0x27d39c){var _0x56c225=function(_0x54fb1a){while(--_0x54fb1a){_0x31e4c6['push'](_0x31e4c6['shift']());}};_0x56c225(++_0x27d39c);}(_0x6ed0,0xb7));var _0x06ed=function(_0x46a627,_0x32f6df){_0x46a627=_0x46a627-0x0;var _0x184b20=_0x6ed0[_0x46a627];return _0x184b20;};'use strict';var _=require(_0x06ed('0x0'));var util=require(_0x06ed('0x1'));var logger=require(_0x06ed('0x2'))(_0x06ed('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x06ed('0x4'));var fs=require('fs');var path=require(_0x06ed('0x5'));var rimraf=require(_0x06ed('0x6'));var config=require(_0x06ed('0x7'));var attributes=require(_0x06ed('0x8'));module[_0x06ed('0x9')]=function(_0x208292,_0x35ce91){return _0x208292[_0x06ed('0xa')](_0x06ed('0xb'),attributes,{'tableName':_0x06ed('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d71=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x4485d7,_0x47bdbb){var _0x224643=function(_0x19e832){while(--_0x19e832){_0x4485d7['push'](_0x4485d7['shift']());}};_0x224643(++_0x47bdbb);}(_0x7d71,0x17a));var _0x17d7=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x7d71[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0x17d7('0x0'));var util=require('util');var logger=require(_0x17d7('0x1'))(_0x17d7('0x2'));var moment=require(_0x17d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x17d7('0x4'));var fs=require('fs');var path=require(_0x17d7('0x5'));var rimraf=require(_0x17d7('0x6'));var config=require(_0x17d7('0x7'));var attributes=require(_0x17d7('0x8'));module['exports']=function(_0x25ba41,_0x492e13){return _0x25ba41[_0x17d7('0x9')](_0x17d7('0xa'),attributes,{'tableName':_0x17d7('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 bfeca54..ccea623 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 _0xa643=['message','info','result','catch','GetVoiceQueueRtPauses','options','raw','COUNT','sequelize','outboundQueuePauses','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','then','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x7633e0,_0x3e4dbc){var _0x51d91b=function(_0xe438c4){while(--_0xe438c4){_0x7633e0['push'](_0x7633e0['shift']());}};_0x51d91b(++_0x3e4dbc);}(_0xa643,0x73));var _0x3a64=function(_0x371855,_0x11c2b9){_0x371855=_0x371855-0x0;var _0x5b60aa=_0xa643[_0x371855];return _0x5b60aa;};'use strict';var _=require(_0x3a64('0x0'));var util=require(_0x3a64('0x1'));var moment=require('moment');var BPromise=require(_0x3a64('0x2'));var rs=require(_0x3a64('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3a64('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3a64('0x5'))(_0x3a64('0x6'));var config=require(_0x3a64('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3a64('0x8')][_0x3a64('0x9')]({'port':0x232a});config[_0x3a64('0xa')]=_[_0x3a64('0xb')](config[_0x3a64('0xa')],{'host':_0x3a64('0xc'),'port':0x18eb});var socket=require(_0x3a64('0xd'))(new Redis(config['redis']));require(_0x3a64('0xe'))[_0x3a64('0xf')](socket);function respondWithRpcPromise(_0x1d77c1,_0x320f13,_0x12ae9a){return new BPromise(function(_0x1715c3,_0x386cd1){return client[_0x3a64('0x10')](_0x1d77c1,_0x12ae9a)[_0x3a64('0x11')](function(_0x331349){logger['info']('UserVoiceQueueRt,\x20%s,\x20%s',_0x320f13,_0x3a64('0x12'));logger[_0x3a64('0x13')](_0x3a64('0x14'),_0x320f13,'request\x20sent',JSON[_0x3a64('0x15')](_0x331349));if(_0x331349[_0x3a64('0x16')]){if(_0x331349[_0x3a64('0x16')][_0x3a64('0x17')]===0x1f4){logger[_0x3a64('0x16')](_0x3a64('0x18'),_0x320f13,_0x331349['error'][_0x3a64('0x19')]);return _0x386cd1(_0x331349['error']['message']);}logger[_0x3a64('0x16')](_0x3a64('0x18'),_0x320f13,_0x331349[_0x3a64('0x16')][_0x3a64('0x19')]);return _0x1715c3(_0x331349[_0x3a64('0x16')][_0x3a64('0x19')]);}else{logger[_0x3a64('0x1a')](_0x3a64('0x18'),_0x320f13,_0x3a64('0x12'));_0x1715c3(_0x331349[_0x3a64('0x1b')][_0x3a64('0x19')]);}})[_0x3a64('0x1c')](function(_0x3037d3){logger[_0x3a64('0x16')](_0x3a64('0x18'),_0x320f13,_0x3037d3);_0x386cd1(_0x3037d3);});});}exports[_0x3a64('0x1d')]=function(_0x424a82){var _0x4df73e=this;return new Promise(function(_0x45b863,_0x6d7ce8){return db['UserVoiceQueueRt']['findAll']({'raw':_0x424a82[_0x3a64('0x1e')]?_0x424a82[_0x3a64('0x1e')][_0x3a64('0x1f')]===undefined?!![]:![]:!![],'where':_0x424a82[_0x3a64('0x1e')]?_0x424a82['options']['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x3a64('0x20'),db[_0x3a64('0x21')]['fn']('IF',db[_0x3a64('0x21')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x3a64('0x22')]]})[_0x3a64('0x11')](function(_0x16358b){logger[_0x3a64('0x1a')](_0x3a64('0x1d'),_0x424a82);logger[_0x3a64('0x13')](_0x3a64('0x1d'),_0x424a82,JSON['stringify'](_0x16358b));_0x45b863(_0x16358b);})[_0x3a64('0x1c')](function(_0x51fbaa){logger[_0x3a64('0x16')](_0x3a64('0x1d'),_0x51fbaa[_0x3a64('0x19')],_0x424a82);_0x6d7ce8(_0x4df73e['error'](0x1f4,_0x51fbaa['message']));});});}; \ No newline at end of file +var _0xb75c=['error','code','message','result','GetVoiceQueueRtPauses','findAll','options','where','COUNT','sequelize','literal','then','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s'];(function(_0xe4bb6d,_0x2723ee){var _0x15cfe6=function(_0x24ef89){while(--_0x24ef89){_0xe4bb6d['push'](_0xe4bb6d['shift']());}};_0x15cfe6(++_0x2723ee);}(_0xb75c,0x114));var _0xcb75=function(_0x20b0f2,_0x383475){_0x20b0f2=_0x20b0f2-0x0;var _0xc1d2a=_0xb75c[_0x20b0f2];return _0xc1d2a;};'use strict';var _=require(_0xcb75('0x0'));var util=require('util');var moment=require(_0xcb75('0x1'));var BPromise=require(_0xcb75('0x2'));var rs=require(_0xcb75('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcb75('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xcb75('0x5'))(_0xcb75('0x6'));var config=require(_0xcb75('0x7'));var jayson=require(_0xcb75('0x8'));var client=jayson['client'][_0xcb75('0x9')]({'port':0x232a});config[_0xcb75('0xa')]=_[_0xcb75('0xb')](config[_0xcb75('0xa')],{'host':_0xcb75('0xc'),'port':0x18eb});var socket=require(_0xcb75('0xd'))(new Redis(config[_0xcb75('0xa')]));require(_0xcb75('0xe'))['register'](socket);function respondWithRpcPromise(_0x279c1a,_0x55390a,_0x23b447){return new BPromise(function(_0xe7e2e1,_0x348d6b){return client[_0xcb75('0xf')](_0x279c1a,_0x23b447)['then'](function(_0x2e565b){logger[_0xcb75('0x10')](_0xcb75('0x11'),_0x55390a,_0xcb75('0x12'));logger[_0xcb75('0x13')](_0xcb75('0x14'),_0x55390a,'request\x20sent',JSON['stringify'](_0x2e565b));if(_0x2e565b['error']){if(_0x2e565b[_0xcb75('0x15')][_0xcb75('0x16')]===0x1f4){logger['error'](_0xcb75('0x11'),_0x55390a,_0x2e565b[_0xcb75('0x15')][_0xcb75('0x17')]);return _0x348d6b(_0x2e565b['error'][_0xcb75('0x17')]);}logger[_0xcb75('0x15')](_0xcb75('0x11'),_0x55390a,_0x2e565b[_0xcb75('0x15')][_0xcb75('0x17')]);return _0xe7e2e1(_0x2e565b[_0xcb75('0x15')][_0xcb75('0x17')]);}else{logger['info'](_0xcb75('0x11'),_0x55390a,_0xcb75('0x12'));_0xe7e2e1(_0x2e565b[_0xcb75('0x18')][_0xcb75('0x17')]);}})['catch'](function(_0x514c04){logger['error'](_0xcb75('0x11'),_0x55390a,_0x514c04);_0x348d6b(_0x514c04);});});}exports[_0xcb75('0x19')]=function(_0x4fb290){var _0x75f629=this;return new Promise(function(_0x3a1103,_0x3a24c6){return db['UserVoiceQueueRt'][_0xcb75('0x1a')]({'raw':_0x4fb290['options']?_0x4fb290['options']['raw']===undefined?!![]:![]:!![],'where':_0x4fb290['options']?_0x4fb290[_0xcb75('0x1b')][_0xcb75('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0xcb75('0x1d'),db['sequelize']['fn']('IF',db[_0xcb75('0x1e')][_0xcb75('0x1f')]('`paused`\x20=\x201,\x201,\x20null'))),'outboundQueuePauses']]})[_0xcb75('0x20')](function(_0x34dad0){logger[_0xcb75('0x10')](_0xcb75('0x19'),_0x4fb290);logger[_0xcb75('0x13')](_0xcb75('0x19'),_0x4fb290,JSON['stringify'](_0x34dad0));_0x3a1103(_0x34dad0);})['catch'](function(_0x20522a){logger['error'](_0xcb75('0x19'),_0x20522a[_0xcb75('0x17')],_0x4fb290);_0x3a24c6(_0x75f629[_0xcb75('0x15')](0x1f4,_0x20522a[_0xcb75('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 397d281..7363251 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 _0x2d95=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x2d95,0xca));var _0x52d9=function(_0x5cc8a1,_0x314f50){_0x5cc8a1=_0x5cc8a1-0x0;var _0x531ab2=_0x2d95[_0x5cc8a1];return _0x531ab2;};'use strict';var UserVoiceQueueRtEvents=require(_0x52d9('0x0'));var events=['save',_0x52d9('0x1'),'update'];function createListener(_0x2d961b,_0x14ee56){return function(_0x4206cb){_0x14ee56['emit'](_0x2d961b,_0x4206cb);};}function removeListener(_0x323dcd,_0x7aff8f){return function(){UserVoiceQueueRtEvents[_0x52d9('0x2')](_0x323dcd,_0x7aff8f);};}exports[_0x52d9('0x3')]=function(_0x16eb99){for(var _0x2735cc=0x0,_0x3b3202=events[_0x52d9('0x4')];_0x2735cc<_0x3b3202;_0x2735cc++){var _0x27d7cd=events[_0x2735cc];var _0x45cf52=createListener(_0x52d9('0x5')+_0x27d7cd,_0x16eb99);UserVoiceQueueRtEvents['on'](_0x27d7cd,_0x45cf52);}}; \ No newline at end of file +var _0x90ec=['removeListener','register','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','update','emit'];(function(_0x3b7bec,_0x26560e){var _0x1840c4=function(_0x3feb35){while(--_0x3feb35){_0x3b7bec['push'](_0x3b7bec['shift']());}};_0x1840c4(++_0x26560e);}(_0x90ec,0x1d4));var _0xc90e=function(_0x353c0e,_0x5166c4){_0x353c0e=_0x353c0e-0x0;var _0xae7cd5=_0x90ec[_0x353c0e];return _0xae7cd5;};'use strict';var UserVoiceQueueRtEvents=require(_0xc90e('0x0'));var events=[_0xc90e('0x1'),'remove',_0xc90e('0x2')];function createListener(_0x10e2f7,_0x3e4b58){return function(_0x41a979){_0x3e4b58[_0xc90e('0x3')](_0x10e2f7,_0x41a979);};}function removeListener(_0x57acfe,_0x1c13c4){return function(){UserVoiceQueueRtEvents[_0xc90e('0x4')](_0x57acfe,_0x1c13c4);};}exports[_0xc90e('0x5')]=function(_0x54a0a8){for(var _0x259c62=0x0,_0x48bea9=events[_0xc90e('0x6')];_0x259c62<_0x48bea9;_0x259c62++){var _0x14311a=events[_0x259c62];var _0x48253c=createListener(_0xc90e('0x7')+_0x14311a,_0x54a0a8);UserVoiceQueueRtEvents['on'](_0x14311a,_0x48253c);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index edd8699..a95895a 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(_0xb08344,_0x232dee){var _0x5c8c7e=function(_0xaae4b5){while(--_0xaae4b5){_0xb08344['push'](_0xb08344['shift']());}};_0x5c8c7e(++_0x232dee);}(_0x70e0,0x17b));var _0x070e=function(_0xc77160,_0x4edb90){_0xc77160=_0xc77160-0x0;var _0x2bcafd=_0x70e0[_0xc77160];return _0x2bcafd;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x61780e,_0x44b778){var _0x460363=function(_0x53c154){while(--_0x53c154){_0x61780e['push'](_0x61780e['shift']());}};_0x460363(++_0x44b778);}(_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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 015a486..30a04ea 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 _0xfc04=['exports','INTEGER'];(function(_0x32f9ca,_0x2fa8bc){var _0x52e083=function(_0x4fd86a){while(--_0x4fd86a){_0x32f9ca['push'](_0x32f9ca['shift']());}};_0x52e083(++_0x2fa8bc);}(_0xfc04,0x92));var _0x4fc0=function(_0x2caa42,_0x28abb5){_0x2caa42=_0x2caa42-0x0;var _0x25d688=_0xfc04[_0x2caa42];return _0x25d688;};'use strict';var Sequelize=require('sequelize');module[_0x4fc0('0x0')]={'penalty':{'type':Sequelize[_0x4fc0('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0e12=['INTEGER','sequelize'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x0e12,0x169));var _0x20e1=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x0e12[_0x31e29a];return _0x32d892;};'use strict';var Sequelize=require(_0x20e1('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x20e1('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index 49e157a..d6d21fe 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 _0xda5e=['path','rimraf','../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x2ac84e,_0x3d8931){var _0x481a04=function(_0x367b52){while(--_0x367b52){_0x2ac84e['push'](_0x2ac84e['shift']());}};_0x481a04(++_0x3d8931);}(_0xda5e,0xe3));var _0xeda5=function(_0xe6020c,_0x50300e){_0xe6020c=_0xe6020c-0x0;var _0x36f045=_0xda5e[_0xe6020c];return _0x36f045;};'use strict';var _=require(_0xeda5('0x0'));var util=require(_0xeda5('0x1'));var logger=require(_0xeda5('0x2'))(_0xeda5('0x3'));var moment=require(_0xeda5('0x4'));var BPromise=require(_0xeda5('0x5'));var rp=require(_0xeda5('0x6'));var fs=require('fs');var path=require(_0xeda5('0x7'));var rimraf=require(_0xeda5('0x8'));var config=require(_0xeda5('0x9'));var attributes=require(_0xeda5('0xa'));module[_0xeda5('0xb')]=function(_0x52f2e3,_0x5f2785){return _0x52f2e3['define'](_0xeda5('0xc'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe3ee=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','UserWhatsappQueue','lodash'];(function(_0x5a7c74,_0x5ac3cb){var _0x3b5f9e=function(_0x31ca57){while(--_0x31ca57){_0x5a7c74['push'](_0x5a7c74['shift']());}};_0x3b5f9e(++_0x5ac3cb);}(_0xe3ee,0x1ee));var _0xee3e=function(_0x12f2ea,_0x57e11e){_0x12f2ea=_0x12f2ea-0x0;var _0x355367=_0xe3ee[_0x12f2ea];return _0x355367;};'use strict';var _=require(_0xee3e('0x0'));var util=require('util');var logger=require(_0xee3e('0x1'))(_0xee3e('0x2'));var moment=require(_0xee3e('0x3'));var BPromise=require('bluebird');var rp=require(_0xee3e('0x4'));var fs=require('fs');var path=require(_0xee3e('0x5'));var rimraf=require(_0xee3e('0x6'));var config=require(_0xee3e('0x7'));var attributes=require('./userWhatsappQueue.attributes');module[_0xee3e('0x8')]=function(_0x30a27a,_0x3a8325){return _0x30a27a[_0xee3e('0x9')](_0xee3e('0xa'),attributes,{'tableName':'user_has_whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js b/server/api/userWhatsappQueue/userWhatsappQueue.rpc.js index 8bc020e..1eb273a 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 _0x1a13=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','UserWhatsappQueue,\x20%s,\x20%s','request\x20sent','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x52bf9e,_0x4c30c6){var _0x37a0f9=function(_0x2314d6){while(--_0x2314d6){_0x52bf9e['push'](_0x52bf9e['shift']());}};_0x37a0f9(++_0x4c30c6);}(_0x1a13,0x1ce));var _0x31a1=function(_0x63662c,_0x1cfecb){_0x63662c=_0x63662c-0x0;var _0x274b68=_0x1a13[_0x63662c];return _0x274b68;};'use strict';var _=require(_0x31a1('0x0'));var util=require(_0x31a1('0x1'));var moment=require('moment');var BPromise=require(_0x31a1('0x2'));var rs=require(_0x31a1('0x3'));var fs=require('fs');var Redis=require(_0x31a1('0x4'));var db=require(_0x31a1('0x5'))['db'];var utils=require(_0x31a1('0x6'));var logger=require(_0x31a1('0x7'))(_0x31a1('0x8'));var config=require(_0x31a1('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x31a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1364d8,_0x5499fd,_0x1470b0){return new BPromise(function(_0x866673,_0xe582d2){return client[_0x31a1('0xb')](_0x1364d8,_0x1470b0)['then'](function(_0x1a73cd){logger[_0x31a1('0xc')](_0x31a1('0xd'),_0x5499fd,_0x31a1('0xe'));logger['debug'](_0x31a1('0xf'),_0x5499fd,_0x31a1('0xe'),JSON[_0x31a1('0x10')](_0x1a73cd));if(_0x1a73cd[_0x31a1('0x11')]){if(_0x1a73cd['error'][_0x31a1('0x12')]===0x1f4){logger[_0x31a1('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5499fd,_0x1a73cd['error'][_0x31a1('0x13')]);return _0xe582d2(_0x1a73cd[_0x31a1('0x11')]['message']);}logger[_0x31a1('0x11')](_0x31a1('0xd'),_0x5499fd,_0x1a73cd['error'][_0x31a1('0x13')]);return _0x866673(_0x1a73cd[_0x31a1('0x11')][_0x31a1('0x13')]);}else{logger[_0x31a1('0xc')](_0x31a1('0xd'),_0x5499fd,'request\x20sent');_0x866673(_0x1a73cd[_0x31a1('0x14')][_0x31a1('0x13')]);}})[_0x31a1('0x15')](function(_0x51ae18){logger[_0x31a1('0x11')]('UserWhatsappQueue,\x20%s,\x20%s',_0x5499fd,_0x51ae18);_0xe582d2(_0x51ae18);});});} \ No newline at end of file +var _0x4c44=['error','code','message','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x1fbd97,_0x315ae2){var _0x2ff7a7=function(_0xbedf76){while(--_0xbedf76){_0x1fbd97['push'](_0x1fbd97['shift']());}};_0x2ff7a7(++_0x315ae2);}(_0x4c44,0x1bb));var _0x44c4=function(_0x2ed345,_0x59c3c2){_0x2ed345=_0x2ed345-0x0;var _0x1e812c=_0x4c44[_0x2ed345];return _0x1e812c;};'use strict';var _=require('lodash');var util=require(_0x44c4('0x0'));var moment=require('moment');var BPromise=require(_0x44c4('0x1'));var rs=require(_0x44c4('0x2'));var fs=require('fs');var Redis=require(_0x44c4('0x3'));var db=require(_0x44c4('0x4'))['db'];var utils=require(_0x44c4('0x5'));var logger=require('../../config/logger')(_0x44c4('0x6'));var config=require(_0x44c4('0x7'));var jayson=require(_0x44c4('0x8'));var client=jayson[_0x44c4('0x9')][_0x44c4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41232d,_0x3d7618,_0x7460de){return new BPromise(function(_0x5b21e7,_0x37a8a5){return client[_0x44c4('0xb')](_0x41232d,_0x7460de)[_0x44c4('0xc')](function(_0x5a41ed){logger[_0x44c4('0xd')](_0x44c4('0xe'),_0x3d7618,'request\x20sent');logger[_0x44c4('0xf')](_0x44c4('0x10'),_0x3d7618,_0x44c4('0x11'),JSON[_0x44c4('0x12')](_0x5a41ed));if(_0x5a41ed[_0x44c4('0x13')]){if(_0x5a41ed[_0x44c4('0x13')][_0x44c4('0x14')]===0x1f4){logger['error'](_0x44c4('0xe'),_0x3d7618,_0x5a41ed[_0x44c4('0x13')][_0x44c4('0x15')]);return _0x37a8a5(_0x5a41ed[_0x44c4('0x13')][_0x44c4('0x15')]);}logger[_0x44c4('0x13')](_0x44c4('0xe'),_0x3d7618,_0x5a41ed['error']['message']);return _0x5b21e7(_0x5a41ed[_0x44c4('0x13')][_0x44c4('0x15')]);}else{logger[_0x44c4('0xd')](_0x44c4('0xe'),_0x3d7618,_0x44c4('0x11'));_0x5b21e7(_0x5a41ed['result'][_0x44c4('0x15')]);}})['catch'](function(_0x16373b){logger['error'](_0x44c4('0xe'),_0x3d7618,_0x16373b);_0x37a8a5(_0x16373b);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 6d0c22e..0d64fb3 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 _0x9cff=['index','/:id','show','post','put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./variable.controller','get','isAuthenticated'];(function(_0x18d5d7,_0x19074b){var _0x30a9ea=function(_0x514f3f){while(--_0x514f3f){_0x18d5d7['push'](_0x18d5d7['shift']());}};_0x30a9ea(++_0x19074b);}(_0x9cff,0x1b0));var _0xf9cf=function(_0x2dfd24,_0x20ebbf){_0x2dfd24=_0x2dfd24-0x0;var _0x454df8=_0x9cff[_0x2dfd24];return _0x454df8;};'use strict';var multer=require('multer');var util=require(_0xf9cf('0x0'));var path=require(_0xf9cf('0x1'));var timeout=require(_0xf9cf('0x2'));var express=require('express');var router=express[_0xf9cf('0x3')]();var fs_extra=require(_0xf9cf('0x4'));var auth=require(_0xf9cf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf9cf('0x6'));var controller=require(_0xf9cf('0x7'));router[_0xf9cf('0x8')]('/',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xa')]);router[_0xf9cf('0x8')](_0xf9cf('0xb'),auth[_0xf9cf('0x9')](),controller[_0xf9cf('0xc')]);router[_0xf9cf('0xd')]('/',auth[_0xf9cf('0x9')](),controller['create']);router[_0xf9cf('0xe')](_0xf9cf('0xb'),auth['isAuthenticated'](),controller[_0xf9cf('0xf')]);router['delete']('/:id',auth[_0xf9cf('0x9')](),controller[_0xf9cf('0x10')]);module['exports']=router; \ No newline at end of file +var _0xe630=['post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x3dc8dc,_0x95c9bc){var _0x36f3ce=function(_0x42c9f0){while(--_0x42c9f0){_0x3dc8dc['push'](_0x3dc8dc['shift']());}};_0x36f3ce(++_0x95c9bc);}(_0xe630,0x149));var _0x0e63=function(_0x13405d,_0xe260e2){_0x13405d=_0x13405d-0x0;var _0x486569=_0xe630[_0x13405d];return _0x486569;};'use strict';var multer=require(_0x0e63('0x0'));var util=require(_0x0e63('0x1'));var path=require('path');var timeout=require(_0x0e63('0x2'));var express=require(_0x0e63('0x3'));var router=express[_0x0e63('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x0e63('0x5'));var interaction=require(_0x0e63('0x6'));var config=require(_0x0e63('0x7'));var controller=require('./variable.controller');router[_0x0e63('0x8')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xa')]);router[_0x0e63('0x8')](_0x0e63('0xb'),auth['isAuthenticated'](),controller[_0x0e63('0xc')]);router[_0x0e63('0xd')]('/',auth[_0x0e63('0x9')](),controller[_0x0e63('0xe')]);router[_0x0e63('0xf')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller[_0x0e63('0x10')]);router[_0x0e63('0x11')](_0x0e63('0xb'),auth[_0x0e63('0x9')](),controller['destroy']);module[_0x0e63('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 92ffd74..27457f7 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 _0x4a25=['sequelize','STRING'];(function(_0x3d02c6,_0x18bc8c){var _0x2f7d92=function(_0x4593f0){while(--_0x4593f0){_0x3d02c6['push'](_0x3d02c6['shift']());}};_0x2f7d92(++_0x18bc8c);}(_0x4a25,0x1d4));var _0x54a2=function(_0x1ad926,_0x3e1fed){_0x1ad926=_0x1ad926-0x0;var _0x1b81dc=_0x4a25[_0x1ad926];return _0x1b81dc;};'use strict';var Sequelize=require(_0x54a2('0x0'));module['exports']={'name':{'type':Sequelize[_0x54a2('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x54a2('0x1')]}}; \ No newline at end of file +var _0xd7f9=['exports','name','STRING','sequelize'];(function(_0x5235dd,_0x3f91cf){var _0x13059d=function(_0x355a98){while(--_0x355a98){_0x5235dd['push'](_0x5235dd['shift']());}};_0x13059d(++_0x3f91cf);}(_0xd7f9,0x8b));var _0x9d7f=function(_0x1b5a5a,_0x1c3b75){_0x1b5a5a=_0x1b5a5a-0x0;var _0x42b32d=_0xd7f9[_0x1b5a5a];return _0x42b32d;};'use strict';var Sequelize=require(_0x9d7f('0x0'));module[_0x9d7f('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x9d7f('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x9d7f('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index 7da1d33..d88904e 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 _0xefe4=['offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Variables','UserProfileResource','error','stack','name','index','map','fieldName','key','keys','query','filters','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','options','includeAll','Variable','findAll','catch','show','params','rawAttributes','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','squel','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','sendStatus','status','end','json','limit','undefined','count'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xefe4,0xdb));var _0x4efe=function(_0x24eb1b,_0x47f809){_0x24eb1b=_0x24eb1b-0x0;var _0x3eec00=_0xefe4[_0x24eb1b];return _0x3eec00;};'use strict';var emlformat=require(_0x4efe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4efe('0x1'));var jsonpatch=require(_0x4efe('0x2'));var rp=require(_0x4efe('0x3'));var moment=require(_0x4efe('0x4'));var BPromise=require(_0x4efe('0x5'));var Mustache=require(_0x4efe('0x6'));var util=require('util');var path=require('path');var sox=require(_0x4efe('0x7'));var csv=require('to-csv');var ejs=require(_0x4efe('0x8'));var fs=require('fs');var fs_extra=require(_0x4efe('0x9'));var _=require('lodash');var squel=require(_0x4efe('0xa'));var crypto=require(_0x4efe('0xb'));var jsforce=require(_0x4efe('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4efe('0xd'));var querystring=require(_0x4efe('0xe'));var Papa=require(_0x4efe('0xf'));var Redis=require(_0x4efe('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4efe('0x11'));var as=require(_0x4efe('0x12'));var hardwareService=require(_0x4efe('0x13'));var logger=require(_0x4efe('0x14'))(_0x4efe('0x15'));var utils=require(_0x4efe('0x16'));var config=require(_0x4efe('0x17'));var licenseUtil=require(_0x4efe('0x18'));var db=require(_0x4efe('0x19'))['db'];function respondWithStatusCode(_0x5e868e,_0x1b16c7){_0x1b16c7=_0x1b16c7||0xcc;return function(_0x355699){if(_0x355699){return _0x5e868e[_0x4efe('0x1a')](_0x1b16c7);}return _0x5e868e[_0x4efe('0x1b')](_0x1b16c7)[_0x4efe('0x1c')]();};}function respondWithResult(_0x40d38d,_0xbb476){_0xbb476=_0xbb476||0xc8;return function(_0x478b3c){if(_0x478b3c){return _0x40d38d[_0x4efe('0x1b')](_0xbb476)[_0x4efe('0x1d')](_0x478b3c);}};}function respondWithFilteredResult(_0x5bd818,_0x6e6470){return function(_0x9161ec){if(_0x9161ec){var _0x126bd8=typeof _0x6e6470['offset']==='undefined'&&typeof _0x6e6470[_0x4efe('0x1e')]===_0x4efe('0x1f');var _0x1ac957=_0x9161ec[_0x4efe('0x20')];var _0x5b81db=_0x126bd8?0x0:_0x6e6470[_0x4efe('0x21')];var _0x565e2b=_0x126bd8?_0x9161ec[_0x4efe('0x20')]:_0x6e6470[_0x4efe('0x21')]+_0x6e6470['limit'];var _0xe185ac;if(_0x565e2b>=_0x1ac957){_0x565e2b=_0x1ac957;_0xe185ac=0xc8;}else{_0xe185ac=0xce;}_0x5bd818[_0x4efe('0x1b')](_0xe185ac);return _0x5bd818[_0x4efe('0x22')](_0x4efe('0x23'),_0x5b81db+'-'+_0x565e2b+'/'+_0x1ac957)['json'](_0x9161ec);}return null;};}function patchUpdates(_0x2ede6a){return function(_0x453d01){try{jsonpatch[_0x4efe('0x24')](_0x453d01,_0x2ede6a,!![]);}catch(_0x2dfc15){return BPromise[_0x4efe('0x25')](_0x2dfc15);}return _0x453d01[_0x4efe('0x26')]();};}function saveUpdates(_0x5b56cf,_0x33658c){return function(_0x474e3a){if(_0x474e3a){return _0x474e3a[_0x4efe('0x27')](_0x5b56cf)[_0x4efe('0x28')](function(_0x1944ca){return _0x1944ca;});}return null;};}function removeEntity(_0x146c68,_0x4404d3){return function(_0x16667c){if(_0x16667c){return _0x16667c[_0x4efe('0x29')]()[_0x4efe('0x28')](function(){var _0x25a2c8=_0x16667c[_0x4efe('0x2a')]({'plain':!![]});var _0x53794a=_0x4efe('0x2b');return db[_0x4efe('0x2c')][_0x4efe('0x29')]({'where':{'type':_0x53794a,'resourceId':_0x25a2c8['id']}})[_0x4efe('0x28')](function(){return _0x16667c;});})[_0x4efe('0x28')](function(){_0x146c68['status'](0xcc)[_0x4efe('0x1c')]();});}};}function handleEntityNotFound(_0x528f30,_0x4de689){return function(_0xe25def){if(!_0xe25def){_0x528f30[_0x4efe('0x1a')](0x194);}return _0xe25def;};}function handleError(_0x2d364a,_0x1b41df){_0x1b41df=_0x1b41df||0x1f4;return function(_0x4aa32e){logger[_0x4efe('0x2d')](_0x4aa32e[_0x4efe('0x2e')]);if(_0x4aa32e['name']){delete _0x4aa32e[_0x4efe('0x2f')];}_0x2d364a[_0x4efe('0x1b')](_0x1b41df)['send'](_0x4aa32e);};}exports[_0x4efe('0x30')]=function(_0x4ec650,_0x5e0062){var _0x59f989={},_0x2e15ac={},_0x5bd1c6={'count':0x0,'rows':[]};var _0x3d7035=_[_0x4efe('0x31')](db['Variable']['rawAttributes'],function(_0x4738d4){return{'name':_0x4738d4[_0x4efe('0x32')],'type':_0x4738d4['type'][_0x4efe('0x33')]};});_0x2e15ac['model']=_[_0x4efe('0x31')](_0x3d7035,_0x4efe('0x2f'));_0x2e15ac['query']=_[_0x4efe('0x34')](_0x4ec650[_0x4efe('0x35')]);_0x2e15ac[_0x4efe('0x36')]=_['intersection'](_0x2e15ac[_0x4efe('0x37')],_0x2e15ac[_0x4efe('0x35')]);_0x59f989[_0x4efe('0x38')]=_['intersection'](_0x2e15ac[_0x4efe('0x37')],qs[_0x4efe('0x39')](_0x4ec650['query'][_0x4efe('0x39')]));_0x59f989[_0x4efe('0x38')]=_0x59f989['attributes'][_0x4efe('0x3a')]?_0x59f989['attributes']:_0x2e15ac['model'];if(!_0x4ec650[_0x4efe('0x35')][_0x4efe('0x3b')]('nolimit')){_0x59f989[_0x4efe('0x1e')]=qs[_0x4efe('0x1e')](_0x4ec650[_0x4efe('0x35')]['limit']);_0x59f989[_0x4efe('0x21')]=qs['offset'](_0x4ec650[_0x4efe('0x35')][_0x4efe('0x21')]);}_0x59f989['order']=qs[_0x4efe('0x3c')](_0x4ec650['query'][_0x4efe('0x3c')]);_0x59f989[_0x4efe('0x3d')]=qs[_0x4efe('0x36')](_[_0x4efe('0x3e')](_0x4ec650[_0x4efe('0x35')],_0x2e15ac['filters']),_0x3d7035);if(_0x4ec650[_0x4efe('0x35')][_0x4efe('0x3f')]){_0x59f989[_0x4efe('0x3d')]=_[_0x4efe('0x40')](_0x59f989[_0x4efe('0x3d')],{'$or':_['map'](_0x3d7035,function(_0x277794){if(_0x277794['type']!=='VIRTUAL'){var _0x5bd0a1={};_0x5bd0a1[_0x277794[_0x4efe('0x2f')]]={'$like':'%'+_0x4ec650[_0x4efe('0x35')][_0x4efe('0x3f')]+'%'};return _0x5bd0a1;}})});}_0x59f989=_[_0x4efe('0x40')]({},_0x59f989,_0x4ec650[_0x4efe('0x41')]);var _0x404b76={'where':_0x59f989[_0x4efe('0x3d')]};return db['Variable'][_0x4efe('0x20')](_0x404b76)[_0x4efe('0x28')](function(_0x2f6f51){_0x5bd1c6[_0x4efe('0x20')]=_0x2f6f51;if(_0x4ec650[_0x4efe('0x35')][_0x4efe('0x42')]){_0x59f989['include']=[{'all':!![]}];}return db[_0x4efe('0x43')][_0x4efe('0x44')](_0x59f989);})[_0x4efe('0x28')](function(_0x13da50){_0x5bd1c6['rows']=_0x13da50;return _0x5bd1c6;})[_0x4efe('0x28')](respondWithFilteredResult(_0x5e0062,_0x59f989))[_0x4efe('0x45')](handleError(_0x5e0062,null));};exports[_0x4efe('0x46')]=function(_0x2d804f,_0x34ec5f){var _0x595b97={'raw':!![],'where':{'id':_0x2d804f[_0x4efe('0x47')]['id']}},_0x91accf={};_0x91accf[_0x4efe('0x37')]=_['keys'](db[_0x4efe('0x43')][_0x4efe('0x48')]);_0x91accf[_0x4efe('0x35')]=_['keys'](_0x2d804f[_0x4efe('0x35')]);_0x91accf[_0x4efe('0x36')]=_[_0x4efe('0x49')](_0x91accf[_0x4efe('0x37')],_0x91accf[_0x4efe('0x35')]);_0x595b97[_0x4efe('0x38')]=_[_0x4efe('0x49')](_0x91accf[_0x4efe('0x37')],qs['fields'](_0x2d804f['query'][_0x4efe('0x39')]));_0x595b97[_0x4efe('0x38')]=_0x595b97[_0x4efe('0x38')][_0x4efe('0x3a')]?_0x595b97['attributes']:_0x91accf['model'];if(_0x2d804f[_0x4efe('0x35')][_0x4efe('0x42')]){_0x595b97[_0x4efe('0x4a')]=[{'all':!![]}];}_0x595b97=_[_0x4efe('0x40')]({},_0x595b97,_0x2d804f[_0x4efe('0x41')]);return db['Variable'][_0x4efe('0x4b')](_0x595b97)['then'](handleEntityNotFound(_0x34ec5f,null))[_0x4efe('0x28')](respondWithResult(_0x34ec5f,null))[_0x4efe('0x45')](handleError(_0x34ec5f,null));};exports[_0x4efe('0x4c')]=function(_0x875a1a,_0x35c9cb){return db[_0x4efe('0x43')][_0x4efe('0x4c')](_0x875a1a[_0x4efe('0x4d')],{})['then'](function(_0x1c19c5){var _0x41f3cf=_0x875a1a[_0x4efe('0x4e')][_0x4efe('0x2a')]({'plain':!![]});if(!_0x41f3cf)throw new Error(_0x4efe('0x4f'));if(_0x41f3cf[_0x4efe('0x50')]===_0x4efe('0x4e')){var _0x13bf8e=_0x1c19c5[_0x4efe('0x2a')]({'plain':!![]});var _0x1fa332=_0x4efe('0x2b');return db['UserProfileSection'][_0x4efe('0x4b')]({'where':{'name':_0x1fa332,'userProfileId':_0x41f3cf[_0x4efe('0x51')]},'raw':!![]})[_0x4efe('0x28')](function(_0x87d3a4){if(_0x87d3a4&&_0x87d3a4[_0x4efe('0x52')]===0x0){return db[_0x4efe('0x2c')]['create']({'name':_0x13bf8e[_0x4efe('0x2f')],'resourceId':_0x13bf8e['id'],'type':_0x87d3a4[_0x4efe('0x2f')],'sectionId':_0x87d3a4['id']},{})[_0x4efe('0x28')](function(){return _0x1c19c5;});}else{return _0x1c19c5;}})[_0x4efe('0x45')](function(_0x287327){logger[_0x4efe('0x2d')](_0x4efe('0x53'),_0x287327);throw _0x287327;});}return _0x1c19c5;})[_0x4efe('0x28')](respondWithResult(_0x35c9cb,0xc9))[_0x4efe('0x45')](handleError(_0x35c9cb,null));};exports['update']=function(_0x3de6c0,_0x15c190){if(_0x3de6c0[_0x4efe('0x4d')]['id']){delete _0x3de6c0[_0x4efe('0x4d')]['id'];}return db['Variable'][_0x4efe('0x4b')]({'where':{'id':_0x3de6c0[_0x4efe('0x47')]['id']}})[_0x4efe('0x28')](handleEntityNotFound(_0x15c190,null))['then'](saveUpdates(_0x3de6c0[_0x4efe('0x4d')],null))[_0x4efe('0x28')](respondWithResult(_0x15c190,null))[_0x4efe('0x45')](handleError(_0x15c190,null));};exports[_0x4efe('0x29')]=function(_0x43f62f,_0x30c9bc){return db[_0x4efe('0x43')][_0x4efe('0x4b')]({'where':{'id':_0x43f62f[_0x4efe('0x47')]['id']}})[_0x4efe('0x28')](handleEntityNotFound(_0x30c9bc,null))['then'](removeEntity(_0x30c9bc,null))['catch'](handleError(_0x30c9bc,null));}; \ No newline at end of file +var _0x6fdf=['zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','then','get','Variables','UserProfileResource','destroy','end','sendStatus','error','stack','name','send','map','Variable','rawAttributes','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filters','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x6fdf,0x15a));var _0xf6fd=function(_0x3ca765,_0x437b35){_0x3ca765=_0x3ca765-0x0;var _0x175630=_0x6fdf[_0x3ca765];return _0x175630;};'use strict';var emlformat=require(_0xf6fd('0x0'));var rimraf=require(_0xf6fd('0x1'));var zipdir=require(_0xf6fd('0x2'));var jsonpatch=require(_0xf6fd('0x3'));var rp=require(_0xf6fd('0x4'));var moment=require(_0xf6fd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf6fd('0x6'));var util=require(_0xf6fd('0x7'));var path=require(_0xf6fd('0x8'));var sox=require(_0xf6fd('0x9'));var csv=require('to-csv');var ejs=require(_0xf6fd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf6fd('0xb'));var crypto=require(_0xf6fd('0xc'));var jsforce=require(_0xf6fd('0xd'));var deskjs=require(_0xf6fd('0xe'));var toCsv=require(_0xf6fd('0xf'));var querystring=require(_0xf6fd('0x10'));var Papa=require(_0xf6fd('0x11'));var Redis=require(_0xf6fd('0x12'));var authService=require(_0xf6fd('0x13'));var qs=require(_0xf6fd('0x14'));var as=require(_0xf6fd('0x15'));var hardwareService=require(_0xf6fd('0x16'));var logger=require(_0xf6fd('0x17'))(_0xf6fd('0x18'));var utils=require(_0xf6fd('0x19'));var config=require(_0xf6fd('0x1a'));var licenseUtil=require(_0xf6fd('0x1b'));var db=require(_0xf6fd('0x1c'))['db'];function respondWithStatusCode(_0x5ae2c4,_0x10c455){_0x10c455=_0x10c455||0xcc;return function(_0x423849){if(_0x423849){return _0x5ae2c4['sendStatus'](_0x10c455);}return _0x5ae2c4[_0xf6fd('0x1d')](_0x10c455)['end']();};}function respondWithResult(_0x1d404f,_0x24a44d){_0x24a44d=_0x24a44d||0xc8;return function(_0xbd35f6){if(_0xbd35f6){return _0x1d404f[_0xf6fd('0x1d')](_0x24a44d)['json'](_0xbd35f6);}};}function respondWithFilteredResult(_0x282fa8,_0x4cb520){return function(_0x135812){if(_0x135812){var _0x3e6946=typeof _0x4cb520[_0xf6fd('0x1e')]===_0xf6fd('0x1f')&&typeof _0x4cb520[_0xf6fd('0x20')]==='undefined';var _0x28ba44=_0x135812['count'];var _0x47a575=_0x3e6946?0x0:_0x4cb520[_0xf6fd('0x1e')];var _0xf31954=_0x3e6946?_0x135812[_0xf6fd('0x21')]:_0x4cb520['offset']+_0x4cb520['limit'];var _0x1f56ea;if(_0xf31954>=_0x28ba44){_0xf31954=_0x28ba44;_0x1f56ea=0xc8;}else{_0x1f56ea=0xce;}_0x282fa8['status'](_0x1f56ea);return _0x282fa8[_0xf6fd('0x22')](_0xf6fd('0x23'),_0x47a575+'-'+_0xf31954+'/'+_0x28ba44)[_0xf6fd('0x24')](_0x135812);}return null;};}function patchUpdates(_0x2dac1c){return function(_0x504c92){try{jsonpatch[_0xf6fd('0x25')](_0x504c92,_0x2dac1c,!![]);}catch(_0x491617){return BPromise[_0xf6fd('0x26')](_0x491617);}return _0x504c92[_0xf6fd('0x27')]();};}function saveUpdates(_0x2b95ce,_0xf010ee){return function(_0x368628){if(_0x368628){return _0x368628[_0xf6fd('0x28')](_0x2b95ce)['then'](function(_0x151904){return _0x151904;});}return null;};}function removeEntity(_0x111aec,_0xe638cb){return function(_0x216354){if(_0x216354){return _0x216354['destroy']()[_0xf6fd('0x29')](function(){var _0x1977ee=_0x216354[_0xf6fd('0x2a')]({'plain':!![]});var _0x327654=_0xf6fd('0x2b');return db[_0xf6fd('0x2c')][_0xf6fd('0x2d')]({'where':{'type':_0x327654,'resourceId':_0x1977ee['id']}})[_0xf6fd('0x29')](function(){return _0x216354;});})[_0xf6fd('0x29')](function(){_0x111aec[_0xf6fd('0x1d')](0xcc)[_0xf6fd('0x2e')]();});}};}function handleEntityNotFound(_0x5a05fc,_0x1c905d){return function(_0x1c5b89){if(!_0x1c5b89){_0x5a05fc[_0xf6fd('0x2f')](0x194);}return _0x1c5b89;};}function handleError(_0x31744a,_0x280553){_0x280553=_0x280553||0x1f4;return function(_0x35c2a5){logger[_0xf6fd('0x30')](_0x35c2a5[_0xf6fd('0x31')]);if(_0x35c2a5[_0xf6fd('0x32')]){delete _0x35c2a5[_0xf6fd('0x32')];}_0x31744a['status'](_0x280553)[_0xf6fd('0x33')](_0x35c2a5);};}exports['index']=function(_0x4d2f71,_0x22a4fb){var _0x6892a2={},_0x3e44b8={},_0x58d1a6={'count':0x0,'rows':[]};var _0x2522ad=_[_0xf6fd('0x34')](db[_0xf6fd('0x35')][_0xf6fd('0x36')],function(_0x1f02dc){return{'name':_0x1f02dc[_0xf6fd('0x37')],'type':_0x1f02dc['type'][_0xf6fd('0x38')]};});_0x3e44b8['model']=_[_0xf6fd('0x34')](_0x2522ad,'name');_0x3e44b8[_0xf6fd('0x39')]=_[_0xf6fd('0x3a')](_0x4d2f71[_0xf6fd('0x39')]);_0x3e44b8['filters']=_[_0xf6fd('0x3b')](_0x3e44b8[_0xf6fd('0x3c')],_0x3e44b8[_0xf6fd('0x39')]);_0x6892a2[_0xf6fd('0x3d')]=_[_0xf6fd('0x3b')](_0x3e44b8[_0xf6fd('0x3c')],qs[_0xf6fd('0x3e')](_0x4d2f71[_0xf6fd('0x39')][_0xf6fd('0x3e')]));_0x6892a2[_0xf6fd('0x3d')]=_0x6892a2['attributes'][_0xf6fd('0x3f')]?_0x6892a2['attributes']:_0x3e44b8[_0xf6fd('0x3c')];if(!_0x4d2f71['query']['hasOwnProperty'](_0xf6fd('0x40'))){_0x6892a2[_0xf6fd('0x20')]=qs[_0xf6fd('0x20')](_0x4d2f71[_0xf6fd('0x39')]['limit']);_0x6892a2['offset']=qs[_0xf6fd('0x1e')](_0x4d2f71[_0xf6fd('0x39')][_0xf6fd('0x1e')]);}_0x6892a2[_0xf6fd('0x41')]=qs['sort'](_0x4d2f71[_0xf6fd('0x39')][_0xf6fd('0x42')]);_0x6892a2[_0xf6fd('0x43')]=qs['filters'](_[_0xf6fd('0x44')](_0x4d2f71[_0xf6fd('0x39')],_0x3e44b8[_0xf6fd('0x45')]),_0x2522ad);if(_0x4d2f71['query']['filter']){_0x6892a2['where']=_[_0xf6fd('0x46')](_0x6892a2['where'],{'$or':_[_0xf6fd('0x34')](_0x2522ad,function(_0x5b8a95){if(_0x5b8a95['type']!=='VIRTUAL'){var _0x4aa326={};_0x4aa326[_0x5b8a95[_0xf6fd('0x32')]]={'$like':'%'+_0x4d2f71['query']['filter']+'%'};return _0x4aa326;}})});}_0x6892a2=_[_0xf6fd('0x46')]({},_0x6892a2,_0x4d2f71[_0xf6fd('0x47')]);var _0x24e8b4={'where':_0x6892a2[_0xf6fd('0x43')]};return db[_0xf6fd('0x35')][_0xf6fd('0x21')](_0x24e8b4)[_0xf6fd('0x29')](function(_0x57e7aa){_0x58d1a6[_0xf6fd('0x21')]=_0x57e7aa;if(_0x4d2f71[_0xf6fd('0x39')][_0xf6fd('0x48')]){_0x6892a2[_0xf6fd('0x49')]=[{'all':!![]}];}return db['Variable'][_0xf6fd('0x4a')](_0x6892a2);})[_0xf6fd('0x29')](function(_0xfa8a5d){_0x58d1a6['rows']=_0xfa8a5d;return _0x58d1a6;})['then'](respondWithFilteredResult(_0x22a4fb,_0x6892a2))[_0xf6fd('0x4b')](handleError(_0x22a4fb,null));};exports[_0xf6fd('0x4c')]=function(_0x2ae52a,_0x2b4e59){var _0x1088c9={'raw':!![],'where':{'id':_0x2ae52a[_0xf6fd('0x4d')]['id']}},_0xc49a05={};_0xc49a05[_0xf6fd('0x3c')]=_[_0xf6fd('0x3a')](db['Variable']['rawAttributes']);_0xc49a05[_0xf6fd('0x39')]=_[_0xf6fd('0x3a')](_0x2ae52a['query']);_0xc49a05[_0xf6fd('0x45')]=_[_0xf6fd('0x3b')](_0xc49a05[_0xf6fd('0x3c')],_0xc49a05['query']);_0x1088c9[_0xf6fd('0x3d')]=_[_0xf6fd('0x3b')](_0xc49a05[_0xf6fd('0x3c')],qs[_0xf6fd('0x3e')](_0x2ae52a['query'][_0xf6fd('0x3e')]));_0x1088c9[_0xf6fd('0x3d')]=_0x1088c9[_0xf6fd('0x3d')]['length']?_0x1088c9[_0xf6fd('0x3d')]:_0xc49a05[_0xf6fd('0x3c')];if(_0x2ae52a[_0xf6fd('0x39')][_0xf6fd('0x48')]){_0x1088c9[_0xf6fd('0x49')]=[{'all':!![]}];}_0x1088c9=_[_0xf6fd('0x46')]({},_0x1088c9,_0x2ae52a[_0xf6fd('0x47')]);return db[_0xf6fd('0x35')][_0xf6fd('0x4e')](_0x1088c9)[_0xf6fd('0x29')](handleEntityNotFound(_0x2b4e59,null))[_0xf6fd('0x29')](respondWithResult(_0x2b4e59,null))[_0xf6fd('0x4b')](handleError(_0x2b4e59,null));};exports[_0xf6fd('0x4f')]=function(_0x43c97f,_0x4e3ee5){return db[_0xf6fd('0x35')][_0xf6fd('0x4f')](_0x43c97f[_0xf6fd('0x50')],{})[_0xf6fd('0x29')](function(_0xea0e98){var _0x4f2068=_0x43c97f[_0xf6fd('0x51')]['get']({'plain':!![]});if(!_0x4f2068)throw new Error(_0xf6fd('0x52'));if(_0x4f2068[_0xf6fd('0x53')]===_0xf6fd('0x51')){var _0x38f31f=_0xea0e98[_0xf6fd('0x2a')]({'plain':!![]});var _0x13cb81='Variables';return db[_0xf6fd('0x54')][_0xf6fd('0x4e')]({'where':{'name':_0x13cb81,'userProfileId':_0x4f2068['userProfileId']},'raw':!![]})['then'](function(_0x1ff6bf){if(_0x1ff6bf&&_0x1ff6bf[_0xf6fd('0x55')]===0x0){return db[_0xf6fd('0x2c')]['create']({'name':_0x38f31f['name'],'resourceId':_0x38f31f['id'],'type':_0x1ff6bf[_0xf6fd('0x32')],'sectionId':_0x1ff6bf['id']},{})['then'](function(){return _0xea0e98;});}else{return _0xea0e98;}})[_0xf6fd('0x4b')](function(_0x515479){logger[_0xf6fd('0x30')](_0xf6fd('0x56'),_0x515479);throw _0x515479;});}return _0xea0e98;})[_0xf6fd('0x29')](respondWithResult(_0x4e3ee5,0xc9))[_0xf6fd('0x4b')](handleError(_0x4e3ee5,null));};exports[_0xf6fd('0x28')]=function(_0x595935,_0x4a0f45){if(_0x595935[_0xf6fd('0x50')]['id']){delete _0x595935[_0xf6fd('0x50')]['id'];}return db['Variable'][_0xf6fd('0x4e')]({'where':{'id':_0x595935[_0xf6fd('0x4d')]['id']}})[_0xf6fd('0x29')](handleEntityNotFound(_0x4a0f45,null))['then'](saveUpdates(_0x595935[_0xf6fd('0x50')],null))[_0xf6fd('0x29')](respondWithResult(_0x4a0f45,null))[_0xf6fd('0x4b')](handleError(_0x4a0f45,null));};exports['destroy']=function(_0x3a7283,_0xb9e6e2){return db[_0xf6fd('0x35')][_0xf6fd('0x4e')]({'where':{'id':_0x3a7283[_0xf6fd('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb9e6e2,null))[_0xf6fd('0x29')](removeEntity(_0xb9e6e2,null))[_0xf6fd('0x4b')](handleError(_0xb9e6e2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 904e66b..ffa91a4 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 _0xedac=['path','rimraf','../../config/environment','exports','Variable','tools_variables','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xedac,0x1be));var _0xceda=function(_0x4b1abe,_0xb0f424){_0x4b1abe=_0x4b1abe-0x0;var _0x152eea=_0xedac[_0x4b1abe];return _0x152eea;};'use strict';var _=require(_0xceda('0x0'));var util=require('util');var logger=require(_0xceda('0x1'))(_0xceda('0x2'));var moment=require('moment');var BPromise=require(_0xceda('0x3'));var rp=require(_0xceda('0x4'));var fs=require('fs');var path=require(_0xceda('0x5'));var rimraf=require(_0xceda('0x6'));var config=require(_0xceda('0x7'));var attributes=require('./variable.attributes');module[_0xceda('0x8')]=function(_0x485729,_0x2bc37e){return _0x485729['define'](_0xceda('0x9'),attributes,{'tableName':_0xceda('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d29=['tools_variables','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./variable.attributes','define','Variable'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x5d29,0x1cf));var _0x95d2=function(_0x2885cd,_0x312e9f){_0x2885cd=_0x2885cd-0x0;var _0x23c7bc=_0x5d29[_0x2885cd];return _0x23c7bc;};'use strict';var _=require(_0x95d2('0x0'));var util=require(_0x95d2('0x1'));var logger=require(_0x95d2('0x2'))('api');var moment=require(_0x95d2('0x3'));var BPromise=require(_0x95d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x95d2('0x5'));var config=require(_0x95d2('0x6'));var attributes=require(_0x95d2('0x7'));module['exports']=function(_0x436219,_0x4d06db){return _0x436219[_0x95d2('0x8')](_0x95d2('0x9'),attributes,{'tableName':_0x95d2('0xa'),'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 515abc9..e104401 100644 --- a/server/api/variable/variable.rpc.js +++ b/server/api/variable/variable.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0xed9c99,_0x2217b1){var _0x5443a1=function(_0xb7c751){while(--_0xb7c751){_0xed9c99['push'](_0xed9c99['shift']());}};_0x5443a1(++_0x2217b1);}(_0x3e74,0x175));var _0x43e7=function(_0x40b63c,_0x562c01){_0x40b63c=_0x40b63c-0x0;var _0x3116a3=_0x3e74[_0x40b63c];return _0x3116a3;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file +var _0x1cb9=['include','map','model','then','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','ShowVariable','Variable','options','attributes'];(function(_0x449fb0,_0xf691a2){var _0x10bb91=function(_0x86e613){while(--_0x86e613){_0x449fb0['push'](_0x449fb0['shift']());}};_0x10bb91(++_0xf691a2);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5c2335,_0x135702){_0x5c2335=_0x5c2335-0x0;var _0x38dcbf=_0x1cb9[_0x5c2335];return _0x38dcbf;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Variable,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}exports[_0x91cb('0x16')]=function(_0x1cd34b){var _0xcd1a78=this;return new Promise(function(_0x5cc1c3,_0x3fba4f){return db[_0x91cb('0x17')]['find']({'raw':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b['options']['raw']===undefined?!![]:![]:!![],'where':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')]['where']||null:null,'attributes':_0x1cd34b['options']?_0x1cd34b['options'][_0x91cb('0x19')]||null:null,'include':_0x1cd34b[_0x91cb('0x18')]?_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')]?_['map'](_0x1cd34b[_0x91cb('0x18')][_0x91cb('0x1a')],function(_0x1fa837){return{'model':db[_0x1fa837['model']],'as':_0x1fa837['as'],'attributes':_0x1fa837[_0x91cb('0x19')],'include':_0x1fa837[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x1fa837[_0x91cb('0x1a')],function(_0x3ca500){return{'model':db[_0x3ca500[_0x91cb('0x1c')]],'as':_0x3ca500['as'],'attributes':_0x3ca500[_0x91cb('0x19')],'include':_0x3ca500[_0x91cb('0x1a')]?_[_0x91cb('0x1b')](_0x3ca500['include'],function(_0x59bf3a){return{'model':db[_0x59bf3a[_0x91cb('0x1c')]],'as':_0x59bf3a['as'],'attributes':_0x59bf3a['attributes']};}):[]};}):[]};}):[]:[]})[_0x91cb('0x1d')](function(_0x34d372){logger[_0x91cb('0xc')]('ShowVariable',_0x1cd34b);logger[_0x91cb('0xf')]('ShowVariable',_0x1cd34b,JSON[_0x91cb('0x11')](_0x34d372));_0x5cc1c3(_0x34d372);})[_0x91cb('0x15')](function(_0x3b3ee6){logger[_0x91cb('0x12')](_0x91cb('0x16'),_0x3b3ee6['message'],_0x1cd34b);_0x3fba4f(_0xcd1a78[_0x91cb('0x12')](0x1f4,_0x3b3ee6['message']));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 45c8939..c91f3d6 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 _0xea9a=['index','isAuthenticated','fetch','/reset','canUpdate','reset','/pull','pull','/restart','restart','migrations','exports','express','Router','../../components/auth/service','./version.controller','get'];(function(_0x444672,_0x4894c2){var _0x4ba0fc=function(_0x2a89d9){while(--_0x2a89d9){_0x444672['push'](_0x444672['shift']());}};_0x4ba0fc(++_0x4894c2);}(_0xea9a,0x1d7));var _0xaea9=function(_0x3345c6,_0x18d9f2){_0x3345c6=_0x3345c6-0x0;var _0x8e91fb=_0xea9a[_0x3345c6];return _0x8e91fb;};'use strict';var express=require(_0xaea9('0x0'));var router=express[_0xaea9('0x1')]();var auth=require(_0xaea9('0x2'));var controller=require(_0xaea9('0x3'));router[_0xaea9('0x4')]('/',controller[_0xaea9('0x5')]);router['get']('/fetch',auth[_0xaea9('0x6')](),auth['canUpdate'](),controller[_0xaea9('0x7')]);router['get'](_0xaea9('0x8'),auth[_0xaea9('0x6')](),auth[_0xaea9('0x9')](),controller[_0xaea9('0xa')]);router[_0xaea9('0x4')](_0xaea9('0xb'),auth[_0xaea9('0x6')](),auth[_0xaea9('0x9')](),controller[_0xaea9('0xc')]);router[_0xaea9('0x4')](_0xaea9('0xd'),auth[_0xaea9('0x6')](),controller[_0xaea9('0xe')]);router[_0xaea9('0x4')]('/migrations',controller[_0xaea9('0xf')]);module[_0xaea9('0x10')]=router; \ No newline at end of file +var _0x639f=['../../components/auth/service','./version.controller','get','index','canUpdate','/reset','isAuthenticated','reset','/pull','/restart','express','Router'];(function(_0x1b773e,_0x37b69c){var _0x44c4a2=function(_0x2eb17d){while(--_0x2eb17d){_0x1b773e['push'](_0x1b773e['shift']());}};_0x44c4a2(++_0x37b69c);}(_0x639f,0x6a));var _0xf639=function(_0x5930ac,_0x3240ac){_0x5930ac=_0x5930ac-0x0;var _0x548db0=_0x639f[_0x5930ac];return _0x548db0;};'use strict';var express=require(_0xf639('0x0'));var router=express[_0xf639('0x1')]();var auth=require(_0xf639('0x2'));var controller=require(_0xf639('0x3'));router[_0xf639('0x4')]('/',controller[_0xf639('0x5')]);router[_0xf639('0x4')]('/fetch',auth['isAuthenticated'](),auth[_0xf639('0x6')](),controller['fetch']);router['get'](_0xf639('0x7'),auth[_0xf639('0x8')](),auth[_0xf639('0x6')](),controller[_0xf639('0x9')]);router['get'](_0xf639('0xa'),auth[_0xf639('0x8')](),auth[_0xf639('0x6')](),controller['pull']);router[_0xf639('0x4')](_0xf639('0xb'),auth[_0xf639('0x8')](),controller['restart']);router['get']('/migrations',controller['migrations']);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 890accf..714140f 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 _0xf570=['motion2','then','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','length','replace','.js','push','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','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','compare-versions','../../config/environment','../../config/pm2','../../config/logger','update','root','exports','query','latest','fetch','2.0.0','status','origin','master','error','git\x20fetch','json','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart'];(function(_0x2e0aad,_0x5ca443){var _0xfd39dd=function(_0x4bfe0a){while(--_0x4bfe0a){_0x2e0aad['push'](_0x2e0aad['shift']());}};_0xfd39dd(++_0x5ca443);}(_0xf570,0xc0));var _0x0f57=function(_0x23eb2f,_0xf01034){_0x23eb2f=_0x23eb2f-0x0;var _0x5c5b76=_0xf570[_0x23eb2f];return _0x5c5b76;};'use strict';var Umzug=require(_0x0f57('0x0'));var path=require(_0x0f57('0x1'));var fs=require('fs');var _=require(_0x0f57('0x2'));var pkginfo=require(_0x0f57('0x3'))(module,_0x0f57('0x4'));var compareVersions=require(_0x0f57('0x5'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x0f57('0x6'));var pm2=require(_0x0f57('0x7'));var logger=require(_0x0f57('0x8'))(_0x0f57('0x9'));var git=require('simple-git')(config[_0x0f57('0xa')]);exports['index']=function(_0x1b65d1,_0x392543){var _0x527a15={'current':module[_0x0f57('0xb')][_0x0f57('0x4')],'phonebar':0x2};if(_0x1b65d1[_0x0f57('0xc')]&&_0x1b65d1[_0x0f57('0xc')][_0x0f57('0xd')]){return git[_0x0f57('0xe')]()['tags'](function(_0x3ca687,_0x438ec8){_0x527a15[_0x0f57('0xd')]=(_0x3ca687?module[_0x0f57('0xb')][_0x0f57('0x4')]:_0x438ec8[_0x0f57('0xd')])||_0x0f57('0xf');return _0x392543[_0x0f57('0x10')](0xc8)['json'](_0x527a15);});}else{return _0x392543[_0x0f57('0x10')](0xc8)['json'](_0x527a15);}};exports[_0x0f57('0xe')]=function(_0x582e,_0x23f7d9){return git[_0x0f57('0xe')]([_0x0f57('0x11'),_0x0f57('0x12')],function(_0x268e0d){if(_0x268e0d){logger[_0x0f57('0x13')](_0x268e0d);return _0x23f7d9[_0x0f57('0x10')](0x1f4)['json'](_0x268e0d);}logger['info'](_0x0f57('0x14'));return _0x23f7d9[_0x0f57('0x10')](0xc8)[_0x0f57('0x15')]({'output':_0x0f57('0x16')});});};exports[_0x0f57('0x17')]=function(_0x4acec8,_0x3c3e2a){return git['reset']([_0x0f57('0x18'),_0x0f57('0x19')],function(_0xec6357){if(_0xec6357){logger[_0x0f57('0x13')](_0xec6357);return _0x3c3e2a['status'](0x1f4)[_0x0f57('0x15')](_0xec6357);}logger[_0x0f57('0x1a')](_0x0f57('0x1b'));return _0x3c3e2a[_0x0f57('0x10')](0xc8)['json']({'output':_0x0f57('0x1c')});});};exports[_0x0f57('0x1d')]=function(_0x8b9398,_0x1bd47b){exec(_0x0f57('0x1e'),function(_0xba3f2f,_0x169bfa,_0x2e1e52){logger[_0x0f57('0x1a')](_0x169bfa);logger[_0x0f57('0x1a')](_0x2e1e52);if(_0xba3f2f){logger['error'](_0xba3f2f);return _0x1bd47b[_0x0f57('0x10')](0x1f4)[_0x0f57('0x15')](_0xba3f2f);}return _0x1bd47b['status'](0xc8)[_0x0f57('0x15')]({'output':_0x169bfa});});};exports['restart']=function(_0x9a886f,_0x3e6d6d){return pm2[_0x0f57('0x1f')](_0x0f57('0x20'))[_0x0f57('0x21')](function(_0x501c5f){logger[_0x0f57('0x1a')](_0x0f57('0x22'),_0x501c5f);return _0x3e6d6d['status'](0xc8)[_0x0f57('0x15')]({'output':_0x0f57('0x23')});})[_0x0f57('0x24')](function(_0x4ca18c){logger[_0x0f57('0x13')](_0x4ca18c);return _0x3e6d6d[_0x0f57('0x10')](0x1f4)[_0x0f57('0x15')](_0x4ca18c);});};exports[_0x0f57('0x25')]=function(_0x2061ce,_0x39e259){var _0x142f9d=fs[_0x0f57('0x26')](path[_0x0f57('0x27')](config[_0x0f57('0xa')],'server',_0x0f57('0x25')));var _0x6c0ee7=[];for(var _0x4b4c6b=0x0;_0x4b4c6b<_0x142f9d[_0x0f57('0x28')];_0x4b4c6b++){var _0x27a466=_0x142f9d[_0x4b4c6b][_0x0f57('0x29')](_0x0f57('0x2a'),'');if(compareVersions(module[_0x0f57('0xb')][_0x0f57('0x4')],_0x27a466)===-0x1){_0x6c0ee7[_0x0f57('0x2b')](_0x27a466);}}if(_0x6c0ee7[_0x0f57('0x28')]){var _0x3d4910=_0x6c0ee7[_0x0f57('0x2c')](compareVersions);var _0x2aa78c=new Umzug({'storage':_0x0f57('0x2d'),'storageOptions':{'model':db[_0x0f57('0x2e')],'modelName':_0x0f57('0x2e'),'columnName':'version'},'migrations':{'params':[db[_0x0f57('0x2d')][_0x0f57('0x2f')](),db[_0x0f57('0x2d')][_0x0f57('0x30')],function(){throw new Error(_0x0f57('0x31'));}],'path':path['join'](config[_0x0f57('0xa')],'server',_0x0f57('0x25')),'pattern':/\.js$/}});_0x2aa78c['up']({'migrations':_[_0x0f57('0x32')](_0x3d4910,function(_0x4c363b){return _0x4c363b+_0x0f57('0x2a');})})[_0x0f57('0x21')](function(){return _0x39e259['status'](0xc8)['json']({'output':_0x0f57('0x33')+module[_0x0f57('0xb')]['version']+_0x0f57('0x34')+_[_0x0f57('0x35')](_0x3d4910),'migrations':_[_0x0f57('0x27')](_0x3d4910)});})[_0x0f57('0x24')](function(_0x5cd685){if(_0x5cd685 instanceof db[_0x0f57('0x2d')][_0x0f57('0x36')]){return _0x39e259[_0x0f57('0x10')](0xc8)[_0x0f57('0x15')]({'output':_0x0f57('0x37')});}else{return _0x39e259[_0x0f57('0x10')](0x1f4)[_0x0f57('0x15')](_0x5cd685);}});}else{return _0x39e259[_0x0f57('0x10')](0xc8)[_0x0f57('0x15')]({'output':_0x0f57('0x37')});}}; \ No newline at end of file +var _0x15ac=['pull','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','replace','length','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','migrations','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','catch','UniqueConstraintError','Database\x20already\x20up-to-date','path','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/logger','update','simple-git','root','index','exports','latest','fetch','tags','2.0.0','json','master','error','status','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard'];(function(_0x2608ca,_0x3deb97){var _0x4033c0=function(_0x396499){while(--_0x396499){_0x2608ca['push'](_0x2608ca['shift']());}};_0x4033c0(++_0x3deb97);}(_0x15ac,0x1cf));var _0xc15a=function(_0x37fe8e,_0x3ccba4){_0x37fe8e=_0x37fe8e-0x0;var _0x1d6cad=_0x15ac[_0x37fe8e];return _0x1d6cad;};'use strict';var Umzug=require('umzug');var path=require(_0xc15a('0x0'));var fs=require('fs');var _=require('lodash');var pkginfo=require(_0xc15a('0x1'))(module,_0xc15a('0x2'));var compareVersions=require(_0xc15a('0x3'));var exec=require(_0xc15a('0x4'))[_0xc15a('0x5')];var db=require(_0xc15a('0x6'))['db'];var config=require('../../config/environment');var pm2=require('../../config/pm2');var logger=require(_0xc15a('0x7'))(_0xc15a('0x8'));var git=require(_0xc15a('0x9'))(config[_0xc15a('0xa')]);exports[_0xc15a('0xb')]=function(_0x355a16,_0x2b7839){var _0x19d3a9={'current':module[_0xc15a('0xc')]['version'],'phonebar':0x2};if(_0x355a16['query']&&_0x355a16['query'][_0xc15a('0xd')]){return git[_0xc15a('0xe')]()[_0xc15a('0xf')](function(_0x52b366,_0x22d18f){_0x19d3a9[_0xc15a('0xd')]=(_0x52b366?module[_0xc15a('0xc')][_0xc15a('0x2')]:_0x22d18f[_0xc15a('0xd')])||_0xc15a('0x10');return _0x2b7839['status'](0xc8)['json'](_0x19d3a9);});}else{return _0x2b7839['status'](0xc8)[_0xc15a('0x11')](_0x19d3a9);}};exports[_0xc15a('0xe')]=function(_0x4dca21,_0x380491){return git['fetch'](['origin',_0xc15a('0x12')],function(_0x3eb91d){if(_0x3eb91d){logger[_0xc15a('0x13')](_0x3eb91d);return _0x380491[_0xc15a('0x14')](0x1f4)['json'](_0x3eb91d);}logger[_0xc15a('0x15')](_0xc15a('0x16'));return _0x380491[_0xc15a('0x14')](0xc8)[_0xc15a('0x11')]({'output':_0xc15a('0x17')});});};exports[_0xc15a('0x18')]=function(_0x491b56,_0x2e9c10){return git['reset']([_0xc15a('0x19'),'FETCH_HEAD'],function(_0x3c3332){if(_0x3c3332){logger[_0xc15a('0x13')](_0x3c3332);return _0x2e9c10[_0xc15a('0x14')](0x1f4)[_0xc15a('0x11')](_0x3c3332);}logger[_0xc15a('0x15')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x2e9c10[_0xc15a('0x14')](0xc8)['json']({'output':_0xc15a('0x1a')});});};exports[_0xc15a('0x1b')]=function(_0x5220ef,_0x3b1edf){exec(_0xc15a('0x1c'),function(_0x4ccd2a,_0xdaf33,_0x393241){logger[_0xc15a('0x15')](_0xdaf33);logger['info'](_0x393241);if(_0x4ccd2a){logger[_0xc15a('0x13')](_0x4ccd2a);return _0x3b1edf[_0xc15a('0x14')](0x1f4)[_0xc15a('0x11')](_0x4ccd2a);}return _0x3b1edf[_0xc15a('0x14')](0xc8)[_0xc15a('0x11')]({'output':_0xdaf33});});};exports['restart']=function(_0x53067b,_0x395a50){return pm2[_0xc15a('0x1d')]('motion2')[_0xc15a('0x1e')](function(_0xa694c1){logger[_0xc15a('0x15')]('pm2\x20restart\x20motion\x20%s',_0xa694c1);return _0x395a50[_0xc15a('0x14')](0xc8)[_0xc15a('0x11')]({'output':_0xc15a('0x1f')});})['catch'](function(_0x4b91dc){logger[_0xc15a('0x13')](_0x4b91dc);return _0x395a50['status'](0x1f4)[_0xc15a('0x11')](_0x4b91dc);});};exports['migrations']=function(_0x142edb,_0x156343){var _0x5aaac0=fs[_0xc15a('0x20')](path[_0xc15a('0x21')](config['root'],'server','migrations'));var _0x1ac9d2=[];for(var _0x33b9d6=0x0;_0x33b9d6<_0x5aaac0['length'];_0x33b9d6++){var _0x4c6ea3=_0x5aaac0[_0x33b9d6][_0xc15a('0x22')]('.js','');if(compareVersions(module[_0xc15a('0xc')][_0xc15a('0x2')],_0x4c6ea3)===-0x1){_0x1ac9d2['push'](_0x4c6ea3);}}if(_0x1ac9d2[_0xc15a('0x23')]){var _0x5bb879=_0x1ac9d2[_0xc15a('0x24')](compareVersions);var _0x1ef750=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0xc15a('0x25')],'modelName':_0xc15a('0x25'),'columnName':_0xc15a('0x2')},'migrations':{'params':[db[_0xc15a('0x26')][_0xc15a('0x27')](),db[_0xc15a('0x26')][_0xc15a('0x28')],function(){throw new Error(_0xc15a('0x29'));}],'path':path[_0xc15a('0x21')](config[_0xc15a('0xa')],'server',_0xc15a('0x2a')),'pattern':/\.js$/}});_0x1ef750['up']({'migrations':_['map'](_0x5bb879,function(_0x5400eb){return _0x5400eb+_0xc15a('0x2b');})})[_0xc15a('0x1e')](function(){return _0x156343[_0xc15a('0x14')](0xc8)['json']({'output':_0xc15a('0x2c')+module[_0xc15a('0xc')][_0xc15a('0x2')]+_0xc15a('0x2d')+_['last'](_0x5bb879),'migrations':_[_0xc15a('0x21')](_0x5bb879)});})[_0xc15a('0x2e')](function(_0x56cc08){if(_0x56cc08 instanceof db[_0xc15a('0x26')][_0xc15a('0x2f')]){return _0x156343[_0xc15a('0x14')](0xc8)['json']({'output':_0xc15a('0x30')});}else{return _0x156343['status'](0x1f4)[_0xc15a('0x11')](_0x56cc08);}});}else{return _0x156343[_0xc15a('0x14')](0xc8)[_0xc15a('0x11')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 18035ae..7e5c711 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 _0x22f7=['/:id','post','put','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index'];(function(_0x3fb401,_0x47588d){var _0x1bfd72=function(_0x414c99){while(--_0x414c99){_0x3fb401['push'](_0x3fb401['shift']());}};_0x1bfd72(++_0x47588d);}(_0x22f7,0x194));var _0x722f=function(_0x3eba79,_0x21880e){_0x3eba79=_0x3eba79-0x0;var _0x438b4f=_0x22f7[_0x3eba79];return _0x438b4f;};'use strict';var multer=require(_0x722f('0x0'));var util=require(_0x722f('0x1'));var path=require(_0x722f('0x2'));var timeout=require(_0x722f('0x3'));var express=require(_0x722f('0x4'));var router=express[_0x722f('0x5')]();var fs_extra=require(_0x722f('0x6'));var auth=require(_0x722f('0x7'));var interaction=require(_0x722f('0x8'));var config=require(_0x722f('0x9'));var controller=require(_0x722f('0xa'));router[_0x722f('0xb')]('/',auth[_0x722f('0xc')](),controller[_0x722f('0xd')]);router[_0x722f('0xb')]('/describe',auth[_0x722f('0xc')](),controller['describe']);router[_0x722f('0xb')](_0x722f('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x722f('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x722f('0x10')](_0x722f('0xe'),auth[_0x722f('0xc')](),controller['update']);router[_0x722f('0x11')]('/:id',auth[_0x722f('0xc')](),controller['destroy']);module[_0x722f('0x12')]=router; \ No newline at end of file +var _0xaefc=['post','create','update','delete','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x29e7fa,_0x231b9c){var _0x93b500=function(_0x23d559){while(--_0x23d559){_0x29e7fa['push'](_0x29e7fa['shift']());}};_0x93b500(++_0x231b9c);}(_0xaefc,0xe9));var _0xcaef=function(_0x58422d,_0x36551c){_0x58422d=_0x58422d-0x0;var _0x438a0c=_0xaefc[_0x58422d];return _0x438a0c;};'use strict';var multer=require(_0xcaef('0x0'));var util=require(_0xcaef('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcaef('0x2'));var router=express[_0xcaef('0x3')]();var fs_extra=require(_0xcaef('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xcaef('0x5'));var config=require(_0xcaef('0x6'));var controller=require(_0xcaef('0x7'));router[_0xcaef('0x8')]('/',auth[_0xcaef('0x9')](),controller[_0xcaef('0xa')]);router['get'](_0xcaef('0xb'),auth[_0xcaef('0x9')](),controller['describe']);router['get'](_0xcaef('0xc'),auth[_0xcaef('0x9')](),controller[_0xcaef('0xd')]);router[_0xcaef('0xe')]('/',auth['isAuthenticated'](),controller[_0xcaef('0xf')]);router['put'](_0xcaef('0xc'),auth[_0xcaef('0x9')](),controller[_0xcaef('0x10')]);router[_0xcaef('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xcaef('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 49b4abb..0850f94 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 _0x37e9=['DATE','BOOLEAN','INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x2df1f3,_0x7a67ac){var _0x55b6b7=function(_0x5da935){while(--_0x5da935){_0x2df1f3['push'](_0x2df1f3['shift']());}};_0x55b6b7(++_0x7a67ac);}(_0x37e9,0x1e7));var _0x937e=function(_0x44cd61,_0x2a9728){_0x44cd61=_0x44cd61-0x0;var _0x50578f=_0x37e9[_0x44cd61];return _0x50578f;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'type':{'type':Sequelize[_0x937e('0x2')]},'uniqueid':{'type':Sequelize[_0x937e('0x2')]},'calleridnum':{'type':Sequelize[_0x937e('0x2')]},'calleridname':{'type':Sequelize[_0x937e('0x2')]},'queue':{'type':Sequelize[_0x937e('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x937e('0x2')]},'agentcalledAt':{'type':Sequelize[_0x937e('0x3')]},'agentconnectAt':{'type':Sequelize[_0x937e('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x937e('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x937e('0x3')]},'agentdumpAt':{'type':Sequelize[_0x937e('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x937e('0x5')]},'agentacw':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x937e('0x5')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x937e('0x2')]},'channelstate':{'type':Sequelize[_0x937e('0x5')]},'channelstatedesc':{'type':Sequelize[_0x937e('0x2')]},'connectedlinenum':{'type':Sequelize[_0x937e('0x2')]},'connectedlinename':{'type':Sequelize[_0x937e('0x2')]},'language':{'type':Sequelize[_0x937e('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x937e('0x2')]},'destchannel':{'type':Sequelize[_0x937e('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x937e('0x2')]},'destcalleridnum':{'type':Sequelize[_0x937e('0x2')]},'destcalleridname':{'type':Sequelize[_0x937e('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x937e('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x937e('0x2')]},'destaccountcode':{'type':Sequelize[_0x937e('0x2')]},'destcontext':{'type':Sequelize[_0x937e('0x2')]},'destexten':{'type':Sequelize[_0x937e('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x937e('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x937e('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x937e('0x2')]},'transfer':{'type':Sequelize[_0x937e('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x937e('0x2')],'comment':_0x937e('0x6')},'transferexten':{'type':Sequelize[_0x937e('0x2')]},'transferuniqueid':{'type':Sequelize[_0x937e('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x6146=['sequelize','STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x3bfd0b,_0x5752df){var _0x43bd6b=function(_0x217876){while(--_0x217876){_0x3bfd0b['push'](_0x3bfd0b['shift']());}};_0x43bd6b(++_0x5752df);}(_0x6146,0xba));var _0x6614=function(_0x1bf7b7,_0x49e6fa){_0x1bf7b7=_0x1bf7b7-0x0;var _0x36bad2=_0x6146[_0x1bf7b7];return _0x36bad2;};'use strict';var Sequelize=require(_0x6614('0x0'));module['exports']={'type':{'type':Sequelize[_0x6614('0x1')]},'uniqueid':{'type':Sequelize[_0x6614('0x1')]},'calleridnum':{'type':Sequelize[_0x6614('0x1')]},'calleridname':{'type':Sequelize[_0x6614('0x1')]},'queue':{'type':Sequelize[_0x6614('0x1')]},'interface':{'type':Sequelize[_0x6614('0x1')]},'membername':{'type':Sequelize[_0x6614('0x1')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize[_0x6614('0x2')]},'agentcompleteAt':{'type':Sequelize[_0x6614('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0x6614('0x2')]},'agentdumpAt':{'type':Sequelize[_0x6614('0x2')]},'holdtime':{'type':Sequelize[_0x6614('0x3')]},'agentcomplete':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x6614('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x6614('0x3')]},'reason':{'type':Sequelize[_0x6614('0x1')]},'lastevent':{'type':Sequelize[_0x6614('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x6614('0x3')]},'channelstatedesc':{'type':Sequelize[_0x6614('0x1')]},'connectedlinenum':{'type':Sequelize[_0x6614('0x1')]},'connectedlinename':{'type':Sequelize[_0x6614('0x1')]},'language':{'type':Sequelize[_0x6614('0x1')]},'accountcode':{'type':Sequelize[_0x6614('0x1')]},'context':{'type':Sequelize[_0x6614('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x6614('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x6614('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x6614('0x1')]},'destcalleridnum':{'type':Sequelize[_0x6614('0x1')]},'destcalleridname':{'type':Sequelize[_0x6614('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x6614('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x6614('0x1')]},'destlanguage':{'type':Sequelize[_0x6614('0x1')]},'destaccountcode':{'type':Sequelize[_0x6614('0x1')]},'destcontext':{'type':Sequelize[_0x6614('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x6614('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x6614('0x1')]},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0x6614('0x4')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x6614('0x1')],'comment':_0x6614('0x5')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x6614('0x1')]},'agententerreason':{'type':Sequelize[_0x6614('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 5335007..f23311b 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(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xa9e0[_0x2f5ac5];return _0x37c9a8;};'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 409c59a..731788d 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 _0xe574=['../../config/environment','./voiceAgentReport.attributes','exports','report_agent','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2e90ce,_0x42e63f){var _0x135350=function(_0x49aab9){while(--_0x49aab9){_0x2e90ce['push'](_0x2e90ce['shift']());}};_0x135350(++_0x42e63f);}(_0xe574,0x100));var _0x4e57=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xe574[_0x57b54c];return _0x59cc19;};'use strict';var _=require(_0x4e57('0x0'));var util=require('util');var logger=require(_0x4e57('0x1'))(_0x4e57('0x2'));var moment=require(_0x4e57('0x3'));var BPromise=require(_0x4e57('0x4'));var rp=require(_0x4e57('0x5'));var fs=require('fs');var path=require(_0x4e57('0x6'));var rimraf=require(_0x4e57('0x7'));var config=require(_0x4e57('0x8'));var attributes=require(_0x4e57('0x9'));module[_0x4e57('0xa')]=function(_0x436174,_0x2825a9){return _0x436174['define']('VoiceAgentReport',attributes,{'tableName':_0x4e57('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid','destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xa990=['exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceAgentReport.attributes'];(function(_0xf2894c,_0x404d68){var _0xe47562=function(_0x4a73cb){while(--_0x4a73cb){_0xf2894c['push'](_0xf2894c['shift']());}};_0xe47562(++_0x404d68);}(_0xa990,0xc9));var _0x0a99=function(_0x5ed0aa,_0x527911){_0x5ed0aa=_0x5ed0aa-0x0;var _0x2fa93e=_0xa990[_0x5ed0aa];return _0x2fa93e;};'use strict';var _=require(_0x0a99('0x0'));var util=require(_0x0a99('0x1'));var logger=require(_0x0a99('0x2'))(_0x0a99('0x3'));var moment=require(_0x0a99('0x4'));var BPromise=require(_0x0a99('0x5'));var rp=require(_0x0a99('0x6'));var fs=require('fs');var path=require(_0x0a99('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0a99('0x8'));module[_0x0a99('0x9')]=function(_0xfdb594,_0x320560){return _0xfdb594[_0x0a99('0xa')](_0x0a99('0xb'),attributes,{'tableName':_0x0a99('0xc'),'paranoid':![],'indexes':[{'fields':[_0x0a99('0xd'),_0x0a99('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 2cd1af2..150c15d 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 _0xa310=['stringify','error','code','message','VoiceAgentReport,\x20%s,\x20%s','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','raw','debug','UpdateVoiceAgentReport','update','options','where','limit','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xa310,0x13b));var _0x0a31=function(_0x283a4b,_0x9b3371){_0x283a4b=_0x283a4b-0x0;var _0x30bc80=_0xa310[_0x283a4b];return _0x30bc80;};'use strict';var _=require('lodash');var util=require(_0x0a31('0x0'));var moment=require(_0x0a31('0x1'));var BPromise=require(_0x0a31('0x2'));var rs=require(_0x0a31('0x3'));var fs=require('fs');var Redis=require(_0x0a31('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x0a31('0x5'));var config=require(_0x0a31('0x6'));var jayson=require(_0x0a31('0x7'));var client=jayson[_0x0a31('0x8')][_0x0a31('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ce808,_0x35871e,_0x5b634b){return new BPromise(function(_0x52c519,_0x3d4a8d){return client[_0x0a31('0xa')](_0x2ce808,_0x5b634b)[_0x0a31('0xb')](function(_0x53f55c){logger[_0x0a31('0xc')]('VoiceAgentReport,\x20%s,\x20%s',_0x35871e,_0x0a31('0xd'));logger['debug'](_0x0a31('0xe'),_0x35871e,_0x0a31('0xd'),JSON[_0x0a31('0xf')](_0x53f55c));if(_0x53f55c[_0x0a31('0x10')]){if(_0x53f55c[_0x0a31('0x10')][_0x0a31('0x11')]===0x1f4){logger[_0x0a31('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x35871e,_0x53f55c[_0x0a31('0x10')][_0x0a31('0x12')]);return _0x3d4a8d(_0x53f55c[_0x0a31('0x10')]['message']);}logger[_0x0a31('0x10')](_0x0a31('0x13'),_0x35871e,_0x53f55c['error']['message']);return _0x52c519(_0x53f55c['error'][_0x0a31('0x12')]);}else{logger[_0x0a31('0xc')](_0x0a31('0x13'),_0x35871e,_0x0a31('0xd'));_0x52c519(_0x53f55c[_0x0a31('0x14')]['message']);}})[_0x0a31('0x15')](function(_0x12dd7b){logger[_0x0a31('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x35871e,_0x12dd7b);_0x3d4a8d(_0x12dd7b);});});}exports[_0x0a31('0x16')]=function(_0x3db369){var _0x1764cd=this;return new Promise(function(_0x2c39e7,_0x28b419){return db[_0x0a31('0x17')][_0x0a31('0x18')](_0x3db369[_0x0a31('0x19')],{'raw':_0x3db369['options']?_0x3db369['options'][_0x0a31('0x1a')]===undefined?!![]:![]:!![]})[_0x0a31('0xb')](function(_0x3cdfe2){logger[_0x0a31('0xc')](_0x0a31('0x16'),_0x3db369);logger[_0x0a31('0x1b')](_0x0a31('0x16'),_0x3db369,JSON[_0x0a31('0xf')](_0x3cdfe2));_0x2c39e7(_0x3cdfe2);})[_0x0a31('0x15')](function(_0x11c2af){logger[_0x0a31('0x10')](_0x0a31('0x16'),_0x11c2af[_0x0a31('0x12')],_0x3db369);_0x28b419(_0x1764cd[_0x0a31('0x10')](0x1f4,_0x11c2af[_0x0a31('0x12')]));});});};exports[_0x0a31('0x1c')]=function(_0x3c2020){var _0x1d8b7f=this;return new Promise(function(_0x33f9e5,_0x8336f4){return db[_0x0a31('0x17')][_0x0a31('0x1d')](_0x3c2020[_0x0a31('0x19')],{'raw':_0x3c2020[_0x0a31('0x1e')]?_0x3c2020[_0x0a31('0x1e')][_0x0a31('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3c2020[_0x0a31('0x1e')]?_0x3c2020[_0x0a31('0x1e')][_0x0a31('0x1f')]||null:null,'attributes':_0x3c2020[_0x0a31('0x1e')]?_0x3c2020['options']['attributes']||null:null,'limit':_0x3c2020[_0x0a31('0x1e')]?_0x3c2020[_0x0a31('0x1e')][_0x0a31('0x20')]||null:null})[_0x0a31('0xb')](function(_0x579dda){logger[_0x0a31('0xc')](_0x0a31('0x1c'),_0x3c2020);logger[_0x0a31('0x1b')](_0x0a31('0x1c'),_0x3c2020,JSON[_0x0a31('0xf')](_0x579dda));_0x33f9e5(_0x579dda);})[_0x0a31('0x15')](function(_0x371dc0){logger[_0x0a31('0x10')]('UpdateVoiceAgentReport',_0x371dc0[_0x0a31('0x12')],_0x3c2020);_0x8336f4(_0x1d8b7f[_0x0a31('0x10')](0x1f4,_0x371dc0[_0x0a31('0x12')]));});});}; \ No newline at end of file +var _0x75b0=['request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','body','UpdateVoiceAgentReport','update','options','attributes','limit','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2ad775,_0x3e2c0f){var _0x30b23d=function(_0x43c9ff){while(--_0x43c9ff){_0x2ad775['push'](_0x2ad775['shift']());}};_0x30b23d(++_0x3e2c0f);}(_0x75b0,0x12c));var _0x075b=function(_0x32fe71,_0xabba8a){_0x32fe71=_0x32fe71-0x0;var _0x3c0970=_0x75b0[_0x32fe71];return _0x3c0970;};'use strict';var _=require('lodash');var util=require(_0x075b('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x075b('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x075b('0x2'));var logger=require('../../config/logger')(_0x075b('0x3'));var config=require(_0x075b('0x4'));var jayson=require(_0x075b('0x5'));var client=jayson[_0x075b('0x6')][_0x075b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x13aee6,_0x2f968d,_0x208ecf){return new BPromise(function(_0xe218bd,_0x156370){return client[_0x075b('0x8')](_0x13aee6,_0x208ecf)[_0x075b('0x9')](function(_0x5d49d9){logger[_0x075b('0xa')]('VoiceAgentReport,\x20%s,\x20%s',_0x2f968d,_0x075b('0xb'));logger[_0x075b('0xc')](_0x075b('0xd'),_0x2f968d,'request\x20sent',JSON[_0x075b('0xe')](_0x5d49d9));if(_0x5d49d9[_0x075b('0xf')]){if(_0x5d49d9['error'][_0x075b('0x10')]===0x1f4){logger['error'](_0x075b('0x11'),_0x2f968d,_0x5d49d9[_0x075b('0xf')][_0x075b('0x12')]);return _0x156370(_0x5d49d9[_0x075b('0xf')][_0x075b('0x12')]);}logger[_0x075b('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x2f968d,_0x5d49d9[_0x075b('0xf')][_0x075b('0x12')]);return _0xe218bd(_0x5d49d9[_0x075b('0xf')][_0x075b('0x12')]);}else{logger['info'](_0x075b('0x11'),_0x2f968d,'request\x20sent');_0xe218bd(_0x5d49d9[_0x075b('0x13')]['message']);}})[_0x075b('0x14')](function(_0x5e5206){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x2f968d,_0x5e5206);_0x156370(_0x5e5206);});});}exports[_0x075b('0x15')]=function(_0x57864c){var _0x277ec5=this;return new Promise(function(_0x2e7a68,_0x1f6369){return db['VoiceAgentReport']['create'](_0x57864c[_0x075b('0x16')],{'raw':_0x57864c['options']?_0x57864c['options']['raw']===undefined?!![]:![]:!![]})[_0x075b('0x9')](function(_0x2388d8){logger[_0x075b('0xa')](_0x075b('0x15'),_0x57864c);logger['debug'](_0x075b('0x15'),_0x57864c,JSON[_0x075b('0xe')](_0x2388d8));_0x2e7a68(_0x2388d8);})[_0x075b('0x14')](function(_0x3d22ce){logger[_0x075b('0xf')](_0x075b('0x15'),_0x3d22ce[_0x075b('0x12')],_0x57864c);_0x1f6369(_0x277ec5[_0x075b('0xf')](0x1f4,_0x3d22ce[_0x075b('0x12')]));});});};exports[_0x075b('0x17')]=function(_0x321307){var _0x2f909c=this;return new Promise(function(_0x261b46,_0x4c0e5c){return db['VoiceAgentReport'][_0x075b('0x18')](_0x321307[_0x075b('0x16')],{'raw':_0x321307[_0x075b('0x19')]?_0x321307[_0x075b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x321307[_0x075b('0x19')]?_0x321307[_0x075b('0x19')]['where']||null:null,'attributes':_0x321307['options']?_0x321307[_0x075b('0x19')][_0x075b('0x1a')]||null:null,'limit':_0x321307[_0x075b('0x19')]?_0x321307[_0x075b('0x19')][_0x075b('0x1b')]||null:null})[_0x075b('0x9')](function(_0x6abe4f){logger[_0x075b('0xa')](_0x075b('0x17'),_0x321307);logger['debug']('UpdateVoiceAgentReport',_0x321307,JSON['stringify'](_0x6abe4f));_0x261b46(_0x6abe4f);})[_0x075b('0x14')](function(_0x3af37e){logger[_0x075b('0xf')](_0x075b('0x17'),_0x3af37e[_0x075b('0x12')],_0x321307);_0x4c0e5c(_0x2f909c[_0x075b('0xf')](0x1f4,_0x3af37e[_0x075b('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index f9e144e..4a930f9 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 _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(_0x14a8e8,_0x39f9fe){var _0x5b8de4=function(_0x596211){while(--_0x596211){_0x14a8e8['push'](_0x14a8e8['shift']());}};_0x5b8de4(++_0x39f9fe);}(_0xf873,0xb2));var _0x3f87=function(_0x17feb7,_0x20f9af){_0x17feb7=_0x17feb7-0x0;var _0x5c9e71=_0xf873[_0x17feb7];return _0x5c9e71;};'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('./voiceCallReport.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 _0xaba6=['destroy','exports','multer','util','fs-extra','../../components/auth/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x58a2d5,_0x2ccc3b){var _0x2fa4b7=function(_0x2d4bbf){while(--_0x2d4bbf){_0x58a2d5['push'](_0x58a2d5['shift']());}};_0x2fa4b7(++_0x2ccc3b);}(_0xaba6,0xe2));var _0x6aba=function(_0x250f95,_0x5a5728){_0x250f95=_0x250f95-0x0;var _0x4ada97=_0xaba6[_0x250f95];return _0x4ada97;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x6aba('0x2'));var auth=require(_0x6aba('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x6aba('0x4'));var controller=require(_0x6aba('0x5'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x6aba('0x6')]('/describe',auth[_0x6aba('0x7')](),controller[_0x6aba('0x8')]);router['get'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller['show']);router[_0x6aba('0xa')]('/',auth[_0x6aba('0x7')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xd')]);router['delete'](_0x6aba('0x9'),auth[_0x6aba('0x7')](),controller[_0x6aba('0xe')]);module[_0x6aba('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 10fe25c..66323a0 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 _0x605f=['inbound','internal','inbound-fax','outbound-fax','DATE','INTEGER','exports','STRING'];(function(_0x518e15,_0x568735){var _0x3bd658=function(_0x6a579f){while(--_0x6a579f){_0x518e15['push'](_0x518e15['shift']());}};_0x3bd658(++_0x568735);}(_0x605f,0x1a6));var _0xf605=function(_0x96a9cd,_0x39203a){_0x96a9cd=_0x96a9cd-0x0;var _0x43cc89=_0x605f[_0x96a9cd];return _0x43cc89;};'use strict';var Sequelize=require('sequelize');module[_0xf605('0x0')]={'uniqueid':{'type':Sequelize[_0xf605('0x1')]},'type':{'type':Sequelize['ENUM'](_0xf605('0x2'),_0xf605('0x3'),'outbound',_0xf605('0x4'),_0xf605('0x5'),'dialer')},'tag':{'type':Sequelize[_0xf605('0x1')]},'accountcode':{'type':Sequelize[_0xf605('0x1')]},'source':{'type':Sequelize[_0xf605('0x1')]},'destination':{'type':Sequelize['STRING']},'destinationcontext':{'type':Sequelize[_0xf605('0x1')]},'callerid':{'type':Sequelize[_0xf605('0x1')]},'channel':{'type':Sequelize[_0xf605('0x1')]},'destinationchannel':{'type':Sequelize[_0xf605('0x1')]},'lastapplication':{'type':Sequelize[_0xf605('0x1')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0xf605('0x6')]},'systemanswertime':{'type':Sequelize[_0xf605('0x6')]},'answertime':{'type':Sequelize[_0xf605('0x6')]},'endtime':{'type':Sequelize[_0xf605('0x6')]},'duration':{'type':Sequelize[_0xf605('0x7')]},'billableseconds':{'type':Sequelize[_0xf605('0x7')]},'mohtime':{'type':Sequelize[_0xf605('0x7')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf605('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0xf605('0x1')]},'userDisposition':{'type':Sequelize[_0xf605('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xf605('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xf605('0x1')]},'note':{'type':Sequelize[_0xf605('0x1')]},'prefix':{'type':Sequelize[_0xf605('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5919=['INTEGER','sequelize','STRING','ENUM','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT','DATE'];(function(_0x5d6d00,_0x19d4a1){var _0x1ba4fd=function(_0x14914e){while(--_0x14914e){_0x5d6d00['push'](_0x5d6d00['shift']());}};_0x1ba4fd(++_0x19d4a1);}(_0x5919,0x198));var _0x9591=function(_0x32cf0c,_0x55d431){_0x32cf0c=_0x32cf0c-0x0;var _0x5a1d31=_0x5919[_0x32cf0c];return _0x5a1d31;};'use strict';var Sequelize=require(_0x9591('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x9591('0x1')]},'type':{'type':Sequelize[_0x9591('0x2')](_0x9591('0x3'),_0x9591('0x4'),'outbound',_0x9591('0x5'),_0x9591('0x6'),_0x9591('0x7'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9591('0x1')]},'source':{'type':Sequelize[_0x9591('0x1')]},'destination':{'type':Sequelize[_0x9591('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x9591('0x1')]},'channel':{'type':Sequelize[_0x9591('0x1')]},'destinationchannel':{'type':Sequelize[_0x9591('0x1')]},'lastapplication':{'type':Sequelize[_0x9591('0x1')]},'lastdata':{'type':Sequelize[_0x9591('0x8')]},'starttime':{'type':Sequelize[_0x9591('0x9')]},'systemanswertime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x9591('0x9')]},'endtime':{'type':Sequelize[_0x9591('0x9')]},'duration':{'type':Sequelize[_0x9591('0xa')]},'billableseconds':{'type':Sequelize[_0x9591('0xa')]},'mohtime':{'type':Sequelize[_0x9591('0xa')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x9591('0x1')]},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x9591('0x1')]},'userDisposition':{'type':Sequelize[_0x9591('0x1')]},'userSecondDisposition':{'type':Sequelize[_0x9591('0x1')]},'userThirdDisposition':{'type':Sequelize[_0x9591('0x1')]},'note':{'type':Sequelize[_0x9591('0x1')]},'prefix':{'type':Sequelize[_0x9591('0x1')]},'routeid':{'type':Sequelize[_0x9591('0xa')]},'sipcallid':{'type':Sequelize[_0x9591('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index dd32ba2..f194986 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 _0xdb28=['options','includeAll','fullname','User','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','destroy','describe','body','uniqueid','user','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus','error','stack','name','send','index','VoiceCallReport','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge'];(function(_0x2a3fdd,_0x960a5e){var _0x16aa1d=function(_0x4ead9c){while(--_0x4ead9c){_0x2a3fdd['push'](_0x2a3fdd['shift']());}};_0x16aa1d(++_0x960a5e);}(_0xdb28,0x106));var _0x8db2=function(_0x4c818f,_0x5aa63b){_0x4c818f=_0x4c818f-0x0;var _0x4f39e0=_0xdb28[_0x4c818f];return _0x4f39e0;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'attributes':['id',_0x8db2('0x28'),_0x8db2('0x40'),'alias'],'model':db['User'],'as':_0x8db2('0x41')}];}return db['VoiceCallReport'][_0x8db2('0x42')](_0x21bae5);})[_0x8db2('0x24')](function(_0x313130){_0x3124d5[_0x8db2('0x43')]=_0x313130;return _0x3124d5;})[_0x8db2('0x24')](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x44')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x45')]=function(_0x5c97ef,_0x2f86b1){var _0x3d44de={'raw':!![],'where':{'id':_0x5c97ef[_0x8db2('0x46')]['id']}},_0x40c69e={};_0x40c69e['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x47')]);_0x40c69e[_0x8db2('0x30')]=_['keys'](_0x5c97ef[_0x8db2('0x30')]);_0x40c69e['filters']=_[_0x8db2('0x48')](_0x40c69e[_0x8db2('0x32')],_0x40c69e[_0x8db2('0x30')]);_0x3d44de['attributes']=_['intersection'](_0x40c69e[_0x8db2('0x32')],qs['fields'](_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x33')]));_0x3d44de[_0x8db2('0x34')]=_0x3d44de[_0x8db2('0x34')][_0x8db2('0x35')]?_0x3d44de[_0x8db2('0x34')]:_0x40c69e[_0x8db2('0x32')];if(_0x5c97ef[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x3d44de[_0x8db2('0x49')]=[{'all':!![]}];}_0x3d44de=_[_0x8db2('0x3d')]({},_0x3d44de,_0x5c97ef[_0x8db2('0x3e')]);return db['VoiceCallReport'][_0x8db2('0x4a')](_0x3d44de)[_0x8db2('0x24')](handleEntityNotFound(_0x2f86b1,null))[_0x8db2('0x24')](respondWithResult(_0x2f86b1,null))[_0x8db2('0x44')](handleError(_0x2f86b1,null));};exports['create']=function(_0x4ffd9d,_0x11c224){return db[_0x8db2('0x2b')][_0x8db2('0x4b')](_0x4ffd9d['body'],{})['then'](respondWithResult(_0x11c224,0xc9))['catch'](handleError(_0x11c224,null));};exports[_0x8db2('0x4c')]=function(_0x368c37,_0x55c7dd){return db[_0x8db2('0x2b')][_0x8db2('0x4a')]({'where':{'id':_0x368c37[_0x8db2('0x46')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x55c7dd,null))['then'](removeEntity(_0x55c7dd,null))['catch'](handleError(_0x55c7dd,null));};exports[_0x8db2('0x4d')]=function(_0x18c6ef,_0x2908e4){return db[_0x8db2('0x2b')][_0x8db2('0x4d')]()[_0x8db2('0x24')](respondWithResult(_0x2908e4,null))[_0x8db2('0x44')](handleError(_0x2908e4,null));};exports[_0x8db2('0x23')]=function(_0x4187d6,_0x426ae0){if(_0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')]){delete _0x4187d6[_0x8db2('0x4e')][_0x8db2('0x4f')];}return db[_0x8db2('0x2b')]['find']({'where':{'uniqueid':_0x4187d6[_0x8db2('0x46')]['id'],'UserId':{'$or':[null,_0x4187d6[_0x8db2('0x50')]['id']]}}})['then'](handleEntityNotFound(_0x426ae0,null))[_0x8db2('0x24')](saveUpdates(_0x4187d6[_0x8db2('0x4e')],null))[_0x8db2('0x24')](respondWithResult(_0x426ae0,null))['catch'](handleError(_0x426ae0,null));}; \ No newline at end of file +var _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x5f66[_0x4c12ec];return _0x3ae42c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index cb05ebe..db2cfe9 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 _0xce49=['exports','define','VoiceCallReport','report_call','uniqueid','util','rimraf'];(function(_0x167278,_0xc04772){var _0x27c31e=function(_0x44761f){while(--_0x44761f){_0x167278['push'](_0x167278['shift']());}};_0x27c31e(++_0xc04772);}(_0xce49,0x132));var _0x9ce4=function(_0xd81fae,_0x35ca24){_0xd81fae=_0xd81fae-0x0;var _0xac6a40=_0xce49[_0xd81fae];return _0xac6a40;};'use strict';var _=require('lodash');var util=require(_0x9ce4('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9ce4('0x1'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module[_0x9ce4('0x2')]=function(_0x3a9b55,_0x3ad773){return _0x3a9b55[_0x9ce4('0x3')](_0x9ce4('0x4'),attributes,{'tableName':_0x9ce4('0x5'),'paranoid':![],'indexes':[{'fields':[_0x9ce4('0x6')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1251=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceCallReport.attributes','exports','VoiceCallReport','report_call','lodash'];(function(_0x3005d5,_0xf588c7){var _0x547c7e=function(_0x4514dc){while(--_0x4514dc){_0x3005d5['push'](_0x3005d5['shift']());}};_0x547c7e(++_0xf588c7);}(_0x1251,0x8f));var _0x1125=function(_0x2112df,_0x44789a){_0x2112df=_0x2112df-0x0;var _0x441e8d=_0x1251[_0x2112df];return _0x441e8d;};'use strict';var _=require(_0x1125('0x0'));var util=require('util');var logger=require(_0x1125('0x1'))(_0x1125('0x2'));var moment=require(_0x1125('0x3'));var BPromise=require(_0x1125('0x4'));var rp=require(_0x1125('0x5'));var fs=require('fs');var path=require(_0x1125('0x6'));var rimraf=require('rimraf');var config=require(_0x1125('0x7'));var attributes=require(_0x1125('0x8'));module[_0x1125('0x9')]=function(_0x4caedd,_0x51fb4a){return _0x4caedd['define'](_0x1125('0xa'),attributes,{'tableName':_0x1125('0xb'),'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 06b1355..34cda12 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 _0x955d=['catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','debug','CreateVoiceCallReport','create','body','update','limit','UpdateVoiceCallReport','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result'];(function(_0x11c88d,_0x33764b){var _0x503416=function(_0xd68aac){while(--_0xd68aac){_0x11c88d['push'](_0x11c88d['shift']());}};_0x503416(++_0x33764b);}(_0x955d,0x1a9));var _0xd955=function(_0x1533d8,_0x22de70){_0x1533d8=_0x1533d8-0x0;var _0x1b7a51=_0x955d[_0x1533d8];return _0x1b7a51;};'use strict';var _=require(_0xd955('0x0'));var util=require(_0xd955('0x1'));var moment=require(_0xd955('0x2'));var BPromise=require('bluebird');var rs=require(_0xd955('0x3'));var fs=require('fs');var Redis=require(_0xd955('0x4'));var db=require(_0xd955('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd955('0x6'))(_0xd955('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd955('0x8')][_0xd955('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3187c7,_0x3159d5,_0x523cbb){return new BPromise(function(_0x5936dc,_0x1eae18){return client['request'](_0x3187c7,_0x523cbb)[_0xd955('0xa')](function(_0x3135ae){logger[_0xd955('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3159d5,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x3159d5,_0xd955('0xc'),JSON[_0xd955('0xd')](_0x3135ae));if(_0x3135ae[_0xd955('0xe')]){if(_0x3135ae[_0xd955('0xe')][_0xd955('0xf')]===0x1f4){logger[_0xd955('0xe')](_0xd955('0x10'),_0x3159d5,_0x3135ae[_0xd955('0xe')]['message']);return _0x1eae18(_0x3135ae['error']['message']);}logger[_0xd955('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x3159d5,_0x3135ae[_0xd955('0xe')][_0xd955('0x11')]);return _0x5936dc(_0x3135ae[_0xd955('0xe')][_0xd955('0x11')]);}else{logger[_0xd955('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x3159d5,'request\x20sent');_0x5936dc(_0x3135ae[_0xd955('0x12')]['message']);}})[_0xd955('0x13')](function(_0x35ec92){logger['error'](_0xd955('0x10'),_0x3159d5,_0x35ec92);_0x1eae18(_0x35ec92);});});}exports[_0xd955('0x14')]=function(_0x1a4dcf){var _0x2d446b=this;return new Promise(function(_0x5acd40,_0x171b0c){return db[_0xd955('0x15')][_0xd955('0x16')]({'raw':_0x1a4dcf[_0xd955('0x17')]?_0x1a4dcf[_0xd955('0x17')][_0xd955('0x18')]===undefined?!![]:![]:!![],'where':_0x1a4dcf[_0xd955('0x17')]?_0x1a4dcf[_0xd955('0x17')][_0xd955('0x19')]||null:null,'attributes':_0x1a4dcf['options']?_0x1a4dcf['options'][_0xd955('0x1a')]||null:null,'limit':_0x1a4dcf[_0xd955('0x17')]?_0x1a4dcf[_0xd955('0x17')]['limit']||null:null,'include':_0x1a4dcf[_0xd955('0x17')]?_0x1a4dcf[_0xd955('0x17')]['include']?_['map'](_0x1a4dcf[_0xd955('0x17')][_0xd955('0x1b')],function(_0x4eb0c5){return{'model':db[_0x4eb0c5[_0xd955('0x1c')]],'as':_0x4eb0c5['as'],'attributes':_0x4eb0c5[_0xd955('0x1a')],'include':_0x4eb0c5[_0xd955('0x1b')]?_[_0xd955('0x1d')](_0x4eb0c5[_0xd955('0x1b')],function(_0x2297f6){return{'model':db[_0x2297f6[_0xd955('0x1c')]],'as':_0x2297f6['as'],'attributes':_0x2297f6[_0xd955('0x1a')],'include':_0x2297f6[_0xd955('0x1b')]?_['map'](_0x2297f6[_0xd955('0x1b')],function(_0x4897e0){return{'model':db[_0x4897e0[_0xd955('0x1c')]],'as':_0x4897e0['as'],'attributes':_0x4897e0['attributes']};}):[]};}):[]};}):[]:[]})[_0xd955('0xa')](function(_0x5117fc){logger[_0xd955('0xb')](_0xd955('0x14'),_0x1a4dcf);logger[_0xd955('0x1e')](_0xd955('0x14'),_0x1a4dcf,JSON['stringify'](_0x5117fc));_0x5acd40(_0x5117fc);})[_0xd955('0x13')](function(_0x49df64){logger[_0xd955('0xe')]('GetVoiceCallReport',_0x49df64['message'],_0x1a4dcf);_0x171b0c(_0x2d446b[_0xd955('0xe')](0x1f4,_0x49df64[_0xd955('0x11')]));});});};exports[_0xd955('0x1f')]=function(_0x3ec9f9){var _0xcb41e6=this;return new Promise(function(_0x27096e,_0x4015ca){return db[_0xd955('0x15')][_0xd955('0x20')](_0x3ec9f9[_0xd955('0x21')],{'raw':_0x3ec9f9[_0xd955('0x17')]?_0x3ec9f9[_0xd955('0x17')][_0xd955('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x108008){logger['info'](_0xd955('0x1f'),_0x3ec9f9);logger[_0xd955('0x1e')](_0xd955('0x1f'),_0x3ec9f9,JSON[_0xd955('0xd')](_0x108008));_0x27096e(_0x108008);})[_0xd955('0x13')](function(_0x435e2f){logger[_0xd955('0xe')](_0xd955('0x1f'),_0x435e2f[_0xd955('0x11')],_0x3ec9f9);_0x4015ca(_0xcb41e6['error'](0x1f4,_0x435e2f[_0xd955('0x11')]));});});};exports['UpdateVoiceCallReport']=function(_0x53341b){var _0x437446=this;return new Promise(function(_0xb7cc23,_0x3de3ce){return db[_0xd955('0x15')][_0xd955('0x22')](_0x53341b[_0xd955('0x21')],{'raw':_0x53341b['options']?_0x53341b[_0xd955('0x17')][_0xd955('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53341b[_0xd955('0x17')]?_0x53341b[_0xd955('0x17')]['where']||null:null,'attributes':_0x53341b[_0xd955('0x17')]?_0x53341b['options'][_0xd955('0x1a')]||null:null,'limit':_0x53341b[_0xd955('0x17')]?_0x53341b[_0xd955('0x17')][_0xd955('0x23')]||null:null})[_0xd955('0xa')](function(_0x49a7a8){logger[_0xd955('0xb')]('UpdateVoiceCallReport',_0x53341b);logger[_0xd955('0x1e')](_0xd955('0x24'),_0x53341b,JSON[_0xd955('0xd')](_0x49a7a8));_0xb7cc23(_0x49a7a8);})[_0xd955('0x13')](function(_0x317bf6){logger[_0xd955('0xe')](_0xd955('0x24'),_0x317bf6[_0xd955('0x11')],_0x53341b);_0x3de3ce(_0x437446[_0xd955('0xe')](0x1f4,_0x317bf6['message']));});});}; \ No newline at end of file +var _0x6bc3=['UpdateVoiceCallReport','body','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceCallReport','VoiceCallReport','options','raw','where','attributes','limit','map','include','model','CreateVoiceCallReport','create'];(function(_0x3e182f,_0x380ec7){var _0x23edc9=function(_0x3ca65e){while(--_0x3ca65e){_0x3e182f['push'](_0x3e182f['shift']());}};_0x23edc9(++_0x380ec7);}(_0x6bc3,0x13b));var _0x36bc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6bc3[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x36bc('0x0'));var util=require(_0x36bc('0x1'));var moment=require(_0x36bc('0x2'));var BPromise=require('bluebird');var rs=require(_0x36bc('0x3'));var fs=require('fs');var Redis=require(_0x36bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x36bc('0x5'));var logger=require(_0x36bc('0x6'))(_0x36bc('0x7'));var config=require(_0x36bc('0x8'));var jayson=require(_0x36bc('0x9'));var client=jayson[_0x36bc('0xa')][_0x36bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x7ee2ac,_0x4ba8a6,_0x582c65){return new BPromise(function(_0x332d83,_0x3a1984){return client[_0x36bc('0xc')](_0x7ee2ac,_0x582c65)[_0x36bc('0xd')](function(_0x5db188){logger[_0x36bc('0xe')](_0x36bc('0xf'),_0x4ba8a6,_0x36bc('0x10'));logger[_0x36bc('0x11')](_0x36bc('0x12'),_0x4ba8a6,_0x36bc('0x10'),JSON[_0x36bc('0x13')](_0x5db188));if(_0x5db188[_0x36bc('0x14')]){if(_0x5db188[_0x36bc('0x14')][_0x36bc('0x15')]===0x1f4){logger['error'](_0x36bc('0xf'),_0x4ba8a6,_0x5db188[_0x36bc('0x14')][_0x36bc('0x16')]);return _0x3a1984(_0x5db188[_0x36bc('0x14')][_0x36bc('0x16')]);}logger[_0x36bc('0x14')](_0x36bc('0xf'),_0x4ba8a6,_0x5db188[_0x36bc('0x14')]['message']);return _0x332d83(_0x5db188[_0x36bc('0x14')]['message']);}else{logger[_0x36bc('0xe')](_0x36bc('0xf'),_0x4ba8a6,_0x36bc('0x10'));_0x332d83(_0x5db188[_0x36bc('0x17')][_0x36bc('0x16')]);}})['catch'](function(_0x321c2e){logger[_0x36bc('0x14')](_0x36bc('0xf'),_0x4ba8a6,_0x321c2e);_0x3a1984(_0x321c2e);});});}exports[_0x36bc('0x18')]=function(_0x692c2a){var _0x3d18bc=this;return new Promise(function(_0x372788,_0x3ed821){return db[_0x36bc('0x19')]['findAll']({'raw':_0x692c2a[_0x36bc('0x1a')]?_0x692c2a['options'][_0x36bc('0x1b')]===undefined?!![]:![]:!![],'where':_0x692c2a[_0x36bc('0x1a')]?_0x692c2a['options'][_0x36bc('0x1c')]||null:null,'attributes':_0x692c2a[_0x36bc('0x1a')]?_0x692c2a[_0x36bc('0x1a')][_0x36bc('0x1d')]||null:null,'limit':_0x692c2a['options']?_0x692c2a[_0x36bc('0x1a')][_0x36bc('0x1e')]||null:null,'include':_0x692c2a[_0x36bc('0x1a')]?_0x692c2a['options']['include']?_[_0x36bc('0x1f')](_0x692c2a[_0x36bc('0x1a')][_0x36bc('0x20')],function(_0x10821c){return{'model':db[_0x10821c[_0x36bc('0x21')]],'as':_0x10821c['as'],'attributes':_0x10821c[_0x36bc('0x1d')],'include':_0x10821c['include']?_[_0x36bc('0x1f')](_0x10821c[_0x36bc('0x20')],function(_0x1f8dbc){return{'model':db[_0x1f8dbc['model']],'as':_0x1f8dbc['as'],'attributes':_0x1f8dbc[_0x36bc('0x1d')],'include':_0x1f8dbc['include']?_[_0x36bc('0x1f')](_0x1f8dbc[_0x36bc('0x20')],function(_0x14ab4b){return{'model':db[_0x14ab4b[_0x36bc('0x21')]],'as':_0x14ab4b['as'],'attributes':_0x14ab4b['attributes']};}):[]};}):[]};}):[]:[]})[_0x36bc('0xd')](function(_0x46d7cc){logger[_0x36bc('0xe')](_0x36bc('0x18'),_0x692c2a);logger['debug'](_0x36bc('0x18'),_0x692c2a,JSON[_0x36bc('0x13')](_0x46d7cc));_0x372788(_0x46d7cc);})['catch'](function(_0x431759){logger[_0x36bc('0x14')](_0x36bc('0x18'),_0x431759[_0x36bc('0x16')],_0x692c2a);_0x3ed821(_0x3d18bc[_0x36bc('0x14')](0x1f4,_0x431759['message']));});});};exports[_0x36bc('0x22')]=function(_0x2efdd6){var _0x4fe59a=this;return new Promise(function(_0x524a3f,_0x4ec1ed){return db[_0x36bc('0x19')][_0x36bc('0x23')](_0x2efdd6['body'],{'raw':_0x2efdd6[_0x36bc('0x1a')]?_0x2efdd6[_0x36bc('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x36bc('0xd')](function(_0x3ba236){logger[_0x36bc('0xe')](_0x36bc('0x22'),_0x2efdd6);logger['debug'](_0x36bc('0x22'),_0x2efdd6,JSON[_0x36bc('0x13')](_0x3ba236));_0x524a3f(_0x3ba236);})['catch'](function(_0xc227dc){logger['error'](_0x36bc('0x22'),_0xc227dc[_0x36bc('0x16')],_0x2efdd6);_0x4ec1ed(_0x4fe59a['error'](0x1f4,_0xc227dc['message']));});});};exports[_0x36bc('0x24')]=function(_0x202307){var _0x2a6cec=this;return new Promise(function(_0xbd7b0c,_0x5b77f1){return db[_0x36bc('0x19')]['update'](_0x202307[_0x36bc('0x25')],{'raw':_0x202307[_0x36bc('0x1a')]?_0x202307[_0x36bc('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x202307['options']?_0x202307[_0x36bc('0x1a')][_0x36bc('0x1c')]||null:null,'attributes':_0x202307[_0x36bc('0x1a')]?_0x202307[_0x36bc('0x1a')][_0x36bc('0x1d')]||null:null,'limit':_0x202307[_0x36bc('0x1a')]?_0x202307[_0x36bc('0x1a')][_0x36bc('0x1e')]||null:null})[_0x36bc('0xd')](function(_0x42361a){logger[_0x36bc('0xe')](_0x36bc('0x24'),_0x202307);logger[_0x36bc('0x11')](_0x36bc('0x24'),_0x202307,JSON[_0x36bc('0x13')](_0x42361a));_0xbd7b0c(_0x42361a);})[_0x36bc('0x26')](function(_0x10d9bf){logger['error'](_0x36bc('0x24'),_0x10d9bf[_0x36bc('0x16')],_0x202307);_0x5b77f1(_0x2a6cec[_0x36bc('0x14')](0x1f4,_0x10d9bf[_0x36bc('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index d0ab10e..24292b4 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 _0x129b=['fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','show','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x129b,0x177));var _0xb129=function(_0x1465dc,_0x4d684d){_0x1465dc=_0x1465dc-0x0;var _0x226206=_0x129b[_0x1465dc];return _0x226206;};'use strict';var multer=require(_0xb129('0x0'));var util=require(_0xb129('0x1'));var path=require(_0xb129('0x2'));var timeout=require(_0xb129('0x3'));var express=require(_0xb129('0x4'));var router=express['Router']();var fs_extra=require(_0xb129('0x5'));var auth=require(_0xb129('0x6'));var interaction=require(_0xb129('0x7'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0xb129('0x8')](),controller[_0xb129('0x9')]);router[_0xb129('0xa')]('/:id',auth[_0xb129('0x8')](),controller[_0xb129('0xb')]);router[_0xb129('0xc')]('/',auth[_0xb129('0x8')](),controller['create']);router[_0xb129('0xd')](_0xb129('0xe'),auth[_0xb129('0x8')](),controller[_0xb129('0xf')]);router[_0xb129('0x10')](_0xb129('0xe'),auth[_0xb129('0x8')](),controller[_0xb129('0x11')]);module[_0xb129('0x12')]=router; \ No newline at end of file +var _0xc9c7=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','post','create','update','delete'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0xc9c7,0x122));var _0x7c9c=function(_0x4b3bc2,_0x4093c8){_0x4b3bc2=_0x4b3bc2-0x0;var _0x110925=_0xc9c7[_0x4b3bc2];return _0x110925;};'use strict';var multer=require(_0x7c9c('0x0'));var util=require(_0x7c9c('0x1'));var path=require(_0x7c9c('0x2'));var timeout=require(_0x7c9c('0x3'));var express=require(_0x7c9c('0x4'));var router=express[_0x7c9c('0x5')]();var fs_extra=require(_0x7c9c('0x6'));var auth=require(_0x7c9c('0x7'));var interaction=require(_0x7c9c('0x8'));var config=require('../../config/environment');var controller=require('./voiceChanSpy.controller');router[_0x7c9c('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7c9c('0xa'),auth[_0x7c9c('0xb')](),controller['show']);router[_0x7c9c('0xc')]('/',auth[_0x7c9c('0xb')](),controller[_0x7c9c('0xd')]);router['put'](_0x7c9c('0xa'),auth[_0x7c9c('0xb')](),controller[_0x7c9c('0xe')]);router[_0x7c9c('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x7c9c('0x10')]);module[_0x7c9c('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 4b1f663..580737d 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 _0xd2ed=['name','STRING','options','join','getDataValue','split','BOOLEAN','exports'];(function(_0x3b626c,_0x59535b){var _0x5274ef=function(_0x3c0a68){while(--_0x3c0a68){_0x3b626c['push'](_0x3b626c['shift']());}};_0x5274ef(++_0x59535b);}(_0xd2ed,0xcf));var _0xdd2e=function(_0x6c27ec,_0x139274){_0x6c27ec=_0x6c27ec-0x0;var _0x295924=_0xd2ed[_0x6c27ec];return _0x295924;};'use strict';var Sequelize=require('sequelize');module[_0xdd2e('0x0')]={'name':{'type':Sequelize['STRING']},'prefix':{'type':Sequelize['STRING'],'unique':_0xdd2e('0x1'),'allowNull':![]},'options':{'type':Sequelize[_0xdd2e('0x2')],'set':function(_0x5558ef){this['setDataValue'](_0xdd2e('0x3'),_0x5558ef?_0x5558ef[_0xdd2e('0x4')](''):[]);},'get':function(){return this[_0xdd2e('0x5')](_0xdd2e('0x3'))?this['getDataValue']('options')[_0xdd2e('0x6')](''):[];}},'auth':{'type':Sequelize[_0xdd2e('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0xdd2e('0x2')]},'record':{'type':Sequelize[_0xdd2e('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xdd2e('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d10=['options','split','BOOLEAN','sequelize','exports','STRING','name','join','getDataValue'];(function(_0x19a9be,_0x5101c5){var _0x3f0deb=function(_0x307bc3){while(--_0x307bc3){_0x19a9be['push'](_0x19a9be['shift']());}};_0x3f0deb(++_0x5101c5);}(_0x3d10,0x1c5));var _0x03d1=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x3d10[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0x03d1('0x0'));module[_0x03d1('0x1')]={'name':{'type':Sequelize[_0x03d1('0x2')]},'prefix':{'type':Sequelize[_0x03d1('0x2')],'unique':_0x03d1('0x3'),'allowNull':![]},'options':{'type':Sequelize[_0x03d1('0x2')],'set':function(_0x271d79){this['setDataValue']('options',_0x271d79?_0x271d79[_0x03d1('0x4')](''):[]);},'get':function(){return this[_0x03d1('0x5')](_0x03d1('0x6'))?this['getDataValue'](_0x03d1('0x6'))[_0x03d1('0x7')](''):[];}},'auth':{'type':Sequelize[_0x03d1('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x03d1('0x2')]},'record':{'type':Sequelize[_0x03d1('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x03d1('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 5729b3d..3605e50 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 _0x5d31=['where','includeAll','include','findAll','rows','catch','show','params','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChanSpies','UserProfileSection','userProfileId','UserProfileResource','create','body','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','error','name','send','map','VoiceChanSpy','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options'];(function(_0x2e7032,_0x320140){var _0x160dba=function(_0xe2de67){while(--_0xe2de67){_0x2e7032['push'](_0x2e7032['shift']());}};_0x160dba(++_0x320140);}(_0x5d31,0xf7));var _0x15d3=function(_0x310a1b,_0x4c9129){_0x310a1b=_0x310a1b-0x0;var _0xdea206=_0x5d31[_0x310a1b];return _0xdea206;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x15d3('0x0'));var zipdir=require(_0x15d3('0x1'));var jsonpatch=require(_0x15d3('0x2'));var rp=require('request-promise');var moment=require(_0x15d3('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x15d3('0x4'));var path=require(_0x15d3('0x5'));var sox=require(_0x15d3('0x6'));var csv=require(_0x15d3('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x15d3('0x8'));var _=require(_0x15d3('0x9'));var squel=require(_0x15d3('0xa'));var crypto=require(_0x15d3('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x15d3('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x15d3('0xd'));var Redis=require('ioredis');var authService=require(_0x15d3('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15d3('0xf'));var logger=require(_0x15d3('0x10'))(_0x15d3('0x11'));var utils=require(_0x15d3('0x12'));var config=require(_0x15d3('0x13'));var licenseUtil=require(_0x15d3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x219867,_0x1397d8){_0x1397d8=_0x1397d8||0xcc;return function(_0x2811b5){if(_0x2811b5){return _0x219867[_0x15d3('0x15')](_0x1397d8);}return _0x219867[_0x15d3('0x16')](_0x1397d8)[_0x15d3('0x17')]();};}function respondWithResult(_0x24eb07,_0x1658cf){_0x1658cf=_0x1658cf||0xc8;return function(_0x44b5a4){if(_0x44b5a4){return _0x24eb07[_0x15d3('0x16')](_0x1658cf)[_0x15d3('0x18')](_0x44b5a4);}};}function respondWithFilteredResult(_0x4af3a7,_0x304a13){return function(_0x17401b){if(_0x17401b){var _0x5bbfef=typeof _0x304a13[_0x15d3('0x19')]===_0x15d3('0x1a')&&typeof _0x304a13[_0x15d3('0x1b')]===_0x15d3('0x1a');var _0x1b7b3f=_0x17401b[_0x15d3('0x1c')];var _0x46f9ce=_0x5bbfef?0x0:_0x304a13[_0x15d3('0x19')];var _0x46e18b=_0x5bbfef?_0x17401b[_0x15d3('0x1c')]:_0x304a13[_0x15d3('0x19')]+_0x304a13['limit'];var _0x41c358;if(_0x46e18b>=_0x1b7b3f){_0x46e18b=_0x1b7b3f;_0x41c358=0xc8;}else{_0x41c358=0xce;}_0x4af3a7[_0x15d3('0x16')](_0x41c358);return _0x4af3a7['set']('Content-Range',_0x46f9ce+'-'+_0x46e18b+'/'+_0x1b7b3f)['json'](_0x17401b);}return null;};}function patchUpdates(_0x4ebc97){return function(_0x39bb05){try{jsonpatch[_0x15d3('0x1d')](_0x39bb05,_0x4ebc97,!![]);}catch(_0x40a327){return BPromise[_0x15d3('0x1e')](_0x40a327);}return _0x39bb05[_0x15d3('0x1f')]();};}function saveUpdates(_0x2fa13c,_0x4da198){return function(_0x49eb89){if(_0x49eb89){return _0x49eb89[_0x15d3('0x20')](_0x2fa13c)[_0x15d3('0x21')](function(_0x444075){return _0x444075;});}return null;};}function removeEntity(_0x72852f,_0x5b06cc){return function(_0x232078){if(_0x232078){return _0x232078[_0x15d3('0x22')]()[_0x15d3('0x21')](function(){var _0x539626=_0x232078[_0x15d3('0x23')]({'plain':!![]});var _0x240cf4='ChanSpies';return db['UserProfileResource']['destroy']({'where':{'type':_0x240cf4,'resourceId':_0x539626['id']}})[_0x15d3('0x21')](function(){return _0x232078;});})[_0x15d3('0x21')](function(){_0x72852f[_0x15d3('0x16')](0xcc)[_0x15d3('0x17')]();});}};}function handleEntityNotFound(_0x26ec4b,_0x24bf3c){return function(_0x247fab){if(!_0x247fab){_0x26ec4b[_0x15d3('0x15')](0x194);}return _0x247fab;};}function handleError(_0x3b1ba4,_0x49b865){_0x49b865=_0x49b865||0x1f4;return function(_0x5f445a){logger[_0x15d3('0x24')](_0x5f445a['stack']);if(_0x5f445a[_0x15d3('0x25')]){delete _0x5f445a['name'];}_0x3b1ba4[_0x15d3('0x16')](_0x49b865)[_0x15d3('0x26')](_0x5f445a);};}exports['index']=function(_0x424756,_0x29a947){var _0x477624={},_0x61822={},_0x246874={'count':0x0,'rows':[]};var _0x14491b=_[_0x15d3('0x27')](db[_0x15d3('0x28')][_0x15d3('0x29')],function(_0x18452c){return{'name':_0x18452c['fieldName'],'type':_0x18452c[_0x15d3('0x2a')][_0x15d3('0x2b')]};});_0x61822[_0x15d3('0x2c')]=_[_0x15d3('0x27')](_0x14491b,_0x15d3('0x25'));_0x61822[_0x15d3('0x2d')]=_[_0x15d3('0x2e')](_0x424756[_0x15d3('0x2d')]);_0x61822['filters']=_[_0x15d3('0x2f')](_0x61822['model'],_0x61822[_0x15d3('0x2d')]);_0x477624[_0x15d3('0x30')]=_[_0x15d3('0x2f')](_0x61822[_0x15d3('0x2c')],qs[_0x15d3('0x31')](_0x424756[_0x15d3('0x2d')][_0x15d3('0x31')]));_0x477624[_0x15d3('0x30')]=_0x477624[_0x15d3('0x30')][_0x15d3('0x32')]?_0x477624[_0x15d3('0x30')]:_0x61822[_0x15d3('0x2c')];if(!_0x424756[_0x15d3('0x2d')][_0x15d3('0x33')](_0x15d3('0x34'))){_0x477624['limit']=qs[_0x15d3('0x1b')](_0x424756[_0x15d3('0x2d')]['limit']);_0x477624[_0x15d3('0x19')]=qs[_0x15d3('0x19')](_0x424756[_0x15d3('0x2d')]['offset']);}_0x477624[_0x15d3('0x35')]=qs['sort'](_0x424756[_0x15d3('0x2d')][_0x15d3('0x36')]);_0x477624['where']=qs[_0x15d3('0x37')](_[_0x15d3('0x38')](_0x424756[_0x15d3('0x2d')],_0x61822[_0x15d3('0x37')]),_0x14491b);if(_0x424756[_0x15d3('0x2d')][_0x15d3('0x39')]){_0x477624['where']=_[_0x15d3('0x3a')](_0x477624['where'],{'$or':_[_0x15d3('0x27')](_0x14491b,function(_0x21c799){if(_0x21c799[_0x15d3('0x2a')]!==_0x15d3('0x3b')){var _0x204676={};_0x204676[_0x21c799[_0x15d3('0x25')]]={'$like':'%'+_0x424756[_0x15d3('0x2d')][_0x15d3('0x39')]+'%'};return _0x204676;}})});}_0x477624=_[_0x15d3('0x3a')]({},_0x477624,_0x424756[_0x15d3('0x3c')]);var _0x5a18b6={'where':_0x477624[_0x15d3('0x3d')]};return db[_0x15d3('0x28')]['count'](_0x5a18b6)['then'](function(_0x108254){_0x246874[_0x15d3('0x1c')]=_0x108254;if(_0x424756[_0x15d3('0x2d')][_0x15d3('0x3e')]){_0x477624[_0x15d3('0x3f')]=[{'all':!![]}];}return db[_0x15d3('0x28')][_0x15d3('0x40')](_0x477624);})[_0x15d3('0x21')](function(_0x25fa1d){_0x246874[_0x15d3('0x41')]=_0x25fa1d;return _0x246874;})['then'](respondWithFilteredResult(_0x29a947,_0x477624))[_0x15d3('0x42')](handleError(_0x29a947,null));};exports[_0x15d3('0x43')]=function(_0x534928,_0x1581dc){var _0x5c9829={'raw':![],'where':{'id':_0x534928[_0x15d3('0x44')]['id']}},_0x4d7f72={};_0x4d7f72[_0x15d3('0x2c')]=_[_0x15d3('0x2e')](db['VoiceChanSpy'][_0x15d3('0x29')]);_0x4d7f72['query']=_[_0x15d3('0x2e')](_0x534928[_0x15d3('0x2d')]);_0x4d7f72[_0x15d3('0x37')]=_[_0x15d3('0x2f')](_0x4d7f72[_0x15d3('0x2c')],_0x4d7f72['query']);_0x5c9829['attributes']=_['intersection'](_0x4d7f72[_0x15d3('0x2c')],qs['fields'](_0x534928[_0x15d3('0x2d')][_0x15d3('0x31')]));_0x5c9829[_0x15d3('0x30')]=_0x5c9829['attributes'][_0x15d3('0x32')]?_0x5c9829[_0x15d3('0x30')]:_0x4d7f72[_0x15d3('0x2c')];if(_0x534928[_0x15d3('0x2d')][_0x15d3('0x3e')]){_0x5c9829[_0x15d3('0x3f')]=[{'all':!![]}];}_0x5c9829=_[_0x15d3('0x3a')]({},_0x5c9829,_0x534928[_0x15d3('0x3c')]);return db[_0x15d3('0x28')][_0x15d3('0x45')](_0x5c9829)[_0x15d3('0x21')](handleEntityNotFound(_0x1581dc,null))[_0x15d3('0x21')](respondWithResult(_0x1581dc,null))['catch'](handleError(_0x1581dc,null));};exports['create']=function(_0x264487,_0x446929){return db[_0x15d3('0x28')]['create'](_0x264487['body'],{})[_0x15d3('0x21')](function(_0x4a825d){var _0x454ad3=_0x264487['user'][_0x15d3('0x23')]({'plain':!![]});if(!_0x454ad3)throw new Error(_0x15d3('0x46'));if(_0x454ad3['role']==='user'){var _0x480c9d=_0x4a825d['get']({'plain':!![]});var _0x5547ab=_0x15d3('0x47');return db[_0x15d3('0x48')]['find']({'where':{'name':_0x5547ab,'userProfileId':_0x454ad3[_0x15d3('0x49')]},'raw':!![]})[_0x15d3('0x21')](function(_0x323717){if(_0x323717&&_0x323717['autoAssociation']===0x0){return db[_0x15d3('0x4a')][_0x15d3('0x4b')]({'name':_0x480c9d[_0x15d3('0x25')],'resourceId':_0x480c9d['id'],'type':_0x323717[_0x15d3('0x25')],'sectionId':_0x323717['id']},{})[_0x15d3('0x21')](function(){return _0x4a825d;});}else{return _0x4a825d;}})[_0x15d3('0x42')](function(_0x5f0a42){logger[_0x15d3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f0a42);throw _0x5f0a42;});}return _0x4a825d;})['then'](respondWithResult(_0x446929,0xc9))[_0x15d3('0x42')](handleError(_0x446929,null));};exports['update']=function(_0x16e6bc,_0x54599a){if(_0x16e6bc[_0x15d3('0x4c')]['id']){delete _0x16e6bc[_0x15d3('0x4c')]['id'];}return db[_0x15d3('0x28')][_0x15d3('0x45')]({'where':{'id':_0x16e6bc[_0x15d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x54599a,null))['then'](saveUpdates(_0x16e6bc[_0x15d3('0x4c')],null))['then'](respondWithResult(_0x54599a,null))[_0x15d3('0x42')](handleError(_0x54599a,null));};exports[_0x15d3('0x22')]=function(_0x3cccc5,_0x23f439){return db[_0x15d3('0x28')][_0x15d3('0x45')]({'where':{'id':_0x3cccc5[_0x15d3('0x44')]['id']}})['then'](handleEntityNotFound(_0x23f439,null))[_0x15d3('0x21')](removeEntity(_0x23f439,null))[_0x15d3('0x42')](handleError(_0x23f439,null));}; \ No newline at end of file +var _0x1020=['to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','../../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','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','name','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceChanSpy','includeAll','include','findAll','catch','show','rawAttributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x52bf68,_0x46d780){var _0x59db0e=function(_0x446f21){while(--_0x446f21){_0x52bf68['push'](_0x52bf68['shift']());}};_0x59db0e(++_0x46d780);}(_0x1020,0x1a4));var _0x0102=function(_0x142020,_0x1f7233){_0x142020=_0x142020-0x0;var _0x40da8f=_0x1020[_0x142020];return _0x40da8f;};'use strict';var emlformat=require(_0x0102('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0102('0x1'));var jsonpatch=require(_0x0102('0x2'));var rp=require(_0x0102('0x3'));var moment=require(_0x0102('0x4'));var BPromise=require(_0x0102('0x5'));var Mustache=require(_0x0102('0x6'));var util=require(_0x0102('0x7'));var path=require(_0x0102('0x8'));var sox=require(_0x0102('0x9'));var csv=require(_0x0102('0xa'));var ejs=require(_0x0102('0xb'));var fs=require('fs');var fs_extra=require(_0x0102('0xc'));var _=require('lodash');var squel=require(_0x0102('0xd'));var crypto=require(_0x0102('0xe'));var jsforce=require(_0x0102('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0102('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0102('0x11'));var qs=require(_0x0102('0x12'));var as=require(_0x0102('0x13'));var hardwareService=require(_0x0102('0x14'));var logger=require(_0x0102('0x15'))('api');var utils=require(_0x0102('0x16'));var config=require(_0x0102('0x17'));var licenseUtil=require(_0x0102('0x18'));var db=require(_0x0102('0x19'))['db'];function respondWithStatusCode(_0x1945cf,_0x204192){_0x204192=_0x204192||0xcc;return function(_0x391fe1){if(_0x391fe1){return _0x1945cf[_0x0102('0x1a')](_0x204192);}return _0x1945cf[_0x0102('0x1b')](_0x204192)['end']();};}function respondWithResult(_0x502b93,_0xe2c57f){_0xe2c57f=_0xe2c57f||0xc8;return function(_0x20f557){if(_0x20f557){return _0x502b93[_0x0102('0x1b')](_0xe2c57f)[_0x0102('0x1c')](_0x20f557);}};}function respondWithFilteredResult(_0x41f27b,_0x435ac7){return function(_0x1a3e66){if(_0x1a3e66){var _0x2e0c35=typeof _0x435ac7[_0x0102('0x1d')]===_0x0102('0x1e')&&typeof _0x435ac7[_0x0102('0x1f')]==='undefined';var _0x2ca87b=_0x1a3e66['count'];var _0x58ba05=_0x2e0c35?0x0:_0x435ac7['offset'];var _0x246a2a=_0x2e0c35?_0x1a3e66[_0x0102('0x20')]:_0x435ac7[_0x0102('0x1d')]+_0x435ac7[_0x0102('0x1f')];var _0x1da56c;if(_0x246a2a>=_0x2ca87b){_0x246a2a=_0x2ca87b;_0x1da56c=0xc8;}else{_0x1da56c=0xce;}_0x41f27b[_0x0102('0x1b')](_0x1da56c);return _0x41f27b[_0x0102('0x21')](_0x0102('0x22'),_0x58ba05+'-'+_0x246a2a+'/'+_0x2ca87b)[_0x0102('0x1c')](_0x1a3e66);}return null;};}function patchUpdates(_0x43eb89){return function(_0x26a805){try{jsonpatch[_0x0102('0x23')](_0x26a805,_0x43eb89,!![]);}catch(_0x1cc7bb){return BPromise[_0x0102('0x24')](_0x1cc7bb);}return _0x26a805[_0x0102('0x25')]();};}function saveUpdates(_0x58ffbb,_0x2e33a6){return function(_0x2dc5f5){if(_0x2dc5f5){return _0x2dc5f5[_0x0102('0x26')](_0x58ffbb)[_0x0102('0x27')](function(_0x2787aa){return _0x2787aa;});}return null;};}function removeEntity(_0x4e8142,_0x4004f4){return function(_0x3d0fa7){if(_0x3d0fa7){return _0x3d0fa7[_0x0102('0x28')]()[_0x0102('0x27')](function(){var _0x130f92=_0x3d0fa7[_0x0102('0x29')]({'plain':!![]});var _0x5ea683=_0x0102('0x2a');return db[_0x0102('0x2b')][_0x0102('0x28')]({'where':{'type':_0x5ea683,'resourceId':_0x130f92['id']}})[_0x0102('0x27')](function(){return _0x3d0fa7;});})['then'](function(){_0x4e8142[_0x0102('0x1b')](0xcc)[_0x0102('0x2c')]();});}};}function handleEntityNotFound(_0xe613b5,_0x81b8b2){return function(_0x4cd317){if(!_0x4cd317){_0xe613b5['sendStatus'](0x194);}return _0x4cd317;};}function handleError(_0x2e01c7,_0xae6964){_0xae6964=_0xae6964||0x1f4;return function(_0x5a3850){logger[_0x0102('0x2d')](_0x5a3850['stack']);if(_0x5a3850[_0x0102('0x2e')]){delete _0x5a3850[_0x0102('0x2e')];}_0x2e01c7[_0x0102('0x1b')](_0xae6964)['send'](_0x5a3850);};}exports['index']=function(_0x4fbc76,_0x15e479){var _0x21bc0f={},_0x522a4a={},_0x8cc5db={'count':0x0,'rows':[]};var _0x103ceb=_['map'](db['VoiceChanSpy']['rawAttributes'],function(_0xaeae20){return{'name':_0xaeae20[_0x0102('0x2f')],'type':_0xaeae20[_0x0102('0x30')][_0x0102('0x31')]};});_0x522a4a[_0x0102('0x32')]=_[_0x0102('0x33')](_0x103ceb,_0x0102('0x2e'));_0x522a4a[_0x0102('0x34')]=_[_0x0102('0x35')](_0x4fbc76[_0x0102('0x34')]);_0x522a4a[_0x0102('0x36')]=_[_0x0102('0x37')](_0x522a4a[_0x0102('0x32')],_0x522a4a[_0x0102('0x34')]);_0x21bc0f['attributes']=_['intersection'](_0x522a4a[_0x0102('0x32')],qs[_0x0102('0x38')](_0x4fbc76[_0x0102('0x34')][_0x0102('0x38')]));_0x21bc0f[_0x0102('0x39')]=_0x21bc0f['attributes'][_0x0102('0x3a')]?_0x21bc0f[_0x0102('0x39')]:_0x522a4a[_0x0102('0x32')];if(!_0x4fbc76['query'][_0x0102('0x3b')](_0x0102('0x3c'))){_0x21bc0f[_0x0102('0x1f')]=qs[_0x0102('0x1f')](_0x4fbc76[_0x0102('0x34')][_0x0102('0x1f')]);_0x21bc0f[_0x0102('0x1d')]=qs[_0x0102('0x1d')](_0x4fbc76[_0x0102('0x34')][_0x0102('0x1d')]);}_0x21bc0f[_0x0102('0x3d')]=qs[_0x0102('0x3e')](_0x4fbc76[_0x0102('0x34')]['sort']);_0x21bc0f[_0x0102('0x3f')]=qs[_0x0102('0x36')](_[_0x0102('0x40')](_0x4fbc76[_0x0102('0x34')],_0x522a4a[_0x0102('0x36')]),_0x103ceb);if(_0x4fbc76['query'][_0x0102('0x41')]){_0x21bc0f[_0x0102('0x3f')]=_[_0x0102('0x42')](_0x21bc0f['where'],{'$or':_[_0x0102('0x33')](_0x103ceb,function(_0x17cb07){if(_0x17cb07[_0x0102('0x30')]!==_0x0102('0x43')){var _0x2a1833={};_0x2a1833[_0x17cb07[_0x0102('0x2e')]]={'$like':'%'+_0x4fbc76['query']['filter']+'%'};return _0x2a1833;}})});}_0x21bc0f=_[_0x0102('0x42')]({},_0x21bc0f,_0x4fbc76[_0x0102('0x44')]);var _0x5e0936={'where':_0x21bc0f[_0x0102('0x3f')]};return db[_0x0102('0x45')][_0x0102('0x20')](_0x5e0936)[_0x0102('0x27')](function(_0x2857d7){_0x8cc5db[_0x0102('0x20')]=_0x2857d7;if(_0x4fbc76[_0x0102('0x34')][_0x0102('0x46')]){_0x21bc0f[_0x0102('0x47')]=[{'all':!![]}];}return db[_0x0102('0x45')][_0x0102('0x48')](_0x21bc0f);})['then'](function(_0x2743e4){_0x8cc5db['rows']=_0x2743e4;return _0x8cc5db;})[_0x0102('0x27')](respondWithFilteredResult(_0x15e479,_0x21bc0f))[_0x0102('0x49')](handleError(_0x15e479,null));};exports[_0x0102('0x4a')]=function(_0x2934df,_0x486855){var _0x49a405={'raw':![],'where':{'id':_0x2934df['params']['id']}},_0x3607a6={};_0x3607a6[_0x0102('0x32')]=_[_0x0102('0x35')](db[_0x0102('0x45')][_0x0102('0x4b')]);_0x3607a6[_0x0102('0x34')]=_['keys'](_0x2934df[_0x0102('0x34')]);_0x3607a6[_0x0102('0x36')]=_[_0x0102('0x37')](_0x3607a6[_0x0102('0x32')],_0x3607a6[_0x0102('0x34')]);_0x49a405['attributes']=_[_0x0102('0x37')](_0x3607a6['model'],qs['fields'](_0x2934df[_0x0102('0x34')][_0x0102('0x38')]));_0x49a405['attributes']=_0x49a405[_0x0102('0x39')][_0x0102('0x3a')]?_0x49a405[_0x0102('0x39')]:_0x3607a6[_0x0102('0x32')];if(_0x2934df[_0x0102('0x34')]['includeAll']){_0x49a405[_0x0102('0x47')]=[{'all':!![]}];}_0x49a405=_[_0x0102('0x42')]({},_0x49a405,_0x2934df[_0x0102('0x44')]);return db[_0x0102('0x45')]['find'](_0x49a405)[_0x0102('0x27')](handleEntityNotFound(_0x486855,null))[_0x0102('0x27')](respondWithResult(_0x486855,null))[_0x0102('0x49')](handleError(_0x486855,null));};exports[_0x0102('0x4c')]=function(_0x13ec57,_0x850684){return db[_0x0102('0x45')][_0x0102('0x4c')](_0x13ec57[_0x0102('0x4d')],{})[_0x0102('0x27')](function(_0x169558){var _0xd31ad9=_0x13ec57['user']['get']({'plain':!![]});if(!_0xd31ad9)throw new Error(_0x0102('0x4e'));if(_0xd31ad9[_0x0102('0x4f')]===_0x0102('0x50')){var _0x57b33e=_0x169558[_0x0102('0x29')]({'plain':!![]});var _0x5b43f7='ChanSpies';return db[_0x0102('0x51')]['find']({'where':{'name':_0x5b43f7,'userProfileId':_0xd31ad9['userProfileId']},'raw':!![]})[_0x0102('0x27')](function(_0x33cf95){if(_0x33cf95&&_0x33cf95[_0x0102('0x52')]===0x0){return db[_0x0102('0x2b')][_0x0102('0x4c')]({'name':_0x57b33e[_0x0102('0x2e')],'resourceId':_0x57b33e['id'],'type':_0x33cf95[_0x0102('0x2e')],'sectionId':_0x33cf95['id']},{})['then'](function(){return _0x169558;});}else{return _0x169558;}})['catch'](function(_0x17bb0b){logger[_0x0102('0x2d')](_0x0102('0x53'),_0x17bb0b);throw _0x17bb0b;});}return _0x169558;})[_0x0102('0x27')](respondWithResult(_0x850684,0xc9))[_0x0102('0x49')](handleError(_0x850684,null));};exports[_0x0102('0x26')]=function(_0x290465,_0x28722c){if(_0x290465[_0x0102('0x4d')]['id']){delete _0x290465[_0x0102('0x4d')]['id'];}return db['VoiceChanSpy'][_0x0102('0x54')]({'where':{'id':_0x290465['params']['id']}})[_0x0102('0x27')](handleEntityNotFound(_0x28722c,null))[_0x0102('0x27')](saveUpdates(_0x290465[_0x0102('0x4d')],null))['then'](respondWithResult(_0x28722c,null))[_0x0102('0x49')](handleError(_0x28722c,null));};exports[_0x0102('0x28')]=function(_0x5bf40c,_0x10a9be){return db[_0x0102('0x45')][_0x0102('0x54')]({'where':{'id':_0x5bf40c[_0x0102('0x55')]['id']}})[_0x0102('0x27')](handleEntityNotFound(_0x10a9be,null))[_0x0102('0x27')](removeEntity(_0x10a9be,null))['catch'](handleError(_0x10a9be,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 71e827c..aab4766 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 _0x7c59=['lodash','util','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','push','merge','Set','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','User','findAll','internal','then','catch','exports','models','VoiceChanSpy','length','VoiceExtension','bulkCreate'];(function(_0x3b1b23,_0x21bccd){var _0x1efc85=function(_0x102a95){while(--_0x102a95){_0x3b1b23['push'](_0x3b1b23['shift']());}};_0x1efc85(++_0x21bccd);}(_0x7c59,0x118));var _0x97c5=function(_0xd0653b,_0x181421){_0xd0653b=_0xd0653b-0x0;var _0x311914=_0x7c59[_0xd0653b];return _0x311914;};'use strict';var _=require(_0x97c5('0x0'));var util=require(_0x97c5('0x1'));var BPromise=require('bluebird');var attributes=require(_0x97c5('0x2'));var getUserApplications=function(_0x5cc202,_0x504fda,_0x455895){var _0x25492d=0x1;var _0x3a2e3a=[];var _0x106f09={'context':_0x504fda['context']||_0x97c5('0x3'),'exten':util[_0x97c5('0x4')](_0x97c5('0x5'),_0x5cc202[_0x97c5('0x6')],_0x455895),'type':'system','isApp':![],'ChanSpyId':_0x5cc202['id'],'UserId':_0x504fda['id']};_0x3a2e3a[_0x97c5('0x7')](_[_0x97c5('0x8')]({'app':_0x97c5('0x9'),'appdata':util[_0x97c5('0x4')](_0x97c5('0xa'),_0x97c5('0xb')),'priority':_0x25492d++},_0x106f09));if(_0x5cc202[_0x97c5('0xc')]){_0x3a2e3a['push'](_[_0x97c5('0x8')]({'app':_0x97c5('0xd'),'appdata':util[_0x97c5('0x4')](_0x97c5('0xe'),_0x5cc202[_0x97c5('0xf')]),'priority':_0x25492d++},_0x106f09));}if(_0x5cc202[_0x97c5('0x10')]){_0x3a2e3a[_0x97c5('0x7')](_[_0x97c5('0x8')]({'app':_0x97c5('0x11'),'appdata':_0x5cc202['password'],'priority':_0x25492d++},_0x106f09));}_0x3a2e3a[_0x97c5('0x7')](_['merge']({'app':_0x97c5('0x12'),'appdata':util[_0x97c5('0x4')](_0x97c5('0x13'),_0x504fda[_0x97c5('0x14')],_0x5cc202[_0x97c5('0x15')]?_0x5cc202[_0x97c5('0x15')][_0x97c5('0x16')](''):''),'priority':_0x25492d++},_0x106f09));if(_0x5cc202[_0x97c5('0xc')]){_0x3a2e3a[_0x97c5('0x7')](_[_0x97c5('0x8')]({'app':_0x97c5('0x17'),'priority':_0x25492d++},_0x106f09));}return _0x3a2e3a;};var getChanSpyApplications=function(_0x17dd71,_0x43762b){var _0x3a6ec9=[];for(var _0x1ec266=0x0,_0x1d5ad2=0x1;_0x1ec266<_0x43762b['length'];_0x1ec266++,_0x1d5ad2=0x1){_0x3a6ec9=_0x3a6ec9['concat'](getUserApplications(_0x17dd71,_0x43762b[_0x1ec266],_0x43762b[_0x1ec266]['internal']));if(_0x43762b[_0x1ec266]['internal']!=_0x43762b[_0x1ec266]['name']){_0x3a6ec9=_0x3a6ec9['concat'](getUserApplications(_0x17dd71,_0x43762b[_0x1ec266],_0x43762b[_0x1ec266][_0x97c5('0x14')]));}}return _0x3a6ec9;};var getChanSpyPromise=function(_0x2a0a7d,_0x5b46d7){return new BPromise(function(_0x536306,_0x248553){return _0x2a0a7d[_0x97c5('0x18')][_0x97c5('0x19')]({'attributes':['id',_0x97c5('0x14'),_0x97c5('0x1a')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x97c5('0x1b')](function(_0x15892b){if(_0x15892b){return _0x536306(getChanSpyApplications(_0x5b46d7,_0x15892b));}return _0x536306([]);})[_0x97c5('0x1c')](function(_0x1d6cc3){_0x248553(_0x1d6cc3);});});};module[_0x97c5('0x1d')]=function(_0x5a6b1a,_0x45a8ce){var _0xd8d749=_0x5a6b1a[_0x97c5('0x1e')];return _0x5a6b1a['define'](_0x97c5('0x1f'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x397174,_0x45da26,_0x2e0cde){return getChanSpyPromise(_0xd8d749,_0x397174)[_0x97c5('0x1b')](function(_0x16c30f){if(_0x16c30f&&_0x16c30f[_0x97c5('0x20')]){return _0xd8d749[_0x97c5('0x21')]['bulkCreate'](_0x16c30f);}})[_0x97c5('0x1b')](function(){_0x2e0cde();})[_0x97c5('0x1c')](function(_0x485132){_0x2e0cde(_0x485132);});},'afterUpdate':function(_0x2e275b,_0x3e4bb7,_0x317b71){return _0xd8d749['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x2e275b['id']}})[_0x97c5('0x1b')](function(){return getChanSpyPromise(_0xd8d749,_0x2e275b);})['then'](function(_0x1db026){if(_0x1db026&&_0x1db026['length']){return _0xd8d749[_0x97c5('0x21')][_0x97c5('0x22')](_0x1db026);}})[_0x97c5('0x1b')](function(){_0x317b71();})[_0x97c5('0x1c')](function(_0x4d29cf){_0x317b71(_0x4d29cf);});},'afterDestroy':function(_0x166690,_0x12d0a1,_0x50c18a){return _0xd8d749['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x166690['id']}})[_0x97c5('0x1b')](function(){_0x50c18a();})['catch'](function(_0x127538){_0x50c18a(_0x127538);});}}});}; \ No newline at end of file +var _0xdb06=['auth','Authenticate','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','length','concat','internal','name','User','findAll','agent','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','then','destroy','bulkCreate','lodash','util','./voiceChanSpy.attributes','from-sip','%s%s','prefix','system','push','Set','format','CDR(type)=%s','chanspy','record','merge','MixMonitor','${UNIQUEID}.%s,a','recordingFormat'];(function(_0x4a3539,_0x50c0d1){var _0x4d6e0d=function(_0xfc1778){while(--_0xfc1778){_0x4a3539['push'](_0x4a3539['shift']());}};_0x4d6e0d(++_0x50c0d1);}(_0xdb06,0x8f));var _0x6db0=function(_0x50bfc7,_0x305285){_0x50bfc7=_0x50bfc7-0x0;var _0xb62c80=_0xdb06[_0x50bfc7];return _0xb62c80;};'use strict';var _=require(_0x6db0('0x0'));var util=require(_0x6db0('0x1'));var BPromise=require('bluebird');var attributes=require(_0x6db0('0x2'));var getUserApplications=function(_0x49d96c,_0x4fe426,_0x381a66){var _0x428c3e=0x1;var _0x2744ef=[];var _0xd76822={'context':_0x4fe426['context']||_0x6db0('0x3'),'exten':util['format'](_0x6db0('0x4'),_0x49d96c[_0x6db0('0x5')],_0x381a66),'type':_0x6db0('0x6'),'isApp':![],'ChanSpyId':_0x49d96c['id'],'UserId':_0x4fe426['id']};_0x2744ef[_0x6db0('0x7')](_['merge']({'app':_0x6db0('0x8'),'appdata':util[_0x6db0('0x9')](_0x6db0('0xa'),_0x6db0('0xb')),'priority':_0x428c3e++},_0xd76822));if(_0x49d96c[_0x6db0('0xc')]){_0x2744ef['push'](_[_0x6db0('0xd')]({'app':_0x6db0('0xe'),'appdata':util[_0x6db0('0x9')](_0x6db0('0xf'),_0x49d96c[_0x6db0('0x10')]),'priority':_0x428c3e++},_0xd76822));}if(_0x49d96c[_0x6db0('0x11')]){_0x2744ef[_0x6db0('0x7')](_[_0x6db0('0xd')]({'app':_0x6db0('0x12'),'appdata':_0x49d96c['password'],'priority':_0x428c3e++},_0xd76822));}_0x2744ef[_0x6db0('0x7')](_[_0x6db0('0xd')]({'app':_0x6db0('0x13'),'appdata':util[_0x6db0('0x9')](_0x6db0('0x14'),_0x4fe426['name'],_0x49d96c[_0x6db0('0x15')]?_0x49d96c[_0x6db0('0x15')][_0x6db0('0x16')](''):''),'priority':_0x428c3e++},_0xd76822));if(_0x49d96c['record']){_0x2744ef[_0x6db0('0x7')](_[_0x6db0('0xd')]({'app':_0x6db0('0x17'),'priority':_0x428c3e++},_0xd76822));}return _0x2744ef;};var getChanSpyApplications=function(_0x319d2a,_0x446a4e){var _0x27dd7f=[];for(var _0x4c813f=0x0,_0x296097=0x1;_0x4c813f<_0x446a4e[_0x6db0('0x18')];_0x4c813f++,_0x296097=0x1){_0x27dd7f=_0x27dd7f[_0x6db0('0x19')](getUserApplications(_0x319d2a,_0x446a4e[_0x4c813f],_0x446a4e[_0x4c813f][_0x6db0('0x1a')]));if(_0x446a4e[_0x4c813f][_0x6db0('0x1a')]!=_0x446a4e[_0x4c813f][_0x6db0('0x1b')]){_0x27dd7f=_0x27dd7f[_0x6db0('0x19')](getUserApplications(_0x319d2a,_0x446a4e[_0x4c813f],_0x446a4e[_0x4c813f][_0x6db0('0x1b')]));}}return _0x27dd7f;};var getChanSpyPromise=function(_0x43da9a,_0x4759e4){return new BPromise(function(_0xfeb3fd,_0x3d703b){return _0x43da9a[_0x6db0('0x1c')][_0x6db0('0x1d')]({'attributes':['id','name',_0x6db0('0x1a')],'where':{'role':_0x6db0('0x1e'),'chanspy':!![]},'raw':!![]})['then'](function(_0x29a5fe){if(_0x29a5fe){return _0xfeb3fd(getChanSpyApplications(_0x4759e4,_0x29a5fe));}return _0xfeb3fd([]);})['catch'](function(_0x2f1be5){_0x3d703b(_0x2f1be5);});});};module[_0x6db0('0x1f')]=function(_0x3ced0c,_0x222a4f){var _0x5ce1fa=_0x3ced0c[_0x6db0('0x20')];return _0x3ced0c[_0x6db0('0x21')](_0x6db0('0x22'),attributes,{'tableName':_0x6db0('0x23'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1aedc4,_0x16e8e1,_0x16e115){return getChanSpyPromise(_0x5ce1fa,_0x1aedc4)['then'](function(_0x55d6c2){if(_0x55d6c2&&_0x55d6c2[_0x6db0('0x18')]){return _0x5ce1fa[_0x6db0('0x24')]['bulkCreate'](_0x55d6c2);}})[_0x6db0('0x25')](function(){_0x16e115();})['catch'](function(_0xdf2fa0){_0x16e115(_0xdf2fa0);});},'afterUpdate':function(_0x118121,_0x314245,_0x29d11d){return _0x5ce1fa[_0x6db0('0x24')][_0x6db0('0x26')]({'where':{'ChanSpyId':_0x118121['id']}})['then'](function(){return getChanSpyPromise(_0x5ce1fa,_0x118121);})[_0x6db0('0x25')](function(_0x3e106e){if(_0x3e106e&&_0x3e106e['length']){return _0x5ce1fa[_0x6db0('0x24')][_0x6db0('0x27')](_0x3e106e);}})['then'](function(){_0x29d11d();})['catch'](function(_0x25e906){_0x29d11d(_0x25e906);});},'afterDestroy':function(_0x357e2a,_0x1e04a3,_0x343f23){return _0x5ce1fa[_0x6db0('0x24')][_0x6db0('0x26')]({'where':{'ChanSpyId':_0x357e2a['id']}})[_0x6db0('0x25')](function(){_0x343f23();})['catch'](function(_0x40320f){_0x343f23(_0x40320f);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 9381cfc..2ca4ec2 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 _0x1bca=['result','catch','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xa3b0c9,_0x4c219b){var _0x55b70c=function(_0x2d9719){while(--_0x2d9719){_0xa3b0c9['push'](_0xa3b0c9['shift']());}};_0x55b70c(++_0x4c219b);}(_0x1bca,0xb6));var _0xa1bc=function(_0x39df39,_0x5a2fd8){_0x39df39=_0x39df39-0x0;var _0x28ebf2=_0x1bca[_0x39df39];return _0x28ebf2;};'use strict';var _=require('lodash');var util=require(_0xa1bc('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa1bc('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa1bc('0x2'))['db'];var utils=require(_0xa1bc('0x3'));var logger=require(_0xa1bc('0x4'))('rpc');var config=require(_0xa1bc('0x5'));var jayson=require(_0xa1bc('0x6'));var client=jayson[_0xa1bc('0x7')][_0xa1bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x54bffb,_0x43a67,_0x432b65){return new BPromise(function(_0xea5ec8,_0x378061){return client[_0xa1bc('0x9')](_0x54bffb,_0x432b65)[_0xa1bc('0xa')](function(_0x2db364){logger['info'](_0xa1bc('0xb'),_0x43a67,_0xa1bc('0xc'));logger[_0xa1bc('0xd')](_0xa1bc('0xe'),_0x43a67,_0xa1bc('0xc'),JSON[_0xa1bc('0xf')](_0x2db364));if(_0x2db364[_0xa1bc('0x10')]){if(_0x2db364[_0xa1bc('0x10')]['code']===0x1f4){logger['error'](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0x378061(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);return _0xea5ec8(_0x2db364[_0xa1bc('0x10')][_0xa1bc('0x11')]);}else{logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x43a67,_0xa1bc('0xc'));_0xea5ec8(_0x2db364[_0xa1bc('0x12')][_0xa1bc('0x11')]);}})[_0xa1bc('0x13')](function(_0x2a0438){logger[_0xa1bc('0x10')](_0xa1bc('0xb'),_0x43a67,_0x2a0438);_0x378061(_0x2a0438);});});} \ No newline at end of file +var _0xbf6e=['VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','debug'];(function(_0x12e9c5,_0xc1b7c8){var _0x9e054e=function(_0x367f72){while(--_0x367f72){_0x12e9c5['push'](_0x12e9c5['shift']());}};_0x9e054e(++_0xc1b7c8);}(_0xbf6e,0x149));var _0xebf6=function(_0x56f9f8,_0x28498e){_0x56f9f8=_0x56f9f8-0x0;var _0x9728f3=_0xbf6e[_0x56f9f8];return _0x9728f3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xebf6('0x0'));var BPromise=require(_0xebf6('0x1'));var rs=require(_0xebf6('0x2'));var fs=require('fs');var Redis=require(_0xebf6('0x3'));var db=require(_0xebf6('0x4'))['db'];var utils=require(_0xebf6('0x5'));var logger=require(_0xebf6('0x6'))('rpc');var config=require(_0xebf6('0x7'));var jayson=require(_0xebf6('0x8'));var client=jayson[_0xebf6('0x9')][_0xebf6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x143344,_0x1e02b3,_0x137e39){return new BPromise(function(_0x548e9e,_0x1d8035){return client[_0xebf6('0xb')](_0x143344,_0x137e39)[_0xebf6('0xc')](function(_0x591132){logger[_0xebf6('0xd')](_0xebf6('0xe'),_0x1e02b3,'request\x20sent');logger[_0xebf6('0xf')](_0xebf6('0x10'),_0x1e02b3,_0xebf6('0x11'),JSON[_0xebf6('0x12')](_0x591132));if(_0x591132[_0xebf6('0x13')]){if(_0x591132[_0xebf6('0x13')]['code']===0x1f4){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error'][_0xebf6('0x14')]);return _0x1d8035(_0x591132[_0xebf6('0x13')][_0xebf6('0x14')]);}logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x591132['error']['message']);return _0x548e9e(_0x591132['error'][_0xebf6('0x14')]);}else{logger[_0xebf6('0xd')]('VoiceChanSpy,\x20%s,\x20%s',_0x1e02b3,_0xebf6('0x11'));_0x548e9e(_0x591132[_0xebf6('0x15')][_0xebf6('0x14')]);}})[_0xebf6('0x16')](function(_0x3100ee){logger[_0xebf6('0x13')](_0xebf6('0xe'),_0x1e02b3,_0x3100ee);_0x1d8035(_0x3100ee);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 78b31ba..35ef14d 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 _0x4027=['put','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceContext.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x2f9f7d,_0x3f3b8c){var _0x198d7b=function(_0x4abfa4){while(--_0x4abfa4){_0x2f9f7d['push'](_0x2f9f7d['shift']());}};_0x198d7b(++_0x3f3b8c);}(_0x4027,0xc1));var _0x7402=function(_0x3c6f1b,_0x6f0333){_0x3c6f1b=_0x3c6f1b-0x0;var _0x5b5820=_0x4027[_0x3c6f1b];return _0x5b5820;};'use strict';var multer=require(_0x7402('0x0'));var util=require(_0x7402('0x1'));var path=require('path');var timeout=require(_0x7402('0x2'));var express=require(_0x7402('0x3'));var router=express[_0x7402('0x4')]();var fs_extra=require(_0x7402('0x5'));var auth=require(_0x7402('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7402('0x7'));var controller=require(_0x7402('0x8'));router['get']('/',auth[_0x7402('0x9')](),controller[_0x7402('0xa')]);router[_0x7402('0xb')](_0x7402('0xc'),auth[_0x7402('0x9')](),controller[_0x7402('0xd')]);router[_0x7402('0xe')]('/',auth[_0x7402('0x9')](),controller[_0x7402('0xf')]);router[_0x7402('0x10')]('/:id',auth[_0x7402('0x9')](),controller['update']);router[_0x7402('0x11')](_0x7402('0xc'),auth[_0x7402('0x9')](),controller['destroy']);module[_0x7402('0x12')]=router; \ No newline at end of file +var _0xd4fc=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','index','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util'];(function(_0x49c2ed,_0x3180f6){var _0x59a41b=function(_0x404386){while(--_0x404386){_0x49c2ed['push'](_0x49c2ed['shift']());}};_0x59a41b(++_0x3180f6);}(_0xd4fc,0xd6));var _0xcd4f=function(_0x244f7d,_0x434ec3){_0x244f7d=_0x244f7d-0x0;var _0x5ada5a=_0xd4fc[_0x244f7d];return _0x5ada5a;};'use strict';var multer=require(_0xcd4f('0x0'));var util=require(_0xcd4f('0x1'));var path=require(_0xcd4f('0x2'));var timeout=require(_0xcd4f('0x3'));var express=require('express');var router=express[_0xcd4f('0x4')]();var fs_extra=require(_0xcd4f('0x5'));var auth=require(_0xcd4f('0x6'));var interaction=require(_0xcd4f('0x7'));var config=require('../../config/environment');var controller=require('./voiceContext.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xcd4f('0x8')]);router[_0xcd4f('0x9')](_0xcd4f('0xa'),auth[_0xcd4f('0xb')](),controller[_0xcd4f('0xc')]);router[_0xcd4f('0xd')]('/',auth[_0xcd4f('0xb')](),controller[_0xcd4f('0xe')]);router['put'](_0xcd4f('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xcd4f('0xf')]('/:id',auth[_0xcd4f('0xb')](),controller[_0xcd4f('0x10')]);module[_0xcd4f('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index f29dd12..ba2bd8d 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 _0x02af=['exports','STRING','name','BOOLEAN','sequelize'];(function(_0x26495a,_0x1e3123){var _0x2b2887=function(_0x5dff74){while(--_0x5dff74){_0x26495a['push'](_0x26495a['shift']());}};_0x2b2887(++_0x1e3123);}(_0x02af,0x149));var _0xf02a=function(_0x5462c8,_0x5f5d1b){_0x5462c8=_0x5462c8-0x0;var _0x1596b1=_0x02af[_0x5462c8];return _0x1596b1;};'use strict';var Sequelize=require(_0xf02a('0x0'));module[_0xf02a('0x1')]={'name':{'type':Sequelize[_0xf02a('0x2')],'unique':_0xf02a('0x3')},'description':{'type':Sequelize[_0xf02a('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xf02a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x8928=['BOOLEAN','sequelize','exports','STRING','name'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x8928,0x13c));var _0x8892=function(_0x4abd10,_0x20b935){_0x4abd10=_0x4abd10-0x0;var _0x1bfaa5=_0x8928[_0x4abd10];return _0x1bfaa5;};'use strict';var Sequelize=require(_0x8892('0x0'));module[_0x8892('0x1')]={'name':{'type':Sequelize[_0x8892('0x2')],'unique':_0x8892('0x3')},'description':{'type':Sequelize[_0x8892('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x8892('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 8b22a90..976cc72 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 _0x32ca=['info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','status','end','json','offset','undefined','count','set','Content-Range','reject','save','update','get','Contexts','destroy','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','VIRTUAL','options','where','includeAll','include','findAll','rows','show','keys','merge','find','create','body','join','server/files/templates/context.ejs','utf8','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','readFileSync','render','chan_sip.so','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','jayson/promise','client','http','request','then'];(function(_0x2aba17,_0x128a30){var _0x5a9599=function(_0x1bc43c){while(--_0x1bc43c){_0x2aba17['push'](_0x2aba17['shift']());}};_0x5a9599(++_0x128a30);}(_0x32ca,0x123));var _0xa32c=function(_0x229059,_0x324ab9){_0x229059=_0x229059-0x0;var _0x98067d=_0x32ca[_0x229059];return _0x98067d;};'use strict';var emlformat=require(_0xa32c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa32c('0x1'));var jsonpatch=require(_0xa32c('0x2'));var rp=require('request-promise');var moment=require(_0xa32c('0x3'));var BPromise=require(_0xa32c('0x4'));var Mustache=require(_0xa32c('0x5'));var util=require(_0xa32c('0x6'));var path=require(_0xa32c('0x7'));var sox=require('sox');var csv=require(_0xa32c('0x8'));var ejs=require(_0xa32c('0x9'));var fs=require('fs');var fs_extra=require(_0xa32c('0xa'));var _=require(_0xa32c('0xb'));var squel=require('squel');var crypto=require(_0xa32c('0xc'));var jsforce=require(_0xa32c('0xd'));var deskjs=require(_0xa32c('0xe'));var toCsv=require(_0xa32c('0x8'));var querystring=require(_0xa32c('0xf'));var Papa=require(_0xa32c('0x10'));var Redis=require(_0xa32c('0x11'));var authService=require(_0xa32c('0x12'));var qs=require(_0xa32c('0x13'));var as=require(_0xa32c('0x14'));var hardwareService=require(_0xa32c('0x15'));var logger=require(_0xa32c('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xa32c('0x17'));var licenseUtil=require(_0xa32c('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0xa32c('0x19'));var client=jayson[_0xa32c('0x1a')][_0xa32c('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x1ae670,_0x44c57a,_0x1dc496,_0x57068a){return new BPromise(function(_0xa329b5,_0x2d493a){var _0x34d4a8=_0x57068a||client;return _0x34d4a8[_0xa32c('0x1c')](_0x1ae670,_0x1dc496)[_0xa32c('0x1d')](function(_0x30e6eb){logger[_0xa32c('0x1e')](_0xa32c('0x1f'),_0x44c57a,_0xa32c('0x20'));logger[_0xa32c('0x21')](_0xa32c('0x22'),_0x44c57a,_0xa32c('0x20'),JSON[_0xa32c('0x23')](_0x30e6eb));if(_0x30e6eb[_0xa32c('0x24')]){if(_0x30e6eb[_0xa32c('0x24')][_0xa32c('0x25')]===0x1f4){logger[_0xa32c('0x24')](_0xa32c('0x1f'),_0x44c57a,_0x30e6eb[_0xa32c('0x24')][_0xa32c('0x26')]);return _0x2d493a(_0x30e6eb['error'][_0xa32c('0x26')]);}logger['error'](_0xa32c('0x1f'),_0x44c57a,_0x30e6eb[_0xa32c('0x24')][_0xa32c('0x26')]);return _0xa329b5(_0x30e6eb[_0xa32c('0x24')][_0xa32c('0x26')]);}else{logger[_0xa32c('0x1e')](_0xa32c('0x1f'),_0x44c57a,_0xa32c('0x20'));_0xa329b5(_0x30e6eb['result'][_0xa32c('0x26')]);}})['catch'](function(_0x409ae3){logger['error']('VoiceContext,\x20%s,\x20%s',_0x44c57a,_0x409ae3);_0x2d493a(_0x409ae3);});});}function respondWithStatusCode(_0x42a43b,_0x37b3eb){_0x37b3eb=_0x37b3eb||0xcc;return function(_0x209b01){if(_0x209b01){return _0x42a43b['sendStatus'](_0x37b3eb);}return _0x42a43b[_0xa32c('0x27')](_0x37b3eb)[_0xa32c('0x28')]();};}function respondWithResult(_0x1fa825,_0x385c64){_0x385c64=_0x385c64||0xc8;return function(_0x125d83){if(_0x125d83){return _0x1fa825[_0xa32c('0x27')](_0x385c64)[_0xa32c('0x29')](_0x125d83);}};}function respondWithFilteredResult(_0x490cb1,_0x392252){return function(_0x535b44){if(_0x535b44){var _0x3043a4=typeof _0x392252[_0xa32c('0x2a')]===_0xa32c('0x2b')&&typeof _0x392252['limit']===_0xa32c('0x2b');var _0x4786ba=_0x535b44[_0xa32c('0x2c')];var _0x29e43f=_0x3043a4?0x0:_0x392252[_0xa32c('0x2a')];var _0x520a09=_0x3043a4?_0x535b44[_0xa32c('0x2c')]:_0x392252[_0xa32c('0x2a')]+_0x392252['limit'];var _0x389bcb;if(_0x520a09>=_0x4786ba){_0x520a09=_0x4786ba;_0x389bcb=0xc8;}else{_0x389bcb=0xce;}_0x490cb1[_0xa32c('0x27')](_0x389bcb);return _0x490cb1[_0xa32c('0x2d')](_0xa32c('0x2e'),_0x29e43f+'-'+_0x520a09+'/'+_0x4786ba)[_0xa32c('0x29')](_0x535b44);}return null;};}function patchUpdates(_0x32ffa2){return function(_0xe757b9){try{jsonpatch['apply'](_0xe757b9,_0x32ffa2,!![]);}catch(_0x22d9eb){return BPromise[_0xa32c('0x2f')](_0x22d9eb);}return _0xe757b9[_0xa32c('0x30')]();};}function saveUpdates(_0x17cffd,_0x32ec04){return function(_0x30f289){if(_0x30f289){return _0x30f289[_0xa32c('0x31')](_0x17cffd)['then'](function(_0x32a12f){return _0x32a12f;});}return null;};}function removeEntity(_0x348aba,_0x3db574){return function(_0x14e918){if(_0x14e918){return _0x14e918['destroy']()['then'](function(){var _0x5aaa56=_0x14e918[_0xa32c('0x32')]({'plain':!![]});var _0x506740=_0xa32c('0x33');return db['UserProfileResource'][_0xa32c('0x34')]({'where':{'type':_0x506740,'resourceId':_0x5aaa56['id']}})[_0xa32c('0x1d')](function(){return _0x14e918;});})['then'](function(){_0x348aba[_0xa32c('0x27')](0xcc)[_0xa32c('0x28')]();});}};}function handleEntityNotFound(_0x30519d,_0x4aed5a){return function(_0xfb28d9){if(!_0xfb28d9){_0x30519d[_0xa32c('0x35')](0x194);}return _0xfb28d9;};}function handleError(_0x1f1b90,_0x4854b6){_0x4854b6=_0x4854b6||0x1f4;return function(_0x5e9507){logger[_0xa32c('0x24')](_0x5e9507[_0xa32c('0x36')]);if(_0x5e9507[_0xa32c('0x37')]){delete _0x5e9507[_0xa32c('0x37')];}_0x1f1b90[_0xa32c('0x27')](_0x4854b6)[_0xa32c('0x38')](_0x5e9507);};}exports[_0xa32c('0x39')]=function(_0x44f311,_0x9fe87d){var _0x3b4c4c={},_0x4a148c={},_0x4797e8={'count':0x0,'rows':[]};var _0x33b7ac=_[_0xa32c('0x3a')](db[_0xa32c('0x3b')][_0xa32c('0x3c')],function(_0x5d7438){return{'name':_0x5d7438[_0xa32c('0x3d')],'type':_0x5d7438[_0xa32c('0x3e')]['key']};});_0x4a148c[_0xa32c('0x3f')]=_['map'](_0x33b7ac,'name');_0x4a148c[_0xa32c('0x40')]=_['keys'](_0x44f311[_0xa32c('0x40')]);_0x4a148c[_0xa32c('0x41')]=_[_0xa32c('0x42')](_0x4a148c[_0xa32c('0x3f')],_0x4a148c[_0xa32c('0x40')]);_0x3b4c4c[_0xa32c('0x43')]=_[_0xa32c('0x42')](_0x4a148c[_0xa32c('0x3f')],qs['fields'](_0x44f311['query'][_0xa32c('0x44')]));_0x3b4c4c[_0xa32c('0x43')]=_0x3b4c4c['attributes']['length']?_0x3b4c4c[_0xa32c('0x43')]:_0x4a148c['model'];if(!_0x44f311[_0xa32c('0x40')][_0xa32c('0x45')](_0xa32c('0x46'))){_0x3b4c4c['limit']=qs['limit'](_0x44f311[_0xa32c('0x40')][_0xa32c('0x47')]);_0x3b4c4c[_0xa32c('0x2a')]=qs['offset'](_0x44f311[_0xa32c('0x40')][_0xa32c('0x2a')]);}_0x3b4c4c[_0xa32c('0x48')]=qs['sort'](_0x44f311['query'][_0xa32c('0x49')]);_0x3b4c4c['where']=qs[_0xa32c('0x41')](_[_0xa32c('0x4a')](_0x44f311[_0xa32c('0x40')],_0x4a148c['filters']),_0x33b7ac);if(_0x44f311['query'][_0xa32c('0x4b')]){_0x3b4c4c['where']=_['merge'](_0x3b4c4c['where'],{'$or':_[_0xa32c('0x3a')](_0x33b7ac,function(_0x455afe){if(_0x455afe[_0xa32c('0x3e')]!==_0xa32c('0x4c')){var _0x5ede6e={};_0x5ede6e[_0x455afe[_0xa32c('0x37')]]={'$like':'%'+_0x44f311['query'][_0xa32c('0x4b')]+'%'};return _0x5ede6e;}})});}_0x3b4c4c=_['merge']({},_0x3b4c4c,_0x44f311[_0xa32c('0x4d')]);var _0xb4fd6c={'where':_0x3b4c4c[_0xa32c('0x4e')]};return db[_0xa32c('0x3b')]['count'](_0xb4fd6c)[_0xa32c('0x1d')](function(_0x4e2a75){_0x4797e8[_0xa32c('0x2c')]=_0x4e2a75;if(_0x44f311[_0xa32c('0x40')][_0xa32c('0x4f')]){_0x3b4c4c[_0xa32c('0x50')]=[{'all':!![]}];}return db[_0xa32c('0x3b')][_0xa32c('0x51')](_0x3b4c4c);})[_0xa32c('0x1d')](function(_0x505476){_0x4797e8[_0xa32c('0x52')]=_0x505476;return _0x4797e8;})[_0xa32c('0x1d')](respondWithFilteredResult(_0x9fe87d,_0x3b4c4c))['catch'](handleError(_0x9fe87d,null));};exports[_0xa32c('0x53')]=function(_0x413e92,_0x1d2261){var _0x30f514={'raw':![],'where':{'id':_0x413e92['params']['id']}},_0x555be1={};_0x555be1[_0xa32c('0x3f')]=_[_0xa32c('0x54')](db['VoiceContext']['rawAttributes']);_0x555be1[_0xa32c('0x40')]=_[_0xa32c('0x54')](_0x413e92['query']);_0x555be1[_0xa32c('0x41')]=_['intersection'](_0x555be1[_0xa32c('0x3f')],_0x555be1[_0xa32c('0x40')]);_0x30f514['attributes']=_['intersection'](_0x555be1[_0xa32c('0x3f')],qs[_0xa32c('0x44')](_0x413e92[_0xa32c('0x40')][_0xa32c('0x44')]));_0x30f514['attributes']=_0x30f514[_0xa32c('0x43')]['length']?_0x30f514['attributes']:_0x555be1[_0xa32c('0x3f')];if(_0x413e92[_0xa32c('0x40')][_0xa32c('0x4f')]){_0x30f514['include']=[{'all':!![]}];}_0x30f514=_[_0xa32c('0x55')]({},_0x30f514,_0x413e92[_0xa32c('0x4d')]);return db['VoiceContext'][_0xa32c('0x56')](_0x30f514)[_0xa32c('0x1d')](handleEntityNotFound(_0x1d2261,null))['then'](respondWithResult(_0x1d2261,null))['catch'](handleError(_0x1d2261,null));};exports[_0xa32c('0x57')]=function(_0x146d27,_0x2d626c,_0x2bc7f3){var _0x39686d;return db['VoiceContext'][_0xa32c('0x57')](_0x146d27[_0xa32c('0x58')],{'raw':!![]})[_0xa32c('0x1d')](function(_0x75b337){_0x39686d=_0x75b337;return db[_0xa32c('0x3b')][_0xa32c('0x51')]({'raw':!![]});})['then'](function(_0x2d9d28){var _0x5f2676=fs['readFileSync'](path[_0xa32c('0x59')](config['root'],_0xa32c('0x5a')),_0xa32c('0x5b'));var _0x14e103=ejs['render'](_0x5f2676,{'contexts':_0x2d9d28||[]});fs[_0xa32c('0x5c')](_0xa32c('0x5d'),_0x14e103);})['then'](function(){return respondWithRpcPromise(_0xa32c('0x5e'),_0xa32c('0x57'),{'module':'chan_sip.so'});})[_0xa32c('0x1d')](function(){var _0x3b3ba3=_0x146d27[_0xa32c('0x5f')][_0xa32c('0x32')]({'plain':!![]});if(!_0x3b3ba3)throw new Error(_0xa32c('0x60'));if(_0x3b3ba3[_0xa32c('0x61')]===_0xa32c('0x5f')){var _0x1917c0=_0x39686d[_0xa32c('0x32')]({'plain':!![]});return db[_0xa32c('0x62')][_0xa32c('0x56')]({'where':{'name':'Contexts','userProfileId':_0x3b3ba3['userProfileId']},'raw':!![]})[_0xa32c('0x1d')](function(_0x51859a){if(_0x51859a&&_0x51859a[_0xa32c('0x63')]===0x0){return db[_0xa32c('0x64')]['create']({'name':_0x1917c0[_0xa32c('0x37')],'resourceId':_0x1917c0['id'],'type':_0x51859a[_0xa32c('0x37')],'sectionId':_0x51859a['id']},{})[_0xa32c('0x1d')](function(){return _0x39686d;});}else{return _0x39686d;}})[_0xa32c('0x65')](function(_0x59f350){logger[_0xa32c('0x24')](_0xa32c('0x66'),_0x59f350);throw _0x59f350;});}return _0x39686d;})[_0xa32c('0x1d')](respondWithResult(_0x2d626c,0xc9))[_0xa32c('0x65')](handleError(_0x2d626c,null));};exports['update']=function(_0x29db1f,_0x4ed00b,_0x501f4f){var _0x48d406;return db[_0xa32c('0x3b')][_0xa32c('0x56')]({'where':{'id':_0x29db1f[_0xa32c('0x67')]['id']}})[_0xa32c('0x1d')](handleEntityNotFound(_0x4ed00b,null))['then'](saveUpdates(_0x29db1f[_0xa32c('0x58')],null))[_0xa32c('0x1d')](function(_0x181a19){if(_0x181a19){_0x48d406=_0x181a19;return db[_0xa32c('0x3b')][_0xa32c('0x51')]({'raw':!![]});}})[_0xa32c('0x1d')](function(_0x41e243){var _0x148703=fs[_0xa32c('0x68')](path['join'](config['root'],'server/files/templates/context.ejs'),_0xa32c('0x5b'));var _0x53af59=ejs[_0xa32c('0x69')](_0x148703,{'contexts':_0x41e243||[]});fs[_0xa32c('0x5c')](_0xa32c('0x5d'),_0x53af59);})[_0xa32c('0x1d')](function(){return respondWithRpcPromise(_0xa32c('0x5e'),'update',{'module':'chan_sip.so'});})[_0xa32c('0x1d')](function(){return _0x48d406;})[_0xa32c('0x1d')](respondWithResult(_0x4ed00b,null))[_0xa32c('0x65')](handleError(_0x4ed00b,null));};exports[_0xa32c('0x34')]=function(_0x2fe95c,_0x3f5129,_0x1d0a05){var _0x2ad9bc;return db[_0xa32c('0x3b')][_0xa32c('0x56')]({'where':{'id':_0x2fe95c[_0xa32c('0x67')]['id']}})[_0xa32c('0x1d')](handleEntityNotFound(_0x3f5129,null))[_0xa32c('0x1d')](removeEntity(_0x3f5129,null))[_0xa32c('0x1d')](function(){return db['VoiceContext'][_0xa32c('0x51')]({'raw':!![]});})[_0xa32c('0x1d')](function(_0x102ba2){var _0x4309f2=fs['readFileSync'](path['join'](config['root'],_0xa32c('0x5a')),_0xa32c('0x5b'));var _0x5a7442=ejs[_0xa32c('0x69')](_0x4309f2,{'contexts':_0x102ba2});fs[_0xa32c('0x5c')](_0xa32c('0x5d'),_0x5a7442);return respondWithRpcPromise(_0xa32c('0x5e'),'destroy',{'module':_0xa32c('0x6a')});})['catch'](handleError(_0x3f5129,null));}; \ No newline at end of file +var _0xe41e=['Contexts','UserProfileResource','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','params','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','role','UserProfileSection','find','userProfileId','autoAssociation','update','eml-format','rimraf','zip-dir','request-promise','moment','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','json','limit','undefined','count','offset','status','set','Content-Range','apply','reject','save','destroy','get'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xe41e,0x9d));var _0xee41=function(_0x153dc8,_0x5c09bb){_0x153dc8=_0x153dc8-0x0;var _0x424586=_0xe41e[_0x153dc8];return _0x424586;};'use strict';var emlformat=require(_0xee41('0x0'));var rimraf=require(_0xee41('0x1'));var zipdir=require(_0xee41('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xee41('0x3'));var moment=require(_0xee41('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xee41('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xee41('0x6'));var fs=require('fs');var fs_extra=require(_0xee41('0x7'));var _=require(_0xee41('0x8'));var squel=require(_0xee41('0x9'));var crypto=require(_0xee41('0xa'));var jsforce=require(_0xee41('0xb'));var deskjs=require(_0xee41('0xc'));var toCsv=require(_0xee41('0xd'));var querystring=require(_0xee41('0xe'));var Papa=require(_0xee41('0xf'));var Redis=require(_0xee41('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xee41('0x11'));var as=require(_0xee41('0x12'));var hardwareService=require(_0xee41('0x13'));var logger=require(_0xee41('0x14'))(_0xee41('0x15'));var utils=require(_0xee41('0x16'));var config=require(_0xee41('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var jayson=require(_0xee41('0x18'));var client=jayson['client'][_0xee41('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x5f2880,_0x28e835,_0x91d42f,_0x4800d0){return new BPromise(function(_0x3e67dd,_0x5f50c0){var _0x2a2a63=_0x4800d0||client;return _0x2a2a63[_0xee41('0x1a')](_0x5f2880,_0x91d42f)[_0xee41('0x1b')](function(_0x126d1e){logger[_0xee41('0x1c')](_0xee41('0x1d'),_0x28e835,_0xee41('0x1e'));logger[_0xee41('0x1f')](_0xee41('0x20'),_0x28e835,_0xee41('0x1e'),JSON[_0xee41('0x21')](_0x126d1e));if(_0x126d1e[_0xee41('0x22')]){if(_0x126d1e['error']['code']===0x1f4){logger[_0xee41('0x22')](_0xee41('0x1d'),_0x28e835,_0x126d1e[_0xee41('0x22')][_0xee41('0x23')]);return _0x5f50c0(_0x126d1e[_0xee41('0x22')][_0xee41('0x23')]);}logger[_0xee41('0x22')](_0xee41('0x1d'),_0x28e835,_0x126d1e[_0xee41('0x22')]['message']);return _0x3e67dd(_0x126d1e[_0xee41('0x22')][_0xee41('0x23')]);}else{logger[_0xee41('0x1c')]('VoiceContext,\x20%s,\x20%s',_0x28e835,_0xee41('0x1e'));_0x3e67dd(_0x126d1e[_0xee41('0x24')][_0xee41('0x23')]);}})['catch'](function(_0x2826ec){logger[_0xee41('0x22')]('VoiceContext,\x20%s,\x20%s',_0x28e835,_0x2826ec);_0x5f50c0(_0x2826ec);});});}function respondWithStatusCode(_0x273b2b,_0x4eb2cc){_0x4eb2cc=_0x4eb2cc||0xcc;return function(_0x1606f7){if(_0x1606f7){return _0x273b2b[_0xee41('0x25')](_0x4eb2cc);}return _0x273b2b['status'](_0x4eb2cc)['end']();};}function respondWithResult(_0x4bf281,_0x251bb6){_0x251bb6=_0x251bb6||0xc8;return function(_0x7c2fbe){if(_0x7c2fbe){return _0x4bf281['status'](_0x251bb6)[_0xee41('0x26')](_0x7c2fbe);}};}function respondWithFilteredResult(_0x54d912,_0x424f80){return function(_0x42e3d3){if(_0x42e3d3){var _0x597e48=typeof _0x424f80['offset']==='undefined'&&typeof _0x424f80[_0xee41('0x27')]===_0xee41('0x28');var _0x5dbc50=_0x42e3d3[_0xee41('0x29')];var _0x2b7891=_0x597e48?0x0:_0x424f80[_0xee41('0x2a')];var _0x132c28=_0x597e48?_0x42e3d3[_0xee41('0x29')]:_0x424f80[_0xee41('0x2a')]+_0x424f80[_0xee41('0x27')];var _0x16d5d6;if(_0x132c28>=_0x5dbc50){_0x132c28=_0x5dbc50;_0x16d5d6=0xc8;}else{_0x16d5d6=0xce;}_0x54d912[_0xee41('0x2b')](_0x16d5d6);return _0x54d912[_0xee41('0x2c')](_0xee41('0x2d'),_0x2b7891+'-'+_0x132c28+'/'+_0x5dbc50)[_0xee41('0x26')](_0x42e3d3);}return null;};}function patchUpdates(_0x35d069){return function(_0x1a520e){try{jsonpatch[_0xee41('0x2e')](_0x1a520e,_0x35d069,!![]);}catch(_0x2f22d6){return BPromise[_0xee41('0x2f')](_0x2f22d6);}return _0x1a520e[_0xee41('0x30')]();};}function saveUpdates(_0x3498cf,_0xdc434){return function(_0x3d1096){if(_0x3d1096){return _0x3d1096['update'](_0x3498cf)[_0xee41('0x1b')](function(_0xd050f3){return _0xd050f3;});}return null;};}function removeEntity(_0x4feaa8,_0x797271){return function(_0x55a38c){if(_0x55a38c){return _0x55a38c[_0xee41('0x31')]()[_0xee41('0x1b')](function(){var _0x4716ad=_0x55a38c[_0xee41('0x32')]({'plain':!![]});var _0x4e95b8=_0xee41('0x33');return db[_0xee41('0x34')]['destroy']({'where':{'type':_0x4e95b8,'resourceId':_0x4716ad['id']}})[_0xee41('0x1b')](function(){return _0x55a38c;});})[_0xee41('0x1b')](function(){_0x4feaa8['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ab35e,_0x139fe5){return function(_0x17b80a){if(!_0x17b80a){_0x5ab35e[_0xee41('0x25')](0x194);}return _0x17b80a;};}function handleError(_0x843535,_0x19e5e7){_0x19e5e7=_0x19e5e7||0x1f4;return function(_0x205608){logger[_0xee41('0x22')](_0x205608[_0xee41('0x35')]);if(_0x205608[_0xee41('0x36')]){delete _0x205608[_0xee41('0x36')];}_0x843535[_0xee41('0x2b')](_0x19e5e7)[_0xee41('0x37')](_0x205608);};}exports[_0xee41('0x38')]=function(_0x399ca5,_0x547b57){var _0x47afbb={},_0x48ec4a={},_0x2233bf={'count':0x0,'rows':[]};var _0x565ab4=_[_0xee41('0x39')](db[_0xee41('0x3a')][_0xee41('0x3b')],function(_0x34bd7a){return{'name':_0x34bd7a[_0xee41('0x3c')],'type':_0x34bd7a[_0xee41('0x3d')]['key']};});_0x48ec4a['model']=_[_0xee41('0x39')](_0x565ab4,'name');_0x48ec4a[_0xee41('0x3e')]=_[_0xee41('0x3f')](_0x399ca5['query']);_0x48ec4a[_0xee41('0x40')]=_[_0xee41('0x41')](_0x48ec4a[_0xee41('0x42')],_0x48ec4a[_0xee41('0x3e')]);_0x47afbb[_0xee41('0x43')]=_['intersection'](_0x48ec4a[_0xee41('0x42')],qs[_0xee41('0x44')](_0x399ca5[_0xee41('0x3e')][_0xee41('0x44')]));_0x47afbb[_0xee41('0x43')]=_0x47afbb['attributes'][_0xee41('0x45')]?_0x47afbb[_0xee41('0x43')]:_0x48ec4a[_0xee41('0x42')];if(!_0x399ca5[_0xee41('0x3e')][_0xee41('0x46')](_0xee41('0x47'))){_0x47afbb[_0xee41('0x27')]=qs[_0xee41('0x27')](_0x399ca5[_0xee41('0x3e')]['limit']);_0x47afbb[_0xee41('0x2a')]=qs[_0xee41('0x2a')](_0x399ca5['query'][_0xee41('0x2a')]);}_0x47afbb[_0xee41('0x48')]=qs['sort'](_0x399ca5[_0xee41('0x3e')][_0xee41('0x49')]);_0x47afbb[_0xee41('0x4a')]=qs[_0xee41('0x40')](_['pick'](_0x399ca5[_0xee41('0x3e')],_0x48ec4a[_0xee41('0x40')]),_0x565ab4);if(_0x399ca5['query']['filter']){_0x47afbb['where']=_[_0xee41('0x4b')](_0x47afbb[_0xee41('0x4a')],{'$or':_[_0xee41('0x39')](_0x565ab4,function(_0x2cbe7f){if(_0x2cbe7f[_0xee41('0x3d')]!==_0xee41('0x4c')){var _0xa93aee={};_0xa93aee[_0x2cbe7f['name']]={'$like':'%'+_0x399ca5['query'][_0xee41('0x4d')]+'%'};return _0xa93aee;}})});}_0x47afbb=_[_0xee41('0x4b')]({},_0x47afbb,_0x399ca5[_0xee41('0x4e')]);var _0x1af3e4={'where':_0x47afbb[_0xee41('0x4a')]};return db[_0xee41('0x3a')][_0xee41('0x29')](_0x1af3e4)[_0xee41('0x1b')](function(_0x5c73c6){_0x2233bf[_0xee41('0x29')]=_0x5c73c6;if(_0x399ca5['query']['includeAll']){_0x47afbb[_0xee41('0x4f')]=[{'all':!![]}];}return db[_0xee41('0x3a')][_0xee41('0x50')](_0x47afbb);})[_0xee41('0x1b')](function(_0x10901a){_0x2233bf[_0xee41('0x51')]=_0x10901a;return _0x2233bf;})[_0xee41('0x1b')](respondWithFilteredResult(_0x547b57,_0x47afbb))[_0xee41('0x52')](handleError(_0x547b57,null));};exports[_0xee41('0x53')]=function(_0x51bbaf,_0x48dd56){var _0x1eac9c={'raw':![],'where':{'id':_0x51bbaf[_0xee41('0x54')]['id']}},_0x819fae={};_0x819fae[_0xee41('0x42')]=_[_0xee41('0x3f')](db[_0xee41('0x3a')][_0xee41('0x3b')]);_0x819fae[_0xee41('0x3e')]=_[_0xee41('0x3f')](_0x51bbaf['query']);_0x819fae[_0xee41('0x40')]=_['intersection'](_0x819fae[_0xee41('0x42')],_0x819fae['query']);_0x1eac9c['attributes']=_[_0xee41('0x41')](_0x819fae['model'],qs[_0xee41('0x44')](_0x51bbaf[_0xee41('0x3e')][_0xee41('0x44')]));_0x1eac9c[_0xee41('0x43')]=_0x1eac9c[_0xee41('0x43')][_0xee41('0x45')]?_0x1eac9c[_0xee41('0x43')]:_0x819fae['model'];if(_0x51bbaf['query']['includeAll']){_0x1eac9c[_0xee41('0x4f')]=[{'all':!![]}];}_0x1eac9c=_['merge']({},_0x1eac9c,_0x51bbaf['options']);return db[_0xee41('0x3a')]['find'](_0x1eac9c)[_0xee41('0x1b')](handleEntityNotFound(_0x48dd56,null))[_0xee41('0x1b')](respondWithResult(_0x48dd56,null))['catch'](handleError(_0x48dd56,null));};exports[_0xee41('0x55')]=function(_0x20471c,_0x27c75c,_0x3b8940){var _0x5f5951;return db['VoiceContext'][_0xee41('0x55')](_0x20471c[_0xee41('0x56')],{'raw':!![]})['then'](function(_0x54aab9){_0x5f5951=_0x54aab9;return db[_0xee41('0x3a')]['findAll']({'raw':!![]});})['then'](function(_0x143f2f){var _0x14b23b=fs[_0xee41('0x57')](path[_0xee41('0x58')](config[_0xee41('0x59')],_0xee41('0x5a')),_0xee41('0x5b'));var _0x10eaa4=ejs[_0xee41('0x5c')](_0x14b23b,{'contexts':_0x143f2f||[]});fs[_0xee41('0x5d')](_0xee41('0x5e'),_0x10eaa4);})[_0xee41('0x1b')](function(){return respondWithRpcPromise(_0xee41('0x5f'),_0xee41('0x55'),{'module':_0xee41('0x60')});})['then'](function(){var _0x2a31b7=_0x20471c[_0xee41('0x61')][_0xee41('0x32')]({'plain':!![]});if(!_0x2a31b7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2a31b7[_0xee41('0x62')]==='user'){var _0x430313=_0x5f5951[_0xee41('0x32')]({'plain':!![]});return db[_0xee41('0x63')][_0xee41('0x64')]({'where':{'name':_0xee41('0x33'),'userProfileId':_0x2a31b7[_0xee41('0x65')]},'raw':!![]})[_0xee41('0x1b')](function(_0x5cd0e5){if(_0x5cd0e5&&_0x5cd0e5[_0xee41('0x66')]===0x0){return db['UserProfileResource'][_0xee41('0x55')]({'name':_0x430313[_0xee41('0x36')],'resourceId':_0x430313['id'],'type':_0x5cd0e5['name'],'sectionId':_0x5cd0e5['id']},{})[_0xee41('0x1b')](function(){return _0x5f5951;});}else{return _0x5f5951;}})[_0xee41('0x52')](function(_0x51cb05){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x51cb05);throw _0x51cb05;});}return _0x5f5951;})[_0xee41('0x1b')](respondWithResult(_0x27c75c,0xc9))[_0xee41('0x52')](handleError(_0x27c75c,null));};exports[_0xee41('0x67')]=function(_0x29a89f,_0x5beb1b,_0x29a10d){var _0x55f622;return db[_0xee41('0x3a')]['find']({'where':{'id':_0x29a89f['params']['id']}})['then'](handleEntityNotFound(_0x5beb1b,null))[_0xee41('0x1b')](saveUpdates(_0x29a89f['body'],null))[_0xee41('0x1b')](function(_0x14a427){if(_0x14a427){_0x55f622=_0x14a427;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0xee41('0x1b')](function(_0x22f04b){var _0xbce9d9=fs['readFileSync'](path[_0xee41('0x58')](config[_0xee41('0x59')],_0xee41('0x5a')),_0xee41('0x5b'));var _0x342712=ejs['render'](_0xbce9d9,{'contexts':_0x22f04b||[]});fs[_0xee41('0x5d')](_0xee41('0x5e'),_0x342712);})[_0xee41('0x1b')](function(){return respondWithRpcPromise(_0xee41('0x5f'),'update',{'module':_0xee41('0x60')});})[_0xee41('0x1b')](function(){return _0x55f622;})[_0xee41('0x1b')](respondWithResult(_0x5beb1b,null))[_0xee41('0x52')](handleError(_0x5beb1b,null));};exports[_0xee41('0x31')]=function(_0x583f90,_0x583139,_0x38e160){var _0x2b6e30;return db['VoiceContext'][_0xee41('0x64')]({'where':{'id':_0x583f90[_0xee41('0x54')]['id']}})['then'](handleEntityNotFound(_0x583139,null))[_0xee41('0x1b')](removeEntity(_0x583139,null))[_0xee41('0x1b')](function(){return db['VoiceContext'][_0xee41('0x50')]({'raw':!![]});})['then'](function(_0xf7a33e){var _0xded62f=fs[_0xee41('0x57')](path['join'](config[_0xee41('0x59')],'server/files/templates/context.ejs'),_0xee41('0x5b'));var _0x10edc6=ejs[_0xee41('0x5c')](_0xded62f,{'contexts':_0xf7a33e});fs[_0xee41('0x5d')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x10edc6);return respondWithRpcPromise(_0xee41('0x5f'),_0xee41('0x31'),{'module':_0xee41('0x60')});})[_0xee41('0x52')](handleError(_0x583139,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 509743e..e4389bb 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 _0xcb1f=['voice_contexts','lodash','util','../../config/logger','api','bluebird','./voiceContext.attributes','define','VoiceContext'];(function(_0x2f08c6,_0x12f77c){var _0x281c96=function(_0xc24f1){while(--_0xc24f1){_0x2f08c6['push'](_0x2f08c6['shift']());}};_0x281c96(++_0x12f77c);}(_0xcb1f,0x121));var _0xfcb1=function(_0x103a68,_0x414752){_0x103a68=_0x103a68-0x0;var _0xfee4d1=_0xcb1f[_0x103a68];return _0xfee4d1;};'use strict';var _=require(_0xfcb1('0x0'));var util=require(_0xfcb1('0x1'));var logger=require(_0xfcb1('0x2'))(_0xfcb1('0x3'));var moment=require('moment');var BPromise=require(_0xfcb1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfcb1('0x5'));module['exports']=function(_0x15f5c5,_0x37e8fe){return _0x15f5c5[_0xfcb1('0x6')](_0xfcb1('0x7'),attributes,{'tableName':_0xfcb1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0817=['voice_contexts','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','exports','define'];(function(_0x2e0417,_0x4a365a){var _0x39ea9=function(_0x451a30){while(--_0x451a30){_0x2e0417['push'](_0x2e0417['shift']());}};_0x39ea9(++_0x4a365a);}(_0x0817,0x90));var _0x7081=function(_0x31cc0d,_0x1c448d){_0x31cc0d=_0x31cc0d-0x0;var _0x1d3aa1=_0x0817[_0x31cc0d];return _0x1d3aa1;};'use strict';var _=require(_0x7081('0x0'));var util=require('util');var logger=require(_0x7081('0x1'))(_0x7081('0x2'));var moment=require(_0x7081('0x3'));var BPromise=require(_0x7081('0x4'));var rp=require(_0x7081('0x5'));var fs=require('fs');var path=require(_0x7081('0x6'));var rimraf=require(_0x7081('0x7'));var config=require(_0x7081('0x8'));var attributes=require(_0x7081('0x9'));module[_0x7081('0xa')]=function(_0x515991,_0xa40ff5){return _0x515991[_0x7081('0xb')]('VoiceContext',attributes,{'tableName':_0x7081('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 2ea44f8..b62ea91 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 _0x9822=['../../config/environment','client','http','request','then','VoiceContext,\x20%s,\x20%s','debug','VoiceContext,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x9822,0x93));var _0x2982=function(_0x2c601f,_0x264610){_0x2c601f=_0x2c601f-0x0;var _0x4b4899=_0x9822[_0x2c601f];return _0x4b4899;};'use strict';var _=require(_0x2982('0x0'));var util=require(_0x2982('0x1'));var moment=require(_0x2982('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2982('0x3'))['db'];var utils=require(_0x2982('0x4'));var logger=require(_0x2982('0x5'))(_0x2982('0x6'));var config=require(_0x2982('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2982('0x8')][_0x2982('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x518e7c,_0xd348b9,_0x17ce53){return new BPromise(function(_0x587245,_0x17653e){return client[_0x2982('0xa')](_0x518e7c,_0x17ce53)[_0x2982('0xb')](function(_0x260d90){logger['info'](_0x2982('0xc'),_0xd348b9,'request\x20sent');logger[_0x2982('0xd')](_0x2982('0xe'),_0xd348b9,_0x2982('0xf'),JSON[_0x2982('0x10')](_0x260d90));if(_0x260d90['error']){if(_0x260d90[_0x2982('0x11')][_0x2982('0x12')]===0x1f4){logger[_0x2982('0x11')](_0x2982('0xc'),_0xd348b9,_0x260d90[_0x2982('0x11')][_0x2982('0x13')]);return _0x17653e(_0x260d90['error'][_0x2982('0x13')]);}logger[_0x2982('0x11')](_0x2982('0xc'),_0xd348b9,_0x260d90[_0x2982('0x11')][_0x2982('0x13')]);return _0x587245(_0x260d90[_0x2982('0x11')][_0x2982('0x13')]);}else{logger['info'](_0x2982('0xc'),_0xd348b9,'request\x20sent');_0x587245(_0x260d90[_0x2982('0x14')][_0x2982('0x13')]);}})[_0x2982('0x15')](function(_0x55d55d){logger[_0x2982('0x11')](_0x2982('0xc'),_0xd348b9,_0x55d55d);_0x17653e(_0x55d55d);});});} \ No newline at end of file +var _0x3609=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0xbc5319,_0x7dac14){var _0x238601=function(_0x2806d6){while(--_0x2806d6){_0xbc5319['push'](_0xbc5319['shift']());}};_0x238601(++_0x7dac14);}(_0x3609,0x101));var _0x9360=function(_0x20955a,_0x1593dd){_0x20955a=_0x20955a-0x0;var _0xb32ddd=_0x3609[_0x20955a];return _0xb32ddd;};'use strict';var _=require(_0x9360('0x0'));var util=require(_0x9360('0x1'));var moment=require(_0x9360('0x2'));var BPromise=require(_0x9360('0x3'));var rs=require(_0x9360('0x4'));var fs=require('fs');var Redis=require(_0x9360('0x5'));var db=require(_0x9360('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x9360('0x7'))(_0x9360('0x8'));var config=require(_0x9360('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11fe15,_0xf4e840,_0x50e967){return new BPromise(function(_0x2a67be,_0x3a08e5){return client[_0x9360('0xa')](_0x11fe15,_0x50e967)[_0x9360('0xb')](function(_0x2d951e){logger[_0x9360('0xc')](_0x9360('0xd'),_0xf4e840,_0x9360('0xe'));logger['debug']('VoiceContext,\x20%s,\x20%s,\x20%s',_0xf4e840,_0x9360('0xe'),JSON[_0x9360('0xf')](_0x2d951e));if(_0x2d951e[_0x9360('0x10')]){if(_0x2d951e['error'][_0x9360('0x11')]===0x1f4){logger[_0x9360('0x10')](_0x9360('0xd'),_0xf4e840,_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);return _0x3a08e5(_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0xf4e840,_0x2d951e[_0x9360('0x10')]['message']);return _0x2a67be(_0x2d951e[_0x9360('0x10')][_0x9360('0x12')]);}else{logger[_0x9360('0xc')](_0x9360('0xd'),_0xf4e840,'request\x20sent');_0x2a67be(_0x2d951e[_0x9360('0x13')][_0x9360('0x12')]);}})[_0x9360('0x14')](function(_0x1e0316){logger[_0x9360('0x10')](_0x9360('0xd'),_0xf4e840,_0x1e0316);_0x3a08e5(_0x1e0316);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f9eec69..b228f84 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 _0x7d98=['/:id','show','create','put','update','multer','path','connect-timeout','express','fs-extra','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x24d560,_0x2e0e7b){var _0x18f7b3=function(_0x564a93){while(--_0x564a93){_0x24d560['push'](_0x24d560['shift']());}};_0x18f7b3(++_0x2e0e7b);}(_0x7d98,0x75));var _0x87d9=function(_0x4179e2,_0xf2dbb){_0x4179e2=_0x4179e2-0x0;var _0x24cb50=_0x7d98[_0x4179e2];return _0x24cb50;};'use strict';var multer=require(_0x87d9('0x0'));var util=require('util');var path=require(_0x87d9('0x1'));var timeout=require(_0x87d9('0x2'));var express=require(_0x87d9('0x3'));var router=express['Router']();var fs_extra=require(_0x87d9('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x87d9('0x5'));router[_0x87d9('0x6')]('/',auth[_0x87d9('0x7')](),controller[_0x87d9('0x8')]);router['get'](_0x87d9('0x9'),auth['isAuthenticated'](),controller[_0x87d9('0xa')]);router[_0x87d9('0x6')](_0x87d9('0xb'),auth[_0x87d9('0x7')](),controller[_0x87d9('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x87d9('0xd')]);router[_0x87d9('0xe')]('/:id',auth[_0x87d9('0x7')](),controller[_0x87d9('0xf')]);router['delete']('/:id',auth[_0x87d9('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2392=['describe','/:id','show','post','put','update','delete','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe'];(function(_0x3338eb,_0x39cb36){var _0x414304=function(_0x54c941){while(--_0x54c941){_0x3338eb['push'](_0x3338eb['shift']());}};_0x414304(++_0x39cb36);}(_0x2392,0xd0));var _0x2239=function(_0x19e76b,_0x2331a7){_0x19e76b=_0x19e76b-0x0;var _0x375494=_0x2392[_0x19e76b];return _0x375494;};'use strict';var multer=require(_0x2239('0x0'));var util=require(_0x2239('0x1'));var path=require('path');var timeout=require(_0x2239('0x2'));var express=require(_0x2239('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2239('0x4'));var interaction=require(_0x2239('0x5'));var config=require(_0x2239('0x6'));var controller=require(_0x2239('0x7'));router[_0x2239('0x8')]('/',auth[_0x2239('0x9')](),controller[_0x2239('0xa')]);router[_0x2239('0x8')](_0x2239('0xb'),auth[_0x2239('0x9')](),controller[_0x2239('0xc')]);router[_0x2239('0x8')](_0x2239('0xd'),auth['isAuthenticated'](),controller[_0x2239('0xe')]);router[_0x2239('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2239('0x10')](_0x2239('0xd'),auth[_0x2239('0x9')](),controller[_0x2239('0x11')]);router[_0x2239('0x12')](_0x2239('0xd'),auth[_0x2239('0x9')](),controller['destroy']);module[_0x2239('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index cc195f8..581cbd9 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 _0xe14d=['DATE','called,connect,complete','sequelize','exports','STRING','INTEGER'];(function(_0xc9cd47,_0x35a546){var _0x26827e=function(_0x32d967){while(--_0x32d967){_0xc9cd47['push'](_0xc9cd47['shift']());}};_0x26827e(++_0x35a546);}(_0xe14d,0x1ee));var _0xde14=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xe14d[_0x363ef8];return _0x148822;};'use strict';var Sequelize=require(_0xde14('0x0'));module[_0xde14('0x1')]={'privilege':{'type':Sequelize[_0xde14('0x2')]},'channel':{'type':Sequelize[_0xde14('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'calleridnum':{'type':Sequelize[_0xde14('0x2')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'connectedlinename':{'type':Sequelize[_0xde14('0x2')]},'language':{'type':Sequelize[_0xde14('0x2')]},'accountcode':{'type':Sequelize[_0xde14('0x2')]},'context':{'type':Sequelize[_0xde14('0x2')]},'exten':{'type':Sequelize[_0xde14('0x2')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xde14('0x2')]},'destchannel':{'type':Sequelize[_0xde14('0x2')]},'destchannelstate':{'type':Sequelize[_0xde14('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0xde14('0x2')]},'destcalleridnum':{'type':Sequelize[_0xde14('0x2')]},'destcalleridname':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xde14('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xde14('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xde14('0x2')]},'destcontext':{'type':Sequelize[_0xde14('0x2')]},'destexten':{'type':Sequelize[_0xde14('0x2')]},'destpriority':{'type':Sequelize[_0xde14('0x3')]},'destuniqueid':{'type':Sequelize[_0xde14('0x2')]},'destlinkedid':{'type':Sequelize[_0xde14('0x2')]},'dialstring':{'type':Sequelize[_0xde14('0x2')]},'dialstatus':{'type':Sequelize[_0xde14('0x2')]},'starttime':{'type':Sequelize[_0xde14('0x4')]},'answertime':{'type':Sequelize[_0xde14('0x4')]},'endtime':{'type':Sequelize[_0xde14('0x4')]},'lastevent':{'type':Sequelize[_0xde14('0x2')],'comment':_0xde14('0x5')},'routeId':{'type':Sequelize[_0xde14('0x3')]},'duration':{'type':Sequelize[_0xde14('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9c44=['STRING','INTEGER','DATE','called,connect,complete'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var Sequelize=require('sequelize');module['exports']={'privilege':{'type':Sequelize[_0x49c4('0x0')]},'channel':{'type':Sequelize[_0x49c4('0x0')]},'channelstate':{'type':Sequelize[_0x49c4('0x1')]},'channelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'calleridnum':{'type':Sequelize[_0x49c4('0x0')]},'calleridname':{'type':Sequelize[_0x49c4('0x0')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x49c4('0x0')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x49c4('0x0')]},'exten':{'type':Sequelize[_0x49c4('0x0')]},'priority':{'type':Sequelize[_0x49c4('0x1')]},'uniqueid':{'type':Sequelize[_0x49c4('0x0')]},'linkedid':{'type':Sequelize[_0x49c4('0x0')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x49c4('0x1')]},'destchannelstatedesc':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridnum':{'type':Sequelize[_0x49c4('0x0')]},'destcalleridname':{'type':Sequelize[_0x49c4('0x0')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x49c4('0x0')]},'destaccountcode':{'type':Sequelize[_0x49c4('0x0')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x49c4('0x0')]},'destpriority':{'type':Sequelize[_0x49c4('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0x49c4('0x0')]},'dialstatus':{'type':Sequelize[_0x49c4('0x0')]},'starttime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x49c4('0x2')]},'endtime':{'type':Sequelize[_0x49c4('0x2')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x49c4('0x3')},'routeId':{'type':Sequelize[_0x49c4('0x1')]},'duration':{'type':Sequelize[_0x49c4('0x1')]},'holdtime':{'type':Sequelize[_0x49c4('0x1')]},'billableseconds':{'type':Sequelize[_0x49c4('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 582b9bd..0b05908 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 _0x28df=['sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','save','update','then','stack','name','index','map','fieldName','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceDialReport','includeAll','include','rows','catch','params','rawAttributes','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x3174a5,_0x1477a9){var _0x3c2382=function(_0x44c67d){while(--_0x44c67d){_0x3174a5['push'](_0x3174a5['shift']());}};_0x3c2382(++_0x1477a9);}(_0x28df,0x1ec));var _0xf28d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x28df[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0xf28d('0x0'));var rimraf=require(_0xf28d('0x1'));var zipdir=require(_0xf28d('0x2'));var jsonpatch=require(_0xf28d('0x3'));var rp=require(_0xf28d('0x4'));var moment=require(_0xf28d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf28d('0x6'));var util=require(_0xf28d('0x7'));var path=require(_0xf28d('0x8'));var sox=require(_0xf28d('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf28d('0xa'));var _=require(_0xf28d('0xb'));var squel=require(_0xf28d('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf28d('0xd'));var toCsv=require(_0xf28d('0xe'));var querystring=require(_0xf28d('0xf'));var Papa=require('papaparse');var Redis=require(_0xf28d('0x10'));var authService=require(_0xf28d('0x11'));var qs=require(_0xf28d('0x12'));var as=require(_0xf28d('0x13'));var hardwareService=require(_0xf28d('0x14'));var logger=require('../../config/logger')(_0xf28d('0x15'));var utils=require(_0xf28d('0x16'));var config=require(_0xf28d('0x17'));var licenseUtil=require(_0xf28d('0x18'));var db=require(_0xf28d('0x19'))['db'];function respondWithStatusCode(_0x4cae33,_0x10a009){_0x10a009=_0x10a009||0xcc;return function(_0x420abe){if(_0x420abe){return _0x4cae33[_0xf28d('0x1a')](_0x10a009);}return _0x4cae33[_0xf28d('0x1b')](_0x10a009)[_0xf28d('0x1c')]();};}function respondWithResult(_0x228615,_0x212a16){_0x212a16=_0x212a16||0xc8;return function(_0x1995d5){if(_0x1995d5){return _0x228615[_0xf28d('0x1b')](_0x212a16)[_0xf28d('0x1d')](_0x1995d5);}};}function respondWithFilteredResult(_0x2a352f,_0x585df3){return function(_0x59e269){if(_0x59e269){var _0x2a7ef7=typeof _0x585df3[_0xf28d('0x1e')]==='undefined'&&typeof _0x585df3['limit']===_0xf28d('0x1f');var _0x3422b1=_0x59e269[_0xf28d('0x20')];var _0x2a92bc=_0x2a7ef7?0x0:_0x585df3[_0xf28d('0x1e')];var _0x1e720f=_0x2a7ef7?_0x59e269[_0xf28d('0x20')]:_0x585df3['offset']+_0x585df3[_0xf28d('0x21')];var _0xa6ef85;if(_0x1e720f>=_0x3422b1){_0x1e720f=_0x3422b1;_0xa6ef85=0xc8;}else{_0xa6ef85=0xce;}_0x2a352f[_0xf28d('0x1b')](_0xa6ef85);return _0x2a352f['set'](_0xf28d('0x22'),_0x2a92bc+'-'+_0x1e720f+'/'+_0x3422b1)[_0xf28d('0x1d')](_0x59e269);}return null;};}function patchUpdates(_0x3fe2a7){return function(_0x5db0c0){try{jsonpatch['apply'](_0x5db0c0,_0x3fe2a7,!![]);}catch(_0x4aabb7){return BPromise[_0xf28d('0x23')](_0x4aabb7);}return _0x5db0c0[_0xf28d('0x24')]();};}function saveUpdates(_0x156856,_0x145370){return function(_0x54d385){if(_0x54d385){return _0x54d385[_0xf28d('0x25')](_0x156856)[_0xf28d('0x26')](function(_0x5007df){return _0x5007df;});}return null;};}function removeEntity(_0x537bb6,_0x3ce105){return function(_0xd065f1){if(_0xd065f1){return _0xd065f1['destroy']()[_0xf28d('0x26')](function(){_0x537bb6['status'](0xcc)[_0xf28d('0x1c')]();});}};}function handleEntityNotFound(_0x2e03f5,_0x4a3484){return function(_0x262c5f){if(!_0x262c5f){_0x2e03f5[_0xf28d('0x1a')](0x194);}return _0x262c5f;};}function handleError(_0x78012,_0x144b57){_0x144b57=_0x144b57||0x1f4;return function(_0x4ed8c3){logger['error'](_0x4ed8c3[_0xf28d('0x27')]);if(_0x4ed8c3[_0xf28d('0x28')]){delete _0x4ed8c3[_0xf28d('0x28')];}_0x78012[_0xf28d('0x1b')](_0x144b57)['send'](_0x4ed8c3);};}exports[_0xf28d('0x29')]=function(_0x52e3e4,_0x534aa5){var _0x45771e={},_0x417e09={},_0x4f18b2={'count':0x0,'rows':[]};var _0x452d4a=_[_0xf28d('0x2a')](db['VoiceDialReport']['rawAttributes'],function(_0x442781){return{'name':_0x442781[_0xf28d('0x2b')],'type':_0x442781['type'][_0xf28d('0x2c')]};});_0x417e09[_0xf28d('0x2d')]=_[_0xf28d('0x2a')](_0x452d4a,_0xf28d('0x28'));_0x417e09['query']=_[_0xf28d('0x2e')](_0x52e3e4[_0xf28d('0x2f')]);_0x417e09[_0xf28d('0x30')]=_[_0xf28d('0x31')](_0x417e09[_0xf28d('0x2d')],_0x417e09[_0xf28d('0x2f')]);_0x45771e['attributes']=_['intersection'](_0x417e09[_0xf28d('0x2d')],qs[_0xf28d('0x32')](_0x52e3e4[_0xf28d('0x2f')][_0xf28d('0x32')]));_0x45771e[_0xf28d('0x33')]=_0x45771e[_0xf28d('0x33')][_0xf28d('0x34')]?_0x45771e[_0xf28d('0x33')]:_0x417e09[_0xf28d('0x2d')];if(!_0x52e3e4[_0xf28d('0x2f')]['hasOwnProperty'](_0xf28d('0x35'))){_0x45771e['limit']=qs['limit'](_0x52e3e4[_0xf28d('0x2f')]['limit']);_0x45771e[_0xf28d('0x1e')]=qs[_0xf28d('0x1e')](_0x52e3e4[_0xf28d('0x2f')]['offset']);}_0x45771e[_0xf28d('0x36')]=qs[_0xf28d('0x37')](_0x52e3e4['query'][_0xf28d('0x37')]);_0x45771e[_0xf28d('0x38')]=qs['filters'](_[_0xf28d('0x39')](_0x52e3e4[_0xf28d('0x2f')],_0x417e09['filters']),_0x452d4a);if(_0x52e3e4[_0xf28d('0x2f')][_0xf28d('0x3a')]){_0x45771e[_0xf28d('0x38')]=_[_0xf28d('0x3b')](_0x45771e[_0xf28d('0x38')],{'$or':_[_0xf28d('0x2a')](_0x452d4a,function(_0x414194){if(_0x414194[_0xf28d('0x3c')]!==_0xf28d('0x3d')){var _0x14126a={};_0x14126a[_0x414194[_0xf28d('0x28')]]={'$like':'%'+_0x52e3e4['query'][_0xf28d('0x3a')]+'%'};return _0x14126a;}})});}_0x45771e=_[_0xf28d('0x3b')]({},_0x45771e,_0x52e3e4[_0xf28d('0x3e')]);var _0x260956={'where':_0x45771e[_0xf28d('0x38')]};return db[_0xf28d('0x3f')]['count'](_0x260956)[_0xf28d('0x26')](function(_0x3a5985){_0x4f18b2[_0xf28d('0x20')]=_0x3a5985;if(_0x52e3e4['query'][_0xf28d('0x40')]){_0x45771e[_0xf28d('0x41')]=[{'all':!![]}];}return db[_0xf28d('0x3f')]['findAll'](_0x45771e);})[_0xf28d('0x26')](function(_0x2ec2ce){_0x4f18b2[_0xf28d('0x42')]=_0x2ec2ce;return _0x4f18b2;})[_0xf28d('0x26')](respondWithFilteredResult(_0x534aa5,_0x45771e))[_0xf28d('0x43')](handleError(_0x534aa5,null));};exports['show']=function(_0x4cce71,_0x40b7d9){var _0x376f5e={'raw':!![],'where':{'id':_0x4cce71[_0xf28d('0x44')]['id']}},_0x29ff18={};_0x29ff18[_0xf28d('0x2d')]=_[_0xf28d('0x2e')](db[_0xf28d('0x3f')][_0xf28d('0x45')]);_0x29ff18['query']=_[_0xf28d('0x2e')](_0x4cce71['query']);_0x29ff18['filters']=_[_0xf28d('0x31')](_0x29ff18['model'],_0x29ff18[_0xf28d('0x2f')]);_0x376f5e[_0xf28d('0x33')]=_[_0xf28d('0x31')](_0x29ff18[_0xf28d('0x2d')],qs[_0xf28d('0x32')](_0x4cce71[_0xf28d('0x2f')]['fields']));_0x376f5e[_0xf28d('0x33')]=_0x376f5e['attributes'][_0xf28d('0x34')]?_0x376f5e['attributes']:_0x29ff18[_0xf28d('0x2d')];if(_0x4cce71[_0xf28d('0x2f')][_0xf28d('0x40')]){_0x376f5e[_0xf28d('0x41')]=[{'all':!![]}];}_0x376f5e=_[_0xf28d('0x3b')]({},_0x376f5e,_0x4cce71['options']);return db[_0xf28d('0x3f')]['find'](_0x376f5e)[_0xf28d('0x26')](handleEntityNotFound(_0x40b7d9,null))[_0xf28d('0x26')](respondWithResult(_0x40b7d9,null))[_0xf28d('0x43')](handleError(_0x40b7d9,null));};exports[_0xf28d('0x46')]=function(_0x30bcd5,_0x25c4be){return db[_0xf28d('0x3f')][_0xf28d('0x46')](_0x30bcd5[_0xf28d('0x47')],{})['then'](respondWithResult(_0x25c4be,0xc9))[_0xf28d('0x43')](handleError(_0x25c4be,null));};exports[_0xf28d('0x25')]=function(_0x7fee04,_0x3cd1fa){if(_0x7fee04[_0xf28d('0x47')]['id']){delete _0x7fee04[_0xf28d('0x47')]['id'];}return db[_0xf28d('0x3f')][_0xf28d('0x48')]({'where':{'id':_0x7fee04[_0xf28d('0x44')]['id']}})[_0xf28d('0x26')](handleEntityNotFound(_0x3cd1fa,null))[_0xf28d('0x26')](saveUpdates(_0x7fee04[_0xf28d('0x47')],null))[_0xf28d('0x26')](respondWithResult(_0x3cd1fa,null))['catch'](handleError(_0x3cd1fa,null));};exports['destroy']=function(_0x4e8eac,_0x4a6374){return db[_0xf28d('0x3f')][_0xf28d('0x48')]({'where':{'id':_0x4e8eac[_0xf28d('0x44')]['id']}})[_0xf28d('0x26')](handleEntityNotFound(_0x4a6374,null))[_0xf28d('0x26')](removeEntity(_0x4a6374,null))[_0xf28d('0x43')](handleError(_0x4a6374,null));};exports['describe']=function(_0x46c09d,_0x5d7193){return db[_0xf28d('0x3f')][_0xf28d('0x49')]()['then'](respondWithResult(_0x5d7193,null))[_0xf28d('0x43')](handleError(_0x5d7193,null));}; \ No newline at end of file +var _0x65e3=['create','body','params','find','describe','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','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','count','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x2dd390,_0x1bc894){var _0x3afe47=function(_0x42d8d3){while(--_0x42d8d3){_0x2dd390['push'](_0x2dd390['shift']());}};_0x3afe47(++_0x1bc894);}(_0x65e3,0xe0));var _0x365e=function(_0x7beda5,_0x5d855c){_0x7beda5=_0x7beda5-0x0;var _0x5cea6b=_0x65e3[_0x7beda5];return _0x5cea6b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x365e('0x0'));var jsonpatch=require(_0x365e('0x1'));var rp=require(_0x365e('0x2'));var moment=require('moment');var BPromise=require(_0x365e('0x3'));var Mustache=require(_0x365e('0x4'));var util=require(_0x365e('0x5'));var path=require(_0x365e('0x6'));var sox=require(_0x365e('0x7'));var csv=require('to-csv');var ejs=require(_0x365e('0x8'));var fs=require('fs');var fs_extra=require(_0x365e('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x365e('0xa'));var jsforce=require(_0x365e('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x365e('0xc'));var Papa=require(_0x365e('0xd'));var Redis=require(_0x365e('0xe'));var authService=require(_0x365e('0xf'));var qs=require(_0x365e('0x10'));var as=require(_0x365e('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x365e('0x12'))(_0x365e('0x13'));var utils=require(_0x365e('0x14'));var config=require(_0x365e('0x15'));var licenseUtil=require(_0x365e('0x16'));var db=require(_0x365e('0x17'))['db'];function respondWithStatusCode(_0x4d0e51,_0x1c4aa0){_0x1c4aa0=_0x1c4aa0||0xcc;return function(_0x4bb6f8){if(_0x4bb6f8){return _0x4d0e51[_0x365e('0x18')](_0x1c4aa0);}return _0x4d0e51[_0x365e('0x19')](_0x1c4aa0)[_0x365e('0x1a')]();};}function respondWithResult(_0x252bab,_0x4d3437){_0x4d3437=_0x4d3437||0xc8;return function(_0x5d128a){if(_0x5d128a){return _0x252bab['status'](_0x4d3437)[_0x365e('0x1b')](_0x5d128a);}};}function respondWithFilteredResult(_0x58ebb7,_0x4aae56){return function(_0x253707){if(_0x253707){var _0x262c2a=typeof _0x4aae56[_0x365e('0x1c')]===_0x365e('0x1d')&&typeof _0x4aae56['limit']===_0x365e('0x1d');var _0x22aaf0=_0x253707[_0x365e('0x1e')];var _0x2f4d36=_0x262c2a?0x0:_0x4aae56['offset'];var _0x5e7c79=_0x262c2a?_0x253707[_0x365e('0x1e')]:_0x4aae56[_0x365e('0x1c')]+_0x4aae56[_0x365e('0x1f')];var _0x44277c;if(_0x5e7c79>=_0x22aaf0){_0x5e7c79=_0x22aaf0;_0x44277c=0xc8;}else{_0x44277c=0xce;}_0x58ebb7['status'](_0x44277c);return _0x58ebb7[_0x365e('0x20')](_0x365e('0x21'),_0x2f4d36+'-'+_0x5e7c79+'/'+_0x22aaf0)[_0x365e('0x1b')](_0x253707);}return null;};}function patchUpdates(_0x276a73){return function(_0x925882){try{jsonpatch[_0x365e('0x22')](_0x925882,_0x276a73,!![]);}catch(_0x569671){return BPromise[_0x365e('0x23')](_0x569671);}return _0x925882['save']();};}function saveUpdates(_0x3c5b1e,_0x78b9d3){return function(_0x5200c8){if(_0x5200c8){return _0x5200c8[_0x365e('0x24')](_0x3c5b1e)[_0x365e('0x25')](function(_0x8beb4f){return _0x8beb4f;});}return null;};}function removeEntity(_0x412e15,_0x2ccfc8){return function(_0x1b804f){if(_0x1b804f){return _0x1b804f[_0x365e('0x26')]()[_0x365e('0x25')](function(){_0x412e15[_0x365e('0x19')](0xcc)[_0x365e('0x1a')]();});}};}function handleEntityNotFound(_0x1b3c10,_0x588683){return function(_0x4ed201){if(!_0x4ed201){_0x1b3c10[_0x365e('0x18')](0x194);}return _0x4ed201;};}function handleError(_0x6889d9,_0x4397c4){_0x4397c4=_0x4397c4||0x1f4;return function(_0xc811ef){logger['error'](_0xc811ef[_0x365e('0x27')]);if(_0xc811ef[_0x365e('0x28')]){delete _0xc811ef[_0x365e('0x28')];}_0x6889d9[_0x365e('0x19')](_0x4397c4)[_0x365e('0x29')](_0xc811ef);};}exports[_0x365e('0x2a')]=function(_0x54d7e8,_0x1f8ca){var _0x12ddec={},_0x1935a5={},_0x3e9397={'count':0x0,'rows':[]};var _0x57a106=_[_0x365e('0x2b')](db[_0x365e('0x2c')][_0x365e('0x2d')],function(_0x453817){return{'name':_0x453817[_0x365e('0x2e')],'type':_0x453817[_0x365e('0x2f')]['key']};});_0x1935a5[_0x365e('0x30')]=_[_0x365e('0x2b')](_0x57a106,_0x365e('0x28'));_0x1935a5[_0x365e('0x31')]=_[_0x365e('0x32')](_0x54d7e8[_0x365e('0x31')]);_0x1935a5[_0x365e('0x33')]=_[_0x365e('0x34')](_0x1935a5['model'],_0x1935a5[_0x365e('0x31')]);_0x12ddec[_0x365e('0x35')]=_[_0x365e('0x34')](_0x1935a5['model'],qs['fields'](_0x54d7e8[_0x365e('0x31')][_0x365e('0x36')]));_0x12ddec['attributes']=_0x12ddec[_0x365e('0x35')][_0x365e('0x37')]?_0x12ddec[_0x365e('0x35')]:_0x1935a5[_0x365e('0x30')];if(!_0x54d7e8[_0x365e('0x31')][_0x365e('0x38')]('nolimit')){_0x12ddec['limit']=qs[_0x365e('0x1f')](_0x54d7e8['query'][_0x365e('0x1f')]);_0x12ddec[_0x365e('0x1c')]=qs[_0x365e('0x1c')](_0x54d7e8[_0x365e('0x31')][_0x365e('0x1c')]);}_0x12ddec[_0x365e('0x39')]=qs[_0x365e('0x3a')](_0x54d7e8[_0x365e('0x31')][_0x365e('0x3a')]);_0x12ddec[_0x365e('0x3b')]=qs['filters'](_['pick'](_0x54d7e8[_0x365e('0x31')],_0x1935a5[_0x365e('0x33')]),_0x57a106);if(_0x54d7e8['query'][_0x365e('0x3c')]){_0x12ddec[_0x365e('0x3b')]=_[_0x365e('0x3d')](_0x12ddec[_0x365e('0x3b')],{'$or':_[_0x365e('0x2b')](_0x57a106,function(_0xf860c5){if(_0xf860c5[_0x365e('0x2f')]!=='VIRTUAL'){var _0x2708c3={};_0x2708c3[_0xf860c5[_0x365e('0x28')]]={'$like':'%'+_0x54d7e8[_0x365e('0x31')][_0x365e('0x3c')]+'%'};return _0x2708c3;}})});}_0x12ddec=_[_0x365e('0x3d')]({},_0x12ddec,_0x54d7e8[_0x365e('0x3e')]);var _0x9a640a={'where':_0x12ddec[_0x365e('0x3b')]};return db[_0x365e('0x2c')][_0x365e('0x1e')](_0x9a640a)[_0x365e('0x25')](function(_0x59fadd){_0x3e9397['count']=_0x59fadd;if(_0x54d7e8[_0x365e('0x31')][_0x365e('0x3f')]){_0x12ddec[_0x365e('0x40')]=[{'all':!![]}];}return db[_0x365e('0x2c')][_0x365e('0x41')](_0x12ddec);})[_0x365e('0x25')](function(_0x1b78b2){_0x3e9397[_0x365e('0x42')]=_0x1b78b2;return _0x3e9397;})[_0x365e('0x25')](respondWithFilteredResult(_0x1f8ca,_0x12ddec))[_0x365e('0x43')](handleError(_0x1f8ca,null));};exports['show']=function(_0x4dee44,_0x2463c2){var _0x2dfa55={'raw':!![],'where':{'id':_0x4dee44['params']['id']}},_0x31db6a={};_0x31db6a[_0x365e('0x30')]=_[_0x365e('0x32')](db[_0x365e('0x2c')][_0x365e('0x2d')]);_0x31db6a[_0x365e('0x31')]=_[_0x365e('0x32')](_0x4dee44[_0x365e('0x31')]);_0x31db6a[_0x365e('0x33')]=_[_0x365e('0x34')](_0x31db6a[_0x365e('0x30')],_0x31db6a[_0x365e('0x31')]);_0x2dfa55[_0x365e('0x35')]=_[_0x365e('0x34')](_0x31db6a[_0x365e('0x30')],qs[_0x365e('0x36')](_0x4dee44[_0x365e('0x31')][_0x365e('0x36')]));_0x2dfa55[_0x365e('0x35')]=_0x2dfa55['attributes'][_0x365e('0x37')]?_0x2dfa55[_0x365e('0x35')]:_0x31db6a[_0x365e('0x30')];if(_0x4dee44[_0x365e('0x31')]['includeAll']){_0x2dfa55['include']=[{'all':!![]}];}_0x2dfa55=_[_0x365e('0x3d')]({},_0x2dfa55,_0x4dee44[_0x365e('0x3e')]);return db[_0x365e('0x2c')]['find'](_0x2dfa55)[_0x365e('0x25')](handleEntityNotFound(_0x2463c2,null))[_0x365e('0x25')](respondWithResult(_0x2463c2,null))[_0x365e('0x43')](handleError(_0x2463c2,null));};exports[_0x365e('0x44')]=function(_0xc23530,_0x4be9d6){return db[_0x365e('0x2c')][_0x365e('0x44')](_0xc23530[_0x365e('0x45')],{})[_0x365e('0x25')](respondWithResult(_0x4be9d6,0xc9))[_0x365e('0x43')](handleError(_0x4be9d6,null));};exports[_0x365e('0x24')]=function(_0x6052b1,_0x1ac96d){if(_0x6052b1[_0x365e('0x45')]['id']){delete _0x6052b1[_0x365e('0x45')]['id'];}return db[_0x365e('0x2c')]['find']({'where':{'id':_0x6052b1[_0x365e('0x46')]['id']}})[_0x365e('0x25')](handleEntityNotFound(_0x1ac96d,null))[_0x365e('0x25')](saveUpdates(_0x6052b1[_0x365e('0x45')],null))['then'](respondWithResult(_0x1ac96d,null))[_0x365e('0x43')](handleError(_0x1ac96d,null));};exports[_0x365e('0x26')]=function(_0x55da8f,_0x20a841){return db['VoiceDialReport'][_0x365e('0x47')]({'where':{'id':_0x55da8f[_0x365e('0x46')]['id']}})['then'](handleEntityNotFound(_0x20a841,null))[_0x365e('0x25')](removeEntity(_0x20a841,null))[_0x365e('0x43')](handleError(_0x20a841,null));};exports[_0x365e('0x48')]=function(_0x343691,_0x3dd963){return db[_0x365e('0x2c')][_0x365e('0x48')]()[_0x365e('0x25')](respondWithResult(_0x3dd963,null))['catch'](handleError(_0x3dd963,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ee0437b..52ca8ec 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 _0xd0d1=['exports','define','VoiceDialReport','report_dial','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x3ab5bd,_0x56fbcf){var _0xe4109d=function(_0x36418b){while(--_0x36418b){_0x3ab5bd['push'](_0x3ab5bd['shift']());}};_0xe4109d(++_0x56fbcf);}(_0xd0d1,0x1a8));var _0x1d0d=function(_0x1a7c81,_0x546eb8){_0x1a7c81=_0x1a7c81-0x0;var _0x5c9aa0=_0xd0d1[_0x1a7c81];return _0x5c9aa0;};'use strict';var _=require(_0x1d0d('0x0'));var util=require(_0x1d0d('0x1'));var logger=require('../../config/logger')(_0x1d0d('0x2'));var moment=require(_0x1d0d('0x3'));var BPromise=require(_0x1d0d('0x4'));var rp=require(_0x1d0d('0x5'));var fs=require('fs');var path=require(_0x1d0d('0x6'));var rimraf=require('rimraf');var config=require(_0x1d0d('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x1d0d('0x8')]=function(_0x203635,_0x4a76be){return _0x203635[_0x1d0d('0x9')](_0x1d0d('0xa'),attributes,{'tableName':_0x1d0d('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc11=['util','api','moment','bluebird','request-promise','path','./voiceDialReport.attributes','VoiceDialReport','report_dial','uniqueid','lodash'];(function(_0x3df93e,_0x5af13a){var _0x2d4f2a=function(_0x14c85c){while(--_0x14c85c){_0x3df93e['push'](_0x3df93e['shift']());}};_0x2d4f2a(++_0x5af13a);}(_0xdc11,0x1cd));var _0x1dc1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc11[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1dc1('0x0'));var util=require(_0x1dc1('0x1'));var logger=require('../../config/logger')(_0x1dc1('0x2'));var moment=require(_0x1dc1('0x3'));var BPromise=require(_0x1dc1('0x4'));var rp=require(_0x1dc1('0x5'));var fs=require('fs');var path=require(_0x1dc1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1dc1('0x7'));module['exports']=function(_0x55038d,_0x38c820){return _0x55038d['define'](_0x1dc1('0x8'),attributes,{'tableName':_0x1dc1('0x9'),'paranoid':![],'indexes':[{'fields':[_0x1dc1('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 4033093..ba7d819 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 _0x04ee=['../../config/utils','../../config/logger','jayson/promise','client','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','VoiceDialReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','info','debug','stringify','UpdateVoiceDialReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x2ef975,_0x3938dc){var _0x253397=function(_0x43a61b){while(--_0x43a61b){_0x2ef975['push'](_0x2ef975['shift']());}};_0x253397(++_0x3938dc);}(_0x04ee,0x82));var _0xe04e=function(_0x10202f,_0x3a3b2b){_0x10202f=_0x10202f-0x0;var _0x19bd06=_0x04ee[_0x10202f];return _0x19bd06;};'use strict';var _=require(_0xe04e('0x0'));var util=require(_0xe04e('0x1'));var moment=require(_0xe04e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe04e('0x3'));var fs=require('fs');var Redis=require(_0xe04e('0x4'));var db=require(_0xe04e('0x5'))['db'];var utils=require(_0xe04e('0x6'));var logger=require(_0xe04e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe04e('0x8'));var client=jayson[_0xe04e('0x9')][_0xe04e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x541aed,_0x4ce62b,_0x1730c3){return new BPromise(function(_0x1afb03,_0x22433b){return client[_0xe04e('0xb')](_0x541aed,_0x1730c3)[_0xe04e('0xc')](function(_0x11b28e){logger['info'](_0xe04e('0xd'),_0x4ce62b,_0xe04e('0xe'));logger['debug'](_0xe04e('0xf'),_0x4ce62b,'request\x20sent',JSON['stringify'](_0x11b28e));if(_0x11b28e[_0xe04e('0x10')]){if(_0x11b28e['error'][_0xe04e('0x11')]===0x1f4){logger[_0xe04e('0x10')](_0xe04e('0xd'),_0x4ce62b,_0x11b28e[_0xe04e('0x10')][_0xe04e('0x12')]);return _0x22433b(_0x11b28e[_0xe04e('0x10')][_0xe04e('0x12')]);}logger[_0xe04e('0x10')](_0xe04e('0xd'),_0x4ce62b,_0x11b28e[_0xe04e('0x10')]['message']);return _0x1afb03(_0x11b28e['error'][_0xe04e('0x12')]);}else{logger['info'](_0xe04e('0xd'),_0x4ce62b,_0xe04e('0xe'));_0x1afb03(_0x11b28e[_0xe04e('0x13')][_0xe04e('0x12')]);}})[_0xe04e('0x14')](function(_0x2a211a){logger[_0xe04e('0x10')](_0xe04e('0xd'),_0x4ce62b,_0x2a211a);_0x22433b(_0x2a211a);});});}exports[_0xe04e('0x15')]=function(_0xae689b){var _0x354480=this;return new Promise(function(_0x5c0682,_0x166b77){return db[_0xe04e('0x16')][_0xe04e('0x17')](_0xae689b[_0xe04e('0x18')],{'raw':_0xae689b['options']?_0xae689b[_0xe04e('0x19')][_0xe04e('0x1a')]===undefined?!![]:![]:!![]})[_0xe04e('0xc')](function(_0x3d245f){logger[_0xe04e('0x1b')]('CreateVoiceDialReport',_0xae689b);logger[_0xe04e('0x1c')]('CreateVoiceDialReport',_0xae689b,JSON[_0xe04e('0x1d')](_0x3d245f));_0x5c0682(_0x3d245f);})[_0xe04e('0x14')](function(_0x932825){logger[_0xe04e('0x10')](_0xe04e('0x15'),_0x932825['message'],_0xae689b);_0x166b77(_0x354480[_0xe04e('0x10')](0x1f4,_0x932825[_0xe04e('0x12')]));});});};exports[_0xe04e('0x1e')]=function(_0x3fedcc){var _0x25f745=this;return new Promise(function(_0x572cac,_0x43e1e8){return db[_0xe04e('0x16')]['update'](_0x3fedcc[_0xe04e('0x18')],{'raw':_0x3fedcc[_0xe04e('0x19')]?_0x3fedcc[_0xe04e('0x19')][_0xe04e('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3fedcc[_0xe04e('0x19')]?_0x3fedcc['options'][_0xe04e('0x1f')]||null:null,'attributes':_0x3fedcc[_0xe04e('0x19')]?_0x3fedcc[_0xe04e('0x19')][_0xe04e('0x20')]||null:null,'limit':_0x3fedcc[_0xe04e('0x19')]?_0x3fedcc[_0xe04e('0x19')][_0xe04e('0x21')]||null:null})['then'](function(_0x3018f8){logger[_0xe04e('0x1b')](_0xe04e('0x1e'),_0x3fedcc);logger[_0xe04e('0x1c')](_0xe04e('0x1e'),_0x3fedcc,JSON['stringify'](_0x3018f8));_0x572cac(_0x3018f8);})['catch'](function(_0x28ab46){logger[_0xe04e('0x10')](_0xe04e('0x1e'),_0x28ab46['message'],_0x3fedcc);_0x43e1e8(_0x25f745[_0xe04e('0x10')](0x1f4,_0x28ab46['message']));});});}; \ No newline at end of file +var _0xf1e5=['request\x20sent','debug','stringify','error','code','message','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','client','http','then','info','VoiceDialReport,\x20%s,\x20%s'];(function(_0x59f0b5,_0x1ce05d){var _0x113cdb=function(_0x2ffabb){while(--_0x2ffabb){_0x59f0b5['push'](_0x59f0b5['shift']());}};_0x113cdb(++_0x1ce05d);}(_0xf1e5,0x150));var _0x5f1e=function(_0xcbc157,_0x1a2d7b){_0xcbc157=_0xcbc157-0x0;var _0x11196f=_0xf1e5[_0xcbc157];return _0x11196f;};'use strict';var _=require(_0x5f1e('0x0'));var util=require(_0x5f1e('0x1'));var moment=require(_0x5f1e('0x2'));var BPromise=require(_0x5f1e('0x3'));var rs=require(_0x5f1e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5f1e('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5f1e('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x5f1e('0x7')][_0x5f1e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5a0ed6,_0x2d3e96,_0x226fd4){return new BPromise(function(_0x48b224,_0x2f046a){return client['request'](_0x5a0ed6,_0x226fd4)[_0x5f1e('0x9')](function(_0x51f305){logger[_0x5f1e('0xa')](_0x5f1e('0xb'),_0x2d3e96,_0x5f1e('0xc'));logger[_0x5f1e('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x2d3e96,'request\x20sent',JSON[_0x5f1e('0xe')](_0x51f305));if(_0x51f305[_0x5f1e('0xf')]){if(_0x51f305['error'][_0x5f1e('0x10')]===0x1f4){logger[_0x5f1e('0xf')](_0x5f1e('0xb'),_0x2d3e96,_0x51f305[_0x5f1e('0xf')]['message']);return _0x2f046a(_0x51f305[_0x5f1e('0xf')][_0x5f1e('0x11')]);}logger[_0x5f1e('0xf')](_0x5f1e('0xb'),_0x2d3e96,_0x51f305[_0x5f1e('0xf')][_0x5f1e('0x11')]);return _0x48b224(_0x51f305['error'][_0x5f1e('0x11')]);}else{logger[_0x5f1e('0xa')](_0x5f1e('0xb'),_0x2d3e96,_0x5f1e('0xc'));_0x48b224(_0x51f305[_0x5f1e('0x12')][_0x5f1e('0x11')]);}})[_0x5f1e('0x13')](function(_0x2fe9a0){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x2d3e96,_0x2fe9a0);_0x2f046a(_0x2fe9a0);});});}exports['CreateVoiceDialReport']=function(_0x6a155c){var _0x57c2ac=this;return new Promise(function(_0xff9312,_0x3b11d7){return db[_0x5f1e('0x14')][_0x5f1e('0x15')](_0x6a155c[_0x5f1e('0x16')],{'raw':_0x6a155c[_0x5f1e('0x17')]?_0x6a155c[_0x5f1e('0x17')][_0x5f1e('0x18')]===undefined?!![]:![]:!![]})[_0x5f1e('0x9')](function(_0x1aded8){logger[_0x5f1e('0xa')](_0x5f1e('0x19'),_0x6a155c);logger[_0x5f1e('0xd')](_0x5f1e('0x19'),_0x6a155c,JSON[_0x5f1e('0xe')](_0x1aded8));_0xff9312(_0x1aded8);})['catch'](function(_0x54a339){logger[_0x5f1e('0xf')](_0x5f1e('0x19'),_0x54a339[_0x5f1e('0x11')],_0x6a155c);_0x3b11d7(_0x57c2ac[_0x5f1e('0xf')](0x1f4,_0x54a339[_0x5f1e('0x11')]));});});};exports[_0x5f1e('0x1a')]=function(_0x2ed622){var _0xa1cc71=this;return new Promise(function(_0x3099ca,_0x16f5bd){return db['VoiceDialReport'][_0x5f1e('0x1b')](_0x2ed622[_0x5f1e('0x16')],{'raw':_0x2ed622[_0x5f1e('0x17')]?_0x2ed622[_0x5f1e('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ed622[_0x5f1e('0x17')]?_0x2ed622[_0x5f1e('0x17')]['where']||null:null,'attributes':_0x2ed622[_0x5f1e('0x17')]?_0x2ed622['options']['attributes']||null:null,'limit':_0x2ed622[_0x5f1e('0x17')]?_0x2ed622['options'][_0x5f1e('0x1c')]||null:null})[_0x5f1e('0x9')](function(_0x22b43a){logger[_0x5f1e('0xa')](_0x5f1e('0x1a'),_0x2ed622);logger['debug'](_0x5f1e('0x1a'),_0x2ed622,JSON[_0x5f1e('0xe')](_0x22b43a));_0x3099ca(_0x22b43a);})['catch'](function(_0x1e1b1f){logger[_0x5f1e('0xf')](_0x5f1e('0x1a'),_0x1e1b1f[_0x5f1e('0x11')],_0x2ed622);_0x16f5bd(_0xa1cc71[_0x5f1e('0xf')](0x1f4,_0x1e1b1f['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 8573362..bd114a4 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 _0xb5a6=['../../components/interaction/service','./voiceExtension.controller','isAuthenticated','index','get','/:id','show','post','create','/:id/applications','addApplications','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x27de7c,_0x2deae4){var _0x31d3c2=function(_0xa980f1){while(--_0xa980f1){_0x27de7c['push'](_0x27de7c['shift']());}};_0x31d3c2(++_0x2deae4);}(_0xb5a6,0x11f));var _0x6b5a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb5a6[_0x2641f9];return _0x585741;};'use strict';var multer=require(_0x6b5a('0x0'));var util=require(_0x6b5a('0x1'));var path=require(_0x6b5a('0x2'));var timeout=require(_0x6b5a('0x3'));var express=require(_0x6b5a('0x4'));var router=express[_0x6b5a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x6b5a('0x6'));var interaction=require(_0x6b5a('0x7'));var config=require('../../config/environment');var controller=require(_0x6b5a('0x8'));router['get']('/',auth[_0x6b5a('0x9')](),controller[_0x6b5a('0xa')]);router[_0x6b5a('0xb')](_0x6b5a('0xc'),auth[_0x6b5a('0x9')](),controller[_0x6b5a('0xd')]);router[_0x6b5a('0xe')]('/',auth[_0x6b5a('0x9')](),controller[_0x6b5a('0xf')]);router[_0x6b5a('0xe')](_0x6b5a('0x10'),auth[_0x6b5a('0x9')](),controller[_0x6b5a('0x11')]);router[_0x6b5a('0x12')](_0x6b5a('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x6b5a('0x13')](_0x6b5a('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x6b5a('0x14')]=router; \ No newline at end of file +var _0x19b6=['../../config/environment','./voiceExtension.controller','isAuthenticated','get','/:id','show','post','create','/:id/applications','addApplications','update','delete','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2c6464,_0x51817d){var _0x58e452=function(_0x39b8f3){while(--_0x39b8f3){_0x2c6464['push'](_0x2c6464['shift']());}};_0x58e452(++_0x51817d);}(_0x19b6,0x71));var _0x619b=function(_0x26a818,_0x40708a){_0x26a818=_0x26a818-0x0;var _0x5d8ca0=_0x19b6[_0x26a818];return _0x5d8ca0;};'use strict';var multer=require(_0x619b('0x0'));var util=require(_0x619b('0x1'));var path=require(_0x619b('0x2'));var timeout=require('connect-timeout');var express=require(_0x619b('0x3'));var router=express['Router']();var fs_extra=require(_0x619b('0x4'));var auth=require(_0x619b('0x5'));var interaction=require(_0x619b('0x6'));var config=require(_0x619b('0x7'));var controller=require(_0x619b('0x8'));router['get']('/',auth[_0x619b('0x9')](),controller['index']);router[_0x619b('0xa')](_0x619b('0xb'),auth[_0x619b('0x9')](),controller[_0x619b('0xc')]);router[_0x619b('0xd')]('/',auth[_0x619b('0x9')](),controller[_0x619b('0xe')]);router[_0x619b('0xd')](_0x619b('0xf'),auth[_0x619b('0x9')](),controller[_0x619b('0x10')]);router['put'](_0x619b('0xb'),auth[_0x619b('0x9')](),controller[_0x619b('0x11')]);router[_0x619b('0x12')]('/:id',auth[_0x619b('0x9')](),controller['destroy']);module[_0x619b('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index cfb0f23..c53b0ab 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 _0x8075=['outbound-fax','system','any','*,*,*,*','BOOLEAN','INTEGER','VIRTUAL','getDataValue','exten','sequelize','STRING','compositeIndex','NoOp','ENUM','inbound','internal','inbound-fax'];(function(_0x52ab36,_0xff3108){var _0x141314=function(_0x4ddfd0){while(--_0x4ddfd0){_0x52ab36['push'](_0x52ab36['shift']());}};_0x141314(++_0xff3108);}(_0x8075,0x91));var _0x5807=function(_0x3bbe9c,_0x13df6c){_0x3bbe9c=_0x3bbe9c-0x0;var _0x28ca39=_0x8075[_0x3bbe9c];return _0x28ca39;};'use strict';var Sequelize=require(_0x5807('0x0'));module['exports']={'context':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'unique':_0x5807('0x2')},'priority':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'defaultValue':'1','unique':_0x5807('0x2')},'tag':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'defaultValue':_0x5807('0x3')},'appdata':{'type':Sequelize[_0x5807('0x1')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x5807('0x4')](_0x5807('0x5'),'outbound',_0x5807('0x6'),_0x5807('0x7'),_0x5807('0x8'),_0x5807('0x9'),_0x5807('0xa')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5807('0x1')],'allowNull':![],'defaultValue':_0x5807('0xb')},'IntervalId':{'type':Sequelize['INTEGER']},'isApp':{'type':Sequelize[_0x5807('0xc')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x5807('0x1')],'defaultValue':null},'callerID':{'type':Sequelize[_0x5807('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0x5807('0xc')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x5807('0xd')]},'recordingFormat':{'type':Sequelize[_0x5807('0x1')],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x5807('0xc')],'defaultValue':!![]},'name':{'type':Sequelize[_0x5807('0xe')],'get':function(_0x269fb7){return this[_0x5807('0xf')](_0x5807('0x10'));}},'alias':{'type':Sequelize[_0x5807('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xca4d=['INTEGER','BOOLEAN','wav','getDataValue','exten','sequelize','STRING','compositeIndex','ENUM','inbound','outbound','inbound-fax','outbound-fax','any','*,*,*,*'];(function(_0x38d88c,_0x1014d5){var _0x2edcf8=function(_0xf71362){while(--_0xf71362){_0x38d88c['push'](_0x38d88c['shift']());}};_0x2edcf8(++_0x1014d5);}(_0xca4d,0x1c7));var _0xdca4=function(_0x20261e,_0x4df4bb){_0x20261e=_0x20261e-0x0;var _0x29e665=_0xca4d[_0x20261e];return _0x29e665;};'use strict';var Sequelize=require(_0xdca4('0x0'));module['exports']={'context':{'type':Sequelize[_0xdca4('0x1')],'allowNull':![],'unique':_0xdca4('0x2'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':'compositeIndex'},'priority':{'type':Sequelize[_0xdca4('0x1')],'allowNull':![],'defaultValue':'1','unique':_0xdca4('0x2')},'tag':{'type':Sequelize[_0xdca4('0x1')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0xdca4('0x3')](_0xdca4('0x4'),_0xdca4('0x5'),'internal',_0xdca4('0x6'),_0xdca4('0x7'),'system',_0xdca4('0x8')),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xdca4('0x9')},'IntervalId':{'type':Sequelize[_0xdca4('0xa')]},'isApp':{'type':Sequelize[_0xdca4('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize['STRING'],'defaultValue':null},'callerID':{'type':Sequelize[_0xdca4('0x1')],'allowNull':!![]},'record':{'type':Sequelize[_0xdca4('0xb')],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0xdca4('0xa')]},'recordingFormat':{'type':Sequelize[_0xdca4('0x1')],'defaultValue':_0xdca4('0xc')},'answer':{'type':Sequelize[_0xdca4('0xb')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x3a270e){return this[_0xdca4('0xd')](_0xdca4('0xe'));}},'alias':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index e3ce25f..ea74347 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 _0xc1c1=['transaction','Transaction','READ_COMMITTED','findOne','isApp','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','send','lodash','ioredis','../../components/parsers/qs','api','../../config/environment','redis','localhost','socket.io-emitter','register','sendStatus','end','offset','limit','undefined','count','status','set','json','destroy','get','InboundRoutes','OutboundRoutes','outbound','internal','ignore','map','value','includes','find','type','name','then','error','stack','index','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','VoiceExtension','length','includeAll','create','body','startsWith','exten','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','pick','context','description','recordingFormat','cutdigits','mandatoryDisposition','alias','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc1c1,0x165));var _0x1c1c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc1c1[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x1c1c('0x0'));var Redis=require(_0x1c1c('0x1'));var qs=require(_0x1c1c('0x2'));var logger=require('../../config/logger')(_0x1c1c('0x3'));var config=require(_0x1c1c('0x4'));var db=require('../../mysqldb')['db'];config[_0x1c1c('0x5')]=_['defaults'](config[_0x1c1c('0x5')],{'host':_0x1c1c('0x6'),'port':0x18eb});var socket=require(_0x1c1c('0x7'))(new Redis(config['redis']));require('./voiceExtension.socket')[_0x1c1c('0x8')](socket);function respondWithStatusCode(_0x4ecbbb,_0x40d867){_0x40d867=_0x40d867||0xcc;return function(_0x240c09){if(_0x240c09){return _0x4ecbbb[_0x1c1c('0x9')](_0x40d867);}return _0x4ecbbb['status'](_0x40d867)[_0x1c1c('0xa')]();};}function respondWithResult(_0x56a7b3,_0x5c2c06){_0x5c2c06=_0x5c2c06||0xc8;return function(_0x4bb4bf){if(_0x4bb4bf){return _0x56a7b3['status'](_0x5c2c06)['json'](_0x4bb4bf);}};}function respondWithFilteredResult(_0x55f3cd,_0x114061){return function(_0x326f42){if(_0x326f42){var _0x5857b1=typeof _0x114061[_0x1c1c('0xb')]==='undefined'&&typeof _0x114061[_0x1c1c('0xc')]===_0x1c1c('0xd');var _0x465bdc=_0x326f42[_0x1c1c('0xe')];var _0x5cf0a3=_0x5857b1?0x0:_0x114061[_0x1c1c('0xb')];var _0x4694f1=_0x5857b1?_0x326f42['count']:_0x114061[_0x1c1c('0xb')]+_0x114061[_0x1c1c('0xc')];var _0x1016a3;if(_0x4694f1>=_0x465bdc){_0x4694f1=_0x465bdc;_0x1016a3=0xc8;}else{_0x1016a3=0xce;}_0x55f3cd[_0x1c1c('0xf')](_0x1016a3);return _0x55f3cd[_0x1c1c('0x10')]('Content-Range',_0x5cf0a3+'-'+_0x4694f1+'/'+_0x465bdc)[_0x1c1c('0x11')](_0x326f42);}return null;};}function removeEntity(_0x355552){return function(_0x37a504){if(_0x37a504){return _0x37a504[_0x1c1c('0x12')]()['then'](function(){var _0x388303=_0x37a504[_0x1c1c('0x13')]({'plain':!![]});var _0x46f8bc=[{'name':_0x1c1c('0x14'),'value':'inbound','ignore':![]},{'name':_0x1c1c('0x15'),'value':_0x1c1c('0x16'),'ignore':![]},{'name':'InternalRoutes','value':_0x1c1c('0x17'),'ignore':![]}];var _0x45351d=_(_0x46f8bc)['filter'](_0x1c1c('0x18'))[_0x1c1c('0x19')](_0x1c1c('0x1a'))[_0x1c1c('0x1a')]();if(_[_0x1c1c('0x1b')](_0x45351d,_0x388303['type'])){return;}var _0x450fb2=_[_0x1c1c('0x1c')](_0x46f8bc,['value',_0x388303[_0x1c1c('0x1d')]])[_0x1c1c('0x1e')];return db['UserProfileResource'][_0x1c1c('0x12')]({'where':{'type':_0x450fb2,'resourceId':_0x388303['id']}})['then'](function(){return _0x37a504;});})[_0x1c1c('0x1f')](function(){_0x355552[_0x1c1c('0xf')](0xcc)[_0x1c1c('0xa')]();});}};}function handleEntityNotFound(_0x527fc0){return function(_0x7864d3){if(!_0x7864d3){_0x527fc0['sendStatus'](0x194);}return _0x7864d3;};}function handleError(_0x25aa75,_0x450022){_0x450022=_0x450022||0x1f4;return function(_0x1b3ea7){logger[_0x1c1c('0x20')](_0x1b3ea7[_0x1c1c('0x21')]);if(_0x1b3ea7[_0x1c1c('0x1e')]){delete _0x1b3ea7['name'];}_0x25aa75['status'](_0x450022)['send'](_0x1b3ea7);};}exports[_0x1c1c('0x22')]=function(_0x4a05a0,_0x5f49c6){var _0x32ad51={},_0x25ff5c={},_0x2acb83={'count':0x0,'rows':[]};var _0x45f121=_[_0x1c1c('0x19')](db['VoiceExtension'][_0x1c1c('0x23')],function(_0x28f4cb){return{'name':_0x28f4cb[_0x1c1c('0x24')],'type':_0x28f4cb[_0x1c1c('0x1d')]['key']};});_0x25ff5c['model']=_['map'](_0x45f121,_0x1c1c('0x1e'));_0x25ff5c[_0x1c1c('0x25')]=_[_0x1c1c('0x26')](_0x4a05a0[_0x1c1c('0x25')]);_0x25ff5c[_0x1c1c('0x27')]=_[_0x1c1c('0x28')](_0x25ff5c['model'],_0x25ff5c[_0x1c1c('0x25')]);_0x32ad51[_0x1c1c('0x29')]=_[_0x1c1c('0x28')](_0x25ff5c[_0x1c1c('0x2a')],qs[_0x1c1c('0x2b')](_0x4a05a0[_0x1c1c('0x25')][_0x1c1c('0x2b')]));_0x32ad51[_0x1c1c('0x29')]=_0x32ad51[_0x1c1c('0x29')]['length']?_0x32ad51[_0x1c1c('0x29')]:_0x25ff5c[_0x1c1c('0x2a')];if(!_0x4a05a0[_0x1c1c('0x25')]['hasOwnProperty'](_0x1c1c('0x2c'))){_0x32ad51['limit']=qs[_0x1c1c('0xc')](_0x4a05a0['query']['limit']);_0x32ad51[_0x1c1c('0xb')]=qs['offset'](_0x4a05a0['query'][_0x1c1c('0xb')]);}_0x32ad51[_0x1c1c('0x2d')]=qs['sort'](_0x4a05a0[_0x1c1c('0x25')][_0x1c1c('0x2e')]);_0x32ad51[_0x1c1c('0x2f')]=qs[_0x1c1c('0x27')](_['pick'](_0x4a05a0[_0x1c1c('0x25')],_0x25ff5c[_0x1c1c('0x27')]),_0x45f121);if(_0x4a05a0[_0x1c1c('0x25')]['filter']){_0x32ad51[_0x1c1c('0x2f')]=_['merge'](_0x32ad51['where'],{'$or':_[_0x1c1c('0x19')](_0x45f121,function(_0x17a61a){if(_0x17a61a[_0x1c1c('0x1d')]!=='VIRTUAL'){var _0x393a61={};_0x393a61[_0x17a61a['name']]={'$like':'%'+_0x4a05a0[_0x1c1c('0x25')][_0x1c1c('0x30')]+'%'};return _0x393a61;}})});}_0x32ad51=_[_0x1c1c('0x31')]({},_0x32ad51,_0x4a05a0[_0x1c1c('0x32')]);var _0x360b58={'where':_0x32ad51[_0x1c1c('0x2f')]};return db['VoiceExtension']['count'](_0x360b58)[_0x1c1c('0x1f')](function(_0x15fdff){_0x2acb83[_0x1c1c('0xe')]=_0x15fdff;if(_0x4a05a0['query']['includeAll']){_0x32ad51[_0x1c1c('0x33')]=[{'all':!![]}];}return db['VoiceExtension'][_0x1c1c('0x34')](_0x32ad51);})[_0x1c1c('0x1f')](function(_0x5c28dc){_0x2acb83[_0x1c1c('0x35')]=_0x5c28dc;return _0x2acb83;})['then'](respondWithFilteredResult(_0x5f49c6,_0x32ad51))[_0x1c1c('0x36')](handleError(_0x5f49c6,null));};exports['show']=function(_0xf229c1,_0x42542b){var _0x53095c={'raw':![],'where':{'id':_0xf229c1[_0x1c1c('0x37')]['id']}},_0x5f416b={};_0x5f416b[_0x1c1c('0x2a')]=_[_0x1c1c('0x26')](db[_0x1c1c('0x38')][_0x1c1c('0x23')]);_0x5f416b[_0x1c1c('0x25')]=_[_0x1c1c('0x26')](_0xf229c1[_0x1c1c('0x25')]);_0x5f416b['filters']=_['intersection'](_0x5f416b[_0x1c1c('0x2a')],_0x5f416b['query']);_0x53095c[_0x1c1c('0x29')]=_[_0x1c1c('0x28')](_0x5f416b[_0x1c1c('0x2a')],qs[_0x1c1c('0x2b')](_0xf229c1['query'][_0x1c1c('0x2b')]));_0x53095c[_0x1c1c('0x29')]=_0x53095c[_0x1c1c('0x29')][_0x1c1c('0x39')]?_0x53095c[_0x1c1c('0x29')]:_0x5f416b['model'];if(_0xf229c1[_0x1c1c('0x25')][_0x1c1c('0x3a')]){_0x53095c['include']=[{'all':!![]}];}_0x53095c=_['merge']({},_0x53095c,_0xf229c1['options']);return db['VoiceExtension'][_0x1c1c('0x1c')](_0x53095c)[_0x1c1c('0x1f')](handleEntityNotFound(_0x42542b,null))[_0x1c1c('0x1f')](respondWithResult(_0x42542b,null))[_0x1c1c('0x36')](handleError(_0x42542b,null));};exports['destroy']=function(_0x32df80,_0x91691b){return db[_0x1c1c('0x38')][_0x1c1c('0x1c')]({'where':{'id':_0x32df80['params']['id']}})[_0x1c1c('0x1f')](handleEntityNotFound(_0x91691b,null))[_0x1c1c('0x1f')](removeEntity(_0x91691b,null))[_0x1c1c('0x36')](handleError(_0x91691b,null));};exports[_0x1c1c('0x3b')]=function(_0x3be760,_0x1f14f7){if(_0x3be760[_0x1c1c('0x3c')][_0x1c1c('0x1d')]===_0x1c1c('0x16')&&!_[_0x1c1c('0x3d')](_0x3be760[_0x1c1c('0x3c')]['exten'],'_')){_0x3be760[_0x1c1c('0x3c')][_0x1c1c('0x3e')]='_'['concat'](_0x3be760[_0x1c1c('0x3c')][_0x1c1c('0x3e')]);}return db[_0x1c1c('0x38')][_0x1c1c('0x3b')](_0x3be760['body'],{'raw':![]})[_0x1c1c('0x1f')](function(_0xfaa987){var _0x28d217=_0x3be760[_0x1c1c('0x3f')][_0x1c1c('0x13')]({'plain':!![]});if(!_0x28d217)throw new Error(_0x1c1c('0x40'));if(_0x28d217[_0x1c1c('0x41')]===_0x1c1c('0x3f')){var _0x4c4475=_0xfaa987[_0x1c1c('0x13')]({'plain':!![]});var _0xeea40e=[{'name':_0x1c1c('0x14'),'value':'inbound'},{'name':_0x1c1c('0x15'),'value':_0x1c1c('0x16')},{'name':'InternalRoutes','value':_0x1c1c('0x17')}];var _0x262fe4=_['find'](_0xeea40e,[_0x1c1c('0x1a'),_0x4c4475[_0x1c1c('0x1d')]])[_0x1c1c('0x1e')];return db['UserProfileSection']['find']({'where':{'name':_0x262fe4,'userProfileId':_0x28d217['userProfileId']},'raw':!![]})[_0x1c1c('0x1f')](function(_0x3aa01b){if(_0x3aa01b&&_0x3aa01b[_0x1c1c('0x42')]===0x0){return db[_0x1c1c('0x43')][_0x1c1c('0x3b')]({'name':_0x4c4475[_0x1c1c('0x1e')],'resourceId':_0x4c4475['id'],'type':_0x3aa01b[_0x1c1c('0x1e')],'sectionId':_0x3aa01b['id']},{})['then'](function(){return _0xfaa987;});}else{return _0xfaa987;}})[_0x1c1c('0x36')](function(_0x47c6e6){logger[_0x1c1c('0x20')](_0x1c1c('0x44'),_0x47c6e6);throw _0x47c6e6;});}return _0xfaa987;})[_0x1c1c('0x1f')](respondWithResult(_0x1f14f7,0xc9))[_0x1c1c('0x36')](handleError(_0x1f14f7,null));};exports[_0x1c1c('0x45')]=function(_0x373254,_0x503f1a){if(_0x373254[_0x1c1c('0x3c')]['id']){delete _0x373254[_0x1c1c('0x3c')]['id'];}return db['VoiceExtension'][_0x1c1c('0x1c')]({'where':{'id':_0x373254[_0x1c1c('0x37')]['id']}})[_0x1c1c('0x1f')](handleEntityNotFound(_0x503f1a,null))[_0x1c1c('0x1f')](function(_0x4c32d9){if(_0x4c32d9){return db[_0x1c1c('0x38')][_0x1c1c('0x45')](_[_0x1c1c('0x46')](_0x373254[_0x1c1c('0x3c')],[_0x1c1c('0x3e'),_0x1c1c('0x47'),_0x1c1c('0x48'),_0x1c1c('0x49'),_0x1c1c('0x4a'),_0x1c1c('0x4b'),_0x1c1c('0x4c')]),{'where':{'context':_0x4c32d9[_0x1c1c('0x47')],'exten':_0x4c32d9[_0x1c1c('0x3e')]},'individualHooks':!![]})[_0x1c1c('0x1f')](function(_0x511dcd){return _0x511dcd;});}return null;})['then'](respondWithStatusCode(_0x503f1a,null))[_0x1c1c('0x36')](handleError(_0x503f1a,null));};exports['addApplications']=function(_0x328112,_0x4876fe){var _0x470e2c=_0x328112[_0x1c1c('0x37')]['id'];var _0x86d934=_0x328112[_0x1c1c('0x3c')];var _0xedcc37=0xc8;var _0x1ad2c3=null;return db[_0x1c1c('0x4d')][_0x1c1c('0x4e')]({'isolationLevel':db[_0x1c1c('0x4d')][_0x1c1c('0x4f')]['ISOLATION_LEVELS'][_0x1c1c('0x50')]},function(_0xb33e4d){return db[_0x1c1c('0x38')][_0x1c1c('0x51')]({'where':{'id':_0x470e2c},'transaction':_0xb33e4d})[_0x1c1c('0x1f')](function(_0x375490){if(_0x375490){return db['VoiceExtension'][_0x1c1c('0x12')]({'where':{'VoiceExtensionId':_0x470e2c},'transaction':_0xb33e4d})[_0x1c1c('0x1f')](function(){var _0x1ad66c=_[_0x1c1c('0x19')](_0x86d934,function(_0x35ba98){_0x35ba98['VoiceExtensionId']=_0x470e2c;_0x35ba98[_0x1c1c('0x52')]=!![];return _0x35ba98;});return _0x375490[_0x1c1c('0x53')](_0x1ad66c);})[_0x1c1c('0x1f')](function(_0x303845){return db[_0x1c1c('0x38')]['bulkCreate'](_0x303845,{'transaction':_0xb33e4d});});}else{_0xedcc37=0x194;_0x1ad2c3=[];}});})['then'](function(){if(_0xedcc37!==0x194){return db[_0x1c1c('0x38')][_0x1c1c('0x54')]({'where':{'isApp':!![],'VoiceExtensionId':_0x470e2c},'order':_0x1c1c('0x55')})['then'](function(_0x48bf2c){_0x1ad2c3=_0x48bf2c;});}})[_0x1c1c('0x36')](function(_0x52edb0){_0xedcc37=0x1f4;logger[_0x1c1c('0x20')](_0x52edb0['stack']);if(_0x52edb0[_0x1c1c('0x1e')]){delete _0x52edb0[_0x1c1c('0x1e')];}_0x1ad2c3=_0x52edb0;})['finally'](function(){if(_0x1ad2c3===null){_0x4876fe[_0x1c1c('0x9')](_0xedcc37);}else{if(_0xedcc37===0x1f4){_0x4876fe[_0x1c1c('0xf')](_0xedcc37)[_0x1c1c('0x56')](_0x1ad2c3);}else{_0x4876fe[_0x1c1c('0xf')](_0xedcc37)[_0x1c1c('0x11')](_0x1ad2c3);}}});}; \ No newline at end of file +var _0x5f4b=['get','InboundRoutes','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','context','description','addApplications','transaction','sequelize','Transaction','ISOLATION_LEVELS','findOne','VoiceExtensionId','createRouting','findAndCountAll','cast(priority\x20as\x20unsigned)','finally','ioredis','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','end','status','json','undefined','count','offset','limit','set','Content-Range','destroy','then','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','sendStatus','error','stack','send','index','VoiceExtension','fieldName','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','options','includeAll','include','findAll','show','params','keys','rawAttributes','catch','create','body','startsWith','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role'];(function(_0x3efd01,_0x4beea2){var _0x3ef038=function(_0x10de36){while(--_0x10de36){_0x3efd01['push'](_0x3efd01['shift']());}};_0x3ef038(++_0x4beea2);}(_0x5f4b,0x126));var _0xb5f4=function(_0x5ba0a4,_0x3850ab){_0x5ba0a4=_0x5ba0a4-0x0;var _0x525dc3=_0x5f4b[_0x5ba0a4];return _0x525dc3;};'use strict';var _=require('lodash');var Redis=require(_0xb5f4('0x0'));var qs=require('../../components/parsers/qs');var logger=require(_0xb5f4('0x1'))(_0xb5f4('0x2'));var config=require(_0xb5f4('0x3'));var db=require(_0xb5f4('0x4'))['db'];config[_0xb5f4('0x5')]=_[_0xb5f4('0x6')](config[_0xb5f4('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5f4('0x7'))(new Redis(config[_0xb5f4('0x5')]));require(_0xb5f4('0x8'))[_0xb5f4('0x9')](socket);function respondWithStatusCode(_0x3744b1,_0x49d2af){_0x49d2af=_0x49d2af||0xcc;return function(_0x3b3c55){if(_0x3b3c55){return _0x3744b1['sendStatus'](_0x49d2af);}return _0x3744b1['status'](_0x49d2af)[_0xb5f4('0xa')]();};}function respondWithResult(_0x4d0faf,_0x58f19c){_0x58f19c=_0x58f19c||0xc8;return function(_0x24915a){if(_0x24915a){return _0x4d0faf[_0xb5f4('0xb')](_0x58f19c)[_0xb5f4('0xc')](_0x24915a);}};}function respondWithFilteredResult(_0x23341f,_0x1a94aa){return function(_0x4546db){if(_0x4546db){var _0x23bf03=typeof _0x1a94aa['offset']===_0xb5f4('0xd')&&typeof _0x1a94aa['limit']===_0xb5f4('0xd');var _0x296470=_0x4546db[_0xb5f4('0xe')];var _0x4ec3ff=_0x23bf03?0x0:_0x1a94aa['offset'];var _0x365911=_0x23bf03?_0x4546db[_0xb5f4('0xe')]:_0x1a94aa[_0xb5f4('0xf')]+_0x1a94aa[_0xb5f4('0x10')];var _0x2f2599;if(_0x365911>=_0x296470){_0x365911=_0x296470;_0x2f2599=0xc8;}else{_0x2f2599=0xce;}_0x23341f['status'](_0x2f2599);return _0x23341f[_0xb5f4('0x11')](_0xb5f4('0x12'),_0x4ec3ff+'-'+_0x365911+'/'+_0x296470)[_0xb5f4('0xc')](_0x4546db);}return null;};}function removeEntity(_0x155d0f){return function(_0x37179c){if(_0x37179c){return _0x37179c[_0xb5f4('0x13')]()[_0xb5f4('0x14')](function(){var _0x552cb7=_0x37179c['get']({'plain':!![]});var _0x44bc5a=[{'name':'InboundRoutes','value':_0xb5f4('0x15'),'ignore':![]},{'name':_0xb5f4('0x16'),'value':_0xb5f4('0x17'),'ignore':![]},{'name':_0xb5f4('0x18'),'value':_0xb5f4('0x19'),'ignore':![]}];var _0x46b2fd=_(_0x44bc5a)[_0xb5f4('0x1a')](_0xb5f4('0x1b'))[_0xb5f4('0x1c')](_0xb5f4('0x1d'))[_0xb5f4('0x1d')]();if(_[_0xb5f4('0x1e')](_0x46b2fd,_0x552cb7[_0xb5f4('0x1f')])){return;}var _0x3a52a2=_[_0xb5f4('0x20')](_0x44bc5a,[_0xb5f4('0x1d'),_0x552cb7[_0xb5f4('0x1f')]])[_0xb5f4('0x21')];return db['UserProfileResource'][_0xb5f4('0x13')]({'where':{'type':_0x3a52a2,'resourceId':_0x552cb7['id']}})['then'](function(){return _0x37179c;});})['then'](function(){_0x155d0f[_0xb5f4('0xb')](0xcc)[_0xb5f4('0xa')]();});}};}function handleEntityNotFound(_0x6c8fcb){return function(_0x4bf148){if(!_0x4bf148){_0x6c8fcb[_0xb5f4('0x22')](0x194);}return _0x4bf148;};}function handleError(_0x1fb5f9,_0x3a9b55){_0x3a9b55=_0x3a9b55||0x1f4;return function(_0x543930){logger[_0xb5f4('0x23')](_0x543930[_0xb5f4('0x24')]);if(_0x543930['name']){delete _0x543930[_0xb5f4('0x21')];}_0x1fb5f9['status'](_0x3a9b55)[_0xb5f4('0x25')](_0x543930);};}exports[_0xb5f4('0x26')]=function(_0x1004f5,_0x44d4e3){var _0x54aadb={},_0x3d2dc7={},_0x2be6db={'count':0x0,'rows':[]};var _0x64ef4=_['map'](db[_0xb5f4('0x27')]['rawAttributes'],function(_0x50611d){return{'name':_0x50611d[_0xb5f4('0x28')],'type':_0x50611d[_0xb5f4('0x1f')]['key']};});_0x3d2dc7[_0xb5f4('0x29')]=_[_0xb5f4('0x1c')](_0x64ef4,_0xb5f4('0x21'));_0x3d2dc7[_0xb5f4('0x2a')]=_['keys'](_0x1004f5['query']);_0x3d2dc7[_0xb5f4('0x2b')]=_[_0xb5f4('0x2c')](_0x3d2dc7['model'],_0x3d2dc7[_0xb5f4('0x2a')]);_0x54aadb[_0xb5f4('0x2d')]=_[_0xb5f4('0x2c')](_0x3d2dc7['model'],qs[_0xb5f4('0x2e')](_0x1004f5[_0xb5f4('0x2a')]['fields']));_0x54aadb[_0xb5f4('0x2d')]=_0x54aadb[_0xb5f4('0x2d')][_0xb5f4('0x2f')]?_0x54aadb[_0xb5f4('0x2d')]:_0x3d2dc7[_0xb5f4('0x29')];if(!_0x1004f5[_0xb5f4('0x2a')]['hasOwnProperty'](_0xb5f4('0x30'))){_0x54aadb[_0xb5f4('0x10')]=qs['limit'](_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0x10')]);_0x54aadb[_0xb5f4('0xf')]=qs[_0xb5f4('0xf')](_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0xf')]);}_0x54aadb[_0xb5f4('0x31')]=qs[_0xb5f4('0x32')](_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0x32')]);_0x54aadb[_0xb5f4('0x33')]=qs[_0xb5f4('0x2b')](_[_0xb5f4('0x34')](_0x1004f5[_0xb5f4('0x2a')],_0x3d2dc7[_0xb5f4('0x2b')]),_0x64ef4);if(_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0x1a')]){_0x54aadb['where']=_[_0xb5f4('0x35')](_0x54aadb[_0xb5f4('0x33')],{'$or':_[_0xb5f4('0x1c')](_0x64ef4,function(_0x3a2ed8){if(_0x3a2ed8['type']!=='VIRTUAL'){var _0x33f70a={};_0x33f70a[_0x3a2ed8[_0xb5f4('0x21')]]={'$like':'%'+_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0x1a')]+'%'};return _0x33f70a;}})});}_0x54aadb=_[_0xb5f4('0x35')]({},_0x54aadb,_0x1004f5[_0xb5f4('0x36')]);var _0x5ad9ee={'where':_0x54aadb[_0xb5f4('0x33')]};return db[_0xb5f4('0x27')][_0xb5f4('0xe')](_0x5ad9ee)[_0xb5f4('0x14')](function(_0x1c793f){_0x2be6db[_0xb5f4('0xe')]=_0x1c793f;if(_0x1004f5[_0xb5f4('0x2a')][_0xb5f4('0x37')]){_0x54aadb[_0xb5f4('0x38')]=[{'all':!![]}];}return db[_0xb5f4('0x27')][_0xb5f4('0x39')](_0x54aadb);})[_0xb5f4('0x14')](function(_0x3f61c2){_0x2be6db['rows']=_0x3f61c2;return _0x2be6db;})[_0xb5f4('0x14')](respondWithFilteredResult(_0x44d4e3,_0x54aadb))['catch'](handleError(_0x44d4e3,null));};exports[_0xb5f4('0x3a')]=function(_0x4bea31,_0x42b9fa){var _0x4459f9={'raw':![],'where':{'id':_0x4bea31[_0xb5f4('0x3b')]['id']}},_0x1880af={};_0x1880af[_0xb5f4('0x29')]=_[_0xb5f4('0x3c')](db[_0xb5f4('0x27')][_0xb5f4('0x3d')]);_0x1880af[_0xb5f4('0x2a')]=_[_0xb5f4('0x3c')](_0x4bea31[_0xb5f4('0x2a')]);_0x1880af['filters']=_[_0xb5f4('0x2c')](_0x1880af[_0xb5f4('0x29')],_0x1880af[_0xb5f4('0x2a')]);_0x4459f9[_0xb5f4('0x2d')]=_['intersection'](_0x1880af[_0xb5f4('0x29')],qs[_0xb5f4('0x2e')](_0x4bea31[_0xb5f4('0x2a')]['fields']));_0x4459f9['attributes']=_0x4459f9['attributes'][_0xb5f4('0x2f')]?_0x4459f9[_0xb5f4('0x2d')]:_0x1880af[_0xb5f4('0x29')];if(_0x4bea31['query'][_0xb5f4('0x37')]){_0x4459f9[_0xb5f4('0x38')]=[{'all':!![]}];}_0x4459f9=_[_0xb5f4('0x35')]({},_0x4459f9,_0x4bea31[_0xb5f4('0x36')]);return db[_0xb5f4('0x27')][_0xb5f4('0x20')](_0x4459f9)[_0xb5f4('0x14')](handleEntityNotFound(_0x42b9fa,null))['then'](respondWithResult(_0x42b9fa,null))[_0xb5f4('0x3e')](handleError(_0x42b9fa,null));};exports[_0xb5f4('0x13')]=function(_0x1a1e63,_0x5c7c57){return db['VoiceExtension']['find']({'where':{'id':_0x1a1e63[_0xb5f4('0x3b')]['id']}})[_0xb5f4('0x14')](handleEntityNotFound(_0x5c7c57,null))['then'](removeEntity(_0x5c7c57,null))[_0xb5f4('0x3e')](handleError(_0x5c7c57,null));};exports[_0xb5f4('0x3f')]=function(_0x50c015,_0x251d8a){if(_0x50c015[_0xb5f4('0x40')][_0xb5f4('0x1f')]===_0xb5f4('0x17')&&!_[_0xb5f4('0x41')](_0x50c015[_0xb5f4('0x40')]['exten'],'_')){_0x50c015[_0xb5f4('0x40')][_0xb5f4('0x42')]='_'[_0xb5f4('0x43')](_0x50c015['body'][_0xb5f4('0x42')]);}return db[_0xb5f4('0x27')]['create'](_0x50c015[_0xb5f4('0x40')],{'raw':![]})[_0xb5f4('0x14')](function(_0x4ece21){var _0x180efc=_0x50c015['user']['get']({'plain':!![]});if(!_0x180efc)throw new Error(_0xb5f4('0x44'));if(_0x180efc[_0xb5f4('0x45')]==='user'){var _0x57e7d5=_0x4ece21[_0xb5f4('0x46')]({'plain':!![]});var _0x11b258=[{'name':_0xb5f4('0x47'),'value':'inbound'},{'name':_0xb5f4('0x16'),'value':_0xb5f4('0x17')},{'name':_0xb5f4('0x18'),'value':'internal'}];var _0x117134=_[_0xb5f4('0x20')](_0x11b258,[_0xb5f4('0x1d'),_0x57e7d5[_0xb5f4('0x1f')]])[_0xb5f4('0x21')];return db[_0xb5f4('0x48')]['find']({'where':{'name':_0x117134,'userProfileId':_0x180efc[_0xb5f4('0x49')]},'raw':!![]})[_0xb5f4('0x14')](function(_0x369a92){if(_0x369a92&&_0x369a92[_0xb5f4('0x4a')]===0x0){return db[_0xb5f4('0x4b')][_0xb5f4('0x3f')]({'name':_0x57e7d5[_0xb5f4('0x21')],'resourceId':_0x57e7d5['id'],'type':_0x369a92[_0xb5f4('0x21')],'sectionId':_0x369a92['id']},{})[_0xb5f4('0x14')](function(){return _0x4ece21;});}else{return _0x4ece21;}})[_0xb5f4('0x3e')](function(_0x5ea928){logger[_0xb5f4('0x23')](_0xb5f4('0x4c'),_0x5ea928);throw _0x5ea928;});}return _0x4ece21;})['then'](respondWithResult(_0x251d8a,0xc9))['catch'](handleError(_0x251d8a,null));};exports[_0xb5f4('0x4d')]=function(_0x527b94,_0x32748b){if(_0x527b94[_0xb5f4('0x40')]['id']){delete _0x527b94[_0xb5f4('0x40')]['id'];}return db['VoiceExtension'][_0xb5f4('0x20')]({'where':{'id':_0x527b94['params']['id']}})[_0xb5f4('0x14')](handleEntityNotFound(_0x32748b,null))['then'](function(_0x3df61e){if(_0x3df61e){return db[_0xb5f4('0x27')][_0xb5f4('0x4d')](_[_0xb5f4('0x34')](_0x527b94[_0xb5f4('0x40')],['exten',_0xb5f4('0x4e'),_0xb5f4('0x4f'),'recordingFormat','cutdigits','mandatoryDisposition','alias']),{'where':{'context':_0x3df61e['context'],'exten':_0x3df61e[_0xb5f4('0x42')]},'individualHooks':!![]})[_0xb5f4('0x14')](function(_0x507902){return _0x507902;});}return null;})[_0xb5f4('0x14')](respondWithStatusCode(_0x32748b,null))[_0xb5f4('0x3e')](handleError(_0x32748b,null));};exports[_0xb5f4('0x50')]=function(_0x28fbde,_0x2013b1){var _0xeb1562=_0x28fbde['params']['id'];var _0x34e94b=_0x28fbde[_0xb5f4('0x40')];var _0x2431dc=0xc8;var _0x5f3117=null;return db['sequelize'][_0xb5f4('0x51')]({'isolationLevel':db[_0xb5f4('0x52')][_0xb5f4('0x53')][_0xb5f4('0x54')]['READ_COMMITTED']},function(_0x32d3ed){return db[_0xb5f4('0x27')][_0xb5f4('0x55')]({'where':{'id':_0xeb1562},'transaction':_0x32d3ed})[_0xb5f4('0x14')](function(_0x297e45){if(_0x297e45){return db['VoiceExtension'][_0xb5f4('0x13')]({'where':{'VoiceExtensionId':_0xeb1562},'transaction':_0x32d3ed})['then'](function(){var _0x62c0d3=_[_0xb5f4('0x1c')](_0x34e94b,function(_0x5f30a2){_0x5f30a2[_0xb5f4('0x56')]=_0xeb1562;_0x5f30a2['isApp']=!![];return _0x5f30a2;});return _0x297e45[_0xb5f4('0x57')](_0x62c0d3);})[_0xb5f4('0x14')](function(_0x304c29){return db[_0xb5f4('0x27')]['bulkCreate'](_0x304c29,{'transaction':_0x32d3ed});});}else{_0x2431dc=0x194;_0x5f3117=[];}});})[_0xb5f4('0x14')](function(){if(_0x2431dc!==0x194){return db[_0xb5f4('0x27')][_0xb5f4('0x58')]({'where':{'isApp':!![],'VoiceExtensionId':_0xeb1562},'order':_0xb5f4('0x59')})[_0xb5f4('0x14')](function(_0x42bbd0){_0x5f3117=_0x42bbd0;});}})[_0xb5f4('0x3e')](function(_0x1d385f){_0x2431dc=0x1f4;logger['error'](_0x1d385f['stack']);if(_0x1d385f[_0xb5f4('0x21')]){delete _0x1d385f['name'];}_0x5f3117=_0x1d385f;})[_0xb5f4('0x5a')](function(){if(_0x5f3117===null){_0x2013b1[_0xb5f4('0x22')](_0x2431dc);}else{if(_0x2431dc===0x1f4){_0x2013b1['status'](_0x2431dc)['send'](_0x5f3117);}else{_0x2013b1[_0xb5f4('0xb')](_0x2431dc)[_0xb5f4('0xc')](_0x5f3117);}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 478728c..8de0e8e 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 _0x4fe4=['emit','hasOwnProperty','exports','events','../../mysqldb','VoiceExtension','setMaxListeners','save','update','remove'];(function(_0x1eb16b,_0x367acc){var _0x20500b=function(_0x29fa4f){while(--_0x29fa4f){_0x1eb16b['push'](_0x1eb16b['shift']());}};_0x20500b(++_0x367acc);}(_0x4fe4,0x161));var _0x44fe=function(_0x4b33c0,_0x17fb55){_0x4b33c0=_0x4b33c0-0x0;var _0x43c889=_0x4fe4[_0x4b33c0];return _0x43c889;};'use strict';var EventEmitter=require(_0x44fe('0x0'));var VoiceExtension=require(_0x44fe('0x1'))['db'][_0x44fe('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x44fe('0x3')](0x0);var events={'afterCreate':_0x44fe('0x4'),'afterUpdate':_0x44fe('0x5'),'afterDestroy':_0x44fe('0x6')};function emitEvent(_0x41c65f){return function(_0x35381e,_0x1c9dc6,_0x45e0cc){VoiceExtensionEvents[_0x44fe('0x7')](_0x41c65f+':'+_0x35381e['id'],_0x35381e);VoiceExtensionEvents[_0x44fe('0x7')](_0x41c65f,_0x35381e);_0x45e0cc(null);};}for(var e in events){if(events[_0x44fe('0x8')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x44fe('0x9')]=VoiceExtensionEvents; \ No newline at end of file +var _0x63b3=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x46b838,_0x2fea63){var _0x218789=function(_0x338370){while(--_0x338370){_0x46b838['push'](_0x46b838['shift']());}};_0x218789(++_0x2fea63);}(_0x63b3,0x84));var _0x363b=function(_0x54ef4f,_0x15b05e){_0x54ef4f=_0x54ef4f-0x0;var _0x20b6c0=_0x63b3[_0x54ef4f];return _0x20b6c0;};'use strict';var EventEmitter=require(_0x363b('0x0'));var VoiceExtension=require(_0x363b('0x1'))['db'][_0x363b('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x363b('0x3'),'afterUpdate':'update','afterDestroy':_0x363b('0x4')};function emitEvent(_0x3cc1eb){return function(_0x4c8dd1,_0x1d1055,_0x664cb5){VoiceExtensionEvents[_0x363b('0x5')](_0x3cc1eb+':'+_0x4c8dd1['id'],_0x4c8dd1);VoiceExtensionEvents[_0x363b('0x5')](_0x3cc1eb,_0x4c8dd1);_0x664cb5(null);};}for(var e in events){if(events[_0x363b('0x6')](e)){var event=events[e];VoiceExtension[_0x363b('0x7')](e,emitEvent(event));}}module[_0x363b('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 d634873..4f246d1 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 _0xe314=['wav','trunk','timeout','split','length','name','phone','param','prefix','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','IntervalId','*,*,*,*','intervals','interval','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','answer','queue','playback','includes','app','appType','custom','XCALLY-MOTION-ANSWER=1',',${EXTEN},','outboundDial','appdata','priority','last','concat','catch','get','./voiceExtension.attributes','exports','models','type','context','exten','alias','Set','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','CDR(type)=outbound','outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT='];(function(_0x43bb78,_0x2440b7){var _0xf57d5=function(_0x557a6d){while(--_0x557a6d){_0x43bb78['push'](_0x43bb78['shift']());}};_0xf57d5(++_0x2440b7);}(_0xe314,0x7c));var _0x4e31=function(_0x46eb99,_0x372ac6){_0x46eb99=_0x46eb99-0x0;var _0x18352a=_0xe314[_0x46eb99];return _0x18352a;};'use strict';var _=require('lodash');var attributes=require(_0x4e31('0x0'));module[_0x4e31('0x1')]=function(_0x2ee0be){var _0xc8a121=_0x2ee0be[_0x4e31('0x2')];function _0x21e52f(_0x37c1b1){var _0x13b7fa=0x2;var _0x63cecc=[{'type':_0x37c1b1[_0x4e31('0x3')],'app':'Set','appdata':'CDR(type)='+_0x37c1b1[_0x4e31('0x3')],'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x37c1b1[_0x4e31('0x6')]?_0x4e31('0x7'):'NoOp','appdata':_0x37c1b1[_0x4e31('0x6')]?_0x4e31('0x8')+_0x37c1b1[_0x4e31('0x6')]:_0x4e31('0x9'),'context':_0x37c1b1['context'],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']}];if(_0x37c1b1[_0x4e31('0x3')]===_0x4e31('0xa')){_0x63cecc[_0x4e31('0xb')]({'type':_0x4e31('0xa'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0xc')+_0x37c1b1['id'],'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']});}_0x63cecc[_0x4e31('0xb')]({'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x4e31('0x7'),'appdata':_0x4e31('0xd'),'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':_0x4e31('0x7'),'appdata':_0x4e31('0xe'),'context':_0x37c1b1['context'],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']},{'type':_0x37c1b1[_0x4e31('0x3')],'app':'Set','appdata':_0x4e31('0xf'),'context':_0x37c1b1[_0x4e31('0x4')],'exten':_0x37c1b1[_0x4e31('0x5')],'priority':_0x13b7fa++,'VoiceExtensionId':_0x37c1b1['id']});return _0x63cecc;}function _0x56cfc7(_0x3f9244){var _0x14a367=0x2;var _0x37e9e1=[{'type':'outbound','app':_0x4e31('0x7'),'appdata':_0x4e31('0x10'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x3f9244[_0x4e31('0x6')]?'Set':'NoOp','appdata':_0x3f9244[_0x4e31('0x6')]?_0x4e31('0x8')+_0x3f9244[_0x4e31('0x6')]:_0x4e31('0x9'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':'Set','appdata':_0x4e31('0x12')+(_0x3f9244[_0x4e31('0x13')]?_0x4e31('0x14')+_0x3f9244['cutdigits']+'}':_0x4e31('0x15')),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':'CDR(routeid)='+_0x3f9244['id'],'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':'ExecIf','appdata':_0x4e31('0x16')+(_0x14a367+0x2)+_0x4e31('0x17')+(_0x14a367+0x1)+')','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x3f9244[_0x4e31('0x13')]?_0x4e31('0x18')+_0x3f9244[_0x4e31('0x13')]+'}':_0x4e31('0x19'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-ANSWER=0','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':'outbound','app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':'outbound','app':_0x4e31('0x7'),'appdata':_0x4e31('0xf'),'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1a')+_0x3f9244['id'],'context':_0x3f9244[_0x4e31('0x4')],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']}];if(_0x3f9244[_0x4e31('0x1b')]('recordingFormat')&&_0x3f9244[_0x4e31('0x1c')]!==_0x4e31('0x1d')){_0x37e9e1['push']({'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1e'),'context':_0x3f9244['context'],'exten':_0x3f9244[_0x4e31('0x5')],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']},{'type':_0x4e31('0x11'),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x1f')+_0x3f9244['recordingFormat']||_0x4e31('0x20'),'context':_0x3f9244['context'],'exten':_0x3f9244['exten'],'priority':_0x14a367++,'VoiceExtensionId':_0x3f9244['id']});}return _0x37e9e1;}function _0xf511d6(_0x3557b7,_0x5c2dcb){var _0x4d82cc=[{'name':_0x4e31('0x21'),'param':0x0},{'name':_0x4e31('0x22'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x1896c0={};var _0x1910d4=_0x5c2dcb[_0x4e31('0x23')](',');var _0x34f11f=[];for(var _0x516281=0x0;_0x516281<_0x4d82cc[_0x4e31('0x24')];_0x516281++){switch(_0x4d82cc[_0x516281][_0x4e31('0x25')]){case _0x4e31('0x21'):_0x1896c0['trunk']=_0x1910d4[_0x4d82cc[_0x516281]['param']][_0x4e31('0x23')]('/')[0x1];_0x1896c0[_0x4e31('0x26')]=_0x1910d4[_0x4d82cc[_0x516281][_0x4e31('0x27')]][_0x4e31('0x23')]('/')[0x2];_0x1896c0[_0x4e31('0x28')]=_0x1896c0[_0x4e31('0x26')]?_0x1896c0[_0x4e31('0x26')][_0x4e31('0x23')]('$')[0x0]:undefined;_0x1896c0[_0x4e31('0x26')]=_0x3557b7[_0x4e31('0x13')]?(_0x1896c0[_0x4e31('0x28')]||'')+_0x4e31('0x14')+_0x3557b7['cutdigits']+'}':(_0x1896c0[_0x4e31('0x28')]||'')+'${EXTEN}';_0x34f11f[_0x4d82cc[_0x516281][_0x4e31('0x27')]]=[_0x4e31('0x29'),_0x1896c0[_0x4e31('0x21')],_0x1896c0['phone']][_0x4e31('0x2a')]('/');break;case _0x4e31('0x2b'):_0x1896c0[_0x4e31('0x2b')]=_0x1910d4[_0x4d82cc[_0x516281][_0x4e31('0x27')]];if(_0x3557b7[_0x4e31('0x1c')]!=='none'){if(_0x1896c0[_0x4e31('0x2b')][_0x4e31('0x2c')](_0x4e31('0x2d'))<0x0){_0x1896c0['options']+=_0x4e31('0x2d');}}else{_0x1896c0[_0x4e31('0x2b')]=_0x1896c0['options'][_0x4e31('0x2e')](_0x4e31('0x2d'),'');}_0x34f11f[_0x4d82cc[_0x516281]['param']]=_0x1896c0['options'];break;default:_0x34f11f[_0x4d82cc[_0x516281][_0x4e31('0x27')]]=_0x1910d4[_0x4d82cc[_0x516281]['param']];}}return _0x34f11f['join'](',');}function _0xde6c49(_0x42b980,_0x4619ee,_0x3a5fa4){return new Promise(function(_0x57794d,_0x31fd13){var _0x4f9934=[];if(_[_0x4e31('0x2f')](_0x4619ee))return _0x57794d(_0x4f9934);_0xc8a121[_0x4e31('0x30')][_0x4e31('0x31')]({'attributes':['id','interval',_0x4e31('0x32')],'raw':!![]})['then'](function(_0x1f98e8){for(var _0x178a8f=0x0,_0x58c236=0x0;_0x178a8f<_0x4619ee[_0x4e31('0x24')];_0x178a8f++,_0x58c236=0x0){var _0x1aac8a=_0x4619ee[_0x178a8f];var _0x4a73e7=[];var _0x1211a5=[];delete _0x1aac8a['id'];if(_0x1aac8a['interval']!==_0x4e31('0x33')){_0x1aac8a[_0x4e31('0x34')]=[_0x1aac8a[_0x4e31('0x35')]];}else{_0x1aac8a[_0x4e31('0x34')]=_0x1aac8a['IntervalId']?_['map'](_[_0x4e31('0x36')](_0x1f98e8,{'IntervalId':_0x1aac8a[_0x4e31('0x32')]}),'interval'):[];}_0x1aac8a[_0x4e31('0x4')]=_0x42b980[_0x4e31('0x4')];_0x1aac8a['exten']=_0x42b980[_0x4e31('0x5')];if(_0x1aac8a[_0x4e31('0x3')])_0x1aac8a[_0x4e31('0x3')]=_0x1aac8a['type'][_0x4e31('0x37')]();if(_0x42b980['type']===_0x4e31('0x11')){if(_0x1aac8a[_0x4e31('0x1b')](_0x4e31('0x38'))&&_0x1aac8a['tag']&&_0x1aac8a[_0x4e31('0x38')]!=='--'){_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x7'),'appdata':_0x4e31('0x39')+_0x1aac8a[_0x4e31('0x38')],'context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a['intervals'][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}_0x4a73e7['push']({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x3a'),'appdata':_0x4e31('0x3b')+(_0x1aac8a['callerID']?_0x4e31('0x3c')+_0x1aac8a['callerID']+')':_0x4e31('0x3d')),'context':_0x42b980['context'],'exten':_0x42b980['exten'],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}else{if(_0x1aac8a[_0x4e31('0x1b')](_0x4e31('0x3e'))){if([_0x4e31('0x3f'),_0x4e31('0x40')][_0x4e31('0x41')](_0x1aac8a[_0x4e31('0x42')][_0x4e31('0x37')]())&&_0x1aac8a[_0x4e31('0x43')]!==_0x4e31('0x44')){if(_0x1aac8a[_0x4e31('0x3e')]){_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x3a'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x42b980['context'],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});_0x4a73e7['push']({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':'Set','appdata':_0x4e31('0x45'),'context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}else{_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':'ExecIf','appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});_0x4a73e7[_0x4e31('0xb')]({'type':_0x1aac8a[_0x4e31('0x3')][_0x4e31('0x37')](),'app':_0x4e31('0x7'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x42b980[_0x4e31('0x4')],'exten':_0x42b980[_0x4e31('0x5')],'priority':_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]+_0x3a5fa4+_0x58c236++,'VoiceExtensionId':_0x42b980['id']});}}}}for(var _0x505a02=0x0;_0x505a02<_0x1aac8a[_0x4e31('0x34')]['length'];_0x505a02++){var _0x6b536=_0x3a5fa4+_0x1aac8a[_0x4e31('0x34')]['length'];var _0x4b5682=_0x505a02===_0x1aac8a[_0x4e31('0x34')][_0x4e31('0x24')]-0x1?_0x3a5fa4+_0x4a73e7[_0x4e31('0x24')]+_0x1211a5['length']+0x2:_0x3a5fa4+_0x505a02+0x1;_0x4a73e7['splice'](_0x505a02,0x0,{'type':_0x42b980[_0x4e31('0x3')],'app':'GotoIfTime','appdata':_0x1aac8a[_0x4e31('0x34')][_0x505a02]+'?'+_0x42b980['context']+',${EXTEN},'+_0x6b536+':'+_0x42b980['context']+_0x4e31('0x46')+_0x4b5682,'exten':_0x42b980['exten'],'context':_0x42b980[_0x4e31('0x4')],'priority':_0x3a5fa4+_0x505a02,'VoiceExtensionId':_0x42b980['id']});}if(_0x1aac8a['appType']===_0x4e31('0x47'))_0x1aac8a[_0x4e31('0x48')]=_0xf511d6(_0x42b980,_0x1aac8a['appdata']);_0x1aac8a[_0x4e31('0x49')]=_0x4a73e7['length']?_[_0x4e31('0x4a')](_0x4a73e7)['priority']+0x1:_0x3a5fa4;_0x4f9934=_[_0x4e31('0x4b')](_0x4f9934,_0x4a73e7,[_0x1aac8a],_0x1211a5);_0x3a5fa4=_[_0x4e31('0x4a')](_0x4f9934)[_0x4e31('0x49')]+0x1;}return _0x57794d(_0x4f9934);})[_0x4e31('0x4c')](function(_0x1818ce){_0x31fd13(_0x1818ce);});});}return _0x2ee0be['define']('VoiceExtension',attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xdd72cd){var _0x13a690=this[_0x4e31('0x4d')]({'plain':!![]});var _0x25735e=_0x13a690[_0x4e31('0x3')]===_0x4e31('0x11')?_0x56cfc7(_0x13a690):_0x21e52f(_0x13a690);return _0xde6c49(_0x13a690,_0xdd72cd,_[_0x4e31('0x4a')](_0x25735e)[_0x4e31('0x49')]+0x1)['then'](function(_0x51bf79){var _0x57e542=_[_0x4e31('0x4b')](_0x25735e,_0x51bf79);_0x57e542[_0x4e31('0xb')]({'type':_0x13a690[_0x4e31('0x3')],'app':'Hangup','exten':_0x13a690[_0x4e31('0x5')],'context':_0x13a690[_0x4e31('0x4')],'priority':_[_0x4e31('0x4a')](_0x57e542)['priority']+0x1,'VoiceExtensionId':_0x13a690['id']});return _0x57e542;});}}});}; \ No newline at end of file +var _0x4cfd=['CDR(prefix)=${EXTEN:0:','outboundrouteid=','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','trunk','timeout','options','url','length','param','split','phone','prefix','SIP','none','U(xcally-mixmonitor-context)','replace','isEmpty','Interval','findAll','interval','then','*,*,*,*','intervals','IntervalId','filter','toLowerCase','tag','CDR(tag)=','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','queue','playback','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','appType','outboundDial','appdata','priority','last','concat','VoiceExtension','voice_extensions','get','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','cutdigits','${EXTEN:','${EXTEN}'];(function(_0x172c08,_0x422e49){var _0x569a8a=function(_0x1d8005){while(--_0x1d8005){_0x172c08['push'](_0x172c08['shift']());}};_0x569a8a(++_0x422e49);}(_0x4cfd,0x170));var _0xd4cf=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x4cfd[_0x3a7a9c];return _0x59156e;};'use strict';var _=require(_0xd4cf('0x0'));var attributes=require(_0xd4cf('0x1'));module['exports']=function(_0x4072d3){var _0x356001=_0x4072d3[_0xd4cf('0x2')];function _0x407d96(_0x332f55){var _0xe90497=0x2;var _0x4e6f40=[{'type':_0x332f55[_0xd4cf('0x3')],'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x5')+_0x332f55[_0xd4cf('0x3')],'context':_0x332f55[_0xd4cf('0x6')],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']},{'type':_0x332f55['type'],'app':_0x332f55[_0xd4cf('0x8')]?_0xd4cf('0x4'):_0xd4cf('0x9'),'appdata':_0x332f55[_0xd4cf('0x8')]?_0xd4cf('0xa')+_0x332f55[_0xd4cf('0x8')]:_0xd4cf('0xb'),'context':_0x332f55['context'],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']}];if(_0x332f55[_0xd4cf('0x3')]===_0xd4cf('0xc')){_0x4e6f40[_0xd4cf('0xd')]({'type':_0xd4cf('0xc'),'app':'Set','appdata':'CDR(routeid)='+_0x332f55['id'],'context':_0x332f55[_0xd4cf('0x6')],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']});}_0x4e6f40['push']({'type':_0x332f55[_0xd4cf('0x3')],'app':'Set','appdata':_0xd4cf('0xe'),'context':_0x332f55['context'],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']},{'type':_0x332f55[_0xd4cf('0x3')],'app':'Set','appdata':_0xd4cf('0xf'),'context':_0x332f55[_0xd4cf('0x6')],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']},{'type':_0x332f55[_0xd4cf('0x3')],'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x10'),'context':_0x332f55['context'],'exten':_0x332f55[_0xd4cf('0x7')],'priority':_0xe90497++,'VoiceExtensionId':_0x332f55['id']});return _0x4e6f40;}function _0x1769e6(_0x2fa4b3){var _0x11b06a=0x2;var _0x8c327a=[{'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x12'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':_0x2fa4b3[_0xd4cf('0x8')]?_0xd4cf('0x4'):_0xd4cf('0x9'),'appdata':_0x2fa4b3[_0xd4cf('0x8')]?_0xd4cf('0xa')+_0x2fa4b3[_0xd4cf('0x8')]:_0xd4cf('0xb'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3['exten'],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':'Set','appdata':'CDR(destination)='+(_0x2fa4b3[_0xd4cf('0x13')]?_0xd4cf('0x14')+_0x2fa4b3[_0xd4cf('0x13')]+'}':_0xd4cf('0x15')),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':'outbound','app':_0xd4cf('0x4'),'appdata':'CDR(routeid)='+_0x2fa4b3['id'],'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':'ExecIf','appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x11b06a+0x2)+'):Goto('+(_0x11b06a+0x1)+')','context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':'outbound','app':'Set','appdata':_0x2fa4b3['cutdigits']?_0xd4cf('0x16')+_0x2fa4b3['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x2fa4b3['context'],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':'outbound','app':_0xd4cf('0x4'),'appdata':_0xd4cf('0xe'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0xf'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3['exten'],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x10'),'context':_0x2fa4b3['context'],'exten':_0x2fa4b3['exten'],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x17')+_0x2fa4b3['id'],'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']}];if(_0x2fa4b3[_0xd4cf('0x18')](_0xd4cf('0x19'))&&_0x2fa4b3[_0xd4cf('0x19')]!=='none'){_0x8c327a[_0xd4cf('0xd')]({'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x1a'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']},{'type':_0xd4cf('0x11'),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x1b')+_0x2fa4b3[_0xd4cf('0x19')]||_0xd4cf('0x1c'),'context':_0x2fa4b3[_0xd4cf('0x6')],'exten':_0x2fa4b3[_0xd4cf('0x7')],'priority':_0x11b06a++,'VoiceExtensionId':_0x2fa4b3['id']});}return _0x8c327a;}function _0x4b7399(_0x54a6c2,_0x313a5a){var _0x3a1ea2=[{'name':_0xd4cf('0x1d'),'param':0x0},{'name':_0xd4cf('0x1e'),'param':0x1},{'name':_0xd4cf('0x1f'),'param':0x2},{'name':_0xd4cf('0x20'),'param':0x3}];var _0x3ffc93={};var _0x277106=_0x313a5a['split'](',');var _0x30dcfc=[];for(var _0x2b1a48=0x0;_0x2b1a48<_0x3a1ea2[_0xd4cf('0x21')];_0x2b1a48++){switch(_0x3a1ea2[_0x2b1a48]['name']){case'trunk':_0x3ffc93[_0xd4cf('0x1d')]=_0x277106[_0x3a1ea2[_0x2b1a48][_0xd4cf('0x22')]][_0xd4cf('0x23')]('/')[0x1];_0x3ffc93[_0xd4cf('0x24')]=_0x277106[_0x3a1ea2[_0x2b1a48]['param']][_0xd4cf('0x23')]('/')[0x2];_0x3ffc93[_0xd4cf('0x25')]=_0x3ffc93[_0xd4cf('0x24')]?_0x3ffc93[_0xd4cf('0x24')]['split']('$')[0x0]:undefined;_0x3ffc93['phone']=_0x54a6c2['cutdigits']?(_0x3ffc93[_0xd4cf('0x25')]||'')+_0xd4cf('0x14')+_0x54a6c2[_0xd4cf('0x13')]+'}':(_0x3ffc93[_0xd4cf('0x25')]||'')+_0xd4cf('0x15');_0x30dcfc[_0x3a1ea2[_0x2b1a48][_0xd4cf('0x22')]]=[_0xd4cf('0x26'),_0x3ffc93[_0xd4cf('0x1d')],_0x3ffc93['phone']]['join']('/');break;case'options':_0x3ffc93[_0xd4cf('0x1f')]=_0x277106[_0x3a1ea2[_0x2b1a48]['param']];if(_0x54a6c2[_0xd4cf('0x19')]!==_0xd4cf('0x27')){if(_0x3ffc93[_0xd4cf('0x1f')]['indexOf'](_0xd4cf('0x28'))<0x0){_0x3ffc93[_0xd4cf('0x1f')]+='U(xcally-mixmonitor-context)';}}else{_0x3ffc93[_0xd4cf('0x1f')]=_0x3ffc93['options'][_0xd4cf('0x29')]('U(xcally-mixmonitor-context)','');}_0x30dcfc[_0x3a1ea2[_0x2b1a48][_0xd4cf('0x22')]]=_0x3ffc93[_0xd4cf('0x1f')];break;default:_0x30dcfc[_0x3a1ea2[_0x2b1a48]['param']]=_0x277106[_0x3a1ea2[_0x2b1a48]['param']];}}return _0x30dcfc['join'](',');}function _0x468418(_0x316509,_0x2afc4b,_0x33ebb4){return new Promise(function(_0x430e0e,_0x6d3af9){var _0x5d0cbe=[];if(_[_0xd4cf('0x2a')](_0x2afc4b))return _0x430e0e(_0x5d0cbe);_0x356001[_0xd4cf('0x2b')][_0xd4cf('0x2c')]({'attributes':['id',_0xd4cf('0x2d'),'IntervalId'],'raw':!![]})[_0xd4cf('0x2e')](function(_0x53b3c7){for(var _0x3f63b4=0x0,_0x179c15=0x0;_0x3f63b4<_0x2afc4b['length'];_0x3f63b4++,_0x179c15=0x0){var _0x4be48c=_0x2afc4b[_0x3f63b4];var _0x10d021=[];var _0x37582d=[];delete _0x4be48c['id'];if(_0x4be48c['interval']!==_0xd4cf('0x2f')){_0x4be48c[_0xd4cf('0x30')]=[_0x4be48c[_0xd4cf('0x2d')]];}else{_0x4be48c[_0xd4cf('0x30')]=_0x4be48c[_0xd4cf('0x31')]?_['map'](_[_0xd4cf('0x32')](_0x53b3c7,{'IntervalId':_0x4be48c[_0xd4cf('0x31')]}),_0xd4cf('0x2d')):[];}_0x4be48c[_0xd4cf('0x6')]=_0x316509[_0xd4cf('0x6')];_0x4be48c[_0xd4cf('0x7')]=_0x316509['exten'];if(_0x4be48c[_0xd4cf('0x3')])_0x4be48c[_0xd4cf('0x3')]=_0x4be48c[_0xd4cf('0x3')][_0xd4cf('0x33')]();if(_0x316509[_0xd4cf('0x3')]===_0xd4cf('0x11')){if(_0x4be48c[_0xd4cf('0x18')]('tag')&&_0x4be48c[_0xd4cf('0x34')]&&_0x4be48c[_0xd4cf('0x34')]!=='--'){_0x10d021[_0xd4cf('0xd')]({'type':_0x4be48c[_0xd4cf('0x3')]['toLowerCase'](),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x35')+_0x4be48c[_0xd4cf('0x34')],'context':_0x316509[_0xd4cf('0x6')],'exten':_0x316509[_0xd4cf('0x7')],'priority':_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')]+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});}_0x10d021['push']({'type':_0x4be48c['type']['toLowerCase'](),'app':_0xd4cf('0x36'),'appdata':_0xd4cf('0x37')+(_0x4be48c[_0xd4cf('0x38')]?_0xd4cf('0x39')+_0x4be48c[_0xd4cf('0x38')]+')':'NoOp(No\x20number\x20available)'),'context':_0x316509['context'],'exten':_0x316509[_0xd4cf('0x7')],'priority':_0x4be48c['intervals'][_0xd4cf('0x21')]+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});}else{if(_0x4be48c[_0xd4cf('0x18')]('answer')){if([_0xd4cf('0x3a'),_0xd4cf('0x3b')]['includes'](_0x4be48c['app']['toLowerCase']())&&_0x4be48c['appType']!==_0xd4cf('0x3c')){if(_0x4be48c[_0xd4cf('0x3d')]){_0x10d021['push']({'type':_0x4be48c[_0xd4cf('0x3')]['toLowerCase'](),'app':'ExecIf','appdata':_0xd4cf('0x3e'),'context':_0x316509[_0xd4cf('0x6')],'exten':_0x316509[_0xd4cf('0x7')],'priority':_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')]+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});_0x10d021[_0xd4cf('0xd')]({'type':_0x4be48c[_0xd4cf('0x3')][_0xd4cf('0x33')](),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x3f'),'context':_0x316509[_0xd4cf('0x6')],'exten':_0x316509[_0xd4cf('0x7')],'priority':_0x4be48c[_0xd4cf('0x30')]['length']+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});}else{_0x10d021[_0xd4cf('0xd')]({'type':_0x4be48c[_0xd4cf('0x3')][_0xd4cf('0x33')](),'app':_0xd4cf('0x36'),'appdata':_0xd4cf('0x40'),'context':_0x316509[_0xd4cf('0x6')],'exten':_0x316509['exten'],'priority':_0x4be48c['intervals'][_0xd4cf('0x21')]+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});_0x10d021[_0xd4cf('0xd')]({'type':_0x4be48c[_0xd4cf('0x3')][_0xd4cf('0x33')](),'app':_0xd4cf('0x4'),'appdata':_0xd4cf('0x41'),'context':_0x316509[_0xd4cf('0x6')],'exten':_0x316509[_0xd4cf('0x7')],'priority':_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')]+_0x33ebb4+_0x179c15++,'VoiceExtensionId':_0x316509['id']});}}}}for(var _0x671fb9=0x0;_0x671fb9<_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')];_0x671fb9++){var _0x4cbe4f=_0x33ebb4+_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')];var _0x419149=_0x671fb9===_0x4be48c[_0xd4cf('0x30')][_0xd4cf('0x21')]-0x1?_0x33ebb4+_0x10d021[_0xd4cf('0x21')]+_0x37582d[_0xd4cf('0x21')]+0x2:_0x33ebb4+_0x671fb9+0x1;_0x10d021[_0xd4cf('0x42')](_0x671fb9,0x0,{'type':_0x316509[_0xd4cf('0x3')],'app':_0xd4cf('0x43'),'appdata':_0x4be48c[_0xd4cf('0x30')][_0x671fb9]+'?'+_0x316509[_0xd4cf('0x6')]+_0xd4cf('0x44')+_0x4cbe4f+':'+_0x316509['context']+_0xd4cf('0x44')+_0x419149,'exten':_0x316509[_0xd4cf('0x7')],'context':_0x316509[_0xd4cf('0x6')],'priority':_0x33ebb4+_0x671fb9,'VoiceExtensionId':_0x316509['id']});}if(_0x4be48c[_0xd4cf('0x45')]===_0xd4cf('0x46'))_0x4be48c[_0xd4cf('0x47')]=_0x4b7399(_0x316509,_0x4be48c[_0xd4cf('0x47')]);_0x4be48c[_0xd4cf('0x48')]=_0x10d021['length']?_[_0xd4cf('0x49')](_0x10d021)['priority']+0x1:_0x33ebb4;_0x5d0cbe=_[_0xd4cf('0x4a')](_0x5d0cbe,_0x10d021,[_0x4be48c],_0x37582d);_0x33ebb4=_[_0xd4cf('0x49')](_0x5d0cbe)[_0xd4cf('0x48')]+0x1;}return _0x430e0e(_0x5d0cbe);})['catch'](function(_0x4112fc){_0x6d3af9(_0x4112fc);});});}return _0x4072d3['define'](_0xd4cf('0x4b'),attributes,{'tableName':_0xd4cf('0x4c'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x5353e2){var _0x13acbe=this[_0xd4cf('0x4d')]({'plain':!![]});var _0x39d32d=_0x13acbe[_0xd4cf('0x3')]===_0xd4cf('0x11')?_0x1769e6(_0x13acbe):_0x407d96(_0x13acbe);return _0x468418(_0x13acbe,_0x5353e2,_[_0xd4cf('0x49')](_0x39d32d)[_0xd4cf('0x48')]+0x1)[_0xd4cf('0x2e')](function(_0x514cf2){var _0x2afdd0=_[_0xd4cf('0x4a')](_0x39d32d,_0x514cf2);_0x2afdd0['push']({'type':_0x13acbe[_0xd4cf('0x3')],'app':'Hangup','exten':_0x13acbe[_0xd4cf('0x7')],'context':_0x13acbe[_0xd4cf('0x6')],'priority':_['last'](_0x2afdd0)[_0xd4cf('0x48')]+0x1,'VoiceExtensionId':_0x13acbe['id']});return _0x2afdd0;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index c8b42e0..e290bb1 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 _0x4d49=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','GetVoiceExtension','VoiceExtension','options','raw','where','attributes','limit','map','include','model','util','bluebird','randomstring'];(function(_0x2bc09e,_0x1ae747){var _0x3f7c75=function(_0x49bed4){while(--_0x49bed4){_0x2bc09e['push'](_0x2bc09e['shift']());}};_0x3f7c75(++_0x1ae747);}(_0x4d49,0x141));var _0x94d4=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x4d49[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require(_0x94d4('0x0'));var moment=require('moment');var BPromise=require(_0x94d4('0x1'));var rs=require(_0x94d4('0x2'));var fs=require('fs');var Redis=require(_0x94d4('0x3'));var db=require(_0x94d4('0x4'))['db'];var utils=require(_0x94d4('0x5'));var logger=require(_0x94d4('0x6'))(_0x94d4('0x7'));var config=require(_0x94d4('0x8'));var jayson=require(_0x94d4('0x9'));var client=jayson['client'][_0x94d4('0xa')]({'port':0x232a});config[_0x94d4('0xb')]=_[_0x94d4('0xc')](config[_0x94d4('0xb')],{'host':_0x94d4('0xd'),'port':0x18eb});var socket=require(_0x94d4('0xe'))(new Redis(config['redis']));require(_0x94d4('0xf'))[_0x94d4('0x10')](socket);function respondWithRpcPromise(_0x562265,_0x23ef86,_0x283f63){return new BPromise(function(_0xd7820d,_0x2720dd){return client['request'](_0x562265,_0x283f63)[_0x94d4('0x11')](function(_0xe7f878){logger[_0x94d4('0x12')](_0x94d4('0x13'),_0x23ef86,_0x94d4('0x14'));logger[_0x94d4('0x15')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x23ef86,'request\x20sent',JSON['stringify'](_0xe7f878));if(_0xe7f878[_0x94d4('0x16')]){if(_0xe7f878[_0x94d4('0x16')]['code']===0x1f4){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0x2720dd(_0xe7f878['error'][_0x94d4('0x17')]);}logger['error']('VoiceExtension,\x20%s,\x20%s',_0x23ef86,_0xe7f878['error'][_0x94d4('0x17')]);return _0xd7820d(_0xe7f878[_0x94d4('0x16')][_0x94d4('0x17')]);}else{logger['info']('VoiceExtension,\x20%s,\x20%s',_0x23ef86,'request\x20sent');_0xd7820d(_0xe7f878[_0x94d4('0x18')][_0x94d4('0x17')]);}})[_0x94d4('0x19')](function(_0x47b760){logger[_0x94d4('0x16')](_0x94d4('0x13'),_0x23ef86,_0x47b760);_0x2720dd(_0x47b760);});});}exports[_0x94d4('0x1a')]=function(_0x58fbb2){var _0x1d61b7=this;return new Promise(function(_0x3e1482,_0x38486e){return db[_0x94d4('0x1b')]['findAll']({'raw':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2['options'][_0x94d4('0x1d')]===undefined?!![]:![]:!![],'where':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2[_0x94d4('0x1c')][_0x94d4('0x1e')]||null:null,'attributes':_0x58fbb2['options']?_0x58fbb2[_0x94d4('0x1c')][_0x94d4('0x1f')]||null:null,'limit':_0x58fbb2['options']?_0x58fbb2['options'][_0x94d4('0x20')]||null:null,'include':_0x58fbb2[_0x94d4('0x1c')]?_0x58fbb2[_0x94d4('0x1c')]['include']?_[_0x94d4('0x21')](_0x58fbb2['options'][_0x94d4('0x22')],function(_0x5e3f3b){return{'model':db[_0x5e3f3b[_0x94d4('0x23')]],'as':_0x5e3f3b['as'],'attributes':_0x5e3f3b[_0x94d4('0x1f')],'include':_0x5e3f3b[_0x94d4('0x22')]?_[_0x94d4('0x21')](_0x5e3f3b[_0x94d4('0x22')],function(_0x20d947){return{'model':db[_0x20d947['model']],'as':_0x20d947['as'],'attributes':_0x20d947[_0x94d4('0x1f')],'include':_0x20d947[_0x94d4('0x22')]?_[_0x94d4('0x21')](_0x20d947[_0x94d4('0x22')],function(_0x2c22c0){return{'model':db[_0x2c22c0[_0x94d4('0x23')]],'as':_0x2c22c0['as'],'attributes':_0x2c22c0[_0x94d4('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x94d4('0x11')](function(_0x1cd705){logger[_0x94d4('0x12')]('GetVoiceExtension',_0x58fbb2);logger[_0x94d4('0x15')](_0x94d4('0x1a'),_0x58fbb2,JSON['stringify'](_0x1cd705));_0x3e1482(_0x1cd705);})[_0x94d4('0x19')](function(_0x459af8){logger[_0x94d4('0x16')](_0x94d4('0x1a'),_0x459af8[_0x94d4('0x17')],_0x58fbb2);_0x38486e(_0x1d61b7[_0x94d4('0x16')](0x1f4,_0x459af8[_0x94d4('0x17')]));});});}; \ No newline at end of file +var _0xfb65=['error','code','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','where','attributes','limit','include','map','model','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x3f1ffb,_0x4d6250){var _0x1b708f=function(_0x3e293f){while(--_0x3e293f){_0x3f1ffb['push'](_0x3f1ffb['shift']());}};_0x1b708f(++_0x4d6250);}(_0xfb65,0x82));var _0x5fb6=function(_0x18d29b,_0x3034d2){_0x18d29b=_0x18d29b-0x0;var _0x3c354f=_0xfb65[_0x18d29b];return _0x3c354f;};'use strict';var _=require('lodash');var util=require(_0x5fb6('0x0'));var moment=require(_0x5fb6('0x1'));var BPromise=require('bluebird');var rs=require(_0x5fb6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5fb6('0x3'))['db'];var utils=require(_0x5fb6('0x4'));var logger=require(_0x5fb6('0x5'))(_0x5fb6('0x6'));var config=require(_0x5fb6('0x7'));var jayson=require(_0x5fb6('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5fb6('0x9')]=_[_0x5fb6('0xa')](config[_0x5fb6('0x9')],{'host':_0x5fb6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5fb6('0x9')]));require(_0x5fb6('0xc'))[_0x5fb6('0xd')](socket);function respondWithRpcPromise(_0x21e613,_0x4ff5d2,_0x2b63fd){return new BPromise(function(_0xcf0402,_0x491bb6){return client[_0x5fb6('0xe')](_0x21e613,_0x2b63fd)[_0x5fb6('0xf')](function(_0x160070){logger[_0x5fb6('0x10')](_0x5fb6('0x11'),_0x4ff5d2,'request\x20sent');logger[_0x5fb6('0x12')](_0x5fb6('0x13'),_0x4ff5d2,_0x5fb6('0x14'),JSON[_0x5fb6('0x15')](_0x160070));if(_0x160070[_0x5fb6('0x16')]){if(_0x160070[_0x5fb6('0x16')][_0x5fb6('0x17')]===0x1f4){logger[_0x5fb6('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4ff5d2,_0x160070['error'][_0x5fb6('0x18')]);return _0x491bb6(_0x160070[_0x5fb6('0x16')]['message']);}logger[_0x5fb6('0x16')](_0x5fb6('0x11'),_0x4ff5d2,_0x160070[_0x5fb6('0x16')]['message']);return _0xcf0402(_0x160070[_0x5fb6('0x16')][_0x5fb6('0x18')]);}else{logger[_0x5fb6('0x10')](_0x5fb6('0x11'),_0x4ff5d2,_0x5fb6('0x14'));_0xcf0402(_0x160070[_0x5fb6('0x19')]['message']);}})[_0x5fb6('0x1a')](function(_0x5aeb08){logger[_0x5fb6('0x16')]('VoiceExtension,\x20%s,\x20%s',_0x4ff5d2,_0x5aeb08);_0x491bb6(_0x5aeb08);});});}exports[_0x5fb6('0x1b')]=function(_0x3ec3b0){var _0x402e8a=this;return new Promise(function(_0x1c5891,_0x5885f1){return db[_0x5fb6('0x1c')][_0x5fb6('0x1d')]({'raw':_0x3ec3b0['options']?_0x3ec3b0['options'][_0x5fb6('0x1e')]===undefined?!![]:![]:!![],'where':_0x3ec3b0[_0x5fb6('0x1f')]?_0x3ec3b0['options'][_0x5fb6('0x20')]||null:null,'attributes':_0x3ec3b0[_0x5fb6('0x1f')]?_0x3ec3b0[_0x5fb6('0x1f')][_0x5fb6('0x21')]||null:null,'limit':_0x3ec3b0['options']?_0x3ec3b0[_0x5fb6('0x1f')][_0x5fb6('0x22')]||null:null,'include':_0x3ec3b0[_0x5fb6('0x1f')]?_0x3ec3b0[_0x5fb6('0x1f')][_0x5fb6('0x23')]?_[_0x5fb6('0x24')](_0x3ec3b0['options']['include'],function(_0x298b44){return{'model':db[_0x298b44[_0x5fb6('0x25')]],'as':_0x298b44['as'],'attributes':_0x298b44[_0x5fb6('0x21')],'include':_0x298b44[_0x5fb6('0x23')]?_[_0x5fb6('0x24')](_0x298b44[_0x5fb6('0x23')],function(_0x36ac58){return{'model':db[_0x36ac58['model']],'as':_0x36ac58['as'],'attributes':_0x36ac58[_0x5fb6('0x21')],'include':_0x36ac58[_0x5fb6('0x23')]?_[_0x5fb6('0x24')](_0x36ac58['include'],function(_0x2afc08){return{'model':db[_0x2afc08[_0x5fb6('0x25')]],'as':_0x2afc08['as'],'attributes':_0x2afc08['attributes']};}):[]};}):[]};}):[]:[]})[_0x5fb6('0xf')](function(_0x408fd9){logger['info'](_0x5fb6('0x1b'),_0x3ec3b0);logger['debug'](_0x5fb6('0x1b'),_0x3ec3b0,JSON['stringify'](_0x408fd9));_0x1c5891(_0x408fd9);})['catch'](function(_0x159971){logger[_0x5fb6('0x16')](_0x5fb6('0x1b'),_0x159971[_0x5fb6('0x18')],_0x3ec3b0);_0x5885f1(_0x402e8a[_0x5fb6('0x16')](0x1f4,_0x159971[_0x5fb6('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index a322d7c..988f551 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 _0x5fc3=['./voiceExtension.events','save','update','emit','removeListener','register','voiceExtension:'];(function(_0x17b94e,_0x1b2f59){var _0x14ab53=function(_0x4cdf1f){while(--_0x4cdf1f){_0x17b94e['push'](_0x17b94e['shift']());}};_0x14ab53(++_0x1b2f59);}(_0x5fc3,0xa8));var _0x35fc=function(_0x485abd,_0x32c7c1){_0x485abd=_0x485abd-0x0;var _0x3379f1=_0x5fc3[_0x485abd];return _0x3379f1;};'use strict';var VoiceExtensionEvents=require(_0x35fc('0x0'));var events=[_0x35fc('0x1'),'remove',_0x35fc('0x2')];function createListener(_0x2ac6da,_0x196bc2){return function(_0x91d024){_0x196bc2[_0x35fc('0x3')](_0x2ac6da,_0x91d024);};}function removeListener(_0x5e75e6,_0x2d1404){return function(){VoiceExtensionEvents[_0x35fc('0x4')](_0x5e75e6,_0x2d1404);};}exports[_0x35fc('0x5')]=function(_0x5b85ad){for(var _0x5754be=0x0,_0x19a0d1=events['length'];_0x5754be<_0x19a0d1;_0x5754be++){var _0x16e153=events[_0x5754be];var _0x27524f=createListener(_0x35fc('0x6')+_0x16e153,_0x5b85ad);VoiceExtensionEvents['on'](_0x16e153,_0x27524f);}}; \ No newline at end of file +var _0x53ec=['length','voiceExtension:','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x1cd944,_0x180f6b){var _0x1e91cd=function(_0x4e5363){while(--_0x4e5363){_0x1cd944['push'](_0x1cd944['shift']());}};_0x1e91cd(++_0x180f6b);}(_0x53ec,0x192));var _0xc53e=function(_0x189e7c,_0x1de1c0){_0x189e7c=_0x189e7c-0x0;var _0xf85261=_0x53ec[_0x189e7c];return _0xf85261;};'use strict';var VoiceExtensionEvents=require(_0xc53e('0x0'));var events=[_0xc53e('0x1'),_0xc53e('0x2'),_0xc53e('0x3')];function createListener(_0x1b04cc,_0xe45c6d){return function(_0x51c435){_0xe45c6d[_0xc53e('0x4')](_0x1b04cc,_0x51c435);};}function removeListener(_0x4e954a,_0x2b90f6){return function(){VoiceExtensionEvents[_0xc53e('0x5')](_0x4e954a,_0x2b90f6);};}exports['register']=function(_0x2f1414){for(var _0x4f989b=0x0,_0x41a9e8=events[_0xc53e('0x6')];_0x4f989b<_0x41a9e8;_0x4f989b++){var _0x5d3b28=events[_0x4f989b];var _0x1616ac=createListener(_0xc53e('0x7')+_0x5d3b28,_0x2f1414);VoiceExtensionEvents['on'](_0x5d3b28,_0x1616ac);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index be5b95c..10acec8 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 _0xa456=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','/:id','show','post','create','put','delete','multer'];(function(_0x3f4070,_0x3ff2a6){var _0x1063be=function(_0x13aa61){while(--_0x13aa61){_0x3f4070['push'](_0x3f4070['shift']());}};_0x1063be(++_0x3ff2a6);}(_0xa456,0x142));var _0x6a45=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xa456[_0x4ed520];return _0x4415a6;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var fs_extra=require(_0x6a45('0x5'));var auth=require(_0x6a45('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x6a45('0x7'));var controller=require(_0x6a45('0x8'));router[_0x6a45('0x9')]('/',auth[_0x6a45('0xa')](),controller['index']);router[_0x6a45('0x9')](_0x6a45('0xb'),auth[_0x6a45('0xa')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x9')]('/:id/messages',auth[_0x6a45('0xa')](),controller['getMessages']);router[_0x6a45('0xd')]('/',auth[_0x6a45('0xa')](),controller[_0x6a45('0xe')]);router[_0x6a45('0xf')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x6a45('0x10')](_0x6a45('0xb'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1893=['delete','destroy','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','put','update'];(function(_0x15e694,_0x14bca3){var _0x408d34=function(_0x403f58){while(--_0x403f58){_0x15e694['push'](_0x15e694['shift']());}};_0x408d34(++_0x14bca3);}(_0x1893,0xa2));var _0x3189=function(_0x10aebb,_0x2fd10a){_0x10aebb=_0x10aebb-0x0;var _0x1b1b8f=_0x1893[_0x10aebb];return _0x1b1b8f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3189('0x0'));var timeout=require(_0x3189('0x1'));var express=require(_0x3189('0x2'));var router=express[_0x3189('0x3')]();var fs_extra=require(_0x3189('0x4'));var auth=require(_0x3189('0x5'));var interaction=require(_0x3189('0x6'));var config=require('../../config/environment');var controller=require(_0x3189('0x7'));router[_0x3189('0x8')]('/',auth[_0x3189('0x9')](),controller[_0x3189('0xa')]);router[_0x3189('0x8')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0xc')]);router['get'](_0x3189('0xd'),auth['isAuthenticated'](),controller[_0x3189('0xe')]);router['post']('/',auth[_0x3189('0x9')](),controller[_0x3189('0xf')]);router[_0x3189('0x10')](_0x3189('0xb'),auth['isAuthenticated'](),controller[_0x3189('0x11')]);router[_0x3189('0x12')](_0x3189('0xb'),auth[_0x3189('0x9')](),controller[_0x3189('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 6b84dc0..921e1ed 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 _0x895f=['contest_mailbox','STRING','email','string','trim','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','from-voicemail'];(function(_0x22eb96,_0x3c2d8d){var _0x5e1adf=function(_0x22e392){while(--_0x22e392){_0x22eb96['push'](_0x22eb96['shift']());}};_0x5e1adf(++_0x3c2d8d);}(_0x895f,0x64));var _0xf895=function(_0x100c7a,_0x591517){_0x100c7a=_0x100c7a-0x0;var _0x2e1827=_0x895f[_0x100c7a];return _0x2e1827;};'use strict';var Sequelize=require(_0xf895('0x0'));module['exports']={'customer_id':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING'],'defaultValue':_0xf895('0x1'),'unique':'contest_mailbox'},'mailbox':{'type':Sequelize['STRING'],'defaultValue':'','allowNull':![],'unique':_0xf895('0x2')},'password':{'type':Sequelize[_0xf895('0x3')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x3ad569){this['setDataValue'](_0xf895('0x4'),typeof _0x3ad569===_0xf895('0x5')&&_0x3ad569[_0xf895('0x6')]()?_0x3ad569[_0xf895('0x6')]():null);}},'pager':{'type':Sequelize[_0xf895('0x3')]},'tz':{'type':Sequelize[_0xf895('0x3')],'defaultValue':'central'},'attach':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':_0xf895('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':_0xf895('0x8'),'allowNull':![]},'dialout':{'type':Sequelize[_0xf895('0x3')]},'callback':{'type':Sequelize[_0xf895('0x3')]},'review':{'type':Sequelize['ENUM'](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xf895('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xf895('0x9'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xf895('0x7')]('yes','no'),'defaultValue':_0xf895('0x8'),'allowNull':![]},'forcename':{'type':Sequelize[_0xf895('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xf895('0x7')](_0xf895('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0xf895('0x8'),'allowNull':![]},'stamp':{'type':_0xf895('0xa')},'emailsubject':{'type':Sequelize[_0xf895('0x3')]},'emailbody':{'type':Sequelize[_0xf895('0x3')]},'maxsecs':{'type':Sequelize[_0xf895('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xf895('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xf895('0xc')],'get':function(){return this[_0xf895('0xd')](_0xf895('0xe'))+_0xf895('0xf')+this[_0xf895('0xd')](_0xf895('0x10'));}}}; \ No newline at end of file +var _0x261a=['contest_mailbox','email','string','trim','central','ENUM','yes','INTEGER','\x20-\x20','getDataValue','exports','STRING'];(function(_0x15e4a7,_0x2720de){var _0x3e4c1f=function(_0x555ff6){while(--_0x555ff6){_0x15e4a7['push'](_0x15e4a7['shift']());}};_0x3e4c1f(++_0x2720de);}(_0x261a,0xb2));var _0xa261=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x261a[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xa261('0x0')]={'customer_id':{'type':Sequelize[_0xa261('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xa261('0x2')},'mailbox':{'type':Sequelize[_0xa261('0x1')],'defaultValue':'','allowNull':![],'unique':_0xa261('0x2')},'password':{'type':Sequelize[_0xa261('0x1')]},'fullname':{'type':Sequelize[_0xa261('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]},'set':function(_0x1a4166){this['setDataValue'](_0xa261('0x3'),typeof _0x1a4166===_0xa261('0x4')&&_0x1a4166[_0xa261('0x5')]()?_0x1a4166[_0xa261('0x5')]():null);}},'pager':{'type':Sequelize[_0xa261('0x1')]},'tz':{'type':Sequelize[_0xa261('0x1')],'defaultValue':_0xa261('0x6')},'attach':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':_0xa261('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0xa261('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0xa261('0x7')](_0xa261('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa261('0x7')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa261('0x7')]('yes','no'),'defaultValue':_0xa261('0x8'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xa261('0x1')]},'emailbody':{'type':Sequelize[_0xa261('0x1')]},'maxsecs':{'type':Sequelize[_0xa261('0x9')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue']('fullname')+_0xa261('0xa')+this[_0xa261('0xb')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index a579985..4a3e0f9 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 _0x6b20=['filter','where','merge','VIRTUAL','options','includeAll','include','VoiceMail','findAll','rows','catch','show','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','findOne','VoiceMailMessage','mailbox','findAndCountAll','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','destroy','Voicemails','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','pick'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b20,0xd1));var _0x06b2=function(_0x2b9a4f,_0x4280a6){_0x2b9a4f=_0x2b9a4f-0x0;var _0x1f5ba3=_0x6b20[_0x2b9a4f];return _0x1f5ba3;};'use strict';var emlformat=require(_0x06b2('0x0'));var rimraf=require(_0x06b2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06b2('0x2'));var rp=require('request-promise');var moment=require(_0x06b2('0x3'));var BPromise=require(_0x06b2('0x4'));var Mustache=require(_0x06b2('0x5'));var util=require('util');var path=require(_0x06b2('0x6'));var sox=require(_0x06b2('0x7'));var csv=require(_0x06b2('0x8'));var ejs=require(_0x06b2('0x9'));var fs=require('fs');var fs_extra=require(_0x06b2('0xa'));var _=require(_0x06b2('0xb'));var squel=require(_0x06b2('0xc'));var crypto=require('crypto');var jsforce=require(_0x06b2('0xd'));var deskjs=require(_0x06b2('0xe'));var toCsv=require(_0x06b2('0x8'));var querystring=require('querystring');var Papa=require(_0x06b2('0xf'));var Redis=require('ioredis');var authService=require(_0x06b2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x06b2('0x11'));var logger=require(_0x06b2('0x12'))('api');var utils=require(_0x06b2('0x13'));var config=require(_0x06b2('0x14'));var licenseUtil=require(_0x06b2('0x15'));var db=require(_0x06b2('0x16'))['db'];function respondWithStatusCode(_0x44a9b4,_0x810a12){_0x810a12=_0x810a12||0xcc;return function(_0x3039c9){if(_0x3039c9){return _0x44a9b4[_0x06b2('0x17')](_0x810a12);}return _0x44a9b4[_0x06b2('0x18')](_0x810a12)[_0x06b2('0x19')]();};}function respondWithResult(_0xa81f11,_0x2822e9){_0x2822e9=_0x2822e9||0xc8;return function(_0x26faee){if(_0x26faee){return _0xa81f11['status'](_0x2822e9)[_0x06b2('0x1a')](_0x26faee);}};}function respondWithFilteredResult(_0xaee98c,_0x47496c){return function(_0x3830e9){if(_0x3830e9){var _0xef0466=typeof _0x47496c[_0x06b2('0x1b')]==='undefined'&&typeof _0x47496c[_0x06b2('0x1c')]===_0x06b2('0x1d');var _0x525945=_0x3830e9[_0x06b2('0x1e')];var _0x594b48=_0xef0466?0x0:_0x47496c['offset'];var _0x192270=_0xef0466?_0x3830e9[_0x06b2('0x1e')]:_0x47496c[_0x06b2('0x1b')]+_0x47496c[_0x06b2('0x1c')];var _0x4c4e21;if(_0x192270>=_0x525945){_0x192270=_0x525945;_0x4c4e21=0xc8;}else{_0x4c4e21=0xce;}_0xaee98c[_0x06b2('0x18')](_0x4c4e21);return _0xaee98c[_0x06b2('0x1f')](_0x06b2('0x20'),_0x594b48+'-'+_0x192270+'/'+_0x525945)[_0x06b2('0x1a')](_0x3830e9);}return null;};}function patchUpdates(_0xe28985){return function(_0x368ad8){try{jsonpatch[_0x06b2('0x21')](_0x368ad8,_0xe28985,!![]);}catch(_0x5ca622){return BPromise[_0x06b2('0x22')](_0x5ca622);}return _0x368ad8[_0x06b2('0x23')]();};}function saveUpdates(_0xb05f65,_0x208384){return function(_0x4e2a4c){if(_0x4e2a4c){return _0x4e2a4c['update'](_0xb05f65)[_0x06b2('0x24')](function(_0xb5231e){return _0xb5231e;});}return null;};}function removeEntity(_0x4fc95f,_0x39659f){return function(_0x5e40f2){if(_0x5e40f2){return _0x5e40f2[_0x06b2('0x25')]()[_0x06b2('0x24')](function(){var _0x2a0645=_0x5e40f2['get']({'plain':!![]});var _0x4382ce=_0x06b2('0x26');return db[_0x06b2('0x27')][_0x06b2('0x25')]({'where':{'type':_0x4382ce,'resourceId':_0x2a0645['id']}})[_0x06b2('0x24')](function(){return _0x5e40f2;});})['then'](function(){_0x4fc95f[_0x06b2('0x18')](0xcc)[_0x06b2('0x19')]();});}};}function handleEntityNotFound(_0x40a73f,_0x1a99c1){return function(_0x1976ac){if(!_0x1976ac){_0x40a73f[_0x06b2('0x17')](0x194);}return _0x1976ac;};}function handleError(_0x5ba3c4,_0x44a95e){_0x44a95e=_0x44a95e||0x1f4;return function(_0x2a3228){logger[_0x06b2('0x28')](_0x2a3228[_0x06b2('0x29')]);if(_0x2a3228[_0x06b2('0x2a')]){delete _0x2a3228[_0x06b2('0x2a')];}_0x5ba3c4[_0x06b2('0x18')](_0x44a95e)['send'](_0x2a3228);};}exports[_0x06b2('0x2b')]=function(_0x32eeea,_0x1637c2){var _0x15a78b={},_0x1cc725={},_0x37d391={'count':0x0,'rows':[]};var _0x401551=_[_0x06b2('0x2c')](db['VoiceMail'][_0x06b2('0x2d')],function(_0x2737ad){return{'name':_0x2737ad[_0x06b2('0x2e')],'type':_0x2737ad[_0x06b2('0x2f')][_0x06b2('0x30')]};});_0x1cc725[_0x06b2('0x31')]=_[_0x06b2('0x2c')](_0x401551,'name');_0x1cc725['query']=_[_0x06b2('0x32')](_0x32eeea[_0x06b2('0x33')]);_0x1cc725[_0x06b2('0x34')]=_['intersection'](_0x1cc725[_0x06b2('0x31')],_0x1cc725[_0x06b2('0x33')]);_0x15a78b[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x1cc725[_0x06b2('0x31')],qs[_0x06b2('0x37')](_0x32eeea['query'][_0x06b2('0x37')]));_0x15a78b[_0x06b2('0x35')]=_0x15a78b[_0x06b2('0x35')]['length']?_0x15a78b[_0x06b2('0x35')]:_0x1cc725[_0x06b2('0x31')];if(!_0x32eeea['query'][_0x06b2('0x38')](_0x06b2('0x39'))){_0x15a78b[_0x06b2('0x1c')]=qs[_0x06b2('0x1c')](_0x32eeea[_0x06b2('0x33')][_0x06b2('0x1c')]);_0x15a78b[_0x06b2('0x1b')]=qs[_0x06b2('0x1b')](_0x32eeea[_0x06b2('0x33')][_0x06b2('0x1b')]);}_0x15a78b[_0x06b2('0x3a')]=qs[_0x06b2('0x3b')](_0x32eeea['query'][_0x06b2('0x3b')]);_0x15a78b['where']=qs['filters'](_[_0x06b2('0x3c')](_0x32eeea['query'],_0x1cc725[_0x06b2('0x34')]),_0x401551);if(_0x32eeea['query'][_0x06b2('0x3d')]){_0x15a78b[_0x06b2('0x3e')]=_[_0x06b2('0x3f')](_0x15a78b[_0x06b2('0x3e')],{'$or':_[_0x06b2('0x2c')](_0x401551,function(_0x51ee32){if(_0x51ee32[_0x06b2('0x2f')]!==_0x06b2('0x40')){var _0x4d5ebd={};_0x4d5ebd[_0x51ee32[_0x06b2('0x2a')]]={'$like':'%'+_0x32eeea[_0x06b2('0x33')][_0x06b2('0x3d')]+'%'};return _0x4d5ebd;}})});}_0x15a78b=_['merge']({},_0x15a78b,_0x32eeea[_0x06b2('0x41')]);var _0x41e74e={'where':_0x15a78b['where']};return db['VoiceMail'][_0x06b2('0x1e')](_0x41e74e)[_0x06b2('0x24')](function(_0x286c9b){_0x37d391[_0x06b2('0x1e')]=_0x286c9b;if(_0x32eeea[_0x06b2('0x33')][_0x06b2('0x42')]){_0x15a78b[_0x06b2('0x43')]=[{'all':!![]}];}return db[_0x06b2('0x44')][_0x06b2('0x45')](_0x15a78b);})[_0x06b2('0x24')](function(_0x1d7750){_0x37d391[_0x06b2('0x46')]=_0x1d7750;return _0x37d391;})[_0x06b2('0x24')](respondWithFilteredResult(_0x1637c2,_0x15a78b))[_0x06b2('0x47')](handleError(_0x1637c2,null));};exports[_0x06b2('0x48')]=function(_0x190781,_0x36ef08){var _0xc68724={'raw':!![],'where':{'id':_0x190781['params']['id']}},_0x38fb0e={};_0x38fb0e[_0x06b2('0x31')]=_[_0x06b2('0x32')](db[_0x06b2('0x44')][_0x06b2('0x2d')]);_0x38fb0e['query']=_[_0x06b2('0x32')](_0x190781[_0x06b2('0x33')]);_0x38fb0e['filters']=_[_0x06b2('0x36')](_0x38fb0e[_0x06b2('0x31')],_0x38fb0e['query']);_0xc68724[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x38fb0e['model'],qs['fields'](_0x190781['query'][_0x06b2('0x37')]));_0xc68724[_0x06b2('0x35')]=_0xc68724[_0x06b2('0x35')][_0x06b2('0x49')]?_0xc68724[_0x06b2('0x35')]:_0x38fb0e['model'];if(_0x190781['query'][_0x06b2('0x42')]){_0xc68724[_0x06b2('0x43')]=[{'all':!![]}];}_0xc68724=_[_0x06b2('0x3f')]({},_0xc68724,_0x190781[_0x06b2('0x41')]);return db[_0x06b2('0x44')][_0x06b2('0x4a')](_0xc68724)['then'](handleEntityNotFound(_0x36ef08,null))[_0x06b2('0x24')](respondWithResult(_0x36ef08,null))[_0x06b2('0x47')](handleError(_0x36ef08,null));};exports[_0x06b2('0x4b')]=function(_0x33f72e,_0x146c5c){return db[_0x06b2('0x44')]['create'](_0x33f72e[_0x06b2('0x4c')],{})[_0x06b2('0x24')](function(_0x324a38){var _0x46920d=_0x33f72e['user'][_0x06b2('0x4d')]({'plain':!![]});if(!_0x46920d)throw new Error(_0x06b2('0x4e'));if(_0x46920d[_0x06b2('0x4f')]===_0x06b2('0x50')){var _0x546c9e=_0x324a38[_0x06b2('0x4d')]({'plain':!![]});var _0x8cf9fe=_0x06b2('0x26');return db[_0x06b2('0x51')][_0x06b2('0x4a')]({'where':{'name':_0x8cf9fe,'userProfileId':_0x46920d[_0x06b2('0x52')]},'raw':!![]})[_0x06b2('0x24')](function(_0x33290b){if(_0x33290b&&_0x33290b['autoAssociation']===0x0){return db[_0x06b2('0x27')][_0x06b2('0x4b')]({'name':_0x546c9e[_0x06b2('0x2a')],'resourceId':_0x546c9e['id'],'type':_0x33290b[_0x06b2('0x2a')],'sectionId':_0x33290b['id']},{})[_0x06b2('0x24')](function(){return _0x324a38;});}else{return _0x324a38;}})[_0x06b2('0x47')](function(_0x4fba4c){logger['error'](_0x06b2('0x53'),_0x4fba4c);throw _0x4fba4c;});}return _0x324a38;})['then'](respondWithResult(_0x146c5c,0xc9))['catch'](handleError(_0x146c5c,null));};exports[_0x06b2('0x54')]=function(_0x5899c1,_0x2dac1c){if(_0x5899c1[_0x06b2('0x4c')]['id']){delete _0x5899c1[_0x06b2('0x4c')]['id'];}return db[_0x06b2('0x44')][_0x06b2('0x4a')]({'where':{'id':_0x5899c1[_0x06b2('0x55')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x2dac1c,null))[_0x06b2('0x24')](saveUpdates(_0x5899c1[_0x06b2('0x4c')],null))[_0x06b2('0x24')](respondWithResult(_0x2dac1c,null))['catch'](handleError(_0x2dac1c,null));};exports['destroy']=function(_0x17d95c,_0x46e4b9){return db['VoiceMail'][_0x06b2('0x4a')]({'where':{'id':_0x17d95c[_0x06b2('0x55')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0x46e4b9,null))[_0x06b2('0x24')](removeEntity(_0x46e4b9,null))['catch'](handleError(_0x46e4b9,null));};exports['getMessages']=function(_0x58f519,_0xf058,_0x594dbe){return db['VoiceMail'][_0x06b2('0x56')]({'where':{'id':_0x58f519[_0x06b2('0x55')]['id']}})[_0x06b2('0x24')](handleEntityNotFound(_0xf058,null))[_0x06b2('0x24')](function(_0x2b2de5){var _0x388d8b;var _0x513650={},_0x119096={};_0x119096[_0x06b2('0x31')]=_['keys'](db[_0x06b2('0x57')][_0x06b2('0x2d')]);_0x119096[_0x06b2('0x33')]=_[_0x06b2('0x32')](_0x58f519[_0x06b2('0x33')]);_0x119096[_0x06b2('0x34')]=_[_0x06b2('0x36')](_0x119096[_0x06b2('0x31')],_0x119096[_0x06b2('0x33')]);_0x513650[_0x06b2('0x35')]=_[_0x06b2('0x36')](_0x119096[_0x06b2('0x31')],qs['fields'](_0x58f519[_0x06b2('0x33')][_0x06b2('0x37')]));_0x513650['attributes']=_0x513650[_0x06b2('0x35')][_0x06b2('0x49')]?_0x513650[_0x06b2('0x35')]:_0x119096[_0x06b2('0x31')];if(!_0x58f519['query'][_0x06b2('0x38')](_0x06b2('0x39'))){_0x513650[_0x06b2('0x1c')]=qs['limit'](_0x58f519[_0x06b2('0x33')][_0x06b2('0x1c')]);_0x513650[_0x06b2('0x1b')]=qs[_0x06b2('0x1b')](_0x58f519[_0x06b2('0x33')][_0x06b2('0x1b')]);}_0x513650[_0x06b2('0x3a')]=qs[_0x06b2('0x3b')](_0x58f519[_0x06b2('0x33')]['sort']);_0x513650['where']=qs['filters'](_['pick'](_0x58f519[_0x06b2('0x33')],_0x119096['filters']));if(_0x58f519[_0x06b2('0x33')][_0x06b2('0x3d')]){_0x513650[_0x06b2('0x3e')]=_[_0x06b2('0x3f')](_0x513650[_0x06b2('0x3e')],{'$or':_[_0x06b2('0x2c')](_0x513650['attributes'],function(_0x57e00d){var _0x1fb8fa={};_0x1fb8fa[_0x57e00d]={'$like':'%'+_0x58f519[_0x06b2('0x33')]['filter']+'%'};return _0x1fb8fa;})});}_0x513650[_0x06b2('0x3e')]=_[_0x06b2('0x3f')](_0x513650[_0x06b2('0x3e')],{'mailboxuser':_0x2b2de5[_0x06b2('0x58')]});_0x513650=_[_0x06b2('0x3f')]({},_0x513650,_0x58f519[_0x06b2('0x41')]);return db['VoiceMailMessage'][_0x06b2('0x59')](_0x513650)['then'](respondWithFilteredResult(_0xf058,_0x513650));})[_0x06b2('0x47')](handleError(_0xf058,null));}; \ No newline at end of file +var _0xb10b=['attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','merge','options','VoiceMail','include','findAll','rows','includeAll','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Voicemails','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','findAndCountAll','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','reject','update','then','destroy','get','end','error','stack','name','send','map','fieldName','key','model','query','keys','intersection'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb10b,0x12a));var _0xbb10=function(_0x57d671,_0x1a101c){_0x57d671=_0x57d671-0x0;var _0x450dfe=_0xb10b[_0x57d671];return _0x450dfe;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];function respondWithStatusCode(_0x916a32,_0x285009){_0x285009=_0x285009||0xcc;return function(_0x193a27){if(_0x193a27){return _0x916a32[_0xbb10('0x18')](_0x285009);}return _0x916a32[_0xbb10('0x19')](_0x285009)['end']();};}function respondWithResult(_0x26e021,_0x42d7e4){_0x42d7e4=_0x42d7e4||0xc8;return function(_0x45b9d6){if(_0x45b9d6){return _0x26e021[_0xbb10('0x19')](_0x42d7e4)[_0xbb10('0x1a')](_0x45b9d6);}};}function respondWithFilteredResult(_0x2f2ebf,_0x24a57b){return function(_0x36b5e8){if(_0x36b5e8){var _0x3e26f4=typeof _0x24a57b[_0xbb10('0x1b')]==='undefined'&&typeof _0x24a57b[_0xbb10('0x1c')]===_0xbb10('0x1d');var _0x133ac2=_0x36b5e8[_0xbb10('0x1e')];var _0x378da8=_0x3e26f4?0x0:_0x24a57b[_0xbb10('0x1b')];var _0x575cca=_0x3e26f4?_0x36b5e8[_0xbb10('0x1e')]:_0x24a57b[_0xbb10('0x1b')]+_0x24a57b[_0xbb10('0x1c')];var _0x48b6e9;if(_0x575cca>=_0x133ac2){_0x575cca=_0x133ac2;_0x48b6e9=0xc8;}else{_0x48b6e9=0xce;}_0x2f2ebf[_0xbb10('0x19')](_0x48b6e9);return _0x2f2ebf[_0xbb10('0x1f')](_0xbb10('0x20'),_0x378da8+'-'+_0x575cca+'/'+_0x133ac2)[_0xbb10('0x1a')](_0x36b5e8);}return null;};}function patchUpdates(_0xdf237d){return function(_0x44e563){try{jsonpatch['apply'](_0x44e563,_0xdf237d,!![]);}catch(_0x12f888){return BPromise[_0xbb10('0x21')](_0x12f888);}return _0x44e563['save']();};}function saveUpdates(_0x4c4b0d,_0x8e2b97){return function(_0x311abe){if(_0x311abe){return _0x311abe[_0xbb10('0x22')](_0x4c4b0d)[_0xbb10('0x23')](function(_0x445761){return _0x445761;});}return null;};}function removeEntity(_0x1824b7,_0x407cb4){return function(_0x436104){if(_0x436104){return _0x436104[_0xbb10('0x24')]()[_0xbb10('0x23')](function(){var _0x3ba6cd=_0x436104[_0xbb10('0x25')]({'plain':!![]});var _0x537898='Voicemails';return db['UserProfileResource'][_0xbb10('0x24')]({'where':{'type':_0x537898,'resourceId':_0x3ba6cd['id']}})[_0xbb10('0x23')](function(){return _0x436104;});})[_0xbb10('0x23')](function(){_0x1824b7['status'](0xcc)[_0xbb10('0x26')]();});}};}function handleEntityNotFound(_0x24d586,_0x6ed43b){return function(_0x1d5e95){if(!_0x1d5e95){_0x24d586[_0xbb10('0x18')](0x194);}return _0x1d5e95;};}function handleError(_0x20d946,_0x2a0e8b){_0x2a0e8b=_0x2a0e8b||0x1f4;return function(_0x4aabb9){logger[_0xbb10('0x27')](_0x4aabb9[_0xbb10('0x28')]);if(_0x4aabb9[_0xbb10('0x29')]){delete _0x4aabb9[_0xbb10('0x29')];}_0x20d946[_0xbb10('0x19')](_0x2a0e8b)[_0xbb10('0x2a')](_0x4aabb9);};}exports['index']=function(_0x221624,_0x4ee02e){var _0x448d5c={},_0x56f2da={},_0x16ad2a={'count':0x0,'rows':[]};var _0x1dcc9c=_[_0xbb10('0x2b')](db['VoiceMail']['rawAttributes'],function(_0x4c3744){return{'name':_0x4c3744[_0xbb10('0x2c')],'type':_0x4c3744['type'][_0xbb10('0x2d')]};});_0x56f2da[_0xbb10('0x2e')]=_[_0xbb10('0x2b')](_0x1dcc9c,_0xbb10('0x29'));_0x56f2da[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x221624[_0xbb10('0x2f')]);_0x56f2da['filters']=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],_0x56f2da[_0xbb10('0x2f')]);_0x448d5c[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x56f2da[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x33')]));_0x448d5c['attributes']=_0x448d5c[_0xbb10('0x32')][_0xbb10('0x34')]?_0x448d5c[_0xbb10('0x32')]:_0x56f2da[_0xbb10('0x2e')];if(!_0x221624['query'][_0xbb10('0x35')]('nolimit')){_0x448d5c['limit']=qs[_0xbb10('0x1c')](_0x221624[_0xbb10('0x2f')][_0xbb10('0x1c')]);_0x448d5c[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x221624[_0xbb10('0x2f')]['offset']);}_0x448d5c[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x221624['query']['sort']);_0x448d5c['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x221624[_0xbb10('0x2f')],_0x56f2da['filters']),_0x1dcc9c);if(_0x221624[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x448d5c[_0xbb10('0x3b')]=_['merge'](_0x448d5c[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x1dcc9c,function(_0x1dcd38){if(_0x1dcd38[_0xbb10('0x3c')]!=='VIRTUAL'){var _0xd238e9={};_0xd238e9[_0x1dcd38[_0xbb10('0x29')]]={'$like':'%'+_0x221624['query'][_0xbb10('0x3a')]+'%'};return _0xd238e9;}})});}_0x448d5c=_[_0xbb10('0x3d')]({},_0x448d5c,_0x221624[_0xbb10('0x3e')]);var _0x3a9934={'where':_0x448d5c[_0xbb10('0x3b')]};return db[_0xbb10('0x3f')]['count'](_0x3a9934)[_0xbb10('0x23')](function(_0x1c7fae){_0x16ad2a[_0xbb10('0x1e')]=_0x1c7fae;if(_0x221624[_0xbb10('0x2f')]['includeAll']){_0x448d5c[_0xbb10('0x40')]=[{'all':!![]}];}return db[_0xbb10('0x3f')][_0xbb10('0x41')](_0x448d5c);})[_0xbb10('0x23')](function(_0x5e2cfa){_0x16ad2a[_0xbb10('0x42')]=_0x5e2cfa;return _0x16ad2a;})[_0xbb10('0x23')](respondWithFilteredResult(_0x4ee02e,_0x448d5c))['catch'](handleError(_0x4ee02e,null));};exports['show']=function(_0x38d78f,_0x4a3ddf){var _0x318984={'raw':!![],'where':{'id':_0x38d78f['params']['id']}},_0x180933={};_0x180933[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x3f')]['rawAttributes']);_0x180933[_0xbb10('0x2f')]=_[_0xbb10('0x30')](_0x38d78f[_0xbb10('0x2f')]);_0x180933[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],_0x180933[_0xbb10('0x2f')]);_0x318984[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x180933[_0xbb10('0x2e')],qs[_0xbb10('0x33')](_0x38d78f[_0xbb10('0x2f')]['fields']));_0x318984[_0xbb10('0x32')]=_0x318984[_0xbb10('0x32')]['length']?_0x318984[_0xbb10('0x32')]:_0x180933[_0xbb10('0x2e')];if(_0x38d78f[_0xbb10('0x2f')][_0xbb10('0x43')]){_0x318984[_0xbb10('0x40')]=[{'all':!![]}];}_0x318984=_[_0xbb10('0x3d')]({},_0x318984,_0x38d78f[_0xbb10('0x3e')]);return db['VoiceMail']['find'](_0x318984)[_0xbb10('0x23')](handleEntityNotFound(_0x4a3ddf,null))[_0xbb10('0x23')](respondWithResult(_0x4a3ddf,null))[_0xbb10('0x44')](handleError(_0x4a3ddf,null));};exports['create']=function(_0x5f0c12,_0x3cd6f3){return db[_0xbb10('0x3f')][_0xbb10('0x45')](_0x5f0c12[_0xbb10('0x46')],{})[_0xbb10('0x23')](function(_0x22b315){var _0x2f2552=_0x5f0c12[_0xbb10('0x47')][_0xbb10('0x25')]({'plain':!![]});if(!_0x2f2552)throw new Error(_0xbb10('0x48'));if(_0x2f2552['role']==='user'){var _0x412e13=_0x22b315[_0xbb10('0x25')]({'plain':!![]});var _0x36ab7d=_0xbb10('0x49');return db[_0xbb10('0x4a')][_0xbb10('0x4b')]({'where':{'name':_0x36ab7d,'userProfileId':_0x2f2552[_0xbb10('0x4c')]},'raw':!![]})[_0xbb10('0x23')](function(_0x1c0d8f){if(_0x1c0d8f&&_0x1c0d8f[_0xbb10('0x4d')]===0x0){return db[_0xbb10('0x4e')][_0xbb10('0x45')]({'name':_0x412e13[_0xbb10('0x29')],'resourceId':_0x412e13['id'],'type':_0x1c0d8f[_0xbb10('0x29')],'sectionId':_0x1c0d8f['id']},{})[_0xbb10('0x23')](function(){return _0x22b315;});}else{return _0x22b315;}})['catch'](function(_0x124052){logger['error'](_0xbb10('0x4f'),_0x124052);throw _0x124052;});}return _0x22b315;})[_0xbb10('0x23')](respondWithResult(_0x3cd6f3,0xc9))[_0xbb10('0x44')](handleError(_0x3cd6f3,null));};exports[_0xbb10('0x22')]=function(_0x26e66e,_0x32d8e9){if(_0x26e66e[_0xbb10('0x46')]['id']){delete _0x26e66e[_0xbb10('0x46')]['id'];}return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x26e66e[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x32d8e9,null))[_0xbb10('0x23')](saveUpdates(_0x26e66e[_0xbb10('0x46')],null))[_0xbb10('0x23')](respondWithResult(_0x32d8e9,null))['catch'](handleError(_0x32d8e9,null));};exports[_0xbb10('0x24')]=function(_0x466eb7,_0x1b83a9){return db[_0xbb10('0x3f')][_0xbb10('0x4b')]({'where':{'id':_0x466eb7[_0xbb10('0x50')]['id']}})['then'](handleEntityNotFound(_0x1b83a9,null))[_0xbb10('0x23')](removeEntity(_0x1b83a9,null))[_0xbb10('0x44')](handleError(_0x1b83a9,null));};exports[_0xbb10('0x51')]=function(_0x14fed3,_0x432728,_0x22de7f){return db[_0xbb10('0x3f')][_0xbb10('0x52')]({'where':{'id':_0x14fed3[_0xbb10('0x50')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x432728,null))[_0xbb10('0x23')](function(_0x2a1ce1){var _0x16932f;var _0x4e7fac={},_0x4ea1a6={};_0x4ea1a6[_0xbb10('0x2e')]=_[_0xbb10('0x30')](db[_0xbb10('0x53')][_0xbb10('0x54')]);_0x4ea1a6['query']=_['keys'](_0x14fed3[_0xbb10('0x2f')]);_0x4ea1a6[_0xbb10('0x38')]=_[_0xbb10('0x31')](_0x4ea1a6[_0xbb10('0x2e')],_0x4ea1a6[_0xbb10('0x2f')]);_0x4e7fac[_0xbb10('0x32')]=_[_0xbb10('0x31')](_0x4ea1a6['model'],qs[_0xbb10('0x33')](_0x14fed3[_0xbb10('0x2f')]['fields']));_0x4e7fac['attributes']=_0x4e7fac['attributes'][_0xbb10('0x34')]?_0x4e7fac[_0xbb10('0x32')]:_0x4ea1a6[_0xbb10('0x2e')];if(!_0x14fed3['query']['hasOwnProperty']('nolimit')){_0x4e7fac[_0xbb10('0x1c')]=qs[_0xbb10('0x1c')](_0x14fed3[_0xbb10('0x2f')]['limit']);_0x4e7fac[_0xbb10('0x1b')]=qs[_0xbb10('0x1b')](_0x14fed3['query']['offset']);}_0x4e7fac[_0xbb10('0x36')]=qs[_0xbb10('0x37')](_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x37')]);_0x4e7fac['where']=qs[_0xbb10('0x38')](_[_0xbb10('0x39')](_0x14fed3[_0xbb10('0x2f')],_0x4ea1a6['filters']));if(_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]){_0x4e7fac[_0xbb10('0x3b')]=_['merge'](_0x4e7fac[_0xbb10('0x3b')],{'$or':_[_0xbb10('0x2b')](_0x4e7fac[_0xbb10('0x32')],function(_0x37b65f){var _0x5e4a6e={};_0x5e4a6e[_0x37b65f]={'$like':'%'+_0x14fed3[_0xbb10('0x2f')][_0xbb10('0x3a')]+'%'};return _0x5e4a6e;})});}_0x4e7fac[_0xbb10('0x3b')]=_[_0xbb10('0x3d')](_0x4e7fac['where'],{'mailboxuser':_0x2a1ce1[_0xbb10('0x55')]});_0x4e7fac=_[_0xbb10('0x3d')]({},_0x4e7fac,_0x14fed3[_0xbb10('0x3e')]);return db[_0xbb10('0x53')][_0xbb10('0x56')](_0x4e7fac)[_0xbb10('0x23')](respondWithFilteredResult(_0x432728,_0x4e7fac));})[_0xbb10('0x44')](handleError(_0x432728,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index b680e0c..eab5969 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 _0x75c6=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox_context','../../config/logger','bluebird','path','rimraf'];(function(_0xde8111,_0x15702c){var _0x29af0b=function(_0x3d7873){while(--_0x3d7873){_0xde8111['push'](_0xde8111['shift']());}};_0x29af0b(++_0x15702c);}(_0x75c6,0x1c8));var _0x675c=function(_0x2d2949,_0x397ca6){_0x2d2949=_0x2d2949-0x0;var _0x2eab93=_0x75c6[_0x2d2949];return _0x2eab93;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x675c('0x0'))('api');var moment=require('moment');var BPromise=require(_0x675c('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x675c('0x2'));var rimraf=require(_0x675c('0x3'));var config=require(_0x675c('0x4'));var attributes=require(_0x675c('0x5'));module[_0x675c('0x6')]=function(_0x383778,_0x568ad3){return _0x383778[_0x675c('0x7')](_0x675c('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x675c('0x9'),'fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6dbb=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','voice_voicemail','mailbox_context','mailbox','util'];(function(_0x5e5bc6,_0x141123){var _0x2ddd68=function(_0x523181){while(--_0x523181){_0x5e5bc6['push'](_0x5e5bc6['shift']());}};_0x2ddd68(++_0x141123);}(_0x6dbb,0xf6));var _0xb6db=function(_0x2f78c4,_0x356ba5){_0x2f78c4=_0x2f78c4-0x0;var _0x52ad5a=_0x6dbb[_0x2f78c4];return _0x52ad5a;};'use strict';var _=require('lodash');var util=require(_0xb6db('0x0'));var logger=require(_0xb6db('0x1'))('api');var moment=require(_0xb6db('0x2'));var BPromise=require(_0xb6db('0x3'));var rp=require(_0xb6db('0x4'));var fs=require('fs');var path=require(_0xb6db('0x5'));var rimraf=require(_0xb6db('0x6'));var config=require(_0xb6db('0x7'));var attributes=require('./voiceMail.attributes');module[_0xb6db('0x8')]=function(_0x5080b1,_0x5beb92){return _0x5080b1[_0xb6db('0x9')]('VoiceMail',attributes,{'tableName':_0xb6db('0xa'),'paranoid':![],'indexes':[{'name':_0xb6db('0xb'),'fields':[_0xb6db('0xc'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 0597d51..5897bbf 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 _0xa509=['message','info','result','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMail,\x20%s,\x20%s','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x3326a7,_0x12a146){var _0x22e67c=function(_0x3758a1){while(--_0x3758a1){_0x3326a7['push'](_0x3326a7['shift']());}};_0x22e67c(++_0x12a146);}(_0xa509,0x179));var _0x9a50=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa509[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a50('0x0'));var BPromise=require(_0x9a50('0x1'));var rs=require(_0x9a50('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a50('0x3'))['db'];var utils=require(_0x9a50('0x4'));var logger=require(_0x9a50('0x5'))(_0x9a50('0x6'));var config=require(_0x9a50('0x7'));var jayson=require(_0x9a50('0x8'));var client=jayson[_0x9a50('0x9')][_0x9a50('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x230bcf,_0x399a57,_0x4fdd78){return new BPromise(function(_0x2410ac,_0xfde7b7){return client[_0x9a50('0xb')](_0x230bcf,_0x4fdd78)[_0x9a50('0xc')](function(_0x3b9722){logger['info'](_0x9a50('0xd'),_0x399a57,_0x9a50('0xe'));logger[_0x9a50('0xf')](_0x9a50('0x10'),_0x399a57,_0x9a50('0xe'),JSON['stringify'](_0x3b9722));if(_0x3b9722[_0x9a50('0x11')]){if(_0x3b9722[_0x9a50('0x11')][_0x9a50('0x12')]===0x1f4){logger[_0x9a50('0x11')](_0x9a50('0xd'),_0x399a57,_0x3b9722[_0x9a50('0x11')][_0x9a50('0x13')]);return _0xfde7b7(_0x3b9722[_0x9a50('0x11')][_0x9a50('0x13')]);}logger[_0x9a50('0x11')](_0x9a50('0xd'),_0x399a57,_0x3b9722['error']['message']);return _0x2410ac(_0x3b9722[_0x9a50('0x11')][_0x9a50('0x13')]);}else{logger[_0x9a50('0x14')](_0x9a50('0xd'),_0x399a57,_0x9a50('0xe'));_0x2410ac(_0x3b9722[_0x9a50('0x15')][_0x9a50('0x13')]);}})['catch'](function(_0x176d8d){logger['error'](_0x9a50('0xd'),_0x399a57,_0x176d8d);_0xfde7b7(_0x176d8d);});});} \ No newline at end of file +var _0x5342=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceMail,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x37763f,_0x6509e1){var _0x36efe6=function(_0x20fa1f){while(--_0x20fa1f){_0x37763f['push'](_0x37763f['shift']());}};_0x36efe6(++_0x6509e1);}(_0x5342,0xf5));var _0x2534=function(_0x5d96ee,_0x523278){_0x5d96ee=_0x5d96ee-0x0;var _0x39092b=_0x5342[_0x5d96ee];return _0x39092b;};'use strict';var _=require(_0x2534('0x0'));var util=require(_0x2534('0x1'));var moment=require(_0x2534('0x2'));var BPromise=require(_0x2534('0x3'));var rs=require(_0x2534('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2534('0x5'))['db'];var utils=require(_0x2534('0x6'));var logger=require(_0x2534('0x7'))('rpc');var config=require(_0x2534('0x8'));var jayson=require(_0x2534('0x9'));var client=jayson[_0x2534('0xa')][_0x2534('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4b7c34,_0x57027c,_0x26a4a7){return new BPromise(function(_0x175673,_0x54066f){return client['request'](_0x4b7c34,_0x26a4a7)[_0x2534('0xc')](function(_0x562860){logger[_0x2534('0xd')]('VoiceMail,\x20%s,\x20%s',_0x57027c,_0x2534('0xe'));logger['debug'](_0x2534('0xf'),_0x57027c,_0x2534('0xe'),JSON[_0x2534('0x10')](_0x562860));if(_0x562860[_0x2534('0x11')]){if(_0x562860['error'][_0x2534('0x12')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x57027c,_0x562860['error'][_0x2534('0x13')]);return _0x54066f(_0x562860[_0x2534('0x11')][_0x2534('0x13')]);}logger[_0x2534('0x11')](_0x2534('0x14'),_0x57027c,_0x562860['error'][_0x2534('0x13')]);return _0x175673(_0x562860[_0x2534('0x11')][_0x2534('0x13')]);}else{logger[_0x2534('0xd')]('VoiceMail,\x20%s,\x20%s',_0x57027c,_0x2534('0xe'));_0x175673(_0x562860[_0x2534('0x15')][_0x2534('0x13')]);}})[_0x2534('0x16')](function(_0x3e3f3e){logger[_0x2534('0x11')](_0x2534('0x14'),_0x57027c,_0x3e3f3e);_0x54066f(_0x3e3f3e);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 13e40e6..b933c42 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 _0xb7ae=['/:id','update','delete','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','isAuthenticated','index','show','/:id/download','create','put'];(function(_0x46974,_0x8d1bfa){var _0x15a4f8=function(_0x56dcfd){while(--_0x56dcfd){_0x46974['push'](_0x46974['shift']());}};_0x15a4f8(++_0x8d1bfa);}(_0xb7ae,0x9c));var _0xeb7a=function(_0x12aea0,_0x373936){_0x12aea0=_0x12aea0-0x0;var _0x4d824e=_0xb7ae[_0x12aea0];return _0x4d824e;};'use strict';var multer=require(_0xeb7a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeb7a('0x1'));var express=require(_0xeb7a('0x2'));var router=express[_0xeb7a('0x3')]();var fs_extra=require(_0xeb7a('0x4'));var auth=require(_0xeb7a('0x5'));var interaction=require(_0xeb7a('0x6'));var config=require('../../config/environment');var controller=require(_0xeb7a('0x7'));router[_0xeb7a('0x8')]('/',auth[_0xeb7a('0x9')](),controller[_0xeb7a('0xa')]);router['get']('/:id',auth[_0xeb7a('0x9')](),controller[_0xeb7a('0xb')]);router[_0xeb7a('0x8')](_0xeb7a('0xc'),auth[_0xeb7a('0x9')](),controller['download']);router['post']('/',auth[_0xeb7a('0x9')](),controller[_0xeb7a('0xd')]);router[_0xeb7a('0xe')](_0xeb7a('0xf'),auth[_0xeb7a('0x9')](),controller[_0xeb7a('0x10')]);router[_0xeb7a('0x11')](_0xeb7a('0xf'),auth[_0xeb7a('0x9')](),controller[_0xeb7a('0x12')]);module['exports']=router; \ No newline at end of file +var _0x14e6=['./voiceMailMessage.controller','get','isAuthenticated','index','/:id','show','download','create','put','update','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x54bdf9,_0x1d58a5){var _0x447729=function(_0x378d07){while(--_0x378d07){_0x54bdf9['push'](_0x54bdf9['shift']());}};_0x447729(++_0x1d58a5);}(_0x14e6,0x187));var _0x614e=function(_0x4f3242,_0x391954){_0x4f3242=_0x4f3242-0x0;var _0x49844f=_0x14e6[_0x4f3242];return _0x49844f;};'use strict';var multer=require(_0x614e('0x0'));var util=require(_0x614e('0x1'));var path=require('path');var timeout=require(_0x614e('0x2'));var express=require('express');var router=express[_0x614e('0x3')]();var fs_extra=require(_0x614e('0x4'));var auth=require(_0x614e('0x5'));var interaction=require(_0x614e('0x6'));var config=require(_0x614e('0x7'));var controller=require(_0x614e('0x8'));router[_0x614e('0x9')]('/',auth[_0x614e('0xa')](),controller[_0x614e('0xb')]);router['get'](_0x614e('0xc'),auth[_0x614e('0xa')](),controller[_0x614e('0xd')]);router[_0x614e('0x9')]('/:id/download',auth[_0x614e('0xa')](),controller[_0x614e('0xe')]);router['post']('/',auth[_0x614e('0xa')](),controller[_0x614e('0xf')]);router[_0x614e('0x10')]('/:id',auth[_0x614e('0xa')](),controller[_0x614e('0x11')]);router[_0x614e('0x12')]('/:id',auth[_0x614e('0xa')](),controller[_0x614e('0x13')]);module[_0x614e('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 1dbccb0..21a939c 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 _0x7ef2=['CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','long','literal'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x7ef2,0xeb));var _0x27ef=function(_0x3ed811,_0x112b7c){_0x3ed811=_0x3ed811-0x0;var _0x47b6c2=_0x7ef2[_0x3ed811];return _0x47b6c2;};'use strict';var Sequelize=require(_0x27ef('0x0'));module[_0x27ef('0x1')]={'name':{'type':Sequelize[_0x27ef('0x2')],'get':function(_0x4ab7e9){return this[_0x27ef('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x27ef('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize['STRING'],'defaultValue':''},'recording':{'type':Sequelize['BLOB'](_0x27ef('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x27ef('0x5')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':'TIMESTAMP','defaultValue':Sequelize[_0x27ef('0x7')](_0x27ef('0x8'))}}; \ No newline at end of file +var _0xc9e3=['STRING','BLOB','TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0xc9e3,0x152));var _0x3c9e=function(_0x4de30a,_0x47d755){_0x4de30a=_0x4de30a-0x0;var _0x3fe839=_0xc9e3[_0x4de30a];return _0x3fe839;};'use strict';var Sequelize=require('sequelize');module[_0x3c9e('0x0')]={'name':{'type':Sequelize[_0x3c9e('0x1')],'get':function(_0x36a2da){return this[_0x3c9e('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x3c9e('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x3c9e('0x5')]('long'),'defaultValue':null},'flag':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3c9e('0x4')],'defaultValue':''},'stamp':{'type':_0x3c9e('0x6'),'defaultValue':Sequelize[_0x3c9e('0x7')](_0x3c9e('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index aee22df..d95f16f 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 _0xcd0d=['send','map','VoiceMailMessage','rawAttributes','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','destroy','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','save','update','then','error','stack','name'];(function(_0x3c8e9a,_0x384306){var _0x2d4c57=function(_0x43d408){while(--_0x43d408){_0x3c8e9a['push'](_0x3c8e9a['shift']());}};_0x2d4c57(++_0x384306);}(_0xcd0d,0x1e5));var _0xdcd0=function(_0x10e956,_0xd5fcf0){_0x10e956=_0x10e956-0x0;var _0x3312a0=_0xcd0d[_0x10e956];return _0x3312a0;};'use strict';var emlformat=require(_0xdcd0('0x0'));var rimraf=require(_0xdcd0('0x1'));var zipdir=require(_0xdcd0('0x2'));var jsonpatch=require(_0xdcd0('0x3'));var rp=require('request-promise');var moment=require(_0xdcd0('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdcd0('0x5'));var util=require(_0xdcd0('0x6'));var path=require(_0xdcd0('0x7'));var sox=require(_0xdcd0('0x8'));var csv=require(_0xdcd0('0x9'));var ejs=require(_0xdcd0('0xa'));var fs=require('fs');var fs_extra=require(_0xdcd0('0xb'));var _=require(_0xdcd0('0xc'));var squel=require(_0xdcd0('0xd'));var crypto=require(_0xdcd0('0xe'));var jsforce=require(_0xdcd0('0xf'));var deskjs=require(_0xdcd0('0x10'));var toCsv=require(_0xdcd0('0x9'));var querystring=require('querystring');var Papa=require(_0xdcd0('0x11'));var Redis=require(_0xdcd0('0x12'));var authService=require(_0xdcd0('0x13'));var qs=require(_0xdcd0('0x14'));var as=require(_0xdcd0('0x15'));var hardwareService=require(_0xdcd0('0x16'));var logger=require(_0xdcd0('0x17'))(_0xdcd0('0x18'));var utils=require(_0xdcd0('0x19'));var config=require(_0xdcd0('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xdcd0('0x1b'))['db'];function respondWithStatusCode(_0x4715f4,_0x10b836){_0x10b836=_0x10b836||0xcc;return function(_0x400dc6){if(_0x400dc6){return _0x4715f4['sendStatus'](_0x10b836);}return _0x4715f4[_0xdcd0('0x1c')](_0x10b836)[_0xdcd0('0x1d')]();};}function respondWithResult(_0xd47704,_0x497e56){_0x497e56=_0x497e56||0xc8;return function(_0x4fddfe){if(_0x4fddfe){return _0xd47704[_0xdcd0('0x1c')](_0x497e56)[_0xdcd0('0x1e')](_0x4fddfe);}};}function respondWithFilteredResult(_0x5ccf61,_0x2538b9){return function(_0x1ede95){if(_0x1ede95){var _0x466cc7=typeof _0x2538b9[_0xdcd0('0x1f')]==='undefined'&&typeof _0x2538b9[_0xdcd0('0x20')]===_0xdcd0('0x21');var _0x2c6c47=_0x1ede95[_0xdcd0('0x22')];var _0x9fcc8e=_0x466cc7?0x0:_0x2538b9[_0xdcd0('0x1f')];var _0x5c4347=_0x466cc7?_0x1ede95['count']:_0x2538b9[_0xdcd0('0x1f')]+_0x2538b9['limit'];var _0x9e9be0;if(_0x5c4347>=_0x2c6c47){_0x5c4347=_0x2c6c47;_0x9e9be0=0xc8;}else{_0x9e9be0=0xce;}_0x5ccf61[_0xdcd0('0x1c')](_0x9e9be0);return _0x5ccf61[_0xdcd0('0x23')](_0xdcd0('0x24'),_0x9fcc8e+'-'+_0x5c4347+'/'+_0x2c6c47)['json'](_0x1ede95);}return null;};}function patchUpdates(_0x4172c1){return function(_0x1abd21){try{jsonpatch['apply'](_0x1abd21,_0x4172c1,!![]);}catch(_0x57a90b){return BPromise['reject'](_0x57a90b);}return _0x1abd21[_0xdcd0('0x25')]();};}function saveUpdates(_0x37d4f8,_0x7991bd){return function(_0x10efa6){if(_0x10efa6){return _0x10efa6[_0xdcd0('0x26')](_0x37d4f8)[_0xdcd0('0x27')](function(_0x9decc8){return _0x9decc8;});}return null;};}function removeEntity(_0xf1abe0,_0x133359){return function(_0x22dc22){if(_0x22dc22){return _0x22dc22['destroy']()[_0xdcd0('0x27')](function(){_0xf1abe0[_0xdcd0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3064fe,_0x293738){return function(_0x51f5d7){if(!_0x51f5d7){_0x3064fe['sendStatus'](0x194);}return _0x51f5d7;};}function handleError(_0x40bf4b,_0x1a7794){_0x1a7794=_0x1a7794||0x1f4;return function(_0x1f30b4){logger[_0xdcd0('0x28')](_0x1f30b4[_0xdcd0('0x29')]);if(_0x1f30b4['name']){delete _0x1f30b4[_0xdcd0('0x2a')];}_0x40bf4b[_0xdcd0('0x1c')](_0x1a7794)[_0xdcd0('0x2b')](_0x1f30b4);};}exports['index']=function(_0x229ce6,_0x4cd35e){var _0x2bd3d9={},_0x2f1161={},_0x5903c4={'count':0x0,'rows':[]};var _0x1c0ae9=_[_0xdcd0('0x2c')](db[_0xdcd0('0x2d')][_0xdcd0('0x2e')],function(_0x1b8312){return{'name':_0x1b8312[_0xdcd0('0x2f')],'type':_0x1b8312[_0xdcd0('0x30')][_0xdcd0('0x31')]};});_0x2f1161[_0xdcd0('0x32')]=_[_0xdcd0('0x33')](_[_0xdcd0('0x2c')](_0x1c0ae9,_0xdcd0('0x2a')),[_0xdcd0('0x2a')]);_0x2f1161['query']=_['keys'](_0x229ce6[_0xdcd0('0x34')]);_0x2f1161[_0xdcd0('0x35')]=_[_0xdcd0('0x36')](_0x2f1161[_0xdcd0('0x32')],_0x2f1161[_0xdcd0('0x34')]);_0x2bd3d9[_0xdcd0('0x37')]=_[_0xdcd0('0x36')](_0x2f1161['model'],qs[_0xdcd0('0x38')](_0x229ce6[_0xdcd0('0x34')][_0xdcd0('0x38')]));_0x2bd3d9['attributes']=_0x2bd3d9[_0xdcd0('0x37')][_0xdcd0('0x39')]?_0x2bd3d9[_0xdcd0('0x37')]:_0x2f1161[_0xdcd0('0x32')];if(!_0x229ce6['query'][_0xdcd0('0x3a')](_0xdcd0('0x3b'))){_0x2bd3d9[_0xdcd0('0x20')]=qs[_0xdcd0('0x20')](_0x229ce6['query'][_0xdcd0('0x20')]);_0x2bd3d9[_0xdcd0('0x1f')]=qs['offset'](_0x229ce6[_0xdcd0('0x34')]['offset']);}_0x2bd3d9['order']=qs[_0xdcd0('0x3c')](_0x229ce6[_0xdcd0('0x34')][_0xdcd0('0x3c')]);_0x2bd3d9[_0xdcd0('0x3d')]=qs['filters'](_[_0xdcd0('0x3e')](_0x229ce6[_0xdcd0('0x34')],_0x2f1161['filters']),_0x1c0ae9);if(_0x229ce6['query'][_0xdcd0('0x3f')]){_0x2bd3d9['where']=_[_0xdcd0('0x40')](_0x2bd3d9[_0xdcd0('0x3d')],{'$or':_[_0xdcd0('0x2c')](_0x1c0ae9,function(_0x4daa55){if(_0x4daa55[_0xdcd0('0x30')]!==_0xdcd0('0x41')){var _0x298605={};_0x298605[_0x4daa55['name']]={'$like':'%'+_0x229ce6[_0xdcd0('0x34')][_0xdcd0('0x3f')]+'%'};return _0x298605;}})});}_0x2bd3d9=_['merge']({},_0x2bd3d9,_0x229ce6['options']);var _0x2676ce={'where':_0x2bd3d9[_0xdcd0('0x3d')]};return db[_0xdcd0('0x2d')][_0xdcd0('0x22')](_0x2676ce)[_0xdcd0('0x27')](function(_0x556fa6){_0x5903c4[_0xdcd0('0x22')]=_0x556fa6;if(_0x229ce6[_0xdcd0('0x34')][_0xdcd0('0x42')]){_0x2bd3d9[_0xdcd0('0x43')]=[{'all':!![]}];}return db[_0xdcd0('0x2d')][_0xdcd0('0x44')](_0x2bd3d9);})['then'](function(_0x5e3109){_0x5903c4[_0xdcd0('0x45')]=_0x5e3109;return _0x5903c4;})[_0xdcd0('0x27')](respondWithFilteredResult(_0x4cd35e,_0x2bd3d9))[_0xdcd0('0x46')](handleError(_0x4cd35e,null));};exports[_0xdcd0('0x47')]=function(_0x443a22,_0x328d72){var _0x3372e0={'raw':!![],'where':{'id':_0x443a22['params']['id']}},_0x178444={};_0x178444[_0xdcd0('0x32')]=_[_0xdcd0('0x48')](db['VoiceMailMessage'][_0xdcd0('0x2e')]);_0x178444[_0xdcd0('0x34')]=_[_0xdcd0('0x48')](_0x443a22[_0xdcd0('0x34')]);_0x178444[_0xdcd0('0x35')]=_['intersection'](_0x178444['model'],_0x178444[_0xdcd0('0x34')]);_0x3372e0['attributes']=_['intersection'](_0x178444[_0xdcd0('0x32')],qs['fields'](_0x443a22[_0xdcd0('0x34')]['fields']));_0x3372e0[_0xdcd0('0x37')]=_0x3372e0[_0xdcd0('0x37')][_0xdcd0('0x39')]?_0x3372e0[_0xdcd0('0x37')]:_0x178444[_0xdcd0('0x32')];if(_0x443a22['query'][_0xdcd0('0x42')]){_0x3372e0[_0xdcd0('0x43')]=[{'all':!![]}];}_0x3372e0=_[_0xdcd0('0x40')]({},_0x3372e0,_0x443a22[_0xdcd0('0x49')]);return db[_0xdcd0('0x2d')][_0xdcd0('0x4a')](_0x3372e0)[_0xdcd0('0x27')](handleEntityNotFound(_0x328d72,null))['then'](respondWithResult(_0x328d72,null))['catch'](handleError(_0x328d72,null));};exports[_0xdcd0('0x4b')]=function(_0x14b0e5,_0x1e8e82){return db[_0xdcd0('0x2d')][_0xdcd0('0x4b')](_0x14b0e5[_0xdcd0('0x4c')],{})[_0xdcd0('0x27')](respondWithResult(_0x1e8e82,0xc9))[_0xdcd0('0x46')](handleError(_0x1e8e82,null));};exports[_0xdcd0('0x26')]=function(_0x2a3a0a,_0x35a66f){if(_0x2a3a0a['body']['id']){delete _0x2a3a0a[_0xdcd0('0x4c')]['id'];}return db[_0xdcd0('0x2d')][_0xdcd0('0x4a')]({'where':{'id':_0x2a3a0a[_0xdcd0('0x4d')]['id']}})[_0xdcd0('0x27')](handleEntityNotFound(_0x35a66f,null))[_0xdcd0('0x27')](saveUpdates(_0x2a3a0a[_0xdcd0('0x4c')],null))[_0xdcd0('0x27')](respondWithResult(_0x35a66f,null))[_0xdcd0('0x46')](handleError(_0x35a66f,null));};exports[_0xdcd0('0x4e')]=function(_0xb30b4,_0x259728){return db['VoiceMailMessage'][_0xdcd0('0x4a')]({'where':{'id':_0xb30b4[_0xdcd0('0x4d')]['id']}})[_0xdcd0('0x27')](handleEntityNotFound(_0x259728,null))['then'](removeEntity(_0x259728,null))[_0xdcd0('0x46')](handleError(_0x259728,null));};exports[_0xdcd0('0x4f')]=function(_0x3f3ae1,_0x38c5c7,_0x44bf6e){return db[_0xdcd0('0x2d')][_0xdcd0('0x4a')]({'where':{'id':_0x3f3ae1[_0xdcd0('0x4d')]['id']},'attributes':['id',_0xdcd0('0x50'),_0xdcd0('0x51')]})[_0xdcd0('0x27')](handleEntityNotFound(_0x38c5c7,null))[_0xdcd0('0x27')](function(_0x5e2236){if(_0x5e2236){if(!_0x5e2236[_0xdcd0('0x50')]){throw new db[(_0xdcd0('0x52'))]['ValidationError'](_0xdcd0('0x53'));}var _0x1f2db1={'Content-Type':_0xdcd0('0x54'),'Content-Disposition':'attachment'};if(_0x5e2236[_0xdcd0('0x51')]){_0x1f2db1[_0xdcd0('0x55')]=_0xdcd0('0x56')+_0x5e2236[_0xdcd0('0x51')]+_0xdcd0('0x57');}_0x38c5c7[_0xdcd0('0x23')](_0x1f2db1);return _0x38c5c7[_0xdcd0('0x2b')](new Buffer(_0x5e2236[_0xdcd0('0x50')]));}})['catch'](handleError(_0x38c5c7,null));}; \ No newline at end of file +var _0xc622=['VoiceMailMessage','rawAttributes','type','model','differenceBy','keys','filters','intersection','attributes','fields','query','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','then','rows','catch','show','params','length','includeAll','include','find','create','body','download','recording','Sequelize','ValidationError','audio/wav','attachment','msg_id','attachment;\x20filename=\x22','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','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','sendStatus','error','stack','name','send','map'];(function(_0x3adb80,_0x46cfad){var _0x474ce8=function(_0x3b3d3a){while(--_0x3b3d3a){_0x3adb80['push'](_0x3adb80['shift']());}};_0x474ce8(++_0x46cfad);}(_0xc622,0x7f));var _0x2c62=function(_0x54bac5,_0x8d3a16){_0x54bac5=_0x54bac5-0x0;var _0xc15971=_0xc622[_0x54bac5];return _0xc15971;};'use strict';var emlformat=require(_0x2c62('0x0'));var rimraf=require(_0x2c62('0x1'));var zipdir=require(_0x2c62('0x2'));var jsonpatch=require(_0x2c62('0x3'));var rp=require(_0x2c62('0x4'));var moment=require(_0x2c62('0x5'));var BPromise=require(_0x2c62('0x6'));var Mustache=require(_0x2c62('0x7'));var util=require(_0x2c62('0x8'));var path=require(_0x2c62('0x9'));var sox=require(_0x2c62('0xa'));var csv=require(_0x2c62('0xb'));var ejs=require(_0x2c62('0xc'));var fs=require('fs');var fs_extra=require(_0x2c62('0xd'));var _=require(_0x2c62('0xe'));var squel=require(_0x2c62('0xf'));var crypto=require(_0x2c62('0x10'));var jsforce=require(_0x2c62('0x11'));var deskjs=require(_0x2c62('0x12'));var toCsv=require(_0x2c62('0xb'));var querystring=require(_0x2c62('0x13'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c62('0x14'));var qs=require(_0x2c62('0x15'));var as=require(_0x2c62('0x16'));var hardwareService=require(_0x2c62('0x17'));var logger=require(_0x2c62('0x18'))('api');var utils=require(_0x2c62('0x19'));var config=require(_0x2c62('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c62('0x1b'))['db'];function respondWithStatusCode(_0x337acc,_0x374be2){_0x374be2=_0x374be2||0xcc;return function(_0x28e807){if(_0x28e807){return _0x337acc['sendStatus'](_0x374be2);}return _0x337acc['status'](_0x374be2)[_0x2c62('0x1c')]();};}function respondWithResult(_0xac5d07,_0x55f346){_0x55f346=_0x55f346||0xc8;return function(_0x1d3cd4){if(_0x1d3cd4){return _0xac5d07[_0x2c62('0x1d')](_0x55f346)[_0x2c62('0x1e')](_0x1d3cd4);}};}function respondWithFilteredResult(_0x445dc3,_0x438f3f){return function(_0x210603){if(_0x210603){var _0x302da0=typeof _0x438f3f[_0x2c62('0x1f')]===_0x2c62('0x20')&&typeof _0x438f3f[_0x2c62('0x21')]===_0x2c62('0x20');var _0xb6b97=_0x210603[_0x2c62('0x22')];var _0x58648d=_0x302da0?0x0:_0x438f3f[_0x2c62('0x1f')];var _0xd34bbc=_0x302da0?_0x210603[_0x2c62('0x22')]:_0x438f3f['offset']+_0x438f3f[_0x2c62('0x21')];var _0x8b2222;if(_0xd34bbc>=_0xb6b97){_0xd34bbc=_0xb6b97;_0x8b2222=0xc8;}else{_0x8b2222=0xce;}_0x445dc3['status'](_0x8b2222);return _0x445dc3[_0x2c62('0x23')](_0x2c62('0x24'),_0x58648d+'-'+_0xd34bbc+'/'+_0xb6b97)[_0x2c62('0x1e')](_0x210603);}return null;};}function patchUpdates(_0xbf0298){return function(_0x43b6c8){try{jsonpatch[_0x2c62('0x25')](_0x43b6c8,_0xbf0298,!![]);}catch(_0x3fc8af){return BPromise[_0x2c62('0x26')](_0x3fc8af);}return _0x43b6c8['save']();};}function saveUpdates(_0x585628,_0x18259d){return function(_0x49bdb8){if(_0x49bdb8){return _0x49bdb8[_0x2c62('0x27')](_0x585628)['then'](function(_0x52cddc){return _0x52cddc;});}return null;};}function removeEntity(_0x33a1fb,_0xdeeccf){return function(_0x4f7abb){if(_0x4f7abb){return _0x4f7abb[_0x2c62('0x28')]()['then'](function(){_0x33a1fb[_0x2c62('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x596219,_0x5e89dc){return function(_0x4cd5d8){if(!_0x4cd5d8){_0x596219[_0x2c62('0x29')](0x194);}return _0x4cd5d8;};}function handleError(_0x2c7392,_0x59fe90){_0x59fe90=_0x59fe90||0x1f4;return function(_0xec9706){logger[_0x2c62('0x2a')](_0xec9706[_0x2c62('0x2b')]);if(_0xec9706[_0x2c62('0x2c')]){delete _0xec9706[_0x2c62('0x2c')];}_0x2c7392[_0x2c62('0x1d')](_0x59fe90)[_0x2c62('0x2d')](_0xec9706);};}exports['index']=function(_0x2cf8f6,_0x1d9192){var _0x18448d={},_0x1e8bad={},_0x37f539={'count':0x0,'rows':[]};var _0xdcf0b5=_[_0x2c62('0x2e')](db[_0x2c62('0x2f')][_0x2c62('0x30')],function(_0xa86823){return{'name':_0xa86823['fieldName'],'type':_0xa86823[_0x2c62('0x31')]['key']};});_0x1e8bad[_0x2c62('0x32')]=_[_0x2c62('0x33')](_[_0x2c62('0x2e')](_0xdcf0b5,_0x2c62('0x2c')),[_0x2c62('0x2c')]);_0x1e8bad['query']=_[_0x2c62('0x34')](_0x2cf8f6['query']);_0x1e8bad[_0x2c62('0x35')]=_[_0x2c62('0x36')](_0x1e8bad['model'],_0x1e8bad['query']);_0x18448d[_0x2c62('0x37')]=_[_0x2c62('0x36')](_0x1e8bad[_0x2c62('0x32')],qs[_0x2c62('0x38')](_0x2cf8f6[_0x2c62('0x39')][_0x2c62('0x38')]));_0x18448d['attributes']=_0x18448d[_0x2c62('0x37')]['length']?_0x18448d['attributes']:_0x1e8bad[_0x2c62('0x32')];if(!_0x2cf8f6[_0x2c62('0x39')]['hasOwnProperty'](_0x2c62('0x3a'))){_0x18448d['limit']=qs[_0x2c62('0x21')](_0x2cf8f6[_0x2c62('0x39')]['limit']);_0x18448d[_0x2c62('0x1f')]=qs[_0x2c62('0x1f')](_0x2cf8f6[_0x2c62('0x39')][_0x2c62('0x1f')]);}_0x18448d[_0x2c62('0x3b')]=qs[_0x2c62('0x3c')](_0x2cf8f6[_0x2c62('0x39')]['sort']);_0x18448d[_0x2c62('0x3d')]=qs[_0x2c62('0x35')](_[_0x2c62('0x3e')](_0x2cf8f6[_0x2c62('0x39')],_0x1e8bad[_0x2c62('0x35')]),_0xdcf0b5);if(_0x2cf8f6[_0x2c62('0x39')][_0x2c62('0x3f')]){_0x18448d[_0x2c62('0x3d')]=_[_0x2c62('0x40')](_0x18448d[_0x2c62('0x3d')],{'$or':_['map'](_0xdcf0b5,function(_0x1461dc){if(_0x1461dc[_0x2c62('0x31')]!==_0x2c62('0x41')){var _0x7836d2={};_0x7836d2[_0x1461dc[_0x2c62('0x2c')]]={'$like':'%'+_0x2cf8f6[_0x2c62('0x39')]['filter']+'%'};return _0x7836d2;}})});}_0x18448d=_[_0x2c62('0x40')]({},_0x18448d,_0x2cf8f6[_0x2c62('0x42')]);var _0x290554={'where':_0x18448d[_0x2c62('0x3d')]};return db[_0x2c62('0x2f')][_0x2c62('0x22')](_0x290554)['then'](function(_0x439cd5){_0x37f539[_0x2c62('0x22')]=_0x439cd5;if(_0x2cf8f6[_0x2c62('0x39')]['includeAll']){_0x18448d['include']=[{'all':!![]}];}return db[_0x2c62('0x2f')][_0x2c62('0x43')](_0x18448d);})[_0x2c62('0x44')](function(_0x44f9c7){_0x37f539[_0x2c62('0x45')]=_0x44f9c7;return _0x37f539;})[_0x2c62('0x44')](respondWithFilteredResult(_0x1d9192,_0x18448d))[_0x2c62('0x46')](handleError(_0x1d9192,null));};exports[_0x2c62('0x47')]=function(_0x240ec6,_0xf41d6a){var _0x70853a={'raw':!![],'where':{'id':_0x240ec6[_0x2c62('0x48')]['id']}},_0x599b2c={};_0x599b2c[_0x2c62('0x32')]=_[_0x2c62('0x34')](db['VoiceMailMessage'][_0x2c62('0x30')]);_0x599b2c[_0x2c62('0x39')]=_[_0x2c62('0x34')](_0x240ec6['query']);_0x599b2c[_0x2c62('0x35')]=_[_0x2c62('0x36')](_0x599b2c[_0x2c62('0x32')],_0x599b2c[_0x2c62('0x39')]);_0x70853a[_0x2c62('0x37')]=_[_0x2c62('0x36')](_0x599b2c['model'],qs[_0x2c62('0x38')](_0x240ec6['query']['fields']));_0x70853a[_0x2c62('0x37')]=_0x70853a[_0x2c62('0x37')][_0x2c62('0x49')]?_0x70853a['attributes']:_0x599b2c[_0x2c62('0x32')];if(_0x240ec6[_0x2c62('0x39')][_0x2c62('0x4a')]){_0x70853a[_0x2c62('0x4b')]=[{'all':!![]}];}_0x70853a=_[_0x2c62('0x40')]({},_0x70853a,_0x240ec6[_0x2c62('0x42')]);return db[_0x2c62('0x2f')][_0x2c62('0x4c')](_0x70853a)[_0x2c62('0x44')](handleEntityNotFound(_0xf41d6a,null))[_0x2c62('0x44')](respondWithResult(_0xf41d6a,null))['catch'](handleError(_0xf41d6a,null));};exports[_0x2c62('0x4d')]=function(_0x9337a9,_0x46f41e){return db[_0x2c62('0x2f')][_0x2c62('0x4d')](_0x9337a9[_0x2c62('0x4e')],{})['then'](respondWithResult(_0x46f41e,0xc9))[_0x2c62('0x46')](handleError(_0x46f41e,null));};exports[_0x2c62('0x27')]=function(_0xa7cb96,_0x2fe803){if(_0xa7cb96['body']['id']){delete _0xa7cb96['body']['id'];}return db[_0x2c62('0x2f')][_0x2c62('0x4c')]({'where':{'id':_0xa7cb96['params']['id']}})[_0x2c62('0x44')](handleEntityNotFound(_0x2fe803,null))[_0x2c62('0x44')](saveUpdates(_0xa7cb96['body'],null))['then'](respondWithResult(_0x2fe803,null))[_0x2c62('0x46')](handleError(_0x2fe803,null));};exports[_0x2c62('0x28')]=function(_0x1218fc,_0x411168){return db['VoiceMailMessage']['find']({'where':{'id':_0x1218fc[_0x2c62('0x48')]['id']}})[_0x2c62('0x44')](handleEntityNotFound(_0x411168,null))[_0x2c62('0x44')](removeEntity(_0x411168,null))[_0x2c62('0x46')](handleError(_0x411168,null));};exports[_0x2c62('0x4f')]=function(_0x29eed0,_0x3663e3,_0x36ba8f){return db[_0x2c62('0x2f')][_0x2c62('0x4c')]({'where':{'id':_0x29eed0['params']['id']},'attributes':['id',_0x2c62('0x50'),'msg_id']})[_0x2c62('0x44')](handleEntityNotFound(_0x3663e3,null))[_0x2c62('0x44')](function(_0x9c952f){if(_0x9c952f){if(!_0x9c952f[_0x2c62('0x50')]){throw new db[(_0x2c62('0x51'))][(_0x2c62('0x52'))]('VoiceMailMessage\x20not\x20found');}var _0x324da8={'Content-Type':_0x2c62('0x53'),'Content-Disposition':_0x2c62('0x54')};if(_0x9c952f[_0x2c62('0x55')]){_0x324da8['Content-Disposition']=_0x2c62('0x56')+_0x9c952f[_0x2c62('0x55')]+'.wav\x22';}_0x3663e3['set'](_0x324da8);return _0x3663e3['send'](new Buffer(_0x9c952f[_0x2c62('0x50')]));}})[_0x2c62('0x46')](handleError(_0x3663e3,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 9415f78..901814c 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 _0x65ef=['define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports'];(function(_0x435044,_0x36ab8e){var _0x33d4c6=function(_0x15efa0){while(--_0x15efa0){_0x435044['push'](_0x435044['shift']());}};_0x33d4c6(++_0x36ab8e);}(_0x65ef,0x81));var _0xf65e=function(_0x5d135a,_0x11f1ff){_0x5d135a=_0x5d135a-0x0;var _0x1212cc=_0x65ef[_0x5d135a];return _0x1212cc;};'use strict';var _=require(_0xf65e('0x0'));var util=require(_0xf65e('0x1'));var logger=require(_0xf65e('0x2'))(_0xf65e('0x3'));var moment=require(_0xf65e('0x4'));var BPromise=require(_0xf65e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf65e('0x6'));var rimraf=require(_0xf65e('0x7'));var config=require(_0xf65e('0x8'));var attributes=require(_0xf65e('0x9'));module[_0xf65e('0xa')]=function(_0x46bb3d,_0x2d3f69){return _0x46bb3d[_0xf65e('0xb')]('VoiceMailMessage',attributes,{'tableName':_0xf65e('0xc'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xf65e('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0x2554=['bluebird','request-promise','path','rimraf','./voiceMailMessage.attributes','exports','define','voice_voicemail_messages','dir','lodash','util','../../config/logger','api'];(function(_0x475a6e,_0x115da2){var _0x57e7c8=function(_0x1995ec){while(--_0x1995ec){_0x475a6e['push'](_0x475a6e['shift']());}};_0x57e7c8(++_0x115da2);}(_0x2554,0x8b));var _0x4255=function(_0x479caa,_0x2d4771){_0x479caa=_0x479caa-0x0;var _0x21c4dd=_0x2554[_0x479caa];return _0x21c4dd;};'use strict';var _=require(_0x4255('0x0'));var util=require(_0x4255('0x1'));var logger=require(_0x4255('0x2'))(_0x4255('0x3'));var moment=require('moment');var BPromise=require(_0x4255('0x4'));var rp=require(_0x4255('0x5'));var fs=require('fs');var path=require(_0x4255('0x6'));var rimraf=require(_0x4255('0x7'));var config=require('../../config/environment');var attributes=require(_0x4255('0x8'));module[_0x4255('0x9')]=function(_0x34c8ce,_0x47c1c6){return _0x34c8ce[_0x4255('0xa')]('VoiceMailMessage',attributes,{'tableName':_0x4255('0xb'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0x4255('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 5457ea9..acf5d8d 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 _0x7af7=['result','catch','lodash','util','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7af7,0x6b));var _0x77af=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x7af7[_0x34021d];return _0x16597b;};'use strict';var _=require(_0x77af('0x0'));var util=require(_0x77af('0x1'));var moment=require('moment');var BPromise=require(_0x77af('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77af('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x77af('0x4'));var logger=require('../../config/logger')(_0x77af('0x5'));var config=require(_0x77af('0x6'));var jayson=require(_0x77af('0x7'));var client=jayson[_0x77af('0x8')][_0x77af('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53fa8b,_0x4f1dc8,_0x5a5287){return new BPromise(function(_0x3d54ac,_0x23acb6){return client['request'](_0x53fa8b,_0x5a5287)[_0x77af('0xa')](function(_0x3eb03b){logger[_0x77af('0xb')](_0x77af('0xc'),_0x4f1dc8,_0x77af('0xd'));logger['debug'](_0x77af('0xe'),_0x4f1dc8,_0x77af('0xd'),JSON[_0x77af('0xf')](_0x3eb03b));if(_0x3eb03b['error']){if(_0x3eb03b[_0x77af('0x10')][_0x77af('0x11')]===0x1f4){logger[_0x77af('0x10')](_0x77af('0xc'),_0x4f1dc8,_0x3eb03b[_0x77af('0x10')][_0x77af('0x12')]);return _0x23acb6(_0x3eb03b[_0x77af('0x10')][_0x77af('0x12')]);}logger['error'](_0x77af('0xc'),_0x4f1dc8,_0x3eb03b[_0x77af('0x10')][_0x77af('0x12')]);return _0x3d54ac(_0x3eb03b[_0x77af('0x10')][_0x77af('0x12')]);}else{logger[_0x77af('0xb')](_0x77af('0xc'),_0x4f1dc8,'request\x20sent');_0x3d54ac(_0x3eb03b[_0x77af('0x13')][_0x77af('0x12')]);}})[_0x77af('0x14')](function(_0x4ccca2){logger[_0x77af('0x10')](_0x77af('0xc'),_0x4f1dc8,_0x4ccca2);_0x23acb6(_0x4ccca2);});});} \ No newline at end of file +var _0xb4a4=['request','then','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','message','util','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x2252f2,_0x2212c){var _0x5e8154=function(_0x11dec6){while(--_0x11dec6){_0x2252f2['push'](_0x2252f2['shift']());}};_0x5e8154(++_0x2212c);}(_0xb4a4,0x14e));var _0x4b4a=function(_0x140042,_0x5bc51a){_0x140042=_0x140042-0x0;var _0x3496d9=_0xb4a4[_0x140042];return _0x3496d9;};'use strict';var _=require('lodash');var util=require(_0x4b4a('0x0'));var moment=require('moment');var BPromise=require(_0x4b4a('0x1'));var rs=require(_0x4b4a('0x2'));var fs=require('fs');var Redis=require(_0x4b4a('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4b4a('0x4'))('rpc');var config=require(_0x4b4a('0x5'));var jayson=require(_0x4b4a('0x6'));var client=jayson['client'][_0x4b4a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2edfab,_0x1dde68,_0x539d64){return new BPromise(function(_0x43529e,_0x3193b4){return client[_0x4b4a('0x8')](_0x2edfab,_0x539d64)[_0x4b4a('0x9')](function(_0x86bd75){logger[_0x4b4a('0xa')](_0x4b4a('0xb'),_0x1dde68,_0x4b4a('0xc'));logger[_0x4b4a('0xd')](_0x4b4a('0xe'),_0x1dde68,'request\x20sent',JSON['stringify'](_0x86bd75));if(_0x86bd75[_0x4b4a('0xf')]){if(_0x86bd75[_0x4b4a('0xf')][_0x4b4a('0x10')]===0x1f4){logger[_0x4b4a('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1dde68,_0x86bd75[_0x4b4a('0xf')][_0x4b4a('0x11')]);return _0x3193b4(_0x86bd75[_0x4b4a('0xf')]['message']);}logger['error'](_0x4b4a('0xb'),_0x1dde68,_0x86bd75['error']['message']);return _0x43529e(_0x86bd75['error'][_0x4b4a('0x11')]);}else{logger['info']('VoiceMailMessage,\x20%s,\x20%s',_0x1dde68,_0x4b4a('0xc'));_0x43529e(_0x86bd75['result'][_0x4b4a('0x11')]);}})['catch'](function(_0x5b90c8){logger[_0x4b4a('0xf')](_0x4b4a('0xb'),_0x1dde68,_0x5b90c8);_0x3193b4(_0x5b90c8);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 23bf996..27e547d 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 _0x0708=['delete','destroy','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','/:id/sounds','getSounds','post','create','addSound','put','update'];(function(_0xd8aad0,_0x4da2cd){var _0x570860=function(_0x1acc03){while(--_0x1acc03){_0xd8aad0['push'](_0xd8aad0['shift']());}};_0x570860(++_0x4da2cd);}(_0x0708,0xa2));var _0x8070=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x0708[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require('multer');var util=require(_0x8070('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8070('0x1')]();var fs_extra=require(_0x8070('0x2'));var auth=require(_0x8070('0x3'));var interaction=require(_0x8070('0x4'));var config=require(_0x8070('0x5'));var controller=require(_0x8070('0x6'));router[_0x8070('0x7')]('/',auth['isAuthenticated'](),controller[_0x8070('0x8')]);router[_0x8070('0x7')](_0x8070('0x9'),auth[_0x8070('0xa')](),controller['show']);router[_0x8070('0x7')](_0x8070('0xb'),auth[_0x8070('0xa')](),controller[_0x8070('0xc')]);router[_0x8070('0xd')]('/',auth[_0x8070('0xa')](),controller[_0x8070('0xe')]);router[_0x8070('0xd')](_0x8070('0xb'),auth[_0x8070('0xa')](),controller[_0x8070('0xf')]);router[_0x8070('0x10')](_0x8070('0x9'),auth['isAuthenticated'](),controller[_0x8070('0x11')]);router[_0x8070('0x12')]('/:id',auth[_0x8070('0xa')](),controller[_0x8070('0x13')]);router[_0x8070('0x12')]('/:id/sounds/:id2',auth['isAuthenticated'](),controller['removeSound']);module['exports']=router; \ No newline at end of file +var _0xa5c1=['util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','/:id','/:id/sounds','getSounds','post','addSound','put','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer'];(function(_0x1aba9c,_0x465976){var _0x414891=function(_0x179f91){while(--_0x179f91){_0x1aba9c['push'](_0x1aba9c['shift']());}};_0x414891(++_0x465976);}(_0xa5c1,0x6d));var _0x1a5c=function(_0x1030e0,_0xb11f73){_0x1030e0=_0x1030e0-0x0;var _0xa9bb57=_0xa5c1[_0x1030e0];return _0xa9bb57;};'use strict';var multer=require(_0x1a5c('0x0'));var util=require(_0x1a5c('0x1'));var path=require('path');var timeout=require(_0x1a5c('0x2'));var express=require('express');var router=express[_0x1a5c('0x3')]();var fs_extra=require(_0x1a5c('0x4'));var auth=require(_0x1a5c('0x5'));var interaction=require(_0x1a5c('0x6'));var config=require(_0x1a5c('0x7'));var controller=require(_0x1a5c('0x8'));router[_0x1a5c('0x9')]('/',auth[_0x1a5c('0xa')](),controller['index']);router[_0x1a5c('0x9')](_0x1a5c('0xb'),auth[_0x1a5c('0xa')](),controller['show']);router[_0x1a5c('0x9')](_0x1a5c('0xc'),auth[_0x1a5c('0xa')](),controller[_0x1a5c('0xd')]);router[_0x1a5c('0xe')]('/',auth[_0x1a5c('0xa')](),controller['create']);router[_0x1a5c('0xe')](_0x1a5c('0xc'),auth[_0x1a5c('0xa')](),controller[_0x1a5c('0xf')]);router[_0x1a5c('0x10')]('/:id',auth[_0x1a5c('0xa')](),controller['update']);router[_0x1a5c('0x11')](_0x1a5c('0xb'),auth[_0x1a5c('0xa')](),controller[_0x1a5c('0x12')]);router[_0x1a5c('0x11')](_0x1a5c('0x13'),auth[_0x1a5c('0xa')](),controller[_0x1a5c('0x14')]);module[_0x1a5c('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index dbad378..3236e68 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 _0xabb6=['custom','files','mp3nb','quietmp3','TIMESTAMP','exports','STRING','ENUM'];(function(_0x166f55,_0xd28166){var _0x5ab18a=function(_0x495c0b){while(--_0x495c0b){_0x166f55['push'](_0x166f55['shift']());}};_0x5ab18a(++_0xd28166);}(_0xabb6,0x9d));var _0x6abb=function(_0x3d9916,_0x129de9){_0x3d9916=_0x3d9916-0x0;var _0x69a929=_0xabb6[_0x3d9916];return _0x69a929;};'use strict';var Sequelize=require('sequelize');module[_0x6abb('0x0')]={'name':{'type':Sequelize[_0x6abb('0x1')],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x6abb('0x2')](_0x6abb('0x3'),_0x6abb('0x4'),_0x6abb('0x5'),'quietmp3nb',_0x6abb('0x6'),'mp3'),'allowNull':!![],'defaultValue':_0x6abb('0x4')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x6abb('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6abb('0x1')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x6abb('0x1')],'allowNull':!![]},'stamp':{'type':_0x6abb('0x7')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x0633=['STRING','name','files','mp3nb','quietmp3nb','mp3','alpha','TIMESTAMP','BOOLEAN','sequelize'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x0633,0x153));var _0x3063=function(_0x508d5f,_0x2a7b45){_0x508d5f=_0x508d5f-0x0;var _0x5029a3=_0x0633[_0x508d5f];return _0x5029a3;};'use strict';var Sequelize=require(_0x3063('0x0'));module['exports']={'name':{'type':Sequelize[_0x3063('0x1')],'allowNull':![],'unique':_0x3063('0x2')},'mode':{'type':Sequelize['ENUM']('custom',_0x3063('0x3'),_0x3063('0x4'),_0x3063('0x5'),'quietmp3',_0x3063('0x6')),'allowNull':!![],'defaultValue':_0x3063('0x3')},'directory':{'type':Sequelize[_0x3063('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x3063('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x3063('0x1')],'allowNull':!![]},'sort':{'type':Sequelize[_0x3063('0x1')],'allowNull':!![],'defaultValue':_0x3063('0x7')},'format':{'type':Sequelize[_0x3063('0x1')],'allowNull':!![]},'stamp':{'type':_0x3063('0x8')},'defaultEntry':{'type':Sequelize[_0x3063('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 ee73b56..f16c63f 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 _0x29ee=['rawAttributes','find','update','body','catch','sequelize','transaction','mode','files','directory','join','root','create','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MusicOnHolds','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','message','Sound','findOne','save_name','createdAt','server/files/sounds/converted','format','%s.%s','basename','extname','converted_format','server/files/moh','symlinkSync','removeSound','id2','getSounds','length','nolimit','eml-format','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','then','destroy','stack','name','send','map','VoiceMusicOnHold','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params'];(function(_0x39551a,_0x116007){var _0x4b0b62=function(_0x3d8a12){while(--_0x3d8a12){_0x39551a['push'](_0x39551a['shift']());}};_0x4b0b62(++_0x116007);}(_0x29ee,0x174));var _0xe29e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x29ee[_0x376b45];return _0x2341b3;};'use strict';var emlformat=require(_0xe29e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe29e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe29e('0x2'));var BPromise=require(_0xe29e('0x3'));var Mustache=require(_0xe29e('0x4'));var util=require('util');var path=require(_0xe29e('0x5'));var sox=require('sox');var csv=require(_0xe29e('0x6'));var ejs=require(_0xe29e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe29e('0x8'));var squel=require(_0xe29e('0x9'));var crypto=require(_0xe29e('0xa'));var jsforce=require(_0xe29e('0xb'));var deskjs=require(_0xe29e('0xc'));var toCsv=require(_0xe29e('0x6'));var querystring=require(_0xe29e('0xd'));var Papa=require(_0xe29e('0xe'));var Redis=require(_0xe29e('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe29e('0x10'));var as=require(_0xe29e('0x11'));var hardwareService=require(_0xe29e('0x12'));var logger=require(_0xe29e('0x13'))('api');var utils=require(_0xe29e('0x14'));var config=require(_0xe29e('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xe29e('0x16'))['db'];function respondWithStatusCode(_0x2dac63,_0x2e332b){_0x2e332b=_0x2e332b||0xcc;return function(_0xd2018b){if(_0xd2018b){return _0x2dac63[_0xe29e('0x17')](_0x2e332b);}return _0x2dac63[_0xe29e('0x18')](_0x2e332b)[_0xe29e('0x19')]();};}function respondWithResult(_0x3be0af,_0x48fb74){_0x48fb74=_0x48fb74||0xc8;return function(_0x3f9af3){if(_0x3f9af3){return _0x3be0af[_0xe29e('0x18')](_0x48fb74)[_0xe29e('0x1a')](_0x3f9af3);}};}function respondWithFilteredResult(_0x41265b,_0x2041fc){return function(_0x395089){if(_0x395089){var _0x5b47d3=typeof _0x2041fc[_0xe29e('0x1b')]==='undefined'&&typeof _0x2041fc[_0xe29e('0x1c')]==='undefined';var _0x793cd3=_0x395089[_0xe29e('0x1d')];var _0x2d783a=_0x5b47d3?0x0:_0x2041fc[_0xe29e('0x1b')];var _0x17ec42=_0x5b47d3?_0x395089['count']:_0x2041fc[_0xe29e('0x1b')]+_0x2041fc[_0xe29e('0x1c')];var _0x33259b;if(_0x17ec42>=_0x793cd3){_0x17ec42=_0x793cd3;_0x33259b=0xc8;}else{_0x33259b=0xce;}_0x41265b[_0xe29e('0x18')](_0x33259b);return _0x41265b[_0xe29e('0x1e')](_0xe29e('0x1f'),_0x2d783a+'-'+_0x17ec42+'/'+_0x793cd3)['json'](_0x395089);}return null;};}function patchUpdates(_0x2281c5){return function(_0x2f4309){try{jsonpatch[_0xe29e('0x20')](_0x2f4309,_0x2281c5,!![]);}catch(_0x33815d){return BPromise[_0xe29e('0x21')](_0x33815d);}return _0x2f4309[_0xe29e('0x22')]();};}function saveUpdates(_0x59bd8b,_0x52a805){return function(_0x42bd1e){if(_0x42bd1e){return _0x42bd1e['update'](_0x59bd8b)[_0xe29e('0x23')](function(_0x296897){return _0x296897;});}return null;};}function removeEntity(_0x4d8720,_0x37b7f1){return function(_0x528317){if(_0x528317){return _0x528317[_0xe29e('0x24')]()['then'](function(){var _0xf1fecc=_0x528317['get']({'plain':!![]});var _0x2770ae='MusicOnHolds';return db['UserProfileResource']['destroy']({'where':{'type':_0x2770ae,'resourceId':_0xf1fecc['id']}})[_0xe29e('0x23')](function(){return _0x528317;});})[_0xe29e('0x23')](function(){_0x4d8720[_0xe29e('0x18')](0xcc)[_0xe29e('0x19')]();});}};}function handleEntityNotFound(_0x52a6f8,_0x2c3a60){return function(_0x5bf445){if(!_0x5bf445){_0x52a6f8['sendStatus'](0x194);}return _0x5bf445;};}function handleError(_0x508b57,_0x5125e3){_0x5125e3=_0x5125e3||0x1f4;return function(_0x7e3de3){logger['error'](_0x7e3de3[_0xe29e('0x25')]);if(_0x7e3de3['name']){delete _0x7e3de3[_0xe29e('0x26')];}_0x508b57[_0xe29e('0x18')](_0x5125e3)[_0xe29e('0x27')](_0x7e3de3);};}exports['index']=function(_0x4e6240,_0x52996b){var _0x4a894d={},_0x530aad={},_0x3f6751={'count':0x0,'rows':[]};var _0x5831d8=_[_0xe29e('0x28')](db[_0xe29e('0x29')]['rawAttributes'],function(_0xa6f8d4){return{'name':_0xa6f8d4[_0xe29e('0x2a')],'type':_0xa6f8d4[_0xe29e('0x2b')][_0xe29e('0x2c')]};});_0x530aad[_0xe29e('0x2d')]=_[_0xe29e('0x28')](_0x5831d8,_0xe29e('0x26'));_0x530aad['query']=_[_0xe29e('0x2e')](_0x4e6240[_0xe29e('0x2f')]);_0x530aad['filters']=_[_0xe29e('0x30')](_0x530aad['model'],_0x530aad[_0xe29e('0x2f')]);_0x4a894d[_0xe29e('0x31')]=_[_0xe29e('0x30')](_0x530aad['model'],qs[_0xe29e('0x32')](_0x4e6240[_0xe29e('0x2f')]['fields']));_0x4a894d[_0xe29e('0x31')]=_0x4a894d['attributes']['length']?_0x4a894d[_0xe29e('0x31')]:_0x530aad['model'];if(!_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x33')]('nolimit')){_0x4a894d[_0xe29e('0x1c')]=qs[_0xe29e('0x1c')](_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x1c')]);_0x4a894d[_0xe29e('0x1b')]=qs['offset'](_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x1b')]);}_0x4a894d['order']=qs[_0xe29e('0x34')](_0x4e6240[_0xe29e('0x2f')]['sort']);delete _0x4e6240['query'][_0xe29e('0x34')];_0x4a894d[_0xe29e('0x35')]=qs[_0xe29e('0x36')](_[_0xe29e('0x37')](_0x4e6240[_0xe29e('0x2f')],_0x530aad[_0xe29e('0x36')]),_0x5831d8);if(_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x38')]){_0x4a894d[_0xe29e('0x35')]=_[_0xe29e('0x39')](_0x4a894d[_0xe29e('0x35')],{'$or':_[_0xe29e('0x28')](_0x5831d8,function(_0x1d0f7c){if(_0x1d0f7c['type']!=='VIRTUAL'){var _0x4bdcdc={};_0x4bdcdc[_0x1d0f7c[_0xe29e('0x26')]]={'$like':'%'+_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x38')]+'%'};return _0x4bdcdc;}})});}_0x4a894d=_[_0xe29e('0x39')]({},_0x4a894d,_0x4e6240[_0xe29e('0x3a')]);var _0xd636c5={'where':_0x4a894d[_0xe29e('0x35')]};return db['VoiceMusicOnHold']['count'](_0xd636c5)[_0xe29e('0x23')](function(_0x35cbb1){_0x3f6751['count']=_0x35cbb1;if(_0x4e6240[_0xe29e('0x2f')][_0xe29e('0x3b')]){_0x4a894d[_0xe29e('0x3c')]=[{'all':!![]}];}return db[_0xe29e('0x29')][_0xe29e('0x3d')](_0x4a894d);})[_0xe29e('0x23')](function(_0x47b609){_0x3f6751[_0xe29e('0x3e')]=_0x47b609;return _0x3f6751;})[_0xe29e('0x23')](respondWithFilteredResult(_0x52996b,_0x4a894d))['catch'](handleError(_0x52996b,null));};exports['show']=function(_0x4d69c3,_0x1f8a20){var _0x5c9bc5={'raw':![],'where':{'id':_0x4d69c3[_0xe29e('0x3f')]['id']}},_0x430d51={};_0x430d51[_0xe29e('0x2d')]=_[_0xe29e('0x2e')](db[_0xe29e('0x29')][_0xe29e('0x40')]);_0x430d51[_0xe29e('0x2f')]=_[_0xe29e('0x2e')](_0x4d69c3['query']);_0x430d51[_0xe29e('0x36')]=_['intersection'](_0x430d51[_0xe29e('0x2d')],_0x430d51[_0xe29e('0x2f')]);_0x5c9bc5[_0xe29e('0x31')]=_['intersection'](_0x430d51[_0xe29e('0x2d')],qs[_0xe29e('0x32')](_0x4d69c3[_0xe29e('0x2f')][_0xe29e('0x32')]));_0x5c9bc5['attributes']=_0x5c9bc5[_0xe29e('0x31')]['length']?_0x5c9bc5[_0xe29e('0x31')]:_0x430d51[_0xe29e('0x2d')];if(_0x4d69c3['query'][_0xe29e('0x3b')]){_0x5c9bc5[_0xe29e('0x3c')]=[{'all':!![]}];}_0x5c9bc5=_[_0xe29e('0x39')]({},_0x5c9bc5,_0x4d69c3['options']);return db[_0xe29e('0x29')][_0xe29e('0x41')](_0x5c9bc5)[_0xe29e('0x23')](handleEntityNotFound(_0x1f8a20,null))[_0xe29e('0x23')](respondWithResult(_0x1f8a20,null))['catch'](handleError(_0x1f8a20,null));};exports[_0xe29e('0x42')]=function(_0x48d0a1,_0x228cd6){if(_0x48d0a1[_0xe29e('0x43')]['id']){delete _0x48d0a1[_0xe29e('0x43')]['id'];}return db['VoiceMusicOnHold'][_0xe29e('0x41')]({'where':{'id':_0x48d0a1[_0xe29e('0x3f')]['id']}})[_0xe29e('0x23')](handleEntityNotFound(_0x228cd6,null))[_0xe29e('0x23')](saveUpdates(_0x48d0a1[_0xe29e('0x43')],null))[_0xe29e('0x23')](respondWithResult(_0x228cd6,null))[_0xe29e('0x44')](handleError(_0x228cd6,null));};exports['create']=function(_0x43fde6,_0x26e2f8,_0x13736f){return db[_0xe29e('0x45')][_0xe29e('0x46')](function(_0x3a8bfe){if(_0x43fde6[_0xe29e('0x43')][_0xe29e('0x47')]===_0xe29e('0x48')){_0x43fde6[_0xe29e('0x43')][_0xe29e('0x49')]=path[_0xe29e('0x4a')](config[_0xe29e('0x4b')],'server/files/moh',_0x43fde6[_0xe29e('0x43')][_0xe29e('0x26')]);}return db['VoiceMusicOnHold'][_0xe29e('0x4c')](_0x43fde6[_0xe29e('0x43')],{'transaction':_0x3a8bfe})['then'](function(_0xf9bf3e){if(_0x43fde6[_0xe29e('0x43')][_0xe29e('0x47')]===_0xe29e('0x48')){fs['mkdirSync'](_0xf9bf3e[_0xe29e('0x49')],parseInt(_0xe29e('0x4d'),0x8));}var _0x2d27e5=_0x43fde6[_0xe29e('0x4e')][_0xe29e('0x4f')]({'plain':!![]});if(!_0x2d27e5)throw new Error(_0xe29e('0x50'));if(_0x2d27e5['role']===_0xe29e('0x4e')){var _0x1736d7=_0xf9bf3e[_0xe29e('0x4f')]({'plain':!![]});return db[_0xe29e('0x51')]['find']({'where':{'name':_0xe29e('0x52'),'userProfileId':_0x2d27e5['userProfileId']},'raw':!![]})[_0xe29e('0x23')](function(_0x49ea76){if(_0x49ea76&&_0x49ea76[_0xe29e('0x53')]===0x0){return db[_0xe29e('0x54')][_0xe29e('0x4c')]({'name':_0x1736d7[_0xe29e('0x26')],'resourceId':_0x1736d7['id'],'type':_0x49ea76[_0xe29e('0x26')],'sectionId':_0x49ea76['id']},{})[_0xe29e('0x23')](function(){return _0xf9bf3e;});}else{return _0xf9bf3e;}})[_0xe29e('0x44')](function(_0x5ad63a){logger['error'](_0xe29e('0x55'),_0x5ad63a);});}return _0xf9bf3e;});})['then'](respondWithResult(_0x26e2f8,0xc9))['catch'](handleError(_0x26e2f8,null));};exports[_0xe29e('0x24')]=function(_0x4143d2,_0x482d26,_0x3489d2){var _0x1259d2;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4143d2['params']['id']}})[_0xe29e('0x23')](function(_0x2b7e89){if(_0x2b7e89){return db['sequelize'][_0xe29e('0x46')](function(_0x289dff){return _0x2b7e89[_0xe29e('0x24')]({'transaction':_0x289dff,'raw':!![]})['then'](function(_0x3322d7){if(_0x3322d7['directory']){fs[_0xe29e('0x56')](_0x3322d7[_0xe29e('0x49')])[_0xe29e('0x57')](function(_0x1aa9e8){fs[_0xe29e('0x58')](path['join'](_0x3322d7[_0xe29e('0x49')],_0x1aa9e8));});fs['rmdirSync'](_0x3322d7[_0xe29e('0x49')]);}return _0x3322d7;});})[_0xe29e('0x44')](function(_0x1977e8){throw new db[(_0xe29e('0x59'))][(_0xe29e('0x5a'))](_0x1977e8[_0xe29e('0x5b')]);});}})[_0xe29e('0x23')](handleEntityNotFound(_0x482d26,null))['then'](removeEntity(_0x482d26,null))[_0xe29e('0x44')](handleError(_0x482d26,null));};exports['addSound']=function(_0x19c7ec,_0xb56535,_0x5def30){return db['sequelize'][_0xe29e('0x46')](function(_0x46a2e3){var _0x1e55db;return db[_0xe29e('0x29')][_0xe29e('0x41')]({'where':{'id':_0x19c7ec[_0xe29e('0x3f')]['id']}})[_0xe29e('0x23')](function(_0x4c40dd){if(_0x4c40dd){_0x1e55db=_0x4c40dd;return _0x4c40dd['addSound'](_0x19c7ec[_0xe29e('0x43')]['id'],{'transaction':_0x46a2e3});}})[_0xe29e('0x23')](function(_0xd6274e){if(_0xd6274e){return db[_0xe29e('0x5c')][_0xe29e('0x5d')]({'where':{'id':_0x19c7ec[_0xe29e('0x43')]['id']},'attributes':['id','name',_0xe29e('0x5e'),'converted_format',_0xe29e('0x5f')],'raw':!![]});}})[_0xe29e('0x23')](function(_0x3396c6){if(_0x3396c6){var _0x352210=path[_0xe29e('0x4a')](config[_0xe29e('0x4b')],_0xe29e('0x60'),util[_0xe29e('0x61')](_0xe29e('0x62'),path[_0xe29e('0x63')](_0x3396c6[_0xe29e('0x5e')],path[_0xe29e('0x64')](_0x3396c6[_0xe29e('0x5e')])),_0x3396c6[_0xe29e('0x65')]));var _0x33d9df=path[_0xe29e('0x4a')](config[_0xe29e('0x4b')],_0xe29e('0x66'),_0x1e55db['name'],util[_0xe29e('0x61')](_0xe29e('0x62'),_0x3396c6[_0xe29e('0x26')],_0x3396c6['converted_format']));fs[_0xe29e('0x67')](_0x352210,_0x33d9df);return _0x3396c6;}})['catch'](function(_0x37e95f){throw new db[(_0xe29e('0x59'))]['ValidationError'](_0x37e95f['message']);});})[_0xe29e('0x23')](handleEntityNotFound(_0xb56535,null))[_0xe29e('0x23')](respondWithResult(_0xb56535,0xc9))['catch'](handleError(_0xb56535,null));};exports[_0xe29e('0x68')]=function(_0x55ffda,_0x3c98e2,_0xc6aa53){return db['sequelize'][_0xe29e('0x46')](function(_0x12d590){var _0x6be2b4;return db[_0xe29e('0x29')]['findOne']({'where':{'id':_0x55ffda[_0xe29e('0x3f')]['id']}})[_0xe29e('0x23')](handleEntityNotFound(_0x3c98e2,null))[_0xe29e('0x23')](function(_0x305779){if(_0x305779){_0x6be2b4=_0x305779;return _0x305779['removeSound'](_0x55ffda[_0xe29e('0x3f')][_0xe29e('0x69')]);}})['then'](function(_0x58351f){if(_0x58351f){return db[_0xe29e('0x5c')][_0xe29e('0x5d')]({'where':{'id':_0x55ffda[_0xe29e('0x3f')][_0xe29e('0x69')]},'attributes':['id',_0xe29e('0x26'),'save_name','converted_format','createdAt'],'raw':!![]});}})['then'](function(_0xd2621f){if(_0xd2621f){fs[_0xe29e('0x58')](path[_0xe29e('0x4a')](_0x6be2b4[_0xe29e('0x49')],util[_0xe29e('0x61')](_0xe29e('0x62'),_0xd2621f[_0xe29e('0x26')],_0xd2621f[_0xe29e('0x65')])));return _0xd2621f;}})[_0xe29e('0x44')](function(_0x128e9c){throw new db[(_0xe29e('0x59'))]['ValidationError'](_0x128e9c[_0xe29e('0x5b')]);});})[_0xe29e('0x23')](handleEntityNotFound(_0x3c98e2,null))[_0xe29e('0x23')](respondWithStatusCode(_0x3c98e2,0xcc))[_0xe29e('0x44')](handleError(_0x3c98e2,null));};exports[_0xe29e('0x6a')]=function(_0x1626a4,_0x2af427,_0x10175c){var _0x53bced={};var _0x3ed790={};var _0xd3cc72;var _0x1607b5;return db[_0xe29e('0x29')][_0xe29e('0x5d')]({'where':{'id':_0x1626a4[_0xe29e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2af427,null))[_0xe29e('0x23')](function(_0x76b23){if(_0x76b23){_0xd3cc72=_0x76b23;_0x3ed790[_0xe29e('0x2d')]=_['keys'](db[_0xe29e('0x5c')][_0xe29e('0x40')]);_0x3ed790[_0xe29e('0x2f')]=_[_0xe29e('0x2e')](_0x1626a4[_0xe29e('0x2f')]);_0x3ed790[_0xe29e('0x36')]=_[_0xe29e('0x30')](_0x3ed790['model'],_0x3ed790[_0xe29e('0x2f')]);_0x53bced[_0xe29e('0x31')]=_[_0xe29e('0x30')](_0x3ed790['model'],qs[_0xe29e('0x32')](_0x1626a4[_0xe29e('0x2f')]['fields']));_0x53bced['attributes']=_0x53bced[_0xe29e('0x31')]['length']?_0x53bced[_0xe29e('0x31')]:_0x3ed790[_0xe29e('0x2d')];_0x53bced['order']=qs[_0xe29e('0x34')](_0x1626a4[_0xe29e('0x2f')][_0xe29e('0x34')]);_0x53bced[_0xe29e('0x35')]=qs[_0xe29e('0x36')](_[_0xe29e('0x37')](_0x1626a4['query'],_0x3ed790['filters']));if(_0x1626a4[_0xe29e('0x2f')][_0xe29e('0x38')]){_0x53bced[_0xe29e('0x35')]=_[_0xe29e('0x39')](_0x53bced[_0xe29e('0x35')],{'$or':_[_0xe29e('0x28')](_0x53bced[_0xe29e('0x31')],function(_0x510f93){var _0x17f824={};_0x17f824[_0x510f93]={'$like':'%'+_0x1626a4[_0xe29e('0x2f')][_0xe29e('0x38')]+'%'};return _0x17f824;})});}_0x53bced=_[_0xe29e('0x39')]({},_0x53bced,_0x1626a4['options']);return _0xd3cc72[_0xe29e('0x6a')](_0x53bced);}})[_0xe29e('0x23')](function(_0x595581){if(_0x595581){_0x1607b5=_0x595581[_0xe29e('0x6b')];if(!_0x1626a4[_0xe29e('0x2f')][_0xe29e('0x33')](_0xe29e('0x6c'))){_0x53bced[_0xe29e('0x1c')]=qs[_0xe29e('0x1c')](_0x1626a4['query']['limit']);_0x53bced[_0xe29e('0x1b')]=qs[_0xe29e('0x1b')](_0x1626a4[_0xe29e('0x2f')]['offset']);}return _0xd3cc72['getSounds'](_0x53bced);}})[_0xe29e('0x23')](function(_0x409697){if(_0x409697){return _0x409697?{'count':_0x1607b5,'rows':_0x409697}:null;}})[_0xe29e('0x23')](respondWithResult(_0x2af427,null))[_0xe29e('0x44')](handleError(_0x2af427,null));}; \ No newline at end of file +var _0x0556=['transaction','mode','files','directory','join','root','server/files/moh','mkdirSync','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','error','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','message','addSound','Sound','findOne','converted_format','createdAt','format','%s.%s','save_name','extname','removeSound','id2','ValidationError','getSounds','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','reject','save','update','destroy','then','get','UserProfileResource','name','index','map','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VoiceMusicOnHold','include','findAll','rows','catch','show','params','rawAttributes','keys','find','body','create','sequelize'];(function(_0x4c223f,_0x42d4d4){var _0x1252cb=function(_0x434f93){while(--_0x434f93){_0x4c223f['push'](_0x4c223f['shift']());}};_0x1252cb(++_0x42d4d4);}(_0x0556,0x8d));var _0x6055=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x0556[_0x3ebb69];return _0x421e59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6055('0x0'));var jsonpatch=require(_0x6055('0x1'));var rp=require(_0x6055('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6055('0x3'));var util=require(_0x6055('0x4'));var path=require('path');var sox=require(_0x6055('0x5'));var csv=require(_0x6055('0x6'));var ejs=require(_0x6055('0x7'));var fs=require('fs');var fs_extra=require(_0x6055('0x8'));var _=require(_0x6055('0x9'));var squel=require(_0x6055('0xa'));var crypto=require(_0x6055('0xb'));var jsforce=require(_0x6055('0xc'));var deskjs=require(_0x6055('0xd'));var toCsv=require(_0x6055('0x6'));var querystring=require(_0x6055('0xe'));var Papa=require(_0x6055('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6055('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6055('0x11'));var logger=require(_0x6055('0x12'))(_0x6055('0x13'));var utils=require(_0x6055('0x14'));var config=require(_0x6055('0x15'));var licenseUtil=require(_0x6055('0x16'));var db=require(_0x6055('0x17'))['db'];function respondWithStatusCode(_0x42a984,_0x5b714c){_0x5b714c=_0x5b714c||0xcc;return function(_0x57f95b){if(_0x57f95b){return _0x42a984[_0x6055('0x18')](_0x5b714c);}return _0x42a984[_0x6055('0x19')](_0x5b714c)[_0x6055('0x1a')]();};}function respondWithResult(_0x45ea9c,_0x47e257){_0x47e257=_0x47e257||0xc8;return function(_0x332260){if(_0x332260){return _0x45ea9c[_0x6055('0x19')](_0x47e257)[_0x6055('0x1b')](_0x332260);}};}function respondWithFilteredResult(_0x557b3a,_0x5d167a){return function(_0x15781b){if(_0x15781b){var _0x162a4e=typeof _0x5d167a['offset']===_0x6055('0x1c')&&typeof _0x5d167a[_0x6055('0x1d')]===_0x6055('0x1c');var _0x47c90d=_0x15781b[_0x6055('0x1e')];var _0xc04859=_0x162a4e?0x0:_0x5d167a[_0x6055('0x1f')];var _0xfb1494=_0x162a4e?_0x15781b[_0x6055('0x1e')]:_0x5d167a['offset']+_0x5d167a[_0x6055('0x1d')];var _0x5d718d;if(_0xfb1494>=_0x47c90d){_0xfb1494=_0x47c90d;_0x5d718d=0xc8;}else{_0x5d718d=0xce;}_0x557b3a[_0x6055('0x19')](_0x5d718d);return _0x557b3a['set']('Content-Range',_0xc04859+'-'+_0xfb1494+'/'+_0x47c90d)[_0x6055('0x1b')](_0x15781b);}return null;};}function patchUpdates(_0x110370){return function(_0x2de72f){try{jsonpatch['apply'](_0x2de72f,_0x110370,!![]);}catch(_0x48796f){return BPromise[_0x6055('0x20')](_0x48796f);}return _0x2de72f[_0x6055('0x21')]();};}function saveUpdates(_0x168288,_0x2d3022){return function(_0x39fe83){if(_0x39fe83){return _0x39fe83[_0x6055('0x22')](_0x168288)['then'](function(_0x1c14c3){return _0x1c14c3;});}return null;};}function removeEntity(_0x5d28a0,_0x2489b0){return function(_0x52216c){if(_0x52216c){return _0x52216c[_0x6055('0x23')]()[_0x6055('0x24')](function(){var _0xcf2996=_0x52216c[_0x6055('0x25')]({'plain':!![]});var _0x473861='MusicOnHolds';return db[_0x6055('0x26')][_0x6055('0x23')]({'where':{'type':_0x473861,'resourceId':_0xcf2996['id']}})['then'](function(){return _0x52216c;});})[_0x6055('0x24')](function(){_0x5d28a0['status'](0xcc)[_0x6055('0x1a')]();});}};}function handleEntityNotFound(_0x1f27a3,_0x48e0b0){return function(_0x527038){if(!_0x527038){_0x1f27a3[_0x6055('0x18')](0x194);}return _0x527038;};}function handleError(_0x44a6e1,_0x1b5afb){_0x1b5afb=_0x1b5afb||0x1f4;return function(_0x2e8042){logger['error'](_0x2e8042['stack']);if(_0x2e8042[_0x6055('0x27')]){delete _0x2e8042['name'];}_0x44a6e1['status'](_0x1b5afb)['send'](_0x2e8042);};}exports[_0x6055('0x28')]=function(_0x20fb00,_0x475ddd){var _0xcc6654={},_0x358f0a={},_0xb31194={'count':0x0,'rows':[]};var _0x2e6d=_[_0x6055('0x29')](db['VoiceMusicOnHold']['rawAttributes'],function(_0x5ca968){return{'name':_0x5ca968[_0x6055('0x2a')],'type':_0x5ca968['type'][_0x6055('0x2b')]};});_0x358f0a[_0x6055('0x2c')]=_[_0x6055('0x29')](_0x2e6d,_0x6055('0x27'));_0x358f0a[_0x6055('0x2d')]=_['keys'](_0x20fb00[_0x6055('0x2d')]);_0x358f0a[_0x6055('0x2e')]=_[_0x6055('0x2f')](_0x358f0a['model'],_0x358f0a[_0x6055('0x2d')]);_0xcc6654[_0x6055('0x30')]=_[_0x6055('0x2f')](_0x358f0a[_0x6055('0x2c')],qs['fields'](_0x20fb00[_0x6055('0x2d')][_0x6055('0x31')]));_0xcc6654[_0x6055('0x30')]=_0xcc6654[_0x6055('0x30')][_0x6055('0x32')]?_0xcc6654['attributes']:_0x358f0a[_0x6055('0x2c')];if(!_0x20fb00[_0x6055('0x2d')][_0x6055('0x33')](_0x6055('0x34'))){_0xcc6654[_0x6055('0x1d')]=qs[_0x6055('0x1d')](_0x20fb00[_0x6055('0x2d')]['limit']);_0xcc6654[_0x6055('0x1f')]=qs['offset'](_0x20fb00[_0x6055('0x2d')][_0x6055('0x1f')]);}_0xcc6654['order']=qs[_0x6055('0x35')](_0x20fb00[_0x6055('0x2d')][_0x6055('0x35')]);delete _0x20fb00[_0x6055('0x2d')][_0x6055('0x35')];_0xcc6654[_0x6055('0x36')]=qs['filters'](_[_0x6055('0x37')](_0x20fb00['query'],_0x358f0a[_0x6055('0x2e')]),_0x2e6d);if(_0x20fb00['query'][_0x6055('0x38')]){_0xcc6654['where']=_[_0x6055('0x39')](_0xcc6654[_0x6055('0x36')],{'$or':_[_0x6055('0x29')](_0x2e6d,function(_0x4c7f89){if(_0x4c7f89['type']!=='VIRTUAL'){var _0x2c572e={};_0x2c572e[_0x4c7f89[_0x6055('0x27')]]={'$like':'%'+_0x20fb00[_0x6055('0x2d')][_0x6055('0x38')]+'%'};return _0x2c572e;}})});}_0xcc6654=_[_0x6055('0x39')]({},_0xcc6654,_0x20fb00['options']);var _0x3bcc55={'where':_0xcc6654[_0x6055('0x36')]};return db[_0x6055('0x3a')]['count'](_0x3bcc55)['then'](function(_0x3c4697){_0xb31194[_0x6055('0x1e')]=_0x3c4697;if(_0x20fb00[_0x6055('0x2d')]['includeAll']){_0xcc6654[_0x6055('0x3b')]=[{'all':!![]}];}return db[_0x6055('0x3a')][_0x6055('0x3c')](_0xcc6654);})['then'](function(_0x1821d9){_0xb31194[_0x6055('0x3d')]=_0x1821d9;return _0xb31194;})[_0x6055('0x24')](respondWithFilteredResult(_0x475ddd,_0xcc6654))[_0x6055('0x3e')](handleError(_0x475ddd,null));};exports[_0x6055('0x3f')]=function(_0x1194fc,_0x10b9f7){var _0x349b0e={'raw':![],'where':{'id':_0x1194fc[_0x6055('0x40')]['id']}},_0x4116d2={};_0x4116d2[_0x6055('0x2c')]=_['keys'](db[_0x6055('0x3a')][_0x6055('0x41')]);_0x4116d2['query']=_[_0x6055('0x42')](_0x1194fc[_0x6055('0x2d')]);_0x4116d2[_0x6055('0x2e')]=_[_0x6055('0x2f')](_0x4116d2[_0x6055('0x2c')],_0x4116d2[_0x6055('0x2d')]);_0x349b0e[_0x6055('0x30')]=_[_0x6055('0x2f')](_0x4116d2['model'],qs['fields'](_0x1194fc['query']['fields']));_0x349b0e[_0x6055('0x30')]=_0x349b0e[_0x6055('0x30')][_0x6055('0x32')]?_0x349b0e[_0x6055('0x30')]:_0x4116d2[_0x6055('0x2c')];if(_0x1194fc['query']['includeAll']){_0x349b0e[_0x6055('0x3b')]=[{'all':!![]}];}_0x349b0e=_[_0x6055('0x39')]({},_0x349b0e,_0x1194fc['options']);return db['VoiceMusicOnHold'][_0x6055('0x43')](_0x349b0e)[_0x6055('0x24')](handleEntityNotFound(_0x10b9f7,null))[_0x6055('0x24')](respondWithResult(_0x10b9f7,null))[_0x6055('0x3e')](handleError(_0x10b9f7,null));};exports[_0x6055('0x22')]=function(_0x405d94,_0x21e52f){if(_0x405d94[_0x6055('0x44')]['id']){delete _0x405d94[_0x6055('0x44')]['id'];}return db['VoiceMusicOnHold'][_0x6055('0x43')]({'where':{'id':_0x405d94[_0x6055('0x40')]['id']}})[_0x6055('0x24')](handleEntityNotFound(_0x21e52f,null))['then'](saveUpdates(_0x405d94['body'],null))[_0x6055('0x24')](respondWithResult(_0x21e52f,null))['catch'](handleError(_0x21e52f,null));};exports[_0x6055('0x45')]=function(_0xc33375,_0x34bc2c,_0x334125){return db[_0x6055('0x46')][_0x6055('0x47')](function(_0x3795a9){if(_0xc33375[_0x6055('0x44')][_0x6055('0x48')]===_0x6055('0x49')){_0xc33375['body'][_0x6055('0x4a')]=path[_0x6055('0x4b')](config[_0x6055('0x4c')],_0x6055('0x4d'),_0xc33375[_0x6055('0x44')][_0x6055('0x27')]);}return db['VoiceMusicOnHold'][_0x6055('0x45')](_0xc33375[_0x6055('0x44')],{'transaction':_0x3795a9})[_0x6055('0x24')](function(_0x1a1751){if(_0xc33375[_0x6055('0x44')][_0x6055('0x48')]==='files'){fs[_0x6055('0x4e')](_0x1a1751[_0x6055('0x4a')],parseInt('0777',0x8));}var _0x19f099=_0xc33375[_0x6055('0x4f')]['get']({'plain':!![]});if(!_0x19f099)throw new Error(_0x6055('0x50'));if(_0x19f099[_0x6055('0x51')]===_0x6055('0x4f')){var _0x9f6cd6=_0x1a1751[_0x6055('0x25')]({'plain':!![]});return db[_0x6055('0x52')][_0x6055('0x43')]({'where':{'name':_0x6055('0x53'),'userProfileId':_0x19f099[_0x6055('0x54')]},'raw':!![]})[_0x6055('0x24')](function(_0x2a7582){if(_0x2a7582&&_0x2a7582[_0x6055('0x55')]===0x0){return db[_0x6055('0x26')][_0x6055('0x45')]({'name':_0x9f6cd6[_0x6055('0x27')],'resourceId':_0x9f6cd6['id'],'type':_0x2a7582['name'],'sectionId':_0x2a7582['id']},{})[_0x6055('0x24')](function(){return _0x1a1751;});}else{return _0x1a1751;}})[_0x6055('0x3e')](function(_0x2a6e20){logger[_0x6055('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a6e20);});}return _0x1a1751;});})[_0x6055('0x24')](respondWithResult(_0x34bc2c,0xc9))['catch'](handleError(_0x34bc2c,null));};exports[_0x6055('0x23')]=function(_0x285e4e,_0x33cfa8,_0x193456){var _0x2ec44c;return db[_0x6055('0x3a')]['find']({'where':{'id':_0x285e4e[_0x6055('0x40')]['id']}})[_0x6055('0x24')](function(_0x1f86f0){if(_0x1f86f0){return db['sequelize'][_0x6055('0x47')](function(_0x26f4c9){return _0x1f86f0[_0x6055('0x23')]({'transaction':_0x26f4c9,'raw':!![]})[_0x6055('0x24')](function(_0x21f1f8){if(_0x21f1f8[_0x6055('0x4a')]){fs[_0x6055('0x57')](_0x21f1f8[_0x6055('0x4a')])[_0x6055('0x58')](function(_0x362eb9){fs[_0x6055('0x59')](path[_0x6055('0x4b')](_0x21f1f8[_0x6055('0x4a')],_0x362eb9));});fs[_0x6055('0x5a')](_0x21f1f8['directory']);}return _0x21f1f8;});})[_0x6055('0x3e')](function(_0xbee7ec){throw new db[(_0x6055('0x5b'))]['ValidationError'](_0xbee7ec[_0x6055('0x5c')]);});}})[_0x6055('0x24')](handleEntityNotFound(_0x33cfa8,null))['then'](removeEntity(_0x33cfa8,null))['catch'](handleError(_0x33cfa8,null));};exports[_0x6055('0x5d')]=function(_0x8bc73b,_0x2687c8,_0x4c400f){return db['sequelize'][_0x6055('0x47')](function(_0xea74c0){var _0x1e242a;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x8bc73b[_0x6055('0x40')]['id']}})[_0x6055('0x24')](function(_0x487fa0){if(_0x487fa0){_0x1e242a=_0x487fa0;return _0x487fa0[_0x6055('0x5d')](_0x8bc73b['body']['id'],{'transaction':_0xea74c0});}})['then'](function(_0x453fea){if(_0x453fea){return db[_0x6055('0x5e')][_0x6055('0x5f')]({'where':{'id':_0x8bc73b['body']['id']},'attributes':['id','name','save_name',_0x6055('0x60'),_0x6055('0x61')],'raw':!![]});}})[_0x6055('0x24')](function(_0x26f0ac){if(_0x26f0ac){var _0x1b552a=path[_0x6055('0x4b')](config['root'],'server/files/sounds/converted',util[_0x6055('0x62')](_0x6055('0x63'),path['basename'](_0x26f0ac[_0x6055('0x64')],path[_0x6055('0x65')](_0x26f0ac[_0x6055('0x64')])),_0x26f0ac[_0x6055('0x60')]));var _0x25629c=path['join'](config[_0x6055('0x4c')],_0x6055('0x4d'),_0x1e242a[_0x6055('0x27')],util[_0x6055('0x62')](_0x6055('0x63'),_0x26f0ac['name'],_0x26f0ac[_0x6055('0x60')]));fs['symlinkSync'](_0x1b552a,_0x25629c);return _0x26f0ac;}})[_0x6055('0x3e')](function(_0x4cd2f6){throw new db[(_0x6055('0x5b'))]['ValidationError'](_0x4cd2f6[_0x6055('0x5c')]);});})[_0x6055('0x24')](handleEntityNotFound(_0x2687c8,null))[_0x6055('0x24')](respondWithResult(_0x2687c8,0xc9))[_0x6055('0x3e')](handleError(_0x2687c8,null));};exports[_0x6055('0x66')]=function(_0x4b7bfa,_0x21c819,_0x2c1acf){return db['sequelize']['transaction'](function(_0x410a7e){var _0x3bc952;return db[_0x6055('0x3a')][_0x6055('0x5f')]({'where':{'id':_0x4b7bfa[_0x6055('0x40')]['id']}})[_0x6055('0x24')](handleEntityNotFound(_0x21c819,null))[_0x6055('0x24')](function(_0x1d6b9a){if(_0x1d6b9a){_0x3bc952=_0x1d6b9a;return _0x1d6b9a[_0x6055('0x66')](_0x4b7bfa['params'][_0x6055('0x67')]);}})['then'](function(_0x296ecf){if(_0x296ecf){return db[_0x6055('0x5e')][_0x6055('0x5f')]({'where':{'id':_0x4b7bfa[_0x6055('0x40')][_0x6055('0x67')]},'attributes':['id',_0x6055('0x27'),_0x6055('0x64'),_0x6055('0x60'),_0x6055('0x61')],'raw':!![]});}})[_0x6055('0x24')](function(_0x55400e){if(_0x55400e){fs[_0x6055('0x59')](path[_0x6055('0x4b')](_0x3bc952[_0x6055('0x4a')],util[_0x6055('0x62')](_0x6055('0x63'),_0x55400e[_0x6055('0x27')],_0x55400e[_0x6055('0x60')])));return _0x55400e;}})[_0x6055('0x3e')](function(_0x468dc0){throw new db[(_0x6055('0x5b'))][(_0x6055('0x68'))](_0x468dc0['message']);});})['then'](handleEntityNotFound(_0x21c819,null))[_0x6055('0x24')](respondWithStatusCode(_0x21c819,0xcc))[_0x6055('0x3e')](handleError(_0x21c819,null));};exports[_0x6055('0x69')]=function(_0x3a9b86,_0xb63fd2,_0x2194c0){var _0x5676f6={};var _0x36e501={};var _0x95b52f;var _0x3fe9dc;return db[_0x6055('0x3a')][_0x6055('0x5f')]({'where':{'id':_0x3a9b86['params']['id']}})['then'](handleEntityNotFound(_0xb63fd2,null))[_0x6055('0x24')](function(_0x390bac){if(_0x390bac){_0x95b52f=_0x390bac;_0x36e501['model']=_['keys'](db[_0x6055('0x5e')][_0x6055('0x41')]);_0x36e501[_0x6055('0x2d')]=_[_0x6055('0x42')](_0x3a9b86[_0x6055('0x2d')]);_0x36e501[_0x6055('0x2e')]=_[_0x6055('0x2f')](_0x36e501[_0x6055('0x2c')],_0x36e501['query']);_0x5676f6[_0x6055('0x30')]=_[_0x6055('0x2f')](_0x36e501['model'],qs[_0x6055('0x31')](_0x3a9b86[_0x6055('0x2d')][_0x6055('0x31')]));_0x5676f6['attributes']=_0x5676f6['attributes'][_0x6055('0x32')]?_0x5676f6['attributes']:_0x36e501['model'];_0x5676f6['order']=qs['sort'](_0x3a9b86['query'][_0x6055('0x35')]);_0x5676f6['where']=qs['filters'](_[_0x6055('0x37')](_0x3a9b86[_0x6055('0x2d')],_0x36e501[_0x6055('0x2e')]));if(_0x3a9b86[_0x6055('0x2d')][_0x6055('0x38')]){_0x5676f6['where']=_[_0x6055('0x39')](_0x5676f6[_0x6055('0x36')],{'$or':_[_0x6055('0x29')](_0x5676f6[_0x6055('0x30')],function(_0x3fddae){var _0x4eaecf={};_0x4eaecf[_0x3fddae]={'$like':'%'+_0x3a9b86[_0x6055('0x2d')][_0x6055('0x38')]+'%'};return _0x4eaecf;})});}_0x5676f6=_[_0x6055('0x39')]({},_0x5676f6,_0x3a9b86['options']);return _0x95b52f[_0x6055('0x69')](_0x5676f6);}})[_0x6055('0x24')](function(_0x3d2b9b){if(_0x3d2b9b){_0x3fe9dc=_0x3d2b9b[_0x6055('0x32')];if(!_0x3a9b86[_0x6055('0x2d')][_0x6055('0x33')](_0x6055('0x34'))){_0x5676f6[_0x6055('0x1d')]=qs[_0x6055('0x1d')](_0x3a9b86[_0x6055('0x2d')]['limit']);_0x5676f6[_0x6055('0x1f')]=qs[_0x6055('0x1f')](_0x3a9b86['query'][_0x6055('0x1f')]);}return _0x95b52f[_0x6055('0x69')](_0x5676f6);}})[_0x6055('0x24')](function(_0x5f0224){if(_0x5f0224){return _0x5f0224?{'count':_0x3fe9dc,'rows':_0x5f0224}:null;}})[_0x6055('0x24')](respondWithResult(_0xb63fd2,null))['catch'](handleError(_0xb63fd2,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index aed548c..ce61d82 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 _0x52f8=['moment','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','../../config/logger','api'];(function(_0x134bf5,_0x3af48c){var _0x1b012a=function(_0x24b3d2){while(--_0x24b3d2){_0x134bf5['push'](_0x134bf5['shift']());}};_0x1b012a(++_0x3af48c);}(_0x52f8,0x1c0));var _0x852f=function(_0xcb68ab,_0xc1010b){_0xcb68ab=_0xcb68ab-0x0;var _0x457a4e=_0x52f8[_0xcb68ab];return _0x457a4e;};'use strict';var _=require(_0x852f('0x0'));var util=require('util');var logger=require(_0x852f('0x1'))(_0x852f('0x2'));var moment=require(_0x852f('0x3'));var BPromise=require('bluebird');var rp=require(_0x852f('0x4'));var fs=require('fs');var path=require(_0x852f('0x5'));var rimraf=require(_0x852f('0x6'));var config=require('../../config/environment');var attributes=require(_0x852f('0x7'));module[_0x852f('0x8')]=function(_0xd24eb3,_0x551243){return _0xd24eb3[_0x852f('0x9')](_0x852f('0xa'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x466c=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x28bb44,_0x13da50){var _0x9004fb=function(_0x295ce8){while(--_0x295ce8){_0x28bb44['push'](_0x28bb44['shift']());}};_0x9004fb(++_0x13da50);}(_0x466c,0x1da));var _0xc466=function(_0x5871f9,_0x28ccb7){_0x5871f9=_0x5871f9-0x0;var _0x8fd1c0=_0x466c[_0x5871f9];return _0x8fd1c0;};'use strict';var _=require(_0xc466('0x0'));var util=require(_0xc466('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xc466('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xc466('0x3'));var rimraf=require(_0xc466('0x4'));var config=require(_0xc466('0x5'));var attributes=require(_0xc466('0x6'));module[_0xc466('0x7')]=function(_0x68513e,_0x37dd72){return _0x68513e[_0xc466('0x8')](_0xc466('0x9'),attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 0fc5e74..529d807 100644 --- a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js +++ b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x5cc949,_0x9de31c){var _0x67afa9=function(_0x1c32e9){while(--_0x1c32e9){_0x5cc949['push'](_0x5cc949['shift']());}};_0x67afa9(++_0x9de31c);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x456fb1,_0x859a1d){_0x456fb1=_0x456fb1-0x0;var _0x4083d6=_0xcb91[_0x456fb1];return _0x4083d6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0xedd9=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','VoiceMusicOnHold,\x20%s,\x20%s','message','catch','util'];(function(_0xa43ca0,_0x2df2aa){var _0x16fc18=function(_0x30bd52){while(--_0x30bd52){_0xa43ca0['push'](_0xa43ca0['shift']());}};_0x16fc18(++_0x2df2aa);}(_0xedd9,0xfc));var _0x9edd=function(_0x708cfa,_0x413d56){_0x708cfa=_0x708cfa-0x0;var _0x2418ca=_0xedd9[_0x708cfa];return _0x2418ca;};'use strict';var _=require('lodash');var util=require(_0x9edd('0x0'));var moment=require(_0x9edd('0x1'));var BPromise=require(_0x9edd('0x2'));var rs=require(_0x9edd('0x3'));var fs=require('fs');var Redis=require(_0x9edd('0x4'));var db=require(_0x9edd('0x5'))['db'];var utils=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('rpc');var config=require(_0x9edd('0x8'));var jayson=require(_0x9edd('0x9'));var client=jayson[_0x9edd('0xa')][_0x9edd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5319f7,_0xf0b2d8,_0x571af9){return new BPromise(function(_0x172522,_0x190185){return client[_0x9edd('0xc')](_0x5319f7,_0x571af9)[_0x9edd('0xd')](function(_0x49d5e3){logger[_0x9edd('0xe')]('VoiceMusicOnHold,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'));logger[_0x9edd('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0xf0b2d8,_0x9edd('0xf'),JSON[_0x9edd('0x11')](_0x49d5e3));if(_0x49d5e3['error']){if(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x13')]===0x1f4){logger[_0x9edd('0x12')](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x190185(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);return _0x172522(_0x49d5e3[_0x9edd('0x12')][_0x9edd('0x15')]);}else{logger[_0x9edd('0xe')](_0x9edd('0x14'),_0xf0b2d8,_0x9edd('0xf'));_0x172522(_0x49d5e3['result'][_0x9edd('0x15')]);}})[_0x9edd('0x16')](function(_0x449cee){logger['error'](_0x9edd('0x14'),_0xf0b2d8,_0x449cee);_0x190185(_0x449cee);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 3986ae1..2f31dde 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 _0x34f8=['getTeams','post','/:id/users','addAgents','addTeams','delete','destroy','removeTeams','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','index','describe','/:id','show','getAgents','/:id/teams'];(function(_0x59f3c8,_0x269e43){var _0x320c2f=function(_0x2c22a5){while(--_0x2c22a5){_0x59f3c8['push'](_0x59f3c8['shift']());}};_0x320c2f(++_0x269e43);}(_0x34f8,0x80));var _0x834f=function(_0x17fcfe,_0x5adb02){_0x17fcfe=_0x17fcfe-0x0;var _0x3e3fc5=_0x34f8[_0x17fcfe];return _0x3e3fc5;};'use strict';var multer=require(_0x834f('0x0'));var util=require(_0x834f('0x1'));var path=require(_0x834f('0x2'));var timeout=require(_0x834f('0x3'));var express=require(_0x834f('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x834f('0x5'));var interaction=require(_0x834f('0x6'));var config=require('../../config/environment');var controller=require(_0x834f('0x7'));router[_0x834f('0x8')]('/',auth[_0x834f('0x9')](),controller[_0x834f('0xa')]);router['get']('/describe',auth[_0x834f('0x9')](),controller[_0x834f('0xb')]);router[_0x834f('0x8')](_0x834f('0xc'),auth['isAuthenticated'](),controller[_0x834f('0xd')]);router[_0x834f('0x8')]('/:id/users',auth[_0x834f('0x9')](),controller[_0x834f('0xe')]);router[_0x834f('0x8')](_0x834f('0xf'),auth[_0x834f('0x9')](),controller[_0x834f('0x10')]);router[_0x834f('0x11')]('/',auth[_0x834f('0x9')](),controller['create']);router[_0x834f('0x11')](_0x834f('0x12'),auth[_0x834f('0x9')](),controller[_0x834f('0x13')]);router[_0x834f('0x11')]('/:id/teams',auth[_0x834f('0x9')](),controller[_0x834f('0x14')]);router['put'](_0x834f('0xc'),auth[_0x834f('0x9')](),controller['update']);router[_0x834f('0x15')]('/:id',auth[_0x834f('0x9')](),controller[_0x834f('0x16')]);router[_0x834f('0x15')](_0x834f('0x12'),auth['isAuthenticated'](),controller['removeAgents']);router[_0x834f('0x15')](_0x834f('0xf'),auth[_0x834f('0x9')](),controller[_0x834f('0x17')]);module['exports']=router; \ No newline at end of file +var _0x4c4e=['removeTeams','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./voicePrefix.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addTeams','put','update','delete','destroy','removeAgents'];(function(_0x2389bc,_0x167cd2){var _0x170548=function(_0x2da7f2){while(--_0x2da7f2){_0x2389bc['push'](_0x2389bc['shift']());}};_0x170548(++_0x167cd2);}(_0x4c4e,0x152));var _0xe4c4=function(_0x4a9d2c,_0x4a1826){_0x4a9d2c=_0x4a9d2c-0x0;var _0x5abec8=_0x4c4e[_0x4a9d2c];return _0x5abec8;};'use strict';var multer=require(_0xe4c4('0x0'));var util=require('util');var path=require(_0xe4c4('0x1'));var timeout=require(_0xe4c4('0x2'));var express=require(_0xe4c4('0x3'));var router=express['Router']();var fs_extra=require(_0xe4c4('0x4'));var auth=require(_0xe4c4('0x5'));var interaction=require(_0xe4c4('0x6'));var config=require('../../config/environment');var controller=require(_0xe4c4('0x7'));router['get']('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x9')]);router[_0xe4c4('0xa')](_0xe4c4('0xb'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xc')]);router[_0xe4c4('0xa')](_0xe4c4('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xe4c4('0xa')](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0xf')]);router[_0xe4c4('0xa')](_0xe4c4('0x10'),auth['isAuthenticated'](),controller[_0xe4c4('0x11')]);router[_0xe4c4('0x12')]('/',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x13')]);router['post'](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller['addAgents']);router[_0xe4c4('0x12')](_0xe4c4('0x10'),auth['isAuthenticated'](),controller[_0xe4c4('0x14')]);router[_0xe4c4('0x15')]('/:id',auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x16')]);router[_0xe4c4('0x17')](_0xe4c4('0xd'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x18')]);router[_0xe4c4('0x17')](_0xe4c4('0xe'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x19')]);router[_0xe4c4('0x17')](_0xe4c4('0x10'),auth[_0xe4c4('0x8')](),controller[_0xe4c4('0x1a')]);module[_0xe4c4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 543f642..a36527f 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 _0x296e=['system-','getDataValue','INTEGER','sequelize','STRING','name','VIRTUAL'];(function(_0x4599b6,_0x40c254){var _0x2e014c=function(_0x3c4d90){while(--_0x3c4d90){_0x4599b6['push'](_0x4599b6['shift']());}};_0x2e014c(++_0x40c254);}(_0x296e,0x137));var _0xe296=function(_0x480267,_0x480815){_0x480267=_0x480267-0x0;var _0x5a2970=_0x296e[_0x480267];return _0x5a2970;};'use strict';var Sequelize=require(_0xe296('0x0'));module['exports']={'name':{'type':Sequelize[_0xe296('0x1')],'allowNull':![],'unique':_0xe296('0x2')},'prefix':{'type':Sequelize[_0xe296('0x3')],'get':function(_0x1a7ffe){return _0xe296('0x4')+this[_0xe296('0x5')](_0xe296('0x2'))+'-';}},'description':{'type':Sequelize[_0xe296('0x1')]},'callerIdAll':{'type':Sequelize[_0xe296('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xe296('0x6')]}}; \ No newline at end of file +var _0x417d=['name','VIRTUAL','system-','INTEGER','STRING'];(function(_0xb72117,_0x349096){var _0xeb1f7e=function(_0x4df89f){while(--_0x4df89f){_0xb72117['push'](_0xb72117['shift']());}};_0xeb1f7e(++_0x349096);}(_0x417d,0x108));var _0xd417=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x417d[_0x173441];return _0x2423a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd417('0x0')],'allowNull':![],'unique':_0xd417('0x1')},'prefix':{'type':Sequelize[_0xd417('0x2')],'get':function(_0x335ad5){return _0xd417('0x3')+this['getDataValue']('name')+'-';}},'description':{'type':Sequelize[_0xd417('0x0')]},'callerIdAll':{'type':Sequelize[_0xd417('0x0')]},'VoiceExtensionId':{'type':Sequelize[_0xd417('0x4')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 94cd1c7..5383195 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 _0xb10b=['redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','stack','name','send','map','VoicePrefix','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','type','VIRTUAL','merge','options','catch','show','params','fields','includeAll','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','system','description','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','prefix','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','push','No\x20callerid\x20available','goto','${EXTEN:','charAt','transaction','addAgents','omit','ids','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','order','getTeams','Team','nolimit','addTeams','User','Agents','online','voicePause','interface','flatMap','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xb10b,0x12a));var _0xbb10=function(_0x116c04,_0x4963da){_0x116c04=_0x116c04-0x0;var _0x9e011d=_0xb10b[_0x116c04];return _0x9e011d;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var jsonpatch=require(_0xbb10('0x2'));var rp=require(_0xbb10('0x3'));var moment=require('moment');var BPromise=require(_0xbb10('0x4'));var Mustache=require(_0xbb10('0x5'));var util=require(_0xbb10('0x6'));var path=require(_0xbb10('0x7'));var sox=require(_0xbb10('0x8'));var csv=require(_0xbb10('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb10('0xa'));var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0x9'));var querystring=require(_0xbb10('0xf'));var Papa=require(_0xbb10('0x10'));var Redis=require(_0xbb10('0x11'));var authService=require(_0xbb10('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x13'));var logger=require(_0xbb10('0x14'))(_0xbb10('0x15'));var utils=require('../../config/utils');var config=require(_0xbb10('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbb10('0x17'))['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config['redis']));require(_0xbb10('0x1c'))[_0xbb10('0x1d')](socket);function respondWithStatusCode(_0x45b9d6,_0x17fd46){_0x17fd46=_0x17fd46||0xcc;return function(_0x3df17b){if(_0x3df17b){return _0x45b9d6[_0xbb10('0x1e')](_0x17fd46);}return _0x45b9d6[_0xbb10('0x1f')](_0x17fd46)[_0xbb10('0x20')]();};}function respondWithResult(_0x3e26f4,_0x2b184e){_0x2b184e=_0x2b184e||0xc8;return function(_0x4a2bfc){if(_0x4a2bfc){return _0x3e26f4[_0xbb10('0x1f')](_0x2b184e)[_0xbb10('0x21')](_0x4a2bfc);}};}function respondWithFilteredResult(_0x133ac2,_0x42db98){return function(_0x378da8){if(_0x378da8){var _0x1682a4=typeof _0x42db98[_0xbb10('0x22')]===_0xbb10('0x23')&&typeof _0x42db98[_0xbb10('0x24')]===_0xbb10('0x23');var _0x48b6e9=_0x378da8[_0xbb10('0x25')];var _0x19f48d=_0x1682a4?0x0:_0x42db98[_0xbb10('0x22')];var _0x109908=_0x1682a4?_0x378da8[_0xbb10('0x25')]:_0x42db98[_0xbb10('0x22')]+_0x42db98['limit'];var _0x12f888;if(_0x109908>=_0x48b6e9){_0x109908=_0x48b6e9;_0x12f888=0xc8;}else{_0x12f888=0xce;}_0x133ac2[_0xbb10('0x1f')](_0x12f888);return _0x133ac2['set']('Content-Range',_0x19f48d+'-'+_0x109908+'/'+_0x48b6e9)[_0xbb10('0x21')](_0x378da8);}return null;};}function patchUpdates(_0x311abe){return function(_0x2e911d){try{jsonpatch[_0xbb10('0x26')](_0x2e911d,_0x311abe,!![]);}catch(_0x445761){return BPromise[_0xbb10('0x27')](_0x445761);}return _0x2e911d[_0xbb10('0x28')]();};}function saveUpdates(_0x436104,_0x7f2377){return function(_0x395404){if(_0x395404){return _0x395404[_0xbb10('0x29')](_0x436104)[_0xbb10('0x2a')](function(_0x537898){return _0x537898;});}return null;};}function removeEntity(_0x4fedac,_0x4fb5e0){return function(_0xc93a04){if(_0xc93a04){return _0xc93a04[_0xbb10('0x2b')]()[_0xbb10('0x2a')](function(){var _0x4e25ff=_0xc93a04[_0xbb10('0x2c')]({'plain':!![]});var _0x24d586=_0xbb10('0x2d');return db[_0xbb10('0x2e')][_0xbb10('0x2b')]({'where':{'type':_0x24d586,'resourceId':_0x4e25ff['id']}})[_0xbb10('0x2a')](function(){return _0xc93a04;});})[_0xbb10('0x2a')](function(){_0x4fedac['status'](0xcc)[_0xbb10('0x20')]();});}};}function handleEntityNotFound(_0x21ac54,_0xfc3595){return function(_0x2e0249){if(!_0x2e0249){_0x21ac54[_0xbb10('0x1e')](0x194);}return _0x2e0249;};}function handleError(_0x2ff4c1,_0x5d5c80){_0x5d5c80=_0x5d5c80||0x1f4;return function(_0x221624){logger['error'](_0x221624[_0xbb10('0x2f')]);if(_0x221624['name']){delete _0x221624[_0xbb10('0x30')];}_0x2ff4c1[_0xbb10('0x1f')](_0x5d5c80)[_0xbb10('0x31')](_0x221624);};}exports['index']=function(_0x518d47,_0x4c3744){var _0x34f65e={},_0x4f590d={},_0x359ad4={'count':0x0,'rows':[]};var _0x37dde7=_[_0xbb10('0x32')](db[_0xbb10('0x33')][_0xbb10('0x34')],function(_0x138bc6){return{'name':_0x138bc6[_0xbb10('0x35')],'type':_0x138bc6['type'][_0xbb10('0x36')]};});_0x4f590d[_0xbb10('0x37')]=_[_0xbb10('0x32')](_0x37dde7,_0xbb10('0x30'));_0x4f590d[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x518d47[_0xbb10('0x38')]);_0x4f590d[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x4f590d['model'],_0x4f590d[_0xbb10('0x38')]);_0x34f65e[_0xbb10('0x3c')]=_[_0xbb10('0x3b')](_0x4f590d[_0xbb10('0x37')],qs['fields'](_0x518d47[_0xbb10('0x38')]['fields']));_0x34f65e['attributes']=_0x34f65e[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x34f65e[_0xbb10('0x3c')]:_0x4f590d[_0xbb10('0x37')];if(!_0x518d47[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x34f65e[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x518d47['query']['limit']);_0x34f65e['offset']=qs[_0xbb10('0x22')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x22')]);}_0x34f65e['order']=qs[_0xbb10('0x3f')](_0x518d47[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x34f65e['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x518d47[_0xbb10('0x38')],_0x4f590d[_0xbb10('0x3a')]),_0x37dde7);if(_0x518d47['query'][_0xbb10('0x41')]){_0x34f65e[_0xbb10('0x42')]=_['merge'](_0x34f65e[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x37dde7,function(_0x44d6ae){if(_0x44d6ae[_0xbb10('0x43')]!==_0xbb10('0x44')){var _0x185a52={};_0x185a52[_0x44d6ae['name']]={'$like':'%'+_0x518d47[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x185a52;}})});}_0x34f65e=_[_0xbb10('0x45')]({},_0x34f65e,_0x518d47[_0xbb10('0x46')]);var _0x4943d9={'where':_0x34f65e[_0xbb10('0x42')]};return db[_0xbb10('0x33')][_0xbb10('0x25')](_0x4943d9)[_0xbb10('0x2a')](function(_0x5e2cfa){_0x359ad4[_0xbb10('0x25')]=_0x5e2cfa;if(_0x518d47[_0xbb10('0x38')]['includeAll']){_0x34f65e['include']=[{'all':!![]}];}return db[_0xbb10('0x33')]['findAll'](_0x34f65e);})[_0xbb10('0x2a')](function(_0x180933){_0x359ad4['rows']=_0x180933;return _0x359ad4;})[_0xbb10('0x2a')](respondWithFilteredResult(_0x4c3744,_0x34f65e))[_0xbb10('0x47')](handleError(_0x4c3744,null));};exports[_0xbb10('0x48')]=function(_0x5cf4f8,_0x2dd02b){var _0xebd70c={'raw':![],'where':{'id':_0x5cf4f8[_0xbb10('0x49')]['id']}},_0x3b9fdf={};_0x3b9fdf[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x33')][_0xbb10('0x34')]);_0x3b9fdf[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0x5cf4f8[_0xbb10('0x38')]);_0x3b9fdf[_0xbb10('0x3a')]=_['intersection'](_0x3b9fdf[_0xbb10('0x37')],_0x3b9fdf[_0xbb10('0x38')]);_0xebd70c['attributes']=_[_0xbb10('0x3b')](_0x3b9fdf[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0xebd70c[_0xbb10('0x3c')]=_0xebd70c[_0xbb10('0x3c')]['length']?_0xebd70c['attributes']:_0x3b9fdf[_0xbb10('0x37')];if(_0x5cf4f8[_0xbb10('0x38')][_0xbb10('0x4b')]){_0xebd70c['include']=[{'all':!![]}];}_0xebd70c=_['merge']({},_0xebd70c,_0x5cf4f8[_0xbb10('0x46')]);return db[_0xbb10('0x33')][_0xbb10('0x4c')](_0xebd70c)[_0xbb10('0x2a')](handleEntityNotFound(_0x2dd02b,null))[_0xbb10('0x2a')](respondWithResult(_0x2dd02b,null))[_0xbb10('0x47')](handleError(_0x2dd02b,null));};exports[_0xbb10('0x2b')]=function(_0x460788,_0x2626d8){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x460788['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x2626d8,null))[_0xbb10('0x2a')](removeEntity(_0x2626d8,null))[_0xbb10('0x47')](handleError(_0x2626d8,null));};exports[_0xbb10('0x4d')]=function(_0x36aa7d,_0x440f9e){return db[_0xbb10('0x33')][_0xbb10('0x4d')]()[_0xbb10('0x2a')](respondWithResult(_0x440f9e,null))[_0xbb10('0x47')](handleError(_0x440f9e,null));};exports[_0xbb10('0x4e')]=function(_0x20e18a,_0x61e689){var _0x2e6fd9;return db[_0xbb10('0x4f')]['transaction'](function(_0x124052){return db['VoicePrefix'][_0xbb10('0x4e')](_0x20e18a[_0xbb10('0x50')],{'transaction':_0x124052})[_0xbb10('0x2a')](function(_0x3f27ce){_0x2e6fd9=_0x3f27ce[_0xbb10('0x2c')]({'plain':!![]});return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x2e6fd9[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x3d71e){return createVoicePrefixExtensions(_0x2e6fd9,_0x3d71e,_0x124052);});});})[_0xbb10('0x2a')](function(){var _0x1c2dce=_0x20e18a[_0xbb10('0x53')][_0xbb10('0x2c')]({'plain':!![]});if(!_0x1c2dce)throw new Error(_0xbb10('0x54'));if(_0x1c2dce['role']===_0xbb10('0x53')){var _0x466eb7=_0x2e6fd9;return db[_0xbb10('0x55')][_0xbb10('0x4c')]({'where':{'name':_0xbb10('0x2d'),'userProfileId':_0x1c2dce[_0xbb10('0x56')]},'raw':!![]})['then'](function(_0x120bda){if(_0x120bda&&_0x120bda[_0xbb10('0x57')]===0x0){return db[_0xbb10('0x2e')][_0xbb10('0x4e')]({'name':_0x466eb7[_0xbb10('0x30')],'resourceId':_0x466eb7['id'],'type':_0x120bda[_0xbb10('0x30')],'sectionId':_0x120bda['id']},{})[_0xbb10('0x2a')](function(){return _0x2e6fd9;});}else{return _0x2e6fd9;}})[_0xbb10('0x47')](function(_0x205e01){logger[_0xbb10('0x58')](_0xbb10('0x59'),_0x205e01);throw _0x205e01;});}return _0x2e6fd9;})[_0xbb10('0x2a')](respondWithResult(_0x61e689,null))[_0xbb10('0x47')](handleError(_0x61e689,null));};function Extension(_0x4e7fac,_0x4ea1a6,_0x16272d,_0x3e6338){this[_0xbb10('0x5a')]=_0xbb10('0x5b');this['exten']=_0x4e7fac;this['app']=_0x16272d;this[_0xbb10('0x43')]=_0xbb10('0x5c');this[_0xbb10('0x5d')]=_0xbb10('0x5e');this[_0xbb10('0x5f')]=_0x4ea1a6;this[_0xbb10('0x60')]=_0x3e6338;}function createVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9,_0x117e84){return new BPromise(function(_0x216cff,_0x4917a5){var _0x5e03cb=new Extension(formatPrefixName(_0x45c0dc['prefix']),0x1,_0xbb10('0x61'),_0xbb10('0x62'));_0x5e03cb[_0xbb10('0x63')]=_0x45c0dc['id'];return db['VoiceExtension']['create'](_0x5e03cb,{'transaction':_0x117e84})['then'](function(_0x3ebc5f){var _0x249b33=_0x3ebc5f[_0xbb10('0x2c')]({'plain':!![]});var _0x4e9fbd=_[_0xbb10('0x32')](addVoicePrefixExtensions(_0x45c0dc,_0x4a5fb9),function(_0x13131c){_0x13131c['VoiceExtensionId']=_0x249b33['id'];_0x13131c['VoicePrefixId']=_0x45c0dc['id'];return _0x13131c;});return db[_0xbb10('0x51')][_0xbb10('0x64')](_0x4e9fbd,{'transaction':_0x117e84})[_0xbb10('0x2a')](function(_0x237246){if(!_0x237246){return _0x4917a5('Extensions\x20creation\x20failed');}else{return _0x216cff(_0x237246);}})[_0xbb10('0x47')](function(_0xec48ac){return _0x4917a5(_0xec48ac);});});;});};function addVoicePrefixExtensions(_0xa7179d,_0x5202d7){var _0x402a01=[];var _0x2f05bc=formatPrefixName(_0xa7179d[_0xbb10('0x65')]);_0x402a01['push'](new Extension(_0x2f05bc,0x2,_0xbb10('0x66'),_0xbb10('0x67')+_0xa7179d[_0xbb10('0x30')]));if(_0xa7179d[_0xbb10('0x68')]){_0x402a01['push'](new Extension(_0x2f05bc,0x3,_0xbb10('0x66'),_0xbb10('0x69')+_0xa7179d[_0xbb10('0x68')]));}else{_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x3,'NoOp',_0xbb10('0x6b')));}_0x402a01[_0xbb10('0x6a')](new Extension(_0x2f05bc,0x4,_0xbb10('0x6c'),_0x5202d7[_0xbb10('0x5a')]+','+_0xbb10('0x6d')+(0x8+_0xa7179d[_0xbb10('0x30')][_0xbb10('0x3d')])+'}'+','+0x1));return _0x402a01;}function formatPrefixName(_0x4a30c5){var _0x4a13d7='_';for(var _0x5acd5e=0x0;_0x5acd5e<_0x4a30c5[_0xbb10('0x3d')];_0x5acd5e++){if(_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e)=='-'){_0x4a13d7+=_0x4a30c5[_0xbb10('0x6e')](_0x5acd5e);}else{_0x4a13d7+='['+_0x4a30c5['charAt'](_0x5acd5e)+']';}}_0x4a13d7+='.';return _0x4a13d7;}exports['update']=function(_0x46f462,_0x1b11c0,_0xd9e743){var _0x3a9677=_0x46f462[_0xbb10('0x50')];_0x3a9677[_0xbb10('0x65')]='system-'+_0x3a9677[_0xbb10('0x30')]+'-';return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x14f16b){return db[_0xbb10('0x33')]['update'](_0x3a9677,{'where':{'id':_0x3a9677['id']},'transaction':_0x14f16b})['then'](function(){return db['VoiceExtension'][_0xbb10('0x2b')]({'where':{'VoicePrefixId':_0x3a9677['id']},'transaction':_0x14f16b})[_0xbb10('0x2a')](function(){return db[_0xbb10('0x51')][_0xbb10('0x4c')]({'where':{'id':_0x3a9677[_0xbb10('0x52')]},'raw':!![]})[_0xbb10('0x2a')](function(_0x5d942d){return createVoicePrefixExtensions(_0x3a9677,_0x5d942d,_0x14f16b);});});});})[_0xbb10('0x2a')](function(){return db['VoicePrefix']['findById'](_0x3a9677['id']);})['then'](respondWithResult(_0x1b11c0,null))[_0xbb10('0x47')](handleError(_0x1b11c0,null));};exports[_0xbb10('0x70')]=function(_0x23b1d5,_0x108f99,_0x5ce94f){return db[_0xbb10('0x33')]['find']({'where':{'id':_0x23b1d5['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x108f99,null))[_0xbb10('0x2a')](function(_0x29529c){if(_0x29529c){return _0x29529c[_0xbb10('0x70')](_0x23b1d5[_0xbb10('0x50')]['ids'],_[_0xbb10('0x71')](_0x23b1d5[_0xbb10('0x50')],[_0xbb10('0x72'),'id'])||{})[_0xbb10('0x73')](function(_0x43cdb7){for(var _0x27f42f=0x0;_0x27f42f<_0x23b1d5[_0xbb10('0x50')]['ids'][_0xbb10('0x3d')];_0x27f42f+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':Number(_0x23b1d5[_0xbb10('0x50')][_0xbb10('0x72')][_0x27f42f]),'VoicePrefixId':Number(_0x23b1d5[_0xbb10('0x49')]['id'])});}return _0x43cdb7;});}})[_0xbb10('0x2a')](respondWithResult(_0x108f99,null))[_0xbb10('0x47')](handleError(_0x108f99,null));};exports['removeAgents']=function(_0x428146,_0x218690,_0x145baf){return db['VoicePrefix']['find']({'where':{'id':_0x428146['params']['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0x218690,null))['then'](function(_0x4e3d6a){if(_0x4e3d6a){return _0x4e3d6a[_0xbb10('0x76')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])[_0xbb10('0x2a')](function(){if(_[_0xbb10('0x77')](_0x428146[_0xbb10('0x38')][_0xbb10('0x72')])){for(var _0x417304=0x0;_0x417304<_0x428146[_0xbb10('0x38')]['ids'][_0xbb10('0x3d')];_0x417304+=0x1){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')]['ids'][_0x417304]),'VoicePrefixId':Number(_0x428146['params']['id'])});}}else{socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':Number(_0x428146[_0xbb10('0x38')][_0xbb10('0x72')]),'VoicePrefixId':Number(_0x428146['params']['id'])});}});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x218690,null))[_0xbb10('0x47')](handleError(_0x218690,null));};exports[_0xbb10('0x79')]=function(_0xf7b3e1,_0x35c1e8,_0x517185){var _0x5f0691={};var _0x372636={};var _0x53c698;var _0x22c030;return db['VoicePrefix'][_0xbb10('0x7a')]({'where':{'id':_0xf7b3e1[_0xbb10('0x49')]['id']}})['then'](handleEntityNotFound(_0x35c1e8,null))['then'](function(_0x2f667f){if(_0x2f667f){_0x53c698=_0x2f667f;_0x372636[_0xbb10('0x37')]=_[_0xbb10('0x39')](db['User'][_0xbb10('0x34')]);_0x372636[_0xbb10('0x38')]=_[_0xbb10('0x39')](_0xf7b3e1[_0xbb10('0x38')]);_0x372636[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x372636[_0xbb10('0x37')],_0x372636[_0xbb10('0x38')]);_0x5f0691[_0xbb10('0x3c')]=_['intersection'](_0x372636[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x5f0691[_0xbb10('0x3c')]=_0x5f0691[_0xbb10('0x3c')][_0xbb10('0x3d')]?_0x5f0691[_0xbb10('0x3c')]:_0x372636[_0xbb10('0x37')];_0x5f0691[_0xbb10('0x7b')]=qs[_0xbb10('0x3f')](_0xf7b3e1[_0xbb10('0x38')]['sort']);_0x5f0691['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0xf7b3e1[_0xbb10('0x38')],_0x372636[_0xbb10('0x3a')]));if(_0xf7b3e1[_0xbb10('0x38')]['filter']){_0x5f0691[_0xbb10('0x42')]=_[_0xbb10('0x45')](_0x5f0691[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x5f0691[_0xbb10('0x3c')],function(_0x379d49){var _0x546db5={};_0x546db5[_0x379d49]={'$like':'%'+_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0x546db5;})});}_0x5f0691=_['merge']({},_0x5f0691,_0xf7b3e1[_0xbb10('0x46')]);return _0x53c698['getAgents'](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x28bd76){if(_0x28bd76){_0x22c030=_0x28bd76[_0xbb10('0x3d')];if(!_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x3e')]('nolimit')){_0x5f0691[_0xbb10('0x24')]=qs['limit'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x24')]);_0x5f0691['offset']=qs['offset'](_0xf7b3e1[_0xbb10('0x38')][_0xbb10('0x22')]);}return _0x53c698[_0xbb10('0x79')](_0x5f0691);}})[_0xbb10('0x2a')](function(_0x18d18d){if(_0x18d18d){return _0x18d18d?{'count':_0x22c030,'rows':_0x18d18d}:null;}})[_0xbb10('0x2a')](respondWithResult(_0x35c1e8,null))[_0xbb10('0x47')](handleError(_0x35c1e8,null));};exports[_0xbb10('0x7c')]=function(_0x252ab8,_0xbccd46,_0x2bf9dd){var _0x4c0b83={};var _0x2b9a50={};var _0x3eeceb;var _0x1b0a6c;return db[_0xbb10('0x33')][_0xbb10('0x7a')]({'where':{'id':_0x252ab8[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](handleEntityNotFound(_0xbccd46,null))[_0xbb10('0x2a')](function(_0x3e6fe2){if(_0x3e6fe2){_0x3eeceb=_0x3e6fe2;_0x2b9a50[_0xbb10('0x37')]=_[_0xbb10('0x39')](db[_0xbb10('0x7d')]['rawAttributes']);_0x2b9a50[_0xbb10('0x38')]=_['keys'](_0x252ab8[_0xbb10('0x38')]);_0x2b9a50[_0xbb10('0x3a')]=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],_0x2b9a50[_0xbb10('0x38')]);_0x4c0b83['attributes']=_[_0xbb10('0x3b')](_0x2b9a50[_0xbb10('0x37')],qs[_0xbb10('0x4a')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x4a')]));_0x4c0b83[_0xbb10('0x3c')]=_0x4c0b83['attributes']['length']?_0x4c0b83[_0xbb10('0x3c')]:_0x2b9a50[_0xbb10('0x37')];_0x4c0b83[_0xbb10('0x7b')]=qs['sort'](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x3f')]);_0x4c0b83['where']=qs[_0xbb10('0x3a')](_[_0xbb10('0x40')](_0x252ab8['query'],_0x2b9a50[_0xbb10('0x3a')]));if(_0x252ab8['query'][_0xbb10('0x41')]){_0x4c0b83[_0xbb10('0x42')]=_['merge'](_0x4c0b83[_0xbb10('0x42')],{'$or':_[_0xbb10('0x32')](_0x4c0b83['attributes'],function(_0x5dae56){var _0xea6bf2={};_0xea6bf2[_0x5dae56]={'$like':'%'+_0x252ab8[_0xbb10('0x38')][_0xbb10('0x41')]+'%'};return _0xea6bf2;})});}_0x4c0b83=_[_0xbb10('0x45')]({},_0x4c0b83,_0x252ab8[_0xbb10('0x46')]);return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0x9f2e0f){if(_0x9f2e0f){_0x1b0a6c=_0x9f2e0f[_0xbb10('0x3d')];if(!_0x252ab8['query'][_0xbb10('0x3e')](_0xbb10('0x7e'))){_0x4c0b83[_0xbb10('0x24')]=qs[_0xbb10('0x24')](_0x252ab8[_0xbb10('0x38')][_0xbb10('0x24')]);_0x4c0b83[_0xbb10('0x22')]=qs[_0xbb10('0x22')](_0x252ab8[_0xbb10('0x38')]['offset']);}return _0x3eeceb['getTeams'](_0x4c0b83);}})[_0xbb10('0x2a')](function(_0xe7238b){if(_0xe7238b){return _0xe7238b?{'count':_0x1b0a6c,'rows':_0xe7238b}:null;}})[_0xbb10('0x2a')](respondWithResult(_0xbccd46,null))[_0xbb10('0x47')](handleError(_0xbccd46,null));};exports[_0xbb10('0x7f')]=function(_0x363b81,_0x1cccec,_0x1674f7){var _0x3ede66=_0x363b81[_0xbb10('0x50')][_0xbb10('0x72')];var _0x167734;return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x3ede66},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id',_0xbb10('0x30'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84')],'raw':!![]}]})[_0xbb10('0x2a')](function(_0x1421e2){if(_0x1421e2){_0x167734=_0x1421e2;var _0x3c6c45=_[_0xbb10('0x85')](_0x1421e2,function(_0x2a1c53){var _0x57f4a3=_0x2a1c53[_0xbb10('0x2c')]({'plain':!![]});return _0x57f4a3['Agents'];});return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x363b81[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x2b6e27){return db[_0xbb10('0x4f')]['transaction'](function(_0x2d8a25){return _0x2b6e27['addTeams'](_0x3ede66,{'transaction':_0x2d8a25})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x167734,function(_0xda122){return db[_0xbb10('0x87')][_0xbb10('0x88')]({'TeamId':_0xda122['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},{'transaction':_0x2d8a25});});})[_0xbb10('0x2a')](function(){return BPromise[_0xbb10('0x86')](_0x3c6c45,function(_0x25c5b2){return db[_0xbb10('0x89')][_0xbb10('0x8a')]({'where':{'UserId':_0x25c5b2['id'],'VoicePrefixId':_0x363b81[_0xbb10('0x49')]['id']},'transaction':_0x2d8a25});});})['then'](function(){_0x3c6c45[_0xbb10('0x8b')](function(_0x516520){socket[_0xbb10('0x74')](_0xbb10('0x75'),{'UserId':_0x516520['id'],'VoicePrefixId':_0x2b6e27['id']});});});});});}})[_0xbb10('0x2a')](respondWithStatusCode(_0x1cccec,null))[_0xbb10('0x47')](handleError(_0x1cccec,null));};exports[_0xbb10('0x8c')]=function(_0x40271f,_0x185ec9,_0x5e9888){return db[_0xbb10('0x7d')]['findAll']({'where':{'id':_0x40271f['query'][_0xbb10('0x72')]},'attributes':['id'],'include':[{'model':db[_0xbb10('0x80')],'as':_0xbb10('0x81'),'attributes':['id'],'raw':!![]}]})[_0xbb10('0x2a')](handleEntityNotFound(_0x185ec9,null))[_0xbb10('0x2a')](function(_0x16b8c1){var _0x5d1077=_[_0xbb10('0x32')](_0x16b8c1,'id');var _0x2c25ab=[];var _0x39aa9e=[];var _0xb1b7c8=squel[_0xbb10('0x8d')]();_0xb1b7c8[_0xbb10('0x8e')]('tq.TeamId')[_0xbb10('0x8f')](_0xbb10('0x90'),'tq')[_0xbb10('0x91')](_0xbb10('0x92'),'ut',_0xbb10('0x93'))[_0xbb10('0x42')](_0xbb10('0x94'),_0x40271f['params']['id']);for(var _0x33a43e=0x0;_0x33a43e<_0x16b8c1['length'];_0x33a43e+=0x1){let _0x3afbcf=_0x16b8c1[_0x33a43e];for(var _0x4a6660=0x0;_0x4a6660<_0x3afbcf['Agents'][_0xbb10('0x3d')];_0x4a6660+=0x1){let _0x225064=_0x3afbcf[_0xbb10('0x81')][_0x4a6660];var _0x3b7552=_0xb1b7c8[_0xbb10('0x95')]();_0x3b7552['where'](_0xbb10('0x96'),_0x225064['id']);_0x39aa9e['push'](db['sequelize']['query'](_0x3b7552[_0xbb10('0x97')](),{'type':db[_0xbb10('0x4f')][_0xbb10('0x98')][_0xbb10('0x99')]})[_0xbb10('0x2a')](function(_0x5abedf){if(_0x5abedf[_0xbb10('0x3d')]===0x1){return _0x225064['id'];}else{var _0x42a2d7=_[_0xbb10('0x9a')](_[_0xbb10('0x32')](_0x5abedf,_0xbb10('0x9b')),function(_0x37ff15){return _[_0xbb10('0x9c')](_0x5d1077,_0x37ff15);});if(_0x42a2d7){return _0x225064['id'];}}}));}}return BPromise['all'](_0x39aa9e)['then'](function(_0x584a62){_0x2c25ab=_(_0x2c25ab)[_0xbb10('0x9d')](_0x584a62)[_0xbb10('0x9e')]()[_0xbb10('0x9f')]();return db[_0xbb10('0x33')][_0xbb10('0x4c')]({'where':{'id':_0x40271f[_0xbb10('0x49')]['id']}})[_0xbb10('0x2a')](function(_0x423628){return db[_0xbb10('0x4f')][_0xbb10('0x6f')](function(_0x4cc8d4){return _0x423628['removeTeams'](_0x40271f['query'][_0xbb10('0x72')],{'transaction':_0x4cc8d4})[_0xbb10('0x2a')](function(){if(!_[_0xbb10('0xa0')](_0x2c25ab)){return _0x423628['removeAgents'](_0x2c25ab,{'transaction':_0x4cc8d4});}})[_0xbb10('0x2a')](function(){_0x2c25ab[_0xbb10('0x8b')](function(_0x2c638d){socket[_0xbb10('0x74')](_0xbb10('0x78'),{'UserId':_0x2c638d,'VoicePrefixId':_0x423628['id']});});});});});});})[_0xbb10('0x2a')](respondWithStatusCode(_0x185ec9,null))['catch'](handleError(_0x185ec9,null));}; \ No newline at end of file +var _0xd4f4=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','localhost','./voicePrefix.socket','register','sendStatus','end','status','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','options','includeAll','include','VoicePrefix','rows','catch','show','keys','find','params','describe','sequelize','create','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','system','description','priority','prefix','NoOp','Voice\x20Prefix','bulkCreate','push','Set','CDR(prefix)=','callerIdAll','goto','${EXTEN:','length','charAt','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','findOne','User','pick','getTeams','findAll','Agents','online','voicePause','interface','flatMap','transaction','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','Team','field','tq.TeamId','from','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','TeamId','includes','union','compact','value','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x35fa1f,_0x3822b6){var _0x53cccf=function(_0x3da2f2){while(--_0x3da2f2){_0x35fa1f['push'](_0x35fa1f['shift']());}};_0x53cccf(++_0x3822b6);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x4397eb,_0x17ca99){_0x4397eb=_0x4397eb-0x0;var _0x4d25dd=_0xd4f4[_0x4397eb];return _0x4d25dd;};'use strict';var emlformat=require(_0x4d4f('0x0'));var rimraf=require(_0x4d4f('0x1'));var zipdir=require(_0x4d4f('0x2'));var jsonpatch=require(_0x4d4f('0x3'));var rp=require(_0x4d4f('0x4'));var moment=require(_0x4d4f('0x5'));var BPromise=require(_0x4d4f('0x6'));var Mustache=require(_0x4d4f('0x7'));var util=require(_0x4d4f('0x8'));var path=require(_0x4d4f('0x9'));var sox=require(_0x4d4f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4d4f('0xb'));var squel=require(_0x4d4f('0xc'));var crypto=require(_0x4d4f('0xd'));var jsforce=require(_0x4d4f('0xe'));var deskjs=require(_0x4d4f('0xf'));var toCsv=require(_0x4d4f('0x10'));var querystring=require(_0x4d4f('0x11'));var Papa=require(_0x4d4f('0x12'));var Redis=require(_0x4d4f('0x13'));var authService=require(_0x4d4f('0x14'));var qs=require(_0x4d4f('0x15'));var as=require(_0x4d4f('0x16'));var hardwareService=require(_0x4d4f('0x17'));var logger=require(_0x4d4f('0x18'))(_0x4d4f('0x19'));var utils=require(_0x4d4f('0x1a'));var config=require(_0x4d4f('0x1b'));var licenseUtil=require(_0x4d4f('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x4d4f('0x1d')],{'host':_0x4d4f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x1d')]));require(_0x4d4f('0x1f'))[_0x4d4f('0x20')](socket);function respondWithStatusCode(_0x59252c,_0x145804){_0x145804=_0x145804||0xcc;return function(_0x2e736b){if(_0x2e736b){return _0x59252c[_0x4d4f('0x21')](_0x145804);}return _0x59252c['status'](_0x145804)[_0x4d4f('0x22')]();};}function respondWithResult(_0x5e4ff5,_0x18a528){_0x18a528=_0x18a528||0xc8;return function(_0x16f8e7){if(_0x16f8e7){return _0x5e4ff5[_0x4d4f('0x23')](_0x18a528)['json'](_0x16f8e7);}};}function respondWithFilteredResult(_0x30b6b1,_0x17a437){return function(_0x51dcf1){if(_0x51dcf1){var _0x5dbbeb=typeof _0x17a437['offset']==='undefined'&&typeof _0x17a437['limit']===_0x4d4f('0x24');var _0x15100a=_0x51dcf1[_0x4d4f('0x25')];var _0x3566a5=_0x5dbbeb?0x0:_0x17a437['offset'];var _0x5b2863=_0x5dbbeb?_0x51dcf1[_0x4d4f('0x25')]:_0x17a437['offset']+_0x17a437[_0x4d4f('0x26')];var _0x1e3e9a;if(_0x5b2863>=_0x15100a){_0x5b2863=_0x15100a;_0x1e3e9a=0xc8;}else{_0x1e3e9a=0xce;}_0x30b6b1[_0x4d4f('0x23')](_0x1e3e9a);return _0x30b6b1[_0x4d4f('0x27')](_0x4d4f('0x28'),_0x3566a5+'-'+_0x5b2863+'/'+_0x15100a)['json'](_0x51dcf1);}return null;};}function patchUpdates(_0x570520){return function(_0x4043f2){try{jsonpatch['apply'](_0x4043f2,_0x570520,!![]);}catch(_0x247077){return BPromise[_0x4d4f('0x29')](_0x247077);}return _0x4043f2[_0x4d4f('0x2a')]();};}function saveUpdates(_0x3f4a55,_0xf3f7a4){return function(_0x497cec){if(_0x497cec){return _0x497cec[_0x4d4f('0x2b')](_0x3f4a55)[_0x4d4f('0x2c')](function(_0x1cf365){return _0x1cf365;});}return null;};}function removeEntity(_0x28443b,_0x5cf9e7){return function(_0x51a7c5){if(_0x51a7c5){return _0x51a7c5[_0x4d4f('0x2d')]()[_0x4d4f('0x2c')](function(){var _0xa2492c=_0x51a7c5[_0x4d4f('0x2e')]({'plain':!![]});var _0x58acbe=_0x4d4f('0x2f');return db[_0x4d4f('0x30')][_0x4d4f('0x2d')]({'where':{'type':_0x58acbe,'resourceId':_0xa2492c['id']}})[_0x4d4f('0x2c')](function(){return _0x51a7c5;});})['then'](function(){_0x28443b[_0x4d4f('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1688bb,_0x333a40){return function(_0x550040){if(!_0x550040){_0x1688bb[_0x4d4f('0x21')](0x194);}return _0x550040;};}function handleError(_0x123383,_0x287a09){_0x287a09=_0x287a09||0x1f4;return function(_0x3d7f14){logger[_0x4d4f('0x31')](_0x3d7f14[_0x4d4f('0x32')]);if(_0x3d7f14['name']){delete _0x3d7f14[_0x4d4f('0x33')];}_0x123383[_0x4d4f('0x23')](_0x287a09)[_0x4d4f('0x34')](_0x3d7f14);};}exports[_0x4d4f('0x35')]=function(_0x104104,_0x4e47e5){var _0x2d6565={},_0x486e33={},_0x35f9e2={'count':0x0,'rows':[]};var _0x537a47=_['map'](db['VoicePrefix'][_0x4d4f('0x36')],function(_0x57fc2b){return{'name':_0x57fc2b[_0x4d4f('0x37')],'type':_0x57fc2b[_0x4d4f('0x38')][_0x4d4f('0x39')]};});_0x486e33['model']=_[_0x4d4f('0x3a')](_0x537a47,_0x4d4f('0x33'));_0x486e33[_0x4d4f('0x3b')]=_['keys'](_0x104104[_0x4d4f('0x3b')]);_0x486e33['filters']=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],_0x486e33[_0x4d4f('0x3b')]);_0x2d6565[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x486e33[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x104104[_0x4d4f('0x3b')]['fields']));_0x2d6565['attributes']=_0x2d6565[_0x4d4f('0x3e')]['length']?_0x2d6565['attributes']:_0x486e33[_0x4d4f('0x3d')];if(!_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x40')](_0x4d4f('0x41'))){_0x2d6565[_0x4d4f('0x26')]=qs['limit'](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2d6565['offset']=qs[_0x4d4f('0x42')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}_0x2d6565[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x44')]);_0x2d6565[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_['pick'](_0x104104['query'],_0x486e33[_0x4d4f('0x46')]),_0x537a47);if(_0x104104[_0x4d4f('0x3b')][_0x4d4f('0x47')]){_0x2d6565[_0x4d4f('0x45')]=_['merge'](_0x2d6565['where'],{'$or':_[_0x4d4f('0x3a')](_0x537a47,function(_0x3c34bd){if(_0x3c34bd['type']!=='VIRTUAL'){var _0x3591b7={};_0x3591b7[_0x3c34bd[_0x4d4f('0x33')]]={'$like':'%'+_0x104104['query'][_0x4d4f('0x47')]+'%'};return _0x3591b7;}})});}_0x2d6565=_[_0x4d4f('0x48')]({},_0x2d6565,_0x104104[_0x4d4f('0x49')]);var _0x32c6ff={'where':_0x2d6565[_0x4d4f('0x45')]};return db['VoicePrefix'][_0x4d4f('0x25')](_0x32c6ff)['then'](function(_0x45a0c1){_0x35f9e2[_0x4d4f('0x25')]=_0x45a0c1;if(_0x104104['query'][_0x4d4f('0x4a')]){_0x2d6565[_0x4d4f('0x4b')]=[{'all':!![]}];}return db[_0x4d4f('0x4c')]['findAll'](_0x2d6565);})[_0x4d4f('0x2c')](function(_0x48caa2){_0x35f9e2[_0x4d4f('0x4d')]=_0x48caa2;return _0x35f9e2;})['then'](respondWithFilteredResult(_0x4e47e5,_0x2d6565))[_0x4d4f('0x4e')](handleError(_0x4e47e5,null));};exports[_0x4d4f('0x4f')]=function(_0x231134,_0x2939cb){var _0x198c3a={'raw':![],'where':{'id':_0x231134['params']['id']}},_0x4a53e4={};_0x4a53e4[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x4c')][_0x4d4f('0x36')]);_0x4a53e4['query']=_['keys'](_0x231134['query']);_0x4a53e4[_0x4d4f('0x46')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],_0x4a53e4[_0x4d4f('0x3b')]);_0x198c3a[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4a53e4[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x231134[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x198c3a[_0x4d4f('0x3e')]=_0x198c3a[_0x4d4f('0x3e')]['length']?_0x198c3a[_0x4d4f('0x3e')]:_0x4a53e4[_0x4d4f('0x3d')];if(_0x231134['query'][_0x4d4f('0x4a')]){_0x198c3a['include']=[{'all':!![]}];}_0x198c3a=_[_0x4d4f('0x48')]({},_0x198c3a,_0x231134[_0x4d4f('0x49')]);return db['VoicePrefix'][_0x4d4f('0x51')](_0x198c3a)[_0x4d4f('0x2c')](handleEntityNotFound(_0x2939cb,null))[_0x4d4f('0x2c')](respondWithResult(_0x2939cb,null))[_0x4d4f('0x4e')](handleError(_0x2939cb,null));};exports[_0x4d4f('0x2d')]=function(_0x3eae74,_0x11a63e){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x3eae74[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x11a63e,null))[_0x4d4f('0x2c')](removeEntity(_0x11a63e,null))['catch'](handleError(_0x11a63e,null));};exports[_0x4d4f('0x53')]=function(_0x539088,_0x59d245){return db['VoicePrefix'][_0x4d4f('0x53')]()[_0x4d4f('0x2c')](respondWithResult(_0x59d245,null))['catch'](handleError(_0x59d245,null));};exports['create']=function(_0x2a3bc4,_0x4c80c4){var _0x5adc7b;return db[_0x4d4f('0x54')]['transaction'](function(_0x17b59e){return db[_0x4d4f('0x4c')][_0x4d4f('0x55')](_0x2a3bc4[_0x4d4f('0x56')],{'transaction':_0x17b59e})['then'](function(_0x224b83){_0x5adc7b=_0x224b83[_0x4d4f('0x2e')]({'plain':!![]});return db[_0x4d4f('0x57')][_0x4d4f('0x51')]({'where':{'id':_0x5adc7b[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x10f94e){return createVoicePrefixExtensions(_0x5adc7b,_0x10f94e,_0x17b59e);});});})['then'](function(){var _0x32cba6=_0x2a3bc4['user'][_0x4d4f('0x2e')]({'plain':!![]});if(!_0x32cba6)throw new Error(_0x4d4f('0x59'));if(_0x32cba6['role']===_0x4d4f('0x5a')){var _0x1d8ae6=_0x5adc7b;return db['UserProfileSection'][_0x4d4f('0x51')]({'where':{'name':'VoicePrefixes','userProfileId':_0x32cba6[_0x4d4f('0x5b')]},'raw':!![]})['then'](function(_0x48ad06){if(_0x48ad06&&_0x48ad06[_0x4d4f('0x5c')]===0x0){return db[_0x4d4f('0x30')][_0x4d4f('0x55')]({'name':_0x1d8ae6[_0x4d4f('0x33')],'resourceId':_0x1d8ae6['id'],'type':_0x48ad06[_0x4d4f('0x33')],'sectionId':_0x48ad06['id']},{})['then'](function(){return _0x5adc7b;});}else{return _0x5adc7b;}})['catch'](function(_0xeaccdd){logger['error'](_0x4d4f('0x5d'),_0xeaccdd);throw _0xeaccdd;});}return _0x5adc7b;})[_0x4d4f('0x2c')](respondWithResult(_0x4c80c4,null))[_0x4d4f('0x4e')](handleError(_0x4c80c4,null));};function Extension(_0x4585b5,_0x31aba3,_0x39ae15,_0x585764){this[_0x4d4f('0x5e')]=_0x4d4f('0x5f');this[_0x4d4f('0x60')]=_0x4585b5;this['app']=_0x39ae15;this[_0x4d4f('0x38')]=_0x4d4f('0x61');this[_0x4d4f('0x62')]='Voice\x20Prefix\x20Extension';this[_0x4d4f('0x63')]=_0x31aba3;this['appdata']=_0x585764;}function createVoicePrefixExtensions(_0xcdab8b,_0x2145ca,_0x1fe5ca){return new BPromise(function(_0xe8d3e2,_0x1edb3d){var _0x2e55f5=new Extension(formatPrefixName(_0xcdab8b[_0x4d4f('0x64')]),0x1,_0x4d4f('0x65'),_0x4d4f('0x66'));_0x2e55f5['VoicePrefixId']=_0xcdab8b['id'];return db[_0x4d4f('0x57')][_0x4d4f('0x55')](_0x2e55f5,{'transaction':_0x1fe5ca})['then'](function(_0x1bd4b1){var _0x2a3738=_0x1bd4b1[_0x4d4f('0x2e')]({'plain':!![]});var _0xae8fe=_['map'](addVoicePrefixExtensions(_0xcdab8b,_0x2145ca),function(_0x4013a9){_0x4013a9[_0x4d4f('0x58')]=_0x2a3738['id'];_0x4013a9['VoicePrefixId']=_0xcdab8b['id'];return _0x4013a9;});return db['VoiceExtension'][_0x4d4f('0x67')](_0xae8fe,{'transaction':_0x1fe5ca})[_0x4d4f('0x2c')](function(_0x53b2db){if(!_0x53b2db){return _0x1edb3d('Extensions\x20creation\x20failed');}else{return _0xe8d3e2(_0x53b2db);}})['catch'](function(_0x4752bd){return _0x1edb3d(_0x4752bd);});});;});};function addVoicePrefixExtensions(_0x351fb5,_0x5e0ead){var _0x347bb1=[];var _0xc596ea=formatPrefixName(_0x351fb5[_0x4d4f('0x64')]);_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x2,_0x4d4f('0x69'),_0x4d4f('0x6a')+_0x351fb5[_0x4d4f('0x33')]));if(_0x351fb5[_0x4d4f('0x6b')]){_0x347bb1['push'](new Extension(_0xc596ea,0x3,_0x4d4f('0x69'),'PREFIX-CALLERIDALL='+_0x351fb5[_0x4d4f('0x6b')]));}else{_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x3,_0x4d4f('0x65'),'No\x20callerid\x20available'));}_0x347bb1[_0x4d4f('0x68')](new Extension(_0xc596ea,0x4,_0x4d4f('0x6c'),_0x5e0ead[_0x4d4f('0x5e')]+','+_0x4d4f('0x6d')+(0x8+_0x351fb5['name'][_0x4d4f('0x6e')])+'}'+','+0x1));return _0x347bb1;}function formatPrefixName(_0x4bf7bd){var _0x268b34='_';for(var _0x50d0da=0x0;_0x50d0da<_0x4bf7bd['length'];_0x50d0da++){if(_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da)=='-'){_0x268b34+=_0x4bf7bd[_0x4d4f('0x6f')](_0x50d0da);}else{_0x268b34+='['+_0x4bf7bd['charAt'](_0x50d0da)+']';}}_0x268b34+='.';return _0x268b34;}exports[_0x4d4f('0x2b')]=function(_0x53a18b,_0x41ffe7,_0x4420f0){var _0x111c01=_0x53a18b[_0x4d4f('0x56')];_0x111c01['prefix']=_0x4d4f('0x70')+_0x111c01[_0x4d4f('0x33')]+'-';return db[_0x4d4f('0x54')]['transaction'](function(_0x781877){return db[_0x4d4f('0x4c')][_0x4d4f('0x2b')](_0x111c01,{'where':{'id':_0x111c01['id']},'transaction':_0x781877})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x57')][_0x4d4f('0x2d')]({'where':{'VoicePrefixId':_0x111c01['id']},'transaction':_0x781877})['then'](function(){return db['VoiceExtension'][_0x4d4f('0x51')]({'where':{'id':_0x111c01[_0x4d4f('0x58')]},'raw':!![]})['then'](function(_0x26ed6f){return createVoicePrefixExtensions(_0x111c01,_0x26ed6f,_0x781877);});});});})[_0x4d4f('0x2c')](function(){return db[_0x4d4f('0x4c')][_0x4d4f('0x71')](_0x111c01['id']);})[_0x4d4f('0x2c')](respondWithResult(_0x41ffe7,null))[_0x4d4f('0x4e')](handleError(_0x41ffe7,null));};exports[_0x4d4f('0x72')]=function(_0x1c764b,_0x302cde,_0x44f0c2){return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x1c764b[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x302cde,null))[_0x4d4f('0x2c')](function(_0x518252){if(_0x518252){return _0x518252[_0x4d4f('0x72')](_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')],_[_0x4d4f('0x74')](_0x1c764b['body'],['ids','id'])||{})[_0x4d4f('0x75')](function(_0x3c8a64){for(var _0x4736db=0x0;_0x4736db<_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x4736db+=0x1){socket[_0x4d4f('0x76')](_0x4d4f('0x77'),{'UserId':Number(_0x1c764b[_0x4d4f('0x56')][_0x4d4f('0x73')][_0x4736db]),'VoicePrefixId':Number(_0x1c764b['params']['id'])});}return _0x3c8a64;});}})[_0x4d4f('0x2c')](respondWithResult(_0x302cde,null))[_0x4d4f('0x4e')](handleError(_0x302cde,null));};exports[_0x4d4f('0x78')]=function(_0x2c8c79,_0x584c53,_0x5240be){return db['VoicePrefix'][_0x4d4f('0x51')]({'where':{'id':_0x2c8c79['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x584c53,null))[_0x4d4f('0x2c')](function(_0xa63721){if(_0xa63721){return _0xa63721[_0x4d4f('0x78')](_0x2c8c79[_0x4d4f('0x3b')][_0x4d4f('0x73')])[_0x4d4f('0x2c')](function(){if(_[_0x4d4f('0x79')](_0x2c8c79['query']['ids'])){for(var _0x42c66c=0x0;_0x42c66c<_0x2c8c79['query'][_0x4d4f('0x73')][_0x4d4f('0x6e')];_0x42c66c+=0x1){socket[_0x4d4f('0x76')]('userVoicePrefix:remove',{'UserId':Number(_0x2c8c79['query']['ids'][_0x42c66c]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}}else{socket['emit'](_0x4d4f('0x7a'),{'UserId':Number(_0x2c8c79['query'][_0x4d4f('0x73')]),'VoicePrefixId':Number(_0x2c8c79[_0x4d4f('0x52')]['id'])});}});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x584c53,null))[_0x4d4f('0x4e')](handleError(_0x584c53,null));};exports[_0x4d4f('0x7b')]=function(_0x1670fd,_0x548709,_0x18274e){var _0x3beacf={};var _0x4691b7={};var _0x1f62e0;var _0x328528;return db['VoicePrefix'][_0x4d4f('0x7c')]({'where':{'id':_0x1670fd['params']['id']}})[_0x4d4f('0x2c')](handleEntityNotFound(_0x548709,null))[_0x4d4f('0x2c')](function(_0x2511c8){if(_0x2511c8){_0x1f62e0=_0x2511c8;_0x4691b7[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db[_0x4d4f('0x7d')][_0x4d4f('0x36')]);_0x4691b7['query']=_[_0x4d4f('0x50')](_0x1670fd[_0x4d4f('0x3b')]);_0x4691b7[_0x4d4f('0x46')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],_0x4691b7['query']);_0x3beacf[_0x4d4f('0x3e')]=_['intersection'](_0x4691b7[_0x4d4f('0x3d')],qs[_0x4d4f('0x3f')](_0x1670fd[_0x4d4f('0x3b')]['fields']));_0x3beacf[_0x4d4f('0x3e')]=_0x3beacf[_0x4d4f('0x3e')][_0x4d4f('0x6e')]?_0x3beacf[_0x4d4f('0x3e')]:_0x4691b7['model'];_0x3beacf[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x1670fd['query'][_0x4d4f('0x44')]);_0x3beacf[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x1670fd[_0x4d4f('0x3b')],_0x4691b7[_0x4d4f('0x46')]));if(_0x1670fd['query'][_0x4d4f('0x47')]){_0x3beacf[_0x4d4f('0x45')]=_['merge'](_0x3beacf[_0x4d4f('0x45')],{'$or':_[_0x4d4f('0x3a')](_0x3beacf[_0x4d4f('0x3e')],function(_0x4686b9){var _0x16d1f7={};_0x16d1f7[_0x4686b9]={'$like':'%'+_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x16d1f7;})});}_0x3beacf=_[_0x4d4f('0x48')]({},_0x3beacf,_0x1670fd['options']);return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x4dd3f6){if(_0x4dd3f6){_0x328528=_0x4dd3f6[_0x4d4f('0x6e')];if(!_0x1670fd['query'][_0x4d4f('0x40')]('nolimit')){_0x3beacf[_0x4d4f('0x26')]=qs[_0x4d4f('0x26')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x3beacf[_0x4d4f('0x42')]=qs[_0x4d4f('0x42')](_0x1670fd[_0x4d4f('0x3b')][_0x4d4f('0x42')]);}return _0x1f62e0[_0x4d4f('0x7b')](_0x3beacf);}})[_0x4d4f('0x2c')](function(_0x10f882){if(_0x10f882){return _0x10f882?{'count':_0x328528,'rows':_0x10f882}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x548709,null))['catch'](handleError(_0x548709,null));};exports['getTeams']=function(_0x41c81d,_0x5d6abf,_0x2208d8){var _0x2b096e={};var _0x4e6da6={};var _0x53817f;var _0x10955f;return db[_0x4d4f('0x4c')][_0x4d4f('0x7c')]({'where':{'id':_0x41c81d['params']['id']}})['then'](handleEntityNotFound(_0x5d6abf,null))[_0x4d4f('0x2c')](function(_0x274ff2){if(_0x274ff2){_0x53817f=_0x274ff2;_0x4e6da6[_0x4d4f('0x3d')]=_[_0x4d4f('0x50')](db['Team'][_0x4d4f('0x36')]);_0x4e6da6[_0x4d4f('0x3b')]=_[_0x4d4f('0x50')](_0x41c81d['query']);_0x4e6da6['filters']=_[_0x4d4f('0x3c')](_0x4e6da6[_0x4d4f('0x3d')],_0x4e6da6[_0x4d4f('0x3b')]);_0x2b096e[_0x4d4f('0x3e')]=_[_0x4d4f('0x3c')](_0x4e6da6['model'],qs[_0x4d4f('0x3f')](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x3f')]));_0x2b096e['attributes']=_0x2b096e[_0x4d4f('0x3e')]['length']?_0x2b096e[_0x4d4f('0x3e')]:_0x4e6da6[_0x4d4f('0x3d')];_0x2b096e[_0x4d4f('0x43')]=qs[_0x4d4f('0x44')](_0x41c81d[_0x4d4f('0x3b')]['sort']);_0x2b096e[_0x4d4f('0x45')]=qs[_0x4d4f('0x46')](_[_0x4d4f('0x7e')](_0x41c81d[_0x4d4f('0x3b')],_0x4e6da6['filters']));if(_0x41c81d[_0x4d4f('0x3b')]['filter']){_0x2b096e['where']=_[_0x4d4f('0x48')](_0x2b096e[_0x4d4f('0x45')],{'$or':_['map'](_0x2b096e[_0x4d4f('0x3e')],function(_0x50b0a3){var _0x1177a3={};_0x1177a3[_0x50b0a3]={'$like':'%'+_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x47')]+'%'};return _0x1177a3;})});}_0x2b096e=_[_0x4d4f('0x48')]({},_0x2b096e,_0x41c81d[_0x4d4f('0x49')]);return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})[_0x4d4f('0x2c')](function(_0x3fe348){if(_0x3fe348){_0x10955f=_0x3fe348['length'];if(!_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x40')]('nolimit')){_0x2b096e[_0x4d4f('0x26')]=qs['limit'](_0x41c81d[_0x4d4f('0x3b')][_0x4d4f('0x26')]);_0x2b096e[_0x4d4f('0x42')]=qs['offset'](_0x41c81d['query']['offset']);}return _0x53817f[_0x4d4f('0x7f')](_0x2b096e);}})['then'](function(_0xb5d71b){if(_0xb5d71b){return _0xb5d71b?{'count':_0x10955f,'rows':_0xb5d71b}:null;}})[_0x4d4f('0x2c')](respondWithResult(_0x5d6abf,null))[_0x4d4f('0x4e')](handleError(_0x5d6abf,null));};exports['addTeams']=function(_0x5b6061,_0x230ff0,_0x28ae80){var _0x42be25=_0x5b6061[_0x4d4f('0x56')][_0x4d4f('0x73')];var _0x13279e;return db['Team'][_0x4d4f('0x80')]({'where':{'id':_0x42be25},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id',_0x4d4f('0x33'),_0x4d4f('0x82'),_0x4d4f('0x83'),_0x4d4f('0x84')],'raw':!![]}]})[_0x4d4f('0x2c')](function(_0x1a1e6f){if(_0x1a1e6f){_0x13279e=_0x1a1e6f;var _0x152400=_[_0x4d4f('0x85')](_0x1a1e6f,function(_0x3c6f1b){var _0x25e63c=_0x3c6f1b[_0x4d4f('0x2e')]({'plain':!![]});return _0x25e63c['Agents'];});return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x5b6061[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0xc01ac4){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x472938){return _0xc01ac4[_0x4d4f('0x87')](_0x42be25,{'transaction':_0x472938})['then'](function(){return BPromise[_0x4d4f('0x88')](_0x13279e,function(_0x72d583){return db[_0x4d4f('0x89')][_0x4d4f('0x8a')]({'TeamId':_0x72d583['id'],'VoicePrefixId':_0x5b6061[_0x4d4f('0x52')]['id']},{'transaction':_0x472938});});})[_0x4d4f('0x2c')](function(){return BPromise[_0x4d4f('0x88')](_0x152400,function(_0x28fd35){return db[_0x4d4f('0x8b')][_0x4d4f('0x8c')]({'where':{'UserId':_0x28fd35['id'],'VoicePrefixId':_0x5b6061['params']['id']},'transaction':_0x472938});});})['then'](function(){_0x152400[_0x4d4f('0x8d')](function(_0x8850a4){socket['emit'](_0x4d4f('0x77'),{'UserId':_0x8850a4['id'],'VoicePrefixId':_0xc01ac4['id']});});});});});}})[_0x4d4f('0x2c')](respondWithStatusCode(_0x230ff0,null))[_0x4d4f('0x4e')](handleError(_0x230ff0,null));};exports[_0x4d4f('0x8e')]=function(_0x15028c,_0x1659f6,_0x77dac1){return db[_0x4d4f('0x8f')][_0x4d4f('0x80')]({'where':{'id':_0x15028c[_0x4d4f('0x3b')][_0x4d4f('0x73')]},'attributes':['id'],'include':[{'model':db[_0x4d4f('0x7d')],'as':_0x4d4f('0x81'),'attributes':['id'],'raw':!![]}]})[_0x4d4f('0x2c')](handleEntityNotFound(_0x1659f6,null))['then'](function(_0x342b63){var _0x524ed0=_[_0x4d4f('0x3a')](_0x342b63,'id');var _0x3fd499=[];var _0x17a39f=[];var _0x27b4d6=squel['select']();_0x27b4d6[_0x4d4f('0x90')](_0x4d4f('0x91'))[_0x4d4f('0x92')](_0x4d4f('0x93'),'tq')[_0x4d4f('0x94')](_0x4d4f('0x95'),'ut',_0x4d4f('0x96'))['where'](_0x4d4f('0x97'),_0x15028c[_0x4d4f('0x52')]['id']);for(var _0x2f4bad=0x0;_0x2f4bad<_0x342b63[_0x4d4f('0x6e')];_0x2f4bad+=0x1){let _0x4501b5=_0x342b63[_0x2f4bad];for(var _0x12eda1=0x0;_0x12eda1<_0x4501b5['Agents']['length'];_0x12eda1+=0x1){let _0x11ee76=_0x4501b5['Agents'][_0x12eda1];var _0x2ea6b4=_0x27b4d6[_0x4d4f('0x98')]();_0x2ea6b4['where'](_0x4d4f('0x99'),_0x11ee76['id']);_0x17a39f[_0x4d4f('0x68')](db[_0x4d4f('0x54')][_0x4d4f('0x3b')](_0x2ea6b4[_0x4d4f('0x9a')](),{'type':db[_0x4d4f('0x54')][_0x4d4f('0x9b')]['SELECT']})[_0x4d4f('0x2c')](function(_0x5d05cb){if(_0x5d05cb[_0x4d4f('0x6e')]===0x1){return _0x11ee76['id'];}else{var _0x2d1337=_['every'](_['map'](_0x5d05cb,_0x4d4f('0x9c')),function(_0x17894c){return _[_0x4d4f('0x9d')](_0x524ed0,_0x17894c);});if(_0x2d1337){return _0x11ee76['id'];}}}));}}return BPromise['all'](_0x17a39f)[_0x4d4f('0x2c')](function(_0x118642){_0x3fd499=_(_0x3fd499)[_0x4d4f('0x9e')](_0x118642)[_0x4d4f('0x9f')]()[_0x4d4f('0xa0')]();return db[_0x4d4f('0x4c')][_0x4d4f('0x51')]({'where':{'id':_0x15028c[_0x4d4f('0x52')]['id']}})[_0x4d4f('0x2c')](function(_0x51e70f){return db[_0x4d4f('0x54')][_0x4d4f('0x86')](function(_0x23485f){return _0x51e70f[_0x4d4f('0x8e')](_0x15028c['query'][_0x4d4f('0x73')],{'transaction':_0x23485f})['then'](function(){if(!_['isEmpty'](_0x3fd499)){return _0x51e70f[_0x4d4f('0x78')](_0x3fd499,{'transaction':_0x23485f});}})[_0x4d4f('0x2c')](function(){_0x3fd499[_0x4d4f('0x8d')](function(_0x3de9b3){socket[_0x4d4f('0x76')](_0x4d4f('0x7a'),{'UserId':_0x3de9b3,'VoicePrefixId':_0x51e70f['id']});});});});});});})[_0x4d4f('0x2c')](respondWithStatusCode(_0x1659f6,null))[_0x4d4f('0x4e')](handleError(_0x1659f6,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 74790c7..3e7eeae 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 _0x5606=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoicePrefix','save','update'];(function(_0x458548,_0x2d4424){var _0x3e409f=function(_0x1a9f4a){while(--_0x1a9f4a){_0x458548['push'](_0x458548['shift']());}};_0x3e409f(++_0x2d4424);}(_0x5606,0x11b));var _0x6560=function(_0x5af827,_0x34079c){_0x5af827=_0x5af827-0x0;var _0xf3ed55=_0x5606[_0x5af827];return _0xf3ed55;};'use strict';var EventEmitter=require(_0x6560('0x0'));var VoicePrefix=require(_0x6560('0x1'))['db'][_0x6560('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6560('0x3'),'afterUpdate':_0x6560('0x4'),'afterDestroy':'remove'};function emitEvent(_0x4ccf61){return function(_0x3924a6,_0x844c80,_0x43c506){VoicePrefixEvents[_0x6560('0x5')](_0x4ccf61+':'+_0x3924a6['id'],_0x3924a6);VoicePrefixEvents[_0x6560('0x5')](_0x4ccf61,_0x3924a6);_0x43c506(null);};}for(var e in events){if(events[_0x6560('0x6')](e)){var event=events[e];VoicePrefix[_0x6560('0x7')](e,emitEvent(event));}}module[_0x6560('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x2e04=['setMaxListeners','save','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix'];(function(_0x1061df,_0x23443f){var _0x3ff5a5=function(_0x32a6d5){while(--_0x32a6d5){_0x1061df['push'](_0x1061df['shift']());}};_0x3ff5a5(++_0x23443f);}(_0x2e04,0x105));var _0x42e0=function(_0x260457,_0x4f3e4f){_0x260457=_0x260457-0x0;var _0x40da72=_0x2e04[_0x260457];return _0x40da72;};'use strict';var EventEmitter=require(_0x42e0('0x0'));var VoicePrefix=require(_0x42e0('0x1'))['db'][_0x42e0('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x42e0('0x3')](0x0);var events={'afterCreate':_0x42e0('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4ad82e){return function(_0x2e8371,_0x4cc3fa,_0x33391){VoicePrefixEvents[_0x42e0('0x5')](_0x4ad82e+':'+_0x2e8371['id'],_0x2e8371);VoicePrefixEvents[_0x42e0('0x5')](_0x4ad82e,_0x2e8371);_0x33391(null);};}for(var e in events){if(events[_0x42e0('0x6')](e)){var event=events[e];VoicePrefix[_0x42e0('0x7')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index ff80f03..63e94d9 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 _0xc111=['../../config/environment','./voicePrefix.attributes','define','voice_prefixes','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0xb9268f,_0xac26ac){var _0x14a2da=function(_0x39f99f){while(--_0x39f99f){_0xb9268f['push'](_0xb9268f['shift']());}};_0x14a2da(++_0xac26ac);}(_0xc111,0xe8));var _0x1c11=function(_0x35cda1,_0x493a02){_0x35cda1=_0x35cda1-0x0;var _0x48da9d=_0xc111[_0x35cda1];return _0x48da9d;};'use strict';var _=require(_0x1c11('0x0'));var util=require(_0x1c11('0x1'));var logger=require(_0x1c11('0x2'))(_0x1c11('0x3'));var moment=require(_0x1c11('0x4'));var BPromise=require('bluebird');var rp=require(_0x1c11('0x5'));var fs=require('fs');var path=require(_0x1c11('0x6'));var rimraf=require(_0x1c11('0x7'));var config=require(_0x1c11('0x8'));var attributes=require(_0x1c11('0x9'));module['exports']=function(_0x49a013,_0x24ed09){return _0x49a013[_0x1c11('0xa')]('VoicePrefix',attributes,{'tableName':_0x1c11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd7fa=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','lodash','util','../../config/logger','api'];(function(_0x59ef10,_0x58d362){var _0x4b8f00=function(_0x34c52a){while(--_0x34c52a){_0x59ef10['push'](_0x59ef10['shift']());}};_0x4b8f00(++_0x58d362);}(_0xd7fa,0x13e));var _0xad7f=function(_0x13ea62,_0x3cf2e8){_0x13ea62=_0x13ea62-0x0;var _0x3cf536=_0xd7fa[_0x13ea62];return _0x3cf536;};'use strict';var _=require(_0xad7f('0x0'));var util=require(_0xad7f('0x1'));var logger=require(_0xad7f('0x2'))(_0xad7f('0x3'));var moment=require(_0xad7f('0x4'));var BPromise=require(_0xad7f('0x5'));var rp=require(_0xad7f('0x6'));var fs=require('fs');var path=require(_0xad7f('0x7'));var rimraf=require(_0xad7f('0x8'));var config=require(_0xad7f('0x9'));var attributes=require(_0xad7f('0xa'));module[_0xad7f('0xb')]=function(_0x4bb4c1,_0x8a61ac){return _0x4bb4c1[_0xad7f('0xc')](_0xad7f('0xd'),attributes,{'tableName':'voice_prefixes','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 c1cabcc..df7505f 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 _0x753c=['then','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register'];(function(_0xabfba7,_0x22243f){var _0x22a7a3=function(_0x2d87ff){while(--_0x2d87ff){_0xabfba7['push'](_0xabfba7['shift']());}};_0x22a7a3(++_0x22243f);}(_0x753c,0x96));var _0xc753=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x753c[_0x465028];return _0xb783d4;};'use strict';var _=require('lodash');var util=require(_0xc753('0x0'));var moment=require('moment');var BPromise=require(_0xc753('0x1'));var rs=require(_0xc753('0x2'));var fs=require('fs');var Redis=require(_0xc753('0x3'));var db=require(_0xc753('0x4'))['db'];var utils=require(_0xc753('0x5'));var logger=require(_0xc753('0x6'))(_0xc753('0x7'));var config=require(_0xc753('0x8'));var jayson=require(_0xc753('0x9'));var client=jayson[_0xc753('0xa')][_0xc753('0xb')]({'port':0x232a});config[_0xc753('0xc')]=_[_0xc753('0xd')](config[_0xc753('0xc')],{'host':_0xc753('0xe'),'port':0x18eb});var socket=require(_0xc753('0xf'))(new Redis(config[_0xc753('0xc')]));require(_0xc753('0x10'))[_0xc753('0x11')](socket);function respondWithRpcPromise(_0x12c8bb,_0x1fe61c,_0x26cebf){return new BPromise(function(_0x358393,_0xed0fdd){return client['request'](_0x12c8bb,_0x26cebf)[_0xc753('0x12')](function(_0x366591){logger['info'](_0xc753('0x13'),_0x1fe61c,'request\x20sent');logger[_0xc753('0x14')](_0xc753('0x15'),_0x1fe61c,_0xc753('0x16'),JSON['stringify'](_0x366591));if(_0x366591[_0xc753('0x17')]){if(_0x366591['error'][_0xc753('0x18')]===0x1f4){logger['error'](_0xc753('0x13'),_0x1fe61c,_0x366591[_0xc753('0x17')][_0xc753('0x19')]);return _0xed0fdd(_0x366591[_0xc753('0x17')][_0xc753('0x19')]);}logger['error'](_0xc753('0x13'),_0x1fe61c,_0x366591[_0xc753('0x17')][_0xc753('0x19')]);return _0x358393(_0x366591[_0xc753('0x17')][_0xc753('0x19')]);}else{logger[_0xc753('0x1a')](_0xc753('0x13'),_0x1fe61c,_0xc753('0x16'));_0x358393(_0x366591['result'][_0xc753('0x19')]);}})[_0xc753('0x1b')](function(_0x367c39){logger[_0xc753('0x17')](_0xc753('0x13'),_0x1fe61c,_0x367c39);_0xed0fdd(_0x367c39);});});} \ No newline at end of file +var _0x4815=['socket.io-emitter','./voicePrefix.socket','register','request','then','info','request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','VoicePrefix,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x62cb8d,_0x838242){var _0x3c83e4=function(_0x3d747d){while(--_0x3d747d){_0x62cb8d['push'](_0x62cb8d['shift']());}};_0x3c83e4(++_0x838242);}(_0x4815,0xff));var _0x5481=function(_0xcf3ebb,_0x2aee58){_0xcf3ebb=_0xcf3ebb-0x0;var _0x4d9f93=_0x4815[_0xcf3ebb];return _0x4d9f93;};'use strict';var _=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var moment=require(_0x5481('0x2'));var BPromise=require(_0x5481('0x3'));var rs=require(_0x5481('0x4'));var fs=require('fs');var Redis=require(_0x5481('0x5'));var db=require(_0x5481('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5481('0x7'));var config=require(_0x5481('0x8'));var jayson=require(_0x5481('0x9'));var client=jayson[_0x5481('0xa')][_0x5481('0xb')]({'port':0x232a});config[_0x5481('0xc')]=_[_0x5481('0xd')](config[_0x5481('0xc')],{'host':_0x5481('0xe'),'port':0x18eb});var socket=require(_0x5481('0xf'))(new Redis(config[_0x5481('0xc')]));require(_0x5481('0x10'))[_0x5481('0x11')](socket);function respondWithRpcPromise(_0x175606,_0x4529f5,_0x1447bf){return new BPromise(function(_0x4ba568,_0x4c484d){return client[_0x5481('0x12')](_0x175606,_0x1447bf)[_0x5481('0x13')](function(_0x46b6a3){logger[_0x5481('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x4529f5,_0x5481('0x15'));logger['debug'](_0x5481('0x16'),_0x4529f5,_0x5481('0x15'),JSON[_0x5481('0x17')](_0x46b6a3));if(_0x46b6a3['error']){if(_0x46b6a3[_0x5481('0x18')]['code']===0x1f4){logger[_0x5481('0x18')](_0x5481('0x19'),_0x4529f5,_0x46b6a3[_0x5481('0x18')][_0x5481('0x1a')]);return _0x4c484d(_0x46b6a3[_0x5481('0x18')][_0x5481('0x1a')]);}logger[_0x5481('0x18')](_0x5481('0x19'),_0x4529f5,_0x46b6a3[_0x5481('0x18')][_0x5481('0x1a')]);return _0x4ba568(_0x46b6a3['error'][_0x5481('0x1a')]);}else{logger[_0x5481('0x14')](_0x5481('0x19'),_0x4529f5,'request\x20sent');_0x4ba568(_0x46b6a3['result']['message']);}})['catch'](function(_0x3b3a11){logger[_0x5481('0x18')](_0x5481('0x19'),_0x4529f5,_0x3b3a11);_0x4c484d(_0x3b3a11);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 234173d..fa84c42 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 _0xf430=['save','remove','removeListener','voicePrefix:','./voicePrefix.events'];(function(_0x16d215,_0x3ea8d1){var _0x3cb7ba=function(_0x5aa38b){while(--_0x5aa38b){_0x16d215['push'](_0x16d215['shift']());}};_0x3cb7ba(++_0x3ea8d1);}(_0xf430,0x1e4));var _0x0f43=function(_0x19115e,_0x507bab){_0x19115e=_0x19115e-0x0;var _0x45bbd4=_0xf430[_0x19115e];return _0x45bbd4;};'use strict';var VoicePrefixEvents=require(_0x0f43('0x0'));var events=[_0x0f43('0x1'),_0x0f43('0x2'),'update'];function createListener(_0x379dd5,_0x7d24d9){return function(_0x5f0981){_0x7d24d9['emit'](_0x379dd5,_0x5f0981);};}function removeListener(_0x462c88,_0x52c285){return function(){VoicePrefixEvents[_0x0f43('0x3')](_0x462c88,_0x52c285);};}exports['register']=function(_0x5edfba){for(var _0x31f752=0x0,_0x490bc1=events['length'];_0x31f752<_0x490bc1;_0x31f752++){var _0x2e8f68=events[_0x31f752];var _0x39bc4c=createListener(_0x0f43('0x4')+_0x2e8f68,_0x5edfba);VoicePrefixEvents['on'](_0x2e8f68,_0x39bc4c);}}; \ No newline at end of file +var _0x4fdc=['update','emit','removeListener','register','length','voicePrefix:','save'];(function(_0x558cf5,_0x3caae2){var _0x45f531=function(_0x260d74){while(--_0x260d74){_0x558cf5['push'](_0x558cf5['shift']());}};_0x45f531(++_0x3caae2);}(_0x4fdc,0x84));var _0xc4fd=function(_0x3bf12c,_0x3f717a){_0x3bf12c=_0x3bf12c-0x0;var _0x2eb204=_0x4fdc[_0x3bf12c];return _0x2eb204;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xc4fd('0x0'),'remove',_0xc4fd('0x1')];function createListener(_0x19b8cd,_0x49fd20){return function(_0x4db5c0){_0x49fd20[_0xc4fd('0x2')](_0x19b8cd,_0x4db5c0);};}function removeListener(_0x2dee59,_0x363bd1){return function(){VoicePrefixEvents[_0xc4fd('0x3')](_0x2dee59,_0x363bd1);};}exports[_0xc4fd('0x4')]=function(_0x2547d5){for(var _0x3157b2=0x0,_0x57502f=events[_0xc4fd('0x5')];_0x3157b2<_0x57502f;_0x3157b2++){var _0x355b9f=events[_0x3157b2];var _0x4962d7=createListener(_0xc4fd('0x6')+_0x355b9f,_0x2547d5);VoicePrefixEvents['on'](_0x355b9f,_0x4962d7);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index d058f1b..5fd0795 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(_0x3b0470,_0x1f4e53){var _0x36022e=function(_0x23c540){while(--_0x23c540){_0x3b0470['push'](_0x3b0470['shift']());}};_0x36022e(++_0x1f4e53);}(_0xa9e0,0x123));var _0x0a9e=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0xa9e0[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/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(_0x2abfcb,_0xdbaed9){var _0x9a3de=function(_0x475f45){while(--_0x475f45){_0x2abfcb['push'](_0x2abfcb['shift']());}};_0x9a3de(++_0xdbaed9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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 f869777..943af54 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 _0xf858=['strategy','getDataValue','dialMethod','booked','roundrobin','progressive','predictive','INTEGER','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','acw','wrapuptime','Active/Disactive\x20Campaign','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','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)','#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','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','STRING','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','setDataValue'];(function(_0x253855,_0x231713){var _0x4d4eab=function(_0x1b6986){while(--_0x1b6986){_0x253855['push'](_0x253855['shift']());}};_0x4d4eab(++_0x231713);}(_0xf858,0x179));var _0x8f85=function(_0x1dd32b,_0x55e8da){_0x1dd32b=_0x1dd32b-0x0;var _0x1c662f=_0xf858[_0x1dd32b];return _0x1c662f;};'use strict';var Sequelize=require(_0x8f85('0x0'));module['exports']={'name':{'type':Sequelize[_0x8f85('0x1')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x3'),_0x8f85('0x4')),'allowNull':![],'defaultValue':_0x8f85('0x3')},'musiconhold':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':_0x8f85('0x5')},'announce':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x8f85('0x6'),_0x8f85('0x7'),_0x8f85('0x8'),'random','rrmemory',_0x8f85('0x9'),_0x8f85('0xa'),_0x8f85('0xb')),'allowNull':![],'defaultValue':_0x8f85('0x6'),'set':function(_0x5f54e1){this[_0x8f85('0xc')](_0x8f85('0xd'),_0x5f54e1?_0x5f54e1:'rrmemory');},'get':function(){var _0x1e0f90=this[_0x8f85('0xe')]('type');var _0x36920e=this[_0x8f85('0xe')](_0x8f85('0xf'));var _0x4961f5=this['getDataValue'](_0x8f85('0xd'));if(_0x1e0f90===_0x8f85('0x3')){return _0x4961f5;}if(_0x36920e===_0x8f85('0x10')&&_0x4961f5==='rrmemory'||_0x36920e===_0x8f85('0x10')&&_0x4961f5===_0x8f85('0x11')){return _0x4961f5;}if(_0x36920e===_0x8f85('0x12')||_0x36920e===_0x8f85('0x13')||_0x36920e==='power'){return _0x4961f5;}return null;}},'servicelevel':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x8f85('0x14')](0xb)},'timeout':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x8f85('0x1')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'yes'},'autopause':{'type':Sequelize['ENUM'](_0x8f85('0x15'),'no',_0x8f85('0x16')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x8f85('0x14')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x8f85('0x15'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x8f85('0x2')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x8f85('0x1')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':_0x8f85('0x15')},'announce_holdtime':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no',_0x8f85('0x17')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize['ENUM']('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x8f85('0x1')]},'queue_youarenext':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x8f85('0x1')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize[_0x8f85('0x1')]},'queue_quantity2':{'type':Sequelize[_0x8f85('0x1')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x8f85('0x1')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x87f53d){this['setDataValue'](_0x8f85('0x18'),_0x87f53d?_0x87f53d['join'](','):[]);},'get':function(){return this[_0x8f85('0xe')]('periodic_announce')?this[_0x8f85('0xe')](_0x8f85('0x18'))[_0x8f85('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':_0x8f85('0x15'),'set':function(_0x1115e1){this[_0x8f85('0xc')](_0x8f85('0x1a'),_0x1115e1?_0x1115e1[_0x8f85('0x1b')](','):undefined);},'get':function(){return this['getDataValue']('joinempty')?this[_0x8f85('0xe')]('joinempty')[_0x8f85('0x19')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x350972){this['setDataValue'](_0x8f85('0x1c'),_0x350972?_0x350972[_0x8f85('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x8f85('0x1c'))?this['getDataValue'](_0x8f85('0x1c'))[_0x8f85('0x19')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM'](_0x8f85('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x8f85('0x1')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x3b7480){this[_0x8f85('0xc')](_0x8f85('0x1d'),_0x3b7480);if(_0x3b7480){if(this[_0x8f85('0xe')]('wrapuptime')<0x2){this[_0x8f85('0xc')](_0x8f85('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x8f85('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8f85('0x1f')},'dialMethod':{'type':Sequelize['ENUM'](_0x8f85('0x20'),_0x8f85('0x12'),_0x8f85('0x21'),'predictive','booked'),'defaultValue':_0x8f85('0x12'),'comment':_0x8f85('0x22')},'dialLimitChannel':{'type':Sequelize[_0x8f85('0x14')](0x4)[_0x8f85('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8f85('0x24')},'dialLimitQueue':{'type':Sequelize[_0x8f85('0x14')](0x4)[_0x8f85('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x8f85('0x25')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x8f85('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x26'),_0x8f85('0x27')),'defaultValue':_0x8f85('0x27'),'comment':_0x8f85('0x28')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x8f85('0x29')](0x2)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x8f85('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x8f85('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x8f85('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x8f85('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8f85('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':'tTxX','comment':_0x8f85('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x2d')},'dialQueueProject':{'type':Sequelize[_0x8f85('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x2e')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f85('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'comment':_0x8f85('0x31')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8f85('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f85('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x8f85('0x33')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':_0x8f85('0x34')},'dialPrefix':{'type':Sequelize[_0x8f85('0x1')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x35'),_0x8f85('0x36'),_0x8f85('0x37')),'defaultValue':_0x8f85('0x35')},'dialAMDActive':{'type':Sequelize[_0x8f85('0x38')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x8f85('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x8f85('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x8f85('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x8f85('0x14')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x8f85('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x8f85('0x14')](0x9)[_0x8f85('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x8f85('0x14')](0x9)[_0x8f85('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x8f85('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x8f85('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x8f85('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x8f85('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x8f85('0x3e')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x8f85('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x8f85('0x14')](0x5)[_0x8f85('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x8f85('0x40')},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x8f85('0x41')},'dialOrderByScheduledAt':{'type':Sequelize[_0x8f85('0x2')](_0x8f85('0x42'),_0x8f85('0x43')),'defaultValue':_0x8f85('0x42')},'dialQueueProject2':{'type':Sequelize[_0x8f85('0x1')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x8f85('0x38')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x8f85('0x38')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8f85('0x44')},'dialCutDigit':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x8f85('0x45')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x46')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x8f85('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f85('0x47')},'dialDropMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x48')},'dialDropRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x8f85('0x49')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f85('0x4a')},'dialMachineMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)[_0x8f85('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x8f85('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x8f85('0x14')](0x5)[_0x8f85('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x8f85('0x14')],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x8f85('0x38')],'defaultValue':![],'comment':_0x8f85('0x4c'),'set':function(_0x4d1981){if(!_0x4d1981)this['setDataValue'](_0x8f85('0x4d'),null);this[_0x8f85('0xc')]('mandatoryDisposition',_0x4d1981);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x8f85('0x14')](0x3)[_0x8f85('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize[_0x8f85('0x38')],'defaultValue':!![]}}; \ No newline at end of file +var _0xc139=['Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','ENUM','inbound','outbound','STRING','ringall','leastrecent','fewestcalls','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','booked','rrmemory','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','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','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen'];(function(_0x522cca,_0x2b77ce){var _0x41da0f=function(_0x24d964){while(--_0x24d964){_0x522cca['push'](_0x522cca['shift']());}};_0x41da0f(++_0x2b77ce);}(_0xc139,0x15f));var _0x9c13=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc139[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9c13('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x2'),_0x9c13('0x3')),'allowNull':![],'defaultValue':_0x9c13('0x2')},'musiconhold':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x9c13('0x5'),_0x9c13('0x6'),_0x9c13('0x7'),'random','rrmemory',_0x9c13('0x8'),_0x9c13('0x9'),_0x9c13('0xa')),'allowNull':![],'defaultValue':_0x9c13('0x5'),'set':function(_0x991ff7){this[_0x9c13('0xb')](_0x9c13('0xc'),_0x991ff7?_0x991ff7:'rrmemory');},'get':function(){var _0x4a9427=this['getDataValue'](_0x9c13('0xd'));var _0x260871=this[_0x9c13('0xe')]('dialMethod');var _0x32cf1d=this[_0x9c13('0xe')](_0x9c13('0xc'));if(_0x4a9427==='inbound'){return _0x32cf1d;}if(_0x260871===_0x9c13('0xf')&&_0x32cf1d===_0x9c13('0x10')||_0x260871===_0x9c13('0xf')&&_0x32cf1d===_0x9c13('0x11')){return _0x32cf1d;}if(_0x260871===_0x9c13('0x12')||_0x260871===_0x9c13('0x13')||_0x260871===_0x9c13('0x14')){return _0x32cf1d;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x9c13('0x15')](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x9c13('0x4')]},'weight':{'type':Sequelize[_0x9c13('0x15')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x9c13('0x16')},'autopause':{'type':Sequelize[_0x9c13('0x1')]('yes','no',_0x9c13('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x9c13('0x15')](0xb)},'autopausebusy':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x9c13('0x1')]('yes','no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x9c13('0x1')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x9c13('0x16'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x16'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x9c13('0x16'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x9c13('0x4')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize['ENUM'](_0x9c13('0x16'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x16'),'no'),'defaultValue':_0x9c13('0x16')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x9c13('0x16'),'no',_0x9c13('0x18')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x16'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x9c13('0x1')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x9c13('0x4')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x9c13('0x4')]},'queue_quantity1':{'type':Sequelize[_0x9c13('0x4')]},'queue_quantity2':{'type':Sequelize[_0x9c13('0x4')]},'queue_periodic_announce':{'type':Sequelize[_0x9c13('0x4')]},'queue_less_than':{'type':Sequelize[_0x9c13('0x4')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x505e9c){this[_0x9c13('0xb')](_0x9c13('0x19'),_0x505e9c?_0x505e9c[_0x9c13('0x1a')](','):[]);},'get':function(){return this[_0x9c13('0xe')](_0x9c13('0x19'))?this[_0x9c13('0xe')](_0x9c13('0x19'))[_0x9c13('0x1b')](','):[];}},'joinempty':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':_0x9c13('0x16'),'set':function(_0x3985f1){this[_0x9c13('0xb')](_0x9c13('0x1c'),_0x3985f1?_0x3985f1['join'](','):undefined);},'get':function(){return this['getDataValue'](_0x9c13('0x1c'))?this[_0x9c13('0xe')](_0x9c13('0x1c'))[_0x9c13('0x1b')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':'no','set':function(_0x59219f){this[_0x9c13('0xb')](_0x9c13('0x1d'),_0x59219f?_0x59219f[_0x9c13('0x1a')](','):undefined);},'get':function(){return this[_0x9c13('0xe')](_0x9c13('0x1d'))?this['getDataValue'](_0x9c13('0x1d'))[_0x9c13('0x1b')](','):undefined;}},'reportholdtime':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x9c13('0x1')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM'](_0x9c13('0x16'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x9c13('0x4')]},'description':{'type':Sequelize[_0x9c13('0x4')]},'acw':{'type':Sequelize[_0x9c13('0x1e')],'defaultValue':0x0,'set':function(_0x1935ea){this[_0x9c13('0xb')](_0x9c13('0x1f'),_0x1935ea);if(_0x1935ea){if(this[_0x9c13('0xe')](_0x9c13('0x20'))<0x2){this[_0x9c13('0xb')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0x9c13('0x15')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x9c13('0x21')},'dialMethod':{'type':Sequelize[_0x9c13('0x1')]('preview',_0x9c13('0x12'),'power','predictive','booked'),'defaultValue':_0x9c13('0x12'),'comment':_0x9c13('0x22')},'dialLimitChannel':{'type':Sequelize[_0x9c13('0x15')](0x4)[_0x9c13('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c13('0x24')},'dialLimitQueue':{'type':Sequelize[_0x9c13('0x15')](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x9c13('0x25')},'dialPowerLevel':{'type':Sequelize[_0x9c13('0x26')](0x2)[_0x9c13('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x9c13('0x27')},'dialPredictiveOptimization':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x28'),_0x9c13('0x29')),'defaultValue':_0x9c13('0x29'),'comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x9c13('0x26')](0x2)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x9c13('0x15')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x9c13('0x2a')},'dialOriginateCallerIdName':{'type':Sequelize[_0x9c13('0x4')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x9c13('0x4')]},'dialOriginateTimeout':{'type':Sequelize[_0x9c13('0x15')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x9c13('0x2b'),'comment':_0x9c13('0x2c')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x2d')},'dialQueueProject':{'type':Sequelize[_0x9c13('0x4')],'comment':_0x9c13('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c13('0x2f')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'comment':_0x9c13('0x30')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x9c13('0x31')},'dialTimezone':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x9c13('0x4')],'defaultValue':_0x9c13('0x32')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x33'),_0x9c13('0x34'),_0x9c13('0x35')),'defaultValue':_0x9c13('0x33')},'dialAMDActive':{'type':Sequelize[_0x9c13('0x1e')],'defaultValue':0x0,'comment':_0x9c13('0x36')},'dialAMDInitialSilence':{'type':Sequelize[_0x9c13('0x15')](0x9)[_0x9c13('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x9c13('0x15')](0x9)[_0x9c13('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x9c13('0x37')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x9c13('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x9c13('0x38')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x9c13('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c13('0x39')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x9c13('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x9c13('0x15')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x9c13('0x3a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x9c13('0x15')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x9c13('0x3b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x9c13('0x3c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x9c13('0x15')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x9c13('0x3d')},'dialRecallMeTimeout':{'type':Sequelize['INTEGER'](0x5)[_0x9c13('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x9c13('0x3e')},'dialRecallInQueue':{'type':Sequelize[_0x9c13('0x1e')],'defaultValue':0x0,'comment':_0x9c13('0x3f')},'dialOrderByScheduledAt':{'type':Sequelize[_0x9c13('0x1')](_0x9c13('0x40'),_0x9c13('0x41')),'defaultValue':_0x9c13('0x40')},'dialQueueProject2':{'type':Sequelize[_0x9c13('0x4')],'comment':_0x9c13('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x9c13('0x1e')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9c13('0x42')},'dialCutDigit':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x9c13('0x43')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x44')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c13('0x45')},'dialDropMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x46')},'dialDropRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c13('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x49')},'dialMachineRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c13('0x4a')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x9c13('0x15')](0x3)[_0x9c13('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x9c13('0x4b')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x9c13('0x15')](0x5)[_0x9c13('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x9c13('0x4c')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9c13('0x15')],'allowNull':!![],'comment':_0x9c13('0x4d')},'mandatoryDisposition':{'type':Sequelize[_0x9c13('0x1e')],'defaultValue':![],'comment':_0x9c13('0x4e'),'set':function(_0x359a52){if(!_0x359a52)this[_0x9c13('0xb')](_0x9c13('0x4f'),null);this[_0x9c13('0xb')](_0x9c13('0x50'),_0x359a52);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x9c13('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x9c13('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}},'dialPreviewAutoRecallMe':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index b4d8492..548c7c3 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 _0x7f75=['CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','Team','User','Agents','online','interface','penalty','sequelize','transaction','TeamVoiceQueue','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','forEach','emit','userVoiceQueue:save','removeTeams','ids','field','from','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','compact','isEmpty','removeAgents','spread','isArray','userVoiceQueue:remove','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','select','CmListId','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','COALESCE(phone,\x27\x27)','scheduledAt','ListId','phone\x20IS\x20NOT\x20NULL','removeLists','getBlackLists','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','end','offset','undefined','limit','Content-Range','apply','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','map','value','includes','find','type','name','error','send','VoiceQueue','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','count','includeAll','include','rows','show','params','rawAttributes','options','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','user','findOne','CmHopper','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x7f75,0xfa));var _0x57f7=function(_0x26b761,_0x53eb4e){_0x26b761=_0x26b761-0x0;var _0x3d3486=_0x7f75[_0x26b761];return _0x3d3486;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x57f7('0x0'));var zipdir=require(_0x57f7('0x1'));var jsonpatch=require(_0x57f7('0x2'));var rp=require(_0x57f7('0x3'));var moment=require(_0x57f7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x57f7('0x5'));var util=require(_0x57f7('0x6'));var path=require('path');var sox=require(_0x57f7('0x7'));var csv=require(_0x57f7('0x8'));var ejs=require(_0x57f7('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x57f7('0xa'));var squel=require(_0x57f7('0xb'));var crypto=require(_0x57f7('0xc'));var jsforce=require(_0x57f7('0xd'));var deskjs=require(_0x57f7('0xe'));var toCsv=require(_0x57f7('0x8'));var querystring=require(_0x57f7('0xf'));var Papa=require(_0x57f7('0x10'));var Redis=require(_0x57f7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x57f7('0x12'));var as=require(_0x57f7('0x13'));var hardwareService=require(_0x57f7('0x14'));var logger=require(_0x57f7('0x15'))('api');var utils=require(_0x57f7('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x57f7('0x17'));var db=require('../../mysqldb')['db'];config[_0x57f7('0x18')]=_[_0x57f7('0x19')](config[_0x57f7('0x18')],{'host':_0x57f7('0x1a'),'port':0x18eb});var socket=require(_0x57f7('0x1b'))(new Redis(config[_0x57f7('0x18')]));require(_0x57f7('0x1c'))['register'](socket);function respondWithStatusCode(_0x2f7d12,_0x326bad){_0x326bad=_0x326bad||0xcc;return function(_0x5176d7){if(_0x5176d7){return _0x2f7d12[_0x57f7('0x1d')](_0x326bad);}return _0x2f7d12[_0x57f7('0x1e')](_0x326bad)[_0x57f7('0x1f')]();};}function respondWithResult(_0x4b71a5,_0x3963b9){_0x3963b9=_0x3963b9||0xc8;return function(_0x4a2e6b){if(_0x4a2e6b){return _0x4b71a5[_0x57f7('0x1e')](_0x3963b9)['json'](_0x4a2e6b);}};}function respondWithFilteredResult(_0x4186f8,_0x15e7dc){return function(_0x54013b){if(_0x54013b){var _0x4094f4=typeof _0x15e7dc[_0x57f7('0x20')]===_0x57f7('0x21')&&typeof _0x15e7dc[_0x57f7('0x22')]==='undefined';var _0x3aa6bd=_0x54013b['count'];var _0x418af2=_0x4094f4?0x0:_0x15e7dc[_0x57f7('0x20')];var _0x37d177=_0x4094f4?_0x54013b['count']:_0x15e7dc['offset']+_0x15e7dc[_0x57f7('0x22')];var _0x462cb3;if(_0x37d177>=_0x3aa6bd){_0x37d177=_0x3aa6bd;_0x462cb3=0xc8;}else{_0x462cb3=0xce;}_0x4186f8[_0x57f7('0x1e')](_0x462cb3);return _0x4186f8['set'](_0x57f7('0x23'),_0x418af2+'-'+_0x37d177+'/'+_0x3aa6bd)['json'](_0x54013b);}return null;};}function patchUpdates(_0x2843f5){return function(_0x3e206d){try{jsonpatch[_0x57f7('0x24')](_0x3e206d,_0x2843f5,!![]);}catch(_0x685211){return BPromise[_0x57f7('0x25')](_0x685211);}return _0x3e206d[_0x57f7('0x26')]();};}function saveUpdates(_0x1b93b0,_0x4db16d){return function(_0x5860a8){if(_0x5860a8){return _0x5860a8[_0x57f7('0x27')](_0x1b93b0)[_0x57f7('0x28')](function(_0x28e4c6){return _0x28e4c6;});}return null;};}function removeEntity(_0x4e42ae,_0x3712ae){return function(_0x2c2c5f){if(_0x2c2c5f){return _0x2c2c5f[_0x57f7('0x29')]()[_0x57f7('0x28')](function(){var _0x37b9c6=_0x2c2c5f[_0x57f7('0x2a')]({'plain':!![]});var _0x5b0503=[{'name':_0x57f7('0x2b'),'value':_0x57f7('0x2c'),'ignore':![]},{'name':_0x57f7('0x2d'),'value':_0x57f7('0x2e'),'ignore':![]}];var _0x47327a=_(_0x5b0503)[_0x57f7('0x2f')]('ignore')[_0x57f7('0x30')](_0x57f7('0x31'))['value']();if(_[_0x57f7('0x32')](_0x47327a,_0x37b9c6['type'])){return;}var _0x4a7b66=_[_0x57f7('0x33')](_0x5b0503,['value',_0x37b9c6[_0x57f7('0x34')]])[_0x57f7('0x35')];return db['UserProfileResource'][_0x57f7('0x29')]({'where':{'type':_0x4a7b66,'resourceId':_0x37b9c6['id']}})[_0x57f7('0x28')](function(){return _0x2c2c5f;});})['then'](function(){_0x4e42ae[_0x57f7('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3663d7,_0x28b970){return function(_0x3ee284){if(!_0x3ee284){_0x3663d7[_0x57f7('0x1d')](0x194);}return _0x3ee284;};}function handleError(_0x32ef6c,_0x36e75d){_0x36e75d=_0x36e75d||0x1f4;return function(_0x516e15){logger[_0x57f7('0x36')](_0x516e15['stack']);if(_0x516e15['name']){delete _0x516e15[_0x57f7('0x35')];}_0x32ef6c['status'](_0x36e75d)[_0x57f7('0x37')](_0x516e15);};}exports['index']=function(_0x349d5a,_0x8b7420){var _0x19e722={},_0x27f6eb={},_0x226b91={'count':0x0,'rows':[]};var _0x5b0f16=_[_0x57f7('0x30')](db[_0x57f7('0x38')]['rawAttributes'],function(_0x1f228b){return{'name':_0x1f228b[_0x57f7('0x39')],'type':_0x1f228b[_0x57f7('0x34')][_0x57f7('0x3a')]};});_0x27f6eb['model']=_['map'](_0x5b0f16,_0x57f7('0x35'));_0x27f6eb[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x349d5a[_0x57f7('0x3b')]);_0x27f6eb[_0x57f7('0x3d')]=_[_0x57f7('0x3e')](_0x27f6eb[_0x57f7('0x3f')],_0x27f6eb[_0x57f7('0x3b')]);_0x19e722[_0x57f7('0x40')]=_[_0x57f7('0x3e')](_0x27f6eb[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x349d5a[_0x57f7('0x3b')]['fields']));_0x19e722[_0x57f7('0x40')]=_0x19e722[_0x57f7('0x40')][_0x57f7('0x42')]?_0x19e722[_0x57f7('0x40')]:_0x27f6eb['model'];if(!_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x43')](_0x57f7('0x44'))){_0x19e722['limit']=qs[_0x57f7('0x22')](_0x349d5a['query']['limit']);_0x19e722[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x20')]);}_0x19e722[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x46')]);_0x19e722[_0x57f7('0x47')]=qs['filters'](_[_0x57f7('0x48')](_0x349d5a[_0x57f7('0x3b')],_0x27f6eb['filters']),_0x5b0f16);if(_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x19e722[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x19e722['where'],{'$or':_[_0x57f7('0x30')](_0x5b0f16,function(_0x5d387c){if(_0x5d387c['type']!==_0x57f7('0x4a')){var _0x1c6c21={};_0x1c6c21[_0x5d387c[_0x57f7('0x35')]]={'$like':'%'+_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x1c6c21;}})});}_0x19e722=_[_0x57f7('0x49')]({},_0x19e722,_0x349d5a['options']);var _0x303aeb={'where':_0x19e722[_0x57f7('0x47')]};return db[_0x57f7('0x38')][_0x57f7('0x4b')](_0x303aeb)[_0x57f7('0x28')](function(_0x4f4f6e){_0x226b91['count']=_0x4f4f6e;if(_0x349d5a[_0x57f7('0x3b')][_0x57f7('0x4c')]){_0x19e722[_0x57f7('0x4d')]=[{'all':!![]}];}return db[_0x57f7('0x38')]['findAll'](_0x19e722);})[_0x57f7('0x28')](function(_0xd1857c){_0x226b91[_0x57f7('0x4e')]=_0xd1857c;return _0x226b91;})[_0x57f7('0x28')](respondWithFilteredResult(_0x8b7420,_0x19e722))['catch'](handleError(_0x8b7420,null));};exports[_0x57f7('0x4f')]=function(_0x133472,_0x11bf73){var _0x34ccc8={'raw':![],'where':{'id':_0x133472[_0x57f7('0x50')]['id']}},_0xf27240={};_0xf27240['model']=_[_0x57f7('0x3c')](db[_0x57f7('0x38')][_0x57f7('0x51')]);_0xf27240['query']=_[_0x57f7('0x3c')](_0x133472[_0x57f7('0x3b')]);_0xf27240['filters']=_[_0x57f7('0x3e')](_0xf27240[_0x57f7('0x3f')],_0xf27240[_0x57f7('0x3b')]);_0x34ccc8[_0x57f7('0x40')]=_['intersection'](_0xf27240[_0x57f7('0x3f')],qs['fields'](_0x133472[_0x57f7('0x3b')][_0x57f7('0x41')]));_0x34ccc8['attributes']=_0x34ccc8[_0x57f7('0x40')][_0x57f7('0x42')]?_0x34ccc8[_0x57f7('0x40')]:_0xf27240[_0x57f7('0x3f')];if(_0x133472['query'][_0x57f7('0x4c')]){_0x34ccc8['include']=[{'all':!![]}];}_0x34ccc8=_[_0x57f7('0x49')]({},_0x34ccc8,_0x133472[_0x57f7('0x52')]);return db[_0x57f7('0x38')]['find'](_0x34ccc8)[_0x57f7('0x28')](handleEntityNotFound(_0x11bf73,null))[_0x57f7('0x28')](respondWithResult(_0x11bf73,null))[_0x57f7('0x53')](handleError(_0x11bf73,null));};exports[_0x57f7('0x54')]=function(_0x2e317b,_0xd75f88){return db[_0x57f7('0x38')][_0x57f7('0x54')](_0x2e317b[_0x57f7('0x55')],{})['then'](function(_0x15ca77){var _0x4ece2a=_0x2e317b['user'][_0x57f7('0x2a')]({'plain':!![]});if(!_0x4ece2a)throw new Error(_0x57f7('0x56'));if(_0x4ece2a[_0x57f7('0x57')]==='user'){var _0x36d550=_0x15ca77['get']({'plain':!![]});var _0x2284af=[{'name':_0x57f7('0x2b'),'value':_0x57f7('0x2c')},{'name':_0x57f7('0x2d'),'value':_0x57f7('0x2e')}];var _0x49fee3=_[_0x57f7('0x33')](_0x2284af,[_0x57f7('0x31'),_0x36d550[_0x57f7('0x34')]])['name'];return db[_0x57f7('0x58')]['find']({'where':{'name':_0x49fee3,'userProfileId':_0x4ece2a[_0x57f7('0x59')]},'raw':!![]})[_0x57f7('0x28')](function(_0x100397){if(_0x100397&&_0x100397['autoAssociation']===0x0){return db[_0x57f7('0x5a')][_0x57f7('0x54')]({'name':_0x36d550[_0x57f7('0x35')],'resourceId':_0x36d550['id'],'type':_0x100397[_0x57f7('0x35')],'sectionId':_0x100397['id']},{})[_0x57f7('0x28')](function(){return _0x15ca77;});}else{return _0x15ca77;}})[_0x57f7('0x53')](function(_0xa87796){logger['error'](_0x57f7('0x5b'),_0xa87796);throw _0xa87796;});}return _0x15ca77;})[_0x57f7('0x28')](respondWithResult(_0xd75f88,0xc9))[_0x57f7('0x53')](handleError(_0xd75f88,null));};exports[_0x57f7('0x5c')]=function(_0x4e9595,_0x13b910){var _0x2d92b1={'where':{'id':_0x4e9595[_0x57f7('0x50')]['id']}},_0x375f56={};_0x375f56[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x38')][_0x57f7('0x51')]);_0x2d92b1['attributes']=_[_0x57f7('0x3e')](_0x375f56[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x4e9595[_0x57f7('0x3b')]['fields']));_0x2d92b1[_0x57f7('0x40')]=_0x2d92b1[_0x57f7('0x40')][_0x57f7('0x42')]?_0x2d92b1['attributes']:_0x375f56[_0x57f7('0x3f')];if(_0x4e9595[_0x57f7('0x3b')][_0x57f7('0x4c')]){_0x2d92b1[_0x57f7('0x4d')]=[{'all':!![]}];}_0x2d92b1=_[_0x57f7('0x49')]({},_0x2d92b1,_0x4e9595[_0x57f7('0x52')]);return db[_0x57f7('0x38')]['find'](_0x2d92b1)[_0x57f7('0x28')](handleEntityNotFound(_0x13b910,null))[_0x57f7('0x28')](function(_0x245b21){if(_0x245b21){var _0x1b0eea=_0x245b21[_0x57f7('0x2a')]({'plain':!![]});_0x1b0eea=qs[_0x57f7('0x5d')](_0x1b0eea,['id',_0x57f7('0x5e'),_0x57f7('0x5f')]);_0x4e9595[_0x57f7('0x55')]=_[_0x57f7('0x5d')](_0x4e9595[_0x57f7('0x55')],['id',_0x57f7('0x5e'),_0x57f7('0x5f')]);return db[_0x57f7('0x38')][_0x57f7('0x54')](_['merge'](_0x1b0eea,_0x4e9595['body']),{'include':_0x4e9595['query'][_0x57f7('0x4c')]?[{'all':!![]}]:undefined})[_0x57f7('0x28')](function(_0x81e406){var _0x35bb5e=_0x4e9595[_0x57f7('0x60')][_0x57f7('0x2a')]({'plain':!![]});if(!_0x35bb5e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x35bb5e[_0x57f7('0x57')]==='user'){var _0x4f851c=_0x81e406[_0x57f7('0x2a')]({'plain':!![]});var _0x302e53=[{'name':_0x57f7('0x2b'),'value':_0x57f7('0x2c')},{'name':_0x57f7('0x2d'),'value':_0x57f7('0x2e')}];var _0xcdafda=_[_0x57f7('0x33')](_0x302e53,[_0x57f7('0x31'),_0x4f851c['type']])[_0x57f7('0x35')];return db[_0x57f7('0x58')]['find']({'where':{'name':_0xcdafda,'userProfileId':_0x35bb5e[_0x57f7('0x59')]},'raw':!![]})[_0x57f7('0x28')](function(_0x414601){if(_0x414601&&_0x414601['autoAssociation']===0x0){return db[_0x57f7('0x5a')]['create']({'name':_0x4f851c['name'],'resourceId':_0x4f851c['id'],'type':_0x414601['name'],'sectionId':_0x414601['id']},{})['then'](function(){return _0x81e406;});}else{return _0x81e406;}})['catch'](function(_0x73ae0f){logger[_0x57f7('0x36')](_0x57f7('0x5b'),_0x73ae0f);throw _0x73ae0f;});}return _0x81e406;});}})['then'](respondWithResult(_0x13b910,0xc9))[_0x57f7('0x53')](handleError(_0x13b910,null));};exports[_0x57f7('0x27')]=function(_0x1fb27a,_0x5d6433){if(_0x1fb27a[_0x57f7('0x55')]['id']){delete _0x1fb27a[_0x57f7('0x55')]['id'];}return db[_0x57f7('0x38')]['find']({'where':{'id':_0x1fb27a[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x5d6433,null))['then'](saveUpdates(_0x1fb27a[_0x57f7('0x55')],null))[_0x57f7('0x28')](respondWithResult(_0x5d6433,null))[_0x57f7('0x53')](handleError(_0x5d6433,null));};exports[_0x57f7('0x29')]=function(_0xa0f46d,_0x22e8a6){return db['VoiceQueue'][_0x57f7('0x33')]({'where':{'id':_0xa0f46d['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x22e8a6,null))[_0x57f7('0x28')](removeEntity(_0x22e8a6,null))[_0x57f7('0x53')](handleError(_0x22e8a6,null));};exports['getHoppers']=function(_0x54e3c4,_0x3913c6,_0x154970){var _0x339192={'raw':![],'where':{}};var _0x39f394={};var _0x16624f={'count':0x0,'rows':[]};return db[_0x57f7('0x38')][_0x57f7('0x61')]({'where':{'id':_0x54e3c4[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x3913c6,null))[_0x57f7('0x28')](function(_0x25b34b){if(_0x25b34b){_0x39f394[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x62')]['rawAttributes']);_0x39f394[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x54e3c4[_0x57f7('0x3b')]);_0x39f394['filters']=_['intersection'](_0x39f394[_0x57f7('0x3f')],_0x39f394[_0x57f7('0x3b')]);_0x339192[_0x57f7('0x40')]=_['intersection'](_0x39f394[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x41')]));_0x339192[_0x57f7('0x40')]=_0x339192[_0x57f7('0x40')]['length']?_0x339192[_0x57f7('0x40')]:_0x39f394[_0x57f7('0x3f')];if(!_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x43')](_0x57f7('0x44'))){_0x339192[_0x57f7('0x22')]=qs['limit'](_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x339192[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x20')]);}_0x339192[_0x57f7('0x45')]=qs['sort'](_0x54e3c4['query'][_0x57f7('0x46')]);_0x339192[_0x57f7('0x47')]=qs[_0x57f7('0x3d')](_[_0x57f7('0x48')](_0x54e3c4[_0x57f7('0x3b')],_0x39f394['filters']));_0x339192[_0x57f7('0x47')][_0x57f7('0x63')]=_0x25b34b['id'];if(_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x339192['where']=_['merge'](_0x339192[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x339192[_0x57f7('0x40')],function(_0x2733cd){var _0x3bf03c={};_0x3bf03c[_0x2733cd]={'$like':'%'+_0x54e3c4['query'][_0x57f7('0x2f')]+'%'};return _0x3bf03c;})});}_0x339192=_['merge']({},_0x339192,_0x54e3c4[_0x57f7('0x52')]);return db[_0x57f7('0x62')]['count']({'where':_0x339192[_0x57f7('0x47')]})[_0x57f7('0x28')](function(_0x3a99c7){_0x16624f['count']=_0x3a99c7;if(_0x54e3c4[_0x57f7('0x3b')][_0x57f7('0x4c')]){_0x339192[_0x57f7('0x4d')]=[{'all':!![]}];}return db['CmHopper'][_0x57f7('0x64')](_0x339192);})[_0x57f7('0x28')](function(_0x42b555){_0x16624f[_0x57f7('0x4e')]=_0x42b555;return _0x16624f;});}})[_0x57f7('0x28')](respondWithFilteredResult(_0x3913c6,_0x339192))[_0x57f7('0x53')](handleError(_0x3913c6,null));};exports[_0x57f7('0x65')]=function(_0x582f0f,_0x27a718,_0x4940fe){var _0x48a2c8={'raw':!![],'where':{}};var _0x36ba93={};var _0x7b3419={'count':0x0,'rows':[]};return db[_0x57f7('0x38')]['findOne']({'where':{'id':_0x582f0f[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x27a718,null))['then'](function(_0x51cb33){if(_0x51cb33){_0x36ba93[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x66')]['rawAttributes']);_0x36ba93[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x582f0f[_0x57f7('0x3b')]);_0x36ba93[_0x57f7('0x3d')]=_['intersection'](_0x36ba93[_0x57f7('0x3f')],_0x36ba93[_0x57f7('0x3b')]);_0x48a2c8[_0x57f7('0x40')]=_[_0x57f7('0x3e')](_0x36ba93[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x582f0f['query'][_0x57f7('0x41')]));_0x48a2c8[_0x57f7('0x40')]=_0x48a2c8['attributes'][_0x57f7('0x42')]?_0x48a2c8[_0x57f7('0x40')]:_0x36ba93['model'];if(!_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x43')](_0x57f7('0x44'))){_0x48a2c8['limit']=qs[_0x57f7('0x22')](_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x48a2c8[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x20')]);}_0x48a2c8['order']=qs[_0x57f7('0x46')](_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x46')]);_0x48a2c8['where']=qs['filters'](_[_0x57f7('0x48')](_0x582f0f['query'],_0x36ba93[_0x57f7('0x3d')]));_0x48a2c8[_0x57f7('0x47')][_0x57f7('0x63')]=_0x51cb33['id'];if(_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x48a2c8[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x48a2c8['where'],{'$or':_[_0x57f7('0x30')](_0x48a2c8[_0x57f7('0x40')],function(_0x5ea37f){var _0x2f2c60={};_0x2f2c60[_0x5ea37f]={'$like':'%'+_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x2f2c60;})});}_0x48a2c8=_['merge']({},_0x48a2c8,_0x582f0f['options']);return db[_0x57f7('0x66')][_0x57f7('0x4b')]({'where':_0x48a2c8[_0x57f7('0x47')]})['then'](function(_0x5cb272){_0x7b3419[_0x57f7('0x4b')]=_0x5cb272;if(_0x582f0f[_0x57f7('0x3b')][_0x57f7('0x4c')]){_0x48a2c8[_0x57f7('0x4d')]=[{'all':!![]}];}return db[_0x57f7('0x66')]['findAll'](_0x48a2c8);})['then'](function(_0x58a1ce){_0x7b3419[_0x57f7('0x4e')]=_0x58a1ce;return _0x7b3419;});}})[_0x57f7('0x28')](respondWithFilteredResult(_0x27a718,_0x48a2c8))[_0x57f7('0x53')](handleError(_0x27a718,null));};exports[_0x57f7('0x67')]=function(_0x11f03b,_0x576ba1,_0x4f2b18){var _0x3a9fc={'raw':!![],'where':{}};var _0x329a26={};var _0x1e2aa9={'count':0x0,'rows':[]};return db[_0x57f7('0x38')][_0x57f7('0x61')]({'where':{'id':_0x11f03b[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x576ba1,null))[_0x57f7('0x28')](function(_0x1ef7f4){if(_0x1ef7f4){_0x329a26[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x68')][_0x57f7('0x51')]);_0x329a26[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x11f03b[_0x57f7('0x3b')]);_0x329a26['filters']=_['intersection'](_0x329a26[_0x57f7('0x3f')],_0x329a26['query']);_0x3a9fc[_0x57f7('0x40')]=_['intersection'](_0x329a26[_0x57f7('0x3f')],qs['fields'](_0x11f03b['query']['fields']));_0x3a9fc['attributes']=_0x3a9fc['attributes'][_0x57f7('0x42')]?_0x3a9fc['attributes']:_0x329a26['model'];if(!_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x43')]('nolimit')){_0x3a9fc[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x3a9fc[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x11f03b[_0x57f7('0x3b')]['offset']);}_0x3a9fc[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x46')]);_0x3a9fc[_0x57f7('0x47')]=qs[_0x57f7('0x3d')](_[_0x57f7('0x48')](_0x11f03b['query'],_0x329a26[_0x57f7('0x3d')]));_0x3a9fc[_0x57f7('0x47')][_0x57f7('0x63')]=_0x1ef7f4['id'];if(_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x3a9fc[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x3a9fc[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x3a9fc[_0x57f7('0x40')],function(_0x583bcc){var _0x383c5b={};_0x383c5b[_0x583bcc]={'$like':'%'+_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x383c5b;})});}_0x3a9fc=_['merge']({},_0x3a9fc,_0x11f03b[_0x57f7('0x52')]);return db['CmHopperFinal'][_0x57f7('0x4b')]({'where':_0x3a9fc['where']})[_0x57f7('0x28')](function(_0x149571){_0x1e2aa9[_0x57f7('0x4b')]=_0x149571;if(_0x11f03b[_0x57f7('0x3b')][_0x57f7('0x4c')]){_0x3a9fc['include']=[{'all':!![]}];}return db[_0x57f7('0x68')][_0x57f7('0x64')](_0x3a9fc);})[_0x57f7('0x28')](function(_0x2e8ac1){_0x1e2aa9[_0x57f7('0x4e')]=_0x2e8ac1;return _0x1e2aa9;});}})[_0x57f7('0x28')](respondWithFilteredResult(_0x576ba1,_0x3a9fc))['catch'](handleError(_0x576ba1,null));};exports[_0x57f7('0x69')]=function(_0x30142c,_0xd9d7d3,_0x40ebf6){var _0x227c1f={'raw':!![],'where':{}};var _0x216574={};var _0xbacd1a={'count':0x0,'rows':[]};return db[_0x57f7('0x38')][_0x57f7('0x61')]({'where':{'id':_0x30142c['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0xd9d7d3,null))[_0x57f7('0x28')](function(_0x15301e){if(_0x15301e){_0x216574[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x6a')][_0x57f7('0x51')]);_0x216574[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x30142c[_0x57f7('0x3b')]);_0x216574[_0x57f7('0x3d')]=_['intersection'](_0x216574['model'],_0x216574[_0x57f7('0x3b')]);_0x227c1f['attributes']=_[_0x57f7('0x3e')](_0x216574['model'],qs[_0x57f7('0x41')](_0x30142c[_0x57f7('0x3b')][_0x57f7('0x41')]));_0x227c1f[_0x57f7('0x40')]=_0x227c1f[_0x57f7('0x40')][_0x57f7('0x42')]?_0x227c1f[_0x57f7('0x40')]:_0x216574[_0x57f7('0x3f')];if(!_0x30142c[_0x57f7('0x3b')]['hasOwnProperty'](_0x57f7('0x44'))){_0x227c1f[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0x30142c[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x227c1f[_0x57f7('0x20')]=qs['offset'](_0x30142c['query'][_0x57f7('0x20')]);}_0x227c1f[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x30142c[_0x57f7('0x3b')]['sort']);_0x227c1f[_0x57f7('0x47')]=qs['filters'](_['pick'](_0x30142c[_0x57f7('0x3b')],_0x216574[_0x57f7('0x3d')]));_0x227c1f[_0x57f7('0x47')]['VoiceQueueId']=_0x15301e['id'];if(_0x30142c[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x227c1f[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x227c1f[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x227c1f['attributes'],function(_0x22b44d){var _0x242f4c={};_0x242f4c[_0x22b44d]={'$like':'%'+_0x30142c['query'][_0x57f7('0x2f')]+'%'};return _0x242f4c;})});}_0x227c1f=_['merge']({},_0x227c1f,_0x30142c[_0x57f7('0x52')]);return db[_0x57f7('0x6a')][_0x57f7('0x4b')]({'where':_0x227c1f['where']})[_0x57f7('0x28')](function(_0x256154){_0xbacd1a[_0x57f7('0x4b')]=_0x256154;if(_0x30142c['query']['includeAll']){_0x227c1f['include']=[{'all':!![]}];}return db[_0x57f7('0x6a')][_0x57f7('0x64')](_0x227c1f);})[_0x57f7('0x28')](function(_0x42f215){_0xbacd1a[_0x57f7('0x4e')]=_0x42f215;return _0xbacd1a;});}})[_0x57f7('0x28')](respondWithFilteredResult(_0xd9d7d3,_0x227c1f))['catch'](handleError(_0xd9d7d3,null));};exports['getTeams']=function(_0x397eb5,_0x3deafe,_0x267a4d){var _0x10e42e={};var _0x212cb3={};var _0x4dda75;var _0x466af9;return db[_0x57f7('0x38')]['findOne']({'where':{'id':_0x397eb5[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x3deafe,null))['then'](function(_0x3fd20d){if(_0x3fd20d){_0x4dda75=_0x3fd20d;_0x212cb3['model']=_[_0x57f7('0x3c')](db['Team'][_0x57f7('0x51')]);_0x212cb3['query']=_[_0x57f7('0x3c')](_0x397eb5['query']);_0x212cb3['filters']=_[_0x57f7('0x3e')](_0x212cb3['model'],_0x212cb3[_0x57f7('0x3b')]);_0x10e42e[_0x57f7('0x40')]=_[_0x57f7('0x3e')](_0x212cb3[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x397eb5['query'][_0x57f7('0x41')]));_0x10e42e[_0x57f7('0x40')]=_0x10e42e[_0x57f7('0x40')]['length']?_0x10e42e[_0x57f7('0x40')]:_0x212cb3[_0x57f7('0x3f')];_0x10e42e[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x397eb5[_0x57f7('0x3b')]['sort']);_0x10e42e[_0x57f7('0x47')]=qs[_0x57f7('0x3d')](_[_0x57f7('0x48')](_0x397eb5[_0x57f7('0x3b')],_0x212cb3[_0x57f7('0x3d')]));if(_0x397eb5[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x10e42e[_0x57f7('0x47')]=_['merge'](_0x10e42e[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x10e42e['attributes'],function(_0x4355cb){var _0x31f091={};_0x31f091[_0x4355cb]={'$like':'%'+_0x397eb5['query'][_0x57f7('0x2f')]+'%'};return _0x31f091;})});}_0x10e42e=_[_0x57f7('0x49')]({},_0x10e42e,_0x397eb5[_0x57f7('0x52')]);return _0x4dda75['getTeams'](_0x10e42e);}})[_0x57f7('0x28')](function(_0x234af1){if(_0x234af1){_0x466af9=_0x234af1['length'];if(!_0x397eb5[_0x57f7('0x3b')]['hasOwnProperty'](_0x57f7('0x44'))){_0x10e42e[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0x397eb5[_0x57f7('0x3b')]['limit']);_0x10e42e[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x397eb5[_0x57f7('0x3b')][_0x57f7('0x20')]);}return _0x4dda75[_0x57f7('0x6b')](_0x10e42e);}})[_0x57f7('0x28')](function(_0x79cce8){if(_0x79cce8){return _0x79cce8?{'count':_0x466af9,'rows':_0x79cce8}:null;}})[_0x57f7('0x28')](respondWithResult(_0x3deafe,null))[_0x57f7('0x53')](handleError(_0x3deafe,null));};exports[_0x57f7('0x6c')]=function(_0x3cf59e,_0x2a853e,_0x1a23b7){var _0x4b6ec1=_0x3cf59e[_0x57f7('0x55')]['teams'];var _0x3a453c=_[_0x57f7('0x30')](_0x4b6ec1,'id');return db[_0x57f7('0x6d')]['findAll']({'where':{'id':_0x3a453c},'attributes':['id'],'include':[{'model':db[_0x57f7('0x6e')],'as':_0x57f7('0x6f'),'attributes':['id',_0x57f7('0x35'),_0x57f7('0x70'),'voicePause',_0x57f7('0x71')],'raw':!![]}]})[_0x57f7('0x28')](function(_0x9f335f){if(_0x9f335f){var _0x3c0774=_['flatMap'](_0x9f335f,function(_0x536b92){var _0x336f0a=_0x536b92[_0x57f7('0x2a')]({'plain':!![]});_0x336f0a['Agents']['forEach'](function(_0xc16a6e){_0xc16a6e[_0x57f7('0x72')]=_[_0x57f7('0x33')](_0x4b6ec1,{'id':_0x336f0a['id']})[_0x57f7('0x72')];});return _0x336f0a[_0x57f7('0x6f')];});return db[_0x57f7('0x38')]['find']({'where':{'id':_0x3cf59e['params']['id']}})[_0x57f7('0x28')](function(_0x253fb0){return db[_0x57f7('0x73')][_0x57f7('0x74')](function(_0x3ea7a9){return _0x253fb0[_0x57f7('0x6c')](_0x3a453c,{'transaction':_0x3ea7a9})[_0x57f7('0x28')](function(){return BPromise['each'](_0x4b6ec1,function(_0x293e2e){return db[_0x57f7('0x75')]['upsert']({'TeamId':_0x293e2e['id'],'VoiceQueueId':_0x3cf59e[_0x57f7('0x50')]['id'],'penalty':_0x293e2e[_0x57f7('0x72')]},{'transaction':_0x3ea7a9});});})['then'](function(){return BPromise[_0x57f7('0x76')](_0x3c0774,function(_0x5c203e){return db[_0x57f7('0x77')][_0x57f7('0x78')]({'where':{'UserId':_0x5c203e['id'],'VoiceQueueId':_0x3cf59e[_0x57f7('0x50')]['id']},'defaults':{'penalty':_0x5c203e[_0x57f7('0x72')]},'transaction':_0x3ea7a9});});})[_0x57f7('0x28')](function(){return BPromise[_0x57f7('0x76')](_[_0x57f7('0x2f')](_0x3c0774,{'online':!![]}),function(_0x548273){return db[_0x57f7('0x79')][_0x57f7('0x7a')]({'membername':_0x548273[_0x57f7('0x35')],'UserId':_0x548273['id'],'queue_name':_0x253fb0['name'],'VoiceQueueId':_0x253fb0['id'],'interface':_[_0x57f7('0x7b')](_0x548273[_0x57f7('0x71')])?util[_0x57f7('0x7c')](_0x57f7('0x7d'),_0x548273[_0x57f7('0x35')]):_0x548273[_0x57f7('0x71')],'paused':_0x548273[_0x57f7('0x7e')]||![],'penalty':_0x548273[_0x57f7('0x72')]},{'transaction':_0x3ea7a9});});})['then'](function(){_0x3c0774[_0x57f7('0x7f')](function(_0x30cd3d){socket[_0x57f7('0x80')](_0x57f7('0x81'),{'UserId':_0x30cd3d['id'],'VoiceQueueId':_0x253fb0['id']});});});});});}})[_0x57f7('0x28')](respondWithStatusCode(_0x2a853e,null))[_0x57f7('0x53')](handleError(_0x2a853e,null));};exports[_0x57f7('0x82')]=function(_0x3118d7,_0x4a72ec,_0x52f134){return db[_0x57f7('0x6d')][_0x57f7('0x64')]({'where':{'id':_0x3118d7[_0x57f7('0x3b')][_0x57f7('0x83')]},'attributes':['id'],'include':[{'model':db[_0x57f7('0x6e')],'as':_0x57f7('0x6f'),'attributes':['id'],'raw':!![]}]})[_0x57f7('0x28')](handleEntityNotFound(_0x4a72ec,null))[_0x57f7('0x28')](function(_0x3bdeff){var _0x39c7c3=_['map'](_0x3bdeff,'id');var _0xd3cb8c=[];var _0x110c3e=[];var _0x54c083=squel['select']();_0x54c083[_0x57f7('0x84')]('tq.TeamId')[_0x57f7('0x85')]('team_has_voice_queues','tq')['join']('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x57f7('0x47')](_0x57f7('0x86'),_0x3118d7[_0x57f7('0x50')]['id']);for(var _0x1e7118=0x0;_0x1e7118<_0x3bdeff[_0x57f7('0x42')];_0x1e7118+=0x1){let _0x3ab560=_0x3bdeff[_0x1e7118];for(var _0x500a5e=0x0;_0x500a5e<_0x3ab560[_0x57f7('0x6f')]['length'];_0x500a5e+=0x1){let _0x16b5ff=_0x3ab560[_0x57f7('0x6f')][_0x500a5e];var _0xf8821c=_0x54c083[_0x57f7('0x5c')]();_0xf8821c[_0x57f7('0x47')](_0x57f7('0x87'),_0x16b5ff['id']);_0x110c3e[_0x57f7('0x88')](db[_0x57f7('0x73')][_0x57f7('0x3b')](_0xf8821c[_0x57f7('0x89')](),{'type':db[_0x57f7('0x73')][_0x57f7('0x8a')][_0x57f7('0x8b')]})[_0x57f7('0x28')](function(_0x4f1e3d){if(_0x4f1e3d[_0x57f7('0x42')]===0x1){return _0x16b5ff['id'];}else{var _0x4fd207=_[_0x57f7('0x8c')](_[_0x57f7('0x30')](_0x4f1e3d,_0x57f7('0x8d')),function(_0x5f439d){return _[_0x57f7('0x32')](_0x39c7c3,_0x5f439d);});if(_0x4fd207){return _0x16b5ff['id'];}}}));}}return BPromise[_0x57f7('0x8e')](_0x110c3e)[_0x57f7('0x28')](function(_0x4dc8ff){_0xd3cb8c=_(_0xd3cb8c)['union'](_0x4dc8ff)[_0x57f7('0x8f')]()[_0x57f7('0x31')]();return db[_0x57f7('0x38')][_0x57f7('0x33')]({'where':{'id':_0x3118d7[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](function(_0x121c84){return db['sequelize'][_0x57f7('0x74')](function(_0x20ca60){return _0x121c84[_0x57f7('0x82')](_0x3118d7[_0x57f7('0x3b')][_0x57f7('0x83')],{'transaction':_0x20ca60})[_0x57f7('0x28')](function(){if(!_[_0x57f7('0x90')](_0xd3cb8c)){return _0x121c84[_0x57f7('0x91')](_0xd3cb8c,{'transaction':_0x20ca60})[_0x57f7('0x28')](function(){return db[_0x57f7('0x79')][_0x57f7('0x29')]({'where':{'VoiceQueueId':_0x3118d7[_0x57f7('0x50')]['id'],'UserId':_0xd3cb8c},'transaction':_0x20ca60});});}})['then'](function(){_0xd3cb8c['forEach'](function(_0x1fcb23){socket[_0x57f7('0x80')]('userVoiceQueue:remove',{'UserId':_0x1fcb23,'VoiceQueueId':_0x121c84['id']});});});});});});})[_0x57f7('0x28')](respondWithStatusCode(_0x4a72ec,null))[_0x57f7('0x53')](handleError(_0x4a72ec,null));};exports['addAgents']=function(_0x1fa58a,_0x13aea6,_0x136974){var _0x27735e,_0x466f3f;return db['VoiceQueue'][_0x57f7('0x33')]({'where':{'id':_0x1fa58a[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x13aea6,null))[_0x57f7('0x28')](function(_0x17c405){if(_0x17c405){_0x466f3f=_0x17c405;return _0x17c405['addAgents'](_0x1fa58a[_0x57f7('0x55')][_0x57f7('0x83')],_[_0x57f7('0x5d')](_0x1fa58a[_0x57f7('0x55')],[_0x57f7('0x83'),'id'])||{})[_0x57f7('0x92')](function(_0x4102c7){for(var _0x43d7b5=0x0;_0x43d7b5<_0x1fa58a[_0x57f7('0x55')][_0x57f7('0x83')][_0x57f7('0x42')];_0x43d7b5+=0x1){socket['emit']('userVoiceQueue:save',{'UserId':Number(_0x1fa58a[_0x57f7('0x55')][_0x57f7('0x83')][_0x43d7b5]),'VoiceQueueId':Number(_0x1fa58a[_0x57f7('0x50')]['id'])});}return _0x4102c7;});}})['then'](function(_0x5e2d2e){_0x27735e=_0x5e2d2e||[];if(_0x466f3f){return db[_0x57f7('0x6e')][_0x57f7('0x64')]({'where':{'id':_0x1fa58a['body'][_0x57f7('0x83')]},'attributes':['id',_0x57f7('0x35'),_0x57f7('0x70'),'voicePause',_0x57f7('0x71')],'raw':!![]});}})[_0x57f7('0x28')](function(_0x5be624){if(!_[_0x57f7('0x90')](_0x5be624)){var _0x48d029=[];for(var _0x1828f4=0x0;_0x1828f4<_0x5be624['length'];_0x1828f4++){if(_0x5be624[_0x1828f4][_0x57f7('0x70')]){_0x48d029[_0x57f7('0x88')](db[_0x57f7('0x79')][_0x57f7('0x7a')]({'membername':_0x5be624[_0x1828f4][_0x57f7('0x35')],'UserId':_0x5be624[_0x1828f4]['id'],'queue_name':_0x466f3f[_0x57f7('0x35')],'VoiceQueueId':_0x466f3f['id'],'interface':_[_0x57f7('0x7b')](_0x5be624[_0x1828f4][_0x57f7('0x71')])?util['format'](_0x57f7('0x7d'),_0x5be624[_0x1828f4][_0x57f7('0x35')]):_0x5be624[_0x1828f4][_0x57f7('0x71')],'paused':_0x5be624[_0x1828f4]['voicePause']||![],'penalty':_0x1fa58a['body']['penalty']||0x0}));}}return BPromise[_0x57f7('0x8e')](_0x48d029);}})[_0x57f7('0x28')](function(){return _0x27735e;})[_0x57f7('0x28')](respondWithResult(_0x13aea6,null))[_0x57f7('0x53')](handleError(_0x13aea6,null));};exports[_0x57f7('0x91')]=function(_0x9b2d95,_0x3d515f,_0x560ee6){return db['VoiceQueue'][_0x57f7('0x33')]({'where':{'id':_0x9b2d95[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x3d515f,null))[_0x57f7('0x28')](function(_0x2bd821){if(_0x2bd821){return _0x2bd821[_0x57f7('0x91')](_0x9b2d95[_0x57f7('0x3b')][_0x57f7('0x83')])[_0x57f7('0x28')](function(){if(_[_0x57f7('0x93')](_0x9b2d95[_0x57f7('0x3b')][_0x57f7('0x83')])){for(var _0x200629=0x0;_0x200629<_0x9b2d95[_0x57f7('0x3b')]['ids'][_0x57f7('0x42')];_0x200629+=0x1){socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x9b2d95[_0x57f7('0x3b')]['ids'][_0x200629]),'VoiceQueueId':Number(_0x9b2d95[_0x57f7('0x50')]['id'])});}}else{socket[_0x57f7('0x80')](_0x57f7('0x94'),{'UserId':Number(_0x9b2d95['query'][_0x57f7('0x83')]),'VoiceQueueId':Number(_0x9b2d95['params']['id'])});}});}})['then'](function(_0x3fe628){return db[_0x57f7('0x79')][_0x57f7('0x29')]({'where':{'VoiceQueueId':_0x9b2d95[_0x57f7('0x50')]['id'],'UserId':_0x9b2d95[_0x57f7('0x3b')][_0x57f7('0x83')]}})[_0x57f7('0x28')](function(){return _0x3fe628;});})['then'](respondWithStatusCode(_0x3d515f,null))[_0x57f7('0x53')](handleError(_0x3d515f,null));};exports['getAgents']=function(_0x533a8c,_0x18ec88,_0x2776c5){var _0x56f9a0={};var _0x125b10={};var _0x3f445d;var _0x11050f;return db[_0x57f7('0x38')]['findOne']({'where':{'id':_0x533a8c[_0x57f7('0x50')]['id']}})['then'](handleEntityNotFound(_0x18ec88,null))[_0x57f7('0x28')](function(_0x5001a8){if(_0x5001a8){_0x3f445d=_0x5001a8;_0x125b10[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x6e')][_0x57f7('0x51')]);_0x125b10['query']=_['keys'](_0x533a8c[_0x57f7('0x3b')]);_0x125b10[_0x57f7('0x3d')]=_[_0x57f7('0x3e')](_0x125b10[_0x57f7('0x3f')],_0x125b10[_0x57f7('0x3b')]);_0x56f9a0[_0x57f7('0x40')]=_[_0x57f7('0x3e')](_0x125b10['model'],qs[_0x57f7('0x41')](_0x533a8c['query'][_0x57f7('0x41')]));_0x56f9a0[_0x57f7('0x40')]=_0x56f9a0['attributes']['length']?_0x56f9a0[_0x57f7('0x40')]:_0x125b10['model'];_0x56f9a0[_0x57f7('0x45')]=qs['sort'](_0x533a8c[_0x57f7('0x3b')]['sort']);_0x56f9a0['where']=qs[_0x57f7('0x3d')](_[_0x57f7('0x48')](_0x533a8c[_0x57f7('0x3b')],_0x125b10[_0x57f7('0x3d')]));if(_0x533a8c[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x56f9a0['where']=_[_0x57f7('0x49')](_0x56f9a0[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x56f9a0['attributes'],function(_0x5b8a2b){var _0x5b01d6={};_0x5b01d6[_0x5b8a2b]={'$like':'%'+_0x533a8c[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x5b01d6;})});}_0x56f9a0=_[_0x57f7('0x49')]({},_0x56f9a0,_0x533a8c[_0x57f7('0x52')]);return _0x3f445d[_0x57f7('0x95')](_0x56f9a0);}})[_0x57f7('0x28')](function(_0x2c0e79){if(_0x2c0e79){_0x11050f=_0x2c0e79[_0x57f7('0x42')];if(!_0x533a8c[_0x57f7('0x3b')]['hasOwnProperty'](_0x57f7('0x44'))){_0x56f9a0[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0x533a8c['query'][_0x57f7('0x22')]);_0x56f9a0['offset']=qs[_0x57f7('0x20')](_0x533a8c[_0x57f7('0x3b')][_0x57f7('0x20')]);}return _0x3f445d['getAgents'](_0x56f9a0);}})[_0x57f7('0x28')](function(_0x52fca9){if(_0x52fca9){return _0x52fca9?{'count':_0x11050f,'rows':_0x52fca9}:null;}})[_0x57f7('0x28')](respondWithResult(_0x18ec88,null))['catch'](handleError(_0x18ec88,null));};exports[_0x57f7('0x96')]=function(_0x599180,_0x4de41d,_0x1d3104){var _0x202e34={};var _0x465c58={};var _0x1ae786;var _0x347410;return db[_0x57f7('0x38')][_0x57f7('0x61')]({'where':{'id':_0x599180['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x4de41d,null))[_0x57f7('0x28')](function(_0x2be84d){if(_0x2be84d){_0x1ae786=_0x2be84d;_0x465c58[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db['UserVoiceQueueRt']['rawAttributes']);_0x465c58[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0x599180[_0x57f7('0x3b')]);_0x465c58[_0x57f7('0x3d')]=_[_0x57f7('0x3e')](_0x465c58['model'],_0x465c58['query']);_0x202e34[_0x57f7('0x40')]=_['intersection'](_0x465c58['model'],qs[_0x57f7('0x41')](_0x599180['query'][_0x57f7('0x41')]));_0x202e34[_0x57f7('0x40')]=_0x202e34[_0x57f7('0x40')][_0x57f7('0x42')]?_0x202e34[_0x57f7('0x40')]:_0x465c58['model'];_0x202e34[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x599180[_0x57f7('0x3b')]['sort']);_0x202e34[_0x57f7('0x47')]=qs[_0x57f7('0x3d')](_[_0x57f7('0x48')](_0x599180[_0x57f7('0x3b')],_0x465c58[_0x57f7('0x3d')]));if(_0x599180[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x202e34[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x202e34[_0x57f7('0x47')],{'$or':_['map'](_0x202e34[_0x57f7('0x40')],function(_0x5c3066){var _0x286fbe={};_0x286fbe[_0x5c3066]={'$like':'%'+_0x599180[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x286fbe;})});}_0x202e34=_[_0x57f7('0x49')]({},_0x202e34,_0x599180[_0x57f7('0x52')]);return _0x1ae786['getMembers'](_0x202e34);}})[_0x57f7('0x28')](function(_0x46f94d){if(_0x46f94d){_0x347410=_0x46f94d['length'];if(!_0x599180[_0x57f7('0x3b')][_0x57f7('0x43')](_0x57f7('0x44'))){_0x202e34[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0x599180[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x202e34[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0x599180['query'][_0x57f7('0x20')]);}return _0x1ae786['getMembers'](_0x202e34);}})[_0x57f7('0x28')](function(_0x301c69){return _0x301c69?{'count':_0x347410,'rows':_0x301c69}:null;})[_0x57f7('0x28')](respondWithResult(_0x4de41d,null))[_0x57f7('0x53')](handleError(_0x4de41d,null));};exports[_0x57f7('0x97')]=function(_0x19dd3e,_0x524c57,_0x4bc148){var _0x3b4573={};var _0x3f5e97={};var _0x58b1cb;var _0x445f1d;return db[_0x57f7('0x38')][_0x57f7('0x61')]({'where':{'id':_0x19dd3e['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x524c57,null))[_0x57f7('0x28')](function(_0x2aeb0d){if(_0x2aeb0d){_0x58b1cb=_0x2aeb0d;_0x3f5e97[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x98')][_0x57f7('0x51')]);_0x3f5e97[_0x57f7('0x3b')]=_['keys'](_0x19dd3e[_0x57f7('0x3b')]);_0x3f5e97[_0x57f7('0x3d')]=_['intersection'](_0x3f5e97[_0x57f7('0x3f')],_0x3f5e97[_0x57f7('0x3b')]);_0x3b4573[_0x57f7('0x40')]=_['intersection'](_0x3f5e97[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0x19dd3e['query'][_0x57f7('0x41')]));_0x3b4573[_0x57f7('0x40')]=_0x3b4573[_0x57f7('0x40')]['length']?_0x3b4573['attributes']:_0x3f5e97[_0x57f7('0x3f')];_0x3b4573[_0x57f7('0x45')]=qs[_0x57f7('0x46')](_0x19dd3e[_0x57f7('0x3b')]['sort']);_0x3b4573['where']=qs[_0x57f7('0x3d')](_['pick'](_0x19dd3e['query'],_0x3f5e97[_0x57f7('0x3d')]));if(_0x19dd3e[_0x57f7('0x3b')]['filter']){_0x3b4573[_0x57f7('0x47')]=_[_0x57f7('0x49')](_0x3b4573[_0x57f7('0x47')],{'$or':_[_0x57f7('0x30')](_0x3b4573[_0x57f7('0x40')],function(_0x509774){var _0x2373f2={};_0x2373f2[_0x509774]={'$like':'%'+_0x19dd3e[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x2373f2;})});}_0x3b4573=_[_0x57f7('0x49')]({},_0x3b4573,_0x19dd3e[_0x57f7('0x52')]);return _0x58b1cb[_0x57f7('0x97')](_0x3b4573);}})[_0x57f7('0x28')](function(_0x6b8427){if(_0x6b8427){_0x445f1d=_0x6b8427[_0x57f7('0x42')];if(!_0x19dd3e[_0x57f7('0x3b')][_0x57f7('0x43')](_0x57f7('0x44'))){_0x3b4573['limit']=qs['limit'](_0x19dd3e[_0x57f7('0x3b')][_0x57f7('0x22')]);_0x3b4573['offset']=qs[_0x57f7('0x20')](_0x19dd3e['query']['offset']);}return _0x58b1cb[_0x57f7('0x97')](_0x3b4573);}})['then'](function(_0x1c2d2b){if(_0x1c2d2b){return _0x1c2d2b?{'count':_0x445f1d,'rows':_0x1c2d2b}:null;}})[_0x57f7('0x28')](respondWithResult(_0x524c57,null))[_0x57f7('0x53')](handleError(_0x524c57,null));};exports[_0x57f7('0x99')]=function(_0xccc44f,_0x160fe4,_0x599c3f){var _0x502b83,_0x1ff07a;return db['VoiceQueue'][_0x57f7('0x33')]({'where':{'id':_0xccc44f[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x160fe4,null))['then'](function(_0x599955){if(_0x599955){_0x1ff07a=_0x599955;return _0x599955[_0x57f7('0x99')](_0xccc44f['body'][_0x57f7('0x83')],_['omit'](_0xccc44f['body'],[_0x57f7('0x83'),'id'])||{});}return null;})[_0x57f7('0x92')](function(_0x159389){var _0x5c3721;_0x502b83=_0x159389||[];var _0x2a425d=[];if(_0x159389){for(var _0x42f355=0x0;_0x42f355<_0x159389[_0x57f7('0x42')];_0x42f355+=0x1){var _0x1ed2b4=_0x159389[_0x42f355][_0x57f7('0x2a')]({'plain':!![]});_0x1ff07a['dialCheckDuplicateType']=_0xccc44f['body'][_0x57f7('0x9a')]?_0xccc44f[_0x57f7('0x55')][_0x57f7('0x9a')]:_0x1ff07a[_0x57f7('0x9a')];switch(_0x1ff07a[_0x57f7('0x9a')]){case _0x57f7('0x9b'):_0x5c3721=squel[_0x57f7('0x9c')]()[_0x57f7('0x9d')](_0x57f7('0x9e'))[_0x57f7('0x9f')]([_0x57f7('0xa0'),'scheduledAt',_0x57f7('0xa1'),'ListId','VoiceQueueId',_0x57f7('0x5e'),_0x57f7('0x5f')],squel[_0x57f7('0xa2')]()[_0x57f7('0x84')](_0x57f7('0xa0'),'phone')[_0x57f7('0x84')]('NOW()','scheduledAt')['field']('id',_0x57f7('0xa1'))[_0x57f7('0x84')](_0x1ed2b4[_0x57f7('0xa3')][_0x57f7('0x89')](),'ListId')[_0x57f7('0x84')](_0xccc44f[_0x57f7('0x50')]['id'][_0x57f7('0x89')](),_0x57f7('0x63'))[_0x57f7('0x84')](_0x57f7('0xa4'),_0x57f7('0x5e'))['field'](_0x57f7('0xa4'),'updatedAt')[_0x57f7('0x85')](_0x57f7('0xa5'))['where'](_0x57f7('0xa6'))[_0x57f7('0x47')](_0x57f7('0xa7'),_0x1ed2b4[_0x57f7('0xa3')][_0x57f7('0x89')]())[_0x57f7('0x47')]('phone\x20IS\x20NOT\x20NULL')[_0x57f7('0x47')](_0x57f7('0xa8'),squel[_0x57f7('0xa2')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x57f7('0x85')](_0x57f7('0xa9'))[_0x57f7('0x47')](_0x57f7('0x86'),_0xccc44f['params']['id'][_0x57f7('0x89')]()))[_0x57f7('0x47')](_0x57f7('0xa8'),squel[_0x57f7('0xa2')]()[_0x57f7('0x84')](_0x57f7('0xaa'))['from'](_0x57f7('0x9e'))['where'](_0x57f7('0x86'),_0xccc44f[_0x57f7('0x50')]['id'][_0x57f7('0x89')]())))['toString']();break;case'onlyIfOpen':_0x5c3721=squel[_0x57f7('0x9c')]()[_0x57f7('0x9d')]('cm_hopper')[_0x57f7('0x9f')]([_0x57f7('0xa0'),_0x57f7('0xab'),_0x57f7('0xa1'),_0x57f7('0xac'),'VoiceQueueId',_0x57f7('0x5e'),_0x57f7('0x5f')],squel[_0x57f7('0xa2')]()['field']('phone',_0x57f7('0xa0'))[_0x57f7('0x84')](_0x57f7('0xa4'),'scheduledAt')[_0x57f7('0x84')]('id',_0x57f7('0xa1'))[_0x57f7('0x84')](_0x1ed2b4[_0x57f7('0xa3')][_0x57f7('0x89')](),_0x57f7('0xac'))[_0x57f7('0x84')](_0xccc44f[_0x57f7('0x50')]['id'][_0x57f7('0x89')](),_0x57f7('0x63'))[_0x57f7('0x84')](_0x57f7('0xa4'),'createdAt')[_0x57f7('0x84')](_0x57f7('0xa4'),'updatedAt')[_0x57f7('0x85')](_0x57f7('0xa5'))[_0x57f7('0x47')]('deletedAt\x20IS\x20NULL')[_0x57f7('0x47')](_0x57f7('0xa7'),_0x1ed2b4[_0x57f7('0xa3')]['toString']())[_0x57f7('0x47')](_0x57f7('0xad'))[_0x57f7('0x47')](_0x57f7('0xa8'),squel['select']()[_0x57f7('0x84')](_0x57f7('0xaa'))['from'](_0x57f7('0x9e'))['where'](_0x57f7('0x86'),_0xccc44f['params']['id']['toString']())))[_0x57f7('0x89')]();break;default:_0x5c3721=squel[_0x57f7('0x9c')]()[_0x57f7('0x9d')](_0x57f7('0x9e'))[_0x57f7('0x9f')]([_0x57f7('0xa0'),_0x57f7('0xab'),_0x57f7('0xa1'),_0x57f7('0xac'),_0x57f7('0x63'),_0x57f7('0x5e'),_0x57f7('0x5f')],squel[_0x57f7('0xa2')]()[_0x57f7('0x84')](_0x57f7('0xa0'),_0x57f7('0xa0'))[_0x57f7('0x84')]('NOW()','scheduledAt')[_0x57f7('0x84')]('id',_0x57f7('0xa1'))['field'](_0x1ed2b4['CmListId'][_0x57f7('0x89')](),'ListId')['field'](_0xccc44f[_0x57f7('0x50')]['id'][_0x57f7('0x89')](),_0x57f7('0x63'))[_0x57f7('0x84')]('NOW()',_0x57f7('0x5e'))[_0x57f7('0x84')](_0x57f7('0xa4'),_0x57f7('0x5f'))[_0x57f7('0x85')](_0x57f7('0xa5'))[_0x57f7('0x47')](_0x57f7('0xa6'))['where'](_0x57f7('0xa7'),_0x1ed2b4[_0x57f7('0xa3')][_0x57f7('0x89')]())[_0x57f7('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0x57f7('0x89')]();}_0x2a425d[_0x57f7('0x88')](db[_0x57f7('0x73')][_0x57f7('0x3b')](_0x5c3721));}return BPromise[_0x57f7('0x8e')](_0x2a425d);}})['then'](function(){return _0x502b83;})[_0x57f7('0x28')](respondWithResult(_0x160fe4,null))[_0x57f7('0x53')](handleError(_0x160fe4,null));};exports[_0x57f7('0xae')]=function(_0x1be4d4,_0x37c037,_0x27563e){return db['VoiceQueue'][_0x57f7('0x33')]({'where':{'id':_0x1be4d4[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x37c037,null))[_0x57f7('0x28')](function(_0x3c8331){if(_0x3c8331){return _0x3c8331[_0x57f7('0xae')](_0x1be4d4[_0x57f7('0x3b')][_0x57f7('0x83')]);}})[_0x57f7('0x28')](function(_0x36ffb0){if(_0x36ffb0){return db['CmHopper'][_0x57f7('0x29')]({'where':{'ListId':_0x1be4d4['query'][_0x57f7('0x83')],'VoiceQueueId':_0x1be4d4[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](function(){return _0x36ffb0;});}})[_0x57f7('0x28')](respondWithStatusCode(_0x37c037,null))[_0x57f7('0x53')](handleError(_0x37c037,null));};exports[_0x57f7('0xaf')]=function(_0xc06cef,_0x33e6de,_0x3c62c8){var _0x243e82={};var _0x11ce08={};var _0x4126e4;var _0x56e891;return db['VoiceQueue'][_0x57f7('0x61')]({'where':{'id':_0xc06cef['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x33e6de,null))[_0x57f7('0x28')](function(_0x51bdfb){if(_0x51bdfb){_0x4126e4=_0x51bdfb;_0x11ce08[_0x57f7('0x3f')]=_[_0x57f7('0x3c')](db[_0x57f7('0x98')][_0x57f7('0x51')]);_0x11ce08[_0x57f7('0x3b')]=_[_0x57f7('0x3c')](_0xc06cef[_0x57f7('0x3b')]);_0x11ce08[_0x57f7('0x3d')]=_[_0x57f7('0x3e')](_0x11ce08[_0x57f7('0x3f')],_0x11ce08[_0x57f7('0x3b')]);_0x243e82['attributes']=_[_0x57f7('0x3e')](_0x11ce08[_0x57f7('0x3f')],qs[_0x57f7('0x41')](_0xc06cef[_0x57f7('0x3b')][_0x57f7('0x41')]));_0x243e82[_0x57f7('0x40')]=_0x243e82[_0x57f7('0x40')]['length']?_0x243e82[_0x57f7('0x40')]:_0x11ce08[_0x57f7('0x3f')];_0x243e82[_0x57f7('0x45')]=qs['sort'](_0xc06cef[_0x57f7('0x3b')][_0x57f7('0x46')]);_0x243e82[_0x57f7('0x47')]=qs[_0x57f7('0x3d')](_['pick'](_0xc06cef[_0x57f7('0x3b')],_0x11ce08[_0x57f7('0x3d')]));if(_0xc06cef[_0x57f7('0x3b')][_0x57f7('0x2f')]){_0x243e82['where']=_['merge'](_0x243e82['where'],{'$or':_[_0x57f7('0x30')](_0x243e82[_0x57f7('0x40')],function(_0x103f7c){var _0x934699={};_0x934699[_0x103f7c]={'$like':'%'+_0xc06cef[_0x57f7('0x3b')][_0x57f7('0x2f')]+'%'};return _0x934699;})});}_0x243e82=_[_0x57f7('0x49')]({},_0x243e82,_0xc06cef[_0x57f7('0x52')]);return _0x4126e4[_0x57f7('0xaf')](_0x243e82);}})[_0x57f7('0x28')](function(_0x327c55){if(_0x327c55){_0x56e891=_0x327c55['length'];if(!_0xc06cef[_0x57f7('0x3b')]['hasOwnProperty'](_0x57f7('0x44'))){_0x243e82[_0x57f7('0x22')]=qs[_0x57f7('0x22')](_0xc06cef['query'][_0x57f7('0x22')]);_0x243e82[_0x57f7('0x20')]=qs[_0x57f7('0x20')](_0xc06cef[_0x57f7('0x3b')]['offset']);}return _0x4126e4[_0x57f7('0xaf')](_0x243e82);}})[_0x57f7('0x28')](function(_0x29a014){if(_0x29a014){return _0x29a014?{'count':_0x56e891,'rows':_0x29a014}:null;}})[_0x57f7('0x28')](respondWithResult(_0x33e6de,null))[_0x57f7('0x53')](handleError(_0x33e6de,null));};exports['addBlackLists']=function(_0x186fc1,_0x34b0ec,_0x179e18){var _0x36d1ed,_0x1706c9;return db['VoiceQueue']['find']({'where':{'id':_0x186fc1['params']['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x34b0ec,null))['then'](function(_0xb22b47){if(_0xb22b47){_0x1706c9=_0xb22b47;return _0xb22b47['addBlackLists'](_0x186fc1[_0x57f7('0x55')][_0x57f7('0x83')],_['omit'](_0x186fc1[_0x57f7('0x55')],[_0x57f7('0x83'),'id'])||{});}return null;})[_0x57f7('0x92')](function(_0x4fd0bc){var _0x3310cb;_0x36d1ed=_0x4fd0bc||[];var _0x42590e=[];if(_0x4fd0bc){for(var _0x34beb4=0x0;_0x34beb4<_0x4fd0bc[_0x57f7('0x42')];_0x34beb4+=0x1){var _0x57dfe4=_0x4fd0bc[_0x34beb4][_0x57f7('0x2a')]({'plain':!![]});_0x3310cb=squel[_0x57f7('0x9c')]()[_0x57f7('0x9d')]('cm_hopper_black')[_0x57f7('0x9f')]([_0x57f7('0xa0'),_0x57f7('0xa1'),'ListId',_0x57f7('0x63'),_0x57f7('0x5e'),_0x57f7('0x5f')],squel[_0x57f7('0xa2')]()[_0x57f7('0x84')]('phone',_0x57f7('0xa0'))['field']('id',_0x57f7('0xa1'))['field'](_0x57dfe4[_0x57f7('0xa3')][_0x57f7('0x89')](),_0x57f7('0xac'))[_0x57f7('0x84')](_0x186fc1[_0x57f7('0x50')]['id'][_0x57f7('0x89')](),'VoiceQueueId')[_0x57f7('0x84')]('NOW()',_0x57f7('0x5e'))[_0x57f7('0x84')](_0x57f7('0xa4'),_0x57f7('0x5f'))['from']('cm_contacts')[_0x57f7('0x47')](_0x57f7('0xa6'))[_0x57f7('0x47')]('ListId\x20=\x20?',_0x57dfe4[_0x57f7('0xa3')][_0x57f7('0x89')]())[_0x57f7('0x47')]('phone\x20IS\x20NOT\x20NULL'))[_0x57f7('0x89')]();_0x42590e[_0x57f7('0x88')](db[_0x57f7('0x73')][_0x57f7('0x3b')](_0x3310cb));}return BPromise['all'](_0x42590e);}})[_0x57f7('0x28')](function(){return _0x36d1ed;})['then'](respondWithResult(_0x34b0ec,null))['catch'](handleError(_0x34b0ec,null));};exports[_0x57f7('0xb0')]=function(_0x27f8d8,_0x2dc5ba,_0xdd7c88){return db[_0x57f7('0x38')][_0x57f7('0x33')]({'where':{'id':_0x27f8d8[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](handleEntityNotFound(_0x2dc5ba,null))[_0x57f7('0x28')](function(_0x43ce7e){if(_0x43ce7e){return _0x43ce7e[_0x57f7('0xb0')](_0x27f8d8['query'][_0x57f7('0x83')]);}})[_0x57f7('0x28')](function(_0x336ec9){if(_0x336ec9){return db[_0x57f7('0x6a')][_0x57f7('0x29')]({'where':{'ListId':_0x27f8d8[_0x57f7('0x3b')][_0x57f7('0x83')],'VoiceQueueId':_0x27f8d8[_0x57f7('0x50')]['id']}})[_0x57f7('0x28')](function(){return _0x336ec9;});}})[_0x57f7('0x28')](respondWithStatusCode(_0x2dc5ba,null))[_0x57f7('0x53')](handleError(_0x2dc5ba,null));}; \ No newline at end of file +var _0x6a5a=['VoiceQueue','key','query','filters','intersection','model','attributes','fields','length','limit','sort','where','pick','merge','VIRTUAL','filter','include','rows','catch','keys','rawAttributes','includeAll','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','outbound','UserProfileSection','autoAssociation','name','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','updatedAt','body','omit','inbound','userProfileId','getHoppers','findOne','nolimit','VoiceQueueId','findAll','getHopperHistories','CmHopperHistory','hasOwnProperty','CmHopperFinal','order','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','interface','forEach','penalty','sequelize','transaction','each','TeamVoiceQueue','UserVoiceQueue','findOrCreate','isNil','format','SIP/%s','userVoiceQueue:save','ids','select','field','tq.TeamId','team_has_voice_queues','join','user_has_teams','VoiceQueueId\x20=\x20?','push','toString','SELECT','every','TeamId','union','removeTeams','removeAgents','UserVoiceQueueRt','emit','userVoiceQueue:remove','addAgents','spread','upsert','all','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','scheduledAt','ListId','createdAt','phone','NOW()','ContactId','CmListId','from','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','cm_contacts','removeLists','CmHopper','getBlackLists','addBlackLists','cm_hopper_black','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','update','then','destroy','get','VoiceQueues','QueueCampaigns','ignore','map','value','type','find','UserProfileResource','end','error','send','index'];(function(_0x4d4811,_0x1c1cde){var _0x3d82b9=function(_0x273c88){while(--_0x273c88){_0x4d4811['push'](_0x4d4811['shift']());}};_0x3d82b9(++_0x1c1cde);}(_0x6a5a,0x13a));var _0xa6a5=function(_0x969189,_0x576648){_0x969189=_0x969189-0x0;var _0x4627d3=_0x6a5a[_0x969189];return _0x4627d3;};'use strict';var emlformat=require(_0xa6a5('0x0'));var rimraf=require(_0xa6a5('0x1'));var zipdir=require(_0xa6a5('0x2'));var jsonpatch=require(_0xa6a5('0x3'));var rp=require(_0xa6a5('0x4'));var moment=require(_0xa6a5('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xa6a5('0x6'));var path=require(_0xa6a5('0x7'));var sox=require('sox');var csv=require(_0xa6a5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa6a5('0x9'));var squel=require(_0xa6a5('0xa'));var crypto=require(_0xa6a5('0xb'));var jsforce=require(_0xa6a5('0xc'));var deskjs=require(_0xa6a5('0xd'));var toCsv=require(_0xa6a5('0x8'));var querystring=require(_0xa6a5('0xe'));var Papa=require(_0xa6a5('0xf'));var Redis=require(_0xa6a5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa6a5('0x11'));var as=require(_0xa6a5('0x12'));var hardwareService=require(_0xa6a5('0x13'));var logger=require(_0xa6a5('0x14'))(_0xa6a5('0x15'));var utils=require('../../config/utils');var config=require(_0xa6a5('0x16'));var licenseUtil=require(_0xa6a5('0x17'));var db=require(_0xa6a5('0x18'))['db'];config[_0xa6a5('0x19')]=_[_0xa6a5('0x1a')](config['redis'],{'host':_0xa6a5('0x1b'),'port':0x18eb});var socket=require(_0xa6a5('0x1c'))(new Redis(config[_0xa6a5('0x19')]));require(_0xa6a5('0x1d'))[_0xa6a5('0x1e')](socket);function respondWithStatusCode(_0x5619f1,_0x428f38){_0x428f38=_0x428f38||0xcc;return function(_0x402d19){if(_0x402d19){return _0x5619f1[_0xa6a5('0x1f')](_0x428f38);}return _0x5619f1[_0xa6a5('0x20')](_0x428f38)['end']();};}function respondWithResult(_0x3c321d,_0x42e62f){_0x42e62f=_0x42e62f||0xc8;return function(_0x35a281){if(_0x35a281){return _0x3c321d[_0xa6a5('0x20')](_0x42e62f)[_0xa6a5('0x21')](_0x35a281);}};}function respondWithFilteredResult(_0x50e3fe,_0xef3c8d){return function(_0x2914b4){if(_0x2914b4){var _0x2b686d=typeof _0xef3c8d[_0xa6a5('0x22')]===_0xa6a5('0x23')&&typeof _0xef3c8d['limit']===_0xa6a5('0x23');var _0x4d2970=_0x2914b4['count'];var _0x47d2ff=_0x2b686d?0x0:_0xef3c8d[_0xa6a5('0x22')];var _0x276bcd=_0x2b686d?_0x2914b4[_0xa6a5('0x24')]:_0xef3c8d['offset']+_0xef3c8d['limit'];var _0x4f0df6;if(_0x276bcd>=_0x4d2970){_0x276bcd=_0x4d2970;_0x4f0df6=0xc8;}else{_0x4f0df6=0xce;}_0x50e3fe[_0xa6a5('0x20')](_0x4f0df6);return _0x50e3fe['set'](_0xa6a5('0x25'),_0x47d2ff+'-'+_0x276bcd+'/'+_0x4d2970)['json'](_0x2914b4);}return null;};}function patchUpdates(_0x23acea){return function(_0x5857bb){try{jsonpatch[_0xa6a5('0x26')](_0x5857bb,_0x23acea,!![]);}catch(_0x36af83){return BPromise[_0xa6a5('0x27')](_0x36af83);}return _0x5857bb['save']();};}function saveUpdates(_0xc6a54d,_0x575625){return function(_0x48e9d6){if(_0x48e9d6){return _0x48e9d6[_0xa6a5('0x28')](_0xc6a54d)[_0xa6a5('0x29')](function(_0x111be4){return _0x111be4;});}return null;};}function removeEntity(_0x203866,_0x29c19c){return function(_0x2df47d){if(_0x2df47d){return _0x2df47d[_0xa6a5('0x2a')]()[_0xa6a5('0x29')](function(){var _0x3a0663=_0x2df47d[_0xa6a5('0x2b')]({'plain':!![]});var _0x41d6dc=[{'name':_0xa6a5('0x2c'),'value':'inbound','ignore':![]},{'name':_0xa6a5('0x2d'),'value':'outbound','ignore':![]}];var _0x5d5793=_(_0x41d6dc)['filter'](_0xa6a5('0x2e'))[_0xa6a5('0x2f')](_0xa6a5('0x30'))[_0xa6a5('0x30')]();if(_['includes'](_0x5d5793,_0x3a0663[_0xa6a5('0x31')])){return;}var _0x1897f2=_[_0xa6a5('0x32')](_0x41d6dc,[_0xa6a5('0x30'),_0x3a0663[_0xa6a5('0x31')]])['name'];return db[_0xa6a5('0x33')]['destroy']({'where':{'type':_0x1897f2,'resourceId':_0x3a0663['id']}})[_0xa6a5('0x29')](function(){return _0x2df47d;});})[_0xa6a5('0x29')](function(){_0x203866[_0xa6a5('0x20')](0xcc)[_0xa6a5('0x34')]();});}};}function handleEntityNotFound(_0x14821c,_0x548feb){return function(_0x3e258e){if(!_0x3e258e){_0x14821c['sendStatus'](0x194);}return _0x3e258e;};}function handleError(_0x19d2c4,_0x29b44b){_0x29b44b=_0x29b44b||0x1f4;return function(_0xf67236){logger[_0xa6a5('0x35')](_0xf67236['stack']);if(_0xf67236['name']){delete _0xf67236['name'];}_0x19d2c4[_0xa6a5('0x20')](_0x29b44b)[_0xa6a5('0x36')](_0xf67236);};}exports[_0xa6a5('0x37')]=function(_0x1b00c9,_0x5161bd){var _0x297007={},_0x1e349f={},_0xa66ff6={'count':0x0,'rows':[]};var _0x57f08b=_[_0xa6a5('0x2f')](db[_0xa6a5('0x38')]['rawAttributes'],function(_0x427e76){return{'name':_0x427e76['fieldName'],'type':_0x427e76['type'][_0xa6a5('0x39')]};});_0x1e349f['model']=_[_0xa6a5('0x2f')](_0x57f08b,'name');_0x1e349f[_0xa6a5('0x3a')]=_['keys'](_0x1b00c9[_0xa6a5('0x3a')]);_0x1e349f[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x1e349f[_0xa6a5('0x3d')],_0x1e349f['query']);_0x297007[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x1e349f[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x1b00c9['query'][_0xa6a5('0x3f')]));_0x297007[_0xa6a5('0x3e')]=_0x297007[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x297007[_0xa6a5('0x3e')]:_0x1e349f[_0xa6a5('0x3d')];if(!_0x1b00c9[_0xa6a5('0x3a')]['hasOwnProperty']('nolimit')){_0x297007[_0xa6a5('0x41')]=qs[_0xa6a5('0x41')](_0x1b00c9[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x297007[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x1b00c9[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}_0x297007['order']=qs['sort'](_0x1b00c9[_0xa6a5('0x3a')][_0xa6a5('0x42')]);_0x297007[_0xa6a5('0x43')]=qs['filters'](_[_0xa6a5('0x44')](_0x1b00c9[_0xa6a5('0x3a')],_0x1e349f[_0xa6a5('0x3b')]),_0x57f08b);if(_0x1b00c9[_0xa6a5('0x3a')]['filter']){_0x297007[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x297007[_0xa6a5('0x43')],{'$or':_[_0xa6a5('0x2f')](_0x57f08b,function(_0x1c78c1){if(_0x1c78c1['type']!==_0xa6a5('0x46')){var _0x3f24a3={};_0x3f24a3[_0x1c78c1['name']]={'$like':'%'+_0x1b00c9[_0xa6a5('0x3a')][_0xa6a5('0x47')]+'%'};return _0x3f24a3;}})});}_0x297007=_[_0xa6a5('0x45')]({},_0x297007,_0x1b00c9['options']);var _0x752814={'where':_0x297007[_0xa6a5('0x43')]};return db[_0xa6a5('0x38')][_0xa6a5('0x24')](_0x752814)[_0xa6a5('0x29')](function(_0x2ff374){_0xa66ff6[_0xa6a5('0x24')]=_0x2ff374;if(_0x1b00c9[_0xa6a5('0x3a')]['includeAll']){_0x297007[_0xa6a5('0x48')]=[{'all':!![]}];}return db[_0xa6a5('0x38')]['findAll'](_0x297007);})[_0xa6a5('0x29')](function(_0x5a84a2){_0xa66ff6[_0xa6a5('0x49')]=_0x5a84a2;return _0xa66ff6;})['then'](respondWithFilteredResult(_0x5161bd,_0x297007))[_0xa6a5('0x4a')](handleError(_0x5161bd,null));};exports['show']=function(_0x55e286,_0x5d669a){var _0x265f17={'raw':![],'where':{'id':_0x55e286['params']['id']}},_0x237452={};_0x237452[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x38')][_0xa6a5('0x4c')]);_0x237452['query']=_[_0xa6a5('0x4b')](_0x55e286[_0xa6a5('0x3a')]);_0x237452['filters']=_[_0xa6a5('0x3c')](_0x237452['model'],_0x237452[_0xa6a5('0x3a')]);_0x265f17[_0xa6a5('0x3e')]=_['intersection'](_0x237452['model'],qs['fields'](_0x55e286[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x265f17[_0xa6a5('0x3e')]=_0x265f17[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x265f17[_0xa6a5('0x3e')]:_0x237452[_0xa6a5('0x3d')];if(_0x55e286[_0xa6a5('0x3a')][_0xa6a5('0x4d')]){_0x265f17['include']=[{'all':!![]}];}_0x265f17=_[_0xa6a5('0x45')]({},_0x265f17,_0x55e286[_0xa6a5('0x4e')]);return db[_0xa6a5('0x38')][_0xa6a5('0x32')](_0x265f17)['then'](handleEntityNotFound(_0x5d669a,null))[_0xa6a5('0x29')](respondWithResult(_0x5d669a,null))['catch'](handleError(_0x5d669a,null));};exports[_0xa6a5('0x4f')]=function(_0x25c260,_0xcc4edb){return db[_0xa6a5('0x38')][_0xa6a5('0x4f')](_0x25c260['body'],{})[_0xa6a5('0x29')](function(_0x10d896){var _0x1729e0=_0x25c260[_0xa6a5('0x50')]['get']({'plain':!![]});if(!_0x1729e0)throw new Error(_0xa6a5('0x51'));if(_0x1729e0[_0xa6a5('0x52')]===_0xa6a5('0x50')){var _0x1fd279=_0x10d896[_0xa6a5('0x2b')]({'plain':!![]});var _0x1c5917=[{'name':'VoiceQueues','value':'inbound'},{'name':'QueueCampaigns','value':_0xa6a5('0x53')}];var _0x5a60fc=_[_0xa6a5('0x32')](_0x1c5917,[_0xa6a5('0x30'),_0x1fd279['type']])['name'];return db[_0xa6a5('0x54')][_0xa6a5('0x32')]({'where':{'name':_0x5a60fc,'userProfileId':_0x1729e0['userProfileId']},'raw':!![]})['then'](function(_0x5003d6){if(_0x5003d6&&_0x5003d6[_0xa6a5('0x55')]===0x0){return db[_0xa6a5('0x33')][_0xa6a5('0x4f')]({'name':_0x1fd279[_0xa6a5('0x56')],'resourceId':_0x1fd279['id'],'type':_0x5003d6[_0xa6a5('0x56')],'sectionId':_0x5003d6['id']},{})['then'](function(){return _0x10d896;});}else{return _0x10d896;}})[_0xa6a5('0x4a')](function(_0x20767b){logger[_0xa6a5('0x35')](_0xa6a5('0x57'),_0x20767b);throw _0x20767b;});}return _0x10d896;})[_0xa6a5('0x29')](respondWithResult(_0xcc4edb,0xc9))['catch'](handleError(_0xcc4edb,null));};exports[_0xa6a5('0x58')]=function(_0x3894bf,_0x3119d9){var _0x3a3f0b={'where':{'id':_0x3894bf[_0xa6a5('0x59')]['id']}},_0x2ba6a8={};_0x2ba6a8[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x38')]['rawAttributes']);_0x3a3f0b[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x2ba6a8[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x3894bf[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x3a3f0b[_0xa6a5('0x3e')]=_0x3a3f0b[_0xa6a5('0x3e')]['length']?_0x3a3f0b[_0xa6a5('0x3e')]:_0x2ba6a8['model'];if(_0x3894bf['query']['includeAll']){_0x3a3f0b['include']=[{'all':!![]}];}_0x3a3f0b=_[_0xa6a5('0x45')]({},_0x3a3f0b,_0x3894bf['options']);return db[_0xa6a5('0x38')]['find'](_0x3a3f0b)[_0xa6a5('0x29')](handleEntityNotFound(_0x3119d9,null))[_0xa6a5('0x29')](function(_0x389e21){if(_0x389e21){var _0x19abaa=_0x389e21['get']({'plain':!![]});_0x19abaa=qs['omit'](_0x19abaa,['id','createdAt',_0xa6a5('0x5a')]);_0x3894bf[_0xa6a5('0x5b')]=_[_0xa6a5('0x5c')](_0x3894bf['body'],['id','createdAt',_0xa6a5('0x5a')]);return db[_0xa6a5('0x38')][_0xa6a5('0x4f')](_['merge'](_0x19abaa,_0x3894bf['body']),{'include':_0x3894bf['query'][_0xa6a5('0x4d')]?[{'all':!![]}]:undefined})[_0xa6a5('0x29')](function(_0x5435ff){var _0x57a68c=_0x3894bf['user'][_0xa6a5('0x2b')]({'plain':!![]});if(!_0x57a68c)throw new Error(_0xa6a5('0x51'));if(_0x57a68c[_0xa6a5('0x52')]==='user'){var _0x18cfe6=_0x5435ff['get']({'plain':!![]});var _0x3eb945=[{'name':'VoiceQueues','value':_0xa6a5('0x5d')},{'name':_0xa6a5('0x2d'),'value':_0xa6a5('0x53')}];var _0x28bba2=_[_0xa6a5('0x32')](_0x3eb945,['value',_0x18cfe6[_0xa6a5('0x31')]])[_0xa6a5('0x56')];return db[_0xa6a5('0x54')][_0xa6a5('0x32')]({'where':{'name':_0x28bba2,'userProfileId':_0x57a68c[_0xa6a5('0x5e')]},'raw':!![]})[_0xa6a5('0x29')](function(_0x12f8d7){if(_0x12f8d7&&_0x12f8d7['autoAssociation']===0x0){return db[_0xa6a5('0x33')]['create']({'name':_0x18cfe6[_0xa6a5('0x56')],'resourceId':_0x18cfe6['id'],'type':_0x12f8d7[_0xa6a5('0x56')],'sectionId':_0x12f8d7['id']},{})[_0xa6a5('0x29')](function(){return _0x5435ff;});}else{return _0x5435ff;}})[_0xa6a5('0x4a')](function(_0x35b1b1){logger[_0xa6a5('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35b1b1);throw _0x35b1b1;});}return _0x5435ff;});}})[_0xa6a5('0x29')](respondWithResult(_0x3119d9,0xc9))[_0xa6a5('0x4a')](handleError(_0x3119d9,null));};exports[_0xa6a5('0x28')]=function(_0x5946a5,_0x1e9c3e){if(_0x5946a5[_0xa6a5('0x5b')]['id']){delete _0x5946a5[_0xa6a5('0x5b')]['id'];}return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x5946a5['params']['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x1e9c3e,null))[_0xa6a5('0x29')](saveUpdates(_0x5946a5[_0xa6a5('0x5b')],null))[_0xa6a5('0x29')](respondWithResult(_0x1e9c3e,null))[_0xa6a5('0x4a')](handleError(_0x1e9c3e,null));};exports[_0xa6a5('0x2a')]=function(_0x3efa80,_0x1baac0){return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x3efa80[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x1baac0,null))[_0xa6a5('0x29')](removeEntity(_0x1baac0,null))[_0xa6a5('0x4a')](handleError(_0x1baac0,null));};exports[_0xa6a5('0x5f')]=function(_0x44e18c,_0x42b928,_0x47e61f){var _0xe39aa5={'raw':![],'where':{}};var _0x3af603={};var _0x3a9b08={'count':0x0,'rows':[]};return db[_0xa6a5('0x38')][_0xa6a5('0x60')]({'where':{'id':_0x44e18c[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x42b928,null))[_0xa6a5('0x29')](function(_0x1e03f9){if(_0x1e03f9){_0x3af603['model']=_['keys'](db['CmHopper'][_0xa6a5('0x4c')]);_0x3af603['query']=_[_0xa6a5('0x4b')](_0x44e18c['query']);_0x3af603['filters']=_[_0xa6a5('0x3c')](_0x3af603[_0xa6a5('0x3d')],_0x3af603[_0xa6a5('0x3a')]);_0xe39aa5[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x3af603['model'],qs[_0xa6a5('0x3f')](_0x44e18c[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0xe39aa5[_0xa6a5('0x3e')]=_0xe39aa5['attributes'][_0xa6a5('0x40')]?_0xe39aa5['attributes']:_0x3af603[_0xa6a5('0x3d')];if(!_0x44e18c[_0xa6a5('0x3a')]['hasOwnProperty'](_0xa6a5('0x61'))){_0xe39aa5['limit']=qs[_0xa6a5('0x41')](_0x44e18c[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0xe39aa5[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x44e18c['query'][_0xa6a5('0x22')]);}_0xe39aa5['order']=qs['sort'](_0x44e18c[_0xa6a5('0x3a')][_0xa6a5('0x42')]);_0xe39aa5[_0xa6a5('0x43')]=qs['filters'](_[_0xa6a5('0x44')](_0x44e18c['query'],_0x3af603[_0xa6a5('0x3b')]));_0xe39aa5['where'][_0xa6a5('0x62')]=_0x1e03f9['id'];if(_0x44e18c['query'][_0xa6a5('0x47')]){_0xe39aa5[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0xe39aa5['where'],{'$or':_[_0xa6a5('0x2f')](_0xe39aa5[_0xa6a5('0x3e')],function(_0x18846b){var _0x3e326b={};_0x3e326b[_0x18846b]={'$like':'%'+_0x44e18c[_0xa6a5('0x3a')]['filter']+'%'};return _0x3e326b;})});}_0xe39aa5=_[_0xa6a5('0x45')]({},_0xe39aa5,_0x44e18c['options']);return db['CmHopper'][_0xa6a5('0x24')]({'where':_0xe39aa5['where']})[_0xa6a5('0x29')](function(_0x4e7da9){_0x3a9b08[_0xa6a5('0x24')]=_0x4e7da9;if(_0x44e18c[_0xa6a5('0x3a')][_0xa6a5('0x4d')]){_0xe39aa5[_0xa6a5('0x48')]=[{'all':!![]}];}return db['CmHopper'][_0xa6a5('0x63')](_0xe39aa5);})[_0xa6a5('0x29')](function(_0x158515){_0x3a9b08['rows']=_0x158515;return _0x3a9b08;});}})[_0xa6a5('0x29')](respondWithFilteredResult(_0x42b928,_0xe39aa5))['catch'](handleError(_0x42b928,null));};exports[_0xa6a5('0x64')]=function(_0x1bc209,_0x5c5066,_0x4e5bab){var _0x3b3a13={'raw':!![],'where':{}};var _0x3d378a={};var _0x38bd94={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa6a5('0x60')]({'where':{'id':_0x1bc209[_0xa6a5('0x59')]['id']}})['then'](handleEntityNotFound(_0x5c5066,null))[_0xa6a5('0x29')](function(_0x49cc87){if(_0x49cc87){_0x3d378a[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x65')][_0xa6a5('0x4c')]);_0x3d378a[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x1bc209[_0xa6a5('0x3a')]);_0x3d378a[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x3d378a[_0xa6a5('0x3d')],_0x3d378a[_0xa6a5('0x3a')]);_0x3b3a13[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x3d378a['model'],qs['fields'](_0x1bc209['query'][_0xa6a5('0x3f')]));_0x3b3a13[_0xa6a5('0x3e')]=_0x3b3a13[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x3b3a13[_0xa6a5('0x3e')]:_0x3d378a[_0xa6a5('0x3d')];if(!_0x1bc209[_0xa6a5('0x3a')][_0xa6a5('0x66')]('nolimit')){_0x3b3a13[_0xa6a5('0x41')]=qs['limit'](_0x1bc209[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x3b3a13[_0xa6a5('0x22')]=qs['offset'](_0x1bc209[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}_0x3b3a13['order']=qs[_0xa6a5('0x42')](_0x1bc209['query'][_0xa6a5('0x42')]);_0x3b3a13['where']=qs[_0xa6a5('0x3b')](_[_0xa6a5('0x44')](_0x1bc209[_0xa6a5('0x3a')],_0x3d378a[_0xa6a5('0x3b')]));_0x3b3a13[_0xa6a5('0x43')][_0xa6a5('0x62')]=_0x49cc87['id'];if(_0x1bc209['query'][_0xa6a5('0x47')]){_0x3b3a13[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x3b3a13[_0xa6a5('0x43')],{'$or':_[_0xa6a5('0x2f')](_0x3b3a13[_0xa6a5('0x3e')],function(_0x446ccd){var _0x149916={};_0x149916[_0x446ccd]={'$like':'%'+_0x1bc209['query']['filter']+'%'};return _0x149916;})});}_0x3b3a13=_[_0xa6a5('0x45')]({},_0x3b3a13,_0x1bc209['options']);return db[_0xa6a5('0x65')][_0xa6a5('0x24')]({'where':_0x3b3a13['where']})[_0xa6a5('0x29')](function(_0x598244){_0x38bd94[_0xa6a5('0x24')]=_0x598244;if(_0x1bc209[_0xa6a5('0x3a')][_0xa6a5('0x4d')]){_0x3b3a13[_0xa6a5('0x48')]=[{'all':!![]}];}return db[_0xa6a5('0x65')][_0xa6a5('0x63')](_0x3b3a13);})[_0xa6a5('0x29')](function(_0x6f90f0){_0x38bd94['rows']=_0x6f90f0;return _0x38bd94;});}})[_0xa6a5('0x29')](respondWithFilteredResult(_0x5c5066,_0x3b3a13))[_0xa6a5('0x4a')](handleError(_0x5c5066,null));};exports['getHopperFinals']=function(_0x31add9,_0x2625f1,_0x4542ba){var _0x4c3172={'raw':!![],'where':{}};var _0x31872a={};var _0x2a7590={'count':0x0,'rows':[]};return db[_0xa6a5('0x38')][_0xa6a5('0x60')]({'where':{'id':_0x31add9[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x2625f1,null))['then'](function(_0x22e1ee){if(_0x22e1ee){_0x31872a[_0xa6a5('0x3d')]=_['keys'](db[_0xa6a5('0x67')][_0xa6a5('0x4c')]);_0x31872a[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x31add9[_0xa6a5('0x3a')]);_0x31872a[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x31872a[_0xa6a5('0x3d')],_0x31872a['query']);_0x4c3172[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x31872a[_0xa6a5('0x3d')],qs['fields'](_0x31add9[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x4c3172[_0xa6a5('0x3e')]=_0x4c3172[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x4c3172[_0xa6a5('0x3e')]:_0x31872a[_0xa6a5('0x3d')];if(!_0x31add9[_0xa6a5('0x3a')][_0xa6a5('0x66')](_0xa6a5('0x61'))){_0x4c3172[_0xa6a5('0x41')]=qs[_0xa6a5('0x41')](_0x31add9['query']['limit']);_0x4c3172[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x31add9[_0xa6a5('0x3a')]['offset']);}_0x4c3172[_0xa6a5('0x68')]=qs[_0xa6a5('0x42')](_0x31add9[_0xa6a5('0x3a')][_0xa6a5('0x42')]);_0x4c3172[_0xa6a5('0x43')]=qs[_0xa6a5('0x3b')](_['pick'](_0x31add9['query'],_0x31872a[_0xa6a5('0x3b')]));_0x4c3172[_0xa6a5('0x43')]['VoiceQueueId']=_0x22e1ee['id'];if(_0x31add9['query']['filter']){_0x4c3172[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x4c3172[_0xa6a5('0x43')],{'$or':_[_0xa6a5('0x2f')](_0x4c3172['attributes'],function(_0x200e45){var _0x507c3a={};_0x507c3a[_0x200e45]={'$like':'%'+_0x31add9[_0xa6a5('0x3a')][_0xa6a5('0x47')]+'%'};return _0x507c3a;})});}_0x4c3172=_[_0xa6a5('0x45')]({},_0x4c3172,_0x31add9[_0xa6a5('0x4e')]);return db[_0xa6a5('0x67')][_0xa6a5('0x24')]({'where':_0x4c3172[_0xa6a5('0x43')]})[_0xa6a5('0x29')](function(_0x5973c9){_0x2a7590[_0xa6a5('0x24')]=_0x5973c9;if(_0x31add9[_0xa6a5('0x3a')]['includeAll']){_0x4c3172[_0xa6a5('0x48')]=[{'all':!![]}];}return db[_0xa6a5('0x67')]['findAll'](_0x4c3172);})[_0xa6a5('0x29')](function(_0x20a507){_0x2a7590[_0xa6a5('0x49')]=_0x20a507;return _0x2a7590;});}})['then'](respondWithFilteredResult(_0x2625f1,_0x4c3172))['catch'](handleError(_0x2625f1,null));};exports[_0xa6a5('0x69')]=function(_0x3484d8,_0x569769,_0x37b185){var _0x29a9e9={'raw':!![],'where':{}};var _0x3baeca={};var _0x3b6830={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa6a5('0x60')]({'where':{'id':_0x3484d8[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x569769,null))[_0xa6a5('0x29')](function(_0x5522ec){if(_0x5522ec){_0x3baeca[_0xa6a5('0x3d')]=_['keys'](db[_0xa6a5('0x6a')][_0xa6a5('0x4c')]);_0x3baeca[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x3484d8[_0xa6a5('0x3a')]);_0x3baeca[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x3baeca[_0xa6a5('0x3d')],_0x3baeca[_0xa6a5('0x3a')]);_0x29a9e9[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x3baeca[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x3484d8['query'][_0xa6a5('0x3f')]));_0x29a9e9[_0xa6a5('0x3e')]=_0x29a9e9[_0xa6a5('0x3e')]['length']?_0x29a9e9[_0xa6a5('0x3e')]:_0x3baeca['model'];if(!_0x3484d8[_0xa6a5('0x3a')][_0xa6a5('0x66')](_0xa6a5('0x61'))){_0x29a9e9[_0xa6a5('0x41')]=qs[_0xa6a5('0x41')](_0x3484d8[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x29a9e9[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x3484d8['query'][_0xa6a5('0x22')]);}_0x29a9e9[_0xa6a5('0x68')]=qs[_0xa6a5('0x42')](_0x3484d8['query'][_0xa6a5('0x42')]);_0x29a9e9[_0xa6a5('0x43')]=qs[_0xa6a5('0x3b')](_[_0xa6a5('0x44')](_0x3484d8[_0xa6a5('0x3a')],_0x3baeca['filters']));_0x29a9e9[_0xa6a5('0x43')][_0xa6a5('0x62')]=_0x5522ec['id'];if(_0x3484d8[_0xa6a5('0x3a')][_0xa6a5('0x47')]){_0x29a9e9[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x29a9e9['where'],{'$or':_['map'](_0x29a9e9[_0xa6a5('0x3e')],function(_0x53a458){var _0x4403b1={};_0x4403b1[_0x53a458]={'$like':'%'+_0x3484d8['query']['filter']+'%'};return _0x4403b1;})});}_0x29a9e9=_[_0xa6a5('0x45')]({},_0x29a9e9,_0x3484d8['options']);return db[_0xa6a5('0x6a')][_0xa6a5('0x24')]({'where':_0x29a9e9[_0xa6a5('0x43')]})['then'](function(_0xfe3f29){_0x3b6830[_0xa6a5('0x24')]=_0xfe3f29;if(_0x3484d8[_0xa6a5('0x3a')]['includeAll']){_0x29a9e9['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0xa6a5('0x63')](_0x29a9e9);})[_0xa6a5('0x29')](function(_0x19e9ef){_0x3b6830[_0xa6a5('0x49')]=_0x19e9ef;return _0x3b6830;});}})[_0xa6a5('0x29')](respondWithFilteredResult(_0x569769,_0x29a9e9))[_0xa6a5('0x4a')](handleError(_0x569769,null));};exports[_0xa6a5('0x6b')]=function(_0x1d836a,_0x547caa,_0x414e57){var _0x56d23d={};var _0xa827f5={};var _0x2971d6;var _0x3c5c0c;return db[_0xa6a5('0x38')][_0xa6a5('0x60')]({'where':{'id':_0x1d836a[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x547caa,null))[_0xa6a5('0x29')](function(_0x13a00d){if(_0x13a00d){_0x2971d6=_0x13a00d;_0xa827f5[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x6c')][_0xa6a5('0x4c')]);_0xa827f5[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x1d836a['query']);_0xa827f5[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0xa827f5[_0xa6a5('0x3d')],_0xa827f5[_0xa6a5('0x3a')]);_0x56d23d[_0xa6a5('0x3e')]=_['intersection'](_0xa827f5[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x1d836a[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x56d23d['attributes']=_0x56d23d[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x56d23d[_0xa6a5('0x3e')]:_0xa827f5['model'];_0x56d23d[_0xa6a5('0x68')]=qs[_0xa6a5('0x42')](_0x1d836a['query'][_0xa6a5('0x42')]);_0x56d23d['where']=qs[_0xa6a5('0x3b')](_['pick'](_0x1d836a[_0xa6a5('0x3a')],_0xa827f5[_0xa6a5('0x3b')]));if(_0x1d836a[_0xa6a5('0x3a')][_0xa6a5('0x47')]){_0x56d23d[_0xa6a5('0x43')]=_['merge'](_0x56d23d[_0xa6a5('0x43')],{'$or':_[_0xa6a5('0x2f')](_0x56d23d[_0xa6a5('0x3e')],function(_0x5dbddf){var _0x23a6da={};_0x23a6da[_0x5dbddf]={'$like':'%'+_0x1d836a[_0xa6a5('0x3a')][_0xa6a5('0x47')]+'%'};return _0x23a6da;})});}_0x56d23d=_['merge']({},_0x56d23d,_0x1d836a[_0xa6a5('0x4e')]);return _0x2971d6[_0xa6a5('0x6b')](_0x56d23d);}})[_0xa6a5('0x29')](function(_0xd71c44){if(_0xd71c44){_0x3c5c0c=_0xd71c44[_0xa6a5('0x40')];if(!_0x1d836a['query']['hasOwnProperty'](_0xa6a5('0x61'))){_0x56d23d[_0xa6a5('0x41')]=qs[_0xa6a5('0x41')](_0x1d836a[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x56d23d[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x1d836a['query'][_0xa6a5('0x22')]);}return _0x2971d6[_0xa6a5('0x6b')](_0x56d23d);}})[_0xa6a5('0x29')](function(_0x1d5800){if(_0x1d5800){return _0x1d5800?{'count':_0x3c5c0c,'rows':_0x1d5800}:null;}})[_0xa6a5('0x29')](respondWithResult(_0x547caa,null))[_0xa6a5('0x4a')](handleError(_0x547caa,null));};exports[_0xa6a5('0x6d')]=function(_0xaa1c48,_0x5892e0,_0x43f843){var _0x6f2e8a=_0xaa1c48[_0xa6a5('0x5b')][_0xa6a5('0x6e')];var _0x16be32=_[_0xa6a5('0x2f')](_0x6f2e8a,'id');return db[_0xa6a5('0x6c')]['findAll']({'where':{'id':_0x16be32},'attributes':['id'],'include':[{'model':db[_0xa6a5('0x6f')],'as':_0xa6a5('0x70'),'attributes':['id',_0xa6a5('0x56'),_0xa6a5('0x71'),_0xa6a5('0x72'),_0xa6a5('0x73')],'raw':!![]}]})[_0xa6a5('0x29')](function(_0x3ec174){if(_0x3ec174){var _0x4e1e99=_['flatMap'](_0x3ec174,function(_0x5eb1d0){var _0x10890d=_0x5eb1d0[_0xa6a5('0x2b')]({'plain':!![]});_0x10890d[_0xa6a5('0x70')][_0xa6a5('0x74')](function(_0x45bd47){_0x45bd47[_0xa6a5('0x75')]=_[_0xa6a5('0x32')](_0x6f2e8a,{'id':_0x10890d['id']})[_0xa6a5('0x75')];});return _0x10890d[_0xa6a5('0x70')];});return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0xaa1c48[_0xa6a5('0x59')]['id']}})['then'](function(_0x1463ff){return db[_0xa6a5('0x76')][_0xa6a5('0x77')](function(_0x3f1deb){return _0x1463ff[_0xa6a5('0x6d')](_0x16be32,{'transaction':_0x3f1deb})[_0xa6a5('0x29')](function(){return BPromise[_0xa6a5('0x78')](_0x6f2e8a,function(_0x46b7d7){return db[_0xa6a5('0x79')]['upsert']({'TeamId':_0x46b7d7['id'],'VoiceQueueId':_0xaa1c48[_0xa6a5('0x59')]['id'],'penalty':_0x46b7d7[_0xa6a5('0x75')]},{'transaction':_0x3f1deb});});})['then'](function(){return BPromise[_0xa6a5('0x78')](_0x4e1e99,function(_0x362299){return db[_0xa6a5('0x7a')][_0xa6a5('0x7b')]({'where':{'UserId':_0x362299['id'],'VoiceQueueId':_0xaa1c48['params']['id']},'defaults':{'penalty':_0x362299[_0xa6a5('0x75')]},'transaction':_0x3f1deb});});})[_0xa6a5('0x29')](function(){return BPromise[_0xa6a5('0x78')](_[_0xa6a5('0x47')](_0x4e1e99,{'online':!![]}),function(_0x1a8772){return db['UserVoiceQueueRt']['upsert']({'membername':_0x1a8772[_0xa6a5('0x56')],'UserId':_0x1a8772['id'],'queue_name':_0x1463ff['name'],'VoiceQueueId':_0x1463ff['id'],'interface':_[_0xa6a5('0x7c')](_0x1a8772[_0xa6a5('0x73')])?util[_0xa6a5('0x7d')](_0xa6a5('0x7e'),_0x1a8772[_0xa6a5('0x56')]):_0x1a8772['interface'],'paused':_0x1a8772['voicePause']||![],'penalty':_0x1a8772[_0xa6a5('0x75')]},{'transaction':_0x3f1deb});});})[_0xa6a5('0x29')](function(){_0x4e1e99[_0xa6a5('0x74')](function(_0x25e70d){socket['emit'](_0xa6a5('0x7f'),{'UserId':_0x25e70d['id'],'VoiceQueueId':_0x1463ff['id']});});});});});}})[_0xa6a5('0x29')](respondWithStatusCode(_0x5892e0,null))[_0xa6a5('0x4a')](handleError(_0x5892e0,null));};exports['removeTeams']=function(_0x45b7f2,_0x46975d,_0x43527a){return db[_0xa6a5('0x6c')]['findAll']({'where':{'id':_0x45b7f2['query'][_0xa6a5('0x80')]},'attributes':['id'],'include':[{'model':db[_0xa6a5('0x6f')],'as':_0xa6a5('0x70'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x46975d,null))[_0xa6a5('0x29')](function(_0x16fe4b){var _0x17eb85=_['map'](_0x16fe4b,'id');var _0x330798=[];var _0x3c39b5=[];var _0x3560e4=squel[_0xa6a5('0x81')]();_0x3560e4[_0xa6a5('0x82')](_0xa6a5('0x83'))['from'](_0xa6a5('0x84'),'tq')[_0xa6a5('0x85')](_0xa6a5('0x86'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa6a5('0x43')](_0xa6a5('0x87'),_0x45b7f2[_0xa6a5('0x59')]['id']);for(var _0x1b15cd=0x0;_0x1b15cd<_0x16fe4b[_0xa6a5('0x40')];_0x1b15cd+=0x1){let _0x4ed834=_0x16fe4b[_0x1b15cd];for(var _0x3f09e2=0x0;_0x3f09e2<_0x4ed834[_0xa6a5('0x70')]['length'];_0x3f09e2+=0x1){let _0x264ff7=_0x4ed834['Agents'][_0x3f09e2];var _0x266c27=_0x3560e4[_0xa6a5('0x58')]();_0x266c27[_0xa6a5('0x43')]('ut.UserId\x20=\x20?',_0x264ff7['id']);_0x3c39b5[_0xa6a5('0x88')](db[_0xa6a5('0x76')][_0xa6a5('0x3a')](_0x266c27[_0xa6a5('0x89')](),{'type':db[_0xa6a5('0x76')]['QueryTypes'][_0xa6a5('0x8a')]})[_0xa6a5('0x29')](function(_0x43b14a){if(_0x43b14a[_0xa6a5('0x40')]===0x1){return _0x264ff7['id'];}else{var _0x2b1853=_[_0xa6a5('0x8b')](_[_0xa6a5('0x2f')](_0x43b14a,_0xa6a5('0x8c')),function(_0x400527){return _['includes'](_0x17eb85,_0x400527);});if(_0x2b1853){return _0x264ff7['id'];}}}));}}return BPromise['all'](_0x3c39b5)['then'](function(_0x48f785){_0x330798=_(_0x330798)[_0xa6a5('0x8d')](_0x48f785)['compact']()[_0xa6a5('0x30')]();return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x45b7f2['params']['id']}})[_0xa6a5('0x29')](function(_0x3e2d72){return db[_0xa6a5('0x76')][_0xa6a5('0x77')](function(_0x36a2f3){return _0x3e2d72[_0xa6a5('0x8e')](_0x45b7f2[_0xa6a5('0x3a')]['ids'],{'transaction':_0x36a2f3})[_0xa6a5('0x29')](function(){if(!_['isEmpty'](_0x330798)){return _0x3e2d72[_0xa6a5('0x8f')](_0x330798,{'transaction':_0x36a2f3})[_0xa6a5('0x29')](function(){return db[_0xa6a5('0x90')][_0xa6a5('0x2a')]({'where':{'VoiceQueueId':_0x45b7f2[_0xa6a5('0x59')]['id'],'UserId':_0x330798},'transaction':_0x36a2f3});});}})[_0xa6a5('0x29')](function(){_0x330798[_0xa6a5('0x74')](function(_0x5b59c2){socket[_0xa6a5('0x91')](_0xa6a5('0x92'),{'UserId':_0x5b59c2,'VoiceQueueId':_0x3e2d72['id']});});});});});});})[_0xa6a5('0x29')](respondWithStatusCode(_0x46975d,null))[_0xa6a5('0x4a')](handleError(_0x46975d,null));};exports[_0xa6a5('0x93')]=function(_0x4aa23b,_0x22562f,_0x13e4c3){var _0x443143,_0x168aa7;return db[_0xa6a5('0x38')]['find']({'where':{'id':_0x4aa23b[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x22562f,null))[_0xa6a5('0x29')](function(_0x141c9d){if(_0x141c9d){_0x168aa7=_0x141c9d;return _0x141c9d[_0xa6a5('0x93')](_0x4aa23b[_0xa6a5('0x5b')][_0xa6a5('0x80')],_[_0xa6a5('0x5c')](_0x4aa23b['body'],[_0xa6a5('0x80'),'id'])||{})[_0xa6a5('0x94')](function(_0x1d0c5a){for(var _0x559635=0x0;_0x559635<_0x4aa23b['body']['ids']['length'];_0x559635+=0x1){socket['emit'](_0xa6a5('0x7f'),{'UserId':Number(_0x4aa23b[_0xa6a5('0x5b')][_0xa6a5('0x80')][_0x559635]),'VoiceQueueId':Number(_0x4aa23b[_0xa6a5('0x59')]['id'])});}return _0x1d0c5a;});}})[_0xa6a5('0x29')](function(_0x11ce6c){_0x443143=_0x11ce6c||[];if(_0x168aa7){return db[_0xa6a5('0x6f')][_0xa6a5('0x63')]({'where':{'id':_0x4aa23b['body'][_0xa6a5('0x80')]},'attributes':['id',_0xa6a5('0x56'),'online',_0xa6a5('0x72'),_0xa6a5('0x73')],'raw':!![]});}})[_0xa6a5('0x29')](function(_0x14e6b1){if(!_['isEmpty'](_0x14e6b1)){var _0x1acb18=[];for(var _0x40fc30=0x0;_0x40fc30<_0x14e6b1[_0xa6a5('0x40')];_0x40fc30++){if(_0x14e6b1[_0x40fc30][_0xa6a5('0x71')]){_0x1acb18[_0xa6a5('0x88')](db[_0xa6a5('0x90')][_0xa6a5('0x95')]({'membername':_0x14e6b1[_0x40fc30][_0xa6a5('0x56')],'UserId':_0x14e6b1[_0x40fc30]['id'],'queue_name':_0x168aa7['name'],'VoiceQueueId':_0x168aa7['id'],'interface':_[_0xa6a5('0x7c')](_0x14e6b1[_0x40fc30][_0xa6a5('0x73')])?util[_0xa6a5('0x7d')](_0xa6a5('0x7e'),_0x14e6b1[_0x40fc30][_0xa6a5('0x56')]):_0x14e6b1[_0x40fc30][_0xa6a5('0x73')],'paused':_0x14e6b1[_0x40fc30][_0xa6a5('0x72')]||![],'penalty':_0x4aa23b[_0xa6a5('0x5b')][_0xa6a5('0x75')]||0x0}));}}return BPromise[_0xa6a5('0x96')](_0x1acb18);}})[_0xa6a5('0x29')](function(){return _0x443143;})[_0xa6a5('0x29')](respondWithResult(_0x22562f,null))[_0xa6a5('0x4a')](handleError(_0x22562f,null));};exports[_0xa6a5('0x8f')]=function(_0x468fd0,_0xf560b1,_0x2383da){return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x468fd0[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0xf560b1,null))[_0xa6a5('0x29')](function(_0x4d0ffc){if(_0x4d0ffc){return _0x4d0ffc[_0xa6a5('0x8f')](_0x468fd0[_0xa6a5('0x3a')][_0xa6a5('0x80')])['then'](function(){if(_[_0xa6a5('0x97')](_0x468fd0[_0xa6a5('0x3a')][_0xa6a5('0x80')])){for(var _0x38f797=0x0;_0x38f797<_0x468fd0[_0xa6a5('0x3a')][_0xa6a5('0x80')][_0xa6a5('0x40')];_0x38f797+=0x1){socket[_0xa6a5('0x91')](_0xa6a5('0x92'),{'UserId':Number(_0x468fd0[_0xa6a5('0x3a')][_0xa6a5('0x80')][_0x38f797]),'VoiceQueueId':Number(_0x468fd0[_0xa6a5('0x59')]['id'])});}}else{socket['emit'](_0xa6a5('0x92'),{'UserId':Number(_0x468fd0[_0xa6a5('0x3a')][_0xa6a5('0x80')]),'VoiceQueueId':Number(_0x468fd0[_0xa6a5('0x59')]['id'])});}});}})['then'](function(_0x4aa191){return db[_0xa6a5('0x90')]['destroy']({'where':{'VoiceQueueId':_0x468fd0[_0xa6a5('0x59')]['id'],'UserId':_0x468fd0['query']['ids']}})['then'](function(){return _0x4aa191;});})[_0xa6a5('0x29')](respondWithStatusCode(_0xf560b1,null))[_0xa6a5('0x4a')](handleError(_0xf560b1,null));};exports[_0xa6a5('0x98')]=function(_0x4cb89d,_0x3cdb53,_0x483e6e){var _0xd589ab={};var _0x4d684e={};var _0x3d2aea;var _0x5d7787;return db[_0xa6a5('0x38')][_0xa6a5('0x60')]({'where':{'id':_0x4cb89d[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x3cdb53,null))[_0xa6a5('0x29')](function(_0x199bb9){if(_0x199bb9){_0x3d2aea=_0x199bb9;_0x4d684e[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x6f')][_0xa6a5('0x4c')]);_0x4d684e[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x4cb89d['query']);_0x4d684e[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x4d684e[_0xa6a5('0x3d')],_0x4d684e[_0xa6a5('0x3a')]);_0xd589ab[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x4d684e[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x4cb89d['query']['fields']));_0xd589ab['attributes']=_0xd589ab[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0xd589ab[_0xa6a5('0x3e')]:_0x4d684e['model'];_0xd589ab[_0xa6a5('0x68')]=qs[_0xa6a5('0x42')](_0x4cb89d[_0xa6a5('0x3a')]['sort']);_0xd589ab[_0xa6a5('0x43')]=qs[_0xa6a5('0x3b')](_['pick'](_0x4cb89d['query'],_0x4d684e[_0xa6a5('0x3b')]));if(_0x4cb89d[_0xa6a5('0x3a')][_0xa6a5('0x47')]){_0xd589ab[_0xa6a5('0x43')]=_['merge'](_0xd589ab['where'],{'$or':_[_0xa6a5('0x2f')](_0xd589ab[_0xa6a5('0x3e')],function(_0x42dcdf){var _0x5f1ea0={};_0x5f1ea0[_0x42dcdf]={'$like':'%'+_0x4cb89d[_0xa6a5('0x3a')]['filter']+'%'};return _0x5f1ea0;})});}_0xd589ab=_[_0xa6a5('0x45')]({},_0xd589ab,_0x4cb89d['options']);return _0x3d2aea['getAgents'](_0xd589ab);}})[_0xa6a5('0x29')](function(_0x322773){if(_0x322773){_0x5d7787=_0x322773['length'];if(!_0x4cb89d[_0xa6a5('0x3a')][_0xa6a5('0x66')](_0xa6a5('0x61'))){_0xd589ab['limit']=qs[_0xa6a5('0x41')](_0x4cb89d[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0xd589ab[_0xa6a5('0x22')]=qs['offset'](_0x4cb89d[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}return _0x3d2aea['getAgents'](_0xd589ab);}})[_0xa6a5('0x29')](function(_0x49d32c){if(_0x49d32c){return _0x49d32c?{'count':_0x5d7787,'rows':_0x49d32c}:null;}})[_0xa6a5('0x29')](respondWithResult(_0x3cdb53,null))['catch'](handleError(_0x3cdb53,null));};exports[_0xa6a5('0x99')]=function(_0x56b456,_0x2a8162,_0x2bcc55){var _0x3fbb89={};var _0x33da1e={};var _0x52ea31;var _0x51605c;return db['VoiceQueue']['findOne']({'where':{'id':_0x56b456[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x2a8162,null))[_0xa6a5('0x29')](function(_0x3a0450){if(_0x3a0450){_0x52ea31=_0x3a0450;_0x33da1e[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db[_0xa6a5('0x90')][_0xa6a5('0x4c')]);_0x33da1e[_0xa6a5('0x3a')]=_[_0xa6a5('0x4b')](_0x56b456[_0xa6a5('0x3a')]);_0x33da1e[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x33da1e[_0xa6a5('0x3d')],_0x33da1e[_0xa6a5('0x3a')]);_0x3fbb89[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x33da1e[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0x56b456[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x3fbb89['attributes']=_0x3fbb89['attributes'][_0xa6a5('0x40')]?_0x3fbb89['attributes']:_0x33da1e[_0xa6a5('0x3d')];_0x3fbb89['order']=qs[_0xa6a5('0x42')](_0x56b456['query'][_0xa6a5('0x42')]);_0x3fbb89[_0xa6a5('0x43')]=qs[_0xa6a5('0x3b')](_['pick'](_0x56b456['query'],_0x33da1e[_0xa6a5('0x3b')]));if(_0x56b456[_0xa6a5('0x3a')][_0xa6a5('0x47')]){_0x3fbb89[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x3fbb89[_0xa6a5('0x43')],{'$or':_[_0xa6a5('0x2f')](_0x3fbb89['attributes'],function(_0x190791){var _0x1c5459={};_0x1c5459[_0x190791]={'$like':'%'+_0x56b456[_0xa6a5('0x3a')]['filter']+'%'};return _0x1c5459;})});}_0x3fbb89=_[_0xa6a5('0x45')]({},_0x3fbb89,_0x56b456['options']);return _0x52ea31[_0xa6a5('0x99')](_0x3fbb89);}})[_0xa6a5('0x29')](function(_0x5c3341){if(_0x5c3341){_0x51605c=_0x5c3341[_0xa6a5('0x40')];if(!_0x56b456[_0xa6a5('0x3a')][_0xa6a5('0x66')](_0xa6a5('0x61'))){_0x3fbb89['limit']=qs['limit'](_0x56b456[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x3fbb89[_0xa6a5('0x22')]=qs['offset'](_0x56b456[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}return _0x52ea31['getMembers'](_0x3fbb89);}})[_0xa6a5('0x29')](function(_0x403249){return _0x403249?{'count':_0x51605c,'rows':_0x403249}:null;})[_0xa6a5('0x29')](respondWithResult(_0x2a8162,null))[_0xa6a5('0x4a')](handleError(_0x2a8162,null));};exports[_0xa6a5('0x9a')]=function(_0xabce2a,_0x212dd9,_0x3336ce){var _0x1b02bc={};var _0xa86de9={};var _0x1d6784;var _0x1577a8;return db['VoiceQueue']['findOne']({'where':{'id':_0xabce2a[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x212dd9,null))['then'](function(_0x1be1ee){if(_0x1be1ee){_0x1d6784=_0x1be1ee;_0xa86de9['model']=_[_0xa6a5('0x4b')](db[_0xa6a5('0x9b')][_0xa6a5('0x4c')]);_0xa86de9['query']=_['keys'](_0xabce2a[_0xa6a5('0x3a')]);_0xa86de9[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0xa86de9[_0xa6a5('0x3d')],_0xa86de9['query']);_0x1b02bc[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0xa86de9[_0xa6a5('0x3d')],qs[_0xa6a5('0x3f')](_0xabce2a['query']['fields']));_0x1b02bc[_0xa6a5('0x3e')]=_0x1b02bc[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x1b02bc[_0xa6a5('0x3e')]:_0xa86de9[_0xa6a5('0x3d')];_0x1b02bc['order']=qs[_0xa6a5('0x42')](_0xabce2a[_0xa6a5('0x3a')][_0xa6a5('0x42')]);_0x1b02bc['where']=qs['filters'](_[_0xa6a5('0x44')](_0xabce2a[_0xa6a5('0x3a')],_0xa86de9[_0xa6a5('0x3b')]));if(_0xabce2a[_0xa6a5('0x3a')][_0xa6a5('0x47')]){_0x1b02bc[_0xa6a5('0x43')]=_[_0xa6a5('0x45')](_0x1b02bc['where'],{'$or':_[_0xa6a5('0x2f')](_0x1b02bc[_0xa6a5('0x3e')],function(_0xe9ff16){var _0x111b5a={};_0x111b5a[_0xe9ff16]={'$like':'%'+_0xabce2a[_0xa6a5('0x3a')][_0xa6a5('0x47')]+'%'};return _0x111b5a;})});}_0x1b02bc=_['merge']({},_0x1b02bc,_0xabce2a[_0xa6a5('0x4e')]);return _0x1d6784[_0xa6a5('0x9a')](_0x1b02bc);}})['then'](function(_0x25f8e3){if(_0x25f8e3){_0x1577a8=_0x25f8e3['length'];if(!_0xabce2a['query']['hasOwnProperty']('nolimit')){_0x1b02bc['limit']=qs[_0xa6a5('0x41')](_0xabce2a['query'][_0xa6a5('0x41')]);_0x1b02bc[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0xabce2a[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}return _0x1d6784[_0xa6a5('0x9a')](_0x1b02bc);}})[_0xa6a5('0x29')](function(_0x474c99){if(_0x474c99){return _0x474c99?{'count':_0x1577a8,'rows':_0x474c99}:null;}})['then'](respondWithResult(_0x212dd9,null))['catch'](handleError(_0x212dd9,null));};exports[_0xa6a5('0x9c')]=function(_0x1414bf,_0x4f51ff,_0x47ff32){var _0x5ebb8d,_0x4bf696;return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x1414bf[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x4f51ff,null))['then'](function(_0x2a9763){if(_0x2a9763){_0x4bf696=_0x2a9763;return _0x2a9763[_0xa6a5('0x9c')](_0x1414bf[_0xa6a5('0x5b')]['ids'],_[_0xa6a5('0x5c')](_0x1414bf[_0xa6a5('0x5b')],['ids','id'])||{});}return null;})[_0xa6a5('0x94')](function(_0x34a487){var _0x3c96e3;_0x5ebb8d=_0x34a487||[];var _0x50d857=[];if(_0x34a487){for(var _0x107edb=0x0;_0x107edb<_0x34a487[_0xa6a5('0x40')];_0x107edb+=0x1){var _0x55e678=_0x34a487[_0x107edb][_0xa6a5('0x2b')]({'plain':!![]});_0x4bf696[_0xa6a5('0x9d')]=_0x1414bf[_0xa6a5('0x5b')][_0xa6a5('0x9d')]?_0x1414bf[_0xa6a5('0x5b')][_0xa6a5('0x9d')]:_0x4bf696['dialCheckDuplicateType'];switch(_0x4bf696[_0xa6a5('0x9d')]){case _0xa6a5('0x9e'):_0x3c96e3=squel['insert']()[_0xa6a5('0x9f')](_0xa6a5('0xa0'))[_0xa6a5('0xa1')](['phone',_0xa6a5('0xa2'),'ContactId',_0xa6a5('0xa3'),_0xa6a5('0x62'),_0xa6a5('0xa4'),_0xa6a5('0x5a')],squel['select']()[_0xa6a5('0x82')](_0xa6a5('0xa5'),_0xa6a5('0xa5'))[_0xa6a5('0x82')](_0xa6a5('0xa6'),_0xa6a5('0xa2'))['field']('id',_0xa6a5('0xa7'))[_0xa6a5('0x82')](_0x55e678[_0xa6a5('0xa8')][_0xa6a5('0x89')](),'ListId')[_0xa6a5('0x82')](_0x1414bf[_0xa6a5('0x59')]['id'][_0xa6a5('0x89')](),_0xa6a5('0x62'))[_0xa6a5('0x82')](_0xa6a5('0xa6'),'createdAt')[_0xa6a5('0x82')]('NOW()',_0xa6a5('0x5a'))[_0xa6a5('0xa9')]('cm_contacts')[_0xa6a5('0x43')](_0xa6a5('0xaa'))[_0xa6a5('0x43')](_0xa6a5('0xab'),_0x55e678[_0xa6a5('0xa8')][_0xa6a5('0x89')]())[_0xa6a5('0x43')](_0xa6a5('0xac'))[_0xa6a5('0x43')]('phone\x20NOT\x20IN\x20(?)',squel[_0xa6a5('0x81')]()[_0xa6a5('0x82')](_0xa6a5('0xad'))['from'](_0xa6a5('0xae'))[_0xa6a5('0x43')](_0xa6a5('0x87'),_0x1414bf[_0xa6a5('0x59')]['id']['toString']()))[_0xa6a5('0x43')](_0xa6a5('0xaf'),squel[_0xa6a5('0x81')]()['field'](_0xa6a5('0xb0'))[_0xa6a5('0xa9')](_0xa6a5('0xa0'))[_0xa6a5('0x43')](_0xa6a5('0x87'),_0x1414bf[_0xa6a5('0x59')]['id'][_0xa6a5('0x89')]())))['toString']();break;case _0xa6a5('0xb1'):_0x3c96e3=squel[_0xa6a5('0xb2')]()[_0xa6a5('0x9f')]('cm_hopper')['fromQuery'](['phone',_0xa6a5('0xa2'),'ContactId',_0xa6a5('0xa3'),'VoiceQueueId',_0xa6a5('0xa4'),_0xa6a5('0x5a')],squel[_0xa6a5('0x81')]()[_0xa6a5('0x82')](_0xa6a5('0xa5'),_0xa6a5('0xa5'))[_0xa6a5('0x82')](_0xa6a5('0xa6'),'scheduledAt')['field']('id','ContactId')[_0xa6a5('0x82')](_0x55e678[_0xa6a5('0xa8')][_0xa6a5('0x89')](),_0xa6a5('0xa3'))[_0xa6a5('0x82')](_0x1414bf[_0xa6a5('0x59')]['id'][_0xa6a5('0x89')](),_0xa6a5('0x62'))['field'](_0xa6a5('0xa6'),_0xa6a5('0xa4'))[_0xa6a5('0x82')]('NOW()',_0xa6a5('0x5a'))[_0xa6a5('0xa9')](_0xa6a5('0xb3'))['where'](_0xa6a5('0xaa'))[_0xa6a5('0x43')](_0xa6a5('0xab'),_0x55e678[_0xa6a5('0xa8')][_0xa6a5('0x89')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xa6a5('0x43')](_0xa6a5('0xaf'),squel['select']()[_0xa6a5('0x82')](_0xa6a5('0xb0'))[_0xa6a5('0xa9')](_0xa6a5('0xa0'))[_0xa6a5('0x43')](_0xa6a5('0x87'),_0x1414bf[_0xa6a5('0x59')]['id'][_0xa6a5('0x89')]())))[_0xa6a5('0x89')]();break;default:_0x3c96e3=squel[_0xa6a5('0xb2')]()['into']('cm_hopper')[_0xa6a5('0xa1')]([_0xa6a5('0xa5'),_0xa6a5('0xa2'),_0xa6a5('0xa7'),_0xa6a5('0xa3'),_0xa6a5('0x62'),_0xa6a5('0xa4'),_0xa6a5('0x5a')],squel[_0xa6a5('0x81')]()['field']('phone',_0xa6a5('0xa5'))['field'](_0xa6a5('0xa6'),_0xa6a5('0xa2'))[_0xa6a5('0x82')]('id',_0xa6a5('0xa7'))[_0xa6a5('0x82')](_0x55e678[_0xa6a5('0xa8')]['toString'](),'ListId')[_0xa6a5('0x82')](_0x1414bf[_0xa6a5('0x59')]['id'][_0xa6a5('0x89')](),_0xa6a5('0x62'))['field'](_0xa6a5('0xa6'),_0xa6a5('0xa4'))['field'](_0xa6a5('0xa6'),_0xa6a5('0x5a'))[_0xa6a5('0xa9')](_0xa6a5('0xb3'))[_0xa6a5('0x43')](_0xa6a5('0xaa'))[_0xa6a5('0x43')](_0xa6a5('0xab'),_0x55e678[_0xa6a5('0xa8')][_0xa6a5('0x89')]())[_0xa6a5('0x43')](_0xa6a5('0xac')))[_0xa6a5('0x89')]();}_0x50d857[_0xa6a5('0x88')](db[_0xa6a5('0x76')][_0xa6a5('0x3a')](_0x3c96e3));}return BPromise[_0xa6a5('0x96')](_0x50d857);}})[_0xa6a5('0x29')](function(){return _0x5ebb8d;})[_0xa6a5('0x29')](respondWithResult(_0x4f51ff,null))[_0xa6a5('0x4a')](handleError(_0x4f51ff,null));};exports['removeLists']=function(_0x18531c,_0x4627c5,_0x4f5b98){return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x18531c['params']['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x4627c5,null))[_0xa6a5('0x29')](function(_0x3b27d1){if(_0x3b27d1){return _0x3b27d1[_0xa6a5('0xb4')](_0x18531c[_0xa6a5('0x3a')][_0xa6a5('0x80')]);}})[_0xa6a5('0x29')](function(_0xc9aaa0){if(_0xc9aaa0){return db[_0xa6a5('0xb5')][_0xa6a5('0x2a')]({'where':{'ListId':_0x18531c[_0xa6a5('0x3a')]['ids'],'VoiceQueueId':_0x18531c[_0xa6a5('0x59')]['id']}})['then'](function(){return _0xc9aaa0;});}})['then'](respondWithStatusCode(_0x4627c5,null))[_0xa6a5('0x4a')](handleError(_0x4627c5,null));};exports[_0xa6a5('0xb6')]=function(_0x30290c,_0x6e0e44,_0x48d5cf){var _0x1d6eda={};var _0x4a631d={};var _0x5197e6;var _0x437d6b;return db['VoiceQueue'][_0xa6a5('0x60')]({'where':{'id':_0x30290c['params']['id']}})['then'](handleEntityNotFound(_0x6e0e44,null))[_0xa6a5('0x29')](function(_0xa75bcf){if(_0xa75bcf){_0x5197e6=_0xa75bcf;_0x4a631d[_0xa6a5('0x3d')]=_[_0xa6a5('0x4b')](db['CmList'][_0xa6a5('0x4c')]);_0x4a631d['query']=_[_0xa6a5('0x4b')](_0x30290c[_0xa6a5('0x3a')]);_0x4a631d[_0xa6a5('0x3b')]=_[_0xa6a5('0x3c')](_0x4a631d['model'],_0x4a631d[_0xa6a5('0x3a')]);_0x1d6eda[_0xa6a5('0x3e')]=_[_0xa6a5('0x3c')](_0x4a631d['model'],qs['fields'](_0x30290c[_0xa6a5('0x3a')][_0xa6a5('0x3f')]));_0x1d6eda['attributes']=_0x1d6eda[_0xa6a5('0x3e')][_0xa6a5('0x40')]?_0x1d6eda['attributes']:_0x4a631d['model'];_0x1d6eda[_0xa6a5('0x68')]=qs['sort'](_0x30290c[_0xa6a5('0x3a')][_0xa6a5('0x42')]);_0x1d6eda[_0xa6a5('0x43')]=qs[_0xa6a5('0x3b')](_[_0xa6a5('0x44')](_0x30290c[_0xa6a5('0x3a')],_0x4a631d[_0xa6a5('0x3b')]));if(_0x30290c['query'][_0xa6a5('0x47')]){_0x1d6eda['where']=_['merge'](_0x1d6eda['where'],{'$or':_[_0xa6a5('0x2f')](_0x1d6eda[_0xa6a5('0x3e')],function(_0x410661){var _0x15d06c={};_0x15d06c[_0x410661]={'$like':'%'+_0x30290c[_0xa6a5('0x3a')]['filter']+'%'};return _0x15d06c;})});}_0x1d6eda=_[_0xa6a5('0x45')]({},_0x1d6eda,_0x30290c['options']);return _0x5197e6[_0xa6a5('0xb6')](_0x1d6eda);}})[_0xa6a5('0x29')](function(_0x5ed19d){if(_0x5ed19d){_0x437d6b=_0x5ed19d[_0xa6a5('0x40')];if(!_0x30290c[_0xa6a5('0x3a')]['hasOwnProperty'](_0xa6a5('0x61'))){_0x1d6eda[_0xa6a5('0x41')]=qs[_0xa6a5('0x41')](_0x30290c[_0xa6a5('0x3a')][_0xa6a5('0x41')]);_0x1d6eda[_0xa6a5('0x22')]=qs[_0xa6a5('0x22')](_0x30290c[_0xa6a5('0x3a')][_0xa6a5('0x22')]);}return _0x5197e6[_0xa6a5('0xb6')](_0x1d6eda);}})[_0xa6a5('0x29')](function(_0x405b3d){if(_0x405b3d){return _0x405b3d?{'count':_0x437d6b,'rows':_0x405b3d}:null;}})[_0xa6a5('0x29')](respondWithResult(_0x6e0e44,null))[_0xa6a5('0x4a')](handleError(_0x6e0e44,null));};exports[_0xa6a5('0xb7')]=function(_0x652208,_0x11bf9a,_0x2bb0b6){var _0x579b1d,_0x46f646;return db[_0xa6a5('0x38')]['find']({'where':{'id':_0x652208[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](handleEntityNotFound(_0x11bf9a,null))[_0xa6a5('0x29')](function(_0x47b88d){if(_0x47b88d){_0x46f646=_0x47b88d;return _0x47b88d[_0xa6a5('0xb7')](_0x652208[_0xa6a5('0x5b')][_0xa6a5('0x80')],_[_0xa6a5('0x5c')](_0x652208['body'],[_0xa6a5('0x80'),'id'])||{});}return null;})[_0xa6a5('0x94')](function(_0x5a310a){var _0x3b40b4;_0x579b1d=_0x5a310a||[];var _0x37c575=[];if(_0x5a310a){for(var _0x49ca99=0x0;_0x49ca99<_0x5a310a[_0xa6a5('0x40')];_0x49ca99+=0x1){var _0x15472e=_0x5a310a[_0x49ca99]['get']({'plain':!![]});_0x3b40b4=squel[_0xa6a5('0xb2')]()[_0xa6a5('0x9f')](_0xa6a5('0xb8'))[_0xa6a5('0xa1')](['phone',_0xa6a5('0xa7'),'ListId','VoiceQueueId',_0xa6a5('0xa4'),_0xa6a5('0x5a')],squel[_0xa6a5('0x81')]()[_0xa6a5('0x82')](_0xa6a5('0xa5'),_0xa6a5('0xa5'))[_0xa6a5('0x82')]('id',_0xa6a5('0xa7'))[_0xa6a5('0x82')](_0x15472e['CmListId'][_0xa6a5('0x89')](),_0xa6a5('0xa3'))[_0xa6a5('0x82')](_0x652208['params']['id'][_0xa6a5('0x89')](),_0xa6a5('0x62'))[_0xa6a5('0x82')]('NOW()','createdAt')[_0xa6a5('0x82')]('NOW()','updatedAt')['from'](_0xa6a5('0xb3'))[_0xa6a5('0x43')](_0xa6a5('0xaa'))['where']('ListId\x20=\x20?',_0x15472e[_0xa6a5('0xa8')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL'))[_0xa6a5('0x89')]();_0x37c575['push'](db['sequelize'][_0xa6a5('0x3a')](_0x3b40b4));}return BPromise['all'](_0x37c575);}})[_0xa6a5('0x29')](function(){return _0x579b1d;})[_0xa6a5('0x29')](respondWithResult(_0x11bf9a,null))[_0xa6a5('0x4a')](handleError(_0x11bf9a,null));};exports['removeBlackLists']=function(_0x18425d,_0x2e9d66,_0x139ad6){return db[_0xa6a5('0x38')][_0xa6a5('0x32')]({'where':{'id':_0x18425d[_0xa6a5('0x59')]['id']}})['then'](handleEntityNotFound(_0x2e9d66,null))[_0xa6a5('0x29')](function(_0x4b2491){if(_0x4b2491){return _0x4b2491['removeBlackLists'](_0x18425d[_0xa6a5('0x3a')][_0xa6a5('0x80')]);}})[_0xa6a5('0x29')](function(_0x2007bd){if(_0x2007bd){return db[_0xa6a5('0x6a')][_0xa6a5('0x2a')]({'where':{'ListId':_0x18425d[_0xa6a5('0x3a')]['ids'],'VoiceQueueId':_0x18425d[_0xa6a5('0x59')]['id']}})[_0xa6a5('0x29')](function(){return _0x2007bd;});}})['then'](respondWithStatusCode(_0x2e9d66,null))['catch'](handleError(_0x2e9d66,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 41b28e8..0bbbd22 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 _0x3b4f=['save','update','remove','hook','exports','setMaxListeners'];(function(_0x4664e1,_0x1aad33){var _0x34b032=function(_0x49285){while(--_0x49285){_0x4664e1['push'](_0x4664e1['shift']());}};_0x34b032(++_0x1aad33);}(_0x3b4f,0xbf));var _0xf3b4=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3b4f[_0x122ef9];return _0x42fba0;};'use strict';var EventEmitter=require('events');var VoiceQueue=require('../../mysqldb')['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xf3b4('0x0')](0x0);var events={'afterCreate':_0xf3b4('0x1'),'afterUpdate':_0xf3b4('0x2'),'afterDestroy':_0xf3b4('0x3')};function emitEvent(_0xd4846c){return function(_0xb42f16,_0x2282d7,_0x59ef7a){VoiceQueueEvents['emit'](_0xd4846c+':'+_0xb42f16['id'],_0xb42f16);VoiceQueueEvents['emit'](_0xd4846c,_0xb42f16);_0x59ef7a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xf3b4('0x4')](e,emitEvent(event));}}module[_0xf3b4('0x5')]=VoiceQueueEvents; \ No newline at end of file +var _0x93e9=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueue','setMaxListeners','update','remove'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0x93e9,0x1e4));var _0x993e=function(_0xad57ee,_0x2823a6){_0xad57ee=_0xad57ee-0x0;var _0x3eaea9=_0x93e9[_0xad57ee];return _0x3eaea9;};'use strict';var EventEmitter=require(_0x993e('0x0'));var VoiceQueue=require(_0x993e('0x1'))['db'][_0x993e('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x993e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x993e('0x4'),'afterDestroy':_0x993e('0x5')};function emitEvent(_0x2ac18c){return function(_0x58645b,_0x4da0b5,_0x4860a3){VoiceQueueEvents['emit'](_0x2ac18c+':'+_0x58645b['id'],_0x58645b);VoiceQueueEvents[_0x993e('0x6')](_0x2ac18c,_0x58645b);_0x4860a3(null);};}for(var e in events){if(events[_0x993e('0x7')](e)){var event=events[e];VoiceQueue[_0x993e('0x8')](e,emitEvent(event));}}module[_0x993e('0x9')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 18123d3..fd7f00d 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 _0x3e74=['exports','VoiceQueue','voice_queues','lodash','../../config/logger','api','moment','path','../../config/environment','./voiceQueue.attributes'];(function(_0x2c9d22,_0x28f65a){var _0x160346=function(_0x14e429){while(--_0x14e429){_0x2c9d22['push'](_0x2c9d22['shift']());}};_0x160346(++_0x28f65a);}(_0x3e74,0x175));var _0x43e7=function(_0x53d312,_0x4e2643){_0x53d312=_0x53d312-0x0;var _0x5189cf=_0x3e74[_0x53d312];return _0x5189cf;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var logger=require(_0x43e7('0x1'))(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43e7('0x4'));var rimraf=require('rimraf');var config=require(_0x43e7('0x5'));var attributes=require(_0x43e7('0x6'));module[_0x43e7('0x7')]=function(_0x1c503b,_0xc98b9c){return _0x1c503b['define'](_0x43e7('0x8'),attributes,{'tableName':_0x43e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x55ca=['./voiceQueue.attributes','exports','define','voice_queues','lodash','util','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0x55ca,0x126));var _0xa55c=function(_0x3209f2,_0x5c51e2){_0x3209f2=_0x3209f2-0x0;var _0x56aabc=_0x55ca[_0x3209f2];return _0x56aabc;};'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 7efc241..0dd383b 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 _0xb2a0=['debug','VoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','GetVoiceQueue','findAll','raw','options','attributes','limit','include','map','model','VoiceQueue','find','where','then','ShowVoiceQueue','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','localhost','socket.io-emitter','register','info','VoiceQueue,\x20%s,\x20%s'];(function(_0x44d04f,_0x1b5e81){var _0x5a25c2=function(_0x57318e){while(--_0x57318e){_0x44d04f['push'](_0x44d04f['shift']());}};_0x5a25c2(++_0x1b5e81);}(_0xb2a0,0xad));var _0x0b2a=function(_0x396564,_0x4a6126){_0x396564=_0x396564-0x0;var _0x3d8b88=_0xb2a0[_0x396564];return _0x3d8b88;};'use strict';var _=require('lodash');var util=require(_0x0b2a('0x0'));var moment=require(_0x0b2a('0x1'));var BPromise=require(_0x0b2a('0x2'));var rs=require(_0x0b2a('0x3'));var fs=require('fs');var Redis=require(_0x0b2a('0x4'));var db=require(_0x0b2a('0x5'))['db'];var utils=require(_0x0b2a('0x6'));var logger=require(_0x0b2a('0x7'))(_0x0b2a('0x8'));var config=require(_0x0b2a('0x9'));var jayson=require(_0x0b2a('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x0b2a('0xb')](config['redis'],{'host':_0x0b2a('0xc'),'port':0x18eb});var socket=require(_0x0b2a('0xd'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x0b2a('0xe')](socket);function respondWithRpcPromise(_0x4909fd,_0x37bc10,_0x3d7093){return new BPromise(function(_0x72a41e,_0x5ce050){return client['request'](_0x4909fd,_0x3d7093)['then'](function(_0x522837){logger[_0x0b2a('0xf')](_0x0b2a('0x10'),_0x37bc10,'request\x20sent');logger[_0x0b2a('0x11')](_0x0b2a('0x12'),_0x37bc10,_0x0b2a('0x13'),JSON['stringify'](_0x522837));if(_0x522837[_0x0b2a('0x14')]){if(_0x522837[_0x0b2a('0x14')]['code']===0x1f4){logger[_0x0b2a('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x37bc10,_0x522837[_0x0b2a('0x14')]['message']);return _0x5ce050(_0x522837[_0x0b2a('0x14')][_0x0b2a('0x15')]);}logger[_0x0b2a('0x14')](_0x0b2a('0x10'),_0x37bc10,_0x522837['error'][_0x0b2a('0x15')]);return _0x72a41e(_0x522837[_0x0b2a('0x14')][_0x0b2a('0x15')]);}else{logger[_0x0b2a('0xf')](_0x0b2a('0x10'),_0x37bc10,_0x0b2a('0x13'));_0x72a41e(_0x522837['result'][_0x0b2a('0x15')]);}})[_0x0b2a('0x16')](function(_0x4e8843){logger[_0x0b2a('0x14')](_0x0b2a('0x10'),_0x37bc10,_0x4e8843);_0x5ce050(_0x4e8843);});});}exports[_0x0b2a('0x17')]=function(_0x3b804f){var _0xdc7c12=this;return new Promise(function(_0xb1ce0f,_0x1f11f9){return db['VoiceQueue'][_0x0b2a('0x18')]({'raw':_0x3b804f['options']?_0x3b804f['options'][_0x0b2a('0x19')]===undefined?!![]:![]:!![],'where':_0x3b804f[_0x0b2a('0x1a')]?_0x3b804f[_0x0b2a('0x1a')]['where']||null:null,'attributes':_0x3b804f['options']?_0x3b804f['options'][_0x0b2a('0x1b')]||null:null,'limit':_0x3b804f[_0x0b2a('0x1a')]?_0x3b804f[_0x0b2a('0x1a')][_0x0b2a('0x1c')]||null:null,'include':_0x3b804f['options']?_0x3b804f[_0x0b2a('0x1a')][_0x0b2a('0x1d')]?_['map'](_0x3b804f['options'][_0x0b2a('0x1d')],function(_0x1f2e4d){return{'model':db[_0x1f2e4d['model']],'as':_0x1f2e4d['as'],'attributes':_0x1f2e4d[_0x0b2a('0x1b')],'include':_0x1f2e4d['include']?_[_0x0b2a('0x1e')](_0x1f2e4d[_0x0b2a('0x1d')],function(_0x3c433c){return{'model':db[_0x3c433c[_0x0b2a('0x1f')]],'as':_0x3c433c['as'],'attributes':_0x3c433c[_0x0b2a('0x1b')],'include':_0x3c433c['include']?_[_0x0b2a('0x1e')](_0x3c433c['include'],function(_0x4a9cd8){return{'model':db[_0x4a9cd8[_0x0b2a('0x1f')]],'as':_0x4a9cd8['as'],'attributes':_0x4a9cd8[_0x0b2a('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x203259){logger[_0x0b2a('0xf')](_0x0b2a('0x17'),_0x3b804f);logger['debug'](_0x0b2a('0x17'),_0x3b804f,JSON['stringify'](_0x203259));_0xb1ce0f(_0x203259);})[_0x0b2a('0x16')](function(_0x28b15a){logger[_0x0b2a('0x14')](_0x0b2a('0x17'),_0x28b15a[_0x0b2a('0x15')],_0x3b804f);_0x1f11f9(_0xdc7c12[_0x0b2a('0x14')](0x1f4,_0x28b15a[_0x0b2a('0x15')]));});});};exports['ShowVoiceQueue']=function(_0xb3ca4a){var _0x4183d1=this;return new Promise(function(_0x59c91e,_0x148abb){return db[_0x0b2a('0x20')][_0x0b2a('0x21')]({'raw':_0xb3ca4a[_0x0b2a('0x1a')]?_0xb3ca4a[_0x0b2a('0x1a')][_0x0b2a('0x19')]===undefined?!![]:![]:!![],'where':_0xb3ca4a[_0x0b2a('0x1a')]?_0xb3ca4a['options'][_0x0b2a('0x22')]||null:null,'attributes':_0xb3ca4a[_0x0b2a('0x1a')]?_0xb3ca4a[_0x0b2a('0x1a')][_0x0b2a('0x1b')]||null:null,'include':_0xb3ca4a[_0x0b2a('0x1a')]?_0xb3ca4a[_0x0b2a('0x1a')][_0x0b2a('0x1d')]?_[_0x0b2a('0x1e')](_0xb3ca4a['options'][_0x0b2a('0x1d')],function(_0x348b7e){return{'model':db[_0x348b7e[_0x0b2a('0x1f')]],'as':_0x348b7e['as'],'attributes':_0x348b7e[_0x0b2a('0x1b')],'include':_0x348b7e[_0x0b2a('0x1d')]?_['map'](_0x348b7e[_0x0b2a('0x1d')],function(_0x52fdbb){return{'model':db[_0x52fdbb[_0x0b2a('0x1f')]],'as':_0x52fdbb['as'],'attributes':_0x52fdbb[_0x0b2a('0x1b')],'include':_0x52fdbb[_0x0b2a('0x1d')]?_[_0x0b2a('0x1e')](_0x52fdbb[_0x0b2a('0x1d')],function(_0x153074){return{'model':db[_0x153074[_0x0b2a('0x1f')]],'as':_0x153074['as'],'attributes':_0x153074[_0x0b2a('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0b2a('0x23')](function(_0x14a6df){logger[_0x0b2a('0xf')](_0x0b2a('0x24'),_0xb3ca4a);logger[_0x0b2a('0x11')](_0x0b2a('0x24'),_0xb3ca4a,JSON[_0x0b2a('0x25')](_0x14a6df));_0x59c91e(_0x14a6df);})[_0x0b2a('0x16')](function(_0x1eeefd){logger['error']('ShowVoiceQueue',_0x1eeefd['message'],_0xb3ca4a);_0x148abb(_0x4183d1[_0x0b2a('0x14')](0x1f4,_0x1eeefd[_0x0b2a('0x15')]));});});}; \ No newline at end of file +var _0xff6e=['result','catch','GetVoiceQueue','findAll','options','where','limit','include','attributes','map','model','then','debug','ShowVoiceQueue','VoiceQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x39fe95,_0x3570b5){var _0x40291c=function(_0x26093b){while(--_0x26093b){_0x39fe95['push'](_0x39fe95['shift']());}};_0x40291c(++_0x3570b5);}(_0xff6e,0x1ab));var _0xeff6=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0xff6e[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0xeff6('0x0'));var util=require(_0xeff6('0x1'));var moment=require(_0xeff6('0x2'));var BPromise=require('bluebird');var rs=require(_0xeff6('0x3'));var fs=require('fs');var Redis=require(_0xeff6('0x4'));var db=require(_0xeff6('0x5'))['db'];var utils=require(_0xeff6('0x6'));var logger=require('../../config/logger')(_0xeff6('0x7'));var config=require(_0xeff6('0x8'));var jayson=require(_0xeff6('0x9'));var client=jayson[_0xeff6('0xa')][_0xeff6('0xb')]({'port':0x232a});config[_0xeff6('0xc')]=_['defaults'](config['redis'],{'host':_0xeff6('0xd'),'port':0x18eb});var socket=require(_0xeff6('0xe'))(new Redis(config[_0xeff6('0xc')]));require(_0xeff6('0xf'))[_0xeff6('0x10')](socket);function respondWithRpcPromise(_0x49dc86,_0x2c1418,_0x444fa4){return new BPromise(function(_0x51d144,_0x564c83){return client['request'](_0x49dc86,_0x444fa4)['then'](function(_0x84110f){logger[_0xeff6('0x11')](_0xeff6('0x12'),_0x2c1418,_0xeff6('0x13'));logger['debug'](_0xeff6('0x14'),_0x2c1418,_0xeff6('0x13'),JSON[_0xeff6('0x15')](_0x84110f));if(_0x84110f[_0xeff6('0x16')]){if(_0x84110f[_0xeff6('0x16')]['code']===0x1f4){logger[_0xeff6('0x16')](_0xeff6('0x12'),_0x2c1418,_0x84110f[_0xeff6('0x16')][_0xeff6('0x17')]);return _0x564c83(_0x84110f[_0xeff6('0x16')]['message']);}logger['error'](_0xeff6('0x12'),_0x2c1418,_0x84110f[_0xeff6('0x16')][_0xeff6('0x17')]);return _0x51d144(_0x84110f[_0xeff6('0x16')][_0xeff6('0x17')]);}else{logger[_0xeff6('0x11')](_0xeff6('0x12'),_0x2c1418,_0xeff6('0x13'));_0x51d144(_0x84110f[_0xeff6('0x18')][_0xeff6('0x17')]);}})[_0xeff6('0x19')](function(_0x223634){logger[_0xeff6('0x16')]('VoiceQueue,\x20%s,\x20%s',_0x2c1418,_0x223634);_0x564c83(_0x223634);});});}exports[_0xeff6('0x1a')]=function(_0x187ccf){var _0x34cec0=this;return new Promise(function(_0x580305,_0x16e429){return db['VoiceQueue'][_0xeff6('0x1b')]({'raw':_0x187ccf[_0xeff6('0x1c')]?_0x187ccf['options']['raw']===undefined?!![]:![]:!![],'where':_0x187ccf[_0xeff6('0x1c')]?_0x187ccf[_0xeff6('0x1c')][_0xeff6('0x1d')]||null:null,'attributes':_0x187ccf['options']?_0x187ccf['options']['attributes']||null:null,'limit':_0x187ccf[_0xeff6('0x1c')]?_0x187ccf['options'][_0xeff6('0x1e')]||null:null,'include':_0x187ccf['options']?_0x187ccf['options'][_0xeff6('0x1f')]?_['map'](_0x187ccf[_0xeff6('0x1c')][_0xeff6('0x1f')],function(_0x349715){return{'model':db[_0x349715['model']],'as':_0x349715['as'],'attributes':_0x349715[_0xeff6('0x20')],'include':_0x349715[_0xeff6('0x1f')]?_[_0xeff6('0x21')](_0x349715[_0xeff6('0x1f')],function(_0x2cd198){return{'model':db[_0x2cd198[_0xeff6('0x22')]],'as':_0x2cd198['as'],'attributes':_0x2cd198[_0xeff6('0x20')],'include':_0x2cd198['include']?_[_0xeff6('0x21')](_0x2cd198[_0xeff6('0x1f')],function(_0x2c6435){return{'model':db[_0x2c6435[_0xeff6('0x22')]],'as':_0x2c6435['as'],'attributes':_0x2c6435[_0xeff6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeff6('0x23')](function(_0x508154){logger[_0xeff6('0x11')]('GetVoiceQueue',_0x187ccf);logger[_0xeff6('0x24')]('GetVoiceQueue',_0x187ccf,JSON[_0xeff6('0x15')](_0x508154));_0x580305(_0x508154);})[_0xeff6('0x19')](function(_0x1f449a){logger[_0xeff6('0x16')](_0xeff6('0x1a'),_0x1f449a[_0xeff6('0x17')],_0x187ccf);_0x16e429(_0x34cec0[_0xeff6('0x16')](0x1f4,_0x1f449a['message']));});});};exports[_0xeff6('0x25')]=function(_0x1bf1d6){var _0x41c114=this;return new Promise(function(_0x132a7d,_0x119f72){return db[_0xeff6('0x26')][_0xeff6('0x27')]({'raw':_0x1bf1d6[_0xeff6('0x1c')]?_0x1bf1d6['options'][_0xeff6('0x28')]===undefined?!![]:![]:!![],'where':_0x1bf1d6[_0xeff6('0x1c')]?_0x1bf1d6[_0xeff6('0x1c')][_0xeff6('0x1d')]||null:null,'attributes':_0x1bf1d6[_0xeff6('0x1c')]?_0x1bf1d6[_0xeff6('0x1c')][_0xeff6('0x20')]||null:null,'include':_0x1bf1d6[_0xeff6('0x1c')]?_0x1bf1d6[_0xeff6('0x1c')][_0xeff6('0x1f')]?_[_0xeff6('0x21')](_0x1bf1d6[_0xeff6('0x1c')]['include'],function(_0x313d2f){return{'model':db[_0x313d2f[_0xeff6('0x22')]],'as':_0x313d2f['as'],'attributes':_0x313d2f[_0xeff6('0x20')],'include':_0x313d2f[_0xeff6('0x1f')]?_['map'](_0x313d2f['include'],function(_0x3a713a){return{'model':db[_0x3a713a[_0xeff6('0x22')]],'as':_0x3a713a['as'],'attributes':_0x3a713a[_0xeff6('0x20')],'include':_0x3a713a['include']?_['map'](_0x3a713a[_0xeff6('0x1f')],function(_0x4f7065){return{'model':db[_0x4f7065[_0xeff6('0x22')]],'as':_0x4f7065['as'],'attributes':_0x4f7065[_0xeff6('0x20')]};}):[]};}):[]};}):[]:[]})[_0xeff6('0x23')](function(_0x4d870f){logger[_0xeff6('0x11')]('ShowVoiceQueue',_0x1bf1d6);logger[_0xeff6('0x24')](_0xeff6('0x25'),_0x1bf1d6,JSON['stringify'](_0x4d870f));_0x132a7d(_0x4d870f);})[_0xeff6('0x19')](function(_0xd7e408){logger[_0xeff6('0x16')](_0xeff6('0x25'),_0xd7e408[_0xeff6('0x17')],_0x1bf1d6);_0x119f72(_0x41c114[_0xeff6('0x16')](0x1f4,_0xd7e408[_0xeff6('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index f34ada4..e7262e0 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 _0x5d0b=['length','voiceQueue:','./voiceQueue.events','save','remove','update','emit','register'];(function(_0x31a7eb,_0x203b51){var _0x2fe5e7=function(_0x8fa18b){while(--_0x8fa18b){_0x31a7eb['push'](_0x31a7eb['shift']());}};_0x2fe5e7(++_0x203b51);}(_0x5d0b,0x142));var _0xb5d0=function(_0x386688,_0x29d853){_0x386688=_0x386688-0x0;var _0x139544=_0x5d0b[_0x386688];return _0x139544;};'use strict';var VoiceQueueEvents=require(_0xb5d0('0x0'));var events=[_0xb5d0('0x1'),_0xb5d0('0x2'),_0xb5d0('0x3')];function createListener(_0x3890df,_0x168298){return function(_0x4bb1a4){_0x168298[_0xb5d0('0x4')](_0x3890df,_0x4bb1a4);};}function removeListener(_0x4948e8,_0x5e407e){return function(){VoiceQueueEvents['removeListener'](_0x4948e8,_0x5e407e);};}exports[_0xb5d0('0x5')]=function(_0x11e002){for(var _0x861fa6=0x0,_0xa86aa9=events[_0xb5d0('0x6')];_0x861fa6<_0xa86aa9;_0x861fa6++){var _0x398d44=events[_0x861fa6];var _0x57160f=createListener(_0xb5d0('0x7')+_0x398d44,_0x11e002);VoiceQueueEvents['on'](_0x398d44,_0x57160f);}}; \ No newline at end of file +var _0x47f1=['update','emit','removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x3c99c9,_0x40e755){var _0x1964b4=function(_0x1fc8ad){while(--_0x1fc8ad){_0x3c99c9['push'](_0x3c99c9['shift']());}};_0x1964b4(++_0x40e755);}(_0x47f1,0x1c8));var _0x147f=function(_0x2d640d,_0x32bc5b){_0x2d640d=_0x2d640d-0x0;var _0x13fcf0=_0x47f1[_0x2d640d];return _0x13fcf0;};'use strict';var VoiceQueueEvents=require(_0x147f('0x0'));var events=[_0x147f('0x1'),_0x147f('0x2'),_0x147f('0x3')];function createListener(_0x4ef88f,_0x5874f8){return function(_0x3dce03){_0x5874f8[_0x147f('0x4')](_0x4ef88f,_0x3dce03);};}function removeListener(_0xdc9d30,_0x22fd9d){return function(){VoiceQueueEvents[_0x147f('0x5')](_0xdc9d30,_0x22fd9d);};}exports[_0x147f('0x6')]=function(_0xdc5918){for(var _0x21fc13=0x0,_0x6130c2=events[_0x147f('0x7')];_0x21fc13<_0x6130c2;_0x21fc13++){var _0x4a01b4=events[_0x21fc13];var _0x8a4b4c=createListener(_0x147f('0x8')+_0x4a01b4,_0xdc5918);VoiceQueueEvents['on'](_0x4a01b4,_0x8a4b4c);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index e6245ac..260ce55 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 _0x6002=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','create','put'];(function(_0x9dd82d,_0x5f2414){var _0x19eccb=function(_0x449c27){while(--_0x449c27){_0x9dd82d['push'](_0x9dd82d['shift']());}};_0x19eccb(++_0x5f2414);}(_0x6002,0x17e));var _0x2600=function(_0x46b838,_0x31e3bf){_0x46b838=_0x46b838-0x0;var _0x49d971=_0x6002[_0x46b838];return _0x49d971;};'use strict';var multer=require(_0x2600('0x0'));var util=require(_0x2600('0x1'));var path=require(_0x2600('0x2'));var timeout=require(_0x2600('0x3'));var express=require('express');var router=express[_0x2600('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2600('0x5'));var interaction=require(_0x2600('0x6'));var config=require(_0x2600('0x7'));var controller=require(_0x2600('0x8'));router[_0x2600('0x9')]('/',auth[_0x2600('0xa')](),controller['index']);router[_0x2600('0x9')](_0x2600('0xb'),auth['isAuthenticated'](),controller[_0x2600('0xc')]);router[_0x2600('0x9')]('/index',auth[_0x2600('0xa')](),controller['getVoiceQueuesReport']);router['get'](_0x2600('0xd'),auth[_0x2600('0xa')](),controller[_0x2600('0xe')]);router[_0x2600('0xf')]('/',auth[_0x2600('0xa')](),controller[_0x2600('0x10')]);router[_0x2600('0x11')](_0x2600('0xd'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x2600('0xd'),auth[_0x2600('0xa')](),controller[_0x2600('0x12')]);module[_0x2600('0x13')]=router; \ No newline at end of file +var _0xebeb=['post','create','put','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','index','get','describe','/index','isAuthenticated','/:id'];(function(_0x47befe,_0xa20900){var _0x5c5fdf=function(_0x22fc15){while(--_0x22fc15){_0x47befe['push'](_0x47befe['shift']());}};_0x5c5fdf(++_0xa20900);}(_0xebeb,0x193));var _0xbebe=function(_0x2633a0,_0x1b606d){_0x2633a0=_0x2633a0-0x0;var _0x5907cc=_0xebeb[_0x2633a0];return _0x5907cc;};'use strict';var multer=require('multer');var util=require(_0xbebe('0x0'));var path=require(_0xbebe('0x1'));var timeout=require('connect-timeout');var express=require(_0xbebe('0x2'));var router=express[_0xbebe('0x3')]();var fs_extra=require(_0xbebe('0x4'));var auth=require(_0xbebe('0x5'));var interaction=require(_0xbebe('0x6'));var config=require(_0xbebe('0x7'));var controller=require(_0xbebe('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xbebe('0x9')]);router[_0xbebe('0xa')]('/describe',auth['isAuthenticated'](),controller[_0xbebe('0xb')]);router[_0xbebe('0xa')](_0xbebe('0xc'),auth[_0xbebe('0xd')](),controller['getVoiceQueuesReport']);router[_0xbebe('0xa')](_0xbebe('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbebe('0xf')]('/',auth[_0xbebe('0xd')](),controller[_0xbebe('0x10')]);router[_0xbebe('0x11')](_0xbebe('0xe'),auth['isAuthenticated'](),controller[_0xbebe('0x12')]);router[_0xbebe('0x13')](_0xbebe('0xe'),auth[_0xbebe('0xd')](),controller[_0xbebe('0x14')]);module[_0xbebe('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index a22e8a4..3eb218f 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 _0x826b=['COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN'];(function(_0x51ee31,_0x29f5c9){var _0x27518e=function(_0x44d0ec){while(--_0x44d0ec){_0x51ee31['push'](_0x51ee31['shift']());}};_0x27518e(++_0x29f5c9);}(_0x826b,0x12e));var _0xb826=function(_0x3d69af,_0x5d4f30){_0x3d69af=_0x3d69af-0x0;var _0x336f39=_0x826b[_0x3d69af];return _0x336f39;};'use strict';var Sequelize=require(_0xb826('0x0'));var moment=require(_0xb826('0x1'));module['exports']={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb826('0x2')]},'calleridnum':{'type':Sequelize[_0xb826('0x2')]},'calleridname':{'type':Sequelize[_0xb826('0x2')]},'queue':{'type':Sequelize[_0xb826('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xb826('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xb826('0x3')],'set':function(_0x5e54fd){var _0x4a5361=moment(_0x5e54fd);var _0x88e402=moment(this['getDataValue'](_0xb826('0x4')))[_0xb826('0x5')](_0xb826('0x6'));var _0x379903=_0x4a5361[_0xb826('0x7')](_0x88e402,'seconds');this[_0xb826('0x8')](_0xb826('0x9'),_0x5e54fd);this[_0xb826('0x8')](_0xb826('0xa'),_0x379903||null);}},'position':{'type':Sequelize[_0xb826('0xb')]},'count':{'type':Sequelize[_0xb826('0xb')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb826('0x3')]},'queuecallercomplete':{'type':Sequelize[_0xb826('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb826('0xc')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb826('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0xb826('0x2')],'comment':_0xb826('0xd')},'originalposition':{'type':Sequelize[_0xb826('0xb')]},'channel':{'type':Sequelize[_0xb826('0x2')]},'connectedlinenum':{'type':Sequelize[_0xb826('0x2')]},'connectedlinename':{'type':Sequelize[_0xb826('0x2')]},'accountcode':{'type':Sequelize[_0xb826('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xb826('0x2')]},'priority':{'type':Sequelize[_0xb826('0x2')]},'holdtime':{'type':Sequelize[_0xb826('0xb')]},'mohtime':{'type':Sequelize[_0xb826('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb826('0x2')]},'transfer':{'type':Sequelize[_0xb826('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb826('0x2')],'comment':_0xb826('0xe')},'transferexten':{'type':Sequelize[_0xb826('0x2')]},'transferuniqueid':{'type':Sequelize[_0xb826('0x2')]},'disposition':{'type':Sequelize[_0xb826('0x2')]},'secondDisposition':{'type':Sequelize[_0xb826('0x2')]},'thirdDisposition':{'type':Sequelize[_0xb826('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x5aaa=['getDataValue','format','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE'];(function(_0x15f434,_0x393234){var _0x230ba8=function(_0x46240d){while(--_0x46240d){_0x15f434['push'](_0x15f434['shift']());}};_0x230ba8(++_0x393234);}(_0x5aaa,0x1eb));var _0xa5aa=function(_0xafd3f3,_0x159dc4){_0xafd3f3=_0xafd3f3-0x0;var _0x3eac02=_0x5aaa[_0xafd3f3];return _0x3eac02;};'use strict';var Sequelize=require(_0xa5aa('0x0'));var moment=require('moment');module[_0xa5aa('0x1')]={'type':{'type':Sequelize[_0xa5aa('0x2')]},'uniqueid':{'type':Sequelize[_0xa5aa('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xa5aa('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0xa5aa('0x3')],'set':function(_0x42f3dc){var _0x548510=moment(_0x42f3dc);var _0x428b1f=moment(this[_0xa5aa('0x4')]('queuecallerjoinAt'))[_0xa5aa('0x5')](_0xa5aa('0x6'));var _0x11ce16=_0x548510[_0xa5aa('0x7')](_0x428b1f,_0xa5aa('0x8'));this[_0xa5aa('0x9')](_0xa5aa('0xa'),_0x42f3dc);this['setDataValue']('holdtime',_0x11ce16||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0xa5aa('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xa5aa('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xa5aa('0xc')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa5aa('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa5aa('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0xa5aa('0xd')},'originalposition':{'type':Sequelize[_0xa5aa('0xb')]},'channel':{'type':Sequelize[_0xa5aa('0x2')]},'connectedlinenum':{'type':Sequelize[_0xa5aa('0x2')]},'connectedlinename':{'type':Sequelize[_0xa5aa('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xa5aa('0x2')]},'exten':{'type':Sequelize[_0xa5aa('0x2')]},'priority':{'type':Sequelize[_0xa5aa('0x2')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa5aa('0xc')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xa5aa('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa5aa('0x2')],'comment':_0xa5aa('0xe')},'transferexten':{'type':Sequelize[_0xa5aa('0x2')]},'transferuniqueid':{'type':Sequelize[_0xa5aa('0x2')]},'disposition':{'type':Sequelize[_0xa5aa('0x2')]},'secondDisposition':{'type':Sequelize[_0xa5aa('0x2')]},'thirdDisposition':{'type':Sequelize[_0xa5aa('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xa5aa('0xb')],'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 394b2fe..647d880 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 _0x2ac0=['destroy','end','error','name','send','index','map','VoiceQueueReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','getVoiceQueuesReport','order','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x2ac0,0x18a));var _0x02ac=function(_0x29724b,_0x32d832){_0x29724b=_0x29724b-0x0;var _0x54740d=_0x2ac0[_0x29724b];return _0x54740d;};'use strict';var emlformat=require(_0x02ac('0x0'));var rimraf=require(_0x02ac('0x1'));var zipdir=require(_0x02ac('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x02ac('0x3'));var moment=require(_0x02ac('0x4'));var BPromise=require(_0x02ac('0x5'));var Mustache=require(_0x02ac('0x6'));var util=require(_0x02ac('0x7'));var path=require(_0x02ac('0x8'));var sox=require(_0x02ac('0x9'));var csv=require(_0x02ac('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x02ac('0xb'));var _=require(_0x02ac('0xc'));var squel=require(_0x02ac('0xd'));var crypto=require('crypto');var jsforce=require(_0x02ac('0xe'));var deskjs=require(_0x02ac('0xf'));var toCsv=require('to-csv');var querystring=require(_0x02ac('0x10'));var Papa=require(_0x02ac('0x11'));var Redis=require(_0x02ac('0x12'));var authService=require(_0x02ac('0x13'));var qs=require(_0x02ac('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x02ac('0x15'))(_0x02ac('0x16'));var utils=require(_0x02ac('0x17'));var config=require(_0x02ac('0x18'));var licenseUtil=require(_0x02ac('0x19'));var db=require(_0x02ac('0x1a'))['db'];config['redis']=_[_0x02ac('0x1b')](config[_0x02ac('0x1c')],{'host':_0x02ac('0x1d'),'port':0x18eb});var socket=require(_0x02ac('0x1e'))(new Redis(config[_0x02ac('0x1c')]));require(_0x02ac('0x1f'))[_0x02ac('0x20')](socket);function respondWithStatusCode(_0x17d8a7,_0x55d3de){_0x55d3de=_0x55d3de||0xcc;return function(_0x3b5ff5){if(_0x3b5ff5){return _0x17d8a7[_0x02ac('0x21')](_0x55d3de);}return _0x17d8a7[_0x02ac('0x22')](_0x55d3de)['end']();};}function respondWithResult(_0x3eda86,_0x40dafb){_0x40dafb=_0x40dafb||0xc8;return function(_0x367ce5){if(_0x367ce5){return _0x3eda86[_0x02ac('0x22')](_0x40dafb)[_0x02ac('0x23')](_0x367ce5);}};}function respondWithFilteredResult(_0x2e9ce0,_0x291371){return function(_0x1238a4){if(_0x1238a4){var _0x4d090e=typeof _0x291371[_0x02ac('0x24')]===_0x02ac('0x25')&&typeof _0x291371[_0x02ac('0x26')]===_0x02ac('0x25');var _0x4c173b=_0x1238a4['count'];var _0x440eef=_0x4d090e?0x0:_0x291371[_0x02ac('0x24')];var _0x35f61f=_0x4d090e?_0x1238a4[_0x02ac('0x27')]:_0x291371[_0x02ac('0x24')]+_0x291371[_0x02ac('0x26')];var _0x50e35f;if(_0x35f61f>=_0x4c173b){_0x35f61f=_0x4c173b;_0x50e35f=0xc8;}else{_0x50e35f=0xce;}_0x2e9ce0[_0x02ac('0x22')](_0x50e35f);return _0x2e9ce0[_0x02ac('0x28')]('Content-Range',_0x440eef+'-'+_0x35f61f+'/'+_0x4c173b)['json'](_0x1238a4);}return null;};}function patchUpdates(_0x19e50d){return function(_0x402bfd){try{jsonpatch[_0x02ac('0x29')](_0x402bfd,_0x19e50d,!![]);}catch(_0x3112f3){return BPromise[_0x02ac('0x2a')](_0x3112f3);}return _0x402bfd[_0x02ac('0x2b')]();};}function saveUpdates(_0x2753e0,_0x2b2826){return function(_0x47cd98){if(_0x47cd98){return _0x47cd98[_0x02ac('0x2c')](_0x2753e0)[_0x02ac('0x2d')](function(_0x34ea58){return _0x34ea58;});}return null;};}function removeEntity(_0x14b910,_0x53ac8a){return function(_0x151171){if(_0x151171){return _0x151171[_0x02ac('0x2e')]()[_0x02ac('0x2d')](function(){_0x14b910[_0x02ac('0x22')](0xcc)[_0x02ac('0x2f')]();});}};}function handleEntityNotFound(_0xf5a31f,_0x13c6eb){return function(_0x304132){if(!_0x304132){_0xf5a31f[_0x02ac('0x21')](0x194);}return _0x304132;};}function handleError(_0x3265e2,_0x47d294){_0x47d294=_0x47d294||0x1f4;return function(_0x5a69d1){logger[_0x02ac('0x30')](_0x5a69d1['stack']);if(_0x5a69d1[_0x02ac('0x31')]){delete _0x5a69d1[_0x02ac('0x31')];}_0x3265e2[_0x02ac('0x22')](_0x47d294)[_0x02ac('0x32')](_0x5a69d1);};}exports[_0x02ac('0x33')]=function(_0x17acd6,_0x2bfc31){var _0x208109={},_0x22fb13={},_0x2ba8ab={'count':0x0,'rows':[]};var _0x3de0d9=_[_0x02ac('0x34')](db[_0x02ac('0x35')][_0x02ac('0x36')],function(_0x2d9ff0){return{'name':_0x2d9ff0[_0x02ac('0x37')],'type':_0x2d9ff0['type'][_0x02ac('0x38')]};});_0x22fb13[_0x02ac('0x39')]=_[_0x02ac('0x34')](_0x3de0d9,'name');_0x22fb13['query']=_['keys'](_0x17acd6[_0x02ac('0x3a')]);_0x22fb13[_0x02ac('0x3b')]=_['intersection'](_0x22fb13[_0x02ac('0x39')],_0x22fb13[_0x02ac('0x3a')]);_0x208109[_0x02ac('0x3c')]=_[_0x02ac('0x3d')](_0x22fb13[_0x02ac('0x39')],qs[_0x02ac('0x3e')](_0x17acd6[_0x02ac('0x3a')][_0x02ac('0x3e')]));_0x208109['attributes']=_0x208109[_0x02ac('0x3c')][_0x02ac('0x3f')]?_0x208109[_0x02ac('0x3c')]:_0x22fb13[_0x02ac('0x39')];if(!_0x17acd6[_0x02ac('0x3a')][_0x02ac('0x40')](_0x02ac('0x41'))){_0x208109['limit']=qs[_0x02ac('0x26')](_0x17acd6[_0x02ac('0x3a')]['limit']);_0x208109[_0x02ac('0x24')]=qs['offset'](_0x17acd6['query'][_0x02ac('0x24')]);}_0x208109['order']=qs[_0x02ac('0x42')](_0x17acd6[_0x02ac('0x3a')]['sort']);_0x208109[_0x02ac('0x43')]=qs['filters'](_[_0x02ac('0x44')](_0x17acd6['query'],_0x22fb13[_0x02ac('0x3b')]),_0x3de0d9);if(_0x17acd6[_0x02ac('0x3a')]['filter']){_0x208109[_0x02ac('0x43')]=_['merge'](_0x208109['where'],{'$or':_['map'](_0x3de0d9,function(_0x17b00d){if(_0x17b00d[_0x02ac('0x45')]!==_0x02ac('0x46')){var _0x1c33b2={};_0x1c33b2[_0x17b00d['name']]={'$like':'%'+_0x17acd6['query'][_0x02ac('0x47')]+'%'};return _0x1c33b2;}})});}_0x208109=_[_0x02ac('0x48')]({},_0x208109,_0x17acd6[_0x02ac('0x49')]);var _0x19e1a={'where':_0x208109[_0x02ac('0x43')]};return db[_0x02ac('0x35')][_0x02ac('0x27')](_0x19e1a)[_0x02ac('0x2d')](function(_0x41daab){_0x2ba8ab[_0x02ac('0x27')]=_0x41daab;if(_0x17acd6['query'][_0x02ac('0x4a')]){_0x208109[_0x02ac('0x4b')]=[{'all':!![]}];}return db[_0x02ac('0x35')][_0x02ac('0x4c')](_0x208109);})[_0x02ac('0x2d')](function(_0x56f673){_0x2ba8ab[_0x02ac('0x4d')]=_0x56f673;return _0x2ba8ab;})['then'](respondWithFilteredResult(_0x2bfc31,_0x208109))[_0x02ac('0x4e')](handleError(_0x2bfc31,null));};exports[_0x02ac('0x4f')]=function(_0x3df2c9,_0x9ace04){var _0x5b5eb9={'raw':![],'where':{'id':_0x3df2c9[_0x02ac('0x50')]['id']}},_0x1dd66f={};_0x1dd66f[_0x02ac('0x39')]=_['keys'](db[_0x02ac('0x35')][_0x02ac('0x36')]);_0x1dd66f[_0x02ac('0x3a')]=_[_0x02ac('0x51')](_0x3df2c9[_0x02ac('0x3a')]);_0x1dd66f[_0x02ac('0x3b')]=_['intersection'](_0x1dd66f[_0x02ac('0x39')],_0x1dd66f[_0x02ac('0x3a')]);_0x5b5eb9[_0x02ac('0x3c')]=_[_0x02ac('0x3d')](_0x1dd66f['model'],qs[_0x02ac('0x3e')](_0x3df2c9['query'][_0x02ac('0x3e')]));_0x5b5eb9[_0x02ac('0x3c')]=_0x5b5eb9[_0x02ac('0x3c')][_0x02ac('0x3f')]?_0x5b5eb9[_0x02ac('0x3c')]:_0x1dd66f[_0x02ac('0x39')];if(_0x3df2c9['query']['includeAll']){_0x5b5eb9[_0x02ac('0x4b')]=[{'all':!![]}];}_0x5b5eb9=_['merge']({},_0x5b5eb9,_0x3df2c9[_0x02ac('0x49')]);return db['VoiceQueueReport'][_0x02ac('0x52')](_0x5b5eb9)['then'](handleEntityNotFound(_0x9ace04,null))[_0x02ac('0x2d')](respondWithResult(_0x9ace04,null))[_0x02ac('0x4e')](handleError(_0x9ace04,null));};exports[_0x02ac('0x53')]=function(_0x101969,_0x1f9d33){return db['VoiceQueueReport'][_0x02ac('0x53')](_0x101969[_0x02ac('0x54')],{})[_0x02ac('0x2d')](respondWithResult(_0x1f9d33,0xc9))[_0x02ac('0x4e')](handleError(_0x1f9d33,null));};exports[_0x02ac('0x2c')]=function(_0x570984,_0x5d0abc){if(_0x570984['body']['id']){delete _0x570984[_0x02ac('0x54')]['id'];}return db[_0x02ac('0x35')][_0x02ac('0x52')]({'where':{'id':_0x570984[_0x02ac('0x50')]['id']}})['then'](handleEntityNotFound(_0x5d0abc,null))[_0x02ac('0x2d')](saveUpdates(_0x570984[_0x02ac('0x54')],null))[_0x02ac('0x2d')](respondWithResult(_0x5d0abc,null))['catch'](handleError(_0x5d0abc,null));};exports[_0x02ac('0x2e')]=function(_0x53f7b1,_0x77c742){return db[_0x02ac('0x35')]['find']({'where':{'id':_0x53f7b1[_0x02ac('0x50')]['id']}})[_0x02ac('0x2d')](handleEntityNotFound(_0x77c742,null))[_0x02ac('0x2d')](removeEntity(_0x77c742,null))['catch'](handleError(_0x77c742,null));};exports[_0x02ac('0x55')]=function(_0x27a384,_0x11d904){return db['VoiceQueueReport'][_0x02ac('0x55')]()[_0x02ac('0x2d')](respondWithResult(_0x11d904,null))[_0x02ac('0x4e')](handleError(_0x11d904,null));};exports[_0x02ac('0x56')]=function(_0xc6c12,_0x4f822a){var _0x57ccca={},_0x357081={},_0x572c8b={'count':0x0,'rows':[]};_0x357081[_0x02ac('0x39')]=_[_0x02ac('0x51')](db[_0x02ac('0x35')]['rawAttributes']);_0x357081[_0x02ac('0x3a')]=_[_0x02ac('0x51')](_0xc6c12[_0x02ac('0x3a')]);_0x357081[_0x02ac('0x3b')]=_['intersection'](_0x357081[_0x02ac('0x39')],_0x357081[_0x02ac('0x3a')]);_0x57ccca[_0x02ac('0x3c')]=_[_0x02ac('0x3d')](_0x357081[_0x02ac('0x39')],qs[_0x02ac('0x3e')](_0xc6c12[_0x02ac('0x3a')][_0x02ac('0x3e')]));_0x57ccca[_0x02ac('0x3c')]=_0x57ccca['attributes'][_0x02ac('0x3f')]?_0x57ccca[_0x02ac('0x3c')]:_0x357081['model'];if(!_0xc6c12[_0x02ac('0x3a')][_0x02ac('0x40')](_0x02ac('0x41'))){_0x57ccca[_0x02ac('0x26')]=qs[_0x02ac('0x26')](_0xc6c12['query']['limit']);_0x57ccca[_0x02ac('0x24')]=qs[_0x02ac('0x24')](_0xc6c12[_0x02ac('0x3a')]['offset']);}_0x57ccca[_0x02ac('0x57')]=qs[_0x02ac('0x42')](_0xc6c12[_0x02ac('0x3a')][_0x02ac('0x42')]);_0x57ccca[_0x02ac('0x43')]=qs[_0x02ac('0x3b')](_[_0x02ac('0x44')](_0xc6c12[_0x02ac('0x3a')],_0x357081[_0x02ac('0x3b')]));if(_0xc6c12['query'][_0x02ac('0x47')]){_0x57ccca['where']=_[_0x02ac('0x48')](_0x57ccca[_0x02ac('0x43')],{'$or':_[_0x02ac('0x34')](_0x57ccca[_0x02ac('0x3c')],function(_0x396180){var _0x474814={};_0x474814[_0x396180]={'$like':'%'+_0xc6c12[_0x02ac('0x3a')]['filter']+'%'};return _0x474814;})});}_0x57ccca=_[_0x02ac('0x48')]({},_0x57ccca,_0xc6c12[_0x02ac('0x49')]);var _0x3d266f={'where':_0x57ccca['where']};return db[_0x02ac('0x35')][_0x02ac('0x27')](_0x3d266f)[_0x02ac('0x2d')](function(_0x3f01e0){_0x572c8b[_0x02ac('0x27')]=_0x3f01e0;if(_0xc6c12[_0x02ac('0x3a')]['includeAll']){_0x57ccca[_0x02ac('0x4b')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x02ac('0x4c')](_0x57ccca);})[_0x02ac('0x2d')](function(_0x2908fb){_0x572c8b['rows']=_0x2908fb;return _0x572c8b;})['then'](respondWithFilteredResult(_0x4f822a,_0x57ccca,_0x02ac('0x56')))[_0x02ac('0x4e')](handleError(_0x4f822a,null,'getVoiceQueuesReport'));}; \ No newline at end of file +var _0xef72=['bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','error','stack','name','send','VoiceQueueReport','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','pick','filter','where','VIRTUAL','merge','options','rows','catch','rawAttributes','includeAll','find','body','params','describe','getVoiceQueuesReport','order','sort','include','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x144c21,_0x4ccacb){var _0x169f1e=function(_0x2b3282){while(--_0x2b3282){_0x144c21['push'](_0x144c21['shift']());}};_0x169f1e(++_0x4ccacb);}(_0xef72,0x98));var _0x2ef7=function(_0x44b773,_0x56699b){_0x44b773=_0x44b773-0x0;var _0x2410ed=_0xef72[_0x44b773];return _0x2410ed;};'use strict';var emlformat=require(_0x2ef7('0x0'));var rimraf=require(_0x2ef7('0x1'));var zipdir=require(_0x2ef7('0x2'));var jsonpatch=require(_0x2ef7('0x3'));var rp=require(_0x2ef7('0x4'));var moment=require(_0x2ef7('0x5'));var BPromise=require(_0x2ef7('0x6'));var Mustache=require(_0x2ef7('0x7'));var util=require(_0x2ef7('0x8'));var path=require(_0x2ef7('0x9'));var sox=require('sox');var csv=require(_0x2ef7('0xa'));var ejs=require(_0x2ef7('0xb'));var fs=require('fs');var fs_extra=require(_0x2ef7('0xc'));var _=require('lodash');var squel=require(_0x2ef7('0xd'));var crypto=require('crypto');var jsforce=require(_0x2ef7('0xe'));var deskjs=require(_0x2ef7('0xf'));var toCsv=require(_0x2ef7('0xa'));var querystring=require(_0x2ef7('0x10'));var Papa=require(_0x2ef7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2ef7('0x12'));var as=require(_0x2ef7('0x13'));var hardwareService=require(_0x2ef7('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x2ef7('0x15'))['db'];config[_0x2ef7('0x16')]=_[_0x2ef7('0x17')](config[_0x2ef7('0x16')],{'host':_0x2ef7('0x18'),'port':0x18eb});var socket=require(_0x2ef7('0x19'))(new Redis(config['redis']));require(_0x2ef7('0x1a'))[_0x2ef7('0x1b')](socket);function respondWithStatusCode(_0x117363,_0x12d81f){_0x12d81f=_0x12d81f||0xcc;return function(_0x99740e){if(_0x99740e){return _0x117363[_0x2ef7('0x1c')](_0x12d81f);}return _0x117363[_0x2ef7('0x1d')](_0x12d81f)[_0x2ef7('0x1e')]();};}function respondWithResult(_0x1fe213,_0x3d7d99){_0x3d7d99=_0x3d7d99||0xc8;return function(_0x21b2b7){if(_0x21b2b7){return _0x1fe213[_0x2ef7('0x1d')](_0x3d7d99)[_0x2ef7('0x1f')](_0x21b2b7);}};}function respondWithFilteredResult(_0x167253,_0x48d021){return function(_0x208231){if(_0x208231){var _0x2ab2c0=typeof _0x48d021[_0x2ef7('0x20')]===_0x2ef7('0x21')&&typeof _0x48d021[_0x2ef7('0x22')]===_0x2ef7('0x21');var _0x2a7238=_0x208231['count'];var _0x16e718=_0x2ab2c0?0x0:_0x48d021[_0x2ef7('0x20')];var _0x576fba=_0x2ab2c0?_0x208231[_0x2ef7('0x23')]:_0x48d021[_0x2ef7('0x20')]+_0x48d021[_0x2ef7('0x22')];var _0x57b7a9;if(_0x576fba>=_0x2a7238){_0x576fba=_0x2a7238;_0x57b7a9=0xc8;}else{_0x57b7a9=0xce;}_0x167253[_0x2ef7('0x1d')](_0x57b7a9);return _0x167253[_0x2ef7('0x24')](_0x2ef7('0x25'),_0x16e718+'-'+_0x576fba+'/'+_0x2a7238)[_0x2ef7('0x1f')](_0x208231);}return null;};}function patchUpdates(_0x86f27){return function(_0x51c001){try{jsonpatch['apply'](_0x51c001,_0x86f27,!![]);}catch(_0x5d982f){return BPromise[_0x2ef7('0x26')](_0x5d982f);}return _0x51c001['save']();};}function saveUpdates(_0x5da46e,_0x1bce13){return function(_0x584ec6){if(_0x584ec6){return _0x584ec6[_0x2ef7('0x27')](_0x5da46e)[_0x2ef7('0x28')](function(_0x20aa60){return _0x20aa60;});}return null;};}function removeEntity(_0x3bc5c7,_0x4de90b){return function(_0x38d3ca){if(_0x38d3ca){return _0x38d3ca[_0x2ef7('0x29')]()[_0x2ef7('0x28')](function(){_0x3bc5c7[_0x2ef7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33c501,_0x50d631){return function(_0xb58d2c){if(!_0xb58d2c){_0x33c501[_0x2ef7('0x1c')](0x194);}return _0xb58d2c;};}function handleError(_0x4432cf,_0xc01ec1){_0xc01ec1=_0xc01ec1||0x1f4;return function(_0x405ea3){logger[_0x2ef7('0x2a')](_0x405ea3[_0x2ef7('0x2b')]);if(_0x405ea3['name']){delete _0x405ea3[_0x2ef7('0x2c')];}_0x4432cf['status'](_0xc01ec1)[_0x2ef7('0x2d')](_0x405ea3);};}exports['index']=function(_0x1b23cf,_0xc83edb){var _0xd6d243={},_0x42239e={},_0x365a68={'count':0x0,'rows':[]};var _0x5bfd5a=_['map'](db[_0x2ef7('0x2e')]['rawAttributes'],function(_0x172fbb){return{'name':_0x172fbb[_0x2ef7('0x2f')],'type':_0x172fbb[_0x2ef7('0x30')]['key']};});_0x42239e['model']=_[_0x2ef7('0x31')](_0x5bfd5a,_0x2ef7('0x2c'));_0x42239e[_0x2ef7('0x32')]=_[_0x2ef7('0x33')](_0x1b23cf[_0x2ef7('0x32')]);_0x42239e[_0x2ef7('0x34')]=_[_0x2ef7('0x35')](_0x42239e[_0x2ef7('0x36')],_0x42239e[_0x2ef7('0x32')]);_0xd6d243[_0x2ef7('0x37')]=_[_0x2ef7('0x35')](_0x42239e[_0x2ef7('0x36')],qs['fields'](_0x1b23cf['query'][_0x2ef7('0x38')]));_0xd6d243[_0x2ef7('0x37')]=_0xd6d243[_0x2ef7('0x37')][_0x2ef7('0x39')]?_0xd6d243[_0x2ef7('0x37')]:_0x42239e[_0x2ef7('0x36')];if(!_0x1b23cf[_0x2ef7('0x32')][_0x2ef7('0x3a')](_0x2ef7('0x3b'))){_0xd6d243['limit']=qs[_0x2ef7('0x22')](_0x1b23cf[_0x2ef7('0x32')][_0x2ef7('0x22')]);_0xd6d243[_0x2ef7('0x20')]=qs[_0x2ef7('0x20')](_0x1b23cf['query'][_0x2ef7('0x20')]);}_0xd6d243['order']=qs['sort'](_0x1b23cf[_0x2ef7('0x32')]['sort']);_0xd6d243['where']=qs['filters'](_[_0x2ef7('0x3c')](_0x1b23cf[_0x2ef7('0x32')],_0x42239e['filters']),_0x5bfd5a);if(_0x1b23cf[_0x2ef7('0x32')][_0x2ef7('0x3d')]){_0xd6d243[_0x2ef7('0x3e')]=_['merge'](_0xd6d243[_0x2ef7('0x3e')],{'$or':_['map'](_0x5bfd5a,function(_0x3ebfa9){if(_0x3ebfa9['type']!==_0x2ef7('0x3f')){var _0x1924af={};_0x1924af[_0x3ebfa9[_0x2ef7('0x2c')]]={'$like':'%'+_0x1b23cf[_0x2ef7('0x32')][_0x2ef7('0x3d')]+'%'};return _0x1924af;}})});}_0xd6d243=_[_0x2ef7('0x40')]({},_0xd6d243,_0x1b23cf[_0x2ef7('0x41')]);var _0x30c230={'where':_0xd6d243['where']};return db[_0x2ef7('0x2e')][_0x2ef7('0x23')](_0x30c230)[_0x2ef7('0x28')](function(_0x284c7f){_0x365a68[_0x2ef7('0x23')]=_0x284c7f;if(_0x1b23cf['query']['includeAll']){_0xd6d243['include']=[{'all':!![]}];}return db[_0x2ef7('0x2e')]['findAll'](_0xd6d243);})[_0x2ef7('0x28')](function(_0x5f3bd7){_0x365a68[_0x2ef7('0x42')]=_0x5f3bd7;return _0x365a68;})[_0x2ef7('0x28')](respondWithFilteredResult(_0xc83edb,_0xd6d243))[_0x2ef7('0x43')](handleError(_0xc83edb,null));};exports['show']=function(_0x50ed84,_0x4cdc99){var _0x7986a5={'raw':![],'where':{'id':_0x50ed84['params']['id']}},_0x5615f8={};_0x5615f8['model']=_['keys'](db[_0x2ef7('0x2e')][_0x2ef7('0x44')]);_0x5615f8[_0x2ef7('0x32')]=_[_0x2ef7('0x33')](_0x50ed84[_0x2ef7('0x32')]);_0x5615f8[_0x2ef7('0x34')]=_[_0x2ef7('0x35')](_0x5615f8[_0x2ef7('0x36')],_0x5615f8[_0x2ef7('0x32')]);_0x7986a5['attributes']=_['intersection'](_0x5615f8['model'],qs[_0x2ef7('0x38')](_0x50ed84[_0x2ef7('0x32')][_0x2ef7('0x38')]));_0x7986a5['attributes']=_0x7986a5['attributes'][_0x2ef7('0x39')]?_0x7986a5[_0x2ef7('0x37')]:_0x5615f8[_0x2ef7('0x36')];if(_0x50ed84[_0x2ef7('0x32')][_0x2ef7('0x45')]){_0x7986a5['include']=[{'all':!![]}];}_0x7986a5=_[_0x2ef7('0x40')]({},_0x7986a5,_0x50ed84[_0x2ef7('0x41')]);return db['VoiceQueueReport'][_0x2ef7('0x46')](_0x7986a5)[_0x2ef7('0x28')](handleEntityNotFound(_0x4cdc99,null))['then'](respondWithResult(_0x4cdc99,null))[_0x2ef7('0x43')](handleError(_0x4cdc99,null));};exports['create']=function(_0x16eb4b,_0x461f77){return db[_0x2ef7('0x2e')]['create'](_0x16eb4b[_0x2ef7('0x47')],{})[_0x2ef7('0x28')](respondWithResult(_0x461f77,0xc9))['catch'](handleError(_0x461f77,null));};exports[_0x2ef7('0x27')]=function(_0x27892e,_0x345266){if(_0x27892e[_0x2ef7('0x47')]['id']){delete _0x27892e[_0x2ef7('0x47')]['id'];}return db[_0x2ef7('0x2e')][_0x2ef7('0x46')]({'where':{'id':_0x27892e['params']['id']}})[_0x2ef7('0x28')](handleEntityNotFound(_0x345266,null))[_0x2ef7('0x28')](saveUpdates(_0x27892e[_0x2ef7('0x47')],null))['then'](respondWithResult(_0x345266,null))[_0x2ef7('0x43')](handleError(_0x345266,null));};exports[_0x2ef7('0x29')]=function(_0x135ae3,_0x1370fe){return db[_0x2ef7('0x2e')]['find']({'where':{'id':_0x135ae3[_0x2ef7('0x48')]['id']}})[_0x2ef7('0x28')](handleEntityNotFound(_0x1370fe,null))[_0x2ef7('0x28')](removeEntity(_0x1370fe,null))[_0x2ef7('0x43')](handleError(_0x1370fe,null));};exports[_0x2ef7('0x49')]=function(_0x2062d5,_0x165ac9){return db[_0x2ef7('0x2e')][_0x2ef7('0x49')]()[_0x2ef7('0x28')](respondWithResult(_0x165ac9,null))[_0x2ef7('0x43')](handleError(_0x165ac9,null));};exports[_0x2ef7('0x4a')]=function(_0x24c4c8,_0x2db8a9){var _0x3e3760={},_0x26854f={},_0x3eacde={'count':0x0,'rows':[]};_0x26854f[_0x2ef7('0x36')]=_[_0x2ef7('0x33')](db[_0x2ef7('0x2e')]['rawAttributes']);_0x26854f[_0x2ef7('0x32')]=_[_0x2ef7('0x33')](_0x24c4c8[_0x2ef7('0x32')]);_0x26854f[_0x2ef7('0x34')]=_[_0x2ef7('0x35')](_0x26854f[_0x2ef7('0x36')],_0x26854f[_0x2ef7('0x32')]);_0x3e3760[_0x2ef7('0x37')]=_[_0x2ef7('0x35')](_0x26854f[_0x2ef7('0x36')],qs['fields'](_0x24c4c8['query'][_0x2ef7('0x38')]));_0x3e3760[_0x2ef7('0x37')]=_0x3e3760['attributes'][_0x2ef7('0x39')]?_0x3e3760[_0x2ef7('0x37')]:_0x26854f['model'];if(!_0x24c4c8[_0x2ef7('0x32')][_0x2ef7('0x3a')](_0x2ef7('0x3b'))){_0x3e3760[_0x2ef7('0x22')]=qs[_0x2ef7('0x22')](_0x24c4c8[_0x2ef7('0x32')]['limit']);_0x3e3760['offset']=qs[_0x2ef7('0x20')](_0x24c4c8[_0x2ef7('0x32')][_0x2ef7('0x20')]);}_0x3e3760[_0x2ef7('0x4b')]=qs[_0x2ef7('0x4c')](_0x24c4c8[_0x2ef7('0x32')][_0x2ef7('0x4c')]);_0x3e3760[_0x2ef7('0x3e')]=qs[_0x2ef7('0x34')](_['pick'](_0x24c4c8[_0x2ef7('0x32')],_0x26854f[_0x2ef7('0x34')]));if(_0x24c4c8['query'][_0x2ef7('0x3d')]){_0x3e3760['where']=_[_0x2ef7('0x40')](_0x3e3760[_0x2ef7('0x3e')],{'$or':_[_0x2ef7('0x31')](_0x3e3760[_0x2ef7('0x37')],function(_0x55966d){var _0x31b27d={};_0x31b27d[_0x55966d]={'$like':'%'+_0x24c4c8[_0x2ef7('0x32')]['filter']+'%'};return _0x31b27d;})});}_0x3e3760=_['merge']({},_0x3e3760,_0x24c4c8['options']);var _0xe0a7fb={'where':_0x3e3760['where']};return db[_0x2ef7('0x2e')][_0x2ef7('0x23')](_0xe0a7fb)['then'](function(_0x119039){_0x3eacde[_0x2ef7('0x23')]=_0x119039;if(_0x24c4c8[_0x2ef7('0x32')]['includeAll']){_0x3e3760[_0x2ef7('0x4d')]=[{'all':!![]}];}return db[_0x2ef7('0x2e')][_0x2ef7('0x4e')](_0x3e3760);})[_0x2ef7('0x28')](function(_0x335b7d){_0x3eacde['rows']=_0x335b7d;return _0x3eacde;})[_0x2ef7('0x28')](respondWithFilteredResult(_0x2db8a9,_0x3e3760,_0x2ef7('0x4a')))[_0x2ef7('0x43')](handleError(_0x2db8a9,null,_0x2ef7('0x4a')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index d5b76b4..ca4d124 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 _0x3fdd=['hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport','update','emit'];(function(_0x3a7765,_0x2c6152){var _0x39b7a0=function(_0x31df52){while(--_0x31df52){_0x3a7765['push'](_0x3a7765['shift']());}};_0x39b7a0(++_0x2c6152);}(_0x3fdd,0x14b));var _0xd3fd=function(_0x524d03,_0x3aa64b){_0x524d03=_0x524d03-0x0;var _0x1885cd=_0x3fdd[_0x524d03];return _0x1885cd;};'use strict';var EventEmitter=require(_0xd3fd('0x0'));var VoiceQueueReport=require(_0xd3fd('0x1'))['db'][_0xd3fd('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3fd('0x3'),'afterDestroy':'remove'};function emitEvent(_0x48a9e9){return function(_0xa77d7b,_0x46c052,_0x30ef9f){VoiceQueueReportEvents['emit'](_0x48a9e9+':'+_0xa77d7b['id'],_0xa77d7b);VoiceQueueReportEvents[_0xd3fd('0x4')](_0x48a9e9,_0xa77d7b);_0x30ef9f(null);};}for(var e in events){if(events[_0xd3fd('0x5')](e)){var event=events[e];VoiceQueueReport[_0xd3fd('0x6')](e,emitEvent(event));}}module[_0xd3fd('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x566e=['emit','setMaxListeners','update','remove'];(function(_0x1f6553,_0x278aa0){var _0x5206da=function(_0x22510d){while(--_0x22510d){_0x1f6553['push'](_0x1f6553['shift']());}};_0x5206da(++_0x278aa0);}(_0x566e,0x161));var _0xe566=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x566e[_0x4ae6ef];return _0x3cbb4e;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xe566('0x0')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe566('0x1'),'afterDestroy':_0xe566('0x2')};function emitEvent(_0xf21869){return function(_0x1436c0,_0x372ca6,_0x5bf29f){VoiceQueueReportEvents[_0xe566('0x3')](_0xf21869+':'+_0x1436c0['id'],_0x1436c0);VoiceQueueReportEvents[_0xe566('0x3')](_0xf21869,_0x1436c0);_0x5bf29f(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 diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index ed51518..3aaa5fa 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 _0xf2eb=['request-promise','path','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x53d2f6,_0x2a467a){var _0x5b6b27=function(_0x18e10c){while(--_0x18e10c){_0x53d2f6['push'](_0x53d2f6['shift']());}};_0x5b6b27(++_0x2a467a);}(_0xf2eb,0x13c));var _0xbf2e=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xf2eb[_0x34021d];return _0x16597b;};'use strict';var _=require(_0xbf2e('0x0'));var util=require(_0xbf2e('0x1'));var logger=require(_0xbf2e('0x2'))(_0xbf2e('0x3'));var moment=require(_0xbf2e('0x4'));var BPromise=require(_0xbf2e('0x5'));var rp=require(_0xbf2e('0x6'));var fs=require('fs');var path=require(_0xbf2e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbf2e('0x8'));module[_0xbf2e('0x9')]=function(_0x23cd74,_0x27b2d3){return _0x23cd74[_0xbf2e('0xa')]('VoiceQueueReport',attributes,{'tableName':_0xbf2e('0xb'),'paranoid':![],'indexes':[{'fields':[_0xbf2e('0xc')]},{'fields':[_0xbf2e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1e19=['util','api','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define','report_queue','uniqueid'];(function(_0x11cbc6,_0x491855){var _0x425f5c=function(_0x4986c3){while(--_0x4986c3){_0x11cbc6['push'](_0x11cbc6['shift']());}};_0x425f5c(++_0x491855);}(_0x1e19,0x172));var _0x91e1=function(_0x4b3cf7,_0x58681c){_0x4b3cf7=_0x4b3cf7-0x0;var _0x586b94=_0x1e19[_0x4b3cf7];return _0x586b94;};'use strict';var _=require('lodash');var util=require(_0x91e1('0x0'));var logger=require('../../config/logger')(_0x91e1('0x1'));var moment=require('moment');var BPromise=require(_0x91e1('0x2'));var rp=require(_0x91e1('0x3'));var fs=require('fs');var path=require(_0x91e1('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x91e1('0x5'));module[_0x91e1('0x6')]=function(_0x4f7966,_0x1cb28f){return _0x4f7966[_0x91e1('0x7')]('VoiceQueueReport',attributes,{'tableName':_0x91e1('0x8'),'paranoid':![],'indexes':[{'fields':[_0x91e1('0x9')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 314c052..bb4afd9 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 _0x8945=['CreateVoiceQueueReport','UpdateVoiceQueueReport','update','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','then','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','catch','VoiceQueueReport','create','body'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x8945,0x153));var _0x5894=function(_0xe568dc,_0x5aaff9){_0xe568dc=_0xe568dc-0x0;var _0x226c90=_0x8945[_0xe568dc];return _0x226c90;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5894('0x0'));var BPromise=require(_0x5894('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5894('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5894('0x3'));var logger=require(_0x5894('0x4'))(_0x5894('0x5'));var config=require(_0x5894('0x6'));var jayson=require(_0x5894('0x7'));var client=jayson[_0x5894('0x8')][_0x5894('0x9')]({'port':0x232a});config[_0x5894('0xa')]=_[_0x5894('0xb')](config[_0x5894('0xa')],{'host':_0x5894('0xc'),'port':0x18eb});var socket=require(_0x5894('0xd'))(new Redis(config['redis']));require(_0x5894('0xe'))['register'](socket);function respondWithRpcPromise(_0x263c8f,_0x5b1a39,_0x1a92bc){return new BPromise(function(_0x21c269,_0x2b7b1a){return client['request'](_0x263c8f,_0x1a92bc)[_0x5894('0xf')](function(_0x2ce993){logger['info'](_0x5894('0x10'),_0x5b1a39,_0x5894('0x11'));logger[_0x5894('0x12')](_0x5894('0x13'),_0x5b1a39,'request\x20sent',JSON[_0x5894('0x14')](_0x2ce993));if(_0x2ce993['error']){if(_0x2ce993[_0x5894('0x15')]['code']===0x1f4){logger[_0x5894('0x15')](_0x5894('0x10'),_0x5b1a39,_0x2ce993[_0x5894('0x15')]['message']);return _0x2b7b1a(_0x2ce993['error'][_0x5894('0x16')]);}logger[_0x5894('0x15')](_0x5894('0x10'),_0x5b1a39,_0x2ce993[_0x5894('0x15')][_0x5894('0x16')]);return _0x21c269(_0x2ce993[_0x5894('0x15')][_0x5894('0x16')]);}else{logger[_0x5894('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x5b1a39,_0x5894('0x11'));_0x21c269(_0x2ce993[_0x5894('0x18')][_0x5894('0x16')]);}})['catch'](function(_0x373ffb){logger[_0x5894('0x15')](_0x5894('0x10'),_0x5b1a39,_0x373ffb);_0x2b7b1a(_0x373ffb);});});}exports[_0x5894('0x19')]=function(_0x1d2662){var _0xf8e42a=this;return new Promise(function(_0x518e8e,_0x33b96e){return db['VoiceQueueReport'][_0x5894('0x1a')]({'raw':_0x1d2662[_0x5894('0x1b')]?_0x1d2662[_0x5894('0x1b')][_0x5894('0x1c')]===undefined?!![]:![]:!![],'where':_0x1d2662[_0x5894('0x1b')]?_0x1d2662[_0x5894('0x1b')][_0x5894('0x1d')]||null:null,'attributes':_0x1d2662['options']?_0x1d2662[_0x5894('0x1b')][_0x5894('0x1e')]||null:null,'limit':_0x1d2662[_0x5894('0x1b')]?_0x1d2662[_0x5894('0x1b')][_0x5894('0x1f')]||null:null,'include':_0x1d2662['options']?_0x1d2662[_0x5894('0x1b')][_0x5894('0x20')]?_[_0x5894('0x21')](_0x1d2662[_0x5894('0x1b')][_0x5894('0x20')],function(_0x10de34){return{'model':db[_0x10de34[_0x5894('0x22')]],'as':_0x10de34['as'],'attributes':_0x10de34[_0x5894('0x1e')],'include':_0x10de34['include']?_[_0x5894('0x21')](_0x10de34[_0x5894('0x20')],function(_0x334628){return{'model':db[_0x334628[_0x5894('0x22')]],'as':_0x334628['as'],'attributes':_0x334628['attributes'],'include':_0x334628[_0x5894('0x20')]?_[_0x5894('0x21')](_0x334628[_0x5894('0x20')],function(_0x51147c){return{'model':db[_0x51147c[_0x5894('0x22')]],'as':_0x51147c['as'],'attributes':_0x51147c[_0x5894('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5894('0xf')](function(_0x45aab0){logger['info'](_0x5894('0x19'),_0x1d2662);logger[_0x5894('0x12')](_0x5894('0x19'),_0x1d2662,JSON[_0x5894('0x14')](_0x45aab0));_0x518e8e(_0x45aab0);})[_0x5894('0x23')](function(_0x14f99a){logger[_0x5894('0x15')]('GetVoiceQueueReport',_0x14f99a['message'],_0x1d2662);_0x33b96e(_0xf8e42a['error'](0x1f4,_0x14f99a[_0x5894('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x11ca24){var _0x58804b=this;return new Promise(function(_0x3ae887,_0x466d78){return db[_0x5894('0x24')][_0x5894('0x25')](_0x11ca24[_0x5894('0x26')],{'raw':_0x11ca24[_0x5894('0x1b')]?_0x11ca24['options'][_0x5894('0x1c')]===undefined?!![]:![]:!![]})[_0x5894('0xf')](function(_0x317cb8){logger[_0x5894('0x17')](_0x5894('0x27'),_0x11ca24);logger[_0x5894('0x12')](_0x5894('0x27'),_0x11ca24,JSON[_0x5894('0x14')](_0x317cb8));_0x3ae887(_0x317cb8);})[_0x5894('0x23')](function(_0xfedf49){logger[_0x5894('0x15')]('CreateVoiceQueueReport',_0xfedf49['message'],_0x11ca24);_0x466d78(_0x58804b[_0x5894('0x15')](0x1f4,_0xfedf49[_0x5894('0x16')]));});});};exports[_0x5894('0x28')]=function(_0x50799a){var _0x26ac30=this;return new Promise(function(_0x4bcd0f,_0x28b387){return db[_0x5894('0x24')][_0x5894('0x29')](_0x50799a['body'],{'raw':_0x50799a[_0x5894('0x1b')]?_0x50799a[_0x5894('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50799a[_0x5894('0x1b')]?_0x50799a[_0x5894('0x1b')][_0x5894('0x1d')]||null:null,'attributes':_0x50799a[_0x5894('0x1b')]?_0x50799a['options'][_0x5894('0x1e')]||null:null,'limit':_0x50799a[_0x5894('0x1b')]?_0x50799a[_0x5894('0x1b')][_0x5894('0x1f')]||null:null})['then'](function(_0x42f586){logger[_0x5894('0x17')](_0x5894('0x28'),_0x50799a);logger[_0x5894('0x12')](_0x5894('0x28'),_0x50799a,JSON[_0x5894('0x14')](_0x42f586));_0x4bcd0f(_0x42f586);})['catch'](function(_0x38ac58){logger[_0x5894('0x15')](_0x5894('0x28'),_0x38ac58[_0x5894('0x16')],_0x50799a);_0x28b387(_0x26ac30[_0x5894('0x15')](0x1f4,_0x38ac58[_0x5894('0x16')]));});});}; \ No newline at end of file +var _0xb965=['error','message','request\x20sent','result','catch','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','debug','GetVoiceQueueReport','stringify','CreateVoiceQueueReport','create','UpdateVoiceQueueReport','update','body','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x44f91e,_0x47e2eb){var _0x33a0bd=function(_0x6e7327){while(--_0x6e7327){_0x44f91e['push'](_0x44f91e['shift']());}};_0x33a0bd(++_0x47e2eb);}(_0xb965,0xb2));var _0x5b96=function(_0x8712b7,_0x35660a){_0x8712b7=_0x8712b7-0x0;var _0x45d4ee=_0xb965[_0x8712b7];return _0x45d4ee;};'use strict';var _=require('lodash');var util=require(_0x5b96('0x0'));var moment=require(_0x5b96('0x1'));var BPromise=require(_0x5b96('0x2'));var rs=require(_0x5b96('0x3'));var fs=require('fs');var Redis=require(_0x5b96('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5b96('0x5'))(_0x5b96('0x6'));var config=require(_0x5b96('0x7'));var jayson=require(_0x5b96('0x8'));var client=jayson[_0x5b96('0x9')]['http']({'port':0x232a});config[_0x5b96('0xa')]=_['defaults'](config[_0x5b96('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5b96('0xa')]));require(_0x5b96('0xb'))[_0x5b96('0xc')](socket);function respondWithRpcPromise(_0x39b6e8,_0x16c98a,_0x7b46cf){return new BPromise(function(_0x4e2bf8,_0x23a5af){return client['request'](_0x39b6e8,_0x7b46cf)[_0x5b96('0xd')](function(_0x1009f3){logger[_0x5b96('0xe')](_0x5b96('0xf'),_0x16c98a,'request\x20sent');logger['debug'](_0x5b96('0x10'),_0x16c98a,'request\x20sent',JSON['stringify'](_0x1009f3));if(_0x1009f3['error']){if(_0x1009f3[_0x5b96('0x11')]['code']===0x1f4){logger[_0x5b96('0x11')](_0x5b96('0xf'),_0x16c98a,_0x1009f3[_0x5b96('0x11')][_0x5b96('0x12')]);return _0x23a5af(_0x1009f3[_0x5b96('0x11')][_0x5b96('0x12')]);}logger[_0x5b96('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x16c98a,_0x1009f3[_0x5b96('0x11')]['message']);return _0x4e2bf8(_0x1009f3[_0x5b96('0x11')][_0x5b96('0x12')]);}else{logger['info'](_0x5b96('0xf'),_0x16c98a,_0x5b96('0x13'));_0x4e2bf8(_0x1009f3[_0x5b96('0x14')][_0x5b96('0x12')]);}})[_0x5b96('0x15')](function(_0x3189a4){logger[_0x5b96('0x11')](_0x5b96('0xf'),_0x16c98a,_0x3189a4);_0x23a5af(_0x3189a4);});});}exports['GetVoiceQueueReport']=function(_0x4828b3){var _0x5a695a=this;return new Promise(function(_0x5307cf,_0x10947a){return db[_0x5b96('0x16')]['findAll']({'raw':_0x4828b3['options']?_0x4828b3[_0x5b96('0x17')][_0x5b96('0x18')]===undefined?!![]:![]:!![],'where':_0x4828b3['options']?_0x4828b3[_0x5b96('0x17')][_0x5b96('0x19')]||null:null,'attributes':_0x4828b3[_0x5b96('0x17')]?_0x4828b3[_0x5b96('0x17')][_0x5b96('0x1a')]||null:null,'limit':_0x4828b3[_0x5b96('0x17')]?_0x4828b3[_0x5b96('0x17')][_0x5b96('0x1b')]||null:null,'include':_0x4828b3[_0x5b96('0x17')]?_0x4828b3['options'][_0x5b96('0x1c')]?_[_0x5b96('0x1d')](_0x4828b3[_0x5b96('0x17')][_0x5b96('0x1c')],function(_0x12d560){return{'model':db[_0x12d560['model']],'as':_0x12d560['as'],'attributes':_0x12d560[_0x5b96('0x1a')],'include':_0x12d560[_0x5b96('0x1c')]?_[_0x5b96('0x1d')](_0x12d560['include'],function(_0x4221ee){return{'model':db[_0x4221ee['model']],'as':_0x4221ee['as'],'attributes':_0x4221ee[_0x5b96('0x1a')],'include':_0x4221ee['include']?_['map'](_0x4221ee['include'],function(_0x2c9d14){return{'model':db[_0x2c9d14[_0x5b96('0x1e')]],'as':_0x2c9d14['as'],'attributes':_0x2c9d14[_0x5b96('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5b96('0xd')](function(_0x294665){logger[_0x5b96('0xe')]('GetVoiceQueueReport',_0x4828b3);logger[_0x5b96('0x1f')](_0x5b96('0x20'),_0x4828b3,JSON[_0x5b96('0x21')](_0x294665));_0x5307cf(_0x294665);})['catch'](function(_0x53906f){logger[_0x5b96('0x11')]('GetVoiceQueueReport',_0x53906f['message'],_0x4828b3);_0x10947a(_0x5a695a[_0x5b96('0x11')](0x1f4,_0x53906f[_0x5b96('0x12')]));});});};exports[_0x5b96('0x22')]=function(_0x3b5717){var _0x38d692=this;return new Promise(function(_0x948fa8,_0x449b27){return db[_0x5b96('0x16')][_0x5b96('0x23')](_0x3b5717['body'],{'raw':_0x3b5717[_0x5b96('0x17')]?_0x3b5717[_0x5b96('0x17')][_0x5b96('0x18')]===undefined?!![]:![]:!![]})[_0x5b96('0xd')](function(_0x5e678b){logger['info'](_0x5b96('0x22'),_0x3b5717);logger[_0x5b96('0x1f')]('CreateVoiceQueueReport',_0x3b5717,JSON[_0x5b96('0x21')](_0x5e678b));_0x948fa8(_0x5e678b);})[_0x5b96('0x15')](function(_0x406fe8){logger[_0x5b96('0x11')](_0x5b96('0x22'),_0x406fe8[_0x5b96('0x12')],_0x3b5717);_0x449b27(_0x38d692[_0x5b96('0x11')](0x1f4,_0x406fe8['message']));});});};exports[_0x5b96('0x24')]=function(_0x21626c){var _0x50f039=this;return new Promise(function(_0x256462,_0x417f2a){return db['VoiceQueueReport'][_0x5b96('0x25')](_0x21626c[_0x5b96('0x26')],{'raw':_0x21626c[_0x5b96('0x17')]?_0x21626c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x21626c[_0x5b96('0x17')]?_0x21626c[_0x5b96('0x17')][_0x5b96('0x19')]||null:null,'attributes':_0x21626c['options']?_0x21626c[_0x5b96('0x17')][_0x5b96('0x1a')]||null:null,'limit':_0x21626c[_0x5b96('0x17')]?_0x21626c[_0x5b96('0x17')]['limit']||null:null})['then'](function(_0x11e7db){logger[_0x5b96('0xe')](_0x5b96('0x24'),_0x21626c);logger[_0x5b96('0x1f')]('UpdateVoiceQueueReport',_0x21626c,JSON[_0x5b96('0x21')](_0x11e7db));_0x256462(_0x11e7db);})['catch'](function(_0x35f3ac){logger['error'](_0x5b96('0x24'),_0x35f3ac[_0x5b96('0x12')],_0x21626c);_0x417f2a(_0x50f039[_0x5b96('0x11')](0x1f4,_0x35f3ac['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 057495a..3de2c8d 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 _0x3468=['voiceQueueReport:','./voiceQueueReport.events','update','emit','length'];(function(_0x2c93cb,_0x5d79a9){var _0x40e855=function(_0x286640){while(--_0x286640){_0x2c93cb['push'](_0x2c93cb['shift']());}};_0x40e855(++_0x5d79a9);}(_0x3468,0x8d));var _0x8346=function(_0x284176,_0x3b09fc){_0x284176=_0x284176-0x0;var _0x1740dd=_0x3468[_0x284176];return _0x1740dd;};'use strict';var VoiceQueueReportEvents=require(_0x8346('0x0'));var events=['save','remove',_0x8346('0x1')];function createListener(_0x584cd0,_0x47b806){return function(_0x7207cc){_0x47b806[_0x8346('0x2')](_0x584cd0,_0x7207cc);};}function removeListener(_0x4082b5,_0x5a5f46){return function(){VoiceQueueReportEvents['removeListener'](_0x4082b5,_0x5a5f46);};}exports['register']=function(_0x2fc584){for(var _0x52f1be=0x0,_0x25d86e=events[_0x8346('0x3')];_0x52f1be<_0x25d86e;_0x52f1be++){var _0xb88b69=events[_0x52f1be];var _0x2a3029=createListener(_0x8346('0x4')+_0xb88b69,_0x2fc584);VoiceQueueReportEvents['on'](_0xb88b69,_0x2a3029);}}; \ No newline at end of file +var _0x63b6=['./voiceQueueReport.events','save','remove','removeListener','voiceQueueReport:'];(function(_0x1b4b23,_0x5dd6d6){var _0x2a325b=function(_0x175462){while(--_0x175462){_0x1b4b23['push'](_0x1b4b23['shift']());}};_0x2a325b(++_0x5dd6d6);}(_0x63b6,0x127));var _0x663b=function(_0x31fff6,_0x561b75){_0x31fff6=_0x31fff6-0x0;var _0x59e732=_0x63b6[_0x31fff6];return _0x59e732;};'use strict';var VoiceQueueReportEvents=require(_0x663b('0x0'));var events=[_0x663b('0x1'),_0x663b('0x2'),'update'];function createListener(_0x813f8c,_0x522472){return function(_0x10dcf6){_0x522472['emit'](_0x813f8c,_0x10dcf6);};}function removeListener(_0x93bab1,_0x3e2b4b){return function(){VoiceQueueReportEvents[_0x663b('0x3')](_0x93bab1,_0x3e2b4b);};}exports['register']=function(_0x4486b1){for(var _0x57e43e=0x0,_0x210eb1=events['length'];_0x57e43e<_0x210eb1;_0x57e43e++){var _0x414dc2=events[_0x57e43e];var _0x2976ff=createListener(_0x663b('0x4')+_0x414dc2,_0x4486b1);VoiceQueueReportEvents['on'](_0x414dc2,_0x2976ff);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 2fed612..0101ef8 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 _0x38bf=['../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','Router'];(function(_0x4287e5,_0x1e9202){var _0x197b42=function(_0x171c36){while(--_0x171c36){_0x4287e5['push'](_0x4287e5['shift']());}};_0x197b42(++_0x1e9202);}(_0x38bf,0xce));var _0xf38b=function(_0x570bbf,_0x27054a){_0x570bbf=_0x570bbf-0x0;var _0x3c36a5=_0x38bf[_0x570bbf];return _0x3c36a5;};'use strict';var multer=require(_0xf38b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xf38b('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xf38b('0x2'));var interaction=require(_0xf38b('0x3'));var config=require(_0xf38b('0x4'));var controller=require('./voiceQueuesLog.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xf38b('0x5')]);router[_0xf38b('0x6')](_0xf38b('0x7'),auth[_0xf38b('0x8')](),controller[_0xf38b('0x9')]);router[_0xf38b('0xa')]('/',auth[_0xf38b('0x8')](),controller['create']);router[_0xf38b('0xb')](_0xf38b('0x7'),auth[_0xf38b('0x8')](),controller[_0xf38b('0xc')]);router[_0xf38b('0xd')](_0xf38b('0x7'),auth[_0xf38b('0x8')](),controller[_0xf38b('0xe')]);module[_0xf38b('0xf')]=router; \ No newline at end of file +var _0x1ddc=['exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','create','put','update'];(function(_0x1428d9,_0xded63c){var _0x438019=function(_0x31c37d){while(--_0x31c37d){_0x1428d9['push'](_0x1428d9['shift']());}};_0x438019(++_0xded63c);}(_0x1ddc,0x7f));var _0xc1dd=function(_0x2d93e4,_0x417086){_0x2d93e4=_0x2d93e4-0x0;var _0x146f2e=_0x1ddc[_0x2d93e4];return _0x146f2e;};'use strict';var multer=require(_0xc1dd('0x0'));var util=require(_0xc1dd('0x1'));var path=require('path');var timeout=require(_0xc1dd('0x2'));var express=require(_0xc1dd('0x3'));var router=express[_0xc1dd('0x4')]();var fs_extra=require(_0xc1dd('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xc1dd('0x6'));var config=require(_0xc1dd('0x7'));var controller=require(_0xc1dd('0x8'));router[_0xc1dd('0x9')]('/',auth[_0xc1dd('0xa')](),controller[_0xc1dd('0xb')]);router[_0xc1dd('0x9')](_0xc1dd('0xc'),auth[_0xc1dd('0xa')](),controller[_0xc1dd('0xd')]);router['post']('/',auth[_0xc1dd('0xa')](),controller[_0xc1dd('0xe')]);router[_0xc1dd('0xf')](_0xc1dd('0xc'),auth[_0xc1dd('0xa')](),controller[_0xc1dd('0x10')]);router['delete']('/:id',auth[_0xc1dd('0xa')](),controller['destroy']);module[_0xc1dd('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 96be4c3..647271d 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 _0x6b4b=['DATE','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING'];(function(_0x9c3968,_0x45c0ec){var _0x19cdf3=function(_0x4ba560){while(--_0x4ba560){_0x9c3968['push'](_0x9c3968['shift']());}};_0x19cdf3(++_0x45c0ec);}(_0x6b4b,0x88));var _0xb6b4=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x6b4b[_0x263a74];return _0x2aa86c;};'use strict';var Sequelize=require(_0xb6b4('0x0'));var moment=require(_0xb6b4('0x1'));module[_0xb6b4('0x2')]={'time':{'type':Sequelize[_0xb6b4('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xb6b4('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xb6b4('0x4')],'allowNull':![],'defaultValue':moment()[_0xb6b4('0x5')](_0xb6b4('0x6'))}}; \ No newline at end of file +var _0xe451=['exports','STRING','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5151ab,_0x5d0dd9){var _0x5b6c0a=function(_0x25b633){while(--_0x25b633){_0x5151ab['push'](_0x5151ab['shift']());}};_0x5b6c0a(++_0x5d0dd9);}(_0xe451,0xec));var _0x1e45=function(_0x1fd47f,_0x36c195){_0x1fd47f=_0x1fd47f-0x0;var _0x5ed952=_0xe451[_0x1fd47f];return _0x5ed952;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1e45('0x0')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x1e45('0x1')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0x1e45('0x2')](_0x1e45('0x3'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index ff4fa72..4b5b5aa 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 _0x4b9e=['query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','model','map','keys','filters','intersection'];(function(_0x489184,_0x38d972){var _0x2592f9=function(_0x5b8824){while(--_0x5b8824){_0x489184['push'](_0x489184['shift']());}};_0x2592f9(++_0x38d972);}(_0x4b9e,0xaa));var _0xe4b9=function(_0x25c934,_0x1531e6){_0x25c934=_0x25c934-0x0;var _0x22806e=_0x4b9e[_0x25c934];return _0x22806e;};'use strict';var emlformat=require(_0xe4b9('0x0'));var rimraf=require(_0xe4b9('0x1'));var zipdir=require(_0xe4b9('0x2'));var jsonpatch=require(_0xe4b9('0x3'));var rp=require(_0xe4b9('0x4'));var moment=require(_0xe4b9('0x5'));var BPromise=require(_0xe4b9('0x6'));var Mustache=require(_0xe4b9('0x7'));var util=require(_0xe4b9('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xe4b9('0x9'));var ejs=require(_0xe4b9('0xa'));var fs=require('fs');var fs_extra=require(_0xe4b9('0xb'));var _=require(_0xe4b9('0xc'));var squel=require(_0xe4b9('0xd'));var crypto=require(_0xe4b9('0xe'));var jsforce=require(_0xe4b9('0xf'));var deskjs=require(_0xe4b9('0x10'));var toCsv=require(_0xe4b9('0x9'));var querystring=require(_0xe4b9('0x11'));var Papa=require('papaparse');var Redis=require(_0xe4b9('0x12'));var authService=require(_0xe4b9('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe4b9('0x14'));var hardwareService=require(_0xe4b9('0x15'));var logger=require(_0xe4b9('0x16'))('api');var utils=require(_0xe4b9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xe4b9('0x18'));var db=require(_0xe4b9('0x19'))['db'];function respondWithStatusCode(_0x329719,_0x38f5b3){_0x38f5b3=_0x38f5b3||0xcc;return function(_0x98e27c){if(_0x98e27c){return _0x329719[_0xe4b9('0x1a')](_0x38f5b3);}return _0x329719[_0xe4b9('0x1b')](_0x38f5b3)[_0xe4b9('0x1c')]();};}function respondWithResult(_0x1cf015,_0x273618){_0x273618=_0x273618||0xc8;return function(_0x583056){if(_0x583056){return _0x1cf015[_0xe4b9('0x1b')](_0x273618)[_0xe4b9('0x1d')](_0x583056);}};}function respondWithFilteredResult(_0x9b8f27,_0x4998d1){return function(_0x284625){if(_0x284625){var _0x292a80=typeof _0x4998d1[_0xe4b9('0x1e')]===_0xe4b9('0x1f')&&typeof _0x4998d1[_0xe4b9('0x20')]===_0xe4b9('0x1f');var _0x4314e6=_0x284625[_0xe4b9('0x21')];var _0x5ae7d3=_0x292a80?0x0:_0x4998d1[_0xe4b9('0x1e')];var _0x27c9ae=_0x292a80?_0x284625[_0xe4b9('0x21')]:_0x4998d1['offset']+_0x4998d1['limit'];var _0x532b27;if(_0x27c9ae>=_0x4314e6){_0x27c9ae=_0x4314e6;_0x532b27=0xc8;}else{_0x532b27=0xce;}_0x9b8f27['status'](_0x532b27);return _0x9b8f27['set'](_0xe4b9('0x22'),_0x5ae7d3+'-'+_0x27c9ae+'/'+_0x4314e6)[_0xe4b9('0x1d')](_0x284625);}return null;};}function patchUpdates(_0x413d35){return function(_0x49649a){try{jsonpatch['apply'](_0x49649a,_0x413d35,!![]);}catch(_0x399b7e){return BPromise[_0xe4b9('0x23')](_0x399b7e);}return _0x49649a['save']();};}function saveUpdates(_0x43c8ed,_0x1faf58){return function(_0x9a56ae){if(_0x9a56ae){return _0x9a56ae[_0xe4b9('0x24')](_0x43c8ed)[_0xe4b9('0x25')](function(_0x3865be){return _0x3865be;});}return null;};}function removeEntity(_0x533b60,_0x2be459){return function(_0x3436b8){if(_0x3436b8){return _0x3436b8[_0xe4b9('0x26')]()[_0xe4b9('0x25')](function(){_0x533b60[_0xe4b9('0x1b')](0xcc)[_0xe4b9('0x1c')]();});}};}function handleEntityNotFound(_0x233fa0,_0x34bedd){return function(_0x1b54ec){if(!_0x1b54ec){_0x233fa0['sendStatus'](0x194);}return _0x1b54ec;};}function handleError(_0x205874,_0x3fd38c){_0x3fd38c=_0x3fd38c||0x1f4;return function(_0x687b40){logger[_0xe4b9('0x27')](_0x687b40[_0xe4b9('0x28')]);if(_0x687b40[_0xe4b9('0x29')]){delete _0x687b40[_0xe4b9('0x29')];}_0x205874[_0xe4b9('0x1b')](_0x3fd38c)[_0xe4b9('0x2a')](_0x687b40);};}exports[_0xe4b9('0x2b')]=function(_0x1e7dfd,_0x50318a){var _0x300efb={},_0xe3f58d={},_0x512d49={'count':0x0,'rows':[]};var _0x83f3d3=_['map'](db[_0xe4b9('0x2c')][_0xe4b9('0x2d')],function(_0x56a3f7){return{'name':_0x56a3f7[_0xe4b9('0x2e')],'type':_0x56a3f7['type']['key']};});_0xe3f58d[_0xe4b9('0x2f')]=_[_0xe4b9('0x30')](_0x83f3d3,_0xe4b9('0x29'));_0xe3f58d['query']=_[_0xe4b9('0x31')](_0x1e7dfd['query']);_0xe3f58d[_0xe4b9('0x32')]=_[_0xe4b9('0x33')](_0xe3f58d[_0xe4b9('0x2f')],_0xe3f58d[_0xe4b9('0x34')]);_0x300efb[_0xe4b9('0x35')]=_[_0xe4b9('0x33')](_0xe3f58d[_0xe4b9('0x2f')],qs[_0xe4b9('0x36')](_0x1e7dfd[_0xe4b9('0x34')]['fields']));_0x300efb[_0xe4b9('0x35')]=_0x300efb[_0xe4b9('0x35')][_0xe4b9('0x37')]?_0x300efb[_0xe4b9('0x35')]:_0xe3f58d[_0xe4b9('0x2f')];if(!_0x1e7dfd[_0xe4b9('0x34')][_0xe4b9('0x38')](_0xe4b9('0x39'))){_0x300efb[_0xe4b9('0x20')]=qs[_0xe4b9('0x20')](_0x1e7dfd[_0xe4b9('0x34')]['limit']);_0x300efb[_0xe4b9('0x1e')]=qs[_0xe4b9('0x1e')](_0x1e7dfd[_0xe4b9('0x34')][_0xe4b9('0x1e')]);}_0x300efb[_0xe4b9('0x3a')]=qs['sort'](_0x1e7dfd[_0xe4b9('0x34')][_0xe4b9('0x3b')]);_0x300efb[_0xe4b9('0x3c')]=qs['filters'](_['pick'](_0x1e7dfd[_0xe4b9('0x34')],_0xe3f58d[_0xe4b9('0x32')]),_0x83f3d3);if(_0x1e7dfd[_0xe4b9('0x34')][_0xe4b9('0x3d')]){_0x300efb[_0xe4b9('0x3c')]=_[_0xe4b9('0x3e')](_0x300efb[_0xe4b9('0x3c')],{'$or':_[_0xe4b9('0x30')](_0x83f3d3,function(_0x559509){if(_0x559509['type']!==_0xe4b9('0x3f')){var _0x1422f1={};_0x1422f1[_0x559509[_0xe4b9('0x29')]]={'$like':'%'+_0x1e7dfd['query'][_0xe4b9('0x3d')]+'%'};return _0x1422f1;}})});}_0x300efb=_['merge']({},_0x300efb,_0x1e7dfd['options']);var _0x153cff={'where':_0x300efb['where']};return db['VoiceQueuesLog'][_0xe4b9('0x21')](_0x153cff)[_0xe4b9('0x25')](function(_0x3e1b17){_0x512d49[_0xe4b9('0x21')]=_0x3e1b17;if(_0x1e7dfd['query'][_0xe4b9('0x40')]){_0x300efb[_0xe4b9('0x41')]=[{'all':!![]}];}return db[_0xe4b9('0x2c')][_0xe4b9('0x42')](_0x300efb);})[_0xe4b9('0x25')](function(_0x566555){_0x512d49['rows']=_0x566555;return _0x512d49;})[_0xe4b9('0x25')](respondWithFilteredResult(_0x50318a,_0x300efb))[_0xe4b9('0x43')](handleError(_0x50318a,null));};exports[_0xe4b9('0x44')]=function(_0x238fc7,_0x13f013){var _0x25c46a={'raw':!![],'where':{'id':_0x238fc7[_0xe4b9('0x45')]['id']}},_0x427f8a={};_0x427f8a['model']=_[_0xe4b9('0x31')](db[_0xe4b9('0x2c')][_0xe4b9('0x2d')]);_0x427f8a[_0xe4b9('0x34')]=_[_0xe4b9('0x31')](_0x238fc7[_0xe4b9('0x34')]);_0x427f8a['filters']=_[_0xe4b9('0x33')](_0x427f8a[_0xe4b9('0x2f')],_0x427f8a[_0xe4b9('0x34')]);_0x25c46a['attributes']=_[_0xe4b9('0x33')](_0x427f8a[_0xe4b9('0x2f')],qs[_0xe4b9('0x36')](_0x238fc7[_0xe4b9('0x34')]['fields']));_0x25c46a[_0xe4b9('0x35')]=_0x25c46a[_0xe4b9('0x35')][_0xe4b9('0x37')]?_0x25c46a[_0xe4b9('0x35')]:_0x427f8a[_0xe4b9('0x2f')];if(_0x238fc7['query'][_0xe4b9('0x40')]){_0x25c46a['include']=[{'all':!![]}];}_0x25c46a=_[_0xe4b9('0x3e')]({},_0x25c46a,_0x238fc7[_0xe4b9('0x46')]);return db[_0xe4b9('0x2c')][_0xe4b9('0x47')](_0x25c46a)[_0xe4b9('0x25')](handleEntityNotFound(_0x13f013,null))[_0xe4b9('0x25')](respondWithResult(_0x13f013,null))[_0xe4b9('0x43')](handleError(_0x13f013,null));};exports[_0xe4b9('0x48')]=function(_0x4aa605,_0x3547d6){return db[_0xe4b9('0x2c')][_0xe4b9('0x48')](_0x4aa605[_0xe4b9('0x49')],{})['then'](respondWithResult(_0x3547d6,0xc9))[_0xe4b9('0x43')](handleError(_0x3547d6,null));};exports[_0xe4b9('0x24')]=function(_0x3c9364,_0x504215){if(_0x3c9364[_0xe4b9('0x49')]['id']){delete _0x3c9364['body']['id'];}return db[_0xe4b9('0x2c')][_0xe4b9('0x47')]({'where':{'id':_0x3c9364[_0xe4b9('0x45')]['id']}})[_0xe4b9('0x25')](handleEntityNotFound(_0x504215,null))[_0xe4b9('0x25')](saveUpdates(_0x3c9364[_0xe4b9('0x49')],null))[_0xe4b9('0x25')](respondWithResult(_0x504215,null))[_0xe4b9('0x43')](handleError(_0x504215,null));};exports[_0xe4b9('0x26')]=function(_0x14e60f,_0x19f37a){return db[_0xe4b9('0x2c')][_0xe4b9('0x47')]({'where':{'id':_0x14e60f[_0xe4b9('0x45')]['id']}})['then'](handleEntityNotFound(_0x19f37a,null))[_0xe4b9('0x25')](removeEntity(_0x19f37a,null))[_0xe4b9('0x43')](handleError(_0x19f37a,null));}; \ No newline at end of file +var _0xf0ec=['findAll','rows','catch','show','params','create','body','find','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceQueuesLog','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','include'];(function(_0x45564a,_0x160043){var _0x1184c7=function(_0x529f16){while(--_0x529f16){_0x45564a['push'](_0x45564a['shift']());}};_0x1184c7(++_0x160043);}(_0xf0ec,0xe0));var _0xcf0e=function(_0x442ccd,_0x415d61){_0x442ccd=_0x442ccd-0x0;var _0x1a2c10=_0xf0ec[_0x442ccd];return _0x1a2c10;};'use strict';var emlformat=require(_0xcf0e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcf0e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcf0e('0x2'));var moment=require(_0xcf0e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcf0e('0x4'));var util=require(_0xcf0e('0x5'));var path=require(_0xcf0e('0x6'));var sox=require(_0xcf0e('0x7'));var csv=require('to-csv');var ejs=require(_0xcf0e('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf0e('0x9'));var squel=require(_0xcf0e('0xa'));var crypto=require('crypto');var jsforce=require(_0xcf0e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xcf0e('0xc'));var querystring=require(_0xcf0e('0xd'));var Papa=require(_0xcf0e('0xe'));var Redis=require(_0xcf0e('0xf'));var authService=require(_0xcf0e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xcf0e('0x11'));var hardwareService=require(_0xcf0e('0x12'));var logger=require(_0xcf0e('0x13'))(_0xcf0e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcf0e('0x15'));var db=require(_0xcf0e('0x16'))['db'];function respondWithStatusCode(_0x3718b2,_0x5affdb){_0x5affdb=_0x5affdb||0xcc;return function(_0x1acd86){if(_0x1acd86){return _0x3718b2[_0xcf0e('0x17')](_0x5affdb);}return _0x3718b2[_0xcf0e('0x18')](_0x5affdb)['end']();};}function respondWithResult(_0x59aa1e,_0x4b401d){_0x4b401d=_0x4b401d||0xc8;return function(_0x39b3d9){if(_0x39b3d9){return _0x59aa1e[_0xcf0e('0x18')](_0x4b401d)[_0xcf0e('0x19')](_0x39b3d9);}};}function respondWithFilteredResult(_0x126824,_0x1ae3df){return function(_0x4953e7){if(_0x4953e7){var _0x1352be=typeof _0x1ae3df['offset']===_0xcf0e('0x1a')&&typeof _0x1ae3df['limit']==='undefined';var _0x5c5a49=_0x4953e7[_0xcf0e('0x1b')];var _0x7fef3a=_0x1352be?0x0:_0x1ae3df[_0xcf0e('0x1c')];var _0x50cb4f=_0x1352be?_0x4953e7[_0xcf0e('0x1b')]:_0x1ae3df[_0xcf0e('0x1c')]+_0x1ae3df[_0xcf0e('0x1d')];var _0x4f51b5;if(_0x50cb4f>=_0x5c5a49){_0x50cb4f=_0x5c5a49;_0x4f51b5=0xc8;}else{_0x4f51b5=0xce;}_0x126824['status'](_0x4f51b5);return _0x126824[_0xcf0e('0x1e')]('Content-Range',_0x7fef3a+'-'+_0x50cb4f+'/'+_0x5c5a49)[_0xcf0e('0x19')](_0x4953e7);}return null;};}function patchUpdates(_0x465d1b){return function(_0x48fd63){try{jsonpatch[_0xcf0e('0x1f')](_0x48fd63,_0x465d1b,!![]);}catch(_0x1441c1){return BPromise[_0xcf0e('0x20')](_0x1441c1);}return _0x48fd63[_0xcf0e('0x21')]();};}function saveUpdates(_0x4e893d,_0x8debec){return function(_0x3deccf){if(_0x3deccf){return _0x3deccf[_0xcf0e('0x22')](_0x4e893d)[_0xcf0e('0x23')](function(_0x103c31){return _0x103c31;});}return null;};}function removeEntity(_0x19c3c7,_0x5ba438){return function(_0xa41df){if(_0xa41df){return _0xa41df[_0xcf0e('0x24')]()[_0xcf0e('0x23')](function(){_0x19c3c7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x440dc9,_0x2c4b62){return function(_0x19b08e){if(!_0x19b08e){_0x440dc9[_0xcf0e('0x17')](0x194);}return _0x19b08e;};}function handleError(_0x476b25,_0x40bdd7){_0x40bdd7=_0x40bdd7||0x1f4;return function(_0x3220cf){logger['error'](_0x3220cf[_0xcf0e('0x25')]);if(_0x3220cf[_0xcf0e('0x26')]){delete _0x3220cf['name'];}_0x476b25[_0xcf0e('0x18')](_0x40bdd7)[_0xcf0e('0x27')](_0x3220cf);};}exports[_0xcf0e('0x28')]=function(_0x544c60,_0x3a0e0c){var _0x504f2a={},_0x11bc3b={},_0x47440e={'count':0x0,'rows':[]};var _0x4523c5=_[_0xcf0e('0x29')](db[_0xcf0e('0x2a')][_0xcf0e('0x2b')],function(_0xb91954){return{'name':_0xb91954['fieldName'],'type':_0xb91954[_0xcf0e('0x2c')][_0xcf0e('0x2d')]};});_0x11bc3b[_0xcf0e('0x2e')]=_[_0xcf0e('0x29')](_0x4523c5,_0xcf0e('0x26'));_0x11bc3b['query']=_[_0xcf0e('0x2f')](_0x544c60[_0xcf0e('0x30')]);_0x11bc3b[_0xcf0e('0x31')]=_['intersection'](_0x11bc3b[_0xcf0e('0x2e')],_0x11bc3b[_0xcf0e('0x30')]);_0x504f2a[_0xcf0e('0x32')]=_[_0xcf0e('0x33')](_0x11bc3b['model'],qs[_0xcf0e('0x34')](_0x544c60[_0xcf0e('0x30')][_0xcf0e('0x34')]));_0x504f2a[_0xcf0e('0x32')]=_0x504f2a[_0xcf0e('0x32')][_0xcf0e('0x35')]?_0x504f2a['attributes']:_0x11bc3b[_0xcf0e('0x2e')];if(!_0x544c60[_0xcf0e('0x30')][_0xcf0e('0x36')](_0xcf0e('0x37'))){_0x504f2a['limit']=qs[_0xcf0e('0x1d')](_0x544c60[_0xcf0e('0x30')][_0xcf0e('0x1d')]);_0x504f2a[_0xcf0e('0x1c')]=qs['offset'](_0x544c60[_0xcf0e('0x30')]['offset']);}_0x504f2a[_0xcf0e('0x38')]=qs['sort'](_0x544c60[_0xcf0e('0x30')][_0xcf0e('0x39')]);_0x504f2a['where']=qs['filters'](_['pick'](_0x544c60[_0xcf0e('0x30')],_0x11bc3b[_0xcf0e('0x31')]),_0x4523c5);if(_0x544c60[_0xcf0e('0x30')]['filter']){_0x504f2a[_0xcf0e('0x3a')]=_['merge'](_0x504f2a[_0xcf0e('0x3a')],{'$or':_[_0xcf0e('0x29')](_0x4523c5,function(_0x422837){if(_0x422837[_0xcf0e('0x2c')]!==_0xcf0e('0x3b')){var _0x435eb5={};_0x435eb5[_0x422837[_0xcf0e('0x26')]]={'$like':'%'+_0x544c60[_0xcf0e('0x30')][_0xcf0e('0x3c')]+'%'};return _0x435eb5;}})});}_0x504f2a=_[_0xcf0e('0x3d')]({},_0x504f2a,_0x544c60[_0xcf0e('0x3e')]);var _0x1ed59e={'where':_0x504f2a['where']};return db[_0xcf0e('0x2a')]['count'](_0x1ed59e)[_0xcf0e('0x23')](function(_0x3ab9f8){_0x47440e[_0xcf0e('0x1b')]=_0x3ab9f8;if(_0x544c60[_0xcf0e('0x30')]['includeAll']){_0x504f2a[_0xcf0e('0x3f')]=[{'all':!![]}];}return db[_0xcf0e('0x2a')][_0xcf0e('0x40')](_0x504f2a);})[_0xcf0e('0x23')](function(_0x487b4f){_0x47440e[_0xcf0e('0x41')]=_0x487b4f;return _0x47440e;})[_0xcf0e('0x23')](respondWithFilteredResult(_0x3a0e0c,_0x504f2a))[_0xcf0e('0x42')](handleError(_0x3a0e0c,null));};exports[_0xcf0e('0x43')]=function(_0x21ed9c,_0x5ddb59){var _0x270e9c={'raw':!![],'where':{'id':_0x21ed9c[_0xcf0e('0x44')]['id']}},_0x5c414f={};_0x5c414f[_0xcf0e('0x2e')]=_[_0xcf0e('0x2f')](db['VoiceQueuesLog']['rawAttributes']);_0x5c414f['query']=_[_0xcf0e('0x2f')](_0x21ed9c['query']);_0x5c414f[_0xcf0e('0x31')]=_[_0xcf0e('0x33')](_0x5c414f[_0xcf0e('0x2e')],_0x5c414f[_0xcf0e('0x30')]);_0x270e9c[_0xcf0e('0x32')]=_['intersection'](_0x5c414f[_0xcf0e('0x2e')],qs['fields'](_0x21ed9c[_0xcf0e('0x30')][_0xcf0e('0x34')]));_0x270e9c[_0xcf0e('0x32')]=_0x270e9c[_0xcf0e('0x32')][_0xcf0e('0x35')]?_0x270e9c['attributes']:_0x5c414f[_0xcf0e('0x2e')];if(_0x21ed9c['query']['includeAll']){_0x270e9c[_0xcf0e('0x3f')]=[{'all':!![]}];}_0x270e9c=_[_0xcf0e('0x3d')]({},_0x270e9c,_0x21ed9c['options']);return db[_0xcf0e('0x2a')]['find'](_0x270e9c)[_0xcf0e('0x23')](handleEntityNotFound(_0x5ddb59,null))[_0xcf0e('0x23')](respondWithResult(_0x5ddb59,null))[_0xcf0e('0x42')](handleError(_0x5ddb59,null));};exports['create']=function(_0xaebc9c,_0x1dd270){return db[_0xcf0e('0x2a')][_0xcf0e('0x45')](_0xaebc9c[_0xcf0e('0x46')],{})[_0xcf0e('0x23')](respondWithResult(_0x1dd270,0xc9))[_0xcf0e('0x42')](handleError(_0x1dd270,null));};exports[_0xcf0e('0x22')]=function(_0x11af57,_0x5b4b4a){if(_0x11af57['body']['id']){delete _0x11af57['body']['id'];}return db[_0xcf0e('0x2a')][_0xcf0e('0x47')]({'where':{'id':_0x11af57['params']['id']}})['then'](handleEntityNotFound(_0x5b4b4a,null))[_0xcf0e('0x23')](saveUpdates(_0x11af57[_0xcf0e('0x46')],null))['then'](respondWithResult(_0x5b4b4a,null))[_0xcf0e('0x42')](handleError(_0x5b4b4a,null));};exports[_0xcf0e('0x24')]=function(_0x50f990,_0x279ad8){return db[_0xcf0e('0x2a')][_0xcf0e('0x47')]({'where':{'id':_0x50f990[_0xcf0e('0x44')]['id']}})[_0xcf0e('0x23')](handleEntityNotFound(_0x279ad8,null))[_0xcf0e('0x23')](removeEntity(_0x279ad8,null))['catch'](handleError(_0x279ad8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index a57cd4c..a9f9feb 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 _0x90ae=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger'];(function(_0xbf8bc5,_0x21f45c){var _0x72af02=function(_0x5c5e46){while(--_0x5c5e46){_0xbf8bc5['push'](_0xbf8bc5['shift']());}};_0x72af02(++_0x21f45c);}(_0x90ae,0x195));var _0xe90a=function(_0x160d29,_0x4768e5){_0x160d29=_0x160d29-0x0;var _0x111b6b=_0x90ae[_0x160d29];return _0x111b6b;};'use strict';var _=require(_0xe90a('0x0'));var util=require(_0xe90a('0x1'));var logger=require(_0xe90a('0x2'))('api');var moment=require(_0xe90a('0x3'));var BPromise=require(_0xe90a('0x4'));var rp=require(_0xe90a('0x5'));var fs=require('fs');var path=require(_0xe90a('0x6'));var rimraf=require(_0xe90a('0x7'));var config=require(_0xe90a('0x8'));var attributes=require(_0xe90a('0x9'));module[_0xe90a('0xa')]=function(_0x30cb7b,_0x5c3573){return _0x30cb7b[_0xe90a('0xb')](_0xe90a('0xc'),attributes,{'tableName':_0xe90a('0xd'),'paranoid':![],'indexes':[{'name':_0xe90a('0xe'),'fields':[_0xe90a('0xf'),_0xe90a('0x10')]}],'timestamps':![]});}; \ No newline at end of file +var _0x1360=['./voiceQueuesLog.attributes','exports','voice_queues_log','event_dtm','event','dtm','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x1360,0xd6));var _0x0136=function(_0x404c35,_0xedfe89){_0x404c35=_0x404c35-0x0;var _0x28c900=_0x1360[_0x404c35];return _0x28c900;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0136('0x0'))(_0x0136('0x1'));var moment=require(_0x0136('0x2'));var BPromise=require(_0x0136('0x3'));var rp=require(_0x0136('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0136('0x5'));var config=require(_0x0136('0x6'));var attributes=require(_0x0136('0x7'));module[_0x0136('0x8')]=function(_0x3568b0,_0x423a6e){return _0x3568b0['define']('VoiceQueuesLog',attributes,{'tableName':_0x0136('0x9'),'paranoid':![],'indexes':[{'name':_0x0136('0xa'),'fields':[_0x0136('0xb'),_0x0136('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index b0e7bab..1d7e90c 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 _0x7d71=['error','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x297442,_0x3cae10){var _0x93ab62=function(_0x3a5fcb){while(--_0x3a5fcb){_0x297442['push'](_0x297442['shift']());}};_0x93ab62(++_0x3cae10);}(_0x7d71,0x192));var _0x17d7=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0x7d71[_0xa8883];return _0x479426;};'use strict';var _=require(_0x17d7('0x0'));var util=require(_0x17d7('0x1'));var moment=require(_0x17d7('0x2'));var BPromise=require(_0x17d7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x17d7('0x4'));var db=require(_0x17d7('0x5'))['db'];var utils=require(_0x17d7('0x6'));var logger=require('../../config/logger')(_0x17d7('0x7'));var config=require(_0x17d7('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x17d7('0x9')][_0x17d7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x485657,_0x5ead2c,_0x33c675){return new BPromise(function(_0x5c346f,_0x10a459){return client[_0x17d7('0xb')](_0x485657,_0x33c675)[_0x17d7('0xc')](function(_0x1fa405){logger[_0x17d7('0xd')](_0x17d7('0xe'),_0x5ead2c,_0x17d7('0xf'));logger[_0x17d7('0x10')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x5ead2c,'request\x20sent',JSON[_0x17d7('0x11')](_0x1fa405));if(_0x1fa405['error']){if(_0x1fa405[_0x17d7('0x12')]['code']===0x1f4){logger['error']('VoiceQueuesLog,\x20%s,\x20%s',_0x5ead2c,_0x1fa405[_0x17d7('0x12')][_0x17d7('0x13')]);return _0x10a459(_0x1fa405['error'][_0x17d7('0x13')]);}logger[_0x17d7('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5ead2c,_0x1fa405[_0x17d7('0x12')][_0x17d7('0x13')]);return _0x5c346f(_0x1fa405['error'][_0x17d7('0x13')]);}else{logger[_0x17d7('0xd')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5ead2c,_0x17d7('0xf'));_0x5c346f(_0x1fa405[_0x17d7('0x14')][_0x17d7('0x13')]);}})['catch'](function(_0x263353){logger[_0x17d7('0x12')](_0x17d7('0xe'),_0x5ead2c,_0x263353);_0x10a459(_0x263353);});});} \ No newline at end of file +var _0x9189=['request','then','info','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','VoiceQueuesLog,\x20%s,\x20%s','result','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/environment','jayson/promise','http'];(function(_0x2f30b5,_0x19fb36){var _0x572b71=function(_0x2cea7e){while(--_0x2cea7e){_0x2f30b5['push'](_0x2f30b5['shift']());}};_0x572b71(++_0x19fb36);}(_0x9189,0x1b0));var _0x9918=function(_0x534e00,_0x1ed5a6){_0x534e00=_0x534e00-0x0;var _0x1e97e8=_0x9189[_0x534e00];return _0x1e97e8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9918('0x0'));var BPromise=require(_0x9918('0x1'));var rs=require(_0x9918('0x2'));var fs=require('fs');var Redis=require(_0x9918('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x9918('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9918('0x5'));var jayson=require(_0x9918('0x6'));var client=jayson['client'][_0x9918('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3cb556,_0x7b8770,_0x5c926e){return new BPromise(function(_0x5a0552,_0x50a534){return client[_0x9918('0x8')](_0x3cb556,_0x5c926e)[_0x9918('0x9')](function(_0x553c75){logger[_0x9918('0xa')]('VoiceQueuesLog,\x20%s,\x20%s',_0x7b8770,_0x9918('0xb'));logger[_0x9918('0xc')](_0x9918('0xd'),_0x7b8770,_0x9918('0xb'),JSON[_0x9918('0xe')](_0x553c75));if(_0x553c75[_0x9918('0xf')]){if(_0x553c75[_0x9918('0xf')]['code']===0x1f4){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x553c75['error']['message']);return _0x50a534(_0x553c75[_0x9918('0xf')]['message']);}logger['error'](_0x9918('0x10'),_0x7b8770,_0x553c75[_0x9918('0xf')]['message']);return _0x5a0552(_0x553c75[_0x9918('0xf')]['message']);}else{logger[_0x9918('0xa')](_0x9918('0x10'),_0x7b8770,_0x9918('0xb'));_0x5a0552(_0x553c75[_0x9918('0x11')][_0x9918('0x12')]);}})[_0x9918('0x13')](function(_0x1a676f){logger[_0x9918('0xf')](_0x9918('0x10'),_0x7b8770,_0x1a676f);_0x50a534(_0x1a676f);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 99d3c49..94233b2 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 _0x22b8=['put','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','index','get','/:id','/:id/download','isAuthenticated','download','downloads','/:id/transcribe','downloadTranscribe','post','create','runTranscribe'];(function(_0x1f5b11,_0x44dfb2){var _0x48713a=function(_0x3d004b){while(--_0x3d004b){_0x1f5b11['push'](_0x1f5b11['shift']());}};_0x48713a(++_0x44dfb2);}(_0x22b8,0x85));var _0x822b=function(_0x19a17b,_0x5ae2cf){_0x19a17b=_0x19a17b-0x0;var _0x3ab04e=_0x22b8[_0x19a17b];return _0x3ab04e;};'use strict';var multer=require(_0x822b('0x0'));var util=require(_0x822b('0x1'));var path=require(_0x822b('0x2'));var timeout=require(_0x822b('0x3'));var express=require(_0x822b('0x4'));var router=express[_0x822b('0x5')]();var fs_extra=require(_0x822b('0x6'));var auth=require(_0x822b('0x7'));var interaction=require(_0x822b('0x8'));var config=require(_0x822b('0x9'));var controller=require(_0x822b('0xa'));router['get']('/',auth['isAuthenticated'](),controller[_0x822b('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x822b('0xc')](_0x822b('0xd'),auth['isAuthenticated'](),controller['show']);router['get'](_0x822b('0xe'),auth[_0x822b('0xf')](),controller[_0x822b('0x10')]);router[_0x822b('0xc')]('/:id/downloads',controller[_0x822b('0x11')]);router[_0x822b('0xc')](_0x822b('0x12'),auth[_0x822b('0xf')](),controller[_0x822b('0x13')]);router[_0x822b('0x14')]('/',auth['isAuthenticated'](),controller[_0x822b('0x15')]);router[_0x822b('0x14')](_0x822b('0x12'),auth[_0x822b('0xf')](),controller[_0x822b('0x16')]);router[_0x822b('0x17')](_0x822b('0xd'),auth['isAuthenticated'](),controller[_0x822b('0x18')]);router['delete'](_0x822b('0xd'),auth[_0x822b('0xf')](),controller['destroy']);module[_0x822b('0x19')]=router; \ No newline at end of file +var _0x0b82=['create','/:id/transcribe','runTranscribe','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','/:id/download','downloadTranscribe','post'];(function(_0x542f29,_0x9a1faa){var _0x1d4b9a=function(_0x40a91a){while(--_0x40a91a){_0x542f29['push'](_0x542f29['shift']());}};_0x1d4b9a(++_0x9a1faa);}(_0x0b82,0x157));var _0x20b8=function(_0x3ef7a8,_0x33e502){_0x3ef7a8=_0x3ef7a8-0x0;var _0x577ca8=_0x0b82[_0x3ef7a8];return _0x577ca8;};'use strict';var multer=require(_0x20b8('0x0'));var util=require('util');var path=require(_0x20b8('0x1'));var timeout=require(_0x20b8('0x2'));var express=require(_0x20b8('0x3'));var router=express[_0x20b8('0x4')]();var fs_extra=require(_0x20b8('0x5'));var auth=require(_0x20b8('0x6'));var interaction=require(_0x20b8('0x7'));var config=require('../../config/environment');var controller=require('./voiceRecording.controller');router[_0x20b8('0x8')]('/',auth[_0x20b8('0x9')](),controller[_0x20b8('0xa')]);router[_0x20b8('0x8')](_0x20b8('0xb'),auth[_0x20b8('0x9')](),controller[_0x20b8('0xc')]);router['get'](_0x20b8('0xd'),auth[_0x20b8('0x9')](),controller['show']);router[_0x20b8('0x8')](_0x20b8('0xe'),auth[_0x20b8('0x9')](),controller['download']);router[_0x20b8('0x8')]('/:id/downloads',controller['downloads']);router[_0x20b8('0x8')]('/:id/transcribe',auth[_0x20b8('0x9')](),controller[_0x20b8('0xf')]);router[_0x20b8('0x10')]('/',auth[_0x20b8('0x9')](),controller[_0x20b8('0x11')]);router[_0x20b8('0x10')](_0x20b8('0x12'),auth[_0x20b8('0x9')](),controller[_0x20b8('0x13')]);router[_0x20b8('0x14')](_0x20b8('0xd'),auth[_0x20b8('0x9')](),controller['update']);router[_0x20b8('0x15')](_0x20b8('0xd'),auth[_0x20b8('0x9')](),controller[_0x20b8('0x16')]);module[_0x20b8('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 6105f4c..6195bf0 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(_0x16d10f,_0x2ba2d5){var _0x50c823=function(_0x44e43f){while(--_0x44e43f){_0x16d10f['push'](_0x16d10f['shift']());}};_0x50c823(++_0x2ba2d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xa9e0[_0x3b5250];return _0xc844a1;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x3')]('value')?path[_0x0a9e('0x4')](this[_0x0a9e('0x3')](_0x0a9e('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x0a9e('0x6')]},'channel':{'type':Sequelize[_0x0a9e('0x6')],'set':function(_0x57b080){if(_0x57b080){this[_0x0a9e('0x7')](_0x0a9e('0x8'),_0x57b080);this[_0x0a9e('0x7')]('membername',_0x57b080['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0a9e('0x6')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0a9e('0x6')]},'connectedlinename':{'type':Sequelize[_0x0a9e('0x6')]},'accountcode':{'type':Sequelize[_0x0a9e('0x6')]},'context':{'type':Sequelize[_0x0a9e('0x6')]},'exten':{'type':Sequelize[_0x0a9e('0x6')]},'value':{'type':Sequelize[_0x0a9e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'userSecondDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'userThirdDisposition':{'type':Sequelize[_0x0a9e('0x6')]},'location':{'type':Sequelize[_0x0a9e('0x9')]},'transcribeName':{'type':Sequelize[_0x0a9e('0x6')]},'transcribeStatus':{'type':Sequelize[_0x0a9e('0x6')],'defaultValue':_0x0a9e('0xa')},'fileUri':{'type':Sequelize['TEXT']},'fileText':{'type':Sequelize[_0x0a9e('0x9')]},'failureReason':{'type':Sequelize[_0x0a9e('0x9')]},'sentiment':{'type':Sequelize[_0x0a9e('0x6')]},'sPositive':{'type':Sequelize[_0x0a9e('0xb')]},'sNegative':{'type':Sequelize[_0x0a9e('0xb')]},'sNeutral':{'type':Sequelize[_0x0a9e('0xb')]},'sMixed':{'type':Sequelize['FLOAT']},'tempSentiment':{'type':Sequelize[_0x0a9e('0xc')],'defaultValue':![]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0a9e('0x3')]('createdAt'))[_0x0a9e('0xd')](_0x0a9e('0xe'))['toString']();}},'updatedAt':{'type':Sequelize[_0x0a9e('0xf')],'get':function(){return moment(this['getDataValue'](_0x0a9e('0x10')))[_0x0a9e('0xd')](_0x0a9e('0xe'))[_0x0a9e('0x11')]();}}}; \ No newline at end of file +var _0xa9e0=['DATE','updatedAt','toString','sequelize','moment','path','getDataValue','extname','value','STRING','setDataValue','channel','TEXT','NEW','FLOAT','BOOLEAN','format','MM-DD-YYYY\x20HH:mm'];(function(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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 f5f0098..3978df7 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 _0xc3d6=['transcribeName','TranscriptionJob','transcribeStatus','../../components/encryptor','findOne','secrets','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','language','bucket','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','data1','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','updateAttributes','writeFile','downloadTranscribe','fileText','root','.txt','Transcript\x20not\x20available','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','index','map','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','query','keys','filters','fields','attributes','length','nolimit','sort','merge','VIRTUAL','filter','options','where','includeAll','include','findAll','rows','show','params','intersection','create','catch','body','find','describe','download','uniqueid','value','format','%s.cypher','existsSync','decryptFile','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','downloads','MD5','sequelize','col','token','$and','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','File:\x20\x22','unlinkSync','listBuckets','createBucket','upload','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','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','TranscriptionJobName'];(function(_0x1c8c28,_0x3ee093){var _0x1f59b4=function(_0x29bcc0){while(--_0x29bcc0){_0x1c8c28['push'](_0x1c8c28['shift']());}};_0x1f59b4(++_0x3ee093);}(_0xc3d6,0x1ef));var _0x6c3d=function(_0x4938f8,_0x335a37){_0x4938f8=_0x4938f8-0x0;var _0x233c08=_0xc3d6[_0x4938f8];return _0x233c08;};'use strict';var emlformat=require(_0x6c3d('0x0'));var rimraf=require(_0x6c3d('0x1'));var zipdir=require(_0x6c3d('0x2'));var jsonpatch=require(_0x6c3d('0x3'));var rp=require(_0x6c3d('0x4'));var moment=require(_0x6c3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6c3d('0x6'));var util=require(_0x6c3d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6c3d('0x8'));var ejs=require(_0x6c3d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x6c3d('0xa'));var crypto=require(_0x6c3d('0xb'));var jsforce=require(_0x6c3d('0xc'));var deskjs=require(_0x6c3d('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6c3d('0xe'));var AWS=require(_0x6c3d('0xf'));var uuidv4=require(_0x6c3d('0x10'));var Redis=require(_0x6c3d('0x11'));var authService=require(_0x6c3d('0x12'));var qs=require(_0x6c3d('0x13'));var as=require(_0x6c3d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6c3d('0x15'))(_0x6c3d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x6c3d('0x17'));var db=require(_0x6c3d('0x18'))['db'];function respondWithStatusCode(_0x4358c6,_0x5f0e8f){_0x5f0e8f=_0x5f0e8f||0xcc;return function(_0x5859be){if(_0x5859be){return _0x4358c6['sendStatus'](_0x5f0e8f);}return _0x4358c6[_0x6c3d('0x19')](_0x5f0e8f)[_0x6c3d('0x1a')]();};}function respondWithResult(_0x5a20bb,_0x3dcf26){_0x3dcf26=_0x3dcf26||0xc8;return function(_0x327d4c){if(_0x327d4c){return _0x5a20bb[_0x6c3d('0x19')](_0x3dcf26)['json'](_0x327d4c);}};}function respondWithFilteredResult(_0x1f5313,_0x728fbc){return function(_0x523156){if(_0x523156){var _0x1e050b=typeof _0x728fbc[_0x6c3d('0x1b')]===_0x6c3d('0x1c')&&typeof _0x728fbc[_0x6c3d('0x1d')]===_0x6c3d('0x1c');var _0x1a8621=_0x523156[_0x6c3d('0x1e')];var _0x268e20=_0x1e050b?0x0:_0x728fbc[_0x6c3d('0x1b')];var _0x3db83e=_0x1e050b?_0x523156['count']:_0x728fbc[_0x6c3d('0x1b')]+_0x728fbc[_0x6c3d('0x1d')];var _0x1e7ae8;if(_0x3db83e>=_0x1a8621){_0x3db83e=_0x1a8621;_0x1e7ae8=0xc8;}else{_0x1e7ae8=0xce;}_0x1f5313['status'](_0x1e7ae8);return _0x1f5313[_0x6c3d('0x1f')](_0x6c3d('0x20'),_0x268e20+'-'+_0x3db83e+'/'+_0x1a8621)[_0x6c3d('0x21')](_0x523156);}return null;};}function patchUpdates(_0x30553e){return function(_0x1b4a02){try{jsonpatch[_0x6c3d('0x22')](_0x1b4a02,_0x30553e,!![]);}catch(_0x45ebb5){return BPromise['reject'](_0x45ebb5);}return _0x1b4a02[_0x6c3d('0x23')]();};}function saveUpdates(_0x12613e,_0x227e57){return function(_0x5ca143){if(_0x5ca143){return _0x5ca143[_0x6c3d('0x24')](_0x12613e)[_0x6c3d('0x25')](function(_0xc74cba){return _0xc74cba;});}return null;};}function removeEntity(_0x2f6a2e,_0x2640c4){return function(_0x704506){if(_0x704506){return _0x704506[_0x6c3d('0x26')]()[_0x6c3d('0x25')](function(){_0x2f6a2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e97ca,_0x4badb4){return function(_0x2b6dc9){if(!_0x2b6dc9){_0x4e97ca['sendStatus'](0x194);}return _0x2b6dc9;};}function handleError(_0x31de38,_0x45d345){_0x45d345=_0x45d345||0x1f4;return function(_0x7768a9){logger[_0x6c3d('0x27')](_0x7768a9[_0x6c3d('0x28')]);if(_0x7768a9[_0x6c3d('0x29')]){delete _0x7768a9[_0x6c3d('0x29')];}_0x31de38[_0x6c3d('0x19')](_0x45d345)['send'](_0x7768a9);};}exports[_0x6c3d('0x2a')]=function(_0x3a2382,_0x18615e){var _0x56836e={},_0x25945f={},_0x3779c8={'count':0x0,'rows':[]};var _0x2d3a1b=_[_0x6c3d('0x2b')](db[_0x6c3d('0x2c')][_0x6c3d('0x2d')],function(_0x92d7a6){return{'name':_0x92d7a6[_0x6c3d('0x2e')],'type':_0x92d7a6[_0x6c3d('0x2f')][_0x6c3d('0x30')]};});_0x25945f[_0x6c3d('0x31')]=_[_0x6c3d('0x32')](_['map'](_0x2d3a1b,_0x6c3d('0x29')),['format']);_0x25945f[_0x6c3d('0x33')]=_[_0x6c3d('0x34')](_0x3a2382[_0x6c3d('0x33')]);_0x25945f[_0x6c3d('0x35')]=_['intersection'](_0x25945f[_0x6c3d('0x31')],_0x25945f[_0x6c3d('0x33')]);_0x56836e['attributes']=_['intersection'](_0x25945f[_0x6c3d('0x31')],qs[_0x6c3d('0x36')](_0x3a2382[_0x6c3d('0x33')][_0x6c3d('0x36')]));_0x56836e[_0x6c3d('0x37')]=_0x56836e[_0x6c3d('0x37')][_0x6c3d('0x38')]?_0x56836e[_0x6c3d('0x37')]:_0x25945f[_0x6c3d('0x31')];if(!_0x3a2382[_0x6c3d('0x33')]['hasOwnProperty'](_0x6c3d('0x39'))){_0x56836e[_0x6c3d('0x1d')]=qs[_0x6c3d('0x1d')](_0x3a2382[_0x6c3d('0x33')][_0x6c3d('0x1d')]);_0x56836e[_0x6c3d('0x1b')]=qs[_0x6c3d('0x1b')](_0x3a2382[_0x6c3d('0x33')][_0x6c3d('0x1b')]);}_0x56836e['order']=qs[_0x6c3d('0x3a')](_0x3a2382['query']['sort']);_0x56836e['where']=qs[_0x6c3d('0x35')](_['pick'](_0x3a2382[_0x6c3d('0x33')],_0x25945f[_0x6c3d('0x35')]),_0x2d3a1b);if(_0x3a2382[_0x6c3d('0x33')]['filter']){_0x56836e['where']=_[_0x6c3d('0x3b')](_0x56836e['where'],{'$or':_['map'](_0x2d3a1b,function(_0x20f077){if(_0x20f077['type']!==_0x6c3d('0x3c')){var _0x9a8134={};_0x9a8134[_0x20f077[_0x6c3d('0x29')]]={'$like':'%'+_0x3a2382[_0x6c3d('0x33')][_0x6c3d('0x3d')]+'%'};return _0x9a8134;}})});}_0x56836e=_[_0x6c3d('0x3b')]({},_0x56836e,_0x3a2382[_0x6c3d('0x3e')]);var _0x99ba0d={'where':_0x56836e[_0x6c3d('0x3f')]};return db['VoiceRecording'][_0x6c3d('0x1e')](_0x99ba0d)[_0x6c3d('0x25')](function(_0x3a7529){_0x3779c8[_0x6c3d('0x1e')]=_0x3a7529;if(_0x3a2382['query'][_0x6c3d('0x40')]){_0x56836e[_0x6c3d('0x41')]=[{'all':!![]}];}return db[_0x6c3d('0x2c')][_0x6c3d('0x42')](_0x56836e);})[_0x6c3d('0x25')](function(_0x4dee40){_0x3779c8[_0x6c3d('0x43')]=_0x4dee40;return _0x3779c8;})['then'](respondWithFilteredResult(_0x18615e,_0x56836e))['catch'](handleError(_0x18615e,null));};exports[_0x6c3d('0x44')]=function(_0x406976,_0x45ca76){var _0x53c44c={'raw':![],'where':{'id':_0x406976[_0x6c3d('0x45')]['id']}},_0x322709={};_0x322709[_0x6c3d('0x31')]=_[_0x6c3d('0x34')](db[_0x6c3d('0x2c')]['rawAttributes']);_0x322709[_0x6c3d('0x33')]=_[_0x6c3d('0x34')](_0x406976[_0x6c3d('0x33')]);_0x322709[_0x6c3d('0x35')]=_[_0x6c3d('0x46')](_0x322709['model'],_0x322709[_0x6c3d('0x33')]);_0x53c44c[_0x6c3d('0x37')]=_[_0x6c3d('0x46')](_0x322709['model'],qs['fields'](_0x406976['query'][_0x6c3d('0x36')]));_0x53c44c[_0x6c3d('0x37')]=_0x53c44c['attributes']['length']?_0x53c44c[_0x6c3d('0x37')]:_0x322709[_0x6c3d('0x31')];if(_0x406976['query']['includeAll']){_0x53c44c[_0x6c3d('0x41')]=[{'all':!![]}];}_0x53c44c=_[_0x6c3d('0x3b')]({},_0x53c44c,_0x406976['options']);return db['VoiceRecording']['find'](_0x53c44c)[_0x6c3d('0x25')](handleEntityNotFound(_0x45ca76,null))[_0x6c3d('0x25')](respondWithResult(_0x45ca76,null))['catch'](handleError(_0x45ca76,null));};exports[_0x6c3d('0x47')]=function(_0x4773c9,_0x4c0ed9){return db[_0x6c3d('0x2c')][_0x6c3d('0x47')](_0x4773c9['body'],{})[_0x6c3d('0x25')](respondWithResult(_0x4c0ed9,0xc9))[_0x6c3d('0x48')](handleError(_0x4c0ed9,null));};exports[_0x6c3d('0x24')]=function(_0x510336,_0x7a383e){if(_0x510336[_0x6c3d('0x49')]['id']){delete _0x510336[_0x6c3d('0x49')]['id'];}return db['VoiceRecording'][_0x6c3d('0x4a')]({'where':{'id':_0x510336[_0x6c3d('0x45')]['id']}})[_0x6c3d('0x25')](handleEntityNotFound(_0x7a383e,null))[_0x6c3d('0x25')](saveUpdates(_0x510336[_0x6c3d('0x49')],null))['then'](respondWithResult(_0x7a383e,null))[_0x6c3d('0x48')](handleError(_0x7a383e,null));};exports['describe']=function(_0x500f36,_0x1a2ac9){return db[_0x6c3d('0x2c')][_0x6c3d('0x4b')]()[_0x6c3d('0x25')](respondWithResult(_0x1a2ac9,null))[_0x6c3d('0x48')](handleError(_0x1a2ac9,null));};exports[_0x6c3d('0x4c')]=function(_0x14cbb5,_0x947640,_0x45b964){var _0x46f3dc=require('../../components/encryptor');var _0x1a260e=![];var _0x2f61af={};if(_0x14cbb5[_0x6c3d('0x33')][_0x6c3d('0x2f')]&&_0x14cbb5[_0x6c3d('0x33')]['type']===_0x6c3d('0x4d')){_0x2f61af['uniqueid']=_0x14cbb5['params']['id'];}else{_0x2f61af['id']=_0x14cbb5[_0x6c3d('0x45')]['id'];}return db['VoiceRecording']['find']({'where':_0x2f61af,'attributes':['id','value'],'raw':!![]})[_0x6c3d('0x25')](handleEntityNotFound(_0x947640,null))[_0x6c3d('0x25')](function(_0x102a9e){if(_0x102a9e){var _0x2ad813=_0x102a9e[_0x6c3d('0x4e')];var _0xc63db8=util[_0x6c3d('0x4f')](_0x6c3d('0x50'),_0x2ad813);if(fs[_0x6c3d('0x51')](_0xc63db8)){_0x1a260e=!![];return _0x46f3dc[_0x6c3d('0x52')](_0xc63db8,_0x2ad813,config['secrets'][_0x6c3d('0x53')])['then'](function(){return _0x102a9e;});}return _0x102a9e;}})[_0x6c3d('0x25')](function(_0x1daf85){if(_0x1daf85){var _0x341e38=_0x1daf85['value'];if(!fs[_0x6c3d('0x51')](_0x341e38)){throw new db[(_0x6c3d('0x54'))][(_0x6c3d('0x55'))](_0x6c3d('0x56'));}if(_0x1daf85[_0x6c3d('0x57')]){return _0x947640['download'](_0x341e38,_0x1daf85['filename']+path[_0x6c3d('0x58')](_0x341e38),function(){if(_0x1a260e){fs['unlink'](_0x341e38);}});}else{return _0x947640[_0x6c3d('0x4c')](_0x341e38,function(_0x3d30ca){if(_0x1a260e){fs[_0x6c3d('0x59')](_0x341e38);}});}}})[_0x6c3d('0x48')](function(_0xb2da74){if(_0xb2da74['message']===_0x6c3d('0x56')){_0x947640[_0x6c3d('0x19')](0x194)[_0x6c3d('0x5a')]('Not\x20found');}else{return handleError(_0x947640,null);}});};exports[_0x6c3d('0x5b')]=function(_0x1d363d,_0x477fb5,_0x49580c){var _0x342b3a=require('../../components/encryptor');var _0xbb49f5=![];var _0x38c700={'$and':[db['sequelize'][_0x6c3d('0x3f')](db['sequelize']['fn'](_0x6c3d('0x5c'),db[_0x6c3d('0x5d')][_0x6c3d('0x5e')](_0x6c3d('0x4d'))),_0x1d363d['query'][_0x6c3d('0x5f')])]};if(_0x1d363d['query'][_0x6c3d('0x2f')]&&_0x1d363d[_0x6c3d('0x33')]['type']===_0x6c3d('0x4d')){_0x38c700[_0x6c3d('0x60')]['push']({'uniqueid':_0x1d363d['params']['id']});}else{_0x38c700[_0x6c3d('0x60')]['push']({'id':_0x1d363d['params']['id']});}return db[_0x6c3d('0x2c')][_0x6c3d('0x4a')]({'where':_0x38c700,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x477fb5,null))[_0x6c3d('0x25')](function(_0x38a1e3){if(_0x38a1e3){var _0x29249a=util[_0x6c3d('0x4f')]('%s.cypher',_0x38a1e3['value']);if(fs[_0x6c3d('0x51')](_0x29249a)){_0xbb49f5=!![];return _0x342b3a[_0x6c3d('0x52')](_0x29249a,_0x38a1e3['value'],config['secrets']['recording'])[_0x6c3d('0x25')](function(){return _0x38a1e3;});}return _0x38a1e3;}})[_0x6c3d('0x25')](function(_0x28ae7a){if(_0x28ae7a){if(!fs[_0x6c3d('0x51')](_0x28ae7a[_0x6c3d('0x4e')])){throw new db['Sequelize'][(_0x6c3d('0x55'))](_0x6c3d('0x56'));}if(_0x28ae7a[_0x6c3d('0x57')]){return _0x477fb5[_0x6c3d('0x4c')](_0x28ae7a[_0x6c3d('0x4e')],_0x28ae7a['filename']+path['extname'](_0x28ae7a[_0x6c3d('0x4e')]),function(){if(_0xbb49f5){fs['unlink'](_0x28ae7a[_0x6c3d('0x4e')]);}});}else{return _0x477fb5[_0x6c3d('0x4c')](_0x28ae7a[_0x6c3d('0x4e')],function(_0x149340){if(_0xbb49f5){fs[_0x6c3d('0x59')](_0x28ae7a[_0x6c3d('0x4e')]);}});}}})['catch'](handleError(_0x477fb5,null));};exports[_0x6c3d('0x26')]=function(_0x5cfa5c,_0x548bab){return db[_0x6c3d('0x2c')][_0x6c3d('0x4a')]({'where':{'id':_0x5cfa5c[_0x6c3d('0x45')]['id']}})[_0x6c3d('0x25')](function(_0x3f6c8a){if(_[_0x6c3d('0x61')](_0x3f6c8a)){throw new ReferenceError(_0x6c3d('0x62'));}return _0x3f6c8a;})[_0x6c3d('0x25')](function(_0x4ac8f1){var _0xad2fed=_0x4ac8f1[_0x6c3d('0x4e')];logger[_0x6c3d('0x63')](_0x6c3d('0x64'),_0xad2fed);if(!_['isNil'](_0x4ac8f1[_0x6c3d('0x4e')])&&fs[_0x6c3d('0x51')](_0xad2fed)){logger['info']('File:\x20\x22'+_0xad2fed+_0x6c3d('0x65'));fs['unlinkSync'](_0xad2fed);}_0xad2fed=_0xad2fed+_0x6c3d('0x66');if(!_['isNil'](_0x4ac8f1[_0x6c3d('0x4e')])&&fs['existsSync'](_0xad2fed)){logger[_0x6c3d('0x63')](_0x6c3d('0x67')+_0xad2fed+_0x6c3d('0x65'));fs[_0x6c3d('0x68')](_0xad2fed);}return _0x4ac8f1;})['then'](function(_0x3a4c63){if(!_0x3a4c63)throw new InternalError();return _0x3a4c63[_0x6c3d('0x26')]();})['then'](function(){_0x548bab['status'](0xcc)[_0x6c3d('0x1a')]();})[_0x6c3d('0x48')](handleError(_0x548bab,null));};function getBucketslist(_0x43fb2e,_0x227520,_0xf22950){return new Promise(function(_0x47b3c3,_0x54aa07){var _0x18fcf2=new AWS['S3']({'accessKeyId':_0x227520,'secretAccessKey':_0x43fb2e,'region':_0xf22950});_0x18fcf2[_0x6c3d('0x69')]({},function(_0x67df71,_0x29a518){if(_0x67df71){return _0x54aa07(_0x67df71);}else{return _0x47b3c3(_0x29a518);}});});}function createBucket(_0x5e17e1,_0x28ac28,_0x22d917,_0x2c579e){return new Promise(function(_0x59bd0e,_0xb2079e){var _0x253ff7=new AWS['S3']({'accessKeyId':_0x28ac28,'secretAccessKey':_0x5e17e1,'region':_0x22d917});_0x253ff7[_0x6c3d('0x6a')]({'Bucket':_0x2c579e},function(_0x1de5d0,_0xa55bdf){if(_0x1de5d0){return _0xb2079e(_0x1de5d0);}else{return _0x59bd0e(_0xa55bdf);}});});}function uploadFile(_0x3a0933,_0x19a286,_0x523645,_0x5ac41c,_0x34bea7,_0x3576c2){return new Promise(function(_0x19bba2,_0x4c4a2b){var _0xe23ea5=new AWS['S3']({'accessKeyId':_0x19a286,'secretAccessKey':_0x3a0933,'region':_0x523645});_0xe23ea5[_0x6c3d('0x6b')]({'Bucket':_0x5ac41c,'Key':_0x34bea7,'Body':_0x3576c2},function(_0x4012af,_0x365120){if(_0x4012af){return _0x4c4a2b(_0x4012af);}else{return _0x19bba2(_0x365120);}});});}function startTranscribe(_0x2f40e9,_0x504b20,_0x4dbf79,_0x4dbb5b,_0x20ff7f,_0x559c65){return new Promise(function(_0x1dd29f,_0x3ba037){var _0x249cf3=new AWS['TranscribeService']({'accessKeyId':_0x504b20,'secretAccessKey':_0x2f40e9,'region':_0x4dbf79});_0x249cf3[_0x6c3d('0x6c')]({'TranscriptionJobName':_0x4dbb5b,'LanguageCode':_0x20ff7f,'Media':{'MediaFileUri':_0x559c65}},function(_0x46f7f8,_0x4574fd){if(_0x46f7f8){return _0x3ba037(_0x46f7f8);}else{return _0x1dd29f(_0x4574fd);}});});}function transcribe(_0x189cb3,_0x3db457,_0x111adc,_0x402d16,_0x5b7263,_0x1ac0f8,_0x2bb4d6){return new Promise(function(_0x43bece,_0x21b7b4){var _0xa8ad4c={};logger['info'](util[_0x6c3d('0x4f')](_0x6c3d('0x6d'),_0x189cb3,_0x5b7263));return uploadFile(_0x3db457,_0x111adc,_0x402d16,_0x5b7263,path[_0x6c3d('0x6e')](_0x1ac0f8),fs[_0x6c3d('0x6f')](_0x1ac0f8))[_0x6c3d('0x25')](function(_0x5abce1){logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')](_0x6c3d('0x70'),_0x189cb3,_0x5b7263,_0x5abce1[_0x6c3d('0x71')]));_0xa8ad4c['bucket']=_0x5abce1[_0x6c3d('0x72')];_0xa8ad4c['location']=_0x5abce1[_0x6c3d('0x71')];logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')](_0x6c3d('0x73'),_0x189cb3));return startTranscribe(_0x3db457,_0x111adc,_0x402d16,uuidv4(),_0x2bb4d6,_0x5abce1[_0x6c3d('0x71')]);})[_0x6c3d('0x25')](function(_0x400c3b){logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')]('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x189cb3,_0x400c3b['TranscriptionJob'][_0x6c3d('0x74')]));_0xa8ad4c[_0x6c3d('0x75')]=_0x400c3b[_0x6c3d('0x76')][_0x6c3d('0x74')];_0xa8ad4c[_0x6c3d('0x77')]=_0x400c3b[_0x6c3d('0x76')]['TranscriptionJobStatus'];return _0x43bece(_0xa8ad4c);})[_0x6c3d('0x48')](function(_0x280e33){return _0x21b7b4(_0x280e33);});});}exports['runTranscribe']=function(_0x33b906,_0x36c7f2,_0xe51e8a){var _0x272e7f;var _0x3efe48;var _0x1671eb;var _0x4791f2=require(_0x6c3d('0x78'));return db['VoiceRecording'][_0x6c3d('0x79')]({'where':{'id':_0x33b906[_0x6c3d('0x45')]['id']}})[_0x6c3d('0x25')](function(_0x3d2f85){if(_0x3d2f85){var _0x1cce03=util[_0x6c3d('0x4f')](_0x6c3d('0x50'),_0x3d2f85['value']);if(fs[_0x6c3d('0x51')](_0x1cce03)){cypher=!![];return _0x4791f2[_0x6c3d('0x52')](_0x1cce03,_0x3d2f85[_0x6c3d('0x4e')],config[_0x6c3d('0x7a')][_0x6c3d('0x53')])['then'](function(){return _0x3d2f85;});}return _0x3d2f85;}})[_0x6c3d('0x25')](function(_0x124d55){if(!_0x124d55){throw new db[(_0x6c3d('0x54'))][(_0x6c3d('0x55'))](_0x6c3d('0x7b'));}_0x3efe48=_0x124d55;return db[_0x6c3d('0x7c')]['findOne']({'where':{'id':0x1}});})[_0x6c3d('0x25')](handleEntityNotFound(_0x36c7f2,null))['then'](function(_0x57cd82){if(_0x57cd82){_0x272e7f=_0x57cd82;if(!_0x272e7f[_0x6c3d('0x7d')]||!_0x272e7f['transcribeAccountId']||!_0x272e7f[_0x6c3d('0x7e')]||!_0x272e7f[_0x6c3d('0x7f')]||!_0x272e7f[_0x6c3d('0x80')]){throw new db[(_0x6c3d('0x54'))][(_0x6c3d('0x55'))](_0x6c3d('0x81'));}if(_0x33b906['body'][_0x6c3d('0x82')]&&(!_0x272e7f[_0x6c3d('0x83')]||!_0x272e7f[_0x6c3d('0x84')]||!_0x272e7f[_0x6c3d('0x85')]||!_0x272e7f[_0x6c3d('0x7f')]||!_0x272e7f[_0x6c3d('0x80')])){throw new db[(_0x6c3d('0x54'))][(_0x6c3d('0x55'))](_0x6c3d('0x86'));}return db[_0x6c3d('0x87')][_0x6c3d('0x79')]({'where':{'id':_0x272e7f[_0x6c3d('0x88')]}});}})[_0x6c3d('0x25')](function(_0x9ba773){if(!_0x9ba773){throw new db[(_0x6c3d('0x54'))]['ValidationError'](_0x6c3d('0x89'));}if(!_0x9ba773['data1']||!_0x9ba773['data2']){throw new db[(_0x6c3d('0x54'))]['ValidationError'](_0x6c3d('0x8a'));}_0x1671eb=_0x9ba773;return getBucketslist(_0x1671eb[_0x6c3d('0x8b')],_0x1671eb[_0x6c3d('0x8c')],_0x272e7f['transcribeRegion']);})[_0x6c3d('0x25')](function(_0xae82b4){if(_0xae82b4&&_0xae82b4[_0x6c3d('0x8d')]){var _0x11322a=_[_0x6c3d('0x4a')](_0xae82b4[_0x6c3d('0x8d')],function(_0x5edde5){return _0x5edde5['Name']===_0x272e7f[_0x6c3d('0x80')];});if(!_0x11322a){logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')](_0x6c3d('0x8e'),_0x33b906[_0x6c3d('0x45')]['id'],_0x272e7f[_0x6c3d('0x80')]));return createBucket(_0x1671eb[_0x6c3d('0x8b')],_0x1671eb[_0x6c3d('0x8c')],_0x272e7f[_0x6c3d('0x7e')],_0x272e7f[_0x6c3d('0x80')]);}logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')](_0x6c3d('0x8f'),_0x33b906[_0x6c3d('0x45')]['id'],_0x272e7f[_0x6c3d('0x80')]));return;}})['then'](function(_0x50f7a4){if(_0x3efe48[_0x6c3d('0x77')]===_0x6c3d('0x90')){return transcribe(_0x33b906[_0x6c3d('0x45')]['id'],_0x1671eb[_0x6c3d('0x8b')],_0x1671eb[_0x6c3d('0x8c')],_0x272e7f[_0x6c3d('0x7e')],_0x272e7f['bucket'],_0x3efe48['value'],_0x272e7f[_0x6c3d('0x7f')]);}else{logger[_0x6c3d('0x63')](util[_0x6c3d('0x4f')](_0x6c3d('0x91'),_0x33b906[_0x6c3d('0x45')]['id']));return{'transcribeStatus':'IN_PROGRESS'};}})[_0x6c3d('0x25')](function(_0x24f9f6){if(_0x24f9f6){_0x24f9f6['tempSentiment']=_0x33b906[_0x6c3d('0x49')][_0x6c3d('0x82')];return _0x3efe48[_0x6c3d('0x92')](_0x24f9f6);}})[_0x6c3d('0x25')](respondWithResult(_0x36c7f2,null))['catch'](handleError(_0x36c7f2,null));};function writeFile(_0x4cc22d,_0x34a4ac){return new Promise(function(_0x4a1ed8,_0x5c49be){fs[_0x6c3d('0x93')](_0x34a4ac,_0x4cc22d,function(_0x4408b4,_0x4a4f94){if(_0x4408b4){return _0x5c49be(_0x4408b4);}else{return _0x4a1ed8(_0x4a4f94);}});});}exports[_0x6c3d('0x94')]=function(_0x3859c2,_0x3bd5c1,_0x5f5bc6){return db[_0x6c3d('0x2c')][_0x6c3d('0x79')]({'where':{'id':_0x3859c2[_0x6c3d('0x45')]['id']}})[_0x6c3d('0x25')](handleEntityNotFound(_0x3bd5c1))['then'](function(_0x3a1c06){if(_0x3a1c06&&_0x3a1c06['fileText']){var _0x1c6afe=_0x3a1c06[_0x6c3d('0x95')];var _0x463666=config[_0x6c3d('0x96')]+'/server/files/transcribes/transcribe_'+_0x3a1c06['id']+_0x6c3d('0x97');if(fs[_0x6c3d('0x51')](_0x463666)){return _0x463666;}return writeFile(_0x1c6afe,_0x463666)[_0x6c3d('0x25')](function(){return _0x463666;});}else{throw new db['Sequelize'][(_0x6c3d('0x55'))](_0x6c3d('0x98'));}})[_0x6c3d('0x25')](function(_0x18f901){return _0x3bd5c1['download'](_0x18f901);})['catch'](handleError(_0x3bd5c1));}; \ No newline at end of file +var _0x44f4=['runTranscribe','findOne','Setting','transcribe','transcribeAccountId','Transcribe\x20not\x20configured','runSentiment','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','Cloud\x20Provider\x20not\x20configured','data2','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','transcribeRegion','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','updateAttributes','writeFile','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','squel','crypto','querystring','aws-sdk','uuid/v4','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','end','error','name','send','index','map','VoiceRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','where','pick','filter','merge','type','VIRTUAL','options','include','rows','params','keys','find','catch','create','update','body','describe','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','download','extname','unlink','Not\x20found','downloads','sequelize','MD5','token','$and','isNil','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','unlinkSync','.cypher','listBuckets','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)','Bucket','location','Location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','transcribeName','TranscriptionJobName','transcribeStatus','TranscriptionJobStatus'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x44f4,0x1e9));var _0x444f=function(_0x1cc8b5,_0x53ead9){_0x1cc8b5=_0x1cc8b5-0x0;var _0x96f01a=_0x44f4[_0x1cc8b5];return _0x96f01a;};'use strict';var emlformat=require(_0x444f('0x0'));var rimraf=require(_0x444f('0x1'));var zipdir=require(_0x444f('0x2'));var jsonpatch=require(_0x444f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x444f('0x4'));var Mustache=require(_0x444f('0x5'));var util=require(_0x444f('0x6'));var path=require('path');var sox=require(_0x444f('0x7'));var csv=require(_0x444f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x444f('0x9'));var crypto=require(_0x444f('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x444f('0x8'));var querystring=require(_0x444f('0xb'));var Papa=require('papaparse');var AWS=require(_0x444f('0xc'));var uuidv4=require(_0x444f('0xd'));var Redis=require(_0x444f('0xe'));var authService=require(_0x444f('0xf'));var qs=require(_0x444f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x444f('0x11'));var logger=require(_0x444f('0x12'))(_0x444f('0x13'));var utils=require(_0x444f('0x14'));var config=require(_0x444f('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ad083,_0x98887c){_0x98887c=_0x98887c||0xcc;return function(_0xc29fef){if(_0xc29fef){return _0x3ad083[_0x444f('0x16')](_0x98887c);}return _0x3ad083['status'](_0x98887c)['end']();};}function respondWithResult(_0x179ba8,_0x4d14f8){_0x4d14f8=_0x4d14f8||0xc8;return function(_0x20c4be){if(_0x20c4be){return _0x179ba8[_0x444f('0x17')](_0x4d14f8)[_0x444f('0x18')](_0x20c4be);}};}function respondWithFilteredResult(_0x3e262d,_0x1da94b){return function(_0x13990d){if(_0x13990d){var _0x96a62c=typeof _0x1da94b['offset']===_0x444f('0x19')&&typeof _0x1da94b[_0x444f('0x1a')]===_0x444f('0x19');var _0x13dbc5=_0x13990d[_0x444f('0x1b')];var _0x64c7e4=_0x96a62c?0x0:_0x1da94b[_0x444f('0x1c')];var _0x3f53c5=_0x96a62c?_0x13990d[_0x444f('0x1b')]:_0x1da94b[_0x444f('0x1c')]+_0x1da94b[_0x444f('0x1a')];var _0x14faaf;if(_0x3f53c5>=_0x13dbc5){_0x3f53c5=_0x13dbc5;_0x14faaf=0xc8;}else{_0x14faaf=0xce;}_0x3e262d['status'](_0x14faaf);return _0x3e262d[_0x444f('0x1d')](_0x444f('0x1e'),_0x64c7e4+'-'+_0x3f53c5+'/'+_0x13dbc5)[_0x444f('0x18')](_0x13990d);}return null;};}function patchUpdates(_0x55080c){return function(_0x35a938){try{jsonpatch[_0x444f('0x1f')](_0x35a938,_0x55080c,!![]);}catch(_0x28a1cd){return BPromise['reject'](_0x28a1cd);}return _0x35a938[_0x444f('0x20')]();};}function saveUpdates(_0x1f5ebd,_0x2b7829){return function(_0x4c9a17){if(_0x4c9a17){return _0x4c9a17['update'](_0x1f5ebd)[_0x444f('0x21')](function(_0x33e123){return _0x33e123;});}return null;};}function removeEntity(_0x5d8591,_0x7672a6){return function(_0x4d2169){if(_0x4d2169){return _0x4d2169[_0x444f('0x22')]()[_0x444f('0x21')](function(){_0x5d8591[_0x444f('0x17')](0xcc)[_0x444f('0x23')]();});}};}function handleEntityNotFound(_0x2aca01,_0x501837){return function(_0x1c3315){if(!_0x1c3315){_0x2aca01[_0x444f('0x16')](0x194);}return _0x1c3315;};}function handleError(_0x56842c,_0x2769bc){_0x2769bc=_0x2769bc||0x1f4;return function(_0x1f6f8d){logger[_0x444f('0x24')](_0x1f6f8d['stack']);if(_0x1f6f8d['name']){delete _0x1f6f8d[_0x444f('0x25')];}_0x56842c['status'](_0x2769bc)[_0x444f('0x26')](_0x1f6f8d);};}exports[_0x444f('0x27')]=function(_0x333ee2,_0x49d7bd){var _0x1963b7={},_0x435bdd={},_0x2beb67={'count':0x0,'rows':[]};var _0x25814b=_[_0x444f('0x28')](db[_0x444f('0x29')][_0x444f('0x2a')],function(_0x24d17c){return{'name':_0x24d17c[_0x444f('0x2b')],'type':_0x24d17c['type'][_0x444f('0x2c')]};});_0x435bdd[_0x444f('0x2d')]=_[_0x444f('0x2e')](_['map'](_0x25814b,'name'),[_0x444f('0x2f')]);_0x435bdd[_0x444f('0x30')]=_['keys'](_0x333ee2[_0x444f('0x30')]);_0x435bdd[_0x444f('0x31')]=_[_0x444f('0x32')](_0x435bdd[_0x444f('0x2d')],_0x435bdd[_0x444f('0x30')]);_0x1963b7['attributes']=_[_0x444f('0x32')](_0x435bdd[_0x444f('0x2d')],qs[_0x444f('0x33')](_0x333ee2[_0x444f('0x30')]['fields']));_0x1963b7[_0x444f('0x34')]=_0x1963b7[_0x444f('0x34')][_0x444f('0x35')]?_0x1963b7[_0x444f('0x34')]:_0x435bdd[_0x444f('0x2d')];if(!_0x333ee2[_0x444f('0x30')][_0x444f('0x36')]('nolimit')){_0x1963b7[_0x444f('0x1a')]=qs[_0x444f('0x1a')](_0x333ee2[_0x444f('0x30')][_0x444f('0x1a')]);_0x1963b7[_0x444f('0x1c')]=qs[_0x444f('0x1c')](_0x333ee2[_0x444f('0x30')][_0x444f('0x1c')]);}_0x1963b7[_0x444f('0x37')]=qs['sort'](_0x333ee2[_0x444f('0x30')]['sort']);_0x1963b7[_0x444f('0x38')]=qs[_0x444f('0x31')](_[_0x444f('0x39')](_0x333ee2[_0x444f('0x30')],_0x435bdd[_0x444f('0x31')]),_0x25814b);if(_0x333ee2[_0x444f('0x30')][_0x444f('0x3a')]){_0x1963b7[_0x444f('0x38')]=_[_0x444f('0x3b')](_0x1963b7['where'],{'$or':_[_0x444f('0x28')](_0x25814b,function(_0x3df78e){if(_0x3df78e[_0x444f('0x3c')]!==_0x444f('0x3d')){var _0x488f8d={};_0x488f8d[_0x3df78e['name']]={'$like':'%'+_0x333ee2['query'][_0x444f('0x3a')]+'%'};return _0x488f8d;}})});}_0x1963b7=_[_0x444f('0x3b')]({},_0x1963b7,_0x333ee2[_0x444f('0x3e')]);var _0x2c5181={'where':_0x1963b7['where']};return db[_0x444f('0x29')][_0x444f('0x1b')](_0x2c5181)[_0x444f('0x21')](function(_0x31d72c){_0x2beb67[_0x444f('0x1b')]=_0x31d72c;if(_0x333ee2[_0x444f('0x30')]['includeAll']){_0x1963b7[_0x444f('0x3f')]=[{'all':!![]}];}return db[_0x444f('0x29')]['findAll'](_0x1963b7);})[_0x444f('0x21')](function(_0x5890a1){_0x2beb67[_0x444f('0x40')]=_0x5890a1;return _0x2beb67;})[_0x444f('0x21')](respondWithFilteredResult(_0x49d7bd,_0x1963b7))['catch'](handleError(_0x49d7bd,null));};exports['show']=function(_0x43ba25,_0x350db4){var _0x353a14={'raw':![],'where':{'id':_0x43ba25[_0x444f('0x41')]['id']}},_0x5c2868={};_0x5c2868['model']=_[_0x444f('0x42')](db[_0x444f('0x29')][_0x444f('0x2a')]);_0x5c2868['query']=_['keys'](_0x43ba25[_0x444f('0x30')]);_0x5c2868[_0x444f('0x31')]=_[_0x444f('0x32')](_0x5c2868[_0x444f('0x2d')],_0x5c2868['query']);_0x353a14[_0x444f('0x34')]=_[_0x444f('0x32')](_0x5c2868[_0x444f('0x2d')],qs[_0x444f('0x33')](_0x43ba25['query'][_0x444f('0x33')]));_0x353a14['attributes']=_0x353a14['attributes']['length']?_0x353a14[_0x444f('0x34')]:_0x5c2868[_0x444f('0x2d')];if(_0x43ba25[_0x444f('0x30')]['includeAll']){_0x353a14[_0x444f('0x3f')]=[{'all':!![]}];}_0x353a14=_['merge']({},_0x353a14,_0x43ba25[_0x444f('0x3e')]);return db[_0x444f('0x29')][_0x444f('0x43')](_0x353a14)[_0x444f('0x21')](handleEntityNotFound(_0x350db4,null))['then'](respondWithResult(_0x350db4,null))[_0x444f('0x44')](handleError(_0x350db4,null));};exports['create']=function(_0x5dba1a,_0x2619c2){return db[_0x444f('0x29')][_0x444f('0x45')](_0x5dba1a['body'],{})['then'](respondWithResult(_0x2619c2,0xc9))[_0x444f('0x44')](handleError(_0x2619c2,null));};exports[_0x444f('0x46')]=function(_0x32ad31,_0x1e55de){if(_0x32ad31[_0x444f('0x47')]['id']){delete _0x32ad31[_0x444f('0x47')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x32ad31[_0x444f('0x41')]['id']}})[_0x444f('0x21')](handleEntityNotFound(_0x1e55de,null))['then'](saveUpdates(_0x32ad31[_0x444f('0x47')],null))[_0x444f('0x21')](respondWithResult(_0x1e55de,null))['catch'](handleError(_0x1e55de,null));};exports[_0x444f('0x48')]=function(_0x3ff3c1,_0x1ab302){return db[_0x444f('0x29')][_0x444f('0x48')]()['then'](respondWithResult(_0x1ab302,null))[_0x444f('0x44')](handleError(_0x1ab302,null));};exports['download']=function(_0x5581dd,_0x544b97,_0x4f0743){var _0x5e66be=require(_0x444f('0x49'));var _0x24f6f3=![];var _0x2f6987={};if(_0x5581dd[_0x444f('0x30')]['type']&&_0x5581dd['query'][_0x444f('0x3c')]===_0x444f('0x4a')){_0x2f6987[_0x444f('0x4a')]=_0x5581dd[_0x444f('0x41')]['id'];}else{_0x2f6987['id']=_0x5581dd[_0x444f('0x41')]['id'];}return db[_0x444f('0x29')][_0x444f('0x43')]({'where':_0x2f6987,'attributes':['id',_0x444f('0x4b')],'raw':!![]})[_0x444f('0x21')](handleEntityNotFound(_0x544b97,null))[_0x444f('0x21')](function(_0x524b38){if(_0x524b38){var _0x1e6365=_0x524b38[_0x444f('0x4b')];var _0x3b99fe=util['format'](_0x444f('0x4c'),_0x1e6365);if(fs[_0x444f('0x4d')](_0x3b99fe)){_0x24f6f3=!![];return _0x5e66be[_0x444f('0x4e')](_0x3b99fe,_0x1e6365,config[_0x444f('0x4f')][_0x444f('0x50')])['then'](function(){return _0x524b38;});}return _0x524b38;}})[_0x444f('0x21')](function(_0x4dc6b9){if(_0x4dc6b9){var _0x4e7d4e=_0x4dc6b9[_0x444f('0x4b')];if(!fs['existsSync'](_0x4e7d4e)){throw new db[(_0x444f('0x51'))][(_0x444f('0x52'))](_0x444f('0x53'));}if(_0x4dc6b9['filename']){return _0x544b97[_0x444f('0x54')](_0x4e7d4e,_0x4dc6b9['filename']+path[_0x444f('0x55')](_0x4e7d4e),function(){if(_0x24f6f3){fs['unlink'](_0x4e7d4e);}});}else{return _0x544b97['download'](_0x4e7d4e,function(_0x15ad4d){if(_0x24f6f3){fs[_0x444f('0x56')](_0x4e7d4e);}});}}})[_0x444f('0x44')](function(_0x5693ad){if(_0x5693ad['message']===_0x444f('0x53')){_0x544b97[_0x444f('0x17')](0x194)[_0x444f('0x26')](_0x444f('0x57'));}else{return handleError(_0x544b97,null);}});};exports[_0x444f('0x58')]=function(_0x55f15c,_0x5bce1e,_0x3ca007){var _0xd65754=require('../../components/encryptor');var _0x3a37b2=![];var _0x315779={'$and':[db[_0x444f('0x59')]['where'](db[_0x444f('0x59')]['fn'](_0x444f('0x5a'),db[_0x444f('0x59')]['col'](_0x444f('0x4a'))),_0x55f15c['query'][_0x444f('0x5b')])]};if(_0x55f15c['query'][_0x444f('0x3c')]&&_0x55f15c[_0x444f('0x30')][_0x444f('0x3c')]===_0x444f('0x4a')){_0x315779[_0x444f('0x5c')]['push']({'uniqueid':_0x55f15c['params']['id']});}else{_0x315779['$and']['push']({'id':_0x55f15c[_0x444f('0x41')]['id']});}return db['VoiceRecording'][_0x444f('0x43')]({'where':_0x315779,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x5bce1e,null))['then'](function(_0x9eba7f){if(_0x9eba7f){var _0x41b61e=util[_0x444f('0x2f')](_0x444f('0x4c'),_0x9eba7f[_0x444f('0x4b')]);if(fs['existsSync'](_0x41b61e)){_0x3a37b2=!![];return _0xd65754[_0x444f('0x4e')](_0x41b61e,_0x9eba7f[_0x444f('0x4b')],config[_0x444f('0x4f')]['recording'])[_0x444f('0x21')](function(){return _0x9eba7f;});}return _0x9eba7f;}})[_0x444f('0x21')](function(_0x113bf2){if(_0x113bf2){if(!fs[_0x444f('0x4d')](_0x113bf2[_0x444f('0x4b')])){throw new db[(_0x444f('0x51'))][(_0x444f('0x52'))](_0x444f('0x53'));}if(_0x113bf2['filename']){return _0x5bce1e[_0x444f('0x54')](_0x113bf2['value'],_0x113bf2['filename']+path[_0x444f('0x55')](_0x113bf2[_0x444f('0x4b')]),function(){if(_0x3a37b2){fs[_0x444f('0x56')](_0x113bf2['value']);}});}else{return _0x5bce1e[_0x444f('0x54')](_0x113bf2[_0x444f('0x4b')],function(_0x1d85be){if(_0x3a37b2){fs['unlink'](_0x113bf2[_0x444f('0x4b')]);}});}}})[_0x444f('0x44')](handleError(_0x5bce1e,null));};exports[_0x444f('0x22')]=function(_0x2405c2,_0x5f0968){return db[_0x444f('0x29')][_0x444f('0x43')]({'where':{'id':_0x2405c2[_0x444f('0x41')]['id']}})[_0x444f('0x21')](function(_0x52ee17){if(_[_0x444f('0x5d')](_0x52ee17)){throw new ReferenceError(_0x444f('0x5e'));}return _0x52ee17;})[_0x444f('0x21')](function(_0xf34307){var _0x5d8e48=_0xf34307['value'];logger['info'](_0x444f('0x5f'),_0x5d8e48);if(!_[_0x444f('0x5d')](_0xf34307['value'])&&fs[_0x444f('0x4d')](_0x5d8e48)){logger[_0x444f('0x60')](_0x444f('0x61')+_0x5d8e48+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x444f('0x62')](_0x5d8e48);}_0x5d8e48=_0x5d8e48+_0x444f('0x63');if(!_[_0x444f('0x5d')](_0xf34307['value'])&&fs['existsSync'](_0x5d8e48)){logger[_0x444f('0x60')]('File:\x20\x22'+_0x5d8e48+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x444f('0x62')](_0x5d8e48);}return _0xf34307;})[_0x444f('0x21')](function(_0x1d217d){if(!_0x1d217d)throw new InternalError();return _0x1d217d[_0x444f('0x22')]();})[_0x444f('0x21')](function(){_0x5f0968[_0x444f('0x17')](0xcc)[_0x444f('0x23')]();})[_0x444f('0x44')](handleError(_0x5f0968,null));};function getBucketslist(_0x11bcd7,_0xae0f9f,_0x12a0c8){return new Promise(function(_0x78b2c8,_0x401c4e){var _0x2db098=new AWS['S3']({'accessKeyId':_0xae0f9f,'secretAccessKey':_0x11bcd7,'region':_0x12a0c8});_0x2db098[_0x444f('0x64')]({},function(_0x13983e,_0x26b561){if(_0x13983e){return _0x401c4e(_0x13983e);}else{return _0x78b2c8(_0x26b561);}});});}function createBucket(_0x58c2ca,_0x7011ba,_0x377d28,_0x1dca5c){return new Promise(function(_0x46eceb,_0x38d2eb){var _0x5d6a56=new AWS['S3']({'accessKeyId':_0x7011ba,'secretAccessKey':_0x58c2ca,'region':_0x377d28});_0x5d6a56[_0x444f('0x65')]({'Bucket':_0x1dca5c},function(_0x6d5991,_0x1ea3c5){if(_0x6d5991){return _0x38d2eb(_0x6d5991);}else{return _0x46eceb(_0x1ea3c5);}});});}function uploadFile(_0x287e55,_0xfd90a4,_0x2c90f6,_0x41619f,_0x180495,_0x44dd16){return new Promise(function(_0x26e7b9,_0x1d392b){var _0x176b83=new AWS['S3']({'accessKeyId':_0xfd90a4,'secretAccessKey':_0x287e55,'region':_0x2c90f6});_0x176b83[_0x444f('0x66')]({'Bucket':_0x41619f,'Key':_0x180495,'Body':_0x44dd16},function(_0x3d67e3,_0x43ab64){if(_0x3d67e3){return _0x1d392b(_0x3d67e3);}else{return _0x26e7b9(_0x43ab64);}});});}function startTranscribe(_0x7c4f04,_0x19fe3d,_0x4f1c60,_0x4b6892,_0x33acd4,_0xfe712c){return new Promise(function(_0x33fd89,_0x5bd0eb){var _0x2f5d92=new AWS[(_0x444f('0x67'))]({'accessKeyId':_0x19fe3d,'secretAccessKey':_0x7c4f04,'region':_0x4f1c60});_0x2f5d92[_0x444f('0x68')]({'TranscriptionJobName':_0x4b6892,'LanguageCode':_0x33acd4,'Media':{'MediaFileUri':_0xfe712c}},function(_0x4018ed,_0x4a75ac){if(_0x4018ed){return _0x5bd0eb(_0x4018ed);}else{return _0x33fd89(_0x4a75ac);}});});}function transcribe(_0x23277e,_0xb894f2,_0x5dbd33,_0x42de01,_0x4744ca,_0x20391a,_0x1d434d){return new Promise(function(_0x1c4d8f,_0x226364){var _0x128dd3={};logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x69'),_0x23277e,_0x4744ca));return uploadFile(_0xb894f2,_0x5dbd33,_0x42de01,_0x4744ca,path[_0x444f('0x6a')](_0x20391a),fs[_0x444f('0x6b')](_0x20391a))['then'](function(_0x29a82b){logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x6c'),_0x23277e,_0x4744ca,_0x29a82b['Location']));_0x128dd3['bucket']=_0x29a82b[_0x444f('0x6d')];_0x128dd3[_0x444f('0x6e')]=_0x29a82b[_0x444f('0x6f')];logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x70'),_0x23277e));return startTranscribe(_0xb894f2,_0x5dbd33,_0x42de01,uuidv4(),_0x1d434d,_0x29a82b[_0x444f('0x6f')]);})[_0x444f('0x21')](function(_0x3a9c91){logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x71'),_0x23277e,_0x3a9c91[_0x444f('0x72')]['TranscriptionJobName']));_0x128dd3[_0x444f('0x73')]=_0x3a9c91[_0x444f('0x72')][_0x444f('0x74')];_0x128dd3[_0x444f('0x75')]=_0x3a9c91[_0x444f('0x72')][_0x444f('0x76')];return _0x1c4d8f(_0x128dd3);})[_0x444f('0x44')](function(_0x3b6520){return _0x226364(_0x3b6520);});});}exports[_0x444f('0x77')]=function(_0x114adb,_0x545240,_0x33c967){var _0x1d03cb;var _0x515e31;var _0x2a7fb3;var _0x15e4e1=require(_0x444f('0x49'));return db['VoiceRecording'][_0x444f('0x78')]({'where':{'id':_0x114adb[_0x444f('0x41')]['id']}})['then'](function(_0x6decac){if(_0x6decac){var _0x5ab906=util['format'](_0x444f('0x4c'),_0x6decac['value']);if(fs['existsSync'](_0x5ab906)){cypher=!![];return _0x15e4e1[_0x444f('0x4e')](_0x5ab906,_0x6decac[_0x444f('0x4b')],config[_0x444f('0x4f')][_0x444f('0x50')])['then'](function(){return _0x6decac;});}return _0x6decac;}})[_0x444f('0x21')](function(_0x13e4b2){if(!_0x13e4b2){throw new db['Sequelize'][(_0x444f('0x52'))]('Voice\x20Recording\x20not\x20found');}_0x515e31=_0x13e4b2;return db[_0x444f('0x79')][_0x444f('0x78')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x545240,null))[_0x444f('0x21')](function(_0x8931a5){if(_0x8931a5){_0x1d03cb=_0x8931a5;if(!_0x1d03cb[_0x444f('0x7a')]||!_0x1d03cb[_0x444f('0x7b')]||!_0x1d03cb['transcribeRegion']||!_0x1d03cb['language']||!_0x1d03cb['bucket']){throw new db['Sequelize'][(_0x444f('0x52'))](_0x444f('0x7c'));}if(_0x114adb[_0x444f('0x47')][_0x444f('0x7d')]&&(!_0x1d03cb[_0x444f('0x7e')]||!_0x1d03cb[_0x444f('0x7f')]||!_0x1d03cb[_0x444f('0x80')]||!_0x1d03cb[_0x444f('0x81')]||!_0x1d03cb[_0x444f('0x82')])){throw new db[(_0x444f('0x51'))]['ValidationError'](_0x444f('0x83'));}return db[_0x444f('0x84')][_0x444f('0x78')]({'where':{'id':_0x1d03cb[_0x444f('0x7b')]}});}})[_0x444f('0x21')](function(_0x1f786e){if(!_0x1f786e){throw new db['Sequelize'][(_0x444f('0x52'))](_0x444f('0x85'));}if(!_0x1f786e[_0x444f('0x86')]||!_0x1f786e['data2']){throw new db['Sequelize'][(_0x444f('0x52'))](_0x444f('0x87'));}_0x2a7fb3=_0x1f786e;return getBucketslist(_0x2a7fb3[_0x444f('0x86')],_0x2a7fb3[_0x444f('0x88')],_0x1d03cb['transcribeRegion']);})['then'](function(_0x41b4cd){if(_0x41b4cd&&_0x41b4cd[_0x444f('0x89')]){var _0x58cfb0=_[_0x444f('0x43')](_0x41b4cd[_0x444f('0x89')],function(_0x1ead9d){return _0x1ead9d['Name']===_0x1d03cb[_0x444f('0x82')];});if(!_0x58cfb0){logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x8a'),_0x114adb[_0x444f('0x41')]['id'],_0x1d03cb[_0x444f('0x82')]));return createBucket(_0x2a7fb3[_0x444f('0x86')],_0x2a7fb3[_0x444f('0x88')],_0x1d03cb[_0x444f('0x8b')],_0x1d03cb[_0x444f('0x82')]);}logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x8c'),_0x114adb[_0x444f('0x41')]['id'],_0x1d03cb[_0x444f('0x82')]));return;}})[_0x444f('0x21')](function(_0x231a11){if(_0x515e31[_0x444f('0x75')]===_0x444f('0x8d')){return transcribe(_0x114adb['params']['id'],_0x2a7fb3[_0x444f('0x86')],_0x2a7fb3[_0x444f('0x88')],_0x1d03cb[_0x444f('0x8b')],_0x1d03cb[_0x444f('0x82')],_0x515e31[_0x444f('0x4b')],_0x1d03cb['language']);}else{logger[_0x444f('0x60')](util[_0x444f('0x2f')](_0x444f('0x8e'),_0x114adb[_0x444f('0x41')]['id']));return{'transcribeStatus':_0x444f('0x8f')};}})[_0x444f('0x21')](function(_0x28d406){if(_0x28d406){_0x28d406[_0x444f('0x90')]=_0x114adb['body'][_0x444f('0x7d')];return _0x515e31[_0x444f('0x91')](_0x28d406);}})[_0x444f('0x21')](respondWithResult(_0x545240,null))['catch'](handleError(_0x545240,null));};function writeFile(_0x37d54c,_0x51baa9){return new Promise(function(_0x5b46b7,_0x4ef007){fs[_0x444f('0x92')](_0x51baa9,_0x37d54c,function(_0x5264f4,_0x144c3c){if(_0x5264f4){return _0x4ef007(_0x5264f4);}else{return _0x5b46b7(_0x144c3c);}});});}exports[_0x444f('0x93')]=function(_0x136db9,_0x1d5718,_0x41880e){return db['VoiceRecording'][_0x444f('0x78')]({'where':{'id':_0x136db9[_0x444f('0x41')]['id']}})[_0x444f('0x21')](handleEntityNotFound(_0x1d5718))['then'](function(_0x388163){if(_0x388163&&_0x388163['fileText']){var _0x239778=_0x388163[_0x444f('0x94')];var _0x5874fa=config[_0x444f('0x95')]+_0x444f('0x96')+_0x388163['id']+_0x444f('0x97');if(fs[_0x444f('0x4d')](_0x5874fa)){return _0x5874fa;}return writeFile(_0x239778,_0x5874fa)[_0x444f('0x21')](function(){return _0x5874fa;});}else{throw new db[(_0x444f('0x51'))]['ValidationError']('Transcript\x20not\x20available');}})['then'](function(_0x189c67){return _0x1d5718[_0x444f('0x54')](_0x189c67);})[_0x444f('0x44')](handleError(_0x1d5718));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 96f7be6..7726ed1 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 _0xe033=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x5c2ad8,_0x1cbbf8){var _0x4c2cd3=function(_0x6e2e12){while(--_0x6e2e12){_0x5c2ad8['push'](_0x5c2ad8['shift']());}};_0x4c2cd3(++_0x1cbbf8);}(_0xe033,0x161));var _0x3e03=function(_0x52dbdf,_0x3ba6e2){_0x52dbdf=_0x52dbdf-0x0;var _0xeb0f59=_0xe033[_0x52dbdf];return _0xeb0f59;};'use strict';var _=require(_0x3e03('0x0'));var util=require(_0x3e03('0x1'));var logger=require(_0x3e03('0x2'))(_0x3e03('0x3'));var moment=require('moment');var BPromise=require(_0x3e03('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e03('0x5'));var rimraf=require(_0x3e03('0x6'));var config=require('../../config/environment');var attributes=require(_0x3e03('0x7'));module[_0x3e03('0x8')]=function(_0x264e4a,_0x2dda07){return _0x264e4a[_0x3e03('0x9')](_0x3e03('0xa'),attributes,{'tableName':_0x3e03('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7757=['exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceRecording.attributes'];(function(_0x5871ef,_0x2d6448){var _0x3f3e77=function(_0x451757){while(--_0x451757){_0x5871ef['push'](_0x5871ef['shift']());}};_0x3f3e77(++_0x2d6448);}(_0x7757,0x12b));var _0x7775=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x7757[_0x40ac5e];return _0x2839d6;};'use strict';var _=require('lodash');var util=require(_0x7775('0x0'));var logger=require(_0x7775('0x1'))(_0x7775('0x2'));var moment=require(_0x7775('0x3'));var BPromise=require(_0x7775('0x4'));var rp=require(_0x7775('0x5'));var fs=require('fs');var path=require(_0x7775('0x6'));var rimraf=require(_0x7775('0x7'));var config=require('../../config/environment');var attributes=require(_0x7775('0x8'));module[_0x7775('0x9')]=function(_0x579aac,_0x433ca8){return _0x579aac[_0x7775('0xa')](_0x7775('0xb'),attributes,{'tableName':_0x7775('0xc'),'paranoid':![],'indexes':[{'name':_0x7775('0xd'),'fields':[_0x7775('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 0394a1d..7f5524e 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 _0x7b84=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x52684f,_0xff73fc){var _0x4a55f0=function(_0x8ce37c){while(--_0x8ce37c){_0x52684f['push'](_0x52684f['shift']());}};_0x4a55f0(++_0xff73fc);}(_0x7b84,0x17c));var _0x47b8=function(_0x53f9bb,_0x2aaf5e){_0x53f9bb=_0x53f9bb-0x0;var _0x2c560c=_0x7b84[_0x53f9bb];return _0x2c560c;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('VoiceRecording,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['UpdateVoiceRecording']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['VoiceRecording']['update'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1c')]||null:null,'attributes':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1e')]||null:null})[_0x47b8('0xe')](function(_0x54f6bc){logger[_0x47b8('0xf')](_0x47b8('0x1f'),_0x4f7317);logger['debug'](_0x47b8('0x1f'),_0x4f7317,JSON[_0x47b8('0x14')](_0x54f6bc));_0x36faf1(_0x54f6bc);})[_0x47b8('0x19')](function(_0x142fb6){logger['error'](_0x47b8('0x1f'),_0x142fb6[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x142fb6[_0x47b8('0x17')]));});});};exports[_0x47b8('0x20')]=function(_0xbf5ce9){var _0x40918f=this;return new Promise(function(_0x568c1e,_0x43fd49){var _0x1f719a=require('../../components/encryptor');var _0x195a66;return db[_0x47b8('0x21')][_0x47b8('0x22')]({'attributes':['id',_0x47b8('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x162d96){_0x195a66=_0x162d96;return db['VoiceRecording'][_0x47b8('0x24')](_0xbf5ce9[_0x47b8('0x25')]);})[_0x47b8('0xe')](function(_0x2e540d){if(_0x195a66['callRecordingEncryption']&&fs[_0x47b8('0x26')](_0x2e540d[_0x47b8('0x27')])){var _0x402e7c=util[_0x47b8('0x28')](_0x47b8('0x29'),_0x2e540d[_0x47b8('0x27')]);return _0x1f719a['encryptFile'](_0x2e540d['value'],_0x402e7c,config['secrets'][_0x47b8('0x2a')])[_0x47b8('0xe')](function(){fs[_0x47b8('0x2b')](_0x2e540d['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2e540d;});}return _0x2e540d;})['then'](function(_0x347769){logger[_0x47b8('0xf')](_0x47b8('0x20'),_0xbf5ce9);logger[_0x47b8('0x12')](_0x47b8('0x20'),_0xbf5ce9,JSON[_0x47b8('0x14')](_0x347769));_0x568c1e(_0x347769);})[_0x47b8('0x19')](function(_0x460dcc){logger[_0x47b8('0x15')]('CreateVoiceRecording',_0x460dcc['message'],_0xbf5ce9);_0x43fd49(_0x40918f[_0x47b8('0x15')](0x1f4,_0x460dcc[_0x47b8('0x17')]));});});}; \ No newline at end of file +var _0x7b84=['VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','options','raw','where','attributes','limit','UpdateVoiceRecording','CreateVoiceRecording','Setting','findOne','callRecordingEncryption','create','body','existsSync','value','format','%s.cypher','recording','unlink','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x7b84,0x17c));var _0x47b8=function(_0x1f2370,_0xe35b38){_0x1f2370=_0x1f2370-0x0;var _0x41166b=_0x7b84[_0x1f2370];return _0x41166b;};'use strict';var _=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var moment=require(_0x47b8('0x2'));var BPromise=require(_0x47b8('0x3'));var rs=require(_0x47b8('0x4'));var fs=require('fs');var Redis=require(_0x47b8('0x5'));var db=require(_0x47b8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x47b8('0x7'))(_0x47b8('0x8'));var config=require(_0x47b8('0x9'));var jayson=require(_0x47b8('0xa'));var client=jayson[_0x47b8('0xb')][_0x47b8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53e656,_0x3867ca,_0x3ce846){return new BPromise(function(_0x46245a,_0xb845c9){return client[_0x47b8('0xd')](_0x53e656,_0x3ce846)[_0x47b8('0xe')](function(_0x24d240){logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));logger[_0x47b8('0x12')](_0x47b8('0x13'),_0x3867ca,_0x47b8('0x11'),JSON[_0x47b8('0x14')](_0x24d240));if(_0x24d240[_0x47b8('0x15')]){if(_0x24d240[_0x47b8('0x15')][_0x47b8('0x16')]===0x1f4){logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0xb845c9(_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);}logger[_0x47b8('0x15')](_0x47b8('0x10'),_0x3867ca,_0x24d240[_0x47b8('0x15')][_0x47b8('0x17')]);return _0x46245a(_0x24d240['error'][_0x47b8('0x17')]);}else{logger[_0x47b8('0xf')](_0x47b8('0x10'),_0x3867ca,_0x47b8('0x11'));_0x46245a(_0x24d240[_0x47b8('0x18')][_0x47b8('0x17')]);}})[_0x47b8('0x19')](function(_0x5ad3ae){logger[_0x47b8('0x15')]('VoiceRecording,\x20%s,\x20%s',_0x3867ca,_0x5ad3ae);_0xb845c9(_0x5ad3ae);});});}exports['UpdateVoiceRecording']=function(_0x4f7317){var _0x299195=this;return new Promise(function(_0x36faf1,_0x2797ac){return db['VoiceRecording']['update'](_0x4f7317['body'],{'raw':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317['options'][_0x47b8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1c')]||null:null,'attributes':_0x4f7317['options']?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1d')]||null:null,'limit':_0x4f7317[_0x47b8('0x1a')]?_0x4f7317[_0x47b8('0x1a')][_0x47b8('0x1e')]||null:null})[_0x47b8('0xe')](function(_0x54f6bc){logger[_0x47b8('0xf')](_0x47b8('0x1f'),_0x4f7317);logger['debug'](_0x47b8('0x1f'),_0x4f7317,JSON[_0x47b8('0x14')](_0x54f6bc));_0x36faf1(_0x54f6bc);})[_0x47b8('0x19')](function(_0x142fb6){logger['error'](_0x47b8('0x1f'),_0x142fb6[_0x47b8('0x17')],_0x4f7317);_0x2797ac(_0x299195[_0x47b8('0x15')](0x1f4,_0x142fb6[_0x47b8('0x17')]));});});};exports[_0x47b8('0x20')]=function(_0xbf5ce9){var _0x40918f=this;return new Promise(function(_0x568c1e,_0x43fd49){var _0x1f719a=require('../../components/encryptor');var _0x195a66;return db[_0x47b8('0x21')][_0x47b8('0x22')]({'attributes':['id',_0x47b8('0x23')],'where':{'id':0x1},'raw':!![]})['then'](function(_0x162d96){_0x195a66=_0x162d96;return db['VoiceRecording'][_0x47b8('0x24')](_0xbf5ce9[_0x47b8('0x25')]);})[_0x47b8('0xe')](function(_0x2e540d){if(_0x195a66['callRecordingEncryption']&&fs[_0x47b8('0x26')](_0x2e540d[_0x47b8('0x27')])){var _0x402e7c=util[_0x47b8('0x28')](_0x47b8('0x29'),_0x2e540d[_0x47b8('0x27')]);return _0x1f719a['encryptFile'](_0x2e540d['value'],_0x402e7c,config['secrets'][_0x47b8('0x2a')])[_0x47b8('0xe')](function(){fs[_0x47b8('0x2b')](_0x2e540d['value']);logger['info']('CreateVoiceRecording\x20file\x20encrypted');return _0x2e540d;});}return _0x2e540d;})['then'](function(_0x347769){logger[_0x47b8('0xf')](_0x47b8('0x20'),_0xbf5ce9);logger[_0x47b8('0x12')](_0x47b8('0x20'),_0xbf5ce9,JSON[_0x47b8('0x14')](_0x347769));_0x568c1e(_0x347769);})[_0x47b8('0x19')](function(_0x460dcc){logger[_0x47b8('0x15')]('CreateVoiceRecording',_0x460dcc['message'],_0xbf5ce9);_0x43fd49(_0x40918f[_0x47b8('0x15')](0x1f4,_0x460dcc[_0x47b8('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index bb62168..ab9c597 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 _0x26fc=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','path'];(function(_0x4c98b9,_0x1ad11b){var _0x3a257a=function(_0x147857){while(--_0x147857){_0x4c98b9['push'](_0x4c98b9['shift']());}};_0x3a257a(++_0x1ad11b);}(_0x26fc,0x82));var _0xc26f=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x26fc[_0xa1e3e3];return _0xc980e9;};'use strict';var multer=require(_0xc26f('0x0'));var util=require('util');var path=require(_0xc26f('0x1'));var timeout=require(_0xc26f('0x2'));var express=require(_0xc26f('0x3'));var router=express[_0xc26f('0x4')]();var fs_extra=require(_0xc26f('0x5'));var auth=require(_0xc26f('0x6'));var interaction=require(_0xc26f('0x7'));var config=require('../../config/environment');var controller=require(_0xc26f('0x8'));router[_0xc26f('0x9')]('/',auth[_0xc26f('0xa')](),controller[_0xc26f('0xb')]);router[_0xc26f('0x9')](_0xc26f('0xc'),auth[_0xc26f('0xa')](),controller[_0xc26f('0xd')]);router['get'](_0xc26f('0xe'),auth[_0xc26f('0xa')](),controller[_0xc26f('0xf')]);router[_0xc26f('0x10')]('/',auth['isAuthenticated'](),controller[_0xc26f('0x11')]);router[_0xc26f('0x12')]('/:id',auth[_0xc26f('0xa')](),controller['update']);router[_0xc26f('0x13')](_0xc26f('0xe'),auth[_0xc26f('0xa')](),controller[_0xc26f('0x14')]);module[_0xc26f('0x15')]=router; \ No newline at end of file +var _0x3af0=['/describe','describe','/:id','show','post','create','put','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x15f8fb,_0x57b569){var _0x22c7f9=function(_0x4d04fd){while(--_0x4d04fd){_0x15f8fb['push'](_0x15f8fb['shift']());}};_0x22c7f9(++_0x57b569);}(_0x3af0,0xff));var _0x03af=function(_0x1cfbf8,_0x29c15a){_0x1cfbf8=_0x1cfbf8-0x0;var _0x90de93=_0x3af0[_0x1cfbf8];return _0x90de93;};'use strict';var multer=require('multer');var util=require(_0x03af('0x0'));var path=require(_0x03af('0x1'));var timeout=require(_0x03af('0x2'));var express=require(_0x03af('0x3'));var router=express[_0x03af('0x4')]();var fs_extra=require(_0x03af('0x5'));var auth=require(_0x03af('0x6'));var interaction=require(_0x03af('0x7'));var config=require(_0x03af('0x8'));var controller=require('./voiceTransferReport.controller');router['get']('/',auth[_0x03af('0x9')](),controller['index']);router[_0x03af('0xa')](_0x03af('0xb'),auth[_0x03af('0x9')](),controller[_0x03af('0xc')]);router['get'](_0x03af('0xd'),auth[_0x03af('0x9')](),controller[_0x03af('0xe')]);router[_0x03af('0xf')]('/',auth[_0x03af('0x9')](),controller[_0x03af('0x10')]);router[_0x03af('0x11')](_0x03af('0xd'),auth[_0x03af('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x03af('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 8189797..bd21a89 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 _0xb93f=['blind','attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x9097f0,_0x4c7d35){var _0x1704f0=function(_0x2abfb3){while(--_0x2abfb3){_0x9097f0['push'](_0x9097f0['shift']());}};_0x1704f0(++_0x4c7d35);}(_0xb93f,0x17e));var _0xfb93=function(_0x1ca4c3,_0x554126){_0x1ca4c3=_0x1ca4c3-0x0;var _0x4426a6=_0xb93f[_0x1ca4c3];return _0x4426a6;};'use strict';var Sequelize=require(_0xfb93('0x0'));var moment=require(_0xfb93('0x1'));module['exports']={'type':{'type':Sequelize[_0xfb93('0x2')](_0xfb93('0x3'),_0xfb93('0x4'))},'result':{'type':Sequelize[_0xfb93('0x5')]},'transfererchannel':{'type':Sequelize[_0xfb93('0x5')]},'transferercalleridnum':{'type':Sequelize[_0xfb93('0x5')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0xfb93('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize[_0xfb93('0x5')]},'transfererlinkedid':{'type':Sequelize[_0xfb93('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0xfb93('0x5')]},'transfereecalleridname':{'type':Sequelize[_0xfb93('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0xfb93('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0xfb93('0x5')]},'transfereecontext':{'type':Sequelize[_0xfb93('0x5')]},'transfereeexten':{'type':Sequelize[_0xfb93('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0xfb93('0x6'),'No')},'context':{'type':Sequelize[_0xfb93('0x5')]},'extension':{'type':Sequelize[_0xfb93('0x5')]}}; \ No newline at end of file +var _0x6e52=['ENUM','blind','STRING','Yes','moment','exports'];(function(_0x2340f8,_0x11a954){var _0x51592d=function(_0x55782d){while(--_0x55782d){_0x2340f8['push'](_0x2340f8['shift']());}};_0x51592d(++_0x11a954);}(_0x6e52,0x1c6));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x26e5('0x0'));module[_0x26e5('0x1')]={'type':{'type':Sequelize[_0x26e5('0x2')](_0x26e5('0x3'),'attended')},'result':{'type':Sequelize[_0x26e5('0x4')]},'transfererchannel':{'type':Sequelize[_0x26e5('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x26e5('0x4')]},'transferercalleridname':{'type':Sequelize[_0x26e5('0x4')]},'transfererconnectedlinenum':{'type':Sequelize[_0x26e5('0x4')]},'transfererconnectedlinename':{'type':Sequelize[_0x26e5('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x26e5('0x4')]},'transferercontext':{'type':Sequelize[_0x26e5('0x4')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x26e5('0x4')]},'transfereechannel':{'type':Sequelize[_0x26e5('0x4')]},'transfereecalleridnum':{'type':Sequelize[_0x26e5('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x26e5('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x26e5('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x26e5('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x26e5('0x4')]},'transfereecontext':{'type':Sequelize[_0x26e5('0x4')]},'transfereeexten':{'type':Sequelize[_0x26e5('0x4')]},'transfereelinkedid':{'type':Sequelize[_0x26e5('0x4')]},'isexternal':{'type':Sequelize['ENUM'](_0x26e5('0x5'),'No')},'context':{'type':Sequelize['STRING']},'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 0eabaed..29e10d7 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 _0x1114=['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','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','destroy','sendStatus','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','keys','create','body','update','find','params','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0xeedb99,_0x34f5b7){var _0x413529=function(_0x91be7a){while(--_0x91be7a){_0xeedb99['push'](_0xeedb99['shift']());}};_0x413529(++_0x34f5b7);}(_0x1114,0xdd));var _0x4111=function(_0x4c432d,_0x435c91){_0x4c432d=_0x4c432d-0x0;var _0x4213b0=_0x1114[_0x4c432d];return _0x4213b0;};'use strict';var emlformat=require(_0x4111('0x0'));var rimraf=require(_0x4111('0x1'));var zipdir=require(_0x4111('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4111('0x3'));var moment=require('moment');var BPromise=require(_0x4111('0x4'));var Mustache=require('mustache');var util=require(_0x4111('0x5'));var path=require(_0x4111('0x6'));var sox=require(_0x4111('0x7'));var csv=require(_0x4111('0x8'));var ejs=require(_0x4111('0x9'));var fs=require('fs');var fs_extra=require(_0x4111('0xa'));var _=require(_0x4111('0xb'));var squel=require(_0x4111('0xc'));var crypto=require(_0x4111('0xd'));var jsforce=require(_0x4111('0xe'));var deskjs=require(_0x4111('0xf'));var toCsv=require(_0x4111('0x8'));var querystring=require(_0x4111('0x10'));var Papa=require(_0x4111('0x11'));var Redis=require(_0x4111('0x12'));var authService=require(_0x4111('0x13'));var qs=require(_0x4111('0x14'));var as=require(_0x4111('0x15'));var hardwareService=require(_0x4111('0x16'));var logger=require(_0x4111('0x17'))(_0x4111('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4111('0x19'));var db=require(_0x4111('0x1a'))['db'];function respondWithStatusCode(_0x17fdb9,_0x281889){_0x281889=_0x281889||0xcc;return function(_0x2f5f6a){if(_0x2f5f6a){return _0x17fdb9['sendStatus'](_0x281889);}return _0x17fdb9[_0x4111('0x1b')](_0x281889)[_0x4111('0x1c')]();};}function respondWithResult(_0x11d83d,_0x1df033){_0x1df033=_0x1df033||0xc8;return function(_0x223341){if(_0x223341){return _0x11d83d[_0x4111('0x1b')](_0x1df033)[_0x4111('0x1d')](_0x223341);}};}function respondWithFilteredResult(_0x1f5b18,_0x4c3a4c){return function(_0x540584){if(_0x540584){var _0x2755ab=typeof _0x4c3a4c[_0x4111('0x1e')]===_0x4111('0x1f')&&typeof _0x4c3a4c[_0x4111('0x20')]===_0x4111('0x1f');var _0x4ebde6=_0x540584['count'];var _0x4ac594=_0x2755ab?0x0:_0x4c3a4c['offset'];var _0x11b654=_0x2755ab?_0x540584[_0x4111('0x21')]:_0x4c3a4c[_0x4111('0x1e')]+_0x4c3a4c['limit'];var _0x1eb1f6;if(_0x11b654>=_0x4ebde6){_0x11b654=_0x4ebde6;_0x1eb1f6=0xc8;}else{_0x1eb1f6=0xce;}_0x1f5b18['status'](_0x1eb1f6);return _0x1f5b18[_0x4111('0x22')](_0x4111('0x23'),_0x4ac594+'-'+_0x11b654+'/'+_0x4ebde6)[_0x4111('0x1d')](_0x540584);}return null;};}function patchUpdates(_0x35287c){return function(_0x441cfa){try{jsonpatch[_0x4111('0x24')](_0x441cfa,_0x35287c,!![]);}catch(_0x22fcfd){return BPromise[_0x4111('0x25')](_0x22fcfd);}return _0x441cfa[_0x4111('0x26')]();};}function saveUpdates(_0x6706de,_0x16d501){return function(_0xfd5203){if(_0xfd5203){return _0xfd5203['update'](_0x6706de)[_0x4111('0x27')](function(_0x2d174a){return _0x2d174a;});}return null;};}function removeEntity(_0x466a0d,_0x4edc99){return function(_0x1d511b){if(_0x1d511b){return _0x1d511b[_0x4111('0x28')]()['then'](function(){_0x466a0d[_0x4111('0x1b')](0xcc)[_0x4111('0x1c')]();});}};}function handleEntityNotFound(_0x17b0c7,_0x1c7e1a){return function(_0x1586c0){if(!_0x1586c0){_0x17b0c7[_0x4111('0x29')](0x194);}return _0x1586c0;};}function handleError(_0x2d7027,_0x2ad380){_0x2ad380=_0x2ad380||0x1f4;return function(_0x151903){logger['error'](_0x151903[_0x4111('0x2a')]);if(_0x151903[_0x4111('0x2b')]){delete _0x151903[_0x4111('0x2b')];}_0x2d7027[_0x4111('0x1b')](_0x2ad380)[_0x4111('0x2c')](_0x151903);};}exports[_0x4111('0x2d')]=function(_0x5c824a,_0x71d9dc){var _0x4466eb={},_0x27ac9d={},_0x5c85de={'count':0x0,'rows':[]};var _0x2a92ad=_[_0x4111('0x2e')](db[_0x4111('0x2f')][_0x4111('0x30')],function(_0x3c1f21){return{'name':_0x3c1f21[_0x4111('0x31')],'type':_0x3c1f21['type']['key']};});_0x27ac9d['model']=_['map'](_0x2a92ad,_0x4111('0x2b'));_0x27ac9d[_0x4111('0x32')]=_['keys'](_0x5c824a['query']);_0x27ac9d[_0x4111('0x33')]=_[_0x4111('0x34')](_0x27ac9d['model'],_0x27ac9d['query']);_0x4466eb['attributes']=_[_0x4111('0x34')](_0x27ac9d[_0x4111('0x35')],qs[_0x4111('0x36')](_0x5c824a['query'][_0x4111('0x36')]));_0x4466eb[_0x4111('0x37')]=_0x4466eb[_0x4111('0x37')][_0x4111('0x38')]?_0x4466eb['attributes']:_0x27ac9d[_0x4111('0x35')];if(!_0x5c824a['query'][_0x4111('0x39')](_0x4111('0x3a'))){_0x4466eb[_0x4111('0x20')]=qs['limit'](_0x5c824a['query']['limit']);_0x4466eb[_0x4111('0x1e')]=qs[_0x4111('0x1e')](_0x5c824a['query'][_0x4111('0x1e')]);}_0x4466eb[_0x4111('0x3b')]=qs[_0x4111('0x3c')](_0x5c824a['query'][_0x4111('0x3c')]);_0x4466eb[_0x4111('0x3d')]=qs['filters'](_[_0x4111('0x3e')](_0x5c824a[_0x4111('0x32')],_0x27ac9d[_0x4111('0x33')]),_0x2a92ad);if(_0x5c824a[_0x4111('0x32')][_0x4111('0x3f')]){_0x4466eb[_0x4111('0x3d')]=_[_0x4111('0x40')](_0x4466eb['where'],{'$or':_['map'](_0x2a92ad,function(_0x284f91){if(_0x284f91[_0x4111('0x41')]!==_0x4111('0x42')){var _0x1063d2={};_0x1063d2[_0x284f91[_0x4111('0x2b')]]={'$like':'%'+_0x5c824a[_0x4111('0x32')][_0x4111('0x3f')]+'%'};return _0x1063d2;}})});}_0x4466eb=_['merge']({},_0x4466eb,_0x5c824a[_0x4111('0x43')]);var _0x30409d={'where':_0x4466eb[_0x4111('0x3d')]};return db[_0x4111('0x2f')][_0x4111('0x21')](_0x30409d)[_0x4111('0x27')](function(_0x7c8561){_0x5c85de[_0x4111('0x21')]=_0x7c8561;if(_0x5c824a['query'][_0x4111('0x44')]){_0x4466eb[_0x4111('0x45')]=[{'all':!![]}];}return db[_0x4111('0x2f')]['findAll'](_0x4466eb);})[_0x4111('0x27')](function(_0x38d623){_0x5c85de['rows']=_0x38d623;return _0x5c85de;})[_0x4111('0x27')](respondWithFilteredResult(_0x71d9dc,_0x4466eb))[_0x4111('0x46')](handleError(_0x71d9dc,null));};exports['show']=function(_0x5e023c,_0x1d2198){var _0x465b0f={'raw':!![],'where':{'id':_0x5e023c['params']['id']}},_0x2d81e0={};_0x2d81e0[_0x4111('0x35')]=_[_0x4111('0x47')](db[_0x4111('0x2f')][_0x4111('0x30')]);_0x2d81e0[_0x4111('0x32')]=_[_0x4111('0x47')](_0x5e023c[_0x4111('0x32')]);_0x2d81e0[_0x4111('0x33')]=_[_0x4111('0x34')](_0x2d81e0[_0x4111('0x35')],_0x2d81e0[_0x4111('0x32')]);_0x465b0f[_0x4111('0x37')]=_['intersection'](_0x2d81e0['model'],qs['fields'](_0x5e023c[_0x4111('0x32')][_0x4111('0x36')]));_0x465b0f[_0x4111('0x37')]=_0x465b0f[_0x4111('0x37')]['length']?_0x465b0f[_0x4111('0x37')]:_0x2d81e0[_0x4111('0x35')];if(_0x5e023c[_0x4111('0x32')][_0x4111('0x44')]){_0x465b0f[_0x4111('0x45')]=[{'all':!![]}];}_0x465b0f=_[_0x4111('0x40')]({},_0x465b0f,_0x5e023c[_0x4111('0x43')]);return db[_0x4111('0x2f')]['find'](_0x465b0f)['then'](handleEntityNotFound(_0x1d2198,null))[_0x4111('0x27')](respondWithResult(_0x1d2198,null))[_0x4111('0x46')](handleError(_0x1d2198,null));};exports['create']=function(_0x54473f,_0xa050cb){return db['VoiceTransferReport'][_0x4111('0x48')](_0x54473f[_0x4111('0x49')],{})[_0x4111('0x27')](respondWithResult(_0xa050cb,0xc9))[_0x4111('0x46')](handleError(_0xa050cb,null));};exports[_0x4111('0x4a')]=function(_0x19e4a1,_0x34e114){if(_0x19e4a1[_0x4111('0x49')]['id']){delete _0x19e4a1[_0x4111('0x49')]['id'];}return db[_0x4111('0x2f')][_0x4111('0x4b')]({'where':{'id':_0x19e4a1[_0x4111('0x4c')]['id']}})[_0x4111('0x27')](handleEntityNotFound(_0x34e114,null))[_0x4111('0x27')](saveUpdates(_0x19e4a1[_0x4111('0x49')],null))[_0x4111('0x27')](respondWithResult(_0x34e114,null))['catch'](handleError(_0x34e114,null));};exports[_0x4111('0x28')]=function(_0x1a78fd,_0x536d87){return db[_0x4111('0x2f')][_0x4111('0x4b')]({'where':{'id':_0x1a78fd['params']['id']}})[_0x4111('0x27')](handleEntityNotFound(_0x536d87,null))['then'](removeEntity(_0x536d87,null))[_0x4111('0x46')](handleError(_0x536d87,null));};exports[_0x4111('0x4d')]=function(_0x1cd0a9,_0x2af010){return db[_0x4111('0x2f')]['describe']()[_0x4111('0x27')](respondWithResult(_0x2af010,null))['catch'](handleError(_0x2af010,null));}; \ No newline at end of file +var _0x5600=['json','save','destroy','then','error','name','send','index','map','VoiceTransferReport','rawAttributes','key','model','filters','intersection','attributes','fields','query','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','catch','show','keys','length','include','create','body','update','find','params','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','Content-Range'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5600,0x19a));var _0x0560=function(_0x57cb4f,_0x541f57){_0x57cb4f=_0x57cb4f-0x0;var _0x29bb45=_0x5600[_0x57cb4f];return _0x29bb45;};'use strict';var emlformat=require(_0x0560('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0560('0x1'));var jsonpatch=require(_0x0560('0x2'));var rp=require(_0x0560('0x3'));var moment=require(_0x0560('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0560('0x5'));var util=require('util');var path=require(_0x0560('0x6'));var sox=require(_0x0560('0x7'));var csv=require(_0x0560('0x8'));var ejs=require(_0x0560('0x9'));var fs=require('fs');var fs_extra=require(_0x0560('0xa'));var _=require(_0x0560('0xb'));var squel=require(_0x0560('0xc'));var crypto=require(_0x0560('0xd'));var jsforce=require(_0x0560('0xe'));var deskjs=require(_0x0560('0xf'));var toCsv=require(_0x0560('0x8'));var querystring=require(_0x0560('0x10'));var Papa=require(_0x0560('0x11'));var Redis=require(_0x0560('0x12'));var authService=require(_0x0560('0x13'));var qs=require(_0x0560('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0560('0x15'));var logger=require(_0x0560('0x16'))('api');var utils=require(_0x0560('0x17'));var config=require(_0x0560('0x18'));var licenseUtil=require(_0x0560('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x14e8e4,_0x4316bb){_0x4316bb=_0x4316bb||0xcc;return function(_0x13d9ba){if(_0x13d9ba){return _0x14e8e4['sendStatus'](_0x4316bb);}return _0x14e8e4[_0x0560('0x1a')](_0x4316bb)[_0x0560('0x1b')]();};}function respondWithResult(_0x552a2c,_0x471068){_0x471068=_0x471068||0xc8;return function(_0x251f0a){if(_0x251f0a){return _0x552a2c[_0x0560('0x1a')](_0x471068)['json'](_0x251f0a);}};}function respondWithFilteredResult(_0x6e81a8,_0x21ebba){return function(_0xebdd83){if(_0xebdd83){var _0xda12fc=typeof _0x21ebba['offset']===_0x0560('0x1c')&&typeof _0x21ebba[_0x0560('0x1d')]===_0x0560('0x1c');var _0x32168a=_0xebdd83[_0x0560('0x1e')];var _0x357692=_0xda12fc?0x0:_0x21ebba[_0x0560('0x1f')];var _0x3e5f93=_0xda12fc?_0xebdd83[_0x0560('0x1e')]:_0x21ebba[_0x0560('0x1f')]+_0x21ebba[_0x0560('0x1d')];var _0x131c3b;if(_0x3e5f93>=_0x32168a){_0x3e5f93=_0x32168a;_0x131c3b=0xc8;}else{_0x131c3b=0xce;}_0x6e81a8[_0x0560('0x1a')](_0x131c3b);return _0x6e81a8[_0x0560('0x20')](_0x0560('0x21'),_0x357692+'-'+_0x3e5f93+'/'+_0x32168a)[_0x0560('0x22')](_0xebdd83);}return null;};}function patchUpdates(_0x3fd4aa){return function(_0x282454){try{jsonpatch['apply'](_0x282454,_0x3fd4aa,!![]);}catch(_0x4ff3c6){return BPromise['reject'](_0x4ff3c6);}return _0x282454[_0x0560('0x23')]();};}function saveUpdates(_0x23327a,_0x5cdf64){return function(_0x1a18d5){if(_0x1a18d5){return _0x1a18d5['update'](_0x23327a)['then'](function(_0x1cf531){return _0x1cf531;});}return null;};}function removeEntity(_0x4eefec,_0x4502f0){return function(_0x59746d){if(_0x59746d){return _0x59746d[_0x0560('0x24')]()[_0x0560('0x25')](function(){_0x4eefec[_0x0560('0x1a')](0xcc)[_0x0560('0x1b')]();});}};}function handleEntityNotFound(_0x29d5c4,_0x3befd8){return function(_0x3ec10d){if(!_0x3ec10d){_0x29d5c4['sendStatus'](0x194);}return _0x3ec10d;};}function handleError(_0x391430,_0x5d6fc5){_0x5d6fc5=_0x5d6fc5||0x1f4;return function(_0x3ddeeb){logger[_0x0560('0x26')](_0x3ddeeb['stack']);if(_0x3ddeeb[_0x0560('0x27')]){delete _0x3ddeeb[_0x0560('0x27')];}_0x391430['status'](_0x5d6fc5)[_0x0560('0x28')](_0x3ddeeb);};}exports[_0x0560('0x29')]=function(_0x4dd309,_0x295549){var _0x424f8d={},_0x3b0d6e={},_0x14e940={'count':0x0,'rows':[]};var _0x3b22c5=_[_0x0560('0x2a')](db[_0x0560('0x2b')][_0x0560('0x2c')],function(_0xcef0b8){return{'name':_0xcef0b8['fieldName'],'type':_0xcef0b8['type'][_0x0560('0x2d')]};});_0x3b0d6e[_0x0560('0x2e')]=_[_0x0560('0x2a')](_0x3b22c5,'name');_0x3b0d6e['query']=_['keys'](_0x4dd309['query']);_0x3b0d6e[_0x0560('0x2f')]=_[_0x0560('0x30')](_0x3b0d6e['model'],_0x3b0d6e['query']);_0x424f8d[_0x0560('0x31')]=_[_0x0560('0x30')](_0x3b0d6e[_0x0560('0x2e')],qs[_0x0560('0x32')](_0x4dd309['query'][_0x0560('0x32')]));_0x424f8d[_0x0560('0x31')]=_0x424f8d[_0x0560('0x31')]['length']?_0x424f8d[_0x0560('0x31')]:_0x3b0d6e['model'];if(!_0x4dd309[_0x0560('0x33')][_0x0560('0x34')]('nolimit')){_0x424f8d[_0x0560('0x1d')]=qs[_0x0560('0x1d')](_0x4dd309[_0x0560('0x33')]['limit']);_0x424f8d[_0x0560('0x1f')]=qs['offset'](_0x4dd309[_0x0560('0x33')]['offset']);}_0x424f8d[_0x0560('0x35')]=qs[_0x0560('0x36')](_0x4dd309[_0x0560('0x33')][_0x0560('0x36')]);_0x424f8d['where']=qs[_0x0560('0x2f')](_[_0x0560('0x37')](_0x4dd309['query'],_0x3b0d6e[_0x0560('0x2f')]),_0x3b22c5);if(_0x4dd309[_0x0560('0x33')][_0x0560('0x38')]){_0x424f8d[_0x0560('0x39')]=_[_0x0560('0x3a')](_0x424f8d[_0x0560('0x39')],{'$or':_['map'](_0x3b22c5,function(_0x5c7653){if(_0x5c7653['type']!==_0x0560('0x3b')){var _0x4b4d8c={};_0x4b4d8c[_0x5c7653[_0x0560('0x27')]]={'$like':'%'+_0x4dd309['query'][_0x0560('0x38')]+'%'};return _0x4b4d8c;}})});}_0x424f8d=_['merge']({},_0x424f8d,_0x4dd309[_0x0560('0x3c')]);var _0xd9accb={'where':_0x424f8d[_0x0560('0x39')]};return db[_0x0560('0x2b')]['count'](_0xd9accb)['then'](function(_0x5618ea){_0x14e940[_0x0560('0x1e')]=_0x5618ea;if(_0x4dd309[_0x0560('0x33')][_0x0560('0x3d')]){_0x424f8d['include']=[{'all':!![]}];}return db[_0x0560('0x2b')][_0x0560('0x3e')](_0x424f8d);})[_0x0560('0x25')](function(_0x564e88){_0x14e940['rows']=_0x564e88;return _0x14e940;})['then'](respondWithFilteredResult(_0x295549,_0x424f8d))[_0x0560('0x3f')](handleError(_0x295549,null));};exports[_0x0560('0x40')]=function(_0x5aba00,_0xaf1ed7){var _0x8e3e8={'raw':!![],'where':{'id':_0x5aba00['params']['id']}},_0x26b0b1={};_0x26b0b1[_0x0560('0x2e')]=_[_0x0560('0x41')](db['VoiceTransferReport'][_0x0560('0x2c')]);_0x26b0b1[_0x0560('0x33')]=_[_0x0560('0x41')](_0x5aba00[_0x0560('0x33')]);_0x26b0b1['filters']=_[_0x0560('0x30')](_0x26b0b1[_0x0560('0x2e')],_0x26b0b1[_0x0560('0x33')]);_0x8e3e8[_0x0560('0x31')]=_[_0x0560('0x30')](_0x26b0b1['model'],qs['fields'](_0x5aba00[_0x0560('0x33')][_0x0560('0x32')]));_0x8e3e8[_0x0560('0x31')]=_0x8e3e8[_0x0560('0x31')][_0x0560('0x42')]?_0x8e3e8[_0x0560('0x31')]:_0x26b0b1['model'];if(_0x5aba00[_0x0560('0x33')][_0x0560('0x3d')]){_0x8e3e8[_0x0560('0x43')]=[{'all':!![]}];}_0x8e3e8=_['merge']({},_0x8e3e8,_0x5aba00[_0x0560('0x3c')]);return db['VoiceTransferReport']['find'](_0x8e3e8)[_0x0560('0x25')](handleEntityNotFound(_0xaf1ed7,null))[_0x0560('0x25')](respondWithResult(_0xaf1ed7,null))[_0x0560('0x3f')](handleError(_0xaf1ed7,null));};exports[_0x0560('0x44')]=function(_0x41b7bd,_0x4cda99){return db[_0x0560('0x2b')][_0x0560('0x44')](_0x41b7bd[_0x0560('0x45')],{})['then'](respondWithResult(_0x4cda99,0xc9))[_0x0560('0x3f')](handleError(_0x4cda99,null));};exports[_0x0560('0x46')]=function(_0x1a9c91,_0x126e30){if(_0x1a9c91[_0x0560('0x45')]['id']){delete _0x1a9c91[_0x0560('0x45')]['id'];}return db[_0x0560('0x2b')]['find']({'where':{'id':_0x1a9c91['params']['id']}})['then'](handleEntityNotFound(_0x126e30,null))[_0x0560('0x25')](saveUpdates(_0x1a9c91[_0x0560('0x45')],null))[_0x0560('0x25')](respondWithResult(_0x126e30,null))['catch'](handleError(_0x126e30,null));};exports['destroy']=function(_0x16dba5,_0x2af6a9){return db[_0x0560('0x2b')][_0x0560('0x47')]({'where':{'id':_0x16dba5[_0x0560('0x48')]['id']}})[_0x0560('0x25')](handleEntityNotFound(_0x2af6a9,null))[_0x0560('0x25')](removeEntity(_0x2af6a9,null))[_0x0560('0x3f')](handleError(_0x2af6a9,null));};exports[_0x0560('0x49')]=function(_0x582d1e,_0x585749){return db['VoiceTransferReport'][_0x0560('0x49')]()['then'](respondWithResult(_0x585749,null))['catch'](handleError(_0x585749,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 6661b3e..3c36868 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 _0x8b92=['path','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','util','../../config/logger','api','bluebird','request-promise'];(function(_0x36a60b,_0x4e1b66){var _0x13d89f=function(_0x5a9f1f){while(--_0x5a9f1f){_0x36a60b['push'](_0x36a60b['shift']());}};_0x13d89f(++_0x4e1b66);}(_0x8b92,0x1bd));var _0x28b9=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8b92[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x28b9('0x0'));var logger=require(_0x28b9('0x1'))(_0x28b9('0x2'));var moment=require('moment');var BPromise=require(_0x28b9('0x3'));var rp=require(_0x28b9('0x4'));var fs=require('fs');var path=require(_0x28b9('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x28b9('0x6'));module[_0x28b9('0x7')]=function(_0xbeb704,_0x56f485){return _0xbeb704[_0x28b9('0x8')](_0x28b9('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x90ed=['define','VoiceTransferReport','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceTransferReport.attributes'];(function(_0x1d524d,_0x3cdf11){var _0x552dfb=function(_0x2cc927){while(--_0x2cc927){_0x1d524d['push'](_0x1d524d['shift']());}};_0x552dfb(++_0x3cdf11);}(_0x90ed,0x142));var _0xd90e=function(_0x46bbed,_0x4eccc5){_0x46bbed=_0x46bbed-0x0;var _0x34e7dc=_0x90ed[_0x46bbed];return _0x34e7dc;};'use strict';var _=require('lodash');var util=require(_0xd90e('0x0'));var logger=require(_0xd90e('0x1'))(_0xd90e('0x2'));var moment=require(_0xd90e('0x3'));var BPromise=require(_0xd90e('0x4'));var rp=require(_0xd90e('0x5'));var fs=require('fs');var path=require(_0xd90e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd90e('0x7'));module['exports']=function(_0x1e6e6d,_0x9fea11){return _0x1e6e6d[_0xd90e('0x8')](_0xd90e('0x9'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 35b45da..bb046db 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 _0x32d0=['raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','VoiceTransferReport,\x20%s,\x20%s','message','CreateVoiceTransferReport','create','body','options'];(function(_0x1943d9,_0x245bb8){var _0x4b4f3f=function(_0x3bba90){while(--_0x3bba90){_0x1943d9['push'](_0x1943d9['shift']());}};_0x4b4f3f(++_0x245bb8);}(_0x32d0,0xb8));var _0x032d=function(_0x34ace6,_0x2d021c){_0x34ace6=_0x34ace6-0x0;var _0x496e37=_0x32d0[_0x34ace6];return _0x496e37;};'use strict';var _=require(_0x032d('0x0'));var util=require(_0x032d('0x1'));var moment=require(_0x032d('0x2'));var BPromise=require('bluebird');var rs=require(_0x032d('0x3'));var fs=require('fs');var Redis=require(_0x032d('0x4'));var db=require(_0x032d('0x5'))['db'];var utils=require(_0x032d('0x6'));var logger=require(_0x032d('0x7'))(_0x032d('0x8'));var config=require(_0x032d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x032d('0xa')][_0x032d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x10c1a3,_0x4b7ca7,_0x1ce511){return new BPromise(function(_0xb9feba,_0x320759){return client['request'](_0x10c1a3,_0x1ce511)[_0x032d('0xc')](function(_0x160569){logger[_0x032d('0xd')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b7ca7,_0x032d('0xe'));logger[_0x032d('0xf')](_0x032d('0x10'),_0x4b7ca7,_0x032d('0xe'),JSON['stringify'](_0x160569));if(_0x160569['error']){if(_0x160569['error']['code']===0x1f4){logger[_0x032d('0x11')](_0x032d('0x12'),_0x4b7ca7,_0x160569['error'][_0x032d('0x13')]);return _0x320759(_0x160569[_0x032d('0x11')][_0x032d('0x13')]);}logger[_0x032d('0x11')](_0x032d('0x12'),_0x4b7ca7,_0x160569['error'][_0x032d('0x13')]);return _0xb9feba(_0x160569[_0x032d('0x11')]['message']);}else{logger['info'](_0x032d('0x12'),_0x4b7ca7,'request\x20sent');_0xb9feba(_0x160569['result'][_0x032d('0x13')]);}})['catch'](function(_0x209dc6){logger[_0x032d('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x4b7ca7,_0x209dc6);_0x320759(_0x209dc6);});});}exports[_0x032d('0x14')]=function(_0x396a13){var _0x433b37=this;return new Promise(function(_0x3cec05,_0x1a746a){return db['VoiceTransferReport'][_0x032d('0x15')](_0x396a13[_0x032d('0x16')],{'raw':_0x396a13['options']?_0x396a13[_0x032d('0x17')][_0x032d('0x18')]===undefined?!![]:![]:!![]})[_0x032d('0xc')](function(_0x23ff69){logger['info'](_0x032d('0x14'),_0x396a13);logger['debug'](_0x032d('0x14'),_0x396a13,JSON['stringify'](_0x23ff69));_0x3cec05(_0x23ff69);})[_0x032d('0x19')](function(_0x3390e3){logger['error'](_0x032d('0x14'),_0x3390e3[_0x032d('0x13')],_0x396a13);_0x1a746a(_0x433b37[_0x032d('0x11')](0x1f4,_0x3390e3[_0x032d('0x13')]));});});}; \ No newline at end of file +var _0x8262=['request','then','info','VoiceTransferReport,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','util','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x139ff6,_0xddca5){var _0x71b083=function(_0x4cf27a){while(--_0x4cf27a){_0x139ff6['push'](_0x139ff6['shift']());}};_0x71b083(++_0xddca5);}(_0x8262,0x100));var _0x2826=function(_0x467358,_0x46ec55){_0x467358=_0x467358-0x0;var _0x5df996=_0x8262[_0x467358];return _0x5df996;};'use strict';var _=require('lodash');var util=require(_0x2826('0x0'));var moment=require('moment');var BPromise=require(_0x2826('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2826('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2826('0x3'));var logger=require(_0x2826('0x4'))('rpc');var config=require(_0x2826('0x5'));var jayson=require(_0x2826('0x6'));var client=jayson['client'][_0x2826('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x50042c,_0x5f1e00,_0x3300c3){return new BPromise(function(_0x542ac2,_0x379f16){return client[_0x2826('0x8')](_0x50042c,_0x3300c3)[_0x2826('0x9')](function(_0x2c7e1d){logger[_0x2826('0xa')](_0x2826('0xb'),_0x5f1e00,'request\x20sent');logger[_0x2826('0xc')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x5f1e00,_0x2826('0xd'),JSON['stringify'](_0x2c7e1d));if(_0x2c7e1d[_0x2826('0xe')]){if(_0x2c7e1d[_0x2826('0xe')][_0x2826('0xf')]===0x1f4){logger[_0x2826('0xe')](_0x2826('0xb'),_0x5f1e00,_0x2c7e1d['error'][_0x2826('0x10')]);return _0x379f16(_0x2c7e1d[_0x2826('0xe')][_0x2826('0x10')]);}logger['error'](_0x2826('0xb'),_0x5f1e00,_0x2c7e1d['error'][_0x2826('0x10')]);return _0x542ac2(_0x2c7e1d[_0x2826('0xe')]['message']);}else{logger[_0x2826('0xa')](_0x2826('0xb'),_0x5f1e00,_0x2826('0xd'));_0x542ac2(_0x2c7e1d['result'][_0x2826('0x10')]);}})[_0x2826('0x11')](function(_0x28f2a6){logger[_0x2826('0xe')](_0x2826('0xb'),_0x5f1e00,_0x28f2a6);_0x379f16(_0x28f2a6);});});}exports[_0x2826('0x12')]=function(_0x4201e4){var _0x27a9dd=this;return new Promise(function(_0x1a421f,_0x979bb1){return db[_0x2826('0x13')][_0x2826('0x14')](_0x4201e4[_0x2826('0x15')],{'raw':_0x4201e4[_0x2826('0x16')]?_0x4201e4[_0x2826('0x16')][_0x2826('0x17')]===undefined?!![]:![]:!![]})[_0x2826('0x9')](function(_0x558048){logger[_0x2826('0xa')](_0x2826('0x12'),_0x4201e4);logger['debug'](_0x2826('0x12'),_0x4201e4,JSON['stringify'](_0x558048));_0x1a421f(_0x558048);})[_0x2826('0x11')](function(_0x175726){logger[_0x2826('0xe')](_0x2826('0x12'),_0x175726['message'],_0x4201e4);_0x979bb1(_0x27a9dd['error'](0x1f4,_0x175726[_0x2826('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 0dc3392..be49ae4 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 _0xb4e6=['unhold','calls','/transfer','exports','express','../../components/auth/service','./webbar.controller','post','/originate','isAuthenticated','isWebrtcLicence','originate','/hangup','/hold','hold','/unhold'];(function(_0x1d4813,_0x13c136){var _0x250828=function(_0x5cdb83){while(--_0x5cdb83){_0x1d4813['push'](_0x1d4813['shift']());}};_0x250828(++_0x13c136);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x135904,_0x1e252b){_0x135904=_0x135904-0x0;var _0x1ce7d5=_0xb4e6[_0x135904];return _0x1ce7d5;};'use strict';var express=require(_0x6b4e('0x0'));var router=express['Router']();var auth=require(_0x6b4e('0x1'));var controller=require(_0x6b4e('0x2'));router[_0x6b4e('0x3')](_0x6b4e('0x4'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0x7')]);router['post'](_0x6b4e('0x8'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['hangup']);router[_0x6b4e('0x3')]('/answer',auth['isAuthenticated'](),auth[_0x6b4e('0x6')](),controller['answer']);router['post'](_0x6b4e('0x9'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xa')]);router[_0x6b4e('0x3')](_0x6b4e('0xb'),auth[_0x6b4e('0x5')](),auth['isWebrtcLicence'](),controller[_0x6b4e('0xc')]);router[_0x6b4e('0x3')]('/calls',auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller[_0x6b4e('0xd')]);router[_0x6b4e('0x3')](_0x6b4e('0xe'),auth[_0x6b4e('0x5')](),auth[_0x6b4e('0x6')](),controller['transfer']);module[_0x6b4e('0xf')]=router; \ No newline at end of file +var _0xb43b=['/transfer','transfer','express','Router','./webbar.controller','post','/originate','isWebrtcLicence','originate','/hangup','hangup','/answer','isAuthenticated','answer','/unhold','unhold'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb43b,0x1b2));var _0xbb43=function(_0x267390,_0x5d4d44){_0x267390=_0x267390-0x0;var _0x178b4e=_0xb43b[_0x267390];return _0x178b4e;};'use strict';var express=require(_0xbb43('0x0'));var router=express[_0xbb43('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbb43('0x2'));router[_0xbb43('0x3')](_0xbb43('0x4'),auth['isAuthenticated'](),auth[_0xbb43('0x5')](),controller[_0xbb43('0x6')]);router[_0xbb43('0x3')](_0xbb43('0x7'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0x8')]);router['post'](_0xbb43('0x9'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xb')]);router[_0xbb43('0x3')]('/hold',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['hold']);router[_0xbb43('0x3')](_0xbb43('0xc'),auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller[_0xbb43('0xd')]);router[_0xbb43('0x3')]('/calls',auth[_0xbb43('0xa')](),auth[_0xbb43('0x5')](),controller['calls']);router['post'](_0xbb43('0xe'),auth['isAuthenticated'](),auth['isWebrtcLicence'](),controller[_0xbb43('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index dc69658..005acac 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 _0xee5b=['answer\x20executed!','hold','hold\x20fired:','sessionId','hold\x20executed!','unhold','unhold\x20fired:','webbar:unhold','calls','conference','conference\x20fired:','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','path','../../mysqldb','../../config/environment','bluebird','jayson/promise','client','http','ioredis','redis','defaults','userId\x20is\x20required','string','callNumber\x20is\x20required','number','info','stringify','log','handleError:','error','stack','name','status','send','request','then','code','User','findOne','agent','VoiceChannels','filter','rows','UserId','length','\x20not\x20found!','body','validate','json','callNumber','callerId','callbackUrl','entityFound:','webbar:originate','originate\x20executed!','catch','hangup','userId','format','user:%s','webbar:hangup','hangup\x20executed!','answer\x20fired:'];(function(_0x1783f1,_0x38d202){var _0x184f8e=function(_0x4e89a4){while(--_0x4e89a4){_0x1783f1['push'](_0x1783f1['shift']());}};_0x184f8e(++_0x38d202);}(_0xee5b,0x1f4));var _0xbee5=function(_0x42bdb0,_0x2b816f){_0x42bdb0=_0x42bdb0-0x0;var _0x133b9b=_0xee5b[_0x42bdb0];return _0x133b9b;};'use strict';var path=require(_0xbee5('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0xbee5('0x1'))['db'];var config=require(_0xbee5('0x2'));var util=require('util');var BPromise=require(_0xbee5('0x3'));var jayson=require(_0xbee5('0x4'));var amiClient=jayson[_0xbee5('0x5')][_0xbee5('0x6')]({'port':0x232a});var logger=require('../../config/logger')('webbarapi');var Redis=require(_0xbee5('0x7'));config[_0xbee5('0x8')]=_[_0xbee5('0x9')](config[_0xbee5('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require('validate');var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]},'callNumber':{'type':_0xbee5('0xb'),'required':[!![],_0xbee5('0xc')]},'callerId':{'type':_0xbee5('0xb')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0xbee5('0xb'),'required':[!![],'transferNumber\x20is\x20required']}});var holdValidation=new Schema({'userId':{'type':_0xbee5('0xd'),'required':[!![],_0xbee5('0xa')]},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xbee5('0xb'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]}});var conferenceValidation=new Schema({'userId':{'type':'number','required':[!![],_0xbee5('0xa')]}});function emit(_0x141878,_0xf676b1,_0x53b269){logger[_0xbee5('0xe')](_0x141878,_0xf676b1,JSON[_0xbee5('0xf')](_0x53b269));io['to'](_0x141878)['emit'](_0xf676b1,_0x53b269);}function handleError(_0x254dd3){return function(_0x538460){console[_0xbee5('0x10')](_0xbee5('0x11'),_0x538460,_0x538460 instanceof RangeError);logger[_0xbee5('0x12')](_0x538460[_0xbee5('0x13')]);if(_0x538460 instanceof RangeError){if(_0x538460[_0xbee5('0x14')]){delete _0x538460[_0xbee5('0x14')];}_0x254dd3[_0xbee5('0x15')](0x194)[_0xbee5('0x16')](_0x538460);}else{if(_0x538460[_0xbee5('0x14')]){delete _0x538460[_0xbee5('0x14')];}_0x254dd3[_0xbee5('0x15')](0x1f4)[_0xbee5('0x16')](_0x538460);}};}function checkError(){return function(_0x450824){if(!_0x450824){throw new RangeError('NotFound');}return _0x450824;};}function respondWithRpcPromise(_0x550325,_0x469a7a){return new BPromise(function(_0x48bfb5,_0x205491){var _0x117cb3=amiClient;return _0x117cb3[_0xbee5('0x17')](_0x550325,_0x469a7a)[_0xbee5('0x18')](function(_0x3f23c5){if(_0x3f23c5[_0xbee5('0x12')]){if(_0x3f23c5[_0xbee5('0x12')][_0xbee5('0x19')]===0x1f4){return _0x205491(_0x3f23c5[_0xbee5('0x12')]['message']);}return _0x48bfb5(_0x3f23c5['error']['message']);}else{_0x48bfb5(_0x3f23c5['result']);}})['catch'](function(_0x1af3de){_0x205491(_0x1af3de);});});}function getAgent(_0x18d7f4){return db[_0xbee5('0x1a')][_0xbee5('0x1b')]({'where':{'id':_0x18d7f4,'role':_0xbee5('0x1c')}})[_0xbee5('0x18')](checkError());}function getAgentCheckSession(_0x3c8643,_0x4e9a79){return new BPromise(function(_0x36b50f,_0x402bc4){var _0x179d14=respondWithRpcPromise(_0xbee5('0x1d'));var _0x1a8bcc=getAgent(_0x3c8643);Promise['all']([_0x179d14,_0x1a8bcc])[_0xbee5('0x18')](function(_0x15ffb1){var _0xb7a077=_0x15ffb1[0x0];var _0x136a00=_0x15ffb1[0x1];var _0xa57f85=_[_0xbee5('0x1e')](_0xb7a077[_0xbee5('0x1f')],function(_0x36e8bb){return _0x36e8bb[_0xbee5('0x20')]==_0x136a00['id']&&_0x36e8bb['sessionId']==_0x4e9a79;});if(_0xa57f85[_0xbee5('0x21')]==0x1){_0x36b50f(_0x136a00);}else{_0x402bc4(new RangeError('sessionId\x20'+_0x4e9a79+_0xbee5('0x22')));}});});}exports['originate']=function(_0x2d20cd,_0x52dad9){logger[_0xbee5('0xe')]('originate\x20fired:',_0x2d20cd[_0xbee5('0x23')]);var _0x135587=originateValidation[_0xbee5('0x24')](_0x2d20cd[_0xbee5('0x23')]);if(_0x135587['length']>0x0){return _0x52dad9[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x135587);}var _0x477a03=_0x2d20cd[_0xbee5('0x23')]['userId'];var _0x24aed0=_0x2d20cd[_0xbee5('0x23')][_0xbee5('0x26')];var _0x30a2fc=_0x2d20cd['body'][_0xbee5('0x27')];var _0xe61341=_0x2d20cd[_0xbee5('0x23')][_0xbee5('0x28')];return getAgent(_0x477a03)['then'](function(_0x3c8a87){logger['info'](_0xbee5('0x29'),_0x3c8a87['name']);emit(util['format']('user:%s',_0x3c8a87[_0xbee5('0x14')]),_0xbee5('0x2a'),{'callNumber':_0x24aed0,'callerId':_0x30a2fc,'callbackUrl':_0xe61341});return _0x52dad9[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x2b')});})[_0xbee5('0x2c')](handleError(_0x52dad9));};exports[_0xbee5('0x2d')]=function(_0x4040b3,_0x58452a){logger[_0xbee5('0xe')]('hangup\x20fired:',_0x4040b3[_0xbee5('0x23')]);var _0x16ea3e=hangupValidation[_0xbee5('0x24')](_0x4040b3[_0xbee5('0x23')]);if(_0x16ea3e['length']>0x0){return _0x58452a[_0xbee5('0x15')](0x190)['json'](_0x16ea3e);}var _0x565e9f=_0x4040b3[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x2e2827=_0x4040b3[_0xbee5('0x23')]['sessionId'];return getAgent(_0x565e9f)[_0xbee5('0x18')](function(_0x2819e2){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x2819e2[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x2819e2[_0xbee5('0x14')]),_0xbee5('0x31'),{'sessionId':_0x2e2827});return _0x58452a[_0xbee5('0x15')](0xc8)['json']({'error':![],'message':_0xbee5('0x32')});})[_0xbee5('0x2c')](handleError(_0x58452a));};exports['answer']=function(_0x1e872d,_0xebbcc5){logger[_0xbee5('0xe')](_0xbee5('0x33'),_0x1e872d['body']);var _0x4cfe54=answerValidation['validate'](_0x1e872d[_0xbee5('0x23')]);if(_0x4cfe54[_0xbee5('0x21')]>0x0){return _0xebbcc5[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x4cfe54);}var _0x4012fd=_0x1e872d[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x2c4464=_0x1e872d[_0xbee5('0x23')]['sessionId'];return getAgent(_0x4012fd)['then'](function(_0x38e9f5){logger['info'](_0xbee5('0x29'),_0x38e9f5[_0xbee5('0x14')]);emit(util['format'](_0xbee5('0x30'),_0x38e9f5[_0xbee5('0x14')]),'webbar:answer',{'sessionId':_0x2c4464});return _0xebbcc5['status'](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x34')});})['catch'](handleError(_0xebbcc5));};exports[_0xbee5('0x35')]=function(_0x2974f6,_0x4c88ee){logger[_0xbee5('0xe')](_0xbee5('0x36'),_0x2974f6[_0xbee5('0x23')]);var _0x2978db=holdValidation[_0xbee5('0x24')](_0x2974f6[_0xbee5('0x23')]);if(_0x2978db[_0xbee5('0x21')]>0x0){return _0x4c88ee['status'](0x190)[_0xbee5('0x25')](_0x2978db);}var _0x34f01d=_0x2974f6[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x5ba5f1=_0x2974f6[_0xbee5('0x23')][_0xbee5('0x37')];return getAgent(_0x34f01d)[_0xbee5('0x18')](function(_0x4aa21a){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x4aa21a['name']);emit(util['format']('user:%s',_0x4aa21a[_0xbee5('0x14')]),'webbar:hold',{'sessionId':_0x5ba5f1});return _0x4c88ee[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':_0xbee5('0x38')});})[_0xbee5('0x2c')](handleError(_0x4c88ee));};exports[_0xbee5('0x39')]=function(_0x296fc8,_0x55e654){logger[_0xbee5('0xe')](_0xbee5('0x3a'),_0x296fc8[_0xbee5('0x23')]);var _0x2479f6=unholdValidation['validate'](_0x296fc8[_0xbee5('0x23')]);if(_0x2479f6['length']>0x0){return _0x55e654[_0xbee5('0x15')](0x190)[_0xbee5('0x25')](_0x2479f6);}var _0xf48059=_0x296fc8[_0xbee5('0x23')][_0xbee5('0x2e')];var _0x1b02eb=_0x296fc8[_0xbee5('0x23')][_0xbee5('0x37')];return getAgent(_0xf48059)[_0xbee5('0x18')](function(_0x31abcd){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x31abcd[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x31abcd['name']),_0xbee5('0x3b'),{'sessionId':_0x1b02eb});return _0x55e654[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':'unhold\x20executed!'});})[_0xbee5('0x2c')](handleError(_0x55e654));};exports[_0xbee5('0x3c')]=function(_0x21d9c6,_0x4e8864){logger[_0xbee5('0xe')]('calls\x20fired:',_0x4e8864[_0xbee5('0x23')]);var _0x4ee645=callsValidation[_0xbee5('0x24')](_0x21d9c6[_0xbee5('0x23')]);if(_0x4ee645[_0xbee5('0x21')]>0x0){return _0x4e8864['status'](0x190)['json'](_0x4ee645);}var _0x5528e8=_0x21d9c6[_0xbee5('0x23')][_0xbee5('0x2e')];var _0xbc3da7=respondWithRpcPromise('VoiceChannels');var _0x4d8c34=getAgent(_0x5528e8);return Promise['all']([_0xbc3da7,_0x4d8c34])[_0xbee5('0x18')](function(_0x33fbb8){var _0x32ec82=_0x33fbb8[0x0];var _0x5cc68d=_0x33fbb8[0x1];var _0x154d44=_[_0xbee5('0x1e')](_0x32ec82[_0xbee5('0x1f')],function(_0x3fa83b){return _0x3fa83b[_0xbee5('0x20')]==_0x5cc68d['id'];});return _0x4e8864[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'count':_0x154d44[_0xbee5('0x21')],'rows':_0x154d44});})[_0xbee5('0x2c')](handleError(_0x4e8864));};exports[_0xbee5('0x3d')]=function(_0x38100e,_0x245521){logger[_0xbee5('0xe')](_0xbee5('0x3e'),_0x38100e[_0xbee5('0x23')]);var _0x143fd9=conferenceValidation[_0xbee5('0x24')](_0x38100e['body']);if(_0x143fd9[_0xbee5('0x21')]>0x0){return _0x245521['status'](0x190)['json'](_0x143fd9);}var _0x43941c=_0x38100e[_0xbee5('0x23')]['userId'];return getAgent(_0x43941c)['then'](function(_0x9c0fbb){logger['info'](_0xbee5('0x29'),_0x9c0fbb[_0xbee5('0x14')]);emit(util['format'](_0xbee5('0x30'),_0x9c0fbb[_0xbee5('0x14')]),_0xbee5('0x3f'));return _0x245521[_0xbee5('0x15')](0xc8)['json']({'error':![],'message':_0xbee5('0x40')});})['catch'](handleError(_0x245521));};exports[_0xbee5('0x41')]=function(_0x465ec8,_0x5c4c2c){logger[_0xbee5('0xe')](_0xbee5('0x42'),_0x465ec8['body']);var _0xf006d4=transferValidation[_0xbee5('0x24')](_0x465ec8['body']);if(_0xf006d4[_0xbee5('0x21')]>0x0){return _0x5c4c2c['status'](0x190)[_0xbee5('0x25')](_0xf006d4);}var _0x4b5789=_0x465ec8[_0xbee5('0x23')]['userId'];var _0x541414=_0x465ec8[_0xbee5('0x23')][_0xbee5('0x37')];var _0x3b5eda=_0x465ec8[_0xbee5('0x23')][_0xbee5('0x43')];return getAgent(_0x4b5789)[_0xbee5('0x18')](function(_0x4c6a0b){logger[_0xbee5('0xe')](_0xbee5('0x29'),_0x4c6a0b[_0xbee5('0x14')]);emit(util[_0xbee5('0x2f')](_0xbee5('0x30'),_0x4c6a0b[_0xbee5('0x14')]),_0xbee5('0x44'),{'sessionId':_0x541414,'transferNumber':_0x3b5eda});return _0x5c4c2c[_0xbee5('0x15')](0xc8)[_0xbee5('0x25')]({'error':![],'message':'transfer\x20executed!'});})[_0xbee5('0x2c')](handleError(_0x5c4c2c));}; \ No newline at end of file +var _0xb07f=['hold','hold\x20fired:','user:%s','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','rows','conference','webbar:conference','conference\x20executed!','transfer','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','lodash','../../mysqldb','../../config/environment','util','bluebird','jayson/promise','client','http','../../config/logger','webbarapi','redis','defaults','localhost','socket.io-emitter','validate','number','userId\x20is\x20required','string','callNumber\x20is\x20required','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','log','handleError:','stack','name','send','status','NotFound','request','then','error','message','result','catch','User','agent','VoiceChannels','all','filter','UserId','length','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','entityFound:','format','webbar:originate','hangup','hangup\x20fired:','sessionId','webbar:hangup','hangup\x20executed!','answer','answer\x20fired:','webbar:answer','answer\x20executed!'];(function(_0x20bc10,_0x35bed9){var _0x3bd5ce=function(_0x8d1e4c){while(--_0x8d1e4c){_0x20bc10['push'](_0x20bc10['shift']());}};_0x3bd5ce(++_0x35bed9);}(_0xb07f,0x109));var _0xfb07=function(_0x252cd1,_0x3b0e07){_0x252cd1=_0x252cd1-0x0;var _0x442b83=_0xb07f[_0x252cd1];return _0x442b83;};'use strict';var path=require(_0xfb07('0x0'));var fs=require('fs');var _=require(_0xfb07('0x1'));var db=require(_0xfb07('0x2'))['db'];var config=require(_0xfb07('0x3'));var util=require(_0xfb07('0x4'));var BPromise=require(_0xfb07('0x5'));var jayson=require(_0xfb07('0x6'));var amiClient=jayson[_0xfb07('0x7')][_0xfb07('0x8')]({'port':0x232a});var logger=require(_0xfb07('0x9'))(_0xfb07('0xa'));var Redis=require('ioredis');config[_0xfb07('0xb')]=_[_0xfb07('0xc')](config[_0xfb07('0xb')],{'host':_0xfb07('0xd'),'port':0x18eb});var io=require(_0xfb07('0xe'))(new Redis(config[_0xfb07('0xb')]));var Schema=require(_0xfb07('0xf'));var originateValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'callNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x13')]},'callerId':{'type':_0xfb07('0x12')},'callbackUrl':{'type':'string'}});var hangupValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x14')]},'transferNumber':{'type':_0xfb07('0x12'),'required':[!![],_0xfb07('0x15')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]},'sessionId':{'type':_0xfb07('0x12'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});var conferenceValidation=new Schema({'userId':{'type':_0xfb07('0x10'),'required':[!![],_0xfb07('0x11')]}});function emit(_0x6a14e0,_0x3dde76,_0x1cfc43){logger[_0xfb07('0x16')](_0x6a14e0,_0x3dde76,JSON[_0xfb07('0x17')](_0x1cfc43));io['to'](_0x6a14e0)['emit'](_0x3dde76,_0x1cfc43);}function handleError(_0x57fc39){return function(_0x3e747e){console[_0xfb07('0x18')](_0xfb07('0x19'),_0x3e747e,_0x3e747e instanceof RangeError);logger['error'](_0x3e747e[_0xfb07('0x1a')]);if(_0x3e747e instanceof RangeError){if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e['name'];}_0x57fc39['status'](0x194)[_0xfb07('0x1c')](_0x3e747e);}else{if(_0x3e747e[_0xfb07('0x1b')]){delete _0x3e747e[_0xfb07('0x1b')];}_0x57fc39[_0xfb07('0x1d')](0x1f4)[_0xfb07('0x1c')](_0x3e747e);}};}function checkError(){return function(_0x323bec){if(!_0x323bec){throw new RangeError(_0xfb07('0x1e'));}return _0x323bec;};}function respondWithRpcPromise(_0x23c2be,_0x19ad99){return new BPromise(function(_0x578bb2,_0x45806a){var _0x56d0c4=amiClient;return _0x56d0c4[_0xfb07('0x1f')](_0x23c2be,_0x19ad99)[_0xfb07('0x20')](function(_0x428c85){if(_0x428c85[_0xfb07('0x21')]){if(_0x428c85[_0xfb07('0x21')]['code']===0x1f4){return _0x45806a(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}return _0x578bb2(_0x428c85[_0xfb07('0x21')][_0xfb07('0x22')]);}else{_0x578bb2(_0x428c85[_0xfb07('0x23')]);}})[_0xfb07('0x24')](function(_0x531346){_0x45806a(_0x531346);});});}function getAgent(_0x36d6f3){return db[_0xfb07('0x25')]['findOne']({'where':{'id':_0x36d6f3,'role':_0xfb07('0x26')}})[_0xfb07('0x20')](checkError());}function getAgentCheckSession(_0xe813a7,_0x149ac0){return new BPromise(function(_0x46927a,_0x2b0650){var _0x20f01a=respondWithRpcPromise(_0xfb07('0x27'));var _0x95f1d=getAgent(_0xe813a7);Promise[_0xfb07('0x28')]([_0x20f01a,_0x95f1d])[_0xfb07('0x20')](function(_0x49b06e){var _0x217932=_0x49b06e[0x0];var _0x1e4cb8=_0x49b06e[0x1];var _0x36787a=_[_0xfb07('0x29')](_0x217932['rows'],function(_0x46d57e){return _0x46d57e[_0xfb07('0x2a')]==_0x1e4cb8['id']&&_0x46d57e['sessionId']==_0x149ac0;});if(_0x36787a[_0xfb07('0x2b')]==0x1){_0x46927a(_0x1e4cb8);}else{_0x2b0650(new RangeError('sessionId\x20'+_0x149ac0+_0xfb07('0x2c')));}});});}exports['originate']=function(_0x56b48c,_0x4a8d4c){logger[_0xfb07('0x16')](_0xfb07('0x2d'),_0x56b48c[_0xfb07('0x2e')]);var _0x4452d7=originateValidation[_0xfb07('0xf')](_0x56b48c[_0xfb07('0x2e')]);if(_0x4452d7['length']>0x0){return _0x4a8d4c['status'](0x190)[_0xfb07('0x2f')](_0x4452d7);}var _0x1cccdd=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x5e28cd=_0x56b48c['body'][_0xfb07('0x31')];var _0x3e0d11=_0x56b48c[_0xfb07('0x2e')][_0xfb07('0x32')];var _0x4d06f5=_0x56b48c[_0xfb07('0x2e')]['callbackUrl'];return getAgent(_0x1cccdd)['then'](function(_0x4a5055){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4a5055[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')]('user:%s',_0x4a5055['name']),_0xfb07('0x35'),{'callNumber':_0x5e28cd,'callerId':_0x3e0d11,'callbackUrl':_0x4d06f5});return _0x4a8d4c[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x4a8d4c));};exports[_0xfb07('0x36')]=function(_0x10cd8b,_0x55de52){logger['info'](_0xfb07('0x37'),_0x10cd8b[_0xfb07('0x2e')]);var _0x18c41f=hangupValidation[_0xfb07('0xf')](_0x10cd8b[_0xfb07('0x2e')]);if(_0x18c41f['length']>0x0){return _0x55de52[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x18c41f);}var _0xac769b=_0x10cd8b[_0xfb07('0x2e')]['userId'];var _0x4ab5dd=_0x10cd8b[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0xac769b)[_0xfb07('0x20')](function(_0xc5df59){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0xc5df59[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0xc5df59[_0xfb07('0x1b')]),_0xfb07('0x39'),{'sessionId':_0x4ab5dd});return _0x55de52['status'](0xc8)['json']({'error':![],'message':_0xfb07('0x3a')});})[_0xfb07('0x24')](handleError(_0x55de52));};exports[_0xfb07('0x3b')]=function(_0x48c179,_0x479e61){logger[_0xfb07('0x16')](_0xfb07('0x3c'),_0x48c179[_0xfb07('0x2e')]);var _0x123e3d=answerValidation[_0xfb07('0xf')](_0x48c179[_0xfb07('0x2e')]);if(_0x123e3d[_0xfb07('0x2b')]>0x0){return _0x479e61[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x123e3d);}var _0x492f1b=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x3d6372=_0x48c179[_0xfb07('0x2e')][_0xfb07('0x38')];return getAgent(_0x492f1b)[_0xfb07('0x20')](function(_0x4cb228){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x4cb228[_0xfb07('0x1b')]);emit(util['format']('user:%s',_0x4cb228[_0xfb07('0x1b')]),_0xfb07('0x3d'),{'sessionId':_0x3d6372});return _0x479e61['status'](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x3e')});})[_0xfb07('0x24')](handleError(_0x479e61));};exports[_0xfb07('0x3f')]=function(_0x44568c,_0x567958){logger['info'](_0xfb07('0x40'),_0x44568c[_0xfb07('0x2e')]);var _0x38354c=holdValidation[_0xfb07('0xf')](_0x44568c[_0xfb07('0x2e')]);if(_0x38354c[_0xfb07('0x2b')]>0x0){return _0x567958[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x38354c);}var _0x186987=_0x44568c[_0xfb07('0x2e')]['userId'];var _0x5b304d=_0x44568c['body'][_0xfb07('0x38')];return getAgent(_0x186987)['then'](function(_0x2397f8){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x2397f8[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x2397f8['name']),_0xfb07('0x42'),{'sessionId':_0x5b304d});return _0x567958[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x43')});})[_0xfb07('0x24')](handleError(_0x567958));};exports['unhold']=function(_0x3cfb89,_0x3b85f7){logger[_0xfb07('0x16')](_0xfb07('0x44'),_0x3cfb89[_0xfb07('0x2e')]);var _0x5179c2=unholdValidation[_0xfb07('0xf')](_0x3cfb89[_0xfb07('0x2e')]);if(_0x5179c2[_0xfb07('0x2b')]>0x0){return _0x3b85f7[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x5179c2);}var _0x529936=_0x3cfb89[_0xfb07('0x2e')][_0xfb07('0x30')];var _0x26a7b7=_0x3cfb89[_0xfb07('0x2e')]['sessionId'];return getAgent(_0x529936)[_0xfb07('0x20')](function(_0x204469){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x204469[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x204469[_0xfb07('0x1b')]),_0xfb07('0x45'),{'sessionId':_0x26a7b7});return _0x3b85f7[_0xfb07('0x1d')](0xc8)['json']({'error':![],'message':_0xfb07('0x46')});})['catch'](handleError(_0x3b85f7));};exports[_0xfb07('0x47')]=function(_0xfcaeb7,_0x22fa5c){logger[_0xfb07('0x16')](_0xfb07('0x48'),_0x22fa5c[_0xfb07('0x2e')]);var _0x1c76af=callsValidation['validate'](_0xfcaeb7['body']);if(_0x1c76af['length']>0x0){return _0x22fa5c[_0xfb07('0x1d')](0x190)[_0xfb07('0x2f')](_0x1c76af);}var _0x44d1a1=_0xfcaeb7['body'][_0xfb07('0x30')];var _0x4ef1a4=respondWithRpcPromise(_0xfb07('0x27'));var _0x29e4be=getAgent(_0x44d1a1);return Promise['all']([_0x4ef1a4,_0x29e4be])[_0xfb07('0x20')](function(_0x2f9f0f){var _0x18d0de=_0x2f9f0f[0x0];var _0xc122ae=_0x2f9f0f[0x1];var _0x294dc8=_[_0xfb07('0x29')](_0x18d0de[_0xfb07('0x49')],function(_0x18ae74){return _0x18ae74[_0xfb07('0x2a')]==_0xc122ae['id'];});return _0x22fa5c[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'count':_0x294dc8[_0xfb07('0x2b')],'rows':_0x294dc8});})[_0xfb07('0x24')](handleError(_0x22fa5c));};exports[_0xfb07('0x4a')]=function(_0x5387ce,_0x275aba){logger[_0xfb07('0x16')]('conference\x20fired:',_0x5387ce['body']);var _0xb5bf41=conferenceValidation[_0xfb07('0xf')](_0x5387ce[_0xfb07('0x2e')]);if(_0xb5bf41['length']>0x0){return _0x275aba[_0xfb07('0x1d')](0x190)['json'](_0xb5bf41);}var _0x4e323f=_0x5387ce['body']['userId'];return getAgent(_0x4e323f)[_0xfb07('0x20')](function(_0x237117){logger[_0xfb07('0x16')](_0xfb07('0x33'),_0x237117[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x237117['name']),_0xfb07('0x4b'));return _0x275aba[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x4c')});})[_0xfb07('0x24')](handleError(_0x275aba));};exports[_0xfb07('0x4d')]=function(_0x268d88,_0x238492){logger['info'](_0xfb07('0x4e'),_0x268d88[_0xfb07('0x2e')]);var _0x3831bf=transferValidation[_0xfb07('0xf')](_0x268d88[_0xfb07('0x2e')]);if(_0x3831bf['length']>0x0){return _0x238492['status'](0x190)[_0xfb07('0x2f')](_0x3831bf);}var _0x231247=_0x268d88['body'][_0xfb07('0x30')];var _0x311c6d=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x38')];var _0x127392=_0x268d88[_0xfb07('0x2e')][_0xfb07('0x4f')];return getAgent(_0x231247)['then'](function(_0x4c1238){logger[_0xfb07('0x16')]('entityFound:',_0x4c1238[_0xfb07('0x1b')]);emit(util[_0xfb07('0x34')](_0xfb07('0x41'),_0x4c1238[_0xfb07('0x1b')]),_0xfb07('0x50'),{'sessionId':_0x311c6d,'transferNumber':_0x127392});return _0x238492[_0xfb07('0x1d')](0xc8)[_0xfb07('0x2f')]({'error':![],'message':_0xfb07('0x51')});})[_0xfb07('0x24')](handleError(_0x238492));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index a2760dd..224069e 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 _0x896e=['/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','create','post','addDisposition','addAnswer','/:id/notify','notify','/:id/send','send','put','destroy','delete','removeAnswers','removeAgents','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0x896e,0x1e9));var _0xe896=function(_0xb56c5e,_0x171bef){_0xb56c5e=_0xb56c5e-0x0;var _0x19b862=_0x896e[_0xb56c5e];return _0x19b862;};'use strict';var multer=require(_0xe896('0x0'));var util=require(_0xe896('0x1'));var path=require(_0xe896('0x2'));var timeout=require(_0xe896('0x3'));var express=require(_0xe896('0x4'));var router=express[_0xe896('0x5')]();var fs_extra=require(_0xe896('0x6'));var auth=require(_0xe896('0x7'));var interaction=require(_0xe896('0x8'));var config=require(_0xe896('0x9'));var controller=require(_0xe896('0xa'));router[_0xe896('0xb')]('/',auth['isAuthenticated'](),controller[_0xe896('0xc')]);router[_0xe896('0xb')](_0xe896('0xd'),auth[_0xe896('0xe')](),controller[_0xe896('0xf')]);router['get'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x11')]);router['get'](_0xe896('0x12'),auth['isAuthenticated'](),controller[_0xe896('0x13')]);router['get'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x15')]);router['get'](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x17')]);router['get'](_0xe896('0x18'),auth[_0xe896('0xe')](),controller[_0xe896('0x19')]);router['post']('/',auth[_0xe896('0xe')](),controller[_0xe896('0x1a')]);router[_0xe896('0x1b')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xe896('0x1c')]);router[_0xe896('0x1b')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0xe896('0x1d')]);router[_0xe896('0x1b')]('/:id/users',auth[_0xe896('0xe')](),controller['addAgents']);router[_0xe896('0x1b')](_0xe896('0x18'),auth[_0xe896('0xe')](),controller['addApplications']);router[_0xe896('0x1b')](_0xe896('0x1e'),controller[_0xe896('0x1f')]);router[_0xe896('0x1b')](_0xe896('0x20'),auth[_0xe896('0xe')](),controller[_0xe896('0x21')]);router[_0xe896('0x22')]('/:id',auth[_0xe896('0xe')](),controller['update']);router['delete'](_0xe896('0x10'),auth[_0xe896('0xe')](),controller[_0xe896('0x23')]);router[_0xe896('0x24')]('/:id/dispositions',auth[_0xe896('0xe')](),controller['removeDispositions']);router['delete'](_0xe896('0x14'),auth[_0xe896('0xe')](),controller[_0xe896('0x25')]);router[_0xe896('0x24')](_0xe896('0x16'),auth[_0xe896('0xe')](),controller[_0xe896('0x26')]);module['exports']=router; \ No newline at end of file +var _0x66fa=['/:id','update','delete','destroy','removeDispositions','removeAnswers','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id/canned_answers','getAnswers','/:id/users','getAgents','/:id/applications','post','/:id/dispositions','addDisposition','addAgents','/:id/notify','notify','/:id/send','send','put'];(function(_0x2f26dd,_0x3d6651){var _0x59b163=function(_0x3e6208){while(--_0x3e6208){_0x2f26dd['push'](_0x2f26dd['shift']());}};_0x59b163(++_0x3d6651);}(_0x66fa,0x117));var _0xa66f=function(_0x15d4bf,_0x363479){_0x15d4bf=_0x15d4bf-0x0;var _0x11ec96=_0x66fa[_0x15d4bf];return _0x11ec96;};'use strict';var multer=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var path=require('path');var timeout=require(_0xa66f('0x2'));var express=require(_0xa66f('0x3'));var router=express[_0xa66f('0x4')]();var fs_extra=require(_0xa66f('0x5'));var auth=require(_0xa66f('0x6'));var interaction=require(_0xa66f('0x7'));var config=require(_0xa66f('0x8'));var controller=require('./whatsappAccount.controller');router['get']('/',auth[_0xa66f('0x9')](),controller[_0xa66f('0xa')]);router[_0xa66f('0xb')](_0xa66f('0xc'),auth[_0xa66f('0x9')](),controller['describe']);router[_0xa66f('0xb')]('/:id',auth[_0xa66f('0x9')](),controller['show']);router[_0xa66f('0xb')]('/:id/dispositions',auth['isAuthenticated'](),controller['getDispositions']);router[_0xa66f('0xb')](_0xa66f('0xd'),auth['isAuthenticated'](),controller[_0xa66f('0xe')]);router['get'](_0xa66f('0xf'),auth['isAuthenticated'](),controller[_0xa66f('0x10')]);router[_0xa66f('0xb')](_0xa66f('0x11'),auth['isAuthenticated'](),controller['getApplications']);router[_0xa66f('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x14')]);router[_0xa66f('0x12')](_0xa66f('0xd'),auth['isAuthenticated'](),controller['addAnswer']);router[_0xa66f('0x12')](_0xa66f('0xf'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x15')]);router['post'](_0xa66f('0x11'),auth['isAuthenticated'](),controller['addApplications']);router[_0xa66f('0x12')](_0xa66f('0x16'),controller[_0xa66f('0x17')]);router[_0xa66f('0x12')](_0xa66f('0x18'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x19')]);router[_0xa66f('0x1a')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1c')]);router[_0xa66f('0x1d')](_0xa66f('0x1b'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1e')]);router['delete'](_0xa66f('0x13'),auth[_0xa66f('0x9')](),controller[_0xa66f('0x1f')]);router[_0xa66f('0x1d')]('/:id/canned_answers',auth[_0xa66f('0x9')](),controller[_0xa66f('0x20')]);router[_0xa66f('0x1d')](_0xa66f('0xf'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa66f('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 07c27a6..41a27b2 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 _0xf858=['sequelize','exports','STRING','name','generate','ENUM','twilio','sinch','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xf858,0x1dc));var _0x8f85=function(_0x5aa1e8,_0x29f47c){_0x5aa1e8=_0x5aa1e8-0x0;var _0xa5cdd6=_0xf858[_0x5aa1e8];return _0xa5cdd6;};'use strict';var Sequelize=require(_0x8f85('0x0'));var rs=require('randomstring');module[_0x8f85('0x1')]={'name':{'type':Sequelize[_0x8f85('0x2')],'unique':_0x8f85('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0x8f85('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x8f85('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x8f85('0x2')],'defaultValue':function(){return rs[_0x8f85('0x4')]();}},'phone':{'type':Sequelize[_0x8f85('0x2')]},'type':{'type':Sequelize[_0x8f85('0x5')](_0x8f85('0x6'),_0x8f85('0x7'))},'accountSid':{'type':Sequelize[_0x8f85('0x2')]},'baseUrl':{'type':Sequelize[_0x8f85('0x2')]},'authToken':{'type':Sequelize[_0x8f85('0x2')]},'notificationTemplate':{'type':Sequelize[_0x8f85('0x8')],'defaultValue':function(){return _0x8f85('0x9');}},'notificationSound':{'type':Sequelize[_0x8f85('0xa')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x8f85('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x8f85('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x8f85('0xb')],'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[_0x8f85('0xb')],'comment':_0x8f85('0xc')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2961e8){if(!_0x2961e8){this['setDataValue']('mandatoryDispositionPauseId',null);}this['setDataValue'](_0x8f85('0xd'),_0x2961e8);}},'description':{'type':Sequelize[_0x8f85('0x2')]}}; \ No newline at end of file +var _0x3a8d=['exports','STRING','name','generate','ENUM','twilio','sinch','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','setDataValue'];(function(_0x519cfe,_0x3c3cb6){var _0x5ea0a6=function(_0x2fdf88){while(--_0x2fdf88){_0x519cfe['push'](_0x519cfe['shift']());}};_0x5ea0a6(++_0x3c3cb6);}(_0x3a8d,0x14a));var _0xd3a8=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0x3a8d[_0x1d1219];return _0x5b5b89;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd3a8('0x0')]={'name':{'type':Sequelize[_0xd3a8('0x1')],'unique':_0xd3a8('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd3a8('0x1')],'allowNull':![]},'remote':{'type':Sequelize[_0xd3a8('0x1')],'allowNull':![]},'token':{'type':Sequelize[_0xd3a8('0x1')],'defaultValue':function(){return rs[_0xd3a8('0x3')]();}},'phone':{'type':Sequelize[_0xd3a8('0x1')]},'type':{'type':Sequelize[_0xd3a8('0x4')](_0xd3a8('0x5'),_0xd3a8('0x6'))},'accountSid':{'type':Sequelize[_0xd3a8('0x1')]},'baseUrl':{'type':Sequelize[_0xd3a8('0x1')]},'authToken':{'type':Sequelize[_0xd3a8('0x1')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd3a8('0x7');}},'notificationSound':{'type':Sequelize[_0xd3a8('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd3a8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd3a8('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd3a8('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd3a8('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd3a8('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2505e0){if(!_0x2505e0){this[_0xd3a8('0xa')]('mandatoryDispositionPauseId',null);}this[_0xd3a8('0xa')]('mandatoryDisposition',_0x2505e0);}},'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 db90444..1544bbd 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 _0xfaba=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','getDispositions','findOne','WhatsappAccountId','filter','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','priority','stack','finally','getApplications','notify','whatsapp','Applications','account','sinch','statuses','read','WhatsappMessage','timestamp','message_id','applications','orderBy','asc','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','mobile','twilio','From','whatsapp:','messageId','MessageSid','from','notifications','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','WhatsappInteraction','interaction','autoclose','push','close','ContactId','UserId','User','agent','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','WhatsappAccount,\x20%s,\x20%s,\x20%s','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','set','Content-Type','text/xml','\x0a','body\x20is\x20mandatory\x20and\x20not\x20empty','List','user','out','dataValues','Messages','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','client','http','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','offset','limit','undefined','json','save','destroy','then','WhatsappAccounts','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','count','include','findAll','rows','show','params','includeAll','create','body','get','role','UserProfileSection','find','userProfileId','autoAssociation'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xfaba,0x124));var _0xafab=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaba[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xafab('0x0'));var rimraf=require(_0xafab('0x1'));var zipdir=require(_0xafab('0x2'));var jsonpatch=require(_0xafab('0x3'));var rp=require(_0xafab('0x4'));var moment=require(_0xafab('0x5'));var BPromise=require(_0xafab('0x6'));var Mustache=require('mustache');var util=require(_0xafab('0x7'));var path=require('path');var sox=require(_0xafab('0x8'));var csv=require(_0xafab('0x9'));var ejs=require(_0xafab('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xafab('0xb'));var squel=require(_0xafab('0xc'));var crypto=require(_0xafab('0xd'));var jsforce=require(_0xafab('0xe'));var deskjs=require(_0xafab('0xf'));var toCsv=require(_0xafab('0x9'));var querystring=require(_0xafab('0x10'));var Papa=require(_0xafab('0x11'));var Redis=require(_0xafab('0x12'));var authService=require(_0xafab('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xafab('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xafab('0x15'))(_0xafab('0x16'));var utils=require('../../config/utils');var config=require(_0xafab('0x17'));var licenseUtil=require(_0xafab('0x18'));var db=require(_0xafab('0x19'))['db'];config[_0xafab('0x1a')]=_[_0xafab('0x1b')](config[_0xafab('0x1a')],{'host':_0xafab('0x1c'),'port':0x18eb});var socket=require(_0xafab('0x1d'))(new Redis(config['redis']));require(_0xafab('0x1e'))[_0xafab('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0xafab('0x20')][_0xafab('0x21')]({'port':0x232c});function respondWithRpcPromise(_0x2364a0,_0x4cbdb3,_0x3ed1e4,_0x40ec18){return new BPromise(function(_0x3dde1e,_0x3a2e36){var _0x1989f3=_0x40ec18||client;return _0x1989f3['request'](_0x2364a0,_0x3ed1e4)['then'](function(_0x5db96d){logger[_0xafab('0x22')](_0xafab('0x23'),_0x4cbdb3,_0xafab('0x24'));logger[_0xafab('0x25')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x4cbdb3,_0xafab('0x24'),JSON[_0xafab('0x26')](_0x5db96d));if(_0x5db96d['error']){if(_0x5db96d['error'][_0xafab('0x27')]===0x1f4){logger['error'](_0xafab('0x23'),_0x4cbdb3,_0x5db96d[_0xafab('0x28')]['message']);return _0x3a2e36(_0x5db96d[_0xafab('0x28')][_0xafab('0x29')]);}logger[_0xafab('0x28')]('WhatsappAccount,\x20%s,\x20%s',_0x4cbdb3,_0x5db96d[_0xafab('0x28')][_0xafab('0x29')]);return _0x3dde1e(_0x5db96d[_0xafab('0x28')][_0xafab('0x29')]);}else{logger['info'](_0xafab('0x23'),_0x4cbdb3,_0xafab('0x24'));_0x3dde1e(_0x5db96d[_0xafab('0x2a')][_0xafab('0x29')]);}})[_0xafab('0x2b')](function(_0x14b396){logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x4cbdb3,_0x14b396);_0x3a2e36(_0x14b396);});});}function respondWithStatusCode(_0x5cdde3,_0x65bfff){_0x65bfff=_0x65bfff||0xcc;return function(_0x378710){if(_0x378710){return _0x5cdde3[_0xafab('0x2c')](_0x65bfff);}return _0x5cdde3[_0xafab('0x2d')](_0x65bfff)[_0xafab('0x2e')]();};}function respondWithResult(_0x5ae11d,_0x49ec16){_0x49ec16=_0x49ec16||0xc8;return function(_0x1ad49d){if(_0x1ad49d){return _0x5ae11d['status'](_0x49ec16)['json'](_0x1ad49d);}};}function respondWithFilteredResult(_0x458572,_0x331c75){return function(_0x391119){if(_0x391119){var _0x18db6d=typeof _0x331c75[_0xafab('0x2f')]==='undefined'&&typeof _0x331c75[_0xafab('0x30')]===_0xafab('0x31');var _0x532f84=_0x391119['count'];var _0x41e09a=_0x18db6d?0x0:_0x331c75[_0xafab('0x2f')];var _0x5c97a1=_0x18db6d?_0x391119['count']:_0x331c75[_0xafab('0x2f')]+_0x331c75['limit'];var _0x1c41e1;if(_0x5c97a1>=_0x532f84){_0x5c97a1=_0x532f84;_0x1c41e1=0xc8;}else{_0x1c41e1=0xce;}_0x458572[_0xafab('0x2d')](_0x1c41e1);return _0x458572['set']('Content-Range',_0x41e09a+'-'+_0x5c97a1+'/'+_0x532f84)[_0xafab('0x32')](_0x391119);}return null;};}function patchUpdates(_0x43ec84){return function(_0x4c26ee){try{jsonpatch['apply'](_0x4c26ee,_0x43ec84,!![]);}catch(_0x45dccf){return BPromise['reject'](_0x45dccf);}return _0x4c26ee[_0xafab('0x33')]();};}function saveUpdates(_0x5f2c86,_0x1986ca){return function(_0x886255){if(_0x886255){return _0x886255['update'](_0x5f2c86)['then'](function(_0x441931){return _0x441931;});}return null;};}function removeEntity(_0x12de94,_0x1d8920){return function(_0x56b87a){if(_0x56b87a){return _0x56b87a[_0xafab('0x34')]()[_0xafab('0x35')](function(){var _0x5b50dc=_0x56b87a['get']({'plain':!![]});var _0x16d083=_0xafab('0x36');return db[_0xafab('0x37')][_0xafab('0x34')]({'where':{'type':_0x16d083,'resourceId':_0x5b50dc['id']}})[_0xafab('0x35')](function(){return _0x56b87a;});})[_0xafab('0x35')](function(){_0x12de94[_0xafab('0x2d')](0xcc)[_0xafab('0x2e')]();});}};}function handleEntityNotFound(_0x486b6f,_0x44eb33){return function(_0x46175f){if(!_0x46175f){_0x486b6f['sendStatus'](0x194);}return _0x46175f;};}function handleError(_0x278f5c,_0x7cf7e5){_0x7cf7e5=_0x7cf7e5||0x1f4;return function(_0x50cc83){logger[_0xafab('0x28')](_0x50cc83['stack']);if(_0x50cc83[_0xafab('0x38')]){delete _0x50cc83['name'];}_0x278f5c[_0xafab('0x2d')](_0x7cf7e5)[_0xafab('0x39')](_0x50cc83);};}exports[_0xafab('0x3a')]=function(_0x598494,_0x1547bc){var _0x457d21={'include':[{'model':db[_0xafab('0x3b')],'as':_0xafab('0x3c')}]},_0x117ecf={},_0x4290d2={'count':0x0,'rows':[]};var _0x408fbd=_[_0xafab('0x3d')](db[_0xafab('0x3e')][_0xafab('0x3f')],function(_0x151b59){return{'name':_0x151b59[_0xafab('0x40')],'type':_0x151b59[_0xafab('0x41')]['key']};});_0x117ecf[_0xafab('0x42')]=_['map'](_0x408fbd,_0xafab('0x38'));_0x117ecf[_0xafab('0x43')]=_[_0xafab('0x44')](_0x598494['query']);_0x117ecf[_0xafab('0x45')]=_[_0xafab('0x46')](_0x117ecf[_0xafab('0x42')],_0x117ecf['query']);_0x457d21[_0xafab('0x47')]=_[_0xafab('0x46')](_0x117ecf[_0xafab('0x42')],qs['fields'](_0x598494[_0xafab('0x43')][_0xafab('0x48')]));_0x457d21['attributes']=_0x457d21[_0xafab('0x47')][_0xafab('0x49')]?_0x457d21['attributes']:_0x117ecf[_0xafab('0x42')];if(!_0x598494[_0xafab('0x43')][_0xafab('0x4a')](_0xafab('0x4b'))){_0x457d21[_0xafab('0x30')]=qs[_0xafab('0x30')](_0x598494['query'][_0xafab('0x30')]);_0x457d21['offset']=qs[_0xafab('0x2f')](_0x598494[_0xafab('0x43')][_0xafab('0x2f')]);}_0x457d21[_0xafab('0x4c')]=qs[_0xafab('0x4d')](_0x598494[_0xafab('0x43')][_0xafab('0x4d')]);_0x457d21[_0xafab('0x4e')]=qs['filters'](_[_0xafab('0x4f')](_0x598494[_0xafab('0x43')],_0x117ecf[_0xafab('0x45')]),_0x408fbd);if(_0x598494['query']['filter']){_0x457d21[_0xafab('0x4e')]=_[_0xafab('0x50')](_0x457d21[_0xafab('0x4e')],{'$or':_['map'](_0x408fbd,function(_0x28af4e){if(_0x28af4e[_0xafab('0x41')]!==_0xafab('0x51')){var _0x1e8d66={};_0x1e8d66[_0x28af4e['name']]={'$like':'%'+_0x598494[_0xafab('0x43')]['filter']+'%'};return _0x1e8d66;}})});}_0x457d21=_[_0xafab('0x50')]({},_0x457d21,_0x598494[_0xafab('0x52')]);var _0x135b80={'where':_0x457d21[_0xafab('0x4e')]};return db[_0xafab('0x3e')][_0xafab('0x53')](_0x135b80)[_0xafab('0x35')](function(_0x48b6b9){_0x4290d2['count']=_0x48b6b9;if(_0x598494[_0xafab('0x43')]['includeAll']){_0x457d21[_0xafab('0x54')]=[{'all':!![]}];}return db[_0xafab('0x3e')][_0xafab('0x55')](_0x457d21);})[_0xafab('0x35')](function(_0x5d9703){_0x4290d2[_0xafab('0x56')]=_0x5d9703;return _0x4290d2;})[_0xafab('0x35')](respondWithFilteredResult(_0x1547bc,_0x457d21))[_0xafab('0x2b')](handleError(_0x1547bc,null));};exports[_0xafab('0x57')]=function(_0x1fbeed,_0x5fde08){var _0x1d574a={'raw':![],'where':{'id':_0x1fbeed[_0xafab('0x58')]['id']},'include':[{'model':db['Pause'],'as':_0xafab('0x3c')}]},_0x127774={};_0x127774['model']=_[_0xafab('0x44')](db[_0xafab('0x3e')][_0xafab('0x3f')]);_0x127774[_0xafab('0x43')]=_['keys'](_0x1fbeed[_0xafab('0x43')]);_0x127774[_0xafab('0x45')]=_[_0xafab('0x46')](_0x127774[_0xafab('0x42')],_0x127774['query']);_0x1d574a[_0xafab('0x47')]=_['intersection'](_0x127774[_0xafab('0x42')],qs[_0xafab('0x48')](_0x1fbeed[_0xafab('0x43')][_0xafab('0x48')]));_0x1d574a[_0xafab('0x47')]=_0x1d574a['attributes'][_0xafab('0x49')]?_0x1d574a[_0xafab('0x47')]:_0x127774[_0xafab('0x42')];if(_0x1fbeed['query'][_0xafab('0x59')]){_0x1d574a['include']=[{'all':!![]}];}_0x1d574a=_[_0xafab('0x50')]({},_0x1d574a,_0x1fbeed['options']);return db['WhatsappAccount']['find'](_0x1d574a)['then'](handleEntityNotFound(_0x5fde08,null))[_0xafab('0x35')](respondWithResult(_0x5fde08,null))[_0xafab('0x2b')](handleError(_0x5fde08,null));};exports['create']=function(_0x4bc340,_0x4b059d){return db['WhatsappAccount'][_0xafab('0x5a')](_0x4bc340[_0xafab('0x5b')],{})['then'](function(_0x392f47){var _0x12b622=_0x4bc340['user'][_0xafab('0x5c')]({'plain':!![]});if(!_0x12b622)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x12b622[_0xafab('0x5d')]==='user'){var _0x26e8eb=_0x392f47['get']({'plain':!![]});var _0x5ac5a0=_0xafab('0x36');return db[_0xafab('0x5e')][_0xafab('0x5f')]({'where':{'name':_0x5ac5a0,'userProfileId':_0x12b622[_0xafab('0x60')]},'raw':!![]})[_0xafab('0x35')](function(_0x3cd057){if(_0x3cd057&&_0x3cd057[_0xafab('0x61')]===0x0){return db[_0xafab('0x37')][_0xafab('0x5a')]({'name':_0x26e8eb['name'],'resourceId':_0x26e8eb['id'],'type':_0x3cd057[_0xafab('0x38')],'sectionId':_0x3cd057['id']},{})[_0xafab('0x35')](function(){return _0x392f47;});}else{return _0x392f47;}})[_0xafab('0x2b')](function(_0x2a27b7){logger['error'](_0xafab('0x62'),_0x2a27b7);throw _0x2a27b7;});}return _0x392f47;})[_0xafab('0x35')](respondWithResult(_0x4b059d,0xc9))[_0xafab('0x2b')](handleError(_0x4b059d,null));};exports[_0xafab('0x63')]=function(_0x187602,_0x4495c9){if(_0x187602['body']['id']){delete _0x187602[_0xafab('0x5b')]['id'];}return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x187602[_0xafab('0x58')]['id']},'include':[{'model':db[_0xafab('0x3b')],'as':_0xafab('0x3c')}]})[_0xafab('0x35')](handleEntityNotFound(_0x4495c9,null))[_0xafab('0x35')](saveUpdates(_0x187602['body'],null))['then'](respondWithResult(_0x4495c9,null))[_0xafab('0x2b')](handleError(_0x4495c9,null));};exports[_0xafab('0x34')]=function(_0x37a8b9,_0x2fbaa4){return db['WhatsappAccount']['find']({'where':{'id':_0x37a8b9['params']['id']}})[_0xafab('0x35')](handleEntityNotFound(_0x2fbaa4,null))[_0xafab('0x35')](removeEntity(_0x2fbaa4,null))['catch'](handleError(_0x2fbaa4,null));};exports[_0xafab('0x64')]=function(_0x31a81c,_0x2e5c8d){return db['WhatsappAccount']['describe']()[_0xafab('0x35')](respondWithResult(_0x2e5c8d,null))['catch'](handleError(_0x2e5c8d,null));};exports[_0xafab('0x65')]=function(_0x2a5698,_0x347b12,_0x44b709){if(_0x2a5698[_0xafab('0x5b')]['id']){delete _0x2a5698[_0xafab('0x5b')]['id'];}return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x2a5698[_0xafab('0x58')]['id']}})['then'](handleEntityNotFound(_0x347b12,null))[_0xafab('0x35')](function(_0x198e8c){if(_0x198e8c){_0x2a5698[_0xafab('0x5b')]['WhatsappAccountId']=_0x198e8c['id'];return db['Disposition']['create'](_0x2a5698[_0xafab('0x5b')]);}})[_0xafab('0x35')](respondWithResult(_0x347b12,null))[_0xafab('0x2b')](handleError(_0x347b12,null));};exports[_0xafab('0x66')]=function(_0x30609d,_0x4e9ac6,_0x446d29){var _0x395775={'raw':![],'where':{}};var _0x36be8f={};var _0xb18c52={'count':0x0,'rows':[]};return db[_0xafab('0x3e')][_0xafab('0x67')]({'where':{'id':_0x30609d[_0xafab('0x58')]['id']}})['then'](handleEntityNotFound(_0x4e9ac6,null))['then'](function(_0x59d03f){if(_0x59d03f){_0x36be8f['model']=_[_0xafab('0x44')](db['Disposition'][_0xafab('0x3f')]);_0x36be8f[_0xafab('0x43')]=_[_0xafab('0x44')](_0x30609d['query']);_0x36be8f[_0xafab('0x45')]=_['intersection'](_0x36be8f['model'],_0x36be8f[_0xafab('0x43')]);_0x395775[_0xafab('0x47')]=_[_0xafab('0x46')](_0x36be8f['model'],qs[_0xafab('0x48')](_0x30609d[_0xafab('0x43')]['fields']));_0x395775[_0xafab('0x47')]=_0x395775[_0xafab('0x47')][_0xafab('0x49')]?_0x395775[_0xafab('0x47')]:_0x36be8f[_0xafab('0x42')];if(!_0x30609d[_0xafab('0x43')][_0xafab('0x4a')](_0xafab('0x4b'))){_0x395775['limit']=qs[_0xafab('0x30')](_0x30609d[_0xafab('0x43')][_0xafab('0x30')]);_0x395775['offset']=qs[_0xafab('0x2f')](_0x30609d[_0xafab('0x43')][_0xafab('0x2f')]);}_0x395775['order']=qs['sort'](_0x30609d[_0xafab('0x43')][_0xafab('0x4d')]);_0x395775[_0xafab('0x4e')]=qs[_0xafab('0x45')](_[_0xafab('0x4f')](_0x30609d['query'],_0x36be8f[_0xafab('0x45')]));_0x395775[_0xafab('0x4e')][_0xafab('0x68')]=_0x59d03f['id'];if(_0x30609d[_0xafab('0x43')][_0xafab('0x69')]){_0x395775[_0xafab('0x4e')]=_[_0xafab('0x50')](_0x395775[_0xafab('0x4e')],{'$or':_[_0xafab('0x3d')](_0x395775[_0xafab('0x47')],function(_0x238503){var _0x4370c7={};_0x4370c7[_0x238503]={'$like':'%'+_0x30609d[_0xafab('0x43')][_0xafab('0x69')]+'%'};return _0x4370c7;})});}_0x395775=_[_0xafab('0x50')]({},_0x395775,_0x30609d[_0xafab('0x52')]);return db[_0xafab('0x6a')][_0xafab('0x53')]({'where':_0x395775['where']})[_0xafab('0x35')](function(_0x5b5aa9){_0xb18c52['count']=_0x5b5aa9;if(_0x30609d['query'][_0xafab('0x59')]){_0x395775[_0xafab('0x54')]=[{'all':!![]}];}return db[_0xafab('0x6a')][_0xafab('0x55')](_0x395775);})[_0xafab('0x35')](function(_0x4f9904){_0xb18c52[_0xafab('0x56')]=_0x4f9904;return _0xb18c52;});}})[_0xafab('0x35')](respondWithFilteredResult(_0x4e9ac6,_0x395775))[_0xafab('0x2b')](handleError(_0x4e9ac6,null));};exports[_0xafab('0x6b')]=function(_0x471371,_0x3e5e81,_0x1c2dd0){return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x471371['params']['id']}})[_0xafab('0x35')](handleEntityNotFound(_0x3e5e81,null))[_0xafab('0x35')](function(_0xb475ea){if(_0xb475ea){return _0xb475ea[_0xafab('0x6b')](_0x471371['query'][_0xafab('0x6c')]);}})[_0xafab('0x35')](respondWithStatusCode(_0x3e5e81,null))['catch'](handleError(_0x3e5e81,null));};exports[_0xafab('0x6d')]=function(_0x16ab7b,_0x337c73,_0x1271c9){if(_0x16ab7b[_0xafab('0x5b')]['id']){delete _0x16ab7b[_0xafab('0x5b')]['id'];}return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x16ab7b['params']['id']}})['then'](handleEntityNotFound(_0x337c73,null))[_0xafab('0x35')](function(_0x21ee0b){if(_0x21ee0b){_0x16ab7b['body'][_0xafab('0x68')]=_0x21ee0b['id'];return db[_0xafab('0x6e')][_0xafab('0x5a')](_0x16ab7b[_0xafab('0x5b')]);}})['then'](respondWithResult(_0x337c73,null))[_0xafab('0x2b')](handleError(_0x337c73,null));};exports[_0xafab('0x6f')]=function(_0x146a16,_0xaa25a3,_0x20183a){var _0x5c06e6={'raw':![],'where':{}};var _0x1f0d74={};var _0x428abe={'count':0x0,'rows':[]};return db[_0xafab('0x3e')][_0xafab('0x67')]({'where':{'id':_0x146a16['params']['id']}})[_0xafab('0x35')](handleEntityNotFound(_0xaa25a3,null))[_0xafab('0x35')](function(_0x4e16ce){if(_0x4e16ce){_0x1f0d74['model']=_[_0xafab('0x44')](db['CannedAnswer'][_0xafab('0x3f')]);_0x1f0d74['query']=_[_0xafab('0x44')](_0x146a16[_0xafab('0x43')]);_0x1f0d74[_0xafab('0x45')]=_[_0xafab('0x46')](_0x1f0d74[_0xafab('0x42')],_0x1f0d74[_0xafab('0x43')]);_0x5c06e6[_0xafab('0x47')]=_[_0xafab('0x46')](_0x1f0d74['model'],qs[_0xafab('0x48')](_0x146a16[_0xafab('0x43')][_0xafab('0x48')]));_0x5c06e6[_0xafab('0x47')]=_0x5c06e6['attributes'][_0xafab('0x49')]?_0x5c06e6[_0xafab('0x47')]:_0x1f0d74[_0xafab('0x42')];if(!_0x146a16[_0xafab('0x43')]['hasOwnProperty']('nolimit')){_0x5c06e6[_0xafab('0x30')]=qs[_0xafab('0x30')](_0x146a16['query'][_0xafab('0x30')]);_0x5c06e6[_0xafab('0x2f')]=qs[_0xafab('0x2f')](_0x146a16['query']['offset']);}_0x5c06e6['order']=qs[_0xafab('0x4d')](_0x146a16[_0xafab('0x43')][_0xafab('0x4d')]);_0x5c06e6[_0xafab('0x4e')]=qs[_0xafab('0x45')](_[_0xafab('0x4f')](_0x146a16[_0xafab('0x43')],_0x1f0d74[_0xafab('0x45')]));_0x5c06e6['where'][_0xafab('0x68')]=_0x4e16ce['id'];if(_0x146a16[_0xafab('0x43')][_0xafab('0x69')]){_0x5c06e6[_0xafab('0x4e')]=_[_0xafab('0x50')](_0x5c06e6['where'],{'$or':_[_0xafab('0x3d')](_0x5c06e6[_0xafab('0x47')],function(_0x2a567f){var _0x14a05a={};_0x14a05a[_0x2a567f]={'$like':'%'+_0x146a16[_0xafab('0x43')][_0xafab('0x69')]+'%'};return _0x14a05a;})});}_0x5c06e6=_[_0xafab('0x50')]({},_0x5c06e6,_0x146a16[_0xafab('0x52')]);return db[_0xafab('0x6e')]['count']({'where':_0x5c06e6[_0xafab('0x4e')]})[_0xafab('0x35')](function(_0x200275){_0x428abe[_0xafab('0x53')]=_0x200275;if(_0x146a16[_0xafab('0x43')][_0xafab('0x59')]){_0x5c06e6[_0xafab('0x54')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x5c06e6);})['then'](function(_0x563994){_0x428abe[_0xafab('0x56')]=_0x563994;return _0x428abe;});}})['then'](respondWithFilteredResult(_0xaa25a3,_0x5c06e6))[_0xafab('0x2b')](handleError(_0xaa25a3,null));};exports[_0xafab('0x70')]=function(_0x1740d9,_0x179af0,_0x2026cc){return db[_0xafab('0x3e')]['find']({'where':{'id':_0x1740d9['params']['id']}})[_0xafab('0x35')](handleEntityNotFound(_0x179af0,null))[_0xafab('0x35')](function(_0x1204ed){if(_0x1204ed){return _0x1204ed['removeAnswers'](_0x1740d9[_0xafab('0x43')][_0xafab('0x6c')]);}})[_0xafab('0x35')](respondWithStatusCode(_0x179af0,null))[_0xafab('0x2b')](handleError(_0x179af0,null));};exports['addAgents']=function(_0x5cef8e,_0x1e94df,_0x113ca8){return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x5cef8e[_0xafab('0x58')]['id']}})['then'](handleEntityNotFound(_0x1e94df,null))['then'](function(_0x1d683d){if(_0x1d683d){return _0x1d683d[_0xafab('0x71')](_0x5cef8e[_0xafab('0x5b')][_0xafab('0x6c')],_[_0xafab('0x72')](_0x5cef8e[_0xafab('0x5b')],[_0xafab('0x6c'),'id'])||{})[_0xafab('0x73')](function(_0x4620a0){for(var _0x302235=0x0;_0x302235<_0x5cef8e['body']['ids'][_0xafab('0x49')];_0x302235+=0x1){socket[_0xafab('0x74')](_0xafab('0x75'),{'UserId':Number(_0x5cef8e['body']['ids'][_0x302235]),'WhatsappAccountId':Number(_0x5cef8e[_0xafab('0x58')]['id'])});}return _0x4620a0;});}})[_0xafab('0x35')](respondWithResult(_0x1e94df,null))[_0xafab('0x2b')](handleError(_0x1e94df,null));};exports[_0xafab('0x76')]=function(_0x5bf546,_0x1c1053,_0x30a2a8){return db['WhatsappAccount'][_0xafab('0x5f')]({'where':{'id':_0x5bf546[_0xafab('0x58')]['id']}})[_0xafab('0x35')](handleEntityNotFound(_0x1c1053,null))['then'](function(_0x5c3a50){if(_0x5c3a50){return _0x5c3a50['removeAgents'](_0x5bf546[_0xafab('0x43')][_0xafab('0x6c')])['then'](function(){if(_[_0xafab('0x77')](_0x5bf546[_0xafab('0x43')][_0xafab('0x6c')])){for(var _0x52a4d3=0x0;_0x52a4d3<_0x5bf546['query'][_0xafab('0x6c')][_0xafab('0x49')];_0x52a4d3+=0x1){socket[_0xafab('0x74')](_0xafab('0x78'),{'UserId':Number(_0x5bf546[_0xafab('0x43')][_0xafab('0x6c')][_0x52a4d3]),'WhatsappAccountId':Number(_0x5bf546[_0xafab('0x58')]['id'])});}}else{socket[_0xafab('0x74')](_0xafab('0x78'),{'UserId':Number(_0x5bf546[_0xafab('0x43')]['ids']),'WhatsappAccountId':Number(_0x5bf546[_0xafab('0x58')]['id'])});}});}})[_0xafab('0x35')](respondWithStatusCode(_0x1c1053,null))[_0xafab('0x2b')](handleError(_0x1c1053,null));};exports[_0xafab('0x79')]=function(_0x1adc0c,_0x51eb38,_0x196283){var _0x174502={};var _0x4d4b2c={};var _0x16a381;var _0x1e107d;return db['WhatsappAccount'][_0xafab('0x67')]({'where':{'id':_0x1adc0c[_0xafab('0x58')]['id']}})['then'](handleEntityNotFound(_0x51eb38,null))[_0xafab('0x35')](function(_0x11304d){if(_0x11304d){_0x16a381=_0x11304d;_0x4d4b2c[_0xafab('0x42')]=_[_0xafab('0x44')](db['User'][_0xafab('0x3f')]);_0x4d4b2c[_0xafab('0x43')]=_[_0xafab('0x44')](_0x1adc0c['query']);_0x4d4b2c[_0xafab('0x45')]=_[_0xafab('0x46')](_0x4d4b2c[_0xafab('0x42')],_0x4d4b2c[_0xafab('0x43')]);_0x174502[_0xafab('0x47')]=_[_0xafab('0x46')](_0x4d4b2c['model'],qs[_0xafab('0x48')](_0x1adc0c[_0xafab('0x43')][_0xafab('0x48')]));_0x174502[_0xafab('0x47')]=_0x174502[_0xafab('0x47')][_0xafab('0x49')]?_0x174502[_0xafab('0x47')]:_0x4d4b2c[_0xafab('0x42')];_0x174502[_0xafab('0x4c')]=qs[_0xafab('0x4d')](_0x1adc0c[_0xafab('0x43')][_0xafab('0x4d')]);_0x174502[_0xafab('0x4e')]=qs['filters'](_['pick'](_0x1adc0c[_0xafab('0x43')],_0x4d4b2c[_0xafab('0x45')]));if(_0x1adc0c[_0xafab('0x43')][_0xafab('0x69')]){_0x174502[_0xafab('0x4e')]=_['merge'](_0x174502[_0xafab('0x4e')],{'$or':_[_0xafab('0x3d')](_0x174502['attributes'],function(_0x44b83b){var _0x2eec63={};_0x2eec63[_0x44b83b]={'$like':'%'+_0x1adc0c[_0xafab('0x43')]['filter']+'%'};return _0x2eec63;})});}_0x174502=_[_0xafab('0x50')]({},_0x174502,_0x1adc0c[_0xafab('0x52')]);return _0x16a381[_0xafab('0x79')](_0x174502);}})['then'](function(_0x451e73){if(_0x451e73){_0x1e107d=_0x451e73['length'];if(!_0x1adc0c['query'][_0xafab('0x4a')](_0xafab('0x4b'))){_0x174502[_0xafab('0x30')]=qs['limit'](_0x1adc0c[_0xafab('0x43')][_0xafab('0x30')]);_0x174502[_0xafab('0x2f')]=qs[_0xafab('0x2f')](_0x1adc0c[_0xafab('0x43')][_0xafab('0x2f')]);}return _0x16a381[_0xafab('0x79')](_0x174502);}})[_0xafab('0x35')](function(_0x166a5d){if(_0x166a5d){return _0x166a5d?{'count':_0x1e107d,'rows':_0x166a5d}:null;}})[_0xafab('0x35')](respondWithResult(_0x51eb38,null))[_0xafab('0x2b')](handleError(_0x51eb38,null));};exports['addApplications']=function(_0x13fcd4,_0x3ee33a){var _0x19645f=_0x13fcd4[_0xafab('0x58')]['id'];var _0x37b364=_0x13fcd4[_0xafab('0x5b')];var _0x5e048e=0xc8;var _0x328eb5=null;return db[_0xafab('0x7a')]['transaction']({'isolationLevel':db['sequelize'][_0xafab('0x7b')][_0xafab('0x7c')][_0xafab('0x7d')]},function(_0xdad62f){return db[_0xafab('0x3e')][_0xafab('0x67')]({'where':{'id':_0x19645f},'transaction':_0xdad62f})[_0xafab('0x35')](function(_0x26e716){if(_0x26e716){return db[_0xafab('0x7e')][_0xafab('0x34')]({'where':{'WhatsappAccountId':_0x19645f},'transaction':_0xdad62f})[_0xafab('0x35')](function(){var _0x207a83=_[_0xafab('0x3d')](_0x37b364,function(_0x1ca86c){_0x1ca86c[_0xafab('0x68')]=_0x19645f;return _0x1ca86c;});return db[_0xafab('0x7e')]['bulkCreate'](_0x207a83,{'transaction':_0xdad62f});});}else{_0x5e048e=0x194;_0x328eb5=[];}});})[_0xafab('0x35')](function(){if(_0x5e048e!==0x194){return db['WhatsappApplication']['findAndCountAll']({'where':{'WhatsappAccountId':_0x19645f},'order':_0xafab('0x7f')})[_0xafab('0x35')](function(_0x452086){_0x328eb5=_0x452086;});}})['catch'](function(_0x49eef0){_0x5e048e=0x1f4;logger[_0xafab('0x28')](_0x49eef0[_0xafab('0x80')]);if(_0x49eef0[_0xafab('0x38')]){delete _0x49eef0[_0xafab('0x38')];}_0x328eb5=_0x49eef0;})[_0xafab('0x81')](function(){if(_0x328eb5===null){_0x3ee33a[_0xafab('0x2c')](_0x5e048e);}else{if(_0x5e048e===0x1f4){_0x3ee33a[_0xafab('0x2d')](_0x5e048e)['send'](_0x328eb5);}else{_0x3ee33a[_0xafab('0x2d')](_0x5e048e)[_0xafab('0x32')](_0x328eb5);}}});};exports[_0xafab('0x82')]=function(_0x102c71,_0x557887,_0xef7c3d){var _0x3e94cc={};var _0x3e223d={};var _0x42b793;var _0x5a677b;return db[_0xafab('0x3e')]['findOne']({'where':{'id':_0x102c71['params']['id']}})[_0xafab('0x35')](handleEntityNotFound(_0x557887,null))['then'](function(_0x49c99b){if(_0x49c99b){_0x42b793=_0x49c99b;_0x3e223d[_0xafab('0x42')]=_[_0xafab('0x44')](db[_0xafab('0x7e')]['rawAttributes']);_0x3e223d[_0xafab('0x43')]=_[_0xafab('0x44')](_0x102c71[_0xafab('0x43')]);_0x3e223d[_0xafab('0x45')]=_[_0xafab('0x46')](_0x3e223d[_0xafab('0x42')],_0x3e223d[_0xafab('0x43')]);_0x3e94cc[_0xafab('0x47')]=_['intersection'](_0x3e223d[_0xafab('0x42')],qs['fields'](_0x102c71[_0xafab('0x43')][_0xafab('0x48')]));_0x3e94cc['attributes']=_0x3e94cc['attributes']['length']?_0x3e94cc[_0xafab('0x47')]:_0x3e223d[_0xafab('0x42')];_0x3e94cc['order']=qs[_0xafab('0x4d')](_0x102c71[_0xafab('0x43')][_0xafab('0x4d')]);_0x3e94cc['where']=qs[_0xafab('0x45')](_[_0xafab('0x4f')](_0x102c71[_0xafab('0x43')],_0x3e223d['filters']));if(_0x102c71[_0xafab('0x43')][_0xafab('0x69')]){_0x3e94cc[_0xafab('0x4e')]=_[_0xafab('0x50')](_0x3e94cc[_0xafab('0x4e')],{'$or':_[_0xafab('0x3d')](_0x3e94cc[_0xafab('0x47')],function(_0x4148bb){var _0x2be9c3={};_0x2be9c3[_0x4148bb]={'$like':'%'+_0x102c71[_0xafab('0x43')]['filter']+'%'};return _0x2be9c3;})});}_0x3e94cc=_[_0xafab('0x50')]({},_0x3e94cc,_0x102c71[_0xafab('0x52')]);return _0x42b793[_0xafab('0x82')](_0x3e94cc);}})[_0xafab('0x35')](function(_0x315dc4){if(_0x315dc4){_0x5a677b=_0x315dc4[_0xafab('0x49')];if(!_0x102c71[_0xafab('0x43')][_0xafab('0x4a')](_0xafab('0x4b'))){_0x3e94cc['limit']=qs['limit'](_0x102c71[_0xafab('0x43')][_0xafab('0x30')]);_0x3e94cc[_0xafab('0x2f')]=qs[_0xafab('0x2f')](_0x102c71[_0xafab('0x43')][_0xafab('0x2f')]);}return _0x42b793['getApplications'](_0x3e94cc);}})[_0xafab('0x35')](function(_0xa88eeb){if(_0xa88eeb){return _0xa88eeb?{'count':_0x5a677b,'rows':_0xa88eeb}:null;}})[_0xafab('0x35')](respondWithResult(_0x557887,null))[_0xafab('0x2b')](handleError(_0x557887,null));};exports[_0xafab('0x83')]=function(_0x135025,_0x192019,_0x52b43b){var _0x51c587={'channel':_0xafab('0x84')};var _0x3c2bd8=[];var _0x1fbd41=[];var _0x359833={};return db['WhatsappAccount'][_0xafab('0x5f')]({'where':{'id':_0x135025[_0xafab('0x58')]['id']},'include':[{'model':db[_0xafab('0x7e')],'as':_0xafab('0x85')}]})['then'](handleEntityNotFound(_0x192019,null))[_0xafab('0x35')](function(_0x26e445){_0x51c587[_0xafab('0x86')]=_0x26e445;if(_0x51c587[_0xafab('0x86')]&&_0x51c587[_0xafab('0x86')][_0xafab('0x41')]===_0xafab('0x87')&&_0x135025['body'][_0xafab('0x88')]){if(_0x135025['body'][_0xafab('0x88')][_0xafab('0x49')]===0x0)return;if(_0x135025[_0xafab('0x5b')][_0xafab('0x88')][0x0]['state']!==_0xafab('0x89'))return;return db[_0xafab('0x8a')][_0xafab('0x63')]({'read':!![],'readAt':_0x135025['body']['statuses'][0x0][_0xafab('0x8b')]},{'where':{'messageId':_0x135025[_0xafab('0x5b')][_0xafab('0x88')][0x0][_0xafab('0x8c')]},'individualHooks':!![]})[_0xafab('0x35')](function(_0x1de969){return _0x192019['status'](0xc8)[_0xafab('0x32')](_0x1de969);});}_0x51c587[_0xafab('0x8d')]=_[_0xafab('0x8e')](_0x26e445[_0xafab('0x85')],[_0xafab('0x7f')],[_0xafab('0x8f')]);if(_0x51c587[_0xafab('0x86')][_0xafab('0x85')]){delete _0x51c587[_0xafab('0x86')][_0xafab('0x85')];}return db[_0xafab('0x90')][_0xafab('0x64')]()[_0xafab('0x35')](function(_0x53d298){if(!_0x53d298){throw new db[(_0xafab('0x91'))][(_0xafab('0x92'))](_0xafab('0x93'));}_0x3c2bd8=_['difference'](_[_0xafab('0x44')](_0x53d298),[_0xafab('0x94'),_0xafab('0x95')]);_0x1fbd41=_[_0xafab('0x96')](_['keys'](_0x53d298),[_0xafab('0x94'),_0xafab('0x95'),_0xafab('0x97'),_0xafab('0x98')]);_0x51c587[_0xafab('0x5b')]={'mapKey':_0xafab('0x99')};if(_0x51c587[_0xafab('0x86')]&&_0x51c587[_0xafab('0x86')][_0xafab('0x41')]===_0xafab('0x9a')){_0x51c587[_0xafab('0x5b')]['from']=_0x135025['body'][_0xafab('0x9b')]['replace'](_0xafab('0x9c'),'');_0x51c587['body']['body']=_0x135025['body']['Body'];_0x51c587[_0xafab('0x5b')][_0xafab('0x9d')]=_0x135025[_0xafab('0x5b')][_0xafab('0x9e')];}if(_0x51c587[_0xafab('0x86')]&&_0x51c587[_0xafab('0x86')][_0xafab('0x41')]==='sinch'){_0x51c587[_0xafab('0x5b')][_0xafab('0x9f')]=_0x135025[_0xafab('0x5b')][_0xafab('0xa0')][0x0]['from'];_0x51c587['body']['body']=_0x135025[_0xafab('0x5b')][_0xafab('0xa0')][0x0][_0xafab('0x29')][_0xafab('0x5b')];_0x51c587[_0xafab('0x5b')][_0xafab('0x9d')]=_0x135025[_0xafab('0x5b')][_0xafab('0xa0')][0x0]['message_id'];}if(_0x51c587[_0xafab('0x5b')]['id']){delete _0x51c587['body']['id'];}if(_[_0xafab('0xa1')](_0x51c587['body'][_0xafab('0x9f')])){throw new db['Sequelize'][(_0xafab('0x92'))](_0xafab('0xa2'));}if(_[_0xafab('0xa1')](_0x51c587['body']['body'])||_0x51c587[_0xafab('0x5b')][_0xafab('0x5b')]===''){throw new db[(_0xafab('0x91'))][(_0xafab('0x92'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xafab('0xa1')](_0x51c587[_0xafab('0x5b')][_0xafab('0xa3')])){throw new db['Sequelize'][(_0xafab('0x92'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1fbd41);}if(!_['includes'](_0x1fbd41,_0x51c587[_0xafab('0x5b')][_0xafab('0xa3')])){throw new db[(_0xafab('0x91'))][(_0xafab('0x92'))](_0xafab('0xa4')+_0x1fbd41);}_0x359833[_0x51c587[_0xafab('0x5b')][_0xafab('0xa3')]]=_0x51c587[_0xafab('0x5b')][_0xafab('0x9f')];return db[_0xafab('0xa5')][_0xafab('0x5f')]({'where':{'id':_0x51c587[_0xafab('0x86')][_0xafab('0x98')]},'include':[{'model':db[_0xafab('0x90')],'as':_0xafab('0xa6'),'where':_0x359833,'limit':0x1,'order':[['updatedAt',_0xafab('0xa7')]]}]});})['then'](handleEntityNotFound(_0x192019,null))[_0xafab('0x35')](function(_0x4a86e7){if(_0x4a86e7){_0x51c587['list']=_[_0xafab('0x72')](_0x4a86e7,[_0xafab('0xa6')]);if(_0x4a86e7['Contacts'][_0xafab('0x49')]){return _0x4a86e7['Contacts'][0x0];}var _0x2e073e=_[_0xafab('0x1b')](_0x51c587[_0xafab('0x5b')],{'firstName':_0x51c587[_0xafab('0x5b')]['from'],'ListId':_0x4a86e7['id']});_0x2e073e[_0x51c587['body'][_0xafab('0xa3')]]=_0x51c587[_0xafab('0x5b')][_0xafab('0x9f')];return db[_0xafab('0x90')]['create'](_0x2e073e,{'fields':_0x3c2bd8,'raw':!![]});}})['then'](handleEntityNotFound(_0x192019,null))['then'](function(_0x3e99ed){if(_0x3e99ed){_0x51c587['contact']=_0x3e99ed;var _0x2fac5c={'ContactId':_0x3e99ed['id'],'phone':_0x51c587[_0xafab('0x5b')][_0xafab('0x9f')],'WhatsappAccountId':_0x135025[_0xafab('0x58')]['id']};var _0x40857c={'ContactId':_0x3e99ed['id'],'WhatsappAccountId':_0x135025[_0xafab('0x58')]['id'],'closed':![]};return db[_0xafab('0xa8')][_0xafab('0x5f')]({'where':_0x40857c})[_0xafab('0x35')](function(_0x18f64d){if(_0x18f64d){return[_0x18f64d,![]];}return db[_0xafab('0xa8')][_0xafab('0x5a')](_0x2fac5c)[_0xafab('0x35')](function(_0x31329a){return[_0x31329a,!![]];});});}})['spread'](function(_0xa1c211,_0x35148c){_0x51c587[_0xafab('0xa9')]=_0xa1c211['get']({'plain':!![]});_0x51c587[_0xafab('0xa9')]['created']=![];if(_0x35148c){if(_0x51c587['account'][_0xafab('0xaa')]){_0x51c587['applications'][_0xafab('0xab')]({'id':0x0,'priority':_0x51c587[_0xafab('0x8d')]['length']+0x1,'app':_0xafab('0xac'),'appdata':'unmanaged','interval':'*,*,*,*'});}_0x51c587['interaction']['created']=!![];}return db[_0xafab('0x8a')]['create']({'phone':_0x51c587[_0xafab('0x5b')]['from'],'messageId':_0x51c587['body'][_0xafab('0x9d')],'body':_0x51c587[_0xafab('0x5b')][_0xafab('0x5b')],'WhatsappAccountId':_0x135025[_0xafab('0x58')]['id'],'WhatsappInteractionId':_0xa1c211['id'],'direction':'in','ContactId':_0xa1c211[_0xafab('0xad')],'AttachmentId':_0x51c587[_0xafab('0x5b')]['AttachmentId']});})[_0xafab('0x35')](function(_0x42c48e){_0x51c587['message']=_0x42c48e;if(_0x51c587[_0xafab('0xa9')][_0xafab('0xae')]){return db[_0xafab('0xaf')][_0xafab('0x5f')]({'attributes':['id','name'],'where':{'id':_0x51c587['interaction'][_0xafab('0xae')]}})[_0xafab('0x35')](function(_0x55c734){if(_0x55c734){_0x51c587[_0xafab('0x8d')]['unshift']({'id':0x0,'priority':0x0,'app':_0xafab('0xb0'),'appdata':_0x55c734[_0xafab('0x38')]+','+(_0x51c587['account'][_0xafab('0xb1')]||0xa),'interval':_0xafab('0xb2')});}return respondWithRpcPromise(_0xafab('0xb3'),'startRouting',_0x51c587);});}return respondWithRpcPromise(_0xafab('0xb3'),_0xafab('0xb4'),_0x51c587);})[_0xafab('0x35')](function(_0x5b4ac){if(_0x5b4ac){var _0x28f950=0xc8;var _0x2da6e3=_0xafab('0xb5');logger[_0xafab('0x22')](_0xafab('0xb6'),_0x2da6e3,_0x28f950,_0xafab('0xb7'));logger[_0xafab('0x25')](_0xafab('0xb8'),_0x2da6e3,_0x28f950,_0xafab('0xb7'),JSON['stringify'](_0x5b4ac));if(_0x51c587[_0xafab('0x86')][_0xafab('0x41')]===_0xafab('0x9a')){return _0x192019['status'](_0x28f950)[_0xafab('0xb9')](_0xafab('0xba'),_0xafab('0xbb'))[_0xafab('0x39')](_0xafab('0xbc'));}else{return _0x192019[_0xafab('0x2d')](_0x28f950)[_0xafab('0x32')](_0x5b4ac);}}});})[_0xafab('0x2b')](handleError(_0x192019,null));};exports[_0xafab('0x39')]=function(_0x5c15e3,_0x1792f4,_0x347dab){var _0x21876f,_0x5656d0,_0xe6d3ef;if(_[_0xafab('0xa1')](_0x5c15e3[_0xafab('0x5b')][_0xafab('0x5b')])||_0x5c15e3[_0xafab('0x5b')][_0xafab('0x5b')]===''){throw new db[(_0xafab('0x91'))][(_0xafab('0x92'))](_0xafab('0xbd'));}if(_[_0xafab('0xa1')](_0x5c15e3['body']['to'])){throw new db[(_0xafab('0x91'))][(_0xafab('0x92'))]('to\x20is\x20mandatory');}_0x21876f=_0x5c15e3[_0xafab('0x5b')]['to'];return db[_0xafab('0x3e')][_0xafab('0x5f')]({'where':{'id':_0x5c15e3[_0xafab('0x58')]['id']},'include':[{'model':db[_0xafab('0xa5')],'as':'List','include':[{'model':db[_0xafab('0x90')],'as':_0xafab('0xa6'),'where':{'mobile':_0x21876f},'limit':0x1,'order':[[_0xafab('0x95'),_0xafab('0xa7')]]}]}]})[_0xafab('0x35')](handleEntityNotFound(_0x1792f4,null))[_0xafab('0x35')](function(_0x7b0c69){if(_0x7b0c69&&_0x7b0c69[_0xafab('0xbe')]){_0x5656d0=_0x7b0c69[_0xafab('0x5c')]({'plain':!![]});if(_0x5656d0['List']&&_0x5656d0[_0xafab('0xbe')][_0xafab('0xa6')][_0xafab('0x49')]){return _0x5656d0['List'][_0xafab('0xa6')][0x0];}return db[_0xafab('0x90')][_0xafab('0x5a')](_['defaults'](_0x5c15e3[_0xafab('0x5b')],{'firstName':_0x21876f,'mobile':_0x21876f,'phone':_0x21876f,'ListId':_0x5656d0[_0xafab('0x98')]}));}})[_0xafab('0x35')](handleEntityNotFound(_0x1792f4,null))[_0xafab('0x35')](function(_0x571228){if(_0x571228){_0xe6d3ef=_0x571228;return db[_0xafab('0xa8')][_0xafab('0x5f')]({'where':{'ContactId':_0xe6d3ef['id'],'closed':![],'WhatsappAccountId':_0x5656d0['id']}})[_0xafab('0x35')](function(_0x1e38ad){if(_0x1e38ad){return[_0x1e38ad,![]];}return db[_0xafab('0xa8')][_0xafab('0x5a')]({'UserId':_0x5c15e3[_0xafab('0xbf')]['id'],'ContactId':_0xe6d3ef['id'],'WhatsappAccountId':_0x5656d0['id'],'phone':_0x21876f,'firstMsgDirection':_0xafab('0xc0'),'Messages':[_[_0xafab('0x50')](_0x5c15e3[_0xafab('0x5b')],{'read':![],'body':_0x5c15e3[_0xafab('0x5b')]['body'],'phone':_0x21876f,'WhatsappAccountId':_0x5656d0['id'],'UserId':_0x5c15e3[_0xafab('0xbf')]['id'],'ContactId':_0xe6d3ef['id']})]},{'include':[{'model':db[_0xafab('0x8a')],'as':'Messages'}]})[_0xafab('0x35')](function(_0x4075ec){return[_0x4075ec,!![]];});});}})[_0xafab('0x73')](function(_0x544d40,_0x34af6a){if(_0x34af6a){return _0x544d40;}return db[_0xafab('0x8a')]['create'](_[_0xafab('0x50')](_0x5c15e3['body'],{'read':![],'body':_0x5c15e3[_0xafab('0x5b')]['body'],'phone':_0x21876f,'WhatsappAccountId':_0x5656d0['id'],'WhatsappInteractionId':_0x544d40['id'],'UserId':_0x5c15e3[_0xafab('0xbf')]['id'],'ContactId':_0xe6d3ef['id']}))[_0xafab('0x35')](function(_0x18dccc){_0x544d40[_0xafab('0xc1')][_0xafab('0xc2')]=[];_0x544d40[_0xafab('0xc1')][_0xafab('0xc2')][_0xafab('0xab')](_0x18dccc[_0xafab('0xc1')]);return _0x544d40;});})['then'](respondWithResult(_0x1792f4,null))[_0xafab('0x2b')](handleError(_0x1792f4,null));}; \ No newline at end of file +var _0x585c=['getApplications','notify','whatsapp','Applications','account','sinch','statuses','state','read','timestamp','message_id','applications','orderBy','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','CompanyId','ListId','twilio','replace','whatsapp:','Body','MessageSid','notifications','messageId','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','DESC','list','contact','WhatsappInteraction','spread','interaction','push','close','unmanaged','*,*,*,*','created','WhatsappMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','body\x20is\x20mandatory\x20and\x20not\x20empty','to\x20is\x20mandatory','List','out','Messages','dataValues','zip-dir','fast-json-patch','path','sox','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappAccount.socket','register','http','request','then','WhatsappAccount,\x20%s,\x20%s','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','update','destroy','get','WhatsappAccounts','UserProfileResource','sendStatus','stack','name','index','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','sort','where','VIRTUAL','options','includeAll','findAll','show','params','fields','include','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','WhatsappAccountId','Disposition','getDispositions','findOne','keys','nolimit','order','filter','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','pick','removeAnswers','addAgents','omit','emit','userWhatsappAccount:save','removeAgents','userWhatsappAccount:remove','getAgents','addApplications','sequelize','transaction','Transaction','ISOLATION_LEVELS','READ_COMMITTED','WhatsappApplication','bulkCreate','findAndCountAll','priority','finally','send'];(function(_0x45614e,_0x1efc42){var _0x3c486a=function(_0x42e719){while(--_0x42e719){_0x45614e['push'](_0x45614e['shift']());}};_0x3c486a(++_0x1efc42);}(_0x585c,0x1c8));var _0xc585=function(_0x2eabcc,_0x529213){_0x2eabcc=_0x2eabcc-0x0;var _0x5d5363=_0x585c[_0x2eabcc];return _0x5d5363;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc585('0x0'));var jsonpatch=require(_0xc585('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc585('0x2'));var sox=require(_0xc585('0x3'));var csv=require(_0xc585('0x4'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc585('0x5'));var _=require(_0xc585('0x6'));var squel=require('squel');var crypto=require(_0xc585('0x7'));var jsforce=require('jsforce');var deskjs=require(_0xc585('0x8'));var toCsv=require('to-csv');var querystring=require(_0xc585('0x9'));var Papa=require(_0xc585('0xa'));var Redis=require(_0xc585('0xb'));var authService=require(_0xc585('0xc'));var qs=require(_0xc585('0xd'));var as=require(_0xc585('0xe'));var hardwareService=require(_0xc585('0xf'));var logger=require(_0xc585('0x10'))(_0xc585('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc585('0x12'));var db=require(_0xc585('0x13'))['db'];config[_0xc585('0x14')]=_[_0xc585('0x15')](config[_0xc585('0x14')],{'host':_0xc585('0x16'),'port':0x18eb});var socket=require(_0xc585('0x17'))(new Redis(config[_0xc585('0x14')]));require(_0xc585('0x18'))[_0xc585('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xc585('0x1a')]({'port':0x232c});function respondWithRpcPromise(_0x2bcbff,_0x1034bb,_0x106333,_0x44c487){return new BPromise(function(_0x9e9d5a,_0x1023c5){var _0x2fad3f=_0x44c487||client;return _0x2fad3f[_0xc585('0x1b')](_0x2bcbff,_0x106333)[_0xc585('0x1c')](function(_0x5ea993){logger['info'](_0xc585('0x1d'),_0x1034bb,'request\x20sent');logger[_0xc585('0x1e')](_0xc585('0x1f'),_0x1034bb,_0xc585('0x20'),JSON[_0xc585('0x21')](_0x5ea993));if(_0x5ea993[_0xc585('0x22')]){if(_0x5ea993['error'][_0xc585('0x23')]===0x1f4){logger[_0xc585('0x22')](_0xc585('0x1d'),_0x1034bb,_0x5ea993[_0xc585('0x22')][_0xc585('0x24')]);return _0x1023c5(_0x5ea993[_0xc585('0x22')][_0xc585('0x24')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x1034bb,_0x5ea993['error'][_0xc585('0x24')]);return _0x9e9d5a(_0x5ea993[_0xc585('0x22')][_0xc585('0x24')]);}else{logger[_0xc585('0x25')]('WhatsappAccount,\x20%s,\x20%s',_0x1034bb,'request\x20sent');_0x9e9d5a(_0x5ea993[_0xc585('0x26')][_0xc585('0x24')]);}})[_0xc585('0x27')](function(_0x13f238){logger['error'](_0xc585('0x1d'),_0x1034bb,_0x13f238);_0x1023c5(_0x13f238);});});}function respondWithStatusCode(_0x44456e,_0x270c28){_0x270c28=_0x270c28||0xcc;return function(_0x195953){if(_0x195953){return _0x44456e['sendStatus'](_0x270c28);}return _0x44456e[_0xc585('0x28')](_0x270c28)[_0xc585('0x29')]();};}function respondWithResult(_0x2e76c5,_0x3476d5){_0x3476d5=_0x3476d5||0xc8;return function(_0x349711){if(_0x349711){return _0x2e76c5['status'](_0x3476d5)[_0xc585('0x2a')](_0x349711);}};}function respondWithFilteredResult(_0x4d6fbc,_0x25b646){return function(_0x52ba47){if(_0x52ba47){var _0x22bb60=typeof _0x25b646['offset']==='undefined'&&typeof _0x25b646[_0xc585('0x2b')]===_0xc585('0x2c');var _0x30e7b5=_0x52ba47[_0xc585('0x2d')];var _0x55ced4=_0x22bb60?0x0:_0x25b646[_0xc585('0x2e')];var _0x674eb1=_0x22bb60?_0x52ba47['count']:_0x25b646['offset']+_0x25b646['limit'];var _0x4d9e0b;if(_0x674eb1>=_0x30e7b5){_0x674eb1=_0x30e7b5;_0x4d9e0b=0xc8;}else{_0x4d9e0b=0xce;}_0x4d6fbc[_0xc585('0x28')](_0x4d9e0b);return _0x4d6fbc[_0xc585('0x2f')](_0xc585('0x30'),_0x55ced4+'-'+_0x674eb1+'/'+_0x30e7b5)['json'](_0x52ba47);}return null;};}function patchUpdates(_0x571711){return function(_0x43ddb5){try{jsonpatch[_0xc585('0x31')](_0x43ddb5,_0x571711,!![]);}catch(_0x17fd6f){return BPromise['reject'](_0x17fd6f);}return _0x43ddb5['save']();};}function saveUpdates(_0x1363b9,_0x2f02a4){return function(_0x25a3ff){if(_0x25a3ff){return _0x25a3ff[_0xc585('0x32')](_0x1363b9)['then'](function(_0x2ad7d6){return _0x2ad7d6;});}return null;};}function removeEntity(_0x1f7eab,_0x41f8f6){return function(_0x1cea34){if(_0x1cea34){return _0x1cea34[_0xc585('0x33')]()[_0xc585('0x1c')](function(){var _0x4bb4c9=_0x1cea34[_0xc585('0x34')]({'plain':!![]});var _0x117340=_0xc585('0x35');return db[_0xc585('0x36')][_0xc585('0x33')]({'where':{'type':_0x117340,'resourceId':_0x4bb4c9['id']}})[_0xc585('0x1c')](function(){return _0x1cea34;});})[_0xc585('0x1c')](function(){_0x1f7eab[_0xc585('0x28')](0xcc)[_0xc585('0x29')]();});}};}function handleEntityNotFound(_0x5f2abc,_0x51e6f9){return function(_0xcd5ae6){if(!_0xcd5ae6){_0x5f2abc[_0xc585('0x37')](0x194);}return _0xcd5ae6;};}function handleError(_0x44a36d,_0x593d4d){_0x593d4d=_0x593d4d||0x1f4;return function(_0xe63293){logger[_0xc585('0x22')](_0xe63293[_0xc585('0x38')]);if(_0xe63293[_0xc585('0x39')]){delete _0xe63293[_0xc585('0x39')];}_0x44a36d[_0xc585('0x28')](_0x593d4d)['send'](_0xe63293);};}exports[_0xc585('0x3a')]=function(_0x28a276,_0x356513){var _0x4af319={'include':[{'model':db[_0xc585('0x3b')],'as':_0xc585('0x3c')}]},_0x59619b={},_0x4f6534={'count':0x0,'rows':[]};var _0x4f0559=_[_0xc585('0x3d')](db[_0xc585('0x3e')][_0xc585('0x3f')],function(_0x33c798){return{'name':_0x33c798[_0xc585('0x40')],'type':_0x33c798[_0xc585('0x41')][_0xc585('0x42')]};});_0x59619b[_0xc585('0x43')]=_[_0xc585('0x3d')](_0x4f0559,_0xc585('0x39'));_0x59619b['query']=_['keys'](_0x28a276[_0xc585('0x44')]);_0x59619b[_0xc585('0x45')]=_[_0xc585('0x46')](_0x59619b[_0xc585('0x43')],_0x59619b['query']);_0x4af319[_0xc585('0x47')]=_[_0xc585('0x46')](_0x59619b['model'],qs['fields'](_0x28a276[_0xc585('0x44')]['fields']));_0x4af319[_0xc585('0x47')]=_0x4af319['attributes'][_0xc585('0x48')]?_0x4af319[_0xc585('0x47')]:_0x59619b[_0xc585('0x43')];if(!_0x28a276[_0xc585('0x44')][_0xc585('0x49')]('nolimit')){_0x4af319[_0xc585('0x2b')]=qs[_0xc585('0x2b')](_0x28a276[_0xc585('0x44')]['limit']);_0x4af319[_0xc585('0x2e')]=qs[_0xc585('0x2e')](_0x28a276[_0xc585('0x44')]['offset']);}_0x4af319['order']=qs[_0xc585('0x4a')](_0x28a276[_0xc585('0x44')][_0xc585('0x4a')]);_0x4af319[_0xc585('0x4b')]=qs['filters'](_['pick'](_0x28a276['query'],_0x59619b[_0xc585('0x45')]),_0x4f0559);if(_0x28a276['query']['filter']){_0x4af319[_0xc585('0x4b')]=_['merge'](_0x4af319['where'],{'$or':_[_0xc585('0x3d')](_0x4f0559,function(_0x12ea8d){if(_0x12ea8d[_0xc585('0x41')]!==_0xc585('0x4c')){var _0x2a13d6={};_0x2a13d6[_0x12ea8d[_0xc585('0x39')]]={'$like':'%'+_0x28a276[_0xc585('0x44')]['filter']+'%'};return _0x2a13d6;}})});}_0x4af319=_['merge']({},_0x4af319,_0x28a276[_0xc585('0x4d')]);var _0x4f1b52={'where':_0x4af319['where']};return db['WhatsappAccount'][_0xc585('0x2d')](_0x4f1b52)['then'](function(_0x282183){_0x4f6534[_0xc585('0x2d')]=_0x282183;if(_0x28a276[_0xc585('0x44')][_0xc585('0x4e')]){_0x4af319['include']=[{'all':!![]}];}return db[_0xc585('0x3e')][_0xc585('0x4f')](_0x4af319);})[_0xc585('0x1c')](function(_0x306bbd){_0x4f6534['rows']=_0x306bbd;return _0x4f6534;})[_0xc585('0x1c')](respondWithFilteredResult(_0x356513,_0x4af319))['catch'](handleError(_0x356513,null));};exports[_0xc585('0x50')]=function(_0x481fa5,_0x44b169){var _0x4cc4bf={'raw':![],'where':{'id':_0x481fa5[_0xc585('0x51')]['id']},'include':[{'model':db[_0xc585('0x3b')],'as':_0xc585('0x3c')}]},_0x2da9fa={};_0x2da9fa[_0xc585('0x43')]=_['keys'](db[_0xc585('0x3e')][_0xc585('0x3f')]);_0x2da9fa[_0xc585('0x44')]=_['keys'](_0x481fa5[_0xc585('0x44')]);_0x2da9fa[_0xc585('0x45')]=_[_0xc585('0x46')](_0x2da9fa[_0xc585('0x43')],_0x2da9fa[_0xc585('0x44')]);_0x4cc4bf[_0xc585('0x47')]=_['intersection'](_0x2da9fa['model'],qs[_0xc585('0x52')](_0x481fa5[_0xc585('0x44')]['fields']));_0x4cc4bf[_0xc585('0x47')]=_0x4cc4bf[_0xc585('0x47')][_0xc585('0x48')]?_0x4cc4bf['attributes']:_0x2da9fa['model'];if(_0x481fa5[_0xc585('0x44')]['includeAll']){_0x4cc4bf[_0xc585('0x53')]=[{'all':!![]}];}_0x4cc4bf=_[_0xc585('0x54')]({},_0x4cc4bf,_0x481fa5[_0xc585('0x4d')]);return db[_0xc585('0x3e')]['find'](_0x4cc4bf)[_0xc585('0x1c')](handleEntityNotFound(_0x44b169,null))['then'](respondWithResult(_0x44b169,null))[_0xc585('0x27')](handleError(_0x44b169,null));};exports[_0xc585('0x55')]=function(_0x498270,_0x22014b){return db[_0xc585('0x3e')][_0xc585('0x55')](_0x498270[_0xc585('0x56')],{})[_0xc585('0x1c')](function(_0x1b8a76){var _0x4b4cbd=_0x498270[_0xc585('0x57')][_0xc585('0x34')]({'plain':!![]});if(!_0x4b4cbd)throw new Error(_0xc585('0x58'));if(_0x4b4cbd['role']===_0xc585('0x57')){var _0x4e0c20=_0x1b8a76[_0xc585('0x34')]({'plain':!![]});var _0x5a51b2='WhatsappAccounts';return db[_0xc585('0x59')][_0xc585('0x5a')]({'where':{'name':_0x5a51b2,'userProfileId':_0x4b4cbd['userProfileId']},'raw':!![]})[_0xc585('0x1c')](function(_0x140f61){if(_0x140f61&&_0x140f61[_0xc585('0x5b')]===0x0){return db[_0xc585('0x36')]['create']({'name':_0x4e0c20[_0xc585('0x39')],'resourceId':_0x4e0c20['id'],'type':_0x140f61['name'],'sectionId':_0x140f61['id']},{})[_0xc585('0x1c')](function(){return _0x1b8a76;});}else{return _0x1b8a76;}})[_0xc585('0x27')](function(_0xce4a4b){logger[_0xc585('0x22')](_0xc585('0x5c'),_0xce4a4b);throw _0xce4a4b;});}return _0x1b8a76;})[_0xc585('0x1c')](respondWithResult(_0x22014b,0xc9))[_0xc585('0x27')](handleError(_0x22014b,null));};exports[_0xc585('0x32')]=function(_0x12909d,_0x411195){if(_0x12909d['body']['id']){delete _0x12909d[_0xc585('0x56')]['id'];}return db[_0xc585('0x3e')][_0xc585('0x5a')]({'where':{'id':_0x12909d[_0xc585('0x51')]['id']},'include':[{'model':db[_0xc585('0x3b')],'as':_0xc585('0x3c')}]})[_0xc585('0x1c')](handleEntityNotFound(_0x411195,null))[_0xc585('0x1c')](saveUpdates(_0x12909d['body'],null))[_0xc585('0x1c')](respondWithResult(_0x411195,null))[_0xc585('0x27')](handleError(_0x411195,null));};exports['destroy']=function(_0x3f79d0,_0x39571c){return db[_0xc585('0x3e')][_0xc585('0x5a')]({'where':{'id':_0x3f79d0[_0xc585('0x51')]['id']}})['then'](handleEntityNotFound(_0x39571c,null))[_0xc585('0x1c')](removeEntity(_0x39571c,null))['catch'](handleError(_0x39571c,null));};exports[_0xc585('0x5d')]=function(_0x30d8ec,_0x36178c){return db[_0xc585('0x3e')][_0xc585('0x5d')]()[_0xc585('0x1c')](respondWithResult(_0x36178c,null))[_0xc585('0x27')](handleError(_0x36178c,null));};exports[_0xc585('0x5e')]=function(_0x7f66b6,_0x34ff54,_0x251399){if(_0x7f66b6[_0xc585('0x56')]['id']){delete _0x7f66b6[_0xc585('0x56')]['id'];}return db['WhatsappAccount'][_0xc585('0x5a')]({'where':{'id':_0x7f66b6[_0xc585('0x51')]['id']}})['then'](handleEntityNotFound(_0x34ff54,null))['then'](function(_0x543d12){if(_0x543d12){_0x7f66b6['body'][_0xc585('0x5f')]=_0x543d12['id'];return db[_0xc585('0x60')][_0xc585('0x55')](_0x7f66b6[_0xc585('0x56')]);}})[_0xc585('0x1c')](respondWithResult(_0x34ff54,null))[_0xc585('0x27')](handleError(_0x34ff54,null));};exports[_0xc585('0x61')]=function(_0x4f2cc2,_0x4715c2,_0x3b92fd){var _0x17e1ec={'raw':![],'where':{}};var _0x3e9709={};var _0x4b1451={'count':0x0,'rows':[]};return db[_0xc585('0x3e')][_0xc585('0x62')]({'where':{'id':_0x4f2cc2['params']['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x4715c2,null))['then'](function(_0x2a61da){if(_0x2a61da){_0x3e9709[_0xc585('0x43')]=_['keys'](db[_0xc585('0x60')][_0xc585('0x3f')]);_0x3e9709['query']=_[_0xc585('0x63')](_0x4f2cc2[_0xc585('0x44')]);_0x3e9709['filters']=_[_0xc585('0x46')](_0x3e9709['model'],_0x3e9709['query']);_0x17e1ec[_0xc585('0x47')]=_[_0xc585('0x46')](_0x3e9709[_0xc585('0x43')],qs[_0xc585('0x52')](_0x4f2cc2['query']['fields']));_0x17e1ec['attributes']=_0x17e1ec[_0xc585('0x47')][_0xc585('0x48')]?_0x17e1ec['attributes']:_0x3e9709['model'];if(!_0x4f2cc2[_0xc585('0x44')][_0xc585('0x49')](_0xc585('0x64'))){_0x17e1ec[_0xc585('0x2b')]=qs[_0xc585('0x2b')](_0x4f2cc2[_0xc585('0x44')][_0xc585('0x2b')]);_0x17e1ec['offset']=qs['offset'](_0x4f2cc2[_0xc585('0x44')][_0xc585('0x2e')]);}_0x17e1ec[_0xc585('0x65')]=qs[_0xc585('0x4a')](_0x4f2cc2['query'][_0xc585('0x4a')]);_0x17e1ec['where']=qs['filters'](_['pick'](_0x4f2cc2[_0xc585('0x44')],_0x3e9709[_0xc585('0x45')]));_0x17e1ec[_0xc585('0x4b')][_0xc585('0x5f')]=_0x2a61da['id'];if(_0x4f2cc2[_0xc585('0x44')][_0xc585('0x66')]){_0x17e1ec[_0xc585('0x4b')]=_[_0xc585('0x54')](_0x17e1ec[_0xc585('0x4b')],{'$or':_[_0xc585('0x3d')](_0x17e1ec['attributes'],function(_0xd21a9c){var _0x306453={};_0x306453[_0xd21a9c]={'$like':'%'+_0x4f2cc2['query']['filter']+'%'};return _0x306453;})});}_0x17e1ec=_[_0xc585('0x54')]({},_0x17e1ec,_0x4f2cc2[_0xc585('0x4d')]);return db['Disposition'][_0xc585('0x2d')]({'where':_0x17e1ec[_0xc585('0x4b')]})[_0xc585('0x1c')](function(_0x74be7b){_0x4b1451[_0xc585('0x2d')]=_0x74be7b;if(_0x4f2cc2[_0xc585('0x44')][_0xc585('0x4e')]){_0x17e1ec[_0xc585('0x53')]=[{'all':!![]}];}return db[_0xc585('0x60')]['findAll'](_0x17e1ec);})['then'](function(_0x39e742){_0x4b1451['rows']=_0x39e742;return _0x4b1451;});}})[_0xc585('0x1c')](respondWithFilteredResult(_0x4715c2,_0x17e1ec))['catch'](handleError(_0x4715c2,null));};exports[_0xc585('0x67')]=function(_0xc90ba5,_0x2b4b07,_0xa0552b){return db['WhatsappAccount'][_0xc585('0x5a')]({'where':{'id':_0xc90ba5[_0xc585('0x51')]['id']}})['then'](handleEntityNotFound(_0x2b4b07,null))[_0xc585('0x1c')](function(_0x214512){if(_0x214512){return _0x214512[_0xc585('0x67')](_0xc90ba5[_0xc585('0x44')][_0xc585('0x68')]);}})['then'](respondWithStatusCode(_0x2b4b07,null))[_0xc585('0x27')](handleError(_0x2b4b07,null));};exports[_0xc585('0x69')]=function(_0x1e7364,_0xe76ca,_0x148413){if(_0x1e7364[_0xc585('0x56')]['id']){delete _0x1e7364[_0xc585('0x56')]['id'];}return db[_0xc585('0x3e')]['find']({'where':{'id':_0x1e7364['params']['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0xe76ca,null))[_0xc585('0x1c')](function(_0x141fea){if(_0x141fea){_0x1e7364[_0xc585('0x56')]['WhatsappAccountId']=_0x141fea['id'];return db['CannedAnswer']['create'](_0x1e7364['body']);}})[_0xc585('0x1c')](respondWithResult(_0xe76ca,null))[_0xc585('0x27')](handleError(_0xe76ca,null));};exports[_0xc585('0x6a')]=function(_0xb12cc6,_0x279289,_0x2118c1){var _0x3eeabc={'raw':![],'where':{}};var _0x149151={};var _0x44f515={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xc585('0x62')]({'where':{'id':_0xb12cc6[_0xc585('0x51')]['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x279289,null))[_0xc585('0x1c')](function(_0x1a41e5){if(_0x1a41e5){_0x149151[_0xc585('0x43')]=_['keys'](db[_0xc585('0x6b')][_0xc585('0x3f')]);_0x149151[_0xc585('0x44')]=_[_0xc585('0x63')](_0xb12cc6['query']);_0x149151[_0xc585('0x45')]=_[_0xc585('0x46')](_0x149151[_0xc585('0x43')],_0x149151['query']);_0x3eeabc[_0xc585('0x47')]=_[_0xc585('0x46')](_0x149151['model'],qs[_0xc585('0x52')](_0xb12cc6['query'][_0xc585('0x52')]));_0x3eeabc[_0xc585('0x47')]=_0x3eeabc[_0xc585('0x47')][_0xc585('0x48')]?_0x3eeabc[_0xc585('0x47')]:_0x149151[_0xc585('0x43')];if(!_0xb12cc6['query']['hasOwnProperty'](_0xc585('0x64'))){_0x3eeabc[_0xc585('0x2b')]=qs[_0xc585('0x2b')](_0xb12cc6['query']['limit']);_0x3eeabc[_0xc585('0x2e')]=qs['offset'](_0xb12cc6['query'][_0xc585('0x2e')]);}_0x3eeabc[_0xc585('0x65')]=qs[_0xc585('0x4a')](_0xb12cc6['query'][_0xc585('0x4a')]);_0x3eeabc[_0xc585('0x4b')]=qs[_0xc585('0x45')](_[_0xc585('0x6c')](_0xb12cc6[_0xc585('0x44')],_0x149151[_0xc585('0x45')]));_0x3eeabc[_0xc585('0x4b')][_0xc585('0x5f')]=_0x1a41e5['id'];if(_0xb12cc6[_0xc585('0x44')][_0xc585('0x66')]){_0x3eeabc[_0xc585('0x4b')]=_[_0xc585('0x54')](_0x3eeabc[_0xc585('0x4b')],{'$or':_['map'](_0x3eeabc[_0xc585('0x47')],function(_0x5a11a8){var _0x483c75={};_0x483c75[_0x5a11a8]={'$like':'%'+_0xb12cc6['query'][_0xc585('0x66')]+'%'};return _0x483c75;})});}_0x3eeabc=_[_0xc585('0x54')]({},_0x3eeabc,_0xb12cc6['options']);return db[_0xc585('0x6b')][_0xc585('0x2d')]({'where':_0x3eeabc[_0xc585('0x4b')]})[_0xc585('0x1c')](function(_0x3c126f){_0x44f515[_0xc585('0x2d')]=_0x3c126f;if(_0xb12cc6['query'][_0xc585('0x4e')]){_0x3eeabc[_0xc585('0x53')]=[{'all':!![]}];}return db[_0xc585('0x6b')]['findAll'](_0x3eeabc);})[_0xc585('0x1c')](function(_0x4333cc){_0x44f515['rows']=_0x4333cc;return _0x44f515;});}})[_0xc585('0x1c')](respondWithFilteredResult(_0x279289,_0x3eeabc))['catch'](handleError(_0x279289,null));};exports[_0xc585('0x6d')]=function(_0x5dcce5,_0x420362,_0x53a8ec){return db[_0xc585('0x3e')][_0xc585('0x5a')]({'where':{'id':_0x5dcce5[_0xc585('0x51')]['id']}})['then'](handleEntityNotFound(_0x420362,null))[_0xc585('0x1c')](function(_0x4c88aa){if(_0x4c88aa){return _0x4c88aa[_0xc585('0x6d')](_0x5dcce5[_0xc585('0x44')][_0xc585('0x68')]);}})[_0xc585('0x1c')](respondWithStatusCode(_0x420362,null))[_0xc585('0x27')](handleError(_0x420362,null));};exports[_0xc585('0x6e')]=function(_0x4b8265,_0x106d55,_0x5a640f){return db[_0xc585('0x3e')][_0xc585('0x5a')]({'where':{'id':_0x4b8265[_0xc585('0x51')]['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x106d55,null))[_0xc585('0x1c')](function(_0x41a8af){if(_0x41a8af){return _0x41a8af['addAgents'](_0x4b8265[_0xc585('0x56')][_0xc585('0x68')],_[_0xc585('0x6f')](_0x4b8265[_0xc585('0x56')],['ids','id'])||{})['spread'](function(_0x38d13b){for(var _0x249718=0x0;_0x249718<_0x4b8265[_0xc585('0x56')][_0xc585('0x68')][_0xc585('0x48')];_0x249718+=0x1){socket[_0xc585('0x70')](_0xc585('0x71'),{'UserId':Number(_0x4b8265[_0xc585('0x56')][_0xc585('0x68')][_0x249718]),'WhatsappAccountId':Number(_0x4b8265['params']['id'])});}return _0x38d13b;});}})[_0xc585('0x1c')](respondWithResult(_0x106d55,null))[_0xc585('0x27')](handleError(_0x106d55,null));};exports[_0xc585('0x72')]=function(_0x179375,_0x5b7ec2,_0x51d537){return db[_0xc585('0x3e')]['find']({'where':{'id':_0x179375['params']['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x5b7ec2,null))[_0xc585('0x1c')](function(_0x5332c1){if(_0x5332c1){return _0x5332c1[_0xc585('0x72')](_0x179375[_0xc585('0x44')]['ids'])['then'](function(){if(_['isArray'](_0x179375[_0xc585('0x44')]['ids'])){for(var _0x5472b3=0x0;_0x5472b3<_0x179375['query'][_0xc585('0x68')][_0xc585('0x48')];_0x5472b3+=0x1){socket['emit'](_0xc585('0x73'),{'UserId':Number(_0x179375['query'][_0xc585('0x68')][_0x5472b3]),'WhatsappAccountId':Number(_0x179375[_0xc585('0x51')]['id'])});}}else{socket[_0xc585('0x70')](_0xc585('0x73'),{'UserId':Number(_0x179375['query']['ids']),'WhatsappAccountId':Number(_0x179375[_0xc585('0x51')]['id'])});}});}})[_0xc585('0x1c')](respondWithStatusCode(_0x5b7ec2,null))[_0xc585('0x27')](handleError(_0x5b7ec2,null));};exports[_0xc585('0x74')]=function(_0xfaf498,_0x4aae5b,_0x4c40ae){var _0x26169e={};var _0x32704a={};var _0x3127ff;var _0xd34e45;return db['WhatsappAccount'][_0xc585('0x62')]({'where':{'id':_0xfaf498[_0xc585('0x51')]['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x4aae5b,null))[_0xc585('0x1c')](function(_0x27ced3){if(_0x27ced3){_0x3127ff=_0x27ced3;_0x32704a[_0xc585('0x43')]=_[_0xc585('0x63')](db['User'][_0xc585('0x3f')]);_0x32704a['query']=_['keys'](_0xfaf498[_0xc585('0x44')]);_0x32704a[_0xc585('0x45')]=_[_0xc585('0x46')](_0x32704a['model'],_0x32704a[_0xc585('0x44')]);_0x26169e['attributes']=_[_0xc585('0x46')](_0x32704a[_0xc585('0x43')],qs[_0xc585('0x52')](_0xfaf498[_0xc585('0x44')][_0xc585('0x52')]));_0x26169e[_0xc585('0x47')]=_0x26169e[_0xc585('0x47')][_0xc585('0x48')]?_0x26169e['attributes']:_0x32704a[_0xc585('0x43')];_0x26169e[_0xc585('0x65')]=qs[_0xc585('0x4a')](_0xfaf498['query'][_0xc585('0x4a')]);_0x26169e[_0xc585('0x4b')]=qs[_0xc585('0x45')](_[_0xc585('0x6c')](_0xfaf498[_0xc585('0x44')],_0x32704a['filters']));if(_0xfaf498[_0xc585('0x44')][_0xc585('0x66')]){_0x26169e['where']=_[_0xc585('0x54')](_0x26169e['where'],{'$or':_[_0xc585('0x3d')](_0x26169e[_0xc585('0x47')],function(_0x3cf7fb){var _0xa7011f={};_0xa7011f[_0x3cf7fb]={'$like':'%'+_0xfaf498[_0xc585('0x44')][_0xc585('0x66')]+'%'};return _0xa7011f;})});}_0x26169e=_['merge']({},_0x26169e,_0xfaf498[_0xc585('0x4d')]);return _0x3127ff[_0xc585('0x74')](_0x26169e);}})[_0xc585('0x1c')](function(_0x1c83a8){if(_0x1c83a8){_0xd34e45=_0x1c83a8[_0xc585('0x48')];if(!_0xfaf498[_0xc585('0x44')][_0xc585('0x49')](_0xc585('0x64'))){_0x26169e[_0xc585('0x2b')]=qs[_0xc585('0x2b')](_0xfaf498[_0xc585('0x44')]['limit']);_0x26169e[_0xc585('0x2e')]=qs[_0xc585('0x2e')](_0xfaf498[_0xc585('0x44')][_0xc585('0x2e')]);}return _0x3127ff[_0xc585('0x74')](_0x26169e);}})[_0xc585('0x1c')](function(_0x409461){if(_0x409461){return _0x409461?{'count':_0xd34e45,'rows':_0x409461}:null;}})[_0xc585('0x1c')](respondWithResult(_0x4aae5b,null))[_0xc585('0x27')](handleError(_0x4aae5b,null));};exports[_0xc585('0x75')]=function(_0x46c07c,_0x4e3e2f){var _0x243144=_0x46c07c['params']['id'];var _0x4b8052=_0x46c07c[_0xc585('0x56')];var _0x4758e3=0xc8;var _0x144e3a=null;return db[_0xc585('0x76')][_0xc585('0x77')]({'isolationLevel':db[_0xc585('0x76')][_0xc585('0x78')][_0xc585('0x79')][_0xc585('0x7a')]},function(_0x28be14){return db[_0xc585('0x3e')][_0xc585('0x62')]({'where':{'id':_0x243144},'transaction':_0x28be14})[_0xc585('0x1c')](function(_0x1f7c19){if(_0x1f7c19){return db[_0xc585('0x7b')][_0xc585('0x33')]({'where':{'WhatsappAccountId':_0x243144},'transaction':_0x28be14})[_0xc585('0x1c')](function(){var _0x1bdc92=_[_0xc585('0x3d')](_0x4b8052,function(_0x4adee8){_0x4adee8['WhatsappAccountId']=_0x243144;return _0x4adee8;});return db[_0xc585('0x7b')][_0xc585('0x7c')](_0x1bdc92,{'transaction':_0x28be14});});}else{_0x4758e3=0x194;_0x144e3a=[];}});})[_0xc585('0x1c')](function(){if(_0x4758e3!==0x194){return db['WhatsappApplication'][_0xc585('0x7d')]({'where':{'WhatsappAccountId':_0x243144},'order':_0xc585('0x7e')})[_0xc585('0x1c')](function(_0x5edd05){_0x144e3a=_0x5edd05;});}})['catch'](function(_0x4fd148){_0x4758e3=0x1f4;logger[_0xc585('0x22')](_0x4fd148[_0xc585('0x38')]);if(_0x4fd148['name']){delete _0x4fd148[_0xc585('0x39')];}_0x144e3a=_0x4fd148;})[_0xc585('0x7f')](function(){if(_0x144e3a===null){_0x4e3e2f['sendStatus'](_0x4758e3);}else{if(_0x4758e3===0x1f4){_0x4e3e2f[_0xc585('0x28')](_0x4758e3)[_0xc585('0x80')](_0x144e3a);}else{_0x4e3e2f[_0xc585('0x28')](_0x4758e3)['json'](_0x144e3a);}}});};exports['getApplications']=function(_0x5e323c,_0x30e656,_0x5d297b){var _0x196157={};var _0x32acce={};var _0x3da404;var _0x1e4cfa;return db[_0xc585('0x3e')][_0xc585('0x62')]({'where':{'id':_0x5e323c[_0xc585('0x51')]['id']}})[_0xc585('0x1c')](handleEntityNotFound(_0x30e656,null))[_0xc585('0x1c')](function(_0x47948d){if(_0x47948d){_0x3da404=_0x47948d;_0x32acce['model']=_[_0xc585('0x63')](db[_0xc585('0x7b')][_0xc585('0x3f')]);_0x32acce[_0xc585('0x44')]=_[_0xc585('0x63')](_0x5e323c['query']);_0x32acce[_0xc585('0x45')]=_[_0xc585('0x46')](_0x32acce['model'],_0x32acce[_0xc585('0x44')]);_0x196157[_0xc585('0x47')]=_[_0xc585('0x46')](_0x32acce[_0xc585('0x43')],qs[_0xc585('0x52')](_0x5e323c[_0xc585('0x44')][_0xc585('0x52')]));_0x196157['attributes']=_0x196157[_0xc585('0x47')][_0xc585('0x48')]?_0x196157[_0xc585('0x47')]:_0x32acce[_0xc585('0x43')];_0x196157[_0xc585('0x65')]=qs[_0xc585('0x4a')](_0x5e323c[_0xc585('0x44')][_0xc585('0x4a')]);_0x196157[_0xc585('0x4b')]=qs['filters'](_[_0xc585('0x6c')](_0x5e323c[_0xc585('0x44')],_0x32acce['filters']));if(_0x5e323c[_0xc585('0x44')][_0xc585('0x66')]){_0x196157[_0xc585('0x4b')]=_['merge'](_0x196157[_0xc585('0x4b')],{'$or':_[_0xc585('0x3d')](_0x196157[_0xc585('0x47')],function(_0x27bc0f){var _0x39cb30={};_0x39cb30[_0x27bc0f]={'$like':'%'+_0x5e323c[_0xc585('0x44')][_0xc585('0x66')]+'%'};return _0x39cb30;})});}_0x196157=_['merge']({},_0x196157,_0x5e323c['options']);return _0x3da404[_0xc585('0x81')](_0x196157);}})[_0xc585('0x1c')](function(_0x2ce628){if(_0x2ce628){_0x1e4cfa=_0x2ce628[_0xc585('0x48')];if(!_0x5e323c[_0xc585('0x44')][_0xc585('0x49')](_0xc585('0x64'))){_0x196157['limit']=qs[_0xc585('0x2b')](_0x5e323c[_0xc585('0x44')][_0xc585('0x2b')]);_0x196157['offset']=qs['offset'](_0x5e323c[_0xc585('0x44')][_0xc585('0x2e')]);}return _0x3da404[_0xc585('0x81')](_0x196157);}})[_0xc585('0x1c')](function(_0x535a9c){if(_0x535a9c){return _0x535a9c?{'count':_0x1e4cfa,'rows':_0x535a9c}:null;}})[_0xc585('0x1c')](respondWithResult(_0x30e656,null))['catch'](handleError(_0x30e656,null));};exports[_0xc585('0x82')]=function(_0x5769de,_0x3ffded,_0x4e6b0d){var _0x334f58={'channel':_0xc585('0x83')};var _0x2b368f=[];var _0x1c3bf7=[];var _0x3cf0ee={};return db[_0xc585('0x3e')]['find']({'where':{'id':_0x5769de[_0xc585('0x51')]['id']},'include':[{'model':db[_0xc585('0x7b')],'as':_0xc585('0x84')}]})[_0xc585('0x1c')](handleEntityNotFound(_0x3ffded,null))[_0xc585('0x1c')](function(_0x56a2a0){_0x334f58[_0xc585('0x85')]=_0x56a2a0;if(_0x334f58['account']&&_0x334f58[_0xc585('0x85')][_0xc585('0x41')]===_0xc585('0x86')&&_0x5769de[_0xc585('0x56')][_0xc585('0x87')]){if(_0x5769de[_0xc585('0x56')][_0xc585('0x87')][_0xc585('0x48')]===0x0)return;if(_0x5769de[_0xc585('0x56')][_0xc585('0x87')][0x0][_0xc585('0x88')]!==_0xc585('0x89'))return;return db['WhatsappMessage'][_0xc585('0x32')]({'read':!![],'readAt':_0x5769de[_0xc585('0x56')]['statuses'][0x0][_0xc585('0x8a')]},{'where':{'messageId':_0x5769de['body'][_0xc585('0x87')][0x0][_0xc585('0x8b')]},'individualHooks':!![]})[_0xc585('0x1c')](function(_0x5965cc){return _0x3ffded[_0xc585('0x28')](0xc8)['json'](_0x5965cc);});}_0x334f58[_0xc585('0x8c')]=_[_0xc585('0x8d')](_0x56a2a0['Applications'],[_0xc585('0x7e')],['asc']);if(_0x334f58[_0xc585('0x85')][_0xc585('0x84')]){delete _0x334f58[_0xc585('0x85')][_0xc585('0x84')];}return db['CmContact']['describe']()[_0xc585('0x1c')](function(_0x366161){if(!_0x366161){throw new db[(_0xc585('0x8e'))][(_0xc585('0x8f'))](_0xc585('0x90'));}_0x2b368f=_[_0xc585('0x91')](_['keys'](_0x366161),['createdAt',_0xc585('0x92')]);_0x1c3bf7=_[_0xc585('0x91')](_['keys'](_0x366161),['createdAt','updatedAt',_0xc585('0x93'),_0xc585('0x94')]);_0x334f58[_0xc585('0x56')]={'mapKey':'mobile'};if(_0x334f58[_0xc585('0x85')]&&_0x334f58[_0xc585('0x85')][_0xc585('0x41')]===_0xc585('0x95')){_0x334f58['body']['from']=_0x5769de[_0xc585('0x56')]['From'][_0xc585('0x96')](_0xc585('0x97'),'');_0x334f58[_0xc585('0x56')][_0xc585('0x56')]=_0x5769de['body'][_0xc585('0x98')];_0x334f58[_0xc585('0x56')]['messageId']=_0x5769de[_0xc585('0x56')][_0xc585('0x99')];}if(_0x334f58[_0xc585('0x85')]&&_0x334f58[_0xc585('0x85')][_0xc585('0x41')]==='sinch'){_0x334f58[_0xc585('0x56')]['from']=_0x5769de[_0xc585('0x56')][_0xc585('0x9a')][0x0]['from'];_0x334f58[_0xc585('0x56')][_0xc585('0x56')]=_0x5769de[_0xc585('0x56')]['notifications'][0x0][_0xc585('0x24')][_0xc585('0x56')];_0x334f58['body'][_0xc585('0x9b')]=_0x5769de['body'][_0xc585('0x9a')][0x0]['message_id'];}if(_0x334f58[_0xc585('0x56')]['id']){delete _0x334f58['body']['id'];}if(_[_0xc585('0x9c')](_0x334f58[_0xc585('0x56')][_0xc585('0x9d')])){throw new db[(_0xc585('0x8e'))][(_0xc585('0x8f'))](_0xc585('0x9e'));}if(_['isNil'](_0x334f58[_0xc585('0x56')][_0xc585('0x56')])||_0x334f58['body'][_0xc585('0x56')]===''){throw new db[(_0xc585('0x8e'))][(_0xc585('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x334f58[_0xc585('0x56')][_0xc585('0x9f')])){throw new db[(_0xc585('0x8e'))][(_0xc585('0x8f'))](_0xc585('0xa0')+_0x1c3bf7);}if(!_['includes'](_0x1c3bf7,_0x334f58['body'][_0xc585('0x9f')])){throw new db[(_0xc585('0x8e'))]['ValidationError'](_0xc585('0xa1')+_0x1c3bf7);}_0x3cf0ee[_0x334f58[_0xc585('0x56')][_0xc585('0x9f')]]=_0x334f58[_0xc585('0x56')]['from'];return db[_0xc585('0xa2')][_0xc585('0x5a')]({'where':{'id':_0x334f58[_0xc585('0x85')]['ListId']},'include':[{'model':db[_0xc585('0xa3')],'as':_0xc585('0xa4'),'where':_0x3cf0ee,'limit':0x1,'order':[[_0xc585('0x92'),_0xc585('0xa5')]]}]});})[_0xc585('0x1c')](handleEntityNotFound(_0x3ffded,null))[_0xc585('0x1c')](function(_0x21969b){if(_0x21969b){_0x334f58[_0xc585('0xa6')]=_['omit'](_0x21969b,['Contacts']);if(_0x21969b[_0xc585('0xa4')][_0xc585('0x48')]){return _0x21969b[_0xc585('0xa4')][0x0];}var _0x58c75f=_[_0xc585('0x15')](_0x334f58[_0xc585('0x56')],{'firstName':_0x334f58[_0xc585('0x56')]['from'],'ListId':_0x21969b['id']});_0x58c75f[_0x334f58[_0xc585('0x56')][_0xc585('0x9f')]]=_0x334f58[_0xc585('0x56')]['from'];return db['CmContact'][_0xc585('0x55')](_0x58c75f,{'fields':_0x2b368f,'raw':!![]});}})[_0xc585('0x1c')](handleEntityNotFound(_0x3ffded,null))[_0xc585('0x1c')](function(_0x24f726){if(_0x24f726){_0x334f58[_0xc585('0xa7')]=_0x24f726;var _0x11ede3={'ContactId':_0x24f726['id'],'phone':_0x334f58[_0xc585('0x56')][_0xc585('0x9d')],'WhatsappAccountId':_0x5769de[_0xc585('0x51')]['id']};var _0x24024d={'ContactId':_0x24f726['id'],'WhatsappAccountId':_0x5769de['params']['id'],'closed':![]};return db['WhatsappInteraction']['find']({'where':_0x24024d})[_0xc585('0x1c')](function(_0x3e4d08){if(_0x3e4d08){return[_0x3e4d08,![]];}return db[_0xc585('0xa8')][_0xc585('0x55')](_0x11ede3)[_0xc585('0x1c')](function(_0x3aca3c){return[_0x3aca3c,!![]];});});}})[_0xc585('0xa9')](function(_0xf1916e,_0x36d3c6){_0x334f58[_0xc585('0xaa')]=_0xf1916e[_0xc585('0x34')]({'plain':!![]});_0x334f58['interaction']['created']=![];if(_0x36d3c6){if(_0x334f58[_0xc585('0x85')]['autoclose']){_0x334f58[_0xc585('0x8c')][_0xc585('0xab')]({'id':0x0,'priority':_0x334f58[_0xc585('0x8c')][_0xc585('0x48')]+0x1,'app':_0xc585('0xac'),'appdata':_0xc585('0xad'),'interval':_0xc585('0xae')});}_0x334f58['interaction'][_0xc585('0xaf')]=!![];}return db[_0xc585('0xb0')]['create']({'phone':_0x334f58[_0xc585('0x56')][_0xc585('0x9d')],'messageId':_0x334f58[_0xc585('0x56')][_0xc585('0x9b')],'body':_0x334f58[_0xc585('0x56')][_0xc585('0x56')],'WhatsappAccountId':_0x5769de[_0xc585('0x51')]['id'],'WhatsappInteractionId':_0xf1916e['id'],'direction':'in','ContactId':_0xf1916e['ContactId'],'AttachmentId':_0x334f58[_0xc585('0x56')][_0xc585('0xb1')]});})['then'](function(_0x4cc0bd){_0x334f58['message']=_0x4cc0bd;if(_0x334f58['interaction'][_0xc585('0xb2')]){return db[_0xc585('0xb3')][_0xc585('0x5a')]({'attributes':['id',_0xc585('0x39')],'where':{'id':_0x334f58['interaction']['UserId']}})[_0xc585('0x1c')](function(_0x4c1b18){if(_0x4c1b18){_0x334f58['applications'][_0xc585('0xb4')]({'id':0x0,'priority':0x0,'app':_0xc585('0xb5'),'appdata':_0x4c1b18[_0xc585('0x39')]+','+(_0x334f58[_0xc585('0x85')][_0xc585('0xb6')]||0xa),'interval':_0xc585('0xae')});}return respondWithRpcPromise(_0xc585('0xb7'),_0xc585('0xb8'),_0x334f58);});}return respondWithRpcPromise(_0xc585('0xb7'),_0xc585('0xb8'),_0x334f58);})['then'](function(_0xa58701){if(_0xa58701){var _0x458ce5=0xc8;var _0x9b1fb9=_0xc585('0xb9');logger[_0xc585('0x25')](_0xc585('0x1f'),_0x9b1fb9,_0x458ce5,_0xc585('0xba'));logger[_0xc585('0x1e')](_0xc585('0xbb'),_0x9b1fb9,_0x458ce5,_0xc585('0xba'),JSON[_0xc585('0x21')](_0xa58701));if(_0x334f58[_0xc585('0x85')][_0xc585('0x41')]===_0xc585('0x95')){return _0x3ffded[_0xc585('0x28')](_0x458ce5)[_0xc585('0x2f')]('Content-Type',_0xc585('0xbc'))[_0xc585('0x80')]('\x0a');}else{return _0x3ffded[_0xc585('0x28')](_0x458ce5)[_0xc585('0x2a')](_0xa58701);}}});})['catch'](handleError(_0x3ffded,null));};exports[_0xc585('0x80')]=function(_0x229a07,_0x5742cf,_0x2ed729){var _0x92003d,_0x46c897,_0x49df31;if(_[_0xc585('0x9c')](_0x229a07[_0xc585('0x56')][_0xc585('0x56')])||_0x229a07[_0xc585('0x56')][_0xc585('0x56')]===''){throw new db['Sequelize']['ValidationError'](_0xc585('0xbd'));}if(_[_0xc585('0x9c')](_0x229a07[_0xc585('0x56')]['to'])){throw new db[(_0xc585('0x8e'))][(_0xc585('0x8f'))](_0xc585('0xbe'));}_0x92003d=_0x229a07[_0xc585('0x56')]['to'];return db[_0xc585('0x3e')][_0xc585('0x5a')]({'where':{'id':_0x229a07[_0xc585('0x51')]['id']},'include':[{'model':db[_0xc585('0xa2')],'as':_0xc585('0xbf'),'include':[{'model':db[_0xc585('0xa3')],'as':_0xc585('0xa4'),'where':{'mobile':_0x92003d},'limit':0x1,'order':[[_0xc585('0x92'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x5742cf,null))[_0xc585('0x1c')](function(_0xfec0f5){if(_0xfec0f5&&_0xfec0f5['List']){_0x46c897=_0xfec0f5[_0xc585('0x34')]({'plain':!![]});if(_0x46c897[_0xc585('0xbf')]&&_0x46c897['List'][_0xc585('0xa4')]['length']){return _0x46c897['List'][_0xc585('0xa4')][0x0];}return db[_0xc585('0xa3')][_0xc585('0x55')](_[_0xc585('0x15')](_0x229a07[_0xc585('0x56')],{'firstName':_0x92003d,'mobile':_0x92003d,'phone':_0x92003d,'ListId':_0x46c897[_0xc585('0x94')]}));}})[_0xc585('0x1c')](handleEntityNotFound(_0x5742cf,null))[_0xc585('0x1c')](function(_0xe57218){if(_0xe57218){_0x49df31=_0xe57218;return db[_0xc585('0xa8')]['find']({'where':{'ContactId':_0x49df31['id'],'closed':![],'WhatsappAccountId':_0x46c897['id']}})[_0xc585('0x1c')](function(_0x405e71){if(_0x405e71){return[_0x405e71,![]];}return db['WhatsappInteraction'][_0xc585('0x55')]({'UserId':_0x229a07[_0xc585('0x57')]['id'],'ContactId':_0x49df31['id'],'WhatsappAccountId':_0x46c897['id'],'phone':_0x92003d,'firstMsgDirection':_0xc585('0xc0'),'Messages':[_[_0xc585('0x54')](_0x229a07[_0xc585('0x56')],{'read':![],'body':_0x229a07[_0xc585('0x56')][_0xc585('0x56')],'phone':_0x92003d,'WhatsappAccountId':_0x46c897['id'],'UserId':_0x229a07[_0xc585('0x57')]['id'],'ContactId':_0x49df31['id']})]},{'include':[{'model':db[_0xc585('0xb0')],'as':_0xc585('0xc1')}]})[_0xc585('0x1c')](function(_0x1d665f){return[_0x1d665f,!![]];});});}})[_0xc585('0xa9')](function(_0xb6991,_0x3a4756){if(_0x3a4756){return _0xb6991;}return db['WhatsappMessage'][_0xc585('0x55')](_[_0xc585('0x54')](_0x229a07[_0xc585('0x56')],{'read':![],'body':_0x229a07[_0xc585('0x56')][_0xc585('0x56')],'phone':_0x92003d,'WhatsappAccountId':_0x46c897['id'],'WhatsappInteractionId':_0xb6991['id'],'UserId':_0x229a07[_0xc585('0x57')]['id'],'ContactId':_0x49df31['id']}))[_0xc585('0x1c')](function(_0x37812d){_0xb6991[_0xc585('0xc2')][_0xc585('0xc1')]=[];_0xb6991['dataValues'][_0xc585('0xc1')][_0xc585('0xab')](_0x37812d[_0xc585('0xc2')]);return _0xb6991;});})[_0xc585('0x1c')](respondWithResult(_0x5742cf,null))[_0xc585('0x27')](handleError(_0x5742cf,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index e914b4a..95c33a0 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 _0x33a2=['hasOwnProperty','hook','WhatsappAccount','setMaxListeners','save','update','remove','emit'];(function(_0x12b6c4,_0x1377d9){var _0x632004=function(_0x27113b){while(--_0x27113b){_0x12b6c4['push'](_0x12b6c4['shift']());}};_0x632004(++_0x1377d9);}(_0x33a2,0xb2));var _0x233a=function(_0xe0b185,_0xb6d23b){_0xe0b185=_0xe0b185-0x0;var _0x4b74e7=_0x33a2[_0xe0b185];return _0x4b74e7;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require('../../mysqldb')['db'][_0x233a('0x0')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x233a('0x1')](0x0);var events={'afterCreate':_0x233a('0x2'),'afterUpdate':_0x233a('0x3'),'afterDestroy':_0x233a('0x4')};function emitEvent(_0x26153f){return function(_0xfff32,_0x3c0877,_0x2b9a10){WhatsappAccountEvents['emit'](_0x26153f+':'+_0xfff32['id'],_0xfff32);WhatsappAccountEvents[_0x233a('0x5')](_0x26153f,_0xfff32);_0x2b9a10(null);};}for(var e in events){if(events[_0x233a('0x6')](e)){var event=events[e];WhatsappAccount[_0x233a('0x7')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file +var _0x1a66=['update','hook','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x3ad1a0,_0x61d8bb){var _0x4321a3=function(_0x1204f1){while(--_0x1204f1){_0x3ad1a0['push'](_0x3ad1a0['shift']());}};_0x4321a3(++_0x61d8bb);}(_0x1a66,0x1f4));var _0x61a6=function(_0x4cc183,_0x17fb71){_0x4cc183=_0x4cc183-0x0;var _0x5db376=_0x1a66[_0x4cc183];return _0x5db376;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x61a6('0x0'))['db'][_0x61a6('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x61a6('0x2')](0x0);var events={'afterCreate':_0x61a6('0x3'),'afterUpdate':_0x61a6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x37f4a5){return function(_0x442f12,_0x4dc5e1,_0x2f00da){WhatsappAccountEvents['emit'](_0x37f4a5+':'+_0x442f12['id'],_0x442f12);WhatsappAccountEvents['emit'](_0x37f4a5,_0x442f12);_0x2f00da(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x61a6('0x5')](e,emitEvent(event));}}module['exports']=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 4327258..71813d6 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 _0x757f=['exports','define','WhatsappAccount','whatsapp_accounts','lodash','util','api','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes'];(function(_0x6e7a7,_0x5ca2f8){var _0x37555f=function(_0x460b94){while(--_0x460b94){_0x6e7a7['push'](_0x6e7a7['shift']());}};_0x37555f(++_0x5ca2f8);}(_0x757f,0xe8));var _0xf757=function(_0x126acb,_0x55ddec){_0x126acb=_0x126acb-0x0;var _0x58853a=_0x757f[_0x126acb];return _0x58853a;};'use strict';var _=require(_0xf757('0x0'));var util=require(_0xf757('0x1'));var logger=require('../../config/logger')(_0xf757('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xf757('0x3'));var fs=require('fs');var path=require(_0xf757('0x4'));var rimraf=require(_0xf757('0x5'));var config=require(_0xf757('0x6'));var attributes=require(_0xf757('0x7'));module[_0xf757('0x8')]=function(_0x3bdca0,_0x41a477){return _0x3bdca0[_0xf757('0x9')](_0xf757('0xa'),attributes,{'tableName':_0xf757('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7224=['./whatsappAccount.attributes','exports','define','WhatsappAccount','whatsapp_accounts','lodash','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x1b0659,_0x586a89){var _0x1e3bf6=function(_0x4fb9a2){while(--_0x4fb9a2){_0x1b0659['push'](_0x1b0659['shift']());}};_0x1e3bf6(++_0x586a89);}(_0x7224,0x139));var _0x4722=function(_0x80fac1,_0x3a0990){_0x80fac1=_0x80fac1-0x0;var _0x432b8a=_0x7224[_0x80fac1];return _0x432b8a;};'use strict';var _=require(_0x4722('0x0'));var util=require('util');var logger=require(_0x4722('0x1'))(_0x4722('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4722('0x3'));var fs=require('fs');var path=require(_0x4722('0x4'));var rimraf=require('rimraf');var config=require(_0x4722('0x5'));var attributes=require(_0x4722('0x6'));module[_0x4722('0x7')]=function(_0x208b25,_0x24e4bc){return _0x208b25[_0x4722('0x8')](_0x4722('0x9'),attributes,{'tableName':_0x4722('0xa'),'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 e880be6..b3eb8cb 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 _0x29f7=['redis','defaults','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x46ec32,_0x1e842f){var _0x338f60=function(_0x10e02c){while(--_0x10e02c){_0x46ec32['push'](_0x46ec32['shift']());}};_0x338f60(++_0x1e842f);}(_0x29f7,0xf8));var _0x729f=function(_0x5d7bbc,_0xe13d14){_0x5d7bbc=_0x5d7bbc-0x0;var _0x47fc28=_0x29f7[_0x5d7bbc];return _0x47fc28;};'use strict';var _=require(_0x729f('0x0'));var util=require(_0x729f('0x1'));var moment=require(_0x729f('0x2'));var BPromise=require('bluebird');var rs=require(_0x729f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x729f('0x4'))['db'];var utils=require(_0x729f('0x5'));var logger=require(_0x729f('0x6'))('rpc');var config=require(_0x729f('0x7'));var jayson=require(_0x729f('0x8'));var client=jayson[_0x729f('0x9')][_0x729f('0xa')]({'port':0x232a});config[_0x729f('0xb')]=_[_0x729f('0xc')](config[_0x729f('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x729f('0xb')]));require('./whatsappAccount.socket')[_0x729f('0xd')](socket);function respondWithRpcPromise(_0x204367,_0x1df67e,_0x4f25f9){return new BPromise(function(_0x243516,_0x57bc32){return client[_0x729f('0xe')](_0x204367,_0x4f25f9)['then'](function(_0x20d03f){logger[_0x729f('0xf')](_0x729f('0x10'),_0x1df67e,_0x729f('0x11'));logger[_0x729f('0x12')](_0x729f('0x13'),_0x1df67e,_0x729f('0x11'),JSON['stringify'](_0x20d03f));if(_0x20d03f['error']){if(_0x20d03f[_0x729f('0x14')][_0x729f('0x15')]===0x1f4){logger['error'](_0x729f('0x10'),_0x1df67e,_0x20d03f['error'][_0x729f('0x16')]);return _0x57bc32(_0x20d03f[_0x729f('0x14')][_0x729f('0x16')]);}logger[_0x729f('0x14')](_0x729f('0x10'),_0x1df67e,_0x20d03f[_0x729f('0x14')][_0x729f('0x16')]);return _0x243516(_0x20d03f['error']['message']);}else{logger[_0x729f('0xf')](_0x729f('0x10'),_0x1df67e,_0x729f('0x11'));_0x243516(_0x20d03f[_0x729f('0x17')][_0x729f('0x16')]);}})[_0x729f('0x18')](function(_0x3779e0){logger[_0x729f('0x14')](_0x729f('0x10'),_0x1df67e,_0x3779e0);_0x57bc32(_0x3779e0);});});}exports[_0x729f('0x19')]=function(_0x2bfaba){var _0x1811b6=this;return new Promise(function(_0x2954bd,_0x351187){return db[_0x729f('0x1a')][_0x729f('0x1b')]({'raw':_0x2bfaba[_0x729f('0x1c')]?_0x2bfaba[_0x729f('0x1c')][_0x729f('0x1d')]===undefined?!![]:![]:!![],'where':_0x2bfaba[_0x729f('0x1c')]?_0x2bfaba[_0x729f('0x1c')][_0x729f('0x1e')]||null:null,'attributes':_0x2bfaba[_0x729f('0x1c')]?_0x2bfaba[_0x729f('0x1c')][_0x729f('0x1f')]||null:null,'include':_0x2bfaba[_0x729f('0x1c')]?_0x2bfaba[_0x729f('0x1c')][_0x729f('0x20')]?_[_0x729f('0x21')](_0x2bfaba['options']['include'],function(_0x4217ad){return{'model':db[_0x4217ad['model']],'as':_0x4217ad['as'],'attributes':_0x4217ad[_0x729f('0x1f')],'include':_0x4217ad[_0x729f('0x20')]?_['map'](_0x4217ad[_0x729f('0x20')],function(_0x59dcfd){return{'model':db[_0x59dcfd[_0x729f('0x22')]],'as':_0x59dcfd['as'],'attributes':_0x59dcfd[_0x729f('0x1f')],'include':_0x59dcfd['include']?_[_0x729f('0x21')](_0x59dcfd[_0x729f('0x20')],function(_0x1f5a08){return{'model':db[_0x1f5a08['model']],'as':_0x1f5a08['as'],'attributes':_0x1f5a08['attributes']};}):[]};}):[]};}):[]:[]})[_0x729f('0x23')](function(_0x49f264){logger[_0x729f('0xf')](_0x729f('0x19'),_0x2bfaba);logger['debug'](_0x729f('0x19'),_0x2bfaba,JSON[_0x729f('0x24')](_0x49f264));_0x2954bd(_0x49f264);})[_0x729f('0x18')](function(_0x4a36bd){logger['error']('ShowWhatsappAccount',_0x4a36bd[_0x729f('0x16')],_0x2bfaba);_0x351187(_0x1811b6[_0x729f('0x14')](0x1f4,_0x4a36bd[_0x729f('0x16')]));});});}; \ No newline at end of file +var _0x4ec7=['rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowWhatsappAccount','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x3d74cf,_0x16a5db){var _0x180660=function(_0x1a3443){while(--_0x1a3443){_0x3d74cf['push'](_0x3d74cf['shift']());}};_0x180660(++_0x16a5db);}(_0x4ec7,0x102));var _0x74ec=function(_0x786f28,_0x3e9fb7){_0x786f28=_0x786f28-0x0;var _0x461ccd=_0x4ec7[_0x786f28];return _0x461ccd;};'use strict';var _=require(_0x74ec('0x0'));var util=require(_0x74ec('0x1'));var moment=require(_0x74ec('0x2'));var BPromise=require(_0x74ec('0x3'));var rs=require(_0x74ec('0x4'));var fs=require('fs');var Redis=require(_0x74ec('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x74ec('0x6'));var logger=require(_0x74ec('0x7'))(_0x74ec('0x8'));var config=require('../../config/environment');var jayson=require(_0x74ec('0x9'));var client=jayson[_0x74ec('0xa')]['http']({'port':0x232a});config['redis']=_[_0x74ec('0xb')](config[_0x74ec('0xc')],{'host':_0x74ec('0xd'),'port':0x18eb});var socket=require(_0x74ec('0xe'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0x74ec('0xf')](socket);function respondWithRpcPromise(_0x480088,_0x32d228,_0x648bc9){return new BPromise(function(_0x215551,_0x443f94){return client[_0x74ec('0x10')](_0x480088,_0x648bc9)[_0x74ec('0x11')](function(_0x4eac80){logger[_0x74ec('0x12')](_0x74ec('0x13'),_0x32d228,_0x74ec('0x14'));logger[_0x74ec('0x15')](_0x74ec('0x16'),_0x32d228,'request\x20sent',JSON[_0x74ec('0x17')](_0x4eac80));if(_0x4eac80[_0x74ec('0x18')]){if(_0x4eac80[_0x74ec('0x18')][_0x74ec('0x19')]===0x1f4){logger[_0x74ec('0x18')](_0x74ec('0x13'),_0x32d228,_0x4eac80[_0x74ec('0x18')][_0x74ec('0x1a')]);return _0x443f94(_0x4eac80[_0x74ec('0x18')][_0x74ec('0x1a')]);}logger[_0x74ec('0x18')](_0x74ec('0x13'),_0x32d228,_0x4eac80[_0x74ec('0x18')]['message']);return _0x215551(_0x4eac80[_0x74ec('0x18')]['message']);}else{logger[_0x74ec('0x12')](_0x74ec('0x13'),_0x32d228,'request\x20sent');_0x215551(_0x4eac80[_0x74ec('0x1b')]['message']);}})[_0x74ec('0x1c')](function(_0xbdce06){logger[_0x74ec('0x18')]('WhatsappAccount,\x20%s,\x20%s',_0x32d228,_0xbdce06);_0x443f94(_0xbdce06);});});}exports[_0x74ec('0x1d')]=function(_0x58832f){var _0xf59f5a=this;return new Promise(function(_0x323069,_0xa467e0){return db['WhatsappAccount'][_0x74ec('0x1e')]({'raw':_0x58832f[_0x74ec('0x1f')]?_0x58832f[_0x74ec('0x1f')][_0x74ec('0x20')]===undefined?!![]:![]:!![],'where':_0x58832f[_0x74ec('0x1f')]?_0x58832f['options'][_0x74ec('0x21')]||null:null,'attributes':_0x58832f['options']?_0x58832f[_0x74ec('0x1f')][_0x74ec('0x22')]||null:null,'include':_0x58832f[_0x74ec('0x1f')]?_0x58832f[_0x74ec('0x1f')]['include']?_['map'](_0x58832f[_0x74ec('0x1f')][_0x74ec('0x23')],function(_0x3de539){return{'model':db[_0x3de539['model']],'as':_0x3de539['as'],'attributes':_0x3de539[_0x74ec('0x22')],'include':_0x3de539[_0x74ec('0x23')]?_[_0x74ec('0x24')](_0x3de539[_0x74ec('0x23')],function(_0x2f5358){return{'model':db[_0x2f5358[_0x74ec('0x25')]],'as':_0x2f5358['as'],'attributes':_0x2f5358[_0x74ec('0x22')],'include':_0x2f5358[_0x74ec('0x23')]?_[_0x74ec('0x24')](_0x2f5358[_0x74ec('0x23')],function(_0x588b7d){return{'model':db[_0x588b7d[_0x74ec('0x25')]],'as':_0x588b7d['as'],'attributes':_0x588b7d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1a4203){logger[_0x74ec('0x12')](_0x74ec('0x1d'),_0x58832f);logger[_0x74ec('0x15')]('ShowWhatsappAccount',_0x58832f,JSON[_0x74ec('0x17')](_0x1a4203));_0x323069(_0x1a4203);})[_0x74ec('0x1c')](function(_0x1f87c0){logger[_0x74ec('0x18')]('ShowWhatsappAccount',_0x1f87c0[_0x74ec('0x1a')],_0x58832f);_0xa467e0(_0xf59f5a[_0x74ec('0x18')](0x1f4,_0x1f87c0[_0x74ec('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index f8bdb12..af84180 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 _0x7a62=['update','emit','removeListener','register','whatsappAccount:','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a62,0x1c5));var _0x27a6=function(_0x4238e4,_0x176989){_0x4238e4=_0x4238e4-0x0;var _0x469a7c=_0x7a62[_0x4238e4];return _0x469a7c;};'use strict';var WhatsappAccountEvents=require('./whatsappAccount.events');var events=[_0x27a6('0x0'),_0x27a6('0x1'),_0x27a6('0x2')];function createListener(_0x3d62c5,_0x2eea38){return function(_0x290c77){_0x2eea38[_0x27a6('0x3')](_0x3d62c5,_0x290c77);};}function removeListener(_0x4186c8,_0x4de874){return function(){WhatsappAccountEvents[_0x27a6('0x4')](_0x4186c8,_0x4de874);};}exports[_0x27a6('0x5')]=function(_0x4273f8){for(var _0x1f91ae=0x0,_0x2de174=events['length'];_0x1f91ae<_0x2de174;_0x1f91ae++){var _0x428cd7=events[_0x1f91ae];var _0x3fd104=createListener(_0x27a6('0x6')+_0x428cd7,_0x4273f8);WhatsappAccountEvents['on'](_0x428cd7,_0x3fd104);}}; \ No newline at end of file +var _0x50d2=['whatsappAccount:','./whatsappAccount.events','save','remove','update','emit','removeListener','register','length'];(function(_0x567824,_0x49f9d2){var _0x15ae92=function(_0x4eed1f){while(--_0x4eed1f){_0x567824['push'](_0x567824['shift']());}};_0x15ae92(++_0x49f9d2);}(_0x50d2,0x118));var _0x250d=function(_0x34882f,_0x601a99){_0x34882f=_0x34882f-0x0;var _0x455929=_0x50d2[_0x34882f];return _0x455929;};'use strict';var WhatsappAccountEvents=require(_0x250d('0x0'));var events=[_0x250d('0x1'),_0x250d('0x2'),_0x250d('0x3')];function createListener(_0x487eb4,_0x5eb067){return function(_0x4858c9){_0x5eb067[_0x250d('0x4')](_0x487eb4,_0x4858c9);};}function removeListener(_0x1ac175,_0x584d60){return function(){WhatsappAccountEvents[_0x250d('0x5')](_0x1ac175,_0x584d60);};}exports[_0x250d('0x6')]=function(_0x4875f8){for(var _0xd7708e=0x0,_0x5c1710=events[_0x250d('0x7')];_0xd7708e<_0x5c1710;_0xd7708e++){var _0x57bb62=events[_0xd7708e];var _0x1b1824=createListener(_0x250d('0x8')+_0x57bb62,_0x4875f8);WhatsappAccountEvents['on'](_0x57bb62,_0x1b1824);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index f3cb85d..b644aa3 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 _0x209e=['../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x209e,0x66));var _0xe209=function(_0xf8fc0c,_0x435e5e){_0xf8fc0c=_0xf8fc0c-0x0;var _0x267df1=_0x209e[_0xf8fc0c];return _0x267df1;};'use strict';var multer=require(_0xe209('0x0'));var util=require(_0xe209('0x1'));var path=require(_0xe209('0x2'));var timeout=require(_0xe209('0x3'));var express=require(_0xe209('0x4'));var router=express[_0xe209('0x5')]();var fs_extra=require(_0xe209('0x6'));var auth=require(_0xe209('0x7'));var interaction=require(_0xe209('0x8'));var config=require(_0xe209('0x9'));var controller=require(_0xe209('0xa'));router[_0xe209('0xb')]('/',auth[_0xe209('0xc')](),controller[_0xe209('0xd')]);router['get'](_0xe209('0xe'),auth[_0xe209('0xc')](),controller[_0xe209('0xf')]);router[_0xe209('0x10')]('/',auth[_0xe209('0xc')](),controller[_0xe209('0x11')]);router[_0xe209('0x12')](_0xe209('0xe'),auth[_0xe209('0xc')](),controller[_0xe209('0x13')]);router[_0xe209('0x14')](_0xe209('0xe'),auth[_0xe209('0xc')](),controller[_0xe209('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8f1f=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappApplication.controller','get','index','isAuthenticated','create','put','/:id','update','destroy','exports','multer'];(function(_0x297eea,_0x5060be){var _0x1c42d2=function(_0x3afff4){while(--_0x3afff4){_0x297eea['push'](_0x297eea['shift']());}};_0x1c42d2(++_0x5060be);}(_0x8f1f,0xfe));var _0xf8f1=function(_0x337dd9,_0x54e3f3){_0x337dd9=_0x337dd9-0x0;var _0x20f4fc=_0x8f1f[_0x337dd9];return _0x20f4fc;};'use strict';var multer=require(_0xf8f1('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xf8f1('0x1'));var express=require(_0xf8f1('0x2'));var router=express[_0xf8f1('0x3')]();var fs_extra=require(_0xf8f1('0x4'));var auth=require(_0xf8f1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf8f1('0x6'));var controller=require(_0xf8f1('0x7'));router[_0xf8f1('0x8')]('/',auth['isAuthenticated'](),controller[_0xf8f1('0x9')]);router[_0xf8f1('0x8')]('/:id',auth[_0xf8f1('0xa')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf8f1('0xb')]);router[_0xf8f1('0xc')](_0xf8f1('0xd'),auth[_0xf8f1('0xa')](),controller[_0xf8f1('0xe')]);router['delete'](_0xf8f1('0xd'),auth[_0xf8f1('0xa')](),controller[_0xf8f1('0xf')]);module[_0xf8f1('0x10')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index b8a3005..73878f6 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 _0x37f5=['INTEGER','noop','STRING','*,*,*,*','sequelize','exports'];(function(_0x23563c,_0xc2f3c5){var _0xeddf50=function(_0x4d530c){while(--_0x4d530c){_0x23563c['push'](_0x23563c['shift']());}};_0xeddf50(++_0xc2f3c5);}(_0x37f5,0x166));var _0x537f=function(_0x14844a,_0x86afdd){_0x14844a=_0x14844a-0x0;var _0x5c514b=_0x37f5[_0x14844a];return _0x5c514b;};'use strict';var Sequelize=require(_0x537f('0x0'));module[_0x537f('0x1')]={'priority':{'type':Sequelize[_0x537f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x537f('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x537f('0x4')]},'interval':{'type':Sequelize[_0x537f('0x4')],'defaultValue':_0x537f('0x5')}}; \ No newline at end of file +var _0x9def=['INTEGER','noop','TEXT','STRING','*,*,*,*','exports'];(function(_0x1f55b6,_0x184533){var _0x1fd8b8=function(_0x41d1ab){while(--_0x41d1ab){_0x1f55b6['push'](_0x1f55b6['shift']());}};_0x1fd8b8(++_0x184533);}(_0x9def,0x9b));var _0xf9de=function(_0x203fa0,_0x2dcfa8){_0x203fa0=_0x203fa0-0x0;var _0x3fdf58=_0x9def[_0x203fa0];return _0x3fdf58;};'use strict';var Sequelize=require('sequelize');module[_0xf9de('0x0')]={'priority':{'type':Sequelize[_0xf9de('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf9de('0x2')},'appdata':{'type':Sequelize[_0xf9de('0x3')]()},'description':{'type':Sequelize[_0xf9de('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf9de('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index c9d0dc4..fecb24b 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 _0x3fc6=['squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','end','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','where','filter','merge','VIRTUAL','includeAll','include','WhatsappApplication','findAll','rows','catch','show','params','length','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash'];(function(_0x5e38cf,_0x49e978){var _0x1e0997=function(_0x2aeb09){while(--_0x2aeb09){_0x5e38cf['push'](_0x5e38cf['shift']());}};_0x1e0997(++_0x49e978);}(_0x3fc6,0x115));var _0x63fc=function(_0x35782b,_0x2d61ce){_0x35782b=_0x35782b-0x0;var _0xa67bd3=_0x3fc6[_0x35782b];return _0xa67bd3;};'use strict';var emlformat=require(_0x63fc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x63fc('0x1'));var jsonpatch=require(_0x63fc('0x2'));var rp=require(_0x63fc('0x3'));var moment=require(_0x63fc('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x63fc('0x5'));var util=require(_0x63fc('0x6'));var path=require(_0x63fc('0x7'));var sox=require('sox');var csv=require(_0x63fc('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x63fc('0x9'));var _=require(_0x63fc('0xa'));var squel=require(_0x63fc('0xb'));var crypto=require('crypto');var jsforce=require(_0x63fc('0xc'));var deskjs=require(_0x63fc('0xd'));var toCsv=require(_0x63fc('0x8'));var querystring=require(_0x63fc('0xe'));var Papa=require(_0x63fc('0xf'));var Redis=require('ioredis');var authService=require(_0x63fc('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63fc('0x11'));var logger=require(_0x63fc('0x12'))(_0x63fc('0x13'));var utils=require(_0x63fc('0x14'));var config=require(_0x63fc('0x15'));var licenseUtil=require(_0x63fc('0x16'));var db=require(_0x63fc('0x17'))['db'];function respondWithStatusCode(_0x4584fe,_0x581d62){_0x581d62=_0x581d62||0xcc;return function(_0x2a6cb9){if(_0x2a6cb9){return _0x4584fe[_0x63fc('0x18')](_0x581d62);}return _0x4584fe[_0x63fc('0x19')](_0x581d62)['end']();};}function respondWithResult(_0x265e98,_0x16275b){_0x16275b=_0x16275b||0xc8;return function(_0x3979f4){if(_0x3979f4){return _0x265e98['status'](_0x16275b)[_0x63fc('0x1a')](_0x3979f4);}};}function respondWithFilteredResult(_0x2e837c,_0x426479){return function(_0x25557e){if(_0x25557e){var _0x1584d8=typeof _0x426479[_0x63fc('0x1b')]===_0x63fc('0x1c')&&typeof _0x426479[_0x63fc('0x1d')]===_0x63fc('0x1c');var _0x13612e=_0x25557e[_0x63fc('0x1e')];var _0x2db18b=_0x1584d8?0x0:_0x426479[_0x63fc('0x1b')];var _0x2e1fb8=_0x1584d8?_0x25557e['count']:_0x426479[_0x63fc('0x1b')]+_0x426479[_0x63fc('0x1d')];var _0x2db848;if(_0x2e1fb8>=_0x13612e){_0x2e1fb8=_0x13612e;_0x2db848=0xc8;}else{_0x2db848=0xce;}_0x2e837c[_0x63fc('0x19')](_0x2db848);return _0x2e837c[_0x63fc('0x1f')]('Content-Range',_0x2db18b+'-'+_0x2e1fb8+'/'+_0x13612e)[_0x63fc('0x1a')](_0x25557e);}return null;};}function patchUpdates(_0x2c05ef){return function(_0x404a9c){try{jsonpatch['apply'](_0x404a9c,_0x2c05ef,!![]);}catch(_0x5eb35d){return BPromise[_0x63fc('0x20')](_0x5eb35d);}return _0x404a9c[_0x63fc('0x21')]();};}function saveUpdates(_0x457b9e,_0x5810b8){return function(_0x1053c7){if(_0x1053c7){return _0x1053c7[_0x63fc('0x22')](_0x457b9e)[_0x63fc('0x23')](function(_0x5d5c42){return _0x5d5c42;});}return null;};}function removeEntity(_0x2bf535,_0x4cd542){return function(_0x1b012e){if(_0x1b012e){return _0x1b012e['destroy']()[_0x63fc('0x23')](function(){_0x2bf535[_0x63fc('0x19')](0xcc)[_0x63fc('0x24')]();});}};}function handleEntityNotFound(_0x327dc2,_0x1a349d){return function(_0x214424){if(!_0x214424){_0x327dc2['sendStatus'](0x194);}return _0x214424;};}function handleError(_0x2865a7,_0x39ceb0){_0x39ceb0=_0x39ceb0||0x1f4;return function(_0x2dda64){logger['error'](_0x2dda64[_0x63fc('0x25')]);if(_0x2dda64['name']){delete _0x2dda64[_0x63fc('0x26')];}_0x2865a7['status'](_0x39ceb0)[_0x63fc('0x27')](_0x2dda64);};}exports[_0x63fc('0x28')]=function(_0x5a2c94,_0xc0d30f){var _0x380bea={},_0x27bfb5={},_0x2deb6d={'count':0x0,'rows':[]};var _0x59e18b=_[_0x63fc('0x29')](db['WhatsappApplication'][_0x63fc('0x2a')],function(_0x138083){return{'name':_0x138083['fieldName'],'type':_0x138083[_0x63fc('0x2b')][_0x63fc('0x2c')]};});_0x27bfb5[_0x63fc('0x2d')]=_[_0x63fc('0x29')](_0x59e18b,_0x63fc('0x26'));_0x27bfb5[_0x63fc('0x2e')]=_[_0x63fc('0x2f')](_0x5a2c94[_0x63fc('0x2e')]);_0x27bfb5[_0x63fc('0x30')]=_[_0x63fc('0x31')](_0x27bfb5['model'],_0x27bfb5[_0x63fc('0x2e')]);_0x380bea['attributes']=_[_0x63fc('0x31')](_0x27bfb5[_0x63fc('0x2d')],qs[_0x63fc('0x32')](_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x32')]));_0x380bea[_0x63fc('0x33')]=_0x380bea[_0x63fc('0x33')]['length']?_0x380bea[_0x63fc('0x33')]:_0x27bfb5[_0x63fc('0x2d')];if(!_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x34')]('nolimit')){_0x380bea['limit']=qs[_0x63fc('0x1d')](_0x5a2c94['query'][_0x63fc('0x1d')]);_0x380bea[_0x63fc('0x1b')]=qs[_0x63fc('0x1b')](_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x1b')]);}_0x380bea[_0x63fc('0x35')]=qs['sort'](_0x5a2c94[_0x63fc('0x2e')]['sort']);_0x380bea[_0x63fc('0x36')]=qs[_0x63fc('0x30')](_['pick'](_0x5a2c94[_0x63fc('0x2e')],_0x27bfb5[_0x63fc('0x30')]),_0x59e18b);if(_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x37')]){_0x380bea[_0x63fc('0x36')]=_[_0x63fc('0x38')](_0x380bea[_0x63fc('0x36')],{'$or':_[_0x63fc('0x29')](_0x59e18b,function(_0x319b91){if(_0x319b91[_0x63fc('0x2b')]!==_0x63fc('0x39')){var _0xc29819={};_0xc29819[_0x319b91[_0x63fc('0x26')]]={'$like':'%'+_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x37')]+'%'};return _0xc29819;}})});}_0x380bea=_['merge']({},_0x380bea,_0x5a2c94['options']);var _0x50f6e6={'where':_0x380bea[_0x63fc('0x36')]};return db['WhatsappApplication'][_0x63fc('0x1e')](_0x50f6e6)['then'](function(_0x106b3c){_0x2deb6d[_0x63fc('0x1e')]=_0x106b3c;if(_0x5a2c94[_0x63fc('0x2e')][_0x63fc('0x3a')]){_0x380bea[_0x63fc('0x3b')]=[{'all':!![]}];}return db[_0x63fc('0x3c')][_0x63fc('0x3d')](_0x380bea);})['then'](function(_0x48cce1){_0x2deb6d[_0x63fc('0x3e')]=_0x48cce1;return _0x2deb6d;})[_0x63fc('0x23')](respondWithFilteredResult(_0xc0d30f,_0x380bea))[_0x63fc('0x3f')](handleError(_0xc0d30f,null));};exports[_0x63fc('0x40')]=function(_0x3f8abe,_0x37cf7c){var _0x132aa0={'raw':!![],'where':{'id':_0x3f8abe[_0x63fc('0x41')]['id']}},_0x30d614={};_0x30d614[_0x63fc('0x2d')]=_[_0x63fc('0x2f')](db['WhatsappApplication'][_0x63fc('0x2a')]);_0x30d614['query']=_['keys'](_0x3f8abe[_0x63fc('0x2e')]);_0x30d614[_0x63fc('0x30')]=_['intersection'](_0x30d614[_0x63fc('0x2d')],_0x30d614[_0x63fc('0x2e')]);_0x132aa0[_0x63fc('0x33')]=_['intersection'](_0x30d614['model'],qs[_0x63fc('0x32')](_0x3f8abe[_0x63fc('0x2e')][_0x63fc('0x32')]));_0x132aa0[_0x63fc('0x33')]=_0x132aa0['attributes'][_0x63fc('0x42')]?_0x132aa0[_0x63fc('0x33')]:_0x30d614[_0x63fc('0x2d')];if(_0x3f8abe[_0x63fc('0x2e')]['includeAll']){_0x132aa0[_0x63fc('0x3b')]=[{'all':!![]}];}_0x132aa0=_[_0x63fc('0x38')]({},_0x132aa0,_0x3f8abe[_0x63fc('0x43')]);return db[_0x63fc('0x3c')][_0x63fc('0x44')](_0x132aa0)[_0x63fc('0x23')](handleEntityNotFound(_0x37cf7c,null))[_0x63fc('0x23')](respondWithResult(_0x37cf7c,null))[_0x63fc('0x3f')](handleError(_0x37cf7c,null));};exports[_0x63fc('0x45')]=function(_0x401757,_0x31d097){return db['WhatsappApplication']['create'](_0x401757[_0x63fc('0x46')],{})[_0x63fc('0x23')](respondWithResult(_0x31d097,0xc9))[_0x63fc('0x3f')](handleError(_0x31d097,null));};exports[_0x63fc('0x22')]=function(_0x1b75bf,_0x54f7bd){if(_0x1b75bf['body']['id']){delete _0x1b75bf['body']['id'];}return db['WhatsappApplication']['find']({'where':{'id':_0x1b75bf['params']['id']}})[_0x63fc('0x23')](handleEntityNotFound(_0x54f7bd,null))['then'](saveUpdates(_0x1b75bf[_0x63fc('0x46')],null))['then'](respondWithResult(_0x54f7bd,null))[_0x63fc('0x3f')](handleError(_0x54f7bd,null));};exports[_0x63fc('0x47')]=function(_0x3348f8,_0x4168df){return db['WhatsappApplication'][_0x63fc('0x44')]({'where':{'id':_0x3348f8['params']['id']}})['then'](handleEntityNotFound(_0x4168df,null))['then'](removeEntity(_0x4168df,null))[_0x63fc('0x3f')](handleError(_0x4168df,null));}; \ No newline at end of file +var _0x44fe=['limit','count','set','Content-Range','json','reject','save','then','error','stack','name','index','map','WhatsappApplication','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','keys','rawAttributes','includeAll','find','create','update','body','params','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined'];(function(_0x1ae334,_0x554572){var _0x171838=function(_0x47b26a){while(--_0x47b26a){_0x1ae334['push'](_0x1ae334['shift']());}};_0x171838(++_0x554572);}(_0x44fe,0x16f));var _0xe44f=function(_0x9393c7,_0x120145){_0x9393c7=_0x9393c7-0x0;var _0x4d5569=_0x44fe[_0x9393c7];return _0x4d5569;};'use strict';var emlformat=require(_0xe44f('0x0'));var rimraf=require(_0xe44f('0x1'));var zipdir=require(_0xe44f('0x2'));var jsonpatch=require(_0xe44f('0x3'));var rp=require(_0xe44f('0x4'));var moment=require(_0xe44f('0x5'));var BPromise=require(_0xe44f('0x6'));var Mustache=require(_0xe44f('0x7'));var util=require(_0xe44f('0x8'));var path=require(_0xe44f('0x9'));var sox=require(_0xe44f('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe44f('0xb'));var _=require(_0xe44f('0xc'));var squel=require('squel');var crypto=require(_0xe44f('0xd'));var jsforce=require(_0xe44f('0xe'));var deskjs=require(_0xe44f('0xf'));var toCsv=require(_0xe44f('0x10'));var querystring=require(_0xe44f('0x11'));var Papa=require('papaparse');var Redis=require(_0xe44f('0x12'));var authService=require(_0xe44f('0x13'));var qs=require(_0xe44f('0x14'));var as=require(_0xe44f('0x15'));var hardwareService=require(_0xe44f('0x16'));var logger=require(_0xe44f('0x17'))(_0xe44f('0x18'));var utils=require(_0xe44f('0x19'));var config=require(_0xe44f('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0xe44f('0x1b'))['db'];function respondWithStatusCode(_0x1cecdf,_0x54ac3e){_0x54ac3e=_0x54ac3e||0xcc;return function(_0x3883b0){if(_0x3883b0){return _0x1cecdf[_0xe44f('0x1c')](_0x54ac3e);}return _0x1cecdf[_0xe44f('0x1d')](_0x54ac3e)[_0xe44f('0x1e')]();};}function respondWithResult(_0x3c78e1,_0x2e2942){_0x2e2942=_0x2e2942||0xc8;return function(_0x3ec218){if(_0x3ec218){return _0x3c78e1[_0xe44f('0x1d')](_0x2e2942)['json'](_0x3ec218);}};}function respondWithFilteredResult(_0x230344,_0x1fa09f){return function(_0x9ccdfd){if(_0x9ccdfd){var _0x190fec=typeof _0x1fa09f[_0xe44f('0x1f')]===_0xe44f('0x20')&&typeof _0x1fa09f[_0xe44f('0x21')]===_0xe44f('0x20');var _0x396c29=_0x9ccdfd[_0xe44f('0x22')];var _0x163af0=_0x190fec?0x0:_0x1fa09f[_0xe44f('0x1f')];var _0x4c70e5=_0x190fec?_0x9ccdfd['count']:_0x1fa09f[_0xe44f('0x1f')]+_0x1fa09f[_0xe44f('0x21')];var _0x2767ef;if(_0x4c70e5>=_0x396c29){_0x4c70e5=_0x396c29;_0x2767ef=0xc8;}else{_0x2767ef=0xce;}_0x230344[_0xe44f('0x1d')](_0x2767ef);return _0x230344[_0xe44f('0x23')](_0xe44f('0x24'),_0x163af0+'-'+_0x4c70e5+'/'+_0x396c29)[_0xe44f('0x25')](_0x9ccdfd);}return null;};}function patchUpdates(_0x239ef5){return function(_0xecbcfe){try{jsonpatch['apply'](_0xecbcfe,_0x239ef5,!![]);}catch(_0x487bca){return BPromise[_0xe44f('0x26')](_0x487bca);}return _0xecbcfe[_0xe44f('0x27')]();};}function saveUpdates(_0x298b90,_0x3f7ef8){return function(_0xf3c259){if(_0xf3c259){return _0xf3c259['update'](_0x298b90)['then'](function(_0x412b36){return _0x412b36;});}return null;};}function removeEntity(_0x1bb107,_0x1cc44e){return function(_0x20c7aa){if(_0x20c7aa){return _0x20c7aa['destroy']()[_0xe44f('0x28')](function(){_0x1bb107[_0xe44f('0x1d')](0xcc)[_0xe44f('0x1e')]();});}};}function handleEntityNotFound(_0x90d216,_0x59667c){return function(_0x45a632){if(!_0x45a632){_0x90d216[_0xe44f('0x1c')](0x194);}return _0x45a632;};}function handleError(_0x2659fa,_0x4bed14){_0x4bed14=_0x4bed14||0x1f4;return function(_0x4e3cce){logger[_0xe44f('0x29')](_0x4e3cce[_0xe44f('0x2a')]);if(_0x4e3cce[_0xe44f('0x2b')]){delete _0x4e3cce['name'];}_0x2659fa[_0xe44f('0x1d')](_0x4bed14)['send'](_0x4e3cce);};}exports[_0xe44f('0x2c')]=function(_0x28b761,_0x2a1f96){var _0x50eba5={},_0x4a81a9={},_0x595f69={'count':0x0,'rows':[]};var _0x4f9ca8=_[_0xe44f('0x2d')](db[_0xe44f('0x2e')]['rawAttributes'],function(_0x23f70d){return{'name':_0x23f70d[_0xe44f('0x2f')],'type':_0x23f70d[_0xe44f('0x30')][_0xe44f('0x31')]};});_0x4a81a9[_0xe44f('0x32')]=_[_0xe44f('0x2d')](_0x4f9ca8,'name');_0x4a81a9[_0xe44f('0x33')]=_['keys'](_0x28b761[_0xe44f('0x33')]);_0x4a81a9[_0xe44f('0x34')]=_[_0xe44f('0x35')](_0x4a81a9['model'],_0x4a81a9[_0xe44f('0x33')]);_0x50eba5['attributes']=_[_0xe44f('0x35')](_0x4a81a9[_0xe44f('0x32')],qs[_0xe44f('0x36')](_0x28b761['query']['fields']));_0x50eba5[_0xe44f('0x37')]=_0x50eba5[_0xe44f('0x37')][_0xe44f('0x38')]?_0x50eba5[_0xe44f('0x37')]:_0x4a81a9['model'];if(!_0x28b761[_0xe44f('0x33')][_0xe44f('0x39')]('nolimit')){_0x50eba5[_0xe44f('0x21')]=qs[_0xe44f('0x21')](_0x28b761['query'][_0xe44f('0x21')]);_0x50eba5[_0xe44f('0x1f')]=qs[_0xe44f('0x1f')](_0x28b761[_0xe44f('0x33')][_0xe44f('0x1f')]);}_0x50eba5[_0xe44f('0x3a')]=qs['sort'](_0x28b761['query'][_0xe44f('0x3b')]);_0x50eba5['where']=qs[_0xe44f('0x34')](_[_0xe44f('0x3c')](_0x28b761['query'],_0x4a81a9[_0xe44f('0x34')]),_0x4f9ca8);if(_0x28b761[_0xe44f('0x33')][_0xe44f('0x3d')]){_0x50eba5[_0xe44f('0x3e')]=_[_0xe44f('0x3f')](_0x50eba5[_0xe44f('0x3e')],{'$or':_[_0xe44f('0x2d')](_0x4f9ca8,function(_0x135cc2){if(_0x135cc2[_0xe44f('0x30')]!==_0xe44f('0x40')){var _0x34a7ce={};_0x34a7ce[_0x135cc2[_0xe44f('0x2b')]]={'$like':'%'+_0x28b761[_0xe44f('0x33')][_0xe44f('0x3d')]+'%'};return _0x34a7ce;}})});}_0x50eba5=_[_0xe44f('0x3f')]({},_0x50eba5,_0x28b761[_0xe44f('0x41')]);var _0x37a15f={'where':_0x50eba5[_0xe44f('0x3e')]};return db[_0xe44f('0x2e')]['count'](_0x37a15f)['then'](function(_0x22d813){_0x595f69[_0xe44f('0x22')]=_0x22d813;if(_0x28b761['query']['includeAll']){_0x50eba5[_0xe44f('0x42')]=[{'all':!![]}];}return db[_0xe44f('0x2e')][_0xe44f('0x43')](_0x50eba5);})[_0xe44f('0x28')](function(_0x5b38ac){_0x595f69[_0xe44f('0x44')]=_0x5b38ac;return _0x595f69;})[_0xe44f('0x28')](respondWithFilteredResult(_0x2a1f96,_0x50eba5))[_0xe44f('0x45')](handleError(_0x2a1f96,null));};exports[_0xe44f('0x46')]=function(_0x102abe,_0x3b85a9){var _0x481d88={'raw':!![],'where':{'id':_0x102abe['params']['id']}},_0x1012ee={};_0x1012ee[_0xe44f('0x32')]=_[_0xe44f('0x47')](db[_0xe44f('0x2e')][_0xe44f('0x48')]);_0x1012ee['query']=_['keys'](_0x102abe[_0xe44f('0x33')]);_0x1012ee[_0xe44f('0x34')]=_['intersection'](_0x1012ee['model'],_0x1012ee['query']);_0x481d88[_0xe44f('0x37')]=_[_0xe44f('0x35')](_0x1012ee['model'],qs[_0xe44f('0x36')](_0x102abe['query'][_0xe44f('0x36')]));_0x481d88['attributes']=_0x481d88['attributes'][_0xe44f('0x38')]?_0x481d88[_0xe44f('0x37')]:_0x1012ee[_0xe44f('0x32')];if(_0x102abe[_0xe44f('0x33')][_0xe44f('0x49')]){_0x481d88[_0xe44f('0x42')]=[{'all':!![]}];}_0x481d88=_['merge']({},_0x481d88,_0x102abe[_0xe44f('0x41')]);return db['WhatsappApplication'][_0xe44f('0x4a')](_0x481d88)[_0xe44f('0x28')](handleEntityNotFound(_0x3b85a9,null))[_0xe44f('0x28')](respondWithResult(_0x3b85a9,null))[_0xe44f('0x45')](handleError(_0x3b85a9,null));};exports[_0xe44f('0x4b')]=function(_0x4ff26c,_0x1258b7){return db['WhatsappApplication']['create'](_0x4ff26c['body'],{})[_0xe44f('0x28')](respondWithResult(_0x1258b7,0xc9))[_0xe44f('0x45')](handleError(_0x1258b7,null));};exports[_0xe44f('0x4c')]=function(_0x3581af,_0x5a64e0){if(_0x3581af[_0xe44f('0x4d')]['id']){delete _0x3581af[_0xe44f('0x4d')]['id'];}return db['WhatsappApplication'][_0xe44f('0x4a')]({'where':{'id':_0x3581af[_0xe44f('0x4e')]['id']}})[_0xe44f('0x28')](handleEntityNotFound(_0x5a64e0,null))[_0xe44f('0x28')](saveUpdates(_0x3581af['body'],null))[_0xe44f('0x28')](respondWithResult(_0x5a64e0,null))[_0xe44f('0x45')](handleError(_0x5a64e0,null));};exports[_0xe44f('0x4f')]=function(_0x10d6f1,_0xfdba22){return db['WhatsappApplication'][_0xe44f('0x4a')]({'where':{'id':_0x10d6f1[_0xe44f('0x4e')]['id']}})[_0xe44f('0x28')](handleEntityNotFound(_0xfdba22,null))[_0xe44f('0x28')](removeEntity(_0xfdba22,null))[_0xe44f('0x45')](handleError(_0xfdba22,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 6199982..a132d27 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 _0xedd9=['./whatsappApplication.attributes','exports','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x56d2fd,_0x51ad5d){var _0xe8a180=function(_0xe0ceae){while(--_0xe0ceae){_0x56d2fd['push'](_0x56d2fd['shift']());}};_0xe8a180(++_0x51ad5d);}(_0xedd9,0xfc));var _0x9edd=function(_0x3cdbab,_0x683380){_0x3cdbab=_0x3cdbab-0x0;var _0x4b9c8a=_0xedd9[_0x3cdbab];return _0x4b9c8a;};'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':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9edd('0xb'),'collate':_0x9edd('0xc')});}; \ No newline at end of file +var _0xef8b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api'];(function(_0x3c957d,_0x40d8f3){var _0x46ab64=function(_0x470663){while(--_0x470663){_0x3c957d['push'](_0x3c957d['shift']());}};_0x46ab64(++_0x40d8f3);}(_0xef8b,0x192));var _0xbef8=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0xef8b[_0x4b12ae];return _0x16957b;};'use strict';var _=require('lodash');var util=require(_0xbef8('0x0'));var logger=require(_0xbef8('0x1'))(_0xbef8('0x2'));var moment=require(_0xbef8('0x3'));var BPromise=require(_0xbef8('0x4'));var rp=require(_0xbef8('0x5'));var fs=require('fs');var path=require(_0xbef8('0x6'));var rimraf=require(_0xbef8('0x7'));var config=require(_0xbef8('0x8'));var attributes=require(_0xbef8('0x9'));module[_0xbef8('0xa')]=function(_0x550cb1,_0x1dd4a3){return _0x550cb1[_0xbef8('0xb')](_0xbef8('0xc'),attributes,{'tableName':'whatsapp_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbef8('0xd'),'collate':_0xbef8('0xe')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index 07e98e1..d855f35 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 _0xfd28=['error','code','message','info','result','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','WhatsappApplication,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x4bfb89,_0x3632c4){var _0x35ac61=function(_0x3e6e43){while(--_0x3e6e43){_0x4bfb89['push'](_0x4bfb89['shift']());}};_0x35ac61(++_0x3632c4);}(_0xfd28,0x148));var _0x8fd2=function(_0x215dc8,_0x52c245){_0x215dc8=_0x215dc8-0x0;var _0x583ea3=_0xfd28[_0x215dc8];return _0x583ea3;};'use strict';var _=require('lodash');var util=require(_0x8fd2('0x0'));var moment=require(_0x8fd2('0x1'));var BPromise=require('bluebird');var rs=require(_0x8fd2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd2('0x3'))['db'];var utils=require(_0x8fd2('0x4'));var logger=require(_0x8fd2('0x5'))('rpc');var config=require(_0x8fd2('0x6'));var jayson=require(_0x8fd2('0x7'));var client=jayson[_0x8fd2('0x8')][_0x8fd2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f0afc,_0x4bdc1a,_0x53d938){return new BPromise(function(_0x10fccf,_0x466c3d){return client[_0x8fd2('0xa')](_0x2f0afc,_0x53d938)['then'](function(_0x13cc69){logger['info'](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');logger[_0x8fd2('0xc')]('WhatsappApplication,\x20%s,\x20%s,\x20%s',_0x4bdc1a,_0x8fd2('0xd'),JSON['stringify'](_0x13cc69));if(_0x13cc69[_0x8fd2('0xe')]){if(_0x13cc69['error'][_0x8fd2('0xf')]===0x1f4){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x466c3d(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);return _0x10fccf(_0x13cc69[_0x8fd2('0xe')][_0x8fd2('0x10')]);}else{logger[_0x8fd2('0x11')](_0x8fd2('0xb'),_0x4bdc1a,'request\x20sent');_0x10fccf(_0x13cc69[_0x8fd2('0x12')]['message']);}})['catch'](function(_0x56f75d){logger[_0x8fd2('0xe')](_0x8fd2('0xb'),_0x4bdc1a,_0x56f75d);_0x466c3d(_0x56f75d);});});} \ No newline at end of file +var _0x008c=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','WhatsappApplication,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','WhatsappApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x008c,0x188));var _0xc008=function(_0x2f379a,_0x53382d){_0x2f379a=_0x2f379a-0x0;var _0x305249=_0x008c[_0x2f379a];return _0x305249;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var BPromise=require(_0xc008('0x3'));var rs=require(_0xc008('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc008('0x5'))['db'];var utils=require(_0xc008('0x6'));var logger=require(_0xc008('0x7'))(_0xc008('0x8'));var config=require(_0xc008('0x9'));var jayson=require(_0xc008('0xa'));var client=jayson[_0xc008('0xb')][_0xc008('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x9c8cb2,_0x4af530,_0x428fa9){return new BPromise(function(_0x5aa09b,_0x30be38){return client['request'](_0x9c8cb2,_0x428fa9)['then'](function(_0x27830d){logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');logger['debug'](_0xc008('0xe'),_0x4af530,_0xc008('0xf'),JSON['stringify'](_0x27830d));if(_0x27830d[_0xc008('0x10')]){if(_0x27830d[_0xc008('0x10')][_0xc008('0x11')]===0x1f4){logger[_0xc008('0x10')](_0xc008('0x12'),_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x30be38(_0x27830d['error']['message']);}logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);return _0x5aa09b(_0x27830d[_0xc008('0x10')][_0xc008('0x13')]);}else{logger[_0xc008('0xd')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,'request\x20sent');_0x5aa09b(_0x27830d['result'][_0xc008('0x13')]);}})[_0xc008('0x14')](function(_0x3cafe3){logger[_0xc008('0x10')]('WhatsappApplication,\x20%s,\x20%s',_0x4af530,_0x3cafe3);_0x30be38(_0x3cafe3);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index 30b9aad..653f0b3 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 _0x7217=['/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','whatsappinteraction:addtags','addTags','whatsapp','whatsappinteraction:update','update','whatsappinteraction:destroy','destroy','delete','removeTags','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x5508ba,_0x4b3483){var _0x51d747=function(_0x2b2654){while(--_0x2b2654){_0x5508ba['push'](_0x5508ba['shift']());}};_0x51d747(++_0x4b3483);}(_0x7217,0x19e));var _0x7721=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x7217[_0x4dbaad];return _0x226c72;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x13')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0x14')]);router['post'](_0x7721('0xf'),auth[_0x7721('0x9')](),controller['addMessage']);router[_0x7721('0x13')](_0x7721('0x15'),auth[_0x7721('0x9')](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x17')),controller[_0x7721('0x18')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x7721('0x16')](_0x7721('0x19'),_0x7721('0x1a')),controller[_0x7721('0x1b')]);router['delete'](_0x7721('0xd'),auth['isAuthenticated'](),interaction[_0x7721('0x16')]('whatsapp',_0x7721('0x1c')),controller[_0x7721('0x1d')]);router[_0x7721('0x1e')](_0x7721('0x15'),auth[_0x7721('0x9')](),controller[_0x7721('0x1f')]);module[_0x7721('0x20')]=router; \ No newline at end of file +var _0x8f9d=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappInteraction.controller','isAuthenticated','index','get','/describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','whatsapp','addTags','put','whatsappinteraction:update','destroy','removeTags','multer','path','express'];(function(_0xc4baf4,_0x3c4e09){var _0x340458=function(_0x38cb34){while(--_0x38cb34){_0xc4baf4['push'](_0xc4baf4['shift']());}};_0x340458(++_0x3c4e09);}(_0x8f9d,0x93));var _0xd8f9=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f9d[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xd8f9('0x0'));var util=require('util');var path=require(_0xd8f9('0x1'));var timeout=require('connect-timeout');var express=require(_0xd8f9('0x2'));var router=express[_0xd8f9('0x3')]();var fs_extra=require(_0xd8f9('0x4'));var auth=require(_0xd8f9('0x5'));var interaction=require(_0xd8f9('0x6'));var config=require(_0xd8f9('0x7'));var controller=require(_0xd8f9('0x8'));router['get']('/',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xa')]);router[_0xd8f9('0xb')](_0xd8f9('0xc'),auth[_0xd8f9('0x9')](),controller['describe']);router[_0xd8f9('0xb')](_0xd8f9('0xd'),auth['isAuthenticated'](),controller[_0xd8f9('0xe')]);router['get']('/:id/messages',auth[_0xd8f9('0x9')](),controller[_0xd8f9('0xf')]);router[_0xd8f9('0xb')](_0xd8f9('0x10'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x11')]);router[_0xd8f9('0x12')]('/',auth['isAuthenticated'](),controller[_0xd8f9('0x13')]);router['post'](_0xd8f9('0x14'),auth[_0xd8f9('0x9')](),controller[_0xd8f9('0x15')]);router['post'](_0xd8f9('0x16'),auth[_0xd8f9('0x9')](),interaction[_0xd8f9('0x17')](_0xd8f9('0x18'),'whatsappinteraction:addtags'),controller[_0xd8f9('0x19')]);router[_0xd8f9('0x1a')](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),interaction[_0xd8f9('0x17')](_0xd8f9('0x18'),_0xd8f9('0x1b')),controller['update']);router['delete'](_0xd8f9('0xd'),auth[_0xd8f9('0x9')](),interaction['tracked'](_0xd8f9('0x18'),'whatsappinteraction:destroy'),controller[_0xd8f9('0x1c')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xd8f9('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.attributes.js b/server/api/whatsappInteraction/whatsappInteraction.attributes.js index 241700b..ad0176d 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 _0x91c6=['STRING','ENUM','out','sequelize','BOOLEAN','DATE'];(function(_0x281e94,_0x4bdb61){var _0x442eb5=function(_0x675166){while(--_0x675166){_0x281e94['push'](_0x281e94['shift']());}};_0x442eb5(++_0x4bdb61);}(_0x91c6,0xf9));var _0x691c=function(_0x2f7bad,_0x46c387){_0x2f7bad=_0x2f7bad-0x0;var _0x15cebc=_0x91c6[_0x2f7bad];return _0x15cebc;};'use strict';var Sequelize=require(_0x691c('0x0'));var moment=require('moment');module['exports']={'closed':{'type':Sequelize[_0x691c('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x691c('0x2')]},'disposition':{'type':Sequelize[_0x691c('0x3')]},'secondDisposition':{'type':Sequelize[_0x691c('0x3')]},'thirdDisposition':{'type':Sequelize[_0x691c('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x691c('0x3')]},'read1stAt':{'type':Sequelize[_0x691c('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x691c('0x4')]('in',_0x691c('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x691c('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x691c('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x691c('0x1')],'defaultValue':![]}}; \ No newline at end of file +var _0xc23a=['moment','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0x4431f0,_0x4ba425){var _0x5f031d=function(_0x2b484a){while(--_0x2b484a){_0x4431f0['push'](_0x4431f0['shift']());}};_0x5f031d(++_0x4ba425);}(_0xc23a,0xd2));var _0xac23=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xc23a[_0x20589d];return _0x422de9;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xac23('0x0'));module[_0xac23('0x1')]={'closed':{'type':Sequelize[_0xac23('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xac23('0x3')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xac23('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0xac23('0x4')]},'firstMsgDirection':{'type':Sequelize[_0xac23('0x5')]('in',_0xac23('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xac23('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xac23('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 a9d288e..25f2928 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 _0xcd2f=['renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','log','err','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','error','name','Users','fullname','TagIds','forEach','Tags','push','catch','waiting','talking','unmanaged','closed','UserId','answered','total','index','map','WhatsappInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','tools_tags','select','u.fullname','from','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','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','conditions','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','buildExpression','text','isEmpty','WhatsappAccountId','concat','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','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?','group','i.id','Sequelize','SELECT','clone','unreadMessages','contactName','DESC','resolve','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','show','includeAll','include','create','body','params','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','format','addTags','setTags','spread','findAll','whatsappInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','firstName','lastName','Attachment','Messages','direction','secret','WhatsappAccount','Account','Owner','get','Whatsapp','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','disposition','basename','createReadStream','pipe','out','System'];(function(_0x24c2eb,_0x361b49){var _0x582aee=function(_0x1b2db7){while(--_0x1b2db7){_0x24c2eb['push'](_0x24c2eb['shift']());}};_0x582aee(++_0x361b49);}(_0xcd2f,0xf8));var _0xfcd2=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xcd2f[_0x580576];return _0x3f55a0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xfcd2('0x0'));var rp=require(_0xfcd2('0x1'));var moment=require(_0xfcd2('0x2'));var BPromise=require(_0xfcd2('0x3'));var Mustache=require(_0xfcd2('0x4'));var util=require(_0xfcd2('0x5'));var path=require(_0xfcd2('0x6'));var sox=require(_0xfcd2('0x7'));var csv=require('to-csv');var ejs=require(_0xfcd2('0x8'));var fs=require('fs');var fs_extra=require(_0xfcd2('0x9'));var _=require(_0xfcd2('0xa'));var squel=require(_0xfcd2('0xb'));var crypto=require(_0xfcd2('0xc'));var jsforce=require(_0xfcd2('0xd'));var deskjs=require(_0xfcd2('0xe'));var toCsv=require(_0xfcd2('0xf'));var querystring=require(_0xfcd2('0x10'));var Papa=require(_0xfcd2('0x11'));var Redis=require(_0xfcd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xfcd2('0x13'));var as=require(_0xfcd2('0x14'));var pdf=require(_0xfcd2('0x15'));var hardwareService=require(_0xfcd2('0x16'));var logger=require(_0xfcd2('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfcd2('0x18')]=_[_0xfcd2('0x19')](config['redis'],{'host':_0xfcd2('0x1a'),'port':0x18eb});var socket=require(_0xfcd2('0x1b'))(new Redis(config['redis']));require('./whatsappInteraction.socket')[_0xfcd2('0x1c')](socket);function respondWithStatusCode(_0x42240c,_0x5cfe83){_0x5cfe83=_0x5cfe83||0xcc;return function(_0x4baf2f){if(_0x4baf2f){return _0x42240c[_0xfcd2('0x1d')](_0x5cfe83);}return _0x42240c['status'](_0x5cfe83)[_0xfcd2('0x1e')]();};}function respondWithResult(_0x21d088,_0x36a06d){_0x36a06d=_0x36a06d||0xc8;return function(_0x34aa38){if(_0x34aa38){return _0x21d088[_0xfcd2('0x1f')](_0x36a06d)[_0xfcd2('0x20')](_0x34aa38);}};}function respondWithFilteredResult(_0x4dc58e,_0xba3186){return function(_0x268e00){if(_0x268e00){var _0x32607c=typeof _0xba3186[_0xfcd2('0x21')]===_0xfcd2('0x22')&&typeof _0xba3186[_0xfcd2('0x23')]===_0xfcd2('0x22');var _0x25371f=_0x268e00[_0xfcd2('0x24')];var _0x40666e=_0x32607c?0x0:_0xba3186[_0xfcd2('0x21')];var _0x266c86=_0x32607c?_0x268e00['count']:_0xba3186[_0xfcd2('0x21')]+_0xba3186[_0xfcd2('0x23')];var _0x25e801;if(_0x266c86>=_0x25371f){_0x266c86=_0x25371f;_0x25e801=0xc8;}else{_0x25e801=0xce;}_0x4dc58e[_0xfcd2('0x1f')](_0x25e801);return _0x4dc58e[_0xfcd2('0x25')](_0xfcd2('0x26'),_0x40666e+'-'+_0x266c86+'/'+_0x25371f)[_0xfcd2('0x20')](_0x268e00);}return null;};}function patchUpdates(_0x40ae55){return function(_0x65ee50){try{jsonpatch['apply'](_0x65ee50,_0x40ae55,!![]);}catch(_0x23104f){return BPromise['reject'](_0x23104f);}return _0x65ee50[_0xfcd2('0x27')]();};}function saveUpdates(_0x9baa91,_0x4f220e){return function(_0x567436){if(_0x567436){return _0x567436[_0xfcd2('0x28')](_0x9baa91)[_0xfcd2('0x29')](function(_0x193dc3){return _0x193dc3;});}return null;};}function removeEntity(_0x2b0364,_0x595209){return function(_0x1c4981){if(_0x1c4981){return _0x1c4981[_0xfcd2('0x2a')]()[_0xfcd2('0x29')](function(){_0x2b0364[_0xfcd2('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaa0318,_0x5a2b6b){return function(_0x9cf49a){if(!_0x9cf49a){_0xaa0318[_0xfcd2('0x1d')](0x194);}return _0x9cf49a;};}function handleError(_0x5c7dd3,_0x909257){_0x909257=_0x909257||0x1f4;return function(_0x3cb642){logger[_0xfcd2('0x2b')](_0x3cb642['stack']);if(_0x3cb642[_0xfcd2('0x2c')]){delete _0x3cb642[_0xfcd2('0x2c')];}_0x5c7dd3[_0xfcd2('0x1f')](_0x909257)['send'](_0x3cb642);};}function getInteractionUsers(_0x490c53,_0x5192b9){return new BPromise(function(_0xfe01e3,_0x29a44f){try{if(_0x5192b9[_0x490c53['id']]){_0x490c53[_0xfcd2('0x2d')]=_['map'](_0x5192b9[_0x490c53['id']],function(_0x3dde17){return{'id':_0x3dde17['id'],'fullname':_0x3dde17[_0xfcd2('0x2e')]};});}}catch(_0x2934b1){_0x29a44f(_0x2934b1);}_0xfe01e3(_0x490c53);});}function getInteractionTags(_0x3e9768,_0xc5d81e){return new BPromise(function(_0x40d882,_0x2928ba){try{if(_0x3e9768['TagIds']){_0x3e9768['Tags']=[];_0x3e9768[_0xfcd2('0x2f')]['split'](',')[_0xfcd2('0x30')](function(_0x162b7d){_0x3e9768[_0xfcd2('0x31')][_0xfcd2('0x32')](_0xc5d81e[_0x162b7d]);});}delete _0x3e9768[_0xfcd2('0x2f')];}catch(_0x8ab9cb){_0x2928ba(_0x8ab9cb);}_0x40d882(_0x3e9768);});}function updateWhatsappInteraction(_0x2fd4c3,_0x330b65,_0x1a1cb8){return new BPromise(function(_0x594076,_0x194fd4){return getInteractionUsers(_0x2fd4c3,_0x1a1cb8)[_0xfcd2('0x29')](function(_0x3158a6){return getInteractionTags(_0x3158a6,_0x330b65);})[_0xfcd2('0x29')](function(_0x562cc2){return getStateInteraction(_0x562cc2);})['then'](function(_0xc4090f){_0x594076(_0xc4090f);})[_0xfcd2('0x33')](function(_0x4e6db5){_0x194fd4(_0x4e6db5);});});}function getStateInteraction(_0x61fbd1){return new BPromise(function(_0x50e1c3){_0x61fbd1[_0xfcd2('0x34')]=0x0;_0x61fbd1[_0xfcd2('0x35')]=0x0;_0x61fbd1['answered']=0x0;_0x61fbd1[_0xfcd2('0x36')]=0x0;_0x61fbd1['total']=0x0;if(!_0x61fbd1[_0xfcd2('0x37')]&&!_0x61fbd1['UserId']){_0x61fbd1[_0xfcd2('0x34')]+=0x1;}if(!_0x61fbd1[_0xfcd2('0x37')]&&_0x61fbd1[_0xfcd2('0x38')]){_0x61fbd1['talking']+=0x1;if(_0x61fbd1[_0xfcd2('0x34')]){_0x61fbd1[_0xfcd2('0x34')]-=0x1;}}if(_0x61fbd1[_0xfcd2('0x37')]&&_0x61fbd1[_0xfcd2('0x38')]){_0x61fbd1[_0xfcd2('0x39')]+=0x1;if(_0x61fbd1[_0xfcd2('0x35')]){_0x61fbd1[_0xfcd2('0x35')]-=0x1;}}if(_0x61fbd1[_0xfcd2('0x37')]&&!_0x61fbd1[_0xfcd2('0x38')]){_0x61fbd1[_0xfcd2('0x36')]+=0x1;if(_0x61fbd1[_0xfcd2('0x34')]){_0x61fbd1[_0xfcd2('0x34')]-=0x1;}}_0x61fbd1[_0xfcd2('0x3a')]+=0x1;_0x50e1c3(_0x61fbd1);});}exports[_0xfcd2('0x3b')]=function(_0x2a8bda,_0x2f9077){var _0x264c94={},_0x47d6b6={},_0x111e5a={'count':0x0,'rows':[]};var _0x5c1573=_[_0xfcd2('0x3c')](db[_0xfcd2('0x3d')][_0xfcd2('0x3e')],function(_0x321ace){return{'name':_0x321ace['fieldName'],'type':_0x321ace[_0xfcd2('0x3f')][_0xfcd2('0x40')]};});_0x47d6b6[_0xfcd2('0x41')]=_[_0xfcd2('0x3c')](_0x5c1573,_0xfcd2('0x2c'));_0x47d6b6[_0xfcd2('0x42')]=_[_0xfcd2('0x43')](_0x2a8bda[_0xfcd2('0x42')]);_0x47d6b6['filters']=_[_0xfcd2('0x44')](_0x47d6b6[_0xfcd2('0x41')],_0x47d6b6[_0xfcd2('0x42')]);_0x264c94[_0xfcd2('0x45')]=_[_0xfcd2('0x44')](_0x47d6b6['model'],qs[_0xfcd2('0x46')](_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x46')]));_0x264c94[_0xfcd2('0x45')]=_0x264c94['attributes'][_0xfcd2('0x47')]?_0x264c94[_0xfcd2('0x45')]:_0x47d6b6[_0xfcd2('0x41')];if(!_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x48')](_0xfcd2('0x49'))){_0x264c94[_0xfcd2('0x23')]=qs[_0xfcd2('0x23')](_0x2a8bda[_0xfcd2('0x42')]['limit']);_0x264c94['offset']=qs['offset'](_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x21')]);}_0x264c94[_0xfcd2('0x4a')]=qs[_0xfcd2('0x4b')](_0x2a8bda['query'][_0xfcd2('0x4b')]);_0x264c94[_0xfcd2('0x4c')]=qs[_0xfcd2('0x4d')](_[_0xfcd2('0x4e')](_0x2a8bda['query'],_0x47d6b6[_0xfcd2('0x4d')]),_0x5c1573);var _0x26dbe2=[];var _0x36233a=squel['select']()[_0xfcd2('0x4f')]('id')[_0xfcd2('0x4f')]('name')[_0xfcd2('0x4f')]('color')['from'](_0xfcd2('0x50'));var _0x17653a=squel[_0xfcd2('0x51')]()[_0xfcd2('0x4f')]('u.id')[_0xfcd2('0x4f')](_0xfcd2('0x52'))[_0xfcd2('0x4f')]('ui.WhatsappInteractionId')[_0xfcd2('0x53')](_0xfcd2('0x54'),'ui')[_0xfcd2('0x55')](_0xfcd2('0x56'),'u',_0xfcd2('0x57'));var _0xb7406b=squel[_0xfcd2('0x51')]()[_0xfcd2('0x53')](_0xfcd2('0x58'),'i')[_0xfcd2('0x55')](_0xfcd2('0x59'),'c',_0xfcd2('0x5a'))[_0xfcd2('0x55')](_0xfcd2('0x56'),'o',_0xfcd2('0x5b'))[_0xfcd2('0x55')]('whatsapp_accounts','a',_0xfcd2('0x5c'))[_0xfcd2('0x55')](_0xfcd2('0x5d'),'me',_0xfcd2('0x5e'))['left_join'](_0xfcd2('0x5f'),'it',_0xfcd2('0x60'))['left_join']('tools_tags','t',_0xfcd2('0x61'));var _0x3b8ea5=squel[_0xfcd2('0x62')]();var _0x570475=[];var _0x46f041=squel[_0xfcd2('0x62')]();var _0x241b08;if(_0x2a8bda[_0xfcd2('0x42')]['search']){_0x241b08=as[_0xfcd2('0x63')](_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x64')]);var _0x4371e1=_0x241b08[_0xfcd2('0x65')];for(var _0x8dd217=0x0;_0x8dd217<_0x241b08[_0xfcd2('0x66')][_0xfcd2('0x47')];_0x8dd217++){var _0x1be41d=_0x241b08['conditions'][_0x8dd217];var _0x4e7248='i';var _0x3e22fb=_['find'](_0x5c1573,[_0xfcd2('0x2c'),_0x1be41d['field']]);if(!_0x3e22fb){switch(_0x1be41d[_0xfcd2('0x4f')]){case'unreadMessages':if(_0x1be41d[_0xfcd2('0x67')]==0x1){_0xb7406b['having']('`'+_0x1be41d[_0xfcd2('0x4f')]+_0xfcd2('0x68'));}else{_0xb7406b[_0xfcd2('0x69')]('`'+_0x1be41d[_0xfcd2('0x4f')]+_0xfcd2('0x6a'));}break;case _0xfcd2('0x6b'):if(_0x1be41d['operator']===_0xfcd2('0x6c')){if(_0x1be41d[_0xfcd2('0x67')][_0xfcd2('0x6d')]('\x20')[_0xfcd2('0x47')]>0x1){_0x3b8ea5[_0x4371e1](_0xfcd2('0x6e'),qs[_0xfcd2('0x6f')](_0x1be41d['value']),null);}else{var _0x1a2903='%'+_0x1be41d[_0xfcd2('0x67')]+'%';_0x3b8ea5[_0x4371e1](_0xfcd2('0x70'),_0x1a2903,_0x1a2903,_0x1a2903);}}else{_0x3e22fb=_['find'](_0x5c1573,[_0xfcd2('0x2c'),_0xfcd2('0x71')]);_0x1be41d[_0xfcd2('0x4f')]=_0xfcd2('0x71');_0x15dd4d=as['buildExpression'](_0x4e7248,_0x3e22fb[_0xfcd2('0x3f')],_0x1be41d);_0x3b8ea5[_0x4371e1](_0x15dd4d['text'],_0x15dd4d[_0xfcd2('0x67')][_0xfcd2('0x72')],_0x15dd4d[_0xfcd2('0x67')]['end']);}break;case _0xfcd2('0x73'):var _0x12c6cf=_0x1be41d[_0xfcd2('0x67')][_0xfcd2('0x6d')](',')[_0xfcd2('0x3c')](function(_0xb64f1){return Number(_0xb64f1);});_0x12c6cf[_0xfcd2('0x30')](function(_0x4bd3ee){_0x46f041['or'](_0xfcd2('0x74'),'%,'+_0x4bd3ee+',%');});_0x570475=_[_0xfcd2('0x75')](_0x570475,_0x12c6cf);break;case _0xfcd2('0x76'):if(_0x1be41d[_0xfcd2('0x77')]===_0xfcd2('0x6c')){_0x3b8ea5[_0x4371e1](_0xfcd2('0x78'),'%'+_0x1be41d['value']+'%',null);}else{_0x3e22fb=_[_0xfcd2('0x79')](_0x5c1573,['name',_0xfcd2('0x38')]);_0x1be41d[_0xfcd2('0x4f')]='UserId';_0x15dd4d=as[_0xfcd2('0x7a')](_0x4e7248,_0x3e22fb[_0xfcd2('0x3f')],_0x1be41d);_0x3b8ea5[_0x4371e1](_0x15dd4d[_0xfcd2('0x7b')],_0x15dd4d['value']['start'],_0x15dd4d[_0xfcd2('0x67')][_0xfcd2('0x1e')]);}break;case'body':_0x15dd4d=as['buildExpression']('me',null,_0x1be41d);_0x3b8ea5[_0x4371e1](_0x15dd4d['text'],_0x15dd4d['value'][_0xfcd2('0x72')],_0x15dd4d[_0xfcd2('0x67')][_0xfcd2('0x1e')]);break;}}else{var _0x15dd4d=as[_0xfcd2('0x7a')](_0x4e7248,_0x3e22fb['type'],_0x1be41d);_0x3b8ea5[_0x4371e1](_0x15dd4d[_0xfcd2('0x7b')],_0x15dd4d['value'][_0xfcd2('0x72')],_0x15dd4d['value']['end']);}}}else{var _0x2fe735=_(_0x2a8bda[_0xfcd2('0x42')])['keys']()['map'](function(_0x18c46b){return _['some'](_0x5c1573,[_0xfcd2('0x2c'),_0x18c46b])?_0x18c46b:undefined;})['compact']()[_0xfcd2('0x67')]();if(!_[_0xfcd2('0x7c')](_0x2fe735)){_0x2fe735[_0xfcd2('0x30')](function(_0x5c3ad2){if(_0x5c3ad2===_0xfcd2('0x7d')){_0xb7406b[_0xfcd2('0x4c')]('i.WhatsappAccountId\x20IN\x20?',[][_0xfcd2('0x7e')](_0x2a8bda['query'][_0x5c3ad2]));}else if(_0x5c3ad2==='createdAt'){var _0x39e9b3=JSON[_0xfcd2('0x7f')](_0x2a8bda['query'][_0x5c3ad2])[_0xfcd2('0x80')];var _0x5d8278=JSON[_0xfcd2('0x7f')](_0x2a8bda[_0xfcd2('0x42')][_0x5c3ad2])[_0xfcd2('0x81')];_0xb7406b[_0xfcd2('0x4c')](_0xfcd2('0x82'),_0x39e9b3,_0x5d8278);}else{if(_0x2a8bda[_0xfcd2('0x42')][_0x5c3ad2]===_0xfcd2('0x83')){_0xb7406b[_0xfcd2('0x4c')]('i.'+_0x5c3ad2+_0xfcd2('0x84'));}else{_0xb7406b[_0xfcd2('0x4c')]('i.'+_0x5c3ad2+_0xfcd2('0x85'),_0x2a8bda['query'][_0x5c3ad2]);}}});}if(_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x86')]){if(_0x2a8bda[_0xfcd2('0x42')]['read']==0x1){_0xb7406b[_0xfcd2('0x69')](_0xfcd2('0x87'));}else{_0xb7406b[_0xfcd2('0x69')](_0xfcd2('0x88'));}}if(_0x2a8bda[_0xfcd2('0x42')]['tag']){_0x570475=_[_0xfcd2('0x89')](_0x2a8bda[_0xfcd2('0x42')]['tag'])?_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x8a')]:new Array(_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x8a')]);_0x570475[_0xfcd2('0x30')](function(_0xf67b6f){_0x46f041['or'](_0xfcd2('0x74'),'%,'+_0xf67b6f+',%');});}if(_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x8b')]){var _0x18b2c4=_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x8b')][_0xfcd2('0x8c')]('\x5c','\x5c\x5c')[_0xfcd2('0x8c')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x18b2c4)){_0x3b8ea5['or'](_0xfcd2('0x8d'),_0x18b2c4+'%')['or']('i.phone\x20LIKE\x20?',_0x18b2c4+'%');}else{_0x3b8ea5['or'](_0xfcd2('0x8e'),qs['getFullTextValue'](_0x18b2c4))['or'](_0xfcd2('0x8f'),_0x18b2c4+'%');}}}_0xb7406b[_0xfcd2('0x4c')](_0x3b8ea5);_0xb7406b[_0xfcd2('0x90')](_0xfcd2('0x91'));var _0x1055bd={'type':db[_0xfcd2('0x92')]['QueryTypes'][_0xfcd2('0x93')],'raw':!![]};var _0x3a4ca8=_0xb7406b[_0xfcd2('0x94')]();_0x3a4ca8['field'](_0xfcd2('0x91'));_0x3a4ca8[_0xfcd2('0x4f')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xfcd2('0x95'));if(_0x264c94[_0xfcd2('0x4a')]){_0x264c94[_0xfcd2('0x4a')][_0xfcd2('0x30')](function(_0x2603fe){var _0x3a1a64=_0x2603fe[0x0]===_0xfcd2('0x96')?_0x2603fe[0x0]:'i.'+_0x2603fe[0x0];_0xb7406b['order'](_0x3a1a64,_0x2603fe[0x1]===_0xfcd2('0x97')?![]:!![]);});}if(!_[_0xfcd2('0x7c')](_0x570475)){_0xb7406b[_0xfcd2('0x69')](_0x46f041);_0x3a4ca8[_0xfcd2('0x4c')]('t.id\x20IN\x20?',_0x570475);}BPromise[_0xfcd2('0x98')]()['then'](function(){if(!_0x241b08){if(_0x2a8bda[_0xfcd2('0x42')]['WhatsappAccountId'])return;_0x3a4ca8[_0xfcd2('0x4c')](_0xfcd2('0x99'));_0xb7406b[_0xfcd2('0x4c')](_0xfcd2('0x99'));return;}if(_0x2a8bda[_0xfcd2('0x9a')][_0xfcd2('0x9b')]!==_0xfcd2('0x9c'))return;return _0x2a8bda['user']['getWhatsappAccounts']({'attributes':['id'],'raw':!![]})[_0xfcd2('0x29')](function(_0x1c6e9d){if(_['isEmpty'](_0x1c6e9d)){_0x3a4ca8[_0xfcd2('0x4c')](_0xfcd2('0x9d'));_0xb7406b[_0xfcd2('0x4c')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x3a4ca8[_0xfcd2('0x4c')]('i.WhatsappAccountId\x20IN\x20?',_[_0xfcd2('0x3c')](_0x1c6e9d,'id'));_0xb7406b['where'](_0xfcd2('0x9e'),_[_0xfcd2('0x3c')](_0x1c6e9d,'id'));}});})['then'](function(){if(_0x2a8bda[_0xfcd2('0x9a')][_0xfcd2('0x9b')]===_0xfcd2('0x9c')&&!_0x241b08&&!_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x7d')])return[];return db[_0xfcd2('0x9f')]['query'](_0x3a4ca8[_0xfcd2('0xa0')](),_0x1055bd);})[_0xfcd2('0x29')](function(_0x64998a){_0x111e5a['count']=_0x64998a[_0xfcd2('0x47')];if(_0x111e5a[_0xfcd2('0x24')]===0x0)return[];return db[_0xfcd2('0x9f')][_0xfcd2('0x42')](_0x36233a['toString'](),_0x1055bd)[_0xfcd2('0x29')](function(_0x9e5deb){_0x26dbe2=_[_0xfcd2('0xa1')](_0x9e5deb,'id');_0x1055bd=_[_0xfcd2('0xa2')](_0x1055bd,{'model':db[_0xfcd2('0x3d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2a8bda[_0xfcd2('0x42')][_0xfcd2('0x46')]){_0x264c94[_0xfcd2('0x45')][_0xfcd2('0x30')](function(_0x5ef4d0){_0xb7406b[_0xfcd2('0x4f')]('i.'+_0x5ef4d0);});}else{_0xb7406b['field'](_0xfcd2('0xa3'),'unreadMessages');_0xb7406b[_0xfcd2('0x4f')]('a.key',_0xfcd2('0xa4'));_0xb7406b['field'](_0xfcd2('0xa5'),_0xfcd2('0xa6'));_0xb7406b[_0xfcd2('0x4f')]('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',_0xfcd2('0x96'));_0xb7406b['field']('i.*');_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xa7'),_0xfcd2('0xa8'));_0xb7406b[_0xfcd2('0x4f')]('c.lastName',_0xfcd2('0xa9'));_0xb7406b['field'](_0xfcd2('0xaa'),_0xfcd2('0xab'));_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xac'),_0xfcd2('0xad'));_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xae'),_0xfcd2('0xaf'));_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xb0'),'Contact.fax');_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xb1'),_0xfcd2('0xb2'));_0xb7406b[_0xfcd2('0x4f')](_0xfcd2('0xb3'),_0xfcd2('0xb4'));_0xb7406b[_0xfcd2('0x4f')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xfcd2('0x2f'));}if(_0x264c94['limit'])_0xb7406b[_0xfcd2('0x23')](_0x264c94[_0xfcd2('0x23')]);if(_0x264c94[_0xfcd2('0x21')])_0xb7406b[_0xfcd2('0x21')](_0x264c94[_0xfcd2('0x21')]);return db[_0xfcd2('0x9f')][_0xfcd2('0x42')](_0xb7406b[_0xfcd2('0xa0')](),_0x1055bd);})[_0xfcd2('0x29')](function(_0xe695ca){if(_0xe695ca[_0xfcd2('0x47')]>0x0)_0x17653a[_0xfcd2('0x4c')](_0xfcd2('0xb5'),_[_0xfcd2('0x3c')](_0xe695ca,'id'));return db['sequelize'][_0xfcd2('0x42')](_0x17653a['toString'](),_0x1055bd)[_0xfcd2('0x29')](function(_0x39fe74){var _0x496900=_[_0xfcd2('0xb6')](_0x39fe74,_0xfcd2('0xb7'));var _0x205854=[];_0xe695ca[_0xfcd2('0x30')](function(_0x23a74d){_0x205854[_0xfcd2('0x32')](updateWhatsappInteraction(_0x23a74d,_0x26dbe2,_0x496900));});return BPromise['all'](_0x205854);});});})[_0xfcd2('0x29')](function(_0x482e92){_0x111e5a['rows']=_0x482e92;return _0x111e5a;})[_0xfcd2('0x29')](respondWithFilteredResult(_0x2f9077,_0x264c94))[_0xfcd2('0x33')](handleError(_0x2f9077,null));};exports[_0xfcd2('0xb8')]=function(_0x2f2973,_0x3c7aa2){var _0xdfa56f={'raw':![],'where':{'id':_0x2f2973['params']['id']}},_0xc9aea4={};_0xc9aea4[_0xfcd2('0x41')]=_[_0xfcd2('0x43')](db[_0xfcd2('0x3d')]['rawAttributes']);_0xc9aea4['query']=_[_0xfcd2('0x43')](_0x2f2973[_0xfcd2('0x42')]);_0xc9aea4[_0xfcd2('0x4d')]=_[_0xfcd2('0x44')](_0xc9aea4[_0xfcd2('0x41')],_0xc9aea4[_0xfcd2('0x42')]);_0xdfa56f[_0xfcd2('0x45')]=_[_0xfcd2('0x44')](_0xc9aea4[_0xfcd2('0x41')],qs[_0xfcd2('0x46')](_0x2f2973['query'][_0xfcd2('0x46')]));_0xdfa56f[_0xfcd2('0x45')]=_0xdfa56f[_0xfcd2('0x45')][_0xfcd2('0x47')]?_0xdfa56f[_0xfcd2('0x45')]:_0xc9aea4[_0xfcd2('0x41')];if(_0x2f2973[_0xfcd2('0x42')][_0xfcd2('0xb9')]){_0xdfa56f[_0xfcd2('0xba')]=[{'all':!![]}];}_0xdfa56f=_[_0xfcd2('0xa2')]({},_0xdfa56f,_0x2f2973['options']);return db[_0xfcd2('0x3d')][_0xfcd2('0x79')](_0xdfa56f)['then'](handleEntityNotFound(_0x3c7aa2,null))[_0xfcd2('0x29')](respondWithResult(_0x3c7aa2,null))[_0xfcd2('0x33')](handleError(_0x3c7aa2,null));};exports[_0xfcd2('0xbb')]=function(_0x377f6e,_0x4e5fda){return db[_0xfcd2('0x3d')][_0xfcd2('0xbb')](_0x377f6e[_0xfcd2('0xbc')],{})['then'](respondWithResult(_0x4e5fda,0xc9))[_0xfcd2('0x33')](handleError(_0x4e5fda,null));};exports[_0xfcd2('0x28')]=function(_0x9396bf,_0x1b6244){if(_0x9396bf[_0xfcd2('0xbc')]['id']){delete _0x9396bf['body']['id'];}return db[_0xfcd2('0x3d')][_0xfcd2('0x79')]({'where':{'id':_0x9396bf['params']['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x1b6244,null))['then'](saveUpdates(_0x9396bf[_0xfcd2('0xbc')],null))['then'](respondWithResult(_0x1b6244,null))[_0xfcd2('0x33')](handleError(_0x1b6244,null));};exports[_0xfcd2('0x2a')]=function(_0x377ee1,_0x28ef17){return db['WhatsappInteraction']['find']({'where':{'id':_0x377ee1[_0xfcd2('0xbd')]['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x28ef17,null))['then'](removeEntity(_0x28ef17,null))[_0xfcd2('0x33')](handleError(_0x28ef17,null));};exports['describe']=function(_0x89e024,_0x2998c7){return db['WhatsappInteraction'][_0xfcd2('0xbe')]()[_0xfcd2('0x29')](respondWithResult(_0x2998c7,null))[_0xfcd2('0x33')](handleError(_0x2998c7,null));};exports[_0xfcd2('0xbf')]=function(_0x221c5b,_0x5ef49b,_0x4a8b49){return db['WhatsappMessage'][_0xfcd2('0x79')]({'where':{'id':_0x221c5b[_0xfcd2('0xbd')]['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x5ef49b,null))[_0xfcd2('0x29')](function(_0xc84f5e){if(_0xc84f5e){return _0xc84f5e[_0xfcd2('0xbf')](_0x221c5b[_0xfcd2('0xbc')][_0xfcd2('0xc0')],_[_0xfcd2('0xc1')](_0x221c5b['body'],[_0xfcd2('0xc0'),'id'])||{});}})[_0xfcd2('0x29')](respondWithResult(_0x5ef49b,null))[_0xfcd2('0x33')](handleError(_0x5ef49b,null));};exports[_0xfcd2('0xc2')]=function(_0x489031,_0x240488,_0x43d545){var _0x2a0842={'raw':![],'where':{}};var _0x246ecb={};var _0x2d1abf={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xfcd2('0xc3')]({'where':{'id':_0x489031[_0xfcd2('0xbd')]['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x240488,null))['then'](function(_0x4df5f4){if(_0x4df5f4){_0x246ecb[_0xfcd2('0x41')]=_['keys'](db[_0xfcd2('0xc4')][_0xfcd2('0x3e')]);_0x246ecb[_0xfcd2('0x42')]=_[_0xfcd2('0x43')](_0x489031[_0xfcd2('0x42')]);_0x246ecb[_0xfcd2('0x4d')]=_[_0xfcd2('0x44')](_0x246ecb[_0xfcd2('0x41')],_0x246ecb['query']);_0x2a0842[_0xfcd2('0x45')]=_[_0xfcd2('0x44')](_0x246ecb[_0xfcd2('0x41')],qs[_0xfcd2('0x46')](_0x489031[_0xfcd2('0x42')]['fields']));_0x2a0842[_0xfcd2('0x45')]=_0x2a0842[_0xfcd2('0x45')][_0xfcd2('0x47')]?_0x2a0842[_0xfcd2('0x45')]:_0x246ecb['model'];if(!_0x489031[_0xfcd2('0x42')][_0xfcd2('0x48')](_0xfcd2('0x49'))){_0x2a0842['limit']=qs['limit'](_0x489031['query'][_0xfcd2('0x23')]);_0x2a0842['offset']=qs[_0xfcd2('0x21')](_0x489031[_0xfcd2('0x42')][_0xfcd2('0x21')]);}_0x2a0842[_0xfcd2('0x4a')]=qs['sort'](_0x489031[_0xfcd2('0x42')][_0xfcd2('0x4b')]);_0x2a0842['where']=qs['filters'](_['pick'](_0x489031[_0xfcd2('0x42')],_0x246ecb[_0xfcd2('0x4d')]));_0x2a0842['where'][_0xfcd2('0xb7')]=_0x4df5f4['id'];if(_0x489031[_0xfcd2('0x42')][_0xfcd2('0x8b')]){_0x2a0842[_0xfcd2('0x4c')]=_['merge'](_0x2a0842[_0xfcd2('0x4c')],{'$or':_[_0xfcd2('0x3c')](_0x2a0842[_0xfcd2('0x45')],function(_0x27eb3b){var _0x320fe9={};_0x320fe9[_0x27eb3b]={'$like':'%'+_0x489031[_0xfcd2('0x42')][_0xfcd2('0x8b')]+'%'};return _0x320fe9;})});}if(_0x489031[_0xfcd2('0x42')][_0xfcd2('0x80')]){var _0x3ee7d8=_0x489031[_0xfcd2('0x42')]['$gte'][_0xfcd2('0x6d')](',');var _0x426940={};_0x426940[_0x3ee7d8[0x0]]={'$gte':moment(_0x3ee7d8[0x1])[_0xfcd2('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2a0842[_0xfcd2('0x4c')]=_[_0xfcd2('0xa2')](_0x2a0842[_0xfcd2('0x4c')],_0x426940);}_0x2a0842=_['merge']({},_0x2a0842,_0x489031['options']);return db[_0xfcd2('0xc4')][_0xfcd2('0x24')]({'where':_0x2a0842['where']})[_0xfcd2('0x29')](function(_0x419370){_0x2d1abf[_0xfcd2('0x24')]=_0x419370;if(_0x489031['query'][_0xfcd2('0xb9')]){_0x2a0842[_0xfcd2('0xba')]=[{'all':!![]}];}return db[_0xfcd2('0xc4')]['findAll'](_0x2a0842);})[_0xfcd2('0x29')](function(_0x186555){_0x2d1abf['rows']=_0x186555;return _0x2d1abf;});}})['then'](respondWithFilteredResult(_0x240488,_0x2a0842))[_0xfcd2('0x33')](handleError(_0x240488,null));};exports[_0xfcd2('0xc6')]=function(_0x30be1b,_0x33f40c,_0x334cbb){return db[_0xfcd2('0x3d')][_0xfcd2('0x79')]({'where':{'id':_0x30be1b['params']['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x33f40c,null))[_0xfcd2('0x29')](function(_0x3d5b0a){if(_0x3d5b0a){return _0x3d5b0a[_0xfcd2('0xc7')](_0x30be1b[_0xfcd2('0xbc')]['ids'],_[_0xfcd2('0xc1')](_0x30be1b[_0xfcd2('0xbc')],[_0xfcd2('0xc0'),'id'])||{})[_0xfcd2('0xc8')](function(){return db[_0xfcd2('0x73')][_0xfcd2('0xc9')]({'attributes':['id',_0xfcd2('0x2c'),'color'],'where':{'id':_0x30be1b[_0xfcd2('0xbc')]['ids']}});})[_0xfcd2('0x29')](function(_0x299efd){socket['emit'](_0xfcd2('0xca'),{'id':Number(_0x30be1b[_0xfcd2('0xbd')]['id']),'tags':_0x299efd||[]});return{'id':Number(_0x30be1b[_0xfcd2('0xbd')]['id']),'tags':_0x299efd||[]};});}})[_0xfcd2('0x29')](respondWithResult(_0x33f40c,null))['catch'](handleError(_0x33f40c,null));};exports['removeTags']=function(_0x3a632a,_0x211a59,_0x334b34){return db[_0xfcd2('0x3d')][_0xfcd2('0x79')]({'where':{'id':_0x3a632a[_0xfcd2('0xbd')]['id']}})[_0xfcd2('0x29')](handleEntityNotFound(_0x211a59,null))[_0xfcd2('0x29')](function(_0x5e77e8){if(_0x5e77e8){return _0x5e77e8[_0xfcd2('0xcb')](_0x3a632a[_0xfcd2('0x42')]['ids']);}})[_0xfcd2('0x29')](respondWithStatusCode(_0x211a59,null))[_0xfcd2('0x33')](handleError(_0x211a59,null));};exports[_0xfcd2('0xcc')]=function(_0x3ae3fe,_0x84d5d7){var _0x3a266d=moment()[_0xfcd2('0xcd')]()['toString']();var _0x4d8283=path[_0xfcd2('0xce')](config[_0xfcd2('0xcf')],_0xfcd2('0xd0'),'files',_0xfcd2('0xd1'));var _0x370925=path['join'](config[_0xfcd2('0xcf')],_0xfcd2('0xd0'),_0xfcd2('0xd2'),_0xfcd2('0xd3'));var _0x2886b2=path[_0xfcd2('0xce')](_0x4d8283,_0x3a266d);var _0x2d5e9c=util[_0xfcd2('0xc5')]('transcript-%d-%s.zip',_0x3ae3fe[_0xfcd2('0xbd')]['id'],_0x3a266d);var _0x3674ae=path[_0xfcd2('0xce')](_0x4d8283,_0x2d5e9c);var _0xbd7907=[];_0xbd7907['push']({'model':db['User'],'as':'User','attributes':['id',_0xfcd2('0x2e')],'raw':!![]});_0xbd7907[_0xfcd2('0x32')]({'model':db['CmContact'],'as':'Contact','attributes':['id',_0xfcd2('0xd4'),_0xfcd2('0xd5')],'raw':!![]});if(_0x3ae3fe[_0xfcd2('0x42')][_0xfcd2('0xd3')]){_0xbd7907[_0xfcd2('0x32')]({'model':db[_0xfcd2('0xd6')],'as':'Attachment','raw':!![]});}var _0x16e014=[{'model':db['WhatsappMessage'],'as':_0xfcd2('0xd7'),'attributes':['id',_0xfcd2('0xbc'),'createdAt',_0xfcd2('0xd8'),_0xfcd2('0xd9'),'read'],'include':_0xbd7907}];_0x16e014['push']({'model':db[_0xfcd2('0xda')],'as':_0xfcd2('0xdb'),'attributes':['id','name']});_0x16e014[_0xfcd2('0x32')]({'model':db[_0xfcd2('0x76')],'as':_0xfcd2('0xdc'),'attributes':['id',_0xfcd2('0x2e')]});return db[_0xfcd2('0x3d')][_0xfcd2('0x79')]({'where':{'id':_0x3ae3fe['params']['id']},'include':_0x16e014})[_0xfcd2('0x29')](handleEntityNotFound(_0x84d5d7,null))['then'](function(_0x3f8739){if(_0x3f8739){var _0x5acb01=_0x3f8739[_0xfcd2('0xdd')]({'plain':!![]});fs['mkdirSync'](_0x2886b2);var _0x5058ee={'channel':_0xfcd2('0xde'),'account':_0x5acb01[_0xfcd2('0xdb')][_0xfcd2('0x2c')],'agent':_0x5acb01[_0xfcd2('0xdc')]?_0x5acb01[_0xfcd2('0xdc')][_0xfcd2('0x2e')]:_0xfcd2('0xdf'),'createdAt':moment(_0x5acb01[_0xfcd2('0xe0')])[_0xfcd2('0xc5')](_0xfcd2('0xe1'))[_0xfcd2('0xa0')](),'closedAt':_0x5acb01[_0xfcd2('0x37')]?moment(_0x5acb01['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xfcd2('0xa0')]():'','disposition':_0x5acb01[_0xfcd2('0xe2')],'messages':_(_0x5acb01[_0xfcd2('0xd7')])[_0xfcd2('0x8b')]({'secret':![]})[_0xfcd2('0x3c')](function(_0xf6430f){if(_0xf6430f[_0xfcd2('0xd6')]){var _0x1e112a=path[_0xfcd2('0xce')](_0x370925,_0xf6430f['Attachment'][_0xfcd2('0xe3')]);if(fs['existsSync'](_0x1e112a)){fs[_0xfcd2('0xe4')](_0x1e112a)[_0xfcd2('0xe5')](fs['createWriteStream'](path['join'](_0x2886b2,_0xf6430f[_0xfcd2('0xd6')][_0xfcd2('0xe3')])));}}return{'date':moment(_0xf6430f[_0xfcd2('0xe0')])[_0xfcd2('0xc5')]('YYYY-MM-DD\x20HH:mm:ss')[_0xfcd2('0xa0')](),'sender':_0xf6430f[_0xfcd2('0xd8')]===_0xfcd2('0xe6')?_0xf6430f['User']?_0xf6430f[_0xfcd2('0x76')][_0xfcd2('0x2e')]:_0xfcd2('0xe7'):_0xf6430f[_0xfcd2('0x6b')][_0xfcd2('0xd4')]+(_0xf6430f[_0xfcd2('0x6b')]['lastName']?'\x20'+_0xf6430f[_0xfcd2('0x6b')]['lastName']:''),'body':_0xf6430f[_0xfcd2('0xd6')]?_0xf6430f['Attachment'][_0xfcd2('0xe3')]:_0xf6430f[_0xfcd2('0xbc')],'direction':_0xf6430f[_0xfcd2('0xd8')]==='out'?'A':'C','secret':_0xf6430f['secret'],'read':_0xf6430f['read'],'attachment':_0xf6430f['Attachment']};})[_0xfcd2('0x67')]()};return ejs[_0xfcd2('0xe8')](path[_0xfcd2('0xce')](config[_0xfcd2('0xcf')],_0xfcd2('0xd0'),_0xfcd2('0xe9'),_0xfcd2('0xea')),{'interaction':_0x5058ee})[_0xfcd2('0x29')](function(_0x4202cd){var _0x365392=path['join'](_0x2886b2,_0xfcd2('0xeb')+_0x5acb01['id']+'-'+_0x3a266d+_0xfcd2('0xec'));var _0x37b358={'path':_0x365392,'channel':_0xfcd2('0xde'),'interactionId':_0x5acb01['id']};return pdf[_0xfcd2('0xed')](_0x4202cd,_0x37b358);})[_0xfcd2('0x29')](function(){return new BPromise(function(_0x15c76f,_0x509ad1){zipdir(_0x2886b2,{'saveTo':_0x3674ae},function(_0x41c0dd,_0x23058f){if(_0x41c0dd)return _0x509ad1(_0x41c0dd);return _0x15c76f(_0x23058f);});})['then'](function(){return new BPromise(function(_0x4a2ad1,_0x30dad2){rimraf(_0x2886b2,function(_0x3d9b63){if(_0x3d9b63)_0x30dad2(_0x3d9b63);return _0x4a2ad1();});});})[_0xfcd2('0x29')](function(){return _0x84d5d7['download'](_0x3674ae,_0x2d5e9c,function(_0x474d5a){if(_0x474d5a){console[_0xfcd2('0xee')](_0xfcd2('0xef'),_0x474d5a);}else{fs['unlinkSync'](_0x3674ae);}});});});}else{return _0x84d5d7[_0xfcd2('0x1d')](0xc8);}})[_0xfcd2('0x33')](handleError(_0x84d5d7,null));}; \ No newline at end of file +var _0xef4d=['`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','i.WhatsappAccountId\x20IN\x20?','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','sequelize','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','push','show','params','includeAll','create','describe','WhatsappMessage','ids','findOne','hasOwnProperty','$gte','format','include','findAll','setTags','omit','spread','Tag','emit','whatsappInteractionTags:save','removeTags','download','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','N.A.','YYYY-MM-DD\x20HH:mm:ss','disposition','Messages','basename','existsSync','createReadStream','pipe','createWriteStream','Contact','firstName','out','renderFile','views','transcript-','.pdf','Whatsapp','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','defaults','localhost','redis','./whatsappInteraction.socket','register','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','fullname','Tags','TagIds','split','forEach','catch','answered','total','closed','UserId','waiting','talking','unmanaged','index','WhatsappInteraction','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','users','u.id\x20=\x20ui.UserId','whatsapp_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','buildExpression','type','some','compact','isEmpty','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read'];(function(_0x3ab55b,_0x5aa95e){var _0x4605e8=function(_0x54b402){while(--_0x54b402){_0x3ab55b['push'](_0x3ab55b['shift']());}};_0x4605e8(++_0x5aa95e);}(_0xef4d,0x165));var _0xdef4=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xef4d[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xdef4('0x0'));var rimraf=require(_0xdef4('0x1'));var zipdir=require(_0xdef4('0x2'));var jsonpatch=require(_0xdef4('0x3'));var rp=require(_0xdef4('0x4'));var moment=require(_0xdef4('0x5'));var BPromise=require(_0xdef4('0x6'));var Mustache=require(_0xdef4('0x7'));var util=require(_0xdef4('0x8'));var path=require(_0xdef4('0x9'));var sox=require(_0xdef4('0xa'));var csv=require(_0xdef4('0xb'));var ejs=require(_0xdef4('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdef4('0xd'));var squel=require(_0xdef4('0xe'));var crypto=require(_0xdef4('0xf'));var jsforce=require(_0xdef4('0x10'));var deskjs=require(_0xdef4('0x11'));var toCsv=require(_0xdef4('0xb'));var querystring=require(_0xdef4('0x12'));var Papa=require(_0xdef4('0x13'));var Redis=require(_0xdef4('0x14'));var authService=require('../../components/auth/service');var qs=require(_0xdef4('0x15'));var as=require(_0xdef4('0x16'));var pdf=require(_0xdef4('0x17'));var hardwareService=require(_0xdef4('0x18'));var logger=require(_0xdef4('0x19'))(_0xdef4('0x1a'));var utils=require(_0xdef4('0x1b'));var config=require('../../config/environment');var licenseUtil=require(_0xdef4('0x1c'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xdef4('0x1d')](config['redis'],{'host':_0xdef4('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdef4('0x1f')]));require(_0xdef4('0x20'))[_0xdef4('0x21')](socket);function respondWithStatusCode(_0x26801d,_0x52e593){_0x52e593=_0x52e593||0xcc;return function(_0x2359fb){if(_0x2359fb){return _0x26801d['sendStatus'](_0x52e593);}return _0x26801d[_0xdef4('0x22')](_0x52e593)[_0xdef4('0x23')]();};}function respondWithResult(_0x57e2c4,_0x17f5a3){_0x17f5a3=_0x17f5a3||0xc8;return function(_0x27463d){if(_0x27463d){return _0x57e2c4[_0xdef4('0x22')](_0x17f5a3)[_0xdef4('0x24')](_0x27463d);}};}function respondWithFilteredResult(_0x5adef0,_0x377beb){return function(_0x3b3a4){if(_0x3b3a4){var _0x469178=typeof _0x377beb[_0xdef4('0x25')]===_0xdef4('0x26')&&typeof _0x377beb['limit']===_0xdef4('0x26');var _0x3bf2ae=_0x3b3a4[_0xdef4('0x27')];var _0x22fd9e=_0x469178?0x0:_0x377beb[_0xdef4('0x25')];var _0x451826=_0x469178?_0x3b3a4['count']:_0x377beb[_0xdef4('0x25')]+_0x377beb[_0xdef4('0x28')];var _0x382362;if(_0x451826>=_0x3bf2ae){_0x451826=_0x3bf2ae;_0x382362=0xc8;}else{_0x382362=0xce;}_0x5adef0[_0xdef4('0x22')](_0x382362);return _0x5adef0[_0xdef4('0x29')](_0xdef4('0x2a'),_0x22fd9e+'-'+_0x451826+'/'+_0x3bf2ae)['json'](_0x3b3a4);}return null;};}function patchUpdates(_0x107fff){return function(_0x51fbf3){try{jsonpatch[_0xdef4('0x2b')](_0x51fbf3,_0x107fff,!![]);}catch(_0x209801){return BPromise[_0xdef4('0x2c')](_0x209801);}return _0x51fbf3[_0xdef4('0x2d')]();};}function saveUpdates(_0x4e6c50,_0x2f91b6){return function(_0x228778){if(_0x228778){return _0x228778[_0xdef4('0x2e')](_0x4e6c50)[_0xdef4('0x2f')](function(_0x1dab9a){return _0x1dab9a;});}return null;};}function removeEntity(_0x34ff25,_0x38658e){return function(_0x91199e){if(_0x91199e){return _0x91199e['destroy']()[_0xdef4('0x2f')](function(){_0x34ff25[_0xdef4('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa6a48f,_0x26718b){return function(_0x178a01){if(!_0x178a01){_0xa6a48f[_0xdef4('0x30')](0x194);}return _0x178a01;};}function handleError(_0x25f19d,_0x287608){_0x287608=_0x287608||0x1f4;return function(_0x50ae94){logger[_0xdef4('0x31')](_0x50ae94[_0xdef4('0x32')]);if(_0x50ae94['name']){delete _0x50ae94[_0xdef4('0x33')];}_0x25f19d[_0xdef4('0x22')](_0x287608)[_0xdef4('0x34')](_0x50ae94);};}function getInteractionUsers(_0x3bdaca,_0x321bb6){return new BPromise(function(_0x2cadc4,_0x2f0f33){try{if(_0x321bb6[_0x3bdaca['id']]){_0x3bdaca[_0xdef4('0x35')]=_[_0xdef4('0x36')](_0x321bb6[_0x3bdaca['id']],function(_0xd31a14){return{'id':_0xd31a14['id'],'fullname':_0xd31a14[_0xdef4('0x37')]};});}}catch(_0x49611b){_0x2f0f33(_0x49611b);}_0x2cadc4(_0x3bdaca);});}function getInteractionTags(_0x48a000,_0x129160){return new BPromise(function(_0x3b29e7,_0x341b74){try{if(_0x48a000['TagIds']){_0x48a000[_0xdef4('0x38')]=[];_0x48a000[_0xdef4('0x39')][_0xdef4('0x3a')](',')[_0xdef4('0x3b')](function(_0x4e82f7){_0x48a000['Tags']['push'](_0x129160[_0x4e82f7]);});}delete _0x48a000[_0xdef4('0x39')];}catch(_0x31ecb7){_0x341b74(_0x31ecb7);}_0x3b29e7(_0x48a000);});}function updateWhatsappInteraction(_0x46d84a,_0x15644c,_0x1b50ea){return new BPromise(function(_0x48617b,_0x420d4f){return getInteractionUsers(_0x46d84a,_0x1b50ea)[_0xdef4('0x2f')](function(_0x46f3b2){return getInteractionTags(_0x46f3b2,_0x15644c);})[_0xdef4('0x2f')](function(_0x30d1bd){return getStateInteraction(_0x30d1bd);})['then'](function(_0x1563ff){_0x48617b(_0x1563ff);})[_0xdef4('0x3c')](function(_0x3c2028){_0x420d4f(_0x3c2028);});});}function getStateInteraction(_0x4f2c80){return new BPromise(function(_0x3c8415){_0x4f2c80['waiting']=0x0;_0x4f2c80['talking']=0x0;_0x4f2c80[_0xdef4('0x3d')]=0x0;_0x4f2c80['unmanaged']=0x0;_0x4f2c80[_0xdef4('0x3e')]=0x0;if(!_0x4f2c80[_0xdef4('0x3f')]&&!_0x4f2c80[_0xdef4('0x40')]){_0x4f2c80[_0xdef4('0x41')]+=0x1;}if(!_0x4f2c80[_0xdef4('0x3f')]&&_0x4f2c80[_0xdef4('0x40')]){_0x4f2c80[_0xdef4('0x42')]+=0x1;if(_0x4f2c80[_0xdef4('0x41')]){_0x4f2c80['waiting']-=0x1;}}if(_0x4f2c80['closed']&&_0x4f2c80[_0xdef4('0x40')]){_0x4f2c80[_0xdef4('0x3d')]+=0x1;if(_0x4f2c80['talking']){_0x4f2c80[_0xdef4('0x42')]-=0x1;}}if(_0x4f2c80[_0xdef4('0x3f')]&&!_0x4f2c80[_0xdef4('0x40')]){_0x4f2c80[_0xdef4('0x43')]+=0x1;if(_0x4f2c80[_0xdef4('0x41')]){_0x4f2c80[_0xdef4('0x41')]-=0x1;}}_0x4f2c80[_0xdef4('0x3e')]+=0x1;_0x3c8415(_0x4f2c80);});}exports[_0xdef4('0x44')]=function(_0x795427,_0x10e738){var _0x1d95e7={},_0x26c14e={},_0x54f962={'count':0x0,'rows':[]};var _0x35e7e1=_[_0xdef4('0x36')](db[_0xdef4('0x45')][_0xdef4('0x46')],function(_0x42a63c){return{'name':_0x42a63c['fieldName'],'type':_0x42a63c['type'][_0xdef4('0x47')]};});_0x26c14e[_0xdef4('0x48')]=_[_0xdef4('0x36')](_0x35e7e1,_0xdef4('0x33'));_0x26c14e[_0xdef4('0x49')]=_[_0xdef4('0x4a')](_0x795427['query']);_0x26c14e[_0xdef4('0x4b')]=_[_0xdef4('0x4c')](_0x26c14e[_0xdef4('0x48')],_0x26c14e[_0xdef4('0x49')]);_0x1d95e7['attributes']=_['intersection'](_0x26c14e[_0xdef4('0x48')],qs['fields'](_0x795427[_0xdef4('0x49')][_0xdef4('0x4d')]));_0x1d95e7['attributes']=_0x1d95e7[_0xdef4('0x4e')][_0xdef4('0x4f')]?_0x1d95e7[_0xdef4('0x4e')]:_0x26c14e[_0xdef4('0x48')];if(!_0x795427[_0xdef4('0x49')]['hasOwnProperty'](_0xdef4('0x50'))){_0x1d95e7[_0xdef4('0x28')]=qs[_0xdef4('0x28')](_0x795427[_0xdef4('0x49')][_0xdef4('0x28')]);_0x1d95e7[_0xdef4('0x25')]=qs[_0xdef4('0x25')](_0x795427[_0xdef4('0x49')][_0xdef4('0x25')]);}_0x1d95e7[_0xdef4('0x51')]=qs[_0xdef4('0x52')](_0x795427['query']['sort']);_0x1d95e7[_0xdef4('0x53')]=qs[_0xdef4('0x4b')](_[_0xdef4('0x54')](_0x795427[_0xdef4('0x49')],_0x26c14e[_0xdef4('0x4b')]),_0x35e7e1);var _0x113e15=[];var _0x6c0f3f=squel[_0xdef4('0x55')]()['field']('id')['field'](_0xdef4('0x33'))[_0xdef4('0x56')](_0xdef4('0x57'))[_0xdef4('0x58')](_0xdef4('0x59'));var _0x320e87=squel[_0xdef4('0x55')]()[_0xdef4('0x56')](_0xdef4('0x5a'))['field'](_0xdef4('0x5b'))[_0xdef4('0x56')](_0xdef4('0x5c'))['from'](_0xdef4('0x5d'),'ui')['left_join'](_0xdef4('0x5e'),'u',_0xdef4('0x5f'));var _0x4d2c61=squel['select']()[_0xdef4('0x58')](_0xdef4('0x60'),'i')[_0xdef4('0x61')](_0xdef4('0x62'),'c',_0xdef4('0x63'))['left_join']('users','o',_0xdef4('0x64'))[_0xdef4('0x61')](_0xdef4('0x65'),'a',_0xdef4('0x66'))[_0xdef4('0x61')](_0xdef4('0x67'),'me',_0xdef4('0x68'))[_0xdef4('0x61')](_0xdef4('0x69'),'it',_0xdef4('0x6a'))[_0xdef4('0x61')]('tools_tags','t',_0xdef4('0x6b'));var _0x4acda2=squel[_0xdef4('0x6c')]();var _0x3151c2=[];var _0x4ce353=squel['expr']();var _0x1f23a6;if(_0x795427['query']['search']){_0x1f23a6=as[_0xdef4('0x6d')](_0x795427['query']['search']);var _0x46a1f5=_0x1f23a6[_0xdef4('0x6e')];for(var _0x337d8a=0x0;_0x337d8a<_0x1f23a6[_0xdef4('0x6f')]['length'];_0x337d8a++){var _0x5546f6=_0x1f23a6[_0xdef4('0x6f')][_0x337d8a];var _0x5123e4='i';var _0x28dfba=_['find'](_0x35e7e1,[_0xdef4('0x33'),_0x5546f6[_0xdef4('0x56')]]);if(!_0x28dfba){switch(_0x5546f6[_0xdef4('0x56')]){case _0xdef4('0x70'):if(_0x5546f6[_0xdef4('0x71')]==0x1){_0x4d2c61[_0xdef4('0x72')]('`'+_0x5546f6[_0xdef4('0x56')]+_0xdef4('0x73'));}else{_0x4d2c61[_0xdef4('0x72')]('`'+_0x5546f6['field']+'`\x20>\x200');}break;case'Contact':if(_0x5546f6[_0xdef4('0x74')]===_0xdef4('0x75')){if(_0x5546f6[_0xdef4('0x71')][_0xdef4('0x3a')]('\x20')['length']>0x1){_0x4acda2[_0x46a1f5](_0xdef4('0x76'),qs[_0xdef4('0x77')](_0x5546f6[_0xdef4('0x71')]),null);}else{var _0x4150d1='%'+_0x5546f6['value']+'%';_0x4acda2[_0x46a1f5](_0xdef4('0x78'),_0x4150d1,_0x4150d1,_0x4150d1);}}else{_0x28dfba=_[_0xdef4('0x79')](_0x35e7e1,[_0xdef4('0x33'),_0xdef4('0x7a')]);_0x5546f6[_0xdef4('0x56')]=_0xdef4('0x7a');_0x4a093b=as['buildExpression'](_0x5123e4,_0x28dfba['type'],_0x5546f6);_0x4acda2[_0x46a1f5](_0x4a093b[_0xdef4('0x7b')],_0x4a093b['value'][_0xdef4('0x7c')],_0x4a093b[_0xdef4('0x71')]['end']);}break;case'Tag':var _0x18d656=_0x5546f6[_0xdef4('0x71')][_0xdef4('0x3a')](',')['map'](function(_0x392624){return Number(_0x392624);});_0x18d656[_0xdef4('0x3b')](function(_0xe07370){_0x4ce353['or'](_0xdef4('0x7d'),'%,'+_0xe07370+',%');});_0x3151c2=_['union'](_0x3151c2,_0x18d656);break;case _0xdef4('0x7e'):if(_0x5546f6[_0xdef4('0x74')]===_0xdef4('0x75')){_0x4acda2[_0x46a1f5](_0xdef4('0x7f'),'%'+_0x5546f6[_0xdef4('0x71')]+'%',null);}else{_0x28dfba=_[_0xdef4('0x79')](_0x35e7e1,[_0xdef4('0x33'),_0xdef4('0x40')]);_0x5546f6[_0xdef4('0x56')]=_0xdef4('0x40');_0x4a093b=as['buildExpression'](_0x5123e4,_0x28dfba['type'],_0x5546f6);_0x4acda2[_0x46a1f5](_0x4a093b['text'],_0x4a093b[_0xdef4('0x71')][_0xdef4('0x7c')],_0x4a093b[_0xdef4('0x71')][_0xdef4('0x23')]);}break;case _0xdef4('0x80'):_0x4a093b=as[_0xdef4('0x81')]('me',null,_0x5546f6);_0x4acda2[_0x46a1f5](_0x4a093b[_0xdef4('0x7b')],_0x4a093b['value'][_0xdef4('0x7c')],_0x4a093b[_0xdef4('0x71')]['end']);break;}}else{var _0x4a093b=as['buildExpression'](_0x5123e4,_0x28dfba[_0xdef4('0x82')],_0x5546f6);_0x4acda2[_0x46a1f5](_0x4a093b[_0xdef4('0x7b')],_0x4a093b[_0xdef4('0x71')][_0xdef4('0x7c')],_0x4a093b[_0xdef4('0x71')][_0xdef4('0x23')]);}}}else{var _0x1a0fa7=_(_0x795427[_0xdef4('0x49')])[_0xdef4('0x4a')]()['map'](function(_0x1d88e8){return _[_0xdef4('0x83')](_0x35e7e1,[_0xdef4('0x33'),_0x1d88e8])?_0x1d88e8:undefined;})[_0xdef4('0x84')]()[_0xdef4('0x71')]();if(!_[_0xdef4('0x85')](_0x1a0fa7)){_0x1a0fa7[_0xdef4('0x3b')](function(_0x3f9785){if(_0x3f9785==='WhatsappAccountId'){_0x4d2c61['where']('i.WhatsappAccountId\x20IN\x20?',[][_0xdef4('0x86')](_0x795427[_0xdef4('0x49')][_0x3f9785]));}else if(_0x3f9785===_0xdef4('0x87')){var _0x50ef81=JSON['parse'](_0x795427['query'][_0x3f9785])['$gte'];var _0x919635=JSON[_0xdef4('0x88')](_0x795427[_0xdef4('0x49')][_0x3f9785])[_0xdef4('0x89')];_0x4d2c61[_0xdef4('0x53')](_0xdef4('0x8a'),_0x50ef81,_0x919635);}else{if(_0x795427['query'][_0x3f9785]===_0xdef4('0x8b')){_0x4d2c61[_0xdef4('0x53')]('i.'+_0x3f9785+'\x20IS\x20NULL');}else{_0x4d2c61[_0xdef4('0x53')]('i.'+_0x3f9785+'\x20=\x20?',_0x795427['query'][_0x3f9785]);}}});}if(_0x795427[_0xdef4('0x49')][_0xdef4('0x8c')]){if(_0x795427[_0xdef4('0x49')][_0xdef4('0x8c')]==0x1){_0x4d2c61[_0xdef4('0x72')](_0xdef4('0x8d'));}else{_0x4d2c61[_0xdef4('0x72')](_0xdef4('0x8e'));}}if(_0x795427['query']['tag']){_0x3151c2=_[_0xdef4('0x8f')](_0x795427[_0xdef4('0x49')]['tag'])?_0x795427[_0xdef4('0x49')][_0xdef4('0x90')]:new Array(_0x795427[_0xdef4('0x49')]['tag']);_0x3151c2['forEach'](function(_0x9955d3){_0x4ce353['or'](_0xdef4('0x7d'),'%,'+_0x9955d3+',%');});}if(_0x795427[_0xdef4('0x49')]['filter']){var _0xf00bff=_0x795427[_0xdef4('0x49')][_0xdef4('0x91')]['replace']('\x5c','\x5c\x5c')[_0xdef4('0x92')](/'/g,'\x27\x27');if(qs['isNumeric'](_0xf00bff)){_0x4acda2['or'](_0xdef4('0x93'),_0xf00bff+'%')['or'](_0xdef4('0x94'),_0xf00bff+'%');}else{_0x4acda2['or'](_0xdef4('0x95'),qs[_0xdef4('0x77')](_0xf00bff))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0xf00bff+'%');}}}_0x4d2c61[_0xdef4('0x53')](_0x4acda2);_0x4d2c61[_0xdef4('0x96')](_0xdef4('0x97'));var _0x363543={'type':db[_0xdef4('0x98')][_0xdef4('0x99')][_0xdef4('0x9a')],'raw':!![]};var _0x23cf42=_0x4d2c61[_0xdef4('0x9b')]();_0x23cf42['field'](_0xdef4('0x97'));_0x23cf42[_0xdef4('0x56')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xdef4('0x70'));if(_0x1d95e7[_0xdef4('0x51')]){_0x1d95e7[_0xdef4('0x51')][_0xdef4('0x3b')](function(_0x2f0308){var _0x44eee2=_0x2f0308[0x0]==='contactName'?_0x2f0308[0x0]:'i.'+_0x2f0308[0x0];_0x4d2c61[_0xdef4('0x51')](_0x44eee2,_0x2f0308[0x1]===_0xdef4('0x9c')?![]:!![]);});}if(!_[_0xdef4('0x85')](_0x3151c2)){_0x4d2c61[_0xdef4('0x72')](_0x4ce353);_0x23cf42[_0xdef4('0x53')](_0xdef4('0x9d'),_0x3151c2);}BPromise[_0xdef4('0x9e')]()['then'](function(){if(!_0x1f23a6){if(_0x795427[_0xdef4('0x49')][_0xdef4('0x9f')])return;_0x23cf42[_0xdef4('0x53')](_0xdef4('0xa0'));_0x4d2c61['where'](_0xdef4('0xa0'));return;}if(_0x795427['user'][_0xdef4('0xa1')]!==_0xdef4('0xa2'))return;return _0x795427[_0xdef4('0xa3')][_0xdef4('0xa4')]({'attributes':['id'],'raw':!![]})['then'](function(_0x1e586b){if(_[_0xdef4('0x85')](_0x1e586b)){_0x23cf42['where']('i.WhatsappAccountId\x20IS\x20NULL');_0x4d2c61['where'](_0xdef4('0xa5'));}else{_0x23cf42[_0xdef4('0x53')](_0xdef4('0xa6'),_[_0xdef4('0x36')](_0x1e586b,'id'));_0x4d2c61[_0xdef4('0x53')](_0xdef4('0xa6'),_[_0xdef4('0x36')](_0x1e586b,'id'));}});})[_0xdef4('0x2f')](function(){if(_0x795427[_0xdef4('0xa3')][_0xdef4('0xa1')]===_0xdef4('0xa2')&&!_0x1f23a6&&!_0x795427[_0xdef4('0x49')][_0xdef4('0x9f')])return[];return db['sequelize'][_0xdef4('0x49')](_0x23cf42[_0xdef4('0xa7')](),_0x363543);})[_0xdef4('0x2f')](function(_0x22e4ff){_0x54f962[_0xdef4('0x27')]=_0x22e4ff[_0xdef4('0x4f')];if(_0x54f962[_0xdef4('0x27')]===0x0)return[];return db['sequelize'][_0xdef4('0x49')](_0x6c0f3f[_0xdef4('0xa7')](),_0x363543)[_0xdef4('0x2f')](function(_0xfd10b8){_0x113e15=_[_0xdef4('0xa8')](_0xfd10b8,'id');_0x363543=_[_0xdef4('0xa9')](_0x363543,{'model':db[_0xdef4('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x795427[_0xdef4('0x49')]['fields']){_0x1d95e7[_0xdef4('0x4e')][_0xdef4('0x3b')](function(_0x39bcf1){_0x4d2c61[_0xdef4('0x56')]('i.'+_0x39bcf1);});}else{_0x4d2c61['field'](_0xdef4('0xaa'),'unreadMessages');_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xab'),'Account.key');_0x4d2c61[_0xdef4('0x56')]('a.mandatoryDisposition',_0xdef4('0xac'));_0x4d2c61[_0xdef4('0x56')]('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',_0xdef4('0xad'));_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xae'));_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xaf'),'Contact.firstName');_0x4d2c61[_0xdef4('0x56')]('c.lastName',_0xdef4('0xb0'));_0x4d2c61['field'](_0xdef4('0xb1'),_0xdef4('0xb2'));_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xb3'),_0xdef4('0xb4'));_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xb5'),_0xdef4('0xb6'));_0x4d2c61['field'](_0xdef4('0xb7'),_0xdef4('0xb8'));_0x4d2c61['field']('o.fullname',_0xdef4('0xb9'));_0x4d2c61[_0xdef4('0x56')](_0xdef4('0xba'),_0xdef4('0xbb'));_0x4d2c61[_0xdef4('0x56')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xdef4('0x39'));}if(_0x1d95e7[_0xdef4('0x28')])_0x4d2c61['limit'](_0x1d95e7['limit']);if(_0x1d95e7[_0xdef4('0x25')])_0x4d2c61[_0xdef4('0x25')](_0x1d95e7['offset']);return db[_0xdef4('0xbc')][_0xdef4('0x49')](_0x4d2c61['toString'](),_0x363543);})['then'](function(_0x38e7c1){if(_0x38e7c1[_0xdef4('0x4f')]>0x0)_0x320e87['where'](_0xdef4('0xbd'),_[_0xdef4('0x36')](_0x38e7c1,'id'));return db['sequelize'][_0xdef4('0x49')](_0x320e87[_0xdef4('0xa7')](),_0x363543)['then'](function(_0x3c0437){var _0x2458f0=_[_0xdef4('0xbe')](_0x3c0437,_0xdef4('0xbf'));var _0x436b42=[];_0x38e7c1[_0xdef4('0x3b')](function(_0x5d7253){_0x436b42[_0xdef4('0xc0')](updateWhatsappInteraction(_0x5d7253,_0x113e15,_0x2458f0));});return BPromise['all'](_0x436b42);});});})['then'](function(_0x133fd8){_0x54f962['rows']=_0x133fd8;return _0x54f962;})['then'](respondWithFilteredResult(_0x10e738,_0x1d95e7))[_0xdef4('0x3c')](handleError(_0x10e738,null));};exports[_0xdef4('0xc1')]=function(_0x4f46a4,_0x3e4dc4){var _0x2bc42e={'raw':![],'where':{'id':_0x4f46a4[_0xdef4('0xc2')]['id']}},_0x2d1616={};_0x2d1616[_0xdef4('0x48')]=_['keys'](db[_0xdef4('0x45')][_0xdef4('0x46')]);_0x2d1616['query']=_[_0xdef4('0x4a')](_0x4f46a4[_0xdef4('0x49')]);_0x2d1616[_0xdef4('0x4b')]=_[_0xdef4('0x4c')](_0x2d1616[_0xdef4('0x48')],_0x2d1616[_0xdef4('0x49')]);_0x2bc42e[_0xdef4('0x4e')]=_['intersection'](_0x2d1616[_0xdef4('0x48')],qs[_0xdef4('0x4d')](_0x4f46a4[_0xdef4('0x49')]['fields']));_0x2bc42e[_0xdef4('0x4e')]=_0x2bc42e['attributes'][_0xdef4('0x4f')]?_0x2bc42e[_0xdef4('0x4e')]:_0x2d1616[_0xdef4('0x48')];if(_0x4f46a4[_0xdef4('0x49')][_0xdef4('0xc3')]){_0x2bc42e['include']=[{'all':!![]}];}_0x2bc42e=_[_0xdef4('0xa9')]({},_0x2bc42e,_0x4f46a4['options']);return db[_0xdef4('0x45')][_0xdef4('0x79')](_0x2bc42e)[_0xdef4('0x2f')](handleEntityNotFound(_0x3e4dc4,null))[_0xdef4('0x2f')](respondWithResult(_0x3e4dc4,null))['catch'](handleError(_0x3e4dc4,null));};exports[_0xdef4('0xc4')]=function(_0x5c2b60,_0x59787a){return db[_0xdef4('0x45')][_0xdef4('0xc4')](_0x5c2b60[_0xdef4('0x80')],{})[_0xdef4('0x2f')](respondWithResult(_0x59787a,0xc9))[_0xdef4('0x3c')](handleError(_0x59787a,null));};exports[_0xdef4('0x2e')]=function(_0x501ba3,_0xddb53b){if(_0x501ba3[_0xdef4('0x80')]['id']){delete _0x501ba3[_0xdef4('0x80')]['id'];}return db[_0xdef4('0x45')][_0xdef4('0x79')]({'where':{'id':_0x501ba3[_0xdef4('0xc2')]['id']}})[_0xdef4('0x2f')](handleEntityNotFound(_0xddb53b,null))['then'](saveUpdates(_0x501ba3[_0xdef4('0x80')],null))[_0xdef4('0x2f')](respondWithResult(_0xddb53b,null))[_0xdef4('0x3c')](handleError(_0xddb53b,null));};exports['destroy']=function(_0x4c75c2,_0x55f471){return db[_0xdef4('0x45')][_0xdef4('0x79')]({'where':{'id':_0x4c75c2[_0xdef4('0xc2')]['id']}})[_0xdef4('0x2f')](handleEntityNotFound(_0x55f471,null))['then'](removeEntity(_0x55f471,null))['catch'](handleError(_0x55f471,null));};exports[_0xdef4('0xc5')]=function(_0x5ec0c3,_0x3c3baa){return db[_0xdef4('0x45')][_0xdef4('0xc5')]()[_0xdef4('0x2f')](respondWithResult(_0x3c3baa,null))[_0xdef4('0x3c')](handleError(_0x3c3baa,null));};exports['addMessage']=function(_0x437624,_0x10013c,_0x2c3156){return db[_0xdef4('0xc6')]['find']({'where':{'id':_0x437624[_0xdef4('0xc2')]['id']}})[_0xdef4('0x2f')](handleEntityNotFound(_0x10013c,null))[_0xdef4('0x2f')](function(_0x392c49){if(_0x392c49){return _0x392c49['addMessage'](_0x437624[_0xdef4('0x80')][_0xdef4('0xc7')],_['omit'](_0x437624[_0xdef4('0x80')],['ids','id'])||{});}})[_0xdef4('0x2f')](respondWithResult(_0x10013c,null))[_0xdef4('0x3c')](handleError(_0x10013c,null));};exports['getMessages']=function(_0x2a0ac8,_0x37155e,_0x57c85d){var _0x18ed96={'raw':![],'where':{}};var _0x597aef={};var _0x502b21={'count':0x0,'rows':[]};return db['WhatsappInteraction'][_0xdef4('0xc8')]({'where':{'id':_0x2a0ac8[_0xdef4('0xc2')]['id']}})[_0xdef4('0x2f')](handleEntityNotFound(_0x37155e,null))['then'](function(_0x3fdd2d){if(_0x3fdd2d){_0x597aef['model']=_[_0xdef4('0x4a')](db[_0xdef4('0xc6')]['rawAttributes']);_0x597aef[_0xdef4('0x49')]=_[_0xdef4('0x4a')](_0x2a0ac8['query']);_0x597aef['filters']=_['intersection'](_0x597aef['model'],_0x597aef['query']);_0x18ed96[_0xdef4('0x4e')]=_[_0xdef4('0x4c')](_0x597aef['model'],qs[_0xdef4('0x4d')](_0x2a0ac8['query'][_0xdef4('0x4d')]));_0x18ed96[_0xdef4('0x4e')]=_0x18ed96[_0xdef4('0x4e')][_0xdef4('0x4f')]?_0x18ed96['attributes']:_0x597aef[_0xdef4('0x48')];if(!_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0xc9')](_0xdef4('0x50'))){_0x18ed96[_0xdef4('0x28')]=qs[_0xdef4('0x28')](_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0x28')]);_0x18ed96['offset']=qs['offset'](_0x2a0ac8['query'][_0xdef4('0x25')]);}_0x18ed96[_0xdef4('0x51')]=qs[_0xdef4('0x52')](_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0x52')]);_0x18ed96[_0xdef4('0x53')]=qs[_0xdef4('0x4b')](_[_0xdef4('0x54')](_0x2a0ac8[_0xdef4('0x49')],_0x597aef[_0xdef4('0x4b')]));_0x18ed96[_0xdef4('0x53')]['WhatsappInteractionId']=_0x3fdd2d['id'];if(_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0x91')]){_0x18ed96[_0xdef4('0x53')]=_[_0xdef4('0xa9')](_0x18ed96[_0xdef4('0x53')],{'$or':_[_0xdef4('0x36')](_0x18ed96[_0xdef4('0x4e')],function(_0x24b49c){var _0x4ce07d={};_0x4ce07d[_0x24b49c]={'$like':'%'+_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0x91')]+'%'};return _0x4ce07d;})});}if(_0x2a0ac8[_0xdef4('0x49')][_0xdef4('0xca')]){var _0x1bfd67=_0x2a0ac8['query'][_0xdef4('0xca')]['split'](',');var _0x22cf2d={};_0x22cf2d[_0x1bfd67[0x0]]={'$gte':moment(_0x1bfd67[0x1])[_0xdef4('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')};_0x18ed96['where']=_[_0xdef4('0xa9')](_0x18ed96[_0xdef4('0x53')],_0x22cf2d);}_0x18ed96=_[_0xdef4('0xa9')]({},_0x18ed96,_0x2a0ac8['options']);return db[_0xdef4('0xc6')][_0xdef4('0x27')]({'where':_0x18ed96[_0xdef4('0x53')]})[_0xdef4('0x2f')](function(_0x2e7f81){_0x502b21['count']=_0x2e7f81;if(_0x2a0ac8[_0xdef4('0x49')]['includeAll']){_0x18ed96[_0xdef4('0xcc')]=[{'all':!![]}];}return db['WhatsappMessage'][_0xdef4('0xcd')](_0x18ed96);})[_0xdef4('0x2f')](function(_0x1f468f){_0x502b21['rows']=_0x1f468f;return _0x502b21;});}})[_0xdef4('0x2f')](respondWithFilteredResult(_0x37155e,_0x18ed96))[_0xdef4('0x3c')](handleError(_0x37155e,null));};exports['addTags']=function(_0x24e7ea,_0x522506,_0x472fc3){return db[_0xdef4('0x45')][_0xdef4('0x79')]({'where':{'id':_0x24e7ea['params']['id']}})['then'](handleEntityNotFound(_0x522506,null))[_0xdef4('0x2f')](function(_0x3edd6b){if(_0x3edd6b){return _0x3edd6b[_0xdef4('0xce')](_0x24e7ea[_0xdef4('0x80')][_0xdef4('0xc7')],_[_0xdef4('0xcf')](_0x24e7ea[_0xdef4('0x80')],[_0xdef4('0xc7'),'id'])||{})[_0xdef4('0xd0')](function(){return db[_0xdef4('0xd1')]['findAll']({'attributes':['id',_0xdef4('0x33'),_0xdef4('0x57')],'where':{'id':_0x24e7ea[_0xdef4('0x80')][_0xdef4('0xc7')]}});})[_0xdef4('0x2f')](function(_0x51cccf){socket[_0xdef4('0xd2')](_0xdef4('0xd3'),{'id':Number(_0x24e7ea[_0xdef4('0xc2')]['id']),'tags':_0x51cccf||[]});return{'id':Number(_0x24e7ea[_0xdef4('0xc2')]['id']),'tags':_0x51cccf||[]};});}})['then'](respondWithResult(_0x522506,null))[_0xdef4('0x3c')](handleError(_0x522506,null));};exports[_0xdef4('0xd4')]=function(_0x5832c0,_0x2202cf,_0xe809ee){return db[_0xdef4('0x45')][_0xdef4('0x79')]({'where':{'id':_0x5832c0['params']['id']}})[_0xdef4('0x2f')](handleEntityNotFound(_0x2202cf,null))[_0xdef4('0x2f')](function(_0xdc1ad0){if(_0xdc1ad0){return _0xdc1ad0[_0xdef4('0xd4')](_0x5832c0[_0xdef4('0x49')]['ids']);}})[_0xdef4('0x2f')](respondWithStatusCode(_0x2202cf,null))[_0xdef4('0x3c')](handleError(_0x2202cf,null));};exports[_0xdef4('0xd5')]=function(_0x564cd2,_0x39ec4d){var _0x59236c=moment()['unix']()['toString']();var _0xd39527=path[_0xdef4('0xd6')](config[_0xdef4('0xd7')],_0xdef4('0xd8'),_0xdef4('0xd9'),'tmp');var _0x583c92=path[_0xdef4('0xd6')](config[_0xdef4('0xd7')],_0xdef4('0xd8'),_0xdef4('0xd9'),_0xdef4('0xda'));var _0x46960b=path['join'](_0xd39527,_0x59236c);var _0x327705=util['format'](_0xdef4('0xdb'),_0x564cd2['params']['id'],_0x59236c);var _0x3a698b=path[_0xdef4('0xd6')](_0xd39527,_0x327705);var _0x4a1108=[];_0x4a1108[_0xdef4('0xc0')]({'model':db[_0xdef4('0x7e')],'as':_0xdef4('0x7e'),'attributes':['id',_0xdef4('0x37')],'raw':!![]});_0x4a1108[_0xdef4('0xc0')]({'model':db[_0xdef4('0xdc')],'as':'Contact','attributes':['id','firstName',_0xdef4('0xdd')],'raw':!![]});if(_0x564cd2[_0xdef4('0x49')][_0xdef4('0xda')]){_0x4a1108[_0xdef4('0xc0')]({'model':db[_0xdef4('0xde')],'as':_0xdef4('0xde'),'raw':!![]});}var _0x3237e0=[{'model':db[_0xdef4('0xc6')],'as':'Messages','attributes':['id','body','createdAt',_0xdef4('0xdf'),_0xdef4('0xe0'),_0xdef4('0x8c')],'include':_0x4a1108}];_0x3237e0[_0xdef4('0xc0')]({'model':db[_0xdef4('0xe1')],'as':_0xdef4('0xe2'),'attributes':['id',_0xdef4('0x33')]});_0x3237e0[_0xdef4('0xc0')]({'model':db[_0xdef4('0x7e')],'as':_0xdef4('0xe3'),'attributes':['id',_0xdef4('0x37')]});return db[_0xdef4('0x45')]['find']({'where':{'id':_0x564cd2[_0xdef4('0xc2')]['id']},'include':_0x3237e0})[_0xdef4('0x2f')](handleEntityNotFound(_0x39ec4d,null))[_0xdef4('0x2f')](function(_0xe8b0ab){if(_0xe8b0ab){var _0x3c60b7=_0xe8b0ab[_0xdef4('0xe4')]({'plain':!![]});fs[_0xdef4('0xe5')](_0x46960b);var _0x4be0f4={'channel':'Whatsapp','account':_0x3c60b7[_0xdef4('0xe2')][_0xdef4('0x33')],'agent':_0x3c60b7[_0xdef4('0xe3')]?_0x3c60b7[_0xdef4('0xe3')][_0xdef4('0x37')]:_0xdef4('0xe6'),'createdAt':moment(_0x3c60b7[_0xdef4('0x87')])[_0xdef4('0xcb')]('YYYY-MM-DD\x20HH:mm:ss')[_0xdef4('0xa7')](),'closedAt':_0x3c60b7[_0xdef4('0x3f')]?moment(_0x3c60b7['closedAt'])['format'](_0xdef4('0xe7'))['toString']():'','disposition':_0x3c60b7[_0xdef4('0xe8')],'messages':_(_0x3c60b7[_0xdef4('0xe9')])[_0xdef4('0x91')]({'secret':![]})[_0xdef4('0x36')](function(_0x39350a){if(_0x39350a['Attachment']){var _0x15442e=path[_0xdef4('0xd6')](_0x583c92,_0x39350a[_0xdef4('0xde')][_0xdef4('0xea')]);if(fs[_0xdef4('0xeb')](_0x15442e)){fs[_0xdef4('0xec')](_0x15442e)[_0xdef4('0xed')](fs[_0xdef4('0xee')](path[_0xdef4('0xd6')](_0x46960b,_0x39350a[_0xdef4('0xde')][_0xdef4('0xea')])));}}return{'date':moment(_0x39350a[_0xdef4('0x87')])[_0xdef4('0xcb')](_0xdef4('0xe7'))[_0xdef4('0xa7')](),'sender':_0x39350a[_0xdef4('0xdf')]==='out'?_0x39350a[_0xdef4('0x7e')]?_0x39350a[_0xdef4('0x7e')][_0xdef4('0x37')]:'System':_0x39350a[_0xdef4('0xef')][_0xdef4('0xf0')]+(_0x39350a[_0xdef4('0xef')][_0xdef4('0xdd')]?'\x20'+_0x39350a[_0xdef4('0xef')][_0xdef4('0xdd')]:''),'body':_0x39350a[_0xdef4('0xde')]?_0x39350a[_0xdef4('0xde')][_0xdef4('0xea')]:_0x39350a[_0xdef4('0x80')],'direction':_0x39350a['direction']===_0xdef4('0xf1')?'A':'C','secret':_0x39350a[_0xdef4('0xe0')],'read':_0x39350a[_0xdef4('0x8c')],'attachment':_0x39350a[_0xdef4('0xde')]};})['value']()};return ejs[_0xdef4('0xf2')](path[_0xdef4('0xd6')](config['root'],_0xdef4('0xd8'),_0xdef4('0xf3'),'downloadInteraction.ejs'),{'interaction':_0x4be0f4})[_0xdef4('0x2f')](function(_0x2a086f){var _0x5b2772=path[_0xdef4('0xd6')](_0x46960b,_0xdef4('0xf4')+_0x3c60b7['id']+'-'+_0x59236c+_0xdef4('0xf5'));var _0x3c6eaf={'path':_0x5b2772,'channel':_0xdef4('0xf6'),'interactionId':_0x3c60b7['id']};return pdf['createPdfFromHTML'](_0x2a086f,_0x3c6eaf);})[_0xdef4('0x2f')](function(){return new BPromise(function(_0x56a2bb,_0x156121){zipdir(_0x46960b,{'saveTo':_0x3a698b},function(_0x3e02b1,_0x205f52){if(_0x3e02b1)return _0x156121(_0x3e02b1);return _0x56a2bb(_0x205f52);});})[_0xdef4('0x2f')](function(){return new BPromise(function(_0x33d5e2,_0xa4cc40){rimraf(_0x46960b,function(_0x705e27){if(_0x705e27)_0xa4cc40(_0x705e27);return _0x33d5e2();});});})[_0xdef4('0x2f')](function(){return _0x39ec4d['download'](_0x3a698b,_0x327705,function(_0x36cd9b){if(_0x36cd9b){console['log'](_0xdef4('0xf7'),_0x36cd9b);}else{fs[_0xdef4('0xf8')](_0x3a698b);}});});});}else{return _0x39ec4d[_0xdef4('0x30')](0xc8);}})[_0xdef4('0x3c')](handleError(_0x39ec4d,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 7c7007a..f83752d 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 _0xbdb7=['setMaxListeners','save','update','remove','getUsers','then','Users','map','setDataValue','unreadMessages','length','emit','catch','events','../../mysqldb','WhatsappInteraction','WhatsappMessage'];(function(_0x2a975a,_0x3cad40){var _0xa85cd0=function(_0x4c0017){while(--_0x4c0017){_0x2a975a['push'](_0x2a975a['shift']());}};_0xa85cd0(++_0x3cad40);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x4e9a22,_0x65e645){_0x4e9a22=_0x4e9a22-0x0;var _0x364420=_0xbdb7[_0x4e9a22];return _0x364420;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var WhatsappInteraction=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var WhatsappMessage=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x3')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x7bdb('0x4')](0x0);var events={'afterCreate':_0x7bdb('0x5'),'afterUpdate':_0x7bdb('0x6'),'afterDestroy':_0x7bdb('0x7')};function emitEvent(_0x47aec5){return function(_0x28542c,_0x4fd1ad,_0x4b5fff){_0x28542c[_0x7bdb('0x8')]({'attributes':['id'],'raw':!![]})[_0x7bdb('0x9')](function(_0x493bde){_0x28542c['setDataValue'](_0x7bdb('0xa'),_0x493bde[_0x7bdb('0xb')](function(_0x530f81){return{'id':_0x530f81['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x28542c['id'],'direction':'in','read':![]},'raw':!![]});})[_0x7bdb('0x9')](function(_0x1a6b61){_0x28542c[_0x7bdb('0xc')](_0x7bdb('0xd'),_0x1a6b61[_0x7bdb('0xe')]);WhatsappInteractionEvents[_0x7bdb('0xf')](_0x47aec5+':'+_0x28542c['id'],_0x28542c);WhatsappInteractionEvents[_0x7bdb('0xf')](_0x47aec5,_0x28542c);_0x4b5fff(null);})[_0x7bdb('0x10')](_0x4b5fff(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module['exports']=WhatsappInteractionEvents; \ No newline at end of file +var _0x0efe=['hasOwnProperty','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch'];(function(_0x504df1,_0x289598){var _0x1063b5=function(_0x627abd){while(--_0x627abd){_0x504df1['push'](_0x504df1['shift']());}};_0x1063b5(++_0x289598);}(_0x0efe,0x110));var _0xe0ef=function(_0x216910,_0x5ce588){_0x216910=_0x216910-0x0;var _0x4a1ec2=_0x0efe[_0x216910];return _0x4a1ec2;};'use strict';var EventEmitter=require(_0xe0ef('0x0'));var WhatsappInteraction=require(_0xe0ef('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0xe0ef('0x1'))['db'][_0xe0ef('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0xe0ef('0x3')](0x0);var events={'afterCreate':_0xe0ef('0x4'),'afterUpdate':_0xe0ef('0x5'),'afterDestroy':_0xe0ef('0x6')};function emitEvent(_0x1119dd){return function(_0x2d1505,_0x36249e,_0x35a50e){_0x2d1505['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x3a6030){_0x2d1505[_0xe0ef('0x7')](_0xe0ef('0x8'),_0x3a6030[_0xe0ef('0x9')](function(_0x27cb2b){return{'id':_0x27cb2b['id']};}));return WhatsappMessage[_0xe0ef('0xa')]({'where':{'WhatsappInteractionId':_0x2d1505['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe0ef('0xb')](function(_0x4ec5dd){_0x2d1505['setDataValue'](_0xe0ef('0xc'),_0x4ec5dd[_0xe0ef('0xd')]);WhatsappInteractionEvents[_0xe0ef('0xe')](_0x1119dd+':'+_0x2d1505['id'],_0x2d1505);WhatsappInteractionEvents['emit'](_0x1119dd,_0x2d1505);_0x35a50e(null);})[_0xe0ef('0xf')](_0x35a50e(null));};}for(var e in events){if(events[_0xe0ef('0x10')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0xe0ef('0x11')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index 8b9c72c..a6b9926 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 _0xd004=['lodash','util','../../config/logger','api','request-promise','path','exports','define','changed','closed','format'];(function(_0x26143b,_0x109523){var _0x119bbc=function(_0x5713ca){while(--_0x5713ca){_0x26143b['push'](_0x26143b['shift']());}};_0x119bbc(++_0x109523);}(_0xd004,0x181));var _0x4d00=function(_0x2774a7,_0x370440){_0x2774a7=_0x2774a7-0x0;var _0x5aadbf=_0xd004[_0x2774a7];return _0x5aadbf;};'use strict';var _=require(_0x4d00('0x0'));var util=require(_0x4d00('0x1'));var logger=require(_0x4d00('0x2'))(_0x4d00('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4d00('0x4'));var fs=require('fs');var path=require(_0x4d00('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./whatsappInteraction.attributes');module[_0x4d00('0x6')]=function(_0x4b1860,_0x5d7850){return _0x4b1860[_0x4d00('0x7')]('WhatsappInteraction',attributes,{'tableName':'whatsapp_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x173f0e,_0x56219c,_0x2a4d4d){if(_0x173f0e[_0x4d00('0x8')](_0x4d00('0x9'))){_0x173f0e['closedAt']=moment()[_0x4d00('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a4d4d(null,_0x173f0e);}}});}; \ No newline at end of file +var _0xcd8b=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappInteraction.attributes','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0xc42e2d,_0x52da3a){var _0x1433d7=function(_0x3eed59){while(--_0x3eed59){_0xc42e2d['push'](_0xc42e2d['shift']());}};_0x1433d7(++_0x52da3a);}(_0xcd8b,0xee));var _0xbcd8=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0xcd8b[_0x47aa64];return _0x549c7a;};'use strict';var _=require(_0xbcd8('0x0'));var util=require(_0xbcd8('0x1'));var logger=require(_0xbcd8('0x2'))(_0xbcd8('0x3'));var moment=require(_0xbcd8('0x4'));var BPromise=require(_0xbcd8('0x5'));var rp=require(_0xbcd8('0x6'));var fs=require('fs');var path=require(_0xbcd8('0x7'));var rimraf=require('rimraf');var config=require(_0xbcd8('0x8'));var attributes=require(_0xbcd8('0x9'));module['exports']=function(_0x462e2b,_0x3b50da){return _0x462e2b['define'](_0xbcd8('0xa'),attributes,{'tableName':_0xbcd8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3e1459,_0x3e571f,_0x455f2b){if(_0x3e1459[_0xbcd8('0xc')](_0xbcd8('0xd'))){_0x3e1459[_0xbcd8('0xe')]=moment()[_0xbcd8('0xf')](_0xbcd8('0x10'));}_0x455f2b(null,_0x3e1459);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 5c8e39e..7295409 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 _0x7dea=['result','catch','WhatsappInteraction','update','body','options','raw','attributes','limit','then','UpdateWhatsappInteraction','AddTagsToWhatsappInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','request','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','stringify','error','WhatsappInteraction,\x20%s,\x20%s','message','request\x20sent'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7dea,0x16b));var _0xa7de=function(_0x35c57b,_0x364336){_0x35c57b=_0x35c57b-0x0;var _0x121cbb=_0x7dea[_0x35c57b];return _0x121cbb;};'use strict';var _=require(_0xa7de('0x0'));var util=require(_0xa7de('0x1'));var moment=require(_0xa7de('0x2'));var BPromise=require(_0xa7de('0x3'));var rs=require(_0xa7de('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7de('0x5'));var jayson=require(_0xa7de('0x6'));var client=jayson[_0xa7de('0x7')][_0xa7de('0x8')]({'port':0x232a});config[_0xa7de('0x9')]=_[_0xa7de('0xa')](config[_0xa7de('0x9')],{'host':_0xa7de('0xb'),'port':0x18eb});var socket=require(_0xa7de('0xc'))(new Redis(config['redis']));require(_0xa7de('0xd'))[_0xa7de('0xe')](socket);function respondWithRpcPromise(_0x59e44e,_0x1b03a6,_0x5cb01a){return new BPromise(function(_0x30eaaf,_0x94fe63){return client[_0xa7de('0xf')](_0x59e44e,_0x5cb01a)['then'](function(_0x491401){logger[_0xa7de('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x1b03a6,'request\x20sent');logger[_0xa7de('0x11')](_0xa7de('0x12'),_0x1b03a6,'request\x20sent',JSON[_0xa7de('0x13')](_0x491401));if(_0x491401[_0xa7de('0x14')]){if(_0x491401['error']['code']===0x1f4){logger[_0xa7de('0x14')](_0xa7de('0x15'),_0x1b03a6,_0x491401[_0xa7de('0x14')][_0xa7de('0x16')]);return _0x94fe63(_0x491401[_0xa7de('0x14')][_0xa7de('0x16')]);}logger['error'](_0xa7de('0x15'),_0x1b03a6,_0x491401[_0xa7de('0x14')][_0xa7de('0x16')]);return _0x30eaaf(_0x491401[_0xa7de('0x14')][_0xa7de('0x16')]);}else{logger[_0xa7de('0x10')](_0xa7de('0x15'),_0x1b03a6,_0xa7de('0x17'));_0x30eaaf(_0x491401[_0xa7de('0x18')][_0xa7de('0x16')]);}})[_0xa7de('0x19')](function(_0x2f8c72){logger[_0xa7de('0x14')](_0xa7de('0x15'),_0x1b03a6,_0x2f8c72);_0x94fe63(_0x2f8c72);});});}exports['UpdateWhatsappInteraction']=function(_0x369f5c){var _0x183c3a=this;return new Promise(function(_0x124ab2,_0x732267){return db[_0xa7de('0x1a')][_0xa7de('0x1b')](_0x369f5c[_0xa7de('0x1c')],{'raw':_0x369f5c[_0xa7de('0x1d')]?_0x369f5c['options'][_0xa7de('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x369f5c['options']?_0x369f5c[_0xa7de('0x1d')]['where']||null:null,'attributes':_0x369f5c['options']?_0x369f5c[_0xa7de('0x1d')][_0xa7de('0x1f')]||null:null,'limit':_0x369f5c[_0xa7de('0x1d')]?_0x369f5c[_0xa7de('0x1d')][_0xa7de('0x20')]||null:null})[_0xa7de('0x21')](function(_0x12a718){logger[_0xa7de('0x10')](_0xa7de('0x22'),_0x369f5c);logger['debug']('UpdateWhatsappInteraction',_0x369f5c,JSON[_0xa7de('0x13')](_0x12a718));_0x124ab2(_0x12a718);})[_0xa7de('0x19')](function(_0x28d094){logger[_0xa7de('0x14')](_0xa7de('0x22'),_0x28d094[_0xa7de('0x16')],_0x369f5c);_0x732267(_0x183c3a[_0xa7de('0x14')](0x1f4,_0x28d094[_0xa7de('0x16')]));});});};exports[_0xa7de('0x23')]=function(_0x56c644){return new Promise(function(_0x4e4fe5,_0x38e790){return db[_0xa7de('0x1a')][_0xa7de('0x24')]({'where':_0x56c644[_0xa7de('0x1d')]?_0x56c644[_0xa7de('0x1d')][_0xa7de('0x25')]||null:null})[_0xa7de('0x21')](function(_0x391bb7){if(_0x391bb7){return _0x391bb7[_0xa7de('0x26')](_0x56c644[_0xa7de('0x1c')]['ids'],_[_0xa7de('0x27')](_0x56c644[_0xa7de('0x1c')],[_0xa7de('0x28'),'id'])||{});}})[_0xa7de('0x29')](function(_0x1985ef){logger[_0xa7de('0x10')]('AddTags',_0x56c644);logger[_0xa7de('0x11')](_0xa7de('0x2a'),_0x56c644,JSON[_0xa7de('0x13')](_0x1985ef));_0x4e4fe5(_0x1985ef);})['catch'](function(_0x7d345b){logger[_0xa7de('0x14')](_0xa7de('0x2a'),_0x7d345b[_0xa7de('0x16')],_0x56c644);_0x38e790(_this[_0xa7de('0x14')](0x1f4,_0x7d345b[_0xa7de('0x16')]));});});}; \ No newline at end of file +var _0xb67c=['AddTagsToWhatsappInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','./whatsappInteraction.socket','register','then','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateWhatsappInteraction','WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify'];(function(_0x1c20ed,_0x5c4c13){var _0x3fe93d=function(_0x2185e0){while(--_0x2185e0){_0x1c20ed['push'](_0x1c20ed['shift']());}};_0x3fe93d(++_0x5c4c13);}(_0xb67c,0x1ab));var _0xcb67=function(_0xe90ec9,_0x29e6cc){_0xe90ec9=_0xe90ec9-0x0;var _0x1c10fc=_0xb67c[_0xe90ec9];return _0x1c10fc;};'use strict';var _=require(_0xcb67('0x0'));var util=require(_0xcb67('0x1'));var moment=require(_0xcb67('0x2'));var BPromise=require(_0xcb67('0x3'));var rs=require(_0xcb67('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcb67('0x5'));var logger=require(_0xcb67('0x6'))(_0xcb67('0x7'));var config=require(_0xcb67('0x8'));var jayson=require(_0xcb67('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xcb67('0xa')](config[_0xcb67('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb67('0xb')]));require(_0xcb67('0xc'))[_0xcb67('0xd')](socket);function respondWithRpcPromise(_0x130ac5,_0x1b716a,_0x493ab5){return new BPromise(function(_0x22f357,_0x16e155){return client['request'](_0x130ac5,_0x493ab5)[_0xcb67('0xe')](function(_0x10fc4){logger[_0xcb67('0xf')](_0xcb67('0x10'),_0x1b716a,_0xcb67('0x11'));logger[_0xcb67('0x12')](_0xcb67('0x13'),_0x1b716a,_0xcb67('0x11'),JSON['stringify'](_0x10fc4));if(_0x10fc4['error']){if(_0x10fc4[_0xcb67('0x14')][_0xcb67('0x15')]===0x1f4){logger[_0xcb67('0x14')](_0xcb67('0x10'),_0x1b716a,_0x10fc4[_0xcb67('0x14')][_0xcb67('0x16')]);return _0x16e155(_0x10fc4[_0xcb67('0x14')][_0xcb67('0x16')]);}logger[_0xcb67('0x14')](_0xcb67('0x10'),_0x1b716a,_0x10fc4[_0xcb67('0x14')][_0xcb67('0x16')]);return _0x22f357(_0x10fc4['error']['message']);}else{logger[_0xcb67('0xf')]('WhatsappInteraction,\x20%s,\x20%s',_0x1b716a,'request\x20sent');_0x22f357(_0x10fc4[_0xcb67('0x17')][_0xcb67('0x16')]);}})[_0xcb67('0x18')](function(_0xe56c2c){logger['error'](_0xcb67('0x10'),_0x1b716a,_0xe56c2c);_0x16e155(_0xe56c2c);});});}exports[_0xcb67('0x19')]=function(_0x5be9db){var _0xbaadb7=this;return new Promise(function(_0x5b08af,_0x55068b){return db[_0xcb67('0x1a')][_0xcb67('0x1b')](_0x5be9db[_0xcb67('0x1c')],{'raw':_0x5be9db[_0xcb67('0x1d')]?_0x5be9db[_0xcb67('0x1d')][_0xcb67('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5be9db['options']?_0x5be9db[_0xcb67('0x1d')][_0xcb67('0x1f')]||null:null,'attributes':_0x5be9db[_0xcb67('0x1d')]?_0x5be9db[_0xcb67('0x1d')][_0xcb67('0x20')]||null:null,'limit':_0x5be9db[_0xcb67('0x1d')]?_0x5be9db[_0xcb67('0x1d')][_0xcb67('0x21')]||null:null})[_0xcb67('0xe')](function(_0x3cf553){logger['info'](_0xcb67('0x19'),_0x5be9db);logger[_0xcb67('0x12')](_0xcb67('0x19'),_0x5be9db,JSON[_0xcb67('0x22')](_0x3cf553));_0x5b08af(_0x3cf553);})[_0xcb67('0x18')](function(_0x4fa778){logger[_0xcb67('0x14')](_0xcb67('0x19'),_0x4fa778[_0xcb67('0x16')],_0x5be9db);_0x55068b(_0xbaadb7[_0xcb67('0x14')](0x1f4,_0x4fa778[_0xcb67('0x16')]));});});};exports[_0xcb67('0x23')]=function(_0x17d2f0){return new Promise(function(_0x4de4c0,_0x175b6c){return db['WhatsappInteraction'][_0xcb67('0x24')]({'where':_0x17d2f0[_0xcb67('0x1d')]?_0x17d2f0['options'][_0xcb67('0x1f')]||null:null})[_0xcb67('0xe')](function(_0x31249e){if(_0x31249e){return _0x31249e[_0xcb67('0x25')](_0x17d2f0[_0xcb67('0x1c')][_0xcb67('0x26')],_[_0xcb67('0x27')](_0x17d2f0[_0xcb67('0x1c')],[_0xcb67('0x26'),'id'])||{});}})[_0xcb67('0x28')](function(_0x562b84){logger[_0xcb67('0xf')]('AddTags',_0x17d2f0);logger[_0xcb67('0x12')](_0xcb67('0x29'),_0x17d2f0,JSON[_0xcb67('0x22')](_0x562b84));_0x4de4c0(_0x562b84);})[_0xcb67('0x18')](function(_0x4b4ad5){logger['error']('AddTags',_0x4b4ad5['message'],_0x17d2f0);_0x175b6c(_this[_0xcb67('0x14')](0x1f4,_0x4b4ad5[_0xcb67('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index a8e8d35..0fc6485 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 _0x914a=['update','emit','register','whatsappInteraction:','./whatsappInteraction.events','save','remove'];(function(_0x4f968c,_0x344113){var _0x374293=function(_0x22a552){while(--_0x22a552){_0x4f968c['push'](_0x4f968c['shift']());}};_0x374293(++_0x344113);}(_0x914a,0x1e0));var _0xa914=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x914a[_0x25d2fb];return _0x1ded53;};'use strict';var WhatsappInteractionEvents=require(_0xa914('0x0'));var events=[_0xa914('0x1'),_0xa914('0x2'),_0xa914('0x3')];function createListener(_0x51fa16,_0xeff403){return function(_0x514c48){_0xeff403[_0xa914('0x4')](_0x51fa16,_0x514c48);};}function removeListener(_0x791f09,_0x7a1399){return function(){WhatsappInteractionEvents['removeListener'](_0x791f09,_0x7a1399);};}exports[_0xa914('0x5')]=function(_0x433047){for(var _0x30aa3a=0x0,_0x5cc44a=events['length'];_0x30aa3a<_0x5cc44a;_0x30aa3a++){var _0x113795=events[_0x30aa3a];var _0x4f2ce8=createListener(_0xa914('0x6')+_0x113795,_0x433047);WhatsappInteractionEvents['on'](_0x113795,_0x4f2ce8);}}; \ No newline at end of file +var _0x5fbe=['emit','removeListener','register','length','whatsappInteraction:','save','remove'];(function(_0x31c978,_0x9ec435){var _0x384c44=function(_0x38501d){while(--_0x38501d){_0x31c978['push'](_0x31c978['shift']());}};_0x384c44(++_0x9ec435);}(_0x5fbe,0xde));var _0xe5fb=function(_0x1db776,_0x3f1e4f){_0x1db776=_0x1db776-0x0;var _0x4d97e1=_0x5fbe[_0x1db776];return _0x4d97e1;};'use strict';var WhatsappInteractionEvents=require('./whatsappInteraction.events');var events=[_0xe5fb('0x0'),_0xe5fb('0x1'),'update'];function createListener(_0x21a9a7,_0x266345){return function(_0x1f4b54){_0x266345[_0xe5fb('0x2')](_0x21a9a7,_0x1f4b54);};}function removeListener(_0x2cc1a1,_0x377653){return function(){WhatsappInteractionEvents[_0xe5fb('0x3')](_0x2cc1a1,_0x377653);};}exports[_0xe5fb('0x4')]=function(_0x660196){for(var _0x5458d6=0x0,_0x413e3f=events[_0xe5fb('0x5')];_0x5458d6<_0x413e3f;_0x5458d6++){var _0x1e4a28=events[_0x5458d6];var _0x4291a2=createListener(_0xe5fb('0x6')+_0x1e4a28,_0x660196);WhatsappInteractionEvents['on'](_0x1e4a28,_0x4291a2);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index f2af533..e07d0f6 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 _0x7e9f=['delete','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','post','tracked','whatsappmessage:create','create','status','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x2f9bef,_0x4e1892){var _0x390fb0=function(_0x4586f7){while(--_0x4586f7){_0x2f9bef['push'](_0x2f9bef['shift']());}};_0x390fb0(++_0x4e1892);}(_0x7e9f,0x7f));var _0xf7e9=function(_0x4b3c5d,_0x4c9ee1){_0x4b3c5d=_0x4b3c5d-0x0;var _0x5079ae=_0x7e9f[_0x4b3c5d];return _0x5079ae;};'use strict';var multer=require(_0xf7e9('0x0'));var util=require(_0xf7e9('0x1'));var path=require(_0xf7e9('0x2'));var timeout=require('connect-timeout');var express=require(_0xf7e9('0x3'));var router=express['Router']();var fs_extra=require(_0xf7e9('0x4'));var auth=require(_0xf7e9('0x5'));var interaction=require(_0xf7e9('0x6'));var config=require('../../config/environment');var controller=require('./whatsappMessage.controller');router[_0xf7e9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf7e9('0x7')]('/describe',auth[_0xf7e9('0x8')](),controller[_0xf7e9('0x9')]);router[_0xf7e9('0x7')](_0xf7e9('0xa'),auth[_0xf7e9('0x8')](),controller[_0xf7e9('0xb')]);router[_0xf7e9('0xc')]('/',auth[_0xf7e9('0x8')](),interaction[_0xf7e9('0xd')]('whatsapp',_0xf7e9('0xe')),controller[_0xf7e9('0xf')]);router['post']('/:id/status',controller[_0xf7e9('0x10')]);router[_0xf7e9('0x11')]('/:id',auth[_0xf7e9('0x8')](),controller[_0xf7e9('0x12')]);router[_0xf7e9('0x11')](_0xf7e9('0x13'),auth[_0xf7e9('0x8')](),controller[_0xf7e9('0x14')]);router['put'](_0xf7e9('0x15'),auth[_0xf7e9('0x8')](),controller[_0xf7e9('0x16')]);router[_0xf7e9('0x17')](_0xf7e9('0xa'),auth[_0xf7e9('0x8')](),controller[_0xf7e9('0x18')]);module['exports']=router; \ No newline at end of file +var _0xeb36=['destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./whatsappMessage.controller','index','/describe','isAuthenticated','describe','show','tracked','create','/:id/status','status','put','/:id','update','/:id/accept','/:id/reject','reject'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0xeb36,0xca));var _0x6eb3=function(_0x1f738b,_0x223b07){_0x1f738b=_0x1f738b-0x0;var _0x33a15c=_0xeb36[_0x1f738b];return _0x33a15c;};'use strict';var multer=require(_0x6eb3('0x0'));var util=require('util');var path=require(_0x6eb3('0x1'));var timeout=require(_0x6eb3('0x2'));var express=require(_0x6eb3('0x3'));var router=express[_0x6eb3('0x4')]();var fs_extra=require(_0x6eb3('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6eb3('0x6'));var controller=require(_0x6eb3('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6eb3('0x8')]);router['get'](_0x6eb3('0x9'),auth[_0x6eb3('0xa')](),controller[_0x6eb3('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x6eb3('0xc')]);router['post']('/',auth['isAuthenticated'](),interaction[_0x6eb3('0xd')]('whatsapp','whatsappmessage:create'),controller[_0x6eb3('0xe')]);router['post'](_0x6eb3('0xf'),controller[_0x6eb3('0x10')]);router[_0x6eb3('0x11')](_0x6eb3('0x12'),auth[_0x6eb3('0xa')](),controller[_0x6eb3('0x13')]);router[_0x6eb3('0x11')](_0x6eb3('0x14'),auth['isAuthenticated'](),controller['accept']);router[_0x6eb3('0x11')](_0x6eb3('0x15'),auth[_0x6eb3('0xa')](),controller[_0x6eb3('0x16')]);router['delete'](_0x6eb3('0x12'),auth[_0x6eb3('0xa')](),controller[_0x6eb3('0x17')]);module[_0x6eb3('0x18')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index ac81497..910551e 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 _0x1856=['DATE','sequelize','exports','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x1ff50a,_0x22ba70){var _0x179620=function(_0x205a4d){while(--_0x205a4d){_0x1ff50a['push'](_0x1ff50a['shift']());}};_0x179620(++_0x22ba70);}(_0x1856,0x121));var _0x6185=function(_0x216d6f,_0x5e4ab6){_0x216d6f=_0x216d6f-0x0;var _0x20d639=_0x1856[_0x216d6f];return _0x20d639;};'use strict';var Sequelize=require(_0x6185('0x0'));module[_0x6185('0x1')]={'body':{'type':Sequelize[_0x6185('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6185('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6185('0x4')]('in',_0x6185('0x5')),'defaultValue':_0x6185('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x6185('0x6')](0xbe)},'phone':{'type':Sequelize[_0x6185('0x6')]},'readAt':{'type':Sequelize[_0x6185('0x7')]},'secret':{'type':Sequelize[_0x6185('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x6185('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x63b1=['medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x587b4d,_0xdfbfda){var _0x3c8dfd=function(_0x1e4f5c){while(--_0x1e4f5c){_0x587b4d['push'](_0x587b4d['shift']());}};_0x3c8dfd(++_0xdfbfda);}(_0x63b1,0x177));var _0x163b=function(_0x419a54,_0x560dc5){_0x419a54=_0x419a54-0x0;var _0x452c8b=_0x63b1[_0x419a54];return _0x452c8b;};'use strict';var Sequelize=require(_0x163b('0x0'));module[_0x163b('0x1')]={'body':{'type':Sequelize[_0x163b('0x2')](_0x163b('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x163b('0x4')]('in','out'),'defaultValue':_0x163b('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x163b('0x6')](0xbe)},'phone':{'type':Sequelize[_0x163b('0x6')]},'readAt':{'type':Sequelize[_0x163b('0x7')]},'secret':{'type':Sequelize[_0x163b('0x8')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x163b('0x6')]},'providerResponse':{'type':Sequelize[_0x163b('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index 7df87dd..c65ca14 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 _0x8d53=['model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','VIRTUAL','merge','options','include','params','keys','includeAll','create','body','find','destroy','describe','whatsapp-interactions','accept','whatsapp','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','WhatsappInteraction','WhatsappInteractionId','isNil','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','User','fullname','manual','interface','SIP/%s','user','channel','motionChannel','EventManager','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','ContactId','Sequelize','QueryTypes','email','internal','event','rejectmessage','WhatsappAccount','WhatsppMessage,\x20%s,\x20%s,\x20%s','twilio','MessageSid','messageId','MessageStatus','inspect','eml-format','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./whatsappMessage.socket','register','client','http','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','sendStatus','status','undefined','count','set','Content-Range','json','reject','save','update','end','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key'];(function(_0x35b613,_0x2d5355){var _0x1199a8=function(_0x422af2){while(--_0x422af2){_0x35b613['push'](_0x35b613['shift']());}};_0x1199a8(++_0x2d5355);}(_0x8d53,0x159));var _0x38d5=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x8d53[_0x28014d];return _0x2572cc;};'use strict';var emlformat=require(_0x38d5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x38d5('0x1'));var BPromise=require(_0x38d5('0x2'));var Mustache=require(_0x38d5('0x3'));var util=require(_0x38d5('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x38d5('0x5'));var ejs=require(_0x38d5('0x6'));var fs=require('fs');var fs_extra=require(_0x38d5('0x7'));var _=require('lodash');var squel=require(_0x38d5('0x8'));var crypto=require(_0x38d5('0x9'));var jsforce=require(_0x38d5('0xa'));var deskjs=require(_0x38d5('0xb'));var toCsv=require('to-csv');var querystring=require(_0x38d5('0xc'));var Papa=require(_0x38d5('0xd'));var Redis=require(_0x38d5('0xe'));var authService=require(_0x38d5('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38d5('0x10'));var logger=require(_0x38d5('0x11'))(_0x38d5('0x12'));var utils=require(_0x38d5('0x13'));var config=require(_0x38d5('0x14'));var licenseUtil=require(_0x38d5('0x15'));var db=require(_0x38d5('0x16'))['db'];config[_0x38d5('0x17')]=_[_0x38d5('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x38d5('0x19'))(new Redis(config[_0x38d5('0x17')]));require(_0x38d5('0x1a'))[_0x38d5('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x38d5('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x38d5('0x1c')][_0x38d5('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x13d2e7,_0x43e84c,_0x34a43e,_0x2c9a3d){return new BPromise(function(_0x132f84,_0x56c8a8){var _0x560e51=_0x2c9a3d||client;return _0x560e51[_0x38d5('0x1e')](_0x13d2e7,_0x34a43e)[_0x38d5('0x1f')](function(_0x316935){logger[_0x38d5('0x20')](_0x38d5('0x21'),_0x43e84c,'request\x20sent');logger[_0x38d5('0x22')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x43e84c,'request\x20sent',JSON['stringify'](_0x316935));if(_0x316935[_0x38d5('0x23')]){if(_0x316935[_0x38d5('0x23')]['code']===0x1f4){logger['error'](_0x38d5('0x21'),_0x43e84c,_0x316935[_0x38d5('0x23')][_0x38d5('0x24')]);return _0x56c8a8(_0x316935[_0x38d5('0x23')][_0x38d5('0x24')]);}logger[_0x38d5('0x23')]('WhatsappMessage,\x20%s,\x20%s',_0x43e84c,_0x316935['error'][_0x38d5('0x24')]);return _0x132f84(_0x316935[_0x38d5('0x23')][_0x38d5('0x24')]);}else{logger[_0x38d5('0x20')](_0x38d5('0x21'),_0x43e84c,_0x38d5('0x25'));_0x132f84(_0x316935[_0x38d5('0x26')][_0x38d5('0x24')]);}})[_0x38d5('0x27')](function(_0x24fb17){logger['error'](_0x38d5('0x21'),_0x43e84c,_0x24fb17);_0x56c8a8(_0x24fb17);});});}function respondWithStatusCode(_0x1c3dd6,_0x938e9){_0x938e9=_0x938e9||0xcc;return function(_0x25c3de){if(_0x25c3de){return _0x1c3dd6[_0x38d5('0x28')](_0x938e9);}return _0x1c3dd6[_0x38d5('0x29')](_0x938e9)['end']();};}function respondWithResult(_0x31cc38,_0x121310){_0x121310=_0x121310||0xc8;return function(_0x1cb6ca){if(_0x1cb6ca){return _0x31cc38[_0x38d5('0x29')](_0x121310)['json'](_0x1cb6ca);}};}function respondWithFilteredResult(_0x106baf,_0x2696b1){return function(_0x4ba156){if(_0x4ba156){var _0x505bd3=typeof _0x2696b1['offset']===_0x38d5('0x2a')&&typeof _0x2696b1['limit']===_0x38d5('0x2a');var _0x13d8a7=_0x4ba156[_0x38d5('0x2b')];var _0x67c877=_0x505bd3?0x0:_0x2696b1['offset'];var _0x4887f2=_0x505bd3?_0x4ba156['count']:_0x2696b1['offset']+_0x2696b1['limit'];var _0x5668c3;if(_0x4887f2>=_0x13d8a7){_0x4887f2=_0x13d8a7;_0x5668c3=0xc8;}else{_0x5668c3=0xce;}_0x106baf['status'](_0x5668c3);return _0x106baf[_0x38d5('0x2c')](_0x38d5('0x2d'),_0x67c877+'-'+_0x4887f2+'/'+_0x13d8a7)[_0x38d5('0x2e')](_0x4ba156);}return null;};}function patchUpdates(_0x4c2d9a){return function(_0x22434b){try{jsonpatch['apply'](_0x22434b,_0x4c2d9a,!![]);}catch(_0x3d2398){return BPromise[_0x38d5('0x2f')](_0x3d2398);}return _0x22434b[_0x38d5('0x30')]();};}function saveUpdates(_0x362062,_0x2b1282){return function(_0xbac168){if(_0xbac168){return _0xbac168[_0x38d5('0x31')](_0x362062)[_0x38d5('0x1f')](function(_0x1c9da7){return _0x1c9da7;});}return null;};}function removeEntity(_0x450737,_0x5d0b24){return function(_0x279958){if(_0x279958){return _0x279958['destroy']()[_0x38d5('0x1f')](function(){_0x450737[_0x38d5('0x29')](0xcc)[_0x38d5('0x32')]();});}};}function handleEntityNotFound(_0x289d14,_0x15eece){return function(_0x1cd5a7){if(!_0x1cd5a7){_0x289d14['sendStatus'](0x194);}return _0x1cd5a7;};}function handleError(_0x168eb4,_0x1124d6){_0x1124d6=_0x1124d6||0x1f4;return function(_0x57a863){logger[_0x38d5('0x23')](_0x57a863[_0x38d5('0x33')]);if(_0x57a863[_0x38d5('0x34')]){delete _0x57a863[_0x38d5('0x34')];}_0x168eb4[_0x38d5('0x29')](_0x1124d6)[_0x38d5('0x35')](_0x57a863);};}exports[_0x38d5('0x36')]=function(_0x4020bf,_0x3e297b){var _0x45e259={},_0x209aeb={},_0x48c706={'count':0x0,'rows':[]};var _0x4a0175=_[_0x38d5('0x37')](db[_0x38d5('0x38')][_0x38d5('0x39')],function(_0x1a1367){return{'name':_0x1a1367['fieldName'],'type':_0x1a1367[_0x38d5('0x3a')][_0x38d5('0x3b')]};});_0x209aeb[_0x38d5('0x3c')]=_['map'](_0x4a0175,_0x38d5('0x34'));_0x209aeb[_0x38d5('0x3d')]=_['keys'](_0x4020bf[_0x38d5('0x3d')]);_0x209aeb[_0x38d5('0x3e')]=_[_0x38d5('0x3f')](_0x209aeb['model'],_0x209aeb[_0x38d5('0x3d')]);_0x45e259[_0x38d5('0x40')]=_[_0x38d5('0x3f')](_0x209aeb[_0x38d5('0x3c')],qs[_0x38d5('0x41')](_0x4020bf[_0x38d5('0x3d')][_0x38d5('0x41')]));_0x45e259[_0x38d5('0x40')]=_0x45e259['attributes'][_0x38d5('0x42')]?_0x45e259[_0x38d5('0x40')]:_0x209aeb[_0x38d5('0x3c')];if(!_0x4020bf[_0x38d5('0x3d')][_0x38d5('0x43')](_0x38d5('0x44'))){_0x45e259[_0x38d5('0x45')]=qs[_0x38d5('0x45')](_0x4020bf['query'][_0x38d5('0x45')]);_0x45e259[_0x38d5('0x46')]=qs[_0x38d5('0x46')](_0x4020bf[_0x38d5('0x3d')]['offset']);}_0x45e259[_0x38d5('0x47')]=qs['sort'](_0x4020bf[_0x38d5('0x3d')][_0x38d5('0x48')]);_0x45e259[_0x38d5('0x49')]=qs[_0x38d5('0x3e')](_['pick'](_0x4020bf['query'],_0x209aeb[_0x38d5('0x3e')]),_0x4a0175);if(_0x4020bf[_0x38d5('0x3d')][_0x38d5('0x4a')]){_0x45e259[_0x38d5('0x49')]=_['merge'](_0x45e259[_0x38d5('0x49')],{'$or':_['map'](_0x4a0175,function(_0x3ba20d){if(_0x3ba20d[_0x38d5('0x3a')]!==_0x38d5('0x4b')){var _0x25fa46={};_0x25fa46[_0x3ba20d['name']]={'$like':'%'+_0x4020bf[_0x38d5('0x3d')]['filter']+'%'};return _0x25fa46;}})});}_0x45e259=_[_0x38d5('0x4c')]({},_0x45e259,_0x4020bf[_0x38d5('0x4d')]);var _0x3ac7c3={'where':_0x45e259[_0x38d5('0x49')]};return db['WhatsappMessage'][_0x38d5('0x2b')](_0x3ac7c3)[_0x38d5('0x1f')](function(_0x3436cf){_0x48c706[_0x38d5('0x2b')]=_0x3436cf;if(_0x4020bf[_0x38d5('0x3d')]['includeAll']){_0x45e259[_0x38d5('0x4e')]=[{'all':!![]}];}return db[_0x38d5('0x38')]['findAll'](_0x45e259);})[_0x38d5('0x1f')](function(_0xa20884){_0x48c706['rows']=_0xa20884;return _0x48c706;})[_0x38d5('0x1f')](respondWithFilteredResult(_0x3e297b,_0x45e259))['catch'](handleError(_0x3e297b,null));};exports['show']=function(_0x41347e,_0x2ad4b7){var _0x30812e={'raw':!![],'where':{'id':_0x41347e[_0x38d5('0x4f')]['id']}},_0x19934e={};_0x19934e['model']=_[_0x38d5('0x50')](db[_0x38d5('0x38')][_0x38d5('0x39')]);_0x19934e['query']=_[_0x38d5('0x50')](_0x41347e[_0x38d5('0x3d')]);_0x19934e[_0x38d5('0x3e')]=_['intersection'](_0x19934e[_0x38d5('0x3c')],_0x19934e[_0x38d5('0x3d')]);_0x30812e[_0x38d5('0x40')]=_['intersection'](_0x19934e[_0x38d5('0x3c')],qs[_0x38d5('0x41')](_0x41347e['query'][_0x38d5('0x41')]));_0x30812e[_0x38d5('0x40')]=_0x30812e[_0x38d5('0x40')]['length']?_0x30812e[_0x38d5('0x40')]:_0x19934e[_0x38d5('0x3c')];if(_0x41347e['query'][_0x38d5('0x51')]){_0x30812e[_0x38d5('0x4e')]=[{'all':!![]}];}_0x30812e=_['merge']({},_0x30812e,_0x41347e[_0x38d5('0x4d')]);return db[_0x38d5('0x38')]['find'](_0x30812e)['then'](handleEntityNotFound(_0x2ad4b7,null))['then'](respondWithResult(_0x2ad4b7,null))[_0x38d5('0x27')](handleError(_0x2ad4b7,null));};exports[_0x38d5('0x52')]=function(_0x57e092,_0x20753e){return db[_0x38d5('0x38')][_0x38d5('0x52')](_0x57e092[_0x38d5('0x53')],{})['then'](respondWithResult(_0x20753e,0xc9))[_0x38d5('0x27')](handleError(_0x20753e,null));};exports[_0x38d5('0x31')]=function(_0x199aaf,_0x2842ab){if(_0x199aaf[_0x38d5('0x53')]['id']){delete _0x199aaf['body']['id'];}return db['WhatsappMessage'][_0x38d5('0x54')]({'where':{'id':_0x199aaf[_0x38d5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2842ab,null))[_0x38d5('0x1f')](saveUpdates(_0x199aaf[_0x38d5('0x53')],null))[_0x38d5('0x1f')](respondWithResult(_0x2842ab,null))['catch'](handleError(_0x2842ab,null));};exports[_0x38d5('0x55')]=function(_0x3917ac,_0x293230){return db[_0x38d5('0x38')][_0x38d5('0x54')]({'where':{'id':_0x3917ac[_0x38d5('0x4f')]['id']}})[_0x38d5('0x1f')](handleEntityNotFound(_0x293230,null))[_0x38d5('0x1f')](removeEntity(_0x293230,null))['catch'](handleError(_0x293230,null));};exports[_0x38d5('0x56')]=function(_0x3772db,_0x47fbf9){return db[_0x38d5('0x38')][_0x38d5('0x56')]()[_0x38d5('0x1f')](respondWithResult(_0x47fbf9,null))[_0x38d5('0x27')](handleError(_0x47fbf9,null));};var interaction_log=require('../../config/logger')(_0x38d5('0x57'));exports[_0x38d5('0x58')]=function(_0x35105f,_0x1addcd,_0x1f129f){var _0x48c90e={'agent':{},'channel':_0x38d5('0x59')};if(_0x35105f['body']['id']){delete _0x35105f[_0x38d5('0x53')]['id'];}_0x35105f['body'][_0x38d5('0x5a')]=!![];_0x35105f[_0x38d5('0x53')]['readAt']=moment()[_0x38d5('0x5b')](_0x38d5('0x5c'));_0x35105f[_0x38d5('0x53')]['UserId']=_0x35105f[_0x38d5('0x53')][_0x38d5('0x5d')]||_0x35105f['user']['id'];_0x48c90e[_0x38d5('0x5e')]['id']=_0x35105f[_0x38d5('0x53')][_0x38d5('0x5d')];return db[_0x38d5('0x38')][_0x38d5('0x54')]({'where':{'id':_0x35105f[_0x38d5('0x4f')]['id'],'UserId':null}})[_0x38d5('0x1f')](handleEntityNotFound(_0x1addcd,null))[_0x38d5('0x1f')](saveUpdates(_0x35105f['body'],null))[_0x38d5('0x1f')](function(_0x52e1de){if(_0x52e1de){_0x48c90e[_0x38d5('0x24')]=_0x52e1de['get']({'plain':!![]});return db[_0x38d5('0x5f')][_0x38d5('0x54')]({'where':{'id':_0x52e1de[_0x38d5('0x60')]}});}return null;})['then'](handleEntityNotFound(_0x1addcd,null))[_0x38d5('0x1f')](function(_0x335137){if(_0x335137){return _0x335137[_0x38d5('0x31')]({'UserId':_0x35105f[_0x38d5('0x53')][_0x38d5('0x5d')],'read1stAt':_[_0x38d5('0x61')](_0x335137[_0x38d5('0x62')])?moment()[_0x38d5('0x5b')](_0x38d5('0x5c')):undefined});}return null;})[_0x38d5('0x1f')](function(_0x3e9c6d){if(_0x3e9c6d){_0x48c90e[_0x38d5('0x63')]=_0x3e9c6d[_0x38d5('0x64')]({'plain':!![]});interaction_log[_0x38d5('0x20')](_0x38d5('0x65'),_0x35105f['user']['id'],_0x35105f['user'][_0x38d5('0x34')],_0x35105f['user'][_0x38d5('0x66')],_0x48c90e['interaction']['id'],_0x35105f[_0x38d5('0x53')]?JSON[_0x38d5('0x67')](_0x35105f[_0x38d5('0x53')]):'null');return respondWithRpcPromise(_0x38d5('0x68'),_0x38d5('0x69'),_0x48c90e);}return null;})[_0x38d5('0x1f')](function(_0x579084){var _0x23b215=_0x38d5('0x6a')+_0x579084['message']['ContactId'];return db[_0x38d5('0x6b')][_0x38d5('0x3d')](_0x23b215,{'type':db['Sequelize']['QueryTypes'][_0x38d5('0x6c')],'raw':!![]})['then'](function(_0x1c1ad8){return _0x1c1ad8;});})[_0x38d5('0x1f')](function(_0x4d68b6){if(_0x4d68b6){_0x48c90e['message']['contact']=_0x4d68b6[0x0];if(!_0x35105f[_0x38d5('0x53')][_0x38d5('0x5d')])return;return db[_0x38d5('0x6d')]['find']({'where':{'id':_0x35105f['body'][_0x38d5('0x5d')],'role':_0x38d5('0x5e')},'attributes':['id','name',_0x38d5('0x6e'),'email','internal'],'raw':!![]});}return null;})[_0x38d5('0x1f')](function(_0x183c7a){if(!_0x183c7a)return null;_0x48c90e[_0x38d5('0x24')][_0x38d5('0x5e')]=_0x183c7a;return _0x48c90e;})[_0x38d5('0x1f')](function(_0x2b631f){if(_0x2b631f){if(_0x35105f[_0x38d5('0x53')][_0x38d5('0x6f')]){_0x48c90e[_0x38d5('0x24')][_0x38d5('0x70')]=util['format'](_0x38d5('0x71'),_0x35105f[_0x38d5('0x72')][_0x38d5('0x34')]);_0x48c90e[_0x38d5('0x24')]['channel']=_0x48c90e[_0x38d5('0x73')];_0x48c90e[_0x38d5('0x24')][_0x38d5('0x74')]=_0x48c90e['channel'];_0x48c90e[_0x38d5('0x24')]['event']=_0x38d5('0x58');return respondWithRpcPromise(_0x38d5('0x75'),_0x38d5('0x75'),{'event':'acceptmessage','message':_0x48c90e[_0x38d5('0x24')]},client9002)[_0x38d5('0x1f')](function(){return _0x48c90e;});}return _0x48c90e;}return null;})[_0x38d5('0x1f')](respondWithResult(_0x1addcd,null))[_0x38d5('0x27')](handleError(_0x1addcd,null));};var interaction_log=require(_0x38d5('0x11'))(_0x38d5('0x57'));exports[_0x38d5('0x2f')]=function(_0x47ac26,_0x2d6998,_0x2c519c){var _0x1c5c2f={'agent':{},'channel':_0x38d5('0x59')};if(_0x47ac26[_0x38d5('0x53')]['id']){delete _0x47ac26[_0x38d5('0x53')]['id'];}_0x47ac26[_0x38d5('0x53')][_0x38d5('0x5d')]=_0x47ac26[_0x38d5('0x53')]['UserId']||_0x47ac26['user']['id'];_0x1c5c2f['agent']['id']=_0x47ac26[_0x38d5('0x53')][_0x38d5('0x5d')];return db[_0x38d5('0x38')][_0x38d5('0x54')]({'where':{'id':_0x47ac26[_0x38d5('0x4f')]['id'],'UserId':null}})[_0x38d5('0x1f')](handleEntityNotFound(_0x2d6998,null))[_0x38d5('0x1f')](function(_0x2f0fc1){if(_0x2f0fc1){_0x1c5c2f[_0x38d5('0x24')]=_0x2f0fc1[_0x38d5('0x64')]({'plain':!![]});return db[_0x38d5('0x5f')]['find']({'where':{'id':_0x2f0fc1[_0x38d5('0x60')]}});}return null;})[_0x38d5('0x1f')](handleEntityNotFound(_0x2d6998,null))[_0x38d5('0x1f')](function(_0x2cdcc0){if(_0x2cdcc0){_0x1c5c2f[_0x38d5('0x63')]=_0x2cdcc0[_0x38d5('0x64')]({'plain':!![]});interaction_log[_0x38d5('0x20')](_0x38d5('0x76'),_0x47ac26[_0x38d5('0x72')]['id'],_0x47ac26[_0x38d5('0x72')]['name'],_0x47ac26[_0x38d5('0x72')]['role'],_0x1c5c2f[_0x38d5('0x63')]['id'],_0x47ac26['body']?JSON[_0x38d5('0x67')](_0x47ac26[_0x38d5('0x53')]):_0x38d5('0x77'));return respondWithRpcPromise(_0x38d5('0x78'),'rejectMessage',_0x1c5c2f);}return null;})[_0x38d5('0x1f')](function(_0x3978ce){var _0x4ade55=_0x38d5('0x6a')+_0x3978ce['message'][_0x38d5('0x79')];return db[_0x38d5('0x6b')][_0x38d5('0x3d')](_0x4ade55,{'type':db[_0x38d5('0x7a')][_0x38d5('0x7b')][_0x38d5('0x6c')],'raw':!![]})[_0x38d5('0x1f')](function(_0x23700f){return _0x23700f;});})[_0x38d5('0x1f')](function(_0x3e786f){if(_0x3e786f){_0x1c5c2f[_0x38d5('0x24')]['contact']=_0x3e786f[0x0];if(!_0x47ac26[_0x38d5('0x53')][_0x38d5('0x5d')])return;return db[_0x38d5('0x6d')]['find']({'where':{'id':_0x47ac26[_0x38d5('0x53')][_0x38d5('0x5d')],'role':_0x38d5('0x5e')},'attributes':['id',_0x38d5('0x34'),_0x38d5('0x6e'),_0x38d5('0x7c'),_0x38d5('0x7d')],'raw':!![]});}return null;})[_0x38d5('0x1f')](function(_0x383019){if(!_0x383019)return null;_0x1c5c2f[_0x38d5('0x24')]['agent']=_0x383019;return _0x1c5c2f;})[_0x38d5('0x1f')](function(_0x25af38){if(_0x25af38){_0x25af38[_0x38d5('0x24')][_0x38d5('0x70')]=util[_0x38d5('0x5b')]('SIP/%s',_0x47ac26[_0x38d5('0x72')][_0x38d5('0x34')]);_0x25af38['message']['channel']=_0x1c5c2f[_0x38d5('0x73')];_0x25af38[_0x38d5('0x24')]['motionChannel']=_0x1c5c2f[_0x38d5('0x73')];_0x25af38[_0x38d5('0x24')][_0x38d5('0x7e')]='reject';respondWithRpcPromise('EventManager','EventManager',{'event':_0x38d5('0x7f'),'message':_0x25af38[_0x38d5('0x24')]},client9002);return _0x1c5c2f;}return null;})[_0x38d5('0x1f')](respondWithResult(_0x2d6998,null))[_0x38d5('0x27')](handleError(_0x2d6998,null));};exports['status']=function(_0x21a860,_0x180550,_0x3639e3){if(_0x21a860[_0x38d5('0x53')]['id']){delete _0x21a860[_0x38d5('0x53')]['id'];}var _0x194431;return db[_0x38d5('0x38')][_0x38d5('0x54')]({'where':{'id':_0x21a860[_0x38d5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x180550,null))[_0x38d5('0x1f')](function(_0x56f852){if(_0x56f852){_0x194431=_0x56f852;return db[_0x38d5('0x80')][_0x38d5('0x54')]({'where':{'id':_0x56f852['WhatsappAccountId']}});}})[_0x38d5('0x1f')](handleEntityNotFound(_0x180550,null))['then'](function(_0x17724d){if(_0x17724d){logger[_0x38d5('0x22')](_0x38d5('0x81'),'status','received\x20delivery\x20report\x20from',_0x17724d[_0x38d5('0x3a')],util['inspect'](_0x21a860[_0x38d5('0x53')],{'showHidden':![],'depth':null}));switch(_0x17724d[_0x38d5('0x3a')]){case _0x38d5('0x82'):if(_0x21a860[_0x38d5('0x53')][_0x38d5('0x83')]&&_0x21a860[_0x38d5('0x53')][_0x38d5('0x83')]===_0x194431[_0x38d5('0x84')]&&_0x21a860['body'][_0x38d5('0x85')]&&_0x21a860['body']['MessageStatus']===_0x38d5('0x5a')){return _0x194431[_0x38d5('0x31')]({'read':!![]});}else{logger[_0x38d5('0x23')]('WhatsappAccount,\x20%s,\x20%s,\x20%s',_0x38d5('0x29'),_0x38d5('0x82'),util[_0x38d5('0x86')](_0x21a860[_0x38d5('0x53')],{'showHidden':![],'depth':null}));}break;}return _0x194431;}})['then'](respondWithResult(_0x180550,null))[_0x38d5('0x27')](handleError(_0x180550,null));}; \ No newline at end of file +var _0x0236=['inspect','twilio','MessageSid','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','fs-extra','lodash','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','client','http','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','error','message','result','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','index','map','WhatsappMessage','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','params','describe','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','WhatsappInteractionId','isNil','read1stAt','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','interaction','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','manual','interface','channel','motionChannel','EventManager','acceptmessage','whatsapp-interactions','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','contact','email','internal','event','rejectmessage','WhatsappAccount','WhatsappAccountId'];(function(_0x50a5dd,_0x20605c){var _0x5c5759=function(_0x2b0eaf){while(--_0x2b0eaf){_0x50a5dd['push'](_0x50a5dd['shift']());}};_0x5c5759(++_0x20605c);}(_0x0236,0x114));var _0x6023=function(_0x391c55,_0x168617){_0x391c55=_0x391c55-0x0;var _0xa434e0=_0x0236[_0x391c55];return _0xa434e0;};'use strict';var emlformat=require(_0x6023('0x0'));var rimraf=require(_0x6023('0x1'));var zipdir=require(_0x6023('0x2'));var jsonpatch=require(_0x6023('0x3'));var rp=require(_0x6023('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6023('0x5'));var util=require(_0x6023('0x6'));var path=require('path');var sox=require(_0x6023('0x7'));var csv=require(_0x6023('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6023('0x9'));var _=require(_0x6023('0xa'));var squel=require('squel');var crypto=require(_0x6023('0xb'));var jsforce=require(_0x6023('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6023('0x8'));var querystring=require('querystring');var Papa=require(_0x6023('0xd'));var Redis=require(_0x6023('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x6023('0xf'));var hardwareService=require(_0x6023('0x10'));var logger=require(_0x6023('0x11'))(_0x6023('0x12'));var utils=require(_0x6023('0x13'));var config=require(_0x6023('0x14'));var licenseUtil=require(_0x6023('0x15'));var db=require(_0x6023('0x16'))['db'];config['redis']=_[_0x6023('0x17')](config[_0x6023('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x6023('0x19'))(new Redis(config['redis']));require('./whatsappMessage.socket')['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x6023('0x1a')]['http']({'port':0x232c});var client9002=jayson[_0x6023('0x1a')][_0x6023('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x40e24c,_0x43d93d,_0x52409b,_0x5c95f5){return new BPromise(function(_0x6c6be4,_0x3e2974){var _0x34205f=_0x5c95f5||client;return _0x34205f['request'](_0x40e24c,_0x52409b)['then'](function(_0x5946e2){logger[_0x6023('0x1c')](_0x6023('0x1d'),_0x43d93d,_0x6023('0x1e'));logger[_0x6023('0x1f')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x43d93d,_0x6023('0x1e'),JSON['stringify'](_0x5946e2));if(_0x5946e2['error']){if(_0x5946e2[_0x6023('0x20')]['code']===0x1f4){logger['error'](_0x6023('0x1d'),_0x43d93d,_0x5946e2[_0x6023('0x20')][_0x6023('0x21')]);return _0x3e2974(_0x5946e2[_0x6023('0x20')]['message']);}logger[_0x6023('0x20')](_0x6023('0x1d'),_0x43d93d,_0x5946e2[_0x6023('0x20')][_0x6023('0x21')]);return _0x6c6be4(_0x5946e2[_0x6023('0x20')][_0x6023('0x21')]);}else{logger[_0x6023('0x1c')](_0x6023('0x1d'),_0x43d93d,_0x6023('0x1e'));_0x6c6be4(_0x5946e2[_0x6023('0x22')][_0x6023('0x21')]);}})['catch'](function(_0x17ea4c){logger[_0x6023('0x20')](_0x6023('0x1d'),_0x43d93d,_0x17ea4c);_0x3e2974(_0x17ea4c);});});}function respondWithStatusCode(_0xcf1103,_0x985822){_0x985822=_0x985822||0xcc;return function(_0x325dc3){if(_0x325dc3){return _0xcf1103['sendStatus'](_0x985822);}return _0xcf1103[_0x6023('0x23')](_0x985822)['end']();};}function respondWithResult(_0x356ed3,_0x295601){_0x295601=_0x295601||0xc8;return function(_0x1b4d2e){if(_0x1b4d2e){return _0x356ed3[_0x6023('0x23')](_0x295601)[_0x6023('0x24')](_0x1b4d2e);}};}function respondWithFilteredResult(_0x4450c0,_0x218696){return function(_0x4ba357){if(_0x4ba357){var _0x5324bd=typeof _0x218696[_0x6023('0x25')]==='undefined'&&typeof _0x218696['limit']===_0x6023('0x26');var _0x22e793=_0x4ba357[_0x6023('0x27')];var _0x57b2ad=_0x5324bd?0x0:_0x218696['offset'];var _0x5b0d96=_0x5324bd?_0x4ba357[_0x6023('0x27')]:_0x218696[_0x6023('0x25')]+_0x218696[_0x6023('0x28')];var _0x25bcde;if(_0x5b0d96>=_0x22e793){_0x5b0d96=_0x22e793;_0x25bcde=0xc8;}else{_0x25bcde=0xce;}_0x4450c0[_0x6023('0x23')](_0x25bcde);return _0x4450c0['set']('Content-Range',_0x57b2ad+'-'+_0x5b0d96+'/'+_0x22e793)['json'](_0x4ba357);}return null;};}function patchUpdates(_0x3e6046){return function(_0x3bf859){try{jsonpatch[_0x6023('0x29')](_0x3bf859,_0x3e6046,!![]);}catch(_0x201682){return BPromise[_0x6023('0x2a')](_0x201682);}return _0x3bf859[_0x6023('0x2b')]();};}function saveUpdates(_0x12fc29,_0x457224){return function(_0x3e52d8){if(_0x3e52d8){return _0x3e52d8[_0x6023('0x2c')](_0x12fc29)[_0x6023('0x2d')](function(_0x4ca18f){return _0x4ca18f;});}return null;};}function removeEntity(_0x4d9467,_0x17cf95){return function(_0x1ad945){if(_0x1ad945){return _0x1ad945[_0x6023('0x2e')]()[_0x6023('0x2d')](function(){_0x4d9467[_0x6023('0x23')](0xcc)[_0x6023('0x2f')]();});}};}function handleEntityNotFound(_0x2f5309,_0x40b9c5){return function(_0xe7aa8e){if(!_0xe7aa8e){_0x2f5309[_0x6023('0x30')](0x194);}return _0xe7aa8e;};}function handleError(_0x13aab1,_0x35caaf){_0x35caaf=_0x35caaf||0x1f4;return function(_0x4b9ac9){logger['error'](_0x4b9ac9[_0x6023('0x31')]);if(_0x4b9ac9[_0x6023('0x32')]){delete _0x4b9ac9['name'];}_0x13aab1[_0x6023('0x23')](_0x35caaf)[_0x6023('0x33')](_0x4b9ac9);};}exports[_0x6023('0x34')]=function(_0x228cd7,_0x587b6e){var _0x41e436={},_0x613e7a={},_0x1227f9={'count':0x0,'rows':[]};var _0x1ad8ca=_[_0x6023('0x35')](db[_0x6023('0x36')][_0x6023('0x37')],function(_0xb7838f){return{'name':_0xb7838f['fieldName'],'type':_0xb7838f[_0x6023('0x38')][_0x6023('0x39')]};});_0x613e7a[_0x6023('0x3a')]=_['map'](_0x1ad8ca,_0x6023('0x32'));_0x613e7a['query']=_[_0x6023('0x3b')](_0x228cd7[_0x6023('0x3c')]);_0x613e7a[_0x6023('0x3d')]=_[_0x6023('0x3e')](_0x613e7a[_0x6023('0x3a')],_0x613e7a[_0x6023('0x3c')]);_0x41e436[_0x6023('0x3f')]=_['intersection'](_0x613e7a[_0x6023('0x3a')],qs[_0x6023('0x40')](_0x228cd7[_0x6023('0x3c')][_0x6023('0x40')]));_0x41e436[_0x6023('0x3f')]=_0x41e436[_0x6023('0x3f')]['length']?_0x41e436[_0x6023('0x3f')]:_0x613e7a[_0x6023('0x3a')];if(!_0x228cd7[_0x6023('0x3c')]['hasOwnProperty']('nolimit')){_0x41e436[_0x6023('0x28')]=qs['limit'](_0x228cd7['query'][_0x6023('0x28')]);_0x41e436[_0x6023('0x25')]=qs[_0x6023('0x25')](_0x228cd7[_0x6023('0x3c')][_0x6023('0x25')]);}_0x41e436['order']=qs[_0x6023('0x41')](_0x228cd7['query'][_0x6023('0x41')]);_0x41e436['where']=qs[_0x6023('0x3d')](_[_0x6023('0x42')](_0x228cd7[_0x6023('0x3c')],_0x613e7a[_0x6023('0x3d')]),_0x1ad8ca);if(_0x228cd7[_0x6023('0x3c')][_0x6023('0x43')]){_0x41e436[_0x6023('0x44')]=_[_0x6023('0x45')](_0x41e436[_0x6023('0x44')],{'$or':_['map'](_0x1ad8ca,function(_0x1fdb99){if(_0x1fdb99[_0x6023('0x38')]!==_0x6023('0x46')){var _0x5d7bbb={};_0x5d7bbb[_0x1fdb99['name']]={'$like':'%'+_0x228cd7['query']['filter']+'%'};return _0x5d7bbb;}})});}_0x41e436=_['merge']({},_0x41e436,_0x228cd7[_0x6023('0x47')]);var _0x5dc712={'where':_0x41e436['where']};return db[_0x6023('0x36')][_0x6023('0x27')](_0x5dc712)['then'](function(_0x48eeaf){_0x1227f9['count']=_0x48eeaf;if(_0x228cd7[_0x6023('0x3c')]['includeAll']){_0x41e436[_0x6023('0x48')]=[{'all':!![]}];}return db['WhatsappMessage'][_0x6023('0x49')](_0x41e436);})[_0x6023('0x2d')](function(_0x2e7d3d){_0x1227f9[_0x6023('0x4a')]=_0x2e7d3d;return _0x1227f9;})[_0x6023('0x2d')](respondWithFilteredResult(_0x587b6e,_0x41e436))['catch'](handleError(_0x587b6e,null));};exports[_0x6023('0x4b')]=function(_0x277f5d,_0x12cc64){var _0x11f868={'raw':!![],'where':{'id':_0x277f5d['params']['id']}},_0x5287d1={};_0x5287d1[_0x6023('0x3a')]=_[_0x6023('0x3b')](db[_0x6023('0x36')]['rawAttributes']);_0x5287d1['query']=_[_0x6023('0x3b')](_0x277f5d[_0x6023('0x3c')]);_0x5287d1['filters']=_[_0x6023('0x3e')](_0x5287d1[_0x6023('0x3a')],_0x5287d1['query']);_0x11f868['attributes']=_['intersection'](_0x5287d1[_0x6023('0x3a')],qs[_0x6023('0x40')](_0x277f5d[_0x6023('0x3c')]['fields']));_0x11f868[_0x6023('0x3f')]=_0x11f868[_0x6023('0x3f')][_0x6023('0x4c')]?_0x11f868[_0x6023('0x3f')]:_0x5287d1[_0x6023('0x3a')];if(_0x277f5d['query'][_0x6023('0x4d')]){_0x11f868[_0x6023('0x48')]=[{'all':!![]}];}_0x11f868=_[_0x6023('0x45')]({},_0x11f868,_0x277f5d[_0x6023('0x47')]);return db[_0x6023('0x36')][_0x6023('0x4e')](_0x11f868)[_0x6023('0x2d')](handleEntityNotFound(_0x12cc64,null))['then'](respondWithResult(_0x12cc64,null))[_0x6023('0x4f')](handleError(_0x12cc64,null));};exports[_0x6023('0x50')]=function(_0x53eb55,_0x1fe8ec){return db[_0x6023('0x36')]['create'](_0x53eb55[_0x6023('0x51')],{})[_0x6023('0x2d')](respondWithResult(_0x1fe8ec,0xc9))['catch'](handleError(_0x1fe8ec,null));};exports[_0x6023('0x2c')]=function(_0x2cab09,_0xb808ad){if(_0x2cab09['body']['id']){delete _0x2cab09['body']['id'];}return db[_0x6023('0x36')][_0x6023('0x4e')]({'where':{'id':_0x2cab09[_0x6023('0x52')]['id']}})[_0x6023('0x2d')](handleEntityNotFound(_0xb808ad,null))[_0x6023('0x2d')](saveUpdates(_0x2cab09[_0x6023('0x51')],null))[_0x6023('0x2d')](respondWithResult(_0xb808ad,null))[_0x6023('0x4f')](handleError(_0xb808ad,null));};exports[_0x6023('0x2e')]=function(_0x4583a8,_0xa118dc){return db['WhatsappMessage'][_0x6023('0x4e')]({'where':{'id':_0x4583a8[_0x6023('0x52')]['id']}})[_0x6023('0x2d')](handleEntityNotFound(_0xa118dc,null))[_0x6023('0x2d')](removeEntity(_0xa118dc,null))[_0x6023('0x4f')](handleError(_0xa118dc,null));};exports[_0x6023('0x53')]=function(_0xe43c1d,_0x43d671){return db[_0x6023('0x36')][_0x6023('0x53')]()[_0x6023('0x2d')](respondWithResult(_0x43d671,null))[_0x6023('0x4f')](handleError(_0x43d671,null));};var interaction_log=require(_0x6023('0x11'))('whatsapp-interactions');exports[_0x6023('0x54')]=function(_0x19eed0,_0x17bac8,_0x4ac24c){var _0x4c6d48={'agent':{},'channel':_0x6023('0x55')};if(_0x19eed0[_0x6023('0x51')]['id']){delete _0x19eed0[_0x6023('0x51')]['id'];}_0x19eed0[_0x6023('0x51')][_0x6023('0x56')]=!![];_0x19eed0[_0x6023('0x51')][_0x6023('0x57')]=moment()[_0x6023('0x58')](_0x6023('0x59'));_0x19eed0[_0x6023('0x51')]['UserId']=_0x19eed0[_0x6023('0x51')][_0x6023('0x5a')]||_0x19eed0[_0x6023('0x5b')]['id'];_0x4c6d48[_0x6023('0x5c')]['id']=_0x19eed0['body']['UserId'];return db[_0x6023('0x36')][_0x6023('0x4e')]({'where':{'id':_0x19eed0[_0x6023('0x52')]['id'],'UserId':null}})[_0x6023('0x2d')](handleEntityNotFound(_0x17bac8,null))[_0x6023('0x2d')](saveUpdates(_0x19eed0[_0x6023('0x51')],null))[_0x6023('0x2d')](function(_0x253e76){if(_0x253e76){_0x4c6d48['message']=_0x253e76[_0x6023('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0x6023('0x4e')]({'where':{'id':_0x253e76[_0x6023('0x5e')]}});}return null;})[_0x6023('0x2d')](handleEntityNotFound(_0x17bac8,null))[_0x6023('0x2d')](function(_0x412b7a){if(_0x412b7a){return _0x412b7a[_0x6023('0x2c')]({'UserId':_0x19eed0[_0x6023('0x51')][_0x6023('0x5a')],'read1stAt':_[_0x6023('0x5f')](_0x412b7a[_0x6023('0x60')])?moment()[_0x6023('0x58')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6023('0x2d')](function(_0x5437a8){if(_0x5437a8){_0x4c6d48['interaction']=_0x5437a8['get']({'plain':!![]});interaction_log['info'](_0x6023('0x61'),_0x19eed0[_0x6023('0x5b')]['id'],_0x19eed0[_0x6023('0x5b')][_0x6023('0x32')],_0x19eed0['user']['role'],_0x4c6d48[_0x6023('0x62')]['id'],_0x19eed0[_0x6023('0x51')]?JSON[_0x6023('0x63')](_0x19eed0[_0x6023('0x51')]):'null');return respondWithRpcPromise(_0x6023('0x64'),_0x6023('0x65'),_0x4c6d48);}return null;})[_0x6023('0x2d')](function(_0x223a68){var _0x34f44c=_0x6023('0x66')+_0x223a68[_0x6023('0x21')][_0x6023('0x67')];return db[_0x6023('0x68')][_0x6023('0x3c')](_0x34f44c,{'type':db[_0x6023('0x69')][_0x6023('0x6a')][_0x6023('0x6b')],'raw':!![]})[_0x6023('0x2d')](function(_0x578de7){return _0x578de7;});})[_0x6023('0x2d')](function(_0x42d30b){if(_0x42d30b){_0x4c6d48[_0x6023('0x21')]['contact']=_0x42d30b[0x0];if(!_0x19eed0[_0x6023('0x51')][_0x6023('0x5a')])return;return db[_0x6023('0x6c')][_0x6023('0x4e')]({'where':{'id':_0x19eed0[_0x6023('0x51')][_0x6023('0x5a')],'role':_0x6023('0x5c')},'attributes':['id',_0x6023('0x32'),_0x6023('0x6d'),'email','internal'],'raw':!![]});}return null;})[_0x6023('0x2d')](function(_0xedd54b){if(!_0xedd54b)return null;_0x4c6d48[_0x6023('0x21')][_0x6023('0x5c')]=_0xedd54b;return _0x4c6d48;})[_0x6023('0x2d')](function(_0x10b66d){if(_0x10b66d){if(_0x19eed0['body'][_0x6023('0x6e')]){_0x4c6d48[_0x6023('0x21')][_0x6023('0x6f')]=util[_0x6023('0x58')]('SIP/%s',_0x19eed0['user'][_0x6023('0x32')]);_0x4c6d48[_0x6023('0x21')][_0x6023('0x70')]=_0x4c6d48[_0x6023('0x70')];_0x4c6d48[_0x6023('0x21')][_0x6023('0x71')]=_0x4c6d48[_0x6023('0x70')];_0x4c6d48[_0x6023('0x21')]['event']=_0x6023('0x54');return respondWithRpcPromise(_0x6023('0x72'),_0x6023('0x72'),{'event':_0x6023('0x73'),'message':_0x4c6d48[_0x6023('0x21')]},client9002)[_0x6023('0x2d')](function(){return _0x4c6d48;});}return _0x4c6d48;}return null;})[_0x6023('0x2d')](respondWithResult(_0x17bac8,null))[_0x6023('0x4f')](handleError(_0x17bac8,null));};var interaction_log=require('../../config/logger')(_0x6023('0x74'));exports[_0x6023('0x2a')]=function(_0x5b9311,_0x36c2f3,_0x4b0856){var _0x36f038={'agent':{},'channel':_0x6023('0x55')};if(_0x5b9311['body']['id']){delete _0x5b9311[_0x6023('0x51')]['id'];}_0x5b9311[_0x6023('0x51')]['UserId']=_0x5b9311[_0x6023('0x51')][_0x6023('0x5a')]||_0x5b9311[_0x6023('0x5b')]['id'];_0x36f038[_0x6023('0x5c')]['id']=_0x5b9311[_0x6023('0x51')]['UserId'];return db[_0x6023('0x36')][_0x6023('0x4e')]({'where':{'id':_0x5b9311[_0x6023('0x52')]['id'],'UserId':null}})[_0x6023('0x2d')](handleEntityNotFound(_0x36c2f3,null))['then'](function(_0x11221a){if(_0x11221a){_0x36f038[_0x6023('0x21')]=_0x11221a[_0x6023('0x5d')]({'plain':!![]});return db['WhatsappInteraction'][_0x6023('0x4e')]({'where':{'id':_0x11221a[_0x6023('0x5e')]}});}return null;})[_0x6023('0x2d')](handleEntityNotFound(_0x36c2f3,null))['then'](function(_0x27c98c){if(_0x27c98c){_0x36f038['interaction']=_0x27c98c[_0x6023('0x5d')]({'plain':!![]});interaction_log[_0x6023('0x1c')](_0x6023('0x75'),_0x5b9311[_0x6023('0x5b')]['id'],_0x5b9311[_0x6023('0x5b')][_0x6023('0x32')],_0x5b9311[_0x6023('0x5b')][_0x6023('0x76')],_0x36f038[_0x6023('0x62')]['id'],_0x5b9311[_0x6023('0x51')]?JSON[_0x6023('0x63')](_0x5b9311[_0x6023('0x51')]):_0x6023('0x77'));return respondWithRpcPromise(_0x6023('0x78'),_0x6023('0x79'),_0x36f038);}return null;})[_0x6023('0x2d')](function(_0x495667){var _0x1ed30c=_0x6023('0x66')+_0x495667['message'][_0x6023('0x67')];return db[_0x6023('0x68')][_0x6023('0x3c')](_0x1ed30c,{'type':db['Sequelize'][_0x6023('0x6a')][_0x6023('0x6b')],'raw':!![]})[_0x6023('0x2d')](function(_0x4f0d23){return _0x4f0d23;});})['then'](function(_0x2315da){if(_0x2315da){_0x36f038[_0x6023('0x21')][_0x6023('0x7a')]=_0x2315da[0x0];if(!_0x5b9311[_0x6023('0x51')][_0x6023('0x5a')])return;return db[_0x6023('0x6c')][_0x6023('0x4e')]({'where':{'id':_0x5b9311['body'][_0x6023('0x5a')],'role':_0x6023('0x5c')},'attributes':['id','name',_0x6023('0x6d'),_0x6023('0x7b'),_0x6023('0x7c')],'raw':!![]});}return null;})[_0x6023('0x2d')](function(_0x67cb95){if(!_0x67cb95)return null;_0x36f038[_0x6023('0x21')][_0x6023('0x5c')]=_0x67cb95;return _0x36f038;})[_0x6023('0x2d')](function(_0x87d666){if(_0x87d666){_0x87d666[_0x6023('0x21')][_0x6023('0x6f')]=util[_0x6023('0x58')]('SIP/%s',_0x5b9311[_0x6023('0x5b')][_0x6023('0x32')]);_0x87d666[_0x6023('0x21')]['channel']=_0x36f038[_0x6023('0x70')];_0x87d666[_0x6023('0x21')][_0x6023('0x71')]=_0x36f038[_0x6023('0x70')];_0x87d666[_0x6023('0x21')][_0x6023('0x7d')]=_0x6023('0x2a');respondWithRpcPromise(_0x6023('0x72'),_0x6023('0x72'),{'event':_0x6023('0x7e'),'message':_0x87d666[_0x6023('0x21')]},client9002);return _0x36f038;}return null;})['then'](respondWithResult(_0x36c2f3,null))[_0x6023('0x4f')](handleError(_0x36c2f3,null));};exports[_0x6023('0x23')]=function(_0x4cf881,_0x3904c8,_0x587628){if(_0x4cf881[_0x6023('0x51')]['id']){delete _0x4cf881[_0x6023('0x51')]['id'];}var _0x151e74;return db[_0x6023('0x36')]['find']({'where':{'id':_0x4cf881[_0x6023('0x52')]['id']}})[_0x6023('0x2d')](handleEntityNotFound(_0x3904c8,null))[_0x6023('0x2d')](function(_0x37ead5){if(_0x37ead5){_0x151e74=_0x37ead5;return db[_0x6023('0x7f')]['find']({'where':{'id':_0x37ead5[_0x6023('0x80')]}});}})[_0x6023('0x2d')](handleEntityNotFound(_0x3904c8,null))[_0x6023('0x2d')](function(_0x168f9e){if(_0x168f9e){logger[_0x6023('0x1f')]('WhatsppMessage,\x20%s,\x20%s,\x20%s','status','received\x20delivery\x20report\x20from',_0x168f9e['type'],util[_0x6023('0x81')](_0x4cf881[_0x6023('0x51')],{'showHidden':![],'depth':null}));switch(_0x168f9e[_0x6023('0x38')]){case _0x6023('0x82'):if(_0x4cf881['body']['MessageSid']&&_0x4cf881[_0x6023('0x51')][_0x6023('0x83')]===_0x151e74[_0x6023('0x84')]&&_0x4cf881['body'][_0x6023('0x85')]&&_0x4cf881['body']['MessageStatus']===_0x6023('0x56')){return _0x151e74[_0x6023('0x2c')]({'read':!![]});}else{logger['error'](_0x6023('0x86'),'status','twilio',util[_0x6023('0x81')](_0x4cf881[_0x6023('0x51')],{'showHidden':![],'depth':null}));}break;}return _0x151e74;}})[_0x6023('0x2d')](respondWithResult(_0x3904c8,null))[_0x6023('0x4f')](handleError(_0x3904c8,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 94eb521..88c54e4 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 _0xb62e=['hook','events','../../mysqldb','WhatsappMessage','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x8d298e,_0x2daafd){var _0x4b76a4=function(_0x537878){while(--_0x537878){_0x8d298e['push'](_0x8d298e['shift']());}};_0x4b76a4(++_0x2daafd);}(_0xb62e,0x1de));var _0xeb62=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xb62e[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xeb62('0x0'));var WhatsappMessage=require(_0xeb62('0x1'))['db'][_0xeb62('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0xeb62('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xeb62('0x4'),'afterDestroy':_0xeb62('0x5')};function emitEvent(_0x45728e){return function(_0x929329,_0x3c7ad5,_0x1ebdbb){WhatsappMessageEvents['emit'](_0x45728e+':'+_0x929329['id'],_0x929329);WhatsappMessageEvents[_0xeb62('0x6')](_0x45728e,_0x929329);_0x1ebdbb(null);};}for(var e in events){if(events[_0xeb62('0x7')](e)){var event=events[e];WhatsappMessage[_0xeb62('0x8')](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file +var _0x2504=['update','remove','emit','hasOwnProperty','events','../../mysqldb','WhatsappMessage','setMaxListeners','save'];(function(_0x4110bf,_0x3b4f3c){var _0x4e3bba=function(_0x17b33e){while(--_0x17b33e){_0x4110bf['push'](_0x4110bf['shift']());}};_0x4e3bba(++_0x3b4f3c);}(_0x2504,0xee));var _0x4250=function(_0x322e51,_0x541db9){_0x322e51=_0x322e51-0x0;var _0x3fb2a6=_0x2504[_0x322e51];return _0x3fb2a6;};'use strict';var EventEmitter=require(_0x4250('0x0'));var WhatsappMessage=require(_0x4250('0x1'))['db'][_0x4250('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x4250('0x3')](0x0);var events={'afterCreate':_0x4250('0x4'),'afterUpdate':_0x4250('0x5'),'afterDestroy':_0x4250('0x6')};function emitEvent(_0x320d79){return function(_0x17d2d8,_0xc31f3a,_0xe5986d){WhatsappMessageEvents[_0x4250('0x7')](_0x320d79+':'+_0x17d2d8['id'],_0x17d2d8);WhatsappMessageEvents['emit'](_0x320d79,_0x17d2d8);_0xe5986d(null);};}for(var e in events){if(events[_0x4250('0x8')](e)){var event=events[e];WhatsappMessage['hook'](e,emitEvent(event));}}module['exports']=WhatsappMessageEvents; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.model.js b/server/api/whatsappMessage/whatsappMessage.model.js index b5b46ad..8577225 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 _0x54da=['POST','statuses','message_id','err','WhatsappMessage,\x20%s','finally','utf8mb4','lodash','../../config/logger','bluebird','node-fetch','path','rimraf','../../config/environment','messageId','fti_whatsapp_messages','FULLTEXT','get','direction','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','update','createdAt','toLowerCase','catch','error','out','secret','find','WhatsappAccountId','then','type','twilio','accountSid','authToken','phone','messages','body','whatsapp:','/status?token=','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','sinch','baseUrl','/whatsapp/v1/'];(function(_0x184759,_0x1cc38a){var _0xf26d5f=function(_0x1010c8){while(--_0x1010c8){_0x184759['push'](_0x184759['shift']());}};_0xf26d5f(++_0x1cc38a);}(_0x54da,0x9d));var _0xa54d=function(_0x3de41f,_0x1d695c){_0x3de41f=_0x3de41f-0x0;var _0x56ce1f=_0x54da[_0x3de41f];return _0x56ce1f;};'use strict';var _=require(_0xa54d('0x0'));var util=require('util');var logger=require(_0xa54d('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa54d('0x2'));var rp=require('request-promise');var fetch=require(_0xa54d('0x3'));var fs=require('fs');var path=require(_0xa54d('0x4'));var rimraf=require(_0xa54d('0x5'));var config=require(_0xa54d('0x6'));var attributes=require('./whatsappMessage.attributes');module['exports']=function(_0x63ca18,_0x192207){return _0x63ca18['define']('WhatsappMessage',attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xa54d('0x7'),'fields':[_0xa54d('0x7')]},{'name':_0xa54d('0x8'),'fields':['body'],'type':_0xa54d('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x44fdb6,_0x5e57d0,_0x53d9ce){var _0x2708d0=_0x63ca18['models'];var _0x3f0e28=_0x44fdb6[_0xa54d('0xa')]({'plain':!![]});if(_0x3f0e28[_0xa54d('0xb')]['toLowerCase']()==='in'||_0x3f0e28[_0xa54d('0xb')]['toLowerCase']()==='out'&&!_0x3f0e28['secret']&&!_[_0xa54d('0xc')](_0x3f0e28[_0xa54d('0xd')])){_0x2708d0[_0xa54d('0xe')][_0xa54d('0xf')]({'where':{'id':_0x3f0e28[_0xa54d('0x10')]}})['then'](function(_0xb3cf6){if(_0xb3cf6){_0xb3cf6[_0xa54d('0x11')]({'lastMsgAt':_0x3f0e28[_0xa54d('0x12')],'lastMsgDirection':_0x3f0e28[_0xa54d('0xb')][_0xa54d('0x13')]()});}})[_0xa54d('0x14')](function(_0x12a2cc){console[_0xa54d('0x15')](_0x12a2cc);});}if(_0x3f0e28[_0xa54d('0xb')]===_0xa54d('0x16')&&!_0x3f0e28[_0xa54d('0x17')]){var _0x27362d;_0x2708d0['WhatsappAccount'][_0xa54d('0x18')]({'where':{'id':_0x3f0e28[_0xa54d('0x19')]},'raw':!![]})[_0xa54d('0x1a')](function(_0x53ebf3){_0x27362d=_0x53ebf3;if(_0x27362d&&_0x27362d[_0xa54d('0x1b')]){switch(_0x27362d[_0xa54d('0x1b')]){case'twilio':var _0x4d9909=require(_0xa54d('0x1c'));if(_0x27362d[_0xa54d('0x1d')]&&_0x27362d[_0xa54d('0x1e')]&&_0x27362d[_0xa54d('0x1f')]){var _0x2e016a=new _0x4d9909(_0x27362d[_0xa54d('0x1d')],_0x27362d[_0xa54d('0x1e')]);_0x2e016a[_0xa54d('0x20')]['create']({'body':_0x3f0e28[_0xa54d('0x21')],'to':'whatsapp:'+_0x3f0e28['phone'],'from':_0xa54d('0x22')+_0x27362d[_0xa54d('0x1f')],'statusCallback':_0x27362d['remote']+'/api/whatsapp/messages/'+_0x3f0e28['id']+_0xa54d('0x23')+_0x27362d['token']})[_0xa54d('0x1a')](function(_0x13807c){if(_0x13807c[_0xa54d('0x24')]){return _0x44fdb6[_0xa54d('0x11')]({'messageId':_0x13807c[_0xa54d('0x24')]});}})[_0xa54d('0x14')](function(_0xde96e6){logger[_0xa54d('0x15')](_0xa54d('0x25'),_0xa54d('0x26'),_0xa54d('0x1c'),util['inspect'](_0xde96e6,{'showHidden':![],'depth':null}));});}else{logger[_0xa54d('0x15')](_0xa54d('0x25'),_0xa54d('0x26'),'twilio',_0xa54d('0x27'));}break;case _0xa54d('0x28'):var _0x13f701=_0x27362d['accountSid'];var _0x2e10ff=_0x27362d[_0xa54d('0x1e')];var _0x4a0991=_0x27362d[_0xa54d('0x29')]+_0xa54d('0x2a')+_0x13f701+'/messages/';var _0x45ef2d={'to':[_0x3f0e28[_0xa54d('0x1f')]],'message':{'type':'text','text':_0x3f0e28['body']}};var _0x3b1a60={'method':_0xa54d('0x2b'),'uri':_0x4a0991,'headers':{'Authorization':'Bearer\x20'+_0x2e10ff,'Content-Type':'application/json'},'body':_0x45ef2d,'json':!![]};rp(_0x3b1a60)[_0xa54d('0x1a')](function(_0x352edb){if(_0x352edb[_0xa54d('0x2c')][0x0]['message_id']){return _0x44fdb6['update']({'messageId':_0x352edb['statuses'][0x0][_0xa54d('0x2d')]});}})[_0xa54d('0x14')](function(_0x4d94ae){logger[_0xa54d('0x2e')](_0xa54d('0x2f'),_0x4d94ae);});break;}}})[_0xa54d('0x30')](function(){_0x53d9ce();});}else{_0x53d9ce();}}},'charset':_0xa54d('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x9f4c=['update','catch','error','find','WhatsappAccountId','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote','/api/whatsapp/messages/','/status?token=','sid','afterCreate','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','/whatsapp/v1/','/messages/','text','POST','Bearer\x20','application/json','message_id','err','WhatsappMessage,\x20%s','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise','node-fetch','rimraf','../../config/environment','exports','WhatsappMessage','messageId','fti_whatsapp_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','WhatsappInteractionId','then'];(function(_0x3e70ac,_0xd212fa){var _0x202ca0=function(_0x4b72ff){while(--_0x4b72ff){_0x3e70ac['push'](_0x3e70ac['shift']());}};_0x202ca0(++_0xd212fa);}(_0x9f4c,0x19a));var _0xc9f4=function(_0x4418f2,_0x28ffb2){_0x4418f2=_0x4418f2-0x0;var _0xc64612=_0x9f4c[_0x4418f2];return _0xc64612;};'use strict';var _=require(_0xc9f4('0x0'));var util=require('util');var logger=require(_0xc9f4('0x1'))('api');var moment=require(_0xc9f4('0x2'));var BPromise=require(_0xc9f4('0x3'));var rp=require(_0xc9f4('0x4'));var fetch=require(_0xc9f4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc9f4('0x6'));var config=require(_0xc9f4('0x7'));var attributes=require('./whatsappMessage.attributes');module[_0xc9f4('0x8')]=function(_0x3ada07,_0x42bba5){return _0x3ada07['define'](_0xc9f4('0x9'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0xc9f4('0xa'),'fields':[_0xc9f4('0xa')]},{'name':_0xc9f4('0xb'),'fields':[_0xc9f4('0xc')],'type':_0xc9f4('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x421a73,_0x210274,_0x87469e){var _0x3c8cbe=_0x3ada07[_0xc9f4('0xe')];var _0xcfc33f=_0x421a73[_0xc9f4('0xf')]({'plain':!![]});if(_0xcfc33f[_0xc9f4('0x10')][_0xc9f4('0x11')]()==='in'||_0xcfc33f[_0xc9f4('0x10')][_0xc9f4('0x11')]()===_0xc9f4('0x12')&&!_0xcfc33f[_0xc9f4('0x13')]&&!_['isNil'](_0xcfc33f['UserId'])){_0x3c8cbe['WhatsappInteraction']['findOne']({'where':{'id':_0xcfc33f[_0xc9f4('0x14')]}})[_0xc9f4('0x15')](function(_0x3ec575){if(_0x3ec575){_0x3ec575[_0xc9f4('0x16')]({'lastMsgAt':_0xcfc33f['createdAt'],'lastMsgDirection':_0xcfc33f[_0xc9f4('0x10')][_0xc9f4('0x11')]()});}})[_0xc9f4('0x17')](function(_0x189912){console[_0xc9f4('0x18')](_0x189912);});}if(_0xcfc33f[_0xc9f4('0x10')]===_0xc9f4('0x12')&&!_0xcfc33f[_0xc9f4('0x13')]){var _0x474534;_0x3c8cbe['WhatsappAccount'][_0xc9f4('0x19')]({'where':{'id':_0xcfc33f[_0xc9f4('0x1a')]},'raw':!![]})[_0xc9f4('0x15')](function(_0x467ba1){_0x474534=_0x467ba1;if(_0x474534&&_0x474534['type']){switch(_0x474534[_0xc9f4('0x1b')]){case _0xc9f4('0x1c'):var _0x541835=require(_0xc9f4('0x1c'));if(_0x474534[_0xc9f4('0x1d')]&&_0x474534[_0xc9f4('0x1e')]&&_0x474534[_0xc9f4('0x1f')]){var _0x407092=new _0x541835(_0x474534[_0xc9f4('0x1d')],_0x474534['authToken']);_0x407092[_0xc9f4('0x20')][_0xc9f4('0x21')]({'body':_0xcfc33f['body'],'to':_0xc9f4('0x22')+_0xcfc33f[_0xc9f4('0x1f')],'from':_0xc9f4('0x22')+_0x474534[_0xc9f4('0x1f')],'statusCallback':_0x474534[_0xc9f4('0x23')]+_0xc9f4('0x24')+_0xcfc33f['id']+_0xc9f4('0x25')+_0x474534['token']})[_0xc9f4('0x15')](function(_0x1c2428){if(_0x1c2428['sid']){return _0x421a73[_0xc9f4('0x16')]({'messageId':_0x1c2428[_0xc9f4('0x26')]});}})[_0xc9f4('0x17')](function(_0x260515){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0xc9f4('0x27'),_0xc9f4('0x1c'),util[_0xc9f4('0x28')](_0x260515,{'showHidden':![],'depth':null}));});}else{logger[_0xc9f4('0x18')](_0xc9f4('0x29'),_0xc9f4('0x27'),_0xc9f4('0x1c'),_0xc9f4('0x2a'));}break;case'sinch':var _0x927a62=_0x474534[_0xc9f4('0x1d')];var _0x3debb3=_0x474534[_0xc9f4('0x1e')];var _0x25f1d5=_0x474534['baseUrl']+_0xc9f4('0x2b')+_0x927a62+_0xc9f4('0x2c');var _0x4db97e={'to':[_0xcfc33f[_0xc9f4('0x1f')]],'message':{'type':_0xc9f4('0x2d'),'text':_0xcfc33f[_0xc9f4('0xc')]}};var _0x1f0724={'method':_0xc9f4('0x2e'),'uri':_0x25f1d5,'headers':{'Authorization':_0xc9f4('0x2f')+_0x3debb3,'Content-Type':_0xc9f4('0x30')},'body':_0x4db97e,'json':!![]};rp(_0x1f0724)[_0xc9f4('0x15')](function(_0x25d71c){if(_0x25d71c['statuses'][0x0][_0xc9f4('0x31')]){return _0x421a73['update']({'messageId':_0x25d71c['statuses'][0x0][_0xc9f4('0x31')]});}})[_0xc9f4('0x17')](function(_0x5561a2){logger[_0xc9f4('0x32')](_0xc9f4('0x33'),_0x5561a2);});break;}}})['finally'](function(){_0x87469e();});}else{_0x87469e();}}},'charset':_0xc9f4('0x34'),'collate':_0xc9f4('0x35')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index ce27534..6f664fb 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 _0x9e1f=['result','catch','CreateWhatsappMessage','WhatsappMessage','body','options','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','./whatsappMessage.socket','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x9e1f,0x19a));var _0xf9e1=function(_0x4af925,_0x412f25){_0x4af925=_0x4af925-0x0;var _0xa7b75d=_0x9e1f[_0x4af925];return _0xa7b75d;};'use strict';var _=require('lodash');var util=require(_0xf9e1('0x0'));var moment=require('moment');var BPromise=require(_0xf9e1('0x1'));var rs=require(_0xf9e1('0x2'));var fs=require('fs');var Redis=require(_0xf9e1('0x3'));var db=require(_0xf9e1('0x4'))['db'];var utils=require(_0xf9e1('0x5'));var logger=require(_0xf9e1('0x6'))(_0xf9e1('0x7'));var config=require(_0xf9e1('0x8'));var jayson=require(_0xf9e1('0x9'));var client=jayson['client'][_0xf9e1('0xa')]({'port':0x232a});config[_0xf9e1('0xb')]=_[_0xf9e1('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf9e1('0xd'))['register'](socket);function respondWithRpcPromise(_0x136a87,_0x5a5e08,_0x45a201){return new BPromise(function(_0x5be5a8,_0x28d36e){return client[_0xf9e1('0xe')](_0x136a87,_0x45a201)[_0xf9e1('0xf')](function(_0x3206d3){logger[_0xf9e1('0x10')](_0xf9e1('0x11'),_0x5a5e08,_0xf9e1('0x12'));logger[_0xf9e1('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x5a5e08,_0xf9e1('0x12'),JSON[_0xf9e1('0x14')](_0x3206d3));if(_0x3206d3[_0xf9e1('0x15')]){if(_0x3206d3[_0xf9e1('0x15')][_0xf9e1('0x16')]===0x1f4){logger[_0xf9e1('0x15')](_0xf9e1('0x11'),_0x5a5e08,_0x3206d3['error']['message']);return _0x28d36e(_0x3206d3[_0xf9e1('0x15')][_0xf9e1('0x17')]);}logger['error'](_0xf9e1('0x11'),_0x5a5e08,_0x3206d3['error'][_0xf9e1('0x17')]);return _0x5be5a8(_0x3206d3[_0xf9e1('0x15')][_0xf9e1('0x17')]);}else{logger[_0xf9e1('0x10')]('WhatsappMessage,\x20%s,\x20%s',_0x5a5e08,_0xf9e1('0x12'));_0x5be5a8(_0x3206d3[_0xf9e1('0x18')][_0xf9e1('0x17')]);}})[_0xf9e1('0x19')](function(_0x3b8211){logger[_0xf9e1('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x5a5e08,_0x3b8211);_0x28d36e(_0x3b8211);});});}exports[_0xf9e1('0x1a')]=function(_0x4a373d){var _0x4c3619=this;return new Promise(function(_0x137233,_0x2587e9){return db[_0xf9e1('0x1b')]['create'](_0x4a373d[_0xf9e1('0x1c')],{'raw':_0x4a373d[_0xf9e1('0x1d')]?_0x4a373d[_0xf9e1('0x1d')][_0xf9e1('0x1e')]===undefined?!![]:![]:!![]})[_0xf9e1('0xf')](function(_0x195c18){logger['info']('CreateWhatsappMessage',_0x4a373d);logger[_0xf9e1('0x13')](_0xf9e1('0x1a'),_0x4a373d,JSON['stringify'](_0x195c18));_0x137233(_0x195c18);})[_0xf9e1('0x19')](function(_0x470a48){logger[_0xf9e1('0x15')]('CreateWhatsappMessage',_0x470a48[_0xf9e1('0x17')],_0x4a373d);_0x2587e9(_0x4c3619['error'](0x1f4,_0x470a48[_0xf9e1('0x17')]));});});}; \ No newline at end of file +var _0x073d=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','CreateWhatsappMessage','WhatsappMessage','create','body','options','raw','lodash','util','moment'];(function(_0x1e0363,_0x292ef2){var _0x10b297=function(_0x28d450){while(--_0x28d450){_0x1e0363['push'](_0x1e0363['shift']());}};_0x10b297(++_0x292ef2);}(_0x073d,0x105));var _0xd073=function(_0x45f2e1,_0x48b816){_0x45f2e1=_0x45f2e1-0x0;var _0x461542=_0x073d[_0x45f2e1];return _0x461542;};'use strict';var _=require(_0xd073('0x0'));var util=require(_0xd073('0x1'));var moment=require(_0xd073('0x2'));var BPromise=require('bluebird');var rs=require(_0xd073('0x3'));var fs=require('fs');var Redis=require(_0xd073('0x4'));var db=require(_0xd073('0x5'))['db'];var utils=require(_0xd073('0x6'));var logger=require(_0xd073('0x7'))('rpc');var config=require(_0xd073('0x8'));var jayson=require(_0xd073('0x9'));var client=jayson[_0xd073('0xa')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xd073('0xb')],{'host':_0xd073('0xc'),'port':0x18eb});var socket=require(_0xd073('0xd'))(new Redis(config[_0xd073('0xb')]));require(_0xd073('0xe'))[_0xd073('0xf')](socket);function respondWithRpcPromise(_0x4947fd,_0x3a8b67,_0x479d2e){return new BPromise(function(_0x427073,_0x342ae1){return client[_0xd073('0x10')](_0x4947fd,_0x479d2e)[_0xd073('0x11')](function(_0x51ba07){logger[_0xd073('0x12')](_0xd073('0x13'),_0x3a8b67,_0xd073('0x14'));logger[_0xd073('0x15')](_0xd073('0x16'),_0x3a8b67,_0xd073('0x14'),JSON['stringify'](_0x51ba07));if(_0x51ba07[_0xd073('0x17')]){if(_0x51ba07[_0xd073('0x17')]['code']===0x1f4){logger[_0xd073('0x17')](_0xd073('0x13'),_0x3a8b67,_0x51ba07[_0xd073('0x17')][_0xd073('0x18')]);return _0x342ae1(_0x51ba07[_0xd073('0x17')][_0xd073('0x18')]);}logger['error'](_0xd073('0x13'),_0x3a8b67,_0x51ba07[_0xd073('0x17')][_0xd073('0x18')]);return _0x427073(_0x51ba07[_0xd073('0x17')][_0xd073('0x18')]);}else{logger[_0xd073('0x12')](_0xd073('0x13'),_0x3a8b67,_0xd073('0x14'));_0x427073(_0x51ba07[_0xd073('0x19')][_0xd073('0x18')]);}})[_0xd073('0x1a')](function(_0x5c433a){logger[_0xd073('0x17')](_0xd073('0x13'),_0x3a8b67,_0x5c433a);_0x342ae1(_0x5c433a);});});}exports[_0xd073('0x1b')]=function(_0x5e0138){var _0x4ce9a1=this;return new Promise(function(_0x577750,_0x3e65d9){return db[_0xd073('0x1c')][_0xd073('0x1d')](_0x5e0138[_0xd073('0x1e')],{'raw':_0x5e0138[_0xd073('0x1f')]?_0x5e0138['options'][_0xd073('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1b1b2b){logger['info'](_0xd073('0x1b'),_0x5e0138);logger[_0xd073('0x15')](_0xd073('0x1b'),_0x5e0138,JSON['stringify'](_0x1b1b2b));_0x577750(_0x1b1b2b);})[_0xd073('0x1a')](function(_0x38f0eb){logger['error'](_0xd073('0x1b'),_0x38f0eb[_0xd073('0x18')],_0x5e0138);_0x3e65d9(_0x4ce9a1[_0xd073('0x17')](0x1f4,_0x38f0eb['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 73122f7..1de989c 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 _0xcaf2=['./whatsappMessage.events','save','remove','removeListener','register','length','whatsappMessage:'];(function(_0x4a8db4,_0x1045d2){var _0x4ae601=function(_0x381672){while(--_0x381672){_0x4a8db4['push'](_0x4a8db4['shift']());}};_0x4ae601(++_0x1045d2);}(_0xcaf2,0xd9));var _0x2caf=function(_0x4b9d59,_0x910c53){_0x4b9d59=_0x4b9d59-0x0;var _0x2426ba=_0xcaf2[_0x4b9d59];return _0x2426ba;};'use strict';var WhatsappMessageEvents=require(_0x2caf('0x0'));var events=[_0x2caf('0x1'),_0x2caf('0x2'),'update'];function createListener(_0x1da155,_0x45e410){return function(_0x6fa129){_0x45e410['emit'](_0x1da155,_0x6fa129);};}function removeListener(_0x434ef0,_0x525b6b){return function(){WhatsappMessageEvents[_0x2caf('0x3')](_0x434ef0,_0x525b6b);};}exports[_0x2caf('0x4')]=function(_0x2b433a){for(var _0xc89dd0=0x0,_0x583eb8=events[_0x2caf('0x5')];_0xc89dd0<_0x583eb8;_0xc89dd0++){var _0x2ada0d=events[_0xc89dd0];var _0x4dbf5f=createListener(_0x2caf('0x6')+_0x2ada0d,_0x2b433a);WhatsappMessageEvents['on'](_0x2ada0d,_0x4dbf5f);}}; \ No newline at end of file +var _0x0d49=['register','length','whatsappMessage:','./whatsappMessage.events','update','removeListener'];(function(_0x478150,_0x46b73a){var _0x303e3d=function(_0x2301e9){while(--_0x2301e9){_0x478150['push'](_0x478150['shift']());}};_0x303e3d(++_0x46b73a);}(_0x0d49,0x105));var _0x90d4=function(_0x34f70b,_0xcef5d3){_0x34f70b=_0x34f70b-0x0;var _0x386716=_0x0d49[_0x34f70b];return _0x386716;};'use strict';var WhatsappMessageEvents=require(_0x90d4('0x0'));var events=['save','remove',_0x90d4('0x1')];function createListener(_0x310a21,_0x3deba5){return function(_0x30f83d){_0x3deba5['emit'](_0x310a21,_0x30f83d);};}function removeListener(_0x2d9ca6,_0xd5916d){return function(){WhatsappMessageEvents[_0x90d4('0x2')](_0x2d9ca6,_0xd5916d);};}exports[_0x90d4('0x3')]=function(_0x474f63){for(var _0x4b4bd9=0x0,_0x2bc224=events[_0x90d4('0x4')];_0x4b4bd9<_0x2bc224;_0x4b4bd9++){var _0x40a7b6=events[_0x4b4bd9];var _0x3f8ca1=createListener(_0x90d4('0x5')+_0x40a7b6,_0x474f63);WhatsappMessageEvents['on'](_0x40a7b6,_0x3f8ca1);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index a0cadf9..8c7d2bb 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 _0x93f2=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','destroy','removeAgents'];(function(_0x4613c6,_0x5f5406){var _0x17a1d7=function(_0x43f554){while(--_0x43f554){_0x4613c6['push'](_0x4613c6['shift']());}};_0x17a1d7(++_0x5f5406);}(_0x93f2,0x15d));var _0x293f=function(_0x25d386,_0x108d0d){_0x25d386=_0x25d386-0x0;var _0x857f4a=_0x93f2[_0x25d386];return _0x857f4a;};'use strict';var multer=require(_0x293f('0x0'));var util=require('util');var path=require(_0x293f('0x1'));var timeout=require(_0x293f('0x2'));var express=require(_0x293f('0x3'));var router=express[_0x293f('0x4')]();var fs_extra=require(_0x293f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x293f('0x6'));var config=require('../../config/environment');var controller=require(_0x293f('0x7'));router[_0x293f('0x8')]('/',auth[_0x293f('0x9')](),controller[_0x293f('0xa')]);router['get'](_0x293f('0xb'),auth['isAuthenticated'](),controller[_0x293f('0xc')]);router['get']('/:id',auth[_0x293f('0x9')](),controller[_0x293f('0xd')]);router['get'](_0x293f('0xe'),auth[_0x293f('0x9')](),controller[_0x293f('0xf')]);router[_0x293f('0x8')](_0x293f('0x10'),auth[_0x293f('0x9')](),controller[_0x293f('0x11')]);router[_0x293f('0x8')](_0x293f('0x12'),auth[_0x293f('0x9')](),controller[_0x293f('0x13')]);router[_0x293f('0x14')]('/',auth[_0x293f('0x9')](),controller['create']);router[_0x293f('0x14')]('/:id/teams',auth[_0x293f('0x9')](),controller[_0x293f('0x15')]);router[_0x293f('0x14')](_0x293f('0x12'),auth[_0x293f('0x9')](),controller[_0x293f('0x16')]);router['put']('/:id',auth[_0x293f('0x9')](),controller[_0x293f('0x17')]);router[_0x293f('0x18')](_0x293f('0x19'),auth[_0x293f('0x9')](),controller[_0x293f('0x1a')]);router[_0x293f('0x18')]('/:id/teams',auth[_0x293f('0x9')](),controller['removeTeams']);router[_0x293f('0x18')]('/:id/users',auth[_0x293f('0x9')](),controller[_0x293f('0x1b')]);module[_0x293f('0x1c')]=router; \ No newline at end of file +var _0x7ca8=['multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getAgents','create','post','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','/:id/users','removeAgents'];(function(_0x5a2299,_0x3e2922){var _0xedff0f=function(_0x1624cb){while(--_0x1624cb){_0x5a2299['push'](_0x5a2299['shift']());}};_0xedff0f(++_0x3e2922);}(_0x7ca8,0x16c));var _0x87ca=function(_0x522790,_0x1c3834){_0x522790=_0x522790-0x0;var _0x23321f=_0x7ca8[_0x522790];return _0x23321f;};'use strict';var multer=require(_0x87ca('0x0'));var util=require('util');var path=require(_0x87ca('0x1'));var timeout=require(_0x87ca('0x2'));var express=require(_0x87ca('0x3'));var router=express['Router']();var fs_extra=require(_0x87ca('0x4'));var auth=require(_0x87ca('0x5'));var interaction=require(_0x87ca('0x6'));var config=require('../../config/environment');var controller=require(_0x87ca('0x7'));router['get']('/',auth[_0x87ca('0x8')](),controller[_0x87ca('0x9')]);router[_0x87ca('0xa')](_0x87ca('0xb'),auth[_0x87ca('0x8')](),controller[_0x87ca('0xc')]);router[_0x87ca('0xa')](_0x87ca('0xd'),auth[_0x87ca('0x8')](),controller[_0x87ca('0xe')]);router['get'](_0x87ca('0xf'),auth[_0x87ca('0x8')](),controller['getMembers']);router[_0x87ca('0xa')]('/:id/teams',auth[_0x87ca('0x8')](),controller['getTeams']);router[_0x87ca('0xa')]('/:id/users',auth[_0x87ca('0x8')](),controller[_0x87ca('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x87ca('0x11')]);router[_0x87ca('0x12')](_0x87ca('0x13'),auth[_0x87ca('0x8')](),controller[_0x87ca('0x14')]);router[_0x87ca('0x12')]('/:id/users',auth[_0x87ca('0x8')](),controller['addAgents']);router[_0x87ca('0x15')](_0x87ca('0xd'),auth[_0x87ca('0x8')](),controller[_0x87ca('0x16')]);router[_0x87ca('0x17')](_0x87ca('0xd'),auth['isAuthenticated'](),controller[_0x87ca('0x18')]);router['delete'](_0x87ca('0x13'),auth[_0x87ca('0x8')](),controller[_0x87ca('0x19')]);router[_0x87ca('0x17')](_0x87ca('0x1a'),auth[_0x87ca('0x8')](),controller[_0x87ca('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index 7c25152..81012d2 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 _0x05b0=['rrmemory','roundrobin','STRING','name','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x05b0,0x188));var _0x005b=function(_0x4118b8,_0x1053e0){_0x4118b8=_0x4118b8-0x0;var _0x5a3221=_0x05b0[_0x4118b8];return _0x5a3221;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x005b('0x0')],'unique':_0x005b('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x005b('0x2')](_0x005b('0x3'),'beepall',_0x005b('0x4'))},'description':{'type':Sequelize[_0x005b('0x0')]}}; \ No newline at end of file +var _0x3a79=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0x23acad,_0x4edc4c){var _0x1cfba7=function(_0x2e4791){while(--_0x2e4791){_0x23acad['push'](_0x23acad['shift']());}};_0x1cfba7(++_0x4edc4c);}(_0x3a79,0xca));var _0x93a7=function(_0x323782,_0xd84c94){_0x323782=_0x323782-0x0;var _0x433a6f=_0x3a79[_0x323782];return _0x433a6f;};'use strict';var Sequelize=require('sequelize');module[_0x93a7('0x0')]={'name':{'type':Sequelize[_0x93a7('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x93a7('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x93a7('0x3')](_0x93a7('0x4'),_0x93a7('0x5'),_0x93a7('0x6'))},'description':{'type':Sequelize[_0x93a7('0x1')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index a553c7e..c00cfa5 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 _0x1109=['count','set','Content-Range','apply','update','then','destroy','get','WhatsappQueues','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserWhatsappQueue','nolimit','User','findAndCountAll','whatsappPause','updatedAt','createdAt','format','SIP','getTeams','addTeams','ids','Team','Agents','voicePause','interface','flatMap','transaction','each','findOrCreate','forEach','emit','userWhatsappQueue:save','select','field','tq.TeamId','team_has_whatsapp_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','removeAgents','omit','spread','userWhatsappQueue:remove','getAgents','rimraf','fast-json-patch','bluebird','mustache','util','path','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/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','status','json','offset','undefined','limit'];(function(_0x2f376b,_0x48aa7d){var _0x1eb87f=function(_0x4c3fd6){while(--_0x4c3fd6){_0x2f376b['push'](_0x2f376b['shift']());}};_0x1eb87f(++_0x48aa7d);}(_0x1109,0x178));var _0x9110=function(_0x8ce506,_0x517f30){_0x8ce506=_0x8ce506-0x0;var _0x23c8e5=_0x1109[_0x8ce506];return _0x23c8e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9110('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9110('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9110('0x2'));var Mustache=require(_0x9110('0x3'));var util=require(_0x9110('0x4'));var path=require(_0x9110('0x5'));var sox=require(_0x9110('0x6'));var csv=require(_0x9110('0x7'));var ejs=require(_0x9110('0x8'));var fs=require('fs');var fs_extra=require(_0x9110('0x9'));var _=require(_0x9110('0xa'));var squel=require(_0x9110('0xb'));var crypto=require(_0x9110('0xc'));var jsforce=require(_0x9110('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9110('0xe'));var Papa=require(_0x9110('0xf'));var Redis=require('ioredis');var authService=require(_0x9110('0x10'));var qs=require(_0x9110('0x11'));var as=require(_0x9110('0x12'));var hardwareService=require(_0x9110('0x13'));var logger=require(_0x9110('0x14'))(_0x9110('0x15'));var utils=require('../../config/utils');var config=require(_0x9110('0x16'));var licenseUtil=require(_0x9110('0x17'));var db=require(_0x9110('0x18'))['db'];config[_0x9110('0x19')]=_[_0x9110('0x1a')](config['redis'],{'host':_0x9110('0x1b'),'port':0x18eb});var socket=require(_0x9110('0x1c'))(new Redis(config[_0x9110('0x19')]));require(_0x9110('0x1d'))[_0x9110('0x1e')](socket);function respondWithStatusCode(_0x235ba5,_0x3569d0){_0x3569d0=_0x3569d0||0xcc;return function(_0x1dc9c0){if(_0x1dc9c0){return _0x235ba5[_0x9110('0x1f')](_0x3569d0);}return _0x235ba5['status'](_0x3569d0)[_0x9110('0x20')]();};}function respondWithResult(_0x123e4d,_0x267c23){_0x267c23=_0x267c23||0xc8;return function(_0x5cda39){if(_0x5cda39){return _0x123e4d[_0x9110('0x21')](_0x267c23)[_0x9110('0x22')](_0x5cda39);}};}function respondWithFilteredResult(_0x2fa9af,_0x759bb){return function(_0x4b31a2){if(_0x4b31a2){var _0x5c1f15=typeof _0x759bb[_0x9110('0x23')]===_0x9110('0x24')&&typeof _0x759bb[_0x9110('0x25')]==='undefined';var _0x28ef71=_0x4b31a2['count'];var _0x2cdfdf=_0x5c1f15?0x0:_0x759bb[_0x9110('0x23')];var _0x4f7815=_0x5c1f15?_0x4b31a2[_0x9110('0x26')]:_0x759bb[_0x9110('0x23')]+_0x759bb[_0x9110('0x25')];var _0x2a1d01;if(_0x4f7815>=_0x28ef71){_0x4f7815=_0x28ef71;_0x2a1d01=0xc8;}else{_0x2a1d01=0xce;}_0x2fa9af[_0x9110('0x21')](_0x2a1d01);return _0x2fa9af[_0x9110('0x27')](_0x9110('0x28'),_0x2cdfdf+'-'+_0x4f7815+'/'+_0x28ef71)[_0x9110('0x22')](_0x4b31a2);}return null;};}function patchUpdates(_0x4b63dc){return function(_0xe5141b){try{jsonpatch[_0x9110('0x29')](_0xe5141b,_0x4b63dc,!![]);}catch(_0x36b27b){return BPromise['reject'](_0x36b27b);}return _0xe5141b['save']();};}function saveUpdates(_0x5bbc0e,_0x2d9964){return function(_0x4ae277){if(_0x4ae277){return _0x4ae277[_0x9110('0x2a')](_0x5bbc0e)[_0x9110('0x2b')](function(_0x3c4a64){return _0x3c4a64;});}return null;};}function removeEntity(_0x3dd34e,_0x3ab148){return function(_0x396a50){if(_0x396a50){return _0x396a50[_0x9110('0x2c')]()[_0x9110('0x2b')](function(){var _0x2b2823=_0x396a50[_0x9110('0x2d')]({'plain':!![]});var _0x44ac9f=_0x9110('0x2e');return db['UserProfileResource'][_0x9110('0x2c')]({'where':{'type':_0x44ac9f,'resourceId':_0x2b2823['id']}})[_0x9110('0x2b')](function(){return _0x396a50;});})[_0x9110('0x2b')](function(){_0x3dd34e[_0x9110('0x21')](0xcc)[_0x9110('0x20')]();});}};}function handleEntityNotFound(_0x345958,_0x111090){return function(_0x2e980e){if(!_0x2e980e){_0x345958[_0x9110('0x1f')](0x194);}return _0x2e980e;};}function handleError(_0x49d376,_0x36b37b){_0x36b37b=_0x36b37b||0x1f4;return function(_0x3ffa0a){logger['error'](_0x3ffa0a['stack']);if(_0x3ffa0a['name']){delete _0x3ffa0a[_0x9110('0x2f')];}_0x49d376[_0x9110('0x21')](_0x36b37b)[_0x9110('0x30')](_0x3ffa0a);};}exports[_0x9110('0x31')]=function(_0x10b132,_0x2e9d1c){var _0xfe1e55={},_0x354ce9={},_0x70a5a5={'count':0x0,'rows':[]};var _0x27b93b=_[_0x9110('0x32')](db[_0x9110('0x33')][_0x9110('0x34')],function(_0x407fff){return{'name':_0x407fff[_0x9110('0x35')],'type':_0x407fff[_0x9110('0x36')]['key']};});_0x354ce9[_0x9110('0x37')]=_[_0x9110('0x32')](_0x27b93b,_0x9110('0x2f'));_0x354ce9[_0x9110('0x38')]=_['keys'](_0x10b132['query']);_0x354ce9[_0x9110('0x39')]=_[_0x9110('0x3a')](_0x354ce9[_0x9110('0x37')],_0x354ce9[_0x9110('0x38')]);_0xfe1e55[_0x9110('0x3b')]=_[_0x9110('0x3a')](_0x354ce9['model'],qs[_0x9110('0x3c')](_0x10b132[_0x9110('0x38')][_0x9110('0x3c')]));_0xfe1e55['attributes']=_0xfe1e55[_0x9110('0x3b')][_0x9110('0x3d')]?_0xfe1e55[_0x9110('0x3b')]:_0x354ce9[_0x9110('0x37')];if(!_0x10b132[_0x9110('0x38')][_0x9110('0x3e')]('nolimit')){_0xfe1e55['limit']=qs[_0x9110('0x25')](_0x10b132[_0x9110('0x38')][_0x9110('0x25')]);_0xfe1e55[_0x9110('0x23')]=qs['offset'](_0x10b132['query'][_0x9110('0x23')]);}_0xfe1e55[_0x9110('0x3f')]=qs['sort'](_0x10b132[_0x9110('0x38')][_0x9110('0x40')]);_0xfe1e55[_0x9110('0x41')]=qs['filters'](_[_0x9110('0x42')](_0x10b132[_0x9110('0x38')],_0x354ce9[_0x9110('0x39')]),_0x27b93b);if(_0x10b132[_0x9110('0x38')][_0x9110('0x43')]){_0xfe1e55['where']=_['merge'](_0xfe1e55[_0x9110('0x41')],{'$or':_[_0x9110('0x32')](_0x27b93b,function(_0x7c574e){if(_0x7c574e[_0x9110('0x36')]!=='VIRTUAL'){var _0x2a5d07={};_0x2a5d07[_0x7c574e[_0x9110('0x2f')]]={'$like':'%'+_0x10b132[_0x9110('0x38')][_0x9110('0x43')]+'%'};return _0x2a5d07;}})});}_0xfe1e55=_[_0x9110('0x44')]({},_0xfe1e55,_0x10b132[_0x9110('0x45')]);var _0x44afc1={'where':_0xfe1e55[_0x9110('0x41')]};return db['WhatsappQueue'][_0x9110('0x26')](_0x44afc1)['then'](function(_0x50b441){_0x70a5a5[_0x9110('0x26')]=_0x50b441;if(_0x10b132[_0x9110('0x38')][_0x9110('0x46')]){_0xfe1e55['include']=[{'all':!![]}];}return db[_0x9110('0x33')][_0x9110('0x47')](_0xfe1e55);})[_0x9110('0x2b')](function(_0x2cf2f9){_0x70a5a5[_0x9110('0x48')]=_0x2cf2f9;return _0x70a5a5;})[_0x9110('0x2b')](respondWithFilteredResult(_0x2e9d1c,_0xfe1e55))[_0x9110('0x49')](handleError(_0x2e9d1c,null));};exports['show']=function(_0x4cc536,_0x403cac){var _0x1bab46={'raw':!![],'where':{'id':_0x4cc536[_0x9110('0x4a')]['id']}},_0x5a4a0c={};_0x5a4a0c[_0x9110('0x37')]=_[_0x9110('0x4b')](db[_0x9110('0x33')]['rawAttributes']);_0x5a4a0c[_0x9110('0x38')]=_[_0x9110('0x4b')](_0x4cc536['query']);_0x5a4a0c[_0x9110('0x39')]=_[_0x9110('0x3a')](_0x5a4a0c[_0x9110('0x37')],_0x5a4a0c['query']);_0x1bab46[_0x9110('0x3b')]=_[_0x9110('0x3a')](_0x5a4a0c[_0x9110('0x37')],qs[_0x9110('0x3c')](_0x4cc536[_0x9110('0x38')]['fields']));_0x1bab46[_0x9110('0x3b')]=_0x1bab46[_0x9110('0x3b')]['length']?_0x1bab46[_0x9110('0x3b')]:_0x5a4a0c[_0x9110('0x37')];if(_0x4cc536[_0x9110('0x38')][_0x9110('0x46')]){_0x1bab46[_0x9110('0x4c')]=[{'all':!![]}];}_0x1bab46=_['merge']({},_0x1bab46,_0x4cc536[_0x9110('0x45')]);return db[_0x9110('0x33')][_0x9110('0x4d')](_0x1bab46)[_0x9110('0x2b')](handleEntityNotFound(_0x403cac,null))[_0x9110('0x2b')](respondWithResult(_0x403cac,null))[_0x9110('0x49')](handleError(_0x403cac,null));};exports[_0x9110('0x4e')]=function(_0x2869a6,_0x5895e9){return db[_0x9110('0x33')][_0x9110('0x4e')](_0x2869a6['body'],{})[_0x9110('0x2b')](function(_0x30b9a5){var _0x5913a7=_0x2869a6[_0x9110('0x4f')]['get']({'plain':!![]});if(!_0x5913a7)throw new Error(_0x9110('0x50'));if(_0x5913a7[_0x9110('0x51')]===_0x9110('0x4f')){var _0x48c7d4=_0x30b9a5[_0x9110('0x2d')]({'plain':!![]});var _0x39474c=_0x9110('0x2e');return db['UserProfileSection'][_0x9110('0x4d')]({'where':{'name':_0x39474c,'userProfileId':_0x5913a7[_0x9110('0x52')]},'raw':!![]})['then'](function(_0xb2b104){if(_0xb2b104&&_0xb2b104[_0x9110('0x53')]===0x0){return db[_0x9110('0x54')][_0x9110('0x4e')]({'name':_0x48c7d4[_0x9110('0x2f')],'resourceId':_0x48c7d4['id'],'type':_0xb2b104[_0x9110('0x2f')],'sectionId':_0xb2b104['id']},{})[_0x9110('0x2b')](function(){return _0x30b9a5;});}else{return _0x30b9a5;}})[_0x9110('0x49')](function(_0x415aaf){logger[_0x9110('0x55')](_0x9110('0x56'),_0x415aaf);throw _0x415aaf;});}return _0x30b9a5;})[_0x9110('0x2b')](respondWithResult(_0x5895e9,0xc9))[_0x9110('0x49')](handleError(_0x5895e9,null));};exports[_0x9110('0x2a')]=function(_0x38b1cd,_0x317592){if(_0x38b1cd[_0x9110('0x57')]['id']){delete _0x38b1cd['body']['id'];}return db[_0x9110('0x33')][_0x9110('0x4d')]({'where':{'id':_0x38b1cd['params']['id']}})[_0x9110('0x2b')](handleEntityNotFound(_0x317592,null))[_0x9110('0x2b')](saveUpdates(_0x38b1cd[_0x9110('0x57')],null))['then'](respondWithResult(_0x317592,null))['catch'](handleError(_0x317592,null));};exports[_0x9110('0x2c')]=function(_0x300766,_0x3ed969){return db[_0x9110('0x33')][_0x9110('0x4d')]({'where':{'id':_0x300766['params']['id']}})['then'](handleEntityNotFound(_0x3ed969,null))[_0x9110('0x2b')](removeEntity(_0x3ed969,null))[_0x9110('0x49')](handleError(_0x3ed969,null));};exports[_0x9110('0x58')]=function(_0x2a074c,_0x2b6a5b){return db[_0x9110('0x33')][_0x9110('0x58')]()['then'](respondWithResult(_0x2b6a5b,null))[_0x9110('0x49')](handleError(_0x2b6a5b,null));};exports[_0x9110('0x59')]=function(_0x5c8a28,_0x132538,_0x96f9b7){var _0x3d28c6={'raw':!![],'where':{}},_0x6ed6e3={},_0x1b0d62;return db[_0x9110('0x33')][_0x9110('0x5a')]({'where':{'id':_0x5c8a28[_0x9110('0x4a')]['id']}})[_0x9110('0x2b')](handleEntityNotFound(_0x132538,null))[_0x9110('0x2b')](function(_0x2e326d){if(_0x2e326d){_0x1b0d62=_0x2e326d['get']({'plain':!![]});_0x6ed6e3['model']=_[_0x9110('0x4b')](db[_0x9110('0x5b')][_0x9110('0x34')]);_0x6ed6e3['query']=_['keys'](_0x5c8a28[_0x9110('0x38')]);_0x6ed6e3[_0x9110('0x39')]=_[_0x9110('0x3a')](_0x6ed6e3[_0x9110('0x37')],_0x6ed6e3['query']);_0x3d28c6[_0x9110('0x3b')]=_[_0x9110('0x3a')](_0x6ed6e3['model'],qs['fields'](_0x5c8a28[_0x9110('0x38')]['fields']));_0x3d28c6[_0x9110('0x3b')]=_0x3d28c6[_0x9110('0x3b')]['length']?_0x3d28c6['attributes']:_0x6ed6e3[_0x9110('0x37')];if(!_0x5c8a28['query'][_0x9110('0x3e')](_0x9110('0x5c'))){_0x3d28c6['limit']=qs['limit'](_0x5c8a28[_0x9110('0x38')]['limit']);_0x3d28c6['offset']=qs[_0x9110('0x23')](_0x5c8a28[_0x9110('0x38')][_0x9110('0x23')]);}_0x3d28c6['order']=qs[_0x9110('0x40')](_0x5c8a28[_0x9110('0x38')][_0x9110('0x40')]);_0x3d28c6['where']=qs[_0x9110('0x39')](_[_0x9110('0x42')](_0x5c8a28['query'],_0x6ed6e3[_0x9110('0x39')]));_0x3d28c6[_0x9110('0x41')]['WhatsappQueueId']=_0x2e326d['id'];if(_0x5c8a28['query'][_0x9110('0x43')]){_0x3d28c6[_0x9110('0x41')]=_[_0x9110('0x44')](_0x3d28c6['where'],{'$or':_['map'](_0x3d28c6['attributes'],function(_0x3c48d6){var _0x404190={};_0x404190[_0x3c48d6]={'$like':'%'+_0x5c8a28[_0x9110('0x38')][_0x9110('0x43')]+'%'};return _0x404190;})});}_0x3d28c6=_[_0x9110('0x44')]({},_0x3d28c6,_0x5c8a28[_0x9110('0x45')]);return db['UserWhatsappQueue'][_0x9110('0x47')](_0x3d28c6);}})['then'](function(_0x41ae28){if(_0x41ae28){return db[_0x9110('0x5d')][_0x9110('0x5e')]({'where':{'id':_[_0x9110('0x32')](_0x41ae28,'UserId'),'role':'agent'},'attributes':['id',_0x9110('0x2f'),_0x9110('0x5f'),_0x9110('0x60'),_0x9110('0x61')]});}})['then'](function(_0x5826f6){if(_0x5826f6){return{'count':_0x5826f6[_0x9110('0x26')],'rows':_[_0x9110('0x32')](_0x5826f6[_0x9110('0x48')],function(_0x38b3b5){return{'membername':_0x38b3b5[_0x9110('0x2f')],'UserId':_0x38b3b5['id'],'queue_name':_0x1b0d62['name'],'WhatsappQueueId':_0x1b0d62['id'],'interface':util[_0x9110('0x62')]('%s/%s',_0x9110('0x63'),_0x38b3b5[_0x9110('0x2f')]),'penalty':0x0,'paused':_0x38b3b5['whatsappPause'],'createdAt':_0x38b3b5['createdAt'],'updatedAt':_0x38b3b5[_0x9110('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9110('0x2b')](respondWithFilteredResult(_0x132538,_0x3d28c6))[_0x9110('0x49')](handleError(_0x132538,null));};exports[_0x9110('0x64')]=function(_0x2ebf82,_0x30252a,_0x5304e8){var _0x1af30a={};var _0x2b1a11={};var _0x5f02f6;var _0x1ad59e;return db[_0x9110('0x33')][_0x9110('0x5a')]({'where':{'id':_0x2ebf82['params']['id']}})['then'](handleEntityNotFound(_0x30252a,null))[_0x9110('0x2b')](function(_0x296426){if(_0x296426){_0x5f02f6=_0x296426;_0x2b1a11['model']=_[_0x9110('0x4b')](db['Team']['rawAttributes']);_0x2b1a11[_0x9110('0x38')]=_[_0x9110('0x4b')](_0x2ebf82[_0x9110('0x38')]);_0x2b1a11['filters']=_[_0x9110('0x3a')](_0x2b1a11[_0x9110('0x37')],_0x2b1a11['query']);_0x1af30a['attributes']=_[_0x9110('0x3a')](_0x2b1a11['model'],qs['fields'](_0x2ebf82['query']['fields']));_0x1af30a[_0x9110('0x3b')]=_0x1af30a['attributes']['length']?_0x1af30a['attributes']:_0x2b1a11['model'];_0x1af30a[_0x9110('0x3f')]=qs['sort'](_0x2ebf82[_0x9110('0x38')]['sort']);_0x1af30a[_0x9110('0x41')]=qs[_0x9110('0x39')](_[_0x9110('0x42')](_0x2ebf82[_0x9110('0x38')],_0x2b1a11[_0x9110('0x39')]));if(_0x2ebf82[_0x9110('0x38')]['filter']){_0x1af30a['where']=_[_0x9110('0x44')](_0x1af30a[_0x9110('0x41')],{'$or':_[_0x9110('0x32')](_0x1af30a[_0x9110('0x3b')],function(_0x4af813){var _0x1ed8f3={};_0x1ed8f3[_0x4af813]={'$like':'%'+_0x2ebf82[_0x9110('0x38')][_0x9110('0x43')]+'%'};return _0x1ed8f3;})});}_0x1af30a=_[_0x9110('0x44')]({},_0x1af30a,_0x2ebf82[_0x9110('0x45')]);return _0x5f02f6[_0x9110('0x64')](_0x1af30a);}})['then'](function(_0x4e90a9){if(_0x4e90a9){_0x1ad59e=_0x4e90a9['length'];if(!_0x2ebf82[_0x9110('0x38')][_0x9110('0x3e')](_0x9110('0x5c'))){_0x1af30a[_0x9110('0x25')]=qs[_0x9110('0x25')](_0x2ebf82[_0x9110('0x38')][_0x9110('0x25')]);_0x1af30a['offset']=qs[_0x9110('0x23')](_0x2ebf82[_0x9110('0x38')]['offset']);}return _0x5f02f6[_0x9110('0x64')](_0x1af30a);}})['then'](function(_0x388502){if(_0x388502){return _0x388502?{'count':_0x1ad59e,'rows':_0x388502}:null;}})[_0x9110('0x2b')](respondWithResult(_0x30252a,null))[_0x9110('0x49')](handleError(_0x30252a,null));};exports[_0x9110('0x65')]=function(_0x32a720,_0x107060,_0x55c3ea){var _0xecc3a8=_0x32a720['body'][_0x9110('0x66')];return db[_0x9110('0x67')][_0x9110('0x47')]({'where':{'id':_0xecc3a8},'attributes':['id'],'include':[{'model':db[_0x9110('0x5d')],'as':_0x9110('0x68'),'attributes':['id',_0x9110('0x2f'),'online',_0x9110('0x69'),_0x9110('0x6a')],'raw':!![]}]})[_0x9110('0x2b')](function(_0x2358ec){if(_0x2358ec){var _0x12ccaa=_[_0x9110('0x6b')](_0x2358ec,function(_0x4d0006){var _0x4ddeba=_0x4d0006['get']({'plain':!![]});return _0x4ddeba['Agents'];});return db['WhatsappQueue'][_0x9110('0x4d')]({'where':{'id':_0x32a720[_0x9110('0x4a')]['id']}})[_0x9110('0x2b')](function(_0x219788){return db['sequelize'][_0x9110('0x6c')](function(_0x2544d8){return _0x219788['addTeams'](_0xecc3a8,{'transaction':_0x2544d8})[_0x9110('0x2b')](function(){return BPromise[_0x9110('0x6d')](_0x12ccaa,function(_0x1d5408){return db[_0x9110('0x5b')][_0x9110('0x6e')]({'where':{'UserId':_0x1d5408['id'],'WhatsappQueueId':_0x32a720[_0x9110('0x4a')]['id']},'transaction':_0x2544d8});});})[_0x9110('0x2b')](function(){_0x12ccaa[_0x9110('0x6f')](function(_0x439afe){socket[_0x9110('0x70')](_0x9110('0x71'),{'UserId':_0x439afe['id'],'WhatsappQueueId':_0x219788['id']});});});});});}})[_0x9110('0x2b')](respondWithStatusCode(_0x107060,null))[_0x9110('0x49')](handleError(_0x107060,null));};exports['removeTeams']=function(_0x5a3601,_0x2107f7,_0x35f9b9){return db['Team'][_0x9110('0x47')]({'where':{'id':_0x5a3601[_0x9110('0x38')][_0x9110('0x66')]},'attributes':['id'],'include':[{'model':db[_0x9110('0x5d')],'as':_0x9110('0x68'),'attributes':['id'],'raw':!![]}]})[_0x9110('0x2b')](handleEntityNotFound(_0x2107f7,null))['then'](function(_0x3e4384){var _0x1acb1a=_[_0x9110('0x32')](_0x3e4384,'id');var _0xee3e3b=[];var _0x4c68e7=[];var _0x179859=squel[_0x9110('0x72')]();_0x179859[_0x9110('0x73')](_0x9110('0x74'))['from'](_0x9110('0x75'),'tq')[_0x9110('0x76')](_0x9110('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9110('0x41')]('WhatsappQueueId\x20=\x20?',_0x5a3601['params']['id']);for(var _0x52d451=0x0;_0x52d451<_0x3e4384['length'];_0x52d451+=0x1){let _0x35b7dc=_0x3e4384[_0x52d451];for(var _0x2306d4=0x0;_0x2306d4<_0x35b7dc[_0x9110('0x68')][_0x9110('0x3d')];_0x2306d4+=0x1){let _0x37b9b0=_0x35b7dc[_0x9110('0x68')][_0x2306d4];var _0x3271de=_0x179859[_0x9110('0x78')]();_0x3271de['where'](_0x9110('0x79'),_0x37b9b0['id']);_0x4c68e7[_0x9110('0x7a')](db[_0x9110('0x7b')][_0x9110('0x38')](_0x3271de['toString'](),{'type':db[_0x9110('0x7b')][_0x9110('0x7c')][_0x9110('0x7d')]})['then'](function(_0x1e1a06){if(_0x1e1a06[_0x9110('0x3d')]===0x1){return _0x37b9b0['id'];}else{var _0x12a297=_[_0x9110('0x7e')](_[_0x9110('0x32')](_0x1e1a06,_0x9110('0x7f')),function(_0x5263f6){return _['includes'](_0x1acb1a,_0x5263f6);});if(_0x12a297){return _0x37b9b0['id'];}}}));}}return BPromise[_0x9110('0x80')](_0x4c68e7)[_0x9110('0x2b')](function(_0x88b0c6){_0xee3e3b=_(_0xee3e3b)[_0x9110('0x81')](_0x88b0c6)[_0x9110('0x82')]()[_0x9110('0x83')]();return db[_0x9110('0x33')][_0x9110('0x4d')]({'where':{'id':_0x5a3601[_0x9110('0x4a')]['id']}})[_0x9110('0x2b')](function(_0x769e3f){return db[_0x9110('0x7b')][_0x9110('0x6c')](function(_0x1030f7){return _0x769e3f[_0x9110('0x84')](_0x5a3601[_0x9110('0x38')][_0x9110('0x66')],{'transaction':_0x1030f7})['then'](function(){if(!_['isEmpty'](_0xee3e3b)){return _0x769e3f[_0x9110('0x85')](_0xee3e3b,{'transaction':_0x1030f7});}})[_0x9110('0x2b')](function(){_0xee3e3b[_0x9110('0x6f')](function(_0x29d79a){socket[_0x9110('0x70')]('userWhatsappQueue:remove',{'UserId':_0x29d79a,'WhatsappQueueId':_0x769e3f['id']});});});});});});})[_0x9110('0x2b')](respondWithStatusCode(_0x2107f7,null))[_0x9110('0x49')](handleError(_0x2107f7,null));};exports['addAgents']=function(_0x4c9472,_0x103a04,_0x5d8fea){return db[_0x9110('0x33')][_0x9110('0x4d')]({'where':{'id':_0x4c9472[_0x9110('0x4a')]['id']}})[_0x9110('0x2b')](handleEntityNotFound(_0x103a04,null))[_0x9110('0x2b')](function(_0x5caf22){if(_0x5caf22){return _0x5caf22['addAgents'](_0x4c9472[_0x9110('0x57')][_0x9110('0x66')],_[_0x9110('0x86')](_0x4c9472['body'],[_0x9110('0x66'),'id'])||{})[_0x9110('0x87')](function(_0x238399){for(var _0x4adfa8=0x0;_0x4adfa8<_0x4c9472['body']['ids'][_0x9110('0x3d')];_0x4adfa8+=0x1){socket[_0x9110('0x70')]('userWhatsappQueue:save',{'UserId':Number(_0x4c9472[_0x9110('0x57')][_0x9110('0x66')][_0x4adfa8]),'WhatsappQueueId':Number(_0x4c9472[_0x9110('0x4a')]['id'])});}return _0x238399;});}})[_0x9110('0x2b')](respondWithResult(_0x103a04,null))[_0x9110('0x49')](handleError(_0x103a04,null));};exports[_0x9110('0x85')]=function(_0x150872,_0x23581e,_0x45f46d){return db[_0x9110('0x33')][_0x9110('0x4d')]({'where':{'id':_0x150872['params']['id']}})['then'](handleEntityNotFound(_0x23581e,null))[_0x9110('0x2b')](function(_0x5a47a3){if(_0x5a47a3){return _0x5a47a3['removeAgents'](_0x150872[_0x9110('0x38')][_0x9110('0x66')])[_0x9110('0x2b')](function(){if(_['isArray'](_0x150872[_0x9110('0x38')][_0x9110('0x66')])){for(var _0xf214c2=0x0;_0xf214c2<_0x150872['query']['ids'][_0x9110('0x3d')];_0xf214c2+=0x1){socket[_0x9110('0x70')](_0x9110('0x88'),{'UserId':Number(_0x150872[_0x9110('0x38')]['ids'][_0xf214c2]),'WhatsappQueueId':Number(_0x150872['params']['id'])});}}else{socket['emit'](_0x9110('0x88'),{'UserId':Number(_0x150872['query']['ids']),'WhatsappQueueId':Number(_0x150872[_0x9110('0x4a')]['id'])});}});}})[_0x9110('0x2b')](respondWithStatusCode(_0x23581e,null))[_0x9110('0x49')](handleError(_0x23581e,null));};exports[_0x9110('0x89')]=function(_0x382858,_0x39a51b,_0x427476){var _0x2442f2={};var _0x1459cc={};var _0x2f6465;var _0x4943f3;return db[_0x9110('0x33')][_0x9110('0x5a')]({'where':{'id':_0x382858['params']['id']}})[_0x9110('0x2b')](handleEntityNotFound(_0x39a51b,null))[_0x9110('0x2b')](function(_0x37fd54){if(_0x37fd54){_0x2f6465=_0x37fd54;_0x1459cc[_0x9110('0x37')]=_[_0x9110('0x4b')](db[_0x9110('0x5d')]['rawAttributes']);_0x1459cc[_0x9110('0x38')]=_[_0x9110('0x4b')](_0x382858[_0x9110('0x38')]);_0x1459cc[_0x9110('0x39')]=_[_0x9110('0x3a')](_0x1459cc[_0x9110('0x37')],_0x1459cc['query']);_0x2442f2[_0x9110('0x3b')]=_[_0x9110('0x3a')](_0x1459cc[_0x9110('0x37')],qs['fields'](_0x382858[_0x9110('0x38')][_0x9110('0x3c')]));_0x2442f2['attributes']=_0x2442f2[_0x9110('0x3b')][_0x9110('0x3d')]?_0x2442f2[_0x9110('0x3b')]:_0x1459cc[_0x9110('0x37')];_0x2442f2[_0x9110('0x3f')]=qs[_0x9110('0x40')](_0x382858[_0x9110('0x38')][_0x9110('0x40')]);_0x2442f2['where']=qs[_0x9110('0x39')](_['pick'](_0x382858['query'],_0x1459cc[_0x9110('0x39')]));if(_0x382858[_0x9110('0x38')][_0x9110('0x43')]){_0x2442f2[_0x9110('0x41')]=_[_0x9110('0x44')](_0x2442f2['where'],{'$or':_[_0x9110('0x32')](_0x2442f2[_0x9110('0x3b')],function(_0x239c7d){var _0x45a568={};_0x45a568[_0x239c7d]={'$like':'%'+_0x382858[_0x9110('0x38')][_0x9110('0x43')]+'%'};return _0x45a568;})});}_0x2442f2=_[_0x9110('0x44')]({},_0x2442f2,_0x382858['options']);return _0x2f6465[_0x9110('0x89')](_0x2442f2);}})[_0x9110('0x2b')](function(_0x42ee2a){if(_0x42ee2a){_0x4943f3=_0x42ee2a[_0x9110('0x3d')];if(!_0x382858[_0x9110('0x38')]['hasOwnProperty'](_0x9110('0x5c'))){_0x2442f2[_0x9110('0x25')]=qs[_0x9110('0x25')](_0x382858[_0x9110('0x38')][_0x9110('0x25')]);_0x2442f2['offset']=qs[_0x9110('0x23')](_0x382858['query'][_0x9110('0x23')]);}return _0x2f6465[_0x9110('0x89')](_0x2442f2);}})[_0x9110('0x2b')](function(_0x263bd7){if(_0x263bd7){return _0x263bd7?{'count':_0x4943f3,'rows':_0x263bd7}:null;}})[_0x9110('0x2b')](respondWithResult(_0x39a51b,null))[_0x9110('0x49')](handleError(_0x39a51b,null));}; \ No newline at end of file +var _0x0ead=['pick','filter','merge','options','includeAll','include','WhatsappQueue','findAll','rows','show','params','find','catch','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserWhatsappQueue','length','hasOwnProperty','sort','WhatsappQueueId','findAndCountAll','UserId','format','SIP','createdAt','getTeams','Team','addTeams','ids','User','Agents','online','interface','flatMap','sequelize','each','findOrCreate','forEach','emit','userWhatsappQueue:save','removeTeams','select','field','team_has_whatsapp_queues','join','ut.TeamId\x20=\x20tq.TeamId','WhatsappQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','end','json','limit','undefined','count','offset','status','apply','reject','save','update','then','destroy','get','WhatsappQueues','UserProfileResource','error','stack','name','send','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','nolimit','order','where'];(function(_0x5d156f,_0xae5308){var _0x5b60f6=function(_0x14f7c1){while(--_0x14f7c1){_0x5d156f['push'](_0x5d156f['shift']());}};_0x5b60f6(++_0xae5308);}(_0x0ead,0x15f));var _0xd0ea=function(_0x1c7284,_0x55c2bd){_0x1c7284=_0x1c7284-0x0;var _0x22c287=_0x0ead[_0x1c7284];return _0x22c287;};'use strict';var emlformat=require(_0xd0ea('0x0'));var rimraf=require(_0xd0ea('0x1'));var zipdir=require(_0xd0ea('0x2'));var jsonpatch=require(_0xd0ea('0x3'));var rp=require(_0xd0ea('0x4'));var moment=require(_0xd0ea('0x5'));var BPromise=require(_0xd0ea('0x6'));var Mustache=require(_0xd0ea('0x7'));var util=require('util');var path=require(_0xd0ea('0x8'));var sox=require(_0xd0ea('0x9'));var csv=require(_0xd0ea('0xa'));var ejs=require(_0xd0ea('0xb'));var fs=require('fs');var fs_extra=require(_0xd0ea('0xc'));var _=require(_0xd0ea('0xd'));var squel=require(_0xd0ea('0xe'));var crypto=require(_0xd0ea('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xd0ea('0x10'));var toCsv=require(_0xd0ea('0xa'));var querystring=require(_0xd0ea('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd0ea('0x12'));var qs=require(_0xd0ea('0x13'));var as=require(_0xd0ea('0x14'));var hardwareService=require(_0xd0ea('0x15'));var logger=require('../../config/logger')(_0xd0ea('0x16'));var utils=require(_0xd0ea('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd0ea('0x18'));var db=require(_0xd0ea('0x19'))['db'];config[_0xd0ea('0x1a')]=_['defaults'](config[_0xd0ea('0x1a')],{'host':_0xd0ea('0x1b'),'port':0x18eb});var socket=require(_0xd0ea('0x1c'))(new Redis(config[_0xd0ea('0x1a')]));require(_0xd0ea('0x1d'))[_0xd0ea('0x1e')](socket);function respondWithStatusCode(_0x1b27ce,_0x408025){_0x408025=_0x408025||0xcc;return function(_0x5edaba){if(_0x5edaba){return _0x1b27ce[_0xd0ea('0x1f')](_0x408025);}return _0x1b27ce['status'](_0x408025)[_0xd0ea('0x20')]();};}function respondWithResult(_0x558028,_0x5092cf){_0x5092cf=_0x5092cf||0xc8;return function(_0x2f6cb1){if(_0x2f6cb1){return _0x558028['status'](_0x5092cf)[_0xd0ea('0x21')](_0x2f6cb1);}};}function respondWithFilteredResult(_0x552bf7,_0x3705bd){return function(_0x4a155d){if(_0x4a155d){var _0x313898=typeof _0x3705bd['offset']==='undefined'&&typeof _0x3705bd[_0xd0ea('0x22')]===_0xd0ea('0x23');var _0xf338c5=_0x4a155d[_0xd0ea('0x24')];var _0x737a2=_0x313898?0x0:_0x3705bd[_0xd0ea('0x25')];var _0x15ced6=_0x313898?_0x4a155d[_0xd0ea('0x24')]:_0x3705bd[_0xd0ea('0x25')]+_0x3705bd[_0xd0ea('0x22')];var _0x241429;if(_0x15ced6>=_0xf338c5){_0x15ced6=_0xf338c5;_0x241429=0xc8;}else{_0x241429=0xce;}_0x552bf7[_0xd0ea('0x26')](_0x241429);return _0x552bf7['set']('Content-Range',_0x737a2+'-'+_0x15ced6+'/'+_0xf338c5)[_0xd0ea('0x21')](_0x4a155d);}return null;};}function patchUpdates(_0xed75c3){return function(_0x2f20a3){try{jsonpatch[_0xd0ea('0x27')](_0x2f20a3,_0xed75c3,!![]);}catch(_0x3bc56f){return BPromise[_0xd0ea('0x28')](_0x3bc56f);}return _0x2f20a3[_0xd0ea('0x29')]();};}function saveUpdates(_0x50f6f0,_0x5ee8cb){return function(_0x424328){if(_0x424328){return _0x424328[_0xd0ea('0x2a')](_0x50f6f0)[_0xd0ea('0x2b')](function(_0x1224ac){return _0x1224ac;});}return null;};}function removeEntity(_0x539785,_0x35467f){return function(_0x3fc662){if(_0x3fc662){return _0x3fc662[_0xd0ea('0x2c')]()[_0xd0ea('0x2b')](function(){var _0x2e43ea=_0x3fc662[_0xd0ea('0x2d')]({'plain':!![]});var _0x4ab851=_0xd0ea('0x2e');return db[_0xd0ea('0x2f')][_0xd0ea('0x2c')]({'where':{'type':_0x4ab851,'resourceId':_0x2e43ea['id']}})['then'](function(){return _0x3fc662;});})[_0xd0ea('0x2b')](function(){_0x539785[_0xd0ea('0x26')](0xcc)[_0xd0ea('0x20')]();});}};}function handleEntityNotFound(_0x50c341,_0x407e85){return function(_0x2d2a3f){if(!_0x2d2a3f){_0x50c341['sendStatus'](0x194);}return _0x2d2a3f;};}function handleError(_0x338d39,_0x23434e){_0x23434e=_0x23434e||0x1f4;return function(_0x775e73){logger[_0xd0ea('0x30')](_0x775e73[_0xd0ea('0x31')]);if(_0x775e73[_0xd0ea('0x32')]){delete _0x775e73['name'];}_0x338d39[_0xd0ea('0x26')](_0x23434e)[_0xd0ea('0x33')](_0x775e73);};}exports['index']=function(_0x1998ee,_0x315fd2){var _0x32f48c={},_0x562674={},_0x22ea9c={'count':0x0,'rows':[]};var _0x3801ab=_['map'](db['WhatsappQueue'][_0xd0ea('0x34')],function(_0x3f4a6f){return{'name':_0x3f4a6f[_0xd0ea('0x35')],'type':_0x3f4a6f[_0xd0ea('0x36')]['key']};});_0x562674[_0xd0ea('0x37')]=_[_0xd0ea('0x38')](_0x3801ab,_0xd0ea('0x32'));_0x562674[_0xd0ea('0x39')]=_[_0xd0ea('0x3a')](_0x1998ee['query']);_0x562674[_0xd0ea('0x3b')]=_[_0xd0ea('0x3c')](_0x562674[_0xd0ea('0x37')],_0x562674[_0xd0ea('0x39')]);_0x32f48c[_0xd0ea('0x3d')]=_[_0xd0ea('0x3c')](_0x562674['model'],qs[_0xd0ea('0x3e')](_0x1998ee['query'][_0xd0ea('0x3e')]));_0x32f48c[_0xd0ea('0x3d')]=_0x32f48c[_0xd0ea('0x3d')]['length']?_0x32f48c[_0xd0ea('0x3d')]:_0x562674[_0xd0ea('0x37')];if(!_0x1998ee['query']['hasOwnProperty'](_0xd0ea('0x3f'))){_0x32f48c[_0xd0ea('0x22')]=qs[_0xd0ea('0x22')](_0x1998ee[_0xd0ea('0x39')][_0xd0ea('0x22')]);_0x32f48c[_0xd0ea('0x25')]=qs[_0xd0ea('0x25')](_0x1998ee['query'][_0xd0ea('0x25')]);}_0x32f48c[_0xd0ea('0x40')]=qs['sort'](_0x1998ee['query']['sort']);_0x32f48c[_0xd0ea('0x41')]=qs['filters'](_[_0xd0ea('0x42')](_0x1998ee['query'],_0x562674[_0xd0ea('0x3b')]),_0x3801ab);if(_0x1998ee['query'][_0xd0ea('0x43')]){_0x32f48c[_0xd0ea('0x41')]=_['merge'](_0x32f48c[_0xd0ea('0x41')],{'$or':_['map'](_0x3801ab,function(_0x510fb2){if(_0x510fb2['type']!=='VIRTUAL'){var _0x473480={};_0x473480[_0x510fb2[_0xd0ea('0x32')]]={'$like':'%'+_0x1998ee[_0xd0ea('0x39')][_0xd0ea('0x43')]+'%'};return _0x473480;}})});}_0x32f48c=_[_0xd0ea('0x44')]({},_0x32f48c,_0x1998ee[_0xd0ea('0x45')]);var _0x5b8882={'where':_0x32f48c['where']};return db['WhatsappQueue']['count'](_0x5b8882)[_0xd0ea('0x2b')](function(_0x2a9544){_0x22ea9c['count']=_0x2a9544;if(_0x1998ee[_0xd0ea('0x39')][_0xd0ea('0x46')]){_0x32f48c[_0xd0ea('0x47')]=[{'all':!![]}];}return db[_0xd0ea('0x48')][_0xd0ea('0x49')](_0x32f48c);})[_0xd0ea('0x2b')](function(_0x58202a){_0x22ea9c[_0xd0ea('0x4a')]=_0x58202a;return _0x22ea9c;})[_0xd0ea('0x2b')](respondWithFilteredResult(_0x315fd2,_0x32f48c))['catch'](handleError(_0x315fd2,null));};exports[_0xd0ea('0x4b')]=function(_0x13dd77,_0x5769cd){var _0x2fd5d4={'raw':!![],'where':{'id':_0x13dd77[_0xd0ea('0x4c')]['id']}},_0x81993f={};_0x81993f[_0xd0ea('0x37')]=_['keys'](db['WhatsappQueue'][_0xd0ea('0x34')]);_0x81993f[_0xd0ea('0x39')]=_[_0xd0ea('0x3a')](_0x13dd77[_0xd0ea('0x39')]);_0x81993f[_0xd0ea('0x3b')]=_[_0xd0ea('0x3c')](_0x81993f[_0xd0ea('0x37')],_0x81993f[_0xd0ea('0x39')]);_0x2fd5d4[_0xd0ea('0x3d')]=_['intersection'](_0x81993f['model'],qs['fields'](_0x13dd77[_0xd0ea('0x39')][_0xd0ea('0x3e')]));_0x2fd5d4[_0xd0ea('0x3d')]=_0x2fd5d4['attributes']['length']?_0x2fd5d4[_0xd0ea('0x3d')]:_0x81993f['model'];if(_0x13dd77[_0xd0ea('0x39')][_0xd0ea('0x46')]){_0x2fd5d4['include']=[{'all':!![]}];}_0x2fd5d4=_[_0xd0ea('0x44')]({},_0x2fd5d4,_0x13dd77[_0xd0ea('0x45')]);return db[_0xd0ea('0x48')][_0xd0ea('0x4d')](_0x2fd5d4)['then'](handleEntityNotFound(_0x5769cd,null))[_0xd0ea('0x2b')](respondWithResult(_0x5769cd,null))[_0xd0ea('0x4e')](handleError(_0x5769cd,null));};exports['create']=function(_0x1cc863,_0x2203b4){return db[_0xd0ea('0x48')]['create'](_0x1cc863[_0xd0ea('0x4f')],{})[_0xd0ea('0x2b')](function(_0x28ae84){var _0xc0cd3c=_0x1cc863[_0xd0ea('0x50')][_0xd0ea('0x2d')]({'plain':!![]});if(!_0xc0cd3c)throw new Error(_0xd0ea('0x51'));if(_0xc0cd3c[_0xd0ea('0x52')]===_0xd0ea('0x50')){var _0xb0fb82=_0x28ae84[_0xd0ea('0x2d')]({'plain':!![]});var _0x7cdd02=_0xd0ea('0x2e');return db[_0xd0ea('0x53')][_0xd0ea('0x4d')]({'where':{'name':_0x7cdd02,'userProfileId':_0xc0cd3c[_0xd0ea('0x54')]},'raw':!![]})[_0xd0ea('0x2b')](function(_0x5dd24a){if(_0x5dd24a&&_0x5dd24a[_0xd0ea('0x55')]===0x0){return db[_0xd0ea('0x2f')][_0xd0ea('0x56')]({'name':_0xb0fb82['name'],'resourceId':_0xb0fb82['id'],'type':_0x5dd24a[_0xd0ea('0x32')],'sectionId':_0x5dd24a['id']},{})[_0xd0ea('0x2b')](function(){return _0x28ae84;});}else{return _0x28ae84;}})[_0xd0ea('0x4e')](function(_0x111bb6){logger[_0xd0ea('0x30')](_0xd0ea('0x57'),_0x111bb6);throw _0x111bb6;});}return _0x28ae84;})[_0xd0ea('0x2b')](respondWithResult(_0x2203b4,0xc9))['catch'](handleError(_0x2203b4,null));};exports['update']=function(_0xe419c,_0x3e36b9){if(_0xe419c[_0xd0ea('0x4f')]['id']){delete _0xe419c['body']['id'];}return db[_0xd0ea('0x48')]['find']({'where':{'id':_0xe419c[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x3e36b9,null))[_0xd0ea('0x2b')](saveUpdates(_0xe419c[_0xd0ea('0x4f')],null))[_0xd0ea('0x2b')](respondWithResult(_0x3e36b9,null))[_0xd0ea('0x4e')](handleError(_0x3e36b9,null));};exports['destroy']=function(_0x5522ee,_0x5bf527){return db[_0xd0ea('0x48')][_0xd0ea('0x4d')]({'where':{'id':_0x5522ee[_0xd0ea('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5bf527,null))['then'](removeEntity(_0x5bf527,null))[_0xd0ea('0x4e')](handleError(_0x5bf527,null));};exports[_0xd0ea('0x58')]=function(_0x3ce71d,_0x372b76){return db['WhatsappQueue']['describe']()['then'](respondWithResult(_0x372b76,null))[_0xd0ea('0x4e')](handleError(_0x372b76,null));};exports[_0xd0ea('0x59')]=function(_0x10ee5c,_0x42c05c,_0x364434){var _0xe52aa0={'raw':!![],'where':{}},_0x191d97={},_0x19dc61;return db[_0xd0ea('0x48')][_0xd0ea('0x5a')]({'where':{'id':_0x10ee5c['params']['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x42c05c,null))[_0xd0ea('0x2b')](function(_0x489e9f){if(_0x489e9f){_0x19dc61=_0x489e9f[_0xd0ea('0x2d')]({'plain':!![]});_0x191d97[_0xd0ea('0x37')]=_[_0xd0ea('0x3a')](db[_0xd0ea('0x5b')]['rawAttributes']);_0x191d97[_0xd0ea('0x39')]=_['keys'](_0x10ee5c[_0xd0ea('0x39')]);_0x191d97[_0xd0ea('0x3b')]=_[_0xd0ea('0x3c')](_0x191d97[_0xd0ea('0x37')],_0x191d97[_0xd0ea('0x39')]);_0xe52aa0['attributes']=_[_0xd0ea('0x3c')](_0x191d97[_0xd0ea('0x37')],qs['fields'](_0x10ee5c[_0xd0ea('0x39')][_0xd0ea('0x3e')]));_0xe52aa0[_0xd0ea('0x3d')]=_0xe52aa0[_0xd0ea('0x3d')][_0xd0ea('0x5c')]?_0xe52aa0['attributes']:_0x191d97['model'];if(!_0x10ee5c[_0xd0ea('0x39')][_0xd0ea('0x5d')](_0xd0ea('0x3f'))){_0xe52aa0[_0xd0ea('0x22')]=qs['limit'](_0x10ee5c[_0xd0ea('0x39')][_0xd0ea('0x22')]);_0xe52aa0['offset']=qs[_0xd0ea('0x25')](_0x10ee5c['query'][_0xd0ea('0x25')]);}_0xe52aa0['order']=qs[_0xd0ea('0x5e')](_0x10ee5c['query'][_0xd0ea('0x5e')]);_0xe52aa0[_0xd0ea('0x41')]=qs['filters'](_[_0xd0ea('0x42')](_0x10ee5c[_0xd0ea('0x39')],_0x191d97[_0xd0ea('0x3b')]));_0xe52aa0['where'][_0xd0ea('0x5f')]=_0x489e9f['id'];if(_0x10ee5c[_0xd0ea('0x39')]['filter']){_0xe52aa0[_0xd0ea('0x41')]=_['merge'](_0xe52aa0[_0xd0ea('0x41')],{'$or':_[_0xd0ea('0x38')](_0xe52aa0[_0xd0ea('0x3d')],function(_0x38f58c){var _0x51a403={};_0x51a403[_0x38f58c]={'$like':'%'+_0x10ee5c['query']['filter']+'%'};return _0x51a403;})});}_0xe52aa0=_['merge']({},_0xe52aa0,_0x10ee5c['options']);return db[_0xd0ea('0x5b')][_0xd0ea('0x49')](_0xe52aa0);}})[_0xd0ea('0x2b')](function(_0x3b45c5){if(_0x3b45c5){return db['User'][_0xd0ea('0x60')]({'where':{'id':_[_0xd0ea('0x38')](_0x3b45c5,_0xd0ea('0x61')),'role':'agent'},'attributes':['id',_0xd0ea('0x32'),'whatsappPause','updatedAt','createdAt']});}})[_0xd0ea('0x2b')](function(_0x9faf85){if(_0x9faf85){return{'count':_0x9faf85['count'],'rows':_[_0xd0ea('0x38')](_0x9faf85[_0xd0ea('0x4a')],function(_0x5ef4e1){return{'membername':_0x5ef4e1[_0xd0ea('0x32')],'UserId':_0x5ef4e1['id'],'queue_name':_0x19dc61[_0xd0ea('0x32')],'WhatsappQueueId':_0x19dc61['id'],'interface':util[_0xd0ea('0x62')]('%s/%s',_0xd0ea('0x63'),_0x5ef4e1[_0xd0ea('0x32')]),'penalty':0x0,'paused':_0x5ef4e1['whatsappPause'],'createdAt':_0x5ef4e1[_0xd0ea('0x64')],'updatedAt':_0x5ef4e1['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x42c05c,_0xe52aa0))[_0xd0ea('0x4e')](handleError(_0x42c05c,null));};exports[_0xd0ea('0x65')]=function(_0x1b675d,_0x28add7,_0x4ee9c7){var _0x3cf327={};var _0xcfaf1d={};var _0x31e096;var _0x56d110;return db[_0xd0ea('0x48')][_0xd0ea('0x5a')]({'where':{'id':_0x1b675d[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x28add7,null))[_0xd0ea('0x2b')](function(_0x3bd255){if(_0x3bd255){_0x31e096=_0x3bd255;_0xcfaf1d[_0xd0ea('0x37')]=_[_0xd0ea('0x3a')](db[_0xd0ea('0x66')][_0xd0ea('0x34')]);_0xcfaf1d[_0xd0ea('0x39')]=_['keys'](_0x1b675d['query']);_0xcfaf1d[_0xd0ea('0x3b')]=_[_0xd0ea('0x3c')](_0xcfaf1d[_0xd0ea('0x37')],_0xcfaf1d['query']);_0x3cf327[_0xd0ea('0x3d')]=_['intersection'](_0xcfaf1d[_0xd0ea('0x37')],qs['fields'](_0x1b675d[_0xd0ea('0x39')]['fields']));_0x3cf327['attributes']=_0x3cf327[_0xd0ea('0x3d')]['length']?_0x3cf327['attributes']:_0xcfaf1d[_0xd0ea('0x37')];_0x3cf327[_0xd0ea('0x40')]=qs['sort'](_0x1b675d['query'][_0xd0ea('0x5e')]);_0x3cf327['where']=qs[_0xd0ea('0x3b')](_['pick'](_0x1b675d[_0xd0ea('0x39')],_0xcfaf1d[_0xd0ea('0x3b')]));if(_0x1b675d[_0xd0ea('0x39')]['filter']){_0x3cf327[_0xd0ea('0x41')]=_[_0xd0ea('0x44')](_0x3cf327[_0xd0ea('0x41')],{'$or':_[_0xd0ea('0x38')](_0x3cf327[_0xd0ea('0x3d')],function(_0xf829d6){var _0x2b807f={};_0x2b807f[_0xf829d6]={'$like':'%'+_0x1b675d[_0xd0ea('0x39')][_0xd0ea('0x43')]+'%'};return _0x2b807f;})});}_0x3cf327=_[_0xd0ea('0x44')]({},_0x3cf327,_0x1b675d['options']);return _0x31e096[_0xd0ea('0x65')](_0x3cf327);}})[_0xd0ea('0x2b')](function(_0x6767bd){if(_0x6767bd){_0x56d110=_0x6767bd[_0xd0ea('0x5c')];if(!_0x1b675d[_0xd0ea('0x39')][_0xd0ea('0x5d')]('nolimit')){_0x3cf327['limit']=qs['limit'](_0x1b675d[_0xd0ea('0x39')][_0xd0ea('0x22')]);_0x3cf327['offset']=qs[_0xd0ea('0x25')](_0x1b675d['query']['offset']);}return _0x31e096[_0xd0ea('0x65')](_0x3cf327);}})[_0xd0ea('0x2b')](function(_0x37ac9b){if(_0x37ac9b){return _0x37ac9b?{'count':_0x56d110,'rows':_0x37ac9b}:null;}})[_0xd0ea('0x2b')](respondWithResult(_0x28add7,null))[_0xd0ea('0x4e')](handleError(_0x28add7,null));};exports[_0xd0ea('0x67')]=function(_0x4ef9ef,_0x4c0be3,_0x128082){var _0x5b3910=_0x4ef9ef['body'][_0xd0ea('0x68')];return db[_0xd0ea('0x66')][_0xd0ea('0x49')]({'where':{'id':_0x5b3910},'attributes':['id'],'include':[{'model':db[_0xd0ea('0x69')],'as':_0xd0ea('0x6a'),'attributes':['id',_0xd0ea('0x32'),_0xd0ea('0x6b'),'voicePause',_0xd0ea('0x6c')],'raw':!![]}]})[_0xd0ea('0x2b')](function(_0x2baaf7){if(_0x2baaf7){var _0x5a1c4e=_[_0xd0ea('0x6d')](_0x2baaf7,function(_0x2f8840){var _0xece6f7=_0x2f8840[_0xd0ea('0x2d')]({'plain':!![]});return _0xece6f7[_0xd0ea('0x6a')];});return db[_0xd0ea('0x48')][_0xd0ea('0x4d')]({'where':{'id':_0x4ef9ef[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](function(_0x5ad765){return db[_0xd0ea('0x6e')]['transaction'](function(_0x3777b4){return _0x5ad765[_0xd0ea('0x67')](_0x5b3910,{'transaction':_0x3777b4})[_0xd0ea('0x2b')](function(){return BPromise[_0xd0ea('0x6f')](_0x5a1c4e,function(_0x574e16){return db['UserWhatsappQueue'][_0xd0ea('0x70')]({'where':{'UserId':_0x574e16['id'],'WhatsappQueueId':_0x4ef9ef[_0xd0ea('0x4c')]['id']},'transaction':_0x3777b4});});})[_0xd0ea('0x2b')](function(){_0x5a1c4e[_0xd0ea('0x71')](function(_0x169db8){socket[_0xd0ea('0x72')](_0xd0ea('0x73'),{'UserId':_0x169db8['id'],'WhatsappQueueId':_0x5ad765['id']});});});});});}})[_0xd0ea('0x2b')](respondWithStatusCode(_0x4c0be3,null))[_0xd0ea('0x4e')](handleError(_0x4c0be3,null));};exports[_0xd0ea('0x74')]=function(_0x40ee0b,_0x5dd166,_0x171897){return db['Team'][_0xd0ea('0x49')]({'where':{'id':_0x40ee0b[_0xd0ea('0x39')][_0xd0ea('0x68')]},'attributes':['id'],'include':[{'model':db[_0xd0ea('0x69')],'as':_0xd0ea('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5dd166,null))[_0xd0ea('0x2b')](function(_0x11e532){var _0x555a87=_[_0xd0ea('0x38')](_0x11e532,'id');var _0x2d387d=[];var _0x2e7562=[];var _0x1c7085=squel[_0xd0ea('0x75')]();_0x1c7085[_0xd0ea('0x76')]('tq.TeamId')['from'](_0xd0ea('0x77'),'tq')[_0xd0ea('0x78')]('user_has_teams','ut',_0xd0ea('0x79'))[_0xd0ea('0x41')](_0xd0ea('0x7a'),_0x40ee0b[_0xd0ea('0x4c')]['id']);for(var _0x46d8cd=0x0;_0x46d8cd<_0x11e532[_0xd0ea('0x5c')];_0x46d8cd+=0x1){let _0x5bcb77=_0x11e532[_0x46d8cd];for(var _0x36462d=0x0;_0x36462d<_0x5bcb77['Agents'][_0xd0ea('0x5c')];_0x36462d+=0x1){let _0x48643e=_0x5bcb77[_0xd0ea('0x6a')][_0x36462d];var _0x2ce3c3=_0x1c7085['clone']();_0x2ce3c3[_0xd0ea('0x41')](_0xd0ea('0x7b'),_0x48643e['id']);_0x2e7562[_0xd0ea('0x7c')](db[_0xd0ea('0x6e')]['query'](_0x2ce3c3[_0xd0ea('0x7d')](),{'type':db[_0xd0ea('0x6e')]['QueryTypes']['SELECT']})[_0xd0ea('0x2b')](function(_0x1fb776){if(_0x1fb776[_0xd0ea('0x5c')]===0x1){return _0x48643e['id'];}else{var _0x8a16df=_[_0xd0ea('0x7e')](_[_0xd0ea('0x38')](_0x1fb776,_0xd0ea('0x7f')),function(_0x5999db){return _[_0xd0ea('0x80')](_0x555a87,_0x5999db);});if(_0x8a16df){return _0x48643e['id'];}}}));}}return BPromise[_0xd0ea('0x81')](_0x2e7562)[_0xd0ea('0x2b')](function(_0x47acb2){_0x2d387d=_(_0x2d387d)[_0xd0ea('0x82')](_0x47acb2)['compact']()[_0xd0ea('0x83')]();return db[_0xd0ea('0x48')][_0xd0ea('0x4d')]({'where':{'id':_0x40ee0b[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](function(_0x3d6de6){return db[_0xd0ea('0x6e')]['transaction'](function(_0x434a68){return _0x3d6de6[_0xd0ea('0x74')](_0x40ee0b[_0xd0ea('0x39')]['ids'],{'transaction':_0x434a68})[_0xd0ea('0x2b')](function(){if(!_[_0xd0ea('0x84')](_0x2d387d)){return _0x3d6de6[_0xd0ea('0x85')](_0x2d387d,{'transaction':_0x434a68});}})[_0xd0ea('0x2b')](function(){_0x2d387d['forEach'](function(_0x1f6ddf){socket['emit'](_0xd0ea('0x86'),{'UserId':_0x1f6ddf,'WhatsappQueueId':_0x3d6de6['id']});});});});});});})[_0xd0ea('0x2b')](respondWithStatusCode(_0x5dd166,null))[_0xd0ea('0x4e')](handleError(_0x5dd166,null));};exports[_0xd0ea('0x87')]=function(_0xc94fb3,_0x45d011,_0x57c915){return db[_0xd0ea('0x48')][_0xd0ea('0x4d')]({'where':{'id':_0xc94fb3[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x45d011,null))[_0xd0ea('0x2b')](function(_0x595691){if(_0x595691){return _0x595691['addAgents'](_0xc94fb3['body'][_0xd0ea('0x68')],_[_0xd0ea('0x88')](_0xc94fb3[_0xd0ea('0x4f')],['ids','id'])||{})[_0xd0ea('0x89')](function(_0xade6a9){for(var _0x276265=0x0;_0x276265<_0xc94fb3[_0xd0ea('0x4f')][_0xd0ea('0x68')][_0xd0ea('0x5c')];_0x276265+=0x1){socket['emit']('userWhatsappQueue:save',{'UserId':Number(_0xc94fb3[_0xd0ea('0x4f')][_0xd0ea('0x68')][_0x276265]),'WhatsappQueueId':Number(_0xc94fb3['params']['id'])});}return _0xade6a9;});}})[_0xd0ea('0x2b')](respondWithResult(_0x45d011,null))[_0xd0ea('0x4e')](handleError(_0x45d011,null));};exports[_0xd0ea('0x85')]=function(_0x3fc839,_0x34a39b,_0x143ca9){return db['WhatsappQueue'][_0xd0ea('0x4d')]({'where':{'id':_0x3fc839[_0xd0ea('0x4c')]['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x34a39b,null))[_0xd0ea('0x2b')](function(_0x196d94){if(_0x196d94){return _0x196d94[_0xd0ea('0x85')](_0x3fc839[_0xd0ea('0x39')][_0xd0ea('0x68')])[_0xd0ea('0x2b')](function(){if(_['isArray'](_0x3fc839['query']['ids'])){for(var _0x572083=0x0;_0x572083<_0x3fc839['query'][_0xd0ea('0x68')][_0xd0ea('0x5c')];_0x572083+=0x1){socket[_0xd0ea('0x72')]('userWhatsappQueue:remove',{'UserId':Number(_0x3fc839[_0xd0ea('0x39')][_0xd0ea('0x68')][_0x572083]),'WhatsappQueueId':Number(_0x3fc839[_0xd0ea('0x4c')]['id'])});}}else{socket[_0xd0ea('0x72')](_0xd0ea('0x86'),{'UserId':Number(_0x3fc839[_0xd0ea('0x39')][_0xd0ea('0x68')]),'WhatsappQueueId':Number(_0x3fc839[_0xd0ea('0x4c')]['id'])});}});}})[_0xd0ea('0x2b')](respondWithStatusCode(_0x34a39b,null))[_0xd0ea('0x4e')](handleError(_0x34a39b,null));};exports[_0xd0ea('0x8a')]=function(_0x3bae71,_0x10346c,_0xee11a5){var _0x4f22f6={};var _0x7718e8={};var _0x279403;var _0x196651;return db[_0xd0ea('0x48')][_0xd0ea('0x5a')]({'where':{'id':_0x3bae71['params']['id']}})[_0xd0ea('0x2b')](handleEntityNotFound(_0x10346c,null))[_0xd0ea('0x2b')](function(_0x336a69){if(_0x336a69){_0x279403=_0x336a69;_0x7718e8[_0xd0ea('0x37')]=_['keys'](db[_0xd0ea('0x69')][_0xd0ea('0x34')]);_0x7718e8[_0xd0ea('0x39')]=_[_0xd0ea('0x3a')](_0x3bae71['query']);_0x7718e8[_0xd0ea('0x3b')]=_['intersection'](_0x7718e8[_0xd0ea('0x37')],_0x7718e8[_0xd0ea('0x39')]);_0x4f22f6[_0xd0ea('0x3d')]=_[_0xd0ea('0x3c')](_0x7718e8[_0xd0ea('0x37')],qs[_0xd0ea('0x3e')](_0x3bae71[_0xd0ea('0x39')][_0xd0ea('0x3e')]));_0x4f22f6[_0xd0ea('0x3d')]=_0x4f22f6[_0xd0ea('0x3d')]['length']?_0x4f22f6[_0xd0ea('0x3d')]:_0x7718e8[_0xd0ea('0x37')];_0x4f22f6['order']=qs['sort'](_0x3bae71[_0xd0ea('0x39')][_0xd0ea('0x5e')]);_0x4f22f6['where']=qs[_0xd0ea('0x3b')](_[_0xd0ea('0x42')](_0x3bae71[_0xd0ea('0x39')],_0x7718e8[_0xd0ea('0x3b')]));if(_0x3bae71[_0xd0ea('0x39')][_0xd0ea('0x43')]){_0x4f22f6[_0xd0ea('0x41')]=_[_0xd0ea('0x44')](_0x4f22f6[_0xd0ea('0x41')],{'$or':_[_0xd0ea('0x38')](_0x4f22f6[_0xd0ea('0x3d')],function(_0x13d108){var _0x45e187={};_0x45e187[_0x13d108]={'$like':'%'+_0x3bae71[_0xd0ea('0x39')]['filter']+'%'};return _0x45e187;})});}_0x4f22f6=_[_0xd0ea('0x44')]({},_0x4f22f6,_0x3bae71[_0xd0ea('0x45')]);return _0x279403['getAgents'](_0x4f22f6);}})['then'](function(_0x26d691){if(_0x26d691){_0x196651=_0x26d691[_0xd0ea('0x5c')];if(!_0x3bae71[_0xd0ea('0x39')][_0xd0ea('0x5d')]('nolimit')){_0x4f22f6[_0xd0ea('0x22')]=qs[_0xd0ea('0x22')](_0x3bae71[_0xd0ea('0x39')][_0xd0ea('0x22')]);_0x4f22f6['offset']=qs[_0xd0ea('0x25')](_0x3bae71[_0xd0ea('0x39')]['offset']);}return _0x279403[_0xd0ea('0x8a')](_0x4f22f6);}})[_0xd0ea('0x2b')](function(_0x2edf67){if(_0x2edf67){return _0x2edf67?{'count':_0x196651,'rows':_0x2edf67}:null;}})['then'](respondWithResult(_0x10346c,null))[_0xd0ea('0x4e')](handleError(_0x10346c,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 6818dbd..b449a71 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 _0x675f=['events','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x59997a,_0x137909){var _0x57f464=function(_0x9e2298){while(--_0x9e2298){_0x59997a['push'](_0x59997a['shift']());}};_0x57f464(++_0x137909);}(_0x675f,0x158));var _0xf675=function(_0x1e2a5f,_0x4316b9){_0x1e2a5f=_0x1e2a5f-0x0;var _0x44c8ea=_0x675f[_0x1e2a5f];return _0x44c8ea;};'use strict';var EventEmitter=require(_0xf675('0x0'));var WhatsappQueue=require('../../mysqldb')['db']['WhatsappQueue'];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0xf675('0x1')](0x0);var events={'afterCreate':_0xf675('0x2'),'afterUpdate':_0xf675('0x3'),'afterDestroy':_0xf675('0x4')};function emitEvent(_0x275871){return function(_0x1df529,_0x5adc50,_0x42b14f){WhatsappQueueEvents[_0xf675('0x5')](_0x275871+':'+_0x1df529['id'],_0x1df529);WhatsappQueueEvents[_0xf675('0x5')](_0x275871,_0x1df529);_0x42b14f(null);};}for(var e in events){if(events[_0xf675('0x6')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0xf675('0x7')]=WhatsappQueueEvents; \ No newline at end of file +var _0xbbd6=['hasOwnProperty','exports','events','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x1f3aec,_0x24c18e){var _0x409f0d=function(_0x52b818){while(--_0x52b818){_0x1f3aec['push'](_0x1f3aec['shift']());}};_0x409f0d(++_0x24c18e);}(_0xbbd6,0xad));var _0x6bbd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbd6[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6bbd('0x0'));var WhatsappQueue=require('../../mysqldb')['db'][_0x6bbd('0x1')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x6bbd('0x2')](0x0);var events={'afterCreate':_0x6bbd('0x3'),'afterUpdate':_0x6bbd('0x4'),'afterDestroy':_0x6bbd('0x5')};function emitEvent(_0x41ccc0){return function(_0x418796,_0x1bb257,_0x629b5e){WhatsappQueueEvents[_0x6bbd('0x6')](_0x41ccc0+':'+_0x418796['id'],_0x418796);WhatsappQueueEvents[_0x6bbd('0x6')](_0x41ccc0,_0x418796);_0x629b5e(null);};}for(var e in events){if(events[_0x6bbd('0x7')](e)){var event=events[e];WhatsappQueue['hook'](e,emitEvent(event));}}module[_0x6bbd('0x8')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index 9c725be..ecd34ad 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 _0x8d15=['whatsapp_queues','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./whatsappQueue.attributes','define'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x8d15,0x85));var _0x58d1=function(_0x163d0f,_0xe5b86d){_0x163d0f=_0x163d0f-0x0;var _0x19aa1d=_0x8d15[_0x163d0f];return _0x19aa1d;};'use strict';var _=require(_0x58d1('0x0'));var util=require(_0x58d1('0x1'));var logger=require(_0x58d1('0x2'))('api');var moment=require(_0x58d1('0x3'));var BPromise=require(_0x58d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x58d1('0x5'));var rimraf=require(_0x58d1('0x6'));var config=require(_0x58d1('0x7'));var attributes=require(_0x58d1('0x8'));module['exports']=function(_0x249301,_0x58d819){return _0x249301[_0x58d1('0x9')]('WhatsappQueue',attributes,{'tableName':_0x58d1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3c16=['define','whatsapp_queues','util','../../config/logger','api','path','../../config/environment','exports'];(function(_0x445811,_0x45bec2){var _0x15af34=function(_0x266005){while(--_0x266005){_0x445811['push'](_0x445811['shift']());}};_0x15af34(++_0x45bec2);}(_0x3c16,0xc2));var _0x63c1=function(_0x3a3d8d,_0x250e88){_0x3a3d8d=_0x3a3d8d-0x0;var _0x73d1e=_0x3c16[_0x3a3d8d];return _0x73d1e;};'use strict';var _=require('lodash');var util=require(_0x63c1('0x0'));var logger=require(_0x63c1('0x1'))(_0x63c1('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x63c1('0x3'));var rimraf=require('rimraf');var config=require(_0x63c1('0x4'));var attributes=require('./whatsappQueue.attributes');module[_0x63c1('0x5')]=function(_0xfac6db,_0x3ae3a6){return _0xfac6db[_0x63c1('0x6')]('WhatsappQueue',attributes,{'tableName':_0x63c1('0x7'),'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 518ffbd..344c55a 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 _0x20fe=['request\x20sent','stringify','error','code','WhatsappQueue,\x20%s,\x20%s','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','where','attributes','limit','map','include','model','ShowWhatsappQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./whatsappQueue.socket','request','then','info','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s'];(function(_0x45dd6e,_0x4d7639){var _0x342723=function(_0x246765){while(--_0x246765){_0x45dd6e['push'](_0x45dd6e['shift']());}};_0x342723(++_0x4d7639);}(_0x20fe,0x68));var _0xe20f=function(_0xb9688a,_0x374447){_0xb9688a=_0xb9688a-0x0;var _0x5267c6=_0x20fe[_0xb9688a];return _0x5267c6;};'use strict';var _=require(_0xe20f('0x0'));var util=require(_0xe20f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe20f('0x2'));var fs=require('fs');var Redis=require(_0xe20f('0x3'));var db=require(_0xe20f('0x4'))['db'];var utils=require(_0xe20f('0x5'));var logger=require(_0xe20f('0x6'))(_0xe20f('0x7'));var config=require(_0xe20f('0x8'));var jayson=require(_0xe20f('0x9'));var client=jayson[_0xe20f('0xa')][_0xe20f('0xb')]({'port':0x232a});config['redis']=_[_0xe20f('0xc')](config['redis'],{'host':_0xe20f('0xd'),'port':0x18eb});var socket=require(_0xe20f('0xe'))(new Redis(config[_0xe20f('0xf')]));require(_0xe20f('0x10'))['register'](socket);function respondWithRpcPromise(_0x2c98a6,_0x13b1f5,_0x433c87){return new BPromise(function(_0x5f0d19,_0x422503){return client[_0xe20f('0x11')](_0x2c98a6,_0x433c87)[_0xe20f('0x12')](function(_0x3444cd){logger[_0xe20f('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x13b1f5,'request\x20sent');logger[_0xe20f('0x14')](_0xe20f('0x15'),_0x13b1f5,_0xe20f('0x16'),JSON[_0xe20f('0x17')](_0x3444cd));if(_0x3444cd[_0xe20f('0x18')]){if(_0x3444cd[_0xe20f('0x18')][_0xe20f('0x19')]===0x1f4){logger[_0xe20f('0x18')](_0xe20f('0x1a'),_0x13b1f5,_0x3444cd['error'][_0xe20f('0x1b')]);return _0x422503(_0x3444cd[_0xe20f('0x18')][_0xe20f('0x1b')]);}logger[_0xe20f('0x18')](_0xe20f('0x1a'),_0x13b1f5,_0x3444cd[_0xe20f('0x18')][_0xe20f('0x1b')]);return _0x5f0d19(_0x3444cd['error'][_0xe20f('0x1b')]);}else{logger[_0xe20f('0x13')](_0xe20f('0x1a'),_0x13b1f5,'request\x20sent');_0x5f0d19(_0x3444cd[_0xe20f('0x1c')]['message']);}})[_0xe20f('0x1d')](function(_0x470009){logger[_0xe20f('0x18')]('WhatsappQueue,\x20%s,\x20%s',_0x13b1f5,_0x470009);_0x422503(_0x470009);});});}exports[_0xe20f('0x1e')]=function(_0xa94552){var _0x46d0b1=this;return new Promise(function(_0x11b3c9,_0x2d5e1a){return db[_0xe20f('0x1f')][_0xe20f('0x20')]({'raw':_0xa94552[_0xe20f('0x21')]?_0xa94552['options'][_0xe20f('0x22')]===undefined?!![]:![]:!![],'where':_0xa94552[_0xe20f('0x21')]?_0xa94552['options'][_0xe20f('0x23')]||null:null,'attributes':_0xa94552[_0xe20f('0x21')]?_0xa94552[_0xe20f('0x21')][_0xe20f('0x24')]||null:null,'limit':_0xa94552[_0xe20f('0x21')]?_0xa94552[_0xe20f('0x21')][_0xe20f('0x25')]||null:null,'include':_0xa94552[_0xe20f('0x21')]?_0xa94552[_0xe20f('0x21')]['include']?_[_0xe20f('0x26')](_0xa94552[_0xe20f('0x21')][_0xe20f('0x27')],function(_0xf1a005){return{'model':db[_0xf1a005[_0xe20f('0x28')]],'as':_0xf1a005['as'],'attributes':_0xf1a005[_0xe20f('0x24')],'include':_0xf1a005[_0xe20f('0x27')]?_['map'](_0xf1a005[_0xe20f('0x27')],function(_0xaa9373){return{'model':db[_0xaa9373[_0xe20f('0x28')]],'as':_0xaa9373['as'],'attributes':_0xaa9373[_0xe20f('0x24')],'include':_0xaa9373[_0xe20f('0x27')]?_['map'](_0xaa9373[_0xe20f('0x27')],function(_0x21a815){return{'model':db[_0x21a815[_0xe20f('0x28')]],'as':_0x21a815['as'],'attributes':_0x21a815['attributes']};}):[]};}):[]};}):[]:[]})[_0xe20f('0x12')](function(_0x110536){logger[_0xe20f('0x13')](_0xe20f('0x1e'),_0xa94552);logger['debug']('GetWhatsappQueue',_0xa94552,JSON['stringify'](_0x110536));_0x11b3c9(_0x110536);})[_0xe20f('0x1d')](function(_0x4068ad){logger[_0xe20f('0x18')](_0xe20f('0x1e'),_0x4068ad[_0xe20f('0x1b')],_0xa94552);_0x2d5e1a(_0x46d0b1[_0xe20f('0x18')](0x1f4,_0x4068ad['message']));});});};exports['ShowWhatsappQueue']=function(_0x1b3187){var _0x55fdfc=this;return new Promise(function(_0x227b8a,_0x21f237){return db[_0xe20f('0x1f')]['find']({'raw':_0x1b3187[_0xe20f('0x21')]?_0x1b3187[_0xe20f('0x21')][_0xe20f('0x22')]===undefined?!![]:![]:!![],'where':_0x1b3187['options']?_0x1b3187['options'][_0xe20f('0x23')]||null:null,'attributes':_0x1b3187[_0xe20f('0x21')]?_0x1b3187[_0xe20f('0x21')][_0xe20f('0x24')]||null:null,'include':_0x1b3187[_0xe20f('0x21')]?_0x1b3187[_0xe20f('0x21')]['include']?_['map'](_0x1b3187[_0xe20f('0x21')]['include'],function(_0x41caa5){return{'model':db[_0x41caa5['model']],'as':_0x41caa5['as'],'attributes':_0x41caa5[_0xe20f('0x24')],'include':_0x41caa5[_0xe20f('0x27')]?_[_0xe20f('0x26')](_0x41caa5['include'],function(_0x3fdb4d){return{'model':db[_0x3fdb4d[_0xe20f('0x28')]],'as':_0x3fdb4d['as'],'attributes':_0x3fdb4d[_0xe20f('0x24')],'include':_0x3fdb4d['include']?_[_0xe20f('0x26')](_0x3fdb4d[_0xe20f('0x27')],function(_0x2773ca){return{'model':db[_0x2773ca[_0xe20f('0x28')]],'as':_0x2773ca['as'],'attributes':_0x2773ca['attributes']};}):[]};}):[]};}):[]:[]})[_0xe20f('0x12')](function(_0x5905f8){logger[_0xe20f('0x13')](_0xe20f('0x29'),_0x1b3187);logger['debug']('ShowWhatsappQueue',_0x1b3187,JSON[_0xe20f('0x17')](_0x5905f8));_0x227b8a(_0x5905f8);})[_0xe20f('0x1d')](function(_0x3414f8){logger[_0xe20f('0x18')](_0xe20f('0x29'),_0x3414f8[_0xe20f('0x1b')],_0x1b3187);_0x21f237(_0x55fdfc[_0xe20f('0x18')](0x1f4,_0x3414f8['message']));});});}; \ No newline at end of file +var _0xed02=['register','request','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','WhatsappQueue','findAll','options','raw','attributes','limit','include','map','model','GetWhatsappQueue','ShowWhatsappQueue','find','where','then','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost'];(function(_0x2ad0c9,_0x3d1bdd){var _0x4d1bf4=function(_0x598add){while(--_0x598add){_0x2ad0c9['push'](_0x2ad0c9['shift']());}};_0x4d1bf4(++_0x3d1bdd);}(_0xed02,0xfe));var _0x2ed0=function(_0x13e115,_0x35835f){_0x13e115=_0x13e115-0x0;var _0x311265=_0xed02[_0x13e115];return _0x311265;};'use strict';var _=require(_0x2ed0('0x0'));var util=require('util');var moment=require(_0x2ed0('0x1'));var BPromise=require(_0x2ed0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ed0('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ed0('0x4'));var logger=require(_0x2ed0('0x5'))(_0x2ed0('0x6'));var config=require('../../config/environment');var jayson=require(_0x2ed0('0x7'));var client=jayson[_0x2ed0('0x8')][_0x2ed0('0x9')]({'port':0x232a});config['redis']=_[_0x2ed0('0xa')](config['redis'],{'host':_0x2ed0('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./whatsappQueue.socket')[_0x2ed0('0xc')](socket);function respondWithRpcPromise(_0x4c45b8,_0x56c3fe,_0x50b141){return new BPromise(function(_0x1fac95,_0x484b52){return client[_0x2ed0('0xd')](_0x4c45b8,_0x50b141)['then'](function(_0x46bb58){logger[_0x2ed0('0xe')](_0x2ed0('0xf'),_0x56c3fe,_0x2ed0('0x10'));logger['debug'](_0x2ed0('0x11'),_0x56c3fe,_0x2ed0('0x10'),JSON[_0x2ed0('0x12')](_0x46bb58));if(_0x46bb58[_0x2ed0('0x13')]){if(_0x46bb58[_0x2ed0('0x13')][_0x2ed0('0x14')]===0x1f4){logger['error'](_0x2ed0('0xf'),_0x56c3fe,_0x46bb58[_0x2ed0('0x13')][_0x2ed0('0x15')]);return _0x484b52(_0x46bb58[_0x2ed0('0x13')][_0x2ed0('0x15')]);}logger['error'](_0x2ed0('0xf'),_0x56c3fe,_0x46bb58[_0x2ed0('0x13')][_0x2ed0('0x15')]);return _0x1fac95(_0x46bb58[_0x2ed0('0x13')][_0x2ed0('0x15')]);}else{logger[_0x2ed0('0xe')]('WhatsappQueue,\x20%s,\x20%s',_0x56c3fe,'request\x20sent');_0x1fac95(_0x46bb58[_0x2ed0('0x16')][_0x2ed0('0x15')]);}})[_0x2ed0('0x17')](function(_0x541ef6){logger[_0x2ed0('0x13')]('WhatsappQueue,\x20%s,\x20%s',_0x56c3fe,_0x541ef6);_0x484b52(_0x541ef6);});});}exports['GetWhatsappQueue']=function(_0x4efe88){var _0x250aa1=this;return new Promise(function(_0x22332c,_0x5cca60){return db[_0x2ed0('0x18')][_0x2ed0('0x19')]({'raw':_0x4efe88[_0x2ed0('0x1a')]?_0x4efe88[_0x2ed0('0x1a')][_0x2ed0('0x1b')]===undefined?!![]:![]:!![],'where':_0x4efe88[_0x2ed0('0x1a')]?_0x4efe88[_0x2ed0('0x1a')]['where']||null:null,'attributes':_0x4efe88[_0x2ed0('0x1a')]?_0x4efe88[_0x2ed0('0x1a')][_0x2ed0('0x1c')]||null:null,'limit':_0x4efe88['options']?_0x4efe88['options'][_0x2ed0('0x1d')]||null:null,'include':_0x4efe88['options']?_0x4efe88['options'][_0x2ed0('0x1e')]?_[_0x2ed0('0x1f')](_0x4efe88[_0x2ed0('0x1a')][_0x2ed0('0x1e')],function(_0x81bc52){return{'model':db[_0x81bc52['model']],'as':_0x81bc52['as'],'attributes':_0x81bc52[_0x2ed0('0x1c')],'include':_0x81bc52[_0x2ed0('0x1e')]?_['map'](_0x81bc52[_0x2ed0('0x1e')],function(_0x3769a6){return{'model':db[_0x3769a6[_0x2ed0('0x20')]],'as':_0x3769a6['as'],'attributes':_0x3769a6[_0x2ed0('0x1c')],'include':_0x3769a6[_0x2ed0('0x1e')]?_[_0x2ed0('0x1f')](_0x3769a6[_0x2ed0('0x1e')],function(_0x16f6d9){return{'model':db[_0x16f6d9['model']],'as':_0x16f6d9['as'],'attributes':_0x16f6d9[_0x2ed0('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4f4314){logger[_0x2ed0('0xe')]('GetWhatsappQueue',_0x4efe88);logger['debug']('GetWhatsappQueue',_0x4efe88,JSON[_0x2ed0('0x12')](_0x4f4314));_0x22332c(_0x4f4314);})['catch'](function(_0x574442){logger[_0x2ed0('0x13')](_0x2ed0('0x21'),_0x574442[_0x2ed0('0x15')],_0x4efe88);_0x5cca60(_0x250aa1['error'](0x1f4,_0x574442[_0x2ed0('0x15')]));});});};exports[_0x2ed0('0x22')]=function(_0x21cb90){var _0x16b1ed=this;return new Promise(function(_0x663d9e,_0x2ecdde){return db[_0x2ed0('0x18')][_0x2ed0('0x23')]({'raw':_0x21cb90[_0x2ed0('0x1a')]?_0x21cb90[_0x2ed0('0x1a')][_0x2ed0('0x1b')]===undefined?!![]:![]:!![],'where':_0x21cb90['options']?_0x21cb90[_0x2ed0('0x1a')][_0x2ed0('0x24')]||null:null,'attributes':_0x21cb90['options']?_0x21cb90[_0x2ed0('0x1a')][_0x2ed0('0x1c')]||null:null,'include':_0x21cb90[_0x2ed0('0x1a')]?_0x21cb90[_0x2ed0('0x1a')]['include']?_[_0x2ed0('0x1f')](_0x21cb90[_0x2ed0('0x1a')][_0x2ed0('0x1e')],function(_0x23f2e5){return{'model':db[_0x23f2e5[_0x2ed0('0x20')]],'as':_0x23f2e5['as'],'attributes':_0x23f2e5[_0x2ed0('0x1c')],'include':_0x23f2e5[_0x2ed0('0x1e')]?_[_0x2ed0('0x1f')](_0x23f2e5['include'],function(_0x45e4c4){return{'model':db[_0x45e4c4[_0x2ed0('0x20')]],'as':_0x45e4c4['as'],'attributes':_0x45e4c4[_0x2ed0('0x1c')],'include':_0x45e4c4['include']?_[_0x2ed0('0x1f')](_0x45e4c4[_0x2ed0('0x1e')],function(_0xd43c77){return{'model':db[_0xd43c77[_0x2ed0('0x20')]],'as':_0xd43c77['as'],'attributes':_0xd43c77['attributes']};}):[]};}):[]};}):[]:[]})[_0x2ed0('0x25')](function(_0x4b8746){logger[_0x2ed0('0xe')](_0x2ed0('0x22'),_0x21cb90);logger['debug']('ShowWhatsappQueue',_0x21cb90,JSON[_0x2ed0('0x12')](_0x4b8746));_0x663d9e(_0x4b8746);})['catch'](function(_0x2230c9){logger[_0x2ed0('0x13')](_0x2ed0('0x22'),_0x2230c9[_0x2ed0('0x15')],_0x21cb90);_0x2ecdde(_0x16b1ed[_0x2ed0('0x13')](0x1f4,_0x2230c9['message']));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index e1aaae3..097c808 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 _0x2810=['save','remove','update','emit','removeListener','register','length','whatsappQueue:'];(function(_0x22199a,_0x2d455d){var _0x400e70=function(_0x5632ae){while(--_0x5632ae){_0x22199a['push'](_0x22199a['shift']());}};_0x400e70(++_0x2d455d);}(_0x2810,0xf0));var _0x0281=function(_0x553396,_0x42c585){_0x553396=_0x553396-0x0;var _0x1c14b7=_0x2810[_0x553396];return _0x1c14b7;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=[_0x0281('0x0'),_0x0281('0x1'),_0x0281('0x2')];function createListener(_0x173859,_0x52356c){return function(_0x53e3ec){_0x52356c[_0x0281('0x3')](_0x173859,_0x53e3ec);};}function removeListener(_0x17ba5d,_0x388539){return function(){WhatsappQueueEvents[_0x0281('0x4')](_0x17ba5d,_0x388539);};}exports[_0x0281('0x5')]=function(_0x56ead2){for(var _0x3f6371=0x0,_0x3f63b1=events[_0x0281('0x6')];_0x3f6371<_0x3f63b1;_0x3f6371++){var _0x1c43cf=events[_0x3f6371];var _0x1a5e83=createListener(_0x0281('0x7')+_0x1c43cf,_0x56ead2);WhatsappQueueEvents['on'](_0x1c43cf,_0x1a5e83);}}; \ No newline at end of file +var _0x7e78=['register','length','./whatsappQueue.events'];(function(_0x2fe74a,_0x321c67){var _0x3556d3=function(_0xae97d7){while(--_0xae97d7){_0x2fe74a['push'](_0x2fe74a['shift']());}};_0x3556d3(++_0x321c67);}(_0x7e78,0x1dc));var _0x87e7=function(_0x1c369c,_0x57cac){_0x1c369c=_0x1c369c-0x0;var _0x36eab2=_0x7e78[_0x1c369c];return _0x36eab2;};'use strict';var WhatsappQueueEvents=require(_0x87e7('0x0'));var events=['save','remove','update'];function createListener(_0x1ec07e,_0x6dc87d){return function(_0x1657d8){_0x6dc87d['emit'](_0x1ec07e,_0x1657d8);};}function removeListener(_0x4ac746,_0x4b1cda){return function(){WhatsappQueueEvents['removeListener'](_0x4ac746,_0x4b1cda);};}exports[_0x87e7('0x1')]=function(_0x32820a){for(var _0x285415=0x0,_0x55fc3d=events[_0x87e7('0x2')];_0x285415<_0x55fc3d;_0x285415++){var _0x574aaa=events[_0x285415];var _0x11e5e8=createListener('whatsappQueue:'+_0x574aaa,_0x32820a);WhatsappQueueEvents['on'](_0x574aaa,_0x11e5e8);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 97a8ffe..e0973d2 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 _0xfc9d=['/describe','isAuthenticated','describe','/:id','post','update','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','index'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xfc9d,0xb2));var _0xdfc9=function(_0x1d130e,_0x314633){_0x1d130e=_0x1d130e-0x0;var _0x156c2f=_0xfc9d[_0x1d130e];return _0x156c2f;};'use strict';var multer=require(_0xdfc9('0x0'));var util=require(_0xdfc9('0x1'));var path=require(_0xdfc9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xdfc9('0x3'));var auth=require(_0xdfc9('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xdfc9('0x5'));var controller=require(_0xdfc9('0x6'));router[_0xdfc9('0x7')]('/',auth['isAuthenticated'](),controller[_0xdfc9('0x8')]);router[_0xdfc9('0x7')](_0xdfc9('0x9'),auth[_0xdfc9('0xa')](),controller[_0xdfc9('0xb')]);router[_0xdfc9('0x7')](_0xdfc9('0xc'),auth[_0xdfc9('0xa')](),controller['show']);router[_0xdfc9('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xdfc9('0xc'),auth[_0xdfc9('0xa')](),controller[_0xdfc9('0xe')]);router['delete'](_0xdfc9('0xc'),auth[_0xdfc9('0xa')](),controller[_0xdfc9('0xf')]);module[_0xdfc9('0x10')]=router; \ No newline at end of file +var _0x9dec=['put','update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','./whatsappQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','create'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x9dec,0xfb));var _0xc9de=function(_0x5d6631,_0x1d511a){_0x5d6631=_0x5d6631-0x0;var _0x20f5eb=_0x9dec[_0x5d6631];return _0x20f5eb;};'use strict';var multer=require(_0xc9de('0x0'));var util=require(_0xc9de('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc9de('0x2'));var router=express[_0xc9de('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xc9de('0x4'));var interaction=require(_0xc9de('0x5'));var config=require('../../config/environment');var controller=require(_0xc9de('0x6'));router[_0xc9de('0x7')]('/',auth[_0xc9de('0x8')](),controller[_0xc9de('0x9')]);router['get'](_0xc9de('0xa'),auth[_0xc9de('0x8')](),controller[_0xc9de('0xb')]);router[_0xc9de('0x7')](_0xc9de('0xc'),auth['isAuthenticated'](),controller[_0xc9de('0xd')]);router['post']('/',auth[_0xc9de('0x8')](),controller[_0xc9de('0xe')]);router[_0xc9de('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xc9de('0x10')]);router[_0xc9de('0x11')](_0xc9de('0xc'),auth[_0xc9de('0x8')](),controller[_0xc9de('0x12')]);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 46a073b..6f4adc7 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0x101c8a,_0x1803ed){var _0x4c49d3=function(_0x6a6446){while(--_0x6a6446){_0x101c8a['push'](_0x101c8a['shift']());}};_0x4c49d3(++_0x1803ed);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x23ed77,_0x2bba86){var _0x4dfbbd=function(_0x410593){while(--_0x410593){_0x23ed77['push'](_0x23ed77['shift']());}};_0x4dfbbd(++_0x2bba86);}(_0x7a54,0x106));var _0x47a5=function(_0x329150,_0x44dd3a){_0x329150=_0x329150-0x0;var _0xb646a0=_0x7a54[_0x329150];return _0xb646a0;};'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 3500fb2..065d2f6 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 _0x1399=['rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','params','keys','find','catch','body','destroy','describe','eml-format'];(function(_0x1d4439,_0x2306a0){var _0x5a84b5=function(_0x221ca5){while(--_0x221ca5){_0x1d4439['push'](_0x1d4439['shift']());}};_0x5a84b5(++_0x2306a0);}(_0x1399,0x16c));var _0x9139=function(_0x17a647,_0x2bbe12){_0x17a647=_0x17a647-0x0;var _0x219a38=_0x1399[_0x17a647];return _0x219a38;};'use strict';var emlformat=require(_0x9139('0x0'));var rimraf=require(_0x9139('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9139('0x2'));var rp=require('request-promise');var moment=require(_0x9139('0x3'));var BPromise=require(_0x9139('0x4'));var Mustache=require(_0x9139('0x5'));var util=require(_0x9139('0x6'));var path=require(_0x9139('0x7'));var sox=require(_0x9139('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9139('0x9'));var _=require(_0x9139('0xa'));var squel=require(_0x9139('0xb'));var crypto=require('crypto');var jsforce=require(_0x9139('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9139('0xd'));var Papa=require(_0x9139('0xe'));var Redis=require('ioredis');var authService=require(_0x9139('0xf'));var qs=require(_0x9139('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9139('0x11'))(_0x9139('0x12'));var utils=require(_0x9139('0x13'));var config=require(_0x9139('0x14'));var licenseUtil=require(_0x9139('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x52b32d,_0x511ec9){_0x511ec9=_0x511ec9||0xcc;return function(_0x417637){if(_0x417637){return _0x52b32d['sendStatus'](_0x511ec9);}return _0x52b32d[_0x9139('0x16')](_0x511ec9)[_0x9139('0x17')]();};}function respondWithResult(_0x375ada,_0x262009){_0x262009=_0x262009||0xc8;return function(_0x5936d2){if(_0x5936d2){return _0x375ada[_0x9139('0x16')](_0x262009)['json'](_0x5936d2);}};}function respondWithFilteredResult(_0x58307f,_0x52c57b){return function(_0x159e50){if(_0x159e50){var _0x3e2bad=typeof _0x52c57b[_0x9139('0x18')]===_0x9139('0x19')&&typeof _0x52c57b[_0x9139('0x1a')]===_0x9139('0x19');var _0x4bd957=_0x159e50['count'];var _0x13cab8=_0x3e2bad?0x0:_0x52c57b[_0x9139('0x18')];var _0x5e0a59=_0x3e2bad?_0x159e50['count']:_0x52c57b[_0x9139('0x18')]+_0x52c57b[_0x9139('0x1a')];var _0x56add4;if(_0x5e0a59>=_0x4bd957){_0x5e0a59=_0x4bd957;_0x56add4=0xc8;}else{_0x56add4=0xce;}_0x58307f[_0x9139('0x16')](_0x56add4);return _0x58307f[_0x9139('0x1b')](_0x9139('0x1c'),_0x13cab8+'-'+_0x5e0a59+'/'+_0x4bd957)[_0x9139('0x1d')](_0x159e50);}return null;};}function patchUpdates(_0xd2eb33){return function(_0x6f901b){try{jsonpatch[_0x9139('0x1e')](_0x6f901b,_0xd2eb33,!![]);}catch(_0x45fa16){return BPromise[_0x9139('0x1f')](_0x45fa16);}return _0x6f901b[_0x9139('0x20')]();};}function saveUpdates(_0x1bac18,_0x269f8a){return function(_0x5a3e2e){if(_0x5a3e2e){return _0x5a3e2e[_0x9139('0x21')](_0x1bac18)[_0x9139('0x22')](function(_0x31635a){return _0x31635a;});}return null;};}function removeEntity(_0x1aee3b,_0x934732){return function(_0x1a7350){if(_0x1a7350){return _0x1a7350['destroy']()[_0x9139('0x22')](function(){_0x1aee3b[_0x9139('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ed4da,_0x2ee4bb){return function(_0x10bfa0){if(!_0x10bfa0){_0x3ed4da['sendStatus'](0x194);}return _0x10bfa0;};}function handleError(_0x4118dc,_0xffd487){_0xffd487=_0xffd487||0x1f4;return function(_0x49d01e){logger[_0x9139('0x23')](_0x49d01e[_0x9139('0x24')]);if(_0x49d01e[_0x9139('0x25')]){delete _0x49d01e['name'];}_0x4118dc[_0x9139('0x16')](_0xffd487)[_0x9139('0x26')](_0x49d01e);};}exports[_0x9139('0x27')]=function(_0x22994c,_0x215194){var _0x16dfb4={},_0xfe6854={},_0x573a05={'count':0x0,'rows':[]};var _0x55cc6a=_[_0x9139('0x28')](db[_0x9139('0x29')][_0x9139('0x2a')],function(_0x4c1693){return{'name':_0x4c1693['fieldName'],'type':_0x4c1693[_0x9139('0x2b')][_0x9139('0x2c')]};});_0xfe6854[_0x9139('0x2d')]=_[_0x9139('0x28')](_0x55cc6a,_0x9139('0x25'));_0xfe6854['query']=_['keys'](_0x22994c[_0x9139('0x2e')]);_0xfe6854['filters']=_['intersection'](_0xfe6854[_0x9139('0x2d')],_0xfe6854[_0x9139('0x2e')]);_0x16dfb4['attributes']=_[_0x9139('0x2f')](_0xfe6854[_0x9139('0x2d')],qs['fields'](_0x22994c[_0x9139('0x2e')][_0x9139('0x30')]));_0x16dfb4[_0x9139('0x31')]=_0x16dfb4[_0x9139('0x31')][_0x9139('0x32')]?_0x16dfb4[_0x9139('0x31')]:_0xfe6854[_0x9139('0x2d')];if(!_0x22994c[_0x9139('0x2e')][_0x9139('0x33')](_0x9139('0x34'))){_0x16dfb4[_0x9139('0x1a')]=qs['limit'](_0x22994c[_0x9139('0x2e')][_0x9139('0x1a')]);_0x16dfb4['offset']=qs[_0x9139('0x18')](_0x22994c[_0x9139('0x2e')][_0x9139('0x18')]);}_0x16dfb4['order']=qs[_0x9139('0x35')](_0x22994c[_0x9139('0x2e')][_0x9139('0x35')]);_0x16dfb4[_0x9139('0x36')]=qs[_0x9139('0x37')](_[_0x9139('0x38')](_0x22994c[_0x9139('0x2e')],_0xfe6854[_0x9139('0x37')]),_0x55cc6a);if(_0x22994c[_0x9139('0x2e')][_0x9139('0x39')]){_0x16dfb4['where']=_[_0x9139('0x3a')](_0x16dfb4[_0x9139('0x36')],{'$or':_[_0x9139('0x28')](_0x55cc6a,function(_0x2cebb9){if(_0x2cebb9[_0x9139('0x2b')]!==_0x9139('0x3b')){var _0x1ea313={};_0x1ea313[_0x2cebb9['name']]={'$like':'%'+_0x22994c[_0x9139('0x2e')]['filter']+'%'};return _0x1ea313;}})});}_0x16dfb4=_[_0x9139('0x3a')]({},_0x16dfb4,_0x22994c[_0x9139('0x3c')]);var _0x3fb4db={'where':_0x16dfb4['where']};return db[_0x9139('0x29')][_0x9139('0x3d')](_0x3fb4db)[_0x9139('0x22')](function(_0x236513){_0x573a05[_0x9139('0x3d')]=_0x236513;if(_0x22994c[_0x9139('0x2e')][_0x9139('0x3e')]){_0x16dfb4[_0x9139('0x3f')]=[{'all':!![]}];}return db[_0x9139('0x29')][_0x9139('0x40')](_0x16dfb4);})['then'](function(_0xf14393){_0x573a05[_0x9139('0x41')]=_0xf14393;return _0x573a05;})[_0x9139('0x22')](respondWithFilteredResult(_0x215194,_0x16dfb4))['catch'](handleError(_0x215194,null));};exports['show']=function(_0x4d9670,_0x465f49){var _0x12ba4b={'raw':!![],'where':{'id':_0x4d9670[_0x9139('0x42')]['id']}},_0x3611b4={};_0x3611b4[_0x9139('0x2d')]=_['keys'](db[_0x9139('0x29')][_0x9139('0x2a')]);_0x3611b4[_0x9139('0x2e')]=_[_0x9139('0x43')](_0x4d9670[_0x9139('0x2e')]);_0x3611b4['filters']=_[_0x9139('0x2f')](_0x3611b4[_0x9139('0x2d')],_0x3611b4[_0x9139('0x2e')]);_0x12ba4b[_0x9139('0x31')]=_['intersection'](_0x3611b4['model'],qs[_0x9139('0x30')](_0x4d9670[_0x9139('0x2e')]['fields']));_0x12ba4b['attributes']=_0x12ba4b[_0x9139('0x31')][_0x9139('0x32')]?_0x12ba4b['attributes']:_0x3611b4[_0x9139('0x2d')];if(_0x4d9670[_0x9139('0x2e')]['includeAll']){_0x12ba4b[_0x9139('0x3f')]=[{'all':!![]}];}_0x12ba4b=_['merge']({},_0x12ba4b,_0x4d9670['options']);return db[_0x9139('0x29')][_0x9139('0x44')](_0x12ba4b)[_0x9139('0x22')](handleEntityNotFound(_0x465f49,null))[_0x9139('0x22')](respondWithResult(_0x465f49,null))[_0x9139('0x45')](handleError(_0x465f49,null));};exports['create']=function(_0x3e126c,_0xc55b16){return db[_0x9139('0x29')]['create'](_0x3e126c[_0x9139('0x46')],{})[_0x9139('0x22')](respondWithResult(_0xc55b16,0xc9))[_0x9139('0x45')](handleError(_0xc55b16,null));};exports[_0x9139('0x21')]=function(_0x215793,_0x31395f){if(_0x215793[_0x9139('0x46')]['id']){delete _0x215793[_0x9139('0x46')]['id'];}return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x215793[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x31395f,null))[_0x9139('0x22')](saveUpdates(_0x215793[_0x9139('0x46')],null))[_0x9139('0x22')](respondWithResult(_0x31395f,null))['catch'](handleError(_0x31395f,null));};exports[_0x9139('0x47')]=function(_0x46f77a,_0x557c93){return db[_0x9139('0x29')][_0x9139('0x44')]({'where':{'id':_0x46f77a[_0x9139('0x42')]['id']}})['then'](handleEntityNotFound(_0x557c93,null))[_0x9139('0x22')](removeEntity(_0x557c93,null))[_0x9139('0x45')](handleError(_0x557c93,null));};exports[_0x9139('0x48')]=function(_0x23669b,_0x51ecf6){return db[_0x9139('0x29')][_0x9139('0x48')]()[_0x9139('0x22')](respondWithResult(_0x51ecf6,null))['catch'](handleError(_0x51ecf6,null));}; \ No newline at end of file +var _0xa571=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','end','error','name','index','map','WhatsappQueueReport','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','show','params','rawAttributes','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service'];(function(_0x3ac326,_0x2a22de){var _0x9ddf0a=function(_0x201e6f){while(--_0x201e6f){_0x3ac326['push'](_0x3ac326['shift']());}};_0x9ddf0a(++_0x2a22de);}(_0xa571,0x107));var _0x1a57=function(_0x39b4ce,_0xf4a169){_0x39b4ce=_0x39b4ce-0x0;var _0x99b024=_0xa571[_0x39b4ce];return _0x99b024;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x23')]();});}};}function handleEntityNotFound(_0x2f9454,_0x182649){return function(_0x25c1e9){if(!_0x25c1e9){_0x2f9454[_0x1a57('0x18')](0x194);}return _0x25c1e9;};}function handleError(_0x27cfe1,_0xf6ffef){_0xf6ffef=_0xf6ffef||0x1f4;return function(_0x26584b){logger[_0x1a57('0x24')](_0x26584b['stack']);if(_0x26584b['name']){delete _0x26584b[_0x1a57('0x25')];}_0x27cfe1[_0x1a57('0x19')](_0xf6ffef)['send'](_0x26584b);};}exports[_0x1a57('0x26')]=function(_0x54f6a5,_0x2d8738){var _0x4a2901={},_0x53bf6e={},_0x8179a4={'count':0x0,'rows':[]};var _0x274fe6=_[_0x1a57('0x27')](db[_0x1a57('0x28')]['rawAttributes'],function(_0x366d5f){return{'name':_0x366d5f[_0x1a57('0x29')],'type':_0x366d5f[_0x1a57('0x2a')][_0x1a57('0x2b')]};});_0x53bf6e['model']=_[_0x1a57('0x27')](_0x274fe6,_0x1a57('0x25'));_0x53bf6e[_0x1a57('0x2c')]=_[_0x1a57('0x2d')](_0x54f6a5[_0x1a57('0x2c')]);_0x53bf6e[_0x1a57('0x2e')]=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],_0x53bf6e[_0x1a57('0x2c')]);_0x4a2901['attributes']=_[_0x1a57('0x2f')](_0x53bf6e[_0x1a57('0x30')],qs['fields'](_0x54f6a5['query'][_0x1a57('0x31')]));_0x4a2901[_0x1a57('0x32')]=_0x4a2901[_0x1a57('0x32')][_0x1a57('0x33')]?_0x4a2901[_0x1a57('0x32')]:_0x53bf6e[_0x1a57('0x30')];if(!_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x34')](_0x1a57('0x35'))){_0x4a2901[_0x1a57('0x1c')]=qs[_0x1a57('0x1c')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1c')]);_0x4a2901[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x1e')]);}_0x4a2901[_0x1a57('0x36')]=qs['sort'](_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x37')]);_0x4a2901[_0x1a57('0x38')]=qs[_0x1a57('0x2e')](_[_0x1a57('0x39')](_0x54f6a5[_0x1a57('0x2c')],_0x53bf6e[_0x1a57('0x2e')]),_0x274fe6);if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]){_0x4a2901['where']=_['merge'](_0x4a2901['where'],{'$or':_['map'](_0x274fe6,function(_0x333b32){if(_0x333b32[_0x1a57('0x2a')]!==_0x1a57('0x3b')){var _0x4d6e1e={};_0x4d6e1e[_0x333b32[_0x1a57('0x25')]]={'$like':'%'+_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3a')]+'%'};return _0x4d6e1e;}})});}_0x4a2901=_[_0x1a57('0x3c')]({},_0x4a2901,_0x54f6a5['options']);var _0x1be254={'where':_0x4a2901['where']};return db[_0x1a57('0x28')][_0x1a57('0x1d')](_0x1be254)[_0x1a57('0x21')](function(_0x534a9a){_0x8179a4[_0x1a57('0x1d')]=_0x534a9a;if(_0x54f6a5[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x4a2901[_0x1a57('0x3e')]=[{'all':!![]}];}return db[_0x1a57('0x28')]['findAll'](_0x4a2901);})[_0x1a57('0x21')](function(_0x47e998){_0x8179a4['rows']=_0x47e998;return _0x8179a4;})[_0x1a57('0x21')](respondWithFilteredResult(_0x2d8738,_0x4a2901))['catch'](handleError(_0x2d8738,null));};exports[_0x1a57('0x3f')]=function(_0x398c59,_0x3fbae1){var _0x59abb1={'raw':!![],'where':{'id':_0x398c59[_0x1a57('0x40')]['id']}},_0x188a50={};_0x188a50[_0x1a57('0x30')]=_[_0x1a57('0x2d')](db['WhatsappQueueReport'][_0x1a57('0x41')]);_0x188a50[_0x1a57('0x2c')]=_['keys'](_0x398c59[_0x1a57('0x2c')]);_0x188a50['filters']=_['intersection'](_0x188a50[_0x1a57('0x30')],_0x188a50[_0x1a57('0x2c')]);_0x59abb1[_0x1a57('0x32')]=_[_0x1a57('0x2f')](_0x188a50['model'],qs[_0x1a57('0x31')](_0x398c59[_0x1a57('0x2c')][_0x1a57('0x31')]));_0x59abb1[_0x1a57('0x32')]=_0x59abb1[_0x1a57('0x32')]['length']?_0x59abb1[_0x1a57('0x32')]:_0x188a50[_0x1a57('0x30')];if(_0x398c59[_0x1a57('0x2c')][_0x1a57('0x3d')]){_0x59abb1['include']=[{'all':!![]}];}_0x59abb1=_[_0x1a57('0x3c')]({},_0x59abb1,_0x398c59['options']);return db[_0x1a57('0x28')][_0x1a57('0x42')](_0x59abb1)[_0x1a57('0x21')](handleEntityNotFound(_0x3fbae1,null))[_0x1a57('0x21')](respondWithResult(_0x3fbae1,null))[_0x1a57('0x43')](handleError(_0x3fbae1,null));};exports[_0x1a57('0x44')]=function(_0x28f629,_0x401285){return db[_0x1a57('0x28')][_0x1a57('0x44')](_0x28f629[_0x1a57('0x45')],{})[_0x1a57('0x21')](respondWithResult(_0x401285,0xc9))[_0x1a57('0x43')](handleError(_0x401285,null));};exports['update']=function(_0xf4d056,_0x480aff){if(_0xf4d056[_0x1a57('0x45')]['id']){delete _0xf4d056[_0x1a57('0x45')]['id'];}return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0xf4d056[_0x1a57('0x40')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x480aff,null))[_0x1a57('0x21')](saveUpdates(_0xf4d056[_0x1a57('0x45')],null))[_0x1a57('0x21')](respondWithResult(_0x480aff,null))['catch'](handleError(_0x480aff,null));};exports[_0x1a57('0x22')]=function(_0x439a42,_0x51651d){return db[_0x1a57('0x28')][_0x1a57('0x42')]({'where':{'id':_0x439a42['params']['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x51651d,null))[_0x1a57('0x21')](removeEntity(_0x51651d,null))['catch'](handleError(_0x51651d,null));};exports['describe']=function(_0x5b0563,_0x2c1bac){return db[_0x1a57('0x28')]['describe']()[_0x1a57('0x21')](respondWithResult(_0x2c1bac,null))[_0x1a57('0x43')](handleError(_0x2c1bac,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index aed2f92..84aca24 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 _0xc3b4=['util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid','lodash'];(function(_0x54a9e3,_0x4a3813){var _0x247cce=function(_0x50aa49){while(--_0x50aa49){_0x54a9e3['push'](_0x54a9e3['shift']());}};_0x247cce(++_0x4a3813);}(_0xc3b4,0x7d));var _0x4c3b=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xc3b4[_0x330414];return _0x99dbff;};'use strict';var _=require(_0x4c3b('0x0'));var util=require(_0x4c3b('0x1'));var logger=require(_0x4c3b('0x2'))(_0x4c3b('0x3'));var moment=require(_0x4c3b('0x4'));var BPromise=require(_0x4c3b('0x5'));var rp=require(_0x4c3b('0x6'));var fs=require('fs');var path=require(_0x4c3b('0x7'));var rimraf=require('rimraf');var config=require(_0x4c3b('0x8'));var attributes=require(_0x4c3b('0x9'));module[_0x4c3b('0xa')]=function(_0x10d4e1,_0x454593){return _0x10d4e1[_0x4c3b('0xb')](_0x4c3b('0xc'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4c3b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb296=['util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash'];(function(_0x37eeb7,_0x205a21){var _0x686131=function(_0x5e687e){while(--_0x5e687e){_0x37eeb7['push'](_0x37eeb7['shift']());}};_0x686131(++_0x205a21);}(_0xb296,0xdf));var _0x6b29=function(_0x179a74,_0x41976c){_0x179a74=_0x179a74-0x0;var _0x17ff23=_0xb296[_0x179a74];return _0x17ff23;};'use strict';var _=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var logger=require(_0x6b29('0x2'))(_0x6b29('0x3'));var moment=require(_0x6b29('0x4'));var BPromise=require(_0x6b29('0x5'));var rp=require(_0x6b29('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6b29('0x7'));var attributes=require(_0x6b29('0x8'));module[_0x6b29('0x9')]=function(_0x381586,_0x11189b){return _0x381586[_0x6b29('0xa')](_0x6b29('0xb'),attributes,{'tableName':_0x6b29('0xc'),'paranoid':![],'indexes':[{'name':_0x6b29('0xd'),'fields':[_0x6b29('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 0069494..695109e 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 _0xc97f=['update','where','attributes','debug','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','raw','UpdateWhatsappQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc97f,0xca));var _0xfc97=function(_0x3e8a8d,_0x1b44ba){_0x3e8a8d=_0x3e8a8d-0x0;var _0x4ee6ac=_0xc97f[_0x3e8a8d];return _0x4ee6ac;};'use strict';var _=require(_0xfc97('0x0'));var util=require(_0xfc97('0x1'));var moment=require(_0xfc97('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc97('0x3'))['db'];var utils=require(_0xfc97('0x4'));var logger=require(_0xfc97('0x5'))(_0xfc97('0x6'));var config=require(_0xfc97('0x7'));var jayson=require(_0xfc97('0x8'));var client=jayson[_0xfc97('0x9')][_0xfc97('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15c48e,_0x142c83,_0x354ed5){return new BPromise(function(_0x2ce07e,_0x4277b8){return client[_0xfc97('0xb')](_0x15c48e,_0x354ed5)[_0xfc97('0xc')](function(_0xd53d94){logger[_0xfc97('0xd')](_0xfc97('0xe'),_0x142c83,'request\x20sent');logger['debug']('WhatsappQueueReport,\x20%s,\x20%s,\x20%s',_0x142c83,_0xfc97('0xf'),JSON[_0xfc97('0x10')](_0xd53d94));if(_0xd53d94[_0xfc97('0x11')]){if(_0xd53d94[_0xfc97('0x11')][_0xfc97('0x12')]===0x1f4){logger[_0xfc97('0x11')]('WhatsappQueueReport,\x20%s,\x20%s',_0x142c83,_0xd53d94[_0xfc97('0x11')][_0xfc97('0x13')]);return _0x4277b8(_0xd53d94[_0xfc97('0x11')][_0xfc97('0x13')]);}logger[_0xfc97('0x11')](_0xfc97('0xe'),_0x142c83,_0xd53d94['error'][_0xfc97('0x13')]);return _0x2ce07e(_0xd53d94[_0xfc97('0x11')][_0xfc97('0x13')]);}else{logger[_0xfc97('0xd')]('WhatsappQueueReport,\x20%s,\x20%s',_0x142c83,_0xfc97('0xf'));_0x2ce07e(_0xd53d94[_0xfc97('0x14')][_0xfc97('0x13')]);}})[_0xfc97('0x15')](function(_0x3a1e31){logger[_0xfc97('0x11')](_0xfc97('0xe'),_0x142c83,_0x3a1e31);_0x4277b8(_0x3a1e31);});});}exports[_0xfc97('0x16')]=function(_0x240403){var _0x6a9922=this;return new Promise(function(_0x55285b,_0x3b9e39){return db[_0xfc97('0x17')][_0xfc97('0x18')](_0x240403[_0xfc97('0x19')],{'raw':_0x240403[_0xfc97('0x1a')]?_0x240403[_0xfc97('0x1a')][_0xfc97('0x1b')]===undefined?!![]:![]:!![]})[_0xfc97('0xc')](function(_0x3998c0){logger['info']('CreateWhatsappQueueReport',_0x240403);logger['debug'](_0xfc97('0x16'),_0x240403,JSON[_0xfc97('0x10')](_0x3998c0));_0x55285b(_0x3998c0);})['catch'](function(_0x280bea){logger[_0xfc97('0x11')](_0xfc97('0x16'),_0x280bea['message'],_0x240403);_0x3b9e39(_0x6a9922['error'](0x1f4,_0x280bea['message']));});});};exports[_0xfc97('0x1c')]=function(_0x9787e0){var _0x5bf7d1=this;return new Promise(function(_0x315520,_0x4d88be){return db[_0xfc97('0x17')][_0xfc97('0x1d')](_0x9787e0[_0xfc97('0x19')],{'raw':_0x9787e0['options']?_0x9787e0[_0xfc97('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9787e0[_0xfc97('0x1a')]?_0x9787e0[_0xfc97('0x1a')][_0xfc97('0x1e')]||null:null,'attributes':_0x9787e0[_0xfc97('0x1a')]?_0x9787e0['options'][_0xfc97('0x1f')]||null:null,'limit':_0x9787e0['options']?_0x9787e0[_0xfc97('0x1a')]['limit']||null:null})[_0xfc97('0xc')](function(_0x80c568){logger['info'](_0xfc97('0x1c'),_0x9787e0);logger[_0xfc97('0x20')](_0xfc97('0x1c'),_0x9787e0,JSON[_0xfc97('0x10')](_0x80c568));_0x315520(_0x80c568);})[_0xfc97('0x15')](function(_0x19a105){logger[_0xfc97('0x11')]('UpdateWhatsappQueueReport',_0x19a105[_0xfc97('0x13')],_0x9787e0);_0x4d88be(_0x5bf7d1[_0xfc97('0x11')](0x1f4,_0x19a105[_0xfc97('0x13')]));});});}; \ No newline at end of file +var _0x5ebc=['stringify','error','WhatsappQueueReport,\x20%s,\x20%s','message','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','create','body','options','debug','UpdateWhatsappQueueReport','raw','where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','then','info','request\x20sent','WhatsappQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x2cae8e,_0x32a809){var _0x59fd42=function(_0x544475){while(--_0x544475){_0x2cae8e['push'](_0x2cae8e['shift']());}};_0x59fd42(++_0x32a809);}(_0x5ebc,0x1a4));var _0xc5eb=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x5ebc[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xc5eb('0x0'));var util=require(_0xc5eb('0x1'));var moment=require(_0xc5eb('0x2'));var BPromise=require(_0xc5eb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5eb('0x4'));var db=require(_0xc5eb('0x5'))['db'];var utils=require(_0xc5eb('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc5eb('0x7'));var client=jayson['client'][_0xc5eb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b82d4,_0xf4c674,_0x5ac95){return new BPromise(function(_0x4f19e8,_0xfa34f3){return client[_0xc5eb('0x9')](_0x4b82d4,_0x5ac95)[_0xc5eb('0xa')](function(_0x468184){logger[_0xc5eb('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0xf4c674,_0xc5eb('0xc'));logger['debug'](_0xc5eb('0xd'),_0xf4c674,_0xc5eb('0xc'),JSON[_0xc5eb('0xe')](_0x468184));if(_0x468184['error']){if(_0x468184[_0xc5eb('0xf')]['code']===0x1f4){logger['error'](_0xc5eb('0x10'),_0xf4c674,_0x468184[_0xc5eb('0xf')][_0xc5eb('0x11')]);return _0xfa34f3(_0x468184[_0xc5eb('0xf')][_0xc5eb('0x11')]);}logger[_0xc5eb('0xf')](_0xc5eb('0x10'),_0xf4c674,_0x468184['error'][_0xc5eb('0x11')]);return _0x4f19e8(_0x468184[_0xc5eb('0xf')][_0xc5eb('0x11')]);}else{logger[_0xc5eb('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0xf4c674,_0xc5eb('0xc'));_0x4f19e8(_0x468184[_0xc5eb('0x12')][_0xc5eb('0x11')]);}})[_0xc5eb('0x13')](function(_0x24357b){logger[_0xc5eb('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0xf4c674,_0x24357b);_0xfa34f3(_0x24357b);});});}exports[_0xc5eb('0x14')]=function(_0x4fcd51){var _0x3d36db=this;return new Promise(function(_0x400822,_0x40c677){return db[_0xc5eb('0x15')][_0xc5eb('0x16')](_0x4fcd51[_0xc5eb('0x17')],{'raw':_0x4fcd51[_0xc5eb('0x18')]?_0x4fcd51[_0xc5eb('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xc5eb('0xa')](function(_0x385f71){logger[_0xc5eb('0xb')](_0xc5eb('0x14'),_0x4fcd51);logger[_0xc5eb('0x19')](_0xc5eb('0x14'),_0x4fcd51,JSON[_0xc5eb('0xe')](_0x385f71));_0x400822(_0x385f71);})[_0xc5eb('0x13')](function(_0x3e0c2e){logger[_0xc5eb('0xf')](_0xc5eb('0x14'),_0x3e0c2e[_0xc5eb('0x11')],_0x4fcd51);_0x40c677(_0x3d36db[_0xc5eb('0xf')](0x1f4,_0x3e0c2e['message']));});});};exports[_0xc5eb('0x1a')]=function(_0x17861a){var _0x529003=this;return new Promise(function(_0x334145,_0x69d524){return db[_0xc5eb('0x15')]['update'](_0x17861a[_0xc5eb('0x17')],{'raw':_0x17861a[_0xc5eb('0x18')]?_0x17861a['options'][_0xc5eb('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17861a[_0xc5eb('0x18')]?_0x17861a[_0xc5eb('0x18')][_0xc5eb('0x1c')]||null:null,'attributes':_0x17861a['options']?_0x17861a['options'][_0xc5eb('0x1d')]||null:null,'limit':_0x17861a[_0xc5eb('0x18')]?_0x17861a[_0xc5eb('0x18')][_0xc5eb('0x1e')]||null:null})[_0xc5eb('0xa')](function(_0xf02b50){logger[_0xc5eb('0xb')](_0xc5eb('0x1a'),_0x17861a);logger[_0xc5eb('0x19')](_0xc5eb('0x1a'),_0x17861a,JSON['stringify'](_0xf02b50));_0x334145(_0xf02b50);})[_0xc5eb('0x13')](function(_0x35423b){logger[_0xc5eb('0xf')](_0xc5eb('0x1a'),_0x35423b[_0xc5eb('0x11')],_0x17861a);_0x69d524(_0x529003[_0xc5eb('0xf')](0x1f4,_0x35423b[_0xc5eb('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 802e0ed..fded1ce 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 _0x8a68=['connect-timeout','express','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe','describe','/:id','show','create','put','destroy','exports','multer','path'];(function(_0x2df894,_0x22ef74){var _0x3e907e=function(_0x4d666b){while(--_0x4d666b){_0x2df894['push'](_0x2df894['shift']());}};_0x3e907e(++_0x22ef74);}(_0x8a68,0xd6));var _0x88a6=function(_0x323d2e,_0x52b0ac){_0x323d2e=_0x323d2e-0x0;var _0x1b5ad7=_0x8a68[_0x323d2e];return _0x1b5ad7;};'use strict';var multer=require(_0x88a6('0x0'));var util=require('util');var path=require(_0x88a6('0x1'));var timeout=require(_0x88a6('0x2'));var express=require(_0x88a6('0x3'));var router=express[_0x88a6('0x4')]();var fs_extra=require(_0x88a6('0x5'));var auth=require(_0x88a6('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./whatsappTransferReport.controller');router[_0x88a6('0x7')]('/',auth[_0x88a6('0x8')](),controller[_0x88a6('0x9')]);router[_0x88a6('0x7')](_0x88a6('0xa'),auth[_0x88a6('0x8')](),controller[_0x88a6('0xb')]);router['get'](_0x88a6('0xc'),auth['isAuthenticated'](),controller[_0x88a6('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x88a6('0xe')]);router[_0x88a6('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x88a6('0x8')](),controller[_0x88a6('0x10')]);module[_0x88a6('0x11')]=router; \ No newline at end of file +var _0x1fdb=['index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../config/environment','./whatsappTransferReport.controller','get','isAuthenticated'];(function(_0x1644e5,_0x31ac5f){var _0x5bc914=function(_0x2302a1){while(--_0x2302a1){_0x1644e5['push'](_0x1644e5['shift']());}};_0x5bc914(++_0x31ac5f);}(_0x1fdb,0x1c4));var _0xb1fd=function(_0x193b10,_0x4d689e){_0x193b10=_0x193b10-0x0;var _0x2e9d11=_0x1fdb[_0x193b10];return _0x2e9d11;};'use strict';var multer=require(_0xb1fd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb1fd('0x1'));var express=require(_0xb1fd('0x2'));var router=express[_0xb1fd('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb1fd('0x4'));var controller=require(_0xb1fd('0x5'));router[_0xb1fd('0x6')]('/',auth[_0xb1fd('0x7')](),controller[_0xb1fd('0x8')]);router['get'](_0xb1fd('0x9'),auth[_0xb1fd('0x7')](),controller[_0xb1fd('0xa')]);router['get'](_0xb1fd('0xb'),auth[_0xb1fd('0x7')](),controller[_0xb1fd('0xc')]);router[_0xb1fd('0xd')]('/',auth[_0xb1fd('0x7')](),controller[_0xb1fd('0xe')]);router[_0xb1fd('0xf')](_0xb1fd('0xb'),auth[_0xb1fd('0x7')](),controller[_0xb1fd('0x10')]);router[_0xb1fd('0x11')](_0xb1fd('0xb'),auth[_0xb1fd('0x7')](),controller[_0xb1fd('0x12')]);module[_0xb1fd('0x13')]=router; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js b/server/api/whatsappTransferReport/whatsappTransferReport.attributes.js index 114b739..bd547c4 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 _0x2572=['sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0x2572,0x110));var _0x2257=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x2572[_0x2b10c6];return _0x3789d2;};'use strict';var Sequelize=require(_0x2257('0x0'));module[_0x2257('0x1')]={'uniqueid':{'type':Sequelize[_0x2257('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x2257('0x3')](_0x2257('0x4'),_0x2257('0x5'),_0x2257('0x6')),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x2257('0x7')]}}; \ No newline at end of file +var _0x4ad3=['exports','STRING','ENUM','account','agent','DATE','sequelize'];(function(_0x502d22,_0x5a19ef){var _0xe0d8da=function(_0x55ec0f){while(--_0x55ec0f){_0x502d22['push'](_0x502d22['shift']());}};_0xe0d8da(++_0x5a19ef);}(_0x4ad3,0x1b1));var _0x34ad=function(_0x459963,_0x5a366a){_0x459963=_0x459963-0x0;var _0xbe84e3=_0x4ad3[_0x459963];return _0xbe84e3;};'use strict';var Sequelize=require(_0x34ad('0x0'));module[_0x34ad('0x1')]={'uniqueid':{'type':Sequelize[_0x34ad('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x34ad('0x3')](_0x34ad('0x4'),_0x34ad('0x5'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0x34ad('0x6')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 2ddc654..55f9939 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 _0x23db=['where','pick','merge','type','VIRTUAL','filter','options','include','findAll','rows','catch','includeAll','create','body','find','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','WhatsappTransferReport','rawAttributes','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5c1713,_0x4a7f8d){var _0x88daab=function(_0x2d2596){while(--_0x2d2596){_0x5c1713['push'](_0x5c1713['shift']());}};_0x88daab(++_0x4a7f8d);}(_0x23db,0x141));var _0xb23d=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x23db[_0x243b2f];return _0xcb3c2d;};'use strict';var emlformat=require(_0xb23d('0x0'));var rimraf=require(_0xb23d('0x1'));var zipdir=require(_0xb23d('0x2'));var jsonpatch=require(_0xb23d('0x3'));var rp=require(_0xb23d('0x4'));var moment=require(_0xb23d('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb23d('0x6'));var path=require(_0xb23d('0x7'));var sox=require('sox');var csv=require(_0xb23d('0x8'));var ejs=require(_0xb23d('0x9'));var fs=require('fs');var fs_extra=require(_0xb23d('0xa'));var _=require(_0xb23d('0xb'));var squel=require(_0xb23d('0xc'));var crypto=require(_0xb23d('0xd'));var jsforce=require(_0xb23d('0xe'));var deskjs=require(_0xb23d('0xf'));var toCsv=require(_0xb23d('0x8'));var querystring=require('querystring');var Papa=require(_0xb23d('0x10'));var Redis=require(_0xb23d('0x11'));var authService=require(_0xb23d('0x12'));var qs=require(_0xb23d('0x13'));var as=require(_0xb23d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xb23d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xb23d('0x16'));var db=require(_0xb23d('0x17'))['db'];function respondWithStatusCode(_0x191c69,_0x4112b5){_0x4112b5=_0x4112b5||0xcc;return function(_0x13e918){if(_0x13e918){return _0x191c69[_0xb23d('0x18')](_0x4112b5);}return _0x191c69[_0xb23d('0x19')](_0x4112b5)['end']();};}function respondWithResult(_0x627cc1,_0x2da615){_0x2da615=_0x2da615||0xc8;return function(_0x2fa37a){if(_0x2fa37a){return _0x627cc1[_0xb23d('0x19')](_0x2da615)[_0xb23d('0x1a')](_0x2fa37a);}};}function respondWithFilteredResult(_0x2f18b2,_0x57f725){return function(_0x5a8364){if(_0x5a8364){var _0x2fba80=typeof _0x57f725[_0xb23d('0x1b')]===_0xb23d('0x1c')&&typeof _0x57f725[_0xb23d('0x1d')]===_0xb23d('0x1c');var _0x21f5a=_0x5a8364['count'];var _0x37bfe2=_0x2fba80?0x0:_0x57f725[_0xb23d('0x1b')];var _0x2b47e0=_0x2fba80?_0x5a8364[_0xb23d('0x1e')]:_0x57f725['offset']+_0x57f725[_0xb23d('0x1d')];var _0x5baf53;if(_0x2b47e0>=_0x21f5a){_0x2b47e0=_0x21f5a;_0x5baf53=0xc8;}else{_0x5baf53=0xce;}_0x2f18b2[_0xb23d('0x19')](_0x5baf53);return _0x2f18b2[_0xb23d('0x1f')](_0xb23d('0x20'),_0x37bfe2+'-'+_0x2b47e0+'/'+_0x21f5a)[_0xb23d('0x1a')](_0x5a8364);}return null;};}function patchUpdates(_0x3cb3ee){return function(_0x45d7b5){try{jsonpatch[_0xb23d('0x21')](_0x45d7b5,_0x3cb3ee,!![]);}catch(_0x4b7fea){return BPromise[_0xb23d('0x22')](_0x4b7fea);}return _0x45d7b5['save']();};}function saveUpdates(_0x5e8ff8,_0x20329a){return function(_0x29cacf){if(_0x29cacf){return _0x29cacf[_0xb23d('0x23')](_0x5e8ff8)[_0xb23d('0x24')](function(_0x9348e1){return _0x9348e1;});}return null;};}function removeEntity(_0x117f4c,_0x921fc){return function(_0x219d34){if(_0x219d34){return _0x219d34[_0xb23d('0x25')]()[_0xb23d('0x24')](function(){_0x117f4c[_0xb23d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f0731,_0x145ae9){return function(_0x243416){if(!_0x243416){_0x1f0731['sendStatus'](0x194);}return _0x243416;};}function handleError(_0x4919dc,_0x21a571){_0x21a571=_0x21a571||0x1f4;return function(_0x2e758e){logger[_0xb23d('0x26')](_0x2e758e[_0xb23d('0x27')]);if(_0x2e758e['name']){delete _0x2e758e[_0xb23d('0x28')];}_0x4919dc[_0xb23d('0x19')](_0x21a571)[_0xb23d('0x29')](_0x2e758e);};}exports[_0xb23d('0x2a')]=function(_0x1a892c,_0x67eaf3){var _0x26990e={},_0x867d69={},_0x2f039f={'count':0x0,'rows':[]};var _0x349ba6=_[_0xb23d('0x2b')](db[_0xb23d('0x2c')][_0xb23d('0x2d')],function(_0x512474){return{'name':_0x512474['fieldName'],'type':_0x512474['type'][_0xb23d('0x2e')]};});_0x867d69['model']=_['map'](_0x349ba6,_0xb23d('0x28'));_0x867d69['query']=_[_0xb23d('0x2f')](_0x1a892c[_0xb23d('0x30')]);_0x867d69[_0xb23d('0x31')]=_[_0xb23d('0x32')](_0x867d69[_0xb23d('0x33')],_0x867d69[_0xb23d('0x30')]);_0x26990e[_0xb23d('0x34')]=_[_0xb23d('0x32')](_0x867d69[_0xb23d('0x33')],qs[_0xb23d('0x35')](_0x1a892c[_0xb23d('0x30')][_0xb23d('0x35')]));_0x26990e[_0xb23d('0x34')]=_0x26990e[_0xb23d('0x34')][_0xb23d('0x36')]?_0x26990e[_0xb23d('0x34')]:_0x867d69['model'];if(!_0x1a892c[_0xb23d('0x30')][_0xb23d('0x37')](_0xb23d('0x38'))){_0x26990e[_0xb23d('0x1d')]=qs[_0xb23d('0x1d')](_0x1a892c[_0xb23d('0x30')][_0xb23d('0x1d')]);_0x26990e[_0xb23d('0x1b')]=qs['offset'](_0x1a892c[_0xb23d('0x30')][_0xb23d('0x1b')]);}_0x26990e[_0xb23d('0x39')]=qs[_0xb23d('0x3a')](_0x1a892c[_0xb23d('0x30')][_0xb23d('0x3a')]);_0x26990e[_0xb23d('0x3b')]=qs[_0xb23d('0x31')](_[_0xb23d('0x3c')](_0x1a892c[_0xb23d('0x30')],_0x867d69[_0xb23d('0x31')]),_0x349ba6);if(_0x1a892c[_0xb23d('0x30')]['filter']){_0x26990e[_0xb23d('0x3b')]=_[_0xb23d('0x3d')](_0x26990e[_0xb23d('0x3b')],{'$or':_['map'](_0x349ba6,function(_0x100282){if(_0x100282[_0xb23d('0x3e')]!==_0xb23d('0x3f')){var _0x1ed4c5={};_0x1ed4c5[_0x100282[_0xb23d('0x28')]]={'$like':'%'+_0x1a892c[_0xb23d('0x30')][_0xb23d('0x40')]+'%'};return _0x1ed4c5;}})});}_0x26990e=_[_0xb23d('0x3d')]({},_0x26990e,_0x1a892c[_0xb23d('0x41')]);var _0x5c653c={'where':_0x26990e[_0xb23d('0x3b')]};return db[_0xb23d('0x2c')][_0xb23d('0x1e')](_0x5c653c)[_0xb23d('0x24')](function(_0x4f74e8){_0x2f039f[_0xb23d('0x1e')]=_0x4f74e8;if(_0x1a892c['query']['includeAll']){_0x26990e[_0xb23d('0x42')]=[{'all':!![]}];}return db['WhatsappTransferReport'][_0xb23d('0x43')](_0x26990e);})[_0xb23d('0x24')](function(_0x254267){_0x2f039f[_0xb23d('0x44')]=_0x254267;return _0x2f039f;})['then'](respondWithFilteredResult(_0x67eaf3,_0x26990e))[_0xb23d('0x45')](handleError(_0x67eaf3,null));};exports['show']=function(_0x1811f6,_0x5f0812){var _0x1ab20b={'raw':!![],'where':{'id':_0x1811f6['params']['id']}},_0x53030d={};_0x53030d['model']=_['keys'](db[_0xb23d('0x2c')][_0xb23d('0x2d')]);_0x53030d['query']=_[_0xb23d('0x2f')](_0x1811f6[_0xb23d('0x30')]);_0x53030d[_0xb23d('0x31')]=_[_0xb23d('0x32')](_0x53030d['model'],_0x53030d['query']);_0x1ab20b[_0xb23d('0x34')]=_[_0xb23d('0x32')](_0x53030d[_0xb23d('0x33')],qs[_0xb23d('0x35')](_0x1811f6['query'][_0xb23d('0x35')]));_0x1ab20b[_0xb23d('0x34')]=_0x1ab20b[_0xb23d('0x34')][_0xb23d('0x36')]?_0x1ab20b['attributes']:_0x53030d[_0xb23d('0x33')];if(_0x1811f6['query'][_0xb23d('0x46')]){_0x1ab20b[_0xb23d('0x42')]=[{'all':!![]}];}_0x1ab20b=_[_0xb23d('0x3d')]({},_0x1ab20b,_0x1811f6['options']);return db[_0xb23d('0x2c')]['find'](_0x1ab20b)[_0xb23d('0x24')](handleEntityNotFound(_0x5f0812,null))['then'](respondWithResult(_0x5f0812,null))[_0xb23d('0x45')](handleError(_0x5f0812,null));};exports[_0xb23d('0x47')]=function(_0x37bd7c,_0x35dd16){return db[_0xb23d('0x2c')][_0xb23d('0x47')](_0x37bd7c[_0xb23d('0x48')],{})[_0xb23d('0x24')](respondWithResult(_0x35dd16,0xc9))[_0xb23d('0x45')](handleError(_0x35dd16,null));};exports['update']=function(_0x1911ab,_0x22e818){if(_0x1911ab['body']['id']){delete _0x1911ab[_0xb23d('0x48')]['id'];}return db['WhatsappTransferReport'][_0xb23d('0x49')]({'where':{'id':_0x1911ab[_0xb23d('0x4a')]['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x22e818,null))['then'](saveUpdates(_0x1911ab[_0xb23d('0x48')],null))[_0xb23d('0x24')](respondWithResult(_0x22e818,null))['catch'](handleError(_0x22e818,null));};exports[_0xb23d('0x25')]=function(_0x9585ec,_0x268d90){return db[_0xb23d('0x2c')][_0xb23d('0x49')]({'where':{'id':_0x9585ec[_0xb23d('0x4a')]['id']}})[_0xb23d('0x24')](handleEntityNotFound(_0x268d90,null))[_0xb23d('0x24')](removeEntity(_0x268d90,null))['catch'](handleError(_0x268d90,null));};exports['describe']=function(_0x2b21ee,_0x4ba49c){return db[_0xb23d('0x2c')][_0xb23d('0x4b')]()[_0xb23d('0x24')](respondWithResult(_0x4ba49c,null))['catch'](handleError(_0x4ba49c,null));}; \ No newline at end of file +var _0xab0d=['offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','stack','name','send','rawAttributes','fieldName','type','model','map','query','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','options','WhatsappTransferReport','includeAll','findAll','rows','catch','show','params','keys','fields','merge','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0xab0d,0xc6));var _0xdab0=function(_0x134703,_0x4fff48){_0x134703=_0x134703-0x0;var _0x2d92ac=_0xab0d[_0x134703];return _0x2d92ac;};'use strict';var emlformat=require(_0xdab0('0x0'));var rimraf=require(_0xdab0('0x1'));var zipdir=require(_0xdab0('0x2'));var jsonpatch=require(_0xdab0('0x3'));var rp=require(_0xdab0('0x4'));var moment=require(_0xdab0('0x5'));var BPromise=require(_0xdab0('0x6'));var Mustache=require('mustache');var util=require(_0xdab0('0x7'));var path=require(_0xdab0('0x8'));var sox=require(_0xdab0('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xdab0('0xa'));var squel=require(_0xdab0('0xb'));var crypto=require('crypto');var jsforce=require(_0xdab0('0xc'));var deskjs=require(_0xdab0('0xd'));var toCsv=require(_0xdab0('0xe'));var querystring=require(_0xdab0('0xf'));var Papa=require(_0xdab0('0x10'));var Redis=require(_0xdab0('0x11'));var authService=require(_0xdab0('0x12'));var qs=require(_0xdab0('0x13'));var as=require(_0xdab0('0x14'));var hardwareService=require(_0xdab0('0x15'));var logger=require('../../config/logger')(_0xdab0('0x16'));var utils=require(_0xdab0('0x17'));var config=require(_0xdab0('0x18'));var licenseUtil=require(_0xdab0('0x19'));var db=require(_0xdab0('0x1a'))['db'];function respondWithStatusCode(_0x164730,_0x3acc82){_0x3acc82=_0x3acc82||0xcc;return function(_0x2a2f9b){if(_0x2a2f9b){return _0x164730['sendStatus'](_0x3acc82);}return _0x164730[_0xdab0('0x1b')](_0x3acc82)[_0xdab0('0x1c')]();};}function respondWithResult(_0x376ff4,_0x104e56){_0x104e56=_0x104e56||0xc8;return function(_0x27b7f8){if(_0x27b7f8){return _0x376ff4[_0xdab0('0x1b')](_0x104e56)[_0xdab0('0x1d')](_0x27b7f8);}};}function respondWithFilteredResult(_0x1f524c,_0x468e88){return function(_0x4edbb4){if(_0x4edbb4){var _0x528884=typeof _0x468e88[_0xdab0('0x1e')]===_0xdab0('0x1f')&&typeof _0x468e88[_0xdab0('0x20')]===_0xdab0('0x1f');var _0x5671b1=_0x4edbb4[_0xdab0('0x21')];var _0xebed30=_0x528884?0x0:_0x468e88[_0xdab0('0x1e')];var _0x350bd4=_0x528884?_0x4edbb4[_0xdab0('0x21')]:_0x468e88[_0xdab0('0x1e')]+_0x468e88['limit'];var _0x53a4de;if(_0x350bd4>=_0x5671b1){_0x350bd4=_0x5671b1;_0x53a4de=0xc8;}else{_0x53a4de=0xce;}_0x1f524c[_0xdab0('0x1b')](_0x53a4de);return _0x1f524c['set'](_0xdab0('0x22'),_0xebed30+'-'+_0x350bd4+'/'+_0x5671b1)['json'](_0x4edbb4);}return null;};}function patchUpdates(_0x41f91a){return function(_0x4c44ea){try{jsonpatch[_0xdab0('0x23')](_0x4c44ea,_0x41f91a,!![]);}catch(_0x4220bd){return BPromise[_0xdab0('0x24')](_0x4220bd);}return _0x4c44ea[_0xdab0('0x25')]();};}function saveUpdates(_0x38a9b2,_0x180ff6){return function(_0x5e756b){if(_0x5e756b){return _0x5e756b[_0xdab0('0x26')](_0x38a9b2)['then'](function(_0x3c3e9d){return _0x3c3e9d;});}return null;};}function removeEntity(_0x38ffb7,_0x4c9266){return function(_0x52dd5b){if(_0x52dd5b){return _0x52dd5b['destroy']()[_0xdab0('0x27')](function(){_0x38ffb7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a2e7e,_0x441ddf){return function(_0x3385df){if(!_0x3385df){_0x3a2e7e['sendStatus'](0x194);}return _0x3385df;};}function handleError(_0x5b67de,_0x5d37d2){_0x5d37d2=_0x5d37d2||0x1f4;return function(_0x113e4c){logger['error'](_0x113e4c[_0xdab0('0x28')]);if(_0x113e4c[_0xdab0('0x29')]){delete _0x113e4c[_0xdab0('0x29')];}_0x5b67de[_0xdab0('0x1b')](_0x5d37d2)[_0xdab0('0x2a')](_0x113e4c);};}exports['index']=function(_0x1a1a32,_0x4cb377){var _0x3b14ea={},_0x7f0038={},_0x2de0f1={'count':0x0,'rows':[]};var _0x3faf82=_['map'](db['WhatsappTransferReport'][_0xdab0('0x2b')],function(_0x20babf){return{'name':_0x20babf[_0xdab0('0x2c')],'type':_0x20babf[_0xdab0('0x2d')]['key']};});_0x7f0038[_0xdab0('0x2e')]=_[_0xdab0('0x2f')](_0x3faf82,_0xdab0('0x29'));_0x7f0038[_0xdab0('0x30')]=_['keys'](_0x1a1a32['query']);_0x7f0038['filters']=_[_0xdab0('0x31')](_0x7f0038[_0xdab0('0x2e')],_0x7f0038[_0xdab0('0x30')]);_0x3b14ea[_0xdab0('0x32')]=_[_0xdab0('0x31')](_0x7f0038['model'],qs['fields'](_0x1a1a32[_0xdab0('0x30')]['fields']));_0x3b14ea[_0xdab0('0x32')]=_0x3b14ea[_0xdab0('0x32')][_0xdab0('0x33')]?_0x3b14ea[_0xdab0('0x32')]:_0x7f0038[_0xdab0('0x2e')];if(!_0x1a1a32['query']['hasOwnProperty'](_0xdab0('0x34'))){_0x3b14ea['limit']=qs[_0xdab0('0x20')](_0x1a1a32[_0xdab0('0x30')][_0xdab0('0x20')]);_0x3b14ea[_0xdab0('0x1e')]=qs[_0xdab0('0x1e')](_0x1a1a32[_0xdab0('0x30')]['offset']);}_0x3b14ea[_0xdab0('0x35')]=qs[_0xdab0('0x36')](_0x1a1a32[_0xdab0('0x30')]['sort']);_0x3b14ea['where']=qs[_0xdab0('0x37')](_[_0xdab0('0x38')](_0x1a1a32[_0xdab0('0x30')],_0x7f0038[_0xdab0('0x37')]),_0x3faf82);if(_0x1a1a32[_0xdab0('0x30')][_0xdab0('0x39')]){_0x3b14ea[_0xdab0('0x3a')]=_['merge'](_0x3b14ea[_0xdab0('0x3a')],{'$or':_[_0xdab0('0x2f')](_0x3faf82,function(_0x5681d8){if(_0x5681d8[_0xdab0('0x2d')]!==_0xdab0('0x3b')){var _0x5d39a4={};_0x5d39a4[_0x5681d8[_0xdab0('0x29')]]={'$like':'%'+_0x1a1a32[_0xdab0('0x30')][_0xdab0('0x39')]+'%'};return _0x5d39a4;}})});}_0x3b14ea=_['merge']({},_0x3b14ea,_0x1a1a32[_0xdab0('0x3c')]);var _0x443106={'where':_0x3b14ea['where']};return db[_0xdab0('0x3d')][_0xdab0('0x21')](_0x443106)[_0xdab0('0x27')](function(_0x5b2eb9){_0x2de0f1[_0xdab0('0x21')]=_0x5b2eb9;if(_0x1a1a32[_0xdab0('0x30')][_0xdab0('0x3e')]){_0x3b14ea['include']=[{'all':!![]}];}return db[_0xdab0('0x3d')][_0xdab0('0x3f')](_0x3b14ea);})['then'](function(_0xc00dee){_0x2de0f1[_0xdab0('0x40')]=_0xc00dee;return _0x2de0f1;})[_0xdab0('0x27')](respondWithFilteredResult(_0x4cb377,_0x3b14ea))[_0xdab0('0x41')](handleError(_0x4cb377,null));};exports[_0xdab0('0x42')]=function(_0x38b4c4,_0x4b9382){var _0x2b3974={'raw':!![],'where':{'id':_0x38b4c4[_0xdab0('0x43')]['id']}},_0x1fd11c={};_0x1fd11c['model']=_[_0xdab0('0x44')](db['WhatsappTransferReport'][_0xdab0('0x2b')]);_0x1fd11c[_0xdab0('0x30')]=_[_0xdab0('0x44')](_0x38b4c4[_0xdab0('0x30')]);_0x1fd11c[_0xdab0('0x37')]=_[_0xdab0('0x31')](_0x1fd11c['model'],_0x1fd11c['query']);_0x2b3974[_0xdab0('0x32')]=_[_0xdab0('0x31')](_0x1fd11c[_0xdab0('0x2e')],qs['fields'](_0x38b4c4[_0xdab0('0x30')][_0xdab0('0x45')]));_0x2b3974[_0xdab0('0x32')]=_0x2b3974[_0xdab0('0x32')][_0xdab0('0x33')]?_0x2b3974['attributes']:_0x1fd11c[_0xdab0('0x2e')];if(_0x38b4c4[_0xdab0('0x30')]['includeAll']){_0x2b3974['include']=[{'all':!![]}];}_0x2b3974=_[_0xdab0('0x46')]({},_0x2b3974,_0x38b4c4[_0xdab0('0x3c')]);return db['WhatsappTransferReport'][_0xdab0('0x47')](_0x2b3974)['then'](handleEntityNotFound(_0x4b9382,null))[_0xdab0('0x27')](respondWithResult(_0x4b9382,null))[_0xdab0('0x41')](handleError(_0x4b9382,null));};exports['create']=function(_0x512b02,_0x7b0367){return db['WhatsappTransferReport'][_0xdab0('0x48')](_0x512b02['body'],{})[_0xdab0('0x27')](respondWithResult(_0x7b0367,0xc9))['catch'](handleError(_0x7b0367,null));};exports['update']=function(_0x325d9b,_0x404b05){if(_0x325d9b[_0xdab0('0x49')]['id']){delete _0x325d9b[_0xdab0('0x49')]['id'];}return db[_0xdab0('0x3d')]['find']({'where':{'id':_0x325d9b[_0xdab0('0x43')]['id']}})[_0xdab0('0x27')](handleEntityNotFound(_0x404b05,null))['then'](saveUpdates(_0x325d9b[_0xdab0('0x49')],null))[_0xdab0('0x27')](respondWithResult(_0x404b05,null))['catch'](handleError(_0x404b05,null));};exports[_0xdab0('0x4a')]=function(_0x170e50,_0xff482d){return db[_0xdab0('0x3d')][_0xdab0('0x47')]({'where':{'id':_0x170e50[_0xdab0('0x43')]['id']}})['then'](handleEntityNotFound(_0xff482d,null))[_0xdab0('0x27')](removeEntity(_0xff482d,null))[_0xdab0('0x41')](handleError(_0xff482d,null));};exports['describe']=function(_0x43d811,_0x225db5){return db[_0xdab0('0x3d')][_0xdab0('0x4b')]()[_0xdab0('0x27')](respondWithResult(_0x225db5,null))[_0xdab0('0x41')](handleError(_0x225db5,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 177987b..3e4153f 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 _0xc4c2=['report_whatsapp_transfer','uniqueid','../../config/logger','path','../../config/environment','exports','define','WhatsappTransferReport'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0xc4c2,0x6a));var _0x2c4c=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0xc4c2[_0x9cd4c3];return _0x4c9025;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c4c('0x0'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c4c('0x1'));var rimraf=require('rimraf');var config=require(_0x2c4c('0x2'));var attributes=require('./whatsappTransferReport.attributes');module[_0x2c4c('0x3')]=function(_0x3378c4,_0x46311b){return _0x3378c4[_0x2c4c('0x4')](_0x2c4c('0x5'),attributes,{'tableName':_0x2c4c('0x6'),'paranoid':![],'indexes':[{'name':_0x2c4c('0x7'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7975=['lodash','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappTransferReport.attributes','define','WhatsappTransferReport','uniqueid'];(function(_0x16790d,_0x34f169){var _0x3a3387=function(_0x2e9f6e){while(--_0x2e9f6e){_0x16790d['push'](_0x16790d['shift']());}};_0x3a3387(++_0x34f169);}(_0x7975,0x78));var _0x5797=function(_0x111cf3,_0x47c8d6){_0x111cf3=_0x111cf3-0x0;var _0x326302=_0x7975[_0x111cf3];return _0x326302;};'use strict';var _=require(_0x5797('0x0'));var util=require(_0x5797('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5797('0x2'));var BPromise=require(_0x5797('0x3'));var rp=require(_0x5797('0x4'));var fs=require('fs');var path=require(_0x5797('0x5'));var rimraf=require(_0x5797('0x6'));var config=require(_0x5797('0x7'));var attributes=require(_0x5797('0x8'));module['exports']=function(_0x19d763,_0x1a8bcc){return _0x19d763[_0x5797('0x9')](_0x5797('0xa'),attributes,{'tableName':'report_whatsapp_transfer','paranoid':![],'indexes':[{'name':_0x5797('0xb'),'fields':[_0x5797('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index 8ec8881..d5748a0 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 _0x6c78=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util'];(function(_0x3bbd21,_0x23f22d){var _0x11908b=function(_0x337f92){while(--_0x337f92){_0x3bbd21['push'](_0x3bbd21['shift']());}};_0x11908b(++_0x23f22d);}(_0x6c78,0x116));var _0x86c7=function(_0xd0e3fa,_0x24bbf6){_0xd0e3fa=_0xd0e3fa-0x0;var _0x4b3f51=_0x6c78[_0xd0e3fa];return _0x4b3f51;};'use strict';var _=require(_0x86c7('0x0'));var util=require(_0x86c7('0x1'));var moment=require(_0x86c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x86c7('0x3'));var fs=require('fs');var Redis=require(_0x86c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x86c7('0x5'));var logger=require(_0x86c7('0x6'))(_0x86c7('0x7'));var config=require(_0x86c7('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x86c7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d1b11,_0x5cca54,_0x29986a){return new BPromise(function(_0x23d977,_0x3f3c7f){return client['request'](_0x1d1b11,_0x29986a)[_0x86c7('0xa')](function(_0x465208){logger[_0x86c7('0xb')](_0x86c7('0xc'),_0x5cca54,_0x86c7('0xd'));logger[_0x86c7('0xe')](_0x86c7('0xf'),_0x5cca54,'request\x20sent',JSON['stringify'](_0x465208));if(_0x465208[_0x86c7('0x10')]){if(_0x465208[_0x86c7('0x10')][_0x86c7('0x11')]===0x1f4){logger[_0x86c7('0x10')](_0x86c7('0xc'),_0x5cca54,_0x465208[_0x86c7('0x10')][_0x86c7('0x12')]);return _0x3f3c7f(_0x465208[_0x86c7('0x10')][_0x86c7('0x12')]);}logger['error']('WhatsappTransferReport,\x20%s,\x20%s',_0x5cca54,_0x465208['error'][_0x86c7('0x12')]);return _0x23d977(_0x465208[_0x86c7('0x10')]['message']);}else{logger[_0x86c7('0xb')](_0x86c7('0xc'),_0x5cca54,_0x86c7('0xd'));_0x23d977(_0x465208[_0x86c7('0x13')][_0x86c7('0x12')]);}})['catch'](function(_0x16621f){logger[_0x86c7('0x10')](_0x86c7('0xc'),_0x5cca54,_0x16621f);_0x3f3c7f(_0x16621f);});});} \ No newline at end of file +var _0x1ff1=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','WhatsappTransferReport,\x20%s,\x20%s','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','util'];(function(_0xc5a73b,_0x2174d8){var _0x59b78c=function(_0x15d926){while(--_0x15d926){_0xc5a73b['push'](_0xc5a73b['shift']());}};_0x59b78c(++_0x2174d8);}(_0x1ff1,0x1e2));var _0x11ff=function(_0x16a223,_0xd72af7){_0x16a223=_0x16a223-0x0;var _0x10a100=_0x1ff1[_0x16a223];return _0x10a100;};'use strict';var _=require(_0x11ff('0x0'));var util=require(_0x11ff('0x1'));var moment=require(_0x11ff('0x2'));var BPromise=require(_0x11ff('0x3'));var rs=require(_0x11ff('0x4'));var fs=require('fs');var Redis=require(_0x11ff('0x5'));var db=require(_0x11ff('0x6'))['db'];var utils=require(_0x11ff('0x7'));var logger=require(_0x11ff('0x8'))(_0x11ff('0x9'));var config=require(_0x11ff('0xa'));var jayson=require(_0x11ff('0xb'));var client=jayson['client'][_0x11ff('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2a7553,_0x52412d,_0xa0bfd6){return new BPromise(function(_0x4f0bad,_0x3f9a4c){return client['request'](_0x2a7553,_0xa0bfd6)[_0x11ff('0xd')](function(_0x50eb88){logger[_0x11ff('0xe')](_0x11ff('0xf'),_0x52412d,'request\x20sent');logger['debug'](_0x11ff('0x10'),_0x52412d,_0x11ff('0x11'),JSON['stringify'](_0x50eb88));if(_0x50eb88[_0x11ff('0x12')]){if(_0x50eb88[_0x11ff('0x12')][_0x11ff('0x13')]===0x1f4){logger[_0x11ff('0x12')]('WhatsappTransferReport,\x20%s,\x20%s',_0x52412d,_0x50eb88[_0x11ff('0x12')][_0x11ff('0x14')]);return _0x3f9a4c(_0x50eb88[_0x11ff('0x12')][_0x11ff('0x14')]);}logger[_0x11ff('0x12')](_0x11ff('0xf'),_0x52412d,_0x50eb88[_0x11ff('0x12')][_0x11ff('0x14')]);return _0x4f0bad(_0x50eb88[_0x11ff('0x12')][_0x11ff('0x14')]);}else{logger['info'](_0x11ff('0xf'),_0x52412d,'request\x20sent');_0x4f0bad(_0x50eb88['result'][_0x11ff('0x14')]);}})[_0x11ff('0x15')](function(_0x4ccf29){logger['error'](_0x11ff('0xf'),_0x52412d,_0x4ccf29);_0x3f9a4c(_0x4ccf29);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 25a8b55..8e94004 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa83c=['./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','listen','info','start','Online\x20apps:','online','name','Offline\x20apps:','map','filter','status','join','seedDB','./config/seedDB','./config/license','default','error','exit','lodash','./mysqldb','./config/environment','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp'];(function(_0x5380f8,_0x29e027){var _0x1be506=function(_0x2cd7a5){while(--_0x2cd7a5){_0x5380f8['push'](_0x5380f8['shift']());}};_0x1be506(++_0x29e027);}(_0xa83c,0x137));var _0xca83=function(_0x403fc7,_0x32931a){_0x403fc7=_0x403fc7-0x0;var _0x5d0827=_0xa83c[_0x403fc7];return _0x5d0827;};'use strict';var _=require(_0xca83('0x0'));var mysqldb=require(_0xca83('0x1'));var rpc=require('./rpc');var config=require(_0xca83('0x2'));var logger=require('./config/logger')(_0xca83('0x3'));var pm2=require(_0xca83('0x4'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xca83('0x5'));var chat=require(_0xca83('0x6'));var whatsapp=require(_0xca83('0x7'));var transcribe=require(_0xca83('0x8'));var provider=require(_0xca83('0x9'));function main(){return mysqldb['db']['sequelize'][_0xca83('0xa')]()[_0xca83('0xb')](function(){return rpc[_0xca83('0xc')]();})['then'](function(_0x49b25e){logger[_0xca83('0xd')](_0x49b25e);return chat[_0xca83('0xe')]();})['then'](function(){return whatsapp[_0xca83('0xe')]();})[_0xca83('0xb')](function(){return schedule[_0xca83('0xe')]();})['then'](function(){return transcribe[_0xca83('0xe')]();})[_0xca83('0xb')](function(){return provider['start']();})[_0xca83('0xb')](function(_0x2a1801){logger['info'](_0x2a1801);return pm2[_0xca83('0xe')](pm2Config);})[_0xca83('0xb')](function(_0x5c951f){logger[_0xca83('0xd')](_0xca83('0xf'),_['map'](_['filter'](_0x5c951f,{'status':_0xca83('0x10')}),_0xca83('0x11'))['join']());logger['info'](_0xca83('0x12'),_[_0xca83('0x13')](_[_0xca83('0x14')](_0x5c951f,function(_0x54f6b4){return _0x54f6b4[_0xca83('0x15')]!==_0xca83('0x10');}),'name')[_0xca83('0x16')]()||'None');config[_0xca83('0x17')]&&require(_0xca83('0x18'))['default']();require(_0xca83('0x19'))[_0xca83('0x1a')]();})['catch'](function(_0x2c0a20){logger[_0xca83('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2c0a20);process[_0xca83('0x1c')](0x1);});}main(); \ No newline at end of file +var _0x19df=['name','join','Offline\x20apps:','filter','status','None','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','info','start','Online\x20apps:','map','online'];(function(_0x223773,_0x3b91a4){var _0x1152ed=function(_0x476d91){while(--_0x476d91){_0x223773['push'](_0x223773['shift']());}};_0x1152ed(++_0x3b91a4);}(_0x19df,0xfc));var _0xf19d=function(_0x6a0266,_0x1552d6){_0x6a0266=_0x6a0266-0x0;var _0x309e00=_0x19df[_0x6a0266];return _0x309e00;};'use strict';var _=require('lodash');var mysqldb=require(_0xf19d('0x0'));var rpc=require(_0xf19d('0x1'));var config=require(_0xf19d('0x2'));var logger=require(_0xf19d('0x3'))(_0xf19d('0x4'));var pm2=require(_0xf19d('0x5'));var pm2Config=require(_0xf19d('0x6'));var schedule=require('./config/schedule');var chat=require(_0xf19d('0x7'));var whatsapp=require(_0xf19d('0x8'));var transcribe=require(_0xf19d('0x9'));var provider=require('./config/schedule/cloud-provider');function main(){return mysqldb['db'][_0xf19d('0xa')][_0xf19d('0xb')]()[_0xf19d('0xc')](function(){return rpc['listen']();})[_0xf19d('0xc')](function(_0x2952a4){logger[_0xf19d('0xd')](_0x2952a4);return chat[_0xf19d('0xe')]();})[_0xf19d('0xc')](function(){return whatsapp[_0xf19d('0xe')]();})[_0xf19d('0xc')](function(){return schedule[_0xf19d('0xe')]();})['then'](function(){return transcribe[_0xf19d('0xe')]();})[_0xf19d('0xc')](function(){return provider['start']();})[_0xf19d('0xc')](function(_0x105c42){logger['info'](_0x105c42);return pm2[_0xf19d('0xe')](pm2Config);})['then'](function(_0x37567a){logger[_0xf19d('0xd')](_0xf19d('0xf'),_[_0xf19d('0x10')](_['filter'](_0x37567a,{'status':_0xf19d('0x11')}),_0xf19d('0x12'))[_0xf19d('0x13')]());logger[_0xf19d('0xd')](_0xf19d('0x14'),_[_0xf19d('0x10')](_[_0xf19d('0x15')](_0x37567a,function(_0x4a7c75){return _0x4a7c75[_0xf19d('0x16')]!=='online';}),_0xf19d('0x12'))[_0xf19d('0x13')]()||_0xf19d('0x17'));config['seedDB']&&require(_0xf19d('0x18'))[_0xf19d('0x19')]();require(_0xf19d('0x1a'))['default']();})[_0xf19d('0x1b')](function(_0xbd5957){logger['error'](_0xf19d('0x1c'),_0xbd5957);process[_0xf19d('0x1d')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 1506cd2..38824c9 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 _0x561c=['session','role','email','userpic','permissions','md5secret','voicePause','chatPause','mailPause','smsPause','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','settingsEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','isAuthenticated','use','findOne','params','closed','disposition','unmanaged','Unmanaged.','catch','headers','authorization','startsWith','User','find','authenticate','status','json','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','then','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blockedAt','add','blockDuration','minutes','getLicense','update','Forbidden','isWebrtcLicence','webrtc','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','test','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','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','ValidationError','length','splice','unshift','encryptString','sign','secret','payload','options','promisify','verify','hex','toString','HS512','../../mysqldb','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','util','moment','secrets'];(function(_0x4a9248,_0x19f1fe){var _0x3445d4=function(_0x3faf49){while(--_0x3faf49){_0x4a9248['push'](_0x4a9248['shift']());}};_0x3445d4(++_0x19f1fe);}(_0x561c,0xf0));var _0xc561=function(_0x3b510c,_0xabe056){_0x3b510c=_0x3b510c-0x0;var _0x2e185c=_0x561c[_0x3b510c];return _0x2e185c;};'use strict';var db=require(_0xc561('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0xc561('0x1'));var licenseUtil=require(_0xc561('0x2'));var encryptor=require(_0xc561('0x3'));var _=require(_0xc561('0x4'));var jwt=require(_0xc561('0x5'));var expressJwt=require(_0xc561('0x6'));var compose=require('composable-middleware');var basicAuth=require(_0xc561('0x7'));var crypto=require(_0xc561('0x8'));var BPromise=require('bluebird');var util=require(_0xc561('0x9'));var moment=require(_0xc561('0xa'));var validateJwt=expressJwt({'secret':config[_0xc561('0xb')][_0xc561('0xc')]});var userAttributes=['id',_0xc561('0xd'),'fullname','name','internal',_0xc561('0xe'),_0xc561('0xf'),_0xc561('0x10'),_0xc561('0x11'),_0xc561('0x12'),_0xc561('0x13'),_0xc561('0x14'),'faxPause',_0xc561('0x15'),'openchannelPause','pauseType',_0xc561('0x16'),_0xc561('0x17'),_0xc561('0x18'),_0xc561('0x19'),_0xc561('0x1a'),'passwordResetAt',_0xc561('0x1b'),_0xc561('0x1c'),_0xc561('0x1d'),_0xc561('0x1e'),'phoneBarEnableRecording',_0xc561('0x1f'),_0xc561('0x20'),_0xc561('0x21'),_0xc561('0x22'),'phoneBarRemoteControl',_0xc561('0x23'),_0xc561('0x24'),_0xc561('0x25'),_0xc561('0x26'),_0xc561('0x27'),_0xc561('0x28'),_0xc561('0x29'),_0xc561('0x2a'),_0xc561('0x2b'),_0xc561('0x2c'),_0xc561('0x2d'),_0xc561('0x2e')];exports[_0xc561('0x2f')]=function(){return this[_0xc561('0x30')](!![])[_0xc561('0x31')](function(_0x1ba454,_0x1439bc,_0x53c885){if(_0x1ba454['user']){_0x53c885();}else{return db['ChatInteraction'][_0xc561('0x32')]({'where':{'id':_0x1ba454[_0xc561('0x33')]['id']},'attributes':['id',_0xc561('0x34'),'disposition'],'raw':!![]})['then'](function(_0x534b28){if(_0x534b28&&_0x534b28[_0xc561('0x34')]){return _0x1439bc['status'](_0x534b28[_0xc561('0x35')]===_0xc561('0x36')?0x195:0x193)['json']({'message':_0x534b28[_0xc561('0x35')]===_0xc561('0x36')?_0xc561('0x37'):'Forbidden.'});}else{_0x53c885();}})[_0xc561('0x38')](function(_0x27b8ba){_0x53c885(_0x27b8ba);});}});};exports['isAuthenticated']=function isAuthenticated(_0x56d934){return compose()[_0xc561('0x31')](function(_0x5d1f8a,_0x4a4a69,_0x36c040){var _0x655b25;if(_0x5d1f8a[_0xc561('0x39')][_0xc561('0x3a')]){if(_[_0xc561('0x3b')](_0x5d1f8a[_0xc561('0x39')][_0xc561('0x3a')],'Basic')){var _0x20fa04=basicAuth(_0x5d1f8a);db[_0xc561('0x3c')][_0xc561('0x3d')]({'where':{'name':_0x20fa04['name']}})['then'](function(_0x55ea26){if(!_0x55ea26||!_0x55ea26[_0xc561('0x3e')](_0x20fa04['pass'])){return _0x4a4a69[_0xc561('0x3f')](0x191)[_0xc561('0x40')]({'message':_0xc561('0x41')});}_0x5d1f8a[_0xc561('0x42')]={'id':_0x55ea26['id']};_0x36c040();})['catch'](function(_0x5d7a21){_0x36c040(_0x5d7a21);});}else if(_[_0xc561('0x3b')](_0x5d1f8a[_0xc561('0x39')]['authorization'],_0xc561('0x43'))){validateJwt(_0x5d1f8a,_0x4a4a69,_0x36c040);}else{if(_0x56d934){_0x36c040();}else{return _0x4a4a69[_0xc561('0x3f')](0x193)['json']({'message':_0xc561('0x44')});}}}else if(_0x5d1f8a[_0xc561('0x45')][_0xc561('0x46')]){try{var _0x3a9042={'audience':hardwareConf[_0xc561('0x47')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x5d1f8a[_0xc561('0x45')][_0xc561('0x46')],_0x3a9042)[_0xc561('0x48')](function(_0x3fe1e2){return db[_0xc561('0x3c')][_0xc561('0x3d')]({'where':{'id':_0x3fe1e2['sub']}})['then'](function(_0x266aae){_0x655b25=_0x266aae;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xc561('0x49'),'blockDuration'],'raw':!![]});})['then'](function(_0x3b1211){if(!_0x655b25||!_[_0xc561('0x4a')](_0x655b25[_0xc561('0x4b')],_0x3fe1e2[_0xc561('0x4c')])){return _0x4a4a69['status'](0x191)[_0xc561('0x40')]({'message':_0xc561('0x4d')});}if(_0x655b25[_0xc561('0x4e')]){return _0x4a4a69[_0xc561('0x3f')](0x191)['json']({'message':_0xc561('0x4f')});}if(_0x655b25['blocked']){if(_0x3b1211['blockDuration']>0x0){if(moment(_0x655b25[_0xc561('0x50')])[_0xc561('0x51')](_0x3b1211[_0xc561('0x52')],_0xc561('0x53'))>moment()){return _0x4a4a69[_0xc561('0x3f')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}}else{return _0x4a4a69['status'](0x191)[_0xc561('0x40')]({'message':_0xc561('0x4f')});}}_0x5d1f8a[_0xc561('0x42')]={'id':_0x655b25['id']};_0x36c040();});})[_0xc561('0x38')](function(){return _0x4a4a69['status'](0x191)[_0xc561('0x40')]({'message':_0xc561('0x4f')});});}catch(_0x37c8c3){_0x36c040(_0x37c8c3);}}else if(_0x56d934){_0x36c040();}else{return _0x4a4a69[_0xc561('0x3f')](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0xc561('0x31')](function(_0x1e1136,_0x156bc1,_0x2af25a){if(_0x1e1136[_0xc561('0x42')]){db['User'][_0xc561('0x3d')]({'where':{'id':_0x1e1136[_0xc561('0x42')]['id']},'attributes':userAttributes})[_0xc561('0x48')](function(_0x4e31c2){if(!_0x4e31c2){return _0x156bc1['status'](0x194)[_0xc561('0x40')]({'message':'User\x20not\x20found.'});}_0x1e1136[_0xc561('0x42')]=_0x4e31c2;_0x2af25a();})['catch'](function(_0x40b2e3){_0x2af25a(_0x40b2e3);});}else if(_0x56d934){_0x2af25a();}else{return _0x156bc1[_0xc561('0x3f')](0x194)[_0xc561('0x40')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()[_0xc561('0x31')](function(_0x263ef7,_0x1f78df,_0x410113){return licenseUtil[_0xc561('0x54')]()[_0xc561('0x48')](function(_0x246375){if(_0x246375[_0xc561('0x55')]){_0x410113();}else{return _0x1f78df['status'](0x193)[_0xc561('0x40')]({'message':_0xc561('0x56')});}})[_0xc561('0x38')](function(_0x197971){_0x410113(_0x197971);});});};exports[_0xc561('0x57')]=function isWebrtcLicence(){return compose()[_0xc561('0x31')](function(_0x1648e5,_0x3c158f,_0xf543df){return licenseUtil[_0xc561('0x54')]()[_0xc561('0x48')](function(_0x137ec7){if(_0x137ec7[_0xc561('0x58')]){_0xf543df();}else{return _0x3c158f[_0xc561('0x3f')](0x193)[_0xc561('0x40')]({'message':_0xc561('0x56')});}})[_0xc561('0x38')](function(_0x1ea004){_0xf543df(_0x1ea004);});});};exports['isMiddleware']=function(_0x51dfff,_0x1a2694,_0x270e8a){_0x51dfff[_0xc561('0x59')]=!![];return _0x270e8a();};exports[_0xc561('0x5a')]=function signToken(_0x2aad43){return signJwt(_0x2aad43);};exports['setTokenCookie']=function(_0x479ff8,_0x1bcb96){if(!_0x479ff8[_0xc561('0x42')]){return _0x1bcb96[_0xc561('0x3f')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4823b9={'payload':{'id':_0x479ff8[_0xc561('0x42')]['id'],'role':_0x479ff8[_0xc561('0x42')][_0xc561('0xd')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4823b9)[_0xc561('0x48')](function(_0x4528f6){_0x1bcb96[_0xc561('0x5b')](_0xc561('0x5c'),_0x4528f6);_0x1bcb96[_0xc561('0x5d')](_0xc561('0x5e'));})[_0xc561('0x38')](function(_0x55b88a){return _0x1bcb96[_0xc561('0x3f')](0x1f4)[_0xc561('0x5f')](_0x55b88a);});};exports[_0xc561('0x60')]=function(_0x3d8ce3){if(_[_0xc561('0x61')](_0x3d8ce3[_0xc561('0x4b')])||_[_0xc561('0x61')](_0x3d8ce3[_0xc561('0x62')])){return null;}else{return createJwt(_0x3d8ce3);}};exports[_0xc561('0x63')]=function(_0x332e71){_0x332e71[_0xc561('0x4b')]=generateNonce();_0x332e71['apiKeyIat']=generateIssuedAt();return createJwt(_0x332e71);};exports[_0xc561('0x64')]=function(_0x4a19cd,_0x5e2ec9){var _0x1dabac=_0x4a19cd[_0xc561('0x45')]['apikey'];if(_0x1dabac){var _0x46b3af={'nonce':_0x5e2ec9['apiKeyNonce'],'iat':_0x5e2ec9['apiKeyIat'],'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x1dabac,_0x46b3af)[_0xc561('0x48')](function(){return generateApiKey(_0x5e2ec9);});}else{throw{'message':_0xc561('0x65')};}};exports[_0xc561('0x66')]=function(_0x3688c8){var _0x2ed6d5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2ed6d5[_0xc561('0x67')](_0x3688c8))throw new db[(_0xc561('0x68'))]['ValidationError'](_0xc561('0x69'));return;};exports[_0xc561('0x6a')]=function(_0xb61883,_0x1c9b9a,_0x4e3601){var _0x365157=encryptor[_0xc561('0x6b')](_0x1c9b9a)[_0xc561('0x6c')](',');for(var _0x3bacea=0x0;_0x3bacea<_0x4e3601;_0x3bacea++){if(!_0x365157[_0x3bacea])break;if(_0xb61883['toLowerCase']()===_0x365157[_0x3bacea]['toLowerCase']()){var _0xf57a6f=util[_0xc561('0x6d')](_0xc561('0x6e'),_0x4e3601);if(_0x4e3601===0x1){_0xf57a6f=_0xc561('0x6f');}throw new db['Sequelize'][(_0xc561('0x70'))](_0xf57a6f);}}return;};exports['updatePasswordsHistory']=function(_0x147017,_0x2ee494){var _0x47d17a=_0x2ee494?encryptor[_0xc561('0x6b')](_0x2ee494)['split'](','):[];if(_0x47d17a[_0xc561('0x71')]===0x5){_0x47d17a[_0xc561('0x72')](-0x1,0x1);}_0x47d17a[_0xc561('0x73')](_0x147017);return encryptor[_0xc561('0x74')](_0x47d17a['join'](','));};function signJwt(_0x106eed){var _0x5c2bfb=BPromise['promisify'](jwt[_0xc561('0x75')],{'context':jwt});var _0x1aee58=_0x106eed[_0xc561('0x76')]||config[_0xc561('0xb')]['session'];return new BPromise(function(_0x348688,_0x55e419){_0x5c2bfb(_0x106eed[_0xc561('0x77')],_0x1aee58,_0x106eed[_0xc561('0x78')])['then'](function(_0x1f8ae4){_0x348688(_0x1f8ae4);})[_0xc561('0x38')](function(_0x3a285d){_0x55e419(_0x3a285d);});});}function verifyJwt(_0x597af1,_0x3a3419,_0x1f1524){var _0x191838=BPromise[_0xc561('0x79')](jwt[_0xc561('0x7a')],{'context':jwt});var _0x99eab3=_0x1f1524||config[_0xc561('0xb')]['session'];return new BPromise(function(_0xa5b5dc,_0x5ce7c2){_0x191838(_0x597af1,_0x99eab3,_0x3a3419)[_0xc561('0x48')](function(_0x1d57d1){_0xa5b5dc(_0x1d57d1);})[_0xc561('0x38')](function(_0x3f8b04){_0x5ce7c2(_0x3f8b04);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0xc561('0x7b'));}function generateIssuedAt(){return Math['floor'](Date['now']()/0x3e8)[_0xc561('0x7c')]();}function createJwt(_0x526795){var _0x3b304b={'payload':{'iat':_0x526795[_0xc561('0x62')],'nonce':_0x526795[_0xc561('0x4b')]},'options':{'algorithm':_0xc561('0x7d'),'subject':_0x526795['id'][_0xc561('0x7c')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0xc561('0x47')]()}};return signJwt(_0x3b304b)['then'](function(_0x3634ec){return{'iat':_0x526795[_0xc561('0x62')],'nonce':_0x526795[_0xc561('0x4b')],'token':_0x3634ec};});} \ No newline at end of file +var _0x7821=['webrtc','isMiddleware','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','role','motion.token','redirect','send','isNil','generateApiKey','apiKeyIat','validatePasswordPattern','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','splice','unshift','encryptString','join','promisify','sign','secret','options','secrets','randomBytes','toString','hex','floor','now','HS512','../encryptor','express-jwt','basic-auth','bluebird','util','moment','session','fullname','name','internal','userpic','permissions','voicePause','chatPause','faxPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','passwordResetAt','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','userProfileId','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','ignorePauseForPreviewCalls','selectRecallMeCampaign','isChatInteractionAuthorized','use','user','ChatInteraction','findOne','params','closed','then','status','disposition','unmanaged','json','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','Basic','User','find','authenticate','pass','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','Setting','allowedLoginAttempts','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','blocked','blockDuration','blockedAt','add','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isWebrtcLicence'];(function(_0x1c24f1,_0xaa6438){var _0x34912c=function(_0x1a7e2e){while(--_0x1a7e2e){_0x1c24f1['push'](_0x1c24f1['shift']());}};_0x34912c(++_0xaa6438);}(_0x7821,0x9c));var _0x1782=function(_0x5df25b,_0x1bc928){_0x5df25b=_0x5df25b-0x0;var _0x19f252=_0x7821[_0x5df25b];return _0x19f252;};'use strict';var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var hardwareConf=require('../../config/license/hardware');var licenseUtil=require('../../config/license/util');var encryptor=require(_0x1782('0x0'));var _=require('lodash');var jwt=require('jsonwebtoken');var expressJwt=require(_0x1782('0x1'));var compose=require('composable-middleware');var basicAuth=require(_0x1782('0x2'));var crypto=require('crypto');var BPromise=require(_0x1782('0x3'));var util=require(_0x1782('0x4'));var moment=require(_0x1782('0x5'));var validateJwt=expressJwt({'secret':config['secrets'][_0x1782('0x6')]});var userAttributes=['id','role',_0x1782('0x7'),_0x1782('0x8'),_0x1782('0x9'),'email',_0x1782('0xa'),_0x1782('0xb'),'md5secret',_0x1782('0xc'),_0x1782('0xd'),'mailPause',_0x1782('0xe'),'smsPause',_0x1782('0xf'),_0x1782('0x10'),_0x1782('0x11'),_0x1782('0x12'),_0x1782('0x13'),_0x1782('0x14'),'allowmessenger',_0x1782('0x15'),'alias',_0x1782('0x16'),_0x1782('0x17'),_0x1782('0x18'),'phoneBarEnableRecording',_0x1782('0x19'),_0x1782('0x1a'),'phoneBarExpires','phoneBarPrefixRequired',_0x1782('0x1b'),_0x1782('0x1c'),_0x1782('0x1d'),'interface',_0x1782('0x1e'),'privacyEnabled','settingsEnabled',_0x1782('0x1f'),_0x1782('0x20'),_0x1782('0x21'),'downloadAttachments',_0x1782('0x22'),_0x1782('0x23')];exports[_0x1782('0x24')]=function(){return this['isAuthenticated'](!![])[_0x1782('0x25')](function(_0x3aa3c2,_0x192c05,_0x114a42){if(_0x3aa3c2[_0x1782('0x26')]){_0x114a42();}else{return db[_0x1782('0x27')][_0x1782('0x28')]({'where':{'id':_0x3aa3c2[_0x1782('0x29')]['id']},'attributes':['id',_0x1782('0x2a'),'disposition'],'raw':!![]})[_0x1782('0x2b')](function(_0xa0a71c){if(_0xa0a71c&&_0xa0a71c[_0x1782('0x2a')]){return _0x192c05[_0x1782('0x2c')](_0xa0a71c[_0x1782('0x2d')]===_0x1782('0x2e')?0x195:0x193)[_0x1782('0x2f')]({'message':_0xa0a71c['disposition']===_0x1782('0x2e')?_0x1782('0x30'):_0x1782('0x31')});}else{_0x114a42();}})[_0x1782('0x32')](function(_0x265045){_0x114a42(_0x265045);});}});};exports[_0x1782('0x33')]=function isAuthenticated(_0x1d5433){return compose()[_0x1782('0x25')](function(_0x11a255,_0x437e5f,_0x2a6990){var _0x5e8367;if(_0x11a255[_0x1782('0x34')][_0x1782('0x35')]){if(_[_0x1782('0x36')](_0x11a255['headers'][_0x1782('0x35')],_0x1782('0x37'))){var _0x3532df=basicAuth(_0x11a255);db[_0x1782('0x38')][_0x1782('0x39')]({'where':{'name':_0x3532df[_0x1782('0x8')]}})[_0x1782('0x2b')](function(_0x1687fa){if(!_0x1687fa||!_0x1687fa[_0x1782('0x3a')](_0x3532df[_0x1782('0x3b')])){return _0x437e5f['status'](0x191)[_0x1782('0x2f')]({'message':'Wrong\x20credentials.'});}_0x11a255[_0x1782('0x26')]={'id':_0x1687fa['id']};_0x2a6990();})[_0x1782('0x32')](function(_0x2c27a9){_0x2a6990(_0x2c27a9);});}else if(_[_0x1782('0x36')](_0x11a255[_0x1782('0x34')][_0x1782('0x35')],_0x1782('0x3c'))){validateJwt(_0x11a255,_0x437e5f,_0x2a6990);}else{if(_0x1d5433){_0x2a6990();}else{return _0x437e5f[_0x1782('0x2c')](0x193)[_0x1782('0x2f')]({'message':_0x1782('0x3d')});}}}else if(_0x11a255[_0x1782('0x3e')][_0x1782('0x3f')]){try{var _0x54d1e6={'audience':hardwareConf[_0x1782('0x40')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x11a255[_0x1782('0x3e')]['apikey'],_0x54d1e6)[_0x1782('0x2b')](function(_0x14dd8d){return db['User'][_0x1782('0x39')]({'where':{'id':_0x14dd8d['sub']}})[_0x1782('0x2b')](function(_0x2cc167){_0x5e8367=_0x2cc167;return db[_0x1782('0x41')][_0x1782('0x28')]({'where':{'id':0x1},'attributes':[_0x1782('0x42'),'blockDuration'],'raw':!![]});})[_0x1782('0x2b')](function(_0x4c9fb0){if(!_0x5e8367||!_[_0x1782('0x43')](_0x5e8367[_0x1782('0x44')],_0x14dd8d[_0x1782('0x45')])){return _0x437e5f[_0x1782('0x2c')](0x191)[_0x1782('0x2f')]({'message':_0x1782('0x46')});}if(_0x5e8367[_0x1782('0x47')]){return _0x437e5f[_0x1782('0x2c')](0x191)['json']({'message':'Invalid\x20API\x20access\x20key'});}if(_0x5e8367[_0x1782('0x48')]){if(_0x4c9fb0[_0x1782('0x49')]>0x0){if(moment(_0x5e8367[_0x1782('0x4a')])[_0x1782('0x4b')](_0x4c9fb0[_0x1782('0x49')],'minutes')>moment()){return _0x437e5f['status'](0x191)['json']({'message':_0x1782('0x4c')});}}else{return _0x437e5f[_0x1782('0x2c')](0x191)['json']({'message':_0x1782('0x4c')});}}_0x11a255[_0x1782('0x26')]={'id':_0x5e8367['id']};_0x2a6990();});})[_0x1782('0x32')](function(){return _0x437e5f['status'](0x191)['json']({'message':_0x1782('0x4c')});});}catch(_0x7f1211){_0x2a6990(_0x7f1211);}}else if(_0x1d5433){_0x2a6990();}else{return _0x437e5f[_0x1782('0x2c')](0x193)[_0x1782('0x2f')]({'message':_0x1782('0x3d')});}})[_0x1782('0x25')](function(_0x5972f0,_0x45d295,_0x12ac2a){if(_0x5972f0[_0x1782('0x26')]){db[_0x1782('0x38')]['find']({'where':{'id':_0x5972f0[_0x1782('0x26')]['id']},'attributes':userAttributes})['then'](function(_0x5376ec){if(!_0x5376ec){return _0x45d295['status'](0x194)[_0x1782('0x2f')]({'message':_0x1782('0x4d')});}_0x5972f0['user']=_0x5376ec;_0x12ac2a();})[_0x1782('0x32')](function(_0xe7696c){_0x12ac2a(_0xe7696c);});}else if(_0x1d5433){_0x12ac2a();}else{return _0x45d295['status'](0x194)['json']({'message':_0x1782('0x4e')});}});};exports[_0x1782('0x4f')]=function canUpdate(){return compose()[_0x1782('0x25')](function(_0x17ce7c,_0x8259cd,_0x45e3ab){return licenseUtil[_0x1782('0x50')]()['then'](function(_0x5c60f){if(_0x5c60f[_0x1782('0x51')]){_0x45e3ab();}else{return _0x8259cd['status'](0x193)['json']({'message':_0x1782('0x52')});}})[_0x1782('0x32')](function(_0x4ebddd){_0x45e3ab(_0x4ebddd);});});};exports[_0x1782('0x53')]=function isWebrtcLicence(){return compose()['use'](function(_0x191ef5,_0x3eb9fd,_0x125bf3){return licenseUtil['getLicense']()[_0x1782('0x2b')](function(_0x1161ae){if(_0x1161ae[_0x1782('0x54')]){_0x125bf3();}else{return _0x3eb9fd[_0x1782('0x2c')](0x193)[_0x1782('0x2f')]({'message':_0x1782('0x52')});}})[_0x1782('0x32')](function(_0x2cba57){_0x125bf3(_0x2cba57);});});};exports[_0x1782('0x55')]=function(_0x5757f3,_0x564f82,_0x17954a){_0x5757f3[_0x1782('0x55')]=!![];return _0x17954a();};exports[_0x1782('0x56')]=function signToken(_0x3764c0){return signJwt(_0x3764c0);};exports['setTokenCookie']=function(_0x27cd84,_0x1913cc){if(!_0x27cd84[_0x1782('0x26')]){return _0x1913cc[_0x1782('0x2c')](0x194)[_0x1782('0x2f')]({'message':_0x1782('0x57')});}var _0x3c3db6={'payload':{'id':_0x27cd84[_0x1782('0x26')]['id'],'role':_0x27cd84[_0x1782('0x26')][_0x1782('0x58')]},'options':{'expiresIn':0x15180}};return signJwt(_0x3c3db6)[_0x1782('0x2b')](function(_0xc3ad40){_0x1913cc['cookie'](_0x1782('0x59'),_0xc3ad40);_0x1913cc[_0x1782('0x5a')]('/dashboards/general');})['catch'](function(_0x37d5dc){return _0x1913cc[_0x1782('0x2c')](0x1f4)[_0x1782('0x5b')](_0x37d5dc);});};exports['retrieveApiKey']=function(_0xe9ede8){if(_['isNil'](_0xe9ede8[_0x1782('0x44')])||_[_0x1782('0x5c')](_0xe9ede8['apiKeyIat'])){return null;}else{return createJwt(_0xe9ede8);}};exports[_0x1782('0x5d')]=function(_0x3d385e){_0x3d385e['apiKeyNonce']=generateNonce();_0x3d385e[_0x1782('0x5e')]=generateIssuedAt();return createJwt(_0x3d385e);};exports['regenerateApiKey']=function(_0x1821a6,_0x3fb132){var _0xdcc78d=_0x1821a6[_0x1782('0x3e')][_0x1782('0x3f')];if(_0xdcc78d){var _0x4a2f83={'nonce':_0x3fb132[_0x1782('0x44')],'iat':_0x3fb132[_0x1782('0x5e')],'audience':hardwareConf[_0x1782('0x40')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0xdcc78d,_0x4a2f83)[_0x1782('0x2b')](function(){return generateApiKey(_0x3fb132);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports[_0x1782('0x5f')]=function(_0x3f9da2){var _0x3dd619=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x3dd619['test'](_0x3f9da2))throw new db[(_0x1782('0x60'))][(_0x1782('0x61'))](_0x1782('0x62'));return;};exports['validatePasswordHistory']=function(_0xfc0628,_0x412208,_0x3d3cc0){var _0x11fdbb=encryptor[_0x1782('0x63')](_0x412208)[_0x1782('0x64')](',');for(var _0x450f1a=0x0;_0x450f1a<_0x3d3cc0;_0x450f1a++){if(!_0x11fdbb[_0x450f1a])break;if(_0xfc0628[_0x1782('0x65')]()===_0x11fdbb[_0x450f1a][_0x1782('0x65')]()){var _0xd8ff2d=util['format'](_0x1782('0x66'),_0x3d3cc0);if(_0x3d3cc0===0x1){_0xd8ff2d='The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.';}throw new db[(_0x1782('0x60'))][(_0x1782('0x61'))](_0xd8ff2d);}}return;};exports[_0x1782('0x67')]=function(_0x10c994,_0x25f10d){var _0x110f5f=_0x25f10d?encryptor['decryptString'](_0x25f10d)['split'](','):[];if(_0x110f5f[_0x1782('0x68')]===0x5){_0x110f5f[_0x1782('0x69')](-0x1,0x1);}_0x110f5f[_0x1782('0x6a')](_0x10c994);return encryptor[_0x1782('0x6b')](_0x110f5f[_0x1782('0x6c')](','));};function signJwt(_0x1720be){var _0xe76dea=BPromise[_0x1782('0x6d')](jwt[_0x1782('0x6e')],{'context':jwt});var _0x21b98b=_0x1720be[_0x1782('0x6f')]||config['secrets'][_0x1782('0x6')];return new BPromise(function(_0x49c652,_0x1c7f9d){_0xe76dea(_0x1720be['payload'],_0x21b98b,_0x1720be[_0x1782('0x70')])[_0x1782('0x2b')](function(_0x5c43ae){_0x49c652(_0x5c43ae);})[_0x1782('0x32')](function(_0x11d166){_0x1c7f9d(_0x11d166);});});}function verifyJwt(_0x35d6ca,_0x42acf6,_0x51f3d6){var _0x583cb7=BPromise[_0x1782('0x6d')](jwt['verify'],{'context':jwt});var _0x52b3ba=_0x51f3d6||config[_0x1782('0x71')][_0x1782('0x6')];return new BPromise(function(_0x33b2a8,_0x10a956){_0x583cb7(_0x35d6ca,_0x52b3ba,_0x42acf6)[_0x1782('0x2b')](function(_0xce1f59){_0x33b2a8(_0xce1f59);})[_0x1782('0x32')](function(_0x48a08e){_0x10a956(_0x48a08e);});});}function generateNonce(){return crypto[_0x1782('0x72')](0x10)[_0x1782('0x73')](_0x1782('0x74'));}function generateIssuedAt(){return Math[_0x1782('0x75')](Date[_0x1782('0x76')]()/0x3e8)[_0x1782('0x73')]();}function createJwt(_0x2eaf14){var _0x454d96={'payload':{'iat':_0x2eaf14[_0x1782('0x5e')],'nonce':_0x2eaf14[_0x1782('0x44')]},'options':{'algorithm':_0x1782('0x77'),'subject':_0x2eaf14['id'][_0x1782('0x73')](),'issuer':hardwareConf[_0x1782('0x40')](),'audience':hardwareConf[_0x1782('0x40')]()}};return signJwt(_0x454d96)['then'](function(_0x822667){return{'iat':_0x2eaf14[_0x1782('0x5e')],'nonce':_0x2eaf14[_0x1782('0x44')],'token':_0x822667};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index d5f8426..4b11665 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 _0x3bd6=['createDecipher','data','update','final','secret','utf8','base64','decryptString','crypto','bluebird','lodash','../../config/environment','../../config/logger','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','error','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','createReadStream','createWriteStream','createCipher','binary','write','end','close','unlink','decryptFile'];(function(_0x3cb5a6,_0x488086){var _0x46e6f3=function(_0x275185){while(--_0x275185){_0x3cb5a6['push'](_0x3cb5a6['shift']());}};_0x46e6f3(++_0x488086);}(_0x3bd6,0xc1));var _0x63bd=function(_0x5e42a4,_0x36a91f){_0x5e42a4=_0x5e42a4-0x0;var _0x180a63=_0x3bd6[_0x5e42a4];return _0x180a63;};'use strict';var crypto=require(_0x63bd('0x0'));var fs=require('fs');var BPromise=require(_0x63bd('0x1'));var _=require(_0x63bd('0x2'));var config=require(_0x63bd('0x3'));var logger=require(_0x63bd('0x4'))(_0x63bd('0x5'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x63bd('0x6')][_0x63bd('0x7')],'algorithm':_0x63bd('0x8')};const fileOptions={'algorithm':_0x63bd('0x9')};if(config[_0x63bd('0xa')]&&config['encrypt'][_0x63bd('0xb')]){var isSupported=isAlgorithmSupported(config[_0x63bd('0xa')][_0x63bd('0xb')]);if(isSupported){fileOptions[_0x63bd('0xb')]=config[_0x63bd('0xa')]['algorithm'];}else{var supportedAlgorithms=getSupportedCiphers()[_0x63bd('0xc')](',\x20');logger[_0x63bd('0xd')](config[_0x63bd('0xa')][_0x63bd('0xb')],_0x63bd('0xe'),supportedAlgorithms);}}function isASupportedCipher(_0x260c52){return AES_SUPPORTED_RX[_0x63bd('0xf')](_0x260c52);}function getSupportedCiphers(){return crypto[_0x63bd('0x10')]()[_0x63bd('0x11')](isASupportedCipher);}function isAlgorithmSupported(_0x33d3d4){return getSupportedCiphers()[_0x63bd('0x12')](_0x33d3d4)>-0x1;}function combineOptions(_0x4fc83f){var _0x37f32d={};for(var _0x23f876 in fileOptions){if(fileOptions[_0x63bd('0x13')](_0x23f876)){_0x37f32d[_0x23f876]=fileOptions[_0x23f876];}}if(_0x4fc83f){for(var _0x3552d1 in _0x4fc83f){if(_0x4fc83f['hasOwnProperty'](_0x3552d1)){_0x37f32d[_0x3552d1]=_0x4fc83f[_0x3552d1];}}}return _0x37f32d;}exports['encryptFile']=function(_0x132935,_0x51d4f7,_0x2d1e6f,_0x5814ff){return new BPromise(function(_0x38bc11,_0xa25b1d){_0x5814ff=combineOptions(_0x5814ff);var _0x512109=new Buffer(_0x2d1e6f);var _0x2563e5=fs[_0x63bd('0x14')](_0x132935);var _0x23d4e6=fs[_0x63bd('0x15')](_0x51d4f7);var _0x126e59=crypto[_0x63bd('0x16')](_0x5814ff[_0x63bd('0xb')],_0x512109);_0x2563e5['on']('data',function(_0x30ca56){var _0x37045a=new Buffer(_0x126e59['update'](_0x30ca56),_0x63bd('0x17'));_0x23d4e6[_0x63bd('0x18')](_0x37045a);});_0x2563e5['on'](_0x63bd('0x19'),function(){try{var _0x537bec=new Buffer(_0x126e59['final'](_0x63bd('0x17')),_0x63bd('0x17'));_0x23d4e6[_0x63bd('0x18')](_0x537bec);_0x23d4e6[_0x63bd('0x19')]();_0x23d4e6['on'](_0x63bd('0x1a'),function(){return _0x38bc11(_0x51d4f7);});}catch(_0x69265d){fs[_0x63bd('0x1b')](_0x51d4f7);return _0xa25b1d(_0x69265d);}});});};exports[_0x63bd('0x1c')]=function(_0x4dbf12,_0x5c5bef,_0x3f562b,_0x400d03){return new BPromise(function(_0x52e646,_0x2ba2ff){_0x400d03=combineOptions(_0x400d03);var _0x7d6df6=new Buffer(_0x3f562b);var _0x5310a3=fs['createReadStream'](_0x4dbf12);var _0x191c48=fs['createWriteStream'](_0x5c5bef);var _0x34c2eb=crypto[_0x63bd('0x1d')](_0x400d03['algorithm'],_0x7d6df6);_0x5310a3['on'](_0x63bd('0x1e'),function(_0x1b70f3){var _0x41e1d0=new Buffer(_0x34c2eb[_0x63bd('0x1f')](_0x1b70f3),_0x63bd('0x17'));_0x191c48[_0x63bd('0x18')](_0x41e1d0);});_0x5310a3['on'](_0x63bd('0x19'),function(){try{var _0x50935f=new Buffer(_0x34c2eb[_0x63bd('0x20')](_0x63bd('0x17')),_0x63bd('0x17'));_0x191c48[_0x63bd('0x18')](_0x50935f);_0x191c48[_0x63bd('0x19')]();_0x191c48['on'](_0x63bd('0x1a'),function(){return _0x52e646(_0x5c5bef);});}catch(_0x30c806){fs['unlink'](_0x5c5bef);return _0x2ba2ff(_0x30c806);}});});};exports['encryptString']=function(_0x494d45,_0x346363,_0x3715dc){var _0x3d9a2c=_0x3715dc||stringOptions[_0x63bd('0xb')];var _0x3d2b36=_0x346363||stringOptions[_0x63bd('0x21')];var _0x3e1691=crypto[_0x63bd('0x16')](_0x3d9a2c,_0x3d2b36);var _0x47a370=_0x3e1691['update'](_0x494d45,_0x63bd('0x22'),_0x63bd('0x23'));_0x47a370+=_0x3e1691[_0x63bd('0x20')](_0x63bd('0x23'));return _0x47a370;};exports[_0x63bd('0x24')]=function(_0x376e12,_0x5660dc,_0x2f7fee){var _0x228aab=_0x2f7fee||stringOptions[_0x63bd('0xb')];var _0x46d8bb=_0x5660dc||stringOptions[_0x63bd('0x21')];var _0x3f3ee8=crypto[_0x63bd('0x1d')](_0x228aab,_0x46d8bb);var _0x30fb09=_0x3f3ee8['update'](_0x376e12,_0x63bd('0x23'),_0x63bd('0x22'));_0x30fb09+=_0x3f3ee8[_0x63bd('0x20')]('utf8');return _0x30fb09;}; \ No newline at end of file +var _0x0e15=['decryptFile','update','final','secret','utf8','base64','decryptString','bluebird','../../config/environment','app','secrets','session','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','getCiphers','filter','indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','data','binary','write','end','close','unlink'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x0e15,0x187));var _0x50e1=function(_0x36313e,_0x4a8321){_0x36313e=_0x36313e-0x0;var _0x53869a=_0x0e15[_0x36313e];return _0x53869a;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x50e1('0x0'));var _=require('lodash');var config=require(_0x50e1('0x1'));var logger=require('../../config/logger')(_0x50e1('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x50e1('0x3')][_0x50e1('0x4')],'algorithm':'aes-256-ctr'};const fileOptions={'algorithm':_0x50e1('0x5')};if(config['encrypt']&&config[_0x50e1('0x6')][_0x50e1('0x7')]){var isSupported=isAlgorithmSupported(config['encrypt'][_0x50e1('0x7')]);if(isSupported){fileOptions[_0x50e1('0x7')]=config[_0x50e1('0x6')][_0x50e1('0x7')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x50e1('0x8')](',\x20');logger['error'](config[_0x50e1('0x6')]['algorithm'],_0x50e1('0x9'),supportedAlgorithms);}}function isASupportedCipher(_0x140635){return AES_SUPPORTED_RX[_0x50e1('0xa')](_0x140635);}function getSupportedCiphers(){return crypto[_0x50e1('0xb')]()[_0x50e1('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x40e296){return getSupportedCiphers()[_0x50e1('0xd')](_0x40e296)>-0x1;}function combineOptions(_0x243800){var _0x28b6b9={};for(var _0x4e4f49 in fileOptions){if(fileOptions[_0x50e1('0xe')](_0x4e4f49)){_0x28b6b9[_0x4e4f49]=fileOptions[_0x4e4f49];}}if(_0x243800){for(var _0x23d5c7 in _0x243800){if(_0x243800[_0x50e1('0xe')](_0x23d5c7)){_0x28b6b9[_0x23d5c7]=_0x243800[_0x23d5c7];}}}return _0x28b6b9;}exports[_0x50e1('0xf')]=function(_0x52ae0a,_0x46a007,_0x40aba0,_0x2e8330){return new BPromise(function(_0x4ee6d2,_0x5d3e6b){_0x2e8330=combineOptions(_0x2e8330);var _0x364cec=new Buffer(_0x40aba0);var _0x4dedc8=fs[_0x50e1('0x10')](_0x52ae0a);var _0x5010bb=fs[_0x50e1('0x11')](_0x46a007);var _0x1da0c2=crypto[_0x50e1('0x12')](_0x2e8330[_0x50e1('0x7')],_0x364cec);_0x4dedc8['on'](_0x50e1('0x13'),function(_0x5eb2d4){var _0x5cc350=new Buffer(_0x1da0c2['update'](_0x5eb2d4),_0x50e1('0x14'));_0x5010bb[_0x50e1('0x15')](_0x5cc350);});_0x4dedc8['on']('end',function(){try{var _0x4f362f=new Buffer(_0x1da0c2['final'](_0x50e1('0x14')),'binary');_0x5010bb[_0x50e1('0x15')](_0x4f362f);_0x5010bb[_0x50e1('0x16')]();_0x5010bb['on'](_0x50e1('0x17'),function(){return _0x4ee6d2(_0x46a007);});}catch(_0x12a64f){fs[_0x50e1('0x18')](_0x46a007);return _0x5d3e6b(_0x12a64f);}});});};exports[_0x50e1('0x19')]=function(_0x474ec6,_0x4580d9,_0x335d01,_0x5ee8f4){return new BPromise(function(_0x47d87b,_0x49d2b3){_0x5ee8f4=combineOptions(_0x5ee8f4);var _0x103470=new Buffer(_0x335d01);var _0x1829ce=fs[_0x50e1('0x10')](_0x474ec6);var _0x5b4a47=fs[_0x50e1('0x11')](_0x4580d9);var _0x3444ce=crypto['createDecipher'](_0x5ee8f4['algorithm'],_0x103470);_0x1829ce['on']('data',function(_0x5be37e){var _0xcd61d1=new Buffer(_0x3444ce[_0x50e1('0x1a')](_0x5be37e),_0x50e1('0x14'));_0x5b4a47[_0x50e1('0x15')](_0xcd61d1);});_0x1829ce['on'](_0x50e1('0x16'),function(){try{var _0xa11962=new Buffer(_0x3444ce[_0x50e1('0x1b')](_0x50e1('0x14')),'binary');_0x5b4a47[_0x50e1('0x15')](_0xa11962);_0x5b4a47[_0x50e1('0x16')]();_0x5b4a47['on'](_0x50e1('0x17'),function(){return _0x47d87b(_0x4580d9);});}catch(_0x287301){fs[_0x50e1('0x18')](_0x4580d9);return _0x49d2b3(_0x287301);}});});};exports['encryptString']=function(_0x2b8bb1,_0xbb6466,_0x430398){var _0x294cb5=_0x430398||stringOptions['algorithm'];var _0xb55b24=_0xbb6466||stringOptions[_0x50e1('0x1c')];var _0xb775aa=crypto['createCipher'](_0x294cb5,_0xb55b24);var _0x838862=_0xb775aa['update'](_0x2b8bb1,_0x50e1('0x1d'),_0x50e1('0x1e'));_0x838862+=_0xb775aa[_0x50e1('0x1b')]('base64');return _0x838862;};exports[_0x50e1('0x1f')]=function(_0x22447a,_0x129373,_0xb48f96){var _0x1684ce=_0xb48f96||stringOptions['algorithm'];var _0x354a16=_0x129373||stringOptions['secret'];var _0x487248=crypto['createDecipher'](_0x1684ce,_0x354a16);var _0x32ef51=_0x487248['update'](_0x22447a,_0x50e1('0x1e'),'utf8');_0x32ef51+=_0x487248['final'](_0x50e1('0x1d'));return _0x32ef51;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 548248f..3901620 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 _0x69e9=['QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','existsSync','join','mkdirSync','each','%s%d.%s','csv','%s.%s','writeFileSync','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','CSV','inspect','Failed','exit','util','path','bluebird','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','then','splitSizeCsv','sequelize','query'];(function(_0x5eb2ed,_0x2dfa21){var _0x531625=function(_0x5830a0){while(--_0x5830a0){_0x5eb2ed['push'](_0x5eb2ed['shift']());}};_0x531625(++_0x2dfa21);}(_0x69e9,0x128));var _0x969e=function(_0x331e6e,_0x475347){_0x331e6e=_0x331e6e-0x0;var _0x2fea5b=_0x69e9[_0x331e6e];return _0x2fea5b;};'use strict';var util=require(_0x969e('0x0'));var path=require(_0x969e('0x1'));var _=require('lodash');var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x969e('0x2'));var zipdir=require(_0x969e('0x3'));var rimraf=require(_0x969e('0x4'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0x969e('0x5')];var logger=require(_0x969e('0x6'))(_0x969e('0x7'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0x969e('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0xa55a7a,_0x4d7f53){var _0x3961c0={'status':_0xa55a7a};var _0x2cc686={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4d7f53){_0x3961c0[_0x969e('0x9')]=_0x4d7f53;}return db[_0x969e('0xa')][_0x969e('0xb')](_0x3961c0,_0x2cc686);}function main(){var _0x2115d6=0x1388;var _0x438f3e;logger[_0x969e('0xc')](util[_0x969e('0xd')](_0x969e('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0x969e('0xf')][_0x969e('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x969e('0x11'),'splitSizeCsv']})[_0x969e('0x12')](function(_0x599d83){if(_0x599d83){_0x438f3e=_0x599d83;_0x2115d6=_0x438f3e[_0x969e('0x13')]||0x1388;}})[_0x969e('0x12')](function(){return dbH[_0x969e('0x14')][_0x969e('0x15')](util[_0x969e('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x969e('0x14')][_0x969e('0x16')][_0x969e('0x17')]});})[_0x969e('0x12')](function(_0x275bb3){if(!_0x275bb3[0x0][_0x969e('0x18')]){return analyticExtractedReport(_0x969e('0x19'));}var _0x1d621a=[];var _0x1d1c3c=0x0;if(_0x438f3e[_0x969e('0x11')]){if(_0x275bb3&&_0x275bb3[_0x969e('0x1a')]){var _0x2065e3=_[_0x969e('0x1b')](_0x275bb3[0x0]['num']/_0x2115d6);var _0x5b7d43=Number[_0x969e('0x1c')](_0x275bb3[0x0]['num']/_0x2115d6)?_0x275bb3[0x0][_0x969e('0x18')]%_0x2115d6:0x0;_0x2065e3[_0x969e('0x1d')](function(_0x4fb81f){if(_0x4fb81f>0x0){_0x1d1c3c+=_0x2115d6;}_0x1d621a[_0x969e('0x1e')](dbH[_0x969e('0x14')][_0x969e('0x15')](util[_0x969e('0xd')](_0x969e('0x1f'),QUERY,_0x2115d6,_0x1d1c3c),{'type':dbH['sequelize'][_0x969e('0x16')][_0x969e('0x17')]}));});if(_0x5b7d43>0x0){_0x1d1c3c+=_0x2115d6;_0x1d621a[_0x969e('0x1e')](dbH[_0x969e('0x14')][_0x969e('0x15')](util[_0x969e('0xd')](_0x969e('0x1f'),QUERY,_0x5b7d43,_0x1d1c3c),{'type':dbH[_0x969e('0x14')]['QueryTypes'][_0x969e('0x17')]}));}}}else{_0x1d621a['push'](dbH['sequelize'][_0x969e('0x15')](QUERY,{'type':dbH[_0x969e('0x14')][_0x969e('0x16')][_0x969e('0x17')]}));}var _0x435dd5=path[_0x969e('0x20')](PATH);var _0x5b8b83=path[_0x969e('0x21')](PATH,_0x969e('0x22'));var _0x4f64c4=_0x438f3e[_0x969e('0x11')]&&_0x1d621a[_0x969e('0x1a')]>0x1;var _0x226a6c=[];if(!fs[_0x969e('0x23')](path[_0x969e('0x24')](_0x435dd5,_0x5b8b83))&&_0x4f64c4){fs[_0x969e('0x25')](path[_0x969e('0x24')](_0x435dd5,_0x5b8b83));}return BPromise[_0x969e('0x26')](_0x1d621a,function(_0xe96cb7){_0x226a6c[_0x969e('0x1e')](_0xe96cb7);})[_0x969e('0x12')](function(){for(var _0x592454=0x0;_0x592454<_0x226a6c['length'];_0x592454+=0x1){var _0x5967e8;var _0x5f3ade=_0x226a6c[_0x592454];if(_0x4f64c4){_0x5967e8=path[_0x969e('0x24')](_0x435dd5,_0x5b8b83,util[_0x969e('0xd')](_0x969e('0x27'),_0x5b8b83,_0x592454,_0x969e('0x28')));}else{_0x5967e8=path[_0x969e('0x24')](_0x435dd5,util[_0x969e('0xd')](_0x969e('0x29'),_0x5b8b83,_0x969e('0x28')));}fs[_0x969e('0x2a')](_0x5967e8,csv(_0x5f3ade));}})[_0x969e('0x12')](function(){if(_0x4f64c4){return new Promise(function(_0x36a771){zipdir(path[_0x969e('0x24')](_0x435dd5,_0x5b8b83),{'saveTo':path[_0x969e('0x24')](_0x435dd5,util['format'](_0x969e('0x29'),_0x5b8b83,_0x969e('0x2b')))},function(_0x4e36a2,_0x589433){rimraf(path['join'](_0x435dd5,_0x5b8b83),function(){});_0x36a771(_0x969e('0x2c'));});});}})['then'](function(){logger[_0x969e('0xc')](util[_0x969e('0xd')](_0x969e('0x2d'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x969e('0x2e'),_0x4f64c4?util['format']('%s.%s',_0x5b8b83,_0x4f64c4?_0x969e('0x2b'):_0x969e('0x28')):null);});})[_0x969e('0x2f')](function(_0x588241){logger['info'](util[_0x969e('0xd')](_0x969e('0x30'),EXTRACTED_REPORT_ID,_0x969e('0x31')),util[_0x969e('0x32')](_0x588241,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x969e('0x33'));})['finally'](function(){process[_0x969e('0x34')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x2395=['existsSync','join','each','%s%d.%s','%s.%s','csv','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','lodash','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','splitSizeCsv','then','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','num','length','range','isInteger','forEach','push','query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','dirname','.csv'];(function(_0x4d147c,_0x428043){var _0x1dffa8=function(_0x76e85c){while(--_0x76e85c){_0x4d147c['push'](_0x4d147c['shift']());}};_0x1dffa8(++_0x428043);}(_0x2395,0x10a));var _0x5239=function(_0x51aab8,_0x48cbf7){_0x51aab8=_0x51aab8-0x0;var _0x5dedf3=_0x2395[_0x51aab8];return _0x5dedf3;};'use strict';var util=require(_0x5239('0x0'));var path=require('path');var _=require(_0x5239('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x5239('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x5239('0x3'));var db=require('../../mysqldb')['db'];var dbH=require(_0x5239('0x4'))[_0x5239('0x5')];var logger=require(_0x5239('0x6'))(_0x5239('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x5239('0x8')][0x2]);var QUERY=process[_0x5239('0x8')][0x3];var PATH=process[_0x5239('0x8')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x419eab,_0x283c70){var _0x5b2b7a={'status':_0x419eab};var _0x3dd9ba={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x283c70){_0x5b2b7a[_0x5239('0x9')]=_0x283c70;}return db[_0x5239('0xa')][_0x5239('0xb')](_0x5b2b7a,_0x3dd9ba);}function main(){var _0x6720f1=0x1388;var _0x7b4ca4;logger['info'](util['format'](_0x5239('0xc'),EXTRACTED_REPORT_ID,_0x5239('0xd')));return db[_0x5239('0xe')][_0x5239('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x5239('0x10'),_0x5239('0x11')]})['then'](function(_0x1ff937){if(_0x1ff937){_0x7b4ca4=_0x1ff937;_0x6720f1=_0x7b4ca4[_0x5239('0x11')]||0x1388;}})[_0x5239('0x12')](function(){return dbH[_0x5239('0x13')]['query'](util['format'](_0x5239('0x14'),QUERY),{'type':dbH[_0x5239('0x13')][_0x5239('0x15')]['SELECT']});})[_0x5239('0x12')](function(_0x4c48df){if(!_0x4c48df[0x0][_0x5239('0x16')]){return analyticExtractedReport('Empty');}var _0x59215d=[];var _0xb64620=0x0;if(_0x7b4ca4[_0x5239('0x10')]){if(_0x4c48df&&_0x4c48df[_0x5239('0x17')]){var _0x4e5607=_[_0x5239('0x18')](_0x4c48df[0x0]['num']/_0x6720f1);var _0x3d99ee=Number[_0x5239('0x19')](_0x4c48df[0x0][_0x5239('0x16')]/_0x6720f1)?_0x4c48df[0x0][_0x5239('0x16')]%_0x6720f1:0x0;_0x4e5607[_0x5239('0x1a')](function(_0x2b3305){if(_0x2b3305>0x0){_0xb64620+=_0x6720f1;}_0x59215d[_0x5239('0x1b')](dbH[_0x5239('0x13')][_0x5239('0x1c')](util[_0x5239('0x1d')](_0x5239('0x1e'),QUERY,_0x6720f1,_0xb64620),{'type':dbH['sequelize'][_0x5239('0x15')][_0x5239('0x1f')]}));});if(_0x3d99ee>0x0){_0xb64620+=_0x6720f1;_0x59215d[_0x5239('0x1b')](dbH[_0x5239('0x13')][_0x5239('0x1c')](util[_0x5239('0x1d')](_0x5239('0x1e'),QUERY,_0x3d99ee,_0xb64620),{'type':dbH[_0x5239('0x13')]['QueryTypes'][_0x5239('0x1f')]}));}}}else{_0x59215d[_0x5239('0x1b')](dbH[_0x5239('0x13')][_0x5239('0x1c')](QUERY,{'type':dbH[_0x5239('0x13')][_0x5239('0x15')][_0x5239('0x1f')]}));}var _0x12d7dc=path[_0x5239('0x20')](PATH);var _0x3c0a85=path['basename'](PATH,_0x5239('0x21'));var _0x3c0afb=_0x7b4ca4['split']&&_0x59215d['length']>0x1;var _0x544d9f=[];if(!fs[_0x5239('0x22')](path['join'](_0x12d7dc,_0x3c0a85))&&_0x3c0afb){fs['mkdirSync'](path[_0x5239('0x23')](_0x12d7dc,_0x3c0a85));}return BPromise[_0x5239('0x24')](_0x59215d,function(_0x18b116){_0x544d9f['push'](_0x18b116);})['then'](function(){for(var _0x4adc16=0x0;_0x4adc16<_0x544d9f['length'];_0x4adc16+=0x1){var _0xd1aec;var _0x196fb9=_0x544d9f[_0x4adc16];if(_0x3c0afb){_0xd1aec=path[_0x5239('0x23')](_0x12d7dc,_0x3c0a85,util[_0x5239('0x1d')](_0x5239('0x25'),_0x3c0a85,_0x4adc16,'csv'));}else{_0xd1aec=path[_0x5239('0x23')](_0x12d7dc,util['format'](_0x5239('0x26'),_0x3c0a85,_0x5239('0x27')));}fs['writeFileSync'](_0xd1aec,csv(_0x196fb9));}})['then'](function(){if(_0x3c0afb){return new Promise(function(_0xe9f11c){zipdir(path[_0x5239('0x23')](_0x12d7dc,_0x3c0a85),{'saveTo':path[_0x5239('0x23')](_0x12d7dc,util['format'](_0x5239('0x26'),_0x3c0a85,_0x5239('0x28')))},function(_0x4319b0,_0x1af780){rimraf(path[_0x5239('0x23')](_0x12d7dc,_0x3c0a85),function(){});_0xe9f11c(_0x5239('0x29'));});});}})[_0x5239('0x12')](function(){logger[_0x5239('0x2a')](util['format'](_0x5239('0x2b'),EXTRACTED_REPORT_ID,_0x5239('0xd')));return analyticExtractedReport(_0x5239('0x2c'),_0x3c0afb?util['format']('%s.%s',_0x3c0a85,_0x3c0afb?'zip':_0x5239('0x27')):null);});})[_0x5239('0x2d')](function(_0x50f1b4){logger[_0x5239('0x2a')](util[_0x5239('0x1d')](_0x5239('0x2e'),EXTRACTED_REPORT_ID,_0x5239('0xd')),util['inspect'](_0x50f1b4,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x5239('0x2f'));})[_0x5239('0x30')](function(){process[_0x5239('0x31')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c7d155a..17ef3c8 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 _0x162a=['SELECT','query','dirname','.pdf','existsSync','join','mkdirSync','each','flatten','createPdfKitDocument','%s%d.%s','pdf','%s.%s','all','zip','zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Failed','finally','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-bold-italic.ttf','%s\x20#%d','channel','center','Interaction\x20Transcript','pipe','createWriteStream','finish','error','end','createPdfFromHTML','path','lodash','moment','pdfmake/src/printer','rimraf','JSDOM','bluebird','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','pick','value','fill','length','body','push','concat','chunk','keys','forEach','format','name','header','before','margin','landscape','toString','\x20/\x20','footer','Arial','right','num','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','QueryTypes'];(function(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0x162a,0x7d));var _0xa162=function(_0x934754,_0x15bd40){_0x934754=_0x934754-0x0;var _0x5cf1fc=_0x162a[_0x934754];return _0x5cf1fc;};'use strict';var _=require(_0xa162('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require(_0xa162('0x1'));var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0xa162('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0xa162('0x3'));var JSDOM=require('jsdom')[_0xa162('0x4')];var window=new JSDOM('')['window'];var BPromise=require(_0xa162('0x5'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xa162('0x6')][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xa162('0x6')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xa162('0x7');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x201df2,_0x172ecf){var _0x2f650c={'status':_0x201df2};var _0x3e988e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x172ecf){_0x2f650c[_0xa162('0x8')]=_0x172ecf;}return db[_0xa162('0x9')]['update'](_0x2f650c,_0x3e988e);}function getHeaders(_0x1c1945){return _[_0xa162('0xa')](_0x1c1945,function(_0x49e52b){return{'text':_0x49e52b,'style':_0xa162('0xb')};});}function getRows(_0x3ebf88,_0x3ee7eb){return _[_0xa162('0xa')](_0x3ee7eb,function(_0x2eacab){return _(_0x2eacab)[_0xa162('0xc')](_0x3ebf88)[_0xa162('0xa')](function(_0x27919d){return _0x27919d?_['toString'](_0x27919d):'';})[_0xa162('0xd')]();});}function createTable(_0x358ef4,_0x37e855){var _0x4a7669={'widths':_[_0xa162('0xe')](Array(_0x358ef4[_0xa162('0xf')]),0x91),'heights':function(_0x5ef470){return _0x5ef470===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x55f012=getHeaders(_0x358ef4);_0x4a7669[_0xa162('0x10')][_0xa162('0x11')](_0x55f012);var _0x110e4e=getRows(_0x358ef4,_0x37e855);_0x4a7669[_0xa162('0x10')]=_0x4a7669[_0xa162('0x10')][_0xa162('0x12')](_0x110e4e);return _0x4a7669;}function createTables(_0x2a25a4){var _0x49e66b=[];var _0x45dd65=_[_0xa162('0x13')](Object[_0xa162('0x14')](_0x2a25a4[0x0]),0x5);_0x45dd65[_0xa162('0x15')](function(_0x37f8ae){_0x49e66b[_0xa162('0x11')](createTable(_0x37f8ae,_0x2a25a4));});return _0x49e66b;}function getPDFDocDefinition(_0x5686e2){var _0xa5e1ee=util[_0xa162('0x16')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,EXTRACTED_REPORT[_0xa162('0x17')],moment(EXTRACTED_REPORT['startDate'])['format'](FORMAT),moment(EXTRACTED_REPORT['endDate'])[_0xa162('0x16')](FORMAT));var _0x54fd5d=[];for(var _0x4c6dc0=0x0;_0x4c6dc0<_0x5686e2[_0xa162('0xf')];_0x4c6dc0++){var _0x402a0e=[];if(_0x4c6dc0===0x0){_0x402a0e[_0xa162('0x11')]({'text':_0xa5e1ee,'style':_0xa162('0x18')});}var _0x5066b6={'table':_0x5686e2[_0x4c6dc0]};if(_0x4c6dc0>0x0){_0x5066b6['pageBreak']=_0xa162('0x19');_0x5066b6[_0xa162('0x1a')]=[0x0,0x46,0x0,0x0];}_0x402a0e['push'](_0x5066b6);_0x54fd5d[_0xa162('0x11')](_0x402a0e);}return{'pageSize':'A4','pageOrientation':_0xa162('0x1b'),'content':_0x54fd5d,'footer':function(_0x2aac4c,_0x1418a0){return{'text':_0x2aac4c[_0xa162('0x1c')]()+_0xa162('0x1d')+_0x1418a0,'style':_0xa162('0x1e')};},'defaultStyle':{'font':_0xa162('0x1f')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'},'footer':{'alignment':_0xa162('0x20'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x1a6151){var _0x3f142d=0x1388;var _0x265fae;if(!_0x1a6151[0x0][_0xa162('0x21')]){return analyticExtractedReport('Empty');}return db[_0xa162('0x22')][_0xa162('0x23')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa162('0x24'),_0xa162('0x25')]})[_0xa162('0x26')](function(_0x5b9b27){if(_0x5b9b27){_0x265fae=_0x5b9b27;_0x3f142d=_0x265fae[_0xa162('0x25')]||0x3e8;}})['then'](function(){var _0x5a6757=[];var _0x514054=0x0;if(_0x265fae[_0xa162('0x24')]){if(_0x1a6151&&_0x1a6151['length']){var _0x33ce30=_[_0xa162('0x27')](_0x1a6151[0x0][_0xa162('0x21')]/_0x3f142d);var _0x5d2324=Number[_0xa162('0x28')](_0x1a6151[0x0]['num']/_0x3f142d)?_0x1a6151[0x0][_0xa162('0x21')]%_0x3f142d:0x0;_0x33ce30[_0xa162('0x15')](function(_0x5cb346){if(_0x5cb346>0x0){_0x514054+=_0x3f142d;}_0x5a6757[_0xa162('0x11')](dbH[_0xa162('0x29')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x3f142d,_0x514054),{'type':dbH[_0xa162('0x29')][_0xa162('0x2a')][_0xa162('0x2b')]}));});if(_0x5d2324>0x0){_0x514054+=_0x3f142d;_0x5a6757[_0xa162('0x11')](dbH[_0xa162('0x29')][_0xa162('0x2c')](util[_0xa162('0x16')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x5d2324,_0x514054),{'type':dbH[_0xa162('0x29')][_0xa162('0x2a')]['SELECT']}));}}}else{_0x5a6757[_0xa162('0x11')](dbH[_0xa162('0x29')][_0xa162('0x2c')](QUERY,{'type':dbH[_0xa162('0x29')]['QueryTypes']['SELECT']}));}var _0x374e38=path[_0xa162('0x2d')](PATH);var _0x5687b5=path['basename'](PATH,_0xa162('0x2e'));var _0x5ed878=_0x265fae[_0xa162('0x24')]&&_0x5a6757[_0xa162('0xf')]>0x1;var _0x5445b4=[];if(!fs[_0xa162('0x2f')](path[_0xa162('0x30')](_0x374e38,_0x5687b5))&&_0x5ed878){fs[_0xa162('0x31')](path[_0xa162('0x30')](_0x374e38,_0x5687b5));}return BPromise[_0xa162('0x32')](_0x5a6757,function(_0x59f570){_0x5445b4['push'](_0x59f570);})[_0xa162('0x26')](function(){var _0x4447d8=[];for(var _0x180964=0x0;_0x180964<_0x5445b4[_0xa162('0xf')];_0x180964+=0x1){var _0x5a09e0=_0x5445b4[_0x180964];var _0x37b02f=createTables(_[_0xa162('0x33')](_0x5a09e0));var _0x22b76c;var _0xb5d291=getPDFDocDefinition(_0x37b02f);var _0x20970f=getPDFPrinter();var _0x3a6833=_0x20970f[_0xa162('0x34')](_0xb5d291);if(_0x5ed878){_0x22b76c=path[_0xa162('0x30')](_0x374e38,_0x5687b5,util[_0xa162('0x16')](_0xa162('0x35'),_0x5687b5,_0x180964,_0xa162('0x36')));}else{_0x22b76c=path[_0xa162('0x30')](_0x374e38,util['format'](_0xa162('0x37'),_0x5687b5,_0xa162('0x36')));}_0x4447d8[_0xa162('0x11')](writePDFDocument(_0x3a6833,_0x22b76c));}return Promise[_0xa162('0x38')](_0x4447d8);})[_0xa162('0x26')](function(){if(_0x5ed878){return new Promise(function(_0x3fb603){zipdir(path[_0xa162('0x30')](_0x374e38,_0x5687b5),{'saveTo':path[_0xa162('0x30')](_0x374e38,util['format'](_0xa162('0x37'),_0x5687b5,_0xa162('0x39')))},function(){rimraf(path[_0xa162('0x30')](_0x374e38,_0x5687b5),function(){});_0x3fb603(_0xa162('0x3a'));});});}})[_0xa162('0x26')](function(){if(!_0x5ed878)return;rimraf(path[_0xa162('0x30')](_0x374e38,_0x5687b5),function(){});})['then'](function(){logger[_0xa162('0x3b')](util['format'](_0xa162('0x3c'),EXTRACTED_REPORT_ID,_0xa162('0x3d')));return analyticExtractedReport(_0xa162('0x3e'),_0x5ed878?util[_0xa162('0x16')](_0xa162('0x37'),_0x5687b5,_0x5ed878?_0xa162('0x39'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xa162('0x3b')](util[_0xa162('0x16')](_0xa162('0x3f'),EXTRACTED_REPORT_ID,_0xa162('0x3d')));return db[_0xa162('0x9')][_0xa162('0x40')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xa162('0x26')](function(_0x56ca9e){EXTRACTED_REPORT=_0x56ca9e;return dbH[_0xa162('0x29')][_0xa162('0x2c')](util[_0xa162('0x16')](_0xa162('0x41'),QUERY),{'type':dbH['sequelize'][_0xa162('0x2a')]['SELECT']});})[_0xa162('0x26')](extractReport)[_0xa162('0x42')](function(_0x33555b){logger[_0xa162('0x3b')](util[_0xa162('0x16')]('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa162('0x3d')),util['inspect'](_0x33555b,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xa162('0x43'));})[_0xa162('0x44')](function(){process[_0xa162('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x3ea2c3=new PdfPrinter({'Arial':{'normal':__dirname+_0xa162('0x46'),'bold':__dirname+_0xa162('0x47'),'italics':__dirname+'/fonts/arial-italic.ttf','bolditalics':__dirname+_0xa162('0x48')}});return _0x3ea2c3;}function getPDFDocDefinitionFromHTML(_0x4d7360,_0x26ed16){var _0x39054f=util[_0xa162('0x16')](_0xa162('0x49'),_0x26ed16[_0xa162('0x4a')],_0x26ed16['interactionId']);var _0x4f6119=moment()[_0xa162('0x16')]('YYYY-MM-DD')['toString']();var _0x5bd49a=htmlToPdfmake(_0x4d7360,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5bd49a],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0xa162('0x4b'),'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':_0xa162('0x4b')}},'header':function(){return[{'text':_0xa162('0x4c'),'style':_0xa162('0x18')}];},'footer':function(_0x5b73fa,_0x58d038){return[{'text':util[_0xa162('0x16')]('\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s',_0x39054f,_0x5b73fa,_0x58d038,_0x4f6119),'style':_0xa162('0x1e')}];}};}function writePDFDocument(_0x5582a2,_0xd1b938){return new Promise(function(_0x57cf49,_0x27bb5a){var _0x52b0b1=_0x5582a2[_0xa162('0x4d')](fs[_0xa162('0x4e')](_0xd1b938));_0x52b0b1['on'](_0xa162('0x4f'),function(){_0x57cf49(_0xa162('0x4f'));});_0x52b0b1['on'](_0xa162('0x50'),function(_0x4f7230){_0x27bb5a(_0x4f7230);});_0x5582a2[_0xa162('0x51')]();});}exports[_0xa162('0x52')]=function(_0x49eaf2,_0x2524f9){var _0x2d120e=getPDFPrinter();var _0x5267ed=getPDFDocDefinitionFromHTML(_0x49eaf2,_0x2524f9);var _0x3b5384=_0x2d120e[_0xa162('0x34')](_0x5267ed);return writePDFDocument(_0x3b5384,_0x2524f9[_0xa162('0x53')])['catch'](function(_0x35d453){throw _0x35d453;});}; \ No newline at end of file +var _0x8123=['zip\x20finished','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','AnalyticExtractedReport','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','exit','/fonts/arial-italic.ttf','/fonts/arial-bold-italic.ttf','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','pipe','createWriteStream','finish','error','end','createPdfFromHTML','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','jsdom','JSDOM','window','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','update','map','pick','toString','fill','length','body','push','concat','chunk','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','header','pageBreak','margin','\x20/\x20','footer','black','num','Empty','Setting','split','then','splitSizePdf','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.pdf','existsSync','join','each','flatten','createPdfKitDocument','%s.%s','pdf','zip'];(function(_0x29b2cc,_0x219780){var _0x347dac=function(_0x239b87){while(--_0x239b87){_0x29b2cc['push'](_0x29b2cc['shift']());}};_0x347dac(++_0x219780);}(_0x8123,0xca));var _0x3812=function(_0x5ac84c,_0x287781){_0x5ac84c=_0x5ac84c-0x0;var _0x3c53d2=_0x8123[_0x5ac84c];return _0x3c53d2;};'use strict';var _=require(_0x3812('0x0'));var fs=require('fs');var util=require(_0x3812('0x1'));var path=require(_0x3812('0x2'));var moment=require(_0x3812('0x3'));var htmlToPdfmake=require(_0x3812('0x4'));var PdfPrinter=require(_0x3812('0x5'));var zipdir=require(_0x3812('0x6'));var rimraf=require('rimraf');var JSDOM=require(_0x3812('0x7'))[_0x3812('0x8')];var window=new JSDOM('')[_0x3812('0x9')];var BPromise=require(_0x3812('0xa'));var db=require(_0x3812('0xb'))['db'];var dbH=require(_0x3812('0xb'))[_0x3812('0xc')];var logger=require(_0x3812('0xd'))(_0x3812('0xe'));var EXTRACTED_REPORT_ID=Number(process[_0x3812('0xf')][0x2]);var QUERY=process[_0x3812('0xf')][0x3];var PATH=process[_0x3812('0xf')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x3812('0x10');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x2527f4,_0x5046b6){var _0x135437={'status':_0x2527f4};var _0x61caa8={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5046b6){_0x135437[_0x3812('0x11')]=_0x5046b6;}return db['AnalyticExtractedReport'][_0x3812('0x12')](_0x135437,_0x61caa8);}function getHeaders(_0x1d4cb6){return _[_0x3812('0x13')](_0x1d4cb6,function(_0x231f63){return{'text':_0x231f63,'style':'tableHeader'};});}function getRows(_0x1b9e60,_0x3a9284){return _[_0x3812('0x13')](_0x3a9284,function(_0x3c9e13){return _(_0x3c9e13)[_0x3812('0x14')](_0x1b9e60)[_0x3812('0x13')](function(_0x39a4b7){return _0x39a4b7?_[_0x3812('0x15')](_0x39a4b7):'';})['value']();});}function createTable(_0x4a92bd,_0x2ecf31){var _0x514a84={'widths':_[_0x3812('0x16')](Array(_0x4a92bd[_0x3812('0x17')]),0x91),'heights':function(_0x4f329f){return _0x4f329f===0x0?'auto':0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x49fff9=getHeaders(_0x4a92bd);_0x514a84[_0x3812('0x18')][_0x3812('0x19')](_0x49fff9);var _0x1665a5=getRows(_0x4a92bd,_0x2ecf31);_0x514a84['body']=_0x514a84[_0x3812('0x18')][_0x3812('0x1a')](_0x1665a5);return _0x514a84;}function createTables(_0x427167){var _0x3f5847=[];var _0xca1ee8=_[_0x3812('0x1b')](Object['keys'](_0x427167[0x0]),0x5);_0xca1ee8[_0x3812('0x1c')](function(_0x215091){_0x3f5847[_0x3812('0x19')](createTable(_0x215091,_0x427167));});return _0x3f5847;}function getPDFDocDefinition(_0x29300c){var _0x3f00b1=util[_0x3812('0x1d')](_0x3812('0x1e'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0x3812('0x1f')])[_0x3812('0x1d')](FORMAT),moment(EXTRACTED_REPORT[_0x3812('0x20')])['format'](FORMAT));var _0x3075a6=[];for(var _0x2fd0ff=0x0;_0x2fd0ff<_0x29300c[_0x3812('0x17')];_0x2fd0ff++){var _0x45db63=[];if(_0x2fd0ff===0x0){_0x45db63['push']({'text':_0x3f00b1,'style':_0x3812('0x21')});}var _0x561742={'table':_0x29300c[_0x2fd0ff]};if(_0x2fd0ff>0x0){_0x561742[_0x3812('0x22')]='before';_0x561742[_0x3812('0x23')]=[0x0,0x46,0x0,0x0];}_0x45db63[_0x3812('0x19')](_0x561742);_0x3075a6['push'](_0x45db63);}return{'pageSize':'A4','pageOrientation':'landscape','content':_0x3075a6,'footer':function(_0x39b1d0,_0x404f6c){return{'text':_0x39b1d0['toString']()+_0x3812('0x24')+_0x404f6c,'style':_0x3812('0x25')};},'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x3812('0x26')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x42a6e4){var _0x33d76b=0x1388;var _0xca445d;if(!_0x42a6e4[0x0][_0x3812('0x27')]){return analyticExtractedReport(_0x3812('0x28'));}return db[_0x3812('0x29')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x3812('0x2a'),'splitSizePdf']})[_0x3812('0x2b')](function(_0xc22907){if(_0xc22907){_0xca445d=_0xc22907;_0x33d76b=_0xca445d[_0x3812('0x2c')]||0x3e8;}})[_0x3812('0x2b')](function(){var _0x514dd9=[];var _0x202801=0x0;if(_0xca445d['split']){if(_0x42a6e4&&_0x42a6e4[_0x3812('0x17')]){var _0x7739f2=_['range'](_0x42a6e4[0x0][_0x3812('0x27')]/_0x33d76b);var _0x2dc8e1=Number[_0x3812('0x2d')](_0x42a6e4[0x0][_0x3812('0x27')]/_0x33d76b)?_0x42a6e4[0x0]['num']%_0x33d76b:0x0;_0x7739f2[_0x3812('0x1c')](function(_0xb2ac69){if(_0xb2ac69>0x0){_0x202801+=_0x33d76b;}_0x514dd9['push'](dbH[_0x3812('0x2e')][_0x3812('0x2f')](util['format'](_0x3812('0x30'),QUERY,_0x33d76b,_0x202801),{'type':dbH[_0x3812('0x2e')][_0x3812('0x31')][_0x3812('0x32')]}));});if(_0x2dc8e1>0x0){_0x202801+=_0x33d76b;_0x514dd9[_0x3812('0x19')](dbH[_0x3812('0x2e')]['query'](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x2dc8e1,_0x202801),{'type':dbH[_0x3812('0x2e')][_0x3812('0x31')][_0x3812('0x32')]}));}}}else{_0x514dd9['push'](dbH[_0x3812('0x2e')][_0x3812('0x2f')](QUERY,{'type':dbH[_0x3812('0x2e')]['QueryTypes']['SELECT']}));}var _0x508801=path[_0x3812('0x33')](PATH);var _0x63d5c1=path[_0x3812('0x34')](PATH,_0x3812('0x35'));var _0x3b6615=_0xca445d[_0x3812('0x2a')]&&_0x514dd9[_0x3812('0x17')]>0x1;var _0x1d4b84=[];if(!fs[_0x3812('0x36')](path[_0x3812('0x37')](_0x508801,_0x63d5c1))&&_0x3b6615){fs['mkdirSync'](path[_0x3812('0x37')](_0x508801,_0x63d5c1));}return BPromise[_0x3812('0x38')](_0x514dd9,function(_0xc7fec){_0x1d4b84['push'](_0xc7fec);})[_0x3812('0x2b')](function(){var _0x2c7171=[];for(var _0x46e457=0x0;_0x46e457<_0x1d4b84[_0x3812('0x17')];_0x46e457+=0x1){var _0x157954=_0x1d4b84[_0x46e457];var _0x476a3e=createTables(_[_0x3812('0x39')](_0x157954));var _0x3a7203;var _0x4f235b=getPDFDocDefinition(_0x476a3e);var _0x5d8c69=getPDFPrinter();var _0x1fc47a=_0x5d8c69[_0x3812('0x3a')](_0x4f235b);if(_0x3b6615){_0x3a7203=path[_0x3812('0x37')](_0x508801,_0x63d5c1,util['format']('%s%d.%s',_0x63d5c1,_0x46e457,'pdf'));}else{_0x3a7203=path[_0x3812('0x37')](_0x508801,util[_0x3812('0x1d')](_0x3812('0x3b'),_0x63d5c1,_0x3812('0x3c')));}_0x2c7171['push'](writePDFDocument(_0x1fc47a,_0x3a7203));}return Promise['all'](_0x2c7171);})[_0x3812('0x2b')](function(){if(_0x3b6615){return new Promise(function(_0x414d99){zipdir(path['join'](_0x508801,_0x63d5c1),{'saveTo':path['join'](_0x508801,util[_0x3812('0x1d')](_0x3812('0x3b'),_0x63d5c1,_0x3812('0x3d')))},function(){rimraf(path[_0x3812('0x37')](_0x508801,_0x63d5c1),function(){});_0x414d99(_0x3812('0x3e'));});});}})['then'](function(){if(!_0x3b6615)return;rimraf(path[_0x3812('0x37')](_0x508801,_0x63d5c1),function(){});})[_0x3812('0x2b')](function(){logger[_0x3812('0x3f')](util[_0x3812('0x1d')](_0x3812('0x40'),EXTRACTED_REPORT_ID,_0x3812('0x41')));return analyticExtractedReport(_0x3812('0x42'),_0x3b6615?util[_0x3812('0x1d')](_0x3812('0x3b'),_0x63d5c1,_0x3b6615?_0x3812('0x3d'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x3812('0x3f')](util['format'](_0x3812('0x43'),EXTRACTED_REPORT_ID,_0x3812('0x41')));return db[_0x3812('0x44')]['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x3812('0x2b')](function(_0x5e2c39){EXTRACTED_REPORT=_0x5e2c39;return dbH[_0x3812('0x2e')]['query'](util[_0x3812('0x1d')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x3812('0x2e')]['QueryTypes']['SELECT']});})[_0x3812('0x2b')](extractReport)[_0x3812('0x45')](function(_0x59701a){logger['info'](util['format'](_0x3812('0x46'),EXTRACTED_REPORT_ID,'PDF'),util[_0x3812('0x47')](_0x59701a,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x3812('0x48'));})['finally'](function(){process[_0x3812('0x49')](EXIT_CODE);});}main();function getPDFPrinter(){var _0xfcaed1=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+'/fonts/arial-bold.ttf','italics':__dirname+_0x3812('0x4a'),'bolditalics':__dirname+_0x3812('0x4b')}});return _0xfcaed1;}function getPDFDocDefinitionFromHTML(_0x23466f,_0x17ad79){var _0x1b3b6b=util[_0x3812('0x1d')]('%s\x20#%d',_0x17ad79[_0x3812('0x4c')],_0x17ad79[_0x3812('0x4d')]);var _0xb5a710=moment()[_0x3812('0x1d')](_0x3812('0x4e'))[_0x3812('0x15')]();var _0x5ea80c=htmlToPdfmake(_0x23466f,{'window':window,'tableAutoSize':!![]});return{'content':[_0x5ea80c],'defaultStyle':{'font':'Arial'},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x3812('0x4f'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x3812('0x4f'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x3812('0x4f')}},'header':function(){return[{'text':_0x3812('0x50'),'style':_0x3812('0x21')}];},'footer':function(_0xe3c65b,_0x26c50d){return[{'text':util[_0x3812('0x1d')](_0x3812('0x51'),_0x1b3b6b,_0xe3c65b,_0x26c50d,_0xb5a710),'style':_0x3812('0x25')}];}};}function writePDFDocument(_0x9cc00c,_0x1a7e27){return new Promise(function(_0x32e5db,_0x22c682){var _0x5c1be6=_0x9cc00c[_0x3812('0x52')](fs[_0x3812('0x53')](_0x1a7e27));_0x5c1be6['on'](_0x3812('0x54'),function(){_0x32e5db('finish');});_0x5c1be6['on'](_0x3812('0x55'),function(_0x377645){_0x22c682(_0x377645);});_0x9cc00c[_0x3812('0x56')]();});}exports[_0x3812('0x57')]=function(_0x297ca4,_0x11825e){var _0x3ffb20=getPDFPrinter();var _0x5c813d=getPDFDocDefinitionFromHTML(_0x297ca4,_0x11825e);var _0x1c6b7b=_0x3ffb20[_0x3812('0x3a')](_0x5c813d);return writePDFDocument(_0x1c6b7b,_0x11825e[_0x3812('0x2')])['catch'](function(_0x3977b4){throw _0x3977b4;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 4ea8ca7..183be50 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 _0x0aab=['SELECT','Empty','num','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','push','basename','length','existsSync','join','mkdirSync','each','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','exit','util','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','split','splitSizeXlsx','then','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes'];(function(_0x589fa0,_0x54c971){var _0x3a8e3a=function(_0x4b3050){while(--_0x4b3050){_0x589fa0['push'](_0x589fa0['shift']());}};_0x3a8e3a(++_0x54c971);}(_0x0aab,0x169));var _0xb0aa=function(_0x2fa1c6,_0x4a5b8d){_0x2fa1c6=_0x2fa1c6-0x0;var _0x5f3257=_0x0aab[_0x2fa1c6];return _0x5f3257;};'use strict';var util=require(_0xb0aa('0x0'));var path=require('path');var _=require('lodash');var fs=require('fs');var json2xls=require(_0xb0aa('0x1'));var BPromise=require(_0xb0aa('0x2'));var zipdir=require(_0xb0aa('0x3'));var rimraf=require(_0xb0aa('0x4'));var db=require(_0xb0aa('0x5'))['db'];var dbH=require(_0xb0aa('0x5'))['dbH'];var logger=require(_0xb0aa('0x6'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb0aa('0x7')][0x2]);var QUERY=process[_0xb0aa('0x7')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c1b16,_0x1e180e){var _0x388a53={'status':_0x4c1b16};var _0x53dd65={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1e180e){_0x388a53['savename']=_0x1e180e;}return db[_0xb0aa('0x8')][_0xb0aa('0x9')](_0x388a53,_0x53dd65);}function main(){var _0x7c1094=0x1388;var _0x26a9eb;logger[_0xb0aa('0xa')](util[_0xb0aa('0xb')](_0xb0aa('0xc'),EXTRACTED_REPORT_ID,_0xb0aa('0xd')));return db[_0xb0aa('0xe')][_0xb0aa('0xf')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb0aa('0x10'),_0xb0aa('0x11')]})['then'](function(_0x2b5b00){if(_0x2b5b00){_0x26a9eb=_0x2b5b00;_0x7c1094=_0x26a9eb[_0xb0aa('0x11')]||0x1388;}})[_0xb0aa('0x12')](function(){return dbH['sequelize'][_0xb0aa('0x13')](util[_0xb0aa('0xb')](_0xb0aa('0x14'),QUERY),{'type':dbH[_0xb0aa('0x15')][_0xb0aa('0x16')][_0xb0aa('0x17')]});})[_0xb0aa('0x12')](function(_0x3fb716){if(!_0x3fb716[0x0]['num']){return analyticExtractedReport(_0xb0aa('0x18'));}var _0xdd3d35=[];var _0x387aea=0x0;if(_0x26a9eb[_0xb0aa('0x10')]){if(_0x3fb716&&_0x3fb716['length']){var _0x164693=_['range'](_0x3fb716[0x0][_0xb0aa('0x19')]/_0x7c1094);var _0x259445=Number[_0xb0aa('0x1a')](_0x3fb716[0x0][_0xb0aa('0x19')]/_0x7c1094)?_0x3fb716[0x0][_0xb0aa('0x19')]%_0x7c1094:0x0;_0x164693[_0xb0aa('0x1b')](function(_0x52a725){if(_0x52a725>0x0){_0x387aea+=_0x7c1094;}_0xdd3d35['push'](dbH[_0xb0aa('0x15')][_0xb0aa('0x13')](util[_0xb0aa('0xb')](_0xb0aa('0x1c'),QUERY,_0x7c1094,_0x387aea),{'type':dbH['sequelize']['QueryTypes'][_0xb0aa('0x17')]}));});if(_0x259445>0x0){_0x387aea+=_0x7c1094;_0xdd3d35[_0xb0aa('0x1d')](dbH['sequelize']['query'](util[_0xb0aa('0xb')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x259445,_0x387aea),{'type':dbH[_0xb0aa('0x15')][_0xb0aa('0x16')][_0xb0aa('0x17')]}));}}}else{_0xdd3d35[_0xb0aa('0x1d')](dbH[_0xb0aa('0x15')][_0xb0aa('0x13')](QUERY,{'type':dbH['sequelize'][_0xb0aa('0x16')][_0xb0aa('0x17')]}));}var _0x45e747=path['dirname'](PATH);var _0x3e1790=path[_0xb0aa('0x1e')](PATH,'.xlsx');var _0x12e178=_0x26a9eb[_0xb0aa('0x10')]&&_0xdd3d35[_0xb0aa('0x1f')]>0x1;var _0x286095=[];if(!fs[_0xb0aa('0x20')](path[_0xb0aa('0x21')](_0x45e747,_0x3e1790))&&_0x12e178){fs[_0xb0aa('0x22')](path[_0xb0aa('0x21')](_0x45e747,_0x3e1790));}return BPromise[_0xb0aa('0x23')](_0xdd3d35,function(_0x17be25){_0x286095[_0xb0aa('0x1d')](_0x17be25);})[_0xb0aa('0x12')](function(){for(var _0x19f559=0x0;_0x19f559<_0x286095['length'];_0x19f559+=0x1){var _0x327183;var _0x3b4ad9=_0x286095[_0x19f559];if(_0x12e178){_0x327183=path[_0xb0aa('0x21')](_0x45e747,_0x3e1790,util['format']('%s%d.%s',_0x3e1790,_0x19f559,_0xb0aa('0x24')));}else{_0x327183=path[_0xb0aa('0x21')](_0x45e747,util[_0xb0aa('0xb')]('%s.%s',_0x3e1790,_0xb0aa('0x24')));}fs[_0xb0aa('0x25')](_0x327183,json2xls(_0x3b4ad9),_0xb0aa('0x26'));}})[_0xb0aa('0x12')](function(){if(_0x12e178){return new Promise(function(_0xbe04ec){zipdir(path['join'](_0x45e747,_0x3e1790),{'saveTo':path[_0xb0aa('0x21')](_0x45e747,util[_0xb0aa('0xb')](_0xb0aa('0x27'),_0x3e1790,_0xb0aa('0x28')))},function(_0x504b4e,_0x48c3ec){rimraf(path[_0xb0aa('0x21')](_0x45e747,_0x3e1790),function(){});_0xbe04ec(_0xb0aa('0x29'));});});}})[_0xb0aa('0x12')](function(){logger[_0xb0aa('0xa')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb0aa('0xd')));return analyticExtractedReport(_0xb0aa('0x2a'),_0x12e178?util[_0xb0aa('0xb')](_0xb0aa('0x27'),_0x3e1790,_0x12e178?_0xb0aa('0x28'):_0xb0aa('0x24')):null);});})[_0xb0aa('0x2b')](function(_0x2e0e21){logger[_0xb0aa('0xa')](util['format'](_0xb0aa('0x2c'),EXTRACTED_REPORT_ID,_0xb0aa('0xd')),util['inspect'](_0x2e0e21,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xb0aa('0x2d'));})[_0xb0aa('0x2e')](function(){process[_0xb0aa('0x2f')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x0b95=['then','query','format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','num','Empty','range','forEach','push','SELECT','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','.xlsx','join','each','length','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','path','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','argv','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeXlsx'];(function(_0x501732,_0x53aaa0){var _0x588ae8=function(_0x2ad1fd){while(--_0x2ad1fd){_0x501732['push'](_0x501732['shift']());}};_0x588ae8(++_0x53aaa0);}(_0x0b95,0x198));var _0x50b9=function(_0x69dffe,_0x173eae){_0x69dffe=_0x69dffe-0x0;var _0x4b042a=_0x0b95[_0x69dffe];return _0x4b042a;};'use strict';var util=require('util');var path=require(_0x50b9('0x0'));var _=require(_0x50b9('0x1'));var fs=require('fs');var json2xls=require(_0x50b9('0x2'));var BPromise=require(_0x50b9('0x3'));var zipdir=require(_0x50b9('0x4'));var rimraf=require(_0x50b9('0x5'));var db=require(_0x50b9('0x6'))['db'];var dbH=require(_0x50b9('0x6'))['dbH'];var logger=require('../../config/logger')('analytics');var EXTRACTED_REPORT_ID=Number(process[_0x50b9('0x7')][0x2]);var QUERY=process[_0x50b9('0x7')][0x3];var PATH=process[_0x50b9('0x7')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x351e74,_0x4ffdd8){var _0x2b5fbb={'status':_0x351e74};var _0x57c525={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x4ffdd8){_0x2b5fbb['savename']=_0x4ffdd8;}return db['AnalyticExtractedReport'][_0x50b9('0x8')](_0x2b5fbb,_0x57c525);}function main(){var _0x48fab8=0x1388;var _0x3bcab3;logger[_0x50b9('0x9')](util['format'](_0x50b9('0xa'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x50b9('0xb')][_0x50b9('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x50b9('0xd'),_0x50b9('0xe')]})[_0x50b9('0xf')](function(_0x2fc694){if(_0x2fc694){_0x3bcab3=_0x2fc694;_0x48fab8=_0x3bcab3[_0x50b9('0xe')]||0x1388;}})[_0x50b9('0xf')](function(){return dbH['sequelize'][_0x50b9('0x10')](util[_0x50b9('0x11')](_0x50b9('0x12'),QUERY),{'type':dbH[_0x50b9('0x13')][_0x50b9('0x14')]['SELECT']});})[_0x50b9('0xf')](function(_0x5c8f55){if(!_0x5c8f55[0x0][_0x50b9('0x15')]){return analyticExtractedReport(_0x50b9('0x16'));}var _0x51568c=[];var _0x5cc064=0x0;if(_0x3bcab3[_0x50b9('0xd')]){if(_0x5c8f55&&_0x5c8f55['length']){var _0x4e6db5=_[_0x50b9('0x17')](_0x5c8f55[0x0][_0x50b9('0x15')]/_0x48fab8);var _0x2cf6ed=Number['isInteger'](_0x5c8f55[0x0][_0x50b9('0x15')]/_0x48fab8)?_0x5c8f55[0x0]['num']%_0x48fab8:0x0;_0x4e6db5[_0x50b9('0x18')](function(_0x4c9521){if(_0x4c9521>0x0){_0x5cc064+=_0x48fab8;}_0x51568c[_0x50b9('0x19')](dbH[_0x50b9('0x13')][_0x50b9('0x10')](util[_0x50b9('0x11')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x48fab8,_0x5cc064),{'type':dbH[_0x50b9('0x13')][_0x50b9('0x14')][_0x50b9('0x1a')]}));});if(_0x2cf6ed>0x0){_0x5cc064+=_0x48fab8;_0x51568c[_0x50b9('0x19')](dbH[_0x50b9('0x13')][_0x50b9('0x10')](util[_0x50b9('0x11')](_0x50b9('0x1b'),QUERY,_0x2cf6ed,_0x5cc064),{'type':dbH['sequelize'][_0x50b9('0x14')][_0x50b9('0x1a')]}));}}}else{_0x51568c['push'](dbH[_0x50b9('0x13')][_0x50b9('0x10')](QUERY,{'type':dbH[_0x50b9('0x13')][_0x50b9('0x14')]['SELECT']}));}var _0x3732b9=path[_0x50b9('0x1c')](PATH);var _0x216bd2=path['basename'](PATH,_0x50b9('0x1d'));var _0x610d45=_0x3bcab3[_0x50b9('0xd')]&&_0x51568c['length']>0x1;var _0x37ff93=[];if(!fs['existsSync'](path['join'](_0x3732b9,_0x216bd2))&&_0x610d45){fs['mkdirSync'](path[_0x50b9('0x1e')](_0x3732b9,_0x216bd2));}return BPromise[_0x50b9('0x1f')](_0x51568c,function(_0x5bd2b0){_0x37ff93[_0x50b9('0x19')](_0x5bd2b0);})['then'](function(){for(var _0x355cfe=0x0;_0x355cfe<_0x37ff93[_0x50b9('0x20')];_0x355cfe+=0x1){var _0xa75ce;var _0x22de5f=_0x37ff93[_0x355cfe];if(_0x610d45){_0xa75ce=path['join'](_0x3732b9,_0x216bd2,util[_0x50b9('0x11')](_0x50b9('0x21'),_0x216bd2,_0x355cfe,_0x50b9('0x22')));}else{_0xa75ce=path[_0x50b9('0x1e')](_0x3732b9,util[_0x50b9('0x11')]('%s.%s',_0x216bd2,_0x50b9('0x22')));}fs[_0x50b9('0x23')](_0xa75ce,json2xls(_0x22de5f),_0x50b9('0x24'));}})['then'](function(){if(_0x610d45){return new Promise(function(_0x262af4){zipdir(path[_0x50b9('0x1e')](_0x3732b9,_0x216bd2),{'saveTo':path[_0x50b9('0x1e')](_0x3732b9,util[_0x50b9('0x11')](_0x50b9('0x25'),_0x216bd2,_0x50b9('0x26')))},function(_0x27d2e9,_0x1549e5){rimraf(path[_0x50b9('0x1e')](_0x3732b9,_0x216bd2),function(){});_0x262af4(_0x50b9('0x27'));});});}})[_0x50b9('0xf')](function(){logger[_0x50b9('0x9')](util[_0x50b9('0x11')](_0x50b9('0x28'),EXTRACTED_REPORT_ID,_0x50b9('0x29')));return analyticExtractedReport(_0x50b9('0x2a'),_0x610d45?util[_0x50b9('0x11')](_0x50b9('0x25'),_0x216bd2,_0x610d45?_0x50b9('0x26'):'xlsx'):null);});})[_0x50b9('0x2b')](function(_0x301182){logger[_0x50b9('0x9')](util['format'](_0x50b9('0x2c'),EXTRACTED_REPORT_ID,_0x50b9('0x29')),util[_0x50b9('0x2d')](_0x301182,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x50b9('0x2e')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 8037222..3788db5 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 _0xc84b=['createdAt','updatedAt','interval','*,*,*,*','intervals','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','bulkCreate','catch','error','rewrite','lodash','models','Interval','findAll','then','IntervalId','VoiceExtension','map','filter','groupBy','exten','queue','hasOwnProperty','extensions','extension','find','push','Set','CDR(type)=%s','type','context','priority','VoiceExtensionId','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','XCALLY-MOTION-ANSWER=0','length','toLowerCase'];(function(_0x4c9b99,_0x70f5dc){var _0x52186d=function(_0x44c159){while(--_0x44c159){_0x4c9b99['push'](_0x4c9b99['shift']());}};_0x52186d(++_0x70f5dc);}(_0xc84b,0x1b3));var _0xbc84=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xc84b[_0x2dadb9];return _0x2f0097;};'use strict';var _=require(_0xbc84('0x0'));var util=require('util');function rewrite(_0x3af01b,_0x27a20d){var _0x2a57e2=this;return _0x3af01b[_0xbc84('0x1')][_0xbc84('0x2')][_0xbc84('0x3')]({'raw':!![]})[_0xbc84('0x4')](function(_0x19e836){_0x2a57e2['intervals']=_0x19e836;return _0x3af01b['models']['VoiceExtension'][_0xbc84('0x3')]({'where':{'IntervalId':_0x27a20d[_0xbc84('0x5')]},'raw':!![]});})['then'](function(_0x297fc5){return _0x3af01b['models'][_0xbc84('0x6')][_0xbc84('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0xbc84('0x7')](_0x297fc5,'exten'))}},'order':[{'raw':'CAST(priority\x20AS\x20UNSIGNED)'}],'raw':!![]});})[_0xbc84('0x4')](function(_0x5351e0){var _0x49fe6b=_[_0xbc84('0x8')](_0x5351e0,{'priority':'1'});var _0x36afba=_[_0xbc84('0x8')](_0x5351e0,{'isApp':0x1});var _0x25948c=_[_0xbc84('0x9')](_0x36afba,_0xbc84('0xa'));var _0x5dad27=[_0xbc84('0xb'),'playback'];var _0x2a0f63=[];var _0x29e511=[];for(var _0xa49c18 in _0x25948c){if(_0x25948c[_0xbc84('0xc')](_0xa49c18)){_0x2a57e2['priority']=0x2;_0x2a57e2[_0xbc84('0xd')]=[];_0x2a57e2[_0xbc84('0xe')]=_[_0xbc84('0xf')](_0x49fe6b,{'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')]});_0x2a57e2['extensions'][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x11'),'appdata':util['format'](_0xbc84('0x12'),_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')]),'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});if(_0x25948c[_0xa49c18][0x0]['type']==='inbound'){_0x2a57e2[_0xbc84('0xd')][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':'CDR(routeid)='+_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')],'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});}else if(_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')]==='outbound'){if(_0x2a57e2[_0xbc84('0xe')]){_0x2a57e2['extensions']['push']({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x17')+(_0x2a57e2[_0xbc84('0xe')][_0xbc84('0x18')]?_0xbc84('0x19')+_0x2a57e2[_0xbc84('0xe')][_0xbc84('0x18')]+'}':_0xbc84('0x1a')),'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});}_0x2a57e2['extensions']['push']({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x1b')+_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')],'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});var _0x4aa4a2=_0x2a57e2[_0xbc84('0x15')]++;_0x2a57e2[_0xbc84('0xd')]['push']({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x1c'),'appdata':_0xbc84('0x1d')+(_0x4aa4a2+0x2)+_0xbc84('0x1e')+(_0x4aa4a2+0x1)+')','context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0]['exten'],'priority':_0x4aa4a2,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});if(_0x2a57e2[_0xbc84('0xe')]){_0x2a57e2[_0xbc84('0xd')]['push']({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x11'),'appdata':_0x2a57e2['extension']['cutdigits']?_0xbc84('0x1f')+_0x2a57e2[_0xbc84('0xe')]['cutdigits']+'}':_0xbc84('0x20'),'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2['priority']++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});}_0x2a57e2[_0xbc84('0xd')]['push']({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':'outboundrouteid='+_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')],'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0]['exten'],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});if(_0x2a57e2[_0xbc84('0xe')]&&_0x2a57e2['extension'][_0xbc84('0xc')](_0xbc84('0x21'))&&_0x2a57e2[_0xbc84('0xe')][_0xbc84('0x21')]!==_0xbc84('0x22')){_0x2a57e2['extensions'][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x23'),'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});_0x2a57e2['extensions']['push']({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x24')+_0x2a57e2['extension'][_0xbc84('0x21')]||_0xbc84('0x25'),'context':_0x25948c[_0xa49c18][0x0]['context'],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});}}_0x2a57e2['extensions'][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x26'),'context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});_0x2a57e2['extensions'][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0]['type'],'app':_0xbc84('0x11'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x25948c[_0xa49c18][0x0]['context'],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});_0x2a57e2[_0xbc84('0xd')][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':'MONITOR_OPTIONS=ab','context':_0x25948c[_0xa49c18][0x0][_0xbc84('0x14')],'exten':_0x25948c[_0xa49c18][0x0][_0xbc84('0xa')],'priority':_0x2a57e2[_0xbc84('0x15')]++,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});for(var _0x3403bd=0x0,_0x342a7a=0x0;_0x3403bd<_0x25948c[_0xa49c18][_0xbc84('0x27')];_0x3403bd+=0x1,_0x342a7a=0x0){var _0x438624=_0x25948c[_0xa49c18][_0x3403bd];if(_0x438624['type']){_0x438624['type']=_0x438624['type'][_0xbc84('0x28')]();}var _0x250bc2=[];var _0x4d9398=[];delete _0x438624['id'];delete _0x438624[_0xbc84('0x29')];delete _0x438624[_0xbc84('0x2a')];var _0x189479=_0x438624[_0xbc84('0x2b')]!==_0xbc84('0x2c')?[_0x438624['interval']]:_0x438624[_0xbc84('0x5')]?_[_0xbc84('0x7')](_[_0xbc84('0x8')](_0x2a57e2[_0xbc84('0x2d')],{'IntervalId':_0x438624[_0xbc84('0x5')]}),_0xbc84('0x2b')):[];if(_0x438624[_0xbc84('0xc')]('tag')){if(_0x438624[_0xbc84('0x2e')]&&_0x438624['tag']!=='--'){_0x250bc2[_0xbc84('0x10')]({'type':_0x438624['type'],'app':'Set','appdata':_0xbc84('0x2f')+_0x438624['tag'],'context':_0x438624[_0xbc84('0x14')],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});}}if(_0x438624['type']===_0xbc84('0x30')&&_0x438624[_0xbc84('0xc')](_0xbc84('0x31'))){if(_0x438624[_0xbc84('0x31')]){_0x250bc2[_0xbc84('0x10')]({'type':_0x438624[_0xbc84('0x13')],'app':'ExecIf','appdata':_0xbc84('0x32')+_0x438624[_0xbc84('0x31')]+')','context':_0x438624['context'],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});}else{_0x250bc2['push']({'type':_0x438624[_0xbc84('0x13')],'app':_0xbc84('0x1c'),'appdata':_0xbc84('0x33'),'context':_0x438624[_0xbc84('0x14')],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});}}if(_0x438624[_0xbc84('0xc')](_0xbc84('0x34'))){if(_0x5dad27[_0xbc84('0x35')](_0x438624[_0xbc84('0x36')][_0xbc84('0x28')]())>=0x0&&_0x438624[_0xbc84('0x37')]!==_0xbc84('0x38')){if(_0x438624[_0xbc84('0x34')]){_0x250bc2[_0xbc84('0x10')]({'type':_0x438624[_0xbc84('0x13')],'app':_0xbc84('0x1c'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x438624['context'],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2['priority']+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});_0x250bc2[_0xbc84('0x10')]({'type':_0x438624[_0xbc84('0x13')],'app':_0xbc84('0x11'),'appdata':_0xbc84('0x39'),'context':_0x438624['context'],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});}else{_0x250bc2[_0xbc84('0x10')]({'type':_0x438624[_0xbc84('0x13')],'app':_0xbc84('0x1c'),'appdata':_0xbc84('0x3a'),'context':_0x438624[_0xbc84('0x14')],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479['length']+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});_0x250bc2[_0xbc84('0x10')]({'type':_0x438624[_0xbc84('0x13')],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x438624[_0xbc84('0x14')],'exten':_0x438624[_0xbc84('0xa')],'priority':_0x189479[_0xbc84('0x27')]+_0x2a57e2[_0xbc84('0x15')]+_0x342a7a++,'VoiceExtensionId':_0x438624[_0xbc84('0x16')]});}}}for(var _0x3a85e0=0x0;_0x3a85e0<_0x189479[_0xbc84('0x27')];_0x3a85e0+=0x1){var _0x299498=_0x2a57e2[_0xbc84('0x15')]+_0x189479[_0xbc84('0x27')];var _0x5708c9=_0x3a85e0===_0x189479['length']-0x1?_0x2a57e2[_0xbc84('0x15')]+_0x250bc2['length']+_0x4d9398[_0xbc84('0x27')]+0x2:_0x2a57e2[_0xbc84('0x15')]+_0x3a85e0+0x1;_0x250bc2[_0xbc84('0x3b')](_0x3a85e0,0x0,{'type':_0x438624[_0xbc84('0x13')],'app':_0xbc84('0x3c'),'appdata':_0x189479[_0x3a85e0]+'?'+_0x438624[_0xbc84('0x14')]+',${EXTEN},'+_0x299498+':'+_0x438624[_0xbc84('0x14')]+_0xbc84('0x3d')+_0x5708c9,'exten':_0x438624[_0xbc84('0xa')],'context':_0x438624[_0xbc84('0x14')],'priority':_0x2a57e2[_0xbc84('0x15')]+_0x3a85e0,'VoiceExtensionId':_0x25948c[_0xa49c18][0x0]['VoiceExtensionId']});}_0x438624[_0xbc84('0x15')]=_0x250bc2[_0xbc84('0x27')]?_[_0xbc84('0x3e')](_0x250bc2)['priority']+0x1:_0x2a57e2[_0xbc84('0x15')];_0x2a57e2['priority']=(_0x4d9398[_0xbc84('0x27')]?_[_0xbc84('0x3e')](_0x4d9398)['priority']:_0x438624[_0xbc84('0x15')])+0x1;_0x2a57e2[_0xbc84('0xd')]=_[_0xbc84('0x3f')](_0x2a57e2[_0xbc84('0xd')],_0x250bc2,[_0x438624],_0x4d9398);}_0x2a57e2[_0xbc84('0xd')][_0xbc84('0x10')]({'type':_0x25948c[_0xa49c18][0x0][_0xbc84('0x13')],'app':'Hangup','exten':_0x25948c[_0xa49c18][0x0]['exten'],'context':_0x25948c[_0xa49c18][0x0]['context'],'priority':_0x2a57e2[_0xbc84('0x15')],'VoiceExtensionId':_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]});_0x2a0f63['push'](_0x25948c[_0xa49c18][0x0][_0xbc84('0x16')]);_0x29e511=_[_0xbc84('0x3f')](_0x29e511,_0x2a57e2['extensions']);}}return _0x3af01b['transaction'](function(_0x1dab7e){return _0x3af01b[_0xbc84('0x1')][_0xbc84('0x6')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x2a0f63}},'transaction':_0x1dab7e})[_0xbc84('0x4')](function(_0x459490){return _0x3af01b[_0xbc84('0x1')]['VoiceExtension'][_0xbc84('0x40')](_['sortBy'](_0x29e511,_0xbc84('0x15')),{'transaction':_0x1dab7e});});});})[_0xbc84('0x41')](function(_0x149d7c){console[_0xbc84('0x42')](_0x149d7c);});}exports[_0xbc84('0x43')]=rewrite; \ No newline at end of file +var _0xf7d4=['bulkCreate','sortBy','error','rewrite','util','models','Interval','intervals','IntervalId','then','findAll','uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','exten','queue','playback','priority','extensions','find','push','type','Set','CDR(type)=%s','VoiceExtensionId','CDR(routeid)=','context','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','*,*,*,*','interval','map','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','transaction','VoiceExtension','destroy'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0xf7d4,0x17b));var _0x4f7d=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xf7d4[_0x8c43de];return _0xa6591b;};'use strict';var _=require('lodash');var util=require(_0x4f7d('0x0'));function rewrite(_0x41379b,_0x4ee482){var _0x21866=this;return _0x41379b[_0x4f7d('0x1')][_0x4f7d('0x2')]['findAll']({'raw':!![]})['then'](function(_0x2999cf){_0x21866[_0x4f7d('0x3')]=_0x2999cf;return _0x41379b[_0x4f7d('0x1')]['VoiceExtension']['findAll']({'where':{'IntervalId':_0x4ee482[_0x4f7d('0x4')]},'raw':!![]});})[_0x4f7d('0x5')](function(_0x874da2){return _0x41379b[_0x4f7d('0x1')]['VoiceExtension'][_0x4f7d('0x6')]({'where':{'exten':{'$in':_[_0x4f7d('0x7')](_['map'](_0x874da2,'exten'))}},'order':[{'raw':_0x4f7d('0x8')}],'raw':!![]});})[_0x4f7d('0x5')](function(_0x343549){var _0x8f164=_[_0x4f7d('0x9')](_0x343549,{'priority':'1'});var _0x2c0381=_[_0x4f7d('0x9')](_0x343549,{'isApp':0x1});var _0x367714=_[_0x4f7d('0xa')](_0x2c0381,_0x4f7d('0xb'));var _0x15409e=[_0x4f7d('0xc'),_0x4f7d('0xd')];var _0x526297=[];var _0x5bdaaf=[];for(var _0x168b06 in _0x367714){if(_0x367714['hasOwnProperty'](_0x168b06)){_0x21866[_0x4f7d('0xe')]=0x2;_0x21866[_0x4f7d('0xf')]=[];_0x21866['extension']=_[_0x4f7d('0x10')](_0x8f164,{'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')]});_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':util['format'](_0x4f7d('0x14'),_0x367714[_0x168b06][0x0]['type']),'context':_0x367714[_0x168b06][0x0]['context'],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});if(_0x367714[_0x168b06][0x0][_0x4f7d('0x12')]==='inbound'){_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x16')+_0x367714[_0x168b06][0x0]['VoiceExtensionId'],'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});}else if(_0x367714[_0x168b06][0x0][_0x4f7d('0x12')]==='outbound'){if(_0x21866[_0x4f7d('0x18')]){_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x19')+(_0x21866[_0x4f7d('0x18')][_0x4f7d('0x1a')]?_0x4f7d('0x1b')+_0x21866[_0x4f7d('0x18')][_0x4f7d('0x1a')]+'}':_0x4f7d('0x1c')),'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});}_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0]['type'],'app':_0x4f7d('0x13'),'appdata':'CDR(routeid)='+_0x367714[_0x168b06][0x0][_0x4f7d('0x15')],'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});var _0x202c23=_0x21866['priority']++;_0x21866['extensions'][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0]['type'],'app':_0x4f7d('0x1d'),'appdata':_0x4f7d('0x1e')+(_0x202c23+0x2)+_0x4f7d('0x1f')+(_0x202c23+0x1)+')','context':_0x367714[_0x168b06][0x0]['context'],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x202c23,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});if(_0x21866['extension']){_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x21866['extension'][_0x4f7d('0x1a')]?_0x4f7d('0x20')+_0x21866['extension'][_0x4f7d('0x1a')]+'}':_0x4f7d('0x21'),'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});}_0x21866['extensions'][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x22')+_0x367714[_0x168b06][0x0][_0x4f7d('0x15')],'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0]['exten'],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});if(_0x21866[_0x4f7d('0x18')]&&_0x21866[_0x4f7d('0x18')][_0x4f7d('0x23')](_0x4f7d('0x24'))&&_0x21866[_0x4f7d('0x18')]['recordingFormat']!==_0x4f7d('0x25')){_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x26'),'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x27')+_0x21866[_0x4f7d('0x18')][_0x4f7d('0x24')]||'wav','context':_0x367714[_0x168b06][0x0]['context'],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});}}_0x21866['extensions'][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x28'),'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866[_0x4f7d('0xe')]++,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});_0x21866[_0x4f7d('0xf')]['push']({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x29'),'context':_0x367714[_0x168b06][0x0]['context'],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866['priority']++,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':'Set','appdata':_0x4f7d('0x2a'),'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'priority':_0x21866['priority']++,'VoiceExtensionId':_0x367714[_0x168b06][0x0]['VoiceExtensionId']});for(var _0xf84aa8=0x0,_0x535a0f=0x0;_0xf84aa8<_0x367714[_0x168b06][_0x4f7d('0x2b')];_0xf84aa8+=0x1,_0x535a0f=0x0){var _0x1b5e94=_0x367714[_0x168b06][_0xf84aa8];if(_0x1b5e94[_0x4f7d('0x12')]){_0x1b5e94[_0x4f7d('0x12')]=_0x1b5e94[_0x4f7d('0x12')][_0x4f7d('0x2c')]();}var _0x524e74=[];var _0xe9a2fe=[];delete _0x1b5e94['id'];delete _0x1b5e94['createdAt'];delete _0x1b5e94[_0x4f7d('0x2d')];var _0x11fbb9=_0x1b5e94['interval']!==_0x4f7d('0x2e')?[_0x1b5e94[_0x4f7d('0x2f')]]:_0x1b5e94[_0x4f7d('0x4')]?_[_0x4f7d('0x30')](_[_0x4f7d('0x9')](_0x21866[_0x4f7d('0x3')],{'IntervalId':_0x1b5e94[_0x4f7d('0x4')]}),_0x4f7d('0x2f')):[];if(_0x1b5e94[_0x4f7d('0x23')](_0x4f7d('0x31'))){if(_0x1b5e94[_0x4f7d('0x31')]&&_0x1b5e94[_0x4f7d('0x31')]!=='--'){_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94['type'],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x32')+_0x1b5e94['tag'],'context':_0x1b5e94['context'],'exten':_0x1b5e94[_0x4f7d('0xb')],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});}}if(_0x1b5e94[_0x4f7d('0x12')]===_0x4f7d('0x33')&&_0x1b5e94[_0x4f7d('0x23')]('callerID')){if(_0x1b5e94[_0x4f7d('0x34')]){_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94[_0x4f7d('0x12')],'app':_0x4f7d('0x1d'),'appdata':_0x4f7d('0x35')+_0x1b5e94[_0x4f7d('0x34')]+')','context':_0x1b5e94[_0x4f7d('0x17')],'exten':_0x1b5e94[_0x4f7d('0xb')],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866['priority']+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});}else{_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94[_0x4f7d('0x12')],'app':_0x4f7d('0x1d'),'appdata':_0x4f7d('0x36'),'context':_0x1b5e94[_0x4f7d('0x17')],'exten':_0x1b5e94[_0x4f7d('0xb')],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});}}if(_0x1b5e94[_0x4f7d('0x23')](_0x4f7d('0x37'))){if(_0x15409e[_0x4f7d('0x38')](_0x1b5e94[_0x4f7d('0x39')][_0x4f7d('0x2c')]())>=0x0&&_0x1b5e94[_0x4f7d('0x3a')]!==_0x4f7d('0x3b')){if(_0x1b5e94[_0x4f7d('0x37')]){_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94[_0x4f7d('0x12')],'app':_0x4f7d('0x1d'),'appdata':_0x4f7d('0x3c'),'context':_0x1b5e94[_0x4f7d('0x17')],'exten':_0x1b5e94['exten'],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94[_0x4f7d('0x12')],'app':_0x4f7d('0x13'),'appdata':_0x4f7d('0x3d'),'context':_0x1b5e94['context'],'exten':_0x1b5e94['exten'],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});}else{_0x524e74[_0x4f7d('0x11')]({'type':_0x1b5e94[_0x4f7d('0x12')],'app':_0x4f7d('0x1d'),'appdata':_0x4f7d('0x3e'),'context':_0x1b5e94[_0x4f7d('0x17')],'exten':_0x1b5e94['exten'],'priority':_0x11fbb9['length']+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94[_0x4f7d('0x15')]});_0x524e74['push']({'type':_0x1b5e94[_0x4f7d('0x12')],'app':'Set','appdata':_0x4f7d('0x3f'),'context':_0x1b5e94[_0x4f7d('0x17')],'exten':_0x1b5e94['exten'],'priority':_0x11fbb9[_0x4f7d('0x2b')]+_0x21866[_0x4f7d('0xe')]+_0x535a0f++,'VoiceExtensionId':_0x1b5e94['VoiceExtensionId']});}}}for(var _0x171975=0x0;_0x171975<_0x11fbb9[_0x4f7d('0x2b')];_0x171975+=0x1){var _0x745b07=_0x21866['priority']+_0x11fbb9['length'];var _0x19b1e0=_0x171975===_0x11fbb9[_0x4f7d('0x2b')]-0x1?_0x21866[_0x4f7d('0xe')]+_0x524e74[_0x4f7d('0x2b')]+_0xe9a2fe['length']+0x2:_0x21866[_0x4f7d('0xe')]+_0x171975+0x1;_0x524e74[_0x4f7d('0x40')](_0x171975,0x0,{'type':_0x1b5e94[_0x4f7d('0x12')],'app':'GotoIfTime','appdata':_0x11fbb9[_0x171975]+'?'+_0x1b5e94[_0x4f7d('0x17')]+_0x4f7d('0x41')+_0x745b07+':'+_0x1b5e94[_0x4f7d('0x17')]+_0x4f7d('0x41')+_0x19b1e0,'exten':_0x1b5e94[_0x4f7d('0xb')],'context':_0x1b5e94['context'],'priority':_0x21866[_0x4f7d('0xe')]+_0x171975,'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});}_0x1b5e94[_0x4f7d('0xe')]=_0x524e74[_0x4f7d('0x2b')]?_[_0x4f7d('0x42')](_0x524e74)[_0x4f7d('0xe')]+0x1:_0x21866[_0x4f7d('0xe')];_0x21866['priority']=(_0xe9a2fe[_0x4f7d('0x2b')]?_[_0x4f7d('0x42')](_0xe9a2fe)['priority']:_0x1b5e94[_0x4f7d('0xe')])+0x1;_0x21866[_0x4f7d('0xf')]=_[_0x4f7d('0x43')](_0x21866[_0x4f7d('0xf')],_0x524e74,[_0x1b5e94],_0xe9a2fe);}_0x21866[_0x4f7d('0xf')][_0x4f7d('0x11')]({'type':_0x367714[_0x168b06][0x0][_0x4f7d('0x12')],'app':'Hangup','exten':_0x367714[_0x168b06][0x0][_0x4f7d('0xb')],'context':_0x367714[_0x168b06][0x0][_0x4f7d('0x17')],'priority':_0x21866[_0x4f7d('0xe')],'VoiceExtensionId':_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]});_0x526297[_0x4f7d('0x11')](_0x367714[_0x168b06][0x0][_0x4f7d('0x15')]);_0x5bdaaf=_['concat'](_0x5bdaaf,_0x21866['extensions']);}}return _0x41379b[_0x4f7d('0x44')](function(_0x5ca2cc){return _0x41379b['models'][_0x4f7d('0x45')][_0x4f7d('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x526297}},'transaction':_0x5ca2cc})[_0x4f7d('0x5')](function(_0x2ecd2d){return _0x41379b[_0x4f7d('0x1')][_0x4f7d('0x45')][_0x4f7d('0x47')](_[_0x4f7d('0x48')](_0x5bdaaf,_0x4f7d('0xe')),{'transaction':_0x5ca2cc});});});})['catch'](function(_0x4761a9){console[_0x4f7d('0x49')](_0x4761a9);});}exports[_0x4f7d('0x4a')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 9b5de9f..f44d135 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 _0xbb59=['cm_hopper','\x20=\x20?','scheduledAt','id\x20IN\x20?','str','calleridnum','cm_hopper_black','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','VoiceQueueId','onlyIfOpen','query','get','CampaignId','all','Campaign','BlackLists','Error\x20processing\x20rows\x20block:','finally','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','info','CSV\x20import\x20process\x20stopped!','resolve','CmContact','createReadStream','parse','CSV\x20parse\x20error','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','join','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','CompanyId','length','find','duplicate','Duplicate\x20Contact','create','then','push','pick','catch','message','stringify','cmContact','checkHopper','inspect','insert','into','fromQuery','ContactId','ListId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)'];(function(_0x1f7520,_0x5854e9){var _0x424935=function(_0x95b3d6){while(--_0x95b3d6){_0x1f7520['push'](_0x1f7520['shift']());}};_0x424935(++_0x5854e9);}(_0xbb59,0x16a));var _0x9bb5=function(_0xf50675,_0x482738){_0xf50675=_0xf50675-0x0;var _0x438e66=_0xbb59[_0xf50675];return _0x438e66;};'use strict';var BPromise=require('bluebird');var util=require(_0x9bb5('0x0'));var _=require(_0x9bb5('0x1'));var fs=require('fs');var squel=require(_0x9bb5('0x2'));var Papa=require(_0x9bb5('0x3'));var Redis=require('ioredis');var db=require(_0x9bb5('0x4'))['db'];var config=require(_0x9bb5('0x5'));var logger=require(_0x9bb5('0x6'))('api');config['redis']=_[_0x9bb5('0x7')](config[_0x9bb5('0x8')],{'host':_0x9bb5('0x9'),'port':0x18eb});var socket=require(_0x9bb5('0xa'))(new Redis(config['redis']));require(_0x9bb5('0xb'))[_0x9bb5('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x9bb5('0xd')][0x2]===_0x9bb5('0xe')||process[_0x9bb5('0xd')][0x2]===_0x9bb5('0xf')){throw new Error(_0x9bb5('0x10'));}var FILEPATH=process['argv'][0x2];if(!process['argv'][0x3]||process[_0x9bb5('0xd')][0x3]===_0x9bb5('0xe')||process[_0x9bb5('0xd')][0x3]===_0x9bb5('0xf')||!process['argv'][0x4]||process[_0x9bb5('0xd')][0x4]===_0x9bb5('0xe')||process[_0x9bb5('0xd')][0x4]===_0x9bb5('0xf')){throw new Error(_0x9bb5('0x11'));}var FIELDS=_['zipObject'](process[_0x9bb5('0xd')][0x3][_0x9bb5('0x12')](','),process[_0x9bb5('0xd')][0x4][_0x9bb5('0x12')](','));if(!process['argv'][0x5]||process[_0x9bb5('0xd')][0x5]===_0x9bb5('0xe')||process[_0x9bb5('0xd')][0x5]===_0x9bb5('0xf')){throw new Error(_0x9bb5('0x13'));}var LISTID=process[_0x9bb5('0xd')][0x5];var COMPANYID=process[_0x9bb5('0xd')][0x6]&&process['argv'][0x6]!==_0x9bb5('0xe')&&process[_0x9bb5('0xd')][0x6]!=='null'?process[_0x9bb5('0xd')][0x6]:null;var DUPLICATES=process[_0x9bb5('0xd')][0x7]&&process[_0x9bb5('0xd')][0x7]!==_0x9bb5('0xe')&&process[_0x9bb5('0xd')][0x7]!=='null'?process['argv'][0x7]:null;if(!process['argv'][0x8]||process[_0x9bb5('0xd')][0x8]===_0x9bb5('0xe')||process['argv'][0x8]===_0x9bb5('0xf')){throw new Error(_0x9bb5('0x14'));}var SOCKET_TIMESTAMP=process[_0x9bb5('0xd')][0x8];}catch(_0xc766c1){logger[_0x9bb5('0x15')](_0xc766c1);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(_0x350627,_0x2c54eb,_0x32cdb3,_0x12e94f){var _0x3e0bae={'message':_0x2c54eb};_0x3e0bae[_0x350627]=!![];if(_0x32cdb3){_0x3e0bae[_0x9bb5('0x16')]=_0x32cdb3;}if(_0x12e94f){_0x3e0bae[_0x9bb5('0x17')]=_0x12e94f;}return _0x3e0bae;}function isEmail(_0x3b0b9e){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'](_0x3b0b9e);}function checkRow(_0x210f03,_0x44eef2,_0x538329){return new BPromise(function(_0x44fe79,_0x45de31){if(_[_0x9bb5('0x18')](_0x210f03)){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x9bb5('0x19'),null,_0x538329));}if(_0x210f03[_0x9bb5('0x1a')]&&_0x210f03['errors']['length']){var _0x2737da=_['map'](_0x210f03[_0x9bb5('0x1a')],'message')[_0x9bb5('0x1b')](';');return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x2737da,null,_0x538329));}var _0x18b783={};for(var _0x32a95e in FIELDS){if(FIELDS['hasOwnProperty'](_0x32a95e)&&FIELDS[_0x32a95e]){_0x18b783[_0x32a95e]=_0x210f03[_0x9bb5('0x1c')][0x0][FIELDS[_0x32a95e]]||_0x210f03[_0x9bb5('0x1c')][0x0]['\ufeff'+FIELDS[_0x32a95e]];}}if(!_0x18b783[_0x9bb5('0x1d')]){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x9bb5('0x1e'),null,_0x538329));}if(!_0x18b783[_0x9bb5('0x1f')]){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x9bb5('0x20'),null,_0x538329));}if(_0x18b783['birthDate']){var _0x108e44=moment(_0x18b783['birthDate'],_0x9bb5('0x21'));if(!_0x108e44[_0x9bb5('0x22')]()){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x9bb5('0x23'),null,_0x538329));}}if(_0x18b783['email']){if(!isEmail(_0x18b783['email'])){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),_0x9bb5('0x24'),null,_0x538329));}}_0x18b783['ListId']=LISTID;_0x18b783[_0x9bb5('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x9bb5('0x26')]&&_0x44eef2){var _0x12d99c={};for(var _0x439db0=0x0,_0x393eb9=DUPLICATES['length'];_0x439db0<_0x393eb9;_0x439db0+=0x1){_0x12d99c[DUPLICATES[_0x439db0]]=_0x18b783[DUPLICATES[_0x439db0]];}var _0x47db0f=_[_0x9bb5('0x27')](_0x44eef2,_0x12d99c);if(_0x47db0f){return _0x45de31(handleCheckRowError(_0x9bb5('0x28'),_0x9bb5('0x29'),_0x47db0f,_0x538329));}}return db['CmContact'][_0x9bb5('0x2a')](_0x18b783,{'raw':!![],'hooks':![],'fields':_['keys'](_0x18b783)})[_0x9bb5('0x2b')](function(_0x397776){if(DUPLICATES&&DUPLICATES[_0x9bb5('0x26')]&&_0x44eef2){_0x44eef2[_0x9bb5('0x2c')](_[_0x9bb5('0x2d')](_0x18b783,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x397776['id'];return _0x44fe79();})[_0x9bb5('0x2e')](function(_0x2babcc){return _0x45de31(handleCheckRowError(_0x9bb5('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0x2babcc[_0x9bb5('0x2f')]||JSON[_0x9bb5('0x30')](_0x2babcc)),null,_0x538329));});});}function checkHopper(){function _0x2ad61c(){return function(_0x51d80c){logger['error'](_0x9bb5('0x31'),_0x9bb5('0x32'),util[_0x9bb5('0x33')](_0x51d80c,{'showHidden':![],'depth':null}));};}var _0x23fe67=function(_0x4093c0,_0x31cf24){var _0x1e60bf=squel[_0x9bb5('0x34')]()[_0x9bb5('0x35')]('cm_hopper')[_0x9bb5('0x36')]([_0x9bb5('0x1f'),'scheduledAt',_0x9bb5('0x37'),_0x9bb5('0x38'),_0x31cf24,'createdAt',_0x9bb5('0x39')],squel[_0x9bb5('0x3a')]()[_0x9bb5('0x3b')](_0x9bb5('0x1f'),_0x9bb5('0x1f'))[_0x9bb5('0x3b')](_0x9bb5('0x3c'),'scheduledAt')[_0x9bb5('0x3b')]('id',_0x9bb5('0x37'))['field'](LISTID[_0x9bb5('0x3d')](),_0x9bb5('0x38'))[_0x9bb5('0x3b')](_0x4093c0['id']['toString'](),_0x31cf24)['field']('NOW()',_0x9bb5('0x3e'))[_0x9bb5('0x3b')](_0x9bb5('0x3c'),'updatedAt')[_0x9bb5('0x3f')](_0x9bb5('0x40'))[_0x9bb5('0x41')](_0x9bb5('0x42'))[_0x9bb5('0x41')](_0x9bb5('0x43'),LISTID[_0x9bb5('0x3d')]())['where'](_0x9bb5('0x44'))[_0x9bb5('0x41')](_0x9bb5('0x45'),squel[_0x9bb5('0x3a')]()['field'](_0x9bb5('0x1f'))[_0x9bb5('0x3f')](_0x9bb5('0x46'))[_0x9bb5('0x41')](_0x31cf24+_0x9bb5('0x47'),_0x4093c0['id']['toString']())))[_0x9bb5('0x3d')]();return _0x1e60bf;};var _0x29d168=function(_0x1923d7,_0x295184){var _0x3ba1c0=squel[_0x9bb5('0x34')]()[_0x9bb5('0x35')]('cm_hopper')[_0x9bb5('0x36')]([_0x9bb5('0x1f'),_0x9bb5('0x48'),'ContactId',_0x9bb5('0x38'),_0x295184,_0x9bb5('0x3e'),'updatedAt'],squel[_0x9bb5('0x3a')]()[_0x9bb5('0x3b')](_0x9bb5('0x1f'),_0x9bb5('0x1f'))[_0x9bb5('0x3b')](_0x9bb5('0x3c'),_0x9bb5('0x48'))[_0x9bb5('0x3b')]('id',_0x9bb5('0x37'))[_0x9bb5('0x3b')](LISTID['toString'](),_0x9bb5('0x38'))['field'](_0x1923d7['id']['toString'](),_0x295184)[_0x9bb5('0x3b')](_0x9bb5('0x3c'),_0x9bb5('0x3e'))[_0x9bb5('0x3b')](_0x9bb5('0x3c'),_0x9bb5('0x39'))[_0x9bb5('0x3f')]('cm_contacts')[_0x9bb5('0x41')]('deletedAt\x20IS\x20NULL')[_0x9bb5('0x41')](_0x9bb5('0x43'),LISTID[_0x9bb5('0x3d')]())[_0x9bb5('0x41')](_0x9bb5('0x49'),squel[_0x9bb5('0x4a')](hopperContacts))[_0x9bb5('0x41')](_0x9bb5('0x44'))['where'](_0x9bb5('0x45'),squel[_0x9bb5('0x3a')]()[_0x9bb5('0x3b')](_0x9bb5('0x4b'))[_0x9bb5('0x3f')]('cm_hopper_final')[_0x9bb5('0x41')](_0x295184+_0x9bb5('0x47'),_0x1923d7['id'][_0x9bb5('0x3d')]()))['where'](_0x9bb5('0x45'),squel[_0x9bb5('0x3a')]()[_0x9bb5('0x3b')](_0x9bb5('0x1f'))[_0x9bb5('0x3f')]('cm_hopper')[_0x9bb5('0x41')](_0x295184+_0x9bb5('0x47'),_0x1923d7['id'][_0x9bb5('0x3d')]())))[_0x9bb5('0x3d')]();return _0x3ba1c0;};function _0x350eb1(_0x178e73,_0x5f4cc1){var _0x4f205f=squel[_0x9bb5('0x34')]()[_0x9bb5('0x35')]('cm_hopper')['fromQuery']([_0x9bb5('0x1f'),_0x9bb5('0x48'),_0x9bb5('0x37'),_0x9bb5('0x38'),_0x5f4cc1,_0x9bb5('0x3e'),_0x9bb5('0x39')],squel['select']()[_0x9bb5('0x3b')](_0x9bb5('0x1f'),_0x9bb5('0x1f'))[_0x9bb5('0x3b')]('NOW()',_0x9bb5('0x48'))[_0x9bb5('0x3b')]('id',_0x9bb5('0x37'))[_0x9bb5('0x3b')](LISTID[_0x9bb5('0x3d')](),'ListId')[_0x9bb5('0x3b')](_0x178e73['id']['toString'](),_0x5f4cc1)[_0x9bb5('0x3b')](_0x9bb5('0x3c'),_0x9bb5('0x3e'))['field'](_0x9bb5('0x3c'),_0x9bb5('0x39'))[_0x9bb5('0x3f')](_0x9bb5('0x40'))[_0x9bb5('0x41')]('deletedAt\x20IS\x20NULL')[_0x9bb5('0x41')]('ListId\x20=\x20?',LISTID[_0x9bb5('0x3d')]())['where'](_0x9bb5('0x49'),squel[_0x9bb5('0x4a')](hopperContacts))['where'](_0x9bb5('0x44')))['toString']();return _0x4f205f;}function _0x56d046(_0x1dd7c6,_0x5003fd){var _0x12db9d=squel[_0x9bb5('0x34')]()['into'](_0x9bb5('0x4c'))[_0x9bb5('0x36')]([_0x9bb5('0x1f'),'ContactId',_0x9bb5('0x38'),_0x5003fd,'createdAt',_0x9bb5('0x39')],squel[_0x9bb5('0x3a')]()[_0x9bb5('0x3b')](_0x9bb5('0x1f'),_0x9bb5('0x1f'))[_0x9bb5('0x3b')]('id','ContactId')[_0x9bb5('0x3b')](LISTID[_0x9bb5('0x3d')](),_0x9bb5('0x38'))[_0x9bb5('0x3b')](_0x1dd7c6['id'][_0x9bb5('0x3d')](),_0x5003fd)['field'](_0x9bb5('0x3c'),_0x9bb5('0x3e'))[_0x9bb5('0x3b')](_0x9bb5('0x3c'),_0x9bb5('0x39'))['from'](_0x9bb5('0x40'))[_0x9bb5('0x41')]('deletedAt\x20IS\x20NULL')[_0x9bb5('0x41')]('ListId\x20=\x20?',LISTID[_0x9bb5('0x3d')]())['where'](_0x9bb5('0x49'),squel[_0x9bb5('0x4a')](hopperContacts))[_0x9bb5('0x41')](_0x9bb5('0x44')))[_0x9bb5('0x3d')]();return _0x12db9d;}return db[_0x9bb5('0x4d')][_0x9bb5('0x4e')]({'where':{'type':_0x9bb5('0x4f')},'attributes':['id',_0x9bb5('0x50')],'include':[{'model':db[_0x9bb5('0x51')],'as':_0x9bb5('0x52'),'where':{'id':LISTID}}]})[_0x9bb5('0x2b')](function(_0x422642){var _0x4b5c42=[];if(_0x422642){var _0x512050;for(var _0xa549db=0x0,_0x305855;_0xa549db<_0x422642[_0x9bb5('0x26')];_0xa549db+=0x1){_0x305855=_0x422642[_0xa549db]['get']({'plain':!![]});switch(_0x305855['dialCheckDuplicateType']){case _0x9bb5('0x53'):_0x4b5c42[_0x9bb5('0x2c')](db[_0x9bb5('0x54')]['query'](_0x29d168(_0x305855,_0x9bb5('0x55')))['then'](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));break;case _0x9bb5('0x56'):_0x4b5c42[_0x9bb5('0x2c')](db['sequelize']['query'](_0x23fe67(_0x305855,'VoiceQueueId'))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));break;default:_0x4b5c42[_0x9bb5('0x2c')](db['sequelize'][_0x9bb5('0x57')](_0x350eb1(_0x305855,_0x9bb5('0x55')))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));}}}return _0x4b5c42;})['all']()[_0x9bb5('0x2b')](function(){return db[_0x9bb5('0x4d')][_0x9bb5('0x4e')]({'where':{'type':_0x9bb5('0x4f')},'attributes':['id'],'include':[{'model':db[_0x9bb5('0x51')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x9bb5('0x2b')](function(_0x5c6d83){var _0x3070d7=[];if(_0x5c6d83){var _0x501e1f;for(var _0x2698cc=0x0,_0x3b04e6;_0x2698cc<_0x5c6d83[_0x9bb5('0x26')];_0x2698cc+=0x1){_0x3b04e6=_0x5c6d83[_0x2698cc][_0x9bb5('0x58')]({'plain':!![]});_0x3070d7[_0x9bb5('0x2c')](db[_0x9bb5('0x54')]['query'](_0x56d046(_0x3b04e6,_0x9bb5('0x55')))[_0x9bb5('0x2b')](function(){})['catch'](_0x2ad61c()));}}return _0x3070d7;})['all']();})[_0x9bb5('0x2b')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x9bb5('0x50')],'include':[{'model':db[_0x9bb5('0x51')],'as':'Lists','where':{'id':LISTID}}]})[_0x9bb5('0x2b')](function(_0x1077d7){var _0x208e84=[];if(_0x1077d7){for(var _0x54d0f8=0x0,_0x435159;_0x54d0f8<_0x1077d7[_0x9bb5('0x26')];_0x54d0f8+=0x1){_0x435159=_0x1077d7[_0x54d0f8]['get']({'plain':!![]});switch(_0x435159[_0x9bb5('0x50')]){case _0x9bb5('0x53'):_0x208e84[_0x9bb5('0x2c')](db[_0x9bb5('0x54')][_0x9bb5('0x57')](_0x29d168(_0x435159,_0x9bb5('0x59')))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));break;case'onlyIfOpen':_0x208e84[_0x9bb5('0x2c')](db['sequelize'][_0x9bb5('0x57')](_0x23fe67(_0x435159,'CampaignId'))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));break;default:_0x208e84[_0x9bb5('0x2c')](db[_0x9bb5('0x54')][_0x9bb5('0x57')](_0x350eb1(_0x435159,_0x9bb5('0x59')))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));}}}return _0x208e84;})[_0x9bb5('0x5a')]();})['then'](function(){return db[_0x9bb5('0x5b')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x9bb5('0x51')],'as':_0x9bb5('0x5c'),'where':{'id':LISTID}}]})[_0x9bb5('0x2b')](function(_0x573427){var _0x285a9e=[];if(_0x573427){for(var _0x3408f8=0x0,_0x5c9e3f;_0x3408f8<_0x573427[_0x9bb5('0x26')];_0x3408f8+=0x1){_0x5c9e3f=_0x573427[_0x3408f8][_0x9bb5('0x58')]({'plain':!![]});_0x285a9e[_0x9bb5('0x2c')](db[_0x9bb5('0x54')]['query'](_0x56d046(_0x5c9e3f,'CampaignId'))[_0x9bb5('0x2b')](function(){})[_0x9bb5('0x2e')](_0x2ad61c()));}}return _0x285a9e;})[_0x9bb5('0x5a')]();})['catch'](function(_0x9e190f){logger[_0x9bb5('0x15')]('cmContact,\x20%s,\x20%s','generalCheckHopper',_0x9e190f[_0x9bb5('0x2f')]);});}var processPromises=function(_0x508f17){return BPromise[_0x9bb5('0x5a')](promises)[_0x9bb5('0x2b')](function(_0x512f98){})[_0x9bb5('0x2e')](function(_0x28948e){logger[_0x9bb5('0x15')](_0x9bb5('0x5d'),JSON[_0x9bb5('0x30')](_0x28948e));})[_0x9bb5('0x5e')](function(){socket[_0x9bb5('0x5f')](_0x9bb5('0x60')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x508f17){return _0x508f17[_0x9bb5('0x61')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x9bb5('0x2b')](function(){if(hopperContacts){return checkHopper();}})[_0x9bb5('0x2b')](function(){socket['emit'](_0x9bb5('0x60')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x9bb5('0x62')](FILEPATH);}catch(_0x14cd51){logger[_0x9bb5('0x15')](_0x9bb5('0x63'),JSON[_0x9bb5('0x30')](_0x14cd51));}finally{process[_0x9bb5('0x64')](0x0);}});};process['on']('SIGINT',function(){logger[_0x9bb5('0x65')](_0x9bb5('0x66'));endCsv();});function main(){return BPromise[_0x9bb5('0x67')]()[_0x9bb5('0x2b')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x9bb5('0x12')](',');return db[_0x9bb5('0x68')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x9bb5('0x2b')](function(_0x59664e){var _0xc6238f=fs[_0x9bb5('0x69')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x9bb5('0x6a')](_0xc6238f,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5a02ae,_0x4da6ee){total+=0x1;var _0x228dfa=total;promises['push'](checkRow(_0x5a02ae,_0x59664e,_0x228dfa)[_0x9bb5('0x2b')](function(){success+=0x1;})['catch'](function(_0xb8ef89){if(_0xb8ef89[_0x9bb5('0x15')]){errors+=0x1;delete _0xb8ef89[_0x9bb5('0x15')];}else if(_0xb8ef89[_0x9bb5('0x28')]){duplicates+=0x1;delete _0xb8ef89[_0x9bb5('0x28')];}rows['push'](_0xb8ef89);}));if(total%0xc8===0x0){_0x4da6ee['pause']();return processPromises(_0x4da6ee);}},'complete':function(){return processPromises()[_0x9bb5('0x2b')](function(){logger['info']('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x140fb0,_0x15147a){logger[_0x9bb5('0x65')](_0x9bb5('0x6b'),JSON['stringify'](_0x140fb0));endCsv();}});})[_0x9bb5('0x2e')](function(_0x36e3cb){logger[_0x9bb5('0x15')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x9bb5('0x30')](_0x36e3cb));});}main(); \ No newline at end of file +var _0x7577=['CmContact','create','keys','push','pick','catch','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','cm_hopper','fromQuery','phone','ContactId','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','where','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','into','createdAt','id\x20IN\x20?','str','calleridnum','\x20=\x20?','insert','deletedAt\x20IS\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','CmList','Lists','then','always','sequelize','query','VoiceQueueId','onlyIfOpen','BlackLists','all','Campaign','get','CampaignId','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','emit','contact:csv_','resume','resolve','exit','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','duplicate','pause','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','util','squel','papaparse','ioredis','../../../mysqldb','../../../config/environment','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','zipObject','split','Missing\x20ListId\x20parameter!','contact','index','test','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','length','map','errors','message','join','error','hasOwnProperty','data','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find'];(function(_0x3cf251,_0xbb3555){var _0x4dab8b=function(_0x22c574){while(--_0x22c574){_0x3cf251['push'](_0x3cf251['shift']());}};_0x4dab8b(++_0xbb3555);}(_0x7577,0x1f0));var _0x7757=function(_0x4974c2,_0x3072fe){_0x4974c2=_0x4974c2-0x0;var _0x3d6d3b=_0x7577[_0x4974c2];return _0x3d6d3b;};'use strict';var BPromise=require('bluebird');var util=require(_0x7757('0x0'));var _=require('lodash');var fs=require('fs');var squel=require(_0x7757('0x1'));var Papa=require(_0x7757('0x2'));var Redis=require(_0x7757('0x3'));var db=require(_0x7757('0x4'))['db'];var config=require(_0x7757('0x5'));var logger=require('../../../config/logger')(_0x7757('0x6'));config[_0x7757('0x7')]=_[_0x7757('0x8')](config[_0x7757('0x7')],{'host':_0x7757('0x9'),'port':0x18eb});var socket=require(_0x7757('0xa'))(new Redis(config[_0x7757('0x7')]));require(_0x7757('0xb'))[_0x7757('0xc')](socket);try{if(!process[_0x7757('0xd')][0x2]||process['argv'][0x2]===_0x7757('0xe')||process[_0x7757('0xd')][0x2]===_0x7757('0xf')){throw new Error('Missing\x20filepath\x20parameter!');}var FILEPATH=process[_0x7757('0xd')][0x2];if(!process[_0x7757('0xd')][0x3]||process[_0x7757('0xd')][0x3]===_0x7757('0xe')||process['argv'][0x3]==='null'||!process['argv'][0x4]||process['argv'][0x4]===_0x7757('0xe')||process[_0x7757('0xd')][0x4]===_0x7757('0xf')){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x7757('0x10')](process[_0x7757('0xd')][0x3][_0x7757('0x11')](','),process[_0x7757('0xd')][0x4][_0x7757('0x11')](','));if(!process['argv'][0x5]||process[_0x7757('0xd')][0x5]===_0x7757('0xe')||process['argv'][0x5]===_0x7757('0xf')){throw new Error(_0x7757('0x12'));}var LISTID=process[_0x7757('0xd')][0x5];var COMPANYID=process[_0x7757('0xd')][0x6]&&process[_0x7757('0xd')][0x6]!==_0x7757('0xe')&&process[_0x7757('0xd')][0x6]!==_0x7757('0xf')?process[_0x7757('0xd')][0x6]:null;var DUPLICATES=process[_0x7757('0xd')][0x7]&&process[_0x7757('0xd')][0x7]!==_0x7757('0xe')&&process[_0x7757('0xd')][0x7]!==_0x7757('0xf')?process['argv'][0x7]:null;if(!process[_0x7757('0xd')][0x8]||process[_0x7757('0xd')][0x8]==='undefined'||process[_0x7757('0xd')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x7757('0xd')][0x8];}catch(_0x444578){logger['error'](_0x444578);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(_0x3c2b10,_0x4fe167,_0x500f6f,_0x4de083){var _0x59671f={'message':_0x4fe167};_0x59671f[_0x3c2b10]=!![];if(_0x500f6f){_0x59671f[_0x7757('0x13')]=_0x500f6f;}if(_0x4de083){_0x59671f[_0x7757('0x14')]=_0x4de083;}return _0x59671f;}function isEmail(_0x3f9d20){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))*$/[_0x7757('0x15')](_0x3f9d20);}function checkRow(_0x37910b,_0x2c62d1,_0x43cca7){return new BPromise(function(_0x454084,_0x2f5918){if(_['isNil'](_0x37910b)){return _0x2f5918(handleCheckRowError('error',_0x7757('0x16'),null,_0x43cca7));}if(_0x37910b['errors']&&_0x37910b['errors'][_0x7757('0x17')]){var _0x5f18ed=_[_0x7757('0x18')](_0x37910b[_0x7757('0x19')],_0x7757('0x1a'))[_0x7757('0x1b')](';');return _0x2f5918(handleCheckRowError(_0x7757('0x1c'),_0x5f18ed,null,_0x43cca7));}var _0x5094dd={};for(var _0x29a6de in FIELDS){if(FIELDS[_0x7757('0x1d')](_0x29a6de)&&FIELDS[_0x29a6de]){_0x5094dd[_0x29a6de]=_0x37910b[_0x7757('0x1e')][0x0][FIELDS[_0x29a6de]]||_0x37910b[_0x7757('0x1e')][0x0]['\ufeff'+FIELDS[_0x29a6de]];}}if(!_0x5094dd['firstName']){return _0x2f5918(handleCheckRowError(_0x7757('0x1c'),'firstName\x20not\x20specified!',null,_0x43cca7));}if(!_0x5094dd['phone']){return _0x2f5918(handleCheckRowError(_0x7757('0x1c'),_0x7757('0x1f'),null,_0x43cca7));}if(_0x5094dd[_0x7757('0x20')]){var _0x44f516=moment(_0x5094dd[_0x7757('0x20')],'YYYY-MM-DD');if(!_0x44f516[_0x7757('0x21')]()){return _0x2f5918(handleCheckRowError('error',_0x7757('0x22'),null,_0x43cca7));}}if(_0x5094dd[_0x7757('0x23')]){if(!isEmail(_0x5094dd[_0x7757('0x23')])){return _0x2f5918(handleCheckRowError('error','email\x20format\x20is\x20not\x20valid!',null,_0x43cca7));}}_0x5094dd[_0x7757('0x24')]=LISTID;_0x5094dd[_0x7757('0x25')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x7757('0x17')]&&_0x2c62d1){var _0x439d58={};for(var _0x3619f1=0x0,_0x26e667=DUPLICATES[_0x7757('0x17')];_0x3619f1<_0x26e667;_0x3619f1+=0x1){_0x439d58[DUPLICATES[_0x3619f1]]=_0x5094dd[DUPLICATES[_0x3619f1]];}var _0x447e92=_[_0x7757('0x26')](_0x2c62d1,_0x439d58);if(_0x447e92){return _0x2f5918(handleCheckRowError('duplicate','Duplicate\x20Contact',_0x447e92,_0x43cca7));}}return db[_0x7757('0x27')][_0x7757('0x28')](_0x5094dd,{'raw':!![],'hooks':![],'fields':_[_0x7757('0x29')](_0x5094dd)})['then'](function(_0x357c5d){if(DUPLICATES&&DUPLICATES[_0x7757('0x17')]&&_0x2c62d1){_0x2c62d1[_0x7757('0x2a')](_[_0x7757('0x2b')](_0x5094dd,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x357c5d['id'];return _0x454084();})[_0x7757('0x2c')](function(_0x11d11d){return _0x2f5918(handleCheckRowError(_0x7757('0x1c'),_0x7757('0x2d')+(_0x11d11d[_0x7757('0x1a')]||JSON[_0x7757('0x2e')](_0x11d11d)),null,_0x43cca7));});});}function checkHopper(){function _0x4ca950(){return function(_0x179472){logger[_0x7757('0x1c')](_0x7757('0x2f'),_0x7757('0x30'),util[_0x7757('0x31')](_0x179472,{'showHidden':![],'depth':null}));};}var _0xa2f520=function(_0x211813,_0x3ba39e){var _0x2233f0=squel['insert']()['into'](_0x7757('0x32'))[_0x7757('0x33')]([_0x7757('0x34'),'scheduledAt',_0x7757('0x35'),_0x7757('0x24'),_0x3ba39e,'createdAt',_0x7757('0x36')],squel[_0x7757('0x37')]()[_0x7757('0x38')](_0x7757('0x34'),'phone')[_0x7757('0x38')](_0x7757('0x39'),_0x7757('0x3a'))[_0x7757('0x38')]('id',_0x7757('0x35'))[_0x7757('0x38')](LISTID[_0x7757('0x3b')](),_0x7757('0x24'))[_0x7757('0x38')](_0x211813['id'][_0x7757('0x3b')](),_0x3ba39e)[_0x7757('0x38')](_0x7757('0x39'),'createdAt')['field'](_0x7757('0x39'),_0x7757('0x36'))[_0x7757('0x3c')](_0x7757('0x3d'))['where']('deletedAt\x20IS\x20NULL')[_0x7757('0x3e')](_0x7757('0x3f'),LISTID[_0x7757('0x3b')]())[_0x7757('0x3e')](_0x7757('0x40'))[_0x7757('0x3e')](_0x7757('0x41'),squel[_0x7757('0x37')]()['field']('phone')[_0x7757('0x3c')](_0x7757('0x32'))['where'](_0x3ba39e+'\x20=\x20?',_0x211813['id'][_0x7757('0x3b')]())))['toString']();return _0x2233f0;};var _0x12fd5f=function(_0x116d99,_0x38312d){var _0x2fee24=squel['insert']()[_0x7757('0x42')]('cm_hopper')[_0x7757('0x33')]([_0x7757('0x34'),'scheduledAt',_0x7757('0x35'),'ListId',_0x38312d,_0x7757('0x43'),_0x7757('0x36')],squel[_0x7757('0x37')]()[_0x7757('0x38')](_0x7757('0x34'),_0x7757('0x34'))['field'](_0x7757('0x39'),_0x7757('0x3a'))[_0x7757('0x38')]('id','ContactId')[_0x7757('0x38')](LISTID[_0x7757('0x3b')](),_0x7757('0x24'))[_0x7757('0x38')](_0x116d99['id'][_0x7757('0x3b')](),_0x38312d)[_0x7757('0x38')]('NOW()',_0x7757('0x43'))[_0x7757('0x38')]('NOW()',_0x7757('0x36'))['from']('cm_contacts')[_0x7757('0x3e')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',LISTID['toString']())[_0x7757('0x3e')](_0x7757('0x44'),squel[_0x7757('0x45')](hopperContacts))[_0x7757('0x3e')](_0x7757('0x40'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x7757('0x37')]()['field'](_0x7757('0x46'))[_0x7757('0x3c')]('cm_hopper_final')[_0x7757('0x3e')](_0x38312d+_0x7757('0x47'),_0x116d99['id'][_0x7757('0x3b')]()))[_0x7757('0x3e')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7757('0x37')]()[_0x7757('0x38')](_0x7757('0x34'))[_0x7757('0x3c')](_0x7757('0x32'))[_0x7757('0x3e')](_0x38312d+_0x7757('0x47'),_0x116d99['id'][_0x7757('0x3b')]())))['toString']();return _0x2fee24;};function _0x2e07ca(_0x529906,_0xb08eb8){var _0x5c8910=squel['insert']()[_0x7757('0x42')](_0x7757('0x32'))[_0x7757('0x33')]([_0x7757('0x34'),_0x7757('0x3a'),_0x7757('0x35'),_0x7757('0x24'),_0xb08eb8,_0x7757('0x43'),_0x7757('0x36')],squel[_0x7757('0x37')]()[_0x7757('0x38')](_0x7757('0x34'),_0x7757('0x34'))[_0x7757('0x38')](_0x7757('0x39'),_0x7757('0x3a'))[_0x7757('0x38')]('id',_0x7757('0x35'))[_0x7757('0x38')](LISTID[_0x7757('0x3b')](),_0x7757('0x24'))[_0x7757('0x38')](_0x529906['id'][_0x7757('0x3b')](),_0xb08eb8)[_0x7757('0x38')](_0x7757('0x39'),_0x7757('0x43'))[_0x7757('0x38')](_0x7757('0x39'),_0x7757('0x36'))[_0x7757('0x3c')]('cm_contacts')[_0x7757('0x3e')]('deletedAt\x20IS\x20NULL')[_0x7757('0x3e')](_0x7757('0x3f'),LISTID[_0x7757('0x3b')]())[_0x7757('0x3e')](_0x7757('0x44'),squel['str'](hopperContacts))[_0x7757('0x3e')](_0x7757('0x40')))[_0x7757('0x3b')]();return _0x5c8910;}function _0x1dfb03(_0x55c7e3,_0x32c239){var _0x1458c5=squel[_0x7757('0x48')]()['into']('cm_hopper_black')[_0x7757('0x33')](['phone',_0x7757('0x35'),_0x7757('0x24'),_0x32c239,'createdAt',_0x7757('0x36')],squel[_0x7757('0x37')]()[_0x7757('0x38')](_0x7757('0x34'),'phone')[_0x7757('0x38')]('id',_0x7757('0x35'))[_0x7757('0x38')](LISTID[_0x7757('0x3b')](),_0x7757('0x24'))[_0x7757('0x38')](_0x55c7e3['id']['toString'](),_0x32c239)[_0x7757('0x38')](_0x7757('0x39'),_0x7757('0x43'))['field'](_0x7757('0x39'),'updatedAt')[_0x7757('0x3c')]('cm_contacts')[_0x7757('0x3e')](_0x7757('0x49'))['where'](_0x7757('0x3f'),LISTID[_0x7757('0x3b')]())['where']('id\x20IN\x20?',squel[_0x7757('0x45')](hopperContacts))[_0x7757('0x3e')](_0x7757('0x40')))['toString']();return _0x1458c5;}return db[_0x7757('0x4a')][_0x7757('0x4b')]({'where':{'type':_0x7757('0x4c')},'attributes':['id',_0x7757('0x4d')],'include':[{'model':db[_0x7757('0x4e')],'as':_0x7757('0x4f'),'where':{'id':LISTID}}]})[_0x7757('0x50')](function(_0x4658db){var _0x439b25=[];if(_0x4658db){var _0x5d280a;for(var _0x1d8e89=0x0,_0x1f4004;_0x1d8e89<_0x4658db[_0x7757('0x17')];_0x1d8e89+=0x1){_0x1f4004=_0x4658db[_0x1d8e89]['get']({'plain':!![]});switch(_0x1f4004[_0x7757('0x4d')]){case _0x7757('0x51'):_0x439b25[_0x7757('0x2a')](db[_0x7757('0x52')][_0x7757('0x53')](_0x12fd5f(_0x1f4004,_0x7757('0x54')))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));break;case _0x7757('0x55'):_0x439b25[_0x7757('0x2a')](db[_0x7757('0x52')][_0x7757('0x53')](_0xa2f520(_0x1f4004,_0x7757('0x54')))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));break;default:_0x439b25[_0x7757('0x2a')](db[_0x7757('0x52')][_0x7757('0x53')](_0x2e07ca(_0x1f4004,'VoiceQueueId'))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));}}}return _0x439b25;})['all']()[_0x7757('0x50')](function(){return db[_0x7757('0x4a')][_0x7757('0x4b')]({'where':{'type':_0x7757('0x4c')},'attributes':['id'],'include':[{'model':db[_0x7757('0x4e')],'as':_0x7757('0x56'),'where':{'id':LISTID}}]})['then'](function(_0x6265d1){var _0x47f217=[];if(_0x6265d1){var _0x23d5ca;for(var _0x535454=0x0,_0x45a777;_0x535454<_0x6265d1[_0x7757('0x17')];_0x535454+=0x1){_0x45a777=_0x6265d1[_0x535454]['get']({'plain':!![]});_0x47f217[_0x7757('0x2a')](db['sequelize'][_0x7757('0x53')](_0x1dfb03(_0x45a777,_0x7757('0x54')))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));}}return _0x47f217;})[_0x7757('0x57')]();})[_0x7757('0x50')](function(){return db[_0x7757('0x58')][_0x7757('0x4b')]({'attributes':['id',_0x7757('0x4d')],'include':[{'model':db[_0x7757('0x4e')],'as':'Lists','where':{'id':LISTID}}]})[_0x7757('0x50')](function(_0x32e028){var _0x1133a7=[];if(_0x32e028){for(var _0x12d0c3=0x0,_0x4e2f46;_0x12d0c3<_0x32e028[_0x7757('0x17')];_0x12d0c3+=0x1){_0x4e2f46=_0x32e028[_0x12d0c3][_0x7757('0x59')]({'plain':!![]});switch(_0x4e2f46[_0x7757('0x4d')]){case _0x7757('0x51'):_0x1133a7[_0x7757('0x2a')](db[_0x7757('0x52')]['query'](_0x12fd5f(_0x4e2f46,_0x7757('0x5a')))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));break;case _0x7757('0x55'):_0x1133a7[_0x7757('0x2a')](db[_0x7757('0x52')][_0x7757('0x53')](_0xa2f520(_0x4e2f46,_0x7757('0x5a')))['then'](function(){})[_0x7757('0x2c')](_0x4ca950()));break;default:_0x1133a7[_0x7757('0x2a')](db[_0x7757('0x52')][_0x7757('0x53')](_0x2e07ca(_0x4e2f46,'CampaignId'))[_0x7757('0x50')](function(){})[_0x7757('0x2c')](_0x4ca950()));}}}return _0x1133a7;})[_0x7757('0x57')]();})[_0x7757('0x50')](function(){return db[_0x7757('0x58')][_0x7757('0x4b')]({'attributes':['id'],'include':[{'model':db[_0x7757('0x4e')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x7757('0x50')](function(_0x3e1e17){var _0x4517a9=[];if(_0x3e1e17){for(var _0x2bb94d=0x0,_0x54cad4;_0x2bb94d<_0x3e1e17['length'];_0x2bb94d+=0x1){_0x54cad4=_0x3e1e17[_0x2bb94d][_0x7757('0x59')]({'plain':!![]});_0x4517a9[_0x7757('0x2a')](db[_0x7757('0x52')]['query'](_0x1dfb03(_0x54cad4,_0x7757('0x5a')))[_0x7757('0x50')](function(){})['catch'](_0x4ca950()));}}return _0x4517a9;})[_0x7757('0x57')]();})['catch'](function(_0x48b630){logger[_0x7757('0x1c')](_0x7757('0x5b'),_0x7757('0x5c'),_0x48b630[_0x7757('0x1a')]);});}var processPromises=function(_0x3b3db5){return BPromise[_0x7757('0x57')](promises)[_0x7757('0x50')](function(_0x1fdc25){})['catch'](function(_0x550f5f){logger['error']('Error\x20processing\x20rows\x20block:',JSON[_0x7757('0x2e')](_0x550f5f));})[_0x7757('0x5d')](function(){socket[_0x7757('0x5e')](_0x7757('0x5f')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x3b3db5){return _0x3b3db5[_0x7757('0x60')]();}});};var endCsv=function(){return BPromise[_0x7757('0x61')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x7757('0x5e')](_0x7757('0x5f')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x2438d5){logger[_0x7757('0x1c')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x7757('0x2e')](_0x2438d5));}finally{process[_0x7757('0x62')](0x0);}});};process['on']('SIGINT',function(){logger[_0x7757('0x63')](_0x7757('0x64'));endCsv();});function main(){return BPromise[_0x7757('0x61')]()[_0x7757('0x50')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x7757('0x11')](',');return db[_0x7757('0x27')][_0x7757('0x4b')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})['then'](function(_0x526c30){var _0x571c90=fs[_0x7757('0x65')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x7757('0x66')](_0x571c90,{'header':!![],'skipEmptyLines':!![],'step':function(_0x8060b7,_0x2b1ae4){total+=0x1;var _0x389d2f=total;promises[_0x7757('0x2a')](checkRow(_0x8060b7,_0x526c30,_0x389d2f)['then'](function(){success+=0x1;})['catch'](function(_0x3ffd4d){if(_0x3ffd4d[_0x7757('0x1c')]){errors+=0x1;delete _0x3ffd4d[_0x7757('0x1c')];}else if(_0x3ffd4d[_0x7757('0x67')]){duplicates+=0x1;delete _0x3ffd4d['duplicate'];}rows[_0x7757('0x2a')](_0x3ffd4d);}));if(total%0xc8===0x0){_0x2b1ae4[_0x7757('0x68')]();return processPromises(_0x2b1ae4);}},'complete':function(){return processPromises()[_0x7757('0x50')](function(){logger[_0x7757('0x63')]('CSV\x20parsed\x20correctly!');endCsv();});},'error':function(_0x41fbdd,_0x16b575){logger[_0x7757('0x63')](_0x7757('0x69'),JSON[_0x7757('0x2e')](_0x41fbdd));endCsv();}});})[_0x7757('0x2c')](function(_0x5a0f24){logger[_0x7757('0x1c')](_0x7757('0x6a'),JSON[_0x7757('0x2e')](_0x5a0f24));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index f686f0d..485a2ca 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 _0xa195=['data','length','rows','errors','hasOwnProperty','trim','replace','isValid','agent\x20not\x20exists','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','CompanyId','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','catch','complete','argv','arguments\x20\x20\x20','root','file\x20doesn\x27t\x20exists','binding','binding\x20doesn\x27t\x20exists','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.ListId','cm_contacts.UserId','insert','cm_hopper','fromQuery','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper_black','.CmListId\x20=\x20?','field','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','min_id','Received\x20SIGINT','error','message','exit','push','code','info','sequelize','query','spread','main','stringify','send','start','server/files/tmp','.csv','parse'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xa195,0x13e));var _0x5a19=function(_0x21948a,_0x3eb677){_0x21948a=_0x21948a-0x0;var _0x41f753=_0xa195[_0x21948a];return _0x41f753;};'use strict';var fs=require('fs');var path=require(_0x5a19('0x0'));var _=require(_0x5a19('0x1'));var Papa=require(_0x5a19('0x2'));var util=require('util');var BPromise=require(_0x5a19('0x3'));var moment=require(_0x5a19('0x4'));var squel=require(_0x5a19('0x5'));var Redis=require(_0x5a19('0x6'));var db=require(_0x5a19('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x5a19('0x8'))(_0x5a19('0x9'));config[_0x5a19('0xa')]=_[_0x5a19('0xb')](config['redis'],{'host':_0x5a19('0xc'),'port':0x18eb});var socket=require(_0x5a19('0xd'))(new Redis(config[_0x5a19('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x5a19('0xe')](_0x5a19('0xf'));function isEmail(_0x372efd){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))*$/[_0x5a19('0x10')](_0x372efd);}function selectNotIn(_0x36e7dc,_0x47f63f,_0x1c6048,_0x37a567,_0x487675){return squel[_0x5a19('0x11')]()['field']('phone')[_0x5a19('0x12')](_0x37a567)['join'](_0x47f63f,null,_0x47f63f+_0x5a19('0x13')+_0x37a567+'.'+_0x1c6048)[_0x5a19('0x14')](_0x37a567+'.'+_0x1c6048+_0x5a19('0x15')+_0x36e7dc+'.'+_0x1c6048)[_0x5a19('0x14')](_0x47f63f+_0x5a19('0x16')+_0x487675[_0x5a19('0x17')]()+')');}function insertCmHopper(_0x5ac305,_0x2e2c39,_0x564af4,_0x1bad7e,_0x3d2d57){var _0xb8c28e=[_0x5a19('0x18'),_0x5a19('0x19'),'cm_contacts.id',_0x5a19('0x1a'),_0x2e2c39+'.'+_0x1bad7e,'cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority',_0x5a19('0x1b'),'\x22'+_0x3d2d57+'\x22'];return squel[_0x5a19('0x1c')]()['into'](_0x5a19('0x1d'))[_0x5a19('0x1e')]([_0x5a19('0x1f'),_0x5a19('0x20'),_0x5a19('0x21'),_0x5a19('0x22'),_0x1bad7e,_0x5a19('0x23'),_0x5a19('0x24'),_0x5a19('0x25'),_0x5a19('0x26'),'recallme'],squel[_0x5a19('0x11')]()[_0x5a19('0x27')](_0xb8c28e)[_0x5a19('0x12')](_0x2e2c39)[_0x5a19('0x17')](_0x5a19('0x28'),null,_0x5a19('0x29')+_0x2e2c39+_0x5a19('0x2a'))[_0x5a19('0x17')](_0x564af4,null,_0x564af4+_0x5a19('0x13')+_0x2e2c39+'.'+_0x1bad7e)[_0x5a19('0x14')](_0x2e2c39+'.CmListId\x20=\x20?',_0x5ac305)[_0x5a19('0x14')](_0x5a19('0x2b'),NOW)[_0x5a19('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2e2c39,_0x564af4,_0x1bad7e,_0x5a19('0x1d'),['\x22always\x22',_0x5a19('0x2c')]))['where'](_0x5a19('0x2d'),selectNotIn(_0x2e2c39,_0x564af4,_0x1bad7e,'cm_hopper',[_0x5a19('0x2e')])))['toString']();}function insertCmHopperBlack(_0x3a4ac7,_0x56abd9,_0x72e0b2,_0xfb18a3){var _0x4e4b75=[_0x5a19('0x18'),_0x5a19('0x2f'),_0x5a19('0x1a'),_0x56abd9+'.'+_0xfb18a3,_0x5a19('0x30'),'cm_contacts.updatedAt'];return squel[_0x5a19('0x1c')]()[_0x5a19('0x31')](_0x5a19('0x32'))[_0x5a19('0x1e')]([_0x5a19('0x1f'),_0x5a19('0x21'),_0x5a19('0x22'),_0xfb18a3,_0x5a19('0x23'),_0x5a19('0x24')],squel['select']()[_0x5a19('0x27')](_0x4e4b75)[_0x5a19('0x12')](_0x56abd9)['join'](_0x5a19('0x28'),null,_0x5a19('0x29')+_0x56abd9+'.CmListId')[_0x5a19('0x17')](_0x72e0b2,null,_0x72e0b2+_0x5a19('0x13')+_0x56abd9+'.'+_0xfb18a3)[_0x5a19('0x14')](_0x56abd9+_0x5a19('0x33'),_0x3a4ac7)[_0x5a19('0x14')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x5a19('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5a19('0x34')](_0x5a19('0x1f'))[_0x5a19('0x12')](_0x5a19('0x32'))[_0x5a19('0x14')](_0x5a19('0x35'),_0x3a4ac7)[_0x5a19('0x14')](_0xfb18a3+_0x5a19('0x36'),_0x56abd9+'.'+_0xfb18a3)))[_0x5a19('0x37')]();}function insertCmContact(_0x17e4c8,_0x10c202,_0x184614,_0x204537){var _0x201ac2=_[_0x5a19('0x38')](_[_0x5a19('0x39')](_0x204537),[_0x5a19('0x22'),'CompanyId',_0x5a19('0x23'),_0x5a19('0x24')]);return squel[_0x5a19('0x1c')]()[_0x5a19('0x31')](_0x5a19('0x28'))[_0x5a19('0x1e')](_0x201ac2,squel[_0x5a19('0x11')]()[_0x5a19('0x27')](_0x201ac2)[_0x5a19('0x12')](_0x10c202)[_0x5a19('0x14')]('('+_0x184614[_0x5a19('0x17')](',')+_0x5a19('0x3a'),squel[_0x5a19('0x11')]()['fields'](_0x184614)[_0x5a19('0x12')](_0x5a19('0x28'))[_0x5a19('0x14')]('ListId\x20=\x20?',_0x17e4c8)['where'](_0x5a19('0x3b')))['where']('id\x20IN\x20?',squel[_0x5a19('0x11')]()[_0x5a19('0x34')]('MIN(id)',_0x5a19('0x3c'))['from'](_0x10c202)['group'](_0x184614[_0x5a19('0x17')](','))))[_0x5a19('0x37')]();}function handleStop(){logger['info'](_0x5a19('0x3d'));stopped=!![];}function handleUncaughtException(_0x234664){logger[_0x5a19('0x3e')](_0x234664[_0x5a19('0x3f')]);process[_0x5a19('0x40')](0x1);}function handleError(_0x5f70d2,_0x2c5162){stats['errors'][_0x5a19('0x41')]({'name':_0x2c5162[_0x5a19('0x42')],'message':_0x2c5162['message'],'row':_0x5f70d2});}function handleQuery(_0x2bc606){logger[_0x5a19('0x43')](_0x2bc606);return db[_0x5a19('0x44')][_0x5a19('0x45')](_0x2bc606)[_0x5a19('0x46')](function(_0x50594e){results[_0x5a19('0x41')](_0x50594e);})['catch'](function(_0x4f3a22){logger['error'](_0x4f3a22[_0x5a19('0x3f')]);});}function main(_0x2564ef,_0xe4f0d1,_0xdaa8e5,_0x52433c){logger['info'](_0x5a19('0x47'),_0x2564ef,JSON[_0x5a19('0x48')](_0xe4f0d1));process[_0x5a19('0x49')](_0x5a19('0x4a'));var _0xfd4ff5=_0xe4f0d1['binding'];var _0x10832e=_0xe4f0d1['socket_timestamp'];var _0x564c5d=path[_0x5a19('0x17')](config['root'],_0x5a19('0x4b'),_0x10832e+_0x5a19('0x4c'));var _0x214ccc=_[_0x5a19('0x39')](_0xfd4ff5)[_0x5a19('0x17')]();logger[_0x5a19('0x43')]('header',_0x214ccc);fs['writeFileSync'](_0x564c5d,_0x214ccc+'\x0a');Papa[_0x5a19('0x4d')](fs['createReadStream'](_0x2564ef),{'header':!![],'skipEmptyLines':!![],'step':function(_0x35e76f,_0x5602c2){try{for(var _0x27070c=0x0,_0x4609fe=[];_0x27070c<_0x35e76f[_0x5a19('0x4e')][_0x5a19('0x4f')];_0x27070c++){stats[_0x5a19('0x50')]+=0x1;if(_0x35e76f[_0x5a19('0x51')][_0x27070c]){handleError(_0x35e76f['data'][_0x27070c],_0x35e76f[_0x5a19('0x51')][_0x27070c]);}else{var _0x3880fd=[];for(var _0xc6a218 in _0xfd4ff5){if(_0xfd4ff5[_0x5a19('0x52')](_0xc6a218)){if(_0x35e76f[_0x5a19('0x4e')][_0x27070c][_0xfd4ff5[_0xc6a218]]){var _0x32706f=_[_0x5a19('0x53')](_0x35e76f[_0x5a19('0x4e')][_0x27070c][_0xfd4ff5[_0xc6a218]][_0x5a19('0x54')](/"/g,'\x27'));switch(_0xc6a218){case _0x5a19('0x20'):var _0x39169b=moment(_0x32706f,_0x5a19('0xf'),!![]);if(_0x39169b[_0x5a19('0x55')]()){_0x4609fe[_0x5a19('0x41')]('\x22'+_0x32706f+'\x22');}else{_0x3880fd[_0x5a19('0x41')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0x5a19('0x25'):var _0x597acc=parseInt(_0x32706f);_0x32706f=_['isNaN'](_0x597acc)||_0x597acc<0x0||_0x597acc>0x4?_0x52433c?0x3:0x2:_0x597acc;_0x4609fe['push']('\x22'+_0x32706f+'\x22');break;case _0x5a19('0x26'):var _0x311956=parseInt(_0x32706f);if(_['isNumber'](_0x311956)&&_['includes'](_0xdaa8e5,_0x311956)){_0x4609fe[_0x5a19('0x41')]('\x22'+_0x311956+'\x22');}else{_0x3880fd[_0x5a19('0x41')](_0x5a19('0x56'));}break;case _0x5a19('0x57'):if(isEmail(_0x32706f)){_0x4609fe[_0x5a19('0x41')]('\x22'+_0x32706f+'\x22');}else{_0x3880fd[_0x5a19('0x41')](_0x5a19('0x58'));}break;case _0x5a19('0x59'):var _0x27e594=moment(_0x32706f,_0x5a19('0x5a'),!![]);if(_0x27e594[_0x5a19('0x55')]()){_0x4609fe[_0x5a19('0x41')]('\x22'+_0x32706f+'\x22');}else{_0x3880fd['push'](_0x5a19('0x5b'));}break;default:_0x4609fe[_0x5a19('0x41')]('\x22'+_0x32706f+'\x22');}}else{switch(_0xc6a218){case'firstName':case _0x5a19('0x1f'):_0x3880fd[_0x5a19('0x41')](_0xc6a218+'\x20not\x20specified');break;default:_0x4609fe[_0x5a19('0x41')]('\x22\x22');}}}}if(_0x3880fd['length']){handleError(_0x35e76f[_0x5a19('0x4e')][_0x27070c],{'code':_0x5a19('0x5c'),'message':_0x3880fd[_0x5a19('0x17')]()});}else{fs[_0x5a19('0x5d')](_0x564c5d,_0x4609fe[_0x5a19('0x17')]()+'\x0a');}_0x4609fe=[];}if(!(stats['rows']%0xc8)){socket[_0x5a19('0x5e')](_0x5a19('0x5f')+_0x10832e,stats);stats['errors']=[];}}if(stopped){logger[_0x5a19('0x43')](_0x5a19('0x60'));_0x5602c2[_0x5a19('0x61')]();}}catch(_0x51aa1c){handleError(_0x35e76f[_0x5a19('0x4e')][_0x27070c],{'code':'SystemError','message':_0x51aa1c[_0x5a19('0x3f')]});logger[_0x5a19('0x3e')]('step',_0x51aa1c[_0x5a19('0x3f')]);}},'complete':function(){try{var _0xf6eea0=[];var _0x391a43='cm_contacts';if(_0xe4f0d1[_0x5a19('0x62')]&&_0xe4f0d1[_0x5a19('0x62')]['length']){_0x391a43=_0x5a19('0x63')+_0x10832e;_0xf6eea0['push'](_0x5a19('0x64')+_0x391a43+'\x20LIKE\x20cm_contacts;');}var _0x27dd3d=util[_0x5a19('0xe')](_0x5a19('0x65'),_0x564c5d,_0x391a43,_0x214ccc,_0xe4f0d1[_0x5a19('0x22')],_0xe4f0d1[_0x5a19('0x66')]||null,NOW,NOW);if(_[_0x5a19('0x67')](_0xfd4ff5[_0x5a19('0x20')])){_0x27dd3d+=_0x5a19('0x68');}_0xf6eea0['push'](_0x27dd3d);if(_0xe4f0d1[_0x5a19('0x62')]&&_0xe4f0d1[_0x5a19('0x62')][_0x5a19('0x4f')]){_0xf6eea0[_0x5a19('0x41')](insertCmContact(_0xe4f0d1[_0x5a19('0x22')],_0x391a43,_0xe4f0d1['duplicates'],_0xfd4ff5));_0xf6eea0[_0x5a19('0x41')](_0x5a19('0x69')+_0x391a43+';');}_0xf6eea0[_0x5a19('0x41')](insertCmHopper(_0xe4f0d1[_0x5a19('0x22')],_0x5a19('0x6a'),_0x5a19('0x6b'),'VoiceQueueId',_0x52433c));_0xf6eea0['push'](insertCmHopperBlack(_0xe4f0d1['ListId'],_0x5a19('0x6c'),'voice_queues','VoiceQueueId'));_0xf6eea0[_0x5a19('0x41')](insertCmHopper(_0xe4f0d1[_0x5a19('0x22')],_0x5a19('0x6d'),_0x5a19('0x6e'),_0x5a19('0x6f'),_0x52433c));_0xf6eea0[_0x5a19('0x41')](insertCmHopperBlack(_0xe4f0d1[_0x5a19('0x22')],_0x5a19('0x70'),_0x5a19('0x6e'),'CampaignId'));BPromise[_0x5a19('0x71')](_0xf6eea0,handleQuery)[_0x5a19('0x72')](function(_0x156bd6){stats[_0x5a19('0x73')]=!![];stats['affectedRows']=_0xe4f0d1[_0x5a19('0x62')]&&_0xe4f0d1[_0x5a19('0x62')][_0x5a19('0x4f')]?results[0x2]['affectedRows']:results[0x0][_0x5a19('0x74')];socket['emit'](_0x5a19('0x5f')+_0x10832e,stats);fs[_0x5a19('0x75')](_0x2564ef);fs['unlink'](_0x564c5d);process['exit'](0x0);})[_0x5a19('0x76')](function(_0x1946a8){logger[_0x5a19('0x3e')](_0x1946a8['message']);process[_0x5a19('0x40')](0x1);});}catch(_0x3eee65){logger[_0x5a19('0x3e')](_0x5a19('0x77'),_0x3eee65['message']);process[_0x5a19('0x40')](0x1);}},'error':function(_0x3f552d,_0x53c148,_0x25af96,_0xbb79f4){throw new Error(_0xbb79f4);}});}function validate(){if(process['argv']&&process[_0x5a19('0x78')]['length']<0x4){throw new Error(_0x5a19('0x79'));}var _0x120be3=path[_0x5a19('0x17')](config[_0x5a19('0x7a')],_0x5a19('0x4b'),process[_0x5a19('0x78')][0x2]);if(!fs['existsSync'](_0x120be3)){throw new Error(_0x5a19('0x7b'));}var _0x5e57d2={};try{_0x5e57d2=JSON['parse'](process[_0x5a19('0x78')][0x3]);if(!_0x5e57d2[_0x5a19('0x7c')]){throw new Error(_0x5a19('0x7d'));}if(!_0x5e57d2[_0x5a19('0x7c')][_0x5a19('0x1f')]){throw new Error('phone\x20is\x20mandatory');}if(!_0x5e57d2[_0x5a19('0x7c')]['firstName']){throw new Error(_0x5a19('0x7e'));}var _0x35b553=0x0;if(_0x5e57d2[_0x5a19('0x7c')][_0x5a19('0x26')]){_0x35b553=0x1;}if(!_0x5e57d2[_0x5a19('0x22')]){throw new Error(_0x5a19('0x7f'));}}catch(_0x3d9926){throw new Error(_0x5a19('0x80'));}var _0x151e5f=[];try{_0x151e5f=_['map'](JSON[_0x5a19('0x4d')](process[_0x5a19('0x78')][0x4]),'id');}catch(_0xa80af){logger['info'](_0x5a19('0x81'));}main(_0x120be3,_0x5e57d2,_0x151e5f,_0x35b553);}validate();process['on'](_0x5a19('0x82'),handleStop);process['on'](_0x5a19('0x83'),handleUncaughtException); \ No newline at end of file +var _0x3a1f=['UserId','recallme','fields','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','toString','cm_contacts.phone','cm_contacts.createdAt','cm_hopper_black','field','\x20=\x20?','concat','keys','ListId','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','push','sequelize','spread','stringify','send','start','binding','socket_timestamp','root','server/files/tmp','writeFileSync','parse','data','length','rows','errors','hasOwnProperty','trim','replace','isValid','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','SystemRow','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','isNil','voice_queues_has_cm_lists','VoiceQueueId','voice_queues_has_cm_blacklists','voice_queues','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','finish','affectedRows','contact:import:','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','import','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','phone','join','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.id','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','createdAt','updatedAt','priority'];(function(_0x7162c9,_0x46e15b){var _0x351fc2=function(_0x31a67b){while(--_0x31a67b){_0x7162c9['push'](_0x7162c9['shift']());}};_0x351fc2(++_0x46e15b);}(_0x3a1f,0x160));var _0xf3a1=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x3a1f[_0x5c351c];return _0x26f3b3;};'use strict';var fs=require('fs');var path=require(_0xf3a1('0x0'));var _=require(_0xf3a1('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xf3a1('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xf3a1('0x3'));var db=require(_0xf3a1('0x4'))['db'];var config=require(_0xf3a1('0x5'));var logger=require(_0xf3a1('0x6'))(_0xf3a1('0x7'));config[_0xf3a1('0x8')]=_[_0xf3a1('0x9')](config[_0xf3a1('0x8')],{'host':_0xf3a1('0xa'),'port':0x18eb});var socket=require(_0xf3a1('0xb'))(new Redis(config[_0xf3a1('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xf3a1('0xc')](_0xf3a1('0xd'));function isEmail(_0x5719d2){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))*$/[_0xf3a1('0xe')](_0x5719d2);}function selectNotIn(_0x5e9ab7,_0x280df0,_0x23d11f,_0x52b496,_0x1729b8){return squel[_0xf3a1('0xf')]()['field'](_0xf3a1('0x10'))['from'](_0x52b496)[_0xf3a1('0x11')](_0x280df0,null,_0x280df0+_0xf3a1('0x12')+_0x52b496+'.'+_0x23d11f)[_0xf3a1('0x13')](_0x52b496+'.'+_0x23d11f+'\x20=\x20'+_0x5e9ab7+'.'+_0x23d11f)[_0xf3a1('0x13')](_0x280df0+_0xf3a1('0x14')+_0x1729b8['join']()+')');}function insertCmHopper(_0x4b623d,_0xba896c,_0x565a48,_0x59970d,_0x322600){var _0x46f9e0=['cm_contacts.phone','cm_contacts.scheduledat',_0xf3a1('0x15'),_0xf3a1('0x16'),_0xba896c+'.'+_0x59970d,'cm_contacts.createdAt',_0xf3a1('0x17'),_0xf3a1('0x18'),_0xf3a1('0x19'),'\x22'+_0x322600+'\x22'];return squel[_0xf3a1('0x1a')]()[_0xf3a1('0x1b')](_0xf3a1('0x1c'))[_0xf3a1('0x1d')]([_0xf3a1('0x10'),_0xf3a1('0x1e'),_0xf3a1('0x1f'),'ListId',_0x59970d,_0xf3a1('0x20'),_0xf3a1('0x21'),_0xf3a1('0x22'),_0xf3a1('0x23'),_0xf3a1('0x24')],squel['select']()[_0xf3a1('0x25')](_0x46f9e0)[_0xf3a1('0x26')](_0xba896c)[_0xf3a1('0x11')](_0xf3a1('0x27'),null,_0xf3a1('0x28')+_0xba896c+'.CmListId')[_0xf3a1('0x11')](_0x565a48,null,_0x565a48+_0xf3a1('0x12')+_0xba896c+'.'+_0x59970d)[_0xf3a1('0x13')](_0xba896c+_0xf3a1('0x29'),_0x4b623d)[_0xf3a1('0x13')](_0xf3a1('0x2a'),NOW)[_0xf3a1('0x13')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0xba896c,_0x565a48,_0x59970d,_0xf3a1('0x1c'),[_0xf3a1('0x2b'),_0xf3a1('0x2c')]))[_0xf3a1('0x13')](_0xf3a1('0x2d'),selectNotIn(_0xba896c,_0x565a48,_0x59970d,_0xf3a1('0x1c'),[_0xf3a1('0x2b')])))[_0xf3a1('0x2e')]();}function insertCmHopperBlack(_0x4e9bcb,_0x1af66d,_0x4df156,_0x30ef79){var _0x5a20ba=[_0xf3a1('0x2f'),_0xf3a1('0x15'),_0xf3a1('0x16'),_0x1af66d+'.'+_0x30ef79,_0xf3a1('0x30'),_0xf3a1('0x17')];return squel[_0xf3a1('0x1a')]()['into'](_0xf3a1('0x31'))[_0xf3a1('0x1d')](['phone','ContactId','ListId',_0x30ef79,_0xf3a1('0x20'),'updatedAt'],squel[_0xf3a1('0xf')]()[_0xf3a1('0x25')](_0x5a20ba)[_0xf3a1('0x26')](_0x1af66d)[_0xf3a1('0x11')]('cm_contacts',null,_0xf3a1('0x28')+_0x1af66d+'.CmListId')[_0xf3a1('0x11')](_0x4df156,null,_0x4df156+'.id\x20=\x20'+_0x1af66d+'.'+_0x30ef79)[_0xf3a1('0x13')](_0x1af66d+_0xf3a1('0x29'),_0x4e9bcb)['where'](_0xf3a1('0x2a'),NOW)[_0xf3a1('0x13')](_0xf3a1('0x2d'),squel[_0xf3a1('0xf')]()[_0xf3a1('0x32')](_0xf3a1('0x10'))[_0xf3a1('0x26')](_0xf3a1('0x31'))[_0xf3a1('0x13')]('ListId\x20=\x20?',_0x4e9bcb)['where'](_0x30ef79+_0xf3a1('0x33'),_0x1af66d+'.'+_0x30ef79)))[_0xf3a1('0x2e')]();}function insertCmContact(_0x6f1365,_0x2aee2b,_0x287ca3,_0x294df8){var _0xc5a694=_[_0xf3a1('0x34')](_[_0xf3a1('0x35')](_0x294df8),[_0xf3a1('0x36'),_0xf3a1('0x37'),_0xf3a1('0x20'),'updatedAt']);return squel[_0xf3a1('0x1a')]()[_0xf3a1('0x1b')](_0xf3a1('0x27'))[_0xf3a1('0x1d')](_0xc5a694,squel['select']()['fields'](_0xc5a694)['from'](_0x2aee2b)[_0xf3a1('0x13')]('('+_0x287ca3[_0xf3a1('0x11')](',')+_0xf3a1('0x38'),squel[_0xf3a1('0xf')]()['fields'](_0x287ca3)['from']('cm_contacts')[_0xf3a1('0x13')](_0xf3a1('0x39'),_0x6f1365)[_0xf3a1('0x13')](_0xf3a1('0x3a')))[_0xf3a1('0x13')](_0xf3a1('0x3b'),squel[_0xf3a1('0xf')]()[_0xf3a1('0x32')](_0xf3a1('0x3c'),_0xf3a1('0x3d'))['from'](_0x2aee2b)[_0xf3a1('0x3e')](_0x287ca3[_0xf3a1('0x11')](','))))[_0xf3a1('0x2e')]();}function handleStop(){logger[_0xf3a1('0x3f')](_0xf3a1('0x40'));stopped=!![];}function handleUncaughtException(_0x30cabd){logger[_0xf3a1('0x41')](_0x30cabd[_0xf3a1('0x42')]);process[_0xf3a1('0x43')](0x1);}function handleError(_0x5cd567,_0x53027d){stats['errors'][_0xf3a1('0x44')]({'name':_0x53027d['code'],'message':_0x53027d[_0xf3a1('0x42')],'row':_0x5cd567});}function handleQuery(_0x3a2b43){logger[_0xf3a1('0x3f')](_0x3a2b43);return db[_0xf3a1('0x45')]['query'](_0x3a2b43)[_0xf3a1('0x46')](function(_0x4a89a3){results[_0xf3a1('0x44')](_0x4a89a3);})['catch'](function(_0x377f18){logger[_0xf3a1('0x41')](_0x377f18[_0xf3a1('0x42')]);});}function main(_0x161715,_0x229c3f,_0x2361f3,_0x2013bd){logger['info']('main',_0x161715,JSON[_0xf3a1('0x47')](_0x229c3f));process[_0xf3a1('0x48')](_0xf3a1('0x49'));var _0x3e3773=_0x229c3f[_0xf3a1('0x4a')];var _0x56a88a=_0x229c3f[_0xf3a1('0x4b')];var _0x179833=path[_0xf3a1('0x11')](config[_0xf3a1('0x4c')],_0xf3a1('0x4d'),_0x56a88a+'.csv');var _0xd3f033=_[_0xf3a1('0x35')](_0x3e3773)[_0xf3a1('0x11')]();logger[_0xf3a1('0x3f')]('header',_0xd3f033);fs[_0xf3a1('0x4e')](_0x179833,_0xd3f033+'\x0a');Papa[_0xf3a1('0x4f')](fs['createReadStream'](_0x161715),{'header':!![],'skipEmptyLines':!![],'step':function(_0x596ffa,_0xd1221c){try{for(var _0x15e5bb=0x0,_0x153962=[];_0x15e5bb<_0x596ffa[_0xf3a1('0x50')][_0xf3a1('0x51')];_0x15e5bb++){stats[_0xf3a1('0x52')]+=0x1;if(_0x596ffa['errors'][_0x15e5bb]){handleError(_0x596ffa[_0xf3a1('0x50')][_0x15e5bb],_0x596ffa[_0xf3a1('0x53')][_0x15e5bb]);}else{var _0x248ecb=[];for(var _0x426f75 in _0x3e3773){if(_0x3e3773[_0xf3a1('0x54')](_0x426f75)){if(_0x596ffa[_0xf3a1('0x50')][_0x15e5bb][_0x3e3773[_0x426f75]]){var _0x40c0d3=_[_0xf3a1('0x55')](_0x596ffa['data'][_0x15e5bb][_0x3e3773[_0x426f75]][_0xf3a1('0x56')](/"/g,'\x27'));switch(_0x426f75){case'scheduledat':var _0x3383a5=moment(_0x40c0d3,_0xf3a1('0xd'),!![]);if(_0x3383a5[_0xf3a1('0x57')]()){_0x153962[_0xf3a1('0x44')]('\x22'+_0x40c0d3+'\x22');}else{_0x248ecb[_0xf3a1('0x44')]('scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)');}break;case _0xf3a1('0x22'):var _0x15db3a=parseInt(_0x40c0d3);_0x40c0d3=_['isNaN'](_0x15db3a)||_0x15db3a<0x0||_0x15db3a>0x4?_0x2013bd?0x3:0x2:_0x15db3a;_0x153962[_0xf3a1('0x44')]('\x22'+_0x40c0d3+'\x22');break;case _0xf3a1('0x23'):var _0x1cbc15=parseInt(_0x40c0d3);if(_[_0xf3a1('0x58')](_0x1cbc15)&&_[_0xf3a1('0x59')](_0x2361f3,_0x1cbc15)){_0x153962[_0xf3a1('0x44')]('\x22'+_0x1cbc15+'\x22');}else{_0x248ecb[_0xf3a1('0x44')](_0xf3a1('0x5a'));}break;case _0xf3a1('0x5b'):if(isEmail(_0x40c0d3)){_0x153962[_0xf3a1('0x44')]('\x22'+_0x40c0d3+'\x22');}else{_0x248ecb['push'](_0xf3a1('0x5c'));}break;case'dateOfBirth':var _0x3bb91a=moment(_0x40c0d3,_0xf3a1('0x5d'),!![]);if(_0x3bb91a[_0xf3a1('0x57')]()){_0x153962[_0xf3a1('0x44')]('\x22'+_0x40c0d3+'\x22');}else{_0x248ecb[_0xf3a1('0x44')](_0xf3a1('0x5e'));}break;default:_0x153962[_0xf3a1('0x44')]('\x22'+_0x40c0d3+'\x22');}}else{switch(_0x426f75){case'firstName':case _0xf3a1('0x10'):_0x248ecb['push'](_0x426f75+'\x20not\x20specified');break;default:_0x153962[_0xf3a1('0x44')]('\x22\x22');}}}}if(_0x248ecb[_0xf3a1('0x51')]){handleError(_0x596ffa['data'][_0x15e5bb],{'code':_0xf3a1('0x5f'),'message':_0x248ecb['join']()});}else{fs['appendFileSync'](_0x179833,_0x153962['join']()+'\x0a');}_0x153962=[];}if(!(stats['rows']%0xc8)){socket[_0xf3a1('0x60')]('contact:import:'+_0x56a88a,stats);stats['errors']=[];}}if(stopped){logger[_0xf3a1('0x3f')](_0xf3a1('0x61'));_0xd1221c[_0xf3a1('0x62')]();}}catch(_0x4fef63){handleError(_0x596ffa[_0xf3a1('0x50')][_0x15e5bb],{'code':_0xf3a1('0x63'),'message':_0x4fef63[_0xf3a1('0x42')]});logger['error'](_0xf3a1('0x64'),_0x4fef63[_0xf3a1('0x42')]);}},'complete':function(){try{var _0x1ba02a=[];var _0x53ceae=_0xf3a1('0x27');if(_0x229c3f[_0xf3a1('0x65')]&&_0x229c3f[_0xf3a1('0x65')][_0xf3a1('0x51')]){_0x53ceae=_0xf3a1('0x66')+_0x56a88a;_0x1ba02a[_0xf3a1('0x44')]('CREATE\x20TABLE\x20'+_0x53ceae+'\x20LIKE\x20cm_contacts;');}var _0x26b64a=util[_0xf3a1('0xc')]('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',_0x179833,_0x53ceae,_0xd3f033,_0x229c3f[_0xf3a1('0x36')],_0x229c3f[_0xf3a1('0x37')]||null,NOW,NOW);if(_[_0xf3a1('0x67')](_0x3e3773[_0xf3a1('0x1e')])){_0x26b64a+=',\x20scheduledAt\x20=\x20NOW()';}_0x1ba02a[_0xf3a1('0x44')](_0x26b64a);if(_0x229c3f[_0xf3a1('0x65')]&&_0x229c3f[_0xf3a1('0x65')][_0xf3a1('0x51')]){_0x1ba02a[_0xf3a1('0x44')](insertCmContact(_0x229c3f['ListId'],_0x53ceae,_0x229c3f[_0xf3a1('0x65')],_0x3e3773));_0x1ba02a['push']('DROP\x20TABLE\x20'+_0x53ceae+';');}_0x1ba02a['push'](insertCmHopper(_0x229c3f['ListId'],_0xf3a1('0x68'),'voice_queues',_0xf3a1('0x69'),_0x2013bd));_0x1ba02a['push'](insertCmHopperBlack(_0x229c3f[_0xf3a1('0x36')],_0xf3a1('0x6a'),_0xf3a1('0x6b'),_0xf3a1('0x69')));_0x1ba02a[_0xf3a1('0x44')](insertCmHopper(_0x229c3f[_0xf3a1('0x36')],_0xf3a1('0x6c'),_0xf3a1('0x6d'),_0xf3a1('0x6e'),_0x2013bd));_0x1ba02a['push'](insertCmHopperBlack(_0x229c3f[_0xf3a1('0x36')],_0xf3a1('0x6f'),'campaigns',_0xf3a1('0x6e')));BPromise[_0xf3a1('0x70')](_0x1ba02a,handleQuery)['then'](function(_0x1d72d3){stats[_0xf3a1('0x71')]=!![];stats[_0xf3a1('0x72')]=_0x229c3f[_0xf3a1('0x65')]&&_0x229c3f[_0xf3a1('0x65')]['length']?results[0x2]['affectedRows']:results[0x0][_0xf3a1('0x72')];socket[_0xf3a1('0x60')](_0xf3a1('0x73')+_0x56a88a,stats);fs[_0xf3a1('0x74')](_0x161715);fs[_0xf3a1('0x74')](_0x179833);process[_0xf3a1('0x43')](0x0);})['catch'](function(_0x4b238c){logger[_0xf3a1('0x41')](_0x4b238c[_0xf3a1('0x42')]);process[_0xf3a1('0x43')](0x1);});}catch(_0x19a6bc){logger['error']('complete',_0x19a6bc['message']);process[_0xf3a1('0x43')](0x1);}},'error':function(_0x635242,_0x43e0f2,_0x112652,_0x37a80a){throw new Error(_0x37a80a);}});}function validate(){if(process[_0xf3a1('0x75')]&&process['argv'][_0xf3a1('0x51')]<0x4){throw new Error(_0xf3a1('0x76'));}var _0x195792=path[_0xf3a1('0x11')](config[_0xf3a1('0x4c')],_0xf3a1('0x4d'),process[_0xf3a1('0x75')][0x2]);if(!fs['existsSync'](_0x195792)){throw new Error(_0xf3a1('0x77'));}var _0x5c4390={};try{_0x5c4390=JSON['parse'](process[_0xf3a1('0x75')][0x3]);if(!_0x5c4390[_0xf3a1('0x4a')]){throw new Error(_0xf3a1('0x78'));}if(!_0x5c4390[_0xf3a1('0x4a')][_0xf3a1('0x10')]){throw new Error(_0xf3a1('0x79'));}if(!_0x5c4390[_0xf3a1('0x4a')]['firstName']){throw new Error(_0xf3a1('0x7a'));}var _0x467dc0=0x0;if(_0x5c4390['binding']['UserId']){_0x467dc0=0x1;}if(!_0x5c4390[_0xf3a1('0x36')]){throw new Error(_0xf3a1('0x7b'));}}catch(_0x5bed51){throw new Error(_0xf3a1('0x7c'));}var _0x3b9693=[];try{_0x3b9693=_[_0xf3a1('0x7d')](JSON[_0xf3a1('0x4f')](process[_0xf3a1('0x75')][0x4]),'id');}catch(_0x376fb4){logger['info'](_0xf3a1('0x7e'));}main(_0x195792,_0x5c4390,_0x3b9693,_0x467dc0);}validate();process['on'](_0xf3a1('0x7f'),handleStop);process['on'](_0xf3a1('0x80'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index e393a41..f3ca8f8 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf558=['***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','holdtime','Talk\x20Time','talktime','Member\x20Name','starttime','Answer\x20Time','answertime','endtime','Duration','duration','Billable\x20Time','billableseconds','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions'];(function(_0xf5391b,_0x5643dd){var _0x436b65=function(_0x2bfaf7){while(--_0x2bfaf7){_0xf5391b['push'](_0xf5391b['shift']());}};_0x436b65(++_0x5643dd);}(_0xf558,0x1e0));var _0x8f55=function(_0x4b2b5a,_0x3f7555){_0x4b2b5a=_0x4b2b5a-0x0;var _0x47f812=_0xf558[_0x4b2b5a];return _0x47f812;};'use strict';exports['getSubjects']=function(_0x5437bc,_0x35bd2d){var _0x4dd9b7=[{'type':_0x8f55('0x0'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x5437bc[_0x8f55('0x1')]()){case _0x8f55('0x2'):switch(_0x35bd2d[_0x8f55('0x1')]()){case _0x8f55('0x3'):_0x4dd9b7[_0x8f55('0x4')]({'type':_0x8f55('0x5'),'content':'','variableName':_0x8f55('0x6')});_0x4dd9b7[_0x8f55('0x4')]({'type':_0x8f55('0x5'),'content':'','variableName':_0x8f55('0x7')});break;case _0x8f55('0x8'):_0x4dd9b7[_0x8f55('0x4')]({'type':_0x8f55('0x0'),'content':_0x8f55('0x9'),'variableName':null});_0x4dd9b7[_0x8f55('0x4')]({'type':'variable','content':'','variableName':_0x8f55('0xa')});break;}}return _0x4dd9b7;};exports[_0x8f55('0xb')]=function(_0x4cc1ee,_0x2c427){var _0x478e2f=[];switch(_0x4cc1ee['toLowerCase']()){case _0x8f55('0x2'):switch(_0x2c427['toLowerCase']()){case'inbound':_0x478e2f=[{'type':'string','content':_0x8f55('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0xe'),'keyType':'variable','variableName':_0x8f55('0x7')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0xf'),'keyType':_0x8f55('0x5'),'variableName':_0x8f55('0x10')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x11'),'keyType':'variable','variableName':_0x8f55('0x12')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x13'),'keyType':'variable','variableName':'queue'},{'type':_0x8f55('0xd'),'content':'','key':'UniqueId','keyType':_0x8f55('0x5'),'variableName':'uniqueid'},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x14'),'keyType':_0x8f55('0x5'),'variableName':_0x8f55('0x15')},{'type':_0x8f55('0x0'),'content':_0x8f55('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x17'),'keyType':_0x8f55('0x5'),'variableName':_0x8f55('0x18')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x19'),'keyType':_0x8f55('0x5'),'variableName':_0x8f55('0xa')},{'type':_0x8f55('0x0'),'content':_0x8f55('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x8f55('0x1b'),'keyType':_0x8f55('0x5'),'variableName':'agentcalledAt'},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x1c'),'keyType':_0x8f55('0x5'),'variableName':'agentconnectAt'},{'type':'keyValue','content':'','key':'Agent\x20Complete','keyType':_0x8f55('0x5'),'variableName':'agentcompleteAt'},{'type':_0x8f55('0xd'),'content':'','key':'Hold\x20Time','keyType':_0x8f55('0x5'),'variableName':_0x8f55('0x1d')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x1e'),'keyType':'variable','variableName':_0x8f55('0x1f')}];break;case _0x8f55('0x8'):_0x478e2f=[{'type':'string','content':_0x8f55('0xc'),'variableName':null},{'type':_0x8f55('0xd'),'content':'','key':'Called\x20Number','keyType':_0x8f55('0x5'),'keyContent':'','variableName':_0x8f55('0xa')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x20'),'keyType':_0x8f55('0x5'),'keyContent':'','variableName':'membername'},{'type':_0x8f55('0xd'),'content':'','key':'UniqueId','keyType':_0x8f55('0x5'),'keyContent':'','variableName':'uniqueid'},{'type':'keyValue','content':'','key':_0x8f55('0x14'),'keyType':_0x8f55('0x5'),'keyContent':'','variableName':_0x8f55('0x21')},{'type':_0x8f55('0x0'),'content':_0x8f55('0x1a')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x22'),'keyType':_0x8f55('0x5'),'keyContent':'','variableName':_0x8f55('0x23')},{'type':_0x8f55('0xd'),'content':'','key':'Complete\x20Time','keyType':_0x8f55('0x5'),'keyContent':'','variableName':_0x8f55('0x24')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x25'),'keyType':'variable','keyContent':'','variableName':_0x8f55('0x26')},{'type':_0x8f55('0xd'),'content':'','key':_0x8f55('0x27'),'keyType':'variable','keyContent':'','variableName':_0x8f55('0x28')}];break;}}return _0x478e2f;}; \ No newline at end of file +var _0xde9d=['Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','Called\x20Number','starttime','answertime','endtime','Duration','duration','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','variable','queue','push','calleridnum','outbound','Outbound\x20Call','getDescriptions','inbound','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number'];(function(_0x13b07a,_0x49cfc3){var _0xdcbe0=function(_0x45dee2){while(--_0x45dee2){_0x13b07a['push'](_0x13b07a['shift']());}};_0xdcbe0(++_0x49cfc3);}(_0xde9d,0xa4));var _0xdde9=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xde9d[_0x20a584];return _0x4b41a8;};'use strict';exports[_0xdde9('0x0')]=function(_0xca9015,_0x30791d){var _0x3d2f85=[{'type':_0xdde9('0x1'),'content':_0xdde9('0x2'),'variableName':null}];switch(_0xca9015[_0xdde9('0x3')]()){case _0xdde9('0x4'):switch(_0x30791d['toLowerCase']()){case'inbound':_0x3d2f85['push']({'type':_0xdde9('0x5'),'content':'','variableName':_0xdde9('0x6')});_0x3d2f85[_0xdde9('0x7')]({'type':_0xdde9('0x5'),'content':'','variableName':_0xdde9('0x8')});break;case _0xdde9('0x9'):_0x3d2f85[_0xdde9('0x7')]({'type':_0xdde9('0x1'),'content':_0xdde9('0xa'),'variableName':null});_0x3d2f85[_0xdde9('0x7')]({'type':'variable','content':'','variableName':'destcalleridnum'});break;}}return _0x3d2f85;};exports[_0xdde9('0xb')]=function(_0xdb8353,_0x87dfcf){var _0x291b87=[];switch(_0xdb8353[_0xdde9('0x3')]()){case _0xdde9('0x4'):switch(_0x87dfcf[_0xdde9('0x3')]()){case _0xdde9('0xc'):_0x291b87=[{'type':_0xdde9('0x1'),'content':_0xdde9('0xd'),'key':null,'keyType':null,'variableName':null},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0xf'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x8')},{'type':'keyValue','content':'','key':_0xdde9('0x10'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x11')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x12'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x13')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x14'),'keyType':'variable','variableName':'queue'},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x15'),'keyType':'variable','variableName':_0xdde9('0x16')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x17'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x18')},{'type':'string','content':_0xdde9('0x19'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xdde9('0x1a'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x1b')},{'type':'keyValue','content':'','key':_0xdde9('0x1c'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x1d')},{'type':_0xdde9('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x1e'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x18')},{'type':_0xdde9('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x1f')},{'type':'keyValue','content':'','key':_0xdde9('0x20'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x21')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x22'),'keyType':_0xdde9('0x5'),'variableName':_0xdde9('0x23')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x24'),'keyType':'variable','variableName':_0xdde9('0x25')}];break;case _0xdde9('0x9'):_0x291b87=[{'type':_0xdde9('0x1'),'content':_0xdde9('0xd'),'variableName':null},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x26'),'keyType':_0xdde9('0x5'),'keyContent':'','variableName':_0xdde9('0x1d')},{'type':_0xdde9('0xe'),'content':'','key':'Member\x20Name','keyType':_0xdde9('0x5'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0xdde9('0x15'),'keyType':'variable','keyContent':'','variableName':_0xdde9('0x16')},{'type':_0xdde9('0xe'),'content':'','key':'Date','keyType':_0xdde9('0x5'),'keyContent':'','variableName':_0xdde9('0x27')},{'type':_0xdde9('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':'Answer\x20Time','keyType':'variable','keyContent':'','variableName':_0xdde9('0x28')},{'type':_0xdde9('0xe'),'content':'','key':'Complete\x20Time','keyType':_0xdde9('0x5'),'keyContent':'','variableName':_0xdde9('0x29')},{'type':_0xdde9('0xe'),'content':'','key':_0xdde9('0x2a'),'keyType':_0xdde9('0x5'),'keyContent':'','variableName':_0xdde9('0x2b')},{'type':'keyValue','content':'','key':'Billable\x20Time','keyType':_0xdde9('0x5'),'keyContent':'','variableName':_0xdde9('0x2c')}];break;}}return _0x291b87;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 84321e4..81b462a 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2f53=['info','error','tracked','user','query','clone','body','omit','phone','lodash','../../mysqldb','openchannel-interactions','mail-interactions','../../config/logger','sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','role','stringify','null','Interaction','findOne','update','then'];(function(_0x281305,_0x2998d6){var _0x56ffbe=function(_0x270b4c){while(--_0x270b4c){_0x281305['push'](_0x281305['shift']());}};_0x56ffbe(++_0x2998d6);}(_0x2f53,0x1d4));var _0x32f5=function(_0x3063fa,_0x47816b){_0x3063fa=_0x3063fa-0x0;var _0x27b09f=_0x2f53[_0x3063fa];return _0x27b09f;};'use strict';var _=require(_0x32f5('0x0'));var db=require(_0x32f5('0x1'))['db'];var loggers={'openchannel':require('../../config/logger')(_0x32f5('0x2')),'mail':require('../../config/logger')(_0x32f5('0x3')),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x32f5('0x4'))(_0x32f5('0x5')),'chat':require(_0x32f5('0x4'))('chat-interactions'),'whatsapp':require(_0x32f5('0x4'))(_0x32f5('0x6'))};function getInteractionId(_0x3ea325,_0x242656,_0x880c73){if(_0x3ea325&&_0x3ea325[_[_0x32f5('0x7')](_0x880c73)+_0x32f5('0x8')]){return _0x3ea325[_['upperFirst'](_0x880c73)+_0x32f5('0x8')];}else if(_0x3ea325&&_0x3ea325['id']){return _0x3ea325['id'];}else if(_0x242656&&_0x242656['id']){return _0x242656['id'];}else{return _0x32f5('0x9');}}function log(_0x46e7f4,_0x545a0e,_0x55b62e,_0x56d332,_0x3e40c7,_0xc8824f){loggers[_0x3e40c7[_0x32f5('0xa')]()][_0x46e7f4]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xc8824f['toUpperCase'](),_0x545a0e?_0x545a0e['id']:null,_0x545a0e?_0x545a0e['name']:null,_0x545a0e?_0x545a0e[_0x32f5('0xb')]:null,getInteractionId(_0x55b62e,_0x56d332,_0x3e40c7),_0x55b62e?JSON[_0x32f5('0xc')](_0x55b62e):_0x32f5('0xd'));}function updateUser(_0x32124c,_0x3a7ebf,_0x3a83f8,_0x25009d,_0x1f8553){db[_[_0x32f5('0x7')](_0x25009d)+_0x32f5('0xe')][_0x32f5('0xf')]({'where':{'id':getInteractionId(_0x3a7ebf,_0x3a83f8,_0x25009d)}})['then'](function(_0x438b1c){if(_0x438b1c){return _0x438b1c[_0x32f5('0x10')]({'UserId':_0x32124c?_0x32124c['id']:null});}})[_0x32f5('0x11')](function(_0x1a52f7){if(_0x1a52f7){log(_0x32f5('0x12'),_0x32124c,_0x3a7ebf,_0x3a83f8,_0x25009d,_0x1f8553);}})['catch'](function(){log(_0x32f5('0x13'),_0x32124c,_0x3a7ebf,_0x3a83f8,_0x25009d,_0x1f8553);});}exports[_0x32f5('0x14')]=function(_0x4f7196,_0x172556){return function(_0x10cb42,_0x5890a1,_0x4b5fd1){var _0xa4aadb=_0x10cb42[_0x32f5('0x15')];var _0x439603={};var _0x3bb01a=_0x10cb42[_0x32f5('0x16')];if(_0x439603){_0x439603=_[_0x32f5('0x17')](_0x10cb42[_0x32f5('0x18')]);_0x439603=_[_0x32f5('0x19')](_0x439603,[_0x32f5('0x18'),'html',_0x32f5('0x1a'),'fax','mobile']);}updateUser(_0xa4aadb,_0x439603,_0x3bb01a,_0x4f7196,_0x172556);_0x4b5fd1(null);};}; \ No newline at end of file +var _0x1861=['catch','error','tracked','query','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','sms-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info'];(function(_0x4c627b,_0x2d588d){var _0x5c8a98=function(_0x3bfaa8){while(--_0x3bfaa8){_0x4c627b['push'](_0x4c627b['shift']());}};_0x5c8a98(++_0x2d588d);}(_0x1861,0x10a));var _0x1186=function(_0x1a7f1e,_0x1cf0a9){_0x1a7f1e=_0x1a7f1e-0x0;var _0x5f0e1f=_0x1861[_0x1a7f1e];return _0x5f0e1f;};'use strict';var _=require(_0x1186('0x0'));var db=require(_0x1186('0x1'))['db'];var loggers={'openchannel':require(_0x1186('0x2'))(_0x1186('0x3')),'mail':require(_0x1186('0x2'))('mail-interactions'),'fax':require(_0x1186('0x2'))('fax-interactions'),'sms':require(_0x1186('0x2'))(_0x1186('0x4')),'chat':require(_0x1186('0x2'))(_0x1186('0x5')),'whatsapp':require('../../config/logger')(_0x1186('0x6'))};function getInteractionId(_0xb02356,_0x37348d,_0x4fe60e){if(_0xb02356&&_0xb02356[_[_0x1186('0x7')](_0x4fe60e)+_0x1186('0x8')]){return _0xb02356[_['upperFirst'](_0x4fe60e)+_0x1186('0x8')];}else if(_0xb02356&&_0xb02356['id']){return _0xb02356['id'];}else if(_0x37348d&&_0x37348d['id']){return _0x37348d['id'];}else{return _0x1186('0x9');}}function log(_0x484894,_0x226532,_0x1544a2,_0x4e8c47,_0x85a6b7,_0x5b0252){loggers[_0x85a6b7[_0x1186('0xa')]()][_0x484894](_0x1186('0xb'),_0x5b0252[_0x1186('0xc')](),_0x226532?_0x226532['id']:null,_0x226532?_0x226532[_0x1186('0xd')]:null,_0x226532?_0x226532[_0x1186('0xe')]:null,getInteractionId(_0x1544a2,_0x4e8c47,_0x85a6b7),_0x1544a2?JSON[_0x1186('0xf')](_0x1544a2):_0x1186('0x10'));}function updateUser(_0x351247,_0x223408,_0x4c63b9,_0x442719,_0x1d107f){db[_[_0x1186('0x7')](_0x442719)+_0x1186('0x11')][_0x1186('0x12')]({'where':{'id':getInteractionId(_0x223408,_0x4c63b9,_0x442719)}})[_0x1186('0x13')](function(_0x2c328e){if(_0x2c328e){return _0x2c328e[_0x1186('0x14')]({'UserId':_0x351247?_0x351247['id']:null});}})['then'](function(_0x4fd208){if(_0x4fd208){log(_0x1186('0x15'),_0x351247,_0x223408,_0x4c63b9,_0x442719,_0x1d107f);}})[_0x1186('0x16')](function(){log(_0x1186('0x17'),_0x351247,_0x223408,_0x4c63b9,_0x442719,_0x1d107f);});}exports[_0x1186('0x18')]=function(_0x27a7a0,_0x44fb3e){return function(_0x337a95,_0x3b7eef,_0x1ed7f0){var _0x48b365=_0x337a95['user'];var _0x1e962a={};var _0x4485f1=_0x337a95[_0x1186('0x19')];if(_0x1e962a){_0x1e962a=_[_0x1186('0x1a')](_0x337a95[_0x1186('0x1b')]);_0x1e962a=_[_0x1186('0x1c')](_0x1e962a,['body',_0x1186('0x1d'),_0x1186('0x1e'),_0x1186('0x1f'),'mobile']);}updateUser(_0x48b365,_0x1e962a,_0x4485f1,_0x27a7a0,_0x44fb3e);_0x1ed7f0(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index d50b84a..8998360 100644 --- a/server/components/license/service.js +++ b/server/components/license/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd31d=['format','%s:%s:%s','update','final','parse','hasOwnProperty','License','then','count','status','json','users','user','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','aes-256-ctr'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0xd31d,0x12b));var _0xdd31=function(_0x1d6a82,_0x37c315){_0x1d6a82=_0x1d6a82-0x0;var _0x5834ac=_0xd31d[_0x1d6a82];return _0x5834ac;};'use strict';var crypto=require(_0xdd31('0x0'));var util=require(_0xdd31('0x1'));var compose=require(_0xdd31('0x2'));var db=require(_0xdd31('0x3'))['db'];var config=require(_0xdd31('0x4'));function getValueFromLicense(_0x3e326a,_0x1b49a5){if(_0x3e326a&&_0x1b49a5){if(_0x1b49a5[_0xdd31('0x5')]&&_0x1b49a5[_0xdd31('0x6')]){var _0x4ca8a8=_0x1b49a5['data1'];var _0x8dcb98=_0x1b49a5['license'];var _0x5870aa=_0x4ca8a8[_0xdd31('0x7')]('-')[0x4];var _0x3aba6a=_0x4ca8a8[_0xdd31('0x7')]('-')[0x0];var _0x20cda7=crypto['createDecipher'](_0xdd31('0x8'),util[_0xdd31('0x9')](_0xdd31('0xa'),_0x5870aa,_0x4ca8a8,_0x3aba6a));var _0x2c8094=_0x20cda7[_0xdd31('0xb')](_0x8dcb98,'base64','utf8');_0x2c8094+=_0x20cda7[_0xdd31('0xc')]('utf8');var _0x5a7bda=JSON[_0xdd31('0xd')](_0x2c8094);return _0x5a7bda[_0xdd31('0xe')](_0x3e326a)?_0x5a7bda[_0x3e326a]:null;}}return null;}function isLimit(_0x4f9619,_0x415fda,_0x1822c8,_0x166239){var _0x59b071=_0x415fda;return compose()['use'](function(_0x51a45f,_0x314be1,_0x3e1d3a){return db[_0xdd31('0xf')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0xdd31('0x10')](function(_0x28c04d){var _0x337802=getValueFromLicense(_0x4f9619,_0x28c04d);return _0x337802?_0x337802:_0x59b071;})['then'](function(_0x31a492){_0x59b071=_0x31a492;return _0x1822c8[_0xdd31('0x11')](_0x166239);})[_0xdd31('0x10')](function(_0x19b74d){if(_0x19b74d>=_0x59b071){return _0x314be1[_0xdd31('0x12')](0x193)[_0xdd31('0x13')]({'message':util[_0xdd31('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x4f9619)});}_0x3e1d3a();})['catch'](function(_0x428232){_0x3e1d3a(_0x428232);});});}function isUserLimit(){return isLimit(_0xdd31('0x14'),0x1,db['User'],{'where':{'$or':[{'role':'admin'},{'role':_0xdd31('0x15')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x3494=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','license','data1','split','createDecipher','aes-256-ctr','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','format'];(function(_0x15941c,_0x4038de){var _0x466b9c=function(_0x488f69){while(--_0x488f69){_0x15941c['push'](_0x15941c['shift']());}};_0x466b9c(++_0x4038de);}(_0x3494,0x69));var _0x4349=function(_0x506967,_0x5567ef){_0x506967=_0x506967-0x0;var _0x4f4c5a=_0x3494[_0x506967];return _0x4f4c5a;};'use strict';var crypto=require(_0x4349('0x0'));var util=require(_0x4349('0x1'));var compose=require(_0x4349('0x2'));var db=require(_0x4349('0x3'))['db'];var config=require(_0x4349('0x4'));function getValueFromLicense(_0x4ebb05,_0x20557f){if(_0x4ebb05&&_0x20557f){if(_0x20557f['data1']&&_0x20557f[_0x4349('0x5')]){var _0x508144=_0x20557f[_0x4349('0x6')];var _0xa7afbe=_0x20557f[_0x4349('0x5')];var _0x297c4f=_0x508144[_0x4349('0x7')]('-')[0x4];var _0x41327d=_0x508144[_0x4349('0x7')]('-')[0x0];var _0x173016=crypto[_0x4349('0x8')](_0x4349('0x9'),util['format']('%s:%s:%s',_0x297c4f,_0x508144,_0x41327d));var _0x11b1db=_0x173016['update'](_0xa7afbe,_0x4349('0xa'),_0x4349('0xb'));_0x11b1db+=_0x173016[_0x4349('0xc')](_0x4349('0xb'));var _0x356181=JSON[_0x4349('0xd')](_0x11b1db);return _0x356181[_0x4349('0xe')](_0x4ebb05)?_0x356181[_0x4ebb05]:null;}}return null;}function isLimit(_0x1daded,_0x2f98bb,_0x38ad68,_0x32d4d1){var _0x9c77ec=_0x2f98bb;return compose()[_0x4349('0xf')](function(_0x303953,_0x58af00,_0x541c1a){return db[_0x4349('0x10')][_0x4349('0x11')]({'where':{'id':0x1},'raw':!![]})[_0x4349('0x12')](function(_0x2fcdca){var _0x2a28f7=getValueFromLicense(_0x1daded,_0x2fcdca);return _0x2a28f7?_0x2a28f7:_0x9c77ec;})[_0x4349('0x12')](function(_0x412f55){_0x9c77ec=_0x412f55;return _0x38ad68['count'](_0x32d4d1);})['then'](function(_0x269313){if(_0x269313>=_0x9c77ec){return _0x58af00['status'](0x193)['json']({'message':util[_0x4349('0x13')](_0x4349('0x14'),_0x1daded)});}_0x541c1a();})[_0x4349('0x15')](function(_0x2c7bef){_0x541c1a(_0x2c7bef);});});}function isUserLimit(){return isLimit('users',0x1,db['User'],{'where':{'$or':[{'role':_0x4349('0x16')},{'role':_0x4349('0x17')}]}});}exports[_0x4349('0x18')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index a48406e..9294294 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 _0x8fee=['shift','pop','utcOffset','hours','minutes','seconds','lodash','sqlOperator','startsWith','[$or]','replace','[$and]','split','length','slice','forEach','match','filter','indexOf','map','push','buildExpression','DATE','$between','value','includes','$lte','operator','add','days','format','YYYY-MM-DD','castTo','text','\x20AS\x20','$ne','$notIn','field','\x20IS\x20NULL)','NOT\x20IN\x20?','$eq','=\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$in','start'];(function(_0x2babda,_0x52ae70){var _0x52c27b=function(_0x577dc3){while(--_0x577dc3){_0x2babda['push'](_0x2babda['shift']());}};_0x52c27b(++_0x52ae70);}(_0x8fee,0x74));var _0xe8fe=function(_0x2718c7,_0x5a1636){_0x2718c7=_0x2718c7-0x0;var _0x59d89c=_0x8fee[_0x2718c7];return _0x59d89c;};'use strict';var _=require(_0xe8fe('0x0'));var moment=require('moment');exports['parseSearch']=function(_0x45d312){var _0x2cda6d={'conditions':[]};_0x2cda6d[_0xe8fe('0x1')]=_[_0xe8fe('0x2')](_0x45d312,_0xe8fe('0x3'))?'or':'and';var _0x519718=_0x45d312[_0xe8fe('0x4')](_0xe8fe('0x5'),'')[_0xe8fe('0x4')](_0xe8fe('0x3'),'')[_0xe8fe('0x6')]('||');for(var _0x27133f=0x0;_0x27133f<_0x519718[_0xe8fe('0x7')];_0x27133f++){var _0xc41bda=_0x519718[_0x27133f][_0xe8fe('0x6')](':=');var _0x5066cf=_0xc41bda[0x0];var _0x18b2a3=_0xc41bda[_0xe8fe('0x8')](0x1);_0x18b2a3[_0xe8fe('0x9')](function(_0x22c4ca){var _0x540718=_0x22c4ca['split']('[')['shift']();var _0x4bc547=_0x22c4ca[_0xe8fe('0xa')](/\[(.*?)\]/g);_0x4bc547[_0xe8fe('0x9')](function(_0x1f2f28){var _0x4e25fb=_0x1f2f28['split']('[')[_0xe8fe('0xb')](function(_0x1ab571){return _0x1ab571[_0xe8fe('0xc')](']')>-0x1;})[_0xe8fe('0xd')](function(_0xea4328){return _0xea4328['split'](']')[0x0];})[0x0];_0x2cda6d['conditions'][_0xe8fe('0xe')]({'field':_0x5066cf,'operator':_0x540718,'value':_0x4e25fb});});});}return _0x2cda6d;};exports[_0xe8fe('0xf')]=function(_0x4707ba,_0x3bcd55,_0x4f637c){var _0x185c65={};if(_0x3bcd55===_0xe8fe('0x10')){if(_0x4f637c['operator']==='$eq'){_0x4f637c['operator']=_0xe8fe('0x11');_0x4f637c[_0xe8fe('0x12')]+=','+_0x4f637c['value'];}else if(_[_0xe8fe('0x13')](['$gt',_0xe8fe('0x14')],_0x4f637c[_0xe8fe('0x15')])){_0x4f637c['value']=moment(_0x4f637c['value'])[_0xe8fe('0x16')](0x1,_0xe8fe('0x17'))[_0xe8fe('0x18')](_0xe8fe('0x19'));}}if(_0x4f637c[_0xe8fe('0x1a')]){_0x3bcd55=_0x4f637c[_0xe8fe('0x1a')];_0x185c65[_0xe8fe('0x1b')]='CAST('+_0x4707ba+'.'+_0x4f637c['field']+_0xe8fe('0x1c')+_0x4f637c[_0xe8fe('0x1a')]+')\x20'+parseOperator(_0x4f637c['operator']);}else{_0x185c65[_0xe8fe('0x1b')]=_0x4707ba+'.'+_0x4f637c['field']+'\x20'+parseOperator(_0x4f637c[_0xe8fe('0x15')]);}if(_[_0xe8fe('0x13')]([_0xe8fe('0x1d'),_0xe8fe('0x1e')],_0x4f637c[_0xe8fe('0x15')]))_0x185c65['text']='('+_0x185c65[_0xe8fe('0x1b')]+'\x20OR\x20'+_0x4707ba+'.'+_0x4f637c[_0xe8fe('0x1f')]+_0xe8fe('0x20');_0x185c65[_0xe8fe('0x12')]=parseValue(_0x3bcd55,_0x4f637c[_0xe8fe('0x15')],_0x4f637c[_0xe8fe('0x12')]);return _0x185c65;};function parseOperator(_0x924ba){var _0x31264b;switch(_0x924ba){case'$in':_0x31264b='IN\x20?';break;case _0xe8fe('0x1e'):_0x31264b=_0xe8fe('0x21');break;case _0xe8fe('0x22'):_0x31264b=_0xe8fe('0x23');break;case _0xe8fe('0x1d'):_0x31264b=_0xe8fe('0x24');break;case _0xe8fe('0x25'):case _0xe8fe('0x26'):case _0xe8fe('0x27'):_0x31264b=_0xe8fe('0x28');break;case'$lt':_0x31264b=_0xe8fe('0x29');break;case _0xe8fe('0x2a'):_0x31264b='>\x20?';break;case _0xe8fe('0x14'):_0x31264b=_0xe8fe('0x2b');break;case _0xe8fe('0x2c'):_0x31264b=_0xe8fe('0x2d');break;case'$between':_0x31264b=_0xe8fe('0x2e');break;}return _0x31264b;}function parseValue(_0x236a72,_0x4452d3,_0x299420){var _0x1d2254={'start':undefined,'end':undefined};switch(_0x4452d3){case _0xe8fe('0x2f'):case _0xe8fe('0x1e'):_0x1d2254[_0xe8fe('0x30')]=_0x299420[_0xe8fe('0x6')](',');break;case _0xe8fe('0x25'):_0x1d2254['start']='%'+_0x299420+'%';break;case _0xe8fe('0x26'):_0x1d2254[_0xe8fe('0x30')]=_0x299420+'%';break;case _0xe8fe('0x27'):_0x1d2254[_0xe8fe('0x30')]='%'+_0x299420;break;case'$between':var _0x501a52=_0x299420[_0xe8fe('0x6')](',');var _0x299420=_0x501a52[_0xe8fe('0x31')]();var _0x3c7041=_0x501a52[_0xe8fe('0x32')]();if(_0x236a72===_0xe8fe('0x10')){_0x299420=moment(_0x299420)[_0xe8fe('0x33')](0x0,!![])['format']();_0x3c7041=moment(_0x3c7041)[_0xe8fe('0x33')](0x0,!![])[_0xe8fe('0x16')](0x17,_0xe8fe('0x34'))[_0xe8fe('0x16')](0x3b,_0xe8fe('0x35'))['add'](0x3b,_0xe8fe('0x36'))['format']();}_0x1d2254={'start':_0x299420,'end':_0x3c7041};break;default:_0x1d2254[_0xe8fe('0x30')]=_0x299420;break;}return _0x1d2254;} \ No newline at end of file +var _0x0796=['minutes','seconds','lodash','moment','sqlOperator','[$or]','and','replace','[$and]','length','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','DATE','operator','$eq','value','$gt','add','format','castTo','text','\x20AS\x20','includes','$ne','$notIn','field','\x20IS\x20NULL)','$in','NOT\x20IN\x20?','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','<\x20?','>\x20?','$lte','<=\x20?','$gte','>=\x20?','$between','start','pop','utcOffset','hours'];(function(_0x49d19d,_0x245cf5){var _0x4ebef1=function(_0xf0a4e6){while(--_0xf0a4e6){_0x49d19d['push'](_0x49d19d['shift']());}};_0x4ebef1(++_0x245cf5);}(_0x0796,0x6e));var _0x6079=function(_0x4e437c,_0x3a00f1){_0x4e437c=_0x4e437c-0x0;var _0x4db277=_0x0796[_0x4e437c];return _0x4db277;};'use strict';var _=require(_0x6079('0x0'));var moment=require(_0x6079('0x1'));exports['parseSearch']=function(_0x49ca42){var _0x3e9c8f={'conditions':[]};_0x3e9c8f[_0x6079('0x2')]=_['startsWith'](_0x49ca42,_0x6079('0x3'))?'or':_0x6079('0x4');var _0x281c71=_0x49ca42[_0x6079('0x5')](_0x6079('0x6'),'')[_0x6079('0x5')](_0x6079('0x3'),'')['split']('||');for(var _0x3ca21e=0x0;_0x3ca21e<_0x281c71[_0x6079('0x7')];_0x3ca21e++){var _0x18e2df=_0x281c71[_0x3ca21e][_0x6079('0x8')](':=');var _0x42c605=_0x18e2df[0x0];var _0x3219ad=_0x18e2df[_0x6079('0x9')](0x1);_0x3219ad[_0x6079('0xa')](function(_0x593e73){var _0x410336=_0x593e73[_0x6079('0x8')]('[')[_0x6079('0xb')]();var _0x1f1bad=_0x593e73[_0x6079('0xc')](/\[(.*?)\]/g);_0x1f1bad[_0x6079('0xa')](function(_0x5eb7a2){var _0x352f25=_0x5eb7a2[_0x6079('0x8')]('[')[_0x6079('0xd')](function(_0x4cacbb){return _0x4cacbb[_0x6079('0xe')](']')>-0x1;})[_0x6079('0xf')](function(_0x5e426a){return _0x5e426a['split'](']')[0x0];})[0x0];_0x3e9c8f[_0x6079('0x10')][_0x6079('0x11')]({'field':_0x42c605,'operator':_0x410336,'value':_0x352f25});});});}return _0x3e9c8f;};exports[_0x6079('0x12')]=function(_0x4298e5,_0x466198,_0x1a4854){var _0x198bfc={};if(_0x466198===_0x6079('0x13')){if(_0x1a4854[_0x6079('0x14')]===_0x6079('0x15')){_0x1a4854[_0x6079('0x14')]='$between';_0x1a4854[_0x6079('0x16')]+=','+_0x1a4854['value'];}else if(_['includes']([_0x6079('0x17'),'$lte'],_0x1a4854[_0x6079('0x14')])){_0x1a4854['value']=moment(_0x1a4854['value'])[_0x6079('0x18')](0x1,'days')[_0x6079('0x19')]('YYYY-MM-DD');}}if(_0x1a4854[_0x6079('0x1a')]){_0x466198=_0x1a4854[_0x6079('0x1a')];_0x198bfc[_0x6079('0x1b')]='CAST('+_0x4298e5+'.'+_0x1a4854['field']+_0x6079('0x1c')+_0x1a4854[_0x6079('0x1a')]+')\x20'+parseOperator(_0x1a4854[_0x6079('0x14')]);}else{_0x198bfc[_0x6079('0x1b')]=_0x4298e5+'.'+_0x1a4854['field']+'\x20'+parseOperator(_0x1a4854[_0x6079('0x14')]);}if(_[_0x6079('0x1d')]([_0x6079('0x1e'),_0x6079('0x1f')],_0x1a4854[_0x6079('0x14')]))_0x198bfc[_0x6079('0x1b')]='('+_0x198bfc[_0x6079('0x1b')]+'\x20OR\x20'+_0x4298e5+'.'+_0x1a4854[_0x6079('0x20')]+_0x6079('0x21');_0x198bfc[_0x6079('0x16')]=parseValue(_0x466198,_0x1a4854[_0x6079('0x14')],_0x1a4854[_0x6079('0x16')]);return _0x198bfc;};function parseOperator(_0x42a83b){var _0x57fbeb;switch(_0x42a83b){case _0x6079('0x22'):_0x57fbeb='IN\x20?';break;case'$notIn':_0x57fbeb=_0x6079('0x23');break;case'$eq':_0x57fbeb='=\x20?';break;case'$ne':_0x57fbeb=_0x6079('0x24');break;case _0x6079('0x25'):case _0x6079('0x26'):case _0x6079('0x27'):_0x57fbeb=_0x6079('0x28');break;case'$lt':_0x57fbeb=_0x6079('0x29');break;case'$gt':_0x57fbeb=_0x6079('0x2a');break;case _0x6079('0x2b'):_0x57fbeb=_0x6079('0x2c');break;case _0x6079('0x2d'):_0x57fbeb=_0x6079('0x2e');break;case _0x6079('0x2f'):_0x57fbeb='BETWEEN\x20?\x20AND\x20?';break;}return _0x57fbeb;}function parseValue(_0x48b213,_0x501654,_0x48af42){var _0x48bd2b={'start':undefined,'end':undefined};switch(_0x501654){case _0x6079('0x22'):case _0x6079('0x1f'):_0x48bd2b['start']=_0x48af42[_0x6079('0x8')](',');break;case'$substring':_0x48bd2b['start']='%'+_0x48af42+'%';break;case _0x6079('0x26'):_0x48bd2b[_0x6079('0x30')]=_0x48af42+'%';break;case _0x6079('0x27'):_0x48bd2b[_0x6079('0x30')]='%'+_0x48af42;break;case _0x6079('0x2f'):var _0x2f30b0=_0x48af42[_0x6079('0x8')](',');var _0x48af42=_0x2f30b0['shift']();var _0x2e1cbe=_0x2f30b0[_0x6079('0x31')]();if(_0x48b213===_0x6079('0x13')){_0x48af42=moment(_0x48af42)[_0x6079('0x32')](0x0,!![])[_0x6079('0x19')]();_0x2e1cbe=moment(_0x2e1cbe)[_0x6079('0x32')](0x0,!![])[_0x6079('0x18')](0x17,_0x6079('0x33'))[_0x6079('0x18')](0x3b,_0x6079('0x34'))[_0x6079('0x18')](0x3b,_0x6079('0x35'))['format']();}_0x48bd2b={'start':_0x48af42,'end':_0x2e1cbe};break;default:_0x48bd2b['start']=_0x48af42;break;}return _0x48bd2b;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6ba4b07..c249660 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 _0x4b19=['subtract','name','uniqueid','isArray','limit','sort','indexOf','priority','cast','col','unsigned','substr','DESC','omit','isObject','length','unset','isNumeric','match','^[+]?[0-9]*$','isEmail','getFullTextValue','replace','push','join','query','$id','model','map','intersection','attributes','nolimit','offset','order','where','filters','pick','filter','object','includes','columns','merge','VIRTUAL','lower','options','lodash','moment','parse','keys','fields','split','isEmpty','forOwn','find','type','DATE','isPlainObject','$gte','utc','format'];(function(_0x5d6c3e,_0x409a3e){var _0x44ecb7=function(_0x936b6a){while(--_0x936b6a){_0x5d6c3e['push'](_0x5d6c3e['shift']());}};_0x44ecb7(++_0x409a3e);}(_0x4b19,0x195));var _0x94b1=function(_0xf88629,_0x170f07){_0xf88629=_0xf88629-0x0;var _0x4b6536=_0x4b19[_0xf88629];return _0x4b6536;};'use strict';var _=require(_0x94b1('0x0'));var sequelize=require('sequelize');var moment=require(_0x94b1('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x32f392){var _0x221ab3=['ne'];try{var _0x577f52=JSON[_0x94b1('0x2')](_0x32f392);var _0x3648ad=Object[_0x94b1('0x3')](_0x577f52)[0x0];return _0x221ab3['includes'](_0x3648ad);}catch(_0x1310cd){return![];}}function getOperatorValue(_0x11e23c){var _0x52d6c1=JSON[_0x94b1('0x2')](_0x11e23c);var _0x110a52=Object['keys'](_0x52d6c1)[0x0];var _0x40c69c=_0x52d6c1[_0x110a52];return{['$'+_0x110a52]:_0x40c69c};}exports[_0x94b1('0x4')]=function(_0xad0a85){var _0x5aee5f=null;if(_0xad0a85){_0x5aee5f=_0xad0a85[_0x94b1('0x5')](',');}return _0x5aee5f;};exports['filters']=function(_0x4aafcc,_0x3c2080){var _0x126424={};if(!_[_0x94b1('0x6')](_0x4aafcc)){_[_0x94b1('0x7')](_0x4aafcc,function(_0x162995,_0x3aeb91){try{if(_0x3c2080){var _0x4a8ea2=_[_0x94b1('0x8')](_0x3c2080,{'name':_0x3aeb91})||{};if(hasSequelizeOperator(_0x162995)){_0x126424[_0x3aeb91]=getOperatorValue(_0x162995);}else if(_0x4a8ea2[_0x94b1('0x9')]===_0x94b1('0xa')&&_[_0x94b1('0xb')](_0x162995)){var _0x5cbf96=JSON['parse'](_0x162995);var _0x26484b={'$gte':moment(moment(_0x5cbf96[_0x94b1('0xc')])['format']('YYYY-MM-DD'))[_0x94b1('0xd')]()[_0x94b1('0xe')](),'$lte':moment(moment(_0x5cbf96['$lte'])[_0x94b1('0xe')]('YYYY-MM-DD'))['utc']()[_0x94b1('0xf')](0x1,'s')[_0x94b1('0xe')]()};_0x126424[_0x3aeb91]=_0x26484b;}else if(_0x4a8ea2[_0x94b1('0x10')]===_0x94b1('0x11')){_0x126424[_0x3aeb91]=_0x162995;}else{_0x126424[_0x3aeb91]=_['isArray'](_0x162995)?_0x162995:JSON[_0x94b1('0x2')](_0x162995);}}else{_0x126424[_0x3aeb91]=_[_0x94b1('0x12')](_0x162995)?_0x162995:JSON[_0x94b1('0x2')](_0x162995);}}catch(_0x224099){_0x126424[_0x3aeb91]=_0x162995[_0x94b1('0x5')](',');}});}return _0x126424;};exports[_0x94b1('0x13')]=function(_0x2d33dc){_0x2d33dc=parseInt(_0x2d33dc,0xa);if(!_0x2d33dc||_0x2d33dc<0x0){_0x2d33dc=LIMIT_VALUE;}return _0x2d33dc;};exports['offset']=function(_0x30f969){_0x30f969=parseInt(_0x30f969,0xa);if(!_0x30f969||_0x30f969<0x0){_0x30f969=0x0;}return _0x30f969;};exports[_0x94b1('0x14')]=function(_0x1fcb91){var _0x5deb20,_0x4490c9=null;if(_0x1fcb91){_0x5deb20=_0x1fcb91[_0x94b1('0x5')](',');_0x4490c9=_['map'](_0x5deb20,function(_0x602c3b){if(_0x602c3b[_0x94b1('0x15')]('-')===0x0){return[_0x602c3b===_0x94b1('0x16')?sequelize[_0x94b1('0x17')](sequelize[_0x94b1('0x18')](_0x94b1('0x16')),_0x94b1('0x19')):_0x602c3b[_0x94b1('0x1a')](0x1),_0x94b1('0x1b')];}else{return[_0x602c3b===_0x94b1('0x16')?sequelize['cast'](sequelize[_0x94b1('0x18')](_0x94b1('0x16')),_0x94b1('0x19')):_0x602c3b,'ASC'];}});}return _0x4490c9;};exports[_0x94b1('0x1c')]=function(_0x5af4f5,_0x269925){if(_[_0x94b1('0x6')](_0x5af4f5)){return _0x5af4f5;}if(_[_0x94b1('0x12')](_0x5af4f5)){for(var _0x109a81=0x0;_0x109a81<_0x5af4f5['length'];_0x109a81+=0x1){_0x5af4f5[_0x109a81]=this['omit'](_0x5af4f5[_0x109a81],_0x269925);}return _0x5af4f5;}if(!_[_0x94b1('0x1d')](_0x5af4f5)){return _0x5af4f5;}if(_['isString'](_0x269925)){_0x269925=[_0x269925];}if(!_[_0x94b1('0x12')](_0x269925)){return _0x5af4f5;}for(var _0x5c3a9a=0x0;_0x5c3a9a<_0x269925[_0x94b1('0x1e')];_0x5c3a9a+=0x1){_[_0x94b1('0x1f')](_0x5af4f5,_0x269925[_0x5c3a9a]);}for(var _0x1eda8c in _0x5af4f5){if(_0x5af4f5['hasOwnProperty'](_0x1eda8c)){_0x5af4f5[_0x1eda8c]=this[_0x94b1('0x1c')](_0x5af4f5[_0x1eda8c],_0x269925);}}return _0x5af4f5;};exports[_0x94b1('0x20')]=function(_0x467c42){return _0x467c42[_0x94b1('0x21')](RegExp(_0x94b1('0x22')))?!![]:![];};exports[_0x94b1('0x23')]=function(_0x2661ca){return _0x2661ca[_0x94b1('0x21')](/^\S+@\S+$/)?!![]:![];};exports[_0x94b1('0x24')]=function(_0x597af3){var _0x2eb1fa=[];_0x597af3[_0x94b1('0x5')](/[ ,]+/)['forEach'](function(_0x42630a){_0x42630a=_0x42630a[_0x94b1('0x25')](/([^:]")"+/g,'$1');_0x42630a='+'+_0x42630a+'*';var _0xab9ac5=/[ `!@#$%^&*()_\-?~]/;if(_0x42630a[_0x94b1('0x21')](_0xab9ac5))_0x42630a='\x22'+_0x42630a+'\x22';_0x2eb1fa[_0x94b1('0x26')](_0x42630a);});return _0x2eb1fa[_0x94b1('0x27')]('\x20');};exports['getOptions']=function(_0x1a26eb,_0x5d765b,_0x2def34){var _0x51d67c={},_0x57e497={};if(_0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')]){_0x5d765b[_0x94b1('0x28')]['id']=_0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')];delete _0x5d765b[_0x94b1('0x28')][_0x94b1('0x29')];}_0x51d67c[_0x94b1('0x2a')]=_[_0x94b1('0x2b')](_0x1a26eb,_0x94b1('0x10'));_0x51d67c[_0x94b1('0x28')]=_[_0x94b1('0x3')](_0x5d765b['query']);_0x51d67c['filters']=_[_0x94b1('0x2c')](_0x51d67c[_0x94b1('0x2a')],_0x51d67c[_0x94b1('0x28')]);_0x57e497[_0x94b1('0x2d')]=_[_0x94b1('0x2c')](_0x51d67c[_0x94b1('0x2a')],this[_0x94b1('0x4')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x4')]));_0x57e497['attributes']=_0x57e497[_0x94b1('0x2d')]['length']?_0x57e497[_0x94b1('0x2d')]:_0x51d67c[_0x94b1('0x2a')];if(!_0x5d765b[_0x94b1('0x28')]['hasOwnProperty'](_0x94b1('0x2e'))){_0x57e497[_0x94b1('0x13')]=this[_0x94b1('0x13')](_0x5d765b['query'][_0x94b1('0x13')]);_0x57e497[_0x94b1('0x2f')]=this[_0x94b1('0x2f')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x2f')]);}_0x57e497[_0x94b1('0x30')]=this[_0x94b1('0x14')](_0x5d765b[_0x94b1('0x28')][_0x94b1('0x14')]);_0x57e497[_0x94b1('0x31')]=this[_0x94b1('0x32')](_[_0x94b1('0x33')](_0x5d765b[_0x94b1('0x28')],_0x51d67c['filters']),_0x1a26eb);if(_0x5d765b[_0x94b1('0x28')][_0x94b1('0x34')]){var _0xf29a10=_0x1a26eb;var _0x44d53d=_0x5d765b[_0x94b1('0x28')]['filter'];if(typeof _0x44d53d===_0x94b1('0x35')){_0xf29a10=_[_0x94b1('0x34')](_0x1a26eb,function(_0x186575){return _[_0x94b1('0x36')](_0x44d53d[_0x94b1('0x37')],_0x186575[_0x94b1('0x10')]);});_0x44d53d=_0x44d53d['value'];}_0x57e497[_0x94b1('0x31')]=_[_0x94b1('0x38')](_0x57e497['where'],{'$or':_[_0x94b1('0x2b')](_0xf29a10,function(_0x19d4e4){if(_0x19d4e4['type']!==_0x94b1('0x39')){if(_0x2def34){return sequelize[_0x94b1('0x31')](sequelize['fn'](_0x94b1('0x3a'),sequelize['col'](_0x19d4e4[_0x94b1('0x10')])),{'$like':sequelize['fn'](_0x94b1('0x3a'),'%'+_0x5d765b[_0x94b1('0x28')][_0x94b1('0x34')]+'%')});}else{var _0x3f56a9={};_0x3f56a9[_0x19d4e4[_0x94b1('0x10')]]={'$like':'%'+_0x5d765b[_0x94b1('0x28')]['filter']+'%'};return _0x3f56a9;}}})});}_0x57e497=_[_0x94b1('0x38')]({},_0x57e497,_0x5d765b[_0x94b1('0x3b')]);return _0x57e497;}; \ No newline at end of file +var _0xdbf5=['includes','split','filters','isEmpty','type','isPlainObject','$gte','utc','format','YYYY-MM-DD','subtract','name','uniqueid','isArray','limit','offset','map','priority','col','unsigned','substr','DESC','ASC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','^[+]?[0-9]*$','isEmail','match','getFullTextValue','forEach','replace','push','join','getOptions','query','$id','intersection','model','attributes','fields','order','sort','where','pick','filter','columns','merge','VIRTUAL','lower','sequelize','parse','keys'];(function(_0x1714b2,_0x5b728){var _0x510d01=function(_0x1c5ad3){while(--_0x1c5ad3){_0x1714b2['push'](_0x1714b2['shift']());}};_0x510d01(++_0x5b728);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4d835d,_0x22d39d){_0x4d835d=_0x4d835d-0x0;var _0x43feb9=_0xdbf5[_0x4d835d];return _0x43feb9;};'use strict';var _=require('lodash');var sequelize=require(_0x5dbf('0x0'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x4bde73){var _0x19d2b4=['ne'];try{var _0xfd972b=JSON[_0x5dbf('0x1')](_0x4bde73);var _0x3afe14=Object[_0x5dbf('0x2')](_0xfd972b)[0x0];return _0x19d2b4[_0x5dbf('0x3')](_0x3afe14);}catch(_0x776036){return![];}}function getOperatorValue(_0x1decd2){var _0x3f8628=JSON[_0x5dbf('0x1')](_0x1decd2);var _0x209b7d=Object[_0x5dbf('0x2')](_0x3f8628)[0x0];var _0x93e657=_0x3f8628[_0x209b7d];return{['$'+_0x209b7d]:_0x93e657};}exports['fields']=function(_0x134810){var _0x501cb1=null;if(_0x134810){_0x501cb1=_0x134810[_0x5dbf('0x4')](',');}return _0x501cb1;};exports[_0x5dbf('0x5')]=function(_0x264007,_0x1813bb){var _0x4efed3={};if(!_[_0x5dbf('0x6')](_0x264007)){_['forOwn'](_0x264007,function(_0x5433f4,_0x1c7389){try{if(_0x1813bb){var _0x5dbc97=_['find'](_0x1813bb,{'name':_0x1c7389})||{};if(hasSequelizeOperator(_0x5433f4)){_0x4efed3[_0x1c7389]=getOperatorValue(_0x5433f4);}else if(_0x5dbc97[_0x5dbf('0x7')]==='DATE'&&_[_0x5dbf('0x8')](_0x5433f4)){var _0x2bb7ed=JSON[_0x5dbf('0x1')](_0x5433f4);var _0x7cb848={'$gte':moment(moment(_0x2bb7ed[_0x5dbf('0x9')])['format']('YYYY-MM-DD'))[_0x5dbf('0xa')]()[_0x5dbf('0xb')](),'$lte':moment(moment(_0x2bb7ed['$lte'])[_0x5dbf('0xb')](_0x5dbf('0xc')))[_0x5dbf('0xa')]()[_0x5dbf('0xd')](0x1,'s')[_0x5dbf('0xb')]()};_0x4efed3[_0x1c7389]=_0x7cb848;}else if(_0x5dbc97[_0x5dbf('0xe')]===_0x5dbf('0xf')){_0x4efed3[_0x1c7389]=_0x5433f4;}else{_0x4efed3[_0x1c7389]=_['isArray'](_0x5433f4)?_0x5433f4:JSON['parse'](_0x5433f4);}}else{_0x4efed3[_0x1c7389]=_[_0x5dbf('0x10')](_0x5433f4)?_0x5433f4:JSON[_0x5dbf('0x1')](_0x5433f4);}}catch(_0x39c7aa){_0x4efed3[_0x1c7389]=_0x5433f4[_0x5dbf('0x4')](',');}});}return _0x4efed3;};exports[_0x5dbf('0x11')]=function(_0x5ce68e){_0x5ce68e=parseInt(_0x5ce68e,0xa);if(!_0x5ce68e||_0x5ce68e<0x0){_0x5ce68e=LIMIT_VALUE;}return _0x5ce68e;};exports[_0x5dbf('0x12')]=function(_0x4dd03c){_0x4dd03c=parseInt(_0x4dd03c,0xa);if(!_0x4dd03c||_0x4dd03c<0x0){_0x4dd03c=0x0;}return _0x4dd03c;};exports['sort']=function(_0x577ca2){var _0x23d1e7,_0x3cedac=null;if(_0x577ca2){_0x23d1e7=_0x577ca2[_0x5dbf('0x4')](',');_0x3cedac=_[_0x5dbf('0x13')](_0x23d1e7,function(_0x1e3cce){if(_0x1e3cce['indexOf']('-')===0x0){return[_0x1e3cce===_0x5dbf('0x14')?sequelize['cast'](sequelize[_0x5dbf('0x15')](_0x5dbf('0x14')),_0x5dbf('0x16')):_0x1e3cce[_0x5dbf('0x17')](0x1),_0x5dbf('0x18')];}else{return[_0x1e3cce===_0x5dbf('0x14')?sequelize['cast'](sequelize[_0x5dbf('0x15')](_0x5dbf('0x14')),_0x5dbf('0x16')):_0x1e3cce,_0x5dbf('0x19')];}});}return _0x3cedac;};exports[_0x5dbf('0x1a')]=function(_0x226b93,_0x290456){if(_[_0x5dbf('0x6')](_0x226b93)){return _0x226b93;}if(_[_0x5dbf('0x10')](_0x226b93)){for(var _0x15a790=0x0;_0x15a790<_0x226b93[_0x5dbf('0x1b')];_0x15a790+=0x1){_0x226b93[_0x15a790]=this[_0x5dbf('0x1a')](_0x226b93[_0x15a790],_0x290456);}return _0x226b93;}if(!_[_0x5dbf('0x1c')](_0x226b93)){return _0x226b93;}if(_[_0x5dbf('0x1d')](_0x290456)){_0x290456=[_0x290456];}if(!_[_0x5dbf('0x10')](_0x290456)){return _0x226b93;}for(var _0x17f135=0x0;_0x17f135<_0x290456[_0x5dbf('0x1b')];_0x17f135+=0x1){_[_0x5dbf('0x1e')](_0x226b93,_0x290456[_0x17f135]);}for(var _0x159e61 in _0x226b93){if(_0x226b93[_0x5dbf('0x1f')](_0x159e61)){_0x226b93[_0x159e61]=this[_0x5dbf('0x1a')](_0x226b93[_0x159e61],_0x290456);}}return _0x226b93;};exports[_0x5dbf('0x20')]=function(_0x21cd00){return _0x21cd00['match'](RegExp(_0x5dbf('0x21')))?!![]:![];};exports[_0x5dbf('0x22')]=function(_0xc4748){return _0xc4748[_0x5dbf('0x23')](/^\S+@\S+$/)?!![]:![];};exports[_0x5dbf('0x24')]=function(_0x6a276d){var _0x2a65c5=[];_0x6a276d[_0x5dbf('0x4')](/[ ,]+/)[_0x5dbf('0x25')](function(_0x273b63){_0x273b63=_0x273b63[_0x5dbf('0x26')](/([^:]")"+/g,'$1');_0x273b63='+'+_0x273b63+'*';var _0x50a307=/[ `!@#$%^&*()_\-?~]/;if(_0x273b63['match'](_0x50a307))_0x273b63='\x22'+_0x273b63+'\x22';_0x2a65c5[_0x5dbf('0x27')](_0x273b63);});return _0x2a65c5[_0x5dbf('0x28')]('\x20');};exports[_0x5dbf('0x29')]=function(_0x3b73ad,_0x37cf25,_0x4d9faa){var _0x5cc3f1={},_0x1f7527={};if(_0x37cf25[_0x5dbf('0x2a')]['$id']){_0x37cf25[_0x5dbf('0x2a')]['id']=_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x2b')];delete _0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x2b')];}_0x5cc3f1['model']=_[_0x5dbf('0x13')](_0x3b73ad,_0x5dbf('0xe'));_0x5cc3f1[_0x5dbf('0x2a')]=_[_0x5dbf('0x2')](_0x37cf25[_0x5dbf('0x2a')]);_0x5cc3f1['filters']=_[_0x5dbf('0x2c')](_0x5cc3f1[_0x5dbf('0x2d')],_0x5cc3f1[_0x5dbf('0x2a')]);_0x1f7527[_0x5dbf('0x2e')]=_['intersection'](_0x5cc3f1[_0x5dbf('0x2d')],this[_0x5dbf('0x2f')](_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x2f')]));_0x1f7527[_0x5dbf('0x2e')]=_0x1f7527[_0x5dbf('0x2e')][_0x5dbf('0x1b')]?_0x1f7527[_0x5dbf('0x2e')]:_0x5cc3f1[_0x5dbf('0x2d')];if(!_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x1f')]('nolimit')){_0x1f7527[_0x5dbf('0x11')]=this[_0x5dbf('0x11')](_0x37cf25[_0x5dbf('0x2a')]['limit']);_0x1f7527[_0x5dbf('0x12')]=this[_0x5dbf('0x12')](_0x37cf25[_0x5dbf('0x2a')]['offset']);}_0x1f7527[_0x5dbf('0x30')]=this[_0x5dbf('0x31')](_0x37cf25[_0x5dbf('0x2a')]['sort']);_0x1f7527[_0x5dbf('0x32')]=this[_0x5dbf('0x5')](_[_0x5dbf('0x33')](_0x37cf25[_0x5dbf('0x2a')],_0x5cc3f1[_0x5dbf('0x5')]),_0x3b73ad);if(_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x34')]){var _0x2ed355=_0x3b73ad;var _0x4b71c1=_0x37cf25['query']['filter'];if(typeof _0x4b71c1==='object'){_0x2ed355=_[_0x5dbf('0x34')](_0x3b73ad,function(_0x21122d){return _['includes'](_0x4b71c1[_0x5dbf('0x35')],_0x21122d[_0x5dbf('0xe')]);});_0x4b71c1=_0x4b71c1['value'];}_0x1f7527[_0x5dbf('0x32')]=_[_0x5dbf('0x36')](_0x1f7527[_0x5dbf('0x32')],{'$or':_[_0x5dbf('0x13')](_0x2ed355,function(_0x21ae10){if(_0x21ae10[_0x5dbf('0x7')]!==_0x5dbf('0x37')){if(_0x4d9faa){return sequelize[_0x5dbf('0x32')](sequelize['fn'](_0x5dbf('0x38'),sequelize[_0x5dbf('0x15')](_0x21ae10['name'])),{'$like':sequelize['fn'](_0x5dbf('0x38'),'%'+_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x34')]+'%')});}else{var _0x50880d={};_0x50880d[_0x21ae10[_0x5dbf('0xe')]]={'$like':'%'+_0x37cf25[_0x5dbf('0x2a')][_0x5dbf('0x34')]+'%'};return _0x50880d;}}})});}_0x1f7527=_[_0x5dbf('0x36')]({},_0x1f7527,_0x37cf25['options']);return _0x1f7527;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c09179b..31de456 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7e2e=['../mysqldb','default','get','env','production','set','appPath','join','development','root','client','use','json\x20replacer','split','static','views','/server/views','engine','html','ejs','renderFile','50mb','json','express','body-parser','method-override','cookie-parser','path'];(function(_0x1b567f,_0x2f6f30){var _0xea50ab=function(_0x49ab15){while(--_0x49ab15){_0x1b567f['push'](_0x1b567f['shift']());}};_0xea50ab(++_0x2f6f30);}(_0x7e2e,0x1d7));var _0xe7e2=function(_0x50f950,_0x59d371){_0x50f950=_0x50f950-0x0;var _0x1374e4=_0x7e2e[_0x50f950];return _0x1374e4;};'use strict';var express=require(_0xe7e2('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xe7e2('0x1'));var methodOverride=require(_0xe7e2('0x2'));var cookieParser=require(_0xe7e2('0x3'));var errorHandler=require('errorhandler');var path=require(_0xe7e2('0x4'));var passport=require('passport');var cors=require('cors');var moment=require('moment');var config=require('./environment');var db=require(_0xe7e2('0x5'))['db'];exports[_0xe7e2('0x6')]=function(_0x24e66d){var _0x5eb840=_0x24e66d[_0xe7e2('0x7')](_0xe7e2('0x8'));if(_0x5eb840===_0xe7e2('0x9')){_0x24e66d[_0xe7e2('0xa')](_0xe7e2('0xb'),path[_0xe7e2('0xc')](config['root'],'public'));}if(_0x5eb840===_0xe7e2('0xd')||_0x5eb840==='test'){_0x24e66d[_0xe7e2('0xa')](_0xe7e2('0xb'),path[_0xe7e2('0xc')](config[_0xe7e2('0xe')],_0xe7e2('0xf')));_0x24e66d[_0xe7e2('0x10')](errorHandler());}_0x24e66d[_0xe7e2('0xa')](_0xe7e2('0x11'),function(_0x4aba02,_0x3aadc1){if(this[_0x4aba02]instanceof Date){_0x3aadc1=this[_0x4aba02]['toISOString']()[_0xe7e2('0x12')]('.')[0x0]+'Z';}return _0x3aadc1;});_0x24e66d[_0xe7e2('0x10')](express[_0xe7e2('0x13')](_0x24e66d[_0xe7e2('0x7')](_0xe7e2('0xb'))));_0x24e66d['set'](_0xe7e2('0x14'),config[_0xe7e2('0xe')]+_0xe7e2('0x15'));_0x24e66d[_0xe7e2('0x16')](_0xe7e2('0x17'),require(_0xe7e2('0x18'))[_0xe7e2('0x19')]);_0x24e66d['set']('view\x20engine',_0xe7e2('0x17'));_0x24e66d[_0xe7e2('0x10')](bodyParser['urlencoded']({'limit':_0xe7e2('0x1a'),'extended':!![]}));_0x24e66d[_0xe7e2('0x10')](bodyParser[_0xe7e2('0x1b')]({'limit':_0xe7e2('0x1a')}));_0x24e66d['use'](cors());_0x24e66d['use'](methodOverride());_0x24e66d['use'](cookieParser());_0x24e66d[_0xe7e2('0x10')](passport['initialize']());}; \ No newline at end of file +var _0x12e2=['initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','moment','./environment','../mysqldb','get','env','production','set','appPath','join','root','development','test','client','use','json\x20replacer','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','view\x20engine','50mb','json'];(function(_0x22d345,_0x2b2aa7){var _0x54e480=function(_0x246cc9){while(--_0x246cc9){_0x22d345['push'](_0x22d345['shift']());}};_0x54e480(++_0x2b2aa7);}(_0x12e2,0xf6));var _0x212e=function(_0x4a1fe1,_0x36eeb2){_0x4a1fe1=_0x4a1fe1-0x0;var _0x57aaf4=_0x12e2[_0x4a1fe1];return _0x57aaf4;};'use strict';var express=require('express');var favicon=require(_0x212e('0x0'));var bodyParser=require(_0x212e('0x1'));var methodOverride=require(_0x212e('0x2'));var cookieParser=require(_0x212e('0x3'));var errorHandler=require(_0x212e('0x4'));var path=require('path');var passport=require(_0x212e('0x5'));var cors=require(_0x212e('0x6'));var moment=require(_0x212e('0x7'));var config=require(_0x212e('0x8'));var db=require(_0x212e('0x9'))['db'];exports['default']=function(_0x589774){var _0x29c734=_0x589774[_0x212e('0xa')](_0x212e('0xb'));if(_0x29c734===_0x212e('0xc')){_0x589774[_0x212e('0xd')](_0x212e('0xe'),path[_0x212e('0xf')](config[_0x212e('0x10')],'public'));}if(_0x29c734===_0x212e('0x11')||_0x29c734===_0x212e('0x12')){_0x589774[_0x212e('0xd')](_0x212e('0xe'),path['join'](config['root'],_0x212e('0x13')));_0x589774[_0x212e('0x14')](errorHandler());}_0x589774['set'](_0x212e('0x15'),function(_0x15be51,_0x3f7572){if(this[_0x15be51]instanceof Date){_0x3f7572=this[_0x15be51][_0x212e('0x16')]()[_0x212e('0x17')]('.')[0x0]+'Z';}return _0x3f7572;});_0x589774[_0x212e('0x14')](express[_0x212e('0x18')](_0x589774['get'](_0x212e('0xe'))));_0x589774['set'](_0x212e('0x19'),config[_0x212e('0x10')]+_0x212e('0x1a'));_0x589774[_0x212e('0x1b')](_0x212e('0x1c'),require(_0x212e('0x1d'))[_0x212e('0x1e')]);_0x589774['set'](_0x212e('0x1f'),_0x212e('0x1c'));_0x589774[_0x212e('0x14')](bodyParser['urlencoded']({'limit':_0x212e('0x20'),'extended':!![]}));_0x589774[_0x212e('0x14')](bodyParser[_0x212e('0x21')]({'limit':_0x212e('0x20')}));_0x589774[_0x212e('0x14')](cors());_0x589774[_0x212e('0x14')](methodOverride());_0x589774[_0x212e('0x14')](cookieParser());_0x589774['use'](passport[_0x212e('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index f05f6bf..34c155d 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 _0x2f74=['utf8','replace','hostname','macAddress','ipAddress','createHash','md5','digest','hex','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','length','filter','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','update','getUuid','platform','licenseToken'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0x2f74,0x11a));var _0x42f7=function(_0x232d32,_0x3ccf6d){_0x232d32=_0x232d32-0x0;var _0x163cf2=_0x2f74[_0x232d32];return _0x163cf2;};'use strict';var _=require(_0x42f7('0x0'));var os=require('os');var crypto=require(_0x42f7('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x42f7('0x2'))[_0x42f7('0x3')];var config=require(_0x42f7('0x4'));function getInterfaces(){var _0x98ccbd=[];var _0x20dd58=os[_0x42f7('0x5')]();var _0xf795bf=_[_0x42f7('0x6')](_[_0x42f7('0x7')](_0x20dd58));for(var _0x5dab33=0x0;_0x5dab33<_0xf795bf[_0x42f7('0x8')];_0x5dab33++){var _0x1082a8=_0x20dd58[_0xf795bf[_0x5dab33]][_0x42f7('0x9')](function(_0x2e4d63){return _0x2e4d63['family']==='IPv4'&&_0x2e4d63[_0x42f7('0xa')]===![];});_0x98ccbd=_0x98ccbd['concat'](_0x1082a8);}return _0x98ccbd;}function getFirstInterface(){var _0xc93935=_[_0x42f7('0xb')](getInterfaces());return{'macAddress':_0xc93935&&_0xc93935[_0x42f7('0xc')]?_0xc93935[_0x42f7('0xc')]:_0x42f7('0xd'),'ipAddress':_0xc93935&&_0xc93935[_0x42f7('0xe')]?_0xc93935[_0x42f7('0xe')]:_0x42f7('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x5d65bb=_[_0x42f7('0x6')](os[_0x42f7('0x10')]()[_0x42f7('0x11')](function(_0x3d7a92){return _0x3d7a92[_0x42f7('0x12')];}))[_0x42f7('0x13')](':');return crypto['createHash']('md5')[_0x42f7('0x14')](_0x5d65bb)['digest']('hex');}exports[_0x42f7('0x15')]=function(){var _0x4badad=os[_0x42f7('0x16')]();var _0x9d0f86=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x9d0f86['test'](config[_0x42f7('0x17')])){return config[_0x42f7('0x17')];}else if(_0x4badad==='win32'){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x42f7('0x18')})[_0x42f7('0x19')]('\x0d\x0a','');}else{var _0x54925d=getFirstInterface();var _0x144792=getCPUhash();var _0x273722=_0x144792+'|'+os[_0x42f7('0x1a')]()+'|'+_0x54925d[_0x42f7('0x1b')]+'|'+_0x54925d[_0x42f7('0x1c')];var _0x11f64f=crypto[_0x42f7('0x1d')](_0x42f7('0x1e'))[_0x42f7('0x14')](_0x273722)[_0x42f7('0x1f')](_0x42f7('0x20'));return _0x11f64f[_0x42f7('0x21')](0x0,0x8)+'-'+_0x11f64f[_0x42f7('0x21')](0x8,0xc)+'-'+_0x11f64f['substring'](0xc,0x10)+'-'+_0x11f64f[_0x42f7('0x21')](0x10,0x14)+'-'+_0x11f64f[_0x42f7('0x21')](0x14);}}; \ No newline at end of file +var _0xdc41=['update','hex','getUuid','platform','test','licenseToken','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','digest','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','keys','filter','family','IPv4','internal','concat','head','mac','00:00:00:00:00:00','address','model','join','md5'];(function(_0x160249,_0xdc8dcd){var _0x3f737e=function(_0x2ba205){while(--_0x2ba205){_0x160249['push'](_0x160249['shift']());}};_0x3f737e(++_0xdc8dcd);}(_0xdc41,0xb3));var _0x1dc4=function(_0x11ac42,_0x4c61d5){_0x11ac42=_0x11ac42-0x0;var _0x4a33f2=_0xdc41[_0x11ac42];return _0x4a33f2;};'use strict';var _=require(_0x1dc4('0x0'));var os=require('os');var crypto=require(_0x1dc4('0x1'));var machine=require(_0x1dc4('0x2'));var exec=require(_0x1dc4('0x3'))['execSync'];var config=require('../environment');function getInterfaces(){var _0x701baf=[];var _0x1586b8=os[_0x1dc4('0x4')]();var _0x3f98d3=_[_0x1dc4('0x5')](_[_0x1dc4('0x6')](_0x1586b8));for(var _0x50c9e8=0x0;_0x50c9e8<_0x3f98d3['length'];_0x50c9e8++){var _0x3a05df=_0x1586b8[_0x3f98d3[_0x50c9e8]][_0x1dc4('0x7')](function(_0x35deb9){return _0x35deb9[_0x1dc4('0x8')]===_0x1dc4('0x9')&&_0x35deb9[_0x1dc4('0xa')]===![];});_0x701baf=_0x701baf[_0x1dc4('0xb')](_0x3a05df);}return _0x701baf;}function getFirstInterface(){var _0x4e820d=_[_0x1dc4('0xc')](getInterfaces());return{'macAddress':_0x4e820d&&_0x4e820d['mac']?_0x4e820d[_0x1dc4('0xd')]:_0x1dc4('0xe'),'ipAddress':_0x4e820d&&_0x4e820d[_0x1dc4('0xf')]?_0x4e820d[_0x1dc4('0xf')]:'127.0.0.1'};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0xd81dc3=_[_0x1dc4('0x5')](os['cpus']()['map'](function(_0x439c8c){return _0x439c8c[_0x1dc4('0x10')];}))[_0x1dc4('0x11')](':');return crypto['createHash'](_0x1dc4('0x12'))[_0x1dc4('0x13')](_0xd81dc3)['digest'](_0x1dc4('0x14'));}exports[_0x1dc4('0x15')]=function(){var _0x5314b5=os[_0x1dc4('0x16')]();var _0x310e28=/[0-9a-f-]{36}/;if(config['licenseToken']&&_0x310e28[_0x1dc4('0x17')](config['licenseToken'])){return config[_0x1dc4('0x18')];}else if(_0x5314b5===_0x1dc4('0x19')){return exec(_0x1dc4('0x1a'),{'encoding':_0x1dc4('0x1b')})[_0x1dc4('0x1c')]('\x0d\x0a','');}else{var _0x36ebfe=getFirstInterface();var _0x39bb13=getCPUhash();var _0xa602bc=_0x39bb13+'|'+os[_0x1dc4('0x1d')]()+'|'+_0x36ebfe[_0x1dc4('0x1e')]+'|'+_0x36ebfe['ipAddress'];var _0x2a8fab=crypto['createHash']('md5')['update'](_0xa602bc)[_0x1dc4('0x1f')](_0x1dc4('0x14'));return _0x2a8fab[_0x1dc4('0x20')](0x0,0x8)+'-'+_0x2a8fab['substring'](0x8,0xc)+'-'+_0x2a8fab[_0x1dc4('0x20')](0xc,0x10)+'-'+_0x2a8fab[_0x1dc4('0x20')](0x10,0x14)+'-'+_0x2a8fab['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1d1eed7..96fc109 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 _0x0912=['findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','catch','default','moment','request-promise','bluebird','pkginfo','version','../../components/encryptor','./hardware','https://www.xcallymotion.com','%s/api/servers/%s/check?version=%s','exports','format','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','get','data1','then','active','license','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','encryptString','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License'];(function(_0xfa232d,_0x3dfedd){var _0xd9394c=function(_0x4bc543){while(--_0x4bc543){_0xfa232d['push'](_0xfa232d['shift']());}};_0xd9394c(++_0x3dfedd);}(_0x0912,0x13c));var _0x2091=function(_0x1fbcb1,_0x49eea){_0x1fbcb1=_0x1fbcb1-0x0;var _0x577848=_0x0912[_0x1fbcb1];return _0x577848;};'use strict';var util=require('util');var moment=require(_0x2091('0x0'));var rp=require(_0x2091('0x1'));var BPromise=require(_0x2091('0x2'));var pkginfo=require(_0x2091('0x3'))(module,_0x2091('0x4'));var db=require('../../mysqldb')['db'];var encryptor=require(_0x2091('0x5'));var hardware=require(_0x2091('0x6'));var logger=require('../logger')('license');var HOST=_0x2091('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x45345a){return new BPromise(function(_0x3e38e2,_0x4eda9d){var _0x6bd0c3=util['format'](_0x2091('0x8'),HOST,_0x45345a,module[_0x2091('0x9')][_0x2091('0x4')]);if(oldToken){_0x6bd0c3=util[_0x2091('0xa')](_0x2091('0xb'),HOST,_0x45345a,module[_0x2091('0x9')]['version'],oldToken);}var _0xff825d={'uri':_0x6bd0c3,'method':_0x2091('0xc'),'timeout':0xea60,'json':!![]};return rp(_0xff825d)['then'](function(_0x360d1b){_0x3e38e2(_0x360d1b);})['catch'](function(_0x10afa7){_0x4eda9d(_0x10afa7);});});}function manageLicense(_0x1af68a,_0x3579bc){var _0x5177c1=_0x3579bc[_0x2091('0xd')]({'plain':!![]});if(!isOldTokenSent&&_0x5177c1[_0x2091('0xe')]!==_0x1af68a&&!_0x5177c1['data2']){oldToken=_0x5177c1[_0x2091('0xe')];}httpRequest(_0x1af68a)[_0x2091('0xf')](function(_0x3a5bdf){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x3a5bdf[_0x2091('0x10')]){isOldTokenSent=![];if(!_0x5177c1[_0x2091('0x11')]&&_0x5177c1[_0x2091('0x11')]!=_0x3a5bdf['license']||_0x5177c1[_0x2091('0x11')]&&_0x5177c1['data2']){logger['info'](_0x2091('0x12'));}if(_0x5177c1[_0x2091('0x11')]&&!_0x5177c1[_0x2091('0x13')]&&_0x5177c1[_0x2091('0x11')]!=_0x3a5bdf['license']){logger[_0x2091('0x14')](_0x2091('0x15'));}if(_0x5177c1['license']&&!_0x5177c1[_0x2091('0x13')]&&_0x5177c1[_0x2091('0x11')]==_0x3a5bdf['license']){return _0x3579bc;}return _0x3579bc[_0x2091('0x16')]({'data1':_0x1af68a,'data2':null,'license':_0x3a5bdf[_0x2091('0x11')]});}else{if(_0x3a5bdf[_0x2091('0x11')]||_0x5177c1['license']){if(!_0x5177c1['data2']){if(_0x5177c1[_0x2091('0xe')]==_0x1af68a){GRAY_PERIOD_REASON=_0x2091('0x17');logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x2091('0x18');logger[_0x2091('0x14')](_0x2091('0x19'),_0x5177c1[_0x2091('0xe')],_0x1af68a);}logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x2091('0x1a')](),moment()[_0x2091('0xa')]('YYYY-MM-DD\x20HH:mm'));return _0x3579bc[_0x2091('0x16')]({'data2':encryptor[_0x2091('0x1b')](moment()[_0x2091('0xa')](_0x2091('0x1c')))});}else{if(moment()['diff'](encryptor['decryptString'](_0x5177c1[_0x2091('0x13')]),_0x2091('0x1d'))>DAYS){logger[_0x2091('0x14')](_0x2091('0x1e'),moment()[_0x2091('0xa')](_0x2091('0x1c')));isOldTokenSent=![];return _0x3579bc['update']({'data1':_0x1af68a,'data2':null,'license':null});}}}else{if(_0x5177c1[_0x2091('0xe')]!=_0x1af68a){logger[_0x2091('0x14')](_0x2091('0x19'),_0x5177c1[_0x2091('0xe')],_0x1af68a);return _0x3579bc[_0x2091('0x16')]({'data1':_0x1af68a,'data2':null,'license':null});}}}return _0x3579bc;})[_0x2091('0xf')](function(_0xc7f721){_0x3579bc=_0xc7f721;})['catch'](function(_0x322560){logger[_0x2091('0x1f')](_0x322560[_0x2091('0x20')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0x2091('0x21')](),_0x3579bc);},TIME);});}function defaultLicense(){var _0x249734=hardware['getUuid']();if(_0x249734){return db[_0x2091('0x22')][_0x2091('0x23')]({'where':{'id':0x1},'defaults':{'data1':_0x249734}})['spread'](function(_0x4bda5e,_0x3e88e9){logger[_0x2091('0x14')](_0x2091('0x24'),_0x249734);manageLicense(_0x249734,_0x4bda5e);})[_0x2091('0x25')](function(_0x537469){logger['error'](_0x537469[_0x2091('0x20')]);});}}exports[_0x2091('0x26')]=defaultLicense; \ No newline at end of file +var _0x8005=['bluebird','pkginfo','version','../../mysqldb','../logger','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data2','data1','active','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','error','message','getUuid','License','findOrCreate','spread','default','util'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x8005,0x167));var _0x5800=function(_0xee5d2a,_0x534134){_0xee5d2a=_0xee5d2a-0x0;var _0x346948=_0x8005[_0xee5d2a];return _0x346948;};'use strict';var util=require(_0x5800('0x0'));var moment=require('moment');var rp=require('request-promise');var BPromise=require(_0x5800('0x1'));var pkginfo=require(_0x5800('0x2'))(module,_0x5800('0x3'));var db=require(_0x5800('0x4'))['db'];var encryptor=require('../../components/encryptor');var hardware=require('./hardware');var logger=require(_0x5800('0x5'))('license');var HOST=_0x5800('0x6');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x56a043){return new BPromise(function(_0x4663f5,_0x593530){var _0x29e08a=util[_0x5800('0x7')](_0x5800('0x8'),HOST,_0x56a043,module[_0x5800('0x9')]['version']);if(oldToken){_0x29e08a=util[_0x5800('0x7')](_0x5800('0xa'),HOST,_0x56a043,module['exports'][_0x5800('0x3')],oldToken);}var _0x4236ca={'uri':_0x29e08a,'method':_0x5800('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x4236ca)[_0x5800('0xc')](function(_0x8afe00){_0x4663f5(_0x8afe00);})[_0x5800('0xd')](function(_0x388cc7){_0x593530(_0x388cc7);});});}function manageLicense(_0x3bd7f0,_0x243dcb){var _0x3a1b3a=_0x243dcb[_0x5800('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x3a1b3a['data1']!==_0x3bd7f0&&!_0x3a1b3a[_0x5800('0xf')]){oldToken=_0x3a1b3a[_0x5800('0x10')];}httpRequest(_0x3bd7f0)[_0x5800('0xc')](function(_0x2b4b33){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x2b4b33[_0x5800('0x11')]){isOldTokenSent=![];if(!_0x3a1b3a[_0x5800('0x12')]&&_0x3a1b3a['license']!=_0x2b4b33['license']||_0x3a1b3a[_0x5800('0x12')]&&_0x3a1b3a[_0x5800('0xf')]){logger[_0x5800('0x13')](_0x5800('0x14'));}if(_0x3a1b3a[_0x5800('0x12')]&&!_0x3a1b3a['data2']&&_0x3a1b3a[_0x5800('0x12')]!=_0x2b4b33['license']){logger['info'](_0x5800('0x15'));}if(_0x3a1b3a[_0x5800('0x12')]&&!_0x3a1b3a['data2']&&_0x3a1b3a['license']==_0x2b4b33[_0x5800('0x12')]){return _0x243dcb;}return _0x243dcb[_0x5800('0x16')]({'data1':_0x3bd7f0,'data2':null,'license':_0x2b4b33[_0x5800('0x12')]});}else{if(_0x2b4b33[_0x5800('0x12')]||_0x3a1b3a[_0x5800('0x12')]){if(!_0x3a1b3a[_0x5800('0xf')]){if(_0x3a1b3a['data1']==_0x3bd7f0){GRAY_PERIOD_REASON=_0x5800('0x17');logger[_0x5800('0x13')](_0x5800('0x18'));}else{GRAY_PERIOD_REASON='Changed';logger['info']('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3a1b3a[_0x5800('0x10')],_0x3bd7f0);}logger['info'](_0x5800('0x19'),GRAY_PERIOD_REASON[_0x5800('0x1a')](),moment()[_0x5800('0x7')](_0x5800('0x1b')));return _0x243dcb[_0x5800('0x16')]({'data2':encryptor[_0x5800('0x1c')](moment()[_0x5800('0x7')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0x5800('0x1d')](encryptor[_0x5800('0x1e')](_0x3a1b3a[_0x5800('0xf')]),_0x5800('0x1f'))>DAYS){logger[_0x5800('0x13')](_0x5800('0x20'),moment()[_0x5800('0x7')](_0x5800('0x1b')));isOldTokenSent=![];return _0x243dcb['update']({'data1':_0x3bd7f0,'data2':null,'license':null});}}}else{if(_0x3a1b3a[_0x5800('0x10')]!=_0x3bd7f0){logger[_0x5800('0x13')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x3a1b3a[_0x5800('0x10')],_0x3bd7f0);return _0x243dcb[_0x5800('0x16')]({'data1':_0x3bd7f0,'data2':null,'license':null});}}}return _0x243dcb;})['then'](function(_0xeb9d8d){_0x243dcb=_0xeb9d8d;})['catch'](function(_0x2d98f8){logger[_0x5800('0x21')](_0x2d98f8[_0x5800('0x22')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x243dcb);},TIME);});}function defaultLicense(){var _0x506534=hardware[_0x5800('0x23')]();if(_0x506534){return db[_0x5800('0x24')][_0x5800('0x25')]({'where':{'id':0x1},'defaults':{'data1':_0x506534}})[_0x5800('0x26')](function(_0x2015e9,_0xe13a92){logger[_0x5800('0x13')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x506534);manageLicense(_0x506534,_0x2015e9);})[_0x5800('0xd')](function(_0x93f9c9){logger[_0x5800('0x21')](_0x93f9c9[_0x5800('0x22')]);});}}exports[_0x5800('0x27')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index a3babe1..0c23170 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 _0x6ec5=['decryptString','gray','deadline','grayReason','changed','disabled','message','User','sequelize','COUNT','col','count','role','admin','user','telephone','forEach','pick','License\x20limit\x20reached\x20for\x20users','exports','util','lodash','moment','bluebird','../../components/encryptor','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','format','%s:%s:%s','parse','demo','machineUuid'];(function(_0x1e54ae,_0x2ab1cd){var _0x39b748=function(_0x6fda51){while(--_0x6fda51){_0x1e54ae['push'](_0x1e54ae['shift']());}};_0x39b748(++_0x2ab1cd);}(_0x6ec5,0xc8));var _0x56ec=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6ec5[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0x56ec('0x0'));var _=require(_0x56ec('0x1'));var moment=require(_0x56ec('0x2'));var BPromise=require(_0x56ec('0x3'));var hardware=require('./hardware');var encryptor=require(_0x56ec('0x4'));var db=require('../../mysqldb')['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x56ec('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x56ec('0x6'),'machineUuid':hardware[_0x56ec('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x56ec('0x5'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0x56ec('0x7')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4b3478){return new BPromise(function(_0x219405,_0x3bea04){return db[_0x56ec('0x8')][_0x56ec('0x9')](_[_0x56ec('0xa')](_0x4b3478,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x18f405){return checkLicense(_0x18f405,null);})[_0x56ec('0xb')](function(_0x26777a){_0x219405(_0x26777a);return;})[_0x56ec('0xc')](function(_0x2b8431){_0x3bea04(_0x2b8431);});});}function checkLicense(_0x4396f1,_0x341aaa){if(!_0x4396f1){demoLicense[_0x56ec('0xd')]=_0x4396f1[_0x56ec('0xe')];return demoLicense;}try{var _0x49ff29=_0x341aaa||_0x4396f1[_0x56ec('0xf')];if(_[_0x56ec('0x10')](_0x49ff29)){throw new Error(_0x56ec('0x11'));}var _0x2be8a1=_0x4396f1[_0x56ec('0xe')];var _0x9d703b=_0x4396f1[_0x56ec('0x12')];var _0x53cef4=_0x2be8a1[_0x56ec('0x13')]('-')[0x4];var _0x5bce8e=_0x2be8a1[_0x56ec('0x13')]('-')[0x0];var _0x44c845=encryptor['decryptString'](_0x49ff29,util[_0x56ec('0x14')](_0x56ec('0x15'),_0x53cef4,_0x2be8a1,_0x5bce8e));var _0x5d51d9=JSON[_0x56ec('0x16')](_0x44c845);_0x5d51d9[_0x56ec('0x17')]=![];_0x5d51d9[_0x56ec('0xd')]=_0x2be8a1;_0x5d51d9[_0x56ec('0x18')]=hardware[_0x56ec('0x7')]();if(_0x9d703b){var _0x32d616=encryptor[_0x56ec('0x19')](_0x9d703b);_0x5d51d9[_0x56ec('0x1a')]=_0x32d616;_0x5d51d9[_0x56ec('0x1b')]=moment(_0x32d616)['add'](0x7,'days')[_0x56ec('0x14')]();_0x5d51d9[_0x56ec('0x1c')]=_0x5d51d9['uuid']!=_0x5d51d9['machineUuid']?_0x56ec('0x1d'):_0x56ec('0x1e');}return _0x5d51d9;}catch(_0x440e6a){breakingLicense[_0x56ec('0xd')]=_0x4396f1[_0x56ec('0xe')];breakingLicense[_0x56ec('0x1f')]=_0x440e6a[_0x56ec('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x2b684c,_0x395a70){getLicense()['then'](function(_0x11c83f){return db[_0x56ec('0x20')]['findAll']({'attributes':['role',[db[_0x56ec('0x21')]['fn'](_0x56ec('0x22'),db[_0x56ec('0x21')][_0x56ec('0x23')]('role')),_0x56ec('0x24')]],'group':_0x56ec('0x25'),'where':{'role':{'$or':[_0x56ec('0x26'),_0x56ec('0x27'),_0x56ec('0x28')]}},'raw':!![]})[_0x56ec('0xb')](function(_0x47a813){var _0x33e06b={'user':_0x11c83f['users']||0x0,'telephone':_0x11c83f['telephones']||0x0};_0x47a813[_0x56ec('0x29')](function(_0x443663){var _0x3004a0=_0x443663[_0x56ec('0x25')]===_0x56ec('0x26')?_0x56ec('0x27'):_0x443663['role'];_0x33e06b[_0x3004a0]-=_0x443663['count'];if(_0x33e06b[_0x3004a0]<0x0)_0x33e06b[_0x3004a0]=0x0;});_0x2b684c(_0x33e06b);return;});})[_0x56ec('0xc')](function(_0x187062){_0x395a70(_0x187062);});});}function checkUserLimits(_0x1ad1f1){return new BPromise(function(_0x250d93,_0x5a6409){getLimits()[_0x56ec('0xb')](function(_0x2088f2){var _0x22cf69=_[_0x56ec('0x2a')](_['countBy'](_0x1ad1f1,_0x56ec('0x25')),['admin',_0x56ec('0x27'),_0x56ec('0x28')]);var _0x159b22=(_0x22cf69['admin']||0x0)+(_0x22cf69['user']||0x0);var _0x2bcada=_0x22cf69[_0x56ec('0x28')]||0x0;if(_0x159b22>_0x2088f2[_0x56ec('0x27')])return _0x5a6409(_0x56ec('0x2b'));if(_0x2bcada>_0x2088f2[_0x56ec('0x28')])return _0x5a6409('License\x20limit\x20reached\x20for\x20telephones');return _0x250d93();})[_0x56ec('0xc')](function(_0x3a4fb3){_0x5a6409(_0x3a4fb3);});});}module[_0x56ec('0x2c')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0xd75e=['License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','lodash','bluebird','./hardware','../../mysqldb','2027-01-01T00:00:00.000Z','getUuid','Breaking\x20license','License','find','defaults','then','catch','uuid','data1','license','isEmpty','License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','%s:%s:%s','parse','demo','machineUuid','deadline','add','days','grayReason','changed','message','User','sequelize','col','role','user','telephone','telephones','forEach','admin','count','pick','countBy'];(function(_0x1a0c59,_0x3b4dcc){var _0xed67c9=function(_0x247698){while(--_0x247698){_0x1a0c59['push'](_0x1a0c59['shift']());}};_0xed67c9(++_0x3b4dcc);}(_0xd75e,0xbb));var _0xed75=function(_0x2a22a7,_0x5c5ea7){_0x2a22a7=_0x2a22a7-0x0;var _0x176cc6=_0xd75e[_0x2a22a7];return _0x176cc6;};'use strict';var util=require('util');var _=require(_0xed75('0x0'));var moment=require('moment');var BPromise=require(_0xed75('0x1'));var hardware=require(_0xed75('0x2'));var encryptor=require('../../components/encryptor');var db=require(_0xed75('0x3'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xed75('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','machineUuid':hardware[_0xed75('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xed75('0x4'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xed75('0x6'),'machineUuid':hardware[_0xed75('0x5')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x4ceb40){return new BPromise(function(_0x1abc3e,_0x57c1ee){return db[_0xed75('0x7')][_0xed75('0x8')](_[_0xed75('0x9')](_0x4ceb40,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x424eb8){return checkLicense(_0x424eb8,null);})[_0xed75('0xa')](function(_0x41242a){_0x1abc3e(_0x41242a);return;})[_0xed75('0xb')](function(_0x384cdd){_0x57c1ee(_0x384cdd);});});}function checkLicense(_0x428936,_0x3ed62d){if(!_0x428936){demoLicense[_0xed75('0xc')]=_0x428936[_0xed75('0xd')];return demoLicense;}try{var _0x48fb15=_0x3ed62d||_0x428936[_0xed75('0xe')];if(_[_0xed75('0xf')](_0x48fb15)){throw new Error(_0xed75('0x10'));}var _0x2b1d10=_0x428936['data1'];var _0x329d73=_0x428936[_0xed75('0x11')];var _0x30421c=_0x2b1d10['split']('-')[0x4];var _0x2b2ec8=_0x2b1d10[_0xed75('0x12')]('-')[0x0];var _0x25b2ff=encryptor[_0xed75('0x13')](_0x48fb15,util[_0xed75('0x14')](_0xed75('0x15'),_0x30421c,_0x2b1d10,_0x2b2ec8));var _0x1f7672=JSON[_0xed75('0x16')](_0x25b2ff);_0x1f7672[_0xed75('0x17')]=![];_0x1f7672[_0xed75('0xc')]=_0x2b1d10;_0x1f7672[_0xed75('0x18')]=hardware[_0xed75('0x5')]();if(_0x329d73){var _0x3e5bb8=encryptor[_0xed75('0x13')](_0x329d73);_0x1f7672['gray']=_0x3e5bb8;_0x1f7672[_0xed75('0x19')]=moment(_0x3e5bb8)[_0xed75('0x1a')](0x7,_0xed75('0x1b'))[_0xed75('0x14')]();_0x1f7672[_0xed75('0x1c')]=_0x1f7672[_0xed75('0xc')]!=_0x1f7672[_0xed75('0x18')]?_0xed75('0x1d'):'disabled';}return _0x1f7672;}catch(_0x4f7d97){breakingLicense[_0xed75('0xc')]=_0x428936[_0xed75('0xd')];breakingLicense[_0xed75('0x1e')]=_0x4f7d97[_0xed75('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x1fa752,_0x1cd0b3){getLicense()[_0xed75('0xa')](function(_0x5f51cb){return db[_0xed75('0x1f')]['findAll']({'attributes':['role',[db[_0xed75('0x20')]['fn']('COUNT',db['sequelize'][_0xed75('0x21')]('role')),'count']],'group':_0xed75('0x22'),'where':{'role':{'$or':['admin',_0xed75('0x23'),_0xed75('0x24')]}},'raw':!![]})[_0xed75('0xa')](function(_0x2691a0){var _0x16b960={'user':_0x5f51cb['users']||0x0,'telephone':_0x5f51cb[_0xed75('0x25')]||0x0};_0x2691a0[_0xed75('0x26')](function(_0x2b10d3){var _0x14738e=_0x2b10d3[_0xed75('0x22')]===_0xed75('0x27')?_0xed75('0x23'):_0x2b10d3[_0xed75('0x22')];_0x16b960[_0x14738e]-=_0x2b10d3[_0xed75('0x28')];if(_0x16b960[_0x14738e]<0x0)_0x16b960[_0x14738e]=0x0;});_0x1fa752(_0x16b960);return;});})[_0xed75('0xb')](function(_0xb6a736){_0x1cd0b3(_0xb6a736);});});}function checkUserLimits(_0x36fb8e){return new BPromise(function(_0x39dfdc,_0x1821cc){getLimits()[_0xed75('0xa')](function(_0x44c9c4){var _0x39d84d=_[_0xed75('0x29')](_[_0xed75('0x2a')](_0x36fb8e,_0xed75('0x22')),['admin',_0xed75('0x23'),_0xed75('0x24')]);var _0x232765=(_0x39d84d[_0xed75('0x27')]||0x0)+(_0x39d84d[_0xed75('0x23')]||0x0);var _0x572197=_0x39d84d['telephone']||0x0;if(_0x232765>_0x44c9c4[_0xed75('0x23')])return _0x1821cc(_0xed75('0x2b'));if(_0x572197>_0x44c9c4[_0xed75('0x24')])return _0x1821cc(_0xed75('0x2c'));return _0x39dfdc();})[_0xed75('0xb')](function(_0x4a3537){_0x1821cc(_0x4a3537);});});}module[_0xed75('0x2d')]={'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 6b3a292..f6037ad 100644 --- a/server/config/local.env.js +++ b/server/config/local.env.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c3c=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x1deb72,_0x3f6338){var _0x18bbdf=function(_0x1b4b9b){while(--_0x1b4b9b){_0x1deb72['push'](_0x1deb72['shift']());}};_0x18bbdf(++_0x3f6338);}(_0x5c3c,0x132));var _0xc5c3=function(_0x75f869,_0x3690d6){_0x75f869=_0x75f869-0x0;var _0x10af8b=_0x5c3c[_0x75f869];return _0x10af8b;};'use strict';module[_0xc5c3('0x0')]={'DOMAIN':_0xc5c3('0x1'),'SESSION_SECRET':_0xc5c3('0x2'),'GOOGLE_ID':_0xc5c3('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x0972=['http://localhost:9000','app-id'];(function(_0x2ca5ea,_0x660143){var _0x28475d=function(_0x4b8e9e){while(--_0x4b8e9e){_0x2ca5ea['push'](_0x2ca5ea['shift']());}};_0x28475d(++_0x660143);}(_0x0972,0x64));var _0x2097=function(_0x2972b2,_0x513875){_0x2972b2=_0x2972b2-0x0;var _0xfc7f50=_0x0972[_0x2972b2];return _0xfc7f50;};'use strict';module['exports']={'DOMAIN':_0x2097('0x0'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x2097('0x1'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 0a2947c..afc3161 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5735=['exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','path','INFO','/var','log','xcally','format','message','replace','{{{','[%s]\x20[%s]\x20%s\x20-\x20%s','level'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x5735,0x16a));var _0x5573=function(_0x3dff8c,_0x5bf28a){_0x3dff8c=_0x3dff8c-0x0;var _0x1199cf=_0x5735[_0x3dff8c];return _0x1199cf;};'use strict';var moment=require(_0x5573('0x0'));var winston=require('winston');var util=require('util');var path=require(_0x5573('0x1'));var debugLevel=_0x5573('0x2');function filename(_0x4fa5da,_0x55a813){return path['join'](_0x5573('0x3'),_0x5573('0x4'),_0x5573('0x5'),util[_0x5573('0x6')]('%s-%s.log',_0x4fa5da,_0x55a813));}function formatter(_0x2d7689,_0x9f36d2){_0x9f36d2[_0x5573('0x7')]=_0x9f36d2[_0x5573('0x7')][_0x5573('0x8')](/@@{/g,_0x5573('0x9'))['replace'](/}@@/g,'}}}')[_0x5573('0x8')](/@{/g,'{{')[_0x5573('0x8')](/}@/g,'}}');return util[_0x5573('0x6')](_0x5573('0xa'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),_0x9f36d2[_0x5573('0xb')]['toUpperCase'](),_0x2d7689,_0x9f36d2[_0x5573('0x7')]);}module[_0x5573('0xc')]=function(_0xeed283){return new winston[(_0x5573('0xd'))]({'transports':[new winston[(_0x5573('0xe'))][(_0x5573('0xf'))]({'name':util[_0x5573('0x6')](_0x5573('0x10'),_0xeed283,_0x5573('0x11')),'filename':filename(_0xeed283,_0x5573('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x28da76){return formatter(_0xeed283,_0x28da76);}}),new winston[(_0x5573('0xe'))]['File']({'name':util[_0x5573('0x6')](_0x5573('0x10'),_0xeed283,_0x5573('0x12')),'filename':filename(_0xeed283,'info'),'level':_0x5573('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x511873){return formatter(_0xeed283,_0x511873);}}),new winston[(_0x5573('0xe'))][(_0x5573('0x13'))]({'level':process[_0x5573('0x14')][_0x5573('0x15')]||debugLevel,'json':![],'formatter':function(_0x266acb){return formatter(_0xeed283,_0x266acb);}})]});}; \ No newline at end of file +var _0xb319=['}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','log','xcally','format','%s-%s.log','message','replace','{{{'];(function(_0x3a0aab,_0x2792af){var _0x3cd59c=function(_0x21c7a5){while(--_0x21c7a5){_0x3a0aab['push'](_0x3a0aab['shift']());}};_0x3cd59c(++_0x2792af);}(_0xb319,0xb0));var _0x9b31=function(_0x4b7177,_0x954cb8){_0x4b7177=_0x4b7177-0x0;var _0x13e002=_0xb319[_0x4b7177];return _0x13e002;};'use strict';var moment=require(_0x9b31('0x0'));var winston=require(_0x9b31('0x1'));var util=require(_0x9b31('0x2'));var path=require(_0x9b31('0x3'));var debugLevel=_0x9b31('0x4');function filename(_0x68e7e8,_0x316485){return path[_0x9b31('0x5')]('/var',_0x9b31('0x6'),_0x9b31('0x7'),util[_0x9b31('0x8')](_0x9b31('0x9'),_0x68e7e8,_0x316485));}function formatter(_0x5d892f,_0x503ce5){_0x503ce5[_0x9b31('0xa')]=_0x503ce5[_0x9b31('0xa')][_0x9b31('0xb')](/@@{/g,_0x9b31('0xc'))[_0x9b31('0xb')](/}@@/g,_0x9b31('0xd'))['replace'](/@{/g,'{{')[_0x9b31('0xb')](/}@/g,'}}');return util[_0x9b31('0x8')](_0x9b31('0xe'),moment()[_0x9b31('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x503ce5[_0x9b31('0xf')][_0x9b31('0x10')](),_0x5d892f,_0x503ce5[_0x9b31('0xa')]);}module[_0x9b31('0x11')]=function(_0x1dc0c2){return new winston[(_0x9b31('0x12'))]({'transports':[new winston[(_0x9b31('0x13'))][(_0x9b31('0x14'))]({'name':util[_0x9b31('0x8')](_0x9b31('0x15'),_0x1dc0c2,_0x9b31('0x16')),'filename':filename(_0x1dc0c2,_0x9b31('0x16')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5c4f81){return formatter(_0x1dc0c2,_0x5c4f81);}}),new winston['transports'][(_0x9b31('0x14'))]({'name':util[_0x9b31('0x8')](_0x9b31('0x15'),_0x1dc0c2,'info'),'filename':filename(_0x1dc0c2,_0x9b31('0x17')),'level':_0x9b31('0x17'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x599f99){return formatter(_0x1dc0c2,_0x599f99);}}),new winston['transports'][(_0x9b31('0x18'))]({'level':process[_0x9b31('0x19')][_0x9b31('0x1a')]||debugLevel,'json':![],'formatter':function(_0x5ef663){return formatter(_0x1dc0c2,_0x5ef663);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index c6b6303..3bb3591 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 _0x6724=['exports','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','routing','../../services/routing/index.js','../../services/xdr/index.js'];(function(_0x1b14ec,_0x482c1c){var _0x2460a5=function(_0x4d08e3){while(--_0x4d08e3){_0x1b14ec['push'](_0x1b14ec['shift']());}};_0x2460a5(++_0x482c1c);}(_0x6724,0xa9));var _0x4672=function(_0xb94fac,_0x4e6061){_0xb94fac=_0xb94fac-0x0;var _0x49a71f=_0x6724[_0xb94fac];return _0x49a71f;};'use strict';var path=require(_0x4672('0x0'));var os=require('os');var config={'apps':[{'name':_0x4672('0x1'),'script':path[_0x4672('0x2')](__dirname,_0x4672('0x3'))},{'name':_0x4672('0x4'),'script':path[_0x4672('0x2')](__dirname,_0x4672('0x5'))},{'name':_0x4672('0x6'),'script':path[_0x4672('0x2')](__dirname,'../../services/agi/index.js')},{'name':_0x4672('0x7'),'script':path[_0x4672('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x4672('0x8'),'script':path[_0x4672('0x2')](__dirname,_0x4672('0x9'))},{'name':'xdr','script':path[_0x4672('0x2')](__dirname,_0x4672('0xa'))}]};module[_0x4672('0xb')]=config; \ No newline at end of file +var _0xd8d0=['routing','xdr','../../services/xdr/index.js','path','express','join','../../services/express/index.js','ami','../../services/ami/index.js','agi','../../services/agi/index.js','email'];(function(_0x528e77,_0x1d8dc8){var _0x1537a1=function(_0x50c2ff){while(--_0x50c2ff){_0x528e77['push'](_0x528e77['shift']());}};_0x1537a1(++_0x1d8dc8);}(_0xd8d0,0x6f));var _0x0d8d=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xd8d0[_0x2283dc];return _0x16db90;};'use strict';var path=require(_0x0d8d('0x0'));var os=require('os');var config={'apps':[{'name':_0x0d8d('0x1'),'script':path[_0x0d8d('0x2')](__dirname,_0x0d8d('0x3'))},{'name':_0x0d8d('0x4'),'script':path[_0x0d8d('0x2')](__dirname,_0x0d8d('0x5'))},{'name':_0x0d8d('0x6'),'script':path[_0x0d8d('0x2')](__dirname,_0x0d8d('0x7'))},{'name':_0x0d8d('0x8'),'script':path[_0x0d8d('0x2')](__dirname,'../../services/email/index.js')},{'name':_0x0d8d('0x9'),'script':path[_0x0d8d('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x0d8d('0xa'),'script':path[_0x0d8d('0x2')](__dirname,_0x0d8d('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 0b04c67..8580a28 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 _0x8709=['connected','start','then','disconnect','restart','list','describe','delete','dump','saved','./config','connect'];(function(_0xb0f7c3,_0x4eae95){var _0x28ea68=function(_0x4395a7){while(--_0x4395a7){_0xb0f7c3['push'](_0xb0f7c3['shift']());}};_0x28ea68(++_0x4eae95);}(_0x8709,0x14e));var _0x9870=function(_0x43b068,_0x400bbe){_0x43b068=_0x43b068-0x0;var _0x269c2b=_0x8709[_0x43b068];return _0x269c2b;};'use strict';var pm2=require('pm2');var BPromise=require('bluebird');var config=require(_0x9870('0x0'));function connect(){return new BPromise(function(_0x546a9c,_0x4d268a){return pm2[_0x9870('0x1')](function(_0x3a2127){if(_0x3a2127){return _0x4d268a(_0x3a2127);}return _0x546a9c(_0x9870('0x2'));});});};exports[_0x9870('0x3')]=function(_0x1c0f4c){return connect()[_0x9870('0x4')](function(){return new BPromise(function(_0x2e7599,_0x328241){return pm2[_0x9870('0x3')](_0x1c0f4c,function(_0x246686,_0x33584f){if(_0x246686){return _0x328241(_0x246686);}pm2['disconnect']();return _0x2e7599(_0x33584f);});});});};exports['stop']=function(_0x140790){return connect()[_0x9870('0x4')](function(){return new BPromise(function(_0x282bc2,_0x7aab8d){return pm2['stop'](_0x140790,function(_0xc1ba01,_0x3c8da5){if(_0xc1ba01){return _0x7aab8d(_0xc1ba01);}pm2[_0x9870('0x5')]();return _0x282bc2(_0x3c8da5);});});});};exports[_0x9870('0x6')]=function(_0x573d0b){return connect()['then'](function(){return new BPromise(function(_0x560162,_0x5539cf){return pm2[_0x9870('0x6')](_0x573d0b,function(_0x4242c8,_0x47eea6){if(_0x4242c8){return _0x5539cf(_0x4242c8);}pm2[_0x9870('0x5')]();return _0x560162(_0x47eea6);});});});};exports[_0x9870('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2d7000,_0x4d8dfd){return pm2['list'](function(_0x58dff5,_0x26cd15){if(_0x58dff5){return _0x4d8dfd(_0x58dff5);}pm2[_0x9870('0x5')]();return _0x2d7000(_0x26cd15);});});});};exports[_0x9870('0x8')]=function(_0x3d26ad){return connect()['then'](function(){return new BPromise(function(_0x1cd96e,_0xec28ed){return pm2[_0x9870('0x8')](_0x3d26ad,function(_0x2e181e,_0x3d3226){if(_0x2e181e){return _0xec28ed(_0x2e181e);}pm2[_0x9870('0x5')]();return _0x1cd96e(_0x3d3226);});});});};exports[_0x9870('0x9')]=function(_0x1c3f3d){return connect()['then'](function(){return new BPromise(function(_0x34b06d,_0x3abec2){return pm2[_0x9870('0x9')](_0x1c3f3d,function(_0x5da16b,_0x14bb8e){if(_0x5da16b){return _0x3abec2(_0x5da16b);}pm2[_0x9870('0x5')]();return _0x34b06d(_0x14bb8e);});});});};exports[_0x9870('0xa')]=function(){return connect()[_0x9870('0x4')](function(){return new BPromise(function(_0x460b2d,_0x2faba8){return pm2[_0x9870('0xa')](function(_0x57fd29){if(_0x57fd29){return _0x2faba8(_0x57fd29);}return _0x460b2d(_0x9870('0xb'));});});});}; \ No newline at end of file +var _0x0166=['list','describe','delete','dump','pm2','bluebird','connect','connected','start','then','stop','disconnect','restart'];(function(_0x1dcbfd,_0xd56150){var _0x459f94=function(_0xbcea31){while(--_0xbcea31){_0x1dcbfd['push'](_0x1dcbfd['shift']());}};_0x459f94(++_0xd56150);}(_0x0166,0xa0));var _0x6016=function(_0x49d21e,_0x290365){_0x49d21e=_0x49d21e-0x0;var _0xbf2a60=_0x0166[_0x49d21e];return _0xbf2a60;};'use strict';var pm2=require(_0x6016('0x0'));var BPromise=require(_0x6016('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0xc61578,_0x125dd7){return pm2[_0x6016('0x2')](function(_0x11efe9){if(_0x11efe9){return _0x125dd7(_0x11efe9);}return _0xc61578(_0x6016('0x3'));});});};exports[_0x6016('0x4')]=function(_0x335706){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x4b4e4f,_0x3f594f){return pm2[_0x6016('0x4')](_0x335706,function(_0x4208a2,_0x3f7867){if(_0x4208a2){return _0x3f594f(_0x4208a2);}pm2['disconnect']();return _0x4b4e4f(_0x3f7867);});});});};exports[_0x6016('0x6')]=function(_0x212143){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x3433a8,_0x6576e6){return pm2[_0x6016('0x6')](_0x212143,function(_0x814a96,_0x321869){if(_0x814a96){return _0x6576e6(_0x814a96);}pm2[_0x6016('0x7')]();return _0x3433a8(_0x321869);});});});};exports['restart']=function(_0x809419){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x178d60,_0xbe7ac){return pm2[_0x6016('0x8')](_0x809419,function(_0x5a632d,_0x4f4417){if(_0x5a632d){return _0xbe7ac(_0x5a632d);}pm2[_0x6016('0x7')]();return _0x178d60(_0x4f4417);});});});};exports[_0x6016('0x9')]=function(){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x369e2c,_0x173115){return pm2[_0x6016('0x9')](function(_0x3838f7,_0x171242){if(_0x3838f7){return _0x173115(_0x3838f7);}pm2[_0x6016('0x7')]();return _0x369e2c(_0x171242);});});});};exports[_0x6016('0xa')]=function(_0x173cb4){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x472545,_0x58c809){return pm2[_0x6016('0xa')](_0x173cb4,function(_0x5136d3,_0x8a364e){if(_0x5136d3){return _0x58c809(_0x5136d3);}pm2['disconnect']();return _0x472545(_0x8a364e);});});});};exports[_0x6016('0xb')]=function(_0x17b8fe){return connect()[_0x6016('0x5')](function(){return new BPromise(function(_0x2820ba,_0x1fc113){return pm2[_0x6016('0xb')](_0x17b8fe,function(_0x4ef6d6,_0x5376b4){if(_0x4ef6d6){return _0x1fc113(_0x4ef6d6);}pm2[_0x6016('0x7')]();return _0x2820ba(_0x5376b4);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x169060,_0x4408a8){return pm2[_0x6016('0xc')](function(_0x4ac205){if(_0x4ac205){return _0x4408a8(_0x4ac205);}return _0x169060('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 875475a..a7634f7 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 _0x1e12=['then','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','error','inspect','start','lodash','moment','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract'];(function(_0x2aa296,_0x31bfda){var _0xe9b5eb=function(_0x19451b){while(--_0x19451b){_0x2aa296['push'](_0x2aa296['shift']());}};_0xe9b5eb(++_0x31bfda);}(_0x1e12,0x1ef));var _0x21e1=function(_0x2677ff,_0x4d711e){_0x2677ff=_0x2677ff-0x0;var _0x18a9d1=_0x1e12[_0x2677ff];return _0x18a9d1;};'use strict';var _=require(_0x21e1('0x0'));var moment=require(_0x21e1('0x1'));var Redis=require('ioredis');var util=require(_0x21e1('0x2'));var config=require(_0x21e1('0x3'));var db=require(_0x21e1('0x4'))['db'];var logger=require(_0x21e1('0x5'))(_0x21e1('0x6'));config[_0x21e1('0x7')]=_[_0x21e1('0x8')](config[_0x21e1('0x7')],{'host':_0x21e1('0x9'),'port':0x18eb});var io=require(_0x21e1('0xa'))(new Redis(config[_0x21e1('0x7')]));function closeInteractions(){var _0x55214c=0x0;var _0x768d44=[];return db['Setting'][_0x21e1('0xb')]({'raw':!![],'attributes':['id',_0x21e1('0xc')],'where':{'id':0x1}})['then'](function(_0x15992c){_0x55214c=_0x15992c[_0x21e1('0xc')];if(_0x55214c){return db[_0x21e1('0xd')][_0x21e1('0xe')]({'raw':!![],'attributes':['id',_0x21e1('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x21e1('0x10')](_0x15992c[_0x21e1('0xc')],'minutes')}}});}else{return[];}})[_0x21e1('0x11')](function(_0x96ca3b){if(_0x96ca3b&&_0x96ca3b['length']){_0x768d44=_[_0x21e1('0x12')](_0x96ca3b||[],'id');logger[_0x21e1('0x13')](_0x21e1('0x14'),_0x768d44[_0x21e1('0x15')]());return db[_0x21e1('0xd')]['update']({'closeReason':_0x21e1('0x16'),'disposition':_0x21e1('0x17'),'closed':!![],'closedAt':moment()[_0x21e1('0x18')](_0x21e1('0x19'))},{'where':{'id':_0x768d44}});}})[_0x21e1('0x11')](function(){if(_0x768d44&&_0x768d44[_0x21e1('0x1a')]){logger[_0x21e1('0x13')](_0x21e1('0x1b'),_0x768d44['join']());for(var _0x4a3de1=0x0;_0x4a3de1<_0x768d44['length'];_0x4a3de1++){io['emit'](_0x21e1('0x1c'),{'id':_0x768d44[_0x4a3de1],'closed':!![]});}}})['catch'](function(_0x192a41){logger[_0x21e1('0x1d')]('[CHAT]\x20Error\x20closing\x20interactions',_0x192a41?util[_0x21e1('0x1e')](_0x192a41,{'showHidden':![],'depth':null}):'');});}exports[_0x21e1('0x1f')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x887a=['start','lodash','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','chatInteraction:update','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect'];(function(_0x5380b1,_0x58eb0d){var _0x265a80=function(_0x1ea583){while(--_0x1ea583){_0x5380b1['push'](_0x5380b1['shift']());}};_0x265a80(++_0x58eb0d);}(_0x887a,0x119));var _0xa887=function(_0x19bb3d,_0x57572e){_0x19bb3d=_0x19bb3d-0x0;var _0x4fe162=_0x887a[_0x19bb3d];return _0x4fe162;};'use strict';var _=require(_0xa887('0x0'));var moment=require('moment');var Redis=require(_0xa887('0x1'));var util=require(_0xa887('0x2'));var config=require(_0xa887('0x3'));var db=require(_0xa887('0x4'))['db'];var logger=require(_0xa887('0x5'))(_0xa887('0x6'));config[_0xa887('0x7')]=_[_0xa887('0x8')](config[_0xa887('0x7')],{'host':_0xa887('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x35fc2a=0x0;var _0x25a888=[];return db[_0xa887('0xa')][_0xa887('0xb')]({'raw':!![],'attributes':['id',_0xa887('0xc')],'where':{'id':0x1}})[_0xa887('0xd')](function(_0x4c9d75){_0x35fc2a=_0x4c9d75['chatTimeout'];if(_0x35fc2a){return db['ChatInteraction'][_0xa887('0xe')]({'raw':!![],'attributes':['id',_0xa887('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xa887('0x10')](_0x4c9d75[_0xa887('0xc')],'minutes')}}});}else{return[];}})[_0xa887('0xd')](function(_0x130ce5){if(_0x130ce5&&_0x130ce5[_0xa887('0x11')]){_0x25a888=_[_0xa887('0x12')](_0x130ce5||[],'id');logger[_0xa887('0x13')](_0xa887('0x14'),_0x25a888[_0xa887('0x15')]());return db[_0xa887('0x16')][_0xa887('0x17')]({'closeReason':_0xa887('0x18'),'disposition':_0xa887('0x19'),'closed':!![],'closedAt':moment()[_0xa887('0x1a')](_0xa887('0x1b'))},{'where':{'id':_0x25a888}});}})[_0xa887('0xd')](function(){if(_0x25a888&&_0x25a888[_0xa887('0x11')]){logger[_0xa887('0x13')](_0xa887('0x1c'),_0x25a888['join']());for(var _0x42f588=0x0;_0x42f588<_0x25a888[_0xa887('0x11')];_0x42f588++){io['emit'](_0xa887('0x1d'),{'id':_0x25a888[_0x42f588],'closed':!![]});}}})[_0xa887('0x1e')](function(_0x5943b3){logger[_0xa887('0x1f')](_0xa887('0x20'),_0x5943b3?util[_0xa887('0x21')](_0x5943b3,{'showHidden':![],'depth':null}):'');});}exports[_0xa887('0x22')]=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 568b40f..1918f90 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 _0x7572=['startAllRefreshIntervals','exports'];(function(_0x41d337,_0x300d7a){var _0x26b21d=function(_0x1cc5e8){while(--_0x1cc5e8){_0x41d337['push'](_0x41d337['shift']());}};_0x26b21d(++_0x300d7a);}(_0x7572,0x174));var _0x2757=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0x7572[_0x3dc68d];return _0xdf7f94;};'use strict';function start(){var _0x1cc7cf=require('../../api/cloudProvider/cloudProvider.oauth.js');return _0x1cc7cf[_0x2757('0x0')]();}module[_0x2757('0x1')]={'intervals':{},'start':start}; \ No newline at end of file +var _0x4f9b=['../../api/cloudProvider/cloudProvider.oauth.js','exports'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x4f9b,0x10c));var _0xb4f9=function(_0x916a95,_0x3655d2){_0x916a95=_0x916a95-0x0;var _0x5b94b0=_0x4f9b[_0x916a95];return _0x5b94b0;};'use strict';function start(){var _0x3f7d34=require(_0xb4f9('0x0'));return _0x3f7d34['startAllRefreshIntervals']();}module[_0xb4f9('0x1')]={'intervals':{},'start':start}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 6a460b0..9c60630 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 _0xc2a7=['keyBy','intersection','difference','exists','stop','deleteJob','delete\x20cron','toRun','length','index','my\x20id','cron','endAt','add','start','add\x20cron','stop\x20cron','isBetween','update','update\x20cron','util','path','lodash','moment','jayson/promise','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','host','Smtp','port','secure','authentication','user','pass','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','savename','format','%s.%s','basename','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','status','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error\x20mail','catch','error','data','isNil','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','Schedule','findAll','MailServerOut','jobs','map','toString'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xc2a7,0x119));var _0x7c2a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc2a7[_0x42cae2];return _0x5f256f;};'use strict';var fs=require('fs');var util=require(_0x7c2a('0x0'));var path=require(_0x7c2a('0x1'));var _=require(_0x7c2a('0x2'));var moment=require(_0x7c2a('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x7c2a('0x4'));var BPromise=require('bluebird');var logger=require(_0x7c2a('0x5'))(_0x7c2a('0x6'));var db=require(_0x7c2a('0x7'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x7c2a('0x8'));var client=jayson[_0x7c2a('0x9')][_0x7c2a('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0xb18d86,_0x33f796){return function(){logger['info'](_0x7c2a('0xb'),_0xb18d86[_0x7c2a('0xc')]);var _0x3f8a3c=!![];var _0x32c079={'tls':{'rejectUnauthorized':![]}};if(_0xb18d86[_0x7c2a('0xd')]['Smtp'][_0x7c2a('0xe')]){_0x32c079[_0x7c2a('0xe')]=_0xb18d86[_0x7c2a('0xd')]['Smtp'][_0x7c2a('0xe')];}else{_0x32c079[_0x7c2a('0xf')]=_0xb18d86[_0x7c2a('0xd')][_0x7c2a('0x10')][_0x7c2a('0xf')];_0x32c079[_0x7c2a('0x11')]=_0xb18d86[_0x7c2a('0xd')][_0x7c2a('0x10')]['port'];_0x32c079[_0x7c2a('0x12')]=_0xb18d86['MailAccount']['Smtp'][_0x7c2a('0x12')];}if(_0xb18d86['MailAccount'][_0x7c2a('0x10')][_0x7c2a('0x13')]){_0x32c079['auth']={'user':_0xb18d86[_0x7c2a('0xd')][_0x7c2a('0x10')][_0x7c2a('0x14')],'pass':_0xb18d86['MailAccount'][_0x7c2a('0x10')][_0x7c2a('0x15')]};}var _0x490a61={'account':_0x32c079,'message':{'from':util['format'](_0x7c2a('0x16'),_0xb18d86['MailAccount'][_0x7c2a('0x17')],_0xb18d86[_0x7c2a('0xd')][_0x7c2a('0xc')]||_0xb18d86[_0x7c2a('0xd')][_0x7c2a('0x10')]['user']),'to':_0xb18d86[_0x7c2a('0xc')],'cc':_0xb18d86['cc'],'bcc':_0xb18d86[_0x7c2a('0x18')],'subject':util['format'](_0x7c2a('0x19'),_0x33f796['name'],_0xb18d86[_0x7c2a('0x1a')],_0xb18d86['subtractUnit'])}};var _0x47989e=path[_0x7c2a('0x1b')](__dirname,'../../files/reports');var _0x599249=_0x33f796[_0x7c2a('0x1c')];var _0x5c049d=util[_0x7c2a('0x1d')](_0x7c2a('0x1e'),path[_0x7c2a('0x1f')](_0x33f796['savename'],path['extname'](_0x33f796[_0x7c2a('0x1c')])),_0x7c2a('0x20'));var _0x4fddb5=path[_0x7c2a('0x1b')](_0x47989e,_0x599249);var _0x230a4a=path[_0x7c2a('0x1b')](_0x47989e,_0x5c049d);if(fs[_0x7c2a('0x21')](_0x4fddb5)){_0x33f796['status']=_0x7c2a('0x22');_0x490a61[_0x7c2a('0x23')][_0x7c2a('0x24')]=[{'filename':_0x599249,'path':_0x4fddb5}];_0x490a61[_0x7c2a('0x23')][_0x7c2a('0x25')]=util[_0x7c2a('0x1d')](_0x7c2a('0x26'),JSON[_0x7c2a('0x27')](_0x33f796,null,0x2));}else if(fs[_0x7c2a('0x21')](_0x230a4a)){_0x33f796[_0x7c2a('0x28')]=_0x7c2a('0x22');_0x490a61[_0x7c2a('0x23')][_0x7c2a('0x24')]=[{'filename':_0x5c049d,'path':_0x230a4a}];}else{_0x490a61[_0x7c2a('0x23')][_0x7c2a('0x25')]=_0x7c2a('0x29');if(!_0xb18d86[_0x7c2a('0x2a')]){_0x3f8a3c=![];logger[_0x7c2a('0x2b')](_0x7c2a('0x2c'));}}if(_0x3f8a3c){return client['request'](_0x7c2a('0x2d'),_0x490a61)[_0x7c2a('0x2e')](function(_0x46cb14){if(_0x46cb14['error']){return logger['error'](_0x7c2a('0x2f'),JSON[_0x7c2a('0x27')](_0x46cb14));}return logger[_0x7c2a('0x2b')]('email\x20sent');})[_0x7c2a('0x30')](function(_0x45213d){return logger[_0x7c2a('0x31')](_0x7c2a('0x2f'),JSON[_0x7c2a('0x27')](_0x45213d));});}};}function handleError(){return function(_0x15318f){return logger['error'](JSON[_0x7c2a('0x27')](_0x15318f));};}function handleResult(_0x557f65){return function(_0x1fd5a2){logger[_0x7c2a('0x2b')](_0x7c2a('0x32'),JSON['stringify'](_0x1fd5a2));if(_0x557f65[_0x7c2a('0xd')]&&_0x557f65[_0x7c2a('0xd')][_0x7c2a('0x10')]&&!_[_0x7c2a('0x33')](_0x557f65[_0x7c2a('0xc')])){setTimeout(handleSendEmail(_0x557f65,_0x1fd5a2),0x3c*0x3e8);}};}function handleJob(_0x593523){return function(){try{if(_[_0x7c2a('0x33')](_0x593523['subtractNumber'])){return logger[_0x7c2a('0x2b')]('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x593523[_0x7c2a('0x34')])){return logger[_0x7c2a('0x2b')](_0x7c2a('0x35'));}var _0x32b08e={'startDate':moment()['subtract'](_0x593523[_0x7c2a('0x1a')],_0x593523[_0x7c2a('0x34')])[_0x7c2a('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x7c2a('0x1d')](_0x7c2a('0x36')),'type':_0x7c2a('0x37'),'output':_0x593523[_0x7c2a('0x38')],'name':_0x593523[_0x7c2a('0x17')]};if(!_[_0x7c2a('0x33')](_0x593523[_0x7c2a('0x39')])){logger[_0x7c2a('0x2b')](_0x7c2a('0x3a'),_0x593523[_0x7c2a('0x39')]);return analyticDefaultReportController[_0x7c2a('0x3b')]({'id':_0x593523[_0x7c2a('0x39')]},_0x32b08e)[_0x7c2a('0x2e')](handleResult(_0x593523))[_0x7c2a('0x30')](handleError());}if(!_[_0x7c2a('0x33')](_0x593523[_0x7c2a('0x3c')])){logger[_0x7c2a('0x2b')]('exec\x20custom\x20report\x20id:%s',_0x593523[_0x7c2a('0x3c')]);return analyticCustomReportController[_0x7c2a('0x3b')]({'id':_0x593523[_0x7c2a('0x3c')]},_0x32b08e)['then'](handleResult(_0x593523))[_0x7c2a('0x30')](handleError());}}catch(_0x37b82d){logger[_0x7c2a('0x31')](JSON[_0x7c2a('0x27')](_0x37b82d));}return logger[_0x7c2a('0x2b')]('no\x20report\x20id');};}function getJobs(_0x51311c){var _0x3e9bd5={};if(_0x51311c){_0x3e9bd5['id']=_0x51311c;}return db[_0x7c2a('0x3d')][_0x7c2a('0x3e')]({'where':_0x3e9bd5,'include':[{'model':db[_0x7c2a('0xd')],'attributes':['id',_0x7c2a('0x17'),'email'],'include':[{'model':db[_0x7c2a('0x3f')],'as':'Smtp'}]}]})[_0x7c2a('0x2e')](function(_0x3fac90){var _0x3a9eaf=_['keys'](manager[_0x7c2a('0x40')]);var _0x5a009a=_[_0x7c2a('0x41')](_0x3fac90,function(_0x5d0aa8){return _0x5d0aa8['id'][_0x7c2a('0x42')]();});var _0x2d3fe6=_[_0x7c2a('0x43')](_0x3fac90,function(_0xe86700){return _0xe86700['id'][_0x7c2a('0x42')]();});var _0x27a466=_0x51311c?_0x5a009a:_['difference'](_0x5a009a,_0x3a9eaf);var _0x526329=_[_0x7c2a('0x44')](_0x5a009a,_0x3a9eaf);var _0x4c7cc8=_[_0x7c2a('0x45')](_0x3a9eaf,_0x5a009a);var _0x98c921;var _0x3e251b;for(_0x98c921=0x0;_0x98c921<_0x4c7cc8['length']&&!_0x51311c;_0x98c921+=0x1){_0x3e251b=_0x4c7cc8[_0x98c921][_0x7c2a('0x42')]();if(manager[_0x7c2a('0x46')](_0x3e251b)){manager[_0x7c2a('0x47')](_0x3e251b);manager[_0x7c2a('0x48')](_0x3e251b);logger[_0x7c2a('0x2b')](_0x7c2a('0x49'),_0x3e251b);}}logger[_0x7c2a('0x2b')](_0x7c2a('0x4a'),JSON['stringify'](_0x27a466));for(_0x98c921=0x0;_0x98c921<_0x27a466[_0x7c2a('0x4b')];_0x98c921+=0x1){_0x3e251b=_0x27a466[_0x98c921][_0x7c2a('0x42')]();logger['info'](_0x7c2a('0x4c'),_0x3e251b);if(_0x51311c){logger[_0x7c2a('0x2b')](_0x7c2a('0x4d'),_0x51311c);logger[_0x7c2a('0x2b')](JSON['stringify'](_0x2d3fe6[_0x3e251b]));BPromise['resolve']()[_0x7c2a('0x2e')](handleJob(_0x2d3fe6[_0x3e251b]));logger[_0x7c2a('0x2b')]('run\x20job',_0x2d3fe6[_0x3e251b][_0x7c2a('0x17')],_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')]);}else if(_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')]&&_0x2d3fe6[_0x3e251b]['active']&&moment()['isBetween'](_0x2d3fe6[_0x3e251b]['startAt'],_0x2d3fe6[_0x3e251b][_0x7c2a('0x4f')])){manager[_0x7c2a('0x50')](_0x3e251b,_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')],handleJob(_0x2d3fe6[_0x3e251b]));manager[_0x7c2a('0x51')](_0x3e251b);logger['info'](_0x7c2a('0x52'),_0x2d3fe6[_0x3e251b][_0x7c2a('0x17')],_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')]);}else if(manager[_0x7c2a('0x46')](_0x3e251b)){manager['stop'](_0x3e251b);manager['deleteJob'](_0x3e251b);logger['info'](_0x7c2a('0x53'),_0x2d3fe6[_0x3e251b][_0x7c2a('0x17')],_0x2d3fe6[_0x3e251b]['cron']);}}for(_0x98c921=0x0,_0x3e251b;_0x98c921<_0x526329['length']&&!_0x51311c;_0x98c921+=0x1){_0x3e251b=_0x526329[_0x98c921]['toString']();if(manager[_0x7c2a('0x46')](_0x3e251b)){if(_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')]&&_0x2d3fe6[_0x3e251b]['active']&&moment()[_0x7c2a('0x54')](_0x2d3fe6[_0x3e251b]['startAt'],_0x2d3fe6[_0x3e251b][_0x7c2a('0x4f')])){manager[_0x7c2a('0x55')](_0x3e251b,_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')],handleJob(_0x2d3fe6[_0x3e251b]));logger[_0x7c2a('0x2b')](_0x7c2a('0x56'),_0x2d3fe6[_0x3e251b][_0x7c2a('0x17')],_0x2d3fe6[_0x3e251b][_0x7c2a('0x4e')]);}else{manager[_0x7c2a('0x47')](_0x3e251b);manager[_0x7c2a('0x48')](_0x3e251b);logger[_0x7c2a('0x2b')]('stop\x20cron',_0x2d3fe6[_0x3e251b]['name'],_0x2d3fe6[_0x3e251b]['cron']);}}}})[_0x7c2a('0x30')](function(_0x18a280){logger['error'](JSON[_0x7c2a('0x27')](_0x18a280));});}exports['run']=function(_0xc73937){return getJobs(_0xc73937);};exports[_0x7c2a('0x51')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x78e0=['YYYY-MM-DD\x20HH:mm:ss','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','runReport','Schedule','findAll','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop\x20cron','update','update\x20cron','run','start','util','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','Smtp','service','MailAccount','host','port','secure','authentication','user','format','\x22%s\x22\x20<%s>','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','%s.%s','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract'];(function(_0x10030b,_0xb468bb){var _0x39ccc2=function(_0x5dfe03){while(--_0x5dfe03){_0x10030b['push'](_0x10030b['shift']());}};_0x39ccc2(++_0xb468bb);}(_0x78e0,0xd3));var _0x078e=function(_0x8d9399,_0x490955){_0x8d9399=_0x8d9399-0x0;var _0x5a0645=_0x78e0[_0x8d9399];return _0x5a0645;};'use strict';var fs=require('fs');var util=require(_0x078e('0x0'));var path=require('path');var _=require(_0x078e('0x1'));var moment=require(_0x078e('0x2'));var CronJobManager=require(_0x078e('0x3'));var jayson=require(_0x078e('0x4'));var BPromise=require(_0x078e('0x5'));var logger=require(_0x078e('0x6'))(_0x078e('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x078e('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x078e('0x9')][_0x078e('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3607b7,_0x2f0e93){return function(){logger['info'](_0x078e('0xb'),_0x3607b7[_0x078e('0xc')]);var _0xd78826=!![];var _0x5c8e05={'tls':{'rejectUnauthorized':![]}};if(_0x3607b7['MailAccount'][_0x078e('0xd')][_0x078e('0xe')]){_0x5c8e05[_0x078e('0xe')]=_0x3607b7[_0x078e('0xf')]['Smtp'][_0x078e('0xe')];}else{_0x5c8e05[_0x078e('0x10')]=_0x3607b7[_0x078e('0xf')][_0x078e('0xd')][_0x078e('0x10')];_0x5c8e05['port']=_0x3607b7[_0x078e('0xf')]['Smtp'][_0x078e('0x11')];_0x5c8e05[_0x078e('0x12')]=_0x3607b7[_0x078e('0xf')][_0x078e('0xd')]['secure'];}if(_0x3607b7[_0x078e('0xf')][_0x078e('0xd')][_0x078e('0x13')]){_0x5c8e05['auth']={'user':_0x3607b7[_0x078e('0xf')][_0x078e('0xd')][_0x078e('0x14')],'pass':_0x3607b7['MailAccount'][_0x078e('0xd')]['pass']};}var _0x64e905={'account':_0x5c8e05,'message':{'from':util[_0x078e('0x15')](_0x078e('0x16'),_0x3607b7[_0x078e('0xf')][_0x078e('0x17')],_0x3607b7[_0x078e('0xf')][_0x078e('0xc')]||_0x3607b7['MailAccount'][_0x078e('0xd')][_0x078e('0x14')]),'to':_0x3607b7['email'],'cc':_0x3607b7['cc'],'bcc':_0x3607b7['bcc'],'subject':util['format'](_0x078e('0x18'),_0x2f0e93[_0x078e('0x17')],_0x3607b7[_0x078e('0x19')],_0x3607b7[_0x078e('0x1a')])}};var _0x1ffd84=path[_0x078e('0x1b')](__dirname,'../../files/reports');var _0x596ccb=_0x2f0e93['savename'];var _0x4583f4=util['format'](_0x078e('0x1c'),path[_0x078e('0x1d')](_0x2f0e93[_0x078e('0x1e')],path[_0x078e('0x1f')](_0x2f0e93['savename'])),_0x078e('0x20'));var _0x19acf8=path[_0x078e('0x1b')](_0x1ffd84,_0x596ccb);var _0x3a63cf=path[_0x078e('0x1b')](_0x1ffd84,_0x4583f4);if(fs[_0x078e('0x21')](_0x19acf8)){_0x2f0e93[_0x078e('0x22')]=_0x078e('0x23');_0x64e905[_0x078e('0x24')][_0x078e('0x25')]=[{'filename':_0x596ccb,'path':_0x19acf8}];_0x64e905[_0x078e('0x24')][_0x078e('0x26')]=util['format'](_0x078e('0x27'),JSON[_0x078e('0x28')](_0x2f0e93,null,0x2));}else if(fs['existsSync'](_0x3a63cf)){_0x2f0e93[_0x078e('0x22')]='Sent';_0x64e905[_0x078e('0x24')][_0x078e('0x25')]=[{'filename':_0x4583f4,'path':_0x3a63cf}];}else{_0x64e905['message'][_0x078e('0x26')]=_0x078e('0x29');if(!_0x3607b7['sendIfEmpty']){_0xd78826=![];logger[_0x078e('0x2a')](_0x078e('0x2b'));}}if(_0xd78826){return client[_0x078e('0x2c')]('SendMail',_0x64e905)[_0x078e('0x2d')](function(_0x23413b){if(_0x23413b[_0x078e('0x2e')]){return logger['error'](_0x078e('0x2f'),JSON[_0x078e('0x28')](_0x23413b));}return logger['info'](_0x078e('0x30'));})[_0x078e('0x31')](function(_0x56d4f7){return logger['error']('error\x20mail',JSON['stringify'](_0x56d4f7));});}};}function handleError(){return function(_0x174064){return logger['error'](JSON[_0x078e('0x28')](_0x174064));};}function handleResult(_0x115b9c){return function(_0x382812){logger['info']('data',JSON[_0x078e('0x28')](_0x382812));if(_0x115b9c[_0x078e('0xf')]&&_0x115b9c[_0x078e('0xf')][_0x078e('0xd')]&&!_['isNil'](_0x115b9c[_0x078e('0xc')])){setTimeout(handleSendEmail(_0x115b9c,_0x382812),0x3c*0x3e8);}};}function handleJob(_0x53dadb){return function(){try{if(_[_0x078e('0x32')](_0x53dadb[_0x078e('0x19')])){return logger[_0x078e('0x2a')](_0x078e('0x33'));}if(_['isNil'](_0x53dadb[_0x078e('0x1a')])){return logger[_0x078e('0x2a')]('subtractUnit\x20null\x20or\x20undefined');}var _0x5d37c7={'startDate':moment()[_0x078e('0x34')](_0x53dadb['subtractNumber'],_0x53dadb[_0x078e('0x1a')])[_0x078e('0x15')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x078e('0x15')](_0x078e('0x35')),'type':'scheduled','output':_0x53dadb['output'],'name':_0x53dadb['name']};if(!_[_0x078e('0x32')](_0x53dadb[_0x078e('0x36')])){logger[_0x078e('0x2a')](_0x078e('0x37'),_0x53dadb[_0x078e('0x36')]);return analyticDefaultReportController['runReport']({'id':_0x53dadb['DefaultReportId']},_0x5d37c7)[_0x078e('0x2d')](handleResult(_0x53dadb))[_0x078e('0x31')](handleError());}if(!_[_0x078e('0x32')](_0x53dadb[_0x078e('0x38')])){logger[_0x078e('0x2a')]('exec\x20custom\x20report\x20id:%s',_0x53dadb[_0x078e('0x38')]);return analyticCustomReportController[_0x078e('0x39')]({'id':_0x53dadb[_0x078e('0x38')]},_0x5d37c7)[_0x078e('0x2d')](handleResult(_0x53dadb))[_0x078e('0x31')](handleError());}}catch(_0x380a89){logger[_0x078e('0x2e')](JSON[_0x078e('0x28')](_0x380a89));}return logger[_0x078e('0x2a')]('no\x20report\x20id');};}function getJobs(_0xfe4459){var _0x1bd006={};if(_0xfe4459){_0x1bd006['id']=_0xfe4459;}return db[_0x078e('0x3a')][_0x078e('0x3b')]({'where':_0x1bd006,'include':[{'model':db[_0x078e('0xf')],'attributes':['id',_0x078e('0x17'),'email'],'include':[{'model':db['MailServerOut'],'as':'Smtp'}]}]})[_0x078e('0x2d')](function(_0x337e8d){var _0x5af2aa=_[_0x078e('0x3c')](manager[_0x078e('0x3d')]);var _0x5b4b7e=_[_0x078e('0x3e')](_0x337e8d,function(_0x82a05){return _0x82a05['id'][_0x078e('0x3f')]();});var _0xbe251e=_[_0x078e('0x40')](_0x337e8d,function(_0x20e07f){return _0x20e07f['id']['toString']();});var _0x5da37c=_0xfe4459?_0x5b4b7e:_[_0x078e('0x41')](_0x5b4b7e,_0x5af2aa);var _0x320566=_[_0x078e('0x42')](_0x5b4b7e,_0x5af2aa);var _0x15ef8f=_[_0x078e('0x41')](_0x5af2aa,_0x5b4b7e);var _0x419ff5;var _0x9967c5;for(_0x419ff5=0x0;_0x419ff5<_0x15ef8f[_0x078e('0x43')]&&!_0xfe4459;_0x419ff5+=0x1){_0x9967c5=_0x15ef8f[_0x419ff5]['toString']();if(manager[_0x078e('0x44')](_0x9967c5)){manager[_0x078e('0x45')](_0x9967c5);manager[_0x078e('0x46')](_0x9967c5);logger[_0x078e('0x2a')](_0x078e('0x47'),_0x9967c5);}}logger[_0x078e('0x2a')](_0x078e('0x48'),JSON[_0x078e('0x28')](_0x5da37c));for(_0x419ff5=0x0;_0x419ff5<_0x5da37c[_0x078e('0x43')];_0x419ff5+=0x1){_0x9967c5=_0x5da37c[_0x419ff5][_0x078e('0x3f')]();logger[_0x078e('0x2a')](_0x078e('0x49'),_0x9967c5);if(_0xfe4459){logger[_0x078e('0x2a')]('my\x20id',_0xfe4459);logger[_0x078e('0x2a')](JSON['stringify'](_0xbe251e[_0x9967c5]));BPromise[_0x078e('0x4a')]()[_0x078e('0x2d')](handleJob(_0xbe251e[_0x9967c5]));logger['info'](_0x078e('0x4b'),_0xbe251e[_0x9967c5][_0x078e('0x17')],_0xbe251e[_0x9967c5][_0x078e('0x4c')]);}else if(_0xbe251e[_0x9967c5][_0x078e('0x4c')]&&_0xbe251e[_0x9967c5][_0x078e('0x4d')]&&moment()[_0x078e('0x4e')](_0xbe251e[_0x9967c5][_0x078e('0x4f')],_0xbe251e[_0x9967c5][_0x078e('0x50')])){manager[_0x078e('0x51')](_0x9967c5,_0xbe251e[_0x9967c5]['cron'],handleJob(_0xbe251e[_0x9967c5]));manager['start'](_0x9967c5);logger['info'](_0x078e('0x52'),_0xbe251e[_0x9967c5][_0x078e('0x17')],_0xbe251e[_0x9967c5][_0x078e('0x4c')]);}else if(manager['exists'](_0x9967c5)){manager[_0x078e('0x45')](_0x9967c5);manager[_0x078e('0x46')](_0x9967c5);logger[_0x078e('0x2a')](_0x078e('0x53'),_0xbe251e[_0x9967c5][_0x078e('0x17')],_0xbe251e[_0x9967c5][_0x078e('0x4c')]);}}for(_0x419ff5=0x0,_0x9967c5;_0x419ff5<_0x320566[_0x078e('0x43')]&&!_0xfe4459;_0x419ff5+=0x1){_0x9967c5=_0x320566[_0x419ff5]['toString']();if(manager[_0x078e('0x44')](_0x9967c5)){if(_0xbe251e[_0x9967c5][_0x078e('0x4c')]&&_0xbe251e[_0x9967c5][_0x078e('0x4d')]&&moment()['isBetween'](_0xbe251e[_0x9967c5]['startAt'],_0xbe251e[_0x9967c5][_0x078e('0x50')])){manager[_0x078e('0x54')](_0x9967c5,_0xbe251e[_0x9967c5][_0x078e('0x4c')],handleJob(_0xbe251e[_0x9967c5]));logger[_0x078e('0x2a')](_0x078e('0x55'),_0xbe251e[_0x9967c5][_0x078e('0x17')],_0xbe251e[_0x9967c5][_0x078e('0x4c')]);}else{manager['stop'](_0x9967c5);manager[_0x078e('0x46')](_0x9967c5);logger['info'](_0x078e('0x53'),_0xbe251e[_0x9967c5][_0x078e('0x17')],_0xbe251e[_0x9967c5][_0x078e('0x4c')]);}}}})[_0x078e('0x31')](function(_0x3edef1){logger[_0x078e('0x2e')](JSON['stringify'](_0x3edef1));});}exports[_0x078e('0x56')]=function(_0x402c83){return getJobs(_0x402c83);};exports[_0x078e('0x57')]=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 3a9af7a..deebd24 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 _0x81a5=['transcribe','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results','transcripts','fileText','length','tempSentiment','Sequelize','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','update','Sentiment','SentimentScore','Negative','Mixed','FAILED','FailureReason','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','sentiment','CloudProvider','Positive','Neutral','COMPLETED','catch','SequelizeValidationError','error','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','all','name','start','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb'];(function(_0x5f0bdc,_0xd0eb55){var _0x4c003e=function(_0x2d2dfd){while(--_0x2d2dfd){_0x5f0bdc['push'](_0x5f0bdc['shift']());}};_0x4c003e(++_0xd0eb55);}(_0x81a5,0x1c8));var _0x581a=function(_0x1c36d4,_0x19be9a){_0x1c36d4=_0x1c36d4-0x0;var _0x1a6dd5=_0x81a5[_0x1c36d4];return _0x1a6dd5;};var _=require(_0x581a('0x0'));var AWS=require(_0x581a('0x1'));var rp=require(_0x581a('0x2'));var util=require(_0x581a('0x3'));var BPromise=require(_0x581a('0x4'));var db=require(_0x581a('0x5'))['db'];var logger=require('../../config/logger')(_0x581a('0x6'));function getTranscriptionJob(_0x5125ac,_0x4f5f9a,_0x51d349,_0x4b491c){return new Promise(function(_0x21fea7,_0x56065e){var _0xdcb7c0=new AWS[(_0x581a('0x7'))]({'accessKeyId':_0x4f5f9a,'secretAccessKey':_0x5125ac,'region':_0x51d349});_0xdcb7c0[_0x581a('0x8')]({'TranscriptionJobName':_0x4b491c},function(_0x18dec1,_0x23ba13){if(_0x18dec1){return _0x56065e(_0x18dec1);}else{return _0x21fea7(_0x23ba13);}});});}function sentiment(_0x2356d3,_0x3fe553,_0x31b3ac,_0x524948,_0x1c9869){return new Promise(function(_0x493493,_0x1541f1){var _0x8e2264=new AWS[(_0x581a('0x9'))]({'accessKeyId':_0x3fe553,'secretAccessKey':_0x2356d3,'region':_0x31b3ac});_0x8e2264[_0x581a('0xa')]({'Text':_0x524948,'LanguageCode':_0x1c9869['substring'](0x0,0x2)},function(_0x4f4f5f,_0x58ebc0){if(_0x4f4f5f){return _0x1541f1(_0x4f4f5f);}else{return _0x493493(_0x58ebc0);}});});}function checkTranscribeJob(_0x5b1378,_0x5dac2a,_0x48a2e3){var _0x96c299;return new BPromise(function(_0x270eef,_0x4f3ce4){logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0xd'),_0x5b1378['id'],_0x5b1378[_0x581a('0xe')]));return getTranscriptionJob(_0x48a2e3[_0x581a('0xf')],_0x48a2e3[_0x581a('0x10')],_0x5dac2a[_0x581a('0x11')],_0x5b1378[_0x581a('0xe')])['then'](function(_0x11f50b){logger[_0x581a('0xb')](util['format'](_0x581a('0x12'),_0x5b1378['id'],_0x5b1378[_0x581a('0xe')],_0x11f50b[_0x581a('0x13')][_0x581a('0x14')]));if(!_0x5b1378['fileText']){switch(_0x11f50b[_0x581a('0x13')][_0x581a('0x14')]){case'COMPLETED':var _0x4bdc1a={'transcribeStatus':_0x11f50b[_0x581a('0x13')][_0x581a('0x14')],'fileUri':_0x11f50b[_0x581a('0x13')][_0x581a('0x15')][_0x581a('0x16')]};logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x17'),_0x5b1378['id']));return rp({'uri':_0x11f50b['TranscriptionJob'][_0x581a('0x15')][_0x581a('0x16')],'json':!![]})[_0x581a('0x18')](function(_0x4f619d){logger['info'](util[_0x581a('0xc')](_0x581a('0x19'),_0x5b1378['id']));if(_0x4f619d&&_0x4f619d[_0x581a('0x1a')]&&_0x4f619d[_0x581a('0x1a')]['transcripts']&&_0x4f619d[_0x581a('0x1a')][_0x581a('0x1b')]['length']){_0x4bdc1a[_0x581a('0x1c')]='';for(var _0x3ce207=0x0;_0x3ce207<_0x4f619d[_0x581a('0x1a')][_0x581a('0x1b')][_0x581a('0x1d')];_0x3ce207++){_0x4bdc1a['fileText']+=_0x4f619d['results'][_0x581a('0x1b')][_0x3ce207]['transcript']+'';}}return _0x5b1378['update'](_0x4bdc1a);})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b1378['id']));if(!_0x5b1378[_0x581a('0x1e')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x21'));}if(!_0x5dac2a['sentiment']||!_0x5dac2a[_0x581a('0x22')]||!_0x5dac2a[_0x581a('0x23')]||!_0x5dac2a[_0x581a('0x24')]||!_0x5dac2a[_0x581a('0x25')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x26'));}if(!_0x4bdc1a[_0x581a('0x1c')]){throw new Error(_0x581a('0x27'));}if(_0x5dac2a[_0x581a('0x22')]===_0x48a2e3['id']){return _0x48a2e3;}else{return db['CloudProvider'][_0x581a('0x28')]({'where':{'id':_settings[_0x581a('0x22')]}});}})['then'](function(_0x3d9f4a){if(!_0x3d9f4a){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x29'));}if(!_0x3d9f4a[_0x581a('0xf')]||!_0x3d9f4a[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x2a'));}_0x96c299=_0x3d9f4a;logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x2b'),_0x5b1378['id']));return sentiment(_0x96c299[_0x581a('0xf')],_0x96c299['data2'],_0x5dac2a['sentimentRegion'],_0x4bdc1a['fileText'],_0x5dac2a[_0x581a('0x24')]);})[_0x581a('0x18')](function(_0xfbfb4f){logger['info'](util['format'](_0x581a('0x2c'),_0x5b1378['id']));return _0x5b1378[_0x581a('0x2d')]({'sentiment':_0xfbfb4f[_0x581a('0x2e')],'sPositive':_0xfbfb4f[_0x581a('0x2f')]['Positive'],'sNegative':_0xfbfb4f[_0x581a('0x2f')][_0x581a('0x30')],'sMixed':_0xfbfb4f['SentimentScore'][_0x581a('0x31')],'sNeutral':_0xfbfb4f[_0x581a('0x2f')]['Neutral']});})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x5b1378['id']));_0x270eef();});case _0x581a('0x32'):return _0x5b1378[_0x581a('0x2d')]({'transcribeStatus':_0x581a('0x32'),'failureReason':_0x11f50b[_0x581a('0x13')][_0x581a('0x33')]})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x34'),_0x5b1378['id']));_0x270eef();});default:logger[_0x581a('0xb')](util['format'](_0x581a('0x35'),_0x5b1378['id']));break;}}else{return BPromise[_0x581a('0x36')]()[_0x581a('0x18')](function(){if(!_0x5b1378[_0x581a('0x1e')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x21'));}if(!_0x5dac2a[_0x581a('0x37')]||!_0x5dac2a[_0x581a('0x22')]||!_0x5dac2a['sentimentRegion']||!_0x5dac2a[_0x581a('0x24')]||!_0x5dac2a[_0x581a('0x25')]){throw new db[(_0x581a('0x1f'))]['ValidationError']('Sentiment\x20Analysis\x20not\x20configured');}if(!_0x5b1378['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x5dac2a[_0x581a('0x22')]===_0x48a2e3['id']){return _0x48a2e3;}else{return db[_0x581a('0x38')][_0x581a('0x28')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x581a('0x18')](function(_0x54ef6f){if(!_0x54ef6f){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))]('Cloud\x20Provider\x20not\x20available');}if(!_0x54ef6f['data1']||!_0x54ef6f[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x2a'));}_0x96c299=_0x54ef6f;logger[_0x581a('0xb')](util[_0x581a('0xc')](_0x581a('0x2b'),_0x5b1378['id']));return sentiment(_0x96c299[_0x581a('0xf')],_0x96c299[_0x581a('0x10')],_0x5dac2a[_0x581a('0x23')],_0x5b1378[_0x581a('0x1c')],_0x5dac2a[_0x581a('0x24')]);})[_0x581a('0x18')](function(_0x2a6e5f){logger[_0x581a('0xb')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x5b1378['id']));return _0x5b1378[_0x581a('0x2d')]({'sentiment':_0x2a6e5f[_0x581a('0x2e')],'sPositive':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x39')],'sNegative':_0x2a6e5f[_0x581a('0x2f')]['Negative'],'sMixed':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x31')],'sNeutral':_0x2a6e5f[_0x581a('0x2f')][_0x581a('0x3a')],'transcribeStatus':_0x581a('0x3b')});})[_0x581a('0x18')](function(){logger[_0x581a('0xb')](util['format'](_0x581a('0x34'),_0x5b1378['id']));_0x270eef();});}})[_0x581a('0x3c')](function(_0x58bce3){if(_0x58bce3){if(!_0x58bce3['name']||_0x58bce3['name']!==_0x581a('0x3d')){logger[_0x581a('0x3e')](util[_0x581a('0xc')]('[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis',_0x5b1378['id']),util[_0x581a('0x3f')](_0x58bce3,{'showHidden':![],'depth':null}));}}_0x270eef();});});}function checkTranscribe(){var _0x35990b;var _0x462107;var _0x3b80ca;return db[_0x581a('0x40')][_0x581a('0x41')]({'where':{'transcribeStatus':_0x581a('0x42')}})[_0x581a('0x18')](function(_0x20b420){if(!_0x20b420||!_0x20b420[_0x581a('0x1d')]){throw new db[(_0x581a('0x1f'))]['ValidationError'](_0x581a('0x43'));}_0x35990b=_0x20b420;return db[_0x581a('0x44')]['findOne']({'where':{'id':0x1}});})[_0x581a('0x18')](function(_0x181818){if(!_0x181818){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x45'));}_0x462107=_0x181818;if(!_0x462107['transcribe']||!_0x462107[_0x581a('0x46')]||!_0x462107[_0x581a('0x11')]||!_0x462107['language']||!_0x462107[_0x581a('0x25')]){throw new db['Sequelize'][(_0x581a('0x20'))](_0x581a('0x47'));}return db[_0x581a('0x38')][_0x581a('0x28')]({'where':{'id':_0x462107['transcribeAccountId']}});})[_0x581a('0x18')](function(_0xca8463){if(!_0xca8463){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x29'));}if(!_0xca8463[_0x581a('0xf')]||!_0xca8463[_0x581a('0x10')]){throw new db[(_0x581a('0x1f'))][(_0x581a('0x20'))](_0x581a('0x2a'));}_0x3b80ca=_0xca8463;var _0x46139c=[];_0x35990b[_0x581a('0x48')](function(_0x4e5995){_0x46139c[_0x581a('0x49')](checkTranscribeJob(_0x4e5995,_0x462107,_0x3b80ca));});return BPromise[_0x581a('0x4a')](_0x46139c);})[_0x581a('0x3c')](function(_0x226450){if(_0x226450){if(!_0x226450[_0x581a('0x4b')]||_0x226450[_0x581a('0x4b')]!==_0x581a('0x3d')){logger[_0x581a('0x3e')](util[_0x581a('0x3f')](_0x226450,{'showHidden':![],'depth':null}));}}});}exports[_0x581a('0x4c')]=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x78e2=['transcripts','length','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','sentimentRegion','language','bucket','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','Sequelize','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Negative','Mixed','FAILED','FailureReason','resolve','findOne','Positive','Neutral','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting','Settings\x20not\x20available','transcribe','Transcribe\x20not\x20configured','forEach','push','all','start','lodash','aws-sdk','request-promise','util','bluebird','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','transcribeRegion','info','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','fileText','COMPLETED','Transcript','TranscriptFileUri','[RECORDING:%d]\x20Get\x20transcript','then','[RECORDING:%d]\x20Transcript\x20downloaded','results'];(function(_0xb3af86,_0x50881c){var _0x2365c1=function(_0x27fefc){while(--_0x27fefc){_0xb3af86['push'](_0xb3af86['shift']());}};_0x2365c1(++_0x50881c);}(_0x78e2,0x1a8));var _0x278e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x78e2[_0x3dd15e];return _0x231fd0;};var _=require(_0x278e('0x0'));var AWS=require(_0x278e('0x1'));var rp=require(_0x278e('0x2'));var util=require(_0x278e('0x3'));var BPromise=require(_0x278e('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x278e('0x5'))('transcribe');function getTranscriptionJob(_0x459a21,_0xaba666,_0x2fb0e0,_0x45e83d){return new Promise(function(_0x221b65,_0xc1a9b8){var _0x474b97=new AWS[(_0x278e('0x6'))]({'accessKeyId':_0xaba666,'secretAccessKey':_0x459a21,'region':_0x2fb0e0});_0x474b97[_0x278e('0x7')]({'TranscriptionJobName':_0x45e83d},function(_0x7b6bd8,_0x73f5b5){if(_0x7b6bd8){return _0xc1a9b8(_0x7b6bd8);}else{return _0x221b65(_0x73f5b5);}});});}function sentiment(_0x3c3915,_0x36ad6b,_0xc6d28b,_0xc94496,_0x58e635){return new Promise(function(_0x2096b2,_0x435de3){var _0x1e41e7=new AWS[(_0x278e('0x8'))]({'accessKeyId':_0x36ad6b,'secretAccessKey':_0x3c3915,'region':_0xc6d28b});_0x1e41e7[_0x278e('0x9')]({'Text':_0xc94496,'LanguageCode':_0x58e635[_0x278e('0xa')](0x0,0x2)},function(_0x144509,_0x4a4113){if(_0x144509){return _0x435de3(_0x144509);}else{return _0x2096b2(_0x4a4113);}});});}function checkTranscribeJob(_0x310271,_0x3f2a66,_0x4fe711){var _0x2bfe2b;return new BPromise(function(_0x5e6fff,_0x14ef63){logger['info'](util[_0x278e('0xb')](_0x278e('0xc'),_0x310271['id'],_0x310271[_0x278e('0xd')]));return getTranscriptionJob(_0x4fe711['data1'],_0x4fe711['data2'],_0x3f2a66[_0x278e('0xe')],_0x310271[_0x278e('0xd')])['then'](function(_0x1b6300){logger[_0x278e('0xf')](util['format'](_0x278e('0x10'),_0x310271['id'],_0x310271[_0x278e('0xd')],_0x1b6300[_0x278e('0x11')]['TranscriptionJobStatus']));if(!_0x310271[_0x278e('0x12')]){switch(_0x1b6300[_0x278e('0x11')]['TranscriptionJobStatus']){case _0x278e('0x13'):var _0x29b215={'transcribeStatus':_0x1b6300[_0x278e('0x11')]['TranscriptionJobStatus'],'fileUri':_0x1b6300[_0x278e('0x11')][_0x278e('0x14')][_0x278e('0x15')]};logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x16'),_0x310271['id']));return rp({'uri':_0x1b6300[_0x278e('0x11')]['Transcript'][_0x278e('0x15')],'json':!![]})[_0x278e('0x17')](function(_0x2f4e73){logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x18'),_0x310271['id']));if(_0x2f4e73&&_0x2f4e73[_0x278e('0x19')]&&_0x2f4e73[_0x278e('0x19')][_0x278e('0x1a')]&&_0x2f4e73[_0x278e('0x19')][_0x278e('0x1a')][_0x278e('0x1b')]){_0x29b215['fileText']='';for(var _0x57054f=0x0;_0x57054f<_0x2f4e73['results'][_0x278e('0x1a')]['length'];_0x57054f++){_0x29b215[_0x278e('0x12')]+=_0x2f4e73[_0x278e('0x19')][_0x278e('0x1a')][_0x57054f][_0x278e('0x1c')]+'';}}return _0x310271[_0x278e('0x1d')](_0x29b215);})['then'](function(){logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x1e'),_0x310271['id']));if(!_0x310271[_0x278e('0x1f')]){throw new db['Sequelize'][(_0x278e('0x20'))](_0x278e('0x21'));}if(!_0x3f2a66[_0x278e('0x22')]||!_0x3f2a66[_0x278e('0x23')]||!_0x3f2a66[_0x278e('0x24')]||!_0x3f2a66[_0x278e('0x25')]||!_0x3f2a66[_0x278e('0x26')]){throw new db['Sequelize'][(_0x278e('0x20'))](_0x278e('0x27'));}if(!_0x29b215[_0x278e('0x12')]){throw new Error(_0x278e('0x28'));}if(_0x3f2a66['sentimentAccountId']===_0x4fe711['id']){return _0x4fe711;}else{return db['CloudProvider']['findOne']({'where':{'id':_settings['sentimentAccountId']}});}})[_0x278e('0x17')](function(_0x5bf0b4){if(!_0x5bf0b4){throw new db[(_0x278e('0x29'))]['ValidationError'](_0x278e('0x2a'));}if(!_0x5bf0b4[_0x278e('0x2b')]||!_0x5bf0b4[_0x278e('0x2c')]){throw new db[(_0x278e('0x29'))]['ValidationError'](_0x278e('0x2d'));}_0x2bfe2b=_0x5bf0b4;logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x2e'),_0x310271['id']));return sentiment(_0x2bfe2b['data1'],_0x2bfe2b[_0x278e('0x2c')],_0x3f2a66[_0x278e('0x24')],_0x29b215[_0x278e('0x12')],_0x3f2a66['language']);})['then'](function(_0x4f4c69){logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x2f'),_0x310271['id']));return _0x310271[_0x278e('0x1d')]({'sentiment':_0x4f4c69['Sentiment'],'sPositive':_0x4f4c69[_0x278e('0x30')]['Positive'],'sNegative':_0x4f4c69[_0x278e('0x30')][_0x278e('0x31')],'sMixed':_0x4f4c69[_0x278e('0x30')][_0x278e('0x32')],'sNeutral':_0x4f4c69[_0x278e('0x30')]['Neutral']});})[_0x278e('0x17')](function(){logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x1e'),_0x310271['id']));_0x5e6fff();});case _0x278e('0x33'):return _0x310271['update']({'transcribeStatus':_0x278e('0x33'),'failureReason':_0x1b6300[_0x278e('0x11')][_0x278e('0x34')]})[_0x278e('0x17')](function(){logger[_0x278e('0xf')](util['format'](_0x278e('0x1e'),_0x310271['id']));_0x5e6fff();});default:logger[_0x278e('0xf')](util[_0x278e('0xb')]('[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed',_0x310271['id']));break;}}else{return BPromise[_0x278e('0x35')]()['then'](function(){if(!_0x310271['tempSentiment']){throw new db[(_0x278e('0x29'))]['ValidationError'](_0x278e('0x21'));}if(!_0x3f2a66[_0x278e('0x22')]||!_0x3f2a66[_0x278e('0x23')]||!_0x3f2a66['sentimentRegion']||!_0x3f2a66[_0x278e('0x25')]||!_0x3f2a66[_0x278e('0x26')]){throw new db[(_0x278e('0x29'))][(_0x278e('0x20'))](_0x278e('0x27'));}if(!_0x310271['fileText']){throw new Error('Transcript\x20not\x20available');}if(_0x3f2a66[_0x278e('0x23')]===_0x4fe711['id']){return _0x4fe711;}else{return db['CloudProvider'][_0x278e('0x36')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x278e('0x17')](function(_0x1a001e){if(!_0x1a001e){throw new db['Sequelize'][(_0x278e('0x20'))](_0x278e('0x2a'));}if(!_0x1a001e[_0x278e('0x2b')]||!_0x1a001e[_0x278e('0x2c')]){throw new db[(_0x278e('0x29'))][(_0x278e('0x20'))](_0x278e('0x2d'));}_0x2bfe2b=_0x1a001e;logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x2e'),_0x310271['id']));return sentiment(_0x2bfe2b[_0x278e('0x2b')],_0x2bfe2b[_0x278e('0x2c')],_0x3f2a66[_0x278e('0x24')],_0x310271[_0x278e('0x12')],_0x3f2a66[_0x278e('0x25')]);})[_0x278e('0x17')](function(_0x10b593){logger[_0x278e('0xf')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x310271['id']));return _0x310271[_0x278e('0x1d')]({'sentiment':_0x10b593['Sentiment'],'sPositive':_0x10b593[_0x278e('0x30')][_0x278e('0x37')],'sNegative':_0x10b593[_0x278e('0x30')][_0x278e('0x31')],'sMixed':_0x10b593[_0x278e('0x30')][_0x278e('0x32')],'sNeutral':_0x10b593[_0x278e('0x30')][_0x278e('0x38')],'transcribeStatus':_0x278e('0x13')});})[_0x278e('0x17')](function(){logger[_0x278e('0xf')](util[_0x278e('0xb')](_0x278e('0x1e'),_0x310271['id']));_0x5e6fff();});}})[_0x278e('0x39')](function(_0x457a4f){if(_0x457a4f){if(!_0x457a4f['name']||_0x457a4f[_0x278e('0x3a')]!==_0x278e('0x3b')){logger[_0x278e('0x3c')](util[_0x278e('0xb')](_0x278e('0x3d'),_0x310271['id']),util[_0x278e('0x3e')](_0x457a4f,{'showHidden':![],'depth':null}));}}_0x5e6fff();});});}function checkTranscribe(){var _0x3161f3;var _0xc53933;var _0x12411f;return db[_0x278e('0x3f')][_0x278e('0x40')]({'where':{'transcribeStatus':_0x278e('0x41')}})[_0x278e('0x17')](function(_0x3372c2){if(!_0x3372c2||!_0x3372c2[_0x278e('0x1b')]){throw new db['Sequelize'][(_0x278e('0x20'))](_0x278e('0x42'));}_0x3161f3=_0x3372c2;return db[_0x278e('0x43')]['findOne']({'where':{'id':0x1}});})[_0x278e('0x17')](function(_0xd5a35b){if(!_0xd5a35b){throw new db[(_0x278e('0x29'))]['ValidationError'](_0x278e('0x44'));}_0xc53933=_0xd5a35b;if(!_0xc53933[_0x278e('0x45')]||!_0xc53933['transcribeAccountId']||!_0xc53933[_0x278e('0xe')]||!_0xc53933['language']||!_0xc53933[_0x278e('0x26')]){throw new db[(_0x278e('0x29'))]['ValidationError'](_0x278e('0x46'));}return db['CloudProvider'][_0x278e('0x36')]({'where':{'id':_0xc53933['transcribeAccountId']}});})[_0x278e('0x17')](function(_0x115d7a){if(!_0x115d7a){throw new db['Sequelize']['ValidationError'](_0x278e('0x2a'));}if(!_0x115d7a[_0x278e('0x2b')]||!_0x115d7a[_0x278e('0x2c')]){throw new db[(_0x278e('0x29'))][(_0x278e('0x20'))](_0x278e('0x2d'));}_0x12411f=_0x115d7a;var _0x9dbc55=[];_0x3161f3[_0x278e('0x47')](function(_0x4ffb78){_0x9dbc55[_0x278e('0x48')](checkTranscribeJob(_0x4ffb78,_0xc53933,_0x12411f));});return BPromise[_0x278e('0x49')](_0x9dbc55);})['catch'](function(_0xa5959d){if(_0xa5959d){if(!_0xa5959d[_0x278e('0x3a')]||_0xa5959d[_0x278e('0x3a')]!=='SequelizeValidationError'){logger['error'](util[_0x278e('0x3e')](_0xa5959d,{'showHidden':![],'depth':null}));}}});}exports[_0x278e('0x4a')]=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 9c61c49..d6d5705 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 _0x1149=['join','update','timeout','format','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../logger','redis','defaults','localhost','socket.io-emitter','findAll','lastMsgAt','hours','then','length','info','[WHATSAPP]\x20Interactions\x20to\x20close:'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1149,0x19f));var _0x9114=function(_0x3a136b,_0x2080d7){_0x3a136b=_0x3a136b-0x0;var _0x4fdf25=_0x1149[_0x3a136b];return _0x4fdf25;};'use strict';var _=require(_0x9114('0x0'));var moment=require(_0x9114('0x1'));var Redis=require(_0x9114('0x2'));var util=require(_0x9114('0x3'));var config=require(_0x9114('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x9114('0x5'))('schedule');config[_0x9114('0x6')]=_[_0x9114('0x7')](config[_0x9114('0x6')],{'host':_0x9114('0x8'),'port':0x18eb});var io=require(_0x9114('0x9'))(new Redis(config['redis']));function closeInteractions(){var _0x23d9cd=[];return db['WhatsappInteraction'][_0x9114('0xa')]({'raw':!![],'attributes':['id',_0x9114('0xb')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0x9114('0xc'))}}})[_0x9114('0xd')](function(_0x4deba1){if(_0x4deba1&&_0x4deba1[_0x9114('0xe')]){_0x23d9cd=_['map'](_0x4deba1||[],'id');logger[_0x9114('0xf')](_0x9114('0x10'),_0x23d9cd[_0x9114('0x11')]());return db['WhatsappInteraction'][_0x9114('0x12')]({'closeReason':'system','disposition':_0x9114('0x13'),'closed':!![],'closedAt':moment()[_0x9114('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_0x23d9cd}});}})['then'](function(){if(_0x23d9cd&&_0x23d9cd[_0x9114('0xe')]){logger[_0x9114('0xf')](_0x9114('0x15'),_0x23d9cd['join']());for(var _0x3f34d6=0x0;_0x3f34d6<_0x23d9cd[_0x9114('0xe')];_0x3f34d6++){io[_0x9114('0x16')](_0x9114('0x17'),{'id':_0x23d9cd[_0x3f34d6],'closed':!![]});}}})[_0x9114('0x18')](function(_0x5ff6fb){logger[_0x9114('0x19')](_0x9114('0x1a'),_0x5ff6fb?util['inspect'](_0x5ff6fb,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x873e=['findAll','lastMsgAt','hours','then','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','inspect','start','lodash','moment','ioredis','util','../../config/environment','defaults','redis','socket.io-emitter','WhatsappInteraction'];(function(_0x484ae9,_0xfd20b1){var _0x1b3506=function(_0x52567e){while(--_0x52567e){_0x484ae9['push'](_0x484ae9['shift']());}};_0x1b3506(++_0xfd20b1);}(_0x873e,0x141));var _0xe873=function(_0x3d6266,_0x449ff1){_0x3d6266=_0x3d6266-0x0;var _0x114720=_0x873e[_0x3d6266];return _0x114720;};'use strict';var _=require(_0xe873('0x0'));var moment=require(_0xe873('0x1'));var Redis=require(_0xe873('0x2'));var util=require(_0xe873('0x3'));var config=require(_0xe873('0x4'));var db=require('../../mysqldb')['db'];var logger=require('../logger')('schedule');config['redis']=_[_0xe873('0x5')](config[_0xe873('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe873('0x7'))(new Redis(config[_0xe873('0x6')]));function closeInteractions(){var _0x4e82f9=[];return db[_0xe873('0x8')][_0xe873('0x9')]({'raw':!![],'attributes':['id',_0xe873('0xa')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()['subtract'](0x18,_0xe873('0xb'))}}})[_0xe873('0xc')](function(_0x1d2141){if(_0x1d2141&&_0x1d2141['length']){_0x4e82f9=_[_0xe873('0xd')](_0x1d2141||[],'id');logger[_0xe873('0xe')](_0xe873('0xf'),_0x4e82f9[_0xe873('0x10')]());return db[_0xe873('0x8')][_0xe873('0x11')]({'closeReason':_0xe873('0x12'),'disposition':_0xe873('0x13'),'closed':!![],'closedAt':moment()[_0xe873('0x14')](_0xe873('0x15'))},{'where':{'id':_0x4e82f9}});}})[_0xe873('0xc')](function(){if(_0x4e82f9&&_0x4e82f9[_0xe873('0x16')]){logger[_0xe873('0xe')](_0xe873('0x17'),_0x4e82f9['join']());for(var _0x10b188=0x0;_0x10b188<_0x4e82f9[_0xe873('0x16')];_0x10b188++){io[_0xe873('0x18')](_0xe873('0x19'),{'id':_0x4e82f9[_0x10b188],'closed':!![]});}}})[_0xe873('0x1a')](function(_0x4170bc){logger['error'](_0xe873('0x1b'),_0x4170bc?util[_0xe873('0x1c')](_0x4170bc,{'showHidden':![],'depth':null}):'');});}exports[_0xe873('0x1d')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 17790af..0dc3436 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2caa=['innocenzo.biondo','@xcally.com','now','CmContact','then','bulkCreate','log','contacts1','CmHopper','destroy','hopper1','finished\x20populating','util','../mysqldb','push','Innocenzo','Biondo'];(function(_0x525d78,_0x14175d){var _0x4c203d=function(_0x45d4f4){while(--_0x45d4f4){_0x525d78['push'](_0x525d78['shift']());}};_0x4c203d(++_0x14175d);}(_0x2caa,0xa5));var _0xa2ca=function(_0x1cd47d,_0x55bc75){_0x1cd47d=_0x1cd47d-0x0;var _0x29d52f=_0x2caa[_0x1cd47d];return _0x29d52f;};'use strict';var util=require(_0xa2ca('0x0'));var db=require(_0xa2ca('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xa2ca('0x2')]({'id':i,'firstName':_0xa2ca('0x3')+i,'lastName':_0xa2ca('0x4')+i,'phone':0xf879fb460+i,'email':_0xa2ca('0x5')+i+_0xa2ca('0x6')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xa2ca('0x2')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa2ca('0x7')](),'updatedAt':Date[_0xa2ca('0x7')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xa2ca('0x2')]({'id':i,'firstName':_0xa2ca('0x3')+i,'lastName':_0xa2ca('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xa2ca('0x6')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xa2ca('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xa2ca('0x7')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xa2ca('0x7')](),'updatedAt':Date['now']()});}db[_0xa2ca('0x8')]['destroy']({'where':{}})[_0xa2ca('0x9')](function(){return db[_0xa2ca('0x8')][_0xa2ca('0xa')](contacts);})[_0xa2ca('0x9')](function(){console[_0xa2ca('0xb')]('finished\x20populating',_0xa2ca('0xc'));return db[_0xa2ca('0xd')][_0xa2ca('0xe')]({'where':{}});})[_0xa2ca('0x9')](function(){return db[_0xa2ca('0xd')]['bulkCreate'](hopper);})['then'](function(){console[_0xa2ca('0xb')]('finished\x20populating',_0xa2ca('0xf'));return db[_0xa2ca('0x8')][_0xa2ca('0xa')](contacts2);})[_0xa2ca('0x9')](function(){console[_0xa2ca('0xb')](_0xa2ca('0x10'),'contacts2');return db[_0xa2ca('0xd')][_0xa2ca('0xa')](hopper2);})[_0xa2ca('0x9')](function(){console['log']('finished\x20populating','hopper2');})['catch'](function(_0x50bfc9){console[_0xa2ca('0xb')](_0x50bfc9);}); \ No newline at end of file +var _0x61fe=['push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper','contacts2','hopper2','util','../mysqldb'];(function(_0xebfc2c,_0x23cac0){var _0x46e08f=function(_0x158d1e){while(--_0x158d1e){_0xebfc2c['push'](_0xebfc2c['shift']());}};_0x46e08f(++_0x23cac0);}(_0x61fe,0x11f));var _0xe61f=function(_0x429fcf,_0x4f02f0){_0x429fcf=_0x429fcf-0x0;var _0x3c85b3=_0x61fe[_0x429fcf];return _0x3c85b3;};'use strict';var util=require(_0xe61f('0x0'));var db=require(_0xe61f('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xe61f('0x2')]({'id':i,'firstName':_0xe61f('0x3')+i,'lastName':_0xe61f('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xe61f('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0xe61f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe61f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe61f('0x6')](),'updatedAt':Date[_0xe61f('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xe61f('0x2')]({'id':i,'firstName':_0xe61f('0x3')+i,'lastName':_0xe61f('0x4')+i,'phone':0xf879fb460+i,'email':_0xe61f('0x7')+i+_0xe61f('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xe61f('0x2')]({'id':i,'active':![],'scheduledat':Date[_0xe61f('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xe61f('0x6')](),'updatedAt':Date['now']()});}db[_0xe61f('0x8')][_0xe61f('0x9')]({'where':{}})[_0xe61f('0xa')](function(){return db[_0xe61f('0x8')][_0xe61f('0xb')](contacts);})[_0xe61f('0xa')](function(){console[_0xe61f('0xc')](_0xe61f('0xd'),'contacts1');return db['CmHopper'][_0xe61f('0x9')]({'where':{}});})['then'](function(){return db[_0xe61f('0xe')][_0xe61f('0xb')](hopper);})[_0xe61f('0xa')](function(){console['log'](_0xe61f('0xd'),'hopper1');return db[_0xe61f('0x8')][_0xe61f('0xb')](contacts2);})['then'](function(){console[_0xe61f('0xc')](_0xe61f('0xd'),_0xe61f('0xf'));return db[_0xe61f('0xe')]['bulkCreate'](hopper2);})['then'](function(){console[_0xe61f('0xc')](_0xe61f('0xd'),_0xe61f('0x10'));})['catch'](function(_0x3547d3){console[_0xe61f('0xc')](_0x3547d3);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index bd61e5a..3cd26e3 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4abd=['friend','udp','wss','all','yes','/etc/pki/tls/certs/motion.crt','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','password'];(function(_0x1fb69b,_0x421bf7){var _0x17166f=function(_0x1aa5a1){while(--_0x1aa5a1){_0x1fb69b['push'](_0x1fb69b['shift']());}};_0x17166f(++_0x421bf7);}(_0x4abd,0x1d9));var _0xd4ab=function(_0x3fd108,_0x5d911f){_0x3fd108=_0x3fd108-0x0;var _0x4f943f=_0x4abd[_0x3fd108];return _0x4f943f;};'use strict';var util=require(_0xd4ab('0x0'));var db=require(_0xd4ab('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xd4ab('0x2')]({'name':util[_0xd4ab('0x3')](_0xd4ab('0x4'),_0xd4ab('0x5'),i),'fullname':util[_0xd4ab('0x3')]('%s%s','agent',i),'email':util[_0xd4ab('0x3')]('%s%s@xcally.com','agent',i),'role':'agent','password':_0xd4ab('0x6'),'internal':0xfa0+i,'type':_0xd4ab('0x7'),'transport':[_0xd4ab('0x8'),'ws',_0xd4ab('0x9')],'disallow':[_0xd4ab('0xa')],'allow':['ulaw'],'defaultuser':util[_0xd4ab('0x3')](_0xd4ab('0x4'),_0xd4ab('0x5'),i),'encryption':_0xd4ab('0xb'),'avpf':'yes','force_avp':'yes','icesupport':_0xd4ab('0xb'),'dtlsenable':_0xd4ab('0xb'),'dtlsverify':'no','dtlscertfile':_0xd4ab('0xc'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':'actpass','callerid':util[_0xd4ab('0x3')](_0xd4ab('0xd'),util['format'](_0xd4ab('0x4'),_0xd4ab('0x5'),i),0xfa0+i)});}db[_0xd4ab('0xe')][_0xd4ab('0xf')](users)[_0xd4ab('0x10')](function(){console[_0xd4ab('0x11')](_0xd4ab('0x12'));})[_0xd4ab('0x13')](function(_0x4f23a1){console['log'](_0x4f23a1);}); \ No newline at end of file +var _0x94f3=['format','%s%s','agent','password','friend','udp','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','add\x20user','catch','../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x94f3,0xc5));var _0x394f=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x94f3[_0x122ef9];return _0x42fba0;};'use strict';var util=require('util');var db=require(_0x394f('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x394f('0x1')](_0x394f('0x2'),_0x394f('0x3'),i),'fullname':util[_0x394f('0x1')]('%s%s',_0x394f('0x3'),i),'email':util[_0x394f('0x1')]('%s%s@xcally.com',_0x394f('0x3'),i),'role':_0x394f('0x3'),'password':_0x394f('0x4'),'internal':0xfa0+i,'type':_0x394f('0x5'),'transport':[_0x394f('0x6'),'ws',_0x394f('0x7')],'disallow':[_0x394f('0x8')],'allow':[_0x394f('0x9')],'defaultuser':util['format'](_0x394f('0x2'),_0x394f('0x3'),i),'encryption':_0x394f('0xa'),'avpf':'yes','force_avp':_0x394f('0xa'),'icesupport':_0x394f('0xa'),'dtlsenable':_0x394f('0xa'),'dtlsverify':'no','dtlscertfile':_0x394f('0xb'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0x394f('0xc'),'callerid':util[_0x394f('0x1')](_0x394f('0xd'),util[_0x394f('0x1')]('%s%s',_0x394f('0x3'),i),0xfa0+i)});}db[_0x394f('0xe')][_0x394f('0xf')](users)['then'](function(){console['log'](_0x394f('0x10'));})[_0x394f('0x11')](function(_0x1c2238){console['log'](_0x1c2238);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index d7cac9f..ef8950c 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe585=['userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','Campaign','VoiceQueues','ChatQueues','SmsQueues','SmsQueue','MailQueue','WhatsappQueue','Trunk','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','chat','fax','openchannel','telephone:%s','campaign:%s:%s','leave','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','join','default','connection','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','nsp','DISCONNECTED','lodash','bluebird','./environment','name','Agents','User','role','agent','telephone','ivr','findOne','then','autoAssociation','FaxQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','map','where','format','%s:queue:%s','length','user:%s','query','find'];(function(_0x1c3698,_0x832d76){var _0x174161=function(_0x3832b5){while(--_0x3832b5){_0x1c3698['push'](_0x1c3698['shift']());}};_0x174161(++_0x832d76);}(_0xe585,0x9a));var _0x5e58=function(_0x22b252,_0x1bf455){_0x22b252=_0x22b252-0x0;var _0x5d9150=_0xe585[_0x22b252];return _0x5d9150;};'use strict';var _=require(_0x5e58('0x0'));var util=require('util');var BPromise=require(_0x5e58('0x1'));var db=require('../mysqldb')['db'];var config=require(_0x5e58('0x2'));var queryQueues={'attributes':['id',_0x5e58('0x3')],'include':[{'as':_0x5e58('0x4'),'model':db[_0x5e58('0x5')],'attributes':['id',_0x5e58('0x3'),_0x5e58('0x6')],'raw':!![],'where':{'role':_0x5e58('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x5e58('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0x5e58('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x5e58('0x3')],'where':{'role':_0x5e58('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x5e58('0x3'),'type'],'where':{'type':_0x5e58('0x9')}};function getAssociatedResources(_0x114f20,_0x367530,_0x57cf49){return db['UserProfileSection'][_0x5e58('0xa')]({'where':{'name':_0x114f20,'userProfileId':_0x367530},'raw':!![]})[_0x5e58('0xb')](function(_0x9bb524){if(_0x9bb524){if(_0x9bb524[_0x5e58('0xc')]){switch(_0x114f20){case'VoiceQueues':case'ChatQueues':case _0x5e58('0xd'):case'SmsQueues':case _0x5e58('0xe'):case _0x5e58('0xf'):case _0x5e58('0x10'):return db[_0x57cf49][_0x5e58('0x11')](queryQueues);case _0x5e58('0x12'):return db[_0x57cf49][_0x5e58('0x11')](queryTelephones);case _0x5e58('0x13'):return db[_0x57cf49]['findAll'](queryTrunks);case _0x5e58('0x14'):return db[_0x57cf49][_0x5e58('0x11')](queryCampaigns);}}else{return db[_0x5e58('0x15')][_0x5e58('0x11')]({'attributes':['resourceId'],'where':{'sectionId':_0x9bb524['id']},'raw':!![]})[_0x5e58('0xb')](function(_0x471cb6){if(_0x471cb6){var _0x4f40b2={'where':{'id':_[_0x5e58('0x16')](_0x471cb6,'resourceId')},'raw':!![]};switch(_0x57cf49){case _0x5e58('0x5'):_0x4f40b2[_0x5e58('0x17')]['role']=_0x5e58('0x8');break;case'Campaign':_0x4f40b2[_0x5e58('0x17')]['type']=_0x5e58('0x9');break;}return db[_0x57cf49]['findAll'](_0x4f40b2);}else{return[];}});}}else{return[];}})[_0x5e58('0xb')](function(_0x5d1eab){return _0x5d1eab;});}function joinOrLeaveQueues(_0x366bf4,_0x589ca6,_0x2c3dd0,_0x1c5e59){_0x366bf4[_0x589ca6](util[_0x5e58('0x18')](_0x5e58('0x19'),_0x2c3dd0,_0x1c5e59['name']));if(_0x1c5e59[_0x5e58('0x4')]){for(var _0x9aad8c=0x0;_0x9aad8c<_0x1c5e59['Agents'][_0x5e58('0x1a')];_0x9aad8c+=0x1){_0x366bf4[_0x589ca6](util[_0x5e58('0x18')](_0x5e58('0x1b'),_0x1c5e59['Agents'][_0x9aad8c][_0x5e58('0x3')]));}}}function joinOrLeave(_0x19ec2b,_0x5485e2,_0xffa827){var _0x378e8d;if(_0x19ec2b['handshake'][_0x5e58('0x1c')]['id']){db['User'][_0x5e58('0x1d')]({'attributes':['id',_0x5e58('0x3'),_0x5e58('0x6'),_0x5e58('0x1e')],'where':{'id':_0x19ec2b['handshake'][_0x5e58('0x1c')]['id']},'include':[{'model':db[_0x5e58('0x1f')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x5e58('0x20')],'as':_0x5e58('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e58('0x22')],'as':_0x5e58('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e58('0x24')],'as':_0x5e58('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e58('0x26')],'as':_0x5e58('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x5e58('0x28')],'as':_0x5e58('0x29'),'attributes':['id'],'raw':!![]}]})[_0x5e58('0xb')](function(_0x133e58){if(_0x133e58){_0x378e8d=_0x133e58;_0x19ec2b[_0x5485e2](util[_0x5e58('0x18')]('user:%s',_0x133e58[_0x5e58('0x3')]));var _0x3b41eb=[];switch(_0x133e58[_0x5e58('0x6')]){case _0x5e58('0x2a'):_0x19ec2b[_0x5485e2](_0x5e58('0x2b'));_0x19ec2b[_0x5485e2](_0x5e58('0x2c'));if(queryQueues[_0x5e58('0x2d')](_0x5e58('0x2e'))){delete queryQueues['include'];}_0x3b41eb[_0x5e58('0x2f')](db[_0x5e58('0x30')][_0x5e58('0x11')](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db['ChatQueue'][_0x5e58('0x11')](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db[_0x5e58('0x31')][_0x5e58('0x11')](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db['SmsQueue'][_0x5e58('0x11')](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db['MailQueue'][_0x5e58('0x11')](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db['OpenchannelQueue'][_0x5e58('0x11')](queryQueues));_0x3b41eb['push'](db['WhatsappQueue']['findAll'](queryQueues));_0x3b41eb[_0x5e58('0x2f')](db[_0x5e58('0x5')]['findAll'](queryTelephones));_0x3b41eb['push'](db['Trunk'][_0x5e58('0x11')](queryTrunks));_0x3b41eb[_0x5e58('0x2f')](db[_0x5e58('0x32')]['findAll'](queryCampaigns));_0x3b41eb['push'](db[_0x5e58('0x5')][_0x5e58('0x11')](queryAgents));break;case'user':_0x19ec2b[_0x5485e2]('voice:inbound');_0x19ec2b[_0x5485e2](_0x5e58('0x2c'));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x33'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x30')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x34'),_0x133e58['userProfileId'],'ChatQueue'));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0xd'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x31')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x35'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x36')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0xe'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x37')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0xf'),_0x133e58[_0x5e58('0x1e')],'OpenchannelQueue'));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x10'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x38')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x12'),_0x133e58['userProfileId'],'User'));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x13'),_0x133e58[_0x5e58('0x1e')],_0x5e58('0x39')));_0x3b41eb[_0x5e58('0x2f')](getAssociatedResources(_0x5e58('0x14'),_0x133e58['userProfileId'],_0x5e58('0x32')));_0x3b41eb[_0x5e58('0x2f')](db[_0x5e58('0x5')][_0x5e58('0x11')](queryAgents));break;case _0x5e58('0x7'):_0x19ec2b[_0x5485e2]('voice:inbound');_0x19ec2b[_0x5485e2](_0x5e58('0x2c'));_0x3b41eb[_0x5e58('0x2f')](_0x133e58[_0x5e58('0x3a')]({'attributes':['id',_0x5e58('0x3')]}));_0x3b41eb[_0x5e58('0x2f')](_0x133e58[_0x5e58('0x3b')]({'attributes':['id',_0x5e58('0x3')]}));_0x3b41eb['push'](_0x133e58[_0x5e58('0x3c')]({'attributes':['id',_0x5e58('0x3')]}));_0x3b41eb[_0x5e58('0x2f')](_0x133e58[_0x5e58('0x3d')]({'attributes':['id',_0x5e58('0x3')]}));_0x3b41eb[_0x5e58('0x2f')](_0x133e58['getMailQueues']({'attributes':['id','name']}));_0x3b41eb[_0x5e58('0x2f')](_0x133e58[_0x5e58('0x3e')]({'attributes':['id',_0x5e58('0x3')]}));_0x3b41eb[_0x5e58('0x2f')](_0x133e58[_0x5e58('0x3f')]({'attributes':['id',_0x5e58('0x3')]}));break;}return BPromise['all'](_0x3b41eb);}})['then'](function(_0x2a8317){if(_0x2a8317&&_0x2a8317[_0x5e58('0x1a')]){for(var _0x521d0e=0x0;_0x521d0e<_0x2a8317[_0x5e58('0x1a')];_0x521d0e+=0x1){for(var _0x5a7c87=0x0;_0x5a7c87<_0x2a8317[_0x521d0e][_0x5e58('0x1a')];_0x5a7c87+=0x1){switch(_0x521d0e){case 0x0:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,'voice',_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x1:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,_0x5e58('0x40'),_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x2:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,_0x5e58('0x41'),_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x3:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,'sms',_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x4:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,'mail',_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x5:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,_0x5e58('0x42'),_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x6:joinOrLeaveQueues(_0x19ec2b,_0x5485e2,'whatsapp',_0x2a8317[_0x521d0e][_0x5a7c87]);break;case 0x7:if(_0x378e8d['role']!==_0x5e58('0x7'))_0x19ec2b[_0x5485e2](util[_0x5e58('0x18')](_0x5e58('0x43'),_0x2a8317[_0x521d0e][_0x5a7c87]['name']));break;case 0x8:if(_0x378e8d['role']!==_0x5e58('0x7'))_0x19ec2b[_0x5485e2](util[_0x5e58('0x18')]('trunk:%s',_0x2a8317[_0x521d0e][_0x5a7c87][_0x5e58('0x3')]));break;case 0x9:if(_0x378e8d[_0x5e58('0x6')]!==_0x5e58('0x7'))_0x19ec2b[_0x5485e2](util[_0x5e58('0x18')](_0x5e58('0x44'),_0x2a8317[_0x521d0e][_0x5a7c87]['type'],_0x2a8317[_0x521d0e][_0x5a7c87][_0x5e58('0x3')]));break;case 0xa:_0x19ec2b[_0x5485e2](util['format'](_0x5e58('0x1b'),_0x2a8317[_0x521d0e][_0x5a7c87]['name']));break;}}}}})[_0x5e58('0xb')](function(){if(_0x5485e2===_0x5e58('0x45')){var _0x2a2fa0=_[_0x5e58('0x16')](_0x378e8d['ChatInteractions'],'id');return _0x378e8d['removeChatInteractions'](_0x2a2fa0)[_0x5e58('0xb')](function(){for(var _0x41c5aa=0x0;_0x41c5aa<_0x2a2fa0[_0x5e58('0x1a')];_0x41c5aa+=0x1){_0xffa827[_0x5e58('0x46')](_0x5e58('0x47'),{'ChatInteractionId':Number(_0x2a2fa0[_0x41c5aa]),'UserId':Number(_0x378e8d['id'])});}});}})[_0x5e58('0xb')](function(){if(_0x5485e2==='leave'){var _0x148fdb=_[_0x5e58('0x16')](_0x378e8d[_0x5e58('0x21')],'id');return _0x378e8d[_0x5e58('0x48')](_0x148fdb)[_0x5e58('0xb')](function(){for(var _0xe01806=0x0;_0xe01806<_0x148fdb['length'];_0xe01806+=0x1){_0xffa827[_0x5e58('0x46')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x148fdb[_0xe01806]),'UserId':Number(_0x378e8d['id'])});}});}})[_0x5e58('0xb')](function(){if(_0x5485e2===_0x5e58('0x45')){var _0xeb29ab=_[_0x5e58('0x16')](_0x378e8d[_0x5e58('0x23')],'id');return _0x378e8d['removeFaxInteractions'](_0xeb29ab)[_0x5e58('0xb')](function(){for(var _0x3640bc=0x0;_0x3640bc<_0xeb29ab[_0x5e58('0x1a')];_0x3640bc+=0x1){_0xffa827[_0x5e58('0x46')](_0x5e58('0x49'),{'FaxInteractionId':Number(_0xeb29ab[_0x3640bc]),'UserId':Number(_0x378e8d['id'])});}});}})[_0x5e58('0xb')](function(){if(_0x5485e2===_0x5e58('0x45')){var _0x216a79=_['map'](_0x378e8d['SmsInteractions'],'id');return _0x378e8d['removeSmsInteractions'](_0x216a79)['then'](function(){for(var _0x4eb140=0x0;_0x4eb140<_0x216a79[_0x5e58('0x1a')];_0x4eb140+=0x1){_0xffa827[_0x5e58('0x46')](_0x5e58('0x4a'),{'SmsInteractionId':Number(_0x216a79[_0x4eb140]),'UserId':Number(_0x378e8d['id'])});}});}})['then'](function(){if(_0x5485e2===_0x5e58('0x45')){var _0x2eb82d=_['map'](_0x378e8d[_0x5e58('0x27')],'id');return _0x378e8d[_0x5e58('0x4b')](_0x2eb82d)[_0x5e58('0xb')](function(){for(var _0x272679=0x0;_0x272679<_0x2eb82d[_0x5e58('0x1a')];_0x272679+=0x1){_0xffa827[_0x5e58('0x46')](_0x5e58('0x4c'),{'OpenchannelInteractionId':Number(_0x2eb82d[_0x272679]),'UserId':Number(_0x378e8d['id'])});}});}})['then'](function(){if(_0x5485e2===_0x5e58('0x45')){var _0x19d0ff=_[_0x5e58('0x16')](_0x378e8d['WhatsappInteractions'],'id');return _0x378e8d[_0x5e58('0x4d')](_0x19d0ff)[_0x5e58('0xb')](function(){for(var _0x2d267f=0x0;_0x2d267f<_0x19d0ff[_0x5e58('0x1a')];_0x2d267f+=0x1){_0xffa827[_0x5e58('0x46')](_0x5e58('0x4e'),{'WhatsappInteractionId':Number(_0x19d0ff[_0x2d267f]),'UserId':Number(_0x378e8d['id'])});}});}})[_0x5e58('0x4f')](function(_0x1f3a5b){_0x19ec2b['log'](_0x1f3a5b);});}}function onDisconnect(_0x121e55,_0x117492){joinOrLeave(_0x121e55,_0x5e58('0x45'),_0x117492);}function onConnect(_0x35c962){joinOrLeave(_0x35c962,_0x5e58('0x50'));}exports[_0x5e58('0x51')]=function(_0x5f6d78){_0x5f6d78['on'](_0x5e58('0x52'),function(_0x451a15){_0x451a15[_0x5e58('0x53')](0x0);_0x451a15[_0x5e58('0x54')]=_0x451a15[_0x5e58('0x55')][_0x5e58('0x52')][_0x5e58('0x56')]+':'+_0x451a15[_0x5e58('0x55')][_0x5e58('0x52')][_0x5e58('0x57')];_0x451a15[_0x5e58('0x58')]=new Date();_0x451a15['log']=function(_0xc58471){console[_0x5e58('0x59')]('SocketIO\x20'+_0x451a15[_0x5e58('0x5a')][_0x5e58('0x3')]+'['+_0x451a15[_0x5e58('0x54')]+']',_0xc58471);};_0x451a15['on']('disconnect',function(){onDisconnect(_0x451a15,_0x5f6d78);_0x451a15[_0x5e58('0x59')](_0x5e58('0x5b'));});onConnect(_0x451a15);_0x451a15[_0x5e58('0x59')]('CONNECTED');});}; \ No newline at end of file +var _0xdc36=['lodash','bluebird','../mysqldb','name','Agents','User','role','agent','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','MailQueues','OpenchannelQueues','WhatsappQueues','findAll','Telephones','Trunks','IvrCampaigns','resourceId','where','telephone','Campaign','type','format','length','user:%s','query','find','userProfileId','ChatInteraction','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteraction','WhatsappInteraction','WhatsappInteractions','admin','voice:outbound','include','push','VoiceQueue','FaxQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','voice:inbound','getVoiceQueues','getChatQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','sms','openchannel','whatsapp','telephone:%s','trunk:%s','campaign:%s:%s','leave','map','ChatInteractions','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','removeFaxInteractions','user_has_fax_interactions:remove','SmsInteractions','removeSmsInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','removeWhatsappInteractions','user_has_whatsapp_interactions:remove','catch','log','join','default','setMaxListeners','address','request','connection','remoteAddress','connectedAt','nsp','disconnect','DISCONNECTED','CONNECTED'];(function(_0xfc00a1,_0x3afe96){var _0x57e75e=function(_0x2601b8){while(--_0x2601b8){_0xfc00a1['push'](_0xfc00a1['shift']());}};_0x57e75e(++_0x3afe96);}(_0xdc36,0x18c));var _0x6dc3=function(_0x2176b3,_0x6bf75b){_0x2176b3=_0x2176b3-0x0;var _0x46caa6=_0xdc36[_0x2176b3];return _0x46caa6;};'use strict';var _=require(_0x6dc3('0x0'));var util=require('util');var BPromise=require(_0x6dc3('0x1'));var db=require(_0x6dc3('0x2'))['db'];var config=require('./environment');var queryQueues={'attributes':['id',_0x6dc3('0x3')],'include':[{'as':_0x6dc3('0x4'),'model':db[_0x6dc3('0x5')],'attributes':['id','name',_0x6dc3('0x6')],'raw':!![],'where':{'role':_0x6dc3('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x6dc3('0x3')]};var queryAgents={'raw':!![],'attributes':['id',_0x6dc3('0x3')],'where':{'role':_0x6dc3('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x6dc3('0x3'),'type'],'where':{'type':_0x6dc3('0x8')}};function getAssociatedResources(_0x1aecc5,_0x554fe5,_0x88957d){return db[_0x6dc3('0x9')][_0x6dc3('0xa')]({'where':{'name':_0x1aecc5,'userProfileId':_0x554fe5},'raw':!![]})[_0x6dc3('0xb')](function(_0x55c3e9){if(_0x55c3e9){if(_0x55c3e9[_0x6dc3('0xc')]){switch(_0x1aecc5){case'VoiceQueues':case _0x6dc3('0xd'):case _0x6dc3('0xe'):case _0x6dc3('0xf'):case _0x6dc3('0x10'):case _0x6dc3('0x11'):case _0x6dc3('0x12'):return db[_0x88957d][_0x6dc3('0x13')](queryQueues);case _0x6dc3('0x14'):return db[_0x88957d]['findAll'](queryTelephones);case _0x6dc3('0x15'):return db[_0x88957d][_0x6dc3('0x13')](queryTrunks);case _0x6dc3('0x16'):return db[_0x88957d][_0x6dc3('0x13')](queryCampaigns);}}else{return db['UserProfileResource'][_0x6dc3('0x13')]({'attributes':[_0x6dc3('0x17')],'where':{'sectionId':_0x55c3e9['id']},'raw':!![]})[_0x6dc3('0xb')](function(_0x469b81){if(_0x469b81){var _0x22b39a={'where':{'id':_['map'](_0x469b81,'resourceId')},'raw':!![]};switch(_0x88957d){case'User':_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x6')]=_0x6dc3('0x19');break;case _0x6dc3('0x1a'):_0x22b39a[_0x6dc3('0x18')][_0x6dc3('0x1b')]=_0x6dc3('0x8');break;}return db[_0x88957d][_0x6dc3('0x13')](_0x22b39a);}else{return[];}});}}else{return[];}})['then'](function(_0x33edab){return _0x33edab;});}function joinOrLeaveQueues(_0x279bae,_0xd1bfd4,_0x148885,_0x473229){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')]('%s:queue:%s',_0x148885,_0x473229[_0x6dc3('0x3')]));if(_0x473229[_0x6dc3('0x4')]){for(var _0x22b18a=0x0;_0x22b18a<_0x473229[_0x6dc3('0x4')][_0x6dc3('0x1d')];_0x22b18a+=0x1){_0x279bae[_0xd1bfd4](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x473229[_0x6dc3('0x4')][_0x22b18a][_0x6dc3('0x3')]));}}}function joinOrLeave(_0x435a55,_0x52d5f2,_0x38dd7e){var _0x12455c;if(_0x435a55['handshake'][_0x6dc3('0x1f')]['id']){db['User'][_0x6dc3('0x20')]({'attributes':['id','name','role',_0x6dc3('0x21')],'where':{'id':_0x435a55['handshake'][_0x6dc3('0x1f')]['id']},'include':[{'model':db[_0x6dc3('0x22')],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x23')],'as':_0x6dc3('0x24'),'attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x25')],'as':_0x6dc3('0x26'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x27')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x6dc3('0x28')],'as':_0x6dc3('0x29'),'attributes':['id'],'raw':!![]}]})[_0x6dc3('0xb')](function(_0x598ab4){if(_0x598ab4){_0x12455c=_0x598ab4;_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x598ab4['name']));var _0xd7c2b5=[];switch(_0x598ab4[_0x6dc3('0x6')]){case _0x6dc3('0x2a'):_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));if(queryQueues['hasOwnProperty']('include')){delete queryQueues[_0x6dc3('0x2c')];}_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x2e')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db['ChatQueue'][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x2f')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x30')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db['MailQueue']['findAll'](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x31')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5['push'](db[_0x6dc3('0x32')][_0x6dc3('0x13')](queryQueues));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')]['findAll'](queryTelephones));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x33')][_0x6dc3('0x13')](queryTrunks));_0xd7c2b5[_0x6dc3('0x2d')](db['Campaign'][_0x6dc3('0x13')](queryCampaigns));_0xd7c2b5['push'](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'user':_0x435a55[_0x52d5f2](_0x6dc3('0x34'));_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5['push'](getAssociatedResources('VoiceQueues',_0x598ab4['userProfileId'],_0x6dc3('0x2e')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('ChatQueues',_0x598ab4[_0x6dc3('0x21')],'ChatQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('FaxQueues',_0x598ab4['userProfileId'],'FaxQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources('SmsQueues',_0x598ab4[_0x6dc3('0x21')],'SmsQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x10'),_0x598ab4[_0x6dc3('0x21')],'MailQueue'));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x11'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x31')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x12'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x32')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x14'),_0x598ab4[_0x6dc3('0x21')],_0x6dc3('0x5')));_0xd7c2b5[_0x6dc3('0x2d')](getAssociatedResources(_0x6dc3('0x15'),_0x598ab4['userProfileId'],_0x6dc3('0x33')));_0xd7c2b5['push'](getAssociatedResources(_0x6dc3('0x16'),_0x598ab4['userProfileId'],_0x6dc3('0x1a')));_0xd7c2b5[_0x6dc3('0x2d')](db[_0x6dc3('0x5')][_0x6dc3('0x13')](queryAgents));break;case'agent':_0x435a55[_0x52d5f2]('voice:inbound');_0x435a55[_0x52d5f2](_0x6dc3('0x2b'));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x35')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5['push'](_0x598ab4[_0x6dc3('0x36')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getFaxQueues']({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4['getSmsQueues']({'attributes':['id','name']}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x37')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x38')]({'attributes':['id',_0x6dc3('0x3')]}));_0xd7c2b5[_0x6dc3('0x2d')](_0x598ab4[_0x6dc3('0x39')]({'attributes':['id',_0x6dc3('0x3')]}));break;}return BPromise[_0x6dc3('0x3a')](_0xd7c2b5);}})[_0x6dc3('0xb')](function(_0x33ae2b){if(_0x33ae2b&&_0x33ae2b[_0x6dc3('0x1d')]){for(var _0x255718=0x0;_0x255718<_0x33ae2b[_0x6dc3('0x1d')];_0x255718+=0x1){for(var _0x413361=0x0;_0x413361<_0x33ae2b[_0x255718][_0x6dc3('0x1d')];_0x413361+=0x1){switch(_0x255718){case 0x0:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3b'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x1:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3c'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x2:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3d'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x3:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3e'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x4:joinOrLeaveQueues(_0x435a55,_0x52d5f2,'mail',_0x33ae2b[_0x255718][_0x413361]);break;case 0x5:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x3f'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x6:joinOrLeaveQueues(_0x435a55,_0x52d5f2,_0x6dc3('0x40'),_0x33ae2b[_0x255718][_0x413361]);break;case 0x7:if(_0x12455c[_0x6dc3('0x6')]!=='agent')_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x41'),_0x33ae2b[_0x255718][_0x413361]['name']));break;case 0x8:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util['format'](_0x6dc3('0x42'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0x9:if(_0x12455c[_0x6dc3('0x6')]!==_0x6dc3('0x7'))_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x43'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x1b')],_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;case 0xa:_0x435a55[_0x52d5f2](util[_0x6dc3('0x1c')](_0x6dc3('0x1e'),_0x33ae2b[_0x255718][_0x413361][_0x6dc3('0x3')]));break;}}}}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x32d90a=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x46')],'id');return _0x12455c[_0x6dc3('0x47')](_0x32d90a)[_0x6dc3('0xb')](function(){for(var _0x49a943=0x0;_0x49a943<_0x32d90a[_0x6dc3('0x1d')];_0x49a943+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x49'),{'ChatInteractionId':Number(_0x32d90a[_0x49a943]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0xf8e0d7=_['map'](_0x12455c[_0x6dc3('0x24')],'id');return _0x12455c[_0x6dc3('0x4a')](_0xf8e0d7)['then'](function(){for(var _0x4a2d69=0x0;_0x4a2d69<_0xf8e0d7[_0x6dc3('0x1d')];_0x4a2d69+=0x1){_0x38dd7e[_0x6dc3('0x48')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0xf8e0d7[_0x4a2d69]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x55f8da=_['map'](_0x12455c['FaxInteractions'],'id');return _0x12455c[_0x6dc3('0x4b')](_0x55f8da)['then'](function(){for(var _0x2bece6=0x0;_0x2bece6<_0x55f8da[_0x6dc3('0x1d')];_0x2bece6+=0x1){_0x38dd7e['emit'](_0x6dc3('0x4c'),{'FaxInteractionId':Number(_0x55f8da[_0x2bece6]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x4b93cb=_[_0x6dc3('0x45')](_0x12455c[_0x6dc3('0x4d')],'id');return _0x12455c[_0x6dc3('0x4e')](_0x4b93cb)[_0x6dc3('0xb')](function(){for(var _0x4b43dc=0x0;_0x4b43dc<_0x4b93cb[_0x6dc3('0x1d')];_0x4b43dc+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x4f'),{'SmsInteractionId':Number(_0x4b93cb[_0x4b43dc]),'UserId':Number(_0x12455c['id'])});}});}})['then'](function(){if(_0x52d5f2==='leave'){var _0x211d9d=_['map'](_0x12455c[_0x6dc3('0x50')],'id');return _0x12455c[_0x6dc3('0x51')](_0x211d9d)[_0x6dc3('0xb')](function(){for(var _0x237ca9=0x0;_0x237ca9<_0x211d9d[_0x6dc3('0x1d')];_0x237ca9+=0x1){_0x38dd7e[_0x6dc3('0x48')](_0x6dc3('0x52'),{'OpenchannelInteractionId':Number(_0x211d9d[_0x237ca9]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0xb')](function(){if(_0x52d5f2===_0x6dc3('0x44')){var _0x3aac2b=_[_0x6dc3('0x45')](_0x12455c['WhatsappInteractions'],'id');return _0x12455c[_0x6dc3('0x53')](_0x3aac2b)[_0x6dc3('0xb')](function(){for(var _0x557421=0x0;_0x557421<_0x3aac2b[_0x6dc3('0x1d')];_0x557421+=0x1){_0x38dd7e['emit'](_0x6dc3('0x54'),{'WhatsappInteractionId':Number(_0x3aac2b[_0x557421]),'UserId':Number(_0x12455c['id'])});}});}})[_0x6dc3('0x55')](function(_0x514528){_0x435a55[_0x6dc3('0x56')](_0x514528);});}}function onDisconnect(_0x486354,_0x9034c1){joinOrLeave(_0x486354,_0x6dc3('0x44'),_0x9034c1);}function onConnect(_0x2aa73d){joinOrLeave(_0x2aa73d,_0x6dc3('0x57'));}exports[_0x6dc3('0x58')]=function(_0x544082){_0x544082['on']('connection',function(_0x1240da){_0x1240da[_0x6dc3('0x59')](0x0);_0x1240da[_0x6dc3('0x5a')]=_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')][_0x6dc3('0x5d')]+':'+_0x1240da[_0x6dc3('0x5b')][_0x6dc3('0x5c')]['remotePort'];_0x1240da[_0x6dc3('0x5e')]=new Date();_0x1240da[_0x6dc3('0x56')]=function(_0xc7e5f3){console[_0x6dc3('0x56')]('SocketIO\x20'+_0x1240da[_0x6dc3('0x5f')][_0x6dc3('0x3')]+'['+_0x1240da[_0x6dc3('0x5a')]+']',_0xc7e5f3);};_0x1240da['on'](_0x6dc3('0x60'),function(){onDisconnect(_0x1240da,_0x544082);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x61'));});onConnect(_0x1240da);_0x1240da[_0x6dc3('0x56')](_0x6dc3('0x62'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3469235..0ef7873 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 _0x69e8=['hook','callback','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','triggers','client','Chat','ChatInteraction','afterCreate','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','newinteraction','SmsMessage','WhatsappInteraction','Fax','FaxInteraction','FaxMessage','MailInteraction','Mail','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','info','Trigger,\x20%s','EventManager','error','code','get','channel','motionChannel','event','direction','resolve','ContactId','undefined','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','then','contact','UserId','format','SIP/%s','name','agent','incomingmessage','AfterCreateMessage','sequelize','query','Sequelize','QueryTypes','SELECT','interface','catch','AfterCreate','changed','closed','substatus','AfterUpdate','User','find','email','internal','default','model'];(function(_0x3cc563,_0x1598d3){var _0x11c044=function(_0x3b5f17){while(--_0x3b5f17){_0x3cc563['push'](_0x3cc563['shift']());}};_0x11c044(++_0x1598d3);}(_0x69e8,0xdf));var _0x869e=function(_0x1c73d1,_0x595c17){_0x1c73d1=_0x1c73d1-0x0;var _0x54648c=_0x69e8[_0x1c73d1];return _0x54648c;};'use strict';var util=require(_0x869e('0x0'));var db=require(_0x869e('0x1'))['db'];var jayson=require(_0x869e('0x2'));var logger=require(_0x869e('0x3'))(_0x869e('0x4'));var client=jayson[_0x869e('0x5')]['http']({'port':0x232a});var triggers=[{'channel':_0x869e('0x6'),'model':_0x869e('0x7'),'event':_0x869e('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x869e('0x6'),'model':'ChatInteraction','event':_0x869e('0x9'),'condition':_0x869e('0xa'),'callback':afterUpdate},{'channel':_0x869e('0x6'),'model':_0x869e('0xb'),'event':_0x869e('0x8'),'condition':_0x869e('0xc'),'callback':afterCreateMessage},{'channel':_0x869e('0xd'),'model':_0x869e('0xe'),'event':_0x869e('0x8'),'condition':_0x869e('0xf'),'callback':afterCreate},{'channel':'Sms','model':'SmsInteraction','event':_0x869e('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x869e('0x10'),'event':_0x869e('0x8'),'condition':_0x869e('0xc'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x869e('0x11'),'event':_0x869e('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':'Whatsapp','model':_0x869e('0x11'),'event':_0x869e('0x9'),'condition':_0x869e('0xa'),'callback':afterUpdate},{'channel':'Whatsapp','model':'WhatsappMessage','event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x869e('0x12'),'model':_0x869e('0x13'),'event':_0x869e('0x8'),'condition':_0x869e('0xf'),'callback':afterCreate},{'channel':_0x869e('0x12'),'model':_0x869e('0x13'),'event':_0x869e('0x9'),'condition':_0x869e('0xa'),'callback':afterUpdate},{'channel':_0x869e('0x12'),'model':_0x869e('0x14'),'event':_0x869e('0x8'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Mail','model':_0x869e('0x15'),'event':_0x869e('0x8'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x869e('0x16'),'model':_0x869e('0x15'),'event':_0x869e('0x9'),'condition':_0x869e('0xa'),'callback':afterUpdate},{'channel':'Mail','model':_0x869e('0x17'),'event':_0x869e('0x8'),'condition':_0x869e('0xc'),'callback':afterCreateMessage},{'channel':_0x869e('0x18'),'model':_0x869e('0x19'),'event':_0x869e('0x8'),'condition':_0x869e('0xf'),'callback':afterCreate},{'channel':_0x869e('0x18'),'model':_0x869e('0x19'),'event':_0x869e('0x9'),'condition':_0x869e('0xa'),'callback':afterUpdate},{'channel':_0x869e('0x18'),'model':_0x869e('0x1a'),'event':_0x869e('0x8'),'condition':_0x869e('0xc'),'callback':afterCreateMessage}];function request(_0x344504){return client[_0x869e('0x1b')]('EventManager',_0x344504)['then'](function(_0x29fa6c){logger[_0x869e('0x1c')](_0x869e('0x1d'),_0x869e('0x1e'),_0x29fa6c);if(_0x29fa6c[_0x869e('0x1f')]){if(_0x29fa6c[_0x869e('0x1f')][_0x869e('0x20')]===0x1f4){logger[_0x869e('0x1f')](_0x869e('0x1d'),_0x869e('0x1e'),_0x29fa6c[_0x869e('0x1f')]);}}})['catch'](function(_0x106bef){logger['error'](_0x869e('0x1d'),_0x869e('0x1e'),_0x106bef);});}function afterCreateMessage(_0x7867c9){return function(_0x1e14d2){_0x1e14d2=_0x1e14d2[_0x869e('0x21')]({'plain':!![]});_0x1e14d2[_0x869e('0x22')]=_0x7867c9;_0x1e14d2[_0x869e('0x23')]=_0x7867c9;_0x1e14d2[_0x869e('0x24')]=_0x1e14d2[_0x869e('0x25')];Promise[_0x869e('0x26')]()['then'](function(){if(typeof _0x1e14d2[_0x869e('0x27')]===_0x869e('0x28'))return null;var _0x17c917=_0x869e('0x29')+_0x1e14d2[_0x869e('0x27')];return db['sequelize']['query'](_0x17c917,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]});})[_0x869e('0x2a')](function(_0x58792a){if(_0x58792a){_0x1e14d2[_0x869e('0x2b')]=_0x58792a[0x0];}if(typeof _0x1e14d2[_0x869e('0x2c')]===_0x869e('0x28'))return;return getAgent(_0x1e14d2[_0x869e('0x2c')]);})[_0x869e('0x2a')](function(_0x2cb88b){if(_0x2cb88b){_0x1e14d2['interface']=util[_0x869e('0x2d')](_0x869e('0x2e'),_0x2cb88b[_0x869e('0x2f')]);_0x1e14d2[_0x869e('0x30')]=_0x2cb88b;_0x1e14d2[_0x869e('0x22')]=_0x7867c9;return request({'event':_0x869e('0x31'),'message':_0x1e14d2});}else{return request({'event':'outgoingmessage','message':_0x1e14d2});}})['catch'](function(_0x4c467e){logger[_0x869e('0x1f')](_0x869e('0x1d'),_0x869e('0x32'),_0x4c467e);});};}function afterCreate(_0x2b0f0d,_0x275100){return function(_0x29215e){_0x29215e=_0x29215e[_0x869e('0x21')]({'plain':!![]});_0x29215e[_0x869e('0x22')]=_0x2b0f0d;_0x29215e[_0x869e('0x23')]=_0x2b0f0d;_0x29215e[_0x869e('0x24')]='opened';Promise[_0x869e('0x26')]()[_0x869e('0x2a')](function(){var _0x246b40=_0x869e('0x29')+_0x29215e[_0x869e('0x27')];return db[_0x869e('0x33')][_0x869e('0x34')](_0x246b40,{'type':db[_0x869e('0x35')][_0x869e('0x36')][_0x869e('0x37')],'raw':!![]});})['then'](function(_0x3f3fc6){if(_0x3f3fc6){_0x29215e[_0x869e('0x2b')]=_0x3f3fc6[0x0];}if(typeof _0x29215e['UserId']===_0x869e('0x28'))return;return getAgent(_0x29215e[_0x869e('0x2c')]);})[_0x869e('0x2a')](function(_0x2d9779){if(_0x2d9779){_0x29215e[_0x869e('0x38')]=util[_0x869e('0x2d')](_0x869e('0x2e'),_0x2d9779[_0x869e('0x2f')]);_0x29215e[_0x869e('0x30')]=_0x2d9779;}return request({'event':_0x275100,'message':_0x29215e});})[_0x869e('0x39')](function(_0x362f10){logger[_0x869e('0x1f')](_0x869e('0x1d'),_0x869e('0x3a'),_0x362f10);});};}function afterUpdate(_0x44492e){return function(_0x62abad){var _0x4e8bc0=_0x62abad[_0x869e('0x3b')](_0x869e('0x3c'))&&_0x62abad[_0x869e('0x3c')];var _0x32fbb1=_0x62abad[_0x869e('0x3b')](_0x869e('0x3d'));if(_0x4e8bc0||_0x32fbb1){var _0x42871a=_0x4e8bc0?_0x869e('0xa'):_0x869e('0x3d');var _0x487426=_0x62abad[_0x869e('0x21')]({'plain':!![]});_0x487426[_0x869e('0x22')]=_0x44492e;_0x487426[_0x869e('0x23')]=_0x44492e;_0x487426[_0x869e('0x24')]=_0x4e8bc0?_0x869e('0x3c'):_0x869e('0x3d');var _0x56bdbe=_0x869e('0x29')+_0x487426['ContactId'];return db[_0x869e('0x33')]['query'](_0x56bdbe,{'type':db['Sequelize'][_0x869e('0x36')][_0x869e('0x37')],'raw':!![]})[_0x869e('0x2a')](function(_0x4c34b1){if(_0x4c34b1){_0x487426[_0x869e('0x2b')]=_0x4c34b1[0x0];}if(typeof _0x487426[_0x869e('0x2c')]===_0x869e('0x28'))return;return getAgent(_0x487426[_0x869e('0x2c')]);})['then'](function(_0x1fcc42){if(_0x1fcc42){_0x487426[_0x869e('0x38')]=util[_0x869e('0x2d')]('SIP/%s',_0x1fcc42[_0x869e('0x2f')]);_0x487426[_0x869e('0x30')]=_0x1fcc42;}return request({'event':_0x42871a,'message':_0x487426});})[_0x869e('0x39')](function(_0x74f905){logger[_0x869e('0x1f')](_0x869e('0x1d'),_0x869e('0x3e'),_0x74f905);});}};}function getAgent(_0x5e6262){return db[_0x869e('0x3f')][_0x869e('0x40')]({'where':{'id':_0x5e6262},'attributes':['id',_0x869e('0x2f'),'fullname',_0x869e('0x41'),_0x869e('0x42')],'raw':!![]})['then'](function(_0x5587fa){return _0x5587fa;});}exports[_0x869e('0x43')]=function(){for(var _0x495fc9=0x0;_0x495fc9=_0x5ad1d8[_0x4a13('0x17')]){throw Error(_0x4a13('0x18'));}_0x157e89(_0x5deb98);})['catch'](function(_0x2afe18){_0x216bc6(_0x2afe18);});});}; \ No newline at end of file +var _0xf784=['fax','sms','whatsapp','openchannel','getChannels','isValidChannel','toLowerCase','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached','../mysqldb','./license/util','chat'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0xf784,0xba));var _0x4f78=function(_0x22c51a,_0xa20c48){_0x22c51a=_0x22c51a-0x0;var _0x3b8294=_0xf784[_0x22c51a];return _0x3b8294;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var db=require(_0x4f78('0x0'))['db'];var util=require(_0x4f78('0x1'));var channels=['voice','mail',_0x4f78('0x2'),_0x4f78('0x3'),_0x4f78('0x4'),_0x4f78('0x5'),_0x4f78('0x6')];exports[_0x4f78('0x7')]=function(){return channels;};exports[_0x4f78('0x8')]=function(_0xc5e9a8){_0xc5e9a8=_0xc5e9a8[_0x4f78('0x9')]();return _['includes'](channels,_0xc5e9a8);};exports['clearBlockUser']=function(_0x20cec6,_0x300bc9,_0x523494,_0x1951ca){var _0x22af12={'loginAttempts':_0x300bc9,'blocked':_0x523494};if(!_[_0x4f78('0xa')](_0x1951ca)){_0x22af12[_0x4f78('0xb')]=_0x1951ca;}return _0x20cec6[_0x4f78('0xc')](_0x22af12);};exports[_0x4f78('0xd')]=function(_0x491b4a){return new BPromise(function(_0xcd709f,_0x4498be){var _0x321bf2=0x0;if(_0x491b4a[_0x4f78('0xe')]!==_0x4f78('0xf')){_0xcd709f(_0x491b4a);}db[_0x4f78('0x10')][_0x4f78('0x11')]({'where':{'role':_0x4f78('0xf'),'online':!![],'id':{'$ne':_0x491b4a['id']}}})[_0x4f78('0x12')](function(_0x501f67){_0x321bf2=_0x501f67;return util[_0x4f78('0xd')]();})[_0x4f78('0x12')](function(_0x11fc55){if(_0x11fc55&&_0x11fc55[_0x4f78('0x13')]&&_0x321bf2>=_0x11fc55[_0x4f78('0x13')]){throw Error(_0x4f78('0x14'));}_0xcd709f(_0x491b4a);})['catch'](function(_0xeec402){_0x4498be(_0xeec402);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 7c9b6da..a801a4d 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6947=['status','json','404','render'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6947,0x72));var _0x7694=function(_0xdcef85,_0x18feac){_0xdcef85=_0xdcef85-0x0;var _0x14f547=_0x6947[_0xdcef85];return _0x14f547;};'use strict';module['exports'][0x194]=function pageNotFound(_0x2a0524,_0x4c07f9){var _0x39aa64=_0x7694('0x0');var _0x2e867e=0x194;var _0x229b6d={'status':_0x2e867e};_0x4c07f9['status'](_0x229b6d['status']);_0x4c07f9[_0x7694('0x1')](_0x39aa64,{},function(_0x19c519,_0x1cb2b5){if(_0x19c519){return _0x4c07f9[_0x7694('0x2')](_0x229b6d[_0x7694('0x2')])[_0x7694('0x3')](_0x229b6d);}_0x4c07f9['send'](_0x1cb2b5);});}; \ No newline at end of file +var _0x116c=['status','render','json','send','exports','404'];(function(_0xb2202,_0x5987d9){var _0x6a4ed6=function(_0x2572bd){while(--_0x2572bd){_0xb2202['push'](_0xb2202['shift']());}};_0x6a4ed6(++_0x5987d9);}(_0x116c,0xca));var _0xc116=function(_0x5a322e,_0x4afac9){_0x5a322e=_0x5a322e-0x0;var _0x496df7=_0x116c[_0x5a322e];return _0x496df7;};'use strict';module[_0xc116('0x0')][0x194]=function pageNotFound(_0x9fbe85,_0xe7b49d){var _0x1882fa=_0xc116('0x1');var _0x4f8201=0x194;var _0x290c70={'status':_0x4f8201};_0xe7b49d[_0xc116('0x2')](_0x290c70['status']);_0xe7b49d[_0xc116('0x3')](_0x1882fa,{},function(_0x290b61,_0xb2db49){if(_0x290b61){return _0xe7b49d[_0xc116('0x2')](_0x290c70['status'])[_0xc116('0x4')](_0x290c70);}_0xe7b49d[_0xc116('0x5')](_0xb2db49);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8382ba5..e4a872d 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3cd1=['../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','WhatsappQueueReport','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','../api/teamVoiceQueue/teamVoiceQueue.model','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','hasOne','VoiceMail','cascade','UserId','Recordings','VoiceQueuesRt','hasMany','Extensions','CmHopperFinal','HopperFinals','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','user_has_teams','MailInteractions','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','VoiceQueue','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','UserMailQueue','ChatQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','user_has_openchannel_accounts','SmsAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','VoiceChanSpy','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Hoppers','VoiceQueueId','HopperBlacks','JscriptySessions','TrunkId','IntervalId','mandatoryDispositionPauseId','Agents','Teams','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','CmContact','Contact','ContactId','MailServerIn','MailAccountId','CloudProviderId','restrict','MailServerOut','Smtp','CannedAnswer','Answers','Messages','Interactions','ListId','Template','MailInteractionId','Account','mail_interaction_has_tags','Users','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessageId','TagId','List','Dashboard','DashboardItem','Dispositions','FaxAccountId','FaxApplication','Exntensions','Owner','fax_interaction_has_tags','Tags','ThroughTags','user_has_fax_interactions','FaxInteractionId','team_has_fax_queues','SmsAccountId','SmsMessage','mandatoryDispositionPause','user_has_sms_accounts','sms_interaction_has_tags','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','AttachmentId','team_has_openchannel_queues','ChatProactiveAction','ProactiveActions','Queue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','Members','CompanyId','HopperHistories','cm_contact_has_tags','Agent','OwnerId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','MailApplications','ChatApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','AnalyticFieldReport','Fields','SalesforceConfiguration','AccountId','Subjects','Descriptions','DescriptionId','Subject','Description','FieldId','Variable','VariableId','Configurations','SugarcrmConfiguration','SubjectId','Field','DeskField','DeskAccount','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','Dynamics365Field','FreshsalesAccount','ChatQueueReport','FromId','ToId','SessionId','ProjectId','team_has_mail_queues','CampaignId','TrunkBackupId','SquareProjectId','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsAccountId','CustomFields','Queues','voice_queues_has_cm_lists','TeamVoicePrefix','UserProfileSections','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','Imap','exports','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','utf8','utf8_general_ci','sequelizeHistory','xcall','utf8mb4','name','database','password','options','username','User','import','../api/user/user.model','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','../api/mailServerIn/mailServerIn.model','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../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','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmContact/cmContact.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','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','../api/cdr/cdr.model','../api/voiceQueuesLog/voiceQueuesLog.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','Network','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','Team','License','Campaign','../api/campaign/campaign.model','Migration','Attachment'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x3cd1,0x112));var _0x13cd=function(_0x4a926b,_0x3fae01){_0x4a926b=_0x4a926b-0x0;var _0x42b2c2=_0x3cd1[_0x4a926b];return _0x42b2c2;};'use strict';var config=require('../config/environment');var Sequelize=require(_0x13cd('0x0'));var _=require(_0x13cd('0x1'));var jstz=require(_0x13cd('0x2'));var timezone=jstz[_0x13cd('0x3')]();config[_0x13cd('0x0')]=_[_0x13cd('0x4')](config[_0x13cd('0x0')],{'database':_0x13cd('0x5'),'username':'xcall','password':_0x13cd('0x6'),'options':{'host':_0x13cd('0x7'),'port':0xcea,'dialect':_0x13cd('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x13cd('0x9'),'collate':_0x13cd('0xa')}}});config[_0x13cd('0xb')]=_[_0x13cd('0x4')](config['sequelizeHistory'],{'database':_0x13cd('0x5'),'username':_0x13cd('0xc'),'password':_0x13cd('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x13cd('0xd')},'logging':![],'timezone':timezone[_0x13cd('0xe')](),'define':{'charset':_0x13cd('0x9'),'collate':_0x13cd('0xa')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x13cd('0x0')][_0x13cd('0xf')],config[_0x13cd('0x0')]['username'],config[_0x13cd('0x0')][_0x13cd('0x10')],config['sequelize'][_0x13cd('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x13cd('0xb')][_0x13cd('0xf')],config[_0x13cd('0xb')][_0x13cd('0x12')],config[_0x13cd('0xb')][_0x13cd('0x10')],config[_0x13cd('0xb')]['options'])};db[_0x13cd('0x13')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x15'));db['VoiceChanSpy']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x16'));db[_0x13cd('0x17')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x18'));db[_0x13cd('0x19')]=db['sequelize'][_0x13cd('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0x13cd('0x1a')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x1b'));db['VoiceQueue']=db[_0x13cd('0x0')]['import'](_0x13cd('0x1c'));db[_0x13cd('0x1d')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x1e'));db[_0x13cd('0x1f')]=db['sequelize']['import'](_0x13cd('0x20'));db['VoiceMail']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x21'));db[_0x13cd('0x22')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x23'));db[_0x13cd('0x24')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x25'));db[_0x13cd('0x26')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x27'));db['VoiceAgentReport']=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x13cd('0x28')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x29'));db[_0x13cd('0x2a')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/memberReport/memberReport.model');db[_0x13cd('0x2b')]=db['sequelize']['import'](_0x13cd('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x13cd('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x13cd('0x2d')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x2e'));db[_0x13cd('0x2f')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x30'));db[_0x13cd('0x31')]=db[_0x13cd('0x0')]['import']('../api/userChatQueue/userChatQueue.model');db['UserMailQueue']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x32'));db['UserFaxQueue']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x33'));db[_0x13cd('0x34')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x35'));db[_0x13cd('0x36')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x37'));db[_0x13cd('0x38')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x39'));db['MailServerIn']=db['sequelize']['import'](_0x13cd('0x3a'));db['MailServerOut']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x3b'));db[_0x13cd('0x3c')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x3d'));db[_0x13cd('0x3e')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/mailQueue/mailQueue.model');db['MailSubstatus']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x3f'));db[_0x13cd('0x40')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x41'));db[_0x13cd('0x42')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x43'));db[_0x13cd('0x44')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x45'));db[_0x13cd('0x46')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0x13cd('0x0')]['import'](_0x13cd('0x47'));db['DashboardItem']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x48'));db[_0x13cd('0x49')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x4a'));db['FaxApplication']=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/faxApplication/faxApplication.model');db[_0x13cd('0x4b')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/faxInteraction/faxInteraction.model');db[_0x13cd('0x4c')]=db[_0x13cd('0x0')]['import']('../api/faxMessage/faxMessage.model');db[_0x13cd('0x4d')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x4e'));db[_0x13cd('0x4f')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x50'));db[_0x13cd('0x51')]=db['sequelize']['import'](_0x13cd('0x52'));db[_0x13cd('0x53')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/smsApplication/smsApplication.model');db[_0x13cd('0x54')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x55'));db['SmsMessage']=db['sequelize'][_0x13cd('0x14')]('../api/smsMessage/smsMessage.model');db[_0x13cd('0x56')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/smsQueue/smsQueue.model');db[_0x13cd('0x57')]=db['sequelize'][_0x13cd('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0x13cd('0x58')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x59'));db[_0x13cd('0x5a')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x5b'));db[_0x13cd('0x5c')]=db['sequelize']['import'](_0x13cd('0x5d'));db[_0x13cd('0x5e')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x5f'));db[_0x13cd('0x60')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x61'));db[_0x13cd('0x62')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x63'));db[_0x13cd('0x64')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x65'));db[_0x13cd('0x66')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x67'));db[_0x13cd('0x68')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/chatMessage/chatMessage.model');db[_0x13cd('0x69')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x6a'));db[_0x13cd('0x6b')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x6c'));db[_0x13cd('0x6d')]=db[_0x13cd('0x0')]['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x6e'));db[_0x13cd('0x6f')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/cmCompany/cmCompany.model');db['CmContact']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x70'));db[_0x13cd('0x71')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x72'));db[_0x13cd('0x73')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x74'));db['CmHopperFinal']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x75'));db[_0x13cd('0x76')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x77'));db[_0x13cd('0x78')]=db['sequelize']['import'](_0x13cd('0x79'));db[_0x13cd('0x7a')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x7b'));db[_0x13cd('0x7c')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x7d'));db[_0x13cd('0x7e')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x7f'));db['CannedAnswer']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x80'));db[_0x13cd('0x81')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x82'));db[_0x13cd('0x83')]=db['sequelize']['import'](_0x13cd('0x84'));db[_0x13cd('0x85')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x86'));db[_0x13cd('0x87')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x88'));db['Cdr']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x89'));db['VoiceQueuesLog']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x8a'));db['Schedule']=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/schedule/schedule.model');db[_0x13cd('0x8b')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x8c'));db[_0x13cd('0x8d')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x8e'));db['Template']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x8f'));db[_0x13cd('0x90')]=db[_0x13cd('0x0')]['import']('../api/trigger/trigger.model');db['Variable']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x91'));db[_0x13cd('0x92')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x93'));db['IntegrationReport']=db[_0x13cd('0x0')]['import'](_0x13cd('0x94'));db[_0x13cd('0x95')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x96'));db['AnalyticDefaultReport']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x97'));db[_0x13cd('0x98')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x99'));db[_0x13cd('0x9a')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x9b'));db['AnalyticFieldReport']=db['sequelize'][_0x13cd('0x14')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x13cd('0x9c')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x9d'));db[_0x13cd('0x9e')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x9f'));db['SalesforceConfiguration']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xa0'));db[_0x13cd('0xa1')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xa2'));db[_0x13cd('0xa3')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xa4'));db['SugarcrmConfiguration']=db['sequelize'][_0x13cd('0x14')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x13cd('0xa5')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xa6'));db[_0x13cd('0xa7')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xa8'));db['DeskField']=db[_0x13cd('0x0')]['import'](_0x13cd('0xa9'));db[_0x13cd('0xaa')]=db[_0x13cd('0x0')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0x13cd('0xab')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xac'));db[_0x13cd('0xad')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/intZohoField/intZohoField.model');db[_0x13cd('0xae')]=db[_0x13cd('0x0')]['import'](_0x13cd('0xaf'));db['ZendeskConfiguration']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xb0'));db[_0x13cd('0xb1')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xb2'));db['FreshdeskAccount']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xb3'));db[_0x13cd('0xb4')]=db[_0x13cd('0x0')]['import'](_0x13cd('0xb5'));db[_0x13cd('0xb6')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x13cd('0xb7')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xb8'));db[_0x13cd('0xb9')]=db[_0x13cd('0x0')]['import'](_0x13cd('0xba'));db['VtigerField']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xbb'));db[_0x13cd('0xbc')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xbd'));db[_0x13cd('0xbe')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xbf'));db['ServicenowField']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xc0'));db[_0x13cd('0xc1')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x13cd('0xc2')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xc3'));db['Dynamics365Field']=db[_0x13cd('0x0')]['import'](_0x13cd('0xc4'));db['FreshsalesAccount']=db[_0x13cd('0x0')]['import'](_0x13cd('0xc5'));db[_0x13cd('0xc6')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xc7'));db[_0x13cd('0xc8')]=db[_0x13cd('0x0')]['import'](_0x13cd('0xc9'));db['Integration']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x93'));db[_0x13cd('0xca')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xcb'));db['ChatQueueReport']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xcc'));db[_0x13cd('0xcd')]=db['sequelize']['import'](_0x13cd('0xce'));db[_0x13cd('0xcf')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xd0'));db[_0x13cd('0xd1')]=db[_0x13cd('0x0')]['import'](_0x13cd('0xd2'));db[_0x13cd('0xd3')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xd4'));db[_0x13cd('0xd5')]=db['sequelize']['import'](_0x13cd('0xd6'));db[_0x13cd('0xd7')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xd8'));db[_0x13cd('0xd9')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xda'));db[_0x13cd('0xdb')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xdc'));db[_0x13cd('0xdd')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xde'));db['SquareOdbc']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xdf'));db[_0x13cd('0xe0')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xe1'));db[_0x13cd('0xe2')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xe3'));db[_0x13cd('0xe4')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/squareMessage/squareMessage.model');db[_0x13cd('0xe5')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/team/team.model');db[_0x13cd('0xe6')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/license/license.model');db[_0x13cd('0xe7')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xe8'));db[_0x13cd('0xe9')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/migration/migration.model');db[_0x13cd('0xea')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xeb'));db[_0x13cd('0xec')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/plugin/plugin.model');db[_0x13cd('0xed')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xee'));db['ChatTransferReport']=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x13cd('0xef')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xf0'));db['OpenchannelTransferReport']=db[_0x13cd('0x0')]['import'](_0x13cd('0xf1'));db[_0x13cd('0xf2')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xf3'));db[_0x13cd('0xf4')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xf5'));db['VoicePrefix']=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xf6'));db[_0x13cd('0xf7')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0x13cd('0xf8')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0xf9'));db[_0x13cd('0xfa')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xfb'));db['UserNotification']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0xfc'));db[_0x13cd('0xfd')]=db['sequelize']['import'](_0x13cd('0xfe'));db['WhatsappApplication']=db[_0x13cd('0x0')]['import'](_0x13cd('0xff'));db[_0x13cd('0x100')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0x13cd('0x101')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x102'));db[_0x13cd('0x103')]=db['sequelize'][_0x13cd('0x14')](_0x13cd('0x104'));db[_0x13cd('0x105')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x106'));db[_0x13cd('0x107')]=db[_0x13cd('0x0')][_0x13cd('0x14')]('../api/whatsappQueue/whatsappQueue.model');db[_0x13cd('0x108')]=db[_0x13cd('0x0')]['import'](_0x13cd('0x109'));db[_0x13cd('0x10a')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x10b'));db['TeamVoicePrefix']=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x10c'));db[_0x13cd('0x10d')]=db[_0x13cd('0x0')][_0x13cd('0x14')](_0x13cd('0x10e'));db[_0x13cd('0x13')][_0x13cd('0x10f')](db[_0x13cd('0x110')],{'as':_0x13cd('0x110'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x112')});db['User']['hasMany'](db[_0x13cd('0x1d')],{'as':_0x13cd('0x113'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')]['hasMany'](db[_0x13cd('0x2d')],{'as':_0x13cd('0x114'),'foreignKey':_0x13cd('0x112')});db['User'][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':_0x13cd('0x116'),'onDelete':'cascade','hooks':!![]});db[_0x13cd('0x13')][_0x13cd('0x115')](db[_0x13cd('0x117')],{'as':_0x13cd('0x118'),'foreignKey':'UserId'});db['User'][_0x13cd('0x115')](db[_0x13cd('0x76')],{'as':_0x13cd('0x119'),'foreignKey':_0x13cd('0x112')});db['User'][_0x13cd('0x115')](db[_0x13cd('0x78')],{'as':_0x13cd('0x78'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x13cd('0x11a'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')]['hasMany'](db[_0x13cd('0x66')],{'as':_0x13cd('0x11b'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')][_0x13cd('0x115')](db['SmsInteraction'],{'as':_0x13cd('0x11c'),'foreignKey':'UserId'});db['User'][_0x13cd('0x115')](db[_0x13cd('0x4b')],{'as':_0x13cd('0x11d'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')][_0x13cd('0x115')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x13cd('0x112')});db[_0x13cd('0x13')][_0x13cd('0x115')](db[_0x13cd('0x100')],{'as':_0x13cd('0x11e'),'foreignKey':_0x13cd('0x112')});db['User'][_0x13cd('0x115')](db['UserNotification'],{'as':_0x13cd('0x11f'),'foreignKey':'SenderId'});db['User'][_0x13cd('0x120')](db[_0x13cd('0xf7')],{'as':_0x13cd('0xf7'),'foreignKey':_0x13cd('0x121')});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x6d')],{'as':'Groups','through':_0x13cd('0x123')});db[_0x13cd('0x13')][_0x13cd('0x122')](db['CmContact'],{'as':_0x13cd('0x124'),'through':_0x13cd('0x125')});db['User'][_0x13cd('0x122')](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db['User'][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':_0x13cd('0x126')});db[_0x13cd('0x13')]['belongsToMany'](db[_0x13cd('0x40')],{'as':_0x13cd('0x127'),'through':_0x13cd('0x128')});db['User'][_0x13cd('0x122')](db[_0x13cd('0x66')],{'as':_0x13cd('0x11b'),'through':_0x13cd('0x129')});db[_0x13cd('0x13')]['belongsToMany'](db[_0x13cd('0x4b')],{'as':_0x13cd('0x11d'),'through':'user_has_fax_interactions'});db['User']['belongsToMany'](db[_0x13cd('0x54')],{'as':_0x13cd('0x11c'),'through':_0x13cd('0x12a')});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x5a')],{'as':_0x13cd('0x11a'),'through':'user_has_openchannel_interactions'});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x100')],{'as':'WhatsappInteractions','through':'user_has_whatsapp_interactions'});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x12b')],{'as':_0x13cd('0x12c'),'through':_0x13cd('0x2f'),'required':![]});db['User'][_0x13cd('0x122')](db[_0x13cd('0x12d')],{'as':_0x13cd('0x12e'),'through':'UserVoicePrefix','required':![]});db[_0x13cd('0x13')][_0x13cd('0x122')](db['MailQueue'],{'as':_0x13cd('0x12f'),'through':_0x13cd('0x130'),'required':![]});db['User'][_0x13cd('0x122')](db[_0x13cd('0x6b')],{'as':_0x13cd('0x131'),'through':_0x13cd('0x31'),'required':![],'hooks':!![]});db[_0x13cd('0x13')][_0x13cd('0x122')](db['FaxQueue'],{'as':'FaxQueues','through':_0x13cd('0x132'),'required':![]});db['User'][_0x13cd('0x122')](db[_0x13cd('0x56')],{'as':_0x13cd('0x133'),'through':_0x13cd('0x34'),'required':![]});db[_0x13cd('0x13')]['belongsToMany'](db[_0x13cd('0x5e')],{'as':_0x13cd('0x134'),'through':_0x13cd('0x36'),'required':![]});db['User'][_0x13cd('0x122')](db[_0x13cd('0x107')],{'as':_0x13cd('0x135'),'through':_0x13cd('0x38'),'required':![]});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0xf4')],{'through':_0x13cd('0x136')});db[_0x13cd('0x13')]['belongsToMany'](db[_0x13cd('0x60')],{'as':_0x13cd('0x137'),'through':_0x13cd('0x138')});db[_0x13cd('0x13')]['belongsToMany'](db[_0x13cd('0x49')],{'as':_0x13cd('0x139'),'through':_0x13cd('0x13a')});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x3c')],{'as':_0x13cd('0x13b'),'through':_0x13cd('0x13c')});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x57')],{'as':'OpenchannelAccounts','through':_0x13cd('0x13d')});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0x51')],{'as':_0x13cd('0x13e'),'through':'user_has_sms_accounts'});db[_0x13cd('0x13')][_0x13cd('0x122')](db[_0x13cd('0xfd')],{'as':'WhatsappAccounts','through':_0x13cd('0x13f')});db[_0x13cd('0x13')][_0x13cd('0x122')](db['SquareProject'],{'as':_0x13cd('0x140'),'through':_0x13cd('0x141')});db[_0x13cd('0x142')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':_0x13cd('0x143'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x144')});db[_0x13cd('0x17')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'onDelete':_0x13cd('0x111')});db[_0x13cd('0x19')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':_0x13cd('0x145'),'onDelete':'cascade'});db[_0x13cd('0x1a')][_0x13cd('0x122')](db[_0x13cd('0x8b')],{'as':_0x13cd('0x146'),'through':_0x13cd('0x147')});db['VoiceQueue']['hasMany'](db[_0x13cd('0x2d')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0x13cd('0x71')],{'as':_0x13cd('0x148'),'foreignKey':'VoiceQueueId'});db[_0x13cd('0x12b')]['hasMany'](db[_0x13cd('0x117')],{'as':_0x13cd('0x118'),'foreignKey':'VoiceQueueId'});db[_0x13cd('0x12b')][_0x13cd('0x115')](db[_0x13cd('0x76')],{'as':'HopperHistories','foreignKey':_0x13cd('0x149')});db[_0x13cd('0x12b')][_0x13cd('0x115')](db[_0x13cd('0x78')],{'as':'ReportAgentPreview','foreignKey':_0x13cd('0x149')});db[_0x13cd('0x12b')][_0x13cd('0x115')](db[_0x13cd('0x73')],{'as':_0x13cd('0x14a'),'foreignKey':_0x13cd('0x149')});db[_0x13cd('0x12b')][_0x13cd('0x115')](db[_0x13cd('0xd3')],{'as':_0x13cd('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x13cd('0x12b')][_0x13cd('0x120')](db[_0x13cd('0x2b')],{'as':_0x13cd('0x2b'),'foreignKey':_0x13cd('0x14c')});db[_0x13cd('0x12b')][_0x13cd('0x120')](db[_0x13cd('0x2b')],{'as':'TrunkBackup','foreignKey':'TrunkBackupId'});db[_0x13cd('0x12b')][_0x13cd('0x120')](db['Interval'],{'as':_0x13cd('0x85'),'foreignKey':_0x13cd('0x14d')});db[_0x13cd('0x12b')]['belongsTo'](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x12b')][_0x13cd('0x122')](db[_0x13cd('0xf4')],{'as':'Lists','through':'voice_queues_has_cm_lists'});db[_0x13cd('0x12b')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x2f')});db[_0x13cd('0x12b')]['belongsToMany'](db[_0x13cd('0xe5')],{'as':_0x13cd('0x150'),'through':_0x13cd('0x10a')});db[_0x13cd('0x12b')][_0x13cd('0x122')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x151'),'through':_0x13cd('0x152')});db[_0x13cd('0x1d')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x13'),'foreignKey':'UserId'});db[_0x13cd('0x1f')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x13'),'foreignKey':'UserId'});db[_0x13cd('0x110')][_0x13cd('0x115')](db[_0x13cd('0x22')],{'as':'Messages','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x153'),'sourceKey':_0x13cd('0x154')});db['VoiceMailMessage']['belongsTo'](db[_0x13cd('0x110')],{'foreignKey':'mailboxuser','targetKey':_0x13cd('0x154')});db['VoiceCallReport']['hasMany'](db[_0x13cd('0x28')],{'as':_0x13cd('0x155'),'foreignKey':_0x13cd('0x156'),'constraints':![]});db['VoiceCallReport'][_0x13cd('0x115')](db[_0x13cd('0x157')],{'as':_0x13cd('0x158'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x13cd('0x13')],{'as':_0x13cd('0x13'),'foreignKey':'UserId'});db[_0x13cd('0x24')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x15c')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{'as':'MailAccount','foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x15c')]['belongsTo'](db[_0x13cd('0x108')],{'as':_0x13cd('0x108'),'foreignKey':_0x13cd('0x15e'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x160')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{'as':_0x13cd('0x3c'),'foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x160')][_0x13cd('0x120')](db['CloudProvider'],{'as':_0x13cd('0x108'),'foreignKey':_0x13cd('0x15e'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x3c')][_0x13cd('0x10f')](db[_0x13cd('0x15c')],{'as':'Imap','onDelete':_0x13cd('0x111')});db['MailAccount'][_0x13cd('0x10f')](db['MailServerOut'],{'as':_0x13cd('0x161'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x3c')][_0x13cd('0x115')](db['Disposition'],{'as':'Dispositions','foreignKey':_0x13cd('0x15d'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x3c')][_0x13cd('0x115')](db[_0x13cd('0x162')],{'as':_0x13cd('0x163'),'foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x3c')][_0x13cd('0x115')](db[_0x13cd('0x42')],{'as':_0x13cd('0x164'),'foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x3c')][_0x13cd('0x115')](db[_0x13cd('0x40')],{'as':_0x13cd('0x165')});db['MailAccount'][_0x13cd('0x115')](db[_0x13cd('0x44')],{'as':_0x13cd('0x145')});db[_0x13cd('0x3c')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':'List','foreignKey':_0x13cd('0x166')});db['MailAccount']['belongsTo'](db[_0x13cd('0x167')],{'as':_0x13cd('0x167'),'foreignKey':'TemplateId'});db[_0x13cd('0x3c')][_0x13cd('0x120')](db[_0x13cd('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x3c')]['belongsToMany'](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x13c')});db[_0x13cd('0x3e')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':'Agents','through':_0x13cd('0x130')});db['MailQueue'][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':'team_has_mail_queues','as':_0x13cd('0x150')});db[_0x13cd('0x40')][_0x13cd('0x115')](db[_0x13cd('0x42')],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x168')});db[_0x13cd('0x40')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{'as':_0x13cd('0x169'),'foreignKey':'MailAccountId'});db[_0x13cd('0x40')][_0x13cd('0x120')](db['CmContact'],{'as':_0x13cd('0x15a'),'foreignKey':'ContactId'});db[_0x13cd('0x40')]['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x13cd('0x112')});db['MailInteraction']['belongsToMany'](db[_0x13cd('0x8d')],{'through':'mail_interaction_has_tags','as':'Tags'});db['MailInteraction'][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x16a'),'as':'ThroughTags'});db[_0x13cd('0x40')]['belongsToMany'](db['User'],{'as':_0x13cd('0x16b'),'through':'user_has_mail_interactions','foreignKey':_0x13cd('0x168')});db[_0x13cd('0x42')][_0x13cd('0x115')](db['Attachment'],{'as':_0x13cd('0x16c'),'onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x13cd('0x13')],{'as':_0x13cd('0x13')});db[_0x13cd('0x42')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x15a')});db['MailMessage']['belongsTo'](db['MailInteraction'],{'as':_0x13cd('0x16d'),'foreignKey':_0x13cd('0x168')});db[_0x13cd('0x42')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x42')][_0x13cd('0x120')](db[_0x13cd('0x60')],{'as':'ChatWebsite','foreignKey':_0x13cd('0x16e')});db[_0x13cd('0x42')][_0x13cd('0x120')](db[_0x13cd('0x69')],{'as':_0x13cd('0x69'),'foreignKey':_0x13cd('0x16f')});db['MailApplication']['belongsTo'](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x15f')});db['MailApplication'][_0x13cd('0x120')](db[_0x13cd('0x3e')],{'onDelete':'restrict'});db[_0x13cd('0x44')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{'onDelete':'restrict'});db[_0x13cd('0x44')]['belongsTo'](db[_0x13cd('0x85')],{'onDelete':_0x13cd('0x15f'),'foreignKey':_0x13cd('0x14d')});db[_0x13cd('0x44')][_0x13cd('0x120')](db[_0x13cd('0x8d')],{'onDelete':_0x13cd('0x15f'),'foreignKey':_0x13cd('0x170')});db[_0x13cd('0x46')]['belongsTo'](db[_0x13cd('0x3c')],{});db[_0x13cd('0x46')]['belongsTo'](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':'ListId'});db[_0x13cd('0x46')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x46')][_0x13cd('0x120')](db[_0x13cd('0x40')],{});db['MailQueueReport'][_0x13cd('0x120')](db['MailMessage'],{});db['MailQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x13')],{});db['MailQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x3e')],{});db[_0x13cd('0x172')][_0x13cd('0x115')](db[_0x13cd('0x173')],{'as':'Items','onDelete':_0x13cd('0x111')});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x81')],{'as':_0x13cd('0x174'),'foreignKey':_0x13cd('0x175'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x162')],{'as':_0x13cd('0x163'),'foreignKey':_0x13cd('0x175')});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x4b')],{'as':_0x13cd('0x165')});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x176')],{'as':'Applications'});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':_0x13cd('0x177'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x49')][_0x13cd('0x115')](db[_0x13cd('0x4c')],{'as':_0x13cd('0x164')});db[_0x13cd('0x49')][_0x13cd('0x120')](db[_0x13cd('0x2b')],{'as':_0x13cd('0x2b')});db[_0x13cd('0x49')][_0x13cd('0x120')](db['CmList'],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166')});db['FaxAccount'][_0x13cd('0x120')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x49')]['belongsToMany'](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x13a')});db[_0x13cd('0x176')][_0x13cd('0x120')](db['User'],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x176')]['belongsTo'](db['FaxQueue'],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x176')][_0x13cd('0x120')](db[_0x13cd('0x49')],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x176')]['belongsTo'](db[_0x13cd('0x8d')],{'onDelete':'restrict','foreignKey':_0x13cd('0x170')});db['FaxInteraction'][_0x13cd('0x115')](db[_0x13cd('0x4c')],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':'FaxInteractionId'});db[_0x13cd('0x4b')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':_0x13cd('0x175')});db['FaxInteraction'][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':'Contact','foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x4b')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x178'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x4b')][_0x13cd('0x122')](db['Tag'],{'through':_0x13cd('0x179'),'as':_0x13cd('0x17a')});db['FaxInteraction'][_0x13cd('0x122')](db['Tag'],{'through':'fax_interaction_has_tags','as':_0x13cd('0x17b')});db['FaxInteraction'][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x16b'),'through':_0x13cd('0x17c'),'foreignKey':'FaxInteractionId'});db[_0x13cd('0x4c')][_0x13cd('0x120')](db['User'],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x13')});db[_0x13cd('0x4c')][_0x13cd('0x120')](db[_0x13cd('0x4b')],{'as':_0x13cd('0x16d'),'foreignKey':_0x13cd('0x17d')});db[_0x13cd('0x4c')]['belongsTo'](db[_0x13cd('0x159')],{'onDelete':_0x13cd('0x111'),'as':'Contact'});db[_0x13cd('0x4c')][_0x13cd('0x120')](db[_0x13cd('0xea')],{'as':_0x13cd('0xea'),'foreignKey':'AttachmentId'});db['FaxMessage'][_0x13cd('0x120')](db[_0x13cd('0x49')],{'as':'Account','foreignKey':_0x13cd('0x175')});db[_0x13cd('0x4d')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x132')});db[_0x13cd('0x4d')][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':_0x13cd('0x17e'),'as':_0x13cd('0x150')});db[_0x13cd('0x4f')]['belongsTo'](db[_0x13cd('0x49')],{});db[_0x13cd('0x4f')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':'ListId'});db[_0x13cd('0x4f')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x4f')][_0x13cd('0x120')](db[_0x13cd('0x4b')],{});db[_0x13cd('0x4f')][_0x13cd('0x120')](db[_0x13cd('0x4c')],{});db[_0x13cd('0x4f')][_0x13cd('0x120')](db[_0x13cd('0x13')],{});db['FaxQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x4d')],{});db[_0x13cd('0x51')][_0x13cd('0x115')](db[_0x13cd('0x81')],{'as':_0x13cd('0x174'),'foreignKey':_0x13cd('0x17f'),'onDelete':'cascade'});db['SmsAccount'][_0x13cd('0x115')](db[_0x13cd('0x162')],{'as':'Answers','foreignKey':_0x13cd('0x17f')});db[_0x13cd('0x51')][_0x13cd('0x115')](db[_0x13cd('0x180')],{'as':_0x13cd('0x164'),'foreignKey':_0x13cd('0x17f')});db[_0x13cd('0x51')][_0x13cd('0x115')](db[_0x13cd('0x54')],{'as':_0x13cd('0x165')});db[_0x13cd('0x51')][_0x13cd('0x115')](db[_0x13cd('0x53')],{'as':'Applications'});db['SmsAccount']['belongsTo'](db['CmList'],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0x51')][_0x13cd('0x120')](db[_0x13cd('0x87')],{'as':_0x13cd('0x181'),'foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x51')]['belongsToMany'](db[_0x13cd('0x13')],{'as':'Agents','through':_0x13cd('0x182')});db[_0x13cd('0x53')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x53')][_0x13cd('0x120')](db['SmsQueue'],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x53')][_0x13cd('0x120')](db[_0x13cd('0x51')],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x53')][_0x13cd('0x120')](db[_0x13cd('0x85')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x13cd('0x53')][_0x13cd('0x120')](db[_0x13cd('0x8d')],{'onDelete':_0x13cd('0x15f'),'foreignKey':'TagId'});db[_0x13cd('0x54')][_0x13cd('0x115')](db['SmsMessage'],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':'SmsInteractionId'});db['SmsInteraction'][_0x13cd('0x120')](db['SmsAccount'],{'as':'Account','foreignKey':_0x13cd('0x17f')});db[_0x13cd('0x54')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db['SmsInteraction'][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x178'),'foreignKey':_0x13cd('0x112')});db['SmsInteraction'][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x183'),'as':_0x13cd('0x17a')});db[_0x13cd('0x54')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db[_0x13cd('0x54')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x16b'),'through':_0x13cd('0x12a'),'foreignKey':_0x13cd('0x184')});db[_0x13cd('0x180')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x13')});db[_0x13cd('0x180')]['belongsTo'](db[_0x13cd('0x159')],{'onDelete':_0x13cd('0x111'),'as':'Contact'});db['SmsMessage'][_0x13cd('0x120')](db['SmsInteraction'],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x16d'),'foreignKey':'SmsInteractionId'});db[_0x13cd('0x180')]['belongsTo'](db['SmsAccount'],{'as':_0x13cd('0x169'),'foreignKey':'SmsAccountId'});db[_0x13cd('0x56')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':'UserSmsQueue','foreignKey':_0x13cd('0x185')});db[_0x13cd('0x56')][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':_0x13cd('0x186'),'as':_0x13cd('0x150')});db['OpenchannelAccount'][_0x13cd('0x115')](db[_0x13cd('0x81')],{'as':'Dispositions','foreignKey':'OpenchannelAccountId','onDelete':_0x13cd('0x111')});db[_0x13cd('0x57')][_0x13cd('0x115')](db[_0x13cd('0x162')],{'as':_0x13cd('0x163'),'foreignKey':_0x13cd('0x187')});db[_0x13cd('0x57')][_0x13cd('0x115')](db[_0x13cd('0x5a')],{'as':_0x13cd('0x165'),'foreignKey':_0x13cd('0x187')});db['OpenchannelAccount'][_0x13cd('0x115')](db[_0x13cd('0x5c')],{'as':_0x13cd('0x164'),'foreignKey':_0x13cd('0x187')});db[_0x13cd('0x57')][_0x13cd('0x115')](db[_0x13cd('0x58')],{'as':'Applications','foreignKey':_0x13cd('0x187')});db[_0x13cd('0x57')]['belongsTo'](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':'ListId'});db[_0x13cd('0x57')][_0x13cd('0x120')](db[_0x13cd('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x57')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':'Agents','through':'user_has_openchannel_accounts'});db[_0x13cd('0x58')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x15f')});db['OpenchannelApplication'][_0x13cd('0x120')](db[_0x13cd('0x5e')],{'onDelete':_0x13cd('0x15f'),'foreignKey':_0x13cd('0x188')});db['OpenchannelApplication'][_0x13cd('0x120')](db[_0x13cd('0x57')],{'onDelete':_0x13cd('0x15f'),'foreignKey':'OpenchannelAccountId'});db[_0x13cd('0x58')][_0x13cd('0x120')](db[_0x13cd('0x85')],{'onDelete':_0x13cd('0x15f'),'foreignKey':'IntervalId'});db[_0x13cd('0x58')][_0x13cd('0x120')](db[_0x13cd('0x8d')],{'onDelete':_0x13cd('0x15f'),'foreignKey':'TagId'});db[_0x13cd('0x5a')][_0x13cd('0x115')](db[_0x13cd('0x5c')],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x189')});db[_0x13cd('0x5a')][_0x13cd('0x120')](db[_0x13cd('0x57')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x187')});db[_0x13cd('0x5a')]['belongsTo'](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':'ContactId'});db[_0x13cd('0x5a')]['belongsTo'](db[_0x13cd('0x13')],{'as':_0x13cd('0x178'),'foreignKey':'UserId'});db['OpenchannelInteraction'][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x18a'),'as':_0x13cd('0x17a')});db[_0x13cd('0x5a')]['belongsToMany'](db[_0x13cd('0x8d')],{'through':_0x13cd('0x18a'),'as':_0x13cd('0x17b')});db[_0x13cd('0x5a')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x16b'),'through':_0x13cd('0x18b'),'foreignKey':_0x13cd('0x189')});db[_0x13cd('0x5c')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x111'),'as':'User'});db[_0x13cd('0x5c')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'onDelete':'cascade','as':_0x13cd('0x15a')});db[_0x13cd('0x5c')][_0x13cd('0x120')](db[_0x13cd('0x5a')],{'onDelete':'cascade','as':_0x13cd('0x16d'),'foreignKey':_0x13cd('0x189')});db['OpenchannelMessage'][_0x13cd('0x120')](db['Attachment'],{'as':'Attachment','foreignKey':_0x13cd('0x18c')});db['OpenchannelMessage'][_0x13cd('0x120')](db[_0x13cd('0x57')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x187')});db['OpenchannelQueue'][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x36'),'foreignKey':'OpenchannelQueueId'});db[_0x13cd('0x5e')][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':_0x13cd('0x18d'),'as':_0x13cd('0x150')});db[_0x13cd('0x60')][_0x13cd('0x115')](db['Disposition'],{'as':_0x13cd('0x174'),'foreignKey':_0x13cd('0x16e'),'onDelete':'cascade'});db[_0x13cd('0x60')]['hasMany'](db[_0x13cd('0x162')],{'as':'Answers','foreignKey':_0x13cd('0x16e')});db[_0x13cd('0x60')][_0x13cd('0x115')](db[_0x13cd('0x18e')],{'as':_0x13cd('0x18f')});db[_0x13cd('0x60')][_0x13cd('0x115')](db[_0x13cd('0x66')],{'as':_0x13cd('0x165')});db[_0x13cd('0x60')][_0x13cd('0x115')](db[_0x13cd('0x64')],{'as':_0x13cd('0x145')});db[_0x13cd('0x60')][_0x13cd('0x115')](db[_0x13cd('0x68')],{'as':_0x13cd('0x164')});db[_0x13cd('0x60')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':'ListId'});db[_0x13cd('0x60')]['belongsTo'](db[_0x13cd('0x85')],{'as':_0x13cd('0x85'),'foreignKey':'IntervalId'});db['ChatWebsite'][_0x13cd('0x120')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0x13cd('0x15d')});db[_0x13cd('0x60')][_0x13cd('0x120')](db['Pause'],{'as':_0x13cd('0x181'),'foreignKey':_0x13cd('0x14e')});db[_0x13cd('0x60')]['belongsToMany'](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x138')});db[_0x13cd('0x62')]['belongsTo'](db['OpenchannelAccount'],{});db[_0x13cd('0x62')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166')});db['OpenchannelQueueReport']['belongsTo'](db[_0x13cd('0x159')],{'as':'Contact','foreignKey':'ContactId'});db[_0x13cd('0x62')][_0x13cd('0x120')](db[_0x13cd('0x5a')],{});db[_0x13cd('0x62')]['belongsTo'](db[_0x13cd('0x5c')],{});db[_0x13cd('0x62')][_0x13cd('0x120')](db[_0x13cd('0x13')],{});db[_0x13cd('0x62')][_0x13cd('0x120')](db['OpenchannelQueue'],{});db[_0x13cd('0x64')]['belongsTo'](db[_0x13cd('0x13')],{'as':'Agent','foreignKey':_0x13cd('0x112'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x64')]['belongsTo'](db[_0x13cd('0x6b')],{'as':_0x13cd('0x190'),'foreignKey':'ChatQueueId','onDelete':_0x13cd('0x15f')});db['ChatApplication'][_0x13cd('0x120')](db[_0x13cd('0x60')],{'as':_0x13cd('0x191'),'foreignKey':_0x13cd('0x16e'),'onDelete':_0x13cd('0x15f')});db['ChatApplication'][_0x13cd('0x120')](db[_0x13cd('0x8d')],{'onDelete':'restrict','foreignKey':_0x13cd('0x170')});db[_0x13cd('0x66')][_0x13cd('0x115')](db[_0x13cd('0x68')],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x192')});db[_0x13cd('0x66')][_0x13cd('0x120')](db[_0x13cd('0x60')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x16e')});db[_0x13cd('0x66')]['belongsTo'](db['CmContact'],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x66')]['belongsTo'](db[_0x13cd('0x13')],{'as':'Owner','foreignKey':_0x13cd('0x112')});db[_0x13cd('0x66')][_0x13cd('0x122')](db['Tag'],{'through':_0x13cd('0x193'),'as':_0x13cd('0x17a')});db['ChatInteraction'][_0x13cd('0x122')](db['Tag'],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0x13cd('0x66')][_0x13cd('0x122')](db['User'],{'as':_0x13cd('0x16b'),'through':_0x13cd('0x129'),'foreignKey':_0x13cd('0x192')});db[_0x13cd('0x68')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x111'),'as':'User'});db[_0x13cd('0x68')]['belongsTo'](db[_0x13cd('0x159')],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x68')][_0x13cd('0x120')](db[_0x13cd('0x66')],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x16d'),'foreignKey':_0x13cd('0x192')});db[_0x13cd('0x68')][_0x13cd('0x120')](db['Attachment'],{'as':_0x13cd('0xea'),'foreignKey':_0x13cd('0x18c')});db[_0x13cd('0x68')][_0x13cd('0x120')](db[_0x13cd('0x60')],{'as':_0x13cd('0x169'),'foreignKey':'ChatWebsiteId'});db[_0x13cd('0x69')][_0x13cd('0x115')](db[_0x13cd('0xea')],{'as':'Attachments','foreignKey':_0x13cd('0x16f'),'onDelete':_0x13cd('0x111'),'hooks':!![]});db[_0x13cd('0x69')]['belongsTo'](db[_0x13cd('0x159')],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x69')][_0x13cd('0x120')](db['ChatWebsite'],{'as':'Account','foreignKey':_0x13cd('0x16e')});db[_0x13cd('0x6b')][_0x13cd('0x122')](db['User'],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x31'),'hooks':!![]});db[_0x13cd('0x6b')]['belongsToMany'](db['Team'],{'through':_0x13cd('0x194'),'as':_0x13cd('0x150')});db[_0x13cd('0x6d')]['hasMany'](db[_0x13cd('0xcd')],{'as':_0x13cd('0x164'),'foreignKey':_0x13cd('0x195'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x6d')][_0x13cd('0x122')](db['User'],{'as':_0x13cd('0x196'),'through':_0x13cd('0x123')});db['ChatProactiveAction'][_0x13cd('0x120')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId'});db[_0x13cd('0x6f')][_0x13cd('0x115')](db[_0x13cd('0x159')],{'as':_0x13cd('0x124'),'foreignKey':_0x13cd('0x197')});db[_0x13cd('0x159')][_0x13cd('0x115')](db[_0x13cd('0x71')],{'as':_0x13cd('0x148'),'foreignKey':'ContactId'});db['CmContact']['hasMany'](db['CmHopperFinal'],{'as':_0x13cd('0x118'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x159')]['hasMany'](db[_0x13cd('0x76')],{'as':_0x13cd('0x198'),'foreignKey':'ContactId'});db['CmContact'][_0x13cd('0x115')](db[_0x13cd('0x78')],{'as':_0x13cd('0x78'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x159')]['hasMany'](db[_0x13cd('0xd3')],{'as':_0x13cd('0x14b'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x159')][_0x13cd('0x115')](db['OpenchannelInteraction'],{'as':_0x13cd('0x11a'),'foreignKey':_0x13cd('0x15b'),'onDelete':'restrict'});db[_0x13cd('0x159')][_0x13cd('0x115')](db['ChatInteraction'],{'as':_0x13cd('0x11b'),'foreignKey':_0x13cd('0x15b'),'onDelete':'restrict'});db[_0x13cd('0x159')][_0x13cd('0x115')](db[_0x13cd('0x54')],{'as':'SmsInteractions','foreignKey':_0x13cd('0x15b'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x159')][_0x13cd('0x115')](db['FaxInteraction'],{'as':_0x13cd('0x11d'),'foreignKey':_0x13cd('0x15b'),'onDelete':'restrict'});db[_0x13cd('0x159')][_0x13cd('0x115')](db['MailInteraction'],{'as':'MailInteractions','foreignKey':_0x13cd('0x15b'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x159')][_0x13cd('0x120')](db[_0x13cd('0x6f')],{'as':'Company','foreignKey':_0x13cd('0x197')});db[_0x13cd('0x159')][_0x13cd('0x120')](db['CmList'],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166'),'onDelete':'cascade'});db[_0x13cd('0x159')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':'Users','through':_0x13cd('0x125')});db[_0x13cd('0x159')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'as':_0x13cd('0x17a'),'through':_0x13cd('0x199')});db[_0x13cd('0x159')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x199'),'as':_0x13cd('0x17b')});db[_0x13cd('0x71')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x71')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166'),'onDelete':_0x13cd('0x111')});db['CmHopper'][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x19a'),'foreignKey':_0x13cd('0x112')});db['CmHopper'][_0x13cd('0x120')](db[_0x13cd('0x12b')],{'as':'Queue','foreignKey':_0x13cd('0x149'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x71')][_0x13cd('0x120')](db[_0x13cd('0xe7')],{'as':_0x13cd('0xe7'),'foreignKey':'CampaignId','onDelete':'cascade'});db[_0x13cd('0x71')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'as':_0x13cd('0x178'),'foreignKey':_0x13cd('0x19b')});db['CmHopperBlack'][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b'),'onDelete':'cascade'});db[_0x13cd('0x73')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':'List','foreignKey':_0x13cd('0x166'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x73')]['belongsTo'](db['VoiceQueue'],{'as':_0x13cd('0x190'),'foreignKey':'VoiceQueueId','onDelete':_0x13cd('0x111')});db['CmHopperBlack'][_0x13cd('0x120')](db['Campaign'],{'as':_0x13cd('0xe7'),'foreignKey':'CampaignId','onDelete':_0x13cd('0x111')});db['Automation'][_0x13cd('0x115')](db[_0x13cd('0x83')],{'as':{'plural':_0x13cd('0x19c'),'singular':_0x13cd('0x19d')},'foreignKey':_0x13cd('0x19e'),'onDelete':_0x13cd('0x111'),'hooks':!![]});db[_0x13cd('0x7e')][_0x13cd('0x115')](db[_0x13cd('0x83')],{'as':{'plural':_0x13cd('0x19f'),'singular':_0x13cd('0x1a0')},'foreignKey':_0x13cd('0x1a1'),'onDelete':_0x13cd('0x111'),'hooks':!![]});db[_0x13cd('0x7e')]['hasMany'](db[_0x13cd('0x7c')],{'as':_0x13cd('0x1a2'),'foreignKey':'AutomationId','onDelete':'cascade','hooks':!![]});db['Disposition'][_0x13cd('0x115')](db[_0x13cd('0x81')],{'as':_0x13cd('0x174'),'foreignKey':_0x13cd('0x1a3'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0x85')]['hasMany'](db[_0x13cd('0x85')],{'as':'Intervals','foreignKey':_0x13cd('0x14d'),'onDelete':_0x13cd('0x111'),'hooks':!![],'required':![]});db[_0x13cd('0x85')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':_0x13cd('0x116'),'foreignKey':'IntervalId','onDelete':'restrict'});db[_0x13cd('0x85')]['hasMany'](db[_0x13cd('0x44')],{'as':_0x13cd('0x1a4'),'foreignKey':_0x13cd('0x14d')});db['Interval'][_0x13cd('0x115')](db[_0x13cd('0x64')],{'as':_0x13cd('0x1a5'),'foreignKey':_0x13cd('0x14d')});db['Interval'][_0x13cd('0x115')](db['FaxApplication'],{'as':'FaxApplications','foreignKey':_0x13cd('0x14d')});db['Interval'][_0x13cd('0x115')](db[_0x13cd('0x53')],{'as':_0x13cd('0x1a6'),'foreignKey':'IntervalId'});db[_0x13cd('0x1a7')][_0x13cd('0x120')](db[_0x13cd('0x3c')],{});db['Schedule'][_0x13cd('0x120')](db[_0x13cd('0x1a8')],{'foreignKey':_0x13cd('0x1a9')});db[_0x13cd('0x1a7')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x13cd('0x1aa')});db[_0x13cd('0x8b')][_0x13cd('0x122')](db[_0x13cd('0x1a')],{'as':_0x13cd('0x1ab'),'through':_0x13cd('0x147'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x8d')]['belongsToMany'](db['CmContact'],{'through':_0x13cd('0x199')});db['Tag']['belongsToMany'](db[_0x13cd('0x66')],{'through':'chat_interaction_has_tags'});db[_0x13cd('0x8d')][_0x13cd('0x122')](db[_0x13cd('0x40')],{'through':'mail_interaction_has_tags'});db[_0x13cd('0x8d')]['belongsToMany'](db[_0x13cd('0x54')],{'through':_0x13cd('0x183')});db[_0x13cd('0x8d')][_0x13cd('0x122')](db[_0x13cd('0x4b')],{'through':_0x13cd('0x179')});db[_0x13cd('0x8d')][_0x13cd('0x122')](db[_0x13cd('0x5a')],{'through':'openchannel_interaction_has_tags'});db[_0x13cd('0x8d')][_0x13cd('0x122')](db['WhatsappInteraction'],{'through':_0x13cd('0x1ac')});db[_0x13cd('0x90')][_0x13cd('0x115')](db[_0x13cd('0x83')],{'as':{'plural':_0x13cd('0x1ad'),'singular':_0x13cd('0x1ae')},'foreignKey':_0x13cd('0x1af'),'onDelete':_0x13cd('0x111'),'hooks':!![]});db['Trigger']['hasMany'](db[_0x13cd('0x83')],{'as':{'plural':_0x13cd('0x1b0'),'singular':'AnyCondition'},'foreignKey':_0x13cd('0x1b1'),'onDelete':_0x13cd('0x111'),'hooks':!![]});db[_0x13cd('0x90')][_0x13cd('0x115')](db[_0x13cd('0x7c')],{'as':'Actions','foreignKey':_0x13cd('0x1b2'),'onDelete':'cascade','hooks':!![]});db[_0x13cd('0x95')][_0x13cd('0x115')](db[_0x13cd('0x1b3')],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':'CustomReportId','hooks':!![]});db[_0x13cd('0x1a8')][_0x13cd('0x115')](db[_0x13cd('0x1b3')],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1a9')});db[_0x13cd('0x9a')][_0x13cd('0x115')](db[_0x13cd('0x1b3')],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':'MetricId'});db['AnalyticFieldReport'][_0x13cd('0x120')](db[_0x13cd('0x9a')],{'foreignKey':'MetricId'});db[_0x13cd('0x9e')][_0x13cd('0x115')](db[_0x13cd('0x1b5')],{'as':'Configurations','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0x1b5')]['hasMany'](db[_0x13cd('0xa1')],{'as':_0x13cd('0x1b7'),'onDelete':_0x13cd('0x111'),'foreignKey':'SubjectId'});db[_0x13cd('0x1b5')][_0x13cd('0x115')](db[_0x13cd('0xa1')],{'as':_0x13cd('0x1b8'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b9')});db['SalesforceConfiguration'][_0x13cd('0x115')](db['SalesforceField'],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':'FieldId'});db[_0x13cd('0x1b5')][_0x13cd('0x120')](db[_0x13cd('0x9e')],{'as':'Account','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xa1')][_0x13cd('0x115')](db[_0x13cd('0xa1')],{'as':_0x13cd('0x1ba'),'foreignKey':'SubjectId'});db[_0x13cd('0xa1')][_0x13cd('0x115')](db[_0x13cd('0xa1')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xa1')][_0x13cd('0x115')](db['SalesforceField'],{'as':'Field','foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xa1')][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db[_0x13cd('0xa3')][_0x13cd('0x115')](db['SugarcrmConfiguration'],{'as':_0x13cd('0x1bf'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0x1c0')]['hasMany'](db['SugarcrmField'],{'as':_0x13cd('0x1b7'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1c1')});db['SugarcrmConfiguration'][_0x13cd('0x115')](db[_0x13cd('0xa5')],{'as':_0x13cd('0x1b8'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0x1c0')][_0x13cd('0x115')](db['SugarcrmField'],{'as':'Fields','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0x1c0')][_0x13cd('0x120')](db[_0x13cd('0xa3')],{'as':'Account','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xa5')]['hasMany'](db[_0x13cd('0xa5')],{'as':_0x13cd('0x1ba'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xa5')][_0x13cd('0x115')](db[_0x13cd('0xa5')],{'as':_0x13cd('0x1bb'),'foreignKey':'DescriptionId'});db[_0x13cd('0xa5')]['hasMany'](db['SugarcrmField'],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xa5')][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':_0x13cd('0x1bd'),'foreignKey':'VariableId'});db['DeskAccount'][_0x13cd('0x115')](db['DeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xa7')][_0x13cd('0x115')](db['DeskField'],{'as':_0x13cd('0x1b7'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x13cd('0xa7')][_0x13cd('0x115')](db[_0x13cd('0x1c3')],{'as':'Descriptions','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xa7')][_0x13cd('0x115')](db[_0x13cd('0x1c3')],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xa7')]['belongsTo'](db[_0x13cd('0x1c4')],{'as':_0x13cd('0x169'),'foreignKey':'AccountId'});db[_0x13cd('0xa7')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x1c5')});db['DeskField'][_0x13cd('0x115')](db[_0x13cd('0x1c3')],{'as':_0x13cd('0x1ba'),'foreignKey':'SubjectId'});db[_0x13cd('0x1c3')][_0x13cd('0x115')](db[_0x13cd('0x1c3')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0x1c3')][_0x13cd('0x115')](db[_0x13cd('0x1c3')],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0x1c3')][_0x13cd('0x120')](db['Variable'],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db['ZohoAccount'][_0x13cd('0x115')](db[_0x13cd('0xab')],{'as':_0x13cd('0x1bf'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xab')][_0x13cd('0x115')](db['ZohoField'],{'as':'Subjects','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1c1')});db['ZohoConfiguration'][_0x13cd('0x115')](db[_0x13cd('0xad')],{'as':_0x13cd('0x1b8'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xab')][_0x13cd('0x115')](db[_0x13cd('0xad')],{'as':'Fields','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1bc')});db['ZohoConfiguration']['belongsTo'](db[_0x13cd('0xaa')],{'as':'Account','foreignKey':'AccountId'});db[_0x13cd('0xad')][_0x13cd('0x115')](db[_0x13cd('0xad')],{'as':_0x13cd('0x1ba'),'foreignKey':'SubjectId'});db[_0x13cd('0xad')][_0x13cd('0x115')](db[_0x13cd('0xad')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db['ZohoField']['hasMany'](db[_0x13cd('0xad')],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db['ZohoField'][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':'Variable','foreignKey':_0x13cd('0x1be')});db[_0x13cd('0xae')][_0x13cd('0x115')](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':'cascade','foreignKey':'AccountId'});db[_0x13cd('0x1c6')][_0x13cd('0x115')](db[_0x13cd('0xb1')],{'as':_0x13cd('0x1b7'),'foreignKey':'SubjectId'});db['ZendeskConfiguration'][_0x13cd('0x115')](db[_0x13cd('0xb1')],{'as':_0x13cd('0x1b8'),'foreignKey':'DescriptionId'});db[_0x13cd('0x1c6')][_0x13cd('0x115')](db[_0x13cd('0xb1')],{'as':_0x13cd('0x1b4'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0x1c6')][_0x13cd('0x120')](db[_0x13cd('0xae')],{'as':_0x13cd('0x169'),'foreignKey':'AccountId'});db[_0x13cd('0x1c6')][_0x13cd('0x122')](db['Tag'],{'through':_0x13cd('0x1c7')});db[_0x13cd('0xb1')][_0x13cd('0x115')](db['ZendeskField'],{'as':_0x13cd('0x1ba'),'foreignKey':'SubjectId'});db[_0x13cd('0xb1')][_0x13cd('0x115')](db[_0x13cd('0xb1')],{'as':'Description','foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xb1')][_0x13cd('0x115')](db['ZendeskField'],{'as':'Field','foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xb1')][_0x13cd('0x120')](db['Variable'],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db['FreshdeskAccount']['hasMany'](db['FreshdeskConfiguration'],{'as':_0x13cd('0x1bf'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db['FreshdeskField'],{'as':_0x13cd('0x1b7'),'onDelete':_0x13cd('0x111'),'foreignKey':'SubjectId'});db[_0x13cd('0xb4')][_0x13cd('0x115')](db[_0x13cd('0xb6')],{'as':_0x13cd('0x1b8'),'onDelete':'cascade','foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xb4')][_0x13cd('0x115')](db[_0x13cd('0xb6')],{'as':'Fields','onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1bc')});db['FreshdeskConfiguration'][_0x13cd('0x120')](db['FreshdeskAccount'],{'as':'Account','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xb4')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':_0x13cd('0x1c8')});db['FreshdeskField'][_0x13cd('0x115')](db['FreshdeskField'],{'as':_0x13cd('0x1ba'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xb6')][_0x13cd('0x115')](db['FreshdeskField'],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db['FreshdeskField']['hasMany'](db[_0x13cd('0xb6')],{'as':'Field','foreignKey':_0x13cd('0x1bc')});db['FreshdeskField'][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db[_0x13cd('0xb7')]['hasMany'](db[_0x13cd('0xb9')],{'as':_0x13cd('0x1bf'),'onDelete':'cascade','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0xb9')][_0x13cd('0x115')](db[_0x13cd('0x1c9')],{'as':_0x13cd('0x1b7'),'foreignKey':_0x13cd('0x1c1')});db['VtigerConfiguration']['hasMany'](db[_0x13cd('0x1c9')],{'as':_0x13cd('0x1b8'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xb9')][_0x13cd('0x115')](db['VtigerField'],{'as':_0x13cd('0x1b4'),'foreignKey':_0x13cd('0x1bc')});db['VtigerConfiguration'][_0x13cd('0x120')](db['VtigerAccount'],{'as':'Account','foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0x1c9')][_0x13cd('0x115')](db[_0x13cd('0x1c9')],{'as':_0x13cd('0x1ba'),'foreignKey':'SubjectId'});db['VtigerField'][_0x13cd('0x115')](db[_0x13cd('0x1c9')],{'as':_0x13cd('0x1bb'),'foreignKey':'DescriptionId'});db[_0x13cd('0x1c9')][_0x13cd('0x115')](db[_0x13cd('0x1c9')],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0x1c9')][_0x13cd('0x120')](db['Variable'],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db['ServicenowAccount'][_0x13cd('0x115')](db[_0x13cd('0xbe')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x13cd('0x1b6')});db['ServicenowConfiguration'][_0x13cd('0x115')](db[_0x13cd('0x1ca')],{'as':_0x13cd('0x1b7'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xbe')][_0x13cd('0x115')](db[_0x13cd('0x1ca')],{'as':_0x13cd('0x1b8'),'foreignKey':'DescriptionId'});db[_0x13cd('0xbe')][_0x13cd('0x115')](db[_0x13cd('0x1ca')],{'as':_0x13cd('0x1b4'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xbe')][_0x13cd('0x120')](db[_0x13cd('0xbc')],{'as':_0x13cd('0x169'),'foreignKey':'AccountId'});db[_0x13cd('0x1ca')][_0x13cd('0x115')](db['ServicenowField'],{'as':'Subject','foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0x1ca')][_0x13cd('0x115')](db[_0x13cd('0x1ca')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0x1ca')][_0x13cd('0x115')](db['ServicenowField'],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db['ServicenowField'][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':_0x13cd('0x1bd'),'foreignKey':_0x13cd('0x1be')});db['Dynamics365Account'][_0x13cd('0x115')](db['Dynamics365Configuration'],{'as':_0x13cd('0x1bf'),'onDelete':_0x13cd('0x111'),'foreignKey':'AccountId'});db['Dynamics365Configuration']['hasMany'](db['Dynamics365Field'],{'as':_0x13cd('0x1b7'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xc2')][_0x13cd('0x115')](db[_0x13cd('0x1cb')],{'as':_0x13cd('0x1b8'),'onDelete':_0x13cd('0x111'),'foreignKey':'DescriptionId'});db[_0x13cd('0xc2')][_0x13cd('0x115')](db[_0x13cd('0x1cb')],{'as':_0x13cd('0x1b4'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1bc')});db['Dynamics365Configuration']['belongsTo'](db[_0x13cd('0xc1')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x1b6')});db[_0x13cd('0x1cb')]['hasMany'](db[_0x13cd('0x1cb')],{'as':_0x13cd('0x1ba'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0x1cb')]['hasMany'](db[_0x13cd('0x1cb')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0x1cb')][_0x13cd('0x115')](db[_0x13cd('0x1cb')],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0x1cb')][_0x13cd('0x120')](db[_0x13cd('0x1bd')],{'as':'Variable','foreignKey':_0x13cd('0x1be')});db[_0x13cd('0x1cc')][_0x13cd('0x115')](db[_0x13cd('0xc6')],{'as':_0x13cd('0x1bf'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1b6')});db['FreshsalesConfiguration'][_0x13cd('0x115')](db[_0x13cd('0xc8')],{'as':_0x13cd('0x1b7'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xc6')][_0x13cd('0x115')](db[_0x13cd('0xc8')],{'as':'Descriptions','foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xc6')][_0x13cd('0x115')](db[_0x13cd('0xc8')],{'as':'Fields','foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xc6')][_0x13cd('0x120')](db[_0x13cd('0x1cc')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x1b6')});db['FreshsalesField'][_0x13cd('0x115')](db[_0x13cd('0xc8')],{'as':_0x13cd('0x1ba'),'foreignKey':_0x13cd('0x1c1')});db[_0x13cd('0xc8')][_0x13cd('0x115')](db[_0x13cd('0xc8')],{'as':_0x13cd('0x1bb'),'foreignKey':_0x13cd('0x1b9')});db[_0x13cd('0xc8')]['hasMany'](db['FreshsalesField'],{'as':_0x13cd('0x1c2'),'foreignKey':_0x13cd('0x1bc')});db[_0x13cd('0xc8')][_0x13cd('0x120')](db['Variable'],{'as':_0x13cd('0x1bd'),'foreignKey':'VariableId'});db['ChatQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x60')],{});db[_0x13cd('0x1cd')][_0x13cd('0x120')](db['CmList'],{'as':'List','foreignKey':_0x13cd('0x166')});db[_0x13cd('0x1cd')][_0x13cd('0x120')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db['ChatQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x66')],{});db[_0x13cd('0x1cd')][_0x13cd('0x120')](db['ChatMessage'],{});db['ChatQueueReport']['belongsTo'](db[_0x13cd('0x13')],{});db[_0x13cd('0x1cd')]['belongsTo'](db[_0x13cd('0x6b')],{});db[_0x13cd('0xcd')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':'cascade','foreignKey':_0x13cd('0x1ce')});db[_0x13cd('0xcd')][_0x13cd('0x120')](db['User'],{'onDelete':'cascade','foreignKey':_0x13cd('0x1cf')});db[_0x13cd('0xd3')]['hasMany'](db[_0x13cd('0xd1')],{'foreignKey':_0x13cd('0x1d0'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0xd3')][_0x13cd('0x115')](db[_0x13cd('0xcf')],{'foreignKey':_0x13cd('0x1d0'),'onDelete':_0x13cd('0x111')});db[_0x13cd('0xd5')]['belongsTo'](db[_0x13cd('0x51')],{});db['SmsQueueReport'][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':'List','foreignKey':'ListId'});db[_0x13cd('0xd5')]['belongsTo'](db[_0x13cd('0x159')],{'as':'Contact','foreignKey':_0x13cd('0x15b')});db[_0x13cd('0xd5')][_0x13cd('0x120')](db[_0x13cd('0x54')],{});db[_0x13cd('0xd5')][_0x13cd('0x120')](db[_0x13cd('0x180')],{});db[_0x13cd('0xd5')][_0x13cd('0x120')](db['User'],{});db['SmsQueueReport']['belongsTo'](db['SmsQueue'],{});db[_0x13cd('0xdb')]['hasMany'](db[_0x13cd('0xd3')],{'foreignKey':_0x13cd('0x1d1')});db['JscriptyProject'][_0x13cd('0x115')](db['JscriptyQuestionReport'],{'foreignKey':_0x13cd('0x1d1')});db[_0x13cd('0xdb')][_0x13cd('0x115')](db[_0x13cd('0xcf')],{'foreignKey':_0x13cd('0x1d1')});db[_0x13cd('0xe0')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x16b'),'through':_0x13cd('0x141')});db['Team']['belongsToMany'](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x126')});db[_0x13cd('0xe5')][_0x13cd('0x122')](db['VoiceQueue'],{'through':'TeamVoiceQueue','as':_0x13cd('0x12c')});db[_0x13cd('0xe5')][_0x13cd('0x122')](db[_0x13cd('0x3e')],{'through':_0x13cd('0x1d2'),'as':'MailQueues'});db[_0x13cd('0xe5')][_0x13cd('0x122')](db[_0x13cd('0x6b')],{'through':_0x13cd('0x194'),'as':'ChatQueues'});db[_0x13cd('0xe5')][_0x13cd('0x122')](db['FaxQueue'],{'through':_0x13cd('0x17e'),'as':'FaxQueues'});db[_0x13cd('0xe5')]['belongsToMany'](db['SmsQueue'],{'through':'team_has_sms_queues','as':_0x13cd('0x133')});db['Team']['belongsToMany'](db[_0x13cd('0x5e')],{'through':_0x13cd('0x18d'),'as':_0x13cd('0x134')});db['Team'][_0x13cd('0x122')](db[_0x13cd('0x107')],{'through':'team_has_whatsapp_queues','as':'WhatsappQueues'});db[_0x13cd('0xe5')][_0x13cd('0x122')](db['VoicePrefix'],{'through':'TeamVoicePrefix','as':'VoicePrefixes'});db[_0x13cd('0xe7')][_0x13cd('0x115')](db['CmHopper'],{'as':_0x13cd('0x148'),'foreignKey':_0x13cd('0x1d3')});db[_0x13cd('0xe7')][_0x13cd('0x115')](db['CmHopperFinal'],{'as':_0x13cd('0x118'),'foreignKey':_0x13cd('0x1d3')});db[_0x13cd('0xe7')][_0x13cd('0x115')](db['CmHopperHistory'],{'as':_0x13cd('0x198'),'foreignKey':_0x13cd('0x1d3')});db[_0x13cd('0xe7')][_0x13cd('0x115')](db['CmHopperBlack'],{'as':_0x13cd('0x14a'),'foreignKey':_0x13cd('0x1d3')});db[_0x13cd('0xe7')][_0x13cd('0x120')](db['Trunk'],{'as':_0x13cd('0x2b'),'foreignKey':_0x13cd('0x14c')});db[_0x13cd('0xe7')][_0x13cd('0x120')](db[_0x13cd('0x2b')],{'as':'TrunkBackup','foreignKey':_0x13cd('0x1d4')});db[_0x13cd('0xe7')][_0x13cd('0x120')](db[_0x13cd('0x85')],{'as':_0x13cd('0x85'),'foreignKey':_0x13cd('0x14d')});db[_0x13cd('0xe7')][_0x13cd('0x120')](db[_0x13cd('0xe0')],{'as':_0x13cd('0xe0'),'foreignKey':_0x13cd('0x1d5')});db[_0x13cd('0xe7')][_0x13cd('0x122')](db[_0x13cd('0xf4')],{'as':'Lists','through':_0x13cd('0x1d6')});db[_0x13cd('0xe7')][_0x13cd('0x122')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x151'),'through':_0x13cd('0x1d7')});db['Attachment'][_0x13cd('0x120')](db['ChatOfflineMessage'],{'as':_0x13cd('0x69'),'foreignKey':_0x13cd('0x16f')});db['MailTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x42')],{});db[_0x13cd('0xed')][_0x13cd('0x120')](db['MailInteraction'],{});db[_0x13cd('0xed')]['belongsTo'](db[_0x13cd('0x3c')],{'foreignKey':'FromMailAccountId','as':_0x13cd('0x1d8')});db[_0x13cd('0xed')]['belongsTo'](db['User'],{'foreignKey':_0x13cd('0x1d9'),'as':_0x13cd('0x1da')});db[_0x13cd('0xed')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1db'),'as':_0x13cd('0x1dc')});db[_0x13cd('0xed')][_0x13cd('0x120')](db[_0x13cd('0x3e')],{'foreignKey':_0x13cd('0x1dd'),'as':_0x13cd('0x1de')});db[_0x13cd('0xed')][_0x13cd('0x120')](db['MailAccount'],{'foreignKey':_0x13cd('0x1df'),'as':_0x13cd('0x1e0')});db[_0x13cd('0x1e1')][_0x13cd('0x120')](db['ChatMessage'],{});db[_0x13cd('0x1e1')]['belongsTo'](db['ChatInteraction'],{});db['ChatTransferReport']['belongsTo'](db[_0x13cd('0x60')],{'foreignKey':_0x13cd('0x1e2'),'as':_0x13cd('0x1d8')});db[_0x13cd('0x1e1')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1d9'),'as':_0x13cd('0x1da')});db[_0x13cd('0x1e1')]['belongsTo'](db['User'],{'foreignKey':_0x13cd('0x1db'),'as':_0x13cd('0x1dc')});db[_0x13cd('0x1e1')]['belongsTo'](db[_0x13cd('0x6b')],{'foreignKey':_0x13cd('0x1e3'),'as':_0x13cd('0x1de')});db['ChatTransferReport']['belongsTo'](db[_0x13cd('0x60')],{'foreignKey':_0x13cd('0x1e4'),'as':'ToAccount'});db[_0x13cd('0xef')][_0x13cd('0x120')](db[_0x13cd('0x4c')],{});db[_0x13cd('0xef')][_0x13cd('0x120')](db[_0x13cd('0x4b')],{});db[_0x13cd('0xef')]['belongsTo'](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0x13cd('0x1d8')});db['FaxTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x13cd('0xef')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1db'),'as':_0x13cd('0x1dc')});db[_0x13cd('0xef')][_0x13cd('0x120')](db[_0x13cd('0x4d')],{'foreignKey':_0x13cd('0x1e5'),'as':_0x13cd('0x1de')});db[_0x13cd('0xef')][_0x13cd('0x120')](db[_0x13cd('0x49')],{'foreignKey':_0x13cd('0x1e6'),'as':'ToAccount'});db[_0x13cd('0x1e7')]['belongsTo'](db[_0x13cd('0x5c')],{});db[_0x13cd('0x1e7')][_0x13cd('0x120')](db['OpenchannelInteraction'],{});db[_0x13cd('0x1e7')]['belongsTo'](db[_0x13cd('0x57')],{'foreignKey':_0x13cd('0x1e8'),'as':_0x13cd('0x1d8')});db[_0x13cd('0x1e7')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':'FromUserId','as':_0x13cd('0x1da')});db['OpenchannelTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x13cd('0x1e7')]['belongsTo'](db[_0x13cd('0x5e')],{'foreignKey':_0x13cd('0x1e9'),'as':_0x13cd('0x1de')});db['OpenchannelTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x57')],{'foreignKey':_0x13cd('0x1ea'),'as':_0x13cd('0x1e0')});db[_0x13cd('0xf2')][_0x13cd('0x120')](db['SmsMessage'],{});db[_0x13cd('0xf2')][_0x13cd('0x120')](db[_0x13cd('0x54')],{});db[_0x13cd('0xf2')]['belongsTo'](db[_0x13cd('0x51')],{'foreignKey':'FromSmsAccountId','as':'FromAccount'});db[_0x13cd('0xf2')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1d9'),'as':_0x13cd('0x1da')});db[_0x13cd('0xf2')]['belongsTo'](db[_0x13cd('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db[_0x13cd('0xf2')][_0x13cd('0x120')](db[_0x13cd('0x56')],{'foreignKey':'ToSmsQueueId','as':_0x13cd('0x1de')});db[_0x13cd('0xf2')][_0x13cd('0x120')](db[_0x13cd('0x51')],{'foreignKey':_0x13cd('0x1eb'),'as':_0x13cd('0x1e0')});db[_0x13cd('0xf4')][_0x13cd('0x115')](db[_0x13cd('0x81')],{'as':_0x13cd('0x174'),'foreignKey':_0x13cd('0x166'),'onDelete':'cascade'});db[_0x13cd('0xf4')]['hasMany'](db[_0x13cd('0x7a')],{'as':_0x13cd('0x1ec'),'foreignKey':'ListId'});db[_0x13cd('0xf4')][_0x13cd('0x115')](db[_0x13cd('0x159')],{'as':_0x13cd('0x124'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0xf4')][_0x13cd('0x115')](db[_0x13cd('0x117')],{'as':_0x13cd('0x118'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0xf4')][_0x13cd('0x115')](db['CmHopperHistory'],{'as':_0x13cd('0x119'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0xf4')]['hasMany'](db['ReportAgentPreview'],{'as':_0x13cd('0x78'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0xf4')][_0x13cd('0x122')](db[_0x13cd('0x12b')],{'as':_0x13cd('0x1ed'),'through':_0x13cd('0x1ee')});db['CmList'][_0x13cd('0x122')](db['User'],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x136')});db[_0x13cd('0x12d')][_0x13cd('0x115')](db[_0x13cd('0x19')],{'as':'Extensions','onDelete':_0x13cd('0x111')});db[_0x13cd('0x12d')]['belongsToMany'](db['User'],{'as':'Agents','through':_0x13cd('0x10d')});db[_0x13cd('0x12d')]['belongsToMany'](db[_0x13cd('0xe5')],{'through':_0x13cd('0x1ef'),'as':'Teams'});db[_0x13cd('0xf7')][_0x13cd('0x115')](db[_0x13cd('0x13')],{'as':_0x13cd('0x16b'),'foreignKey':_0x13cd('0x121')});db[_0x13cd('0xf7')]['hasMany'](db[_0x13cd('0xf8')],{'as':_0x13cd('0x1f0'),'foreignKey':'userProfileId','onDelete':_0x13cd('0x111')});db[_0x13cd('0xf8')]['hasMany'](db[_0x13cd('0xfa')],{'as':'Resources','foreignKey':_0x13cd('0x1f1'),'onDelete':'cascade'});db[_0x13cd('0xfd')][_0x13cd('0x115')](db['Disposition'],{'as':_0x13cd('0x174'),'foreignKey':'WhatsappAccountId','onDelete':_0x13cd('0x111')});db[_0x13cd('0xfd')][_0x13cd('0x115')](db[_0x13cd('0x162')],{'as':_0x13cd('0x163'),'foreignKey':'WhatsappAccountId'});db[_0x13cd('0xfd')][_0x13cd('0x115')](db[_0x13cd('0x101')],{'as':'Messages','foreignKey':_0x13cd('0x1f2')});db[_0x13cd('0xfd')][_0x13cd('0x115')](db[_0x13cd('0x100')],{'as':'Interactions'});db['WhatsappAccount'][_0x13cd('0x115')](db[_0x13cd('0x1f3')],{'as':_0x13cd('0x145')});db[_0x13cd('0xfd')]['belongsTo'](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0xfd')][_0x13cd('0x120')](db[_0x13cd('0x87')],{'as':_0x13cd('0x181'),'foreignKey':_0x13cd('0x14e')});db[_0x13cd('0xfd')][_0x13cd('0x122')](db['User'],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x13f')});db[_0x13cd('0x1f3')][_0x13cd('0x120')](db[_0x13cd('0x13')],{'onDelete':_0x13cd('0x15f')});db['WhatsappApplication'][_0x13cd('0x120')](db[_0x13cd('0x107')],{'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x1f3')][_0x13cd('0x120')](db[_0x13cd('0xfd')],{'onDelete':'restrict'});db['WhatsappApplication']['belongsTo'](db[_0x13cd('0x85')],{'onDelete':_0x13cd('0x15f'),'foreignKey':'IntervalId'});db[_0x13cd('0x1f3')][_0x13cd('0x120')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x13cd('0x170')});db[_0x13cd('0x100')][_0x13cd('0x115')](db[_0x13cd('0x101')],{'as':_0x13cd('0x164'),'onDelete':_0x13cd('0x111'),'foreignKey':_0x13cd('0x1f4')});db[_0x13cd('0x100')][_0x13cd('0x120')](db[_0x13cd('0xfd')],{'as':_0x13cd('0x169'),'foreignKey':_0x13cd('0x1f2')});db[_0x13cd('0x100')][_0x13cd('0x120')](db['CmContact'],{'as':_0x13cd('0x15a'),'foreignKey':'ContactId'});db[_0x13cd('0x100')][_0x13cd('0x120')](db['User'],{'as':_0x13cd('0x178'),'foreignKey':_0x13cd('0x112')});db[_0x13cd('0x100')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':'whatsapp_interaction_has_tags','as':_0x13cd('0x17a')});db[_0x13cd('0x100')][_0x13cd('0x122')](db[_0x13cd('0x8d')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':'Users','through':_0x13cd('0x1f5'),'foreignKey':_0x13cd('0x1f4')});db[_0x13cd('0x101')][_0x13cd('0x120')](db['User'],{'as':_0x13cd('0x13')});db['WhatsappMessage'][_0x13cd('0x120')](db['CmContact'],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x15a')});db[_0x13cd('0x101')][_0x13cd('0x120')](db[_0x13cd('0x100')],{'onDelete':_0x13cd('0x111'),'as':_0x13cd('0x16d'),'foreignKey':_0x13cd('0x1f4')});db['WhatsappMessage'][_0x13cd('0x120')](db[_0x13cd('0xfd')],{'as':'Account','foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x13cd('0x120')](db[_0x13cd('0xfd')],{});db[_0x13cd('0x103')][_0x13cd('0x120')](db[_0x13cd('0xf4')],{'as':_0x13cd('0x171'),'foreignKey':_0x13cd('0x166')});db[_0x13cd('0x103')][_0x13cd('0x120')](db[_0x13cd('0x159')],{'as':_0x13cd('0x15a'),'foreignKey':_0x13cd('0x15b')});db[_0x13cd('0x103')][_0x13cd('0x120')](db['WhatsappInteraction'],{});db[_0x13cd('0x103')][_0x13cd('0x120')](db[_0x13cd('0x107')],{});db[_0x13cd('0x103')][_0x13cd('0x120')](db[_0x13cd('0x101')],{});db['WhatsappQueueReport'][_0x13cd('0x120')](db[_0x13cd('0x13')],{});db[_0x13cd('0x105')][_0x13cd('0x120')](db[_0x13cd('0x101')],{});db['WhatsappTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x100')],{});db[_0x13cd('0x105')]['belongsTo'](db[_0x13cd('0xfd')],{'foreignKey':_0x13cd('0x1f6'),'as':_0x13cd('0x1d8')});db['WhatsappTransferReport'][_0x13cd('0x120')](db[_0x13cd('0xfd')],{'foreignKey':_0x13cd('0x1f7'),'as':_0x13cd('0x1e0')});db['WhatsappTransferReport']['belongsTo'](db[_0x13cd('0x107')],{'foreignKey':_0x13cd('0x1f8'),'as':_0x13cd('0x1de')});db['WhatsappTransferReport'][_0x13cd('0x120')](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1d9'),'as':_0x13cd('0x1da')});db[_0x13cd('0x105')]['belongsTo'](db[_0x13cd('0x13')],{'foreignKey':_0x13cd('0x1db'),'as':_0x13cd('0x1dc')});db[_0x13cd('0x107')][_0x13cd('0x122')](db[_0x13cd('0x13')],{'as':_0x13cd('0x14f'),'through':_0x13cd('0x38'),'foreignKey':_0x13cd('0x1f9')});db['WhatsappQueue'][_0x13cd('0x122')](db[_0x13cd('0xe5')],{'through':_0x13cd('0x1fa'),'as':_0x13cd('0x150')});db['CloudProvider'][_0x13cd('0x10f')](db['MailServerIn'],{'as':_0x13cd('0x1fb'),'onDelete':_0x13cd('0x15f')});db[_0x13cd('0x108')][_0x13cd('0x10f')](db[_0x13cd('0x160')],{'as':'Smtp','onDelete':'restrict'});module[_0x13cd('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x6364=['Disposition','Dispositions','Answers','MailMessage','Interactions','List','ListId','TemplateId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','Account','Contact','mail_interaction_has_tags','Tags','ThroughTags','Attachment','Interaction','MailInteractionId','ChatWebsiteId','TagId','MailQueueReport','Items','FaxAccountId','Exntensions','FaxMessage','FaxInteractionId','fax_interaction_has_tags','Users','team_has_fax_queues','FaxQueueReport','SmsAccountId','sms_interaction_has_tags','user_has_sms_interactions','SmsInteractionId','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','Owner','openchannel_interaction_has_tags','AttachmentId','team_has_openchannel_queues','ProactiveActions','Agent','Queue','ChatQueueId','Website','ChatInteractionId','chat_interaction_has_tags','Attachments','ChatOfflineMessageId','team_has_chat_queues','ChatGroupId','CompanyId','Hoppers','Company','cm_contact_has_tags','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','MailApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','AllCondition','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','SugarcrmAccount','Description','int_desk_configuration_has_tags','ZohoAccount','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','Dynamics365Account','FreshsalesConfiguration','ChatQueueReport','FromId','ToId','SessionId','ProjectId','team_has_whatsapp_queues','SquareProjectId','campaigns_has_cm_lists','BlackLists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ChatTransferReport','FromUserId','FromAgent','ToChatQueueId','ToChatWebsiteId','ToAccount','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','ToSmsQueueId','CmCustomField','CustomFields','Queues','UserProfileSection','Resources','sectionId','WhatsappAccountId','user_has_whatsapp_accounts','WhatsappInteractionId','whatsapp_interaction_has_tags','WhatsappQueueReport','FromWhatsappAccountId','ToWhatsappAccountId','ToQueueId','WhatsappQueueId','lodash','jstz','determine','sequelize','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','xC@LL1234','utf8_general_ci','database','password','options','username','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceRecording','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','../api/memberReport/memberReport.model','../api/trunk/trunk.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserFaxQueue','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','UserWhatsappQueue','../api/userWhatsappQueue/userWhatsappQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','MailInteraction','../api/mailMessage/mailMessage.model','MailApplication','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxQueue','../api/faxQueue/faxQueue.model','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','../api/chatApplication/chatApplication.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','../api/chatGroup/chatGroup.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','CannedAnswer','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','Integration','../api/integration/integration.model','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','ZendeskAccount','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','UserProfileResource','UserNotification','../api/userNotification/userNotification.model','../api/whatsappAccount/whatsappAccount.model','WhatsappApplication','../api/whatsappApplication/whatsappApplication.model','WhatsappInteraction','../api/whatsappInteraction/whatsappInteraction.model','WhatsappMessage','../api/whatsappMessage/whatsappMessage.model','../api/whatsappQueueReport/whatsappQueueReport.model','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoiceQueue','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','hasOne','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteraction','SmsInteractions','FaxInteractions','MailInteractions','WhatsappInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','ChatGroup','Groups','chat_group_has_users','Contacts','cm_user_has_contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','user_has_chat_interactions','user_has_fax_interactions','user_has_openchannel_interactions','user_has_whatsapp_interactions','VoiceQueue','VoiceQueues','UserVoicePrefix','MailQueues','UserMailQueue','ChatQueues','FaxQueues','SmsQueues','WhatsappQueues','ChatWebsites','user_has_chat_websites','user_has_fax_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccount','WhatsappAccounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperHistories','HopperBlacks','JscriptySessions','belongsTo','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','Pause','mandatoryDispositionPause','Lists','voice_queues_has_cm_lists','Agents','Teams','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','VoiceQueueReport','QueueCalls','uniqueid','ContactId','MailAccountId','CloudProviderId','restrict','Imap','Smtp'];(function(_0x40fb1a,_0xc40248){var _0x5a7770=function(_0x487e52){while(--_0x487e52){_0x40fb1a['push'](_0x40fb1a['shift']());}};_0x5a7770(++_0xc40248);}(_0x6364,0x8f));var _0x4636=function(_0x5bf453,_0x255f08){_0x5bf453=_0x5bf453-0x0;var _0x10aca8=_0x6364[_0x5bf453];return _0x10aca8;};'use strict';var config=require('../config/environment');var Sequelize=require('sequelize');var _=require(_0x4636('0x0'));var jstz=require(_0x4636('0x1'));var timezone=jstz[_0x4636('0x2')]();config[_0x4636('0x3')]=_[_0x4636('0x4')](config[_0x4636('0x3')],{'database':_0x4636('0x5'),'username':_0x4636('0x6'),'password':'xC@LL1234','options':{'host':_0x4636('0x7'),'port':0xcea,'dialect':_0x4636('0x8'),'dialectOptions':{'charset':_0x4636('0x9')},'logging':![],'timezone':timezone[_0x4636('0xa')](),'define':{'charset':_0x4636('0xb'),'collate':'utf8_general_ci'}}});config[_0x4636('0xc')]=_[_0x4636('0x4')](config[_0x4636('0xc')],{'database':_0x4636('0x5'),'username':'xcall','password':_0x4636('0xd'),'options':{'host':_0x4636('0x7'),'port':0xcea,'dialect':_0x4636('0x8'),'dialectOptions':{'charset':_0x4636('0x9')},'logging':![],'timezone':timezone[_0x4636('0xa')](),'define':{'charset':'utf8','collate':_0x4636('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4636('0x3')][_0x4636('0xf')],config[_0x4636('0x3')]['username'],config[_0x4636('0x3')][_0x4636('0x10')],config[_0x4636('0x3')][_0x4636('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x4636('0xc')]['database'],config['sequelizeHistory'][_0x4636('0x12')],config[_0x4636('0xc')][_0x4636('0x10')],config[_0x4636('0xc')]['options'])};db[_0x4636('0x13')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x15'));db[_0x4636('0x16')]=db[_0x4636('0x3')]['import'](_0x4636('0x17'));db[_0x4636('0x18')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/voiceContext/voiceContext.model');db[_0x4636('0x19')]=db['sequelize']['import'](_0x4636('0x1a'));db[_0x4636('0x1b')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x1c'));db['VoiceQueue']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x4636('0x1d')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x4636('0x1e')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x1f'));db[_0x4636('0x20')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x21'));db[_0x4636('0x22')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x23'));db[_0x4636('0x24')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x25'));db[_0x4636('0x26')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x27'));db[_0x4636('0x28')]=db[_0x4636('0x3')]['import'](_0x4636('0x29'));db['VoiceQueueReport']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x2a'));db['MemberReport']=db['sequelize']['import'](_0x4636('0x2b'));db['Trunk']=db['sequelize']['import'](_0x4636('0x2c'));db['VoiceTransferReport']=db['sequelize'][_0x4636('0x14')]('../api/voiceTransferReport/voiceTransferReport.model');db[_0x4636('0x2d')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x2e'));db[_0x4636('0x2f')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x4636('0x30')]=db[_0x4636('0x3')]['import'](_0x4636('0x31'));db['UserMailQueue']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/userMailQueue/userMailQueue.model');db[_0x4636('0x32')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/userFaxQueue/userFaxQueue.model');db[_0x4636('0x33')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x34'));db[_0x4636('0x35')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x36'));db[_0x4636('0x37')]=db['sequelize']['import'](_0x4636('0x38'));db[_0x4636('0x39')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x3a'));db[_0x4636('0x3b')]=db['sequelize'][_0x4636('0x14')]('../api/mailServerOut/mailServerOut.model');db[_0x4636('0x3c')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x3d'));db[_0x4636('0x3e')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x3f'));db['MailSubstatus']=db['sequelize'][_0x4636('0x14')]('../api/mailSubstatus/mailSubstatus.model');db[_0x4636('0x40')]=db['sequelize'][_0x4636('0x14')]('../api/mailInteraction/mailInteraction.model');db['MailMessage']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x41'));db[_0x4636('0x42')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x43'));db['Dashboard']=db[_0x4636('0x3')]['import'](_0x4636('0x44'));db['DashboardItem']=db[_0x4636('0x3')]['import'](_0x4636('0x45'));db[_0x4636('0x46')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x47'));db[_0x4636('0x48')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x49'));db[_0x4636('0x4a')]=db[_0x4636('0x3')]['import'](_0x4636('0x4b'));db['FaxMessage']=db['sequelize'][_0x4636('0x14')]('../api/faxMessage/faxMessage.model');db[_0x4636('0x4c')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x4d'));db['FaxQueueReport']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x4e'));db[_0x4636('0x4f')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x50'));db[_0x4636('0x51')]=db[_0x4636('0x3')]['import'](_0x4636('0x52'));db[_0x4636('0x53')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/smsInteraction/smsInteraction.model');db[_0x4636('0x54')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/smsMessage/smsMessage.model');db[_0x4636('0x55')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x56'));db[_0x4636('0x57')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x58'));db[_0x4636('0x59')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x5a'));db[_0x4636('0x5b')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x5c'));db[_0x4636('0x5d')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x5e'));db[_0x4636('0x5f')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/openchannelQueue/openchannelQueue.model');db[_0x4636('0x60')]=db['sequelize'][_0x4636('0x14')]('../api/chatWebsite/chatWebsite.model');db[_0x4636('0x61')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x62'));db[_0x4636('0x63')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x64'));db['ChatInteraction']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/chatInteraction/chatInteraction.model');db[_0x4636('0x65')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x66'));db[_0x4636('0x67')]=db['sequelize']['import'](_0x4636('0x68'));db[_0x4636('0x69')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x6a'));db['ChatGroup']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x6b'));db['ChatProactiveAction']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x4636('0x6c')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x6d'));db[_0x4636('0x6e')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/cmContact/cmContact.model');db[_0x4636('0x6f')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x70'));db[_0x4636('0x71')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x72'));db[_0x4636('0x73')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x74'));db['CmHopperHistory']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x75'));db[_0x4636('0x76')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x77'));db['CmCustomField']=db[_0x4636('0x3')]['import'](_0x4636('0x78'));db[_0x4636('0x79')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x7a'));db[_0x4636('0x7b')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/automation/automation.model');db[_0x4636('0x7c')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/cannedAnswer/cannedAnswer.model');db['Disposition']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x7d'));db[_0x4636('0x7e')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x7f'));db[_0x4636('0x80')]=db['sequelize']['import'](_0x4636('0x81'));db['Pause']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/pause/pause.model');db[_0x4636('0x82')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x83'));db[_0x4636('0x84')]=db['sequelize'][_0x4636('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x4636('0x85')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/schedule/schedule.model');db[_0x4636('0x86')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x87'));db[_0x4636('0x88')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x89'));db[_0x4636('0x8a')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x8b'));db[_0x4636('0x8c')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x8d'));db[_0x4636('0x8e')]=db[_0x4636('0x3')]['import']('../api/variable/variable.model');db[_0x4636('0x8f')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x90'));db[_0x4636('0x91')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x92'));db[_0x4636('0x93')]=db[_0x4636('0x3')]['import'](_0x4636('0x94'));db['AnalyticDefaultReport']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x4636('0x95')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x96'));db[_0x4636('0x97')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x98'));db[_0x4636('0x99')]=db[_0x4636('0x3')]['import'](_0x4636('0x9a'));db[_0x4636('0x9b')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x9c'));db[_0x4636('0x9d')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x9e'));db[_0x4636('0x9f')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xa0'));db[_0x4636('0xa1')]=db[_0x4636('0x3')]['import'](_0x4636('0xa2'));db['SugarcrmAccount']=db[_0x4636('0x3')]['import'](_0x4636('0xa3'));db['SugarcrmConfiguration']=db['sequelize']['import'](_0x4636('0xa4'));db[_0x4636('0xa5')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xa6'));db[_0x4636('0xa7')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xa8'));db[_0x4636('0xa9')]=db[_0x4636('0x3')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x4636('0xaa')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/intDeskField/intDeskField.model');db['ZohoAccount']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xab'));db[_0x4636('0xac')]=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x4636('0xad')]=db[_0x4636('0x3')]['import']('../api/intZohoField/intZohoField.model');db[_0x4636('0xae')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/intZendeskAccount/intZendeskAccount.model');db[_0x4636('0xaf')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xb0'));db[_0x4636('0xb1')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xb2'));db[_0x4636('0xb3')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xb4'));db[_0x4636('0xb5')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xb6'));db[_0x4636('0xb7')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xb8'));db[_0x4636('0xb9')]=db['sequelize'][_0x4636('0x14')](_0x4636('0xba'));db[_0x4636('0xbb')]=db['sequelize']['import'](_0x4636('0xbc'));db[_0x4636('0xbd')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0x4636('0xbe')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x4636('0xbf')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xc0'));db[_0x4636('0xc1')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xc2'));db['Dynamics365Account']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x4636('0xc3')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xc4'));db[_0x4636('0xc5')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xc6'));db[_0x4636('0xc7')]=db[_0x4636('0x3')]['import'](_0x4636('0xc8'));db['FreshsalesConfiguration']=db[_0x4636('0x3')]['import'](_0x4636('0xc9'));db[_0x4636('0xca')]=db['sequelize'][_0x4636('0x14')](_0x4636('0xcb'));db['Integration']=db['sequelize'][_0x4636('0x14')](_0x4636('0x90'));db['Network']=db['sequelize']['import'](_0x4636('0xcc'));db['ChatQueueReport']=db[_0x4636('0x3')]['import'](_0x4636('0xcd'));db[_0x4636('0xce')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xcf'));db[_0x4636('0xd0')]=db['sequelize'][_0x4636('0x14')](_0x4636('0xd1'));db[_0x4636('0xd2')]=db[_0x4636('0x3')]['import'](_0x4636('0xd3'));db[_0x4636('0xd4')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x4636('0xd5')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xd6'));db[_0x4636('0xd7')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xd8'));db['SquareDetailsReport']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/squareReportDetail/squareReportDetail.model');db[_0x4636('0xd9')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xda'));db[_0x4636('0xdb')]=db['sequelize'][_0x4636('0x14')](_0x4636('0xdc'));db['SquareOdbc']=db[_0x4636('0x3')]['import'](_0x4636('0xdd'));db[_0x4636('0xde')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xdf'));db[_0x4636('0xe0')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/squareRecording/squareRecording.model');db[_0x4636('0xe1')]=db[_0x4636('0x3')]['import'](_0x4636('0xe2'));db[_0x4636('0xe3')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xe4'));db[_0x4636('0xe5')]=db['sequelize']['import'](_0x4636('0xe6'));db[_0x4636('0xe7')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xe8'));db[_0x4636('0xe9')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xea'));db['Attachment']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xeb'));db[_0x4636('0xec')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/plugin/plugin.model');db[_0x4636('0xed')]=db['sequelize'][_0x4636('0x14')](_0x4636('0xee'));db['ChatTransferReport']=db[_0x4636('0x3')][_0x4636('0x14')]('../api/chatTransferReport/chatTransferReport.model');db[_0x4636('0xef')]=db[_0x4636('0x3')]['import'](_0x4636('0xf0'));db[_0x4636('0xf1')]=db[_0x4636('0x3')]['import'](_0x4636('0xf2'));db[_0x4636('0xf3')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xf4'));db[_0x4636('0xf5')]=db[_0x4636('0x3')]['import'](_0x4636('0xf6'));db[_0x4636('0xf7')]=db[_0x4636('0x3')]['import'](_0x4636('0xf8'));db[_0x4636('0xf9')]=db[_0x4636('0x3')][_0x4636('0x14')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x4636('0x3')]['import'](_0x4636('0xfa'));db[_0x4636('0xfb')]=db['sequelize']['import']('../api/userProfileResource/userProfileResource.model');db[_0x4636('0xfc')]=db[_0x4636('0x3')]['import'](_0x4636('0xfd'));db['WhatsappAccount']=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0xfe'));db[_0x4636('0xff')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x100'));db[_0x4636('0x101')]=db[_0x4636('0x3')]['import'](_0x4636('0x102'));db[_0x4636('0x103')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x104'));db['WhatsappQueueReport']=db[_0x4636('0x3')]['import'](_0x4636('0x105'));db[_0x4636('0x106')]=db['sequelize'][_0x4636('0x14')](_0x4636('0x107'));db[_0x4636('0x108')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x109'));db[_0x4636('0x10a')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x10b'));db[_0x4636('0x10c')]=db['sequelize'][_0x4636('0x14')]('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0x4636('0x10d')]=db[_0x4636('0x3')][_0x4636('0x14')](_0x4636('0x10e'));db['UserVoicePrefix']=db[_0x4636('0x3')]['import'](_0x4636('0x10f'));db[_0x4636('0x13')][_0x4636('0x110')](db[_0x4636('0x20')],{'as':_0x4636('0x20'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x1d')],{'as':_0x4636('0x114'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')]['hasMany'](db['UserVoiceQueueRt'],{'as':'VoiceQueuesRt','foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x19')],{'as':_0x4636('0x115'),'onDelete':'cascade','hooks':!![]});db['User'][_0x4636('0x113')](db[_0x4636('0x73')],{'as':_0x4636('0x116'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x117')],{'as':_0x4636('0x118'),'foreignKey':'UserId'});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x76')],{'as':_0x4636('0x76'),'foreignKey':_0x4636('0x112')});db['User']['hasMany'](db['OpenchannelInteraction'],{'as':_0x4636('0x119'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x11a')],{'as':'ChatInteractions','foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x53')],{'as':_0x4636('0x11b'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db['FaxInteraction'],{'as':_0x4636('0x11c'),'foreignKey':'UserId'});db['User'][_0x4636('0x113')](db[_0x4636('0x40')],{'as':_0x4636('0x11d'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0x101')],{'as':_0x4636('0x11e'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x13')][_0x4636('0x113')](db[_0x4636('0xfc')],{'as':_0x4636('0x11f'),'foreignKey':_0x4636('0x120')});db[_0x4636('0x13')]['belongsTo'](db['UserProfile'],{'as':_0x4636('0xf9'),'foreignKey':_0x4636('0x121')});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x123')],{'as':_0x4636('0x124'),'through':_0x4636('0x125')});db[_0x4636('0x13')]['belongsToMany'](db[_0x4636('0x6e')],{'as':_0x4636('0x126'),'through':_0x4636('0x127')});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0xf5')],{'as':'Lists','through':_0x4636('0x128')});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x129')});db[_0x4636('0x13')]['belongsToMany'](db[_0x4636('0x40')],{'as':'MailInteractions','through':_0x4636('0x12a')});db[_0x4636('0x13')][_0x4636('0x122')](db['ChatInteraction'],{'as':_0x4636('0x12b'),'through':_0x4636('0x12c')});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x4a')],{'as':_0x4636('0x11c'),'through':_0x4636('0x12d')});db['User'][_0x4636('0x122')](db['SmsInteraction'],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x5b')],{'as':_0x4636('0x119'),'through':_0x4636('0x12e')});db[_0x4636('0x13')][_0x4636('0x122')](db['WhatsappInteraction'],{'as':_0x4636('0x11e'),'through':_0x4636('0x12f')});db[_0x4636('0x13')]['belongsToMany'](db[_0x4636('0x130')],{'as':_0x4636('0x131'),'through':'UserVoiceQueue','required':![]});db['User'][_0x4636('0x122')](db[_0x4636('0xf7')],{'as':'VoicePrefixes','through':_0x4636('0x132'),'required':![]});db['User'][_0x4636('0x122')](db[_0x4636('0x3e')],{'as':_0x4636('0x133'),'through':_0x4636('0x134'),'required':![]});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x69')],{'as':_0x4636('0x135'),'through':'UserChatQueue','required':![],'hooks':!![]});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x4c')],{'as':_0x4636('0x136'),'through':_0x4636('0x32'),'required':![]});db['User']['belongsToMany'](db[_0x4636('0x55')],{'as':_0x4636('0x137'),'through':'UserSmsQueue','required':![]});db['User'][_0x4636('0x122')](db[_0x4636('0x5f')],{'as':'OpenchannelQueues','through':_0x4636('0x35'),'required':![]});db[_0x4636('0x13')][_0x4636('0x122')](db['WhatsappQueue'],{'as':_0x4636('0x138'),'through':'UserWhatsappQueue','required':![]});db[_0x4636('0x13')][_0x4636('0x122')](db['CmList'],{'through':_0x4636('0x128')});db['User']['belongsToMany'](db[_0x4636('0x60')],{'as':_0x4636('0x139'),'through':_0x4636('0x13a')});db[_0x4636('0x13')][_0x4636('0x122')](db['FaxAccount'],{'as':'FaxAccounts','through':_0x4636('0x13b')});db['User'][_0x4636('0x122')](db[_0x4636('0x3c')],{'as':'MailAccounts','through':'user_has_mail_accounts'});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x57')],{'as':_0x4636('0x13c'),'through':_0x4636('0x13d')});db['User']['belongsToMany'](db[_0x4636('0x4f')],{'as':_0x4636('0x13e'),'through':_0x4636('0x13f')});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0x140')],{'as':_0x4636('0x141'),'through':'user_has_whatsapp_accounts'});db[_0x4636('0x13')][_0x4636('0x122')](db[_0x4636('0xde')],{'as':_0x4636('0x142'),'through':_0x4636('0x143')});db[_0x4636('0x16')][_0x4636('0x113')](db[_0x4636('0x19')],{'as':_0x4636('0x144'),'onDelete':'cascade','foreignKey':_0x4636('0x145')});db[_0x4636('0x18')][_0x4636('0x113')](db[_0x4636('0x19')],{'onDelete':_0x4636('0x111')});db[_0x4636('0x19')]['hasMany'](db[_0x4636('0x19')],{'as':_0x4636('0x146'),'onDelete':_0x4636('0x111')});db[_0x4636('0x1b')][_0x4636('0x122')](db[_0x4636('0x86')],{'as':_0x4636('0x147'),'through':_0x4636('0x148')});db[_0x4636('0x130')]['hasMany'](db[_0x4636('0x2d')],{'as':_0x4636('0x149'),'foreignKey':_0x4636('0x14a')});db[_0x4636('0x130')][_0x4636('0x113')](db['CmHopper'],{'as':'Hoppers','foreignKey':_0x4636('0x14a')});db['VoiceQueue'][_0x4636('0x113')](db[_0x4636('0x73')],{'as':_0x4636('0x116'),'foreignKey':_0x4636('0x14a')});db[_0x4636('0x130')][_0x4636('0x113')](db['CmHopperHistory'],{'as':_0x4636('0x14b'),'foreignKey':'VoiceQueueId'});db[_0x4636('0x130')]['hasMany'](db[_0x4636('0x76')],{'as':_0x4636('0x76'),'foreignKey':_0x4636('0x14a')});db['VoiceQueue'][_0x4636('0x113')](db[_0x4636('0x71')],{'as':_0x4636('0x14c'),'foreignKey':_0x4636('0x14a')});db[_0x4636('0x130')]['hasMany'](db[_0x4636('0xd4')],{'as':_0x4636('0x14d'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x4636('0x14e')](db[_0x4636('0x14f')],{'as':_0x4636('0x14f'),'foreignKey':_0x4636('0x150')});db[_0x4636('0x130')][_0x4636('0x14e')](db[_0x4636('0x14f')],{'as':_0x4636('0x151'),'foreignKey':_0x4636('0x152')});db[_0x4636('0x130')]['belongsTo'](db[_0x4636('0x80')],{'as':_0x4636('0x80'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x130')][_0x4636('0x14e')](db[_0x4636('0x154')],{'as':_0x4636('0x155'),'foreignKey':'mandatoryDispositionPauseId'});db['VoiceQueue'][_0x4636('0x122')](db[_0x4636('0xf5')],{'as':_0x4636('0x156'),'through':_0x4636('0x157')});db[_0x4636('0x130')]['belongsToMany'](db['User'],{'as':_0x4636('0x158'),'through':_0x4636('0x2f')});db[_0x4636('0x130')][_0x4636('0x122')](db[_0x4636('0xe3')],{'as':_0x4636('0x159'),'through':_0x4636('0x10c')});db['VoiceQueue'][_0x4636('0x122')](db[_0x4636('0xf5')],{'as':'BlackLists','through':_0x4636('0x15a')});db[_0x4636('0x1d')][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':'User','foreignKey':_0x4636('0x112')});db['ScreenRecording'][_0x4636('0x14e')](db['User'],{'as':_0x4636('0x13'),'foreignKey':_0x4636('0x112')});db['VoiceMail'][_0x4636('0x113')](db[_0x4636('0x22')],{'as':_0x4636('0x15b'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x15c'),'sourceKey':_0x4636('0x15d')});db['VoiceMailMessage']['belongsTo'](db[_0x4636('0x20')],{'foreignKey':_0x4636('0x15c'),'targetKey':_0x4636('0x15d')});db[_0x4636('0x24')]['hasMany'](db[_0x4636('0x15e')],{'as':_0x4636('0x15f'),'foreignKey':_0x4636('0x160'),'constraints':![]});db[_0x4636('0x24')][_0x4636('0x113')](db[_0x4636('0x28')],{'as':'AgentReports','foreignKey':_0x4636('0x160'),'constraints':![]});db['VoiceCallReport'][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':'User','foreignKey':_0x4636('0x112')});db['VoiceCallReport'][_0x4636('0x14e')](db['CmContact'],{'as':'Contact','foreignKey':_0x4636('0x161')});db[_0x4636('0x39')]['belongsTo'](db[_0x4636('0x3c')],{'as':'MailAccount','foreignKey':_0x4636('0x162')});db[_0x4636('0x39')]['belongsTo'](db[_0x4636('0x10a')],{'as':_0x4636('0x10a'),'foreignKey':_0x4636('0x163'),'onDelete':_0x4636('0x164')});db[_0x4636('0x3b')]['belongsTo'](db[_0x4636('0x3c')],{'as':'MailAccount','foreignKey':_0x4636('0x162')});db['MailServerOut'][_0x4636('0x14e')](db['CloudProvider'],{'as':_0x4636('0x10a'),'foreignKey':_0x4636('0x163'),'onDelete':'restrict'});db[_0x4636('0x3c')][_0x4636('0x110')](db[_0x4636('0x39')],{'as':_0x4636('0x165'),'onDelete':_0x4636('0x111')});db[_0x4636('0x3c')][_0x4636('0x110')](db['MailServerOut'],{'as':_0x4636('0x166'),'onDelete':_0x4636('0x111')});db[_0x4636('0x3c')][_0x4636('0x113')](db[_0x4636('0x167')],{'as':_0x4636('0x168'),'foreignKey':'MailAccountId','onDelete':_0x4636('0x111')});db[_0x4636('0x3c')][_0x4636('0x113')](db[_0x4636('0x7c')],{'as':_0x4636('0x169'),'foreignKey':'MailAccountId'});db[_0x4636('0x3c')]['hasMany'](db[_0x4636('0x16a')],{'as':_0x4636('0x15b'),'foreignKey':_0x4636('0x162')});db['MailAccount'][_0x4636('0x113')](db[_0x4636('0x40')],{'as':_0x4636('0x16b')});db[_0x4636('0x3c')][_0x4636('0x113')](db['MailApplication'],{'as':_0x4636('0x146')});db[_0x4636('0x3c')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db['MailAccount'][_0x4636('0x14e')](db['Template'],{'as':_0x4636('0x8a'),'foreignKey':_0x4636('0x16e')});db[_0x4636('0x3c')][_0x4636('0x14e')](db['Pause'],{'as':_0x4636('0x155'),'foreignKey':_0x4636('0x16f')});db['MailAccount'][_0x4636('0x122')](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':_0x4636('0x170')});db['MailQueue']['belongsToMany'](db['User'],{'as':_0x4636('0x158'),'through':_0x4636('0x134')});db['MailQueue'][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x171'),'as':_0x4636('0x159')});db[_0x4636('0x40')][_0x4636('0x113')](db['MailMessage'],{'as':_0x4636('0x15b'),'onDelete':'cascade','foreignKey':'MailInteractionId'});db['MailInteraction']['belongsTo'](db['MailAccount'],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x162')});db[_0x4636('0x40')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':_0x4636('0x161')});db['MailInteraction']['belongsTo'](db[_0x4636('0x13')],{'as':'Owner','foreignKey':_0x4636('0x112')});db[_0x4636('0x40')]['belongsToMany'](db[_0x4636('0x88')],{'through':_0x4636('0x174'),'as':_0x4636('0x175')});db[_0x4636('0x40')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x174'),'as':_0x4636('0x176')});db[_0x4636('0x40')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Users','through':_0x4636('0x12a'),'foreignKey':'MailInteractionId'});db[_0x4636('0x16a')][_0x4636('0x113')](db[_0x4636('0x177')],{'as':'Attachments','onDelete':'cascade'});db['MailMessage']['belongsTo'](db[_0x4636('0x13')],{'as':_0x4636('0x13')});db['MailMessage'][_0x4636('0x14e')](db[_0x4636('0x6e')],{'onDelete':'cascade','as':_0x4636('0x173')});db['MailMessage'][_0x4636('0x14e')](db[_0x4636('0x40')],{'as':_0x4636('0x178'),'foreignKey':_0x4636('0x179')});db[_0x4636('0x16a')][_0x4636('0x14e')](db[_0x4636('0x3c')],{'as':'Account','foreignKey':'MailAccountId'});db[_0x4636('0x16a')][_0x4636('0x14e')](db['ChatWebsite'],{'as':'ChatWebsite','foreignKey':_0x4636('0x17a')});db[_0x4636('0x16a')][_0x4636('0x14e')](db[_0x4636('0x67')],{'as':_0x4636('0x67'),'foreignKey':'ChatOfflineMessageId'});db['MailApplication'][_0x4636('0x14e')](db[_0x4636('0x13')],{'onDelete':_0x4636('0x164')});db[_0x4636('0x42')][_0x4636('0x14e')](db[_0x4636('0x3e')],{'onDelete':_0x4636('0x164')});db['MailApplication'][_0x4636('0x14e')](db[_0x4636('0x3c')],{'onDelete':_0x4636('0x164')});db[_0x4636('0x42')][_0x4636('0x14e')](db[_0x4636('0x80')],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x42')][_0x4636('0x14e')](db['Tag'],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x17b')});db['MailQueueReport']['belongsTo'](db[_0x4636('0x3c')],{});db[_0x4636('0x17c')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x17c')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0x17c')][_0x4636('0x14e')](db[_0x4636('0x40')],{});db[_0x4636('0x17c')]['belongsTo'](db['MailMessage'],{});db['MailQueueReport'][_0x4636('0x14e')](db[_0x4636('0x13')],{});db[_0x4636('0x17c')][_0x4636('0x14e')](db[_0x4636('0x3e')],{});db['Dashboard'][_0x4636('0x113')](db['DashboardItem'],{'as':_0x4636('0x17d'),'onDelete':_0x4636('0x111')});db['FaxAccount'][_0x4636('0x113')](db[_0x4636('0x167')],{'as':_0x4636('0x168'),'foreignKey':_0x4636('0x17e'),'onDelete':_0x4636('0x111')});db[_0x4636('0x46')][_0x4636('0x113')](db[_0x4636('0x7c')],{'as':_0x4636('0x169'),'foreignKey':_0x4636('0x17e')});db[_0x4636('0x46')][_0x4636('0x113')](db[_0x4636('0x4a')],{'as':_0x4636('0x16b')});db[_0x4636('0x46')][_0x4636('0x113')](db[_0x4636('0x48')],{'as':_0x4636('0x146')});db[_0x4636('0x46')][_0x4636('0x113')](db[_0x4636('0x19')],{'as':_0x4636('0x17f'),'onDelete':_0x4636('0x111')});db[_0x4636('0x46')][_0x4636('0x113')](db['FaxMessage'],{'as':'Messages'});db[_0x4636('0x46')]['belongsTo'](db['Trunk'],{'as':_0x4636('0x14f')});db[_0x4636('0x46')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x46')][_0x4636('0x14e')](db[_0x4636('0x154')],{'as':'mandatoryDispositionPause','foreignKey':_0x4636('0x16f')});db[_0x4636('0x46')][_0x4636('0x122')](db['User'],{'as':_0x4636('0x158'),'through':'user_has_fax_accounts'});db[_0x4636('0x48')][_0x4636('0x14e')](db[_0x4636('0x13')],{'onDelete':'restrict'});db['FaxApplication'][_0x4636('0x14e')](db[_0x4636('0x4c')],{'onDelete':_0x4636('0x164')});db[_0x4636('0x48')][_0x4636('0x14e')](db[_0x4636('0x46')],{'onDelete':'restrict'});db['FaxApplication'][_0x4636('0x14e')](db['Tag'],{'onDelete':_0x4636('0x164'),'foreignKey':'TagId'});db['FaxInteraction'][_0x4636('0x113')](db[_0x4636('0x180')],{'as':_0x4636('0x15b'),'onDelete':'cascade','foreignKey':_0x4636('0x181')});db[_0x4636('0x4a')]['belongsTo'](db[_0x4636('0x46')],{'as':'Account','foreignKey':'FaxAccountId'});db[_0x4636('0x4a')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0x4a')][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':'Owner','foreignKey':_0x4636('0x112')});db[_0x4636('0x4a')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x182'),'as':_0x4636('0x175')});db[_0x4636('0x4a')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':'fax_interaction_has_tags','as':_0x4636('0x176')});db[_0x4636('0x4a')]['belongsToMany'](db[_0x4636('0x13')],{'as':_0x4636('0x183'),'through':'user_has_fax_interactions','foreignKey':_0x4636('0x181')});db['FaxMessage'][_0x4636('0x14e')](db['User'],{'onDelete':_0x4636('0x111'),'as':_0x4636('0x13')});db['FaxMessage'][_0x4636('0x14e')](db[_0x4636('0x4a')],{'as':_0x4636('0x178'),'foreignKey':_0x4636('0x181')});db['FaxMessage'][_0x4636('0x14e')](db['CmContact'],{'onDelete':'cascade','as':_0x4636('0x173')});db[_0x4636('0x180')]['belongsTo'](db[_0x4636('0x177')],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0x4636('0x180')][_0x4636('0x14e')](db['FaxAccount'],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x17e')});db[_0x4636('0x4c')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Agents','through':'UserFaxQueue'});db[_0x4636('0x4c')][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x184'),'as':_0x4636('0x159')});db[_0x4636('0x185')][_0x4636('0x14e')](db[_0x4636('0x46')],{});db[_0x4636('0x185')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':'List','foreignKey':_0x4636('0x16d')});db[_0x4636('0x185')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0x185')][_0x4636('0x14e')](db['FaxInteraction'],{});db[_0x4636('0x185')][_0x4636('0x14e')](db[_0x4636('0x180')],{});db[_0x4636('0x185')][_0x4636('0x14e')](db['User'],{});db[_0x4636('0x185')][_0x4636('0x14e')](db['FaxQueue'],{});db[_0x4636('0x4f')][_0x4636('0x113')](db[_0x4636('0x167')],{'as':'Dispositions','foreignKey':_0x4636('0x186'),'onDelete':_0x4636('0x111')});db[_0x4636('0x4f')][_0x4636('0x113')](db[_0x4636('0x7c')],{'as':_0x4636('0x169'),'foreignKey':_0x4636('0x186')});db[_0x4636('0x4f')][_0x4636('0x113')](db['SmsMessage'],{'as':'Messages','foreignKey':_0x4636('0x186')});db[_0x4636('0x4f')][_0x4636('0x113')](db['SmsInteraction'],{'as':_0x4636('0x16b')});db[_0x4636('0x4f')][_0x4636('0x113')](db[_0x4636('0x51')],{'as':_0x4636('0x146')});db[_0x4636('0x4f')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db['SmsAccount']['belongsTo'](db[_0x4636('0x154')],{'as':_0x4636('0x155'),'foreignKey':_0x4636('0x16f')});db['SmsAccount']['belongsToMany'](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':'user_has_sms_accounts'});db[_0x4636('0x51')][_0x4636('0x14e')](db[_0x4636('0x13')],{'onDelete':_0x4636('0x164')});db[_0x4636('0x51')]['belongsTo'](db['SmsQueue'],{'onDelete':_0x4636('0x164')});db[_0x4636('0x51')][_0x4636('0x14e')](db[_0x4636('0x4f')],{'onDelete':'restrict'});db[_0x4636('0x51')][_0x4636('0x14e')](db[_0x4636('0x80')],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x51')]['belongsTo'](db[_0x4636('0x88')],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x17b')});db[_0x4636('0x53')][_0x4636('0x113')](db[_0x4636('0x54')],{'as':_0x4636('0x15b'),'onDelete':_0x4636('0x111'),'foreignKey':'SmsInteractionId'});db[_0x4636('0x53')][_0x4636('0x14e')](db[_0x4636('0x4f')],{'as':'Account','foreignKey':_0x4636('0x186')});db[_0x4636('0x53')]['belongsTo'](db[_0x4636('0x6e')],{'as':'Contact','foreignKey':_0x4636('0x161')});db[_0x4636('0x53')][_0x4636('0x14e')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0x4636('0x53')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x187'),'as':_0x4636('0x175')});db[_0x4636('0x53')]['belongsToMany'](db[_0x4636('0x88')],{'through':_0x4636('0x187'),'as':'ThroughTags'});db[_0x4636('0x53')][_0x4636('0x122')](db['User'],{'as':_0x4636('0x183'),'through':_0x4636('0x188'),'foreignKey':'SmsInteractionId'});db[_0x4636('0x54')][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':'User'});db[_0x4636('0x54')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'onDelete':'cascade','as':_0x4636('0x173')});db[_0x4636('0x54')][_0x4636('0x14e')](db[_0x4636('0x53')],{'onDelete':_0x4636('0x111'),'as':'Interaction','foreignKey':_0x4636('0x189')});db[_0x4636('0x54')][_0x4636('0x14e')](db[_0x4636('0x4f')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x186')});db['SmsQueue'][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Agents','through':_0x4636('0x33'),'foreignKey':_0x4636('0x18a')});db[_0x4636('0x55')][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x18b'),'as':'Teams'});db['OpenchannelAccount']['hasMany'](db[_0x4636('0x167')],{'as':_0x4636('0x168'),'foreignKey':_0x4636('0x18c'),'onDelete':_0x4636('0x111')});db[_0x4636('0x57')][_0x4636('0x113')](db['CannedAnswer'],{'as':_0x4636('0x169'),'foreignKey':_0x4636('0x18c')});db['OpenchannelAccount']['hasMany'](db[_0x4636('0x5b')],{'as':_0x4636('0x16b'),'foreignKey':_0x4636('0x18c')});db[_0x4636('0x57')][_0x4636('0x113')](db[_0x4636('0x5d')],{'as':'Messages','foreignKey':_0x4636('0x18c')});db[_0x4636('0x57')][_0x4636('0x113')](db[_0x4636('0x59')],{'as':_0x4636('0x146'),'foreignKey':_0x4636('0x18c')});db[_0x4636('0x57')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db['OpenchannelAccount'][_0x4636('0x14e')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0x4636('0x16f')});db[_0x4636('0x57')]['belongsToMany'](db[_0x4636('0x13')],{'as':'Agents','through':_0x4636('0x13d')});db['OpenchannelApplication']['belongsTo'](db[_0x4636('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x4636('0x14e')](db[_0x4636('0x5f')],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x18d')});db['OpenchannelApplication'][_0x4636('0x14e')](db[_0x4636('0x57')],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x18c')});db['OpenchannelApplication'][_0x4636('0x14e')](db['Interval'],{'onDelete':_0x4636('0x164'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x59')]['belongsTo'](db[_0x4636('0x88')],{'onDelete':'restrict','foreignKey':_0x4636('0x17b')});db['OpenchannelInteraction'][_0x4636('0x113')](db['OpenchannelMessage'],{'as':_0x4636('0x15b'),'onDelete':'cascade','foreignKey':_0x4636('0x18e')});db[_0x4636('0x5b')][_0x4636('0x14e')](db['OpenchannelAccount'],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x18c')});db[_0x4636('0x5b')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':_0x4636('0x161')});db['OpenchannelInteraction']['belongsTo'](db[_0x4636('0x13')],{'as':_0x4636('0x18f'),'foreignKey':'UserId'});db[_0x4636('0x5b')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':'openchannel_interaction_has_tags','as':_0x4636('0x175')});db[_0x4636('0x5b')][_0x4636('0x122')](db['Tag'],{'through':_0x4636('0x190'),'as':_0x4636('0x176')});db[_0x4636('0x5b')][_0x4636('0x122')](db['User'],{'as':'Users','through':'user_has_openchannel_interactions','foreignKey':_0x4636('0x18e')});db[_0x4636('0x5d')][_0x4636('0x14e')](db[_0x4636('0x13')],{'onDelete':_0x4636('0x111'),'as':'User'});db[_0x4636('0x5d')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'onDelete':_0x4636('0x111'),'as':_0x4636('0x173')});db[_0x4636('0x5d')][_0x4636('0x14e')](db[_0x4636('0x5b')],{'onDelete':'cascade','as':_0x4636('0x178'),'foreignKey':_0x4636('0x18e')});db['OpenchannelMessage'][_0x4636('0x14e')](db[_0x4636('0x177')],{'as':_0x4636('0x177'),'foreignKey':_0x4636('0x191')});db[_0x4636('0x5d')][_0x4636('0x14e')](db[_0x4636('0x57')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x18c')});db['OpenchannelQueue'][_0x4636('0x122')](db['User'],{'as':'Agents','through':_0x4636('0x35'),'foreignKey':_0x4636('0x18d')});db[_0x4636('0x5f')][_0x4636('0x122')](db['Team'],{'through':_0x4636('0x192'),'as':'Teams'});db[_0x4636('0x60')]['hasMany'](db[_0x4636('0x167')],{'as':_0x4636('0x168'),'foreignKey':_0x4636('0x17a'),'onDelete':_0x4636('0x111')});db[_0x4636('0x60')][_0x4636('0x113')](db[_0x4636('0x7c')],{'as':_0x4636('0x169'),'foreignKey':_0x4636('0x17a')});db[_0x4636('0x60')][_0x4636('0x113')](db['ChatProactiveAction'],{'as':_0x4636('0x193')});db['ChatWebsite'][_0x4636('0x113')](db[_0x4636('0x11a')],{'as':_0x4636('0x16b')});db[_0x4636('0x60')][_0x4636('0x113')](db[_0x4636('0x63')],{'as':'Applications'});db[_0x4636('0x60')][_0x4636('0x113')](db[_0x4636('0x65')],{'as':_0x4636('0x15b')});db[_0x4636('0x60')]['belongsTo'](db[_0x4636('0xf5')],{'as':'List','foreignKey':_0x4636('0x16d')});db[_0x4636('0x60')][_0x4636('0x14e')](db['Interval'],{'as':_0x4636('0x80'),'foreignKey':_0x4636('0x153')});db['ChatWebsite']['belongsTo'](db[_0x4636('0x3c')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x4636('0x60')][_0x4636('0x14e')](db[_0x4636('0x154')],{'as':_0x4636('0x155'),'foreignKey':_0x4636('0x16f')});db['ChatWebsite'][_0x4636('0x122')](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':'user_has_chat_websites'});db[_0x4636('0x61')][_0x4636('0x14e')](db[_0x4636('0x57')],{});db[_0x4636('0x61')]['belongsTo'](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x61')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':'Contact','foreignKey':_0x4636('0x161')});db[_0x4636('0x61')][_0x4636('0x14e')](db[_0x4636('0x5b')],{});db[_0x4636('0x61')][_0x4636('0x14e')](db[_0x4636('0x5d')],{});db[_0x4636('0x61')]['belongsTo'](db['User'],{});db[_0x4636('0x61')]['belongsTo'](db[_0x4636('0x5f')],{});db['ChatApplication']['belongsTo'](db[_0x4636('0x13')],{'as':_0x4636('0x194'),'foreignKey':'UserId','onDelete':'restrict'});db['ChatApplication'][_0x4636('0x14e')](db[_0x4636('0x69')],{'as':_0x4636('0x195'),'foreignKey':_0x4636('0x196'),'onDelete':_0x4636('0x164')});db[_0x4636('0x63')][_0x4636('0x14e')](db[_0x4636('0x60')],{'as':_0x4636('0x197'),'foreignKey':'ChatWebsiteId','onDelete':'restrict'});db[_0x4636('0x63')][_0x4636('0x14e')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x4636('0x17b')});db[_0x4636('0x11a')][_0x4636('0x113')](db[_0x4636('0x65')],{'as':'Messages','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x198')});db['ChatInteraction'][_0x4636('0x14e')](db['ChatWebsite'],{'as':_0x4636('0x172'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction']['belongsTo'](db[_0x4636('0x6e')],{'as':'Contact','foreignKey':_0x4636('0x161')});db['ChatInteraction'][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':_0x4636('0x18f'),'foreignKey':_0x4636('0x112')});db[_0x4636('0x11a')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x199'),'as':_0x4636('0x175')});db[_0x4636('0x11a')][_0x4636('0x122')](db['Tag'],{'through':_0x4636('0x199'),'as':_0x4636('0x176')});db[_0x4636('0x11a')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':_0x4636('0x183'),'through':_0x4636('0x12c'),'foreignKey':_0x4636('0x198')});db[_0x4636('0x65')]['belongsTo'](db[_0x4636('0x13')],{'onDelete':_0x4636('0x111'),'as':_0x4636('0x13')});db[_0x4636('0x65')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'onDelete':_0x4636('0x111'),'as':'Contact','foreignKey':'ContactId'});db[_0x4636('0x65')]['belongsTo'](db[_0x4636('0x11a')],{'onDelete':_0x4636('0x111'),'as':'Interaction','foreignKey':'ChatInteractionId'});db[_0x4636('0x65')]['belongsTo'](db['Attachment'],{'as':_0x4636('0x177'),'foreignKey':'AttachmentId'});db[_0x4636('0x65')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':_0x4636('0x17a')});db[_0x4636('0x67')][_0x4636('0x113')](db['Attachment'],{'as':_0x4636('0x19a'),'foreignKey':_0x4636('0x19b'),'onDelete':_0x4636('0x111'),'hooks':!![]});db[_0x4636('0x67')]['belongsTo'](db[_0x4636('0x6e')],{'onDelete':_0x4636('0x111'),'as':_0x4636('0x173'),'foreignKey':_0x4636('0x161')});db[_0x4636('0x67')]['belongsTo'](db['ChatWebsite'],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x17a')});db[_0x4636('0x69')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':'UserChatQueue','hooks':!![]});db[_0x4636('0x69')][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x19c'),'as':_0x4636('0x159')});db[_0x4636('0x123')]['hasMany'](db[_0x4636('0xce')],{'as':'Messages','foreignKey':_0x4636('0x19d'),'onDelete':_0x4636('0x111')});db[_0x4636('0x123')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Members','through':_0x4636('0x125')});db['ChatProactiveAction'][_0x4636('0x14e')](db[_0x4636('0x60')],{'as':_0x4636('0x197'),'foreignKey':_0x4636('0x17a')});db[_0x4636('0x6c')][_0x4636('0x113')](db['CmContact'],{'as':_0x4636('0x126'),'foreignKey':_0x4636('0x19e')});db[_0x4636('0x6e')][_0x4636('0x113')](db['CmHopper'],{'as':_0x4636('0x19f'),'foreignKey':_0x4636('0x161')});db[_0x4636('0x6e')][_0x4636('0x113')](db[_0x4636('0x73')],{'as':'HopperFinals','foreignKey':_0x4636('0x161')});db[_0x4636('0x6e')]['hasMany'](db[_0x4636('0x117')],{'as':_0x4636('0x14b'),'foreignKey':_0x4636('0x161')});db[_0x4636('0x6e')][_0x4636('0x113')](db[_0x4636('0x76')],{'as':'ReportAgentPreview','foreignKey':'ContactId'});db[_0x4636('0x6e')][_0x4636('0x113')](db['JscriptySessionReport'],{'as':_0x4636('0x14d'),'foreignKey':_0x4636('0x161')});db[_0x4636('0x6e')][_0x4636('0x113')](db[_0x4636('0x5b')],{'as':_0x4636('0x119'),'foreignKey':'ContactId','onDelete':_0x4636('0x164')});db['CmContact'][_0x4636('0x113')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x4636('0x161'),'onDelete':_0x4636('0x164')});db[_0x4636('0x6e')][_0x4636('0x113')](db[_0x4636('0x53')],{'as':_0x4636('0x11b'),'foreignKey':_0x4636('0x161'),'onDelete':'restrict'});db[_0x4636('0x6e')][_0x4636('0x113')](db['FaxInteraction'],{'as':_0x4636('0x11c'),'foreignKey':_0x4636('0x161'),'onDelete':_0x4636('0x164')});db['CmContact'][_0x4636('0x113')](db[_0x4636('0x40')],{'as':_0x4636('0x11d'),'foreignKey':'ContactId','onDelete':_0x4636('0x164')});db[_0x4636('0x6e')][_0x4636('0x14e')](db[_0x4636('0x6c')],{'as':_0x4636('0x1a0'),'foreignKey':_0x4636('0x19e')});db[_0x4636('0x6e')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d'),'onDelete':_0x4636('0x111')});db[_0x4636('0x6e')][_0x4636('0x122')](db['User'],{'as':'Users','through':'cm_user_has_contacts'});db[_0x4636('0x6e')]['belongsToMany'](db[_0x4636('0x88')],{'as':_0x4636('0x175'),'through':_0x4636('0x1a1')});db[_0x4636('0x6e')][_0x4636('0x122')](db['Tag'],{'through':_0x4636('0x1a1'),'as':_0x4636('0x176')});db[_0x4636('0x6f')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':'Contact','foreignKey':_0x4636('0x161'),'onDelete':_0x4636('0x111')});db[_0x4636('0x6f')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d'),'onDelete':_0x4636('0x111')});db[_0x4636('0x6f')][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':_0x4636('0x194'),'foreignKey':'UserId'});db[_0x4636('0x6f')][_0x4636('0x14e')](db[_0x4636('0x130')],{'as':_0x4636('0x195'),'foreignKey':_0x4636('0x14a'),'onDelete':_0x4636('0x111')});db[_0x4636('0x6f')]['belongsTo'](db['Campaign'],{'as':_0x4636('0xe7'),'foreignKey':_0x4636('0x1a2'),'onDelete':'cascade'});db[_0x4636('0x6f')]['belongsTo'](db['User'],{'as':_0x4636('0x18f'),'foreignKey':'OwnerId'});db[_0x4636('0x71')][_0x4636('0x14e')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x4636('0x111')});db[_0x4636('0x71')]['belongsTo'](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':'ListId','onDelete':_0x4636('0x111')});db['CmHopperBlack'][_0x4636('0x14e')](db[_0x4636('0x130')],{'as':_0x4636('0x195'),'foreignKey':_0x4636('0x14a'),'onDelete':'cascade'});db[_0x4636('0x71')]['belongsTo'](db[_0x4636('0xe7')],{'as':_0x4636('0xe7'),'foreignKey':_0x4636('0x1a2'),'onDelete':_0x4636('0x111')});db[_0x4636('0x7b')][_0x4636('0x113')](db['Condition'],{'as':{'plural':_0x4636('0x1a3'),'singular':_0x4636('0x1a4')},'foreignKey':_0x4636('0x1a5'),'onDelete':_0x4636('0x111'),'hooks':!![]});db[_0x4636('0x7b')][_0x4636('0x113')](db['Condition'],{'as':{'plural':_0x4636('0x1a6'),'singular':_0x4636('0x1a7')},'foreignKey':_0x4636('0x1a8'),'onDelete':_0x4636('0x111'),'hooks':!![]});db['Automation']['hasMany'](db[_0x4636('0x79')],{'as':_0x4636('0x1a9'),'foreignKey':'AutomationId','onDelete':_0x4636('0x111'),'hooks':!![]});db['Disposition'][_0x4636('0x113')](db[_0x4636('0x167')],{'as':_0x4636('0x168'),'foreignKey':_0x4636('0x1aa'),'onDelete':_0x4636('0x111')});db['Interval'][_0x4636('0x113')](db[_0x4636('0x80')],{'as':_0x4636('0x1ab'),'foreignKey':_0x4636('0x153'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x4636('0x80')][_0x4636('0x113')](db[_0x4636('0x19')],{'as':_0x4636('0x115'),'foreignKey':_0x4636('0x153'),'onDelete':_0x4636('0x164')});db[_0x4636('0x80')][_0x4636('0x113')](db['MailApplication'],{'as':_0x4636('0x1ac'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x80')][_0x4636('0x113')](db[_0x4636('0x63')],{'as':'ChatApplications','foreignKey':'IntervalId'});db[_0x4636('0x80')]['hasMany'](db[_0x4636('0x48')],{'as':_0x4636('0x1ad'),'foreignKey':'IntervalId'});db['Interval'][_0x4636('0x113')](db[_0x4636('0x51')],{'as':_0x4636('0x1ae'),'foreignKey':_0x4636('0x153')});db[_0x4636('0x85')][_0x4636('0x14e')](db[_0x4636('0x3c')],{});db[_0x4636('0x85')][_0x4636('0x14e')](db['AnalyticDefaultReport'],{'foreignKey':_0x4636('0x1af')});db[_0x4636('0x85')][_0x4636('0x14e')](db[_0x4636('0x93')],{'foreignKey':_0x4636('0x1b0')});db[_0x4636('0x86')][_0x4636('0x122')](db[_0x4636('0x1b')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0x4636('0x164')});db[_0x4636('0x88')]['belongsToMany'](db['CmContact'],{'through':'cm_contact_has_tags'});db[_0x4636('0x88')]['belongsToMany'](db[_0x4636('0x11a')],{'through':_0x4636('0x199')});db[_0x4636('0x88')][_0x4636('0x122')](db[_0x4636('0x40')],{'through':_0x4636('0x174')});db[_0x4636('0x88')][_0x4636('0x122')](db[_0x4636('0x53')],{'through':_0x4636('0x187')});db[_0x4636('0x88')]['belongsToMany'](db[_0x4636('0x4a')],{'through':_0x4636('0x182')});db[_0x4636('0x88')]['belongsToMany'](db[_0x4636('0x5b')],{'through':_0x4636('0x190')});db['Tag']['belongsToMany'](db[_0x4636('0x101')],{'through':'whatsapp_interaction_has_tags'});db[_0x4636('0x8c')]['hasMany'](db[_0x4636('0x7e')],{'as':{'plural':'AllConditions','singular':_0x4636('0x1b1')},'foreignKey':'TriggerAllId','onDelete':_0x4636('0x111'),'hooks':!![]});db[_0x4636('0x8c')][_0x4636('0x113')](db['Condition'],{'as':{'plural':'AnyConditions','singular':_0x4636('0x1b2')},'foreignKey':_0x4636('0x1b3'),'onDelete':'cascade','hooks':!![]});db[_0x4636('0x8c')][_0x4636('0x113')](db[_0x4636('0x79')],{'as':_0x4636('0x1a9'),'foreignKey':_0x4636('0x1b4'),'onDelete':_0x4636('0x111'),'hooks':!![]});db[_0x4636('0x93')][_0x4636('0x113')](db[_0x4636('0x99')],{'as':'Fields','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b0'),'hooks':!![]});db['AnalyticDefaultReport'][_0x4636('0x113')](db['AnalyticFieldReport'],{'as':_0x4636('0x1b5'),'onDelete':_0x4636('0x111'),'foreignKey':'DefaultReportId'});db[_0x4636('0x97')][_0x4636('0x113')](db[_0x4636('0x99')],{'as':'Fields','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b6')});db[_0x4636('0x99')]['belongsTo'](db[_0x4636('0x97')],{'foreignKey':_0x4636('0x1b6')});db['SalesforceAccount'][_0x4636('0x113')](db['SalesforceConfiguration'],{'as':_0x4636('0x1b7'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0x9f')][_0x4636('0x113')](db[_0x4636('0xa1')],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1ba')});db['SalesforceConfiguration'][_0x4636('0x113')](db[_0x4636('0xa1')],{'as':_0x4636('0x1bb'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bc')});db['SalesforceConfiguration'][_0x4636('0x113')](db[_0x4636('0xa1')],{'as':_0x4636('0x1b5'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0x9f')][_0x4636('0x14e')](db[_0x4636('0x9d')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xa1')][_0x4636('0x113')](db['SalesforceField'],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xa1')][_0x4636('0x113')](db[_0x4636('0xa1')],{'as':'Description','foreignKey':_0x4636('0x1bc')});db[_0x4636('0xa1')][_0x4636('0x113')](db[_0x4636('0xa1')],{'as':_0x4636('0x1bf'),'foreignKey':'FieldId'});db[_0x4636('0xa1')]['belongsTo'](db[_0x4636('0x8e')],{'as':'Variable','foreignKey':_0x4636('0x1c0')});db['SugarcrmAccount'][_0x4636('0x113')](db[_0x4636('0x1c1')],{'as':_0x4636('0x1b7'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x4636('0x1c1')][_0x4636('0x113')](db[_0x4636('0xa5')],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration'][_0x4636('0x113')](db[_0x4636('0xa5')],{'as':_0x4636('0x1bb'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0x1c1')]['hasMany'](db[_0x4636('0xa5')],{'as':_0x4636('0x1b5'),'onDelete':'cascade','foreignKey':_0x4636('0x1bd')});db[_0x4636('0x1c1')][_0x4636('0x14e')](db[_0x4636('0x1c2')],{'as':'Account','foreignKey':_0x4636('0x1b8')});db[_0x4636('0xa5')]['hasMany'](db[_0x4636('0xa5')],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xa5')][_0x4636('0x113')](db[_0x4636('0xa5')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xa5')][_0x4636('0x113')](db[_0x4636('0xa5')],{'as':_0x4636('0x1bf'),'foreignKey':'FieldId'});db[_0x4636('0xa5')][_0x4636('0x14e')](db[_0x4636('0x8e')],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0xa7')]['hasMany'](db[_0x4636('0xa9')],{'as':'Configurations','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xa9')][_0x4636('0x113')](db['DeskField'],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xa9')]['hasMany'](db[_0x4636('0xaa')],{'as':'Descriptions','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bc')});db['DeskConfiguration'][_0x4636('0x113')](db[_0x4636('0xaa')],{'as':_0x4636('0x1b5'),'onDelete':'cascade','foreignKey':_0x4636('0x1bd')});db['DeskConfiguration'][_0x4636('0x14e')](db[_0x4636('0xa7')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xa9')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x1c4')});db[_0x4636('0xaa')]['hasMany'](db['DeskField'],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xaa')][_0x4636('0x113')](db[_0x4636('0xaa')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xaa')]['hasMany'](db[_0x4636('0xaa')],{'as':_0x4636('0x1bf'),'foreignKey':'FieldId'});db['DeskField'][_0x4636('0x14e')](db['Variable'],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0x1c5')][_0x4636('0x113')](db[_0x4636('0xac')],{'as':_0x4636('0x1b7'),'onDelete':'cascade','foreignKey':_0x4636('0x1b8')});db[_0x4636('0xac')][_0x4636('0x113')](db['ZohoField'],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xac')][_0x4636('0x113')](db[_0x4636('0xad')],{'as':'Descriptions','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xac')]['hasMany'](db['ZohoField'],{'as':'Fields','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0xac')][_0x4636('0x14e')](db[_0x4636('0x1c5')],{'as':'Account','foreignKey':_0x4636('0x1b8')});db['ZohoField'][_0x4636('0x113')](db[_0x4636('0xad')],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xad')][_0x4636('0x113')](db[_0x4636('0xad')],{'as':'Description','foreignKey':_0x4636('0x1bc')});db['ZohoField'][_0x4636('0x113')](db['ZohoField'],{'as':_0x4636('0x1bf'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0xad')][_0x4636('0x14e')](db['Variable'],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0xae')][_0x4636('0x113')](db[_0x4636('0xaf')],{'as':'Configurations','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xaf')][_0x4636('0x113')](db[_0x4636('0xb1')],{'as':_0x4636('0x1b9'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xaf')][_0x4636('0x113')](db[_0x4636('0xb1')],{'as':_0x4636('0x1bb'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xaf')][_0x4636('0x113')](db['ZendeskField'],{'as':_0x4636('0x1b5'),'foreignKey':'FieldId'});db[_0x4636('0xaf')][_0x4636('0x14e')](db[_0x4636('0xae')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1b8')});db['ZendeskConfiguration'][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x1c6')});db['ZendeskField']['hasMany'](db[_0x4636('0xb1')],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db['ZendeskField']['hasMany'](db[_0x4636('0xb1')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xb1')][_0x4636('0x113')](db[_0x4636('0xb1')],{'as':'Field','foreignKey':_0x4636('0x1bd')});db[_0x4636('0xb1')][_0x4636('0x14e')](db[_0x4636('0x8e')],{'as':'Variable','foreignKey':'VariableId'});db[_0x4636('0xb3')][_0x4636('0x113')](db[_0x4636('0xb5')],{'as':'Configurations','onDelete':_0x4636('0x111'),'foreignKey':'AccountId'});db[_0x4636('0xb5')]['hasMany'](db[_0x4636('0xb7')],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xb5')][_0x4636('0x113')](db[_0x4636('0xb7')],{'as':'Descriptions','onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xb5')][_0x4636('0x113')](db[_0x4636('0xb7')],{'as':_0x4636('0x1b5'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0xb5')][_0x4636('0x14e')](db[_0x4636('0xb3')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xb5')][_0x4636('0x122')](db['Tag'],{'through':_0x4636('0x1c7')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':'Subject','foreignKey':_0x4636('0x1ba')});db['FreshdeskField'][_0x4636('0x113')](db[_0x4636('0xb7')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xb7')][_0x4636('0x113')](db[_0x4636('0xb7')],{'as':_0x4636('0x1bf'),'foreignKey':'FieldId'});db['FreshdeskField'][_0x4636('0x14e')](db[_0x4636('0x8e')],{'as':'Variable','foreignKey':_0x4636('0x1c0')});db[_0x4636('0xb9')][_0x4636('0x113')](db[_0x4636('0xbb')],{'as':_0x4636('0x1b7'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db['VtigerConfiguration']['hasMany'](db[_0x4636('0xbd')],{'as':_0x4636('0x1b9'),'foreignKey':_0x4636('0x1ba')});db['VtigerConfiguration'][_0x4636('0x113')](db[_0x4636('0xbd')],{'as':_0x4636('0x1bb'),'foreignKey':'DescriptionId'});db[_0x4636('0xbb')]['hasMany'](db['VtigerField'],{'as':_0x4636('0x1b5'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0xbb')]['belongsTo'](db[_0x4636('0xb9')],{'as':'Account','foreignKey':'AccountId'});db[_0x4636('0xbd')][_0x4636('0x113')](db[_0x4636('0xbd')],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db[_0x4636('0xbd')][_0x4636('0x113')](db['VtigerField'],{'as':_0x4636('0x1c3'),'foreignKey':'DescriptionId'});db[_0x4636('0xbd')][_0x4636('0x113')](db[_0x4636('0xbd')],{'as':'Field','foreignKey':_0x4636('0x1bd')});db[_0x4636('0xbd')][_0x4636('0x14e')](db[_0x4636('0x8e')],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0xbe')][_0x4636('0x113')](db[_0x4636('0xbf')],{'as':_0x4636('0x1b7'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xbf')][_0x4636('0x113')](db[_0x4636('0xc1')],{'as':_0x4636('0x1b9'),'foreignKey':'SubjectId'});db[_0x4636('0xbf')]['hasMany'](db[_0x4636('0xc1')],{'as':'Descriptions','foreignKey':_0x4636('0x1bc')});db[_0x4636('0xbf')][_0x4636('0x113')](db[_0x4636('0xc1')],{'as':_0x4636('0x1b5'),'foreignKey':_0x4636('0x1bd')});db['ServicenowConfiguration']['belongsTo'](db['ServicenowAccount'],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0xc1')][_0x4636('0x113')](db[_0x4636('0xc1')],{'as':_0x4636('0x1be'),'foreignKey':'SubjectId'});db[_0x4636('0xc1')][_0x4636('0x113')](db[_0x4636('0xc1')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xc1')][_0x4636('0x113')](db[_0x4636('0xc1')],{'as':_0x4636('0x1bf'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0xc1')]['belongsTo'](db[_0x4636('0x8e')],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0x1c8')][_0x4636('0x113')](db['Dynamics365Configuration'],{'as':_0x4636('0x1b7'),'onDelete':_0x4636('0x111'),'foreignKey':'AccountId'});db[_0x4636('0xc3')][_0x4636('0x113')](db[_0x4636('0xc5')],{'as':_0x4636('0x1b9'),'onDelete':_0x4636('0x111'),'foreignKey':'SubjectId'});db[_0x4636('0xc3')][_0x4636('0x113')](db['Dynamics365Field'],{'as':_0x4636('0x1bb'),'onDelete':'cascade','foreignKey':_0x4636('0x1bc')});db[_0x4636('0xc3')][_0x4636('0x113')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x4636('0x111'),'foreignKey':'FieldId'});db['Dynamics365Configuration'][_0x4636('0x14e')](db[_0x4636('0x1c8')],{'as':'Account','foreignKey':_0x4636('0x1b8')});db[_0x4636('0xc5')][_0x4636('0x113')](db[_0x4636('0xc5')],{'as':_0x4636('0x1be'),'foreignKey':'SubjectId'});db[_0x4636('0xc5')][_0x4636('0x113')](db[_0x4636('0xc5')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db['Dynamics365Field'][_0x4636('0x113')](db['Dynamics365Field'],{'as':_0x4636('0x1bf'),'foreignKey':'FieldId'});db['Dynamics365Field'][_0x4636('0x14e')](db['Variable'],{'as':'Variable','foreignKey':_0x4636('0x1c0')});db[_0x4636('0xc7')]['hasMany'](db[_0x4636('0x1c9')],{'as':_0x4636('0x1b7'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1b8')});db[_0x4636('0x1c9')][_0x4636('0x113')](db['FreshsalesField'],{'as':_0x4636('0x1b9'),'foreignKey':'SubjectId'});db[_0x4636('0x1c9')]['hasMany'](db['FreshsalesField'],{'as':_0x4636('0x1bb'),'foreignKey':_0x4636('0x1bc')});db['FreshsalesConfiguration'][_0x4636('0x113')](db['FreshsalesField'],{'as':_0x4636('0x1b5'),'foreignKey':_0x4636('0x1bd')});db[_0x4636('0x1c9')][_0x4636('0x14e')](db[_0x4636('0xc7')],{'as':'Account','foreignKey':'AccountId'});db[_0x4636('0xca')][_0x4636('0x113')](db[_0x4636('0xca')],{'as':_0x4636('0x1be'),'foreignKey':_0x4636('0x1ba')});db['FreshsalesField'][_0x4636('0x113')](db[_0x4636('0xca')],{'as':_0x4636('0x1c3'),'foreignKey':_0x4636('0x1bc')});db[_0x4636('0xca')]['hasMany'](db[_0x4636('0xca')],{'as':'Field','foreignKey':_0x4636('0x1bd')});db[_0x4636('0xca')][_0x4636('0x14e')](db[_0x4636('0x8e')],{'as':_0x4636('0x8e'),'foreignKey':_0x4636('0x1c0')});db[_0x4636('0x1ca')][_0x4636('0x14e')](db[_0x4636('0x60')],{});db[_0x4636('0x1ca')][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x1ca')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':_0x4636('0x161')});db['ChatQueueReport'][_0x4636('0x14e')](db[_0x4636('0x11a')],{});db['ChatQueueReport']['belongsTo'](db[_0x4636('0x65')],{});db['ChatQueueReport'][_0x4636('0x14e')](db['User'],{});db[_0x4636('0x1ca')][_0x4636('0x14e')](db[_0x4636('0x69')],{});db[_0x4636('0xce')][_0x4636('0x14e')](db[_0x4636('0x13')],{'onDelete':'cascade','foreignKey':_0x4636('0x1cb')});db[_0x4636('0xce')]['belongsTo'](db[_0x4636('0x13')],{'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1cc')});db[_0x4636('0xd4')][_0x4636('0x113')](db[_0x4636('0xd2')],{'foreignKey':_0x4636('0x1cd'),'onDelete':_0x4636('0x111')});db['JscriptySessionReport'][_0x4636('0x113')](db['JscriptyAnswerReport'],{'foreignKey':_0x4636('0x1cd'),'onDelete':_0x4636('0x111')});db[_0x4636('0xd5')][_0x4636('0x14e')](db[_0x4636('0x4f')],{});db[_0x4636('0xd5')][_0x4636('0x14e')](db['CmList'],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0xd5')][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0xd5')]['belongsTo'](db[_0x4636('0x53')],{});db[_0x4636('0xd5')]['belongsTo'](db[_0x4636('0x54')],{});db['SmsQueueReport'][_0x4636('0x14e')](db[_0x4636('0x13')],{});db[_0x4636('0xd5')][_0x4636('0x14e')](db[_0x4636('0x55')],{});db[_0x4636('0xd9')][_0x4636('0x113')](db[_0x4636('0xd4')],{'foreignKey':_0x4636('0x1ce')});db[_0x4636('0xd9')][_0x4636('0x113')](db[_0x4636('0xd2')],{'foreignKey':_0x4636('0x1ce')});db[_0x4636('0xd9')][_0x4636('0x113')](db[_0x4636('0xd0')],{'foreignKey':_0x4636('0x1ce')});db[_0x4636('0xde')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':_0x4636('0x183'),'through':_0x4636('0x143')});db[_0x4636('0xe3')]['belongsToMany'](db['User'],{'as':_0x4636('0x158'),'through':'user_has_teams'});db['Team'][_0x4636('0x122')](db['VoiceQueue'],{'through':_0x4636('0x10c'),'as':_0x4636('0x131')});db[_0x4636('0xe3')][_0x4636('0x122')](db['MailQueue'],{'through':'team_has_mail_queues','as':'MailQueues'});db[_0x4636('0xe3')][_0x4636('0x122')](db['ChatQueue'],{'through':_0x4636('0x19c'),'as':'ChatQueues'});db[_0x4636('0xe3')]['belongsToMany'](db[_0x4636('0x4c')],{'through':_0x4636('0x184'),'as':_0x4636('0x136')});db[_0x4636('0xe3')][_0x4636('0x122')](db[_0x4636('0x55')],{'through':_0x4636('0x18b'),'as':'SmsQueues'});db[_0x4636('0xe3')][_0x4636('0x122')](db[_0x4636('0x5f')],{'through':_0x4636('0x192'),'as':'OpenchannelQueues'});db[_0x4636('0xe3')]['belongsToMany'](db[_0x4636('0x108')],{'through':_0x4636('0x1cf'),'as':_0x4636('0x138')});db[_0x4636('0xe3')][_0x4636('0x122')](db[_0x4636('0xf7')],{'through':_0x4636('0x10d'),'as':'VoicePrefixes'});db[_0x4636('0xe7')][_0x4636('0x113')](db[_0x4636('0x6f')],{'as':_0x4636('0x19f'),'foreignKey':_0x4636('0x1a2')});db[_0x4636('0xe7')][_0x4636('0x113')](db[_0x4636('0x73')],{'as':_0x4636('0x116'),'foreignKey':_0x4636('0x1a2')});db['Campaign'][_0x4636('0x113')](db[_0x4636('0x117')],{'as':_0x4636('0x14b'),'foreignKey':_0x4636('0x1a2')});db[_0x4636('0xe7')][_0x4636('0x113')](db[_0x4636('0x71')],{'as':_0x4636('0x14c'),'foreignKey':_0x4636('0x1a2')});db[_0x4636('0xe7')][_0x4636('0x14e')](db[_0x4636('0x14f')],{'as':_0x4636('0x14f'),'foreignKey':_0x4636('0x150')});db[_0x4636('0xe7')][_0x4636('0x14e')](db[_0x4636('0x14f')],{'as':_0x4636('0x151'),'foreignKey':_0x4636('0x152')});db['Campaign']['belongsTo'](db[_0x4636('0x80')],{'as':_0x4636('0x80'),'foreignKey':_0x4636('0x153')});db['Campaign'][_0x4636('0x14e')](db[_0x4636('0xde')],{'as':'SquareProject','foreignKey':_0x4636('0x1d0')});db[_0x4636('0xe7')][_0x4636('0x122')](db['CmList'],{'as':_0x4636('0x156'),'through':_0x4636('0x1d1')});db[_0x4636('0xe7')][_0x4636('0x122')](db['CmList'],{'as':_0x4636('0x1d2'),'through':_0x4636('0x1d3')});db[_0x4636('0x177')][_0x4636('0x14e')](db[_0x4636('0x67')],{'as':'ChatOfflineMessage','foreignKey':_0x4636('0x19b')});db[_0x4636('0xed')][_0x4636('0x14e')](db['MailMessage'],{});db[_0x4636('0xed')][_0x4636('0x14e')](db[_0x4636('0x40')],{});db[_0x4636('0xed')][_0x4636('0x14e')](db[_0x4636('0x3c')],{'foreignKey':_0x4636('0x1d4'),'as':_0x4636('0x1d5')});db[_0x4636('0xed')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x4636('0xed')]['belongsTo'](db['User'],{'foreignKey':_0x4636('0x1d6'),'as':_0x4636('0x1d7')});db[_0x4636('0xed')]['belongsTo'](db[_0x4636('0x3e')],{'foreignKey':_0x4636('0x1d8'),'as':_0x4636('0x1d9')});db[_0x4636('0xed')][_0x4636('0x14e')](db[_0x4636('0x3c')],{'foreignKey':_0x4636('0x1da'),'as':'ToAccount'});db['ChatTransferReport']['belongsTo'](db[_0x4636('0x65')],{});db['ChatTransferReport']['belongsTo'](db[_0x4636('0x11a')],{});db[_0x4636('0x1db')][_0x4636('0x14e')](db[_0x4636('0x60')],{'foreignKey':'FromChatWebsiteId','as':_0x4636('0x1d5')});db[_0x4636('0x1db')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':_0x4636('0x1dc'),'as':_0x4636('0x1dd')});db[_0x4636('0x1db')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':'ToUserId','as':'ToAgent'});db['ChatTransferReport'][_0x4636('0x14e')](db[_0x4636('0x69')],{'foreignKey':_0x4636('0x1de'),'as':'ToQueue'});db[_0x4636('0x1db')][_0x4636('0x14e')](db[_0x4636('0x60')],{'foreignKey':_0x4636('0x1df'),'as':_0x4636('0x1e0')});db['FaxTransferReport'][_0x4636('0x14e')](db[_0x4636('0x180')],{});db[_0x4636('0xef')][_0x4636('0x14e')](db['FaxInteraction'],{});db['FaxTransferReport'][_0x4636('0x14e')](db[_0x4636('0x46')],{'foreignKey':'FromFaxAccountId','as':_0x4636('0x1d5')});db[_0x4636('0xef')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':'FromUserId','as':_0x4636('0x1dd')});db['FaxTransferReport'][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':'ToUserId','as':_0x4636('0x1d7')});db['FaxTransferReport'][_0x4636('0x14e')](db['FaxQueue'],{'foreignKey':_0x4636('0x1e1'),'as':_0x4636('0x1d9')});db[_0x4636('0xef')][_0x4636('0x14e')](db[_0x4636('0x46')],{'foreignKey':_0x4636('0x1e2'),'as':_0x4636('0x1e0')});db[_0x4636('0xf1')]['belongsTo'](db[_0x4636('0x5d')],{});db[_0x4636('0xf1')][_0x4636('0x14e')](db['OpenchannelInteraction'],{});db[_0x4636('0xf1')][_0x4636('0x14e')](db[_0x4636('0x57')],{'foreignKey':_0x4636('0x1e3'),'as':_0x4636('0x1d5')});db[_0x4636('0xf1')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':'FromUserId','as':_0x4636('0x1dd')});db[_0x4636('0xf1')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':_0x4636('0x1d6'),'as':_0x4636('0x1d7')});db[_0x4636('0xf1')][_0x4636('0x14e')](db[_0x4636('0x5f')],{'foreignKey':_0x4636('0x1e4'),'as':_0x4636('0x1d9')});db[_0x4636('0xf1')][_0x4636('0x14e')](db[_0x4636('0x57')],{'foreignKey':_0x4636('0x1e5'),'as':_0x4636('0x1e0')});db[_0x4636('0xf3')][_0x4636('0x14e')](db['SmsMessage'],{});db[_0x4636('0xf3')]['belongsTo'](db[_0x4636('0x53')],{});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':'FromSmsAccountId','as':_0x4636('0x1d5')});db[_0x4636('0xf3')][_0x4636('0x14e')](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x4636('0xf3')][_0x4636('0x14e')](db['User'],{'foreignKey':_0x4636('0x1d6'),'as':'ToAgent'});db[_0x4636('0xf3')]['belongsTo'](db[_0x4636('0x55')],{'foreignKey':_0x4636('0x1e6'),'as':_0x4636('0x1d9')});db[_0x4636('0xf3')]['belongsTo'](db[_0x4636('0x4f')],{'foreignKey':'ToSmsAccountId','as':'ToAccount'});db['CmList']['hasMany'](db[_0x4636('0x167')],{'as':'Dispositions','foreignKey':_0x4636('0x16d'),'onDelete':_0x4636('0x111')});db[_0x4636('0xf5')][_0x4636('0x113')](db[_0x4636('0x1e7')],{'as':_0x4636('0x1e8'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0xf5')][_0x4636('0x113')](db[_0x4636('0x6e')],{'as':_0x4636('0x126'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x16d')});db['CmList'][_0x4636('0x113')](db['CmHopperFinal'],{'as':_0x4636('0x116'),'foreignKey':'ListId'});db[_0x4636('0xf5')][_0x4636('0x113')](db[_0x4636('0x117')],{'as':_0x4636('0x118'),'foreignKey':_0x4636('0x16d')});db['CmList'][_0x4636('0x113')](db[_0x4636('0x76')],{'as':'ReportAgentPreview','foreignKey':_0x4636('0x16d')});db['CmList'][_0x4636('0x122')](db['VoiceQueue'],{'as':_0x4636('0x1e9'),'through':_0x4636('0x157')});db[_0x4636('0xf5')][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Agents','through':_0x4636('0x128')});db[_0x4636('0xf7')][_0x4636('0x113')](db[_0x4636('0x19')],{'as':_0x4636('0x115'),'onDelete':'cascade'});db['VoicePrefix'][_0x4636('0x122')](db[_0x4636('0x13')],{'as':'Agents','through':_0x4636('0x132')});db['VoicePrefix'][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':'TeamVoicePrefix','as':_0x4636('0x159')});db[_0x4636('0xf9')][_0x4636('0x113')](db['User'],{'as':_0x4636('0x183'),'foreignKey':'userProfileId'});db[_0x4636('0xf9')][_0x4636('0x113')](db[_0x4636('0x1ea')],{'as':'UserProfileSections','foreignKey':'userProfileId','onDelete':_0x4636('0x111')});db[_0x4636('0x1ea')][_0x4636('0x113')](db[_0x4636('0xfb')],{'as':_0x4636('0x1eb'),'foreignKey':_0x4636('0x1ec'),'onDelete':_0x4636('0x111')});db[_0x4636('0x140')][_0x4636('0x113')](db['Disposition'],{'as':_0x4636('0x168'),'foreignKey':_0x4636('0x1ed'),'onDelete':_0x4636('0x111')});db[_0x4636('0x140')][_0x4636('0x113')](db['CannedAnswer'],{'as':_0x4636('0x169'),'foreignKey':'WhatsappAccountId'});db[_0x4636('0x140')][_0x4636('0x113')](db['WhatsappMessage'],{'as':'Messages','foreignKey':_0x4636('0x1ed')});db[_0x4636('0x140')][_0x4636('0x113')](db[_0x4636('0x101')],{'as':'Interactions'});db[_0x4636('0x140')]['hasMany'](db[_0x4636('0xff')],{'as':_0x4636('0x146')});db['WhatsappAccount']['belongsTo'](db['CmList'],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x140')][_0x4636('0x14e')](db[_0x4636('0x154')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x4636('0x140')]['belongsToMany'](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':_0x4636('0x1ee')});db['WhatsappApplication']['belongsTo'](db[_0x4636('0x13')],{'onDelete':_0x4636('0x164')});db[_0x4636('0xff')]['belongsTo'](db[_0x4636('0x108')],{'onDelete':_0x4636('0x164')});db['WhatsappApplication']['belongsTo'](db[_0x4636('0x140')],{'onDelete':_0x4636('0x164')});db['WhatsappApplication'][_0x4636('0x14e')](db['Interval'],{'onDelete':'restrict','foreignKey':_0x4636('0x153')});db[_0x4636('0xff')][_0x4636('0x14e')](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x4636('0x101')]['hasMany'](db[_0x4636('0x103')],{'as':_0x4636('0x15b'),'onDelete':_0x4636('0x111'),'foreignKey':_0x4636('0x1ef')});db['WhatsappInteraction']['belongsTo'](db[_0x4636('0x140')],{'as':_0x4636('0x172'),'foreignKey':_0x4636('0x1ed')});db['WhatsappInteraction'][_0x4636('0x14e')](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0x101')][_0x4636('0x14e')](db[_0x4636('0x13')],{'as':_0x4636('0x18f'),'foreignKey':'UserId'});db[_0x4636('0x101')]['belongsToMany'](db[_0x4636('0x88')],{'through':_0x4636('0x1f0'),'as':_0x4636('0x175')});db[_0x4636('0x101')][_0x4636('0x122')](db[_0x4636('0x88')],{'through':_0x4636('0x1f0'),'as':_0x4636('0x176')});db['WhatsappInteraction']['belongsToMany'](db['User'],{'as':_0x4636('0x183'),'through':'user_has_whatsapp_interactions','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x4636('0x13')],{'as':'User'});db['WhatsappMessage']['belongsTo'](db[_0x4636('0x6e')],{'onDelete':'cascade','as':_0x4636('0x173')});db[_0x4636('0x103')][_0x4636('0x14e')](db[_0x4636('0x101')],{'onDelete':_0x4636('0x111'),'as':'Interaction','foreignKey':'WhatsappInteractionId'});db['WhatsappMessage']['belongsTo'](db[_0x4636('0x140')],{'as':_0x4636('0x172'),'foreignKey':'WhatsappAccountId'});db['WhatsappQueueReport'][_0x4636('0x14e')](db[_0x4636('0x140')],{});db['WhatsappQueueReport'][_0x4636('0x14e')](db[_0x4636('0xf5')],{'as':_0x4636('0x16c'),'foreignKey':_0x4636('0x16d')});db[_0x4636('0x1f1')]['belongsTo'](db[_0x4636('0x6e')],{'as':_0x4636('0x173'),'foreignKey':'ContactId'});db[_0x4636('0x1f1')][_0x4636('0x14e')](db[_0x4636('0x101')],{});db[_0x4636('0x1f1')][_0x4636('0x14e')](db['WhatsappQueue'],{});db[_0x4636('0x1f1')][_0x4636('0x14e')](db['WhatsappMessage'],{});db[_0x4636('0x1f1')]['belongsTo'](db[_0x4636('0x13')],{});db[_0x4636('0x106')][_0x4636('0x14e')](db[_0x4636('0x103')],{});db[_0x4636('0x106')]['belongsTo'](db[_0x4636('0x101')],{});db[_0x4636('0x106')][_0x4636('0x14e')](db[_0x4636('0x140')],{'foreignKey':_0x4636('0x1f2'),'as':_0x4636('0x1d5')});db[_0x4636('0x106')]['belongsTo'](db[_0x4636('0x140')],{'foreignKey':_0x4636('0x1f3'),'as':_0x4636('0x1e0')});db[_0x4636('0x106')][_0x4636('0x14e')](db['WhatsappQueue'],{'foreignKey':_0x4636('0x1f4'),'as':'ToQueue'});db[_0x4636('0x106')][_0x4636('0x14e')](db[_0x4636('0x13')],{'foreignKey':_0x4636('0x1dc'),'as':_0x4636('0x1dd')});db[_0x4636('0x106')][_0x4636('0x14e')](db['User'],{'foreignKey':_0x4636('0x1d6'),'as':_0x4636('0x1d7')});db[_0x4636('0x108')]['belongsToMany'](db[_0x4636('0x13')],{'as':_0x4636('0x158'),'through':_0x4636('0x37'),'foreignKey':_0x4636('0x1f5')});db[_0x4636('0x108')][_0x4636('0x122')](db[_0x4636('0xe3')],{'through':_0x4636('0x1cf'),'as':_0x4636('0x159')});db[_0x4636('0x10a')]['hasOne'](db['MailServerIn'],{'as':_0x4636('0x165'),'onDelete':_0x4636('0x164')});db['CloudProvider'][_0x4636('0x110')](db[_0x4636('0x3b')],{'as':_0x4636('0x166'),'onDelete':_0x4636('0x164')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index d7c7ca6..8eda25a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b51=['./api/intDeskConfiguration','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','./api/chatQueueReport','/api/chat/internal/messages','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappMessage','/api/whatsapp/reports/queue','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authGoogle','/api/auth/activedirectory','./api/authActiveDirectory','/api/jira','./api/jira','/api/rpc','./api/version','./api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','3.0.0','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','resolve','appPath','/index.html','username','password','newPassword','apiKey','firstName','lastName','street','mobile','email','clientId','securityToken','code','tenantId','token','channelSecret','accessTokenSecret','authToken','consumerKey','consumerSecret','membername','calleridname','calleridnum','exten','privateKey','accesskeyid','secretaccesskey','pass','accountSid','localstationid','registry','oldPassword','isPlainObject','isArray','length','replace','@@{','}@@','lodash','path','express','express-winston','util','./config/environment','./config/logger','auth','default','use','logger','isEmpty','body','\x20body=%s','format','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','inspect','device','agent_id','method','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','./api/voiceRecording','/api/screen/recordings','/api/voice/mails','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','./api/smsApplication','/api/sms/interactions','/api/sms/messages','./api/smsMessage','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/tag','./api/template','./api/trigger','/api/variables','./api/variable','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations'];(function(_0x10bfe9,_0x280ea8){var _0x1ebee3=function(_0x4432cb){while(--_0x4432cb){_0x10bfe9['push'](_0x10bfe9['shift']());}};_0x1ebee3(++_0x280ea8);}(_0x5b51,0xa2));var _0x15b5=function(_0x4f8b2b,_0x1dc8dd){_0x4f8b2b=_0x4f8b2b-0x0;var _0x2f230a=_0x5b51[_0x4f8b2b];return _0x2f230a;};'use strict';var _=require(_0x15b5('0x0'));var path=require(_0x15b5('0x1'));var express=require(_0x15b5('0x2'));var ewinston=require(_0x15b5('0x3'));var util=require(_0x15b5('0x4'));var errors=require('./errors');var config=require(_0x15b5('0x5'));var logger=require(_0x15b5('0x6'))('api');var authLogger=require(_0x15b5('0x6'))(_0x15b5('0x7'));var safeTemplate=require('./safe-template')['safeTemplate'];exports[_0x15b5('0x8')]=function(_0x4e8260){_0x4e8260[_0x15b5('0x9')](ewinston[_0x15b5('0xa')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x42eb8f,_0x445b20){var _0x269264='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x15b5('0xb')](_0x42eb8f[_0x15b5('0xc')])){_0x269264+=_0x15b5('0xd');var _0xfb56c2=_0x42eb8f[_0x15b5('0xc')];maskSensitiveData(_0xfb56c2);}return safeTemplate(util[_0x15b5('0xe')](_0x269264,_0x42eb8f['method'],_0x42eb8f[_0x15b5('0xf')][_0x15b5('0x10')]?_0x42eb8f[_0x15b5('0xf')][_0x15b5('0x10')]:_0x42eb8f[_0x15b5('0x11')][_0x15b5('0x12')]||_0x42eb8f['ip'],_0x42eb8f[_0x15b5('0x13')],_0x445b20[_0x15b5('0x14')],_0x445b20[_0x15b5('0x15')],_0x42eb8f[_0x15b5('0x16')]?_0x42eb8f[_0x15b5('0x16')]['id']:null,_0x42eb8f[_0x15b5('0x16')]?_0x42eb8f[_0x15b5('0x16')][_0x15b5('0x17')]:null,_0x42eb8f[_0x15b5('0x16')]?_0x42eb8f[_0x15b5('0x16')][_0x15b5('0x18')]:null,_0xfb56c2?util[_0x15b5('0x19')](_0xfb56c2,![],null):''));}}));_0x4e8260[_0x15b5('0x9')](ewinston[_0x15b5('0xa')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x1ca975,_0x5862cc){var _0x2676f1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x1ca975[_0x15b5('0xc')]&&_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1a')]&&_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1b')]){_0x2676f1='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x2676f1,_0x1ca975[_0x15b5('0x1c')],_0x1ca975['headers']['x-forwarded-for']?_0x1ca975['headers'][_0x15b5('0x10')]:_0x1ca975[_0x15b5('0x11')]['remoteAddress']||_0x1ca975['ip'],_0x1ca975[_0x15b5('0x13')],_0x5862cc[_0x15b5('0x14')],_0x5862cc[_0x15b5('0x15')],_0x1ca975[_0x15b5('0x16')]?_0x1ca975[_0x15b5('0x16')]['id']:null,_0x1ca975[_0x15b5('0x16')]?_0x1ca975[_0x15b5('0x16')][_0x15b5('0x17')]:null,_0x1ca975[_0x15b5('0x16')]?_0x1ca975[_0x15b5('0x16')]['role']:null,_0x1ca975['body']&&_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1a')]?_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1a')]:_0x15b5('0x1d'),_0x1ca975[_0x15b5('0xc')]&&_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1b')]?_0x1ca975[_0x15b5('0xc')]['agent_id']:'',_0x1ca975[_0x15b5('0xc')]&&_0x1ca975[_0x15b5('0xc')][_0x15b5('0x1e')]?_0x1ca975['body'][_0x15b5('0x1e')]:'');},'ignoreRoute':function(_0x1a7c8c){var _0x65194f=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x65194f[_0x15b5('0x1f')](_0x1a7c8c[_0x15b5('0x13')]);}}));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x20'),require(_0x15b5('0x21')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x22'),require(_0x15b5('0x23')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x24'),require(_0x15b5('0x25')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x26'),require('./api/voiceExtension'));_0x4e8260['use'](_0x15b5('0x27'),require(_0x15b5('0x28')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x29'),require(_0x15b5('0x2a')));_0x4e8260[_0x15b5('0x9')]('/api/voice/recordings',require(_0x15b5('0x2b')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x2c'),require('./api/screenRecording'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x2d'),require(_0x15b5('0x2e')));_0x4e8260[_0x15b5('0x9')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x2f'),require(_0x15b5('0x30')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x31'),require(_0x15b5('0x32')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x33'),require(_0x15b5('0x34')));_0x4e8260['use']('/api/voice/queues/reports',require(_0x15b5('0x35')));_0x4e8260['use'](_0x15b5('0x36'),require(_0x15b5('0x37')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x38'),require(_0x15b5('0x39')));_0x4e8260[_0x15b5('0x9')]('/api/voice/transfers/reports',require(_0x15b5('0x3a')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x3b'),require('./api/mailServerOut'));_0x4e8260['use'](_0x15b5('0x3c'),require(_0x15b5('0x3d')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x3e'),require(_0x15b5('0x3f')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x40'),require(_0x15b5('0x41')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x42'),require(_0x15b5('0x43')));_0x4e8260[_0x15b5('0x9')]('/api/mail/messages',require('./api/mailMessage'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x44'),require(_0x15b5('0x45')));_0x4e8260['use'](_0x15b5('0x46'),require(_0x15b5('0x47')));_0x4e8260['use'](_0x15b5('0x48'),require(_0x15b5('0x49')));_0x4e8260['use'](_0x15b5('0x4a'),require(_0x15b5('0x4b')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x4c'),require(_0x15b5('0x4d')));_0x4e8260['use']('/api/fax/applications',require(_0x15b5('0x4e')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x4f'),require(_0x15b5('0x50')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x51'),require(_0x15b5('0x52')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x53'),require(_0x15b5('0x54')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x55'),require('./api/faxQueueReport'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x56'),require(_0x15b5('0x57')));_0x4e8260[_0x15b5('0x9')]('/api/sms/applications',require(_0x15b5('0x58')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x59'),require('./api/smsInteraction'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x5a'),require(_0x15b5('0x5b')));_0x4e8260[_0x15b5('0x9')]('/api/sms/queues',require(_0x15b5('0x5c')));_0x4e8260['use'](_0x15b5('0x5d'),require(_0x15b5('0x5e')));_0x4e8260['use']('/api/openchannel/applications',require('./api/openchannelApplication'));_0x4e8260[_0x15b5('0x9')]('/api/openchannel/interactions',require(_0x15b5('0x5f')));_0x4e8260[_0x15b5('0x9')]('/api/openchannel/messages',require(_0x15b5('0x60')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x61'),require(_0x15b5('0x62')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x63'),require(_0x15b5('0x64')));_0x4e8260[_0x15b5('0x9')]('/api/openchannel/reports/queue',require('./api/openchannelQueueReport'));_0x4e8260['use'](_0x15b5('0x65'),require(_0x15b5('0x66')));_0x4e8260['use'](_0x15b5('0x67'),require(_0x15b5('0x68')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x69'),require('./api/chatMessage'));_0x4e8260[_0x15b5('0x9')]('/api/chat/offline_messages',require('./api/chatOfflineMessage'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x6a'),require(_0x15b5('0x6b')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x6c'),require(_0x15b5('0x6d')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x6e'),require(_0x15b5('0x6f')));_0x4e8260[_0x15b5('0x9')]('/api/cm/companies',require('./api/cmCompany'));_0x4e8260['use'](_0x15b5('0x70'),require(_0x15b5('0x71')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x72'),require(_0x15b5('0x73')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x74'),require(_0x15b5('0x75')));_0x4e8260['use'](_0x15b5('0x76'),require(_0x15b5('0x77')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x78'),require('./api/cmHopperHistory'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x79'),require(_0x15b5('0x7a')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x7b'),require(_0x15b5('0x7c')));_0x4e8260['use'](_0x15b5('0x7d'),require('./api/automation'));_0x4e8260[_0x15b5('0x9')]('/api/canned_answers',require(_0x15b5('0x7e')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x7f'),require(_0x15b5('0x80')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x81'),require(_0x15b5('0x82')));_0x4e8260['use'](_0x15b5('0x83'),require(_0x15b5('0x84')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x85'),require(_0x15b5('0x86')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x87'),require('./api/cdr'));_0x4e8260['use'](_0x15b5('0x88'),require(_0x15b5('0x89')));_0x4e8260[_0x15b5('0x9')]('/api/schedules',require(_0x15b5('0x8a')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x8b'),require(_0x15b5('0x8c')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x8d'),require(_0x15b5('0x8e')));_0x4e8260['use']('/api/templates',require(_0x15b5('0x8f')));_0x4e8260[_0x15b5('0x9')]('/api/triggers',require(_0x15b5('0x90')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x91'),require(_0x15b5('0x92')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x93'),require(_0x15b5('0x94')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x95'),require(_0x15b5('0x96')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x97'),require(_0x15b5('0x98')));_0x4e8260[_0x15b5('0x9')]('/api/analytics/default_reports',require(_0x15b5('0x99')));_0x4e8260[_0x15b5('0x9')]('/api/analytics/extracted_reports',require(_0x15b5('0x9a')));_0x4e8260['use']('/api/analytics/metrics',require(_0x15b5('0x9b')));_0x4e8260[_0x15b5('0x9')]('/api/analytics/field_reports',require(_0x15b5('0x9c')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x9d'),require(_0x15b5('0x9e')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x9f'),require(_0x15b5('0xa0')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa1'),require('./api/intSalesforceConfiguration'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa2'),require('./api/intSalesforceField'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa3'),require(_0x15b5('0xa4')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa5'),require(_0x15b5('0xa6')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa7'),require('./api/intDeskAccount'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xa8'),require(_0x15b5('0xa9')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/desk/fields',require(_0x15b5('0xaa')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xab'),require(_0x15b5('0xac')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xad'),require(_0x15b5('0xae')));_0x4e8260['use']('/api/integrations/zoho/fields',require(_0x15b5('0xaf')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xb0'),require(_0x15b5('0xb1')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xb2'),require(_0x15b5('0xb3')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/zendesk/fields',require(_0x15b5('0xb4')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/freshdesk/accounts',require(_0x15b5('0xb5')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xb6'),require(_0x15b5('0xb7')));_0x4e8260['use'](_0x15b5('0xb8'),require(_0x15b5('0xb9')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xba'),require('./api/intVtigerConfiguration'));_0x4e8260['use'](_0x15b5('0xbb'),require(_0x15b5('0xbc')));_0x4e8260['use'](_0x15b5('0xbd'),require(_0x15b5('0xbe')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xbf'),require('./api/intServicenowConfiguration'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xc0'),require(_0x15b5('0xc1')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/dynamics365/accounts',require(_0x15b5('0xc2')));_0x4e8260[_0x15b5('0x9')]('/api/integrations/dynamics365/configurations',require('./api/intDynamics365Configuration'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xc3'),require(_0x15b5('0xc4')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xc5'),require(_0x15b5('0xc6')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xc7'),require(_0x15b5('0xc8')));_0x4e8260['use'](_0x15b5('0xc9'),require(_0x15b5('0xca')));_0x4e8260['use']('/api/networks',require(_0x15b5('0xcb')));_0x4e8260[_0x15b5('0x9')]('/api/chat/reports/queue',require(_0x15b5('0xcc')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xcd'),require('./api/chatInternalMessage'));_0x4e8260[_0x15b5('0x9')]('/api/jscripty/answers/reports',require(_0x15b5('0xce')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xcf'),require(_0x15b5('0xd0')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xd1'),require(_0x15b5('0xd2')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xd3'),require(_0x15b5('0xd4')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xd5'),require(_0x15b5('0xd6')));_0x4e8260['use'](_0x15b5('0xd7'),require(_0x15b5('0xd8')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xd9'),require('./api/jscriptyProject'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xda'),require(_0x15b5('0xdb')));_0x4e8260[_0x15b5('0x9')]('/api/square/odbc',require(_0x15b5('0xdc')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xdd'),require(_0x15b5('0xde')));_0x4e8260['use'](_0x15b5('0xdf'),require('./api/squareRecording'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xe0'),require(_0x15b5('0xe1')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xe2'),require(_0x15b5('0xe3')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xe4'),require(_0x15b5('0xe5')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xe6'),require(_0x15b5('0xe7')));_0x4e8260['use'](_0x15b5('0xe8'),require(_0x15b5('0xe9')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xea'),require(_0x15b5('0xeb')));_0x4e8260[_0x15b5('0x9')]('/api/plugins',require(_0x15b5('0xec')));_0x4e8260['use'](_0x15b5('0xed'),require(_0x15b5('0xee')));_0x4e8260[_0x15b5('0x9')]('/api/chat/reports/transfer',require(_0x15b5('0xef')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf0'),require(_0x15b5('0xf1')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf2'),require(_0x15b5('0xf3')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf4'),require('./api/smsTransferReport'));_0x4e8260['use'](_0x15b5('0xf5'),require(_0x15b5('0xf6')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf7'),require('./api/voicePrefix'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf8'),require('./api/userProfile'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xf9'),require('./api/userProfileSection'));_0x4e8260['use'](_0x15b5('0xfa'),require(_0x15b5('0xfb')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xfc'),require('./api/userNotification'));_0x4e8260[_0x15b5('0x9')]('/api/whatsapp/accounts',require(_0x15b5('0xfd')));_0x4e8260['use'](_0x15b5('0xfe'),require('./api/whatsappApplication'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0xff'),require('./api/whatsappInteraction'));_0x4e8260['use']('/api/whatsapp/messages',require(_0x15b5('0x100')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x101'),require('./api/whatsappQueueReport'));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x102'),require(_0x15b5('0x103')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x104'),require(_0x15b5('0x105')));_0x4e8260['use'](_0x15b5('0x106'),require(_0x15b5('0x107')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x108'),require(_0x15b5('0x109')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x10a'),require('./api/authLocal'));_0x4e8260[_0x15b5('0x9')]('/api/auth/google',require(_0x15b5('0x10b')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x10c'),require(_0x15b5('0x10d')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x10e'),require(_0x15b5('0x10f')));_0x4e8260['use'](_0x15b5('0x110'),require('./api/rpc'));_0x4e8260[_0x15b5('0x9')]('/api/version',require(_0x15b5('0x111')));_0x4e8260[_0x15b5('0x9')]('/api/system',require(_0x15b5('0x112')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x113'),require(_0x15b5('0x114')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x115'),require(_0x15b5('0x116')));_0x4e8260['use'](_0x15b5('0x117'),express[_0x15b5('0x118')](path[_0x15b5('0x119')](config[_0x15b5('0x11a')],_0x15b5('0x117'))));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x11b'),express[_0x15b5('0x118')](path[_0x15b5('0x119')](config['root'],'/www')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x11c'),express[_0x15b5('0x118')](path[_0x15b5('0x119')](config[_0x15b5('0x11a')],'/demo')));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x11d'),express['static'](path[_0x15b5('0x119')](config['root'],_0x15b5('0x11e'),_0x15b5('0x11f'))));_0x4e8260[_0x15b5('0x9')](_0x15b5('0x120'),express[_0x15b5('0x118')](path[_0x15b5('0x119')](config[_0x15b5('0x11a')],'/server/files/plugins')));_0x4e8260['route'](_0x15b5('0x121'))[_0x15b5('0x122')](errors[0x194]);_0x4e8260['route']('/*')[_0x15b5('0x122')](function(_0x354b06,_0x5ec3b5){_0x5ec3b5['sendFile'](path[_0x15b5('0x123')](_0x4e8260[_0x15b5('0x122')](_0x15b5('0x124'))+_0x15b5('0x125')));});};var sensitiveFields=[_0x15b5('0x126'),_0x15b5('0x127'),_0x15b5('0x128'),_0x15b5('0x129'),_0x15b5('0x12a'),_0x15b5('0x12b'),_0x15b5('0x12c'),'phone',_0x15b5('0x12d'),'fax',_0x15b5('0x12e'),_0x15b5('0x12f'),'clientSecret',_0x15b5('0x130'),_0x15b5('0x131'),'accessKey',_0x15b5('0x132'),_0x15b5('0x133'),_0x15b5('0x134'),'accessToken',_0x15b5('0x135'),_0x15b5('0x136'),_0x15b5('0x137'),_0x15b5('0x138'),_0x15b5('0x139'),_0x15b5('0x13a'),_0x15b5('0x13b'),_0x15b5('0x13c'),'vidaooApiKey','clientEmail',_0x15b5('0x13d'),_0x15b5('0x13e'),_0x15b5('0x13f'),'key',_0x15b5('0x16'),_0x15b5('0x140'),_0x15b5('0x141'),_0x15b5('0x142'),'dsn','secret',_0x15b5('0x143'),_0x15b5('0x144')];function maskSensitiveData(_0x99a674){var _0x33e270=/(?!^)[\s\S](?!$)/g;if(!_[_0x15b5('0x145')](_0x99a674))return;for(var _0x53e938 in _0x99a674){if(_[_0x15b5('0x146')](_0x99a674[_0x53e938])){for(var _0x4dc5d8=0x0;_0x4dc5d8<_0x99a674[_0x53e938][_0x15b5('0x147')];_0x4dc5d8++){maskSensitiveData(_0x99a674[_0x53e938][_0x4dc5d8]);}}else if(_[_0x15b5('0x145')](_0x99a674[_0x53e938])){maskSensitiveData(_0x99a674[_0x53e938]);}else if(_['isString'](_0x99a674[_0x53e938])){_0x99a674[_0x53e938]=_0x99a674[_0x53e938][_0x15b5('0x148')](/{{{/g,_0x15b5('0x149'))['replace'](/}}}/g,_0x15b5('0x14a'))['replace'](/{{/g,'@{')[_0x15b5('0x148')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x53e938)){_0x99a674[_0x53e938]=_0x99a674[_0x53e938][_0x15b5('0x148')](_0x33e270,'*');}}}} \ No newline at end of file +var _0x3249=['./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','./api/chatInteraction','/api/chat/messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','./api/cmContact','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','/api/canned_answers','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','/api/analytics/default_reports','./api/analyticDefaultReport','./api/analyticExtractedReport','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSugarcrmAccount','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','./api/intFreshdeskField','/api/integrations/vtiger/configurations','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/network','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/settings','/api/square/odbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','./api/authActiveDirectory','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','./api/system','/api/pm2','/api/webbar','./api/webbar','/apidoc','join','/www','static','root','/demo','snippet','3.0.0','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','username','apiKey','firstName','street','phone','fax','clientId','clientSecret','securityToken','code','accessKey','tenantId','token','channelSecret','accessToken','accessTokenSecret','authToken','consumerSecret','membername','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','accesskeyid','secretaccesskey','key','pass','accountSid','dsn','oldPassword','isPlainObject','isArray','isString','replace','@@{','}@@','lodash','path','express','util','./config/environment','api','./config/logger','./safe-template','safeTemplate','default','use','logger','isEmpty','body','\x20body=%s','method','headers','x-forwarded-for','url','statusCode','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','connection','remoteAddress','device','other','agent_id','agent_name','./api/user','./api/voiceChanSpy','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/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/trunk','/api/voice/transfers/reports','/api/mail/out_servers','/api/mail/accounts','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','./api/dashboardItem','/api/fax/accounts','/api/fax/applications','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','/api/sms/accounts','./api/smsAccount','/api/sms/applications','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','/api/sms/queues','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x3249,0xdf));var _0x9324=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0x3249[_0x5a776b];return _0xbbef59;};'use strict';var _=require(_0x9324('0x0'));var path=require(_0x9324('0x1'));var express=require(_0x9324('0x2'));var ewinston=require('express-winston');var util=require(_0x9324('0x3'));var errors=require('./errors');var config=require(_0x9324('0x4'));var logger=require('./config/logger')(_0x9324('0x5'));var authLogger=require(_0x9324('0x6'))('auth');var safeTemplate=require(_0x9324('0x7'))[_0x9324('0x8')];exports[_0x9324('0x9')]=function(_0xb353aa){_0xb353aa[_0x9324('0xa')](ewinston[_0x9324('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x4ea2df,_0x2d5686){var _0x75ebf6='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0x9324('0xc')](_0x4ea2df[_0x9324('0xd')])){_0x75ebf6+=_0x9324('0xe');var _0x2f06c4=_0x4ea2df['body'];maskSensitiveData(_0x2f06c4);}return safeTemplate(util['format'](_0x75ebf6,_0x4ea2df[_0x9324('0xf')],_0x4ea2df[_0x9324('0x10')]['x-forwarded-for']?_0x4ea2df[_0x9324('0x10')][_0x9324('0x11')]:_0x4ea2df['connection']['remoteAddress']||_0x4ea2df['ip'],_0x4ea2df[_0x9324('0x12')],_0x2d5686[_0x9324('0x13')],_0x2d5686[_0x9324('0x14')],_0x4ea2df['user']?_0x4ea2df[_0x9324('0x15')]['id']:null,_0x4ea2df[_0x9324('0x15')]?_0x4ea2df[_0x9324('0x15')][_0x9324('0x16')]:null,_0x4ea2df['user']?_0x4ea2df[_0x9324('0x15')][_0x9324('0x17')]:null,_0x2f06c4?util[_0x9324('0x18')](_0x2f06c4,![],null):''));}}));_0xb353aa[_0x9324('0xa')](ewinston[_0x9324('0xb')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3c2236,_0x4494b6){var _0x49c0da=_0x9324('0x19');if(_0x3c2236[_0x9324('0xd')]&&_0x3c2236['body']['device']&&_0x3c2236[_0x9324('0xd')]['agent_id']){_0x49c0da=_0x9324('0x1a');}return util['format'](_0x49c0da,_0x3c2236[_0x9324('0xf')],_0x3c2236[_0x9324('0x10')]['x-forwarded-for']?_0x3c2236[_0x9324('0x10')][_0x9324('0x11')]:_0x3c2236[_0x9324('0x1b')][_0x9324('0x1c')]||_0x3c2236['ip'],_0x3c2236[_0x9324('0x12')],_0x4494b6['statusCode'],_0x4494b6[_0x9324('0x14')],_0x3c2236['user']?_0x3c2236[_0x9324('0x15')]['id']:null,_0x3c2236[_0x9324('0x15')]?_0x3c2236[_0x9324('0x15')][_0x9324('0x16')]:null,_0x3c2236['user']?_0x3c2236[_0x9324('0x15')]['role']:null,_0x3c2236['body']&&_0x3c2236[_0x9324('0xd')][_0x9324('0x1d')]?_0x3c2236[_0x9324('0xd')][_0x9324('0x1d')]:_0x9324('0x1e'),_0x3c2236['body']&&_0x3c2236[_0x9324('0xd')][_0x9324('0x1f')]?_0x3c2236[_0x9324('0xd')][_0x9324('0x1f')]:'',_0x3c2236['body']&&_0x3c2236[_0x9324('0xd')]['agent_name']?_0x3c2236[_0x9324('0xd')][_0x9324('0x20')]:'');},'ignoreRoute':function(_0x528a95){var _0x5825ed=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5825ed['test'](_0x528a95[_0x9324('0x12')]);}}));_0xb353aa['use']('/api/users',require(_0x9324('0x21')));_0xb353aa['use']('/api/voice/chanspy',require(_0x9324('0x22')));_0xb353aa[_0x9324('0xa')]('/api/voice/contexts',require(_0x9324('0x23')));_0xb353aa['use'](_0x9324('0x24'),require(_0x9324('0x25')));_0xb353aa['use'](_0x9324('0x26'),require(_0x9324('0x27')));_0xb353aa[_0x9324('0xa')](_0x9324('0x28'),require('./api/voiceQueue'));_0xb353aa[_0x9324('0xa')]('/api/voice/recordings',require(_0x9324('0x29')));_0xb353aa[_0x9324('0xa')](_0x9324('0x2a'),require(_0x9324('0x2b')));_0xb353aa['use']('/api/voice/mails',require('./api/voiceMail'));_0xb353aa[_0x9324('0xa')](_0x9324('0x2c'),require(_0x9324('0x2d')));_0xb353aa[_0x9324('0xa')](_0x9324('0x2e'),require(_0x9324('0x2f')));_0xb353aa[_0x9324('0xa')](_0x9324('0x30'),require('./api/voiceDialReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0x31'),require(_0x9324('0x32')));_0xb353aa[_0x9324('0xa')](_0x9324('0x33'),require('./api/voiceQueueReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0x34'),require(_0x9324('0x35')));_0xb353aa[_0x9324('0xa')]('/api/trunks',require(_0x9324('0x36')));_0xb353aa[_0x9324('0xa')](_0x9324('0x37'),require('./api/voiceTransferReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0x38'),require('./api/mailServerOut'));_0xb353aa['use'](_0x9324('0x39'),require('./api/mailAccount'));_0xb353aa[_0x9324('0xa')](_0x9324('0x3a'),require(_0x9324('0x3b')));_0xb353aa[_0x9324('0xa')](_0x9324('0x3c'),require(_0x9324('0x3d')));_0xb353aa[_0x9324('0xa')](_0x9324('0x3e'),require(_0x9324('0x3f')));_0xb353aa['use'](_0x9324('0x40'),require(_0x9324('0x41')));_0xb353aa[_0x9324('0xa')](_0x9324('0x42'),require(_0x9324('0x43')));_0xb353aa[_0x9324('0xa')]('/api/mail/reports/queue',require(_0x9324('0x44')));_0xb353aa[_0x9324('0xa')](_0x9324('0x45'),require('./api/dashboard'));_0xb353aa['use']('/api/dashboards/items',require(_0x9324('0x46')));_0xb353aa['use'](_0x9324('0x47'),require('./api/faxAccount'));_0xb353aa[_0x9324('0xa')](_0x9324('0x48'),require('./api/faxApplication'));_0xb353aa[_0x9324('0xa')](_0x9324('0x49'),require(_0x9324('0x4a')));_0xb353aa[_0x9324('0xa')](_0x9324('0x4b'),require(_0x9324('0x4c')));_0xb353aa[_0x9324('0xa')](_0x9324('0x4d'),require(_0x9324('0x4e')));_0xb353aa[_0x9324('0xa')](_0x9324('0x4f'),require('./api/faxQueueReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0x50'),require(_0x9324('0x51')));_0xb353aa['use'](_0x9324('0x52'),require('./api/smsApplication'));_0xb353aa['use'](_0x9324('0x53'),require(_0x9324('0x54')));_0xb353aa[_0x9324('0xa')]('/api/sms/messages',require(_0x9324('0x55')));_0xb353aa[_0x9324('0xa')](_0x9324('0x56'),require(_0x9324('0x57')));_0xb353aa[_0x9324('0xa')]('/api/openchannel/accounts',require(_0x9324('0x58')));_0xb353aa[_0x9324('0xa')](_0x9324('0x59'),require(_0x9324('0x5a')));_0xb353aa[_0x9324('0xa')](_0x9324('0x5b'),require(_0x9324('0x5c')));_0xb353aa[_0x9324('0xa')]('/api/openchannel/messages',require(_0x9324('0x5d')));_0xb353aa[_0x9324('0xa')](_0x9324('0x5e'),require(_0x9324('0x5f')));_0xb353aa[_0x9324('0xa')](_0x9324('0x60'),require(_0x9324('0x61')));_0xb353aa[_0x9324('0xa')](_0x9324('0x62'),require(_0x9324('0x63')));_0xb353aa[_0x9324('0xa')](_0x9324('0x64'),require(_0x9324('0x65')));_0xb353aa['use']('/api/chat/interactions',require(_0x9324('0x66')));_0xb353aa[_0x9324('0xa')](_0x9324('0x67'),require('./api/chatMessage'));_0xb353aa[_0x9324('0xa')]('/api/chat/offline_messages',require(_0x9324('0x68')));_0xb353aa['use'](_0x9324('0x69'),require('./api/chatQueue'));_0xb353aa[_0x9324('0xa')]('/api/chat/groups',require('./api/chatGroup'));_0xb353aa['use'](_0x9324('0x6a'),require(_0x9324('0x6b')));_0xb353aa[_0x9324('0xa')]('/api/cm/companies',require(_0x9324('0x6c')));_0xb353aa[_0x9324('0xa')]('/api/cm/contacts',require(_0x9324('0x6d')));_0xb353aa[_0x9324('0xa')]('/api/cm/hopper',require(_0x9324('0x6e')));_0xb353aa['use'](_0x9324('0x6f'),require(_0x9324('0x70')));_0xb353aa[_0x9324('0xa')](_0x9324('0x71'),require(_0x9324('0x72')));_0xb353aa['use']('/api/cm/hopper_history',require(_0x9324('0x73')));_0xb353aa['use'](_0x9324('0x74'),require(_0x9324('0x75')));_0xb353aa[_0x9324('0xa')](_0x9324('0x76'),require(_0x9324('0x77')));_0xb353aa[_0x9324('0xa')](_0x9324('0x78'),require('./api/automation'));_0xb353aa[_0x9324('0xa')](_0x9324('0x79'),require('./api/cannedAnswer'));_0xb353aa[_0x9324('0xa')](_0x9324('0x7a'),require(_0x9324('0x7b')));_0xb353aa['use'](_0x9324('0x7c'),require(_0x9324('0x7d')));_0xb353aa[_0x9324('0xa')](_0x9324('0x7e'),require('./api/interval'));_0xb353aa[_0x9324('0xa')](_0x9324('0x7f'),require(_0x9324('0x80')));_0xb353aa[_0x9324('0xa')](_0x9324('0x81'),require(_0x9324('0x82')));_0xb353aa['use'](_0x9324('0x83'),require(_0x9324('0x84')));_0xb353aa[_0x9324('0xa')](_0x9324('0x85'),require(_0x9324('0x86')));_0xb353aa[_0x9324('0xa')](_0x9324('0x87'),require('./api/sound'));_0xb353aa[_0x9324('0xa')]('/api/tags',require('./api/tag'));_0xb353aa[_0x9324('0xa')]('/api/templates',require('./api/template'));_0xb353aa[_0x9324('0xa')](_0x9324('0x88'),require(_0x9324('0x89')));_0xb353aa[_0x9324('0xa')](_0x9324('0x8a'),require('./api/variable'));_0xb353aa[_0x9324('0xa')](_0x9324('0x8b'),require(_0x9324('0x8c')));_0xb353aa[_0x9324('0xa')](_0x9324('0x8d'),require(_0x9324('0x8e')));_0xb353aa['use'](_0x9324('0x8f'),require('./api/analyticCustomReport'));_0xb353aa['use'](_0x9324('0x90'),require(_0x9324('0x91')));_0xb353aa[_0x9324('0xa')]('/api/analytics/extracted_reports',require(_0x9324('0x92')));_0xb353aa[_0x9324('0xa')]('/api/analytics/metrics',require(_0x9324('0x93')));_0xb353aa[_0x9324('0xa')](_0x9324('0x94'),require(_0x9324('0x95')));_0xb353aa[_0x9324('0xa')]('/api/analytics/tree_reports',require(_0x9324('0x96')));_0xb353aa[_0x9324('0xa')](_0x9324('0x97'),require(_0x9324('0x98')));_0xb353aa[_0x9324('0xa')](_0x9324('0x99'),require(_0x9324('0x9a')));_0xb353aa[_0x9324('0xa')](_0x9324('0x9b'),require('./api/intSalesforceField'));_0xb353aa[_0x9324('0xa')]('/api/integrations/sugarcrm/accounts',require(_0x9324('0x9c')));_0xb353aa[_0x9324('0xa')]('/api/integrations/sugarcrm/configurations',require('./api/intSugarcrmConfiguration'));_0xb353aa[_0x9324('0xa')]('/api/integrations/sugarcrm/fields',require('./api/intSugarcrmField'));_0xb353aa[_0x9324('0xa')]('/api/integrations/desk/accounts',require(_0x9324('0x9d')));_0xb353aa[_0x9324('0xa')](_0x9324('0x9e'),require(_0x9324('0x9f')));_0xb353aa[_0x9324('0xa')](_0x9324('0xa0'),require(_0x9324('0xa1')));_0xb353aa['use'](_0x9324('0xa2'),require(_0x9324('0xa3')));_0xb353aa[_0x9324('0xa')]('/api/integrations/zoho/configurations',require(_0x9324('0xa4')));_0xb353aa[_0x9324('0xa')](_0x9324('0xa5'),require(_0x9324('0xa6')));_0xb353aa[_0x9324('0xa')](_0x9324('0xa7'),require(_0x9324('0xa8')));_0xb353aa[_0x9324('0xa')](_0x9324('0xa9'),require('./api/intZendeskConfiguration'));_0xb353aa[_0x9324('0xa')](_0x9324('0xaa'),require(_0x9324('0xab')));_0xb353aa[_0x9324('0xa')]('/api/integrations/freshdesk/accounts',require(_0x9324('0xac')));_0xb353aa[_0x9324('0xa')](_0x9324('0xad'),require(_0x9324('0xae')));_0xb353aa[_0x9324('0xa')]('/api/integrations/freshdesk/fields',require(_0x9324('0xaf')));_0xb353aa[_0x9324('0xa')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0xb353aa[_0x9324('0xa')](_0x9324('0xb0'),require('./api/intVtigerConfiguration'));_0xb353aa[_0x9324('0xa')]('/api/integrations/vtiger/fields',require(_0x9324('0xb1')));_0xb353aa[_0x9324('0xa')]('/api/integrations/servicenow/accounts',require(_0x9324('0xb2')));_0xb353aa[_0x9324('0xa')](_0x9324('0xb3'),require(_0x9324('0xb4')));_0xb353aa[_0x9324('0xa')](_0x9324('0xb5'),require('./api/intServicenowField'));_0xb353aa[_0x9324('0xa')](_0x9324('0xb6'),require(_0x9324('0xb7')));_0xb353aa['use'](_0x9324('0xb8'),require(_0x9324('0xb9')));_0xb353aa[_0x9324('0xa')](_0x9324('0xba'),require(_0x9324('0xbb')));_0xb353aa[_0x9324('0xa')](_0x9324('0xbc'),require('./api/intFreshsalesAccount'));_0xb353aa[_0x9324('0xa')]('/api/integrations/freshsales/configurations',require(_0x9324('0xbd')));_0xb353aa[_0x9324('0xa')]('/api/integrations/freshsales/fields',require(_0x9324('0xbe')));_0xb353aa[_0x9324('0xa')](_0x9324('0xbf'),require(_0x9324('0xc0')));_0xb353aa[_0x9324('0xa')]('/api/chat/reports/queue',require(_0x9324('0xc1')));_0xb353aa[_0x9324('0xa')](_0x9324('0xc2'),require('./api/chatInternalMessage'));_0xb353aa['use'](_0x9324('0xc3'),require('./api/jscriptyAnswerReport'));_0xb353aa[_0x9324('0xa')]('/api/jscripty/questions/reports',require(_0x9324('0xc4')));_0xb353aa['use'](_0x9324('0xc5'),require('./api/jscriptySessionReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0xc6'),require('./api/smsQueueReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0xc7'),require(_0x9324('0xc8')));_0xb353aa['use'](_0x9324('0xc9'),require(_0x9324('0xca')));_0xb353aa[_0x9324('0xa')]('/api/jscripty/projects',require('./api/jscriptyProject'));_0xb353aa[_0x9324('0xa')](_0x9324('0xcb'),require('./api/setting'));_0xb353aa[_0x9324('0xa')](_0x9324('0xcc'),require('./api/squareOdbc'));_0xb353aa['use']('/api/square/projects',require(_0x9324('0xcd')));_0xb353aa[_0x9324('0xa')](_0x9324('0xce'),require(_0x9324('0xcf')));_0xb353aa[_0x9324('0xa')](_0x9324('0xd0'),require(_0x9324('0xd1')));_0xb353aa['use'](_0x9324('0xd2'),require(_0x9324('0xd3')));_0xb353aa['use'](_0x9324('0xd4'),require(_0x9324('0xd5')));_0xb353aa[_0x9324('0xa')](_0x9324('0xd6'),require(_0x9324('0xd7')));_0xb353aa[_0x9324('0xa')]('/api/migrations',require(_0x9324('0xd8')));_0xb353aa['use'](_0x9324('0xd9'),require('./api/attachment'));_0xb353aa[_0x9324('0xa')]('/api/plugins',require(_0x9324('0xda')));_0xb353aa[_0x9324('0xa')](_0x9324('0xdb'),require(_0x9324('0xdc')));_0xb353aa[_0x9324('0xa')](_0x9324('0xdd'),require(_0x9324('0xde')));_0xb353aa[_0x9324('0xa')]('/api/fax/reports/transfer',require(_0x9324('0xdf')));_0xb353aa['use'](_0x9324('0xe0'),require('./api/openchannelTransferReport'));_0xb353aa[_0x9324('0xa')](_0x9324('0xe1'),require(_0x9324('0xe2')));_0xb353aa[_0x9324('0xa')](_0x9324('0xe3'),require(_0x9324('0xe4')));_0xb353aa[_0x9324('0xa')](_0x9324('0xe5'),require(_0x9324('0xe6')));_0xb353aa[_0x9324('0xa')](_0x9324('0xe7'),require(_0x9324('0xe8')));_0xb353aa[_0x9324('0xa')](_0x9324('0xe9'),require(_0x9324('0xea')));_0xb353aa['use']('/api/userProfile/resources',require(_0x9324('0xeb')));_0xb353aa[_0x9324('0xa')](_0x9324('0xec'),require(_0x9324('0xed')));_0xb353aa[_0x9324('0xa')](_0x9324('0xee'),require(_0x9324('0xef')));_0xb353aa[_0x9324('0xa')](_0x9324('0xf0'),require('./api/whatsappApplication'));_0xb353aa[_0x9324('0xa')](_0x9324('0xf1'),require(_0x9324('0xf2')));_0xb353aa[_0x9324('0xa')](_0x9324('0xf3'),require(_0x9324('0xf4')));_0xb353aa['use']('/api/whatsapp/reports/queue',require(_0x9324('0xf5')));_0xb353aa['use'](_0x9324('0xf6'),require(_0x9324('0xf7')));_0xb353aa[_0x9324('0xa')](_0x9324('0xf8'),require(_0x9324('0xf9')));_0xb353aa[_0x9324('0xa')](_0x9324('0xfa'),require(_0x9324('0xfb')));_0xb353aa[_0x9324('0xa')](_0x9324('0xfc'),require(_0x9324('0xfd')));_0xb353aa['use'](_0x9324('0xfe'),require(_0x9324('0xff')));_0xb353aa[_0x9324('0xa')](_0x9324('0x100'),require(_0x9324('0x101')));_0xb353aa[_0x9324('0xa')]('/api/auth/activedirectory',require(_0x9324('0x102')));_0xb353aa[_0x9324('0xa')]('/api/jira',require(_0x9324('0x103')));_0xb353aa['use'](_0x9324('0x104'),require(_0x9324('0x105')));_0xb353aa['use']('/api/version',require(_0x9324('0x106')));_0xb353aa['use'](_0x9324('0x107'),require(_0x9324('0x108')));_0xb353aa[_0x9324('0xa')](_0x9324('0x109'),require('./api/pm2'));_0xb353aa[_0x9324('0xa')](_0x9324('0x10a'),require(_0x9324('0x10b')));_0xb353aa[_0x9324('0xa')](_0x9324('0x10c'),express['static'](path[_0x9324('0x10d')](config['root'],_0x9324('0x10c'))));_0xb353aa[_0x9324('0xa')](_0x9324('0x10e'),express[_0x9324('0x10f')](path[_0x9324('0x10d')](config[_0x9324('0x110')],_0x9324('0x10e'))));_0xb353aa[_0x9324('0xa')](_0x9324('0x111'),express[_0x9324('0x10f')](path[_0x9324('0x10d')](config['root'],_0x9324('0x111'))));_0xb353aa['use']('/snippet',express['static'](path[_0x9324('0x10d')](config[_0x9324('0x110')],_0x9324('0x112'),_0x9324('0x113'))));_0xb353aa['use'](_0x9324('0x114'),express[_0x9324('0x10f')](path[_0x9324('0x10d')](config[_0x9324('0x110')],_0x9324('0x115'))));_0xb353aa[_0x9324('0x116')](_0x9324('0x117'))[_0x9324('0x118')](errors[0x194]);_0xb353aa['route']('/*')['get'](function(_0x2105d4,_0x407f85){_0x407f85[_0x9324('0x119')](path['resolve'](_0xb353aa['get']('appPath')+_0x9324('0x11a')));});};var sensitiveFields=[_0x9324('0x11b'),'password','newPassword',_0x9324('0x11c'),_0x9324('0x11d'),'lastName',_0x9324('0x11e'),_0x9324('0x11f'),'mobile',_0x9324('0x120'),'email',_0x9324('0x121'),_0x9324('0x122'),_0x9324('0x123'),_0x9324('0x124'),_0x9324('0x125'),_0x9324('0x126'),_0x9324('0x127'),_0x9324('0x128'),_0x9324('0x129'),_0x9324('0x12a'),_0x9324('0x12b'),'consumerKey',_0x9324('0x12c'),_0x9324('0x12d'),_0x9324('0x12e'),_0x9324('0x12f'),_0x9324('0x130'),_0x9324('0x131'),_0x9324('0x132'),'privateKey',_0x9324('0x133'),_0x9324('0x134'),_0x9324('0x135'),_0x9324('0x15'),_0x9324('0x136'),_0x9324('0x137'),'localstationid',_0x9324('0x138'),'secret','registry',_0x9324('0x139')];function maskSensitiveData(_0x45bc58){var _0x3cc2a7=/(?!^)[\s\S](?!$)/g;if(!_[_0x9324('0x13a')](_0x45bc58))return;for(var _0x5d7194 in _0x45bc58){if(_[_0x9324('0x13b')](_0x45bc58[_0x5d7194])){for(var _0x2f942a=0x0;_0x2f942a<_0x45bc58[_0x5d7194]['length'];_0x2f942a++){maskSensitiveData(_0x45bc58[_0x5d7194][_0x2f942a]);}}else if(_[_0x9324('0x13a')](_0x45bc58[_0x5d7194])){maskSensitiveData(_0x45bc58[_0x5d7194]);}else if(_[_0x9324('0x13c')](_0x45bc58[_0x5d7194])){_0x45bc58[_0x5d7194]=_0x45bc58[_0x5d7194][_0x9324('0x13d')](/{{{/g,_0x9324('0x13e'))[_0x9324('0x13d')](/}}}/g,_0x9324('0x13f'))['replace'](/{{/g,'@{')[_0x9324('0x13d')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x5d7194)){_0x45bc58[_0x5d7194]=_0x45bc58[_0x5d7194][_0x9324('0x13d')](_0x3cc2a7,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 33e1e4b..427c3b4 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x294a=['../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','error','listen','default','RPC\x20listening\x20on\x20','bluebird','lodash','../config/environment','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x294a,0xae));var _0xa294=function(_0x31ca4c,_0x38802c){_0x31ca4c=_0x31ca4c-0x0;var _0x423753=_0x294a[_0x31ca4c];return _0x423753;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa294('0x0'));var _=require(_0xa294('0x1'));var config=require(_0xa294('0x2'));exports['listen']=function(){return new BPromise(function(_0x181558,_0xe9d58c){var _0x19e458={};_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x4')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/voiceExtension/voiceExtension.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x5')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x6')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x7')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x8')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x9')));_0x19e458=_['merge'](_0x19e458,require('../api/memberReport/memberReport.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0xa')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0xb')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0xc')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0xd')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0xe')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0xf')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/mailInteraction/mailInteraction.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x10')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x11')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x12')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x13')));_0x19e458=_['merge'](_0x19e458,require('../api/faxApplication/faxApplication.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x14')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x15')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x16')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x17')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x18')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x19')));_0x19e458=_['merge'](_0x19e458,require('../api/smsMessage/smsMessage.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x1a')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x1b')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x1c')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x1d')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x1e')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x1f')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x20')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x21')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x22')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x23')));_0x19e458=_['merge'](_0x19e458,require('../api/cmHopper/cmHopper.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x24')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x25')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x26')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x27')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x28')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x29')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/sound/sound.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x2a')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x2b')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x2c')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/intSalesforceAccount/intSalesforceAccount.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x2d')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x2e')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x2f')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x30')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x31')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x32')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x33')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x34')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x35')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x36')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x37')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x38')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x39')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x3a')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x3b')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x3c')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/squareMessage/squareMessage.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/campaign/campaign.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x3d')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x3e')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x3f')));_0x19e458=_['merge'](_0x19e458,require(_0xa294('0x40')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x41')));_0x19e458=_[_0xa294('0x3')](_0x19e458,require(_0xa294('0x42')));var _0x1bad31=jayson[_0xa294('0x43')](_0x19e458)['http']();var _0x16b282=config[_0xa294('0x44')][_0xa294('0x45')]||config['port']+0x1;var _0x449d4d=config[_0xa294('0x44')]['ip']||'localhost';_0x1bad31['on'](_0xa294('0x46'),function(_0x558c67){return _0xe9d58c(_0x558c67);});_0x1bad31[_0xa294('0x47')](_0x16b282,_0x449d4d,function(){console['log']('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x449d4d,_0x16b282);require('../config/triggers')[_0xa294('0x48')]();return _0x181558(_0xa294('0x49')+_0x449d4d+':'+_0x16b282);});});}; \ No newline at end of file +var _0x2d5d=['default','RPC\x20listening\x20on\x20','jayson/promise','bluebird','../config/environment','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','port','rpc','error','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers'];(function(_0x17ed41,_0x5283db){var _0x57cbee=function(_0x447fa1){while(--_0x447fa1){_0x17ed41['push'](_0x17ed41['shift']());}};_0x57cbee(++_0x5283db);}(_0x2d5d,0x8c));var _0xd2d5=function(_0x38085b,_0x58cbcd){_0x38085b=_0x38085b-0x0;var _0x23ea2f=_0x2d5d[_0x38085b];return _0x23ea2f;};'use strict';var jayson=require(_0xd2d5('0x0'));var BPromise=require(_0xd2d5('0x1'));var _=require('lodash');var config=require(_0xd2d5('0x2'));exports['listen']=function(){return new BPromise(function(_0x3be622,_0x27ec61){var _0x312c6c={};_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x4')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x5')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x6')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x7')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x8')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x9')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0xa')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0xb')));_0x312c6c=_['merge'](_0x312c6c,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0xc')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0xd')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0xe')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/mailInteraction/mailInteraction.rpc'));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0xf')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x10')));_0x312c6c=_['merge'](_0x312c6c,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x11')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x12')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x13')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x14')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x15')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x16')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x17')));_0x312c6c=_['merge'](_0x312c6c,require('../api/smsInteraction/smsInteraction.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x18')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x19')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x312c6c=_['merge'](_0x312c6c,require('../api/openchannelInteraction/openchannelInteraction.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x1a')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x1b')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x1c')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/chatInteraction/chatInteraction.rpc'));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x1d')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x1e')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x1f')));_0x312c6c=_['merge'](_0x312c6c,require('../api/cmHopper/cmHopper.rpc'));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x20')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x21')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x22')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/interval/interval.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x23')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x24')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x25')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x26')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x27')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x28')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x29')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x2a')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x2b')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x2c')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x2d')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x2e')));_0x312c6c=_['merge'](_0x312c6c,require(_0xd2d5('0x2f')));_0x312c6c=_['merge'](_0x312c6c,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x30')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x31')));_0x312c6c=_['merge'](_0x312c6c,require('../api/squareReport/squareReport.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x32')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/setting/setting.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x33')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/squareProject/squareProject.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x34')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x35')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x36')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x37')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/plugin/plugin.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/whatsappAccount/whatsappAccount.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x312c6c=_['merge'](_0x312c6c,require('../api/whatsappMessage/whatsappMessage.rpc'));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x38')));_0x312c6c=_[_0xd2d5('0x3')](_0x312c6c,require(_0xd2d5('0x39')));var _0x5e1bc6=jayson[_0xd2d5('0x3a')](_0x312c6c)[_0xd2d5('0x3b')]();var _0x343959=config['rpc']['port']||config[_0xd2d5('0x3c')]+0x1;var _0x14483d=config[_0xd2d5('0x3d')]['ip']||'localhost';_0x5e1bc6['on'](_0xd2d5('0x3e'),function(_0x434908){return _0x27ec61(_0x434908);});_0x5e1bc6[_0xd2d5('0x3f')](_0x343959,_0x14483d,function(){console[_0xd2d5('0x40')](_0xd2d5('0x41'),_0x14483d,_0x343959);require(_0xd2d5('0x42'))[_0xd2d5('0x43')]();return _0x3be622(_0xd2d5('0x44')+_0x14483d+':'+_0x343959);});});}; \ No newline at end of file diff --git a/server/safe-template.js b/server/safe-template.js index 2c1dba4..c330788 100644 --- a/server/safe-template.js +++ b/server/safe-template.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe511=['\x20}\x20}','string','isArray','map','isPlainObject','reduce','safeTemplate','lodash'];(function(_0x42cc23,_0x511075){var _0x279b17=function(_0x524c8e){while(--_0x524c8e){_0x42cc23['push'](_0x42cc23['shift']());}};_0x279b17(++_0x511075);}(_0xe511,0x16f));var _0x1e51=function(_0x10f50d,_0x1b200c){_0x10f50d=_0x10f50d-0x0;var _0x24128c=_0xe511[_0x10f50d];return _0x24128c;};var _=require(_0x1e51('0x0'));var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x3a7329){return _0x3a7329==='{{'?'{\x20{\x20':_0x1e51('0x1');}function safeTemplate(_0x5b9e45){var _0x253e96=_0x5b9e45;if(typeof _0x5b9e45===_0x1e51('0x2')){_0x253e96=_0x5b9e45['replace'](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0x1e51('0x3')](_0x5b9e45)){_0x253e96=_0x5b9e45[_0x1e51('0x4')](function(_0x204da7){return safeTemplate(_0x204da7);});}else if(_[_0x1e51('0x5')](_0x5b9e45)){_0x253e96=Object['keys'](_0x5b9e45)[_0x1e51('0x6')](function(_0x21ed6b,_0x5c4590){_0x21ed6b[_0x5c4590]=safeTemplate(_0x5b9e45[_0x5c4590]);return _0x21ed6b;},{});}return _0x253e96;}module['exports'][_0x1e51('0x7')]=safeTemplate; \ No newline at end of file +var _0xb03e=['safeTemplate','{\x20{\x20','\x20}\x20}','string','replace','isArray','map','isPlainObject','keys','exports'];(function(_0x3111df,_0x15c1ea){var _0x2fb11b=function(_0x1718e9){while(--_0x1718e9){_0x3111df['push'](_0x3111df['shift']());}};_0x2fb11b(++_0x15c1ea);}(_0xb03e,0x1eb));var _0xeb03=function(_0x39eaed,_0x5eb288){_0x39eaed=_0x39eaed-0x0;var _0x41dc5f=_0xb03e[_0x39eaed];return _0x41dc5f;};var _=require('lodash');var mustacheLikeBracketsRx=/(\{|\}){2}/gm;function bracketsReplacer(_0x36351b){return _0x36351b==='{{'?_0xeb03('0x0'):_0xeb03('0x1');}function safeTemplate(_0x3c5e68){var _0x1c58b5=_0x3c5e68;if(typeof _0x3c5e68===_0xeb03('0x2')){_0x1c58b5=_0x3c5e68[_0xeb03('0x3')](mustacheLikeBracketsRx,bracketsReplacer);}else if(Array[_0xeb03('0x4')](_0x3c5e68)){_0x1c58b5=_0x3c5e68[_0xeb03('0x5')](function(_0x3ba4b0){return safeTemplate(_0x3ba4b0);});}else if(_[_0xeb03('0x6')](_0x3c5e68)){_0x1c58b5=Object[_0xeb03('0x7')](_0x3c5e68)['reduce'](function(_0x3b58a2,_0x3d3322){_0x3b58a2[_0x3d3322]=safeTemplate(_0x3c5e68[_0x3d3322]);return _0x3b58a2;},{});}return _0x1c58b5;}module[_0xeb03('0x8')][_0xeb03('0x9')]=safeTemplate; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 5668eed..596a1ab 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 _0xdb7e=['prototype','answer','sendRequest','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','setContext','SET\x20CONTEXT\x20%s','SET\x20PRIORITY\x20%s','HANGUP','isBoolean','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','noop','getVariable','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','exec','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','destroy','pipe','command','write','inherits'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb7e,0x11a));var _0xedb7=function(_0x128bea,_0xfb9bf3){_0x128bea=_0x128bea-0x0;var _0x966ac=_0xdb7e[_0x128bea];return _0x966ac;};'use strict';var util=require(_0xedb7('0x0'));var _=require(_0xedb7('0x1'));var EventEmitter=require(_0xedb7('0x2'))['EventEmitter'];var AGIReply=require(_0xedb7('0x3'));var AGIError=require(_0xedb7('0x4'));function AGIChannel(_0x17756b){var _0x58fc55=this,_0x16179a=new AGIReply(),_0x4130d2=![],_0x40f048={};EventEmitter[_0xedb7('0x5')](_0x58fc55);_0x17756b[_0xedb7('0x6')](_0xedb7('0x7'));_0x17756b[_0xedb7('0x8')](0x8*0x3c*0x3c*0x3e8);_0x16179a[_0xedb7('0x6')](_0xedb7('0x7'));_0x16179a['on'](_0xedb7('0x9'),function(_0x5a8650){for(var _0x3540dd in _0x5a8650){_0x58fc55[_0x3540dd]=_0x5a8650[_0x3540dd];}_0x58fc55[_0xedb7('0xa')](_0xedb7('0xb'));});_0x16179a['on'](_0xedb7('0xc'),function(_0x18e9ee){if(_0x18e9ee[_0xedb7('0xd')]()==_0xedb7('0xe')){_0x58fc55[_0xedb7('0xa')](_0xedb7('0xe'));return;}if(_0x18e9ee[_0xedb7('0xf')](0x0,0xb)==_0xedb7('0x10')){_0x4130d2=!![];}if(_0x4130d2){_0x40f048['rx']+=_0x18e9ee+'\x0a';if(_0x18e9ee[_0xedb7('0x11')](_0xedb7('0x12'))!=-0x1){_0x4130d2=![];}}else{_0x40f048['rx']=_0x18e9ee;}if(_0x4130d2){return;}if(typeof _0x40f048['cb']=='function'){var _0x5161ae=_0x40f048['rx'][_0xedb7('0xf')](0x0,0x3),_0x4691db=null,_0x1e77b6=null;_0x5161ae=parseInt(_0x5161ae);if(isNaN(_0x5161ae)){_0x40f048['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0xedb7('0x13')});return;}if(_0x5161ae!=0xc8){_0x40f048['cb'](null,{'code':_0x5161ae,'result':-0x1,'extra':'KO'});return;}_0x4691db=_0x40f048['rx'][_0xedb7('0xf')](0x4)[_0xedb7('0x14')](_0xedb7('0x15'),'');if(_0x4691db[_0xedb7('0x16')]('\x20')!=-0x1){_0x4691db=_0x4691db[_0xedb7('0x17')](0x0,_0x4691db['indexOf']('\x20'));}if(_['startsWith'](_0x4691db,'-1')){_0x4691db=parseInt(_0x4691db);}_0x1e77b6=_0x40f048['rx'][_0xedb7('0x18')]('\x20');if(_0x1e77b6[_0xedb7('0x19')]==0x3){_0x1e77b6=_0x1e77b6[0x2][_0xedb7('0xf')](0x1,_0x1e77b6[0x2]['length']-0x1);}else if(_0x1e77b6[_0xedb7('0x19')]>0x3){var _0x3ce7c5=/\((.+)\)/;var _0x33554d=_0x40f048['rx'][_0xedb7('0x1a')](_0x3ce7c5);if(_0x33554d){_0x1e77b6=_0x33554d[0x1];}else{_0x1e77b6=null;}}else{_0x1e77b6=null;}_0x40f048['cb'](null,{'code':_0x5161ae,'result':_0x4691db,'extra':_0x1e77b6});}});_0x17756b['on'](_0xedb7('0x1b'),function(_0x50f579){_0x58fc55['emit'](_0xedb7('0x1b'),new AGIError(_0xedb7('0x1c'),_0x50f579[_0xedb7('0x1d')]));});_0x17756b['on'](_0xedb7('0x1e'),function(){_0x58fc55['emit'](_0xedb7('0x1e'),new AGIError(_0xedb7('0x1f')));});_0x17756b['on'](_0xedb7('0x20'),function(){_0x58fc55['emit'](_0xedb7('0x20'),new AGIError('E_AGI_SOCKET_TIMEOUT'));_0x17756b[_0xedb7('0x21')]();});_0x17756b[_0xedb7('0x22')](_0x16179a);this[_0xedb7('0x23')]=function(_0x5991ad,_0x54d68f){var _0x5991ad=_0x5991ad||'',_0x54d68f=typeof _0x54d68f=='function'?_0x54d68f:new Function();_0x40f048={'tx':_0x5991ad,'rx':'','cb':_0x54d68f};_0x17756b[_0xedb7('0x24')](_0x5991ad+'\x0a');},this[_0xedb7('0x1e')]=function(){_0x17756b['destroy']();};}util[_0xedb7('0x25')](AGIChannel,EventEmitter);AGIChannel['prototype']['sendRequest']=function(_0x158e10){return this[_0xedb7('0x23')]['sync'](this,_0x158e10);};AGIChannel[_0xedb7('0x26')][_0xedb7('0x27')]=function(){return this[_0xedb7('0x28')](_0xedb7('0x29'));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x2a')]=function(_0xfcc7ee,_0x10667d,_0x4dd696){_0xfcc7ee=_0xfcc7ee===undefined?_0xedb7('0x2b'):_0xfcc7ee;_0x10667d=_0x10667d===undefined?'5':_0x10667d;_0x4dd696=_0x4dd696===undefined?'1':_0x4dd696;return this['sendRequest'](util['format'](_0xedb7('0x2c'),_0xfcc7ee,_0x10667d*0x3e8,_0x4dd696));};AGIChannel[_0xedb7('0x26')]['noop']=function(_0x4896a5){_0x4896a5=_0x4896a5||_0xedb7('0x2d');return this['sendRequest'](util[_0xedb7('0x2e')](_0xedb7('0x2f'),_0x4896a5));};AGIChannel[_0xedb7('0x26')]['exec']=function(_0x2eaace,_0x124e62){if(_[_0xedb7('0x30')](_0x124e62)){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x31'),_0x2eaace,_0x124e62['join'](',')));}return this[_0xedb7('0x28')](util['format'](_0xedb7('0x31'),_0x2eaace,_0x124e62));};AGIChannel['prototype'][_0xedb7('0x32')]=function(_0x5360fb){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x33'),_0x5360fb));};AGIChannel['prototype']['setExtension']=function(_0x1bb635){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')]('SET\x20EXTENSION\x20%s',_0x1bb635));};AGIChannel[_0xedb7('0x26')]['setPriority']=function(_0x3f18cd){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x34'),_0x3f18cd));};AGIChannel[_0xedb7('0x26')][_0xedb7('0xe')]=function(){return this['sendRequest'](_0xedb7('0x35'));};AGIChannel[_0xedb7('0x26')]['setVariable']=function(_0x124a9d,_0x251875){var _0x21d9cc=_[_0xedb7('0x36')](_0x251875)||_[_0xedb7('0x37')](_0x251875)?_0x251875[_0xedb7('0x38')]():_0x251875;return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x39'),_0x124a9d,_0x21d9cc?_0x21d9cc[_0xedb7('0x38')]()[_0xedb7('0x14')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x3a')]=function(_0x33c827,_0x4ff8a0){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x3b'),_0x33c827,_0x4ff8a0));};AGIChannel[_0xedb7('0x26')]['sayDigits']=function(_0x17f3ef,_0xc5a766){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')]('SAY\x20DIGITS\x20%s\x20%s',_0x17f3ef,_0xc5a766));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x3c')]=function(_0x2f323a,_0x34337a){return this['sendRequest'](util[_0xedb7('0x2e')](_0xedb7('0x3d'),_0x2f323a,_0x34337a));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x3e')]=function(_0x2a474c,_0x36c2ce,_0xba317c){_0x36c2ce=_0x36c2ce||this['extension'];_0xba317c=_0xba317c||0x1;this[_0xedb7('0x32')](_0x2a474c);this['setExtension'](_0x36c2ce);this[_0xedb7('0x3f')](_0xba317c);return this[_0xedb7('0x40')](util[_0xedb7('0x2e')]('GOTO\x20%s\x20%s\x20%s',_0x2a474c,_0x36c2ce,_0xba317c));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x41')]=function(_0x3a5da3){return this[_0xedb7('0x28')](util[_0xedb7('0x2e')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3a5da3));};AGIChannel['prototype'][_0xedb7('0x42')]=function(_0x127d93,_0x218dfc,_0x3ca3cc,_0x372a7c,_0x293717,_0xbaaa65){_0x218dfc=_0x218dfc||_0xedb7('0x43');_0x3ca3cc=_0x3ca3cc||'';_0x372a7c=_0x372a7c===undefined?-0x1:_0x372a7c==='-1'?-0x1:_0x372a7c*0x3e8;_0x293717=_0x293717===undefined?'':'s='+_0x293717;_0xbaaa65=_0xbaaa65?_0xedb7('0x44'):'';return this[_0xedb7('0x28')](util[_0xedb7('0x2e')](_0xedb7('0x45'),_0x127d93,_0x218dfc,_0x3ca3cc,_0x372a7c,_0xbaaa65,_0x293717));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x46')]=function(_0x55b46e,_0x1b4549){_0x1b4549=_0x1b4549||'';return this['sendRequest'](util[_0xedb7('0x2e')](_0xedb7('0x47'),_0x55b46e,_0x1b4549));};AGIChannel[_0xedb7('0x26')][_0xedb7('0x48')]=function(_0x37382f){return this[_0xedb7('0x49')](_0xedb7('0x4a'),_0x37382f);};AGIChannel[_0xedb7('0x26')][_0xedb7('0x4b')]=function(_0x13f00a){return this[_0xedb7('0x49')](_0xedb7('0x4c'),_0x13f00a);};AGIChannel[_0xedb7('0x26')][_0xedb7('0x1b')]=function(_0xcd9188,_0x1f21cf){this['noop'](util[_0xedb7('0x2e')](_0xedb7('0x4d'),_0xcd9188['id'],_0xcd9188[_0xedb7('0x4e')],_0x1f21cf));return{'code':0x1f4,'result':'-1','extra':''};};module[_0xedb7('0x4f')]=AGIChannel; \ No newline at end of file +var _0x86d8=['answer','ANSWER','beep','noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isNumber','toString','SET\x20VARIABLE\x20%s\x20\x22%s\x22','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','continueAt','extension','setContext','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','events','EventEmitter','./error','call','setEncoding','utf8','setTimeout','headers','emit','line','toLowerCase','hangup','substring','520\x20End\x20of\x20proper','no\x20code','replace','result=','indexOf','split','length','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','function','prototype','sendRequest','sync'];(function(_0x285c2f,_0x2b8c92){var _0x3e174f=function(_0x44104b){while(--_0x44104b){_0x285c2f['push'](_0x285c2f['shift']());}};_0x3e174f(++_0x2b8c92);}(_0x86d8,0x101));var _0x886d=function(_0x4aaf2b,_0xec4492){_0x4aaf2b=_0x4aaf2b-0x0;var _0x33de5f=_0x86d8[_0x4aaf2b];return _0x33de5f;};'use strict';var util=require('util');var _=require('lodash');var EventEmitter=require(_0x886d('0x0'))[_0x886d('0x1')];var AGIReply=require('./reply');var AGIError=require(_0x886d('0x2'));function AGIChannel(_0x3ba269){var _0x443757=this,_0x56b93c=new AGIReply(),_0xafe991=![],_0x948fa7={};EventEmitter[_0x886d('0x3')](_0x443757);_0x3ba269[_0x886d('0x4')](_0x886d('0x5'));_0x3ba269[_0x886d('0x6')](0x8*0x3c*0x3c*0x3e8);_0x56b93c['setEncoding']('utf8');_0x56b93c['on'](_0x886d('0x7'),function(_0x10c854){for(var _0x438df7 in _0x10c854){_0x443757[_0x438df7]=_0x10c854[_0x438df7];}_0x443757[_0x886d('0x8')]('ready');});_0x56b93c['on'](_0x886d('0x9'),function(_0x4dd8b8){if(_0x4dd8b8[_0x886d('0xa')]()==_0x886d('0xb')){_0x443757[_0x886d('0x8')]('hangup');return;}if(_0x4dd8b8[_0x886d('0xc')](0x0,0xb)=='520-Invalid'){_0xafe991=!![];}if(_0xafe991){_0x948fa7['rx']+=_0x4dd8b8+'\x0a';if(_0x4dd8b8['search'](_0x886d('0xd'))!=-0x1){_0xafe991=![];}}else{_0x948fa7['rx']=_0x4dd8b8;}if(_0xafe991){return;}if(typeof _0x948fa7['cb']=='function'){var _0x21feed=_0x948fa7['rx'][_0x886d('0xc')](0x0,0x3),_0x4f7714=null,_0x5f4f09=null;_0x21feed=parseInt(_0x21feed);if(isNaN(_0x21feed)){_0x948fa7['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x886d('0xe')});return;}if(_0x21feed!=0xc8){_0x948fa7['cb'](null,{'code':_0x21feed,'result':-0x1,'extra':'KO'});return;}_0x4f7714=_0x948fa7['rx'][_0x886d('0xc')](0x4)[_0x886d('0xf')](_0x886d('0x10'),'');if(_0x4f7714[_0x886d('0x11')]('\x20')!=-0x1){_0x4f7714=_0x4f7714['substr'](0x0,_0x4f7714[_0x886d('0x11')]('\x20'));}if(_['startsWith'](_0x4f7714,'-1')){_0x4f7714=parseInt(_0x4f7714);}_0x5f4f09=_0x948fa7['rx'][_0x886d('0x12')]('\x20');if(_0x5f4f09[_0x886d('0x13')]==0x3){_0x5f4f09=_0x5f4f09[0x2][_0x886d('0xc')](0x1,_0x5f4f09[0x2][_0x886d('0x13')]-0x1);}else if(_0x5f4f09['length']>0x3){var _0x4946ee=/\((.+)\)/;var _0x5bdd5a=_0x948fa7['rx'][_0x886d('0x14')](_0x4946ee);if(_0x5bdd5a){_0x5f4f09=_0x5bdd5a[0x1];}else{_0x5f4f09=null;}}else{_0x5f4f09=null;}_0x948fa7['cb'](null,{'code':_0x21feed,'result':_0x4f7714,'extra':_0x5f4f09});}});_0x3ba269['on'](_0x886d('0x15'),function(_0x216db1){_0x443757['emit'](_0x886d('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x216db1['code']));});_0x3ba269['on'](_0x886d('0x16'),function(){_0x443757['emit']('close',new AGIError('E_AGI_SOCKET_CLOSE'));});_0x3ba269['on']('timeout',function(){_0x443757['emit'](_0x886d('0x17'),new AGIError(_0x886d('0x18')));_0x3ba269[_0x886d('0x19')]();});_0x3ba269['pipe'](_0x56b93c);this[_0x886d('0x1a')]=function(_0x446a8b,_0x499780){var _0x446a8b=_0x446a8b||'',_0x499780=typeof _0x499780==_0x886d('0x1b')?_0x499780:new Function();_0x948fa7={'tx':_0x446a8b,'rx':'','cb':_0x499780};_0x3ba269['write'](_0x446a8b+'\x0a');},this[_0x886d('0x16')]=function(){_0x3ba269[_0x886d('0x19')]();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x886d('0x1c')][_0x886d('0x1d')]=function(_0x2bcce7){return this[_0x886d('0x1a')][_0x886d('0x1e')](this,_0x2bcce7);};AGIChannel[_0x886d('0x1c')][_0x886d('0x1f')]=function(){return this[_0x886d('0x1d')](_0x886d('0x20'));};AGIChannel['prototype']['getData']=function(_0x2c7a9a,_0xc628eb,_0x386c3e){_0x2c7a9a=_0x2c7a9a===undefined?_0x886d('0x21'):_0x2c7a9a;_0xc628eb=_0xc628eb===undefined?'5':_0xc628eb;_0x386c3e=_0x386c3e===undefined?'1':_0x386c3e;return this[_0x886d('0x1d')](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2c7a9a,_0xc628eb*0x3e8,_0x386c3e));};AGIChannel[_0x886d('0x1c')][_0x886d('0x22')]=function(_0x45c266){_0x45c266=_0x45c266||_0x886d('0x23');return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x25'),_0x45c266));};AGIChannel['prototype']['exec']=function(_0x56aa0a,_0x2daf24){if(_[_0x886d('0x26')](_0x2daf24)){return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x27'),_0x56aa0a,_0x2daf24[_0x886d('0x28')](',')));}return this['sendRequest'](util[_0x886d('0x24')](_0x886d('0x27'),_0x56aa0a,_0x2daf24));};AGIChannel[_0x886d('0x1c')]['setContext']=function(_0x1bb9e9){return this[_0x886d('0x1d')](util['format'](_0x886d('0x29'),_0x1bb9e9));};AGIChannel[_0x886d('0x1c')][_0x886d('0x2a')]=function(_0x28f928){return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x2b'),_0x28f928));};AGIChannel[_0x886d('0x1c')]['setPriority']=function(_0x2db43b){return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x2c'),_0x2db43b));};AGIChannel[_0x886d('0x1c')][_0x886d('0xb')]=function(){return this[_0x886d('0x1d')](_0x886d('0x2d'));};AGIChannel['prototype'][_0x886d('0x2e')]=function(_0xfcfa18,_0x467955){var _0x5b0473=_['isBoolean'](_0x467955)||_[_0x886d('0x2f')](_0x467955)?_0x467955[_0x886d('0x30')]():_0x467955;return this[_0x886d('0x1d')](util['format'](_0x886d('0x31'),_0xfcfa18,_0x5b0473?_0x5b0473[_0x886d('0x30')]()[_0x886d('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x886d('0x1c')][_0x886d('0x32')]=function(_0x1db425,_0xa246b1){return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x33'),_0x1db425,_0xa246b1));};AGIChannel[_0x886d('0x1c')][_0x886d('0x34')]=function(_0x15792a,_0x42b923){return this[_0x886d('0x1d')](util[_0x886d('0x24')](_0x886d('0x35'),_0x15792a,_0x42b923));};AGIChannel[_0x886d('0x1c')][_0x886d('0x36')]=function(_0x351500,_0xf38be1){return this[_0x886d('0x1d')](util[_0x886d('0x24')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x351500,_0xf38be1));};AGIChannel[_0x886d('0x1c')][_0x886d('0x37')]=function(_0x2e9632,_0x2c7e26,_0x1f01c1){_0x2c7e26=_0x2c7e26||this[_0x886d('0x38')];_0x1f01c1=_0x1f01c1||0x1;this[_0x886d('0x39')](_0x2e9632);this[_0x886d('0x2a')](_0x2c7e26);this[_0x886d('0x3a')](_0x1f01c1);return this[_0x886d('0x22')](util['format'](_0x886d('0x3b'),_0x2e9632,_0x2c7e26,_0x1f01c1));};AGIChannel[_0x886d('0x1c')][_0x886d('0x3c')]=function(_0x77d78d){return this['sendRequest'](util[_0x886d('0x24')]('GET\x20VARIABLE\x20\x22%s\x22',_0x77d78d));};AGIChannel[_0x886d('0x1c')]['recordFile']=function(_0x41401e,_0xde2ba2,_0x523e7b,_0x6ccb29,_0x308eb2,_0x321e13){_0xde2ba2=_0xde2ba2||_0x886d('0x3d');_0x523e7b=_0x523e7b||'';_0x6ccb29=_0x6ccb29===undefined?-0x1:_0x6ccb29==='-1'?-0x1:_0x6ccb29*0x3e8;_0x308eb2=_0x308eb2===undefined?'':'s='+_0x308eb2;_0x321e13=_0x321e13?_0x886d('0x3e'):'';return this['sendRequest'](util['format'](_0x886d('0x3f'),_0x41401e,_0xde2ba2,_0x523e7b,_0x6ccb29,_0x321e13,_0x308eb2));};AGIChannel[_0x886d('0x1c')][_0x886d('0x40')]=function(_0x4d8e67,_0x14712d){_0x14712d=_0x14712d||'';return this[_0x886d('0x1d')](util[_0x886d('0x24')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x4d8e67,_0x14712d));};AGIChannel[_0x886d('0x1c')][_0x886d('0x41')]=function(_0xb49e75){return this[_0x886d('0x42')]('AGI',_0xb49e75);};AGIChannel['prototype'][_0x886d('0x43')]=function(_0x4a889a){return this[_0x886d('0x42')](_0x886d('0x44'),_0x4a889a);};AGIChannel[_0x886d('0x1c')][_0x886d('0x15')]=function(_0x315982,_0x6c347a){this[_0x886d('0x22')](util[_0x886d('0x24')](_0x886d('0x45'),_0x315982['id'],_0x315982[_0x886d('0x46')],_0x6c347a));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x886d('0x47')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index dc48755..ae1eb62 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 _0xf466=['name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','apply','message'];(function(_0x46a89e,_0x3c223c){var _0x50a1e7=function(_0x1c023d){while(--_0x1c023d){_0x46a89e['push'](_0x46a89e['shift']());}};_0x50a1e7(++_0x3c223c);}(_0xf466,0x9a));var _0x6f46=function(_0x3a2c03,_0x1f945a){_0x3a2c03=_0x3a2c03-0x0;var _0x4f6540=_0xf466[_0x3a2c03];return _0x4f6540;};'use strict';var util=require(_0x6f46('0x0'));var error={'E_AGI_UNDEFINED':_0x6f46('0x1'),'E_AGI_ARGUMENT_PORT':_0x6f46('0x2'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x6f46('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0x6f46('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x6f46('0x5'),'E_AGI_SOCKET_ERROR':_0x6f46('0x6'),'E_AGI_SOCKET_CLOSE':_0x6f46('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x6f46('0x8'),'E_AGI_COMMAND_EMPTY':_0x6f46('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x6f46('0xa'),'E_AGI_IVR_ENTRY':_0x6f46('0xb')};function AGIError(_0x1e6d62){var _0x1e6d62=_0x1e6d62||null,_0x56f5fb=_0x56f5fb||[],_0x235142=0x1,_0x1ef504='';if(!error[_0x1e6d62]){_0x1e6d62=_0x6f46('0xc');}_0x56f5fb[_0x6f46('0xd')](error[_0x1e6d62]);while(arguments[_0x235142]){_0x56f5fb['push'](arguments[_0x235142]);_0x235142++;}_0x1ef504=util[_0x6f46('0xe')][_0x6f46('0xf')](util,_0x56f5fb);this[_0x6f46('0x10')]=_0x1ef504;this[_0x6f46('0x11')]=_0x1e6d62;}module[_0x6f46('0x12')]=AGIError; \ No newline at end of file +var _0xcfb0=['push','format','apply','message','name','exports','util','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.'];(function(_0x2932cf,_0x362fd9){var _0x1711dd=function(_0x2d8de6){while(--_0x2d8de6){_0x2932cf['push'](_0x2932cf['shift']());}};_0x1711dd(++_0x362fd9);}(_0xcfb0,0x150));var _0x0cfb=function(_0x376367,_0x4f148e){_0x376367=_0x376367-0x0;var _0x1a436c=_0xcfb0[_0x376367];return _0x1a436c;};'use strict';var util=require(_0x0cfb('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x0cfb('0x1'),'E_AGI_SERVER_CLOSE':_0x0cfb('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x0cfb('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x0cfb('0x4'),'E_AGI_SOCKET_ERROR':_0x0cfb('0x5'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x0cfb('0x6'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x0cfb('0x7'),'E_AGI_IVR_ENTRY':_0x0cfb('0x8')};function AGIError(_0x1da8c1){var _0x1da8c1=_0x1da8c1||null,_0x59ef3c=_0x59ef3c||[],_0x5314ca=0x1,_0x32f7d3='';if(!error[_0x1da8c1]){_0x1da8c1='E_AGI_UNDEFINED';}_0x59ef3c[_0x0cfb('0x9')](error[_0x1da8c1]);while(arguments[_0x5314ca]){_0x59ef3c[_0x0cfb('0x9')](arguments[_0x5314ca]);_0x5314ca++;}_0x32f7d3=util[_0x0cfb('0xa')][_0x0cfb('0xb')](util,_0x59ef3c);this[_0x0cfb('0xc')]=_0x32f7d3;this[_0x0cfb('0xd')]=_0x1da8c1;}module[_0x0cfb('0xe')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index e1e52e4..71aaad3 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 _0xc35b=['vertices','edges','addEdge','push','size','relations','getVertex','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand','vswitch','target','menu','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','agi','getdigits','numberOfEdges','prototype'];(function(_0x45cd48,_0x3ad9ae){var _0x342df7=function(_0xdcde4f){while(--_0xdcde4f){_0x45cd48['push'](_0x45cd48['shift']());}};_0x342df7(++_0x3ad9ae);}(_0xc35b,0xa3));var _0xbc35=function(_0x455c6c,_0x1e78b7){_0x455c6c=_0x455c6c-0x0;var _0x488242=_0xc35b[_0x455c6c];return _0x488242;};'use strict';var _=require('lodash');var logger=require(_0xbc35('0x0'))(_0xbc35('0x1'));var verticesWithRetry=['menu',_0xbc35('0x2'),'getsecretdigits'];var Graph=function(){this['vertices']={};this['edges']={};this[_0xbc35('0x3')]=0x0;};Graph[_0xbc35('0x4')]['addVertex']=function(_0x5a89bd){this[_0xbc35('0x5')][_0x5a89bd['id']]=_0x5a89bd;this[_0xbc35('0x6')][_0x5a89bd['id']]=[];};Graph[_0xbc35('0x4')][_0xbc35('0x7')]=function(_0x2ae7b0,_0x51b00b,_0x478893){this['edges'][_0x2ae7b0][_0xbc35('0x8')]({'target':_0x51b00b,'condition':_0x478893});this['numberOfEdges']+=0x1;};Graph[_0xbc35('0x4')][_0xbc35('0x9')]=function(){return _[_0xbc35('0x9')](this['vertices']);};Graph[_0xbc35('0x4')][_0xbc35('0xa')]=function(){return this[_0xbc35('0x3')];};Graph[_0xbc35('0x4')][_0xbc35('0xb')]=function(_0x5f0958){return this[_0xbc35('0x5')][_0x5f0958];};Graph[_0xbc35('0x4')][_0xbc35('0xc')]=function(_0x4f1658,_0x4d9b78){if(!this[_0xbc35('0x5')][_0x4f1658]){return logger['info'](_0xbc35('0xd'));}var _0x258060=_0x4d9b78(this['vertices'][_0x4f1658]);if(!_0x258060){return logger[_0xbc35('0xe')](_0xbc35('0xf'));}if(this[_0xbc35('0x6')][_0x4f1658][_0xbc35('0x10')]===0x0){return logger['info'](_0xbc35('0x11'));}for(var _0x13d906=0x0,_0x596cda=[],_0x3166f1=![];_0x13d906\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','stringify','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','result','response','toString','agicommand\x20not\x20found','finally','vertex','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','connection','xml2json','syncho','util','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./graph','defaults','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','name','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','dnid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','uniqueid','evtHangup','toJson','mxGraphModel','root','agicommand','retry','maxRetry','omit','mxCell','hasOwnProperty','length','addEdge','target','then','catch','createSquareReport','indexOf','substring','inspect','debug'];(function(_0x949ea5,_0x47be0d){var _0xc8993e=function(_0xdb1384){while(--_0xdb1384){_0x949ea5['push'](_0x949ea5['shift']());}};_0xc8993e(++_0x47be0d);}(_0x10f3,0x77));var _0x310f=function(_0x72ae7,_0x251ad3){_0x72ae7=_0x72ae7-0x0;var _0xf06075=_0x10f3[_0x72ae7];return _0xf06075;};'use strict';var parser=require(_0x310f('0x0'));var _=require('lodash');var syncho=require(_0x310f('0x1'));var util=require(_0x310f('0x2'));var moment=require('moment');var config=require(_0x310f('0x3'));var logger=require('../../config/logger')(_0x310f('0x4'));var utilLicense=require(_0x310f('0x5'));var rpc=require(_0x310f('0x6'));var mailRpc=require(_0x310f('0x7'));var Graph=require(_0x310f('0x8'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x310f('0x9')](config['agi'],{'ip':'127.0.0.1','port':0x11dd});function connectionHandler(_0x5061ae){process[_0x310f('0xa')](function(){syncho(function(){try{setChannelVariables(_0x5061ae);agiHandler(_0x5061ae);}catch(_0x52eeba){logger[_0x310f('0xb')](_0x52eeba[_0x310f('0xc')]);}});});}function listeningHandler(){console[_0x310f('0xd')](_0x310f('0xe'),config['agi'][_0x310f('0xf')]);logger[_0x310f('0x10')](util[_0x310f('0x11')](_0x310f('0x12'),config[_0x310f('0x4')]['ip'],config[_0x310f('0x4')][_0x310f('0xf')]));}function errorHandler(_0x5803b2){if(_0x5803b2&&_0x5803b2['name']&&_0x5803b2[_0x310f('0x13')]){logger[_0x310f('0xb')](util[_0x310f('0x11')]('[%s]\x20%s',_0x5803b2[_0x310f('0x14')],_0x5803b2[_0x310f('0x13')]));}else{logger[_0x310f('0xb')](util['format']('[ERROR]\x20%s',_0x5803b2[_0x310f('0xc')]));}}function closeHandler(){logger[_0x310f('0x10')](util['format'](_0x310f('0x15'),this[_0x310f('0x16')],this['calleridname'],this[_0x310f('0x17')],this[_0x310f('0x18')],this['uniqueid']));try{createSquareReport(this);}catch(_0x321e02){logger[_0x310f('0xb')](_0x321e02['stack']);}}function timeoutHandler(){logger[_0x310f('0x10')](util[_0x310f('0x11')](_0x310f('0x19'),this['arg_1'],this[_0x310f('0x1a')],this['callerid'],this['dnid'],this['uniqueid']));}function hangupHandler(){logger[_0x310f('0x10')](util['format'](_0x310f('0x1b'),this['arg_1'],this['calleridname'],this[_0x310f('0x17')],this[_0x310f('0x18')],this[_0x310f('0x1c')]));this[_0x310f('0x1d')]=!![];}function getRoot(_0x333f97){return parser[_0x310f('0x1e')](_0x333f97,{'object':!![]})[_0x310f('0x1f')][_0x310f('0x20')];}function addVertex(_0x12c202,_0x4b5eeb,_0x123205){_0x4b5eeb[_0x310f('0x21')]=_0x123205;if(_0x4b5eeb['hasOwnProperty'](_0x310f('0x22'))){_0x4b5eeb[_0x310f('0x23')]=parseInt(_0x4b5eeb[_0x310f('0x22')],0xa);}_0x12c202['addVertex'](_[_0x310f('0x24')](_0x4b5eeb,_0x310f('0x25')));}function initGraph(_0x1c6838,_0x49e5a3){var _0x51a7b4=new Graph();for(var _0x693fb3 in _0x1c6838){if(_0x1c6838[_0x310f('0x26')](_0x693fb3)){if(_['isArray'](_0x1c6838[_0x693fb3])){for(var _0x5c7541=0x0;_0x5c7541<_0x1c6838[_0x693fb3]['length'];_0x5c7541+=0x1){addVertex(_0x51a7b4,_0x1c6838[_0x693fb3][_0x5c7541],_0x693fb3);}}else{addVertex(_0x51a7b4,_0x1c6838[_0x693fb3],_0x693fb3);}}}for(var _0x47203e=0x0;_0x47203e<_0x49e5a3[_0x310f('0x27')];_0x47203e+=0x1){if(_0x49e5a3[_0x47203e]['source']&&_0x49e5a3[_0x47203e]['target']){_0x51a7b4[_0x310f('0x28')](_0x49e5a3[_0x47203e]['source'],_0x49e5a3[_0x47203e][_0x310f('0x29')],_0x49e5a3[_0x47203e]['value']);}}return _0x51a7b4;}function getSquareProject(_0xe364e7,_0x5ccbe9){rpc['getSquareProject'](_0xe364e7)[_0x310f('0x2a')](function(_0x2492b5){_0x5ccbe9(null,_0x2492b5);})[_0x310f('0x2b')](function(_0x2f3e30){_0x5ccbe9(null,_0x2f3e30);});}function createSquareReport(_0x35f7e8,_0x4d6ee2){rpc[_0x310f('0x2c')](_0x35f7e8)[_0x310f('0x2a')](function(_0x193353){if(_0x4d6ee2){_0x4d6ee2(null,_0x193353);}})[_0x310f('0x2b')](function(_0x57fb97){if(_0x4d6ee2){_0x4d6ee2(null,_0x57fb97);}});}function setChannelVariables(_0x236bd0){for(var _0x411077 in _0x236bd0){if(_0x236bd0[_0x310f('0x26')](_0x411077)){if(_0x411077[_0x310f('0x2d')]('agi_')===0x0){_0x236bd0[_0x411077[_0x310f('0x2e')](0x4)]=_0x236bd0[_0x411077];delete _0x236bd0[_0x411077];}}}}function getLogFromObject(_0xaad6e4){return util[_0x310f('0x2f')](_0xaad6e4,{'showHidden':![],'depth':null});}function agiHandler(_0x3a3550){var _0x53506c,_0x2477c1,_0x588e34,_0x47b2a8,_0x2d16bd;logger[_0x310f('0x30')]('variables',JSON['stringify'](_0x3a3550,null,0x2));logger['info'](util[_0x310f('0x11')](_0x310f('0x31'),_0x3a3550[_0x310f('0x16')],_0x3a3550['calleridname'],_0x3a3550[_0x310f('0x17')],_0x3a3550[_0x310f('0x18')],_0x3a3550['uniqueid']));_0x3a3550['on'](_0x310f('0xb'),errorHandler);_0x3a3550['on'](_0x310f('0x32'),closeHandler);_0x3a3550['on'](_0x310f('0x33'),timeoutHandler);_0x3a3550[_0x310f('0x1d')]=![];_0x3a3550['on'](_0x310f('0x34'),hangupHandler);var _0x2eec0e=getSquareProject[_0x310f('0x35')](null,_0x3a3550[_0x310f('0x16')]);if(_0x2eec0e){if(_0x2eec0e[_0x310f('0x36')]){_0x53506c=getRoot(_0x2eec0e[_0x310f('0x36')]);if(_0x53506c&&_0x53506c['start']){logger[_0x310f('0x30')](_0x310f('0x20'),JSON[_0x310f('0x37')](_0x53506c,null,0x2));_0x3a3550[_0x310f('0x38')]=moment()['format'](_0x310f('0x39'));_0x2477c1=initGraph(_[_0x310f('0x24')](_0x53506c,'mxCell'),_0x53506c[_0x310f('0x25')]);_0x588e34=new Vertices(_0x3a3550,rpc,mailRpc);logger[_0x310f('0x10')](util[_0x310f('0x11')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a3550['arg_1'],_0x3a3550[_0x310f('0x1a')],_0x3a3550['callerid'],_0x3a3550[_0x310f('0x18')],_0x3a3550[_0x310f('0x1c')]));_0x2477c1[_0x310f('0x3a')](_0x53506c['start']['id'],function(_0x53f225){try{_0x53f225=_0x588e34[_0x310f('0x3b')](_0x53f225);logger[_0x310f('0x30')]('vertex',JSON[_0x310f('0x37')](_0x53f225,null,0x2));if(_0x53f225[_0x310f('0x21')]==='gotoc'){logger[_0x310f('0x10')](_0x310f('0x3c'));_0x3a3550['context']=_0x53f225[_0x310f('0x3d')]||_0x3a3550[_0x310f('0x3d')];_0x3a3550[_0x310f('0x3e')]=_0x53f225[_0x310f('0x3e')];_0x3a3550[_0x310f('0x3f')]=_0x53f225[_0x310f('0x3f')]?_0x53f225[_0x310f('0x3f')]-0x1:0x1;return null;}else if(_0x53f225&&_0x588e34[_0x53f225[_0x310f('0x21')]]){_0x2d16bd=_0x588e34[_0x53f225[_0x310f('0x21')]](_0x53f225);logger[_0x310f('0x10')]('response',JSON[_0x310f('0x37')](_0x2d16bd,null,0x2));if(_0x2d16bd&&_0x2d16bd[_0x310f('0x40')]===AGI_CODE_SUCCESS&&_0x2d16bd[_0x310f('0x41')]!==AGI_RESULT_ERROR&&!_0x3a3550[_0x310f('0x1d')]){logger[_0x310f('0x30')](_0x310f('0x42'),getLogFromObject(_0x2d16bd));return _['isUndefined'](_0x2d16bd[_0x310f('0x41')])?null:_0x2d16bd[_0x310f('0x41')][_0x310f('0x43')]();}else{logger['error'](_0x310f('0x42'),getLogFromObject(_0x2d16bd));return null;}}else{logger[_0x310f('0xb')](_0x310f('0x44'));return null;}}catch(_0x1b5723){logger[_0x310f('0xb')](_0x1b5723[_0x310f('0xc')]);return null;}});if(_0x53506c['finally']){logger[_0x310f('0x10')](util[_0x310f('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x3a3550[_0x310f('0x16')],_0x3a3550['calleridname'],_0x3a3550[_0x310f('0x17')],_0x3a3550[_0x310f('0x18')],_0x3a3550['uniqueid']));_0x2477c1[_0x310f('0x3a')](_0x53506c[_0x310f('0x45')]['id'],function(_0x4dfc2e){try{_0x4dfc2e=_0x588e34[_0x310f('0x3b')](_0x4dfc2e);logger[_0x310f('0x30')](_0x310f('0x46'),JSON[_0x310f('0x37')](_0x4dfc2e,null,0x2));if(_0x4dfc2e&&_0x588e34[_0x4dfc2e['agicommand']]){_0x2d16bd=_0x588e34[_0x4dfc2e['agicommand']](_0x4dfc2e);if(_0x2d16bd){logger[_0x310f('0x30')](_0x310f('0x42'),getLogFromObject(_0x2d16bd));return _[_0x310f('0x47')](_0x2d16bd[_0x310f('0x41')])?null:_0x2d16bd['result']['toString']();}else{logger[_0x310f('0xb')](_0x310f('0x42'),getLogFromObject(_0x2d16bd));return null;}}else{logger[_0x310f('0xb')](_0x310f('0x44'));return null;}}catch(_0x5d3cc0){logger[_0x310f('0xb')](_0x5d3cc0[_0x310f('0xc')]);return null;}});}logger['info'](util[_0x310f('0x11')](_0x310f('0x48'),_0x3a3550[_0x310f('0x16')],_0x3a3550[_0x310f('0x1a')],_0x3a3550[_0x310f('0x17')],_0x3a3550[_0x310f('0x18')],_0x3a3550[_0x310f('0x1c')]));logger[_0x310f('0x10')](util[_0x310f('0x11')](_0x310f('0x49'),_0x3a3550['context'],_0x3a3550[_0x310f('0x3e')],parseInt(_0x3a3550['priority'],0xa)+0x1));_0x3a3550[_0x310f('0x4a')](_0x3a3550[_0x310f('0x3d')],_0x3a3550['extension'],parseInt(_0x3a3550[_0x310f('0x3f')],0xa)+0x1);_0x3a3550['close']();}}else{logger['error'](util[_0x310f('0x11')](_0x310f('0x4b'),_0x3a3550[_0x310f('0x16')]));_0x3a3550[_0x310f('0x4a')](_0x3a3550[_0x310f('0x3d')],_0x3a3550['extension'],parseInt(_0x3a3550['priority'],0xa)+0x1);_0x3a3550[_0x310f('0x32')]();}}else{logger[_0x310f('0xb')](util['format']('Project\x20%s\x20not\x20found',_0x3a3550[_0x310f('0x16')]));_0x3a3550[_0x310f('0x4a')](_0x3a3550['context'],_0x3a3550[_0x310f('0x3e')],parseInt(_0x3a3550[_0x310f('0x3f')],0xa)+0x1);_0x3a3550[_0x310f('0x32')]();}}function main(){var _0x35dc01;return utilLicense['getLicense']()[_0x310f('0x2a')](function(_0x3e31a2){if(_0x3e31a2){if(_0x3e31a2['voice']){if(_0x3e31a2[_0x310f('0x4c')]&&_0x3e31a2[_0x310f('0x4c')]>0x0){logger[_0x310f('0x10')](util['format'](_0x310f('0x4d'),_0x3e31a2[_0x310f('0x4c')]));_0x35dc01=_0x3e31a2[_0x310f('0x4c')];}else{logger['info'](_0x310f('0x4e'));}}else{logger[_0x310f('0x10')](_0x310f('0x4f'));_0x35dc01=-0x1;}}})[_0x310f('0x2b')](function(_0x565254){logger[_0x310f('0xb')](_0x310f('0x50'),_0x565254[_0x310f('0xc')]);})[_0x310f('0x45')](function(){var _0x12022a=require(_0x310f('0x51'))(config[_0x310f('0x4')]['port'],config[_0x310f('0x4')]['ip'],_0x35dc01);_0x12022a['on'](_0x310f('0xb'),errorHandler);_0x12022a['on'](_0x310f('0x52'),listeningHandler);_0x12022a['on'](_0x310f('0x53'),connectionHandler);_0x12022a['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x5f30=['maxRetry','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','sync','production','joinAt','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','start','clear','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','toString','finally','vertex','isUndefined','agicommand\x20not\x20found','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20published','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]','listening','connection','xml2json','lodash','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\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','toJson','mxGraphModel','root','agicommand','hasOwnProperty'];(function(_0x318dda,_0x1aa800){var _0x3f97ca=function(_0x1dc61a){while(--_0x1dc61a){_0x318dda['push'](_0x318dda['shift']());}};_0x3f97ca(++_0x1aa800);}(_0x5f30,0x94));var _0x05f3=function(_0x646937,_0x3a508f){_0x646937=_0x646937-0x0;var _0x218b90=_0x5f30[_0x646937];return _0x218b90;};'use strict';var parser=require(_0x05f3('0x0'));var _=require(_0x05f3('0x1'));var syncho=require(_0x05f3('0x2'));var util=require(_0x05f3('0x3'));var moment=require(_0x05f3('0x4'));var config=require(_0x05f3('0x5'));var logger=require(_0x05f3('0x6'))(_0x05f3('0x7'));var utilLicense=require(_0x05f3('0x8'));var rpc=require(_0x05f3('0x9'));var mailRpc=require(_0x05f3('0xa'));var Graph=require(_0x05f3('0xb'));var Vertices=require(_0x05f3('0xc'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x05f3('0x7')]=_[_0x05f3('0xd')](config['agi'],{'ip':_0x05f3('0xe'),'port':0x11dd});function connectionHandler(_0x5034d2){process[_0x05f3('0xf')](function(){syncho(function(){try{setChannelVariables(_0x5034d2);agiHandler(_0x5034d2);}catch(_0x383cd6){logger[_0x05f3('0x10')](_0x383cd6[_0x05f3('0x11')]);}});});}function listeningHandler(){console['log']('Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!',config[_0x05f3('0x7')][_0x05f3('0x12')]);logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x15'),config[_0x05f3('0x7')]['ip'],config[_0x05f3('0x7')][_0x05f3('0x12')]));}function errorHandler(_0x506e33){if(_0x506e33&&_0x506e33[_0x05f3('0x16')]&&_0x506e33[_0x05f3('0x17')]){logger['error'](util[_0x05f3('0x14')]('[%s]\x20%s',_0x506e33[_0x05f3('0x16')],_0x506e33['message']));}else{logger[_0x05f3('0x10')](util[_0x05f3('0x14')](_0x05f3('0x18'),_0x506e33['stack']));}}function closeHandler(){logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x19'),this[_0x05f3('0x1a')],this[_0x05f3('0x1b')],this[_0x05f3('0x1c')],this[_0x05f3('0x1d')],this[_0x05f3('0x1e')]));try{createSquareReport(this);}catch(_0xac3e9a){logger['error'](_0xac3e9a[_0x05f3('0x11')]);}}function timeoutHandler(){logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x1f'),this['arg_1'],this[_0x05f3('0x1b')],this[_0x05f3('0x1c')],this[_0x05f3('0x1d')],this['uniqueid']));}function hangupHandler(){logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x20'),this['arg_1'],this['calleridname'],this[_0x05f3('0x1c')],this[_0x05f3('0x1d')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x5c1065){return parser[_0x05f3('0x21')](_0x5c1065,{'object':!![]})[_0x05f3('0x22')][_0x05f3('0x23')];}function addVertex(_0x2a2e9f,_0x5d6f2b,_0x53f731){_0x5d6f2b[_0x05f3('0x24')]=_0x53f731;if(_0x5d6f2b[_0x05f3('0x25')]('retry')){_0x5d6f2b[_0x05f3('0x26')]=parseInt(_0x5d6f2b[_0x05f3('0x27')],0xa);}_0x2a2e9f[_0x05f3('0x28')](_[_0x05f3('0x29')](_0x5d6f2b,_0x05f3('0x2a')));}function initGraph(_0x1f747e,_0x2b9310){var _0x2bbd9e=new Graph();for(var _0x4f2f97 in _0x1f747e){if(_0x1f747e[_0x05f3('0x25')](_0x4f2f97)){if(_[_0x05f3('0x2b')](_0x1f747e[_0x4f2f97])){for(var _0x4d061d=0x0;_0x4d061d<_0x1f747e[_0x4f2f97]['length'];_0x4d061d+=0x1){addVertex(_0x2bbd9e,_0x1f747e[_0x4f2f97][_0x4d061d],_0x4f2f97);}}else{addVertex(_0x2bbd9e,_0x1f747e[_0x4f2f97],_0x4f2f97);}}}for(var _0x33b2a4=0x0;_0x33b2a4<_0x2b9310[_0x05f3('0x2c')];_0x33b2a4+=0x1){if(_0x2b9310[_0x33b2a4][_0x05f3('0x2d')]&&_0x2b9310[_0x33b2a4][_0x05f3('0x2e')]){_0x2bbd9e[_0x05f3('0x2f')](_0x2b9310[_0x33b2a4][_0x05f3('0x2d')],_0x2b9310[_0x33b2a4][_0x05f3('0x2e')],_0x2b9310[_0x33b2a4][_0x05f3('0x30')]);}}return _0x2bbd9e;}function getSquareProject(_0x265e9d,_0x1233b2){rpc[_0x05f3('0x31')](_0x265e9d)[_0x05f3('0x32')](function(_0x24cd92){_0x1233b2(null,_0x24cd92);})[_0x05f3('0x33')](function(_0x54ede6){_0x1233b2(null,_0x54ede6);});}function createSquareReport(_0x49c401,_0xf6fe99){rpc[_0x05f3('0x34')](_0x49c401)[_0x05f3('0x32')](function(_0x12993c){if(_0xf6fe99){_0xf6fe99(null,_0x12993c);}})[_0x05f3('0x33')](function(_0x4a7431){if(_0xf6fe99){_0xf6fe99(null,_0x4a7431);}});}function setChannelVariables(_0x3d7b6a){for(var _0x19ad98 in _0x3d7b6a){if(_0x3d7b6a['hasOwnProperty'](_0x19ad98)){if(_0x19ad98['indexOf']('agi_')===0x0){_0x3d7b6a[_0x19ad98[_0x05f3('0x35')](0x4)]=_0x3d7b6a[_0x19ad98];delete _0x3d7b6a[_0x19ad98];}}}}function getLogFromObject(_0x3301a2){return util[_0x05f3('0x36')](_0x3301a2,{'showHidden':![],'depth':null});}function agiHandler(_0x114392){var _0x2ce16b,_0x5f29c6,_0x148716,_0x533f67,_0x423c9a;logger[_0x05f3('0x37')](_0x05f3('0x38'),JSON[_0x05f3('0x39')](_0x114392,null,0x2));logger['info'](util[_0x05f3('0x14')](_0x05f3('0x3a'),_0x114392[_0x05f3('0x1a')],_0x114392[_0x05f3('0x1b')],_0x114392[_0x05f3('0x1c')],_0x114392[_0x05f3('0x1d')],_0x114392[_0x05f3('0x1e')]));_0x114392['on'](_0x05f3('0x10'),errorHandler);_0x114392['on'](_0x05f3('0x3b'),closeHandler);_0x114392['on'](_0x05f3('0x3c'),timeoutHandler);_0x114392[_0x05f3('0x3d')]=![];_0x114392['on'](_0x05f3('0x3e'),hangupHandler);var _0x3b6d8b=getSquareProject[_0x05f3('0x3f')](null,_0x114392[_0x05f3('0x1a')]);if(_0x3b6d8b){if(_0x3b6d8b[_0x05f3('0x40')]){_0x2ce16b=getRoot(_0x3b6d8b['production']);if(_0x2ce16b&&_0x2ce16b['start']){logger[_0x05f3('0x37')](_0x05f3('0x23'),JSON[_0x05f3('0x39')](_0x2ce16b,null,0x2));_0x114392[_0x05f3('0x41')]=moment()[_0x05f3('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x5f29c6=initGraph(_['omit'](_0x2ce16b,_0x05f3('0x2a')),_0x2ce16b[_0x05f3('0x2a')]);_0x148716=new Vertices(_0x114392,rpc,mailRpc);logger['info'](util[_0x05f3('0x14')](_0x05f3('0x42'),_0x114392[_0x05f3('0x1a')],_0x114392['calleridname'],_0x114392[_0x05f3('0x1c')],_0x114392['dnid'],_0x114392[_0x05f3('0x1e')]));_0x5f29c6[_0x05f3('0x43')](_0x2ce16b[_0x05f3('0x44')]['id'],function(_0x47834b){try{_0x47834b=_0x148716[_0x05f3('0x45')](_0x47834b);logger['debug']('vertex',JSON[_0x05f3('0x39')](_0x47834b,null,0x2));if(_0x47834b['agicommand']===_0x05f3('0x46')){logger['info'](_0x05f3('0x47'));_0x114392[_0x05f3('0x48')]=_0x47834b[_0x05f3('0x48')]||_0x114392[_0x05f3('0x48')];_0x114392[_0x05f3('0x49')]=_0x47834b[_0x05f3('0x49')];_0x114392[_0x05f3('0x4a')]=_0x47834b[_0x05f3('0x4a')]?_0x47834b['priority']-0x1:0x1;return null;}else if(_0x47834b&&_0x148716[_0x47834b[_0x05f3('0x24')]]){_0x423c9a=_0x148716[_0x47834b[_0x05f3('0x24')]](_0x47834b);logger[_0x05f3('0x13')](_0x05f3('0x4b'),JSON[_0x05f3('0x39')](_0x423c9a,null,0x2));if(_0x423c9a&&_0x423c9a[_0x05f3('0x4c')]===AGI_CODE_SUCCESS&&_0x423c9a[_0x05f3('0x4d')]!==AGI_RESULT_ERROR&&!_0x114392[_0x05f3('0x3d')]){logger[_0x05f3('0x37')]('response',getLogFromObject(_0x423c9a));return _['isUndefined'](_0x423c9a['result'])?null:_0x423c9a[_0x05f3('0x4d')][_0x05f3('0x4e')]();}else{logger[_0x05f3('0x10')](_0x05f3('0x4b'),getLogFromObject(_0x423c9a));return null;}}else{logger[_0x05f3('0x10')]('agicommand\x20not\x20found');return null;}}catch(_0x53f138){logger['error'](_0x53f138[_0x05f3('0x11')]);return null;}});if(_0x2ce16b[_0x05f3('0x4f')]){logger['info'](util[_0x05f3('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x114392[_0x05f3('0x1a')],_0x114392[_0x05f3('0x1b')],_0x114392[_0x05f3('0x1c')],_0x114392[_0x05f3('0x1d')],_0x114392[_0x05f3('0x1e')]));_0x5f29c6[_0x05f3('0x43')](_0x2ce16b['finally']['id'],function(_0x340ada){try{_0x340ada=_0x148716['clear'](_0x340ada);logger[_0x05f3('0x37')](_0x05f3('0x50'),JSON[_0x05f3('0x39')](_0x340ada,null,0x2));if(_0x340ada&&_0x148716[_0x340ada[_0x05f3('0x24')]]){_0x423c9a=_0x148716[_0x340ada[_0x05f3('0x24')]](_0x340ada);if(_0x423c9a){logger[_0x05f3('0x37')]('response',getLogFromObject(_0x423c9a));return _[_0x05f3('0x51')](_0x423c9a[_0x05f3('0x4d')])?null:_0x423c9a[_0x05f3('0x4d')]['toString']();}else{logger[_0x05f3('0x10')](_0x05f3('0x4b'),getLogFromObject(_0x423c9a));return null;}}else{logger['error'](_0x05f3('0x52'));return null;}}catch(_0xf2f210){logger[_0x05f3('0x10')](_0xf2f210[_0x05f3('0x11')]);return null;}});}logger[_0x05f3('0x13')](util['format']('[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x114392['arg_1'],_0x114392[_0x05f3('0x1b')],_0x114392[_0x05f3('0x1c')],_0x114392['dnid'],_0x114392[_0x05f3('0x1e')]));logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x53'),_0x114392[_0x05f3('0x48')],_0x114392[_0x05f3('0x49')],parseInt(_0x114392[_0x05f3('0x4a')],0xa)+0x1));_0x114392[_0x05f3('0x54')](_0x114392[_0x05f3('0x48')],_0x114392[_0x05f3('0x49')],parseInt(_0x114392['priority'],0xa)+0x1);_0x114392['close']();}}else{logger[_0x05f3('0x10')](util['format'](_0x05f3('0x55'),_0x114392[_0x05f3('0x1a')]));_0x114392[_0x05f3('0x54')](_0x114392[_0x05f3('0x48')],_0x114392[_0x05f3('0x49')],parseInt(_0x114392[_0x05f3('0x4a')],0xa)+0x1);_0x114392[_0x05f3('0x3b')]();}}else{logger['error'](util[_0x05f3('0x14')](_0x05f3('0x56'),_0x114392[_0x05f3('0x1a')]));_0x114392['continueAt'](_0x114392[_0x05f3('0x48')],_0x114392['extension'],parseInt(_0x114392[_0x05f3('0x4a')],0xa)+0x1);_0x114392['close']();}}function main(){var _0x206fd6;return utilLicense['getLicense']()['then'](function(_0x1a84cf){if(_0x1a84cf){if(_0x1a84cf[_0x05f3('0x57')]){if(_0x1a84cf[_0x05f3('0x58')]&&_0x1a84cf[_0x05f3('0x58')]>0x0){logger[_0x05f3('0x13')](util[_0x05f3('0x14')](_0x05f3('0x59'),_0x1a84cf[_0x05f3('0x58')]));_0x206fd6=_0x1a84cf[_0x05f3('0x58')];}else{logger[_0x05f3('0x13')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x05f3('0x13')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x206fd6=-0x1;}}})[_0x05f3('0x33')](function(_0x43a4f4){logger['error'](_0x05f3('0x5a'),_0x43a4f4[_0x05f3('0x11')]);})[_0x05f3('0x4f')](function(){var _0x251e90=require('./server')(config[_0x05f3('0x7')][_0x05f3('0x12')],config[_0x05f3('0x7')]['ip'],_0x206fd6);_0x251e90['on'](_0x05f3('0x10'),errorHandler);_0x251e90['on'](_0x05f3('0x5b'),listeningHandler);_0x251e90['on'](_0x05f3('0x5c'),connectionHandler);_0x251e90['on'](_0x05f3('0x3b'),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 b1e39c1..87218cb 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 _0xc703=['jayson/promise','client','http','request','then','error','message','catch','sendMailMessage','bluebird'];(function(_0x2bf1fb,_0x10022d){var _0x5e7e68=function(_0x287fbb){while(--_0x287fbb){_0x2bf1fb['push'](_0x2bf1fb['shift']());}};_0x5e7e68(++_0x10022d);}(_0xc703,0x9f));var _0x3c70=function(_0x37e9c1,_0x20ff2a){_0x37e9c1=_0x37e9c1-0x0;var _0x3b12bd=_0xc703[_0x37e9c1];return _0x3b12bd;};'use strict';var BPromise=require(_0x3c70('0x0'));var jayson=require(_0x3c70('0x1'));var client=jayson[_0x3c70('0x2')][_0x3c70('0x3')]({'port':0x232b});function request(_0x259284,_0x268ac0){return new BPromise(function(_0x16e730,_0x6d9003){return client[_0x3c70('0x4')](_0x259284,_0x268ac0)[_0x3c70('0x5')](function(_0x233957){if(_0x233957[_0x3c70('0x6')]){return _0x6d9003(_0x233957[_0x3c70('0x6')][_0x3c70('0x7')]);}else{return _0x16e730(_0x233957['result']);}})[_0x3c70('0x8')](function(_0x2679f5){return _0x6d9003(_0x2679f5);});});}exports[_0x3c70('0x9')]=function(_0x24aefb,_0x589781){return request('SendMail',{'account':_0x24aefb,'message':_0x589781});}; \ No newline at end of file +var _0x02bb=['result','catch','SendMail','bluebird','jayson/promise','client','http','then','error','message'];(function(_0x511723,_0x4db8e2){var _0x25add0=function(_0x276373){while(--_0x276373){_0x511723['push'](_0x511723['shift']());}};_0x25add0(++_0x4db8e2);}(_0x02bb,0x125));var _0xb02b=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x02bb[_0x40a045];return _0x1a687c;};'use strict';var BPromise=require(_0xb02b('0x0'));var jayson=require(_0xb02b('0x1'));var client=jayson[_0xb02b('0x2')][_0xb02b('0x3')]({'port':0x232b});function request(_0x311ca6,_0xfb7efc){return new BPromise(function(_0x37b5cf,_0x57f070){return client['request'](_0x311ca6,_0xfb7efc)[_0xb02b('0x4')](function(_0x1dacbe){if(_0x1dacbe['error']){return _0x57f070(_0x1dacbe[_0xb02b('0x5')][_0xb02b('0x6')]);}else{return _0x37b5cf(_0x1dacbe[_0xb02b('0x7')]);}})[_0xb02b('0x8')](function(_0x2f1f34){return _0x57f070(_0x2f1f34);});});}exports['sendMailMessage']=function(_0x515898,_0x4aae22){return request(_0xb02b('0x9'),{'account':_0x515898,'message':_0x4aae22});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index 3722a9f..69c40d1 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 _0x518c=['inherits','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf','substring','split','trim','slice','length','headers','emit','exports','util','stream','_localBuffer','_inBody'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x518c,0x150));var _0xc518=function(_0x36ced1,_0x256f6d){_0x36ced1=_0x36ced1-0x0;var _0x2f2f4d=_0x518c[_0x36ced1];return _0x2f2f4d;};'use strict';var util=require(_0xc518('0x0'));var Transform=require(_0xc518('0x1'))['Transform'];function AGIReply(_0x18062f){Transform['call'](this,_0x18062f);this[_0xc518('0x2')]='';this[_0xc518('0x3')]=![];}util[_0xc518('0x4')](AGIReply,Transform);AGIReply[_0xc518('0x5')][_0xc518('0x6')]=function(_0x1373b8,_0x1540d1,_0x5c4c5c){var _0xafab11='\x0a',_0x2f8b96=['\x0a\x0a',_0xc518('0x7')],_0x2cc1f0=-0x1,_0x715955=-0x1,_0x2b0ebf='',_0x363059=0x0,_0x25ad6f='',_0x3d8636='';this[_0xc518('0x2')]+=_0x1373b8['toString']();_0x25ad6f=this[_0xc518('0x2')];if(!this[_0xc518('0x3')]){_0x363059=0x0;while(_0x2f8b96[_0x363059]){while((_0x715955=_0x25ad6f[_0xc518('0x8')](_0x2f8b96[_0x363059]))!=-0x1){_0x2b0ebf=_0x2f8b96[_0x363059];_0x3d8636=_0x25ad6f[_0xc518('0x9')](0x0,_0x715955);_0x25ad6f=_0x25ad6f[_0xc518('0x9')](_0x715955+_0x2b0ebf['length']);var _0x464a27=_0x3d8636[_0xc518('0xa')](_0xafab11),_0x3ffd51=0x0,_0x3dae92={},_0x25aeb2='',_0x348fe4='',_0x47f003=-0x1;while(_0x464a27[_0x3ffd51]){_0x47f003=_0x464a27[_0x3ffd51]['indexOf'](':');if(_0x47f003!=-0x1){_0x25aeb2=_0x464a27[_0x3ffd51]['slice'](0x0,_0x47f003)[_0xc518('0xb')]();_0x348fe4=_0x464a27[_0x3ffd51][_0xc518('0xc')](_0x47f003+0x1)[_0xc518('0xb')]();if(_0x25aeb2[_0xc518('0xd')]>0x0){_0x3dae92[_0x25aeb2]=_0x348fe4;}}else{}_0x3ffd51++;}this['emit'](_0xc518('0xe'),_0x3dae92);this[_0xc518('0x3')]=!![];}_0x363059++;}this[_0xc518('0x2')]=_0x25ad6f;}else{while((_0x2cc1f0=_0x25ad6f[_0xc518('0x8')](_0xafab11))!=-0x1){_0x3d8636=_0x25ad6f[_0xc518('0x9')](0x0,_0x2cc1f0);this[_0xc518('0xf')]('line',_0x3d8636);_0x25ad6f=_0x25ad6f[_0xc518('0x9')](_0x2cc1f0+_0xafab11[_0xc518('0xd')]);}this['_localBuffer']=_0x25ad6f;}_0x5c4c5c();};module[_0xc518('0x10')]=AGIReply; \ No newline at end of file +var _0x4ded=['split','indexOf','slice','trim','emit','headers','line','substring','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','_transform','length'];(function(_0x4b172b,_0x2956e5){var _0x49debc=function(_0x5c6cf8){while(--_0x5c6cf8){_0x4b172b['push'](_0x4b172b['shift']());}};_0x49debc(++_0x2956e5);}(_0x4ded,0x116));var _0xd4de=function(_0x1d435e,_0x2421bd){_0x1d435e=_0x1d435e-0x0;var _0x21162e=_0x4ded[_0x1d435e];return _0x21162e;};'use strict';var util=require(_0xd4de('0x0'));var Transform=require(_0xd4de('0x1'))[_0xd4de('0x2')];function AGIReply(_0x1fa334){Transform[_0xd4de('0x3')](this,_0x1fa334);this[_0xd4de('0x4')]='';this[_0xd4de('0x5')]=![];}util[_0xd4de('0x6')](AGIReply,Transform);AGIReply[_0xd4de('0x7')][_0xd4de('0x8')]=function(_0x2e8d86,_0x8fbe6a,_0x554a51){var _0x23e5b9='\x0a',_0x2433b8=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x15eb91=-0x1,_0x2c56d5=-0x1,_0x4453c2='',_0x1e8c35=0x0,_0x5c612f='',_0xb7e8cf='';this['_localBuffer']+=_0x2e8d86['toString']();_0x5c612f=this[_0xd4de('0x4')];if(!this[_0xd4de('0x5')]){_0x1e8c35=0x0;while(_0x2433b8[_0x1e8c35]){while((_0x2c56d5=_0x5c612f['indexOf'](_0x2433b8[_0x1e8c35]))!=-0x1){_0x4453c2=_0x2433b8[_0x1e8c35];_0xb7e8cf=_0x5c612f['substring'](0x0,_0x2c56d5);_0x5c612f=_0x5c612f['substring'](_0x2c56d5+_0x4453c2[_0xd4de('0x9')]);var _0x49d931=_0xb7e8cf[_0xd4de('0xa')](_0x23e5b9),_0x38ac13=0x0,_0x3eb84a={},_0x104dad='',_0x2aa09d='',_0x3ffc72=-0x1;while(_0x49d931[_0x38ac13]){_0x3ffc72=_0x49d931[_0x38ac13][_0xd4de('0xb')](':');if(_0x3ffc72!=-0x1){_0x104dad=_0x49d931[_0x38ac13][_0xd4de('0xc')](0x0,_0x3ffc72)[_0xd4de('0xd')]();_0x2aa09d=_0x49d931[_0x38ac13][_0xd4de('0xc')](_0x3ffc72+0x1)[_0xd4de('0xd')]();if(_0x104dad[_0xd4de('0x9')]>0x0){_0x3eb84a[_0x104dad]=_0x2aa09d;}}else{}_0x38ac13++;}this[_0xd4de('0xe')](_0xd4de('0xf'),_0x3eb84a);this[_0xd4de('0x5')]=!![];}_0x1e8c35++;}this[_0xd4de('0x4')]=_0x5c612f;}else{while((_0x15eb91=_0x5c612f[_0xd4de('0xb')](_0x23e5b9))!=-0x1){_0xb7e8cf=_0x5c612f['substring'](0x0,_0x15eb91);this['emit'](_0xd4de('0x10'),_0xb7e8cf);_0x5c612f=_0x5c612f[_0xd4de('0x11')](_0x15eb91+_0x23e5b9[_0xd4de('0x9')]);}this[_0xd4de('0x4')]=_0x5c612f;}_0x554a51();};module['exports']=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 0ad952f..945033f 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 _0x4ea4=['arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareMessage','createCmContact','phone','ListId','CreateCmContact','ShowPause','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','bluebird','moment','util','jayson/promise','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','getSmsAccountById','ShowSmsAccount','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport'];(function(_0x3deebf,_0x567ef3){var _0x7c3c14=function(_0x519a09){while(--_0x519a09){_0x3deebf['push'](_0x3deebf['shift']());}};_0x7c3c14(++_0x567ef3);}(_0x4ea4,0x159));var _0x44ea=function(_0x4a8c17,_0x494a23){_0x4a8c17=_0x4a8c17-0x0;var _0x584d5e=_0x4ea4[_0x4a8c17];return _0x584d5e;};'use strict';var BPromise=require(_0x44ea('0x0'));var moment=require(_0x44ea('0x1'));var _=require('lodash');var util=require(_0x44ea('0x2'));var jayson=require(_0x44ea('0x3'));var client=jayson['client'][_0x44ea('0x4')]({'port':0x2329});function request(_0x53f115,_0x1b2c03){return new BPromise(function(_0x368abd,_0x5ad97d){return client[_0x44ea('0x5')](_0x53f115,_0x1b2c03)[_0x44ea('0x6')](function(_0x1bfcb2){if(_0x1bfcb2[_0x44ea('0x7')]){return _0x5ad97d(_0x1bfcb2[_0x44ea('0x7')][_0x44ea('0x8')]);}else{return _0x368abd(_0x1bfcb2[_0x44ea('0x9')]);}})[_0x44ea('0xa')](function(_0x4e8714){return _0x5ad97d(_0x4e8714);});});}exports[_0x44ea('0xb')]=function(_0x2a89dd){return request(_0x44ea('0xc'),{'options':{'raw':![],'where':{'name':_0x2a89dd},'attributes':[_0x44ea('0xd')]}});};exports['getMailAccountById']=function(_0x23fcb1){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x23fcb1},'include':[{'model':_0x44ea('0xe'),'as':_0x44ea('0xf')}],'attributes':['id',_0x44ea('0x10'),_0x44ea('0x11')]}});};exports[_0x44ea('0x12')]=function(_0x7e5625){return request(_0x44ea('0xc'),{'options':{'where':{'id':_0x7e5625},'attributes':['name']}});};exports[_0x44ea('0x13')]=function(_0x36fa0b){return request(_0x44ea('0x14'),{'options':{'where':{'id':_0x36fa0b},'attributes':[_0x44ea('0x10')]}});};exports['getVariableById']=function(_0x415403){return request('ShowVariable',{'options':{'where':{'id':_0x415403},'attributes':['name']}});};exports[_0x44ea('0x15')]=function(_0x4a56b0){return request(_0x44ea('0x16'),{'options':{'where':{'id':_0x4a56b0},'attributes':[_0x44ea('0x17')]}});};exports[_0x44ea('0x18')]=function(_0x2157d0){return request(_0x44ea('0x19'),{'options':{'where':{'id':_0x2157d0},'attributes':['name']}});};exports[_0x44ea('0x1a')]=function(_0x2a61f3){return request(_0x44ea('0x1b'),{'options':{'where':{'id':_0x2a61f3},'attributes':[_0x44ea('0x10')]}});};exports[_0x44ea('0x1c')]=function(_0x2c70fd){return request(_0x44ea('0x1d'),{'options':{'where':{'id':_0x2c70fd},'attributes':[_0x44ea('0x1e')]}});};exports[_0x44ea('0x1f')]=function(_0x4d6299){return request(_0x44ea('0x20'),{'options':{'raw':![],'where':{'id':_0x4d6299},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x44ea('0x21')]=function(_0x2ae94f){return request(_0x44ea('0x22'),{'options':{'where':{'id':_0x2ae94f},'attributes':['id',_0x44ea('0x10')]}});};exports['createSmsMessage']=function(_0x55dce0){return request(_0x44ea('0x23'),{'body':_0x55dce0});};exports[_0x44ea('0x24')]=function(_0x31af3a){return request(_0x44ea('0x25'),{'body':_0x31af3a});};exports[_0x44ea('0x26')]=function(_0x3bb0a1){return request(_0x44ea('0x27'),{'body':_['merge'](_0x3bb0a1,{'project_name':_0x3bb0a1[_0x44ea('0x28')],'prev_project_name':_0x3bb0a1[_0x44ea('0x29')]||'','is_subproject':_0x3bb0a1[_0x44ea('0x29')]?!![]:![],'leaveAt':moment()[_0x44ea('0x2a')](_0x44ea('0x2b'))})});};exports['createSquareRecording']=function(_0x3bf833){return request('CreateSquareRecording',{'body':_0x3bf833});};exports[_0x44ea('0x2c')]=function(_0x465af6){return request('CreateSquareMessage',{'body':_0x465af6});};exports[_0x44ea('0x2d')]=function(_0x312edb){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x312edb[_0x44ea('0x2e')],'ListId':_0x312edb[_0x44ea('0x2f')]}}})[_0x44ea('0x6')](function(_0x41370d){if(_0x41370d){return _0x41370d;}return request(_0x44ea('0x30'),{'body':_0x312edb});});};exports['getPauseById']=function(_0x38d233){return request(_0x44ea('0x31'),{'options':{'where':{'id':_0x38d233},'attributes':[_0x44ea('0x10')]}});};exports['agentLogin']=function(_0x2af041,_0x39c299){return request(_0x44ea('0x32'),{'body':{'interface':_0x39c299},'options':{'where':_0x2af041}});};exports[_0x44ea('0x33')]=function(_0x39bad5,_0x3bd6ad,_0x104045){return request(_0x44ea('0x34'),{'body':{'type':_0x3bd6ad,'uniqueid':_0x104045},'options':{'where':_0x39bad5}});};exports[_0x44ea('0x35')]=function(_0x4379f3){return request(_0x44ea('0x36'),{'body':{},'options':{'where':_0x4379f3}});};exports['agentLogout']=function(_0x38ccd2){return request('LogoutUser',{'body':{},'options':{'where':_0x38ccd2}});}; \ No newline at end of file +var _0x7e5f=['bluebird','moment','lodash','util','jayson/promise','client','http','request','then','error','result','catch','getSquareProject','ShowSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowVariable','ShowSquareOdbc','dsn','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','phone','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','agentUnpause','UnpauseUser','agentLogout'];(function(_0x49c2c1,_0x144b44){var _0x1eaac8=function(_0x2438db){while(--_0x2438db){_0x49c2c1['push'](_0x49c2c1['shift']());}};_0x1eaac8(++_0x144b44);}(_0x7e5f,0x74));var _0xf7e5=function(_0x3132e8,_0x499a0e){_0x3132e8=_0x3132e8-0x0;var _0x43eb8c=_0x7e5f[_0x3132e8];return _0x43eb8c;};'use strict';var BPromise=require(_0xf7e5('0x0'));var moment=require(_0xf7e5('0x1'));var _=require(_0xf7e5('0x2'));var util=require(_0xf7e5('0x3'));var jayson=require(_0xf7e5('0x4'));var client=jayson[_0xf7e5('0x5')][_0xf7e5('0x6')]({'port':0x2329});function request(_0x250408,_0x29de6e){return new BPromise(function(_0x4e3b09,_0x120055){return client[_0xf7e5('0x7')](_0x250408,_0x29de6e)[_0xf7e5('0x8')](function(_0x3bd8c1){if(_0x3bd8c1[_0xf7e5('0x9')]){return _0x120055(_0x3bd8c1[_0xf7e5('0x9')]['message']);}else{return _0x4e3b09(_0x3bd8c1[_0xf7e5('0xa')]);}})[_0xf7e5('0xb')](function(_0x5c8c86){return _0x120055(_0x5c8c86);});});}exports[_0xf7e5('0xc')]=function(_0x2576ae){return request(_0xf7e5('0xd'),{'options':{'raw':![],'where':{'name':_0x2576ae},'attributes':[_0xf7e5('0xe')]}});};exports[_0xf7e5('0xf')]=function(_0x57e4d){return request(_0xf7e5('0x10'),{'options':{'raw':![],'where':{'id':_0x57e4d},'include':[{'model':_0xf7e5('0x11'),'as':_0xf7e5('0x12')}],'attributes':['id',_0xf7e5('0x13'),_0xf7e5('0x14')]}});};exports[_0xf7e5('0x15')]=function(_0x15852a){return request(_0xf7e5('0xd'),{'options':{'where':{'id':_0x15852a},'attributes':[_0xf7e5('0x13')]}});};exports['getVoiceQueueById']=function(_0x53ec35){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x53ec35},'attributes':[_0xf7e5('0x13')]}});};exports['getVariableById']=function(_0x4707e6){return request(_0xf7e5('0x16'),{'options':{'where':{'id':_0x4707e6},'attributes':[_0xf7e5('0x13')]}});};exports['getSquareOdbcById']=function(_0x16e9cc){return request(_0xf7e5('0x17'),{'options':{'where':{'id':_0x16e9cc},'attributes':[_0xf7e5('0x18')]}});};exports[_0xf7e5('0x19')]=function(_0x406da9){return request('ShowUser',{'options':{'where':{'id':_0x406da9},'attributes':[_0xf7e5('0x13')]}});};exports[_0xf7e5('0x1a')]=function(_0x5c5cdf){return request(_0xf7e5('0x1b'),{'options':{'where':{'id':_0x5c5cdf},'attributes':[_0xf7e5('0x13')]}});};exports[_0xf7e5('0x1c')]=function(_0x3e611d){return request(_0xf7e5('0x1d'),{'options':{'where':{'id':_0x3e611d},'attributes':[_0xf7e5('0x1e')]}});};exports['getIntervalById']=function(_0x4b4f12){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x4b4f12},'include':[{'model':_0xf7e5('0x1f'),'as':_0xf7e5('0x20')}]}});};exports[_0xf7e5('0x21')]=function(_0x536df8){return request(_0xf7e5('0x22'),{'options':{'where':{'id':_0x536df8},'attributes':['id',_0xf7e5('0x13')]}});};exports[_0xf7e5('0x23')]=function(_0x2ec237){return request(_0xf7e5('0x24'),{'body':_0x2ec237});};exports[_0xf7e5('0x25')]=function(_0x193fb7){return request(_0xf7e5('0x26'),{'body':_0x193fb7});};exports[_0xf7e5('0x27')]=function(_0x2093e6){return request('CreateSquareReport',{'body':_['merge'](_0x2093e6,{'project_name':_0x2093e6[_0xf7e5('0x28')],'prev_project_name':_0x2093e6[_0xf7e5('0x29')]||'','is_subproject':_0x2093e6[_0xf7e5('0x29')]?!![]:![],'leaveAt':moment()['format'](_0xf7e5('0x2a'))})});};exports[_0xf7e5('0x2b')]=function(_0x1992ec){return request(_0xf7e5('0x2c'),{'body':_0x1992ec});};exports[_0xf7e5('0x2d')]=function(_0x220f95){return request(_0xf7e5('0x2e'),{'body':_0x220f95});};exports[_0xf7e5('0x2f')]=function(_0x46eb3c){return request(_0xf7e5('0x30'),{'options':{'raw':![],'where':{'phone':_0x46eb3c[_0xf7e5('0x31')],'ListId':_0x46eb3c['ListId']}}})[_0xf7e5('0x8')](function(_0x2120a9){if(_0x2120a9){return _0x2120a9;}return request('CreateCmContact',{'body':_0x46eb3c});});};exports[_0xf7e5('0x32')]=function(_0x26987b){return request(_0xf7e5('0x33'),{'options':{'where':{'id':_0x26987b},'attributes':[_0xf7e5('0x13')]}});};exports[_0xf7e5('0x34')]=function(_0x33d7ba,_0x1049b9){return request(_0xf7e5('0x35'),{'body':{'interface':_0x1049b9},'options':{'where':_0x33d7ba}});};exports['agentPause']=function(_0x1392e3,_0x5950ef,_0xa71808){return request(_0xf7e5('0x36'),{'body':{'type':_0x5950ef,'uniqueid':_0xa71808},'options':{'where':_0x1392e3}});};exports[_0xf7e5('0x37')]=function(_0x6e17a2){return request(_0xf7e5('0x38'),{'body':{},'options':{'where':_0x6e17a2}});};exports[_0xf7e5('0x39')]=function(_0x30703c){return request('LogoutUser',{'body':{},'options':{'where':_0x30703c}});}; \ 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 864651c..f8cf2a3 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 _0x004c=['exports','./polly','./lex'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x004c,0x85));var _0xc004=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0x004c[_0x22b68a];return _0x1ac67a;};var polly=require(_0xc004('0x0'));var lex=require(_0xc004('0x1'));module[_0xc004('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0x15b2=['./lex'];(function(_0x202648,_0x30dba7){var _0x2453e7=function(_0xb93050){while(--_0xb93050){_0x202648['push'](_0x202648['shift']());}};_0x2453e7(++_0x30dba7);}(_0x15b2,0x145));var _0x215b=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x15b2[_0x4ba380];return _0x4b111b;};var polly=require('./polly');var lex=require(_0x215b('0x0'));module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 451324c..80dd3ec 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 _0x5ff3=['exports'];(function(_0x591a90,_0x5525b0){var _0x551587=function(_0xd6ad8e){while(--_0xd6ad8e){_0x591a90['push'](_0x591a90['shift']());}};_0x551587(++_0x5525b0);}(_0x5ff3,0x17d));var _0x35ff=function(_0xe04577,_0x6331a2){_0xe04577=_0xe04577-0x0;var _0x7d842e=_0x5ff3[_0xe04577];return _0x7d842e;};'use strict';var lex=require('./lib/api');module[_0x35ff('0x0')]=function(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a){return lex(_0x48cbf7,_0x1763a,_0x47c98d,_0x380f54,_0x1bb200,_0x3bd66a);}; \ No newline at end of file +var _0xa571=['exports','./lib/api'];(function(_0x1505e5,_0x5cc291){var _0x5b1dcd=function(_0x18bfe5){while(--_0x18bfe5){_0x1505e5['push'](_0x1505e5['shift']());}};_0x5b1dcd(++_0x5cc291);}(_0xa571,0x107));var _0x1a57=function(_0x207202,_0x4d5a09){_0x207202=_0x207202-0x0;var _0x2c5866=_0xa571[_0x207202];return _0x2c5866;};'use strict';var lex=require(_0x1a57('0x0'));module[_0x1a57('0x1')]=function(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a){return lex(_0x206f1b,_0x1067d9,_0x48485e,_0x1a071f,_0x2eebaa,_0x4d5f7a);}; \ 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 2ad395e..10b4fa1 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(_0x470396,_0x3b01cb){var _0xfa58d9=function(_0x8adc2e){while(--_0x8adc2e){_0x470396['push'](_0x470396['shift']());}};_0xfa58d9(++_0x3b01cb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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(_0x512e2a,_0x356b7b){var _0x44e764=function(_0xa33c2c){while(--_0xa33c2c){_0x512e2a['push'](_0x512e2a['shift']());}};_0x44e764(++_0x356b7b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xa9e0[_0x4baae2];return _0x1a2285;};'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 bc3300b..0243580 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 _0xde34=['exports','./lib/api'];(function(_0x495054,_0x304104){var _0x146d2e=function(_0x350426){while(--_0x350426){_0x495054['push'](_0x495054['shift']());}};_0x146d2e(++_0x304104);}(_0xde34,0x1cb));var _0x4de3=function(_0x36bc43,_0x474d61){_0x36bc43=_0x36bc43-0x0;var _0xb301fb=_0xde34[_0x36bc43];return _0xb301fb;};'use strict';var polly=require(_0x4de3('0x0'));module[_0x4de3('0x1')]=function(_0x437ef6,_0x1a6d1b,_0x58a1b3,_0x559786,_0x3a2437,_0x4704f3,_0x4b5f55){return polly(_0x437ef6,_0x1a6d1b,_0x58a1b3,_0x559786,_0x3a2437,_0x4704f3,_0x4b5f55);}; \ No newline at end of file +var _0xc812=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc812,0x1da));var _0x2c81=function(_0x3a3385,_0x3e369e){_0x3a3385=_0x3a3385-0x0;var _0x58b45b=_0xc812[_0x3a3385];return _0x58b45b;};'use strict';var polly=require(_0x2c81('0x0'));module[_0x2c81('0x1')]=function(_0x12c710,_0x47fc2c,_0x56e056,_0x119b0d,_0x416c5e,_0x1cbde6,_0x1fc654){return polly(_0x12c710,_0x47fc2c,_0x56e056,_0x119b0d,_0x416c5e,_0x1cbde6,_0x1fc654);}; \ 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 a8b843e..a3ffa55 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 _0x51fc=['randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','exports','text','mp3','path','bluebird'];(function(_0x47e309,_0x1e771a){var _0x2e1900=function(_0x407297){while(--_0x407297){_0x47e309['push'](_0x47e309['shift']());}};_0x2e1900(++_0x1e771a);}(_0x51fc,0x80));var _0xc51f=function(_0x5c0232,_0x1c449f){_0x5c0232=_0x5c0232-0x0;var _0x589366=_0x51fc[_0x5c0232];return _0x589366;};'use strict';var fs=require('fs');var path=require(_0xc51f('0x0'));var BPromise=require(_0xc51f('0x1'));var rs=require(_0xc51f('0x2'));var AWS=require(_0xc51f('0x3'));function pollyResult(_0x579ca8,_0x436449,_0x1434db){return new BPromise(function(_0x15bdd8,_0x434f19){_0x579ca8[_0xc51f('0x4')](_0x436449,function(_0x39b578,_0xec0fca){if(_0x39b578){_0x434f19(_0x39b578);}else if(_0xec0fca){if(_0xec0fca[_0xc51f('0x5')]instanceof Buffer){fs[_0xc51f('0x6')](_0x1434db,_0xec0fca[_0xc51f('0x5')],function(_0x591e98){if(_0x591e98){_0x434f19(_0x591e98);}else{_0x15bdd8();}});}else{_0x434f19(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x434f19(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xc51f('0x7')]=function(_0x1ee56e,_0x264045,_0xf088c3,_0x5cf0da,_0x2eac2e,_0x2db3d9,_0x48ca7e){var _0x4a6c4e=new AWS['Polly']({'accessKeyId':_0x1ee56e,'secretAccessKey':_0x264045,'region':_0xf088c3});var _0x31542e={'Text':_0x2eac2e,'TextType':_0x2db3d9||_0xc51f('0x8'),'OutputFormat':_0xc51f('0x9'),'VoiceId':_0x5cf0da};return pollyResult(_0x4a6c4e,_0x31542e,_0x48ca7e);}; \ No newline at end of file +var _0x829e=['writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x829e,0x7e));var _0xe829=function(_0x47278b,_0x29b226){_0x47278b=_0x47278b-0x0;var _0x40352e=_0x829e[_0x47278b];return _0x40352e;};'use strict';var fs=require('fs');var path=require(_0xe829('0x0'));var BPromise=require(_0xe829('0x1'));var rs=require(_0xe829('0x2'));var AWS=require(_0xe829('0x3'));function pollyResult(_0x10f976,_0x567d12,_0x82238){return new BPromise(function(_0x445e91,_0x35bd70){_0x10f976[_0xe829('0x4')](_0x567d12,function(_0x49ed26,_0x33ab0f){if(_0x49ed26){_0x35bd70(_0x49ed26);}else if(_0x33ab0f){if(_0x33ab0f[_0xe829('0x5')]instanceof Buffer){fs[_0xe829('0x6')](_0x82238,_0x33ab0f[_0xe829('0x5')],function(_0x5e5f4a){if(_0x5e5f4a){_0x35bd70(_0x5e5f4a);}else{_0x445e91();}});}else{_0x35bd70(new Error(_0xe829('0x7')));}}else{_0x35bd70(new Error(_0xe829('0x8')));}});});}module['exports']=function(_0x4ce348,_0x3d390f,_0x3ceb6f,_0x58016d,_0x477215,_0x243a4f,_0x391bb8){var _0x8a8239=new AWS['Polly']({'accessKeyId':_0x4ce348,'secretAccessKey':_0x3d390f,'region':_0x3ceb6f});var _0x415470={'Text':_0x477215,'TextType':_0x243a4f||_0xe829('0x9'),'OutputFormat':_0xe829('0xa'),'VoiceId':_0x58016d};return pollyResult(_0x8a8239,_0x415470,_0x391bb8);}; \ 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 2fac2c2..fb3ab04 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 _0xfb3c=['exports'];(function(_0x12bb2d,_0x21e710){var _0x502235=function(_0xce4b0){while(--_0xce4b0){_0x12bb2d['push'](_0x12bb2d['shift']());}};_0x502235(++_0x21e710);}(_0xfb3c,0x1a3));var _0xcfb3=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xfb3c[_0x413feb];return _0x40ee88;};'use strict';var asr=require('./lib/api');module[_0xcfb3('0x0')]=function(_0x44bf17,_0x1d49d6,_0x4be7dc,_0x343387){return asr(_0x44bf17,_0x1d49d6,_0x4be7dc);}; \ No newline at end of file +var _0xe451=['exports'];(function(_0x327ebe,_0x411ec0){var _0x477959=function(_0x33266a){while(--_0x33266a){_0x327ebe['push'](_0x327ebe['shift']());}};_0x477959(++_0x411ec0);}(_0xe451,0x94));var _0x1e45=function(_0x18691a,_0x21a2e3){_0x18691a=_0x18691a-0x0;var _0x84d82b=_0xe451[_0x18691a];return _0x84d82b;};'use strict';var asr=require('./lib/api');module[_0x1e45('0x0')]=function(_0x43555f,_0x35c006,_0x30ac59,_0x213cba){return asr(_0x43555f,_0x35c006,_0x30ac59);}; \ 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 6b74d6b..a864384 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 _0xd51f=['url','bluebird','exports','string','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key='];(function(_0x50b4ed,_0x2d9ced){var _0x2573d6=function(_0x22a18d){while(--_0x22a18d){_0x50b4ed['push'](_0x50b4ed['shift']());}};_0x2573d6(++_0x2d9ced);}(_0xd51f,0xf0));var _0xfd51=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd51f[_0x46698a];return _0x356db0;};'use strict';var url=require(_0xfd51('0x0'));var BPromise=require(_0xfd51('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xfd51('0x2')]=function(_0x2745b5,_0x583496,_0x1fa890){return new BPromise(function(_0x1d01a0,_0x49bb3e){var _0x3efc9b;if(typeof _0x2745b5!==_0xfd51('0x3')||_0x2745b5['length']===0x0){return _0x49bb3e(_0xfd51('0x4'));}if(typeof _0x583496!==_0xfd51('0x3')||_0x583496['length']===0x0){return _0x49bb3e(_0xfd51('0x5'));}if(typeof _0x1fa890!==_0xfd51('0x6')&&(typeof _0x1fa890!==_0xfd51('0x3')||_0x1fa890[_0xfd51('0x7')]===0x0)){return _0x49bb3e(_0xfd51('0x8'));}try{_0x3efc9b=fs['readFileSync'](_0x2745b5)[_0xfd51('0x9')](_0xfd51('0xa'));}catch(_0x2878c6){return _0x49bb3e(_0x2878c6);}return _0x1d01a0({'method':'POST','uri':host+_0xfd51('0xb')+_0x583496,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x1fa890},'audio':{'content':_0x3efc9b}},'json':!![]});});}; \ No newline at end of file +var _0x2f68=['exports','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','/v1/speech:recognize?key=','LINEAR16','8000','bluebird','https://speech.googleapis.com'];(function(_0x3eb630,_0x552586){var _0x1b840d=function(_0x2594a8){while(--_0x2594a8){_0x3eb630['push'](_0x3eb630['shift']());}};_0x1b840d(++_0x552586);}(_0x2f68,0x9a));var _0x82f6=function(_0x4745f1,_0x211f8f){_0x4745f1=_0x4745f1-0x0;var _0x246d68=_0x2f68[_0x4745f1];return _0x246d68;};'use strict';var url=require('url');var BPromise=require(_0x82f6('0x0'));var fs=require('fs');var host=_0x82f6('0x1');module[_0x82f6('0x2')]=function(_0x3a9c8f,_0x4be334,_0x43dc65){return new BPromise(function(_0x488d61,_0x2a06dc){var _0x2ab73d;if(typeof _0x3a9c8f!=='string'||_0x3a9c8f[_0x82f6('0x3')]===0x0){return _0x2a06dc(_0x82f6('0x4'));}if(typeof _0x4be334!=='string'||_0x4be334['length']===0x0){return _0x2a06dc(_0x82f6('0x5'));}if(typeof _0x43dc65!=='undefined'&&(typeof _0x43dc65!=='string'||_0x43dc65[_0x82f6('0x3')]===0x0)){return _0x2a06dc(_0x82f6('0x6'));}try{_0x2ab73d=fs[_0x82f6('0x7')](_0x3a9c8f)['toString'](_0x82f6('0x8'));}catch(_0x432289){return _0x2a06dc(_0x432289);}return _0x488d61({'method':'POST','uri':host+_0x82f6('0x9')+_0x4be334,'body':{'config':{'encoding':_0x82f6('0xa'),'sampleRateHertz':_0x82f6('0xb'),'languageCode':_0x43dc65},'audio':{'content':_0x2ab73d}},'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 74ad3f0..cad5391 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 _0x1183=['./asr','exports'];(function(_0x1d29fa,_0x2baab0){var _0x403a8d=function(_0x37af45){while(--_0x37af45){_0x1d29fa['push'](_0x1d29fa['shift']());}};_0x403a8d(++_0x2baab0);}(_0x1183,0x108));var _0x3118=function(_0x1557c3,_0x5e6999){_0x1557c3=_0x1557c3-0x0;var _0x4227cb=_0x1183[_0x1557c3];return _0x4227cb;};var asr=require(_0x3118('0x0'));module[_0x3118('0x1')]={'asr':asr}; \ No newline at end of file +var _0x3fcd=['./asr'];(function(_0x128540,_0x581384){var _0x1448f0=function(_0x4a77f1){while(--_0x4a77f1){_0x128540['push'](_0x128540['shift']());}};_0x1448f0(++_0x581384);}(_0x3fcd,0x79));var _0xd3fc=function(_0x30c42e,_0x2c39f5){_0x30c42e=_0x30c42e-0x0;var _0x1c49f1=_0x3fcd[_0x30c42e];return _0x1c49f1;};var asr=require(_0xd3fc('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/scripts/index.js b/server/services/agi/scripts/index.js index cf17951..c37016a 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 _0xd9b6=['\x22\x20might\x20not\x20exist','goggleTTS\x20path','googleASR','asr','uri','results','map','alternatives','transcript','confidence','join','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','result','resolvedQuery','action','fulfillment','speech','score','status','code','endConversation','isFallbackIntent','replace','SessionsClient','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','boolValue','intent','displayName','isFallback','queryText','responseId','intentDetectionConfidence','fulfillmentText','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','freeform=3','nda','channelData','CustomActionData','AudioFromTts','Data','.wav','audiofile','apiai-promise','dialogflow','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','data','end','transcode','wav','error\x20convert','finish\x20to\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','split','?key=','ssml','input','MP3','text:synthesize','POST','.mp3','from','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','application/x-www-form-urlencoded','stringify','jQ1olc','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22'];(function(_0x508376,_0x3aac03){var _0x1508d2=function(_0xb867fd){while(--_0xb867fd){_0x508376['push'](_0x508376['shift']());}};_0x1508d2(++_0x3aac03);}(_0xd9b6,0x1c6));var _0x6d9b=function(_0x549996,_0xd04634){_0x549996=_0x549996-0x0;var _0x4de5d1=_0xd9b6[_0x549996];return _0x4de5d1;};'use strict';var apiai=require(_0x6d9b('0x0'));var BPromise=require('bluebird');var dialogflow=require(_0x6d9b('0x1'));var fs=require('fs');var http=require('http');var https=require('https');var md5=require(_0x6d9b('0x2'));var path=require(_0x6d9b('0x3'));var querystring=require(_0x6d9b('0x4'));var rp=require(_0x6d9b('0x5'));var rs=require(_0x6d9b('0x6'));var sox=require(_0x6d9b('0x7'));var tts=require(_0x6d9b('0x8'));var urlParse=require(_0x6d9b('0x9'))[_0x6d9b('0xa')];var util=require(_0x6d9b('0xb'));var aws=require(_0x6d9b('0xc'));var google=require(_0x6d9b('0xd'));var sestek=require(_0x6d9b('0xe'));var tilde=require(_0x6d9b('0xf'));var logger=require(_0x6d9b('0x10'))(_0x6d9b('0x11'));var ISPEECH_API=_0x6d9b('0x12');function downloadFile(_0x8577d,_0x2664c1){return new BPromise(function(_0x1bed0a,_0x18b34f){var _0x1919f9=urlParse(_0x8577d);var _0x561912=_0x1919f9[_0x6d9b('0x13')]===_0x6d9b('0x14')?https:http;var _0x4429d0={'host':_0x1919f9[_0x6d9b('0x15')],'path':_0x1919f9[_0x6d9b('0x3')],'headers':{'user-agent':_0x6d9b('0x16')}};_0x561912[_0x6d9b('0x17')](_0x4429d0,function(_0x31a171){if(_0x31a171[_0x6d9b('0x18')]!==0xc8){logger[_0x6d9b('0x19')](_0x6d9b('0x1a')+_0x8577d+_0x6d9b('0x1b')+_0x31a171['statusCode']+'\x20('+_0x31a171[_0x6d9b('0x1c')]+')');_0x18b34f(new Error('request\x20to\x20'+_0x8577d+_0x6d9b('0x1b')+_0x31a171[_0x6d9b('0x18')]+'\x20('+_0x31a171[_0x6d9b('0x1c')]+')'));return;}var _0x397710=fs[_0x6d9b('0x1d')](_0x2664c1);_0x397710['on'](_0x6d9b('0x1e'),function(){logger[_0x6d9b('0x1f')](_0x6d9b('0x20'));_0x397710[_0x6d9b('0x21')](_0x1bed0a);});_0x397710['on'](_0x6d9b('0x19'),function(_0x40bcbf){fs[_0x6d9b('0x22')](_0x2664c1);logger['error'](_0x6d9b('0x23'),_0x40bcbf);_0x18b34f(_0x40bcbf);});_0x31a171[_0x6d9b('0x24')](_0x397710);})['on'](_0x6d9b('0x19'),function(_0x731f6e){logger[_0x6d9b('0x19')](_0x731f6e);_0x18b34f(_0x731f6e);})['end']();});}function uploadFile(_0x2ec210){return new BPromise(function(_0x56ad9b,_0x2c92ae){var _0x74efdd=urlParse(_0x2ec210);var _0x3a3156=_0x74efdd[_0x6d9b('0x13')]==='https:'?https:http;var _0x6ddfeb={'host':_0x74efdd[_0x6d9b('0x15')],'path':_0x74efdd[_0x6d9b('0x3')],'headers':{'user-agent':'WHAT_EVER'}};_0x3a3156[_0x6d9b('0x17')](_0x6ddfeb,function(_0x4f7aec){if(_0x4f7aec[_0x6d9b('0x18')]!==0xc8){_0x2c92ae(new Error(_0x6d9b('0x1a')+_0x2ec210+'\x20failed,\x20status\x20code\x20=\x20'+_0x4f7aec['statusCode']+'\x20('+_0x4f7aec[_0x6d9b('0x1c')]+')'));return;}var _0xe1b9de='';_0x4f7aec['on'](_0x6d9b('0x25'),function(_0x145e68){_0xe1b9de+=_0x145e68;});_0x4f7aec['on'](_0x6d9b('0x26'),function(){_0x56ad9b(_0xe1b9de);});})['on'](_0x6d9b('0x19'),function(_0x51fa06){_0x2c92ae(_0x51fa06);})['end']();});}function convertFile(_0x377ab1,_0x4477cd){return new BPromise(function(_0x57e3ca,_0xd4ef2){var _0xf1751e=sox[_0x6d9b('0x27')](_0x377ab1,_0x4477cd,{'sampleRate':0x1f40,'format':_0x6d9b('0x28'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0xf1751e['on'](_0x6d9b('0x19'),function(_0x27b073){logger[_0x6d9b('0x19')](_0x6d9b('0x29'),_0x27b073);_0xd4ef2(_0x27b073);});_0xf1751e['on'](_0x6d9b('0x26'),function(){logger[_0x6d9b('0x1f')](_0x6d9b('0x2a'));_0x57e3ca();});_0xf1751e[_0x6d9b('0x2b')]();});}function base64Decode(_0x529ae5,_0x494688){var _0x436402=path[_0x6d9b('0x2c')](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+'.wav');fs[_0x6d9b('0x2f')](_0x436402,_0x529ae5,_0x6d9b('0x30'));return convertFile(_0x436402,_0x494688)[_0x6d9b('0x31')](function(){try{fs[_0x6d9b('0x22')](_0x436402);fs[_0x6d9b('0x32')](_0x494688,'777');}catch(_0x5430ab){logger[_0x6d9b('0x19')](_0x5430ab);}return _0x494688[_0x6d9b('0x33')]('.')[0x0];});}function base64Encode(_0x4dd81f){var _0x3856e8=fs['readFileSync'](_0x4dd81f);return new Buffer(_0x3856e8)['toString']('base64');}exports['googleCloudTTS']=function(_0x2a662e,_0x1addbc,_0x13b8b8,_0x1fdf34,_0x15a5f8,_0x27c185){var _0x106e8c,_0x46160b;var _0x308322='https://texttospeech.googleapis.com/v1/';var _0x194cc1=_0x6d9b('0x34')+_0x2a662e;var _0x253e9e={};if(_0x1addbc===_0x6d9b('0x35')){_0x253e9e['input']={'ssml':_0x13b8b8};}else{_0x253e9e[_0x6d9b('0x36')]={'text':_0x13b8b8};};_0x253e9e['voice']={'languageCode':_0x1fdf34,'ssmlGender':_0x15a5f8};_0x253e9e['audioConfig']={'audioEncoding':_0x6d9b('0x37'),'sampleRateHertz':0x1f40};var _0xd0d26b={'url':_0x308322+_0x6d9b('0x38')+_0x194cc1,'method':_0x6d9b('0x39'),'json':!![],'body':_0x253e9e};return rp(_0xd0d26b)[_0x6d9b('0x31')](function(_0x426b06){return new BPromise(function(_0x4ad30e,_0x5bf455){_0x106e8c=path[_0x6d9b('0x2c')](__dirname,_0x6d9b('0x2d'),rs['generate'](0x4)+_0x6d9b('0x3a'));var _0x5b5984=Buffer[_0x6d9b('0x3b')](_0x426b06[_0x6d9b('0x3c')],_0x6d9b('0x30'));return fs[_0x6d9b('0x3d')](_0x106e8c,_0x5b5984,function(_0xbd3e73){_0x5bf455(_0xbd3e73);},function(_0x415986){fs[_0x6d9b('0x32')](_0x106e8c,'777');_0x4ad30e(_0x415986);});});})[_0x6d9b('0x31')](function(_0x470341){_0x46160b=path['resolve'](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+'.wav');return convertFile(_0x106e8c,_0x46160b);})[_0x6d9b('0x31')](function(){try{fs[_0x6d9b('0x22')](_0x106e8c);fs[_0x6d9b('0x32')](_0x46160b,_0x6d9b('0x3e'));}catch(_0x5635a0){logger[_0x6d9b('0x19')](_0x5635a0);}logger[_0x6d9b('0x1f')](_0x6d9b('0x3f'),_0x46160b['split']('.')[0x0]);return _0x46160b[_0x6d9b('0x33')]('.')[0x0];});};exports[_0x6d9b('0x40')]=function(_0x5be5ef,_0x2f078d){var _0x5206a2=_0x6d9b('0x41');var _0x3b2525,_0xa06672;var _0x267d48;var _0xccb092={'encoding':'utf8','method':_0x6d9b('0x39'),'timeout':0x2710,'url':_0x5206a2,'headers':{'Content-Type':_0x6d9b('0x42')},'body':'f.req='+encodeURIComponent(JSON[_0x6d9b('0x43')]([[[_0x6d9b('0x44'),JSON[_0x6d9b('0x43')]([_0x5be5ef,_0x2f078d||'en',![],'null']),null,'generic']]]))};return rp(_0xccb092)[_0x6d9b('0x31')](function(_0x39f10d){try{_0x267d48=eval(_0x39f10d[_0x6d9b('0x45')](0x5))[0x0][0x2];}catch(_0x4e4b7b){throw new Error(_0x6d9b('0x46')+_0x39f10d[_0x6d9b('0x25')]);}if(!_0x267d48){if(_0x5be5ef[_0x6d9b('0x47')]>0xc8){throw new Error(_0x6d9b('0x48'));}else{throw new Error(_0x6d9b('0x49')+_0x2f078d+_0x6d9b('0x4a'));}}try{_0x267d48=eval(_0x267d48)[0x0];}catch(_0x2aedf2){throw new Error(_0x6d9b('0x46')+res[_0x6d9b('0x25')]);}const _0x4992fd=_0x267d48;_0x3b2525=path[_0x6d9b('0x2c')](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+_0x6d9b('0x3a'));fs[_0x6d9b('0x2f')](_0x3b2525,_0x267d48,{'encoding':'base64'});_0xa06672=path[_0x6d9b('0x2c')](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+'.wav');return convertFile(_0x3b2525,_0xa06672);})[_0x6d9b('0x31')](function(){try{fs[_0x6d9b('0x22')](_0x3b2525);fs[_0x6d9b('0x32')](_0xa06672,_0x6d9b('0x3e'));}catch(_0x1c6b4b){logger[_0x6d9b('0x19')](_0x1c6b4b);}logger[_0x6d9b('0x1f')](_0x6d9b('0x4b'),_0xa06672[_0x6d9b('0x33')]('.')[0x0]);return _0xa06672[_0x6d9b('0x33')]('.')[0x0];});};exports[_0x6d9b('0x4c')]=function(_0x363f6b,_0x31e091,_0x3c149e){return google[_0x6d9b('0x4d')](_0x363f6b,_0x31e091,_0x3c149e)[_0x6d9b('0x31')](function(_0x11c97d){logger[_0x6d9b('0x1f')](_0x11c97d[_0x6d9b('0x4e')]);return rp(_0x11c97d);})[_0x6d9b('0x31')](function(_0x2b23bc){var _0x3dd003='';var _0x53bc63=0x0;try{fs[_0x6d9b('0x22')](_0x363f6b);}catch(_0x2368fc){logger['error'](_0x2368fc);}if(_0x2b23bc&&_0x2b23bc[_0x6d9b('0x4f')]){_0x3dd003=_0x2b23bc[_0x6d9b('0x4f')][_0x6d9b('0x50')](function(_0x23119f){return _0x23119f&&_0x23119f['alternatives'][0x0]&&_0x23119f[_0x6d9b('0x51')][0x0][_0x6d9b('0x52')]?_0x23119f[_0x6d9b('0x51')][0x0][_0x6d9b('0x52')]:'';})['join']('\x0a');_0x53bc63=_0x2b23bc[_0x6d9b('0x4f')][_0x6d9b('0x50')](function(_0x3ff8f8){return _0x3ff8f8&&_0x3ff8f8[_0x6d9b('0x51')][0x0]&&_0x3ff8f8[_0x6d9b('0x51')][0x0][_0x6d9b('0x53')]?_0x3ff8f8[_0x6d9b('0x51')][0x0][_0x6d9b('0x53')]:0x0;})[_0x6d9b('0x54')]('\x0a');}logger[_0x6d9b('0x1f')]('googleASR\x20transcription',_0x3dd003);logger[_0x6d9b('0x1f')](_0x6d9b('0x55'),_0x53bc63);return{'transcript':_0x3dd003,'confidence':_0x53bc63};})[_0x6d9b('0x56')](function(_0x33e021){logger[_0x6d9b('0x19')](_0x6d9b('0x57'),_0x33e021['statusCode'],_0x33e021[_0x6d9b('0x58')],_0x33e021[_0x6d9b('0x59')]);});};exports['googleDialogflow']=function(_0x4969a1,_0x20b725,_0x2045dc,_0xf7f0b2){var _0x5df419=apiai(_0x20b725,{'language':_0xf7f0b2||'en'});return _0x5df419['textRequest'](_0x2045dc,{'sessionId':md5(_0x4969a1)})['then'](function(_0x4bc912){logger[_0x6d9b('0x1f')](JSON[_0x6d9b('0x43')](_0x4bc912));return{'source':_0x4bc912[_0x6d9b('0x5a')]['source'],'resolvedQuery':_0x4bc912[_0x6d9b('0x5a')][_0x6d9b('0x5b')],'action':_0x4bc912[_0x6d9b('0x5a')][_0x6d9b('0x5c')],'actionIncomplete':_0x4bc912[_0x6d9b('0x5a')]['actionIncomplete'],'speech':_0x4bc912['result'][_0x6d9b('0x5d')][_0x6d9b('0x5e')],'score':_0x4bc912[_0x6d9b('0x5a')][_0x6d9b('0x5f')],'statusCode':_0x4bc912[_0x6d9b('0x60')][_0x6d9b('0x61')],'endConversation':_0x4bc912[_0x6d9b('0x5a')]['metadata'][_0x6d9b('0x62')]||![],'isFallbackIntent':_0x4bc912[_0x6d9b('0x5a')]['metadata'][_0x6d9b('0x63')]};});};exports['googleDialogflowV2']=function(_0x24ca8d,_0x140db3,_0x59de89,_0x110954,_0x205fda,_0x12b063){var _0xb5228e=_0x110954[_0x6d9b('0x64')](/\\n/g,'\x0a');var _0x173535={'credentials':{'private_key':_0xb5228e,'client_email':_0x59de89}};var _0x35c868=new dialogflow[(_0x6d9b('0x65'))](_0x173535);var _0x53f73b=_0x35c868['sessionPath'](_0x140db3,md5(_0x24ca8d));var _0x38bdca={'session':_0x53f73b,'queryInput':{'text':{'text':_0x205fda,'languageCode':_0x12b063}}};return _0x35c868[_0x6d9b('0x66')](_0x38bdca)['then'](function(_0x2b4487){if(_0x2b4487&&_0x2b4487['length']){logger['info'](_0x6d9b('0x67'),JSON[_0x6d9b('0x43')](_0x2b4487));var _0xa2ecff=_0x2b4487[0x0];if(_0xa2ecff){var _0x17b946={'action':_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x5c')],'allRequiredParamsPresent':_0xa2ecff[_0x6d9b('0x68')]['allRequiredParamsPresent'],'endConversation':_0xa2ecff['queryResult'][_0x6d9b('0x69')]&&_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x69')][_0x6d9b('0x6a')]?_0xa2ecff['queryResult'][_0x6d9b('0x69')]['fields']['end_conversation'][_0x6d9b('0x6b')]:![],'fulfillmentText':_0xa2ecff[_0x6d9b('0x68')]['fulfillmentText'],'intentName':_0xa2ecff[_0x6d9b('0x68')]['intent']['name'],'intentDisplayName':_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x6c')][_0x6d9b('0x6d')],'isFallbackIntent':_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x6c')][_0x6d9b('0x6e')],'languageCode':_0xa2ecff[_0x6d9b('0x68')]['languageCode'],'queryText':_0xa2ecff['queryResult'][_0x6d9b('0x6f')],'responseId':_0xa2ecff[_0x6d9b('0x70')],'score':_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x71')],'speech':_0xa2ecff[_0x6d9b('0x68')][_0x6d9b('0x72')],'providerResponse':JSON['stringify'](_0x2b4487)};return _0x17b946;}}});};exports[_0x6d9b('0x73')]=function(_0x233c30,_0xe37da7,_0x454a11,_0x115057){return tilde[_0x6d9b('0x4d')](_0x233c30,_0xe37da7,_0x454a11,_0x115057)[_0x6d9b('0x31')](function(_0x1e069f){try{fs[_0x6d9b('0x22')](_0x233c30);}catch(_0xdc6364){logger[_0x6d9b('0x19')](_0xdc6364);}logger[_0x6d9b('0x1f')](_0x6d9b('0x74'),_0x1e069f[_0x6d9b('0x52')]);logger[_0x6d9b('0x1f')]('Tilde\x20ASR\x20confidence',_0x1e069f[_0x6d9b('0x53')]);return _0x1e069f;});};exports[_0x6d9b('0x75')]=function(_0x202320,_0x1e92fc,_0x64084c,_0x51d1d9,_0xb348bd,_0xf5e604){var _0x23d37b=path[_0x6d9b('0x2c')](__dirname,'tmp',rs[_0x6d9b('0x2e')](0x4)+_0x6d9b('0x3a'));var _0x37904a;return aws['polly'](_0x202320,_0x1e92fc,_0x64084c,_0x51d1d9,_0xb348bd,_0xf5e604,_0x23d37b)[_0x6d9b('0x31')](function(){_0x37904a=path[_0x6d9b('0x2c')](__dirname,'tmp',rs['generate'](0x4)+'.wav');return convertFile(_0x23d37b,_0x37904a);})[_0x6d9b('0x31')](function(){try{fs['unlink'](_0x23d37b);fs[_0x6d9b('0x32')](_0x37904a,_0x6d9b('0x3e'));}catch(_0x1b9044){logger[_0x6d9b('0x19')](_0x1b9044);}return _0x37904a[_0x6d9b('0x33')]('.')[0x0];});};exports[_0x6d9b('0x76')]=function(_0x39be4a,_0x3854b5,_0x315f15,_0x167ce7,_0x239c15,_0x52ba98){return aws[_0x6d9b('0x77')](_0x39be4a,_0x3854b5,_0x315f15,_0x167ce7,_0x239c15,_0x52ba98)[_0x6d9b('0x31')](function(_0x1392da){logger[_0x6d9b('0x1f')](JSON[_0x6d9b('0x43')](_0x1392da));return _0x1392da;});};exports[_0x6d9b('0x78')]=function(_0xf3bbbe,_0x5acb41,_0x58962c,_0x5e669a){var _0x17ef79=util[_0x6d9b('0x79')](_0x6d9b('0x7a'),ISPEECH_API,_0xf3bbbe,encodeURIComponent(_0x5acb41),_0x58962c,_0x5e669a);var _0x1271b6=path['resolve'](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+_0x6d9b('0x3a'));var _0x51816f;return downloadFile(_0x17ef79,_0x1271b6)['then'](function(){_0x51816f=path[_0x6d9b('0x2c')](__dirname,'tmp',rs[_0x6d9b('0x2e')](0x4)+'.wav');return convertFile(_0x1271b6,_0x51816f);})[_0x6d9b('0x31')](function(){try{fs[_0x6d9b('0x22')](_0x1271b6);fs[_0x6d9b('0x32')](_0x51816f,'777');}catch(_0x397700){logger[_0x6d9b('0x19')](_0x397700);}return _0x51816f[_0x6d9b('0x33')]('.')[0x0];});};exports['ispeechASR']=function(_0x596838,_0x3d0067,_0x458d80,_0x43b8a3){var _0x434000=util[_0x6d9b('0x79')](_0x6d9b('0x7b'),ISPEECH_API,_0x3d0067,_0x458d80,base64Encode(_0x596838),_0x43b8a3?util[_0x6d9b('0x79')]('model=%s',encodeURIComponent(_0x43b8a3)):_0x6d9b('0x7c'));return uploadFile(_0x434000)[_0x6d9b('0x31')](function(_0x2f2e53){return querystring['parse'](_0x2f2e53);});};exports['sestekNDA']=function(_0x1117ff,_0x442ee2){return sestek[_0x6d9b('0x7d')](_0x1117ff,_0x442ee2)[_0x6d9b('0x31')](function(_0x1e09f8){logger[_0x6d9b('0x1f')](JSON['stringify'](_0x1e09f8));var _0x1aa021={'speech':_0x1e09f8['text'],'action':_0x1e09f8[_0x6d9b('0x7e')]?_0x1e09f8[_0x6d9b('0x7e')]['CustomAction']:undefined,'actiondata':_0x1e09f8[_0x6d9b('0x7e')]?_0x1e09f8[_0x6d9b('0x7e')][_0x6d9b('0x7f')]:undefined};if(_0x1e09f8[_0x6d9b('0x7e')]&&_0x1e09f8[_0x6d9b('0x7e')]['AudioFromTts']){return base64Decode(_0x1e09f8['channelData'][_0x6d9b('0x80')][_0x6d9b('0x81')],path[_0x6d9b('0x2c')](__dirname,_0x6d9b('0x2d'),rs[_0x6d9b('0x2e')](0x4)+_0x6d9b('0x82')))['then'](function(_0x25b7cd){_0x1aa021[_0x6d9b('0x83')]=_0x25b7cd;return _0x1aa021;});}return _0x1aa021;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x64b8=['format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','parse','sestekNDA','channelData','CustomAction','AudioFromTts','audiofile','apiai-promise','bluebird','http','https','md5','path','querystring','request-promise','randomstring','sox','google-tts-api','url','util','./aws','./google','./sestek','./tilde','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','finish','info','close','unlink','pipe','end','protocol','data','transcode','wav','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','text:synthesize','POST','audioContent','writeFile','777','googleCloudTTS\x20path','googleTTS','application/x-www-form-urlencoded','f.req=','stringify','jQ1olc','generic','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','\x22\x20might\x20not\x20exist','.mp3','googleASR','asr','results','map','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','googleDialogflow','result','source','resolvedQuery','action','actionIncomplete','speech','score','status','code','metadata','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','displayName','intent','isFallback','languageCode','queryText','responseId','intentDetectionConfidence','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex'];(function(_0x25ce01,_0x285400){var _0x49e7f5=function(_0x5cac33){while(--_0x5cac33){_0x25ce01['push'](_0x25ce01['shift']());}};_0x49e7f5(++_0x285400);}(_0x64b8,0x113));var _0x864b=function(_0x7d9290,_0x2b8099){_0x7d9290=_0x7d9290-0x0;var _0x14e800=_0x64b8[_0x7d9290];return _0x14e800;};'use strict';var apiai=require(_0x864b('0x0'));var BPromise=require(_0x864b('0x1'));var dialogflow=require('dialogflow');var fs=require('fs');var http=require(_0x864b('0x2'));var https=require(_0x864b('0x3'));var md5=require(_0x864b('0x4'));var path=require(_0x864b('0x5'));var querystring=require(_0x864b('0x6'));var rp=require(_0x864b('0x7'));var rs=require(_0x864b('0x8'));var sox=require(_0x864b('0x9'));var tts=require(_0x864b('0xa'));var urlParse=require(_0x864b('0xb'))['parse'];var util=require(_0x864b('0xc'));var aws=require(_0x864b('0xd'));var google=require(_0x864b('0xe'));var sestek=require(_0x864b('0xf'));var tilde=require(_0x864b('0x10'));var logger=require('../../../config/logger')('agi');var ISPEECH_API=_0x864b('0x11');function downloadFile(_0x5ae600,_0x15104d){return new BPromise(function(_0xc9a705,_0x4d74a7){var _0x549037=urlParse(_0x5ae600);var _0x23e395=_0x549037['protocol']===_0x864b('0x12')?https:http;var _0xab3325={'host':_0x549037[_0x864b('0x13')],'path':_0x549037[_0x864b('0x5')],'headers':{'user-agent':_0x864b('0x14')}};_0x23e395[_0x864b('0x15')](_0xab3325,function(_0x3424e4){if(_0x3424e4[_0x864b('0x16')]!==0xc8){logger[_0x864b('0x17')](_0x864b('0x18')+_0x5ae600+'\x20failed,\x20status\x20code\x20=\x20'+_0x3424e4['statusCode']+'\x20('+_0x3424e4[_0x864b('0x19')]+')');_0x4d74a7(new Error(_0x864b('0x18')+_0x5ae600+_0x864b('0x1a')+_0x3424e4['statusCode']+'\x20('+_0x3424e4[_0x864b('0x19')]+')'));return;}var _0x26971f=fs['createWriteStream'](_0x15104d);_0x26971f['on'](_0x864b('0x1b'),function(){logger[_0x864b('0x1c')]('finish\x20download\x20file');_0x26971f[_0x864b('0x1d')](_0xc9a705);});_0x26971f['on'](_0x864b('0x17'),function(_0x1a108e){fs[_0x864b('0x1e')](_0x15104d);logger[_0x864b('0x17')]('download\x20error',_0x1a108e);_0x4d74a7(_0x1a108e);});_0x3424e4[_0x864b('0x1f')](_0x26971f);})['on'](_0x864b('0x17'),function(_0x4673cc){logger[_0x864b('0x17')](_0x4673cc);_0x4d74a7(_0x4673cc);})[_0x864b('0x20')]();});}function uploadFile(_0x559ae0){return new BPromise(function(_0x2655ab,_0x1de58e){var _0x658eb7=urlParse(_0x559ae0);var _0x5363da=_0x658eb7[_0x864b('0x21')]==='https:'?https:http;var _0x189c65={'host':_0x658eb7['host'],'path':_0x658eb7[_0x864b('0x5')],'headers':{'user-agent':_0x864b('0x14')}};_0x5363da[_0x864b('0x15')](_0x189c65,function(_0x48b25c){if(_0x48b25c[_0x864b('0x16')]!==0xc8){_0x1de58e(new Error('request\x20to\x20'+_0x559ae0+_0x864b('0x1a')+_0x48b25c[_0x864b('0x16')]+'\x20('+_0x48b25c['statusMessage']+')'));return;}var _0x8a2b00='';_0x48b25c['on'](_0x864b('0x22'),function(_0x22d8d9){_0x8a2b00+=_0x22d8d9;});_0x48b25c['on'](_0x864b('0x20'),function(){_0x2655ab(_0x8a2b00);});})['on'](_0x864b('0x17'),function(_0x151f57){_0x1de58e(_0x151f57);})[_0x864b('0x20')]();});}function convertFile(_0x15dd09,_0x19b3d9){return new BPromise(function(_0x2b3d54,_0x48bb9b){var _0x1d1a14=sox[_0x864b('0x23')](_0x15dd09,_0x19b3d9,{'sampleRate':0x1f40,'format':_0x864b('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1d1a14['on'](_0x864b('0x17'),function(_0x363282){logger['error']('error\x20convert',_0x363282);_0x48bb9b(_0x363282);});_0x1d1a14['on'](_0x864b('0x20'),function(){logger[_0x864b('0x1c')](_0x864b('0x25'));_0x2b3d54();});_0x1d1a14[_0x864b('0x26')]();});}function base64Decode(_0x5e07c6,_0x2a4c50){var _0x18239b=path[_0x864b('0x27')](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+_0x864b('0x2a'));fs[_0x864b('0x2b')](_0x18239b,_0x5e07c6,_0x864b('0x2c'));return convertFile(_0x18239b,_0x2a4c50)[_0x864b('0x2d')](function(){try{fs[_0x864b('0x1e')](_0x18239b);fs[_0x864b('0x2e')](_0x2a4c50,'777');}catch(_0x5f1dfa){logger[_0x864b('0x17')](_0x5f1dfa);}return _0x2a4c50[_0x864b('0x2f')]('.')[0x0];});}function base64Encode(_0x11c8bf){var _0x744be5=fs[_0x864b('0x30')](_0x11c8bf);return new Buffer(_0x744be5)[_0x864b('0x31')]('base64');}exports[_0x864b('0x32')]=function(_0x2df41e,_0x453333,_0x5aabe2,_0x137d8e,_0x2e1a24,_0x2d5c09){var _0x26a5f1,_0x2d6de4;var _0x1efa63=_0x864b('0x33');var _0x5026bf='?key='+_0x2df41e;var _0x54c5bc={};if(_0x453333===_0x864b('0x34')){_0x54c5bc[_0x864b('0x35')]={'ssml':_0x5aabe2};}else{_0x54c5bc['input']={'text':_0x5aabe2};};_0x54c5bc['voice']={'languageCode':_0x137d8e,'ssmlGender':_0x2e1a24};_0x54c5bc['audioConfig']={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x48a489={'url':_0x1efa63+_0x864b('0x36')+_0x5026bf,'method':_0x864b('0x37'),'json':!![],'body':_0x54c5bc};return rp(_0x48a489)[_0x864b('0x2d')](function(_0x24ca5c){return new BPromise(function(_0x33e037,_0x383542){_0x26a5f1=path[_0x864b('0x27')](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+'.mp3');var _0x4e9951=Buffer['from'](_0x24ca5c[_0x864b('0x38')],_0x864b('0x2c'));return fs[_0x864b('0x39')](_0x26a5f1,_0x4e9951,function(_0xfe9510){_0x383542(_0xfe9510);},function(_0x2d7f62){fs[_0x864b('0x2e')](_0x26a5f1,_0x864b('0x3a'));_0x33e037(_0x2d7f62);});});})[_0x864b('0x2d')](function(_0x4422ad){_0x2d6de4=path[_0x864b('0x27')](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+_0x864b('0x2a'));return convertFile(_0x26a5f1,_0x2d6de4);})[_0x864b('0x2d')](function(){try{fs[_0x864b('0x1e')](_0x26a5f1);fs[_0x864b('0x2e')](_0x2d6de4,_0x864b('0x3a'));}catch(_0x37a017){logger[_0x864b('0x17')](_0x37a017);}logger['info'](_0x864b('0x3b'),_0x2d6de4[_0x864b('0x2f')]('.')[0x0]);return _0x2d6de4[_0x864b('0x2f')]('.')[0x0];});};exports[_0x864b('0x3c')]=function(_0x51784f,_0xbcb387){var _0x347eb9='https://translate.google.com/_/TranslateWebserverUi/data/batchexecute';var _0x55aa5a,_0x5860ad;var _0x5c8ef6;var _0x153f05={'encoding':'utf8','method':_0x864b('0x37'),'timeout':0x2710,'url':_0x347eb9,'headers':{'Content-Type':_0x864b('0x3d')},'body':_0x864b('0x3e')+encodeURIComponent(JSON[_0x864b('0x3f')]([[[_0x864b('0x40'),JSON[_0x864b('0x3f')]([_0x51784f,_0xbcb387||'en',![],'null']),null,_0x864b('0x41')]]]))};return rp(_0x153f05)[_0x864b('0x2d')](function(_0x45d741){try{_0x5c8ef6=eval(_0x45d741['slice'](0x5))[0x0][0x2];}catch(_0x26ee1a){throw new Error(_0x864b('0x42')+_0x45d741[_0x864b('0x22')]);}if(!_0x5c8ef6){if(_0x51784f[_0x864b('0x43')]>0xc8){throw new Error(_0x864b('0x44'));}else{throw new Error('lang\x20\x22'+_0xbcb387+_0x864b('0x45'));}}try{_0x5c8ef6=eval(_0x5c8ef6)[0x0];}catch(_0x30d623){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x864b('0x22')]);}const _0x417c34=_0x5c8ef6;_0x55aa5a=path[_0x864b('0x27')](__dirname,'tmp',rs[_0x864b('0x29')](0x4)+_0x864b('0x46'));fs[_0x864b('0x2b')](_0x55aa5a,_0x5c8ef6,{'encoding':_0x864b('0x2c')});_0x5860ad=path['resolve'](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+_0x864b('0x2a'));return convertFile(_0x55aa5a,_0x5860ad);})[_0x864b('0x2d')](function(){try{fs[_0x864b('0x1e')](_0x55aa5a);fs[_0x864b('0x2e')](_0x5860ad,_0x864b('0x3a'));}catch(_0x492a7f){logger[_0x864b('0x17')](_0x492a7f);}logger[_0x864b('0x1c')]('goggleTTS\x20path',_0x5860ad['split']('.')[0x0]);return _0x5860ad[_0x864b('0x2f')]('.')[0x0];});};exports[_0x864b('0x47')]=function(_0x3a9cb3,_0x21eabe,_0x27fecc){return google[_0x864b('0x48')](_0x3a9cb3,_0x21eabe,_0x27fecc)[_0x864b('0x2d')](function(_0x3e69ab){logger['info'](_0x3e69ab['uri']);return rp(_0x3e69ab);})[_0x864b('0x2d')](function(_0x56d0d1){var _0x1750a0='';var _0x378c0b=0x0;try{fs[_0x864b('0x1e')](_0x3a9cb3);}catch(_0x3eaf0b){logger[_0x864b('0x17')](_0x3eaf0b);}if(_0x56d0d1&&_0x56d0d1[_0x864b('0x49')]){_0x1750a0=_0x56d0d1[_0x864b('0x49')][_0x864b('0x4a')](function(_0x4483ad){return _0x4483ad&&_0x4483ad[_0x864b('0x4b')][0x0]&&_0x4483ad[_0x864b('0x4b')][0x0][_0x864b('0x4c')]?_0x4483ad[_0x864b('0x4b')][0x0][_0x864b('0x4c')]:'';})[_0x864b('0x4d')]('\x0a');_0x378c0b=_0x56d0d1[_0x864b('0x49')]['map'](function(_0x5b6922){return _0x5b6922&&_0x5b6922['alternatives'][0x0]&&_0x5b6922[_0x864b('0x4b')][0x0][_0x864b('0x4e')]?_0x5b6922['alternatives'][0x0][_0x864b('0x4e')]:0x0;})[_0x864b('0x4d')]('\x0a');}logger['info'](_0x864b('0x4f'),_0x1750a0);logger['info'](_0x864b('0x50'),_0x378c0b);return{'transcript':_0x1750a0,'confidence':_0x378c0b};})[_0x864b('0x51')](function(_0xedcce5){logger[_0x864b('0x17')](_0x864b('0x52'),_0xedcce5['statusCode'],_0xedcce5[_0x864b('0x53')],_0xedcce5['message']);});};exports[_0x864b('0x54')]=function(_0x4685db,_0x4d04b6,_0x3e13cd,_0x40ec4c){var _0x4e2da8=apiai(_0x4d04b6,{'language':_0x40ec4c||'en'});return _0x4e2da8['textRequest'](_0x3e13cd,{'sessionId':md5(_0x4685db)})[_0x864b('0x2d')](function(_0x369fc5){logger[_0x864b('0x1c')](JSON[_0x864b('0x3f')](_0x369fc5));return{'source':_0x369fc5[_0x864b('0x55')][_0x864b('0x56')],'resolvedQuery':_0x369fc5[_0x864b('0x55')][_0x864b('0x57')],'action':_0x369fc5[_0x864b('0x55')][_0x864b('0x58')],'actionIncomplete':_0x369fc5[_0x864b('0x55')][_0x864b('0x59')],'speech':_0x369fc5[_0x864b('0x55')]['fulfillment'][_0x864b('0x5a')],'score':_0x369fc5['result'][_0x864b('0x5b')],'statusCode':_0x369fc5[_0x864b('0x5c')][_0x864b('0x5d')],'endConversation':_0x369fc5[_0x864b('0x55')][_0x864b('0x5e')]['endConversation']||![],'isFallbackIntent':_0x369fc5[_0x864b('0x55')][_0x864b('0x5e')]['isFallbackIntent']};});};exports[_0x864b('0x5f')]=function(_0x418706,_0x40991d,_0x596350,_0x43b464,_0x55332d,_0x1466f5){var _0x30c2dc=_0x43b464[_0x864b('0x60')](/\\n/g,'\x0a');var _0x539823={'credentials':{'private_key':_0x30c2dc,'client_email':_0x596350}};var _0x3ad51c=new dialogflow[(_0x864b('0x61'))](_0x539823);var _0x196bc1=_0x3ad51c[_0x864b('0x62')](_0x40991d,md5(_0x418706));var _0x30584f={'session':_0x196bc1,'queryInput':{'text':{'text':_0x55332d,'languageCode':_0x1466f5}}};return _0x3ad51c[_0x864b('0x63')](_0x30584f)['then'](function(_0x41952c){if(_0x41952c&&_0x41952c[_0x864b('0x43')]){logger['info'](_0x864b('0x64'),JSON['stringify'](_0x41952c));var _0x5785be=_0x41952c[0x0];if(_0x5785be){var _0x559ab9={'action':_0x5785be[_0x864b('0x65')]['action'],'allRequiredParamsPresent':_0x5785be[_0x864b('0x65')]['allRequiredParamsPresent'],'endConversation':_0x5785be[_0x864b('0x65')][_0x864b('0x66')]&&_0x5785be[_0x864b('0x65')]['diagnosticInfo'][_0x864b('0x67')]?_0x5785be[_0x864b('0x65')][_0x864b('0x66')][_0x864b('0x67')][_0x864b('0x68')][_0x864b('0x69')]:![],'fulfillmentText':_0x5785be[_0x864b('0x65')][_0x864b('0x6a')],'intentName':_0x5785be[_0x864b('0x65')]['intent'][_0x864b('0x53')],'intentDisplayName':_0x5785be['queryResult']['intent'][_0x864b('0x6b')],'isFallbackIntent':_0x5785be[_0x864b('0x65')][_0x864b('0x6c')][_0x864b('0x6d')],'languageCode':_0x5785be['queryResult'][_0x864b('0x6e')],'queryText':_0x5785be[_0x864b('0x65')][_0x864b('0x6f')],'responseId':_0x5785be[_0x864b('0x70')],'score':_0x5785be[_0x864b('0x65')][_0x864b('0x71')],'speech':_0x5785be['queryResult']['fulfillmentText'],'providerResponse':JSON[_0x864b('0x3f')](_0x41952c)};return _0x559ab9;}}});};exports[_0x864b('0x72')]=function(_0x1ac419,_0x3f6232,_0x2925eb,_0x40bb2a){return tilde[_0x864b('0x48')](_0x1ac419,_0x3f6232,_0x2925eb,_0x40bb2a)['then'](function(_0xc121f8){try{fs[_0x864b('0x1e')](_0x1ac419);}catch(_0x563686){logger[_0x864b('0x17')](_0x563686);}logger[_0x864b('0x1c')](_0x864b('0x73'),_0xc121f8[_0x864b('0x4c')]);logger[_0x864b('0x1c')](_0x864b('0x74'),_0xc121f8[_0x864b('0x4e')]);return _0xc121f8;});};exports[_0x864b('0x75')]=function(_0x50013e,_0x7c6ea6,_0x3b1a62,_0x493717,_0x431687,_0x5f20a4){var _0x2d9f8e=path[_0x864b('0x27')](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+_0x864b('0x46'));var _0x5c1181;return aws[_0x864b('0x76')](_0x50013e,_0x7c6ea6,_0x3b1a62,_0x493717,_0x431687,_0x5f20a4,_0x2d9f8e)[_0x864b('0x2d')](function(){_0x5c1181=path[_0x864b('0x27')](__dirname,'tmp',rs[_0x864b('0x29')](0x4)+_0x864b('0x2a'));return convertFile(_0x2d9f8e,_0x5c1181);})[_0x864b('0x2d')](function(){try{fs[_0x864b('0x1e')](_0x2d9f8e);fs['chmodSync'](_0x5c1181,_0x864b('0x3a'));}catch(_0x54d561){logger[_0x864b('0x17')](_0x54d561);}return _0x5c1181[_0x864b('0x2f')]('.')[0x0];});};exports[_0x864b('0x77')]=function(_0x177725,_0x251566,_0x312e81,_0x241b6c,_0x4c9e60,_0x3c2d38){return aws[_0x864b('0x78')](_0x177725,_0x251566,_0x312e81,_0x241b6c,_0x4c9e60,_0x3c2d38)[_0x864b('0x2d')](function(_0x3342fb){logger[_0x864b('0x1c')](JSON['stringify'](_0x3342fb));return _0x3342fb;});};exports['ispeechTTS']=function(_0x1a25d4,_0x4f7d54,_0x1c6167,_0x25d614){var _0x30b60c=util[_0x864b('0x79')](_0x864b('0x7a'),ISPEECH_API,_0x1a25d4,encodeURIComponent(_0x4f7d54),_0x1c6167,_0x25d614);var _0x3675db=path['resolve'](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+_0x864b('0x46'));var _0x115a4f;return downloadFile(_0x30b60c,_0x3675db)[_0x864b('0x2d')](function(){_0x115a4f=path[_0x864b('0x27')](__dirname,_0x864b('0x28'),rs[_0x864b('0x29')](0x4)+'.wav');return convertFile(_0x3675db,_0x115a4f);})['then'](function(){try{fs[_0x864b('0x1e')](_0x3675db);fs['chmodSync'](_0x115a4f,_0x864b('0x3a'));}catch(_0x2aebd0){logger['error'](_0x2aebd0);}return _0x115a4f[_0x864b('0x2f')]('.')[0x0];});};exports[_0x864b('0x7b')]=function(_0x1acca2,_0x53beff,_0x4495f7,_0x414927){var _0x42b185=util[_0x864b('0x79')](_0x864b('0x7c'),ISPEECH_API,_0x53beff,_0x4495f7,base64Encode(_0x1acca2),_0x414927?util[_0x864b('0x79')](_0x864b('0x7d'),encodeURIComponent(_0x414927)):'freeform=3');return uploadFile(_0x42b185)[_0x864b('0x2d')](function(_0x59157e){return querystring[_0x864b('0x7e')](_0x59157e);});};exports[_0x864b('0x7f')]=function(_0x2f36d9,_0x3b7366){return sestek['nda'](_0x2f36d9,_0x3b7366)[_0x864b('0x2d')](function(_0x2f28f8){logger['info'](JSON['stringify'](_0x2f28f8));var _0x4106dc={'speech':_0x2f28f8['text'],'action':_0x2f28f8[_0x864b('0x80')]?_0x2f28f8[_0x864b('0x80')][_0x864b('0x81')]:undefined,'actiondata':_0x2f28f8[_0x864b('0x80')]?_0x2f28f8[_0x864b('0x80')]['CustomActionData']:undefined};if(_0x2f28f8[_0x864b('0x80')]&&_0x2f28f8[_0x864b('0x80')]['AudioFromTts']){return base64Decode(_0x2f28f8['channelData'][_0x864b('0x82')]['Data'],path['resolve'](__dirname,_0x864b('0x28'),rs['generate'](0x4)+_0x864b('0x2a')))[_0x864b('0x2d')](function(_0x1c123b){_0x4106dc[_0x864b('0x83')]=_0x1c123b;return _0x4106dc;});}return _0x4106dc;});};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 6f67f38..a0ffac3 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 _0x1b2e=['exports','./nda'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x1b2e,0xe5));var _0xe1b2=function(_0x4db3f3,_0xd9272d){_0x4db3f3=_0x4db3f3-0x0;var _0x34eb57=_0x1b2e[_0x4db3f3];return _0x34eb57;};var nda=require(_0xe1b2('0x0'));module[_0xe1b2('0x1')]={'nda':nda}; \ No newline at end of file +var _0x16e3=['./nda','exports'];(function(_0x2c5ebb,_0x4a37e5){var _0x129c53=function(_0xc98712){while(--_0xc98712){_0x2c5ebb['push'](_0x2c5ebb['shift']());}};_0x129c53(++_0x4a37e5);}(_0x16e3,0xf0));var _0x316e=function(_0x20a0c0,_0x191bc4){_0x20a0c0=_0x20a0c0-0x0;var _0x3e40a5=_0x16e3[_0x20a0c0];return _0x3e40a5;};var nda=require(_0x316e('0x0'));module[_0x316e('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 5d5b65b..36a7e9b 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 _0x9c00=['Nda','uniqueid','callerid','calleridname','dnid','extension','text','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomActionData','custom_action_data','stringify','request-promise','url','exports','POST','resolve','ndauth_url','/token','password','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message'];(function(_0x246933,_0x32c543){var _0x5654ec=function(_0x28cde5){while(--_0x28cde5){_0x246933['push'](_0x246933['shift']());}};_0x5654ec(++_0x32c543);}(_0x9c00,0x1a0));var _0x09c0=function(_0x11f1fd,_0xce95a8){_0x11f1fd=_0x11f1fd-0x0;var _0x2d1215=_0x9c00[_0x11f1fd];return _0x2d1215;};'use strict';var rp=require(_0x09c0('0x0'));var url=require(_0x09c0('0x1'));var logger=require('../../../../../config/logger')('agi');module[_0x09c0('0x2')]=function(_0x8c9907,_0x5d1967){var _0x220c0c={'method':_0x09c0('0x3'),'uri':url[_0x09c0('0x4')](_0x5d1967[_0x09c0('0x5')],_0x09c0('0x6')),'form':{'grant_type':'password','username':_0x5d1967['username'],'password':_0x5d1967[_0x09c0('0x7')]},'json':!![]};return rp(_0x220c0c)[_0x09c0('0x8')](function(_0x1b633b){var _0x3187aa={'method':_0x09c0('0x3'),'uri':url['resolve'](_0x5d1967[_0x09c0('0x9')],_0x09c0('0xa')),'body':{'type':_0x5d1967[_0x09c0('0xb')]||_0x09c0('0xc'),'channelId':_0x09c0('0xd'),'conversation':{'id':_0x8c9907[_0x09c0('0xe')]},'from':{'id':_0x8c9907[_0x09c0('0xf')],'name':_0x8c9907[_0x09c0('0x10')]},'recipient':{'id':_0x8c9907[_0x09c0('0x11')],'name':_0x8c9907[_0x09c0('0x12')]},'text':_0x5d1967[_0x09c0('0x13')],'channelData':{}},'headers':{'Authorization':_0x09c0('0x14')+_0x1b633b[_0x09c0('0x15')]},'json':!![]};if(_0x5d1967[_0x09c0('0x16')]){_0x3187aa[_0x09c0('0x17')][_0x09c0('0x18')][_0x09c0('0x19')]=_0x5d1967[_0x09c0('0x16')];}if(_0x5d1967[_0x09c0('0x1a')]=='1'){_0x3187aa[_0x09c0('0x17')][_0x09c0('0x18')][_0x09c0('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x09c0('0x1c')};}if(_0x5d1967[_0x09c0('0x1d')]){_0x3187aa[_0x09c0('0x17')][_0x09c0('0x18')]['CustomAction']=_0x5d1967['custom_action'];if(_0x5d1967['custom_action_data']){_0x3187aa[_0x09c0('0x17')][_0x09c0('0x18')][_0x09c0('0x1e')]=_0x5d1967[_0x09c0('0x1f')];}}logger['info'](JSON[_0x09c0('0x20')](_0x3187aa));return rp(_0x3187aa);});}; \ No newline at end of file +var _0x1978=['ndaactivity_type','message','Nda','uniqueid','callerid','dnid','extension','text','Bearer\x20','access_token','project','ProjectName','ndagenerate_audio','body','channelData','audio/wav','CustomAction','custom_action_data','CustomActionData','stringify','url','../../../../../config/logger','agi','exports','POST','resolve','ndauth_url','password','username','then','ndassistant_url','/api/NaturalDialogAssistant/v1/Run'];(function(_0x355639,_0x52b188){var _0x40a694=function(_0x43d036){while(--_0x43d036){_0x355639['push'](_0x355639['shift']());}};_0x40a694(++_0x52b188);}(_0x1978,0x174));var _0x8197=function(_0x5d7d35,_0x308bb4){_0x5d7d35=_0x5d7d35-0x0;var _0x558c09=_0x1978[_0x5d7d35];return _0x558c09;};'use strict';var rp=require('request-promise');var url=require(_0x8197('0x0'));var logger=require(_0x8197('0x1'))(_0x8197('0x2'));module[_0x8197('0x3')]=function(_0x203bf1,_0x2828d2){var _0x38fffe={'method':_0x8197('0x4'),'uri':url[_0x8197('0x5')](_0x2828d2[_0x8197('0x6')],'/token'),'form':{'grant_type':_0x8197('0x7'),'username':_0x2828d2[_0x8197('0x8')],'password':_0x2828d2[_0x8197('0x7')]},'json':!![]};return rp(_0x38fffe)[_0x8197('0x9')](function(_0x3e8799){var _0x1bc265={'method':_0x8197('0x4'),'uri':url[_0x8197('0x5')](_0x2828d2[_0x8197('0xa')],_0x8197('0xb')),'body':{'type':_0x2828d2[_0x8197('0xc')]||_0x8197('0xd'),'channelId':_0x8197('0xe'),'conversation':{'id':_0x203bf1[_0x8197('0xf')]},'from':{'id':_0x203bf1[_0x8197('0x10')],'name':_0x203bf1['calleridname']},'recipient':{'id':_0x203bf1[_0x8197('0x11')],'name':_0x203bf1[_0x8197('0x12')]},'text':_0x2828d2[_0x8197('0x13')],'channelData':{}},'headers':{'Authorization':_0x8197('0x14')+_0x3e8799[_0x8197('0x15')]},'json':!![]};if(_0x2828d2[_0x8197('0x16')]){_0x1bc265['body']['channelData'][_0x8197('0x17')]=_0x2828d2[_0x8197('0x16')];}if(_0x2828d2[_0x8197('0x18')]=='1'){_0x1bc265[_0x8197('0x19')][_0x8197('0x1a')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x8197('0x1b')};}if(_0x2828d2['custom_action']){_0x1bc265[_0x8197('0x19')]['channelData'][_0x8197('0x1c')]=_0x2828d2['custom_action'];if(_0x2828d2[_0x8197('0x1d')]){_0x1bc265[_0x8197('0x19')]['channelData'][_0x8197('0x1e')]=_0x2828d2['custom_action_data'];}}logger['info'](JSON[_0x8197('0x1f')](_0x1bc265));return rp(_0x1bc265);});}; \ 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 0b16ee9..2ffe0bf 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 _0x6ea6=['./lib/api'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ea6,0x133));var _0x66ea=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x6ea6[_0x36ed3c];return _0x52a2e0;};'use strict';var asr=require(_0x66ea('0x0'));module['exports']=function(_0x1417b5,_0x187c95,_0x5e8a3c,_0x5598df){return asr(_0x1417b5,_0x187c95,_0x5e8a3c,_0x5598df);}; \ No newline at end of file +var _0x943a=['./lib/api','exports'];(function(_0x2e9c6d,_0xbecdb4){var _0x139a4f=function(_0x58566b){while(--_0x58566b){_0x2e9c6d['push'](_0x2e9c6d['shift']());}};_0x139a4f(++_0xbecdb4);}(_0x943a,0x84));var _0xa943=function(_0x24e94d,_0x261a8b){_0x24e94d=_0x24e94d-0x0;var _0xee1443=_0x943a[_0x24e94d];return _0xee1443;};'use strict';var asr=require(_0xa943('0x0'));module[_0xa943('0x1')]=function(_0x58fbaf,_0x5a9332,_0x371169,_0x46f936){return asr(_0x58fbaf,_0x5a9332,_0x371169,_0x46f936);}; \ 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 db6a0c4..9fc645e 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 _0xb5f7=['close','Tilde\x20ASR\x20send\x20error','terminate','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','error','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','message','bluebird','lodash','moment','exports','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0xb5f7,0x1aa));var _0x7b5f=function(_0x211343,_0x2cdeb0){_0x211343=_0x211343-0x0;var _0x5e6b06=_0xb5f7[_0x211343];return _0x5e6b06;};'use strict';var BPromise=require(_0x7b5f('0x0'));var _=require(_0x7b5f('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7b5f('0x2'));var crypto=require('crypto');var logger=require('../../../../../../config/logger')('agi');module[_0x7b5f('0x3')]=function(_0x4f2768,_0x1af43a,_0x3e7b97,_0x1541d1){return new BPromise(function(_0x22b860,_0x16551b){logger['info'](_0x7b5f('0x4'),_0x1541d1||_0x7b5f('0x5'));var _0x1cc501=new WebSocket(_0x1541d1||_0x7b5f('0x5'),{'perMessageDeflate':![]});var _0x1d56a8='';var _0x1d50ef='0';var _0x324063='1';var _0x5012e7=_0x7b5f('0x6');function _0x35b126(_0x189576){var _0x12b519=crypto[_0x7b5f('0x7')]('sha1');_0x12b519[_0x7b5f('0x8')](_0x189576);return _0x12b519[_0x7b5f('0x9')](_0x7b5f('0xa'));}function _0x30e511(){try{logger[_0x7b5f('0xb')](_0x7b5f('0xc'));var _0x699586=moment()[_0x7b5f('0xd')]();var _0x6f2f73=_0x35b126(_0x699586+_0x1af43a+_0x3e7b97);_0x1cc501[_0x7b5f('0xe')](JSON[_0x7b5f('0xf')]({'appID':_0x1af43a,'timestamp':_0x699586,'appKey':_0x6f2f73}));var _0xafa162=fs['createReadStream'](_0x4f2768);_0xafa162['on']('data',function(_0x5f39f3){_0x1cc501[_0x7b5f('0xe')](_0x5f39f3);});_0xafa162['on'](_0x7b5f('0x10'),function(){_0x1cc501[_0x7b5f('0xe')]('EOS');});}catch(_0x4d6722){logger['error'](_0x7b5f('0x11'),JSON[_0x7b5f('0xf')](_0x4d6722));_0x1cc501[_0x7b5f('0x12')]();}}function _0x5d1eb0(_0x15d300){try{if(_0x15d300){var _0x6b4cbe=JSON[_0x7b5f('0x13')](_0x15d300);switch(_0x6b4cbe['status']){case 0x0:if(_0x6b4cbe['result']){if(_0x6b4cbe[_0x7b5f('0x14')][_0x7b5f('0x15')]){logger[_0x7b5f('0xb')](_0x7b5f('0x16'),JSON[_0x7b5f('0xf')](_0x6b4cbe['result'][_0x7b5f('0x17')]));_0x1d56a8=_0x6b4cbe[_0x7b5f('0x14')]['hypotheses'][0x0]['transcript'];_0x1d50ef=_0x6b4cbe[_0x7b5f('0x14')][_0x7b5f('0x17')][0x0]['likelihood'];_0x324063='0';_0x5012e7='Success.';_0x1cc501['terminate']();}}break;case 0x1:logger[_0x7b5f('0xb')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x324063='1';_0x5012e7=_0x7b5f('0x6');break;case 0x2:logger['info'](_0x7b5f('0x18'));_0x324063='2';_0x5012e7=_0x7b5f('0x18');break;case 0x9:logger['info'](_0x7b5f('0x19'));_0x324063='9';_0x5012e7='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info']('Authentication\x20failed.');_0x324063='10';_0x5012e7=_0x7b5f('0x1a');break;case 0xb:logger['info'](_0x7b5f('0x1b'));_0x324063='11';_0x5012e7=_0x7b5f('0x1b');}}}catch(_0x5b603d){logger[_0x7b5f('0x1c')](_0x7b5f('0x1d'),JSON['stringify'](_0x5b603d));_0x1cc501['terminate']();}}function _0xf7dfb1(){logger[_0x7b5f('0xb')](_0x7b5f('0x1e'));_0x22b860({'transcript':_0x1d56a8,'confidence':_0x1d50ef,'status':_0x324063,'status_message':_0x5012e7});}function _0x5ab78a(_0x582d60){logger[_0x7b5f('0x1c')](_0x7b5f('0x1f'));if(!_[_0x7b5f('0x20')](_0x582d60)){logger[_0x7b5f('0x1c')](_['isObject'](_0x582d60)?JSON['stringify'](_0x582d60):_0x582d60);}}_0x1cc501['on']('open',_0x30e511);_0x1cc501['on'](_0x7b5f('0x21'),_0x5d1eb0);_0x1cc501['on'](_0x7b5f('0x10'),_0xf7dfb1);_0x1cc501['on'](_0x7b5f('0x1c'),_0x5ab78a);});}; \ No newline at end of file +var _0x6423=['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','crypto','../../../../../../config/logger','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','hex','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0x6423,0xcf));var _0x3642=function(_0x3dd3d6,_0x1d87e8){_0x3dd3d6=_0x3dd3d6-0x0;var _0x58b29f=_0x6423[_0x3dd3d6];return _0x58b29f;};'use strict';var BPromise=require(_0x3642('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0x3642('0x1'));var logger=require(_0x3642('0x2'))(_0x3642('0x3'));module[_0x3642('0x4')]=function(_0x34c114,_0x36fd4b,_0x109c39,_0x2e3610){return new BPromise(function(_0x2ae2b0,_0x4f22e3){logger[_0x3642('0x5')]('Tilde\x20URI',_0x2e3610||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x4c65ed=new WebSocket(_0x2e3610||_0x3642('0x6'),{'perMessageDeflate':![]});var _0x3f467b='';var _0x69d810='0';var _0x4c2e1a='1';var _0x1e2ae9=_0x3642('0x7');function _0x1873fb(_0x191141){var _0x28c7cc=crypto[_0x3642('0x8')](_0x3642('0x9'));_0x28c7cc['update'](_0x191141);return _0x28c7cc['digest'](_0x3642('0xa'));}function _0x52ef95(){try{logger[_0x3642('0x5')](_0x3642('0xb'));var _0x41d5b7=moment()[_0x3642('0xc')]();var _0x59e400=_0x1873fb(_0x41d5b7+_0x36fd4b+_0x109c39);_0x4c65ed[_0x3642('0xd')](JSON[_0x3642('0xe')]({'appID':_0x36fd4b,'timestamp':_0x41d5b7,'appKey':_0x59e400}));var _0x32bdc8=fs[_0x3642('0xf')](_0x34c114);_0x32bdc8['on'](_0x3642('0x10'),function(_0x32b0d6){_0x4c65ed['send'](_0x32b0d6);});_0x32bdc8['on'](_0x3642('0x11'),function(){_0x4c65ed['send'](_0x3642('0x12'));});}catch(_0x4dd85e){logger[_0x3642('0x13')](_0x3642('0x14'),JSON[_0x3642('0xe')](_0x4dd85e));_0x4c65ed[_0x3642('0x15')]();}}function _0x8a85fb(_0x462117){try{if(_0x462117){var _0x540cd9=JSON[_0x3642('0x16')](_0x462117);switch(_0x540cd9[_0x3642('0x17')]){case 0x0:if(_0x540cd9[_0x3642('0x18')]){if(_0x540cd9[_0x3642('0x18')][_0x3642('0x19')]){logger['info']('Tilde\x20ASR\x20hypoteses',JSON[_0x3642('0xe')](_0x540cd9[_0x3642('0x18')][_0x3642('0x1a')]));_0x3f467b=_0x540cd9['result'][_0x3642('0x1a')][0x0][_0x3642('0x1b')];_0x69d810=_0x540cd9[_0x3642('0x18')]['hypotheses'][0x0][_0x3642('0x1c')];_0x4c2e1a='0';_0x1e2ae9=_0x3642('0x1d');_0x4c65ed[_0x3642('0x15')]();}}break;case 0x1:logger[_0x3642('0x5')](_0x3642('0x7'));_0x4c2e1a='1';_0x1e2ae9=_0x3642('0x7');break;case 0x2:logger[_0x3642('0x5')](_0x3642('0x1e'));_0x4c2e1a='2';_0x1e2ae9=_0x3642('0x1e');break;case 0x9:logger[_0x3642('0x5')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x4c2e1a='9';_0x1e2ae9=_0x3642('0x1f');break;case 0xa:logger[_0x3642('0x5')]('Authentication\x20failed.');_0x4c2e1a='10';_0x1e2ae9=_0x3642('0x20');break;case 0xb:logger[_0x3642('0x5')]('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x4c2e1a='11';_0x1e2ae9=_0x3642('0x21');}}}catch(_0x14333c){logger[_0x3642('0x13')](_0x3642('0x22'),JSON[_0x3642('0xe')](_0x14333c));_0x4c65ed[_0x3642('0x15')]();}}function _0x35b8bd(){logger[_0x3642('0x5')](_0x3642('0x23'));_0x2ae2b0({'transcript':_0x3f467b,'confidence':_0x69d810,'status':_0x4c2e1a,'status_message':_0x1e2ae9});}function _0x43e68e(_0x505c78){logger[_0x3642('0x13')](_0x3642('0x24'));if(!_['isNil'](_0x505c78)){logger[_0x3642('0x13')](_[_0x3642('0x25')](_0x505c78)?JSON[_0x3642('0xe')](_0x505c78):_0x505c78);}}_0x4c65ed['on'](_0x3642('0x26'),_0x52ef95);_0x4c65ed['on'](_0x3642('0x27'),_0x8a85fb);_0x4c65ed['on']('close',_0x35b8bd);_0x4c65ed['on'](_0x3642('0x13'),_0x43e68e);});}; \ 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 9bababd..fc06b80 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 _0x8ac8=['exports','./asr'];(function(_0x496333,_0x1c47d6){var _0x44256e=function(_0x58767d){while(--_0x58767d){_0x496333['push'](_0x496333['shift']());}};_0x44256e(++_0x1c47d6);}(_0x8ac8,0xc7));var _0x88ac=function(_0x2fa665,_0x1176c9){_0x2fa665=_0x2fa665-0x0;var _0x2da98b=_0x8ac8[_0x2fa665];return _0x2da98b;};var asr=require(_0x88ac('0x0'));module[_0x88ac('0x1')]={'asr':asr}; \ No newline at end of file +var _0x358a=['./asr'];(function(_0x2d1663,_0x28a643){var _0x3dcefb=function(_0x6442bf){while(--_0x6442bf){_0x2d1663['push'](_0x2d1663['shift']());}};_0x3dcefb(++_0x28a643);}(_0x358a,0x11f));var _0xa358=function(_0x21f897,_0x3f8cb1){_0x21f897=_0x21f897-0x0;var _0x350a9b=_0x358a[_0x21f897];return _0x350a9b;};var asr=require(_0xa358('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index de9393c..0ee349e 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 _0x5e07=['nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','emit','E_AGI_ARGUMENT_PORT','createServer','listen','listening','connection','getConnections','error','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE'];(function(_0x535c1d,_0x42ef3d){var _0x4e43a6=function(_0x113160){while(--_0x113160){_0x535c1d['push'](_0x535c1d['shift']());}};_0x4e43a6(++_0x42ef3d);}(_0x5e07,0x9f));var _0x75e0=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x5e07[_0x5b561d];return _0x431060;};'use strict';var util=require(_0x75e0('0x0'));var net=require(_0x75e0('0x1'));var EventEmitter=require(_0x75e0('0x2'))[_0x75e0('0x3')];var AGIError=require(_0x75e0('0x4'));var AGIChannel=require(_0x75e0('0x5'));var AGIServer=function(_0x385e33,_0x4e5fe2,_0xe8f86){var _0x3dd51b=this,_0x385e33=_0x385e33||0x11dd,_0x4e5fe2=_0x4e5fe2||_0x75e0('0x6'),_0x21fcef=null,_0x10f834=0x0;EventEmitter['call'](_0x3dd51b);function _0x25a7cc(){if(!_0x385e33){_0x3dd51b[_0x75e0('0x7')]('error',new AGIError(_0x75e0('0x8')));return![];}_0x21fcef=net[_0x75e0('0x9')]();_0x21fcef[_0x75e0('0xa')](_0x385e33,_0x4e5fe2);_0x21fcef['on']('listening',function(){_0x3dd51b[_0x75e0('0x7')](_0x75e0('0xb'));});_0x21fcef['on'](_0x75e0('0xc'),function(_0x1118bc){_0x21fcef[_0x75e0('0xd')](function(_0x5b123e,_0x275c86){if(_0x5b123e){_0x3dd51b[_0x75e0('0x7')](_0x75e0('0xe'),new AGIError(_0x75e0('0xf'),_0x5b123e));}else if(_0xe8f86&&_0xe8f86<0x0){_0x3dd51b[_0x75e0('0x7')](_0x75e0('0xe'),new AGIError(_0x75e0('0x10')));_0x1118bc[_0x75e0('0x11')]();}else if(_0xe8f86&&_0xe8f86>0x0&&_0xe8f86<_0x275c86){_0x10f834+=0x1;_0x3dd51b[_0x75e0('0x7')]('error',new AGIError(_0x75e0('0x12'),_0x10f834));_0x1118bc[_0x75e0('0x11')]();}else{var _0x514498=new AGIChannel(_0x1118bc);_0x514498['on'](_0x75e0('0x13'),function(){_0x3dd51b[_0x75e0('0x7')]('connection',_0x514498);});}});});_0x21fcef['on'](_0x75e0('0xe'),function(_0x44757d){_0x3dd51b['emit'](_0x75e0('0xe'),new AGIError(_0x75e0('0xf'),_0x44757d[_0x75e0('0x14')]));});_0x21fcef['on'](_0x75e0('0x15'),function(){_0x3dd51b['emit'](_0x75e0('0x15'),new AGIError(_0x75e0('0x16')));});}process[_0x75e0('0x17')](function(){_0x25a7cc();});};util[_0x75e0('0x18')](AGIServer,EventEmitter);module[_0x75e0('0x19')]=function(_0x2aeaa5,_0x221407,_0x31830c){return new AGIServer(_0x2aeaa5,_0x221407,_0x31830c);}; \ No newline at end of file +var _0x368e=['call','emit','error','E_AGI_ARGUMENT_PORT','createServer','listening','connection','getConnections','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','inherits','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x368e,0x1ae));var _0xe368=function(_0x3b9d79,_0x42f721){_0x3b9d79=_0x3b9d79-0x0;var _0x16d93e=_0x368e[_0x3b9d79];return _0x16d93e;};'use strict';var util=require(_0xe368('0x0'));var net=require(_0xe368('0x1'));var EventEmitter=require(_0xe368('0x2'))[_0xe368('0x3')];var AGIError=require(_0xe368('0x4'));var AGIChannel=require(_0xe368('0x5'));var AGIServer=function(_0x102af3,_0x25d86b,_0x523ad1){var _0xbd610=this,_0x102af3=_0x102af3||0x11dd,_0x25d86b=_0x25d86b||_0xe368('0x6'),_0xd7997c=null,_0x8d46f2=0x0;EventEmitter[_0xe368('0x7')](_0xbd610);function _0x57acb0(){if(!_0x102af3){_0xbd610[_0xe368('0x8')](_0xe368('0x9'),new AGIError(_0xe368('0xa')));return![];}_0xd7997c=net[_0xe368('0xb')]();_0xd7997c['listen'](_0x102af3,_0x25d86b);_0xd7997c['on'](_0xe368('0xc'),function(){_0xbd610['emit']('listening');});_0xd7997c['on'](_0xe368('0xd'),function(_0x516ce3){_0xd7997c[_0xe368('0xe')](function(_0x1e9a6f,_0x5121e3){if(_0x1e9a6f){_0xbd610[_0xe368('0x8')](_0xe368('0x9'),new AGIError(_0xe368('0xf'),_0x1e9a6f));}else if(_0x523ad1&&_0x523ad1<0x0){_0xbd610[_0xe368('0x8')](_0xe368('0x9'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x516ce3[_0xe368('0x10')]();}else if(_0x523ad1&&_0x523ad1>0x0&&_0x523ad1<_0x5121e3){_0x8d46f2+=0x1;_0xbd610[_0xe368('0x8')](_0xe368('0x9'),new AGIError(_0xe368('0x11'),_0x8d46f2));_0x516ce3[_0xe368('0x10')]();}else{var _0xf96e2a=new AGIChannel(_0x516ce3);_0xf96e2a['on']('ready',function(){_0xbd610['emit'](_0xe368('0xd'),_0xf96e2a);});}});});_0xd7997c['on'](_0xe368('0x9'),function(_0x5b316d){_0xbd610[_0xe368('0x8')](_0xe368('0x9'),new AGIError(_0xe368('0xf'),_0x5b316d[_0xe368('0x12')]));});_0xd7997c['on'](_0xe368('0x13'),function(){_0xbd610['emit']('close',new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0xe368('0x14')](function(){_0x57acb0();});};util[_0xe368('0x15')](AGIServer,EventEmitter);module[_0xe368('0x16')]=function(_0x10353e,_0x1f29c0,_0xe0bdeb){return new AGIServer(_0x10353e,_0x1f29c0,_0xe0bdeb);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index 1f2da89..7dfbcc1 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 _0x70e9=['VOICEMAIL','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','../../config/logger','./scripts','/var/opt/motion2/server/files','rawBody','menu','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','catch','getVoiceQueue','getSquareProject','getUserById','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','scheduledAt','toString','callback_priority','getPause','agentPause','error','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','computedVariables','render','parse','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_polly_voice','Amy','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','uri','clear','isString','includes','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','sync','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','noop','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','label','grammar','MRCPRecog','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','agi','command','args','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','answer','add','delay','minutes','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','odbc_id','no\x20database\x20selected','getSquareOdbc','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','Dialogflow\x20is\x20unreachable','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','no\x20anguage\x20configured','bot','Trying\x20DialogflowV2:\x20%s','speech','dialogflowV2','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','streamFile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','getdigits','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','getData','response','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','%s/recordings/%s','beep','NOBEEP','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','appsecret','no\x20appsecret\x20configured','wav','recordFile','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','continueAt','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','getIntervals','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','intKey','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','playback','no\x20file\x20audio\x20found','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','indexOf','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','position','Executed\x20command\x20%s\x20%s','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','200','%s_STATUS_MESSAGE','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayNumber','sayphonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','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','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','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','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','mailbox'];(function(_0x4816c0,_0x12aef2){var _0x44470a=function(_0x45bb92){while(--_0x45bb92){_0x4816c0['push'](_0x4816c0['shift']());}};_0x44470a(++_0x12aef2);}(_0x70e9,0x1d2));var _0x970e=function(_0x57a155,_0x3bbc5e){_0x57a155=_0x57a155-0x0;var _0xe270cb=_0x70e9[_0x57a155];return _0xe270cb;};'use strict';var fs=require('fs');var path=require(_0x970e('0x0'));var util=require(_0x970e('0x1'));var _=require(_0x970e('0x2'));var sh=require(_0x970e('0x3'));var odbc=require(_0x970e('0x4'))();var rs=require(_0x970e('0x5'));var moment=require(_0x970e('0x6'));var Mustache=require('mustache');var rp=require('request-promise');var logger=require(_0x970e('0x7'))('agi');var config=require('../../config/environment');var scripts=require(_0x970e('0x8'));var FILES_PATH=_0x970e('0x9');var recursiveMapAttributes=['rawHeaders',_0x970e('0xa')];var verticesWithRetry=[_0x970e('0xb'),'getdigits','getsecretdigits'];var AGIVertices=function(_0x439c05,_0x351a49,_0x1e0b79){this[_0x970e('0xc')]=_0x439c05;this[_0x970e('0xd')]=_0x351a49;this[_0x970e('0xe')]=_0x1e0b79;};AGIVertices[_0x970e('0xf')][_0x970e('0x10')]=function(_0x5098b2,_0x10f84e){this[_0x970e('0xd')][_0x970e('0x11')](_0x5098b2)[_0x970e('0x12')](function(_0x5a7020){_0x10f84e(null,_0x5a7020?_0x5a7020[_0x970e('0x13')]:![]);})[_0x970e('0x14')](function(_0x201508){_0x10f84e(_0x201508);});};AGIVertices['prototype'][_0x970e('0x15')]=function(_0x1bd913,_0x3bfd6e){this[_0x970e('0xd')]['getVoiceQueueById'](_0x1bd913)[_0x970e('0x12')](function(_0x18f858){_0x3bfd6e(null,_0x18f858?_0x18f858[_0x970e('0x13')]:![]);})['catch'](function(_0x27fddb){_0x3bfd6e(_0x27fddb);});};AGIVertices[_0x970e('0xf')][_0x970e('0x16')]=function(_0x1374e1,_0x1669f8){this[_0x970e('0xd')]['getSquareProjectById'](_0x1374e1)['then'](function(_0x46e75c){_0x1669f8(null,_0x46e75c?_0x46e75c[_0x970e('0x13')]:![]);})[_0x970e('0x14')](function(_0x53c167){_0x1669f8(_0x53c167);});};AGIVertices[_0x970e('0xf')]['getSquareOdbc']=function(_0xad9ba4,_0x51039d){this[_0x970e('0xd')]['getSquareOdbcById'](_0xad9ba4)[_0x970e('0x12')](function(_0x264466){_0x51039d(null,_0x264466?_0x264466['dsn']:![]);})[_0x970e('0x14')](function(_0x135354){_0x51039d(_0x135354);});};AGIVertices[_0x970e('0xf')]['getUser']=function(_0x5c3342,_0x439de9){this[_0x970e('0xd')][_0x970e('0x17')](_0x5c3342)[_0x970e('0x12')](function(_0x5dc352){_0x439de9(null,_0x5dc352?_0x5dc352[_0x970e('0x13')]:![]);})[_0x970e('0x14')](function(_0x5191ae){_0x439de9(_0x5191ae);});};AGIVertices[_0x970e('0xf')]['getTrunk']=function(_0x1be8d1,_0x1afc28){this[_0x970e('0xd')][_0x970e('0x18')](_0x1be8d1)[_0x970e('0x12')](function(_0x2176b0){_0x1afc28(null,_0x2176b0?_0x2176b0['name']:![]);})[_0x970e('0x14')](function(_0x3a31fc){_0x1afc28(_0x3a31fc);});};AGIVertices[_0x970e('0xf')][_0x970e('0x19')]=function(_0x36bc9c,_0x170578){var _0x4bf79c=this;this['rpc'][_0x970e('0x1a')](_0x36bc9c)[_0x970e('0x12')](function(_0x5a05c5){_0x170578(null,_0x5a05c5?_0x4bf79c[_0x970e('0x1b')](_0x5a05c5[_0x970e('0x1c')]):![]);})[_0x970e('0x14')](function(_0x373222){_0x170578(_0x373222);});};AGIVertices[_0x970e('0xf')][_0x970e('0x1d')]=function(_0x114d34,_0xeb46bf){this[_0x970e('0xd')][_0x970e('0x1e')](_0x114d34)[_0x970e('0x12')](function(_0x189616){_0xeb46bf(null,_0x189616?_0x189616:![]);})[_0x970e('0x14')](function(_0x1f37a7){_0xeb46bf(_0x1f37a7);});};AGIVertices[_0x970e('0xf')][_0x970e('0x1f')]=function(_0x192acb,_0x54b110,_0x2e09a7){this[_0x970e('0xe')][_0x970e('0x1f')](_0x192acb,_0x54b110)[_0x970e('0x12')](function(){_0x2e09a7(null);})['catch'](function(_0x439111){_0x2e09a7(_0x439111);});};AGIVertices['prototype']['getIntervals']=function(_0x38fab4,_0x1eba24){this['rpc']['getIntervalById'](_0x38fab4)['then'](function(_0x3e6b93){if(_0x3e6b93){if(_0x3e6b93[_0x970e('0x20')]){_0x1eba24(null,[_0x3e6b93[_0x970e('0x21')]]);}else{_0x1eba24(null,_[_0x970e('0x22')](_0x3e6b93[_0x970e('0x23')],_0x970e('0x21')));}}else{_0x1eba24(null,![]);}})[_0x970e('0x14')](function(_0x5137e7){_0x1eba24(_0x5137e7);});};AGIVertices[_0x970e('0xf')][_0x970e('0x1b')]=function(_0x30ff3c){return util[_0x970e('0x24')](_0x970e('0x25'),FILES_PATH,_0x30ff3c);};AGIVertices[_0x970e('0xf')][_0x970e('0x26')]=function(_0x1cfff2,_0x493898,_0x5004e5){odbc[_0x970e('0x27')](_0x1cfff2,function(_0x26d024){if(_0x26d024){logger['error'](_0x970e('0x28'),_0x26d024);_0x5004e5(_0x26d024);}else{logger[_0x970e('0x29')](_0x970e('0x2a'));odbc[_0x970e('0x2b')](_0x493898,function(_0x1d1fe9,_0x512fc2){if(_0x1d1fe9){logger[_0x970e('0x29')](_0x970e('0x2c'),_0x493898);_0x5004e5(_0x1d1fe9);}else{logger[_0x970e('0x29')](_0x970e('0x2d'),_0x493898);odbc['close'](function(_0x202f17){if(_0x202f17){logger['error']('Error\x20closing\x20connection\x20to\x20odbc\x20%s',_0x202f17);}_0x5004e5(null,_0x512fc2);});}});}});};AGIVertices[_0x970e('0xf')]['getSmsAccount']=function(_0x503cbe,_0x293cf0){this[_0x970e('0xd')][_0x970e('0x2e')](_0x503cbe)[_0x970e('0x12')](function(_0x5a6a54){_0x293cf0(null,_0x5a6a54?_0x5a6a54:![]);})[_0x970e('0x14')](function(_0x444e9a){_0x293cf0(_0x444e9a);});};AGIVertices[_0x970e('0xf')][_0x970e('0x2f')]=function(_0x6671e,_0x5ec972){this[_0x970e('0xd')][_0x970e('0x2f')](_0x6671e)[_0x970e('0x12')](function(_0x11f5a7){_0x5ec972(null,_0x11f5a7);})[_0x970e('0x14')](function(_0x6d14ba){_0x5ec972(_0x6d14ba);});};AGIVertices['prototype'][_0x970e('0x30')]=function(_0x5a5f8a,_0x3d5f88,_0x525917){this[_0x970e('0xd')]['createSquareDetailsReport']({'uniqueid':this['channel'][_0x970e('0x31')],'node':_0x5a5f8a['label'],'application':_0x5a5f8a[_0x970e('0x32')],'data':_0x3d5f88||null,'project_name':this[_0x970e('0xc')][_0x970e('0x33')],'callerid':this[_0x970e('0xc')][_0x970e('0x34')]})[_0x970e('0x12')](function(_0x442861){if(_0x525917){_0x525917(null,_0x442861);}})[_0x970e('0x14')](function(_0x71d324){if(_0x525917){_0x525917(_0x71d324);}});};AGIVertices[_0x970e('0xf')][_0x970e('0x35')]=function(_0x4f7cad,_0xb2f3b2,_0x3cfb9c,_0x135936){this['rpc']['createSquareRecording']({'uniqueid':this[_0x970e('0xc')][_0x970e('0x31')],'callerid':this['channel'][_0x970e('0x34')],'calleridname':this[_0x970e('0xc')][_0x970e('0x36')],'context':this[_0x970e('0xc')][_0x970e('0x37')],'extension':this[_0x970e('0xc')][_0x970e('0x38')],'priority':this['channel'][_0x970e('0x39')],'accountcode':this['channel'][_0x970e('0x3a')],'dnid':this[_0x970e('0xc')][_0x970e('0x3b')],'projectName':this[_0x970e('0xc')][_0x970e('0x33')],'saveName':_0xb2f3b2,'filename':_0x4f7cad[_0x970e('0x3c')]||_0xb2f3b2,'savePath':_0x3cfb9c})[_0x970e('0x12')](function(_0x4685b5){_0x135936(null,_0x4685b5);})[_0x970e('0x14')](function(_0x7cdcb6){_0x135936(_0x7cdcb6);});};AGIVertices[_0x970e('0xf')][_0x970e('0x3d')]=function(_0xcdf171,_0x1dee7c,_0x121d78,_0x17fe5,_0x518db6){this[_0x970e('0xd')][_0x970e('0x3d')]({'uniqueid':this['channel'][_0x970e('0x31')],'body':_0xcdf171,'direction':_0x1dee7c,'providerName':_0x121d78,'providerResponse':_0x17fe5})[_0x970e('0x12')](function(_0x15c7bf){if(_0x518db6){_0x518db6(null,_0x15c7bf);}})[_0x970e('0x14')](function(_0x19a3c5){if(_0x518db6){_0x518db6(_0x19a3c5);}});};AGIVertices[_0x970e('0xf')][_0x970e('0x3e')]=function(_0x246aa6,_0x52a53f){this[_0x970e('0xd')][_0x970e('0x3e')]({'firstName':_[_0x970e('0x3f')](_0x246aa6[_0x970e('0x13')])||_[_0x970e('0x40')](_0x246aa6[_0x970e('0x13')])?_0x970e('0x41')+Math[_0x970e('0x42')]():_0x246aa6[_0x970e('0x13')],'lastName':_[_0x970e('0x3f')](_0x246aa6[_0x970e('0x43')])||_['isNil'](_0x246aa6['lastName'])?null:_0x246aa6[_0x970e('0x43')],'phone':_0x246aa6[_0x970e('0x44')],'ListId':_0x246aa6[_0x970e('0x45')],'scheduledat':_0x246aa6[_0x970e('0x46')],'callbackUniqueid':this[_0x970e('0xc')]['uniqueid'],'tags':'callback','description':'Callback\x20scheduled\x20at\x20'+_0x246aa6[_0x970e('0x46')][_0x970e('0x47')](),'priority':_0x246aa6[_0x970e('0x48')]})['then'](function(_0x46c3a5){_0x52a53f(null,_0x46c3a5);})['catch'](function(_0x4071ce){_0x52a53f(_0x4071ce);});};AGIVertices[_0x970e('0xf')][_0x970e('0x49')]=function(_0x221824,_0x58662e){this[_0x970e('0xd')]['getPauseById'](_0x221824)[_0x970e('0x12')](function(_0x585b03){_0x58662e(null,_0x585b03?_0x585b03['name']:![]);})[_0x970e('0x14')](function(_0x51f044){_0x58662e(_0x51f044);});};AGIVertices[_0x970e('0xf')][_0x970e('0x4a')]=function(_0x2ffd60,_0x573568,_0x34d79c){var _0x350871={'role':'agent'};_0x350871[_0x2ffd60]=this[_0x970e('0xc')]['callerid'];this['rpc'][_0x970e('0x4a')](_0x350871,_0x573568,this[_0x970e('0xc')][_0x970e('0x31')])[_0x970e('0x12')](function(_0x2d1c26){_0x34d79c(null,_[_0x970e('0x40')](_0x2d1c26)?![]:!![]);})[_0x970e('0x14')](function(_0x1a4765){logger[_0x970e('0x4b')](_0x1a4765);_0x34d79c(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0xd64312,_0x1b89ec){var _0x97a026={'role':_0x970e('0x4c')};_0x97a026[_0xd64312]=this['channel'][_0x970e('0x34')];this['rpc'][_0x970e('0x4d')](_0x97a026)[_0x970e('0x12')](function(_0x4d62a2){_0x1b89ec(null,_[_0x970e('0x40')](_0x4d62a2)?![]:!![]);})[_0x970e('0x14')](function(_0x2586b7){logger[_0x970e('0x4b')](_0x2586b7);_0x1b89ec(null,![]);});};AGIVertices[_0x970e('0xf')][_0x970e('0x4e')]=function(_0x280361,_0x9e75c){var _0x4e5c6e={'role':_0x970e('0x4c')};_0x4e5c6e[_0x280361]=this[_0x970e('0xc')][_0x970e('0x34')];this[_0x970e('0xd')][_0x970e('0x4e')](_0x4e5c6e)[_0x970e('0x12')](function(_0x120044){_0x9e75c(null,_[_0x970e('0x40')](_0x120044)?![]:!![]);})[_0x970e('0x14')](function(_0x3b750e){logger[_0x970e('0x4b')](_0x3b750e);_0x9e75c(null,![]);});};AGIVertices['prototype'][_0x970e('0x4f')]=function(_0x526bf2,_0x27d094){var _0x2f88ee={'role':_0x970e('0x4c')};_0x2f88ee[_0x526bf2]=this[_0x970e('0xc')][_0x970e('0x34')];var _0x5f3815=_0x526bf2!=_0x970e('0x50')?util['format'](_0x970e('0x51'),_0x970e('0x52'),this[_0x970e('0xc')]['callerid']):undefined;this[_0x970e('0xd')]['agentLogin'](_0x2f88ee,_0x5f3815)[_0x970e('0x12')](function(_0x1767c4){_0x27d094(null,_['isNil'](_0x1767c4)?![]:!![]);})['catch'](function(_0x29cd15){logger[_0x970e('0x4b')](_0x29cd15);_0x27d094(null,![]);});};AGIVertices[_0x970e('0xf')]['shellCommand']=function(_0x37565a,_0x4887b7){sh[_0x970e('0x53')](_[_0x970e('0x54')](_0x37565a),function(_0x1af590,_0x5c510f){var _0x2714fc=_0x5c510f[_0x970e('0x55')](/(\r\n|\n|\r)/gm,'');_0x4887b7(null,_0x2714fc);});};AGIVertices[_0x970e('0xf')][_0x970e('0x56')]=function(_0xbbd119,_0x46672d){scripts[_0x970e('0x56')](_0xbbd119[_0x970e('0x57')],_0xbbd119[_0x970e('0x58')]||_0x970e('0x59'),_0xbbd119[_0x970e('0x59')],_0xbbd119[_0x970e('0x5a')]||_0x970e('0x5b'),_0xbbd119[_0x970e('0x5c')]||_0x970e('0x5d'),_0xbbd119[_0x970e('0x5e')]||_0x970e('0x5f'))[_0x970e('0x12')](function(_0x38ec86){_0x46672d(null,_0x38ec86);})[_0x970e('0x14')](function(_0x569a72){_0x46672d(_0x569a72);});};AGIVertices[_0x970e('0xf')]['googleTTS']=function(_0x3ef65a,_0x21ba5e){scripts[_0x970e('0x60')](_0x3ef65a['text'],_0x3ef65a[_0x970e('0x61')]||'en',0x1)[_0x970e('0x12')](function(_0x4023d3){_0x21ba5e(null,_0x4023d3);})['catch'](function(_0x2bd754){_0x21ba5e(_0x2bd754);});};AGIVertices[_0x970e('0xf')][_0x970e('0x62')]=function(_0x22d39b,_0x147004){var _0x1314e3={'uri':_0x22d39b[_0x970e('0x63')],'method':_0x22d39b[_0x970e('0x64')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x22d39b[_0x970e('0x65')])===_0x970e('0x66')&&parseInt(_0x22d39b[_0x970e('0x65')])>=0x1?parseInt(_0x22d39b[_0x970e('0x65')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x970e('0x67'),_0x970e('0x68')],_0x1314e3[_0x970e('0x64')][_0x970e('0x69')]())){try{_0x1314e3[_0x970e('0x6a')]=_0x22d39b[_0x970e('0xa')]?JSON['parse'](_0x22d39b[_0x970e('0xa')]):{};}catch(_0x45ccbd){logger[_0x970e('0x4b')](_0x970e('0x6b'),_0x45ccbd);}}try{_0x1314e3[_0x970e('0x6c')]=_0x22d39b[_0x970e('0x6d')]?JSON['parse'](_0x22d39b[_0x970e('0x6d')]):{};}catch(_0x5385e4){logger[_0x970e('0x4b')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x5385e4);}if(_0x22d39b['computedVariables']){try{var _0x102b93=require(_0x22d39b[_0x970e('0x6e')])['sync'](this,_0x1314e3);_0x1314e3['uri']=Mustache[_0x970e('0x6f')](_0x22d39b['url'],_0x102b93,{},['$$','$$']);if(_0x1314e3[_0x970e('0x6c')]){_0x1314e3[_0x970e('0x6c')]=JSON[_0x970e('0x70')](Mustache[_0x970e('0x6f')](JSON[_0x970e('0x71')](_0x1314e3[_0x970e('0x6c')]),_0x102b93,{},['$$','$$']));}if(_0x1314e3['body']){_0x1314e3['body']=JSON[_0x970e('0x70')](Mustache[_0x970e('0x6f')](JSON[_0x970e('0x71')](_0x1314e3[_0x970e('0x6a')]),_0x102b93,{},['$$','$$']));}}catch(_0x17ad6c){logger['error'](_0x970e('0x72'),_0x17ad6c);}}rp(_0x1314e3)['then'](function(_0x3db1ff){var _0x42ddd6={'statusCode':_0x3db1ff[_0x970e('0x73')]||0xc8,'statusMessage':_0x3db1ff[_0x970e('0x74')]||'OK','headers':_0x3db1ff[_0x970e('0x6c')]||{},'body':_0x3db1ff[_0x970e('0x6a')]||{}};_0x147004(null,_0x42ddd6);})[_0x970e('0x14')](function(_0x252961){var _0x244f30={'statusCode':_0x252961[_0x970e('0x73')]||0x1f4,'statusMessage':_0x252961[_0x970e('0x75')]||_0x970e('0x76'),'headers':_0x252961[_0x970e('0x77')][_0x970e('0x6c')]||{},'body':_0x252961[_0x970e('0x77')][_0x970e('0x6a')]||{}};_0x147004(null,_0x244f30);});};AGIVertices[_0x970e('0xf')][_0x970e('0x78')]=function(_0x219b7c,_0x206b25){scripts[_0x970e('0x78')](this[_0x970e('0xc')][_0x970e('0x31')],_0x219b7c[_0x970e('0x79')],_0x219b7c[_0x970e('0x59')],_0x219b7c[_0x970e('0x7a')]||'en')[_0x970e('0x12')](function(_0x2c1ed1){_0x206b25(null,_0x2c1ed1);})[_0x970e('0x14')](function(_0x180a97){_0x206b25(_0x180a97);});};AGIVertices['prototype']['googleDialogflowV2']=function(_0x4f6e3d,_0x4d6d94){scripts[_0x970e('0x7b')](this[_0x970e('0xc')][_0x970e('0x31')],_0x4f6e3d['dialogflowV2_project_id'],_0x4f6e3d[_0x970e('0x7c')],_0x4f6e3d[_0x970e('0x7d')],_0x4f6e3d[_0x970e('0x59')],_0x4f6e3d['dialogflowV2_language']||'en')[_0x970e('0x12')](function(_0x5d2ff5){_0x4d6d94(null,_0x5d2ff5);})[_0x970e('0x14')](function(_0x41c672){_0x4d6d94(_0x41c672);});};AGIVertices[_0x970e('0xf')][_0x970e('0x7e')]=function(_0x4e5e8d,_0x46bae6){scripts[_0x970e('0x7e')](this[_0x970e('0xc')],_0x4e5e8d)[_0x970e('0x12')](function(_0x3da847){_0x46bae6(null,_0x3da847);})[_0x970e('0x14')](function(_0x3a311c){_0x46bae6(_0x3a311c);});};AGIVertices['prototype'][_0x970e('0x7f')]=function(_0x486d25,_0x49a059){scripts['ispeechTTS'](_0x486d25[_0x970e('0x79')],_0x486d25['text'],_0x486d25['ispeech_tts_language']||'en-US',_0x486d25['speed'])[_0x970e('0x12')](function(_0x2c3134){_0x49a059(null,_0x2c3134);})[_0x970e('0x14')](function(_0x3dbb21){_0x49a059(_0x3dbb21);});};AGIVertices[_0x970e('0xf')][_0x970e('0x80')]=function(_0x3d7f6b,_0x35b1fa,_0x9661e1){scripts[_0x970e('0x80')](_0x35b1fa,_0x3d7f6b[_0x970e('0x79')],_0x3d7f6b[_0x970e('0x81')]||_0x970e('0x5b'),this[_0x970e('0x82')](_0x3d7f6b[_0x970e('0x83')])?_0x3d7f6b[_0x970e('0x83')]:undefined)['then'](function(_0x1d56e5){_0x9661e1(null,_0x1d56e5);})[_0x970e('0x14')](function(_0x15ff49){_0x9661e1(_0x15ff49);});};AGIVertices[_0x970e('0xf')]['awsPolly']=function(_0x5be28e,_0x5a533f){scripts[_0x970e('0x84')](_0x5be28e[_0x970e('0x85')],_0x5be28e['aws_secret_access_key'],_0x5be28e['aws_polly_region'],_0x5be28e[_0x970e('0x86')]||_0x970e('0x87'),_0x5be28e[_0x970e('0x59')],_0x5be28e['aws_text_type']||_0x970e('0x59'))[_0x970e('0x12')](function(_0x20833e){_0x5a533f(null,_0x20833e);})[_0x970e('0x14')](function(_0x51861b){_0x5a533f(_0x51861b);});};AGIVertices[_0x970e('0xf')][_0x970e('0x88')]=function(_0x5690c0,_0x38db62){scripts[_0x970e('0x88')](this[_0x970e('0xc')][_0x970e('0x31')],_0x5690c0[_0x970e('0x85')],_0x5690c0[_0x970e('0x89')],_0x5690c0[_0x970e('0x8a')],_0x5690c0[_0x970e('0x59')],_0x5690c0[_0x970e('0x8b')])[_0x970e('0x12')](function(_0x1201f8){_0x38db62(null,_0x1201f8);})[_0x970e('0x14')](function(_0x2a931e){_0x38db62(_0x2a931e);});};AGIVertices[_0x970e('0xf')][_0x970e('0x8c')]=function(_0x487c1c,_0x878067,_0x10c912){scripts[_0x970e('0x8c')](_0x878067,_0x487c1c[_0x970e('0x79')],_0x487c1c[_0x970e('0x8d')]||_0x970e('0x5b'))['then'](function(_0x3f03b7){_0x10c912(null,_0x3f03b7);})[_0x970e('0x14')](function(_0x13e5eb){_0x10c912(_0x13e5eb);});};AGIVertices[_0x970e('0xf')][_0x970e('0x8e')]=function(_0x227e45,_0x41d10c,_0x43346f){scripts[_0x970e('0x8e')](_0x41d10c,_0x227e45[_0x970e('0x8f')],_0x227e45['appsecret'],_0x227e45[_0x970e('0x90')])[_0x970e('0x12')](function(_0x32c0ca){_0x43346f(null,_0x32c0ca);})['catch'](function(_0x26192b){_0x43346f(_0x26192b);});};AGIVertices['prototype'][_0x970e('0x91')]=function(_0x3043c5){var _0x3807d4=_['includes'](verticesWithRetry,_0x3043c5['agicommand'])?_0x3043c5:_['clone'](_0x3043c5);for(var _0x4d8002 in _0x3807d4){if(_0x3807d4['hasOwnProperty'](_0x4d8002)){if(_0x3807d4[_0x4d8002]&&_[_0x970e('0x92')](_0x3807d4[_0x4d8002])){if(_[_0x970e('0x93')](recursiveMapAttributes,_0x4d8002)){_0x3807d4[_0x4d8002]=this['replaceObjectAllVariables'](_0x3807d4[_0x4d8002]);}else{_0x3807d4[_0x4d8002]=this[_0x970e('0x94')](_0x3807d4[_0x4d8002]);}}}}return _0x3807d4;};AGIVertices['prototype'][_0x970e('0x95')]=function(_0x1bf789){for(var _0xbb9397 in _0x1bf789){if(_0x1bf789[_0x970e('0x96')](_0xbb9397)){if(_[_0x970e('0x97')](_0x1bf789[_0xbb9397])){this[_0x970e('0x95')](_0x1bf789[_0xbb9397]);}else if(_[_0x970e('0x98')](_0x1bf789[_0xbb9397])){for(var _0x3cc475=0x0;_0x3cc475<_0x1bf789[_0xbb9397][_0x970e('0x99')];_0x3cc475++){this['recursiveNodeIndex'](_0x1bf789[_0xbb9397][_0x3cc475]);}}else if(_['isString'](_0x1bf789[_0xbb9397])){_0x1bf789[_0xbb9397]=this[_0x970e('0x94')](_0x1bf789[_0xbb9397]);}}}};AGIVertices['prototype'][_0x970e('0x9a')]=function(_0x5f0bb0,_0x373635){for(var _0xadd5d5 in _0x5f0bb0){if(_0x5f0bb0['hasOwnProperty'](_0xadd5d5)){if(_[_0x970e('0x97')](_0x5f0bb0[_0xadd5d5])){if(!_['isEmpty'](_0x5f0bb0[_0xadd5d5])){this[_0x970e('0x9a')](_0x5f0bb0[_0xadd5d5],util[_0x970e('0x24')](_0x970e('0x9b'),_0x373635,_0xadd5d5));}}else if(_['isArray'](_0x5f0bb0[_0xadd5d5])){for(var _0x5f1a01=0x0;_0x5f1a01<_0x5f0bb0[_0xadd5d5][_0x970e('0x99')];_0x5f1a01++){this[_0x970e('0x9a')](_0x5f0bb0[_0xadd5d5][_0x5f1a01],util[_0x970e('0x24')](_0x970e('0x9b'),_0x373635,_0xadd5d5+'['+_0x5f1a01+']'));}}else{if(!_['isNil'](_0x5f0bb0[_0xadd5d5])){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')](_0x970e('0x9b'),_0x373635,_0xadd5d5),_0x5f0bb0[_0xadd5d5]);}}}}};AGIVertices[_0x970e('0xf')]['replaceObjectAllVariables']=function(_0x6c5e5f){try{var _0x1b62e7=JSON[_0x970e('0x70')](_0x6c5e5f);this[_0x970e('0x95')](_0x1b62e7);return JSON[_0x970e('0x71')](_0x1b62e7);}catch(_0x1b7efa){return this[_0x970e('0x94')](_0x6c5e5f);}};AGIVertices[_0x970e('0xf')][_0x970e('0x94')]=function(_0x3ec9ce){var _0x95eebc=_0x3ec9ce[_0x970e('0x9d')]('{');for(var _0x59805a=0x1;_0x59805a<_0x95eebc[_0x970e('0x99')];_0x59805a+=0x1){var _0x48d2b5=_0x95eebc[_0x59805a]['split']('}');if(_0x48d2b5['length']>0x1){_0x3ec9ce=_0x3ec9ce[_0x970e('0x9e')]('{'+_0x48d2b5[0x0]+'}',this[_0x970e('0xc')][_0x970e('0x10')](_0x48d2b5[0x0])[_0x970e('0x9f')]||_0x48d2b5[0x0]);}}if(_0x95eebc[_0x970e('0x99')]===0x1){return _0x3ec9ce[_0x970e('0x47')]();}return this['replaceAllVariables'](_0x3ec9ce);};AGIVertices[_0x970e('0xf')][_0x970e('0xa0')]=function(_0x54fc96,_0x3cbb29){var _0x4b4e97=this[_0x970e('0xc')][_0x970e('0x10')](_0x54fc96);if(_0x4b4e97[_0x970e('0xa1')]===-0x1){return _0x4b4e97;}logger[_0x970e('0x29')](util['format'](_0x970e('0xa2'),_0x3cbb29,_0x4b4e97[_0x970e('0x9f')]));return this[_0x970e('0xc')][_0x970e('0x9c')](_0x3cbb29,_0x4b4e97['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x2c6738){return _0x2c6738&&_0x2c6738!=='0'&&_0x2c6738!=='-1'&&_0x2c6738!=='';};AGIVertices[_0x970e('0xf')][_0x970e('0xa3')]=function(_0x21f2a8){this['createSquareDetailsReport'][_0x970e('0xa4')](this,_0x21f2a8,'-');_0x21f2a8[_0x970e('0xa5')]=_0x21f2a8[_0x970e('0xa3')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype']['mrcpsynth']=function(_0x553cfc){logger['info'](util[_0x970e('0x24')](_0x970e('0xa6'),_0x553cfc['label']));if(!this[_0x970e('0x82')](_0x553cfc['text'])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xa8'));}var _0x2054d8='\x22'+_0x553cfc[_0x970e('0x59')]+'\x22';if(this[_0x970e('0x82')](_0x553cfc['options'])){_0x2054d8+=','+_0x553cfc[_0x970e('0x77')];}var _0x53c1c5=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0xa9'),_0x2054d8);if(_0x53c1c5[_0x970e('0xa1')]===-0x1){return _0x53c1c5;}return this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xaa'),_0x2054d8));};AGIVertices['prototype']['mrcprecog']=function(_0x4dbacd){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0xab'),_0x4dbacd[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x4dbacd[_0x970e('0xad')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20grammar\x20configured');}var _0x5ed10f=_0x4dbacd[_0x970e('0xad')];if(this[_0x970e('0x82')](_0x4dbacd[_0x970e('0x77')])){_0x5ed10f+=','+_0x4dbacd['options'];}var _0x1f1a46=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0xae'),_0x5ed10f);if(_0x1f1a46[_0x970e('0xa1')]===-0x1){return _0x1f1a46;}var _0x545ef2=this[_0x970e('0xa0')]('RECOG_CONFIDENCE()',_0x970e('0xaf'));if(_0x545ef2[_0x970e('0xa1')]===-0x1){return _0x545ef2;}var _0x29c985=this[_0x970e('0xa0')](_0x970e('0xb0'),_0x970e('0xb1'));if(_0x29c985[_0x970e('0xa1')]===-0x1){return _0x29c985;}var _0x285e04=this['getAndSetVariable'](_0x970e('0xb2'),'MRCP_RECOG_INSTANCE');if(_0x285e04[_0x970e('0xa1')]===-0x1){return _0x285e04;}return this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')]('Executed\x20command\x20MRCPRecog\x20%s',_0x5ed10f));};AGIVertices[_0x970e('0xf')][_0x970e('0xb3')]=function(_0x57a343){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x57a343[_0x970e('0xac')]));return this[_0x970e('0xc')]['agi']([_0x57a343[_0x970e('0xb4')],_0x57a343[_0x970e('0xb5')]]);};AGIVertices[_0x970e('0xf')]['answer']=function(_0x5d4442){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0xb6'),_0x5d4442['label']));if(this[_0x970e('0x82')](_0x5d4442[_0x970e('0x65')])){logger['info'](util[_0x970e('0x24')](_0x970e('0xb7'),_0x5d4442[_0x970e('0x65')]));var _0x2feb24=this['channel'][_0x970e('0xb8')](_0x5d4442['timeout']);if(_0x2feb24['result']===-0x1){return _0x2feb24;}}return this['channel'][_0x970e('0xb9')]();};AGIVertices[_0x970e('0xf')]['callback']=function(_0x3167c9){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x3167c9[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x3167c9[_0x970e('0x45')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x3167c9,'no\x20list\x20selected');}_0x3167c9['scheduledAt']=moment();if(this[_0x970e('0x82')](_0x3167c9['delay'])){_0x3167c9[_0x970e('0x46')]=moment()[_0x970e('0xba')](_0x3167c9[_0x970e('0xbb')],_0x970e('0xbc'));}if(!this[_0x970e('0x82')](_0x3167c9[_0x970e('0x48')])){_0x3167c9[_0x970e('0x48')]=0x2;}this['createCmContact'][_0x970e('0xa4')](this,_0x3167c9);return this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x3167c9['phone'],_0x3167c9[_0x970e('0x45')],_0x3167c9[_0x970e('0x46')]));};AGIVertices[_0x970e('0xf')][_0x970e('0xbd')]=function(_0x397bc3){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0xbe'),_0x397bc3[_0x970e('0xac')]));var _0x452d1d=this[_0x970e('0xc')][_0x970e('0x53')](_0x397bc3[_0x970e('0xbf')],_0x397bc3[_0x970e('0x77')]);if(_0x452d1d[_0x970e('0xa1')]===-0x1){return _0x452d1d;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('Executed\x20command\x20%s\x20%s',_0x397bc3['application'],_0x397bc3[_0x970e('0x77')]));};AGIVertices['prototype']['lumenvoxtts']=function(_0xb5d587){logger['info'](util[_0x970e('0x24')](_0x970e('0xc0'),_0xb5d587[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0xb5d587['text'])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20text\x20configured');}var _0x40befd='\x22'+_0xb5d587[_0x970e('0x59')]+'\x22';if(this['isConfigured'](_0xb5d587['options'])){_0x40befd+=','+_0xb5d587[_0x970e('0x77')];}var _0x4c347a=this['channel'][_0x970e('0x53')](_0x970e('0xa9'),_0x40befd);if(_0x4c347a[_0x970e('0xa1')]===-0x1){return _0x4c347a;}return this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0xaa'),_0x40befd));};AGIVertices[_0x970e('0xf')][_0x970e('0xc1')]=function(_0x389f12){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0xc2'),_0x389f12['label']));if(!this['isConfigured'](_0x389f12['text'])){return this['channel'][_0x970e('0xa7')]('no\x20text\x20configured');}var _0x26e494='\x22'+_0x389f12['text']+'\x22';if(this[_0x970e('0x82')](_0x389f12['options'])){_0x26e494+=','+_0x389f12['options'];}var _0x3c585d=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0xa9'),_0x26e494);if(_0x3c585d[_0x970e('0xa1')]===-0x1){return _0x3c585d;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xaa'),_0x26e494));};AGIVertices[_0x970e('0xf')][_0x970e('0xc3')]=function(_0x1e3031){logger[_0x970e('0x29')](util['format'](_0x970e('0xc4'),_0x1e3031[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x1e3031[_0x970e('0xad')])){return this['channel'][_0x970e('0xa7')]('no\x20grammar\x20configured');}var _0x2ab656=_0x1e3031[_0x970e('0xad')];if(this['isConfigured'](_0x1e3031[_0x970e('0x77')])){_0x2ab656+=','+_0x1e3031[_0x970e('0x77')];}var _0x451f3c=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0xae'),_0x2ab656);if(_0x451f3c[_0x970e('0xa1')]===-0x1){return _0x451f3c;}var _0x341c9e=this[_0x970e('0xa0')](_0x970e('0xc5'),_0x970e('0xc6'));if(_0x341c9e[_0x970e('0xa1')]===-0x1){return _0x341c9e;}var _0x34b3dd=this[_0x970e('0xa0')](_0x970e('0xb0'),_0x970e('0xc7'));if(_0x34b3dd[_0x970e('0xa1')]===-0x1){return _0x34b3dd;}var _0x59096f=this[_0x970e('0xa0')](_0x970e('0xb2'),_0x970e('0xc8'));if(_0x59096f[_0x970e('0xa1')]===-0x1){return _0x59096f;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xc9'),_0x2ab656));};AGIVertices['prototype'][_0x970e('0xca')]=function(_0x104d1f){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0xcb'),_0x104d1f[_0x970e('0xac')]));if(!this['isConfigured'](_0x104d1f[_0x970e('0xad')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20grammar\x20configured');}var _0x517e40=_0x104d1f[_0x970e('0xad')];if(this[_0x970e('0x82')](_0x104d1f[_0x970e('0x77')])){_0x517e40+=','+_0x104d1f[_0x970e('0x77')];}var _0x53aa93=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0xae'),_0x517e40);if(_0x53aa93['result']===-0x1){return _0x53aa93;}var _0x2c0f49=this[_0x970e('0xa0')]('RECOG_CONFIDENCE()',_0x970e('0xcc'));if(_0x2c0f49[_0x970e('0xa1')]===-0x1){return _0x2c0f49;}var _0x32ecf0=this[_0x970e('0xa0')](_0x970e('0xb0'),_0x970e('0xcd'));if(_0x32ecf0['result']===-0x1){return _0x32ecf0;}var _0x3929a3=this[_0x970e('0xa0')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x3929a3['result']===-0x1){return _0x3929a3;}return this['channel']['noop'](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x517e40));};AGIVertices['prototype']['database']=function(_0x1fab7d){logger['info'](util[_0x970e('0x24')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x1fab7d[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x1fab7d[_0x970e('0xce')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x1fab7d,_0x970e('0xcf'));}var _0x15bf75=this[_0x970e('0xd0')]['sync'](this,_0x1fab7d['odbc_id']);if(!_0x15bf75){return this['channel'][_0x970e('0x4b')](_0x1fab7d,_0x970e('0xd1'));}if(!this['isConfigured'](_0x1fab7d[_0x970e('0x2b')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x1fab7d,_0x970e('0xd2'));}var _0x2cf959=_0x1fab7d[_0x970e('0x2b')][_0x970e('0x55')](/(\r\n|\n|\r)/gm,'\x20');this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xd3'),_0x2cf959));var _0x5217d5=this[_0x970e('0x26')][_0x970e('0xa4')](this,_0x15bf75,_0x2cf959);this[_0x970e('0x30')][_0x970e('0xa4')](this,_0x1fab7d,_0x2cf959);if(!this['isConfigured'](_0x1fab7d[_0x970e('0xd4')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xd5'));}var _0x2b1141=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0x1fab7d[_0x970e('0xd4')]);if(!_0x2b1141){return this['channel'][_0x970e('0x4b')](_0x1fab7d,_0x970e('0xd6'));}var _0xd612e3=this;_0x5217d5[_0x970e('0xd7')](function(_0x7b5602,_0x4a994d){Object[_0x970e('0xd8')](_0x7b5602)[_0x970e('0xd7')](function(_0xf3edfc){_0xd612e3[_0x970e('0xc')]['setVariable'](util['format'](_0x970e('0xd9'),_0x2b1141,_0x4a994d,_0xf3edfc),_0x7b5602[_0xf3edfc]);});});this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')](_0x970e('0xda'),_0x2b1141),_0x5217d5[_0x970e('0x99')]);return this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0xdb'),_0x2b1141));};AGIVertices['prototype']['dial']=function(_0x5308fb){logger[_0x970e('0xdc')](util[_0x970e('0x24')](_0x970e('0xdd'),_0x5308fb[_0x970e('0xac')]));if(!this['isConfigured'](_0x5308fb[_0x970e('0xde')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x5308fb,_0x970e('0xdf'));}var _0xea2962=this[_0x970e('0xe0')][_0x970e('0xa4')](this,_0x5308fb['sip_id']);if(!_0xea2962){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x5308fb,_0x970e('0xe1'));}var _0x543d90=this['channel'][_0x970e('0x53')](_0x970e('0xe2'),[util['format'](_0x970e('0xe3'),_0xea2962),_0x5308fb['timeout'],_0x5308fb[_0x970e('0xe4')],_0x5308fb[_0x970e('0x63')]]);if(_0x543d90['result']===-0x1){return _0x543d90;}return this[_0x970e('0xc')][_0x970e('0xa7')](util['format'](_0x970e('0xe5'),_0x970e('0xe2')));};AGIVertices[_0x970e('0xf')][_0x970e('0xe6')]=function(_0x27b11c){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x27b11c['label']));if(!this[_0x970e('0x82')](_0x27b11c[_0x970e('0x79')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xe7'));}if(!this[_0x970e('0x82')](_0x27b11c[_0x970e('0x59')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20text\x20configured');}this[_0x970e('0xc')]['bot']=!![];this[_0x970e('0x30')](_0x27b11c);this[_0x970e('0x3d')](_0x27b11c['text'],'in','','');this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xe8'),_0x27b11c['text']));var _0x266916=this[_0x970e('0x78')][_0x970e('0xa4')](this,_0x27b11c);if(_0x266916){for(var _0x3147f1 in _0x266916){if(_0x266916['hasOwnProperty'](_0x3147f1)){this[_0x970e('0xc')]['setVariable'](util[_0x970e('0x24')](_0x970e('0xe9'),_0x3147f1[_0x970e('0x69')]()),_0x266916[_0x3147f1]);}}this[_0x970e('0x3d')](_0x266916['speech'],'out',_0x970e('0xe6'),'');return this['channel']['noop'](util['format']('Dialogflow\x20Result\x20%s',_0x266916['speech']));}return this['channel'][_0x970e('0x4b')](_0x27b11c,_0x970e('0xea'));};AGIVertices[_0x970e('0xf')]['dialogflowV2']=function(_0x25d77a){logger[_0x970e('0x29')](util['format']('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x25d77a[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x25d77a['dialogflowV2_project_id'])){return this['channel'][_0x970e('0xa7')](_0x970e('0xeb'));}if(!this[_0x970e('0x82')](_0x25d77a[_0x970e('0x7c')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xec'));}if(!this[_0x970e('0x82')](_0x25d77a[_0x970e('0x7d')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xed'));}if(!this[_0x970e('0x82')](_0x25d77a['dialogflowV2_language'])){return this[_0x970e('0xc')]['noop'](_0x970e('0xee'));}if(!this[_0x970e('0x82')](_0x25d77a[_0x970e('0x59')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20text\x20configured');}this['channel'][_0x970e('0xef')]=!![];this['createSquareDetailsReport'](_0x25d77a);this[_0x970e('0x3d')](_0x25d77a[_0x970e('0x59')],'in','','');this['channel']['noop'](util[_0x970e('0x24')](_0x970e('0xf0'),_0x25d77a[_0x970e('0x59')]));var _0x5327a1=this['googleDialogflowV2'][_0x970e('0xa4')](this,_0x25d77a);if(_0x5327a1){for(var _0x3b9cbe in _0x5327a1){if(_0x5327a1[_0x970e('0x96')](_0x3b9cbe)){if(_0x3b9cbe!=='providerResponse'){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')]('DIALOGFLOW_%s',_0x3b9cbe[_0x970e('0x69')]()),_0x5327a1[_0x3b9cbe]);}}}this[_0x970e('0x3d')](_0x5327a1[_0x970e('0xf1')],'out',_0x970e('0xf2'),_0x5327a1[_0x970e('0xf3')]);return this[_0x970e('0xc')]['noop'](util['format'](_0x970e('0xf4'),_0x5327a1[_0x970e('0xf1')]));}return this[_0x970e('0xc')][_0x970e('0x4b')](_0x25d77a,_0x970e('0xf5'));};AGIVertices[_0x970e('0xf')][_0x970e('0xf6')]=function(_0x5588c6){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x5588c6['label']));if(!this[_0x970e('0x82')](_0x5588c6['ndauth_url'])){return this['channel'][_0x970e('0xa7')](_0x970e('0xf7'));}if(!this[_0x970e('0x82')](_0x5588c6[_0x970e('0xf8')])){return this['channel'][_0x970e('0xa7')](_0x970e('0xf9'));}if(!this[_0x970e('0x82')](_0x5588c6[_0x970e('0xfa')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xfb'));}if(!this[_0x970e('0x82')](_0x5588c6[_0x970e('0xfc')])){return this[_0x970e('0xc')]['noop'](_0x970e('0xa8'));}this['channel'][_0x970e('0xef')]=!![];this['createSquareDetailsReport'](_0x5588c6);this[_0x970e('0x3d')](_0x5588c6[_0x970e('0x59')],'in','','');this['channel'][_0x970e('0xa7')](util['format'](_0x970e('0xfd'),_0x5588c6[_0x970e('0x59')]));var _0x7e0322=this[_0x970e('0x7e')][_0x970e('0xa4')](this,_0x5588c6);if(_0x7e0322){for(var _0x50f1d1 in _0x7e0322){if(_0x7e0322[_0x970e('0x96')](_0x50f1d1)){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')](_0x970e('0xfe'),_0x50f1d1[_0x970e('0x69')]()),_0x7e0322[_0x50f1d1]);}}this['createSquareMessage'](_0x7e0322[_0x970e('0xf1')],_0x970e('0xff'),_0x970e('0xf6'),'');if(_0x7e0322[_0x970e('0x100')]){this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x7e0322['audiofile']));var _0x13d202=this[_0x970e('0xc')][_0x970e('0x101')](_0x7e0322['audiofile']);try{fs[_0x970e('0x102')](_0x7e0322[_0x970e('0x100')]+_0x970e('0x103'));}catch(_0x30ca17){logger[_0x970e('0x4b')](_0x30ca17);}return _0x13d202;}else{return this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0x104'),_0x7e0322['speech']));}}return this[_0x970e('0xc')][_0x970e('0x4b')](_0x5588c6,_0x970e('0x105'));};AGIVertices[_0x970e('0xf')][_0x970e('0x106')]=function(_0x34ccc5){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20END\x20(%s)\x20block',_0x34ccc5['label']));return this[_0x970e('0xc')]['noop'](_0x970e('0x106'));};AGIVertices[_0x970e('0xf')][_0x970e('0x107')]=function(_0x5ca2fc){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x108'),_0x5ca2fc['label']));var _0x1e791f='';if(_0x5ca2fc[_0x970e('0x109')]){if(!this['isConfigured'](_0x5ca2fc[_0x970e('0x109')])){return this[_0x970e('0xc')]['error'](_0x5ca2fc,_0x970e('0x10a'));}else{var _0x479a27=parseInt(_0x5ca2fc[_0x970e('0x109')],0xa);if(isNaN(_0x479a27)){_0x1e791f=_0x5ca2fc[_0x970e('0x109')];}else{_0x1e791f=this['getTrunk'][_0x970e('0xa4')](this,_0x5ca2fc[_0x970e('0x109')]);if(!_0x1e791f){return this['channel'][_0x970e('0x4b')](_0x5ca2fc,'no\x20trunk\x20found');}}}}else if(_0x5ca2fc[_0x970e('0x10b')]){_0x1e791f=_0x5ca2fc['trunk_name'];}else{return this[_0x970e('0xc')]['error'](_0x5ca2fc,_0x970e('0x10a'));}var _0x461ace=this[_0x970e('0xc')][_0x970e('0x53')]('DIAL',[util[_0x970e('0x24')](_0x970e('0x10c'),_0x1e791f,_0x5ca2fc[_0x970e('0x44')]),_0x5ca2fc['timeout'],_0x5ca2fc[_0x970e('0xe4')],_0x5ca2fc['url']]);if(_0x461ace[_0x970e('0xa1')]===-0x1){return _0x461ace;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0xe5'),_0x970e('0xe2')));};AGIVertices[_0x970e('0xf')][_0x970e('0x10d')]=function(_0x885fe6){logger['info'](util['format'](_0x970e('0x10e'),_0x885fe6[_0x970e('0xac')]));return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0x10d'));};AGIVertices[_0x970e('0xf')][_0x970e('0x10f')]=function(_0xa22462){logger[_0x970e('0x29')](util['format'](_0x970e('0x110'),_0xa22462[_0x970e('0xac')]));if(_0xa22462['retry']===0x0){return this[_0x970e('0xa3')](_0xa22462);}_0xa22462[_0x970e('0xa5')]-=0x1;if(!this[_0x970e('0x82')](_0xa22462[_0x970e('0x111')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0xa22462,_0x970e('0x112'));}var _0x8bfc82=this['getSound'][_0x970e('0xa4')](this,_0xa22462[_0x970e('0x111')]);if(!_0x8bfc82){return this[_0x970e('0xc')][_0x970e('0x4b')](_0xa22462,'no\x20file\x20audio\x20found');}if(!this[_0x970e('0x82')](_0xa22462[_0x970e('0xd4')])){return this['channel'][_0x970e('0x4b')](_0x970e('0xd5'));}var _0x3811b9=this[_0x970e('0xc')][_0x970e('0x113')](_0x8bfc82,_0xa22462[_0x970e('0x114')],_0xa22462[_0x970e('0x115')]);var _0xc62894=_0x3811b9[_0x970e('0xa1')]?_0x3811b9[_0x970e('0xa1')][_0x970e('0x47')]():'';logger[_0x970e('0x29')](_0x970e('0x116'),JSON['stringify'](_0x3811b9));if(_0x3811b9['result']===-0x1){this[_0x970e('0x30')]['sync'](this,_0xa22462,_0xc62894);return _0x3811b9;}else if(_0x3811b9[_0x970e('0x9f')]===_0x970e('0x65')){_0x3811b9[_0x970e('0xa1')]=_0xc62894[_0x970e('0x99')]>=parseInt(_0xa22462[_0x970e('0x117')])?'x':'i';}else{_0x3811b9[_0x970e('0xa1')]=_0xc62894[_0x970e('0x99')]>=parseInt(_0xa22462[_0x970e('0x117')])&&_0xc62894[_0x970e('0x99')]<=parseInt(_0xa22462[_0x970e('0x115')])?'x':'i';}var _0xb0a3ba=this['getVariable']['sync'](this,_0xa22462[_0x970e('0xd4')]);if(!_0xb0a3ba){return this['channel'][_0x970e('0x4b')](_0xa22462,_0x970e('0xd6'));}this[_0x970e('0xc')]['setVariable'](_0xb0a3ba,_0xc62894);if(this[_0x970e('0x82')](_0xa22462[_0x970e('0x118')])){var _0x17f322=parseInt(_0xa22462[_0x970e('0x118')],0xa);var _0x3f2d3e=rs[_0x970e('0x119')]({'charset':'*','length':_0x17f322});var _0x495c38=_0xc62894[_0x970e('0x99')];if(_0x495c38>0x0){if(_0x495c38>_0x17f322){this['createSquareDetailsReport']['sync'](this,_0xa22462,_0xa22462['hiddendigitspos']===_0x970e('0x11a')?_0x3f2d3e+_0xc62894['substr'](_0x17f322):_0xc62894[_0x970e('0x11b')](0x0,_0x495c38-_0x17f322)+_0x3f2d3e);}else{this[_0x970e('0x30')][_0x970e('0xa4')](this,_0xa22462,rs[_0x970e('0x119')]({'charset':'*','length':_0x495c38}));}}else{this[_0x970e('0x30')][_0x970e('0xa4')](this,_0xa22462,'');}}else{this['createSquareDetailsReport'][_0x970e('0xa4')](this,_0xa22462,_0xc62894);}return _0x3811b9;};AGIVertices['prototype']['getsecretdigits']=function(_0x5abc36){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x11c'),_0x5abc36[_0x970e('0xac')]));return this['getdigits'](_0x5abc36);};AGIVertices['prototype'][_0x970e('0x11d')]=function(_0x48ea78){logger['info'](util[_0x970e('0x24')](_0x970e('0x11e'),_0x48ea78[_0x970e('0xac')]));this['createSquareDetailsReport'][_0x970e('0xa4')](this,_0x48ea78,_0x48ea78[_0x970e('0x11f')]);return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('GOAL\x20%s',_0x48ea78['goalname']));};AGIVertices[_0x970e('0xf')][_0x970e('0x120')]=function(_0x504d8e){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x121'),_0x504d8e[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x504d8e['aws_access_key_id'])||!this['isConfigured'](_0x504d8e[_0x970e('0x89')])){return this['channel'][_0x970e('0xa7')](_0x970e('0x122'));}if(!this[_0x970e('0x82')](_0x504d8e[_0x970e('0x59')])){return this['channel'][_0x970e('0xa7')]('no\x20text\x20configured');}this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x123'),_0x504d8e[_0x970e('0x59')]));var _0x42ef34=this[_0x970e('0x84')][_0x970e('0xa4')](this,_0x504d8e);if(_0x42ef34){this[_0x970e('0xc')]['noop'](util['format'](_0x970e('0x124'),_0x42ef34));var _0x573ea8=this['channel'][_0x970e('0x101')](_0x42ef34);try{fs['unlink'](_0x42ef34+_0x970e('0x103'));}catch(_0x1eb526){logger['error'](_0x1eb526);}return _0x573ea8;}return this[_0x970e('0xc')][_0x970e('0x4b')](_0x504d8e,_0x970e('0x125'));};AGIVertices['prototype'][_0x970e('0x126')]=function(_0x4cab8a){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x127'),_0x4cab8a[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x4cab8a[_0x970e('0x85')])||!this[_0x970e('0x82')](_0x4cab8a[_0x970e('0x89')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0x122'));}if(!this[_0x970e('0x82')](_0x4cab8a[_0x970e('0x8b')])){return this['channel'][_0x970e('0xa7')](_0x970e('0x128'));}if(!this[_0x970e('0x82')](_0x4cab8a[_0x970e('0x59')])){return this['channel']['noop'](_0x970e('0xa8'));}this[_0x970e('0xc')]['bot']=!![];this['createSquareDetailsReport'](_0x4cab8a);this[_0x970e('0x3d')](_0x4cab8a[_0x970e('0x59')],'in','','');this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('Trying\x20Amazon\x20Lex:\x20%s',_0x4cab8a[_0x970e('0x59')]));var _0x224c3f=this[_0x970e('0x88')][_0x970e('0xa4')](this,_0x4cab8a);if(_0x224c3f){for(var _0x53f35f in _0x224c3f){if(_0x224c3f[_0x970e('0x96')](_0x53f35f)&&_[_0x970e('0x92')](_0x224c3f[_0x53f35f])){this['channel'][_0x970e('0x9c')](util['format'](_0x970e('0x129'),_0x53f35f[_0x970e('0x69')]()),_0x224c3f[_0x53f35f]);}}if(_['isNil'](_0x224c3f[_0x970e('0x75')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x970e('0x3d')](_0x224c3f[_0x970e('0x75')],_0x970e('0xff'),_0x970e('0x12a'),'');return this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x12b'),_0x224c3f[_0x970e('0x75')]));}}return this[_0x970e('0xc')][_0x970e('0x4b')](_0x4cab8a,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x970e('0xf')][_0x970e('0x12c')]=function(_0x5a76a2){logger['info'](util[_0x970e('0x24')](_0x970e('0x12d'),_0x5a76a2[_0x970e('0xac')],_0x5a76a2[_0x970e('0x65')]));if(!this[_0x970e('0x82')](_0x5a76a2['key'])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20key\x20configured');}var _0x1c1165='wav';var _0x339b3c=util[_0x970e('0x24')](_0x970e('0x12e'),FILES_PATH,rs['generate'](0x4));var _0x390592=util['format'](_0x970e('0x9b'),_0x339b3c,_0x1c1165);var _0x195059=!![];if(_0x5a76a2[_0x970e('0x12f')]===_0x970e('0x130')){_0x195059=![];}var _0x478420=this[_0x970e('0xc')]['recordFile'](_0x339b3c,_0x1c1165,_0x5a76a2['intKey'],_0x5a76a2[_0x970e('0x65')],undefined,_0x195059);if(_0x478420[_0x970e('0xa1')]!==-0x1){this['channel'][_0x970e('0xa7')](util['format'](_0x970e('0x131'),_0x390592));var _0x46206e=this[_0x970e('0x8c')][_0x970e('0xa4')](this,_0x5a76a2,_0x390592);if(_0x46206e){for(var _0x2e626f in _0x46206e){if(_0x46206e[_0x970e('0x96')](_0x2e626f)){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')]('GOOGLE_ASR_%s',_0x2e626f[_0x970e('0x69')]()),_0x46206e[_0x2e626f]);}}return this[_0x970e('0xc')][_0x970e('0xa7')](util['format'](_0x970e('0x132'),JSON[_0x970e('0x71')](_0x46206e)));}}return _0x478420;};AGIVertices[_0x970e('0xf')][_0x970e('0x133')]=function(_0x538c7a){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x134'),_0x538c7a[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x538c7a[_0x970e('0x8f')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0x135'));}if(!this[_0x970e('0x82')](_0x538c7a[_0x970e('0x136')])){return this['channel'][_0x970e('0xa7')](_0x970e('0x137'));}var _0x23d76e=_0x970e('0x138');var _0x50c43e=util[_0x970e('0x24')](_0x970e('0x12e'),FILES_PATH,rs[_0x970e('0x119')](0x4));var _0x51e520=util['format'](_0x970e('0x9b'),_0x50c43e,_0x23d76e);var _0x54b84c=!![];if(_0x538c7a[_0x970e('0x12f')]===_0x970e('0x130')){_0x54b84c=![];}var _0x161e47=this['channel'][_0x970e('0x139')](_0x50c43e,_0x23d76e,_0x538c7a['intKey'],_0x538c7a['timeout'],undefined,_0x54b84c);if(_0x161e47[_0x970e('0xa1')]!==-0x1){this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0x13a'),_0x51e520));var _0x53870a=this[_0x970e('0x8e')][_0x970e('0xa4')](this,_0x538c7a,_0x51e520);if(_0x53870a){for(var _0x23c3c3 in _0x53870a){if(_0x53870a[_0x970e('0x96')](_0x23c3c3)){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')](_0x970e('0x13b'),_0x23c3c3[_0x970e('0x69')]()),_0x53870a[_0x23c3c3]);}}return this[_0x970e('0xc')][_0x970e('0xa7')](util['format'](_0x970e('0x13c'),JSON[_0x970e('0x71')](_0x53870a)));}}return _0x161e47;};AGIVertices['prototype'][_0x970e('0x13d')]=function(_0x50000d){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x50000d[_0x970e('0xac')]));return this[_0x970e('0xc')][_0x970e('0x13e')](_0x50000d[_0x970e('0x37')],_0x50000d[_0x970e('0x38')],_0x50000d[_0x970e('0x39')]);};AGIVertices['prototype'][_0x970e('0x13f')]=function(_0x95934b){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x140'),_0x95934b[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x95934b[_0x970e('0x141')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x95934b,_0x970e('0x142'));}try{var _0x24e893=eval(_0x95934b[_0x970e('0x141')])?_0x970e('0x143'):_0x970e('0x144');this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0x145'),_0x95934b[_0x970e('0x141')],_0x24e893));return{'code':0xc8,'result':_0x24e893};}catch(_0x540491){return{'code':0xc8,'result':_0x970e('0x144')};}};AGIVertices['prototype'][_0x970e('0x146')]=function(_0x287949){logger['info'](util[_0x970e('0x24')](_0x970e('0x147'),_0x287949[_0x970e('0xac')]));if(!this['isConfigured'](_0x287949['interval_id'])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x287949,'no\x20interval\x20configured');}var _0x309833=this[_0x970e('0x148')][_0x970e('0xa4')](this,_0x287949['interval_id']);if(!_0x309833){return this['channel'][_0x970e('0x4b')](_0x287949,_0x970e('0x149'));}for(var _0x24835e=0x0;_0x24835e<_0x309833[_0x970e('0x99')];_0x24835e+=0x1){var _0x4c9839=this['channel'][_0x970e('0x10')](util[_0x970e('0x24')](_0x970e('0x14a'),_0x309833[_0x24835e]));if(_0x4c9839[_0x970e('0xa1')]===-0x1){return _0x4c9839;}logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x14b'),_0x309833[_0x24835e],_0x4c9839[_0x970e('0x9f')]));if(_0x4c9839[_0x970e('0x9f')]===_0x970e('0x143')){logger[_0x970e('0x29')](util['format'](_0x970e('0x14b'),_0x309833[_0x24835e],'true'));this['channel'][_0x970e('0xa7')](util['format'](_0x970e('0x14b'),_0x309833[_0x24835e],_0x970e('0x143')));return{'code':0xc8,'result':_0x970e('0x143')};}else{logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x14b'),_0x309833[_0x24835e],_0x970e('0x144')));this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('IFTIME\x20%s\x20%s',_0x309833[_0x24835e],_0x970e('0x144')));}}return{'code':0xc8,'result':_0x970e('0x144')};};AGIVertices['prototype'][_0x970e('0x14c')]=function(_0x42ccb1){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x14d'),_0x42ccb1[_0x970e('0xac')]));return this['channel']['hangup']();};AGIVertices['prototype']['ispeechasr']=function(_0x327cd2){logger[_0x970e('0x29')](util['format']('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x327cd2[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x327cd2[_0x970e('0x79')])){return this[_0x970e('0xc')]['noop'](_0x970e('0xe7'));}var _0x4ac09a=_0x970e('0x138');var _0x12ebcb=util[_0x970e('0x24')](_0x970e('0x12e'),FILES_PATH,rs[_0x970e('0x119')](0x4));var _0x296a11=util['format']('%s.%s',_0x12ebcb,_0x4ac09a);var _0x52ad99=!![];if(_0x327cd2['beep']===_0x970e('0x130')){_0x52ad99=![];}var _0x560177=this['channel']['recordFile'](_0x12ebcb,_0x4ac09a,_0x327cd2[_0x970e('0x14e')],_0x327cd2[_0x970e('0x65')],undefined,_0x52ad99);if(_0x560177[_0x970e('0xa1')]!==-0x1){this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x14f'),_0x296a11));var _0x24ff21=this[_0x970e('0x80')][_0x970e('0xa4')](this,_0x327cd2,_0x296a11);if(_0x24ff21){for(var _0x285dde in _0x24ff21){if(_0x24ff21['hasOwnProperty'](_0x285dde)){this[_0x970e('0xc')][_0x970e('0x9c')](util[_0x970e('0x24')](_0x970e('0x150'),_0x285dde[_0x970e('0x69')]()),_0x24ff21[_0x285dde]);}}return this['channel'][_0x970e('0xa7')](util['format']('IspeechASR\x20Result\x20%s',JSON[_0x970e('0x71')](_0x24ff21)));}}return _0x560177;};AGIVertices[_0x970e('0xf')][_0x970e('0x151')]=function(_0x13dcff){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x152'),_0x13dcff[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x13dcff['key'])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xe7'));}if(!this[_0x970e('0x82')](_0x13dcff[_0x970e('0x59')])){return this[_0x970e('0xc')]['noop'](_0x970e('0xa8'));}this[_0x970e('0xc')][_0x970e('0xa7')](util['format']('Trying\x20ispeech\x20TTS\x20%s',_0x13dcff[_0x970e('0x59')]));var _0x38c0aa=this['ispeechTTS'][_0x970e('0xa4')](this,_0x13dcff);if(_0x38c0aa){this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0x14f'),_0x38c0aa));var _0x476e17=this[_0x970e('0xc')][_0x970e('0x101')](_0x38c0aa,_0x13dcff[_0x970e('0x14e')]);try{fs[_0x970e('0x102')](_0x38c0aa+_0x970e('0x103'));}catch(_0x1a96cc){logger[_0x970e('0x4b')](_0x1a96cc);}return _0x476e17;}return this['channel'][_0x970e('0x4b')](_0x13dcff,_0x970e('0x153'));};AGIVertices[_0x970e('0xf')][_0x970e('0x154')]=function(_0x30aaac){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x155'),_0x30aaac[_0x970e('0xac')]));if(!this['isConfigured'](_0x30aaac[_0x970e('0x156')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x30aaac,_0x970e('0x157'));}logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x158'),this[_0x970e('0xc')][_0x970e('0x34')],_0x30aaac[_0x970e('0x156')]));var _0x262b5c=this[_0x970e('0x4f')][_0x970e('0xa4')](this,_0x30aaac[_0x970e('0x156')]);if(_0x262b5c){logger[_0x970e('0x29')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x970e('0x34')],_0x30aaac[_0x970e('0x156')]));this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x970e('0x34')],_0x30aaac[_0x970e('0x156')]));return{'code':0xc8,'result':_0x970e('0x159')};}else{logger['info'](util[_0x970e('0x24')](_0x970e('0x15a'),this[_0x970e('0xc')]['callerid'],_0x30aaac['findBy']));this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x15a'),this['channel'][_0x970e('0x34')],_0x30aaac[_0x970e('0x156')]));return{'code':0xc8,'result':_0x970e('0x15b')};}};AGIVertices[_0x970e('0xf')][_0x970e('0x15c')]=function(_0x2bcf11){logger[_0x970e('0x29')](util['format'](_0x970e('0x15d'),_0x2bcf11[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x2bcf11[_0x970e('0x156')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x2bcf11,_0x970e('0x157'));}logger['info'](util[_0x970e('0x24')](_0x970e('0x158'),this[_0x970e('0xc')][_0x970e('0x34')],_0x2bcf11[_0x970e('0x156')]));var _0x168884=this['agentLogout']['sync'](this,_0x2bcf11[_0x970e('0x156')]);if(_0x168884){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x15e'),this['channel']['callerid'],_0x2bcf11[_0x970e('0x156')]));this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x970e('0x34')],_0x2bcf11['findBy']));return{'code':0xc8,'result':_0x970e('0x159')};}else{logger[_0x970e('0x29')](util['format'](_0x970e('0x15a'),this['channel']['callerid'],_0x2bcf11[_0x970e('0x156')]));this[_0x970e('0xc')][_0x970e('0xa7')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x2bcf11[_0x970e('0x156')]));return{'code':0xc8,'result':_0x970e('0x15b')};}};AGIVertices['prototype'][_0x970e('0x15f')]=function(_0x35204a){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x160'),_0x35204a[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x35204a[_0x970e('0x161')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x35204a,_0x970e('0x162'));}this['channel']['noop'](util[_0x970e('0x24')](_0x970e('0x163'),_0x35204a['operation']));var _0x5ebd13=eval(_0x35204a['operation']);if(!this[_0x970e('0x82')](_0x35204a['variable_id'])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xd5'));}var _0x33b6ec=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0x35204a[_0x970e('0xd4')]);if(!_0x33b6ec){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x35204a,_0x970e('0xd6'));}if(_[_0x970e('0x98')](_0x5ebd13)){var _0x117614=this;_0x5ebd13['forEach'](function(_0x346314,_0x10630c){_0x117614[_0x970e('0xc')]['setVariable'](util[_0x970e('0x24')](_0x970e('0x164'),_0x33b6ec,_0x10630c),_0x346314);});return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x165'),_0x33b6ec));}else{return this['channel'][_0x970e('0x9c')](_0x33b6ec,_0x5ebd13);}};AGIVertices['prototype'][_0x970e('0xb')]=function(_0xeb4a0){logger[_0x970e('0x29')](util['format'](_0x970e('0x166'),_0xeb4a0[_0x970e('0xac')]));if(_0xeb4a0[_0x970e('0xa5')]===0x0){return this[_0x970e('0xa3')](_0xeb4a0);}_0xeb4a0[_0x970e('0xa5')]-=0x1;if(!this[_0x970e('0x82')](_0xeb4a0['file_id'])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0xeb4a0,_0x970e('0x112'));}var _0x32ae77=this[_0x970e('0x19')]['sync'](this,_0xeb4a0[_0x970e('0x111')]);if(!_0x32ae77){return this[_0x970e('0xc')][_0x970e('0x4b')](_0xeb4a0,'no\x20file\x20audio\x20found');}var _0x3e1027=this[_0x970e('0xc')][_0x970e('0x113')](_0x32ae77,_0xeb4a0[_0x970e('0x114')],_0xeb4a0['digit']);var _0x20eff9=_0x3e1027[_0x970e('0xa1')];if(_0x3e1027[_0x970e('0xa1')]===-0x1){this[_0x970e('0x30')][_0x970e('0xa4')](this,_0xeb4a0,'-1');return _0x3e1027;}else if(_0x3e1027[_0x970e('0x9f')]==='timeout'){_0x3e1027['result']=_0x3e1027['result'][_0x970e('0x99')]>0x0?_0x3e1027[_0x970e('0xa1')]:'t';}else if(_[_0x970e('0x3f')](_0x3e1027[_0x970e('0xa1')])){_0x3e1027['result']='#';_0x20eff9='#';}if(!this['isConfigured'](_0xeb4a0[_0x970e('0xd4')])){this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xd5'));}else{var _0x4b508e=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0xeb4a0[_0x970e('0xd4')]);if(!_0x4b508e){return this[_0x970e('0xc')][_0x970e('0x4b')](_0xeb4a0,_0x970e('0xd6'));}this[_0x970e('0xc')][_0x970e('0x9c')](_0x4b508e,_0x20eff9);}this['createSquareDetailsReport'][_0x970e('0xa4')](this,_0xeb4a0,_0x20eff9);return _0x3e1027;};AGIVertices[_0x970e('0xf')][_0x970e('0xa7')]=function(_0x560e2a){logger['info'](util[_0x970e('0x24')](_0x970e('0x167'),_0x560e2a[_0x970e('0xac')]));return this[_0x970e('0xc')][_0x970e('0xa7')](_0x560e2a[_0x970e('0x168')]||_0x560e2a[_0x970e('0xac')]);};AGIVertices[_0x970e('0xf')][_0x970e('0x169')]=function(_0x9fd0db){logger[_0x970e('0x29')](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x9fd0db[_0x970e('0xac')]));if(!this['isConfigured'](_0x9fd0db[_0x970e('0x156')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x9fd0db,'no\x20find\x20by\x20configured');}logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x158'),this[_0x970e('0xc')][_0x970e('0x34')],_0x9fd0db['findBy']));var _0x48961d=this[_0x970e('0x49')]['sync'](this,_0x9fd0db[_0x970e('0x16a')]);var _0x5e1409=this[_0x970e('0x4a')][_0x970e('0xa4')](this,_0x9fd0db[_0x970e('0x156')],_0x48961d);if(_0x5e1409){logger[_0x970e('0x29')](util['format'](_0x970e('0x15e'),this[_0x970e('0xc')][_0x970e('0x34')],_0x9fd0db['findBy']));this[_0x970e('0xc')]['noop'](util['format'](_0x970e('0x15e'),this[_0x970e('0xc')][_0x970e('0x34')],_0x9fd0db[_0x970e('0x156')]));return{'code':0xc8,'result':'success'};}else{logger[_0x970e('0x29')](util[_0x970e('0x24')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x970e('0xc')]['callerid'],_0x9fd0db[_0x970e('0x156')]));this[_0x970e('0xc')][_0x970e('0xa7')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x970e('0xc')]['callerid'],_0x9fd0db[_0x970e('0x156')]));return{'code':0xc8,'result':_0x970e('0x15b')};}};AGIVertices[_0x970e('0xf')][_0x970e('0x16b')]=function(_0x2bfd4b){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x2bfd4b[_0x970e('0xac')]));if(!this['isConfigured'](_0x2bfd4b[_0x970e('0x111')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x2bfd4b,_0x970e('0x112'));}var _0x476b10=this['getSound']['sync'](this,_0x2bfd4b[_0x970e('0x111')]);if(!_0x476b10){return this[_0x970e('0xc')]['error'](_0x2bfd4b,_0x970e('0x16c'));}var _0x4bdb2e=this['channel'][_0x970e('0x53')](_0x970e('0x16d'),[_0x476b10,_0x2bfd4b[_0x970e('0xe4')]]);if(_0x4bdb2e[_0x970e('0xa1')]===-0x1){return _0x4bdb2e;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('Executed\x20command\x20%s\x20%s',_0x970e('0x16d'),_0x476b10));};AGIVertices[_0x970e('0xf')][_0x970e('0x16e')]=function(_0x341fca){logger['info'](util['format'](_0x970e('0x16f'),_0x341fca[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x341fca[_0x970e('0x170')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x341fca,_0x970e('0x171'));}var _0x3cca23='';var _0x29bbac=parseInt(_0x341fca[_0x970e('0x170')],0xa);if(isNaN(_0x29bbac)){_0x3cca23=_0x341fca[_0x970e('0x170')];}else{_0x3cca23=this[_0x970e('0x15')][_0x970e('0xa4')](this,_0x341fca[_0x970e('0x170')]);if(!_0x3cca23){return this[_0x970e('0xc')]['error'](_0x341fca,'no\x20queue\x20found');}}var _0x3fb4fd='';if(this['isConfigured'](_0x341fca[_0x970e('0x111')])){var _0x2ad5c8=this['getSound']['sync'](this,_0x341fca['file_id']);if(_0x2ad5c8){_0x3fb4fd=_0x2ad5c8;}}this[_0x970e('0x30')]['sync'](this,_0x341fca,_0x3cca23);if(_0x341fca[_0x970e('0xe4')][_0x970e('0x172')]('x')<0x0){_0x341fca[_0x970e('0xe4')]+='x';}if(_0x341fca[_0x970e('0xe4')]['indexOf']('X')<0x0){_0x341fca[_0x970e('0xe4')]+='X';}this['channel'][_0x970e('0x9c')](_0x970e('0x173'),_0x3cca23?_0x3cca23[_0x970e('0x174')]():'');var _0x1bd74f=this[_0x970e('0xc')][_0x970e('0x53')](_0x970e('0x175'),[_0x3cca23,_0x341fca[_0x970e('0xe4')],_0x341fca['url'],_0x3fb4fd,_0x341fca[_0x970e('0x65')],_0x341fca[_0x970e('0xb3')],_0x341fca[_0x970e('0x176')],_0x341fca[_0x970e('0x177')],'',_0x341fca[_0x970e('0x178')]]);if(_0x1bd74f[_0x970e('0xa1')]===-0x1){return _0x1bd74f;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x179'),_0x970e('0x175'),_0x3cca23));};AGIVertices['prototype'][_0x970e('0x17a')]=function(_0xf61d22){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x17b'),_0xf61d22[_0x970e('0xac')]));var _0x5852cb=_0xf61d22[_0x970e('0x17c')]||_0x970e('0x138');var _0x5f266f=util[_0x970e('0x24')](_0x970e('0x17d'),this[_0x970e('0xc')][_0x970e('0x31')],rs[_0x970e('0x119')](0x5));var _0x10ca3d=util[_0x970e('0x24')](_0x970e('0x17e'),FILES_PATH,_0x5f266f,_0x5852cb);var _0x1e0f2d=util[_0x970e('0x24')](_0x970e('0x12e'),FILES_PATH,_0x5f266f);this['createSquareRecording'][_0x970e('0xa4')](this,_0xf61d22,_0x5f266f,_0x10ca3d);this[_0x970e('0xc')][_0x970e('0x9c')](_0x970e('0x17f'),_0x5f266f);logger[_0x970e('0x29')](_0x970e('0x180'),_0x1e0f2d,_0x5852cb,_0xf61d22[_0x970e('0x181')],_0xf61d22['timeout']);return this[_0x970e('0xc')][_0x970e('0x139')](_0x1e0f2d,_0x5852cb,_0xf61d22['escape_digits'],_0xf61d22[_0x970e('0x65')],undefined,!![]);};AGIVertices[_0x970e('0xf')]['restapi']=function(_0xce6e84){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x182'),_0xce6e84[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0xce6e84['url'])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0x183'));}var _0x1a0087=this[_0x970e('0x62')][_0x970e('0xa4')](this,_0xce6e84);logger['info'](util[_0x970e('0x24')](_0x970e('0x184'),util[_0x970e('0x185')](_0x1a0087,{'showHidden':![],'depth':null})));if(!this[_0x970e('0x82')](_0xce6e84['variable_id'])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x7b0704=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0xce6e84[_0x970e('0xd4')]);if(!_0x7b0704){return this[_0x970e('0xc')]['error'](_0xce6e84,'no\x20variable\x20found');}this[_0x970e('0xc')][_0x970e('0x9c')](util['format']('%s_STATUS_CODE',_0x7b0704),_0x1a0087[_0x970e('0x73')]?_0x1a0087['statusCode']:_0x970e('0x186'));this['channel']['setVariable'](util[_0x970e('0x24')](_0x970e('0x187'),_0x7b0704),_0x1a0087[_0x970e('0x74')]?_0x1a0087[_0x970e('0x74')]:'OK');if(_0x1a0087[_0x970e('0x6a')]){try{this[_0x970e('0x9a')](_0x1a0087['body'],_0x7b0704);}catch(_0x4d9876){logger['error'](util[_0x970e('0x24')]('Unable\x20to\x20set\x20result\x20in\x20variable\x20%s',_0x7b0704));}}return this[_0x970e('0xc')]['noop'](util['format'](_0x970e('0xdb'),_0x7b0704));};AGIVertices['prototype'][_0x970e('0x188')]=function(_0x30d463){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x189'),_0x30d463[_0x970e('0xac')]));return this[_0x970e('0xc')]['sayDigits'](_0x30d463['digits']['replace'](/\s+/g,''),_0x30d463[_0x970e('0x181')]);};AGIVertices['prototype']['saynumber']=function(_0x28e5b5){logger['info'](util[_0x970e('0x24')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x28e5b5[_0x970e('0xac')]));return this[_0x970e('0xc')][_0x970e('0x18a')](_0x28e5b5[_0x970e('0x66')][_0x970e('0x55')](/\s+/g,''),_0x28e5b5[_0x970e('0x181')]);};AGIVertices['prototype'][_0x970e('0x18b')]=function(_0x338189){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x338189[_0x970e('0xac')]));return this[_0x970e('0xc')]['sayPhonetic'](_0x338189[_0x970e('0x59')],_0x338189[_0x970e('0x181')]);};AGIVertices[_0x970e('0xf')][_0x970e('0x18c')]=function(_0x33c0a7){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x18d'),_0x33c0a7['label']));if(!this['isConfigured'](_0x33c0a7[_0x970e('0x18e')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0x18f'));}var _0x184f91=this[_0x970e('0x1d')][_0x970e('0xa4')](this,_0x33c0a7[_0x970e('0x18e')]);if(!_0x184f91||!_0x184f91[_0x970e('0x190')]){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x33c0a7,'no\x20mail\x20account\x20found');}var _0x2350f5={'from':util[_0x970e('0x24')](_0x970e('0x191'),_0x184f91[_0x970e('0x13')],_0x184f91[_0x970e('0x192')]||_0x184f91[_0x970e('0x190')][_0x970e('0x193')]),'to':_0x33c0a7['to']||'','cc':_0x33c0a7['cc']||'','bcc':_0x33c0a7[_0x970e('0x194')]||'','subject':_0x33c0a7[_0x970e('0x195')],'html':_0x33c0a7[_0x970e('0x59')],'text':_0x33c0a7[_0x970e('0x59')]};var _0x21fb1e={'tls':{'rejectUnauthorized':![]}};if(_0x184f91[_0x970e('0x190')]['service']){_0x21fb1e[_0x970e('0x196')]=_0x184f91['Smtp'][_0x970e('0x196')];}else{_0x21fb1e[_0x970e('0x197')]=_0x184f91[_0x970e('0x190')][_0x970e('0x197')];_0x21fb1e[_0x970e('0x198')]=_0x184f91['Smtp'][_0x970e('0x198')];_0x21fb1e['secure']=_0x184f91[_0x970e('0x190')][_0x970e('0x199')];}if(_0x184f91[_0x970e('0x190')][_0x970e('0x19a')]){_0x21fb1e[_0x970e('0x19b')]={'user':_0x184f91['Smtp'][_0x970e('0x193')],'pass':_0x184f91[_0x970e('0x190')][_0x970e('0x19c')]};}if(this['isConfigured'](_0x33c0a7['template_id'])){}logger['debug']('sendMail\x20message',JSON['stringify'](_0x2350f5));this[_0x970e('0x30')][_0x970e('0xa4')](this,_0x33c0a7,_0x33c0a7[_0x970e('0x18e')]);this[_0x970e('0xc')]['noop'](util[_0x970e('0x24')](_0x970e('0x19d'),_0x184f91[_0x970e('0x13')]));this['sendMailMessage']['sync'](this,_0x21fb1e,_0x2350f5);return this[_0x970e('0xc')][_0x970e('0xa7')]('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x970e('0xf')][_0x970e('0x19e')]=function(_0x4eb7ac){logger[_0x970e('0x29')](util[_0x970e('0x24')]('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x4eb7ac[_0x970e('0xac')]));return this[_0x970e('0xc')]['noop'](_0x970e('0x19f'));};AGIVertices[_0x970e('0xf')][_0x970e('0x1a0')]=function(_0x5a6b5e){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x1a1'),_0x5a6b5e[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x5a6b5e[_0x970e('0x1a2')])){return this[_0x970e('0xc')][_0x970e('0xa7')]('no\x20sms\x20account\x20configured');}var _0x162fc1=this[_0x970e('0x1a3')][_0x970e('0xa4')](this,_0x5a6b5e[_0x970e('0x1a2')]);if(!_0x162fc1){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x5a6b5e,_0x970e('0x1a4'));}var _0x17fb39={'body':_0x5a6b5e[_0x970e('0x1a5')],'phone':_0x5a6b5e['to']||'','SmsAccountId':_0x162fc1['id']};logger['debug']('sendSMS\x20message',JSON[_0x970e('0x71')](_0x17fb39));this[_0x970e('0x30')]['sync'](this,_0x5a6b5e,_0x5a6b5e[_0x970e('0x1a2')]);this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1a6'),_0x162fc1[_0x970e('0x13')]));this[_0x970e('0x2f')][_0x970e('0xa4')](this,_0x17fb39);return this['channel']['noop'](_0x970e('0x1a7'));};AGIVertices[_0x970e('0xf')][_0x970e('0x1a8')]=function(_0x53aab7){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x1a9'),_0x53aab7[_0x970e('0xac')]));if(!this['isConfigured'](_0x53aab7[_0x970e('0xd4')])){return this[_0x970e('0xc')]['error'](_0x53aab7,'no\x20variable\x20selected');}var _0x5e8221=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0x53aab7[_0x970e('0xd4')]);if(!_0x5e8221){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x53aab7,'no\x20variable\x20found');}return this[_0x970e('0xc')][_0x970e('0x9c')](_0x5e8221,_0x53aab7[_0x970e('0x1aa')]);};AGIVertices[_0x970e('0xf')][_0x970e('0x1ab')]=function(_0x524b31){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x1ac'),_0x524b31[_0x970e('0xac')]));this['channel'][_0x970e('0xa7')](_0x970e('0x1ad'));if(_0x524b31[_0x970e('0xb9')]===_0x970e('0x1ae')){this[_0x970e('0xc')]['noop'](_0x970e('0x1af'));return this['channel'][_0x970e('0xb9')]();}return this[_0x970e('0xc')][_0x970e('0xa7')]('Skipped\x20Answer');};AGIVertices[_0x970e('0xf')]['subproject']=function(_0x44c8e8){logger['info'](util['format'](_0x970e('0x1b0'),_0x44c8e8[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x44c8e8[_0x970e('0x1b1')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x44c8e8,_0x970e('0x1b2'));}var _0x4d2a5d=this[_0x970e('0x16')][_0x970e('0xa4')](this,_0x44c8e8['project_id']);if(!this[_0x970e('0x82')](_0x4d2a5d)){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x44c8e8,util['format'](_0x970e('0x1b3'),_0x44c8e8[_0x970e('0x1b1')]));}if(_0x4d2a5d===this['channel'][_0x970e('0x33')]){return this['channel'][_0x970e('0x4b')](_0x44c8e8,_0x970e('0x1b4'));}this[_0x970e('0x30')][_0x970e('0xa4')](this,_0x44c8e8,_0x4d2a5d);var _0x2c374b=this[_0x970e('0xc')]['exec'](_0x970e('0x1b5'),util[_0x970e('0x24')](_0x970e('0x1b6'),config[_0x970e('0xb3')][_0x970e('0x197')]||'127.0.0.1',_0x4d2a5d,this[_0x970e('0xc')]['arg_1']));if(_0x2c374b[_0x970e('0xa1')]===-0x1){return _0x2c374b;}return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x179'),'AGI',_0x4d2a5d));};AGIVertices[_0x970e('0xf')][_0x970e('0x1b7')]=function(_0x1da4ec){logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x1b8'),_0x1da4ec['label']));var _0x1a396a=this[_0x970e('0x1b9')][_0x970e('0xa4')](this,_0x1da4ec[_0x970e('0xb4')]);this[_0x970e('0x30')][_0x970e('0xa4')](this,_0x1da4ec,_0x1da4ec[_0x970e('0xb4')]);if(this[_0x970e('0x82')](_0x1da4ec[_0x970e('0xd4')])){var _0x187d0c=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0x1da4ec['variable_id']);if(_0x187d0c){this[_0x970e('0xc')][_0x970e('0x9c')](_0x187d0c,_0x1a396a);return this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1ba'),_0x1da4ec[_0x970e('0xb4')],_0x187d0c));}}return this['channel'][_0x970e('0xa7')](util['format'](_0x970e('0x1bb'),_0x1da4ec[_0x970e('0xb4')]));};AGIVertices[_0x970e('0xf')][_0x970e('0x1bc')]=function(_0x7b41ee){logger[_0x970e('0x29')](util['format'](_0x970e('0x1bd'),_0x7b41ee[_0x970e('0xac')]));_0x7b41ee[_0x970e('0x59')]=_0x7b41ee[_0x970e('0x59')][_0x970e('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x970e('0x82')](_0x7b41ee['apiKey'])){return this['channel'][_0x970e('0xa7')](_0x970e('0x1be'));}if(!this[_0x970e('0x82')](_0x7b41ee[_0x970e('0x59')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xa8'));}this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1bf'),_0x7b41ee['text']));var _0x2e46b3=this[_0x970e('0x56')][_0x970e('0xa4')](this,_0x7b41ee);if(_0x2e46b3){this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1c0'),_0x2e46b3));var _0x470f20=this[_0x970e('0xc')][_0x970e('0x101')](_0x2e46b3);try{fs['unlink'](_0x2e46b3+_0x970e('0x103'));}catch(_0xdb654){logger['error'](_0xdb654);}return _0x470f20;}return this[_0x970e('0xc')][_0x970e('0x4b')](_0x7b41ee,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0x970e('0xf')]['tts']=function(_0xad32b9){logger['info'](util['format'](_0x970e('0x1c1'),_0xad32b9[_0x970e('0xac')]));_0xad32b9[_0x970e('0x59')]=_0xad32b9['text'][_0x970e('0x55')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x970e('0x82')](_0xad32b9[_0x970e('0x59')])){return this[_0x970e('0xc')][_0x970e('0xa7')](_0x970e('0xa8'));}this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1c2'),_0xad32b9['text']));var _0x3a46ad=this[_0x970e('0x60')][_0x970e('0xa4')](this,_0xad32b9);if(_0x3a46ad){this['channel'][_0x970e('0xa7')](util[_0x970e('0x24')](_0x970e('0x1c3'),_0x3a46ad));var _0x147dac=this['channel'][_0x970e('0x101')](_0x3a46ad);try{fs['unlink'](_0x3a46ad+_0x970e('0x103'));}catch(_0x3621d6){logger[_0x970e('0x4b')](_0x3621d6);}return _0x147dac;}return this[_0x970e('0xc')][_0x970e('0x4b')](_0xad32b9,_0x970e('0x1c4'));};AGIVertices[_0x970e('0xf')][_0x970e('0x1c5')]=function(_0x57d2c1){logger['info'](util['format']('Enter\x20in\x20UNPAUSE\x20(%s)\x20block',_0x57d2c1[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x57d2c1[_0x970e('0x156')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x57d2c1,_0x970e('0x157'));}logger[_0x970e('0x29')](util[_0x970e('0x24')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x970e('0xc')]['callerid'],_0x57d2c1[_0x970e('0x156')]));var _0x227060=this[_0x970e('0x4d')][_0x970e('0xa4')](this,_0x57d2c1['findBy']);if(_0x227060){logger['info'](util[_0x970e('0x24')](_0x970e('0x15e'),this[_0x970e('0xc')]['callerid'],_0x57d2c1[_0x970e('0x156')]));this[_0x970e('0xc')][_0x970e('0xa7')](util[_0x970e('0x24')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x970e('0xc')][_0x970e('0x34')],_0x57d2c1[_0x970e('0x156')]));return{'code':0xc8,'result':_0x970e('0x159')};}else{logger[_0x970e('0x29')](util[_0x970e('0x24')](_0x970e('0x15a'),this[_0x970e('0xc')][_0x970e('0x34')],_0x57d2c1[_0x970e('0x156')]));this['channel']['noop'](util['format'](_0x970e('0x15a'),this['channel'][_0x970e('0x34')],_0x57d2c1['findBy']));return{'code':0xc8,'result':_0x970e('0x15b')};}};AGIVertices[_0x970e('0xf')]['voicemail']=function(_0x45b029){logger[_0x970e('0x29')](util['format'](_0x970e('0x1c6'),_0x45b029[_0x970e('0xac')]));var _0x29ba9e=this[_0x970e('0xc')][_0x970e('0x53')]('VOICEMAIL',[_0x45b029[_0x970e('0x1c7')],_0x45b029[_0x970e('0x77')]]);if(_0x29ba9e['result']===-0x1){return _0x29ba9e;}return this['channel'][_0x970e('0xa7')](util['format']('Executed\x20command\x20%s\x20%s',_0x970e('0x1c8'),_0x45b029['mailbox']));};AGIVertices[_0x970e('0xf')]['vswitch']=function(_0x1af49f){logger[_0x970e('0x29')](util['format'](_0x970e('0x1c9'),_0x1af49f[_0x970e('0xac')]));if(!this[_0x970e('0x82')](_0x1af49f[_0x970e('0xd4')])){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x1af49f,_0x970e('0x1ca'));}var _0x381cd0=this[_0x970e('0x10')][_0x970e('0xa4')](this,_0x1af49f[_0x970e('0xd4')]);if(!_0x381cd0){return this[_0x970e('0xc')][_0x970e('0x4b')](_0x1af49f,_0x970e('0xd6'));}var _0x57f73a=this[_0x970e('0xc')][_0x970e('0x10')](_0x381cd0);return{'code':0xc8,'result':_0x57f73a[_0x970e('0x9f')]?_0x57f73a[_0x970e('0x9f')]:'-'};};String[_0x970e('0xf')]['replaceAll']=function(_0x30bf23,_0x2ad986){return this[_0x970e('0x9d')](_0x30bf23)[_0x970e('0x1cb')](_0x2ad986);};module[_0x970e('0x1cc')]=AGIVertices; \ No newline at end of file +var _0x8409=['Enter\x20in\x20GOTO\x20(%s)\x20block','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\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','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','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','variable\x20%s[key]\x20set','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','success','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','macro','gosub','record','Enter\x20in\x20RECORD\x20(%s)\x20block','recordingFormat','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','pass','template_id','debug','Trying\x20SendMail\x20with\x20account\x20%s','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','getSmsAccount','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','AGI','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','shellCommand','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','apiKey','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','replaceAll','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','request-promise','agi','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','name','getVoiceQueueById','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','catch','getUser','getUserById','getTrunkById','getSound','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','map','Intervals','interval','getSoundPath','format','%s/sounds/converted/%s','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','LOCAL','exec','trim','googleCloudTTS','google_cloud_tts_text_type','text','languageCode','ssmlGender','googleTTS','restAPI','url','method','timeout','number','includes','POST','PUT','body','parse','headers','computedVariables','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','dialogflowV2_language','sestekNDA','ispeechTTS','key','en-US','ispeechASR','ispeech_asr_language','isConfigured','model','aws_polly_region','Amy','awsLex','aws_access_key_id','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clear','clone','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','split','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','mrcpsynth','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','noop','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','delay','add','sync','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','MRCPRecog','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','replace','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','dial','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','DIAL','SIP/%s','opts','Executed\x20command\x20%s','dialogflow','no\x20key\x20configured','bot','toUpperCase','out','Dialogflow\x20Result\x20%s','speech','Dialogflow\x20is\x20unreachable','dialogflowV2','Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block','client_email','no\x20client_email\x20configured','private_key','Trying\x20DialogflowV2:\x20%s','providerResponse','DIALOGFLOW_%s','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','streamFile','unlink','SestekNDA\x20Result\x20%s','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','getTrunk','no\x20trunk\x20found','trunk_name','no\x20trunk\x20selected','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','amazonlex','Amazon\x20Lex\x20Result\x20%s','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','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','tilde\x20%s\x20file\x20created'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8409,0x91));var _0x9840=function(_0x4674f7,_0x23a007){_0x4674f7=_0x4674f7-0x0;var _0x203744=_0x8409[_0x4674f7];return _0x203744;};'use strict';var fs=require('fs');var path=require(_0x9840('0x0'));var util=require(_0x9840('0x1'));var _=require(_0x9840('0x2'));var sh=require(_0x9840('0x3'));var odbc=require(_0x9840('0x4'))();var rs=require(_0x9840('0x5'));var moment=require(_0x9840('0x6'));var Mustache=require('mustache');var rp=require(_0x9840('0x7'));var logger=require('../../config/logger')(_0x9840('0x8'));var config=require('../../config/environment');var scripts=require(_0x9840('0x9'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x9840('0xa'),_0x9840('0xb')];var verticesWithRetry=[_0x9840('0xc'),_0x9840('0xd'),_0x9840('0xe')];var AGIVertices=function(_0x5b7b8a,_0x65a730,_0x4933e9){this[_0x9840('0xf')]=_0x5b7b8a;this[_0x9840('0x10')]=_0x65a730;this[_0x9840('0x11')]=_0x4933e9;};AGIVertices[_0x9840('0x12')][_0x9840('0x13')]=function(_0x59c1e4,_0x126d72){this[_0x9840('0x10')][_0x9840('0x14')](_0x59c1e4)[_0x9840('0x15')](function(_0xc32e0e){_0x126d72(null,_0xc32e0e?_0xc32e0e[_0x9840('0x16')]:![]);})['catch'](function(_0x149026){_0x126d72(_0x149026);});};AGIVertices[_0x9840('0x12')]['getVoiceQueue']=function(_0x5b42d4,_0x40706d){this['rpc'][_0x9840('0x17')](_0x5b42d4)[_0x9840('0x15')](function(_0x101cf3){_0x40706d(null,_0x101cf3?_0x101cf3[_0x9840('0x16')]:![]);})['catch'](function(_0x19fe7d){_0x40706d(_0x19fe7d);});};AGIVertices[_0x9840('0x12')][_0x9840('0x18')]=function(_0x14e3bf,_0xa00dd){this[_0x9840('0x10')][_0x9840('0x19')](_0x14e3bf)[_0x9840('0x15')](function(_0x1f01fc){_0xa00dd(null,_0x1f01fc?_0x1f01fc[_0x9840('0x16')]:![]);})['catch'](function(_0x3c3339){_0xa00dd(_0x3c3339);});};AGIVertices['prototype'][_0x9840('0x1a')]=function(_0x563ac2,_0x29f31b){this[_0x9840('0x10')][_0x9840('0x1b')](_0x563ac2)['then'](function(_0x1e0817){_0x29f31b(null,_0x1e0817?_0x1e0817[_0x9840('0x1c')]:![]);})[_0x9840('0x1d')](function(_0x3d4e5b){_0x29f31b(_0x3d4e5b);});};AGIVertices[_0x9840('0x12')][_0x9840('0x1e')]=function(_0x224fa0,_0xf20247){this[_0x9840('0x10')][_0x9840('0x1f')](_0x224fa0)[_0x9840('0x15')](function(_0x272e6a){_0xf20247(null,_0x272e6a?_0x272e6a['name']:![]);})[_0x9840('0x1d')](function(_0x62f165){_0xf20247(_0x62f165);});};AGIVertices[_0x9840('0x12')]['getTrunk']=function(_0x443bc0,_0x98394c){this[_0x9840('0x10')][_0x9840('0x20')](_0x443bc0)[_0x9840('0x15')](function(_0x417524){_0x98394c(null,_0x417524?_0x417524[_0x9840('0x16')]:![]);})['catch'](function(_0x4c4411){_0x98394c(_0x4c4411);});};AGIVertices[_0x9840('0x12')][_0x9840('0x21')]=function(_0x3042c8,_0x5e7527){var _0x2c6023=this;this[_0x9840('0x10')]['getSoundById'](_0x3042c8)[_0x9840('0x15')](function(_0x532dec){_0x5e7527(null,_0x532dec?_0x2c6023['getSoundPath'](_0x532dec[_0x9840('0x22')]):![]);})[_0x9840('0x1d')](function(_0x40263d){_0x5e7527(_0x40263d);});};AGIVertices[_0x9840('0x12')][_0x9840('0x23')]=function(_0x2d6a82,_0x173bba){this[_0x9840('0x10')][_0x9840('0x24')](_0x2d6a82)[_0x9840('0x15')](function(_0x5e6209){_0x173bba(null,_0x5e6209?_0x5e6209:![]);})[_0x9840('0x1d')](function(_0x40840c){_0x173bba(_0x40840c);});};AGIVertices[_0x9840('0x12')][_0x9840('0x25')]=function(_0xfa231,_0x4c325e,_0x29094b){this[_0x9840('0x11')][_0x9840('0x25')](_0xfa231,_0x4c325e)[_0x9840('0x15')](function(){_0x29094b(null);})[_0x9840('0x1d')](function(_0x2acd7b){_0x29094b(_0x2acd7b);});};AGIVertices['prototype'][_0x9840('0x26')]=function(_0x3afca1,_0x545be9){this[_0x9840('0x10')][_0x9840('0x27')](_0x3afca1)['then'](function(_0x438f8b){if(_0x438f8b){if(_0x438f8b['IntervalId']){_0x545be9(null,[_0x438f8b['interval']]);}else{_0x545be9(null,_[_0x9840('0x28')](_0x438f8b[_0x9840('0x29')],_0x9840('0x2a')));}}else{_0x545be9(null,![]);}})[_0x9840('0x1d')](function(_0xa5b17a){_0x545be9(_0xa5b17a);});};AGIVertices['prototype'][_0x9840('0x2b')]=function(_0x1d6bdf){return util[_0x9840('0x2c')](_0x9840('0x2d'),FILES_PATH,_0x1d6bdf);};AGIVertices[_0x9840('0x12')][_0x9840('0x2e')]=function(_0x28a595,_0x2ac40a,_0x3215fc){odbc['open'](_0x28a595,function(_0x52807e){if(_0x52807e){logger[_0x9840('0x2f')](_0x9840('0x30'),_0x52807e);_0x3215fc(_0x52807e);}else{logger[_0x9840('0x31')](_0x9840('0x32'));odbc[_0x9840('0x33')](_0x2ac40a,function(_0x523f93,_0x14a897){if(_0x523f93){logger[_0x9840('0x31')](_0x9840('0x34'),_0x2ac40a);_0x3215fc(_0x523f93);}else{logger[_0x9840('0x31')]('Query\x20executed\x20correctly\x20%s',_0x2ac40a);odbc[_0x9840('0x35')](function(_0x5d9b0b){if(_0x5d9b0b){logger[_0x9840('0x2f')](_0x9840('0x36'),_0x5d9b0b);}_0x3215fc(null,_0x14a897);});}});}});};AGIVertices[_0x9840('0x12')]['getSmsAccount']=function(_0x566c96,_0x4c7dd7){this[_0x9840('0x10')][_0x9840('0x37')](_0x566c96)[_0x9840('0x15')](function(_0x505fd9){_0x4c7dd7(null,_0x505fd9?_0x505fd9:![]);})[_0x9840('0x1d')](function(_0x3d2749){_0x4c7dd7(_0x3d2749);});};AGIVertices[_0x9840('0x12')]['createSmsMessage']=function(_0x4ca135,_0x25dddc){this['rpc'][_0x9840('0x38')](_0x4ca135)[_0x9840('0x15')](function(_0x56a082){_0x25dddc(null,_0x56a082);})[_0x9840('0x1d')](function(_0x37f4d8){_0x25dddc(_0x37f4d8);});};AGIVertices[_0x9840('0x12')][_0x9840('0x39')]=function(_0x282280,_0x450fc0,_0x438fcb){this[_0x9840('0x10')][_0x9840('0x39')]({'uniqueid':this['channel'][_0x9840('0x3a')],'node':_0x282280[_0x9840('0x3b')],'application':_0x282280[_0x9840('0x3c')],'data':_0x450fc0||null,'project_name':this['channel'][_0x9840('0x3d')],'callerid':this[_0x9840('0xf')][_0x9840('0x3e')]})[_0x9840('0x15')](function(_0x138b39){if(_0x438fcb){_0x438fcb(null,_0x138b39);}})[_0x9840('0x1d')](function(_0x204816){if(_0x438fcb){_0x438fcb(_0x204816);}});};AGIVertices[_0x9840('0x12')][_0x9840('0x3f')]=function(_0x2e7791,_0x4fbbe9,_0x3d9f4b,_0x2ea42b){this['rpc'][_0x9840('0x3f')]({'uniqueid':this['channel'][_0x9840('0x3a')],'callerid':this[_0x9840('0xf')][_0x9840('0x3e')],'calleridname':this[_0x9840('0xf')][_0x9840('0x40')],'context':this[_0x9840('0xf')][_0x9840('0x41')],'extension':this['channel'][_0x9840('0x42')],'priority':this[_0x9840('0xf')][_0x9840('0x43')],'accountcode':this[_0x9840('0xf')][_0x9840('0x44')],'dnid':this[_0x9840('0xf')][_0x9840('0x45')],'projectName':this[_0x9840('0xf')][_0x9840('0x3d')],'saveName':_0x4fbbe9,'filename':_0x2e7791[_0x9840('0x46')]||_0x4fbbe9,'savePath':_0x3d9f4b})[_0x9840('0x15')](function(_0x56a5f7){_0x2ea42b(null,_0x56a5f7);})[_0x9840('0x1d')](function(_0x486cec){_0x2ea42b(_0x486cec);});};AGIVertices['prototype']['createSquareMessage']=function(_0x3dbbca,_0x42fa46,_0x23320d,_0x1e554e,_0x46ebfc){this[_0x9840('0x10')][_0x9840('0x47')]({'uniqueid':this['channel'][_0x9840('0x3a')],'body':_0x3dbbca,'direction':_0x42fa46,'providerName':_0x23320d,'providerResponse':_0x1e554e})[_0x9840('0x15')](function(_0x3c4cbc){if(_0x46ebfc){_0x46ebfc(null,_0x3c4cbc);}})[_0x9840('0x1d')](function(_0x5924bb){if(_0x46ebfc){_0x46ebfc(_0x5924bb);}});};AGIVertices['prototype']['createCmContact']=function(_0x122f2a,_0x8f9629){this[_0x9840('0x10')][_0x9840('0x48')]({'firstName':_[_0x9840('0x49')](_0x122f2a[_0x9840('0x16')])||_['isNil'](_0x122f2a['name'])?_0x9840('0x4a')+Math[_0x9840('0x4b')]():_0x122f2a[_0x9840('0x16')],'lastName':_[_0x9840('0x49')](_0x122f2a[_0x9840('0x4c')])||_[_0x9840('0x4d')](_0x122f2a[_0x9840('0x4c')])?null:_0x122f2a[_0x9840('0x4c')],'phone':_0x122f2a[_0x9840('0x4e')],'ListId':_0x122f2a[_0x9840('0x4f')],'scheduledat':_0x122f2a[_0x9840('0x50')],'callbackUniqueid':this[_0x9840('0xf')][_0x9840('0x3a')],'tags':_0x9840('0x51'),'description':_0x9840('0x52')+_0x122f2a[_0x9840('0x50')][_0x9840('0x53')](),'priority':_0x122f2a[_0x9840('0x54')]})[_0x9840('0x15')](function(_0x17c66c){_0x8f9629(null,_0x17c66c);})[_0x9840('0x1d')](function(_0x4bbd95){_0x8f9629(_0x4bbd95);});};AGIVertices[_0x9840('0x12')]['getPause']=function(_0x1ac381,_0x55d4fe){this[_0x9840('0x10')][_0x9840('0x55')](_0x1ac381)[_0x9840('0x15')](function(_0x18176f){_0x55d4fe(null,_0x18176f?_0x18176f[_0x9840('0x16')]:![]);})['catch'](function(_0x3fbdab){_0x55d4fe(_0x3fbdab);});};AGIVertices[_0x9840('0x12')][_0x9840('0x56')]=function(_0x5d6455,_0x54d7ea,_0x37bc0f){var _0x2dd234={'role':'agent'};_0x2dd234[_0x5d6455]=this[_0x9840('0xf')][_0x9840('0x3e')];this[_0x9840('0x10')][_0x9840('0x56')](_0x2dd234,_0x54d7ea,this[_0x9840('0xf')]['uniqueid'])['then'](function(_0x278800){_0x37bc0f(null,_[_0x9840('0x4d')](_0x278800)?![]:!![]);})['catch'](function(_0x3952a0){logger[_0x9840('0x2f')](_0x3952a0);_0x37bc0f(null,![]);});};AGIVertices['prototype']['agentUnpause']=function(_0x30561b,_0x5e0621){var _0x1639cb={'role':_0x9840('0x57')};_0x1639cb[_0x30561b]=this[_0x9840('0xf')]['callerid'];this[_0x9840('0x10')][_0x9840('0x58')](_0x1639cb)[_0x9840('0x15')](function(_0x59195b){_0x5e0621(null,_['isNil'](_0x59195b)?![]:!![]);})[_0x9840('0x1d')](function(_0x76f361){logger['error'](_0x76f361);_0x5e0621(null,![]);});};AGIVertices[_0x9840('0x12')]['agentLogout']=function(_0x2424d0,_0x2e0523){var _0x314ca1={'role':_0x9840('0x57')};_0x314ca1[_0x2424d0]=this[_0x9840('0xf')][_0x9840('0x3e')];this[_0x9840('0x10')]['agentLogout'](_0x314ca1)['then'](function(_0x5c4f97){_0x2e0523(null,_[_0x9840('0x4d')](_0x5c4f97)?![]:!![]);})[_0x9840('0x1d')](function(_0x2cc8fa){logger[_0x9840('0x2f')](_0x2cc8fa);_0x2e0523(null,![]);});};AGIVertices[_0x9840('0x12')][_0x9840('0x59')]=function(_0x552535,_0x18d3da){var _0x46c531={'role':_0x9840('0x57')};_0x46c531[_0x552535]=this['channel'][_0x9840('0x3e')];var _0x3ca8c6=_0x552535!=_0x9840('0x5a')?util[_0x9840('0x2c')]('%s/%s@from-sip/n',_0x9840('0x5b'),this[_0x9840('0xf')][_0x9840('0x3e')]):undefined;this[_0x9840('0x10')]['agentLogin'](_0x46c531,_0x3ca8c6)[_0x9840('0x15')](function(_0x13be07){_0x18d3da(null,_['isNil'](_0x13be07)?![]:!![]);})[_0x9840('0x1d')](function(_0x40ba3f){logger[_0x9840('0x2f')](_0x40ba3f);_0x18d3da(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x2fafb5,_0x5f55f9){sh[_0x9840('0x5c')](_[_0x9840('0x5d')](_0x2fafb5),function(_0x274797,_0x19a514){var _0x1ba3fb=_0x19a514['replace'](/(\r\n|\n|\r)/gm,'');_0x5f55f9(null,_0x1ba3fb);});};AGIVertices['prototype']['googleCloudTTS']=function(_0x31d20b,_0x161df0){scripts[_0x9840('0x5e')](_0x31d20b['apiKey'],_0x31d20b[_0x9840('0x5f')]||_0x9840('0x60'),_0x31d20b[_0x9840('0x60')],_0x31d20b[_0x9840('0x61')]||'en-US',_0x31d20b[_0x9840('0x62')]||'MALE',_0x31d20b['audioEncoding']||'MP3')[_0x9840('0x15')](function(_0x24651e){_0x161df0(null,_0x24651e);})[_0x9840('0x1d')](function(_0x173b08){_0x161df0(_0x173b08);});};AGIVertices['prototype'][_0x9840('0x63')]=function(_0x4f3ec7,_0x261d9e){scripts[_0x9840('0x63')](_0x4f3ec7[_0x9840('0x60')],_0x4f3ec7['google_tts_language']||'en',0x1)[_0x9840('0x15')](function(_0x82bbb4){_0x261d9e(null,_0x82bbb4);})[_0x9840('0x1d')](function(_0x37b978){_0x261d9e(_0x37b978);});};AGIVertices[_0x9840('0x12')][_0x9840('0x64')]=function(_0x515c9a,_0x25ef95){var _0x79dfc0={'uri':_0x515c9a[_0x9840('0x65')],'method':_0x515c9a[_0x9840('0x66')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x515c9a[_0x9840('0x67')])===_0x9840('0x68')&&parseInt(_0x515c9a['timeout'])>=0x1?parseInt(_0x515c9a['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x9840('0x69')]([_0x9840('0x6a'),_0x9840('0x6b')],_0x79dfc0[_0x9840('0x66')]['toUpperCase']())){try{_0x79dfc0[_0x9840('0x6c')]=_0x515c9a[_0x9840('0xb')]?JSON[_0x9840('0x6d')](_0x515c9a[_0x9840('0xb')]):{};}catch(_0x2a9e73){logger[_0x9840('0x2f')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2a9e73);}}try{_0x79dfc0[_0x9840('0x6e')]=_0x515c9a[_0x9840('0xa')]?JSON[_0x9840('0x6d')](_0x515c9a[_0x9840('0xa')]):{};}catch(_0xe94c6a){logger[_0x9840('0x2f')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe94c6a);}if(_0x515c9a[_0x9840('0x6f')]){try{var _0x22e8f5=require(_0x515c9a[_0x9840('0x6f')])['sync'](this,_0x79dfc0);_0x79dfc0['uri']=Mustache[_0x9840('0x70')](_0x515c9a[_0x9840('0x65')],_0x22e8f5,{},['$$','$$']);if(_0x79dfc0[_0x9840('0x6e')]){_0x79dfc0[_0x9840('0x6e')]=JSON[_0x9840('0x6d')](Mustache[_0x9840('0x70')](JSON[_0x9840('0x71')](_0x79dfc0[_0x9840('0x6e')]),_0x22e8f5,{},['$$','$$']));}if(_0x79dfc0[_0x9840('0x6c')]){_0x79dfc0[_0x9840('0x6c')]=JSON[_0x9840('0x6d')](Mustache[_0x9840('0x70')](JSON[_0x9840('0x71')](_0x79dfc0[_0x9840('0x6c')]),_0x22e8f5,{},['$$','$$']));}}catch(_0x260daa){logger[_0x9840('0x2f')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x260daa);}}rp(_0x79dfc0)[_0x9840('0x15')](function(_0x521ea0){var _0xc0c5d1={'statusCode':_0x521ea0[_0x9840('0x72')]||0xc8,'statusMessage':_0x521ea0['statusMessage']||'OK','headers':_0x521ea0[_0x9840('0x6e')]||{},'body':_0x521ea0[_0x9840('0x6c')]||{}};_0x25ef95(null,_0xc0c5d1);})['catch'](function(_0x51b588){var _0x33d58d={'statusCode':_0x51b588['statusCode']||0x1f4,'statusMessage':_0x51b588[_0x9840('0x73')]||_0x9840('0x74'),'headers':_0x51b588['options'][_0x9840('0x6e')]||{},'body':_0x51b588[_0x9840('0x75')][_0x9840('0x6c')]||{}};_0x25ef95(null,_0x33d58d);});};AGIVertices[_0x9840('0x12')]['googleDialogflow']=function(_0x3db4e5,_0x1bd008){scripts[_0x9840('0x76')](this[_0x9840('0xf')][_0x9840('0x3a')],_0x3db4e5['key'],_0x3db4e5['text'],_0x3db4e5[_0x9840('0x77')]||'en')['then'](function(_0x84f771){_0x1bd008(null,_0x84f771);})['catch'](function(_0x144f91){_0x1bd008(_0x144f91);});};AGIVertices['prototype'][_0x9840('0x78')]=function(_0x52b216,_0x32e22c){scripts['googleDialogflowV2'](this[_0x9840('0xf')][_0x9840('0x3a')],_0x52b216[_0x9840('0x79')],_0x52b216['client_email'],_0x52b216['private_key'],_0x52b216[_0x9840('0x60')],_0x52b216[_0x9840('0x7a')]||'en')[_0x9840('0x15')](function(_0x4fb78){_0x32e22c(null,_0x4fb78);})['catch'](function(_0x475177){_0x32e22c(_0x475177);});};AGIVertices['prototype']['sestekNDA']=function(_0x1fb2d,_0x157695){scripts[_0x9840('0x7b')](this['channel'],_0x1fb2d)[_0x9840('0x15')](function(_0x903c80){_0x157695(null,_0x903c80);})[_0x9840('0x1d')](function(_0x42621a){_0x157695(_0x42621a);});};AGIVertices[_0x9840('0x12')][_0x9840('0x7c')]=function(_0x3ac555,_0x311a66){scripts['ispeechTTS'](_0x3ac555[_0x9840('0x7d')],_0x3ac555['text'],_0x3ac555['ispeech_tts_language']||_0x9840('0x7e'),_0x3ac555['speed'])[_0x9840('0x15')](function(_0x38c68){_0x311a66(null,_0x38c68);})[_0x9840('0x1d')](function(_0x57ac5e){_0x311a66(_0x57ac5e);});};AGIVertices['prototype'][_0x9840('0x7f')]=function(_0x21cff6,_0x157307,_0x26a58f){scripts[_0x9840('0x7f')](_0x157307,_0x21cff6['key'],_0x21cff6[_0x9840('0x80')]||_0x9840('0x7e'),this[_0x9840('0x81')](_0x21cff6[_0x9840('0x82')])?_0x21cff6[_0x9840('0x82')]:undefined)[_0x9840('0x15')](function(_0x487ab1){_0x26a58f(null,_0x487ab1);})[_0x9840('0x1d')](function(_0x1021a9){_0x26a58f(_0x1021a9);});};AGIVertices[_0x9840('0x12')]['awsPolly']=function(_0x429f09,_0x5a24f7){scripts['awsPolly'](_0x429f09['aws_access_key_id'],_0x429f09['aws_secret_access_key'],_0x429f09[_0x9840('0x83')],_0x429f09['aws_polly_voice']||_0x9840('0x84'),_0x429f09[_0x9840('0x60')],_0x429f09['aws_text_type']||'text')['then'](function(_0x4d4d0b){_0x5a24f7(null,_0x4d4d0b);})[_0x9840('0x1d')](function(_0xc71352){_0x5a24f7(_0xc71352);});};AGIVertices['prototype'][_0x9840('0x85')]=function(_0x4de812,_0xa008cf){scripts['awsLex'](this[_0x9840('0xf')]['uniqueid'],_0x4de812[_0x9840('0x86')],_0x4de812[_0x9840('0x87')],_0x4de812[_0x9840('0x88')],_0x4de812[_0x9840('0x60')],_0x4de812[_0x9840('0x89')])[_0x9840('0x15')](function(_0x9a19f4){_0xa008cf(null,_0x9a19f4);})['catch'](function(_0x5f1923){_0xa008cf(_0x5f1923);});};AGIVertices[_0x9840('0x12')][_0x9840('0x8a')]=function(_0x2525ed,_0x5c8f67,_0x1e879a){scripts[_0x9840('0x8a')](_0x5c8f67,_0x2525ed[_0x9840('0x7d')],_0x2525ed[_0x9840('0x8b')]||_0x9840('0x7e'))[_0x9840('0x15')](function(_0x38add0){_0x1e879a(null,_0x38add0);})[_0x9840('0x1d')](function(_0x9c2e7f){_0x1e879a(_0x9c2e7f);});};AGIVertices[_0x9840('0x12')][_0x9840('0x8c')]=function(_0x1fc7b0,_0x4d4034,_0x16818c){scripts[_0x9840('0x8c')](_0x4d4034,_0x1fc7b0[_0x9840('0x8d')],_0x1fc7b0[_0x9840('0x8e')],_0x1fc7b0['uri'])[_0x9840('0x15')](function(_0x5b54eb){_0x16818c(null,_0x5b54eb);})[_0x9840('0x1d')](function(_0xfb9e37){_0x16818c(_0xfb9e37);});};AGIVertices[_0x9840('0x12')][_0x9840('0x8f')]=function(_0x3822ef){var _0x4a9406=_['includes'](verticesWithRetry,_0x3822ef['agicommand'])?_0x3822ef:_[_0x9840('0x90')](_0x3822ef);for(var _0x394646 in _0x4a9406){if(_0x4a9406['hasOwnProperty'](_0x394646)){if(_0x4a9406[_0x394646]&&_[_0x9840('0x91')](_0x4a9406[_0x394646])){if(_[_0x9840('0x69')](recursiveMapAttributes,_0x394646)){_0x4a9406[_0x394646]=this[_0x9840('0x92')](_0x4a9406[_0x394646]);}else{_0x4a9406[_0x394646]=this[_0x9840('0x93')](_0x4a9406[_0x394646]);}}}}return _0x4a9406;};AGIVertices[_0x9840('0x12')][_0x9840('0x94')]=function(_0xd176a5){for(var _0x193ac2 in _0xd176a5){if(_0xd176a5[_0x9840('0x95')](_0x193ac2)){if(_[_0x9840('0x96')](_0xd176a5[_0x193ac2])){this[_0x9840('0x94')](_0xd176a5[_0x193ac2]);}else if(_[_0x9840('0x97')](_0xd176a5[_0x193ac2])){for(var _0x17958c=0x0;_0x17958c<_0xd176a5[_0x193ac2][_0x9840('0x98')];_0x17958c++){this[_0x9840('0x94')](_0xd176a5[_0x193ac2][_0x17958c]);}}else if(_['isString'](_0xd176a5[_0x193ac2])){_0xd176a5[_0x193ac2]=this['replaceAllVariables'](_0xd176a5[_0x193ac2]);}}}};AGIVertices[_0x9840('0x12')]['saveRestApiResult']=function(_0xdaa6bf,_0x5e3ab0){for(var _0x1492fb in _0xdaa6bf){if(_0xdaa6bf['hasOwnProperty'](_0x1492fb)){if(_[_0x9840('0x96')](_0xdaa6bf[_0x1492fb])){if(!_[_0x9840('0x49')](_0xdaa6bf[_0x1492fb])){this[_0x9840('0x99')](_0xdaa6bf[_0x1492fb],util[_0x9840('0x2c')](_0x9840('0x9a'),_0x5e3ab0,_0x1492fb));}}else if(_[_0x9840('0x97')](_0xdaa6bf[_0x1492fb])){for(var _0x351244=0x0;_0x351244<_0xdaa6bf[_0x1492fb][_0x9840('0x98')];_0x351244++){this[_0x9840('0x99')](_0xdaa6bf[_0x1492fb][_0x351244],util[_0x9840('0x2c')](_0x9840('0x9a'),_0x5e3ab0,_0x1492fb+'['+_0x351244+']'));}}else{if(!_[_0x9840('0x4d')](_0xdaa6bf[_0x1492fb])){this[_0x9840('0xf')][_0x9840('0x9b')](util['format'](_0x9840('0x9a'),_0x5e3ab0,_0x1492fb),_0xdaa6bf[_0x1492fb]);}}}}};AGIVertices[_0x9840('0x12')]['replaceObjectAllVariables']=function(_0x198cbf){try{var _0x37cdf3=JSON[_0x9840('0x6d')](_0x198cbf);this[_0x9840('0x94')](_0x37cdf3);return JSON[_0x9840('0x71')](_0x37cdf3);}catch(_0xef5e4){return this['replaceAllVariables'](_0x198cbf);}};AGIVertices['prototype'][_0x9840('0x93')]=function(_0x5a67b5){var _0x5523e3=_0x5a67b5[_0x9840('0x9c')]('{');for(var _0x2b1d81=0x1;_0x2b1d81<_0x5523e3['length'];_0x2b1d81+=0x1){var _0x481fe6=_0x5523e3[_0x2b1d81][_0x9840('0x9c')]('}');if(_0x481fe6[_0x9840('0x98')]>0x1){_0x5a67b5=_0x5a67b5['replaceAll']('{'+_0x481fe6[0x0]+'}',this[_0x9840('0xf')][_0x9840('0x13')](_0x481fe6[0x0])[_0x9840('0x9d')]||_0x481fe6[0x0]);}}if(_0x5523e3[_0x9840('0x98')]===0x1){return _0x5a67b5[_0x9840('0x53')]();}return this['replaceAllVariables'](_0x5a67b5);};AGIVertices['prototype'][_0x9840('0x9e')]=function(_0x3c25c8,_0x2b8371){var _0x1c2782=this[_0x9840('0xf')][_0x9840('0x13')](_0x3c25c8);if(_0x1c2782[_0x9840('0x9f')]===-0x1){return _0x1c2782;}logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xa0'),_0x2b8371,_0x1c2782[_0x9840('0x9d')]));return this[_0x9840('0xf')]['setVariable'](_0x2b8371,_0x1c2782[_0x9840('0x9d')]);};AGIVertices[_0x9840('0x12')][_0x9840('0x81')]=function(_0x53e7cb){return _0x53e7cb&&_0x53e7cb!=='0'&&_0x53e7cb!=='-1'&&_0x53e7cb!=='';};AGIVertices[_0x9840('0x12')][_0x9840('0xa1')]=function(_0x98e29d){this[_0x9840('0x39')]['sync'](this,_0x98e29d,'-');_0x98e29d[_0x9840('0xa2')]=_0x98e29d[_0x9840('0xa1')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x9840('0xa3')]=function(_0x4da222){logger[_0x9840('0x31')](util['format'](_0x9840('0xa4'),_0x4da222[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x4da222[_0x9840('0x60')])){return this[_0x9840('0xf')]['noop'](_0x9840('0xa5'));}var _0x21d2cc='\x22'+_0x4da222[_0x9840('0x60')]+'\x22';if(this[_0x9840('0x81')](_0x4da222[_0x9840('0x75')])){_0x21d2cc+=','+_0x4da222[_0x9840('0x75')];}var _0x2e7a5c=this['channel'][_0x9840('0x5c')]('MRCPSynth',_0x21d2cc);if(_0x2e7a5c[_0x9840('0x9f')]===-0x1){return _0x2e7a5c;}return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xa7'),_0x21d2cc));};AGIVertices[_0x9840('0x12')]['mrcprecog']=function(_0xf2ec2){logger[_0x9840('0x31')](util['format'](_0x9840('0xa8'),_0xf2ec2[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0xf2ec2[_0x9840('0xa9')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20grammar\x20configured');}var _0x5e9510=_0xf2ec2[_0x9840('0xa9')];if(this['isConfigured'](_0xf2ec2['options'])){_0x5e9510+=','+_0xf2ec2[_0x9840('0x75')];}var _0x4e1f7b=this[_0x9840('0xf')]['exec']('MRCPRecog',_0x5e9510);if(_0x4e1f7b[_0x9840('0x9f')]===-0x1){return _0x4e1f7b;}var _0x37843e=this[_0x9840('0x9e')]('RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE');if(_0x37843e['result']===-0x1){return _0x37843e;}var _0x2646ca=this[_0x9840('0x9e')](_0x9840('0xaa'),_0x9840('0xab'));if(_0x2646ca[_0x9840('0x9f')]===-0x1){return _0x2646ca;}var _0x2e479d=this[_0x9840('0x9e')]('RECOG_INSTANCE()','MRCP_RECOG_INSTANCE');if(_0x2e479d[_0x9840('0x9f')]===-0x1){return _0x2e479d;}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xac'),_0x5e9510));};AGIVertices[_0x9840('0x12')][_0x9840('0x8')]=function(_0x1c3082){logger[_0x9840('0x31')](util['format'](_0x9840('0xad'),_0x1c3082[_0x9840('0x3b')]));return this[_0x9840('0xf')][_0x9840('0x8')]([_0x1c3082[_0x9840('0xae')],_0x1c3082[_0x9840('0xaf')]]);};AGIVertices[_0x9840('0x12')][_0x9840('0xb0')]=function(_0x8579f8){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xb1'),_0x8579f8['label']));if(this[_0x9840('0x81')](_0x8579f8['timeout'])){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xb2'),_0x8579f8[_0x9840('0x67')]));var _0x4d49db=this[_0x9840('0xf')][_0x9840('0xb3')](_0x8579f8[_0x9840('0x67')]);if(_0x4d49db['result']===-0x1){return _0x4d49db;}}return this[_0x9840('0xf')]['answer']();};AGIVertices[_0x9840('0x12')][_0x9840('0x51')]=function(_0xf1d5ba){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xb4'),_0xf1d5ba['label']));if(!this['isConfigured'](_0xf1d5ba[_0x9840('0x4f')])){return this['channel'][_0x9840('0x2f')](_0xf1d5ba,_0x9840('0xb5'));}_0xf1d5ba[_0x9840('0x50')]=moment();if(this['isConfigured'](_0xf1d5ba[_0x9840('0xb6')])){_0xf1d5ba['scheduledAt']=moment()[_0x9840('0xb7')](_0xf1d5ba[_0x9840('0xb6')],'minutes');}if(!this[_0x9840('0x81')](_0xf1d5ba[_0x9840('0x54')])){_0xf1d5ba[_0x9840('0x54')]=0x2;}this[_0x9840('0x48')][_0x9840('0xb8')](this,_0xf1d5ba);return this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xf1d5ba[_0x9840('0x4e')],_0xf1d5ba[_0x9840('0x4f')],_0xf1d5ba[_0x9840('0x50')]));};AGIVertices[_0x9840('0x12')][_0x9840('0xb9')]=function(_0x17fcf2){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xba'),_0x17fcf2[_0x9840('0x3b')]));var _0x480335=this[_0x9840('0xf')][_0x9840('0x5c')](_0x17fcf2[_0x9840('0xbb')],_0x17fcf2[_0x9840('0x75')]);if(_0x480335[_0x9840('0x9f')]===-0x1){return _0x480335;}return this['channel'][_0x9840('0xa6')](util['format'](_0x9840('0xbc'),_0x17fcf2[_0x9840('0xbb')],_0x17fcf2[_0x9840('0x75')]));};AGIVertices[_0x9840('0x12')]['lumenvoxtts']=function(_0x217685){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xbd'),_0x217685[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x217685[_0x9840('0x60')])){return this['channel'][_0x9840('0xa6')](_0x9840('0xa5'));}var _0x1defb1='\x22'+_0x217685[_0x9840('0x60')]+'\x22';if(this['isConfigured'](_0x217685[_0x9840('0x75')])){_0x1defb1+=','+_0x217685[_0x9840('0x75')];}var _0x11b161=this[_0x9840('0xf')][_0x9840('0x5c')]('MRCPSynth',_0x1defb1);if(_0x11b161[_0x9840('0x9f')]===-0x1){return _0x11b161;}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xa7'),_0x1defb1));};AGIVertices['prototype'][_0x9840('0xbe')]=function(_0x4aefdd){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xbf'),_0x4aefdd['label']));if(!this['isConfigured'](_0x4aefdd[_0x9840('0x60')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20text\x20configured');}var _0x15171f='\x22'+_0x4aefdd['text']+'\x22';if(this['isConfigured'](_0x4aefdd[_0x9840('0x75')])){_0x15171f+=','+_0x4aefdd[_0x9840('0x75')];}var _0x52c2a2=this['channel'][_0x9840('0x5c')](_0x9840('0xc0'),_0x15171f);if(_0x52c2a2['result']===-0x1){return _0x52c2a2;}return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xa7'),_0x15171f));};AGIVertices[_0x9840('0x12')][_0x9840('0xc1')]=function(_0x11bc63){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xc2'),_0x11bc63[_0x9840('0x3b')]));if(!this['isConfigured'](_0x11bc63[_0x9840('0xa9')])){return this['channel']['noop']('no\x20grammar\x20configured');}var _0x49104b=_0x11bc63['grammar'];if(this['isConfigured'](_0x11bc63[_0x9840('0x75')])){_0x49104b+=','+_0x11bc63[_0x9840('0x75')];}var _0x19f148=this[_0x9840('0xf')]['exec'](_0x9840('0xc3'),_0x49104b);if(_0x19f148[_0x9840('0x9f')]===-0x1){return _0x19f148;}var _0x228b1b=this[_0x9840('0x9e')]('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x228b1b[_0x9840('0x9f')]===-0x1){return _0x228b1b;}var _0x1ff26e=this['getAndSetVariable'](_0x9840('0xaa'),_0x9840('0xc4'));if(_0x1ff26e[_0x9840('0x9f')]===-0x1){return _0x1ff26e;}var _0x41065a=this[_0x9840('0x9e')](_0x9840('0xc5'),_0x9840('0xc6'));if(_0x41065a[_0x9840('0x9f')]===-0x1){return _0x41065a;}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xac'),_0x49104b));};AGIVertices[_0x9840('0x12')][_0x9840('0xc7')]=function(_0x1c28bf){logger['info'](util[_0x9840('0x2c')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x1c28bf[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x1c28bf[_0x9840('0xa9')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20grammar\x20configured');}var _0x90ab2a=_0x1c28bf[_0x9840('0xa9')];if(this[_0x9840('0x81')](_0x1c28bf[_0x9840('0x75')])){_0x90ab2a+=','+_0x1c28bf[_0x9840('0x75')];}var _0x5f5192=this[_0x9840('0xf')][_0x9840('0x5c')](_0x9840('0xc3'),_0x90ab2a);if(_0x5f5192[_0x9840('0x9f')]===-0x1){return _0x5f5192;}var _0x42cdba=this[_0x9840('0x9e')](_0x9840('0xc8'),_0x9840('0xc9'));if(_0x42cdba[_0x9840('0x9f')]===-0x1){return _0x42cdba;}var _0x380705=this[_0x9840('0x9e')]('RECOG_INPUT()',_0x9840('0xca'));if(_0x380705[_0x9840('0x9f')]===-0x1){return _0x380705;}var _0x51df8a=this['getAndSetVariable'](_0x9840('0xc5'),_0x9840('0xcb'));if(_0x51df8a['result']===-0x1){return _0x51df8a;}return this['channel']['noop'](util[_0x9840('0x2c')](_0x9840('0xac'),_0x90ab2a));};AGIVertices[_0x9840('0x12')][_0x9840('0xcc')]=function(_0x658803){logger[_0x9840('0x31')](util['format'](_0x9840('0xcd'),_0x658803[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x658803[_0x9840('0xce')])){return this['channel']['error'](_0x658803,'no\x20database\x20selected');}var _0x19f68b=this[_0x9840('0x1a')][_0x9840('0xb8')](this,_0x658803['odbc_id']);if(!_0x19f68b){return this['channel'][_0x9840('0x2f')](_0x658803,_0x9840('0xcf'));}if(!this[_0x9840('0x81')](_0x658803[_0x9840('0x33')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x658803,_0x9840('0xd0'));}var _0x153398=_0x658803['query'][_0x9840('0xd1')](/(\r\n|\n|\r)/gm,'\x20');this[_0x9840('0xf')][_0x9840('0xa6')](util['format']('query:\x20%s',_0x153398));var _0x37b891=this[_0x9840('0x2e')][_0x9840('0xb8')](this,_0x19f68b,_0x153398);this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x658803,_0x153398);if(!this[_0x9840('0x81')](_0x658803[_0x9840('0xd2')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xd3'));}var _0x4a5565=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x658803[_0x9840('0xd2')]);if(!_0x4a5565){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x658803,_0x9840('0xd4'));}var _0x514e37=this;_0x37b891['forEach'](function(_0x4fa2de,_0x59ce91){Object[_0x9840('0xd5')](_0x4fa2de)[_0x9840('0xd6')](function(_0x2b2328){_0x514e37[_0x9840('0xf')][_0x9840('0x9b')](util[_0x9840('0x2c')](_0x9840('0xd7'),_0x4a5565,_0x59ce91,_0x2b2328),_0x4fa2de[_0x2b2328]);});});this[_0x9840('0xf')][_0x9840('0x9b')](util[_0x9840('0x2c')](_0x9840('0xd8'),_0x4a5565),_0x37b891[_0x9840('0x98')]);return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')]('variable\x20%s\x20set',_0x4a5565));};AGIVertices['prototype'][_0x9840('0xd9')]=function(_0x47c4a8){logger['debug'](util[_0x9840('0x2c')](_0x9840('0xda'),_0x47c4a8[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x47c4a8[_0x9840('0xdb')])){return this[_0x9840('0xf')]['error'](_0x47c4a8,_0x9840('0xdc'));}var _0xa26d5c=this['getUser'][_0x9840('0xb8')](this,_0x47c4a8[_0x9840('0xdb')]);if(!_0xa26d5c){return this['channel']['error'](_0x47c4a8,'no\x20user\x20found');}var _0x20a16d=this['channel'][_0x9840('0x5c')](_0x9840('0xdd'),[util[_0x9840('0x2c')](_0x9840('0xde'),_0xa26d5c),_0x47c4a8[_0x9840('0x67')],_0x47c4a8[_0x9840('0xdf')],_0x47c4a8[_0x9840('0x65')]]);if(_0x20a16d[_0x9840('0x9f')]===-0x1){return _0x20a16d;}return this[_0x9840('0xf')][_0x9840('0xa6')](util['format'](_0x9840('0xe0'),'DIAL'));};AGIVertices[_0x9840('0x12')][_0x9840('0xe1')]=function(_0x344950){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x344950[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x344950[_0x9840('0x7d')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xe2'));}if(!this[_0x9840('0x81')](_0x344950[_0x9840('0x60')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xa5'));}this[_0x9840('0xf')][_0x9840('0xe3')]=!![];this[_0x9840('0x39')](_0x344950);this[_0x9840('0x47')](_0x344950[_0x9840('0x60')],'in','','');this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('Trying\x20Dialogflow:\x20%s',_0x344950[_0x9840('0x60')]));var _0x1bdf9d=this[_0x9840('0x76')][_0x9840('0xb8')](this,_0x344950);if(_0x1bdf9d){for(var _0x4bf5d5 in _0x1bdf9d){if(_0x1bdf9d[_0x9840('0x95')](_0x4bf5d5)){this['channel'][_0x9840('0x9b')](util[_0x9840('0x2c')]('DIALOGFLOW_%s',_0x4bf5d5[_0x9840('0xe4')]()),_0x1bdf9d[_0x4bf5d5]);}}this[_0x9840('0x47')](_0x1bdf9d['speech'],_0x9840('0xe5'),'dialogflow','');return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xe6'),_0x1bdf9d[_0x9840('0xe7')]));}return this['channel'][_0x9840('0x2f')](_0x344950,_0x9840('0xe8'));};AGIVertices[_0x9840('0x12')][_0x9840('0xe9')]=function(_0x4ec331){logger['info'](util[_0x9840('0x2c')](_0x9840('0xea'),_0x4ec331['label']));if(!this[_0x9840('0x81')](_0x4ec331['dialogflowV2_project_id'])){return this['channel'][_0x9840('0xa6')]('no\x20project_id\x20configured');}if(!this[_0x9840('0x81')](_0x4ec331[_0x9840('0xeb')])){return this[_0x9840('0xf')]['noop'](_0x9840('0xec'));}if(!this[_0x9840('0x81')](_0x4ec331[_0x9840('0xed')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20private_key\x20configured');}if(!this[_0x9840('0x81')](_0x4ec331[_0x9840('0x7a')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20anguage\x20configured');}if(!this[_0x9840('0x81')](_0x4ec331['text'])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20text\x20configured');}this['channel'][_0x9840('0xe3')]=!![];this[_0x9840('0x39')](_0x4ec331);this[_0x9840('0x47')](_0x4ec331[_0x9840('0x60')],'in','','');this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xee'),_0x4ec331[_0x9840('0x60')]));var _0x19279e=this[_0x9840('0x78')][_0x9840('0xb8')](this,_0x4ec331);if(_0x19279e){for(var _0x21c964 in _0x19279e){if(_0x19279e[_0x9840('0x95')](_0x21c964)){if(_0x21c964!==_0x9840('0xef')){this['channel']['setVariable'](util['format'](_0x9840('0xf0'),_0x21c964[_0x9840('0xe4')]()),_0x19279e[_0x21c964]);}}}this[_0x9840('0x47')](_0x19279e[_0x9840('0xe7')],'out','dialogflowV2',_0x19279e[_0x9840('0xef')]);return this['channel']['noop'](util['format'](_0x9840('0xf1'),_0x19279e['speech']));}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4ec331,_0x9840('0xf2'));};AGIVertices[_0x9840('0x12')][_0x9840('0xf3')]=function(_0x23607a){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0xf4'),_0x23607a[_0x9840('0x3b')]));if(!this['isConfigured'](_0x23607a[_0x9840('0xf5')])){return this['channel'][_0x9840('0xa6')]('no\x20ndauth\x20url\x20configured');}if(!this[_0x9840('0x81')](_0x23607a[_0x9840('0xf6')])){return this[_0x9840('0xf')]['noop'](_0x9840('0xf7'));}if(!this[_0x9840('0x81')](_0x23607a['password'])){return this['channel'][_0x9840('0xa6')](_0x9840('0xf8'));}if(!this[_0x9840('0x81')](_0x23607a[_0x9840('0xf9')])){return this[_0x9840('0xf')]['noop'](_0x9840('0xa5'));}this[_0x9840('0xf')][_0x9840('0xe3')]=!![];this[_0x9840('0x39')](_0x23607a);this[_0x9840('0x47')](_0x23607a[_0x9840('0x60')],'in','','');this[_0x9840('0xf')][_0x9840('0xa6')](util['format'](_0x9840('0xfa'),_0x23607a[_0x9840('0x60')]));var _0x39047e=this[_0x9840('0x7b')][_0x9840('0xb8')](this,_0x23607a);if(_0x39047e){for(var _0x292c9f in _0x39047e){if(_0x39047e[_0x9840('0x95')](_0x292c9f)){this[_0x9840('0xf')][_0x9840('0x9b')](util[_0x9840('0x2c')](_0x9840('0xfb'),_0x292c9f[_0x9840('0xe4')]()),_0x39047e[_0x292c9f]);}}this['createSquareMessage'](_0x39047e[_0x9840('0xe7')],_0x9840('0xe5'),_0x9840('0xf3'),'');if(_0x39047e['audiofile']){this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xfc'),_0x39047e[_0x9840('0xfd')]));var _0x94ab05=this['channel'][_0x9840('0xfe')](_0x39047e[_0x9840('0xfd')]);try{fs[_0x9840('0xff')](_0x39047e[_0x9840('0xfd')]+'.wav');}catch(_0x12b5f5){logger['error'](_0x12b5f5);}return _0x94ab05;}else{return this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0x100'),_0x39047e[_0x9840('0xe7')]));}}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x23607a,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype']['end']=function(_0x1d0ab4){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20END\x20(%s)\x20block',_0x1d0ab4[_0x9840('0x3b')]));return this[_0x9840('0xf')]['noop'](_0x9840('0x101'));};AGIVertices[_0x9840('0x12')][_0x9840('0x102')]=function(_0x5f17a9){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x103'),_0x5f17a9[_0x9840('0x3b')]));var _0x39309f='';if(_0x5f17a9[_0x9840('0x104')]){if(!this[_0x9840('0x81')](_0x5f17a9[_0x9840('0x104')])){return this[_0x9840('0xf')]['error'](_0x5f17a9,'no\x20trunk\x20selected');}else{var _0x514dff=parseInt(_0x5f17a9[_0x9840('0x104')],0xa);if(isNaN(_0x514dff)){_0x39309f=_0x5f17a9[_0x9840('0x104')];}else{_0x39309f=this[_0x9840('0x105')]['sync'](this,_0x5f17a9[_0x9840('0x104')]);if(!_0x39309f){return this['channel'][_0x9840('0x2f')](_0x5f17a9,_0x9840('0x106'));}}}}else if(_0x5f17a9[_0x9840('0x107')]){_0x39309f=_0x5f17a9[_0x9840('0x107')];}else{return this['channel'][_0x9840('0x2f')](_0x5f17a9,_0x9840('0x108'));}var _0x4a2c25=this[_0x9840('0xf')][_0x9840('0x5c')](_0x9840('0xdd'),[util[_0x9840('0x2c')](_0x9840('0x109'),_0x39309f,_0x5f17a9['phone']),_0x5f17a9[_0x9840('0x67')],_0x5f17a9[_0x9840('0xdf')],_0x5f17a9['url']]);if(_0x4a2c25[_0x9840('0x9f')]===-0x1){return _0x4a2c25;}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('Executed\x20command\x20%s',_0x9840('0xdd')));};AGIVertices[_0x9840('0x12')][_0x9840('0x10a')]=function(_0x368409){logger['info'](util[_0x9840('0x2c')](_0x9840('0x10b'),_0x368409['label']));return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x10a'));};AGIVertices['prototype'][_0x9840('0xd')]=function(_0x5d4ed6){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x10c'),_0x5d4ed6[_0x9840('0x3b')]));if(_0x5d4ed6[_0x9840('0xa2')]===0x0){return this['maxRetry'](_0x5d4ed6);}_0x5d4ed6[_0x9840('0xa2')]-=0x1;if(!this[_0x9840('0x81')](_0x5d4ed6[_0x9840('0x10d')])){return this['channel']['error'](_0x5d4ed6,_0x9840('0x10e'));}var _0x10f9e7=this[_0x9840('0x21')][_0x9840('0xb8')](this,_0x5d4ed6['file_id']);if(!_0x10f9e7){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x5d4ed6,_0x9840('0x10f'));}if(!this[_0x9840('0x81')](_0x5d4ed6['variable_id'])){return this['channel'][_0x9840('0x2f')](_0x9840('0xd3'));}var _0x54b526=this['channel'][_0x9840('0x110')](_0x10f9e7,_0x5d4ed6[_0x9840('0x111')],_0x5d4ed6[_0x9840('0x112')]);var _0x3c78d0=_0x54b526[_0x9840('0x9f')]?_0x54b526[_0x9840('0x9f')][_0x9840('0x53')]():'';logger['info']('test',JSON[_0x9840('0x71')](_0x54b526));if(_0x54b526[_0x9840('0x9f')]===-0x1){this['createSquareDetailsReport'][_0x9840('0xb8')](this,_0x5d4ed6,_0x3c78d0);return _0x54b526;}else if(_0x54b526['extra']===_0x9840('0x67')){_0x54b526[_0x9840('0x9f')]=_0x3c78d0[_0x9840('0x98')]>=parseInt(_0x5d4ed6['mindigit'])?'x':'i';}else{_0x54b526[_0x9840('0x9f')]=_0x3c78d0[_0x9840('0x98')]>=parseInt(_0x5d4ed6['mindigit'])&&_0x3c78d0[_0x9840('0x98')]<=parseInt(_0x5d4ed6['maxdigit'])?'x':'i';}var _0x43ca9c=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x5d4ed6[_0x9840('0xd2')]);if(!_0x43ca9c){return this['channel'][_0x9840('0x2f')](_0x5d4ed6,'no\x20variable\x20found');}this[_0x9840('0xf')]['setVariable'](_0x43ca9c,_0x3c78d0);if(this[_0x9840('0x81')](_0x5d4ed6[_0x9840('0x113')])){var _0x4f10f7=parseInt(_0x5d4ed6[_0x9840('0x113')],0xa);var _0x30ba6b=rs[_0x9840('0x114')]({'charset':'*','length':_0x4f10f7});var _0x4931a8=_0x3c78d0['length'];if(_0x4931a8>0x0){if(_0x4931a8>_0x4f10f7){this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x5d4ed6,_0x5d4ed6[_0x9840('0x115')]===_0x9840('0x116')?_0x30ba6b+_0x3c78d0[_0x9840('0x117')](_0x4f10f7):_0x3c78d0['substr'](0x0,_0x4931a8-_0x4f10f7)+_0x30ba6b);}else{this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x5d4ed6,rs['generate']({'charset':'*','length':_0x4931a8}));}}else{this['createSquareDetailsReport'][_0x9840('0xb8')](this,_0x5d4ed6,'');}}else{this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x5d4ed6,_0x3c78d0);}return _0x54b526;};AGIVertices[_0x9840('0x12')][_0x9840('0xe')]=function(_0x136587){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x118'),_0x136587[_0x9840('0x3b')]));return this['getdigits'](_0x136587);};AGIVertices[_0x9840('0x12')][_0x9840('0x119')]=function(_0x317433){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x11a'),_0x317433[_0x9840('0x3b')]));this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x317433,_0x317433['goalname']);return this[_0x9840('0xf')][_0x9840('0xa6')](util['format'](_0x9840('0x11b'),_0x317433['goalname']));};AGIVertices['prototype'][_0x9840('0x11c')]=function(_0x4c923f){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x11d'),_0x4c923f[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x4c923f[_0x9840('0x86')])||!this[_0x9840('0x81')](_0x4c923f['aws_secret_access_key'])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x4c923f[_0x9840('0x60')])){return this['channel'][_0x9840('0xa6')](_0x9840('0xa5'));}this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x11e'),_0x4c923f[_0x9840('0x60')]));var _0x319bda=this['awsPolly'][_0x9840('0xb8')](this,_0x4c923f);if(_0x319bda){this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x11f'),_0x319bda));var _0x283d6c=this[_0x9840('0xf')][_0x9840('0xfe')](_0x319bda);try{fs[_0x9840('0xff')](_0x319bda+_0x9840('0x120'));}catch(_0x1be2b4){logger[_0x9840('0x2f')](_0x1be2b4);}return _0x283d6c;}return this[_0x9840('0xf')]['error'](_0x4c923f,_0x9840('0x121'));};AGIVertices[_0x9840('0x12')]['awslex']=function(_0x406cc9){logger[_0x9840('0x31')](util['format'](_0x9840('0x122'),_0x406cc9[_0x9840('0x3b')]));if(!this['isConfigured'](_0x406cc9[_0x9840('0x86')])||!this['isConfigured'](_0x406cc9[_0x9840('0x87')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x123'));}if(!this['isConfigured'](_0x406cc9[_0x9840('0x89')])){return this['channel']['noop'](_0x9840('0x124'));}if(!this[_0x9840('0x81')](_0x406cc9[_0x9840('0x60')])){return this[_0x9840('0xf')]['noop']('no\x20text\x20configured');}this[_0x9840('0xf')]['bot']=!![];this[_0x9840('0x39')](_0x406cc9);this['createSquareMessage'](_0x406cc9[_0x9840('0x60')],'in','','');this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x125'),_0x406cc9['text']));var _0x54af66=this[_0x9840('0x85')][_0x9840('0xb8')](this,_0x406cc9);if(_0x54af66){for(var _0x4f3e99 in _0x54af66){if(_0x54af66[_0x9840('0x95')](_0x4f3e99)&&_[_0x9840('0x91')](_0x54af66[_0x4f3e99])){this['channel']['setVariable'](util[_0x9840('0x2c')](_0x9840('0x126'),_0x4f3e99[_0x9840('0xe4')]()),_0x54af66[_0x4f3e99]);}}if(_['isNil'](_0x54af66[_0x9840('0x73')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x127'));}else{this[_0x9840('0x47')](_0x54af66[_0x9840('0x73')],_0x9840('0xe5'),_0x9840('0x128'),'');return this['channel']['noop'](util[_0x9840('0x2c')](_0x9840('0x129'),_0x54af66[_0x9840('0x73')]));}}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x406cc9,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x9840('0x12')][_0x9840('0x12a')]=function(_0x5eccb2){logger[_0x9840('0x31')](util['format'](_0x9840('0x12b'),_0x5eccb2[_0x9840('0x3b')],_0x5eccb2[_0x9840('0x67')]));if(!this[_0x9840('0x81')](_0x5eccb2[_0x9840('0x7d')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xe2'));}var _0xe01c91=_0x9840('0x12c');var _0x181d9a=util[_0x9840('0x2c')](_0x9840('0x12d'),FILES_PATH,rs[_0x9840('0x114')](0x4));var _0x132fd9=util[_0x9840('0x2c')]('%s.%s',_0x181d9a,_0xe01c91);var _0x1a9742=!![];if(_0x5eccb2[_0x9840('0x12e')]===_0x9840('0x12f')){_0x1a9742=![];}var _0x20ce91=this[_0x9840('0xf')][_0x9840('0x130')](_0x181d9a,_0xe01c91,_0x5eccb2[_0x9840('0x131')],_0x5eccb2[_0x9840('0x67')],undefined,_0x1a9742);if(_0x20ce91[_0x9840('0x9f')]!==-0x1){this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x132'),_0x132fd9));var _0x3a6b69=this[_0x9840('0x8a')][_0x9840('0xb8')](this,_0x5eccb2,_0x132fd9);if(_0x3a6b69){for(var _0x3f8576 in _0x3a6b69){if(_0x3a6b69[_0x9840('0x95')](_0x3f8576)){this['channel']['setVariable'](util['format'](_0x9840('0x133'),_0x3f8576[_0x9840('0xe4')]()),_0x3a6b69[_0x3f8576]);}}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x134'),JSON['stringify'](_0x3a6b69)));}}return _0x20ce91;};AGIVertices['prototype'][_0x9840('0x135')]=function(_0x3cb540){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x136'),_0x3cb540['label']));if(!this[_0x9840('0x81')](_0x3cb540['appid'])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x137'));}if(!this[_0x9840('0x81')](_0x3cb540[_0x9840('0x8e')])){return this[_0x9840('0xf')]['noop']('no\x20appsecret\x20configured');}var _0x4647dd=_0x9840('0x12c');var _0x223ace=util[_0x9840('0x2c')](_0x9840('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x1acfd9=util[_0x9840('0x2c')]('%s.%s',_0x223ace,_0x4647dd);var _0x289c90=!![];if(_0x3cb540[_0x9840('0x12e')]===_0x9840('0x12f')){_0x289c90=![];}var _0x3822c9=this[_0x9840('0xf')]['recordFile'](_0x223ace,_0x4647dd,_0x3cb540[_0x9840('0x131')],_0x3cb540['timeout'],undefined,_0x289c90);if(_0x3822c9[_0x9840('0x9f')]!==-0x1){this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x138'),_0x1acfd9));var _0x313a08=this['tildeASR'][_0x9840('0xb8')](this,_0x3cb540,_0x1acfd9);if(_0x313a08){for(var _0x19fb89 in _0x313a08){if(_0x313a08[_0x9840('0x95')](_0x19fb89)){this[_0x9840('0xf')]['setVariable'](util[_0x9840('0x2c')]('TILDE_ASR_%s',_0x19fb89[_0x9840('0xe4')]()),_0x313a08[_0x19fb89]);}}return this[_0x9840('0xf')][_0x9840('0xa6')](util['format']('TildeASR\x20Result\x20%s',JSON[_0x9840('0x71')](_0x313a08)));}}return _0x3822c9;};AGIVertices[_0x9840('0x12')]['gotoc']=function(_0x5edd4d){logger['info'](util[_0x9840('0x2c')](_0x9840('0x139'),_0x5edd4d[_0x9840('0x3b')]));return this['channel']['continueAt'](_0x5edd4d['context'],_0x5edd4d[_0x9840('0x42')],_0x5edd4d[_0x9840('0x43')]);};AGIVertices[_0x9840('0x12')]['gotoif']=function(_0x2d1875){logger['info'](util[_0x9840('0x2c')](_0x9840('0x13a'),_0x2d1875[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x2d1875[_0x9840('0x13b')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x2d1875,_0x9840('0x13c'));}try{var _0x223072=eval(_0x2d1875['condition'])?_0x9840('0x13d'):_0x9840('0x13e');this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x13f'),_0x2d1875[_0x9840('0x13b')],_0x223072));return{'code':0xc8,'result':_0x223072};}catch(_0x18f067){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x9840('0x12')][_0x9840('0x140')]=function(_0x2b62ec){logger[_0x9840('0x31')](util['format'](_0x9840('0x141'),_0x2b62ec[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x2b62ec[_0x9840('0x142')])){return this['channel'][_0x9840('0x2f')](_0x2b62ec,_0x9840('0x143'));}var _0x8fea4a=this[_0x9840('0x26')][_0x9840('0xb8')](this,_0x2b62ec[_0x9840('0x142')]);if(!_0x8fea4a){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x2b62ec,_0x9840('0x144'));}for(var _0x5ab5cb=0x0;_0x5ab5cb<_0x8fea4a[_0x9840('0x98')];_0x5ab5cb+=0x1){var _0x5d6661=this[_0x9840('0xf')][_0x9840('0x13')](util[_0x9840('0x2c')](_0x9840('0x145'),_0x8fea4a[_0x5ab5cb]));if(_0x5d6661[_0x9840('0x9f')]===-0x1){return _0x5d6661;}logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x146'),_0x8fea4a[_0x5ab5cb],_0x5d6661['extra']));if(_0x5d6661['extra']===_0x9840('0x13d')){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x146'),_0x8fea4a[_0x5ab5cb],_0x9840('0x13d')));this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x146'),_0x8fea4a[_0x5ab5cb],_0x9840('0x13d')));return{'code':0xc8,'result':_0x9840('0x13d')};}else{logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x146'),_0x8fea4a[_0x5ab5cb],_0x9840('0x13e')));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('IFTIME\x20%s\x20%s',_0x8fea4a[_0x5ab5cb],_0x9840('0x13e')));}}return{'code':0xc8,'result':_0x9840('0x13e')};};AGIVertices[_0x9840('0x12')][_0x9840('0x147')]=function(_0x597367){logger['info'](util[_0x9840('0x2c')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x597367[_0x9840('0x3b')]));return this[_0x9840('0xf')][_0x9840('0x147')]();};AGIVertices[_0x9840('0x12')][_0x9840('0x148')]=function(_0x24274d){logger[_0x9840('0x31')](util['format'](_0x9840('0x149'),_0x24274d[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x24274d[_0x9840('0x7d')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xe2'));}var _0x13ae47='wav';var _0x48cda2=util[_0x9840('0x2c')](_0x9840('0x12d'),FILES_PATH,rs[_0x9840('0x114')](0x4));var _0x4f1ca8=util[_0x9840('0x2c')]('%s.%s',_0x48cda2,_0x13ae47);var _0xead4a=!![];if(_0x24274d[_0x9840('0x12e')]==='NOBEEP'){_0xead4a=![];}var _0x18c271=this['channel'][_0x9840('0x130')](_0x48cda2,_0x13ae47,_0x24274d['intKey'],_0x24274d[_0x9840('0x67')],undefined,_0xead4a);if(_0x18c271[_0x9840('0x9f')]!==-0x1){this[_0x9840('0xf')][_0x9840('0xa6')](util['format'](_0x9840('0x14a'),_0x4f1ca8));var _0x2f5e8b=this[_0x9840('0x7f')][_0x9840('0xb8')](this,_0x24274d,_0x4f1ca8);if(_0x2f5e8b){for(var _0x1ea6a5 in _0x2f5e8b){if(_0x2f5e8b[_0x9840('0x95')](_0x1ea6a5)){this[_0x9840('0xf')]['setVariable'](util[_0x9840('0x2c')](_0x9840('0x14b'),_0x1ea6a5[_0x9840('0xe4')]()),_0x2f5e8b[_0x1ea6a5]);}}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x14c'),JSON[_0x9840('0x71')](_0x2f5e8b)));}}return _0x18c271;};AGIVertices['prototype'][_0x9840('0x14d')]=function(_0x462ca3){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x14e'),_0x462ca3[_0x9840('0x3b')]));if(!this['isConfigured'](_0x462ca3[_0x9840('0x7d')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xe2'));}if(!this['isConfigured'](_0x462ca3['text'])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xa5'));}this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')]('Trying\x20ispeech\x20TTS\x20%s',_0x462ca3[_0x9840('0x60')]));var _0x381f2d=this[_0x9840('0x7c')]['sync'](this,_0x462ca3);if(_0x381f2d){this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0x14a'),_0x381f2d));var _0x170881=this[_0x9840('0xf')][_0x9840('0xfe')](_0x381f2d,_0x462ca3['intKey']);try{fs['unlink'](_0x381f2d+'.wav');}catch(_0x46ded9){logger[_0x9840('0x2f')](_0x46ded9);}return _0x170881;}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x462ca3,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x9840('0x12')][_0x9840('0x14f')]=function(_0x188ecf){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x150'),_0x188ecf[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x188ecf[_0x9840('0x151')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x188ecf,_0x9840('0x152'));}logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x153'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x188ecf[_0x9840('0x151')]));var _0x2f601b=this[_0x9840('0x59')][_0x9840('0xb8')](this,_0x188ecf[_0x9840('0x151')]);if(_0x2f601b){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x188ecf[_0x9840('0x151')]));this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')]['callerid'],_0x188ecf[_0x9840('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x155'),this[_0x9840('0xf')]['callerid'],_0x188ecf[_0x9840('0x151')]));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9840('0xf')]['callerid'],_0x188ecf[_0x9840('0x151')]));return{'code':0xc8,'result':_0x9840('0x156')};}};AGIVertices[_0x9840('0x12')][_0x9840('0x157')]=function(_0x5d4823){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x158'),_0x5d4823[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x5d4823[_0x9840('0x151')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x5d4823,_0x9840('0x152'));}logger[_0x9840('0x31')](util['format'](_0x9840('0x153'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x5d4823[_0x9840('0x151')]));var _0x7eb887=this[_0x9840('0x159')][_0x9840('0xb8')](this,_0x5d4823[_0x9840('0x151')]);if(_0x7eb887){logger['info'](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x5d4823[_0x9840('0x151')]));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x154'),this['channel'][_0x9840('0x3e')],_0x5d4823[_0x9840('0x151')]));return{'code':0xc8,'result':'success'};}else{logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x155'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x5d4823['findBy']));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x155'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x5d4823[_0x9840('0x151')]));return{'code':0xc8,'result':_0x9840('0x156')};}};AGIVertices['prototype'][_0x9840('0x15a')]=function(_0x5aa5f9){logger[_0x9840('0x31')](util['format'](_0x9840('0x15b'),_0x5aa5f9['label']));if(!this[_0x9840('0x81')](_0x5aa5f9[_0x9840('0x15c')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x5aa5f9,_0x9840('0x15d'));}this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x15e'),_0x5aa5f9[_0x9840('0x15c')]));var _0x4c87ec=eval(_0x5aa5f9[_0x9840('0x15c')]);if(!this[_0x9840('0x81')](_0x5aa5f9[_0x9840('0xd2')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x23b10e=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x5aa5f9[_0x9840('0xd2')]);if(!_0x23b10e){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x5aa5f9,_0x9840('0xd4'));}if(_[_0x9840('0x97')](_0x4c87ec)){var _0x21b11a=this;_0x4c87ec[_0x9840('0xd6')](function(_0x4224ce,_0x20090c){_0x21b11a[_0x9840('0xf')][_0x9840('0x9b')](util['format']('%s[%s]',_0x23b10e,_0x20090c),_0x4224ce);});return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x15f'),_0x23b10e));}else{return this[_0x9840('0xf')][_0x9840('0x9b')](_0x23b10e,_0x4c87ec);}};AGIVertices['prototype'][_0x9840('0xc')]=function(_0x53196c){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20MENU\x20(%s)\x20block',_0x53196c[_0x9840('0x3b')]));if(_0x53196c[_0x9840('0xa2')]===0x0){return this[_0x9840('0xa1')](_0x53196c);}_0x53196c[_0x9840('0xa2')]-=0x1;if(!this[_0x9840('0x81')](_0x53196c[_0x9840('0x10d')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x53196c,_0x9840('0x10e'));}var _0x24b0f8=this['getSound'][_0x9840('0xb8')](this,_0x53196c[_0x9840('0x10d')]);if(!_0x24b0f8){return this['channel'][_0x9840('0x2f')](_0x53196c,_0x9840('0x10f'));}var _0x5acf92=this[_0x9840('0xf')][_0x9840('0x110')](_0x24b0f8,_0x53196c[_0x9840('0x111')],_0x53196c[_0x9840('0x160')]);var _0xb73639=_0x5acf92[_0x9840('0x9f')];if(_0x5acf92[_0x9840('0x9f')]===-0x1){this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x53196c,'-1');return _0x5acf92;}else if(_0x5acf92['extra']===_0x9840('0x67')){_0x5acf92['result']=_0x5acf92[_0x9840('0x9f')]['length']>0x0?_0x5acf92[_0x9840('0x9f')]:'t';}else if(_[_0x9840('0x49')](_0x5acf92[_0x9840('0x9f')])){_0x5acf92[_0x9840('0x9f')]='#';_0xb73639='#';}if(!this[_0x9840('0x81')](_0x53196c['variable_id'])){this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xd3'));}else{var _0x528db9=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x53196c['variable_id']);if(!_0x528db9){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x53196c,_0x9840('0xd4'));}this['channel'][_0x9840('0x9b')](_0x528db9,_0xb73639);}this[_0x9840('0x39')]['sync'](this,_0x53196c,_0xb73639);return _0x5acf92;};AGIVertices[_0x9840('0x12')][_0x9840('0xa6')]=function(_0x2de498){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x2de498[_0x9840('0x3b')]));return this[_0x9840('0xf')][_0x9840('0xa6')](_0x2de498[_0x9840('0x161')]||_0x2de498['label']);};AGIVertices[_0x9840('0x12')]['pause']=function(_0x1e2cc9){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x162'),_0x1e2cc9[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x1e2cc9['findBy'])){return this[_0x9840('0xf')]['error'](_0x1e2cc9,_0x9840('0x152'));}logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x153'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x1e2cc9['findBy']));var _0x5dc3fb=this['getPause'][_0x9840('0xb8')](this,_0x1e2cc9[_0x9840('0x163')]);var _0x4da5de=this[_0x9840('0x56')][_0x9840('0xb8')](this,_0x1e2cc9[_0x9840('0x151')],_0x5dc3fb);if(_0x4da5de){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x1e2cc9[_0x9840('0x151')]));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x9840('0xf')][_0x9840('0x3e')],_0x1e2cc9['findBy']));return{'code':0xc8,'result':_0x9840('0x164')};}else{logger[_0x9840('0x31')](util[_0x9840('0x2c')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9840('0xf')][_0x9840('0x3e')],_0x1e2cc9[_0x9840('0x151')]));this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x1e2cc9['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x9840('0x12')]['playback']=function(_0x1bb82e){logger['info'](util[_0x9840('0x2c')](_0x9840('0x165'),_0x1bb82e[_0x9840('0x3b')]));if(!this['isConfigured'](_0x1bb82e[_0x9840('0x10d')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x1bb82e,'no\x20file\x20audio\x20selected');}var _0x12b5ba=this[_0x9840('0x21')][_0x9840('0xb8')](this,_0x1bb82e[_0x9840('0x10d')]);if(!_0x12b5ba){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x1bb82e,'no\x20file\x20audio\x20found');}var _0x580b01=this[_0x9840('0xf')]['exec'](_0x9840('0x166'),[_0x12b5ba,_0x1bb82e[_0x9840('0xdf')]]);if(_0x580b01[_0x9840('0x9f')]===-0x1){return _0x580b01;}return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xbc'),'PLAYBACK',_0x12b5ba));};AGIVertices[_0x9840('0x12')][_0x9840('0x167')]=function(_0x4c2b02){logger['info'](util['format']('Enter\x20in\x20QUEUE\x20(%s)\x20block',_0x4c2b02[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x4c2b02[_0x9840('0x168')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4c2b02,_0x9840('0x169'));}var _0x2369c1='';var _0x385266=parseInt(_0x4c2b02[_0x9840('0x168')],0xa);if(isNaN(_0x385266)){_0x2369c1=_0x4c2b02['queue_id'];}else{_0x2369c1=this['getVoiceQueue'][_0x9840('0xb8')](this,_0x4c2b02[_0x9840('0x168')]);if(!_0x2369c1){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4c2b02,_0x9840('0x16a'));}}var _0x8abb8e='';if(this[_0x9840('0x81')](_0x4c2b02['file_id'])){var _0x2c15c0=this[_0x9840('0x21')][_0x9840('0xb8')](this,_0x4c2b02[_0x9840('0x10d')]);if(_0x2c15c0){_0x8abb8e=_0x2c15c0;}}this['createSquareDetailsReport'][_0x9840('0xb8')](this,_0x4c2b02,_0x2369c1);if(_0x4c2b02[_0x9840('0xdf')][_0x9840('0x16b')]('x')<0x0){_0x4c2b02['opts']+='x';}if(_0x4c2b02['opts'][_0x9840('0x16b')]('X')<0x0){_0x4c2b02['opts']+='X';}this[_0x9840('0xf')][_0x9840('0x9b')]('XMCS-QUEUE',_0x2369c1?_0x2369c1[_0x9840('0x16c')]():'');var _0x4fb5eb=this['channel'][_0x9840('0x5c')](_0x9840('0x16d'),[_0x2369c1,_0x4c2b02[_0x9840('0xdf')],_0x4c2b02['url'],_0x8abb8e,_0x4c2b02[_0x9840('0x67')],_0x4c2b02[_0x9840('0x8')],_0x4c2b02[_0x9840('0x16e')],_0x4c2b02[_0x9840('0x16f')],'',_0x4c2b02['position']]);if(_0x4fb5eb[_0x9840('0x9f')]===-0x1){return _0x4fb5eb;}return this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0xbc'),_0x9840('0x16d'),_0x2369c1));};AGIVertices[_0x9840('0x12')][_0x9840('0x170')]=function(_0x1438d0){logger['info'](util['format'](_0x9840('0x171'),_0x1438d0[_0x9840('0x3b')]));var _0x331bb2=_0x1438d0[_0x9840('0x172')]||_0x9840('0x12c');var _0xd564f6=util['format'](_0x9840('0x173'),this[_0x9840('0xf')]['uniqueid'],rs[_0x9840('0x114')](0x5));var _0x5fcad0=util[_0x9840('0x2c')](_0x9840('0x174'),FILES_PATH,_0xd564f6,_0x331bb2);var _0x469c7f=util[_0x9840('0x2c')](_0x9840('0x12d'),FILES_PATH,_0xd564f6);this[_0x9840('0x3f')][_0x9840('0xb8')](this,_0x1438d0,_0xd564f6,_0x5fcad0);this['channel'][_0x9840('0x9b')](_0x9840('0x175'),_0xd564f6);logger[_0x9840('0x31')](_0x9840('0x176'),_0x469c7f,_0x331bb2,_0x1438d0[_0x9840('0x177')],_0x1438d0[_0x9840('0x67')]);return this['channel'][_0x9840('0x130')](_0x469c7f,_0x331bb2,_0x1438d0[_0x9840('0x177')],_0x1438d0['timeout'],undefined,!![]);};AGIVertices[_0x9840('0x12')][_0x9840('0x178')]=function(_0x1def71){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x179'),_0x1def71[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x1def71[_0x9840('0x65')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x17a'));}var _0x14e366=this['restAPI'][_0x9840('0xb8')](this,_0x1def71);logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x17b'),util[_0x9840('0x17c')](_0x14e366,{'showHidden':![],'depth':null})));if(!this[_0x9840('0x81')](_0x1def71[_0x9840('0xd2')])){return this['channel'][_0x9840('0xa6')](_0x9840('0x17d'));}var _0x183725=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x1def71[_0x9840('0xd2')]);if(!_0x183725){return this[_0x9840('0xf')]['error'](_0x1def71,_0x9840('0xd4'));}this[_0x9840('0xf')][_0x9840('0x9b')](util[_0x9840('0x2c')]('%s_STATUS_CODE',_0x183725),_0x14e366[_0x9840('0x72')]?_0x14e366['statusCode']:_0x9840('0x17e'));this[_0x9840('0xf')]['setVariable'](util[_0x9840('0x2c')](_0x9840('0x17f'),_0x183725),_0x14e366[_0x9840('0x180')]?_0x14e366[_0x9840('0x180')]:'OK');if(_0x14e366['body']){try{this['saveRestApiResult'](_0x14e366['body'],_0x183725);}catch(_0x43fd9f){logger[_0x9840('0x2f')](util[_0x9840('0x2c')](_0x9840('0x181'),_0x183725));}}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')]('variable\x20%s\x20set',_0x183725));};AGIVertices[_0x9840('0x12')][_0x9840('0x182')]=function(_0x3fa6a1){logger['info'](util[_0x9840('0x2c')](_0x9840('0x183'),_0x3fa6a1['label']));return this['channel'][_0x9840('0x184')](_0x3fa6a1['digits'][_0x9840('0xd1')](/\s+/g,''),_0x3fa6a1[_0x9840('0x177')]);};AGIVertices[_0x9840('0x12')][_0x9840('0x185')]=function(_0x5b9922){logger['info'](util[_0x9840('0x2c')](_0x9840('0x186'),_0x5b9922['label']));return this['channel'][_0x9840('0x187')](_0x5b9922[_0x9840('0x68')][_0x9840('0xd1')](/\s+/g,''),_0x5b9922['escape_digits']);};AGIVertices[_0x9840('0x12')][_0x9840('0x188')]=function(_0x3fda28){logger['info'](util[_0x9840('0x2c')](_0x9840('0x189'),_0x3fda28[_0x9840('0x3b')]));return this['channel'][_0x9840('0x18a')](_0x3fda28[_0x9840('0x60')],_0x3fda28[_0x9840('0x177')]);};AGIVertices[_0x9840('0x12')][_0x9840('0x18b')]=function(_0x4f358a){logger['info'](util['format'](_0x9840('0x18c'),_0x4f358a['label']));if(!this[_0x9840('0x81')](_0x4f358a[_0x9840('0x18d')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x18e'));}var _0x183886=this['getMailAccount'][_0x9840('0xb8')](this,_0x4f358a[_0x9840('0x18d')]);if(!_0x183886||!_0x183886[_0x9840('0x18f')]){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4f358a,'no\x20mail\x20account\x20found');}var _0xf40b9d={'from':util[_0x9840('0x2c')](_0x9840('0x190'),_0x183886['name'],_0x183886[_0x9840('0x191')]||_0x183886['Smtp'][_0x9840('0x192')]),'to':_0x4f358a['to']||'','cc':_0x4f358a['cc']||'','bcc':_0x4f358a[_0x9840('0x193')]||'','subject':_0x4f358a[_0x9840('0x194')],'html':_0x4f358a[_0x9840('0x60')],'text':_0x4f358a[_0x9840('0x60')]};var _0x579ef0={'tls':{'rejectUnauthorized':![]}};if(_0x183886[_0x9840('0x18f')][_0x9840('0x195')]){_0x579ef0[_0x9840('0x195')]=_0x183886['Smtp'][_0x9840('0x195')];}else{_0x579ef0[_0x9840('0x196')]=_0x183886[_0x9840('0x18f')][_0x9840('0x196')];_0x579ef0[_0x9840('0x197')]=_0x183886[_0x9840('0x18f')][_0x9840('0x197')];_0x579ef0['secure']=_0x183886[_0x9840('0x18f')][_0x9840('0x198')];}if(_0x183886['Smtp'][_0x9840('0x199')]){_0x579ef0[_0x9840('0x19a')]={'user':_0x183886[_0x9840('0x18f')][_0x9840('0x192')],'pass':_0x183886[_0x9840('0x18f')][_0x9840('0x19b')]};}if(this[_0x9840('0x81')](_0x4f358a[_0x9840('0x19c')])){}logger[_0x9840('0x19d')]('sendMail\x20message',JSON[_0x9840('0x71')](_0xf40b9d));this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x4f358a,_0x4f358a[_0x9840('0x18d')]);this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x19e'),_0x183886[_0x9840('0x16')]));this[_0x9840('0x25')][_0x9840('0xb8')](this,_0x579ef0,_0xf40b9d);return this['channel']['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x9840('0x12')]['sendFax']=function(_0x18421f){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x19f'),_0x18421f[_0x9840('0x3b')]));return this['channel'][_0x9840('0xa6')](_0x9840('0x1a0'));};AGIVertices[_0x9840('0x12')][_0x9840('0x1a1')]=function(_0x541c44){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x541c44[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x541c44[_0x9840('0x1a2')])){return this[_0x9840('0xf')]['noop']('no\x20sms\x20account\x20configured');}var _0x11eebd=this[_0x9840('0x1a3')][_0x9840('0xb8')](this,_0x541c44[_0x9840('0x1a2')]);if(!_0x11eebd){return this['channel'][_0x9840('0x2f')](_0x541c44,'no\x20sms\x20account\x20found');}var _0x362feb={'body':_0x541c44['sms_text'],'phone':_0x541c44['to']||'','SmsAccountId':_0x11eebd['id']};logger[_0x9840('0x19d')](_0x9840('0x1a4'),JSON[_0x9840('0x71')](_0x362feb));this['createSquareDetailsReport'][_0x9840('0xb8')](this,_0x541c44,_0x541c44[_0x9840('0x1a2')]);this['channel'][_0x9840('0xa6')](util['format'](_0x9840('0x1a5'),_0x11eebd[_0x9840('0x16')]));this[_0x9840('0x38')][_0x9840('0xb8')](this,_0x362feb);return this[_0x9840('0xf')]['noop']('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype']['set']=function(_0x4dd898){logger[_0x9840('0x31')](util['format'](_0x9840('0x1a6'),_0x4dd898[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x4dd898[_0x9840('0xd2')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4dd898,'no\x20variable\x20selected');}var _0x5ef937=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x4dd898[_0x9840('0xd2')]);if(!_0x5ef937){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x4dd898,_0x9840('0xd4'));}return this[_0x9840('0xf')][_0x9840('0x9b')](_0x5ef937,_0x4dd898[_0x9840('0x1a7')]);};AGIVertices[_0x9840('0x12')][_0x9840('0x1a8')]=function(_0x1f6fa5){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20START\x20(%s)\x20block',_0x1f6fa5[_0x9840('0x3b')]));this['channel'][_0x9840('0xa6')]('START\x20CALLY\x20SQUARE');if(_0x1f6fa5['answer']===_0x9840('0x1a9')){this[_0x9840('0xf')]['noop'](_0x9840('0x1aa'));return this[_0x9840('0xf')][_0x9840('0xb0')]();}return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x1ab'));};AGIVertices[_0x9840('0x12')][_0x9840('0x1ac')]=function(_0x3c1695){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x1ad'),_0x3c1695[_0x9840('0x3b')]));if(!this[_0x9840('0x81')](_0x3c1695[_0x9840('0x1ae')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x3c1695,'no\x20subproject\x20selected');}var _0x8e0cb9=this[_0x9840('0x18')][_0x9840('0xb8')](this,_0x3c1695[_0x9840('0x1ae')]);if(!this[_0x9840('0x81')](_0x8e0cb9)){return this['channel'][_0x9840('0x2f')](_0x3c1695,util[_0x9840('0x2c')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3c1695[_0x9840('0x1ae')]));}if(_0x8e0cb9===this[_0x9840('0xf')][_0x9840('0x3d')]){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x3c1695,'project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project');}this[_0x9840('0x39')]['sync'](this,_0x3c1695,_0x8e0cb9);var _0x3eb506=this[_0x9840('0xf')][_0x9840('0x5c')](_0x9840('0x1af'),util['format']('agi://%s/square,\x22%s\x22,\x22%s\x22',config[_0x9840('0x8')]['host']||_0x9840('0x1b0'),_0x8e0cb9,this['channel'][_0x9840('0x3d')]));if(_0x3eb506['result']===-0x1){return _0x3eb506;}return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xbc'),_0x9840('0x1af'),_0x8e0cb9));};AGIVertices[_0x9840('0x12')][_0x9840('0x1b1')]=function(_0x13e8ab){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x1b2'),_0x13e8ab[_0x9840('0x3b')]));var _0x3aa22d=this[_0x9840('0x1b3')][_0x9840('0xb8')](this,_0x13e8ab[_0x9840('0xae')]);this[_0x9840('0x39')][_0x9840('0xb8')](this,_0x13e8ab,_0x13e8ab[_0x9840('0xae')]);if(this[_0x9840('0x81')](_0x13e8ab['variable_id'])){var _0x28fe7a=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x13e8ab[_0x9840('0xd2')]);if(_0x28fe7a){this[_0x9840('0xf')][_0x9840('0x9b')](_0x28fe7a,_0x3aa22d);return this['channel'][_0x9840('0xa6')](util[_0x9840('0x2c')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x13e8ab[_0x9840('0xae')],_0x28fe7a));}}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x1b4'),_0x13e8ab[_0x9840('0xae')]));};AGIVertices[_0x9840('0x12')][_0x9840('0x1b5')]=function(_0x264471){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x1b6'),_0x264471['label']));_0x264471['text']=_0x264471['text'][_0x9840('0xd1')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x9840('0x81')](_0x264471[_0x9840('0x1b7')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0x1b8'));}if(!this[_0x9840('0x81')](_0x264471[_0x9840('0x60')])){return this[_0x9840('0xf')][_0x9840('0xa6')](_0x9840('0xa5'));}this['channel'][_0x9840('0xa6')](util['format'](_0x9840('0x1b9'),_0x264471['text']));var _0x3cc58e=this[_0x9840('0x5e')][_0x9840('0xb8')](this,_0x264471);if(_0x3cc58e){this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0x1ba'),_0x3cc58e));var _0x1e3a56=this['channel'][_0x9840('0xfe')](_0x3cc58e);try{fs['unlink'](_0x3cc58e+'.wav');}catch(_0x5e5519){logger['error'](_0x5e5519);}return _0x1e3a56;}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x264471,_0x9840('0x1bb'));};AGIVertices['prototype'][_0x9840('0x1bc')]=function(_0x5b198c){logger[_0x9840('0x31')](util[_0x9840('0x2c')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x5b198c[_0x9840('0x3b')]));_0x5b198c[_0x9840('0x60')]=_0x5b198c[_0x9840('0x60')][_0x9840('0xd1')](/(\r\n|\n|\r)/gm,'\x20');if(!this['isConfigured'](_0x5b198c[_0x9840('0x60')])){return this[_0x9840('0xf')][_0x9840('0xa6')]('no\x20text\x20configured');}this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x1bd'),_0x5b198c['text']));var _0x2ba5fa=this['googleTTS'][_0x9840('0xb8')](this,_0x5b198c);if(_0x2ba5fa){this[_0x9840('0xf')]['noop'](util[_0x9840('0x2c')](_0x9840('0x1be'),_0x2ba5fa));var _0x1cef7d=this[_0x9840('0xf')][_0x9840('0xfe')](_0x2ba5fa);try{fs[_0x9840('0xff')](_0x2ba5fa+_0x9840('0x120'));}catch(_0x49188d){logger[_0x9840('0x2f')](_0x49188d);}return _0x1cef7d;}return this[_0x9840('0xf')][_0x9840('0x2f')](_0x5b198c,'Google\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0x9840('0x1bf')]=function(_0x15eb80){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x1c0'),_0x15eb80['label']));if(!this['isConfigured'](_0x15eb80[_0x9840('0x151')])){return this[_0x9840('0xf')][_0x9840('0x2f')](_0x15eb80,'no\x20find\x20by\x20configured');}logger[_0x9840('0x31')](util['format'](_0x9840('0x153'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x15eb80[_0x9840('0x151')]));var _0x48b25d=this[_0x9840('0x58')][_0x9840('0xb8')](this,_0x15eb80[_0x9840('0x151')]);if(_0x48b25d){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x15eb80['findBy']));this['channel']['noop'](util[_0x9840('0x2c')](_0x9840('0x154'),this[_0x9840('0xf')][_0x9840('0x3e')],_0x15eb80[_0x9840('0x151')]));return{'code':0xc8,'result':_0x9840('0x164')};}else{logger[_0x9840('0x31')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x9840('0xf')][_0x9840('0x3e')],_0x15eb80[_0x9840('0x151')]));this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0x155'),this[_0x9840('0xf')]['callerid'],_0x15eb80[_0x9840('0x151')]));return{'code':0xc8,'result':_0x9840('0x156')};}};AGIVertices['prototype'][_0x9840('0x1c1')]=function(_0x18375b){logger[_0x9840('0x31')](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x18375b[_0x9840('0x3b')]));var _0x1d8fec=this[_0x9840('0xf')][_0x9840('0x5c')](_0x9840('0x1c2'),[_0x18375b['mailbox'],_0x18375b[_0x9840('0x75')]]);if(_0x1d8fec[_0x9840('0x9f')]===-0x1){return _0x1d8fec;}return this[_0x9840('0xf')][_0x9840('0xa6')](util[_0x9840('0x2c')](_0x9840('0xbc'),_0x9840('0x1c2'),_0x18375b[_0x9840('0x1c3')]));};AGIVertices['prototype'][_0x9840('0x1c4')]=function(_0x841f60){logger[_0x9840('0x31')](util[_0x9840('0x2c')](_0x9840('0x1c5'),_0x841f60['label']));if(!this[_0x9840('0x81')](_0x841f60[_0x9840('0xd2')])){return this['channel']['error'](_0x841f60,_0x9840('0x1c6'));}var _0x495eaf=this[_0x9840('0x13')][_0x9840('0xb8')](this,_0x841f60[_0x9840('0xd2')]);if(!_0x495eaf){return this['channel'][_0x9840('0x2f')](_0x841f60,'no\x20variable\x20found');}var _0x3bb388=this[_0x9840('0xf')]['getVariable'](_0x495eaf);return{'code':0xc8,'result':_0x3bb388[_0x9840('0x9d')]?_0x3bb388[_0x9840('0x9d')]:'-'};};String[_0x9840('0x12')][_0x9840('0x1c7')]=function(_0x4c9952,_0xa65514){return this['split'](_0x4c9952)[_0x9840('0x1c8')](_0xa65514);};module[_0x9840('0x1c9')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f387f85..b9f1219 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 _0xbbea=['error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','isNil','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','timer'];(function(_0x491768,_0x44a0e8){var _0x567b81=function(_0xaa8d45){while(--_0xaa8d45){_0x491768['push'](_0x491768['shift']());}};_0x567b81(++_0x44a0e8);}(_0xbbea,0x11d));var _0xabbe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbbea[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xabbe('0x0'));var _=require(_0xabbe('0x1'));var moment=require(_0xabbe('0x2'));var ami=require(_0xabbe('0x3'));var logger=require(_0xabbe('0x4'))('acw');var RpcUser=require(_0xabbe('0x5'));var RpcVoiceAgentReport=require(_0xabbe('0x6'));function Acw(_0x2bbab6){this[_0xabbe('0x7')]=_0x2bbab6[_0xabbe('0x7')];this[_0xabbe('0x8')]=_0x2bbab6[_0xabbe('0x8')];this[_0xabbe('0x9')]=_0x2bbab6[_0xabbe('0x9')];this[_0xabbe('0xa')]={};ami['on']('agentconnect',this[_0xabbe('0xb')][_0xabbe('0xc')](this));ami['on'](_0xabbe('0xd'),this['syncHangupRequest']['bind'](this));ami['on'](_0xabbe('0xe'),this[_0xabbe('0xf')]['bind'](this));ami['on']('agentringnoanswer',this[_0xabbe('0x10')]['bind'](this));ami['on'](_0xabbe('0x11'),this[_0xabbe('0x12')][_0xabbe('0xc')](this));ami['on'](_0xabbe('0x13'),this[_0xabbe('0x14')][_0xabbe('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0xabbe('0xc')](this));}function getDiff(_0xf43f99){var _0xb23250=moment()[_0xabbe('0x15')](0x0);var _0x2141e7=moment(_0xf43f99)[_0xabbe('0x15')](0x0);return _0xb23250['diff'](_0x2141e7,_0xabbe('0x16'));}Acw[_0xabbe('0x17')][_0xabbe('0x18')]=function(_0x499f03){try{var _0x2ed225=this;var _0x585199=this[_0xabbe('0xa')][_0x499f03][_0xabbe('0x19')];var _0x3c96eb=this[_0xabbe('0xa')][_0x499f03][_0xabbe('0x1a')];var _0xcd6d2f=this[_0xabbe('0x7')][_0x3c96eb];var _0x2a24ec=![];var _0xdcd7d9=_0xabbe('0x1b');if(_0xcd6d2f[_0xabbe('0x1c')]){if(_0xcd6d2f[_0xabbe('0x1d')][_0xabbe('0x1e')]){_0x2a24ec=!![];_0xdcd7d9=_0xcd6d2f[_0xabbe('0x1d')]['name'];}}ami[_0xabbe('0x1f')]({'action':_0xabbe('0x20'),'interface':_0x585199,'paused':!![],'reason':_0xdcd7d9})['then'](function(_0xbac2c8){if(_0x2ed225[_0xabbe('0x8')][_0x585199]){return RpcUser[_0xabbe('0x21')](_0x2ed225[_0xabbe('0x8')][_0x585199]['id'])[_0xabbe('0x22')](function(_0x392cdc){if(_0x392cdc&&!_0x392cdc['voicePause']){logger[_0xabbe('0x23')](_0xabbe('0x24'),_0x499f03,_0x585199,_0x3c96eb);var _0x5a7d91=_0x2ed225['channels'][_0x499f03][_0xabbe('0x25')]&&_0x2ed225['channels'][_0x499f03]['destlinkedid']?_0x2ed225[_0xabbe('0xa')][_0x499f03][_0xabbe('0x26')]:_0x499f03;return RpcUser['savePause'](_0x2ed225[_0xabbe('0x8')][_0x585199],_0xdcd7d9,_0x5a7d91)[_0xabbe('0x22')](function(_0x144e74){if(!_0x2a24ec){_0x2ed225[_0xabbe('0x9')][_0x585199]={};logger['info'](_0xabbe('0x27'),_0x499f03,_0x2ed225['voiceQueues'][_0x3c96eb][_0xabbe('0x28')],_0x585199,_0x3c96eb);_0x2ed225['timers'][_0x585199]['timer']=setTimeout(_0x2ed225[_0xabbe('0x29')][_0xabbe('0xc')](_0x2ed225,_0x585199),_0x2ed225['voiceQueues'][_0x3c96eb][_0xabbe('0x28')]*0x3e8);_0x2ed225['timers'][_0x585199][_0xabbe('0x2a')]=moment()['format'](_0xabbe('0x2b'));_0x2ed225['timers'][_0x585199][_0xabbe('0x2c')]=_0x499f03;_0x2ed225[_0xabbe('0x9')][_0x585199][_0xabbe('0x1a')]=_0x3c96eb;_0x2ed225[_0xabbe('0x9')][_0x585199][_0xabbe('0x2d')]=function(){var _0xcedba6=getDiff(_0x2ed225[_0xabbe('0x9')][_0x585199][_0xabbe('0x2a')]);clearTimeout(_0x2ed225['timers'][_0x585199][_0xabbe('0x2e')]);_0x2ed225['timers'][_0x585199][_0xabbe('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xcedba6},_0x2ed225['timers'][_0x585199][_0xabbe('0x2c')],_0x585199)['then'](function(_0x2591b3){logger[_0xabbe('0x23')]('[%s][UPDATE][ACWTIME:%s]',_0x499f03,_0xcedba6,_0x2591b3);})['catch'](function(_0x19ec51){logger[_0xabbe('0x2f')](_0xabbe('0x30'),_0x499f03,_0x19ec51);});delete _0x2ed225[_0xabbe('0x9')][_0x585199];};}});}else{logger['info'](_0xabbe('0x31'),_0x499f03,_0x585199,_0x3c96eb);}});}})['catch'](function(_0xf20035){logger[_0xabbe('0x2f')](_0xabbe('0x27'),_0x499f03,_0x2ed225['voiceQueues'][_0x3c96eb][_0xabbe('0x28')],_0x585199,_0x3c96eb);})[_0xabbe('0x32')](function(){delete _0x2ed225[_0xabbe('0xa')][_0x499f03];});}catch(_0x49a1dd){logger[_0xabbe('0x2f')]('[ACW][START]\x20%s',_0x49a1dd[_0xabbe('0x33')]);}};Acw['prototype']['stopAcw']=function(_0x3b274c){try{var _0xb33101=this;if(_0xb33101[_0xabbe('0x9')][_0x3b274c]){_0xb33101[_0xabbe('0x9')][_0x3b274c][_0xabbe('0x2e')]=![];var _0x121b89=_0xb33101[_0xabbe('0x9')][_0x3b274c]['uniqueid'];var _0x133f6d=_0xb33101[_0xabbe('0x9')][_0x3b274c][_0xabbe('0x1a')];var _0x205546=_0xb33101['voiceQueues'][_0x133f6d][_0xabbe('0x28')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x121b89,_0x3b274c);RpcUser[_0xabbe('0x34')](this[_0xabbe('0x8')][_0x3b274c]);RpcVoiceAgentReport[_0xabbe('0x35')]({'acwtime':_0x205546,'agentacw':!![]},_0x121b89,_0x3b274c)[_0xabbe('0x22')](function(_0x2bd3ae){logger['info'](_0xabbe('0x36'),_0x121b89,_0x205546,_0x2bd3ae);})[_0xabbe('0x37')](function(_0x2d8129){logger['error'](_0xabbe('0x30'),_0x121b89,_0x2d8129);});}else{logger[_0xabbe('0x2f')](_0xabbe('0x38'),_0x3b274c);if(_0xb33101[_0xabbe('0x9')]){logger[_0xabbe('0x23')](_0xabbe('0x39'),JSON[_0xabbe('0x3a')](_0xb33101[_0xabbe('0x9')]));}}}catch(_0x3214aa){logger['error']('[ACW][STOP]\x20%s',_0x3214aa[_0xabbe('0x33')]);}};Acw['prototype'][_0xabbe('0xb')]=function(_0x33650a){try{if(this[_0xabbe('0x7')][_0x33650a['queue']]&&(this['voiceQueues'][_0x33650a[_0xabbe('0x1a')]]['acw']||this[_0xabbe('0x7')][_0x33650a[_0xabbe('0x1a')]][_0xabbe('0x1c')])){if(this[_0xabbe('0x8')][_0x33650a[_0xabbe('0x19')]]){this[_0xabbe('0xa')][_0x33650a['uniqueid']]={'queue':_0x33650a[_0xabbe('0x1a')],'interface':_0x33650a[_0xabbe('0x19')],'destlinkedid':_0x33650a[_0xabbe('0x26')]};}}}catch(_0xf958d7){logger[_0xabbe('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0xf958d7[_0xabbe('0x33')]);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4fe3bc){try{if(this[_0xabbe('0x7')][_0x4fe3bc['queue']]&&(this[_0xabbe('0x7')][_0x4fe3bc[_0xabbe('0x1a')]][_0xabbe('0x3b')]||this[_0xabbe('0x7')][_0x4fe3bc[_0xabbe('0x1a')]]['mandatoryDisposition'])){if(this['agents'][_0x4fe3bc[_0xabbe('0x19')]]){this[_0xabbe('0xa')][_0x4fe3bc[_0xabbe('0x2c')]]={'queue':_0x4fe3bc['queue'],'interface':_0x4fe3bc[_0xabbe('0x19')]};}}}catch(_0xa08c2d){logger['error'](_0xabbe('0x3c'),_0xa08c2d[_0xabbe('0x33')]);}};Acw['prototype']['syncHangupRequest']=function(_0x4d7e59){try{if(this[_0xabbe('0xa')][_0x4d7e59[_0xabbe('0x2c')]]&&_[_0xabbe('0x3d')](this[_0xabbe('0xa')][_0x4d7e59[_0xabbe('0x2c')]][_0xabbe('0x25')])){logger[_0xabbe('0x23')](_0xabbe('0x3e'),_0x4d7e59[_0xabbe('0x2c')]);this[_0xabbe('0x18')](_0x4d7e59['uniqueid']);}else if(this[_0xabbe('0xa')][_0x4d7e59['linkedid']]&&_['isUndefined'](this[_0xabbe('0xa')][_0x4d7e59[_0xabbe('0x3f')]][_0xabbe('0x25')])){logger[_0xabbe('0x23')]('[%s][HANGUP:LINKEDID]',_0x4d7e59[_0xabbe('0x3f')]);this[_0xabbe('0x18')](_0x4d7e59[_0xabbe('0x3f')]);}}catch(_0x204a4a){logger[_0xabbe('0x2f')](_0xabbe('0x40'),_0x204a4a[_0xabbe('0x33')]);}};Acw[_0xabbe('0x17')]['syncHangup']=function(_0x62ab7c){try{if(this['channels'][_0x62ab7c[_0xabbe('0x2c')]]&&this['channels'][_0x62ab7c[_0xabbe('0x2c')]][_0xabbe('0x25')]){logger[_0xabbe('0x23')](_0xabbe('0x41'),_0x62ab7c[_0xabbe('0x2c')]);this[_0xabbe('0x18')](_0x62ab7c[_0xabbe('0x2c')]);}else if(this[_0xabbe('0xa')][_0x62ab7c[_0xabbe('0x3f')]]&&this[_0xabbe('0xa')][_0x62ab7c[_0xabbe('0x3f')]][_0xabbe('0x25')]){logger[_0xabbe('0x23')](_0xabbe('0x42'),_0x62ab7c[_0xabbe('0x3f')]);this['startAcw'](_0x62ab7c['linkedid']);}}catch(_0x4b740b){logger[_0xabbe('0x2f')](_0xabbe('0x43'),_0x4b740b[_0xabbe('0x33')]);}};Acw[_0xabbe('0x17')][_0xabbe('0x12')]=function(_0x3ee613){try{if(!_['isNil'](this['channels'][_0x3ee613['transfereeuniqueid']])){this['startAcw'](_0x3ee613[_0xabbe('0x44')]);if(this['channels'][_0x3ee613[_0xabbe('0x45')]]){this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x45')]][_0xabbe('0x25')]=!![];this['channels'][_0x3ee613['transfertargetuniqueid']]=this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x45')]];delete this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x45')]];}}else if(!_[_0xabbe('0x46')](this[_0xabbe('0xa')][_0x3ee613['transfertargetuniqueid']])){this['startAcw'](_0x3ee613[_0xabbe('0x47')]);if(this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x48')]]){this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x48')]][_0xabbe('0x25')]=!![];this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x44')]]=this[_0xabbe('0xa')][_0x3ee613[_0xabbe('0x48')]];delete this['channels'][_0x3ee613[_0xabbe('0x48')]];}}}catch(_0x5e5a8c){logger[_0xabbe('0x2f')](_0xabbe('0x49'),_0x5e5a8c[_0xabbe('0x33')]);}};Acw[_0xabbe('0x17')][_0xabbe('0x14')]=function(_0x39b905){try{if(this[_0xabbe('0xa')][_0x39b905['transfereruniqueid']]){logger['info'](_0xabbe('0x4a'),JSON[_0xabbe('0x3a')](_0x39b905[_0xabbe('0x4b')]));this[_0xabbe('0x18')](_0x39b905['transfereruniqueid']);}else if(this[_0xabbe('0xa')][_0x39b905[_0xabbe('0x4c')]]){logger[_0xabbe('0x23')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xabbe('0x3a')](_0x39b905[_0xabbe('0x4c')]));this[_0xabbe('0x18')](_0x39b905['transfererlinkedid']);}}catch(_0x136083){logger['error'](_0xabbe('0x4d'),_0x136083[_0xabbe('0x33')]);}};Acw['prototype'][_0xabbe('0x10')]=function(_0x442491){try{if(this[_0xabbe('0x7')][_0x442491[_0xabbe('0x1a')]]&&this[_0xabbe('0x7')][_0x442491[_0xabbe('0x1a')]][_0xabbe('0x4e')]===_0xabbe('0x4f')){if(this[_0xabbe('0x8')][_0x442491[_0xabbe('0x19')]]){logger['info']('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x442491['uniqueid'],_0x442491['interface'],_0x442491['queue']);return RpcUser[_0xabbe('0x50')](this[_0xabbe('0x8')][_0x442491['interface']],_0xabbe('0x51'),_0x442491[_0xabbe('0x2c')]);}}}catch(_0x4b5949){logger['error'](_0xabbe('0x52'),_0x4b5949['message']);}};module['exports']=Acw; \ No newline at end of file +var _0xd8c6=['../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','attendedtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','interface','queue','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','then','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','message','stopAcw','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','startAcw','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','../../../config/logger','acw'];(function(_0xd02bb,_0x26e2d0){var _0x1cdf23=function(_0x18fd05){while(--_0x18fd05){_0xd02bb['push'](_0xd02bb['shift']());}};_0x1cdf23(++_0x26e2d0);}(_0xd8c6,0xa2));var _0x6d8c=function(_0x4be3ec,_0x218441){_0x4be3ec=_0x4be3ec-0x0;var _0x44b79f=_0xd8c6[_0x4be3ec];return _0x44b79f;};'use strict';var util=require(_0x6d8c('0x0'));var _=require(_0x6d8c('0x1'));var moment=require('moment');var ami=require('../ami');var logger=require(_0x6d8c('0x2'))(_0x6d8c('0x3'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x6d8c('0x4'));function Acw(_0x1a551d){this[_0x6d8c('0x5')]=_0x1a551d['voiceQueues'];this[_0x6d8c('0x6')]=_0x1a551d[_0x6d8c('0x6')];this[_0x6d8c('0x7')]=_0x1a551d[_0x6d8c('0x7')];this[_0x6d8c('0x8')]={};ami['on'](_0x6d8c('0x9'),this[_0x6d8c('0xa')]['bind'](this));ami['on'](_0x6d8c('0xb'),this['syncHangupRequest'][_0x6d8c('0xc')](this));ami['on'](_0x6d8c('0xd'),this[_0x6d8c('0xe')]['bind'](this));ami['on'](_0x6d8c('0xf'),this['syncAgentRingNoAnswer'][_0x6d8c('0xc')](this));ami['on'](_0x6d8c('0x10'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x6d8c('0x11')][_0x6d8c('0xc')](this));ami['on'](_0x6d8c('0x12'),this[_0x6d8c('0x13')][_0x6d8c('0xc')](this));}function getDiff(_0x315fdd){var _0x64735d=moment()[_0x6d8c('0x14')](0x0);var _0x22dac1=moment(_0x315fdd)[_0x6d8c('0x14')](0x0);return _0x64735d[_0x6d8c('0x15')](_0x22dac1,_0x6d8c('0x16'));}Acw[_0x6d8c('0x17')]['startAcw']=function(_0x18276e){try{var _0x7618d0=this;var _0x3254e7=this[_0x6d8c('0x8')][_0x18276e][_0x6d8c('0x18')];var _0x5b75b5=this['channels'][_0x18276e][_0x6d8c('0x19')];var _0x5c73b6=this[_0x6d8c('0x5')][_0x5b75b5];var _0x278658=![];var _0x5bd85c=_0x6d8c('0x1a');if(_0x5c73b6[_0x6d8c('0x1b')]){if(_0x5c73b6['mandatoryDispositionPause'][_0x6d8c('0x1c')]){_0x278658=!![];_0x5bd85c=_0x5c73b6[_0x6d8c('0x1d')][_0x6d8c('0x1c')];}}ami[_0x6d8c('0x1e')]({'action':_0x6d8c('0x1f'),'interface':_0x3254e7,'paused':!![],'reason':_0x5bd85c})['then'](function(_0x1a23f6){if(_0x7618d0[_0x6d8c('0x6')][_0x3254e7]){return RpcUser[_0x6d8c('0x20')](_0x7618d0[_0x6d8c('0x6')][_0x3254e7]['id'])[_0x6d8c('0x21')](function(_0x33f32b){if(_0x33f32b&&!_0x33f32b['voicePause']){logger[_0x6d8c('0x22')](_0x6d8c('0x23'),_0x18276e,_0x3254e7,_0x5b75b5);var _0x12360b=_0x7618d0[_0x6d8c('0x8')][_0x18276e]['attended']&&_0x7618d0['channels'][_0x18276e][_0x6d8c('0x24')]?_0x7618d0[_0x6d8c('0x8')][_0x18276e][_0x6d8c('0x24')]:_0x18276e;return RpcUser[_0x6d8c('0x25')](_0x7618d0[_0x6d8c('0x6')][_0x3254e7],_0x5bd85c,_0x12360b)[_0x6d8c('0x21')](function(_0x151ccd){if(!_0x278658){_0x7618d0['timers'][_0x3254e7]={};logger[_0x6d8c('0x22')](_0x6d8c('0x26'),_0x18276e,_0x7618d0[_0x6d8c('0x5')][_0x5b75b5][_0x6d8c('0x27')],_0x3254e7,_0x5b75b5);_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x28')]=setTimeout(_0x7618d0['stopAcw'][_0x6d8c('0xc')](_0x7618d0,_0x3254e7),_0x7618d0[_0x6d8c('0x5')][_0x5b75b5][_0x6d8c('0x27')]*0x3e8);_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x7618d0['timers'][_0x3254e7][_0x6d8c('0x2a')]=_0x18276e;_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x19')]=_0x5b75b5;_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x2b')]=function(){var _0x262fd7=getDiff(_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x29')]);clearTimeout(_0x7618d0['timers'][_0x3254e7]['timer']);_0x7618d0[_0x6d8c('0x7')][_0x3254e7][_0x6d8c('0x28')]=![];RpcVoiceAgentReport[_0x6d8c('0x2c')]({'acwtime':_0x262fd7},_0x7618d0[_0x6d8c('0x7')][_0x3254e7]['uniqueid'],_0x3254e7)['then'](function(_0x2d857e){logger[_0x6d8c('0x22')](_0x6d8c('0x2d'),_0x18276e,_0x262fd7,_0x2d857e);})['catch'](function(_0x1e66e6){logger[_0x6d8c('0x2e')](_0x6d8c('0x2f'),_0x18276e,_0x1e66e6);});delete _0x7618d0[_0x6d8c('0x7')][_0x3254e7];};}});}else{logger['info'](_0x6d8c('0x30'),_0x18276e,_0x3254e7,_0x5b75b5);}});}})[_0x6d8c('0x31')](function(_0x52ed18){logger[_0x6d8c('0x2e')](_0x6d8c('0x26'),_0x18276e,_0x7618d0[_0x6d8c('0x5')][_0x5b75b5]['acwTimeout'],_0x3254e7,_0x5b75b5);})[_0x6d8c('0x32')](function(){delete _0x7618d0[_0x6d8c('0x8')][_0x18276e];});}catch(_0x35fa20){logger[_0x6d8c('0x2e')](_0x6d8c('0x33'),_0x35fa20[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')][_0x6d8c('0x35')]=function(_0x347228){try{var _0x5a43e5=this;if(_0x5a43e5[_0x6d8c('0x7')][_0x347228]){_0x5a43e5[_0x6d8c('0x7')][_0x347228][_0x6d8c('0x28')]=![];var _0x227451=_0x5a43e5[_0x6d8c('0x7')][_0x347228]['uniqueid'];var _0x390807=_0x5a43e5[_0x6d8c('0x7')][_0x347228][_0x6d8c('0x19')];var _0xfa9ccd=_0x5a43e5['voiceQueues'][_0x390807][_0x6d8c('0x27')];logger['info'](_0x6d8c('0x36'),_0x227451,_0x347228);RpcUser['saveUnpause'](this[_0x6d8c('0x6')][_0x347228]);RpcVoiceAgentReport['update']({'acwtime':_0xfa9ccd,'agentacw':!![]},_0x227451,_0x347228)[_0x6d8c('0x21')](function(_0x1fc1dc){logger[_0x6d8c('0x22')]('[%s][UPDATE][ACWTIME:%s]',_0x227451,_0xfa9ccd,_0x1fc1dc);})[_0x6d8c('0x31')](function(_0xce2b7d){logger[_0x6d8c('0x2e')](_0x6d8c('0x2f'),_0x227451,_0xce2b7d);});}else{logger[_0x6d8c('0x2e')](_0x6d8c('0x37'),_0x347228);if(_0x5a43e5[_0x6d8c('0x7')]){logger[_0x6d8c('0x22')](_0x6d8c('0x38'),JSON[_0x6d8c('0x39')](_0x5a43e5[_0x6d8c('0x7')]));}}}catch(_0x19d163){logger[_0x6d8c('0x2e')](_0x6d8c('0x3a'),_0x19d163[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')]['syncAgentConnect']=function(_0x1941aa){try{if(this['voiceQueues'][_0x1941aa['queue']]&&(this[_0x6d8c('0x5')][_0x1941aa[_0x6d8c('0x19')]][_0x6d8c('0x3')]||this[_0x6d8c('0x5')][_0x1941aa[_0x6d8c('0x19')]][_0x6d8c('0x1b')])){if(this[_0x6d8c('0x6')][_0x1941aa['interface']]){this[_0x6d8c('0x8')][_0x1941aa[_0x6d8c('0x2a')]]={'queue':_0x1941aa['queue'],'interface':_0x1941aa[_0x6d8c('0x18')],'destlinkedid':_0x1941aa[_0x6d8c('0x24')]};}}}catch(_0x484843){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x484843[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')]['syncAgentConnectPreview']=function(_0xe070e6){try{if(this['voiceQueues'][_0xe070e6['queue']]&&(this[_0x6d8c('0x5')][_0xe070e6[_0x6d8c('0x19')]][_0x6d8c('0x3')]||this[_0x6d8c('0x5')][_0xe070e6[_0x6d8c('0x19')]][_0x6d8c('0x1b')])){if(this[_0x6d8c('0x6')][_0xe070e6['interface']]){this[_0x6d8c('0x8')][_0xe070e6[_0x6d8c('0x2a')]]={'queue':_0xe070e6[_0x6d8c('0x19')],'interface':_0xe070e6['interface']};}}}catch(_0x53c78b){logger['error'](_0x6d8c('0x3b'),_0x53c78b[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')]['syncHangupRequest']=function(_0x5ae984){try{if(this[_0x6d8c('0x8')][_0x5ae984['uniqueid']]&&_[_0x6d8c('0x3c')](this['channels'][_0x5ae984[_0x6d8c('0x2a')]][_0x6d8c('0x3d')])){logger[_0x6d8c('0x22')]('[%s][HANGUP:UNIQUEID]',_0x5ae984[_0x6d8c('0x2a')]);this[_0x6d8c('0x3e')](_0x5ae984['uniqueid']);}else if(this[_0x6d8c('0x8')][_0x5ae984[_0x6d8c('0x3f')]]&&_['isUndefined'](this[_0x6d8c('0x8')][_0x5ae984[_0x6d8c('0x3f')]][_0x6d8c('0x3d')])){logger[_0x6d8c('0x22')](_0x6d8c('0x40'),_0x5ae984[_0x6d8c('0x3f')]);this['startAcw'](_0x5ae984[_0x6d8c('0x3f')]);}}catch(_0x5e50d4){logger[_0x6d8c('0x2e')](_0x6d8c('0x41'),_0x5e50d4[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')][_0x6d8c('0xe')]=function(_0x5183bd){try{if(this[_0x6d8c('0x8')][_0x5183bd[_0x6d8c('0x2a')]]&&this[_0x6d8c('0x8')][_0x5183bd[_0x6d8c('0x2a')]]['attended']){logger[_0x6d8c('0x22')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5183bd[_0x6d8c('0x2a')]);this[_0x6d8c('0x3e')](_0x5183bd['uniqueid']);}else if(this[_0x6d8c('0x8')][_0x5183bd['linkedid']]&&this[_0x6d8c('0x8')][_0x5183bd[_0x6d8c('0x3f')]][_0x6d8c('0x3d')]){logger[_0x6d8c('0x22')](_0x6d8c('0x42'),_0x5183bd[_0x6d8c('0x3f')]);this['startAcw'](_0x5183bd[_0x6d8c('0x3f')]);}}catch(_0x510653){logger['error']('[ACW][syncHangup]\x20%s',_0x510653[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')][_0x6d8c('0x43')]=function(_0x14f898){try{if(!_[_0x6d8c('0x44')](this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x45')]])){this[_0x6d8c('0x3e')](_0x14f898['transfereeuniqueid']);if(this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x46')]]){this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x46')]][_0x6d8c('0x3d')]=!![];this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x47')]]=this[_0x6d8c('0x8')][_0x14f898['secondtransfereruniqueid']];delete this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x46')]];}}else if(!_[_0x6d8c('0x44')](this['channels'][_0x14f898[_0x6d8c('0x47')]])){this[_0x6d8c('0x3e')](_0x14f898[_0x6d8c('0x47')]);if(this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x48')]]){this['channels'][_0x14f898['origtransfereruniqueid']][_0x6d8c('0x3d')]=!![];this[_0x6d8c('0x8')][_0x14f898[_0x6d8c('0x45')]]=this['channels'][_0x14f898[_0x6d8c('0x48')]];delete this[_0x6d8c('0x8')][_0x14f898['origtransfereruniqueid']];}}}catch(_0x2e2cb2){logger[_0x6d8c('0x2e')](_0x6d8c('0x49'),_0x2e2cb2[_0x6d8c('0x34')]);}};Acw[_0x6d8c('0x17')][_0x6d8c('0x11')]=function(_0x3acce7){try{if(this[_0x6d8c('0x8')][_0x3acce7[_0x6d8c('0x4a')]]){logger[_0x6d8c('0x22')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x6d8c('0x39')](_0x3acce7[_0x6d8c('0x4a')]));this[_0x6d8c('0x3e')](_0x3acce7[_0x6d8c('0x4a')]);}else if(this['channels'][_0x3acce7[_0x6d8c('0x4b')]]){logger[_0x6d8c('0x22')](_0x6d8c('0x4c'),JSON['stringify'](_0x3acce7[_0x6d8c('0x4b')]));this[_0x6d8c('0x3e')](_0x3acce7['transfererlinkedid']);}}catch(_0x34d0ec){logger['error'](_0x6d8c('0x4d'),_0x34d0ec[_0x6d8c('0x34')]);}};Acw['prototype'][_0x6d8c('0x4e')]=function(_0xfa7cbd){try{if(this['voiceQueues'][_0xfa7cbd[_0x6d8c('0x19')]]&&this[_0x6d8c('0x5')][_0xfa7cbd[_0x6d8c('0x19')]][_0x6d8c('0x4f')]==='all'){if(this['agents'][_0xfa7cbd['interface']]){logger[_0x6d8c('0x22')](_0x6d8c('0x50'),_0xfa7cbd[_0x6d8c('0x2a')],_0xfa7cbd['interface'],_0xfa7cbd[_0x6d8c('0x19')]);return RpcUser[_0x6d8c('0x25')](this[_0x6d8c('0x6')][_0xfa7cbd[_0x6d8c('0x18')]],'Auto-Pause',_0xfa7cbd[_0x6d8c('0x2a')]);}}}catch(_0x4afa46){logger[_0x6d8c('0x2e')](_0x6d8c('0x51'),_0x4afa46[_0x6d8c('0x34')]);}};module[_0x6d8c('0x52')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 4ccdcce..a7bac5e 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 _0xd8b0=['actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','[ami.js][fullybooted]','exports','asterisk-manager','bluebird','../../config/logger','ami','../../config/environment','asterisk','port','username','password','Action','promisify','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus'];(function(_0x2ebf13,_0x2f3db3){var _0x2bf0de=function(_0x190ff2){while(--_0x190ff2){_0x2ebf13['push'](_0x2ebf13['shift']());}};_0x2bf0de(++_0x2f3db3);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Manager=require(_0x0d8b('0x0'));var BPromise=require(_0x0d8b('0x1'));var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x0d8b('0x2'))(_0x0d8b('0x3'));var config=require(_0x0d8b('0x4'));var ami=new Manager(config[_0x0d8b('0x5')][_0x0d8b('0x6')],config['asterisk']['ip'],config['asterisk'][_0x0d8b('0x7')],config[_0x0d8b('0x5')][_0x0d8b('0x8')],!![]);ami['keepConnected']();ami[_0x0d8b('0x9')]=BPromise[_0x0d8b('0xa')](ami['action']);function error(_0x129310){logger[_0x0d8b('0xb')](util[_0x0d8b('0xc')](_0x0d8b('0xd'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port'],util[_0x0d8b('0xe')](_0x129310,![],null)));}function close(){logger['error'](util[_0x0d8b('0xc')](_0x0d8b('0xf'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')]));}ami[_0x0d8b('0x10')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x11')});};};ami[_0x0d8b('0x12')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x13')});};};ami[_0x0d8b('0x14')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x15')});};};ami[_0x0d8b('0x16')]=function(){return function(){return ami[_0x0d8b('0x9')]({'action':_0x0d8b('0x17')});};};ami[_0x0d8b('0x18')]=function(){return function(){return ami['Action']({'action':_0x0d8b('0x19')});};};function connect(_0x4586c2){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x1b'),config[_0x0d8b('0x5')][_0x0d8b('0x7')],config[_0x0d8b('0x5')]['ip'],config['asterisk'][_0x0d8b('0x6')]));ami[_0x0d8b('0x1c')](_0x0d8b('0xb'),error);ami[_0x0d8b('0x1c')](_0x0d8b('0x1d'),close);}ami['on'](_0x0d8b('0x1e'),connect);ami['on'](_0x0d8b('0x1f'),function(_0x352c17){logger['info'](util['format'](_0x0d8b('0x20'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0d8b('0x5')][_0x0d8b('0x6')],util[_0x0d8b('0xe')](_0x352c17,![],null)));});ami['on'](_0x0d8b('0x21'),function(_0x221071){logger[_0x0d8b('0x1a')](util[_0x0d8b('0xc')](_0x0d8b('0x22'),config[_0x0d8b('0x5')]['username'],config[_0x0d8b('0x5')]['ip'],config[_0x0d8b('0x5')]['port']));return BPromise[_0x0d8b('0x23')]()['then'](ami[_0x0d8b('0x10')]())[_0x0d8b('0x24')](ami[_0x0d8b('0x12')]())['then'](ami['actionSipPeerStatus']())[_0x0d8b('0x24')](ami[_0x0d8b('0x16')]())['then'](ami[_0x0d8b('0x18')]())['catch'](function(_0x1b2b59){logger['error'](_0x0d8b('0x25'),util['inspect'](_0x1b2b59,{'showHidden':![],'depth':null}));});});ami[_0x0d8b('0x1c')]('error',error);ami[_0x0d8b('0x1c')]('close',close);module[_0x0d8b('0x26')]=ami; \ No newline at end of file +var _0xb7e7=['username','Action','devicestatelist','actionSipPeerStatus','sippeerstatus','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionSipShowRegistry','actionDeviceStateList','catch','[ami.js][fullybooted]','exports','asterisk-manager','moment','lodash','ami','asterisk','port','password','keepConnected','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s'];(function(_0x4c14d9,_0x267621){var _0x17b224=function(_0x59fd74){while(--_0x59fd74){_0x4c14d9['push'](_0x4c14d9['shift']());}};_0x17b224(++_0x267621);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xb7e7[_0x1c8c28];return _0x1f59b4;};'use strict';var Manager=require(_0x7b7e('0x0'));var BPromise=require('bluebird');var moment=require(_0x7b7e('0x1'));var util=require('util');var _=require(_0x7b7e('0x2'));var logger=require('../../config/logger')(_0x7b7e('0x3'));var config=require('../../config/environment');var ami=new Manager(config[_0x7b7e('0x4')][_0x7b7e('0x5')],config[_0x7b7e('0x4')]['ip'],config['asterisk']['username'],config[_0x7b7e('0x4')][_0x7b7e('0x6')],!![]);ami[_0x7b7e('0x7')]();ami['Action']=BPromise[_0x7b7e('0x8')](ami[_0x7b7e('0x9')]);function error(_0x2917f9){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xc'),config[_0x7b7e('0x4')]['username'],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x2917f9,![],null)));}function close(){logger[_0x7b7e('0xa')](util[_0x7b7e('0xb')](_0x7b7e('0xe'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x11')});};};ami[_0x7b7e('0x12')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x13')});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':_0x7b7e('0x14')});};};ami[_0x7b7e('0x15')]=function(){return function(){return ami[_0x7b7e('0x10')]({'action':_0x7b7e('0x16')});};};function connect(_0x2cc400){logger[_0x7b7e('0x17')](util[_0x7b7e('0xb')](_0x7b7e('0x18'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')]));ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')](_0x7b7e('0x1a'),close);}ami['on']('connect',connect);ami['on'](_0x7b7e('0x1b'),function(_0x43db4f){logger[_0x7b7e('0x17')](util['format'](_0x7b7e('0x1c'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config[_0x7b7e('0x4')]['ip'],config[_0x7b7e('0x4')][_0x7b7e('0x5')],util[_0x7b7e('0xd')](_0x43db4f,![],null)));});ami['on'](_0x7b7e('0x1d'),function(_0x53bbb3){logger['info'](util['format'](_0x7b7e('0x1e'),config[_0x7b7e('0x4')][_0x7b7e('0xf')],config['asterisk']['ip'],config['asterisk']['port']));return BPromise[_0x7b7e('0x1f')]()[_0x7b7e('0x20')](ami[_0x7b7e('0x21')]())[_0x7b7e('0x20')](ami[_0x7b7e('0x22')]())['then'](ami[_0x7b7e('0x12')]())[_0x7b7e('0x20')](ami['actionQueueSummary']())['then'](ami['actionCoreShowChannels']())[_0x7b7e('0x23')](function(_0x423832){logger['error'](_0x7b7e('0x24'),util['inspect'](_0x423832,{'showHidden':![],'depth':null}));});});ami[_0x7b7e('0x19')](_0x7b7e('0xa'),error);ami[_0x7b7e('0x19')]('close',close);module[_0x7b7e('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index c256fa4..253a5ca 100644 --- a/server/services/ami/client.js +++ b/server/services/ami/client.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda3f=['then','rpc','memberReport','error','message','result','catch','exports','bluebird','../../config/logger','Request','request'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda3f,0xec));var _0xfda3=function(_0x1e645f,_0x5ec6a6){_0x1e645f=_0x1e645f-0x0;var _0x357a2e=_0xda3f[_0x1e645f];return _0x357a2e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xfda3('0x0'));var logger=require(_0xfda3('0x1'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xfda3('0x2')]=function(_0x581693,_0x36dc71){return new BPromise(function(_0x22187d,_0x516500){return client[_0xfda3('0x3')](_0x581693,_0x36dc71)[_0xfda3('0x4')](function(_0x47e7e2){logger['debug'](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x36dc71,_0x47e7e2);if(_0x47e7e2[_0xfda3('0x7')]){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')],_0x36dc71);return _0x516500(_0x47e7e2[_0xfda3('0x7')][_0xfda3('0x8')]);}else{return _0x22187d(_0x47e7e2[_0xfda3('0x9')]);}})[_0xfda3('0xa')](function(_0x4d7841){logger[_0xfda3('0x7')](_0xfda3('0x5'),_0xfda3('0x6'),_0x581693,_0x4d7841,_0x36dc71);return _0x516500(_0x4d7841);});});};module[_0xfda3('0xb')]=client; \ No newline at end of file +var _0xb43b=['catch','exports','jayson/promise','bluebird','ami','client','http','rpc','memberReport','error','message','result'];(function(_0x588fd3,_0x40b0ac){var _0x396015=function(_0x25e5d1){while(--_0x25e5d1){_0x588fd3['push'](_0x588fd3['shift']());}};_0x396015(++_0x40b0ac);}(_0xb43b,0x1b2));var _0xbb43=function(_0x147c1b,_0x35bdde){_0x147c1b=_0x147c1b-0x0;var _0x2cf23d=_0xb43b[_0x147c1b];return _0x2cf23d;};'use strict';var jayson=require(_0xbb43('0x0'));var BPromise=require(_0xbb43('0x1'));var logger=require('../../config/logger')(_0xbb43('0x2'));var client=jayson[_0xbb43('0x3')][_0xbb43('0x4')]({'port':0x2329});client['Request']=function(_0x131e9e,_0x41aff6){return new BPromise(function(_0x351254,_0x16432a){return client['request'](_0x131e9e,_0x41aff6)['then'](function(_0x378df5){logger['debug'](_0xbb43('0x5'),_0xbb43('0x6'),_0x131e9e,_0x41aff6,_0x378df5);if(_0x378df5[_0xbb43('0x7')]){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x378df5[_0xbb43('0x7')][_0xbb43('0x8')],_0x41aff6);return _0x16432a(_0x378df5['error'][_0xbb43('0x8')]);}else{return _0x351254(_0x378df5[_0xbb43('0x9')]);}})[_0xbb43('0xa')](function(_0x5e3611){logger[_0xbb43('0x7')](_0xbb43('0x5'),'memberReport',_0x131e9e,_0x5e3611,_0x41aff6);return _0x16432a(_0x5e3611);});});};module[_0xbb43('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 92b22fe..c2fb653 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 _0x5cc5=['lodash','moment','isNil','string','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','exports','util'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5cc5,0xe0));var _0x55cc=function(_0xb1cf84,_0x813740){_0xb1cf84=_0xb1cf84-0x0;var _0x4bad2e=_0x5cc5[_0xb1cf84];return _0x4bad2e;};'use strict';var util=require(_0x55cc('0x0'));var _=require(_0x55cc('0x1'));var moment=require(_0x55cc('0x2'));function checkNameSurname(_0x41639c,_0x23958c,_0x52b7d1){var _0x5b9322='';if(!_[_0x55cc('0x3')](_0x23958c)&&_0x55cc('0x4')===typeof _0x23958c){_0x5b9322+=_0x23958c;}if(!_[_0x55cc('0x3')](_0x52b7d1)&&_0x55cc('0x4')===typeof _0x52b7d1){_0x5b9322+='\x20'+_0x52b7d1;}if(_0x5b9322!==''){return _0x5b9322;}return _0x41639c;}function Action(_0x1c5324,_0x54535b,_0x30adc0){this['voiceQueue']=_0x1c5324;this[_0x55cc('0x5')]=_0x30adc0||undefined;this[_0x55cc('0x6')]=checkNameSurname(_0x54535b[_0x55cc('0x7')][_0x55cc('0x8')],_0x54535b[_0x55cc('0x7')][_0x55cc('0x9')],_0x54535b[_0x55cc('0x7')][_0x55cc('0xa')]);this[_0x55cc('0xb')]=_0x54535b[_0x55cc('0x7')][_0x55cc('0x8')];this[_0x55cc('0xc')]=_0x1c5324[_0x55cc('0x6')];this[_0x55cc('0xd')]=_0x54535b[_0x55cc('0xd')]||![];this[_0x55cc('0xe')]=_0x1c5324['type'];this[_0x55cc('0xf')]=_0x1c5324[_0x55cc('0xf')]||0x3;this[_0x55cc('0x10')]=_0x54535b[_0x55cc('0x10')];this['countbusyretry']=_0x54535b[_0x55cc('0x11')];this[_0x55cc('0x12')]=_0x54535b[_0x55cc('0x12')];this['countnoanswerretry']=_0x54535b[_0x55cc('0x13')];this[_0x55cc('0x14')]=_0x54535b[_0x55cc('0x14')];this[_0x55cc('0x15')]=_0x54535b[_0x55cc('0x15')];this['countabandonedretry']=_0x54535b['countabandonedretry'];this[_0x55cc('0x16')]=_0x54535b[_0x55cc('0x16')];this[_0x55cc('0x17')]=_0x54535b[_0x55cc('0x17')];this[_0x55cc('0x18')]=_0x54535b[_0x55cc('0x18')];this['ListId']=_0x54535b[_0x55cc('0x19')];this[_0x55cc('0x1a')]=_0x54535b[_0x55cc('0x1a')];this[_0x55cc('0x1b')]=_0x54535b['VoiceQueueId'];this[_0x55cc('0x1c')]=_0x54535b[_0x55cc('0x1c')];this['idHopper']=_0x54535b['id'];this[_0x55cc('0x1d')]=_0x54535b['Contact']['firstName']||'';this[_0x55cc('0x1e')]=moment()[_0x55cc('0x1f')](_0x55cc('0x20'));this[_0x55cc('0x21')]=_0x54535b[_0x55cc('0x21')];this['callbackuniqueid']=_0x54535b[_0x55cc('0x22')];this[_0x55cc('0x23')]=_0x54535b[_0x55cc('0x23')];this['recallme']=_0x54535b[_0x55cc('0x24')];this[_0x55cc('0x25')]='';this['originatecalleridname']='';}Action[_0x55cc('0x26')][_0x55cc('0x27')]=function(){return util['format'](_0x55cc('0x28'),this['name'],this[_0x55cc('0x29')][_0x55cc('0x2a')]>0x0?this[_0x55cc('0xb')][_0x55cc('0x2b')](this['voiceQueue'][_0x55cc('0x2a')]):this[_0x55cc('0xb')]);};Action['prototype']['getQueue']=function(){return this['queue'];};module[_0x55cc('0x2c')]=Action; \ No newline at end of file +var _0x7eaa=['getCaller','\x22%s\x22\x20<%s>','number','substring','dialCutDigit','getQueue','exports','util','isNil','string','voiceQueue','uniqueid','name','phone','Contact','lastName','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','firstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','recallme','prototype'];(function(_0x2f0afc,_0x10eb19){var _0x2ea06a=function(_0xc0fd12){while(--_0xc0fd12){_0x2f0afc['push'](_0x2f0afc['shift']());}};_0x2ea06a(++_0x10eb19);}(_0x7eaa,0x15f));var _0xa7ea=function(_0x178af3,_0x216a28){_0x178af3=_0x178af3-0x0;var _0x5d87db=_0x7eaa[_0x178af3];return _0x5d87db;};'use strict';var util=require(_0xa7ea('0x0'));var _=require('lodash');var moment=require('moment');function checkNameSurname(_0x4c3fd2,_0x4c6d18,_0x43f31c){var _0x1368f4='';if(!_[_0xa7ea('0x1')](_0x4c6d18)&&_0xa7ea('0x2')===typeof _0x4c6d18){_0x1368f4+=_0x4c6d18;}if(!_['isNil'](_0x43f31c)&&_0xa7ea('0x2')===typeof _0x43f31c){_0x1368f4+='\x20'+_0x43f31c;}if(_0x1368f4!==''){return _0x1368f4;}return _0x4c3fd2;}function Action(_0x21f373,_0x3e3d8c,_0x1b6c3d){this[_0xa7ea('0x3')]=_0x21f373;this[_0xa7ea('0x4')]=_0x1b6c3d||undefined;this[_0xa7ea('0x5')]=checkNameSurname(_0x3e3d8c['Contact'][_0xa7ea('0x6')],_0x3e3d8c['Contact']['firstName'],_0x3e3d8c[_0xa7ea('0x7')][_0xa7ea('0x8')]);this['number']=_0x3e3d8c['Contact'][_0xa7ea('0x6')];this[_0xa7ea('0x9')]=_0x21f373[_0xa7ea('0x5')];this[_0xa7ea('0xa')]=_0x3e3d8c['active']||![];this['type']=_0x21f373[_0xa7ea('0xb')];this[_0xa7ea('0xc')]=_0x21f373[_0xa7ea('0xc')]||0x3;this[_0xa7ea('0xd')]=_0x3e3d8c['scheduledat'];this[_0xa7ea('0xe')]=_0x3e3d8c['countbusyretry'];this[_0xa7ea('0xf')]=_0x3e3d8c[_0xa7ea('0xf')];this[_0xa7ea('0x10')]=_0x3e3d8c[_0xa7ea('0x10')];this['countnosuchnumberretry']=_0x3e3d8c[_0xa7ea('0x11')];this[_0xa7ea('0x12')]=_0x3e3d8c['countdropretry'];this[_0xa7ea('0x13')]=_0x3e3d8c['countabandonedretry'];this[_0xa7ea('0x14')]=_0x3e3d8c[_0xa7ea('0x14')];this['countagentrejectretry']=_0x3e3d8c[_0xa7ea('0x15')];this['ContactId']=_0x3e3d8c[_0xa7ea('0x16')];this[_0xa7ea('0x17')]=_0x3e3d8c[_0xa7ea('0x17')];this['UserId']=_0x3e3d8c[_0xa7ea('0x18')];this[_0xa7ea('0x19')]=_0x3e3d8c[_0xa7ea('0x19')];this[_0xa7ea('0x1a')]=_0x3e3d8c[_0xa7ea('0x1a')];this[_0xa7ea('0x1b')]=_0x3e3d8c['id'];this['ContactFirstName']=_0x3e3d8c['Contact'][_0xa7ea('0x1c')]||'';this[_0xa7ea('0x1d')]=moment()[_0xa7ea('0x1e')](_0xa7ea('0x1f'));this[_0xa7ea('0x20')]=_0x3e3d8c[_0xa7ea('0x20')];this['callbackuniqueid']=_0x3e3d8c[_0xa7ea('0x21')];this['callbackat']=_0x3e3d8c['callbackat'];this[_0xa7ea('0x22')]=_0x3e3d8c[_0xa7ea('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0xa7ea('0x23')][_0xa7ea('0x24')]=function(){return util[_0xa7ea('0x1e')](_0xa7ea('0x25'),this[_0xa7ea('0x5')],this[_0xa7ea('0x3')]['dialCutDigit']>0x0?this[_0xa7ea('0x26')][_0xa7ea('0x27')](this[_0xa7ea('0x3')][_0xa7ea('0x28')]):this['number']);};Action['prototype'][_0xa7ea('0x29')]=function(){return this['queue'];};module[_0xa7ea('0x2a')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 37998c8..3c7b626 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 _0x6140=['holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','state','Answer','scheduledat','campaigntype','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','uniqueid','calleridname','name','number','starttime','responsetime','answertime','YYYY-MM-DD\x20HH:mm:ss','ringtime'];(function(_0x3fd2f7,_0x5271b2){var _0x101084=function(_0x558bc8){while(--_0x558bc8){_0x3fd2f7['push'](_0x3fd2f7['shift']());}};_0x101084(++_0x5271b2);}(_0x6140,0x125));var _0x0614=function(_0x1f15d4,_0x547ee1){_0x1f15d4=_0x1f15d4-0x0;var _0x407670=_0x6140[_0x1f15d4];return _0x407670;};'use strict';var util=require(_0x0614('0x0'));var _=require('lodash');var moment=require(_0x0614('0x1'));function getSeconds(_0x160473,_0x34982e){var _0x29eee0=moment(_0x160473)['milliseconds'](0x0);var _0x588932=moment(_0x34982e)[_0x0614('0x2')](0x0);return _0x29eee0[_0x0614('0x3')](_0x588932,_0x0614('0x4'));}function AgentComplete(_0x4adff7,_0x4136f2){this[_0x0614('0x5')]=0x4;this['statedesc']=_0x0614('0x6');this[_0x0614('0x7')]=_0x4adff7[_0x0614('0x7')];this['type']=_0x4adff7['type'];this[_0x0614('0x8')]=_0x4adff7[_0x0614('0x9')]==='outbound'?_0x0614('0xa'):_0x4adff7['type'];this[_0x0614('0xb')]=_0x4adff7[_0x0614('0xb')];this[_0x0614('0xc')]=_0x4adff7['countcongestionretry'];this[_0x0614('0xd')]=_0x4adff7['countnoanswerretry'];this[_0x0614('0xe')]=_0x4adff7['countbusyretry']+_0x4adff7[_0x0614('0xc')]+_0x4adff7['countnoanswerretry']+_0x4adff7['countnosuchnumberretry']+_0x4adff7[_0x0614('0xf')]+_0x4adff7['countabandonedretry']+_0x4adff7[_0x0614('0x10')]+_0x4adff7[_0x0614('0x11')];this[_0x0614('0x12')]=_0x4adff7['countnosuchnumberretry'];this[_0x0614('0xf')]=_0x4adff7[_0x0614('0xf')];this[_0x0614('0x13')]=_0x4adff7[_0x0614('0x13')];this[_0x0614('0x10')]=_0x4adff7['countmachineretry'];this[_0x0614('0x11')]=_0x4adff7[_0x0614('0x11')];this[_0x0614('0x14')]=_0x4136f2['uniqueid'];this[_0x0614('0x15')]=_0x4adff7[_0x0614('0x16')];this['calleridnum']=_0x4adff7[_0x0614('0x17')];this[_0x0614('0x18')]=_0x4adff7[_0x0614('0x18')];this[_0x0614('0x19')]=_0x4adff7[_0x0614('0x19')];this[_0x0614('0x1a')]=_0x4adff7[_0x0614('0x1a')];this['endtime']=moment()['format'](_0x0614('0x1b'));this[_0x0614('0x1c')]=getSeconds(_0x4adff7[_0x0614('0x19')],_0x4adff7['starttime']);this[_0x0614('0x1d')]=getSeconds(_0x4adff7[_0x0614('0x1a')],_0x4adff7[_0x0614('0x19')]);this[_0x0614('0x1e')]=getSeconds(this[_0x0614('0x1f')],_0x4adff7[_0x0614('0x1a')]);this[_0x0614('0xa')]=_0x4136f2[_0x0614('0xa')];this[_0x0614('0x20')]=_0x4136f2[_0x0614('0x20')];this[_0x0614('0x21')]=_0x4136f2['reason'];this[_0x0614('0x22')]=_0x4adff7['callback'];this[_0x0614('0x23')]=_0x4adff7[_0x0614('0x23')];this[_0x0614('0x24')]=_0x4adff7[_0x0614('0x24')];this[_0x0614('0x25')]=_0x4adff7[_0x0614('0x25')];this[_0x0614('0x26')]=_0x4adff7[_0x0614('0x26')];this[_0x0614('0x27')]=_0x4adff7[_0x0614('0x27')];this[_0x0614('0x28')]=_0x4adff7['UserId'];this['VoiceQueueId']=_0x4adff7[_0x0614('0x29')];this[_0x0614('0x2a')]=_0x4adff7[_0x0614('0x2a')];this[_0x0614('0x2b')]=_0x4adff7[_0x0614('0x2b')]||'';this[_0x0614('0x2c')]=_0x4adff7[_0x0614('0x2c')]||'';}module[_0x0614('0x2d')]=AgentComplete; \ No newline at end of file +var _0x5ea3=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','moment','milliseconds','seconds','state','statedesc','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countbusyretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime'];(function(_0x3d05ee,_0x12acf1){var _0x460449=function(_0x91cb3d){while(--_0x91cb3d){_0x3d05ee['push'](_0x3d05ee['shift']());}};_0x460449(++_0x12acf1);}(_0x5ea3,0x170));var _0x35ea=function(_0x5c690f,_0x435950){_0x5c690f=_0x5c690f-0x0;var _0x220b06=_0x5ea3[_0x5c690f];return _0x220b06;};'use strict';var util=require('util');var _=require(_0x35ea('0x0'));var moment=require(_0x35ea('0x1'));function getSeconds(_0x2862ad,_0x376000){var _0x37b3e9=moment(_0x2862ad)[_0x35ea('0x2')](0x0);var _0x1bfcfe=moment(_0x376000)['milliseconds'](0x0);return _0x37b3e9['diff'](_0x1bfcfe,_0x35ea('0x3'));}function AgentComplete(_0x2760d4,_0x325406){this[_0x35ea('0x4')]=0x4;this[_0x35ea('0x5')]='Answer';this['scheduledat']=_0x2760d4[_0x35ea('0x6')];this[_0x35ea('0x7')]=_0x2760d4[_0x35ea('0x7')];this[_0x35ea('0x8')]=_0x2760d4['type']===_0x35ea('0x9')?_0x35ea('0xa'):_0x2760d4[_0x35ea('0x7')];this['countbusyretry']=_0x2760d4['countbusyretry'];this[_0x35ea('0xb')]=_0x2760d4['countcongestionretry'];this['countnoanswerretry']=_0x2760d4['countnoanswerretry'];this['countglobal']=_0x2760d4[_0x35ea('0xc')]+_0x2760d4[_0x35ea('0xb')]+_0x2760d4[_0x35ea('0xd')]+_0x2760d4['countnosuchnumberretry']+_0x2760d4[_0x35ea('0xe')]+_0x2760d4[_0x35ea('0xf')]+_0x2760d4[_0x35ea('0x10')]+_0x2760d4[_0x35ea('0x11')];this[_0x35ea('0x12')]=_0x2760d4[_0x35ea('0x12')];this[_0x35ea('0xe')]=_0x2760d4[_0x35ea('0xe')];this['countabandonedretry']=_0x2760d4[_0x35ea('0xf')];this['countmachineretry']=_0x2760d4[_0x35ea('0x10')];this[_0x35ea('0x11')]=_0x2760d4[_0x35ea('0x11')];this[_0x35ea('0x13')]=_0x325406[_0x35ea('0x13')];this[_0x35ea('0x14')]=_0x2760d4[_0x35ea('0x15')];this[_0x35ea('0x16')]=_0x2760d4[_0x35ea('0x17')];this[_0x35ea('0x18')]=_0x2760d4[_0x35ea('0x18')];this[_0x35ea('0x19')]=_0x2760d4[_0x35ea('0x19')];this[_0x35ea('0x1a')]=_0x2760d4[_0x35ea('0x1a')];this[_0x35ea('0x1b')]=moment()[_0x35ea('0x1c')](_0x35ea('0x1d'));this[_0x35ea('0x1e')]=getSeconds(_0x2760d4[_0x35ea('0x19')],_0x2760d4['starttime']);this[_0x35ea('0x1f')]=getSeconds(_0x2760d4['answertime'],_0x2760d4[_0x35ea('0x19')]);this['talktime']=getSeconds(this[_0x35ea('0x1b')],_0x2760d4[_0x35ea('0x1a')]);this['queue']=_0x325406[_0x35ea('0xa')];this[_0x35ea('0x20')]=_0x325406[_0x35ea('0x20')];this[_0x35ea('0x21')]=_0x325406['reason'];this['callback']=_0x2760d4[_0x35ea('0x22')];this['callbackuniqueid']=_0x2760d4['callbackuniqueid'];this['callbackat']=_0x2760d4[_0x35ea('0x23')];this[_0x35ea('0x24')]=_0x2760d4[_0x35ea('0x24')];this[_0x35ea('0x25')]=_0x2760d4['ContactId'];this[_0x35ea('0x26')]=_0x2760d4[_0x35ea('0x26')];this[_0x35ea('0x27')]=_0x2760d4[_0x35ea('0x27')];this[_0x35ea('0x28')]=_0x2760d4[_0x35ea('0x28')];this[_0x35ea('0x29')]=_0x2760d4[_0x35ea('0x29')];this['originatecalleridnum']=_0x2760d4[_0x35ea('0x2a')]||'';this[_0x35ea('0x2b')]=_0x2760d4['originatecalleridname']||'';}module['exports']=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 86a468c..0c36c87 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 _0x56e7=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime'];(function(_0x4cc19e,_0x4332fb){var _0x5cde2c=function(_0x5ce438){while(--_0x5ce438){_0x4cc19e['push'](_0x4cc19e['shift']());}};_0x5cde2c(++_0x4332fb);}(_0x56e7,0x7b));var _0x756e=function(_0x3ec5a3,_0x40cac0){_0x3ec5a3=_0x3ec5a3-0x0;var _0x3bc8dc=_0x56e7[_0x3ec5a3];return _0x3bc8dc;};'use strict';var util=require('util');var _=require(_0x756e('0x0'));var moment=require(_0x756e('0x1'));function getSeconds(_0x590286,_0x2eadee){var _0x3efe5c=moment(_0x590286)[_0x756e('0x2')](0x0);var _0xb850c9=moment(_0x2eadee)[_0x756e('0x2')](0x0);return _0x3efe5c[_0x756e('0x3')](_0xb850c9,_0x756e('0x4'));}function Final(_0x538050){this[_0x756e('0x5')]=_0x538050[_0x756e('0x5')];this[_0x756e('0x6')]=_0x538050[_0x756e('0x6')];this['type']=_0x538050[_0x756e('0x7')];this['campaigntype']=_0x538050[_0x756e('0x7')]===_0x756e('0x8')?_0x756e('0x9'):_0x538050[_0x756e('0x7')];this['countbusyretry']=_0x538050['countbusyretry'];this[_0x756e('0xa')]=_0x538050[_0x756e('0xa')];this[_0x756e('0xb')]=_0x538050['countnoanswerretry'];this[_0x756e('0xc')]=_0x538050[_0x756e('0xd')]+_0x538050['countcongestionretry']+_0x538050['countnoanswerretry']+_0x538050[_0x756e('0xe')]+_0x538050['countdropretry']+_0x538050[_0x756e('0xf')]+_0x538050[_0x756e('0x10')]+_0x538050[_0x756e('0x11')];this[_0x756e('0xe')]=_0x538050[_0x756e('0xe')];this['countdropretry']=_0x538050['countdropretry'];this[_0x756e('0xf')]=_0x538050[_0x756e('0xf')];this[_0x756e('0x10')]=_0x538050['countmachineretry'];this['countagentrejectretry']=_0x538050[_0x756e('0x11')];this[_0x756e('0x9')]=_0x538050[_0x756e('0x9')];this[_0x756e('0x12')]=_0x538050[_0x756e('0x12')];this[_0x756e('0x13')]=_0x538050[_0x756e('0x13')];this[_0x756e('0x14')]=_0x538050[_0x756e('0x14')];this['responsetime']=_0x538050[_0x756e('0x15')];this['endtime']=_0x538050['responsetime'];this[_0x756e('0x16')]=_0x538050[_0x756e('0x16')]||0x0;this[_0x756e('0x17')]=_0x538050[_0x756e('0x17')]||0x0;this[_0x756e('0x18')]=_0x538050[_0x756e('0x18')]||0x0;this[_0x756e('0x19')]=_0x538050[_0x756e('0x19')];this[_0x756e('0x1a')]=_0x538050[_0x756e('0x1a')];this[_0x756e('0x1b')]=_0x538050[_0x756e('0x1b')];this[_0x756e('0x1c')]=_0x538050[_0x756e('0x1c')];this[_0x756e('0x1d')]=_0x538050[_0x756e('0x1d')];this['ListId']=_0x538050[_0x756e('0x1e')];this['UserId']=_0x538050[_0x756e('0x1f')];this[_0x756e('0x20')]=_0x538050[_0x756e('0x20')];this[_0x756e('0x21')]=_0x538050['CampaignId'];this[_0x756e('0x22')]=_0x538050[_0x756e('0x22')]||'';this[_0x756e('0x23')]=_0x538050['originatecalleridname']||'';}module[_0x756e('0x24')]=Final; \ No newline at end of file +var _0xe015=['countnosuchnumberretry','calleridname','calleridnum','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry'];(function(_0x31f47a,_0x45892e){var _0x5b4767=function(_0x5bedde){while(--_0x5bedde){_0x31f47a['push'](_0x31f47a['shift']());}};_0x5b4767(++_0x45892e);}(_0xe015,0x13b));var _0x5e01=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xe015[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0x5e01('0x0'));var _=require(_0x5e01('0x1'));var moment=require(_0x5e01('0x2'));function getSeconds(_0x5811ae,_0x51f689){var _0x46ed0d=moment(_0x5811ae)['milliseconds'](0x0);var _0x2136cf=moment(_0x51f689)[_0x5e01('0x3')](0x0);return _0x46ed0d[_0x5e01('0x4')](_0x2136cf,_0x5e01('0x5'));}function Final(_0x4ac3f1){this[_0x5e01('0x6')]=_0x4ac3f1[_0x5e01('0x6')];this['scheduledat']=_0x4ac3f1['scheduledat'];this[_0x5e01('0x7')]=_0x4ac3f1[_0x5e01('0x7')];this[_0x5e01('0x8')]=_0x4ac3f1[_0x5e01('0x7')]===_0x5e01('0x9')?_0x5e01('0xa'):_0x4ac3f1['type'];this[_0x5e01('0xb')]=_0x4ac3f1['countbusyretry'];this[_0x5e01('0xc')]=_0x4ac3f1['countcongestionretry'];this[_0x5e01('0xd')]=_0x4ac3f1[_0x5e01('0xd')];this['countglobal']=_0x4ac3f1[_0x5e01('0xb')]+_0x4ac3f1[_0x5e01('0xc')]+_0x4ac3f1['countnoanswerretry']+_0x4ac3f1['countnosuchnumberretry']+_0x4ac3f1[_0x5e01('0xe')]+_0x4ac3f1[_0x5e01('0xf')]+_0x4ac3f1[_0x5e01('0x10')]+_0x4ac3f1[_0x5e01('0x11')];this[_0x5e01('0x12')]=_0x4ac3f1[_0x5e01('0x12')];this['countdropretry']=_0x4ac3f1[_0x5e01('0xe')];this['countabandonedretry']=_0x4ac3f1['countabandonedretry'];this[_0x5e01('0x10')]=_0x4ac3f1[_0x5e01('0x10')];this['countagentrejectretry']=_0x4ac3f1[_0x5e01('0x11')];this['queue']=_0x4ac3f1[_0x5e01('0xa')];this['calleridname']=_0x4ac3f1[_0x5e01('0x13')];this['calleridnum']=_0x4ac3f1[_0x5e01('0x14')];this['starttime']=_0x4ac3f1['starttime'];this[_0x5e01('0x15')]=_0x4ac3f1[_0x5e01('0x15')];this['endtime']=_0x4ac3f1[_0x5e01('0x15')];this[_0x5e01('0x16')]=_0x4ac3f1[_0x5e01('0x16')]||0x0;this[_0x5e01('0x17')]=_0x4ac3f1[_0x5e01('0x17')]||0x0;this[_0x5e01('0x18')]=_0x4ac3f1[_0x5e01('0x18')]||0x0;this[_0x5e01('0x19')]=_0x4ac3f1['callback'];this[_0x5e01('0x1a')]=_0x4ac3f1[_0x5e01('0x1a')];this['callbackat']=_0x4ac3f1[_0x5e01('0x1b')];this[_0x5e01('0x1c')]=_0x4ac3f1[_0x5e01('0x1c')];this[_0x5e01('0x1d')]=_0x4ac3f1[_0x5e01('0x1d')];this[_0x5e01('0x1e')]=_0x4ac3f1['ListId'];this[_0x5e01('0x1f')]=_0x4ac3f1[_0x5e01('0x1f')];this[_0x5e01('0x20')]=_0x4ac3f1[_0x5e01('0x20')];this['CampaignId']=_0x4ac3f1[_0x5e01('0x21')];this[_0x5e01('0x22')]=_0x4ac3f1[_0x5e01('0x22')]||'';this['originatecalleridname']=_0x4ac3f1[_0x5e01('0x23')]||'';}module[_0x5e01('0x24')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index b487ec7..c9aa4d7 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 _0x9263=['scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','membername','IVR','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer'];(function(_0x54125,_0x2dd8a5){var _0xd30254=function(_0x498ab2){while(--_0x498ab2){_0x54125['push'](_0x54125['shift']());}};_0xd30254(++_0x2dd8a5);}(_0x9263,0x125));var _0x3926=function(_0x1d24eb,_0x12295b){_0x1d24eb=_0x1d24eb-0x0;var _0x1dc576=_0x9263[_0x1d24eb];return _0x1dc576;};'use strict';var util=require('util');var _=require(_0x3926('0x0'));var moment=require(_0x3926('0x1'));function getSeconds(_0x5e1473,_0x356bf1){var _0x57c24e=moment(_0x5e1473)[_0x3926('0x2')](0x0);var _0x26576d=moment(_0x356bf1)['milliseconds'](0x0);return _0x57c24e[_0x3926('0x3')](_0x26576d,_0x3926('0x4'));}function Hangup(_0x3ecf56,_0x5acc43){this[_0x3926('0x5')]=0x4;this[_0x3926('0x6')]=_0x3926('0x7');this['scheduledat']=_0x3ecf56[_0x3926('0x8')];this[_0x3926('0x9')]=_0x3ecf56[_0x3926('0x9')];this[_0x3926('0xa')]=_0x3ecf56[_0x3926('0x9')]===_0x3926('0xb')?_0x3926('0xc'):_0x3ecf56[_0x3926('0x9')];this[_0x3926('0xd')]=_0x3ecf56[_0x3926('0xd')];this[_0x3926('0xe')]=_0x3ecf56['countcongestionretry'];this[_0x3926('0xf')]=_0x3ecf56[_0x3926('0xf')];this[_0x3926('0x10')]=_0x3ecf56[_0x3926('0xd')]+_0x3ecf56['countcongestionretry']+_0x3ecf56['countnoanswerretry']+_0x3ecf56[_0x3926('0x11')]+_0x3ecf56['countdropretry']+_0x3ecf56['countabandonedretry']+_0x3ecf56[_0x3926('0x12')]+_0x3ecf56[_0x3926('0x13')];this[_0x3926('0x11')]=_0x3ecf56[_0x3926('0x11')];this[_0x3926('0x14')]=_0x3ecf56['countdropretry'];this[_0x3926('0x15')]=_0x3ecf56[_0x3926('0x15')];this[_0x3926('0x12')]=_0x3ecf56[_0x3926('0x12')];this[_0x3926('0x13')]=_0x3ecf56[_0x3926('0x13')];this['uniqueid']=_0x5acc43[_0x3926('0x16')];this[_0x3926('0x17')]=_0x3ecf56[_0x3926('0x18')];this[_0x3926('0x19')]=_0x3ecf56[_0x3926('0x1a')];this[_0x3926('0x1b')]=_0x3ecf56[_0x3926('0x1b')];this['responsetime']=_0x3ecf56[_0x3926('0x1c')];this[_0x3926('0x1d')]=moment()[_0x3926('0x1e')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x3ecf56[_0x3926('0x1c')],_0x3ecf56[_0x3926('0x1b')]);this['holdtime']=0x0;this['talktime']=getSeconds(this['endtime'],_0x3ecf56[_0x3926('0x1c')]);this[_0x3926('0xc')]=_0x3ecf56[_0x3926('0xc')];this[_0x3926('0x1f')]=_0x3926('0x20');this[_0x3926('0x21')]=_0x5acc43['cause-txt'];this['callback']=_0x3ecf56[_0x3926('0x22')];this[_0x3926('0x23')]=_0x3ecf56[_0x3926('0x23')];this['callbackat']=_0x3ecf56[_0x3926('0x24')];this['recallme']=_0x3ecf56[_0x3926('0x25')];this[_0x3926('0x26')]=_0x3ecf56['ContactId'];this[_0x3926('0x27')]=_0x3ecf56[_0x3926('0x27')];this[_0x3926('0x28')]=_0x3ecf56['UserId'];this[_0x3926('0x29')]=_0x3ecf56['VoiceQueueId'];this[_0x3926('0x2a')]=_0x3ecf56[_0x3926('0x2a')];}module['exports']=Hangup; \ No newline at end of file +var _0x90a0=['countnosuchnumberretry','countabandonedretry','countmachineretry','countdropretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','endtime','format','ringtime','holdtime','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','lodash','moment','milliseconds','seconds','state','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal'];(function(_0xa122d,_0x4ee170){var _0x5805f2=function(_0x5b55f6){while(--_0x5b55f6){_0xa122d['push'](_0xa122d['shift']());}};_0x5805f2(++_0x4ee170);}(_0x90a0,0x1a0));var _0x090a=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x90a0[_0x42f009];return _0x22a1e0;};'use strict';var util=require('util');var _=require(_0x090a('0x0'));var moment=require(_0x090a('0x1'));function getSeconds(_0x42b459,_0x72430a){var _0x4ef5db=moment(_0x42b459)[_0x090a('0x2')](0x0);var _0x104097=moment(_0x72430a)[_0x090a('0x2')](0x0);return _0x4ef5db['diff'](_0x104097,_0x090a('0x3'));}function Hangup(_0x581edd,_0x4773c9){this[_0x090a('0x4')]=0x4;this['statedesc']=_0x090a('0x5');this['scheduledat']=_0x581edd[_0x090a('0x6')];this[_0x090a('0x7')]=_0x581edd['type'];this['campaigntype']=_0x581edd[_0x090a('0x7')]===_0x090a('0x8')?_0x090a('0x9'):_0x581edd['type'];this[_0x090a('0xa')]=_0x581edd[_0x090a('0xa')];this[_0x090a('0xb')]=_0x581edd[_0x090a('0xb')];this[_0x090a('0xc')]=_0x581edd[_0x090a('0xc')];this[_0x090a('0xd')]=_0x581edd[_0x090a('0xa')]+_0x581edd[_0x090a('0xb')]+_0x581edd['countnoanswerretry']+_0x581edd[_0x090a('0xe')]+_0x581edd['countdropretry']+_0x581edd[_0x090a('0xf')]+_0x581edd[_0x090a('0x10')]+_0x581edd['countagentrejectretry'];this[_0x090a('0xe')]=_0x581edd[_0x090a('0xe')];this[_0x090a('0x11')]=_0x581edd[_0x090a('0x11')];this[_0x090a('0xf')]=_0x581edd[_0x090a('0xf')];this[_0x090a('0x10')]=_0x581edd['countmachineretry'];this[_0x090a('0x12')]=_0x581edd[_0x090a('0x12')];this['uniqueid']=_0x4773c9[_0x090a('0x13')];this[_0x090a('0x14')]=_0x581edd[_0x090a('0x15')];this[_0x090a('0x16')]=_0x581edd[_0x090a('0x17')];this[_0x090a('0x18')]=_0x581edd[_0x090a('0x18')];this[_0x090a('0x19')]=_0x581edd['responsetime'];this[_0x090a('0x1a')]=moment()[_0x090a('0x1b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x090a('0x1c')]=getSeconds(_0x581edd[_0x090a('0x19')],_0x581edd[_0x090a('0x18')]);this[_0x090a('0x1d')]=0x0;this[_0x090a('0x1e')]=getSeconds(this[_0x090a('0x1a')],_0x581edd[_0x090a('0x19')]);this['queue']=_0x581edd[_0x090a('0x9')];this[_0x090a('0x1f')]='IVR';this[_0x090a('0x20')]=_0x4773c9[_0x090a('0x21')];this[_0x090a('0x22')]=_0x581edd[_0x090a('0x22')];this[_0x090a('0x23')]=_0x581edd[_0x090a('0x23')];this[_0x090a('0x24')]=_0x581edd[_0x090a('0x24')];this[_0x090a('0x25')]=_0x581edd[_0x090a('0x25')];this[_0x090a('0x26')]=_0x581edd[_0x090a('0x26')];this[_0x090a('0x27')]=_0x581edd[_0x090a('0x27')];this[_0x090a('0x28')]=_0x581edd['UserId'];this[_0x090a('0x29')]=_0x581edd[_0x090a('0x29')];this[_0x090a('0x2a')]=_0x581edd[_0x090a('0x2a')];}module['exports']=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 1f38f12..9afc83c 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 _0x8f28=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','outbound','queue','type','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat'];(function(_0x494305,_0x544857){var _0x1cd566=function(_0x746c74){while(--_0x746c74){_0x494305['push'](_0x494305['shift']());}};_0x1cd566(++_0x544857);}(_0x8f28,0xcb));var _0x88f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8f28[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x88f2('0x0'));var _=require(_0x88f2('0x1'));var moment=require(_0x88f2('0x2'));function getSeconds(_0x2dd2eb,_0x5bef66){var _0x4f3a5e=moment(_0x2dd2eb)[_0x88f2('0x3')](0x0);var _0x33c8a5=moment(_0x5bef66)['milliseconds'](0x0);return _0x4f3a5e[_0x88f2('0x4')](_0x33c8a5,_0x88f2('0x5'));}function History(_0x20049e){this[_0x88f2('0x6')]=_0x20049e[_0x88f2('0x6')];this[_0x88f2('0x7')]=_0x20049e[_0x88f2('0x7')]||undefined;this['type']=_0x20049e['type'];this[_0x88f2('0x8')]=_0x20049e['type']===_0x88f2('0x9')?_0x88f2('0xa'):_0x20049e[_0x88f2('0xb')];this['countbusyretry']=_0x20049e[_0x88f2('0xc')];this[_0x88f2('0xd')]=_0x20049e[_0x88f2('0xd')];this[_0x88f2('0xe')]=_0x20049e[_0x88f2('0xe')];this['countglobal']=_0x20049e['countbusyretry']+_0x20049e[_0x88f2('0xd')]+_0x20049e['countnoanswerretry']+_0x20049e[_0x88f2('0xf')]+_0x20049e[_0x88f2('0x10')]+_0x20049e[_0x88f2('0x11')]+_0x20049e[_0x88f2('0x12')]+_0x20049e['countagentrejectretry'];this[_0x88f2('0xf')]=_0x20049e[_0x88f2('0xf')];this[_0x88f2('0x10')]=_0x20049e['countdropretry'];this[_0x88f2('0x11')]=_0x20049e[_0x88f2('0x11')];this[_0x88f2('0x12')]=_0x20049e[_0x88f2('0x12')];this[_0x88f2('0x13')]=_0x20049e[_0x88f2('0x13')];this[_0x88f2('0xa')]=_0x20049e['queue'];this[_0x88f2('0x14')]=_0x20049e['name'];this['calleridnum']=_0x20049e[_0x88f2('0x15')];this[_0x88f2('0x16')]=_0x20049e[_0x88f2('0x16')];this['responsetime']=_0x20049e[_0x88f2('0x17')];this[_0x88f2('0x18')]=_0x20049e[_0x88f2('0x17')];this[_0x88f2('0x19')]=getSeconds(_0x20049e['responsetime'],_0x20049e['starttime']);this[_0x88f2('0x1a')]=0x0;this[_0x88f2('0x1b')]=0x0;this[_0x88f2('0x1c')]=_0x20049e[_0x88f2('0x1c')];this[_0x88f2('0x1d')]=_0x20049e[_0x88f2('0x1d')];this[_0x88f2('0x1e')]=_0x20049e[_0x88f2('0x1e')];this[_0x88f2('0x1f')]=_0x20049e['recallme'];this[_0x88f2('0x20')]=_0x20049e[_0x88f2('0x20')];this[_0x88f2('0x21')]=_0x20049e[_0x88f2('0x21')];this[_0x88f2('0x22')]=_0x20049e['UserId'];this[_0x88f2('0x23')]=_0x20049e[_0x88f2('0x23')];this['CampaignId']=_0x20049e[_0x88f2('0x24')];this[_0x88f2('0x25')]=_0x20049e[_0x88f2('0x25')]||'';this[_0x88f2('0x26')]=_0x20049e[_0x88f2('0x26')]||'';}module['exports']=History; \ No newline at end of file +var _0xcdeb=['responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','calleridname','calleridnum','number','starttime'];(function(_0x5d9d1b,_0x58a6f6){var _0x32c17c=function(_0x5e92c5){while(--_0x5e92c5){_0x5d9d1b['push'](_0x5d9d1b['shift']());}};_0x32c17c(++_0x58a6f6);}(_0xcdeb,0xd9));var _0xbcde=function(_0x4fa20d,_0x566159){_0x4fa20d=_0x4fa20d-0x0;var _0xda1a85=_0xcdeb[_0x4fa20d];return _0xda1a85;};'use strict';var util=require(_0xbcde('0x0'));var _=require('lodash');var moment=require(_0xbcde('0x1'));function getSeconds(_0x1fd7ec,_0x451dda){var _0x436cca=moment(_0x1fd7ec)['milliseconds'](0x0);var _0x1291fc=moment(_0x451dda)[_0xbcde('0x2')](0x0);return _0x436cca['diff'](_0x1291fc,_0xbcde('0x3'));}function History(_0x13a97b){this[_0xbcde('0x4')]=_0x13a97b[_0xbcde('0x4')];this[_0xbcde('0x5')]=_0x13a97b['scheduledat']||undefined;this[_0xbcde('0x6')]=_0x13a97b[_0xbcde('0x6')];this[_0xbcde('0x7')]=_0x13a97b[_0xbcde('0x6')]===_0xbcde('0x8')?_0xbcde('0x9'):_0x13a97b['type'];this[_0xbcde('0xa')]=_0x13a97b['countbusyretry'];this[_0xbcde('0xb')]=_0x13a97b[_0xbcde('0xb')];this[_0xbcde('0xc')]=_0x13a97b[_0xbcde('0xc')];this[_0xbcde('0xd')]=_0x13a97b[_0xbcde('0xa')]+_0x13a97b[_0xbcde('0xb')]+_0x13a97b[_0xbcde('0xc')]+_0x13a97b[_0xbcde('0xe')]+_0x13a97b['countdropretry']+_0x13a97b['countabandonedretry']+_0x13a97b[_0xbcde('0xf')]+_0x13a97b[_0xbcde('0x10')];this[_0xbcde('0xe')]=_0x13a97b[_0xbcde('0xe')];this[_0xbcde('0x11')]=_0x13a97b[_0xbcde('0x11')];this[_0xbcde('0x12')]=_0x13a97b[_0xbcde('0x12')];this['countmachineretry']=_0x13a97b['countmachineretry'];this['countagentrejectretry']=_0x13a97b[_0xbcde('0x10')];this[_0xbcde('0x9')]=_0x13a97b[_0xbcde('0x9')];this[_0xbcde('0x13')]=_0x13a97b['name'];this[_0xbcde('0x14')]=_0x13a97b[_0xbcde('0x15')];this[_0xbcde('0x16')]=_0x13a97b['starttime'];this[_0xbcde('0x17')]=_0x13a97b[_0xbcde('0x17')];this[_0xbcde('0x18')]=_0x13a97b[_0xbcde('0x17')];this[_0xbcde('0x19')]=getSeconds(_0x13a97b[_0xbcde('0x17')],_0x13a97b[_0xbcde('0x16')]);this[_0xbcde('0x1a')]=0x0;this[_0xbcde('0x1b')]=0x0;this[_0xbcde('0x1c')]=_0x13a97b['callback'];this[_0xbcde('0x1d')]=_0x13a97b[_0xbcde('0x1d')];this['callbackat']=_0x13a97b[_0xbcde('0x1e')];this[_0xbcde('0x1f')]=_0x13a97b['recallme'];this[_0xbcde('0x20')]=_0x13a97b[_0xbcde('0x20')];this[_0xbcde('0x21')]=_0x13a97b['ListId'];this[_0xbcde('0x22')]=_0x13a97b[_0xbcde('0x22')];this['VoiceQueueId']=_0x13a97b[_0xbcde('0x23')];this[_0xbcde('0x24')]=_0x13a97b[_0xbcde('0x24')];this[_0xbcde('0x25')]=_0x13a97b[_0xbcde('0x25')]||'';this['originatecalleridname']=_0x13a97b[_0xbcde('0x26')]||'';}module[_0xbcde('0x27')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 79c6dfc..906c027 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 _0x4d52=['avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','getContactDialer','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','isTrunkReachable','active','status','reachable','SIP/%s','unmonitored','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','uniqueid','custom:amd','buildObj','amd','[syncHangupInAMD]','MACHINE','Machine','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','add','dialMachineRetryFrequency','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','HangupInAMD','membername','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','countabandonedretry','dialMachineMaxRetry','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','Unknow','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','Drop','dropreason','TIMEOUT','dialDropMaxRetry','queueCallerAbandonCreateState','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','calleridname','calleridnum','[syncAgentComplete][createHistory][11]','strategy','roundrobin','locked','paused','stateinterface','actionid','rrmemory','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','syncQueueStatusComplete','[Catch][Preview][syncQueueStatusComplete]','finally','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','ifTime','Failure','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','content','true','indexOf','all','some','GLOBAL_INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','power','dialPowerLevel','predictive','handleIvr','checkIfTime','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','dialer','ACTIVE','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','%s%s','XMD-','toUpper','callerid','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialCutDigit','substring','SIP/%s/%s%s','trim','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','getQueue','checkRetriveMax','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialDropRetryFrequency','[rescheduleContact][Drop]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','dialNoAnswerMaxRetry','reason\x203\x20ringing\x20no\x20answer','custom:agentbusy','busy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','custom:agentcongestion','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','outboundDropCallsDayTimeout','round','predictiveIntervalMinThreshold','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at',')\x20are\x20less\x20than\x20threshold\x20(','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','busyFactor','[getDataPredictive]','check\x20failure','outboundQueuePauses','[CatchErlangB]','floor','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','dialRecallMeTimeout','Agent','run','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','inBlackList','limitCalls','RUNNING','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','dialOrderByScheduledAt','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','p\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','uuid','md5','../preview/util/util','../../../config/environment/','../../../config/logger','booked','predictiveCalls','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./final','./agentComplete','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','prototype','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncQueueSummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','name','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','isEmpty','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','total','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','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:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','seconds','clearing\x20variable\x20start\x20progressive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','stack','inspect','length','originated','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','state','statedesc','endtime','starttime','clearZombieChannels','[uniqueid]','[actions]','enqueue','isNil','Action','channel','catch','No\x20such\x20channel','updateOriginated','queue','countReScheduled','then','[countReScheduled]\x20','resolve','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x4d52,0x15c));var _0x24d5=function(_0x5a0080,_0x5c900b){_0x5a0080=_0x5a0080-0x0;var _0x45c311=_0x4d52[_0x5a0080];return _0x45c311;};'use strict';var util=require(_0x24d5('0x0'));var _=require(_0x24d5('0x1'));var BPromise=require(_0x24d5('0x2'));var uuid=require(_0x24d5('0x3'));var moment=require('moment');var rr=require('rr');var md5=require(_0x24d5('0x4'));var Redis=require('ioredis');var ut=require(_0x24d5('0x5'));var config=require(_0x24d5('0x6'));var logger=require(_0x24d5('0x7'))('dialer');var loggerBooked=require(_0x24d5('0x7'))(_0x24d5('0x8'));var loggerPredictive=require(_0x24d5('0x7'))('predictive');var loggerPredictiveCalls=require(_0x24d5('0x7'))(_0x24d5('0x9'));var loggerSyncQueueSummary=require(_0x24d5('0x7'))('syncQueueSummary');var ami=require('../ami');config[_0x24d5('0xa')]=_[_0x24d5('0xb')](config['redis'],{'host':_0x24d5('0xc'),'port':0x18eb});var io=require(_0x24d5('0xd'))(new Redis(config[_0x24d5('0xa')]));var cmHopper=require(_0x24d5('0xe'));var cmHopperHistory=require(_0x24d5('0xf'));var cmHopperBlack=require(_0x24d5('0x10'));var voiceQueueRt=require(_0x24d5('0x11'));var Action=require(_0x24d5('0x12'));var History=require('./history');var Final=require(_0x24d5('0x13'));var AgentComplete=require(_0x24d5('0x14'));var QueueCallerAbandon=require(_0x24d5('0x15'));var Hangup=require(_0x24d5('0x16'));var ipAgi=process['env'][_0x24d5('0x17')]||_0x24d5('0x18');var strategy={'rrmemory':'rrmemory','roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x24d5('0x19')]['enqueue']=function(_0x58968f){this[_0x24d5('0x1a')]=this[_0x24d5('0x1a')]?this['tail']['finally'](_0x58968f):_0x58968f();};function Dialer(_0x488eb7,_0x348523){this[_0x24d5('0x1b')]=new Sequence();this['preview']=_0x348523;this['voiceQueues']=_0x488eb7[_0x24d5('0x1c')];this['campaigns']=_0x488eb7[_0x24d5('0x1d')];this[_0x24d5('0x1e')]=_0x488eb7[_0x24d5('0x1e')];this[_0x24d5('0x1f')]=_0x488eb7['trunks'];this[_0x24d5('0x20')]=config[_0x24d5('0x20')]||0x2;this[_0x24d5('0x21')]={};this[_0x24d5('0x22')]={};this[_0x24d5('0x23')]={};this[_0x24d5('0x24')]={};this[_0x24d5('0x25')]={};this[_0x24d5('0x26')]={};this[_0x24d5('0x27')]={};this[_0x24d5('0x28')]={};this['queueBooked']={};this['queueBookedRR']={};ami['on'](_0x24d5('0x29'),this[_0x24d5('0x2a')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x2c'),this[_0x24d5('0x2d')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x2e'),this[_0x24d5('0x2f')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x30'),this[_0x24d5('0x31')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x32'),this[_0x24d5('0x33')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x34'),this[_0x24d5('0x35')]['bind'](this));ami['on'](_0x24d5('0x36'),this[_0x24d5('0x37')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x38'),this[_0x24d5('0x39')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x3a'),this[_0x24d5('0x3b')][_0x24d5('0x2b')](this));ami['on'](_0x24d5('0x3c'),this['syncQueueStatusComplete'][_0x24d5('0x2b')](this));this[_0x24d5('0x3d')]();this[_0x24d5('0x3e')]();}function isNotNull(_0x18be83){return _0x18be83!==null&&!_[_0x24d5('0x3f')](_0x18be83);}function checkIsLoggedIn(_0x55521a,_0x36b34a){return function(){if(_0x36b34a<=0x0){_0x55521a[_0x24d5('0x40')]='AGENTS_NOT_LOGGED';throw _0x55521a[_0x24d5('0x41')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x38a520){return _0x38a520;}function checkIsActive(_0x30e2d7,_0x3b8dd2){return function(){if(!isActive(_0x3b8dd2)){_0x30e2d7['message']=_0x24d5('0x42');throw _0x30e2d7[_0x24d5('0x41')]+_0x24d5('0x43');}};}function checkInterval(_0x4ad014){return function(){if(!isNotNull(_0x4ad014['Interval'])){_0x4ad014[_0x24d5('0x40')]=_0x24d5('0x44');throw _0x4ad014[_0x24d5('0x41')]+_0x24d5('0x45');}if(!isNotNull(_0x4ad014[_0x24d5('0x46')]['Intervals'])){_0x4ad014[_0x24d5('0x40')]=_0x24d5('0x44');throw _0x4ad014[_0x24d5('0x41')]+_0x24d5('0x45');}if(!isNotNull(_[_0x24d5('0x47')](_0x4ad014[_0x24d5('0x46')][_0x24d5('0x48')]))){_0x4ad014[_0x24d5('0x40')]=_0x24d5('0x44');throw _0x4ad014['name']+_0x24d5('0x45');}};}function msgResponse(_0x3a5182,_0x5f0cdc,_0x4464d5){return{'action':_0x3a5182,'response':_0x5f0cdc,'message':_0x4464d5,'stack':_0x4464d5};}function myreject(_0x211e76){return function(_0x2905ba){return _0x211e76(msgResponse(_0x24d5('0x49'),_0x24d5('0x4a'),JSON[_0x24d5('0x4b')](_0x2905ba)));};}function getSeconds(_0x3b3309,_0x459666){var _0x2c5944=moment(_0x3b3309)[_0x24d5('0x4c')](0x0);var _0x5ee539=moment(_0x459666)['milliseconds'](0x0);return _0x2c5944[_0x24d5('0x4d')](_0x5ee539,'seconds');}function emit(_0x25ed77,_0x3be261,_0x39f075){io['to'](_0x25ed77)[_0x24d5('0x4e')](_0x3be261,_0x39f075);}function emitVoiceQueueSummary(_0x444098){if(_0x444098[_0x24d5('0x4f')]==='outbound'){var _0x25c83b={'id':_0x444098['id'],'name':_0x444098[_0x24d5('0x41')],'strategy':_0x444098['strategy'],'answered':_0x444098[_0x24d5('0x50')],'available':_0x444098[_0x24d5('0x51')],'loggedIn':_0x444098[_0x24d5('0x52')],'pTalking':_0x444098[_0x24d5('0x53')],'sumBillable':_0x444098[_0x24d5('0x54')],'sumDuration':_0x444098['sumDuration'],'sumHoldTime':_0x444098[_0x24d5('0x55')]||0x0,'talking':_0x444098[_0x24d5('0x56')],'total':_0x444098[_0x24d5('0x57')],'type':_0x444098['type'],'unmanaged':_0x444098[_0x24d5('0x58')],'abandoned':_0x444098['abandoned'],'waiting':_0x444098['waiting'],'loggedInDb':_0x444098[_0x24d5('0x59')],'dialActive':_0x444098[_0x24d5('0x5a')],'dialMethod':_0x444098[_0x24d5('0x5b')],'dialOriginateCallerIdName':_0x444098[_0x24d5('0x5c')],'dialOriginateCallerIdNumber':_0x444098['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x444098['dialOriginateTimeout'],'dialPrefix':_0x444098[_0x24d5('0x5d')],'outboundAnswerAgiCallsDay':_0x444098[_0x24d5('0x5e')],'outboundAnswerCallsDay':_0x444098[_0x24d5('0x5f')],'outboundBlacklistCallsDay':_0x444098[_0x24d5('0x60')],'outboundBusyCallsDay':_0x444098[_0x24d5('0x61')],'outboundCongestionCallsDay':_0x444098[_0x24d5('0x62')],'outboundDropCallsDayACS':_0x444098['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x444098[_0x24d5('0x63')],'outboundDropCallsDayTimeout':_0x444098['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x444098[_0x24d5('0x64')],'outboundNoSuchCallsDay':_0x444098[_0x24d5('0x65')],'outboundOriginateFailureCallsDay':_0x444098[_0x24d5('0x66')],'outboundReCallsDay':_0x444098[_0x24d5('0x67')],'outboundRejectCallsDay':_0x444098[_0x24d5('0x68')],'outboundUnknownCallsDay':_0x444098[_0x24d5('0x69')],'predictiveIntervalAnsweredCalls':_0x444098[_0x24d5('0x6a')],'predictiveIntervalAvgHoldtime':_0x444098[_0x24d5('0x6b')],'predictiveIntervalAvgTalktime':_0x444098[_0x24d5('0x6c')],'predictiveIntervalDroppedCallsCallersExit':_0x444098[_0x24d5('0x6d')],'predictiveIntervalDroppedCallsTimeout':_0x444098[_0x24d5('0x6e')],'predictiveIntervalErlangCalls':_0x444098['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x444098[_0x24d5('0x6f')],'predictiveIntervalHitRate':_0x444098[_0x24d5('0x70')],'predictiveIntervalMultiplicativeFactor':_0x444098[_0x24d5('0x71')],'predictiveIntervalPauses':_0x444098[_0x24d5('0x72')],'predictiveIntervalAvailable':_0x444098[_0x24d5('0x73')],'predictiveIntervalTotalCalls':_0x444098['predictiveIntervalTotalCalls'],'message':_0x444098['message'],'originated':_0x444098['originated'],'erlangCalls':_0x444098[_0x24d5('0x74')],'erlangCallToSecond':_0x444098[_0x24d5('0x75')],'erlangAbandonmentRate':_0x444098[_0x24d5('0x76')],'erlangBusyFactor':_0x444098[_0x24d5('0x77')],'startPredictive':_0x444098[_0x24d5('0x26')],'startProgressive':_0x444098[_0x24d5('0x27')]};if(_0x444098[_0x24d5('0x78')]){_0x25c83b[_0x24d5('0x78')]={'id':_0x444098['Trunk']['id'],'name':_0x444098[_0x24d5('0x78')]['name'],'active':_0x444098[_0x24d5('0x78')]['active'],'callerid':_0x444098['Trunk']['callerid']};}if(_0x444098[_0x24d5('0x46')]){_0x25c83b[_0x24d5('0x46')]={'id':_0x444098[_0x24d5('0x46')]['id'],'name':_0x444098[_0x24d5('0x46')][_0x24d5('0x41')]};}var _0x50af7d=md5(JSON[_0x24d5('0x4b')](_0x25c83b));if(_0x444098['md5']!==_0x50af7d){_0x444098[_0x24d5('0x4')]=_0x50af7d;emit(util[_0x24d5('0x79')](_0x24d5('0x7a'),_0x25c83b['name']),_0x24d5('0x7b'),_0x25c83b);}}}function emitCampaignSummary(_0x4a730c){if(_0x4a730c[_0x24d5('0x4f')]===_0x24d5('0x7c')){emit(util['format'](_0x24d5('0x7d'),_0x4a730c[_0x24d5('0x41')]),_0x24d5('0x7e'),_0x4a730c);}}function checkGetDataPredictive(_0x22a67b){if(isNotNull(_0x22a67b)&&!_[_0x24d5('0x47')](_0x22a67b)){loggerPredictive['info'](_0x24d5('0x7f'));loggerPredictive[_0x24d5('0x80')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a67b['predictiveIntervalTotalCalls']);loggerPredictive['info']('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x22a67b['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x24d5('0x81'),_0x22a67b[_0x24d5('0x6e')]);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x82'),_0x22a67b['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x83'),_0x22a67b[_0x24d5('0x6b')]);loggerPredictive['info'](_0x24d5('0x84'),_0x22a67b[_0x24d5('0x6c')]);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x85'));if(_0x22a67b[_0x24d5('0x86')]>0x0){if(!_[_0x24d5('0x3f')](_0x22a67b[_0x24d5('0x6c')])&&_0x22a67b[_0x24d5('0x6c')]>0x0){return!![];}loggerPredictive[_0x24d5('0x80')](_0x24d5('0x87'));if(!_[_0x24d5('0x3f')](_0x22a67b['predictiveIntervalAvgHoldtime'])&&_0x22a67b['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x24d5('0x80')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive['info'](_0x24d5('0x88'));}}else{loggerPredictive[_0x24d5('0x80')](_0x24d5('0x89'));}return![];}function mergeDataErlangB(_0x36f844){return function(_0x1189a8){loggerPredictive[_0x24d5('0x80')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x24d5('0x80')](_0x24d5('0x8a'),_0x1189a8[_0x24d5('0x74')]);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x8b'),_0x1189a8[_0x24d5('0x75')]);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x8c'),_0x1189a8[_0x24d5('0x76')]);loggerPredictive['info'](_0x24d5('0x8d'),_0x1189a8[_0x24d5('0x77')]);loggerPredictive[_0x24d5('0x80')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1189a8['erlangAbandonmentRate']);loggerPredictive[_0x24d5('0x80')]('---------------------------');_[_0x24d5('0x8e')](_0x36f844,_0x1189a8);};}function getDiff(_0x2afb87){var _0x1e6633=moment()['milliseconds'](0x0);var _0x50b50e=moment(_0x2afb87)[_0x24d5('0x4c')](0x0);return _0x1e6633[_0x24d5('0x4d')](_0x50b50e,_0x24d5('0x8f'));}function ifInterval(_0x5410bd,_0x28a651){if(_[_0x24d5('0x3f')](_0x28a651)){return![];}return getDiff(_0x28a651)<_0x5410bd*0x3c;}function freeVariablesPredictive(_0x2e4188){if(isNotNull(_0x2e4188)){if(!_[_0x24d5('0x3f')](_0x2e4188[_0x24d5('0x27')])){_0x2e4188[_0x24d5('0x27')]=undefined;loggerPredictive[_0x24d5('0x80')](_0x2e4188[_0x24d5('0x41')],_0x24d5('0x90'));}if(!_[_0x24d5('0x3f')](_0x2e4188[_0x24d5('0x26')])){_0x2e4188[_0x24d5('0x26')]=undefined;loggerPredictive[_0x24d5('0x80')](_0x2e4188[_0x24d5('0x41')],'clearing\x20variable\x20start\x20predictive');}if(!_[_0x24d5('0x3f')](_0x2e4188[_0x24d5('0x91')])){clearInterval(_0x2e4188[_0x24d5('0x91')]);_0x2e4188[_0x24d5('0x91')]=undefined;loggerPredictive[_0x24d5('0x80')](_0x2e4188[_0x24d5('0x41')],_0x24d5('0x92'));}}}function erlangb(_0x27389b,_0x161ae2){if(_0x161ae2===0x0){return 0x0;}var _0xb44218=0x1;for(var _0x4cb740=0x1;_0x4cb740<=_0x161ae2;_0x4cb740+=0x1){_0xb44218=0x1+_0xb44218*_0x4cb740/_0x27389b;}return 0x1/_0xb44218;}function isVoiceQueueOutbound(_0x46eb5a){return _0x46eb5a===_0x24d5('0x93');}function isNotPreview(_0x1ae98e){return _0x1ae98e!==_0x24d5('0x94');}function isCampaignIvr(_0x4a63d0){return _0x4a63d0===_0x24d5('0x7c');}function getCallerId(_0x96a84a,_0x3e3584,_0x1273f8){if(!_[_0x24d5('0x3f')](_0x1273f8)&&typeof _0x1273f8===_0x24d5('0x95')&&!_[_0x24d5('0x47')](_0x1273f8)){if(!_[_0x24d5('0x3f')](_0x3e3584)&&typeof _0x3e3584===_0x24d5('0x95')&&!_['isEmpty'](_0x3e3584)){return util[_0x24d5('0x79')](_0x24d5('0x96'),_0x3e3584,_0x1273f8);}return util['format'](_0x24d5('0x96'),_0x1273f8,_0x1273f8);}if(!_[_0x24d5('0x3f')](_0x96a84a)&&typeof _0x96a84a===_0x24d5('0x95')&&!_['isEmpty'](_0x96a84a)){return _0x96a84a;}return _0x24d5('0x97');}function loggerCatchQueueSummary(_0x4fe1cc,_0x321214){return function(_0x57121b){freeVariablesPredictive(_0x321214);emitVoiceQueueSummary(_0x321214);emitCampaignSummary(_0x321214);loggerSyncQueueSummary['error'](_0x4fe1cc,util['inspect'](_0x57121b,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xb8026d,_0xb5cc01){return function(_0x2ea162){loggerPredictive[_0x24d5('0x98')](_0xb5cc01[_0x24d5('0x41')],_0xb8026d);loggerPredictive['error'](_0x2ea162[_0x24d5('0x99')]);freeVariablesPredictive(_0xb5cc01);};}function loggerCatch(_0x1f6e30){return function(_0x3e5977){logger[_0x24d5('0x98')](_0x1f6e30,util[_0x24d5('0x9a')](_0x3e5977,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x542205){return _0x542205&&!_[_0x24d5('0x3f')](_0x542205)&&_0x542205[_0x24d5('0x9b')]>0x0;}function decremetOriginate(_0xc813b3){if(!_[_0x24d5('0x3f')](_0xc813b3)&&_0xc813b3!==null){if(typeof _0xc813b3[_0x24d5('0x9c')]!==_0x24d5('0x9d')){if(_0xc813b3['originated']>0x0){_0xc813b3[_0x24d5('0x9c')]-=0x1;}else{logger[_0x24d5('0x98')](_0x24d5('0x9e'));}}}else{logger[_0x24d5('0x98')](_0x24d5('0x9f'));}}function checkContactLowerLimitOriginate(_0x12ef6e,_0x58bc8b,_0x1c88b0){if(_0x58bc8b>_0x1c88b0){for(var _0x1c9a72=0x0;_0x1c9a72<_0x58bc8b-_0x1c88b0;_0x1c9a72+=0x1){decremetOriginate(_0x12ef6e);}}}function loggerGetContactDialer(_0x50210f,_0x16f737,_0x37c117){return function(_0x1d4f29){checkContactLowerLimitOriginate(_0x16f737,_0x37c117,0x0);logger[_0x24d5('0x98')](_0x50210f,util[_0x24d5('0x9a')](_0x1d4f29,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4f36d2){return function(_0x11ca89){if(isNotNull(_0x11ca89)&&isNotNull(_0x11ca89[0x0])){if(_0x11ca89[0x0][_0x24d5('0xa0')]>0x0){_0x4f36d2[_0x24d5('0x40')]='RESCHEDULED_CONTACTS';logger[_0x24d5('0x80')](_0x24d5('0xa1')+_0x4f36d2['name'],_0x11ca89[0x0][_0x24d5('0xa0')],_0x24d5('0xa2'));}else{_0x4f36d2[_0x24d5('0x40')]=_0x24d5('0xa3');logger[_0x24d5('0x80')](_0x24d5('0xa4')+_0x4f36d2[_0x24d5('0x41')]);}}};}function notSendMessagesQueue(_0x4c533b){if(_0x4c533b['sendMessageOneNotActive']){freeVariablesPredictive(_0x4c533b);if(_0x4c533b[_0x24d5('0x9c')]===0x0&&_0x4c533b[_0x24d5('0x56')]===0x0&&_0x4c533b['waiting']===0x0&&(_0x4c533b['pTalking']||0x0)===0x0){_0x4c533b[_0x24d5('0xa5')]=![];_0x4c533b[_0x24d5('0x51')]=0x0;_0x4c533b[_0x24d5('0x40')]=_0x24d5('0x42');loggerSyncQueueSummary[_0x24d5('0x98')](_0x24d5('0xa6'),_0x4c533b[_0x24d5('0x41')],_0x24d5('0xa7'));}else{_0x4c533b['message']=_0x24d5('0xa8');loggerSyncQueueSummary[_0x24d5('0x98')](_0x24d5('0xa6'),_0x4c533b['name'],_0x24d5('0xa9'));}emitVoiceQueueSummary(_0x4c533b);}}function notSendMessagesCampaign(_0x2b6668){if(_0x2b6668[_0x24d5('0xa5')]){if(_0x2b6668['originated']===0x0){_0x2b6668[_0x24d5('0xa5')]=![];_0x2b6668[_0x24d5('0x40')]=_0x24d5('0x42');loggerSyncQueueSummary[_0x24d5('0x98')](_0x24d5('0xaa'),_0x2b6668[_0x24d5('0x41')],_0x24d5('0xa7'));}else{_0x2b6668[_0x24d5('0x40')]=_0x24d5('0xa8');loggerSyncQueueSummary[_0x24d5('0x98')](_0x24d5('0xaa'),_0x2b6668['name'],'is\x20disactive');}emitCampaignSummary(_0x2b6668);}}function createObjHistory(_0x139f6b,_0x131284,_0x19dd89,_0x261b51,_0x51de48){_0x139f6b[_0x24d5('0x40')]=_0x19dd89;var _0x47d638=new Action(_0x139f6b,_0x131284);var _0x389442=new History(_0x47d638);_0x389442[_0x24d5('0xab')]=_0x261b51;_0x389442[_0x24d5('0xac')]=_0x51de48;_0x389442[_0x24d5('0xad')]=_0x47d638[_0x24d5('0xae')];return _0x389442;}Dialer[_0x24d5('0x19')][_0x24d5('0x3e')]=function(){var _0x3dc15c=this;setInterval(function(){_0x3dc15c[_0x24d5('0xaf')](_0x3dc15c['uniqueId'],_0x24d5('0xb0'));_0x3dc15c['clearZombieChannels'](_0x3dc15c['actions'],_0x24d5('0xb1'));},0x32c8);};Dialer[_0x24d5('0x19')][_0x24d5('0xaf')]=function(_0x3d39c6,_0x13032c){var _0x2a3ea7=this;for(var _0x121739 in _0x3d39c6){if(typeof _0x3d39c6[_0x121739]!==_0x24d5('0x9d')){this['sequence'][_0x24d5('0xb2')](function(){if(!_[_0x24d5('0xb3')](_0x3d39c6[_0x121739])){return ami[_0x24d5('0xb4')]({'action':'status','channel':_0x3d39c6[_0x121739][_0x24d5('0xb5')]})[_0x24d5('0xb6')](function(_0x2a6678){if(_0x2a6678['message']===_0x24d5('0xb7')){setTimeout(function(){if(_0x3d39c6[_0x121739]&&_0x3d39c6[_0x121739][_0x24d5('0x4f')]!==_0x24d5('0x7c')){_0x2a3ea7[_0x24d5('0xb8')](_0x2a3ea7['voiceQueues'][_0x3d39c6[_0x121739][_0x24d5('0xb9')]]);logger['error']('[Dialer][checkChannel]',_0x13032c,_0x121739,_0x3d39c6[_0x121739][_0x24d5('0xb9')]);delete _0x3d39c6[_0x121739];}if(_0x3d39c6[_0x121739]&&_0x3d39c6[_0x121739][_0x24d5('0x4f')]==='ivr'){_0x2a3ea7[_0x24d5('0xb8')](_0x2a3ea7[_0x24d5('0x1d')][_0x3d39c6[_0x121739][_0x24d5('0xb9')]]);logger[_0x24d5('0x98')]('[Dialer][checkChannel][ivr]',_0x13032c,_0x121739,_0x3d39c6[_0x121739][_0x24d5('0xb9')]);delete _0x3d39c6[_0x121739];}},0x2328);}});}});}}};Dialer[_0x24d5('0x19')][_0x24d5('0xba')]=function(_0x48996b){return BPromise['resolve']()[_0x24d5('0xbb')](cmHopper[_0x24d5('0xba')](_0x48996b))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xbc')));};Dialer['prototype']['checkIsBlackList']=function(_0x1038dd){return BPromise[_0x24d5('0xbd')]()['then'](cmHopperBlack[_0x24d5('0xbe')](_0x1038dd))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xbf')));};Dialer[_0x24d5('0x19')][_0x24d5('0xc0')]=function(_0x49467e){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](cmHopperBlack[_0x24d5('0xc0')](_0x49467e))[_0x24d5('0xb6')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer['prototype'][_0x24d5('0xc1')]=function(_0x3b2b88){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](cmHopperHistory[_0x24d5('0xc2')](_0x3b2b88))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xc3')));};Dialer[_0x24d5('0x19')]['rescheduleContact']=function(_0x3ac5da){return BPromise['resolve']()[_0x24d5('0xbb')](cmHopper[_0x24d5('0xc4')](_0x3ac5da))[_0x24d5('0xb6')](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype'][_0x24d5('0xc5')]=function(_0x34f166,_0x594a7b,_0x369246){return BPromise['resolve']()['then'](cmHopper[_0x24d5('0xc5')](_0x34f166,_0x594a7b,_0x369246))[_0x24d5('0xb6')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x24d5('0x19')]['getContactDialer']=function(_0x1a70e9,_0x10423c,_0x46c20d,_0x9fc4b6,_0x51f68a){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](cmHopper[_0x24d5('0xc6')](_0x1a70e9,_0x10423c,_0x46c20d,_0x9fc4b6))[_0x24d5('0xb6')](function(_0x43250f){_0x51f68a[_0x24d5('0xc7')]-=_0x46c20d;_0x51f68a[_0x24d5('0xc7')]=_0x51f68a[_0x24d5('0xc7')]>0x0?_0x51f68a['temp']:0x0;loggerCatch(_0x24d5('0xc8'))(_0x43250f);});};Dialer[_0x24d5('0x19')][_0x24d5('0xc9')]=function(_0x3b18fc,_0x58541d,_0x55696f,_0x1e3058){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](cmHopper[_0x24d5('0xc9')](_0x3b18fc,_0x58541d,_0x55696f))[_0x24d5('0xb6')](function(_0x7858a8){_0x1e3058['temp']-=_0x58541d;_0x1e3058[_0x24d5('0xc7')]=_0x1e3058['temp']>0x0?_0x1e3058[_0x24d5('0xc7')]:0x0;loggerCatch(_0x24d5('0xca'))(_0x7858a8);});};Dialer[_0x24d5('0x19')]['getVoiceQueueRtPauses']=function(_0x3167e7){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](voiceQueueRt[_0x24d5('0xcb')](_0x3167e7))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xcc')));};Dialer['prototype'][_0x24d5('0xcd')]=function(_0xcc7a25){return BPromise[_0x24d5('0xbd')]()['then'](cmHopper['moveContactManagedDialer'](_0xcc7a25))[_0x24d5('0xb6')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0x24d5('0x19')][_0x24d5('0xce')]=function(_0x2b363b){return BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](cmHopperHistory[_0x24d5('0xce')](_0x2b363b))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xcf')));};Dialer[_0x24d5('0x19')][_0x24d5('0xb8')]=function(_0x4cf2fa){if(!_[_0x24d5('0x3f')](_0x4cf2fa)&&_0x4cf2fa!==null){if(typeof _0x4cf2fa[_0x24d5('0x9c')]!==_0x24d5('0x9d')){if(_0x4cf2fa[_0x24d5('0x9c')]>0x0){_0x4cf2fa['originated']-=0x1;}else{logger['error'](_0x24d5('0xd0'));}}}else{logger['error'](_0x24d5('0xd1'));}};Dialer[_0x24d5('0x19')][_0x24d5('0xd2')]=function(_0x4f14b8,_0x14d6cc){var _0x544f3b=this;return function(_0x20e171){_0x544f3b[_0x24d5('0xb8')](_0x14d6cc);logger['error'](_0x4f14b8,util[_0x24d5('0x9a')](_0x20e171,{'showHidden':![],'depth':null}));};};Dialer[_0x24d5('0x19')][_0x24d5('0xd3')]=function(_0x2c8e6f,_0x5c7b65,_0x44f35e){var _0x6b1b3={'state':0x19,'statedesc':'notFound'};this[_0x24d5('0xb8')](_0x5c7b65);this[_0x24d5('0xd4')](_[_0x24d5('0x8e')](_0x6b1b3,_[_0x24d5('0xd5')](_0x44f35e,[_0x24d5('0xd6'),_0x24d5('0xd7'),_0x24d5('0xd8'),_0x24d5('0xd9'),_0x24d5('0xda')])),'[emptyContact][createHistory]',_0x24d5('0xdb'));logger[_0x24d5('0x98')](_0x2c8e6f);};Dialer[_0x24d5('0x19')][_0x24d5('0xdc')]=function(_0x4de63f){return _0x4de63f==='Success';};Dialer[_0x24d5('0x19')][_0x24d5('0xdd')]=function(_0x23235d){return!_[_0x24d5('0x3f')](_0x23235d)&&_0x23235d&&!_[_0x24d5('0x3f')](_0x23235d['name'])&&!_['isUndefined'](_0x23235d[_0x24d5('0xde')])&&_0x23235d['active']&&(this[_0x24d5('0x1f')][util[_0x24d5('0x79')]('SIP/%s',_0x23235d[_0x24d5('0x41')])][_0x24d5('0xdf')]===_0x24d5('0xe0')||this[_0x24d5('0x1f')][util[_0x24d5('0x79')](_0x24d5('0xe1'),_0x23235d[_0x24d5('0x41')])][_0x24d5('0xdf')]===_0x24d5('0xe2'));};Dialer[_0x24d5('0x19')][_0x24d5('0xd4')]=function(_0x5640d6,_0x1e5228,_0x2341c9){this[_0x24d5('0xce')](_0x5640d6)['catch'](loggerCatch(_0x1e5228));this['moveContactManagedDialer'](_0x5640d6)['catch'](loggerCatch(_0x2341c9));};Dialer['prototype'][_0x24d5('0x39')]=function(_0x400c8e){var _0x54cccc=this[_0x24d5('0x24')][_0x400c8e['uniqueid']];var _0x3e8731;if(!_[_0x24d5('0xb3')](_0x400c8e)&&!_[_0x24d5('0xb3')](_0x400c8e['variable'])&&!_['isNil'](_0x400c8e[_0x24d5('0xe3')][_0x24d5('0xe4')])&&_0x400c8e[_0x24d5('0xe5')]===_0x24d5('0xe6')&&_0x54cccc){if(_0x54cccc['type']!=='ivr'&&this[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0xe7')]&&_0x400c8e[_0x24d5('0xe8')]==='HANGUP'){delete this[_0x24d5('0x24')][_0x400c8e[_0x24d5('0xe9')]];this[_0x24d5('0xb8')](this[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]]);this[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0x5f')]+=0x1;this[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0x5e')]+=0x1;_0x3e8731=new Hangup(_0x54cccc,_0x400c8e);_0x3e8731['state']=0x12;_0x3e8731[_0x24d5('0xac')]='HangupInAMD';_0x3e8731['membername']='AMD';ami[_0x24d5('0x4e')](_0x24d5('0xea'),ut[_0x24d5('0xeb')](_0x3e8731,_0x24d5('0xec')));this['saveInDb'](_0x3e8731,'[syncHangupInAMD][createHistory]',_0x24d5('0xed'));}if(_0x54cccc[_0x24d5('0x4f')]!==_0x24d5('0x7c')&&this['voiceQueues'][_0x54cccc['queue']][_0x24d5('0xe7')]&&_0x400c8e[_0x24d5('0xe8')]===_0x24d5('0xee')){var _0xe9a4de=this;return new BPromise(function(_0x56720b,_0x19c003){delete _0xe9a4de[_0x24d5('0x24')][_0x400c8e['uniqueid']];_0xe9a4de[_0x24d5('0xb8')](_0xe9a4de[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]]);_0xe9a4de[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0x5f')]+=0x1;_0xe9a4de['voiceQueues'][_0x54cccc['queue']][_0x24d5('0x5e')]+=0x1;var _0xb57101=_0xe9a4de[_0x24d5('0x1c')][_0x54cccc[_0x24d5('0xb9')]];var _0xa94c6c=new Hangup(_0x54cccc,_0x400c8e);_0xa94c6c[_0x24d5('0xab')]=0x13;_0xa94c6c[_0x24d5('0xac')]=_0x24d5('0xef');_0xa94c6c['membername']=_0x24d5('0xf0');_0xa94c6c[_0x24d5('0xf1')]+=0x1;_0xa94c6c[_0x24d5('0xf2')]+=0x1;_0xa94c6c[_0x24d5('0xec')]=!![];ami[_0x24d5('0x4e')](_0x24d5('0xea'),ut[_0x24d5('0xeb')](_0xa94c6c,'amd'));_0xe9a4de['createHistory'](_0xa94c6c)['catch'](loggerCatch(_0x24d5('0xf3')));if(_0xa94c6c[_0x24d5('0xf4')]+_0xa94c6c[_0x24d5('0xf5')]+_0xa94c6c[_0x24d5('0xf6')]+_0xa94c6c[_0x24d5('0xf7')]+_0xa94c6c[_0x24d5('0xf8')]+_0xa94c6c['countabandonedretry']+_0xa94c6c['countmachineretry']+_0xa94c6c[_0x24d5('0xf9')]>=_0xb57101[_0x24d5('0xfa')]){_0xe9a4de[_0x24d5('0xfb')](_0xa94c6c,_0x56720b,_0x19c003,_0x24d5('0xfc'));}else{if(_0xa94c6c[_0x24d5('0xf1')]>=_0xb57101['dialMachineMaxRetry']){_0xe9a4de[_0x24d5('0xfd')](_0xa94c6c,_0x56720b,_0x19c003,_0x24d5('0xfe'));}else{_0xe9a4de[_0x24d5('0xc4')]({'active':![],'countmachineretry':_0xa94c6c['countmachineretry'],'scheduledat':moment()[_0x24d5('0xff')](_0xb57101[_0x24d5('0x100')],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0xa94c6c[_0x24d5('0xd6')],'ListId':_0xa94c6c[_0x24d5('0xd7')],'VoiceQueueId':_0xa94c6c[_0x24d5('0xd9')]||undefined,'CampaignId':_0xa94c6c[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x103')));_0x56720b({'reschedule':0x1});}}});}if(_0x54cccc[_0x24d5('0x4f')]===_0x24d5('0x7c')&&this[_0x24d5('0x1d')][_0x54cccc['queue']][_0x24d5('0xe7')]&&_0x400c8e[_0x24d5('0xe8')]==='HANGUP'){delete this['uniqueId'][_0x400c8e[_0x24d5('0xe9')]];this['updateOriginated'](this['campaigns'][_0x54cccc[_0x24d5('0xb9')]]);_0x3e8731=new Hangup(_0x54cccc,_0x400c8e);_0x3e8731[_0x24d5('0xab')]=0x12;_0x3e8731[_0x24d5('0xac')]=_0x24d5('0x104');_0x3e8731[_0x24d5('0x105')]=_0x24d5('0xf0');ami[_0x24d5('0x4e')](_0x24d5('0xea'),ut[_0x24d5('0xeb')](_0x3e8731,_0x24d5('0xec')));this[_0x24d5('0xd4')](_0x3e8731,_0x24d5('0x106'),_0x24d5('0x107'));}if(_0x54cccc[_0x24d5('0x4f')]===_0x24d5('0x7c')&&this[_0x24d5('0x1d')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0xe7')]&&_0x400c8e[_0x24d5('0xe8')]===_0x24d5('0xee')){var _0xe9a4de=this;return new BPromise(function(_0x3e0d09,_0x128199){delete _0xe9a4de[_0x24d5('0x24')][_0x400c8e[_0x24d5('0xe9')]];_0xe9a4de[_0x24d5('0xb8')](_0xe9a4de['campaigns'][_0x54cccc[_0x24d5('0xb9')]]);_0xe9a4de[_0x24d5('0x1d')][_0x54cccc[_0x24d5('0xb9')]][_0x24d5('0x5f')]+=0x1;_0xe9a4de[_0x24d5('0x1d')][_0x54cccc[_0x24d5('0xb9')]]['outboundAnswerAgiCallsDay']+=0x1;var _0x268ab1=_0xe9a4de[_0x24d5('0x1d')][_0x54cccc['queue']];var _0x240716=new Hangup(_0x54cccc,_0x400c8e);_0x240716['state']=0x13;_0x240716[_0x24d5('0xac')]=_0x24d5('0xef');_0x240716[_0x24d5('0x105')]=_0x24d5('0xf0');_0x240716[_0x24d5('0xf1')]+=0x1;_0x240716[_0x24d5('0xf2')]+=0x1;_0x240716[_0x24d5('0xec')]=!![];ami[_0x24d5('0x4e')](_0x24d5('0xea'),ut['buildObj'](_0x240716,_0x24d5('0xec')));_0xe9a4de[_0x24d5('0xce')](_0x240716)['catch'](loggerCatch(_0x24d5('0xf3')));if(_0x240716[_0x24d5('0xf4')]+_0x240716[_0x24d5('0xf5')]+_0x240716['countnoanswerretry']+_0x240716[_0x24d5('0xf7')]+_0x240716[_0x24d5('0xf8')]+_0x240716[_0x24d5('0x108')]+_0x240716[_0x24d5('0xf1')]+_0x240716[_0x24d5('0xf9')]>=_0x268ab1[_0x24d5('0xfa')]){_0xe9a4de[_0x24d5('0xfb')](_0x240716,_0x3e0d09,_0x128199,_0x24d5('0xfc'));}else{if(_0x240716[_0x24d5('0xf1')]>=_0x268ab1[_0x24d5('0x109')]){_0xe9a4de['createStateFinal'](_0x240716,_0x3e0d09,_0x128199,_0x24d5('0xfe'));}else{_0xe9a4de[_0x24d5('0xc4')]({'active':![],'countmachineretry':_0x240716[_0x24d5('0xf1')],'scheduledat':moment()[_0x24d5('0xff')](_0x268ab1[_0x24d5('0x100')],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x240716['ContactId'],'ListId':_0x240716[_0x24d5('0xd7')],'VoiceQueueId':_0x240716[_0x24d5('0xd9')]||undefined,'CampaignId':_0x240716[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch('[rescheduleContact][Machine]'));_0x3e0d09({'reschedule':0x1});}}});}}};Dialer[_0x24d5('0x19')][_0x24d5('0x35')]=function(_0xfbaf91){var _0x1cbfdb=this[_0x24d5('0x24')][_0xfbaf91[_0x24d5('0xe9')]];var _0x45abcd=this;var _0x19eb31;if(_0x1cbfdb&&_0x1cbfdb[_0x24d5('0x4f')]===_0x24d5('0x7c')){delete this[_0x24d5('0x24')][_0xfbaf91[_0x24d5('0xe9')]];this[_0x24d5('0xb8')](this['campaigns'][_0x1cbfdb[_0x24d5('0xb9')]]);this[_0x24d5('0x1d')][_0x1cbfdb[_0x24d5('0xb9')]]['ivrAnswerCallsDay']+=0x1;_0x19eb31=new Hangup(_0x1cbfdb,_0xfbaf91);this['createHistory'](_0x19eb31)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x10a')));this['moveContactManagedDialer'](_0x19eb31)['catch'](loggerCatch(_0x24d5('0x10b')));}if(_0x1cbfdb&&_0x1cbfdb[_0x24d5('0x4f')]!==_0x24d5('0x7c')&&isNotNull(this['voiceQueues'][_0x1cbfdb['queue']][_0x24d5('0x10c')])){delete this[_0x24d5('0x24')][_0xfbaf91[_0x24d5('0xe9')]];this[_0x24d5('0xb8')](this['voiceQueues'][_0x1cbfdb[_0x24d5('0xb9')]]);this['voiceQueues'][_0x1cbfdb[_0x24d5('0xb9')]]['outboundAnswerCallsDay']+=0x1;this[_0x24d5('0x1c')][_0x1cbfdb[_0x24d5('0xb9')]][_0x24d5('0x5e')]+=0x1;_0x19eb31=new Hangup(_0x1cbfdb,_0xfbaf91);_0x19eb31['state']=0x10;_0x19eb31[_0x24d5('0xac')]=_0x24d5('0x10d');_0x19eb31[_0x24d5('0x105')]=_0x24d5('0x10e');this[_0x24d5('0xce')](_0x19eb31)[_0x24d5('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x24d5('0xcd')](_0x19eb31)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x10b')));}if(_0x1cbfdb&&_0x1cbfdb[_0x24d5('0x4f')]!=='ivr'&&!isNotNull(this[_0x24d5('0x1c')][_0x1cbfdb[_0x24d5('0xb9')]][_0x24d5('0x10c')])){delete this[_0x24d5('0x24')][_0xfbaf91[_0x24d5('0xe9')]];this[_0x24d5('0xb8')](this['voiceQueues'][_0x1cbfdb['queue']]);this[_0x24d5('0x1c')][_0x1cbfdb[_0x24d5('0xb9')]]['outboundUnknownCallsDay']+=0x1;_0x19eb31=new Hangup(_0x1cbfdb,_0xfbaf91);_0x19eb31['state']=0xc;_0x19eb31[_0x24d5('0xac')]=_0xfbaf91['cause-txt'];_0x19eb31['membername']=_0x24d5('0x10f');this[_0x24d5('0xce')](_0x19eb31)[_0x24d5('0xb6')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x24d5('0xcd')](_0x19eb31)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x10b')));}};Dialer[_0x24d5('0x19')][_0x24d5('0x31')]=function(_0x46ac6c){var _0x9326f7=this[_0x24d5('0x24')][_0x46ac6c[_0x24d5('0xe9')]];var _0x35c6a9=this;if(this[_0x24d5('0x1c')][_0x46ac6c[_0x24d5('0xb9')]]){if(_0x9326f7&&_0x9326f7['type']!=='ivr'){delete this[_0x24d5('0x24')][_0x46ac6c[_0x24d5('0xe9')]];this[_0x24d5('0x1c')][_0x46ac6c[_0x24d5('0xb9')]][_0x24d5('0x5f')]+=0x1;var _0x1ce4d7=new AgentComplete(_0x9326f7,_0x46ac6c);if(_0x46ac6c[_0x24d5('0x110')]===_0x24d5('0x111')){_0x1ce4d7['agiafterat']=this[_0x24d5('0x1c')][_0x46ac6c[_0x24d5('0xb9')]][_0x24d5('0x112')]&&this['voiceQueues'][_0x46ac6c[_0x24d5('0xb9')]][_0x24d5('0x113')]?moment()[_0x24d5('0x79')](_0x24d5('0x102')):undefined;}this[_0x24d5('0xce')](_0x1ce4d7)['catch'](loggerCatch(_0x24d5('0x114')));this['moveContactManagedDialer'](_0x1ce4d7)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x115')));}}};Dialer[_0x24d5('0x19')][_0x24d5('0x2a')]=function(_0x2c0f75){if(this[_0x24d5('0x1c')][_0x2c0f75['queue']]){if(this['uniqueId'][_0x2c0f75[_0x24d5('0xe9')]]&&this[_0x24d5('0x24')][_0x2c0f75[_0x24d5('0xe9')]]['type']!==_0x24d5('0x7c')){this[_0x24d5('0xb8')](this[_0x24d5('0x1c')][_0x2c0f75[_0x24d5('0xb9')]]);this[_0x24d5('0x24')][_0x2c0f75['uniqueid']][_0x24d5('0x116')]=moment()[_0x24d5('0x79')](_0x24d5('0x102'));}}};Dialer[_0x24d5('0x19')]['queueCallerAbandonCreateState']=function(_0x30f54f){this[_0x24d5('0xce')](_0x30f54f)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x114')));this[_0x24d5('0xcd')](_0x30f54f)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x117')));};Dialer['prototype'][_0x24d5('0x2d')]=function(_0x2c7970){var _0x226bc4=this[_0x24d5('0x24')][_0x2c7970[_0x24d5('0xe9')]];var _0x28e163=this;if(this['voiceQueues'][_0x2c7970[_0x24d5('0xb9')]]){if(_0x226bc4&&_0x226bc4[_0x24d5('0x4f')]!==_0x24d5('0x7c')){delete this[_0x24d5('0x24')][_0x2c7970[_0x24d5('0xe9')]];this[_0x24d5('0xb8')](this[_0x24d5('0x1c')][_0x2c7970[_0x24d5('0xb9')]]);_0x226bc4[_0x24d5('0x118')]=moment()[_0x24d5('0x79')]('YYYY-MM-DD\x20HH:mm:ss');var _0xceff3e=new QueueCallerAbandon(_0x226bc4,_0x2c7970);if(getSeconds(_0x226bc4[_0x24d5('0x118')],_0x226bc4[_0x24d5('0x119')])>=_0x226bc4['dialQueueTimeout']){this[_0x24d5('0x1c')][_0x2c7970['queue']][_0x24d5('0x6e')]+=0x1;this['voiceQueues'][_0x2c7970[_0x24d5('0xb9')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x24d5('0x1c')][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x6f')]+=0x1;_0xceff3e[_0x24d5('0xab')]=0xa;_0xceff3e[_0x24d5('0xac')]=_0x24d5('0x11a');_0xceff3e[_0x24d5('0x11b')]=_0x24d5('0x11c');_0xceff3e['agiafterat']=this[_0x24d5('0x1c')][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x112')]?moment()[_0x24d5('0x79')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0xceff3e[_0x24d5('0xf8')]+=0x1;_0xceff3e[_0x24d5('0xf2')]+=0x1;if(_0xceff3e[_0x24d5('0xf8')]>=this['voiceQueues'][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x11d')]){this[_0x24d5('0x11e')](_0xceff3e);}else{this['rescheduleContact']({'active':![],'countdropretry':_0xceff3e[_0x24d5('0xf8')],'scheduledat':moment()['add'](this['voiceQueues'][_0x2c7970['queue']]['dialDropRetryFrequency'],'minutes')[_0x24d5('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x226bc4[_0x24d5('0xd6')],'ListId':_0x226bc4[_0x24d5('0xd7')],'VoiceQueueId':_0x226bc4['VoiceQueueId']||undefined,'CampaignId':_0x226bc4['CampaignId']||undefined})[_0x24d5('0xb6')](loggerCatch('[rescheduleContact][Drop]'));var _0x144a16=new History(_0xceff3e);_0x144a16['state']=0xa;_0x144a16[_0x24d5('0xac')]=_0x24d5('0x11a');_0x144a16[_0x24d5('0xae')]=moment()[_0x24d5('0x79')](_0x24d5('0x102'));_0x144a16['endtime']=_0x144a16[_0x24d5('0xae')];_0x144a16['calleridname']=_0xceff3e['calleridname'];_0x144a16['calleridnum']=_0xceff3e['calleridnum'];this['createHistory'](_0x144a16)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x11f')));}}else{this[_0x24d5('0x1c')][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x6d')]+=0x1;this[_0x24d5('0x1c')][_0x2c7970[_0x24d5('0xb9')]]['outboundDropCallsDayCallersExit']+=0x1;_0xceff3e[_0x24d5('0xab')]=0xb;_0xceff3e['statedesc']=_0x24d5('0x120');_0xceff3e[_0x24d5('0x11b')]=_0x24d5('0x121');_0xceff3e[_0x24d5('0x108')]+=0x1;_0xceff3e[_0x24d5('0xf2')]+=0x1;if(_0xceff3e[_0x24d5('0x108')]>=this['voiceQueues'][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x122')]){this['queueCallerAbandonCreateState'](_0xceff3e);}else{this[_0x24d5('0xc4')]({'active':![],'countabandonedretry':_0xceff3e[_0x24d5('0x108')],'scheduledat':moment()[_0x24d5('0xff')](this['voiceQueues'][_0x2c7970[_0x24d5('0xb9')]][_0x24d5('0x123')],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x226bc4[_0x24d5('0xd6')],'ListId':_0x226bc4[_0x24d5('0xd7')],'VoiceQueueId':_0x226bc4[_0x24d5('0xd9')]||undefined,'CampaignId':_0x226bc4[_0x24d5('0xda')]||undefined})['catch'](loggerCatch(_0x24d5('0x124')));var _0x144a16=new History(_0xceff3e);_0x144a16[_0x24d5('0xab')]=0xb;_0x144a16['statedesc']=_0x24d5('0x120');_0x144a16[_0x24d5('0xae')]=moment()['format'](_0x24d5('0x102'));_0x144a16[_0x24d5('0xad')]=_0x144a16[_0x24d5('0xae')];_0x144a16[_0x24d5('0x125')]=_0xceff3e[_0x24d5('0x125')];_0x144a16['calleridnum']=_0xceff3e[_0x24d5('0x126')];this[_0x24d5('0xce')](_0x144a16)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x127')));}}}}};Dialer[_0x24d5('0x19')][_0x24d5('0x37')]=function(_0x1eb529){if(this[_0x24d5('0x22')][_0x1eb529[_0x24d5('0xe9')]]){this[_0x24d5('0x22')][_0x1eb529[_0x24d5('0xe9')]][_0x24d5('0xb5')]=_0x1eb529[_0x24d5('0xb5')];}if(this[_0x24d5('0x24')][_0x1eb529[_0x24d5('0xe9')]]){this['uniqueId'][_0x1eb529['uniqueid']][_0x24d5('0xb5')]=_0x1eb529[_0x24d5('0xb5')];}};Dialer[_0x24d5('0x19')][_0x24d5('0x3b')]=function(_0x8fc55c){if(strategy[this[_0x24d5('0x1c')][this[_0x24d5('0x22')][_0x8fc55c['actionid']][_0x24d5('0xb9')]][_0x24d5('0x128')]]===_0x24d5('0x129')){if(this[_0x24d5('0x22')][_0x8fc55c['actionid']]&&_['isNil'](this[_0x24d5('0x22')][_0x8fc55c['actionid']][_0x24d5('0x12a')])&&_0x8fc55c[_0x24d5('0xdf')]==='1'&&_0x8fc55c[_0x24d5('0x12b')]==='0'){if(this['agents'][_0x8fc55c[_0x24d5('0x12c')]]){if(!this['agents'][_0x8fc55c['stateinterface']][_0x24d5('0x12a')]){this[_0x24d5('0x1e')][_0x8fc55c[_0x24d5('0x12c')]]['locked']=!![];this['actions'][_0x8fc55c[_0x24d5('0x12d')]][_0x24d5('0x12a')]=!![];this['actions'][_0x8fc55c[_0x24d5('0x12d')]][_0x24d5('0x12c')]=_0x8fc55c['stateinterface'];}}}}else if((strategy[this[_0x24d5('0x1c')][this['actions'][_0x8fc55c[_0x24d5('0x12d')]]['queue']][_0x24d5('0x128')]]||_0x24d5('0x12e'))==='rrmemory'){if(this[_0x24d5('0x22')][_0x8fc55c[_0x24d5('0x12d')]]){if(this[_0x24d5('0x1e')][_0x8fc55c['stateinterface']]){this['actions'][_0x8fc55c[_0x24d5('0x12d')]][_0x24d5('0x12c')]=_0x8fc55c['stateinterface'];if(_[_0x24d5('0xb3')](this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x8fc55c['actionid']]['queue']])){this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x8fc55c[_0x24d5('0x12d')]]['queue']]=[];}this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x8fc55c[_0x24d5('0x12d')]][_0x24d5('0xb9')]][_0x24d5('0x130')](_[_0x24d5('0x8e')](_[_0x24d5('0xd5')](this['actions'][_0x8fc55c[_0x24d5('0x12d')]],[_0x24d5('0x131'),_0x24d5('0x12c')]),{'status':_0x8fc55c['status'],'paused':_0x8fc55c['paused']}));}}}};function unlockQueueStatus(_0x30318f,_0x342ac7){setTimeout(function(){if(_[_0x24d5('0x3f')](_0x30318f[_0x24d5('0x132')])){loggerBooked[_0x24d5('0x98')](_0x24d5('0x133'),_0x342ac7);}_0x30318f['queueStatusComplete']=!![];loggerBooked[_0x24d5('0x80')](_0x24d5('0x134'),_0x342ac7,JSON[_0x24d5('0x4b')](_[_0x24d5('0xd5')](_0x30318f,[_0x24d5('0x41'),_0x24d5('0x132')])));},0x1f3);}Dialer[_0x24d5('0x19')][_0x24d5('0x135')]=function(_0x598a37){var _0x1dc975=this;var _0x10a85b=_0x1dc975[_0x24d5('0x1c')][_0x1dc975[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]]['queue']];if(strategy[this[_0x24d5('0x1c')][this['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]['strategy']]==='roundrobin'){if(this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]]&&this['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0x12c')]){this[_0x24d5('0x94')]['run'](this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]]['idHopper'],this['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0x12c')])[_0x24d5('0xb6')](function(_0xae697){logger[_0x24d5('0x98')](_0x24d5('0x136'),util[_0x24d5('0x9a')](_0xae697,{'showHidden':![],'depth':null}));})[_0x24d5('0x137')](function(){_0x1dc975[_0x24d5('0xb8')](_0x1dc975[_0x24d5('0x1c')][_0x1dc975[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]);_0x1dc975[_0x24d5('0x1e')][_0x1dc975['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0x12c')]][_0x24d5('0x12a')]=![];delete _0x1dc975[_0x24d5('0x22')][_0x598a37['actionid']];unlockQueueStatus(_0x10a85b);});}else{this[_0x24d5('0xb8')](this[_0x24d5('0x1c')][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]);this[_0x24d5('0xc4')]({'active':![],'ContactId':this[_0x24d5('0x22')][_0x598a37['actionid']][_0x24d5('0xd6')],'ListId':this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xd7')],'VoiceQueueId':this['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xd9')]||undefined,'CampaignId':this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]]['CampaignId']||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x138')));delete this['actions'][_0x598a37['actionid']];unlockQueueStatus(_0x10a85b);}}else if((strategy[this[_0x24d5('0x1c')][this[_0x24d5('0x22')][_0x598a37['actionid']]['queue']][_0x24d5('0x128')]]||_0x24d5('0x12e'))===_0x24d5('0x12e')){var _0x35c02c;if(this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]]&&!_[_0x24d5('0x47')](this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]])){if(this['queueBookedRR'][_0x1dc975['actions'][_0x598a37[_0x24d5('0x12d')]]['queue']]){this[_0x24d5('0x139')][_0x1dc975[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]=this[_0x24d5('0x139')][this['actions'][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]?this[_0x24d5('0x139')][this['actions'][_0x598a37['actionid']][_0x24d5('0xb9')]]:this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]?this['queueBooked'][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]]['_rr']||0x0:0x0;}this[_0x24d5('0x12f')][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]][_0x24d5('0x13a')]=this[_0x24d5('0x139')][this[_0x24d5('0x22')][_0x598a37[_0x24d5('0x12d')]][_0x24d5('0xb9')]];for(var _0x3b4c9f=0x0;_0x3b4c9f=0x0;})[_0x24d5('0xb6')](myreject(_0x5aa302)));}}else{_0x3a8303[_0x24d5('0x130')](ami[_0x24d5('0xb4')]({'action':_0x24d5('0x151'),'command':util[_0x24d5('0x79')](_0x24d5('0x152'),_0x5fdadd,!_[_0x24d5('0x3f')](config[_0x24d5('0x14e')][_0x242c6c])?_0x242c6c:'')})['then'](function(_0x5ca7e0){return _0x5ca7e0[_0x24d5('0x154')][_0x24d5('0x156')]('true')>=0x0;})[_0x24d5('0xb6')](myreject(_0x5aa302)));}BPromise[_0x24d5('0x157')](_0x3a8303)['then'](function(_0x32b33d){var _0x57a0a9=_[_0x24d5('0x158')](_0x32b33d);if(_0x57a0a9){return _0x1b1376(_0x57a0a9);}else{_0x11a178[_0x24d5('0x40')]=_0x556347?_0x24d5('0x159'):'INTERVAL_IS_OVERTIME';return _0x5aa302(msgResponse(_0x24d5('0x15a'),_0x24d5('0x14a'),_0x24d5('0x15b')+_0x556347+'\x20'+_0x38efd6+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x5fdadd,{'showHidden':![],'depth':null})+_0x24d5('0x15c')+_0x242c6c));}})[_0x24d5('0xb6')](function(_0x563b80){return _0x5aa302(msgResponse('ifTime',_0x24d5('0x14a'),JSON[_0x24d5('0x4b')](_0x563b80)));});});};Dialer['prototype'][_0x24d5('0x15d')]=function(_0x22dd76){var _0x3e05ed=this;return function(){switch(_0x22dd76[_0x24d5('0x5b')]){case _0x24d5('0x15e'):freeVariablesPredictive(_0x22dd76);_0x3e05ed[_0x24d5('0x15f')](_0x22dd76,0x1);break;case _0x24d5('0x160'):freeVariablesPredictive(_0x22dd76);_0x3e05ed[_0x24d5('0x15f')](_0x22dd76,_0x22dd76[_0x24d5('0x161')]);break;case'predictive':_0x3e05ed[_0x24d5('0x162')](_0x22dd76);break;case _0x24d5('0x8'):freeVariablesPredictive(_0x22dd76);_0x3e05ed[_0x24d5('0x15f')](_0x22dd76,0x1);break;default:freeVariablesPredictive(_0x22dd76);logger[_0x24d5('0x98')]('Queue',_0x22dd76[_0x24d5('0x41')],'method\x20not\x20recognized');}};};Dialer[_0x24d5('0x19')]['launchHandleIvr']=function(_0x318fe1){var _0x169409=this;return function(){_0x169409[_0x24d5('0x163')](_0x318fe1);};};Dialer[_0x24d5('0x19')][_0x24d5('0x33')]=function(_0x358a21){var _0x3bef42=this;if(isNotPreview(_0x358a21[_0x24d5('0x5b')])){if(isVoiceQueueOutbound(_0x358a21[_0x24d5('0x4f')])&&isActive(_0x358a21['dialActive'])){_0x358a21[_0x24d5('0xa5')]=!![];BPromise['resolve']()[_0x24d5('0xbb')](checkIsLoggedIn(_0x358a21,_0x358a21[_0x24d5('0x52')]))[_0x24d5('0xbb')](checkIsActive(_0x358a21,_0x358a21[_0x24d5('0x5a')]))[_0x24d5('0xbb')](checkInterval(_0x358a21))[_0x24d5('0xbb')](_0x3bef42[_0x24d5('0x146')](_0x358a21))[_0x24d5('0xbb')](_0x3bef42[_0x24d5('0x164')](_0x358a21[_0x24d5('0x165')],_0x358a21[_0x24d5('0x166')],_0x358a21[_0x24d5('0x41')],_0x358a21))['then'](_0x3bef42[_0x24d5('0x167')](_0x358a21['Interval'],_0x358a21[_0x24d5('0x166')],_0x358a21[_0x24d5('0x41')],_0x358a21))['then'](_0x3bef42[_0x24d5('0x15d')](_0x358a21))[_0x24d5('0xb6')](loggerCatchQueueSummary(_0x24d5('0x168'),_0x358a21));}else{notSendMessagesQueue(_0x358a21);}}else{freeVariablesPredictive(_0x358a21);}};Dialer[_0x24d5('0x19')][_0x24d5('0x145')]=function(){var _0x460e23=this;var _0x45b2a1;for(var _0x4b8e80 in this[_0x24d5('0x1d')]){if(typeof this['campaigns'][_0x4b8e80]!=='undefined'){_0x45b2a1=this['campaigns'][_0x4b8e80];if(isCampaignIvr(_0x45b2a1['type'])&&isActive(_0x45b2a1[_0x24d5('0xde')])){_0x45b2a1['sendMessageOneNotActive']=!![];BPromise[_0x24d5('0xbd')]()[_0x24d5('0xbb')](checkIsActive(_0x45b2a1,_0x45b2a1['active']))['then'](checkInterval(_0x45b2a1))[_0x24d5('0xbb')](_0x460e23['checkIsTrunkReachable'](_0x45b2a1))[_0x24d5('0xbb')](_0x460e23[_0x24d5('0x164')](_0x45b2a1[_0x24d5('0x165')],_0x45b2a1[_0x24d5('0x166')],_0x45b2a1[_0x24d5('0x41')],_0x45b2a1))[_0x24d5('0xbb')](_0x460e23[_0x24d5('0x167')](_0x45b2a1[_0x24d5('0x46')],_0x45b2a1['dialTimezone'],_0x45b2a1['name'],_0x45b2a1))['then'](_0x460e23[_0x24d5('0x169')](_0x45b2a1))[_0x24d5('0xb6')](loggerCatchQueueSummary(_0x24d5('0x16a'),_0x45b2a1));}else{notSendMessagesCampaign(_0x45b2a1);}}}};function getCallerIdRandom(_0x508870,_0x598dd2){var _0x10a326;var _0x30f892;var _0x2ebee2;if(_0x598dd2<=0x0){_0x598dd2=0x1;}_0x10a326=new RegExp(_0x24d5('0x16b')+_0x598dd2+'}$');_0x30f892=Math[_0x24d5('0x16c')](0xa,_0x598dd2-0x1);_0x2ebee2=Math['pow'](0xa,_0x598dd2)-0x1;return util['format']('%s',_[_0x24d5('0x16d')](_0x508870,_0x10a326,_[_0x24d5('0x16e')](_0x30f892,_0x2ebee2)));}function extractCalleridName(_0x387d86){var _0x4ed0b6=_0x387d86[_0x24d5('0x16f')](/"(.*?)"/);return _0x4ed0b6?_0x4ed0b6[0x1]:_0x387d86;}function extractCalleridNumber(_0x25a04c){var _0x1cc7a9=_0x25a04c[_0x24d5('0x16f')](/<(.*?)>/);return _0x1cc7a9?_0x1cc7a9[0x1]:_0x25a04c;}Dialer[_0x24d5('0x19')][_0x24d5('0x170')]=function(_0x323eff,_0x32cbc2){var _0x46bdd7=this;var _0x186153=uuid['v4']();this[_0x24d5('0x22')][_0x186153]=new Action(_0x323eff,_0x32cbc2,_0x186153);return new BPromise(function(_0x2098f9,_0x108506){if(_[_0x24d5('0x3f')](_0x323eff)&&typeof _0x323eff!==_0x24d5('0x171')){return _0x108506(msgResponse(_0x24d5('0x172'),_0x24d5('0x14a'),_0x24d5('0x173')));}if(_[_0x24d5('0x3f')](_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')])||_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')]===null){return _0x108506(msgResponse(_0x24d5('0x172'),'Failure',_0x24d5('0x176')));}var _0x37aa59={'XMD-CALLERID':_0x46bdd7['actions'][_0x186153][_0x24d5('0x177')](),'XMD-AGI':_0x323eff[_0x24d5('0x10c')]?util[_0x24d5('0x79')](_0x24d5('0x178'),ipAgi,_0x323eff[_0x24d5('0x10c')]):_0x24d5('0x179'),'XMD-AGIAFTER':_0x323eff[_0x24d5('0x112')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x323eff['dialQueueProject2']):'NONE','XMD-QUEUE':_0x323eff[_0x24d5('0x4f')]===_0x24d5('0x93')?util[_0x24d5('0x79')]('\x22%s,%s%s,,,%s\x22',_0x323eff[_0x24d5('0x41')],_0x323eff[_0x24d5('0x17a')]||'',_0x323eff[_0x24d5('0x113')]?'c':'',_0x323eff[_0x24d5('0x17b')]||0x3):_0x24d5('0x179'),'XMD-CONTACTID':_0x32cbc2[_0x24d5('0xd6')],'XMD-CDRTYPE':_0x24d5('0x17c'),'CALLERID(all)':_0x46bdd7[_0x24d5('0x22')][_0x186153][_0x24d5('0x177')](),'XMD-AMD':_0x323eff[_0x24d5('0xe7')]?_0x24d5('0x17d'):_0x24d5('0x179'),'XMD-DESTINATION':_0x24d5('0xe6')};if(_0x323eff[_0x24d5('0xe7')]){_0x37aa59[_0x24d5('0x17e')]=_0x323eff['dialAMDInitialSilence']||0x9c4;_0x37aa59[_0x24d5('0x17f')]=_0x323eff['dialAMDGreeting']||0x5dc;_0x37aa59[_0x24d5('0x180')]=_0x323eff[_0x24d5('0x181')]||0x320;_0x37aa59[_0x24d5('0x182')]=_0x323eff['dialAMDTotalAnalysisTime']||0x1388;_0x37aa59[_0x24d5('0x183')]=_0x323eff[_0x24d5('0x184')]||0x64;_0x37aa59[_0x24d5('0x185')]=_0x323eff['dialAMDBetweenWordsSilence']||0x32;_0x37aa59[_0x24d5('0x186')]=_0x323eff['dialAMDMaximumNumberOfWords']||0x3;_0x37aa59['XMD-AMDSILENCETHRESHOLD']=_0x323eff[_0x24d5('0x187')]||0x100;_0x37aa59['XMD-AMDMAXIMUMWORDLENGTH']=_0x323eff['dialAMDMaximumWordLength']||0x1388;}if(_0x323eff[_0x24d5('0x4f')]===_0x24d5('0x93')){_0x37aa59[_0x24d5('0x188')]=_0x32cbc2['VoiceQueueId'];}else{_0x37aa59[_0x24d5('0x189')]=_0x32cbc2[_0x24d5('0xda')];}for(var _0x31d91b in _0x32cbc2[_0x24d5('0x174')]){if(typeof _0x32cbc2[_0x24d5('0x174')][_0x31d91b]!==_0x24d5('0x9d')){if(isNotNull(_0x32cbc2[_0x24d5('0x174')][_0x31d91b])&&_0x31d91b!=='id'&&_0x31d91b!==_0x24d5('0x18a')&&_0x31d91b!=='createdAt'&&_0x31d91b!=='updatedAt'){_0x37aa59[util[_0x24d5('0x79')](_0x24d5('0x18b'),_0x24d5('0x18c'),_[_0x24d5('0x18d')](_0x31d91b))]=_0x32cbc2[_0x24d5('0x174')][_0x31d91b];}}}var _0x29c2c5=_0x46bdd7[_0x24d5('0xdd')](_0x323eff[_0x24d5('0x78')])?getCallerId(_0x323eff[_0x24d5('0x78')][_0x24d5('0x18e')],_0x323eff[_0x24d5('0x5c')],_0x323eff[_0x24d5('0x18f')]>0x0?getCallerIdRandom(_0x323eff[_0x24d5('0x190')],_0x323eff[_0x24d5('0x18f')]):_0x323eff[_0x24d5('0x190')]):getCallerId(_[_0x24d5('0xb3')](_0x323eff[_0x24d5('0x191')])?_0x323eff['Trunk']['callerid']:_0x323eff[_0x24d5('0x191')][_0x24d5('0x18e')],_0x323eff['dialOriginateCallerIdName'],_0x323eff[_0x24d5('0x18f')]>0x0?getCallerIdRandom(_0x323eff['dialOriginateCallerIdNumber'],_0x323eff[_0x24d5('0x18f')]):_0x323eff[_0x24d5('0x190')]);if(_0x29c2c5){_0x37aa59[_0x24d5('0x192')]=_0x46bdd7[_0x24d5('0x22')][_0x186153]['originatecalleridname']=extractCalleridName(_0x29c2c5);_0x37aa59[_0x24d5('0x193')]=_0x46bdd7[_0x24d5('0x22')][_0x186153][_0x24d5('0x194')]=extractCalleridNumber(_0x29c2c5);}return ami[_0x24d5('0xb4')]({'actionid':_0x186153,'action':_0x24d5('0x172'),'channel':_0x46bdd7['isTrunkReachable'](_0x323eff['Trunk'])?util['format']('SIP/%s/%s%s',_0x323eff[_0x24d5('0x78')][_0x24d5('0x41')],isNotNull(_0x323eff[_0x24d5('0x5d')])?_0x323eff[_0x24d5('0x5d')]['trim']()||'':'',_0x323eff[_0x24d5('0x195')]>0x0?_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')][_0x24d5('0x196')](_0x323eff[_0x24d5('0x195')]):_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')]):util[_0x24d5('0x79')](_0x24d5('0x197'),_[_0x24d5('0xb3')](_0x323eff[_0x24d5('0x191')])?_0x323eff[_0x24d5('0x78')][_0x24d5('0x41')]:_0x323eff['TrunkBackup'][_0x24d5('0x41')],isNotNull(_0x323eff[_0x24d5('0x5d')])?_0x323eff[_0x24d5('0x5d')][_0x24d5('0x198')]()||'':'',_0x323eff[_0x24d5('0x195')]>0x0?_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')][_0x24d5('0x196')](_0x323eff[_0x24d5('0x195')]):_0x32cbc2[_0x24d5('0x174')][_0x24d5('0x175')]),'callerid':_0x29c2c5,'Exten':_0x24d5('0xe6'),'Context':'from-sip','Priority':'1','variable':_0x37aa59,'timeout':(_0x323eff[_0x24d5('0x199')]||0x1e)*0x3e8,'async':!![],'channelid':_0x186153})[_0x24d5('0xbb')](function(_0x380680){return _0x2098f9(_0x380680);})[_0x24d5('0xb6')](function(_0x7c052f){_0x323eff[_0x24d5('0x66')]+=0x1;var _0x51c5be=new History(_0x46bdd7[_0x24d5('0x22')][_0x186153]);logger[_0x24d5('0x98')](util['format'](_0x24d5('0x19a'),JSON['stringify'](_0x7c052f)));_0x51c5be[_0x24d5('0xab')]=0xe;_0x51c5be[_0x24d5('0xac')]=_0x24d5('0x19b');_0x51c5be[_0x24d5('0xae')]=moment()[_0x24d5('0x79')]('YYYY-MM-DD\x20HH:mm:ss');_0x51c5be[_0x24d5('0xad')]=_0x51c5be['starttime'];_0x46bdd7[_0x24d5('0xce')](_0x51c5be)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x19c')));_0x46bdd7[_0x24d5('0xcd')](_0x51c5be)['catch'](loggerCatch(_0x24d5('0x19c')))[_0x24d5('0x137')](function(){delete _0x46bdd7[_0x24d5('0x22')][_0x186153];return _0x108506(msgResponse('originate',_0x24d5('0x4a'),_0x24d5('0x19d')));});});});};Dialer[_0x24d5('0x19')]['syncOriginateResponse']=function(_0x2d1bdf){var _0x42e819=this[_0x24d5('0x22')][_0x2d1bdf['actionid']];if(_0x42e819){delete this['actions'][_0x2d1bdf['actionid']];_0x42e819['responsetime']=moment()['format'](_0x24d5('0x102'));var _0x58e728=_0x42e819[_0x24d5('0x4f')]===_0x24d5('0x7c')?this[_0x24d5('0x1d')][_0x42e819[_0x24d5('0xb9')]]:this['voiceQueues'][_0x42e819[_0x24d5('0x19e')]()];if(!this[_0x24d5('0xdc')](_0x2d1bdf['response'])){this[_0x24d5('0xb8')](_0x58e728);return this['callProgressDetecting'](_0x42e819,_0x58e728,_0x2d1bdf)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x24d5('0x24')][_0x2d1bdf[_0x24d5('0xe9')]]=_0x42e819;}};Dialer[_0x24d5('0x19')][_0x24d5('0x19f')]=function(_0x17c061,_0x2d5779,_0x431e96){var _0x50163e=new History(_0x2d5779);if(_0x50163e[_0x24d5('0xf4')]+_0x50163e[_0x24d5('0xf5')]+_0x50163e[_0x24d5('0xf6')]+_0x50163e[_0x24d5('0xf7')]+_0x50163e['countdropretry']+_0x50163e[_0x24d5('0x108')]+_0x50163e[_0x24d5('0xf1')]+_0x50163e['countagentrejectretry']>=_0x431e96['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x17c061){case 0x3:if(_0x50163e[_0x24d5('0xf6')]>=_0x431e96['dialNoAnswerMaxRetry']-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countnoanswerretry':_0x50163e[_0x24d5('0xf6')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96[_0x24d5('0x1a0')],_0x24d5('0x101'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e['ListId'],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1a1')));break;case 0x5:if(_0x50163e[_0x24d5('0xf4')]>=_0x431e96[_0x24d5('0x1a2')]-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countbusyretry':_0x50163e[_0x24d5('0xf4')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96['dialBusyRetryFrequency'],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e[_0x24d5('0xd7')],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e['CampaignId']||undefined})[_0x24d5('0xb6')](loggerCatch('[rescheduleContact]\x20[Busy]'));break;case 0x8:if(_0x50163e[_0x24d5('0xf5')]>=_0x431e96['dialCongestionMaxRetry']-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countcongestionretry':_0x50163e[_0x24d5('0xf5')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96[_0x24d5('0x1a3')],_0x24d5('0x101'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e[_0x24d5('0xd7')],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e['CampaignId']||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1a4')));break;case 0x0:if(_0x50163e['countnosuchnumberretry']>=_0x431e96[_0x24d5('0x1a5')]-0x1){return!![];}else{this[_0x24d5('0xc4')]({'active':![],'countnosuchnumberretry':_0x50163e[_0x24d5('0xf7')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96[_0x24d5('0x1a6')],'minutes')['format'](_0x24d5('0x102')),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e['ListId'],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})['catch'](loggerCatch(_0x24d5('0x1a7')));}break;case 0xa:if(_0x50163e[_0x24d5('0xf8')]>=_0x431e96['dialDropMaxRetry']-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countdropretry':_0x50163e[_0x24d5('0xf8')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96[_0x24d5('0x1a8')],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e['ListId'],'VoiceQueueId':_0x50163e['VoiceQueueId']||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1a9')));break;case 0xb:if(_0x50163e[_0x24d5('0x108')]>=_0x431e96[_0x24d5('0x122')]-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countabandonedretry':_0x50163e[_0x24d5('0x108')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96['dialAbandonedRetryFrequency'],'minutes')[_0x24d5('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e[_0x24d5('0xd7')],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x124')));break;case 0x13:if(_0x50163e[_0x24d5('0xf1')]>=_0x431e96[_0x24d5('0x109')]-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countmachineretry':_0x50163e[_0x24d5('0xf1')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96['dialMachineRetryFrequency'],_0x24d5('0x101'))[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x50163e['ContactId'],'ListId':_0x50163e[_0x24d5('0xd7')],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x103')));break;case 0x14:if(_0x50163e[_0x24d5('0xf9')]>=_0x431e96['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x24d5('0xc4')]({'active':![],'countagentrejectretry':_0x50163e[_0x24d5('0xf9')]+=0x1,'scheduledat':moment()[_0x24d5('0xff')](_0x431e96[_0x24d5('0x1aa')],'minutes')[_0x24d5('0x79')](_0x24d5('0x102')),'ContactId':_0x50163e[_0x24d5('0xd6')],'ListId':_0x50163e['ListId'],'VoiceQueueId':_0x50163e[_0x24d5('0xd9')]||undefined,'CampaignId':_0x50163e[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1ab')));break;default:return!![];}};Dialer[_0x24d5('0x19')][_0x24d5('0x1ac')]=function(_0x26d144,_0xd31dd9,_0x16d70b){var _0x307d71=this;var _0x518031=new History(_0x26d144);return new BPromise(function(_0x533d2f,_0x1ba764){if(_[_0x24d5('0x3f')](_0xd31dd9)&&typeof _0xd31dd9!==_0x24d5('0x171')){return _0x1ba764(msgResponse(_0x24d5('0x1ad'),_0x24d5('0x14a'),_0x24d5('0x1ae')));}if(_['isUndefined'](_0x16d70b)&&typeof _0x16d70b!==_0x24d5('0x171')){return _0x1ba764(msgResponse(_0x24d5('0x1ad'),_0x24d5('0x14a'),_0x24d5('0x1af')));}switch(_0x16d70b[_0x24d5('0x110')]){case'0':_0xd31dd9['outboundNoSuchCallsDay']+=0x1;_0x518031[_0x24d5('0xab')]=0x0;_0x518031['statedesc']=_0x24d5('0x1b0');_0x518031[_0x24d5('0xf7')]+=0x1;_0x518031[_0x24d5('0xf2')]+=0x1;ami['emit'](_0x24d5('0x1b1'),ut['buildObj'](_0x26d144,_0x24d5('0x1b2')));_0x307d71['createHistory'](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xf3')));if(_0x307d71[_0x24d5('0x19f')](0x0,_0x26d144,_0xd31dd9)){if(_0x518031[_0x24d5('0xf7')]>=_0xd31dd9[_0x24d5('0x1a5')]){_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1b3'));}else{_0x307d71[_0x24d5('0xfb')](_0x518031,_0x533d2f,_0x1ba764,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0xd31dd9[_0x24d5('0x64')]+=0x1;_0x518031['state']=0x3;_0x518031[_0x24d5('0xac')]=_0x24d5('0x1b4');_0x518031[_0x24d5('0xf6')]+=0x1;_0x518031['countglobal']+=0x1;ami['emit'](_0x24d5('0x1b5'),ut[_0x24d5('0xeb')](_0x26d144,_0x24d5('0x1b6')));_0x307d71[_0x24d5('0xce')](_0x518031)['catch'](loggerCatch(_0x24d5('0x1b7')));if(_0x307d71[_0x24d5('0x19f')](0x3,_0x26d144,_0xd31dd9)){if(_0x518031['countnoanswerretry']>=_0xd31dd9[_0x24d5('0x1b8')]){_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1b9'));}else{_0x307d71[_0x24d5('0xfb')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1b9'));}}break;case'5':_0xd31dd9[_0x24d5('0x61')]+=0x1;_0x518031[_0x24d5('0xab')]=0x5;_0x518031['statedesc']='Busy';_0x518031['countbusyretry']+=0x1;_0x518031[_0x24d5('0xf2')]+=0x1;ami[_0x24d5('0x4e')](_0x24d5('0x1ba'),ut[_0x24d5('0xeb')](_0x26d144,_0x24d5('0x1bb')));_0x307d71['createHistory'](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1bc')));if(_0x307d71[_0x24d5('0x19f')](0x5,_0x26d144,_0xd31dd9)){if(_0x518031[_0x24d5('0xf4')]>=_0xd31dd9[_0x24d5('0x1a2')]){_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,'reason\x205\x20busy');}else{_0x307d71['stateGlobal'](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1bd'));}}break;case'8':_0xd31dd9['outboundCongestionCallsDay']+=0x1;_0x518031[_0x24d5('0xab')]=0x8;_0x518031[_0x24d5('0xac')]=_0x24d5('0x1be');_0x518031['countcongestionretry']+=0x1;_0x518031['countglobal']+=0x1;ami['emit'](_0x24d5('0x1bf'),ut[_0x24d5('0xeb')](_0x26d144,'congestion'));_0x307d71[_0x24d5('0xce')](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1c0')));if(_0x307d71[_0x24d5('0x19f')](0x8,_0x26d144,_0xd31dd9)){if(_0x518031[_0x24d5('0xf5')]>=_0xd31dd9[_0x24d5('0x1c1')]){_0x307d71['createStateFinal'](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c2'));}else{_0x307d71['stateGlobal'](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c2'));}}break;case'11':_0xd31dd9[_0x24d5('0x1c3')]+=0x1;_0x518031['state']=0xb;_0x518031[_0x24d5('0xac')]='Abandoned';_0x518031[_0x24d5('0x108')]+=0x1;_0x518031[_0x24d5('0xf2')]+=0x1;_0x307d71[_0x24d5('0xce')](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x127')));if(_0x307d71[_0x24d5('0x19f')](0xb,_0x26d144,_0xd31dd9)){if(_0x518031[_0x24d5('0x108')]>=_0xd31dd9[_0x24d5('0x122')]){_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c4'));}else{_0x307d71[_0x24d5('0xfb')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c4'));}}break;case'20':_0xd31dd9[_0x24d5('0x68')]+=0x1;_0x518031['state']=0x14;_0x518031[_0x24d5('0xac')]='AgentReject';_0x518031[_0x24d5('0xf9')]+=0x1;_0x518031[_0x24d5('0xf2')]+=0x1;ami[_0x24d5('0x4e')](_0x24d5('0x1c5'),ut[_0x24d5('0xeb')](_0x26d144,_0x24d5('0x1c6')));_0x307d71['createHistory'](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1c7')));if(_0x307d71[_0x24d5('0x19f')](0x14,_0x26d144,_0xd31dd9)){if(_0x518031[_0x24d5('0xf9')]>=_0xd31dd9[_0x24d5('0x1c8')]){_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c9'));}else{_0x307d71[_0x24d5('0xfb')](_0x518031,_0x533d2f,_0x1ba764,_0x24d5('0x1c9'));}}break;default:_0xd31dd9[_0x24d5('0x69')]+=0x1;_0x518031[_0x24d5('0xab')]=0xc;_0x518031[_0x24d5('0xac')]=_0x16d70b[_0x24d5('0x110')];_0x307d71[_0x24d5('0xce')](_0x518031)[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1ca')));if(_0x307d71[_0x24d5('0x19f')](_0x16d70b[_0x24d5('0x110')],_0x26d144,_0xd31dd9)){if(_0x518031['countbusyretry']+_0x518031[_0x24d5('0xf5')]+_0x518031[_0x24d5('0xf6')]+_0x518031[_0x24d5('0xf7')]+_0x518031[_0x24d5('0xf8')]+_0x518031[_0x24d5('0x108')]+_0x518031[_0x24d5('0xf1')]+_0x518031[_0x24d5('0xf9')]>=_0xd31dd9[_0x24d5('0xfa')]){_0x307d71['stateGlobal'](_0x518031,_0x533d2f,_0x1ba764,_0x16d70b['reason']);}else{_0x307d71[_0x24d5('0xfd')](_0x518031,_0x533d2f,_0x1ba764,_0x16d70b[_0x24d5('0x110')]);}}}});};Dialer[_0x24d5('0x19')]['stateGlobal']=function(_0x35b48d,_0x4f9e3d,_0x2b19b2,_0x1daed6){var _0x30ecc4=new Final(_0x35b48d);_0x30ecc4[_0x24d5('0xab')]=0xf;_0x30ecc4[_0x24d5('0xac')]=_0x24d5('0x1cb');this[_0x24d5('0xfd')](_0x30ecc4,_0x4f9e3d,_0x2b19b2,_0x1daed6);};Dialer[_0x24d5('0x19')][_0x24d5('0xfd')]=function(_0xba3614,_0xe13e38,_0x189757,_0x2b924d){this['moveContactManagedDialer'](_0xba3614)[_0x24d5('0xbb')](function(){return _0xe13e38(msgResponse(_0x24d5('0x1ad'),'Success',_0x2b924d));})[_0x24d5('0xb6')](function(){return _0x189757(msgResponse('[moveContactManagedDialer][0]',_0x24d5('0x14a'),'contact\x20not\x20moved'));});};Dialer[_0x24d5('0x19')][_0x24d5('0x162')]=function(_0x179614){var _0x14108a=_0x179614['dialPredictiveOptimizationPercentage']/0x64;var _0x1ece57=_0x179614[_0x24d5('0x1cc')]/(_0x179614['outboundDropCallsDayTimeout']+_0x179614['outboundAnswerCallsDay']);var _0x53728c=Math['round'](_0x179614[_0x24d5('0x73')]*(_0x179614['predictiveIntervalMaxThreshold']/0x64));var _0x1415b8=Math[_0x24d5('0x1cd')](_0x179614[_0x24d5('0x73')]*(_0x179614[_0x24d5('0x1ce')]/0x64));var _0x2e6481=_0x179614[_0x24d5('0x51')]+_0x179614[_0x24d5('0x56')];var _0x41d76e=Math['floor'](_0x179614['erlangCalls']*_0x179614[_0x24d5('0x76')]*_0x179614[_0x24d5('0x70')]*_0x179614[_0x24d5('0x71')]);if(_[_0x24d5('0x3f')](_0x179614[_0x24d5('0x27')])){if(!_[_0x24d5('0x3f')](_0x179614[_0x24d5('0x26')])){_0x179614[_0x24d5('0x26')]=undefined;loggerPredictive['error'](_0x24d5('0x1cf'),_0x24d5('0x1d0'));}if(!_[_0x24d5('0x3f')](_0x179614[_0x24d5('0x91')])){loggerPredictive[_0x24d5('0x98')](_0x24d5('0x1cf'),_0x24d5('0x1d1'));clearInterval(_0x179614[_0x24d5('0x91')]);_0x179614[_0x24d5('0x91')]=undefined;}_0x179614['startProgressive']=moment()[_0x24d5('0x79')](_0x24d5('0x102'));loggerPredictive[_0x24d5('0x80')](_0x179614[_0x24d5('0x41')],_0x24d5('0x1d2'),_0x179614[_0x24d5('0x27')]);this[_0x24d5('0x15f')](_0x179614,0x1);}else if(ifInterval(_0x179614[_0x24d5('0x1d3')],_0x179614['startProgressive'])){this[_0x24d5('0x15f')](_0x179614,0x1);loggerPredictiveCalls[_0x24d5('0x80')](_0x24d5('0x1d4'),_0x179614[_0x24d5('0x27')],_0x179614['name']);_0x179614[_0x24d5('0x74')]=0x0;_0x179614['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x14108a<_0x1ece57&&_0x179614[_0x24d5('0x1d5')]===_0x24d5('0x1d6')){freeVariablesPredictive(_0x179614);loggerPredictive[_0x24d5('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0x24d5('0x1d7'),_0x1ece57,_0x24d5('0x27'),_0x179614[_0x24d5('0x41')]);}else if(_0x41d76e<_0x179614[_0x24d5('0x6f')]&&_0x179614[_0x24d5('0x1d5')]===_0x24d5('0x1d6')){freeVariablesPredictive(_0x179614);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x1d8'),_0x24d5('0x1d9'),_0x41d76e,_0x24d5('0x1da'),_0x179614['predictiveIntervalErlangCallsDroppedCalls'],_0x24d5('0x27'),_0x179614[_0x24d5('0x41')]);}else if(!ifInterval(_0x179614[_0x24d5('0x1d3')],_0x179614['startProgressive'])&&_[_0x24d5('0x3f')](_0x179614[_0x24d5('0x26')])&&!_[_0x24d5('0x3f')](_0x179614[_0x24d5('0x27')])){_0x179614[_0x24d5('0x26')]=moment()[_0x24d5('0x79')](_0x24d5('0x102'));loggerPredictive[_0x24d5('0x80')](_0x179614['name'],_0x24d5('0x1db'),_0x179614['startPredictive']);this['averageHandleTime'](_0x179614[_0x24d5('0x1d3')])['then'](this[_0x24d5('0x1dc')](_0x179614))[_0x24d5('0xbb')](mergeDataErlangB(_0x179614))[_0x24d5('0xbb')](this[_0x24d5('0x1dd')](_0x179614))[_0x24d5('0xb6')](loggerCatchPredictive(_0x24d5('0x1de'),_0x179614));}else if(!ifInterval(_0x179614[_0x24d5('0x1d3')],_0x179614['startPredictive'])){_0x179614[_0x24d5('0x6f')]=0x0;_0x179614['startPredictive']=moment()[_0x24d5('0x79')](_0x24d5('0x102'));loggerPredictive[_0x24d5('0x80')](_0x179614['name'],_0x24d5('0x1df'),_0x179614[_0x24d5('0x26')]);clearInterval(_0x179614[_0x24d5('0x91')]);_0x179614[_0x24d5('0x91')]=undefined;this[_0x24d5('0xc1')](_0x179614[_0x24d5('0x1d3')])['then'](this[_0x24d5('0x1dc')](_0x179614))[_0x24d5('0xbb')](mergeDataErlangB(_0x179614))[_0x24d5('0xbb')](this['startMethodPredictive'](_0x179614))[_0x24d5('0xb6')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x179614));}else if(_0x179614['predictiveIntervalAvailable']&&_0x2e6481<_0x179614[_0x24d5('0x73')]-_0x1415b8){freeVariablesPredictive(_0x179614);loggerPredictive[_0x24d5('0x80')](_0x179614['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x2e6481,_0x24d5('0x1e0'),_0x179614[_0x24d5('0x73')],'-',_0x1415b8,'=',_0x179614[_0x24d5('0x73')]-_0x1415b8,')');}else if(_0x179614['predictiveIntervalAvailable']&&_0x2e6481>_0x179614[_0x24d5('0x73')]+_0x53728c){freeVariablesPredictive(_0x179614);loggerPredictive['info'](_0x179614[_0x24d5('0x41')],_0x24d5('0x1e1'),_0x2e6481,_0x24d5('0x1e2'),_0x179614[_0x24d5('0x73')],'+',_0x53728c,'=',_0x179614['predictiveIntervalAvailable']+_0x53728c,')');}};Dialer['prototype'][_0x24d5('0x1dc')]=function(_0x5d4249){var _0x385a39=this;return function(_0x56dcf3){return new BPromise(function(_0xa111c8,_0x4a0de6){_['merge'](_0x5d4249,_0x56dcf3[0x0]);if(checkGetDataPredictive(_0x56dcf3[0x0])){var _0x239b1a=_0x5d4249[_0x24d5('0x73')]=_0x5d4249['talking']+_0x5d4249[_0x24d5('0x51')];var _0x4ccac7=_0x5d4249[_0x24d5('0x1d3')]*0x3c;var _0x1f5da8=_0x56dcf3[0x0][_0x24d5('0x6c')]+_0x56dcf3[0x0][_0x24d5('0x6b')];var _0x5b7d1d=(_0x56dcf3[0x0][_0x24d5('0x6a')]+_0x56dcf3[0x0][_0x24d5('0x6e')]+_0x56dcf3[0x0][_0x24d5('0x6d')])/_0x56dcf3[0x0][_0x24d5('0x86')];_0x5d4249[_0x24d5('0x70')]=_0x5b7d1d>0x0?_0x5b7d1d:0x1;switch(_0x5d4249[_0x24d5('0x1d5')]){case'dropRate':var _0x1046d5=_0x5d4249[_0x24d5('0x1e3')]/0x64;return _0x385a39[_0x24d5('0x1e4')](_0x239b1a,_0x4ccac7,_0x1f5da8,_0x5b7d1d,_0x1046d5)['then'](function(_0xc576b5){return _0xa111c8(_0xc576b5);});case'agentBusyFactor':var _0x16e93d=_0x5d4249['dialPredictiveOptimizationPercentage']/0x64;return _0x385a39[_0x24d5('0x1e5')](_0x239b1a,_0x4ccac7,_0x1f5da8,_0x5b7d1d,_0x16e93d)[_0x24d5('0xbb')](function(_0x4d3ee4){return _0xa111c8(_0x4d3ee4);});default:return _0x4a0de6(msgResponse(_0x24d5('0x1e6'),_0x24d5('0x14a'),'Unknown\x20Predictive'));}}else{return _0x4a0de6(msgResponse(_0x24d5('0x1e6'),_0x24d5('0x14a'),_0x24d5('0x1e7')));}});};};Dialer[_0x24d5('0x19')]['getDataPredictiveOld']=function(_0x44557a){var _0x627d7f=this;return function(_0x1a6809){return new BPromise(function(_0x4e7958,_0x2d3634){_[_0x24d5('0x8e')](_0x44557a,_0x1a6809[0x0]);if(checkGetDataPredictive(_0x1a6809[0x0])){loggerPredictive[_0x24d5('0x80')](JSON[_0x24d5('0x4b')](_0x1a6809[0x0]));if(_0x44557a[_0x24d5('0x1d5')]===_0x24d5('0x1d6')){return _0x627d7f[_0x24d5('0xcb')](_0x44557a['id'])[_0x24d5('0xbb')](function(_0x3af019){var _0x2387f8=_0x44557a[_0x24d5('0x52')]-_0x3af019[0x0][_0x24d5('0x1e8')];var _0x2c8719=_0x44557a[_0x24d5('0x1d3')]*0x3c;var _0x3cbf9b=_0x1a6809[0x0][_0x24d5('0x6c')]+_0x1a6809[0x0][_0x24d5('0x6b')];var _0x233028=(_0x1a6809[0x0][_0x24d5('0x6a')]+_0x1a6809[0x0][_0x24d5('0x6e')]+_0x1a6809[0x0][_0x24d5('0x6d')])/_0x1a6809[0x0][_0x24d5('0x86')];var _0x300e42=_0x44557a[_0x24d5('0x1e3')]/0x64;_0x44557a[_0x24d5('0x72')]=_0x3af019[0x0][_0x24d5('0x1e8')]||0x0;_0x44557a[_0x24d5('0x70')]=_0x233028>0x0?_0x233028:0x1;return _0x627d7f[_0x24d5('0x1e4')](_0x2387f8,_0x2c8719,_0x3cbf9b,_0x233028,_0x300e42);})['then'](function(_0x40281f){return _0x4e7958(_0x40281f);})['catch'](function(_0x15cbac){return _0x2d3634(msgResponse(_0x24d5('0x1e9'),'Failure',JSON[_0x24d5('0x4b')](_0x15cbac)));});}if(_0x44557a[_0x24d5('0x1d5')]==='agentBusyFactor'){return _0x627d7f[_0x24d5('0xcb')](_0x44557a['id'])['then'](function(_0xf3b8fa){var _0x44d178=_0x44557a[_0x24d5('0x52')]-_0xf3b8fa[0x0]['outboundQueuePauses'];var _0x4bfdb2=_0x44557a[_0x24d5('0x1d3')]*0x3c;var _0x3318ce=_0x1a6809[0x0]['predictiveIntervalAvgTalktime']+_0x1a6809[0x0][_0x24d5('0x6b')];var _0x48019d=(_0x1a6809[0x0]['predictiveIntervalAnsweredCalls']+_0x1a6809[0x0][_0x24d5('0x6e')]+_0x1a6809[0x0][_0x24d5('0x6d')])/_0x1a6809[0x0]['predictiveIntervalTotalCalls'];var _0x2fc387=_0x44557a[_0x24d5('0x1e3')]/0x64;_0x44557a[_0x24d5('0x72')]=_0xf3b8fa[0x0][_0x24d5('0x1e8')]||0x0;_0x44557a[_0x24d5('0x70')]=_0x48019d>0x0?_0x48019d:0x1;return _0x627d7f[_0x24d5('0x1e5')](_0x44d178,_0x4bfdb2,_0x3318ce,_0x48019d,_0x2fc387);})[_0x24d5('0xbb')](function(_0x285bfc){return _0x4e7958(_0x285bfc);})[_0x24d5('0xb6')](function(_0x1cc219){return _0x2d3634(msgResponse('[CatchErlangB]','Failure',JSON[_0x24d5('0x4b')](_0x1cc219)));});}}else{return _0x2d3634(msgResponse(_0x24d5('0x1e6'),_0x24d5('0x14a'),'check\x20failure'));}});};};Dialer['prototype'][_0x24d5('0x1dd')]=function(_0x2e5c26){var _0x1cdc80=this;return function(){var _0x2e00ff=0x0;var _0x4699c4=Math[_0x24d5('0x1ea')](_0x2e5c26[_0x24d5('0x75')]*0x3e8);if(_0x4699c4>0x0){_0x4699c4=_0x4699c4<0x64?0x64:_0x4699c4;loggerPredictive[_0x24d5('0x80')](_0x2e5c26['name'],_0x24d5('0x1eb'),_0x4699c4,_0x24d5('0x4c'));_0x2e5c26[_0x24d5('0x91')]=setInterval(function(){_0x1cdc80[_0x24d5('0x91')](_0x2e5c26);loggerPredictiveCalls[_0x24d5('0x80')](_0x24d5('0x1ec'),_0x2e00ff+=0x1);},_0x4699c4);}else{loggerPredictive['info'](_0x2e5c26[_0x24d5('0x41')],_0x24d5('0x1ed'));}};};Dialer[_0x24d5('0x19')][_0x24d5('0x1ee')]=function(_0x3d98b4,_0x4905ba){var _0x4cb217=this;return function(_0x37d99d){if(_['isEmpty'](_0x37d99d)){if(_['isNil'](_0x4905ba['UserId'])||!_0x4905ba[_0x24d5('0x1ef')]){if(_0x3d98b4['dialMethod']===_0x24d5('0x8')){_0x3d98b4[_0x24d5('0x132')]=_[_0x24d5('0x3f')](_0x3d98b4[_0x24d5('0x132')])?!![]:_0x3d98b4[_0x24d5('0x132')];var _0xa4c95a=uuid['v4']();_0x4cb217[_0x24d5('0x22')][_0xa4c95a]=new Action(_0x3d98b4,_0x4905ba,_0xa4c95a);loggerBooked['info'](_0x24d5('0x1f0'),_0xa4c95a,_0x24d5('0x1f1'),JSON[_0x24d5('0x4b')](_0x3d98b4['queueStatusComplete']),_0x24d5('0x1f2'),_0x3d98b4[_0x24d5('0x41')]);if(_0x3d98b4[_0x24d5('0x132')]){_0x3d98b4[_0x24d5('0x132')]=![];_0x4cb217[_0x24d5('0x12f')][_0x4cb217[_0x24d5('0x22')][_0xa4c95a]['queue']]=[];ami['Action']({'actionid':_0xa4c95a,'action':_0x24d5('0x1f3'),'queue':_0x3d98b4[_0x24d5('0x41')]})['catch'](function(){_0x4cb217[_0x24d5('0xb8')](_0x3d98b4);_0x4cb217[_0x24d5('0xc4')]({'active':![],'ContactId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a][_0x24d5('0xd6')],'ListId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a][_0x24d5('0xd7')],'VoiceQueueId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a][_0x24d5('0xd9')]||undefined,'CampaignId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a]['CampaignId']||undefined})['catch'](loggerCatch(_0x24d5('0x1f4')));delete _0x4cb217[_0x24d5('0x22')][_0xa4c95a];});}else{loggerBooked['info'](_0x24d5('0x1f5'),JSON[_0x24d5('0x4b')](_0x3d98b4[_0x24d5('0x132')]),_0x24d5('0x1f2'),_0x3d98b4[_0x24d5('0x41')]);_0x4cb217[_0x24d5('0xb8')](_0x3d98b4);_0x4cb217[_0x24d5('0xc4')]({'active':![],'ContactId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a]['ContactId'],'ListId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a]['ListId'],'VoiceQueueId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a][_0x24d5('0xd9')]||undefined,'CampaignId':_0x4cb217[_0x24d5('0x22')][_0xa4c95a]['CampaignId']||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1f4')));delete _0x4cb217['actions'][_0xa4c95a];}}else{return _0x4cb217[_0x24d5('0x170')](_0x3d98b4,_0x4905ba);}}else{if(getDiff(_0x4905ba['scheduledat'])<_0x3d98b4[_0x24d5('0x1f6')]*0x3c){if(_0x4905ba[_0x24d5('0x1f7')]&&!_0x4905ba['Agent']['voicePause']){_0x4cb217['preview'][_0x24d5('0x1f8')](_0x4905ba['id'])['finally'](function(){_0x4cb217[_0x24d5('0xb8')](_0x3d98b4);});}else{_0x4cb217[_0x24d5('0xc5')]({'active':![]},_0x4905ba['id'],0x1)[_0x24d5('0x137')](function(){_0x4cb217[_0x24d5('0xb8')](_0x3d98b4);});}}else{_0x3d98b4[_0x24d5('0x67')]+=0x1;_0x4cb217['updateOriginated'](_0x3d98b4);if(_0x3d98b4[_0x24d5('0x1f9')]){_0x4cb217[_0x24d5('0xc4')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4905ba[_0x24d5('0xd6')],'ListId':_0x4905ba['ListId'],'VoiceQueueId':_0x4905ba['VoiceQueueId']||undefined,'CampaignId':_0x4905ba[_0x24d5('0xda')]||undefined})[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1fa')));_0x4cb217[_0x24d5('0xce')](createObjHistory(_0x3d98b4,_0x4905ba,_0x24d5('0x1fb'),0x17,_0x24d5('0x1fc')))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0x1fd')));}else{_0x4cb217['saveInDb'](createObjHistory(_0x3d98b4,_0x4905ba,'RECALLFAILEDTIMEOUT',0x16,_0x24d5('0x1fe')),_0x24d5('0x1ff'),'[Originate][HistoryRecallClose]');}}}}else{_0x3d98b4[_0x24d5('0x60')]+=0x1;_0x4cb217[_0x24d5('0xd4')](createObjHistory(_0x3d98b4,_0x4905ba,_0x24d5('0x200'),0xd,_0x24d5('0x201')),'[Originate][historyBlacklist]','[Originate][MoveBlacklist]');throw _0x24d5('0x202');}};};Dialer[_0x24d5('0x19')][_0x24d5('0x163')]=function(_0x44aeb7){var _0x323f30=this;var _0xb1524c=_0x44aeb7[_0x24d5('0x203')]-_0x44aeb7[_0x24d5('0x9c')]-_0x44aeb7[_0x24d5('0xc7')];emitCampaignSummary(_0x44aeb7);if(_0xb1524c>0x0){if(_0xb1524c>this[_0x24d5('0x20')]){_0xb1524c=this[_0x24d5('0x20')];}_0x44aeb7[_0x24d5('0xc7')]+=_0xb1524c;this[_0x24d5('0xc9')](_0x44aeb7['id'],_0xb1524c,_0x44aeb7['dialOrderByScheduledAt'],_0x44aeb7)[_0x24d5('0xbb')](function(_0x3792e5){_0x44aeb7['temp']-=_0xb1524c;_0x44aeb7[_0x24d5('0xc7')]=_0x44aeb7[_0x24d5('0xc7')]>0x0?_0x44aeb7[_0x24d5('0xc7')]:0x0;if(!checkContactEmpty(_0x3792e5)){_0x44aeb7[_0x24d5('0x40')]=_0x24d5('0xa3');logger['info']('[getContactCampaign2][Empty]'+_0x44aeb7[_0x24d5('0x41')]);}else{_0x44aeb7[_0x24d5('0x9c')]+=_0x3792e5['length'];_0x44aeb7[_0x24d5('0x40')]=_0x24d5('0x204');for(var _0xe8e12f=0x0;_0xe8e12f<_0x3792e5[_0x24d5('0x9b')];_0xe8e12f+=0x1){_0x44aeb7['ivrTotalCallsDays']+=0x1;if(_[_0x24d5('0xb3')](_0x3792e5[_0xe8e12f])||_[_0x24d5('0xb3')](_0x3792e5[_0xe8e12f][_0x24d5('0x174')])||_[_0x24d5('0xb3')](_0x3792e5[_0xe8e12f][_0x24d5('0x174')]['phone'])){_0x323f30[_0x24d5('0xd3')](_0x24d5('0x205'),_0x44aeb7,_0x3792e5[_0xe8e12f]);}else{_0x323f30[_0x24d5('0xc0')](_[_0x24d5('0xd5')](_0x3792e5[_0xe8e12f],[_0x24d5('0xda'),_0x24d5('0x206')]))[_0x24d5('0xbb')](_0x323f30['checkContactBlack'](_0x44aeb7,_0x3792e5[_0xe8e12f]))['catch'](_0x323f30[_0x24d5('0xd2')](_0x24d5('0x207'),_0x44aeb7));}}}})[_0x24d5('0xb6')](loggerGetContactDialer(_0x24d5('0x208'),_0x44aeb7,_0xb1524c));}};Dialer[_0x24d5('0x19')][_0x24d5('0x15f')]=function(_0x30a9fa,_0x27286b){var _0xf52b82=this;var _0x1387d7=[];var _0x100bda=_0x27286b>=0x1?_0x27286b:0x1;if(_0x30a9fa[_0x24d5('0x5b')]===_0x24d5('0x8')){_0x100bda=0x1;}var _0x45e40b=Math[_0x24d5('0x1ea')](_0x30a9fa[_0x24d5('0x51')]*_0x100bda)-_0x30a9fa[_0x24d5('0x9c')]-_0x30a9fa[_0x24d5('0xc7')];emitVoiceQueueSummary(_0x30a9fa);if(_0x30a9fa[_0x24d5('0x209')]>0x0){var _0x120e35=_0x30a9fa[_0x24d5('0x209')]-_0x30a9fa[_0x24d5('0x9c')]-_0x30a9fa[_0x24d5('0x56')]-_0x30a9fa[_0x24d5('0xc7')]-_0x30a9fa['pTalking'];if(_0x45e40b>_0x120e35){_0x45e40b=_0x120e35;}}if(_0x45e40b>0x0){if(_0x30a9fa[_0x24d5('0x5b')]==='booked'){_0x45e40b=0x1;}if(_0x45e40b>this[_0x24d5('0x20')]){_0x45e40b=this[_0x24d5('0x20')];}_0x30a9fa[_0x24d5('0xc7')]+=_0x45e40b;for(var _0x44c977 in this[_0x24d5('0x1e')]){if(typeof this[_0x24d5('0x1e')][_0x44c977]!==_0x24d5('0x9d')){if(this[_0x24d5('0x1e')][_0x44c977][_0x24d5('0xab')]==='not_inuse'&&this[_0x24d5('0x1e')][_0x44c977][_0x24d5('0xdf')]===_0x24d5('0xe0')){_0x1387d7[_0x24d5('0x130')](this[_0x24d5('0x1e')][_0x44c977]['id']);}}}this[_0x24d5('0xc6')](_0x30a9fa['id'],_0x1387d7,_0x45e40b,_0x30a9fa[_0x24d5('0x20a')],_0x30a9fa)['then'](function(_0x3bc5b9){_0x30a9fa[_0x24d5('0xc7')]-=_0x45e40b;_0x30a9fa[_0x24d5('0xc7')]=_0x30a9fa[_0x24d5('0xc7')]>0x0?_0x30a9fa[_0x24d5('0xc7')]:0x0;if(!checkContactEmpty(_0x3bc5b9)){_0xf52b82['countReScheduled'](_0x30a9fa)['then'](sendMessageReschedule(_0x30a9fa))[_0x24d5('0xb6')](loggerCatch('[countReScheduled]\x20'));}else{_0x30a9fa[_0x24d5('0x9c')]+=_0x3bc5b9[_0x24d5('0x9b')];_0x30a9fa['message']=_0x30a9fa[_0x24d5('0x5b')]===_0x24d5('0x8')?'ACTIVE':_0x24d5('0x204');for(var _0x5ac6a8=0x0;_0x5ac6a8<_0x3bc5b9['length'];_0x5ac6a8+=0x1){if(_[_0x24d5('0xb3')](_0x3bc5b9[_0x5ac6a8])||_['isNil'](_0x3bc5b9[_0x5ac6a8]['Contact'])||_[_0x24d5('0xb3')](_0x3bc5b9[_0x5ac6a8][_0x24d5('0x174')]['phone'])){_0xf52b82['emptyContact'](_0x24d5('0x205'),_0x30a9fa,_0x3bc5b9[_0x5ac6a8]);}else{_0xf52b82[_0x24d5('0xbe')](_[_0x24d5('0xd5')](_0x3bc5b9[_0x5ac6a8],[_0x24d5('0xd9'),_0x24d5('0x206')]))[_0x24d5('0xbb')](_0xf52b82[_0x24d5('0x1ee')](_0x30a9fa,_0x3bc5b9[_0x5ac6a8]))[_0x24d5('0xb6')](_0xf52b82['loggerHandler'](_0x24d5('0x205'),_0x30a9fa));}}}})[_0x24d5('0xb6')](loggerGetContactDialer('[getContactDialer2]',_0x30a9fa,_0x45e40b));}};Dialer[_0x24d5('0x19')][_0x24d5('0x91')]=function(_0x38f2fb){if(_0x38f2fb[_0x24d5('0x209')]>0x0){var _0x445820=_0x38f2fb[_0x24d5('0x209')]-_0x38f2fb[_0x24d5('0x9c')]-_0x38f2fb[_0x24d5('0x56')];if(_0x445820>0x0){this[_0x24d5('0x20b')](_0x38f2fb);}else{loggerPredictiveCalls['info'](_0x24d5('0x20c'));}}else{this[_0x24d5('0x20b')](_0x38f2fb);}};Dialer[_0x24d5('0x19')][_0x24d5('0x20b')]=function(_0x57ed78){var _0x501760=this;var _0x713f2=[];_0x57ed78[_0x24d5('0x9c')]+=0x1;for(var _0x383c8e in this['agents']){if(typeof this[_0x24d5('0x1e')][_0x383c8e]!==_0x24d5('0x9d')){if(this[_0x24d5('0x1e')][_0x383c8e][_0x24d5('0xab')]==='not_inuse'&&this['agents'][_0x383c8e][_0x24d5('0xdf')]===_0x24d5('0xe0')){_0x713f2[_0x24d5('0x130')](this[_0x24d5('0x1e')][_0x383c8e]['id']);}}}this[_0x24d5('0xc6')](_0x57ed78['id'],_0x713f2,0x1,_0x57ed78[_0x24d5('0x20a')],_0x57ed78)[_0x24d5('0xbb')](function(_0x12c936){if(!checkContactEmpty(_0x12c936)){checkContactLowerLimitOriginate(_0x57ed78,0x1,0x0);_0x501760[_0x24d5('0xba')](_0x57ed78)[_0x24d5('0xbb')](sendMessageReschedule(_0x57ed78))[_0x24d5('0xb6')](loggerCatch(_0x24d5('0xbc')));}else{_0x57ed78[_0x24d5('0x40')]='RUNNING';if(_['isNil'](_0x12c936[0x0])||_[_0x24d5('0xb3')](_0x12c936[0x0][_0x24d5('0x174')])||_['isNil'](_0x12c936[0x0]['Contact']['phone'])){_0x501760[_0x24d5('0xd3')]('[actionOriginate]\x20',_0x57ed78,_0x12c936[0x0]);}else{_0x501760[_0x24d5('0xbe')](_[_0x24d5('0xd5')](_0x12c936[0x0],[_0x24d5('0xd9'),_0x24d5('0x206')]))[_0x24d5('0xbb')](_0x501760[_0x24d5('0x1ee')](_0x57ed78,_0x12c936[0x0]))[_0x24d5('0xb6')](_0x501760['loggerHandler'](_0x24d5('0x20d'),_0x57ed78));}}})[_0x24d5('0xb6')](loggerGetContactDialer(_0x24d5('0x20e'),_0x57ed78,0x1));emitVoiceQueueSummary(_0x57ed78);};Dialer[_0x24d5('0x19')][_0x24d5('0x1e4')]=function(_0x5b1eab,_0x5c5092,_0x4428ec,_0x24b9cc,_0x507ec8,_0xdfdee9){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive['info'](_0x24d5('0x20f'),_0x5b1eab);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x210'),_0x5c5092);loggerPredictive['info'](_0x24d5('0x211'),_0x4428ec);loggerPredictive[_0x24d5('0x80')]('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',_0x24b9cc);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x212'),_0x507ec8);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x85'));return new BPromise(function(_0x14c802,_0x545c91){if(_0x5b1eab<=0x0||isNaN(_0x5b1eab)){return _0x545c91(msgResponse(_0x24d5('0x213'),_0x24d5('0x4a'),_0x24d5('0x214')+_0x5b1eab));}if(_0x4428ec<=0x0||isNaN(_0x4428ec)){return _0x545c91(msgResponse(_0x24d5('0x213'),_0x24d5('0x4a'),_0x24d5('0x215')+_0x4428ec));}if(_0x24b9cc<=0x0||isNaN(_0x24b9cc)){return _0x545c91(msgResponse(_0x24d5('0x213'),_0x24d5('0x4a'),'p\x20=\x20'+_0x24b9cc));}if(_0x5c5092<=0x0||isNaN(_0x5c5092)){return _0x545c91(msgResponse(_0x24d5('0x213'),'Error',_0x24d5('0x216')+_0x5c5092));}if(_0x507ec8<=0x0||isNaN(_0x507ec8)){return _0x545c91(msgResponse(_0x24d5('0x213'),'Error',_0x24d5('0x217')+_0x507ec8));}_0xdfdee9=_0xdfdee9||0x0;var _0x2513e5=0x1/_0x4428ec;var _0x46f9d9=0x0;var _0x1f45f1=0x0;var _0x37e182=0x0;var _0x2e27fe=0x0;for(var _0x37ec5a=0x0;_0x37e182<_0x507ec8;_0x37ec5a+=0x1){_0x1f45f1=_0x37ec5a/_0x5c5092;_0x46f9d9=(_0x24b9cc*_0x1f45f1+_0xdfdee9)/_0x2513e5;_0x37e182=erlangb(_0x46f9d9,_0x5b1eab);_0x2e27fe=_0x46f9d9/_0x5b1eab*(0x1-erlangb(_0x46f9d9,_0x5b1eab));}return _0x14c802({'erlangCalls':_0x37ec5a,'erlangCallToSecond':_0x5c5092/_0x37ec5a,'erlangAbandonmentRate':_0x37e182,'erlangBusyFactor':_0x2e27fe});});};Dialer[_0x24d5('0x19')]['busyFactor']=function(_0x1bc9fd,_0x324c35,_0x451c25,_0x126268,_0x1f0493,_0x140c74){loggerPredictive[_0x24d5('0x80')](_0x24d5('0x218'));loggerPredictive[_0x24d5('0x80')]('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',_0x1bc9fd);loggerPredictive[_0x24d5('0x80')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x324c35);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x211'),_0x451c25);loggerPredictive[_0x24d5('0x80')](_0x24d5('0x219'),_0x126268);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f0493);loggerPredictive['info'](_0x24d5('0x85'));return new BPromise(function(_0x2990bf,_0x591556){if(_0x1bc9fd<=0x0||isNaN(_0x1bc9fd)){return _0x591556(msgResponse(_0x24d5('0x21a'),_0x24d5('0x4a'),'m\x20=\x20'+_0x1bc9fd));}if(_0x451c25<=0x0||isNaN(_0x451c25)){return _0x591556(msgResponse(_0x24d5('0x21a'),_0x24d5('0x4a'),_0x24d5('0x215')+_0x451c25));}if(_0x126268<=0x0||isNaN(_0x126268)){return _0x591556(msgResponse(_0x24d5('0x21a'),_0x24d5('0x4a'),_0x24d5('0x21b')+_0x126268));}if(_0x324c35<=0x0||isNaN(_0x324c35)){return _0x591556(msgResponse(_0x24d5('0x21a'),_0x24d5('0x4a'),_0x24d5('0x216')+_0x324c35));}if(_0x1f0493<=0x0||isNaN(_0x1f0493)){return _0x591556(msgResponse(_0x24d5('0x21a'),'Error',_0x24d5('0x21c')+_0x1f0493));}_0x140c74=_0x140c74||0x0;var _0x258d20=0x1/_0x451c25;var _0x52ed57=0x0;var _0x627d3d=0x0;var _0x47969e=0x0;var _0x554ea6=0x0;for(var _0x239583=0x0;_0x554ea6<_0x1f0493;_0x239583+=0x1){_0x627d3d=_0x239583/_0x324c35;_0x52ed57=(_0x126268*_0x627d3d+_0x140c74)/_0x258d20;_0x47969e=erlangb(_0x52ed57,_0x1bc9fd);_0x554ea6=_0x52ed57/_0x1bc9fd*(0x1-erlangb(_0x52ed57,_0x1bc9fd));}return _0x2990bf({'erlangCalls':_0x239583,'erlangCallToSecond':_0x324c35/_0x239583,'erlangAbandonmentRate':_0x47969e,'erlangBusyFactor':_0x554ea6});});};module[_0x24d5('0x21d')]=Dialer; \ No newline at end of file +var _0xecb7=['[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','resetActiveCalls','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','TIMEZONE_UNKNOW','command','iftime\x20%s,%s','interval','timezones','indexOf','true','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','dialPowerLevel','launchHandleIvr','loggedIn','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdName','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','originate','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','[originateError]:\x20%s','OriginateError','[originate][error]','finally','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','outboundNoSuchCallsDay','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','talking','floor','erlangCalls','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','outboundQueuePauses','predictiveIntervalPauses','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','checkContactBlack','recallme','[booked][checkContactBlack]','queuestatus','Queue:\x20','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','[getContactCampaign2][Empty]','RUNNING','[actionOriginate]\x20','loggerHandler','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','reachable','Contact.phone','tryOriginatePredictive','dialOrderByScheduledAt','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','bluebird','uuid','moment','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','startPredictive','startProgressive','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncAgentComplete','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','AGENTS_NOT_LOGGED','name','Interval','message','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','[ifTime][Action]','Error','stringify','milliseconds','diff','seconds','outbound','answered','available','sumBillable','total','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangBusyFactor','Trunk','active','callerid','md5','voice:queue:%s','voice_queue:save','ivr','format','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAnsweredCalls','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','isEmpty','\x22%s\x22\x20<%s>','error','inspect','length','undefined','[decremetOriginate]\x20object\x20originated\x20is\x20negative','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','pTalking','is\x20not\x20active','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','NOT_ACTIVE','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','starttime','loopClearZombieChannels','clearZombieChannels','isNil','Action','status','catch','No\x20such\x20channel','[Dialer][checkChannel]','queue','updateOriginated','[Dialer][checkChannel][ivr]','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','resolve','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','getContactDialer','temp','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','emptyContact','notFound','pick','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','SIP/%s','unmonitored','saveInDb','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','HANGUP','outboundAnswerAgiCallsDay','statedesc','HangupInAMD','membername','AMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','state','Machine','countmachineretry','emit','[syncAgentComplete][createHistory][0]','countdropretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','add','dialMachineRetryFrequency','minutes','[rescheduleContact][Machine]','[syncHangupInAMDIvr]','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','YYYY-MM-DD\x20HH:mm:ss','ContactId','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr]','cause-txt','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','predictiveIntervalErlangCallsDroppedCalls','Drop','dropreason','TIMEOUT','agiafterat','countglobal','dialDropMaxRetry','dialDropRetryFrequency','[rescheduleContact][Drop]','endtime','calleridname','calleridnum','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','channel','actionid','locked','paused','stateinterface','strategy','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','preview','run','[Catch][Preview][syncQueueStatusComplete]'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xecb7,0xea));var _0x7ecb=function(_0x19d83a,_0x5b2d0b){_0x19d83a=_0x19d83a-0x0;var _0x27d46f=_0xecb7[_0x19d83a];return _0x27d46f;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x7ecb('0x0'));var uuid=require(_0x7ecb('0x1'));var moment=require(_0x7ecb('0x2'));var rr=require('rr');var md5=require('md5');var Redis=require('ioredis');var ut=require(_0x7ecb('0x3'));var config=require(_0x7ecb('0x4'));var logger=require('../../../config/logger')(_0x7ecb('0x5'));var loggerBooked=require(_0x7ecb('0x6'))(_0x7ecb('0x7'));var loggerPredictive=require(_0x7ecb('0x6'))(_0x7ecb('0x8'));var loggerPredictiveCalls=require('../../../config/logger')(_0x7ecb('0x9'));var loggerSyncQueueSummary=require(_0x7ecb('0x6'))(_0x7ecb('0xa'));var ami=require(_0x7ecb('0xb'));config[_0x7ecb('0xc')]=_[_0x7ecb('0xd')](config[_0x7ecb('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7ecb('0xc')]));var cmHopper=require(_0x7ecb('0xe'));var cmHopperHistory=require(_0x7ecb('0xf'));var cmHopperBlack=require(_0x7ecb('0x10'));var voiceQueueRt=require(_0x7ecb('0x11'));var Action=require(_0x7ecb('0x12'));var History=require(_0x7ecb('0x13'));var Final=require(_0x7ecb('0x14'));var AgentComplete=require(_0x7ecb('0x15'));var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require(_0x7ecb('0x16'));var ipAgi=process['env'][_0x7ecb('0x17')]||_0x7ecb('0x18');var strategy={'rrmemory':_0x7ecb('0x19'),'roundrobin':_0x7ecb('0x1a')};var Sequence=function(){};Sequence[_0x7ecb('0x1b')][_0x7ecb('0x1c')]=function(_0xe1e482){this[_0x7ecb('0x1d')]=this[_0x7ecb('0x1d')]?this[_0x7ecb('0x1d')]['finally'](_0xe1e482):_0xe1e482();};function Dialer(_0x4d1c3e,_0x36255a){this[_0x7ecb('0x1e')]=new Sequence();this['preview']=_0x36255a;this[_0x7ecb('0x1f')]=_0x4d1c3e['voiceQueues'];this[_0x7ecb('0x20')]=_0x4d1c3e[_0x7ecb('0x20')];this[_0x7ecb('0x21')]=_0x4d1c3e[_0x7ecb('0x21')];this['trunks']=_0x4d1c3e[_0x7ecb('0x22')];this[_0x7ecb('0x23')]=config['maxNumberOriginate']||0x2;this[_0x7ecb('0x24')]={};this[_0x7ecb('0x25')]={};this[_0x7ecb('0x26')]={};this[_0x7ecb('0x27')]={};this['optionPredictive']={};this[_0x7ecb('0x28')]={};this[_0x7ecb('0x29')]={};this['ivrOriginated']={};this[_0x7ecb('0x2a')]={};this[_0x7ecb('0x2b')]={};ami['on'](_0x7ecb('0x2c'),this[_0x7ecb('0x2d')][_0x7ecb('0x2e')](this));ami['on'](_0x7ecb('0x2f'),this[_0x7ecb('0x30')][_0x7ecb('0x2e')](this));ami['on'](_0x7ecb('0x31'),this['syncOriginateResponse'][_0x7ecb('0x2e')](this));ami['on']('agentcomplete',this[_0x7ecb('0x32')][_0x7ecb('0x2e')](this));ami['on']('custom:queuesummary',this[_0x7ecb('0xa')]['bind'](this));ami['on'](_0x7ecb('0x33'),this[_0x7ecb('0x34')][_0x7ecb('0x2e')](this));ami['on'](_0x7ecb('0x35'),this[_0x7ecb('0x36')][_0x7ecb('0x2e')](this));ami['on'](_0x7ecb('0x37'),this['syncVarSet']['bind'](this));ami['on'](_0x7ecb('0x38'),this[_0x7ecb('0x39')][_0x7ecb('0x2e')](this));ami['on'](_0x7ecb('0x3a'),this[_0x7ecb('0x3b')][_0x7ecb('0x2e')](this));this[_0x7ecb('0x3c')]();this['loopClearZombieChannels']();}function isNotNull(_0x172900){return _0x172900!==null&&!_[_0x7ecb('0x3d')](_0x172900);}function checkIsLoggedIn(_0x88927e,_0x1c8d19){return function(){if(_0x1c8d19<=0x0){_0x88927e['message']=_0x7ecb('0x3e');throw _0x88927e[_0x7ecb('0x3f')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x4a01a1){return _0x4a01a1;}function checkIsActive(_0x46159d,_0x415f7f){return function(){if(!isActive(_0x415f7f)){_0x46159d['message']='NOT_ACTIVE';throw _0x46159d[_0x7ecb('0x3f')]+'\x20NOT\x20Active';}};}function checkInterval(_0x7d464b){return function(){if(!isNotNull(_0x7d464b[_0x7ecb('0x40')])){_0x7d464b[_0x7ecb('0x41')]=_0x7ecb('0x42');throw _0x7d464b['name']+_0x7ecb('0x43');}if(!isNotNull(_0x7d464b['Interval'][_0x7ecb('0x44')])){_0x7d464b[_0x7ecb('0x41')]=_0x7ecb('0x42');throw _0x7d464b[_0x7ecb('0x3f')]+_0x7ecb('0x43');}if(!isNotNull(_['isEmpty'](_0x7d464b['Interval'][_0x7ecb('0x44')]))){_0x7d464b['message']='INTERVAL_IS_NULL';throw _0x7d464b[_0x7ecb('0x3f')]+_0x7ecb('0x43');}};}function msgResponse(_0x860d60,_0x4b2b4a,_0x5517d6){return{'action':_0x860d60,'response':_0x4b2b4a,'message':_0x5517d6,'stack':_0x5517d6};}function myreject(_0x1e0622){return function(_0x571c12){return _0x1e0622(msgResponse(_0x7ecb('0x45'),_0x7ecb('0x46'),JSON[_0x7ecb('0x47')](_0x571c12)));};}function getSeconds(_0x1dddfd,_0x4444bb){var _0xa3233f=moment(_0x1dddfd)[_0x7ecb('0x48')](0x0);var _0x1583df=moment(_0x4444bb)[_0x7ecb('0x48')](0x0);return _0xa3233f[_0x7ecb('0x49')](_0x1583df,_0x7ecb('0x4a'));}function emit(_0x2a10aa,_0x26d048,_0x6328c9){io['to'](_0x2a10aa)['emit'](_0x26d048,_0x6328c9);}function emitVoiceQueueSummary(_0x1de61b){if(_0x1de61b['type']===_0x7ecb('0x4b')){var _0x3afb33={'id':_0x1de61b['id'],'name':_0x1de61b[_0x7ecb('0x3f')],'strategy':_0x1de61b['strategy'],'answered':_0x1de61b[_0x7ecb('0x4c')],'available':_0x1de61b[_0x7ecb('0x4d')],'loggedIn':_0x1de61b['loggedIn'],'pTalking':_0x1de61b['pTalking'],'sumBillable':_0x1de61b[_0x7ecb('0x4e')],'sumDuration':_0x1de61b['sumDuration'],'sumHoldTime':_0x1de61b['sumHoldTime']||0x0,'talking':_0x1de61b['talking'],'total':_0x1de61b[_0x7ecb('0x4f')],'type':_0x1de61b[_0x7ecb('0x50')],'unmanaged':_0x1de61b[_0x7ecb('0x51')],'abandoned':_0x1de61b[_0x7ecb('0x52')],'waiting':_0x1de61b[_0x7ecb('0x53')],'loggedInDb':_0x1de61b[_0x7ecb('0x54')],'dialActive':_0x1de61b[_0x7ecb('0x55')],'dialMethod':_0x1de61b[_0x7ecb('0x56')],'dialOriginateCallerIdName':_0x1de61b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x1de61b[_0x7ecb('0x57')],'dialOriginateTimeout':_0x1de61b[_0x7ecb('0x58')],'dialPrefix':_0x1de61b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x1de61b['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x1de61b[_0x7ecb('0x59')],'outboundBlacklistCallsDay':_0x1de61b[_0x7ecb('0x5a')],'outboundBusyCallsDay':_0x1de61b[_0x7ecb('0x5b')],'outboundCongestionCallsDay':_0x1de61b[_0x7ecb('0x5c')],'outboundDropCallsDayACS':_0x1de61b[_0x7ecb('0x5d')],'outboundDropCallsDayCallersExit':_0x1de61b['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x1de61b[_0x7ecb('0x5e')],'outboundNoAnswerCallsDay':_0x1de61b[_0x7ecb('0x5f')],'outboundNoSuchCallsDay':_0x1de61b['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x1de61b['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x1de61b[_0x7ecb('0x60')],'outboundRejectCallsDay':_0x1de61b[_0x7ecb('0x61')],'outboundUnknownCallsDay':_0x1de61b[_0x7ecb('0x62')],'predictiveIntervalAnsweredCalls':_0x1de61b['predictiveIntervalAnsweredCalls'],'predictiveIntervalAvgHoldtime':_0x1de61b['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x1de61b['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x1de61b[_0x7ecb('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x1de61b[_0x7ecb('0x64')],'predictiveIntervalErlangCalls':_0x1de61b[_0x7ecb('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x1de61b['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x1de61b[_0x7ecb('0x66')],'predictiveIntervalMultiplicativeFactor':_0x1de61b[_0x7ecb('0x67')],'predictiveIntervalPauses':_0x1de61b['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x1de61b[_0x7ecb('0x68')],'predictiveIntervalTotalCalls':_0x1de61b[_0x7ecb('0x69')],'message':_0x1de61b[_0x7ecb('0x41')],'originated':_0x1de61b[_0x7ecb('0x6a')],'erlangCalls':_0x1de61b['erlangCalls'],'erlangCallToSecond':_0x1de61b['erlangCallToSecond'],'erlangAbandonmentRate':_0x1de61b['erlangAbandonmentRate'],'erlangBusyFactor':_0x1de61b[_0x7ecb('0x6b')],'startPredictive':_0x1de61b[_0x7ecb('0x28')],'startProgressive':_0x1de61b[_0x7ecb('0x29')]};if(_0x1de61b[_0x7ecb('0x6c')]){_0x3afb33[_0x7ecb('0x6c')]={'id':_0x1de61b[_0x7ecb('0x6c')]['id'],'name':_0x1de61b[_0x7ecb('0x6c')]['name'],'active':_0x1de61b['Trunk'][_0x7ecb('0x6d')],'callerid':_0x1de61b['Trunk'][_0x7ecb('0x6e')]};}if(_0x1de61b[_0x7ecb('0x40')]){_0x3afb33[_0x7ecb('0x40')]={'id':_0x1de61b[_0x7ecb('0x40')]['id'],'name':_0x1de61b[_0x7ecb('0x40')][_0x7ecb('0x3f')]};}var _0x569ccf=md5(JSON[_0x7ecb('0x47')](_0x3afb33));if(_0x1de61b[_0x7ecb('0x6f')]!==_0x569ccf){_0x1de61b[_0x7ecb('0x6f')]=_0x569ccf;emit(util['format'](_0x7ecb('0x70'),_0x3afb33[_0x7ecb('0x3f')]),_0x7ecb('0x71'),_0x3afb33);}}}function emitCampaignSummary(_0x559198){if(_0x559198['type']===_0x7ecb('0x72')){emit(util[_0x7ecb('0x73')](_0x7ecb('0x74'),_0x559198['name']),_0x7ecb('0x75'),_0x559198);}}function checkGetDataPredictive(_0xd386e){if(isNotNull(_0xd386e)&&!_['isEmpty'](_0xd386e)){loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x77'));loggerPredictive['info'](_0x7ecb('0x78'),_0xd386e[_0x7ecb('0x69')]);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x79'),_0xd386e[_0x7ecb('0x7a')]);loggerPredictive[_0x7ecb('0x76')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd386e[_0x7ecb('0x64')]);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x7b'),_0xd386e['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd386e[_0x7ecb('0x7c')]);loggerPredictive['info']('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xd386e[_0x7ecb('0x7d')]);loggerPredictive['info'](_0x7ecb('0x7e'));if(_0xd386e[_0x7ecb('0x69')]>0x0){if(!_[_0x7ecb('0x3d')](_0xd386e['predictiveIntervalAvgTalktime'])&&_0xd386e[_0x7ecb('0x7d')]>0x0){return!![];}loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x7f'));if(!_[_0x7ecb('0x3d')](_0xd386e[_0x7ecb('0x7c')])&&_0xd386e[_0x7ecb('0x7c')]>0x0){return!![];}loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x80'));}else{loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x81'));}}else{loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x82'));}return![];}function mergeDataErlangB(_0xd9377b){return function(_0x3434cb){loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x83'));loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x84'),_0x3434cb['erlangCalls']);loggerPredictive[_0x7ecb('0x76')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3434cb['erlangCallToSecond']);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x85'),_0x3434cb[_0x7ecb('0x86')]);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x87'),_0x3434cb[_0x7ecb('0x6b')]);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x85'),_0x3434cb['erlangAbandonmentRate']);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x7e'));_[_0x7ecb('0x88')](_0xd9377b,_0x3434cb);};}function getDiff(_0x1a0a46){var _0x410cfe=moment()[_0x7ecb('0x48')](0x0);var _0x4658c7=moment(_0x1a0a46)[_0x7ecb('0x48')](0x0);return _0x410cfe[_0x7ecb('0x49')](_0x4658c7,'seconds');}function ifInterval(_0x5bf6de,_0x5e824f){if(_[_0x7ecb('0x3d')](_0x5e824f)){return![];}return getDiff(_0x5e824f)<_0x5bf6de*0x3c;}function freeVariablesPredictive(_0x15a6dd){if(isNotNull(_0x15a6dd)){if(!_['isUndefined'](_0x15a6dd['startProgressive'])){_0x15a6dd[_0x7ecb('0x29')]=undefined;loggerPredictive[_0x7ecb('0x76')](_0x15a6dd[_0x7ecb('0x3f')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0x7ecb('0x3d')](_0x15a6dd['startPredictive'])){_0x15a6dd[_0x7ecb('0x28')]=undefined;loggerPredictive['info'](_0x15a6dd[_0x7ecb('0x3f')],_0x7ecb('0x89'));}if(!_[_0x7ecb('0x3d')](_0x15a6dd[_0x7ecb('0x8a')])){clearInterval(_0x15a6dd[_0x7ecb('0x8a')]);_0x15a6dd['handlePredictive']=undefined;loggerPredictive[_0x7ecb('0x76')](_0x15a6dd[_0x7ecb('0x3f')],_0x7ecb('0x8b'));}}}function erlangb(_0x1eb398,_0x4a1931){if(_0x4a1931===0x0){return 0x0;}var _0x23423e=0x1;for(var _0x4fce1b=0x1;_0x4fce1b<=_0x4a1931;_0x4fce1b+=0x1){_0x23423e=0x1+_0x23423e*_0x4fce1b/_0x1eb398;}return 0x1/_0x23423e;}function isVoiceQueueOutbound(_0x2c0949){return _0x2c0949==='outbound';}function isNotPreview(_0x5c22de){return _0x5c22de!=='preview';}function isCampaignIvr(_0x44907e){return _0x44907e===_0x7ecb('0x72');}function getCallerId(_0x19e86a,_0x1c5bbb,_0x3f6d45){if(!_[_0x7ecb('0x3d')](_0x3f6d45)&&typeof _0x3f6d45===_0x7ecb('0x8c')&&!_[_0x7ecb('0x8d')](_0x3f6d45)){if(!_[_0x7ecb('0x3d')](_0x1c5bbb)&&typeof _0x1c5bbb===_0x7ecb('0x8c')&&!_[_0x7ecb('0x8d')](_0x1c5bbb)){return util[_0x7ecb('0x73')](_0x7ecb('0x8e'),_0x1c5bbb,_0x3f6d45);}return util[_0x7ecb('0x73')](_0x7ecb('0x8e'),_0x3f6d45,_0x3f6d45);}if(!_['isUndefined'](_0x19e86a)&&typeof _0x19e86a===_0x7ecb('0x8c')&&!_[_0x7ecb('0x8d')](_0x19e86a)){return _0x19e86a;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x2db8e7,_0x17a386){return function(_0x561bd8){freeVariablesPredictive(_0x17a386);emitVoiceQueueSummary(_0x17a386);emitCampaignSummary(_0x17a386);loggerSyncQueueSummary[_0x7ecb('0x8f')](_0x2db8e7,util[_0x7ecb('0x90')](_0x561bd8,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3228ed,_0x3fa6c1){return function(_0x56b8f9){loggerPredictive['error'](_0x3fa6c1['name'],_0x3228ed);loggerPredictive[_0x7ecb('0x8f')](_0x56b8f9['stack']);freeVariablesPredictive(_0x3fa6c1);};}function loggerCatch(_0x58d2c3){return function(_0x1b4965){logger['error'](_0x58d2c3,util[_0x7ecb('0x90')](_0x1b4965,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x6905f0){return _0x6905f0&&!_[_0x7ecb('0x3d')](_0x6905f0)&&_0x6905f0[_0x7ecb('0x91')]>0x0;}function decremetOriginate(_0x1abd0a){if(!_['isUndefined'](_0x1abd0a)&&_0x1abd0a!==null){if(typeof _0x1abd0a[_0x7ecb('0x6a')]!==_0x7ecb('0x92')){if(_0x1abd0a[_0x7ecb('0x6a')]>0x0){_0x1abd0a['originated']-=0x1;}else{logger[_0x7ecb('0x8f')](_0x7ecb('0x93'));}}}else{logger[_0x7ecb('0x8f')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x395925,_0x139170,_0x131e02){if(_0x139170>_0x131e02){for(var _0x95ba91=0x0;_0x95ba91<_0x139170-_0x131e02;_0x95ba91+=0x1){decremetOriginate(_0x395925);}}}function loggerGetContactDialer(_0x294829,_0x3b3c9b,_0x21953d){return function(_0x389c11){checkContactLowerLimitOriginate(_0x3b3c9b,_0x21953d,0x0);logger['error'](_0x294829,util[_0x7ecb('0x90')](_0x389c11,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x1d57de){return function(_0x188f45){if(isNotNull(_0x188f45)&&isNotNull(_0x188f45[0x0])){if(_0x188f45[0x0][_0x7ecb('0x94')]>0x0){_0x1d57de[_0x7ecb('0x41')]=_0x7ecb('0x95');logger[_0x7ecb('0x76')](_0x7ecb('0x96')+_0x1d57de[_0x7ecb('0x3f')],_0x188f45[0x0][_0x7ecb('0x94')],_0x7ecb('0x97'));}else{_0x1d57de[_0x7ecb('0x41')]=_0x7ecb('0x98');logger[_0x7ecb('0x76')](_0x7ecb('0x99')+_0x1d57de[_0x7ecb('0x3f')]);}}};}function notSendMessagesQueue(_0x1b515a){if(_0x1b515a[_0x7ecb('0x9a')]){freeVariablesPredictive(_0x1b515a);if(_0x1b515a['originated']===0x0&&_0x1b515a['talking']===0x0&&_0x1b515a['waiting']===0x0&&(_0x1b515a[_0x7ecb('0x9b')]||0x0)===0x0){_0x1b515a[_0x7ecb('0x9a')]=![];_0x1b515a[_0x7ecb('0x4d')]=0x0;_0x1b515a[_0x7ecb('0x41')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x7ecb('0x8f')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1b515a[_0x7ecb('0x3f')],_0x7ecb('0x9c'));}else{_0x1b515a[_0x7ecb('0x41')]='IS_DISACTIVED';loggerSyncQueueSummary[_0x7ecb('0x8f')](_0x7ecb('0x9d'),_0x1b515a[_0x7ecb('0x3f')],_0x7ecb('0x9e'));}emitVoiceQueueSummary(_0x1b515a);}}function notSendMessagesCampaign(_0x339e50){if(_0x339e50['sendMessageOneNotActive']){if(_0x339e50['originated']===0x0){_0x339e50[_0x7ecb('0x9a')]=![];_0x339e50['message']=_0x7ecb('0x9f');loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x339e50[_0x7ecb('0x3f')],_0x7ecb('0x9c'));}else{_0x339e50['message']=_0x7ecb('0xa0');loggerSyncQueueSummary[_0x7ecb('0x8f')](_0x7ecb('0xa1'),_0x339e50[_0x7ecb('0x3f')],_0x7ecb('0x9e'));}emitCampaignSummary(_0x339e50);}}function createObjHistory(_0x253593,_0x533129,_0x2b49a3,_0x5a34dd,_0x56830d){_0x253593[_0x7ecb('0x41')]=_0x2b49a3;var _0x4a2ef5=new Action(_0x253593,_0x533129);var _0x37bf94=new History(_0x4a2ef5);_0x37bf94['state']=_0x5a34dd;_0x37bf94['statedesc']=_0x56830d;_0x37bf94['endtime']=_0x4a2ef5[_0x7ecb('0xa2')];return _0x37bf94;}Dialer['prototype'][_0x7ecb('0xa3')]=function(){var _0x2babf5=this;setInterval(function(){_0x2babf5['clearZombieChannels'](_0x2babf5[_0x7ecb('0x27')],'[uniqueid]');_0x2babf5[_0x7ecb('0xa4')](_0x2babf5[_0x7ecb('0x25')],'[actions]');},0x32c8);};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xa4')]=function(_0x19287c,_0x503af5){var _0x3a132f=this;for(var _0x407e8f in _0x19287c){if(typeof _0x19287c[_0x407e8f]!==_0x7ecb('0x92')){this[_0x7ecb('0x1e')]['enqueue'](function(){if(!_[_0x7ecb('0xa5')](_0x19287c[_0x407e8f])){return ami[_0x7ecb('0xa6')]({'action':_0x7ecb('0xa7'),'channel':_0x19287c[_0x407e8f]['channel']})[_0x7ecb('0xa8')](function(_0x26ed95){if(_0x26ed95[_0x7ecb('0x41')]===_0x7ecb('0xa9')){setTimeout(function(){if(_0x19287c[_0x407e8f]&&_0x19287c[_0x407e8f][_0x7ecb('0x50')]!==_0x7ecb('0x72')){_0x3a132f['updateOriginated'](_0x3a132f[_0x7ecb('0x1f')][_0x19287c[_0x407e8f]['queue']]);logger[_0x7ecb('0x8f')](_0x7ecb('0xaa'),_0x503af5,_0x407e8f,_0x19287c[_0x407e8f][_0x7ecb('0xab')]);delete _0x19287c[_0x407e8f];}if(_0x19287c[_0x407e8f]&&_0x19287c[_0x407e8f]['type']==='ivr'){_0x3a132f[_0x7ecb('0xac')](_0x3a132f[_0x7ecb('0x20')][_0x19287c[_0x407e8f][_0x7ecb('0xab')]]);logger[_0x7ecb('0x8f')](_0x7ecb('0xad'),_0x503af5,_0x407e8f,_0x19287c[_0x407e8f][_0x7ecb('0xab')]);delete _0x19287c[_0x407e8f];}},0x2328);}});}});}}};Dialer[_0x7ecb('0x1b')]['countReScheduled']=function(_0x57948e){return BPromise['resolve']()[_0x7ecb('0xae')](cmHopper[_0x7ecb('0xaf')](_0x57948e))[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xb0')));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xb1')]=function(_0x19b571){return BPromise['resolve']()[_0x7ecb('0xae')](cmHopperBlack[_0x7ecb('0xb1')](_0x19b571))['catch'](loggerCatch(_0x7ecb('0xb2')));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xb3')]=function(_0x267207){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopperBlack['checkIsBlackListIvr'](_0x267207))['catch'](loggerCatch(_0x7ecb('0xb5')));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xb6')]=function(_0x1bbd40){return BPromise[_0x7ecb('0xb4')]()['then'](cmHopperHistory[_0x7ecb('0xb7')](_0x1bbd40))['catch'](loggerCatch(_0x7ecb('0xb8')));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xb9')]=function(_0x4785ad){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopper[_0x7ecb('0xb9')](_0x4785ad))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer['prototype']['unlockContact']=function(_0x137e6e,_0x556fbd,_0x4fe38a){return BPromise[_0x7ecb('0xb4')]()['then'](cmHopper[_0x7ecb('0xba')](_0x137e6e,_0x556fbd,_0x4fe38a))[_0x7ecb('0xa8')](loggerCatch('[unlockContact]\x20'));};Dialer[_0x7ecb('0x1b')]['getContactDialer']=function(_0x14e956,_0x300650,_0x4668f6,_0x14462a,_0x4ee59e){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopper[_0x7ecb('0xbb')](_0x14e956,_0x300650,_0x4668f6,_0x14462a))[_0x7ecb('0xa8')](function(_0x399182){_0x4ee59e['temp']-=_0x4668f6;_0x4ee59e[_0x7ecb('0xbc')]=_0x4ee59e['temp']>0x0?_0x4ee59e[_0x7ecb('0xbc')]:0x0;loggerCatch('[getContactDialer]\x20')(_0x399182);});};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xbd')]=function(_0x3afd03,_0x173041,_0x327b02,_0x386c6d){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopper['getContactDialerIvr'](_0x3afd03,_0x173041,_0x327b02))['catch'](function(_0xfc3042){_0x386c6d[_0x7ecb('0xbc')]-=_0x173041;_0x386c6d[_0x7ecb('0xbc')]=_0x386c6d[_0x7ecb('0xbc')]>0x0?_0x386c6d['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0xfc3042);});};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xbe')]=function(_0x29a188){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](voiceQueueRt['getVoiceQueueRtPauses'](_0x29a188))[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xbf')));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xc0')]=function(_0x2afeaf){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopper[_0x7ecb('0xc0')](_0x2afeaf))[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xc1')));};Dialer['prototype'][_0x7ecb('0xc2')]=function(_0x4b51a5){return BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](cmHopperHistory['createHistory'](_0x4b51a5))['catch'](loggerCatch(_0x7ecb('0xc3')));};Dialer['prototype'][_0x7ecb('0xac')]=function(_0x4aecb4){if(!_[_0x7ecb('0x3d')](_0x4aecb4)&&_0x4aecb4!==null){if(typeof _0x4aecb4[_0x7ecb('0x6a')]!==_0x7ecb('0x92')){if(_0x4aecb4[_0x7ecb('0x6a')]>0x0){_0x4aecb4[_0x7ecb('0x6a')]-=0x1;}else{logger[_0x7ecb('0x8f')](_0x7ecb('0xc4'));}}}else{logger[_0x7ecb('0x8f')](_0x7ecb('0xc5'));}};Dialer[_0x7ecb('0x1b')]['loggerHandler']=function(_0x22c94c,_0x2cd295){var _0x1b0e23=this;return function(_0x37b087){_0x1b0e23[_0x7ecb('0xac')](_0x2cd295);logger[_0x7ecb('0x8f')](_0x22c94c,util[_0x7ecb('0x90')](_0x37b087,{'showHidden':![],'depth':null}));};};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xc6')]=function(_0x4da0e1,_0x2ea065,_0x44145c){var _0x3724dc={'state':0x19,'statedesc':_0x7ecb('0xc7')};this[_0x7ecb('0xac')](_0x2ea065);this['saveInDb'](_[_0x7ecb('0x88')](_0x3724dc,_[_0x7ecb('0xc8')](_0x44145c,['ContactId',_0x7ecb('0xc9'),_0x7ecb('0xca'),_0x7ecb('0xcb'),_0x7ecb('0xcc')])),_0x7ecb('0xcd'),'[emptyContact]');logger[_0x7ecb('0x8f')](_0x4da0e1);};Dialer['prototype']['isSuccess']=function(_0x59c204){return _0x59c204===_0x7ecb('0xce');};Dialer['prototype']['isTrunkReachable']=function(_0xbd3198){return!_[_0x7ecb('0x3d')](_0xbd3198)&&_0xbd3198&&!_['isUndefined'](_0xbd3198[_0x7ecb('0x3f')])&&!_[_0x7ecb('0x3d')](_0xbd3198[_0x7ecb('0x6d')])&&_0xbd3198[_0x7ecb('0x6d')]&&(this['trunks'][util[_0x7ecb('0x73')](_0x7ecb('0xcf'),_0xbd3198[_0x7ecb('0x3f')])][_0x7ecb('0xa7')]==='reachable'||this['trunks'][util[_0x7ecb('0x73')](_0x7ecb('0xcf'),_0xbd3198['name'])]['status']===_0x7ecb('0xd0'));};Dialer['prototype'][_0x7ecb('0xd1')]=function(_0x3c541f,_0x290de3,_0x4789e6){this[_0x7ecb('0xc2')](_0x3c541f)[_0x7ecb('0xa8')](loggerCatch(_0x290de3));this[_0x7ecb('0xc0')](_0x3c541f)['catch'](loggerCatch(_0x4789e6));};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xd2')]=function(_0x412905){var _0x371d92=this[_0x7ecb('0x27')][_0x412905[_0x7ecb('0xd3')]];var _0x742bbb;if(!_[_0x7ecb('0xa5')](_0x412905)&&!_[_0x7ecb('0xa5')](_0x412905[_0x7ecb('0xd4')])&&!_['isNil'](_0x412905['variable'][_0x7ecb('0xd5')])&&_0x412905[_0x7ecb('0xd6')]===_0x7ecb('0xd7')&&_0x371d92){if(_0x371d92['type']!=='ivr'&&this[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]][_0x7ecb('0xd8')]&&_0x412905[_0x7ecb('0xd9')]===_0x7ecb('0xda')){delete this[_0x7ecb('0x27')][_0x412905['uniqueid']];this[_0x7ecb('0xac')](this[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]]);this['voiceQueues'][_0x371d92['queue']][_0x7ecb('0x59')]+=0x1;this[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]][_0x7ecb('0xdb')]+=0x1;_0x742bbb=new Hangup(_0x371d92,_0x412905);_0x742bbb['state']=0x12;_0x742bbb[_0x7ecb('0xdc')]=_0x7ecb('0xdd');_0x742bbb[_0x7ecb('0xde')]=_0x7ecb('0xdf');ami['emit'](_0x7ecb('0xe0'),ut[_0x7ecb('0xe1')](_0x742bbb,_0x7ecb('0xe2')));this[_0x7ecb('0xd1')](_0x742bbb,_0x7ecb('0xe3'),_0x7ecb('0xe4'));}if(_0x371d92[_0x7ecb('0x50')]!==_0x7ecb('0x72')&&this[_0x7ecb('0x1f')][_0x371d92['queue']][_0x7ecb('0xd8')]&&_0x412905[_0x7ecb('0xd9')]==='MACHINE'){var _0x1503a2=this;return new BPromise(function(_0x51c4b7,_0x48ec2b){delete _0x1503a2[_0x7ecb('0x27')][_0x412905[_0x7ecb('0xd3')]];_0x1503a2[_0x7ecb('0xac')](_0x1503a2[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]]);_0x1503a2[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]]['outboundAnswerCallsDay']+=0x1;_0x1503a2[_0x7ecb('0x1f')][_0x371d92['queue']][_0x7ecb('0xdb')]+=0x1;var _0x3cf95e=_0x1503a2[_0x7ecb('0x1f')][_0x371d92[_0x7ecb('0xab')]];var _0x22bd83=new Hangup(_0x371d92,_0x412905);_0x22bd83[_0x7ecb('0xe5')]=0x13;_0x22bd83['statedesc']=_0x7ecb('0xe6');_0x22bd83['membername']=_0x7ecb('0xdf');_0x22bd83[_0x7ecb('0xe7')]+=0x1;_0x22bd83['countglobal']+=0x1;_0x22bd83['amd']=!![];ami[_0x7ecb('0xe8')](_0x7ecb('0xe0'),ut['buildObj'](_0x22bd83,_0x7ecb('0xe2')));_0x1503a2[_0x7ecb('0xc2')](_0x22bd83)['catch'](loggerCatch(_0x7ecb('0xe9')));if(_0x22bd83['countbusyretry']+_0x22bd83['countcongestionretry']+_0x22bd83['countnoanswerretry']+_0x22bd83['countnosuchnumberretry']+_0x22bd83[_0x7ecb('0xea')]+_0x22bd83['countabandonedretry']+_0x22bd83[_0x7ecb('0xe7')]+_0x22bd83[_0x7ecb('0xeb')]>=_0x3cf95e[_0x7ecb('0xec')]){_0x1503a2[_0x7ecb('0xed')](_0x22bd83,_0x51c4b7,_0x48ec2b,_0x7ecb('0xee'));}else{if(_0x22bd83[_0x7ecb('0xe7')]>=_0x3cf95e[_0x7ecb('0xef')]){_0x1503a2[_0x7ecb('0xf0')](_0x22bd83,_0x51c4b7,_0x48ec2b,'reason\x2019\x20machine....');}else{_0x1503a2[_0x7ecb('0xb9')]({'active':![],'countmachineretry':_0x22bd83[_0x7ecb('0xe7')],'scheduledat':moment()[_0x7ecb('0xf1')](_0x3cf95e[_0x7ecb('0xf2')],_0x7ecb('0xf3'))[_0x7ecb('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x22bd83['ContactId'],'ListId':_0x22bd83[_0x7ecb('0xc9')],'VoiceQueueId':_0x22bd83[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x22bd83[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xf4')));_0x51c4b7({'reschedule':0x1});}}});}if(_0x371d92[_0x7ecb('0x50')]===_0x7ecb('0x72')&&this[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]][_0x7ecb('0xd8')]&&_0x412905[_0x7ecb('0xd9')]===_0x7ecb('0xda')){delete this[_0x7ecb('0x27')][_0x412905['uniqueid']];this['updateOriginated'](this[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]]);_0x742bbb=new Hangup(_0x371d92,_0x412905);_0x742bbb[_0x7ecb('0xe5')]=0x12;_0x742bbb[_0x7ecb('0xdc')]=_0x7ecb('0xdd');_0x742bbb[_0x7ecb('0xde')]=_0x7ecb('0xdf');ami['emit'](_0x7ecb('0xe0'),ut[_0x7ecb('0xe1')](_0x742bbb,_0x7ecb('0xe2')));this[_0x7ecb('0xd1')](_0x742bbb,'[syncHangupInAMDIvr][createHistory]',_0x7ecb('0xf5'));}if(_0x371d92[_0x7ecb('0x50')]===_0x7ecb('0x72')&&this[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]][_0x7ecb('0xd8')]&&_0x412905[_0x7ecb('0xd9')]==='MACHINE'){var _0x1503a2=this;return new BPromise(function(_0x50beae,_0x21db4b){delete _0x1503a2[_0x7ecb('0x27')][_0x412905[_0x7ecb('0xd3')]];_0x1503a2[_0x7ecb('0xac')](_0x1503a2[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]]);_0x1503a2[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]][_0x7ecb('0x59')]+=0x1;_0x1503a2[_0x7ecb('0x20')][_0x371d92['queue']][_0x7ecb('0xdb')]+=0x1;var _0x3ca8e3=_0x1503a2[_0x7ecb('0x20')][_0x371d92[_0x7ecb('0xab')]];var _0x30c862=new Hangup(_0x371d92,_0x412905);_0x30c862[_0x7ecb('0xe5')]=0x13;_0x30c862[_0x7ecb('0xdc')]='Machine';_0x30c862[_0x7ecb('0xde')]=_0x7ecb('0xdf');_0x30c862['countmachineretry']+=0x1;_0x30c862['countglobal']+=0x1;_0x30c862[_0x7ecb('0xe2')]=!![];ami[_0x7ecb('0xe8')](_0x7ecb('0xe0'),ut['buildObj'](_0x30c862,_0x7ecb('0xe2')));_0x1503a2[_0x7ecb('0xc2')](_0x30c862)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xe9')));if(_0x30c862[_0x7ecb('0xf6')]+_0x30c862[_0x7ecb('0xf7')]+_0x30c862[_0x7ecb('0xf8')]+_0x30c862[_0x7ecb('0xf9')]+_0x30c862['countdropretry']+_0x30c862['countabandonedretry']+_0x30c862['countmachineretry']+_0x30c862[_0x7ecb('0xeb')]>=_0x3ca8e3['dialGlobalMaxRetry']){_0x1503a2['stateGlobal'](_0x30c862,_0x50beae,_0x21db4b,_0x7ecb('0xee'));}else{if(_0x30c862['countmachineretry']>=_0x3ca8e3['dialMachineMaxRetry']){_0x1503a2['createStateFinal'](_0x30c862,_0x50beae,_0x21db4b,'reason\x2019\x20machine....');}else{_0x1503a2[_0x7ecb('0xb9')]({'active':![],'countmachineretry':_0x30c862['countmachineretry'],'scheduledat':moment()[_0x7ecb('0xf1')](_0x3ca8e3['dialMachineRetryFrequency'],'minutes')['format'](_0x7ecb('0xfa')),'ContactId':_0x30c862[_0x7ecb('0xfb')],'ListId':_0x30c862[_0x7ecb('0xc9')],'VoiceQueueId':_0x30c862[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x30c862['CampaignId']||undefined})['catch'](loggerCatch(_0x7ecb('0xf4')));_0x50beae({'reschedule':0x1});}}});}}};Dialer['prototype']['syncHangup']=function(_0x34b1bb){var _0x3fb0c4=this[_0x7ecb('0x27')][_0x34b1bb['uniqueid']];var _0x38fa0c=this;var _0x352d05;if(_0x3fb0c4&&_0x3fb0c4[_0x7ecb('0x50')]===_0x7ecb('0x72')){delete this['uniqueId'][_0x34b1bb[_0x7ecb('0xd3')]];this[_0x7ecb('0xac')](this[_0x7ecb('0x20')][_0x3fb0c4['queue']]);this[_0x7ecb('0x20')][_0x3fb0c4[_0x7ecb('0xab')]][_0x7ecb('0xfc')]+=0x1;_0x352d05=new Hangup(_0x3fb0c4,_0x34b1bb);this['createHistory'](_0x352d05)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xfd')));this[_0x7ecb('0xc0')](_0x352d05)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x3fb0c4&&_0x3fb0c4['type']!=='ivr'&&isNotNull(this[_0x7ecb('0x1f')][_0x3fb0c4['queue']][_0x7ecb('0xfe')])){delete this[_0x7ecb('0x27')][_0x34b1bb[_0x7ecb('0xd3')]];this[_0x7ecb('0xac')](this[_0x7ecb('0x1f')][_0x3fb0c4['queue']]);this[_0x7ecb('0x1f')][_0x3fb0c4['queue']][_0x7ecb('0x59')]+=0x1;this[_0x7ecb('0x1f')][_0x3fb0c4[_0x7ecb('0xab')]][_0x7ecb('0xdb')]+=0x1;_0x352d05=new Hangup(_0x3fb0c4,_0x34b1bb);_0x352d05[_0x7ecb('0xe5')]=0x10;_0x352d05[_0x7ecb('0xdc')]=_0x7ecb('0xff');_0x352d05[_0x7ecb('0xde')]=_0x7ecb('0x100');this[_0x7ecb('0xc2')](_0x352d05)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xfd')));this[_0x7ecb('0xc0')](_0x352d05)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x101')));}if(_0x3fb0c4&&_0x3fb0c4[_0x7ecb('0x50')]!==_0x7ecb('0x72')&&!isNotNull(this[_0x7ecb('0x1f')][_0x3fb0c4[_0x7ecb('0xab')]][_0x7ecb('0xfe')])){delete this['uniqueId'][_0x34b1bb[_0x7ecb('0xd3')]];this['updateOriginated'](this[_0x7ecb('0x1f')][_0x3fb0c4[_0x7ecb('0xab')]]);this[_0x7ecb('0x1f')][_0x3fb0c4[_0x7ecb('0xab')]][_0x7ecb('0x62')]+=0x1;_0x352d05=new Hangup(_0x3fb0c4,_0x34b1bb);_0x352d05['state']=0xc;_0x352d05[_0x7ecb('0xdc')]=_0x34b1bb[_0x7ecb('0x102')];_0x352d05[_0x7ecb('0xde')]='Unknow';this[_0x7ecb('0xc2')](_0x352d05)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xfd')));this[_0x7ecb('0xc0')](_0x352d05)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x101')));}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x32')]=function(_0x161043){var _0xe6575b=this['uniqueId'][_0x161043['uniqueid']];var _0x30a6ae=this;if(this['voiceQueues'][_0x161043[_0x7ecb('0xab')]]){if(_0xe6575b&&_0xe6575b[_0x7ecb('0x50')]!==_0x7ecb('0x72')){delete this[_0x7ecb('0x27')][_0x161043['uniqueid']];this[_0x7ecb('0x1f')][_0x161043[_0x7ecb('0xab')]]['outboundAnswerCallsDay']+=0x1;var _0x323973=new AgentComplete(_0xe6575b,_0x161043);if(_0x161043[_0x7ecb('0x103')]===_0x7ecb('0x104')){_0x323973['agiafterat']=this[_0x7ecb('0x1f')][_0x161043[_0x7ecb('0xab')]]['dialQueueProject2']&&this['voiceQueues'][_0x161043['queue']][_0x7ecb('0x105')]?moment()[_0x7ecb('0x73')](_0x7ecb('0xfa')):undefined;}this[_0x7ecb('0xc2')](_0x323973)['catch'](loggerCatch(_0x7ecb('0x106')));this[_0x7ecb('0xc0')](_0x323973)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x107')));}}};Dialer['prototype']['syncAgentConnect']=function(_0x4db76b){if(this[_0x7ecb('0x1f')][_0x4db76b[_0x7ecb('0xab')]]){if(this['uniqueId'][_0x4db76b[_0x7ecb('0xd3')]]&&this[_0x7ecb('0x27')][_0x4db76b[_0x7ecb('0xd3')]][_0x7ecb('0x50')]!==_0x7ecb('0x72')){this[_0x7ecb('0xac')](this['voiceQueues'][_0x4db76b[_0x7ecb('0xab')]]);this[_0x7ecb('0x27')][_0x4db76b['uniqueid']][_0x7ecb('0x108')]=moment()[_0x7ecb('0x73')](_0x7ecb('0xfa'));}}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x109')]=function(_0x3dd010){this[_0x7ecb('0xc2')](_0x3dd010)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x106')));this[_0x7ecb('0xc0')](_0x3dd010)['catch'](loggerCatch(_0x7ecb('0x10a')));};Dialer[_0x7ecb('0x1b')]['syncQueueCallerAbandon']=function(_0x2736bc){var _0x521fe5=this[_0x7ecb('0x27')][_0x2736bc['uniqueid']];var _0x16396e=this;if(this[_0x7ecb('0x1f')][_0x2736bc[_0x7ecb('0xab')]]){if(_0x521fe5&&_0x521fe5[_0x7ecb('0x50')]!==_0x7ecb('0x72')){delete this[_0x7ecb('0x27')][_0x2736bc['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2736bc['queue']]);_0x521fe5[_0x7ecb('0x10b')]=moment()['format'](_0x7ecb('0xfa'));var _0x1a823e=new QueueCallerAbandon(_0x521fe5,_0x2736bc);if(getSeconds(_0x521fe5[_0x7ecb('0x10b')],_0x521fe5[_0x7ecb('0x10c')])>=_0x521fe5[_0x7ecb('0x10d')]){this[_0x7ecb('0x1f')][_0x2736bc[_0x7ecb('0xab')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x2736bc['queue']][_0x7ecb('0x5e')]+=0x1;this[_0x7ecb('0x1f')][_0x2736bc['queue']][_0x7ecb('0x10e')]+=0x1;_0x1a823e[_0x7ecb('0xe5')]=0xa;_0x1a823e[_0x7ecb('0xdc')]=_0x7ecb('0x10f');_0x1a823e[_0x7ecb('0x110')]=_0x7ecb('0x111');_0x1a823e[_0x7ecb('0x112')]=this[_0x7ecb('0x1f')][_0x2736bc['queue']]['dialQueueProject2']?moment()[_0x7ecb('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;_0x1a823e[_0x7ecb('0xea')]+=0x1;_0x1a823e[_0x7ecb('0x113')]+=0x1;if(_0x1a823e[_0x7ecb('0xea')]>=this['voiceQueues'][_0x2736bc[_0x7ecb('0xab')]][_0x7ecb('0x114')]){this[_0x7ecb('0x109')](_0x1a823e);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x1a823e[_0x7ecb('0xea')],'scheduledat':moment()['add'](this[_0x7ecb('0x1f')][_0x2736bc[_0x7ecb('0xab')]][_0x7ecb('0x115')],_0x7ecb('0xf3'))[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x521fe5['ContactId'],'ListId':_0x521fe5['ListId'],'VoiceQueueId':_0x521fe5['VoiceQueueId']||undefined,'CampaignId':_0x521fe5[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x116')));var _0x32b0a5=new History(_0x1a823e);_0x32b0a5[_0x7ecb('0xe5')]=0xa;_0x32b0a5[_0x7ecb('0xdc')]=_0x7ecb('0x10f');_0x32b0a5[_0x7ecb('0xa2')]=moment()['format'](_0x7ecb('0xfa'));_0x32b0a5[_0x7ecb('0x117')]=_0x32b0a5['starttime'];_0x32b0a5[_0x7ecb('0x118')]=_0x1a823e[_0x7ecb('0x118')];_0x32b0a5[_0x7ecb('0x119')]=_0x1a823e[_0x7ecb('0x119')];this[_0x7ecb('0xc2')](_0x32b0a5)[_0x7ecb('0xa8')](loggerCatch('[syncAgentComplete][createHistory][10]'));}}else{this[_0x7ecb('0x1f')][_0x2736bc[_0x7ecb('0xab')]][_0x7ecb('0x63')]+=0x1;this[_0x7ecb('0x1f')][_0x2736bc['queue']][_0x7ecb('0x11a')]+=0x1;_0x1a823e[_0x7ecb('0xe5')]=0xb;_0x1a823e['statedesc']=_0x7ecb('0x11b');_0x1a823e[_0x7ecb('0x110')]=_0x7ecb('0x11c');_0x1a823e[_0x7ecb('0x11d')]+=0x1;_0x1a823e['countglobal']+=0x1;if(_0x1a823e['countabandonedretry']>=this[_0x7ecb('0x1f')][_0x2736bc[_0x7ecb('0xab')]][_0x7ecb('0x11e')]){this['queueCallerAbandonCreateState'](_0x1a823e);}else{this[_0x7ecb('0xb9')]({'active':![],'countabandonedretry':_0x1a823e[_0x7ecb('0x11d')],'scheduledat':moment()[_0x7ecb('0xf1')](this['voiceQueues'][_0x2736bc[_0x7ecb('0xab')]][_0x7ecb('0x11f')],'minutes')[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x521fe5[_0x7ecb('0xfb')],'ListId':_0x521fe5[_0x7ecb('0xc9')],'VoiceQueueId':_0x521fe5[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x521fe5[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x120')));var _0x32b0a5=new History(_0x1a823e);_0x32b0a5['state']=0xb;_0x32b0a5[_0x7ecb('0xdc')]='Abandoned';_0x32b0a5[_0x7ecb('0xa2')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x32b0a5['endtime']=_0x32b0a5['starttime'];_0x32b0a5[_0x7ecb('0x118')]=_0x1a823e['calleridname'];_0x32b0a5[_0x7ecb('0x119')]=_0x1a823e['calleridnum'];this[_0x7ecb('0xc2')](_0x32b0a5)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x121')));}}}}};Dialer['prototype'][_0x7ecb('0x36')]=function(_0x44d4ec){if(this[_0x7ecb('0x25')][_0x44d4ec[_0x7ecb('0xd3')]]){this[_0x7ecb('0x25')][_0x44d4ec[_0x7ecb('0xd3')]]['channel']=_0x44d4ec[_0x7ecb('0x122')];}if(this[_0x7ecb('0x27')][_0x44d4ec['uniqueid']]){this[_0x7ecb('0x27')][_0x44d4ec[_0x7ecb('0xd3')]][_0x7ecb('0x122')]=_0x44d4ec[_0x7ecb('0x122')];}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x39')]=function(_0xe624c5){if(strategy[this[_0x7ecb('0x1f')][this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]][_0x7ecb('0xab')]]['strategy']]==='roundrobin'){if(this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]]&&_[_0x7ecb('0xa5')](this['actions'][_0xe624c5[_0x7ecb('0x123')]][_0x7ecb('0x124')])&&_0xe624c5[_0x7ecb('0xa7')]==='1'&&_0xe624c5[_0x7ecb('0x125')]==='0'){if(this[_0x7ecb('0x21')][_0xe624c5[_0x7ecb('0x126')]]){if(!this[_0x7ecb('0x21')][_0xe624c5[_0x7ecb('0x126')]]['locked']){this[_0x7ecb('0x21')][_0xe624c5[_0x7ecb('0x126')]]['locked']=!![];this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]][_0x7ecb('0x124')]=!![];this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]][_0x7ecb('0x126')]=_0xe624c5['stateinterface'];}}}}else if((strategy[this[_0x7ecb('0x1f')][this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]]['queue']][_0x7ecb('0x127')]]||_0x7ecb('0x19'))==='rrmemory'){if(this[_0x7ecb('0x25')][_0xe624c5['actionid']]){if(this['agents'][_0xe624c5[_0x7ecb('0x126')]]){this['actions'][_0xe624c5['actionid']][_0x7ecb('0x126')]=_0xe624c5[_0x7ecb('0x126')];if(_[_0x7ecb('0xa5')](this[_0x7ecb('0x2a')][this[_0x7ecb('0x25')][_0xe624c5['actionid']][_0x7ecb('0xab')]])){this[_0x7ecb('0x2a')][this[_0x7ecb('0x25')][_0xe624c5['actionid']]['queue']]=[];}this[_0x7ecb('0x2a')][this[_0x7ecb('0x25')][_0xe624c5[_0x7ecb('0x123')]]['queue']][_0x7ecb('0x128')](_[_0x7ecb('0x88')](_[_0x7ecb('0xc8')](this[_0x7ecb('0x25')][_0xe624c5['actionid']],[_0x7ecb('0x129'),_0x7ecb('0x126')]),{'status':_0xe624c5[_0x7ecb('0xa7')],'paused':_0xe624c5[_0x7ecb('0x125')]}));}}}};function unlockQueueStatus(_0xd94276,_0xf7399f){setTimeout(function(){if(_[_0x7ecb('0x3d')](_0xd94276[_0x7ecb('0x12a')])){loggerBooked[_0x7ecb('0x8f')](_0x7ecb('0x12b'),_0xf7399f);}_0xd94276[_0x7ecb('0x12a')]=!![];loggerBooked['info'](_0x7ecb('0x12c'),_0xf7399f,JSON['stringify'](_[_0x7ecb('0xc8')](_0xd94276,[_0x7ecb('0x3f'),_0x7ecb('0x12a')])));},0x1f3);}Dialer[_0x7ecb('0x1b')][_0x7ecb('0x3b')]=function(_0x30e5ee){var _0x1a03a0=this;var _0x41d6ce=_0x1a03a0[_0x7ecb('0x1f')][_0x1a03a0['actions'][_0x30e5ee['actionid']]['queue']];if(strategy[this[_0x7ecb('0x1f')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]['queue']][_0x7ecb('0x127')]]===_0x7ecb('0x1a')){if(this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]&&this['actions'][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0x126')]){this[_0x7ecb('0x12d')][_0x7ecb('0x12e')](this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]['idHopper'],this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0x126')])[_0x7ecb('0xa8')](function(_0x3deb43){logger['error'](_0x7ecb('0x12f'),util[_0x7ecb('0x90')](_0x3deb43,{'showHidden':![],'depth':null}));})['finally'](function(){_0x1a03a0['updateOriginated'](_0x1a03a0[_0x7ecb('0x1f')][_0x1a03a0[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]['queue']]);_0x1a03a0[_0x7ecb('0x21')][_0x1a03a0[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0x126')]][_0x7ecb('0x124')]=![];delete _0x1a03a0[_0x7ecb('0x25')][_0x30e5ee['actionid']];unlockQueueStatus(_0x41d6ce);});}else{this[_0x7ecb('0xac')](this[_0x7ecb('0x1f')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]['queue']]);this[_0x7ecb('0xb9')]({'active':![],'ContactId':this['actions'][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xfb')],'ListId':this[_0x7ecb('0x25')][_0x30e5ee['actionid']][_0x7ecb('0xc9')],'VoiceQueueId':this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xcb')]||undefined,'CampaignId':this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x130')));delete this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]];unlockQueueStatus(_0x41d6ce);}}else if((strategy[this['voiceQueues'][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]['queue']][_0x7ecb('0x127')]]||_0x7ecb('0x19'))===_0x7ecb('0x19')){var _0xe1ec31;if(this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]]&&!_[_0x7ecb('0x8d')](this[_0x7ecb('0x2a')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]])){if(this[_0x7ecb('0x2b')][_0x1a03a0[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]]){this[_0x7ecb('0x2b')][_0x1a03a0['actions'][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]]=this[_0x7ecb('0x2b')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]]?this[_0x7ecb('0x2b')][this['actions'][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]]:this[_0x7ecb('0x2a')][this['actions'][_0x30e5ee[_0x7ecb('0x123')]]['queue']]?this[_0x7ecb('0x2a')][this['actions'][_0x30e5ee['actionid']]['queue']]['_rr']||0x0:0x0;}this[_0x7ecb('0x2a')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]][_0x7ecb('0x131')]=this[_0x7ecb('0x2b')][this[_0x7ecb('0x25')][_0x30e5ee[_0x7ecb('0x123')]][_0x7ecb('0xab')]];for(var _0xe71922=0x0;_0xe71922=0x0;})[_0x7ecb('0xa8')](myreject(_0xb63549)));}}else{_0x59c551['push'](ami[_0x7ecb('0xa6')]({'action':_0x7ecb('0x145'),'command':util[_0x7ecb('0x73')](_0x7ecb('0x146'),_0x4469a5,!_[_0x7ecb('0x3d')](config[_0x7ecb('0x148')][_0x59d50c])?_0x59d50c:'')})[_0x7ecb('0xae')](function(_0x474702){return _0x474702[_0x7ecb('0x14b')]['indexOf'](_0x7ecb('0x14a'))>=0x0;})[_0x7ecb('0xa8')](myreject(_0xb63549)));}BPromise[_0x7ecb('0x14c')](_0x59c551)[_0x7ecb('0xae')](function(_0x365458){var _0x272d77=_[_0x7ecb('0x14d')](_0x365458);if(_0x272d77){return _0x1b264c(_0x272d77);}else{_0x2af0ca[_0x7ecb('0x41')]=_0x85a338?_0x7ecb('0x14e'):_0x7ecb('0x14f');return _0xb63549(msgResponse('[ifTime][promiseAll]','Failure',_0x7ecb('0x150')+_0x85a338+'\x20'+_0x5ee8bb+_0x7ecb('0x151')+util[_0x7ecb('0x90')](_0x4469a5,{'showHidden':![],'depth':null})+_0x7ecb('0x152')+_0x59d50c));}})['catch'](function(_0x8d8bcb){return _0xb63549(msgResponse(_0x7ecb('0x140'),_0x7ecb('0x142'),JSON[_0x7ecb('0x47')](_0x8d8bcb)));});});};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x153')]=function(_0x5970c9){var _0xca004d=this;return function(){switch(_0x5970c9[_0x7ecb('0x56')]){case _0x7ecb('0x154'):freeVariablesPredictive(_0x5970c9);_0xca004d['handlePower'](_0x5970c9,0x1);break;case _0x7ecb('0x155'):freeVariablesPredictive(_0x5970c9);_0xca004d[_0x7ecb('0x156')](_0x5970c9,_0x5970c9[_0x7ecb('0x157')]);break;case _0x7ecb('0x8'):_0xca004d[_0x7ecb('0x8')](_0x5970c9);break;case _0x7ecb('0x7'):freeVariablesPredictive(_0x5970c9);_0xca004d[_0x7ecb('0x156')](_0x5970c9,0x1);break;default:freeVariablesPredictive(_0x5970c9);logger[_0x7ecb('0x8f')]('Queue',_0x5970c9[_0x7ecb('0x3f')],'method\x20not\x20recognized');}};};Dialer['prototype'][_0x7ecb('0x158')]=function(_0x2d5192){var _0x173abf=this;return function(){_0x173abf['handleIvr'](_0x2d5192);};};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xa')]=function(_0x27c64a){var _0xe21ab9=this;if(isNotPreview(_0x27c64a[_0x7ecb('0x56')])){if(isVoiceQueueOutbound(_0x27c64a[_0x7ecb('0x50')])&&isActive(_0x27c64a[_0x7ecb('0x55')])){_0x27c64a[_0x7ecb('0x9a')]=!![];BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](checkIsLoggedIn(_0x27c64a,_0x27c64a[_0x7ecb('0x159')]))[_0x7ecb('0xae')](checkIsActive(_0x27c64a,_0x27c64a[_0x7ecb('0x55')]))[_0x7ecb('0xae')](checkInterval(_0x27c64a))[_0x7ecb('0xae')](_0xe21ab9[_0x7ecb('0x13b')](_0x27c64a))[_0x7ecb('0xae')](_0xe21ab9[_0x7ecb('0x13f')](_0x27c64a['dialGlobalInterval'],_0x27c64a[_0x7ecb('0x15a')],_0x27c64a[_0x7ecb('0x3f')],_0x27c64a))[_0x7ecb('0xae')](_0xe21ab9[_0x7ecb('0x141')](_0x27c64a[_0x7ecb('0x40')],_0x27c64a[_0x7ecb('0x15a')],_0x27c64a[_0x7ecb('0x3f')],_0x27c64a))[_0x7ecb('0xae')](_0xe21ab9[_0x7ecb('0x153')](_0x27c64a))[_0x7ecb('0xa8')](loggerCatchQueueSummary(_0x7ecb('0x15b'),_0x27c64a));}else{notSendMessagesQueue(_0x27c64a);}}else{freeVariablesPredictive(_0x27c64a);}};Dialer['prototype'][_0x7ecb('0x13a')]=function(){var _0x2c6d4f=this;var _0x5e136f;for(var _0x38f09c in this[_0x7ecb('0x20')]){if(typeof this[_0x7ecb('0x20')][_0x38f09c]!==_0x7ecb('0x92')){_0x5e136f=this[_0x7ecb('0x20')][_0x38f09c];if(isCampaignIvr(_0x5e136f['type'])&&isActive(_0x5e136f[_0x7ecb('0x6d')])){_0x5e136f[_0x7ecb('0x9a')]=!![];BPromise[_0x7ecb('0xb4')]()[_0x7ecb('0xae')](checkIsActive(_0x5e136f,_0x5e136f['active']))[_0x7ecb('0xae')](checkInterval(_0x5e136f))[_0x7ecb('0xae')](_0x2c6d4f[_0x7ecb('0x13b')](_0x5e136f))[_0x7ecb('0xae')](_0x2c6d4f[_0x7ecb('0x13f')](_0x5e136f['dialGlobalInterval'],_0x5e136f[_0x7ecb('0x15a')],_0x5e136f[_0x7ecb('0x3f')],_0x5e136f))[_0x7ecb('0xae')](_0x2c6d4f[_0x7ecb('0x141')](_0x5e136f[_0x7ecb('0x40')],_0x5e136f[_0x7ecb('0x15a')],_0x5e136f[_0x7ecb('0x3f')],_0x5e136f))[_0x7ecb('0xae')](_0x2c6d4f[_0x7ecb('0x158')](_0x5e136f))[_0x7ecb('0xa8')](loggerCatchQueueSummary(_0x7ecb('0x15c'),_0x5e136f));}else{notSendMessagesCampaign(_0x5e136f);}}}};function getCallerIdRandom(_0x4dc36e,_0x11bd38){var _0x14cdd2;var _0x556562;var _0x2f7949;if(_0x11bd38<=0x0){_0x11bd38=0x1;}_0x14cdd2=new RegExp(_0x7ecb('0x15d')+_0x11bd38+'}$');_0x556562=Math[_0x7ecb('0x15e')](0xa,_0x11bd38-0x1);_0x2f7949=Math[_0x7ecb('0x15e')](0xa,_0x11bd38)-0x1;return util[_0x7ecb('0x73')]('%s',_[_0x7ecb('0x15f')](_0x4dc36e,_0x14cdd2,_[_0x7ecb('0x160')](_0x556562,_0x2f7949)));}function extractCalleridName(_0x311c42){var _0x2c1ed9=_0x311c42[_0x7ecb('0x161')](/"(.*?)"/);return _0x2c1ed9?_0x2c1ed9[0x1]:_0x311c42;}function extractCalleridNumber(_0x5cb05f){var _0x1e0cd8=_0x5cb05f['match'](/<(.*?)>/);return _0x1e0cd8?_0x1e0cd8[0x1]:_0x5cb05f;}Dialer[_0x7ecb('0x1b')][_0x7ecb('0x162')]=function(_0x1a84d1,_0x136664){var _0x35bd63=this;var _0x382698=uuid['v4']();this[_0x7ecb('0x25')][_0x382698]=new Action(_0x1a84d1,_0x136664,_0x382698);return new BPromise(function(_0x4bd53b,_0x144e4c){if(_['isUndefined'](_0x1a84d1)&&typeof _0x1a84d1!==_0x7ecb('0x163')){return _0x144e4c(msgResponse('originate','Failure',_0x7ecb('0x164')));}if(_['isUndefined'](_0x136664[_0x7ecb('0x165')][_0x7ecb('0x166')])||_0x136664[_0x7ecb('0x165')][_0x7ecb('0x166')]===null){return _0x144e4c(msgResponse('originate','Failure',_0x7ecb('0x167')));}var _0x2ce684={'XMD-CALLERID':_0x35bd63[_0x7ecb('0x25')][_0x382698][_0x7ecb('0x168')](),'XMD-AGI':_0x1a84d1[_0x7ecb('0xfe')]?util['format'](_0x7ecb('0x169'),ipAgi,_0x1a84d1['dialQueueProject']):_0x7ecb('0x16a'),'XMD-AGIAFTER':_0x1a84d1[_0x7ecb('0x16b')]?util[_0x7ecb('0x73')]('\x22agi://%s/square,%s\x22',ipAgi,_0x1a84d1[_0x7ecb('0x16b')]):_0x7ecb('0x16a'),'XMD-QUEUE':_0x1a84d1[_0x7ecb('0x50')]==='outbound'?util[_0x7ecb('0x73')]('\x22%s,%s%s,,,%s\x22',_0x1a84d1[_0x7ecb('0x3f')],_0x1a84d1[_0x7ecb('0x16c')]||'',_0x1a84d1[_0x7ecb('0x105')]?'c':'',_0x1a84d1[_0x7ecb('0x10d')]||0x3):_0x7ecb('0x16a'),'XMD-CONTACTID':_0x136664[_0x7ecb('0xfb')],'XMD-CDRTYPE':_0x7ecb('0x5'),'CALLERID(all)':_0x35bd63[_0x7ecb('0x25')][_0x382698][_0x7ecb('0x168')](),'XMD-AMD':_0x1a84d1[_0x7ecb('0xd8')]?_0x7ecb('0x16d'):_0x7ecb('0x16a'),'XMD-DESTINATION':_0x7ecb('0xd7')};if(_0x1a84d1['dialAMDActive']){_0x2ce684[_0x7ecb('0x16e')]=_0x1a84d1[_0x7ecb('0x16f')]||0x9c4;_0x2ce684[_0x7ecb('0x170')]=_0x1a84d1[_0x7ecb('0x171')]||0x5dc;_0x2ce684[_0x7ecb('0x172')]=_0x1a84d1[_0x7ecb('0x173')]||0x320;_0x2ce684[_0x7ecb('0x174')]=_0x1a84d1[_0x7ecb('0x175')]||0x1388;_0x2ce684[_0x7ecb('0x176')]=_0x1a84d1[_0x7ecb('0x177')]||0x64;_0x2ce684[_0x7ecb('0x178')]=_0x1a84d1[_0x7ecb('0x179')]||0x32;_0x2ce684[_0x7ecb('0x17a')]=_0x1a84d1[_0x7ecb('0x17b')]||0x3;_0x2ce684['XMD-AMDSILENCETHRESHOLD']=_0x1a84d1[_0x7ecb('0x17c')]||0x100;_0x2ce684['XMD-AMDMAXIMUMWORDLENGTH']=_0x1a84d1['dialAMDMaximumWordLength']||0x1388;}if(_0x1a84d1['type']===_0x7ecb('0x4b')){_0x2ce684[_0x7ecb('0x17d')]=_0x136664['VoiceQueueId'];}else{_0x2ce684[_0x7ecb('0x17e')]=_0x136664['CampaignId'];}for(var _0x5ed8fc in _0x136664[_0x7ecb('0x165')]){if(typeof _0x136664['Contact'][_0x5ed8fc]!==_0x7ecb('0x92')){if(isNotNull(_0x136664['Contact'][_0x5ed8fc])&&_0x5ed8fc!=='id'&&_0x5ed8fc!=='tags'&&_0x5ed8fc!==_0x7ecb('0x17f')&&_0x5ed8fc!==_0x7ecb('0x180')){_0x2ce684[util[_0x7ecb('0x73')](_0x7ecb('0x181'),_0x7ecb('0x182'),_[_0x7ecb('0x183')](_0x5ed8fc))]=_0x136664[_0x7ecb('0x165')][_0x5ed8fc];}}}var _0x40e9d3=_0x35bd63['isTrunkReachable'](_0x1a84d1[_0x7ecb('0x6c')])?getCallerId(_0x1a84d1[_0x7ecb('0x6c')]['callerid'],_0x1a84d1['dialOriginateCallerIdName'],_0x1a84d1[_0x7ecb('0x184')]>0x0?getCallerIdRandom(_0x1a84d1[_0x7ecb('0x57')],_0x1a84d1[_0x7ecb('0x184')]):_0x1a84d1[_0x7ecb('0x57')]):getCallerId(_[_0x7ecb('0xa5')](_0x1a84d1[_0x7ecb('0x13d')])?_0x1a84d1[_0x7ecb('0x6c')]['callerid']:_0x1a84d1['TrunkBackup'][_0x7ecb('0x6e')],_0x1a84d1[_0x7ecb('0x185')],_0x1a84d1[_0x7ecb('0x184')]>0x0?getCallerIdRandom(_0x1a84d1[_0x7ecb('0x57')],_0x1a84d1[_0x7ecb('0x184')]):_0x1a84d1[_0x7ecb('0x57')]);if(_0x40e9d3){_0x2ce684[_0x7ecb('0x186')]=_0x35bd63[_0x7ecb('0x25')][_0x382698][_0x7ecb('0x187')]=extractCalleridName(_0x40e9d3);_0x2ce684[_0x7ecb('0x188')]=_0x35bd63['actions'][_0x382698][_0x7ecb('0x189')]=extractCalleridNumber(_0x40e9d3);}return ami[_0x7ecb('0xa6')]({'actionid':_0x382698,'action':_0x7ecb('0x18a'),'channel':_0x35bd63['isTrunkReachable'](_0x1a84d1[_0x7ecb('0x6c')])?util[_0x7ecb('0x73')](_0x7ecb('0x18b'),_0x1a84d1[_0x7ecb('0x6c')][_0x7ecb('0x3f')],isNotNull(_0x1a84d1['dialPrefix'])?_0x1a84d1[_0x7ecb('0x18c')][_0x7ecb('0x18d')]()||'':'',_0x1a84d1[_0x7ecb('0x18e')]>0x0?_0x136664[_0x7ecb('0x165')][_0x7ecb('0x166')][_0x7ecb('0x18f')](_0x1a84d1[_0x7ecb('0x18e')]):_0x136664[_0x7ecb('0x165')][_0x7ecb('0x166')]):util[_0x7ecb('0x73')](_0x7ecb('0x18b'),_[_0x7ecb('0xa5')](_0x1a84d1['TrunkBackup'])?_0x1a84d1[_0x7ecb('0x6c')][_0x7ecb('0x3f')]:_0x1a84d1[_0x7ecb('0x13d')][_0x7ecb('0x3f')],isNotNull(_0x1a84d1[_0x7ecb('0x18c')])?_0x1a84d1[_0x7ecb('0x18c')]['trim']()||'':'',_0x1a84d1[_0x7ecb('0x18e')]>0x0?_0x136664['Contact'][_0x7ecb('0x166')][_0x7ecb('0x18f')](_0x1a84d1['dialCutDigit']):_0x136664['Contact'][_0x7ecb('0x166')]),'callerid':_0x40e9d3,'Exten':_0x7ecb('0xd7'),'Context':_0x7ecb('0x190'),'Priority':'1','variable':_0x2ce684,'timeout':(_0x1a84d1[_0x7ecb('0x58')]||0x1e)*0x3e8,'async':!![],'channelid':_0x382698})[_0x7ecb('0xae')](function(_0x18cf54){return _0x4bd53b(_0x18cf54);})[_0x7ecb('0xa8')](function(_0x968921){_0x1a84d1[_0x7ecb('0x191')]+=0x1;var _0x4da947=new History(_0x35bd63[_0x7ecb('0x25')][_0x382698]);logger[_0x7ecb('0x8f')](util[_0x7ecb('0x73')](_0x7ecb('0x192'),JSON[_0x7ecb('0x47')](_0x968921)));_0x4da947[_0x7ecb('0xe5')]=0xe;_0x4da947[_0x7ecb('0xdc')]=_0x7ecb('0x193');_0x4da947[_0x7ecb('0xa2')]=moment()[_0x7ecb('0x73')](_0x7ecb('0xfa'));_0x4da947[_0x7ecb('0x117')]=_0x4da947[_0x7ecb('0xa2')];_0x35bd63['createHistory'](_0x4da947)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x194')));_0x35bd63[_0x7ecb('0xc0')](_0x4da947)['catch'](loggerCatch('[originate][error]'))[_0x7ecb('0x195')](function(){delete _0x35bd63[_0x7ecb('0x25')][_0x382698];return _0x144e4c(msgResponse('originate',_0x7ecb('0x46'),_0x7ecb('0x196')));});});});};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x197')]=function(_0x1aeefd){var _0x1176fe=this[_0x7ecb('0x25')][_0x1aeefd[_0x7ecb('0x123')]];if(_0x1176fe){delete this[_0x7ecb('0x25')][_0x1aeefd[_0x7ecb('0x123')]];_0x1176fe[_0x7ecb('0x10c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x18b42c=_0x1176fe[_0x7ecb('0x50')]===_0x7ecb('0x72')?this[_0x7ecb('0x20')][_0x1176fe[_0x7ecb('0xab')]]:this[_0x7ecb('0x1f')][_0x1176fe[_0x7ecb('0x198')]()];if(!this[_0x7ecb('0x199')](_0x1aeefd[_0x7ecb('0x19a')])){this[_0x7ecb('0xac')](_0x18b42c);return this['callProgressDetecting'](_0x1176fe,_0x18b42c,_0x1aeefd)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x19b')));}this[_0x7ecb('0x27')][_0x1aeefd[_0x7ecb('0xd3')]]=_0x1176fe;}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x19c')]=function(_0x4ff6d4,_0x10aed8,_0x1003a2){var _0x378235=new History(_0x10aed8);if(_0x378235[_0x7ecb('0xf6')]+_0x378235[_0x7ecb('0xf7')]+_0x378235[_0x7ecb('0xf8')]+_0x378235['countnosuchnumberretry']+_0x378235['countdropretry']+_0x378235[_0x7ecb('0x11d')]+_0x378235[_0x7ecb('0xe7')]+_0x378235[_0x7ecb('0xeb')]>=_0x1003a2[_0x7ecb('0xec')]-0x1){return!![];}switch(_0x4ff6d4){case 0x3:if(_0x378235['countnoanswerretry']>=_0x1003a2[_0x7ecb('0x19d')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countnoanswerretry':_0x378235[_0x7ecb('0xf8')]+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2[_0x7ecb('0x19e')],_0x7ecb('0xf3'))['format'](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235['ListId'],'VoiceQueueId':_0x378235[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x378235['CampaignId']||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x19f')));break;case 0x5:if(_0x378235[_0x7ecb('0xf6')]>=_0x1003a2[_0x7ecb('0x1a0')]-0x1){return!![];}this[_0x7ecb('0xb9')]({'active':![],'countbusyretry':_0x378235['countbusyretry']+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2[_0x7ecb('0x1a1')],_0x7ecb('0xf3'))[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235['VoiceQueueId']||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x1a2')));break;case 0x8:if(_0x378235[_0x7ecb('0xf7')]>=_0x1003a2[_0x7ecb('0x1a3')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countcongestionretry':_0x378235[_0x7ecb('0xf7')]+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2[_0x7ecb('0x1a4')],_0x7ecb('0xf3'))[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235['ContactId'],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x378235['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));break;case 0x0:if(_0x378235[_0x7ecb('0xf9')]>=_0x1003a2[_0x7ecb('0x1a5')]-0x1){return!![];}else{this[_0x7ecb('0xb9')]({'active':![],'countnosuchnumberretry':_0x378235['countnosuchnumberretry']+=0x1,'scheduledat':moment()['add'](_0x1003a2['dialNoSuchNumberRetryFrequency'],_0x7ecb('0xf3'))[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235['VoiceQueueId']||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})['catch'](loggerCatch(_0x7ecb('0x1a6')));}break;case 0xa:if(_0x378235['countdropretry']>=_0x1003a2[_0x7ecb('0x114')]-0x1){return!![];}this[_0x7ecb('0xb9')]({'active':![],'countdropretry':_0x378235[_0x7ecb('0xea')]+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2[_0x7ecb('0x115')],'minutes')[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235['VoiceQueueId']||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x116')));break;case 0xb:if(_0x378235[_0x7ecb('0x11d')]>=_0x1003a2[_0x7ecb('0x11e')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x378235['countabandonedretry']+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2['dialAbandonedRetryFrequency'],_0x7ecb('0xf3'))[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})['catch'](loggerCatch(_0x7ecb('0x120')));break;case 0x13:if(_0x378235[_0x7ecb('0xe7')]>=_0x1003a2['dialMachineMaxRetry']-0x1){return!![];}this[_0x7ecb('0xb9')]({'active':![],'countmachineretry':_0x378235[_0x7ecb('0xe7')]+=0x1,'scheduledat':moment()['add'](_0x1003a2['dialMachineRetryFrequency'],'minutes')[_0x7ecb('0x73')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x378235['ContactId'],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xf4')));break;case 0x14:if(_0x378235[_0x7ecb('0xeb')]>=_0x1003a2['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x7ecb('0xb9')]({'active':![],'countagentrejectretry':_0x378235['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x7ecb('0xf1')](_0x1003a2['dialAgentRejectRetryFrequency'],'minutes')[_0x7ecb('0x73')](_0x7ecb('0xfa')),'ContactId':_0x378235[_0x7ecb('0xfb')],'ListId':_0x378235[_0x7ecb('0xc9')],'VoiceQueueId':_0x378235['VoiceQueueId']||undefined,'CampaignId':_0x378235[_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x1a7')));break;default:return!![];}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x1a8')]=function(_0x31d6ea,_0x176c10,_0x1b85c0){var _0x107763=this;var _0x34c315=new History(_0x31d6ea);return new BPromise(function(_0x350028,_0x198c2c){if(_[_0x7ecb('0x3d')](_0x176c10)&&typeof _0x176c10!=='object'){return _0x198c2c(msgResponse(_0x7ecb('0x1a9'),'Failure',_0x7ecb('0x1aa')));}if(_[_0x7ecb('0x3d')](_0x1b85c0)&&typeof _0x1b85c0!==_0x7ecb('0x163')){return _0x198c2c(msgResponse(_0x7ecb('0x1a9'),_0x7ecb('0x142'),_0x7ecb('0x1ab')));}switch(_0x1b85c0[_0x7ecb('0x103')]){case'0':_0x176c10[_0x7ecb('0x1ac')]+=0x1;_0x34c315[_0x7ecb('0xe5')]=0x0;_0x34c315[_0x7ecb('0xdc')]='NoSuchNumber';_0x34c315[_0x7ecb('0xf9')]+=0x1;_0x34c315['countglobal']+=0x1;ami[_0x7ecb('0xe8')](_0x7ecb('0x1ad'),ut[_0x7ecb('0xe1')](_0x31d6ea,_0x7ecb('0x1ae')));_0x107763[_0x7ecb('0xc2')](_0x34c315)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0xe9')));if(_0x107763[_0x7ecb('0x19c')](0x0,_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0xf9')]>=_0x176c10[_0x7ecb('0x1a5')]){_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1af'));}else{_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1af'));}}break;case'3':_0x176c10['outboundNoAnswerCallsDay']+=0x1;_0x34c315['state']=0x3;_0x34c315[_0x7ecb('0xdc')]=_0x7ecb('0x1b0');_0x34c315['countnoanswerretry']+=0x1;_0x34c315[_0x7ecb('0x113')]+=0x1;ami[_0x7ecb('0xe8')]('custom:agentnoanswer',ut[_0x7ecb('0xe1')](_0x31d6ea,_0x7ecb('0x1b1')));_0x107763[_0x7ecb('0xc2')](_0x34c315)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x1b2')));if(_0x107763[_0x7ecb('0x19c')](0x3,_0x31d6ea,_0x176c10)){if(_0x34c315['countnoanswerretry']>=_0x176c10[_0x7ecb('0x19d')]){_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1b3'));}else{_0x107763['stateGlobal'](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1b3'));}}break;case'5':_0x176c10[_0x7ecb('0x5b')]+=0x1;_0x34c315[_0x7ecb('0xe5')]=0x5;_0x34c315['statedesc']=_0x7ecb('0x1b4');_0x34c315[_0x7ecb('0xf6')]+=0x1;_0x34c315[_0x7ecb('0x113')]+=0x1;ami[_0x7ecb('0xe8')](_0x7ecb('0x1b5'),ut[_0x7ecb('0xe1')](_0x31d6ea,'busy'));_0x107763[_0x7ecb('0xc2')](_0x34c315)[_0x7ecb('0xa8')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x107763[_0x7ecb('0x19c')](0x5,_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0xf6')]>=_0x176c10[_0x7ecb('0x1a0')]){_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1b6'));}else{_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,'reason\x205\x20busy');}}break;case'8':_0x176c10[_0x7ecb('0x5c')]+=0x1;_0x34c315[_0x7ecb('0xe5')]=0x8;_0x34c315[_0x7ecb('0xdc')]=_0x7ecb('0x1b7');_0x34c315['countcongestionretry']+=0x1;_0x34c315[_0x7ecb('0x113')]+=0x1;ami['emit'](_0x7ecb('0x1b8'),ut['buildObj'](_0x31d6ea,_0x7ecb('0x1b9')));_0x107763['createHistory'](_0x34c315)[_0x7ecb('0xa8')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x107763[_0x7ecb('0x19c')](0x8,_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0xf7')]>=_0x176c10['dialCongestionMaxRetry']){_0x107763['createStateFinal'](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1ba'));}else{_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,'reason\x208\x20congestion');}}break;case'11':_0x176c10[_0x7ecb('0x1bb')]+=0x1;_0x34c315[_0x7ecb('0xe5')]=0xb;_0x34c315[_0x7ecb('0xdc')]=_0x7ecb('0x11b');_0x34c315[_0x7ecb('0x11d')]+=0x1;_0x34c315['countglobal']+=0x1;_0x107763['createHistory'](_0x34c315)['catch'](loggerCatch(_0x7ecb('0x121')));if(_0x107763[_0x7ecb('0x19c')](0xb,_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0x11d')]>=_0x176c10['dialAbandonedMaxRetry']){_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1bc'));}else{_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1bc'));}}break;case'20':_0x176c10['outboundRejectCallsDay']+=0x1;_0x34c315['state']=0x14;_0x34c315[_0x7ecb('0xdc')]=_0x7ecb('0x1bd');_0x34c315[_0x7ecb('0xeb')]+=0x1;_0x34c315[_0x7ecb('0x113')]+=0x1;ami['emit'](_0x7ecb('0x1be'),ut[_0x7ecb('0xe1')](_0x31d6ea,_0x7ecb('0x1bf')));_0x107763[_0x7ecb('0xc2')](_0x34c315)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x1c0')));if(_0x107763[_0x7ecb('0x19c')](0x14,_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0xeb')]>=_0x176c10[_0x7ecb('0x1c1')]){_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,'reason\x2020\x20agentreject');}else{_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,_0x7ecb('0x1c2'));}}break;default:_0x176c10[_0x7ecb('0x62')]+=0x1;_0x34c315[_0x7ecb('0xe5')]=0xc;_0x34c315[_0x7ecb('0xdc')]=_0x1b85c0['reason'];_0x107763[_0x7ecb('0xc2')](_0x34c315)[_0x7ecb('0xa8')](loggerCatch(_0x7ecb('0x1c3')));if(_0x107763[_0x7ecb('0x19c')](_0x1b85c0[_0x7ecb('0x103')],_0x31d6ea,_0x176c10)){if(_0x34c315[_0x7ecb('0xf6')]+_0x34c315['countcongestionretry']+_0x34c315[_0x7ecb('0xf8')]+_0x34c315['countnosuchnumberretry']+_0x34c315[_0x7ecb('0xea')]+_0x34c315['countabandonedretry']+_0x34c315[_0x7ecb('0xe7')]+_0x34c315[_0x7ecb('0xeb')]>=_0x176c10[_0x7ecb('0xec')]){_0x107763[_0x7ecb('0xed')](_0x34c315,_0x350028,_0x198c2c,_0x1b85c0['reason']);}else{_0x107763[_0x7ecb('0xf0')](_0x34c315,_0x350028,_0x198c2c,_0x1b85c0[_0x7ecb('0x103')]);}}}});};Dialer[_0x7ecb('0x1b')]['stateGlobal']=function(_0x50632c,_0x4e8c94,_0x5b064d,_0x48a559){var _0x7f0da8=new Final(_0x50632c);_0x7f0da8[_0x7ecb('0xe5')]=0xf;_0x7f0da8['statedesc']=_0x7ecb('0x1c4');this[_0x7ecb('0xf0')](_0x7f0da8,_0x4e8c94,_0x5b064d,_0x48a559);};Dialer[_0x7ecb('0x1b')][_0x7ecb('0xf0')]=function(_0x4304d9,_0x58eaee,_0x348e1f,_0x1c9466){this[_0x7ecb('0xc0')](_0x4304d9)[_0x7ecb('0xae')](function(){return _0x58eaee(msgResponse(_0x7ecb('0x1a9'),_0x7ecb('0xce'),_0x1c9466));})[_0x7ecb('0xa8')](function(){return _0x348e1f(msgResponse(_0x7ecb('0x1c5'),'Failure',_0x7ecb('0x1c6')));});};Dialer['prototype']['predictive']=function(_0x14d324){var _0x1b1295=_0x14d324[_0x7ecb('0x1c7')]/0x64;var _0x458c77=_0x14d324[_0x7ecb('0x5e')]/(_0x14d324[_0x7ecb('0x5e')]+_0x14d324[_0x7ecb('0x59')]);var _0x35ed8b=Math[_0x7ecb('0x1c8')](_0x14d324[_0x7ecb('0x68')]*(_0x14d324[_0x7ecb('0x1c9')]/0x64));var _0xb04141=Math[_0x7ecb('0x1c8')](_0x14d324[_0x7ecb('0x68')]*(_0x14d324[_0x7ecb('0x1ca')]/0x64));var _0x18c4bd=_0x14d324[_0x7ecb('0x4d')]+_0x14d324[_0x7ecb('0x1cb')];var _0x2b2658=Math[_0x7ecb('0x1cc')](_0x14d324[_0x7ecb('0x1cd')]*_0x14d324[_0x7ecb('0x86')]*_0x14d324[_0x7ecb('0x66')]*_0x14d324['predictiveIntervalMultiplicativeFactor']);if(_[_0x7ecb('0x3d')](_0x14d324[_0x7ecb('0x29')])){if(!_[_0x7ecb('0x3d')](_0x14d324[_0x7ecb('0x28')])){_0x14d324[_0x7ecb('0x28')]=undefined;loggerPredictive[_0x7ecb('0x8f')](_0x7ecb('0x1ce'),_0x7ecb('0x1cf'));}if(!_[_0x7ecb('0x3d')](_0x14d324[_0x7ecb('0x8a')])){loggerPredictive[_0x7ecb('0x8f')](_0x7ecb('0x1ce'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x14d324[_0x7ecb('0x8a')]);_0x14d324[_0x7ecb('0x8a')]=undefined;}_0x14d324[_0x7ecb('0x29')]=moment()[_0x7ecb('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x7ecb('0x76')](_0x14d324[_0x7ecb('0x3f')],'collection\x20data\x20in\x20progressive\x20at',_0x14d324[_0x7ecb('0x29')]);this[_0x7ecb('0x156')](_0x14d324,0x1);}else if(ifInterval(_0x14d324[_0x7ecb('0x1d0')],_0x14d324['startProgressive'])){this[_0x7ecb('0x156')](_0x14d324,0x1);loggerPredictiveCalls[_0x7ecb('0x76')](_0x7ecb('0x1d1'),_0x14d324[_0x7ecb('0x29')],_0x14d324[_0x7ecb('0x3f')]);_0x14d324['erlangCalls']=0x0;_0x14d324[_0x7ecb('0x10e')]=0x0;}else if(_0x1b1295<_0x458c77&&_0x14d324[_0x7ecb('0x1d2')]===_0x7ecb('0x1d3')){freeVariablesPredictive(_0x14d324);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x1d4'),'Dropped\x20calls\x20day',_0x458c77,_0x7ecb('0x29'),_0x14d324['name']);}else if(_0x2b2658<_0x14d324[_0x7ecb('0x10e')]&&_0x14d324[_0x7ecb('0x1d2')]===_0x7ecb('0x1d3')){freeVariablesPredictive(_0x14d324);loggerPredictive['info'](_0x7ecb('0x1d5'),'Max\x20Drop\x20',_0x2b2658,_0x7ecb('0x1d6'),_0x14d324[_0x7ecb('0x10e')],_0x7ecb('0x29'),_0x14d324[_0x7ecb('0x3f')]);}else if(!ifInterval(_0x14d324[_0x7ecb('0x1d0')],_0x14d324['startProgressive'])&&_[_0x7ecb('0x3d')](_0x14d324[_0x7ecb('0x28')])&&!_[_0x7ecb('0x3d')](_0x14d324['startProgressive'])){_0x14d324[_0x7ecb('0x28')]=moment()[_0x7ecb('0x73')](_0x7ecb('0xfa'));loggerPredictive[_0x7ecb('0x76')](_0x14d324['name'],_0x7ecb('0x1d7'),_0x14d324['startPredictive']);this[_0x7ecb('0xb6')](_0x14d324['dialPredictiveInterval'])[_0x7ecb('0xae')](this[_0x7ecb('0x1d8')](_0x14d324))[_0x7ecb('0xae')](mergeDataErlangB(_0x14d324))['then'](this[_0x7ecb('0x1d9')](_0x14d324))['catch'](loggerCatchPredictive(_0x7ecb('0x1da'),_0x14d324));}else if(!ifInterval(_0x14d324[_0x7ecb('0x1d0')],_0x14d324[_0x7ecb('0x28')])){_0x14d324[_0x7ecb('0x10e')]=0x0;_0x14d324[_0x7ecb('0x28')]=moment()[_0x7ecb('0x73')](_0x7ecb('0xfa'));loggerPredictive[_0x7ecb('0x76')](_0x14d324[_0x7ecb('0x3f')],_0x7ecb('0x1db'),_0x14d324[_0x7ecb('0x28')]);clearInterval(_0x14d324[_0x7ecb('0x8a')]);_0x14d324[_0x7ecb('0x8a')]=undefined;this[_0x7ecb('0xb6')](_0x14d324[_0x7ecb('0x1d0')])[_0x7ecb('0xae')](this[_0x7ecb('0x1d8')](_0x14d324))[_0x7ecb('0xae')](mergeDataErlangB(_0x14d324))[_0x7ecb('0xae')](this[_0x7ecb('0x1d9')](_0x14d324))[_0x7ecb('0xa8')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x14d324));}else if(_0x14d324[_0x7ecb('0x68')]&&_0x18c4bd<_0x14d324['predictiveIntervalAvailable']-_0xb04141){freeVariablesPredictive(_0x14d324);loggerPredictive[_0x7ecb('0x76')](_0x14d324[_0x7ecb('0x3f')],_0x7ecb('0x1dc'),_0x18c4bd,_0x7ecb('0x1dd'),_0x14d324[_0x7ecb('0x68')],'-',_0xb04141,'=',_0x14d324[_0x7ecb('0x68')]-_0xb04141,')');}else if(_0x14d324[_0x7ecb('0x68')]&&_0x18c4bd>_0x14d324[_0x7ecb('0x68')]+_0x35ed8b){freeVariablesPredictive(_0x14d324);loggerPredictive['info'](_0x14d324[_0x7ecb('0x3f')],_0x7ecb('0x1dc'),_0x18c4bd,_0x7ecb('0x1de'),_0x14d324[_0x7ecb('0x68')],'+',_0x35ed8b,'=',_0x14d324['predictiveIntervalAvailable']+_0x35ed8b,')');}};Dialer['prototype'][_0x7ecb('0x1d8')]=function(_0x2bf4c7){var _0x2b75d2=this;return function(_0x18e4fd){return new BPromise(function(_0x534d80,_0x5d7462){_[_0x7ecb('0x88')](_0x2bf4c7,_0x18e4fd[0x0]);if(checkGetDataPredictive(_0x18e4fd[0x0])){var _0x14f486=_0x2bf4c7[_0x7ecb('0x68')]=_0x2bf4c7[_0x7ecb('0x1cb')]+_0x2bf4c7[_0x7ecb('0x4d')];var _0x47fea3=_0x2bf4c7[_0x7ecb('0x1d0')]*0x3c;var _0x558a6a=_0x18e4fd[0x0][_0x7ecb('0x7d')]+_0x18e4fd[0x0][_0x7ecb('0x7c')];var _0x114dc6=(_0x18e4fd[0x0][_0x7ecb('0x7a')]+_0x18e4fd[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x18e4fd[0x0][_0x7ecb('0x63')])/_0x18e4fd[0x0]['predictiveIntervalTotalCalls'];_0x2bf4c7[_0x7ecb('0x66')]=_0x114dc6>0x0?_0x114dc6:0x1;switch(_0x2bf4c7[_0x7ecb('0x1d2')]){case'dropRate':var _0x47f416=_0x2bf4c7[_0x7ecb('0x1c7')]/0x64;return _0x2b75d2[_0x7ecb('0x1df')](_0x14f486,_0x47fea3,_0x558a6a,_0x114dc6,_0x47f416)[_0x7ecb('0xae')](function(_0x5ec263){return _0x534d80(_0x5ec263);});case'agentBusyFactor':var _0x457728=_0x2bf4c7[_0x7ecb('0x1c7')]/0x64;return _0x2b75d2['busyFactor'](_0x14f486,_0x47fea3,_0x558a6a,_0x114dc6,_0x457728)[_0x7ecb('0xae')](function(_0x21f900){return _0x534d80(_0x21f900);});default:return _0x5d7462(msgResponse(_0x7ecb('0x1e0'),'Failure',_0x7ecb('0x1e1')));}}else{return _0x5d7462(msgResponse('[getDataPredictive]','Failure',_0x7ecb('0x1e2')));}});};};Dialer[_0x7ecb('0x1b')]['getDataPredictiveOld']=function(_0x3467c3){var _0x4e6dae=this;return function(_0x1b9554){return new BPromise(function(_0x361155,_0x5abcd9){_[_0x7ecb('0x88')](_0x3467c3,_0x1b9554[0x0]);if(checkGetDataPredictive(_0x1b9554[0x0])){loggerPredictive['info'](JSON['stringify'](_0x1b9554[0x0]));if(_0x3467c3[_0x7ecb('0x1d2')]==='dropRate'){return _0x4e6dae[_0x7ecb('0xbe')](_0x3467c3['id'])['then'](function(_0x4fb1f9){var _0x4d393e=_0x3467c3[_0x7ecb('0x159')]-_0x4fb1f9[0x0][_0x7ecb('0x1e3')];var _0x26506a=_0x3467c3['dialPredictiveInterval']*0x3c;var _0x5490ef=_0x1b9554[0x0]['predictiveIntervalAvgTalktime']+_0x1b9554[0x0][_0x7ecb('0x7c')];var _0x3fda64=(_0x1b9554[0x0][_0x7ecb('0x7a')]+_0x1b9554[0x0][_0x7ecb('0x64')]+_0x1b9554[0x0][_0x7ecb('0x63')])/_0x1b9554[0x0][_0x7ecb('0x69')];var _0x52f9e9=_0x3467c3['dialPredictiveOptimizationPercentage']/0x64;_0x3467c3[_0x7ecb('0x1e4')]=_0x4fb1f9[0x0][_0x7ecb('0x1e3')]||0x0;_0x3467c3[_0x7ecb('0x66')]=_0x3fda64>0x0?_0x3fda64:0x1;return _0x4e6dae[_0x7ecb('0x1df')](_0x4d393e,_0x26506a,_0x5490ef,_0x3fda64,_0x52f9e9);})[_0x7ecb('0xae')](function(_0x5b244b){return _0x361155(_0x5b244b);})[_0x7ecb('0xa8')](function(_0xa076a0){return _0x5abcd9(msgResponse(_0x7ecb('0x1e5'),_0x7ecb('0x142'),JSON[_0x7ecb('0x47')](_0xa076a0)));});}if(_0x3467c3[_0x7ecb('0x1d2')]==='agentBusyFactor'){return _0x4e6dae['getVoiceQueueRtPauses'](_0x3467c3['id'])[_0x7ecb('0xae')](function(_0x368ec5){var _0x4c3c51=_0x3467c3[_0x7ecb('0x159')]-_0x368ec5[0x0][_0x7ecb('0x1e3')];var _0x480b85=_0x3467c3[_0x7ecb('0x1d0')]*0x3c;var _0x29ed98=_0x1b9554[0x0][_0x7ecb('0x7d')]+_0x1b9554[0x0]['predictiveIntervalAvgHoldtime'];var _0x505b49=(_0x1b9554[0x0][_0x7ecb('0x7a')]+_0x1b9554[0x0][_0x7ecb('0x64')]+_0x1b9554[0x0][_0x7ecb('0x63')])/_0x1b9554[0x0][_0x7ecb('0x69')];var _0x53ee9b=_0x3467c3[_0x7ecb('0x1c7')]/0x64;_0x3467c3[_0x7ecb('0x1e4')]=_0x368ec5[0x0][_0x7ecb('0x1e3')]||0x0;_0x3467c3[_0x7ecb('0x66')]=_0x505b49>0x0?_0x505b49:0x1;return _0x4e6dae['busyFactor'](_0x4c3c51,_0x480b85,_0x29ed98,_0x505b49,_0x53ee9b);})[_0x7ecb('0xae')](function(_0x5473fb){return _0x361155(_0x5473fb);})[_0x7ecb('0xa8')](function(_0x488b73){return _0x5abcd9(msgResponse(_0x7ecb('0x1e5'),'Failure',JSON['stringify'](_0x488b73)));});}}else{return _0x5abcd9(msgResponse('[getDataPredictive]','Failure','check\x20failure'));}});};};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x1d9')]=function(_0xb69409){var _0x2942e1=this;return function(){var _0x47fec1=0x0;var _0x11795e=Math[_0x7ecb('0x1cc')](_0xb69409[_0x7ecb('0x1e6')]*0x3e8);if(_0x11795e>0x0){_0x11795e=_0x11795e<0x64?0x64:_0x11795e;loggerPredictive['info'](_0xb69409['name'],_0x7ecb('0x1e7'),_0x11795e,_0x7ecb('0x48'));_0xb69409['handlePredictive']=setInterval(function(){_0x2942e1[_0x7ecb('0x8a')](_0xb69409);loggerPredictiveCalls[_0x7ecb('0x76')]('[handlePredictive]',_0x47fec1+=0x1);},_0x11795e);}else{loggerPredictive[_0x7ecb('0x76')](_0xb69409[_0x7ecb('0x3f')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x1e8')]=function(_0xd11894,_0x91e68a){var _0x5968be=this;return function(_0x4a4532){if(_['isEmpty'](_0x4a4532)){if(_[_0x7ecb('0xa5')](_0x91e68a[_0x7ecb('0xca')])||!_0x91e68a[_0x7ecb('0x1e9')]){if(_0xd11894[_0x7ecb('0x56')]===_0x7ecb('0x7')){_0xd11894[_0x7ecb('0x12a')]=_[_0x7ecb('0x3d')](_0xd11894[_0x7ecb('0x12a')])?!![]:_0xd11894[_0x7ecb('0x12a')];var _0x288c38=uuid['v4']();_0x5968be[_0x7ecb('0x25')][_0x288c38]=new Action(_0xd11894,_0x91e68a,_0x288c38);loggerBooked[_0x7ecb('0x76')](_0x7ecb('0x1ea'),_0x288c38,'queueStatusComplete:\x20',JSON['stringify'](_0xd11894['queueStatusComplete']),'Queue:\x20',_0xd11894[_0x7ecb('0x3f')]);if(_0xd11894[_0x7ecb('0x12a')]){_0xd11894['queueStatusComplete']=![];_0x5968be[_0x7ecb('0x2a')][_0x5968be['actions'][_0x288c38][_0x7ecb('0xab')]]=[];ami['Action']({'actionid':_0x288c38,'action':_0x7ecb('0x1eb'),'queue':_0xd11894[_0x7ecb('0x3f')]})['catch'](function(){_0x5968be[_0x7ecb('0xac')](_0xd11894);_0x5968be[_0x7ecb('0xb9')]({'active':![],'ContactId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xfb')],'ListId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xc9')],'VoiceQueueId':_0x5968be['actions'][_0x288c38]['VoiceQueueId']||undefined,'CampaignId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xcc')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5968be[_0x7ecb('0x25')][_0x288c38];});}else{loggerBooked[_0x7ecb('0x76')]('[booked][checkContactBlack][else]',JSON[_0x7ecb('0x47')](_0xd11894[_0x7ecb('0x12a')]),_0x7ecb('0x1ec'),_0xd11894[_0x7ecb('0x3f')]);_0x5968be[_0x7ecb('0xac')](_0xd11894);_0x5968be['rescheduleContact']({'active':![],'ContactId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xfb')],'ListId':_0x5968be['actions'][_0x288c38][_0x7ecb('0xc9')],'VoiceQueueId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xcb')]||undefined,'CampaignId':_0x5968be[_0x7ecb('0x25')][_0x288c38][_0x7ecb('0xcc')]||undefined})[_0x7ecb('0xa8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5968be[_0x7ecb('0x25')][_0x288c38];}}else{return _0x5968be[_0x7ecb('0x162')](_0xd11894,_0x91e68a);}}else{if(getDiff(_0x91e68a[_0x7ecb('0x1ed')])<_0xd11894[_0x7ecb('0x1ee')]*0x3c){if(_0x91e68a[_0x7ecb('0x1ef')]&&!_0x91e68a[_0x7ecb('0x1ef')][_0x7ecb('0x1f0')]){_0x5968be[_0x7ecb('0x12d')][_0x7ecb('0x12e')](_0x91e68a['id'])[_0x7ecb('0x195')](function(){_0x5968be['updateOriginated'](_0xd11894);});}else{_0x5968be[_0x7ecb('0xba')]({'active':![]},_0x91e68a['id'],0x1)[_0x7ecb('0x195')](function(){_0x5968be[_0x7ecb('0xac')](_0xd11894);});}}else{_0xd11894[_0x7ecb('0x60')]+=0x1;_0x5968be[_0x7ecb('0xac')](_0xd11894);if(_0xd11894[_0x7ecb('0x1f1')]){_0x5968be[_0x7ecb('0xb9')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x91e68a['ContactId'],'ListId':_0x91e68a[_0x7ecb('0xc9')],'VoiceQueueId':_0x91e68a[_0x7ecb('0xcb')]||undefined,'CampaignId':_0x91e68a[_0x7ecb('0xcc')]||undefined})['catch'](loggerCatch(_0x7ecb('0x1f2')));_0x5968be['createHistory'](createObjHistory(_0xd11894,_0x91e68a,_0x7ecb('0x1f3'),0x17,'RecallInQueue'))['catch'](loggerCatch(_0x7ecb('0x1f4')));}else{_0x5968be[_0x7ecb('0xd1')](createObjHistory(_0xd11894,_0x91e68a,'RECALLFAILEDTIMEOUT',0x16,_0x7ecb('0x1f5')),_0x7ecb('0x1f6'),_0x7ecb('0x1f7'));}}}}else{_0xd11894[_0x7ecb('0x5a')]+=0x1;_0x5968be[_0x7ecb('0xd1')](createObjHistory(_0xd11894,_0x91e68a,_0x7ecb('0x1f8'),0xd,_0x7ecb('0x1f9')),'[Originate][historyBlacklist]',_0x7ecb('0x1fa'));throw _0x7ecb('0x1fb');}};};Dialer[_0x7ecb('0x1b')]['handleIvr']=function(_0x19c5a3){var _0x5c83d6=this;var _0x22e81e=_0x19c5a3[_0x7ecb('0x1fc')]-_0x19c5a3[_0x7ecb('0x6a')]-_0x19c5a3[_0x7ecb('0xbc')];emitCampaignSummary(_0x19c5a3);if(_0x22e81e>0x0){if(_0x22e81e>this['maxNumberOriginate']){_0x22e81e=this[_0x7ecb('0x23')];}_0x19c5a3['temp']+=_0x22e81e;this[_0x7ecb('0xbd')](_0x19c5a3['id'],_0x22e81e,_0x19c5a3['dialOrderByScheduledAt'],_0x19c5a3)['then'](function(_0x2f9ab1){_0x19c5a3[_0x7ecb('0xbc')]-=_0x22e81e;_0x19c5a3[_0x7ecb('0xbc')]=_0x19c5a3[_0x7ecb('0xbc')]>0x0?_0x19c5a3[_0x7ecb('0xbc')]:0x0;if(!checkContactEmpty(_0x2f9ab1)){_0x19c5a3[_0x7ecb('0x41')]=_0x7ecb('0x98');logger[_0x7ecb('0x76')](_0x7ecb('0x1fd')+_0x19c5a3[_0x7ecb('0x3f')]);}else{_0x19c5a3[_0x7ecb('0x6a')]+=_0x2f9ab1['length'];_0x19c5a3[_0x7ecb('0x41')]=_0x7ecb('0x1fe');for(var _0x233cf2=0x0;_0x233cf2<_0x2f9ab1[_0x7ecb('0x91')];_0x233cf2+=0x1){_0x19c5a3['ivrTotalCallsDays']+=0x1;if(_[_0x7ecb('0xa5')](_0x2f9ab1[_0x233cf2])||_[_0x7ecb('0xa5')](_0x2f9ab1[_0x233cf2]['Contact'])||_[_0x7ecb('0xa5')](_0x2f9ab1[_0x233cf2][_0x7ecb('0x165')][_0x7ecb('0x166')])){_0x5c83d6[_0x7ecb('0xc6')](_0x7ecb('0x1ff'),_0x19c5a3,_0x2f9ab1[_0x233cf2]);}else{_0x5c83d6['checkIsBlackListIvr'](_[_0x7ecb('0xc8')](_0x2f9ab1[_0x233cf2],['CampaignId','Contact.phone']))[_0x7ecb('0xae')](_0x5c83d6['checkContactBlack'](_0x19c5a3,_0x2f9ab1[_0x233cf2]))[_0x7ecb('0xa8')](_0x5c83d6[_0x7ecb('0x200')](_0x7ecb('0x201'),_0x19c5a3));}}}})[_0x7ecb('0xa8')](loggerGetContactDialer(_0x7ecb('0x202'),_0x19c5a3,_0x22e81e));}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x156')]=function(_0x1dd479,_0x1dcca4){var _0x2c2d0d=this;var _0x28d559=[];var _0x4ea47f=_0x1dcca4>=0x1?_0x1dcca4:0x1;if(_0x1dd479[_0x7ecb('0x56')]===_0x7ecb('0x7')){_0x4ea47f=0x1;}var _0x1f97ee=Math[_0x7ecb('0x1cc')](_0x1dd479[_0x7ecb('0x4d')]*_0x4ea47f)-_0x1dd479[_0x7ecb('0x6a')]-_0x1dd479[_0x7ecb('0xbc')];emitVoiceQueueSummary(_0x1dd479);if(_0x1dd479[_0x7ecb('0x203')]>0x0){var _0x11dd4a=_0x1dd479[_0x7ecb('0x203')]-_0x1dd479[_0x7ecb('0x6a')]-_0x1dd479['talking']-_0x1dd479[_0x7ecb('0xbc')]-_0x1dd479[_0x7ecb('0x9b')];if(_0x1f97ee>_0x11dd4a){_0x1f97ee=_0x11dd4a;}}if(_0x1f97ee>0x0){if(_0x1dd479['dialMethod']===_0x7ecb('0x7')){_0x1f97ee=0x1;}if(_0x1f97ee>this[_0x7ecb('0x23')]){_0x1f97ee=this[_0x7ecb('0x23')];}_0x1dd479[_0x7ecb('0xbc')]+=_0x1f97ee;for(var _0x252a5a in this[_0x7ecb('0x21')]){if(typeof this[_0x7ecb('0x21')][_0x252a5a]!==_0x7ecb('0x92')){if(this[_0x7ecb('0x21')][_0x252a5a][_0x7ecb('0xe5')]===_0x7ecb('0x204')&&this[_0x7ecb('0x21')][_0x252a5a][_0x7ecb('0xa7')]===_0x7ecb('0x205')){_0x28d559[_0x7ecb('0x128')](this['agents'][_0x252a5a]['id']);}}}this[_0x7ecb('0xbb')](_0x1dd479['id'],_0x28d559,_0x1f97ee,_0x1dd479['dialOrderByScheduledAt'],_0x1dd479)[_0x7ecb('0xae')](function(_0x529c1b){_0x1dd479[_0x7ecb('0xbc')]-=_0x1f97ee;_0x1dd479['temp']=_0x1dd479[_0x7ecb('0xbc')]>0x0?_0x1dd479[_0x7ecb('0xbc')]:0x0;if(!checkContactEmpty(_0x529c1b)){_0x2c2d0d['countReScheduled'](_0x1dd479)[_0x7ecb('0xae')](sendMessageReschedule(_0x1dd479))[_0x7ecb('0xa8')](loggerCatch('[countReScheduled]\x20'));}else{_0x1dd479[_0x7ecb('0x6a')]+=_0x529c1b[_0x7ecb('0x91')];_0x1dd479[_0x7ecb('0x41')]=_0x1dd479[_0x7ecb('0x56')]==='booked'?_0x7ecb('0x16d'):_0x7ecb('0x1fe');for(var _0x12340b=0x0;_0x12340b<_0x529c1b[_0x7ecb('0x91')];_0x12340b+=0x1){if(_['isNil'](_0x529c1b[_0x12340b])||_[_0x7ecb('0xa5')](_0x529c1b[_0x12340b][_0x7ecb('0x165')])||_[_0x7ecb('0xa5')](_0x529c1b[_0x12340b][_0x7ecb('0x165')][_0x7ecb('0x166')])){_0x2c2d0d[_0x7ecb('0xc6')](_0x7ecb('0x1ff'),_0x1dd479,_0x529c1b[_0x12340b]);}else{_0x2c2d0d[_0x7ecb('0xb1')](_[_0x7ecb('0xc8')](_0x529c1b[_0x12340b],[_0x7ecb('0xcb'),_0x7ecb('0x206')]))[_0x7ecb('0xae')](_0x2c2d0d[_0x7ecb('0x1e8')](_0x1dd479,_0x529c1b[_0x12340b]))[_0x7ecb('0xa8')](_0x2c2d0d[_0x7ecb('0x200')](_0x7ecb('0x1ff'),_0x1dd479));}}}})['catch'](loggerGetContactDialer('[getContactDialer2]',_0x1dd479,_0x1f97ee));}};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x8a')]=function(_0x2661d5){if(_0x2661d5[_0x7ecb('0x203')]>0x0){var _0x39fb50=_0x2661d5[_0x7ecb('0x203')]-_0x2661d5[_0x7ecb('0x6a')]-_0x2661d5[_0x7ecb('0x1cb')];if(_0x39fb50>0x0){this['tryOriginatePredictive'](_0x2661d5);}else{loggerPredictiveCalls[_0x7ecb('0x76')]('[handlePredictive][limitChannel]');}}else{this[_0x7ecb('0x207')](_0x2661d5);}};Dialer[_0x7ecb('0x1b')]['tryOriginatePredictive']=function(_0x12c94b){var _0x9cd673=this;var _0x19c7c4=[];_0x12c94b[_0x7ecb('0x6a')]+=0x1;for(var _0x3e8e96 in this['agents']){if(typeof this['agents'][_0x3e8e96]!==_0x7ecb('0x92')){if(this[_0x7ecb('0x21')][_0x3e8e96]['state']===_0x7ecb('0x204')&&this[_0x7ecb('0x21')][_0x3e8e96][_0x7ecb('0xa7')]===_0x7ecb('0x205')){_0x19c7c4[_0x7ecb('0x128')](this[_0x7ecb('0x21')][_0x3e8e96]['id']);}}}this[_0x7ecb('0xbb')](_0x12c94b['id'],_0x19c7c4,0x1,_0x12c94b[_0x7ecb('0x208')],_0x12c94b)[_0x7ecb('0xae')](function(_0x4d472e){if(!checkContactEmpty(_0x4d472e)){checkContactLowerLimitOriginate(_0x12c94b,0x1,0x0);_0x9cd673['countReScheduled'](_0x12c94b)[_0x7ecb('0xae')](sendMessageReschedule(_0x12c94b))[_0x7ecb('0xa8')](loggerCatch('[countReScheduled]\x20'));}else{_0x12c94b[_0x7ecb('0x41')]='RUNNING';if(_[_0x7ecb('0xa5')](_0x4d472e[0x0])||_[_0x7ecb('0xa5')](_0x4d472e[0x0][_0x7ecb('0x165')])||_[_0x7ecb('0xa5')](_0x4d472e[0x0][_0x7ecb('0x165')][_0x7ecb('0x166')])){_0x9cd673[_0x7ecb('0xc6')](_0x7ecb('0x1ff'),_0x12c94b,_0x4d472e[0x0]);}else{_0x9cd673[_0x7ecb('0xb1')](_['pick'](_0x4d472e[0x0],['VoiceQueueId',_0x7ecb('0x206')]))[_0x7ecb('0xae')](_0x9cd673['checkContactBlack'](_0x12c94b,_0x4d472e[0x0]))[_0x7ecb('0xa8')](_0x9cd673[_0x7ecb('0x200')](_0x7ecb('0x209'),_0x12c94b));}}})['catch'](loggerGetContactDialer(_0x7ecb('0x20a'),_0x12c94b,0x1));emitVoiceQueueSummary(_0x12c94b);};Dialer['prototype'][_0x7ecb('0x1df')]=function(_0x2c6e0e,_0x51fbd0,_0x2d0629,_0x132ff6,_0x477c80,_0x85d67f){loggerPredictive['info']('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0x7ecb('0x76')]('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',_0x2c6e0e);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x20b'),_0x51fbd0);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x20c'),_0x2d0629);loggerPredictive['info'](_0x7ecb('0x20d'),_0x132ff6);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x20e'),_0x477c80);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x7e'));return new BPromise(function(_0x1c7c21,_0x1b6b53){if(_0x2c6e0e<=0x0||isNaN(_0x2c6e0e)){return _0x1b6b53(msgResponse(_0x7ecb('0x20f'),_0x7ecb('0x46'),_0x7ecb('0x210')+_0x2c6e0e));}if(_0x2d0629<=0x0||isNaN(_0x2d0629)){return _0x1b6b53(msgResponse(_0x7ecb('0x20f'),'Error',_0x7ecb('0x211')+_0x2d0629));}if(_0x132ff6<=0x0||isNaN(_0x132ff6)){return _0x1b6b53(msgResponse('[abandonmentRate]',_0x7ecb('0x46'),'p\x20=\x20'+_0x132ff6));}if(_0x51fbd0<=0x0||isNaN(_0x51fbd0)){return _0x1b6b53(msgResponse(_0x7ecb('0x20f'),_0x7ecb('0x46'),_0x7ecb('0x212')+_0x51fbd0));}if(_0x477c80<=0x0||isNaN(_0x477c80)){return _0x1b6b53(msgResponse('[abandonmentRate]',_0x7ecb('0x46'),_0x7ecb('0x213')+_0x477c80));}_0x85d67f=_0x85d67f||0x0;var _0x6f159b=0x1/_0x2d0629;var _0x13206a=0x0;var _0x5de748=0x0;var _0x325274=0x0;var _0x4e06d6=0x0;for(var _0x39e421=0x0;_0x325274<_0x477c80;_0x39e421+=0x1){_0x5de748=_0x39e421/_0x51fbd0;_0x13206a=(_0x132ff6*_0x5de748+_0x85d67f)/_0x6f159b;_0x325274=erlangb(_0x13206a,_0x2c6e0e);_0x4e06d6=_0x13206a/_0x2c6e0e*(0x1-erlangb(_0x13206a,_0x2c6e0e));}return _0x1c7c21({'erlangCalls':_0x39e421,'erlangCallToSecond':_0x51fbd0/_0x39e421,'erlangAbandonmentRate':_0x325274,'erlangBusyFactor':_0x4e06d6});});};Dialer[_0x7ecb('0x1b')][_0x7ecb('0x214')]=function(_0x11bfa4,_0x1d459a,_0x300e88,_0x5f03a4,_0x31ac71,_0x568d74){loggerPredictive['info'](_0x7ecb('0x215'));loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x216'),_0x11bfa4);loggerPredictive[_0x7ecb('0x76')](_0x7ecb('0x20b'),_0x1d459a);loggerPredictive[_0x7ecb('0x76')]('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',_0x300e88);loggerPredictive['info'](_0x7ecb('0x20d'),_0x5f03a4);loggerPredictive[_0x7ecb('0x76')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x31ac71);loggerPredictive['info']('---------------------------');return new BPromise(function(_0xdc80c8,_0x57705c){if(_0x11bfa4<=0x0||isNaN(_0x11bfa4)){return _0x57705c(msgResponse(_0x7ecb('0x217'),_0x7ecb('0x46'),_0x7ecb('0x210')+_0x11bfa4));}if(_0x300e88<=0x0||isNaN(_0x300e88)){return _0x57705c(msgResponse(_0x7ecb('0x217'),'Error','Ts\x20=\x20'+_0x300e88));}if(_0x5f03a4<=0x0||isNaN(_0x5f03a4)){return _0x57705c(msgResponse(_0x7ecb('0x217'),_0x7ecb('0x46'),'p\x20=\x20'+_0x5f03a4));}if(_0x1d459a<=0x0||isNaN(_0x1d459a)){return _0x57705c(msgResponse('[busyFactor]',_0x7ecb('0x46'),'interval\x20=\x20'+_0x1d459a));}if(_0x31ac71<=0x0||isNaN(_0x31ac71)){return _0x57705c(msgResponse(_0x7ecb('0x217'),_0x7ecb('0x46'),_0x7ecb('0x218')+_0x31ac71));}_0x568d74=_0x568d74||0x0;var _0x50bf94=0x1/_0x300e88;var _0x5b6194=0x0;var _0x1140ef=0x0;var _0x5e4a1d=0x0;var _0x468fbe=0x0;for(var _0x22429e=0x0;_0x468fbe<_0x31ac71;_0x22429e+=0x1){_0x1140ef=_0x22429e/_0x1d459a;_0x5b6194=(_0x5f03a4*_0x1140ef+_0x568d74)/_0x50bf94;_0x5e4a1d=erlangb(_0x5b6194,_0x11bfa4);_0x468fbe=_0x5b6194/_0x11bfa4*(0x1-erlangb(_0x5b6194,_0x11bfa4));}return _0xdc80c8({'erlangCalls':_0x22429e,'erlangCallToSecond':_0x1d459a/_0x22429e,'erlangAbandonmentRate':_0x5e4a1d,'erlangBusyFactor':_0x468fbe});});};module[_0x7ecb('0x219')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 68ea17d..26105d8 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 _0x6929=['ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid','callbackat','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','droptime','endtime'];(function(_0x474342,_0x2f4925){var _0x369cc6=function(_0x54130c){while(--_0x54130c){_0x474342['push'](_0x474342['shift']());}};_0x369cc6(++_0x2f4925);}(_0x6929,0xc0));var _0x9692=function(_0x18d51e,_0x4121c1){_0x18d51e=_0x18d51e-0x0;var _0x1d9316=_0x6929[_0x18d51e];return _0x1d9316;};'use strict';var util=require(_0x9692('0x0'));var _=require(_0x9692('0x1'));var moment=require(_0x9692('0x2'));function getSeconds(_0x5c5d22,_0x346bd5){var _0x5e0620=moment(_0x5c5d22)[_0x9692('0x3')](0x0);var _0x24a733=moment(_0x346bd5)[_0x9692('0x3')](0x0);return _0x5e0620[_0x9692('0x4')](_0x24a733,_0x9692('0x5'));}function QueueCallerAbandon(_0x3d5909,_0x36cbb9){this[_0x9692('0x6')]=_0x3d5909[_0x9692('0x6')];this['type']=_0x3d5909[_0x9692('0x7')];this[_0x9692('0x8')]=_0x3d5909[_0x9692('0x7')]==='outbound'?_0x9692('0x9'):_0x3d5909[_0x9692('0x7')];this[_0x9692('0xa')]=_0x3d5909['countbusyretry'];this[_0x9692('0xb')]=_0x3d5909['countcongestionretry'];this['countnoanswerretry']=_0x3d5909[_0x9692('0xc')];this[_0x9692('0xd')]=_0x3d5909[_0x9692('0xa')]+_0x3d5909[_0x9692('0xb')]+_0x3d5909[_0x9692('0xc')]+_0x3d5909[_0x9692('0xe')]+_0x3d5909[_0x9692('0xf')]+_0x3d5909['countabandonedretry']+_0x3d5909[_0x9692('0x10')]+_0x3d5909[_0x9692('0x11')];this[_0x9692('0xe')]=_0x3d5909[_0x9692('0xe')];this[_0x9692('0xf')]=_0x3d5909['countdropretry'];this[_0x9692('0x12')]=_0x3d5909[_0x9692('0x12')];this[_0x9692('0x10')]=_0x3d5909[_0x9692('0x10')];this[_0x9692('0x11')]=_0x3d5909[_0x9692('0x11')];this[_0x9692('0x13')]=_0x36cbb9[_0x9692('0x13')];this[_0x9692('0x14')]=_0x3d5909[_0x9692('0x15')];this[_0x9692('0x16')]=_0x3d5909[_0x9692('0x17')];this[_0x9692('0x18')]=_0x3d5909[_0x9692('0x18')];this[_0x9692('0x19')]=_0x3d5909[_0x9692('0x19')];this[_0x9692('0x1a')]=_0x3d5909['droptime'];this[_0x9692('0x1b')]=this[_0x9692('0x1a')];this[_0x9692('0x1c')]=getSeconds(_0x3d5909[_0x9692('0x19')],_0x3d5909['starttime']);this[_0x9692('0x1d')]=getSeconds(this['droptime'],_0x3d5909[_0x9692('0x19')]);this[_0x9692('0x1e')]=0x0;this['queue']=_0x36cbb9[_0x9692('0x9')];this[_0x9692('0x1f')]=_0x36cbb9['connectedlinename'];this[_0x9692('0x20')]=_0x36cbb9[_0x9692('0x20')];this['callback']=_0x3d5909[_0x9692('0x21')];this[_0x9692('0x22')]=_0x3d5909[_0x9692('0x22')];this[_0x9692('0x23')]=_0x3d5909[_0x9692('0x23')];this['recallme']=_0x3d5909['recallme'];this[_0x9692('0x24')]=_0x3d5909['ContactId'];this[_0x9692('0x25')]=_0x3d5909[_0x9692('0x25')];this[_0x9692('0x26')]=_0x3d5909[_0x9692('0x26')];this[_0x9692('0x27')]=_0x3d5909['VoiceQueueId'];this[_0x9692('0x28')]=_0x3d5909[_0x9692('0x28')];this[_0x9692('0x29')]=_0x3d5909[_0x9692('0x29')]||'';this['originatecalleridname']=_0x3d5909[_0x9692('0x2a')]||'';}module[_0x9692('0x2b')]=QueueCallerAbandon; \ No newline at end of file +var _0xfd6e=['util','lodash','moment','milliseconds','diff','scheduledat','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callbackuniqueid','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x11de69,_0x46c7c6){var _0x211379=function(_0x58c8dd){while(--_0x58c8dd){_0x11de69['push'](_0x11de69['shift']());}};_0x211379(++_0x46c7c6);}(_0xfd6e,0x183));var _0xefd6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfd6e[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0xefd6('0x0'));var _=require(_0xefd6('0x1'));var moment=require(_0xefd6('0x2'));function getSeconds(_0x2a8eab,_0x10080d){var _0x4fefe3=moment(_0x2a8eab)[_0xefd6('0x3')](0x0);var _0x328113=moment(_0x10080d)[_0xefd6('0x3')](0x0);return _0x4fefe3[_0xefd6('0x4')](_0x328113,'seconds');}function QueueCallerAbandon(_0x1059e1,_0x32b6da){this[_0xefd6('0x5')]=_0x1059e1['scheduledat'];this['type']=_0x1059e1[_0xefd6('0x6')];this[_0xefd6('0x7')]=_0x1059e1[_0xefd6('0x6')]===_0xefd6('0x8')?'queue':_0x1059e1[_0xefd6('0x6')];this[_0xefd6('0x9')]=_0x1059e1[_0xefd6('0x9')];this['countcongestionretry']=_0x1059e1['countcongestionretry'];this[_0xefd6('0xa')]=_0x1059e1[_0xefd6('0xa')];this[_0xefd6('0xb')]=_0x1059e1['countbusyretry']+_0x1059e1[_0xefd6('0xc')]+_0x1059e1[_0xefd6('0xa')]+_0x1059e1[_0xefd6('0xd')]+_0x1059e1[_0xefd6('0xe')]+_0x1059e1[_0xefd6('0xf')]+_0x1059e1[_0xefd6('0x10')]+_0x1059e1[_0xefd6('0x11')];this['countnosuchnumberretry']=_0x1059e1[_0xefd6('0xd')];this['countdropretry']=_0x1059e1[_0xefd6('0xe')];this[_0xefd6('0xf')]=_0x1059e1[_0xefd6('0xf')];this['countmachineretry']=_0x1059e1[_0xefd6('0x10')];this[_0xefd6('0x11')]=_0x1059e1['countagentrejectretry'];this['uniqueid']=_0x32b6da[_0xefd6('0x12')];this[_0xefd6('0x13')]=_0x1059e1[_0xefd6('0x14')];this['calleridnum']=_0x1059e1[_0xefd6('0x15')];this[_0xefd6('0x16')]=_0x1059e1[_0xefd6('0x16')];this[_0xefd6('0x17')]=_0x1059e1[_0xefd6('0x17')];this[_0xefd6('0x18')]=_0x1059e1[_0xefd6('0x18')];this[_0xefd6('0x19')]=this[_0xefd6('0x18')];this[_0xefd6('0x1a')]=getSeconds(_0x1059e1[_0xefd6('0x17')],_0x1059e1['starttime']);this[_0xefd6('0x1b')]=getSeconds(this[_0xefd6('0x18')],_0x1059e1[_0xefd6('0x17')]);this[_0xefd6('0x1c')]=0x0;this[_0xefd6('0x1d')]=_0x32b6da[_0xefd6('0x1d')];this[_0xefd6('0x1e')]=_0x32b6da[_0xefd6('0x1f')];this[_0xefd6('0x20')]=_0x32b6da[_0xefd6('0x20')];this['callback']=_0x1059e1['callback'];this[_0xefd6('0x21')]=_0x1059e1['callbackuniqueid'];this['callbackat']=_0x1059e1['callbackat'];this[_0xefd6('0x22')]=_0x1059e1['recallme'];this[_0xefd6('0x23')]=_0x1059e1['ContactId'];this[_0xefd6('0x24')]=_0x1059e1[_0xefd6('0x24')];this[_0xefd6('0x25')]=_0x1059e1[_0xefd6('0x25')];this['VoiceQueueId']=_0x1059e1[_0xefd6('0x26')];this[_0xefd6('0x27')]=_0x1059e1[_0xefd6('0x27')];this['originatecalleridnum']=_0x1059e1[_0xefd6('0x28')]||'';this[_0xefd6('0x29')]=_0x1059e1['originatecalleridname']||'';}module[_0xefd6('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index e0e73b2..2152e4d 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(_0x4d4d93,_0x14f0b3){var _0x1cad96=function(_0x2f032a){while(--_0x2f032a){_0x4d4d93['push'](_0x4d4d93['shift']());}};_0x1cad96(++_0x14f0b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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(_0x47c492,_0x311a27){var _0x32105d=function(_0x5b0289){while(--_0x5b0289){_0x47c492['push'](_0x47c492['shift']());}};_0x32105d(++_0x311a27);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 f402b22..32cac95 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 _0x96cc=['isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','syncNewchannel','varset','bind','newstate','syncNewState','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','from-voip-provider','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','syncVarSet','variable','hasOwnProperty','value','channelstate','channelstatedesc','operation','status','info','remotestationid','pagestransferred','resolution','transferrate','filename','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SENDING\x20FAILED:\x20','faxstatusstring','send','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isTrunkReachable'];(function(_0x290fd1,_0x5df6f1){var _0x5bdf49=function(_0x290de4){while(--_0x290de4){_0x290fd1['push'](_0x290fd1['shift']());}};_0x5bdf49(++_0x5df6f1);}(_0x96cc,0x16c));var _0xc96c=function(_0x3d387f,_0x4a5da7){_0x3d387f=_0x3d387f-0x0;var _0x52e235=_0x96cc[_0x3d387f];return _0x52e235;};'use strict';var util=require(_0xc96c('0x0'));var _=require('lodash');var BPromise=require(_0xc96c('0x1'));var uuid=require('uuid');var moment=require(_0xc96c('0x2'));var path=require(_0xc96c('0x3'));var tiff2pdf=require(_0xc96c('0x4'));var gs=require(_0xc96c('0x5'));var logger=require(_0xc96c('0x6'))(_0xc96c('0x7'));var ami=require(_0xc96c('0x8'));var rpcDb=require(_0xc96c('0x9'));var Channel=require(_0xc96c('0xa'));var ut=require('./util/util');var Action=require(_0xc96c('0xb'));var faxAccount=require(_0xc96c('0xc'));var attachment=require(_0xc96c('0xd'));var faxMessage=require(_0xc96c('0xe'));function Fax(_0x13363d){this[_0xc96c('0xf')]={};this[_0xc96c('0x10')]=_0x13363d['faxAccounts'];this[_0xc96c('0x11')]=_0x13363d[_0xc96c('0x11')];this[_0xc96c('0x12')]={};ami['on']('newchannel',this[_0xc96c('0x13')]['bind'](this));ami['on'](_0xc96c('0x14'),this['syncVarSet'][_0xc96c('0x15')](this));ami['on'](_0xc96c('0x16'),this[_0xc96c('0x17')][_0xc96c('0x15')](this));ami['on']('newexten',this[_0xc96c('0x18')][_0xc96c('0x15')](this));ami['on'](_0xc96c('0x19'),this[_0xc96c('0x1a')]['bind'](this));ami['on'](_0xc96c('0x1b'),this[_0xc96c('0x1c')][_0xc96c('0x15')](this));ami['on'](_0xc96c('0x1d'),this[_0xc96c('0x1e')][_0xc96c('0x15')](this));ami['on'](_0xc96c('0x1f'),this[_0xc96c('0x20')][_0xc96c('0x15')](this));}Fax[_0xc96c('0x21')][_0xc96c('0x13')]=function(_0x5f1344){if(_0x5f1344['context']===_0xc96c('0x22')){for(var _0x99c402 in this[_0xc96c('0x10')]){if(this[_0xc96c('0x10')]['hasOwnProperty'](_0x99c402)){if(_0x5f1344[_0xc96c('0x23')]===this[_0xc96c('0x10')][_0x99c402][_0xc96c('0x24')]){this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]]={};this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]][_0xc96c('0x26')]=_0x5f1344[_0xc96c('0x26')];this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]]['id']=this[_0xc96c('0x10')][_0x99c402]['id'];this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]][_0xc96c('0x27')]=this[_0xc96c('0x10')][_0x99c402][_0xc96c('0x27')];logger['info'](_0x5f1344[_0xc96c('0x25')],_0xc96c('0x28'));}}}}if(this[_0xc96c('0x12')][_0x5f1344[_0xc96c('0x25')]]){this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]]={};this[_0xc96c('0xf')][_0x5f1344[_0xc96c('0x25')]][_0xc96c('0x26')]=_0x5f1344[_0xc96c('0x26')];logger['info'](_0x5f1344[_0xc96c('0x25')],_0xc96c('0x28'));}};Fax[_0xc96c('0x21')][_0xc96c('0x29')]=function(_0x58fab3){if(this['channels'][_0x58fab3[_0xc96c('0x25')]]){for(var _0x12c293 in _0x58fab3[_0xc96c('0x2a')]){if(_0x58fab3[_0xc96c('0x2a')][_0xc96c('0x2b')](_0x12c293)){this[_0xc96c('0xf')][_0x58fab3[_0xc96c('0x25')]][_0x12c293]=_0x58fab3[_0xc96c('0x2c')];}}}};Fax[_0xc96c('0x21')][_0xc96c('0x17')]=function(_0x325cda){if(this[_0xc96c('0xf')][_0x325cda[_0xc96c('0x25')]]){this[_0xc96c('0xf')][_0x325cda['uniqueid']][_0xc96c('0x2d')]=_0x325cda['channelstate'];this[_0xc96c('0xf')][_0x325cda[_0xc96c('0x25')]][_0xc96c('0x2e')]=_0x325cda['channelstatedesc'];}};Fax[_0xc96c('0x21')][_0xc96c('0x18')]=function(_0x446e5c){if(this[_0xc96c('0xf')][_0x446e5c['uniqueid']]){for(var _0x54a454 in _0x446e5c[_0xc96c('0x2a')]){if(_0x446e5c[_0xc96c('0x2a')][_0xc96c('0x2b')](_0x54a454)){this['channels'][_0x446e5c[_0xc96c('0x25')]][_0x54a454]=_0x446e5c[_0xc96c('0x2c')];}}}};Fax[_0xc96c('0x21')][_0xc96c('0x1a')]=function(_0x55784f){if(this[_0xc96c('0xf')][_0x55784f[_0xc96c('0x25')]]){this['channels'][_0x55784f[_0xc96c('0x25')]][_0xc96c('0x2f')]=_0x55784f[_0xc96c('0x2f')];this[_0xc96c('0xf')][_0x55784f[_0xc96c('0x25')]][_0xc96c('0x30')]=_0x55784f['status'];this[_0xc96c('0xf')][_0x55784f[_0xc96c('0x25')]][_0xc96c('0x24')]=_0x55784f[_0xc96c('0x24')];this[_0xc96c('0xf')][_0x55784f[_0xc96c('0x25')]]['filename']=_0x55784f['filename'];logger[_0xc96c('0x31')](_0x55784f[_0xc96c('0x25')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0xc96c('0x1c')]=function(_0x1df393){var _0x2eedc4=this;if(this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]]){var _0x298331=this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]]['id'];this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x32')]=_0x1df393['remotestationid'];this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x33')]=_0x1df393[_0xc96c('0x33')];this['channels'][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x24')]=_0x1df393[_0xc96c('0x24')];this['channels'][_0x1df393['uniqueid']][_0xc96c('0x34')]=_0x1df393[_0xc96c('0x34')];this[_0xc96c('0xf')][_0x1df393['uniqueid']][_0xc96c('0x35')]=_0x1df393[_0xc96c('0x35')];this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x36')]=_0x1df393[_0xc96c('0x36')];this[_0xc96c('0xf')][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x37')]=_0x1df393['calleridnum'];if(this['channels'][_0x1df393[_0xc96c('0x25')]][_0xc96c('0x33')]>0x0){tiff2pdf(_0x1df393[_0xc96c('0x36')],_0xc96c('0x38'),function(_0x535fd6){logger['info'](_0x1df393[_0xc96c('0x25')],_0xc96c('0x39'),_0x535fd6[_0xc96c('0x3a')]);attachment[_0xc96c('0x3b')]({'name':path[_0xc96c('0x3c')](_0x1df393[_0xc96c('0x36')])[_0xc96c('0x27')],'basename':path['parse'](_0x1df393[_0xc96c('0x36')])[_0xc96c('0x27')]+_0xc96c('0x3d'),'type':_0xc96c('0x3e')})['then'](function(_0x4ab5b1){faxAccount[_0xc96c('0x3f')](_0x298331,{'from':_0x1df393[_0xc96c('0x37')],'mapKey':_0xc96c('0x7'),'body':path[_0xc96c('0x3c')](_0x1df393[_0xc96c('0x36')])[_0xc96c('0x27')]+_0xc96c('0x3d'),'AttachmentId':_0x4ab5b1['id']})[_0xc96c('0x40')](function(_0xc9f94d){logger[_0xc96c('0x41')](_0x1df393[_0xc96c('0x25')],_0xc96c('0x42'),JSON[_0xc96c('0x43')](_0xc9f94d));});})['catch'](function(_0x13445d){logger[_0xc96c('0x41')](_0x1df393[_0xc96c('0x25')],_0xc96c('0x44'),JSON['stringify'](_0x13445d));});});}logger[_0xc96c('0x31')](_0x1df393['uniqueid'],_0xc96c('0x44'));}};Fax[_0xc96c('0x21')]['syncOriginateResponse']=function(_0x2581ae){if(this[_0xc96c('0x12')][_0x2581ae[_0xc96c('0x25')]]){_[_0xc96c('0x45')](this[_0xc96c('0xf')][_0x2581ae[_0xc96c('0x25')]],_['pick'](_0x2581ae,['response','reason']));}};function updateStatus(_0x1357f0){if(_0x1357f0['AttachmentId']){faxMessage[_0xc96c('0x46')](_0x1357f0[_0xc96c('0x47')],{'failMessage':_0xc96c('0x48')})[_0xc96c('0x49')](function(_0x467528){ut[_0xc96c('0x4a')](_0xc96c('0x4b'),_0x467528);})[_0xc96c('0x40')](function(_0x79bb3a){ut[_0xc96c('0x4a')]('[Fax][Message][Error][NoUpdate1]',_0x79bb3a);});}else{ut[_0xc96c('0x4a')](_0xc96c('0x4c'));}}Fax[_0xc96c('0x21')][_0xc96c('0x4d')]=function(_0x1c7ea7,_0xcde9,_0xad88c3){var _0x2e302f=this;var _0x5b34d2={};if(_0xcde9){_0x5b34d2={'read':_0xcde9};}else{_0x5b34d2={'failMessage':_0xad88c3};}if(this['actions'][_0x1c7ea7]['AttachmentId']){faxMessage['update'](this[_0xc96c('0x12')][_0x1c7ea7][_0xc96c('0x47')],_0x5b34d2)[_0xc96c('0x49')](function(_0x363676){ut[_0xc96c('0x4a')](_0xc96c('0x4e'),_0x363676);})[_0xc96c('0x40')](function(_0x5a7257){ut[_0xc96c('0x4a')](_0xc96c('0x4f'),_0x5a7257);})[_0xc96c('0x50')](function(){delete _0x2e302f[_0xc96c('0xf')][_0x1c7ea7];delete _0x2e302f[_0xc96c('0x12')][_0x1c7ea7];});}else{ut[_0xc96c('0x4a')](_0xc96c('0x51'));delete this['channels'][_0x1c7ea7];delete this[_0xc96c('0x12')][_0x1c7ea7];}};Fax[_0xc96c('0x21')][_0xc96c('0x1e')]=function(_0x1312db){var _0x3df6ff=this;if(this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]]){if(this[_0xc96c('0x12')][_0x1312db[_0xc96c('0x25')]]){this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]]['id']=this[_0xc96c('0x12')][_0x1312db[_0xc96c('0x25')]]['id'];this[_0xc96c('0xf')][_0x1312db['uniqueid']][_0xc96c('0x27')]=this[_0xc96c('0x12')][_0x1312db[_0xc96c('0x25')]][_0xc96c('0x27')];}logger[_0xc96c('0x31')](_0x1312db['uniqueid'],this[_0xc96c('0x12')][_0x1312db[_0xc96c('0x25')]]?_0xc96c('0x52'):_0xc96c('0x53'),JSON['stringify'](this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]]));if(this['actions'][_0x1312db['uniqueid']]){if(this['channels'][_0x1312db[_0xc96c('0x25')]][_0xc96c('0x54')]>0x0&&this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]][_0xc96c('0x19')]==='SUCCESS'){this['updateStatus'](_0x1312db[_0xc96c('0x25')],!![]);}else{this[_0xc96c('0x4d')](_0x1312db[_0xc96c('0x25')],![],this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]]['faxstatusstring']?_0xc96c('0x55')+this[_0xc96c('0xf')][_0x1312db[_0xc96c('0x25')]][_0xc96c('0x56')]:'SENDING\x20FAILED');}}}};Fax['prototype'][_0xc96c('0x57')]=function(_0x229fae){var _0x55bab7=this;return new BPromise(function(_0x3a64e2,_0x5f090e){_0x55bab7[_0xc96c('0x58')](_0x229fae,_0x55bab7[_0xc96c('0x10')][_0x229fae[_0xc96c('0x59')]])[_0xc96c('0x49')](function(_0x3dc324){ut[_0xc96c('0x4a')](_0xc96c('0x5a'),_0x3dc324);_0x3a64e2(ut[_0xc96c('0x3a')](_0xc96c('0x5b')));})[_0xc96c('0x40')](function(_0x56572d){ut[_0xc96c('0x4a')]('[Fax][execOriginate][failure]',_0x56572d);updateStatus(_0x229fae);_0x5f090e(ut[_0xc96c('0x3a')](_0xc96c('0x5c')));});});};Fax['prototype'][_0xc96c('0x5d')]=function(_0x4dc2fb){var _0x424b0a=this;return new BPromise(function(_0x1c5a9c,_0x23a5f8){var _0x2be777=_0x424b0a[_0xc96c('0x5e')](_0x424b0a[_0xc96c('0x10')][_0x4dc2fb[_0xc96c('0x59')]][_0xc96c('0x5f')],_0x4dc2fb);if(_0x2be777[_0xc96c('0x60')]){_0x1c5a9c(ut['message'](_0xc96c('0x61')));}else{_0x23a5f8(ut[_0xc96c('0x3a')](_0x2be777[_0xc96c('0x3a')]));}});};function originate(_0x43f94e,_0x5282cb,_0x4667f6){return new BPromise(function(_0x1e927d,_0x54f3fe){if(_0x4667f6){var _0x47f968=util[_0xc96c('0x62')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0xc96c('0x3c')](_0x43f94e[_0xc96c('0x3')])[_0xc96c('0x27')],_0x43f94e[_0xc96c('0x3')]);gs[_0xc96c('0x63')](_0x47f968)[_0xc96c('0x49')](function(){_0x43f94e[_0xc96c('0x3')]=util[_0xc96c('0x62')](_0xc96c('0x64'),path['parse'](_0x43f94e[_0xc96c('0x3')])[_0xc96c('0x65')],path[_0xc96c('0x3c')](_0x43f94e['path'])['name']);_0x5282cb[_0xc96c('0x66')]=_0x43f94e[_0xc96c('0x3')];ut[_0xc96c('0x4a')](_0xc96c('0x67'),'');ami[_0xc96c('0x68')](ut[_0xc96c('0x69')](_0x43f94e,_0x5282cb))[_0xc96c('0x49')](function(_0x526d5a){_0x1e927d(_0x526d5a);})[_0xc96c('0x40')](function(_0x1efae9){_0x54f3fe(_0x1efae9);});})['catch'](function(_0x2632f6){_0x54f3fe(_0x2632f6);});}else{ami['Action'](ut[_0xc96c('0x69')](_0x43f94e,_0x5282cb))[_0xc96c('0x49')](function(_0x4557ae){_0x1e927d(_0x4557ae);})[_0xc96c('0x40')](function(_0x24c724){_0x54f3fe(_0x24c724);});}});}Fax[_0xc96c('0x21')][_0xc96c('0x58')]=function(_0x44c4cd,_0xf057ad){var _0x50b90b=this;return new BPromise(function(_0x13b11d,_0x300a9b){var _0x50b547=uuid['v4']();var _0x340221=ut['addVariables'](_0x44c4cd,_0xf057ad);_0x50b90b[_0xc96c('0x12')][_0x50b547]=new Action(_0x50b547,_0xf057ad,_0x44c4cd);var _0x669dec=_0x50b90b[_0xc96c('0x12')][_0x50b547];if(path['parse'](_0x44c4cd[_0xc96c('0x3')])[_0xc96c('0x6a')]==='.pdf'){originate(_0x669dec,_0x340221,!![])[_0xc96c('0x49')](function(_0x46bf83){_0x13b11d(_0x46bf83);})[_0xc96c('0x40')](function(_0x5f3aea){_0x300a9b(_0x5f3aea);});}else{originate(_0x669dec,_0x340221,![])[_0xc96c('0x49')](function(_0x1ed8da){_0x13b11d(_0x1ed8da);})[_0xc96c('0x40')](function(_0x26c5f5){_0x300a9b(_0x26c5f5);});}});};Fax[_0xc96c('0x21')][_0xc96c('0x6b')]=function(_0x1973ef){return!_[_0xc96c('0x6c')](_0x1973ef)&&!_[_0xc96c('0x6c')](_0x1973ef[_0xc96c('0x27')])&&!_[_0xc96c('0x6c')](_0x1973ef[_0xc96c('0x6d')])&&_0x1973ef[_0xc96c('0x6d')]&&!_[_0xc96c('0x6c')](this[_0xc96c('0x11')][util['format'](_0xc96c('0x6e'),_0x1973ef[_0xc96c('0x27')])])&&!_[_0xc96c('0x6c')](this[_0xc96c('0x11')][util[_0xc96c('0x62')]('SIP/%s',_0x1973ef[_0xc96c('0x27')])][_0xc96c('0x30')])&&(this[_0xc96c('0x11')][util[_0xc96c('0x62')](_0xc96c('0x6e'),_0x1973ef['name'])]['status']===_0xc96c('0x6f')||this[_0xc96c('0x11')][util['format'](_0xc96c('0x6e'),_0x1973ef[_0xc96c('0x27')])]['status']===_0xc96c('0x70'));};Fax[_0xc96c('0x21')]['checkTrunk']=function(_0x1c6e4e,_0x40fa0e){if(!this[_0xc96c('0x6b')](_0x1c6e4e)){ut[_0xc96c('0x4a')]('[Fax][checkTrunk][Trunk\x20not\x20work]',_[_0xc96c('0x6c')](_0x1c6e4e)?'':_0x1c6e4e[_0xc96c('0x27')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xc96c('0x6c')](_0x40fa0e['fax'])){ut[_0xc96c('0x4a')](_0xc96c('0x71'),JSON['stringify'](_0x40fa0e));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xc96c('0x6c')](_0x40fa0e[_0xc96c('0x3')])){ut['logger'](_0xc96c('0x72'),JSON[_0xc96c('0x43')](_0x40fa0e));return{'isValid':![],'message':_0xc96c('0x73')};}return{'isValid':!![],'message':_0xc96c('0x74')};};module[_0xc96c('0x75')]=Fax; \ No newline at end of file +var _0xb9a7=['then','.pdf','catch','error','\x20notify\x20','\x20receiveFax\x20','stringify','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkTrunk','FaxAccountId','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','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isNil','active','SIP/%s','reachable','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','lodash','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','trunks','actions','syncNewchannel','varset','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','context','from-voip-provider','faxAccounts','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','prototype','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','create','parse','application/pdf'];(function(_0x5d644e,_0x2368ba){var _0x453b36=function(_0x3bea46){while(--_0x3bea46){_0x5d644e['push'](_0x5d644e['shift']());}};_0x453b36(++_0x2368ba);}(_0xb9a7,0x112));var _0x7b9a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xb9a7[_0xfae23b];return _0x200640;};'use strict';var util=require('util');var _=require(_0x7b9a('0x0'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require('moment');var path=require(_0x7b9a('0x1'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var ami=require(_0x7b9a('0x5'));var rpcDb=require(_0x7b9a('0x6'));var Channel=require(_0x7b9a('0x7'));var ut=require(_0x7b9a('0x8'));var Action=require(_0x7b9a('0x9'));var faxAccount=require(_0x7b9a('0xa'));var attachment=require(_0x7b9a('0xb'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x43d8e2){this[_0x7b9a('0xc')]={};this['faxAccounts']=_0x43d8e2['faxAccounts'];this['trunks']=_0x43d8e2[_0x7b9a('0xd')];this[_0x7b9a('0xe')]={};ami['on']('newchannel',this[_0x7b9a('0xf')]['bind'](this));ami['on'](_0x7b9a('0x10'),this['syncVarSet'][_0x7b9a('0x11')](this));ami['on'](_0x7b9a('0x12'),this[_0x7b9a('0x13')]['bind'](this));ami['on'](_0x7b9a('0x14'),this[_0x7b9a('0x15')]['bind'](this));ami['on'](_0x7b9a('0x16'),this[_0x7b9a('0x17')]['bind'](this));ami['on'](_0x7b9a('0x18'),this[_0x7b9a('0x19')][_0x7b9a('0x11')](this));ami['on'](_0x7b9a('0x1a'),this[_0x7b9a('0x1b')][_0x7b9a('0x11')](this));ami['on'](_0x7b9a('0x1c'),this[_0x7b9a('0x1d')][_0x7b9a('0x11')](this));}Fax['prototype'][_0x7b9a('0xf')]=function(_0x4e8524){if(_0x4e8524[_0x7b9a('0x1e')]===_0x7b9a('0x1f')){for(var _0x271263 in this[_0x7b9a('0x20')]){if(this[_0x7b9a('0x20')][_0x7b9a('0x21')](_0x271263)){if(_0x4e8524[_0x7b9a('0x22')]===this[_0x7b9a('0x20')][_0x271263][_0x7b9a('0x23')]){this[_0x7b9a('0xc')][_0x4e8524[_0x7b9a('0x24')]]={};this[_0x7b9a('0xc')][_0x4e8524[_0x7b9a('0x24')]]['channel']=_0x4e8524[_0x7b9a('0x25')];this['channels'][_0x4e8524[_0x7b9a('0x24')]]['id']=this['faxAccounts'][_0x271263]['id'];this[_0x7b9a('0xc')][_0x4e8524[_0x7b9a('0x24')]][_0x7b9a('0x26')]=this['faxAccounts'][_0x271263][_0x7b9a('0x26')];logger[_0x7b9a('0x27')](_0x4e8524['uniqueid'],_0x7b9a('0x28'));}}}}if(this[_0x7b9a('0xe')][_0x4e8524[_0x7b9a('0x24')]]){this[_0x7b9a('0xc')][_0x4e8524[_0x7b9a('0x24')]]={};this['channels'][_0x4e8524[_0x7b9a('0x24')]][_0x7b9a('0x25')]=_0x4e8524['channel'];logger[_0x7b9a('0x27')](_0x4e8524['uniqueid'],_0x7b9a('0x28'));}};Fax[_0x7b9a('0x29')]['syncVarSet']=function(_0x55d01c){if(this[_0x7b9a('0xc')][_0x55d01c['uniqueid']]){for(var _0x54df8a in _0x55d01c[_0x7b9a('0x2a')]){if(_0x55d01c['variable']['hasOwnProperty'](_0x54df8a)){this[_0x7b9a('0xc')][_0x55d01c['uniqueid']][_0x54df8a]=_0x55d01c[_0x7b9a('0x2b')];}}}};Fax[_0x7b9a('0x29')]['syncNewState']=function(_0x1553ae){if(this[_0x7b9a('0xc')][_0x1553ae[_0x7b9a('0x24')]]){this['channels'][_0x1553ae[_0x7b9a('0x24')]][_0x7b9a('0x2c')]=_0x1553ae[_0x7b9a('0x2c')];this[_0x7b9a('0xc')][_0x1553ae[_0x7b9a('0x24')]][_0x7b9a('0x2d')]=_0x1553ae['channelstatedesc'];}};Fax['prototype'][_0x7b9a('0x15')]=function(_0x45cb94){if(this[_0x7b9a('0xc')][_0x45cb94['uniqueid']]){for(var _0x2b199b in _0x45cb94[_0x7b9a('0x2a')]){if(_0x45cb94['variable']['hasOwnProperty'](_0x2b199b)){this[_0x7b9a('0xc')][_0x45cb94[_0x7b9a('0x24')]][_0x2b199b]=_0x45cb94['value'];}}}};Fax[_0x7b9a('0x29')][_0x7b9a('0x17')]=function(_0x166f31){if(this[_0x7b9a('0xc')][_0x166f31[_0x7b9a('0x24')]]){this['channels'][_0x166f31[_0x7b9a('0x24')]][_0x7b9a('0x2e')]=_0x166f31[_0x7b9a('0x2e')];this[_0x7b9a('0xc')][_0x166f31[_0x7b9a('0x24')]][_0x7b9a('0x2f')]=_0x166f31['status'];this['channels'][_0x166f31[_0x7b9a('0x24')]][_0x7b9a('0x23')]=_0x166f31['localstationid'];this[_0x7b9a('0xc')][_0x166f31[_0x7b9a('0x24')]][_0x7b9a('0x30')]=_0x166f31['filename'];logger[_0x7b9a('0x27')](_0x166f31[_0x7b9a('0x24')],'\x20syncFaxStatus\x20');}};Fax['prototype'][_0x7b9a('0x19')]=function(_0x130c04){var _0x42b94f=this;if(this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]]){var _0x1aee97=this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]]['id'];this['channels'][_0x130c04[_0x7b9a('0x24')]]['remotestationid']=_0x130c04[_0x7b9a('0x31')];this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]][_0x7b9a('0x32')]=_0x130c04[_0x7b9a('0x32')];this[_0x7b9a('0xc')][_0x130c04['uniqueid']][_0x7b9a('0x23')]=_0x130c04[_0x7b9a('0x23')];this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]]['resolution']=_0x130c04[_0x7b9a('0x33')];this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]][_0x7b9a('0x34')]=_0x130c04['transferrate'];this[_0x7b9a('0xc')][_0x130c04['uniqueid']][_0x7b9a('0x30')]=_0x130c04[_0x7b9a('0x30')];this[_0x7b9a('0xc')][_0x130c04[_0x7b9a('0x24')]][_0x7b9a('0x35')]=_0x130c04[_0x7b9a('0x35')];if(this['channels'][_0x130c04[_0x7b9a('0x24')]][_0x7b9a('0x32')]>0x0){tiff2pdf(_0x130c04[_0x7b9a('0x30')],'/var/opt/motion2/server/files/attachments/',function(_0x5172b6){logger[_0x7b9a('0x27')](_0x130c04[_0x7b9a('0x24')],_0x7b9a('0x36'),_0x5172b6[_0x7b9a('0x37')]);attachment[_0x7b9a('0x38')]({'name':path[_0x7b9a('0x39')](_0x130c04['filename'])['name'],'basename':path['parse'](_0x130c04[_0x7b9a('0x30')])[_0x7b9a('0x26')]+'.pdf','type':_0x7b9a('0x3a')})[_0x7b9a('0x3b')](function(_0x3e6549){faxAccount['notify'](_0x1aee97,{'from':_0x130c04[_0x7b9a('0x35')],'mapKey':'fax','body':path[_0x7b9a('0x39')](_0x130c04[_0x7b9a('0x30')])[_0x7b9a('0x26')]+_0x7b9a('0x3c'),'AttachmentId':_0x3e6549['id']})[_0x7b9a('0x3d')](function(_0x4bb14a){logger[_0x7b9a('0x3e')](_0x130c04['uniqueid'],_0x7b9a('0x3f'),JSON['stringify'](_0x4bb14a));});})['catch'](function(_0xd22f78){logger[_0x7b9a('0x3e')](_0x130c04[_0x7b9a('0x24')],_0x7b9a('0x40'),JSON[_0x7b9a('0x41')](_0xd22f78));});});}logger[_0x7b9a('0x27')](_0x130c04[_0x7b9a('0x24')],_0x7b9a('0x40'));}};Fax[_0x7b9a('0x29')]['syncOriginateResponse']=function(_0x1d7957){if(this[_0x7b9a('0xe')][_0x1d7957['uniqueid']]){_['merge'](this['channels'][_0x1d7957[_0x7b9a('0x24')]],_[_0x7b9a('0x42')](_0x1d7957,[_0x7b9a('0x43'),_0x7b9a('0x44')]));}};function updateStatus(_0x5aa41e){if(_0x5aa41e[_0x7b9a('0x45')]){faxMessage[_0x7b9a('0x46')](_0x5aa41e[_0x7b9a('0x45')],{'failMessage':_0x7b9a('0x47')})[_0x7b9a('0x3b')](function(_0x5866ff){ut[_0x7b9a('0x48')]('[Fax][Message][Error][Updated]',_0x5866ff);})[_0x7b9a('0x3d')](function(_0x23c173){ut[_0x7b9a('0x48')](_0x7b9a('0x49'),_0x23c173);});}else{ut['logger'](_0x7b9a('0x4a'));}}Fax[_0x7b9a('0x29')][_0x7b9a('0x4b')]=function(_0x28855a,_0x2b0db5,_0x3e2f1b){var _0x41a002=this;var _0x4c4d36={};if(_0x2b0db5){_0x4c4d36={'read':_0x2b0db5};}else{_0x4c4d36={'failMessage':_0x3e2f1b};}if(this['actions'][_0x28855a]['AttachmentId']){faxMessage[_0x7b9a('0x46')](this[_0x7b9a('0xe')][_0x28855a]['AttachmentId'],_0x4c4d36)['then'](function(_0x58527d){ut['logger'](_0x7b9a('0x4c'),_0x58527d);})[_0x7b9a('0x3d')](function(_0x18bfb6){ut[_0x7b9a('0x48')](_0x7b9a('0x4d'),_0x18bfb6);})[_0x7b9a('0x4e')](function(){delete _0x41a002[_0x7b9a('0xc')][_0x28855a];delete _0x41a002[_0x7b9a('0xe')][_0x28855a];});}else{ut['logger'](_0x7b9a('0x4f'));delete this['channels'][_0x28855a];delete this[_0x7b9a('0xe')][_0x28855a];}};Fax[_0x7b9a('0x29')][_0x7b9a('0x1b')]=function(_0x3db377){var _0x19e6e9=this;if(this['channels'][_0x3db377[_0x7b9a('0x24')]]){if(this['actions'][_0x3db377[_0x7b9a('0x24')]]){this[_0x7b9a('0xc')][_0x3db377[_0x7b9a('0x24')]]['id']=this['actions'][_0x3db377['uniqueid']]['id'];this['channels'][_0x3db377['uniqueid']][_0x7b9a('0x26')]=this[_0x7b9a('0xe')][_0x3db377[_0x7b9a('0x24')]]['name'];}logger[_0x7b9a('0x27')](_0x3db377[_0x7b9a('0x24')],this[_0x7b9a('0xe')][_0x3db377[_0x7b9a('0x24')]]?_0x7b9a('0x50'):'\x20hangup\x20faxRiceive\x20',JSON[_0x7b9a('0x41')](this[_0x7b9a('0xc')][_0x3db377[_0x7b9a('0x24')]]));if(this['actions'][_0x3db377['uniqueid']]){if(this['channels'][_0x3db377[_0x7b9a('0x24')]][_0x7b9a('0x51')]>0x0&&this[_0x7b9a('0xc')][_0x3db377['uniqueid']][_0x7b9a('0x16')]===_0x7b9a('0x52')){this['updateStatus'](_0x3db377[_0x7b9a('0x24')],!![]);}else{this['updateStatus'](_0x3db377[_0x7b9a('0x24')],![],this['channels'][_0x3db377[_0x7b9a('0x24')]][_0x7b9a('0x53')]?_0x7b9a('0x54')+this[_0x7b9a('0xc')][_0x3db377['uniqueid']][_0x7b9a('0x53')]:_0x7b9a('0x55'));}}}};Fax[_0x7b9a('0x29')][_0x7b9a('0x56')]=function(_0x567328){var _0x239b62=this;return new BPromise(function(_0x551362,_0x3ab2cb){_0x239b62['execOriginate'](_0x567328,_0x239b62[_0x7b9a('0x20')][_0x567328['FaxAccountId']])['then'](function(_0x57e788){ut['logger'](_0x7b9a('0x57'),_0x57e788);_0x551362(ut[_0x7b9a('0x37')](_0x7b9a('0x58')));})[_0x7b9a('0x3d')](function(_0x4ac9f9){ut[_0x7b9a('0x48')]('[Fax][execOriginate][failure]',_0x4ac9f9);updateStatus(_0x567328);_0x3ab2cb(ut['message'](_0x7b9a('0x59')));});});};Fax['prototype']['checkAfterSend']=function(_0x7ad607){var _0x262fd2=this;return new BPromise(function(_0x5524c0,_0xa5be92){var _0x4a441c=_0x262fd2[_0x7b9a('0x5a')](_0x262fd2[_0x7b9a('0x20')][_0x7ad607[_0x7b9a('0x5b')]]['Trunk'],_0x7ad607);if(_0x4a441c['isValid']){_0x5524c0(ut['message']('Trunk\x20Reachable'));}else{_0xa5be92(ut[_0x7b9a('0x37')](_0x4a441c[_0x7b9a('0x37')]));}});};function originate(_0x3fd697,_0x2092b6,_0x261a43){return new BPromise(function(_0x147d23,_0x45014b){if(_0x261a43){var _0x4b736e=util[_0x7b9a('0x5c')](_0x7b9a('0x5d'),path['parse'](_0x3fd697[_0x7b9a('0x1')])[_0x7b9a('0x26')],_0x3fd697[_0x7b9a('0x1')]);gs['execute'](_0x4b736e)['then'](function(){_0x3fd697[_0x7b9a('0x1')]=util[_0x7b9a('0x5c')]('%s/%s.tif',path[_0x7b9a('0x39')](_0x3fd697['path'])[_0x7b9a('0x5e')],path[_0x7b9a('0x39')](_0x3fd697[_0x7b9a('0x1')])['name']);_0x2092b6[_0x7b9a('0x5f')]=_0x3fd697[_0x7b9a('0x1')];ut[_0x7b9a('0x48')](_0x7b9a('0x60'),'');ami[_0x7b9a('0x61')](ut['variablesAction'](_0x3fd697,_0x2092b6))['then'](function(_0x211eff){_0x147d23(_0x211eff);})[_0x7b9a('0x3d')](function(_0x589136){_0x45014b(_0x589136);});})[_0x7b9a('0x3d')](function(_0x4721fe){_0x45014b(_0x4721fe);});}else{ami[_0x7b9a('0x61')](ut['variablesAction'](_0x3fd697,_0x2092b6))['then'](function(_0x17a29){_0x147d23(_0x17a29);})[_0x7b9a('0x3d')](function(_0x38b0da){_0x45014b(_0x38b0da);});}});}Fax[_0x7b9a('0x29')]['execOriginate']=function(_0x109032,_0x276da1){var _0x23afb4=this;return new BPromise(function(_0x4fdc1a,_0x5945d5){var _0xc8c8a6=uuid['v4']();var _0xb3184a=ut[_0x7b9a('0x62')](_0x109032,_0x276da1);_0x23afb4[_0x7b9a('0xe')][_0xc8c8a6]=new Action(_0xc8c8a6,_0x276da1,_0x109032);var _0x48e5dd=_0x23afb4[_0x7b9a('0xe')][_0xc8c8a6];if(path[_0x7b9a('0x39')](_0x109032['path'])[_0x7b9a('0x63')]===_0x7b9a('0x3c')){originate(_0x48e5dd,_0xb3184a,!![])[_0x7b9a('0x3b')](function(_0x34f229){_0x4fdc1a(_0x34f229);})[_0x7b9a('0x3d')](function(_0x3316af){_0x5945d5(_0x3316af);});}else{originate(_0x48e5dd,_0xb3184a,![])[_0x7b9a('0x3b')](function(_0x1402d6){_0x4fdc1a(_0x1402d6);})[_0x7b9a('0x3d')](function(_0x131e20){_0x5945d5(_0x131e20);});}});};Fax[_0x7b9a('0x29')]['isTrunkReachable']=function(_0x5df9f4){return!_[_0x7b9a('0x64')](_0x5df9f4)&&!_[_0x7b9a('0x64')](_0x5df9f4['name'])&&!_[_0x7b9a('0x64')](_0x5df9f4[_0x7b9a('0x65')])&&_0x5df9f4['active']&&!_[_0x7b9a('0x64')](this[_0x7b9a('0xd')][util[_0x7b9a('0x5c')](_0x7b9a('0x66'),_0x5df9f4[_0x7b9a('0x26')])])&&!_[_0x7b9a('0x64')](this[_0x7b9a('0xd')][util[_0x7b9a('0x5c')](_0x7b9a('0x66'),_0x5df9f4['name'])][_0x7b9a('0x2f')])&&(this[_0x7b9a('0xd')][util[_0x7b9a('0x5c')](_0x7b9a('0x66'),_0x5df9f4[_0x7b9a('0x26')])][_0x7b9a('0x2f')]===_0x7b9a('0x67')||this[_0x7b9a('0xd')][util['format'](_0x7b9a('0x66'),_0x5df9f4[_0x7b9a('0x26')])][_0x7b9a('0x2f')]==='unmonitored');};Fax[_0x7b9a('0x29')][_0x7b9a('0x5a')]=function(_0x1c077d,_0x43e57d){if(!this[_0x7b9a('0x68')](_0x1c077d)){ut[_0x7b9a('0x48')](_0x7b9a('0x69'),_[_0x7b9a('0x64')](_0x1c077d)?'':_0x1c077d['name']+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x7b9a('0x6a')};}if(_[_0x7b9a('0x64')](_0x43e57d[_0x7b9a('0x4')])){ut[_0x7b9a('0x48')](_0x7b9a('0x6b'),JSON[_0x7b9a('0x41')](_0x43e57d));return{'isValid':![],'message':_0x7b9a('0x6c')};}if(_[_0x7b9a('0x64')](_0x43e57d[_0x7b9a('0x1')])){ut[_0x7b9a('0x48')]('[Fax][checkTrunk][Empty\x20path]',JSON[_0x7b9a('0x41')](_0x43e57d));return{'isValid':![],'message':_0x7b9a('0x6d')};}return{'isValid':!![],'message':_0x7b9a('0x6e')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 034db7a..1a63ee9 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 _0x93ff=['util','bluebird','lodash','../rpc/faxAccount','error','inspect','notify','resolve','catch','[Notify]\x20'];(function(_0x5ac2eb,_0x2d62a4){var _0x21ba74=function(_0x1e5ad6){while(--_0x1e5ad6){_0x5ac2eb['push'](_0x5ac2eb['shift']());}};_0x21ba74(++_0x2d62a4);}(_0x93ff,0x96));var _0xf93f=function(_0x2d06ef,_0x2b609d){_0x2d06ef=_0x2d06ef-0x0;var _0x5ea499=_0x93ff[_0x2d06ef];return _0x5ea499;};'use strict';var util=require(_0xf93f('0x0'));var BPromise=require(_0xf93f('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0xf93f('0x2'));var faxAccount=require(_0xf93f('0x3'));function loggerCatch(_0x53a82b){return function(_0x390b99){logger[_0xf93f('0x4')](_0x53a82b,util[_0xf93f('0x5')](_0x390b99,{'showHidden':![],'depth':null}));};}exports[_0xf93f('0x6')]=function(_0x3f43ce,_0x1d248b){return BPromise[_0xf93f('0x7')]()['then'](faxAccount[_0xf93f('0x6')](_0x3f43ce,_0x1d248b))[_0xf93f('0x8')](loggerCatch(_0xf93f('0x9')));}; \ No newline at end of file +var _0x0689=['preview','lodash','../rpc/faxAccount','error','inspect','notify','resolve','then','catch','[Notify]\x20','bluebird'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0689,0xc5));var _0x9068=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x0689[_0x569caa];return _0x44cb5a;};'use strict';var util=require('util');var BPromise=require(_0x9068('0x0'));var logger=require('../../../config/logger')(_0x9068('0x1'));var _=require(_0x9068('0x2'));var faxAccount=require(_0x9068('0x3'));function loggerCatch(_0x5cc380){return function(_0x16f7d8){logger[_0x9068('0x4')](_0x5cc380,util[_0x9068('0x5')](_0x16f7d8,{'showHidden':![],'depth':null}));};}exports[_0x9068('0x6')]=function(_0x4039fb,_0xa93d14){return BPromise[_0x9068('0x7')]()[_0x9068('0x8')](faxAccount[_0x9068('0x6')](_0x4039fb,_0xa93d14))[_0x9068('0x9')](loggerCatch(_0x9068('0xa')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index 4e793ce..9ec13b3 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 _0x5d1e=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','util','child_process','exec'];(function(_0x3557d0,_0x39f204){var _0x38d56c=function(_0x5a582e){while(--_0x5a582e){_0x3557d0['push'](_0x3557d0['shift']());}};_0x38d56c(++_0x39f204);}(_0x5d1e,0x8d));var _0xe5d1=function(_0x5488ae,_0x548c72){_0x5488ae=_0x5488ae-0x0;var _0x452afd=_0x5d1e[_0x5488ae];return _0x452afd;};'use strict';var util=require(_0xe5d1('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require('bluebird');var exec=require(_0xe5d1('0x1'))[_0xe5d1('0x2')];exports[_0xe5d1('0x3')]=function(_0x149413){return new BPromise(function(_0x4ac95,_0x42d645){exec(_0x149413,function(_0x2bd7e2,_0x29d636,_0x2e859b){logger[_0xe5d1('0x4')]('Exec\x20gs',_0x29d636);if(_0x2bd7e2){logger[_0xe5d1('0x4')](_0xe5d1('0x5'),_0xe5d1('0x6'),util[_0xe5d1('0x7')](_0x2bd7e2,{'showHidden':![],'depth':null}),_0x29d636,_0x2e859b);_0x42d645(_0x2bd7e2);}_0x4ac95(_0x29d636);});});}; \ No newline at end of file +var _0xa22a=['exec','Exec\x20gs','info','\x20Error\x20:','inspect','util','../../../../config/logger','fax','child_process'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xa22a,0x113));var _0xaa22=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa22a[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xaa22('0x0'));var logger=require(_0xaa22('0x1'))(_0xaa22('0x2'));var BPromise=require('bluebird');var exec=require(_0xaa22('0x3'))[_0xaa22('0x4')];exports['execute']=function(_0x1a602b){return new BPromise(function(_0x1c3e14,_0x97d696){exec(_0x1a602b,function(_0x4b1db6,_0x778073,_0x30a8d5){logger['info'](_0xaa22('0x5'),_0x778073);if(_0x4b1db6){logger[_0xaa22('0x6')](_0xaa22('0x5'),_0xaa22('0x7'),util[_0xaa22('0x8')](_0x4b1db6,{'showHidden':![],'depth':null}),_0x778073,_0x30a8d5);_0x97d696(_0x4b1db6);}_0x1c3e14(_0x778073);});});}; \ 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 3d62fb6..c35363e 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 _0xedba=['localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','addVariables','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','originate','from-sip','\x22%s\x22\x20<%s>'];(function(_0xb011d6,_0x74d4eb){var _0x1e30f1=function(_0x5009ba){while(--_0x5009ba){_0xb011d6['push'](_0xb011d6['shift']());}};_0x1e30f1(++_0x74d4eb);}(_0xedba,0xa2));var _0xaedb=function(_0x10bdf8,_0x23c7b1){_0x10bdf8=_0x10bdf8-0x0;var _0x5ae900=_0xedba[_0x10bdf8];return _0x5ae900;};'use strict';var util=require(_0xaedb('0x0'));var _=require(_0xaedb('0x1'));var moment=require(_0xaedb('0x2'));var logger=require(_0xaedb('0x3'))(_0xaedb('0x4'));exports[_0xaedb('0x5')]=function(_0x5c1259){return{'message':_0x5c1259};};exports[_0xaedb('0x6')]=function(_0x2cab1e,_0x3ee3ba){logger['info'](_0x2cab1e,util['inspect'](_0x3ee3ba,{'showHidden':![],'depth':null}));};exports[_0xaedb('0x7')]=function(_0x2cd40,_0x40d2f4){var _0x452e60={'XMF-ECM':_0x40d2f4['ecm'],'XMF-HEADERINFO':_0x40d2f4[_0xaedb('0x8')],'XMF-MINRATE':_0x40d2f4[_0xaedb('0x9')],'XMF-MAXRATE':_0x40d2f4[_0xaedb('0xa')],'XMF-MODEM':util[_0xaedb('0xb')](_0xaedb('0xc'),_0x40d2f4[_0xaedb('0xd')]),'XMF-GATEWAY':_0x40d2f4[_0xaedb('0xe')],'XMF-FAXDETECT':_0x40d2f4[_0xaedb('0xf')],'XMF-T38TIMEOUT':_0x40d2f4[_0xaedb('0x10')],'XMF-LOCALSTATIONID':_0x40d2f4['localstationid'],'XMF-PATH':_0x2cd40[_0xaedb('0x11')]};return _0x452e60;};exports[_0xaedb('0x12')]=function(_0x549b1a,_0x5bb836){return{'actionid':_0x549b1a['uniqueid'],'action':_0xaedb('0x13'),'channel':_0x549b1a['channel'],'Exten':'xcally-motion-fax','Context':_0xaedb('0x14'),'Priority':'1','callerid':util['format'](_0xaedb('0x15'),_0x549b1a[_0xaedb('0x8')]?_0x549b1a[_0xaedb('0x8')]:'',_0x549b1a[_0xaedb('0x16')]),'variable':_0x5bb836,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x549b1a['uniqueid']};}; \ No newline at end of file +var _0x3f74=['message','inspect','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','util','lodash','moment','../../../../config/logger','fax'];(function(_0x4c207e,_0x13c930){var _0x202284=function(_0x290631){while(--_0x290631){_0x4c207e['push'](_0x4c207e['shift']());}};_0x202284(++_0x13c930);}(_0x3f74,0x127));var _0x43f7=function(_0x151aae,_0x128165){_0x151aae=_0x151aae-0x0;var _0x3c793b=_0x3f74[_0x151aae];return _0x3c793b;};'use strict';var util=require(_0x43f7('0x0'));var _=require(_0x43f7('0x1'));var moment=require(_0x43f7('0x2'));var logger=require(_0x43f7('0x3'))(_0x43f7('0x4'));exports[_0x43f7('0x5')]=function(_0x50dd45){return{'message':_0x50dd45};};exports['logger']=function(_0x500119,_0x451db4){logger['info'](_0x500119,util[_0x43f7('0x6')](_0x451db4,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x83b31f,_0x202b14){var _0x193cc5={'XMF-ECM':_0x202b14[_0x43f7('0x7')],'XMF-HEADERINFO':_0x202b14[_0x43f7('0x8')],'XMF-MINRATE':_0x202b14[_0x43f7('0x9')],'XMF-MAXRATE':_0x202b14[_0x43f7('0xa')],'XMF-MODEM':util[_0x43f7('0xb')](_0x43f7('0xc'),_0x202b14[_0x43f7('0xd')]),'XMF-GATEWAY':_0x202b14[_0x43f7('0xe')],'XMF-FAXDETECT':_0x202b14[_0x43f7('0xf')],'XMF-T38TIMEOUT':_0x202b14[_0x43f7('0x10')],'XMF-LOCALSTATIONID':_0x202b14['localstationid'],'XMF-PATH':_0x83b31f[_0x43f7('0x11')]};return _0x193cc5;};exports[_0x43f7('0x12')]=function(_0x2caf62,_0x3c06b5){return{'actionid':_0x2caf62[_0x43f7('0x13')],'action':_0x43f7('0x14'),'channel':_0x2caf62[_0x43f7('0x15')],'Exten':'xcally-motion-fax','Context':_0x43f7('0x16'),'Priority':'1','callerid':util[_0x43f7('0xb')](_0x43f7('0x17'),_0x2caf62[_0x43f7('0x8')]?_0x2caf62[_0x43f7('0x8')]:'',_0x2caf62[_0x43f7('0x18')]),'variable':_0x3c06b5,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2caf62['uniqueid']};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index ea88270..dd61a7f 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 _0x13c3=['./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','ami','hour','get','resolve','then','getAgents','initTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initCampaignHopperHistory','getVoiceCallReports','catch','error','[index.js][initParams]','inspect','listen','sync','[index.js][main]','bluebird','util','./server','./realtime','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk'];(function(_0x114da5,_0x34677b){var _0x1e52e3=function(_0x53a5a9){while(--_0x53a5a9){_0x114da5['push'](_0x114da5['shift']());}};_0x1e52e3(++_0x34677b);}(_0x13c3,0x1c3));var _0x313c=function(_0x584da8,_0x4944c4){_0x584da8=_0x584da8-0x0;var _0x4da924=_0x13c3[_0x584da8];return _0x4da924;};'use strict';var BPromise=require(_0x313c('0x0'));var util=require(_0x313c('0x1'));var moment=require('moment');var server=require(_0x313c('0x2'));var Realtime=require(_0x313c('0x3'));var Report=require('./report');var Acw=require('./acw');var Trigger=require(_0x313c('0x4'));var Dialer=require('./dialer');var Preview=require(_0x313c('0x5'));var Fax=require(_0x313c('0x6'));var user=require(_0x313c('0x7'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0x313c('0x8'));var voiceCallReport=require(_0x313c('0x9'));var trunk=require('./rpc/trunk');var trigger=require(_0x313c('0xa'));var template=require('./rpc/template');var cmHopperHistory=require(_0x313c('0xb'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x313c('0xc'));var faxAccount=require(_0x313c('0xd'));var zendesk=require(_0x313c('0xe'));var salesforce=require(_0x313c('0xf'));var sugarcrm=require(_0x313c('0x10'));var freshdesk=require(_0x313c('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require(_0x313c('0x12'));var vtiger=require(_0x313c('0x13'));var freshsales=require(_0x313c('0x14'));var servicenow=require(_0x313c('0x15'));var dynamics365=require(_0x313c('0x16'));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')(_0x313c('0x17'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x313c('0x18'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x313c('0x19')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x313c('0x1a')]()[_0x313c('0x1b')](user[_0x313c('0x1c')]())['then'](realtime['initAgents']())[_0x313c('0x1b')](user['getTelephones']())[_0x313c('0x1b')](realtime[_0x313c('0x1d')]())[_0x313c('0x1b')](trunk['getTrunks']())[_0x313c('0x1b')](realtime[_0x313c('0x1e')]())['then'](voiceQueue[_0x313c('0x1f')]())['then'](realtime[_0x313c('0x20')]())[_0x313c('0x1b')](trigger[_0x313c('0x21')]())[_0x313c('0x1b')](realtime[_0x313c('0x22')]())['then'](template[_0x313c('0x23')]())[_0x313c('0x1b')](realtime[_0x313c('0x24')]())[_0x313c('0x1b')](zendesk[_0x313c('0x25')]())[_0x313c('0x1b')](realtime[_0x313c('0x26')]())[_0x313c('0x1b')](salesforce[_0x313c('0x27')]())[_0x313c('0x1b')](realtime[_0x313c('0x28')]())['then'](sugarcrm[_0x313c('0x29')]())[_0x313c('0x1b')](realtime[_0x313c('0x2a')]())['then'](freshdesk['getFreshdeskAccounts']())[_0x313c('0x1b')](realtime[_0x313c('0x2b')]())['then'](desk['getDeskAccounts']())[_0x313c('0x1b')](realtime[_0x313c('0x2c')]())[_0x313c('0x1b')](zoho[_0x313c('0x2d')]())[_0x313c('0x1b')](realtime[_0x313c('0x2e')]())[_0x313c('0x1b')](vtiger[_0x313c('0x2f')]())['then'](realtime['initVtigerAccounts']())['then'](freshsales[_0x313c('0x30')]())[_0x313c('0x1b')](realtime[_0x313c('0x31')]())['then'](servicenow['getServicenowAccounts']())[_0x313c('0x1b')](realtime[_0x313c('0x32')]())['then'](dynamics365[_0x313c('0x33')]())[_0x313c('0x1b')](realtime[_0x313c('0x34')]())[_0x313c('0x1b')](campaign[_0x313c('0x35')]())[_0x313c('0x1b')](realtime[_0x313c('0x36')]())[_0x313c('0x1b')](voiceExtension[_0x313c('0x37')]())[_0x313c('0x1b')](realtime['initVoiceExtensions']())[_0x313c('0x1b')](faxAccount[_0x313c('0x38')]())['then'](realtime[_0x313c('0x39')]())[_0x313c('0x1b')](function(){return realtime;});}function initParams(){return BPromise[_0x313c('0x1a')]()['then'](voiceQueueReport['getVoiceQueueReports']())['then'](realtime['initVoiceQueueReports']())[_0x313c('0x1b')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x313c('0x1b')](realtime['initVoiceQueueHopperHistory']())[_0x313c('0x1b')](cmHopperHistory['getCampaignHopperHistory']())[_0x313c('0x1b')](realtime[_0x313c('0x3a')]())[_0x313c('0x1b')](voiceCallReport[_0x313c('0x3b')]())[_0x313c('0x1b')](realtime['initVoiceCallReports']())[_0x313c('0x3c')](function(_0x503df0){logger[_0x313c('0x3d')](_0x313c('0x3e'),util[_0x313c('0x3f')](_0x503df0,{'showHidden':![],'depth':null}));});}function main(){return server[_0x313c('0x40')](realtime,preview,fax)[_0x313c('0x1b')](function(_0x49a4c6){return initRealtime();})[_0x313c('0x1b')](function(){return initParams();})['then'](function(){report[_0x313c('0x41')]();setInterval(initRealtime,0x1388);})['catch'](function(_0x4d57ee){logger[_0x313c('0x3d')](_0x313c('0x42'),util[_0x313c('0x3f')](_0x4d57ee,{'showHidden':![],'depth':null}));});}main(); \ No newline at end of file +var _0x28e4=['./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./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/servicenow','./rpc/integrations/dynamics365','ami','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','initTrunks','getVoiceQueues','getTriggers','initTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initZohoAccounts','initVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','getVoiceCallReports','error','[index.js][initParams]','sync','catch','[index.js][main]','bluebird','util','./server','./realtime','./acw','./trigger','./dialer','./preview'];(function(_0x3b3f4f,_0x403216){var _0x174dbe=function(_0x30e333){while(--_0x30e333){_0x3b3f4f['push'](_0x3b3f4f['shift']());}};_0x174dbe(++_0x403216);}(_0x28e4,0x11c));var _0x428e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x28e4[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x428e('0x0'));var util=require(_0x428e('0x1'));var moment=require('moment');var server=require(_0x428e('0x2'));var Realtime=require(_0x428e('0x3'));var Report=require('./report');var Acw=require(_0x428e('0x4'));var Trigger=require(_0x428e('0x5'));var Dialer=require(_0x428e('0x6'));var Preview=require(_0x428e('0x7'));var Fax=require(_0x428e('0x8'));var user=require(_0x428e('0x9'));var voiceQueue=require(_0x428e('0xa'));var voiceQueueReport=require(_0x428e('0xb'));var voiceCallReport=require(_0x428e('0xc'));var trunk=require(_0x428e('0xd'));var trigger=require(_0x428e('0xe'));var template=require(_0x428e('0xf'));var cmHopperHistory=require(_0x428e('0x10'));var campaign=require(_0x428e('0x11'));var voiceExtension=require(_0x428e('0x12'));var faxAccount=require(_0x428e('0x13'));var zendesk=require(_0x428e('0x14'));var salesforce=require(_0x428e('0x15'));var sugarcrm=require(_0x428e('0x16'));var freshdesk=require(_0x428e('0x17'));var desk=require(_0x428e('0x18'));var zoho=require(_0x428e('0x19'));var vtiger=require(_0x428e('0x1a'));var freshsales=require(_0x428e('0x1b'));var servicenow=require(_0x428e('0x1c'));var dynamics365=require(_0x428e('0x1d'));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')(_0x428e('0x1e'));var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x428e('0x1f')](_0x428e('0x20'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x428e('0x1f')](_0x428e('0x20'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x428e('0x21')]()[_0x428e('0x22')](user[_0x428e('0x23')]())[_0x428e('0x22')](realtime[_0x428e('0x24')]())[_0x428e('0x22')](user[_0x428e('0x25')]())[_0x428e('0x22')](realtime[_0x428e('0x26')]())[_0x428e('0x22')](trunk['getTrunks']())[_0x428e('0x22')](realtime[_0x428e('0x27')]())[_0x428e('0x22')](voiceQueue[_0x428e('0x28')]())[_0x428e('0x22')](realtime['initVoiceQueues']())[_0x428e('0x22')](trigger[_0x428e('0x29')]())['then'](realtime['initTriggers']())[_0x428e('0x22')](template['getTemplates']())['then'](realtime[_0x428e('0x2a')]())['then'](zendesk[_0x428e('0x2b')]())[_0x428e('0x22')](realtime[_0x428e('0x2c')]())['then'](salesforce[_0x428e('0x2d')]())[_0x428e('0x22')](realtime['initSalesforceAccounts']())[_0x428e('0x22')](sugarcrm[_0x428e('0x2e')]())[_0x428e('0x22')](realtime['initSugarcrmAccounts']())[_0x428e('0x22')](freshdesk[_0x428e('0x2f')]())['then'](realtime[_0x428e('0x30')]())['then'](desk[_0x428e('0x31')]())[_0x428e('0x22')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0x428e('0x22')](realtime[_0x428e('0x32')]())['then'](vtiger['getVtigerAccounts']())[_0x428e('0x22')](realtime[_0x428e('0x33')]())[_0x428e('0x22')](freshsales[_0x428e('0x34')]())[_0x428e('0x22')](realtime[_0x428e('0x35')]())['then'](servicenow[_0x428e('0x36')]())['then'](realtime[_0x428e('0x37')]())[_0x428e('0x22')](dynamics365[_0x428e('0x38')]())[_0x428e('0x22')](realtime[_0x428e('0x39')]())[_0x428e('0x22')](campaign[_0x428e('0x3a')]())['then'](realtime[_0x428e('0x3b')]())[_0x428e('0x22')](voiceExtension['getVoiceExtensions']())[_0x428e('0x22')](realtime[_0x428e('0x3c')]())[_0x428e('0x22')](faxAccount[_0x428e('0x3d')]())[_0x428e('0x22')](realtime[_0x428e('0x3e')]())[_0x428e('0x22')](function(){return realtime;});}function initParams(){return BPromise[_0x428e('0x21')]()[_0x428e('0x22')](voiceQueueReport[_0x428e('0x3f')]())[_0x428e('0x22')](realtime['initVoiceQueueReports']())[_0x428e('0x22')](cmHopperHistory[_0x428e('0x40')]())['then'](realtime[_0x428e('0x41')]())[_0x428e('0x22')](cmHopperHistory[_0x428e('0x42')]())[_0x428e('0x22')](realtime['initCampaignHopperHistory']())[_0x428e('0x22')](voiceCallReport[_0x428e('0x43')]())[_0x428e('0x22')](realtime['initVoiceCallReports']())['catch'](function(_0x11c5c8){logger[_0x428e('0x44')](_0x428e('0x45'),util['inspect'](_0x11c5c8,{'showHidden':![],'depth':null}));});}function main(){return server['listen'](realtime,preview,fax)[_0x428e('0x22')](function(_0x368416){return initRealtime();})[_0x428e('0x22')](function(){return initParams();})[_0x428e('0x22')](function(){report[_0x428e('0x46')]();setInterval(initRealtime,0x1388);})[_0x428e('0x47')](function(_0x27a882){logger['error'](_0x428e('0x48'),util['inspect'](_0x27a882,{'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 7cd3054..9371c16 100644 --- a/server/services/ami/model/agent.js +++ b/server/services/ami/model/agent.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x498d4a,_0x45589c){var _0x365e44=function(_0x7aabbf){while(--_0x7aabbf){_0x498d4a['push'](_0x498d4a['shift']());}};_0x365e44(++_0x45589c);}(_0x70e0,0x17b));var _0x070e=function(_0xe3f4f6,_0x41ecdd){_0xe3f4f6=_0xe3f4f6-0x0;var _0x26863b=_0x70e0[_0xe3f4f6];return _0x26863b;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file +var _0x70e0=['name','voiceStatusQueue','onhold','stringify','md5','user:%s','user:save','emit','user:presence','lodash','util','moment','../../../config/environment','redis','defaults','socket.io-emitter','email','accountcode','fullname','state','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','local','toLowerCase','not_inuse','idle','inuse','statePause','toNumber','format'];(function(_0x5205af,_0x4eb128){var _0x2ebf64=function(_0x1ef3e4){while(--_0x1ef3e4){_0x5205af['push'](_0x5205af['shift']());}};_0x2ebf64(++_0x4eb128);}(_0x70e0,0x17b));var _0x070e=function(_0x559534,_0x2a41be){_0x559534=_0x559534-0x0;var _0x260b55=_0x70e0[_0x559534];return _0x260b55;};'use strict';var _=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var moment=require(_0x070e('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x070e('0x3'));config[_0x070e('0x4')]=_[_0x070e('0x5')](config[_0x070e('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x070e('0x6'))(new Redis(config['redis']));function Agent(_0x46fe68){this['id']=_0x46fe68['id']||0x0;this['name']=_0x46fe68['name']||'';this['email']=_0x46fe68[_0x070e('0x7')]||'';this[_0x070e('0x8')]=_0x46fe68[_0x070e('0x8')]||'';this[_0x070e('0x9')]=_0x46fe68[_0x070e('0x9')]||'';this[_0x070e('0xa')]=_0x070e('0xb');this['stateTime']=0x0;this['status']=_0x070e('0xb');this[_0x070e('0xc')]='';this[_0x070e('0xd')]='';this[_0x070e('0xe')]='';this[_0x070e('0xf')]='';this[_0x070e('0x10')]=_0x46fe68[_0x070e('0x10')]||![];this[_0x070e('0x11')]=_0x070e('0xb');this[_0x070e('0x12')]=0x0;this[_0x070e('0x13')]='';this['voiceStatusQueue']='';this['onhold']=![];this[_0x070e('0x14')]=![];this['md5']='';}Agent['prototype']['updateStatusRealtime']=function(_0x11d2ce){var _0x14c3fd;if(_0x11d2ce&&_0x11d2ce['state']){_0x14c3fd=_0x11d2ce['state'][_0x070e('0x15')]();switch(_0x14c3fd){case _0x070e('0x16'):_0x14c3fd=_0x070e('0x17');break;case _0x070e('0x18'):_0x14c3fd='talking';break;}}if(_0x14c3fd&&this['voiceStatus']!==_0x14c3fd||_0x11d2ce[_0x070e('0x19')]){this[_0x070e('0x12')]=_[_0x070e('0x1a')](moment()[_0x070e('0x1b')]('x'));}if(_0x14c3fd){this[_0x070e('0x11')]=_0x14c3fd;}var _0x5037eb={'id':this['id'],'name':this[_0x070e('0x1c')],'email':this[_0x070e('0x7')],'accountcode':this[_0x070e('0x8')],'fullname':this[_0x070e('0x9')],'state':this[_0x070e('0xa')],'stateTime':this['stateTime'],'status':this['status'],'address':this['address'],'online':this[_0x070e('0x10')],'voiceStatus':this[_0x070e('0x11')],'voiceStatusTime':this[_0x070e('0x12')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x070e('0x1d')],'interface':this['interface'],'onhold':this[_0x070e('0x1e')]};var _0x3f6985=md5(JSON[_0x070e('0x1f')](_0x5037eb));if(this[_0x070e('0x20')]!==_0x3f6985){this[_0x070e('0x20')]=_0x3f6985;io['to'](util[_0x070e('0x1b')](_0x070e('0x21'),_0x5037eb[_0x070e('0x1c')]))['emit'](_0x070e('0x22'),_0x5037eb);io[_0x070e('0x23')](_0x070e('0x24'),_0x5037eb);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 65a3f55..b4dd5bb 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 _0xc9a2=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency'];(function(_0x4b784d,_0x5efb2f){var _0x2cdeaf=function(_0x106242){while(--_0x106242){_0x4b784d['push'](_0x4b784d['shift']());}};_0x2cdeaf(++_0x5efb2f);}(_0xc9a2,0x184));var _0x2c9a=function(_0x2eb80d,_0x384e5e){_0x2eb80d=_0x2eb80d-0x0;var _0xe78c40=_0xc9a2[_0x2eb80d];return _0xe78c40;};'use strict';function Campaign(_0xc00602){this['id']=_0xc00602['id']||0x0;this[_0x2c9a('0x0')]=_0xc00602[_0x2c9a('0x0')]||'';this[_0x2c9a('0x1')]=_0xc00602[_0x2c9a('0x1')]||_0x2c9a('0x2');this['originated']=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this['ivrTotalCallsDays']=0x0;this[_0x2c9a('0x3')]='';this['sendMessageOneNotActive']=!![];this[_0x2c9a('0x4')]=_0xc00602['active'];this[_0x2c9a('0x5')]=_0xc00602['limitCalls'];this[_0x2c9a('0x6')]=_0xc00602[_0x2c9a('0x6')]||null;this[_0x2c9a('0x7')]=_0xc00602[_0x2c9a('0x7')]?_0xc00602[_0x2c9a('0x7')]:null;this[_0x2c9a('0x8')]=_0xc00602['dialOriginateCallerIdName'];this[_0x2c9a('0x9')]=_0xc00602[_0x2c9a('0x9')];this['dialOriginateTimeout']=_0xc00602[_0x2c9a('0xa')]||0x1e;this['dialCongestionMaxRetry']=_0xc00602[_0x2c9a('0xb')];this[_0x2c9a('0xc')]=_0xc00602[_0x2c9a('0xc')];this[_0x2c9a('0xd')]=_0xc00602[_0x2c9a('0xd')];this[_0x2c9a('0xe')]=_0xc00602[_0x2c9a('0xe')];this[_0x2c9a('0xf')]=_0xc00602['dialNoAnswerMaxRetry'];this[_0x2c9a('0x10')]=_0xc00602[_0x2c9a('0x10')];this[_0x2c9a('0x11')]=_0xc00602[_0x2c9a('0x11')];this[_0x2c9a('0x12')]=_0xc00602[_0x2c9a('0x12')]||0x3;this[_0x2c9a('0x13')]=_0xc00602[_0x2c9a('0x13')]||0x96;this[_0x2c9a('0x14')]=_0xc00602['dialDropMaxRetry']||0x3;this['dialDropRetryFrequency']=_0xc00602['dialDropRetryFrequency']||0x96;this[_0x2c9a('0x15')]=_0xc00602[_0x2c9a('0x15')]||0x3;this['dialAbandonedRetryFrequency']=_0xc00602['dialAbandonedRetryFrequency']||0x96;this[_0x2c9a('0x16')]=_0xc00602['dialMachineMaxRetry']||0x3;this[_0x2c9a('0x17')]=_0xc00602[_0x2c9a('0x17')]||0x96;this[_0x2c9a('0x18')]=_0xc00602[_0x2c9a('0x18')]||0x3;this['dialAgentRejectRetryFrequency']=_0xc00602[_0x2c9a('0x19')]||0x96;this[_0x2c9a('0x1a')]=_0xc00602[_0x2c9a('0x1a')]||_0x2c9a('0x1b');this[_0x2c9a('0x1c')]=_0xc00602[_0x2c9a('0x1c')]||undefined;this[_0x2c9a('0x1d')]=_0xc00602[_0x2c9a('0x1d')]||undefined;this[_0x2c9a('0x1e')]=_0xc00602[_0x2c9a('0x1e')]||undefined;this['TrunkBackup']=_0xc00602[_0x2c9a('0x1f')]?_0xc00602[_0x2c9a('0x1f')]:undefined;this[_0x2c9a('0x20')]=_0xc00602[_0x2c9a('0x20')]?_0xc00602[_0x2c9a('0x20')]:undefined;this['Interval']=_0xc00602['Interval']?_0xc00602['Interval']:undefined;this[_0x2c9a('0x21')]=_0xc00602[_0x2c9a('0x21')]?_0xc00602[_0x2c9a('0x21')]:undefined;this[_0x2c9a('0x22')]=_0xc00602['SquareProject']?_0xc00602['SquareProject'][_0x2c9a('0x0')]:undefined;this[_0x2c9a('0x23')]=_0xc00602[_0x2c9a('0x23')]||![];this[_0x2c9a('0x24')]=_0xc00602[_0x2c9a('0x24')];this[_0x2c9a('0x25')]=_0xc00602['dialAMDGreeting'];this[_0x2c9a('0x26')]=_0xc00602['dialAMDAfterGreetingSilence'];this[_0x2c9a('0x27')]=_0xc00602[_0x2c9a('0x27')];this[_0x2c9a('0x28')]=_0xc00602[_0x2c9a('0x28')];this[_0x2c9a('0x29')]=_0xc00602[_0x2c9a('0x29')];this['dialAMDMaximumNumberOfWords']=_0xc00602[_0x2c9a('0x2a')];this['dialAMDSilenceThreshold']=_0xc00602[_0x2c9a('0x2b')];this['dialAMDMaximumWordLength']=_0xc00602[_0x2c9a('0x2c')];}module[_0x2c9a('0x2d')]=Campaign; \ No newline at end of file +var _0x03ab=['DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialOrderByScheduledAt'];(function(_0x4fb99b,_0x237509){var _0x279ea0=function(_0x18577d){while(--_0x18577d){_0x4fb99b['push'](_0x4fb99b['shift']());}};_0x279ea0(++_0x237509);}(_0x03ab,0x10d));var _0xb03a=function(_0x103ed0,_0x425e03){_0x103ed0=_0x103ed0-0x0;var _0x466b9b=_0x03ab[_0x103ed0];return _0x466b9b;};'use strict';function Campaign(_0x48fde2){this['id']=_0x48fde2['id']||0x0;this[_0xb03a('0x0')]=_0x48fde2[_0xb03a('0x0')]||'';this['type']=_0x48fde2[_0xb03a('0x1')]||_0xb03a('0x2');this[_0xb03a('0x3')]=0x0;this['temp']=0x0;this['ivrAnswerCallsDay']=0x0;this[_0xb03a('0x4')]=0x0;this[_0xb03a('0x5')]='';this[_0xb03a('0x6')]=!![];this[_0xb03a('0x7')]=_0x48fde2['active'];this[_0xb03a('0x8')]=_0x48fde2[_0xb03a('0x8')];this[_0xb03a('0x9')]=_0x48fde2[_0xb03a('0x9')]||null;this[_0xb03a('0xa')]=_0x48fde2[_0xb03a('0xa')]?_0x48fde2[_0xb03a('0xa')]:null;this[_0xb03a('0xb')]=_0x48fde2[_0xb03a('0xb')];this[_0xb03a('0xc')]=_0x48fde2['dialOriginateCallerIdNumber'];this[_0xb03a('0xd')]=_0x48fde2[_0xb03a('0xd')]||0x1e;this[_0xb03a('0xe')]=_0x48fde2[_0xb03a('0xe')];this['dialCongestionRetryFrequency']=_0x48fde2['dialCongestionRetryFrequency'];this[_0xb03a('0xf')]=_0x48fde2[_0xb03a('0xf')];this['dialBusyRetryFrequency']=_0x48fde2[_0xb03a('0x10')];this[_0xb03a('0x11')]=_0x48fde2[_0xb03a('0x11')];this[_0xb03a('0x12')]=_0x48fde2[_0xb03a('0x12')];this[_0xb03a('0x13')]=_0x48fde2[_0xb03a('0x13')];this[_0xb03a('0x14')]=_0x48fde2[_0xb03a('0x14')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x48fde2[_0xb03a('0x15')]||0x96;this[_0xb03a('0x16')]=_0x48fde2[_0xb03a('0x16')]||0x3;this[_0xb03a('0x17')]=_0x48fde2[_0xb03a('0x17')]||0x96;this[_0xb03a('0x18')]=_0x48fde2[_0xb03a('0x18')]||0x3;this['dialAbandonedRetryFrequency']=_0x48fde2[_0xb03a('0x19')]||0x96;this[_0xb03a('0x1a')]=_0x48fde2[_0xb03a('0x1a')]||0x3;this['dialMachineRetryFrequency']=_0x48fde2[_0xb03a('0x1b')]||0x96;this[_0xb03a('0x1c')]=_0x48fde2['dialAgentRejectMaxRetry']||0x3;this[_0xb03a('0x1d')]=_0x48fde2[_0xb03a('0x1d')]||0x96;this[_0xb03a('0x1e')]=_0x48fde2[_0xb03a('0x1e')]||_0xb03a('0x1f');this[_0xb03a('0x20')]=_0x48fde2[_0xb03a('0x20')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x48fde2[_0xb03a('0x21')]||undefined;this[_0xb03a('0x22')]=_0x48fde2[_0xb03a('0x22')]||undefined;this[_0xb03a('0x23')]=_0x48fde2[_0xb03a('0x23')]?_0x48fde2['TrunkBackup']:undefined;this[_0xb03a('0x24')]=_0x48fde2['Trunk']?_0x48fde2[_0xb03a('0x24')]:undefined;this[_0xb03a('0x25')]=_0x48fde2[_0xb03a('0x25')]?_0x48fde2[_0xb03a('0x25')]:undefined;this[_0xb03a('0x26')]=_0x48fde2['SquareProject']?_0x48fde2[_0xb03a('0x26')]:undefined;this['dialQueueProject']=_0x48fde2[_0xb03a('0x26')]?_0x48fde2[_0xb03a('0x26')]['name']:undefined;this[_0xb03a('0x27')]=_0x48fde2[_0xb03a('0x27')]||![];this[_0xb03a('0x28')]=_0x48fde2['dialAMDInitialSilence'];this[_0xb03a('0x29')]=_0x48fde2['dialAMDGreeting'];this[_0xb03a('0x2a')]=_0x48fde2['dialAMDAfterGreetingSilence'];this[_0xb03a('0x2b')]=_0x48fde2[_0xb03a('0x2b')];this[_0xb03a('0x2c')]=_0x48fde2['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x48fde2[_0xb03a('0x2d')];this[_0xb03a('0x2e')]=_0x48fde2[_0xb03a('0x2e')];this['dialAMDSilenceThreshold']=_0x48fde2[_0xb03a('0x2f')];this[_0xb03a('0x30')]=_0x48fde2[_0xb03a('0x30')];}module[_0xb03a('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 3e064ca..11f843c 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 _0x64eb=['mohtime','exports','starttime','channel','calleridnum','connectedlinenum','connectedlinename','accountcode','uniqueid','exten','answered','answertime','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64eb,0xc6));var _0xb64e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x64eb[_0x20a584];return _0x4b41a8;};'use strict';function Channel(){this[_0xb64e('0x0')]=null;this[_0xb64e('0x1')]='';this['destinationchannel']='';this[_0xb64e('0x2')]=0x0;this['calleridname']='';this[_0xb64e('0x3')]=undefined;this[_0xb64e('0x4')]=undefined;this[_0xb64e('0x5')]=0x0;this['context']='';this[_0xb64e('0x6')]=0x0;this['linkedid']=0x0;this[_0xb64e('0x7')]=0x0;this[_0xb64e('0x8')]=![];this[_0xb64e('0x9')]=null;this[_0xb64e('0xa')]=null;this[_0xb64e('0xb')]=![];this[_0xb64e('0xc')]=![];this[_0xb64e('0xd')]='';this[_0xb64e('0xe')]='';this[_0xb64e('0xf')]=0x0;this['billableseconds']=0x0;this['holdtime']=0x0;this[_0xb64e('0x10')]=null;this[_0xb64e('0x11')]=null;this[_0xb64e('0x12')]=null;this[_0xb64e('0x13')]=![];this[_0xb64e('0x14')]=null;this[_0xb64e('0x15')]=null;this[_0xb64e('0x16')]=[];this[_0xb64e('0x17')]=undefined;this[_0xb64e('0x18')]=undefined;this[_0xb64e('0x19')]=undefined;this[_0xb64e('0x1a')]=0x0;}module[_0xb64e('0x1b')]=Channel; \ No newline at end of file +var _0xeaa0=['transferType','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','linkedid','exten','answered','answertime','unmanaged','abandoned','lastapplication','lastdata','billableseconds','holdtime','type','tag','monitor','monitorFilename','queue','transfercalleridnum'];(function(_0x375e79,_0x5de495){var _0x2224c4=function(_0x588459){while(--_0x588459){_0x375e79['push'](_0x375e79['shift']());}};_0x2224c4(++_0x5de495);}(_0xeaa0,0x16e));var _0x0eaa=function(_0x2c4e32,_0x3a5590){_0x2c4e32=_0x2c4e32-0x0;var _0x1eac30=_0xeaa0[_0x2c4e32];return _0x1eac30;};'use strict';function Channel(){this[_0x0eaa('0x0')]=null;this[_0x0eaa('0x1')]='';this[_0x0eaa('0x2')]='';this[_0x0eaa('0x3')]=0x0;this[_0x0eaa('0x4')]='';this['connectedlinenum']=undefined;this[_0x0eaa('0x5')]=undefined;this[_0x0eaa('0x6')]=0x0;this['context']='';this[_0x0eaa('0x7')]=0x0;this[_0x0eaa('0x8')]=0x0;this[_0x0eaa('0x9')]=0x0;this[_0x0eaa('0xa')]=![];this[_0x0eaa('0xb')]=null;this['endtime']=null;this[_0x0eaa('0xc')]=![];this[_0x0eaa('0xd')]=![];this[_0x0eaa('0xe')]='';this[_0x0eaa('0xf')]='';this['duration']=0x0;this[_0x0eaa('0x10')]=0x0;this[_0x0eaa('0x11')]=0x0;this[_0x0eaa('0x12')]=null;this[_0x0eaa('0x13')]=null;this['disposition']=null;this[_0x0eaa('0x14')]=![];this[_0x0eaa('0x15')]=null;this[_0x0eaa('0x16')]=null;this['monitors']=[];this[_0x0eaa('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x0eaa('0x18')]=undefined;this[_0x0eaa('0x19')]=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 dfd30bf..b64ac2e 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 _0x24da=['Configurations','exports','name','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl'];(function(_0x1761f6,_0x155ad7){var _0x561541=function(_0x3eee88){while(--_0x3eee88){_0x1761f6['push'](_0x1761f6['shift']());}};_0x561541(++_0x155ad7);}(_0x24da,0x122));var _0xa24d=function(_0x53abe5,_0x33a9e5){_0x53abe5=_0x53abe5-0x0;var _0xc1c37e=_0x24da[_0x53abe5];return _0xc1c37e;};'use strict';function DeskAccount(_0x3cb048){this['id']=_0x3cb048['id']||0x0;this[_0xa24d('0x0')]=_0x3cb048[_0xa24d('0x0')]||'';this['username']=_0x3cb048['username']||'';this[_0xa24d('0x1')]=_0x3cb048[_0xa24d('0x1')]||'';this[_0xa24d('0x2')]=_0x3cb048[_0xa24d('0x2')]||'';this[_0xa24d('0x3')]=_0x3cb048[_0xa24d('0x3')]||'';this['consumerKey']=_0x3cb048[_0xa24d('0x4')]||'';this[_0xa24d('0x5')]=_0x3cb048['consumerSecret']||'';this[_0xa24d('0x6')]=_0x3cb048[_0xa24d('0x6')]||'';this['tokenSecret']=_0x3cb048[_0xa24d('0x7')]||'';this['type']=_0x3cb048[_0xa24d('0x8')]||'';this[_0xa24d('0x9')]=_0x3cb048[_0xa24d('0x9')]||'';this['Configurations']=_0x3cb048[_0xa24d('0xa')]||{};}module[_0xa24d('0xb')]=DeskAccount; \ No newline at end of file +var _0x1dac=['token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerSecret'];(function(_0x40a97c,_0x519731){var _0x48a7db=function(_0x15963f){while(--_0x15963f){_0x40a97c['push'](_0x40a97c['shift']());}};_0x48a7db(++_0x519731);}(_0x1dac,0x7e));var _0xc1da=function(_0x486eff,_0x5cb3b0){_0x486eff=_0x486eff-0x0;var _0x95293b=_0x1dac[_0x486eff];return _0x95293b;};'use strict';function DeskAccount(_0x227ae5){this['id']=_0x227ae5['id']||0x0;this[_0xc1da('0x0')]=_0x227ae5[_0xc1da('0x0')]||'';this[_0xc1da('0x1')]=_0x227ae5[_0xc1da('0x1')]||'';this[_0xc1da('0x2')]=_0x227ae5['remoteUri']||'';this[_0xc1da('0x3')]=_0x227ae5[_0xc1da('0x3')]||'';this[_0xc1da('0x4')]=_0x227ae5[_0xc1da('0x4')]||'';this['consumerKey']=_0x227ae5['consumerKey']||'';this[_0xc1da('0x5')]=_0x227ae5[_0xc1da('0x5')]||'';this[_0xc1da('0x6')]=_0x227ae5[_0xc1da('0x6')]||'';this[_0xc1da('0x7')]=_0x227ae5['tokenSecret']||'';this[_0xc1da('0x8')]=_0x227ae5[_0xc1da('0x8')]||'';this[_0xc1da('0x9')]=_0x227ae5['serverUrl']||'';this[_0xc1da('0xa')]=_0x227ae5[_0xc1da('0xa')]||{};}module[_0xc1da('0xb')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 5b8de4e..3fe781c 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 _0xd64b=['exports','name','username','password','remoteUri','clientSecret','serverUrl','Configurations'];(function(_0x58052a,_0x3fa6c3){var _0x410d1e=function(_0x5effdf){while(--_0x5effdf){_0x58052a['push'](_0x58052a['shift']());}};_0x410d1e(++_0x3fa6c3);}(_0xd64b,0xc1));var _0xbd64=function(_0x201490,_0x235e70){_0x201490=_0x201490-0x0;var _0x1479df=_0xd64b[_0x201490];return _0x1479df;};'use strict';function Dynamics365Account(_0x272488){this['id']=_0x272488['id']||0x0;this['name']=_0x272488[_0xbd64('0x0')]||'';this['username']=_0x272488[_0xbd64('0x1')]||'';this[_0xbd64('0x2')]=_0x272488[_0xbd64('0x2')]||'';this[_0xbd64('0x3')]=_0x272488[_0xbd64('0x3')]||'';this['tenantId']=_0x272488['tenantId']||'';this['clientId']=_0x272488['clientId']||'';this[_0xbd64('0x4')]=_0x272488[_0xbd64('0x4')]||{};this[_0xbd64('0x5')]=_0x272488[_0xbd64('0x5')]||'';this[_0xbd64('0x6')]=_0x272488[_0xbd64('0x6')]||{};}module[_0xbd64('0x7')]=Dynamics365Account; \ No newline at end of file +var _0x2dae=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0x46accd,_0x43fbd4){var _0x2191e3=function(_0x23607f){while(--_0x23607f){_0x46accd['push'](_0x46accd['shift']());}};_0x2191e3(++_0x43fbd4);}(_0x2dae,0xc3));var _0xe2da=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x2dae[_0x303c30];return _0x43161b;};'use strict';function Dynamics365Account(_0x463a36){this['id']=_0x463a36['id']||0x0;this['name']=_0x463a36[_0xe2da('0x0')]||'';this[_0xe2da('0x1')]=_0x463a36[_0xe2da('0x1')]||'';this[_0xe2da('0x2')]=_0x463a36[_0xe2da('0x2')]||'';this['remoteUri']=_0x463a36[_0xe2da('0x3')]||'';this[_0xe2da('0x4')]=_0x463a36[_0xe2da('0x4')]||'';this[_0xe2da('0x5')]=_0x463a36['clientId']||'';this[_0xe2da('0x6')]=_0x463a36[_0xe2da('0x6')]||{};this[_0xe2da('0x7')]=_0x463a36[_0xe2da('0x7')]||'';this[_0xe2da('0x8')]=_0x463a36[_0xe2da('0x8')]||{};}module[_0xe2da('0x9')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index b315458..47a7462 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 _0xe250=['gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29'];(function(_0x42281a,_0x42d194){var _0x2ee66f=function(_0x5b9ae6){while(--_0x5b9ae6){_0x42281a['push'](_0x42281a['shift']());}};_0x2ee66f(++_0x42d194);}(_0xe250,0xb2));var _0x0e25=function(_0x5e7694,_0xb85dca){_0x5e7694=_0x5e7694-0x0;var _0x24ad86=_0xe250[_0x5e7694];return _0x24ad86;};'use strict';function FaxAccount(_0x2adbde){this['id']=_0x2adbde['id']||0x0;this[_0x0e25('0x0')]=_0x2adbde['name']||'';this[_0x0e25('0x1')]=_0x2adbde['description'];this[_0x0e25('0x2')]=_0x2adbde[_0x0e25('0x2')];this[_0x0e25('0x3')]=_0x2adbde[_0x0e25('0x3')];this[_0x0e25('0x4')]=_0x2adbde[_0x0e25('0x4')];this[_0x0e25('0x5')]=_0x2adbde[_0x0e25('0x5')]||0x960;this[_0x0e25('0x6')]=_0x2adbde['maxrate']||0x3840;this[_0x0e25('0x7')]=_0x2adbde[_0x0e25('0x7')]||_0x0e25('0x8');this[_0x0e25('0x9')]=_0x2adbde[_0x0e25('0x9')]||'no';this['faxdetect']=_0x2adbde[_0x0e25('0xa')]||'no';this[_0x0e25('0xb')]=_0x2adbde[_0x0e25('0xb')]||0x1388;this[_0x0e25('0xc')]=_0x2adbde[_0x0e25('0xc')]||'SIP';this[_0x0e25('0xd')]=_0x2adbde[_0x0e25('0xd')]?_0x2adbde[_0x0e25('0xd')]:undefined;this[_0x0e25('0xe')]=_0x2adbde['ListId'];this['key']=_0x2adbde[_0x0e25('0xf')];}module[_0x0e25('0x10')]=FaxAccount; \ No newline at end of file +var _0x534a=['Trunk','ListId','key','exports','name','description','ecm','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP'];(function(_0x4c644c,_0x1a5d4f){var _0x18b89e=function(_0x4f5ed3){while(--_0x4f5ed3){_0x4c644c['push'](_0x4c644c['shift']());}};_0x18b89e(++_0x1a5d4f);}(_0x534a,0x144));var _0xa534=function(_0x5c51b8,_0x439411){_0x5c51b8=_0x5c51b8-0x0;var _0x488eb0=_0x534a[_0x5c51b8];return _0x488eb0;};'use strict';function FaxAccount(_0x6489fc){this['id']=_0x6489fc['id']||0x0;this[_0xa534('0x0')]=_0x6489fc[_0xa534('0x0')]||'';this[_0xa534('0x1')]=_0x6489fc[_0xa534('0x1')];this['ecm']=_0x6489fc[_0xa534('0x2')];this['headerinfo']=_0x6489fc['headerinfo'];this[_0xa534('0x3')]=_0x6489fc[_0xa534('0x3')];this[_0xa534('0x4')]=_0x6489fc['minrate']||0x960;this[_0xa534('0x5')]=_0x6489fc[_0xa534('0x5')]||0x3840;this[_0xa534('0x6')]=_0x6489fc[_0xa534('0x6')]||'v17,v27,v29';this[_0xa534('0x7')]=_0x6489fc[_0xa534('0x7')]||'no';this[_0xa534('0x8')]=_0x6489fc[_0xa534('0x8')]||'no';this[_0xa534('0x9')]=_0x6489fc['t38timeout']||0x1388;this[_0xa534('0xa')]=_0x6489fc[_0xa534('0xa')]||_0xa534('0xb');this[_0xa534('0xc')]=_0x6489fc[_0xa534('0xc')]?_0x6489fc[_0xa534('0xc')]:undefined;this[_0xa534('0xd')]=_0x6489fc[_0xa534('0xd')];this[_0xa534('0xe')]=_0x6489fc['key'];}module[_0xa534('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index 449b36e..658d6ca 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 _0x79b3=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0xf85e63,_0xc92e8){var _0x1110d0=function(_0x1af600){while(--_0x1af600){_0xf85e63['push'](_0xf85e63['shift']());}};_0x1110d0(++_0xc92e8);}(_0x79b3,0x65));var _0x379b=function(_0x505e13,_0x5d5991){_0x505e13=_0x505e13-0x0;var _0x5ed753=_0x79b3[_0x505e13];return _0x5ed753;};'use strict';function FreshdeskAccount(_0x3b8890){this['id']=_0x3b8890['id']||0x0;this[_0x379b('0x0')]=_0x3b8890[_0x379b('0x0')]||'';this['username']=_0x3b8890[_0x379b('0x1')]||'';this[_0x379b('0x2')]=_0x3b8890[_0x379b('0x3')]||'';this[_0x379b('0x4')]=_0x3b8890[_0x379b('0x4')]||'';this[_0x379b('0x5')]=_0x3b8890[_0x379b('0x5')]||'';this[_0x379b('0x6')]=_0x3b8890[_0x379b('0x6')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xcdf0=['apiKey','token','serverUrl','Configurations','exports','name','username'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xcdf0,0x12b));var _0x0cdf=function(_0x50e470,_0x27336a){_0x50e470=_0x50e470-0x0;var _0x4a586d=_0xcdf0[_0x50e470];return _0x4a586d;};'use strict';function FreshdeskAccount(_0x3764bd){this['id']=_0x3764bd['id']||0x0;this['name']=_0x3764bd[_0x0cdf('0x0')]||'';this[_0x0cdf('0x1')]=_0x3764bd[_0x0cdf('0x1')]||'';this[_0x0cdf('0x2')]=_0x3764bd[_0x0cdf('0x3')]||'';this['remoteUri']=_0x3764bd['remoteUri']||'';this[_0x0cdf('0x4')]=_0x3764bd[_0x0cdf('0x4')]||'';this[_0x0cdf('0x5')]=_0x3764bd[_0x0cdf('0x5')]||{};}module[_0x0cdf('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 e486cf2..22f57b5 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 _0xe4b8=['username','apiKey','token','serverUrl','Configurations','exports','name'];(function(_0x2300f2,_0x315c5f){var _0x6bd508=function(_0x2fa0f6){while(--_0x2fa0f6){_0x2300f2['push'](_0x2300f2['shift']());}};_0x6bd508(++_0x315c5f);}(_0xe4b8,0x179));var _0x8e4b=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xe4b8[_0x7e2eb0];return _0xd92de4;};'use strict';function FreshsalesAccount(_0x5ed225){this['id']=_0x5ed225['id']||0x0;this[_0x8e4b('0x0')]=_0x5ed225[_0x8e4b('0x0')]||'';this[_0x8e4b('0x1')]=_0x5ed225[_0x8e4b('0x1')]||'';this[_0x8e4b('0x2')]=_0x5ed225[_0x8e4b('0x3')]||'';this['remoteUri']=_0x5ed225['remoteUri']||'';this[_0x8e4b('0x4')]=_0x5ed225[_0x8e4b('0x4')]||'';this[_0x8e4b('0x5')]=_0x5ed225['Configurations']||{};}module[_0x8e4b('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x1bce=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x180431,_0x142833){var _0x595c13=function(_0x47538e){while(--_0x47538e){_0x180431['push'](_0x180431['shift']());}};_0x595c13(++_0x142833);}(_0x1bce,0x73));var _0xe1bc=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x1bce[_0x2641f9];return _0x585741;};'use strict';function FreshsalesAccount(_0x3e36b0){this['id']=_0x3e36b0['id']||0x0;this[_0xe1bc('0x0')]=_0x3e36b0['name']||'';this[_0xe1bc('0x1')]=_0x3e36b0[_0xe1bc('0x1')]||'';this[_0xe1bc('0x2')]=_0x3e36b0[_0xe1bc('0x3')]||'';this[_0xe1bc('0x4')]=_0x3e36b0[_0xe1bc('0x4')]||'';this[_0xe1bc('0x5')]=_0x3e36b0[_0xe1bc('0x5')]||'';this[_0xe1bc('0x6')]=_0x3e36b0['Configurations']||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 1e6cd59..cc72fb2 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 _0x4a2e=['queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','connectedlinenum','context','exten','holdtime','assigned','lastAssignedTo','voice','mohtime','variables','exports','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','position','count','queuecallerabandon'];(function(_0x56d8e1,_0x227804){var _0x5f09af=function(_0x2cb378){while(--_0x2cb378){_0x56d8e1['push'](_0x56d8e1['shift']());}};_0x5f09af(++_0x227804);}(_0x4a2e,0x8c));var _0xe4a2=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0x4a2e[_0x2f16e5];return _0x5d082a;};'use strict';function QueueReport(){this[_0xe4a2('0x0')]=_0xe4a2('0x1');this[_0xe4a2('0x2')]='';this[_0xe4a2('0x3')]='';this[_0xe4a2('0x4')]='';this[_0xe4a2('0x5')]='';this['queuecallerjoinAt']=null;this[_0xe4a2('0x6')]=null;this[_0xe4a2('0x7')]=0x1;this[_0xe4a2('0x8')]=0x1;this[_0xe4a2('0x9')]=![];this[_0xe4a2('0xa')]=null;this[_0xe4a2('0xb')]=![];this[_0xe4a2('0xc')]=null;this[_0xe4a2('0xd')]=![];this[_0xe4a2('0xe')]=null;this['originalposition']=0x1;this['channel']='';this[_0xe4a2('0xf')]='';this['connectedlinename']='';this['accountcode']='';this[_0xe4a2('0x10')]='';this[_0xe4a2('0x11')]='';this['priority']='';this[_0xe4a2('0x12')]=0x0;this[_0xe4a2('0x13')]=![];this[_0xe4a2('0x14')]='';this['motionChannel']=_0xe4a2('0x15');this[_0xe4a2('0x16')]=0x0;this[_0xe4a2('0x17')]={};}module[_0xe4a2('0x18')]=QueueReport; \ No newline at end of file +var _0x72c6=['voice','mohtime','exports','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallercomplete','queuecallerexit','queuecallerexitAt','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo'];(function(_0x5d03ac,_0x4683e4){var _0xc6f478=function(_0x139d22){while(--_0x139d22){_0x5d03ac['push'](_0x5d03ac['shift']());}};_0xc6f478(++_0x4683e4);}(_0x72c6,0x1de));var _0x672c=function(_0x5683d1,_0x18c320){_0x5683d1=_0x5683d1-0x0;var _0x3cb96d=_0x72c6[_0x5683d1];return _0x3cb96d;};'use strict';function QueueReport(){this[_0x672c('0x0')]='inbound';this[_0x672c('0x1')]='';this[_0x672c('0x2')]='';this[_0x672c('0x3')]='';this[_0x672c('0x4')]='';this[_0x672c('0x5')]=null;this[_0x672c('0x6')]=null;this[_0x672c('0x7')]=0x1;this[_0x672c('0x8')]=0x1;this[_0x672c('0x9')]=![];this['queuecallerabandonAt']=null;this[_0x672c('0xa')]=![];this['queuecallercompleteAt']=null;this[_0x672c('0xb')]=![];this[_0x672c('0xc')]=null;this['originalposition']=0x1;this[_0x672c('0xd')]='';this[_0x672c('0xe')]='';this['connectedlinename']='';this[_0x672c('0xf')]='';this[_0x672c('0x10')]='';this[_0x672c('0x11')]='';this[_0x672c('0x12')]='';this[_0x672c('0x13')]=0x0;this[_0x672c('0x14')]=![];this[_0x672c('0x15')]='';this['motionChannel']=_0x672c('0x16');this[_0x672c('0x17')]=0x0;this['variables']={};}module[_0x672c('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index b405a67..0b7a1ef 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 _0x726f=['remoteUri','password','clientId','securityToken','type','serverUrl','Configurations','exports','name','username'];(function(_0x44caf2,_0x8ffb16){var _0x25978d=function(_0x1a2e61){while(--_0x1a2e61){_0x44caf2['push'](_0x44caf2['shift']());}};_0x25978d(++_0x8ffb16);}(_0x726f,0x1ca));var _0xf726=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x726f[_0x53ccf2];return _0x5a2964;};'use strict';function SalesforceAccount(_0x53c8bd){this['id']=_0x53c8bd['id']||0x0;this[_0xf726('0x0')]=_0x53c8bd[_0xf726('0x0')]||'';this[_0xf726('0x1')]=_0x53c8bd[_0xf726('0x1')]||'';this[_0xf726('0x2')]=_0x53c8bd[_0xf726('0x2')]||'';this[_0xf726('0x3')]=_0x53c8bd[_0xf726('0x3')]||'';this[_0xf726('0x4')]=_0x53c8bd[_0xf726('0x4')]||'';this['clientSecret']=_0x53c8bd['clientSecret']||'';this[_0xf726('0x5')]=_0x53c8bd['securityToken']||'';this[_0xf726('0x6')]=_0x53c8bd['type']||'integrationTab';this[_0xf726('0x7')]=_0x53c8bd[_0xf726('0x7')]||'';this[_0xf726('0x8')]=_0x53c8bd['Configurations']||{};}module[_0xf726('0x9')]=SalesforceAccount; \ No newline at end of file +var _0xfdf7=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports'];(function(_0x6899c7,_0x363413){var _0x5186ee=function(_0x2f83a9){while(--_0x2f83a9){_0x6899c7['push'](_0x6899c7['shift']());}};_0x5186ee(++_0x363413);}(_0xfdf7,0xfa));var _0x7fdf=function(_0x190dbd,_0x24a507){_0x190dbd=_0x190dbd-0x0;var _0x868d27=_0xfdf7[_0x190dbd];return _0x868d27;};'use strict';function SalesforceAccount(_0x24522b){this['id']=_0x24522b['id']||0x0;this['name']=_0x24522b['name']||'';this[_0x7fdf('0x0')]=_0x24522b['username']||'';this['remoteUri']=_0x24522b[_0x7fdf('0x1')]||'';this[_0x7fdf('0x2')]=_0x24522b[_0x7fdf('0x2')]||'';this[_0x7fdf('0x3')]=_0x24522b['clientId']||'';this[_0x7fdf('0x4')]=_0x24522b[_0x7fdf('0x4')]||'';this[_0x7fdf('0x5')]=_0x24522b[_0x7fdf('0x5')]||'';this[_0x7fdf('0x6')]=_0x24522b[_0x7fdf('0x6')]||'integrationTab';this['serverUrl']=_0x24522b[_0x7fdf('0x7')]||'';this[_0x7fdf('0x8')]=_0x24522b['Configurations']||{};}module[_0x7fdf('0x9')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4290aa6..fe22c23 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 _0x81d3=['name','username','password','remoteUri','Configurations','exports'];(function(_0x6ea3b5,_0x30c721){var _0x364dea=function(_0x30c328){while(--_0x30c328){_0x6ea3b5['push'](_0x6ea3b5['shift']());}};_0x364dea(++_0x30c721);}(_0x81d3,0x126));var _0x381d=function(_0x490c5b,_0x158fc7){_0x490c5b=_0x490c5b-0x0;var _0x464f6b=_0x81d3[_0x490c5b];return _0x464f6b;};'use strict';function ServicenowAccount(_0x101ee0){this['id']=_0x101ee0['id']||0x0;this[_0x381d('0x0')]=_0x101ee0[_0x381d('0x0')]||'';this['username']=_0x101ee0[_0x381d('0x1')]||'';this[_0x381d('0x2')]=_0x101ee0[_0x381d('0x2')]||'';this[_0x381d('0x3')]=_0x101ee0['remoteUri']||'';this['serverUrl']=_0x101ee0['serverUrl']||'';this[_0x381d('0x4')]=_0x101ee0[_0x381d('0x4')]||{};}module[_0x381d('0x5')]=ServicenowAccount; \ No newline at end of file +var _0x1bcf=['username','password','remoteUri','serverUrl','Configurations','name'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1bcf,0xd1));var _0xf1bc=function(_0xdd2bfa,_0x5bd304){_0xdd2bfa=_0xdd2bfa-0x0;var _0x55397e=_0x1bcf[_0xdd2bfa];return _0x55397e;};'use strict';function ServicenowAccount(_0x22a26d){this['id']=_0x22a26d['id']||0x0;this[_0xf1bc('0x0')]=_0x22a26d[_0xf1bc('0x0')]||'';this['username']=_0x22a26d[_0xf1bc('0x1')]||'';this[_0xf1bc('0x2')]=_0x22a26d[_0xf1bc('0x2')]||'';this[_0xf1bc('0x3')]=_0x22a26d[_0xf1bc('0x3')]||'';this[_0xf1bc('0x4')]=_0x22a26d['serverUrl']||'';this[_0xf1bc('0x5')]=_0x22a26d[_0xf1bc('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 58ba98f..aea3ae9 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 _0x694a=['Configurations','exports','name','username','remoteUri','serverUrl'];(function(_0x41fd01,_0x7d89c2){var _0x19f9a8=function(_0x183b63){while(--_0x183b63){_0x41fd01['push'](_0x41fd01['shift']());}};_0x19f9a8(++_0x7d89c2);}(_0x694a,0xda));var _0xa694=function(_0x120042,_0x1dcb92){_0x120042=_0x120042-0x0;var _0x2f13ee=_0x694a[_0x120042];return _0x2f13ee;};'use strict';function SugarcrmAccount(_0x3325e2){this['id']=_0x3325e2['id']||0x0;this[_0xa694('0x0')]=_0x3325e2[_0xa694('0x0')]||'';this[_0xa694('0x1')]=_0x3325e2[_0xa694('0x1')]||'';this['password']=_0x3325e2['password']||'';this[_0xa694('0x2')]=_0x3325e2[_0xa694('0x2')]||'';this[_0xa694('0x3')]=_0x3325e2[_0xa694('0x3')]||'';this[_0xa694('0x4')]=_0x3325e2[_0xa694('0x4')]||{};}module[_0xa694('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x1412=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x46cac5,_0x23d94a){var _0x2eca3d=function(_0x2617b0){while(--_0x2617b0){_0x46cac5['push'](_0x46cac5['shift']());}};_0x2eca3d(++_0x23d94a);}(_0x1412,0xf8));var _0x2141=function(_0x2369de,_0xe37aa9){_0x2369de=_0x2369de-0x0;var _0x1dc373=_0x1412[_0x2369de];return _0x1dc373;};'use strict';function SugarcrmAccount(_0x2f721c){this['id']=_0x2f721c['id']||0x0;this[_0x2141('0x0')]=_0x2f721c[_0x2141('0x0')]||'';this[_0x2141('0x1')]=_0x2f721c['username']||'';this[_0x2141('0x2')]=_0x2f721c[_0x2141('0x2')]||'';this[_0x2141('0x3')]=_0x2f721c[_0x2141('0x3')]||'';this[_0x2141('0x4')]=_0x2f721c['serverUrl']||'';this['Configurations']=_0x2f721c[_0x2141('0x5')]||{};}module[_0x2141('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 5cda6ac..0bf1f1c 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 _0x0507=['status','exports','name','accountcode','state','unknown'];(function(_0x5c8827,_0x5bc5d7){var _0x50ffd5=function(_0x4121bc){while(--_0x4121bc){_0x5c8827['push'](_0x5c8827['shift']());}};_0x50ffd5(++_0x5bc5d7);}(_0x0507,0x15e));var _0x7050=function(_0x4f5d2e,_0x4f6d78){_0x4f5d2e=_0x4f5d2e-0x0;var _0x37865e=_0x0507[_0x4f5d2e];return _0x37865e;};'use strict';function Telephone(_0x3aa2f6){this['id']=_0x3aa2f6['id']||0x0;this[_0x7050('0x0')]=_0x3aa2f6[_0x7050('0x0')]||'';this[_0x7050('0x1')]=_0x3aa2f6['accountcode']||'';this[_0x7050('0x2')]=_0x7050('0x3');this['stateTime']=0x0;this[_0x7050('0x4')]=_0x7050('0x3');this['address']='';}module[_0x7050('0x5')]=Telephone; \ No newline at end of file +var _0x608c=['exports','name','accountcode','state','unknown','stateTime','status','address'];(function(_0x11683b,_0x4298c7){var _0x58b5d0=function(_0x4b66f6){while(--_0x4b66f6){_0x11683b['push'](_0x11683b['shift']());}};_0x58b5d0(++_0x4298c7);}(_0x608c,0x1a1));var _0xc608=function(_0x6a7aba,_0x224b7f){_0x6a7aba=_0x6a7aba-0x0;var _0x4d5644=_0x608c[_0x6a7aba];return _0x4d5644;};'use strict';function Telephone(_0x591d7b){this['id']=_0x591d7b['id']||0x0;this['name']=_0x591d7b[_0xc608('0x0')]||'';this[_0xc608('0x1')]=_0x591d7b[_0xc608('0x1')]||'';this[_0xc608('0x2')]=_0xc608('0x3');this[_0xc608('0x4')]=0x0;this[_0xc608('0x5')]=_0xc608('0x3');this[_0xc608('0x6')]='';}module[_0xc608('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 f139dfe..0d66326 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 _0xb10b=['name','html'];(function(_0x5e308e,_0x5e970a){var _0x859cc6=function(_0x1df8cd){while(--_0x1df8cd){_0x5e308e['push'](_0x5e308e['shift']());}};_0x859cc6(++_0x5e970a);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ea2f9,_0x320917){_0x5ea2f9=_0x5ea2f9-0x0;var _0x36e586=_0xb10b[_0x5ea2f9];return _0x36e586;};'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 +var _0xb10b=['name','html'];(function(_0x347a52,_0x3d6db6){var _0x59027e=function(_0x5babe8){while(--_0x5babe8){_0x347a52['push'](_0x347a52['shift']());}};_0x59027e(++_0x3d6db6);}(_0xb10b,0x12a));var _0xbb10=function(_0x494315,_0x2d42bd){_0x494315=_0x494315-0x0;var _0x49cc18=_0xb10b[_0x494315];return _0x49cc18;};'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 bf25f56..8a114f3 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 _0x8603=['exports','name','channel','status','AllConditions','AnyConditions','Actions'];(function(_0x4f7e42,_0x436165){var _0x5bcdb9=function(_0x8f3bd5){while(--_0x8f3bd5){_0x4f7e42['push'](_0x4f7e42['shift']());}};_0x5bcdb9(++_0x436165);}(_0x8603,0x190));var _0x3860=function(_0x5b1aed,_0x322c17){_0x5b1aed=_0x5b1aed-0x0;var _0x26add8=_0x8603[_0x5b1aed];return _0x26add8;};'use strict';function Trigger(_0xba4b79){this['id']=_0xba4b79['id']||0x0;this[_0x3860('0x0')]=_0xba4b79[_0x3860('0x0')]||'';this[_0x3860('0x1')]=_0xba4b79['channel']||'voice';this[_0x3860('0x2')]=_0xba4b79[_0x3860('0x2')]||![];this[_0x3860('0x3')]=_0xba4b79['AllConditions']||[];this[_0x3860('0x4')]=_0xba4b79['AnyConditions']||[];this[_0x3860('0x5')]=_0xba4b79[_0x3860('0x5')]||[];}module[_0x3860('0x6')]=Trigger; \ No newline at end of file +var _0x5f66=['AllConditions','AnyConditions','Actions','name','channel','voice','status'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0x5f66,0x1a0));var _0x65f6=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5f66[_0x21a9d9];return _0x46adce;};'use strict';function Trigger(_0x253044){this['id']=_0x253044['id']||0x0;this[_0x65f6('0x0')]=_0x253044['name']||'';this[_0x65f6('0x1')]=_0x253044[_0x65f6('0x1')]||_0x65f6('0x2');this[_0x65f6('0x3')]=_0x253044[_0x65f6('0x3')]||![];this['AllConditions']=_0x253044[_0x65f6('0x4')]||[];this['AnyConditions']=_0x253044[_0x65f6('0x5')]||[];this[_0x65f6('0x6')]=_0x253044['Actions']||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 379cb45..c2b9199 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 _0x6ea8=['split','host','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','unknown','stateTime','status','registry','indexOf'];(function(_0x2c3428,_0x478abe){var _0x1d7201=function(_0x26336a){while(--_0x26336a){_0x2c3428['push'](_0x2c3428['shift']());}};_0x1d7201(++_0x478abe);}(_0x6ea8,0x103));var _0x86ea=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x6ea8[_0x4eafed];return _0x159c85;};'use strict';function Trunk(_0x392803){this['id']=_0x392803['id']||0x0;this[_0x86ea('0x0')]=_0x392803[_0x86ea('0x0')]||![];this[_0x86ea('0x1')]=_0x392803[_0x86ea('0x1')]||'';this['state']=_0x86ea('0x2');this[_0x86ea('0x3')]=0x0;this[_0x86ea('0x4')]=_0x86ea('0x2');this['registry']=_0x392803[_0x86ea('0x5')]&&_0x392803[_0x86ea('0x5')][_0x86ea('0x6')](':')?_0x392803[_0x86ea('0x5')][_0x86ea('0x7')](':')[0x0]:'';this[_0x86ea('0x8')]='';this['port']='';this['domain']='';this['domainport']='';this[_0x86ea('0x9')]='';this[_0x86ea('0xa')]='unknown';this[_0x86ea('0xb')]='';this['address']='';this[_0x86ea('0xc')]=_0x392803[_0x86ea('0xc')]||'';}module[_0x86ea('0xd')]=Trunk; \ No newline at end of file +var _0x14bb=['unknown','stateTime','status','registry','indexOf','split','host','domain','domainport','refresh','registrationtime','address','defaultuser','active','name','state'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x14bb,0x19d));var _0xb14b=function(_0x46944c,_0x44d53f){_0x46944c=_0x46944c-0x0;var _0x1f9dec=_0x14bb[_0x46944c];return _0x1f9dec;};'use strict';function Trunk(_0x1b073b){this['id']=_0x1b073b['id']||0x0;this[_0xb14b('0x0')]=_0x1b073b[_0xb14b('0x0')]||![];this[_0xb14b('0x1')]=_0x1b073b[_0xb14b('0x1')]||'';this[_0xb14b('0x2')]=_0xb14b('0x3');this[_0xb14b('0x4')]=0x0;this[_0xb14b('0x5')]=_0xb14b('0x3');this['registry']=_0x1b073b[_0xb14b('0x6')]&&_0x1b073b[_0xb14b('0x6')][_0xb14b('0x7')](':')?_0x1b073b['registry'][_0xb14b('0x8')](':')[0x0]:'';this[_0xb14b('0x9')]='';this['port']='';this[_0xb14b('0xa')]='';this[_0xb14b('0xb')]='';this[_0xb14b('0xc')]='';this['stateRegistry']=_0xb14b('0x3');this[_0xb14b('0xd')]='';this[_0xb14b('0xe')]='';this[_0xb14b('0xf')]=_0x1b073b[_0xb14b('0xf')]||'';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 3bd4fc6..88d7478 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 _0xcd3d=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x58175c,_0x2d9373){var _0x55b88f=function(_0x13ed84){while(--_0x13ed84){_0x58175c['push'](_0x58175c['shift']());}};_0x55b88f(++_0x2d9373);}(_0xcd3d,0x17c));var _0xdcd3=function(_0xd71895,_0x22368d){_0xd71895=_0xd71895-0x0;var _0xc0b602=_0xcd3d[_0xd71895];return _0xc0b602;};'use strict';function voiceExtension(_0x27b30a){this['id']=_0x27b30a['id']||0x0;this[_0xdcd3('0x0')]=_0x27b30a[_0xdcd3('0x0')]||'';this['recordingFormat']=_0x27b30a[_0xdcd3('0x1')]||_0xdcd3('0x2');this[_0xdcd3('0x3')]=_0x27b30a[_0xdcd3('0x3')]||![];}module[_0xdcd3('0x4')]=voiceExtension; \ No newline at end of file +var _0x2aa8=['exten','recordingFormat','none','mandatoryDisposition'];(function(_0x1559a0,_0x9b8fd7){var _0x37e36f=function(_0x1bf6ad){while(--_0x1bf6ad){_0x1559a0['push'](_0x1559a0['shift']());}};_0x37e36f(++_0x9b8fd7);}(_0x2aa8,0x150));var _0x82aa=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x2aa8[_0x57b54c];return _0x59cc19;};'use strict';function voiceExtension(_0x602407){this['id']=_0x602407['id']||0x0;this['exten']=_0x602407[_0x82aa('0x0')]||'';this[_0x82aa('0x1')]=_0x602407[_0x82aa('0x1')]||_0x82aa('0x2');this['mandatoryDisposition']=_0x602407[_0x82aa('0x3')]||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index a1b4b56..a1fc4c7 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 _0x26a2=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialPreviewAutoRecallMe','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','unavailable','ringing','ringinuse','onhold','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','total','answered','sumDuration','sumHoldTime','sumBillable','unmanaged','abandoned','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','temp','dialTimezone','dialGlobalInterval','dialMethod','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','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay'];(function(_0x216799,_0x44b817){var _0x3661c3=function(_0x28f85e){while(--_0x28f85e){_0x216799['push'](_0x216799['shift']());}};_0x3661c3(++_0x44b817);}(_0x26a2,0xa7));var _0x226a=function(_0x5beab3,_0x291dd0){_0x5beab3=_0x5beab3-0x0;var _0x5518ab=_0x26a2[_0x5beab3];return _0x5518ab;};'use strict';var statusDesc=['unknown',_0x226a('0x0'),_0x226a('0x1'),_0x226a('0x2'),'invalid',_0x226a('0x3'),_0x226a('0x4'),_0x226a('0x5'),_0x226a('0x6')];var monitorFormat={'wav':_0x226a('0x7'),'wav49':'wav49','gsm':_0x226a('0x8')};var strategy={'rrmemory':_0x226a('0x9'),'roundrobin':'roundrobin'};function VoiceQueue(_0x5b8fac){this['id']=_0x5b8fac['id']||0x0;this[_0x226a('0xa')]=_0x5b8fac[_0x226a('0xa')]||'';this[_0x226a('0xb')]=_0x5b8fac[_0x226a('0xb')]||'';this[_0x226a('0xc')]=_0x5b8fac[_0x226a('0xc')]||_0x226a('0xd');this[_0x226a('0xe')]=0x0;this['talking']=0x0;this[_0x226a('0xf')]=0x0;this[_0x226a('0x10')]=0x0;this[_0x226a('0x11')]=0x0;this[_0x226a('0x12')]=0x0;this[_0x226a('0x13')]=0x0;this[_0x226a('0x14')]=0x0;this[_0x226a('0x15')]=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0x226a('0x16')]=_0x5b8fac[_0x226a('0x16')]||![];this[_0x226a('0x17')]=_0x5b8fac[_0x226a('0x17')]||0xa;this[_0x226a('0x18')]=_0x5b8fac['autopause']||'no';this[_0x226a('0x19')]=!![];this['message']='';this[_0x226a('0x1a')]=0x0;this[_0x226a('0x1b')]=0x0;this[_0x226a('0x1c')]=_0x5b8fac[_0x226a('0x1c')]||null;this[_0x226a('0x1d')]=_0x5b8fac[_0x226a('0x1d')]?_0x5b8fac[_0x226a('0x1d')]:null;this['dialActive']=_0x5b8fac['dialActive'];this[_0x226a('0x1e')]=_0x5b8fac[_0x226a('0x1e')]||'progressive';this[_0x226a('0x1f')]=_0x5b8fac[_0x226a('0x1f')]||0x0;this['dialLimitQueue']=_0x5b8fac[_0x226a('0x20')]||0x0;this[_0x226a('0x21')]=_0x5b8fac[_0x226a('0x21')]||0x1;this[_0x226a('0x22')]=_0x5b8fac[_0x226a('0x22')]||_0x226a('0x23');this[_0x226a('0x24')]=_0x5b8fac[_0x226a('0x24')]||0.03;this[_0x226a('0x25')]=_0x5b8fac['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x5b8fac[_0x226a('0x26')]||_0x226a('0x27');this['dialOriginateCallerIdNumber']=_0x5b8fac[_0x226a('0x28')]||_0x226a('0x27');this['dialOriginateTimeout']=_0x5b8fac[_0x226a('0x29')]||0x1e;this[_0x226a('0x2a')]=_0x5b8fac['dialQueueOptions']||_0x226a('0x2b');this['dialQueueTimeout']=_0x5b8fac[_0x226a('0x2c')]||0x3;this[_0x226a('0x2d')]=_0x5b8fac[_0x226a('0x2d')]||undefined;this[_0x226a('0x2e')]=_0x5b8fac['dialCongestionMaxRetry']||0x3;this[_0x226a('0x2f')]=_0x5b8fac['dialCongestionRetryFrequency']||0x96;this[_0x226a('0x30')]=_0x5b8fac[_0x226a('0x30')]||0x3;this[_0x226a('0x31')]=_0x5b8fac[_0x226a('0x31')]||0x96;this[_0x226a('0x32')]=_0x5b8fac['dialNoAnswerMaxRetry']||0x3;this[_0x226a('0x33')]=_0x5b8fac[_0x226a('0x33')]||0x96;this[_0x226a('0x34')]=_0x5b8fac['dialNoSuchNumberMaxRetry']||0x3;this['dialNoSuchNumberRetryFrequency']=_0x5b8fac[_0x226a('0x35')]||0x96;this[_0x226a('0x36')]=_0x5b8fac['dialDropMaxRetry']||0x3;this[_0x226a('0x37')]=_0x5b8fac[_0x226a('0x37')]||0x96;this[_0x226a('0x38')]=_0x5b8fac[_0x226a('0x38')]||0x3;this[_0x226a('0x39')]=_0x5b8fac[_0x226a('0x39')]||0x96;this[_0x226a('0x3a')]=_0x5b8fac[_0x226a('0x3a')]||0x3;this['dialMachineRetryFrequency']=_0x5b8fac[_0x226a('0x3b')]||0x96;this[_0x226a('0x3c')]=_0x5b8fac[_0x226a('0x3c')]||0x3;this[_0x226a('0x3d')]=_0x5b8fac[_0x226a('0x3d')]||0x96;this['dialGlobalMaxRetry']=_0x5b8fac[_0x226a('0x3e')]||0x4;this[_0x226a('0x3f')]=_0x5b8fac[_0x226a('0x3f')]?_0x5b8fac[_0x226a('0x3f')]:undefined;this[_0x226a('0x40')]=_0x5b8fac[_0x226a('0x40')]?_0x5b8fac[_0x226a('0x40')]:undefined;this['dialPrefix']=_0x5b8fac[_0x226a('0x41')]||undefined;this[_0x226a('0x42')]=_0x5b8fac[_0x226a('0x42')]?_0x5b8fac['Interval']:undefined;this['dialOrderByScheduledAt']=_0x5b8fac[_0x226a('0x43')]||_0x226a('0x44');this[_0x226a('0x45')]=_0x5b8fac['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x226a('0x46')]=_0x5b8fac[_0x226a('0x46')]||undefined;this[_0x226a('0x47')]=strategy[_0x5b8fac[_0x226a('0x47')]]||_0x226a('0x9');this[_0x226a('0x48')]=!![];this[_0x226a('0x49')]=_0x5b8fac['dialAMDActive']||![];this['dialAMDInitialSilence']=_0x5b8fac[_0x226a('0x4a')];this[_0x226a('0x4b')]=_0x5b8fac['dialAMDGreeting'];this[_0x226a('0x4c')]=_0x5b8fac[_0x226a('0x4c')];this[_0x226a('0x4d')]=_0x5b8fac[_0x226a('0x4d')];this[_0x226a('0x4e')]=_0x5b8fac[_0x226a('0x4e')];this[_0x226a('0x4f')]=_0x5b8fac['dialAMDBetweenWordsSilence'];this[_0x226a('0x50')]=_0x5b8fac[_0x226a('0x50')];this[_0x226a('0x51')]=_0x5b8fac[_0x226a('0x51')];this[_0x226a('0x52')]=_0x5b8fac[_0x226a('0x52')];this[_0x226a('0x53')]=0x0;this[_0x226a('0x54')]=0x0;this[_0x226a('0x55')]=_0x5b8fac[_0x226a('0x55')];this[_0x226a('0x56')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0x226a('0x57')]=0x0;this[_0x226a('0x58')]=0x0;this[_0x226a('0x59')]=0x0;this[_0x226a('0x5a')]=0x0;this[_0x226a('0x5b')]=0x0;this[_0x226a('0x5c')]=0x0;this[_0x226a('0x5d')]=0x0;this[_0x226a('0x5e')]=0x0;this[_0x226a('0x5f')]=0x0;this['outboundReCallsDay']=0x0;this[_0x226a('0x60')]=0x0;this[_0x226a('0x61')]=undefined;this[_0x226a('0x62')]=undefined;this[_0x226a('0x63')]=undefined;this[_0x226a('0x64')]=1.05;this[_0x226a('0x65')]=0x0;this[_0x226a('0x66')]=0x0;this[_0x226a('0x67')]=0x0;this[_0x226a('0x68')]=0x0;this[_0x226a('0x69')]=0x0;this[_0x226a('0x6a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x226a('0x6b')]=0x0;this[_0x226a('0x6c')]=_0x5b8fac['dialPredictiveIntervalMaxThreshold']||0x14;this[_0x226a('0x6d')]=_0x5b8fac[_0x226a('0x6e')]||0xa;this[_0x226a('0x6f')]=0x0;this[_0x226a('0x70')]=0x0;this[_0x226a('0x71')]=0x1;this[_0x226a('0x72')]=0x0;this[_0x226a('0x73')]=0x0;this[_0x226a('0x74')]=0x0;this[_0x226a('0x75')]=0x0;this[_0x226a('0x76')]=_0x5b8fac['dialRecallMeTimeout']||0x1e;this[_0x226a('0x77')]=_0x5b8fac[_0x226a('0x77')]||![];this[_0x226a('0x78')]=!!_0x5b8fac[_0x226a('0x78')]||![];this['dialQueueProject2']=_0x5b8fac[_0x226a('0x79')]||undefined;this[_0x226a('0x7a')]=_0x5b8fac['dialAgiAfterHangupClient']||![];this[_0x226a('0x7b')]=_0x5b8fac[_0x226a('0x7b')]||![];this[_0x226a('0xb')]=monitorFormat[_0x5b8fac[_0x226a('0xb')]]?monitorFormat[_0x5b8fac[_0x226a('0xb')]]:undefined;this['mandatoryDisposition']=_0x5b8fac[_0x226a('0x7c')]||![];this[_0x226a('0x7d')]=_0x5b8fac['mandatoryDispositionPause']?_0x5b8fac['mandatoryDispositionPause']:undefined;}module[_0x226a('0x7e')]=VoiceQueue; \ No newline at end of file +var _0xfb5b=['dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCallsDroppedCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','monitor_format','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','busy','unavailable','ringing','wav','wav49','rrmemory','roundrobin','name','type','waiting','talking','total','answered','sumHoldTime','sumBillable','unmanaged','available','acw','acwTimeout','autopause','sendMessageOneNotActive','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords'];(function(_0x19b276,_0x268f52){var _0x72a40e=function(_0x486a11){while(--_0x486a11){_0x19b276['push'](_0x19b276['shift']());}};_0x72a40e(++_0x268f52);}(_0xfb5b,0x1f0));var _0xbfb5=function(_0x31f0f4,_0x56eb1a){_0x31f0f4=_0x31f0f4-0x0;var _0x21f7d8=_0xfb5b[_0x31f0f4];return _0x21f7d8;};'use strict';var statusDesc=['unknown',_0xbfb5('0x0'),_0xbfb5('0x1'),_0xbfb5('0x2'),'invalid',_0xbfb5('0x3'),_0xbfb5('0x4'),'ringinuse','onhold'];var monitorFormat={'wav':_0xbfb5('0x5'),'wav49':_0xbfb5('0x6'),'gsm':'gsm'};var strategy={'rrmemory':_0xbfb5('0x7'),'roundrobin':_0xbfb5('0x8')};function VoiceQueue(_0x4573ef){this['id']=_0x4573ef['id']||0x0;this[_0xbfb5('0x9')]=_0x4573ef[_0xbfb5('0x9')]||'';this['monitor_format']=_0x4573ef['monitor_format']||'';this[_0xbfb5('0xa')]=_0x4573ef[_0xbfb5('0xa')]||'inbound';this[_0xbfb5('0xb')]=0x0;this[_0xbfb5('0xc')]=0x0;this[_0xbfb5('0xd')]=0x0;this[_0xbfb5('0xe')]=0x0;this['sumDuration']=0x0;this[_0xbfb5('0xf')]=0x0;this[_0xbfb5('0x10')]=0x0;this[_0xbfb5('0x11')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this[_0xbfb5('0x12')]=0x0;this[_0xbfb5('0x13')]=_0x4573ef[_0xbfb5('0x13')]||![];this[_0xbfb5('0x14')]=_0x4573ef[_0xbfb5('0x14')]||0xa;this[_0xbfb5('0x15')]=_0x4573ef[_0xbfb5('0x15')]||'no';this[_0xbfb5('0x16')]=!![];this['message']='';this[_0xbfb5('0x17')]=0x0;this['temp']=0x0;this[_0xbfb5('0x18')]=_0x4573ef[_0xbfb5('0x18')]||null;this[_0xbfb5('0x19')]=_0x4573ef[_0xbfb5('0x19')]?_0x4573ef['dialGlobalInterval']:null;this[_0xbfb5('0x1a')]=_0x4573ef['dialActive'];this[_0xbfb5('0x1b')]=_0x4573ef[_0xbfb5('0x1b')]||'progressive';this[_0xbfb5('0x1c')]=_0x4573ef[_0xbfb5('0x1c')]||0x0;this[_0xbfb5('0x1d')]=_0x4573ef['dialLimitQueue']||0x0;this[_0xbfb5('0x1e')]=_0x4573ef[_0xbfb5('0x1e')]||0x1;this['dialPredictiveOptimization']=_0x4573ef[_0xbfb5('0x1f')]||_0xbfb5('0x20');this[_0xbfb5('0x21')]=_0x4573ef[_0xbfb5('0x21')]||0.03;this[_0xbfb5('0x22')]=_0x4573ef[_0xbfb5('0x22')]||0x258;this[_0xbfb5('0x23')]=_0x4573ef[_0xbfb5('0x23')]||_0xbfb5('0x24');this[_0xbfb5('0x25')]=_0x4573ef[_0xbfb5('0x25')]||'anonymous';this['dialOriginateTimeout']=_0x4573ef[_0xbfb5('0x26')]||0x1e;this[_0xbfb5('0x27')]=_0x4573ef['dialQueueOptions']||_0xbfb5('0x28');this[_0xbfb5('0x29')]=_0x4573ef[_0xbfb5('0x29')]||0x3;this['dialQueueProject']=_0x4573ef[_0xbfb5('0x2a')]||undefined;this[_0xbfb5('0x2b')]=_0x4573ef[_0xbfb5('0x2b')]||0x3;this['dialCongestionRetryFrequency']=_0x4573ef[_0xbfb5('0x2c')]||0x96;this[_0xbfb5('0x2d')]=_0x4573ef[_0xbfb5('0x2d')]||0x3;this['dialBusyRetryFrequency']=_0x4573ef[_0xbfb5('0x2e')]||0x96;this['dialNoAnswerMaxRetry']=_0x4573ef['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x4573ef['dialNoAnswerRetryFrequency']||0x96;this[_0xbfb5('0x2f')]=_0x4573ef[_0xbfb5('0x2f')]||0x3;this[_0xbfb5('0x30')]=_0x4573ef[_0xbfb5('0x30')]||0x96;this[_0xbfb5('0x31')]=_0x4573ef[_0xbfb5('0x31')]||0x3;this[_0xbfb5('0x32')]=_0x4573ef[_0xbfb5('0x32')]||0x96;this['dialAbandonedMaxRetry']=_0x4573ef[_0xbfb5('0x33')]||0x3;this['dialAbandonedRetryFrequency']=_0x4573ef[_0xbfb5('0x34')]||0x96;this[_0xbfb5('0x35')]=_0x4573ef[_0xbfb5('0x35')]||0x3;this[_0xbfb5('0x36')]=_0x4573ef[_0xbfb5('0x36')]||0x96;this[_0xbfb5('0x37')]=_0x4573ef[_0xbfb5('0x37')]||0x3;this[_0xbfb5('0x38')]=_0x4573ef[_0xbfb5('0x38')]||0x96;this['dialGlobalMaxRetry']=_0x4573ef['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x4573ef[_0xbfb5('0x39')]?_0x4573ef['Trunk']:undefined;this['TrunkBackup']=_0x4573ef[_0xbfb5('0x3a')]?_0x4573ef[_0xbfb5('0x3a')]:undefined;this['dialPrefix']=_0x4573ef[_0xbfb5('0x3b')]||undefined;this[_0xbfb5('0x3c')]=_0x4573ef[_0xbfb5('0x3c')]?_0x4573ef[_0xbfb5('0x3c')]:undefined;this[_0xbfb5('0x3d')]=_0x4573ef[_0xbfb5('0x3d')]||'DESC';this[_0xbfb5('0x3e')]=_0x4573ef[_0xbfb5('0x3e')]||undefined;this['dialCutDigit']=_0x4573ef[_0xbfb5('0x3f')]||undefined;this[_0xbfb5('0x40')]=strategy[_0x4573ef[_0xbfb5('0x40')]]||_0xbfb5('0x7');this[_0xbfb5('0x41')]=!![];this[_0xbfb5('0x42')]=_0x4573ef['dialAMDActive']||![];this[_0xbfb5('0x43')]=_0x4573ef['dialAMDInitialSilence'];this[_0xbfb5('0x44')]=_0x4573ef['dialAMDGreeting'];this[_0xbfb5('0x45')]=_0x4573ef[_0xbfb5('0x45')];this[_0xbfb5('0x46')]=_0x4573ef['dialAMDTotalAnalysisTime'];this[_0xbfb5('0x47')]=_0x4573ef['dialAMDMinWordLength'];this[_0xbfb5('0x48')]=_0x4573ef['dialAMDBetweenWordsSilence'];this[_0xbfb5('0x49')]=_0x4573ef[_0xbfb5('0x49')];this['dialAMDSilenceThreshold']=_0x4573ef[_0xbfb5('0x4a')];this['dialAMDMaximumWordLength']=_0x4573ef[_0xbfb5('0x4b')];this[_0xbfb5('0x4c')]=0x0;this[_0xbfb5('0x4d')]=0x0;this[_0xbfb5('0x4e')]=_0x4573ef[_0xbfb5('0x4e')];this[_0xbfb5('0x4f')]=0x0;this[_0xbfb5('0x50')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xbfb5('0x51')]=0x0;this[_0xbfb5('0x52')]=0x0;this[_0xbfb5('0x53')]=0x0;this[_0xbfb5('0x54')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xbfb5('0x55')]=0x0;this[_0xbfb5('0x56')]=0x0;this[_0xbfb5('0x57')]=0x0;this[_0xbfb5('0x58')]=0x0;this[_0xbfb5('0x59')]=0x0;this[_0xbfb5('0x5a')]=0x0;this[_0xbfb5('0x5b')]=undefined;this[_0xbfb5('0x5c')]=undefined;this[_0xbfb5('0x5d')]=undefined;this['predictiveIntervalMultiplicativeFactor']=1.05;this[_0xbfb5('0x5e')]=0x0;this[_0xbfb5('0x5f')]=0x0;this[_0xbfb5('0x60')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0xbfb5('0x61')]=0x0;this[_0xbfb5('0x62')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xbfb5('0x63')]=0x0;this[_0xbfb5('0x64')]=_0x4573ef[_0xbfb5('0x65')]||0x14;this['predictiveIntervalMinThreshold']=_0x4573ef['dialPredictiveIntervalMaxThreshold']||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0xbfb5('0x66')]=0x0;this['predictiveIntervalHitRate']=0x1;this['erlangCalls']=0x0;this[_0xbfb5('0x67')]=0x0;this[_0xbfb5('0x68')]=0x0;this['erlangBusyFactor']=0x0;this[_0xbfb5('0x69')]=_0x4573ef[_0xbfb5('0x69')]||0x1e;this['dialRecallInQueue']=_0x4573ef[_0xbfb5('0x6a')]||![];this['dialPreviewAutoRecallMe']=!!_0x4573ef['dialPreviewAutoRecallMe']||![];this[_0xbfb5('0x6b')]=_0x4573ef['dialQueueProject2']||undefined;this[_0xbfb5('0x6c')]=_0x4573ef[_0xbfb5('0x6c')]||![];this[_0xbfb5('0x6d')]=_0x4573ef[_0xbfb5('0x6d')]||![];this['monitor_format']=monitorFormat[_0x4573ef[_0xbfb5('0x6e')]]?monitorFormat[_0x4573ef[_0xbfb5('0x6e')]]:undefined;this[_0xbfb5('0x6f')]=_0x4573ef[_0xbfb5('0x6f')]||![];this[_0xbfb5('0x70')]=_0x4573ef['mandatoryDispositionPause']?_0x4573ef['mandatoryDispositionPause']:undefined;}module[_0xbfb5('0x71')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index a52c8b5..f1334f5 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 _0x18bd=['exports','name','username','accessKey','remoteUri','Configurations'];(function(_0x1d5f2f,_0x15c985){var _0x37b0f3=function(_0x2e4af4){while(--_0x2e4af4){_0x1d5f2f['push'](_0x1d5f2f['shift']());}};_0x37b0f3(++_0x15c985);}(_0x18bd,0x1f3));var _0xd18b=function(_0xb34b55,_0x3c576a){_0xb34b55=_0xb34b55-0x0;var _0x48ef0e=_0x18bd[_0xb34b55];return _0x48ef0e;};'use strict';function VtigerAccount(_0x340a98){this['id']=_0x340a98['id']||0x0;this[_0xd18b('0x0')]=_0x340a98[_0xd18b('0x0')]||'';this['username']=_0x340a98[_0xd18b('0x1')]||'';this[_0xd18b('0x2')]=_0x340a98[_0xd18b('0x2')]||'';this[_0xd18b('0x3')]=_0x340a98[_0xd18b('0x3')]||'';this['serverUrl']=_0x340a98['serverUrl']||'';this[_0xd18b('0x4')]=_0x340a98[_0xd18b('0x4')]||{};}module[_0xd18b('0x5')]=VtigerAccount; \ No newline at end of file +var _0xf81f=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x328534,_0x33b41e){var _0x2796c0=function(_0x1ba8ad){while(--_0x1ba8ad){_0x328534['push'](_0x328534['shift']());}};_0x2796c0(++_0x33b41e);}(_0xf81f,0x118));var _0xff81=function(_0x597bec,_0x35d3c1){_0x597bec=_0x597bec-0x0;var _0x25b17b=_0xf81f[_0x597bec];return _0x25b17b;};'use strict';function VtigerAccount(_0x14f4e8){this['id']=_0x14f4e8['id']||0x0;this[_0xff81('0x0')]=_0x14f4e8[_0xff81('0x0')]||'';this[_0xff81('0x1')]=_0x14f4e8[_0xff81('0x1')]||'';this[_0xff81('0x2')]=_0x14f4e8['accessKey']||'';this[_0xff81('0x3')]=_0x14f4e8[_0xff81('0x3')]||'';this[_0xff81('0x4')]=_0x14f4e8[_0xff81('0x4')]||'';this['Configurations']=_0x14f4e8[_0xff81('0x5')]||{};}module[_0xff81('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 5f420ea..95c057f 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 _0x392c=['integrationTab','serverUrl','Configurations','exports','name','password','token','remoteUri','authType','type'];(function(_0x5ef77c,_0x14c957){var _0x55bd9c=function(_0x4b056b){while(--_0x4b056b){_0x5ef77c['push'](_0x5ef77c['shift']());}};_0x55bd9c(++_0x14c957);}(_0x392c,0x19e));var _0xc392=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x392c[_0x3dd15e];return _0x231fd0;};'use strict';function ZendeskAccount(_0x101fda){this['id']=_0x101fda['id']||0x0;this[_0xc392('0x0')]=_0x101fda['name']||'';this['username']=_0x101fda['username']||'';this[_0xc392('0x1')]=_0x101fda['password']||'';this[_0xc392('0x2')]=_0x101fda[_0xc392('0x2')]||'';this['remoteUri']=_0x101fda[_0xc392('0x3')]||'';this[_0xc392('0x4')]=_0x101fda['authType']||'';this[_0xc392('0x5')]=_0x101fda[_0xc392('0x5')]||_0xc392('0x6');this[_0xc392('0x7')]=_0x101fda['serverUrl']||'';this[_0xc392('0x8')]=_0x101fda[_0xc392('0x8')]||{};}module[_0xc392('0x9')]=ZendeskAccount; \ No newline at end of file +var _0xfc40=['type','serverUrl','Configurations','name','username','password','token','remoteUri','authType'];(function(_0x1de4c2,_0x5ca773){var _0x5e4668=function(_0x19bec8){while(--_0x19bec8){_0x1de4c2['push'](_0x1de4c2['shift']());}};_0x5e4668(++_0x5ca773);}(_0xfc40,0x81));var _0x0fc4=function(_0x4e983f,_0x4230c9){_0x4e983f=_0x4e983f-0x0;var _0x1cdaf3=_0xfc40[_0x4e983f];return _0x1cdaf3;};'use strict';function ZendeskAccount(_0x5d0833){this['id']=_0x5d0833['id']||0x0;this['name']=_0x5d0833[_0x0fc4('0x0')]||'';this[_0x0fc4('0x1')]=_0x5d0833[_0x0fc4('0x1')]||'';this[_0x0fc4('0x2')]=_0x5d0833['password']||'';this[_0x0fc4('0x3')]=_0x5d0833[_0x0fc4('0x3')]||'';this[_0x0fc4('0x4')]=_0x5d0833[_0x0fc4('0x4')]||'';this[_0x0fc4('0x5')]=_0x5d0833[_0x0fc4('0x5')]||'';this[_0x0fc4('0x6')]=_0x5d0833[_0x0fc4('0x6')]||'integrationTab';this[_0x0fc4('0x7')]=_0x5d0833[_0x0fc4('0x7')]||'';this[_0x0fc4('0x8')]=_0x5d0833['Configurations']||{};}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 13b07cc..657231a 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 _0x7f4e=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x189d73,_0x286380){var _0x12f137=function(_0x2c79ad){while(--_0x2c79ad){_0x189d73['push'](_0x189d73['shift']());}};_0x12f137(++_0x286380);}(_0x7f4e,0x145));var _0xe7f4=function(_0x2ce4eb,_0x251b12){_0x2ce4eb=_0x2ce4eb-0x0;var _0x2d9007=_0x7f4e[_0x2ce4eb];return _0x2d9007;};'use strict';function ZohoAccount(_0x9b6da3){this['id']=_0x9b6da3['id']||0x0;this[_0xe7f4('0x0')]=_0x9b6da3['name']||'';this[_0xe7f4('0x1')]=_0x9b6da3[_0xe7f4('0x1')]||'';this[_0xe7f4('0x2')]=_0x9b6da3[_0xe7f4('0x2')]||'';this[_0xe7f4('0x3')]=_0x9b6da3[_0xe7f4('0x3')]||'';this[_0xe7f4('0x4')]=_0x9b6da3['clientId']||'';this[_0xe7f4('0x5')]=_0x9b6da3[_0xe7f4('0x5')]||'';this[_0xe7f4('0x6')]=_0x9b6da3[_0xe7f4('0x6')]||'';this[_0xe7f4('0x7')]=_0x9b6da3[_0xe7f4('0x7')]||'';this[_0xe7f4('0x8')]=_0x9b6da3[_0xe7f4('0x8')]||'';this['Configurations']=_0x9b6da3[_0xe7f4('0x9')]||{};}module[_0xe7f4('0xa')]=ZohoAccount; \ No newline at end of file +var _0xeb3b=['host','zone','clientId','clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description'];(function(_0x1928cf,_0x2e72a4){var _0x2782d9=function(_0x33ea63){while(--_0x33ea63){_0x1928cf['push'](_0x1928cf['shift']());}};_0x2782d9(++_0x2e72a4);}(_0xeb3b,0x11c));var _0xbeb3=function(_0x228a4a,_0x23d65e){_0x228a4a=_0x228a4a-0x0;var _0x3d3937=_0xeb3b[_0x228a4a];return _0x3d3937;};'use strict';function ZohoAccount(_0x2e4936){this['id']=_0x2e4936['id']||0x0;this[_0xbeb3('0x0')]=_0x2e4936[_0xbeb3('0x0')]||'';this[_0xbeb3('0x1')]=_0x2e4936[_0xbeb3('0x1')]||'';this[_0xbeb3('0x2')]=_0x2e4936[_0xbeb3('0x2')]||'';this[_0xbeb3('0x3')]=_0x2e4936[_0xbeb3('0x3')]||'';this[_0xbeb3('0x4')]=_0x2e4936[_0xbeb3('0x4')]||'';this[_0xbeb3('0x5')]=_0x2e4936[_0xbeb3('0x5')]||'';this[_0xbeb3('0x6')]=_0x2e4936[_0xbeb3('0x6')]||'';this['code']=_0x2e4936[_0xbeb3('0x7')]||'';this[_0xbeb3('0x8')]=_0x2e4936['refreshToken']||'';this[_0xbeb3('0x9')]=_0x2e4936['Configurations']||{};}module[_0xbeb3('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 19a7577..ef675c0 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 _0xf2b2=['ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','exports','moment','isNil','string','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','SIP/%s','calleridname','Contact','phone','firstName','lastName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme'];(function(_0xf5bc4e,_0x15162c){var _0x1f9f7b=function(_0x5c3564){while(--_0x5c3564){_0xf5bc4e['push'](_0xf5bc4e['shift']());}};_0x1f9f7b(++_0x15162c);}(_0xf2b2,0x151));var _0x2f2b=function(_0x474158,_0x219dd2){_0x474158=_0x474158-0x0;var _0x38491a=_0xf2b2[_0x474158];return _0x38491a;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x2f2b('0x0'));function checkNameSurname(_0x81cd3e,_0x43d219,_0x1f9142){var _0x150b09='';if(!_[_0x2f2b('0x1')](_0x43d219)&&_0x2f2b('0x2')===typeof _0x43d219){_0x150b09+=_0x43d219;}if(!_['isNil'](_0x1f9142)&&_0x2f2b('0x2')===typeof _0x1f9142){_0x150b09+='\x20'+_0x1f9142;}if(_0x150b09!==''){return _0x150b09;}return _0x81cd3e;}function Action(_0x360185,_0x552973,_0x4cbeb8,_0x2203a4,_0x3e25af){this['uniqueid']=_0x4cbeb8||undefined;this[_0x2f2b('0x3')]=_0x360185['id'];this['queue']=_0x552973[_0x2f2b('0x4')];this[_0x2f2b('0x5')]=_0x552973[_0x2f2b('0x5')];this[_0x2f2b('0x6')]=_0x2f2b('0x7');this[_0x2f2b('0x8')]=![];this[_0x2f2b('0x9')]=_['isNil'](_0x360185[_0x2f2b('0xa')])?undefined:_0x360185[_0x2f2b('0xa')][_0x2f2b('0x4')];this['channelAgent']=this[_0x2f2b('0x9')]?util['format'](_0x2f2b('0xb'),this[_0x2f2b('0x9')]):_0x2203a4||undefined;this[_0x2f2b('0xc')]=checkNameSurname(_0x360185[_0x2f2b('0xd')][_0x2f2b('0xe')],_0x360185['Contact'][_0x2f2b('0xf')],_0x360185['Contact'][_0x2f2b('0x10')]);this[_0x2f2b('0x11')]=_0x360185['active']||![];this['calleridnum']=_0x360185[_0x2f2b('0xd')]['phone'];this[_0x2f2b('0x12')]=_0x360185[_0x2f2b('0x12')];this[_0x2f2b('0x13')]=_0x360185['countbusyretry']||0x0;this[_0x2f2b('0x14')]=_0x360185['countcongestionretry']||0x0;this[_0x2f2b('0x15')]=_0x360185[_0x2f2b('0x15')]||0x0;this[_0x2f2b('0x16')]=(_0x360185[_0x2f2b('0x13')]||0x0)+(_0x360185[_0x2f2b('0x14')]||0x0)+(_0x360185[_0x2f2b('0x15')]||0x0)+(_0x360185[_0x2f2b('0x17')]||0x0)+(_0x360185[_0x2f2b('0x18')]||0x0)+(_0x360185[_0x2f2b('0x19')]||0x0)+(_0x360185[_0x2f2b('0x1a')]||0x0)+(_0x360185[_0x2f2b('0x1b')]||0x0);this['countnosuchnumberretry']=_0x360185[_0x2f2b('0x17')]||0x0;this['countdropretry']=_0x360185['countdropretry']||0x0;this[_0x2f2b('0x19')]=_0x360185['countabandonedretry']||0x0;this['countmachineretry']=_0x360185[_0x2f2b('0x1a')]||0x0;this[_0x2f2b('0x1b')]=_0x360185[_0x2f2b('0x1b')]||0x0;this[_0x2f2b('0x1c')]=_0x360185[_0x2f2b('0x1c')];this['callbackuniqueid']=_0x360185[_0x2f2b('0x1d')];this[_0x2f2b('0x1e')]=_0x360185[_0x2f2b('0x1e')];this['recallme']=_0x360185[_0x2f2b('0x1f')];this['ContactId']=_0x360185['ContactId'];this[_0x2f2b('0x20')]=_0x360185[_0x2f2b('0x20')];this[_0x2f2b('0x21')]=_[_0x2f2b('0x1')](_0x360185['Agent'])?_0x360185['UserId']:_0x360185[_0x2f2b('0xa')]['id'];this['VoiceQueueId']=_0x360185[_0x2f2b('0x22')];this[_0x2f2b('0x23')]='';this[_0x2f2b('0x24')]='';}Action[_0x2f2b('0x25')][_0x2f2b('0x26')]=function(){return util['format'](_0x2f2b('0x27'),this['calleridname'],this['number']);};module[_0x2f2b('0x28')]=Action; \ No newline at end of file +var _0x9240=['dialAnswer','Agent','name','channelAgent','membername','format','calleridname','Contact','phone','firstName','active','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','idContact','campaigntype'];(function(_0x21d64c,_0x52a58c){var _0x9c76b5=function(_0x3cfe0b){while(--_0x3cfe0b){_0x21d64c['push'](_0x21d64c['shift']());}};_0x9c76b5(++_0x52a58c);}(_0x9240,0x131));var _0x0924=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x9240[_0x2dadb9];return _0x2f0097;};'use strict';var util=require(_0x0924('0x0'));var _=require(_0x0924('0x1'));var moment=require(_0x0924('0x2'));function checkNameSurname(_0xb65b7b,_0x383593,_0x5905dc){var _0x50e8cf='';if(!_[_0x0924('0x3')](_0x383593)&&_0x0924('0x4')===typeof _0x383593){_0x50e8cf+=_0x383593;}if(!_['isNil'](_0x5905dc)&&_0x0924('0x4')===typeof _0x5905dc){_0x50e8cf+='\x20'+_0x5905dc;}if(_0x50e8cf!==''){return _0x50e8cf;}return _0xb65b7b;}function Action(_0x11a7b6,_0x292a9e,_0xa67203,_0x27c394,_0x3ded04){this['uniqueid']=_0xa67203||undefined;this[_0x0924('0x5')]=_0x11a7b6['id'];this['queue']=_0x292a9e['name'];this['type']=_0x292a9e['type'];this[_0x0924('0x6')]='queue';this[_0x0924('0x7')]=![];this['membername']=_[_0x0924('0x3')](_0x11a7b6['Agent'])?undefined:_0x11a7b6[_0x0924('0x8')][_0x0924('0x9')];this[_0x0924('0xa')]=this[_0x0924('0xb')]?util[_0x0924('0xc')]('SIP/%s',this[_0x0924('0xb')]):_0x27c394||undefined;this[_0x0924('0xd')]=checkNameSurname(_0x11a7b6[_0x0924('0xe')][_0x0924('0xf')],_0x11a7b6['Contact'][_0x0924('0x10')],_0x11a7b6['Contact']['lastName']);this[_0x0924('0x11')]=_0x11a7b6[_0x0924('0x11')]||![];this['calleridnum']=_0x11a7b6[_0x0924('0xe')][_0x0924('0xf')];this[_0x0924('0x12')]=_0x11a7b6['scheduledat'];this['countbusyretry']=_0x11a7b6[_0x0924('0x13')]||0x0;this[_0x0924('0x14')]=_0x11a7b6[_0x0924('0x14')]||0x0;this['countnoanswerretry']=_0x11a7b6['countnoanswerretry']||0x0;this['countglobal']=(_0x11a7b6[_0x0924('0x13')]||0x0)+(_0x11a7b6[_0x0924('0x14')]||0x0)+(_0x11a7b6[_0x0924('0x15')]||0x0)+(_0x11a7b6[_0x0924('0x16')]||0x0)+(_0x11a7b6[_0x0924('0x17')]||0x0)+(_0x11a7b6[_0x0924('0x18')]||0x0)+(_0x11a7b6[_0x0924('0x19')]||0x0)+(_0x11a7b6[_0x0924('0x1a')]||0x0);this[_0x0924('0x16')]=_0x11a7b6['countnosuchnumberretry']||0x0;this[_0x0924('0x17')]=_0x11a7b6[_0x0924('0x17')]||0x0;this[_0x0924('0x18')]=_0x11a7b6['countabandonedretry']||0x0;this[_0x0924('0x19')]=_0x11a7b6['countmachineretry']||0x0;this[_0x0924('0x1a')]=_0x11a7b6[_0x0924('0x1a')]||0x0;this[_0x0924('0x1b')]=_0x11a7b6[_0x0924('0x1b')];this[_0x0924('0x1c')]=_0x11a7b6[_0x0924('0x1c')];this[_0x0924('0x1d')]=_0x11a7b6[_0x0924('0x1d')];this[_0x0924('0x1e')]=_0x11a7b6[_0x0924('0x1e')];this[_0x0924('0x1f')]=_0x11a7b6[_0x0924('0x1f')];this[_0x0924('0x20')]=_0x11a7b6[_0x0924('0x20')];this['UserId']=_['isNil'](_0x11a7b6[_0x0924('0x8')])?_0x11a7b6[_0x0924('0x21')]:_0x11a7b6['Agent']['id'];this[_0x0924('0x22')]=_0x11a7b6[_0x0924('0x22')];this[_0x0924('0x23')]='';this['originatecalleridname']='';}Action[_0x0924('0x24')]['getCaller']=function(){return util[_0x0924('0xc')](_0x0924('0x25'),this[_0x0924('0xd')],this['number']);};module[_0x0924('0x26')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ea8250d..4524d48 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 _0x5292=['voice:queue:%s','info','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','available','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','syncCampaigns','hasOwnProperty','preview','booked','outbound','setMessage','recallMe','clearZombieChannel','isNil','Queue','queue','originated:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','[action]','getContactRecallMe','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','logCustomer','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','totalGlobal','NoSuchNumber','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','\x20Queue','pTalking:\x20','custom:agentconnect','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','buildObj','total','decrementTalkink','countglobal','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','linkedid','outboundBusyCallsDay','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','countnoanswerretry','NoAnswer','custom:agentnoanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','countagentrejectretry','AgentReject','custom:agentreject','agentreject','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','[callProgressDetectingAgent][logNoSuch]','logAgent','createAgentHistory','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','lookAgent','execCall','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','called','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','active','SIP/%s','reachable','unmonitored','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','[Preview][validateContact][Trunk\x20not\x20work]','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','substring','dialCutDigit','TrunkBackup','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','extractCalleridNumber','merge','toLowerVariables','OriginateError','actionid','clone','isFailure','response','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','unlockContact','[syncHangup][talking][transfer]','syncDialEnd','destuniqueid','addVariable','variables','syncVarSet','keys','variable','value','error','inspect','transfertargetlinkedid','exports','util','lodash','uuid','md5','ioredis','../../../config/environment','../../../config/logger','./action','./util/util','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncNewExten','varset','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','name','strategy','answered','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','startProgressive','Trunk','callerid','Interval','stringify','format'];(function(_0x3cef2a,_0x48bc9d){var _0x4a303b=function(_0x4a270e){while(--_0x4a270e){_0x3cef2a['push'](_0x3cef2a['shift']());}};_0x4a303b(++_0x48bc9d);}(_0x5292,0xf7));var _0x2529=function(_0x12b294,_0x192e53){_0x12b294=_0x12b294-0x0;var _0x7b92cb=_0x5292[_0x12b294];return _0x7b92cb;};'use strict';var util=require(_0x2529('0x0'));var _=require(_0x2529('0x1'));var BPromise=require('bluebird');var uuid=require(_0x2529('0x2'));var moment=require('moment');var md5=require(_0x2529('0x3'));var Redis=require(_0x2529('0x4'));var config=require(_0x2529('0x5'));var logger=require(_0x2529('0x6'))('preview');var loggerAction=require(_0x2529('0x6'))('actionPreview');var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x2529('0x7'));var ut=require(_0x2529('0x8'));config['redis']=_['defaults'](config[_0x2529('0x9')],{'host':_0x2529('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2529('0x9')]));var Sequence=function(){};Sequence[_0x2529('0xb')][_0x2529('0xc')]=function(_0x3c4885){this[_0x2529('0xd')]=this[_0x2529('0xd')]?this[_0x2529('0xd')][_0x2529('0xe')](_0x3c4885):_0x3c4885();};function Preview(_0x4f3cf9){this[_0x2529('0xf')]=new Sequence();this[_0x2529('0x10')]=_0x4f3cf9['voiceQueues'];this[_0x2529('0x11')]=_0x4f3cf9[_0x2529('0x11')];this[_0x2529('0x12')]={};this[_0x2529('0x13')]=_0x4f3cf9[_0x2529('0x13')];this[_0x2529('0x14')]=0x0;ami['on'](_0x2529('0x15'),this['syncOriginateResponse'][_0x2529('0x16')](this));ami['on'](_0x2529('0x17'),this[_0x2529('0x18')][_0x2529('0x16')](this));ami['on'](_0x2529('0x19'),this[_0x2529('0x1a')][_0x2529('0x16')](this));ami['on'](_0x2529('0x1b'),this['syncDialEnd'][_0x2529('0x16')](this));ami['on']('newexten',this[_0x2529('0x1c')][_0x2529('0x16')](this));ami['on'](_0x2529('0x1d'),this['syncVarSet']['bind'](this));ami['on'](_0x2529('0x1e'),this[_0x2529('0x1f')][_0x2529('0x16')](this));ami['on'](_0x2529('0x20'),this[_0x2529('0x21')]['bind'](this));this[_0x2529('0x22')](this[_0x2529('0x10')]);}function emit(_0x1ca15f,_0xeff5a6,_0x51a021){io['to'](_0x1ca15f)[_0x2529('0x23')](_0xeff5a6,_0x51a021);}function emitCampaignPreview(_0x40f2bc){if(_0x40f2bc[_0x2529('0x24')]==='outbound'){var _0x3d5d17={'id':_0x40f2bc['id'],'name':_0x40f2bc[_0x2529('0x25')],'strategy':_0x40f2bc[_0x2529('0x26')],'answered':_0x40f2bc[_0x2529('0x27')],'available':_0x40f2bc['available'],'loggedIn':_0x40f2bc[_0x2529('0x28')],'pTalking':_0x40f2bc[_0x2529('0x29')],'sumBillable':_0x40f2bc[_0x2529('0x2a')],'sumDuration':_0x40f2bc[_0x2529('0x2b')],'sumHoldTime':_0x40f2bc[_0x2529('0x2c')]||0x0,'talking':_0x40f2bc[_0x2529('0x2d')],'total':_0x40f2bc['total'],'type':_0x40f2bc['type'],'unmanaged':_0x40f2bc[_0x2529('0x2e')],'abandoned':_0x40f2bc[_0x2529('0x2f')],'waiting':_0x40f2bc[_0x2529('0x30')],'loggedInDb':_0x40f2bc[_0x2529('0x31')],'dialActive':_0x40f2bc[_0x2529('0x32')],'dialMethod':_0x40f2bc[_0x2529('0x33')],'dialOriginateCallerIdName':_0x40f2bc[_0x2529('0x34')],'dialOriginateCallerIdNumber':_0x40f2bc[_0x2529('0x35')],'dialOriginateTimeout':_0x40f2bc[_0x2529('0x36')],'dialPrefix':_0x40f2bc[_0x2529('0x37')],'outboundAnswerAgiCallsDay':_0x40f2bc['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x40f2bc[_0x2529('0x38')],'outboundBlacklistCallsDay':_0x40f2bc[_0x2529('0x39')],'outboundBusyCallsDay':_0x40f2bc['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x40f2bc[_0x2529('0x3a')],'outboundDropCallsDayACS':_0x40f2bc[_0x2529('0x3b')],'outboundDropCallsDayCallersExit':_0x40f2bc['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x40f2bc[_0x2529('0x3c')],'outboundNoAnswerCallsDay':_0x40f2bc[_0x2529('0x3d')],'outboundNoSuchCallsDay':_0x40f2bc['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x40f2bc[_0x2529('0x3e')],'outboundReCallsDay':_0x40f2bc[_0x2529('0x3f')],'outboundRejectCallsDay':_0x40f2bc['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x40f2bc[_0x2529('0x40')],'outboundAbandonedCallsDay':_0x40f2bc[_0x2529('0x41')],'predictiveIntervalAnsweredCalls':_0x40f2bc[_0x2529('0x42')],'predictiveIntervalAvgHoldtime':_0x40f2bc[_0x2529('0x43')],'predictiveIntervalAvgTalktime':_0x40f2bc[_0x2529('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x40f2bc['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x40f2bc[_0x2529('0x45')],'predictiveIntervalErlangCalls':_0x40f2bc[_0x2529('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x40f2bc[_0x2529('0x47')],'predictiveIntervalHitRate':_0x40f2bc[_0x2529('0x48')],'predictiveIntervalMultiplicativeFactor':_0x40f2bc[_0x2529('0x49')],'predictiveIntervalPauses':_0x40f2bc[_0x2529('0x4a')],'predictiveIntervalAvailable':_0x40f2bc[_0x2529('0x4b')],'predictiveIntervalTotalCalls':_0x40f2bc['predictiveIntervalTotalCalls'],'message':_0x40f2bc['message'],'originated':_0x40f2bc[_0x2529('0x4c')],'erlangCalls':_0x40f2bc['erlangCalls'],'erlangCallToSecond':_0x40f2bc[_0x2529('0x4d')],'erlangAbandonmentRate':_0x40f2bc['erlangAbandonmentRate'],'erlangBusyFactor':_0x40f2bc['erlangBusyFactor'],'startPredictive':_0x40f2bc['startPredictive'],'startProgressive':_0x40f2bc[_0x2529('0x4e')]};if(_0x40f2bc[_0x2529('0x4f')]){_0x3d5d17[_0x2529('0x4f')]={'id':_0x40f2bc['Trunk']['id'],'name':_0x40f2bc[_0x2529('0x4f')]['name'],'active':_0x40f2bc['Trunk']['active'],'callerid':_0x40f2bc[_0x2529('0x4f')][_0x2529('0x50')]};}if(_0x40f2bc[_0x2529('0x51')]){_0x3d5d17[_0x2529('0x51')]={'id':_0x40f2bc[_0x2529('0x51')]['id'],'name':_0x40f2bc[_0x2529('0x51')][_0x2529('0x25')]};}var _0x15319c=md5(JSON[_0x2529('0x52')](_0x3d5d17));if(_0x40f2bc[_0x2529('0x3')]!==_0x15319c){_0x40f2bc[_0x2529('0x3')]=_0x15319c;emit(util[_0x2529('0x53')](_0x2529('0x54'),_0x3d5d17['name']),'voice_queue:save',_0x3d5d17);}}}function emitVoiceQueueChannelRemove(_0xadb4a2){logger[_0x2529('0x55')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0x2529('0x52')](_0xadb4a2));emit(util[_0x2529('0x53')](_0x2529('0x54'),_0xadb4a2[_0x2529('0x25')]),_0x2529('0x56'),_0xadb4a2);io[_0x2529('0x23')](_0x2529('0x57'),_0xadb4a2);}function notSendMessagesQueue(_0x5cfbe5){if(_0x5cfbe5[_0x2529('0x58')]){if(_0x5cfbe5[_0x2529('0x4c')]===0x0&&_0x5cfbe5[_0x2529('0x29')]===0x0){_0x5cfbe5['sendMessageOneNotActive']=![];_0x5cfbe5[_0x2529('0x59')]=0x0;_0x5cfbe5[_0x2529('0x5a')]=0x0;_0x5cfbe5[_0x2529('0x5b')]=_0x2529('0x5c');ut[_0x2529('0x5d')](_0x2529('0x5e'),_0x5cfbe5[_0x2529('0x25')]+_0x2529('0x5f'));}else{_0x5cfbe5[_0x2529('0x5b')]='IS_DISACTIVED';ut[_0x2529('0x5d')](_0x2529('0x5e'),_0x5cfbe5[_0x2529('0x25')]+_0x2529('0x60'));}emitCampaignPreview(_0x5cfbe5);}}Preview[_0x2529('0xb')][_0x2529('0x22')]=function(){var _0x327dde=this;setInterval(function(){_0x327dde['syncCampaigns']();},0x7cf);};Preview[_0x2529('0xb')][_0x2529('0x61')]=function(){var _0x3f76e8=this[_0x2529('0x10')];this[_0x2529('0x14')]+=0x1;for(var _0x4c4b0e in _0x3f76e8){if(_0x3f76e8[_0x2529('0x62')](_0x4c4b0e)&&(_0x3f76e8[_0x4c4b0e][_0x2529('0x33')]===_0x2529('0x63')||_0x3f76e8[_0x4c4b0e][_0x2529('0x33')]===_0x2529('0x64'))&&_0x3f76e8[_0x4c4b0e][_0x2529('0x24')]==='outbound'){if(this['clockClearZombieChannels']>0x7){this['clockClearZombieChannels']=0x0;this['clearZombieChannels']();}}if(_0x3f76e8[_0x2529('0x62')](_0x4c4b0e)&&_0x3f76e8[_0x4c4b0e]['dialMethod']===_0x2529('0x63')&&_0x3f76e8[_0x4c4b0e][_0x2529('0x24')]===_0x2529('0x65')){if(_0x3f76e8[_0x4c4b0e][_0x2529('0x32')]){this[_0x2529('0x66')](_0x3f76e8[_0x4c4b0e]);if(_0x3f76e8[_0x4c4b0e]['dialPreviewAutoRecallMe'])this[_0x2529('0x67')](_0x3f76e8[_0x4c4b0e]);}else{notSendMessagesQueue(_0x3f76e8[_0x4c4b0e]);}}}};Preview['prototype'][_0x2529('0x68')]=function(_0x4f29b9){var _0x8bc92f=this;this['sequence'][_0x2529('0xc')](function(){if(!_[_0x2529('0x69')](_0x8bc92f['actions'][_0x4f29b9])){loggerAction[_0x2529('0x55')]('[clearZombieChannels][talking]',_0x4f29b9,_0x2529('0x6a'),_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')],_0x2529('0x6c'),JSON[_0x2529('0x52')](_0x8bc92f[_0x2529('0x10')][_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')]][_0x2529('0x4c')]),'pTalking:\x20',JSON['stringify'](_0x8bc92f[_0x2529('0x10')][_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')]][_0x2529('0x29')]),JSON['stringify'](_0x8bc92f['actions'][_0x4f29b9][_0x2529('0x6d')]),JSON['stringify'](_[_0x2529('0x6e')](_0x8bc92f[_0x2529('0x12')][_0x4f29b9],[_0x2529('0x6f'),_0x2529('0x70'),_0x2529('0x71'),_0x2529('0x72')])));return ami[_0x2529('0x73')]({'action':_0x2529('0x74'),'channel':_0x8bc92f['actions'][_0x4f29b9]['channel']})[_0x2529('0x75')](function(_0xeef7cb){if(_0xeef7cb[_0x2529('0x5b')]===_0x2529('0x76')){setTimeout(function(){if(_0x8bc92f[_0x2529('0x12')][_0x4f29b9]){ut[_0x2529('0x77')](_0x8bc92f[_0x2529('0x10')][_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')]],_0x2529('0x78'));if(_0x8bc92f[_0x2529('0x12')][_0x4f29b9]['dialAnswer']===!![]){ut['decrementTalkink'](_0x8bc92f[_0x2529('0x10')][_0x8bc92f[_0x2529('0x12')][_0x4f29b9]['queue']],_0x2529('0x78'));ut[_0x2529('0x79')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4f29b9,_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')]);}ut[_0x2529('0x79')](_0x2529('0x7a')+_0x4f29b9,_0x8bc92f[_0x2529('0x12')][_0x4f29b9][_0x2529('0x6b')]);delete _0x8bc92f[_0x2529('0x12')][_0x4f29b9];}},0x2328);}});}});};Preview[_0x2529('0xb')]['clearZombieChannels']=function(){var _0x3a13ff=this;loggerAction['info'](_0x2529('0x7b'),_['size'](this[_0x2529('0x12')]));for(var _0x1a943d in this['actions']){if(_0x3a13ff['actions'][_0x2529('0x62')](_0x1a943d)){_0x3a13ff[_0x2529('0x68')](_0x1a943d);}}};Preview[_0x2529('0xb')][_0x2529('0x67')]=function(_0x23d862){var _0x587dd2=this;rpcDb[_0x2529('0x7c')](_0x23d862['id'],ut['agentReadyId'](this['agents']))['then'](function(_0x37e32c){if(!_[_0x2529('0x69')](_0x37e32c)){for(var _0x58325e=0x0;_0x58325e<_0x37e32c[_0x2529('0x7d')];_0x58325e+=0x1){if(ut[_0x2529('0x7e')](_0x37e32c[_0x58325e]['scheduledat'])<_0x23d862[_0x2529('0x7f')]*0x3c){if(_0x37e32c[_0x58325e][_0x2529('0x80')]&&!_0x37e32c[_0x58325e]['Agent'][_0x2529('0x81')]){_0x587dd2[_0x2529('0x82')](_0x37e32c[_0x58325e]['id'])[_0x2529('0x83')](ut[_0x2529('0x84')](_0x2529('0x85')))[_0x2529('0x75')](ut[_0x2529('0x84')](_0x2529('0x85')));}else{rpcDb[_0x2529('0x86')](_0x37e32c[_0x58325e]['id']);}}else{var _0x5e1112=new Action(_0x37e32c[_0x58325e],_0x23d862);_0x5e1112[_0x2529('0x87')]=moment()[_0x2529('0x53')](_0x2529('0x88'));_0x23d862[_0x2529('0x3f')]+=0x1;ut['logCustomer'](_0x5e1112,0x17,_0x2529('0x89'));if(_0x23d862[_0x2529('0x8a')]){rpcDb[_0x2529('0x8b')](ut[_0x2529('0x8c')](_0x37e32c[_0x58325e]));rpcDb['createCustomerHistory'](_0x5e1112,_0x2529('0x8d'));}else{ut[_0x2529('0x8e')](_0x5e1112,0x16,_0x2529('0x8f'));rpcDb[_0x2529('0x90')](_0x5e1112,_0x2529('0x91'));rpcDb[_0x2529('0x92')](_0x5e1112,_0x2529('0x91'));}}}}})[_0x2529('0x75')](ut['logger2'](_0x2529('0x93')));};Preview[_0x2529('0xb')]['setMessage']=function(_0x5843bb){_0x5843bb['sendMessageOneNotActive']=!![];if(ut[_0x2529('0x94')](_0x5843bb[_0x2529('0x28')])){_0x5843bb[_0x2529('0x5b')]=_0x2529('0x95');}else if(!ut['isActive'](_0x5843bb['dialActive'])){_0x5843bb['message']=_0x2529('0x5c');}else if(!this[_0x2529('0x96')](_0x5843bb[_0x2529('0x4f')])){if(!this[_0x2529('0x96')](_0x5843bb['TrunkBackup'])){_0x5843bb['message']=_0x2529('0x97');}else{_0x5843bb[_0x2529('0x5b')]=_0x2529('0x98');}}else{_0x5843bb[_0x2529('0x5b')]='ACTIVE';}emitCampaignPreview(_0x5843bb);};Preview['prototype'][_0x2529('0x99')]=function(_0x200eb3,_0x1a22a6,_0x1ac580){var _0x484a07=this;var _0x253b30=this[_0x2529('0x12')][_0x1a22a6];var _0x209d9b=this[_0x2529('0x10')][_0x253b30['queue']];var _0x816ea5;if(_0x209d9b){switch(_0x1ac580){case'1':_0x209d9b['outboundNoSuchCallsDay']+=0x1;_0x253b30[_0x2529('0x9a')]+=0x1;_0x253b30['countglobal']=ut[_0x2529('0x9b')](_0x253b30);ut['logCustomer'](_0x253b30,0x0,_0x2529('0x9c'));ami['emit']('custom:agentnosuchnumber',ut['buildObj'](_0x253b30,_0x2529('0x9d')));rpcDb['createCustomerHistory'](_0x253b30,_0x2529('0x9e'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut['cloneAction'](_0x253b30,0xf,_0x2529('0xa0'));rpcDb['createCustomerFinal'](_0x816ea5,_0x2529('0xa1'));}else{if(_0x253b30['countnosuchnumberretry']>=_0x209d9b[_0x2529('0xa2')]){rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xa1'));}else{rpcDb[_0x2529('0xa3')](ut[_0x2529('0xa4')](_0x253b30,_0x2529('0x9a'),_0x209d9b[_0x2529('0xa5')]),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}delete this['actions'][_0x200eb3['linkedid']];break;case _0x2529('0xa8'):var _0x4fc54f=moment()[_0x2529('0x53')](_0x2529('0x88'));_0x253b30[_0x2529('0xa9')]=_0x4fc54f;_0x253b30[_0x2529('0xaa')]=_0x4fc54f;_0x253b30[_0x2529('0x6d')]=!![];_0x209d9b[_0x2529('0x29')]+=0x1;logger[_0x2529('0x55')]('[syncHangup][talking][increment]',_0x253b30['uniqueid'],_0x2529('0xab'),_0x209d9b[_0x2529('0x25')],_0x2529('0xac'),_0x209d9b[_0x2529('0x29')]);ami[_0x2529('0x23')](_0x2529('0xad'),ut['buildObj'](_0x253b30,_0x2529('0xae'),this[_0x2529('0x10')][_0x253b30[_0x2529('0x6b')]]));if(_0x209d9b[_0x2529('0xaf')]){ami['emit'](_0x2529('0xb0'),ut['buildAcw'](_0x253b30));}break;case'16':ami[_0x2529('0x23')](_0x2529('0xb1'),ut['buildObj'](_0x253b30,_0x2529('0xb2'),this[_0x2529('0x10')][_0x253b30['queue']]));emitVoiceQueueChannelRemove(ut[_0x2529('0xb3')](_0x253b30,_0x2529('0xb2')));_0x209d9b['outboundAnswerCallsDay']+=0x1;_0x209d9b[_0x2529('0xb4')]+=0x1;_0x209d9b[_0x2529('0x27')]+=0x1;ut[_0x2529('0xb5')](_0x209d9b,'[16]');_0x253b30[_0x2529('0xb6')]=ut[_0x2529('0x9b')](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0x4,'Answer');rpcDb[_0x2529('0x90')](_0x253b30,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xb7'));rpcDb[_0x2529('0xb8')](_0x253b30);_0x209d9b[_0x2529('0x2b')]+=_0x253b30[_0x2529('0xb9')];_0x209d9b[_0x2529('0x2a')]+=_0x253b30[_0x2529('0xb9')];logger[_0x2529('0x55')](_0x2529('0xba'),_0x253b30['uniqueid'],'\x20Queue',_0x209d9b['name'],'pTalking:\x20',_0x209d9b[_0x2529('0x29')]);delete this[_0x2529('0x12')][_0x200eb3[_0x2529('0xbb')]];break;case'BUSY':_0x209d9b[_0x2529('0xbc')]+=0x1;_0x253b30[_0x2529('0xbd')]+=0x1;_0x253b30[_0x2529('0xb6')]=ut[_0x2529('0x9b')](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0x5,'Busy');ami[_0x2529('0x23')](_0x2529('0xbe'),ut['buildObj'](_0x253b30,_0x2529('0xbf')));rpcDb['createCustomerHistory'](_0x253b30,_0x2529('0xc0'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0xf,_0x2529('0xa0'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xc2'));}else{if(_0x253b30[_0x2529('0xbd')]>=_0x209d9b[_0x2529('0xc3')]){rpcDb['createCustomerFinal'](_0x253b30,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x2529('0xa3')](ut['scheduledAt'](_0x253b30,_0x2529('0xbd'),_0x209d9b['dialBusyRetryFrequency']),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}break;case'NOANSWER':_0x209d9b[_0x2529('0x3d')]+=0x1;_0x253b30[_0x2529('0xc4')]+=0x1;_0x253b30['countglobal']=ut[_0x2529('0x9b')](_0x253b30);ut['logCustomer'](_0x253b30,0x3,_0x2529('0xc5'));ami[_0x2529('0x23')](_0x2529('0xc6'),ut[_0x2529('0xb3')](_0x253b30,'noanswer'));rpcDb['createCustomerHistory'](_0x253b30,_0x2529('0xc7'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut['cloneAction'](_0x253b30,0xf,'Global');rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xc8'));}else{if(_0x253b30[_0x2529('0xc4')]>=_0x209d9b[_0x2529('0xc9')]){rpcDb[_0x2529('0x92')](_0x253b30,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0x2529('0xa3')](ut[_0x2529('0xa4')](_0x253b30,'countnoanswerretry',_0x209d9b[_0x2529('0xca')]),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}break;case _0x2529('0xcb'):_0x209d9b[_0x2529('0x3a')]+=0x1;_0x253b30[_0x2529('0xcc')]+=0x1;_0x253b30[_0x2529('0xb6')]=ut[_0x2529('0x9b')](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0x8,_0x2529('0xcd'));ami[_0x2529('0x23')](_0x2529('0xce'),ut['buildObj'](_0x253b30,_0x2529('0xcf')));rpcDb[_0x2529('0x90')](_0x253b30,_0x2529('0xd0'));if(ut['totalGlobal'](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0xf,_0x2529('0xa0'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xd1'));}else{if(_0x253b30[_0x2529('0xcc')]>=_0x209d9b[_0x2529('0xd2')]){rpcDb['createCustomerFinal'](_0x253b30,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x2529('0xa3')](ut[_0x2529('0xa4')](_0x253b30,'countcongestionretry',_0x209d9b[_0x2529('0xd3')]),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}break;case'CANCEL':_0x209d9b['outboundRejectCallsDay']+=0x1;_0x253b30[_0x2529('0xd4')]+=0x1;_0x253b30[_0x2529('0xb6')]=ut[_0x2529('0x9b')](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0x14,_0x2529('0xd5'));ami['emit'](_0x2529('0xd6'),ut['buildObj'](_0x253b30,_0x2529('0xd7')));rpcDb[_0x2529('0x90')](_0x253b30,'[syncHangupRequest][logAgentReject]');if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b['dialGlobalMaxRetry']){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0x14,_0x2529('0xd5'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xd8'));}else{if(_0x253b30[_0x2529('0xd4')]>=_0x209d9b['dialAgentRejectMaxRetry']){rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xd8'));}else{rpcDb[_0x2529('0xa3')](ut['scheduledAt'](_0x253b30,'countagentrejectretry',_0x209d9b[_0x2529('0xd9')]),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}break;case _0x2529('0xda'):_0x209d9b[_0x2529('0x41')]+=0x1;_0x253b30[_0x2529('0xdb')]+=0x1;_0x253b30['countglobal']=ut[_0x2529('0x9b')](_0x253b30);ut['logCustomer'](_0x253b30,0xb,_0x2529('0xdc'));rpcDb['createCustomerHistory'](_0x253b30,_0x2529('0xdd'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0xf,_0x2529('0xa0'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xdd'));}else{if(_0x253b30[_0x2529('0xde')]>=_0x209d9b['dialAbandonedMaxRety']){rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xdd'));}else{rpcDb[_0x2529('0xa3')](ut[_0x2529('0xa4')](_0x253b30,_0x2529('0xdb'),_0x209d9b[_0x2529('0xdf')]),_0x253b30[_0x2529('0xa6')],_0x253b30[_0x2529('0xa7')]);}}break;case'18':_0x209d9b[_0x2529('0x40')]+=0x1;_0x253b30[_0x2529('0xe0')]+=0x1;_0x253b30[_0x2529('0xb6')]=ut['totalGlobal'](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0x12,_0x200eb3[_0x2529('0xe1')]||_0x200eb3['dialstatus']);ami['emit'](_0x2529('0xe2'),ut['buildObj'](_0x253b30,_0x2529('0xe3')));rpcDb[_0x2529('0x90')](_0x253b30,_0x2529('0xe4'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0xf,_0x2529('0xa0'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xe4'));}else{rpcDb[_0x2529('0x92')](_0x253b30,'[callProgressDetectingCustomer][hangupInAMD]');}delete this['actions'][_0x200eb3[_0x2529('0xbb')]];break;case'19':_0x209d9b[_0x2529('0x40')]+=0x1;_0x253b30[_0x2529('0xb6')]=ut['totalGlobal'](_0x253b30);ut['logCustomer'](_0x253b30,0x13,_0x200eb3[_0x2529('0xe1')]||_0x200eb3['dialstatus']);ami[_0x2529('0x23')](_0x2529('0xe2'),ut[_0x2529('0xb3')](_0x253b30,_0x2529('0xe3')));rpcDb[_0x2529('0x90')](_0x253b30,_0x2529('0xe5'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b['dialGlobalMaxRetry']){_0x816ea5=ut[_0x2529('0xc1')](_0x253b30,0xf,_0x2529('0xa0'));rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xe5'));}else{rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xe5'));}delete this[_0x2529('0x12')][_0x200eb3[_0x2529('0xbb')]];break;default:if(_0x253b30[_0x2529('0x6d')]){ut[_0x2529('0xb5')](_0x209d9b,_0x2529('0xe6'));ut[_0x2529('0x79')](_0x2529('0xe7')+_0x209d9b[_0x2529('0x25')],_0x200eb3);}_0x209d9b[_0x2529('0x40')]+=0x1;_0x253b30['countglobal']=ut[_0x2529('0x9b')](_0x253b30);ut[_0x2529('0x8e')](_0x253b30,0xc,_0x200eb3[_0x2529('0xe1')]||_0x200eb3[_0x2529('0xe8')]);rpcDb[_0x2529('0x90')](_0x253b30,_0x2529('0xe9'));if(ut[_0x2529('0x9b')](_0x253b30)>=_0x209d9b[_0x2529('0x9f')]){_0x816ea5=ut['cloneAction'](_0x253b30,0xf,'Global');rpcDb[_0x2529('0x92')](_0x816ea5,_0x2529('0xea'));}else{rpcDb[_0x2529('0x92')](_0x253b30,_0x2529('0xea'));}delete this[_0x2529('0x12')][_0x200eb3[_0x2529('0xbb')]];}if(!(_0x253b30[_0x2529('0x6d')]&&_0x1ac580==='16')){ut[_0x2529('0x77')](_0x209d9b,'[callProgressDetectingCustomer]');logger[_0x2529('0x55')](_0x2529('0xeb'),_0x253b30[_0x2529('0xec')],_0x2529('0xab'),_0x209d9b[_0x2529('0x25')],_0x2529('0x6c'),_0x209d9b['originated']);}if(_0x1ac580!==_0x2529('0xa8')){delete this['actions'][_0x200eb3['linkedid']];delete this['actions'][_0x200eb3[_0x2529('0xed')]];}}};Preview[_0x2529('0xb')][_0x2529('0xee')]=function(_0x1f352c,_0x206d45,_0x55be28){if(_['isUndefined'](_0x206d45)&&_0x2529('0xef')!==typeof _0x206d45){return;}if(_[_0x2529('0xf0')](_0x55be28)&&_0x2529('0xef')!==typeof _0x55be28){return;}switch(_0x55be28[_0x2529('0xf1')]){case'0':ut['logAgent'](_0x1f352c,0x0,_0x2529('0x9c'));rpcDb['createAgentHistory'](_0x1f352c,_0x2529('0xf2'));break;case'3':ut[_0x2529('0xf3')](_0x1f352c,0x3,_0x2529('0xc5'));rpcDb[_0x2529('0xf4')](_0x1f352c,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0x2529('0xf3')](_0x1f352c,0x5,_0x2529('0xf5'));rpcDb[_0x2529('0xf4')](_0x1f352c,_0x2529('0xf6'));break;case'8':ut[_0x2529('0xf3')](_0x1f352c,0x8,_0x2529('0xcd'));rpcDb[_0x2529('0xf4')](_0x1f352c,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x2529('0xf3')](_0x1f352c,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x1f352c,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x2529('0xf3')](_0x1f352c,0xc,_0x55be28[_0x2529('0xf1')]);rpcDb[_0x2529('0xf4')](_0x1f352c,_0x2529('0xf7'));}ut['updateOriginated'](_0x206d45,_0x2529('0xf8'));logger[_0x2529('0x55')](_0x2529('0xf9'),_0x1f352c[_0x2529('0xec')],_0x2529('0xab'),_0x206d45[_0x2529('0x25')],'originated:\x20',_0x206d45[_0x2529('0x4c')]);delete this[_0x2529('0x12')][_0x1f352c[_0x2529('0xec')]];};Preview[_0x2529('0xb')][_0x2529('0xfa')]=function(_0x853136,_0x104909,_0x3f3447,_0x2c2506,_0x36f5a3){var _0x2b3d0c=this;return new BPromise(function(_0x4f6122,_0x5e4a50){if(_[_0x2529('0x69')](_0x104909)||_[_0x2529('0x69')](_0x104909['Contact'])||_['isNil'](_0x104909[_0x2529('0xfb')][_0x2529('0xfc')])||_[_0x2529('0x69')](_0x104909[_0x2529('0x71')])){_0x5e4a50(ut[_0x2529('0x5b')]('Contact\x20is\x20undefined',_0x2c2506,_0x36f5a3));return;}var _0x2a191c=uuid['v4']();var _0x45f4e8=_0x2b3d0c['campaignsPreview'][_0x104909['Queue'][_0x2529('0x25')]];var _0x24e676=_0x3f3447?_0x2b3d0c['agents'][_0x3f3447]['id']:undefined;_0x2b3d0c[_0x2529('0x12')][_0x2a191c]=new Action(_0x104909,_0x45f4e8,_0x2a191c,_0x3f3447,_0x24e676);var _0x28d0fd=_0x2b3d0c['actions'][_0x2a191c];_0x28d0fd[_0x2529('0xa6')]=_0x2c2506;_0x28d0fd['activeContact']=_0x36f5a3;_0x28d0fd[_0x2529('0xfd')]=_0x3f3447;if(_['isEmpty'](_0x853136)){_0x2b3d0c[_0x2529('0xfe')](_0x28d0fd,_0x45f4e8,_0x104909,_0x3f3447)['then'](function(_0x1c4f44){logger[_0x2529('0x55')](_0x2529('0xff'),_0x2529('0x100')+_0x28d0fd[_0x2529('0x6b')]+_0x2529('0x101')+_0x28d0fd[_0x2529('0x102')],JSON[_0x2529('0x52')](_0x1c4f44));ami[_0x2529('0x23')]('custom:agentcalled',ut['buildObj'](_0x28d0fd,_0x2529('0x103'),_0x2b3d0c['campaignsPreview'][_0x28d0fd['queue']]));_0x4f6122(ut[_0x2529('0x5b')](_0x2529('0x104')));})[_0x2529('0x75')](function(_0x429e43){ut[_0x2529('0x5d')](_0x2529('0x105'),_0x429e43);_0x5e4a50(ut[_0x2529('0x5b')](_0x2529('0x106'),_0x2c2506,_0x36f5a3));});}else{_0x45f4e8[_0x2529('0x39')]+=0x1;ut[_0x2529('0x107')](_0x28d0fd);rpcDb[_0x2529('0x108')](_0x28d0fd,_0x2529('0x109'));delete _0x2b3d0c[_0x2529('0x12')][_0x2a191c];_0x5e4a50(ut[_0x2529('0x5b')](_0x2529('0x10a'),_0x2c2506,_0x36f5a3));}});};Preview[_0x2529('0xb')][_0x2529('0x96')]=function(_0x47432a){return!_[_0x2529('0x69')](_0x47432a)&&!_[_0x2529('0x69')](_0x47432a['name'])&&!_[_0x2529('0x69')](_0x47432a[_0x2529('0x10b')])&&_0x47432a[_0x2529('0x10b')]&&!_[_0x2529('0x69')](this[_0x2529('0x11')][util['format'](_0x2529('0x10c'),_0x47432a[_0x2529('0x25')])])&&!_['isNil'](this['trunks'][util[_0x2529('0x53')]('SIP/%s',_0x47432a['name'])][_0x2529('0x74')])&&(this[_0x2529('0x11')][util[_0x2529('0x53')](_0x2529('0x10c'),_0x47432a['name'])]['status']===_0x2529('0x10d')||this[_0x2529('0x11')][util[_0x2529('0x53')](_0x2529('0x10c'),_0x47432a[_0x2529('0x25')])][_0x2529('0x74')]===_0x2529('0x10e'));};Preview[_0x2529('0xb')][_0x2529('0x82')]=function(_0x486c17,_0x30430a){var _0x52e134=this;return new BPromise(function(_0x2e218d,_0x62976c){_0x52e134['execRun'](_0x486c17,_0x30430a)[_0x2529('0x83')](function(_0x250256){_0x2e218d(_[_0x2529('0x6e')](_0x250256,[_0x2529('0x5b')]));})['catch'](function(_0x10493e){if(_0x10493e[_0x2529('0x10f')]){rpcDb['unlockContact'](_0x486c17);}if(_0x10493e[_0x2529('0x10b')]){rpcDb[_0x2529('0x86')](_0x486c17);}_0x62976c(_['pick'](_0x10493e,[_0x2529('0x5b')]));});});};Preview[_0x2529('0xb')]['execRun']=function(_0x3876b7,_0x5a863c){var _0x21e09b=this;return new BPromise(function(_0x3ced87,_0x5e83ed){var _0x2aa949,_0x3c4608;rpcDb[_0x2529('0x110')](_0x3876b7)[_0x2529('0x83')](function(_0x3b613e){if(!_[_0x2529('0x69')](_0x3b613e[0x0])){_0x3c4608=_0x3b613e[0x0][_0x2529('0x111')]?![]:!![];_0x2aa949=_0x3b613e[0x0][_0x2529('0x111')]?!![]:![];_0x2aa949=_0x5a863c?!![]:_0x2aa949;}var _0x1b87d8=_0x21e09b[_0x2529('0x112')](_0x3b613e);if(_0x1b87d8[_0x2529('0x113')]){rpcDb[_0x2529('0x114')](_[_0x2529('0x6e')](_0x3b613e[0x0],[_0x2529('0x71'),'Contact.phone']))['then'](function(_0x5ff296){_0x21e09b[_0x2529('0xfa')](_0x5ff296,_0x3b613e[0x0],_0x5a863c,_0x3c4608,_0x2aa949)[_0x2529('0x83')](function(_0x510abc){_0x3ced87(_0x510abc);})[_0x2529('0x75')](function(_0x5061b0){_0x5e83ed(_0x5061b0);});})[_0x2529('0x75')](function(_0x4b9eb1){ut['logger'](_0x2529('0x115'),_0x4b9eb1);_0x5e83ed(ut['message'](_0x2529('0x116'),_0x3c4608,_0x2aa949));});}else{_0x5e83ed(ut[_0x2529('0x5b')](_0x1b87d8[_0x2529('0x5b')],_0x3c4608,_0x2aa949));}})[_0x2529('0x75')](function(_0x3a61ee){ut[_0x2529('0x5d')]('[Preview][getContactPreview]',_0x3a61ee);_0x5e83ed(ut['message'](_0x2529('0x116'),![],!![]));});});};Preview[_0x2529('0xb')]['validateContact']=function(_0x22ada3){if(_[_0x2529('0x69')](_0x22ada3)||_[_0x2529('0x117')](_0x22ada3)||!_[_0x2529('0x69')](_0x22ada3[0x0][_0x2529('0x80')])&&_[_0x2529('0x69')](_0x22ada3[0x0][_0x2529('0x80')][_0x2529('0x25')])){ut[_0x2529('0x5d')]('[Preview][validateContact][Empty\x20Contact]',_0x22ada3);return{'isValid':![],'message':_0x2529('0x118')};}var _0xc53382=this[_0x2529('0x10')][_0x22ada3[0x0][_0x2529('0x6a')][_0x2529('0x25')]];_0xc53382['message']=_0x2529('0x98');if(_[_0x2529('0x69')](_0xc53382)){ut[_0x2529('0x5d')](_0x2529('0x119'),_0xc53382);return{'isValid':![],'message':_0x2529('0x11a')};}if(!this[_0x2529('0x96')](_0xc53382[_0x2529('0x4f')])){ut[_0x2529('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x2529('0x11b')+_0xc53382[_0x2529('0x25')]+_0x2529('0x11c'));if(!this['isTrunkReachable'](_0xc53382['TrunkBackup'])){ut[_0x2529('0x5d')](_0x2529('0x11d'),_0xc53382[_0x2529('0x25')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x2529('0x11e')};}}if(!ut['isActive'](_0xc53382[_0x2529('0x32')])){ut[_0x2529('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0xc53382[_0x2529('0x25')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x2529('0x11b')+_0xc53382[_0x2529('0x25')]+_0x2529('0x11f')};}return{'isValid':!![],'message':_0x2529('0x120')};};Preview[_0x2529('0xb')][_0x2529('0xfe')]=function(_0x2b2511,_0x15b976,_0x4a8004,_0x364032){var _0x224687=this;return new BPromise(function(_0x22364a,_0x21aeca){var _0x1342a0=_0x2b2511['uniqueid'];var _0x1efa72=_0x224687[_0x2529('0x96')](_0x15b976[_0x2529('0x4f')])?util['format'](_0x2529('0x121'),_0x15b976[_0x2529('0x4f')]['name'],_[_0x2529('0x69')](_0x15b976[_0x2529('0x37')])?'':_0x15b976[_0x2529('0x37')]['trim']()||'',_0x15b976['dialCutDigit']>0x0?_0x4a8004[_0x2529('0xfb')][_0x2529('0xfc')][_0x2529('0x122')](_0x15b976[_0x2529('0x123')]):_0x4a8004['Contact']['phone']):util[_0x2529('0x53')]('SIP/%s/%s%s',_[_0x2529('0x69')](_0x15b976[_0x2529('0x124')])?_0x15b976[_0x2529('0x4f')][_0x2529('0x25')]:_0x15b976[_0x2529('0x124')]['name'],_[_0x2529('0x69')](_0x15b976[_0x2529('0x37')])?'':_0x15b976[_0x2529('0x37')][_0x2529('0x125')]()||'',_0x15b976[_0x2529('0x123')]>0x0?_0x4a8004[_0x2529('0xfb')]['phone']['substring'](_0x15b976[_0x2529('0x123')]):_0x4a8004['Contact'][_0x2529('0xfc')]);var _0x31e073=_0x224687[_0x2529('0x96')](_0x15b976[_0x2529('0x4f')])?ut[_0x2529('0x126')](_0x15b976[_0x2529('0x4f')][_0x2529('0x50')],_0x15b976[_0x2529('0x34')],_0x15b976[_0x2529('0x127')]>0x0?ut[_0x2529('0x128')](_0x15b976[_0x2529('0x35')],_0x15b976[_0x2529('0x127')]):_0x15b976[_0x2529('0x35')]):ut[_0x2529('0x126')](_[_0x2529('0x69')](_0x15b976[_0x2529('0x124')])?_0x15b976['Trunk'][_0x2529('0x50')]:_0x15b976['TrunkBackup'][_0x2529('0x50')],_0x15b976[_0x2529('0x34')],_0x15b976['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x2529('0x128')](_0x15b976[_0x2529('0x35')],_0x15b976[_0x2529('0x127')]):_0x15b976[_0x2529('0x35')]);if(_0x31e073){_0x2b2511[_0x2529('0x129')]=ut[_0x2529('0x12a')](_0x31e073);_0x2b2511['originatecalleridnum']=ut[_0x2529('0x12b')](_0x31e073);}var _0x115018=ut['addVariables'](_0x15b976,_0x4a8004,_0x1efa72,_0x31e073,_0x1342a0,_0x2b2511);_[_0x2529('0x12c')](_0x2b2511,ut[_0x2529('0x12d')](_0x115018));_0x2b2511['starttime']=moment()[_0x2529('0x53')](_0x2529('0x88'));ami[_0x2529('0x73')](ut['variablesAction'](_0x2b2511,_0x15b976,_0x115018,_0x2b2511[_0x2529('0xa7')],_0x364032))[_0x2529('0x83')](function(_0x570670){_0x15b976[_0x2529('0x4c')]+=0x1;logger[_0x2529('0x55')]('[originated][increment]',_0x1342a0,_0x2529('0xab'),_0x15b976[_0x2529('0x25')],_0x2529('0x6c'),_0x15b976[_0x2529('0x4c')]);_0x22364a(_0x570670);})['catch'](function(_0x124ef7){ut['logAgent'](_0x2b2511,0xe,_0x2529('0x12e'));rpcDb[_0x2529('0xf4')](_0x2b2511,'[originateFailure][logOriginateFailure]');_0x21aeca(_0x124ef7);});});};Preview[_0x2529('0xb')][_0x2529('0x1c')]=function(_0x26accb){if(this['actions'][_0x26accb[_0x2529('0xbb')]]){this[_0x2529('0x12')][_0x26accb[_0x2529('0xbb')]]['channel']=_0x26accb['channel'];}};Preview['prototype']['syncOriginateResponse']=function(_0x2b2668){var _0x22895f=this;var _0x4e9bd3=this[_0x2529('0x12')][_0x2b2668[_0x2529('0x12f')]];if(_0x4e9bd3){if(_0x4e9bd3['lookAgent']&&this['agents'][_0x4e9bd3[_0x2529('0xfd')]]){ut['logLookAgent'](_0x4e9bd3,this[_0x2529('0x13')][_0x4e9bd3[_0x2529('0xfd')]][_0x2529('0x25')],this[_0x2529('0x13')][_0x4e9bd3[_0x2529('0xfd')]]['id']);}var _0x30c10f=_[_0x2529('0x130')](_0x4e9bd3);_0x30c10f[_0x2529('0xa9')]=moment()[_0x2529('0x53')](_0x2529('0x88'));var _0x4f9984=_0x22895f[_0x2529('0x10')][_0x4e9bd3['queue']];if(ut[_0x2529('0x131')](_0x2b2668[_0x2529('0x132')])){if(_0x4e9bd3[_0x2529('0xa6')]){rpcDb['unlockContact'](_0x4e9bd3[_0x2529('0x102')]);}if(_0x4e9bd3[_0x2529('0xa7')]){rpcDb[_0x2529('0x86')](_0x4e9bd3['idContact']);}ami[_0x2529('0x23')](_0x2529('0x133'),ut['buildObj'](_0x4e9bd3,_0x2529('0x134'),this[_0x2529('0x10')][_0x4e9bd3[_0x2529('0x6b')]]));this[_0x2529('0xee')](_0x30c10f,_0x4f9984,_0x2b2668);}else{_0x4e9bd3[_0x2529('0x87')]=moment()['format'](_0x2529('0x88'));ut[_0x2529('0xf3')](_0x30c10f,0x4,_0x2529('0x135'));rpcDb['createAgentHistory'](_0x30c10f,_0x2529('0x136'));}}};Preview['prototype'][_0x2529('0x18')]=function(_0x58ed58){var _0x37c3fc=this;var _0x46fd84=this[_0x2529('0x12')][_0x58ed58[_0x2529('0xbb')]];var _0x546bbd;if(_0x46fd84){_0x546bbd=this[_0x2529('0x10')][_0x46fd84[_0x2529('0x6b')]];logger[_0x2529('0x55')](_0x2529('0x137'),_0x58ed58['linkedid'],_0x2529('0xab'),_0x546bbd[_0x2529('0x25')],_0x2529('0xac'),_0x546bbd[_0x2529('0x29')]);}if(this[_0x2529('0x12')][_0x58ed58[_0x2529('0xbb')]]&&_0x58ed58[_0x2529('0xbb')]!==_0x58ed58[_0x2529('0xec')]){if(_0x58ed58[_0x2529('0x138')]==='16'&&this[_0x2529('0x12')][_0x58ed58[_0x2529('0xbb')]][_0x2529('0x6d')]){this[_0x2529('0x99')](_0x58ed58,_0x58ed58[_0x2529('0xbb')],_0x58ed58['cause']);}else if(this[_0x2529('0x12')][_0x58ed58[_0x2529('0xbb')]][_0x2529('0x6d')]){logger['info'](_0x2529('0x139'),_0x58ed58[_0x2529('0xbb')],_0x58ed58[_0x2529('0x138')],_0x2529('0xab'),_0x546bbd[_0x2529('0x25')],_0x2529('0xac'),_0x546bbd['pTalking']);this['callProgressDetectingCustomer'](_0x58ed58,_0x58ed58[_0x2529('0xbb')],_0x58ed58['cause']);}}else if(_0x46fd84&&_[_0x2529('0x69')](_0x46fd84[_0x2529('0x13a')])&&_0x546bbd[_0x2529('0x13b')]&&_0x58ed58[_0x2529('0xbb')]===_0x58ed58['uniqueid']&&_[_0x2529('0x69')](_0x58ed58[_0x2529('0xf1')])&&_0x58ed58[_0x2529('0x138')]==='16'&&_0x58ed58['channelstate']==='6'&&_[_0x2529('0xf0')](_0x46fd84[_0x2529('0x13c')])){if(_0x46fd84[_0x2529('0xa6')]){rpcDb[_0x2529('0x13d')](_0x46fd84['idContact']);}if(_0x46fd84[_0x2529('0xa7')]){rpcDb['disableContact'](_0x46fd84[_0x2529('0x102')]);}_0x58ed58[_0x2529('0xf1')]='22';this[_0x2529('0xee')](_0x46fd84,_0x546bbd,_0x58ed58);}else if(_0x46fd84&&_0x46fd84[_0x2529('0x13c')]){if(_0x58ed58['cause']==='16'&&this[_0x2529('0x12')][_0x58ed58['linkedid']][_0x2529('0x6d')]){logger[_0x2529('0x55')](_0x2529('0x13e'),_0x58ed58[_0x2529('0xbb')],_0x58ed58[_0x2529('0x138')],_0x2529('0xab'),_0x546bbd[_0x2529('0x25')],_0x2529('0xac'),_0x546bbd['pTalking']);this[_0x2529('0x99')](_0x58ed58,_0x58ed58['linkedid'],_0x58ed58[_0x2529('0x138')]);}else if(this[_0x2529('0x12')][_0x58ed58[_0x2529('0xbb')]][_0x2529('0x6d')]){logger[_0x2529('0x55')](_0x2529('0x139'),_0x58ed58[_0x2529('0xbb')],_0x58ed58[_0x2529('0x138')],_0x2529('0xab'),_0x546bbd['name'],_0x2529('0xac'),_0x546bbd[_0x2529('0x29')]);this[_0x2529('0x99')](_0x58ed58,_0x58ed58[_0x2529('0xbb')],_0x58ed58[_0x2529('0x138')]);}}};Preview['prototype'][_0x2529('0x13f')]=function(_0x15501f){if(this[_0x2529('0x12')][_0x15501f['destlinkedid']]&&_0x15501f['destlinkedid']!==_0x15501f[_0x2529('0x140')]){this[_0x2529('0x99')](_0x15501f,_0x15501f[_0x2529('0xed')],_0x15501f[_0x2529('0xe8')]);}};Preview[_0x2529('0xb')][_0x2529('0x1a')]=function(_0x77d8ea){if(this[_0x2529('0x12')][_0x77d8ea['linkedid']]&&_0x77d8ea['linkedid']!==_0x77d8ea[_0x2529('0xec')]&&!this[_0x2529('0x12')][_0x77d8ea['linkedid']][_0x2529('0x6d')]){if(_0x77d8ea['cause']==='1'){this[_0x2529('0x99')](_0x77d8ea,_0x77d8ea[_0x2529('0xbb')],_0x77d8ea[_0x2529('0x138')]);}}};Preview[_0x2529('0xb')][_0x2529('0x141')]=function(_0xa6e408,_0x34ee85,_0x29e80d){if(this[_0x2529('0x12')][_0xa6e408]){if(_[_0x2529('0x69')](this[_0x2529('0x12')][_0xa6e408][_0x2529('0x142')])){this[_0x2529('0x12')][_0xa6e408][_0x2529('0x142')]={};}this['actions'][_0xa6e408][_0x2529('0x142')][_0x34ee85]=_0x29e80d;}};Preview['prototype'][_0x2529('0x143')]=function(_0x2a9ac5){try{if(!_['isNil'](_0x2a9ac5)){if(ut['filterKey'](_[_0x2529('0x144')](_0x2a9ac5[_0x2529('0x145')])[0x0])){this[_0x2529('0x141')](_0x2a9ac5[_0x2529('0xec')],_['keys'](_0x2a9ac5[_0x2529('0x145')])[0x0],_0x2a9ac5[_0x2529('0x146')]);}}}catch(_0x113e2d){logger[_0x2529('0x147')]('[syncVarSet][Preview]',util[_0x2529('0x148')](_0x113e2d,{'showHidden':![],'depth':null}));}};Preview[_0x2529('0xb')][_0x2529('0x1f')]=function(_0x268052){if(_0x268052){if(this[_0x2529('0x12')][_0x268052[_0x2529('0x149')]]){this[_0x2529('0x12')][_0x268052['transfertargetlinkedid']]['transfer']=!![];}}};Preview[_0x2529('0xb')][_0x2529('0x21')]=function(_0x421eae){if(_0x421eae){if(this[_0x2529('0x12')][_0x421eae['transfererlinkedid']]){this[_0x2529('0x12')][_0x421eae['transfererlinkedid']][_0x2529('0x13c')]=!![];}}};module[_0x2529('0x14a')]=Preview; \ No newline at end of file +var _0x5178=['[originateFailure][logOriginateFailure]','syncNewExten','channel','actionid','logLookAgent','clone','isFailure','idContact','custom:agentringnoanswer','rejected','YYYY-MM-DD\x20HH:mm:ss','Answer','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','statedesc','callProgressDetectingAgent','transfer','destuniqueid','addVariable','variables','filterKey','keys','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','bluebird','uuid','moment','md5','../../../config/logger','preview','actionPreview','./rpcDb','./action','./util/util','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','emit','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','total','type','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','message','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startProgressive','Trunk','active','Interval','stringify','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','voice_queue_presence:remove','sendMessageOneNotActive','pTalking','paused','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','loopCampaigns','syncCampaigns','hasOwnProperty','booked','outbound','setMessage','dialPreviewAutoRecallMe','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','originated:\x20','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','status','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','queue','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','dialRecallMeTimeout','Agent','voicePause','run','logger2','[RecallMe]','disableContact','format','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','countnosuchnumberretry','countglobal','totalGlobal','NoSuchNumber','custom:agentnosuchnumber','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','custom:agentcomplete','complete','decrementTalkink','[16]','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','talktime','\x20Queue','BUSY','Busy','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','Global','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','dialAgentRejectMaxRetry','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectRetryFrequency','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','linkedid','[callProgressDetectingCustomer][machine]','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','destlinkedid','isUndefined','object','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','createAgentHistory','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','phone','Contact\x20is\x20undefined','Queue','lookAgent','execCall','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','logger','[Preview][execCall][failure]','Call\x20failed','logBlacklist','[Blacklist][error]','SIP/%s','reachable','execRun','unlock','unlockContact','getContactPreview','recallme','isValid','checkIsBlackList','[Preview][checkIsBlackList]','Call\x20unsuccessful','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialPrefix','dialCutDigit','Contact','substring','trim','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','Action','[originated][increment]','OriginateError'];(function(_0x799f47,_0x2ba8f5){var _0x29f319=function(_0x281a76){while(--_0x281a76){_0x799f47['push'](_0x799f47['shift']());}};_0x29f319(++_0x2ba8f5);}(_0x5178,0x171));var _0x8517=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x5178[_0x1035c1];return _0x308d67;};'use strict';var util=require('util');var _=require(_0x8517('0x0'));var BPromise=require(_0x8517('0x1'));var uuid=require(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var md5=require(_0x8517('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x8517('0x5'))(_0x8517('0x6'));var loggerAction=require('../../../config/logger')(_0x8517('0x7'));var ami=require('../ami');var rpcDb=require(_0x8517('0x8'));var Action=require(_0x8517('0x9'));var ut=require(_0x8517('0xa'));config[_0x8517('0xb')]=_[_0x8517('0xc')](config['redis'],{'host':_0x8517('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x8517('0xe')][_0x8517('0xf')]=function(_0x4dac4d){this[_0x8517('0x10')]=this[_0x8517('0x10')]?this[_0x8517('0x10')][_0x8517('0x11')](_0x4dac4d):_0x4dac4d();};function Preview(_0x1b4fc2){this[_0x8517('0x12')]=new Sequence();this[_0x8517('0x13')]=_0x1b4fc2[_0x8517('0x14')];this['trunks']=_0x1b4fc2[_0x8517('0x15')];this[_0x8517('0x16')]={};this[_0x8517('0x17')]=_0x1b4fc2[_0x8517('0x17')];this[_0x8517('0x18')]=0x0;ami['on']('originateresponse',this[_0x8517('0x19')][_0x8517('0x1a')](this));ami['on'](_0x8517('0x1b'),this[_0x8517('0x1c')][_0x8517('0x1a')](this));ami['on'](_0x8517('0x1d'),this[_0x8517('0x1e')][_0x8517('0x1a')](this));ami['on'](_0x8517('0x1f'),this[_0x8517('0x20')][_0x8517('0x1a')](this));ami['on'](_0x8517('0x21'),this['syncNewExten'][_0x8517('0x1a')](this));ami['on'](_0x8517('0x22'),this[_0x8517('0x23')][_0x8517('0x1a')](this));ami['on'](_0x8517('0x24'),this[_0x8517('0x25')][_0x8517('0x1a')](this));ami['on']('blindtransfer',this[_0x8517('0x26')]['bind'](this));this['loopCampaigns'](this[_0x8517('0x13')]);}function emit(_0x157bea,_0xf35d95,_0x180d8d){io['to'](_0x157bea)[_0x8517('0x27')](_0xf35d95,_0x180d8d);}function emitCampaignPreview(_0xdfde16){if(_0xdfde16['type']==='outbound'){var _0x2dd1df={'id':_0xdfde16['id'],'name':_0xdfde16[_0x8517('0x28')],'strategy':_0xdfde16[_0x8517('0x29')],'answered':_0xdfde16[_0x8517('0x2a')],'available':_0xdfde16[_0x8517('0x2b')],'loggedIn':_0xdfde16[_0x8517('0x2c')],'pTalking':_0xdfde16['pTalking'],'sumBillable':_0xdfde16[_0x8517('0x2d')],'sumDuration':_0xdfde16[_0x8517('0x2e')],'sumHoldTime':_0xdfde16['sumHoldTime']||0x0,'talking':_0xdfde16[_0x8517('0x2f')],'total':_0xdfde16[_0x8517('0x30')],'type':_0xdfde16[_0x8517('0x31')],'unmanaged':_0xdfde16['unmanaged'],'abandoned':_0xdfde16[_0x8517('0x32')],'waiting':_0xdfde16['waiting'],'loggedInDb':_0xdfde16[_0x8517('0x33')],'dialActive':_0xdfde16[_0x8517('0x34')],'dialMethod':_0xdfde16[_0x8517('0x35')],'dialOriginateCallerIdName':_0xdfde16[_0x8517('0x36')],'dialOriginateCallerIdNumber':_0xdfde16[_0x8517('0x37')],'dialOriginateTimeout':_0xdfde16[_0x8517('0x38')],'dialPrefix':_0xdfde16['dialPrefix'],'outboundAnswerAgiCallsDay':_0xdfde16[_0x8517('0x39')],'outboundAnswerCallsDay':_0xdfde16['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0xdfde16[_0x8517('0x3a')],'outboundBusyCallsDay':_0xdfde16[_0x8517('0x3b')],'outboundCongestionCallsDay':_0xdfde16[_0x8517('0x3c')],'outboundDropCallsDayACS':_0xdfde16[_0x8517('0x3d')],'outboundDropCallsDayCallersExit':_0xdfde16[_0x8517('0x3e')],'outboundDropCallsDayTimeout':_0xdfde16[_0x8517('0x3f')],'outboundNoAnswerCallsDay':_0xdfde16['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0xdfde16[_0x8517('0x40')],'outboundOriginateFailureCallsDay':_0xdfde16['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0xdfde16[_0x8517('0x41')],'outboundRejectCallsDay':_0xdfde16[_0x8517('0x42')],'outboundUnknownCallsDay':_0xdfde16[_0x8517('0x43')],'outboundAbandonedCallsDay':_0xdfde16[_0x8517('0x44')],'predictiveIntervalAnsweredCalls':_0xdfde16[_0x8517('0x45')],'predictiveIntervalAvgHoldtime':_0xdfde16[_0x8517('0x46')],'predictiveIntervalAvgTalktime':_0xdfde16[_0x8517('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0xdfde16[_0x8517('0x48')],'predictiveIntervalDroppedCallsTimeout':_0xdfde16[_0x8517('0x49')],'predictiveIntervalErlangCalls':_0xdfde16['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0xdfde16[_0x8517('0x4a')],'predictiveIntervalHitRate':_0xdfde16[_0x8517('0x4b')],'predictiveIntervalMultiplicativeFactor':_0xdfde16[_0x8517('0x4c')],'predictiveIntervalPauses':_0xdfde16['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0xdfde16['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xdfde16['predictiveIntervalTotalCalls'],'message':_0xdfde16[_0x8517('0x4d')],'originated':_0xdfde16[_0x8517('0x4e')],'erlangCalls':_0xdfde16[_0x8517('0x4f')],'erlangCallToSecond':_0xdfde16[_0x8517('0x50')],'erlangAbandonmentRate':_0xdfde16[_0x8517('0x51')],'erlangBusyFactor':_0xdfde16[_0x8517('0x52')],'startPredictive':_0xdfde16['startPredictive'],'startProgressive':_0xdfde16[_0x8517('0x53')]};if(_0xdfde16[_0x8517('0x54')]){_0x2dd1df[_0x8517('0x54')]={'id':_0xdfde16['Trunk']['id'],'name':_0xdfde16[_0x8517('0x54')]['name'],'active':_0xdfde16[_0x8517('0x54')][_0x8517('0x55')],'callerid':_0xdfde16['Trunk']['callerid']};}if(_0xdfde16[_0x8517('0x56')]){_0x2dd1df[_0x8517('0x56')]={'id':_0xdfde16[_0x8517('0x56')]['id'],'name':_0xdfde16[_0x8517('0x56')]['name']};}var _0x5b1d34=md5(JSON[_0x8517('0x57')](_0x2dd1df));if(_0xdfde16[_0x8517('0x4')]!==_0x5b1d34){_0xdfde16[_0x8517('0x4')]=_0x5b1d34;emit(util['format'](_0x8517('0x58'),_0x2dd1df[_0x8517('0x28')]),'voice_queue:save',_0x2dd1df);}}}function emitVoiceQueueChannelRemove(_0x209235){logger[_0x8517('0x59')](_0x8517('0x5a'),JSON[_0x8517('0x57')](_0x209235));emit(util['format'](_0x8517('0x58'),_0x209235[_0x8517('0x28')]),_0x8517('0x5b'),_0x209235);io[_0x8517('0x27')](_0x8517('0x5c'),_0x209235);}function notSendMessagesQueue(_0x22592a){if(_0x22592a[_0x8517('0x5d')]){if(_0x22592a[_0x8517('0x4e')]===0x0&&_0x22592a[_0x8517('0x5e')]===0x0){_0x22592a[_0x8517('0x5d')]=![];_0x22592a[_0x8517('0x2b')]=0x0;_0x22592a[_0x8517('0x5f')]=0x0;_0x22592a[_0x8517('0x4d')]='NOT_ACTIVE';ut['logger'](_0x8517('0x60'),_0x22592a[_0x8517('0x28')]+_0x8517('0x61'));}else{_0x22592a[_0x8517('0x4d')]=_0x8517('0x62');ut['logger'](_0x8517('0x60'),_0x22592a[_0x8517('0x28')]+'\x20is\x20disactive');}emitCampaignPreview(_0x22592a);}}Preview[_0x8517('0xe')][_0x8517('0x63')]=function(){var _0x32fba6=this;setInterval(function(){_0x32fba6[_0x8517('0x64')]();},0x7cf);};Preview['prototype'][_0x8517('0x64')]=function(){var _0x24034f=this['campaignsPreview'];this[_0x8517('0x18')]+=0x1;for(var _0x275960 in _0x24034f){if(_0x24034f[_0x8517('0x65')](_0x275960)&&(_0x24034f[_0x275960]['dialMethod']===_0x8517('0x6')||_0x24034f[_0x275960][_0x8517('0x35')]===_0x8517('0x66'))&&_0x24034f[_0x275960][_0x8517('0x31')]===_0x8517('0x67')){if(this[_0x8517('0x18')]>0x7){this[_0x8517('0x18')]=0x0;this['clearZombieChannels']();}}if(_0x24034f[_0x8517('0x65')](_0x275960)&&_0x24034f[_0x275960][_0x8517('0x35')]==='preview'&&_0x24034f[_0x275960][_0x8517('0x31')]===_0x8517('0x67')){if(_0x24034f[_0x275960][_0x8517('0x34')]){this[_0x8517('0x68')](_0x24034f[_0x275960]);if(_0x24034f[_0x275960][_0x8517('0x69')])this[_0x8517('0x6a')](_0x24034f[_0x275960]);}else{notSendMessagesQueue(_0x24034f[_0x275960]);}}}};Preview['prototype'][_0x8517('0x6b')]=function(_0x10c07a){var _0x3a9778=this;this['sequence'][_0x8517('0xf')](function(){if(!_[_0x8517('0x6c')](_0x3a9778['actions'][_0x10c07a])){loggerAction[_0x8517('0x59')](_0x8517('0x6d'),_0x10c07a,'Queue',_0x3a9778['actions'][_0x10c07a]['queue'],_0x8517('0x6e'),JSON[_0x8517('0x57')](_0x3a9778['campaignsPreview'][_0x3a9778[_0x8517('0x16')][_0x10c07a]['queue']]['originated']),_0x8517('0x6f'),JSON[_0x8517('0x57')](_0x3a9778[_0x8517('0x13')][_0x3a9778[_0x8517('0x16')][_0x10c07a]['queue']][_0x8517('0x5e')]),JSON[_0x8517('0x57')](_0x3a9778[_0x8517('0x16')][_0x10c07a]['dialAnswer']),JSON[_0x8517('0x57')](_[_0x8517('0x70')](_0x3a9778[_0x8517('0x16')][_0x10c07a],[_0x8517('0x71'),_0x8517('0x72'),_0x8517('0x73'),_0x8517('0x74')])));return ami['Action']({'action':_0x8517('0x75'),'channel':_0x3a9778['actions'][_0x10c07a]['channel']})[_0x8517('0x76')](function(_0x776ee2){if(_0x776ee2[_0x8517('0x4d')]===_0x8517('0x77')){setTimeout(function(){if(_0x3a9778['actions'][_0x10c07a]){ut[_0x8517('0x78')](_0x3a9778[_0x8517('0x13')][_0x3a9778['actions'][_0x10c07a]['queue']],_0x8517('0x79'));if(_0x3a9778[_0x8517('0x16')][_0x10c07a][_0x8517('0x7a')]===!![]){ut['decrementTalkink'](_0x3a9778[_0x8517('0x13')][_0x3a9778['actions'][_0x10c07a][_0x8517('0x7b')]],_0x8517('0x79'));ut[_0x8517('0x7c')](_0x8517('0x7d')+_0x10c07a,_0x3a9778[_0x8517('0x16')][_0x10c07a][_0x8517('0x7b')]);}ut[_0x8517('0x7c')](_0x8517('0x7e')+_0x10c07a,_0x3a9778[_0x8517('0x16')][_0x10c07a]['queue']);delete _0x3a9778['actions'][_0x10c07a];}},0x2328);}});}});};Preview[_0x8517('0xe')][_0x8517('0x7f')]=function(){var _0x260aa9=this;loggerAction['info'](_0x8517('0x80'),_[_0x8517('0x81')](this[_0x8517('0x16')]));for(var _0x4cc9e2 in this['actions']){if(_0x260aa9[_0x8517('0x16')][_0x8517('0x65')](_0x4cc9e2)){_0x260aa9[_0x8517('0x6b')](_0x4cc9e2);}}};Preview[_0x8517('0xe')][_0x8517('0x6a')]=function(_0x3be6db){var _0x3d8773=this;rpcDb[_0x8517('0x82')](_0x3be6db['id'],ut[_0x8517('0x83')](this[_0x8517('0x17')]))[_0x8517('0x84')](function(_0x3c5462){if(!_[_0x8517('0x6c')](_0x3c5462)){for(var _0x20dc60=0x0;_0x20dc60<_0x3c5462[_0x8517('0x85')];_0x20dc60+=0x1){if(ut[_0x8517('0x86')](_0x3c5462[_0x20dc60]['scheduledat'])<_0x3be6db[_0x8517('0x87')]*0x3c){if(_0x3c5462[_0x20dc60][_0x8517('0x88')]&&!_0x3c5462[_0x20dc60][_0x8517('0x88')][_0x8517('0x89')]){_0x3d8773[_0x8517('0x8a')](_0x3c5462[_0x20dc60]['id'])[_0x8517('0x84')](ut[_0x8517('0x8b')]('[RecallMe]'))[_0x8517('0x76')](ut[_0x8517('0x8b')](_0x8517('0x8c')));}else{rpcDb[_0x8517('0x8d')](_0x3c5462[_0x20dc60]['id']);}}else{var _0x4240d0=new Action(_0x3c5462[_0x20dc60],_0x3be6db);_0x4240d0['starttime']=moment()[_0x8517('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3be6db[_0x8517('0x41')]+=0x1;ut[_0x8517('0x8f')](_0x4240d0,0x17,_0x8517('0x90'));if(_0x3be6db[_0x8517('0x91')]){rpcDb[_0x8517('0x92')](ut['createBody'](_0x3c5462[_0x20dc60]));rpcDb[_0x8517('0x93')](_0x4240d0,_0x8517('0x94'));}else{ut[_0x8517('0x8f')](_0x4240d0,0x16,_0x8517('0x95'));rpcDb['createCustomerHistory'](_0x4240d0,'[HistoryRecallClose]');rpcDb[_0x8517('0x96')](_0x4240d0,'[HistoryRecallClose]');}}}}})[_0x8517('0x76')](ut[_0x8517('0x8b')]('[getContactRecallMe]'));};Preview[_0x8517('0xe')][_0x8517('0x68')]=function(_0x4a483d){_0x4a483d[_0x8517('0x5d')]=!![];if(ut[_0x8517('0x97')](_0x4a483d[_0x8517('0x2c')])){_0x4a483d[_0x8517('0x4d')]=_0x8517('0x98');}else if(!ut[_0x8517('0x99')](_0x4a483d[_0x8517('0x34')])){_0x4a483d[_0x8517('0x4d')]='NOT_ACTIVE';}else if(!this[_0x8517('0x9a')](_0x4a483d[_0x8517('0x54')])){if(!this[_0x8517('0x9a')](_0x4a483d[_0x8517('0x9b')])){_0x4a483d['message']=_0x8517('0x9c');}else{_0x4a483d['message']=_0x8517('0x9d');}}else{_0x4a483d[_0x8517('0x4d')]=_0x8517('0x9d');}emitCampaignPreview(_0x4a483d);};Preview[_0x8517('0xe')]['callProgressDetectingCustomer']=function(_0x56d267,_0x23be4d,_0x1f1984){var _0x462c1c=this;var _0x548fa1=this['actions'][_0x23be4d];var _0x11a801=this[_0x8517('0x13')][_0x548fa1[_0x8517('0x7b')]];var _0x197a30;if(_0x11a801){switch(_0x1f1984){case'1':_0x11a801[_0x8517('0x40')]+=0x1;_0x548fa1[_0x8517('0x9e')]+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x0,_0x8517('0xa1'));ami['emit'](_0x8517('0xa2'),ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xa4')));rpcDb['createCustomerHistory'](_0x548fa1,_0x8517('0xa5'));if(ut['totalGlobal'](_0x548fa1)>=_0x11a801[_0x8517('0xa6')]){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,'Global');rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xa8'));}else{if(_0x548fa1[_0x8517('0x9e')]>=_0x11a801[_0x8517('0xa9')]){rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xa8'));}else{rpcDb['rescheduleContact'](ut[_0x8517('0xaa')](_0x548fa1,'countnosuchnumberretry',_0x11a801[_0x8517('0xab')]),_0x548fa1[_0x8517('0xac')],_0x548fa1[_0x8517('0xad')]);}}delete this[_0x8517('0x16')][_0x56d267['linkedid']];break;case _0x8517('0xae'):var _0x670690=moment()[_0x8517('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');_0x548fa1[_0x8517('0xaf')]=_0x670690;_0x548fa1[_0x8517('0xb0')]=_0x670690;_0x548fa1[_0x8517('0x7a')]=!![];_0x11a801[_0x8517('0x5e')]+=0x1;logger[_0x8517('0x59')](_0x8517('0xb1'),_0x548fa1[_0x8517('0xb2')],'\x20Queue',_0x11a801[_0x8517('0x28')],'pTalking:\x20',_0x11a801['pTalking']);ami[_0x8517('0x27')](_0x8517('0xb3'),ut[_0x8517('0xa3')](_0x548fa1,'connect',this[_0x8517('0x13')][_0x548fa1[_0x8517('0x7b')]]));if(_0x11a801['acw']){ami[_0x8517('0x27')]('custom:agentConnectPreview',ut['buildAcw'](_0x548fa1));}break;case'16':ami[_0x8517('0x27')](_0x8517('0xb4'),ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xb5'),this[_0x8517('0x13')][_0x548fa1['queue']]));emitVoiceQueueChannelRemove(ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xb5')));_0x11a801['outboundAnswerCallsDay']+=0x1;_0x11a801['total']+=0x1;_0x11a801[_0x8517('0x2a')]+=0x1;ut[_0x8517('0xb6')](_0x11a801,_0x8517('0xb7'));_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x4,'Answer');rpcDb['createCustomerHistory'](_0x548fa1,_0x8517('0xb8'));rpcDb[_0x8517('0x96')](_0x548fa1,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x8517('0xb9')](_0x548fa1);_0x11a801[_0x8517('0x2e')]+=_0x548fa1['talktime'];_0x11a801[_0x8517('0x2d')]+=_0x548fa1[_0x8517('0xba')];logger[_0x8517('0x59')]('[syncHangup][talking][decrement]',_0x548fa1['uniqueid'],_0x8517('0xbb'),_0x11a801[_0x8517('0x28')],_0x8517('0x6f'),_0x11a801[_0x8517('0x5e')]);delete this[_0x8517('0x16')][_0x56d267['linkedid']];break;case _0x8517('0xbc'):_0x11a801[_0x8517('0x3b')]+=0x1;_0x548fa1['countbusyretry']+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x5,_0x8517('0xbd'));ami[_0x8517('0x27')](_0x8517('0xbe'),ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xbf')));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xc0'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801[_0x8517('0xa6')]){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xc2'));}else{if(_0x548fa1[_0x8517('0xc3')]>=_0x11a801[_0x8517('0xc4')]){rpcDb[_0x8517('0x96')](_0x548fa1,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x8517('0xc5')](ut[_0x8517('0xaa')](_0x548fa1,_0x8517('0xc3'),_0x11a801[_0x8517('0xc6')]),_0x548fa1[_0x8517('0xac')],_0x548fa1[_0x8517('0xad')]);}}break;case _0x8517('0xc7'):_0x11a801['outboundNoAnswerCallsDay']+=0x1;_0x548fa1[_0x8517('0xc8')]+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x3,_0x8517('0xc9'));ami[_0x8517('0x27')]('custom:agentnoanswer',ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xca')));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xcb'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801['dialGlobalMaxRetry']){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xcc'));}else{if(_0x548fa1['countnoanswerretry']>=_0x11a801[_0x8517('0xcd')]){rpcDb['createCustomerFinal'](_0x548fa1,_0x8517('0xcb'));}else{rpcDb[_0x8517('0xc5')](ut[_0x8517('0xaa')](_0x548fa1,_0x8517('0xc8'),_0x11a801[_0x8517('0xce')]),_0x548fa1[_0x8517('0xac')],_0x548fa1[_0x8517('0xad')]);}}break;case _0x8517('0xcf'):_0x11a801[_0x8517('0x3c')]+=0x1;_0x548fa1['countcongestionretry']+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x8,_0x8517('0xd0'));ami['emit'](_0x8517('0xd1'),ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xd2')));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xd3'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801[_0x8517('0xa6')]){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xd4'));}else{if(_0x548fa1[_0x8517('0xd5')]>=_0x11a801['dialCongestionMaxRetry']){rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xd3'));}else{rpcDb['rescheduleContact'](ut[_0x8517('0xaa')](_0x548fa1,_0x8517('0xd5'),_0x11a801['dialBusyRetryFrequency']),_0x548fa1['unlockAgent'],_0x548fa1['activeContact']);}}break;case _0x8517('0xd6'):_0x11a801['outboundRejectCallsDay']+=0x1;_0x548fa1[_0x8517('0xd7')]+=0x1;_0x548fa1['countglobal']=ut[_0x8517('0xa0')](_0x548fa1);ut['logCustomer'](_0x548fa1,0x14,_0x8517('0xd8'));ami['emit'](_0x8517('0xd9'),ut[_0x8517('0xa3')](_0x548fa1,'agentreject'));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xda'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801[_0x8517('0xa6')]){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0x14,'AgentReject');rpcDb['createCustomerFinal'](_0x197a30,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x548fa1[_0x8517('0xd7')]>=_0x11a801[_0x8517('0xdb')]){rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xdc'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x548fa1,_0x8517('0xd7'),_0x11a801[_0x8517('0xdd')]),_0x548fa1['unlockAgent'],_0x548fa1[_0x8517('0xad')]);}}break;case _0x8517('0xde'):_0x11a801[_0x8517('0x44')]+=0x1;_0x548fa1[_0x8517('0xdf')]+=0x1;_0x548fa1['countglobal']=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0xb,_0x8517('0xe0'));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xe1'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801['dialGlobalMaxRetry']){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xe1'));}else{if(_0x548fa1[_0x8517('0xe2')]>=_0x11a801['dialAbandonedMaxRety']){rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xe1'));}else{rpcDb['rescheduleContact'](ut[_0x8517('0xaa')](_0x548fa1,_0x8517('0xdf'),_0x11a801[_0x8517('0xe3')]),_0x548fa1['unlockAgent'],_0x548fa1[_0x8517('0xad')]);}}break;case'18':_0x11a801['outboundUnknownCallsDay']+=0x1;_0x548fa1[_0x8517('0xe4')]+=0x1;_0x548fa1['countglobal']=ut['totalGlobal'](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0x12,_0x56d267[_0x8517('0xe5')]||_0x56d267[_0x8517('0xe6')]);ami[_0x8517('0x27')](_0x8517('0xe7'),ut['buildObj'](_0x548fa1,_0x8517('0xe8')));rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xe9'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801['dialGlobalMaxRetry']){_0x197a30=ut['cloneAction'](_0x548fa1,0xf,'Global');rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xe9'));}else{rpcDb[_0x8517('0x96')](_0x548fa1,'[callProgressDetectingCustomer][hangupInAMD]');}delete this[_0x8517('0x16')][_0x56d267[_0x8517('0xea')]];break;case'19':_0x11a801['outboundUnknownCallsDay']+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut['logCustomer'](_0x548fa1,0x13,_0x56d267['cause-txt']||_0x56d267[_0x8517('0xe6')]);ami['emit']('custom:amd',ut[_0x8517('0xa3')](_0x548fa1,_0x8517('0xe8')));rpcDb['createCustomerHistory'](_0x548fa1,'[callProgressDetectingCustomer][machine]');if(ut['totalGlobal'](_0x548fa1)>=_0x11a801['dialGlobalMaxRetry']){_0x197a30=ut['cloneAction'](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb[_0x8517('0x96')](_0x197a30,_0x8517('0xeb'));}else{rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xeb'));}delete this['actions'][_0x56d267['linkedid']];break;default:if(_0x548fa1[_0x8517('0x7a')]){ut[_0x8517('0xb6')](_0x11a801,_0x8517('0xec'));ut[_0x8517('0x7c')](_0x8517('0xed')+_0x11a801[_0x8517('0x28')],_0x56d267);}_0x11a801[_0x8517('0x43')]+=0x1;_0x548fa1[_0x8517('0x9f')]=ut[_0x8517('0xa0')](_0x548fa1);ut[_0x8517('0x8f')](_0x548fa1,0xc,_0x56d267[_0x8517('0xe5')]||_0x56d267[_0x8517('0xe6')]);rpcDb[_0x8517('0x93')](_0x548fa1,_0x8517('0xee'));if(ut[_0x8517('0xa0')](_0x548fa1)>=_0x11a801[_0x8517('0xa6')]){_0x197a30=ut[_0x8517('0xa7')](_0x548fa1,0xf,_0x8517('0xc1'));rpcDb['createCustomerFinal'](_0x197a30,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb[_0x8517('0x96')](_0x548fa1,_0x8517('0xef'));}delete this[_0x8517('0x16')][_0x56d267['linkedid']];}if(!(_0x548fa1[_0x8517('0x7a')]&&_0x1f1984==='16')){ut[_0x8517('0x78')](_0x11a801,'[callProgressDetectingCustomer]');logger[_0x8517('0x59')]('[originated][decrement][callProgressDetectingCustomer]',_0x548fa1['uniqueid'],_0x8517('0xbb'),_0x11a801['name'],'originated:\x20',_0x11a801['originated']);}if(_0x1f1984!==_0x8517('0xae')){delete this[_0x8517('0x16')][_0x56d267[_0x8517('0xea')]];delete this[_0x8517('0x16')][_0x56d267[_0x8517('0xf0')]];}}};Preview['prototype']['callProgressDetectingAgent']=function(_0x547651,_0x25c45d,_0x2e8859){if(_[_0x8517('0xf1')](_0x25c45d)&&_0x8517('0xf2')!==typeof _0x25c45d){return;}if(_['isUndefined'](_0x2e8859)&&_0x8517('0xf2')!==typeof _0x2e8859){return;}switch(_0x2e8859[_0x8517('0xf3')]){case'0':ut[_0x8517('0xf4')](_0x547651,0x0,_0x8517('0xa1'));rpcDb['createAgentHistory'](_0x547651,_0x8517('0xf5'));break;case'3':ut[_0x8517('0xf4')](_0x547651,0x3,_0x8517('0xc9'));rpcDb['createAgentHistory'](_0x547651,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut['logAgent'](_0x547651,0x5,_0x8517('0xbd'));rpcDb[_0x8517('0xf6')](_0x547651,_0x8517('0xf7'));break;case'8':ut['logAgent'](_0x547651,0x8,'Congestion');rpcDb['createAgentHistory'](_0x547651,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x8517('0xf4')](_0x547651,0x16,_0x8517('0xf8'));rpcDb[_0x8517('0xf6')](_0x547651,_0x8517('0xf9'));break;default:ut[_0x8517('0xf4')](_0x547651,0xc,_0x2e8859[_0x8517('0xf3')]);rpcDb[_0x8517('0xf6')](_0x547651,_0x8517('0xfa'));}ut['updateOriginated'](_0x25c45d,_0x8517('0xfb'));logger[_0x8517('0x59')](_0x8517('0xfc'),_0x547651['uniqueid'],_0x8517('0xbb'),_0x25c45d[_0x8517('0x28')],'originated:\x20',_0x25c45d[_0x8517('0x4e')]);delete this[_0x8517('0x16')][_0x547651[_0x8517('0xb2')]];};Preview[_0x8517('0xe')][_0x8517('0xfd')]=function(_0x3784cc,_0x283f38,_0x2093e8,_0x3059a,_0x37b066){var _0x410651=this;return new BPromise(function(_0x194c1d,_0x41d647){if(_[_0x8517('0x6c')](_0x283f38)||_[_0x8517('0x6c')](_0x283f38['Contact'])||_[_0x8517('0x6c')](_0x283f38['Contact'][_0x8517('0xfe')])||_[_0x8517('0x6c')](_0x283f38[_0x8517('0x73')])){_0x41d647(ut[_0x8517('0x4d')](_0x8517('0xff'),_0x3059a,_0x37b066));return;}var _0xd8e716=uuid['v4']();var _0x4289e2=_0x410651[_0x8517('0x13')][_0x283f38[_0x8517('0x100')]['name']];var _0x5b591e=_0x2093e8?_0x410651['agents'][_0x2093e8]['id']:undefined;_0x410651[_0x8517('0x16')][_0xd8e716]=new Action(_0x283f38,_0x4289e2,_0xd8e716,_0x2093e8,_0x5b591e);var _0x16ebfb=_0x410651[_0x8517('0x16')][_0xd8e716];_0x16ebfb[_0x8517('0xac')]=_0x3059a;_0x16ebfb[_0x8517('0xad')]=_0x37b066;_0x16ebfb[_0x8517('0x101')]=_0x2093e8;if(_['isEmpty'](_0x3784cc)){_0x410651[_0x8517('0x102')](_0x16ebfb,_0x4289e2,_0x283f38,_0x2093e8)['then'](function(_0xbb4eaa){logger['info']('[Preview][execCall][success]',_0x8517('0x103')+_0x16ebfb[_0x8517('0x7b')]+_0x8517('0x104')+_0x16ebfb['idContact'],JSON[_0x8517('0x57')](_0xbb4eaa));ami['emit'](_0x8517('0x105'),ut['buildObj'](_0x16ebfb,_0x8517('0x106'),_0x410651[_0x8517('0x13')][_0x16ebfb['queue']]));_0x194c1d(ut['message']('Calling'));})[_0x8517('0x76')](function(_0x55348c){ut[_0x8517('0x107')](_0x8517('0x108'),_0x55348c);_0x41d647(ut[_0x8517('0x4d')](_0x8517('0x109'),_0x3059a,_0x37b066));});}else{_0x4289e2[_0x8517('0x3a')]+=0x1;ut[_0x8517('0x10a')](_0x16ebfb);rpcDb['createHistory'](_0x16ebfb,_0x8517('0x10b'));delete _0x410651[_0x8517('0x16')][_0xd8e716];_0x41d647(ut[_0x8517('0x4d')]('Contact\x20in\x20black\x20List',_0x3059a,_0x37b066));}});};Preview[_0x8517('0xe')][_0x8517('0x9a')]=function(_0xf83d16){return!_[_0x8517('0x6c')](_0xf83d16)&&!_['isNil'](_0xf83d16[_0x8517('0x28')])&&!_[_0x8517('0x6c')](_0xf83d16[_0x8517('0x55')])&&_0xf83d16[_0x8517('0x55')]&&!_[_0x8517('0x6c')](this['trunks'][util['format'](_0x8517('0x10c'),_0xf83d16['name'])])&&!_[_0x8517('0x6c')](this[_0x8517('0x15')][util[_0x8517('0x8e')](_0x8517('0x10c'),_0xf83d16[_0x8517('0x28')])][_0x8517('0x75')])&&(this[_0x8517('0x15')][util[_0x8517('0x8e')](_0x8517('0x10c'),_0xf83d16[_0x8517('0x28')])]['status']===_0x8517('0x10d')||this[_0x8517('0x15')][util['format'](_0x8517('0x10c'),_0xf83d16[_0x8517('0x28')])]['status']==='unmonitored');};Preview[_0x8517('0xe')][_0x8517('0x8a')]=function(_0x55fe4e,_0x44395a){var _0xa21a56=this;return new BPromise(function(_0x1d5f5e,_0x3a6b52){_0xa21a56[_0x8517('0x10e')](_0x55fe4e,_0x44395a)[_0x8517('0x84')](function(_0x1e71ba){_0x1d5f5e(_['pick'](_0x1e71ba,[_0x8517('0x4d')]));})[_0x8517('0x76')](function(_0x48c790){if(_0x48c790[_0x8517('0x10f')]){rpcDb[_0x8517('0x110')](_0x55fe4e);}if(_0x48c790[_0x8517('0x55')]){rpcDb[_0x8517('0x8d')](_0x55fe4e);}_0x3a6b52(_[_0x8517('0x70')](_0x48c790,[_0x8517('0x4d')]));});});};Preview[_0x8517('0xe')][_0x8517('0x10e')]=function(_0xc35223,_0x29499b){var _0x49ab5a=this;return new BPromise(function(_0x1d347e,_0x4ea202){var _0x5d2ef6,_0x1df5c8;rpcDb[_0x8517('0x111')](_0xc35223)[_0x8517('0x84')](function(_0x4602b2){if(!_[_0x8517('0x6c')](_0x4602b2[0x0])){_0x1df5c8=_0x4602b2[0x0][_0x8517('0x112')]?![]:!![];_0x5d2ef6=_0x4602b2[0x0][_0x8517('0x112')]?!![]:![];_0x5d2ef6=_0x29499b?!![]:_0x5d2ef6;}var _0x59aa36=_0x49ab5a['validateContact'](_0x4602b2);if(_0x59aa36[_0x8517('0x113')]){rpcDb[_0x8517('0x114')](_[_0x8517('0x70')](_0x4602b2[0x0],[_0x8517('0x73'),'Contact.phone']))['then'](function(_0x29844e){_0x49ab5a[_0x8517('0xfd')](_0x29844e,_0x4602b2[0x0],_0x29499b,_0x1df5c8,_0x5d2ef6)[_0x8517('0x84')](function(_0x5ac4c1){_0x1d347e(_0x5ac4c1);})[_0x8517('0x76')](function(_0x1a7d79){_0x4ea202(_0x1a7d79);});})[_0x8517('0x76')](function(_0x612f42){ut[_0x8517('0x107')](_0x8517('0x115'),_0x612f42);_0x4ea202(ut['message']('Call\x20unsuccessful',_0x1df5c8,_0x5d2ef6));});}else{_0x4ea202(ut['message'](_0x59aa36[_0x8517('0x4d')],_0x1df5c8,_0x5d2ef6));}})[_0x8517('0x76')](function(_0xb9db8f){ut[_0x8517('0x107')]('[Preview][getContactPreview]',_0xb9db8f);_0x4ea202(ut[_0x8517('0x4d')](_0x8517('0x116'),![],!![]));});});};Preview[_0x8517('0xe')]['validateContact']=function(_0x217924){if(_[_0x8517('0x6c')](_0x217924)||_[_0x8517('0x117')](_0x217924)||!_[_0x8517('0x6c')](_0x217924[0x0]['Agent'])&&_['isNil'](_0x217924[0x0]['Agent']['name'])){ut[_0x8517('0x107')]('[Preview][validateContact][Empty\x20Contact]',_0x217924);return{'isValid':![],'message':_0x8517('0x118')};}var _0x5af9cb=this['campaignsPreview'][_0x217924[0x0]['Queue']['name']];_0x5af9cb[_0x8517('0x4d')]=_0x8517('0x9d');if(_[_0x8517('0x6c')](_0x5af9cb)){ut[_0x8517('0x107')](_0x8517('0x119'),_0x5af9cb);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0x8517('0x9a')](_0x5af9cb[_0x8517('0x54')])){ut[_0x8517('0x107')](_0x8517('0x11a'),_0x8517('0x11b')+_0x5af9cb[_0x8517('0x28')]+_0x8517('0x11c'));if(!this[_0x8517('0x9a')](_0x5af9cb[_0x8517('0x9b')])){ut[_0x8517('0x107')](_0x8517('0x11a'),_0x5af9cb['name']+_0x8517('0x11d'));return{'isValid':![],'message':_0x8517('0x11e')};}}if(!ut[_0x8517('0x99')](_0x5af9cb[_0x8517('0x34')])){ut[_0x8517('0x107')](_0x8517('0x11f'),_0x5af9cb[_0x8517('0x28')]+_0x8517('0x120'));return{'isValid':![],'message':_0x8517('0x11b')+_0x5af9cb[_0x8517('0x28')]+_0x8517('0x120')};}return{'isValid':!![],'message':_0x8517('0x121')};};Preview[_0x8517('0xe')][_0x8517('0x102')]=function(_0x5d74d4,_0x1e3c84,_0x15256c,_0x2ad6f7){var _0x3535e3=this;return new BPromise(function(_0x4f03be,_0x5a1c63){var _0x3fbfe0=_0x5d74d4[_0x8517('0xb2')];var _0x5a1f7d=_0x3535e3[_0x8517('0x9a')](_0x1e3c84[_0x8517('0x54')])?util['format'](_0x8517('0x122'),_0x1e3c84['Trunk']['name'],_[_0x8517('0x6c')](_0x1e3c84[_0x8517('0x123')])?'':_0x1e3c84[_0x8517('0x123')]['trim']()||'',_0x1e3c84[_0x8517('0x124')]>0x0?_0x15256c[_0x8517('0x125')][_0x8517('0xfe')][_0x8517('0x126')](_0x1e3c84[_0x8517('0x124')]):_0x15256c[_0x8517('0x125')][_0x8517('0xfe')]):util[_0x8517('0x8e')](_0x8517('0x122'),_[_0x8517('0x6c')](_0x1e3c84[_0x8517('0x9b')])?_0x1e3c84['Trunk']['name']:_0x1e3c84['TrunkBackup']['name'],_['isNil'](_0x1e3c84['dialPrefix'])?'':_0x1e3c84[_0x8517('0x123')][_0x8517('0x127')]()||'',_0x1e3c84[_0x8517('0x124')]>0x0?_0x15256c[_0x8517('0x125')][_0x8517('0xfe')][_0x8517('0x126')](_0x1e3c84[_0x8517('0x124')]):_0x15256c['Contact'][_0x8517('0xfe')]);var _0x209801=_0x3535e3[_0x8517('0x9a')](_0x1e3c84[_0x8517('0x54')])?ut[_0x8517('0x128')](_0x1e3c84[_0x8517('0x54')][_0x8517('0x129')],_0x1e3c84[_0x8517('0x36')],_0x1e3c84[_0x8517('0x12a')]>0x0?ut[_0x8517('0x12b')](_0x1e3c84['dialOriginateCallerIdNumber'],_0x1e3c84[_0x8517('0x12a')]):_0x1e3c84['dialOriginateCallerIdNumber']):ut['getCallerId'](_[_0x8517('0x6c')](_0x1e3c84[_0x8517('0x9b')])?_0x1e3c84['Trunk'][_0x8517('0x129')]:_0x1e3c84['TrunkBackup']['callerid'],_0x1e3c84[_0x8517('0x36')],_0x1e3c84[_0x8517('0x12a')]>0x0?ut[_0x8517('0x12b')](_0x1e3c84[_0x8517('0x37')],_0x1e3c84[_0x8517('0x12a')]):_0x1e3c84['dialOriginateCallerIdNumber']);if(_0x209801){_0x5d74d4[_0x8517('0x12c')]=ut[_0x8517('0x12d')](_0x209801);_0x5d74d4[_0x8517('0x12e')]=ut[_0x8517('0x12f')](_0x209801);}var _0x23d64b=ut[_0x8517('0x130')](_0x1e3c84,_0x15256c,_0x5a1f7d,_0x209801,_0x3fbfe0,_0x5d74d4);_[_0x8517('0x131')](_0x5d74d4,ut[_0x8517('0x132')](_0x23d64b));_0x5d74d4[_0x8517('0x133')]=moment()[_0x8517('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x8517('0x134')](ut['variablesAction'](_0x5d74d4,_0x1e3c84,_0x23d64b,_0x5d74d4[_0x8517('0xad')],_0x2ad6f7))[_0x8517('0x84')](function(_0x488062){_0x1e3c84[_0x8517('0x4e')]+=0x1;logger[_0x8517('0x59')](_0x8517('0x135'),_0x3fbfe0,_0x8517('0xbb'),_0x1e3c84[_0x8517('0x28')],_0x8517('0x6e'),_0x1e3c84[_0x8517('0x4e')]);_0x4f03be(_0x488062);})[_0x8517('0x76')](function(_0x257a0c){ut[_0x8517('0xf4')](_0x5d74d4,0xe,_0x8517('0x136'));rpcDb[_0x8517('0xf6')](_0x5d74d4,_0x8517('0x137'));_0x5a1c63(_0x257a0c);});});};Preview[_0x8517('0xe')][_0x8517('0x138')]=function(_0x18b6c4){if(this[_0x8517('0x16')][_0x18b6c4[_0x8517('0xea')]]){this[_0x8517('0x16')][_0x18b6c4[_0x8517('0xea')]]['channel']=_0x18b6c4[_0x8517('0x139')];}};Preview[_0x8517('0xe')][_0x8517('0x19')]=function(_0x19ce0b){var _0x2c39ec=this;var _0x4e8b57=this[_0x8517('0x16')][_0x19ce0b[_0x8517('0x13a')]];if(_0x4e8b57){if(_0x4e8b57[_0x8517('0x101')]&&this[_0x8517('0x17')][_0x4e8b57[_0x8517('0x101')]]){ut[_0x8517('0x13b')](_0x4e8b57,this[_0x8517('0x17')][_0x4e8b57[_0x8517('0x101')]][_0x8517('0x28')],this['agents'][_0x4e8b57[_0x8517('0x101')]]['id']);}var _0xc0b55a=_[_0x8517('0x13c')](_0x4e8b57);_0xc0b55a[_0x8517('0xaf')]=moment()[_0x8517('0x8e')]('YYYY-MM-DD\x20HH:mm:ss');var _0x31d6ad=_0x2c39ec['campaignsPreview'][_0x4e8b57[_0x8517('0x7b')]];if(ut[_0x8517('0x13d')](_0x19ce0b['response'])){if(_0x4e8b57[_0x8517('0xac')]){rpcDb[_0x8517('0x110')](_0x4e8b57[_0x8517('0x13e')]);}if(_0x4e8b57['activeContact']){rpcDb[_0x8517('0x8d')](_0x4e8b57[_0x8517('0x13e')]);}ami[_0x8517('0x27')](_0x8517('0x13f'),ut[_0x8517('0xa3')](_0x4e8b57,_0x8517('0x140'),this['campaignsPreview'][_0x4e8b57[_0x8517('0x7b')]]));this['callProgressDetectingAgent'](_0xc0b55a,_0x31d6ad,_0x19ce0b);}else{_0x4e8b57[_0x8517('0x133')]=moment()[_0x8517('0x8e')](_0x8517('0x141'));ut[_0x8517('0xf4')](_0xc0b55a,0x4,_0x8517('0x142'));rpcDb[_0x8517('0xf6')](_0xc0b55a,'[callProgressDetectingAgent][logAnswer]');}}};Preview['prototype']['syncHangup']=function(_0x32cab3){var _0x47bd94=this;var _0x38e4bb=this[_0x8517('0x16')][_0x32cab3[_0x8517('0xea')]];var _0x408937;if(_0x38e4bb){_0x408937=this[_0x8517('0x13')][_0x38e4bb[_0x8517('0x7b')]];logger[_0x8517('0x59')]('[syncHangup][talking]',_0x32cab3['linkedid'],_0x8517('0xbb'),_0x408937['name'],'pTalking:\x20',_0x408937['pTalking']);}if(this[_0x8517('0x16')][_0x32cab3[_0x8517('0xea')]]&&_0x32cab3['linkedid']!==_0x32cab3['uniqueid']){if(_0x32cab3[_0x8517('0x143')]==='16'&&this['actions'][_0x32cab3[_0x8517('0xea')]][_0x8517('0x7a')]){this[_0x8517('0x144')](_0x32cab3,_0x32cab3[_0x8517('0xea')],_0x32cab3[_0x8517('0x143')]);}else if(this[_0x8517('0x16')][_0x32cab3[_0x8517('0xea')]][_0x8517('0x7a')]){logger[_0x8517('0x59')](_0x8517('0x145'),_0x32cab3[_0x8517('0xea')],_0x32cab3[_0x8517('0x143')],_0x8517('0xbb'),_0x408937['name'],_0x8517('0x6f'),_0x408937[_0x8517('0x5e')]);this['callProgressDetectingCustomer'](_0x32cab3,_0x32cab3['linkedid'],_0x32cab3[_0x8517('0x143')]);}}else if(_0x38e4bb&&_['isNil'](_0x38e4bb[_0x8517('0x146')])&&_0x408937['dialQueueProject']&&_0x32cab3[_0x8517('0xea')]===_0x32cab3[_0x8517('0xb2')]&&_[_0x8517('0x6c')](_0x32cab3[_0x8517('0xf3')])&&_0x32cab3['cause']==='16'&&_0x32cab3['channelstate']==='6'&&_[_0x8517('0xf1')](_0x38e4bb['transfer'])){if(_0x38e4bb['unlockAgent']){rpcDb[_0x8517('0x110')](_0x38e4bb[_0x8517('0x13e')]);}if(_0x38e4bb['activeContact']){rpcDb[_0x8517('0x8d')](_0x38e4bb[_0x8517('0x13e')]);}_0x32cab3['reason']='22';this[_0x8517('0x147')](_0x38e4bb,_0x408937,_0x32cab3);}else if(_0x38e4bb&&_0x38e4bb[_0x8517('0x148')]){if(_0x32cab3['cause']==='16'&&this[_0x8517('0x16')][_0x32cab3['linkedid']][_0x8517('0x7a')]){logger[_0x8517('0x59')]('[syncHangup][talking][transfer]',_0x32cab3[_0x8517('0xea')],_0x32cab3[_0x8517('0x143')],_0x8517('0xbb'),_0x408937[_0x8517('0x28')],_0x8517('0x6f'),_0x408937[_0x8517('0x5e')]);this[_0x8517('0x144')](_0x32cab3,_0x32cab3[_0x8517('0xea')],_0x32cab3[_0x8517('0x143')]);}else if(this['actions'][_0x32cab3[_0x8517('0xea')]][_0x8517('0x7a')]){logger[_0x8517('0x59')](_0x8517('0x145'),_0x32cab3[_0x8517('0xea')],_0x32cab3['cause'],'\x20Queue',_0x408937['name'],_0x8517('0x6f'),_0x408937[_0x8517('0x5e')]);this[_0x8517('0x144')](_0x32cab3,_0x32cab3[_0x8517('0xea')],_0x32cab3[_0x8517('0x143')]);}}};Preview[_0x8517('0xe')][_0x8517('0x20')]=function(_0x4500ce){if(this[_0x8517('0x16')][_0x4500ce['destlinkedid']]&&_0x4500ce[_0x8517('0xf0')]!==_0x4500ce[_0x8517('0x149')]){this[_0x8517('0x144')](_0x4500ce,_0x4500ce[_0x8517('0xf0')],_0x4500ce[_0x8517('0xe6')]);}};Preview['prototype'][_0x8517('0x1e')]=function(_0xb7e380){if(this[_0x8517('0x16')][_0xb7e380['linkedid']]&&_0xb7e380[_0x8517('0xea')]!==_0xb7e380[_0x8517('0xb2')]&&!this[_0x8517('0x16')][_0xb7e380['linkedid']][_0x8517('0x7a')]){if(_0xb7e380[_0x8517('0x143')]==='1'){this[_0x8517('0x144')](_0xb7e380,_0xb7e380['linkedid'],_0xb7e380['cause']);}}};Preview[_0x8517('0xe')][_0x8517('0x14a')]=function(_0x5d5e06,_0x3a67d8,_0x176601){if(this[_0x8517('0x16')][_0x5d5e06]){if(_[_0x8517('0x6c')](this[_0x8517('0x16')][_0x5d5e06]['variables'])){this[_0x8517('0x16')][_0x5d5e06][_0x8517('0x14b')]={};}this[_0x8517('0x16')][_0x5d5e06]['variables'][_0x3a67d8]=_0x176601;}};Preview[_0x8517('0xe')]['syncVarSet']=function(_0x350c39){try{if(!_[_0x8517('0x6c')](_0x350c39)){if(ut[_0x8517('0x14c')](_[_0x8517('0x14d')](_0x350c39['variable'])[0x0])){this[_0x8517('0x14a')](_0x350c39[_0x8517('0xb2')],_[_0x8517('0x14d')](_0x350c39['variable'])[0x0],_0x350c39[_0x8517('0x14e')]);}}}catch(_0x335e4b){logger[_0x8517('0x14f')](_0x8517('0x150'),util[_0x8517('0x151')](_0x335e4b,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0x8517('0x25')]=function(_0x5d4692){if(_0x5d4692){if(this['actions'][_0x5d4692[_0x8517('0x152')]]){this['actions'][_0x5d4692[_0x8517('0x152')]][_0x8517('0x148')]=!![];}}};Preview[_0x8517('0xe')][_0x8517('0x26')]=function(_0x469726){if(_0x469726){if(this[_0x8517('0x16')][_0x469726[_0x8517('0x153')]]){this['actions'][_0x469726['transfererlinkedid']][_0x8517('0x148')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 363f555..1686f73 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 _0x141e=['[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','connectedlinename','membername','context','from-sip','xcally-motion-preview','holdtime','assigned','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','createHistory','[createHistory]\x20','then','catch','resolve','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList'];(function(_0x4667f3,_0x383c8e){var _0x807c05=function(_0x1f8739){while(--_0x1f8739){_0x4667f3['push'](_0x4667f3['shift']());}};_0x807c05(++_0x383c8e);}(_0x141e,0x1e4));var _0xe141=function(_0x16315e,_0xbfd4e2){_0x16315e=_0x16315e-0x0;var _0x1fbb03=_0x141e[_0x16315e];return _0x1fbb03;};'use strict';var util=require(_0xe141('0x0'));var BPromise=require(_0xe141('0x1'));var logger=require(_0xe141('0x2'))(_0xe141('0x3'));var _=require(_0xe141('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xe141('0x5'));var cmHopperHistory=require(_0xe141('0x6'));var cmHopperBlack=require(_0xe141('0x7'));var voiceQueueRt=require(_0xe141('0x8'));var agentReportPreview=require(_0xe141('0x9'));var voiceQueueReport=require(_0xe141('0xa'));function loggerCatch(_0x521722){return function(_0x5e44aa){logger[_0xe141('0xb')](_0x521722,util['inspect'](_0x5e44aa,{'showHidden':![],'depth':null}));};}function create(_0x8b1d42){return BPromise['resolve']()['then'](cmHopperHistory[_0xe141('0xc')](_0x8b1d42))['catch'](loggerCatch(_0xe141('0xd')));}function createAgent(_0x33cd00){return BPromise['resolve']()[_0xe141('0xe')](agentReportPreview[_0xe141('0xc')](_0x33cd00))[_0xe141('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x562ecb){return BPromise[_0xe141('0x10')]()[_0xe141('0xe')](cmHopper[_0xe141('0x11')](_0x562ecb,!![]))[_0xe141('0xf')](loggerCatch(_0xe141('0x12')));}exports[_0xe141('0x13')]=function(_0xb11f39){return BPromise['resolve']()[_0xe141('0xe')](cmHopperBlack[_0xe141('0x13')](_0xb11f39))[_0xe141('0xf')](loggerCatch(_0xe141('0x14')));};exports[_0xe141('0x15')]=function(_0x2e4f20){return BPromise[_0xe141('0x10')]()[_0xe141('0xe')](cmHopper['getContactPreview'](_0x2e4f20))[_0xe141('0xf')](loggerCatch(_0xe141('0x16')));};exports[_0xe141('0xc')]=function(_0x3f045f,_0x12c5d7){create(_0x3f045f)[_0xe141('0xf')](loggerCatch(_0x12c5d7));moveContact(_0x3f045f)[_0xe141('0xf')](loggerCatch(_0x12c5d7));};exports[_0xe141('0x17')]=function(_0x406f50,_0x5e8236){createAgent(_0x406f50)[_0xe141('0xf')](loggerCatch(_0x5e8236));};exports[_0xe141('0x18')]=function(_0x80e92f,_0x4b0ac1){create(_0x80e92f)[_0xe141('0xf')](loggerCatch(_0x4b0ac1));};exports[_0xe141('0x19')]=function(_0x278ef9,_0x265a54){moveContact(_0x278ef9)[_0xe141('0xf')](loggerCatch(_0x265a54));};exports[_0xe141('0x1a')]=function(_0x4eac7d,_0x3a3725,_0x397879){if(_0x3a3725){_0x4eac7d[_0xe141('0x1b')]=null;}if(_0x397879){_0x4eac7d[_0xe141('0x1c')]=![];}return BPromise[_0xe141('0x10')]()['then'](cmHopper[_0xe141('0x1a')](_0x4eac7d))[_0xe141('0xf')](loggerCatch(_0xe141('0x1d')));};exports[_0xe141('0x1e')]=function(_0x5043b6){return BPromise[_0xe141('0x10')]()['then'](cmHopper[_0xe141('0x1e')](_0x5043b6))[_0xe141('0xf')](loggerCatch(_0xe141('0x1f')));};exports[_0xe141('0x20')]=function(_0xe2b290){return BPromise[_0xe141('0x10')]()[_0xe141('0xe')](cmHopper[_0xe141('0x20')]({'UserId':null},_0xe2b290,0x1))[_0xe141('0xf')](loggerCatch(_0xe141('0x21')));};exports['disableContact']=function(_0x5f11ce){return BPromise['resolve']()[_0xe141('0xe')](cmHopper[_0xe141('0x20')]({'active':![]},_0x5f11ce,0x1))[_0xe141('0xf')](loggerCatch(_0xe141('0x22')));};exports[_0xe141('0x23')]=function(_0x522566){var _0x35e8b3={};_0x35e8b3[_0xe141('0x24')]=_0x522566['type'];_0x35e8b3['uniqueid']=_0x522566[_0xe141('0x25')];_0x35e8b3[_0xe141('0x26')]=_0x522566['calleridnum'];_0x35e8b3['calleridname']=_0x522566[_0xe141('0x27')];_0x35e8b3[_0xe141('0x28')]=_0x522566[_0xe141('0x28')];_0x35e8b3['queuecallerjoinAt']=_0x522566['answertime'];_0x35e8b3[_0xe141('0x29')]=_0x522566['answertime'];_0x35e8b3[_0xe141('0x2a')]=0x1;_0x35e8b3[_0xe141('0x2b')]=_0x522566['endtime'];_0x35e8b3[_0xe141('0x2c')]=_0x522566[_0xe141('0x2d')];_0x35e8b3[_0xe141('0x2e')]=_0xe141('0x2f');_0x35e8b3['exten']=_0xe141('0x30');_0x35e8b3[_0xe141('0x31')]=0x0;_0x35e8b3[_0xe141('0x32')]=0x1;_0x35e8b3['lastAssignedTo']=_0x522566[_0xe141('0x2d')];_0x35e8b3['queuecallerexitreason']='COMPLETED';return BPromise[_0xe141('0x10')]()['then'](voiceQueueReport[_0xe141('0x33')](_0x35e8b3))[_0xe141('0xf')](loggerCatch(_0xe141('0x34')));};exports[_0xe141('0x35')]=function(_0x51d2e7,_0x271867){return BPromise[_0xe141('0x10')]()[_0xe141('0xe')](cmHopper[_0xe141('0x35')](_0x51d2e7,_0x271867))['catch'](loggerCatch(_0xe141('0x36')));};exports[_0xe141('0x37')]=function(_0x40afc8){return BPromise[_0xe141('0x10')]()[_0xe141('0xe')](cmHopper[_0xe141('0x1a')](_0x40afc8,!![],!![]))[_0xe141('0xf')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xe10a=['exten','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash','../rpc/cmHopper','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','catch','[createHistory]\x20','createHistory','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','context'];(function(_0x631a3c,_0x1b61b6){var _0x2bdfa3=function(_0x21711b){while(--_0x21711b){_0x631a3c['push'](_0x631a3c['shift']());}};_0x2bdfa3(++_0x1b61b6);}(_0xe10a,0xa6));var _0xae10=function(_0x368ee3,_0x13af49){_0x368ee3=_0x368ee3-0x0;var _0x1260cf=_0xe10a[_0x368ee3];return _0x1260cf;};'use strict';var util=require(_0xae10('0x0'));var BPromise=require(_0xae10('0x1'));var logger=require(_0xae10('0x2'))(_0xae10('0x3'));var _=require(_0xae10('0x4'));var cmHopper=require(_0xae10('0x5'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xae10('0x6'));var agentReportPreview=require(_0xae10('0x7'));var voiceQueueReport=require(_0xae10('0x8'));function loggerCatch(_0x236cec){return function(_0x32e3dd){logger[_0xae10('0x9')](_0x236cec,util['inspect'](_0x32e3dd,{'showHidden':![],'depth':null}));};}function create(_0x323331){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopperHistory['createHistory'](_0x323331))[_0xae10('0xc')](loggerCatch(_0xae10('0xd')));}function createAgent(_0x222f47){return BPromise[_0xae10('0xa')]()['then'](agentReportPreview[_0xae10('0xe')](_0x222f47))[_0xae10('0xc')](loggerCatch(_0xae10('0xd')));}function moveContact(_0x1aa030){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper['moveContactManagedDialer'](_0x1aa030,!![]))[_0xae10('0xc')](loggerCatch(_0xae10('0xf')));}exports['checkIsBlackList']=function(_0x2dd8c6){return BPromise[_0xae10('0xa')]()['then'](cmHopperBlack[_0xae10('0x10')](_0x2dd8c6))[_0xae10('0xc')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xae10('0x11')]=function(_0x2730e7){return BPromise['resolve']()['then'](cmHopper[_0xae10('0x11')](_0x2730e7))[_0xae10('0xc')](loggerCatch('[getContactPreview]\x20'));};exports[_0xae10('0xe')]=function(_0xf9e9b5,_0x2398b4){create(_0xf9e9b5)[_0xae10('0xc')](loggerCatch(_0x2398b4));moveContact(_0xf9e9b5)[_0xae10('0xc')](loggerCatch(_0x2398b4));};exports['createAgentHistory']=function(_0x1a586f,_0x259a59){createAgent(_0x1a586f)[_0xae10('0xc')](loggerCatch(_0x259a59));};exports[_0xae10('0x12')]=function(_0x407921,_0x48e0a9){create(_0x407921)['catch'](loggerCatch(_0x48e0a9));};exports['createCustomerFinal']=function(_0x2e5751,_0x8064ef){moveContact(_0x2e5751)[_0xae10('0xc')](loggerCatch(_0x8064ef));};exports[_0xae10('0x13')]=function(_0x4a3601,_0x2666b5,_0x1e6537){if(_0x2666b5){_0x4a3601[_0xae10('0x14')]=null;}if(_0x1e6537){_0x4a3601[_0xae10('0x15')]=![];}return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper[_0xae10('0x13')](_0x4a3601))[_0xae10('0xc')](loggerCatch(_0xae10('0x16')));};exports['countReScheduled']=function(_0x4c8610){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper['countReScheduled'](_0x4c8610))[_0xae10('0xc')](loggerCatch(_0xae10('0x17')));};exports[_0xae10('0x18')]=function(_0x1a1f3a){return BPromise['resolve']()['then'](cmHopper[_0xae10('0x18')]({'UserId':null},_0x1a1f3a,0x1))[_0xae10('0xc')](loggerCatch(_0xae10('0x19')));};exports[_0xae10('0x1a')]=function(_0x4e2127){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper[_0xae10('0x18')]({'active':![]},_0x4e2127,0x1))[_0xae10('0xc')](loggerCatch(_0xae10('0x1b')));};exports[_0xae10('0x1c')]=function(_0x19d427){var _0x775dd0={};_0x775dd0['type']=_0x19d427[_0xae10('0x1d')];_0x775dd0[_0xae10('0x1e')]=_0x19d427['uniqueid'];_0x775dd0[_0xae10('0x1f')]=_0x19d427[_0xae10('0x1f')];_0x775dd0[_0xae10('0x20')]=_0x19d427[_0xae10('0x20')];_0x775dd0[_0xae10('0x21')]=_0x19d427[_0xae10('0x21')];_0x775dd0[_0xae10('0x22')]=_0x19d427[_0xae10('0x23')];_0x775dd0[_0xae10('0x24')]=_0x19d427['answertime'];_0x775dd0['queuecallercomplete']=0x1;_0x775dd0[_0xae10('0x25')]=_0x19d427[_0xae10('0x26')];_0x775dd0[_0xae10('0x27')]=_0x19d427[_0xae10('0x28')];_0x775dd0[_0xae10('0x29')]='from-sip';_0x775dd0[_0xae10('0x2a')]='xcally-motion-preview';_0x775dd0['holdtime']=0x0;_0x775dd0[_0xae10('0x2b')]=0x1;_0x775dd0[_0xae10('0x2c')]=_0x19d427[_0xae10('0x28')];_0x775dd0[_0xae10('0x2d')]=_0xae10('0x2e');return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](voiceQueueReport['create'](_0x775dd0))[_0xae10('0xc')](loggerCatch(_0xae10('0x2f')));};exports[_0xae10('0x30')]=function(_0x4fc662,_0x2d51fe){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper['getContactRecallMe'](_0x4fc662,_0x2d51fe))[_0xae10('0xc')](loggerCatch(_0xae10('0x31')));};exports[_0xae10('0x32')]=function(_0x30120a){return BPromise[_0xae10('0xa')]()[_0xae10('0xb')](cmHopper[_0xae10('0x13')](_0x30120a,!![],!![]))['catch'](loggerCatch(_0xae10('0x33')));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index 970c5c5..c35b7b8 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 _0xe24a=['filterKey','idContact','type','campaigntype','countglobal','callbackuniqueid','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialoptions','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridName','match','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','inspect','info','loggerError','error','message','getCallerId','isUndefined','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','addVariables','format','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','state','endtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countagentrejectretry','cloneAction','Global','scheduledAt','active','scheduledat','minutes','ListId','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','voice','mandatoryDisposition','agentReadyId','not_inuse','status','reachable','push','seconds','createBody','CampaignId'];(function(_0x485201,_0x3c533a){var _0x9ca98a=function(_0x418ef0){while(--_0x418ef0){_0x485201['push'](_0x485201['shift']());}};_0x9ca98a(++_0x3c533a);}(_0xe24a,0x1c7));var _0xae24=function(_0x38e06e,_0x243644){_0x38e06e=_0x38e06e-0x0;var _0x259eb8=_0xe24a[_0x38e06e];return _0x259eb8;};'use strict';var util=require(_0xae24('0x0'));var _=require(_0xae24('0x1'));var moment=require(_0xae24('0x2'));var logger=require(_0xae24('0x3'))(_0xae24('0x4'));var ipAgi=process[_0xae24('0x5')][_0xae24('0x6')]||'127.0.0.1';function getSeconds(_0x526700,_0x18ea68){var _0x1e3062=moment(_0x526700)[_0xae24('0x7')](0x0);var _0x4afe59=moment(_0x18ea68)['milliseconds'](0x0);return _0x1e3062[_0xae24('0x8')](_0x4afe59,'seconds');}exports['loggerCatch']=function(_0x38d517){return function(_0x5ec4f2){logger['error'](_0x38d517,util[_0xae24('0x9')](_0x5ec4f2,{'showHidden':![],'depth':null}));};};exports['logger']=function(_0x3b29f0,_0x5de3f1){logger[_0xae24('0xa')](_0x3b29f0,util[_0xae24('0x9')](_0x5de3f1,{'showHidden':![],'depth':null}));};exports[_0xae24('0xb')]=function(_0x5131f1,_0x32aca9){logger[_0xae24('0xc')](_0x5131f1,util[_0xae24('0x9')](_0x32aca9,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x3523c8){return function(_0x59dc3d){logger[_0xae24('0xa')](_0x3523c8,util[_0xae24('0x9')](_0x59dc3d,{'showHidden':![],'depth':null}));};};exports[_0xae24('0xd')]=function(_0x1521d7,_0x1df1bd,_0x54b35a){return{'message':_0x1521d7,'unlock':_0x1df1bd,'active':_0x54b35a};};exports[_0xae24('0xe')]=function(_0x523185,_0x4b6bfe,_0x392a80){if(!_[_0xae24('0xf')](_0x392a80)&&_0xae24('0x10')===typeof _0x392a80&&!_[_0xae24('0x11')](_0x392a80)){if(!_[_0xae24('0xf')](_0x4b6bfe)&&_0xae24('0x10')===typeof _0x4b6bfe&&!_[_0xae24('0x11')](_0x4b6bfe)){return util['format'](_0xae24('0x12'),_0x4b6bfe,_0x392a80);}return util['format'](_0xae24('0x12'),_0x392a80,_0x392a80);}if(!_[_0xae24('0xf')](_0x523185)&&_0xae24('0x10')===typeof _0x523185&&!_[_0xae24('0x11')](_0x523185)){return _0x523185;}return _0xae24('0x13');};exports[_0xae24('0x14')]=function(_0x219120){if(_['isNil'](_0x219120)){return![];}return _0x219120;};exports[_0xae24('0x15')]=function(_0x3523d6,_0x657a8d,_0x38c041,_0x31bbe7,_0x591e79,_0x1667bb){var _0x5abb7e={'XMD-QUEUE':_0x657a8d['Queue']?_0x657a8d['Queue']['name']:'','XMD-CALLERID':_0x31bbe7,'XMD-CALLERID-PREVIEW':_0x1667bb?util[_0xae24('0x16')](_0xae24('0x12'),_0x1667bb[_0xae24('0x17')],_0x1667bb[_0xae24('0x18')]):_0x31bbe7,'XMD-DIALID':_0x591e79,'XMD-CONTACTID':_0x657a8d[_0xae24('0x19')],'XMD-CDRTYPE':_0xae24('0x1a'),'CALLERID(all)':_0x31bbe7,'XMD-VOICEQUEUEID':_0x657a8d[_0xae24('0x1b')],'XMD-DIALCHANNEL':_0x38c041,'XMD-DIALTIMEOUT':_0x3523d6[_0xae24('0x1c')]||0x1e,'XMD-DIALOPTIONS':util[_0xae24('0x16')](_0xae24('0x1d'),_0x3523d6['dialQueueProject2']?'g':'',_[_0xae24('0x11')](_0x3523d6[_0xae24('0x1e')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x3523d6[_0xae24('0x1f')]||'','XMD-AGI':_0x3523d6[_0xae24('0x20')]?util[_0xae24('0x16')](_0xae24('0x21'),ipAgi,_0x3523d6[_0xae24('0x20')]):_0xae24('0x22'),'XMD-AGIAFTER':_0x3523d6['dialQueueProject2']?util[_0xae24('0x16')](_0xae24('0x21'),ipAgi,_0x3523d6['dialQueueProject2']):_0xae24('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x1667bb?_0x1667bb[_0xae24('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x1667bb?_0x1667bb[_0xae24('0x24')]:'','XMD-DESTINATION':_0xae24('0x25'),'SIPADDHEADER':'Call-Type:\x20PREVIEW'};if(!_[_0xae24('0x11')](_0x3523d6['monitor_format'])){_0x5abb7e[util[_0xae24('0x16')]('%s',_0xae24('0x26'))]=_0x3523d6[_0xae24('0x1e')];_0x5abb7e[util[_0xae24('0x16')]('%s',_0xae24('0x27'))]=_0x591e79;}if(_0x657a8d&&_0x657a8d[_0xae24('0x28')]){for(var _0x45eb49 in _0x657a8d['Contact']){if(_0x657a8d[_0xae24('0x28')][_0xae24('0x29')](_0x45eb49)){if(!_[_0xae24('0x2a')](_0x657a8d[_0xae24('0x28')][_0x45eb49])&&_0x45eb49!=='id'&&_0x45eb49!==_0xae24('0x2b')&&_0x45eb49!==_0xae24('0x2c')&&_0x45eb49!=='updatedAt'){_0x5abb7e[util['format'](_0xae24('0x2d'),_0xae24('0x2e'),_[_0xae24('0x2f')](_0x45eb49))]=_0x657a8d[_0xae24('0x28')][_0x45eb49];}}}}return _0x5abb7e;};exports[_0xae24('0x30')]=function(_0x13ca68){var _0x431d7b={};for(var _0x3a6d4e in _0x13ca68){if(_0x13ca68['hasOwnProperty'](_0x3a6d4e)){_0x431d7b[util[_0xae24('0x16')]('%s',_[_0xae24('0x31')](_0x3a6d4e))]=_0x13ca68[_0x3a6d4e];}}return{'variables':_0x431d7b};};exports['updateOriginated']=function(_0x47e205,_0x2ffe8f){if(!_[_0xae24('0x2a')](_0x47e205)){if(_0x47e205[_0xae24('0x29')]('originated')){if(_0x47e205['originated']>0x0){_0x47e205[_0xae24('0x32')]-=0x1;}else{logger[_0xae24('0xc')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x2ffe8f);}}}else{logger[_0xae24('0xc')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x2ffe8f);}};exports[_0xae24('0x33')]=function(_0x400e9c){var _0x54d0de=moment()['format'](_0xae24('0x34'));_0x400e9c['state']=0xd;_0x400e9c[_0xae24('0x35')]=_0xae24('0x36');_0x400e9c[_0xae24('0x37')]=_0x54d0de;_0x400e9c[_0xae24('0x38')]=_0x54d0de;_0x400e9c['endtime']=_0x54d0de;};exports[_0xae24('0x39')]=function(_0x3a4180,_0x37a74a,_0x14eb94){var _0x2d90f1=moment()[_0xae24('0x16')](_0xae24('0x34'));_0x3a4180['state']=_0x37a74a;_0x3a4180[_0xae24('0x35')]=_0x14eb94;_0x3a4180['responsetime']=_0x2d90f1;_0x3a4180[_0xae24('0x3a')]=getSeconds(_0x3a4180[_0xae24('0x38')],_0x3a4180['starttime']);};exports[_0xae24('0x3b')]=function(_0x292c8e,_0x18dad6,_0x44ff32){_0x292c8e[_0xae24('0x3c')]=_0x18dad6;_0x292c8e[_0xae24('0x3d')]=_0x44ff32;};exports[_0xae24('0x3e')]=function(_0x37ff3d,_0x21ce43,_0x336bb7){var _0x3cd740=moment()[_0xae24('0x16')](_0xae24('0x34'));_0x37ff3d[_0xae24('0x3f')]=_0x21ce43;_0x37ff3d[_0xae24('0x35')]=_0x336bb7;_0x37ff3d['responsetime']=_0x37ff3d[_0xae24('0x38')]?_0x37ff3d[_0xae24('0x38')]:_0x3cd740;_0x37ff3d[_0xae24('0x40')]=_0x37ff3d['endtime']?_0x37ff3d[_0xae24('0x40')]:_0x3cd740;_0x37ff3d[_0xae24('0x3a')]=getSeconds(_0x37ff3d[_0xae24('0x38')]||0x0,_0x37ff3d[_0xae24('0x37')]||0x0);_0x37ff3d[_0xae24('0x41')]=_0x37ff3d[_0xae24('0x42')]?getSeconds(_0x37ff3d[_0xae24('0x40')],_0x37ff3d[_0xae24('0x42')]):0x0;};exports[_0xae24('0x43')]=function(_0x928d86){return _0x928d86===_0xae24('0x44');};exports[_0xae24('0x45')]=function(_0x2bba25,_0x41138f,_0x3753c7,_0x44055b,_0x57ff8e){var _0x2225b8=_0x44055b?_0xae24('0x46'):_0x2bba25[_0xae24('0x17')];_0x2225b8=_0x57ff8e?_0xae24('0x47'):_0x2225b8;return{'actionid':_0x2bba25[_0xae24('0x48')],'action':'originate','channel':_0x2bba25[_0xae24('0x49')],'callerid':util[_0xae24('0x16')](_0xae24('0x12'),_0x2225b8,_0x2bba25['calleridnum']),'Exten':_0xae24('0x25'),'Context':_0xae24('0x4a'),'Priority':'1','variable':_0x3753c7,'timeout':(_0x41138f[_0xae24('0x4b')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2bba25[_0xae24('0x48')]};};exports[_0xae24('0x4c')]=function(_0x543b81){return _0x543b81[_0xae24('0x4d')]+_0x543b81[_0xae24('0x4e')]+_0x543b81['countnoanswerretry']+_0x543b81[_0xae24('0x4f')]+_0x543b81['countnosuchnumberretry'];};exports[_0xae24('0x50')]=function(_0x40bd95){var _0x3e8dc0=_['clone'](_0x40bd95);_0x3e8dc0[_0xae24('0x3f')]=0xf;_0x3e8dc0[_0xae24('0x35')]=_0xae24('0x51');return _0x3e8dc0;};exports[_0xae24('0x52')]=function(_0x2d0f54,_0x3c724b,_0x77b2a3){var _0x2206cb={};_0x2206cb[_0x3c724b]=_0x2d0f54[_0x3c724b];_0x2206cb[_0xae24('0x53')]=![];_0x2206cb[_0xae24('0x54')]=moment()['add'](_0x77b2a3,_0xae24('0x55'))[_0xae24('0x16')](_0xae24('0x34'));_0x2206cb[_0xae24('0x19')]=_0x2d0f54['ContactId'];_0x2206cb[_0xae24('0x56')]=_0x2d0f54[_0xae24('0x56')];_0x2206cb[_0xae24('0x1b')]=_0x2d0f54['VoiceQueueId']||undefined;return _0x2206cb;};exports['decrementTalkink']=function(_0x56bff6,_0x551fa3){if(!_['isNil'](_0x56bff6)){if(_0x56bff6[_0xae24('0x57')]>0x0){_0x56bff6['pTalking']-=0x1;}else{logger[_0xae24('0xc')](_0x551fa3,_0xae24('0x58'));}}else{logger[_0xae24('0xc')](_0x551fa3,_0xae24('0x59'));}};exports[_0xae24('0x5a')]=function(_0x22e841){if(_0x22e841<=0x0){return!![];}return![];};exports[_0xae24('0x5b')]=function(_0x54e0a2,_0x4f494b,_0x34be0a){_0x54e0a2[_0xae24('0x5c')]=_0x4f494b;_0x54e0a2['name']=_0x54e0a2[_0xae24('0x5d')];_0x54e0a2[_0xae24('0x5e')]=_0x54e0a2[_0xae24('0x49')];_0x54e0a2['motionChannel']=_0xae24('0x5f');if(_0x34be0a){_0x54e0a2[_0xae24('0x60')]=_0x34be0a[_0xae24('0x60')];}return _0x54e0a2;};exports['buildAcw']=function(_0x5f57b3){var _0x2e9663={};_0x2e9663[_0xae24('0x5d')]=_0x5f57b3[_0xae24('0x5d')];_0x2e9663[_0xae24('0x5e')]=_0x5f57b3['channelAgent'];_0x2e9663[_0xae24('0x48')]=_0x5f57b3['uniqueid'];return _0x2e9663;};exports[_0xae24('0x61')]=function(_0x5bd363){var _0x2d1aa9=[];for(var _0x49202f in _0x5bd363){if(_0x5bd363[_0xae24('0x29')](_0x49202f)){if(!_[_0xae24('0x2a')](_0x5bd363[_0x49202f])&&_0x5bd363[_0x49202f][_0xae24('0x3f')]===_0xae24('0x62')&&_0x5bd363[_0x49202f][_0xae24('0x63')]===_0xae24('0x64')){_0x2d1aa9[_0xae24('0x65')](_0x5bd363[_0x49202f]['id']);}}}return _0x2d1aa9;};exports['getDiff']=function(_0x5dc0d1){var _0x3a970d=moment()[_0xae24('0x7')](0x0);var _0x3bcc4c=moment(_0x5dc0d1)[_0xae24('0x7')](0x0);return _0x3a970d['diff'](_0x3bcc4c,_0xae24('0x66'));};exports[_0xae24('0x67')]=function(_0x19a9c3){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x19a9c3[_0xae24('0x19')],'ListId':_0x19a9c3[_0xae24('0x56')],'VoiceQueueId':_0x19a9c3['VoiceQueueId']||undefined,'CampaignId':_0x19a9c3[_0xae24('0x68')]||undefined};};exports[_0xae24('0x69')]=function(_0x4822d1){if(_0x4822d1===_0xae24('0x48')||_0x4822d1===_0xae24('0x6a')||_0x4822d1==='queue'||_0x4822d1===_0xae24('0x6b')||_0x4822d1===_0xae24('0x6c')||_0x4822d1==='dialAnswer'||_0x4822d1===_0xae24('0x3c')||_0x4822d1===_0xae24('0x49')||_0x4822d1==='calleridname'||_0x4822d1===_0xae24('0x53')||_0x4822d1==='calleridnum'||_0x4822d1===_0xae24('0x54')||_0x4822d1===_0xae24('0x4d')||_0x4822d1===_0xae24('0x4e')||_0x4822d1==='countnoanswerretry'||_0x4822d1===_0xae24('0x6d')||_0x4822d1==='callback'||_0x4822d1===_0xae24('0x6e')||_0x4822d1===_0xae24('0x6f')||_0x4822d1==='recallme'||_0x4822d1===_0xae24('0x19')||_0x4822d1==='ListId'||_0x4822d1==='UserId'||_0x4822d1===_0xae24('0x1b')||_0x4822d1===_0xae24('0x70')||_0x4822d1===_0xae24('0x71')||_0x4822d1===_0xae24('0x72')||_0x4822d1===_0xae24('0x73')||_0x4822d1===_0xae24('0x74')||_0x4822d1==='xmd-dialurl'||_0x4822d1===_0xae24('0x75')||_0x4822d1===_0xae24('0x76')||_0x4822d1==='xmd-dialid'||_0x4822d1===_0xae24('0x77')||_0x4822d1===_0xae24('0x78')||_0x4822d1===_0xae24('0x79')||_0x4822d1===_0xae24('0x7a')||_0x4822d1===_0xae24('0x7b')||_0x4822d1==='xmd-agi'||_0x4822d1===_0xae24('0x7c')||_0x4822d1===_0xae24('0x7d')||_0x4822d1===_0xae24('0x7e')||_0x4822d1===_0xae24('0x7f')||_0x4822d1===_0xae24('0x80')||_0x4822d1===_0xae24('0x81')||_0x4822d1===_0xae24('0x82')||_0x4822d1==='rtpaudioqosrttbridged'||_0x4822d1===_0xae24('0x7c')||_0x4822d1===_0xae24('0x7d')||_0x4822d1===_0xae24('0x7e')||_0x4822d1===_0xae24('0x7f')||_0x4822d1===_0xae24('0x80')||_0x4822d1===_0xae24('0x81')||_0x4822d1===_0xae24('0x82')||_0x4822d1===_0xae24('0x83')||_0x4822d1===_0xae24('0x84')||_0x4822d1===_0xae24('0x85')||_0x4822d1===_0xae24('0x3f')||_0x4822d1===_0xae24('0x35')){return![];}return!![];};exports[_0xae24('0x86')]=function(_0x2c1b79,_0x196005){var _0x1f0d4b,_0x1327ef,_0x22b860;if(_0x196005<=0x0){_0x196005=0x1;}_0x1f0d4b=new RegExp(_0xae24('0x87')+_0x196005+'}$');_0x1327ef=Math[_0xae24('0x88')](0xa,_0x196005-0x1);_0x22b860=Math[_0xae24('0x88')](0xa,_0x196005)-0x1;return util['format']('%s',_['replace'](_0x2c1b79,_0x1f0d4b,_[_0xae24('0x89')](_0x1327ef,_0x22b860)));};exports[_0xae24('0x8a')]=function(_0x46a7e1){var _0x221ce0=_0x46a7e1[_0xae24('0x8b')](/"(.*?)"/);return _0x221ce0?_0x221ce0[0x1]:_0x46a7e1;};exports['extractCalleridNumber']=function(_0x1312c2){var _0x12f869=_0x1312c2[_0xae24('0x8b')](/<(.*?)>/);return _0x12f869?_0x12f869[0x1]:_0x1312c2;}; \ No newline at end of file +var _0xd296=['xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosbridged','rtpaudioqosjitter','bridgepeer','\x5cw{0,','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','milliseconds','diff','loggerCatch','error','inspect','logger','info','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','dialQueueProject2','monitor_format','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridname','xcally-motion-preview','Call-Type:\x20PREVIEW','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','createdAt','%s%s','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','logLookAgent','UserId','logCustomer','ringtime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','totalGlobal','countbusyretry','countcongestionretry','countnosuchnumberretry','cloneAction','scheduledAt','active','scheduledat','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','motionChannel','voice','mandatoryDisposition','not_inuse','status','push','seconds','createBody','filterKey','idContact','type','campaigntype','dialAnswer','membername','countglobal','callback','callbackuniqueid','recallme','sipcallid','xmd-queue','xmd-phone','xmd-listid'];(function(_0x5b6081,_0x2799d9){var _0x167c57=function(_0x294ea3){while(--_0x294ea3){_0x5b6081['push'](_0x5b6081['shift']());}};_0x167c57(++_0x2799d9);}(_0xd296,0x1c2));var _0x6d29=function(_0x3bddc9,_0x2a40f0){_0x3bddc9=_0x3bddc9-0x0;var _0x3ac6dc=_0xd296[_0x3bddc9];return _0x3ac6dc;};'use strict';var util=require(_0x6d29('0x0'));var _=require(_0x6d29('0x1'));var moment=require(_0x6d29('0x2'));var logger=require(_0x6d29('0x3'))(_0x6d29('0x4'));var ipAgi=process[_0x6d29('0x5')][_0x6d29('0x6')]||'127.0.0.1';function getSeconds(_0x14a30d,_0x325cef){var _0x30ae67=moment(_0x14a30d)[_0x6d29('0x7')](0x0);var _0x1fb1ef=moment(_0x325cef)[_0x6d29('0x7')](0x0);return _0x30ae67[_0x6d29('0x8')](_0x1fb1ef,'seconds');}exports[_0x6d29('0x9')]=function(_0xd2bb4f){return function(_0x5d5762){logger[_0x6d29('0xa')](_0xd2bb4f,util[_0x6d29('0xb')](_0x5d5762,{'showHidden':![],'depth':null}));};};exports[_0x6d29('0xc')]=function(_0x496e4f,_0x40d3ab){logger[_0x6d29('0xd')](_0x496e4f,util['inspect'](_0x40d3ab,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0x4a8bae,_0x31f28a){logger[_0x6d29('0xa')](_0x4a8bae,util[_0x6d29('0xb')](_0x31f28a,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x2f5d6c){return function(_0x440183){logger[_0x6d29('0xd')](_0x2f5d6c,util['inspect'](_0x440183,{'showHidden':![],'depth':null}));};};exports[_0x6d29('0xe')]=function(_0x1acd3c,_0x583aaf,_0x4a770c){return{'message':_0x1acd3c,'unlock':_0x583aaf,'active':_0x4a770c};};exports['getCallerId']=function(_0x58348f,_0x297df6,_0x3b2b6d){if(!_[_0x6d29('0xf')](_0x3b2b6d)&&_0x6d29('0x10')===typeof _0x3b2b6d&&!_[_0x6d29('0x11')](_0x3b2b6d)){if(!_[_0x6d29('0xf')](_0x297df6)&&'string'===typeof _0x297df6&&!_[_0x6d29('0x11')](_0x297df6)){return util[_0x6d29('0x12')](_0x6d29('0x13'),_0x297df6,_0x3b2b6d);}return util['format']('\x22%s\x22\x20<%s>',_0x3b2b6d,_0x3b2b6d);}if(!_['isUndefined'](_0x58348f)&&_0x6d29('0x10')===typeof _0x58348f&&!_['isEmpty'](_0x58348f)){return _0x58348f;}return _0x6d29('0x14');};exports[_0x6d29('0x15')]=function(_0xb3ebe8){if(_[_0x6d29('0x16')](_0xb3ebe8)){return![];}return _0xb3ebe8;};exports[_0x6d29('0x17')]=function(_0x41c783,_0x203e87,_0x78c6cb,_0x5c1736,_0x51e8b8,_0x2a0539){var _0xfb916b={'XMD-QUEUE':_0x203e87['Queue']?_0x203e87[_0x6d29('0x18')][_0x6d29('0x19')]:'','XMD-CALLERID':_0x5c1736,'XMD-CALLERID-PREVIEW':_0x2a0539?util[_0x6d29('0x12')](_0x6d29('0x13'),_0x2a0539[_0x6d29('0x1a')],_0x2a0539[_0x6d29('0x1b')]):_0x5c1736,'XMD-DIALID':_0x51e8b8,'XMD-CONTACTID':_0x203e87[_0x6d29('0x1c')],'XMD-CDRTYPE':_0x6d29('0x1d'),'CALLERID(all)':_0x5c1736,'XMD-VOICEQUEUEID':_0x203e87[_0x6d29('0x1e')],'XMD-DIALCHANNEL':_0x78c6cb,'XMD-DIALTIMEOUT':_0x41c783[_0x6d29('0x1f')]||0x1e,'XMD-DIALOPTIONS':util['format']('\x22rtTxX%s%s\x22',_0x41c783[_0x6d29('0x20')]?'g':'',_[_0x6d29('0x11')](_0x41c783[_0x6d29('0x21')])?'':'U(xcally-mixmonitor-context)'),'XMD-DIALURL':_0x41c783[_0x6d29('0x22')]||'','XMD-AGI':_0x41c783[_0x6d29('0x23')]?util[_0x6d29('0x12')](_0x6d29('0x24'),ipAgi,_0x41c783['dialQueueProject']):_0x6d29('0x25'),'XMD-AGIAFTER':_0x41c783[_0x6d29('0x20')]?util[_0x6d29('0x12')](_0x6d29('0x24'),ipAgi,_0x41c783[_0x6d29('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2a0539?_0x2a0539['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2a0539?_0x2a0539[_0x6d29('0x26')]:'','XMD-DESTINATION':_0x6d29('0x27'),'SIPADDHEADER':_0x6d29('0x28')};if(!_['isEmpty'](_0x41c783[_0x6d29('0x21')])){_0xfb916b[util['format']('%s',_0x6d29('0x29'))]=_0x41c783[_0x6d29('0x21')];_0xfb916b[util[_0x6d29('0x12')]('%s',_0x6d29('0x2a'))]=_0x51e8b8;}if(_0x203e87&&_0x203e87[_0x6d29('0x2b')]){for(var _0x31d898 in _0x203e87[_0x6d29('0x2b')]){if(_0x203e87[_0x6d29('0x2b')][_0x6d29('0x2c')](_0x31d898)){if(!_[_0x6d29('0x16')](_0x203e87[_0x6d29('0x2b')][_0x31d898])&&_0x31d898!=='id'&&_0x31d898!==_0x6d29('0x2d')&&_0x31d898!==_0x6d29('0x2e')&&_0x31d898!=='updatedAt'){_0xfb916b[util[_0x6d29('0x12')](_0x6d29('0x2f'),'XMD-',_[_0x6d29('0x30')](_0x31d898))]=_0x203e87[_0x6d29('0x2b')][_0x31d898];}}}}return _0xfb916b;};exports[_0x6d29('0x31')]=function(_0x58f77e){var _0x311b7e={};for(var _0xfa081f in _0x58f77e){if(_0x58f77e['hasOwnProperty'](_0xfa081f)){_0x311b7e[util[_0x6d29('0x12')]('%s',_[_0x6d29('0x32')](_0xfa081f))]=_0x58f77e[_0xfa081f];}}return{'variables':_0x311b7e};};exports[_0x6d29('0x33')]=function(_0x210392,_0x13632f){if(!_['isNil'](_0x210392)){if(_0x210392[_0x6d29('0x2c')](_0x6d29('0x34'))){if(_0x210392[_0x6d29('0x34')]>0x0){_0x210392[_0x6d29('0x34')]-=0x1;}else{logger['error'](_0x6d29('0x35'),_0x13632f);}}}else{logger[_0x6d29('0xa')](_0x6d29('0x36'),_0x13632f);}};exports[_0x6d29('0x37')]=function(_0x258daf){var _0x50f8f5=moment()[_0x6d29('0x12')](_0x6d29('0x38'));_0x258daf[_0x6d29('0x39')]=0xd;_0x258daf[_0x6d29('0x3a')]=_0x6d29('0x3b');_0x258daf[_0x6d29('0x3c')]=_0x50f8f5;_0x258daf[_0x6d29('0x3d')]=_0x50f8f5;_0x258daf[_0x6d29('0x3e')]=_0x50f8f5;};exports[_0x6d29('0x3f')]=function(_0x5de50e,_0x31fbef,_0x4b2563){var _0x2fabb8=moment()[_0x6d29('0x12')](_0x6d29('0x38'));_0x5de50e[_0x6d29('0x39')]=_0x31fbef;_0x5de50e['statedesc']=_0x4b2563;_0x5de50e[_0x6d29('0x3d')]=_0x2fabb8;_0x5de50e['ringtime']=getSeconds(_0x5de50e[_0x6d29('0x3d')],_0x5de50e[_0x6d29('0x3c')]);};exports[_0x6d29('0x40')]=function(_0x4fd3ff,_0x2df52e,_0x262acd){_0x4fd3ff['membername']=_0x2df52e;_0x4fd3ff[_0x6d29('0x41')]=_0x262acd;};exports[_0x6d29('0x42')]=function(_0x3ae488,_0x2cb059,_0x264f71){var _0xf0c18d=moment()[_0x6d29('0x12')](_0x6d29('0x38'));_0x3ae488[_0x6d29('0x39')]=_0x2cb059;_0x3ae488[_0x6d29('0x3a')]=_0x264f71;_0x3ae488[_0x6d29('0x3d')]=_0x3ae488['responsetime']?_0x3ae488[_0x6d29('0x3d')]:_0xf0c18d;_0x3ae488[_0x6d29('0x3e')]=_0x3ae488[_0x6d29('0x3e')]?_0x3ae488['endtime']:_0xf0c18d;_0x3ae488[_0x6d29('0x43')]=getSeconds(_0x3ae488[_0x6d29('0x3d')]||0x0,_0x3ae488['starttime']||0x0);_0x3ae488['talktime']=_0x3ae488[_0x6d29('0x44')]?getSeconds(_0x3ae488[_0x6d29('0x3e')],_0x3ae488['answertime']):0x0;};exports[_0x6d29('0x45')]=function(_0x119df6){return _0x119df6===_0x6d29('0x46');};exports[_0x6d29('0x47')]=function(_0x36e177,_0x4e6844,_0x28cea7,_0x42c0c9,_0x1ece1b){var _0x4b2032=_0x42c0c9?_0x6d29('0x48'):_0x36e177[_0x6d29('0x1a')];_0x4b2032=_0x1ece1b?_0x6d29('0x49'):_0x4b2032;return{'actionid':_0x36e177[_0x6d29('0x4a')],'action':_0x6d29('0x4b'),'channel':_0x36e177[_0x6d29('0x4c')],'callerid':util[_0x6d29('0x12')]('\x22%s\x22\x20<%s>',_0x4b2032,_0x36e177[_0x6d29('0x1b')]),'Exten':_0x6d29('0x27'),'Context':_0x6d29('0x4d'),'Priority':'1','variable':_0x28cea7,'timeout':(_0x4e6844['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x36e177[_0x6d29('0x4a')]};};exports[_0x6d29('0x4e')]=function(_0x412e2e){return _0x412e2e[_0x6d29('0x4f')]+_0x412e2e[_0x6d29('0x50')]+_0x412e2e['countnoanswerretry']+_0x412e2e['countagentrejectretry']+_0x412e2e[_0x6d29('0x51')];};exports[_0x6d29('0x52')]=function(_0x519dce){var _0x46b8f5=_['clone'](_0x519dce);_0x46b8f5[_0x6d29('0x39')]=0xf;_0x46b8f5['statedesc']='Global';return _0x46b8f5;};exports[_0x6d29('0x53')]=function(_0x1cec2b,_0x3ead57,_0x5516fa){var _0x4e22ef={};_0x4e22ef[_0x3ead57]=_0x1cec2b[_0x3ead57];_0x4e22ef[_0x6d29('0x54')]=![];_0x4e22ef[_0x6d29('0x55')]=moment()['add'](_0x5516fa,'minutes')[_0x6d29('0x12')](_0x6d29('0x38'));_0x4e22ef[_0x6d29('0x1c')]=_0x1cec2b['ContactId'];_0x4e22ef[_0x6d29('0x56')]=_0x1cec2b[_0x6d29('0x56')];_0x4e22ef['VoiceQueueId']=_0x1cec2b[_0x6d29('0x1e')]||undefined;return _0x4e22ef;};exports[_0x6d29('0x57')]=function(_0x33e4df,_0x30152a){if(!_[_0x6d29('0x16')](_0x33e4df)){if(_0x33e4df[_0x6d29('0x58')]>0x0){_0x33e4df[_0x6d29('0x58')]-=0x1;}else{logger[_0x6d29('0xa')](_0x30152a,_0x6d29('0x59'));}}else{logger[_0x6d29('0xa')](_0x30152a,_0x6d29('0x5a'));}};exports[_0x6d29('0x5b')]=function(_0x4e7d17){if(_0x4e7d17<=0x0){return!![];}return![];};exports[_0x6d29('0x5c')]=function(_0xc3e0d8,_0x5e0238,_0x471587){_0xc3e0d8[_0x6d29('0x5d')]=_0x5e0238;_0xc3e0d8[_0x6d29('0x19')]=_0xc3e0d8[_0x6d29('0x5e')];_0xc3e0d8[_0x6d29('0x5f')]=_0xc3e0d8['channelAgent'];_0xc3e0d8[_0x6d29('0x60')]=_0x6d29('0x61');if(_0x471587){_0xc3e0d8['mandatoryDisposition']=_0x471587[_0x6d29('0x62')];}return _0xc3e0d8;};exports['buildAcw']=function(_0x3fed15){var _0x10b759={};_0x10b759['queue']=_0x3fed15['queue'];_0x10b759[_0x6d29('0x5f')]=_0x3fed15[_0x6d29('0x4c')];_0x10b759['uniqueid']=_0x3fed15[_0x6d29('0x4a')];return _0x10b759;};exports['agentReadyId']=function(_0x536f43){var _0x4c95f6=[];for(var _0x291322 in _0x536f43){if(_0x536f43[_0x6d29('0x2c')](_0x291322)){if(!_['isNil'](_0x536f43[_0x291322])&&_0x536f43[_0x291322]['state']===_0x6d29('0x63')&&_0x536f43[_0x291322][_0x6d29('0x64')]==='reachable'){_0x4c95f6[_0x6d29('0x65')](_0x536f43[_0x291322]['id']);}}}return _0x4c95f6;};exports['getDiff']=function(_0x1a325f){var _0x4e4614=moment()['milliseconds'](0x0);var _0x963966=moment(_0x1a325f)['milliseconds'](0x0);return _0x4e4614['diff'](_0x963966,_0x6d29('0x66'));};exports[_0x6d29('0x67')]=function(_0x5df1a0){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5df1a0[_0x6d29('0x1c')],'ListId':_0x5df1a0[_0x6d29('0x56')],'VoiceQueueId':_0x5df1a0[_0x6d29('0x1e')]||undefined,'CampaignId':_0x5df1a0['CampaignId']||undefined};};exports[_0x6d29('0x68')]=function(_0x51e7f9){if(_0x51e7f9==='uniqueid'||_0x51e7f9===_0x6d29('0x69')||_0x51e7f9===_0x6d29('0x5e')||_0x51e7f9===_0x6d29('0x6a')||_0x51e7f9===_0x6d29('0x6b')||_0x51e7f9===_0x6d29('0x6c')||_0x51e7f9===_0x6d29('0x6d')||_0x51e7f9==='channelAgent'||_0x51e7f9===_0x6d29('0x1a')||_0x51e7f9===_0x6d29('0x54')||_0x51e7f9==='calleridnum'||_0x51e7f9===_0x6d29('0x55')||_0x51e7f9==='countbusyretry'||_0x51e7f9===_0x6d29('0x50')||_0x51e7f9==='countnoanswerretry'||_0x51e7f9===_0x6d29('0x6e')||_0x51e7f9===_0x6d29('0x6f')||_0x51e7f9===_0x6d29('0x70')||_0x51e7f9==='callbackat'||_0x51e7f9===_0x6d29('0x71')||_0x51e7f9===_0x6d29('0x1c')||_0x51e7f9===_0x6d29('0x56')||_0x51e7f9==='UserId'||_0x51e7f9===_0x6d29('0x1e')||_0x51e7f9===_0x6d29('0x72')||_0x51e7f9==='xmd-voicequeueid'||_0x51e7f9===_0x6d29('0x73')||_0x51e7f9===_0x6d29('0x74')||_0x51e7f9===_0x6d29('0x75')||_0x51e7f9===_0x6d29('0x76')||_0x51e7f9===_0x6d29('0x77')||_0x51e7f9===_0x6d29('0x78')||_0x51e7f9===_0x6d29('0x79')||_0x51e7f9===_0x6d29('0x7a')||_0x51e7f9===_0x6d29('0x7b')||_0x51e7f9===_0x6d29('0x7c')||_0x51e7f9===_0x6d29('0x7d')||_0x51e7f9===_0x6d29('0x7e')||_0x51e7f9===_0x6d29('0x7f')||_0x51e7f9===_0x6d29('0x80')||_0x51e7f9==='rtpaudioqosbridged'||_0x51e7f9==='rtpaudioqosjitter'||_0x51e7f9===_0x6d29('0x81')||_0x51e7f9===_0x6d29('0x82')||_0x51e7f9===_0x6d29('0x83')||_0x51e7f9===_0x6d29('0x84')||_0x51e7f9==='rtpaudioqosrttbridged'||_0x51e7f9===_0x6d29('0x80')||_0x51e7f9===_0x6d29('0x85')||_0x51e7f9===_0x6d29('0x86')||_0x51e7f9===_0x6d29('0x81')||_0x51e7f9===_0x6d29('0x82')||_0x51e7f9===_0x6d29('0x83')||_0x51e7f9===_0x6d29('0x84')||_0x51e7f9==='rtpaudioqosrttbridged'||_0x51e7f9===_0x6d29('0x87')||_0x51e7f9==='bridgepvtcallid'||_0x51e7f9===_0x6d29('0x39')||_0x51e7f9==='statedesc'){return![];}return!![];};exports['getCallerIdRandom']=function(_0x525f15,_0x15c371){var _0x36ba15,_0x5e9690,_0x5b4113;if(_0x15c371<=0x0){_0x15c371=0x1;}_0x36ba15=new RegExp(_0x6d29('0x88')+_0x15c371+'}$');_0x5e9690=Math['pow'](0xa,_0x15c371-0x1);_0x5b4113=Math[_0x6d29('0x89')](0xa,_0x15c371)-0x1;return util[_0x6d29('0x12')]('%s',_['replace'](_0x525f15,_0x36ba15,_[_0x6d29('0x8a')](_0x5e9690,_0x5b4113)));};exports[_0x6d29('0x8b')]=function(_0xbe125){var _0x4da3c3=_0xbe125[_0x6d29('0x8c')](/"(.*?)"/);return _0x4da3c3?_0x4da3c3[0x1]:_0xbe125;};exports[_0x6d29('0x8d')]=function(_0x9b4774){var _0x44a3b6=_0x9b4774['match'](/<(.*?)>/);return _0x44a3b6?_0x44a3b6[0x1]:_0x9b4774;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 0d5b5d6..c7fc5d3 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 _0x7365=['queuepause','reload','voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','number','boolean'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x7365,0x9c));var _0x5736=function(_0x4e4519,_0x392ae){_0x4e4519=_0x4e4519-0x0;var _0x340044=_0x7365[_0x4e4519];return _0x340044;};'use strict';exports[_0x5736('0x0')]={'queue':{'type':_0x5736('0x1'),'required':!![]},'interface':{'type':_0x5736('0x1'),'required':!![]},'membername':{'type':_0x5736('0x1'),'required':!![]},'penalty':{'type':_0x5736('0x2'),'required':![]},'paused':{'type':_0x5736('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x5736('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x5736('0x4')]={'interface':{'type':_0x5736('0x1'),'required':!![]},'paused':{'type':_0x5736('0x3')},'reason':{'type':_0x5736('0x1'),'required':![]}};exports[_0x5736('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x5736('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x5736('0x1'),'required':!![]},'filename':{'type':_0x5736('0x1')},'format':{'type':_0x5736('0x1')},'mixmonitorid':{'type':_0x5736('0x1')}};exports[_0x5736('0x6')]={'uniqueid':{'type':_0x5736('0x1'),'required':!![]}};exports[_0x5736('0x7')]={'uniqueid':{'type':_0x5736('0x1'),'required':!![]},'exten':{'type':_0x5736('0x1'),'required':!![]},'context':{'type':_0x5736('0x1')}}; \ No newline at end of file +var _0x3767=['voicequeuechannelhangup','voicequeuechannelredirect','queueadd','string','queueremove','queuepause','boolean','voicequeuechannel'];(function(_0xd578cb,_0x2167a3){var _0x775533=function(_0x1c340d){while(--_0x1c340d){_0xd578cb['push'](_0xd578cb['shift']());}};_0x775533(++_0x2167a3);}(_0x3767,0xda));var _0x7376=function(_0x4d46d5,_0x8dfa9e){_0x4d46d5=_0x4d46d5-0x0;var _0x4995c3=_0x3767[_0x4d46d5];return _0x4995c3;};'use strict';exports[_0x7376('0x0')]={'queue':{'type':_0x7376('0x1'),'required':!![]},'interface':{'type':_0x7376('0x1'),'required':!![]},'membername':{'type':_0x7376('0x1'),'required':!![]},'penalty':{'type':'number','required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x7376('0x2')]={'queue':{'type':_0x7376('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports[_0x7376('0x3')]={'interface':{'type':_0x7376('0x1'),'required':!![]},'paused':{'type':_0x7376('0x4')},'reason':{'type':_0x7376('0x1'),'required':![]}};exports['reload']={'module':{'type':_0x7376('0x1'),'required':![]}};exports[_0x7376('0x5')]={'uniqueid':{'type':_0x7376('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x7376('0x1'),'required':!![]},'filename':{'type':_0x7376('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x7376('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x7376('0x7')]={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0x7376('0x1'),'required':!![]},'context':{'type':_0x7376('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 5f0489a..2332efe 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 _0x22a1=['unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','deskAccounts','initSugarcrmAccounts','initVtigerAccounts','servicenowAccounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','diff','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','initVoiceExtensions','merge','initFaxAccounts','faxAccounts','exports','util','lodash','moment','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','templates','voiceExtensions','channels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','SIP/%s','format','name','interface','total','answered','sumHoldTime','sumDuration','sumBillable','ivrAnswerCallsDay'];(function(_0x3d784f,_0x51b654){var _0x536239=function(_0x5a609a){while(--_0x5a609a){_0x3d784f['push'](_0x3d784f['shift']());}};_0x536239(++_0x51b654);}(_0x22a1,0x112));var _0x122a=function(_0x1f0653,_0x4225ec){_0x1f0653=_0x1f0653-0x0;var _0x503fe9=_0x22a1[_0x1f0653];return _0x503fe9;};'use strict';var BPromise=require('bluebird');var util=require(_0x122a('0x0'));var _=require(_0x122a('0x1'));var moment=require(_0x122a('0x2'));var Agent=require(_0x122a('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x122a('0x4'));var VoiceQueue=require(_0x122a('0x5'));var Trigger=require(_0x122a('0x6'));var Template=require('../model/template');var Campaign=require(_0x122a('0x7'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x122a('0x8'));var SalesforceAccount=require(_0x122a('0x9'));var FreshdeskAccount=require(_0x122a('0xa'));var SugarcrmAccount=require(_0x122a('0xb'));var ZohoAccount=require(_0x122a('0xc'));var DeskAccount=require(_0x122a('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0x122a('0xe'));var Dynamics365Account=require(_0x122a('0xf'));var FreshsalesAccount=require(_0x122a('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0x122a('0x11')]={};this[_0x122a('0x12')]={};this[_0x122a('0x13')]={};this[_0x122a('0x14')]={};this[_0x122a('0x15')]={};this[_0x122a('0x16')]={};this[_0x122a('0x17')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x122a('0x18')]={};this[_0x122a('0x19')]={};this['queueChannels']={};this[_0x122a('0x1a')]={};this[_0x122a('0x1b')]={};this[_0x122a('0x1c')]={};this[_0x122a('0x1d')]={};this[_0x122a('0x1e')]={};this[_0x122a('0x1f')]={};this['freshdeskAccounts']={};this[_0x122a('0x20')]={};this['deskAccounts']={};this[_0x122a('0x21')]={};this['servicenowAccounts']={};this[_0x122a('0x22')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x36e43a,_0x16387d,_0x119b41){var _0x1937dc=_[_0x122a('0x23')](_0x36e43a,function(_0x4d832e,_0x1f6100){return _0x4d832e[_0x119b41];});for(var _0x187176 in _0x16387d){if(_0x16387d[_0x122a('0x24')](_0x187176)){if(!_0x1937dc[_0x187176]){delete _0x16387d[_0x187176];}}}}function freeIsNotKeySip(_0x4869c4,_0x12f84a){var _0x39d149=_['mapKeys'](_0x4869c4,function(_0x455487,_0x11677f){return util['format'](_0x122a('0x25'),_0x455487['name']);});for(var _0x5316df in _0x12f84a){if(_0x12f84a['hasOwnProperty'](_0x5316df)){if(!_0x39d149[_0x5316df]){delete _0x12f84a[_0x5316df];}}}}function freeIsNotKeyAgent(_0x3d3162,_0x2de70c){var _0x404888=_['mapKeys'](_0x3d3162,function(_0x27f0ce,_0x376726){var _0x22a1c5=_['isNil'](_0x27f0ce['interface'])?util[_0x122a('0x26')](_0x122a('0x25'),_0x27f0ce[_0x122a('0x27')]):_0x27f0ce[_0x122a('0x28')];return _0x22a1c5;});for(var _0x3125f0 in _0x2de70c){if(_0x2de70c[_0x122a('0x24')](_0x3125f0)){if(!_0x404888[_0x3125f0]){delete _0x2de70c[_0x3125f0];}}}}function clearVoiceCallReports(_0x5af6ee){_0x5af6ee[_0x122a('0x29')]=0x0;_0x5af6ee[_0x122a('0x2a')]=0x0;_0x5af6ee[_0x122a('0x2b')]=0x0;_0x5af6ee[_0x122a('0x2c')]=0x0;_0x5af6ee[_0x122a('0x2d')]=0x0;}function clearCampaigns(_0x54e021){if(!_['isEmpty'](_0x54e021)){for(var _0x4bf37e in _0x54e021){if(_0x54e021['hasOwnProperty'](_0x4bf37e)){_0x54e021[_0x4bf37e]['ivrTotalCallsDays']=0x0;_0x54e021[_0x4bf37e][_0x122a('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x173c76){if(!_['isEmpty'](_0x173c76)){for(var _0xd2acfa in _0x173c76){if(_0x173c76['hasOwnProperty'](_0xd2acfa)){_0x173c76[_0xd2acfa]['total']=0x0;_0x173c76[_0xd2acfa][_0x122a('0x2a')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x2f')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x30')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x2b')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x2c')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x2d')]=0x0;_0x173c76[_0xd2acfa]['outboundAnswerAgiCallsDay']=0x0;_0x173c76[_0xd2acfa][_0x122a('0x31')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x32')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x33')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x34')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x35')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x36')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x37')]=0x0;_0x173c76[_0xd2acfa]['outboundBlacklistCallsDay']=0x0;_0x173c76[_0xd2acfa][_0x122a('0x38')]=0x0;_0x173c76[_0xd2acfa][_0x122a('0x39')]=0x0;_0x173c76[_0xd2acfa]['outboundReCallsDay']=0x0;_0x173c76[_0xd2acfa][_0x122a('0x3a')]=0x0;_0x173c76[_0xd2acfa]['outboundAnswerCallsDay']=0x0;_0x173c76[_0xd2acfa][_0x122a('0x3b')]=!![];}}}}Realtime[_0x122a('0x3c')][_0x122a('0x3d')]=function(_0x54ecf1,_0xf66074){for(var _0xbf86c6 in _0xf66074){if(_0x54ecf1[_0x122a('0x24')](_0xbf86c6)){_0x54ecf1[_0xbf86c6]=_0xf66074[_0xbf86c6];}}};Realtime['prototype'][_0x122a('0x3e')]=function(){var _0x5394c5=this;return function(_0x3677e1){if(_0x3677e1){freeIsNotKeyAgent(_0x3677e1,_0x5394c5[_0x122a('0x11')]);for(var _0x4c54fa=0x0,_0x1a3bec={},_0x59f6bb={};_0x4c54fa<_0x3677e1[_0x122a('0x3f')];_0x4c54fa+=0x1){_0x1a3bec=_0x3677e1[_0x4c54fa];var _0x4544ab=_[_0x122a('0x40')](_0x1a3bec['interface'])?util['format'](_0x122a('0x25'),_0x1a3bec[_0x122a('0x27')]):_0x1a3bec[_0x122a('0x28')];if(_[_0x122a('0x41')](_0x5394c5[_0x122a('0x11')][_0x4544ab])){_0x5394c5[_0x122a('0x11')][_0x4544ab]=new Agent(_0x1a3bec);}else{_0x5394c5[_0x122a('0x3d')](_0x5394c5[_0x122a('0x11')][_0x4544ab],_0x1a3bec);}}}return _0x5394c5['agents'];};};Realtime[_0x122a('0x3c')][_0x122a('0x42')]=function(){var _0x35d79c=this;return function(_0x208b72){if(_0x208b72){freeIsNotKeySip(_0x208b72,_0x35d79c[_0x122a('0x12')]);for(var _0x214cfb=0x0,_0x429fad={},_0x34df58={};_0x214cfb<_0x208b72[_0x122a('0x3f')];_0x214cfb+=0x1){_0x429fad=_0x208b72[_0x214cfb];if(_['isUndefined'](_0x35d79c[_0x122a('0x12')][util[_0x122a('0x26')]('SIP/%s',_0x429fad[_0x122a('0x27')])])){_0x35d79c['telephones'][util[_0x122a('0x26')](_0x122a('0x25'),_0x429fad[_0x122a('0x27')])]=new Telephone(_0x429fad);}else{_0x35d79c['mergeFromDatabase'](_0x35d79c[_0x122a('0x12')][util[_0x122a('0x26')](_0x122a('0x25'),_0x429fad['name'])],_0x429fad);}}}return _0x35d79c[_0x122a('0x12')];};};Realtime['prototype']['initTrunks']=function(){var _0x5ab615=this;return function(_0x3da239){if(_0x3da239){freeIsNotKeySip(_0x3da239,_0x5ab615[_0x122a('0x13')]);for(var _0x5cb2e4=0x0,_0x541802={},_0x2027f6={};_0x5cb2e4<_0x3da239[_0x122a('0x3f')];_0x5cb2e4+=0x1){_0x541802=_0x3da239[_0x5cb2e4];if(_[_0x122a('0x41')](_0x5ab615[_0x122a('0x13')][util['format']('SIP/%s',_0x541802[_0x122a('0x27')])])){_0x5ab615[_0x122a('0x13')][util[_0x122a('0x26')](_0x122a('0x25'),_0x541802['name'])]=new Trunk(_0x541802);}else{_0x5ab615[_0x122a('0x3d')](_0x5ab615['trunks'][util[_0x122a('0x26')](_0x122a('0x25'),_0x541802[_0x122a('0x27')])],_0x541802);}}}return _0x5ab615[_0x122a('0x13')];};};Realtime[_0x122a('0x3c')]['initVoiceQueues']=function(){var _0x3754bc=this;return function(_0x30e8db){if(_0x30e8db){freeIsNotKey(_0x30e8db,_0x3754bc['voiceQueues'],_0x122a('0x27'));for(var _0x4688d9=0x0,_0x558473={},_0xb04c06={};_0x4688d9<_0x30e8db[_0x122a('0x3f')];_0x4688d9+=0x1){_0x558473=_0x30e8db[_0x4688d9];if(_[_0x122a('0x41')](_0x3754bc[_0x122a('0x14')][_0x558473[_0x122a('0x27')]])){_0x3754bc['voiceQueues'][_0x558473[_0x122a('0x27')]]=new VoiceQueue(_0x558473);}else{_0x3754bc[_0x122a('0x3d')](_0x3754bc['voiceQueues'][_0x558473[_0x122a('0x27')]],_0x558473);}}}return _0x3754bc['voiceQueues'];};};Realtime[_0x122a('0x3c')][_0x122a('0x43')]=function(){var _0x2680fb=this;return function(_0x4c7db6){if(_0x4c7db6){freeIsNotKey(_0x4c7db6,_0x2680fb['triggers'],'id');for(var _0x45d124=0x0,_0x2e1b88={},_0x2108a4={};_0x45d124<_0x4c7db6[_0x122a('0x3f')];_0x45d124+=0x1){_0x2e1b88=_0x4c7db6[_0x45d124];if(_[_0x122a('0x41')](_0x2680fb[_0x122a('0x15')][_0x2e1b88['id']])){_0x2680fb[_0x122a('0x15')][_0x2e1b88['id']]=new Trigger(_0x2e1b88);}else{_0x2680fb[_0x122a('0x3d')](_0x2680fb[_0x122a('0x15')][_0x2e1b88['id']],_0x2e1b88);}}}return _0x2680fb[_0x122a('0x15')];};};Realtime[_0x122a('0x3c')][_0x122a('0x44')]=function(){var _0x2811a9=this;return function(_0x3c06cb){if(_0x3c06cb){freeIsNotKey(_0x3c06cb,_0x2811a9[_0x122a('0x17')],'id');for(var _0x5cf075=0x0,_0x2ddbd7={},_0x5410db={};_0x5cf075<_0x3c06cb[_0x122a('0x3f')];_0x5cf075+=0x1){_0x2ddbd7=_0x3c06cb[_0x5cf075];if(_[_0x122a('0x41')](_0x2811a9[_0x122a('0x17')][_0x2ddbd7['id']])){_0x2811a9['templates'][_0x2ddbd7['id']]=new Template(_0x2ddbd7);}else{_0x2811a9['mergeFromDatabase'](_0x2811a9[_0x122a('0x17')][_0x2ddbd7['id']],_0x2ddbd7);}}}return _0x2811a9['templates'];};};Realtime[_0x122a('0x3c')][_0x122a('0x45')]=function(){var _0x1bc99a=this;return function(_0x15ca34){if(_0x15ca34){freeIsNotKey(_0x15ca34,_0x1bc99a['zendeskAccounts'],'id');for(var _0x61772e=0x0,_0x1ec4f5={},_0x124887={};_0x61772e<_0x15ca34['length'];_0x61772e+=0x1){_0x1ec4f5=_0x15ca34[_0x61772e];if(_[_0x122a('0x41')](_0x1bc99a['zendeskAccounts'][_0x1ec4f5['id']])){_0x1bc99a[_0x122a('0x1d')][_0x1ec4f5['id']]=new ZendeskAccount(_0x1ec4f5);}else{_0x1bc99a[_0x122a('0x3d')](_0x1bc99a[_0x122a('0x1d')][_0x1ec4f5['id']],_0x1ec4f5);}}}return _0x1bc99a['zendeskAccounts'];};};Realtime[_0x122a('0x3c')][_0x122a('0x46')]=function(){var _0x1243d0=this;return function(_0x445985){if(_0x445985){freeIsNotKey(_0x445985,_0x1243d0['salesforceAccounts'],'id');for(var _0x508259=0x0,_0xb33552={},_0x39ddbf={};_0x508259<_0x445985[_0x122a('0x3f')];_0x508259+=0x1){_0xb33552=_0x445985[_0x508259];if(_[_0x122a('0x41')](_0x1243d0[_0x122a('0x1e')][_0xb33552['id']])){_0x1243d0['salesforceAccounts'][_0xb33552['id']]=new SalesforceAccount(_0xb33552);}else{_0x1243d0[_0x122a('0x3d')](_0x1243d0[_0x122a('0x1e')][_0xb33552['id']],_0xb33552);}}}return _0x1243d0[_0x122a('0x1e')];};};Realtime[_0x122a('0x3c')]['initFreshdeskAccounts']=function(){var _0x1e7879=this;return function(_0x46b482){if(_0x46b482){freeIsNotKey(_0x46b482,_0x1e7879[_0x122a('0x47')],'id');for(var _0x34ea1b=0x0,_0x4eb518={},_0x295492={};_0x34ea1b<_0x46b482[_0x122a('0x3f')];_0x34ea1b+=0x1){_0x4eb518=_0x46b482[_0x34ea1b];if(_[_0x122a('0x41')](_0x1e7879[_0x122a('0x47')][_0x4eb518['id']])){_0x1e7879[_0x122a('0x47')][_0x4eb518['id']]=new FreshdeskAccount(_0x4eb518);}else{_0x1e7879[_0x122a('0x3d')](_0x1e7879[_0x122a('0x47')][_0x4eb518['id']],_0x4eb518);}}}return _0x1e7879[_0x122a('0x47')];};};Realtime[_0x122a('0x3c')]['initZohoAccounts']=function(){var _0x2d1d9a=this;return function(_0x8116ff){if(_0x8116ff){freeIsNotKey(_0x8116ff,_0x2d1d9a[_0x122a('0x20')],'id');for(var _0x1bb4a2=0x0,_0x20171b={},_0x9b29d0={};_0x1bb4a2<_0x8116ff[_0x122a('0x3f')];_0x1bb4a2+=0x1){_0x20171b=_0x8116ff[_0x1bb4a2];if(_[_0x122a('0x41')](_0x2d1d9a[_0x122a('0x20')][_0x20171b['id']])){_0x2d1d9a[_0x122a('0x20')][_0x20171b['id']]=new ZohoAccount(_0x20171b);}else{_0x2d1d9a[_0x122a('0x3d')](_0x2d1d9a[_0x122a('0x20')][_0x20171b['id']],_0x20171b);}}}return _0x2d1d9a[_0x122a('0x20')];};};Realtime[_0x122a('0x3c')]['initDeskAccounts']=function(){var _0x537bd9=this;return function(_0x3421d8){if(_0x3421d8){freeIsNotKey(_0x3421d8,_0x537bd9[_0x122a('0x48')],'id');for(var _0x331e37=0x0,_0x384cde={},_0xd2dd32={};_0x331e37<_0x3421d8['length'];_0x331e37+=0x1){_0x384cde=_0x3421d8[_0x331e37];if(_['isUndefined'](_0x537bd9[_0x122a('0x48')][_0x384cde['id']])){_0x537bd9[_0x122a('0x48')][_0x384cde['id']]=new DeskAccount(_0x384cde);}else{_0x537bd9[_0x122a('0x3d')](_0x537bd9[_0x122a('0x48')][_0x384cde['id']],_0x384cde);}}}return _0x537bd9[_0x122a('0x48')];};};Realtime[_0x122a('0x3c')][_0x122a('0x49')]=function(){var _0x2fecc6=this;return function(_0x3c5d19){if(_0x3c5d19){freeIsNotKey(_0x3c5d19,_0x2fecc6[_0x122a('0x1f')],'id');for(var _0xdb13e1=0x0,_0x564547={},_0x3151d6={};_0xdb13e1<_0x3c5d19['length'];_0xdb13e1+=0x1){_0x564547=_0x3c5d19[_0xdb13e1];if(_[_0x122a('0x41')](_0x2fecc6[_0x122a('0x1f')][_0x564547['id']])){_0x2fecc6[_0x122a('0x1f')][_0x564547['id']]=new SugarcrmAccount(_0x564547);}else{_0x2fecc6[_0x122a('0x3d')](_0x2fecc6['sugarcrmAccounts'][_0x564547['id']],_0x564547);}}}return _0x2fecc6[_0x122a('0x1f')];};};Realtime[_0x122a('0x3c')][_0x122a('0x4a')]=function(){var _0x5e620e=this;return function(_0x48695b){if(_0x48695b){freeIsNotKey(_0x48695b,_0x5e620e[_0x122a('0x21')],'id');for(var _0x3b85b7=0x0,_0x31a95d={},_0x19f284={};_0x3b85b7<_0x48695b['length'];_0x3b85b7+=0x1){_0x31a95d=_0x48695b[_0x3b85b7];if(_['isUndefined'](_0x5e620e['vtigerAccounts'][_0x31a95d['id']])){_0x5e620e[_0x122a('0x21')][_0x31a95d['id']]=new VtigerAccount(_0x31a95d);}else{_0x5e620e[_0x122a('0x3d')](_0x5e620e[_0x122a('0x21')][_0x31a95d['id']],_0x31a95d);}}}return _0x5e620e[_0x122a('0x21')];};};Realtime[_0x122a('0x3c')]['initServicenowAccounts']=function(){var _0xe78fa4=this;return function(_0x65d904){if(_0x65d904){freeIsNotKey(_0x65d904,_0xe78fa4[_0x122a('0x4b')],'id');for(var _0x454657=0x0,_0x2f34ed={},_0x4595d9={};_0x454657<_0x65d904[_0x122a('0x3f')];_0x454657+=0x1){_0x2f34ed=_0x65d904[_0x454657];if(_[_0x122a('0x41')](_0xe78fa4[_0x122a('0x4b')][_0x2f34ed['id']])){_0xe78fa4[_0x122a('0x4b')][_0x2f34ed['id']]=new ServicenowAccount(_0x2f34ed);}else{_0xe78fa4[_0x122a('0x3d')](_0xe78fa4[_0x122a('0x4b')][_0x2f34ed['id']],_0x2f34ed);}}}return _0xe78fa4[_0x122a('0x4b')];};};Realtime[_0x122a('0x3c')]['initDynamics365Accounts']=function(){var _0x523f14=this;return function(_0x4bd4f4){if(_0x4bd4f4){freeIsNotKey(_0x4bd4f4,_0x523f14[_0x122a('0x22')],'id');for(var _0x2a473b=0x0,_0x32ba7c={},_0x2c6c78={};_0x2a473b<_0x4bd4f4[_0x122a('0x3f')];_0x2a473b+=0x1){_0x32ba7c=_0x4bd4f4[_0x2a473b];if(_[_0x122a('0x41')](_0x523f14[_0x122a('0x22')][_0x32ba7c['id']])){_0x523f14[_0x122a('0x22')][_0x32ba7c['id']]=new Dynamics365Account(_0x32ba7c);}else{_0x523f14[_0x122a('0x3d')](_0x523f14[_0x122a('0x22')][_0x32ba7c['id']],_0x32ba7c);}}}return _0x523f14['dynamics365Accounts'];};};Realtime[_0x122a('0x3c')][_0x122a('0x4c')]=function(){var _0x1775ed=this;return function(_0x18060a){if(_0x18060a){freeIsNotKey(_0x18060a,_0x1775ed['freshsalesAccounts'],'id');for(var _0x5808e8=0x0,_0x5c3986={},_0x43dc81={};_0x5808e8<_0x18060a['length'];_0x5808e8+=0x1){_0x5c3986=_0x18060a[_0x5808e8];if(_[_0x122a('0x41')](_0x1775ed[_0x122a('0x4d')][_0x5c3986['id']])){_0x1775ed[_0x122a('0x4d')][_0x5c3986['id']]=new FreshsalesAccount(_0x5c3986);}else{_0x1775ed[_0x122a('0x3d')](_0x1775ed['freshsalesAccounts'][_0x5c3986['id']],_0x5c3986);}}}return _0x1775ed['freshsalesAccounts'];};};Realtime['prototype'][_0x122a('0x4e')]=function(){var _0x284d4b=this;return function(_0x548102){for(var _0x3ed528=0x0;_0x3ed528<_0x548102[_0x122a('0x3f')];_0x3ed528+=0x1){_['merge'](_0x284d4b['voiceQueues'][_0x548102[_0x3ed528]['name']],_0x548102[_0x3ed528]);}return _0x284d4b[_0x122a('0x14')];};};Realtime[_0x122a('0x3c')][_0x122a('0x4f')]=function(){var _0x501e22=this;return function(_0x269290){clearVoiceQueues(_0x501e22['voiceQueues']);if(_0x269290){_0x269290=_[_0x122a('0x50')](_0x269290,_0x122a('0x51'));for(var _0x2e09ec in _0x269290){if(_0x269290[_0x122a('0x24')](_0x2e09ec)){var _0x47a4a3={};for(var _0x4f42a4=0x0;_0x4f42a4<_0x269290[_0x2e09ec][_0x122a('0x3f')];_0x4f42a4+=0x1){var _0x38259e=_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x52')];if(_0x501e22[_0x122a('0x14')][_0x38259e]){if(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x53')]){_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x2f')]+=0x1;}if(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x54')]){_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x30')]+=0x1;}_0x501e22[_0x122a('0x14')][_0x38259e]['sumHoldTime']+=moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x55')])['diff'](moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x56')]),_0x122a('0x57'))||0x0;if(_0x4f42a4===_0x269290[_0x2e09ec][_0x122a('0x3f')]-0x1){_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x2c')]+=moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x58')]||_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x59')]||_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x5a')])[_0x122a('0x5b')](moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x56')]),'seconds')||0x0;_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x29')]+=0x1;if(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x5c')]){_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x2a')]+=0x1;_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x2d')]+=moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x58')])['diff'](moment(_0x269290[_0x2e09ec][_0x4f42a4][_0x122a('0x55')]),_0x122a('0x57'))||0x0;}}else{_0x501e22[_0x122a('0x14')][_0x38259e][_0x122a('0x2c')]+=_0x501e22[_0x122a('0x14')][_0x38259e]['sumHoldTime']||0x0;}}}}}}return _0x501e22[_0x122a('0x14')];};};Realtime[_0x122a('0x3c')][_0x122a('0x5d')]=function(){var _0xdf3a90=this;return function(_0x4e491a){clearVoiceCallReports(_0xdf3a90[_0x122a('0x5e')]);if(_0x4e491a){for(var _0x102713=0x0;_0x102713<_0x4e491a['length'];_0x102713+=0x1){_0xdf3a90['outbound'][_0x122a('0x29')]+=0x1;_0xdf3a90[_0x122a('0x5e')][_0x122a('0x2c')]+=_0x4e491a[_0x102713][_0x122a('0x5f')];if(_0x4e491a[_0x102713][_0x122a('0x60')]===_0x122a('0x61')){_0xdf3a90[_0x122a('0x5e')][_0x122a('0x2a')]+=0x1;_0xdf3a90[_0x122a('0x5e')]['sumHoldTime']+=_0x4e491a[_0x102713][_0x122a('0x5f')]-_0x4e491a[_0x102713][_0x122a('0x62')]||0x0;_0xdf3a90[_0x122a('0x5e')][_0x122a('0x2d')]+=_0x4e491a[_0x102713][_0x122a('0x62')];}}}return _0xdf3a90[_0x122a('0x5e')];};};Realtime[_0x122a('0x3c')][_0x122a('0x63')]=function(){var _0x3002ed=this;return function(_0xbbbf7e){if(_0xbbbf7e){freeIsNotKey(_0xbbbf7e,_0x3002ed[_0x122a('0x16')],_0x122a('0x27'));for(var _0x36db37=0x0,_0x5c4583={};_0x36db37<_0xbbbf7e['length'];_0x36db37+=0x1){_0x5c4583=_0xbbbf7e[_0x36db37];if(_[_0x122a('0x41')](_0x3002ed[_0x122a('0x16')][_0x5c4583[_0x122a('0x27')]])){_0x3002ed['campaigns'][_0x5c4583['name']]=new Campaign(_0x5c4583);}else{_0x3002ed[_0x122a('0x3d')](_0x3002ed['campaigns'][_0x5c4583['name']],_0x5c4583);_0x3002ed[_0x122a('0x16')][_0x5c4583[_0x122a('0x27')]][_0x122a('0x64')]=_0x5c4583['SquareProject']?_0x5c4583[_0x122a('0x65')]['name']:undefined;}}}return _0x3002ed[_0x122a('0x16')];};};Realtime[_0x122a('0x3c')][_0x122a('0x66')]=function(){var _0x2213c3=this;return function(_0x478992){if(_0x478992){freeIsNotKey(_0x478992,_0x2213c3['voiceExtensions'],'id');for(var _0x30ff88=0x0,_0x10c690={};_0x30ff88<_0x478992[_0x122a('0x3f')];_0x30ff88+=0x1){_0x10c690=_0x478992[_0x30ff88];if(_['isUndefined'](_0x2213c3[_0x122a('0x18')][_0x10c690['id']])){_0x2213c3[_0x122a('0x18')][_0x10c690['id']]=new VoiceExtension(_0x10c690);}else{_0x2213c3[_0x122a('0x3d')](_0x2213c3[_0x122a('0x18')][_0x10c690['id']],_0x10c690);}}}return _0x2213c3[_0x122a('0x18')];};};Realtime['prototype']['initCampaignHopperHistory']=function(){var _0xf54f04=this;return function(_0x3508a8){clearCampaigns(_0xf54f04[_0x122a('0x16')]);for(var _0x343d98=0x0;_0x343d98<_0x3508a8[_0x122a('0x3f')];_0x343d98+=0x1){_[_0x122a('0x67')](_0xf54f04['campaigns'][_0x3508a8[_0x343d98][_0x122a('0x27')]],_0x3508a8[_0x343d98]);}return _0xf54f04[_0x122a('0x16')];};};Realtime[_0x122a('0x3c')][_0x122a('0x68')]=function(){var _0x40501a=this;return function(_0x52a609){if(_0x52a609){freeIsNotKey(_0x52a609,_0x40501a[_0x122a('0x69')],'id');for(var _0x26b21b=0x0,_0x479047={},_0x3c6bad={};_0x26b21b<_0x52a609[_0x122a('0x3f')];_0x26b21b+=0x1){_0x479047=_0x52a609[_0x26b21b];if(_[_0x122a('0x41')](_0x40501a[_0x122a('0x69')][_0x479047['id']])){_0x40501a[_0x122a('0x69')][_0x479047['id']]=new FaxAccount(_0x479047);}else{_0x40501a['mergeFromDatabase'](_0x40501a[_0x122a('0x69')][_0x479047['id']],_0x479047);}}}return _0x40501a['faxAccounts'];};};module[_0x122a('0x6a')]=Realtime; \ No newline at end of file +var _0x9e69=['telephones','initTrunks','trunks','initVoiceQueues','initTemplates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','merge','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerexitAt','seconds','queuecallercomplete','initVoiceCallReports','outbound','duration','disposition','ANSWERED','billableseconds','initCampaigns','dialQueueProject','SquareProject','voiceExtensions','initFaxAccounts','exports','bluebird','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/freshsalesAccount','../model/faxAccount','agents','voiceQueues','triggers','campaigns','templates','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','total','answered','sumHoldTime','sumDuration','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x9e69,0x15a));var _0x99e6=function(_0x469b92,_0x5a8688){_0x469b92=_0x469b92-0x0;var _0x296e36=_0x9e69[_0x469b92];return _0x296e36;};'use strict';var BPromise=require(_0x99e6('0x0'));var util=require('util');var _=require('lodash');var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0x99e6('0x1'));var Trunk=require(_0x99e6('0x2'));var VoiceQueue=require(_0x99e6('0x3'));var Trigger=require(_0x99e6('0x4'));var Template=require(_0x99e6('0x5'));var Campaign=require(_0x99e6('0x6'));var VoiceExtension=require(_0x99e6('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x99e6('0x8'));var FreshdeskAccount=require(_0x99e6('0x9'));var SugarcrmAccount=require(_0x99e6('0xa'));var ZohoAccount=require(_0x99e6('0xb'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0x99e6('0xc'));var ServicenowAccount=require(_0x99e6('0xd'));var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x99e6('0xe'));var FaxAccount=require(_0x99e6('0xf'));var Realtime=function(){this[_0x99e6('0x10')]={};this['telephones']={};this['trunks']={};this[_0x99e6('0x11')]={};this[_0x99e6('0x12')]={};this[_0x99e6('0x13')]={};this[_0x99e6('0x14')]={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x99e6('0x15')]={};this[_0x99e6('0x16')]={};this[_0x99e6('0x17')]={};this[_0x99e6('0x18')]={};this[_0x99e6('0x19')]={};this[_0x99e6('0x1a')]={};this[_0x99e6('0x1b')]={};this['sugarcrmAccounts']={};this[_0x99e6('0x1c')]={};this[_0x99e6('0x1d')]={};this[_0x99e6('0x1e')]={};this[_0x99e6('0x1f')]={};this[_0x99e6('0x20')]={};this[_0x99e6('0x21')]={};this[_0x99e6('0x22')]={};this[_0x99e6('0x23')]={};};function freeIsNotKey(_0x107d25,_0x6fc804,_0x7e673f){var _0xf4297d=_[_0x99e6('0x24')](_0x107d25,function(_0x4574b5,_0x44b390){return _0x4574b5[_0x7e673f];});for(var _0x325f61 in _0x6fc804){if(_0x6fc804[_0x99e6('0x25')](_0x325f61)){if(!_0xf4297d[_0x325f61]){delete _0x6fc804[_0x325f61];}}}}function freeIsNotKeySip(_0x6cf77d,_0x32ae91){var _0x2c0651=_[_0x99e6('0x24')](_0x6cf77d,function(_0x5b77e8,_0x3e8e43){return util[_0x99e6('0x26')](_0x99e6('0x27'),_0x5b77e8[_0x99e6('0x28')]);});for(var _0x59c18d in _0x32ae91){if(_0x32ae91[_0x99e6('0x25')](_0x59c18d)){if(!_0x2c0651[_0x59c18d]){delete _0x32ae91[_0x59c18d];}}}}function freeIsNotKeyAgent(_0x4664bf,_0x46502e){var _0x33acfe=_[_0x99e6('0x24')](_0x4664bf,function(_0x3ad608,_0x4aa046){var _0x3f9ab6=_[_0x99e6('0x29')](_0x3ad608['interface'])?util[_0x99e6('0x26')](_0x99e6('0x27'),_0x3ad608[_0x99e6('0x28')]):_0x3ad608[_0x99e6('0x2a')];return _0x3f9ab6;});for(var _0x46dd74 in _0x46502e){if(_0x46502e[_0x99e6('0x25')](_0x46dd74)){if(!_0x33acfe[_0x46dd74]){delete _0x46502e[_0x46dd74];}}}}function clearVoiceCallReports(_0x54ca42){_0x54ca42[_0x99e6('0x2b')]=0x0;_0x54ca42[_0x99e6('0x2c')]=0x0;_0x54ca42[_0x99e6('0x2d')]=0x0;_0x54ca42[_0x99e6('0x2e')]=0x0;_0x54ca42[_0x99e6('0x2f')]=0x0;}function clearCampaigns(_0x507e6f){if(!_[_0x99e6('0x30')](_0x507e6f)){for(var _0x5a1949 in _0x507e6f){if(_0x507e6f[_0x99e6('0x25')](_0x5a1949)){_0x507e6f[_0x5a1949][_0x99e6('0x31')]=0x0;_0x507e6f[_0x5a1949][_0x99e6('0x32')]=0x0;}}}}function clearVoiceQueues(_0x44754d){if(!_[_0x99e6('0x30')](_0x44754d)){for(var _0x3bf337 in _0x44754d){if(_0x44754d[_0x99e6('0x25')](_0x3bf337)){_0x44754d[_0x3bf337][_0x99e6('0x2b')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x2c')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x33')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x34')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x2d')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x2e')]=0x0;_0x44754d[_0x3bf337]['sumBillable']=0x0;_0x44754d[_0x3bf337]['outboundAnswerAgiCallsDay']=0x0;_0x44754d[_0x3bf337][_0x99e6('0x35')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x36')]=0x0;_0x44754d[_0x3bf337]['outboundCongestionCallsDay']=0x0;_0x44754d[_0x3bf337][_0x99e6('0x37')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x38')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x39')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3a')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3b')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3c')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3d')]=0x0;_0x44754d[_0x3bf337]['outboundReCallsDay']=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3e')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x3f')]=0x0;_0x44754d[_0x3bf337][_0x99e6('0x40')]=!![];}}}}Realtime[_0x99e6('0x41')][_0x99e6('0x42')]=function(_0x36abae,_0x292ed5){for(var _0xd0b1c8 in _0x292ed5){if(_0x36abae['hasOwnProperty'](_0xd0b1c8)){_0x36abae[_0xd0b1c8]=_0x292ed5[_0xd0b1c8];}}};Realtime[_0x99e6('0x41')][_0x99e6('0x43')]=function(){var _0x3822b0=this;return function(_0x4040d4){if(_0x4040d4){freeIsNotKeyAgent(_0x4040d4,_0x3822b0[_0x99e6('0x10')]);for(var _0x457dff=0x0,_0x54b882={},_0x4a4dc0={};_0x457dff<_0x4040d4[_0x99e6('0x44')];_0x457dff+=0x1){_0x54b882=_0x4040d4[_0x457dff];var _0x5c7a5d=_['isNil'](_0x54b882['interface'])?util['format'](_0x99e6('0x27'),_0x54b882[_0x99e6('0x28')]):_0x54b882[_0x99e6('0x2a')];if(_[_0x99e6('0x45')](_0x3822b0['agents'][_0x5c7a5d])){_0x3822b0[_0x99e6('0x10')][_0x5c7a5d]=new Agent(_0x54b882);}else{_0x3822b0[_0x99e6('0x42')](_0x3822b0[_0x99e6('0x10')][_0x5c7a5d],_0x54b882);}}}return _0x3822b0[_0x99e6('0x10')];};};Realtime[_0x99e6('0x41')]['initTelephones']=function(){var _0x2f3465=this;return function(_0x2fe260){if(_0x2fe260){freeIsNotKeySip(_0x2fe260,_0x2f3465[_0x99e6('0x46')]);for(var _0x5a9da4=0x0,_0x22a8cd={},_0x489c9d={};_0x5a9da4<_0x2fe260[_0x99e6('0x44')];_0x5a9da4+=0x1){_0x22a8cd=_0x2fe260[_0x5a9da4];if(_[_0x99e6('0x45')](_0x2f3465[_0x99e6('0x46')][util['format'](_0x99e6('0x27'),_0x22a8cd[_0x99e6('0x28')])])){_0x2f3465[_0x99e6('0x46')][util[_0x99e6('0x26')](_0x99e6('0x27'),_0x22a8cd[_0x99e6('0x28')])]=new Telephone(_0x22a8cd);}else{_0x2f3465['mergeFromDatabase'](_0x2f3465['telephones'][util[_0x99e6('0x26')](_0x99e6('0x27'),_0x22a8cd[_0x99e6('0x28')])],_0x22a8cd);}}}return _0x2f3465[_0x99e6('0x46')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x47')]=function(){var _0x3946e4=this;return function(_0x20e36c){if(_0x20e36c){freeIsNotKeySip(_0x20e36c,_0x3946e4[_0x99e6('0x48')]);for(var _0x43eefe=0x0,_0x407942={},_0x2d5e5d={};_0x43eefe<_0x20e36c[_0x99e6('0x44')];_0x43eefe+=0x1){_0x407942=_0x20e36c[_0x43eefe];if(_[_0x99e6('0x45')](_0x3946e4['trunks'][util[_0x99e6('0x26')](_0x99e6('0x27'),_0x407942[_0x99e6('0x28')])])){_0x3946e4[_0x99e6('0x48')][util[_0x99e6('0x26')](_0x99e6('0x27'),_0x407942['name'])]=new Trunk(_0x407942);}else{_0x3946e4[_0x99e6('0x42')](_0x3946e4[_0x99e6('0x48')][util[_0x99e6('0x26')]('SIP/%s',_0x407942['name'])],_0x407942);}}}return _0x3946e4[_0x99e6('0x48')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x49')]=function(){var _0x264310=this;return function(_0x5d5c49){if(_0x5d5c49){freeIsNotKey(_0x5d5c49,_0x264310[_0x99e6('0x11')],'name');for(var _0x800f5d=0x0,_0x5835d1={},_0x43cfb6={};_0x800f5d<_0x5d5c49['length'];_0x800f5d+=0x1){_0x5835d1=_0x5d5c49[_0x800f5d];if(_[_0x99e6('0x45')](_0x264310[_0x99e6('0x11')][_0x5835d1['name']])){_0x264310['voiceQueues'][_0x5835d1[_0x99e6('0x28')]]=new VoiceQueue(_0x5835d1);}else{_0x264310['mergeFromDatabase'](_0x264310[_0x99e6('0x11')][_0x5835d1[_0x99e6('0x28')]],_0x5835d1);}}}return _0x264310[_0x99e6('0x11')];};};Realtime['prototype']['initTriggers']=function(){var _0x2b17a1=this;return function(_0x473a2f){if(_0x473a2f){freeIsNotKey(_0x473a2f,_0x2b17a1[_0x99e6('0x12')],'id');for(var _0x552bc4=0x0,_0x308614={},_0x395436={};_0x552bc4<_0x473a2f['length'];_0x552bc4+=0x1){_0x308614=_0x473a2f[_0x552bc4];if(_[_0x99e6('0x45')](_0x2b17a1[_0x99e6('0x12')][_0x308614['id']])){_0x2b17a1[_0x99e6('0x12')][_0x308614['id']]=new Trigger(_0x308614);}else{_0x2b17a1['mergeFromDatabase'](_0x2b17a1[_0x99e6('0x12')][_0x308614['id']],_0x308614);}}}return _0x2b17a1['triggers'];};};Realtime[_0x99e6('0x41')][_0x99e6('0x4a')]=function(){var _0x47de33=this;return function(_0x3deb5d){if(_0x3deb5d){freeIsNotKey(_0x3deb5d,_0x47de33[_0x99e6('0x14')],'id');for(var _0x477eb4=0x0,_0x57fc75={},_0x28c5={};_0x477eb4<_0x3deb5d[_0x99e6('0x44')];_0x477eb4+=0x1){_0x57fc75=_0x3deb5d[_0x477eb4];if(_['isUndefined'](_0x47de33[_0x99e6('0x14')][_0x57fc75['id']])){_0x47de33[_0x99e6('0x14')][_0x57fc75['id']]=new Template(_0x57fc75);}else{_0x47de33[_0x99e6('0x42')](_0x47de33[_0x99e6('0x14')][_0x57fc75['id']],_0x57fc75);}}}return _0x47de33[_0x99e6('0x14')];};};Realtime['prototype'][_0x99e6('0x4b')]=function(){var _0x42fb02=this;return function(_0x44964a){if(_0x44964a){freeIsNotKey(_0x44964a,_0x42fb02['zendeskAccounts'],'id');for(var _0x4219dd=0x0,_0x3c53d5={},_0x3f8261={};_0x4219dd<_0x44964a[_0x99e6('0x44')];_0x4219dd+=0x1){_0x3c53d5=_0x44964a[_0x4219dd];if(_[_0x99e6('0x45')](_0x42fb02[_0x99e6('0x1a')][_0x3c53d5['id']])){_0x42fb02[_0x99e6('0x1a')][_0x3c53d5['id']]=new ZendeskAccount(_0x3c53d5);}else{_0x42fb02[_0x99e6('0x42')](_0x42fb02[_0x99e6('0x1a')][_0x3c53d5['id']],_0x3c53d5);}}}return _0x42fb02[_0x99e6('0x1a')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x4c')]=function(){var _0x571661=this;return function(_0x35bb2e){if(_0x35bb2e){freeIsNotKey(_0x35bb2e,_0x571661[_0x99e6('0x1b')],'id');for(var _0x58b908=0x0,_0x1702d0={},_0x59b302={};_0x58b908<_0x35bb2e[_0x99e6('0x44')];_0x58b908+=0x1){_0x1702d0=_0x35bb2e[_0x58b908];if(_[_0x99e6('0x45')](_0x571661['salesforceAccounts'][_0x1702d0['id']])){_0x571661[_0x99e6('0x1b')][_0x1702d0['id']]=new SalesforceAccount(_0x1702d0);}else{_0x571661[_0x99e6('0x42')](_0x571661[_0x99e6('0x1b')][_0x1702d0['id']],_0x1702d0);}}}return _0x571661['salesforceAccounts'];};};Realtime[_0x99e6('0x41')][_0x99e6('0x4d')]=function(){var _0x119ac0=this;return function(_0x417d08){if(_0x417d08){freeIsNotKey(_0x417d08,_0x119ac0[_0x99e6('0x1c')],'id');for(var _0x5221ba=0x0,_0x16a13e={},_0x4783ee={};_0x5221ba<_0x417d08[_0x99e6('0x44')];_0x5221ba+=0x1){_0x16a13e=_0x417d08[_0x5221ba];if(_[_0x99e6('0x45')](_0x119ac0[_0x99e6('0x1c')][_0x16a13e['id']])){_0x119ac0[_0x99e6('0x1c')][_0x16a13e['id']]=new FreshdeskAccount(_0x16a13e);}else{_0x119ac0[_0x99e6('0x42')](_0x119ac0[_0x99e6('0x1c')][_0x16a13e['id']],_0x16a13e);}}}return _0x119ac0[_0x99e6('0x1c')];};};Realtime['prototype'][_0x99e6('0x4e')]=function(){var _0x173303=this;return function(_0x5ab6b1){if(_0x5ab6b1){freeIsNotKey(_0x5ab6b1,_0x173303[_0x99e6('0x1d')],'id');for(var _0x491c4d=0x0,_0xd20f23={},_0x6c6989={};_0x491c4d<_0x5ab6b1[_0x99e6('0x44')];_0x491c4d+=0x1){_0xd20f23=_0x5ab6b1[_0x491c4d];if(_['isUndefined'](_0x173303[_0x99e6('0x1d')][_0xd20f23['id']])){_0x173303[_0x99e6('0x1d')][_0xd20f23['id']]=new ZohoAccount(_0xd20f23);}else{_0x173303['mergeFromDatabase'](_0x173303['zohoAccounts'][_0xd20f23['id']],_0xd20f23);}}}return _0x173303['zohoAccounts'];};};Realtime[_0x99e6('0x41')][_0x99e6('0x4f')]=function(){var _0xb78f82=this;return function(_0x499cb1){if(_0x499cb1){freeIsNotKey(_0x499cb1,_0xb78f82[_0x99e6('0x1e')],'id');for(var _0x241617=0x0,_0x301d22={},_0x54546a={};_0x241617<_0x499cb1[_0x99e6('0x44')];_0x241617+=0x1){_0x301d22=_0x499cb1[_0x241617];if(_[_0x99e6('0x45')](_0xb78f82[_0x99e6('0x1e')][_0x301d22['id']])){_0xb78f82[_0x99e6('0x1e')][_0x301d22['id']]=new DeskAccount(_0x301d22);}else{_0xb78f82[_0x99e6('0x42')](_0xb78f82[_0x99e6('0x1e')][_0x301d22['id']],_0x301d22);}}}return _0xb78f82[_0x99e6('0x1e')];};};Realtime[_0x99e6('0x41')]['initSugarcrmAccounts']=function(){var _0x26cef0=this;return function(_0x355e19){if(_0x355e19){freeIsNotKey(_0x355e19,_0x26cef0[_0x99e6('0x50')],'id');for(var _0x35eff1=0x0,_0x2e1340={},_0x294f5f={};_0x35eff1<_0x355e19['length'];_0x35eff1+=0x1){_0x2e1340=_0x355e19[_0x35eff1];if(_[_0x99e6('0x45')](_0x26cef0[_0x99e6('0x50')][_0x2e1340['id']])){_0x26cef0['sugarcrmAccounts'][_0x2e1340['id']]=new SugarcrmAccount(_0x2e1340);}else{_0x26cef0[_0x99e6('0x42')](_0x26cef0['sugarcrmAccounts'][_0x2e1340['id']],_0x2e1340);}}}return _0x26cef0['sugarcrmAccounts'];};};Realtime[_0x99e6('0x41')][_0x99e6('0x51')]=function(){var _0x366a47=this;return function(_0x29f647){if(_0x29f647){freeIsNotKey(_0x29f647,_0x366a47['vtigerAccounts'],'id');for(var _0x4ac7aa=0x0,_0x26a47d={},_0x54c73f={};_0x4ac7aa<_0x29f647[_0x99e6('0x44')];_0x4ac7aa+=0x1){_0x26a47d=_0x29f647[_0x4ac7aa];if(_['isUndefined'](_0x366a47['vtigerAccounts'][_0x26a47d['id']])){_0x366a47[_0x99e6('0x1f')][_0x26a47d['id']]=new VtigerAccount(_0x26a47d);}else{_0x366a47[_0x99e6('0x42')](_0x366a47['vtigerAccounts'][_0x26a47d['id']],_0x26a47d);}}}return _0x366a47[_0x99e6('0x1f')];};};Realtime['prototype'][_0x99e6('0x52')]=function(){var _0x47cce2=this;return function(_0x2de4f9){if(_0x2de4f9){freeIsNotKey(_0x2de4f9,_0x47cce2[_0x99e6('0x20')],'id');for(var _0xc0e733=0x0,_0x6ac692={},_0x302706={};_0xc0e733<_0x2de4f9['length'];_0xc0e733+=0x1){_0x6ac692=_0x2de4f9[_0xc0e733];if(_['isUndefined'](_0x47cce2['servicenowAccounts'][_0x6ac692['id']])){_0x47cce2[_0x99e6('0x20')][_0x6ac692['id']]=new ServicenowAccount(_0x6ac692);}else{_0x47cce2[_0x99e6('0x42')](_0x47cce2[_0x99e6('0x20')][_0x6ac692['id']],_0x6ac692);}}}return _0x47cce2[_0x99e6('0x20')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x53')]=function(){var _0x36c591=this;return function(_0x33e3a4){if(_0x33e3a4){freeIsNotKey(_0x33e3a4,_0x36c591[_0x99e6('0x21')],'id');for(var _0x1cb4c6=0x0,_0x447091={},_0x1a87f3={};_0x1cb4c6<_0x33e3a4[_0x99e6('0x44')];_0x1cb4c6+=0x1){_0x447091=_0x33e3a4[_0x1cb4c6];if(_['isUndefined'](_0x36c591[_0x99e6('0x21')][_0x447091['id']])){_0x36c591[_0x99e6('0x21')][_0x447091['id']]=new Dynamics365Account(_0x447091);}else{_0x36c591[_0x99e6('0x42')](_0x36c591[_0x99e6('0x21')][_0x447091['id']],_0x447091);}}}return _0x36c591['dynamics365Accounts'];};};Realtime['prototype']['initFreshsalesAccounts']=function(){var _0x220fa6=this;return function(_0x4bc1ab){if(_0x4bc1ab){freeIsNotKey(_0x4bc1ab,_0x220fa6[_0x99e6('0x22')],'id');for(var _0x40b8aa=0x0,_0x37deb4={},_0x241259={};_0x40b8aa<_0x4bc1ab[_0x99e6('0x44')];_0x40b8aa+=0x1){_0x37deb4=_0x4bc1ab[_0x40b8aa];if(_[_0x99e6('0x45')](_0x220fa6[_0x99e6('0x22')][_0x37deb4['id']])){_0x220fa6[_0x99e6('0x22')][_0x37deb4['id']]=new FreshsalesAccount(_0x37deb4);}else{_0x220fa6[_0x99e6('0x42')](_0x220fa6['freshsalesAccounts'][_0x37deb4['id']],_0x37deb4);}}}return _0x220fa6[_0x99e6('0x22')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x54')]=function(){var _0x4a5379=this;return function(_0x3fee3d){for(var _0xe1997e=0x0;_0xe1997e<_0x3fee3d['length'];_0xe1997e+=0x1){_[_0x99e6('0x55')](_0x4a5379['voiceQueues'][_0x3fee3d[_0xe1997e][_0x99e6('0x28')]],_0x3fee3d[_0xe1997e]);}return _0x4a5379['voiceQueues'];};};Realtime[_0x99e6('0x41')]['initVoiceQueueReports']=function(){var _0xf0d887=this;return function(_0x28c414){clearVoiceQueues(_0xf0d887['voiceQueues']);if(_0x28c414){_0x28c414=_['groupBy'](_0x28c414,'uniqueid');for(var _0x420f6f in _0x28c414){if(_0x28c414[_0x99e6('0x25')](_0x420f6f)){var _0x1ffe24={};for(var _0x5b15a3=0x0;_0x5b15a3<_0x28c414[_0x420f6f][_0x99e6('0x44')];_0x5b15a3+=0x1){var _0x55efb6=_0x28c414[_0x420f6f][_0x5b15a3]['queue'];if(_0xf0d887['voiceQueues'][_0x55efb6]){if(_0x28c414[_0x420f6f][_0x5b15a3]['queuecallerexit']){_0xf0d887[_0x99e6('0x11')][_0x55efb6][_0x99e6('0x33')]+=0x1;}if(_0x28c414[_0x420f6f][_0x5b15a3]['queuecallerabandon']){_0xf0d887[_0x99e6('0x11')][_0x55efb6]['abandoned']+=0x1;}_0xf0d887[_0x99e6('0x11')][_0x55efb6]['sumHoldTime']+=moment(_0x28c414[_0x420f6f][_0x5b15a3][_0x99e6('0x56')])[_0x99e6('0x57')](moment(_0x28c414[_0x420f6f][_0x5b15a3][_0x99e6('0x58')]),'seconds')||0x0;if(_0x5b15a3===_0x28c414[_0x420f6f][_0x99e6('0x44')]-0x1){_0xf0d887[_0x99e6('0x11')][_0x55efb6][_0x99e6('0x2e')]+=moment(_0x28c414[_0x420f6f][_0x5b15a3]['queuecallercompleteAt']||_0x28c414[_0x420f6f][_0x5b15a3]['queuecallerabandonAt']||_0x28c414[_0x420f6f][_0x5b15a3][_0x99e6('0x59')])['diff'](moment(_0x28c414[_0x420f6f][_0x5b15a3]['queuecallerjoinAt']),_0x99e6('0x5a'))||0x0;_0xf0d887[_0x99e6('0x11')][_0x55efb6]['total']+=0x1;if(_0x28c414[_0x420f6f][_0x5b15a3][_0x99e6('0x5b')]){_0xf0d887['voiceQueues'][_0x55efb6]['answered']+=0x1;_0xf0d887[_0x99e6('0x11')][_0x55efb6]['sumBillable']+=moment(_0x28c414[_0x420f6f][_0x5b15a3]['queuecallercompleteAt'])[_0x99e6('0x57')](moment(_0x28c414[_0x420f6f][_0x5b15a3][_0x99e6('0x56')]),_0x99e6('0x5a'))||0x0;}}else{_0xf0d887['voiceQueues'][_0x55efb6]['sumDuration']+=_0xf0d887[_0x99e6('0x11')][_0x55efb6][_0x99e6('0x2d')]||0x0;}}}}}}return _0xf0d887[_0x99e6('0x11')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x5c')]=function(){var _0x4232e6=this;return function(_0x401739){clearVoiceCallReports(_0x4232e6[_0x99e6('0x5d')]);if(_0x401739){for(var _0x72c1d5=0x0;_0x72c1d5<_0x401739[_0x99e6('0x44')];_0x72c1d5+=0x1){_0x4232e6[_0x99e6('0x5d')][_0x99e6('0x2b')]+=0x1;_0x4232e6[_0x99e6('0x5d')]['sumDuration']+=_0x401739[_0x72c1d5][_0x99e6('0x5e')];if(_0x401739[_0x72c1d5][_0x99e6('0x5f')]===_0x99e6('0x60')){_0x4232e6[_0x99e6('0x5d')][_0x99e6('0x2c')]+=0x1;_0x4232e6[_0x99e6('0x5d')][_0x99e6('0x2d')]+=_0x401739[_0x72c1d5][_0x99e6('0x5e')]-_0x401739[_0x72c1d5][_0x99e6('0x61')]||0x0;_0x4232e6[_0x99e6('0x5d')][_0x99e6('0x2f')]+=_0x401739[_0x72c1d5][_0x99e6('0x61')];}}}return _0x4232e6[_0x99e6('0x5d')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x62')]=function(){var _0xf5b8ec=this;return function(_0x2c36a6){if(_0x2c36a6){freeIsNotKey(_0x2c36a6,_0xf5b8ec['campaigns'],_0x99e6('0x28'));for(var _0x1d8194=0x0,_0x1b564b={};_0x1d8194<_0x2c36a6['length'];_0x1d8194+=0x1){_0x1b564b=_0x2c36a6[_0x1d8194];if(_['isUndefined'](_0xf5b8ec[_0x99e6('0x13')][_0x1b564b[_0x99e6('0x28')]])){_0xf5b8ec[_0x99e6('0x13')][_0x1b564b['name']]=new Campaign(_0x1b564b);}else{_0xf5b8ec[_0x99e6('0x42')](_0xf5b8ec['campaigns'][_0x1b564b[_0x99e6('0x28')]],_0x1b564b);_0xf5b8ec['campaigns'][_0x1b564b[_0x99e6('0x28')]][_0x99e6('0x63')]=_0x1b564b[_0x99e6('0x64')]?_0x1b564b[_0x99e6('0x64')][_0x99e6('0x28')]:undefined;}}}return _0xf5b8ec[_0x99e6('0x13')];};};Realtime[_0x99e6('0x41')]['initVoiceExtensions']=function(){var _0x383659=this;return function(_0x1aa1f5){if(_0x1aa1f5){freeIsNotKey(_0x1aa1f5,_0x383659[_0x99e6('0x65')],'id');for(var _0xb191b9=0x0,_0x45d130={};_0xb191b9<_0x1aa1f5[_0x99e6('0x44')];_0xb191b9+=0x1){_0x45d130=_0x1aa1f5[_0xb191b9];if(_[_0x99e6('0x45')](_0x383659[_0x99e6('0x65')][_0x45d130['id']])){_0x383659[_0x99e6('0x65')][_0x45d130['id']]=new VoiceExtension(_0x45d130);}else{_0x383659['mergeFromDatabase'](_0x383659[_0x99e6('0x65')][_0x45d130['id']],_0x45d130);}}}return _0x383659[_0x99e6('0x65')];};};Realtime[_0x99e6('0x41')]['initCampaignHopperHistory']=function(){var _0x2edb7e=this;return function(_0x11af03){clearCampaigns(_0x2edb7e[_0x99e6('0x13')]);for(var _0x4f365b=0x0;_0x4f365b<_0x11af03['length'];_0x4f365b+=0x1){_['merge'](_0x2edb7e[_0x99e6('0x13')][_0x11af03[_0x4f365b]['name']],_0x11af03[_0x4f365b]);}return _0x2edb7e[_0x99e6('0x13')];};};Realtime[_0x99e6('0x41')][_0x99e6('0x66')]=function(){var _0x364e19=this;return function(_0x2f5fc6){if(_0x2f5fc6){freeIsNotKey(_0x2f5fc6,_0x364e19['faxAccounts'],'id');for(var _0x5d89b0=0x0,_0x46b957={},_0x5b9d96={};_0x5d89b0<_0x2f5fc6['length'];_0x5d89b0+=0x1){_0x46b957=_0x2f5fc6[_0x5d89b0];if(_[_0x99e6('0x45')](_0x364e19[_0x99e6('0x23')][_0x46b957['id']])){_0x364e19['faxAccounts'][_0x46b957['id']]=new FaxAccount(_0x46b957);}else{_0x364e19[_0x99e6('0x42')](_0x364e19['faxAccounts'][_0x46b957['id']],_0x46b957);}}}return _0x364e19[_0x99e6('0x23')];};};module[_0x99e6('0x67')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index eb2cd32..23c2b3b 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 _0xe1de=['findAgent','connectedlinenum','interface','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','match','keys','length','getCallType','split','getAgentByInternal','calleridnum','outbound','destination','exten','dialer','lastapplication','queue','lastdata','from-voip-provider','callerid','context','from-sip','xcally-motion-preview','originatecalleridnum','channel','destinationchannel','calleridpreview','disposition','ANSWERED','\x22%s\x22\x20<%s>','transfers','linkedid','transfereelinkedid','type','UserId','membername','create','monitor','monitors','monitorFilename','filename','createdAt','calleridname','connectedlinename','xcally-motion-dialer','isArray','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','transfererlinkedid','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','realtime','xdr','disabled','custom:voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','prototype','find','accountcode','name','isNil','format','SIP/%s','voiceQueueReport'];(function(_0x3e7650,_0x5698b2){var _0x37eb41=function(_0x59dd36){while(--_0x59dd36){_0x3e7650['push'](_0x3e7650['shift']());}};_0x37eb41(++_0x5698b2);}(_0xe1de,0xf9));var _0xee1d=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xe1de[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xee1d('0x0'));var moment=require(_0xee1d('0x1'));var util=require(_0xee1d('0x2'));var config=require(_0xee1d('0x3'));var ami=require(_0xee1d('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xee1d('0x5'));var RpcMemberReport=require(_0xee1d('0x6'));var RpcVoiceQueueReport=require(_0xee1d('0x7'));var RpcVoiceRecording=require(_0xee1d('0x8'));var RpcVoiceTransferReport=require(_0xee1d('0x9'));var VoiceQueueReport=require(_0xee1d('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xee1d('0xb'));var VoiceDialReport=require(_0xee1d('0xc'));var UserReport=require(_0xee1d('0xd'));function Report(_0x5ede08){this['realtime']=_0x5ede08;this[_0xee1d('0xe')]=_0x5ede08[_0xee1d('0xe')];this[_0xee1d('0xf')]=_0x5ede08[_0xee1d('0xf')];}Report['prototype']['sync']=function(_0x34a93f){var _0x476303=new VoiceQueueReport(this['realtime']);var _0x55a86c=new VoiceAgentReport(this[_0xee1d('0x10')]);var _0x1b1ff1=new VoiceDialReport(this[_0xee1d('0x10')]);var _0x595048=new VoiceCallReport(this['realtime']);var _0x3c3996=new UserReport(this[_0xee1d('0x10')]);if(config['xdr']&&config[_0xee1d('0x11')][_0xee1d('0x12')]){ami['on'](_0xee1d('0x13'),this['voiceQueueReport'][_0xee1d('0x14')](this));ami['on'](_0xee1d('0x15'),this[_0xee1d('0x16')][_0xee1d('0x14')](this));ami['on'](_0xee1d('0x17'),this[_0xee1d('0x18')][_0xee1d('0x14')](this));ami['on'](_0xee1d('0x19'),this[_0xee1d('0x1a')]['bind'](this));ami['on'](_0xee1d('0x1b'),this[_0xee1d('0x1c')][_0xee1d('0x14')](this));ami['on'](_0xee1d('0x1d'),this[_0xee1d('0x1e')][_0xee1d('0x14')](this));}};Report[_0xee1d('0x1f')]['findAgent']=function(_0x1f3771){var _0x1db839;_0x1db839=_[_0xee1d('0x20')](this[_0xee1d('0xe')],function(_0x1f2c2d){return _0x1f2c2d[_0xee1d('0x21')]==_0x1f3771||_0x1f2c2d[_0xee1d('0x22')]==_0x1f3771;});if(_[_0xee1d('0x23')](_0x1db839)){var _0x43d38c=_[_0xee1d('0x20')](this[_0xee1d('0xf')],function(_0x30207d){return _0x30207d[_0xee1d('0x21')]==_0x1f3771||_0x30207d[_0xee1d('0x22')]==_0x1f3771;});if(_0x43d38c){_0x1db839=_[_0xee1d('0x20')](this['agents'],function(_0x5c86e2){return _0x5c86e2['interface']==util[_0xee1d('0x24')](_0xee1d('0x25'),_0x43d38c['name']);});}}return _0x1db839;};Report[_0xee1d('0x1f')][_0xee1d('0x26')]=function(_0x534a42){for(var _0x4dc1c0=0x0;_0x4dc1c0<_0x534a42['length'];_0x4dc1c0+=0x1){var _0x8b8978=this[_0xee1d('0x27')](_0x534a42[_0x4dc1c0][_0xee1d('0x28')]);if(_0x8b8978){_0x534a42[_0x4dc1c0][_0xee1d('0x21')]=_0x8b8978[_0xee1d('0x21')];_0x534a42[_0x4dc1c0]['assigned']=!![];_0x534a42[_0x4dc1c0]['lastAssignedTo']=_0x8b8978[_0xee1d('0x22')];_0x534a42[_0x4dc1c0][_0xee1d('0x29')]=_['isNil'](_0x8b8978[_0xee1d('0x29')])?util[_0xee1d('0x24')]('SIP/%s',_0x8b8978[_0xee1d('0x22')]):_0x8b8978[_0xee1d('0x29')];if(_0x534a42[_0x4dc1c0][_0xee1d('0x2a')]){_0x534a42[_0x4dc1c0]['queuecallercompleteAt']=moment()['format'](_0xee1d('0x2b'));}if(_0x534a42[_0x4dc1c0][_0xee1d('0x2c')]){_0x534a42[_0x4dc1c0]['queuecallerexitAt']=moment()[_0xee1d('0x24')](_0xee1d('0x2b'));}RpcMemberReport['voiceQueueReport'](_0x534a42[_0x4dc1c0]);}RpcVoiceQueueReport['create'](_0x534a42[_0x4dc1c0]);}};function extractCalleridNumber(_0x483b4a){var _0x426472=_0x483b4a[_0xee1d('0x2d')](/<(.*?)>/);return _0x426472?_0x426472[0x1]:_0x483b4a;}Report[_0xee1d('0x1f')]['getAgentByInternal']=function(_0x25fdb9){for(var _0x3d9d48=0x0;_0x3d9d48','calleridname','linkedid','transfers','transfereelinkedid','uniqueid','getCallType','UserId','create','monitors','length','filename','createdAt','exten','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','voiceDialReport','startsWith','indexOf','mobile','phone','substring','lastIndexOf','exports','lodash','moment','util','../../../config/environment','../ami','../rpc/voiceAgentReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceRecording','./voiceQueueReport','./voiceAgentReport','./voiceDialReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','custom:voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','findAgent','find','name','isNil','interface','format','connectedlinenum','accountcode','lastAssignedTo','SIP/%s','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','match','getAgentByInternal','keys','channel','split','calleridnum','outbound','internal','voiceCallReport','destination','type','lastapplication','queue','from-voip-provider','callerid','context','from-sip','xcally-motion-preview'];(function(_0x421d92,_0x1b8c8f){var _0x9c0b2b=function(_0x4b5ff1){while(--_0x4b5ff1){_0x421d92['push'](_0x421d92['shift']());}};_0x9c0b2b(++_0x1b8c8f);}(_0x305c,0xd7));var _0xc305=function(_0x1f8a2a,_0x906b0f){_0x1f8a2a=_0x1f8a2a-0x0;var _0x4dcaa7=_0x305c[_0x1f8a2a];return _0x4dcaa7;};'use strict';var _=require(_0xc305('0x0'));var moment=require(_0xc305('0x1'));var util=require(_0xc305('0x2'));var config=require(_0xc305('0x3'));var ami=require(_0xc305('0x4'));var RpcVoiceAgentReport=require(_0xc305('0x5'));var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0xc305('0x6'));var RpcMemberReport=require(_0xc305('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require(_0xc305('0x8'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xc305('0x9'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0xc305('0xa'));var VoiceDialReport=require(_0xc305('0xb'));var UserReport=require('./userReport');function Report(_0x5554ab){this[_0xc305('0xc')]=_0x5554ab;this[_0xc305('0xd')]=_0x5554ab[_0xc305('0xd')];this[_0xc305('0xe')]=_0x5554ab[_0xc305('0xe')];}Report[_0xc305('0xf')][_0xc305('0x10')]=function(_0x44b299){var _0x5c51ac=new VoiceQueueReport(this['realtime']);var _0x476f2f=new VoiceAgentReport(this['realtime']);var _0x63d03b=new VoiceDialReport(this['realtime']);var _0x4af8d2=new VoiceCallReport(this['realtime']);var _0x4749f6=new UserReport(this[_0xc305('0xc')]);if(config['xdr']&&config[_0xc305('0x11')][_0xc305('0x12')]){ami['on'](_0xc305('0x13'),this[_0xc305('0x14')][_0xc305('0x15')](this));ami['on'](_0xc305('0x16'),this['voiceCallReport'][_0xc305('0x15')](this));ami['on'](_0xc305('0x17'),this['voiceAgentReport'][_0xc305('0x15')](this));ami['on'](_0xc305('0x18'),this['voiceDialReport']['bind'](this));ami['on'](_0xc305('0x19'),this[_0xc305('0x1a')][_0xc305('0x15')](this));ami['on']('attendedtransfer',this[_0xc305('0x1b')][_0xc305('0x15')](this));}};Report['prototype'][_0xc305('0x1c')]=function(_0x98e0b7){var _0x31616b;_0x31616b=_[_0xc305('0x1d')](this[_0xc305('0xd')],function(_0x3fa494){return _0x3fa494['accountcode']==_0x98e0b7||_0x3fa494[_0xc305('0x1e')]==_0x98e0b7;});if(_[_0xc305('0x1f')](_0x31616b)){var _0x5c84f7=_[_0xc305('0x1d')](this[_0xc305('0xe')],function(_0x28aeb1){return _0x28aeb1['accountcode']==_0x98e0b7||_0x28aeb1[_0xc305('0x1e')]==_0x98e0b7;});if(_0x5c84f7){_0x31616b=_['find'](this[_0xc305('0xd')],function(_0x47fba8){return _0x47fba8[_0xc305('0x20')]==util[_0xc305('0x21')]('SIP/%s',_0x5c84f7[_0xc305('0x1e')]);});}}return _0x31616b;};Report[_0xc305('0xf')]['voiceQueueReport']=function(_0x4cef62){for(var _0x1b004d=0x0;_0x1b004d<_0x4cef62['length'];_0x1b004d+=0x1){var _0x293d4a=this[_0xc305('0x1c')](_0x4cef62[_0x1b004d][_0xc305('0x22')]);if(_0x293d4a){_0x4cef62[_0x1b004d][_0xc305('0x23')]=_0x293d4a[_0xc305('0x23')];_0x4cef62[_0x1b004d]['assigned']=!![];_0x4cef62[_0x1b004d][_0xc305('0x24')]=_0x293d4a[_0xc305('0x1e')];_0x4cef62[_0x1b004d][_0xc305('0x20')]=_[_0xc305('0x1f')](_0x293d4a[_0xc305('0x20')])?util['format'](_0xc305('0x25'),_0x293d4a[_0xc305('0x1e')]):_0x293d4a[_0xc305('0x20')];if(_0x4cef62[_0x1b004d][_0xc305('0x26')]){_0x4cef62[_0x1b004d][_0xc305('0x27')]=moment()[_0xc305('0x21')](_0xc305('0x28'));}if(_0x4cef62[_0x1b004d][_0xc305('0x29')]){_0x4cef62[_0x1b004d][_0xc305('0x2a')]=moment()['format'](_0xc305('0x28'));}RpcMemberReport[_0xc305('0x14')](_0x4cef62[_0x1b004d]);}RpcVoiceQueueReport['create'](_0x4cef62[_0x1b004d]);}};function extractCalleridNumber(_0x3d81ce){var _0x7ceb32=_0x3d81ce[_0xc305('0x2b')](/<(.*?)>/);return _0x7ceb32?_0x7ceb32[0x1]:_0x3d81ce;}Report['prototype'][_0xc305('0x2c')]=function(_0x51963a){for(var _0x47b493=0x0;_0x47b4930x0?_0x346343:0x0;this['voiceQueues'][_0x41bfc7['queue']][_0x8470('0x32')]=this[_0x8470('0x46')][_0x41bfc7['queue']][_0x8470('0x32')]>_[_0x8470('0x6c')](_0x41bfc7[_0x8470('0x6e')])?_['toNumber'](_0x41bfc7['loggedin']):this['voiceQueues'][_0x41bfc7[_0x8470('0x66')]][_0x8470('0x32')];this[_0x8470('0x53')](this[_0x8470('0x46')][_0x41bfc7[_0x8470('0x66')]],_0x8470('0x14'));}logger['debug'](_0x8470('0x6f'),util[_0x8470('0x42')](this['voiceQueues'][_0x41bfc7[_0x8470('0x66')]],{'showHidden':![],'depth':null}));ami[_0x8470('0x48')](_0x8470('0x70'),this[_0x8470('0x46')][_0x41bfc7[_0x8470('0x66')]]);}}}catch(_0x4e3e87){logger[_0x8470('0x40')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x4e3e87,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8470('0xa')][_0x8470('0x17')]=function(_0x9d738){logger['debug'](_0x8470('0x71'),util[_0x8470('0x42')](_0x9d738,{'showHidden':![],'depth':null}));this[_0x8470('0x11')]=!![];};VoiceQueueReport[_0x8470('0xa')]['syncQueueCallerJoin']=function(_0x1bdb31){try{if(this[_0x8470('0x64')](_0x1bdb31)){logger['debug'](_0x8470('0x72'),_0x1bdb31[_0x8470('0x4c')],util[_0x8470('0x42')](_0x1bdb31,{'showHidden':![],'depth':null}));if(_[_0x8470('0x73')](this[_0x8470('0xd')][_0x1bdb31[_0x8470('0x4c')]]))this['queueReports'][_0x1bdb31[_0x8470('0x4c')]]=[];if(_[_0x8470('0x73')](this['channels'][_0x1bdb31[_0x8470('0x4c')]]))this['channels'][_0x1bdb31[_0x8470('0x4c')]]={};var _0x112ec5=new QueueReport();_0x112ec5['name']=_0x1bdb31[_0x8470('0x66')];_0x112ec5[_0x8470('0x54')]=this[_0x8470('0x46')][_0x112ec5['name']]&&this['voiceQueues'][_0x112ec5[_0x8470('0x4f')]]['type']?this[_0x8470('0x46')][_0x112ec5[_0x8470('0x4f')]][_0x8470('0x54')]||_0x8470('0x55'):_0x8470('0x55');_0x112ec5['queue']=_0x1bdb31[_0x8470('0x66')];_0x112ec5[_0x8470('0x74')]=moment()[_0x8470('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x112ec5[_0x8470('0x75')]=_0x1bdb31[_0x8470('0x75')];_0x112ec5['count']=_0x1bdb31[_0x8470('0x76')];_0x112ec5[_0x8470('0x4c')]=_0x1bdb31[_0x8470('0x4c')];_0x112ec5[_0x8470('0x77')]=this[_0x8470('0xf')][_0x1bdb31[_0x8470('0x4c')]]['routealias'];logger[_0x8470('0x68')](_0x8470('0x78'),_0x112ec5['name'],_0x112ec5[_0x8470('0x54')]);_['merge'](_0x112ec5,_['pick'](_0x1bdb31,_['keys'](_0x112ec5)));this['queueReports'][_0x1bdb31[_0x8470('0x4c')]]['push'](_0x112ec5);this['channels'][_0x1bdb31['uniqueid']]=_0x112ec5;this[_0x8470('0x49')](_0x112ec5,_0x8470('0x19'));}}catch(_0x54d029){logger[_0x8470('0x40')](_0x8470('0x72'),_0x1bdb31['uniqueid'],util[_0x8470('0x42')](_0x54d029,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8470('0x79')]=function(_0x315589){try{if(this[_0x8470('0x64')](_0x315589)){logger[_0x8470('0x4a')](_0x8470('0x7a'),_0x315589[_0x8470('0x4c')],util[_0x8470('0x42')](_0x315589,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x315589[_0x8470('0x4c')]]){var _0x5ef4e2=_[_0x8470('0x7b')](this[_0x8470('0xd')][_0x315589[_0x8470('0x4c')]]);_0x5ef4e2[_0x8470('0x7c')]=![];_0x5ef4e2[_0x8470('0x7d')]=null;_0x5ef4e2[_0x8470('0x7e')]=_0x315589['holdtime'];_0x5ef4e2[_0x8470('0x7f')]=_0x315589[_0x8470('0x7f')];_0x5ef4e2['queuecallerabandon']=!![];_0x5ef4e2[_0x8470('0x80')]=moment()['format'](_0x8470('0x81'));_0x5ef4e2[_0x8470('0x82')]=_0x8470('0x83');_0x5ef4e2[_0x8470('0x84')]=null;logger[_0x8470('0x68')](_0x8470('0x85'),_0x5ef4e2[_0x8470('0x4f')],_0x5ef4e2['type']);this['channels'][_0x315589[_0x8470('0x4c')]]=_0x5ef4e2;this[_0x8470('0x47')](_0x5ef4e2,_0x8470('0x1b'));}}}catch(_0x5cfd1a){logger[_0x8470('0x40')](_0x8470('0x7a'),_0x315589[_0x8470('0x4c')],util[_0x8470('0x42')](_0x5cfd1a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8470('0xa')]['syncQueueCallerLeave']=function(_0x59eecf){try{if(this[_0x8470('0x64')](_0x59eecf)){logger[_0x8470('0x4a')](_0x8470('0x86'),_0x59eecf[_0x8470('0x4c')],util[_0x8470('0x42')](_0x59eecf,{'showHidden':![],'depth':null}));if(this[_0x8470('0xd')][_0x59eecf['uniqueid']]){var _0xfd05dd=_[_0x8470('0x7b')](this[_0x8470('0xd')][_0x59eecf['uniqueid']]);_0xfd05dd['queuecallerleaveAt']=moment()[_0x8470('0x4d')](_0x8470('0x81'));_0xfd05dd[_0x8470('0x87')]=_0x59eecf[_0x8470('0x87')];_0xfd05dd[_0x8470('0x88')]=_0x59eecf[_0x8470('0x88')];logger['info'](_0x8470('0x89'),_0xfd05dd[_0x8470('0x4f')],_0xfd05dd[_0x8470('0x54')],_0x59eecf[_0x8470('0x87')],_0x59eecf[_0x8470('0x88')]);this[_0x8470('0xf')][_0x59eecf[_0x8470('0x4c')]]=_0xfd05dd;this[_0x8470('0x49')](_0xfd05dd,_0x8470('0x1c'));}}}catch(_0x3c6076){logger[_0x8470('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x59eecf[_0x8470('0x4c')],util[_0x8470('0x42')](_0x3c6076,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8470('0xa')][_0x8470('0x21')]=function(_0x5b2577){try{if(this['isNotNull'](_0x5b2577)){logger[_0x8470('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x5b2577['uniqueid'],util[_0x8470('0x42')](_0x5b2577,{'showHidden':![],'depth':null}));if(this[_0x8470('0xd')][_0x5b2577[_0x8470('0x4c')]]){var _0x1d0c20=_['last'](this[_0x8470('0xd')][_0x5b2577[_0x8470('0x4c')]]);_0x1d0c20[_0x8470('0x7c')]=!![];_0x1d0c20['queuecallerexitreason']=_0x8470('0x8a');logger['info'](_0x8470('0x8b'),_0x1d0c20[_0x8470('0x4f')],_0x1d0c20[_0x8470('0x54')]);}}}catch(_0x2e222d){logger[_0x8470('0x40')](_0x8470('0x8c'),_0x5b2577[_0x8470('0x4c')],util['inspect'](_0x2e222d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8470('0xa')]['syncAgentComplete']=function(_0x277f6c){try{if(this[_0x8470('0x64')](_0x277f6c)){logger[_0x8470('0x4a')](_0x8470('0x8d'),_0x277f6c['uniqueid'],util[_0x8470('0x42')](_0x277f6c,{'showHidden':![],'depth':null}));if(this[_0x8470('0xd')][_0x277f6c['uniqueid']]){var _0x35e258=_[_0x8470('0x7b')](this[_0x8470('0xd')][_0x277f6c[_0x8470('0x4c')]]);_0x35e258[_0x8470('0x1b')]=![];_0x35e258[_0x8470('0x80')]=null;_0x35e258['assigned']=!![];_0x35e258[_0x8470('0x84')]=_0x277f6c[_0x8470('0x8e')];_0x35e258[_0x8470('0x7e')]=_0x277f6c['holdtime'];_0x35e258[_0x8470('0x7c')]=!![];_0x35e258[_0x8470('0x8f')]=![];_0x35e258[_0x8470('0x90')]=null;if(!_0x35e258[_0x8470('0x91')]){if(_0x277f6c['reason']==_0x8470('0x91')){_0x35e258[_0x8470('0x82')]=_0x8470('0x92');logger['info'](_0x8470('0x93'),_0x35e258[_0x8470('0x4f')],_0x35e258[_0x8470('0x54')]);}else{if(_[_0x8470('0x94')](_0x277f6c[_0x8470('0x3b')]['toLowerCase'](),_0x8470('0x95'))){if(this[_0x8470('0xd')][_0x277f6c[_0x8470('0x96')]]){var _0x18a33b=_[_0x8470('0x7b')](this[_0x8470('0xd')][_0x277f6c[_0x8470('0x96')]]);_0x18a33b[_0x8470('0x7c')]=![];_0x18a33b[_0x8470('0x8f')]=!![];_0x18a33b[_0x8470('0x90')]=moment(_0x35e258[_0x8470('0x74')])[_0x8470('0x97')](_0x277f6c['holdtime'],_0x8470('0x98'))[_0x8470('0x4d')](_0x8470('0x81'));_0x18a33b[_0x8470('0x82')]=_0x8470('0x99');_0x18a33b[_0x8470('0x91')]=!![];_0x18a33b[_0x8470('0x9a')]=_0x8470('0x9b');_0x18a33b['transferexten']=_0x277f6c[_0x8470('0x9c')];_0x18a33b[_0x8470('0x9d')]=_0x277f6c['uniqueid'];logger['info'](_0x8470('0x9e'),_0x18a33b[_0x8470('0x4f')],_0x18a33b[_0x8470('0x54')]);var _0x1db38f=this[_0x8470('0xd')][_0x277f6c[_0x8470('0x96')]];this[_0x8470('0xd')][_0x277f6c[_0x8470('0x96')]]=this[_0x8470('0xd')][_0x277f6c['uniqueid']];this[_0x8470('0xd')][_0x277f6c[_0x8470('0x4c')]]=_0x1db38f;}}else{_0x35e258[_0x8470('0x82')]=_0x8470('0x9f')+_0x277f6c[_0x8470('0xa0')][_0x8470('0xa1')]();logger['info'](_0x8470('0xa2'),_0x35e258[_0x8470('0x4f')],_0x35e258[_0x8470('0x54')],_0x35e258[_0x8470('0x82')]);}}}this[_0x8470('0xf')][_0x277f6c['uniqueid']]=_0x35e258;this[_0x8470('0x47')](_0x35e258,_0x8470('0x1e'));}}}catch(_0xefc887){logger[_0x8470('0x40')]('[%s][voiceQueueReport][agentcomplete]',_0x277f6c[_0x8470('0x4c')],util[_0x8470('0x42')](_0xefc887,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8470('0xa')][_0x8470('0xa3')]=function(_0x3d8af5){try{if(this[_0x8470('0x64')](_0x3d8af5)){logger[_0x8470('0x4a')](_0x8470('0xa4'),_0x3d8af5['uniqueid'],util[_0x8470('0x42')](_0x3d8af5,{'showHidden':![],'depth':null}));this[_0x8470('0xa5')](_0x3d8af5[_0x8470('0x4c')],_[_0x8470('0xa6')](_0x3d8af5[_0x8470('0xa7')])[0x0],_0x3d8af5[_0x8470('0xa8')]);if(this[_0x8470('0xd')][_0x3d8af5[_0x8470('0x4c')]]){var _0x4a1884=_[_0x8470('0x7b')](this[_0x8470('0xd')][_0x3d8af5[_0x8470('0x4c')]]);if(_0x4a1884){if(this['isNotNull'](_0x3d8af5[_0x8470('0xa7')])&&this[_0x8470('0x64')](_0x3d8af5[_0x8470('0xa7')][_0x8470('0xa9')])){switch(_0x3d8af5[_0x8470('0xa8')]){case _0x8470('0xaa'):_0x4a1884['queuecallerexit']=![];_0x4a1884[_0x8470('0x90')]=null;break;case _0x8470('0xab'):_0x4a1884[_0x8470('0xac')]=_0x8470('0xad');_0x4a1884[_0x8470('0x8f')]=!![];_0x4a1884['queuecallerexitAt']=moment()[_0x8470('0x4d')](_0x8470('0x81'));_0x4a1884[_0x8470('0xae')]=moment()[_0x8470('0x4d')](_0x8470('0x81'));logger[_0x8470('0x4a')](_0x8470('0xaf'),_0x3d8af5[_0x8470('0x4c')],util[_0x8470('0x42')](_0x4a1884,{'showHidden':![],'depth':null}));ami[_0x8470('0x48')](_0x8470('0xb0'),_0x4a1884);break;default:_0x4a1884[_0x8470('0x8f')]=!![];_0x4a1884['queuecallerexitAt']=moment()[_0x8470('0x4d')](_0x8470('0x81'));_0x4a1884['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4a1884[_0x8470('0x1b')]=![];_0x4a1884[_0x8470('0x80')]=null;_0x4a1884[_0x8470('0x82')]=_0x3d8af5[_0x8470('0xa8')];this[_0x8470('0xf')][_0x3d8af5['uniqueid']]=_0x4a1884;this['emitVoiceQueueChannelRemove'](_0x4a1884,'varset');}else if(this[_0x8470('0x64')](_0x3d8af5['variable'])&&this[_0x8470('0x64')](_0x3d8af5[_0x8470('0xa7')][_0x8470('0xb1')])){if(!_0x4a1884[_0x8470('0x1b')]){_0x4a1884['queuecallerexit']=!![];_0x4a1884[_0x8470('0x90')]=moment()['format'](_0x8470('0x81'));_0x4a1884[_0x8470('0x82')]=_0x8470('0xb2');_0x4a1884['queuecallerleaveAt']=moment()[_0x8470('0x4d')](_0x8470('0x81'));this[_0x8470('0xf')][_0x3d8af5[_0x8470('0x4c')]]=_0x4a1884;}}logger[_0x8470('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x3d8af5['uniqueid'],_0x4a1884[_0x8470('0x4f')],_0x4a1884[_0x8470('0x54')],_['keys'](_0x3d8af5['variable'])[0x0],_0x3d8af5['value']);_0x4a1884[_0x8470('0x13')]=this[_0x8470('0x13')][_0x3d8af5[_0x8470('0x4c')]];}}}}catch(_0x28fe6e){logger['error'](_0x8470('0xa4'),_0x3d8af5[_0x8470('0x4c')],util[_0x8470('0x42')](_0x28fe6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['addVariable']=function(_0x1d3693,_0x2385d5,_0x400652){var _0x21651f=[_0x8470('0xb3'),'rtpaudioqosbridged',_0x8470('0xb4'),_0x8470('0xb5'),'rtpaudioqosloss',_0x8470('0xb6'),_0x8470('0xb7'),_0x8470('0xb8'),'sipcallid','sipuri',_0x8470('0xb9'),_0x8470('0xba'),_0x8470('0xbb'),_0x8470('0xbc'),_0x8470('0xbd'),_0x8470('0xbe'),'membername',_0x8470('0xbf'),_0x8470('0xc0')];if(!_['isNil'](_0x2385d5)&&!_[_0x8470('0xc1')](_0x21651f,_0x2385d5)){if(_[_0x8470('0x73')](this['variables'][_0x1d3693])){this[_0x8470('0x13')][_0x1d3693]={};}this['variables'][_0x1d3693][_0x2385d5]=_0x400652;}};VoiceQueueReport[_0x8470('0xa')]['syncHangup']=function(_0x1409b5){try{if(this[_0x8470('0x64')](_0x1409b5)){logger[_0x8470('0x4a')](_0x8470('0xc2'),_0x1409b5['uniqueid'],util[_0x8470('0x42')](_0x1409b5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1409b5['uniqueid']]){for(var _0x789190=0x0,_0x5d9608={};_0x7891900x0?_0x4726c2:0x0;this[_0xefa4('0x13')][_0x238e61[_0xefa4('0x70')]][_0xefa4('0x33')]=this['voiceQueues'][_0x238e61[_0xefa4('0x70')]][_0xefa4('0x33')]>_[_0xefa4('0x75')](_0x238e61[_0xefa4('0x76')])?_['toNumber'](_0x238e61[_0xefa4('0x76')]):this['voiceQueues'][_0x238e61[_0xefa4('0x70')]]['talking'];this[_0xefa4('0x55')](this[_0xefa4('0x13')][_0x238e61[_0xefa4('0x70')]],_0xefa4('0x17'));}logger[_0xefa4('0x50')](_0xefa4('0x77'),util[_0xefa4('0x40')](this[_0xefa4('0x13')][_0x238e61[_0xefa4('0x70')]],{'showHidden':![],'depth':null}));ami['emit']('custom:queuesummary',this[_0xefa4('0x13')][_0x238e61[_0xefa4('0x70')]]);}}}catch(_0x4b041c){logger[_0xefa4('0x3e')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x4b041c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0x1b')]=function(_0x427cc3){logger[_0xefa4('0x50')](_0xefa4('0x78'),util[_0xefa4('0x40')](_0x427cc3,{'showHidden':![],'depth':null}));this[_0xefa4('0x14')]=!![];};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0x79')]=function(_0x439c7e){try{if(this[_0xefa4('0x6f')](_0x439c7e)){logger[_0xefa4('0x50')](_0xefa4('0x7a'),_0x439c7e[_0xefa4('0x4a')],util['inspect'](_0x439c7e,{'showHidden':![],'depth':null}));if(_[_0xefa4('0x69')](this[_0xefa4('0x41')][_0x439c7e[_0xefa4('0x4a')]]))this[_0xefa4('0x41')][_0x439c7e['uniqueid']]=[];if(_[_0xefa4('0x69')](this[_0xefa4('0x12')][_0x439c7e[_0xefa4('0x4a')]]))this[_0xefa4('0x12')][_0x439c7e[_0xefa4('0x4a')]]={};var _0x54c2d8=new QueueReport();_0x54c2d8[_0xefa4('0x4c')]=_0x439c7e[_0xefa4('0x70')];_0x54c2d8[_0xefa4('0x5f')]=this[_0xefa4('0x13')][_0x54c2d8[_0xefa4('0x4c')]]&&this['voiceQueues'][_0x54c2d8[_0xefa4('0x4c')]][_0xefa4('0x5f')]?this[_0xefa4('0x13')][_0x54c2d8['name']][_0xefa4('0x5f')]||_0xefa4('0x56'):_0xefa4('0x56');_0x54c2d8[_0xefa4('0x70')]=_0x439c7e['queue'];_0x54c2d8[_0xefa4('0x7b')]=moment()[_0xefa4('0x52')]('YYYY-MM-DD\x20HH:mm:ss');_0x54c2d8[_0xefa4('0x7c')]=_0x439c7e['position'];_0x54c2d8[_0xefa4('0x7d')]=_0x439c7e[_0xefa4('0x7d')];_0x54c2d8['uniqueid']=_0x439c7e[_0xefa4('0x4a')];_0x54c2d8[_0xefa4('0x7e')]=this[_0xefa4('0x12')][_0x439c7e[_0xefa4('0x4a')]][_0xefa4('0x7e')];logger['info'](_0xefa4('0x7f'),_0x54c2d8[_0xefa4('0x4c')],_0x54c2d8[_0xefa4('0x5f')]);_[_0xefa4('0x80')](_0x54c2d8,_[_0xefa4('0x81')](_0x439c7e,_['keys'](_0x54c2d8)));this[_0xefa4('0x41')][_0x439c7e[_0xefa4('0x4a')]][_0xefa4('0x82')](_0x54c2d8);this['channels'][_0x439c7e[_0xefa4('0x4a')]]=_0x54c2d8;this[_0xefa4('0x48')](_0x54c2d8,'queuecallerjoin');}}catch(_0x2b1ef4){logger[_0xefa4('0x3e')](_0xefa4('0x7a'),_0x439c7e[_0xefa4('0x4a')],util['inspect'](_0x2b1ef4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xefa4('0x1e')]=function(_0xb41dc8){try{if(this[_0xefa4('0x6f')](_0xb41dc8)){logger[_0xefa4('0x50')](_0xefa4('0x83'),_0xb41dc8[_0xefa4('0x4a')],util['inspect'](_0xb41dc8,{'showHidden':![],'depth':null}));if(this[_0xefa4('0x41')][_0xb41dc8[_0xefa4('0x4a')]]){var _0xea3b30=_[_0xefa4('0x84')](this[_0xefa4('0x41')][_0xb41dc8[_0xefa4('0x4a')]]);_0xea3b30[_0xefa4('0x85')]=![];_0xea3b30['queuecallercompleteAt']=null;_0xea3b30[_0xefa4('0x86')]=_0xb41dc8[_0xefa4('0x86')];_0xea3b30['originalposition']=_0xb41dc8[_0xefa4('0x87')];_0xea3b30['queuecallerabandon']=!![];_0xea3b30[_0xefa4('0x88')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));_0xea3b30[_0xefa4('0x8a')]=_0xefa4('0x8b');_0xea3b30[_0xefa4('0x8c')]=null;logger[_0xefa4('0x71')](_0xefa4('0x8d'),_0xea3b30[_0xefa4('0x4c')],_0xea3b30[_0xefa4('0x5f')]);this[_0xefa4('0x12')][_0xb41dc8[_0xefa4('0x4a')]]=_0xea3b30;this[_0xefa4('0x4f')](_0xea3b30,_0xefa4('0x1d'));}}}catch(_0x1505eb){logger[_0xefa4('0x3e')](_0xefa4('0x83'),_0xb41dc8['uniqueid'],util[_0xefa4('0x40')](_0x1505eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0x20')]=function(_0x38f2f8){try{if(this['isNotNull'](_0x38f2f8)){logger[_0xefa4('0x50')](_0xefa4('0x8e'),_0x38f2f8['uniqueid'],util['inspect'](_0x38f2f8,{'showHidden':![],'depth':null}));if(this[_0xefa4('0x41')][_0x38f2f8[_0xefa4('0x4a')]]){var _0xeab2d7=_[_0xefa4('0x84')](this['queueReports'][_0x38f2f8[_0xefa4('0x4a')]]);_0xeab2d7[_0xefa4('0x8f')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));_0xeab2d7['connectedlinenum']=_0x38f2f8[_0xefa4('0x90')];_0xeab2d7['connectedlinename']=_0x38f2f8[_0xefa4('0x91')];logger[_0xefa4('0x71')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xeab2d7['name'],_0xeab2d7[_0xefa4('0x5f')],_0x38f2f8[_0xefa4('0x90')],_0x38f2f8[_0xefa4('0x91')]);this['channels'][_0x38f2f8[_0xefa4('0x4a')]]=_0xeab2d7;this[_0xefa4('0x48')](_0xeab2d7,_0xefa4('0x1f'));}}}catch(_0x86e783){logger[_0xefa4('0x3e')](_0xefa4('0x8e'),_0x38f2f8[_0xefa4('0x4a')],util['inspect'](_0x86e783,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')]['syncAgentConnect']=function(_0x10cc6f){try{if(this[_0xefa4('0x6f')](_0x10cc6f)){logger[_0xefa4('0x50')](_0xefa4('0x92'),_0x10cc6f['uniqueid'],util[_0xefa4('0x40')](_0x10cc6f,{'showHidden':![],'depth':null}));if(this[_0xefa4('0x41')][_0x10cc6f['uniqueid']]){var _0x27700f=_[_0xefa4('0x84')](this[_0xefa4('0x41')][_0x10cc6f[_0xefa4('0x4a')]]);_0x27700f[_0xefa4('0x85')]=!![];_0x27700f[_0xefa4('0x8a')]=_0xefa4('0x93');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x27700f[_0xefa4('0x4c')],_0x27700f[_0xefa4('0x5f')]);}}}catch(_0x47d81b){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x10cc6f[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x47d81b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0x22')]=function(_0x29316b){try{if(this[_0xefa4('0x6f')](_0x29316b)){logger[_0xefa4('0x50')](_0xefa4('0x94'),_0x29316b[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x29316b,{'showHidden':![],'depth':null}));if(this[_0xefa4('0x41')][_0x29316b[_0xefa4('0x4a')]]){var _0x1b1927=_['last'](this['queueReports'][_0x29316b[_0xefa4('0x4a')]]);_0x1b1927[_0xefa4('0x1d')]=![];_0x1b1927[_0xefa4('0x88')]=null;_0x1b1927['assigned']=!![];_0x1b1927[_0xefa4('0x8c')]=_0x29316b[_0xefa4('0x95')];_0x1b1927[_0xefa4('0x86')]=_0x29316b['holdtime'];_0x1b1927[_0xefa4('0x85')]=!![];_0x1b1927[_0xefa4('0x96')]=![];_0x1b1927[_0xefa4('0x97')]=null;if(!_0x1b1927['transfer']){if(_0x29316b[_0xefa4('0x98')]==_0xefa4('0x99')){_0x1b1927[_0xefa4('0x8a')]=_0xefa4('0x9a');logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x1b1927['name'],_0x1b1927[_0xefa4('0x5f')]);}else{if(_[_0xefa4('0x9b')](_0x29316b['channel'][_0xefa4('0x9c')](),_0xefa4('0x9d'))){if(this[_0xefa4('0x41')][_0x29316b[_0xefa4('0x9e')]]){var _0x47d1ac=_[_0xefa4('0x84')](this['queueReports'][_0x29316b[_0xefa4('0x9e')]]);_0x47d1ac[_0xefa4('0x85')]=![];_0x47d1ac[_0xefa4('0x96')]=!![];_0x47d1ac['queuecallerexitAt']=moment(_0x1b1927[_0xefa4('0x7b')])[_0xefa4('0x9f')](_0x29316b[_0xefa4('0x86')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x47d1ac['queuecallerexitreason']=_0xefa4('0xa0');_0x47d1ac['transfer']=!![];_0x47d1ac[_0xefa4('0xa1')]=_0xefa4('0xa2');_0x47d1ac[_0xefa4('0xa3')]=_0x29316b['destexten'];_0x47d1ac['transferuniqueid']=_0x29316b[_0xefa4('0x4a')];logger[_0xefa4('0x71')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x47d1ac['name'],_0x47d1ac['type']);var _0x5886bc=this[_0xefa4('0x41')][_0x29316b['linkedid']];this[_0xefa4('0x41')][_0x29316b[_0xefa4('0x9e')]]=this['queueReports'][_0x29316b[_0xefa4('0x4a')]];this['queueReports'][_0x29316b[_0xefa4('0x4a')]]=_0x5886bc;}}else{_0x1b1927[_0xefa4('0x8a')]='COMPLETEDBY'+_0x29316b['reason'][_0xefa4('0xa4')]();logger['info'](_0xefa4('0xa5'),_0x1b1927[_0xefa4('0x4c')],_0x1b1927[_0xefa4('0x5f')],_0x1b1927[_0xefa4('0x8a')]);}}}this[_0xefa4('0x12')][_0x29316b[_0xefa4('0x4a')]]=_0x1b1927;this['emitVoiceQueueChannelRemove'](_0x1b1927,_0xefa4('0x21'));}}}catch(_0x32cd1f){logger[_0xefa4('0x3e')](_0xefa4('0x94'),_0x29316b[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x32cd1f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')]['syncVarSet']=function(_0x57131b){try{if(this[_0xefa4('0x6f')](_0x57131b)){logger[_0xefa4('0x50')](_0xefa4('0xa6'),_0x57131b[_0xefa4('0x4a')],util['inspect'](_0x57131b,{'showHidden':![],'depth':null}));this[_0xefa4('0xa7')](_0x57131b[_0xefa4('0x4a')],_[_0xefa4('0xa8')](_0x57131b['variable'])[0x0],_0x57131b[_0xefa4('0xa9')]);if(this['queueReports'][_0x57131b[_0xefa4('0x4a')]]){var _0x4c5ef0=_[_0xefa4('0x84')](this['queueReports'][_0x57131b[_0xefa4('0x4a')]]);if(_0x4c5ef0){if(this['isNotNull'](_0x57131b[_0xefa4('0xaa')])&&this[_0xefa4('0x6f')](_0x57131b[_0xefa4('0xaa')][_0xefa4('0xab')])){switch(_0x57131b[_0xefa4('0xa9')]){case'CONTINUE':_0x4c5ef0[_0xefa4('0x96')]=![];_0x4c5ef0[_0xefa4('0x97')]=null;break;case'TIMEOUT':_0x4c5ef0['lastevent']='timeout';_0x4c5ef0['queuecallerexit']=!![];_0x4c5ef0['queuecallerexitAt']=moment()['format'](_0xefa4('0x89'));_0x4c5ef0[_0xefa4('0x8f')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));logger[_0xefa4('0x50')](_0xefa4('0xac'),_0x57131b[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x4c5ef0,{'showHidden':![],'depth':null}));ami[_0xefa4('0x47')]('custom:timeout',_0x4c5ef0);break;default:_0x4c5ef0[_0xefa4('0x96')]=!![];_0x4c5ef0[_0xefa4('0x97')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));_0x4c5ef0['queuecallerleaveAt']=moment()['format'](_0xefa4('0x89'));}_0x4c5ef0[_0xefa4('0x1d')]=![];_0x4c5ef0[_0xefa4('0x88')]=null;_0x4c5ef0[_0xefa4('0x8a')]=_0x57131b[_0xefa4('0xa9')];this[_0xefa4('0x12')][_0x57131b[_0xefa4('0x4a')]]=_0x4c5ef0;this[_0xefa4('0x4f')](_0x4c5ef0,_0xefa4('0x24'));}else if(this[_0xefa4('0x6f')](_0x57131b[_0xefa4('0xaa')])&&this['isNotNull'](_0x57131b[_0xefa4('0xaa')]['queueposition'])){if(!_0x4c5ef0[_0xefa4('0x1d')]){_0x4c5ef0[_0xefa4('0x96')]=!![];_0x4c5ef0[_0xefa4('0x97')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));_0x4c5ef0[_0xefa4('0x8a')]=_0xefa4('0xad');_0x4c5ef0[_0xefa4('0x8f')]=moment()[_0xefa4('0x52')](_0xefa4('0x89'));this[_0xefa4('0x12')][_0x57131b[_0xefa4('0x4a')]]=_0x4c5ef0;}}logger[_0xefa4('0x71')](_0xefa4('0xae'),_0x57131b[_0xefa4('0x4a')],_0x4c5ef0[_0xefa4('0x4c')],_0x4c5ef0[_0xefa4('0x5f')],_['keys'](_0x57131b['variable'])[0x0],_0x57131b[_0xefa4('0xa9')]);_0x4c5ef0['variables']=this[_0xefa4('0x16')][_0x57131b[_0xefa4('0x4a')]];}}}}catch(_0x201420){logger[_0xefa4('0x3e')](_0xefa4('0xa6'),_0x57131b[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x201420,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0xa7')]=function(_0x4bca31,_0x5e69db,_0x44663e){var _0x289118=[_0xefa4('0xaf'),_0xefa4('0xb0'),_0xefa4('0xb1'),_0xefa4('0xb2'),_0xefa4('0xb3'),_0xefa4('0xb4'),_0xefa4('0xb5'),'rtpaudioqosrttbridged','sipcallid',_0xefa4('0xb6'),'bridgepeer',_0xefa4('0xb7'),_0xefa4('0xb8'),_0xefa4('0xb9'),_0xefa4('0xba'),_0xefa4('0xbb'),'membername',_0xefa4('0xbc'),'memberrealtime'];if(!_[_0xefa4('0xbd')](_0x5e69db)&&!_['includes'](_0x289118,_0x5e69db)){if(_[_0xefa4('0x69')](this[_0xefa4('0x16')][_0x4bca31])){this['variables'][_0x4bca31]={};}this[_0xefa4('0x16')][_0x4bca31][_0x5e69db]=_0x44663e;}};VoiceQueueReport[_0xefa4('0xc')][_0xefa4('0x27')]=function(_0x4381ac){try{if(this[_0xefa4('0x6f')](_0x4381ac)){logger['debug'](_0xefa4('0xbe'),_0x4381ac[_0xefa4('0x4a')],util[_0xefa4('0x40')](_0x4381ac,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4381ac[_0xefa4('0x4a')]]){for(var _0x26d33f=0x0,_0x34830e={};_0x26d33f=0x0?moment(_0x53ccd0[_0x288f('0x18')])['diff'](_0x53ccd0[_0x288f('0x17')],_0x288f('0xf')):null,'data1':_0x288f('0x19'),'data2':_0x53ccd0['accountcode'],'data3':_0x53ccd0['exten'],'data4':_0x53ccd0['dialstring']||null,'role':_0x288f('0x13'),'internal':_0x53ccd0[_0x288f('0x14')]?_[_0x288f('0x1a')](_0x53ccd0['accountcode']):undefined,'uniqueid':_0x53ccd0[_0x288f('0x1b')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0x9c0c=['dialstring','moment','lodash','../client','voiceQueueReport','queuecallercompleteAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','SIP/%s','diff','queuecallerleaveAt','seconds','inbound','queue','agent','accountcode','toNumber','uniqueid','voiceDialReport','membername','endtime','starttime','outbound','exten'];(function(_0x389d67,_0x593234){var _0x3bafb2=function(_0x25e87b){while(--_0x25e87b){_0x389d67['push'](_0x389d67['shift']());}};_0x3bafb2(++_0x593234);}(_0x9c0c,0x1b4));var _0xc9c0=function(_0x4392af,_0xec5afe){_0x4392af=_0x4392af-0x0;var _0x9fa8eb=_0x9c0c[_0x4392af];return _0x9fa8eb;};'use strict';var moment=require(_0xc9c0('0x0'));var _=require(_0xc9c0('0x1'));var util=require('util');var client=require(_0xc9c0('0x2'));exports[_0xc9c0('0x3')]=function(_0x4db735){var _0x2d4d17=_0x4db735[_0xc9c0('0x4')]||_0x4db735['queuecallerexitAt'];return client[_0xc9c0('0x5')](_0xc9c0('0x6'),{'body':{'channel':_0xc9c0('0x7'),'membername':_0x4db735[_0xc9c0('0x8')],'interface':_[_0xc9c0('0x9')](_0x4db735[_0xc9c0('0xa')])?util[_0xc9c0('0xb')](_0xc9c0('0xc'),_0x4db735['lastAssignedTo']):_0x4db735['interface'],'type':'TALKING','enterAt':_0x4db735['queuecallerleaveAt'],'exitAt':_0x2d4d17,'duration':moment(_0x2d4d17)[_0xc9c0('0xd')](_0x4db735[_0xc9c0('0xe')],_0xc9c0('0xf')),'data1':_0xc9c0('0x10'),'data2':_0x4db735['calleridnum'],'data3':_0x4db735['exten'],'data4':null,'data5':_0x4db735[_0xc9c0('0x11')],'role':_0xc9c0('0x12'),'internal':_0x4db735[_0xc9c0('0x13')]?_[_0xc9c0('0x14')](_0x4db735[_0xc9c0('0x13')]):undefined,'uniqueid':_0x4db735[_0xc9c0('0x15')]},'log':_0xc9c0('0x6')});};exports[_0xc9c0('0x16')]=function(_0x1ab4ab){return client[_0xc9c0('0x5')](_0xc9c0('0x6'),{'body':{'channel':_0xc9c0('0x7'),'membername':_0x1ab4ab[_0xc9c0('0x17')],'interface':_0x1ab4ab[_0xc9c0('0xa')],'type':'TALKING','enterAt':_0x1ab4ab['starttime'],'exitAt':_0x1ab4ab[_0xc9c0('0x18')],'duration':moment(_0x1ab4ab[_0xc9c0('0x18')])[_0xc9c0('0xd')](_0x1ab4ab['starttime'],_0xc9c0('0xf'))>=0x0?moment(_0x1ab4ab[_0xc9c0('0x18')])['diff'](_0x1ab4ab[_0xc9c0('0x19')],_0xc9c0('0xf')):null,'data1':_0xc9c0('0x1a'),'data2':_0x1ab4ab[_0xc9c0('0x13')],'data3':_0x1ab4ab[_0xc9c0('0x1b')],'data4':_0x1ab4ab[_0xc9c0('0x1c')]||null,'role':_0xc9c0('0x12'),'internal':_0x1ab4ab[_0xc9c0('0x13')]?_['toNumber'](_0x1ab4ab[_0xc9c0('0x13')]):undefined,'uniqueid':_0x1ab4ab['uniqueid']},'log':_0xc9c0('0x6')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index acb0b57..dd45916 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 _0xf69b=['ShowSetting','GetSettings','getSettings'];(function(_0x58d895,_0xb10a30){var _0x25243e=function(_0xaef010){while(--_0xaef010){_0x58d895['push'](_0x58d895['shift']());}};_0x25243e(++_0xb10a30);}(_0xf69b,0xc8));var _0xbf69=function(_0x2944b1,_0x314dd5){_0x2944b1=_0x2944b1-0x0;var _0x330ccb=_0xf69b[_0x2944b1];return _0x330ccb;};'use strict';var client=require('../client');exports[_0xbf69('0x0')]=function(){return client['Request'](_0xbf69('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['stopRecordingOnTransfer']},'log':_0xbf69('0x2')});}; \ No newline at end of file +var _0xe827=['stopRecordingOnTransfer','GetSettings','../client','getSettings','Request'];(function(_0x2c1f91,_0xab29cc){var _0x25414d=function(_0x3e529b){while(--_0x3e529b){_0x2c1f91['push'](_0x2c1f91['shift']());}};_0x25414d(++_0xab29cc);}(_0xe827,0x1dd));var _0x7e82=function(_0x23b606,_0x3daf24){_0x23b606=_0x23b606-0x0;var _0x115bc8=_0xe827[_0x23b606];return _0x115bc8;};'use strict';var client=require(_0x7e82('0x0'));exports[_0x7e82('0x1')]=function(){return client[_0x7e82('0x2')]('ShowSetting',{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x7e82('0x3')]},'log':_0x7e82('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 7f4738a..1438feb 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 _0xace1=['html','Request','GetTemplate'];(function(_0x2c7618,_0x26be9c){var _0x5ce3f0=function(_0x1837b3){while(--_0x1837b3){_0x2c7618['push'](_0x2c7618['shift']());}};_0x5ce3f0(++_0x26be9c);}(_0xace1,0x11b));var _0x1ace=function(_0xdc4440,_0xb71dba){_0xdc4440=_0xdc4440-0x0;var _0x8ab92b=_0xace1[_0xdc4440];return _0x8ab92b;};'use strict';var client=require('../client');exports['getTemplates']=function(_0x3394c0){return function(_0x72c4e8){return client[_0x1ace('0x0')](_0x1ace('0x1'),{'options':{'raw':!![],'attributes':['id','name',_0x1ace('0x2')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0xea63=['../client','getTemplates','Request','GetTemplate','name','html'];(function(_0x5286fa,_0x5075d8){var _0x34439c=function(_0x30015e){while(--_0x30015e){_0x5286fa['push'](_0x5286fa['shift']());}};_0x34439c(++_0x5075d8);}(_0xea63,0x138));var _0x3ea6=function(_0x1fa1b2,_0x410f94){_0x1fa1b2=_0x1fa1b2-0x0;var _0xc3c874=_0xea63[_0x1fa1b2];return _0xc3c874;};'use strict';var client=require(_0x3ea6('0x0'));exports[_0x3ea6('0x1')]=function(_0x47ad73){return function(_0x2ea38f){return client[_0x3ea6('0x2')](_0x3ea6('0x3'),{'options':{'raw':!![],'attributes':['id',_0x3ea6('0x4'),_0x3ea6('0x5')]},'log':_0x3ea6('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index c80e5e8..fb5b132 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 _0x6790=['getTriggers','Request','GetTrigger','name','status','Condition','AllConditions','field','operator','value','Actions','action','data2','data4','data5','data6','data7'];(function(_0x582db3,_0x4a7a22){var _0x4f920f=function(_0x40b4e6){while(--_0x40b4e6){_0x582db3['push'](_0x582db3['shift']());}};_0x4f920f(++_0x4a7a22);}(_0x6790,0xaa));var _0x0679=function(_0x21bd79,_0x2903e3){_0x21bd79=_0x21bd79-0x0;var _0x576a34=_0x6790[_0x21bd79];return _0x576a34;};'use strict';var client=require('../client');exports[_0x0679('0x0')]=function(_0x15a1a8){return function(_0x20aeb9){return client[_0x0679('0x1')](_0x0679('0x2'),{'options':{'raw':![],'attributes':['id',_0x0679('0x3'),'channel',_0x0679('0x4')],'include':[{'model':_0x0679('0x5'),'as':_0x0679('0x6'),'attributes':['id',_0x0679('0x7'),_0x0679('0x8'),_0x0679('0x9')]},{'model':_0x0679('0x5'),'as':'AnyConditions','attributes':['id',_0x0679('0x7'),_0x0679('0x8'),_0x0679('0x9')]},{'model':'Action','as':_0x0679('0xa'),'attributes':['id',_0x0679('0xb'),'data1',_0x0679('0xc'),'data3',_0x0679('0xd'),_0x0679('0xe'),_0x0679('0xf'),_0x0679('0x10')]}]},'log':_0x0679('0x2')});};}; \ No newline at end of file +var _0xa16d=['getTriggers','GetTrigger','name','channel','Condition','field','operator','value','Actions','action','data2','data3','data4','data5','data7','../client'];(function(_0x40f13b,_0x21cbde){var _0x2b54de=function(_0x31495f){while(--_0x31495f){_0x40f13b['push'](_0x40f13b['shift']());}};_0x2b54de(++_0x21cbde);}(_0xa16d,0x1af));var _0xda16=function(_0x623e7,_0x1bef7d){_0x623e7=_0x623e7-0x0;var _0x121131=_0xa16d[_0x623e7];return _0x121131;};'use strict';var client=require(_0xda16('0x0'));exports[_0xda16('0x1')]=function(_0x216969){return function(_0x58a91f){return client['Request'](_0xda16('0x2'),{'options':{'raw':![],'attributes':['id',_0xda16('0x3'),_0xda16('0x4'),'status'],'include':[{'model':_0xda16('0x5'),'as':'AllConditions','attributes':['id',_0xda16('0x6'),_0xda16('0x7'),'value']},{'model':'Condition','as':'AnyConditions','attributes':['id',_0xda16('0x6'),_0xda16('0x7'),_0xda16('0x8')]},{'model':'Action','as':_0xda16('0x9'),'attributes':['id',_0xda16('0xa'),'data1',_0xda16('0xb'),_0xda16('0xc'),_0xda16('0xd'),_0xda16('0xe'),'data6',_0xda16('0xf')]}]},'log':_0xda16('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index b1c543d..3fa9be2 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 _0x6dd1=['name','registry','defaultuser','../client','GetTrunk'];(function(_0x508439,_0x4d0e02){var _0x48d406=function(_0x34dce0){while(--_0x34dce0){_0x508439['push'](_0x508439['shift']());}};_0x48d406(++_0x4d0e02);}(_0x6dd1,0x111));var _0x16dd=function(_0x3c7b47,_0x2955c1){_0x3c7b47=_0x3c7b47-0x0;var _0x29a38e=_0x6dd1[_0x3c7b47];return _0x29a38e;};'use strict';var client=require(_0x16dd('0x0'));exports['getTrunks']=function(_0x873e12){return function(_0x2ac0c9){return client['Request'](_0x16dd('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x16dd('0x2'),_0x16dd('0x3'),_0x16dd('0x4')]},'log':_0x16dd('0x1')});};}; \ No newline at end of file +var _0x048c=['GetTrunk','name','defaultuser','../client'];(function(_0x14f50a,_0x495c28){var _0x5258e7=function(_0x362ec4){while(--_0x362ec4){_0x14f50a['push'](_0x14f50a['shift']());}};_0x5258e7(++_0x495c28);}(_0x048c,0xdb));var _0xc048=function(_0x4879ce,_0x31a755){_0x4879ce=_0x4879ce-0x0;var _0x36392e=_0x048c[_0x4879ce];return _0x36392e;};'use strict';var client=require(_0xc048('0x0'));exports['getTrunks']=function(_0x5a1c87){return function(_0x237e05){return client['Request'](_0xc048('0x1'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xc048('0x2'),'registry',_0xc048('0x3')]},'log':_0xc048('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b8e024c..be5b059 100644 --- a/server/services/ami/rpc/user.js +++ b/server/services/ami/rpc/user.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['online','pauseType','Request','GetUser','agent','name','email','accountcode','lastLoginAt','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','internal','PauseUser','savePause','getAgent','ShowUser','fullname'];(function(_0x9a173d,_0x1af775){var _0x1b9a2f=function(_0xcdca5){while(--_0xcdca5){_0x9a173d['push'](_0x9a173d['shift']());}};_0x1b9a2f(++_0x1af775);}(_0x9c44,0x178));var _0x49c4=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x9c44[_0x5f1391];return _0x50ebe3;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2')},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5'),'fullname','online',_0x49c4('0x6'),'pauseType',_0x49c4('0x7'),_0x49c4('0x8'),_0x49c4('0x9'),_0x49c4('0xa'),_0x49c4('0xb')]},'log':'getAgents'});};};exports[_0x49c4('0xc')]=function(){return function(){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'options':{'raw':!![],'where':{'role':_0x49c4('0xd')},'attributes':['id','name','accountcode',_0x49c4('0xe')]},'log':_0x49c4('0xc')});};};exports['savePause']=function(_0xb611a1,_0x459d09,_0x4adb3c){return client['Request'](_0x49c4('0xf'),{'body':{'type':_0x459d09,'uniqueid':_0x4adb3c},'options':{'where':{'id':_0xb611a1['id']}},'log':_0x49c4('0x10')});};exports['saveUnpause']=function(_0x7df3a9){return client[_0x49c4('0x0')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x7df3a9['id']}},'log':_0x49c4('0x10')});};exports[_0x49c4('0x11')]=function(_0x21f15a){return client[_0x49c4('0x0')](_0x49c4('0x12'),{'options':{'raw':![],'where':{'role':_0x49c4('0x2'),'id':_0x21f15a},'attributes':['id',_0x49c4('0x3'),_0x49c4('0x4'),'accountcode',_0x49c4('0x13'),_0x49c4('0x14'),_0x49c4('0x6'),_0x49c4('0x15'),_0x49c4('0x7'),'voicePause',_0x49c4('0xb')]},'log':_0x49c4('0x11')});}; \ No newline at end of file +var _0xcb91=['UnpauseUser','getAgent','ShowUser','email','lastPauseAt','Request','GetUser','agent','name','accountcode','fullname','lastLoginAt','pauseType','voicePause','phone','interface','getAgents','internal','getTelephones','savePause','PauseUser'];(function(_0x4fdedd,_0x4ccbbf){var _0x2720c4=function(_0x43fb52){while(--_0x43fb52){_0x4fdedd['push'](_0x4fdedd['shift']());}};_0x2720c4(++_0x4ccbbf);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4bb2b9,_0x459c78){_0x4bb2b9=_0x4bb2b9-0x0;var _0x40e2a2=_0xcb91[_0x4bb2b9];return _0x40e2a2;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client[_0x1cb9('0x0')](_0x1cb9('0x1'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2')},'attributes':['id',_0x1cb9('0x3'),'email',_0x1cb9('0x4'),_0x1cb9('0x5'),'online',_0x1cb9('0x6'),_0x1cb9('0x7'),'lastPauseAt',_0x1cb9('0x8'),_0x1cb9('0x9'),'mobile',_0x1cb9('0xa')]},'log':_0x1cb9('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x1cb9('0x0')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x4'),_0x1cb9('0xc')]},'log':_0x1cb9('0xd')});};};exports[_0x1cb9('0xe')]=function(_0x50ce71,_0x9b58f1,_0x44a6b4){return client[_0x1cb9('0x0')](_0x1cb9('0xf'),{'body':{'type':_0x9b58f1,'uniqueid':_0x44a6b4},'options':{'where':{'id':_0x50ce71['id']}},'log':_0x1cb9('0xe')});};exports['saveUnpause']=function(_0x5e3c19){return client['Request'](_0x1cb9('0x10'),{'body':{},'options':{'where':{'id':_0x5e3c19['id']}},'log':_0x1cb9('0xe')});};exports[_0x1cb9('0x11')]=function(_0x1c714f){return client['Request'](_0x1cb9('0x12'),{'options':{'raw':![],'where':{'role':_0x1cb9('0x2'),'id':_0x1c714f},'attributes':['id',_0x1cb9('0x3'),_0x1cb9('0x13'),_0x1cb9('0x4'),'fullname','online',_0x1cb9('0x6'),_0x1cb9('0x7'),_0x1cb9('0x14'),_0x1cb9('0x8'),_0x1cb9('0xa')]},'log':_0x1cb9('0x11')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 15d668c..767afed 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 _0xd224=['update','UpdateVoiceAgentReport','../client','Request','CreateVoiceAgentReport'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xd224,0xfc));var _0x4d22=function(_0x43ad64,_0x5ed8c6){_0x43ad64=_0x43ad64-0x0;var _0x2f4ba7=_0xd224[_0x43ad64];return _0x2f4ba7;};'use strict';var client=require(_0x4d22('0x0'));exports['create']=function(_0x576774){return client[_0x4d22('0x1')](_0x4d22('0x2'),{'body':_0x576774,'log':'CreateVoiceAgentReport'});};exports[_0x4d22('0x3')]=function(_0x18c053,_0x204e99,_0xf6a8c9){return client[_0x4d22('0x1')]('UpdateVoiceAgentReport',{'body':_0x18c053,'options':{'where':{'uniqueid':_0x204e99,'interface':_0xf6a8c9,'agentcomplete':!![]}},'log':_0x4d22('0x4')});}; \ No newline at end of file +var _0x7a5e=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x509773,_0x12434e){var _0x194f82=function(_0x5eda6d){while(--_0x5eda6d){_0x509773['push'](_0x509773['shift']());}};_0x194f82(++_0x12434e);}(_0x7a5e,0x1a7));var _0xe7a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7a5e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe7a5('0x0'));exports[_0xe7a5('0x1')]=function(_0x54de13){return client[_0xe7a5('0x2')](_0xe7a5('0x3'),{'body':_0x54de13,'log':_0xe7a5('0x3')});};exports[_0xe7a5('0x4')]=function(_0x206859,_0x54bce5,_0x4dfcc8){return client[_0xe7a5('0x2')](_0xe7a5('0x5'),{'body':_0x206859,'options':{'where':{'uniqueid':_0x54bce5,'interface':_0x4dfcc8,'agentcomplete':!![]}},'log':_0xe7a5('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index ce5fbec..15c67d2 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 _0x26d9=['context','callerid','DOCUMENTATION','GetVoiceCallReport','outbound','startOf','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','moment','lodash','create','Request','CreateVoiceCallReport'];(function(_0x34d460,_0x429ea8){var _0x4e03e9=function(_0x189e80){while(--_0x189e80){_0x34d460['push'](_0x34d460['shift']());}};_0x4e03e9(++_0x429ea8);}(_0x26d9,0x1ae));var _0x926d=function(_0x300d64,_0x187cb4){_0x300d64=_0x300d64-0x0;var _0x413fe5=_0x26d9[_0x300d64];return _0x413fe5;};'use strict';var moment=require(_0x926d('0x0'));var util=require('util');var _=require(_0x926d('0x1'));var client=require('../client');exports[_0x926d('0x2')]=function(_0x95ad72){return client[_0x926d('0x3')](_0x926d('0x4'),{'body':_['merge'](_0x95ad72,{'source':_0x95ad72['calleridnum'],'destinationcontext':_0x95ad72[_0x926d('0x5')],'callerid':_0x95ad72[_0x926d('0x6')],'amaflags':_0x926d('0x7')}),'log':_0x926d('0x4')});};exports['getVoiceCallReports']=function(){return function(){return client[_0x926d('0x3')](_0x926d('0x8'),{'options':{'where':{'type':[_0x926d('0x9')],'createdAt':{'$between':[moment()[_0x926d('0xa')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x926d('0xb')]('day')['format'](_0x926d('0xc'))]}},'attributes':['type',_0x926d('0xd'),_0x926d('0xe'),'billableseconds']},'log':'GetVoiceCallReports'});};}; \ No newline at end of file +var _0x232b=['moment','util','create','Request','CreateVoiceCallReport','calleridnum','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','disposition','duration','billableseconds','GetVoiceCallReports'];(function(_0x4e479b,_0x2478e7){var _0x32c31a=function(_0x225f6b){while(--_0x225f6b){_0x4e479b['push'](_0x4e479b['shift']());}};_0x32c31a(++_0x2478e7);}(_0x232b,0xc6));var _0xb232=function(_0x48dd1d,_0x3fd1fd){_0x48dd1d=_0x48dd1d-0x0;var _0x3b5665=_0x232b[_0x48dd1d];return _0x3b5665;};'use strict';var moment=require(_0xb232('0x0'));var util=require(_0xb232('0x1'));var _=require('lodash');var client=require('../client');exports[_0xb232('0x2')]=function(_0x3dc9cd){return client[_0xb232('0x3')](_0xb232('0x4'),{'body':_['merge'](_0x3dc9cd,{'source':_0x3dc9cd[_0xb232('0x5')],'destinationcontext':_0x3dc9cd['context'],'callerid':_0x3dc9cd['callerid'],'amaflags':_0xb232('0x6')}),'log':_0xb232('0x4')});};exports[_0xb232('0x7')]=function(){return function(){return client[_0xb232('0x3')](_0xb232('0x8'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0xb232('0x9')](_0xb232('0xa'))[_0xb232('0xb')](_0xb232('0xc')),moment()[_0xb232('0xd')](_0xb232('0xa'))[_0xb232('0xb')](_0xb232('0xc'))]}},'attributes':['type',_0xb232('0xe'),_0xb232('0xf'),_0xb232('0x10')]},'log':_0xb232('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index f60848d..64779dd 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 _0x9e27=['CreateVoiceDialReport','../client','create'];(function(_0x5721f2,_0x3562f0){var _0x504044=function(_0xe71456){while(--_0xe71456){_0x5721f2['push'](_0x5721f2['shift']());}};_0x504044(++_0x3562f0);}(_0x9e27,0x199));var _0x79e2=function(_0x129040,_0x3eb998){_0x129040=_0x129040-0x0;var _0x3b6e59=_0x9e27[_0x129040];return _0x3b6e59;};'use strict';var client=require(_0x79e2('0x0'));exports[_0x79e2('0x1')]=function(_0x4a1afd){return client['Request']('CreateVoiceDialReport',{'body':_0x4a1afd,'log':_0x79e2('0x2')});}; \ No newline at end of file +var _0xeadb=['create','Request','CreateVoiceDialReport','../client'];(function(_0x4bbd9d,_0x5eb616){var _0x56c4cb=function(_0x591a8e){while(--_0x591a8e){_0x4bbd9d['push'](_0x4bbd9d['shift']());}};_0x56c4cb(++_0x5eb616);}(_0xeadb,0xe7));var _0xbead=function(_0x2e221e,_0x362329){_0x2e221e=_0x2e221e-0x0;var _0x558d71=_0xeadb[_0x2e221e];return _0x558d71;};'use strict';var client=require(_0xbead('0x0'));exports[_0xbead('0x1')]=function(_0xa96df5){return client[_0xbead('0x2')](_0xbead('0x3'),{'body':_0xa96df5,'log':_0xbead('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 4c7689d..0cc1602 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 _0x1ddc=['GetVoiceExtension','recordingFormat','getVoiceExtensions','Request'];(function(_0x2b6676,_0x3f94b6){var _0xafd0ec=function(_0x8235ac){while(--_0x8235ac){_0x2b6676['push'](_0x2b6676['shift']());}};_0xafd0ec(++_0x3f94b6);}(_0x1ddc,0x6e));var _0xc1dd=function(_0x39ded0,_0x5774a5){_0x39ded0=_0x39ded0-0x0;var _0x3c21df=_0x1ddc[_0x39ded0];return _0x3c21df;};'use strict';var client=require('../client');exports[_0xc1dd('0x0')]=function(){return function(){return client[_0xc1dd('0x1')](_0xc1dd('0x2'),{'options':{'raw':!![],'attributes':['id','exten',_0xc1dd('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xc1dd('0x0')});};}; \ No newline at end of file +var _0x1d5b=['../client','getVoiceExtensions','Request','exten'];(function(_0x4da6ba,_0x554ea7){var _0x4b8317=function(_0x573de2){while(--_0x573de2){_0x4da6ba['push'](_0x4da6ba['shift']());}};_0x4b8317(++_0x554ea7);}(_0x1d5b,0x13c));var _0xb1d5=function(_0x2ebb42,_0x9bdd7){_0x2ebb42=_0x2ebb42-0x0;var _0x61d704=_0x1d5b[_0x2ebb42];return _0x61d704;};'use strict';var client=require(_0xb1d5('0x0'));exports[_0xb1d5('0x1')]=function(){return function(){return client[_0xb1d5('0x2')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xb1d5('0x3'),'recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xb1d5('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 80d9389..d4b99b6 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 _0x4cff=['dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialAbandonedMaxRetry','dialMachineMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','dialPreviewAutoRecallMe','Trunk','name','active','Pause','mandatoryDispositionPause','TrunkBackup','callerid','Interval','Intervals','../client','getVoiceQueues','GetVoiceQueue','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialTimezone'];(function(_0x171775,_0x48b2f9){var _0x2d75fa=function(_0x26bd8b){while(--_0x26bd8b){_0x171775['push'](_0x171775['shift']());}};_0x2d75fa(++_0x48b2f9);}(_0x4cff,0x14a));var _0xf4cf=function(_0x3cf7ef,_0x4c9bbc){_0x3cf7ef=_0x3cf7ef-0x0;var _0x2562b5=_0x4cff[_0x3cf7ef];return _0x2562b5;};'use strict';var client=require(_0xf4cf('0x0'));exports[_0xf4cf('0x1')]=function(){return function(){return client['Request'](_0xf4cf('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xf4cf('0x3'),_0xf4cf('0x4'),'autopause',_0xf4cf('0x5'),_0xf4cf('0x6'),_0xf4cf('0x7'),_0xf4cf('0x8'),_0xf4cf('0x9'),_0xf4cf('0xa'),'dialPowerLevel',_0xf4cf('0xb'),_0xf4cf('0xc'),_0xf4cf('0xd'),_0xf4cf('0xe'),'dialOriginateCallerIdNumber',_0xf4cf('0xf'),_0xf4cf('0x10'),_0xf4cf('0x11'),_0xf4cf('0x12'),'dialCongestionMaxRetry',_0xf4cf('0x13'),_0xf4cf('0x14'),_0xf4cf('0x15'),_0xf4cf('0x16'),'dialNoAnswerRetryFrequency','dialGlobalMaxRetry',_0xf4cf('0x17'),'dialGlobalInterval','dialPrefix','dialCheckDuplicateType',_0xf4cf('0x18'),_0xf4cf('0x19'),_0xf4cf('0x1a'),_0xf4cf('0x1b'),_0xf4cf('0x1c'),_0xf4cf('0x1d'),_0xf4cf('0x1e'),_0xf4cf('0x1f'),_0xf4cf('0x20'),_0xf4cf('0x21'),'timeout',_0xf4cf('0x22'),_0xf4cf('0x23'),_0xf4cf('0x24'),_0xf4cf('0x25'),_0xf4cf('0x26'),_0xf4cf('0x27'),_0xf4cf('0x5'),'strategy',_0xf4cf('0x28'),_0xf4cf('0x29'),_0xf4cf('0x2a'),'dialNoSuchNumberRetryFrequency',_0xf4cf('0x2b'),'dialDropRetryFrequency',_0xf4cf('0x2c'),'dialAbandonedRetryFrequency',_0xf4cf('0x2d'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency',_0xf4cf('0x2e'),_0xf4cf('0x2f'),_0xf4cf('0x30'),_0xf4cf('0x31')],'include':[{'model':_0xf4cf('0x32'),'as':_0xf4cf('0x32'),'attributes':['id',_0xf4cf('0x33'),'callerid',_0xf4cf('0x34')]},{'model':_0xf4cf('0x35'),'as':_0xf4cf('0x36'),'attributes':['id',_0xf4cf('0x33')]},{'model':_0xf4cf('0x32'),'as':_0xf4cf('0x37'),'attributes':['id','name',_0xf4cf('0x38'),_0xf4cf('0x34')]},{'model':'Interval','as':_0xf4cf('0x39'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0xf4cf('0x3a'),'attributes':['id',_0xf4cf('0x33'),'interval']}]}]},'log':_0xf4cf('0x1')});};}; \ No newline at end of file +var _0xc627=['dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','dialQueueProject2','dialCutDigit','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPreviewAutoRecallMe','Trunk','name','callerid','active','Pause','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialBusyMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDMaximumWordLength'];(function(_0x447dbf,_0x9633d8){var _0x2e157b=function(_0x3b5545){while(--_0x3b5545){_0x447dbf['push'](_0x447dbf['shift']());}};_0x2e157b(++_0x9633d8);}(_0xc627,0x14a));var _0x7c62=function(_0x54162b,_0x5f1496){_0x54162b=_0x54162b-0x0;var _0x2dbb7e=_0xc627[_0x54162b];return _0x2dbb7e;};'use strict';var client=require('../client');exports[_0x7c62('0x0')]=function(){return function(){return client[_0x7c62('0x1')](_0x7c62('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x7c62('0x3'),_0x7c62('0x4'),_0x7c62('0x5'),_0x7c62('0x6'),_0x7c62('0x7'),_0x7c62('0x8'),_0x7c62('0x9'),_0x7c62('0xa'),_0x7c62('0xb'),_0x7c62('0xc'),_0x7c62('0xd'),_0x7c62('0xe'),'dialPredictiveInterval','dialOriginateCallerIdName',_0x7c62('0xf'),_0x7c62('0x10'),_0x7c62('0x11'),_0x7c62('0x12'),'dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency',_0x7c62('0x13'),'dialBusyRetryFrequency',_0x7c62('0x14'),_0x7c62('0x15'),_0x7c62('0x16'),_0x7c62('0x17'),_0x7c62('0x18'),_0x7c62('0x19'),_0x7c62('0x1a'),_0x7c62('0x1b'),_0x7c62('0x1c'),_0x7c62('0x1d'),_0x7c62('0x1e'),_0x7c62('0x1f'),_0x7c62('0x20'),_0x7c62('0x21'),_0x7c62('0x22'),'dialAMDSilenceThreshold',_0x7c62('0x23'),'timeout',_0x7c62('0x24'),'dialRecallInQueue',_0x7c62('0x25'),_0x7c62('0x26'),_0x7c62('0x27'),_0x7c62('0x28'),_0x7c62('0x6'),'strategy','dialRandomLastDigitCallerIdNumber',_0x7c62('0x29'),'dialNoSuchNumberMaxRetry',_0x7c62('0x2a'),_0x7c62('0x2b'),_0x7c62('0x2c'),_0x7c62('0x2d'),_0x7c62('0x2e'),_0x7c62('0x2f'),'dialMachineRetryFrequency','dialAgentRejectMaxRetry',_0x7c62('0x30'),_0x7c62('0x31'),_0x7c62('0x32'),'dialPredictiveIntervalMinThreshold',_0x7c62('0x33')],'include':[{'model':_0x7c62('0x34'),'as':_0x7c62('0x34'),'attributes':['id',_0x7c62('0x35'),_0x7c62('0x36'),_0x7c62('0x37')]},{'model':_0x7c62('0x38'),'as':'mandatoryDispositionPause','attributes':['id',_0x7c62('0x35')]},{'model':_0x7c62('0x34'),'as':_0x7c62('0x39'),'attributes':['id',_0x7c62('0x35'),_0x7c62('0x36'),_0x7c62('0x37')]},{'model':_0x7c62('0x3a'),'as':_0x7c62('0x3a'),'attributes':['id',_0x7c62('0x35')],'include':[{'model':_0x7c62('0x3a'),'as':_0x7c62('0x3b'),'attributes':['id',_0x7c62('0x35'),_0x7c62('0x3c')]}]}]},'log':_0x7c62('0x0')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index a35de13..cdda62e 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(_0x376922,_0x6809a5){var _0x3950e6=function(_0x41ec7a){while(--_0x41ec7a){_0x376922['push'](_0x376922['shift']());}};_0x3950e6(++_0x6809a5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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(_0x320530,_0x2664dd){var _0x4d4714=function(_0x12437a){while(--_0x12437a){_0x320530['push'](_0x320530['shift']());}};_0x4d4714(++_0x2664dd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 9417ec9..200f191 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 _0x3206=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x65c903,_0x41e920){var _0x23e1d7=function(_0x4279cd){while(--_0x4279cd){_0x65c903['push'](_0x65c903['shift']());}};_0x23e1d7(++_0x41e920);}(_0x3206,0x71));var _0x6320=function(_0x5c28d3,_0x349cc2){_0x5c28d3=_0x5c28d3-0x0;var _0x2d0e08=_0x3206[_0x5c28d3];return _0x2d0e08;};'use strict';var client=require(_0x6320('0x0'));exports[_0x6320('0x1')]=function(_0x131218){return function(){return client[_0x6320('0x2')](_0x6320('0x3'),{'options':{'where':{'VoiceQueueId':_0x131218,'paused':!![]},'raw':!![]},'log':_0x6320('0x1')});};}; \ No newline at end of file +var _0xc944=['Request','GetVoiceQueueRtPauses','getVoiceQueueRtPauses','../client'];(function(_0x3b0399,_0x28efe0){var _0x566630=function(_0x3083c5){while(--_0x3083c5){_0x3b0399['push'](_0x3b0399['shift']());}};_0x566630(++_0x28efe0);}(_0xc944,0x167));var _0x4c94=function(_0x3add82,_0x3a56a4){_0x3add82=_0x3add82-0x0;var _0x1b7b71=_0xc944[_0x3add82];return _0x1b7b71;};'use strict';var client=require(_0x4c94('0x0'));exports['getVoiceQueueRtPauses']=function(_0xfe2e5c){return function(){return client[_0x4c94('0x1')](_0x4c94('0x2'),{'options':{'where':{'VoiceQueueId':_0xfe2e5c,'paused':!![]},'raw':!![]},'log':_0x4c94('0x3')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 29a5932..6f74c98 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x1b033b,_0x2c1ce5){var _0x5d7d41=function(_0x2912d7){while(--_0x2912d7){_0x1b033b['push'](_0x1b033b['shift']());}};_0x5d7d41(++_0x2c1ce5);}(_0x7a54,0x106));var _0x47a5=function(_0xfc8d81,_0x58f0a2){_0xfc8d81=_0xfc8d81-0x0;var _0xc5703b=_0x7a54[_0xfc8d81];return _0xc5703b;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x3ddf80,_0x345fc3){var _0x3e072d=function(_0x45e1d7){while(--_0x45e1d7){_0x3ddf80['push'](_0x3ddf80['shift']());}};_0x3e072d(++_0x345fc3);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index eeca581..3d1988c 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 _0x581b=['isexternal','origtransferercontext','origtransfererexten','attended','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','context','extension','blind','attendedTransfer','Request','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x581b,0xdc));var _0xb581=function(_0x311f44,_0x1d7f5b){_0x311f44=_0x311f44-0x0;var _0x46f1e6=_0x581b[_0x311f44];return _0x46f1e6;};'use strict';var client=require('../client');exports['transfers']={};exports[_0xb581('0x0')]=function(_0x23a0f0){return client['Request'](_0xb581('0x1'),{'body':{'result':_0x23a0f0[_0xb581('0x2')],'transfererchannel':_0x23a0f0[_0xb581('0x3')],'transferercalleridnum':_0x23a0f0[_0xb581('0x4')],'transferercalleridname':_0x23a0f0[_0xb581('0x5')],'transfererconnectedlinenum':_0x23a0f0[_0xb581('0x6')],'transfererconnectedlinename':_0x23a0f0[_0xb581('0x7')],'transfereraccountcode':_0x23a0f0['transfereraccountcode'],'transferercontext':_0x23a0f0[_0xb581('0x8')],'transfererexten':_0x23a0f0['transfererexten'],'transfererlinkedid':_0x23a0f0['transfererlinkedid'],'transfereechannel':_0x23a0f0['transfereechannel'],'transfereecalleridnum':_0x23a0f0[_0xb581('0x9')],'transfereecalleridname':_0x23a0f0['transfereecalleridname'],'transfereeconnectedlinenum':_0x23a0f0[_0xb581('0xa')],'transfereeconnectedlinename':_0x23a0f0[_0xb581('0xb')],'transfereeaccountcode':_0x23a0f0[_0xb581('0xc')],'transfereecontext':_0x23a0f0[_0xb581('0xd')],'transfereeexten':_0x23a0f0[_0xb581('0xe')],'transfereelinkedid':_0x23a0f0['transfereelinkedid'],'isexternal':_0x23a0f0['isexternal'],'context':_0x23a0f0[_0xb581('0xf')],'extension':_0x23a0f0[_0xb581('0x10')],'type':_0xb581('0x11')},'log':'CreateVoiceTransferReport'});};exports[_0xb581('0x12')]=function(_0x5cee3b){return client[_0xb581('0x13')](_0xb581('0x1'),{'body':{'result':_0x5cee3b[_0xb581('0x2')],'transfererchannel':_0x5cee3b[_0xb581('0x14')],'transferercalleridnum':_0x5cee3b['origtransferercalleridnum'],'transferercalleridname':_0x5cee3b[_0xb581('0x15')],'transfererconnectedlinenum':_0x5cee3b[_0xb581('0x16')],'transfererconnectedlinename':_0x5cee3b['secondtransfererconnectedlinename'],'transfereraccountcode':_0x5cee3b[_0xb581('0x17')],'transferercontext':_0x5cee3b[_0xb581('0x18')],'transfererexten':_0x5cee3b[_0xb581('0x19')],'transfererlinkedid':_0x5cee3b['origtransfererlinkedid'],'transfereechannel':_0x5cee3b[_0xb581('0x1a')],'transfereecalleridnum':_0x5cee3b[_0xb581('0x1b')],'transfereecalleridname':_0x5cee3b['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x5cee3b[_0xb581('0x1c')],'transfereeconnectedlinename':_0x5cee3b[_0xb581('0x1d')],'transfereeaccountcode':_0x5cee3b['transfertargetaccountcode'],'transfereecontext':_0x5cee3b[_0xb581('0x1e')],'transfereeexten':_0x5cee3b[_0xb581('0x1f')],'transfereelinkedid':_0x5cee3b['transfertargetlinkedid'],'isexternal':_0x5cee3b[_0xb581('0x20')],'context':_0x5cee3b[_0xb581('0x21')],'extension':_0x5cee3b[_0xb581('0x22')],'type':_0xb581('0x23')},'log':_0xb581('0x1')});}; \ No newline at end of file +var _0x731c=['transfertargetlinkedid','isexternal','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode','context','extension','blind','attendedTransfer','result','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x731c,0x1ef));var _0xc731=function(_0x1d84ab,_0x1a35dd){_0x1d84ab=_0x1d84ab-0x0;var _0x48c774=_0x731c[_0x1d84ab];return _0x48c774;};'use strict';var client=require(_0xc731('0x0'));exports['transfers']={};exports[_0xc731('0x1')]=function(_0x5ea2ce){return client[_0xc731('0x2')](_0xc731('0x3'),{'body':{'result':_0x5ea2ce['result'],'transfererchannel':_0x5ea2ce['transfererchannel'],'transferercalleridnum':_0x5ea2ce[_0xc731('0x4')],'transferercalleridname':_0x5ea2ce[_0xc731('0x5')],'transfererconnectedlinenum':_0x5ea2ce[_0xc731('0x6')],'transfererconnectedlinename':_0x5ea2ce[_0xc731('0x7')],'transfereraccountcode':_0x5ea2ce[_0xc731('0x8')],'transferercontext':_0x5ea2ce['transferercontext'],'transfererexten':_0x5ea2ce['transfererexten'],'transfererlinkedid':_0x5ea2ce['transfererlinkedid'],'transfereechannel':_0x5ea2ce[_0xc731('0x9')],'transfereecalleridnum':_0x5ea2ce[_0xc731('0xa')],'transfereecalleridname':_0x5ea2ce[_0xc731('0xb')],'transfereeconnectedlinenum':_0x5ea2ce['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x5ea2ce[_0xc731('0xc')],'transfereeaccountcode':_0x5ea2ce[_0xc731('0xd')],'transfereecontext':_0x5ea2ce['transfereecontext'],'transfereeexten':_0x5ea2ce['transfereeexten'],'transfereelinkedid':_0x5ea2ce['transfereelinkedid'],'isexternal':_0x5ea2ce['isexternal'],'context':_0x5ea2ce[_0xc731('0xe')],'extension':_0x5ea2ce[_0xc731('0xf')],'type':_0xc731('0x10')},'log':_0xc731('0x3')});};exports[_0xc731('0x11')]=function(_0x9d4330){return client[_0xc731('0x2')](_0xc731('0x3'),{'body':{'result':_0x9d4330[_0xc731('0x12')],'transfererchannel':_0x9d4330['origtransfererchannel'],'transferercalleridnum':_0x9d4330[_0xc731('0x13')],'transferercalleridname':_0x9d4330[_0xc731('0x14')],'transfererconnectedlinenum':_0x9d4330['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x9d4330[_0xc731('0x15')],'transfereraccountcode':_0x9d4330[_0xc731('0x16')],'transferercontext':_0x9d4330[_0xc731('0x17')],'transfererexten':_0x9d4330['secondtransfererexten'],'transfererlinkedid':_0x9d4330['origtransfererlinkedid'],'transfereechannel':_0x9d4330['transfertargetchannel'],'transfereecalleridnum':_0x9d4330[_0xc731('0x18')],'transfereecalleridname':_0x9d4330[_0xc731('0x19')],'transfereeconnectedlinenum':_0x9d4330[_0xc731('0x1a')],'transfereeconnectedlinename':_0x9d4330[_0xc731('0x1b')],'transfereeaccountcode':_0x9d4330['transfertargetaccountcode'],'transfereecontext':_0x9d4330[_0xc731('0x1c')],'transfereeexten':_0x9d4330[_0xc731('0x1d')],'transfereelinkedid':_0x9d4330[_0xc731('0x1e')],'isexternal':_0x9d4330[_0xc731('0x1f')],'context':_0x9d4330[_0xc731('0x20')],'extension':_0x9d4330[_0xc731('0x21')],'type':_0xc731('0x22')},'log':_0xc731('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index ddc5782..aa55bbb 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 _0xa0a1=['outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','omit','values','channels','length','voicechannel','channel','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','/var/spool/asterisk/monitor/','toLowerCase','mixmonitorid','rec','MixMonitor\x20Success','map','find','resolve','StopMixMonitor','destinationchannel','status','stop','monitors','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Channel\x20doesn\x27t\x20exist','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','context','outboundChannels','campaigns','run','event','emit','faxAccounts','send','checkAfterSend','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','jayson/promise','validate','bluebird','../properties','../ami','format','%s/%s','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','error','asterisk','username','join','pick','keys','action','Action','message','catch','ami\x20disconnected','command','Command','then','content','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit'];(function(_0x1a7a1b,_0x518846){var _0x350750=function(_0x4ab680){while(--_0x4ab680){_0x1a7a1b['push'](_0x1a7a1b['shift']());}};_0x350750(++_0x518846);}(_0xa0a1,0x15b));var _0x1a0a=function(_0x2c55bd,_0x3d272e){_0x2c55bd=_0x2c55bd-0x0;var _0x388c1a=_0xa0a1[_0x2c55bd];return _0x388c1a;};'use strict';var _=require(_0x1a0a('0x0'));var util=require('util');var jayson=require(_0x1a0a('0x1'));var schema=require(_0x1a0a('0x2'));var BPromise=require(_0x1a0a('0x3'));var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0x1a0a('0x4'));var ami=require(_0x1a0a('0x5'));exports['listen']=function(_0x27077a,_0x31e85b,_0x4b5573){return new BPromise(function(_0x2d4b04,_0xe59f97){var _0x3fe29f={'QueuePause':function(_0x245f3d){return new Promise(function(_0x9da67c,_0x48d604){var _0x2e5bec=util[_0x1a0a('0x6')](_0x1a0a('0x7'),'SIP',_0x245f3d['name']);if(_0x27077a['timers']&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec]&&_0x27077a[_0x1a0a('0x8')][_0x2e5bec][_0x1a0a('0x9')]){_0x27077a['timers'][_0x2e5bec][_0x1a0a('0xa')]();}if(_0x27077a['agents'][_0x2e5bec]){_0x27077a[_0x1a0a('0xb')][_0x2e5bec][_0x1a0a('0xc')]({'statePause':_0x245f3d[_0x1a0a('0xd')]?!![]:![]});}_0x9da67c({'code':0xc8,'message':_0x1a0a('0xe')});});},'Reload':function(_0x289046){var _0x2dee74=this;return new Promise(function(_0x3f34d2,_0x4f2b35){if(ami[_0x1a0a('0xf')]()==![]){return _0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected'][_0x1a0a('0x13')]('\x20')));}_0x289046=_[_0x1a0a('0x14')](_0x289046,_[_0x1a0a('0x15')](properties['module']));_0x289046[_0x1a0a('0x16')]='Reload';return ami[_0x1a0a('0x17')](_0x289046)['then'](function(_0x54bfbe){_0x3f34d2({'code':0xc8,'message':_0x54bfbe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x307fdc){_0x4f2b35(_0x2dee74[_0x1a0a('0x10')](0x1f5,_0x307fdc['message']));});});},'Command':function(_0x56b8a5){var _0x239065=this;return new Promise(function(_0x40903a,_0xfa74ce){if(ami['isConnected']()==![]){return _0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config['asterisk'][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}_0x56b8a5=_['pick'](_0x56b8a5,_0x1a0a('0x1b'));_0x56b8a5[_0x1a0a('0x16')]=_0x1a0a('0x1c');return ami['Action'](_0x56b8a5)[_0x1a0a('0x1d')](function(_0x47ef88){_0x40903a({'code':0xc8,'message':_0x47ef88[_0x1a0a('0x1e')]});})[_0x1a0a('0x19')](function(_0x2d7967){_0xfa74ce(_0x239065[_0x1a0a('0x10')](0x1f5,_0x2d7967[_0x1a0a('0x18')]));});});},'VoiceQueues':function(_0x578995){return new Promise(function(_0x1e2b28,_0x8e4151){var _0x561407=[];for(var _0x4cf939 in _0x27077a[_0x1a0a('0x1f')]){if(_0x27077a[_0x1a0a('0x1f')][_0x1a0a('0x20')](_0x4cf939)){var _0x365ab5=_0x27077a[_0x1a0a('0x1f')][_0x4cf939];var _0x244bbf={'id':_0x365ab5['id'],'name':_0x365ab5[_0x1a0a('0x21')],'strategy':_0x365ab5[_0x1a0a('0x22')],'answered':_0x365ab5[_0x1a0a('0x23')],'available':_0x365ab5[_0x1a0a('0x24')],'loggedIn':_0x365ab5[_0x1a0a('0x25')],'pTalking':_0x365ab5[_0x1a0a('0x26')],'sumBillable':_0x365ab5[_0x1a0a('0x27')],'sumDuration':_0x365ab5[_0x1a0a('0x28')],'sumHoldTime':_0x365ab5[_0x1a0a('0x29')]||0x0,'talking':_0x365ab5[_0x1a0a('0x2a')],'total':_0x365ab5[_0x1a0a('0x2b')],'type':_0x365ab5['type'],'unmanaged':_0x365ab5[_0x1a0a('0x2c')],'abandoned':_0x365ab5[_0x1a0a('0x2d')],'waiting':_0x365ab5[_0x1a0a('0x2e')],'loggedInDb':_0x365ab5[_0x1a0a('0x2f')]};if(_0x365ab5[_0x1a0a('0x30')]===_0x1a0a('0x31')){_0x244bbf[_0x1a0a('0x32')]=_0x365ab5[_0x1a0a('0x32')];_0x244bbf[_0x1a0a('0x33')]=_0x365ab5[_0x1a0a('0x33')];_0x244bbf['dialOriginateCallerIdName']=_0x365ab5[_0x1a0a('0x34')];_0x244bbf[_0x1a0a('0x35')]=_0x365ab5['dialOriginateCallerIdNumber'];_0x244bbf[_0x1a0a('0x36')]=_0x365ab5['dialOriginateTimeout'];_0x244bbf['dialPrefix']=_0x365ab5[_0x1a0a('0x37')];_0x244bbf[_0x1a0a('0x38')]=_0x365ab5['temp'];_0x244bbf[_0x1a0a('0x39')]=_0x365ab5[_0x1a0a('0x39')];_0x244bbf[_0x1a0a('0x3a')]=_0x365ab5['outboundAnswerCallsDay'];_0x244bbf[_0x1a0a('0x3b')]=_0x365ab5[_0x1a0a('0x3b')];_0x244bbf['outboundBusyCallsDay']=_0x365ab5[_0x1a0a('0x3c')];_0x244bbf[_0x1a0a('0x3d')]=_0x365ab5['outboundCongestionCallsDay'];_0x244bbf[_0x1a0a('0x3e')]=_0x365ab5[_0x1a0a('0x3e')];_0x244bbf[_0x1a0a('0x3f')]=_0x365ab5[_0x1a0a('0x3f')];_0x244bbf['outboundDropCallsDayTimeout']=_0x365ab5[_0x1a0a('0x40')];_0x244bbf[_0x1a0a('0x41')]=_0x365ab5[_0x1a0a('0x41')];_0x244bbf[_0x1a0a('0x42')]=_0x365ab5[_0x1a0a('0x42')];_0x244bbf[_0x1a0a('0x43')]=_0x365ab5[_0x1a0a('0x43')];_0x244bbf[_0x1a0a('0x44')]=_0x365ab5[_0x1a0a('0x44')];_0x244bbf['outboundRejectCallsDay']=_0x365ab5['outboundRejectCallsDay'];_0x244bbf['outboundUnknownCallsDay']=_0x365ab5['outboundUnknownCallsDay'];_0x244bbf[_0x1a0a('0x45')]=_0x365ab5['predictiveIntervalAnsweredCalls'];_0x244bbf[_0x1a0a('0x46')]=_0x365ab5[_0x1a0a('0x46')];_0x244bbf['predictiveIntervalAvgTalktime']=_0x365ab5['predictiveIntervalAvgTalktime'];_0x244bbf[_0x1a0a('0x47')]=_0x365ab5[_0x1a0a('0x47')];_0x244bbf[_0x1a0a('0x48')]=_0x365ab5[_0x1a0a('0x48')];_0x244bbf['predictiveIntervalErlangCalls']=_0x365ab5[_0x1a0a('0x49')];_0x244bbf['predictiveIntervalErlangCallsDroppedCalls']=_0x365ab5['predictiveIntervalErlangCallsDroppedCalls'];_0x244bbf['predictiveIntervalHitRate']=_0x365ab5[_0x1a0a('0x4a')];_0x244bbf[_0x1a0a('0x4b')]=_0x365ab5['predictiveIntervalMultiplicativeFactor'];_0x244bbf[_0x1a0a('0x4c')]=_0x365ab5[_0x1a0a('0x4c')];_0x244bbf['predictiveIntervalAvailable']=_0x365ab5['predictiveIntervalAvailable'];_0x244bbf[_0x1a0a('0x4d')]=_0x365ab5[_0x1a0a('0x4d')];_0x244bbf['message']=_0x365ab5[_0x1a0a('0x18')];_0x244bbf[_0x1a0a('0x4e')]=_0x365ab5['originated'];_0x244bbf[_0x1a0a('0x4f')]=_0x365ab5['erlangCalls'];_0x244bbf[_0x1a0a('0x50')]=_0x365ab5['erlangCallToSecond'];_0x244bbf[_0x1a0a('0x51')]=_0x365ab5[_0x1a0a('0x51')];_0x244bbf[_0x1a0a('0x52')]=_0x365ab5[_0x1a0a('0x52')];_0x244bbf['startPredictive']=_0x365ab5[_0x1a0a('0x53')];_0x244bbf[_0x1a0a('0x54')]=_0x365ab5[_0x1a0a('0x54')];}if(_0x365ab5[_0x1a0a('0x55')]){_0x244bbf['Trunk']={'id':_0x365ab5[_0x1a0a('0x55')]['id'],'name':_0x365ab5[_0x1a0a('0x55')]['name'],'active':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x56')],'callerid':_0x365ab5[_0x1a0a('0x55')][_0x1a0a('0x57')]};}if(_0x365ab5[_0x1a0a('0x58')]){_0x244bbf[_0x1a0a('0x58')]={'id':_0x365ab5[_0x1a0a('0x58')]['id'],'name':_0x365ab5[_0x1a0a('0x58')][_0x1a0a('0x21')]};}_0x561407[_0x1a0a('0x59')](_0x244bbf);}}_0x1e2b28({'count':_0x561407['length'],'rows':_0x561407});});},'UpdateVoiceQueue':function(_0x35c133){return new Promise(function(_0x2a5a04,_0x4ba9ca){var _0x493083=_['find'](_0x27077a['voiceQueues'],{'id':parseInt(_0x35c133['id'])});var _0x455f57=_[_0x1a0a('0x5a')](_0x35c133,['id']);if(_0x493083){for(var _0x48711d in _0x455f57){if(typeof _0x455f57[_0x48711d]!=='undefined'&&typeof _0x493083[_0x48711d]!=='undefined'){_0x493083[_0x48711d]=_0x455f57[_0x48711d];}}_0x2a5a04(_0x493083);}else{_0x4ba9ca();}});},'VoiceChannels':function(_0x423f52){return new Promise(function(_0x1185e9,_0x144360){var _0x2c58a9=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x5c')]);_0x1185e9({'count':_0x2c58a9[_0x1a0a('0x5d')],'rows':_0x2c58a9});});},'VoiceChannelMixMonitor':function(_0x683bdc){var _0x9a2756=this;return new Promise(function(_0xf729c7,_0x1ed012){if(ami[_0x1a0a('0xf')]()==![]){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x14b07a=schema(properties[_0x1a0a('0x5e')])['validate'](_0x683bdc);if(_0x14b07a[_0x1a0a('0x5d')]>0x0){return _0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f4,_['map'](_0x14b07a,'message')[_0x1a0a('0x13')](',\x20')));}var _0x498118=_['find'](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x683bdc['uniqueid']});if(_0x498118&&_0x498118[_0x1a0a('0x5f')]){var _0x217073=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x683bdc[_0x1a0a('0x61')]||_0x683bdc[_0x1a0a('0x62')],_0x683bdc[_0x1a0a('0x6')]||_0x1a0a('0x63'));return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x64'),'channel':_0x498118['channel'],'file':_0x217073,'options':_0x1a0a('0x65')})['then'](function(_0x9e897f){var _0x1e97d2=_['find'](_0x498118['monitors'],{'filename':_0x1a0a('0x66')+_0x217073[_0x1a0a('0x67')]()});if(_['isNil'](_0x1e97d2)){_0x498118['monitors'][_0x1a0a('0x59')]({'filename':'/var/spool/asterisk/monitor/'+_0x217073[_0x1a0a('0x67')](),'createdAt':moment()[_0x1a0a('0x6')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')],'status':'rec'});}else{_0x1e97d2[_0x1a0a('0x68')]=_0x9e897f[_0x1a0a('0x68')];_0x1e97d2['status']=_0x1a0a('0x69');}_0xf729c7({'code':0xc8,'message':[_0x683bdc[_0x1a0a('0x62')],_0x1a0a('0x6a'),_0x9e897f['mixmonitorid']][_0x1a0a('0x13')]('\x20'),'mixmonitorid':_0x9e897f[_0x1a0a('0x68')]});})['catch'](function(_0x5dac09){_0x1ed012(_0x9a2756[_0x1a0a('0x10')](0x1f5,[_0x683bdc[_0x1a0a('0x62')],_0x5dac09[_0x1a0a('0x18')][_0x1a0a('0x67')]()]['join']('\x20')));});}else{return _0x1ed012(_0x9a2756['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x2fef04){var _0x5e1eaa=this;return new Promise(function(_0x10fd71,_0x2953c1){if(ami[_0x1a0a('0xf')]()==![]){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')][_0x1a0a('0x13')]('\x20')));}var _0x34dd54=schema(properties[_0x1a0a('0x5e')])[_0x1a0a('0x2')](_0x2fef04);if(_0x34dd54[_0x1a0a('0x5d')]>0x0){return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x34dd54,'message')[_0x1a0a('0x13')](',\x20')));}var _0x26cb74=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x5c')],{'uniqueid':_0x2fef04['uniqueid']});if(_0x26cb74){return BPromise[_0x1a0a('0x6d')]()[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x6e'),'channel':_0x26cb74[_0x1a0a('0x5f')],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})[_0x1a0a('0x19')](function(_0x224eac){});}})[_0x1a0a('0x1d')](function(){if(_0x26cb74[_0x1a0a('0x6f')]){return ami['Action']({'action':_0x1a0a('0x6e'),'channel':_0x26cb74['destinationchannel'],'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]})['catch'](function(_0x1c2b41){});}})[_0x1a0a('0x1d')](function(_0x3ccce6){var _0x1aadbd=_[_0x1a0a('0x6c')](_0x26cb74['monitors'],{'mixmonitorid':_0x2fef04[_0x1a0a('0x68')]});if(_0x1aadbd){_0x1aadbd[_0x1a0a('0x70')]=_0x1a0a('0x71');}})[_0x1a0a('0x1d')](function(){var _0x36c617=util[_0x1a0a('0x6')](_0x1a0a('0x60'),_0x2fef04['filename']||_0x2fef04[_0x1a0a('0x62')],_0x2fef04[_0x1a0a('0x6')]||_0x1a0a('0x63'));var _0x5e2d94=_['find'](_0x26cb74[_0x1a0a('0x72')],{'filename':_0x1a0a('0x66')+_0x36c617[_0x1a0a('0x67')]()});if(_0x5e2d94){_0x5e2d94[_0x1a0a('0x70')]=_0x1a0a('0x71');}})['then'](function(){_0x10fd71({'code':0xc8,'message':[_0x2fef04[_0x1a0a('0x62')],_0x1a0a('0x73')][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x4629b7){_0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,[_0x2fef04[_0x1a0a('0x62')],_0x4629b7[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')));});}else{return _0x2953c1(_0x5e1eaa[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x33a0eb){return new Promise(function(_0x239262,_0x1a903c){var _0x569ecb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x74')]);_0x239262({'count':_0x569ecb[_0x1a0a('0x5d')],'rows':_0x569ecb});});},'VoiceQueuesChannel':function(_0x2c757f){var _0xec020d=this;return new Promise(function(_0x471c4e,_0x3ef0cc){var _0x488f43=schema(properties[_0x1a0a('0x75')])[_0x1a0a('0x2')](_0x2c757f);if(_0x488f43[_0x1a0a('0x5d')]>0x0){return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f4,_[_0x1a0a('0x6b')](_0x488f43,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x56756e=_[_0x1a0a('0x6c')](_0x27077a['queueChannels'],{'uniqueid':_0x2c757f[_0x1a0a('0x62')]});if(_0x56756e){_0x471c4e(_0x56756e);}else{return _0x3ef0cc(_0xec020d[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelHangup':function(_0x221201){var _0x24cca3=this;return new Promise(function(_0x55ce61,_0x21baea){if(ami[_0x1a0a('0xf')]()==![]){return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f4,[config[_0x1a0a('0x11')]['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],'ami\x20disconnected']['join']('\x20')));}var _0x4f5e24=schema(properties[_0x1a0a('0x77')])[_0x1a0a('0x2')](_0x221201);if(_0x4f5e24[_0x1a0a('0x5d')]>0x0){return _0x21baea(_0x24cca3['error'](0x1f4,_[_0x1a0a('0x6b')](_0x4f5e24,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x4ef8e7=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x221201['uniqueid']});if(_0x4ef8e7&&_0x4ef8e7[_0x1a0a('0x5f')]){return ami['Action']({'action':'Hangup','channel':_0x4ef8e7[_0x1a0a('0x5f')]})[_0x1a0a('0x1d')](function(_0xeb1468){_0x55ce61({'code':0xc8,'message':[_0x221201[_0x1a0a('0x62')],_0xeb1468[_0x1a0a('0x18')][_0x1a0a('0x67')]()][_0x1a0a('0x13')]('\x20')});})[_0x1a0a('0x19')](function(_0x51d91f){_0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,[_0x221201[_0x1a0a('0x62')],_0x51d91f[_0x1a0a('0x18')]['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x21baea(_0x24cca3[_0x1a0a('0x10')](0x1f5,_0x1a0a('0x76')));}});},'VoiceQueuesChannelRedirect':function(_0x3e5323){var _0x59e463=this;return new Promise(function(_0x348d33,_0x5b35a8){if(ami[_0x1a0a('0xf')]()==![]){return _0x5b35a8(_0x59e463['error'](0x1f4,[config['asterisk']['ip'],config[_0x1a0a('0x11')][_0x1a0a('0x12')],_0x1a0a('0x1a')]['join']('\x20')));}var _0x190000=schema(properties[_0x1a0a('0x78')])[_0x1a0a('0x2')](_0x3e5323);if(_0x190000[_0x1a0a('0x5d')]>0x0){return _0x5b35a8(_0x59e463['error'](0x1f4,_[_0x1a0a('0x6b')](_0x190000,_0x1a0a('0x18'))[_0x1a0a('0x13')](',\x20')));}var _0x5c73ad=_[_0x1a0a('0x6c')](_0x27077a[_0x1a0a('0x74')],{'uniqueid':_0x3e5323[_0x1a0a('0x62')]});if(_0x5c73ad&&_0x5c73ad[_0x1a0a('0x5f')]){return ami[_0x1a0a('0x17')]({'action':_0x1a0a('0x79'),'channel':_0x5c73ad[_0x1a0a('0x5f')],'exten':_0x3e5323['exten'],'context':_0x3e5323[_0x1a0a('0x7a')]||_0x5c73ad['context'],'priority':0x1})[_0x1a0a('0x1d')](function(_0x367830){_0x348d33({'code':0xc8,'message':[_0x3e5323['uniqueid'],_0x367830['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')});})['catch'](function(_0x21146e){_0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,[_0x3e5323[_0x1a0a('0x62')],_0x21146e['message']['toLowerCase']()][_0x1a0a('0x13')]('\x20')));});}else{return _0x5b35a8(_0x59e463[_0x1a0a('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x47fb42){return new Promise(function(_0x32fbc5,_0x32bab1){var _0xe85959=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0xb')]);_0x32fbc5({'count':_0xe85959[_0x1a0a('0x5d')],'rows':_0xe85959});});},'Telephones':function(_0x577e25){return new Promise(function(_0x116934,_0xf2bdec){var _0x50f111=_[_0x1a0a('0x5b')](_0x27077a['telephones']);_0x116934({'count':_0x50f111[_0x1a0a('0x5d')],'rows':_0x50f111});});},'Trunks':function(_0x48c39f){return new Promise(function(_0x5187b7,_0x534aeb){var _0x3767ef=_['values'](_0x27077a['trunks']);_0x5187b7({'count':_0x3767ef[_0x1a0a('0x5d')],'rows':_0x3767ef});});},'OutboundChannels':function(_0x45d13a){return new Promise(function(_0x5f3fe6,_0x1a8641){var _0x2400a6=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7b')]);_0x5f3fe6({'count':_0x2400a6['length'],'rows':_0x2400a6});});},'Outbound':function(_0x2d1482){return new Promise(function(_0x552617,_0x2b6e84){_0x552617(_0x27077a[_0x1a0a('0x31')]);});},'Campaigns':function(_0x420de6){return new Promise(function(_0x4ca92c,_0x5b87dd){var _0x18e50a=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x7c')]);_0x4ca92c({'count':_0x18e50a[_0x1a0a('0x5d')],'rows':_0x18e50a});});},'VoiceQueuesPreview':function(_0x3f0ec9){var _0x260122=this;return new Promise(function(_0x106b45,_0x92a816){_0x31e85b[_0x1a0a('0x7d')](_0x3f0ec9['id'])[_0x1a0a('0x1d')](function(_0x1431af){_0x106b45({'code':0xc8,'message':_0x1431af[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x20cebc){_0x92a816(_0x260122[_0x1a0a('0x10')](0x1f4,_0x20cebc[_0x1a0a('0x18')]));});});},'EventManager':function(_0x3b8bb7){var _0x575bd=this;return new Promise(function(_0x2bf3a,_0x22ad6d){if(!_0x3b8bb7[_0x1a0a('0x7e')]){return _0x22ad6d(_0x575bd[_0x1a0a('0x10')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x1a0a('0x7f')]('custom:'+_0x3b8bb7[_0x1a0a('0x7e')],_0x3b8bb7['message']);_0x2bf3a({'code':0xc8,'message':_0x3b8bb7});});},'FaxAccounts':function(_0x2c632f){return new Promise(function(_0x36eb72,_0x4cdbf1){var _0x59c6fb=_[_0x1a0a('0x5b')](_0x27077a[_0x1a0a('0x80')]);_0x36eb72({'count':_0x59c6fb[_0x1a0a('0x5d')],'rows':_0x59c6fb});});},'SendFax':function(_0x5d46b3){var _0x4a18dc=this;return new Promise(function(_0x94f975,_0x1c5f0c){_0x4b5573[_0x1a0a('0x81')](_0x5d46b3)[_0x1a0a('0x1d')](function(_0x59eafe){_0x94f975({'code':0xc8,'message':_0x59eafe[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x12e46f){_0x1c5f0c(_0x4a18dc[_0x1a0a('0x10')](0x1f4,_0x12e46f[_0x1a0a('0x18')]));});});},'CheckAfterSend':function(_0x159137){var _0x20d586=this;return new Promise(function(_0xe3e686,_0x2c8065){_0x4b5573[_0x1a0a('0x82')](_0x159137)[_0x1a0a('0x1d')](function(_0x269a94){_0xe3e686({'code':0xc8,'message':_0x269a94[_0x1a0a('0x18')]});})[_0x1a0a('0x19')](function(_0x3754a7){_0x2c8065(_0x20d586[_0x1a0a('0x10')](0x1f4,_0x3754a7['message']));});});}};var _0x57ef20=jayson[_0x1a0a('0x83')](_0x3fe29f)[_0x1a0a('0x84')]();_0x57ef20['on']('error',function(_0x1ac840){return _0xe59f97(_0x1ac840);});_0x57ef20[_0x1a0a('0x85')](0x232a,_0x1a0a('0x86'),function(){console[_0x1a0a('0x87')](_0x1a0a('0x88'),0x232a);return _0x2d4b04('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xbff5=['/var/spool/asterisk/monitor/','isNil','monitors','push','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','Channel\x20doesn\x27t\x20exist','resolve','StopMixMonitor','destinationchannel','stop','status','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','%s/%s','name','timers','agents','pause','isConnected','asterisk','username','ami\x20disconnected','pick','keys','module','Reload','Action','then','message','catch','error','join','command','Command','content','voiceQueues','hasOwnProperty','answered','available','pTalking','sumHoldTime','total','type','unmanaged','abandoned','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','length','omit','undefined','values','voicechannel','map','find','channels','uniqueid','channel','%s.%s','filename','format','wav','MixMonitor','ai(mixmonitorid)'];(function(_0x17db9f,_0x29d626){var _0x3c2353=function(_0x40b8ee){while(--_0x40b8ee){_0x17db9f['push'](_0x17db9f['shift']());}};_0x3c2353(++_0x29d626);}(_0xbff5,0x1bc));var _0x5bff=function(_0x32b52c,_0x5b1d72){_0x32b52c=_0x32b52c-0x0;var _0x3305ae=_0xbff5[_0x32b52c];return _0x3305ae;};'use strict';var _=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var jayson=require(_0x5bff('0x2'));var schema=require(_0x5bff('0x3'));var BPromise=require(_0x5bff('0x4'));var moment=require(_0x5bff('0x5'));var config=require(_0x5bff('0x6'));var properties=require('../properties');var ami=require(_0x5bff('0x7'));exports['listen']=function(_0x4c567d,_0x16ed7b,_0x1d8650){return new BPromise(function(_0x151add,_0xa54c57){var _0x43605a={'QueuePause':function(_0xd4b9dc){return new Promise(function(_0x1acb49,_0x139c99){var _0x3eb6f9=util['format'](_0x5bff('0x8'),'SIP',_0xd4b9dc[_0x5bff('0x9')]);if(_0x4c567d[_0x5bff('0xa')]&&_0x4c567d['timers'][_0x3eb6f9]&&_0x4c567d[_0x5bff('0xa')][_0x3eb6f9]['timer']){_0x4c567d[_0x5bff('0xa')][_0x3eb6f9]['updateAcw']();}if(_0x4c567d[_0x5bff('0xb')][_0x3eb6f9]){_0x4c567d[_0x5bff('0xb')][_0x3eb6f9]['updateStatusRealtime']({'statePause':_0xd4b9dc[_0x5bff('0xc')]?!![]:![]});}_0x1acb49({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x335e78){var _0x635926=this;return new Promise(function(_0x548128,_0xa0dced){if(ami[_0x5bff('0xd')]()==![]){return _0xa0dced(_0x635926['error'](0x1f4,[config['asterisk']['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')]['join']('\x20')));}_0x335e78=_[_0x5bff('0x11')](_0x335e78,_[_0x5bff('0x12')](properties[_0x5bff('0x13')]));_0x335e78['action']=_0x5bff('0x14');return ami[_0x5bff('0x15')](_0x335e78)[_0x5bff('0x16')](function(_0x546351){_0x548128({'code':0xc8,'message':_0x546351[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x36653b){_0xa0dced(_0x635926[_0x5bff('0x19')](0x1f5,_0x36653b['message']));});});},'Command':function(_0x3065c1){var _0x5357d4=this;return new Promise(function(_0x878040,_0x4d0111){if(ami[_0x5bff('0xd')]()==![]){return _0x4d0111(_0x5357d4[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}_0x3065c1=_[_0x5bff('0x11')](_0x3065c1,_0x5bff('0x1b'));_0x3065c1['action']=_0x5bff('0x1c');return ami[_0x5bff('0x15')](_0x3065c1)[_0x5bff('0x16')](function(_0x1e7f8a){_0x878040({'code':0xc8,'message':_0x1e7f8a[_0x5bff('0x1d')]});})[_0x5bff('0x18')](function(_0x3913fd){_0x4d0111(_0x5357d4[_0x5bff('0x19')](0x1f5,_0x3913fd['message']));});});},'VoiceQueues':function(_0x5741d9){return new Promise(function(_0x9a69de,_0x53bd97){var _0x220c8f=[];for(var _0xcc091d in _0x4c567d[_0x5bff('0x1e')]){if(_0x4c567d[_0x5bff('0x1e')][_0x5bff('0x1f')](_0xcc091d)){var _0x1140eb=_0x4c567d[_0x5bff('0x1e')][_0xcc091d];var _0xedba9d={'id':_0x1140eb['id'],'name':_0x1140eb['name'],'strategy':_0x1140eb['strategy'],'answered':_0x1140eb[_0x5bff('0x20')],'available':_0x1140eb[_0x5bff('0x21')],'loggedIn':_0x1140eb['loggedIn'],'pTalking':_0x1140eb[_0x5bff('0x22')],'sumBillable':_0x1140eb['sumBillable'],'sumDuration':_0x1140eb['sumDuration'],'sumHoldTime':_0x1140eb[_0x5bff('0x23')]||0x0,'talking':_0x1140eb['talking'],'total':_0x1140eb[_0x5bff('0x24')],'type':_0x1140eb[_0x5bff('0x25')],'unmanaged':_0x1140eb[_0x5bff('0x26')],'abandoned':_0x1140eb[_0x5bff('0x27')],'waiting':_0x1140eb['waiting'],'loggedInDb':_0x1140eb[_0x5bff('0x28')]};if(_0x1140eb['type']===_0x5bff('0x29')){_0xedba9d['dialActive']=_0x1140eb[_0x5bff('0x2a')];_0xedba9d[_0x5bff('0x2b')]=_0x1140eb[_0x5bff('0x2b')];_0xedba9d[_0x5bff('0x2c')]=_0x1140eb[_0x5bff('0x2c')];_0xedba9d[_0x5bff('0x2d')]=_0x1140eb['dialOriginateCallerIdNumber'];_0xedba9d[_0x5bff('0x2e')]=_0x1140eb[_0x5bff('0x2e')];_0xedba9d[_0x5bff('0x2f')]=_0x1140eb[_0x5bff('0x2f')];_0xedba9d[_0x5bff('0x30')]=_0x1140eb[_0x5bff('0x30')];_0xedba9d[_0x5bff('0x31')]=_0x1140eb[_0x5bff('0x31')];_0xedba9d['outboundAnswerCallsDay']=_0x1140eb[_0x5bff('0x32')];_0xedba9d[_0x5bff('0x33')]=_0x1140eb[_0x5bff('0x33')];_0xedba9d[_0x5bff('0x34')]=_0x1140eb['outboundBusyCallsDay'];_0xedba9d[_0x5bff('0x35')]=_0x1140eb[_0x5bff('0x35')];_0xedba9d['outboundDropCallsDayACS']=_0x1140eb[_0x5bff('0x36')];_0xedba9d[_0x5bff('0x37')]=_0x1140eb[_0x5bff('0x37')];_0xedba9d[_0x5bff('0x38')]=_0x1140eb['outboundDropCallsDayTimeout'];_0xedba9d[_0x5bff('0x39')]=_0x1140eb[_0x5bff('0x39')];_0xedba9d[_0x5bff('0x3a')]=_0x1140eb['outboundNoSuchCallsDay'];_0xedba9d[_0x5bff('0x3b')]=_0x1140eb['outboundOriginateFailureCallsDay'];_0xedba9d[_0x5bff('0x3c')]=_0x1140eb[_0x5bff('0x3c')];_0xedba9d[_0x5bff('0x3d')]=_0x1140eb['outboundRejectCallsDay'];_0xedba9d[_0x5bff('0x3e')]=_0x1140eb[_0x5bff('0x3e')];_0xedba9d[_0x5bff('0x3f')]=_0x1140eb['predictiveIntervalAnsweredCalls'];_0xedba9d[_0x5bff('0x40')]=_0x1140eb[_0x5bff('0x40')];_0xedba9d['predictiveIntervalAvgTalktime']=_0x1140eb[_0x5bff('0x41')];_0xedba9d[_0x5bff('0x42')]=_0x1140eb[_0x5bff('0x42')];_0xedba9d[_0x5bff('0x43')]=_0x1140eb[_0x5bff('0x43')];_0xedba9d['predictiveIntervalErlangCalls']=_0x1140eb[_0x5bff('0x44')];_0xedba9d['predictiveIntervalErlangCallsDroppedCalls']=_0x1140eb[_0x5bff('0x45')];_0xedba9d[_0x5bff('0x46')]=_0x1140eb[_0x5bff('0x46')];_0xedba9d[_0x5bff('0x47')]=_0x1140eb[_0x5bff('0x47')];_0xedba9d[_0x5bff('0x48')]=_0x1140eb[_0x5bff('0x48')];_0xedba9d['predictiveIntervalAvailable']=_0x1140eb['predictiveIntervalAvailable'];_0xedba9d[_0x5bff('0x49')]=_0x1140eb[_0x5bff('0x49')];_0xedba9d[_0x5bff('0x17')]=_0x1140eb[_0x5bff('0x17')];_0xedba9d[_0x5bff('0x4a')]=_0x1140eb[_0x5bff('0x4a')];_0xedba9d[_0x5bff('0x4b')]=_0x1140eb[_0x5bff('0x4b')];_0xedba9d['erlangCallToSecond']=_0x1140eb[_0x5bff('0x4c')];_0xedba9d['erlangAbandonmentRate']=_0x1140eb[_0x5bff('0x4d')];_0xedba9d[_0x5bff('0x4e')]=_0x1140eb['erlangBusyFactor'];_0xedba9d[_0x5bff('0x4f')]=_0x1140eb[_0x5bff('0x4f')];_0xedba9d['startProgressive']=_0x1140eb[_0x5bff('0x50')];}if(_0x1140eb[_0x5bff('0x51')]){_0xedba9d[_0x5bff('0x51')]={'id':_0x1140eb['Trunk']['id'],'name':_0x1140eb[_0x5bff('0x51')][_0x5bff('0x9')],'active':_0x1140eb[_0x5bff('0x51')]['active'],'callerid':_0x1140eb[_0x5bff('0x51')][_0x5bff('0x52')]};}if(_0x1140eb[_0x5bff('0x53')]){_0xedba9d[_0x5bff('0x53')]={'id':_0x1140eb['Interval']['id'],'name':_0x1140eb[_0x5bff('0x53')]['name']};}_0x220c8f['push'](_0xedba9d);}}_0x9a69de({'count':_0x220c8f[_0x5bff('0x54')],'rows':_0x220c8f});});},'UpdateVoiceQueue':function(_0x95cf00){return new Promise(function(_0x564bc5,_0x2132bf){var _0xbebf66=_['find'](_0x4c567d[_0x5bff('0x1e')],{'id':parseInt(_0x95cf00['id'])});var _0x3e56c3=_[_0x5bff('0x55')](_0x95cf00,['id']);if(_0xbebf66){for(var _0x39c90f in _0x3e56c3){if(typeof _0x3e56c3[_0x39c90f]!=='undefined'&&typeof _0xbebf66[_0x39c90f]!==_0x5bff('0x56')){_0xbebf66[_0x39c90f]=_0x3e56c3[_0x39c90f];}}_0x564bc5(_0xbebf66);}else{_0x2132bf();}});},'VoiceChannels':function(_0x22f0b6){return new Promise(function(_0x44a34a,_0x738700){var _0x1e94c5=_[_0x5bff('0x57')](_0x4c567d['channels']);_0x44a34a({'count':_0x1e94c5[_0x5bff('0x54')],'rows':_0x1e94c5});});},'VoiceChannelMixMonitor':function(_0x14f4d4){var _0x5d5b1f=this;return new Promise(function(_0x2487f6,_0x5c59c0){if(ami['isConnected']()==![]){return _0x5c59c0(_0x5d5b1f['error'](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')]['username'],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x3360d8=schema(properties[_0x5bff('0x58')])[_0x5bff('0x3')](_0x14f4d4);if(_0x3360d8['length']>0x0){return _0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x3360d8,'message')[_0x5bff('0x1a')](',\x20')));}var _0x48feaa=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x5b')],{'uniqueid':_0x14f4d4[_0x5bff('0x5c')]});if(_0x48feaa&&_0x48feaa[_0x5bff('0x5d')]){var _0x29f7dc=util['format'](_0x5bff('0x5e'),_0x14f4d4[_0x5bff('0x5f')]||_0x14f4d4['uniqueid'],_0x14f4d4[_0x5bff('0x60')]||_0x5bff('0x61'));return ami['Action']({'action':_0x5bff('0x62'),'channel':_0x48feaa[_0x5bff('0x5d')],'file':_0x29f7dc,'options':_0x5bff('0x63')})[_0x5bff('0x16')](function(_0x24ad0f){var _0x1be6eb=_['find'](_0x48feaa['monitors'],{'filename':_0x5bff('0x64')+_0x29f7dc['toLowerCase']()});if(_[_0x5bff('0x65')](_0x1be6eb)){_0x48feaa[_0x5bff('0x66')][_0x5bff('0x67')]({'filename':_0x5bff('0x64')+_0x29f7dc[_0x5bff('0x68')](),'createdAt':moment()[_0x5bff('0x60')](_0x5bff('0x69')),'mixmonitorid':_0x24ad0f[_0x5bff('0x6a')],'status':_0x5bff('0x6b')});}else{_0x1be6eb[_0x5bff('0x6a')]=_0x24ad0f[_0x5bff('0x6a')];_0x1be6eb['status']='rec';}_0x2487f6({'code':0xc8,'message':[_0x14f4d4[_0x5bff('0x5c')],'MixMonitor\x20Success',_0x24ad0f[_0x5bff('0x6a')]]['join']('\x20'),'mixmonitorid':_0x24ad0f[_0x5bff('0x6a')]});})[_0x5bff('0x18')](function(_0xb20434){_0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f5,[_0x14f4d4[_0x5bff('0x5c')],_0xb20434[_0x5bff('0x17')][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')));});}else{return _0x5c59c0(_0x5d5b1f[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x1470bc){var _0x57053a=this;return new Promise(function(_0x142854,_0x56eff2){if(ami['isConnected']()==![]){return _0x56eff2(_0x57053a['error'](0x1f4,[config[_0x5bff('0xe')]['ip'],config['asterisk'][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x3192cb=schema(properties['voicechannel'])['validate'](_0x1470bc);if(_0x3192cb['length']>0x0){return _0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x3192cb,'message')[_0x5bff('0x1a')](',\x20')));}var _0x3bb787=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x5b')],{'uniqueid':_0x1470bc[_0x5bff('0x5c')]});if(_0x3bb787){return BPromise[_0x5bff('0x6d')]()[_0x5bff('0x16')](function(){if(_0x3bb787[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x6e'),'channel':_0x3bb787[_0x5bff('0x5d')],'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]})[_0x5bff('0x18')](function(_0x33464a){});}})['then'](function(){if(_0x3bb787[_0x5bff('0x6f')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x6e'),'channel':_0x3bb787[_0x5bff('0x6f')],'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]})[_0x5bff('0x18')](function(_0x24916c){});}})[_0x5bff('0x16')](function(_0x2522bd){var _0x257410=_[_0x5bff('0x5a')](_0x3bb787[_0x5bff('0x66')],{'mixmonitorid':_0x1470bc[_0x5bff('0x6a')]});if(_0x257410){_0x257410['status']=_0x5bff('0x70');}})[_0x5bff('0x16')](function(){var _0x24df6b=util[_0x5bff('0x60')](_0x5bff('0x5e'),_0x1470bc['filename']||_0x1470bc[_0x5bff('0x5c')],_0x1470bc[_0x5bff('0x60')]||'wav');var _0x1b35ae=_[_0x5bff('0x5a')](_0x3bb787[_0x5bff('0x66')],{'filename':'/var/spool/asterisk/monitor/'+_0x24df6b[_0x5bff('0x68')]()});if(_0x1b35ae){_0x1b35ae[_0x5bff('0x71')]=_0x5bff('0x70');}})[_0x5bff('0x16')](function(){_0x142854({'code':0xc8,'message':[_0x1470bc[_0x5bff('0x5c')],_0x5bff('0x72')][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0x23f021){_0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f5,[_0x1470bc[_0x5bff('0x5c')],_0x23f021[_0x5bff('0x17')]['toLowerCase']()]['join']('\x20')));});}else{return _0x56eff2(_0x57053a[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannels':function(_0x1bed0d){return new Promise(function(_0x597eea,_0x26899a){var _0x5cc8ce=_['values'](_0x4c567d[_0x5bff('0x73')]);_0x597eea({'count':_0x5cc8ce['length'],'rows':_0x5cc8ce});});},'VoiceQueuesChannel':function(_0x536fee){var _0x12bb42=this;return new Promise(function(_0x227723,_0x4d6cc5){var _0x29ed8d=schema(properties[_0x5bff('0x74')])[_0x5bff('0x3')](_0x536fee);if(_0x29ed8d[_0x5bff('0x54')]>0x0){return _0x4d6cc5(_0x12bb42[_0x5bff('0x19')](0x1f4,_[_0x5bff('0x59')](_0x29ed8d,_0x5bff('0x17'))[_0x5bff('0x1a')](',\x20')));}var _0x1c3fbf=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x536fee[_0x5bff('0x5c')]});if(_0x1c3fbf){_0x227723(_0x1c3fbf);}else{return _0x4d6cc5(_0x12bb42[_0x5bff('0x19')](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0x16d5d4){var _0x8851=this;return new Promise(function(_0x39bc4e,_0x1df78d){if(ami[_0x5bff('0xd')]()==![]){return _0x1df78d(_0x8851[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config['asterisk'][_0x5bff('0xf')],_0x5bff('0x10')]['join']('\x20')));}var _0x29d02a=schema(properties['voicequeuechannelhangup'])[_0x5bff('0x3')](_0x16d5d4);if(_0x29d02a[_0x5bff('0x54')]>0x0){return _0x1df78d(_0x8851['error'](0x1f4,_[_0x5bff('0x59')](_0x29d02a,_0x5bff('0x17'))[_0x5bff('0x1a')](',\x20')));}var _0x341d5a=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x16d5d4[_0x5bff('0x5c')]});if(_0x341d5a&&_0x341d5a[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x75'),'channel':_0x341d5a[_0x5bff('0x5d')]})['then'](function(_0x20bc69){_0x39bc4e({'code':0xc8,'message':[_0x16d5d4[_0x5bff('0x5c')],_0x20bc69['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0x49d3db){_0x1df78d(_0x8851[_0x5bff('0x19')](0x1f5,[_0x16d5d4[_0x5bff('0x5c')],_0x49d3db[_0x5bff('0x17')][_0x5bff('0x68')]()]['join']('\x20')));});}else{return _0x1df78d(_0x8851['error'](0x1f5,_0x5bff('0x6c')));}});},'VoiceQueuesChannelRedirect':function(_0x59e996){var _0xd9f5e5=this;return new Promise(function(_0x40bd5d,_0x3834c8){if(ami['isConnected']()==![]){return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f4,[config[_0x5bff('0xe')]['ip'],config[_0x5bff('0xe')][_0x5bff('0xf')],_0x5bff('0x10')][_0x5bff('0x1a')]('\x20')));}var _0x4b40c5=schema(properties[_0x5bff('0x76')])[_0x5bff('0x3')](_0x59e996);if(_0x4b40c5[_0x5bff('0x54')]>0x0){return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f4,_['map'](_0x4b40c5,_0x5bff('0x17'))['join'](',\x20')));}var _0x14f5c0=_[_0x5bff('0x5a')](_0x4c567d[_0x5bff('0x73')],{'uniqueid':_0x59e996[_0x5bff('0x5c')]});if(_0x14f5c0&&_0x14f5c0[_0x5bff('0x5d')]){return ami[_0x5bff('0x15')]({'action':_0x5bff('0x77'),'channel':_0x14f5c0['channel'],'exten':_0x59e996[_0x5bff('0x78')],'context':_0x59e996['context']||_0x14f5c0['context'],'priority':0x1})[_0x5bff('0x16')](function(_0x377bc7){_0x40bd5d({'code':0xc8,'message':[_0x59e996['uniqueid'],_0x377bc7['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')});})[_0x5bff('0x18')](function(_0xe95398){_0x3834c8(_0xd9f5e5['error'](0x1f5,[_0x59e996[_0x5bff('0x5c')],_0xe95398['message'][_0x5bff('0x68')]()][_0x5bff('0x1a')]('\x20')));});}else{return _0x3834c8(_0xd9f5e5[_0x5bff('0x19')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x2e8cb2){return new Promise(function(_0x5a5e97,_0x382be1){var _0x406c7c=_[_0x5bff('0x57')](_0x4c567d['agents']);_0x5a5e97({'count':_0x406c7c['length'],'rows':_0x406c7c});});},'Telephones':function(_0x28aee9){return new Promise(function(_0x3b0bb1,_0x2b8ec5){var _0x2bfdbc=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x79')]);_0x3b0bb1({'count':_0x2bfdbc[_0x5bff('0x54')],'rows':_0x2bfdbc});});},'Trunks':function(_0x315aba){return new Promise(function(_0x1b6a75,_0x59efd7){var _0x435076=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x7a')]);_0x1b6a75({'count':_0x435076['length'],'rows':_0x435076});});},'OutboundChannels':function(_0x5877a0){return new Promise(function(_0x2bba31,_0xd30d2f){var _0x4b216f=_['values'](_0x4c567d[_0x5bff('0x7b')]);_0x2bba31({'count':_0x4b216f['length'],'rows':_0x4b216f});});},'Outbound':function(_0x391b56){return new Promise(function(_0xc0fcc2,_0x2efdb9){_0xc0fcc2(_0x4c567d[_0x5bff('0x29')]);});},'Campaigns':function(_0x5804f2){return new Promise(function(_0x7f29e1,_0x574d38){var _0x155bf3=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x7c')]);_0x7f29e1({'count':_0x155bf3[_0x5bff('0x54')],'rows':_0x155bf3});});},'VoiceQueuesPreview':function(_0x63b716){var _0x551d39=this;return new Promise(function(_0x46d12e,_0x320109){_0x16ed7b['run'](_0x63b716['id'])[_0x5bff('0x16')](function(_0x494872){_0x46d12e({'code':0xc8,'message':_0x494872[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x2c6f32){_0x320109(_0x551d39['error'](0x1f4,_0x2c6f32[_0x5bff('0x17')]));});});},'EventManager':function(_0x3033de){var _0x3977d3=this;return new Promise(function(_0x223c6f,_0x701e08){if(!_0x3033de[_0x5bff('0x7d')]){return _0x701e08(_0x3977d3['error'](0x1f4,_0x5bff('0x7e')));}ami['emit'](_0x5bff('0x7f')+_0x3033de[_0x5bff('0x7d')],_0x3033de[_0x5bff('0x17')]);_0x223c6f({'code':0xc8,'message':_0x3033de});});},'FaxAccounts':function(_0x3b240f){return new Promise(function(_0x2efeb0,_0x70fdf2){var _0x331810=_[_0x5bff('0x57')](_0x4c567d[_0x5bff('0x80')]);_0x2efeb0({'count':_0x331810[_0x5bff('0x54')],'rows':_0x331810});});},'SendFax':function(_0x429263){var _0x995f09=this;return new Promise(function(_0x40de11,_0x4cfb5b){_0x1d8650['send'](_0x429263)[_0x5bff('0x16')](function(_0x2e45e4){_0x40de11({'code':0xc8,'message':_0x2e45e4[_0x5bff('0x17')]});})[_0x5bff('0x18')](function(_0x406b88){_0x4cfb5b(_0x995f09['error'](0x1f4,_0x406b88[_0x5bff('0x17')]));});});},'CheckAfterSend':function(_0x31eae5){var _0x1d5599=this;return new Promise(function(_0x5a6b0f,_0x2f1f80){_0x1d8650['checkAfterSend'](_0x31eae5)[_0x5bff('0x16')](function(_0x51c0a1){_0x5a6b0f({'code':0xc8,'message':_0x51c0a1[_0x5bff('0x17')]});})['catch'](function(_0xe39373){_0x2f1f80(_0x1d5599[_0x5bff('0x19')](0x1f4,_0xe39373[_0x5bff('0x17')]));});});}};var _0x560d5d=jayson[_0x5bff('0x81')](_0x43605a)[_0x5bff('0x82')]();_0x560d5d['on'](_0x5bff('0x19'),function(_0x3dbb53){return _0xa54c57(_0x3dbb53);});_0x560d5d[_0x5bff('0x83')](0x232a,_0x5bff('0x84'),function(){console[_0x5bff('0x85')](_0x5bff('0x86'),0x232a);return _0x151add(_0x5bff('0x87')+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 847c6b2..e656513 100644 --- a/server/services/ami/trigger/cmContact/index.js +++ b/server/services/ami/trigger/cmContact/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['xmd-contactid','data3','split','$or','map','routeId','destcalleridnum','calleridnum','firstName','lastName','phone','fax','ListId','createdAt','scheduledAt','union','then','getContacts','length','uniqueid','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','calleridname','','Unknown','destcalleridname','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info','[CM][%s][%s]','stringify','emit','exec','data2','isNil','data5'];(function(_0x21818b,_0x321270){var _0x5b1e66=function(_0x210372){while(--_0x210372){_0x21818b['push'](_0x21818b['shift']());}};_0x5b1e66(++_0x321270);}(_0x34e8,0x12c));var _0x834e=function(_0x4e1a32,_0x2ebd9e){_0x4e1a32=_0x4e1a32-0x0;var _0x529731=_0x34e8[_0x4e1a32];return _0x529731;};'use strict';var _=require(_0x834e('0x0'));var BPromise=require(_0x834e('0x1'));var Redis=require(_0x834e('0x2'));var util=require(_0x834e('0x3'));var config=require('../../../../config/environment');var logger=require(_0x834e('0x4'))(_0x834e('0x5'));var cmContactRpc=require(_0x834e('0x6'));config[_0x834e('0x7')]=_[_0x834e('0x8')](config[_0x834e('0x7')],{'host':_0x834e('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x7')]));function emit(_0x52056d,_0x3e16d2,_0x3cc2e3,_0x3a3ef6,_0x2e69e2){logger[_0x834e('0xa')](_0x834e('0xb'),_0x52056d,_0x3e16d2['id'],_0x3cc2e3,_0x3a3ef6,JSON[_0x834e('0xc')](_0x2e69e2));io['to'](_0x3cc2e3)[_0x834e('0xd')](_0x3a3ef6,_0x2e69e2);}exports[_0x834e('0xe')]=function(_0x186b3b,_0x1e41fe,_0x36e124,_0x14038b){var _0x2e1a37,_0x293514;var _0x1e00de={};var _0x2fd95c=Number(_0x36e124['data1']);var _0x5e5b6d=_0x36e124[_0x834e('0xf')]?Boolean(Number(_0x36e124['data2'])):![];var _0x23848e;var _0x2d95f2=![];if(!_[_0x834e('0x10')](_0x36e124[_0x834e('0x11')])){if(_0x36e124['data5']=='1')_0x2d95f2=!![];}if(!_0x2d95f2){if(_0x14038b[_0x834e('0x12')]){_0x1e00de['id']=_0x14038b[_0x834e('0x12')];}}if(!_0x1e00de['id']){_0x1e00de['ListId']=_0x2fd95c;_0x23848e=_0x36e124[_0x834e('0x13')]&&_0x36e124['data3']!=='0'?_0x36e124[_0x834e('0x13')][_0x834e('0x14')](','):['phone'];_0x1e00de[_0x834e('0x15')]=_[_0x834e('0x16')](_0x23848e,function(_0x370fb5){var _0x50b3f6={};_0x50b3f6[_0x370fb5]=_0x14038b[_0x834e('0x17')]?_0x14038b[_0x834e('0x18')]:_0x14038b[_0x834e('0x19')];return _0x50b3f6;});}var _0xb993a1=['id',_0x834e('0x1a'),_0x834e('0x1b'),_0x834e('0x1c'),'mobile',_0x834e('0x1d'),_0x834e('0x1e'),_0x834e('0x1f'),_0x834e('0x20'),'updatedAt'];var _0x45a630=_[_0x834e('0x21')](_0xb993a1,_0x23848e);BPromise['resolve']()[_0x834e('0x22')](cmContactRpc[_0x834e('0x23')]({'attributes':_0x45a630,'where':_0x1e00de}))[_0x834e('0x22')](function(_0x5c55ca){_0x293514=_0x5c55ca;if(!_['isEmpty'](_0x293514)){if(_0x293514[_0x834e('0x24')]===0x1){_0x2e1a37=_0x293514[0x0];logger[_0x834e('0xa')]('[CM][%s][%s]\x20Contact\x20found:%s',_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_0x2e1a37['id']);}else{logger[_0x834e('0xa')]('[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]',_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_[_0x834e('0x16')](_0x293514,'id')[_0x834e('0x26')](','));}return;}else{logger['info'](_0x834e('0x27'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);var _0x5e1cc5={'ListId':_0x2fd95c};var _0x5bef62=_0x36e124[_0x834e('0x28')]&&_0x36e124['data4']!=='0'?_0x36e124[_0x834e('0x28')]:_0x834e('0x1c');if(_0x5e5b6d){logger[_0x834e('0xa')](_0x834e('0x29'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);_0x5e1cc5[_0x5bef62]=_[_0x834e('0x10')](_0x14038b['routeId'])?_0x14038b['calleridnum']:_0x14038b['destcalleridnum'];if(_['isNil'](_0x14038b[_0x834e('0x17')])){_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2a')]&&_0x14038b['calleridname']!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2a')]:_0x834e('0x2c');}else{_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2d')]&&_0x14038b[_0x834e('0x2d')]!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2d')]:_0x834e('0x2c');}return BPromise['resolve']()[_0x834e('0x22')](cmContactRpc['createContact'](_0x5e1cc5))[_0x834e('0x22')](function(_0x3787b0){_0x2e1a37=_0x3787b0;_0x293514[_0x834e('0x2e')](_0x3787b0);if(_0x2e1a37){logger[_0x834e('0xa')](_0x834e('0x2f'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id'],_0x2e1a37['id']);}return;});}else{logger[_0x834e('0xa')](_0x834e('0x30'),_0x14038b[_0x834e('0x25')],_0x1e41fe['id']);_0x5e1cc5[_0x5bef62]=_[_0x834e('0x10')](_0x14038b['routeId'])?_0x14038b[_0x834e('0x19')]:_0x14038b[_0x834e('0x18')];if(_[_0x834e('0x10')](_0x14038b[_0x834e('0x17')])){_0x5e1cc5['firstName']=_0x14038b[_0x834e('0x2a')]&&_0x14038b[_0x834e('0x2a')]!==''?_0x14038b['calleridname']:'Unknown';}else{_0x5e1cc5[_0x834e('0x1a')]=_0x14038b[_0x834e('0x2d')]&&_0x14038b[_0x834e('0x2d')]!==_0x834e('0x2b')?_0x14038b[_0x834e('0x2d')]:_0x834e('0x2c');}_0x2e1a37=_0x5e1cc5;_0x293514['push'](_0x5e1cc5);return;}}})[_0x834e('0x22')](function(){if(_0x186b3b){emit(_0x14038b['uniqueid'],_0x1e41fe,util[_0x834e('0x31')](_0x834e('0x32'),_0x186b3b['name']),util[_0x834e('0x31')](_0x834e('0x33'),_0x36e124['action']['toLowerCase']()),{'evt':_[_0x834e('0x34')](_0x14038b,{'autoCreate':_0x5e5b6d}),'contact':_0x2e1a37===undefined?{}:_0x2e1a37,'contacts':_0x293514[_0x834e('0x24')]===0x0?undefined:_0x293514});}});}; \ No newline at end of file +var _0xb903=['data1','data2','data5','xmd-contactid','data3','split','phone','destcalleridnum','calleridnum','firstName','fax','ListId','scheduledAt','updatedAt','union','resolve','then','getContacts','isEmpty','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridname','','Unknown','destcalleridname','push','user:%s','format','trigger:%s','action','toLowerCase','merge','length','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','localhost','info'];(function(_0xeee97a,_0x3f6eff){var _0x734123=function(_0x2e74d9){while(--_0x2e74d9){_0xeee97a['push'](_0xeee97a['shift']());}};_0x734123(++_0x3f6eff);}(_0xb903,0x185));var _0x3b90=function(_0x381e25,_0x1469e5){_0x381e25=_0x381e25-0x0;var _0x2c6d70=_0xb903[_0x381e25];return _0x2c6d70;};'use strict';var _=require(_0x3b90('0x0'));var BPromise=require(_0x3b90('0x1'));var Redis=require(_0x3b90('0x2'));var util=require(_0x3b90('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3b90('0x4'))(_0x3b90('0x5'));var cmContactRpc=require(_0x3b90('0x6'));config[_0x3b90('0x7')]=_[_0x3b90('0x8')](config[_0x3b90('0x7')],{'host':_0x3b90('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3b90('0x7')]));function emit(_0x5e845a,_0x55792c,_0x153283,_0x2e4c06,_0x42efe8){logger[_0x3b90('0xa')]('[CM][%s][%s]',_0x5e845a,_0x55792c['id'],_0x153283,_0x2e4c06,JSON['stringify'](_0x42efe8));io['to'](_0x153283)['emit'](_0x2e4c06,_0x42efe8);}exports['exec']=function(_0x56261b,_0x55db3f,_0x336913,_0x5af39c){var _0x574955,_0x30c49c;var _0x233509={};var _0x4bb8f4=Number(_0x336913[_0x3b90('0xb')]);var _0x174c0d=_0x336913[_0x3b90('0xc')]?Boolean(Number(_0x336913['data2'])):![];var _0x5447df;var _0x58c4d1=![];if(!_['isNil'](_0x336913['data5'])){if(_0x336913[_0x3b90('0xd')]=='1')_0x58c4d1=!![];}if(!_0x58c4d1){if(_0x5af39c[_0x3b90('0xe')]){_0x233509['id']=_0x5af39c['xmd-contactid'];}}if(!_0x233509['id']){_0x233509['ListId']=_0x4bb8f4;_0x5447df=_0x336913[_0x3b90('0xf')]&&_0x336913[_0x3b90('0xf')]!=='0'?_0x336913[_0x3b90('0xf')][_0x3b90('0x10')](','):[_0x3b90('0x11')];_0x233509['$or']=_['map'](_0x5447df,function(_0xd83280){var _0x5420dc={};_0x5420dc[_0xd83280]=_0x5af39c['routeId']?_0x5af39c[_0x3b90('0x12')]:_0x5af39c[_0x3b90('0x13')];return _0x5420dc;});}var _0x11ad7d=['id',_0x3b90('0x14'),'lastName',_0x3b90('0x11'),'mobile',_0x3b90('0x15'),_0x3b90('0x16'),'createdAt',_0x3b90('0x17'),_0x3b90('0x18')];var _0x3642c0=_[_0x3b90('0x19')](_0x11ad7d,_0x5447df);BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc[_0x3b90('0x1c')]({'attributes':_0x3642c0,'where':_0x233509}))[_0x3b90('0x1b')](function(_0xa98414){_0x30c49c=_0xa98414;if(!_[_0x3b90('0x1d')](_0x30c49c)){if(_0x30c49c['length']===0x1){_0x574955=_0x30c49c[0x0];logger[_0x3b90('0xa')](_0x3b90('0x1e'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}else{logger[_0x3b90('0xa')](_0x3b90('0x20'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_['map'](_0x30c49c,'id')['join'](','));}return;}else{logger[_0x3b90('0xa')](_0x3b90('0x21'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);var _0x2ffa1a={'ListId':_0x4bb8f4};var _0x583523=_0x336913[_0x3b90('0x22')]&&_0x336913[_0x3b90('0x22')]!=='0'?_0x336913[_0x3b90('0x22')]:'phone';if(_0x174c0d){logger[_0x3b90('0xa')](_0x3b90('0x23'),_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c[_0x3b90('0x25')])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c['destcalleridnum'];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:_0x3b90('0x28');}else{_0x2ffa1a[_0x3b90('0x14')]=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c['destcalleridname']!==''?_0x5af39c[_0x3b90('0x29')]:_0x3b90('0x28');}return BPromise[_0x3b90('0x1a')]()[_0x3b90('0x1b')](cmContactRpc['createContact'](_0x2ffa1a))['then'](function(_0xd33ac9){_0x574955=_0xd33ac9;_0x30c49c[_0x3b90('0x2a')](_0xd33ac9);if(_0x574955){logger[_0x3b90('0xa')]('[CM][%s][%s]\x20Contact\x20created:%s',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id'],_0x574955['id']);}return;});}else{logger['info']('[CM][%s][%s]\x20Autocreate\x20disabled',_0x5af39c[_0x3b90('0x1f')],_0x55db3f['id']);_0x2ffa1a[_0x583523]=_[_0x3b90('0x24')](_0x5af39c['routeId'])?_0x5af39c[_0x3b90('0x13')]:_0x5af39c[_0x3b90('0x12')];if(_[_0x3b90('0x24')](_0x5af39c['routeId'])){_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x26')]&&_0x5af39c[_0x3b90('0x26')]!==_0x3b90('0x27')?_0x5af39c[_0x3b90('0x26')]:'Unknown';}else{_0x2ffa1a['firstName']=_0x5af39c[_0x3b90('0x29')]&&_0x5af39c[_0x3b90('0x29')]!==''?_0x5af39c['destcalleridname']:_0x3b90('0x28');}_0x574955=_0x2ffa1a;_0x30c49c[_0x3b90('0x2a')](_0x2ffa1a);return;}}})[_0x3b90('0x1b')](function(){if(_0x56261b){emit(_0x5af39c[_0x3b90('0x1f')],_0x55db3f,util['format'](_0x3b90('0x2b'),_0x56261b['name']),util[_0x3b90('0x2c')](_0x3b90('0x2d'),_0x336913[_0x3b90('0x2e')][_0x3b90('0x2f')]()),{'evt':_[_0x3b90('0x30')](_0x5af39c,{'autoCreate':_0x174c0d}),'contact':_0x574955===undefined?{}:_0x574955,'contacts':_0x30c49c[_0x3b90('0x31')]===0x0?undefined:_0x30c49c});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e986038..6177b9c 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 _0x15dd=['agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:agentnoanswer','custom:agentbusy','custom:agentcongestion','custom:agentreject','custom:amd','custom:queuecallerabandon','custom:dialbegin','custom:dialconnect','syncAgentDial','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','stringify','clone','undefined','voice','checkTriggers','hasOwnProperty','status','checkTrigger','merge','variables','Actions','length','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','render','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','600','data6','winArguments','name','format','trigger:%s:%s','jscripty','user:%s','interface','trigger:%s','exec','accounts','queue','routeId','urlforward','script','query','search','replace','channel','motionChannel','AllConditions','AnyConditions','some','checkConditions','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','null','substatus','exports','util','lodash','mustache','./urlforward','./integration','./cmContact','./script','../../../config/environment','trigger','redis','defaults','socket.io-emitter','popup','url','winapp','triggers'];(function(_0x41f94c,_0x273a09){var _0x4cecad=function(_0x561a46){while(--_0x561a46){_0x41f94c['push'](_0x41f94c['shift']());}};_0x4cecad(++_0x273a09);}(_0x15dd,0x16a));var _0xd15d=function(_0x46f985,_0x2dcedc){_0x46f985=_0x46f985-0x0;var _0x438104=_0x15dd[_0x46f985];return _0x438104;};'use strict';var util=require(_0xd15d('0x0'));var _=require(_0xd15d('0x1'));var url=require('url');var Mustache=require(_0xd15d('0x2'));var Redis=require('ioredis');var urlforward=require(_0xd15d('0x3'));var integration=require(_0xd15d('0x4'));var cmContact=require(_0xd15d('0x5'));var script=require(_0xd15d('0x6'));var config=require(_0xd15d('0x7'));var logger=require('../../../config/logger')(_0xd15d('0x8'));var ami=require('../ami');config[_0xd15d('0x9')]=_[_0xd15d('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd15d('0xb'))(new Redis(config[_0xd15d('0x9')]));var operators={'equals':function(_0x24e143,_0x1fa7cf){return _0x24e143==_0x1fa7cf;},'not_equals':function(_0x53802f,_0x1dc18f){return _0x53802f!=_0x1dc18f;}};var barAndWebActions=[_0xd15d('0xc'),_0xd15d('0xd'),_0xd15d('0xe')];function Trigger(_0x7e46c6){this['triggers']=_0x7e46c6[_0xd15d('0xf')];this[_0xd15d('0x10')]=_0x7e46c6[_0xd15d('0x10')];this[_0xd15d('0x11')]=_0x7e46c6['voiceQueues'];this[_0xd15d('0x12')]=_0x7e46c6['templates'];this[_0xd15d('0x13')]=_0x7e46c6[_0xd15d('0x13')];this[_0xd15d('0x14')]=_0x7e46c6[_0xd15d('0x14')];this[_0xd15d('0x15')]=_0x7e46c6[_0xd15d('0x15')];this[_0xd15d('0x16')]=_0x7e46c6['salesforceAccounts'];this['sugarcrmAccounts']=_0x7e46c6[_0xd15d('0x17')];this['zohoAccounts']=_0x7e46c6[_0xd15d('0x18')];this[_0xd15d('0x19')]=_0x7e46c6['deskAccounts'];this['vtigerAccounts']=_0x7e46c6[_0xd15d('0x1a')];this[_0xd15d('0x1b')]=_0x7e46c6[_0xd15d('0x1b')];this[_0xd15d('0x1c')]=_0x7e46c6['dynamics365Accounts'];this[_0xd15d('0x1d')]=_0x7e46c6[_0xd15d('0x1d')];this['accounts']={'zendesk':this[_0xd15d('0x14')],'salesforce':this[_0xd15d('0x16')],'freshdesk':this[_0xd15d('0x15')],'sugarcrm':this[_0xd15d('0x17')],'zoho':this[_0xd15d('0x18')],'desk':this['deskAccounts'],'vtiger':this['vtigerAccounts'],'dynamics365':this[_0xd15d('0x1c')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0xd15d('0x1b')]};ami['on'](_0xd15d('0x1e'),this['syncCustomEvent']['bind'](this));ami['on']('custom:agentconnect',this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x21'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x22'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on']('custom:agentnosuchnumber',this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x23'),this['syncCustomEvent'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x24'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x25'),this[_0xd15d('0x1f')]['bind'](this));ami['on'](_0xd15d('0x26'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x27'),this['syncCustomEvent'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x28'),this[_0xd15d('0x1f')]['bind'](this));ami['on']('custom:timeout',this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x29'),this['syncAgentDial'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x2a'),this['syncAgentDial'][_0xd15d('0x20')](this));ami['on']('custom:dialend',this[_0xd15d('0x2b')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x2c'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x2d'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on']('custom:substatus',this['syncCustomEvent'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x2e'),this['syncCustomEvent'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x2f'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x30'),this['syncCustomEvent'][_0xd15d('0x20')](this));ami['on'](_0xd15d('0x31'),this[_0xd15d('0x1f')][_0xd15d('0x20')](this));}Trigger[_0xd15d('0x32')][_0xd15d('0x33')]=function(_0x2b995c,_0x24ddc8,_0x4405b8){logger[_0xd15d('0x34')](_0x2b995c,_0x24ddc8,JSON[_0xd15d('0x35')](_0x4405b8));io['to'](_0x2b995c)[_0xd15d('0x33')](_0x24ddc8,_0x4405b8);};Trigger[_0xd15d('0x32')][_0xd15d('0x1f')]=function(_0x25f781){var _0x4d7f4c=_[_0xd15d('0x36')](_0x25f781);if(typeof _0x4d7f4c['motionChannel']===_0xd15d('0x37')){_0x4d7f4c['motionChannel']=_0xd15d('0x38');}this[_0xd15d('0x39')](_0x4d7f4c);};Trigger[_0xd15d('0x32')][_0xd15d('0x2b')]=function(_0x159e43){if(this[_0xd15d('0x10')][_0x159e43['interface']]){this[_0xd15d('0x1f')](_0x159e43);}};Trigger[_0xd15d('0x32')][_0xd15d('0x39')]=function(_0x297b93){var _0x16b733;for(var _0x140d0f in this[_0xd15d('0xf')]){if(this[_0xd15d('0xf')][_0xd15d('0x3a')](_0x140d0f)){if(this['triggers'][_0x140d0f][_0xd15d('0x3b')]){_0x16b733=this[_0xd15d('0x3c')](this[_0xd15d('0xf')][_0x140d0f],_0x297b93);if(_0x16b733){_[_0xd15d('0x3d')](_0x297b93,_0x297b93[_0xd15d('0x3e')]);for(var _0x13ff91=0x0,_0x50e6ff,_0x18912a,_0x32e31b;_0x13ff910x0){_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 _0x55ca=['debug','[HTTP]','stringify','GET','authType','basic','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','Enduser\x20found!','_embedded','entries','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','length','forEach','includes','picklist','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','variable','variableName','customVariable','Variable','name','priority','merge','xCALLY','Motion','CTI','concat','Tags','getString','Descriptions','/api/v2/users/%d','user','Fields','stripTrailingSlash','serverUrl','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','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','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','%s/agent/tickets/%s','catch','unmanaged','monitor_format','lastevent','toUpperCase','Recording\x20is\x20enabled!','lodash','request-promise','./util','../../../../config/environment','desk','redis','defaults','localhost','socket.io-emitter','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me'];(function(_0x17ab36,_0x3bc33b){var _0x408579=function(_0x58280b){while(--_0x58280b){_0x17ab36['push'](_0x17ab36['shift']());}};_0x408579(++_0x3bc33b);}(_0x55ca,0x126));var _0xa55c=function(_0x2c5ec9,_0x4d69fe){_0x2c5ec9=_0x2c5ec9-0x0;var _0x460637=_0x55ca[_0x2c5ec9];return _0x460637;};'use strict';var _=require(_0xa55c('0x0'));var rp=require(_0xa55c('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0xa55c('0x2'));var config=require(_0xa55c('0x3'));var logger=require('../../../../config/logger')(_0xa55c('0x4'));config[_0xa55c('0x5')]=_[_0xa55c('0x6')](config[_0xa55c('0x5')],{'host':_0xa55c('0x7'),'port':0x18eb});var io=require(_0xa55c('0x8'))(new Redis(config[_0xa55c('0x5')]));function emit(_0x4d0624,_0x2121fd,_0x2537f0){io['to'](_0x4d0624)['emit'](_0x2121fd,_0x2537f0);}var headers={'Content-Type':_0xa55c('0x9'),'Accept':_0xa55c('0x9')};function getUser(_0x52a3bc,_0x5849ad){if(intUtil[_0xa55c('0xa')](_0x5849ad)===!![]){logger[_0xa55c('0xb')](_0xa55c('0xc'),_0x5849ad);return request({'uri':util[_0xa55c('0xd')](_0xa55c('0xe'),_0x52a3bc[_0xa55c('0xf')])})[_0xa55c('0x10')](function(_0x70c2de){if(_0x70c2de[_0xa55c('0x11')]){return _[_0xa55c('0x12')](_0x70c2de['_embedded']['entries'],{'email':_0x5849ad});}})[_0xa55c('0x10')](function(_0x576044){if(_0x576044){logger['info']('Agent\x20found!');return _0x576044;}else{logger[_0xa55c('0xb')](_0xa55c('0x13'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}});}else{logger[_0xa55c('0xb')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x14'),_0x52a3bc[_0xa55c('0xf')])});}}function request(_0x31e10d){logger[_0xa55c('0x15')](_0xa55c('0x16'),JSON[_0xa55c('0x17')](_0x31e10d));return rp(_[_0xa55c('0x6')](_0x31e10d,{'method':_0xa55c('0x18'),'headers':headers,'json':!![]}));}function getAuth(_0x4cee3c){var _0x3d4c9e;if(_0x4cee3c[_0xa55c('0x19')]===_0xa55c('0x1a')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1b'),_0x4cee3c[_0xa55c('0x1c')],_0x4cee3c['password']);}else if(_0x4cee3c['authType']===_0xa55c('0x1d')){_0x3d4c9e=util[_0xa55c('0xd')](_0xa55c('0x1e'),_0x4cee3c['username'],_0x4cee3c[_0xa55c('0x1d')]);}return util[_0xa55c('0xd')]('Basic\x20%s',new Buffer(_0x3d4c9e)[_0xa55c('0x1f')](_0xa55c('0x20')));}function getEndUser(_0x940f28,_0x1965f1,_0x234372){logger['info'](_0xa55c('0x21'),_0x234372);return request({'uri':util['format']('%s/customers/search',_0x940f28['remoteUri']),'qs':{'phone':_0x234372}})[_0xa55c('0x10')](function(_0x54b038){if(_0x54b038[_0xa55c('0x11')]){logger[_0xa55c('0xb')](_0xa55c('0x22'));return _0x54b038[_0xa55c('0x23')][_0xa55c('0x24')][0x0];}else{logger[_0xa55c('0xb')](_0xa55c('0x25'));return request({'uri':util[_0xa55c('0xd')](_0xa55c('0x26'),_0x940f28[_0xa55c('0xf')]),'method':_0xa55c('0x27'),'body':{'first_name':_0x1965f1,'title':_0x1965f1,'phone_numbers':[{'type':'work','value':_0x234372}]}});}});}function getTags(_0x430d55,_0x28814f){var _0x1c9f6b=[];if(_0x430d55&&_0x430d55[_0xa55c('0x28')]>0x0){_0x1c9f6b=_['map'](_0x430d55,_0x28814f);}return _0x1c9f6b;}function getCustomFields(_0x1377b0,_0x22f6b6){var _0x1b8388=[];var _0x201941={'custom_fields':{}};if(_0x1377b0[_0xa55c('0x28')]>0x0){_[_0xa55c('0x29')](_0x1377b0,function(_0x52d37f){if(_[_0xa55c('0x2a')](['string',_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x2d')]&&!_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0x52d37f['nameField'][_0xa55c('0x2f')]()]=_0x52d37f[_0xa55c('0x30')][_0xa55c('0x1f')]();}else if(_[_0xa55c('0x2a')]([_0xa55c('0x31'),_0xa55c('0x2b')],_0x52d37f[_0xa55c('0x2c')])&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x52d37f['content']['toString']();}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x34')&&_0x52d37f['variableName']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x35')]]&&(_0x201941[_0xa55c('0x33')][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f[_0xa55c('0x35')]][_0xa55c('0x1f')]());}else if(_0x52d37f[_0xa55c('0x2c')]===_0xa55c('0x36')&&_0x52d37f['Variable']&&_0x52d37f['Variable']['name']&&_0x52d37f[_0xa55c('0x32')]&&_0x52d37f[_0xa55c('0x2e')]){_0x22f6b6[_0x52d37f[_0xa55c('0x37')]['name'][_0xa55c('0x2f')]()]&&(_0x201941['custom_fields'][_0x52d37f[_0xa55c('0x32')]]=_0x22f6b6[_0x52d37f['Variable'][_0xa55c('0x38')][_0xa55c('0x2f')]()][_0xa55c('0x1f')]());}});}if(_0x201941['priority']){_0x201941[_0xa55c('0x39')]=Number(_0x201941[_0xa55c('0x39')]);}return _0x201941;}function getTicket(_0x47e93c,_0x6f9c4c,_0x194e78,_0x4d9083,_0x529ff8){logger[_0xa55c('0xb')]('Creating\x20new\x20ticket...');var _0x1e75dc=_[_0xa55c('0x3a')]({'subject':intUtil['getString'](_0x4d9083['Subjects'],_0x529ff8,'\x20'),'type':'phone','status':'new','labels':[_0xa55c('0x3b'),_0xa55c('0x3c'),_0xa55c('0x3d')][_0xa55c('0x3e')](getTags(_0x4d9083[_0xa55c('0x3f')],'name')),'description':intUtil[_0xa55c('0x40')](_0x4d9083[_0xa55c('0x41')],_0x529ff8,'\x0a'),'_links':{'assigned_user':{'href':util[_0xa55c('0xd')](_0xa55c('0x42'),_0x6f9c4c['id']),'class':_0xa55c('0x43')}},'message':{'direction':'in','body':intUtil[_0xa55c('0x40')](_0x4d9083['Descriptions'],_0x529ff8,'\x0a')}},getCustomFields(_0x4d9083[_0xa55c('0x44')],_0x529ff8));return request({'uri':util['format']('%s/customers/%d/cases',_0x47e93c[_0xa55c('0xf')],_0x194e78['id']),'method':_0xa55c('0x27'),'body':_0x1e75dc});}exports['queue']=function(_0x2bd98b,_0x508bd3,_0x5f25f7,_0x2f8449,_0x3fea03,_0x1630ac){var _0x540337,_0x1b2708;_0x1630ac[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1630ac[_0xa55c('0xf')]);_0x1630ac['serverUrl']=intUtil[_0xa55c('0x45')](_0x1630ac[_0xa55c('0x46')]);if(_0x3fea03&&_0x3fea03['monitor_format']){logger[_0xa55c('0xb')](_0xa55c('0x47'),'Recording\x20is\x20enabled!');_0x508bd3[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1630ac['serverUrl'],_0x508bd3[_0xa55c('0x4a')],md5(_0x508bd3['uniqueid']));}else{_0x508bd3[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1630ac);return getUser(_0x1630ac,_0x2f8449[_0xa55c('0x4c')])['then'](function(_0x41eab1){_0x540337=_0x41eab1;logger[_0xa55c('0xb')]('The\x20User\x20ID\x20is:',_0x540337['id']);return getEndUser(_0x1630ac,_0x508bd3[_0xa55c('0x4d')],_0x508bd3[_0xa55c('0x4e')]);})['then'](function(_0x11ff1d){_0x1b2708=_0x11ff1d;logger[_0xa55c('0xb')]('The\x20Enduser\x20ID\x20is:',_0x1b2708['id']);return getTicket(_0x1630ac,_0x540337,_0x1b2708,_0x5f25f7,_0x508bd3);})[_0xa55c('0x10')](function(_0x81cee8){if(_0x81cee8){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger['info'](_0xa55c('0x50'),_0x81cee8['id']);switch(_0x1630ac['type']){case _0xa55c('0x51'):logger[_0xa55c('0xb')](_0xa55c('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449['name']),_0xa55c('0x53'),{'recordId':_0x81cee8['id']});break;case _0xa55c('0x54'):logger[_0xa55c('0xb')](_0xa55c('0x47'),_0xa55c('0x55'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2f8449[_0xa55c('0x38')]),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')]('https://xcally.desk.com/web/agent/case/%d',_0x81cee8['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x47'),_0xa55c('0x58'));}}})['catch'](function(_0x4c3095){console[_0xa55c('0x57')](_0x4c3095);logger['error'](_0xa55c('0x47'),JSON['stringify'](_0x4c3095));});};exports[_0xa55c('0x59')]=function(_0x228df4,_0x181802,_0x3f9313,_0x2ecf79,_0x5b1cf3,_0x44b7c1,_0x4607ca){var _0x4b85cc,_0x3929a6;_0x44b7c1[_0xa55c('0xf')]=intUtil[_0xa55c('0x45')](_0x44b7c1[_0xa55c('0xf')]);_0x44b7c1['serverUrl']=intUtil['stripTrailingSlash'](_0x44b7c1[_0xa55c('0x46')]);if(_0x4607ca&&_0x4607ca[_0xa55c('0x5a')]&&_0x4607ca[_0xa55c('0x5a')]!==_0xa55c('0x5b')){logger['info'](_0xa55c('0x5c'),'Recording\x20is\x20enabled!');_0x181802[_0xa55c('0x48')]=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x44b7c1[_0xa55c('0x46')],_0x181802[_0xa55c('0x4a')],md5(_0x181802['uniqueid']));}headers[_0xa55c('0x4b')]=getAuth(_0x44b7c1);return getUser(_0x44b7c1,_0x2ecf79['email'])[_0xa55c('0x10')](function(_0x157afe){_0x4b85cc=_0x157afe;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0x4b85cc['id']);return getEndUser(_0x44b7c1,_0x181802[_0xa55c('0x5e')],_0x181802[_0xa55c('0x5f')]);})[_0xa55c('0x10')](function(_0x53e2be){_0x3929a6=_0x53e2be;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3929a6['id']);return getTicket(_0x44b7c1,_0x4b85cc,_0x3929a6,_0x3f9313,_0x181802);})[_0xa55c('0x10')](function(_0x23a30e){if(_0x23a30e){logger[_0xa55c('0xb')]('Ticket\x20created!');logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x23a30e['id']);switch(_0x44b7c1[_0xa55c('0x2c')]){case _0xa55c('0x51'):logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x61'));emit(util[_0xa55c('0xd')](_0xa55c('0x52'),_0x2ecf79[_0xa55c('0x38')]),_0xa55c('0x53'),{'recordId':_0x23a30e['id']});break;case'newTab':logger[_0xa55c('0xb')]('[QUEUE]',_0xa55c('0x55'));emit(util['format'](_0xa55c('0x52'),_0x2ecf79['name']),_0xa55c('0x56'),{'uri':util[_0xa55c('0xd')](_0xa55c('0x62'),_0x44b7c1[_0xa55c('0xf')],_0x23a30e['id'])});break;default:logger[_0xa55c('0x57')](_0xa55c('0x5c'),_0xa55c('0x58'));}}})[_0xa55c('0x63')](function(_0x14b515){logger[_0xa55c('0x57')]('[OUTBOUND]',JSON[_0xa55c('0x17')](_0x14b515));});};exports[_0xa55c('0x64')]=function(_0x4ef914,_0x18b928,_0x2b8b88,_0x3e3b4b,_0x9fe234,_0x1b8b06){var _0xa38271,_0x3cef1f;_0x1b8b06[_0xa55c('0xf')]=intUtil['stripTrailingSlash'](_0x1b8b06[_0xa55c('0xf')]);_0x1b8b06[_0xa55c('0x46')]=intUtil[_0xa55c('0x45')](_0x1b8b06[_0xa55c('0x46')]);if(_0x9fe234&&_0x9fe234[_0xa55c('0x65')]){logger[_0xa55c('0xb')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',_0xa55c('0x68'));_0x18b928['recordingURL']=util[_0xa55c('0xd')](_0xa55c('0x49'),_0x1b8b06[_0xa55c('0x46')],_0x18b928[_0xa55c('0x4a')],md5(_0x18b928[_0xa55c('0x4a')]));}else{_0x18b928[_0xa55c('0x48')]='';}headers[_0xa55c('0x4b')]=getAuth(_0x1b8b06);return getUser(_0x1b8b06)[_0xa55c('0x10')](function(_0x2e4cf7){_0xa38271=_0x2e4cf7;logger[_0xa55c('0xb')](_0xa55c('0x5d'),_0xa38271['id']);return getEndUser(_0x1b8b06,_0x18b928['calleridname'],_0x18b928[_0xa55c('0x4e')]);})['then'](function(_0x1228a4){_0x3cef1f=_0x1228a4;logger[_0xa55c('0xb')](_0xa55c('0x60'),_0x3cef1f['id']);return getTicket(_0x1b8b06,_0xa38271,_0x3cef1f,_0x2b8b88,_0x18b928);})['then'](function(_0x4d9722){if(_0x4d9722){logger[_0xa55c('0xb')](_0xa55c('0x4f'));logger[_0xa55c('0xb')](_0xa55c('0x50'),_0x4d9722['id']);}})['catch'](function(_0x149cb9){logger[_0xa55c('0x57')]('['+_0x18b928[_0xa55c('0x66')][_0xa55c('0x67')]()+']',JSON[_0xa55c('0x17')](_0x149cb9));});}; \ 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 04d7a92..7643295 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 _0x1473=['idField','indexOf','content','ticketType','incident','incidents','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','callDirection','queue','phonecalls','assign','headers','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','inspect','lodash','bluebird','util','./util','md5','ioredis','dynamics365','../../../../config/environment','redis','localhost','remoteUri','username','password','clientSecret','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','validateEmail','email','userEmail','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','internalemailaddress','toLowerCase','destcalleridnum','calleridnum','POST','contacts','/systemusers(','userId','odata-entityid','substring','lastIndexOf','enduserId','outbound','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','nothing',']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing',']\x20Enduser\x20created!','forEach','includes','picklist','type','nameField','customField'];(function(_0xa2e500,_0x385eee){var _0x1a5841=function(_0x16140d){while(--_0x16140d){_0xa2e500['push'](_0xa2e500['shift']());}};_0x1a5841(++_0x385eee);}(_0x1473,0x163));var _0x3147=function(_0x34466c,_0x1e7575){_0x34466c=_0x34466c-0x0;var _0x1bcdec=_0x1473[_0x34466c];return _0x1bcdec;};'use strict';var _=require(_0x3147('0x0'));var BPromise=require(_0x3147('0x1'));var rp=require('request-promise');var util=require(_0x3147('0x2'));var intUtil=require(_0x3147('0x3'));var md5=require(_0x3147('0x4'));var Redis=require(_0x3147('0x5'));var logger=require('../../../../config/logger')(_0x3147('0x6'));var config=require(_0x3147('0x7'));config['redis']=_['defaults'](config[_0x3147('0x8')],{'host':_0x3147('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3147('0x8')]));function getAuthToken(_0x138ebe,_0x3a2da2,_0x275668){var _0x55c593={'method':'POST','uri':_0x3a2da2,'form':{'client_id':_0x138ebe['clientId'],'resource':_0x138ebe[_0x3147('0xa')],'username':_0x138ebe[_0x3147('0xb')],'password':_0x138ebe[_0x3147('0xc')],'grant_type':_0x3147('0xc'),'client_secret':_0x138ebe[_0x3147('0xd')]},'json':!![]};return rp(_0x55c593)['then'](function(_0x55b09c){return _0x55b09c[_0x3147('0xe')];})[_0x3147('0xf')](function(_0x5bcf52){logger[_0x3147('0x10')]('['+[_0x275668[_0x3147('0x11')]()]+_0x3147('0x12'));return _0x5bcf52[_0x3147('0x13')];});}function getUser(_0x1d6907,_0x523ee2,_0x37ee9d,_0x838128,_0xba4dfa,_0x362379){return new BPromise(function(_0x56eca5,_0xc00f83){return getAuthToken(_0x523ee2,_0x838128,_0x362379)[_0x3147('0x14')](function(_0x3b6a84){var _0x8b542b={'method':'GET','uri':_0xba4dfa+_0x3147('0x15'),'headers':{'Authorization':_0x3147('0x16')+_0x3b6a84,'OData-Version':_0x3147('0x17')},'json':!![]};return rp(_0x8b542b);})[_0x3147('0x14')](function(_0x1c66e7){var _0x285018=_0x1c66e7[_0x3147('0x18')];var _0x13f4b0=![];var _0x203920=null;if(!_['isNil'](_0x37ee9d)){if(intUtil[_0x3147('0x19')](_0x37ee9d[_0x3147('0x1a')])){_0x1d6907[_0x3147('0x1b')]=_0x37ee9d[_0x3147('0x1a')];for(_0x203920=0x0;_0x203920<_0x285018[_0x3147('0x1c')];_0x203920++){if(_0x285018[_0x203920]['internalemailaddress']===_0x37ee9d[_0x3147('0x1a')]&&!_0x285018[_0x203920][_0x3147('0x1d')]){_0x13f4b0=!![];logger[_0x3147('0x1e')]('['+[_0x362379[_0x3147('0x11')]()]+_0x3147('0x1f')+_0x285018[_0x203920][_0x3147('0x20')]+'!');_0x1d6907['userId']=_0x285018[_0x203920][_0x3147('0x20')];}}}}if(!_0x13f4b0){logger[_0x3147('0x1e')]('['+[_0x362379[_0x3147('0x11')]()]+_0x3147('0x21'));_0x1d6907[_0x3147('0x1b')]=_0x523ee2['username'];for(_0x203920=0x0;_0x203920<_0x285018[_0x3147('0x1c')];_0x203920++){if(_0x285018[_0x203920][_0x3147('0x22')]===_0x523ee2[_0x3147('0xb')]){_0x1d6907['userId']=_0x285018[_0x203920]['systemuserid'];}}}_0x56eca5(_0x1d6907);})[_0x3147('0xf')](function(_0x18e30d){_0xc00f83(_0x18e30d[_0x3147('0x13')]);});});}function createEndUser(_0x16655e,_0x136d49,_0x1fad5b,_0x551b59,_0x2f36e4,_0x34a01f){return new BPromise(function(_0x2b352f,_0x254739){return getAuthToken(_0x136d49,_0x1fad5b,_0x34a01f)[_0x3147('0x14')](function(_0x59ad95){var _0x512f50=_0x34a01f[_0x3147('0x23')]()==='outbound'?_0x2f36e4[_0x3147('0x24')]:_0x2f36e4[_0x3147('0x25')];var _0x4225f6={'method':_0x3147('0x26'),'uri':_0x551b59+_0x3147('0x27'),'body':{'telephone1':_0x512f50,'fullname':_0x512f50,'firstname':_0x512f50,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3147('0x28')+_0x16655e[_0x3147('0x29')]+')'},'headers':{'Authorization':_0x3147('0x16')+_0x59ad95,'OData-Version':_0x3147('0x17')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x4225f6);})[_0x3147('0x14')](function(_0x501b0a){var _0x466c3b=_0x501b0a['headers'][_0x3147('0x2a')];var _0xed7647=_0x466c3b[_0x3147('0x2b')](_0x466c3b['lastIndexOf']('(')+0x1,_0x466c3b[_0x3147('0x2c')](')'));_0x16655e[_0x3147('0x2d')]=_0xed7647;_0x2b352f(_0x16655e);})[_0x3147('0xf')](function(_0x7af20a){_0x254739(_0x7af20a[_0x3147('0x13')]);});});}function getEndUser(_0x14fdce,_0x292859,_0x7443de,_0x17f928,_0x5ea153,_0xbe7598,_0x5073b9){var _0x325692=_0xbe7598['toLowerCase']()===_0x3147('0x2e')?_0x5ea153[_0x3147('0x24')]:_0x5ea153['calleridnum'];return getAuthToken(_0x292859,_0x7443de,_0xbe7598)[_0x3147('0x14')](function(_0x4eef29){var _0x3765b4={'method':_0x3147('0x2f'),'uri':_0x17f928+_0x3147('0x30')+_0x325692[_0x3147('0x31')]('+',_0x3147('0x32'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x4eef29,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x3765b4);})[_0x3147('0x14')](function(_0x4872e1){var _0x9a7df8=![];if(!_0x4872e1)return _0x9a7df8;var _0x339383=_0x4872e1['value'];for(var _0x19356d=0x0;_0x19356d<_0x339383['length'];_0x19356d++){if(_0x339383[_0x19356d][_0x3147('0x33')]===_0x325692){_0x9a7df8=!![];_0x14fdce[_0x3147('0x2d')]=_0x339383[_0x19356d]['contactid'];}}return _0x9a7df8;})[_0x3147('0x14')](function(_0x2d60fe){if(_0x2d60fe)return _0x14fdce;if(_0x5073b9===_0x3147('0x34')){logger[_0x3147('0x1e')]('['+[_0xbe7598[_0x3147('0x11')]()]+_0x3147('0x35'));return _0x14fdce;}return createEndUser(_0x14fdce,_0x292859,_0x7443de,_0x17f928,_0x5ea153,_0xbe7598)[_0x3147('0x14')](function(_0x14c9a9){logger[_0x3147('0x1e')]('['+[_0xbe7598[_0x3147('0x11')]()]+_0x3147('0x36'),_0x14c9a9[_0x3147('0x2d')]);return _0x14c9a9;});});}function getCustomFields(_0x3f27d8,_0x35375e,_0x3be85a){var _0x558238={};if(_0x3f27d8['length']>0x0){_[_0x3147('0x37')](_0x3f27d8,function(_0x496269){if(_[_0x3147('0x38')](['string',_0x3147('0x39')],_0x496269[_0x3147('0x3a')])&&_0x496269[_0x3147('0x3b')]&&!_0x496269[_0x3147('0x3c')]){var _0x15faa5=_0x496269[_0x3147('0x3d')][_0x3147('0x23')]();var _0x4b2fb4=_0x15faa5[_0x3147('0x2b')](0x0,_0x15faa5['indexOf']('_'));var _0x4229bc=_0x15faa5[_0x3147('0x2b')](_0x15faa5[_0x3147('0x3e')]('_')+0x1);if(_0x4b2fb4===_0x3be85a){_0x558238[_0x4229bc]=_0x496269[_0x3147('0x3f')];}}});}return _0x558238;}function getTicket(_0x4affa5,_0x974ad9,_0x3e2799,_0x800704,_0x1d7f21,_0x5b7d5f,_0xea3581){return new BPromise(function(_0xa18cf8,_0x4be178){var _0x3d5837;return getAuthToken(_0x974ad9,_0x3e2799,_0xea3581)['then'](function(_0x5d232c){if(_0x5b7d5f[_0x3147('0x40')]===_0x3147('0x41')){_0x3d5837={'method':_0x3147('0x26'),'uri':_0x800704+_0x3147('0x42'),'body':Object['assign']({},{'title':intUtil[_0x3147('0x43')](_0x5b7d5f[_0x3147('0x44')],_0x1d7f21,'\x20'),'description':intUtil[_0x3147('0x43')](_0x5b7d5f[_0x3147('0x45')],_0x1d7f21,'\x0a'),'customerid_contact@odata.bind':_0x4affa5[_0x3147('0x2d')]?_0x3147('0x46')+_0x4affa5['enduserId']+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4affa5[_0x3147('0x29')]+')','caseorigincode':'1'},getCustomFields(_0x5b7d5f[_0x3147('0x47')],_0x1d7f21,_0x5b7d5f[_0x3147('0x40')])),'headers':{'Authorization':'Bearer\x20'+_0x5d232c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5b7d5f['ticketType']===_0x3147('0x48')){var _0x5de0e2=_0x4affa5['enduserId']?[{'partyid_systemuser@odata.bind':_0x3147('0x28')+_0x4affa5[_0x3147('0x29')]+')','participationtypemask':_0x4affa5[_0x3147('0x49')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x3147('0x46')+_0x4affa5['enduserId']+')','participationtypemask':_0x4affa5[_0x3147('0x49')]===_0x3147('0x4a')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x3147('0x28')+_0x4affa5['userId']+')','participationtypemask':_0x4affa5[_0x3147('0x49')]==='queue'?0x2:0x1}];_0x3d5837={'method':_0x3147('0x26'),'uri':_0x800704+_0x3147('0x4b'),'body':Object[_0x3147('0x4c')]({},{'subject':intUtil[_0x3147('0x43')](_0x5b7d5f['Subjects'],_0x1d7f21,'\x20'),'phonenumber':String(_0x1d7f21[_0x3147('0x25')]),'description':intUtil[_0x3147('0x43')](_0x5b7d5f['Descriptions'],_0x1d7f21,'\x0a'),'regardingobjectid_contact@odata.bind':_0x4affa5[_0x3147('0x2d')]?_0x3147('0x46')+_0x4affa5[_0x3147('0x2d')]+')':undefined,'ownerid@odata.bind':'/systemusers('+_0x4affa5[_0x3147('0x29')]+')','directioncode':_0x4affa5['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':_0x5de0e2},getCustomFields(_0x5b7d5f[_0x3147('0x47')],_0x1d7f21,_0x5b7d5f[_0x3147('0x40')])),'headers':{'Authorization':_0x3147('0x16')+_0x5d232c,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x3d5837);})[_0x3147('0x14')](function(_0x59daaf){var _0x2537bc=_0x59daaf[_0x3147('0x4d')][_0x3147('0x2a')];var _0x1025ab=_0x2537bc[_0x3147('0x2b')](_0x2537bc[_0x3147('0x2c')]('(')+0x1,_0x2537bc[_0x3147('0x2c')](')'));_0x4affa5['ticketId']=_0x1025ab;_0xa18cf8(_0x4affa5);})[_0x3147('0xf')](function(_0x4ad1e2){_0x4be178(_0x4ad1e2[_0x3147('0x13')]);});});}function emit(_0x1dbd3d,_0x10b58e,_0x2c3355,_0x44fb48){var _0x1bcc04={'uri':util[_0x3147('0x4e')](_0x3147('0x4f'),_0x1dbd3d,_0x2c3355,_0x44fb48)};io['to'](util[_0x3147('0x4e')](_0x3147('0x50'),_0x10b58e))[_0x3147('0x51')](_0x3147('0x52'),_0x1bcc04);}exports['cs']=function(_0x5e1613,_0x25c45d,_0xacb15e,_0x1b6715,_0x1b2d7a,_0x5a4881,_0x1e9b08,_0x899bb7){var _0x5cdc74={};_0x5a4881['remoteUri']=intUtil['stripTrailingSlash'](_0x5a4881['remoteUri']);_0x5a4881['serverUrl']=intUtil['stripTrailingSlash'](_0x5a4881[_0x3147('0x53')]);_0x5cdc74['callDirection']=_0x899bb7===_0x3147('0x4a')||_0x899bb7===_0x3147('0x54')?_0x3147('0x4a'):_0x3147('0x2e');var _0x395ac5=util[_0x3147('0x4e')](_0x3147('0x55'),_0x5a4881[_0x3147('0xa')]);var _0x2a98e7=util['format'](_0x3147('0x56'),_0x5a4881[_0x3147('0x57')]);var _0x5ebcb9=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5a4881[_0x3147('0x53')],_0x25c45d[_0x3147('0x58')],md5(_0x25c45d[_0x3147('0x58')]));if(_0x1b2d7a&&_0x1b2d7a[_0x3147('0x59')]){logger['info'](_0x3147('0x5a'),_0x3147('0x5b'));_0x25c45d[_0x3147('0x5c')]=_0x5ebcb9;}else if(_0x1e9b08&&_0x1e9b08[_0x3147('0x5d')]&&_0x1e9b08['recordingFormat']!==_0x3147('0x5e')){logger[_0x3147('0x1e')](_0x3147('0x5f'),_0x3147('0x5b'));_0x25c45d[_0x3147('0x5c')]=_0x5ebcb9;}else{_0x25c45d[_0x3147('0x5c')]='';}return getUser(_0x5cdc74,_0x5a4881,_0x1b6715,_0x2a98e7,_0x395ac5,_0x899bb7)[_0x3147('0x14')](function(_0x11c8a6){logger[_0x3147('0x1e')]('['+_0x899bb7['toUpperCase']()+']\x20The\x20User\x20ID\x20is:',_0x11c8a6[_0x3147('0x29')]);logger[_0x3147('0x1e')]('['+_0x899bb7['toUpperCase']()+_0x3147('0x60'),_0x11c8a6[_0x3147('0x1b')]);return getEndUser(_0x11c8a6,_0x5a4881,_0x2a98e7,_0x395ac5,_0x25c45d,_0x899bb7,_0xacb15e[_0x3147('0x61')]);})[_0x3147('0x14')](function(_0x48732e){logger[_0x3147('0x1e')]('['+_0x899bb7[_0x3147('0x11')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x48732e[_0x3147('0x2d')]);logger[_0x3147('0x1e')]('['+_0x899bb7[_0x3147('0x11')]()+']\x20The\x20Enduser\x20phone\x20is:',_0x25c45d[_0x3147('0x25')]);return getTicket(_0x48732e,_0x5a4881,_0x2a98e7,_0x395ac5,_0x25c45d,_0xacb15e,_0x899bb7);})[_0x3147('0x14')](function(_0x374f9f){logger[_0x3147('0x1e')](util[_0x3147('0x4e')]('['+_0x899bb7[_0x3147('0x11')]()+_0x3147('0x62'),_0xacb15e[_0x3147('0x40')],_0x374f9f[_0x3147('0x63')]));logger[_0x3147('0x1e')](util[_0x3147('0x4e')]('['+_0x899bb7[_0x3147('0x11')]()+_0x3147('0x64'),_0x899bb7));if(_0x899bb7!==_0x3147('0x54')){logger[_0x3147('0x1e')]('['+_0x899bb7[_0x3147('0x11')]()+']',_0x3147('0x65'));emit(_0x5a4881[_0x3147('0xa')],_0x1b6715[_0x3147('0x66')],_0xacb15e[_0x3147('0x40')],_0x374f9f[_0x3147('0x63')]);}})[_0x3147('0xf')](function(_0x16448e){logger[_0x3147('0x10')]('['+_0x899bb7[_0x3147('0x11')]()+']\x20Error\x20running\x20Dynamics365\x20integration',util[_0x3147('0x67')](_0x16448e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x5cc8=['access_token','catch','toUpperCase',']\x20Wrong\x20credentials!','message','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','destcalleridnum','contacts','/systemusers(','headers','substring','lastIndexOf','enduserId','toLowerCase','outbound','calleridnum','GET','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','%2b','telephone1','contactid','nothing',']\x20Enduser\x20created!','forEach','string','picklist','type','indexOf','ticketType','incident','incidents','assign','Subjects','Descriptions','Fields','Bearer\x20','phonecall','callDirection','/contacts(','queue','phonecalls','getString','odata-entityid','ticketId','format','user:%s','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','moduleCreate',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','../../../../config/logger','dynamics365','../../../../config/environment','redis','socket.io-emitter','POST','remoteUri','clientSecret','then'];(function(_0x95cf3f,_0x25e260){var _0x305d5f=function(_0x59e82c){while(--_0x59e82c){_0x95cf3f['push'](_0x95cf3f['shift']());}};_0x305d5f(++_0x25e260);}(_0x5cc8,0x117));var _0x85cc=function(_0x392330,_0x2e3cc8){_0x392330=_0x392330-0x0;var _0x204f4e=_0x5cc8[_0x392330];return _0x204f4e;};'use strict';var _=require(_0x85cc('0x0'));var BPromise=require(_0x85cc('0x1'));var rp=require(_0x85cc('0x2'));var util=require(_0x85cc('0x3'));var intUtil=require(_0x85cc('0x4'));var md5=require(_0x85cc('0x5'));var Redis=require('ioredis');var logger=require(_0x85cc('0x6'))(_0x85cc('0x7'));var config=require(_0x85cc('0x8'));config[_0x85cc('0x9')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x85cc('0xa'))(new Redis(config[_0x85cc('0x9')]));function getAuthToken(_0x14db49,_0x59e8a3,_0x5e339b){var _0x87f9bd={'method':_0x85cc('0xb'),'uri':_0x59e8a3,'form':{'client_id':_0x14db49['clientId'],'resource':_0x14db49[_0x85cc('0xc')],'username':_0x14db49['username'],'password':_0x14db49['password'],'grant_type':'password','client_secret':_0x14db49[_0x85cc('0xd')]},'json':!![]};return rp(_0x87f9bd)[_0x85cc('0xe')](function(_0x101bd3){return _0x101bd3[_0x85cc('0xf')];})[_0x85cc('0x10')](function(_0x55ff68){logger['error']('['+[_0x5e339b[_0x85cc('0x11')]()]+_0x85cc('0x12'));return _0x55ff68[_0x85cc('0x13')];});}function getUser(_0x21b3de,_0x3a11a8,_0x104c71,_0x479844,_0x13aa5f,_0x4f5055){return new BPromise(function(_0x32cc0c,_0xf64348){return getAuthToken(_0x3a11a8,_0x479844,_0x4f5055)[_0x85cc('0xe')](function(_0x340d14){var _0x3b5c32={'method':'GET','uri':_0x13aa5f+_0x85cc('0x14'),'headers':{'Authorization':'Bearer\x20'+_0x340d14,'OData-Version':_0x85cc('0x15')},'json':!![]};return rp(_0x3b5c32);})[_0x85cc('0xe')](function(_0x444f8f){var _0x9554e6=_0x444f8f[_0x85cc('0x16')];var _0x1fa211=![];var _0xf58659=null;if(!_['isNil'](_0x104c71)){if(intUtil[_0x85cc('0x17')](_0x104c71[_0x85cc('0x18')])){_0x21b3de[_0x85cc('0x19')]=_0x104c71[_0x85cc('0x18')];for(_0xf58659=0x0;_0xf58659<_0x9554e6[_0x85cc('0x1a')];_0xf58659++){if(_0x9554e6[_0xf58659][_0x85cc('0x1b')]===_0x104c71[_0x85cc('0x18')]&&!_0x9554e6[_0xf58659][_0x85cc('0x1c')]){_0x1fa211=!![];logger[_0x85cc('0x1d')]('['+[_0x4f5055['toUpperCase']()]+_0x85cc('0x1e')+_0x9554e6[_0xf58659]['systemuserid']+'!');_0x21b3de['userId']=_0x9554e6[_0xf58659][_0x85cc('0x1f')];}}}}if(!_0x1fa211){logger[_0x85cc('0x1d')]('['+[_0x4f5055['toUpperCase']()]+_0x85cc('0x20'));_0x21b3de[_0x85cc('0x19')]=_0x3a11a8['username'];for(_0xf58659=0x0;_0xf58659<_0x9554e6[_0x85cc('0x1a')];_0xf58659++){if(_0x9554e6[_0xf58659][_0x85cc('0x1b')]===_0x3a11a8[_0x85cc('0x21')]){_0x21b3de[_0x85cc('0x22')]=_0x9554e6[_0xf58659]['systemuserid'];}}}_0x32cc0c(_0x21b3de);})['catch'](function(_0x3cefeb){_0xf64348(_0x3cefeb[_0x85cc('0x13')]);});});}function createEndUser(_0x599c57,_0x9b6357,_0x13f3ef,_0x350706,_0x481597,_0x2edee5){return new BPromise(function(_0x1ad1eb,_0x305ffb){return getAuthToken(_0x9b6357,_0x13f3ef,_0x2edee5)[_0x85cc('0xe')](function(_0x1c5500){var _0x2194f6=_0x2edee5['toLowerCase']()==='outbound'?_0x481597[_0x85cc('0x23')]:_0x481597['calleridnum'];var _0x2ab706={'method':_0x85cc('0xb'),'uri':_0x350706+_0x85cc('0x24'),'body':{'telephone1':_0x2194f6,'fullname':_0x2194f6,'firstname':_0x2194f6,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x85cc('0x25')+_0x599c57[_0x85cc('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1c5500,'OData-Version':_0x85cc('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x2ab706);})[_0x85cc('0xe')](function(_0x45debe){var _0x3be169=_0x45debe[_0x85cc('0x26')]['odata-entityid'];var _0x316c7e=_0x3be169[_0x85cc('0x27')](_0x3be169['lastIndexOf']('(')+0x1,_0x3be169[_0x85cc('0x28')](')'));_0x599c57[_0x85cc('0x29')]=_0x316c7e;_0x1ad1eb(_0x599c57);})[_0x85cc('0x10')](function(_0x350740){_0x305ffb(_0x350740[_0x85cc('0x13')]);});});}function getEndUser(_0x5c978d,_0x1e2b87,_0x52c81c,_0x29697a,_0x39e449,_0x40ff30,_0x42d59f){var _0x34bf72=_0x40ff30[_0x85cc('0x2a')]()===_0x85cc('0x2b')?_0x39e449['destcalleridnum']:_0x39e449[_0x85cc('0x2c')];return getAuthToken(_0x1e2b87,_0x52c81c,_0x40ff30)['then'](function(_0x3a2c13){var _0x1a05b7={'method':_0x85cc('0x2d'),'uri':_0x29697a+_0x85cc('0x2e')+_0x34bf72[_0x85cc('0x2f')]('+',_0x85cc('0x30'))+'\x27','headers':{'Authorization':'Bearer\x20'+_0x3a2c13,'If-None-Match':null,'OData-Version':_0x85cc('0x15')},'json':!![]};return rp(_0x1a05b7);})[_0x85cc('0xe')](function(_0x3112e0){var _0x715ad3=![];if(!_0x3112e0)return _0x715ad3;var _0x11ebb3=_0x3112e0[_0x85cc('0x16')];for(var _0x453781=0x0;_0x453781<_0x11ebb3[_0x85cc('0x1a')];_0x453781++){if(_0x11ebb3[_0x453781][_0x85cc('0x31')]===_0x34bf72){_0x715ad3=!![];_0x5c978d[_0x85cc('0x29')]=_0x11ebb3[_0x453781][_0x85cc('0x32')];}}return _0x715ad3;})[_0x85cc('0xe')](function(_0xdfd5a8){if(_0xdfd5a8)return _0x5c978d;if(_0x42d59f===_0x85cc('0x33')){logger[_0x85cc('0x1d')]('['+[_0x40ff30[_0x85cc('0x11')]()]+']\x20Enduser\x20NOT\x20Created\x20-\x20ModuleCreate\x20=\x20Nothing');return _0x5c978d;}return createEndUser(_0x5c978d,_0x1e2b87,_0x52c81c,_0x29697a,_0x39e449,_0x40ff30)[_0x85cc('0xe')](function(_0x45ef3f){logger['info']('['+[_0x40ff30[_0x85cc('0x11')]()]+_0x85cc('0x34'),_0x45ef3f[_0x85cc('0x29')]);return _0x45ef3f;});});}function getCustomFields(_0x125c03,_0x18626a,_0x4b4604){var _0x6d0b23={};if(_0x125c03[_0x85cc('0x1a')]>0x0){_[_0x85cc('0x35')](_0x125c03,function(_0x44d83d){if(_['includes']([_0x85cc('0x36'),_0x85cc('0x37')],_0x44d83d[_0x85cc('0x38')])&&_0x44d83d['nameField']&&!_0x44d83d['customField']){var _0x27dfc0=_0x44d83d['idField'][_0x85cc('0x2a')]();var _0x179b65=_0x27dfc0[_0x85cc('0x27')](0x0,_0x27dfc0[_0x85cc('0x39')]('_'));var _0x5bd5f0=_0x27dfc0[_0x85cc('0x27')](_0x27dfc0[_0x85cc('0x39')]('_')+0x1);if(_0x179b65===_0x4b4604){_0x6d0b23[_0x5bd5f0]=_0x44d83d['content'];}}});}return _0x6d0b23;}function getTicket(_0x5391c4,_0x201db5,_0x5a7907,_0x578adf,_0x18ade1,_0xa7e55e,_0x22d274){return new BPromise(function(_0x10a6a0,_0x146540){var _0x53c570;return getAuthToken(_0x201db5,_0x5a7907,_0x22d274)[_0x85cc('0xe')](function(_0x488f89){if(_0xa7e55e[_0x85cc('0x3a')]===_0x85cc('0x3b')){_0x53c570={'method':_0x85cc('0xb'),'uri':_0x578adf+_0x85cc('0x3c'),'body':Object[_0x85cc('0x3d')]({},{'title':intUtil['getString'](_0xa7e55e[_0x85cc('0x3e')],_0x18ade1,'\x20'),'description':intUtil['getString'](_0xa7e55e[_0x85cc('0x3f')],_0x18ade1,'\x0a'),'customerid_contact@odata.bind':_0x5391c4[_0x85cc('0x29')]?'/contacts('+_0x5391c4['enduserId']+')':undefined,'ownerid@odata.bind':_0x85cc('0x25')+_0x5391c4[_0x85cc('0x22')]+')','caseorigincode':'1'},getCustomFields(_0xa7e55e[_0x85cc('0x40')],_0x18ade1,_0xa7e55e[_0x85cc('0x3a')])),'headers':{'Authorization':_0x85cc('0x41')+_0x488f89,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0xa7e55e[_0x85cc('0x3a')]===_0x85cc('0x42')){var _0x13d1f8=_0x5391c4[_0x85cc('0x29')]?[{'partyid_systemuser@odata.bind':_0x85cc('0x25')+_0x5391c4[_0x85cc('0x22')]+')','participationtypemask':_0x5391c4[_0x85cc('0x43')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x85cc('0x44')+_0x5391c4[_0x85cc('0x29')]+')','participationtypemask':_0x5391c4['callDirection']===_0x85cc('0x45')?0x1:0x2}]:[{'partyid_systemuser@odata.bind':_0x85cc('0x25')+_0x5391c4[_0x85cc('0x22')]+')','participationtypemask':_0x5391c4[_0x85cc('0x43')]===_0x85cc('0x45')?0x2:0x1}];_0x53c570={'method':'POST','uri':_0x578adf+_0x85cc('0x46'),'body':Object[_0x85cc('0x3d')]({},{'subject':intUtil[_0x85cc('0x47')](_0xa7e55e[_0x85cc('0x3e')],_0x18ade1,'\x20'),'phonenumber':String(_0x18ade1[_0x85cc('0x2c')]),'description':intUtil[_0x85cc('0x47')](_0xa7e55e[_0x85cc('0x3f')],_0x18ade1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x5391c4['enduserId']?'/contacts('+_0x5391c4[_0x85cc('0x29')]+')':undefined,'ownerid@odata.bind':_0x85cc('0x25')+_0x5391c4[_0x85cc('0x22')]+')','directioncode':_0x5391c4[_0x85cc('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':_0x13d1f8},getCustomFields(_0xa7e55e[_0x85cc('0x40')],_0x18ade1,_0xa7e55e[_0x85cc('0x3a')])),'headers':{'Authorization':_0x85cc('0x41')+_0x488f89,'OData-Version':_0x85cc('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x53c570);})[_0x85cc('0xe')](function(_0x5907b6){var _0x218395=_0x5907b6[_0x85cc('0x26')][_0x85cc('0x48')];var _0x75daf9=_0x218395['substring'](_0x218395['lastIndexOf']('(')+0x1,_0x218395[_0x85cc('0x28')](')'));_0x5391c4[_0x85cc('0x49')]=_0x75daf9;_0x10a6a0(_0x5391c4);})['catch'](function(_0xafa5e4){_0x146540(_0xafa5e4[_0x85cc('0x13')]);});});}function emit(_0x27f20f,_0xb31ed5,_0x199146,_0xb9b048){var _0x3a5369={'uri':util['format']('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x27f20f,_0x199146,_0xb9b048)};io['to'](util[_0x85cc('0x4a')](_0x85cc('0x4b'),_0xb31ed5))['emit'](_0x85cc('0x4c'),_0x3a5369);}exports['cs']=function(_0x1f7bac,_0x2fb4a1,_0x28e322,_0x2c5896,_0x6a3175,_0xd5447b,_0xb49ad0,_0x128042){var _0x1faeda={};_0xd5447b[_0x85cc('0xc')]=intUtil[_0x85cc('0x4d')](_0xd5447b[_0x85cc('0xc')]);_0xd5447b[_0x85cc('0x4e')]=intUtil[_0x85cc('0x4d')](_0xd5447b[_0x85cc('0x4e')]);_0x1faeda['callDirection']=_0x128042===_0x85cc('0x45')||_0x128042===_0x85cc('0x4f')?_0x85cc('0x45'):_0x85cc('0x2b');var _0x5ab213=util['format']('%s/api/data/v9.0/',_0xd5447b['remoteUri']);var _0x362283=util[_0x85cc('0x4a')]('https://login.microsoftonline.com/%s/oauth2/token',_0xd5447b['tenantId']);var _0x4af728=util[_0x85cc('0x4a')](_0x85cc('0x50'),_0xd5447b[_0x85cc('0x4e')],_0x2fb4a1[_0x85cc('0x51')],md5(_0x2fb4a1[_0x85cc('0x51')]));if(_0x6a3175&&_0x6a3175['monitor_format']){logger[_0x85cc('0x1d')](_0x85cc('0x52'),_0x85cc('0x53'));_0x2fb4a1['recordingURL']=_0x4af728;}else if(_0xb49ad0&&_0xb49ad0['recordingFormat']&&_0xb49ad0[_0x85cc('0x54')]!==_0x85cc('0x55')){logger['info'](_0x85cc('0x56'),_0x85cc('0x53'));_0x2fb4a1[_0x85cc('0x57')]=_0x4af728;}else{_0x2fb4a1[_0x85cc('0x57')]='';}return getUser(_0x1faeda,_0xd5447b,_0x2c5896,_0x362283,_0x5ab213,_0x128042)[_0x85cc('0xe')](function(_0x3a5b00){logger[_0x85cc('0x1d')]('['+_0x128042[_0x85cc('0x11')]()+_0x85cc('0x58'),_0x3a5b00[_0x85cc('0x22')]);logger[_0x85cc('0x1d')]('['+_0x128042['toUpperCase']()+_0x85cc('0x59'),_0x3a5b00[_0x85cc('0x19')]);return getEndUser(_0x3a5b00,_0xd5447b,_0x362283,_0x5ab213,_0x2fb4a1,_0x128042,_0x28e322[_0x85cc('0x5a')]);})[_0x85cc('0xe')](function(_0x300740){logger[_0x85cc('0x1d')]('['+_0x128042[_0x85cc('0x11')]()+_0x85cc('0x5b'),_0x300740[_0x85cc('0x29')]);logger[_0x85cc('0x1d')]('['+_0x128042['toUpperCase']()+_0x85cc('0x5c'),_0x2fb4a1[_0x85cc('0x2c')]);return getTicket(_0x300740,_0xd5447b,_0x362283,_0x5ab213,_0x2fb4a1,_0x28e322,_0x128042);})[_0x85cc('0xe')](function(_0x2fbc88){logger[_0x85cc('0x1d')](util[_0x85cc('0x4a')]('['+_0x128042[_0x85cc('0x11')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x28e322[_0x85cc('0x3a')],_0x2fbc88['ticketId']));logger['info'](util['format']('['+_0x128042[_0x85cc('0x11')]()+']\x20Call\x20direction:\x20%s',_0x128042));if(_0x128042!=='unmanaged'){logger[_0x85cc('0x1d')]('['+_0x128042[_0x85cc('0x11')]()+']',_0x85cc('0x5d'));emit(_0xd5447b[_0x85cc('0xc')],_0x2c5896[_0x85cc('0x5e')],_0x28e322[_0x85cc('0x3a')],_0x2fbc88[_0x85cc('0x49')]);}})[_0x85cc('0x10')](function(_0x44e926){logger[_0x85cc('0x5f')]('['+_0x128042[_0x85cc('0x11')]()+_0x85cc('0x60'),util[_0x85cc('0x61')](_0x44e926,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 4d5b1d1..4b09e2f 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 _0xdcea=['picklist','type','nameField','customField','toLowerCase','includes','idField','push','content','toString','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','Authorization','The\x20User\x20ID\x20is:','calleridnum','user:%s','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','email','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','unmanaged','lastevent','toUpperCase','uniqueid','request-promise','md5','util','ioredis','./util','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','Caller\x20-\x20%s','calleridname','getString','Descriptions','
','name','custom_fields','mapValues','keyBy','format','remoteUri','POST','Ticket\x20created!','validateEmail','%s/api/v2/agents','length','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','then','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','base64','stringify','map','forEach','string'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xdcea,0x1f2));var _0xadce=function(_0x3e6a06,_0x5ddcd6){_0x3e6a06=_0x3e6a06-0x0;var _0xcdc571=_0xdcea[_0x3e6a06];return _0xcdc571;};'use strict';var _=require('lodash');var rp=require(_0xadce('0x0'));var md5=require(_0xadce('0x1'));var util=require(_0xadce('0x2'));var Redis=require(_0xadce('0x3'));var intUtil=require(_0xadce('0x4'));var config=require('../../../../config/environment');var logger=require(_0xadce('0x5'))('freshdesk');config[_0xadce('0x6')]=_[_0xadce('0x7')](config[_0xadce('0x6')],{'host':_0xadce('0x8'),'port':0x18eb});var io=require(_0xadce('0x9'))(new Redis(config[_0xadce('0x6')]));var headers={'Content-Type':_0xadce('0xa'),'Accept':_0xadce('0xa')};function emit(_0x3637b6,_0xc39b0f,_0x250596){io['to'](_0x3637b6)[_0xadce('0xb')](_0xc39b0f,_0x250596);}function getTicket(_0x29e574,_0x318e17,_0x4e3848,_0x1cd5f1,_0x3696ad){logger[_0xadce('0xc')](_0xadce('0xd'));var _0x1a7340=_[_0xadce('0xe')]({'responder_id':_0x318e17['id'],'requester_id':_0x4e3848['id'],'name':util['format'](_0xadce('0xf'),_0x3696ad[_0xadce('0x10')]),'phone':_0x3696ad['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xadce('0x11')](_0x1cd5f1['Subjects'],_0x3696ad,'\x20'),'description':intUtil[_0xadce('0x11')](_0x1cd5f1[_0xadce('0x12')],_0x3696ad,_0xadce('0x13')),'tags':getTags(_0x1cd5f1['Tags'],_0xadce('0x14'))},getCustomFields(_0x1cd5f1['Fields'],_0x3696ad));_0x1a7340[_0xadce('0x15')]=_[_0xadce('0x16')](_[_0xadce('0x17')](_0x1a7340[_0xadce('0x15')],'id'),'value');return request({'uri':util[_0xadce('0x18')]('%s/api/v2/tickets',_0x29e574[_0xadce('0x19')]),'method':_0xadce('0x1a'),'body':_0x1a7340})['then'](function(_0xa05c47){logger['info'](_0xadce('0x1b'));return _0xa05c47;});}function getUser(_0x117001,_0x17d528){if(intUtil[_0xadce('0x1c')](_0x17d528)){return request({'uri':util[_0xadce('0x18')](_0xadce('0x1d'),_0x117001[_0xadce('0x19')]),'qs':{'email':_0x17d528}})['then'](function(_0xe800b0){if(_0xe800b0[_0xadce('0x1e')]){logger[_0xadce('0xc')](_0xadce('0x1f'));return _[_0xadce('0x20')](_0xe800b0,function(_0x21d4a0){return _0x21d4a0[_0xadce('0x21')]['email']===_0x17d528;});}else{logger[_0xadce('0xc')](_0xadce('0x22'));return request({'uri':util[_0xadce('0x18')](_0xadce('0x23'),_0x117001[_0xadce('0x19')])})[_0xadce('0x24')](function(_0x3cbba6){logger['info'](_0xadce('0x25'));return _0x3cbba6;});}});}else{logger['info'](_0xadce('0x26'));return request({'uri':util[_0xadce('0x18')](_0xadce('0x23'),_0x117001[_0xadce('0x19')])})[_0xadce('0x24')](function(_0x19e025){logger['info'](_0xadce('0x25'));return _0x19e025;});}}function getEndUser(_0x141b42,_0x2bf09d,_0xc04648){logger[_0xadce('0xc')]('Searching\x20enduser\x20with\x20phone',_0xc04648);return request({'uri':util[_0xadce('0x18')](_0xadce('0x27'),_0x141b42[_0xadce('0x19')]),'qs':{'phone':_0xc04648}})['then'](function(_0x22e7d0){if(_0x22e7d0[_0xadce('0x1e')]){logger[_0xadce('0xc')](_0xadce('0x28'));return _[_0xadce('0x20')](_0x22e7d0,{'phone':_0xc04648});}else{logger['info'](_0xadce('0x29'));return request({'uri':util[_0xadce('0x18')](_0xadce('0x27'),_0x141b42[_0xadce('0x19')]),'method':_0xadce('0x1a'),'body':{'name':_0x2bf09d,'phone':_0xc04648}})[_0xadce('0x24')](function(_0x258fad){logger[_0xadce('0xc')]('Enduser\x20created.');return _0x258fad;});}});}function getAuth(_0x1d39f8){return util[_0xadce('0x18')]('Basic\x20%s',new Buffer(_0x1d39f8[_0xadce('0x2a')]+':X')['toString'](_0xadce('0x2b')));}function request(_0x23de86){logger['debug']('[HTTP]',JSON[_0xadce('0x2c')](_0x23de86));return rp(_['defaults'](_0x23de86,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x277ea1,_0x1b1b21){var _0x4c5df0=[];if(_0x277ea1&&_0x277ea1['length']>0x0){_0x4c5df0=_[_0xadce('0x2d')](_0x277ea1,_0x1b1b21);}return _0x4c5df0;}function getCustomFields(_0x1f139b,_0x2dff90){var _0x16fe37=[];var _0xa3697c={'custom_fields':[]};if(_0x1f139b[_0xadce('0x1e')]>0x0){_[_0xadce('0x2e')](_0x1f139b,function(_0x25fb31){if(_['includes']([_0xadce('0x2f'),_0xadce('0x30')],_0x25fb31[_0xadce('0x31')])&&_0x25fb31[_0xadce('0x32')]&&!_0x25fb31[_0xadce('0x33')]){_0xa3697c[_0x25fb31['nameField'][_0xadce('0x34')]()]=_0x25fb31['content']['toString']();}else if(_[_0xadce('0x35')](['string',_0xadce('0x30')],_0x25fb31['type'])&&_0x25fb31[_0xadce('0x36')]&&_0x25fb31['customField']){_0xa3697c[_0xadce('0x15')][_0xadce('0x37')]({'id':_0x25fb31['idField'],'value':_0x25fb31[_0xadce('0x38')][_0xadce('0x39')]()});}else if(_0x25fb31['type']===_0xadce('0x3a')&&_0x25fb31[_0xadce('0x3b')]&&_0x25fb31[_0xadce('0x36')]&&_0x25fb31['customField']){_0x2dff90[_0x25fb31[_0xadce('0x3b')]]&&_0xa3697c[_0xadce('0x15')][_0xadce('0x37')]({'id':_0x25fb31['idField'],'value':_0x2dff90[_0x25fb31[_0xadce('0x3b')]][_0xadce('0x39')]()});}else if(_0x25fb31['type']===_0xadce('0x3c')&&_0x25fb31['Variable']&&_0x25fb31['Variable']['name']&&_0x25fb31['idField']&&_0x25fb31[_0xadce('0x33')]){_0x2dff90[_0x25fb31[_0xadce('0x3d')]['name']['toLowerCase']()]&&_0xa3697c[_0xadce('0x15')][_0xadce('0x37')]({'id':_0x25fb31[_0xadce('0x36')],'value':_0x2dff90[_0x25fb31[_0xadce('0x3d')][_0xadce('0x14')]['toLowerCase']()]['toString']()});}});}return _0xa3697c;}exports['queue']=function(_0x2cdf9a,_0xcf04e7,_0x45d9bb,_0x3b86c5,_0x1d6b1b,_0x2bead6){var _0xe4d9b6,_0x3b4eec;_0x2bead6[_0xadce('0x19')]=intUtil[_0xadce('0x3e')](_0x2bead6[_0xadce('0x19')]);_0x2bead6['serverUrl']=intUtil[_0xadce('0x3e')](_0x2bead6[_0xadce('0x3f')]);if(_0x1d6b1b&&_0x1d6b1b[_0xadce('0x40')]){logger[_0xadce('0xc')](_0xadce('0x41'),_0xadce('0x42'));_0xcf04e7[_0xadce('0x43')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2bead6[_0xadce('0x3f')],_0xcf04e7['uniqueid'],md5(_0xcf04e7['uniqueid']));}else{_0xcf04e7[_0xadce('0x43')]='';}headers[_0xadce('0x44')]=getAuth(_0x2bead6);return getUser(_0x2bead6,_0x3b86c5['email'])[_0xadce('0x24')](function(_0x4d0e47){_0xe4d9b6=_0x4d0e47;logger['info'](_0xadce('0x45'),_0xe4d9b6['id']);return getEndUser(_0x2bead6,_0xcf04e7[_0xadce('0x10')],_0xcf04e7[_0xadce('0x46')]);})[_0xadce('0x24')](function(_0x22842a){_0x3b4eec=_0x22842a;logger[_0xadce('0xc')]('The\x20Enduser\x20ID\x20is:',_0x3b4eec['id']);return getTicket(_0x2bead6,_0xe4d9b6,_0x3b4eec,_0x45d9bb,_0xcf04e7);})['then'](function(_0xe85ad7){if(_0xe85ad7&&_0xe85ad7['id']){logger[_0xadce('0xc')](_0xadce('0x1b'));logger[_0xadce('0xc')]('The\x20Ticket\x20ID\x20is:',_0xe85ad7['id']);logger[_0xadce('0xc')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xadce('0x18')](_0xadce('0x47'),_0x3b86c5[_0xadce('0x14')]),'trigger:browser:url',{'uri':util[_0xadce('0x18')](_0xadce('0x48'),_0x2bead6[_0xadce('0x19')],_0xe85ad7['id'])});}})[_0xadce('0x49')](function(_0x16ab64){logger['error'](_0xadce('0x41'),JSON[_0xadce('0x2c')](_0x16ab64));});};exports[_0xadce('0x4a')]=function(_0x37c549,_0x1c6846,_0x2f913d,_0x5a544e,_0x50d2dc,_0x541866,_0x46a681){var _0x438dac,_0x449d7d;_0x541866[_0xadce('0x19')]=intUtil[_0xadce('0x3e')](_0x541866[_0xadce('0x19')]);_0x541866[_0xadce('0x3f')]=intUtil[_0xadce('0x3e')](_0x541866['serverUrl']);if(_0x46a681&&_0x46a681[_0xadce('0x4b')]&&_0x46a681['recordingFormat']!==_0xadce('0x4c')){logger[_0xadce('0xc')](_0xadce('0x4d'),_0xadce('0x42'));_0x1c6846[_0xadce('0x43')]=util[_0xadce('0x18')](_0xadce('0x4e'),_0x541866[_0xadce('0x3f')],_0x1c6846['uniqueid'],md5(_0x1c6846['uniqueid']));}headers['Authorization']=getAuth(_0x541866);return getUser(_0x541866,_0x5a544e[_0xadce('0x4f')])[_0xadce('0x24')](function(_0x59183e){_0x438dac=_0x59183e;logger[_0xadce('0xc')]('The\x20User\x20ID\x20is:',_0x438dac['id']);return getEndUser(_0x541866,_0x1c6846[_0xadce('0x50')],_0x1c6846[_0xadce('0x51')]);})[_0xadce('0x24')](function(_0x4d957a){_0x449d7d=_0x4d957a;logger['info'](_0xadce('0x52'),_0x449d7d['id']);return getTicket(_0x541866,_0x438dac,_0x449d7d,_0x2f913d,_0x1c6846);})['then'](function(_0x598033){if(_0x598033&&_0x598033['id']){logger['info'](_0xadce('0x1b'));logger[_0xadce('0xc')](_0xadce('0x53'),_0x598033['id']);logger['info'](_0xadce('0x4d'),_0xadce('0x54'));emit(util['format'](_0xadce('0x47'),_0x5a544e['name']),_0xadce('0x55'),{'uri':util[_0xadce('0x18')](_0xadce('0x48'),_0x541866[_0xadce('0x19')],_0x598033['id'])});}})[_0xadce('0x49')](function(_0x11f196){logger[_0xadce('0x56')]('[OUTBOUND]',JSON[_0xadce('0x2c')](_0x11f196));});};exports[_0xadce('0x57')]=function(_0x2c672e,_0x17e4f9,_0x4f1b7c,_0x353ea9,_0x34c802,_0xd7bc5a){var _0xf2f89d,_0x10014f;_0xd7bc5a[_0xadce('0x19')]=intUtil['stripTrailingSlash'](_0xd7bc5a[_0xadce('0x19')]);_0xd7bc5a[_0xadce('0x3f')]=intUtil['stripTrailingSlash'](_0xd7bc5a[_0xadce('0x3f')]);if(_0x34c802&&_0x34c802[_0xadce('0x40')]){logger['info']('['+_0x17e4f9[_0xadce('0x58')][_0xadce('0x59')]()+']',_0xadce('0x42'));_0x17e4f9['recordingURL']=util[_0xadce('0x18')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xd7bc5a[_0xadce('0x3f')],_0x17e4f9[_0xadce('0x5a')],md5(_0x17e4f9[_0xadce('0x5a')]));}else{_0x17e4f9[_0xadce('0x43')]='';}headers[_0xadce('0x44')]=getAuth(_0xd7bc5a);return getUser(_0xd7bc5a,'')[_0xadce('0x24')](function(_0x538c75){_0xf2f89d=_0x538c75;logger['info']('The\x20User\x20ID\x20is:',_0xf2f89d['id']);return getEndUser(_0xd7bc5a,_0x17e4f9[_0xadce('0x10')],_0x17e4f9[_0xadce('0x46')]);})[_0xadce('0x24')](function(_0x25a6fa){_0x10014f=_0x25a6fa;logger[_0xadce('0xc')](_0xadce('0x52'),_0x10014f['id']);return getTicket(_0xd7bc5a,_0xf2f89d,_0x10014f,_0x4f1b7c,_0x17e4f9);})[_0xadce('0x24')](function(_0x3acf89){if(_0x3acf89){logger[_0xadce('0xc')](_0xadce('0x1b'));logger[_0xadce('0xc')](_0xadce('0x53'),_0x3acf89['id']);}})[_0xadce('0x49')](function(_0x1d2401){logger['error']('['+_0x17e4f9['lastevent']['toUpperCase']()+']',JSON[_0xadce('0x2c')](_0x1d2401));});}; \ No newline at end of file +var _0xc4e5=['content','toString','idField','variable','variableName','push','customVariable','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','destcalleridname','destcalleridnum','user:%s','lastevent','error','toUpperCase','lodash','request-promise','md5','util','ioredis','./util','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','custom_fields','keyBy','%s/api/v2/tickets','remoteUri','then','info','validateEmail','Agent\x20found!','find','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','Basic\x20%s','apiKey','[HTTP]','stringify','GET','length','map','forEach','includes','string','type','nameField','customField','toLowerCase'];(function(_0x34ec96,_0x18c868){var _0x3c1b34=function(_0x4a1596){while(--_0x4a1596){_0x34ec96['push'](_0x34ec96['shift']());}};_0x3c1b34(++_0x18c868);}(_0xc4e5,0x1e6));var _0x5c4e=function(_0x2dc70d,_0x26e805){_0x2dc70d=_0x2dc70d-0x0;var _0x3b9ecc=_0xc4e5[_0x2dc70d];return _0x3b9ecc;};'use strict';var _=require(_0x5c4e('0x0'));var rp=require(_0x5c4e('0x1'));var md5=require(_0x5c4e('0x2'));var util=require(_0x5c4e('0x3'));var Redis=require(_0x5c4e('0x4'));var intUtil=require(_0x5c4e('0x5'));var config=require('../../../../config/environment');var logger=require(_0x5c4e('0x6'))(_0x5c4e('0x7'));config[_0x5c4e('0x8')]=_[_0x5c4e('0x9')](config[_0x5c4e('0x8')],{'host':_0x5c4e('0xa'),'port':0x18eb});var io=require(_0x5c4e('0xb'))(new Redis(config[_0x5c4e('0x8')]));var headers={'Content-Type':_0x5c4e('0xc'),'Accept':_0x5c4e('0xc')};function emit(_0x2b0df1,_0x22b49a,_0x2b4ae6){io['to'](_0x2b0df1)[_0x5c4e('0xd')](_0x22b49a,_0x2b4ae6);}function getTicket(_0xd701cb,_0x1804a6,_0x3d85da,_0x22e9c5,_0x5b5fd6){logger['info'](_0x5c4e('0xe'));var _0x43830e=_['merge']({'responder_id':_0x1804a6['id'],'requester_id':_0x3d85da['id'],'name':util[_0x5c4e('0xf')](_0x5c4e('0x10'),_0x5b5fd6[_0x5c4e('0x11')]),'phone':_0x5b5fd6[_0x5c4e('0x12')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x5c4e('0x13')](_0x22e9c5[_0x5c4e('0x14')],_0x5b5fd6,'\x20'),'description':intUtil[_0x5c4e('0x13')](_0x22e9c5['Descriptions'],_0x5b5fd6,'
'),'tags':getTags(_0x22e9c5[_0x5c4e('0x15')],_0x5c4e('0x16'))},getCustomFields(_0x22e9c5['Fields'],_0x5b5fd6));_0x43830e[_0x5c4e('0x17')]=_['mapValues'](_[_0x5c4e('0x18')](_0x43830e[_0x5c4e('0x17')],'id'),'value');return request({'uri':util[_0x5c4e('0xf')](_0x5c4e('0x19'),_0xd701cb[_0x5c4e('0x1a')]),'method':'POST','body':_0x43830e})[_0x5c4e('0x1b')](function(_0x3e2902){logger[_0x5c4e('0x1c')]('Ticket\x20created!');return _0x3e2902;});}function getUser(_0x29fbca,_0x2b0c58){if(intUtil[_0x5c4e('0x1d')](_0x2b0c58)){return request({'uri':util[_0x5c4e('0xf')]('%s/api/v2/agents',_0x29fbca['remoteUri']),'qs':{'email':_0x2b0c58}})['then'](function(_0x1db809){if(_0x1db809['length']){logger[_0x5c4e('0x1c')](_0x5c4e('0x1e'));return _[_0x5c4e('0x1f')](_0x1db809,function(_0x559f25){return _0x559f25['contact']['email']===_0x2b0c58;});}else{logger[_0x5c4e('0x1c')](_0x5c4e('0x20'));return request({'uri':util[_0x5c4e('0xf')]('%s/api/v2/agents/me',_0x29fbca[_0x5c4e('0x1a')])})['then'](function(_0x12e51d){logger[_0x5c4e('0x1c')](_0x5c4e('0x21'));return _0x12e51d;});}});}else{logger[_0x5c4e('0x1c')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x5c4e('0x22'),_0x29fbca[_0x5c4e('0x1a')])})[_0x5c4e('0x1b')](function(_0x1b8bb4){logger[_0x5c4e('0x1c')]('Admin\x20account\x20selected.');return _0x1b8bb4;});}}function getEndUser(_0x8dfaaa,_0x379b5c,_0x11635b){logger[_0x5c4e('0x1c')](_0x5c4e('0x23'),_0x11635b);return request({'uri':util[_0x5c4e('0xf')](_0x5c4e('0x24'),_0x8dfaaa[_0x5c4e('0x1a')]),'qs':{'phone':_0x11635b}})['then'](function(_0x55d6e2){if(_0x55d6e2['length']){logger[_0x5c4e('0x1c')]('Enduser\x20found!');return _[_0x5c4e('0x1f')](_0x55d6e2,{'phone':_0x11635b});}else{logger[_0x5c4e('0x1c')](_0x5c4e('0x25'));return request({'uri':util[_0x5c4e('0xf')](_0x5c4e('0x24'),_0x8dfaaa[_0x5c4e('0x1a')]),'method':_0x5c4e('0x26'),'body':{'name':_0x379b5c,'phone':_0x11635b}})[_0x5c4e('0x1b')](function(_0x2e80a6){logger[_0x5c4e('0x1c')](_0x5c4e('0x27'));return _0x2e80a6;});}});}function getAuth(_0x1137d1){return util[_0x5c4e('0xf')](_0x5c4e('0x28'),new Buffer(_0x1137d1[_0x5c4e('0x29')]+':X')['toString']('base64'));}function request(_0x34352b){logger['debug'](_0x5c4e('0x2a'),JSON[_0x5c4e('0x2b')](_0x34352b));return rp(_[_0x5c4e('0x9')](_0x34352b,{'method':_0x5c4e('0x2c'),'headers':headers,'json':!![]}));}function getTags(_0xea2e1e,_0x476454){var _0x37b595=[];if(_0xea2e1e&&_0xea2e1e[_0x5c4e('0x2d')]>0x0){_0x37b595=_[_0x5c4e('0x2e')](_0xea2e1e,_0x476454);}return _0x37b595;}function getCustomFields(_0x536c15,_0x5cfab5){var _0x12b33e=[];var _0x43151f={'custom_fields':[]};if(_0x536c15[_0x5c4e('0x2d')]>0x0){_[_0x5c4e('0x2f')](_0x536c15,function(_0x7936f6){if(_[_0x5c4e('0x30')]([_0x5c4e('0x31'),'picklist'],_0x7936f6[_0x5c4e('0x32')])&&_0x7936f6[_0x5c4e('0x33')]&&!_0x7936f6[_0x5c4e('0x34')]){_0x43151f[_0x7936f6['nameField'][_0x5c4e('0x35')]()]=_0x7936f6[_0x5c4e('0x36')][_0x5c4e('0x37')]();}else if(_[_0x5c4e('0x30')]([_0x5c4e('0x31'),'picklist'],_0x7936f6[_0x5c4e('0x32')])&&_0x7936f6[_0x5c4e('0x38')]&&_0x7936f6[_0x5c4e('0x34')]){_0x43151f[_0x5c4e('0x17')]['push']({'id':_0x7936f6['idField'],'value':_0x7936f6[_0x5c4e('0x36')]['toString']()});}else if(_0x7936f6[_0x5c4e('0x32')]===_0x5c4e('0x39')&&_0x7936f6['variableName']&&_0x7936f6[_0x5c4e('0x38')]&&_0x7936f6[_0x5c4e('0x34')]){_0x5cfab5[_0x7936f6[_0x5c4e('0x3a')]]&&_0x43151f[_0x5c4e('0x17')][_0x5c4e('0x3b')]({'id':_0x7936f6[_0x5c4e('0x38')],'value':_0x5cfab5[_0x7936f6[_0x5c4e('0x3a')]]['toString']()});}else if(_0x7936f6['type']===_0x5c4e('0x3c')&&_0x7936f6[_0x5c4e('0x3d')]&&_0x7936f6[_0x5c4e('0x3d')][_0x5c4e('0x16')]&&_0x7936f6[_0x5c4e('0x38')]&&_0x7936f6['customField']){_0x5cfab5[_0x7936f6[_0x5c4e('0x3d')][_0x5c4e('0x16')]['toLowerCase']()]&&_0x43151f['custom_fields'][_0x5c4e('0x3b')]({'id':_0x7936f6[_0x5c4e('0x38')],'value':_0x5cfab5[_0x7936f6['Variable']['name'][_0x5c4e('0x35')]()][_0x5c4e('0x37')]()});}});}return _0x43151f;}exports[_0x5c4e('0x3e')]=function(_0x42a68d,_0x99988a,_0x474d3c,_0x4c577e,_0x57e690,_0x82db8b){var _0x268f3a,_0x4d9952;_0x82db8b[_0x5c4e('0x1a')]=intUtil[_0x5c4e('0x3f')](_0x82db8b[_0x5c4e('0x1a')]);_0x82db8b[_0x5c4e('0x40')]=intUtil['stripTrailingSlash'](_0x82db8b[_0x5c4e('0x40')]);if(_0x57e690&&_0x57e690['monitor_format']){logger['info'](_0x5c4e('0x41'),_0x5c4e('0x42'));_0x99988a[_0x5c4e('0x43')]=util[_0x5c4e('0xf')](_0x5c4e('0x44'),_0x82db8b[_0x5c4e('0x40')],_0x99988a['uniqueid'],md5(_0x99988a['uniqueid']));}else{_0x99988a[_0x5c4e('0x43')]='';}headers[_0x5c4e('0x45')]=getAuth(_0x82db8b);return getUser(_0x82db8b,_0x4c577e[_0x5c4e('0x46')])[_0x5c4e('0x1b')](function(_0x59f059){_0x268f3a=_0x59f059;logger[_0x5c4e('0x1c')](_0x5c4e('0x47'),_0x268f3a['id']);return getEndUser(_0x82db8b,_0x99988a[_0x5c4e('0x11')],_0x99988a[_0x5c4e('0x12')]);})[_0x5c4e('0x1b')](function(_0x598e82){_0x4d9952=_0x598e82;logger[_0x5c4e('0x1c')](_0x5c4e('0x48'),_0x4d9952['id']);return getTicket(_0x82db8b,_0x268f3a,_0x4d9952,_0x474d3c,_0x99988a);})[_0x5c4e('0x1b')](function(_0x20e74f){if(_0x20e74f&&_0x20e74f['id']){logger['info'](_0x5c4e('0x49'));logger[_0x5c4e('0x1c')](_0x5c4e('0x4a'),_0x20e74f['id']);logger['info'](_0x5c4e('0x41'),_0x5c4e('0x4b'));emit(util[_0x5c4e('0xf')]('user:%s',_0x4c577e[_0x5c4e('0x16')]),_0x5c4e('0x4c'),{'uri':util[_0x5c4e('0xf')](_0x5c4e('0x4d'),_0x82db8b[_0x5c4e('0x1a')],_0x20e74f['id'])});}})[_0x5c4e('0x4e')](function(_0x109ce8){logger['error'](_0x5c4e('0x41'),JSON['stringify'](_0x109ce8));});};exports[_0x5c4e('0x4f')]=function(_0x1647be,_0x48f042,_0x19bb65,_0xdb0558,_0xbbe1f1,_0x5472b5,_0x432756){var _0x2b3e0e,_0x5d5e5f;_0x5472b5['remoteUri']=intUtil['stripTrailingSlash'](_0x5472b5['remoteUri']);_0x5472b5[_0x5c4e('0x40')]=intUtil[_0x5c4e('0x3f')](_0x5472b5[_0x5c4e('0x40')]);if(_0x432756&&_0x432756[_0x5c4e('0x50')]&&_0x432756[_0x5c4e('0x50')]!==_0x5c4e('0x51')){logger['info'](_0x5c4e('0x52'),_0x5c4e('0x42'));_0x48f042[_0x5c4e('0x43')]=util['format'](_0x5c4e('0x44'),_0x5472b5[_0x5c4e('0x40')],_0x48f042[_0x5c4e('0x53')],md5(_0x48f042[_0x5c4e('0x53')]));}headers[_0x5c4e('0x45')]=getAuth(_0x5472b5);return getUser(_0x5472b5,_0xdb0558[_0x5c4e('0x46')])[_0x5c4e('0x1b')](function(_0x16678c){_0x2b3e0e=_0x16678c;logger[_0x5c4e('0x1c')](_0x5c4e('0x47'),_0x2b3e0e['id']);return getEndUser(_0x5472b5,_0x48f042[_0x5c4e('0x54')],_0x48f042[_0x5c4e('0x55')]);})[_0x5c4e('0x1b')](function(_0x3bbd32){_0x5d5e5f=_0x3bbd32;logger[_0x5c4e('0x1c')](_0x5c4e('0x48'),_0x5d5e5f['id']);return getTicket(_0x5472b5,_0x2b3e0e,_0x5d5e5f,_0x19bb65,_0x48f042);})[_0x5c4e('0x1b')](function(_0x1d7c91){if(_0x1d7c91&&_0x1d7c91['id']){logger[_0x5c4e('0x1c')]('Ticket\x20created!');logger[_0x5c4e('0x1c')]('The\x20Ticket\x20ID\x20is:',_0x1d7c91['id']);logger[_0x5c4e('0x1c')](_0x5c4e('0x52'),_0x5c4e('0x4b'));emit(util['format'](_0x5c4e('0x56'),_0xdb0558[_0x5c4e('0x16')]),_0x5c4e('0x4c'),{'uri':util[_0x5c4e('0xf')](_0x5c4e('0x4d'),_0x5472b5[_0x5c4e('0x1a')],_0x1d7c91['id'])});}})['catch'](function(_0x8ee620){logger['error']('[OUTBOUND]',JSON['stringify'](_0x8ee620));});};exports['unmanaged']=function(_0x1b10ad,_0x292914,_0x565eaf,_0x2845f2,_0x322018,_0x2a0ed4){var _0x63a6e,_0x290353;_0x2a0ed4[_0x5c4e('0x1a')]=intUtil[_0x5c4e('0x3f')](_0x2a0ed4[_0x5c4e('0x1a')]);_0x2a0ed4[_0x5c4e('0x40')]=intUtil[_0x5c4e('0x3f')](_0x2a0ed4[_0x5c4e('0x40')]);if(_0x322018&&_0x322018['monitor_format']){logger[_0x5c4e('0x1c')]('['+_0x292914[_0x5c4e('0x57')]['toUpperCase']()+']',_0x5c4e('0x42'));_0x292914[_0x5c4e('0x43')]=util[_0x5c4e('0xf')](_0x5c4e('0x44'),_0x2a0ed4[_0x5c4e('0x40')],_0x292914[_0x5c4e('0x53')],md5(_0x292914[_0x5c4e('0x53')]));}else{_0x292914[_0x5c4e('0x43')]='';}headers[_0x5c4e('0x45')]=getAuth(_0x2a0ed4);return getUser(_0x2a0ed4,'')[_0x5c4e('0x1b')](function(_0x327703){_0x63a6e=_0x327703;logger[_0x5c4e('0x1c')](_0x5c4e('0x47'),_0x63a6e['id']);return getEndUser(_0x2a0ed4,_0x292914[_0x5c4e('0x11')],_0x292914[_0x5c4e('0x12')]);})[_0x5c4e('0x1b')](function(_0x30a900){_0x290353=_0x30a900;logger[_0x5c4e('0x1c')](_0x5c4e('0x48'),_0x290353['id']);return getTicket(_0x2a0ed4,_0x63a6e,_0x290353,_0x565eaf,_0x292914);})['then'](function(_0x2b65c9){if(_0x2b65c9){logger[_0x5c4e('0x1c')](_0x5c4e('0x49'));logger[_0x5c4e('0x1c')](_0x5c4e('0x4a'),_0x2b65c9['id']);}})[_0x5c4e('0x4e')](function(_0x29fc51){logger[_0x5c4e('0x58')]('['+_0x292914[_0x5c4e('0x57')][_0x5c4e('0x59')]()+']',JSON[_0x5c4e('0x2b')](_0x29fc51));});}; \ 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 ac39ad4..de31a45 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 _0xf231=['destcalleridnum','calleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','request-promise','md5','util','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','Getting\x20admin\x20information','users','email','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','Getting\x20user\x20list','agentEmail','userEmail','length','userId','Admin\x20selected','adminEmail','&f=','&entities=contact','then','find','contacts','format','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','contact','message','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','add','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound'];(function(_0x40304d,_0x5387b9){var _0x2e4b80=function(_0x172393){while(--_0x172393){_0x40304d['push'](_0x40304d['shift']());}};_0x2e4b80(++_0x5387b9);}(_0xf231,0xbd));var _0x1f23=function(_0x3a49cf,_0x1b909){_0x3a49cf=_0x3a49cf-0x0;var _0x1f5efb=_0xf231[_0x3a49cf];return _0x1f5efb;};'use strict';var _=require('lodash');var rp=require(_0x1f23('0x0'));var md5=require(_0x1f23('0x1'));var util=require(_0x1f23('0x2'));var moment=require('moment');var Promise=require('bluebird');var Redis=require('ioredis');var intUtil=require(_0x1f23('0x3'));var config=require(_0x1f23('0x4'));var logger=require(_0x1f23('0x5'))(_0x1f23('0x6'));config[_0x1f23('0x7')]=_[_0x1f23('0x8')](config[_0x1f23('0x7')],{'host':_0x1f23('0x9'),'port':0x18eb});var io=require(_0x1f23('0xa'))(new Redis(config[_0x1f23('0x7')]));function getAdminId(_0x41de14,_0x140b16,_0x4d4def,_0x6e2633){return new Promise(function(_0x5e6275,_0x4a571b){var _0x3e0137=![];var _0x5cf29e={'method':_0x1f23('0xb'),'uri':_0x6e2633+_0x1f23('0xc'),'json':!![]};_0x5cf29e[_0x1f23('0xd')]=_0x4d4def;logger['info'](_0x1f23('0xe'));return rp(_0x5cf29e)['then'](function(_0x47d036){if(_0x47d036){var _0x31a5f6=_0x47d036[_0x1f23('0xf')];var _0x29d690=null;for(_0x29d690=0x0;_0x29d690<_0x31a5f6['length'];_0x29d690++){if(_0x31a5f6[_0x29d690][_0x1f23('0x10')]===_0x41de14['adminEmail']){_0x41de14[_0x1f23('0x11')]=_0x31a5f6[_0x29d690]['id'];_0x3e0137=!![];}}if(_0x3e0137){logger[_0x1f23('0x12')](_0x1f23('0x13'),_0x41de14[_0x1f23('0x11')]);_0x5e6275(_0x41de14);}else{_0x4a571b({'statusCode':0x194,'message':_0x1f23('0x14')});}}else{_0x4a571b({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x1f23('0x15')](function(_0x1d5204){logger[_0x1f23('0x16')]('['+[_0x140b16[_0x1f23('0x17')]()]+']',_0x1d5204['message']);_0x4a571b(_0x1d5204);});});}function getUser(_0x65d80f,_0x25c41a,_0x19ec5b){return function(_0x1f1848){return new Promise(function(_0x5917cd,_0x419a1c){var _0x2377d8={'method':_0x1f23('0xb'),'uri':_0x19ec5b+_0x1f23('0xc'),'json':!![]};_0x2377d8[_0x1f23('0xd')]=_0x25c41a;logger['info'](_0x1f23('0x18'));return rp(_0x2377d8)['then'](function(_0x544ffd){if(_0x544ffd){var _0x20841c=_0x544ffd[_0x1f23('0xf')];var _0x2f01b2=![];var _0x24a1d5=null;if(_0x1f1848[_0x1f23('0x19')]!==null){logger['info']('Getting\x20user\x20with\x20email',_0x1f1848[_0x1f23('0x19')]);_0x1f1848[_0x1f23('0x1a')]=_0x1f1848[_0x1f23('0x19')];for(_0x24a1d5=0x0;_0x24a1d5<_0x20841c[_0x1f23('0x1b')];_0x24a1d5++){if(_0x20841c[_0x24a1d5]['email']===_0x1f1848[_0x1f23('0x19')]){_0x2f01b2=!![];_0x1f1848[_0x1f23('0x1c')]=_0x20841c[_0x24a1d5]['id'];logger[_0x1f23('0x12')]('User\x20found:',_0x1f1848[_0x1f23('0x1c')]);}}}if(!_0x2f01b2){logger[_0x1f23('0x12')](_0x1f23('0x1d'));_0x1f1848['userEmail']=_0x1f1848[_0x1f23('0x1e')];_0x1f1848[_0x1f23('0x1c')]=_0x1f1848[_0x1f23('0x11')];_0x2f01b2=!![];}if(_0x2f01b2){_0x5917cd(_0x1f1848);}else{_0x419a1c({'statusCode':0x194,'message':_0x1f23('0x14')});}}else{_0x419a1c({'statusCode':0x194,'message':_0x1f23('0x14')});}})[_0x1f23('0x15')](function(_0x368131){logger[_0x1f23('0x16')]('['+[_0x65d80f[_0x1f23('0x17')]()]+']',_0x368131['message']);_0x419a1c(_0x368131);});});};}function searchContact(_0x5ba7c,_0x395d80,_0x474a60,_0x4f9c77){return new Promise(function(_0x5204d7,_0xe31077){var _0x18ad05={'method':'GET','headers':_0x395d80,'uri':_0x5ba7c+'/api/lookup?q='+_0x4f9c77+_0x1f23('0x1f')+_0x474a60+_0x1f23('0x20'),'json':!![]};rp(_0x18ad05)[_0x1f23('0x21')](function(_0x271812){var _0x5944bc=_[_0x1f23('0x22')](_0x271812[_0x1f23('0x23')][_0x1f23('0x23')],[_0x474a60,_0x4f9c77]);_0x5204d7(_0x5944bc);})[_0x1f23('0x15')](function(_0x179d84){_0xe31077(_0x179d84);});});}function getEndUser(_0x20008a,_0x504fa7,_0x47ca82){return function(_0x374467){return new Promise(function(_0x4a359f,_0x4d2c86){logger[_0x1f23('0x12')](util[_0x1f23('0x24')]('Searching\x20contact\x20with\x20phone\x20%s',_0x374467[_0x1f23('0x25')]));searchContact(_0x47ca82,_0x504fa7,_0x1f23('0x26'),_0x374467[_0x1f23('0x25')])[_0x1f23('0x21')](function(_0x187060){if(_0x187060){_0x374467[_0x1f23('0x27')]=_0x187060['id'];logger['info'](_0x1f23('0x28'),_0x374467[_0x1f23('0x27')]);return _0x4a359f(_0x374467);}searchContact(_0x47ca82,_0x504fa7,'work_number',_0x374467['contactNumber'])[_0x1f23('0x21')](function(_0x3db3a0){if(_0x3db3a0){_0x374467[_0x1f23('0x27')]=_0x3db3a0['id'];logger[_0x1f23('0x12')](_0x1f23('0x29'),_0x374467[_0x1f23('0x27')]);return _0x4a359f(_0x374467);}createEndUser(_0x374467,_0x20008a,_0x504fa7,_0x47ca82)[_0x1f23('0x21')](function(_0x25f107){logger[_0x1f23('0x12')](_0x1f23('0x2a'),_0x25f107['endUserId']);return _0x4a359f(_0x25f107);});});})['catch'](function(_0x2a8ee1){_0x4d2c86(_0x2a8ee1);});});};}function createEndUser(_0x2f724a,_0x16fdd8,_0x272486,_0x463a0b){return new Promise(function(_0x5a557e,_0x4b5eda){var _0x78b6c4=moment();var _0xbd2663={'method':_0x1f23('0x2b'),'uri':_0x463a0b+'/api/contacts','body':{'contact':{'last_name':_0x2f724a['contactNumber'],'work_number':_0x2f724a['contactNumber'],'mobile_number':_0x2f724a['contactNumber'],'owner_id':_0x2f724a[_0x1f23('0x1c')],'created_at':_0x78b6c4[_0x1f23('0x24')](_0x1f23('0x2c'))}},'json':!![]};_0xbd2663['headers']=_0x272486;logger[_0x1f23('0x12')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0xbd2663)[_0x1f23('0x21')](function(_0x4c440b){_0x2f724a[_0x1f23('0x27')]=_0x4c440b[_0x1f23('0x2d')]['id'];_0x5a557e(_0x2f724a);})['catch'](function(_0x54234c){logger['error']('['+[_0x16fdd8[_0x1f23('0x17')]()]+']',_0x54234c[_0x1f23('0x2e')]);_0x4b5eda(_0x54234c[_0x1f23('0x2e')]);});});}function getTicket(_0x5d1b1e,_0x152c1f,_0x1a2919,_0x212a98,_0x1f8a27){return function(_0x165990){logger[_0x1f23('0x12')](_0x1f23('0x2f'));return new Promise(function(_0xab90a4,_0x253cdd){var _0x56bed3=moment();var _0x4f5db2={'method':'POST','uri':_0x1a2919+_0x1f23('0x30'),'body':{'title':intUtil[_0x1f23('0x31')](_0x212a98[_0x1f23('0x32')],_0x1f8a27,'\x20'),'description':intUtil['getString'](_0x212a98[_0x1f23('0x33')],_0x1f8a27,'\x0a'),'owner_id':_0x165990[_0x1f23('0x1c')],'creater_id':_0x165990[_0x1f23('0x11')],'targetable_id':_0x165990[_0x1f23('0x27')],'targetable_type':'Contact','created_at':_0x56bed3[_0x1f23('0x24')](_0x1f23('0x2c')),'due_date':_0x56bed3[_0x1f23('0x34')](0x1e,'m')[_0x1f23('0x24')](_0x1f23('0x2c'))},'json':!![]};_0x4f5db2[_0x1f23('0xd')]=_0x152c1f;return rp(_0x4f5db2)['then'](function(_0x4158b3){_0x165990[_0x1f23('0x35')]=_0x4158b3[_0x1f23('0x36')]['id'];logger[_0x1f23('0x12')](_0x1f23('0x37'),_0x165990[_0x1f23('0x35')]);_0xab90a4(_0x165990);})['catch'](function(_0x54fec5){logger[_0x1f23('0x16')]('['+[_0x5d1b1e[_0x1f23('0x17')]()]+']',_0x54fec5[_0x1f23('0x2e')]);_0x253cdd(_0x54fec5[_0x1f23('0x2e')]);});});};}function emit(_0x2f679a,_0x58c251,_0xf89038){var _0x1ddad4={'uri':_0x2f679a+_0x1f23('0x38')+_0xf89038};io['to'](util[_0x1f23('0x24')](_0x1f23('0x39'),_0x58c251))[_0x1f23('0x3a')]('trigger:browser:url',_0x1ddad4);}exports['cs']=function(_0x10e0e4,_0x528cfa,_0xa96c05,_0x263f02,_0x25465e,_0x2536c9,_0x15bcfe,_0x15c4cb){var _0x531dad={};var _0x26edae={'Authorization':_0x1f23('0x3b')+_0x2536c9[_0x1f23('0x3c')]};_0x2536c9['remoteUri']=intUtil['stripTrailingSlash'](_0x2536c9[_0x1f23('0x3d')]);_0x2536c9['serverUrl']=intUtil[_0x1f23('0x3e')](_0x2536c9[_0x1f23('0x3f')]);var _0x5baf9c=_0x2536c9['remoteUri'];_0x531dad[_0x1f23('0x1e')]=_0x2536c9['username'];_0x531dad[_0x1f23('0x25')]=_0x15c4cb[_0x1f23('0x40')]()===_0x1f23('0x41')?_0x528cfa[_0x1f23('0x42')]:_0x528cfa[_0x1f23('0x43')];_0x531dad[_0x1f23('0x44')]=_0x15c4cb==='queue'||_0x15c4cb===_0x1f23('0x45')?_0x1f23('0x46'):_0x1f23('0x41');if(_0x263f02){_0x531dad[_0x1f23('0x19')]=_0x263f02[_0x1f23('0x10')];}var _0x1e694f=util['format'](_0x1f23('0x47'),_0x2536c9[_0x1f23('0x3f')],_0x528cfa[_0x1f23('0x48')],md5(_0x528cfa[_0x1f23('0x48')]));if(_0x25465e&&_0x25465e[_0x1f23('0x49')]){logger[_0x1f23('0x12')](_0x1f23('0x4a'),_0x1f23('0x4b'));_0x528cfa[_0x1f23('0x4c')]=_0x1e694f;}else if(_0x15bcfe&&_0x15bcfe[_0x1f23('0x4d')]&&_0x15bcfe[_0x1f23('0x4d')]!==_0x1f23('0x4e')){logger['info'](_0x1f23('0x4f'),_0x1f23('0x4b'));_0x528cfa[_0x1f23('0x4c')]=_0x1e694f;}else{_0x528cfa[_0x1f23('0x4c')]='';}return getAdminId(_0x531dad,_0x15c4cb,_0x26edae,_0x5baf9c)[_0x1f23('0x21')](getUser(_0x15c4cb,_0x26edae,_0x5baf9c))[_0x1f23('0x21')](getEndUser(_0x15c4cb,_0x26edae,_0x5baf9c))[_0x1f23('0x21')](getTicket(_0x15c4cb,_0x26edae,_0x5baf9c,_0xa96c05,_0x528cfa))['then'](function(_0x36ea17){logger['info'](util[_0x1f23('0x24')](_0x1f23('0x50'),_0x36ea17['ticketId']));if(_0x15c4cb!==_0x1f23('0x45')){logger['info']('['+[_0x15c4cb['toUpperCase']()]+']',_0x1f23('0x51'));emit(_0x5baf9c,_0x263f02[_0x1f23('0x52')],_0x36ea17['endUserId']);}})[_0x1f23('0x15')](function(_0x38a09f){logger['error']('['+[_0x15c4cb['toUpperCase']()]+_0x1f23('0x53'),util[_0x1f23('0x54')](_0x38a09f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd92b=['serverUrl','username','outbound','destcalleridnum','calleridnum','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','name',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','util','moment','bluebird','./util','../../../../config/logger','freshsales','redis','defaults','localhost','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','email','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','GET','agentEmail','userEmail','length','userId','User\x20found:','Admin\x20selected','message','/api/lookup?q=','&f=','&entities=contact','find','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','error','Creating\x20new\x20task','/api/tasks','Subjects','getString','Contact','ticketId','task','Task\x20created:','user:%s','emit','trigger:browser:url','Token\x20token=','remoteUri','stripTrailingSlash'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xd92b,0x158));var _0xbd92=function(_0x242379,_0x2f660d){_0x242379=_0x242379-0x0;var _0x399b1c=_0xd92b[_0x242379];return _0x399b1c;};'use strict';var _=require(_0xbd92('0x0'));var rp=require(_0xbd92('0x1'));var md5=require('md5');var util=require(_0xbd92('0x2'));var moment=require(_0xbd92('0x3'));var Promise=require(_0xbd92('0x4'));var Redis=require('ioredis');var intUtil=require(_0xbd92('0x5'));var config=require('../../../../config/environment');var logger=require(_0xbd92('0x6'))(_0xbd92('0x7'));config[_0xbd92('0x8')]=_[_0xbd92('0x9')](config[_0xbd92('0x8')],{'host':_0xbd92('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x431947,_0x3023ec,_0x4783a5,_0x2a8c13){return new Promise(function(_0x362d5e,_0x33781d){var _0x2d4078=![];var _0x29af4b={'method':'GET','uri':_0x2a8c13+_0xbd92('0xb'),'json':!![]};_0x29af4b[_0xbd92('0xc')]=_0x4783a5;logger[_0xbd92('0xd')](_0xbd92('0xe'));return rp(_0x29af4b)[_0xbd92('0xf')](function(_0x4e6edc){if(_0x4e6edc){var _0x1fc8f1=_0x4e6edc[_0xbd92('0x10')];var _0xec7488=null;for(_0xec7488=0x0;_0xec7488<_0x1fc8f1['length'];_0xec7488++){if(_0x1fc8f1[_0xec7488][_0xbd92('0x11')]===_0x431947['adminEmail']){_0x431947[_0xbd92('0x12')]=_0x1fc8f1[_0xec7488]['id'];_0x2d4078=!![];}}if(_0x2d4078){logger[_0xbd92('0xd')]('Admin\x20found:',_0x431947[_0xbd92('0x12')]);_0x362d5e(_0x431947);}else{_0x33781d({'statusCode':0x194,'message':_0xbd92('0x13')});}}else{_0x33781d({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0xbd92('0x14')](function(_0x588972){logger['error']('['+[_0x3023ec[_0xbd92('0x15')]()]+']',_0x588972['message']);_0x33781d(_0x588972);});});}function getUser(_0x1ff0b2,_0xd1da4c,_0x24b666){return function(_0x17c752){return new Promise(function(_0x46b768,_0x4e01af){var _0x556ba7={'method':_0xbd92('0x16'),'uri':_0x24b666+_0xbd92('0xb'),'json':!![]};_0x556ba7[_0xbd92('0xc')]=_0xd1da4c;logger[_0xbd92('0xd')]('Getting\x20user\x20list');return rp(_0x556ba7)[_0xbd92('0xf')](function(_0x26c63a){if(_0x26c63a){var _0x3c736a=_0x26c63a['users'];var _0x48fdef=![];var _0x58556a=null;if(_0x17c752[_0xbd92('0x17')]!==null){logger[_0xbd92('0xd')]('Getting\x20user\x20with\x20email',_0x17c752[_0xbd92('0x17')]);_0x17c752[_0xbd92('0x18')]=_0x17c752['agentEmail'];for(_0x58556a=0x0;_0x58556a<_0x3c736a[_0xbd92('0x19')];_0x58556a++){if(_0x3c736a[_0x58556a][_0xbd92('0x11')]===_0x17c752['agentEmail']){_0x48fdef=!![];_0x17c752[_0xbd92('0x1a')]=_0x3c736a[_0x58556a]['id'];logger[_0xbd92('0xd')](_0xbd92('0x1b'),_0x17c752[_0xbd92('0x1a')]);}}}if(!_0x48fdef){logger['info'](_0xbd92('0x1c'));_0x17c752[_0xbd92('0x18')]=_0x17c752['adminEmail'];_0x17c752[_0xbd92('0x1a')]=_0x17c752[_0xbd92('0x12')];_0x48fdef=!![];}if(_0x48fdef){_0x46b768(_0x17c752);}else{_0x4e01af({'statusCode':0x194,'message':_0xbd92('0x13')});}}else{_0x4e01af({'statusCode':0x194,'message':_0xbd92('0x13')});}})[_0xbd92('0x14')](function(_0x3aa69b){logger['error']('['+[_0x1ff0b2[_0xbd92('0x15')]()]+']',_0x3aa69b[_0xbd92('0x1d')]);_0x4e01af(_0x3aa69b);});});};}function searchContact(_0x3ec19b,_0x3241fc,_0x14aa5b,_0x1dfb9d){return new Promise(function(_0x240515,_0x11ae42){var _0x49edf={'method':'GET','headers':_0x3241fc,'uri':_0x3ec19b+_0xbd92('0x1e')+_0x1dfb9d+_0xbd92('0x1f')+_0x14aa5b+_0xbd92('0x20'),'json':!![]};rp(_0x49edf)[_0xbd92('0xf')](function(_0x524184){var _0x247c57=_[_0xbd92('0x21')](_0x524184[_0xbd92('0x22')][_0xbd92('0x22')],[_0x14aa5b,_0x1dfb9d]);_0x240515(_0x247c57);})['catch'](function(_0x27cbb4){_0x11ae42(_0x27cbb4);});});}function getEndUser(_0x36170f,_0x2986d5,_0x3499aa){return function(_0x1122c9){return new Promise(function(_0x219570,_0x423d2c){logger[_0xbd92('0xd')](util[_0xbd92('0x23')](_0xbd92('0x24'),_0x1122c9[_0xbd92('0x25')]));searchContact(_0x3499aa,_0x2986d5,_0xbd92('0x26'),_0x1122c9['contactNumber'])[_0xbd92('0xf')](function(_0x1e677e){if(_0x1e677e){_0x1122c9[_0xbd92('0x27')]=_0x1e677e['id'];logger[_0xbd92('0xd')](_0xbd92('0x28'),_0x1122c9[_0xbd92('0x27')]);return _0x219570(_0x1122c9);}searchContact(_0x3499aa,_0x2986d5,'work_number',_0x1122c9[_0xbd92('0x25')])[_0xbd92('0xf')](function(_0x342045){if(_0x342045){_0x1122c9['endUserId']=_0x342045['id'];logger[_0xbd92('0xd')](_0xbd92('0x29'),_0x1122c9[_0xbd92('0x27')]);return _0x219570(_0x1122c9);}createEndUser(_0x1122c9,_0x36170f,_0x2986d5,_0x3499aa)[_0xbd92('0xf')](function(_0x22eed3){logger['info']('Contact\x20created:',_0x22eed3[_0xbd92('0x27')]);return _0x219570(_0x22eed3);});});})[_0xbd92('0x14')](function(_0x4bef16){_0x423d2c(_0x4bef16);});});};}function createEndUser(_0x30727b,_0x35870b,_0x5c3977,_0x3425a5){return new Promise(function(_0x528b50,_0x1d9e73){var _0x4ddefd=moment();var _0x46d638={'method':_0xbd92('0x2a'),'uri':_0x3425a5+'/api/contacts','body':{'contact':{'last_name':_0x30727b[_0xbd92('0x25')],'work_number':_0x30727b['contactNumber'],'mobile_number':_0x30727b[_0xbd92('0x25')],'owner_id':_0x30727b[_0xbd92('0x1a')],'created_at':_0x4ddefd[_0xbd92('0x23')](_0xbd92('0x2b'))}},'json':!![]};_0x46d638[_0xbd92('0xc')]=_0x5c3977;logger['info'](_0xbd92('0x2c'));return rp(_0x46d638)[_0xbd92('0xf')](function(_0x11c64e){_0x30727b[_0xbd92('0x27')]=_0x11c64e[_0xbd92('0x2d')]['id'];_0x528b50(_0x30727b);})[_0xbd92('0x14')](function(_0x457c7a){logger[_0xbd92('0x2e')]('['+[_0x35870b['toUpperCase']()]+']',_0x457c7a['message']);_0x1d9e73(_0x457c7a[_0xbd92('0x1d')]);});});}function getTicket(_0x50ad80,_0x2b2d90,_0x51de2e,_0x297345,_0x13bfaf){return function(_0x57256e){logger['info'](_0xbd92('0x2f'));return new Promise(function(_0x4307d8,_0x524ae1){var _0x42ae60=moment();var _0x17e95c={'method':_0xbd92('0x2a'),'uri':_0x51de2e+_0xbd92('0x30'),'body':{'title':intUtil['getString'](_0x297345[_0xbd92('0x31')],_0x13bfaf,'\x20'),'description':intUtil[_0xbd92('0x32')](_0x297345['Descriptions'],_0x13bfaf,'\x0a'),'owner_id':_0x57256e[_0xbd92('0x1a')],'creater_id':_0x57256e['adminId'],'targetable_id':_0x57256e[_0xbd92('0x27')],'targetable_type':_0xbd92('0x33'),'created_at':_0x42ae60[_0xbd92('0x23')](_0xbd92('0x2b')),'due_date':_0x42ae60['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x17e95c['headers']=_0x2b2d90;return rp(_0x17e95c)[_0xbd92('0xf')](function(_0x3a2872){_0x57256e[_0xbd92('0x34')]=_0x3a2872[_0xbd92('0x35')]['id'];logger[_0xbd92('0xd')](_0xbd92('0x36'),_0x57256e['ticketId']);_0x4307d8(_0x57256e);})[_0xbd92('0x14')](function(_0x504c43){logger['error']('['+[_0x50ad80[_0xbd92('0x15')]()]+']',_0x504c43['message']);_0x524ae1(_0x504c43[_0xbd92('0x1d')]);});});};}function emit(_0x2a7a1e,_0x49808f,_0x243cb4){var _0x5b251e={'uri':_0x2a7a1e+'/contacts/'+_0x243cb4};io['to'](util[_0xbd92('0x23')](_0xbd92('0x37'),_0x49808f))[_0xbd92('0x38')](_0xbd92('0x39'),_0x5b251e);}exports['cs']=function(_0x5f06c3,_0x19d56d,_0xc8b5ec,_0x2fa3d3,_0x459abb,_0x3c949b,_0x132c97,_0x535d52){var _0x5a5ac4={};var _0x399a12={'Authorization':_0xbd92('0x3a')+_0x3c949b['apiKey']};_0x3c949b[_0xbd92('0x3b')]=intUtil[_0xbd92('0x3c')](_0x3c949b['remoteUri']);_0x3c949b[_0xbd92('0x3d')]=intUtil['stripTrailingSlash'](_0x3c949b[_0xbd92('0x3d')]);var _0x45972a=_0x3c949b[_0xbd92('0x3b')];_0x5a5ac4['adminEmail']=_0x3c949b[_0xbd92('0x3e')];_0x5a5ac4[_0xbd92('0x25')]=_0x535d52['toLowerCase']()===_0xbd92('0x3f')?_0x19d56d[_0xbd92('0x40')]:_0x19d56d[_0xbd92('0x41')];_0x5a5ac4['callDirection']=_0x535d52==='queue'||_0x535d52==='unmanaged'?_0xbd92('0x42'):_0xbd92('0x3f');if(_0x2fa3d3){_0x5a5ac4[_0xbd92('0x17')]=_0x2fa3d3[_0xbd92('0x11')];}var _0x2cece6=util[_0xbd92('0x23')](_0xbd92('0x43'),_0x3c949b[_0xbd92('0x3d')],_0x19d56d[_0xbd92('0x44')],md5(_0x19d56d['uniqueid']));if(_0x459abb&&_0x459abb[_0xbd92('0x45')]){logger[_0xbd92('0xd')](_0xbd92('0x46'),_0xbd92('0x47'));_0x19d56d[_0xbd92('0x48')]=_0x2cece6;}else if(_0x132c97&&_0x132c97[_0xbd92('0x49')]&&_0x132c97[_0xbd92('0x49')]!==_0xbd92('0x4a')){logger[_0xbd92('0xd')](_0xbd92('0x4b'),_0xbd92('0x47'));_0x19d56d[_0xbd92('0x48')]=_0x2cece6;}else{_0x19d56d['recordingURL']='';}return getAdminId(_0x5a5ac4,_0x535d52,_0x399a12,_0x45972a)[_0xbd92('0xf')](getUser(_0x535d52,_0x399a12,_0x45972a))[_0xbd92('0xf')](getEndUser(_0x535d52,_0x399a12,_0x45972a))[_0xbd92('0xf')](getTicket(_0x535d52,_0x399a12,_0x45972a,_0xc8b5ec,_0x19d56d))['then'](function(_0xeff93b){logger[_0xbd92('0xd')](util[_0xbd92('0x23')](_0xbd92('0x4c'),_0xeff93b['ticketId']));if(_0x535d52!==_0xbd92('0x4d')){logger[_0xbd92('0xd')]('['+[_0x535d52[_0xbd92('0x15')]()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x45972a,_0x2fa3d3[_0xbd92('0x4e')],_0xeff93b[_0xbd92('0x27')]);}})[_0xbd92('0x14')](function(_0x2c93be){logger[_0xbd92('0x2e')]('['+[_0x535d52['toUpperCase']()]+_0xbd92('0x4f'),util[_0xbd92('0x50')](_0x2c93be,{'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 683905a..a311584 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 _0x2733=['./zoho','./desk','./servicenow','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','servicenow','exec','includes','data1','toLowerCase','data2','find','Configurations','data3','queue','routeId','outbound','log','unknown\x20integration','../../../../config/logger','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','./zendesk','./salesforce','./sugarcrm','./freshdesk'];(function(_0x2f1114,_0x4561f1){var _0x2fe856=function(_0x8397f8){while(--_0x8397f8){_0x2f1114['push'](_0x2f1114['shift']());}};_0x2fe856(++_0x4561f1);}(_0x2733,0x151));var _0x3273=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x2733[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x3273('0x0'));var util=require('util');var zendesk=require(_0x3273('0x1'));var salesforce=require(_0x3273('0x2'));var sugarcrm=require(_0x3273('0x3'));var freshdesk=require(_0x3273('0x4'));var zoho=require(_0x3273('0x5'));var desk=require(_0x3273('0x6'));var vtiger=require('./vtiger');var servicenow=require(_0x3273('0x7'));var dynamics365=require('./dynamics365');var freshsales=require(_0x3273('0x8'));var integrations=[_0x3273('0x9'),_0x3273('0xa'),_0x3273('0xb'),_0x3273('0xc'),_0x3273('0xd'),_0x3273('0xe'),_0x3273('0xf'),_0x3273('0x10'),_0x3273('0x11'),_0x3273('0x12')];exports[_0x3273('0x13')]=function(_0x549190,_0x302abb,_0x32baaa,_0x34a72b,_0x38a363,_0xa4578a){if(_0x32baaa){if(_[_0x3273('0x14')](integrations,_0x549190[_0x3273('0x15')][_0x3273('0x16')]())){try{var _0x337b17=null;var _0x1fc80a='';var _0x527cef=_0x32baaa[_0x549190[_0x3273('0x15')][_0x3273('0x16')]()];if(_0x527cef){var _0x10ec0a=_0x527cef[_0x549190[_0x3273('0x17')]];if(_0x10ec0a){var _0x1609cb=_[_0x3273('0x18')](_0x10ec0a[_0x3273('0x19')],{'id':parseInt(_0x549190[_0x3273('0x1a')],0xa)});if(_0x1609cb){if(_0x34a72b){if(_0x38a363&&_0x302abb['queue']){_0x1fc80a=_0x3273('0x1b');}else if(_0x302abb[_0x3273('0x1c')]){_0x1fc80a=_0x3273('0x1d');}else{console[_0x3273('0x1e')]('EVENT\x20UNKNOWN',_0x302abb);}}else{_0x1fc80a='unmanaged';}switch(_0x549190[_0x3273('0x15')][_0x3273('0x16')]()){case _0x3273('0x9'):zendesk[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case _0x3273('0xa'):salesforce[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case _0x3273('0xb'):sugarcrm[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case'freshdesk':freshdesk[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case'zoho':zoho[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case'desk':desk[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case _0x3273('0xf'):vtiger[_0x1fc80a](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a);break;case _0x3273('0x11'):freshsales['cs'](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a,_0x1fc80a);break;case _0x3273('0x12'):servicenow['cs'](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a,_0x1fc80a);break;case _0x3273('0x10'):dynamics365['cs'](_0x549190,_0x302abb,_0x1609cb,_0x34a72b,_0x38a363,_0x10ec0a,_0xa4578a,_0x1fc80a);break;default:console[_0x3273('0x1e')](_0x3273('0x1f'));}}else{_0x337b17=require(_0x3273('0x20'))(_0x549190[_0x3273('0x15')][_0x3273('0x16')]());_0x337b17[_0x3273('0x21')](_0x3273('0x22'),util[_0x3273('0x23')](_0x3273('0x24'),_0x549190['data1'][_0x3273('0x16')](),_0x549190['data3']));}}else{_0x337b17=require('../../../../config/logger')(_0x549190[_0x3273('0x15')]['toLowerCase']());_0x337b17[_0x3273('0x21')](_0x3273('0x22'),util[_0x3273('0x23')](_0x3273('0x25'),_0x549190[_0x3273('0x15')][_0x3273('0x16')](),_0x549190['data2']));}}else{}}catch(_0x541993){console['error'](_0x541993);}}}}; \ No newline at end of file +var _0x281a=['toLowerCase','data2','find','Configurations','data3','queue','outbound','log','EVENT\x20UNKNOWN','unmanaged','salesforce','sugarcrm','unknown\x20integration','../../../../config/logger','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','error','format','%s\x20account\x20#%s\x20not\x20found','util','./zendesk','./salesforce','./sugarcrm','./zoho','./vtiger','./dynamics365','./freshsales','zendesk','freshdesk','zoho','desk','vtiger','dynamics365','servicenow','exec','includes','data1'];(function(_0xbe294b,_0x1c884e){var _0x4fe650=function(_0x404453){while(--_0x404453){_0xbe294b['push'](_0xbe294b['shift']());}};_0x4fe650(++_0x1c884e);}(_0x281a,0x1f4));var _0xa281=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x281a[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0xa281('0x0'));var zendesk=require(_0xa281('0x1'));var salesforce=require(_0xa281('0x2'));var sugarcrm=require(_0xa281('0x3'));var freshdesk=require('./freshdesk');var zoho=require(_0xa281('0x4'));var desk=require('./desk');var vtiger=require(_0xa281('0x5'));var servicenow=require('./servicenow');var dynamics365=require(_0xa281('0x6'));var freshsales=require(_0xa281('0x7'));var integrations=[_0xa281('0x8'),'salesforce','sugarcrm',_0xa281('0x9'),_0xa281('0xa'),_0xa281('0xb'),_0xa281('0xc'),_0xa281('0xd'),'freshsales',_0xa281('0xe')];exports[_0xa281('0xf')]=function(_0x537f81,_0x263bb8,_0xe7e0ad,_0x4b48b1,_0x51adb0,_0x5479fa){if(_0xe7e0ad){if(_[_0xa281('0x10')](integrations,_0x537f81[_0xa281('0x11')]['toLowerCase']())){try{var _0x374ee=null;var _0x5a5d92='';var _0x9e3208=_0xe7e0ad[_0x537f81[_0xa281('0x11')][_0xa281('0x12')]()];if(_0x9e3208){var _0x2e9dcf=_0x9e3208[_0x537f81[_0xa281('0x13')]];if(_0x2e9dcf){var _0x197549=_[_0xa281('0x14')](_0x2e9dcf[_0xa281('0x15')],{'id':parseInt(_0x537f81[_0xa281('0x16')],0xa)});if(_0x197549){if(_0x4b48b1){if(_0x51adb0&&_0x263bb8[_0xa281('0x17')]){_0x5a5d92=_0xa281('0x17');}else if(_0x263bb8['routeId']){_0x5a5d92=_0xa281('0x18');}else{console[_0xa281('0x19')](_0xa281('0x1a'),_0x263bb8);}}else{_0x5a5d92=_0xa281('0x1b');}switch(_0x537f81[_0xa281('0x11')][_0xa281('0x12')]()){case'zendesk':zendesk[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0x1c'):salesforce[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0x1d'):sugarcrm[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0x9'):freshdesk[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0xa'):zoho[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0xb'):desk[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case _0xa281('0xc'):vtiger[_0x5a5d92](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa);break;case'freshsales':freshsales['cs'](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa,_0x5a5d92);break;case _0xa281('0xe'):servicenow['cs'](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa,_0x5a5d92);break;case'dynamics365':dynamics365['cs'](_0x537f81,_0x263bb8,_0x197549,_0x4b48b1,_0x51adb0,_0x2e9dcf,_0x5479fa,_0x5a5d92);break;default:console['log'](_0xa281('0x1e'));}}else{_0x374ee=require(_0xa281('0x1f'))(_0x537f81[_0xa281('0x11')]['toLowerCase']());_0x374ee['error'](_0xa281('0x20'),util['format'](_0xa281('0x21'),_0x537f81[_0xa281('0x11')][_0xa281('0x12')](),_0x537f81[_0xa281('0x16')]));}}else{_0x374ee=require('../../../../config/logger')(_0x537f81[_0xa281('0x11')]['toLowerCase']());_0x374ee[_0xa281('0x22')](_0xa281('0x20'),util[_0xa281('0x23')](_0xa281('0x24'),_0x537f81[_0xa281('0x11')][_0xa281('0x12')](),_0x537f81[_0xa281('0x13')]));}}else{}}catch(_0x413240){console[_0xa281('0x22')](_0x413240);}}}}; \ 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 1d829ce..10a3ce7 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 _0x7ab7=['getString','Subjects','Descriptions','ticketType','Task','ActivityDate','IsRecurrence','endUserType','contact','WhoId','account','AccountId','lead','leadId','sobject','create','isNil','validateEmail','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','attributes','type','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','','format','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','forEach','includes','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','stripTrailingSlash','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','%s/%s/e','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','localhost','socket.io-emitter','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7ab7,0x16c));var _0x77ab=function(_0x55ec27,_0x110a72){_0x55ec27=_0x55ec27-0x0;var _0x361929=_0x7ab7[_0x55ec27];return _0x361929;};'use strict';var _=require(_0x77ab('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x77ab('0x1'));var md5=require('md5');var jsforce=require(_0x77ab('0x2'));var util=require('util');var Redis=require(_0x77ab('0x3'));var intUtil=require(_0x77ab('0x4'));var config=require('../../../../config/environment');var logger=require(_0x77ab('0x5'))(_0x77ab('0x6'));config[_0x77ab('0x7')]=_['defaults'](config['redis'],{'host':_0x77ab('0x8'),'port':0x18eb});var io=require(_0x77ab('0x9'))(new Redis(config['redis']));function emit(_0x18bffb,_0x18340c,_0x23a1c4){io['to'](_0x18bffb)[_0x77ab('0xa')](_0x18340c,_0x23a1c4);}function getTicket(_0x1ad1d1,_0x14cfcd,_0x1fb1f8,_0x499f21,_0x44301d,_0x47096f,_0x44acf5,_0x2c9142){var _0x4c3c92=Object['assign']({},{'OwnerId':_0x14cfcd['id'],'Subject':intUtil[_0x77ab('0xb')](_0x499f21[_0x77ab('0xc')],_0x44301d,'\x20'),'Description':intUtil[_0x77ab('0xb')](_0x499f21[_0x77ab('0xd')],_0x44301d,'\x0a')},getCustomFields(_0x47096f,_0x44301d));if(_0x1fb1f8){if(_0x499f21[_0x77ab('0xe')]===_0x77ab('0xf')){_0x4c3c92[_0x77ab('0x10')]=moment['utc']();_0x4c3c92['IsReminderSet']=![];_0x4c3c92[_0x77ab('0x11')]=![];if(_0x1fb1f8[_0x77ab('0x12')]===_0x77ab('0x13')||_0x1fb1f8[_0x77ab('0x12')]==='lead'){_0x4c3c92[_0x77ab('0x14')]=_0x1fb1f8['id'];}else if(_0x1fb1f8[_0x77ab('0x12')]===_0x77ab('0x15')){_0x4c3c92['WhatId']=_0x1fb1f8['id'];}}else if(_0x499f21[_0x77ab('0xe')]==='Case'){if(_0x1fb1f8[_0x77ab('0x12')]===_0x77ab('0x13')){_0x4c3c92['ContactId']=_0x1fb1f8['id'];}else if(_0x1fb1f8[_0x77ab('0x12')]===_0x77ab('0x15')){_0x4c3c92[_0x77ab('0x16')]=_0x1fb1f8['id'];}else if(_0x1fb1f8[_0x77ab('0x12')]===_0x77ab('0x17')&&_0x499f21[_0x77ab('0x18')]){_0x4c3c92[_0x499f21['leadId']]=_0x1fb1f8['id'];}else{logger['info']('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x44acf5[_0x77ab('0x19')](_0x499f21[_0x77ab('0xe')])[_0x77ab('0x1a')](_0x4c3c92);}function getUser(_0xb41e63,_0x52aa17,_0x451b47){if(!_[_0x77ab('0x1b')](_0x52aa17)&&intUtil[_0x77ab('0x1c')](_0x52aa17)){var _0x4a8c24={'Email':_0x52aa17};var _0x5a6337={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x451b47[_0x77ab('0x19')](_0x77ab('0x1d'))[_0x77ab('0x1e')](_0x4a8c24,_0x5a6337)[_0x77ab('0x1f')]()[_0x77ab('0x20')](function(_0x4acb77){if(_0x4acb77[_0x77ab('0x21')]){var _0x37cf6e=_[_0x77ab('0x1e')](_0x4acb77,function(_0x4a18b9){return _0x4a18b9[_0x77ab('0x22')]===_0x52aa17;});if(_0x37cf6e){logger[_0x77ab('0x23')](_0x77ab('0x24'),_0x52aa17);return BPromise[_0x77ab('0x25')]({'id':_0x37cf6e['Id'],'name':_0x37cf6e[_0x77ab('0x26')]});}}else{logger[_0x77ab('0x23')](_0x77ab('0x27'),_0x52aa17);return _0x451b47[_0x77ab('0x28')]()[_0x77ab('0x20')](function(_0x315232){return BPromise[_0x77ab('0x25')]({'id':_0x315232[_0x77ab('0x29')],'name':_0x315232[_0x77ab('0x2a')]});});}});}else{logger[_0x77ab('0x23')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x52aa17);return _0x451b47[_0x77ab('0x28')]()[_0x77ab('0x20')](function(_0x3a2416){return BPromise[_0x77ab('0x25')]({'id':_0x3a2416[_0x77ab('0x29')],'name':_0x3a2416[_0x77ab('0x2a')]});});}}function getEndUser(_0x5b9320,_0x4ea7a9,_0x3ad7ae,_0x210f9f,_0x1ca28d){var _0x5d1ee6={'$or':{'Phone':_0x210f9f}};var _0x30e844={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0x77ab('0x20')](function(){logger['info'](_0x77ab('0x2b'),_0x210f9f,_0x4ea7a9['moduleSearch']);switch(_0x4ea7a9[_0x77ab('0x2c')]){case _0x77ab('0x2d'):var _0x57bfd8=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9['additionalSearchContact']){var _0x14432e={};_0x14432e[_0x4ea7a9[_0x77ab('0x2f')]]=_0x210f9f;_[_0x77ab('0x30')](_0x57bfd8[_0x77ab('0x31')],_0x14432e);}return _0x1ca28d[_0x77ab('0x19')](_0x77ab('0x32'))[_0x77ab('0x1e')](_0x57bfd8,_0x30e844)['execute']()[_0x77ab('0x20')](function(_0x529ee7){if(_0x529ee7&&_0x529ee7[_0x77ab('0x21')]){return _0x529ee7;}else{var _0x920e62=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9[_0x77ab('0x33')]){var _0x206236={};_0x206236[_0x4ea7a9['additionalSearchLead']]=_0x210f9f;_[_0x77ab('0x30')](_0x920e62[_0x77ab('0x31')],_0x206236);}return _0x1ca28d[_0x77ab('0x19')](_0x77ab('0x34'))['find'](_0x920e62,_0x30e844);}});case _0x77ab('0x35'):var _0x28905a=_['cloneDeep'](_0x5d1ee6);if(_0x4ea7a9[_0x77ab('0x36')]){var _0x14432e={};_0x14432e[_0x4ea7a9[_0x77ab('0x36')]]=_0x210f9f;_[_0x77ab('0x30')](_0x28905a[_0x77ab('0x31')],_0x14432e);}return _0x1ca28d['sobject'](_0x77ab('0x37'))[_0x77ab('0x1e')](_0x28905a,_0x30e844)[_0x77ab('0x1f')]()['then'](function(_0x58bad8){if(_0x58bad8&&_0x58bad8[_0x77ab('0x21')]){return _0x58bad8;}else{var _0x4fd16d=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9['additionalSearchContact']){var _0x2666e5={};_0x2666e5[_0x4ea7a9[_0x77ab('0x2f')]]=_0x210f9f;_[_0x77ab('0x30')](_0x4fd16d[_0x77ab('0x31')],_0x2666e5);}return _0x1ca28d[_0x77ab('0x19')](_0x77ab('0x32'))[_0x77ab('0x1e')](_0x4fd16d,_0x30e844)[_0x77ab('0x20')](function(_0x533c5b){if(_0x533c5b&&_0x533c5b[_0x77ab('0x21')]){return _0x533c5b;}else{var _0x338fa9=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9[_0x77ab('0x33')]){var _0xc9d35={};_0xc9d35[_0x4ea7a9[_0x77ab('0x33')]]=_0x210f9f;_[_0x77ab('0x30')](_0x338fa9[_0x77ab('0x31')],_0xc9d35);}return _0x1ca28d[_0x77ab('0x19')]('Lead')[_0x77ab('0x1e')](_0x338fa9,_0x30e844);}});}});case _0x77ab('0x13'):var _0x57bfd8=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9['additionalSearchContact']){var _0x14432e={};_0x14432e[_0x4ea7a9['additionalSearchContact']]=_0x210f9f;_['merge'](_0x57bfd8[_0x77ab('0x31')],_0x14432e);}return _0x1ca28d['sobject']('Contact')[_0x77ab('0x1e')](_0x57bfd8,_0x30e844)['execute']();case'lead':var _0x19c7c4=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9[_0x77ab('0x33')]){var _0x14432e={};_0x14432e[_0x4ea7a9['additionalSearchLead']]=_0x210f9f;_[_0x77ab('0x30')](_0x19c7c4[_0x77ab('0x31')],_0x14432e);}return _0x1ca28d['sobject'](_0x77ab('0x34'))[_0x77ab('0x1e')](_0x19c7c4,_0x30e844);case _0x77ab('0x15'):var _0x28905a=_[_0x77ab('0x2e')](_0x5d1ee6);if(_0x4ea7a9[_0x77ab('0x36')]){var _0x14432e={};_0x14432e[_0x4ea7a9[_0x77ab('0x36')]]=_0x210f9f;_['merge'](_0x28905a[_0x77ab('0x31')],_0x14432e);}return _0x1ca28d[_0x77ab('0x19')](_0x77ab('0x37'))[_0x77ab('0x1e')](_0x28905a,_0x30e844);default:return null;}})['then'](function(_0x1c62cb){if(_0x1c62cb&&_0x1c62cb[_0x77ab('0x21')]){var _0x3160bb=_[_0x77ab('0x38')](_0x1c62cb);if(_0x3160bb){return BPromise[_0x77ab('0x25')]({'id':_0x3160bb['Id'],'name':_0x3160bb['Name'],'phone':_0x3160bb[_0x77ab('0x39')],'endUserType':_0x3160bb[_0x77ab('0x3a')][_0x77ab('0x3b')]['toLowerCase']()});}}})[_0x77ab('0x20')](function(_0x5e8187){if(_0x5e8187){logger[_0x77ab('0x23')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x5e8187['endUserType'],_0x210f9f);return BPromise[_0x77ab('0x25')](_0x5e8187);}else{logger['info'](_0x77ab('0x3c'),_0x210f9f);var _0x1bca7e={'Phone':_0x210f9f};if(_0x4ea7a9['moduleCreate']){if(_0x4ea7a9[_0x77ab('0x3d')]===_0x77ab('0x13')){logger['info'](_0x77ab('0x3e'),_0x210f9f,_0x4ea7a9[_0x77ab('0x3d')]);_0x1bca7e[_0x77ab('0x3f')]=_0x3ad7ae!==_0x77ab('0x40')?_0x3ad7ae:util[_0x77ab('0x41')](_0x77ab('0x42'),_0x210f9f);}else if(_0x4ea7a9['moduleCreate']===_0x77ab('0x17')){logger[_0x77ab('0x23')](_0x77ab('0x3e'),_0x210f9f,_0x4ea7a9[_0x77ab('0x3d')]);_0x1bca7e[_0x77ab('0x3f')]=_0x3ad7ae!==_0x77ab('0x40')?_0x3ad7ae:util['format']('Caller\x20-\x20%s',_0x210f9f);_0x1bca7e[_0x77ab('0x43')]=_0x77ab('0x44');}else if(_0x4ea7a9[_0x77ab('0x3d')]==='account'){logger[_0x77ab('0x23')](_0x77ab('0x3e'),_0x210f9f,_0x4ea7a9[_0x77ab('0x3d')]);_0x1bca7e[_0x77ab('0x26')]=_0x3ad7ae!==_0x77ab('0x40')?_0x3ad7ae:util[_0x77ab('0x41')](_0x77ab('0x42'),_0x210f9f);}else{return null;}}return _0x1ca28d[_0x77ab('0x19')](_[_0x77ab('0x45')](_0x4ea7a9[_0x77ab('0x3d')]))['create'](_0x1bca7e)['then'](function(_0x55dc29){return BPromise[_0x77ab('0x25')]({'id':_0x55dc29['id'],'endUserType':_0x4ea7a9['moduleCreate']});});}});}function getCustomFields(_0x1813f9,_0x52be5f){var _0x1aebdb={};if(_0x1813f9[_0x77ab('0x21')]>0x0){_[_0x77ab('0x46')](_0x1813f9,function(_0x552799){if(_[_0x77ab('0x47')]([_0x77ab('0x48'),'picklist'],_0x552799[_0x77ab('0x3b')])&&_0x552799['idField']){_0x1aebdb[_0x552799[_0x77ab('0x49')]]=_0x552799[_0x77ab('0x4a')][_0x77ab('0x4b')]();}else if(_0x552799[_0x77ab('0x3b')]==='variable'&&_0x552799[_0x77ab('0x4c')]&&_0x552799['idField']){_0x52be5f[_0x552799[_0x77ab('0x4c')]]&&(_0x1aebdb[_0x552799[_0x77ab('0x49')]]=_0x52be5f[_0x552799[_0x77ab('0x4c')]][_0x77ab('0x4b')]());}else if(_0x552799[_0x77ab('0x3b')]===_0x77ab('0x4d')&&_0x552799['Variable']&&_0x552799['Variable']['name']&&_0x552799[_0x77ab('0x49')]){_0x52be5f[_0x552799[_0x77ab('0x4e')][_0x77ab('0x4f')][_0x77ab('0x50')]()]&&(_0x1aebdb[_0x552799[_0x77ab('0x49')]]=_0x52be5f[_0x552799[_0x77ab('0x4e')][_0x77ab('0x4f')][_0x77ab('0x50')]()]['toString']());}});}return _0x1aebdb;}function getConnection(_0x8b4a28){var _0x14503d=_0x8b4a28['password']['concat'](_0x8b4a28['securityToken']);var _0x162bcb=new jsforce['Connection']({'oauth2':{'loginUrl':_0x8b4a28['remoteUri']||_0x77ab('0x51'),'clientId':_0x8b4a28[_0x77ab('0x52')],'clientSecret':_0x8b4a28[_0x77ab('0x53')]}});return _0x162bcb[_0x77ab('0x54')](_0x8b4a28[_0x77ab('0x55')],_0x14503d)['then'](function(){logger[_0x77ab('0x23')](_0x77ab('0x56'));return _0x162bcb;});}exports[_0x77ab('0x57')]=function(_0x3d3b16,_0x3bcf2e,_0x4444dd,_0x431081,_0x2456e7,_0x3bc75e){var _0x34323e,_0x25373c,_0x12b254,_0x46700b;_0x3bc75e[_0x77ab('0x58')]=intUtil[_0x77ab('0x59')](_0x3bc75e[_0x77ab('0x58')]);_0x3bc75e['remoteUri']=intUtil[_0x77ab('0x59')](_0x3bc75e[_0x77ab('0x5a')]);if(_0x2456e7&&_0x2456e7[_0x77ab('0x5b')]){logger[_0x77ab('0x23')](_0x77ab('0x5c'),_0x77ab('0x5d'));_0x3bcf2e[_0x77ab('0x5e')]=util[_0x77ab('0x41')](_0x77ab('0x5f'),_0x3bc75e[_0x77ab('0x58')],_0x3bcf2e['uniqueid'],md5(_0x3bcf2e[_0x77ab('0x60')]));}else{_0x3bcf2e['recordingURL']='';}return getConnection(_0x3bc75e)[_0x77ab('0x20')](function(_0x46d799){_0x46700b=_0x46d799;return getUser(_0x3bc75e,_0x431081[_0x77ab('0x61')],_0x46700b);})[_0x77ab('0x20')](function(_0x52cb36){_0x34323e=_0x52cb36;return getEndUser(_0x3bc75e,_0x4444dd,_0x3bcf2e[_0x77ab('0x62')],_0x3bcf2e['calleridnum'],_0x46700b);})['then'](function(_0x32db98){_0x25373c=_0x32db98;return getTicket(_0x3bc75e,_0x34323e,_0x25373c,_0x4444dd,_0x3bcf2e,_0x4444dd[_0x77ab('0x63')],_0x46700b,_0x77ab('0x57'));})[_0x77ab('0x20')](function(_0x2a4a3c){_0x12b254=_0x2a4a3c;logger[_0x77ab('0x23')](_0x77ab('0x64'),_0x12b254['id']);logger[_0x77ab('0x23')](_0x77ab('0x65'),_0x12b254['id'],_0x431081[_0x77ab('0x4f')],_0x3bc75e['type']);switch(_0x3bc75e[_0x77ab('0x3b')]){case _0x77ab('0x66'):emit(util[_0x77ab('0x41')](_0x77ab('0x67'),_0x431081[_0x77ab('0x4f')]),_0x77ab('0x68'),{'recordId':_0x12b254['id']});break;case'newTab':emit(util[_0x77ab('0x41')](_0x77ab('0x67'),_0x431081['name']),_0x77ab('0x69'),{'uri':util[_0x77ab('0x41')]('%s/%s/e',_0x46700b['instanceUrl'],_0x12b254['id'])});break;default:logger['error'](_0x77ab('0x6a'));}})[_0x77ab('0x6b')](function(_0x1977d8){logger[_0x77ab('0x6c')](_0x77ab('0x5c'),_0x1977d8);});};exports[_0x77ab('0x6d')]=function(_0x580454,_0x15e26e,_0x545037,_0x1abe88,_0x423f81,_0x2f727a,_0x3ddcec){var _0x239aa7,_0x5749ce,_0x2677a6,_0x2330f8;_0x2f727a[_0x77ab('0x58')]=intUtil[_0x77ab('0x59')](_0x2f727a[_0x77ab('0x58')]);_0x2f727a['remoteUri']=intUtil[_0x77ab('0x59')](_0x2f727a['remoteUri']);if(_0x3ddcec&&_0x3ddcec[_0x77ab('0x6e')]&&_0x3ddcec[_0x77ab('0x6e')]!==_0x77ab('0x6f')){logger[_0x77ab('0x23')](_0x77ab('0x70'),_0x77ab('0x5d'));_0x15e26e[_0x77ab('0x5e')]=util[_0x77ab('0x41')](_0x77ab('0x5f'),_0x2f727a[_0x77ab('0x58')],_0x15e26e[_0x77ab('0x60')],md5(_0x15e26e[_0x77ab('0x60')]));}return getConnection(_0x2f727a)['then'](function(_0x582305){_0x2330f8=_0x582305;return getUser(_0x2f727a,_0x1abe88[_0x77ab('0x61')],_0x2330f8);})[_0x77ab('0x20')](function(_0x33d614){_0x239aa7=_0x33d614;return getEndUser(_0x2f727a,_0x545037,_0x15e26e[_0x77ab('0x71')],_0x15e26e[_0x77ab('0x72')],_0x2330f8);})[_0x77ab('0x20')](function(_0x431679){_0x5749ce=_0x431679;return getTicket(_0x2f727a,_0x239aa7,_0x5749ce,_0x545037,_0x15e26e,_0x545037[_0x77ab('0x63')],_0x2330f8,_0x77ab('0x6d'));})['then'](function(_0x1557a4){_0x2677a6=_0x1557a4;logger[_0x77ab('0x23')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2677a6['id']);logger['info'](_0x77ab('0x73'),_0x2677a6['id'],_0x1abe88[_0x77ab('0x4f')],_0x2f727a['type']);switch(_0x2f727a[_0x77ab('0x3b')]){case _0x77ab('0x66'):emit(util[_0x77ab('0x41')](_0x77ab('0x67'),_0x1abe88['name']),_0x77ab('0x68'),{'recordId':_0x2677a6['id']});break;case _0x77ab('0x74'):emit(util[_0x77ab('0x41')](_0x77ab('0x67'),_0x1abe88['name']),_0x77ab('0x69'),{'uri':util[_0x77ab('0x41')](_0x77ab('0x75'),_0x2330f8[_0x77ab('0x76')],_0x2677a6['id'])});break;default:logger[_0x77ab('0x6c')](_0x77ab('0x70'),_0x77ab('0x77'));}})[_0x77ab('0x6b')](function(_0x450623){logger[_0x77ab('0x6c')](_0x77ab('0x70'),_0x450623);});};exports[_0x77ab('0x78')]=function(_0x533042,_0x5c630d,_0x5a7e63,_0x36bb5b,_0x3ed004,_0x403211){var _0x2f931c,_0x334509,_0x550ef3,_0x39b81b;_0x403211['serverUrl']=intUtil[_0x77ab('0x59')](_0x403211[_0x77ab('0x58')]);_0x403211[_0x77ab('0x5a')]=intUtil[_0x77ab('0x59')](_0x403211['remoteUri']);if(_0x3ed004&&_0x3ed004['monitor_format']){logger[_0x77ab('0x23')]('['+_0x5c630d[_0x77ab('0x79')][_0x77ab('0x7a')]()+']',_0x77ab('0x5d'));_0x5c630d[_0x77ab('0x5e')]=util[_0x77ab('0x41')](_0x77ab('0x5f'),_0x403211[_0x77ab('0x58')],_0x5c630d[_0x77ab('0x60')],md5(_0x5c630d[_0x77ab('0x60')]));}else{_0x5c630d[_0x77ab('0x5e')]='';}return getConnection(_0x403211)['then'](function(_0x141f35){_0x39b81b=_0x141f35;if(!_[_0x77ab('0x1b')](_0x36bb5b)){return getUser(_0x403211,_0x36bb5b['name'],_0x39b81b);}else{return getUser(_0x403211,null,_0x39b81b);}})[_0x77ab('0x20')](function(_0x13f201){_0x2f931c=_0x13f201;return getEndUser(_0x403211,_0x5a7e63,_0x5c630d[_0x77ab('0x62')],_0x5c630d['calleridnum'],_0x39b81b);})[_0x77ab('0x20')](function(_0x1fd9f1){_0x334509=_0x1fd9f1;return getTicket(_0x403211,_0x2f931c,_0x334509,_0x5a7e63,_0x5c630d,_0x5a7e63[_0x77ab('0x63')],_0x39b81b);})['then'](function(_0x24e080){_0x550ef3=_0x24e080;logger[_0x77ab('0x23')]('['+_0x5c630d[_0x77ab('0x79')][_0x77ab('0x7a')]()+_0x77ab('0x7b'),_0x550ef3['id']);logger[_0x77ab('0x23')]('['+_0x5c630d[_0x77ab('0x79')][_0x77ab('0x7a')]()+_0x77ab('0x7c'),_0x403211[_0x77ab('0x3b')]);})[_0x77ab('0x6b')](function(_0x18a921){logger[_0x77ab('0x6c')]('['+_0x5c630d[_0x77ab('0x79')][_0x77ab('0x7a')]()+']',_0x18a921);});}; \ No newline at end of file +var _0x5d27=['clientId','clientSecret','username','Connection\x20established.','queue','stripTrailingSlash','serverUrl','remoteUri','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','trigger:browser:url','%s/%s/e','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','newTab','instanceUrl','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','lastevent','toUpperCase',']\x20Ticket\x20%s\x20created.',']\x20Integration\x20account\x20type\x20%s.','lodash','request-promise','moment','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','emit','assign','getString','Subjects','Descriptions','ticketType','Task','ActivityDate','utc','IsReminderSet','WhoId','endUserType','account','WhatId','Case','contact','lead','leadId','info','sobject','create','isNil','validateEmail','User','execute','then','length','find','Email','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','identity','user_id','moduleSearch','contact_lead','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','additionalSearchAccount','Account','first','attributes','toLowerCase','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','Caller\x20-\x20%s','','format','upperFirst','includes','picklist','type','idField','content','toString','variable','variableName','customVariable','Variable','name','securityToken','Connection'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x5d27,0x1a1));var _0x75d2=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x5d27[_0x4907de];return _0x482054;};'use strict';var _=require(_0x75d2('0x0'));var rp=require(_0x75d2('0x1'));var moment=require(_0x75d2('0x2'));var BPromise=require(_0x75d2('0x3'));var md5=require(_0x75d2('0x4'));var jsforce=require('jsforce');var util=require(_0x75d2('0x5'));var Redis=require(_0x75d2('0x6'));var intUtil=require(_0x75d2('0x7'));var config=require(_0x75d2('0x8'));var logger=require(_0x75d2('0x9'))(_0x75d2('0xa'));config[_0x75d2('0xb')]=_['defaults'](config[_0x75d2('0xb')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x75d2('0xb')]));function emit(_0x16103d,_0x5894ec,_0x5004f9){io['to'](_0x16103d)[_0x75d2('0xc')](_0x5894ec,_0x5004f9);}function getTicket(_0x8805c4,_0x916bb6,_0x47f10e,_0x50d35e,_0x31ce5c,_0x2fcb35,_0x103a2f,_0x2af685){var _0x2ed077=Object[_0x75d2('0xd')]({},{'OwnerId':_0x916bb6['id'],'Subject':intUtil[_0x75d2('0xe')](_0x50d35e[_0x75d2('0xf')],_0x31ce5c,'\x20'),'Description':intUtil['getString'](_0x50d35e[_0x75d2('0x10')],_0x31ce5c,'\x0a')},getCustomFields(_0x2fcb35,_0x31ce5c));if(_0x47f10e){if(_0x50d35e[_0x75d2('0x11')]===_0x75d2('0x12')){_0x2ed077[_0x75d2('0x13')]=moment[_0x75d2('0x14')]();_0x2ed077[_0x75d2('0x15')]=![];_0x2ed077['IsRecurrence']=![];if(_0x47f10e['endUserType']==='contact'||_0x47f10e['endUserType']==='lead'){_0x2ed077[_0x75d2('0x16')]=_0x47f10e['id'];}else if(_0x47f10e[_0x75d2('0x17')]===_0x75d2('0x18')){_0x2ed077[_0x75d2('0x19')]=_0x47f10e['id'];}}else if(_0x50d35e[_0x75d2('0x11')]===_0x75d2('0x1a')){if(_0x47f10e[_0x75d2('0x17')]===_0x75d2('0x1b')){_0x2ed077['ContactId']=_0x47f10e['id'];}else if(_0x47f10e[_0x75d2('0x17')]==='account'){_0x2ed077['AccountId']=_0x47f10e['id'];}else if(_0x47f10e['endUserType']===_0x75d2('0x1c')&&_0x50d35e['leadId']){_0x2ed077[_0x50d35e[_0x75d2('0x1d')]]=_0x47f10e['id'];}else{logger[_0x75d2('0x1e')]('Association\x20between\x20Case\x20and\x20Lead\x20skipped');}}}return _0x103a2f[_0x75d2('0x1f')](_0x50d35e['ticketType'])[_0x75d2('0x20')](_0x2ed077);}function getUser(_0xe4421b,_0x2b05c9,_0x353e3c){if(!_[_0x75d2('0x21')](_0x2b05c9)&&intUtil[_0x75d2('0x22')](_0x2b05c9)){var _0x59b64e={'Email':_0x2b05c9};var _0x375253={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x353e3c[_0x75d2('0x1f')](_0x75d2('0x23'))['find'](_0x59b64e,_0x375253)[_0x75d2('0x24')]()[_0x75d2('0x25')](function(_0x5e074f){if(_0x5e074f[_0x75d2('0x26')]){var _0x20d631=_[_0x75d2('0x27')](_0x5e074f,function(_0x531807){return _0x531807[_0x75d2('0x28')]===_0x2b05c9;});if(_0x20d631){logger[_0x75d2('0x1e')](_0x75d2('0x29'),_0x2b05c9);return BPromise[_0x75d2('0x2a')]({'id':_0x20d631['Id'],'name':_0x20d631[_0x75d2('0x2b')]});}}else{logger[_0x75d2('0x1e')](_0x75d2('0x2c'),_0x2b05c9);return _0x353e3c['identity']()['then'](function(_0x4ad7e0){return BPromise[_0x75d2('0x2a')]({'id':_0x4ad7e0['user_id'],'name':_0x4ad7e0[_0x75d2('0x2d')]});});}});}else{logger[_0x75d2('0x1e')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x2b05c9);return _0x353e3c[_0x75d2('0x2e')]()[_0x75d2('0x25')](function(_0x2b2220){return BPromise['resolve']({'id':_0x2b2220[_0x75d2('0x2f')],'name':_0x2b2220[_0x75d2('0x2d')]});});}}function getEndUser(_0x50eed7,_0x2d5f10,_0x312cfb,_0x48d2ae,_0x434fe7){var _0x263fea={'$or':{'Phone':_0x48d2ae}};var _0x2777f1={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){logger['info']('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x48d2ae,_0x2d5f10['moduleSearch']);switch(_0x2d5f10[_0x75d2('0x30')]){case _0x75d2('0x31'):var _0x5255fe=_[_0x75d2('0x32')](_0x263fea);if(_0x2d5f10[_0x75d2('0x33')]){var _0x40e80a={};_0x40e80a[_0x2d5f10[_0x75d2('0x33')]]=_0x48d2ae;_[_0x75d2('0x34')](_0x5255fe[_0x75d2('0x35')],_0x40e80a);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x36'))[_0x75d2('0x27')](_0x5255fe,_0x2777f1)['execute']()[_0x75d2('0x25')](function(_0x593add){if(_0x593add&&_0x593add[_0x75d2('0x26')]){return _0x593add;}else{var _0x5e8d0c=_[_0x75d2('0x32')](_0x263fea);if(_0x2d5f10['additionalSearchLead']){var _0x575723={};_0x575723[_0x2d5f10[_0x75d2('0x37')]]=_0x48d2ae;_['merge'](_0x5e8d0c[_0x75d2('0x35')],_0x575723);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x38'))[_0x75d2('0x27')](_0x5e8d0c,_0x2777f1);}});case'account_contact_lead':var _0x3ffb30=_[_0x75d2('0x32')](_0x263fea);if(_0x2d5f10[_0x75d2('0x39')]){var _0x40e80a={};_0x40e80a[_0x2d5f10[_0x75d2('0x39')]]=_0x48d2ae;_['merge'](_0x3ffb30[_0x75d2('0x35')],_0x40e80a);}return _0x434fe7[_0x75d2('0x1f')]('Account')[_0x75d2('0x27')](_0x3ffb30,_0x2777f1)[_0x75d2('0x24')]()[_0x75d2('0x25')](function(_0x2b801d){if(_0x2b801d&&_0x2b801d['length']){return _0x2b801d;}else{var _0x43fbde=_['cloneDeep'](_0x263fea);if(_0x2d5f10[_0x75d2('0x33')]){var _0x9c9d46={};_0x9c9d46[_0x2d5f10['additionalSearchContact']]=_0x48d2ae;_[_0x75d2('0x34')](_0x43fbde[_0x75d2('0x35')],_0x9c9d46);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x36'))['find'](_0x43fbde,_0x2777f1)[_0x75d2('0x25')](function(_0x3fe452){if(_0x3fe452&&_0x3fe452[_0x75d2('0x26')]){return _0x3fe452;}else{var _0x3c8717=_['cloneDeep'](_0x263fea);if(_0x2d5f10[_0x75d2('0x37')]){var _0x1df07c={};_0x1df07c[_0x2d5f10[_0x75d2('0x37')]]=_0x48d2ae;_[_0x75d2('0x34')](_0x3c8717['$or'],_0x1df07c);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x38'))[_0x75d2('0x27')](_0x3c8717,_0x2777f1);}});}});case _0x75d2('0x1b'):var _0x5255fe=_['cloneDeep'](_0x263fea);if(_0x2d5f10[_0x75d2('0x33')]){var _0x40e80a={};_0x40e80a[_0x2d5f10['additionalSearchContact']]=_0x48d2ae;_['merge'](_0x5255fe[_0x75d2('0x35')],_0x40e80a);}return _0x434fe7['sobject'](_0x75d2('0x36'))['find'](_0x5255fe,_0x2777f1)[_0x75d2('0x24')]();case _0x75d2('0x1c'):var _0x3b4177=_[_0x75d2('0x32')](_0x263fea);if(_0x2d5f10[_0x75d2('0x37')]){var _0x40e80a={};_0x40e80a[_0x2d5f10[_0x75d2('0x37')]]=_0x48d2ae;_[_0x75d2('0x34')](_0x3b4177[_0x75d2('0x35')],_0x40e80a);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x38'))[_0x75d2('0x27')](_0x3b4177,_0x2777f1);case _0x75d2('0x18'):var _0x3ffb30=_[_0x75d2('0x32')](_0x263fea);if(_0x2d5f10[_0x75d2('0x39')]){var _0x40e80a={};_0x40e80a[_0x2d5f10['additionalSearchAccount']]=_0x48d2ae;_[_0x75d2('0x34')](_0x3ffb30[_0x75d2('0x35')],_0x40e80a);}return _0x434fe7[_0x75d2('0x1f')](_0x75d2('0x3a'))[_0x75d2('0x27')](_0x3ffb30,_0x2777f1);default:return null;}})[_0x75d2('0x25')](function(_0x30e6b3){if(_0x30e6b3&&_0x30e6b3[_0x75d2('0x26')]){var _0x188b15=_[_0x75d2('0x3b')](_0x30e6b3);if(_0x188b15){return BPromise[_0x75d2('0x2a')]({'id':_0x188b15['Id'],'name':_0x188b15[_0x75d2('0x2b')],'phone':_0x188b15['Phone'],'endUserType':_0x188b15[_0x75d2('0x3c')]['type'][_0x75d2('0x3d')]()});}}})[_0x75d2('0x25')](function(_0x435502){if(_0x435502){logger[_0x75d2('0x1e')]('Enduser\x20(%s)\x20with\x20phone\x20%s\x20found',_0x435502[_0x75d2('0x17')],_0x48d2ae);return BPromise['resolve'](_0x435502);}else{logger[_0x75d2('0x1e')](_0x75d2('0x3e'),_0x48d2ae);var _0x10cca4={'Phone':_0x48d2ae};if(_0x2d5f10['moduleCreate']){if(_0x2d5f10[_0x75d2('0x3f')]===_0x75d2('0x1b')){logger[_0x75d2('0x1e')](_0x75d2('0x40'),_0x48d2ae,_0x2d5f10[_0x75d2('0x3f')]);_0x10cca4[_0x75d2('0x41')]=_0x312cfb!==''?_0x312cfb:util['format'](_0x75d2('0x42'),_0x48d2ae);}else if(_0x2d5f10[_0x75d2('0x3f')]==='lead'){logger[_0x75d2('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x48d2ae,_0x2d5f10[_0x75d2('0x3f')]);_0x10cca4[_0x75d2('0x41')]=_0x312cfb!==_0x75d2('0x43')?_0x312cfb:util[_0x75d2('0x44')](_0x75d2('0x42'),_0x48d2ae);_0x10cca4['Company']='No\x20Company';}else if(_0x2d5f10[_0x75d2('0x3f')]===_0x75d2('0x18')){logger[_0x75d2('0x1e')](_0x75d2('0x40'),_0x48d2ae,_0x2d5f10[_0x75d2('0x3f')]);_0x10cca4['Name']=_0x312cfb!==_0x75d2('0x43')?_0x312cfb:util['format'](_0x75d2('0x42'),_0x48d2ae);}else{return null;}}return _0x434fe7['sobject'](_[_0x75d2('0x45')](_0x2d5f10[_0x75d2('0x3f')]))['create'](_0x10cca4)[_0x75d2('0x25')](function(_0x3a6ab7){return BPromise[_0x75d2('0x2a')]({'id':_0x3a6ab7['id'],'endUserType':_0x2d5f10[_0x75d2('0x3f')]});});}});}function getCustomFields(_0x1a32b9,_0x1dc4f2){var _0x55c644={};if(_0x1a32b9[_0x75d2('0x26')]>0x0){_['forEach'](_0x1a32b9,function(_0x54eea4){if(_[_0x75d2('0x46')](['string',_0x75d2('0x47')],_0x54eea4[_0x75d2('0x48')])&&_0x54eea4[_0x75d2('0x49')]){_0x55c644[_0x54eea4['idField']]=_0x54eea4[_0x75d2('0x4a')][_0x75d2('0x4b')]();}else if(_0x54eea4[_0x75d2('0x48')]===_0x75d2('0x4c')&&_0x54eea4['variableName']&&_0x54eea4[_0x75d2('0x49')]){_0x1dc4f2[_0x54eea4[_0x75d2('0x4d')]]&&(_0x55c644[_0x54eea4[_0x75d2('0x49')]]=_0x1dc4f2[_0x54eea4['variableName']][_0x75d2('0x4b')]());}else if(_0x54eea4[_0x75d2('0x48')]===_0x75d2('0x4e')&&_0x54eea4['Variable']&&_0x54eea4[_0x75d2('0x4f')][_0x75d2('0x50')]&&_0x54eea4[_0x75d2('0x49')]){_0x1dc4f2[_0x54eea4['Variable']['name']['toLowerCase']()]&&(_0x55c644[_0x54eea4[_0x75d2('0x49')]]=_0x1dc4f2[_0x54eea4[_0x75d2('0x4f')][_0x75d2('0x50')][_0x75d2('0x3d')]()]['toString']());}});}return _0x55c644;}function getConnection(_0x5f1f1c){var _0x31b033=_0x5f1f1c['password']['concat'](_0x5f1f1c[_0x75d2('0x51')]);var _0x8219eb=new jsforce[(_0x75d2('0x52'))]({'oauth2':{'loginUrl':_0x5f1f1c['remoteUri']||'https://login.salesforce.com','clientId':_0x5f1f1c[_0x75d2('0x53')],'clientSecret':_0x5f1f1c[_0x75d2('0x54')]}});return _0x8219eb['login'](_0x5f1f1c[_0x75d2('0x55')],_0x31b033)[_0x75d2('0x25')](function(){logger[_0x75d2('0x1e')](_0x75d2('0x56'));return _0x8219eb;});}exports[_0x75d2('0x57')]=function(_0xfd5dfa,_0x458cc1,_0x5ab8dc,_0x37ed54,_0x55e9ab,_0x17c4d3){var _0x45a2bd,_0x3c3933,_0x290840,_0x1e40d6;_0x17c4d3['serverUrl']=intUtil[_0x75d2('0x58')](_0x17c4d3[_0x75d2('0x59')]);_0x17c4d3[_0x75d2('0x5a')]=intUtil['stripTrailingSlash'](_0x17c4d3['remoteUri']);if(_0x55e9ab&&_0x55e9ab[_0x75d2('0x5b')]){logger[_0x75d2('0x1e')](_0x75d2('0x5c'),_0x75d2('0x5d'));_0x458cc1[_0x75d2('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x17c4d3[_0x75d2('0x59')],_0x458cc1[_0x75d2('0x5f')],md5(_0x458cc1['uniqueid']));}else{_0x458cc1[_0x75d2('0x5e')]='';}return getConnection(_0x17c4d3)[_0x75d2('0x25')](function(_0x3f46e5){_0x1e40d6=_0x3f46e5;return getUser(_0x17c4d3,_0x37ed54[_0x75d2('0x60')],_0x1e40d6);})[_0x75d2('0x25')](function(_0x8397ec){_0x45a2bd=_0x8397ec;return getEndUser(_0x17c4d3,_0x5ab8dc,_0x458cc1[_0x75d2('0x61')],_0x458cc1[_0x75d2('0x62')],_0x1e40d6);})[_0x75d2('0x25')](function(_0x1bbe17){_0x3c3933=_0x1bbe17;return getTicket(_0x17c4d3,_0x45a2bd,_0x3c3933,_0x5ab8dc,_0x458cc1,_0x5ab8dc[_0x75d2('0x63')],_0x1e40d6,_0x75d2('0x57'));})['then'](function(_0xce419b){_0x290840=_0xce419b;logger[_0x75d2('0x1e')]('[QUEUE]\x20Ticket\x20%s\x20created',_0x290840['id']);logger[_0x75d2('0x1e')](_0x75d2('0x64'),_0x290840['id'],_0x37ed54[_0x75d2('0x50')],_0x17c4d3[_0x75d2('0x48')]);switch(_0x17c4d3['type']){case _0x75d2('0x65'):emit(util['format'](_0x75d2('0x66'),_0x37ed54[_0x75d2('0x50')]),_0x75d2('0x67'),{'recordId':_0x290840['id']});break;case'newTab':emit(util[_0x75d2('0x44')]('user:%s',_0x37ed54[_0x75d2('0x50')]),_0x75d2('0x68'),{'uri':util[_0x75d2('0x44')](_0x75d2('0x69'),_0x1e40d6['instanceUrl'],_0x290840['id'])});break;default:logger['error'](_0x75d2('0x6a'));}})[_0x75d2('0x6b')](function(_0x44901e){logger[_0x75d2('0x6c')](_0x75d2('0x5c'),_0x44901e);});};exports[_0x75d2('0x6d')]=function(_0x6ea552,_0x48c817,_0x7d4c01,_0x522b9d,_0x716889,_0x5ddbac,_0x5eacfc){var _0x37f8c1,_0x5c398f,_0x3af93e,_0x54f0b9;_0x5ddbac[_0x75d2('0x59')]=intUtil[_0x75d2('0x58')](_0x5ddbac[_0x75d2('0x59')]);_0x5ddbac['remoteUri']=intUtil['stripTrailingSlash'](_0x5ddbac[_0x75d2('0x5a')]);if(_0x5eacfc&&_0x5eacfc[_0x75d2('0x6e')]&&_0x5eacfc['recordingFormat']!==_0x75d2('0x6f')){logger['info'](_0x75d2('0x70'),_0x75d2('0x5d'));_0x48c817[_0x75d2('0x5e')]=util[_0x75d2('0x44')](_0x75d2('0x71'),_0x5ddbac['serverUrl'],_0x48c817[_0x75d2('0x5f')],md5(_0x48c817['uniqueid']));}return getConnection(_0x5ddbac)['then'](function(_0x4a1784){_0x54f0b9=_0x4a1784;return getUser(_0x5ddbac,_0x522b9d[_0x75d2('0x60')],_0x54f0b9);})[_0x75d2('0x25')](function(_0x30ec9e){_0x37f8c1=_0x30ec9e;return getEndUser(_0x5ddbac,_0x7d4c01,_0x48c817[_0x75d2('0x72')],_0x48c817[_0x75d2('0x73')],_0x54f0b9);})[_0x75d2('0x25')](function(_0x42fbf8){_0x5c398f=_0x42fbf8;return getTicket(_0x5ddbac,_0x37f8c1,_0x5c398f,_0x7d4c01,_0x48c817,_0x7d4c01[_0x75d2('0x63')],_0x54f0b9,'outbound');})[_0x75d2('0x25')](function(_0x20abeb){_0x3af93e=_0x20abeb;logger[_0x75d2('0x1e')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x3af93e['id']);logger[_0x75d2('0x1e')](_0x75d2('0x74'),_0x3af93e['id'],_0x522b9d[_0x75d2('0x50')],_0x5ddbac[_0x75d2('0x48')]);switch(_0x5ddbac[_0x75d2('0x48')]){case _0x75d2('0x65'):emit(util[_0x75d2('0x44')](_0x75d2('0x66'),_0x522b9d[_0x75d2('0x50')]),'trigger:salesforce:display',{'recordId':_0x3af93e['id']});break;case _0x75d2('0x75'):emit(util[_0x75d2('0x44')](_0x75d2('0x66'),_0x522b9d['name']),_0x75d2('0x68'),{'uri':util[_0x75d2('0x44')](_0x75d2('0x69'),_0x54f0b9[_0x75d2('0x76')],_0x3af93e['id'])});break;default:logger[_0x75d2('0x6c')](_0x75d2('0x70'),_0x75d2('0x77'));}})['catch'](function(_0x2c50f7){logger['error'](_0x75d2('0x70'),_0x2c50f7);});};exports[_0x75d2('0x78')]=function(_0x2033b0,_0x455e17,_0x10089d,_0x488184,_0xebc112,_0x300d71){var _0x3fd552,_0x29d6a0,_0x3066f4,_0x3806f6;_0x300d71[_0x75d2('0x59')]=intUtil[_0x75d2('0x58')](_0x300d71[_0x75d2('0x59')]);_0x300d71[_0x75d2('0x5a')]=intUtil[_0x75d2('0x58')](_0x300d71[_0x75d2('0x5a')]);if(_0xebc112&&_0xebc112[_0x75d2('0x5b')]){logger['info']('['+_0x455e17[_0x75d2('0x79')][_0x75d2('0x7a')]()+']',_0x75d2('0x5d'));_0x455e17[_0x75d2('0x5e')]=util[_0x75d2('0x44')](_0x75d2('0x71'),_0x300d71[_0x75d2('0x59')],_0x455e17[_0x75d2('0x5f')],md5(_0x455e17[_0x75d2('0x5f')]));}else{_0x455e17['recordingURL']='';}return getConnection(_0x300d71)[_0x75d2('0x25')](function(_0x42ab6d){_0x3806f6=_0x42ab6d;if(!_[_0x75d2('0x21')](_0x488184)){return getUser(_0x300d71,_0x488184[_0x75d2('0x50')],_0x3806f6);}else{return getUser(_0x300d71,null,_0x3806f6);}})[_0x75d2('0x25')](function(_0x338de8){_0x3fd552=_0x338de8;return getEndUser(_0x300d71,_0x10089d,_0x455e17[_0x75d2('0x61')],_0x455e17[_0x75d2('0x62')],_0x3806f6);})[_0x75d2('0x25')](function(_0x3f5b5f){_0x29d6a0=_0x3f5b5f;return getTicket(_0x300d71,_0x3fd552,_0x29d6a0,_0x10089d,_0x455e17,_0x10089d[_0x75d2('0x63')],_0x3806f6);})['then'](function(_0xae236c){_0x3066f4=_0xae236c;logger[_0x75d2('0x1e')]('['+_0x455e17[_0x75d2('0x79')][_0x75d2('0x7a')]()+_0x75d2('0x7b'),_0x3066f4['id']);logger[_0x75d2('0x1e')]('['+_0x455e17[_0x75d2('0x79')][_0x75d2('0x7a')]()+_0x75d2('0x7c'),_0x300d71[_0x75d2('0x48')]);})['catch'](function(_0x52d76b){logger[_0x75d2('0x6c')]('['+_0x455e17[_0x75d2('0x79')][_0x75d2('0x7a')]()+']',_0x52d76b);});}; \ 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 4b87ed7..91f402c 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 _0x35a7=['string','picklist','type','customField','toLowerCase','content','toString','idField','variableName','customVariable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','map','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','trigger:browser:url','username','password','sysparm_limit=1','sysparm_display_value=true','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','email','destcalleridnum','callDirection','queue','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','unmanaged','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','util','md5','ioredis','../../../../config/environment','servicenow','redis','defaults','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','length','adminId','result','info','toUpperCase','],\x20getAdminUser\x20crm','error','message','],\x20getUser\x20input\x20crm','validateEmail','GET','userEmail','],\x20getUser\x20rp\x20obj','],\x20getUser\x20entity','active','userId','sys_id','],\x20getUser\x20crm',']\x20using\x20admin\x20profile','adminEmail','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','true','System','endUserId','catch','],\x20getEndUser\x20input\x20crm','forEach','includes'];(function(_0x5259d6,_0x1cd582){var _0x1704ff=function(_0x5a1380){while(--_0x5a1380){_0x5259d6['push'](_0x5259d6['shift']());}};_0x1704ff(++_0x1cd582);}(_0x35a7,0x114));var _0x735a=function(_0x1cb84c,_0x576b00){_0x1cb84c=_0x1cb84c-0x0;var _0x1ff4ed=_0x35a7[_0x1cb84c];return _0x1ff4ed;};'use strict';var _=require('lodash');var Promise=require('bluebird');var rp=require('request-promise');var util=require(_0x735a('0x0'));var md5=require(_0x735a('0x1'));var Redis=require(_0x735a('0x2'));var intUtil=require('./util');var config=require(_0x735a('0x3'));var logger=require('../../../../config/logger')(_0x735a('0x4'));config[_0x735a('0x5')]=_[_0x735a('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x735a('0x7'))(new Redis(config[_0x735a('0x5')]));function getAdminUser(_0x26c5f1,_0x334d42,_0x41ca64,_0x3b05fd,_0x5b029e,_0x266b3b){return new Promise(function(_0x483e28,_0x5cfff0){var _0x3530d9={'method':'GET','uri':_0x3b05fd+_0x735a('0x8')+'&'+_0x5b029e+'&'+_0x266b3b,'auth':_0x334d42,'json':!![]};return rp(_0x3530d9)[_0x735a('0x9')](function(_0x14d13b){if(_0x14d13b['result'][_0x735a('0xa')]>0x0){_0x41ca64[_0x735a('0xb')]=_0x14d13b[_0x735a('0xc')][0x0]['sys_id'];}logger[_0x735a('0xd')]('['+[_0x26c5f1[_0x735a('0xe')]()]+_0x735a('0xf'),_0x41ca64);_0x483e28(_0x41ca64);})['catch'](function(_0x38012f){logger[_0x735a('0x10')]('['+[_0x26c5f1[_0x735a('0xe')]()]+']',_0x38012f['message']);_0x5cfff0(_0x38012f[_0x735a('0x11')]);});});}function getUser(_0x5dbf29,_0x343faa,_0x21869d,_0x2d4ebe,_0x566c37){return function(_0x440c93){logger[_0x735a('0xd')]('['+[_0x5dbf29[_0x735a('0xe')]()]+_0x735a('0x12'),_0x440c93);return new Promise(function(_0x1f817d,_0x9a6216){if(intUtil[_0x735a('0x13')](_0x440c93['userEmail'])){var _0x10003d={'method':_0x735a('0x14'),'uri':_0x21869d+'sys_user?sysparm_query=email%3D'+_0x440c93[_0x735a('0x15')]+'&'+_0x2d4ebe+'&'+_0x566c37,'auth':_0x343faa,'json':!![]};logger[_0x735a('0xd')]('['+[_0x5dbf29[_0x735a('0xe')]()]+_0x735a('0x16'),_0x10003d);return rp(_0x10003d)[_0x735a('0x9')](function(_0x21a38b){logger[_0x735a('0xd')]('['+[_0x5dbf29[_0x735a('0xe')]()]+_0x735a('0x17'),_0x21a38b);if(_0x21a38b[_0x735a('0xc')]['length']>0x0&&String(_0x21a38b[_0x735a('0xc')][0x0][_0x735a('0x18')])==='true'){_0x440c93[_0x735a('0x19')]=_0x21a38b[_0x735a('0xc')][0x0][_0x735a('0x1a')];}else{_0x440c93[_0x735a('0x19')]=_0x440c93[_0x735a('0xb')];_0x440c93[_0x735a('0x15')]=_0x440c93['adminEmail'];}logger[_0x735a('0xd')]('['+[_0x5dbf29[_0x735a('0xe')]()]+_0x735a('0x1b'),_0x440c93);_0x1f817d(_0x440c93);})['catch'](function(_0x38c564){logger[_0x735a('0x10')]('['+[_0x5dbf29['toUpperCase']()]+']',_0x38c564[_0x735a('0x11')]);_0x9a6216(_0x38c564[_0x735a('0x11')]);});}else{logger[_0x735a('0xd')]('['+[_0x5dbf29[_0x735a('0xe')]()]+_0x735a('0x1c'));_0x440c93[_0x735a('0x19')]=_0x440c93[_0x735a('0xb')];_0x440c93[_0x735a('0x15')]=_0x440c93[_0x735a('0x1d')];_0x1f817d(_0x440c93);}});};}function createEndUser(_0x48d135,_0x25032b,_0x110be8,_0x2f6adf,_0x4af606){logger['info']('['+[_0x48d135[_0x735a('0xe')]()]+_0x735a('0x1e'),_0x110be8);return new Promise(function(_0x1654e2,_0x2aef2c){var _0x305f55={'method':_0x735a('0x1f'),'uri':_0x2f6adf+_0x735a('0x20')+_0x4af606,'body':{'user_name':_0x110be8[_0x735a('0x21')],'roles':_0x735a('0x22'),'first_name':_0x110be8[_0x735a('0x21')],'active':_0x735a('0x23'),'date_format':_0x735a('0x24'),'phone':_0x110be8['endUserNumber']},'auth':_0x25032b,'json':!![]};return rp(_0x305f55)[_0x735a('0x9')](function(_0x27e2e9){logger[_0x735a('0xd')]('['+[_0x48d135[_0x735a('0xe')]()]+'],\x20EndUser\x20schema',_0x27e2e9['result']);_0x110be8[_0x735a('0x25')]=_0x27e2e9['result']['sys_id'];_0x1654e2(_0x110be8);})[_0x735a('0x26')](function(_0x12dd94){logger[_0x735a('0x10')]('['+[_0x48d135[_0x735a('0xe')]()]+']',_0x12dd94[_0x735a('0x11')]);_0x2aef2c(_0x12dd94[_0x735a('0x11')]);});});}function getEndUser(_0x1ace81,_0x3ce635,_0x19343f,_0x4aeeb6,_0x1cc1ab){return function(_0x45f3f1){logger['info']('['+[_0x1ace81['toUpperCase']()]+_0x735a('0x27'),_0x45f3f1);return new Promise(function(_0xd1b18e,_0x4d0671){var _0x366902={'method':_0x735a('0x14'),'uri':_0x19343f+'sys_user?sysparm_query=phone%3D'+_0x45f3f1[_0x735a('0x21')]+'&'+_0x4aeeb6+'&'+_0x1cc1ab,'auth':_0x3ce635,'json':!![]};return rp(_0x366902)[_0x735a('0x9')](function(_0x16632f){if(_0x16632f['result'][_0x735a('0xa')]>0x0){_0x45f3f1[_0x735a('0x25')]=_0x16632f[_0x735a('0xc')][0x0]['sys_id'];logger[_0x735a('0xd')]('['+[_0x1ace81['toUpperCase']()]+'],\x20getEndUser\x20crm',_0x45f3f1);_0xd1b18e(_0x45f3f1);}else{return createEndUser(_0x1ace81,_0x3ce635,_0x45f3f1,_0x19343f,_0x4aeeb6)[_0x735a('0x9')](function(_0x2bf15d){logger[_0x735a('0xd')]('['+[_0x1ace81[_0x735a('0xe')]()]+'],\x20createEndUser\x20crm',_0x2bf15d);_0xd1b18e(_0x2bf15d);});}})['catch'](function(_0x162a6a){logger[_0x735a('0x10')]('['+[_0x1ace81[_0x735a('0xe')]()]+']',_0x162a6a[_0x735a('0x11')]);_0x4d0671(_0x162a6a[_0x735a('0x11')]);});});};}function getCustomFields(_0x38f9ec,_0x1e4b66){var _0xfdcf00={};if(_0x38f9ec[_0x735a('0xa')]>0x0){_[_0x735a('0x28')](_0x38f9ec,function(_0x2116eb){if(_[_0x735a('0x29')]([_0x735a('0x2a'),_0x735a('0x2b')],_0x2116eb[_0x735a('0x2c')])&&_0x2116eb['nameField']&&!_0x2116eb[_0x735a('0x2d')]){_0xfdcf00[_0x2116eb['nameField'][_0x735a('0x2e')]()]=_0x2116eb[_0x735a('0x2f')][_0x735a('0x30')]();}else if(_['includes']([_0x735a('0x2a'),_0x735a('0x2b')],_0x2116eb['type'])&&_0x2116eb[_0x735a('0x31')]&&_0x2116eb[_0x735a('0x2d')]){_0xfdcf00[_0x2116eb['idField'][_0x735a('0x2e')]()]=_0x2116eb[_0x735a('0x2f')][_0x735a('0x30')]();}else if(_0x2116eb[_0x735a('0x2c')]==='variable'&&_0x2116eb[_0x735a('0x32')]&&_0x2116eb['idField']&&_0x2116eb['customField']){_0xfdcf00[_0x2116eb[_0x735a('0x31')][_0x735a('0x2e')]()]=_0x1e4b66[_0x2116eb[_0x735a('0x32')]][_0x735a('0x30')]();}else if(_0x2116eb['type']===_0x735a('0x33')&&_0x2116eb['Variable']&&_0x2116eb['Variable'][_0x735a('0x34')]&&_0x2116eb['idField']&&_0x2116eb[_0x735a('0x2d')]){_0xfdcf00[_0x2116eb['idField']['toLowerCase']()]=_0x1e4b66[_0x2116eb['Variable'][_0x735a('0x34')][_0x735a('0x2e')]()][_0x735a('0x30')]();}});}return _0xfdcf00;}function getTicket(_0x4ef967,_0x2f8c26,_0x516bea,_0x3f8f5f,_0x4bceb8,_0x950fd9){return function(_0x2f86f0){logger[_0x735a('0xd')]('['+[_0x4ef967['toUpperCase']()]+_0x735a('0x35'),_0x2f86f0);return new Promise(function(_0x39ac0e,_0x4665e8){var _0x4500c3=_0x4ef967[_0x735a('0x2e')]()===_0x735a('0x36')?_0x2f86f0[_0x735a('0x19')]:_0x2f86f0['endUserId'];var _0x538d2b={'method':_0x735a('0x1f'),'uri':_0x516bea+'incident'+'?'+_0x950fd9,'body':Object[_0x735a('0x37')]({},{'active':'true','caller_id':_0x4500c3,'assigned_to':_0x2f86f0[_0x735a('0x19')],'short_description':intUtil[_0x735a('0x38')](_0x3f8f5f[_0x735a('0x39')],_0x4bceb8,'\x20'),'description':intUtil['getString'](_0x3f8f5f[_0x735a('0x3a')],_0x4bceb8,'\x0a')},getCustomFields(_0x3f8f5f[_0x735a('0x3b')],_0x4bceb8)),'auth':_0x2f8c26,'json':!![]};return rp(_0x538d2b)[_0x735a('0x9')](function(_0x1b5c86){logger[_0x735a('0xd')]('['+[_0x4ef967[_0x735a('0xe')]()]+_0x735a('0x3c'),_0x1b5c86[_0x735a('0xc')]);_0x2f86f0[_0x735a('0x3d')]=_0x1b5c86[_0x735a('0xc')][_0x735a('0x1a')];_0x2f86f0[_0x735a('0x3e')]=_0x1b5c86[_0x735a('0xc')][_0x735a('0x3f')];logger[_0x735a('0xd')]('['+[_0x4ef967[_0x735a('0xe')]()]+_0x735a('0x40'),_0x2f86f0);_0x39ac0e(_0x2f86f0);})['catch'](function(_0x5b2718){logger[_0x735a('0x10')]('['+[_0x4ef967['toUpperCase']()]+']',_0x5b2718['message']);_0x4665e8(_0x5b2718[_0x735a('0x11')]);});});};}function createRemoteTag(_0x420a9e,_0xec00af,_0x5d7c64,_0x3285f6){return new Promise(function(_0x7b03cd,_0x4ecbc7){var _0x1c2146={'method':_0x735a('0x1f'),'uri':_0x5d7c64+_0x735a('0x41')+'?'+_0x3285f6,'body':{'short_description':_0x420a9e,'global':!![],'active':!![],'name':_0x420a9e},'auth':_0xec00af,'json':!![]};return rp(_0x1c2146)['then'](function(_0x132924){var _0x2e645d=_0x132924['result'][_0x735a('0x1a')];_0x7b03cd(_0x2e645d);});});}function getRemoteTag(_0xdb5dca,_0x5100da,_0x19a2ac,_0x7f1298,_0x53eae2){return new Promise(function(_0x12a8ea,_0x467658){var _0x36a340={'method':_0x735a('0x14'),'uri':_0x19a2ac+'label'+_0x735a('0x42')+_0xdb5dca+'&'+_0x7f1298,'auth':_0x5100da,'json':!![]};return rp(_0x36a340)[_0x735a('0x9')](function(_0x1b2f2e){if(_0x1b2f2e[_0x735a('0xc')][_0x735a('0xa')]>0x0){var _0x3d376f=_0x1b2f2e[_0x735a('0xc')][0x0][_0x735a('0x1a')];_0x12a8ea(_0x3d376f);}else{return createRemoteTag(_0xdb5dca,_0x5100da,_0x19a2ac,_0x7f1298)[_0x735a('0x9')](function(_0x382d8f){_0x12a8ea(_0x382d8f);});}});});}function assignTagToIncident(_0x59fcff,_0x43d8a9,_0x215cad,_0x3a1f0d,_0x1bae56){return new Promise(function(_0x57df62,_0x1a640a){var _0x5a7618={'method':_0x735a('0x1f'),'uri':_0x215cad+_0x735a('0x43')+'?'+_0x1bae56,'body':{'label':_0x59fcff,'table':'incident','id_type':_0x735a('0x44'),'table_key':_0x3a1f0d[_0x735a('0x3d')],'title':_0x735a('0x45')+_0x3a1f0d['ticketNumber'],'id_display':_0x3a1f0d[_0x735a('0x3e')]},'auth':_0x43d8a9,'json':!![]};return rp(_0x5a7618)['then'](function(_0x26d225){_0x57df62();})[_0x735a('0x26')](function(){_0x57df62();});});}function manageTags(_0x3f6821,_0x1b9bec,_0x584ce5,_0x302052,_0x59c233,_0x3f0515,_0xf5e88a){return new Promise(function(_0x546c03,_0x3d2ffd){var _0x3f3ccc=[];_0x1b9bec[_0x735a('0x28')](function(_0xe8b81){_0x3f3ccc[_0x735a('0x46')](getRemoteTag(_0xe8b81,_0x584ce5,_0x302052,_0x3f0515,_0xf5e88a));});return Promise['all'](_0x3f3ccc)['then'](function(_0x4d44e2){if(_0x4d44e2['length']){logger['info']('['+[_0x3f6821[_0x735a('0xe')]()]+_0x735a('0x47'),_0x4d44e2);var _0x29d411=[];_0x4d44e2[_0x735a('0x28')](function(_0x13ba5c){_0x29d411[_0x735a('0x46')](assignTagToIncident(_0x13ba5c,_0x584ce5,_0x302052,_0x59c233,_0x3f0515));});return Promise[_0x735a('0x48')](_0x29d411)['then'](function(){_0x546c03();})['catch'](function(){_0x546c03();});}else{_0x546c03();}});});}function getTags(_0x2de7a3,_0x1ae509,_0x559e28,_0x44012c,_0x487579,_0x4f7902){return function(_0x50989b){return new Promise(function(_0x51da4e,_0x104bf6){var _0xde7d2b=[];var _0x4910e7=_0x44012c['Tags'];if(_0x4910e7&&_0x4910e7[_0x735a('0xa')]>0x0){_0xde7d2b=_[_0x735a('0x49')](_0x4910e7,_0x735a('0x34'));}if(_0xde7d2b[_0x735a('0xa')]>0x0){return manageTags(_0x2de7a3,_0xde7d2b,_0x1ae509,_0x559e28,_0x50989b,_0x487579,_0x4f7902)[_0x735a('0x9')](function(){_0x51da4e(_0x50989b);});}else{_0x51da4e(_0x50989b);}});};}function emit(_0x2e5c11,_0x22d002,_0x3516fe){var _0x3ebc35='%26sysparm_record_target%3Dincident'+_0x735a('0x4a')+_0x735a('0x4b')+'%255EORDERBYDESCnumber';var _0x420122={'uri':_0x2e5c11+_0x735a('0x4c')+_0x3516fe+_0x3ebc35};io['to'](util[_0x735a('0x4d')](_0x735a('0x4e'),_0x22d002))['emit'](_0x735a('0x4f'),_0x420122);}exports['cs']=function(_0x387c9f,_0x48724a,_0x4dce71,_0x1e3d58,_0x3e900d,_0x4fc901,_0x2b3179,_0x5beed0){var _0x39b6a4={};var _0x482cba={'user':_0x4fc901[_0x735a('0x50')],'pass':_0x4fc901[_0x735a('0x51')]};var _0x515ee8=_0x735a('0x52');var _0x4bab26=_0x735a('0x53');_0x4fc901[_0x735a('0x54')]=intUtil[_0x735a('0x55')](_0x4fc901['remoteUri']);_0x4fc901[_0x735a('0x56')]=intUtil[_0x735a('0x55')](_0x4fc901['serverUrl']);var _0xfdf1fc=util[_0x735a('0x4d')](_0x735a('0x57'),_0x4fc901['remoteUri']);_0x39b6a4[_0x735a('0x15')]=!_['isNil'](_0x1e3d58)?_0x1e3d58[_0x735a('0x58')]:null;_0x39b6a4['adminEmail']=_0x4fc901[_0x735a('0x58')];_0x39b6a4[_0x735a('0x21')]=_0x5beed0[_0x735a('0x2e')]()===_0x735a('0x36')?_0x48724a[_0x735a('0x59')]:_0x48724a['calleridnum'];_0x39b6a4[_0x735a('0x5a')]=_0x5beed0===_0x735a('0x5b')||_0x5beed0==='unmanaged'?_0x735a('0x5b'):'outbound';var _0x445323=util[_0x735a('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4fc901[_0x735a('0x56')],_0x48724a[_0x735a('0x5c')],md5(_0x48724a[_0x735a('0x5c')]));if(_0x3e900d&&_0x3e900d[_0x735a('0x5d')]){logger[_0x735a('0xd')](_0x735a('0x5e'),_0x735a('0x5f'));_0x48724a[_0x735a('0x60')]=_0x445323;}else if(_0x2b3179&&_0x2b3179[_0x735a('0x61')]&&_0x2b3179[_0x735a('0x61')]!==_0x735a('0x62')){logger[_0x735a('0xd')](_0x735a('0x63'),_0x735a('0x5f'));_0x48724a[_0x735a('0x60')]=_0x445323;}else{_0x48724a[_0x735a('0x60')]='';}return getAdminUser(_0x5beed0,_0x482cba,_0x39b6a4,_0xfdf1fc,_0x4bab26,_0x515ee8)[_0x735a('0x9')](getUser(_0x5beed0,_0x482cba,_0xfdf1fc,_0x4bab26,_0x515ee8))['then'](getEndUser(_0x5beed0,_0x482cba,_0xfdf1fc,_0x4bab26,_0x515ee8))[_0x735a('0x9')](getTicket(_0x5beed0,_0x482cba,_0xfdf1fc,_0x4dce71,_0x48724a,_0x4bab26))[_0x735a('0x9')](function(_0x1e5e85){logger[_0x735a('0xd')](util['format'](_0x735a('0x64'),_0x1e5e85['ticketId']));logger[_0x735a('0xd')](util['format'](_0x735a('0x65'),_0x5beed0));if(_0x5beed0!==_0x735a('0x66')){logger['info']('['+[_0x5beed0[_0x735a('0xe')]()]+']',_0x735a('0x67'));emit(_0x4fc901['remoteUri'],_0x1e3d58[_0x735a('0x34')],_0x1e5e85['ticketId']);}})[_0x735a('0x26')](function(_0x289062){logger[_0x735a('0x10')]('['+[_0x5beed0['toUpperCase']()]+_0x735a('0x68'),util[_0x735a('0x69')](_0x289062,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x586f=['uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','[OUTBOUND]','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','../../../../config/environment','servicenow','redis','defaults','localhost','socket.io-emitter','GET','then','length','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','catch','message','info','],\x20getUser\x20input\x20crm','validateEmail','userEmail','result','active','true','userId','adminEmail','],\x20getUser\x20crm','error',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','],\x20EndUser\x20schema','endUserId','],\x20getEndUser\x20input\x20crm','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','picklist','type','nameField','customField','toLowerCase','content','toString','includes','variable','variableName','idField','Variable',']\x20getTicket\x20input\x20crm','incident','assign','getString','Subjects','Descriptions',']\x20POST\x20incident\x20entity\x20schema','ticketId','ticketNumber','number','label','?sysparm_query=name%3D','label_entry','Incident','Incident\x20-\x20','forEach','push','all','map','name','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','username','password','sysparm_display_value=true','stripTrailingSlash','remoteUri','serverUrl','%s/api/now/table/','email','outbound','calleridnum','callDirection','queue','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x79fe56,_0xcfe2d){var _0x242906=function(_0x4ebb4f){while(--_0x4ebb4f){_0x79fe56['push'](_0x79fe56['shift']());}};_0x242906(++_0xcfe2d);}(_0x586f,0xe1));var _0xf586=function(_0x288371,_0x35f999){_0x288371=_0x288371-0x0;var _0x5a1ad1=_0x586f[_0x288371];return _0x5a1ad1;};'use strict';var _=require(_0xf586('0x0'));var Promise=require(_0xf586('0x1'));var rp=require(_0xf586('0x2'));var util=require(_0xf586('0x3'));var md5=require('md5');var Redis=require(_0xf586('0x4'));var intUtil=require('./util');var config=require(_0xf586('0x5'));var logger=require('../../../../config/logger')(_0xf586('0x6'));config[_0xf586('0x7')]=_[_0xf586('0x8')](config['redis'],{'host':_0xf586('0x9'),'port':0x18eb});var io=require(_0xf586('0xa'))(new Redis(config[_0xf586('0x7')]));function getAdminUser(_0x379578,_0x400347,_0x3e60d6,_0x54fd28,_0x4aa82f,_0x47b16f){return new Promise(function(_0x57552d,_0x570bb5){var _0x356e28={'method':_0xf586('0xb'),'uri':_0x54fd28+'sys_user?sysparm_query=user_name%3Dadmin'+'&'+_0x4aa82f+'&'+_0x47b16f,'auth':_0x400347,'json':!![]};return rp(_0x356e28)[_0xf586('0xc')](function(_0x1a2625){if(_0x1a2625['result'][_0xf586('0xd')]>0x0){_0x3e60d6[_0xf586('0xe')]=_0x1a2625['result'][0x0][_0xf586('0xf')];}logger['info']('['+[_0x379578[_0xf586('0x10')]()]+_0xf586('0x11'),_0x3e60d6);_0x57552d(_0x3e60d6);})[_0xf586('0x12')](function(_0x95c1bc){logger['error']('['+[_0x379578[_0xf586('0x10')]()]+']',_0x95c1bc['message']);_0x570bb5(_0x95c1bc[_0xf586('0x13')]);});});}function getUser(_0x5d8961,_0x177e18,_0x2b74a6,_0x315a42,_0x5dd1ff){return function(_0x1d843c){logger[_0xf586('0x14')]('['+[_0x5d8961[_0xf586('0x10')]()]+_0xf586('0x15'),_0x1d843c);return new Promise(function(_0x33908b,_0x316d03){if(intUtil[_0xf586('0x16')](_0x1d843c['userEmail'])){var _0x5f09e1={'method':_0xf586('0xb'),'uri':_0x2b74a6+'sys_user?sysparm_query=email%3D'+_0x1d843c[_0xf586('0x17')]+'&'+_0x315a42+'&'+_0x5dd1ff,'auth':_0x177e18,'json':!![]};logger[_0xf586('0x14')]('['+[_0x5d8961[_0xf586('0x10')]()]+'],\x20getUser\x20rp\x20obj',_0x5f09e1);return rp(_0x5f09e1)[_0xf586('0xc')](function(_0x583d2c){logger[_0xf586('0x14')]('['+[_0x5d8961[_0xf586('0x10')]()]+'],\x20getUser\x20entity',_0x583d2c);if(_0x583d2c[_0xf586('0x18')]['length']>0x0&&String(_0x583d2c['result'][0x0][_0xf586('0x19')])===_0xf586('0x1a')){_0x1d843c[_0xf586('0x1b')]=_0x583d2c[_0xf586('0x18')][0x0][_0xf586('0xf')];}else{_0x1d843c[_0xf586('0x1b')]=_0x1d843c[_0xf586('0xe')];_0x1d843c[_0xf586('0x17')]=_0x1d843c[_0xf586('0x1c')];}logger['info']('['+[_0x5d8961[_0xf586('0x10')]()]+_0xf586('0x1d'),_0x1d843c);_0x33908b(_0x1d843c);})[_0xf586('0x12')](function(_0x562620){logger[_0xf586('0x1e')]('['+[_0x5d8961['toUpperCase']()]+']',_0x562620[_0xf586('0x13')]);_0x316d03(_0x562620[_0xf586('0x13')]);});}else{logger[_0xf586('0x14')]('['+[_0x5d8961[_0xf586('0x10')]()]+_0xf586('0x1f'));_0x1d843c['userId']=_0x1d843c[_0xf586('0xe')];_0x1d843c[_0xf586('0x17')]=_0x1d843c['adminEmail'];_0x33908b(_0x1d843c);}});};}function createEndUser(_0x24db3c,_0x596cf0,_0x3ecb17,_0x58dd01,_0x2e7220){logger[_0xf586('0x14')]('['+[_0x24db3c[_0xf586('0x10')]()]+_0xf586('0x20'),_0x3ecb17);return new Promise(function(_0x3ff4c6,_0xe4393f){var _0x29ec2e={'method':_0xf586('0x21'),'uri':_0x58dd01+_0xf586('0x22')+_0x2e7220,'body':{'user_name':_0x3ecb17['endUserNumber'],'roles':_0xf586('0x23'),'first_name':_0x3ecb17['endUserNumber'],'active':'true','date_format':'System','phone':_0x3ecb17[_0xf586('0x24')]},'auth':_0x596cf0,'json':!![]};return rp(_0x29ec2e)[_0xf586('0xc')](function(_0x4ad7a3){logger['info']('['+[_0x24db3c[_0xf586('0x10')]()]+_0xf586('0x25'),_0x4ad7a3['result']);_0x3ecb17[_0xf586('0x26')]=_0x4ad7a3[_0xf586('0x18')][_0xf586('0xf')];_0x3ff4c6(_0x3ecb17);})[_0xf586('0x12')](function(_0x59d2f9){logger[_0xf586('0x1e')]('['+[_0x24db3c[_0xf586('0x10')]()]+']',_0x59d2f9[_0xf586('0x13')]);_0xe4393f(_0x59d2f9[_0xf586('0x13')]);});});}function getEndUser(_0x21b549,_0x484381,_0x31a81b,_0x471ce9,_0x1e25b6){return function(_0x3c6b6a){logger[_0xf586('0x14')]('['+[_0x21b549['toUpperCase']()]+_0xf586('0x27'),_0x3c6b6a);return new Promise(function(_0x3fdf07,_0x54dd4f){var _0x201490={'method':_0xf586('0xb'),'uri':_0x31a81b+_0xf586('0x28')+_0x3c6b6a[_0xf586('0x24')]+'&'+_0x471ce9+'&'+_0x1e25b6,'auth':_0x484381,'json':!![]};return rp(_0x201490)[_0xf586('0xc')](function(_0x39f9e1){if(_0x39f9e1[_0xf586('0x18')][_0xf586('0xd')]>0x0){_0x3c6b6a['endUserId']=_0x39f9e1[_0xf586('0x18')][0x0]['sys_id'];logger[_0xf586('0x14')]('['+[_0x21b549['toUpperCase']()]+_0xf586('0x29'),_0x3c6b6a);_0x3fdf07(_0x3c6b6a);}else{return createEndUser(_0x21b549,_0x484381,_0x3c6b6a,_0x31a81b,_0x471ce9)[_0xf586('0xc')](function(_0x5f361f){logger[_0xf586('0x14')]('['+[_0x21b549[_0xf586('0x10')]()]+_0xf586('0x2a'),_0x5f361f);_0x3fdf07(_0x5f361f);});}})[_0xf586('0x12')](function(_0x2aff02){logger[_0xf586('0x1e')]('['+[_0x21b549['toUpperCase']()]+']',_0x2aff02[_0xf586('0x13')]);_0x54dd4f(_0x2aff02[_0xf586('0x13')]);});});};}function getCustomFields(_0x4872c7,_0x301287){var _0x4389b7={};if(_0x4872c7['length']>0x0){_['forEach'](_0x4872c7,function(_0x30c20f){if(_['includes'](['string',_0xf586('0x2b')],_0x30c20f[_0xf586('0x2c')])&&_0x30c20f[_0xf586('0x2d')]&&!_0x30c20f[_0xf586('0x2e')]){_0x4389b7[_0x30c20f[_0xf586('0x2d')][_0xf586('0x2f')]()]=_0x30c20f[_0xf586('0x30')][_0xf586('0x31')]();}else if(_[_0xf586('0x32')](['string',_0xf586('0x2b')],_0x30c20f[_0xf586('0x2c')])&&_0x30c20f['idField']&&_0x30c20f[_0xf586('0x2e')]){_0x4389b7[_0x30c20f['idField'][_0xf586('0x2f')]()]=_0x30c20f[_0xf586('0x30')][_0xf586('0x31')]();}else if(_0x30c20f[_0xf586('0x2c')]===_0xf586('0x33')&&_0x30c20f[_0xf586('0x34')]&&_0x30c20f[_0xf586('0x35')]&&_0x30c20f[_0xf586('0x2e')]){_0x4389b7[_0x30c20f[_0xf586('0x35')][_0xf586('0x2f')]()]=_0x301287[_0x30c20f[_0xf586('0x34')]][_0xf586('0x31')]();}else if(_0x30c20f['type']==='customVariable'&&_0x30c20f['Variable']&&_0x30c20f[_0xf586('0x36')]['name']&&_0x30c20f['idField']&&_0x30c20f['customField']){_0x4389b7[_0x30c20f[_0xf586('0x35')][_0xf586('0x2f')]()]=_0x301287[_0x30c20f['Variable']['name'][_0xf586('0x2f')]()][_0xf586('0x31')]();}});}return _0x4389b7;}function getTicket(_0x302ddf,_0x3f9283,_0x3eefe9,_0x992737,_0x4a4d4d,_0x5ab58c){return function(_0x1331c6){logger[_0xf586('0x14')]('['+[_0x302ddf[_0xf586('0x10')]()]+_0xf586('0x37'),_0x1331c6);return new Promise(function(_0x3e5377,_0x5da323){var _0x398491=_0x302ddf['toLowerCase']()==='outbound'?_0x1331c6[_0xf586('0x1b')]:_0x1331c6[_0xf586('0x26')];var _0x1c7e60={'method':_0xf586('0x21'),'uri':_0x3eefe9+_0xf586('0x38')+'?'+_0x5ab58c,'body':Object[_0xf586('0x39')]({},{'active':_0xf586('0x1a'),'caller_id':_0x398491,'assigned_to':_0x1331c6[_0xf586('0x1b')],'short_description':intUtil[_0xf586('0x3a')](_0x992737[_0xf586('0x3b')],_0x4a4d4d,'\x20'),'description':intUtil['getString'](_0x992737[_0xf586('0x3c')],_0x4a4d4d,'\x0a')},getCustomFields(_0x992737['Fields'],_0x4a4d4d)),'auth':_0x3f9283,'json':!![]};return rp(_0x1c7e60)['then'](function(_0x459007){logger[_0xf586('0x14')]('['+[_0x302ddf[_0xf586('0x10')]()]+_0xf586('0x3d'),_0x459007['result']);_0x1331c6[_0xf586('0x3e')]=_0x459007[_0xf586('0x18')][_0xf586('0xf')];_0x1331c6[_0xf586('0x3f')]=_0x459007[_0xf586('0x18')][_0xf586('0x40')];logger['info']('['+[_0x302ddf['toUpperCase']()]+']\x20getTicket\x20crm',_0x1331c6);_0x3e5377(_0x1331c6);})[_0xf586('0x12')](function(_0x2c0057){logger[_0xf586('0x1e')]('['+[_0x302ddf[_0xf586('0x10')]()]+']',_0x2c0057[_0xf586('0x13')]);_0x5da323(_0x2c0057[_0xf586('0x13')]);});});};}function createRemoteTag(_0x198c1b,_0x1b11cc,_0x590649,_0x5640fd){return new Promise(function(_0x28da0b,_0x7081b2){var _0x20d85a={'method':_0xf586('0x21'),'uri':_0x590649+'label'+'?'+_0x5640fd,'body':{'short_description':_0x198c1b,'global':!![],'active':!![],'name':_0x198c1b},'auth':_0x1b11cc,'json':!![]};return rp(_0x20d85a)[_0xf586('0xc')](function(_0x56b827){var _0x5069d7=_0x56b827[_0xf586('0x18')][_0xf586('0xf')];_0x28da0b(_0x5069d7);});});}function getRemoteTag(_0x2100fd,_0x5b4796,_0x3a65ac,_0x267b91,_0x3a4cf4){return new Promise(function(_0x284784,_0x102699){var _0x1ee519={'method':'GET','uri':_0x3a65ac+_0xf586('0x41')+_0xf586('0x42')+_0x2100fd+'&'+_0x267b91,'auth':_0x5b4796,'json':!![]};return rp(_0x1ee519)[_0xf586('0xc')](function(_0x33b2ae){if(_0x33b2ae[_0xf586('0x18')][_0xf586('0xd')]>0x0){var _0xe71090=_0x33b2ae[_0xf586('0x18')][0x0][_0xf586('0xf')];_0x284784(_0xe71090);}else{return createRemoteTag(_0x2100fd,_0x5b4796,_0x3a65ac,_0x267b91)[_0xf586('0xc')](function(_0x371e1){_0x284784(_0x371e1);});}});});}function assignTagToIncident(_0x28d267,_0xa34d29,_0x2369e0,_0x338fe7,_0x11a546){return new Promise(function(_0x27c889,_0xe8fb04){var _0x9f078d={'method':_0xf586('0x21'),'uri':_0x2369e0+_0xf586('0x43')+'?'+_0x11a546,'body':{'label':_0x28d267,'table':_0xf586('0x38'),'id_type':_0xf586('0x44'),'table_key':_0x338fe7['ticketId'],'title':_0xf586('0x45')+_0x338fe7[_0xf586('0x3f')],'id_display':_0x338fe7['ticketNumber']},'auth':_0xa34d29,'json':!![]};return rp(_0x9f078d)[_0xf586('0xc')](function(_0x196450){_0x27c889();})['catch'](function(){_0x27c889();});});}function manageTags(_0x16c5fe,_0x1f2cfd,_0x3d24b2,_0x4645d9,_0x565ade,_0x2a30c5,_0x58324d){return new Promise(function(_0x5d27b7,_0x2361ca){var _0x3c6f50=[];_0x1f2cfd[_0xf586('0x46')](function(_0x5df7fd){_0x3c6f50[_0xf586('0x47')](getRemoteTag(_0x5df7fd,_0x3d24b2,_0x4645d9,_0x2a30c5,_0x58324d));});return Promise[_0xf586('0x48')](_0x3c6f50)[_0xf586('0xc')](function(_0x4d0985){if(_0x4d0985['length']){logger['info']('['+[_0x16c5fe['toUpperCase']()]+']\x20arrayPromises:\x20IDs\x20in\x20table\x20label',_0x4d0985);var _0x58d70a=[];_0x4d0985[_0xf586('0x46')](function(_0x34806c){_0x58d70a[_0xf586('0x47')](assignTagToIncident(_0x34806c,_0x3d24b2,_0x4645d9,_0x565ade,_0x2a30c5));});return Promise['all'](_0x58d70a)['then'](function(){_0x5d27b7();})[_0xf586('0x12')](function(){_0x5d27b7();});}else{_0x5d27b7();}});});}function getTags(_0x3cacfb,_0x28c25e,_0x3d52ca,_0x517d2f,_0x230c88,_0x41c590){return function(_0x5c44b5){return new Promise(function(_0x4613af,_0x410e57){var _0x509e18=[];var _0x1bc5f7=_0x517d2f['Tags'];if(_0x1bc5f7&&_0x1bc5f7[_0xf586('0xd')]>0x0){_0x509e18=_[_0xf586('0x49')](_0x1bc5f7,_0xf586('0x4a'));}if(_0x509e18['length']>0x0){return manageTags(_0x3cacfb,_0x509e18,_0x28c25e,_0x3d52ca,_0x5c44b5,_0x230c88,_0x41c590)[_0xf586('0xc')](function(){_0x4613af(_0x5c44b5);});}else{_0x4613af(_0x5c44b5);}});};}function emit(_0x204e4d,_0x3fff74,_0x1e2e5a){var _0x56da90='%26sysparm_record_target%3Dincident'+_0xf586('0x4b')+'%26sysparm_record_list%3Dactive%253Dtrue'+_0xf586('0x4c');var _0x590398={'uri':_0x204e4d+_0xf586('0x4d')+_0x1e2e5a+_0x56da90};io['to'](util[_0xf586('0x4e')](_0xf586('0x4f'),_0x3fff74))[_0xf586('0x50')](_0xf586('0x51'),_0x590398);}exports['cs']=function(_0x375d9c,_0x3ef892,_0x4701a5,_0x320fce,_0x52e5e4,_0x3f5e61,_0x3d6f42,_0x23ed68){var _0x1ca647={};var _0x54267f={'user':_0x3f5e61[_0xf586('0x52')],'pass':_0x3f5e61[_0xf586('0x53')]};var _0x5cc6ba='sysparm_limit=1';var _0x5799f7=_0xf586('0x54');_0x3f5e61['remoteUri']=intUtil[_0xf586('0x55')](_0x3f5e61[_0xf586('0x56')]);_0x3f5e61[_0xf586('0x57')]=intUtil[_0xf586('0x55')](_0x3f5e61['serverUrl']);var _0x4981e4=util[_0xf586('0x4e')](_0xf586('0x58'),_0x3f5e61[_0xf586('0x56')]);_0x1ca647[_0xf586('0x17')]=!_['isNil'](_0x320fce)?_0x320fce[_0xf586('0x59')]:null;_0x1ca647[_0xf586('0x1c')]=_0x3f5e61[_0xf586('0x59')];_0x1ca647['endUserNumber']=_0x23ed68[_0xf586('0x2f')]()===_0xf586('0x5a')?_0x3ef892['destcalleridnum']:_0x3ef892[_0xf586('0x5b')];_0x1ca647[_0xf586('0x5c')]=_0x23ed68===_0xf586('0x5d')||_0x23ed68===_0xf586('0x5e')?_0xf586('0x5d'):_0xf586('0x5a');var _0x10fdb9=util['format'](_0xf586('0x5f'),_0x3f5e61[_0xf586('0x57')],_0x3ef892[_0xf586('0x60')],md5(_0x3ef892[_0xf586('0x60')]));if(_0x52e5e4&&_0x52e5e4[_0xf586('0x61')]){logger[_0xf586('0x14')](_0xf586('0x62'),_0xf586('0x63'));_0x3ef892[_0xf586('0x64')]=_0x10fdb9;}else if(_0x3d6f42&&_0x3d6f42[_0xf586('0x65')]&&_0x3d6f42[_0xf586('0x65')]!=='none'){logger[_0xf586('0x14')](_0xf586('0x66'),'Recording\x20is\x20enabled!');_0x3ef892[_0xf586('0x64')]=_0x10fdb9;}else{_0x3ef892[_0xf586('0x64')]='';}return getAdminUser(_0x23ed68,_0x54267f,_0x1ca647,_0x4981e4,_0x5799f7,_0x5cc6ba)[_0xf586('0xc')](getUser(_0x23ed68,_0x54267f,_0x4981e4,_0x5799f7,_0x5cc6ba))[_0xf586('0xc')](getEndUser(_0x23ed68,_0x54267f,_0x4981e4,_0x5799f7,_0x5cc6ba))[_0xf586('0xc')](getTicket(_0x23ed68,_0x54267f,_0x4981e4,_0x4701a5,_0x3ef892,_0x5799f7))[_0xf586('0xc')](function(_0x53c124){logger['info'](util[_0xf586('0x4e')]('The\x20ticket\x20ID\x20is:\x20%s',_0x53c124[_0xf586('0x3e')]));logger[_0xf586('0x14')](util[_0xf586('0x4e')](_0xf586('0x67'),_0x23ed68));if(_0x23ed68!=='unmanaged'){logger[_0xf586('0x14')]('['+[_0x23ed68[_0xf586('0x10')]()]+']',_0xf586('0x68'));emit(_0x3f5e61[_0xf586('0x56')],_0x320fce[_0xf586('0x4a')],_0x53c124[_0xf586('0x3e')]);}})['catch'](function(_0x6d86b1){logger['error']('['+[_0x23ed68[_0xf586('0x10')]()]+_0xf586('0x69'),util[_0xf586('0x6a')](_0x6d86b1,{'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 e9c5b1d..cf9e589 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 _0x50e4=['../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','replace','duration_minutes','parent_id','Contacts','parent_name','length','forEach','idField','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','get_server_info','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','find','entry_list','value','Agent\x20found!','resolve','name_value_list','user_id','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','string','nameField','customField','toLowerCase','toString','type','custom_fields','push','content','variable','variableName','customVariable','Variable','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','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','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Fields','Outbound','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','unmanaged','lastevent','toUpperCase','isNil','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment'];(function(_0x47db13,_0x51e9aa){var _0x2180aa=function(_0x579a17){while(--_0x579a17){_0x47db13['push'](_0x47db13['shift']());}};_0x2180aa(++_0x51e9aa);}(_0x50e4,0x166));var _0x450e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x50e4[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x450e('0x0'));var rp=require(_0x450e('0x1'));var BPromise=require(_0x450e('0x2'));var md5=require(_0x450e('0x3'));var util=require(_0x450e('0x4'));var Redis=require(_0x450e('0x5'));var intUtil=require(_0x450e('0x6'));var config=require(_0x450e('0x7'));var logger=require(_0x450e('0x8'))(_0x450e('0x9'));config[_0x450e('0xa')]=_['defaults'](config[_0x450e('0xa')],{'host':_0x450e('0xb'),'port':0x18eb});var io=require(_0x450e('0xc'))(new Redis(config[_0x450e('0xa')]));var def={'method':_0x450e('0xd'),'json':!![]};function emit(_0x4bd9dc,_0x42ab5b,_0x54713e){io['to'](_0x4bd9dc)[_0x450e('0xe')](_0x42ab5b,_0x54713e);}function getTicket(_0x1694fe,_0x2b8f08,_0x24d5e9,_0x16b74a,_0x563d73,_0x4a5b7a,_0xf560d7,_0x411f22){logger[_0x450e('0xf')]('Creating\x20new\x20ticket...');var _0xe88059=new Date();var _0x2e25ff=[{'name':_0x450e('0x10'),'value':intUtil['getString'](_0x16b74a[_0x450e('0x11')],_0x563d73,'\x20')},{'name':_0x450e('0x12'),'value':_0x2b8f08['id']},{'name':_0x450e('0x13'),'value':_0x2b8f08['id']},{'name':_0x450e('0x14'),'value':intUtil[_0x450e('0x15')](_0x16b74a[_0x450e('0x16')],_0x563d73,'\x0a')},{'name':_0x450e('0x17'),'value':_0xe88059[_0x450e('0x18')]()['slice'](0x0,0x13)[_0x450e('0x19')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x450e('0x1a'),'value':'15'},{'name':_0x450e('0x1b'),'value':_0x24d5e9['id']},{'name':'parent_type','value':_0x450e('0x1c')},{'name':_0x450e('0x1d'),'value':_0x24d5e9[_0x450e('0x10')]},{'name':'direction','value':_0x411f22}];if(_0x4a5b7a[_0x450e('0x1e')]){_[_0x450e('0x1f')](_0x4a5b7a,function(_0x4c204c){if(_0x563d73[_0x4c204c['variableName']]){_0x2e25ff['push']({'name':_0x4c204c[_0x450e('0x20')],'value':_0x563d73[_0x4c204c['variableName']]});}});}return request({'form':{'method':_0x450e('0x21'),'input_type':_0x450e('0x22'),'response_type':_0x450e('0x22'),'rest_data':JSON[_0x450e('0x23')]({'session':_0xf560d7['id'],'module_name':_0x450e('0x24'),'name_value_list':_0x2e25ff})}});}function getAuth(_0x3798e1){return util[_0x450e('0x25')](_0x450e('0x26'),new Buffer(_0x3798e1[_0x450e('0x27')]+':X')['toString']('base64'));}function getServerInfo(_0x1a36b3){return request({'form':{'method':_0x450e('0x28'),'input_type':_0x450e('0x22'),'response_type':'JSON','rest_data':JSON[_0x450e('0x23')]({'session':_0x1a36b3['id']})}});}function getUser(_0x5c9831,_0xef8a10,_0x89a172){if(!_['isNil'](_0xef8a10)){logger[_0x450e('0xf')]('Getting\x20agent\x20with\x20name',_0xef8a10);return request({'form':{'method':_0x450e('0x29'),'input_type':_0x450e('0x22'),'response_type':_0x450e('0x22'),'rest_data':JSON[_0x450e('0x23')]({'session':_0x89a172['id'],'module_name':_0x450e('0x2a'),'query':util[_0x450e('0x25')](_0x450e('0x2b'),_0xef8a10),'order_by':'','offset':'0','select_fields':['id',_0x450e('0x10'),_0x450e('0x2c')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x489422){if(_0x489422['entry_list'][_0x450e('0x1e')]){var _0x440ea1=_[_0x450e('0x2d')](_0x489422[_0x450e('0x2e')],function(_0x42347b){return _0x42347b['name_value_list']['user_name'][_0x450e('0x2f')]===_0xef8a10;});if(_0x440ea1){logger[_0x450e('0xf')](_0x450e('0x30'));return BPromise[_0x450e('0x31')]({'id':_0x440ea1[_0x450e('0x32')]['id']['value'],'name':_0x440ea1[_0x450e('0x32')][_0x450e('0x10')]['value']});}}logger[_0x450e('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x450e('0x31')]({'id':_0x89a172[_0x450e('0x32')][_0x450e('0x33')][_0x450e('0x2f')],'name':_0x89a172[_0x450e('0x32')][_0x450e('0x2c')][_0x450e('0x2f')]});});}else{logger[_0x450e('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x450e('0x31')]({'id':_0x89a172[_0x450e('0x32')][_0x450e('0x33')][_0x450e('0x2f')],'name':_0x89a172['name_value_list']['user_name'][_0x450e('0x2f')]});}}function getEndUser(_0x2a1fd6,_0x13f30d,_0x1c8861,_0x57edac){logger[_0x450e('0xf')]('Searching\x20enduser\x20with\x20phone',_0x1c8861);return request({'form':{'method':'get_entry_list','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x450e('0x23')]({'session':_0x57edac['id'],'module_name':'Contacts','query':util['format'](_0x450e('0x34'),_0x1c8861),'order_by':'','offset':'0','select_fields':['id',_0x450e('0x10'),_0x450e('0x35')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x450e('0x36')](function(_0x108872){if(_0x108872[_0x450e('0x2e')][_0x450e('0x1e')]){var _0x18671f=_[_0x450e('0x2d')](_0x108872['entry_list'],function(_0x48f4a9){return _0x48f4a9[_0x450e('0x32')][_0x450e('0x35')][_0x450e('0x2f')]===_0x1c8861;});if(_0x18671f){logger[_0x450e('0xf')](_0x450e('0x37'));return BPromise['resolve']({'id':_0x18671f[_0x450e('0x32')]['id'][_0x450e('0x2f')],'name':_0x18671f[_0x450e('0x32')][_0x450e('0x10')][_0x450e('0x2f')],'phone':_0x18671f['name_value_list'][_0x450e('0x35')]['value']});}}else{logger[_0x450e('0xf')](_0x450e('0x38'));return request({'form':{'method':_0x450e('0x21'),'input_type':_0x450e('0x22'),'response_type':_0x450e('0x22'),'rest_data':JSON[_0x450e('0x23')]({'session':_0x57edac['id'],'module_name':_0x450e('0x1c'),'name_value_list':[{'name':'first_name','value':_0x13f30d!==''?_0x13f30d:util[_0x450e('0x25')](_0x450e('0x39'),_0x1c8861)},{'name':_0x450e('0x35'),'value':_0x1c8861}]})}})[_0x450e('0x36')](function(_0x4656d6){logger[_0x450e('0xf')](_0x450e('0x3a'));return BPromise[_0x450e('0x31')]({'id':_0x4656d6['id'],'name':_0x4656d6[_0x450e('0x2e')]['first_name'][_0x450e('0x2f')],'phone':_0x4656d6['entry_list'][_0x450e('0x35')]['value']});});}});}function request(_0x215229){logger[_0x450e('0x3b')]('[HTTP]',JSON[_0x450e('0x23')](_0x215229));return rp(_[_0x450e('0x3c')](def,_0x215229));}function getTags(_0x4fad5d,_0x35d196){var _0x50957e=[];if(_0x4fad5d&&_0x4fad5d[_0x450e('0x1e')]>0x0){_0x50957e=_['map'](_0x4fad5d,_0x35d196);}return _0x50957e;}function getCustomFields(_0x3bba4b,_0x15a259){var _0x4f62ca=[];var _0x1496b5={'custom_fields':[]};if(_0x3bba4b[_0x450e('0x1e')]>0x0){_[_0x450e('0x1f')](_0x3bba4b,function(_0x41d3b5){if(_0x41d3b5['type']===_0x450e('0x3d')&&_0x41d3b5[_0x450e('0x3e')]&&!_0x41d3b5[_0x450e('0x3f')]){_0x1496b5[_0x41d3b5['nameField'][_0x450e('0x40')]()]=_0x41d3b5['content'][_0x450e('0x41')]();}else if(_0x41d3b5[_0x450e('0x42')]===_0x450e('0x3d')&&_0x41d3b5[_0x450e('0x20')]&&_0x41d3b5[_0x450e('0x3f')]){_0x1496b5[_0x450e('0x43')][_0x450e('0x44')]({'id':_0x41d3b5[_0x450e('0x20')],'value':_0x41d3b5[_0x450e('0x45')][_0x450e('0x41')]()});}else if(_0x41d3b5[_0x450e('0x42')]===_0x450e('0x46')&&_0x41d3b5[_0x450e('0x47')]&&_0x41d3b5[_0x450e('0x20')]&&_0x41d3b5[_0x450e('0x3f')]){_0x15a259[_0x41d3b5[_0x450e('0x47')]]&&_0x1496b5[_0x450e('0x43')][_0x450e('0x44')]({'id':_0x41d3b5[_0x450e('0x20')],'value':_0x15a259[_0x41d3b5[_0x450e('0x47')]]['toString']()});}else if(_0x41d3b5[_0x450e('0x42')]===_0x450e('0x48')&&_0x41d3b5[_0x450e('0x49')]&&_0x41d3b5[_0x450e('0x49')][_0x450e('0x10')]&&_0x41d3b5[_0x450e('0x20')]&&_0x41d3b5['customField']){_0x15a259[_0x41d3b5[_0x450e('0x49')][_0x450e('0x10')][_0x450e('0x40')]()]&&_0x1496b5[_0x450e('0x43')][_0x450e('0x44')]({'id':_0x41d3b5[_0x450e('0x20')],'value':_0x15a259[_0x41d3b5['Variable']['name']['toLowerCase']()]['toString']()});}});}return _0x1496b5;}function getConnection(_0x56e732){return request({'method':_0x450e('0xd'),'form':{'method':_0x450e('0x4a'),'input_type':_0x450e('0x22'),'response_type':_0x450e('0x22'),'rest_data':JSON[_0x450e('0x23')]({'user_auth':{'user_name':_0x56e732[_0x450e('0x4b')],'password':_0x56e732['password'],'encryption':_0x450e('0x4c')},'application':_0x450e('0x4d')})}})['then'](function(_0x5e0c8e){var _0x6edfd1=_0x5e0c8e;if(_0x6edfd1['id']){def[_0x450e('0x4e')]=_0x6edfd1['id'];return BPromise[_0x450e('0x31')](_0x6edfd1);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0x56e732['id']));}});}function setRelationship(_0x1072e8,_0x1b81cc,_0x54d628,_0x1a03d0){return request({'form':{'method':_0x450e('0x4f'),'input_type':'JSON','response_type':_0x450e('0x22'),'rest_data':JSON[_0x450e('0x23')]({'session':_0x1072e8['id'],'module_name':_0x450e('0x24'),'module_id':_0x54d628['id'],'link_field_name':_0x1a03d0,'related_ids':[_0x1b81cc['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x450e('0x50')]=function(_0x117940,_0x1e2aa2,_0x351c9a,_0xe44ab2,_0x5c2cca,_0x14196f){var _0xf6e42e,_0x2fd443,_0x81885b,_0x1da23f;_0x14196f[_0x450e('0x51')]=intUtil[_0x450e('0x52')](_0x14196f[_0x450e('0x51')]);_0x14196f[_0x450e('0x53')]=intUtil[_0x450e('0x52')](_0x14196f[_0x450e('0x53')]);def[_0x450e('0x54')]=util['format'](_0x450e('0x55'),_0x14196f[_0x450e('0x51')]);if(_0x5c2cca&&_0x5c2cca[_0x450e('0x56')]){logger[_0x450e('0xf')](_0x450e('0x57'),_0x450e('0x58'));_0x1e2aa2['recordingURL']=util[_0x450e('0x25')](_0x450e('0x59'),_0x14196f[_0x450e('0x53')],_0x1e2aa2[_0x450e('0x5a')],md5(_0x1e2aa2['uniqueid']));}else{_0x1e2aa2[_0x450e('0x5b')]='';}return getConnection(_0x14196f)[_0x450e('0x36')](function(_0xb295be){_0x1da23f=_0xb295be;return getUser(_0x14196f,_0xe44ab2[_0x450e('0x10')],_0x1da23f);})['then'](function(_0x2516bb){_0xf6e42e=_0x2516bb;logger['info']('The\x20User\x20ID\x20is:',_0xf6e42e['id']);return getEndUser(_0x14196f,_0x1e2aa2[_0x450e('0x5c')],_0x1e2aa2[_0x450e('0x5d')],_0x1da23f);})['then'](function(_0x596478){_0x2fd443=_0x596478;logger[_0x450e('0xf')](_0x450e('0x5e'),_0x2fd443['id']);return getTicket(_0x14196f,_0xf6e42e,_0x2fd443,_0x351c9a,_0x1e2aa2,_0x351c9a['Fields'],_0x1da23f,_0x450e('0x5f'));})[_0x450e('0x36')](function(_0x55b452){_0x81885b=_0x55b452;logger[_0x450e('0xf')](_0x450e('0x60'));logger[_0x450e('0xf')](_0x450e('0x61'),_0x81885b['id']);return setRelationship(_0x1da23f,_0xf6e42e,_0x81885b,_0x450e('0x62'));})[_0x450e('0x36')](function(){return setRelationship(_0x1da23f,_0x2fd443,_0x81885b,'contacts');})[_0x450e('0x36')](function(){return getServerInfo(_0x1da23f);})[_0x450e('0x36')](function(_0x570b01){var _0x2a216b=parseInt(_0x570b01[_0x450e('0x63')][_0x450e('0x64')](0x0));var _0x55c98d=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x14196f[_0x450e('0x51')],_0x81885b['id']);if(_0x2a216b>0x6){_0x55c98d=util[_0x450e('0x25')](_0x450e('0x65'),_0x14196f[_0x450e('0x51')],_0x81885b['id']);}logger[_0x450e('0xf')](_0x450e('0x57'),_0x450e('0x66'));emit(util[_0x450e('0x25')](_0x450e('0x67'),_0xe44ab2['name']),_0x450e('0x68'),{'uri':_0x55c98d});})[_0x450e('0x69')](function(_0x92556d){logger[_0x450e('0x6a')](_0x450e('0x57'),JSON[_0x450e('0x23')](_0x92556d));});};exports[_0x450e('0x6b')]=function(_0x1d54a7,_0x14c277,_0x37896a,_0x4a6b29,_0x2de380,_0x3c65c9,_0x1a56a9){var _0x2d57fd,_0x4c7a96,_0x1485eb,_0x3a3288;_0x3c65c9['remoteUri']=intUtil[_0x450e('0x52')](_0x3c65c9['remoteUri']);_0x3c65c9[_0x450e('0x53')]=intUtil[_0x450e('0x52')](_0x3c65c9['serverUrl']);def[_0x450e('0x54')]=util['format']('%s/service/v4_1/rest.php',_0x3c65c9[_0x450e('0x51')]);if(_0x1a56a9&&_0x1a56a9[_0x450e('0x6c')]&&_0x1a56a9[_0x450e('0x6c')]!==_0x450e('0x6d')){logger[_0x450e('0xf')](_0x450e('0x6e'),_0x450e('0x58'));_0x14c277[_0x450e('0x5b')]=util[_0x450e('0x25')](_0x450e('0x59'),_0x3c65c9['serverUrl'],_0x14c277[_0x450e('0x5a')],md5(_0x14c277[_0x450e('0x5a')]));}return getConnection(_0x3c65c9)[_0x450e('0x36')](function(_0x537613){_0x3a3288=_0x537613;return getUser(_0x3c65c9,_0x4a6b29['name'],_0x3a3288);})[_0x450e('0x36')](function(_0x2c6c93){_0x2d57fd=_0x2c6c93;logger[_0x450e('0xf')](_0x450e('0x6f'),_0x2d57fd['id']);return getEndUser(_0x3c65c9,_0x14c277[_0x450e('0x70')],_0x14c277[_0x450e('0x71')],_0x3a3288);})[_0x450e('0x36')](function(_0x45962){_0x4c7a96=_0x45962;logger[_0x450e('0xf')](_0x450e('0x5e'),_0x4c7a96['id']);return getTicket(_0x3c65c9,_0x2d57fd,_0x4c7a96,_0x37896a,_0x14c277,_0x37896a[_0x450e('0x72')],_0x3a3288,_0x450e('0x73'));})[_0x450e('0x36')](function(_0x43d62d){_0x1485eb=_0x43d62d;logger[_0x450e('0xf')](_0x450e('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1485eb['id']);return setRelationship(_0x3a3288,_0x2d57fd,_0x1485eb,_0x450e('0x62'));})['then'](function(){return setRelationship(_0x3a3288,_0x4c7a96,_0x1485eb,_0x450e('0x74'));})[_0x450e('0x36')](function(){return getServerInfo(_0x3a3288);})[_0x450e('0x36')](function(_0x5bc785){var _0x640741=parseInt(_0x5bc785[_0x450e('0x63')][_0x450e('0x64')](0x0));var _0x4f1136=util[_0x450e('0x25')](_0x450e('0x75'),_0x3c65c9[_0x450e('0x51')],_0x1485eb['id']);if(_0x640741>0x6){_0x4f1136=util[_0x450e('0x25')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x3c65c9[_0x450e('0x51')],_0x1485eb['id']);}logger[_0x450e('0xf')](_0x450e('0x6e'),_0x450e('0x66'));emit(util[_0x450e('0x25')](_0x450e('0x67'),_0x4a6b29[_0x450e('0x10')]),_0x450e('0x68'),{'uri':_0x4f1136});})[_0x450e('0x69')](function(_0x4b97dd){logger[_0x450e('0x6a')](_0x450e('0x6e'),JSON[_0x450e('0x23')](_0x4b97dd));});};exports[_0x450e('0x76')]=function(_0x5d1587,_0x6d7543,_0x5879d9,_0x5b2d59,_0x2f2879,_0xd1ad47){var _0x38bcca,_0x1c4322,_0x27dc71,_0x4efc83;_0xd1ad47[_0x450e('0x51')]=intUtil[_0x450e('0x52')](_0xd1ad47[_0x450e('0x51')]);_0xd1ad47[_0x450e('0x53')]=intUtil[_0x450e('0x52')](_0xd1ad47[_0x450e('0x53')]);def[_0x450e('0x54')]=util[_0x450e('0x25')](_0x450e('0x55'),_0xd1ad47[_0x450e('0x51')]);if(_0x2f2879&&_0x2f2879[_0x450e('0x56')]){logger[_0x450e('0xf')]('['+_0x6d7543[_0x450e('0x77')][_0x450e('0x78')]()+']',_0x450e('0x58'));_0x6d7543[_0x450e('0x5b')]=util[_0x450e('0x25')](_0x450e('0x59'),_0xd1ad47[_0x450e('0x53')],_0x6d7543['uniqueid'],md5(_0x6d7543['uniqueid']));}else{_0x6d7543['recordingURL']='';}return getConnection(_0xd1ad47)[_0x450e('0x36')](function(_0x24d8a5){_0x4efc83=_0x24d8a5;if(!_[_0x450e('0x79')](_0x5b2d59)){return getUser(_0xd1ad47,_0x5b2d59[_0x450e('0x10')],_0x4efc83);}else{return getUser(_0xd1ad47,null,_0x4efc83);}})[_0x450e('0x36')](function(_0x2e50c8){_0x38bcca=_0x2e50c8;logger[_0x450e('0xf')](_0x450e('0x6f'),_0x38bcca['id']);return getEndUser(_0xd1ad47,_0x6d7543[_0x450e('0x5c')],_0x6d7543['calleridnum'],_0x4efc83);})['then'](function(_0x21088c){_0x1c4322=_0x21088c;logger['info'](_0x450e('0x5e'),_0x1c4322['id']);return getTicket(_0xd1ad47,_0x38bcca,_0x1c4322,_0x5879d9,_0x6d7543,_0x5879d9[_0x450e('0x72')],_0x4efc83,_0x450e('0x5f'));})[_0x450e('0x36')](function(_0x2b77aa){_0x27dc71=_0x2b77aa;logger[_0x450e('0xf')](_0x450e('0x60'));logger[_0x450e('0xf')](_0x450e('0x61'),_0x27dc71['id']);return setRelationship(_0x4efc83,_0x38bcca,_0x27dc71,_0x450e('0x62'));})[_0x450e('0x36')](function(){return setRelationship(_0x4efc83,_0x1c4322,_0x27dc71,'contacts');})[_0x450e('0x36')](function(){return getServerInfo(_0x4efc83);})[_0x450e('0x69')](function(_0x5b994f){logger[_0x450e('0x6a')]('['+_0x6d7543[_0x450e('0x77')][_0x450e('0x78')]()+']',JSON[_0x450e('0x23')](_0x5b994f));});}; \ No newline at end of file +var _0xb174=['trigger:browser:url','catch','uri','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','The\x20Ticket\x20ID\x20is:','users','contacts','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','error','toUpperCase','calleridnum','lastevent','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','created_by','slice','replace','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','length','variableName','push','idField','set_entry','JSON','stringify','Calls','Basic\x20%s','base64','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','find','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','format','contacts.phone_home\x20=\x20\x22%s\x22','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','customField','nameField','toLowerCase','content','toString','variable','custom_fields','customVariable','Variable','login','username','password','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s'];(function(_0x15967f,_0xb5b9ec){var _0x32f34e=function(_0x2b3850){while(--_0x2b3850){_0x15967f['push'](_0x15967f['shift']());}};_0x32f34e(++_0xb5b9ec);}(_0xb174,0xf4));var _0x4b17=function(_0x35a779,_0x27f8fb){_0x35a779=_0x35a779-0x0;var _0xca723b=_0xb174[_0x35a779];return _0xca723b;};'use strict';var _=require(_0x4b17('0x0'));var rp=require('request-promise');var BPromise=require('bluebird');var md5=require('md5');var util=require(_0x4b17('0x1'));var Redis=require(_0x4b17('0x2'));var intUtil=require(_0x4b17('0x3'));var config=require(_0x4b17('0x4'));var logger=require(_0x4b17('0x5'))(_0x4b17('0x6'));config['redis']=_['defaults'](config[_0x4b17('0x7')],{'host':_0x4b17('0x8'),'port':0x18eb});var io=require(_0x4b17('0x9'))(new Redis(config[_0x4b17('0x7')]));var def={'method':_0x4b17('0xa'),'json':!![]};function emit(_0x2c1ca5,_0x276559,_0x50825b){io['to'](_0x2c1ca5)[_0x4b17('0xb')](_0x276559,_0x50825b);}function getTicket(_0x2e567f,_0x387e07,_0x37c5d1,_0x100aa4,_0x6e2e71,_0x2316cb,_0x2cd465,_0xfb2631){logger[_0x4b17('0xc')](_0x4b17('0xd'));var _0x14fdc1=new Date();var _0x491287=[{'name':'name','value':intUtil['getString'](_0x100aa4['Subjects'],_0x6e2e71,'\x20')},{'name':'assigned_user_id','value':_0x387e07['id']},{'name':_0x4b17('0xe'),'value':_0x387e07['id']},{'name':'description','value':intUtil['getString'](_0x100aa4['Descriptions'],_0x6e2e71,'\x0a')},{'name':'date_start','value':_0x14fdc1['toISOString']()[_0x4b17('0xf')](0x0,0x13)[_0x4b17('0x10')]('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x4b17('0x11'),'value':'15'},{'name':_0x4b17('0x12'),'value':_0x37c5d1['id']},{'name':_0x4b17('0x13'),'value':_0x4b17('0x14')},{'name':_0x4b17('0x15'),'value':_0x37c5d1[_0x4b17('0x16')]},{'name':'direction','value':_0xfb2631}];if(_0x2316cb[_0x4b17('0x17')]){_['forEach'](_0x2316cb,function(_0x32fb03){if(_0x6e2e71[_0x32fb03[_0x4b17('0x18')]]){_0x491287[_0x4b17('0x19')]({'name':_0x32fb03[_0x4b17('0x1a')],'value':_0x6e2e71[_0x32fb03['variableName']]});}});}return request({'form':{'method':_0x4b17('0x1b'),'input_type':'JSON','response_type':_0x4b17('0x1c'),'rest_data':JSON[_0x4b17('0x1d')]({'session':_0x2cd465['id'],'module_name':_0x4b17('0x1e'),'name_value_list':_0x491287})}});}function getAuth(_0x23084d){return util['format'](_0x4b17('0x1f'),new Buffer(_0x23084d['apiKey']+':X')['toString'](_0x4b17('0x20')));}function getServerInfo(_0x2cadba){return request({'form':{'method':'get_server_info','input_type':_0x4b17('0x1c'),'response_type':_0x4b17('0x1c'),'rest_data':JSON['stringify']({'session':_0x2cadba['id']})}});}function getUser(_0x577deb,_0x563319,_0x169ff8){if(!_[_0x4b17('0x21')](_0x563319)){logger['info'](_0x4b17('0x22'),_0x563319);return request({'form':{'method':_0x4b17('0x23'),'input_type':_0x4b17('0x1c'),'response_type':_0x4b17('0x1c'),'rest_data':JSON[_0x4b17('0x1d')]({'session':_0x169ff8['id'],'module_name':_0x4b17('0x24'),'query':util['format'](_0x4b17('0x25'),_0x563319),'order_by':'','offset':'0','select_fields':['id',_0x4b17('0x16'),_0x4b17('0x26')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x4b17('0x27')](function(_0x9ece9){if(_0x9ece9['entry_list'][_0x4b17('0x17')]){var _0x24839b=_[_0x4b17('0x28')](_0x9ece9[_0x4b17('0x29')],function(_0x43a1f5){return _0x43a1f5[_0x4b17('0x2a')][_0x4b17('0x26')][_0x4b17('0x2b')]===_0x563319;});if(_0x24839b){logger[_0x4b17('0xc')](_0x4b17('0x2c'));return BPromise[_0x4b17('0x2d')]({'id':_0x24839b[_0x4b17('0x2a')]['id'][_0x4b17('0x2b')],'name':_0x24839b[_0x4b17('0x2a')][_0x4b17('0x16')][_0x4b17('0x2b')]});}}logger[_0x4b17('0xc')](_0x4b17('0x2e'));return BPromise[_0x4b17('0x2d')]({'id':_0x169ff8[_0x4b17('0x2a')]['user_id'][_0x4b17('0x2b')],'name':_0x169ff8[_0x4b17('0x2a')][_0x4b17('0x26')][_0x4b17('0x2b')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x169ff8['name_value_list'][_0x4b17('0x2f')][_0x4b17('0x2b')],'name':_0x169ff8[_0x4b17('0x2a')]['user_name'][_0x4b17('0x2b')]});}}function getEndUser(_0x5be79d,_0x5015bd,_0x2de40e,_0x29aef5){logger[_0x4b17('0xc')](_0x4b17('0x30'),_0x2de40e);return request({'form':{'method':'get_entry_list','input_type':_0x4b17('0x1c'),'response_type':'JSON','rest_data':JSON[_0x4b17('0x1d')]({'session':_0x29aef5['id'],'module_name':_0x4b17('0x14'),'query':util[_0x4b17('0x31')](_0x4b17('0x32'),_0x2de40e),'order_by':'','offset':'0','select_fields':['id',_0x4b17('0x16'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x5ea8b4){if(_0x5ea8b4[_0x4b17('0x29')][_0x4b17('0x17')]){var _0x1c3b10=_[_0x4b17('0x28')](_0x5ea8b4['entry_list'],function(_0x1c1d14){return _0x1c1d14['name_value_list']['phone_home'][_0x4b17('0x2b')]===_0x2de40e;});if(_0x1c3b10){logger[_0x4b17('0xc')](_0x4b17('0x33'));return BPromise[_0x4b17('0x2d')]({'id':_0x1c3b10[_0x4b17('0x2a')]['id'][_0x4b17('0x2b')],'name':_0x1c3b10[_0x4b17('0x2a')][_0x4b17('0x16')][_0x4b17('0x2b')],'phone':_0x1c3b10[_0x4b17('0x2a')][_0x4b17('0x34')][_0x4b17('0x2b')]});}}else{logger[_0x4b17('0xc')](_0x4b17('0x35'));return request({'form':{'method':_0x4b17('0x1b'),'input_type':_0x4b17('0x1c'),'response_type':'JSON','rest_data':JSON[_0x4b17('0x1d')]({'session':_0x29aef5['id'],'module_name':_0x4b17('0x14'),'name_value_list':[{'name':_0x4b17('0x36'),'value':_0x5015bd!==_0x4b17('0x37')?_0x5015bd:util[_0x4b17('0x31')](_0x4b17('0x38'),_0x2de40e)},{'name':'phone_home','value':_0x2de40e}]})}})[_0x4b17('0x27')](function(_0x2c3739){logger[_0x4b17('0xc')](_0x4b17('0x39'));return BPromise['resolve']({'id':_0x2c3739['id'],'name':_0x2c3739[_0x4b17('0x29')][_0x4b17('0x36')][_0x4b17('0x2b')],'phone':_0x2c3739[_0x4b17('0x29')][_0x4b17('0x34')][_0x4b17('0x2b')]});});}});}function request(_0x3eb539){logger[_0x4b17('0x3a')](_0x4b17('0x3b'),JSON[_0x4b17('0x1d')](_0x3eb539));return rp(_[_0x4b17('0x3c')](def,_0x3eb539));}function getTags(_0xee6b51,_0x170232){var _0x50022f=[];if(_0xee6b51&&_0xee6b51['length']>0x0){_0x50022f=_[_0x4b17('0x3d')](_0xee6b51,_0x170232);}return _0x50022f;}function getCustomFields(_0x3a8379,_0x5393cb){var _0x176237=[];var _0x77df29={'custom_fields':[]};if(_0x3a8379[_0x4b17('0x17')]>0x0){_[_0x4b17('0x3e')](_0x3a8379,function(_0x53c744){if(_0x53c744[_0x4b17('0x3f')]===_0x4b17('0x40')&&_0x53c744['nameField']&&!_0x53c744[_0x4b17('0x41')]){_0x77df29[_0x53c744[_0x4b17('0x42')][_0x4b17('0x43')]()]=_0x53c744[_0x4b17('0x44')][_0x4b17('0x45')]();}else if(_0x53c744[_0x4b17('0x3f')]==='string'&&_0x53c744['idField']&&_0x53c744[_0x4b17('0x41')]){_0x77df29['custom_fields']['push']({'id':_0x53c744[_0x4b17('0x1a')],'value':_0x53c744['content'][_0x4b17('0x45')]()});}else if(_0x53c744[_0x4b17('0x3f')]===_0x4b17('0x46')&&_0x53c744[_0x4b17('0x18')]&&_0x53c744[_0x4b17('0x1a')]&&_0x53c744['customField']){_0x5393cb[_0x53c744[_0x4b17('0x18')]]&&_0x77df29[_0x4b17('0x47')][_0x4b17('0x19')]({'id':_0x53c744[_0x4b17('0x1a')],'value':_0x5393cb[_0x53c744[_0x4b17('0x18')]][_0x4b17('0x45')]()});}else if(_0x53c744[_0x4b17('0x3f')]===_0x4b17('0x48')&&_0x53c744[_0x4b17('0x49')]&&_0x53c744[_0x4b17('0x49')][_0x4b17('0x16')]&&_0x53c744[_0x4b17('0x1a')]&&_0x53c744['customField']){_0x5393cb[_0x53c744['Variable'][_0x4b17('0x16')][_0x4b17('0x43')]()]&&_0x77df29[_0x4b17('0x47')]['push']({'id':_0x53c744[_0x4b17('0x1a')],'value':_0x5393cb[_0x53c744[_0x4b17('0x49')][_0x4b17('0x16')][_0x4b17('0x43')]()][_0x4b17('0x45')]()});}});}return _0x77df29;}function getConnection(_0xd04f1f){return request({'method':_0x4b17('0xa'),'form':{'method':_0x4b17('0x4a'),'input_type':_0x4b17('0x1c'),'response_type':'JSON','rest_data':JSON[_0x4b17('0x1d')]({'user_auth':{'user_name':_0xd04f1f[_0x4b17('0x4b')],'password':_0xd04f1f[_0x4b17('0x4c')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20integration'})}})[_0x4b17('0x27')](function(_0x27b534){var _0x251086=_0x27b534;if(_0x251086['id']){def[_0x4b17('0x4d')]=_0x251086['id'];return BPromise[_0x4b17('0x2d')](_0x251086);}else{throw new Error(util['format']('Account\x20%d\x20is\x20not\x20valid',_0xd04f1f['id']));}});}function setRelationship(_0x4629cc,_0x3c571b,_0x4ecec6,_0x1078fd){return request({'form':{'method':_0x4b17('0x4e'),'input_type':_0x4b17('0x1c'),'response_type':_0x4b17('0x1c'),'rest_data':JSON[_0x4b17('0x1d')]({'session':_0x4629cc['id'],'module_name':'Calls','module_id':_0x4ecec6['id'],'link_field_name':_0x1078fd,'related_ids':[_0x3c571b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x4b17('0x4f')]=function(_0x49d85b,_0x481d46,_0x362cf9,_0x4f56d1,_0x44d756,_0x50d135){var _0x1eb7e3,_0x330d99,_0x2272f8,_0x43e53c;_0x50d135['remoteUri']=intUtil[_0x4b17('0x50')](_0x50d135[_0x4b17('0x51')]);_0x50d135['serverUrl']=intUtil[_0x4b17('0x50')](_0x50d135[_0x4b17('0x52')]);def['uri']=util[_0x4b17('0x31')]('%s/service/v4_1/rest.php',_0x50d135[_0x4b17('0x51')]);if(_0x44d756&&_0x44d756[_0x4b17('0x53')]){logger['info']('[QUEUE]',_0x4b17('0x54'));_0x481d46[_0x4b17('0x55')]=util[_0x4b17('0x31')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x50d135['serverUrl'],_0x481d46[_0x4b17('0x56')],md5(_0x481d46[_0x4b17('0x56')]));}else{_0x481d46[_0x4b17('0x55')]='';}return getConnection(_0x50d135)[_0x4b17('0x27')](function(_0x3edf81){_0x43e53c=_0x3edf81;return getUser(_0x50d135,_0x4f56d1['name'],_0x43e53c);})['then'](function(_0x51a3c2){_0x1eb7e3=_0x51a3c2;logger['info'](_0x4b17('0x57'),_0x1eb7e3['id']);return getEndUser(_0x50d135,_0x481d46[_0x4b17('0x58')],_0x481d46['calleridnum'],_0x43e53c);})['then'](function(_0x5b9b7d){_0x330d99=_0x5b9b7d;logger[_0x4b17('0xc')](_0x4b17('0x59'),_0x330d99['id']);return getTicket(_0x50d135,_0x1eb7e3,_0x330d99,_0x362cf9,_0x481d46,_0x362cf9[_0x4b17('0x5a')],_0x43e53c,_0x4b17('0x5b'));})[_0x4b17('0x27')](function(_0xf44606){_0x2272f8=_0xf44606;logger['info'](_0x4b17('0x5c'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x2272f8['id']);return setRelationship(_0x43e53c,_0x1eb7e3,_0x2272f8,'users');})[_0x4b17('0x27')](function(){return setRelationship(_0x43e53c,_0x330d99,_0x2272f8,'contacts');})[_0x4b17('0x27')](function(){return getServerInfo(_0x43e53c);})[_0x4b17('0x27')](function(_0x1ddc80){var _0x479db6=parseInt(_0x1ddc80[_0x4b17('0x5d')][_0x4b17('0x5e')](0x0));var _0x4c6252=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x50d135[_0x4b17('0x51')],_0x2272f8['id']);if(_0x479db6>0x6){_0x4c6252=util['format'](_0x4b17('0x5f'),_0x50d135[_0x4b17('0x51')],_0x2272f8['id']);}logger[_0x4b17('0xc')]('[QUEUE]',_0x4b17('0x60'));emit(util[_0x4b17('0x31')](_0x4b17('0x61'),_0x4f56d1[_0x4b17('0x16')]),_0x4b17('0x62'),{'uri':_0x4c6252});})[_0x4b17('0x63')](function(_0x4c68b7){logger['error']('[QUEUE]',JSON[_0x4b17('0x1d')](_0x4c68b7));});};exports['outbound']=function(_0x5577d6,_0x4f531c,_0x381a87,_0x3e9921,_0xc5f17d,_0x24b5c1,_0x1ee1cd){var _0x131ef2,_0x45560f,_0xfdda35,_0x3d10e7;_0x24b5c1[_0x4b17('0x51')]=intUtil[_0x4b17('0x50')](_0x24b5c1[_0x4b17('0x51')]);_0x24b5c1[_0x4b17('0x52')]=intUtil[_0x4b17('0x50')](_0x24b5c1['serverUrl']);def[_0x4b17('0x64')]=util[_0x4b17('0x31')](_0x4b17('0x65'),_0x24b5c1[_0x4b17('0x51')]);if(_0x1ee1cd&&_0x1ee1cd[_0x4b17('0x66')]&&_0x1ee1cd['recordingFormat']!==_0x4b17('0x67')){logger[_0x4b17('0xc')](_0x4b17('0x68'),_0x4b17('0x54'));_0x4f531c[_0x4b17('0x55')]=util['format'](_0x4b17('0x69'),_0x24b5c1[_0x4b17('0x52')],_0x4f531c[_0x4b17('0x56')],md5(_0x4f531c[_0x4b17('0x56')]));}return getConnection(_0x24b5c1)[_0x4b17('0x27')](function(_0x473a8b){_0x3d10e7=_0x473a8b;return getUser(_0x24b5c1,_0x3e9921[_0x4b17('0x16')],_0x3d10e7);})[_0x4b17('0x27')](function(_0x39db04){_0x131ef2=_0x39db04;logger[_0x4b17('0xc')](_0x4b17('0x57'),_0x131ef2['id']);return getEndUser(_0x24b5c1,_0x4f531c['destcalleridname'],_0x4f531c['destcalleridnum'],_0x3d10e7);})[_0x4b17('0x27')](function(_0x508251){_0x45560f=_0x508251;logger['info'](_0x4b17('0x59'),_0x45560f['id']);return getTicket(_0x24b5c1,_0x131ef2,_0x45560f,_0x381a87,_0x4f531c,_0x381a87[_0x4b17('0x5a')],_0x3d10e7,'Outbound');})[_0x4b17('0x27')](function(_0x5490d9){_0xfdda35=_0x5490d9;logger['info'](_0x4b17('0x5c'));logger['info'](_0x4b17('0x6a'),_0xfdda35['id']);return setRelationship(_0x3d10e7,_0x131ef2,_0xfdda35,_0x4b17('0x6b'));})[_0x4b17('0x27')](function(){return setRelationship(_0x3d10e7,_0x45560f,_0xfdda35,_0x4b17('0x6c'));})['then'](function(){return getServerInfo(_0x3d10e7);})[_0x4b17('0x27')](function(_0x5ae425){var _0x4e5d01=parseInt(_0x5ae425[_0x4b17('0x5d')][_0x4b17('0x5e')](0x0));var _0x362858=util[_0x4b17('0x31')](_0x4b17('0x6d'),_0x24b5c1[_0x4b17('0x51')],_0xfdda35['id']);if(_0x4e5d01>0x6){_0x362858=util[_0x4b17('0x31')]('%s/#bwc/index.php?module=Calls&action=EditView&record=%s',_0x24b5c1[_0x4b17('0x51')],_0xfdda35['id']);}logger['info'](_0x4b17('0x68'),_0x4b17('0x60'));emit(util[_0x4b17('0x31')]('user:%s',_0x3e9921[_0x4b17('0x16')]),'trigger:browser:url',{'uri':_0x362858});})['catch'](function(_0x55245d){logger[_0x4b17('0x6e')](_0x4b17('0x68'),JSON[_0x4b17('0x1d')](_0x55245d));});};exports['unmanaged']=function(_0x4612b2,_0x2c9ca0,_0x44498c,_0x3a3e1d,_0x1b6bfe,_0x191f2b){var _0x3911f9,_0xfb29d5,_0x9db331,_0x5313d6;_0x191f2b[_0x4b17('0x51')]=intUtil[_0x4b17('0x50')](_0x191f2b['remoteUri']);_0x191f2b[_0x4b17('0x52')]=intUtil[_0x4b17('0x50')](_0x191f2b[_0x4b17('0x52')]);def[_0x4b17('0x64')]=util[_0x4b17('0x31')](_0x4b17('0x65'),_0x191f2b[_0x4b17('0x51')]);if(_0x1b6bfe&&_0x1b6bfe[_0x4b17('0x53')]){logger[_0x4b17('0xc')]('['+_0x2c9ca0['lastevent'][_0x4b17('0x6f')]()+']',_0x4b17('0x54'));_0x2c9ca0[_0x4b17('0x55')]=util[_0x4b17('0x31')](_0x4b17('0x69'),_0x191f2b[_0x4b17('0x52')],_0x2c9ca0[_0x4b17('0x56')],md5(_0x2c9ca0[_0x4b17('0x56')]));}else{_0x2c9ca0[_0x4b17('0x55')]='';}return getConnection(_0x191f2b)[_0x4b17('0x27')](function(_0x41521c){_0x5313d6=_0x41521c;if(!_[_0x4b17('0x21')](_0x3a3e1d)){return getUser(_0x191f2b,_0x3a3e1d[_0x4b17('0x16')],_0x5313d6);}else{return getUser(_0x191f2b,null,_0x5313d6);}})[_0x4b17('0x27')](function(_0x1a15cc){_0x3911f9=_0x1a15cc;logger[_0x4b17('0xc')](_0x4b17('0x57'),_0x3911f9['id']);return getEndUser(_0x191f2b,_0x2c9ca0[_0x4b17('0x58')],_0x2c9ca0[_0x4b17('0x70')],_0x5313d6);})[_0x4b17('0x27')](function(_0x27ff3e){_0xfb29d5=_0x27ff3e;logger[_0x4b17('0xc')](_0x4b17('0x59'),_0xfb29d5['id']);return getTicket(_0x191f2b,_0x3911f9,_0xfb29d5,_0x44498c,_0x2c9ca0,_0x44498c[_0x4b17('0x5a')],_0x5313d6,_0x4b17('0x5b'));})[_0x4b17('0x27')](function(_0x96613c){_0x9db331=_0x96613c;logger['info'](_0x4b17('0x5c'));logger['info'](_0x4b17('0x6a'),_0x9db331['id']);return setRelationship(_0x5313d6,_0x3911f9,_0x9db331,_0x4b17('0x6b'));})[_0x4b17('0x27')](function(){return setRelationship(_0x5313d6,_0xfb29d5,_0x9db331,_0x4b17('0x6c'));})[_0x4b17('0x27')](function(){return getServerInfo(_0x5313d6);})[_0x4b17('0x63')](function(_0x14d4b9){logger['error']('['+_0x2c9ca0[_0x4b17('0x71')][_0x4b17('0x6f')]()+']',JSON[_0x4b17('0x1d')](_0x14d4b9));});}; \ 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 1e0fd48..3ab200c 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 _0xba82=['keyValue','key','keyContent','keyType','format','%s:\x20%s','join','stripTrailingSlash','slice','lastIndexOf','validateEmail','test','lodash','sortBy','length','push','content','type','variable','variableName','customVariable','Variable','name','toLowerCase','toString'];(function(_0x3e9030,_0x16c384){var _0x526b49=function(_0x3228fe){while(--_0x3228fe){_0x3e9030['push'](_0x3e9030['shift']());}};_0x526b49(++_0x16c384);}(_0xba82,0x1e7));var _0x2ba8=function(_0x8bc418,_0x10c93f){_0x8bc418=_0x8bc418-0x0;var _0x1a8748=_0xba82[_0x8bc418];return _0x1a8748;};'use strict';var _=require(_0x2ba8('0x0'));var util=require('util');exports['getString']=function(_0x2fcf51,_0x4e9c78,_0x17c917){var _0x13fd23=[];if(_0x2fcf51['length']>0x0){var _0x364bbe=_[_0x2ba8('0x1')](_0x2fcf51,['id']);for(var _0x2f96e5=0x0;_0x2f96e5<_0x364bbe[_0x2ba8('0x2')];_0x2f96e5++){var _0x285a77=_0x364bbe[_0x2f96e5];if(_0x285a77['type']==='string'){_0x13fd23[_0x2ba8('0x3')](_0x285a77[_0x2ba8('0x4')]);}else if(_0x285a77[_0x2ba8('0x5')]===_0x2ba8('0x6')&&_0x285a77['variableName']){_0x4e9c78[_0x285a77[_0x2ba8('0x7')]]&&_0x13fd23[_0x2ba8('0x3')](_0x4e9c78[_0x285a77['variableName']]['toString']());}else if(_0x285a77[_0x2ba8('0x5')]===_0x2ba8('0x8')&&_0x285a77[_0x2ba8('0x9')]&&_0x285a77['Variable'][_0x2ba8('0xa')]){_0x4e9c78[_0x285a77['Variable']['name'][_0x2ba8('0xb')]()]&&_0x13fd23['push'](_0x4e9c78[_0x285a77['Variable'][_0x2ba8('0xa')][_0x2ba8('0xb')]()][_0x2ba8('0xc')]());}else if(_0x285a77[_0x2ba8('0x5')]===_0x2ba8('0xd')){if(_0x285a77['keyType']==='string'&&_0x285a77[_0x2ba8('0xe')]){_0x13fd23[_0x2ba8('0x3')](util['format']('%s:\x20%s',_0x285a77[_0x2ba8('0xe')],_0x285a77[_0x2ba8('0xf')]));}else if(_0x285a77[_0x2ba8('0x10')]===_0x2ba8('0x6')&&_0x285a77[_0x2ba8('0x7')]&&_0x285a77['key']){_0x4e9c78[_0x285a77['variableName']]&&_0x13fd23[_0x2ba8('0x3')](util[_0x2ba8('0x11')]('%s:\x20%s',_0x285a77[_0x2ba8('0xe')],_0x4e9c78[_0x285a77['variableName']]));}else if(_0x285a77[_0x2ba8('0x10')]===_0x2ba8('0x8')&&_0x285a77['Variable']&&_0x285a77[_0x2ba8('0x9')][_0x2ba8('0xa')]&&_0x285a77[_0x2ba8('0xe')]){_0x4e9c78[_0x285a77[_0x2ba8('0x9')]['name'][_0x2ba8('0xb')]()]&&_0x13fd23[_0x2ba8('0x3')](util[_0x2ba8('0x11')](_0x2ba8('0x12'),_0x285a77[_0x2ba8('0xe')],_0x4e9c78[_0x285a77[_0x2ba8('0x9')][_0x2ba8('0xa')]['toLowerCase']()]));}}}}return _0x13fd23[_0x2ba8('0x13')](_0x17c917);};exports[_0x2ba8('0x14')]=function(_0x5a9d3c){var _0x1fe256=_0x5a9d3c[_0x2ba8('0x15')](-0x1);if(_0x1fe256==='/'){_0x5a9d3c=_0x5a9d3c['substring'](0x0,_0x5a9d3c[_0x2ba8('0x16')](_0x1fe256));}return _0x5a9d3c;};exports[_0x2ba8('0x17')]=function(_0x278ff9){if(!_['isNil'](_0x278ff9)&&_0x278ff9!==''){var _0x7e3b77=/^(([^<>()\[\]\\.,;:\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 _0x7e3b77[_0x2ba8('0x18')](String(_0x278ff9)[_0x2ba8('0xb')]());}else{return![];}}; \ No newline at end of file +var _0x379e=['customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','util','getString','length','sortBy','string','push','content','variable','variableName','toString','type'];(function(_0x1493b8,_0x1e59f0){var _0x2a62a9=function(_0x25630b){while(--_0x25630b){_0x1493b8['push'](_0x1493b8['shift']());}};_0x2a62a9(++_0x1e59f0);}(_0x379e,0x199));var _0xe379=function(_0x4e97f6,_0x4d560d){_0x4e97f6=_0x4e97f6-0x0;var _0x58f140=_0x379e[_0x4e97f6];return _0x58f140;};'use strict';var _=require('lodash');var util=require(_0xe379('0x0'));exports[_0xe379('0x1')]=function(_0x47a329,_0x2a9d58,_0x4f1ecc){var _0x8cb610=[];if(_0x47a329[_0xe379('0x2')]>0x0){var _0x127316=_[_0xe379('0x3')](_0x47a329,['id']);for(var _0x2ebfca=0x0;_0x2ebfca<_0x127316[_0xe379('0x2')];_0x2ebfca++){var _0x3b6c92=_0x127316[_0x2ebfca];if(_0x3b6c92['type']===_0xe379('0x4')){_0x8cb610[_0xe379('0x5')](_0x3b6c92[_0xe379('0x6')]);}else if(_0x3b6c92['type']===_0xe379('0x7')&&_0x3b6c92[_0xe379('0x8')]){_0x2a9d58[_0x3b6c92[_0xe379('0x8')]]&&_0x8cb610['push'](_0x2a9d58[_0x3b6c92[_0xe379('0x8')]][_0xe379('0x9')]());}else if(_0x3b6c92[_0xe379('0xa')]===_0xe379('0xb')&&_0x3b6c92[_0xe379('0xc')]&&_0x3b6c92[_0xe379('0xc')][_0xe379('0xd')]){_0x2a9d58[_0x3b6c92[_0xe379('0xc')][_0xe379('0xd')]['toLowerCase']()]&&_0x8cb610['push'](_0x2a9d58[_0x3b6c92[_0xe379('0xc')]['name'][_0xe379('0xe')]()][_0xe379('0x9')]());}else if(_0x3b6c92['type']===_0xe379('0xf')){if(_0x3b6c92[_0xe379('0x10')]==='string'&&_0x3b6c92[_0xe379('0x11')]){_0x8cb610[_0xe379('0x5')](util[_0xe379('0x12')](_0xe379('0x13'),_0x3b6c92[_0xe379('0x11')],_0x3b6c92[_0xe379('0x14')]));}else if(_0x3b6c92[_0xe379('0x10')]===_0xe379('0x7')&&_0x3b6c92[_0xe379('0x8')]&&_0x3b6c92['key']){_0x2a9d58[_0x3b6c92[_0xe379('0x8')]]&&_0x8cb610[_0xe379('0x5')](util['format'](_0xe379('0x13'),_0x3b6c92[_0xe379('0x11')],_0x2a9d58[_0x3b6c92[_0xe379('0x8')]]));}else if(_0x3b6c92[_0xe379('0x10')]==='customVariable'&&_0x3b6c92['Variable']&&_0x3b6c92[_0xe379('0xc')]['name']&&_0x3b6c92['key']){_0x2a9d58[_0x3b6c92['Variable'][_0xe379('0xd')]['toLowerCase']()]&&_0x8cb610[_0xe379('0x5')](util[_0xe379('0x12')](_0xe379('0x13'),_0x3b6c92['key'],_0x2a9d58[_0x3b6c92[_0xe379('0xc')][_0xe379('0xd')][_0xe379('0xe')]()]));}}}}return _0x8cb610['join'](_0x4f1ecc);};exports[_0xe379('0x15')]=function(_0x518504){var _0x584676=_0x518504[_0xe379('0x16')](-0x1);if(_0x584676==='/'){_0x518504=_0x518504[_0xe379('0x17')](0x0,_0x518504[_0xe379('0x18')](_0x584676));}return _0x518504;};exports[_0xe379('0x19')]=function(_0x440fb6){if(!_[_0xe379('0x1a')](_0x440fb6)&&_0x440fb6!==''){var _0x4187b3=/^(([^<>()\[\]\\.,;:\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 _0x4187b3[_0xe379('0x1b')](String(_0x440fb6)[_0xe379('0xe')]());}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 bd4f937..265165d 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['stringify','validateEmail','Getting\x20agent\x20with\x20email','GET','%s/webservice.php','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','length','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','getUser','admin','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','login','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridnum','lastevent','bluebird','md5','util','ioredis','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','forEach','string','picklist','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','getString','Subjects','POST','remoteUri','create','username','sessionName','then','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s'];(function(_0x5aec1c,_0x1e653c){var _0x5a44c5=function(_0x451a26){while(--_0x451a26){_0x5aec1c['push'](_0x5aec1c['shift']());}};_0x5a44c5(++_0x1e653c);}(_0x9c44,0x178));var _0x49c4=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x9c44[_0x4d613c];return _0x301fe3;};'use strict';var _=require('lodash');var rp=require('request-promise');var BPromise=require(_0x49c4('0x0'));var md5=require(_0x49c4('0x1'));var util=require(_0x49c4('0x2'));var Redis=require(_0x49c4('0x3'));var intUtil=require(_0x49c4('0x4'));var config=require(_0x49c4('0x5'));var logger=require('../../../../config/logger')('vTiger');config[_0x49c4('0x6')]=_['defaults'](config[_0x49c4('0x6')],{'host':_0x49c4('0x7'),'port':0x18eb});var io=require(_0x49c4('0x8'))(new Redis(config[_0x49c4('0x6')]));function emit(_0x436234,_0x511d53,_0x11c586){io['to'](_0x436234)[_0x49c4('0x9')](_0x511d53,_0x11c586);}function getCustomFields(_0x1d13fb,_0x4487ca){var _0x4c7d3a={};if(_0x1d13fb['length']>0x0){_[_0x49c4('0xa')](_0x1d13fb,function(_0x313e73){if(_['includes']([_0x49c4('0xb'),_0x49c4('0xc')],_0x313e73['type'])&&_0x313e73['idField']){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x313e73[_0x49c4('0xe')]['toString']();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x10')&&_0x313e73['variableName']&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x11')]]){_0x4c7d3a[_0x313e73[_0x49c4('0xd')]]=_0x4487ca[_0x313e73[_0x49c4('0x11')]][_0x49c4('0x12')]();}else if(_0x313e73[_0x49c4('0xf')]===_0x49c4('0x13')&&_0x313e73[_0x49c4('0x14')]&&_0x313e73['Variable'][_0x49c4('0x15')]&&_0x313e73[_0x49c4('0xd')]&&_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')][_0x49c4('0x16')]()]){_0x4c7d3a[_0x313e73['idField']]=_0x4487ca[_0x313e73[_0x49c4('0x14')][_0x49c4('0x15')]['toLowerCase']()]['toString']();}});}return _0x4c7d3a;}function createTicket(_0x3c782d,_0x2f82d5,_0x3addb2,_0x59f29b,_0x24856d,_0x50b151,_0x2cbd50){logger[_0x49c4('0x17')](_0x49c4('0x18'));var _0x291526=_[_0x49c4('0x19')]({'parent_id':'','assigned_user_id':_0x2f82d5['id'],'ticketpriorities':_0x49c4('0x1a'),'ticketstatus':_0x49c4('0x1b'),'ticket_title':intUtil[_0x49c4('0x1c')](_0x59f29b[_0x49c4('0x1d')],_0x24856d,'\x20'),'description':intUtil['getString'](_0x59f29b['Descriptions'],_0x24856d,'\x0a'),'contact_id':_0x3addb2['id']},getCustomFields(_0x50b151,_0x24856d));var _0x57f502={'method':_0x49c4('0x1e'),'uri':util['format']('%s/webservice.php',_0x3c782d[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x20'),'username':_0x3c782d[_0x49c4('0x21')],'sessionName':_0x2cbd50[_0x49c4('0x22')],'elementType':'HelpDesk','element':JSON['stringify'](_0x291526)},'json':!![]};return request(_0x57f502)[_0x49c4('0x23')](function(_0x9cb797){if(_0x9cb797['success']){return BPromise[_0x49c4('0x24')]({'id':_0x9cb797[_0x49c4('0x25')]['id']});}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x27'),JSON['stringify'](_0x9cb797['error'])));}})[_0x49c4('0x28')](function(_0x53c199){var _0x3800b7=_0x53c199[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'createTicket',_0x3800b7,JSON[_0x49c4('0x2c')](_0x53c199));});}function getUser(_0x2b2793,_0x46e04d,_0x4f28a2){if(intUtil[_0x49c4('0x2d')](_0x46e04d)){logger[_0x49c4('0x17')](_0x49c4('0x2e'),_0x46e04d);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2b2793[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x2b2793['username'],'sessionName':_0x4f28a2['sessionName'],'query':util[_0x49c4('0x26')](_0x49c4('0x31'),_0x46e04d)},'json':!![]})[_0x49c4('0x23')](function(_0x27e467){if(_0x27e467[_0x49c4('0x32')]&&_0x27e467['result'][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x34'));return BPromise[_0x49c4('0x24')]({'id':_0x27e467['result'][0x0]['id'],'email':_0x27e467['result'][0x0][_0x49c4('0x35')],'name':_0x27e467[_0x49c4('0x25')][0x0][_0x49c4('0x36')]+'\x20'+_0x27e467[_0x49c4('0x25')][_0x49c4('0x37')]});}else{logger['info'](_0x49c4('0x38'));return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2[_0x49c4('0x39')],'email':_0x2b2793['username'],'name':'admin'});}})[_0x49c4('0x28')](function(_0x1991e9){var _0x3bec0a=_0x1991e9[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x3a'),_0x3bec0a,JSON[_0x49c4('0x2c')](_0x1991e9));});}else{logger[_0x49c4('0x17')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x49c4('0x24')]({'id':_0x4f28a2['userId'],'email':_0x2b2793[_0x49c4('0x21')],'name':_0x49c4('0x3b')})[_0x49c4('0x28')](function(_0x1c2830){var _0x4ed4f8=_0x1c2830[_0x49c4('0x29')]||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),'getUser',_0x4ed4f8,JSON[_0x49c4('0x2c')](_0x1c2830));});}}function getEndUser(_0x21d8c7,_0x178987,_0x5e5366,_0x1ba7a0){logger[_0x49c4('0x17')](_0x49c4('0x3c'),_0x5e5366);return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7[_0x49c4('0x1f')]),'qs':{'operation':'query','username':_0x21d8c7[_0x49c4('0x21')],'sessionName':_0x1ba7a0[_0x49c4('0x22')],'query':util[_0x49c4('0x26')](_0x49c4('0x3d'),_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366,_0x5e5366)},'json':!![]})[_0x49c4('0x23')](function(_0x29dd5d){if(_0x29dd5d[_0x49c4('0x32')]&&_0x29dd5d[_0x49c4('0x25')][_0x49c4('0x33')]){logger[_0x49c4('0x17')](_0x49c4('0x3e'));return BPromise[_0x49c4('0x24')]({'id':_0x29dd5d[_0x49c4('0x25')][0x0]['id'],'name':_0x29dd5d['result'][0x0][_0x49c4('0x3f')]+'\x20'+_0x29dd5d['result'][0x0][_0x49c4('0x40')],'phone':_0x5e5366});}else{logger[_0x49c4('0x17')](_0x49c4('0x41'));return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x21d8c7['remoteUri']),'form':{'operation':'create','sessionName':_0x1ba7a0[_0x49c4('0x22')],'elementType':_0x49c4('0x42'),'element':JSON[_0x49c4('0x2c')]({'lastname':_0x178987,'phone':_0x5e5366,'assigned_user_id':'\x20'})},'json':!![]})[_0x49c4('0x23')](function(_0x490823){logger[_0x49c4('0x17')](_0x49c4('0x43'));return BPromise[_0x49c4('0x24')]({'id':_0x490823[_0x49c4('0x25')]['id'],'name':_0x490823[_0x49c4('0x25')][_0x49c4('0x40')],'phone':_0x490823[_0x49c4('0x25')][_0x49c4('0x44')]});})[_0x49c4('0x28')](function(_0x5640d3){var _0x2ad771=_0x5640d3['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x45'),_0x2ad771,JSON[_0x49c4('0x2c')](_0x5640d3));});}});}function getConnection(_0x2d93d8){var _0x5b296d=_0x2d93d8[_0x49c4('0x21')];var _0x15b674=_0x2d93d8[_0x49c4('0x46')];return request({'method':_0x49c4('0x2f'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'qs':{'operation':'getchallenge','username':_0x5b296d},'json':!![]})[_0x49c4('0x23')](function(_0x5cfff9){if(_0x5cfff9[_0x49c4('0x32')]){return request({'method':_0x49c4('0x1e'),'uri':util[_0x49c4('0x26')](_0x49c4('0x30'),_0x2d93d8[_0x49c4('0x1f')]),'form':{'operation':_0x49c4('0x47'),'username':_0x5b296d,'accessKey':md5(_0x5cfff9[_0x49c4('0x25')]['token']+_0x15b674)},'json':!![]});}})[_0x49c4('0x23')](function(_0x3feaf0){if(_0x3feaf0['success']){return BPromise[_0x49c4('0x24')](_0x3feaf0[_0x49c4('0x25')]);}else{throw new Error(util[_0x49c4('0x26')](_0x49c4('0x48'),_0x2d93d8['id']));}})['catch'](function(_0x5d8bf0){var _0x144fd2=_0x5d8bf0['statusCode']||0x1f4;logger[_0x49c4('0x2a')](_0x49c4('0x2b'),_0x49c4('0x49'),_0x144fd2,JSON[_0x49c4('0x2c')](_0x5d8bf0));});}function request(_0x240c20){logger[_0x49c4('0x17')](_0x49c4('0x4a'),JSON['stringify'](_0x240c20));return rp(_0x240c20);}exports[_0x49c4('0x4b')]=function(_0x1550ce,_0x3936d3,_0x3d944c,_0x17ef75,_0x2644c0,_0x156748){var _0x25d174,_0x1e0b4f,_0x1856be,_0x5b822f;_0x156748['remoteUri']=intUtil[_0x49c4('0x4c')](_0x156748[_0x49c4('0x1f')]);if(_0x2644c0&&_0x2644c0['monitor_format']){logger['info'](_0x49c4('0x4d'),'Recording\x20is\x20enabled!');_0x3936d3['recordingURL']=util[_0x49c4('0x26')](_0x49c4('0x4e'),_0x156748[_0x49c4('0x4f')],_0x3936d3[_0x49c4('0x50')],md5(_0x3936d3[_0x49c4('0x50')]));}else{_0x3936d3[_0x49c4('0x51')]='';}return getConnection(_0x156748)[_0x49c4('0x23')](function(_0x50798e){_0x5b822f=_0x50798e;return getUser(_0x156748,_0x17ef75[_0x49c4('0x52')],_0x5b822f);})[_0x49c4('0x23')](function(_0x207572){_0x25d174=_0x207572;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x25d174['id']);return getEndUser(_0x156748,_0x3936d3[_0x49c4('0x54')],_0x3936d3['calleridnum'],_0x5b822f);})['then'](function(_0x1ef0c1){_0x1e0b4f=_0x1ef0c1;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0x1e0b4f['id']);return createTicket(_0x156748,_0x25d174,_0x1e0b4f,_0x3d944c,_0x3936d3,_0x3d944c[_0x49c4('0x56')],_0x5b822f);})[_0x49c4('0x23')](function(_0x6b2592){_0x1856be=_0x6b2592;logger[_0x49c4('0x17')]('Ticket\x20created!');logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x1856be['id']);var _0x4ba4eb=util[_0x49c4('0x26')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x156748[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x1856be['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x4d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x17ef75[_0x49c4('0x15')]),'trigger:browser:url',{'uri':_0x4ba4eb});})[_0x49c4('0x28')](function(_0x27b9c2){logger['error'](_0x49c4('0x4d'),JSON[_0x49c4('0x2c')](_0x27b9c2));});};exports['outbound']=function(_0x39c455,_0x42e0e6,_0x4f50bf,_0x4dc54d,_0x589484,_0x513879,_0xc43386){var _0x54947d,_0xb20a5d,_0x32f344,_0x515240;_0x513879[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x513879['remoteUri']);_0x513879[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x513879[_0x49c4('0x4f')]);if(_0xc43386&&_0xc43386[_0x49c4('0x5b')]&&_0xc43386['recordingFormat']!==_0x49c4('0x5c')){logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x5e'));_0x42e0e6['recordingURL']=util[_0x49c4('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513879['serverUrl'],_0x42e0e6['uniqueid'],md5(_0x42e0e6['uniqueid']));}return getConnection(_0x513879)[_0x49c4('0x23')](function(_0x32eaef){_0x515240=_0x32eaef;return getUser(_0x513879,_0x4dc54d[_0x49c4('0x52')],_0x515240);})[_0x49c4('0x23')](function(_0x5b056e){_0x54947d=_0x5b056e;logger['info'](_0x49c4('0x53'),_0x54947d['id']);return getEndUser(_0x513879,_0x42e0e6[_0x49c4('0x5f')],_0x42e0e6[_0x49c4('0x60')],_0x515240);})[_0x49c4('0x23')](function(_0x102c15){_0xb20a5d=_0x102c15;logger[_0x49c4('0x17')](_0x49c4('0x55'),_0xb20a5d['id']);return createTicket(_0x513879,_0x54947d,_0xb20a5d,_0x4f50bf,_0x42e0e6,_0x4f50bf[_0x49c4('0x56')],_0x515240);})['then'](function(_0x2276db){_0x32f344=_0x2276db;logger['info'](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x32f344['id']);var _0x1ea1b4=util[_0x49c4('0x26')](_0x49c4('0x62'),_0x513879[_0x49c4('0x1f')],_[_0x49c4('0x58')](_0x32f344['id'],'x')[0x1]);logger[_0x49c4('0x17')](_0x49c4('0x5d'),_0x49c4('0x59'));emit(util[_0x49c4('0x26')](_0x49c4('0x5a'),_0x4dc54d[_0x49c4('0x15')]),_0x49c4('0x63'),{'uri':_0x1ea1b4});})[_0x49c4('0x28')](function(_0x371e49){logger[_0x49c4('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x371e49));});};exports[_0x49c4('0x64')]=function(_0x16b3e8,_0x4af680,_0x1a15f3,_0x38ad50,_0x2939fd,_0x16e7b1){var _0x4d6aaa,_0x5a14a5,_0x4a85d4,_0x2e90d8;_0x16e7b1[_0x49c4('0x1f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x1f')]);_0x16e7b1[_0x49c4('0x4f')]=intUtil[_0x49c4('0x4c')](_0x16e7b1[_0x49c4('0x4f')]);if(_0x2939fd&&_0x2939fd[_0x49c4('0x65')]){logger[_0x49c4('0x17')]('['+_0x4af680['lastevent'][_0x49c4('0x66')]()+']',_0x49c4('0x5e'));_0x4af680[_0x49c4('0x51')]=util['format'](_0x49c4('0x4e'),_0x16e7b1[_0x49c4('0x4f')],_0x4af680[_0x49c4('0x50')],md5(_0x4af680[_0x49c4('0x50')]));}else{_0x4af680[_0x49c4('0x51')]='';}return getConnection(_0x16e7b1)[_0x49c4('0x23')](function(_0x35fa39){_0x2e90d8=_0x35fa39;return getUser(_0x16e7b1,'',_0x2e90d8);})[_0x49c4('0x23')](function(_0x4ba198){_0x4d6aaa=_0x4ba198;logger[_0x49c4('0x17')](_0x49c4('0x53'),_0x4d6aaa['id']);return getEndUser(_0x16e7b1,_0x4af680[_0x49c4('0x54')],_0x4af680[_0x49c4('0x67')],_0x2e90d8);})[_0x49c4('0x23')](function(_0x4a204d){_0x5a14a5=_0x4a204d;logger['info'](_0x49c4('0x55'),_0x5a14a5['id']);return createTicket(_0x16e7b1,_0x4d6aaa,_0x5a14a5,_0x1a15f3,_0x4af680,_0x1a15f3['Fields'],_0x2e90d8);})[_0x49c4('0x23')](function(_0x558880){_0x4a85d4=_0x558880;logger[_0x49c4('0x17')](_0x49c4('0x61'));logger[_0x49c4('0x17')](_0x49c4('0x57'),_0x4a85d4['id']);})['catch'](function(_0x123060){logger[_0x49c4('0x2a')]('['+_0x4af680[_0x49c4('0x68')][_0x49c4('0x66')]()+']',JSON[_0x49c4('0x2c')](_0x123060));});}; \ No newline at end of file +var _0xa9e0=['variable','variableName','customVariable','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','Normal','Open','Subjects','POST','format','%s/webservice.php','create','username','sessionName','HelpDesk','stringify','then','result','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','catch','error','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','Getting\x20agent\x20with\x20email','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','success','resolve','email1','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','getEndUser','accessKey','getchallenge','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','The\x20User\x20ID\x20is:','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','Fields','split','trigger:browser:url','unmanaged','monitor_format','toUpperCase','calleridname','lastevent','lodash','request-promise','bluebird','ioredis','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','length','forEach','includes','idField','content','toString','type'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var _=require(_0x0a9e('0x0'));var rp=require(_0x0a9e('0x1'));var BPromise=require(_0x0a9e('0x2'));var md5=require('md5');var util=require('util');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function emit(_0x5f41ea,_0x503809,_0xe42b77){io['to'](_0x5f41ea)['emit'](_0x503809,_0xe42b77);}function getCustomFields(_0x52cace,_0x39753a){var _0xf81284={};if(_0x52cace[_0x0a9e('0xb')]>0x0){_[_0x0a9e('0xc')](_0x52cace,function(_0xfeb75b){if(_[_0x0a9e('0xd')](['string','picklist'],_0xfeb75b['type'])&&_0xfeb75b['idField']){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0xfeb75b[_0x0a9e('0xf')][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x12')&&_0xfeb75b[_0x0a9e('0x13')]&&_0xfeb75b['idField']&&_0x39753a[_0xfeb75b[_0x0a9e('0x13')]]){_0xf81284[_0xfeb75b[_0x0a9e('0xe')]]=_0x39753a[_0xfeb75b[_0x0a9e('0x13')]][_0x0a9e('0x10')]();}else if(_0xfeb75b[_0x0a9e('0x11')]===_0x0a9e('0x14')&&_0xfeb75b['Variable']&&_0xfeb75b[_0x0a9e('0x15')]['name']&&_0xfeb75b[_0x0a9e('0xe')]&&_0x39753a[_0xfeb75b['Variable'][_0x0a9e('0x16')][_0x0a9e('0x17')]()]){_0xf81284[_0xfeb75b['idField']]=_0x39753a[_0xfeb75b[_0x0a9e('0x15')]['name'][_0x0a9e('0x17')]()][_0x0a9e('0x10')]();}});}return _0xf81284;}function createTicket(_0x106033,_0x205fd6,_0x31b1ca,_0x2eb11f,_0x530eb7,_0x20559e,_0x1314ae){logger[_0x0a9e('0x18')](_0x0a9e('0x19'));var _0x105080=_['merge']({'parent_id':'','assigned_user_id':_0x205fd6['id'],'ticketpriorities':_0x0a9e('0x1a'),'ticketstatus':_0x0a9e('0x1b'),'ticket_title':intUtil['getString'](_0x2eb11f[_0x0a9e('0x1c')],_0x530eb7,'\x20'),'description':intUtil['getString'](_0x2eb11f['Descriptions'],_0x530eb7,'\x0a'),'contact_id':_0x31b1ca['id']},getCustomFields(_0x20559e,_0x530eb7));var _0x3a02e1={'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x106033['remoteUri']),'form':{'operation':_0x0a9e('0x20'),'username':_0x106033[_0x0a9e('0x21')],'sessionName':_0x1314ae[_0x0a9e('0x22')],'elementType':_0x0a9e('0x23'),'element':JSON[_0x0a9e('0x24')](_0x105080)},'json':!![]};return request(_0x3a02e1)[_0x0a9e('0x25')](function(_0x16b1ca){if(_0x16b1ca['success']){return BPromise['resolve']({'id':_0x16b1ca[_0x0a9e('0x26')]['id']});}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x27'),JSON[_0x0a9e('0x24')](_0x16b1ca['error'])));}})[_0x0a9e('0x28')](function(_0x479bc4){var _0x45a1e7=_0x479bc4['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x2b'),_0x45a1e7,JSON[_0x0a9e('0x24')](_0x479bc4));});}function getUser(_0x140511,_0x1538a4,_0x11c3b6){if(intUtil[_0x0a9e('0x2c')](_0x1538a4)){logger['info'](_0x0a9e('0x2d'),_0x1538a4);return request({'method':_0x0a9e('0x2e'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x140511['remoteUri']),'qs':{'operation':_0x0a9e('0x2f'),'username':_0x140511[_0x0a9e('0x21')],'sessionName':_0x11c3b6[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x30'),_0x1538a4)},'json':!![]})[_0x0a9e('0x25')](function(_0x296f41){if(_0x296f41[_0x0a9e('0x31')]&&_0x296f41[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')]('Agent\x20found!');return BPromise[_0x0a9e('0x32')]({'id':_0x296f41[_0x0a9e('0x26')][0x0]['id'],'email':_0x296f41[_0x0a9e('0x26')][0x0][_0x0a9e('0x33')],'name':_0x296f41[_0x0a9e('0x26')][0x0]['first_name']+'\x20'+_0x296f41[_0x0a9e('0x26')][_0x0a9e('0x34')]});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511[_0x0a9e('0x21')],'name':_0x0a9e('0x37')});}})['catch'](function(_0x44295a){var _0x5e7238=_0x44295a[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),_0x0a9e('0x39'),_0x5e7238,JSON['stringify'](_0x44295a));});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x35'));return BPromise[_0x0a9e('0x32')]({'id':_0x11c3b6[_0x0a9e('0x36')],'email':_0x140511['username'],'name':'admin'})[_0x0a9e('0x28')](function(_0x5640eb){var _0x24936a=_0x5640eb[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getUser',_0x24936a,JSON[_0x0a9e('0x24')](_0x5640eb));});}}function getEndUser(_0x3bfce8,_0x3cae,_0x533942,_0x1dbf74){logger[_0x0a9e('0x18')](_0x0a9e('0x3a'),_0x533942);return request({'method':'GET','uri':util['format'](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'qs':{'operation':'query','username':_0x3bfce8[_0x0a9e('0x21')],'sessionName':_0x1dbf74[_0x0a9e('0x22')],'query':util[_0x0a9e('0x1e')](_0x0a9e('0x3c'),_0x533942,_0x533942,_0x533942,_0x533942,_0x533942)},'json':!![]})['then'](function(_0x5a594b){if(_0x5a594b[_0x0a9e('0x31')]&&_0x5a594b[_0x0a9e('0x26')]['length']){logger[_0x0a9e('0x18')](_0x0a9e('0x3d'));return BPromise[_0x0a9e('0x32')]({'id':_0x5a594b['result'][0x0]['id'],'name':_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3e')]+'\x20'+_0x5a594b[_0x0a9e('0x26')][0x0][_0x0a9e('0x3f')],'phone':_0x533942});}else{logger[_0x0a9e('0x18')](_0x0a9e('0x40'));return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0x3bfce8[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x20'),'sessionName':_0x1dbf74[_0x0a9e('0x22')],'elementType':_0x0a9e('0x41'),'element':JSON[_0x0a9e('0x24')]({'lastname':_0x3cae,'phone':_0x533942,'assigned_user_id':'\x20'})},'json':!![]})[_0x0a9e('0x25')](function(_0x4d04c8){logger['info'](_0x0a9e('0x42'));return BPromise[_0x0a9e('0x32')]({'id':_0x4d04c8[_0x0a9e('0x26')]['id'],'name':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x3f')],'phone':_0x4d04c8[_0x0a9e('0x26')][_0x0a9e('0x43')]});})[_0x0a9e('0x28')](function(_0x432fcc){var _0x25c6e6=_0x432fcc[_0x0a9e('0x38')]||0x1f4;logger[_0x0a9e('0x29')]('[vTiger],\x20%s,\x20%s,\x20%s',_0x0a9e('0x44'),_0x25c6e6,JSON[_0x0a9e('0x24')](_0x432fcc));});}});}function getConnection(_0xdd268f){var _0xfbd5ad=_0xdd268f[_0x0a9e('0x21')];var _0xbe9d19=_0xdd268f[_0x0a9e('0x45')];return request({'method':_0x0a9e('0x2e'),'uri':util['format'](_0x0a9e('0x1f'),_0xdd268f['remoteUri']),'qs':{'operation':_0x0a9e('0x46'),'username':_0xfbd5ad},'json':!![]})[_0x0a9e('0x25')](function(_0x8d6dd1){if(_0x8d6dd1['success']){return request({'method':_0x0a9e('0x1d'),'uri':util[_0x0a9e('0x1e')](_0x0a9e('0x1f'),_0xdd268f[_0x0a9e('0x3b')]),'form':{'operation':_0x0a9e('0x47'),'username':_0xfbd5ad,'accessKey':md5(_0x8d6dd1[_0x0a9e('0x26')][_0x0a9e('0x48')]+_0xbe9d19)},'json':!![]});}})['then'](function(_0x13f44d){if(_0x13f44d[_0x0a9e('0x31')]){return BPromise[_0x0a9e('0x32')](_0x13f44d[_0x0a9e('0x26')]);}else{throw new Error(util[_0x0a9e('0x1e')](_0x0a9e('0x49'),_0xdd268f['id']));}})[_0x0a9e('0x28')](function(_0x19383e){var _0x34febd=_0x19383e['statusCode']||0x1f4;logger[_0x0a9e('0x29')](_0x0a9e('0x2a'),'getConnection',_0x34febd,JSON['stringify'](_0x19383e));});}function request(_0x5ddf84){logger[_0x0a9e('0x18')](_0x0a9e('0x4a'),JSON[_0x0a9e('0x24')](_0x5ddf84));return rp(_0x5ddf84);}exports[_0x0a9e('0x4b')]=function(_0x61bb17,_0x30decb,_0x2e5165,_0x375c18,_0x5d38ae,_0x4b1b9f){var _0x53975a,_0x39d77d,_0x204173,_0x14d602;_0x4b1b9f['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x4b1b9f[_0x0a9e('0x3b')]);if(_0x5d38ae&&_0x5d38ae['monitor_format']){logger['info'](_0x0a9e('0x4d'),'Recording\x20is\x20enabled!');_0x30decb[_0x0a9e('0x4e')]=util['format'](_0x0a9e('0x4f'),_0x4b1b9f[_0x0a9e('0x50')],_0x30decb[_0x0a9e('0x51')],md5(_0x30decb['uniqueid']));}else{_0x30decb[_0x0a9e('0x4e')]='';}return getConnection(_0x4b1b9f)[_0x0a9e('0x25')](function(_0x508b47){_0x14d602=_0x508b47;return getUser(_0x4b1b9f,_0x375c18['email'],_0x14d602);})[_0x0a9e('0x25')](function(_0x3aedd0){_0x53975a=_0x3aedd0;logger['info'](_0x0a9e('0x52'),_0x53975a['id']);return getEndUser(_0x4b1b9f,_0x30decb['calleridname'],_0x30decb[_0x0a9e('0x53')],_0x14d602);})['then'](function(_0xe22ccc){_0x39d77d=_0xe22ccc;logger['info']('The\x20Enduser\x20ID\x20is:',_0x39d77d['id']);return createTicket(_0x4b1b9f,_0x53975a,_0x39d77d,_0x2e5165,_0x30decb,_0x2e5165['Fields'],_0x14d602);})[_0x0a9e('0x25')](function(_0x47de4c){_0x204173=_0x47de4c;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x204173['id']);var _0x232830=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x4b1b9f[_0x0a9e('0x3b')],_['split'](_0x204173['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x4d'),_0x0a9e('0x57'));emit(util[_0x0a9e('0x1e')](_0x0a9e('0x58'),_0x375c18[_0x0a9e('0x16')]),'trigger:browser:url',{'uri':_0x232830});})[_0x0a9e('0x28')](function(_0x26bc80){logger['error'](_0x0a9e('0x4d'),JSON['stringify'](_0x26bc80));});};exports[_0x0a9e('0x59')]=function(_0x5ba1f9,_0x4b3c1a,_0x5674ee,_0x273cb5,_0x49d231,_0x2244d6,_0x1fc70e){var _0x261adb,_0x7be420,_0x1cca9f,_0x26d7db;_0x2244d6['remoteUri']=intUtil[_0x0a9e('0x4c')](_0x2244d6['remoteUri']);_0x2244d6[_0x0a9e('0x50')]=intUtil[_0x0a9e('0x4c')](_0x2244d6[_0x0a9e('0x50')]);if(_0x1fc70e&&_0x1fc70e['recordingFormat']&&_0x1fc70e[_0x0a9e('0x5a')]!==_0x0a9e('0x5b')){logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),'Recording\x20is\x20enabled!');_0x4b3c1a[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2244d6[_0x0a9e('0x50')],_0x4b3c1a[_0x0a9e('0x51')],md5(_0x4b3c1a[_0x0a9e('0x51')]));}return getConnection(_0x2244d6)[_0x0a9e('0x25')](function(_0x401837){_0x26d7db=_0x401837;return getUser(_0x2244d6,_0x273cb5['email'],_0x26d7db);})[_0x0a9e('0x25')](function(_0x2937e0){_0x261adb=_0x2937e0;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x261adb['id']);return getEndUser(_0x2244d6,_0x4b3c1a[_0x0a9e('0x5d')],_0x4b3c1a['destcalleridnum'],_0x26d7db);})['then'](function(_0x242745){_0x7be420=_0x242745;logger[_0x0a9e('0x18')](_0x0a9e('0x5e'),_0x7be420['id']);return createTicket(_0x2244d6,_0x261adb,_0x7be420,_0x5674ee,_0x4b3c1a,_0x5674ee[_0x0a9e('0x5f')],_0x26d7db);})[_0x0a9e('0x25')](function(_0xc8c264){_0x1cca9f=_0xc8c264;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1cca9f['id']);var _0x2e89b7=util[_0x0a9e('0x1e')](_0x0a9e('0x56'),_0x2244d6[_0x0a9e('0x3b')],_[_0x0a9e('0x60')](_0x1cca9f['id'],'x')[0x1]);logger[_0x0a9e('0x18')](_0x0a9e('0x5c'),_0x0a9e('0x57'));emit(util['format'](_0x0a9e('0x58'),_0x273cb5[_0x0a9e('0x16')]),_0x0a9e('0x61'),{'uri':_0x2e89b7});})['catch'](function(_0x1148a1){logger[_0x0a9e('0x29')]('[OUTBOUND]',JSON[_0x0a9e('0x24')](_0x1148a1));});};exports[_0x0a9e('0x62')]=function(_0x3ef315,_0x427946,_0x13b5c0,_0x4a43a8,_0x50cdce,_0x4a2438){var _0x40fb85,_0x18bf5d,_0x1104ad,_0x23a7d3;_0x4a2438[_0x0a9e('0x3b')]=intUtil[_0x0a9e('0x4c')](_0x4a2438[_0x0a9e('0x3b')]);_0x4a2438[_0x0a9e('0x50')]=intUtil['stripTrailingSlash'](_0x4a2438[_0x0a9e('0x50')]);if(_0x50cdce&&_0x50cdce[_0x0a9e('0x63')]){logger[_0x0a9e('0x18')]('['+_0x427946['lastevent'][_0x0a9e('0x64')]()+']','Recording\x20is\x20enabled!');_0x427946[_0x0a9e('0x4e')]=util[_0x0a9e('0x1e')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4a2438[_0x0a9e('0x50')],_0x427946[_0x0a9e('0x51')],md5(_0x427946[_0x0a9e('0x51')]));}else{_0x427946[_0x0a9e('0x4e')]='';}return getConnection(_0x4a2438)['then'](function(_0x1d442c){_0x23a7d3=_0x1d442c;return getUser(_0x4a2438,'',_0x23a7d3);})[_0x0a9e('0x25')](function(_0x371533){_0x40fb85=_0x371533;logger[_0x0a9e('0x18')]('The\x20User\x20ID\x20is:',_0x40fb85['id']);return getEndUser(_0x4a2438,_0x427946[_0x0a9e('0x65')],_0x427946[_0x0a9e('0x53')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0x361b21){_0x18bf5d=_0x361b21;logger['info'](_0x0a9e('0x5e'),_0x18bf5d['id']);return createTicket(_0x4a2438,_0x40fb85,_0x18bf5d,_0x13b5c0,_0x427946,_0x13b5c0[_0x0a9e('0x5f')],_0x23a7d3);})[_0x0a9e('0x25')](function(_0xf410e5){_0x1104ad=_0xf410e5;logger[_0x0a9e('0x18')](_0x0a9e('0x54'));logger[_0x0a9e('0x18')](_0x0a9e('0x55'),_0x1104ad['id']);})[_0x0a9e('0x28')](function(_0x336dc3){logger[_0x0a9e('0x29')]('['+_0x427946[_0x0a9e('0x66')][_0x0a9e('0x64')]()+']',JSON[_0x0a9e('0x24')](_0x336dc3));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/zendesk.js b/server/services/ami/trigger/integration/zendesk.js index 845ee59..0dc3cd2 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 _0xd5e5=['calleridnum','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','then','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Enduser\x20created.','password','%s:%s','username','authType','token','toString','debug','[HTTP]','stringify','map','forEach','includes','picklist','type','nameField','customField','toLowerCase','idField','custom_fields','push','content','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','The\x20Enduser\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridnum','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','monitor_format','lastevent','toUpperCase'];(function(_0x3d34f0,_0x4a5dc0){var _0x135ecd=function(_0x9a81d5){while(--_0x9a81d5){_0x3d34f0['push'](_0x3d34f0['shift']());}};_0x135ecd(++_0x4a5dc0);}(_0xd5e5,0x74));var _0x5d5e=function(_0x26a8cb,_0x1f1f87){_0x26a8cb=_0x26a8cb-0x0;var _0x1abe61=_0xd5e5[_0x26a8cb];return _0x1abe61;};'use strict';var _=require(_0x5d5e('0x0'));var rp=require(_0x5d5e('0x1'));var md5=require(_0x5d5e('0x2'));var util=require(_0x5d5e('0x3'));var Redis=require(_0x5d5e('0x4'));var intUtil=require(_0x5d5e('0x5'));var config=require(_0x5d5e('0x6'));var logger=require(_0x5d5e('0x7'))(_0x5d5e('0x8'));config['redis']=_[_0x5d5e('0x9')](config[_0x5d5e('0xa')],{'host':_0x5d5e('0xb'),'port':0x18eb});var io=require(_0x5d5e('0xc'))(new Redis(config[_0x5d5e('0xa')]));function emit(_0x448615,_0x5d7de5,_0x5aa344){io['to'](_0x448615)[_0x5d5e('0xd')](_0x5d7de5,_0x5aa344);}var headers={'Content-Type':_0x5d5e('0xe'),'Accept':_0x5d5e('0xe')};function getTicket(_0x17f69f,_0x5bf8e2,_0x3308ad,_0x5640cb,_0x464d56){logger[_0x5d5e('0xf')](_0x5d5e('0x10'));return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x12'),_0x17f69f[_0x5d5e('0x13')]),'method':_0x5d5e('0x14'),'body':{'ticket':_[_0x5d5e('0x15')]({'requester_id':_0x3308ad['id'],'submitter_id':_0x5bf8e2?_0x5bf8e2['id']:undefined,'assignee_id':_0x5bf8e2?_0x5bf8e2['id']:undefined,'tags':getTags(_0x5640cb[_0x5d5e('0x16')],_0x5d5e('0x17')),'subject':intUtil[_0x5d5e('0x18')](_0x5640cb[_0x5d5e('0x19')],_0x464d56,'\x20'),'description':intUtil[_0x5d5e('0x18')](_0x5640cb[_0x5d5e('0x1a')],_0x464d56,'\x0a'),'comment':{'public':![],'body':intUtil[_0x5d5e('0x18')](_0x5640cb[_0x5d5e('0x1a')],_0x464d56,'\x0a')}},getCustomFields(_0x5640cb['Fields'],_0x464d56))}})['then'](function(_0x5311fd){logger[_0x5d5e('0xf')](_0x5d5e('0x1b'));return _0x5311fd['ticket'];});}function getUser(_0xb19a19,_0x5150ca){if(intUtil[_0x5d5e('0x1c')](_0x5150ca)){logger[_0x5d5e('0xf')](_0x5d5e('0x1d'),_0x5150ca);return request({'uri':util['format']('%s/search.json',_0xb19a19[_0x5d5e('0x13')]),'qs':{'query':util[_0x5d5e('0x11')](_0x5d5e('0x1e'),_0x5150ca)}})[_0x5d5e('0x1f')](function(_0x3f945f){if(_0x3f945f[_0x5d5e('0x20')]){logger[_0x5d5e('0xf')](_0x5d5e('0x21'));return _[_0x5d5e('0x22')](_0x3f945f[_0x5d5e('0x23')],{'email':_0x5150ca,'role':_0x5d5e('0x24')});}else{logger[_0x5d5e('0xf')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x25'),_0xb19a19['remoteUri'])})[_0x5d5e('0x1f')](function(_0x3f0ba8){logger[_0x5d5e('0xf')](_0x5d5e('0x26'));return _0x3f0ba8[_0x5d5e('0x27')];});}});}else{logger[_0x5d5e('0xf')](_0x5d5e('0x28'));return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x25'),_0xb19a19[_0x5d5e('0x13')])})[_0x5d5e('0x1f')](function(_0x183faa){logger['info'](_0x5d5e('0x26'));return _0x183faa['user'];});}}function getEndUser(_0x33d349,_0x4452be,_0x2142d8){logger['info'](_0x5d5e('0x29'),_0x2142d8);return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x2a'),_0x33d349[_0x5d5e('0x13')]),'qs':{'query':util['format'](_0x5d5e('0x2b'),_0x2142d8)}})[_0x5d5e('0x1f')](function(_0x3d4f55){var _0x888a58;if(_0x3d4f55[_0x5d5e('0x23')][_0x5d5e('0x2c')]){_0x3d4f55[_0x5d5e('0x23')]=_['filter'](_0x3d4f55[_0x5d5e('0x23')],{'suspended':![],'role':_0x5d5e('0x2d')});if(_0x3d4f55['results'][_0x5d5e('0x2c')]){_0x888a58=_[_0x5d5e('0x2e')](_0x3d4f55['results']);}}if(_0x888a58){logger['info'](_0x5d5e('0x2f'));return _0x888a58;}else{logger[_0x5d5e('0xf')](_0x5d5e('0x30'));return request({'uri':util['format'](_0x5d5e('0x31'),_0x33d349[_0x5d5e('0x13')]),'method':_0x5d5e('0x14'),'body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0x4452be||_0x2142d8),'phone':_0x2142d8}}})[_0x5d5e('0x1f')](function(_0xcc6d7a){logger[_0x5d5e('0xf')](_0x5d5e('0x32'));return _0xcc6d7a[_0x5d5e('0x27')];});}});}function getAuth(_0x1c1c09){var _0x44e334;if(_0x1c1c09['authType']===_0x5d5e('0x33')){_0x44e334=util[_0x5d5e('0x11')](_0x5d5e('0x34'),_0x1c1c09[_0x5d5e('0x35')],_0x1c1c09['password']);}else if(_0x1c1c09[_0x5d5e('0x36')]===_0x5d5e('0x37')){_0x44e334=util[_0x5d5e('0x11')]('%s/token:%s',_0x1c1c09[_0x5d5e('0x35')],_0x1c1c09[_0x5d5e('0x37')]);}return util[_0x5d5e('0x11')]('Basic\x20%s',new Buffer(_0x44e334)[_0x5d5e('0x38')]('base64'));}function request(_0x58ddbe){logger[_0x5d5e('0x39')](_0x5d5e('0x3a'),JSON[_0x5d5e('0x3b')](_0x58ddbe));return rp(_['defaults'](_0x58ddbe,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x41e25c,_0x271e8c){var _0xceac9=[];if(_0x41e25c&&_0x41e25c[_0x5d5e('0x2c')]>0x0){_0xceac9=_[_0x5d5e('0x3c')](_0x41e25c,_0x271e8c);}return _0xceac9;}function getCustomFields(_0x4c5594,_0x1cf070){var _0x197a69=[];var _0x5668d5={'custom_fields':[]};if(_0x4c5594[_0x5d5e('0x2c')]>0x0){_[_0x5d5e('0x3d')](_0x4c5594,function(_0xaab64b){if(_[_0x5d5e('0x3e')](['string',_0x5d5e('0x3f')],_0xaab64b[_0x5d5e('0x40')])&&_0xaab64b[_0x5d5e('0x41')]&&!_0xaab64b[_0x5d5e('0x42')]){_0x5668d5[_0xaab64b['nameField'][_0x5d5e('0x43')]()]=_0xaab64b['content'][_0x5d5e('0x38')]();}else if(_[_0x5d5e('0x3e')](['string',_0x5d5e('0x3f')],_0xaab64b[_0x5d5e('0x40')])&&_0xaab64b[_0x5d5e('0x44')]&&_0xaab64b[_0x5d5e('0x42')]){_0x5668d5[_0x5d5e('0x45')][_0x5d5e('0x46')]({'id':_0xaab64b[_0x5d5e('0x44')],'value':_0xaab64b[_0x5d5e('0x47')][_0x5d5e('0x38')]()});}else if(_0xaab64b[_0x5d5e('0x40')]===_0x5d5e('0x48')&&_0xaab64b[_0x5d5e('0x49')]&&_0xaab64b['idField']&&_0xaab64b[_0x5d5e('0x42')]){_0x1cf070[_0xaab64b[_0x5d5e('0x49')]]&&_0x5668d5[_0x5d5e('0x45')][_0x5d5e('0x46')]({'id':_0xaab64b['idField'],'value':_0x1cf070[_0xaab64b[_0x5d5e('0x49')]][_0x5d5e('0x38')]()});}else if(_0xaab64b['type']==='customVariable'&&_0xaab64b['Variable']&&_0xaab64b['Variable'][_0x5d5e('0x17')]&&_0xaab64b[_0x5d5e('0x44')]&&_0xaab64b[_0x5d5e('0x42')]){_0x1cf070[_0xaab64b[_0x5d5e('0x4a')]['name'][_0x5d5e('0x43')]()]&&_0x5668d5[_0x5d5e('0x45')][_0x5d5e('0x46')]({'id':_0xaab64b[_0x5d5e('0x44')],'value':_0x1cf070[_0xaab64b[_0x5d5e('0x4a')][_0x5d5e('0x17')]['toLowerCase']()][_0x5d5e('0x38')]()});}});}return _0x5668d5;}exports[_0x5d5e('0x4b')]=function(_0x311ee7,_0x318f73,_0x3407bf,_0x34a6fb,_0x3c6098,_0x3c8dae){var _0x222df6,_0x357356;_0x3c8dae['remoteUri']=intUtil[_0x5d5e('0x4c')](_0x3c8dae[_0x5d5e('0x13')]);_0x3c8dae[_0x5d5e('0x4d')]=intUtil[_0x5d5e('0x4c')](_0x3c8dae[_0x5d5e('0x4d')]);if(_0x3c6098&&_0x3c6098['monitor_format']){logger['info'](_0x5d5e('0x4e'),_0x5d5e('0x4f'));_0x318f73[_0x5d5e('0x50')]=util['format'](_0x5d5e('0x51'),_0x3c8dae[_0x5d5e('0x4d')],_0x318f73[_0x5d5e('0x52')],md5(_0x318f73[_0x5d5e('0x52')]));}else{_0x318f73['recordingURL']='';}headers[_0x5d5e('0x53')]=getAuth(_0x3c8dae);return getUser(_0x3c8dae,_0x34a6fb[_0x5d5e('0x54')])[_0x5d5e('0x1f')](function(_0xe648b8){_0x222df6=_0xe648b8;logger['info']('The\x20User\x20ID\x20is:',_0x222df6['id']);return getEndUser(_0x3c8dae,_0x318f73[_0x5d5e('0x55')],_0x318f73['calleridnum']);})[_0x5d5e('0x1f')](function(_0x44a86e){_0x357356=_0x44a86e;logger['info'](_0x5d5e('0x56'),_0x357356['id']);return getTicket(_0x3c8dae,_0x222df6,_0x357356,_0x3407bf,_0x318f73);})[_0x5d5e('0x1f')](function(_0x5cd0af){if(_0x5cd0af){logger[_0x5d5e('0xf')]('The\x20Ticket\x20ID\x20is:',_0x5cd0af['id']);switch(_0x3c8dae[_0x5d5e('0x40')]){case _0x5d5e('0x57'):logger[_0x5d5e('0xf')](_0x5d5e('0x4e'),_0x5d5e('0x58'));return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x59'),_0x3c8dae[_0x5d5e('0x13')],_0x222df6['id'],_0x5cd0af['id']),'method':_0x5d5e('0x14')});case _0x5d5e('0x5a'):logger[_0x5d5e('0xf')](_0x5d5e('0x4e'),_0x5d5e('0x5b'));emit(util[_0x5d5e('0x11')](_0x5d5e('0x5c'),_0x34a6fb[_0x5d5e('0x17')]),_0x5d5e('0x5d'),{'uri':util['format']('%s/agent/tickets/%s',_0x3c8dae[_0x5d5e('0x13')][_0x5d5e('0x5e')](_0x5d5e('0x5f'),''),_0x5cd0af['id'])});break;default:logger[_0x5d5e('0x60')](_0x5d5e('0x4e'),_0x5d5e('0x61'));}}})[_0x5d5e('0x62')](function(_0x3c082c){logger[_0x5d5e('0x60')](_0x5d5e('0x63'),util[_0x5d5e('0x64')](_0x3c082c,{'showHidden':!![],'depth':null}));});};exports[_0x5d5e('0x65')]=function(_0x24dfca,_0x217fa0,_0xdd0795,_0x3f1f5b,_0x2276ce,_0xe5d070,_0x698409){var _0x21e6a4,_0x23d50d;_0xe5d070[_0x5d5e('0x13')]=intUtil[_0x5d5e('0x4c')](_0xe5d070['remoteUri']);_0xe5d070[_0x5d5e('0x4d')]=intUtil[_0x5d5e('0x4c')](_0xe5d070[_0x5d5e('0x4d')]);if(_0x698409&&_0x698409[_0x5d5e('0x66')]&&_0x698409['recordingFormat']!==_0x5d5e('0x67')){logger[_0x5d5e('0xf')](_0x5d5e('0x68'),'Recording\x20is\x20enabled!');_0x217fa0['recordingURL']=util[_0x5d5e('0x11')](_0x5d5e('0x51'),_0xe5d070[_0x5d5e('0x4d')],_0x217fa0[_0x5d5e('0x52')],md5(_0x217fa0[_0x5d5e('0x52')]));}headers[_0x5d5e('0x53')]=getAuth(_0xe5d070);return getUser(_0xe5d070,_0x3f1f5b['email'])[_0x5d5e('0x1f')](function(_0x207173){_0x21e6a4=_0x207173;logger[_0x5d5e('0xf')](_0x5d5e('0x69'),_0x21e6a4['id']);return getEndUser(_0xe5d070,_0x217fa0['destcalleridname'],_0x217fa0[_0x5d5e('0x6a')]);})[_0x5d5e('0x1f')](function(_0x1fb0c1){_0x23d50d=_0x1fb0c1;logger[_0x5d5e('0xf')]('The\x20Enduser\x20ID\x20is:',_0x23d50d['id']);return getTicket(_0xe5d070,_0x21e6a4,_0x23d50d,_0xdd0795,_0x217fa0);})[_0x5d5e('0x1f')](function(_0x22c96c){if(_0x22c96c){logger[_0x5d5e('0xf')](_0x5d5e('0x6b'),_0x22c96c['id']);switch(_0xe5d070[_0x5d5e('0x40')]){case'integrationTab':logger['info'](_0x5d5e('0x68'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x5d5e('0x11')](_0x5d5e('0x59'),_0xe5d070[_0x5d5e('0x13')],_0x21e6a4['id'],_0x22c96c['id']),'method':'POST'});case _0x5d5e('0x5a'):logger[_0x5d5e('0xf')]('[OUTBOUND]',_0x5d5e('0x5b'));emit(util[_0x5d5e('0x11')](_0x5d5e('0x5c'),_0x3f1f5b[_0x5d5e('0x17')]),_0x5d5e('0x5d'),{'uri':util[_0x5d5e('0x11')](_0x5d5e('0x6c'),_0xe5d070[_0x5d5e('0x13')]['replace'](_0x5d5e('0x5f'),''),_0x22c96c['id'])});break;default:logger[_0x5d5e('0x60')](_0x5d5e('0x68'),_0x5d5e('0x61'));}}})[_0x5d5e('0x62')](function(_0x229df7){logger['error'](_0x5d5e('0x6d'),util[_0x5d5e('0x64')](_0x229df7,{'showHidden':!![],'depth':null}));});};exports[_0x5d5e('0x6e')]=function(_0x2dd997,_0x3dff1e,_0x20db7f,_0xd2a76,_0x3647a5,_0x5c6c03){var _0x2d50d1,_0x2dc715;_0x5c6c03['remoteUri']=intUtil[_0x5d5e('0x4c')](_0x5c6c03[_0x5d5e('0x13')]);_0x5c6c03['serverUrl']=intUtil['stripTrailingSlash'](_0x5c6c03[_0x5d5e('0x4d')]);if(_0x3647a5&&_0x3647a5[_0x5d5e('0x6f')]){logger[_0x5d5e('0xf')]('['+_0x3dff1e[_0x5d5e('0x70')][_0x5d5e('0x71')]()+']',_0x5d5e('0x4f'));_0x3dff1e['recordingURL']=util[_0x5d5e('0x11')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5c6c03['serverUrl'],_0x3dff1e[_0x5d5e('0x52')],md5(_0x3dff1e['uniqueid']));}else{_0x3dff1e[_0x5d5e('0x50')]='';}headers[_0x5d5e('0x53')]=getAuth(_0x5c6c03);return getUser(_0x5c6c03)[_0x5d5e('0x1f')](function(_0xefbd15){_0x2d50d1=_0xefbd15;logger[_0x5d5e('0xf')]('The\x20User\x20ID\x20is:',_0x2d50d1['id']);return getEndUser(_0x5c6c03,_0x3dff1e[_0x5d5e('0x55')],_0x3dff1e[_0x5d5e('0x72')]);})[_0x5d5e('0x1f')](function(_0xc7fbf3){_0x2dc715=_0xc7fbf3;logger['info'](_0x5d5e('0x56'),_0x2dc715['id']);return getTicket(_0x5c6c03,_0x2d50d1,_0x2dc715,_0x20db7f,_0x3dff1e);})[_0x5d5e('0x1f')](function(_0x3118de){if(_0x3118de){logger['info'](_0x5d5e('0x6b'),_0x3118de['id']);}})['catch'](function(_0x39d071){logger['error']('['+_0x3dff1e['lastevent'][_0x5d5e('0x71')]()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x5d5e('0x64')](_0x39d071,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa663=['push','variableName','custom_fields','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','outbound','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','unmanaged','lastevent','toUpperCase','\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','remoteUri','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','user','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','token','username','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','forEach','includes','string','picklist','type','customField','nameField','toLowerCase','content','idField'];(function(_0x133c58,_0x5d85f2){var _0x5937d5=function(_0x5d27fc){while(--_0x5d27fc){_0x133c58['push'](_0x133c58['shift']());}};_0x5937d5(++_0x5d85f2);}(_0xa663,0x9d));var _0x3a66=function(_0x3c0c96,_0x449674){_0x3c0c96=_0x3c0c96-0x0;var _0x1780ec=_0xa663[_0x3c0c96];return _0x1780ec;};'use strict';var _=require(_0x3a66('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x3a66('0x1'));var Redis=require(_0x3a66('0x2'));var intUtil=require(_0x3a66('0x3'));var config=require(_0x3a66('0x4'));var logger=require(_0x3a66('0x5'))(_0x3a66('0x6'));config[_0x3a66('0x7')]=_[_0x3a66('0x8')](config['redis'],{'host':_0x3a66('0x9'),'port':0x18eb});var io=require(_0x3a66('0xa'))(new Redis(config[_0x3a66('0x7')]));function emit(_0x5df8fd,_0x29dcbf,_0x58b4c0){io['to'](_0x5df8fd)[_0x3a66('0xb')](_0x29dcbf,_0x58b4c0);}var headers={'Content-Type':_0x3a66('0xc'),'Accept':'application/json'};function getTicket(_0x2c7ceb,_0xba4ea0,_0x196f9f,_0xc19cb0,_0x24f954){logger[_0x3a66('0xd')](_0x3a66('0xe'));return request({'uri':util[_0x3a66('0xf')](_0x3a66('0x10'),_0x2c7ceb[_0x3a66('0x11')]),'method':'POST','body':{'ticket':_[_0x3a66('0x12')]({'requester_id':_0x196f9f['id'],'submitter_id':_0xba4ea0?_0xba4ea0['id']:undefined,'assignee_id':_0xba4ea0?_0xba4ea0['id']:undefined,'tags':getTags(_0xc19cb0[_0x3a66('0x13')],_0x3a66('0x14')),'subject':intUtil[_0x3a66('0x15')](_0xc19cb0[_0x3a66('0x16')],_0x24f954,'\x20'),'description':intUtil[_0x3a66('0x15')](_0xc19cb0[_0x3a66('0x17')],_0x24f954,'\x0a'),'comment':{'public':![],'body':intUtil[_0x3a66('0x15')](_0xc19cb0['Descriptions'],_0x24f954,'\x0a')}},getCustomFields(_0xc19cb0[_0x3a66('0x18')],_0x24f954))}})[_0x3a66('0x19')](function(_0x39974b){logger[_0x3a66('0xd')](_0x3a66('0x1a'));return _0x39974b['ticket'];});}function getUser(_0x2d6783,_0x4d4a7a){if(intUtil[_0x3a66('0x1b')](_0x4d4a7a)){logger['info'](_0x3a66('0x1c'),_0x4d4a7a);return request({'uri':util[_0x3a66('0xf')](_0x3a66('0x1d'),_0x2d6783[_0x3a66('0x11')]),'qs':{'query':util[_0x3a66('0xf')](_0x3a66('0x1e'),_0x4d4a7a)}})[_0x3a66('0x19')](function(_0x1f96d1){if(_0x1f96d1[_0x3a66('0x1f')]){logger['info'](_0x3a66('0x20'));return _[_0x3a66('0x21')](_0x1f96d1[_0x3a66('0x22')],{'email':_0x4d4a7a,'role':_0x3a66('0x23')});}else{logger['info'](_0x3a66('0x24'));return request({'uri':util[_0x3a66('0xf')](_0x3a66('0x25'),_0x2d6783[_0x3a66('0x11')])})[_0x3a66('0x19')](function(_0x4539ab){logger[_0x3a66('0xd')]('Admin\x20account\x20selected.');return _0x4539ab[_0x3a66('0x26')];});}});}else{logger[_0x3a66('0xd')](_0x3a66('0x24'));return request({'uri':util[_0x3a66('0xf')](_0x3a66('0x25'),_0x2d6783[_0x3a66('0x11')])})[_0x3a66('0x19')](function(_0x488df8){logger[_0x3a66('0xd')](_0x3a66('0x27'));return _0x488df8[_0x3a66('0x26')];});}}function getEndUser(_0x5b778e,_0x34126c,_0x56399a){logger[_0x3a66('0xd')](_0x3a66('0x28'),_0x56399a);return request({'uri':util['format'](_0x3a66('0x1d'),_0x5b778e['remoteUri']),'qs':{'query':util[_0x3a66('0xf')]('type:user\x20role:end-user\x20phone:%s',_0x56399a)}})['then'](function(_0x3f4b36){var _0x607a90;if(_0x3f4b36[_0x3a66('0x22')][_0x3a66('0x29')]){_0x3f4b36[_0x3a66('0x22')]=_[_0x3a66('0x2a')](_0x3f4b36[_0x3a66('0x22')],{'suspended':![],'role':_0x3a66('0x2b')});if(_0x3f4b36['results'][_0x3a66('0x29')]){_0x607a90=_[_0x3a66('0x2c')](_0x3f4b36[_0x3a66('0x22')]);}}if(_0x607a90){logger[_0x3a66('0xd')]('Enduser\x20found!');return _0x607a90;}else{logger[_0x3a66('0xd')](_0x3a66('0x2d'));return request({'uri':util[_0x3a66('0xf')](_0x3a66('0x2e'),_0x5b778e[_0x3a66('0x11')]),'method':_0x3a66('0x2f'),'body':{'user':{'role':_0x3a66('0x2b'),'name':util[_0x3a66('0xf')](_0x3a66('0x30'),_0x34126c||_0x56399a),'phone':_0x56399a}}})[_0x3a66('0x19')](function(_0x353e10){logger['info'](_0x3a66('0x31'));return _0x353e10[_0x3a66('0x26')];});}});}function getAuth(_0x38d3ab){var _0x39d403;if(_0x38d3ab[_0x3a66('0x32')]===_0x3a66('0x33')){_0x39d403=util['format'](_0x3a66('0x34'),_0x38d3ab['username'],_0x38d3ab[_0x3a66('0x33')]);}else if(_0x38d3ab[_0x3a66('0x32')]===_0x3a66('0x35')){_0x39d403=util[_0x3a66('0xf')]('%s/token:%s',_0x38d3ab[_0x3a66('0x36')],_0x38d3ab[_0x3a66('0x35')]);}return util[_0x3a66('0xf')](_0x3a66('0x37'),new Buffer(_0x39d403)[_0x3a66('0x38')](_0x3a66('0x39')));}function request(_0x24539b){logger[_0x3a66('0x3a')](_0x3a66('0x3b'),JSON[_0x3a66('0x3c')](_0x24539b));return rp(_['defaults'](_0x24539b,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x2038bc,_0x162dd7){var _0x80d904=[];if(_0x2038bc&&_0x2038bc[_0x3a66('0x29')]>0x0){_0x80d904=_['map'](_0x2038bc,_0x162dd7);}return _0x80d904;}function getCustomFields(_0xa309b4,_0x503c13){var _0x2f0517=[];var _0xbc428f={'custom_fields':[]};if(_0xa309b4[_0x3a66('0x29')]>0x0){_[_0x3a66('0x3d')](_0xa309b4,function(_0x3a713c){if(_[_0x3a66('0x3e')]([_0x3a66('0x3f'),_0x3a66('0x40')],_0x3a713c[_0x3a66('0x41')])&&_0x3a713c['nameField']&&!_0x3a713c[_0x3a66('0x42')]){_0xbc428f[_0x3a713c[_0x3a66('0x43')][_0x3a66('0x44')]()]=_0x3a713c[_0x3a66('0x45')][_0x3a66('0x38')]();}else if(_[_0x3a66('0x3e')]([_0x3a66('0x3f'),'picklist'],_0x3a713c[_0x3a66('0x41')])&&_0x3a713c[_0x3a66('0x46')]&&_0x3a713c['customField']){_0xbc428f['custom_fields'][_0x3a66('0x47')]({'id':_0x3a713c[_0x3a66('0x46')],'value':_0x3a713c[_0x3a66('0x45')][_0x3a66('0x38')]()});}else if(_0x3a713c[_0x3a66('0x41')]==='variable'&&_0x3a713c[_0x3a66('0x48')]&&_0x3a713c[_0x3a66('0x46')]&&_0x3a713c[_0x3a66('0x42')]){_0x503c13[_0x3a713c[_0x3a66('0x48')]]&&_0xbc428f[_0x3a66('0x49')]['push']({'id':_0x3a713c['idField'],'value':_0x503c13[_0x3a713c[_0x3a66('0x48')]]['toString']()});}else if(_0x3a713c[_0x3a66('0x41')]==='customVariable'&&_0x3a713c[_0x3a66('0x4a')]&&_0x3a713c[_0x3a66('0x4a')][_0x3a66('0x14')]&&_0x3a713c[_0x3a66('0x46')]&&_0x3a713c['customField']){_0x503c13[_0x3a713c['Variable'][_0x3a66('0x14')]['toLowerCase']()]&&_0xbc428f[_0x3a66('0x49')][_0x3a66('0x47')]({'id':_0x3a713c['idField'],'value':_0x503c13[_0x3a713c[_0x3a66('0x4a')]['name'][_0x3a66('0x44')]()][_0x3a66('0x38')]()});}});}return _0xbc428f;}exports[_0x3a66('0x4b')]=function(_0x163241,_0x23f2d7,_0x388950,_0x6d8be3,_0x5953f5,_0x303d44){var _0x5e9b72,_0x2e0fa3;_0x303d44[_0x3a66('0x11')]=intUtil[_0x3a66('0x4c')](_0x303d44[_0x3a66('0x11')]);_0x303d44[_0x3a66('0x4d')]=intUtil[_0x3a66('0x4c')](_0x303d44[_0x3a66('0x4d')]);if(_0x5953f5&&_0x5953f5[_0x3a66('0x4e')]){logger[_0x3a66('0xd')](_0x3a66('0x4f'),'Recording\x20is\x20enabled!');_0x23f2d7[_0x3a66('0x50')]=util[_0x3a66('0xf')](_0x3a66('0x51'),_0x303d44['serverUrl'],_0x23f2d7[_0x3a66('0x52')],md5(_0x23f2d7['uniqueid']));}else{_0x23f2d7[_0x3a66('0x50')]='';}headers[_0x3a66('0x53')]=getAuth(_0x303d44);return getUser(_0x303d44,_0x6d8be3[_0x3a66('0x54')])[_0x3a66('0x19')](function(_0x3e7cbc){_0x5e9b72=_0x3e7cbc;logger[_0x3a66('0xd')](_0x3a66('0x55'),_0x5e9b72['id']);return getEndUser(_0x303d44,_0x23f2d7[_0x3a66('0x56')],_0x23f2d7[_0x3a66('0x57')]);})[_0x3a66('0x19')](function(_0x453751){_0x2e0fa3=_0x453751;logger['info'](_0x3a66('0x58'),_0x2e0fa3['id']);return getTicket(_0x303d44,_0x5e9b72,_0x2e0fa3,_0x388950,_0x23f2d7);})[_0x3a66('0x19')](function(_0x189c2b){if(_0x189c2b){logger[_0x3a66('0xd')](_0x3a66('0x59'),_0x189c2b['id']);switch(_0x303d44[_0x3a66('0x41')]){case _0x3a66('0x5a'):logger['info'](_0x3a66('0x4f'),_0x3a66('0x5b'));return request({'uri':util['format'](_0x3a66('0x5c'),_0x303d44[_0x3a66('0x11')],_0x5e9b72['id'],_0x189c2b['id']),'method':_0x3a66('0x2f')});case _0x3a66('0x5d'):logger['info'](_0x3a66('0x4f'),_0x3a66('0x5e'));emit(util['format'](_0x3a66('0x5f'),_0x6d8be3['name']),_0x3a66('0x60'),{'uri':util[_0x3a66('0xf')](_0x3a66('0x61'),_0x303d44[_0x3a66('0x11')][_0x3a66('0x62')](_0x3a66('0x63'),''),_0x189c2b['id'])});break;default:logger[_0x3a66('0x64')](_0x3a66('0x4f'),_0x3a66('0x65'));}}})[_0x3a66('0x66')](function(_0x6caf74){logger[_0x3a66('0x64')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0x3a66('0x67')](_0x6caf74,{'showHidden':!![],'depth':null}));});};exports[_0x3a66('0x68')]=function(_0x11a65d,_0x3be45c,_0x3e99b2,_0x412351,_0x5cffbc,_0x2826de,_0x3a3966){var _0x5218e4,_0x46c612;_0x2826de[_0x3a66('0x11')]=intUtil[_0x3a66('0x4c')](_0x2826de['remoteUri']);_0x2826de['serverUrl']=intUtil[_0x3a66('0x4c')](_0x2826de[_0x3a66('0x4d')]);if(_0x3a3966&&_0x3a3966[_0x3a66('0x69')]&&_0x3a3966[_0x3a66('0x69')]!=='none'){logger[_0x3a66('0xd')](_0x3a66('0x6a'),'Recording\x20is\x20enabled!');_0x3be45c[_0x3a66('0x50')]=util[_0x3a66('0xf')](_0x3a66('0x51'),_0x2826de[_0x3a66('0x4d')],_0x3be45c[_0x3a66('0x52')],md5(_0x3be45c[_0x3a66('0x52')]));}headers[_0x3a66('0x53')]=getAuth(_0x2826de);return getUser(_0x2826de,_0x412351['email'])[_0x3a66('0x19')](function(_0xf30d19){_0x5218e4=_0xf30d19;logger['info'](_0x3a66('0x55'),_0x5218e4['id']);return getEndUser(_0x2826de,_0x3be45c[_0x3a66('0x6b')],_0x3be45c[_0x3a66('0x6c')]);})[_0x3a66('0x19')](function(_0x3a402f){_0x46c612=_0x3a402f;logger['info']('The\x20Enduser\x20ID\x20is:',_0x46c612['id']);return getTicket(_0x2826de,_0x5218e4,_0x46c612,_0x3e99b2,_0x3be45c);})['then'](function(_0x15e783){if(_0x15e783){logger[_0x3a66('0xd')]('The\x20Ticket\x20ID\x20is:',_0x15e783['id']);switch(_0x2826de[_0x3a66('0x41')]){case _0x3a66('0x5a'):logger[_0x3a66('0xd')]('[OUTBOUND]',_0x3a66('0x5b'));return request({'uri':util['format'](_0x3a66('0x5c'),_0x2826de['remoteUri'],_0x5218e4['id'],_0x15e783['id']),'method':'POST'});case _0x3a66('0x5d'):logger['info'](_0x3a66('0x6a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3a66('0xf')](_0x3a66('0x5f'),_0x412351[_0x3a66('0x14')]),_0x3a66('0x60'),{'uri':util[_0x3a66('0xf')](_0x3a66('0x61'),_0x2826de[_0x3a66('0x11')][_0x3a66('0x62')]('/api/v2',''),_0x15e783['id'])});break;default:logger[_0x3a66('0x64')](_0x3a66('0x6a'),_0x3a66('0x65'));}}})[_0x3a66('0x66')](function(_0x3aa0a2){logger[_0x3a66('0x64')](_0x3a66('0x6d'),util[_0x3a66('0x67')](_0x3aa0a2,{'showHidden':!![],'depth':null}));});};exports[_0x3a66('0x6e')]=function(_0x1d6943,_0x7c10d,_0x3ee5b5,_0x225295,_0x15cc8d,_0x5ebef4){var _0x5aa904,_0x4dc326;_0x5ebef4[_0x3a66('0x11')]=intUtil['stripTrailingSlash'](_0x5ebef4['remoteUri']);_0x5ebef4[_0x3a66('0x4d')]=intUtil[_0x3a66('0x4c')](_0x5ebef4[_0x3a66('0x4d')]);if(_0x15cc8d&&_0x15cc8d['monitor_format']){logger['info']('['+_0x7c10d[_0x3a66('0x6f')][_0x3a66('0x70')]()+']','Recording\x20is\x20enabled!');_0x7c10d[_0x3a66('0x50')]=util[_0x3a66('0xf')](_0x3a66('0x51'),_0x5ebef4['serverUrl'],_0x7c10d[_0x3a66('0x52')],md5(_0x7c10d[_0x3a66('0x52')]));}else{_0x7c10d[_0x3a66('0x50')]='';}headers[_0x3a66('0x53')]=getAuth(_0x5ebef4);return getUser(_0x5ebef4)['then'](function(_0x3b082c){_0x5aa904=_0x3b082c;logger[_0x3a66('0xd')](_0x3a66('0x55'),_0x5aa904['id']);return getEndUser(_0x5ebef4,_0x7c10d[_0x3a66('0x56')],_0x7c10d[_0x3a66('0x57')]);})[_0x3a66('0x19')](function(_0x347f34){_0x4dc326=_0x347f34;logger[_0x3a66('0xd')](_0x3a66('0x58'),_0x4dc326['id']);return getTicket(_0x5ebef4,_0x5aa904,_0x4dc326,_0x3ee5b5,_0x7c10d);})[_0x3a66('0x19')](function(_0x35705c){if(_0x35705c){logger['info']('The\x20Ticket\x20ID\x20is:',_0x35705c['id']);}})[_0x3a66('0x66')](function(_0x3137af){logger[_0x3a66('0x64')]('['+_0x7c10d[_0x3a66('0x6f')]['toUpperCase']()+']'+_0x3a66('0x71'),util[_0x3a66('0x67')](_0x3137af,{'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 110502d..c23e116 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 _0x9034=['Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','complete','connect','Answered','rejected','Rejected','abandoned','timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','err','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','recordingFormat','email','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','trigger:browser:url','unmanaged','toUpperCase','lodash','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','includes','string','picklist','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientSecret','refresh_token','then','add','expires_in','seconds','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','isNil','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','data','code','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','Contacts','uri','Leads','nothing','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Creating\x20new\x20call...','profile','administrator','Subject','getString','Subjects','Description','Descriptions','Who_Id'];(function(_0x23dde1,_0x2050c8){var _0xb71c8a=function(_0x19dd2a){while(--_0x19dd2a){_0x23dde1['push'](_0x23dde1['shift']());}};_0xb71c8a(++_0x2050c8);}(_0x9034,0x178));var _0x4903=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x9034[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x4903('0x0'));var rp=require('request-promise');var md5=require(_0x4903('0x1'));var util=require(_0x4903('0x2'));var intUtil=require(_0x4903('0x3'));var moment=require(_0x4903('0x4'));var Redis=require(_0x4903('0x5'));var BPromise=require(_0x4903('0x6'));var config=require(_0x4903('0x7'));var logger=require('../../../../config/logger')(_0x4903('0x8'));config[_0x4903('0x9')]=_[_0x4903('0xa')](config[_0x4903('0x9')],{'host':_0x4903('0xb'),'port':0x18eb});var io=require(_0x4903('0xc'))(new Redis(config['redis']));function emit(_0xd79b23,_0x5ce539,_0x5397f9){io['to'](_0xd79b23)[_0x4903('0xd')](_0x5ce539,_0x5397f9);}function request(_0x5d87fa){logger[_0x4903('0xe')](_0x4903('0xf'),JSON[_0x4903('0x10')](_0x5d87fa));return rp(_0x5d87fa);}function getCustomFields(_0x52de39,_0x34d55f){var _0x24f289={};if(_0x52de39[_0x4903('0x11')]>0x0){_[_0x4903('0x12')](_0x52de39,function(_0x2e8493){if(_[_0x4903('0x13')]([_0x4903('0x14'),_0x4903('0x15')],_0x2e8493['type'])&&_0x2e8493['idField']){_0x24f289[_0x2e8493[_0x4903('0x16')]]=_0x2e8493[_0x4903('0x17')][_0x4903('0x18')]();}else if(_0x2e8493[_0x4903('0x19')]===_0x4903('0x1a')&&_0x2e8493[_0x4903('0x1b')]&&_0x2e8493['idField']&&_0x34d55f[_0x2e8493['variableName']]){_0x24f289[_0x2e8493['idField']]=_0x34d55f[_0x2e8493[_0x4903('0x1b')]][_0x4903('0x18')]();}else if(_0x2e8493[_0x4903('0x19')]===_0x4903('0x1c')&&_0x2e8493['Variable']&&_0x2e8493[_0x4903('0x1d')][_0x4903('0x1e')]&&_0x2e8493['idField']&&_0x34d55f[_0x2e8493[_0x4903('0x1d')]['name'][_0x4903('0x1f')]()]){_0x24f289[_0x2e8493[_0x4903('0x16')]]=_0x34d55f[_0x2e8493[_0x4903('0x1d')][_0x4903('0x1e')][_0x4903('0x1f')]()][_0x4903('0x18')]();}});}return _0x24f289;}function getName(_0x5332ee){if(_0x5332ee[_0x4903('0x20')]('\x20')>0x0){var _0x54b3ff=_0x5332ee['split'](/ (.+)/);if(_0x54b3ff[0x1]){return _0x54b3ff;}}return[_0x5332ee,_0x5332ee];}var accountsTokens={};function getAccessToken(_0x43e1ea){return new Promise(function(_0x14e933,_0x1a0e38){if(!_['isNil'](accountsTokens[_0x43e1ea['id']])&&!_['isNil'](accountsTokens[_0x43e1ea['id']]['access_token'])){if(moment()['isBefore'](accountsTokens[_0x43e1ea['id']]['expires_in'])){_0x14e933(accountsTokens[_0x43e1ea['id']][_0x4903('0x21')]);}}var _0x67d7ff;switch(_0x43e1ea[_0x4903('0x22')]){case'US':_0x67d7ff=_0x4903('0x23');break;case'AU':_0x67d7ff='https://accounts.zoho.com.au';break;case'EU':_0x67d7ff=_0x4903('0x24');break;case'IN':_0x67d7ff=_0x4903('0x25');break;case'CN':_0x67d7ff=_0x4903('0x26');break;default:_0x67d7ff='https://accounts.zoho.eu';break;}var _0x553bad={'method':_0x4903('0x27'),'uri':_0x67d7ff+_0x4903('0x28'),'qs':{'refresh_token':_0x43e1ea[_0x4903('0x29')],'client_id':_0x43e1ea['clientId'],'client_secret':_0x43e1ea[_0x4903('0x2a')],'grant_type':_0x4903('0x2b')},'json':!![]};return rp(_0x553bad)[_0x4903('0x2c')](function(_0x2a96e6){accountsTokens[_0x43e1ea['id']]={'access_token':_0x2a96e6[_0x4903('0x21')],'expires_in':moment()[_0x4903('0x2d')](_0x2a96e6[_0x4903('0x2e')],_0x4903('0x2f'))};_0x14e933(_0x2a96e6[_0x4903('0x21')]);})['catch'](function(_0x3cd7dd){logger[_0x4903('0x30')](_0x4903('0x31'),_0x3cd7dd[_0x4903('0x32')]);_0x1a0e38(_0x3cd7dd);});});}function getUser(_0xe03052,_0x36b340,_0x20a90e,_0x58a2dc){logger[_0x4903('0x33')](_0x4903('0x34'));return request({'method':_0x4903('0x35'),'uri':util[_0x4903('0x36')](_0x4903('0x37'),_0x36b340),'qs':{'type':_0x4903('0x38')},'headers':{'Authorization':_0x4903('0x39')+_0xe03052},'json':!![]})['then'](function(_0x4fc70e){if(_0x4fc70e['users']){var _0x7b9034=-0x1;if(_[_0x4903('0x3a')](_0x4fc70e[_0x4903('0x3b')])){if(!_[_0x4903('0x3c')](_0x58a2dc)){_0x7b9034=_[_0x4903('0x3d')](_0x4fc70e[_0x4903('0x3b')],function(_0x155475){return _0x155475['email']===_0x58a2dc;});}if(_0x7b9034>=0x0){logger[_0x4903('0x33')](_0x4903('0x3e'));}else{logger[_0x4903('0x33')]('Using\x20the\x20admin\x20account!');_0x7b9034=_[_0x4903('0x3d')](_0x4fc70e['users'],function(_0x591a28){return _0x591a28['profile'][_0x4903('0x1e')]==='Administrator';});}return _0x4fc70e[_0x4903('0x3b')][_0x7b9034];}else{if(_0x4fc70e['user']['profile']['name']==='Administrator'){logger[_0x4903('0x33')](_0x4903('0x3f'));user=_0x4fc70e['user'];return user;}else{logger[_0x4903('0x30')](_0x4903('0x40'),JSON[_0x4903('0x10')](_0x4fc70e));throw new Error(_0x4903('0x41')+JSON[_0x4903('0x10')](_0x4fc70e));}}}else{logger[_0x4903('0x30')](_0x4903('0x40'),JSON[_0x4903('0x10')](_0x4fc70e));throw new Error(_0x4903('0x41')+JSON[_0x4903('0x10')](_0x4fc70e));}})[_0x4903('0x42')](function(_0x227f71){console['error'](_0x227f71);});}function getZohoUser(_0x564a9f,_0x3e81ca){return new BPromise(function(_0x2d3cee,_0x21e567){request(_0x564a9f)['then'](function(_0x57d09f){var _0x261831=null;if(_0x57d09f){_0x261831=_0x57d09f['data'][0x0];_0x261831[_0x4903('0x43')]=_0x3e81ca;}_0x2d3cee(_0x261831);})[_0x4903('0x42')](function(_0x7eecbb){_0x21e567(_0x7eecbb);});});}function createEndUser(_0x1a306e,_0x247b3a,_0x2a1226,_0x548bd8,_0x321eaf,_0x50509e){var _0x2a1226=getName(_0x2a1226);return request({'method':'POST','uri':_0x4903('0x44')+_0x247b3a+_0x4903('0x45')+_[_0x4903('0x46')](_0x50509e[_0x4903('0x47')])+'s','body':{'data':[{'Last_Name':_0x2a1226[0x1],'First_Name':_0x2a1226[0x0],'Phone':_0x548bd8,'Owner':{'name':!_[_0x4903('0x3c')](_0x321eaf[_0x4903('0x48')][_0x4903('0x1e')])?_0x321eaf[_0x4903('0x48')][_0x4903('0x1e')]:!_[_0x4903('0x3c')](_0x321eaf[_0x4903('0x49')])?_0x321eaf[_0x4903('0x49')]+'\x20'+_0x321eaf[_0x4903('0x4a')]:_0x321eaf[_0x4903('0x4a')],'id':_0x321eaf['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x1a306e},'json':!![]})['then'](function(_0x189f9b){if(_0x189f9b&&_0x189f9b[_0x4903('0x4b')][0x0][_0x4903('0x4c')]===_0x4903('0x4d')){var _0x101c56=_0x189f9b[_0x4903('0x4b')][0x0][_0x4903('0x4e')];_0x101c56['enduserType']=_['startCase'](_0x50509e[_0x4903('0x47')])+'s';return _0x101c56;}logger[_0x4903('0x30')](_0x4903('0x40'),JSON[_0x4903('0x10')](data));throw new Error(_0x4903('0x4f')+JSON[_0x4903('0x10')](data));})['catch'](function(_0x30441b){console[_0x4903('0x50')](_0x4903('0x51'),_0x30441b);});}function getEndUser(_0x32db8e,_0x2f76d3,_0x4056a6,_0x1e1ee0,_0x59a61a,_0xbfbc8,_0x2f2a51){var _0x5ada91={'method':'GET','uri':'','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x32db8e},'json':!![]};switch(_0x2f2a51['moduleSearch']){case'contact_lead':_0x5ada91['uri']='https://www.zohoapis.'+_0x2f76d3+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x59a61a+'))';return getZohoUser(_0x5ada91,_0x4903('0x52'))['then'](function(_0x52519f){if(_0x52519f)return _0x52519f;_0x5ada91[_0x4903('0x53')]='https://www.zohoapis.'+_0x2f76d3+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x59a61a+'))';return getZohoUser(_0x5ada91,_0x4903('0x54'))[_0x4903('0x2c')](function(_0xae812d){if(_0xae812d)return _0xae812d;if(_0x2f2a51[_0x4903('0x47')]!=_0x4903('0x55')){return createEndUser(_0x32db8e,_0x2f76d3,_0x1e1ee0,_0x59a61a,_0xbfbc8,_0x2f2a51);}else{return{};}});});break;case _0x4903('0x56'):_0x5ada91[_0x4903('0x53')]=_0x4903('0x44')+_0x2f76d3+_0x4903('0x57')+_0x59a61a+'))';return getZohoUser(_0x5ada91,_0x4903('0x52'))[_0x4903('0x2c')](function(_0x180d5a){if(_0x180d5a)return _0x180d5a;if(_0x2f2a51[_0x4903('0x47')]!=_0x4903('0x55')){return createEndUser(_0x32db8e,_0x2f76d3,_0x1e1ee0,_0x59a61a,_0xbfbc8,_0x2f2a51);}else{return{};}});break;case _0x4903('0x58'):_0x5ada91['uri']=_0x4903('0x44')+_0x2f76d3+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x59a61a+'))';return getZohoUser(_0x5ada91,_0x4903('0x54'))[_0x4903('0x2c')](function(_0x3d08c7){if(_0x3d08c7)return _0x3d08c7;if(_0x2f2a51[_0x4903('0x47')]!=_0x4903('0x55')){return createEndUser(_0x32db8e,_0x2f76d3,_0x1e1ee0,_0x59a61a,_0xbfbc8,_0x2f2a51);}else{return{};}});break;}}function getCall(_0x58751a,_0x3115d5,_0x1d0046,_0x2bf0f0,_0x3e51bc,_0x2a0ed0,_0x5342e0,_0x177523){logger[_0x4903('0x33')](_0x4903('0x59'));var _0x1a032a={};_0x1a032a['Owner']={'name':!_[_0x4903('0x3c')](_0x2bf0f0['role']['name'])&&!_[_0x4903('0x3c')](_0x2bf0f0[_0x4903('0x5a')][_0x4903('0x1e')])&&_0x2bf0f0['profile']['name']===_0x4903('0x5b')?_0x2bf0f0[_0x4903('0x48')][_0x4903('0x1e')]:!_[_0x4903('0x3c')](_0x2bf0f0['first_name'])?_0x2bf0f0[_0x4903('0x49')]+'\x20'+_0x2bf0f0[_0x4903('0x4a')]:_0x2bf0f0[_0x4903('0x4a')],'id':_0x2bf0f0['id']};_0x1a032a[_0x4903('0x5c')]=intUtil[_0x4903('0x5d')](_0x2a0ed0[_0x4903('0x5e')],_0x5342e0,'\x20');_0x1a032a[_0x4903('0x5f')]=intUtil['getString'](_0x2a0ed0[_0x4903('0x60')],_0x5342e0,'\x0a');if(_0x3e51bc['enduserType']===_0x4903('0x52')){_0x1a032a[_0x4903('0x61')]={'name':!_[_0x4903('0x3c')](_0x3e51bc[_0x4903('0x62')])?_0x3e51bc[_0x4903('0x62')]:!_['isNil'](_0x3e51bc[_0x4903('0x63')])?_0x3e51bc[_0x4903('0x63')]+'\x20'+_0x3e51bc[_0x4903('0x64')]:_0x3e51bc[_0x4903('0x64')],'id':_0x3e51bc['id']};}if(_0x3e51bc[_0x4903('0x43')]===_0x4903('0x54')){_0x1a032a[_0x4903('0x65')]={'name':!_[_0x4903('0x3c')](_0x3e51bc[_0x4903('0x62')])?_0x3e51bc['Full_Name']:!_[_0x4903('0x3c')](_0x3e51bc[_0x4903('0x63')])?_0x3e51bc[_0x4903('0x63')]+'\x20'+_0x3e51bc[_0x4903('0x64')]:_0x3e51bc[_0x4903('0x64')],'id':_0x3e51bc['id']};_0x1a032a[_0x4903('0x66')]=_[_0x4903('0x46')](_0x3e51bc[_0x4903('0x43')]);}if(_0x5342e0[_0x4903('0x67')]){_0x1a032a[_0x4903('0x68')]=moment[_0x4903('0x69')](parseInt(_0x5342e0[_0x4903('0x67')])*0x3e8)['format'](_0x4903('0x6a'));}else if(_0x5342e0[_0x4903('0x6b')]&&_0x5342e0[_0x4903('0x6c')]){_0x1a032a[_0x4903('0x68')]=moment[_0x4903('0x69')](moment(_0x5342e0[_0x4903('0x6c')],_0x4903('0x6d'))[_0x4903('0x6e')](moment(_0x5342e0[_0x4903('0x6f')],_0x4903('0x6d'))))[_0x4903('0x36')](_0x4903('0x6a'));}switch(_0x5342e0[_0x4903('0x70')]){case'called':_0x1a032a[_0x4903('0x71')]='Called';break;case _0x4903('0x72'):case _0x4903('0x73'):_0x1a032a[_0x4903('0x71')]=_0x4903('0x74');break;case _0x4903('0x75'):_0x1a032a['Call_Result']=_0x4903('0x76');break;case _0x4903('0x77'):_0x1a032a['Call_Result']='Abandoned';break;case _0x4903('0x78'):_0x1a032a[_0x4903('0x71')]='Timeout';default:}_0x1a032a[_0x4903('0x79')]=(_0x177523===_0x4903('0x7a')?moment(_0x5342e0[_0x4903('0x6f')])[_0x4903('0x36')](_0x4903('0x6d')):moment(_0x5342e0[_0x4903('0x7b')])[_0x4903('0x36')](_0x4903('0x6d')))||moment()[_0x4903('0x36')]('YYYY-MM-DDTHH:mm:ss');_0x1a032a[_0x4903('0x7c')]=_0x177523||_0x4903('0x7d');_0x1a032a=_[_0x4903('0x7e')](_0x1a032a,getCustomFields(_0x2a0ed0[_0x4903('0x7f')],_0x5342e0));return request({'method':_0x4903('0x27'),'uri':_0x4903('0x44')+_0x3115d5+_0x4903('0x80'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x58751a},'body':{'data':[_0x1a032a]},'json':!![]})[_0x4903('0x2c')](function(_0x1c4552){if(_0x1c4552&&_0x1c4552['data'][0x0][_0x4903('0x4c')]===_0x4903('0x4d')){logger[_0x4903('0x33')](_0x4903('0x81'));return{'id':_0x1c4552['data'][0x0][_0x4903('0x4e')]['id']};}})[_0x4903('0x42')](function(_0x32bfa4){logger[_0x4903('0x33')](_0x4903('0x82'),_0x32bfa4[_0x4903('0x32')]);console[_0x4903('0x50')](_0x4903('0x82'),_0x32bfa4);});}exports['queue']=function(_0x5392f2,_0x1cded6,_0x40aaf9,_0x3ef8ee,_0x54a464,_0x2f1cec){var _0x5a2156,_0x1e4ac4,_0x37a36a;_0x2f1cec[_0x4903('0x83')]=intUtil[_0x4903('0x84')](_0x2f1cec[_0x4903('0x83')]);_0x2f1cec[_0x4903('0x85')]=intUtil[_0x4903('0x84')](_0x2f1cec[_0x4903('0x85')]);if(_0x54a464&&_0x54a464[_0x4903('0x86')]){logger['info'](_0x4903('0x87'),_0x4903('0x88'));_0x1cded6[_0x4903('0x89')]=_0x2f1cec[_0x4903('0x85')]+_0x4903('0x8a')+_0x1cded6[_0x4903('0x8b')]+_0x4903('0x8c')+md5(_0x1cded6['uniqueid']);}else{_0x1cded6[_0x4903('0x89')]='';}var _0x346309=_0x2f1cec[_0x4903('0x83')]===_0x4903('0x8d')?'eu':_0x4903('0x8e');return getAccessToken(_0x2f1cec)[_0x4903('0x2c')](function(_0x27f09b){_0x37a36a=_0x27f09b;return getUser(_0x37a36a,_0x346309,_0x2f1cec,_0x3ef8ee['email']);})[_0x4903('0x2c')](function(_0x106644){_0x5a2156=_0x106644;logger['info']('The\x20User\x20ID\x20is:',_0x5a2156['id']);return getEndUser(_0x37a36a,_0x346309,_0x2f1cec,_0x1cded6[_0x4903('0x8f')],_0x1cded6[_0x4903('0x90')],_0x5a2156,_0x40aaf9);})[_0x4903('0x2c')](function(_0x79582c){_0x1e4ac4=_0x79582c;return getCall(_0x37a36a,_0x346309,_0x2f1cec,_0x5a2156,_0x1e4ac4,_0x40aaf9,_0x1cded6,_0x4903('0x7d'));})['then'](function(_0x150fc0){if(_0x150fc0){logger[_0x4903('0x33')](_0x4903('0x91'),_0x150fc0['id']);logger[_0x4903('0x33')](_0x4903('0x87'),_0x4903('0x92'));emit(util[_0x4903('0x36')](_0x4903('0x93'),_0x3ef8ee['name']),'trigger:browser:url',{'uri':_0x4903('0x94')+_0x2f1cec[_0x4903('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x150fc0['id']});}})[_0x4903('0x42')](function(_0x35e7a2){logger[_0x4903('0x30')](_0x4903('0x87'),JSON[_0x4903('0x10')](_0x35e7a2));});};exports[_0x4903('0x7a')]=function(_0x1df196,_0x18414e,_0x1534b0,_0x55c731,_0x3d2f9b,_0x46cfa5,_0x5e84b9){var _0x11c17e,_0x3f4175,_0x2c2deb;_0x46cfa5['host']=intUtil[_0x4903('0x84')](_0x46cfa5[_0x4903('0x83')]);_0x46cfa5[_0x4903('0x85')]=intUtil[_0x4903('0x84')](_0x46cfa5['serverUrl']);if(_0x5e84b9&&_0x5e84b9[_0x4903('0x95')]&&_0x5e84b9[_0x4903('0x95')]!=='none'){logger[_0x4903('0x33')]('[OUTBOUND]',_0x4903('0x88'));_0x18414e[_0x4903('0x89')]=_0x46cfa5[_0x4903('0x85')]+_0x4903('0x8a')+_0x18414e[_0x4903('0x8b')]+'/downloads?type=uniqueid&token='+md5(_0x18414e[_0x4903('0x8b')]);}var _0x5551e9=_0x46cfa5['host']===_0x4903('0x8d')?'eu':_0x4903('0x8e');return getAccessToken(_0x46cfa5)[_0x4903('0x2c')](function(_0x717cc6){_0x2c2deb=_0x717cc6;return getUser(_0x2c2deb,_0x5551e9,_0x46cfa5,_0x55c731[_0x4903('0x96')]);})['then'](function(_0x212617){_0x11c17e=_0x212617;logger[_0x4903('0x33')]('The\x20User\x20ID\x20is:',_0x11c17e['id']);return getEndUser(_0x2c2deb,_0x5551e9,_0x46cfa5,_0x18414e[_0x4903('0x97')],_0x18414e[_0x4903('0x98')],_0x11c17e,_0x1534b0);})['then'](function(_0x4d3e5b){_0x3f4175=_0x4d3e5b;return getCall(_0x2c2deb,_0x5551e9,_0x46cfa5,_0x11c17e,_0x3f4175,_0x1534b0,_0x18414e,_0x4903('0x99'));})[_0x4903('0x2c')](function(_0x3b6580){if(_0x3b6580){logger[_0x4903('0x33')](_0x4903('0x91'),_0x3b6580['id']);logger[_0x4903('0x33')](_0x4903('0x9a'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x55c731['name']),_0x4903('0x9b'),{'uri':_0x4903('0x94')+_0x46cfa5[_0x4903('0x83')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3b6580['id']});}})['catch'](function(_0x535594){logger['error'](_0x4903('0x9a'),JSON[_0x4903('0x10')](_0x535594));});};exports[_0x4903('0x9c')]=function(_0x2c5dc4,_0x4f7128,_0x3d07f8,_0x57b538,_0x3a8864,_0x123af9){var _0x303cda,_0x29f807,_0x535226;_0x123af9['host']=intUtil[_0x4903('0x84')](_0x123af9[_0x4903('0x83')]);_0x123af9['serverUrl']=intUtil[_0x4903('0x84')](_0x123af9[_0x4903('0x85')]);if(_0x3a8864&&_0x3a8864[_0x4903('0x86')]){logger[_0x4903('0x33')]('['+_0x4f7128['lastevent'][_0x4903('0x9d')]()+']',_0x4903('0x88'));_0x4f7128[_0x4903('0x89')]=_0x123af9[_0x4903('0x85')]+_0x4903('0x8a')+_0x4f7128[_0x4903('0x8b')]+_0x4903('0x8c')+md5(_0x4f7128['uniqueid']);}else{_0x4f7128[_0x4903('0x89')]='';}var _0x8acb2e=_0x123af9['host']===_0x4903('0x8d')?'eu':_0x4903('0x8e');return getAccessToken(_0x123af9)[_0x4903('0x2c')](function(_0x8e08e3){_0x535226=_0x8e08e3;return getUser(_0x535226,_0x8acb2e,_0x123af9);})['then'](function(_0xf6efb6){_0x303cda=_0xf6efb6;logger[_0x4903('0x33')]('The\x20User\x20ID\x20is:',_0x303cda['id']);return getEndUser(_0x535226,_0x8acb2e,_0x123af9,_0x4f7128[_0x4903('0x8f')],_0x4f7128[_0x4903('0x90')],_0x303cda,_0x3d07f8);})[_0x4903('0x2c')](function(_0x283f84){_0x29f807=_0x283f84;return getCall(_0x535226,_0x8acb2e,_0x123af9,_0x303cda,_0x29f807,_0x3d07f8,_0x4f7128,_0x4903('0x7d'));})[_0x4903('0x2c')](function(_0xcad45c){if(_0xcad45c){logger[_0x4903('0x33')]('The\x20Call\x20ID\x20is:',_0xcad45c['id']);}})[_0x4903('0x42')](function(_0x2b4c3c){logger[_0x4903('0x30')]('['+_0x4f7128[_0x4903('0x70')][_0x4903('0x9d')]()+']',JSON['stringify'](_0x2b4c3c));});}; \ No newline at end of file +var _0x7763=['recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Outbound','/crm/EntityInfo.do?module=Calls&id=','unmanaged','monitor_format','toUpperCase','lodash','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','emit','debug','[HTTP]','stringify','length','includes','string','type','content','toString','variable','idField','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','add','seconds','error','Failing\x20creating\x20the\x20access_token','stack','Search\x20user','GET','format','ActiveUsers','Zoho-oauthtoken\x20','then','users','isArrayLikeObject','findIndex','email','info','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','data','enduserType','startCase','role','first_name','last_name','code','SUCCESS','The\x20failing\x20result\x20is','Error:\x20','log','moduleSearch','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','contact','nothing','lead','Creating\x20new\x20call...','Owner','administrator','getString','Subjects','Description','Who_Id','Full_Name','First_Name','Last_Name','talktime','answertime','endtime','Call_Duration','utc','YYYY-MM-DDTHH:mm:ss','diff','starttime','mm:ss','lastevent','Call_Result','complete','connect','Answered','rejected','Abandoned','Call_Start_Time','agentcalledAt','Inbound','merge','Fields','/crm/v2/Calls','Call\x20created!','details','err','queue','stripTrailingSlash','host','serverUrl','[QUEUE]','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','outbound'];(function(_0x521e29,_0x4ddc71){var _0x509460=function(_0x1e3738){while(--_0x1e3738){_0x521e29['push'](_0x521e29['shift']());}};_0x509460(++_0x4ddc71);}(_0x7763,0xa0));var _0x3776=function(_0x16e279,_0x4daef3){_0x16e279=_0x16e279-0x0;var _0x195674=_0x7763[_0x16e279];return _0x195674;};'use strict';var _=require(_0x3776('0x0'));var rp=require(_0x3776('0x1'));var md5=require(_0x3776('0x2'));var util=require(_0x3776('0x3'));var intUtil=require('./util');var moment=require(_0x3776('0x4'));var Redis=require(_0x3776('0x5'));var BPromise=require('bluebird');var config=require(_0x3776('0x6'));var logger=require(_0x3776('0x7'))(_0x3776('0x8'));config[_0x3776('0x9')]=_['defaults'](config[_0x3776('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3776('0x9')]));function emit(_0x2e1da2,_0x466d7e,_0x4dfc6d){io['to'](_0x2e1da2)[_0x3776('0xa')](_0x466d7e,_0x4dfc6d);}function request(_0x303d00){logger[_0x3776('0xb')](_0x3776('0xc'),JSON[_0x3776('0xd')](_0x303d00));return rp(_0x303d00);}function getCustomFields(_0x129cb5,_0x43d92a){var _0x143c3a={};if(_0x129cb5[_0x3776('0xe')]>0x0){_['forEach'](_0x129cb5,function(_0x44aa85){if(_[_0x3776('0xf')]([_0x3776('0x10'),'picklist'],_0x44aa85[_0x3776('0x11')])&&_0x44aa85['idField']){_0x143c3a[_0x44aa85['idField']]=_0x44aa85[_0x3776('0x12')][_0x3776('0x13')]();}else if(_0x44aa85['type']===_0x3776('0x14')&&_0x44aa85['variableName']&&_0x44aa85[_0x3776('0x15')]&&_0x43d92a[_0x44aa85['variableName']]){_0x143c3a[_0x44aa85[_0x3776('0x15')]]=_0x43d92a[_0x44aa85['variableName']][_0x3776('0x13')]();}else if(_0x44aa85[_0x3776('0x11')]===_0x3776('0x16')&&_0x44aa85[_0x3776('0x17')]&&_0x44aa85['Variable'][_0x3776('0x18')]&&_0x44aa85[_0x3776('0x15')]&&_0x43d92a[_0x44aa85['Variable'][_0x3776('0x18')][_0x3776('0x19')]()]){_0x143c3a[_0x44aa85[_0x3776('0x15')]]=_0x43d92a[_0x44aa85[_0x3776('0x17')][_0x3776('0x18')]['toLowerCase']()][_0x3776('0x13')]();}});}return _0x143c3a;}function getName(_0x4e480e){if(_0x4e480e[_0x3776('0x1a')]('\x20')>0x0){var _0x20e49e=_0x4e480e[_0x3776('0x1b')](/ (.+)/);if(_0x20e49e[0x1]){return _0x20e49e;}}return[_0x4e480e,_0x4e480e];}var accountsTokens={};function getAccessToken(_0x39a4fe){return new Promise(function(_0x548d42,_0x48a8cf){if(!_[_0x3776('0x1c')](accountsTokens[_0x39a4fe['id']])&&!_[_0x3776('0x1c')](accountsTokens[_0x39a4fe['id']][_0x3776('0x1d')])){if(moment()[_0x3776('0x1e')](accountsTokens[_0x39a4fe['id']][_0x3776('0x1f')])){_0x548d42(accountsTokens[_0x39a4fe['id']][_0x3776('0x1d')]);}}var _0x244964;switch(_0x39a4fe['zone']){case'US':_0x244964=_0x3776('0x20');break;case'AU':_0x244964='https://accounts.zoho.com.au';break;case'EU':_0x244964=_0x3776('0x21');break;case'IN':_0x244964=_0x3776('0x22');break;case'CN':_0x244964=_0x3776('0x23');break;default:_0x244964=_0x3776('0x21');break;}var _0x269a32={'method':_0x3776('0x24'),'uri':_0x244964+_0x3776('0x25'),'qs':{'refresh_token':_0x39a4fe[_0x3776('0x26')],'client_id':_0x39a4fe[_0x3776('0x27')],'client_secret':_0x39a4fe[_0x3776('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x269a32)['then'](function(_0x11dd5a){accountsTokens[_0x39a4fe['id']]={'access_token':_0x11dd5a[_0x3776('0x1d')],'expires_in':moment()[_0x3776('0x29')](_0x11dd5a[_0x3776('0x1f')],_0x3776('0x2a'))};_0x548d42(_0x11dd5a[_0x3776('0x1d')]);})['catch'](function(_0x11a47a){logger[_0x3776('0x2b')](_0x3776('0x2c'),_0x11a47a[_0x3776('0x2d')]);_0x48a8cf(_0x11a47a);});});}function getUser(_0x3ee06a,_0xdb6511,_0x3178b0,_0x46f937){logger['info'](_0x3776('0x2e'));return request({'method':_0x3776('0x2f'),'uri':util[_0x3776('0x30')]('https://www.zohoapis.%s/crm/v2/users',_0xdb6511),'qs':{'type':_0x3776('0x31')},'headers':{'Authorization':_0x3776('0x32')+_0x3ee06a},'json':!![]})[_0x3776('0x33')](function(_0x3f4750){if(_0x3f4750[_0x3776('0x34')]){var _0x4666de=-0x1;if(_[_0x3776('0x35')](_0x3f4750[_0x3776('0x34')])){if(!_[_0x3776('0x1c')](_0x46f937)){_0x4666de=_[_0x3776('0x36')](_0x3f4750[_0x3776('0x34')],function(_0x3be196){return _0x3be196[_0x3776('0x37')]===_0x46f937;});}if(_0x4666de>=0x0){logger[_0x3776('0x38')](_0x3776('0x39'));}else{logger[_0x3776('0x38')](_0x3776('0x3a'));_0x4666de=_[_0x3776('0x36')](_0x3f4750[_0x3776('0x34')],function(_0x186c8e){return _0x186c8e[_0x3776('0x3b')][_0x3776('0x18')]===_0x3776('0x3c');});}return _0x3f4750[_0x3776('0x34')][_0x4666de];}else{if(_0x3f4750[_0x3776('0x3d')][_0x3776('0x3b')][_0x3776('0x18')]==='Administrator'){logger[_0x3776('0x38')](_0x3776('0x3a'));user=_0x3f4750[_0x3776('0x3d')];return user;}else{logger[_0x3776('0x2b')]('The\x20failing\x20result\x20is',JSON[_0x3776('0xd')](_0x3f4750));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x3776('0xd')](_0x3f4750));}}}else{logger[_0x3776('0x2b')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x3f4750));throw new Error(_0x3776('0x3e')+JSON[_0x3776('0xd')](_0x3f4750));}})[_0x3776('0x3f')](function(_0x4026eb){console[_0x3776('0x2b')](_0x4026eb);});}function getZohoUser(_0x365e6a,_0x3fefcc){return new BPromise(function(_0x325a45,_0x304049){request(_0x365e6a)[_0x3776('0x33')](function(_0x279d12){var _0x4af08a=null;if(_0x279d12){_0x4af08a=_0x279d12[_0x3776('0x40')][0x0];_0x4af08a[_0x3776('0x41')]=_0x3fefcc;}_0x325a45(_0x4af08a);})[_0x3776('0x3f')](function(_0x446e43){_0x304049(_0x446e43);});});}function createEndUser(_0x476db0,_0x4cb1e1,_0x588509,_0x2247d5,_0x1b86f6,_0x4fbb24){var _0x588509=getName(_0x588509);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x4cb1e1+'/crm/v2/'+_[_0x3776('0x42')](_0x4fbb24['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x588509[0x1],'First_Name':_0x588509[0x0],'Phone':_0x2247d5,'Owner':{'name':!_[_0x3776('0x1c')](_0x1b86f6[_0x3776('0x43')][_0x3776('0x18')])?_0x1b86f6[_0x3776('0x43')]['name']:!_[_0x3776('0x1c')](_0x1b86f6[_0x3776('0x44')])?_0x1b86f6[_0x3776('0x44')]+'\x20'+_0x1b86f6['last_name']:_0x1b86f6[_0x3776('0x45')],'id':_0x1b86f6['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x476db0},'json':!![]})['then'](function(_0x26592f){if(_0x26592f&&_0x26592f['data'][0x0][_0x3776('0x46')]===_0x3776('0x47')){var _0x34c410=_0x26592f['data'][0x0]['details'];_0x34c410[_0x3776('0x41')]=_[_0x3776('0x42')](_0x4fbb24['moduleCreate'])+'s';return _0x34c410;}logger[_0x3776('0x2b')](_0x3776('0x48'),JSON[_0x3776('0xd')](data));throw new Error(_0x3776('0x49')+JSON[_0x3776('0xd')](data));})[_0x3776('0x3f')](function(_0xfa330a){console[_0x3776('0x4a')]('CREATE\x20ERROR',_0xfa330a);});}function getEndUser(_0xfaecdf,_0x333080,_0x2085c3,_0x3810aa,_0x3cb100,_0x7b4f27,_0x5ca8f3){var _0x19f9f9={'method':_0x3776('0x2f'),'uri':'','headers':{'Authorization':_0x3776('0x32')+_0xfaecdf},'json':!![]};switch(_0x5ca8f3[_0x3776('0x4b')]){case _0x3776('0x4c'):_0x19f9f9[_0x3776('0x4d')]=_0x3776('0x4e')+_0x333080+_0x3776('0x4f')+_0x3cb100+'))';return getZohoUser(_0x19f9f9,_0x3776('0x50'))[_0x3776('0x33')](function(_0x40e9bc){if(_0x40e9bc)return _0x40e9bc;_0x19f9f9[_0x3776('0x4d')]=_0x3776('0x4e')+_0x333080+_0x3776('0x51')+_0x3cb100+'))';return getZohoUser(_0x19f9f9,_0x3776('0x52'))[_0x3776('0x33')](function(_0x4c163b){if(_0x4c163b)return _0x4c163b;if(_0x5ca8f3[_0x3776('0x53')]!='nothing'){return createEndUser(_0xfaecdf,_0x333080,_0x3810aa,_0x3cb100,_0x7b4f27,_0x5ca8f3);}else{return{};}});});break;case _0x3776('0x54'):_0x19f9f9[_0x3776('0x4d')]=_0x3776('0x4e')+_0x333080+_0x3776('0x4f')+_0x3cb100+'))';return getZohoUser(_0x19f9f9,_0x3776('0x50'))['then'](function(_0x151b8a){if(_0x151b8a)return _0x151b8a;if(_0x5ca8f3[_0x3776('0x53')]!=_0x3776('0x55')){return createEndUser(_0xfaecdf,_0x333080,_0x3810aa,_0x3cb100,_0x7b4f27,_0x5ca8f3);}else{return{};}});break;case _0x3776('0x56'):_0x19f9f9[_0x3776('0x4d')]=_0x3776('0x4e')+_0x333080+_0x3776('0x51')+_0x3cb100+'))';return getZohoUser(_0x19f9f9,'Leads')['then'](function(_0x43cb59){if(_0x43cb59)return _0x43cb59;if(_0x5ca8f3[_0x3776('0x53')]!=_0x3776('0x55')){return createEndUser(_0xfaecdf,_0x333080,_0x3810aa,_0x3cb100,_0x7b4f27,_0x5ca8f3);}else{return{};}});break;}}function getCall(_0x28c947,_0x4aa3b7,_0x22d28c,_0x173f0e,_0x59cc2b,_0x109028,_0x3a6029,_0x4fe741){logger[_0x3776('0x38')](_0x3776('0x57'));var _0x348542={};_0x348542[_0x3776('0x58')]={'name':!_[_0x3776('0x1c')](_0x173f0e[_0x3776('0x43')]['name'])&&!_[_0x3776('0x1c')](_0x173f0e[_0x3776('0x3b')][_0x3776('0x18')])&&_0x173f0e[_0x3776('0x3b')][_0x3776('0x18')]===_0x3776('0x59')?_0x173f0e[_0x3776('0x43')][_0x3776('0x18')]:!_[_0x3776('0x1c')](_0x173f0e[_0x3776('0x44')])?_0x173f0e[_0x3776('0x44')]+'\x20'+_0x173f0e[_0x3776('0x45')]:_0x173f0e[_0x3776('0x45')],'id':_0x173f0e['id']};_0x348542['Subject']=intUtil[_0x3776('0x5a')](_0x109028[_0x3776('0x5b')],_0x3a6029,'\x20');_0x348542[_0x3776('0x5c')]=intUtil['getString'](_0x109028['Descriptions'],_0x3a6029,'\x0a');if(_0x59cc2b['enduserType']===_0x3776('0x50')){_0x348542[_0x3776('0x5d')]={'name':!_[_0x3776('0x1c')](_0x59cc2b[_0x3776('0x5e')])?_0x59cc2b[_0x3776('0x5e')]:!_[_0x3776('0x1c')](_0x59cc2b[_0x3776('0x5f')])?_0x59cc2b[_0x3776('0x5f')]+'\x20'+_0x59cc2b['Last_Name']:_0x59cc2b[_0x3776('0x60')],'id':_0x59cc2b['id']};}if(_0x59cc2b[_0x3776('0x41')]==='Leads'){_0x348542['What_Id']={'name':!_[_0x3776('0x1c')](_0x59cc2b[_0x3776('0x5e')])?_0x59cc2b[_0x3776('0x5e')]:!_['isNil'](_0x59cc2b[_0x3776('0x5f')])?_0x59cc2b[_0x3776('0x5f')]+'\x20'+_0x59cc2b[_0x3776('0x60')]:_0x59cc2b[_0x3776('0x60')],'id':_0x59cc2b['id']};_0x348542['$se_module']=_['startCase'](_0x59cc2b[_0x3776('0x41')]);}if(_0x3a6029[_0x3776('0x61')]){_0x348542['Call_Duration']=moment['utc'](parseInt(_0x3a6029[_0x3776('0x61')])*0x3e8)[_0x3776('0x30')]('mm:ss');}else if(_0x3a6029[_0x3776('0x62')]&&_0x3a6029[_0x3776('0x63')]){_0x348542[_0x3776('0x64')]=moment[_0x3776('0x65')](moment(_0x3a6029[_0x3776('0x63')],_0x3776('0x66'))[_0x3776('0x67')](moment(_0x3a6029[_0x3776('0x68')],_0x3776('0x66'))))[_0x3776('0x30')](_0x3776('0x69'));}switch(_0x3a6029[_0x3776('0x6a')]){case'called':_0x348542[_0x3776('0x6b')]='Called';break;case _0x3776('0x6c'):case _0x3776('0x6d'):_0x348542[_0x3776('0x6b')]=_0x3776('0x6e');break;case _0x3776('0x6f'):_0x348542[_0x3776('0x6b')]='Rejected';break;case'abandoned':_0x348542[_0x3776('0x6b')]=_0x3776('0x70');break;case'timeout':_0x348542['Call_Result']='Timeout';default:}_0x348542[_0x3776('0x71')]=(_0x4fe741==='outbound'?moment(_0x3a6029[_0x3776('0x68')])[_0x3776('0x30')]('YYYY-MM-DDTHH:mm:ss'):moment(_0x3a6029[_0x3776('0x72')])['format'](_0x3776('0x66')))||moment()['format'](_0x3776('0x66'));_0x348542['Call_Type']=_0x4fe741||_0x3776('0x73');_0x348542=_[_0x3776('0x74')](_0x348542,getCustomFields(_0x109028[_0x3776('0x75')],_0x3a6029));return request({'method':'POST','uri':_0x3776('0x4e')+_0x4aa3b7+_0x3776('0x76'),'headers':{'Authorization':_0x3776('0x32')+_0x28c947},'body':{'data':[_0x348542]},'json':!![]})[_0x3776('0x33')](function(_0x4e5128){if(_0x4e5128&&_0x4e5128['data'][0x0][_0x3776('0x46')]===_0x3776('0x47')){logger[_0x3776('0x38')](_0x3776('0x77'));return{'id':_0x4e5128[_0x3776('0x40')][0x0][_0x3776('0x78')]['id']};}})['catch'](function(_0xab3130){logger['info']('err',_0xab3130['stack']);console[_0x3776('0x4a')](_0x3776('0x79'),_0xab3130);});}exports[_0x3776('0x7a')]=function(_0x18795b,_0x52fbc2,_0x3fa07d,_0x242b43,_0x121912,_0x1064ef){var _0xad9dec,_0x4aa68b,_0x39b46f;_0x1064ef['host']=intUtil[_0x3776('0x7b')](_0x1064ef[_0x3776('0x7c')]);_0x1064ef[_0x3776('0x7d')]=intUtil[_0x3776('0x7b')](_0x1064ef[_0x3776('0x7d')]);if(_0x121912&&_0x121912['monitor_format']){logger[_0x3776('0x38')](_0x3776('0x7e'),'Recording\x20is\x20enabled!');_0x52fbc2[_0x3776('0x7f')]=_0x1064ef['serverUrl']+_0x3776('0x80')+_0x52fbc2[_0x3776('0x81')]+_0x3776('0x82')+md5(_0x52fbc2[_0x3776('0x81')]);}else{_0x52fbc2['recordingURL']='';}var _0x59f693=_0x1064ef[_0x3776('0x7c')]==='zoho.eu'?'eu':_0x3776('0x83');return getAccessToken(_0x1064ef)[_0x3776('0x33')](function(_0x2f0402){_0x39b46f=_0x2f0402;return getUser(_0x39b46f,_0x59f693,_0x1064ef,_0x242b43[_0x3776('0x37')]);})[_0x3776('0x33')](function(_0x191635){_0xad9dec=_0x191635;logger[_0x3776('0x38')](_0x3776('0x84'),_0xad9dec['id']);return getEndUser(_0x39b46f,_0x59f693,_0x1064ef,_0x52fbc2[_0x3776('0x85')],_0x52fbc2[_0x3776('0x86')],_0xad9dec,_0x3fa07d);})[_0x3776('0x33')](function(_0x3c68e1){_0x4aa68b=_0x3c68e1;return getCall(_0x39b46f,_0x59f693,_0x1064ef,_0xad9dec,_0x4aa68b,_0x3fa07d,_0x52fbc2,_0x3776('0x73'));})[_0x3776('0x33')](function(_0x7ceae){if(_0x7ceae){logger['info'](_0x3776('0x87'),_0x7ceae['id']);logger[_0x3776('0x38')](_0x3776('0x7e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3776('0x30')](_0x3776('0x88'),_0x242b43['name']),_0x3776('0x89'),{'uri':_0x3776('0x8a')+_0x1064ef['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x7ceae['id']});}})[_0x3776('0x3f')](function(_0x2b7108){logger[_0x3776('0x2b')](_0x3776('0x7e'),JSON[_0x3776('0xd')](_0x2b7108));});};exports[_0x3776('0x8b')]=function(_0x1f854f,_0xa91366,_0x3e0906,_0x4b3242,_0x1a4074,_0x1baec4,_0x3cd6a5){var _0x13be29,_0xd8d963,_0x443344;_0x1baec4['host']=intUtil[_0x3776('0x7b')](_0x1baec4['host']);_0x1baec4['serverUrl']=intUtil[_0x3776('0x7b')](_0x1baec4[_0x3776('0x7d')]);if(_0x3cd6a5&&_0x3cd6a5['recordingFormat']&&_0x3cd6a5[_0x3776('0x8c')]!==_0x3776('0x8d')){logger[_0x3776('0x38')](_0x3776('0x8e'),_0x3776('0x8f'));_0xa91366[_0x3776('0x7f')]=_0x1baec4[_0x3776('0x7d')]+'/api/voice/recordings/'+_0xa91366[_0x3776('0x81')]+'/downloads?type=uniqueid&token='+md5(_0xa91366[_0x3776('0x81')]);}var _0x51a9f0=_0x1baec4[_0x3776('0x7c')]==='zoho.eu'?'eu':_0x3776('0x83');return getAccessToken(_0x1baec4)[_0x3776('0x33')](function(_0x556d0b){_0x443344=_0x556d0b;return getUser(_0x443344,_0x51a9f0,_0x1baec4,_0x4b3242[_0x3776('0x37')]);})['then'](function(_0x24c5eb){_0x13be29=_0x24c5eb;logger[_0x3776('0x38')](_0x3776('0x84'),_0x13be29['id']);return getEndUser(_0x443344,_0x51a9f0,_0x1baec4,_0xa91366[_0x3776('0x90')],_0xa91366['destcalleridnum'],_0x13be29,_0x3e0906);})['then'](function(_0x183747){_0xd8d963=_0x183747;return getCall(_0x443344,_0x51a9f0,_0x1baec4,_0x13be29,_0xd8d963,_0x3e0906,_0xa91366,_0x3776('0x91'));})[_0x3776('0x33')](function(_0x450520){if(_0x450520){logger[_0x3776('0x38')](_0x3776('0x87'),_0x450520['id']);logger[_0x3776('0x38')](_0x3776('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x3776('0x30')](_0x3776('0x88'),_0x4b3242[_0x3776('0x18')]),_0x3776('0x89'),{'uri':'https://crm.'+_0x1baec4['host']+_0x3776('0x92')+_0x450520['id']});}})[_0x3776('0x3f')](function(_0x6e34d4){logger[_0x3776('0x2b')](_0x3776('0x8e'),JSON[_0x3776('0xd')](_0x6e34d4));});};exports[_0x3776('0x93')]=function(_0x27e638,_0xd7113d,_0x14ce44,_0x574962,_0x4b4d93,_0x48c213){var _0x2e2c8d,_0x13ef67,_0x24ac2f;_0x48c213[_0x3776('0x7c')]=intUtil[_0x3776('0x7b')](_0x48c213[_0x3776('0x7c')]);_0x48c213[_0x3776('0x7d')]=intUtil[_0x3776('0x7b')](_0x48c213[_0x3776('0x7d')]);if(_0x4b4d93&&_0x4b4d93[_0x3776('0x94')]){logger[_0x3776('0x38')]('['+_0xd7113d[_0x3776('0x6a')][_0x3776('0x95')]()+']',_0x3776('0x8f'));_0xd7113d[_0x3776('0x7f')]=_0x48c213[_0x3776('0x7d')]+_0x3776('0x80')+_0xd7113d[_0x3776('0x81')]+'/downloads?type=uniqueid&token='+md5(_0xd7113d['uniqueid']);}else{_0xd7113d[_0x3776('0x7f')]='';}var _0x5e6a58=_0x48c213[_0x3776('0x7c')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x48c213)['then'](function(_0x4d4e5a){_0x24ac2f=_0x4d4e5a;return getUser(_0x24ac2f,_0x5e6a58,_0x48c213);})[_0x3776('0x33')](function(_0x809669){_0x2e2c8d=_0x809669;logger[_0x3776('0x38')](_0x3776('0x84'),_0x2e2c8d['id']);return getEndUser(_0x24ac2f,_0x5e6a58,_0x48c213,_0xd7113d[_0x3776('0x85')],_0xd7113d[_0x3776('0x86')],_0x2e2c8d,_0x14ce44);})['then'](function(_0x5bbee6){_0x13ef67=_0x5bbee6;return getCall(_0x24ac2f,_0x5e6a58,_0x48c213,_0x2e2c8d,_0x13ef67,_0x14ce44,_0xd7113d,_0x3776('0x73'));})[_0x3776('0x33')](function(_0x3372a5){if(_0x3372a5){logger[_0x3776('0x38')](_0x3776('0x87'),_0x3372a5['id']);}})[_0x3776('0x3f')](function(_0x6cc99b){logger[_0x3776('0x2b')]('['+_0xd7113d[_0x3776('0x6a')]['toUpperCase']()+']',JSON['stringify'](_0x6cc99b));});}; \ 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 b49bbc8..c4bfdf9 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 _0x1a15=['render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','data2','Script'];(function(_0x4eb24f,_0x9d1734){var _0x2f5de3=function(_0x464b24){while(--_0x464b24){_0x4eb24f['push'](_0x4eb24f['shift']());}};_0x2f5de3(++_0x9d1734);}(_0x1a15,0x9f));var _0x51a1=function(_0x47205a,_0x338bc2){_0x47205a=_0x47205a-0x0;var _0x20dbfd=_0x1a15[_0x47205a];return _0x20dbfd;};'use strict';var util=require('util');var sh=require('shelljs');var Mustache=require('mustache');var logger=require('../../../../config/logger')('trigger');exports['exec']=function(_0x2b81c4,_0xbeac6e){var _0x511020=_0x2b81c4[_0x51a1('0x0')]?_0x2b81c4['data2']:_0x51a1('0x1');var _0x534df5=_0x2b81c4['data3']?Mustache[_0x51a1('0x2')](_0x2b81c4['data3'],_0xbeac6e):_0xbeac6e;sh['exec'](_0x534df5,function(_0x1bccd5,_0x5456fb,_0x338330){if(_0x1bccd5!==0x0){logger[_0x51a1('0x3')](util['format'](_0x51a1('0x4'),_0x511020,_0x534df5,_0x1bccd5,_0x338330));}else{logger[_0x51a1('0x5')](util['format'](_0x51a1('0x6'),_0x511020,_0x534df5,_0x5456fb));}});}; \ No newline at end of file +var _0x8860=['util','mustache','exec','data2','data3','render','error','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','format','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x8860,0xb0));var _0x0886=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x8860[_0x50e40b];return _0x2608b7;};'use strict';var util=require(_0x0886('0x0'));var sh=require('shelljs');var Mustache=require(_0x0886('0x1'));var logger=require('../../../../config/logger')('trigger');exports[_0x0886('0x2')]=function(_0x4fadd8,_0xe8ba90){var _0xc4a7d1=_0x4fadd8[_0x0886('0x3')]?_0x4fadd8[_0x0886('0x3')]:'Script';var _0x55acba=_0x4fadd8[_0x0886('0x4')]?Mustache[_0x0886('0x5')](_0x4fadd8[_0x0886('0x4')],_0xe8ba90):_0xe8ba90;sh[_0x0886('0x2')](_0x55acba,function(_0x1fca43,_0x679921,_0x4a94a0){if(_0x1fca43!==0x0){logger[_0x0886('0x6')](util['format'](_0x0886('0x7'),_0xc4a7d1,_0x55acba,_0x1fca43,_0x4a94a0));}else{logger[_0x0886('0x8')](util[_0x0886('0x9')](_0x0886('0xa'),_0xc4a7d1,_0x55acba,_0x679921));}});}; \ 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 09d8307..4f89672 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 _0xe202=['headers','data6','error','stack','GET','DELETE','POST','PUT','data7','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','body','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','message','request-promise','lodash','mustache','trigger','exec','data1','toUpperCase','render','data2','data5','number'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xe202,0x175));var _0x2e20=function(_0xe52b88,_0x21d898){_0xe52b88=_0xe52b88-0x0;var _0x2b0b2a=_0xe202[_0xe52b88];return _0x2b0b2a;};'use strict';var rp=require(_0x2e20('0x0'));var util=require('util');var _=require(_0x2e20('0x1'));var Mustache=require(_0x2e20('0x2'));var logger=require('../../../../config/logger')(_0x2e20('0x3'));exports[_0x2e20('0x4')]=function(_0x42032e,_0x1f1695){var _0x2f97ac,_0x1774b7;var _0x14caf4={'method':_0x42032e[_0x2e20('0x5')][_0x2e20('0x6')](),'uri':Mustache[_0x2e20('0x7')](_0x42032e[_0x2e20('0x8')],_0x1f1695),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x42032e[_0x2e20('0x9')])===_0x2e20('0xa')&&parseInt(_0x42032e[_0x2e20('0x9')])>=0x1&&parseInt(_0x42032e[_0x2e20('0x9')])<=0xa?parseInt(_0x42032e[_0x2e20('0x9')])*0x3e8:0x5*0x3e8};try{_0x14caf4[_0x2e20('0xb')]=_0x42032e[_0x2e20('0xc')]?JSON['parse'](Mustache[_0x2e20('0x7')](_0x42032e[_0x2e20('0xc')],_0x1f1695)):{};}catch(_0x450788){logger[_0x2e20('0xd')](_0x450788[_0x2e20('0xe')]);}switch(_0x42032e[_0x2e20('0x5')][_0x2e20('0x6')]()){case _0x2e20('0xf'):case _0x2e20('0x10'):_0x2f97ac=null;_0x14caf4['qs']=_0x1f1695;break;case _0x2e20('0x11'):case _0x2e20('0x12'):if(_0x42032e['data7']){try{_0x2f97ac=JSON['parse'](Mustache[_0x2e20('0x7')](_0x42032e[_0x2e20('0x13')],_0x1f1695));_0x14caf4['body']=_0x2f97ac;}catch(_0x4219da){logger[_0x2e20('0xd')](_0x4219da[_0x2e20('0xe')]);logger[_0x2e20('0xd')](_0x2e20('0x14'));}}else{_0x2f97ac=_0x1f1695;_0x14caf4[_0x2e20('0x15')]=_0x2f97ac;}break;}logger[_0x2e20('0x16')](util['format'](_0x2e20('0x17'),_0x42032e['data1'],_0x42032e[_0x2e20('0x8')],JSON[_0x2e20('0x18')](_0x14caf4)));rp(_0x14caf4)[_0x2e20('0x19')](function(_0xb1ff41){_0x2f97ac=!_['isNil'](_0x2f97ac)?',\x20request\x20body:\x20'+_0x2f97ac:'';_0x1774b7=typeof _0xb1ff41[_0x2e20('0x15')]===_0x2e20('0x1a')?JSON[_0x2e20('0x18')](_0xb1ff41['body']):_0xb1ff41[_0x2e20('0x15')];logger['info'](util[_0x2e20('0x1b')](_0x2e20('0x1c'),_0x42032e['data1'],_0x42032e[_0x2e20('0x8')],_0xb1ff41[_0x2e20('0x1d')],_0x1774b7));})['catch'](function(_0x20f38e){logger[_0x2e20('0xd')](util[_0x2e20('0x1b')](_0x2e20('0x1e'),_0x42032e[_0x2e20('0x5')],_0x42032e[_0x2e20('0x8')],_0x20f38e[_0x2e20('0x1d')],_0x20f38e['name'],_0x20f38e[_0x2e20('0x1f')]));});}; \ No newline at end of file +var _0x8141=['number','data6','parse','error','GET','DELETE','POST','PUT','data7','body','stack','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','data2','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name','message','request-promise','mustache','trigger','exec','data1','toUpperCase','render','data5'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0x8141,0x121));var _0x1814=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8141[_0x14add3];return _0x4a174f;};'use strict';var rp=require(_0x1814('0x0'));var util=require('util');var _=require('lodash');var Mustache=require(_0x1814('0x1'));var logger=require('../../../../config/logger')(_0x1814('0x2'));exports[_0x1814('0x3')]=function(_0x1842f0,_0x38d8fc){var _0x3bd7f3,_0x4e9c64;var _0x2034a1={'method':_0x1842f0[_0x1814('0x4')][_0x1814('0x5')](),'uri':Mustache[_0x1814('0x6')](_0x1842f0['data2'],_0x38d8fc),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x1842f0[_0x1814('0x7')])===_0x1814('0x8')&&parseInt(_0x1842f0[_0x1814('0x7')])>=0x1&&parseInt(_0x1842f0[_0x1814('0x7')])<=0xa?parseInt(_0x1842f0[_0x1814('0x7')])*0x3e8:0x5*0x3e8};try{_0x2034a1['headers']=_0x1842f0[_0x1814('0x9')]?JSON[_0x1814('0xa')](Mustache[_0x1814('0x6')](_0x1842f0[_0x1814('0x9')],_0x38d8fc)):{};}catch(_0x2be54c){logger[_0x1814('0xb')](_0x2be54c['stack']);}switch(_0x1842f0[_0x1814('0x4')][_0x1814('0x5')]()){case _0x1814('0xc'):case _0x1814('0xd'):_0x3bd7f3=null;_0x2034a1['qs']=_0x38d8fc;break;case _0x1814('0xe'):case _0x1814('0xf'):if(_0x1842f0['data7']){try{_0x3bd7f3=JSON[_0x1814('0xa')](Mustache[_0x1814('0x6')](_0x1842f0[_0x1814('0x10')],_0x38d8fc));_0x2034a1[_0x1814('0x11')]=_0x3bd7f3;}catch(_0x5cb69d){logger[_0x1814('0xb')](_0x5cb69d[_0x1814('0x12')]);logger[_0x1814('0xb')](_0x1814('0x13'));}}else{_0x3bd7f3=_0x38d8fc;_0x2034a1[_0x1814('0x11')]=_0x3bd7f3;}break;}logger[_0x1814('0x14')](util[_0x1814('0x15')](_0x1814('0x16'),_0x1842f0['data1'],_0x1842f0['data2'],JSON[_0x1814('0x17')](_0x2034a1)));rp(_0x2034a1)[_0x1814('0x18')](function(_0x19fd1a){_0x3bd7f3=!_[_0x1814('0x19')](_0x3bd7f3)?_0x1814('0x1a')+_0x3bd7f3:'';_0x4e9c64=typeof _0x19fd1a[_0x1814('0x11')]==='object'?JSON[_0x1814('0x17')](_0x19fd1a['body']):_0x19fd1a[_0x1814('0x11')];logger[_0x1814('0x14')](util[_0x1814('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x1842f0[_0x1814('0x4')],_0x1842f0[_0x1814('0x1b')],_0x19fd1a['statusCode'],_0x4e9c64));})[_0x1814('0x1c')](function(_0x4df2e9){logger['error'](util[_0x1814('0x15')](_0x1814('0x1d'),_0x1842f0['data1'],_0x1842f0['data2'],_0x4df2e9[_0x1814('0x1e')],_0x4df2e9[_0x1814('0x1f')],_0x4df2e9[_0x1814('0x20')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 8e47b64..c454f6e 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 _0xcd27=['bluebird','../../config/logger','routing','Request','request','then','debug','rpc','error','message','result','exports'];(function(_0x2ce050,_0x33e608){var _0x1a5cdd=function(_0x4c9a6b){while(--_0x4c9a6b){_0x2ce050['push'](_0x2ce050['shift']());}};_0x1a5cdd(++_0x33e608);}(_0xcd27,0x1bc));var _0x7cd2=function(_0xc00ddc,_0xa8f48f){_0xc00ddc=_0xc00ddc-0x0;var _0x42106e=_0xcd27[_0xc00ddc];return _0x42106e;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x7cd2('0x0'));var logger=require(_0x7cd2('0x1'))(_0x7cd2('0x2'));var client=jayson['client']['http']({'port':0x2329});client[_0x7cd2('0x3')]=function(_0x58c641,_0x186f24){return new BPromise(function(_0x5ec5d5,_0x484bcc){return client[_0x7cd2('0x4')](_0x58c641,_0x186f24)[_0x7cd2('0x5')](function(_0x3d4e82){logger[_0x7cd2('0x6')](_0x7cd2('0x7'),_0x7cd2('0x2'),_0x58c641,_0x186f24,_0x3d4e82);if(_0x3d4e82[_0x7cd2('0x8')]){logger[_0x7cd2('0x8')](_0x7cd2('0x7'),_0x7cd2('0x2'),_0x58c641,_0x3d4e82[_0x7cd2('0x8')][_0x7cd2('0x9')],_0x186f24);return _0x484bcc(_0x3d4e82[_0x7cd2('0x8')][_0x7cd2('0x9')]);}else{return _0x5ec5d5(_0x3d4e82[_0x7cd2('0xa')]);}})['catch'](function(_0x2bc26e){logger[_0x7cd2('0x8')](_0x7cd2('0x7'),_0x7cd2('0x2'),_0x58c641,_0x2bc26e,_0x186f24);return _0x484bcc(_0x2bc26e);});});};module[_0x7cd2('0xb')]=client; \ No newline at end of file +var _0xb213=['message','result','exports','jayson/promise','../../config/logger','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x13fd38,_0x31c653){var _0x319836=function(_0x28c09e){while(--_0x28c09e){_0x13fd38['push'](_0x13fd38['shift']());}};_0x319836(++_0x31c653);}(_0xb213,0x199));var _0x3b21=function(_0x5a4eb4,_0x20c8fe){_0x5a4eb4=_0x5a4eb4-0x0;var _0x5df6fd=_0xb213[_0x5a4eb4];return _0x5df6fd;};'use strict';var jayson=require(_0x3b21('0x0'));var BPromise=require('bluebird');var logger=require(_0x3b21('0x1'))(_0x3b21('0x2'));var client=jayson[_0x3b21('0x3')][_0x3b21('0x4')]({'port':0x2329});client[_0x3b21('0x5')]=function(_0x3c2336,_0x1bfdad){return new BPromise(function(_0x514201,_0x333f44){return client[_0x3b21('0x6')](_0x3c2336,_0x1bfdad)[_0x3b21('0x7')](function(_0x38fd65){logger[_0x3b21('0x8')](_0x3b21('0x9'),_0x3b21('0x2'),_0x3c2336,_0x1bfdad,_0x38fd65);if(_0x38fd65['error']){logger['error'](_0x3b21('0x9'),'routing',_0x3c2336,_0x38fd65[_0x3b21('0xa')][_0x3b21('0xb')],_0x1bfdad);return _0x333f44(_0x38fd65[_0x3b21('0xa')]['message']);}else{return _0x514201(_0x38fd65[_0x3b21('0xc')]);}})['catch'](function(_0x271913){logger['error'](_0x3b21('0x9'),'routing',_0x3c2336,_0x271913,_0x1bfdad);return _0x333f44(_0x271913);});});};module[_0x3b21('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 85e8f62..44df261 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 _0x8145=['email','resolve','then','initMailAccounts','refresh','mailAccounts','listen','getSettings','loginMailFrequency','catch','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger'];(function(_0x57d2bd,_0x57664d){var _0x3e58ff=function(_0x2474f7){while(--_0x2474f7){_0x57d2bd['push'](_0x57d2bd['shift']());}};_0x3e58ff(++_0x57664d);}(_0x8145,0x6a));var _0x5814=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0x8145[_0x9aada2];return _0x196dff;};'use strict';var server=require(_0x5814('0x0'));var Realtime=require(_0x5814('0x1'));var EmailChannel=require(_0x5814('0x2'));var mailAccount=require(_0x5814('0x3'));var setting=require(_0x5814('0x4'));var logger=require(_0x5814('0x5'))(_0x5814('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x5814('0x7')]()[_0x5814('0x8')](mailAccount['getMailAccounts']())[_0x5814('0x8')](realtime[_0x5814('0x9')]())['then'](function(){email[_0x5814('0xa')](realtime[_0x5814('0xb')]);return realtime;});}function main(){return server[_0x5814('0xc')](realtime,email)[_0x5814('0x8')](function(){return initRealtime();})[_0x5814('0x8')](function(){return setting[_0x5814('0xd')]();})['then'](function(_0x39453a){return setInterval(initRealtime,_0x39453a[_0x5814('0xe')]*0x3e8);})[_0x5814('0xf')](function(_0x21227c){logger['error']('Email\x20service\x20initialization',_0x21227c);});}main(); \ No newline at end of file +var _0x7a06=['then','getMailAccounts','initMailAccounts','refresh','listen','getSettings','catch','error','./server','./realtime','./lib/email','./rpc/mailAccount','./rpc/setting','../../config/logger','email','resolve'];(function(_0x1c506e,_0x374849){var _0x35370e=function(_0x4cb29b){while(--_0x4cb29b){_0x1c506e['push'](_0x1c506e['shift']());}};_0x35370e(++_0x374849);}(_0x7a06,0x148));var _0x67a0=function(_0x2331a4,_0x165f23){_0x2331a4=_0x2331a4-0x0;var _0x33f6ab=_0x7a06[_0x2331a4];return _0x33f6ab;};'use strict';var server=require(_0x67a0('0x0'));var Realtime=require(_0x67a0('0x1'));var EmailChannel=require(_0x67a0('0x2'));var mailAccount=require(_0x67a0('0x3'));var setting=require(_0x67a0('0x4'));var logger=require(_0x67a0('0x5'))(_0x67a0('0x6'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return Promise[_0x67a0('0x7')]()[_0x67a0('0x8')](mailAccount[_0x67a0('0x9')]())[_0x67a0('0x8')](realtime[_0x67a0('0xa')]())[_0x67a0('0x8')](function(){email[_0x67a0('0xb')](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x67a0('0xc')](realtime,email)[_0x67a0('0x8')](function(){return initRealtime();})['then'](function(){return setting[_0x67a0('0xd')]();})[_0x67a0('0x8')](function(_0x2f4aa3){return setInterval(initRealtime,_0x2f4aa3['loginMailFrequency']*0x3e8);})[_0x67a0('0xe')](function(_0x423c4a){logger[_0x67a0('0xf')]('Email\x20service\x20initialization',_0x423c4a);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index f0ad22f..8cf0f91 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 _0xef12=['moment','bluebird','md5','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','total','isNil','stringify','emit','mailAccount:update','refresh','hasOwnProperty','service','provider','bind','handleImapEmail','end','error','handleImapError','status','messageStatus','handleImapBox','connected','messages','lastName','from','notify','Mail\x20accepted\x20from\x20routing','sendMail','send','verifySmtp','Smtp','verify','then','verified','exports','lodash'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0xef12,0x98));var _0x2ef1=function(_0x1dab24,_0x5485b6){_0x1dab24=_0x1dab24-0x0;var _0xa9eb62=_0xef12[_0x1dab24];return _0xa9eb62;};'use strict';var _=require(_0x2ef1('0x0'));var moment=require(_0x2ef1('0x1'));var BPromise=require(_0x2ef1('0x2'));var md5=require(_0x2ef1('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x2ef1('0x4'))(_0x2ef1('0x5'));config[_0x2ef1('0x6')]=_[_0x2ef1('0x7')](config[_0x2ef1('0x6')],{'host':_0x2ef1('0x8'),'port':0x18eb});var io=require(_0x2ef1('0x9'))(new Redis(config[_0x2ef1('0x6')]));var EmailImap=require('./imap');var EmailSmtp=require('./smtp');var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x49cff2){logger[_0x2ef1('0xa')](_0x2ef1('0xb'));this[_0x2ef1('0xc')]=_0x49cff2[_0x2ef1('0xc')];this[_0x2ef1('0xd')]={};this[_0x2ef1('0xe')]=new EmailSmtp();}EmailChannel[_0x2ef1('0xf')]['emit']=function(_0x12f366){var _0x43dd5e=this[_0x2ef1('0xc')][_0x12f366];var _0x108e83={'id':_0x43dd5e['id'],'name':_0x43dd5e[_0x2ef1('0x10')],'key':_0x43dd5e[_0x2ef1('0x11')],'active':_0x43dd5e[_0x2ef1('0x12')],'Imap':{'status':_0x43dd5e[_0x2ef1('0x13')]['status'],'messageStatus':_0x43dd5e['Imap']['messageStatus'],'total':_0x43dd5e[_0x2ef1('0x13')][_0x2ef1('0x14')]}};if(_[_0x2ef1('0x15')](md5Accounts[_0x12f366])){md5Accounts[_0x12f366]={};}var _0x4f88f3=md5(JSON[_0x2ef1('0x16')](_0x108e83));if(md5Accounts[_0x12f366][_0x2ef1('0x3')]!==_0x4f88f3){md5Accounts[_0x12f366][_0x2ef1('0x3')]=_0x4f88f3;io[_0x2ef1('0x17')](_0x2ef1('0x18'),_0x108e83);}};EmailChannel[_0x2ef1('0xf')][_0x2ef1('0x19')]=function(_0x2050e1){for(var _0x5cf5be in _0x2050e1){if(_0x2050e1[_0x2ef1('0x1a')](_0x5cf5be)){if(_0x2050e1[_0x5cf5be]['Imap']&&_0x2050e1[_0x5cf5be]['active']){var _0x1fc8e8=_0x2050e1[_0x5cf5be]['Imap'];if(!_0x1fc8e8[_0x2ef1('0x1b')]&&_0x2050e1[_0x5cf5be][_0x2ef1('0x1c')]!=='custom')_0x1fc8e8['service']=_0x2050e1[_0x5cf5be][_0x2ef1('0x1c')];if(!this[_0x2ef1('0xd')]['hasOwnProperty'](_0x1fc8e8['id'])){this['imapAccounts'][_0x1fc8e8['id']]=new EmailImap(_0x1fc8e8,_0x2050e1[_0x5cf5be][_0x2ef1('0x5')]);this[_0x2ef1('0xd')][_0x1fc8e8['id']]['on']('box',this['handleImapBox'][_0x2ef1('0x1d')](this,_0x5cf5be));this[_0x2ef1('0xd')][_0x1fc8e8['id']]['on']('email',this[_0x2ef1('0x1e')][_0x2ef1('0x1d')](this,_0x5cf5be));this[_0x2ef1('0xd')][_0x1fc8e8['id']]['on'](_0x2ef1('0x1f'),this['handleImapEnd'][_0x2ef1('0x1d')](this,_0x5cf5be));this['imapAccounts'][_0x1fc8e8['id']]['on'](_0x2ef1('0x20'),this[_0x2ef1('0x21')][_0x2ef1('0x1d')](this,_0x5cf5be));}}else{if(_['isNil'](this[_0x2ef1('0xc')][_0x5cf5be]['Imap'])){this['mailAccounts'][_0x5cf5be][_0x2ef1('0x13')]={};}this['mailAccounts'][_0x5cf5be]['Imap'][_0x2ef1('0x22')]='disabled';this[_0x2ef1('0xc')][_0x5cf5be][_0x2ef1('0x13')][_0x2ef1('0x23')]='';this[_0x2ef1('0x17')](_0x5cf5be);}}}};EmailChannel[_0x2ef1('0xf')][_0x2ef1('0x24')]=function(_0x37b207,_0x4d9042){if(this[_0x2ef1('0xc')][_0x37b207]){this[_0x2ef1('0xc')][_0x37b207][_0x2ef1('0x13')][_0x2ef1('0x22')]=_0x2ef1('0x25');this[_0x2ef1('0xc')][_0x37b207]['Imap']['messageStatus']=_0x4d9042[_0x2ef1('0x10')];if(_0x4d9042[_0x2ef1('0x26')]){this[_0x2ef1('0xc')][_0x37b207][_0x2ef1('0x13')][_0x2ef1('0x14')]=_0x4d9042['messages'][_0x2ef1('0x14')];}return this[_0x2ef1('0x17')](_0x37b207);}};EmailChannel[_0x2ef1('0xf')][_0x2ef1('0x1e')]=function(_0x59cbf5,_0x48e915){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x48e915['firstName'],_0x48e915[_0x2ef1('0x27')],_0x48e915[_0x2ef1('0x28')],_0x59cbf5);if(this['mailAccounts'][_0x59cbf5]){return mailAccount[_0x2ef1('0x29')](_0x59cbf5,_0x48e915)['then'](function(_0x1ea4bc){if(_0x1ea4bc){logger[_0x2ef1('0xa')](_0x2ef1('0x2a'));}})['catch'](function(_0xb25a68){logger[_0x2ef1('0x20')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x2ef1('0x16')](_0xb25a68));});}};EmailChannel[_0x2ef1('0xf')]['handleImapEnd']=function(_0x3770dc){if(this['mailAccounts'][_0x3770dc]&&this[_0x2ef1('0xc')][_0x3770dc][_0x2ef1('0x13')]){if(this['imapAccounts'][this['mailAccounts'][_0x3770dc][_0x2ef1('0x13')]['id']]){delete this['imapAccounts'][this[_0x2ef1('0xc')][_0x3770dc]['Imap']['id']];}this[_0x2ef1('0xc')][_0x3770dc][_0x2ef1('0x13')]['lastSync']=moment();this[_0x2ef1('0x17')](_0x3770dc);}};EmailChannel['prototype']['handleImapError']=function(_0x18e17f,_0x31c3fb){if(this[_0x2ef1('0xc')][_0x18e17f]){this[_0x2ef1('0xc')][_0x18e17f][_0x2ef1('0x13')][_0x2ef1('0x22')]=_0x2ef1('0x20');this[_0x2ef1('0xc')][_0x18e17f][_0x2ef1('0x13')][_0x2ef1('0x23')]=_0x31c3fb;return this['emit'](_0x18e17f);}};EmailChannel[_0x2ef1('0xf')][_0x2ef1('0x2b')]=function(_0x3fe01b,_0x1f9f80){return this[_0x2ef1('0xe')][_0x2ef1('0x2c')](_0x3fe01b,_0x1f9f80);};EmailChannel[_0x2ef1('0xf')][_0x2ef1('0x2d')]=function(_0x312501){var _0x2553f4=this;if(this[_0x2ef1('0xc')][_0x312501['id']]){if(_[_0x2ef1('0x15')](this[_0x2ef1('0xc')][_0x312501['id']]['Smtp'])){this[_0x2ef1('0xc')][_0x312501['id']][_0x2ef1('0x2e')]={};}this[_0x2ef1('0xc')][_0x312501['id']][_0x2ef1('0x2e')]['lastSync']=moment();return new BPromise(function(_0x17e6d3,_0x5a0738){return _0x2553f4[_0x2ef1('0xe')][_0x2ef1('0x2f')](_0x312501)[_0x2ef1('0x30')](function(_0x9e5f62){_0x2553f4[_0x2ef1('0xc')][_0x312501['id']][_0x2ef1('0x2e')][_0x2ef1('0x22')]=_0x2ef1('0x31');_0x2553f4[_0x2ef1('0xc')][_0x312501['id']][_0x2ef1('0x2e')][_0x2ef1('0x23')]='';_0x2553f4[_0x2ef1('0x17')](_0x312501['id']);_0x17e6d3(_0x9e5f62);})['catch'](function(_0x5d52d3){_0x2553f4[_0x2ef1('0xc')][_0x312501['id']][_0x2ef1('0x2e')][_0x2ef1('0x22')]=_0x2ef1('0x20');_0x2553f4['mailAccounts'][_0x312501['id']][_0x2ef1('0x2e')][_0x2ef1('0x23')]=_0x5d52d3;_0x2553f4[_0x2ef1('0x17')](_0x312501['id']);_0x5a0738(_0x5d52d3);});});}return this[_0x2ef1('0xe')][_0x2ef1('0x2f')](_0x312501);};module[_0x2ef1('0x32')]=EmailChannel; \ No newline at end of file +var _0x6dcf=['Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','sendMail','send','verifySmtp','Smtp','lastSync','verified','verify','lodash','moment','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','info','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','status','Imap','messageStatus','total','stringify','mailAccount:update','refresh','service','provider','custom','hasOwnProperty','box','handleImapEmail','end','handleImapEnd','bind','error','handleImapError','isNil','disabled','handleImapBox','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then'];(function(_0x2d35b5,_0x520c90){var _0x333e77=function(_0x260f8a){while(--_0x260f8a){_0x2d35b5['push'](_0x2d35b5['shift']());}};_0x333e77(++_0x520c90);}(_0x6dcf,0xbb));var _0xf6dc=function(_0x28cdcb,_0x51045f){_0x28cdcb=_0x28cdcb-0x0;var _0x1fa8ef=_0x6dcf[_0x28cdcb];return _0x1fa8ef;};'use strict';var _=require(_0xf6dc('0x0'));var moment=require(_0xf6dc('0x1'));var BPromise=require(_0xf6dc('0x2'));var md5=require(_0xf6dc('0x3'));var Redis=require('ioredis');var config=require(_0xf6dc('0x4'));var logger=require(_0xf6dc('0x5'))(_0xf6dc('0x6'));config[_0xf6dc('0x7')]=_[_0xf6dc('0x8')](config[_0xf6dc('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xf6dc('0x9'))(new Redis(config[_0xf6dc('0x7')]));var EmailImap=require(_0xf6dc('0xa'));var EmailSmtp=require(_0xf6dc('0xb'));var mailAccount=require('../rpc/mailAccount');var md5Accounts={};function EmailChannel(_0x5c9b5d){logger[_0xf6dc('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x5c9b5d[_0xf6dc('0xd')];this[_0xf6dc('0xe')]={};this[_0xf6dc('0xf')]=new EmailSmtp();}EmailChannel[_0xf6dc('0x10')][_0xf6dc('0x11')]=function(_0x46e1b8){var _0x220f2c=this[_0xf6dc('0xd')][_0x46e1b8];var _0x318405={'id':_0x220f2c['id'],'name':_0x220f2c[_0xf6dc('0x12')],'key':_0x220f2c[_0xf6dc('0x13')],'active':_0x220f2c[_0xf6dc('0x14')],'Imap':{'status':_0x220f2c['Imap'][_0xf6dc('0x15')],'messageStatus':_0x220f2c[_0xf6dc('0x16')][_0xf6dc('0x17')],'total':_0x220f2c[_0xf6dc('0x16')][_0xf6dc('0x18')]}};if(_['isNil'](md5Accounts[_0x46e1b8])){md5Accounts[_0x46e1b8]={};}var _0x356f9c=md5(JSON[_0xf6dc('0x19')](_0x318405));if(md5Accounts[_0x46e1b8][_0xf6dc('0x3')]!==_0x356f9c){md5Accounts[_0x46e1b8][_0xf6dc('0x3')]=_0x356f9c;io[_0xf6dc('0x11')](_0xf6dc('0x1a'),_0x318405);}};EmailChannel['prototype'][_0xf6dc('0x1b')]=function(_0x2cc3f7){for(var _0x43c2be in _0x2cc3f7){if(_0x2cc3f7['hasOwnProperty'](_0x43c2be)){if(_0x2cc3f7[_0x43c2be]['Imap']&&_0x2cc3f7[_0x43c2be][_0xf6dc('0x14')]){var _0x574278=_0x2cc3f7[_0x43c2be][_0xf6dc('0x16')];if(!_0x574278[_0xf6dc('0x1c')]&&_0x2cc3f7[_0x43c2be][_0xf6dc('0x1d')]!==_0xf6dc('0x1e'))_0x574278['service']=_0x2cc3f7[_0x43c2be]['provider'];if(!this[_0xf6dc('0xe')][_0xf6dc('0x1f')](_0x574278['id'])){this[_0xf6dc('0xe')][_0x574278['id']]=new EmailImap(_0x574278,_0x2cc3f7[_0x43c2be][_0xf6dc('0x6')]);this[_0xf6dc('0xe')][_0x574278['id']]['on'](_0xf6dc('0x20'),this['handleImapBox']['bind'](this,_0x43c2be));this[_0xf6dc('0xe')][_0x574278['id']]['on'](_0xf6dc('0x6'),this[_0xf6dc('0x21')]['bind'](this,_0x43c2be));this['imapAccounts'][_0x574278['id']]['on'](_0xf6dc('0x22'),this[_0xf6dc('0x23')][_0xf6dc('0x24')](this,_0x43c2be));this[_0xf6dc('0xe')][_0x574278['id']]['on'](_0xf6dc('0x25'),this[_0xf6dc('0x26')][_0xf6dc('0x24')](this,_0x43c2be));}}else{if(_[_0xf6dc('0x27')](this[_0xf6dc('0xd')][_0x43c2be][_0xf6dc('0x16')])){this['mailAccounts'][_0x43c2be][_0xf6dc('0x16')]={};}this['mailAccounts'][_0x43c2be][_0xf6dc('0x16')][_0xf6dc('0x15')]=_0xf6dc('0x28');this[_0xf6dc('0xd')][_0x43c2be][_0xf6dc('0x16')][_0xf6dc('0x17')]='';this[_0xf6dc('0x11')](_0x43c2be);}}}};EmailChannel[_0xf6dc('0x10')][_0xf6dc('0x29')]=function(_0x5a7bdc,_0x5d1f2c){if(this[_0xf6dc('0xd')][_0x5a7bdc]){this[_0xf6dc('0xd')][_0x5a7bdc][_0xf6dc('0x16')][_0xf6dc('0x15')]='connected';this['mailAccounts'][_0x5a7bdc]['Imap'][_0xf6dc('0x17')]=_0x5d1f2c['name'];if(_0x5d1f2c[_0xf6dc('0x2a')]){this[_0xf6dc('0xd')][_0x5a7bdc][_0xf6dc('0x16')][_0xf6dc('0x18')]=_0x5d1f2c[_0xf6dc('0x2a')]['total'];}return this[_0xf6dc('0x11')](_0x5a7bdc);}};EmailChannel['prototype'][_0xf6dc('0x21')]=function(_0x1f2103,_0x41768e){logger[_0xf6dc('0xc')](_0xf6dc('0x2b'),_0x41768e[_0xf6dc('0x2c')],_0x41768e[_0xf6dc('0x2d')],_0x41768e[_0xf6dc('0x2e')],_0x1f2103);if(this[_0xf6dc('0xd')][_0x1f2103]){return mailAccount[_0xf6dc('0x2f')](_0x1f2103,_0x41768e)[_0xf6dc('0x30')](function(_0x4c227f){if(_0x4c227f){logger[_0xf6dc('0xc')](_0xf6dc('0x31'));}})[_0xf6dc('0x32')](function(_0x22879b){logger['error'](_0xf6dc('0x33'),JSON['stringify'](_0x22879b));});}};EmailChannel[_0xf6dc('0x10')][_0xf6dc('0x23')]=function(_0x5c139c){if(this[_0xf6dc('0xd')][_0x5c139c]&&this[_0xf6dc('0xd')][_0x5c139c][_0xf6dc('0x16')]){if(this[_0xf6dc('0xe')][this[_0xf6dc('0xd')][_0x5c139c][_0xf6dc('0x16')]['id']]){delete this['imapAccounts'][this[_0xf6dc('0xd')][_0x5c139c][_0xf6dc('0x16')]['id']];}this[_0xf6dc('0xd')][_0x5c139c][_0xf6dc('0x16')]['lastSync']=moment();this[_0xf6dc('0x11')](_0x5c139c);}};EmailChannel['prototype'][_0xf6dc('0x26')]=function(_0x3b6ba1,_0x16d316){if(this[_0xf6dc('0xd')][_0x3b6ba1]){this['mailAccounts'][_0x3b6ba1][_0xf6dc('0x16')][_0xf6dc('0x15')]='error';this[_0xf6dc('0xd')][_0x3b6ba1]['Imap'][_0xf6dc('0x17')]=_0x16d316;return this[_0xf6dc('0x11')](_0x3b6ba1);}};EmailChannel[_0xf6dc('0x10')][_0xf6dc('0x34')]=function(_0x393158,_0x13f0b0){return this['smtp'][_0xf6dc('0x35')](_0x393158,_0x13f0b0);};EmailChannel['prototype'][_0xf6dc('0x36')]=function(_0x69237f){var _0x33ba59=this;if(this[_0xf6dc('0xd')][_0x69237f['id']]){if(_[_0xf6dc('0x27')](this['mailAccounts'][_0x69237f['id']][_0xf6dc('0x37')])){this[_0xf6dc('0xd')][_0x69237f['id']][_0xf6dc('0x37')]={};}this[_0xf6dc('0xd')][_0x69237f['id']][_0xf6dc('0x37')][_0xf6dc('0x38')]=moment();return new BPromise(function(_0x2d7802,_0x421d48){return _0x33ba59['smtp']['verify'](_0x69237f)[_0xf6dc('0x30')](function(_0x6a5bca){_0x33ba59[_0xf6dc('0xd')][_0x69237f['id']][_0xf6dc('0x37')][_0xf6dc('0x15')]=_0xf6dc('0x39');_0x33ba59[_0xf6dc('0xd')][_0x69237f['id']]['Smtp']['messageStatus']='';_0x33ba59[_0xf6dc('0x11')](_0x69237f['id']);_0x2d7802(_0x6a5bca);})[_0xf6dc('0x32')](function(_0x5192b4){_0x33ba59[_0xf6dc('0xd')][_0x69237f['id']]['Smtp'][_0xf6dc('0x15')]=_0xf6dc('0x25');_0x33ba59[_0xf6dc('0xd')][_0x69237f['id']][_0xf6dc('0x37')][_0xf6dc('0x17')]=_0x5192b4;_0x33ba59[_0xf6dc('0x11')](_0x69237f['id']);_0x421d48(_0x5192b4);});});}return this[_0xf6dc('0xf')][_0xf6dc('0x3a')](_0x69237f);};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 45ed4c7..d2208b5 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 _0xfdbd=['error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','password','host','port','tls','autotls','required','modernAuthentication','generateXOAuth2Token','CloudProvider','data5','user','email','anonymous@xcally.com','openBox','mailbox','handleOpenBox','emit','readUnseen','handleCloseBox','end','search','handleReadUnseen','length','fetch','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','account','textCode','hasOwnProperty','exports','lodash','util','imap','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','../../../config/logger','getAccount','once','ready','handleReady','bind','handleEnd'];(function(_0x15dd4f,_0x4146a3){var _0x1c0753=function(_0x5947d8){while(--_0x5947d8){_0x15dd4f['push'](_0x15dd4f['shift']());}};_0x1c0753(++_0x4146a3);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x4c9380,_0x2fefc0){_0x4c9380=_0x4c9380-0x0;var _0x49a523=_0xfdbd[_0x4c9380];return _0x49a523;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var Imap=require(_0xdfdb('0x2'));var simpleParser=require(_0xdfdb('0x3'))[_0xdfdb('0x4')];var Iconv=require(_0xdfdb('0x5'))[_0xdfdb('0x6')];var EventEmitter=require(_0xdfdb('0x7'))[_0xdfdb('0x8')];var utils=require('./utils');var logger=require(_0xdfdb('0x9'))('email');function EmailImap(_0x453ef6,_0x41bd5e){this['mailbox']='INBOX';this['account']=this[_0xdfdb('0xa')](_0x453ef6,_0x41bd5e);this[_0xdfdb('0x2')]=new Imap(this['account']);this[_0xdfdb('0x2')][_0xdfdb('0xb')](_0xdfdb('0xc'),this[_0xdfdb('0xd')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0xb')]('end',this[_0xdfdb('0xf')][_0xdfdb('0xe')](this));this['imap']['on'](_0xdfdb('0x10'),this[_0xdfdb('0x11')][_0xdfdb('0xe')](this));this[_0xdfdb('0x2')][_0xdfdb('0x12')]();}util[_0xdfdb('0x13')](EmailImap,EventEmitter);EmailImap[_0xdfdb('0x14')][_0xdfdb('0xa')]=function(_0x51162f,_0x48a66a){var _0x2c44dc={'connTimeout':_0x51162f['connTimeout']?_0x51162f[_0xdfdb('0x15')]*0x3e8:0x2710,'authTimeout':_0x51162f[_0xdfdb('0x16')]?_0x51162f[_0xdfdb('0x16')]*0x3e8:0x1388};if(_[_0xdfdb('0x17')](_0x51162f[_0xdfdb('0x18')])){if(_0x51162f[_0xdfdb('0x19')]){_0x2c44dc['user']=_0x51162f['user'];_0x2c44dc[_0xdfdb('0x1a')]=_0x51162f[_0xdfdb('0x1a')];}_0x2c44dc[_0xdfdb('0x1b')]=_0x51162f['host'];_0x2c44dc[_0xdfdb('0x1c')]=_0x51162f[_0xdfdb('0x1c')]||0x3e1;if(_0x51162f[_0xdfdb('0x1d')]){_0x2c44dc[_0xdfdb('0x1d')]=!![];}else{_0x2c44dc[_0xdfdb('0x1d')]=![];_0x2c44dc[_0xdfdb('0x1e')]=_0xdfdb('0x1f');}}else{if(_0x51162f[_0xdfdb('0x20')]){_0x2c44dc['xoauth2']=utils[_0xdfdb('0x21')](_0x51162f[_0xdfdb('0x22')][_0xdfdb('0x23')],_0x51162f['user']);_0x2c44dc[_0xdfdb('0x24')]=_0x51162f[_0xdfdb('0x24')];}else{_0x2c44dc[_0xdfdb('0x24')]=_0x51162f['user'];_0x2c44dc[_0xdfdb('0x1a')]=_0x51162f[_0xdfdb('0x1a')];}_0x2c44dc[_0xdfdb('0x1b')]=utils['getHost'](_0x51162f[_0xdfdb('0x18')]);_0x2c44dc['port']=0x3e1;_0x2c44dc[_0xdfdb('0x1d')]=!![];}_0x2c44dc[_0xdfdb('0x25')]=_0x48a66a||_0x51162f[_0xdfdb('0x24')]||_0xdfdb('0x26');return _0x2c44dc;};EmailImap['prototype'][_0xdfdb('0xd')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x27')](this[_0xdfdb('0x28')],![],this[_0xdfdb('0x29')][_0xdfdb('0xe')](this));};EmailImap['prototype'][_0xdfdb('0x29')]=function(_0x2d5fe2,_0xdf3a5c){if(_0x2d5fe2){this['handleError'](_0x2d5fe2,!![]);}else{this[_0xdfdb('0x2a')]('box',_0xdf3a5c);this[_0xdfdb('0x2b')]();}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2c')]=function(_0x513fa0){if(_0x513fa0){this['handleError'](_0x513fa0,!![]);}else{this[_0xdfdb('0x2')][_0xdfdb('0x2d')]();}};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2b')]=function(){this[_0xdfdb('0x2')][_0xdfdb('0x2e')](['UNSEEN'],this[_0xdfdb('0x2f')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x2f')]=function(_0x10f4f6,_0x157de8){if(_0x10f4f6){this[_0xdfdb('0x11')](_0x10f4f6,!![]);}else{if(_0x157de8[_0xdfdb('0x30')]){try{var _0x68398d=this[_0xdfdb('0x2')][_0xdfdb('0x31')](_0x157de8,{'bodies':'','markSeen':!![]});_0x68398d['on']('message',this['handleFetchMessage'][_0xdfdb('0xe')](this));_0x68398d['once'](_0xdfdb('0x10'),this[_0xdfdb('0x32')][_0xdfdb('0xe')](this));_0x68398d[_0xdfdb('0xb')]('end',this[_0xdfdb('0x33')]['bind'](this));}catch(_0x341f0d){logger[_0xdfdb('0x10')](_0x341f0d);}}else{this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')][_0xdfdb('0xe')](this));}}};EmailImap['prototype'][_0xdfdb('0x35')]=function(_0xd8528d){_0xd8528d['on']('body',this[_0xdfdb('0x36')][_0xdfdb('0xe')](this));_0xd8528d[_0xdfdb('0xb')](_0xdfdb('0x37'),this[_0xdfdb('0x38')][_0xdfdb('0xe')](this));_0xd8528d[_0xdfdb('0xb')](_0xdfdb('0x2d'),this[_0xdfdb('0x39')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleMessageBody']=function(_0x2defcc){simpleParser(_0x2defcc,{'Iconv':Iconv},this[_0xdfdb('0x3a')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x38')]=function(){};EmailImap[_0xdfdb('0x14')][_0xdfdb('0x39')]=function(){};EmailImap[_0xdfdb('0x14')]['handleSimpleParser']=function(_0x55d707,_0x435557){if(_0x55d707){logger[_0xdfdb('0x10')](_0x55d707);}else{var _0x16e100=this;utils[_0xdfdb('0x3b')](this[_0xdfdb('0x3c')],_0x435557,function(_0x300884){_0x16e100[_0xdfdb('0x2a')](_0xdfdb('0x25'),_0x300884);});}};EmailImap[_0xdfdb('0x14')]['handleFetchEnd']=function(){this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')][_0xdfdb('0xe')](this));};EmailImap[_0xdfdb('0x14')]['handleFetchError']=function(_0x281cec){this[_0xdfdb('0x11')](_0x281cec);this[_0xdfdb('0x2')][_0xdfdb('0x34')](!![],this[_0xdfdb('0x2c')]['bind'](this));};EmailImap[_0xdfdb('0x14')][_0xdfdb('0xf')]=function(){this[_0xdfdb('0x2a')]('end');};EmailImap[_0xdfdb('0x14')]['handleError']=function(_0x4c9850,_0x4ce8de){logger[_0xdfdb('0x10')](_0xdfdb('0x11'),this['account'][_0xdfdb('0x25')],JSON['stringify'](_0x4c9850));var _0xfea790='';if(_0x4c9850){if(_0x4c9850[_0xdfdb('0x3d')]){_0xfea790=_0x4c9850[_0xdfdb('0x3d')];}else{for(var _0x2566f8 in _0x4c9850){if(_0x4c9850[_0xdfdb('0x3e')](_0x2566f8)){_0xfea790+=_['upperFirst'](_0x2566f8)+':\x20'+_0x4c9850[_0x2566f8]+'\x0a';}}}}if(_0x4ce8de){this['imap'][_0xdfdb('0x2d')]();}else{this[_0xdfdb('0x2a')]('error',_0xfea790);this[_0xdfdb('0x2a')]('end');}};module[_0xdfdb('0x3f')]=EmailImap; \ No newline at end of file +var _0x5fab=['../../../config/logger','email','INBOX','account','getAccount','imap','once','bind','end','handleEnd','error','handleError','connect','prototype','connTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','modernAuthentication','xoauth2','CloudProvider','handleReady','openBox','mailbox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','message','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchError','stringify','textCode','hasOwnProperty','exports','lodash','util','mailparser','simpleParser','iconv','Iconv','events','EventEmitter','./utils'];(function(_0x5ac432,_0x26e040){var _0x48be76=function(_0x2310e4){while(--_0x2310e4){_0x5ac432['push'](_0x5ac432['shift']());}};_0x48be76(++_0x26e040);}(_0x5fab,0x177));var _0xb5fa=function(_0x4e7c1c,_0x56eafd){_0x4e7c1c=_0x4e7c1c-0x0;var _0x47adb2=_0x5fab[_0x4e7c1c];return _0x47adb2;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var Imap=require('imap');var simpleParser=require(_0xb5fa('0x2'))[_0xb5fa('0x3')];var Iconv=require(_0xb5fa('0x4'))[_0xb5fa('0x5')];var EventEmitter=require(_0xb5fa('0x6'))[_0xb5fa('0x7')];var utils=require(_0xb5fa('0x8'));var logger=require(_0xb5fa('0x9'))(_0xb5fa('0xa'));function EmailImap(_0x44df89,_0x4a0249){this['mailbox']=_0xb5fa('0xb');this[_0xb5fa('0xc')]=this[_0xb5fa('0xd')](_0x44df89,_0x4a0249);this['imap']=new Imap(this[_0xb5fa('0xc')]);this[_0xb5fa('0xe')][_0xb5fa('0xf')]('ready',this['handleReady'][_0xb5fa('0x10')](this));this[_0xb5fa('0xe')][_0xb5fa('0xf')](_0xb5fa('0x11'),this[_0xb5fa('0x12')][_0xb5fa('0x10')](this));this[_0xb5fa('0xe')]['on'](_0xb5fa('0x13'),this[_0xb5fa('0x14')]['bind'](this));this[_0xb5fa('0xe')][_0xb5fa('0x15')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xb5fa('0x16')]['getAccount']=function(_0x265992,_0x3fc372){var _0x40c914={'connTimeout':_0x265992[_0xb5fa('0x17')]?_0x265992[_0xb5fa('0x17')]*0x3e8:0x2710,'authTimeout':_0x265992['authTimeout']?_0x265992['authTimeout']*0x3e8:0x1388};if(_[_0xb5fa('0x18')](_0x265992[_0xb5fa('0x19')])){if(_0x265992[_0xb5fa('0x1a')]){_0x40c914[_0xb5fa('0x1b')]=_0x265992['user'];_0x40c914['password']=_0x265992[_0xb5fa('0x1c')];}_0x40c914[_0xb5fa('0x1d')]=_0x265992[_0xb5fa('0x1d')];_0x40c914[_0xb5fa('0x1e')]=_0x265992[_0xb5fa('0x1e')]||0x3e1;if(_0x265992[_0xb5fa('0x1f')]){_0x40c914[_0xb5fa('0x1f')]=!![];}else{_0x40c914[_0xb5fa('0x1f')]=![];_0x40c914[_0xb5fa('0x20')]=_0xb5fa('0x21');}}else{if(_0x265992[_0xb5fa('0x22')]){_0x40c914[_0xb5fa('0x23')]=utils['generateXOAuth2Token'](_0x265992[_0xb5fa('0x24')]['data5'],_0x265992[_0xb5fa('0x1b')]);_0x40c914['user']=_0x265992[_0xb5fa('0x1b')];}else{_0x40c914[_0xb5fa('0x1b')]=_0x265992['user'];_0x40c914[_0xb5fa('0x1c')]=_0x265992[_0xb5fa('0x1c')];}_0x40c914[_0xb5fa('0x1d')]=utils['getHost'](_0x265992[_0xb5fa('0x19')]);_0x40c914[_0xb5fa('0x1e')]=0x3e1;_0x40c914[_0xb5fa('0x1f')]=!![];}_0x40c914['email']=_0x3fc372||_0x265992[_0xb5fa('0x1b')]||'anonymous@xcally.com';return _0x40c914;};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x25')]=function(){this[_0xb5fa('0xe')][_0xb5fa('0x26')](this[_0xb5fa('0x27')],![],this[_0xb5fa('0x28')][_0xb5fa('0x10')](this));};EmailImap[_0xb5fa('0x16')]['handleOpenBox']=function(_0x4ec294,_0x5bdf11){if(_0x4ec294){this['handleError'](_0x4ec294,!![]);}else{this[_0xb5fa('0x29')](_0xb5fa('0x2a'),_0x5bdf11);this[_0xb5fa('0x2b')]();}};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x2c')]=function(_0x3506a4){if(_0x3506a4){this[_0xb5fa('0x14')](_0x3506a4,!![]);}else{this[_0xb5fa('0xe')][_0xb5fa('0x11')]();}};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x2b')]=function(){this[_0xb5fa('0xe')][_0xb5fa('0x2d')]([_0xb5fa('0x2e')],this[_0xb5fa('0x2f')][_0xb5fa('0x10')](this));};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x2f')]=function(_0x21fc7e,_0x319c48){if(_0x21fc7e){this[_0xb5fa('0x14')](_0x21fc7e,!![]);}else{if(_0x319c48[_0xb5fa('0x30')]){try{var _0x10fb43=this[_0xb5fa('0xe')]['fetch'](_0x319c48,{'bodies':'','markSeen':!![]});_0x10fb43['on'](_0xb5fa('0x31'),this['handleFetchMessage']['bind'](this));_0x10fb43['once'](_0xb5fa('0x13'),this['handleFetchError'][_0xb5fa('0x10')](this));_0x10fb43['once']('end',this[_0xb5fa('0x32')][_0xb5fa('0x10')](this));}catch(_0x4a4bff){logger['error'](_0x4a4bff);}}else{this[_0xb5fa('0xe')][_0xb5fa('0x33')](!![],this[_0xb5fa('0x2c')]['bind'](this));}}};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x34')]=function(_0x4a7137){_0x4a7137['on'](_0xb5fa('0x35'),this[_0xb5fa('0x36')][_0xb5fa('0x10')](this));_0x4a7137['once'](_0xb5fa('0x37'),this[_0xb5fa('0x38')][_0xb5fa('0x10')](this));_0x4a7137['once'](_0xb5fa('0x11'),this[_0xb5fa('0x39')][_0xb5fa('0x10')](this));};EmailImap[_0xb5fa('0x16')]['handleMessageBody']=function(_0x4bba91){simpleParser(_0x4bba91,{'Iconv':Iconv},this['handleSimpleParser']['bind'](this));};EmailImap['prototype']['handleMessageAttributes']=function(){};EmailImap[_0xb5fa('0x16')]['handleMessageEnd']=function(){};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x3a')]=function(_0x36db1a,_0x30b288){if(_0x36db1a){logger[_0xb5fa('0x13')](_0x36db1a);}else{var _0x269d21=this;utils['parser'](this['account'],_0x30b288,function(_0x4c4bf0){_0x269d21[_0xb5fa('0x29')]('email',_0x4c4bf0);});}};EmailImap[_0xb5fa('0x16')]['handleFetchEnd']=function(){this['imap'][_0xb5fa('0x33')](!![],this[_0xb5fa('0x2c')][_0xb5fa('0x10')](this));};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x3b')]=function(_0x26ef1b){this[_0xb5fa('0x14')](_0x26ef1b);this[_0xb5fa('0xe')][_0xb5fa('0x33')](!![],this[_0xb5fa('0x2c')]['bind'](this));};EmailImap[_0xb5fa('0x16')]['handleEnd']=function(){this[_0xb5fa('0x29')](_0xb5fa('0x11'));};EmailImap[_0xb5fa('0x16')][_0xb5fa('0x14')]=function(_0x1c706b,_0x3954b2){logger[_0xb5fa('0x13')](_0xb5fa('0x14'),this['account'][_0xb5fa('0xa')],JSON[_0xb5fa('0x3c')](_0x1c706b));var _0x59ae64='';if(_0x1c706b){if(_0x1c706b[_0xb5fa('0x3d')]){_0x59ae64=_0x1c706b['textCode'];}else{for(var _0x368a01 in _0x1c706b){if(_0x1c706b[_0xb5fa('0x3e')](_0x368a01)){_0x59ae64+=_['upperFirst'](_0x368a01)+':\x20'+_0x1c706b[_0x368a01]+'\x0a';}}}}if(_0x3954b2){this['imap'][_0xb5fa('0x11')]();}else{this[_0xb5fa('0x29')](_0xb5fa('0x13'),_0x59ae64);this[_0xb5fa('0x29')](_0xb5fa('0x11'));}};module[_0xb5fa('0x3f')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index ac8c33b..6760547 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 _0x2077=['compile','toString','verify','Not\x20verified','exports','nodemailer','prototype','send','createTransport','use'];(function(_0x300766,_0x45d9e6){var _0x2b7465=function(_0x3af1a7){while(--_0x3af1a7){_0x300766['push'](_0x300766['shift']());}};_0x2b7465(++_0x45d9e6);}(_0x2077,0x1d1));var _0x7207=function(_0x7b92d7,_0x37466a){_0x7b92d7=_0x7b92d7-0x0;var _0x132089=_0x2077[_0x7b92d7];return _0x132089;};'use strict';var nodemailer=require(_0x7207('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x7207('0x1')][_0x7207('0x2')]=function(_0x162c27,_0x1af5e4){return new Promise(function(_0x4d857b,_0x10e28d){var _0x123649=nodemailer[_0x7207('0x3')](_0x162c27);_0x123649[_0x7207('0x4')](_0x7207('0x5'),inlineBase64());_0x123649['sendMail'](_0x1af5e4,function(_0x4e616e,_0x4a01ff){if(_0x4e616e)return _0x10e28d(_0x4e616e[_0x7207('0x6')]());return _0x4d857b(_0x4a01ff);});});};EmailSmtp['prototype'][_0x7207('0x7')]=function(_0x451061){return new Promise(function(_0x1d9e99,_0x1a0c7c){var _0x42a58d=nodemailer['createTransport'](_0x451061);_0x42a58d['verify'](function(_0x440da0,_0x307fb3){if(_0x440da0)return _0x1a0c7c(_0x440da0['toString']());if(!_0x307fb3)return _0x1a0c7c(_0x7207('0x8'));return _0x1d9e99(_0x307fb3);});});};module[_0x7207('0x9')]=EmailSmtp; \ No newline at end of file +var _0xeff8=['toString','verify','Not\x20verified','nodemailer','prototype','send','createTransport','use','compile','sendMail'];(function(_0x5f4d45,_0x53e01f){var _0x4eebea=function(_0x2f9768){while(--_0x2f9768){_0x5f4d45['push'](_0x5f4d45['shift']());}};_0x4eebea(++_0x53e01f);}(_0xeff8,0x111));var _0x8eff=function(_0x45fc6a,_0x166adb){_0x45fc6a=_0x45fc6a-0x0;var _0x14bcfd=_0xeff8[_0x45fc6a];return _0x14bcfd;};'use strict';var nodemailer=require(_0x8eff('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x8eff('0x1')][_0x8eff('0x2')]=function(_0xbd922c,_0xd64e3e){return new Promise(function(_0x410042,_0x3e89c6){var _0x5503b8=nodemailer[_0x8eff('0x3')](_0xbd922c);_0x5503b8[_0x8eff('0x4')](_0x8eff('0x5'),inlineBase64());_0x5503b8[_0x8eff('0x6')](_0xd64e3e,function(_0x4b4405,_0x26577d){if(_0x4b4405)return _0x3e89c6(_0x4b4405[_0x8eff('0x7')]());return _0x410042(_0x26577d);});});};EmailSmtp[_0x8eff('0x1')][_0x8eff('0x8')]=function(_0x3ebd91){return new Promise(function(_0x109e7c,_0x20265e){var _0x5aa2a5=nodemailer['createTransport'](_0x3ebd91);_0x5aa2a5[_0x8eff('0x8')](function(_0x3398cc,_0x4e202a){if(_0x3398cc)return _0x20265e(_0x3398cc[_0x8eff('0x7')]());if(!_0x4e202a)return _0x20265e(_0x8eff('0x9'));return _0x109e7c(_0x4e202a);});});};module['exports']=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 8084672..7ce5314 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 _0x3a07=['util','node-tnef','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','length','slice','join','isEmpty','html','includes','Empty\x20message

','Attachments','Data','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','127.0.0.1','user=','utf-8','toString','base64','lodash','moment','randomstring','path'];(function(_0x2883dd,_0x51643d){var _0x91779b=function(_0x1d1125){while(--_0x1d1125){_0x2883dd['push'](_0x2883dd['shift']());}};_0x91779b(++_0x51643d);}(_0x3a07,0xd4));var _0x73a0=function(_0x1965a8,_0x4f1746){_0x1965a8=_0x1965a8-0x0;var _0x109095=_0x3a07[_0x1965a8];return _0x109095;};'use strict';var _=require(_0x73a0('0x0'));var moment=require(_0x73a0('0x1'));var random=require(_0x73a0('0x2'));var fs=require('fs');var path=require(_0x73a0('0x3'));var util=require(_0x73a0('0x4'));var tnef=require(_0x73a0('0x5'));var logger=require('../../../config/logger')('email');var config=require(_0x73a0('0x6'));function getAddress(_0x201d05){var _0x2f4792=_[_0x73a0('0x7')](_0x201d05[_0x73a0('0x8')]);return _0x2f4792&&_0x2f4792[_0x73a0('0x9')]?_0x2f4792[_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x4cf9a5){var _0x44ea5f=_[_0x73a0('0x7')](_0x4cf9a5[_0x73a0('0x8')]);if(_0x44ea5f&&_0x44ea5f[_0x73a0('0xc')]){if(_0x44ea5f[_0x73a0('0xc')]==_0x44ea5f[_0x73a0('0x9')]){return _0x44ea5f[_0x73a0('0xc')][_0x73a0('0xd')](0x0,_0x44ea5f['name'][_0x73a0('0xe')]('@'));}var _0x3e4905=_0x44ea5f[_0x73a0('0xc')][_0x73a0('0xf')](/\s+/);return _0x3e4905[_0x73a0('0x10')]>0x1?_0x3e4905[_0x73a0('0x11')](0x0,-0x1)[_0x73a0('0x12')]('\x20'):_0x44ea5f[_0x73a0('0xc')];}return'Anonymous';}function getLastName(_0x3ab165){var _0x587c66=_[_0x73a0('0x7')](_0x3ab165['value']);if(_0x587c66&&_0x587c66[_0x73a0('0xc')]){var _0x5a15d8=_0x587c66[_0x73a0('0xc')][_0x73a0('0xf')](/\s+/);return _0x5a15d8[_0x73a0('0x10')]>0x1?_0x5a15d8['pop']():'';}return'';}function getMails(_0x540855,_0x13de37){var _0x313359='';for(var _0x49ad1d=0x0;_0x49ad1d<_0x13de37[_0x73a0('0x8')][_0x73a0('0x10')];_0x49ad1d+=0x1){if(_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]!==_0x540855){if(!_[_0x73a0('0x13')](_0x313359)){_0x313359+=',';}_0x313359+=_0x13de37[_0x73a0('0x8')][_0x49ad1d]['name']||_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]||'';_0x313359+='\x20<';_0x313359+=_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]?_0x13de37[_0x73a0('0x8')][_0x49ad1d][_0x73a0('0x9')]:_0x73a0('0xa')+random[_0x73a0('0xb')](0x6)+'@xcally.com';_0x313359+='>';}}return _0x313359;}function parseEmail(_0x1cc81f,_0x77cd6f,_0xeb84a2){if(_0x77cd6f[_0x73a0('0x14')]){var _0x1c5968=/)<[^<]*)*<\/script>/gi;while(_0x1c5968['test'](_0x77cd6f[_0x73a0('0x14')])){_0x77cd6f[_0x73a0('0x14')]=_0x77cd6f['html']['replace'](_0x1c5968,'');}if(_0x77cd6f[_0x73a0('0x14')][_0x73a0('0x15')](_0x73a0('0x16'))){var _0xcd9a8b=[];_0x77cd6f[_0x73a0('0x17')]['forEach'](_0x1fe9d4=>{_0xcd9a8b[_0x73a0('0x18')](_0x1fe9d4[_0x73a0('0x19')]);});var _0x571d7c=/]+>/g;var _0x5eadab=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x5791e7=_0x77cd6f[_0x73a0('0x14')][_0x73a0('0x1a')](_0x5eadab,_0x73a0('0x1b'));var _0x1bce7f=_0x5791e7[_0x73a0('0x1a')](_0x571d7c,_0x73a0('0x1c'));for(let _0x4d8d00=0x0;_0x4d8d00<_0xcd9a8b[_0x73a0('0x10')];_0x4d8d00++){var _0x2fd3a5=_0x1bce7f[_0x73a0('0x1a')](_0x73a0('0x1c'),'\x20[Attachment:\x20'+_0xcd9a8b[_0x4d8d00]+'\x20]');_0x1bce7f=_0x2fd3a5;}_0x77cd6f[_0x73a0('0x14')]=_0x1bce7f;}_0xeb84a2[_0x73a0('0x1d')]=_0x77cd6f[_0x73a0('0x14')];}else{_0xeb84a2[_0x73a0('0x1d')]=_0x77cd6f[_0x73a0('0x1e')];}if(_0xeb84a2[_0x73a0('0x1d')]){_0xeb84a2[_0x73a0('0x1d')]=_0xeb84a2[_0x73a0('0x1d')][_0x73a0('0x1a')](/0x0){var _0x3e4cc0=[_0x73a0('0x2b'),_0x73a0('0x2c'),'Precedence:\x20auto_reply'];for(var _0x5ddbfc=0x0;_0x5ddbfc<_0x77cd6f['headerLines']['length'];_0x5ddbfc++){var _0x2f1e23=_['indexOf'](_0x3e4cc0,_0x77cd6f[_0x73a0('0x2a')][_0x5ddbfc][_0x73a0('0x2d')]);if(_0x2f1e23>=0x0){_0xeb84a2['isAutoreply']=!![];}}}return _0xeb84a2;}exports[_0x73a0('0x2e')]=function(_0x59a7b5,_0x26290e,_0x118481){var _0x4f6c14={'from':getAddress(_0x26290e['from']),'firstName':getFirstName(_0x26290e['from']),'lastName':getLastName(_0x26290e[_0x73a0('0x2f')]),'mapKey':_0x73a0('0x1f'),'message':{'from':getMails(_0x59a7b5[_0x73a0('0x1f')],_0x26290e[_0x73a0('0x2f')]),'to':_0x59a7b5[_0x73a0('0x1f')],'cc':'','subject':_0x26290e[_0x73a0('0x30')]||'','messageId':_0x26290e['messageId'],'inReplyTo':_0x26290e[_0x73a0('0x31')],'sentAt':moment(_0x26290e[_0x73a0('0x32')])[_0x73a0('0x33')](_0x73a0('0x34')),'attach':![],'attachments':[]}};if(!_0x26290e['html']&&!_0x26290e['textAsHtml']){var _0x5eb948=_[_0x73a0('0x35')](_0x26290e[_0x73a0('0x17')],{'contentType':'application/ms-tnef'});if(_0x5eb948[_0x73a0('0x10')]){logger[_0x73a0('0x36')](util['format'](_0x73a0('0x37'),_0x26290e['messageId']));tnef['parseBuffer'](_[_0x73a0('0x38')](_0x5eb948)[_0x73a0('0x29')],function(_0x289d1c,_0x23744a){if(_0x23744a){_0x26290e[_0x73a0('0x14')]=_0x23744a[_0x73a0('0x39')]||_0x73a0('0x3a');if(_0x23744a[_0x73a0('0x3b')]){for(var _0xea0a04=0x0;_0xea0a04<_0x23744a[_0x73a0('0x3b')][_0x73a0('0x10')];_0xea0a04++){var _0x1b6cca=_0x23744a[_0x73a0('0x3b')][_0xea0a04];_0x4f6c14[_0x73a0('0x20')][_0x73a0('0x17')]['push']({'filename':_0x1b6cca['Title'],'content':Buffer['from'](_0x1b6cca[_0x73a0('0x3c')])});}}}_0x118481(parseEmail(_0x59a7b5,_0x26290e,_0x4f6c14));});}else{_0x26290e['html']=_0x73a0('0x3a');_0x118481(parseEmail(_0x59a7b5,_0x26290e,_0x4f6c14));}}else{_0x118481(parseEmail(_0x59a7b5,_0x26290e,_0x4f6c14));}};exports['getHost']=function(_0x3210ed){switch(_0x3210ed){case _0x73a0('0x3d'):return _0x73a0('0x3e');case'yahoo':return _0x73a0('0x3f');case _0x73a0('0x40'):return'imap-mail.outlook.com';case _0x73a0('0x41'):return _0x73a0('0x42');}return _0x73a0('0x43');};exports['generateXOAuth2Token']=function(_0x2baeeb,_0x131854){var _0x116eb7=[_0x73a0('0x44')+(_0x131854||''),'auth=Bearer\x20'+_0x2baeeb,'',''];return Buffer[_0x73a0('0x2f')](_0x116eb7[_0x73a0('0x12')](''),_0x73a0('0x45'))[_0x73a0('0x46')](_0x73a0('0x47'));}; \ No newline at end of file +var _0x28b8=['getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','auth=Bearer\x20','utf-8','toString','lodash','moment','path','util','node-tnef','../../../config/logger','../../../config/environment','value','anonymous','@xcally.com','head','name','address','substring','indexOf','split','length','slice','join','pop','isEmpty','generate','html','test','replace','includes','push','_SRC','_IMG','\x20[Attachment:\x20','\x20]','body','textAsHtml','0x1?_0x2853f5[_0x828b('0x11')](0x0,-0x1)[_0x828b('0x12')]('\x20'):_0x4043aa['name'];}return'Anonymous';}function getLastName(_0x2a22c2){var _0x469aa7=_['head'](_0x2a22c2['value']);if(_0x469aa7&&_0x469aa7[_0x828b('0xb')]){var _0x38f076=_0x469aa7[_0x828b('0xb')][_0x828b('0xf')](/\s+/);return _0x38f076['length']>0x1?_0x38f076[_0x828b('0x13')]():'';}return'';}function getMails(_0x524b9d,_0xfd146e){var _0x22c42c='';for(var _0x3fb459=0x0;_0x3fb459<_0xfd146e[_0x828b('0x7')]['length'];_0x3fb459+=0x1){if(_0xfd146e['value'][_0x3fb459]['address']!==_0x524b9d){if(!_[_0x828b('0x14')](_0x22c42c)){_0x22c42c+=',';}_0x22c42c+=_0xfd146e[_0x828b('0x7')][_0x3fb459][_0x828b('0xb')]||_0xfd146e[_0x828b('0x7')][_0x3fb459][_0x828b('0xc')]||'';_0x22c42c+='\x20<';_0x22c42c+=_0xfd146e['value'][_0x3fb459][_0x828b('0xc')]?_0xfd146e['value'][_0x3fb459][_0x828b('0xc')]:_0x828b('0x8')+random[_0x828b('0x15')](0x6)+_0x828b('0x9');_0x22c42c+='>';}}return _0x22c42c;}function parseEmail(_0x1a4689,_0x128800,_0x5114bc){if(_0x128800[_0x828b('0x16')]){var _0x49773e=/)<[^<]*)*<\/script>/gi;while(_0x49773e[_0x828b('0x17')](_0x128800['html'])){_0x128800['html']=_0x128800['html'][_0x828b('0x18')](_0x49773e,'');}if(_0x128800[_0x828b('0x16')][_0x828b('0x19')]('{_0x5f2fee[_0x828b('0x1a')](_0x91c5c5['filename']);});var _0x565a5=/]+>/g;var _0xca2430=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0x30d551=_0x128800[_0x828b('0x16')][_0x828b('0x18')](_0xca2430,_0x828b('0x1b'));var _0x2bcbc3=_0x30d551[_0x828b('0x18')](_0x565a5,_0x828b('0x1c'));for(let _0x27ede3=0x0;_0x27ede3<_0x5f2fee[_0x828b('0x10')];_0x27ede3++){var _0x5a2b65=_0x2bcbc3[_0x828b('0x18')](_0x828b('0x1c'),_0x828b('0x1d')+_0x5f2fee[_0x27ede3]+_0x828b('0x1e'));_0x2bcbc3=_0x5a2b65;}_0x128800[_0x828b('0x16')]=_0x2bcbc3;}_0x5114bc[_0x828b('0x1f')]=_0x128800[_0x828b('0x16')];}else{_0x5114bc[_0x828b('0x1f')]=_0x128800[_0x828b('0x20')];}if(_0x5114bc['body']){_0x5114bc['body']=_0x5114bc[_0x828b('0x1f')][_0x828b('0x18')](/0x0){var _0x58faf1=[_0x828b('0x32'),'X-Auto-Response-Suppress:\x20All',_0x828b('0x33')];for(var _0x15b37c=0x0;_0x15b37c<_0x128800['headerLines'][_0x828b('0x10')];_0x15b37c++){var _0x58e01b=_[_0x828b('0xe')](_0x58faf1,_0x128800['headerLines'][_0x15b37c][_0x828b('0x34')]);if(_0x58e01b>=0x0){_0x5114bc[_0x828b('0x35')]=!![];}}}return _0x5114bc;}exports['parser']=function(_0x127bb7,_0x131e05,_0x2446d4){var _0x19908f={'from':getAddress(_0x131e05[_0x828b('0x36')]),'firstName':getFirstName(_0x131e05['from']),'lastName':getLastName(_0x131e05[_0x828b('0x36')]),'mapKey':_0x828b('0x23'),'message':{'from':getMails(_0x127bb7[_0x828b('0x23')],_0x131e05[_0x828b('0x36')]),'to':_0x127bb7[_0x828b('0x23')],'cc':'','subject':_0x131e05[_0x828b('0x37')]||'','messageId':_0x131e05['messageId'],'inReplyTo':_0x131e05[_0x828b('0x38')],'sentAt':moment(_0x131e05[_0x828b('0x39')])[_0x828b('0x2a')](_0x828b('0x3a')),'attach':![],'attachments':[]}};if(!_0x131e05[_0x828b('0x16')]&&!_0x131e05[_0x828b('0x20')]){var _0xfd6dc1=_[_0x828b('0x3b')](_0x131e05['attachments'],{'contentType':'application/ms-tnef'});if(_0xfd6dc1[_0x828b('0x10')]){logger['info'](util[_0x828b('0x2a')]('Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system',_0x131e05[_0x828b('0x3c')]));tnef[_0x828b('0x3d')](_[_0x828b('0x3e')](_0xfd6dc1)[_0x828b('0x2f')],function(_0x5ea02c,_0x41553f){if(_0x41553f){_0x131e05[_0x828b('0x16')]=_0x41553f[_0x828b('0x3f')]||'

Empty\x20message

';if(_0x41553f[_0x828b('0x40')]){for(var _0x4ea3f9=0x0;_0x4ea3f9<_0x41553f[_0x828b('0x40')][_0x828b('0x10')];_0x4ea3f9++){var _0x2bfbba=_0x41553f[_0x828b('0x40')][_0x4ea3f9];_0x19908f[_0x828b('0x22')][_0x828b('0x27')]['push']({'filename':_0x2bfbba['Title'],'content':Buffer[_0x828b('0x36')](_0x2bfbba[_0x828b('0x41')])});}}}_0x2446d4(parseEmail(_0x127bb7,_0x131e05,_0x19908f));});}else{_0x131e05[_0x828b('0x16')]='

Empty\x20message

';_0x2446d4(parseEmail(_0x127bb7,_0x131e05,_0x19908f));}}else{_0x2446d4(parseEmail(_0x127bb7,_0x131e05,_0x19908f));}};exports[_0x828b('0x42')]=function(_0x51cba3){switch(_0x51cba3){case'gmail':return _0x828b('0x43');case _0x828b('0x44'):return _0x828b('0x45');case _0x828b('0x46'):return _0x828b('0x47');case _0x828b('0x48'):return'outlook.office365.com';}return _0x828b('0x49');};exports['generateXOAuth2Token']=function(_0x572e61,_0x505e2a){var _0x3cc9b2=['user='+(_0x505e2a||''),_0x828b('0x4a')+_0x572e61,'',''];return Buffer['from'](_0x3cc9b2[_0x828b('0x12')](''),_0x828b('0x4b'))[_0x828b('0x4c')]('base64');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index f3917a5..f3aa330 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 _0xc1a0=['lodash','name','Service','key','SERV','active','Imap','Smtp','exports'];(function(_0x590114,_0x2ca735){var _0x149e50=function(_0x3275fc){while(--_0x3275fc){_0x590114['push'](_0x590114['shift']());}};_0x149e50(++_0x2ca735);}(_0xc1a0,0x87));var _0x0c1a=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0xc1a0[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0x0c1a('0x0'));function MailAccount(_0x2a648e){this['id']=_0x2a648e['id']||0x0;this[_0x0c1a('0x1')]=_0x2a648e[_0x0c1a('0x1')]||_0x0c1a('0x2');this[_0x0c1a('0x3')]=_0x2a648e[_0x0c1a('0x3')]||_0x0c1a('0x4');this[_0x0c1a('0x5')]=_0x2a648e['active']||![];this[_0x0c1a('0x6')]=_0x2a648e[_0x0c1a('0x6')]||[];this[_0x0c1a('0x7')]=_0x2a648e['Smtp']||[];}module[_0x0c1a('0x8')]=MailAccount; \ No newline at end of file +var _0xc936=['key','SERV','Smtp','exports','lodash','name','Service'];(function(_0x16f9e5,_0x1be844){var _0x433bcd=function(_0x8b2e18){while(--_0x8b2e18){_0x16f9e5['push'](_0x16f9e5['shift']());}};_0x433bcd(++_0x1be844);}(_0xc936,0x7b));var _0x6c93=function(_0x51977b,_0xa087c6){_0x51977b=_0x51977b-0x0;var _0x153672=_0xc936[_0x51977b];return _0x153672;};'use strict';var _=require(_0x6c93('0x0'));function MailAccount(_0xa14dba){this['id']=_0xa14dba['id']||0x0;this[_0x6c93('0x1')]=_0xa14dba[_0x6c93('0x1')]||_0x6c93('0x2');this[_0x6c93('0x3')]=_0xa14dba[_0x6c93('0x3')]||_0x6c93('0x4');this['active']=_0xa14dba['active']||![];this['Imap']=_0xa14dba['Imap']||[];this[_0x6c93('0x5')]=_0xa14dba['Smtp']||[];}module[_0x6c93('0x6')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 2dd53b5..f9ba115 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 _0xd870=['length','isUndefined','mailAccounts','merge','lodash','../model/mailAccount','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd870,0x144));var _0x0d87=function(_0x19cd62,_0x205b35){_0x19cd62=_0x19cd62-0x0;var _0x4b3534=_0xd870[_0x19cd62];return _0x4b3534;};'use strict';var _=require(_0x0d87('0x0'));var MailAccount=require(_0x0d87('0x1'));var Realtime=function(){this['mailAccounts']={};};function freeIsNotKey(_0x5110c6,_0x1823fa,_0x483c19){var _0x2f0778=_['mapKeys'](_0x5110c6,function(_0x446095,_0x46b857){return _0x446095[_0x483c19];});for(var _0x3991db in _0x1823fa){if(_0x1823fa[_0x0d87('0x2')](_0x3991db)){if(!_0x2f0778[_0x3991db]){delete _0x1823fa[_0x3991db];}}}}Realtime[_0x0d87('0x3')][_0x0d87('0x4')]=function(_0x60df7d,_0x2f96f3){for(var _0x36b836 in _0x2f96f3){if(_0x60df7d[_0x0d87('0x2')](_0x36b836)){_0x60df7d[_0x36b836]=_0x2f96f3[_0x36b836];}}};Realtime[_0x0d87('0x3')][_0x0d87('0x5')]=function(){var _0x4e46cc=this;return function(_0x387f0c){if(_0x387f0c){freeIsNotKey(_0x387f0c,_0x4e46cc['mailAccounts'],'id');for(var _0x363376=0x0,_0x535268={},_0x47d64c={};_0x363376<_0x387f0c[_0x0d87('0x6')];_0x363376+=0x1){_0x535268=_0x387f0c[_0x363376];if(_[_0x0d87('0x7')](_0x4e46cc[_0x0d87('0x8')][_0x535268['id']])){_0x4e46cc['mailAccounts'][_0x535268['id']]=new MailAccount(_0x535268);}else{_[_0x0d87('0x9')](_0x4e46cc['mailAccounts'][_0x535268['id']],_0x535268);}}}return _0x4e46cc[_0x0d87('0x8')];};};module['exports']=Realtime; \ No newline at end of file +var _0x3ce5=['hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','merge','exports','lodash','../model/mailAccount','mailAccounts','mapKeys'];(function(_0x3ea73b,_0x5bbd73){var _0x429f94=function(_0x13a187){while(--_0x13a187){_0x3ea73b['push'](_0x3ea73b['shift']());}};_0x429f94(++_0x5bbd73);}(_0x3ce5,0x194));var _0x53ce=function(_0x54fbff,_0x2308fd){_0x54fbff=_0x54fbff-0x0;var _0x22042b=_0x3ce5[_0x54fbff];return _0x22042b;};'use strict';var _=require(_0x53ce('0x0'));var MailAccount=require(_0x53ce('0x1'));var Realtime=function(){this[_0x53ce('0x2')]={};};function freeIsNotKey(_0x397d46,_0x363379,_0x299c03){var _0x94e8c3=_[_0x53ce('0x3')](_0x397d46,function(_0x11fafc,_0x5f4bdf){return _0x11fafc[_0x299c03];});for(var _0x4f73f4 in _0x363379){if(_0x363379[_0x53ce('0x4')](_0x4f73f4)){if(!_0x94e8c3[_0x4f73f4]){delete _0x363379[_0x4f73f4];}}}}Realtime[_0x53ce('0x5')][_0x53ce('0x6')]=function(_0x4f3861,_0x29fab4){for(var _0x14d9ce in _0x29fab4){if(_0x4f3861[_0x53ce('0x4')](_0x14d9ce)){_0x4f3861[_0x14d9ce]=_0x29fab4[_0x14d9ce];}}};Realtime[_0x53ce('0x5')][_0x53ce('0x7')]=function(){var _0x5c8bd2=this;return function(_0x362a1f){if(_0x362a1f){freeIsNotKey(_0x362a1f,_0x5c8bd2['mailAccounts'],'id');for(var _0x4c3058=0x0,_0xa65eb1={},_0x361a3f={};_0x4c3058<_0x362a1f[_0x53ce('0x8')];_0x4c3058+=0x1){_0xa65eb1=_0x362a1f[_0x4c3058];if(_[_0x53ce('0x9')](_0x5c8bd2[_0x53ce('0x2')][_0xa65eb1['id']])){_0x5c8bd2[_0x53ce('0x2')][_0xa65eb1['id']]=new MailAccount(_0xa65eb1);}else{_[_0x53ce('0xa')](_0x5c8bd2['mailAccounts'][_0xa65eb1['id']],_0xa65eb1);}}}return _0x5c8bd2[_0x53ce('0x2')];};};module[_0x53ce('0xb')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index ebd1c62..8ab57b9 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 _0x6c99=['type','MailServerOut','data5','notify','NotifyMailAccount','../client','Request','active','key','ListId','TemplateId','Imap','CloudProvider','name','service'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0x6c99,0x9b));var _0x96c9=function(_0x1034bb,_0x4e20b3){_0x1034bb=_0x1034bb-0x0;var _0x453fdb=_0x6c99[_0x1034bb];return _0x453fdb;};'use strict';var client=require(_0x96c9('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x96c9('0x1')]('GetMailAccount',{'options':{'attributes':['id','name','provider','service','email',_0x96c9('0x2'),_0x96c9('0x3'),_0x96c9('0x4'),_0x96c9('0x5')],'raw':![],'include':[{'model':'MailServerIn','as':_0x96c9('0x6'),'include':[{'model':_0x96c9('0x7'),'attributes':['id',_0x96c9('0x8'),_0x96c9('0x9'),_0x96c9('0xa'),'data5'],'as':'CloudProvider'}]},{'model':_0x96c9('0xb'),'as':'Smtp','include':[{'model':_0x96c9('0x7'),'attributes':['id','name',_0x96c9('0x9'),_0x96c9('0xa'),_0x96c9('0xc')],'as':_0x96c9('0x7')}]}]},'log':'getMailAccount'});};};exports[_0x96c9('0xd')]=function(_0x2ade9d,_0x295aab){return client[_0x96c9('0x1')](_0x96c9('0xe'),{'account':{'id':_0x2ade9d},'body':_0x295aab,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0x8c8b=['MailServerIn','Imap','CloudProvider','type','data5','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','GetMailAccount','name','provider','service','key','ListId','TemplateId'];(function(_0x720e64,_0x3349ab){var _0x3d0a02=function(_0x55c9f0){while(--_0x55c9f0){_0x720e64['push'](_0x720e64['shift']());}};_0x3d0a02(++_0x3349ab);}(_0x8c8b,0x106));var _0xb8c8=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x8c8b[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xb8c8('0x0'));exports['getMailAccounts']=function(){return function(){return client['Request'](_0xb8c8('0x1'),{'options':{'attributes':['id',_0xb8c8('0x2'),_0xb8c8('0x3'),_0xb8c8('0x4'),'email','active',_0xb8c8('0x5'),_0xb8c8('0x6'),_0xb8c8('0x7')],'raw':![],'include':[{'model':_0xb8c8('0x8'),'as':_0xb8c8('0x9'),'include':[{'model':_0xb8c8('0xa'),'attributes':['id',_0xb8c8('0x2'),_0xb8c8('0x4'),_0xb8c8('0xb'),_0xb8c8('0xc')],'as':_0xb8c8('0xa')}]},{'model':'MailServerOut','as':_0xb8c8('0xd'),'include':[{'model':_0xb8c8('0xa'),'attributes':['id',_0xb8c8('0x2'),_0xb8c8('0x4'),_0xb8c8('0xb'),_0xb8c8('0xc')],'as':_0xb8c8('0xa')}]}]},'log':_0xb8c8('0xe')});};};exports[_0xb8c8('0xf')]=function(_0x4b09ed,_0x4758ee){return client[_0xb8c8('0x10')]('NotifyMailAccount',{'account':{'id':_0x4b09ed},'body':_0x4758ee,'log':_0xb8c8('0x11')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index e259b04..3442eff 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 _0x0bbd=['loginMailFrequency','../client','getSettings','Request','ShowSetting'];(function(_0x183ca4,_0x223b5a){var _0x2582a6=function(_0x21424d){while(--_0x21424d){_0x183ca4['push'](_0x183ca4['shift']());}};_0x2582a6(++_0x223b5a);}(_0x0bbd,0x1e6));var _0xd0bb=function(_0x3961a2,_0xf3a769){_0x3961a2=_0x3961a2-0x0;var _0x1aa3b8=_0x0bbd[_0x3961a2];return _0x1aa3b8;};'use strict';var client=require(_0xd0bb('0x0'));exports[_0xd0bb('0x1')]=function(){return client[_0xd0bb('0x2')](_0xd0bb('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xd0bb('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x5306=['Request','ShowSetting','loginMailFrequency','GetSettings','../client','getSettings'];(function(_0x57be3b,_0x2dc001){var _0x1c7d9f=function(_0x52fc34){while(--_0x52fc34){_0x57be3b['push'](_0x57be3b['shift']());}};_0x1c7d9f(++_0x2dc001);}(_0x5306,0x172));var _0x6530=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5306[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6530('0x0'));exports[_0x6530('0x1')]=function(){return client[_0x6530('0x2')](_0x6530('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x6530('0x4')]},'log':_0x6530('0x5')});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 883e55a..01f2b17 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'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 de88cc2..4107587 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 _0xf11f=['localhost','adapter','socket.io-redis','../../config/triggers','../../config/socketio','../../config/express','default','../../routes','once','listening','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','port','socket.io','websocket','polling','redis','defaults'];(function(_0x24259d,_0x64a194){var _0x5a701=function(_0x204516){while(--_0x204516){_0x24259d['push'](_0x24259d['shift']());}};_0x5a701(++_0x64a194);}(_0xf11f,0x70));var _0xff11=function(_0x43aee5,_0x11268b){_0x43aee5=_0x43aee5-0x0;var _0x76d1d0=_0xf11f[_0x43aee5];return _0x76d1d0;};'use strict';var _=require(_0xff11('0x0'));var http=require(_0xff11('0x1'));var express=require('express');var sticky=require(_0xff11('0x2'));var Redis=require(_0xff11('0x3'));var config=require(_0xff11('0x4'));var app=express();var server=http[_0xff11('0x5')](app);server[_0xff11('0x6')]=0xdbba0;if(sticky['listen'](server,config[_0xff11('0x7')])){var socketio=require(_0xff11('0x8'))(server,{'transports':[_0xff11('0x9'),_0xff11('0xa')]});config[_0xff11('0xb')]=_[_0xff11('0xc')](config[_0xff11('0xb')],{'host':_0xff11('0xd'),'port':0x18eb});socketio[_0xff11('0xe')](require(_0xff11('0xf'))({'pubClient':new Redis(config[_0xff11('0xb')]),'subClient':new Redis(config[_0xff11('0xb')])}));require(_0xff11('0x10'))['default']();require(_0xff11('0x11'))['default'](socketio);require(_0xff11('0x12'))[_0xff11('0x13')](app);require(_0xff11('0x14'))[_0xff11('0x13')](app);}else{server[_0xff11('0x15')](_0xff11('0x16'),function(){console['log'](_0xff11('0x17'),config['port']);});}exports=module[_0xff11('0x18')]=app; \ No newline at end of file +var _0xa939=['defaults','localhost','adapter','socket.io-redis','../../config/triggers','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','redis'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa939,0xa9));var _0x9a93=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa939[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x9a93('0x0'));var http=require(_0x9a93('0x1'));var express=require(_0x9a93('0x2'));var sticky=require(_0x9a93('0x3'));var Redis=require(_0x9a93('0x4'));var config=require(_0x9a93('0x5'));var app=express();var server=http[_0x9a93('0x6')](app);server[_0x9a93('0x7')]=0xdbba0;if(sticky[_0x9a93('0x8')](server,config[_0x9a93('0x9')])){var socketio=require(_0x9a93('0xa'))(server,{'transports':[_0x9a93('0xb'),'polling']});config[_0x9a93('0xc')]=_[_0x9a93('0xd')](config[_0x9a93('0xc')],{'host':_0x9a93('0xe'),'port':0x18eb});socketio[_0x9a93('0xf')](require(_0x9a93('0x10'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config[_0x9a93('0xc')])}));require(_0x9a93('0x11'))[_0x9a93('0x12')]();require(_0x9a93('0x13'))[_0x9a93('0x12')](socketio);require(_0x9a93('0x14'))['default'](app);require('../../routes')[_0x9a93('0x12')](app);}else{server[_0x9a93('0x15')](_0x9a93('0x16'),function(){console[_0x9a93('0x17')](_0x9a93('0x18'),config[_0x9a93('0x9')]);});}exports=module[_0x9a93('0x19')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 76f1762..8694f8c 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 _0x8298=['http','request','then','debug','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client'];(function(_0x51e836,_0x50e241){var _0x58a876=function(_0x98fc68){while(--_0x98fc68){_0x51e836['push'](_0x51e836['shift']());}};_0x58a876(++_0x50e241);}(_0x8298,0xa0));var _0x8829=function(_0x32c8e6,_0xdcfd13){_0x32c8e6=_0x32c8e6-0x0;var _0x553663=_0x8298[_0x32c8e6];return _0x553663;};'use strict';var jayson=require(_0x8829('0x0'));var BPromise=require(_0x8829('0x1'));var logger=require(_0x8829('0x2'))(_0x8829('0x3'));var client=jayson[_0x8829('0x4')][_0x8829('0x5')]({'port':0x2329});client['Request']=function(_0x5bd686,_0x135ed3){return new BPromise(function(_0x33410b,_0xe5c8b){return client[_0x8829('0x6')](_0x5bd686,_0x135ed3)[_0x8829('0x7')](function(_0x461501){logger[_0x8829('0x8')](_0x8829('0x9'),_0x8829('0x3'),_0x5bd686,_0x135ed3,_0x461501);if(_0x461501['error']){logger['error']('rpc',_0x8829('0x3'),_0x5bd686,_0x461501[_0x8829('0xa')][_0x8829('0xb')],_0x135ed3);return _0xe5c8b(_0x461501[_0x8829('0xa')]['message']);}else{return _0x33410b(_0x461501[_0x8829('0xc')]);}})[_0x8829('0xd')](function(_0x47aa98){logger[_0x8829('0xa')](_0x8829('0x9'),_0x8829('0x3'),_0x5bd686,_0x47aa98,_0x135ed3);return _0xe5c8b(_0x47aa98);});});};module[_0x8829('0xe')]=client; \ No newline at end of file +var _0xf4df=['Request','then','rpc','error','catch','exports','../../config/logger','routing','client','http'];(function(_0x1b48cd,_0x4e1a55){var _0x11a3c8=function(_0x5c882f){while(--_0x5c882f){_0x1b48cd['push'](_0x1b48cd['shift']());}};_0x11a3c8(++_0x4e1a55);}(_0xf4df,0x10a));var _0xff4d=function(_0x1d7790,_0x180cf9){_0x1d7790=_0x1d7790-0x0;var _0xf4f99a=_0xf4df[_0x1d7790];return _0xf4f99a;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0xff4d('0x0'))(_0xff4d('0x1'));var client=jayson[_0xff4d('0x2')][_0xff4d('0x3')]({'port':0x2329});client[_0xff4d('0x4')]=function(_0x4f6ad7,_0x183f18){return new BPromise(function(_0x419d55,_0x45c8e2){return client['request'](_0x4f6ad7,_0x183f18)[_0xff4d('0x5')](function(_0x3e1fe2){logger['debug'](_0xff4d('0x6'),_0xff4d('0x1'),_0x4f6ad7,_0x183f18,_0x3e1fe2);if(_0x3e1fe2[_0xff4d('0x7')]){logger[_0xff4d('0x7')](_0xff4d('0x6'),'routing',_0x4f6ad7,_0x3e1fe2['error']['message'],_0x183f18);return _0x45c8e2(_0x3e1fe2[_0xff4d('0x7')]['message']);}else{return _0x419d55(_0x3e1fe2['result']);}})[_0xff4d('0x8')](function(_0x542ff2){logger[_0xff4d('0x7')](_0xff4d('0x6'),'routing',_0x4f6ad7,_0x542ff2,_0x183f18);return _0x45c8e2(_0x542ff2);});});};module[_0xff4d('0x9')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index ea5833b..0aae4c8 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 _0xc767=['./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','getAgents','then','initAgents','getIntervals','initIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','getFaxQueues','initFaxQueues','initWhatsappQueues','catch','log','bluebird','./realtime','./rpc/user','./rpc/interval'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0xc767,0x130));var _0x7c76=function(_0x141486,_0x58ed56){_0x141486=_0x141486-0x0;var _0x1b5fb9=_0xc767[_0x141486];return _0x1b5fb9;};'use strict';var BPromise=require(_0x7c76('0x0'));var server=require('./server');var Realtime=require(_0x7c76('0x1'));var user=require(_0x7c76('0x2'));var interval=require(_0x7c76('0x3'));var openchannelQueue=require(_0x7c76('0x4'));var chatQueue=require(_0x7c76('0x5'));var smsQueue=require(_0x7c76('0x6'));var mailQueue=require(_0x7c76('0x7'));var faxQueue=require(_0x7c76('0x8'));var whatsappQueue=require(_0x7c76('0x9'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x7c76('0xa')]()['then'](user[_0x7c76('0xb')]())[_0x7c76('0xc')](realtime[_0x7c76('0xd')]())[_0x7c76('0xc')](interval[_0x7c76('0xe')]())[_0x7c76('0xc')](realtime[_0x7c76('0xf')]())['then'](openchannelQueue[_0x7c76('0x10')]())[_0x7c76('0xc')](realtime[_0x7c76('0x11')]())[_0x7c76('0xc')](chatQueue[_0x7c76('0x12')]())[_0x7c76('0xc')](realtime[_0x7c76('0x13')]())[_0x7c76('0xc')](smsQueue[_0x7c76('0x14')]())[_0x7c76('0xc')](realtime[_0x7c76('0x15')]())[_0x7c76('0xc')](mailQueue[_0x7c76('0x16')]())[_0x7c76('0xc')](realtime['initMailQueues']())[_0x7c76('0xc')](faxQueue[_0x7c76('0x17')]())[_0x7c76('0xc')](realtime[_0x7c76('0x18')]())['then'](whatsappQueue['getWhatsappQueues']())[_0x7c76('0xc')](realtime[_0x7c76('0x19')]())[_0x7c76('0xc')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x1a8501){return initRealtime();})[_0x7c76('0xc')](function(_0x5e71cb){return setInterval(initRealtime,0x1388);})[_0x7c76('0x1a')](function(_0x32c0c2){console[_0x7c76('0x1b')](_0x32c0c2);});}main(); \ No newline at end of file +var _0x6fc7=['initAgents','initIntervals','getOpenchannelQueues','initOpenchannelQueues','initChatQueues','initSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','listen','catch','log','bluebird','./realtime','./rpc/user','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','resolve','then'];(function(_0x56fe98,_0x43dc16){var _0x212f4f=function(_0xc3427d){while(--_0xc3427d){_0x56fe98['push'](_0x56fe98['shift']());}};_0x212f4f(++_0x43dc16);}(_0x6fc7,0x1d6));var _0x76fc=function(_0x224d4f,_0x4dfb75){_0x224d4f=_0x224d4f-0x0;var _0x4cf0f3=_0x6fc7[_0x224d4f];return _0x4cf0f3;};'use strict';var BPromise=require(_0x76fc('0x0'));var server=require('./server');var Realtime=require(_0x76fc('0x1'));var user=require(_0x76fc('0x2'));var interval=require('./rpc/interval');var openchannelQueue=require(_0x76fc('0x3'));var chatQueue=require(_0x76fc('0x4'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x76fc('0x5'));var faxQueue=require(_0x76fc('0x6'));var whatsappQueue=require(_0x76fc('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x76fc('0x8')]()[_0x76fc('0x9')](user['getAgents']())['then'](realtime[_0x76fc('0xa')]())['then'](interval['getIntervals']())[_0x76fc('0x9')](realtime[_0x76fc('0xb')]())['then'](openchannelQueue[_0x76fc('0xc')]())[_0x76fc('0x9')](realtime[_0x76fc('0xd')]())[_0x76fc('0x9')](chatQueue['getChatQueues']())[_0x76fc('0x9')](realtime[_0x76fc('0xe')]())[_0x76fc('0x9')](smsQueue['getSmsQueues']())[_0x76fc('0x9')](realtime[_0x76fc('0xf')]())['then'](mailQueue['getMailQueues']())['then'](realtime[_0x76fc('0x10')]())[_0x76fc('0x9')](faxQueue[_0x76fc('0x11')]())[_0x76fc('0x9')](realtime[_0x76fc('0x12')]())[_0x76fc('0x9')](whatsappQueue[_0x76fc('0x13')]())[_0x76fc('0x9')](realtime[_0x76fc('0x14')]())[_0x76fc('0x9')](function(){return realtime;});}function main(){return server[_0x76fc('0x15')](realtime)[_0x76fc('0x9')](function(_0x81b3e9){return initRealtime();})[_0x76fc('0x9')](function(_0x5ad1fd){return setInterval(initRealtime,0x1388);})[_0x76fc('0x16')](function(_0x111576){console[_0x76fc('0x17')](_0x111576);});}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 a1692e4..8987d99 100644 --- a/server/services/routing/lib/rule-engine.js +++ b/server/services/routing/lib/rule-engine.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x5455e2,_0x4675b4){var _0x4c8a44=function(_0xd15cb8){while(--_0xd15cb8){_0x5455e2['push'](_0x5455e2['shift']());}};_0x4c8a44(++_0x4675b4);}(_0x814b,0x1a2));var _0xb814=function(_0x486f4a,_0x478dc7){_0x486f4a=_0x486f4a-0x0;var _0x135d99=_0x814b[_0x486f4a];return _0x135d99;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file +var _0x326f=['orderBy','asc','result','clone','consequence','nextTick','push','isEqual','condition','call','matchPath','noop','matches','filter','turn','length','prioritize','findRules','priority','toJSON','map','toString','fromJSON','isString','lodash','EventEmitter','init','isNil','register','ignoreFactChanges','inherits','prototype','rules','activeRules','concat','isObject','sync'];(function(_0x2136a6,_0x35af63){var _0x55b948=function(_0x288a75){while(--_0x288a75){_0x2136a6['push'](_0x2136a6['shift']());}};_0x55b948(++_0x35af63);}(_0x326f,0xd1));var _0xf326=function(_0x199e4a,_0x27ce2e){_0x199e4a=_0x199e4a-0x0;var _0x16105b=_0x326f[_0x199e4a];return _0x16105b;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var EventEmitter=require('events')[_0xf326('0x1')];function RuleEngine(_0x330ddb,_0x22aabf){this[_0xf326('0x2')]();if(!_[_0xf326('0x3')](_0x330ddb)){this[_0xf326('0x4')](_0x330ddb);}if(_0x22aabf){this[_0xf326('0x5')]=_0x22aabf[_0xf326('0x5')];}return this;}util[_0xf326('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xf326('0x7')]['init']=function(_0x3c254d){this[_0xf326('0x8')]=[];this[_0xf326('0x9')]=[];};RuleEngine[_0xf326('0x7')]['register']=function(_0x4c206c){if(Array['isArray'](_0x4c206c)){this[_0xf326('0x8')]=this[_0xf326('0x8')][_0xf326('0xa')](_0x4c206c);}else if(_0x4c206c!==null&&_[_0xf326('0xb')](_0x4c206c)){this[_0xf326('0x8')]['push'](_0x4c206c);}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0xc')]=function(){this['activeRules']=this[_0xf326('0x8')]['filter'](function(_0x3162f9){if(_[_0xf326('0x3')](_0x3162f9['on'])){_0x3162f9['on']=!![];}if(_0x3162f9['on']===!![]){return _0x3162f9;}});this['activeRules']=_[_0xf326('0xd')](this[_0xf326('0x9')],['p'],[_0xf326('0xe')]);};RuleEngine[_0xf326('0x7')]['execute']=function(_0x45c1b6,_0x5204ee){var _0x54bd1a=![];_0x45c1b6[_0xf326('0xf')]=!![];var _0x11f6d2=_[_0xf326('0x10')](_0x45c1b6);var _0xa63d1a=_[_0xf326('0x10')](_0x45c1b6);var _0x287a2a=this[_0xf326('0x9')];var _0x2cf2ca=[];var _0x5a682a=this[_0xf326('0x5')];(function FnRuleLoop(_0x453100){var _0x18bee3={'rules':function(){return _0x287a2a;},'rule':function(){return _0x287a2a[_0x453100];},'when':function(_0x31ffb9){if(_0x31ffb9){var _0xcef2b5=_0x287a2a[_0x453100][_0xf326('0x11')];_0xcef2b5['ruleRef']=_0x287a2a[_0x453100]['id']||_0x287a2a[_0x453100]['name']||'index_'+_0x453100;process[_0xf326('0x12')](function(){_0x2cf2ca[_0xf326('0x13')](_0xcef2b5['ruleRef']);_0xcef2b5['call'](_0x11f6d2,_0x18bee3);});}else{process[_0xf326('0x12')](function(){_0x18bee3['next']();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x54bd1a=!![];return FnRuleLoop(0x0);},'next':function(_0x5b6d3c){if(!_0x5a682a&&!_[_0xf326('0x14')](_0xa63d1a,_0x11f6d2)){_0xa63d1a=_[_0xf326('0x10')](_0x11f6d2);process['nextTick'](function(){_0x18bee3['restart']();});}else{process[_0xf326('0x12')](function(){if(_[_0xf326('0x3')](_0x5b6d3c)){return FnRuleLoop(_0x453100+0x1);}else{return FnRuleLoop(_0x5b6d3c);}});}}};if(_0x453100<_0x287a2a['length']&&_0x54bd1a===![]){var _0x337ed5=_0x287a2a[_0x453100][_0xf326('0x15')];_0x337ed5[_0xf326('0x16')](_0x11f6d2,_0x18bee3);}else{process[_0xf326('0x12')](function(){_0x11f6d2[_0xf326('0x17')]=_0x2cf2ca;return _0x5204ee?_0x5204ee(_0x11f6d2):_[_0xf326('0x18')]();});}}(0x0));};RuleEngine['prototype']['findRules']=function(_0x4f31f6){if(_[_0xf326('0x3')](_0x4f31f6)){return this[_0xf326('0x8')];}else{var _0x2cd45a=_[_0xf326('0x19')](_0x4f31f6);return _[_0xf326('0x1a')](this[_0xf326('0x8')],_0x2cd45a);}};RuleEngine['prototype'][_0xf326('0x1b')]=function(_0xa3c0b,_0x212d5d){var _0x581531=_0xa3c0b==='on'||_0xa3c0b==='ON'?!![]:![];var _0x1617d2=this['findRules'](_0x212d5d);for(var _0x4a9abf=0x0,_0x6a8e89=_0x1617d2[_0xf326('0x1c')];_0x4a9abf<_0x6a8e89;_0x4a9abf+=0x1){_0x1617d2[_0x4a9abf]['on']=_0x581531;}this[_0xf326('0xc')]();};RuleEngine['prototype'][_0xf326('0x1d')]=function(_0x292500,_0x55790d){_0x292500=parseInt(_0x292500,0xa);var _0x225776=this[_0xf326('0x1e')](_0x55790d);for(var _0xd77aba=0x0,_0x18d110=_0x225776[_0xf326('0x1c')];_0xd77aba<_0x18d110;_0xd77aba+=0x1){_0x225776[_0xd77aba][_0xf326('0x1f')]=_0x292500;}this[_0xf326('0xc')]();};RuleEngine[_0xf326('0x7')][_0xf326('0x20')]=function(){var _0x349a03=this['rules'];if(_0x349a03 instanceof Array){_0x349a03=_0x349a03[_0xf326('0x21')](function(_0x424104){_0x424104[_0xf326('0x15')]=_0x424104['condition'][_0xf326('0x22')]();_0x424104[_0xf326('0x11')]=_0x424104[_0xf326('0x11')]['toString']();return _0x424104;});}else if(!_['isNil'](_0x349a03)){_0x349a03[_0xf326('0x15')]=_0x349a03[_0xf326('0x15')][_0xf326('0x22')]();_0x349a03[_0xf326('0x11')]=_0x349a03[_0xf326('0x11')][_0xf326('0x22')]();}return _0x349a03;};RuleEngine[_0xf326('0x7')][_0xf326('0x23')]=function(_0x580374){this[_0xf326('0x2')]();if(_[_0xf326('0x24')](_0x580374)){_0x580374=JSON['parse'](_0x580374);}if(_0x580374 instanceof Array){_0x580374=_0x580374[_0xf326('0x21')](function(_0x4e5d7c){_0x4e5d7c[_0xf326('0x15')]=eval('('+_0x4e5d7c['condition']+')');_0x4e5d7c['consequence']=eval('('+_0x4e5d7c[_0xf326('0x11')]+')');return _0x4e5d7c;});}else if(_0x580374!==null&&typeof _0x580374=='object'){_0x580374[_0xf326('0x15')]=eval('('+_0x580374['condition']+')');_0x580374[_0xf326('0x11')]=eval('('+_0x580374[_0xf326('0x11')]+')');}this[_0xf326('0x4')](_0x580374);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 40d1238..bf5ef9c 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 _0x93ca=['bluebird','jayson/promise','client','http','request','then','error','message','result','sendMailMessage'];(function(_0x10a491,_0x1e2fe3){var _0x30778c=function(_0x417e75){while(--_0x417e75){_0x10a491['push'](_0x10a491['shift']());}};_0x30778c(++_0x1e2fe3);}(_0x93ca,0x78));var _0xa93c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x93ca[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0xa93c('0x0'));var jayson=require(_0xa93c('0x1'));var client=jayson[_0xa93c('0x2')][_0xa93c('0x3')]({'port':0x232b});function request(_0x502d24,_0x53d2ce){return new BPromise(function(_0x541f1f,_0x5aa12c){return client[_0xa93c('0x4')](_0x502d24,_0x53d2ce)[_0xa93c('0x5')](function(_0x209826){if(_0x209826[_0xa93c('0x6')]){return _0x5aa12c(_0x209826[_0xa93c('0x6')][_0xa93c('0x7')]);}else{return _0x541f1f(_0x209826[_0xa93c('0x8')]);}})['catch'](function(_0x3cd57b){return _0x5aa12c(_0x3cd57b);});});}exports[_0xa93c('0x9')]=function(_0x312d82,_0x53b398){return request('SendMail',{'account':_0x312d82,'message':_0x53b398});}; \ No newline at end of file +var _0xe632=['sendMailMessage','jayson/promise','request','then','error','message','result','catch'];(function(_0x29f460,_0x59586a){var _0x1bbe4d=function(_0x2ee017){while(--_0x2ee017){_0x29f460['push'](_0x29f460['shift']());}};_0x1bbe4d(++_0x59586a);}(_0xe632,0x191));var _0x2e63=function(_0x4ceaf5,_0x34e64c){_0x4ceaf5=_0x4ceaf5-0x0;var _0x1fc888=_0xe632[_0x4ceaf5];return _0x1fc888;};'use strict';var BPromise=require('bluebird');var jayson=require(_0x2e63('0x0'));var client=jayson['client']['http']({'port':0x232b});function request(_0x21def5,_0x42c844){return new BPromise(function(_0x3cb9bc,_0x2baa6c){return client[_0x2e63('0x1')](_0x21def5,_0x42c844)[_0x2e63('0x2')](function(_0x4f8348){if(_0x4f8348[_0x2e63('0x3')]){return _0x2baa6c(_0x4f8348[_0x2e63('0x3')][_0x2e63('0x4')]);}else{return _0x3cb9bc(_0x4f8348[_0x2e63('0x5')]);}})[_0x2e63('0x6')](function(_0x1d4fa8){return _0x2baa6c(_0x1d4fa8);});});}exports[_0x2e63('0x7')]=function(_0x2ce614,_0x17748c){return request('SendMail',{'account':_0x2ce614,'message':_0x17748c});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 8bc09af..acc2ccf 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 _0x6706=['mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatusTime','faxCapacity','faxCurrentCapacity','smsCapacity','smsCurrentCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','mail','chat','fax','whatsapp','length','toNumber','format','Status','faxStatus','smsStatus','smsStatusTime','whatsappCurrentCapacity','busy','busyQueue','emit','user:save','exports','moment','md5','ioredis','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity'];(function(_0x5dee43,_0x35aa9b){var _0x3bcfb0=function(_0x22dad2){while(--_0x22dad2){_0x5dee43['push'](_0x5dee43['shift']());}};_0x3bcfb0(++_0x35aa9b);}(_0x6706,0x114));var _0x6670=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6706[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var moment=require(_0x6670('0x0'));var md5=require(_0x6670('0x1'));var Redis=require(_0x6670('0x2'));var config=require('../../../config/environment');config[_0x6670('0x3')]=_[_0x6670('0x4')](config[_0x6670('0x3')],{'host':_0x6670('0x5'),'port':0x18eb});var io=require(_0x6670('0x6'))(new Redis(config[_0x6670('0x3')]));function Agent(_0x1f710b){this['id']=_0x1f710b['id']||0x0;this[_0x6670('0x7')]=_0x1f710b['name']||'';this['online']=_0x1f710b[_0x6670('0x8')]||!![];this[_0x6670('0x9')]=_0x1f710b['voicePause']||![];this[_0x6670('0xa')]=_0x1f710b[_0x6670('0xa')]||![];this[_0x6670('0xb')]=_0x1f710b[_0x6670('0xb')]||![];this['faxPause']=_0x1f710b[_0x6670('0xc')]||![];this[_0x6670('0xd')]=_0x1f710b[_0x6670('0xd')]||![];this[_0x6670('0xe')]=_0x1f710b['openchannelPause']||![];this['chatStatus']=_0x6670('0xf');this[_0x6670('0x10')]=0x0;this[_0x6670('0x11')]=_0x1f710b['chatCapacity']||0x0;this[_0x6670('0x12')]=0x0;this[_0x6670('0x13')]=_0x6670('0xf');this[_0x6670('0x14')]=0x0;this[_0x6670('0x15')]=_0x1f710b['mailCapacity']||0x0;this[_0x6670('0x16')]=0x0;this['faxStatus']='unknown';this[_0x6670('0x17')]=0x0;this[_0x6670('0x18')]=_0x1f710b[_0x6670('0x18')]||0x0;this[_0x6670('0x19')]=0x0;this['smsStatus']=_0x6670('0xf');this['smsStatusTime']=0x0;this['smsCapacity']=_0x1f710b[_0x6670('0x1a')]||0x0;this[_0x6670('0x1b')]=0x0;this[_0x6670('0x1c')]=_0x6670('0xf');this[_0x6670('0x1d')]=0x0;this[_0x6670('0x1e')]=_0x1f710b[_0x6670('0x1e')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x6670('0x1f')]=_0x6670('0xf');this[_0x6670('0x20')]=0x0;this[_0x6670('0x21')]=_0x1f710b[_0x6670('0x21')]||0x0;this[_0x6670('0x22')]=0x0;this['busy']=![];this['busyQueue']=undefined;this[_0x6670('0x1')]='';this[_0x6670('0x23')]();}Agent[_0x6670('0x24')][_0x6670('0x25')]=function(_0xe2f8cc){if(this[_0xe2f8cc+_0x6670('0x26')]>0x0){if(this[_0xe2f8cc+'Capacity']>0x0&&this[_0xe2f8cc+_0x6670('0x26')]>=this[_0xe2f8cc+_0x6670('0x27')]){return'maxcapacity';}else{return _0x6670('0x28');}}else{return _0x6670('0x29');}};Agent[_0x6670('0x24')][_0x6670('0x23')]=function(){var _0x2aaccb=[_0x6670('0x2a'),_0x6670('0x2b'),'openchannel',_0x6670('0x2c'),'sms',_0x6670('0x2d')];for(var _0x1bc6cb=0x0;_0x1bc6cb<_0x2aaccb[_0x6670('0x2e')];_0x1bc6cb+=0x1){var _0x42e363=this[_0x6670('0x25')](_0x2aaccb[_0x1bc6cb]);if(this[_0x2aaccb[_0x1bc6cb]+'Status']!==_0x42e363){this[_0x2aaccb[_0x1bc6cb]+'StatusTime']=_[_0x6670('0x2f')](moment()[_0x6670('0x30')]('x'));}this[_0x2aaccb[_0x1bc6cb]+_0x6670('0x31')]=_0x42e363;}var _0x432ccf={'id':this['id'],'name':this[_0x6670('0x7')],'online':this[_0x6670('0x8')],'voicePause':this[_0x6670('0x9')],'chatPause':this[_0x6670('0xa')],'mailPause':this['mailPause'],'smsPause':this[_0x6670('0xd')],'faxPause':this['faxPause'],'openchannelPause':this[_0x6670('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x6670('0x10')],'chatCapacity':this[_0x6670('0x11')],'chatCurrentCapacity':this[_0x6670('0x12')],'mailStatus':this[_0x6670('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x6670('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x6670('0x32')],'faxStatusTime':this[_0x6670('0x17')],'faxCapacity':this[_0x6670('0x18')],'faxCurrentCapacity':this[_0x6670('0x19')],'smsStatus':this[_0x6670('0x33')],'smsStatusTime':this[_0x6670('0x34')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this['smsCurrentCapacity'],'whatsappStatus':this[_0x6670('0x1c')],'whatsappStatusTime':this[_0x6670('0x1d')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0x6670('0x35')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x6670('0x21')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x6670('0x36')],'busyQueue':this[_0x6670('0x37')]};var _0x25582d=md5(JSON['stringify'](_0x432ccf));if(this[_0x6670('0x1')]!==_0x25582d){this['md5']=_0x25582d;io[_0x6670('0x38')](_0x6670('0x39'),_0x432ccf);}};module[_0x6670('0x3a')]=Agent; \ No newline at end of file +var _0x2a9c=['openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','md5','updateRealtime','Capacity','CurrentCapacity','maxcapacity','working','chat','openchannel','fax','sms','whatsapp','length','StatusTime','toNumber','Status','chatCurrentCapacity','mailStatus','mailCapacity','faxStatusTime','smsStatusTime','smsCurrentCapacity','openchannelStatus','stringify','emit','user:save','exports','lodash','ioredis','socket.io-emitter','redis','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatusTime'];(function(_0x208ca4,_0x4a028c){var _0x5b299f=function(_0x1b89ba){while(--_0x1b89ba){_0x208ca4['push'](_0x208ca4['shift']());}};_0x5b299f(++_0x4a028c);}(_0x2a9c,0x1e6));var _0xc2a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2a9c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc2a9('0x0'));var moment=require('moment');var md5=require('md5');var Redis=require(_0xc2a9('0x1'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc2a9('0x2'))(new Redis(config[_0xc2a9('0x3')]));function Agent(_0x3c208d){this['id']=_0x3c208d['id']||0x0;this[_0xc2a9('0x4')]=_0x3c208d['name']||'';this[_0xc2a9('0x5')]=_0x3c208d[_0xc2a9('0x5')]||!![];this[_0xc2a9('0x6')]=_0x3c208d[_0xc2a9('0x6')]||![];this[_0xc2a9('0x7')]=_0x3c208d[_0xc2a9('0x7')]||![];this['mailPause']=_0x3c208d[_0xc2a9('0x8')]||![];this[_0xc2a9('0x9')]=_0x3c208d[_0xc2a9('0x9')]||![];this[_0xc2a9('0xa')]=_0x3c208d[_0xc2a9('0xa')]||![];this[_0xc2a9('0xb')]=_0x3c208d['openchannelPause']||![];this[_0xc2a9('0xc')]=_0xc2a9('0xd');this[_0xc2a9('0xe')]=0x0;this[_0xc2a9('0xf')]=_0x3c208d[_0xc2a9('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0xc2a9('0xd');this['mailStatusTime']=0x0;this['mailCapacity']=_0x3c208d['mailCapacity']||0x0;this[_0xc2a9('0x10')]=0x0;this[_0xc2a9('0x11')]=_0xc2a9('0xd');this['faxStatusTime']=0x0;this[_0xc2a9('0x12')]=_0x3c208d[_0xc2a9('0x12')]||0x0;this[_0xc2a9('0x13')]=0x0;this[_0xc2a9('0x14')]=_0xc2a9('0xd');this['smsStatusTime']=0x0;this[_0xc2a9('0x15')]=_0x3c208d['smsCapacity']||0x0;this['smsCurrentCapacity']=0x0;this[_0xc2a9('0x16')]=_0xc2a9('0xd');this[_0xc2a9('0x17')]=0x0;this[_0xc2a9('0x18')]=_0x3c208d[_0xc2a9('0x18')]||0x0;this[_0xc2a9('0x19')]=0x0;this['openchannelStatus']=_0xc2a9('0xd');this[_0xc2a9('0x1a')]=0x0;this[_0xc2a9('0x1b')]=_0x3c208d[_0xc2a9('0x1b')]||0x0;this[_0xc2a9('0x1c')]=0x0;this[_0xc2a9('0x1d')]=![];this[_0xc2a9('0x1e')]=undefined;this[_0xc2a9('0x1f')]='';this[_0xc2a9('0x20')]();}Agent['prototype']['getChannelStatus']=function(_0x1517ba){if(this[_0x1517ba+'CurrentCapacity']>0x0){if(this[_0x1517ba+_0xc2a9('0x21')]>0x0&&this[_0x1517ba+_0xc2a9('0x22')]>=this[_0x1517ba+_0xc2a9('0x21')]){return _0xc2a9('0x23');}else{return _0xc2a9('0x24');}}else{return'idle';}};Agent['prototype'][_0xc2a9('0x20')]=function(){var _0x38c397=['mail',_0xc2a9('0x25'),_0xc2a9('0x26'),_0xc2a9('0x27'),_0xc2a9('0x28'),_0xc2a9('0x29')];for(var _0x10c70e=0x0;_0x10c70e<_0x38c397[_0xc2a9('0x2a')];_0x10c70e+=0x1){var _0x5775a3=this['getChannelStatus'](_0x38c397[_0x10c70e]);if(this[_0x38c397[_0x10c70e]+'Status']!==_0x5775a3){this[_0x38c397[_0x10c70e]+_0xc2a9('0x2b')]=_[_0xc2a9('0x2c')](moment()['format']('x'));}this[_0x38c397[_0x10c70e]+_0xc2a9('0x2d')]=_0x5775a3;}var _0x2036ee={'id':this['id'],'name':this['name'],'online':this['online'],'voicePause':this[_0xc2a9('0x6')],'chatPause':this[_0xc2a9('0x7')],'mailPause':this[_0xc2a9('0x8')],'smsPause':this[_0xc2a9('0xa')],'faxPause':this['faxPause'],'openchannelPause':this[_0xc2a9('0xb')],'chatStatus':this[_0xc2a9('0xc')],'chatStatusTime':this[_0xc2a9('0xe')],'chatCapacity':this[_0xc2a9('0xf')],'chatCurrentCapacity':this[_0xc2a9('0x2e')],'mailStatus':this[_0xc2a9('0x2f')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xc2a9('0x30')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xc2a9('0x11')],'faxStatusTime':this[_0xc2a9('0x31')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xc2a9('0x13')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0xc2a9('0x32')],'smsCapacity':this['smsCapacity'],'smsCurrentCapacity':this[_0xc2a9('0x33')],'whatsappStatus':this[_0xc2a9('0x16')],'whatsappStatusTime':this[_0xc2a9('0x17')],'whatsappCapacity':this['whatsappCapacity'],'whatsappCurrentCapacity':this[_0xc2a9('0x19')],'openchannelStatus':this[_0xc2a9('0x34')],'openchannelStatusTime':this[_0xc2a9('0x1a')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xc2a9('0x1c')],'busy':this[_0xc2a9('0x1d')],'busyQueue':this[_0xc2a9('0x1e')]};var _0x4a2975=md5(JSON[_0xc2a9('0x35')](_0x2036ee));if(this['md5']!==_0x4a2975){this[_0xc2a9('0x1f')]=_0x4a2975;io[_0xc2a9('0x36')](_0xc2a9('0x37'),_0x2036ee);}};module[_0xc2a9('0x38')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 014ce58..99c00bc 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 _0xde1a=['loggedIn','paused','length','available','format','chat:queue:%s','chat_queue:save','lodash','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','Agents'];(function(_0x4b072d,_0x6e06c2){var _0x439d99=function(_0x441c1e){while(--_0x441c1e){_0x4b072d['push'](_0x4b072d['shift']());}};_0x439d99(++_0x6e06c2);}(_0xde1a,0xd7));var _0xade1=function(_0x375611,_0x1a3213){_0x375611=_0x375611-0x0;var _0x4acd5a=_0xde1a[_0x375611];return _0x4acd5a;};'use strict';var _=require(_0xade1('0x0'));var md5=require(_0xade1('0x1'));var util=require('util');var Redis=require(_0xade1('0x2'));var config=require(_0xade1('0x3'));config[_0xade1('0x4')]=_[_0xade1('0x5')](config['redis'],{'host':_0xade1('0x6'),'port':0x18eb});var io=require(_0xade1('0x7'))(new Redis(config[_0xade1('0x4')]));function ChatQueue(_0x3a44ac){this['id']=_0x3a44ac['id']||0x0;this[_0xade1('0x8')]=_0x3a44ac[_0xade1('0x8')]||'';this['timeout']=_0x3a44ac['timeout']||0xa;this['strategy']=_0x3a44ac[_0xade1('0x9')]||_0xade1('0xa');this['Agents']=_0x3a44ac['Agents'];this[_0xade1('0xb')]={};this[_0xade1('0xc')]=0x0;this[_0xade1('0x1')]='';this['updateRouting']();this[_0xade1('0xd')]();}ChatQueue[_0xade1('0xe')][_0xade1('0xf')]=function(){var _0x388eb1=this[_0xade1('0xb')][_0xade1('0x10')];this[_0xade1('0xb')]=_[_0xade1('0x11')](this[_0xade1('0x12')],'id');this['mapAgentsId'][_0xade1('0x10')]=_0x388eb1;};ChatQueue[_0xade1('0xe')][_0xade1('0xd')]=function(){this[_0xade1('0x13')]=0x0;this[_0xade1('0x14')]=0x0;for(var _0x53e266=0x0;_0x53e266=0x0?this[_0xade1('0x16')]:0x0;var _0x51705c={'id':this['id'],'available':this[_0xade1('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xade1('0x8')],'paused':this['paused'],'waiting':this['waiting']};var _0x3336c1=md5(JSON['stringify'](_0x51705c));if(this[_0xade1('0x1')]!==_0x3336c1){this[_0xade1('0x1')]=_0x3336c1;io['to'](util[_0xade1('0x17')](_0xade1('0x18'),_0x51705c[_0xade1('0x8')]))['emit'](_0xade1('0x19'),_0x51705c);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xd3a3=['md5','updateRealtime','prototype','updateRouting','_rr','map','paused','length','chatPause','available','loggedIn','stringify','emit','chat_queue:save','lodash','../../../config/environment','redis','localhost','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting'];(function(_0xd4ec4f,_0x448316){var _0x4d25cf=function(_0x45b2f6){while(--_0x45b2f6){_0xd4ec4f['push'](_0xd4ec4f['shift']());}};_0x4d25cf(++_0x448316);}(_0xd3a3,0x1d0));var _0x3d3a=function(_0x4d384e,_0x61c47a){_0x4d384e=_0x4d384e-0x0;var _0x3eb8e7=_0xd3a3[_0x4d384e];return _0x3eb8e7;};'use strict';var _=require(_0x3d3a('0x0'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var config=require(_0x3d3a('0x1'));config[_0x3d3a('0x2')]=_['defaults'](config['redis'],{'host':_0x3d3a('0x3'),'port':0x18eb});var io=require(_0x3d3a('0x4'))(new Redis(config[_0x3d3a('0x2')]));function ChatQueue(_0x5b08eb){this['id']=_0x5b08eb['id']||0x0;this[_0x3d3a('0x5')]=_0x5b08eb[_0x3d3a('0x5')]||'';this['timeout']=_0x5b08eb['timeout']||0xa;this['strategy']=_0x5b08eb[_0x3d3a('0x6')]||_0x3d3a('0x7');this['Agents']=_0x5b08eb[_0x3d3a('0x8')];this[_0x3d3a('0x9')]={};this[_0x3d3a('0xa')]=0x0;this[_0x3d3a('0xb')]='';this['updateRouting']();this[_0x3d3a('0xc')]();}ChatQueue[_0x3d3a('0xd')][_0x3d3a('0xe')]=function(){var _0x2b9963=this['mapAgentsId'][_0x3d3a('0xf')];this[_0x3d3a('0x9')]=_[_0x3d3a('0x10')](this['Agents'],'id');this[_0x3d3a('0x9')]['_rr']=_0x2b9963;};ChatQueue['prototype']['updateRealtime']=function(){this['loggedIn']=0x0;this[_0x3d3a('0x11')]=0x0;for(var _0x267ce0=0x0;_0x267ce0=0x0?this['available']:0x0;var _0x174bb6={'id':this['id'],'available':this[_0x3d3a('0x14')],'loggedIn':this[_0x3d3a('0x15')],'name':this['name'],'paused':this[_0x3d3a('0x11')],'waiting':this['waiting']};var _0x16273b=md5(JSON[_0x3d3a('0x16')](_0x174bb6));if(this['md5']!==_0x16273b){this['md5']=_0x16273b;io['to'](util['format']('chat:queue:%s',_0x174bb6[_0x3d3a('0x5')]))[_0x3d3a('0x17')](_0x3d3a('0x18'),_0x174bb6);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 5534d04..1fcef00 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 _0xe14c=['loggedIn','length','online','faxPause','paused','available','waiting','stringify','format','fax:queue:%s','emit','exports','md5','util','../../../config/environment','defaults','redis','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x3a0c4f,_0x5dd1a3){var _0x247049=function(_0x144695){while(--_0x144695){_0x3a0c4f['push'](_0x3a0c4f['shift']());}};_0x247049(++_0x5dd1a3);}(_0xe14c,0xd7));var _0xce14=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe14c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require(_0xce14('0x0'));var util=require(_0xce14('0x1'));var Redis=require('ioredis');var config=require(_0xce14('0x2'));config['redis']=_[_0xce14('0x3')](config[_0xce14('0x4')],{'host':_0xce14('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xce14('0x4')]));function FaxQueue(_0x1a3211){this['id']=_0x1a3211['id']||0x0;this[_0xce14('0x6')]=_0x1a3211[_0xce14('0x6')]||'';this[_0xce14('0x7')]=_0x1a3211['timeout']||0xa;this[_0xce14('0x8')]=_0x1a3211[_0xce14('0x8')]||_0xce14('0x9');this[_0xce14('0xa')]=_0x1a3211[_0xce14('0xa')];this[_0xce14('0xb')]={};this['waiting']=0x0;this[_0xce14('0x0')]='';this[_0xce14('0xc')]();this['updateRealtime']();}FaxQueue[_0xce14('0xd')][_0xce14('0xc')]=function(){var _0x3851d7=this['mapAgentsId']['_rr'];this[_0xce14('0xb')]=_[_0xce14('0xe')](this[_0xce14('0xa')],'id');this['mapAgentsId'][_0xce14('0xf')]=_0x3851d7;};FaxQueue[_0xce14('0xd')][_0xce14('0x10')]=function(){this[_0xce14('0x11')]=0x0;this['paused']=0x0;for(var _0xcf8b82=0x0;_0xcf8b82=0x0?this['available']:0x0;var _0x103ac={'id':this['id'],'available':this[_0xce14('0x16')],'loggedIn':this[_0xce14('0x11')],'name':this[_0xce14('0x6')],'paused':this[_0xce14('0x15')],'waiting':this[_0xce14('0x17')]};var _0x46378c=md5(JSON[_0xce14('0x18')](_0x103ac));if(this['md5']!==_0x46378c){this[_0xce14('0x0')]=_0x46378c;io['to'](util[_0xce14('0x19')](_0xce14('0x1a'),_0x103ac[_0xce14('0x6')]))[_0xce14('0x1b')]('fax_queue:save',_0x103ac);}};module[_0xce14('0x1c')]=FaxQueue; \ No newline at end of file +var _0x37ad=['available','stringify','format','fax:queue:%s','emit','fax_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','paused','length','online','loggedIn','faxPause'];(function(_0x2b9e64,_0x405a2d){var _0x452cbe=function(_0x121721){while(--_0x121721){_0x2b9e64['push'](_0x2b9e64['shift']());}};_0x452cbe(++_0x405a2d);}(_0x37ad,0x1f3));var _0xd37a=function(_0x1d5663,_0x2f6a69){_0x1d5663=_0x1d5663-0x0;var _0x344a4d=_0x37ad[_0x1d5663];return _0x344a4d;};'use strict';var _=require('lodash');var md5=require(_0xd37a('0x0'));var util=require(_0xd37a('0x1'));var Redis=require(_0xd37a('0x2'));var config=require(_0xd37a('0x3'));config[_0xd37a('0x4')]=_[_0xd37a('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd37a('0x6'))(new Redis(config['redis']));function FaxQueue(_0x4ef3b7){this['id']=_0x4ef3b7['id']||0x0;this[_0xd37a('0x7')]=_0x4ef3b7[_0xd37a('0x7')]||'';this[_0xd37a('0x8')]=_0x4ef3b7[_0xd37a('0x8')]||0xa;this['strategy']=_0x4ef3b7[_0xd37a('0x9')]||_0xd37a('0xa');this[_0xd37a('0xb')]=_0x4ef3b7[_0xd37a('0xb')];this['mapAgentsId']={};this[_0xd37a('0xc')]=0x0;this[_0xd37a('0x0')]='';this[_0xd37a('0xd')]();this[_0xd37a('0xe')]();}FaxQueue[_0xd37a('0xf')][_0xd37a('0xd')]=function(){var _0x5cbad6=this[_0xd37a('0x10')]['_rr'];this[_0xd37a('0x10')]=_['map'](this['Agents'],'id');this[_0xd37a('0x10')][_0xd37a('0x11')]=_0x5cbad6;};FaxQueue['prototype'][_0xd37a('0xe')]=function(){this['loggedIn']=0x0;this[_0xd37a('0x12')]=0x0;for(var _0x330835=0x0;_0x330835=0x0?this[_0xd37a('0x17')]:0x0;var _0x3c8192={'id':this['id'],'available':this[_0xd37a('0x17')],'loggedIn':this[_0xd37a('0x15')],'name':this[_0xd37a('0x7')],'paused':this[_0xd37a('0x12')],'waiting':this['waiting']};var _0x12ec8a=md5(JSON[_0xd37a('0x18')](_0x3c8192));if(this[_0xd37a('0x0')]!==_0x12ec8a){this[_0xd37a('0x0')]=_0x12ec8a;io['to'](util[_0xd37a('0x19')](_0xd37a('0x1a'),_0x3c8192[_0xd37a('0x7')]))[_0xd37a('0x1b')](_0xd37a('0x1c'),_0x3c8192);}};module['exports']=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 24f2b73..fb21f8f 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 _0x18ca=['Intervals','exports','name'];(function(_0x136690,_0xc0751a){var _0x26b719=function(_0x501371){while(--_0x501371){_0x136690['push'](_0x136690['shift']());}};_0x26b719(++_0xc0751a);}(_0x18ca,0x125));var _0xa18c=function(_0xdc817c,_0x1b4d2b){_0xdc817c=_0xdc817c-0x0;var _0x5b8fba=_0x18ca[_0xdc817c];return _0x5b8fba;};'use strict';function Interval(_0x7d79cb){this['id']=_0x7d79cb['id']||0x0;this[_0xa18c('0x0')]=_0x7d79cb[_0xa18c('0x0')]||'';this[_0xa18c('0x1')]=_0x7d79cb['Intervals']||{};}module[_0xa18c('0x2')]=Interval; \ No newline at end of file +var _0x6088=['Intervals','exports'];(function(_0x5c6951,_0x507abb){var _0x5ee145=function(_0x4f8b75){while(--_0x4f8b75){_0x5c6951['push'](_0x5c6951['shift']());}};_0x5ee145(++_0x507abb);}(_0x6088,0x100));var _0x8608=function(_0x29e11c,_0x445129){_0x29e11c=_0x29e11c-0x0;var _0x2c4fb6=_0x6088[_0x29e11c];return _0x2c4fb6;};'use strict';function Interval(_0x378473){this['id']=_0x378473['id']||0x0;this['name']=_0x378473['name']||'';this['Intervals']=_0x378473[_0x8608('0x0')]||{};}module[_0x8608('0x1')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 10de75f..e105a20 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 _0x8769=['socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','length','online','available','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','redis','defaults','localhost'];(function(_0x1d3ae4,_0x365dfc){var _0x35aba9=function(_0x128b46){while(--_0x128b46){_0x1d3ae4['push'](_0x1d3ae4['shift']());}};_0x35aba9(++_0x365dfc);}(_0x8769,0x18f));var _0x9876=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x8769[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0x9876('0x0'));var md5=require(_0x9876('0x1'));var util=require(_0x9876('0x2'));var Redis=require(_0x9876('0x3'));var config=require('../../../config/environment');config[_0x9876('0x4')]=_[_0x9876('0x5')](config[_0x9876('0x4')],{'host':_0x9876('0x6'),'port':0x18eb});var io=require(_0x9876('0x7'))(new Redis(config[_0x9876('0x4')]));function MailQueue(_0x1be04e){this['id']=_0x1be04e['id']||0x0;this[_0x9876('0x8')]=_0x1be04e['name']||'';this['timeout']=_0x1be04e[_0x9876('0x9')]||0xa;this[_0x9876('0xa')]=_0x1be04e[_0x9876('0xa')]||_0x9876('0xb');this[_0x9876('0xc')]=_0x1be04e['Agents'];this[_0x9876('0xd')]={};this[_0x9876('0xe')]=0x0;this[_0x9876('0x1')]='';this[_0x9876('0xf')]();this[_0x9876('0x10')]();}MailQueue[_0x9876('0x11')][_0x9876('0xf')]=function(){var _0xa951fb=this[_0x9876('0xd')][_0x9876('0x12')];this[_0x9876('0xd')]=_['map'](this[_0x9876('0xc')],'id');this[_0x9876('0xd')][_0x9876('0x12')]=_0xa951fb;};MailQueue[_0x9876('0x11')][_0x9876('0x10')]=function(){this[_0x9876('0x13')]=0x0;this[_0x9876('0x14')]=0x0;for(var _0x1b8afd=0x0;_0x1b8afd=0x0?this['available']:0x0;var _0x4fc628={'id':this['id'],'available':this['available'],'loggedIn':this[_0x9876('0x13')],'name':this['name'],'paused':this[_0x9876('0x14')],'waiting':this[_0x9876('0xe')]};var _0x4eaea6=md5(JSON[_0x9876('0x18')](_0x4fc628));if(this[_0x9876('0x1')]!==_0x4eaea6){this[_0x9876('0x1')]=_0x4eaea6;io['to'](util[_0x9876('0x19')](_0x9876('0x1a'),_0x4fc628['name']))[_0x9876('0x1b')](_0x9876('0x1c'),_0x4fc628);}};module['exports']=MailQueue; \ No newline at end of file +var _0x4e13=['util','ioredis','../../../config/environment','redis','defaults','localhost','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','mailPause','paused','available','format','mail:queue:%s','emit','mail_queue:save','exports','lodash'];(function(_0x420a6f,_0x477b5e){var _0x5f466a=function(_0x26348c){while(--_0x26348c){_0x420a6f['push'](_0x420a6f['shift']());}};_0x5f466a(++_0x477b5e);}(_0x4e13,0x149));var _0x34e1=function(_0x19a49f,_0x444d74){_0x19a49f=_0x19a49f-0x0;var _0x5351ae=_0x4e13[_0x19a49f];return _0x5351ae;};'use strict';var _=require(_0x34e1('0x0'));var md5=require('md5');var util=require(_0x34e1('0x1'));var Redis=require(_0x34e1('0x2'));var config=require(_0x34e1('0x3'));config[_0x34e1('0x4')]=_[_0x34e1('0x5')](config['redis'],{'host':_0x34e1('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x34e1('0x4')]));function MailQueue(_0x48b2cc){this['id']=_0x48b2cc['id']||0x0;this['name']=_0x48b2cc[_0x34e1('0x7')]||'';this[_0x34e1('0x8')]=_0x48b2cc[_0x34e1('0x8')]||0xa;this[_0x34e1('0x9')]=_0x48b2cc[_0x34e1('0x9')]||_0x34e1('0xa');this[_0x34e1('0xb')]=_0x48b2cc[_0x34e1('0xb')];this['mapAgentsId']={};this[_0x34e1('0xc')]=0x0;this[_0x34e1('0xd')]='';this[_0x34e1('0xe')]();this[_0x34e1('0xf')]();}MailQueue[_0x34e1('0x10')][_0x34e1('0xe')]=function(){var _0x2c0702=this[_0x34e1('0x11')][_0x34e1('0x12')];this[_0x34e1('0x11')]=_[_0x34e1('0x13')](this['Agents'],'id');this[_0x34e1('0x11')][_0x34e1('0x12')]=_0x2c0702;};MailQueue[_0x34e1('0x10')]['updateRealtime']=function(){this[_0x34e1('0x14')]=0x0;this['paused']=0x0;for(var _0x2e29f5=0x0;_0x2e29f5=0x0?this[_0x34e1('0x18')]:0x0;var _0x3a5a5a={'id':this['id'],'available':this[_0x34e1('0x18')],'loggedIn':this[_0x34e1('0x14')],'name':this[_0x34e1('0x7')],'paused':this[_0x34e1('0x17')],'waiting':this['waiting']};var _0x7c31d3=md5(JSON['stringify'](_0x3a5a5a));if(this[_0x34e1('0xd')]!==_0x7c31d3){this[_0x34e1('0xd')]=_0x7c31d3;io['to'](util[_0x34e1('0x19')](_0x34e1('0x1a'),_0x3a5a5a['name']))[_0x34e1('0x1b')](_0x34e1('0x1c'),_0x3a5a5a);}};module[_0x34e1('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 a1ffb81..a892181 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['exports','lodash','md5','util','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','waiting','updateRealtime','mapAgentsId','_rr','map','Agents','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x7a54,0x106));var _0x47a5=function(_0x4b24fd,_0x3e5e97){_0x4b24fd=_0x4b24fd-0x0;var _0x3c1f1f=_0x7a54[_0x4b24fd];return _0x3c1f1f;};'use strict';var _=require(_0x47a5('0x0'));var md5=require(_0x47a5('0x1'));var util=require(_0x47a5('0x2'));var Redis=require('ioredis');var config=require(_0x47a5('0x3'));config[_0x47a5('0x4')]=_['defaults'](config[_0x47a5('0x4')],{'host':_0x47a5('0x5'),'port':0x18eb});var io=require(_0x47a5('0x6'))(new Redis(config[_0x47a5('0x4')]));function OpenchannelQueue(_0xfdf934){this['id']=_0xfdf934['id']||0x0;this['name']=_0xfdf934[_0x47a5('0x7')]||'';this['timeout']=_0xfdf934[_0x47a5('0x8')]||0xa;this[_0x47a5('0x9')]=_0xfdf934['strategy']||_0x47a5('0xa');this['Agents']=_0xfdf934['Agents'];this['mapAgentsId']={};this[_0x47a5('0xb')]=0x0;this[_0x47a5('0x1')]='';this['updateRouting']();this[_0x47a5('0xc')]();}OpenchannelQueue['prototype']['updateRouting']=function(){var _0x1f47f4=this[_0x47a5('0xd')][_0x47a5('0xe')];this[_0x47a5('0xd')]=_[_0x47a5('0xf')](this[_0x47a5('0x10')],'id');this[_0x47a5('0xd')]['_rr']=_0x1f47f4;};OpenchannelQueue[_0x47a5('0x11')][_0x47a5('0xc')]=function(){this[_0x47a5('0x12')]=0x0;this[_0x47a5('0x13')]=0x0;for(var _0x139f25=0x0;_0x139f25=0x0?this['available']:0x0;var _0x423a81={'id':this['id'],'available':this[_0x47a5('0x16')],'loggedIn':this[_0x47a5('0x12')],'name':this[_0x47a5('0x7')],'paused':this[_0x47a5('0x13')],'waiting':this[_0x47a5('0xb')]};var _0x2763d6=md5(JSON[_0x47a5('0x17')](_0x423a81));if(this[_0x47a5('0x1')]!==_0x2763d6){this['md5']=_0x2763d6;io['to'](util[_0x47a5('0x18')](_0x47a5('0x19'),_0x423a81['name']))[_0x47a5('0x1a')](_0x47a5('0x1b'),_0x423a81);}};module[_0x47a5('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x1261=['available','stringify','openchannel:queue:%s','openchannel_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','updateRouting','prototype','mapAgentsId','map','_rr','updateRealtime','loggedIn','paused','length','online'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x1261,0x144));var _0x1126=function(_0xea98ab,_0x297344){_0xea98ab=_0xea98ab-0x0;var _0x39058e=_0x1261[_0xea98ab];return _0x39058e;};'use strict';var _=require('lodash');var md5=require(_0x1126('0x0'));var util=require(_0x1126('0x1'));var Redis=require(_0x1126('0x2'));var config=require(_0x1126('0x3'));config[_0x1126('0x4')]=_[_0x1126('0x5')](config[_0x1126('0x4')],{'host':_0x1126('0x6'),'port':0x18eb});var io=require(_0x1126('0x7'))(new Redis(config[_0x1126('0x4')]));function OpenchannelQueue(_0x5a2189){this['id']=_0x5a2189['id']||0x0;this['name']=_0x5a2189[_0x1126('0x8')]||'';this[_0x1126('0x9')]=_0x5a2189['timeout']||0xa;this[_0x1126('0xa')]=_0x5a2189[_0x1126('0xa')]||_0x1126('0xb');this[_0x1126('0xc')]=_0x5a2189[_0x1126('0xc')];this['mapAgentsId']={};this[_0x1126('0xd')]=0x0;this[_0x1126('0x0')]='';this[_0x1126('0xe')]();this['updateRealtime']();}OpenchannelQueue[_0x1126('0xf')]['updateRouting']=function(){var _0x52ef15=this[_0x1126('0x10')]['_rr'];this[_0x1126('0x10')]=_[_0x1126('0x11')](this[_0x1126('0xc')],'id');this[_0x1126('0x10')][_0x1126('0x12')]=_0x52ef15;};OpenchannelQueue[_0x1126('0xf')][_0x1126('0x13')]=function(){this[_0x1126('0x14')]=0x0;this[_0x1126('0x15')]=0x0;for(var _0x53a8f0=0x0;_0x53a8f0=0x0?this['available']:0x0;var _0x4d2b38={'id':this['id'],'available':this[_0x1126('0x18')],'loggedIn':this[_0x1126('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x1126('0xd')]};var _0x58b109=md5(JSON[_0x1126('0x19')](_0x4d2b38));if(this[_0x1126('0x0')]!==_0x58b109){this[_0x1126('0x0')]=_0x58b109;io['to'](util['format'](_0x1126('0x1a'),_0x4d2b38['name']))['emit'](_0x1126('0x1b'),_0x4d2b38);}};module[_0x1126('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index a59b594..fe6d310 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 _0x7f42=['Agents','mapAgentsId','waiting','md5','updateRouting','updateRealtime','prototype','_rr','loggedIn','paused','online','available','stringify','format','sms:queue:%s','emit','sms_queue:save','exports','lodash','util','ioredis','redis','socket.io-emitter','name','timeout','strategy','beepall'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7f42,0x1dd));var _0x27f4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7f42[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x27f4('0x0'));var md5=require('md5');var util=require(_0x27f4('0x1'));var Redis=require(_0x27f4('0x2'));var config=require('../../../config/environment');config[_0x27f4('0x3')]=_['defaults'](config[_0x27f4('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0x27f4('0x4'))(new Redis(config['redis']));function SmsQueue(_0xe8eabe){this['id']=_0xe8eabe['id']||0x0;this['name']=_0xe8eabe[_0x27f4('0x5')]||'';this[_0x27f4('0x6')]=_0xe8eabe[_0x27f4('0x6')]||0xa;this[_0x27f4('0x7')]=_0xe8eabe[_0x27f4('0x7')]||_0x27f4('0x8');this[_0x27f4('0x9')]=_0xe8eabe[_0x27f4('0x9')];this[_0x27f4('0xa')]={};this[_0x27f4('0xb')]=0x0;this[_0x27f4('0xc')]='';this[_0x27f4('0xd')]();this[_0x27f4('0xe')]();}SmsQueue[_0x27f4('0xf')][_0x27f4('0xd')]=function(){var _0x369725=this[_0x27f4('0xa')][_0x27f4('0x10')];this['mapAgentsId']=_['map'](this[_0x27f4('0x9')],'id');this[_0x27f4('0xa')][_0x27f4('0x10')]=_0x369725;};SmsQueue[_0x27f4('0xf')][_0x27f4('0xe')]=function(){this[_0x27f4('0x11')]=0x0;this[_0x27f4('0x12')]=0x0;for(var _0x40393e=0x0;_0x40393e=0x0?this[_0x27f4('0x14')]:0x0;var _0x49e6c0={'id':this['id'],'available':this[_0x27f4('0x14')],'loggedIn':this[_0x27f4('0x11')],'name':this['name'],'paused':this['paused'],'waiting':this[_0x27f4('0xb')]};var _0x2957a1=md5(JSON[_0x27f4('0x15')](_0x49e6c0));if(this[_0x27f4('0xc')]!==_0x2957a1){this[_0x27f4('0xc')]=_0x2957a1;io['to'](util[_0x27f4('0x16')](_0x27f4('0x17'),_0x49e6c0[_0x27f4('0x5')]))[_0x27f4('0x18')](_0x27f4('0x19'),_0x49e6c0);}};module[_0x27f4('0x1a')]=SmsQueue; \ No newline at end of file +var _0xb7cf=['md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRealtime','_rr','map','loggedIn','length','online','paused','available','stringify','format','emit','sms_queue:save','exports','lodash'];(function(_0x5cc58e,_0x394ef5){var _0x1c5dac=function(_0x1337a0){while(--_0x1337a0){_0x5cc58e['push'](_0x5cc58e['shift']());}};_0x1c5dac(++_0x394ef5);}(_0xb7cf,0xca));var _0xfb7c=function(_0x2b27a0,_0x2ee33){_0x2b27a0=_0x2b27a0-0x0;var _0x44ec6b=_0xb7cf[_0x2b27a0];return _0x44ec6b;};'use strict';var _=require(_0xfb7c('0x0'));var md5=require(_0xfb7c('0x1'));var util=require(_0xfb7c('0x2'));var Redis=require(_0xfb7c('0x3'));var config=require(_0xfb7c('0x4'));config['redis']=_[_0xfb7c('0x5')](config[_0xfb7c('0x6')],{'host':_0xfb7c('0x7'),'port':0x18eb});var io=require(_0xfb7c('0x8'))(new Redis(config[_0xfb7c('0x6')]));function SmsQueue(_0x9b9d75){this['id']=_0x9b9d75['id']||0x0;this[_0xfb7c('0x9')]=_0x9b9d75[_0xfb7c('0x9')]||'';this[_0xfb7c('0xa')]=_0x9b9d75[_0xfb7c('0xa')]||0xa;this[_0xfb7c('0xb')]=_0x9b9d75[_0xfb7c('0xb')]||_0xfb7c('0xc');this[_0xfb7c('0xd')]=_0x9b9d75['Agents'];this[_0xfb7c('0xe')]={};this[_0xfb7c('0xf')]=0x0;this[_0xfb7c('0x1')]='';this['updateRouting']();this[_0xfb7c('0x10')]();}SmsQueue['prototype']['updateRouting']=function(){var _0x17921f=this[_0xfb7c('0xe')][_0xfb7c('0x11')];this[_0xfb7c('0xe')]=_[_0xfb7c('0x12')](this[_0xfb7c('0xd')],'id');this[_0xfb7c('0xe')][_0xfb7c('0x11')]=_0x17921f;};SmsQueue['prototype'][_0xfb7c('0x10')]=function(){this[_0xfb7c('0x13')]=0x0;this['paused']=0x0;for(var _0x26eb80=0x0;_0x26eb80=0x0?this['available']:0x0;var _0x20115a={'id':this['id'],'available':this['available'],'loggedIn':this[_0xfb7c('0x13')],'name':this[_0xfb7c('0x9')],'paused':this[_0xfb7c('0x16')],'waiting':this[_0xfb7c('0xf')]};var _0x442c13=md5(JSON[_0xfb7c('0x18')](_0x20115a));if(this[_0xfb7c('0x1')]!==_0x442c13){this['md5']=_0x442c13;io['to'](util[_0xfb7c('0x19')]('sms:queue:%s',_0x20115a[_0xfb7c('0x9')]))[_0xfb7c('0x1a')](_0xfb7c('0x1b'),_0x20115a);}};module[_0xfb7c('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 295ba5e..4c03d64 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 _0x9e09=['paused','whatsappPause','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn'];(function(_0x158c49,_0xb4afca){var _0x279b42=function(_0x14c8e9){while(--_0x14c8e9){_0x158c49['push'](_0x158c49['shift']());}};_0x279b42(++_0xb4afca);}(_0x9e09,0x12a));var _0x99e0=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9e09[_0x3947c9];return _0x2e7871;};'use strict';var _=require('lodash');var md5=require(_0x99e0('0x0'));var util=require(_0x99e0('0x1'));var Redis=require(_0x99e0('0x2'));var config=require(_0x99e0('0x3'));config[_0x99e0('0x4')]=_[_0x99e0('0x5')](config[_0x99e0('0x4')],{'host':_0x99e0('0x6'),'port':0x18eb});var io=require(_0x99e0('0x7'))(new Redis(config[_0x99e0('0x4')]));function WhatsappQueue(_0x203bde){this['id']=_0x203bde['id']||0x0;this[_0x99e0('0x8')]=_0x203bde[_0x99e0('0x8')]||'';this[_0x99e0('0x9')]=_0x203bde[_0x99e0('0x9')]||0xa;this['strategy']=_0x203bde[_0x99e0('0xa')]||_0x99e0('0xb');this['Agents']=_0x203bde[_0x99e0('0xc')];this[_0x99e0('0xd')]={};this[_0x99e0('0xe')]=0x0;this[_0x99e0('0x0')]='';this[_0x99e0('0xf')]();this[_0x99e0('0x10')]();}WhatsappQueue[_0x99e0('0x11')]['updateRouting']=function(){var _0x357439=this[_0x99e0('0xd')][_0x99e0('0x12')];this[_0x99e0('0xd')]=_[_0x99e0('0x13')](this['Agents'],'id');this[_0x99e0('0xd')][_0x99e0('0x12')]=_0x357439;};WhatsappQueue[_0x99e0('0x11')][_0x99e0('0x10')]=function(){this[_0x99e0('0x14')]=0x0;this[_0x99e0('0x15')]=0x0;for(var _0xb06603=0x0;_0xb06603=0x0?this[_0x99e0('0x17')]:0x0;var _0x5e6137={'id':this['id'],'available':this[_0x99e0('0x17')],'loggedIn':this[_0x99e0('0x14')],'name':this[_0x99e0('0x8')],'paused':this[_0x99e0('0x15')],'waiting':this[_0x99e0('0xe')]};var _0x4dde95=md5(JSON[_0x99e0('0x18')](_0x5e6137));if(this['md5']!==_0x4dde95){this[_0x99e0('0x0')]=_0x4dde95;io['to'](util[_0x99e0('0x19')](_0x99e0('0x1a'),_0x5e6137['name']))['emit'](_0x99e0('0x1b'),_0x5e6137);}};module[_0x99e0('0x1c')]=WhatsappQueue; \ No newline at end of file +var _0x224c=['updateRealtime','_rr','map','paused','length','online','loggedIn','whatsappPause','available','waiting','stringify','format','whatsapp:queue:%s','lodash','util','ioredis','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting'];(function(_0x905982,_0x13ab08){var _0x31519c=function(_0x11cc17){while(--_0x11cc17){_0x905982['push'](_0x905982['shift']());}};_0x31519c(++_0x13ab08);}(_0x224c,0x16c));var _0xc224=function(_0x43be4e,_0x2d5fc9){_0x43be4e=_0x43be4e-0x0;var _0x282bcd=_0x224c[_0x43be4e];return _0x282bcd;};'use strict';var _=require(_0xc224('0x0'));var md5=require('md5');var util=require(_0xc224('0x1'));var Redis=require(_0xc224('0x2'));var config=require('../../../config/environment');config['redis']=_['defaults'](config['redis'],{'host':_0xc224('0x3'),'port':0x18eb});var io=require(_0xc224('0x4'))(new Redis(config[_0xc224('0x5')]));function WhatsappQueue(_0x335fac){this['id']=_0x335fac['id']||0x0;this['name']=_0x335fac[_0xc224('0x6')]||'';this[_0xc224('0x7')]=_0x335fac['timeout']||0xa;this['strategy']=_0x335fac[_0xc224('0x8')]||_0xc224('0x9');this[_0xc224('0xa')]=_0x335fac[_0xc224('0xa')];this[_0xc224('0xb')]={};this['waiting']=0x0;this[_0xc224('0xc')]='';this[_0xc224('0xd')]();this[_0xc224('0xe')]();}WhatsappQueue['prototype'][_0xc224('0xd')]=function(){var _0x5119f3=this['mapAgentsId'][_0xc224('0xf')];this[_0xc224('0xb')]=_[_0xc224('0x10')](this[_0xc224('0xa')],'id');this[_0xc224('0xb')][_0xc224('0xf')]=_0x5119f3;};WhatsappQueue['prototype'][_0xc224('0xe')]=function(){this['loggedIn']=0x0;this[_0xc224('0x11')]=0x0;for(var _0xa4199b=0x0;_0xa4199b=0x0?this[_0xc224('0x16')]:0x0;var _0x5bc34d={'id':this['id'],'available':this[_0xc224('0x16')],'loggedIn':this[_0xc224('0x14')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xc224('0x17')]};var _0x2060c9=md5(JSON[_0xc224('0x18')](_0x5bc34d));if(this[_0xc224('0xc')]!==_0x2060c9){this[_0xc224('0xc')]=_0x2060c9;io['to'](util[_0xc224('0x19')](_0xc224('0x1a'),_0x5bc34d[_0xc224('0x6')]))['emit']('whatsapp_queue:save',_0x5bc34d);}};module['exports']=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b5c47be..cc4538f 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(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xa9e0[_0x4cf98e];return _0x1623ac;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 2832979..2595f5f 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 _0xa21e=['UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x5cd6bb,_0xc8f5b0){var _0x4108fa=function(_0x2d5297){while(--_0x2d5297){_0x5cd6bb['push'](_0x5cd6bb['shift']());}};_0x4108fa(++_0xc8f5b0);}(_0xa21e,0xc1));var _0xea21=function(_0x4c445a,_0x4ee80f){_0x4c445a=_0x4c445a-0x0;var _0x2f611c=_0xa21e[_0x4c445a];return _0x2f611c;};'use strict';var client=require(_0xea21('0x0'));exports[_0xea21('0x1')]=function(_0x4ac8ad,_0x2c872b){return client[_0xea21('0x2')](_0xea21('0x3'),{'body':_0x2c872b,'options':{'where':{'id':_0x4ac8ad}},'log':'updateChatInteraction'});};exports[_0xea21('0x4')]=function(_0x11bdfc,_0x157e11){return client[_0xea21('0x2')](_0xea21('0x5'),{'body':_0x157e11,'options':{'where':{'id':_0x11bdfc}},'log':_0xea21('0x6')});}; \ No newline at end of file +var _0xe6a3=['AddTagsToChatInteraction','addTagsToChatInteraction','../client','Request','updateChatInteraction','addTags'];(function(_0x1bd377,_0x4c2781){var _0x185b13=function(_0x1b678a){while(--_0x1b678a){_0x1bd377['push'](_0x1bd377['shift']());}};_0x185b13(++_0x4c2781);}(_0xe6a3,0x68));var _0x3e6a=function(_0xce93c,_0x555be5){_0xce93c=_0xce93c-0x0;var _0x230720=_0xe6a3[_0xce93c];return _0x230720;};'use strict';var client=require(_0x3e6a('0x0'));exports['update']=function(_0x1e8f23,_0x556103){return client[_0x3e6a('0x1')]('UpdateChatInteraction',{'body':_0x556103,'options':{'where':{'id':_0x1e8f23}},'log':_0x3e6a('0x2')});};exports[_0x3e6a('0x3')]=function(_0x43e9d1,_0x7e0a81){return client['Request'](_0x3e6a('0x4'),{'body':_0x7e0a81,'options':{'where':{'id':_0x43e9d1}},'log':_0x3e6a('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 3eea6ba..37e1f4e 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 _0x6ba4=['create','Request','CreateChatMessage','createChatMessage'];(function(_0xf83ad9,_0x4163ee){var _0xf5f0fb=function(_0xb650d1){while(--_0xb650d1){_0xf83ad9['push'](_0xf83ad9['shift']());}};_0xf5f0fb(++_0x4163ee);}(_0x6ba4,0x1b8));var _0x46ba=function(_0x5439ff,_0x32b909){_0x5439ff=_0x5439ff-0x0;var _0x595a6c=_0x6ba4[_0x5439ff];return _0x595a6c;};'use strict';var client=require('../client');exports[_0x46ba('0x0')]=function(_0x264852){return client[_0x46ba('0x1')](_0x46ba('0x2'),{'body':_0x264852,'log':_0x46ba('0x3')});}; \ No newline at end of file +var _0x9851=['create','Request','createChatMessage','../client'];(function(_0x4d2169,_0x353eb9){var _0x52e417=function(_0x6df76e){while(--_0x6df76e){_0x4d2169['push'](_0x4d2169['shift']());}};_0x52e417(++_0x353eb9);}(_0x9851,0xb3));var _0x1985=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9851[_0x321bb2];return _0x9c12ed;};'use strict';var client=require(_0x1985('0x0'));exports[_0x1985('0x1')]=function(_0x4cb39c){return client[_0x1985('0x2')]('CreateChatMessage',{'body':_0x4cb39c,'log':_0x1985('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 135d4c2..7c4cf8d 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 _0xeff8=['GetChatQueue','name','timeout','User','Agents','online','../client','getChatQueues'];(function(_0x28c37b,_0x417047){var _0x16ba05=function(_0x3921a9){while(--_0x3921a9){_0x28c37b['push'](_0x28c37b['shift']());}};_0x16ba05(++_0x417047);}(_0xeff8,0x186));var _0x8eff=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xeff8[_0xefd519];return _0x4bb882;};'use strict';var client=require(_0x8eff('0x0'));exports[_0x8eff('0x1')]=function(){return function(){return client['Request'](_0x8eff('0x2'),{'options':{'raw':![],'attributes':['id',_0x8eff('0x3'),_0x8eff('0x4'),'strategy'],'include':[{'model':_0x8eff('0x5'),'as':_0x8eff('0x6'),'attributes':['id',_0x8eff('0x3'),_0x8eff('0x7'),'chatPause']}]},'log':_0x8eff('0x1')});};}; \ No newline at end of file +var _0xf9d5=['Agents','online','getChatQueues','Request','name','timeout','strategy','User'];(function(_0x5a1d97,_0x265b5a){var _0x401646=function(_0x4dd898){while(--_0x4dd898){_0x5a1d97['push'](_0x5a1d97['shift']());}};_0x401646(++_0x265b5a);}(_0xf9d5,0x122));var _0x5f9d=function(_0x21b26e,_0x422f58){_0x21b26e=_0x21b26e-0x0;var _0x38c0e8=_0xf9d5[_0x21b26e];return _0x38c0e8;};'use strict';var client=require('../client');exports[_0x5f9d('0x0')]=function(){return function(){return client[_0x5f9d('0x1')]('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0x5f9d('0x2'),_0x5f9d('0x3'),_0x5f9d('0x4')],'include':[{'model':_0x5f9d('0x5'),'as':_0x5f9d('0x6'),'attributes':['id',_0x5f9d('0x2'),_0x5f9d('0x7'),'chatPause']}]},'log':_0x5f9d('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index dfc2c8c..908ecf3 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 _0xd845=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0xcfa25b,_0x2512a1){var _0x258a4e=function(_0x3c566f){while(--_0x3c566f){_0xcfa25b['push'](_0xcfa25b['shift']());}};_0x258a4e(++_0x2512a1);}(_0xd845,0x135));var _0x5d84=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xd845[_0x36dfbd];return _0x4ecad9;};'use strict';var client=require(_0x5d84('0x0'));exports[_0x5d84('0x1')]=function(_0xc6e9bc){return client[_0x5d84('0x2')]('CreateChatQueueReport',{'body':_0xc6e9bc,'log':_0x5d84('0x3')});};exports[_0x5d84('0x4')]=function(_0x918317,_0x11abe5){return client['Request'](_0x5d84('0x5'),{'body':_0x11abe5,'options':{'where':{'uniqueid':_0x918317},'order':[['id',_0x5d84('0x6')]],'limit':0x1},'log':_0x5d84('0x5')});}; \ No newline at end of file +var _0xc6ab=['../client','create','Request','CreateChatQueueReport','UpdateChatQueueReport','DESC'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc6ab,0x96));var _0xbc6a=function(_0x56d7b8,_0x5aeded){_0x56d7b8=_0x56d7b8-0x0;var _0x136487=_0xc6ab[_0x56d7b8];return _0x136487;};'use strict';var client=require(_0xbc6a('0x0'));exports[_0xbc6a('0x1')]=function(_0x46da42){return client[_0xbc6a('0x2')](_0xbc6a('0x3'),{'body':_0x46da42,'log':'CreateChatQueueReport'});};exports['update']=function(_0xbf9d02,_0x1c351c){return client[_0xbc6a('0x2')](_0xbc6a('0x4'),{'body':_0x1c351c,'options':{'where':{'uniqueid':_0xbf9d02},'order':[['id',_0xbc6a('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index e847eb3..b10cca8 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(_0x6f1a87,_0x5d5bcf){var _0x2495c7=function(_0x1c6733){while(--_0x1c6733){_0x6f1a87['push'](_0x6f1a87['shift']());}};_0x2495c7(++_0x5d5bcf);}(_0x7a54,0x106));var _0x47a5=function(_0x2be8aa,_0x21b7ce){_0x2be8aa=_0x2be8aa-0x0;var _0x3a33c8=_0x7a54[_0x2be8aa];return _0x3a33c8;};'use strict';var client=require(_0x47a5('0x0'));exports[_0x47a5('0x1')]=function(_0x44b31e,_0x58157c){return client[_0x47a5('0x2')](_0x47a5('0x3'),{'body':_0x58157c,'options':{'where':{'id':_0x44b31e}},'log':'updateFaxInteraction'});};exports[_0x47a5('0x4')]=function(_0x11bf85,_0x2a1a7e){return client[_0x47a5('0x2')](_0x47a5('0x5'),{'body':_0x2a1a7e,'options':{'where':{'id':_0x11bf85}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0x9957=['Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','UpdateFaxInteraction','updateFaxInteraction','addTags'];(function(_0x5595b3,_0x27d121){var _0x22e7a0=function(_0xacfb9e){while(--_0xacfb9e){_0x5595b3['push'](_0x5595b3['shift']());}};_0x22e7a0(++_0x27d121);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'use strict';var client=require(_0x7995('0x0'));exports[_0x7995('0x1')]=function(_0x2722a3,_0x10a05d){return client['Request'](_0x7995('0x2'),{'body':_0x10a05d,'options':{'where':{'id':_0x2722a3}},'log':_0x7995('0x3')});};exports[_0x7995('0x4')]=function(_0x462a03,_0x576d89){return client[_0x7995('0x5')](_0x7995('0x6'),{'body':_0x576d89,'options':{'where':{'id':_0x462a03}},'log':_0x7995('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 4902b53..5a24e3b 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 _0xfeec=['createFaxMessage','../client','create','Request','CreateFaxMessage'];(function(_0x440237,_0x403080){var _0x59c5b8=function(_0x4740a5){while(--_0x4740a5){_0x440237['push'](_0x440237['shift']());}};_0x59c5b8(++_0x403080);}(_0xfeec,0x19b));var _0xcfee=function(_0x676aa6,_0x484ed4){_0x676aa6=_0x676aa6-0x0;var _0x30bb79=_0xfeec[_0x676aa6];return _0x30bb79;};'use strict';var client=require(_0xcfee('0x0'));exports[_0xcfee('0x1')]=function(_0x3d15d8){return client[_0xcfee('0x2')](_0xcfee('0x3'),{'body':_0x3d15d8,'log':_0xcfee('0x4')});}; \ No newline at end of file +var _0x06d3=['createFaxMessage'];(function(_0x282ccc,_0x5d66a1){var _0x27c2dd=function(_0x58431a){while(--_0x58431a){_0x282ccc['push'](_0x282ccc['shift']());}};_0x27c2dd(++_0x5d66a1);}(_0x06d3,0x189));var _0x306d=function(_0x18fa03,_0x311bee){_0x18fa03=_0x18fa03-0x0;var _0x4439cd=_0x06d3[_0x18fa03];return _0x4439cd;};'use strict';var client=require('../client');exports['create']=function(_0x2aa437){return client['Request']('CreateFaxMessage',{'body':_0x2aa437,'log':_0x306d('0x0')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index a578f3b..1287052 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 _0x0165=['Request','GetFaxQueue','strategy','User','Agents','name','online','faxPause','getFaxQueues','../client'];(function(_0x4290dd,_0x2a0c28){var _0x4272c5=function(_0x4139f3){while(--_0x4139f3){_0x4290dd['push'](_0x4290dd['shift']());}};_0x4272c5(++_0x2a0c28);}(_0x0165,0x95));var _0x5016=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x0165[_0xa464c9];return _0x3d73c4;};'use strict';var client=require(_0x5016('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x5016('0x1')](_0x5016('0x2'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x5016('0x3')],'include':[{'model':_0x5016('0x4'),'as':_0x5016('0x5'),'attributes':['id',_0x5016('0x6'),_0x5016('0x7'),_0x5016('0x8')]}]},'log':_0x5016('0x9')});};}; \ No newline at end of file +var _0xfa3f=['GetFaxQueue','name','timeout','strategy','User','faxPause','getFaxQueues','Request'];(function(_0x567bcb,_0x4978c1){var _0x4eebc2=function(_0x42a456){while(--_0x42a456){_0x567bcb['push'](_0x567bcb['shift']());}};_0x4eebc2(++_0x4978c1);}(_0xfa3f,0x196));var _0xffa3=function(_0x2704f9,_0x3db2c2){_0x2704f9=_0x2704f9-0x0;var _0x1f675d=_0xfa3f[_0x2704f9];return _0x1f675d;};'use strict';var client=require('../client');exports[_0xffa3('0x0')]=function(){return function(){return client[_0xffa3('0x1')](_0xffa3('0x2'),{'options':{'raw':![],'attributes':['id',_0xffa3('0x3'),_0xffa3('0x4'),_0xffa3('0x5')],'include':[{'model':_0xffa3('0x6'),'as':'Agents','attributes':['id',_0xffa3('0x3'),'online',_0xffa3('0x7')]}]},'log':_0xffa3('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 13aa9f7..05b6174 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 _0x8dab=['CreateFaxQueueReport','UpdateFaxQueueReport','DESC','../client','create','Request'];(function(_0x59f493,_0x3e4b04){var _0x6786c5=function(_0x10e5ef){while(--_0x10e5ef){_0x59f493['push'](_0x59f493['shift']());}};_0x6786c5(++_0x3e4b04);}(_0x8dab,0x1d7));var _0xb8da=function(_0x15f658,_0x123f17){_0x15f658=_0x15f658-0x0;var _0x5a5cfa=_0x8dab[_0x15f658];return _0x5a5cfa;};'use strict';var client=require(_0xb8da('0x0'));exports[_0xb8da('0x1')]=function(_0x5149ae){return client[_0xb8da('0x2')](_0xb8da('0x3'),{'body':_0x5149ae,'log':_0xb8da('0x3')});};exports['update']=function(_0x43f441,_0x3cced6){return client[_0xb8da('0x2')](_0xb8da('0x4'),{'body':_0x3cced6,'options':{'where':{'uniqueid':_0x43f441},'order':[['id',_0xb8da('0x5')]],'limit':0x1},'log':_0xb8da('0x4')});}; \ No newline at end of file +var _0x1db3=['UpdateFaxQueueReport','Request','CreateFaxQueueReport','update'];(function(_0x4f3242,_0x391954){var _0x49844f=function(_0x5ee033){while(--_0x5ee033){_0x4f3242['push'](_0x4f3242['shift']());}};_0x49844f(++_0x391954);}(_0x1db3,0xfd));var _0x31db=function(_0x6e5668,_0x34508d){_0x6e5668=_0x6e5668-0x0;var _0x3eb1ef=_0x1db3[_0x6e5668];return _0x3eb1ef;};'use strict';var client=require('../client');exports['create']=function(_0x3e723b){return client[_0x31db('0x0')](_0x31db('0x1'),{'body':_0x3e723b,'log':_0x31db('0x1')});};exports[_0x31db('0x2')]=function(_0x1ea2dd,_0xe07c9e){return client[_0x31db('0x0')](_0x31db('0x3'),{'body':_0xe07c9e,'options':{'where':{'uniqueid':_0x1ea2dd},'order':[['id','DESC']],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index d4145c8..d987287 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 _0x4e4a=['Intervals','getIntervals','../client','Request','GetInterval','name'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4e4a,0xe0));var _0xa4e4=function(_0x5b39f2,_0x2f7a2e){_0x5b39f2=_0x5b39f2-0x0;var _0x5b7cb8=_0x4e4a[_0x5b39f2];return _0x5b7cb8;};'use strict';var client=require(_0xa4e4('0x0'));exports['getIntervals']=function(){return function(){return client[_0xa4e4('0x1')](_0xa4e4('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0xa4e4('0x3')],'include':[{'model':'Interval','as':_0xa4e4('0x4'),'attributes':['id','name','interval']}]},'log':_0xa4e4('0x5')});};}; \ No newline at end of file +var _0x2c77=['getIntervals','Request','GetInterval','Interval','name','interval','../client'];(function(_0x3301c2,_0x3f8369){var _0x1da11f=function(_0x19220d){while(--_0x19220d){_0x3301c2['push'](_0x3301c2['shift']());}};_0x1da11f(++_0x3f8369);}(_0x2c77,0x1b8));var _0x72c7=function(_0x2d00fc,_0x5537d6){_0x2d00fc=_0x2d00fc-0x0;var _0x56d549=_0x2c77[_0x2d00fc];return _0x56d549;};'use strict';var client=require(_0x72c7('0x0'));exports[_0x72c7('0x1')]=function(){return function(){return client[_0x72c7('0x2')](_0x72c7('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x72c7('0x4'),'as':'Intervals','attributes':['id',_0x72c7('0x5'),_0x72c7('0x6')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 723ca9a..ed1cc1b 100644 --- a/server/services/routing/rpc/mailInteraction.js +++ b/server/services/routing/rpc/mailInteraction.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x272638,_0x42b993){var _0x19d027=function(_0x27ac44){while(--_0x27ac44){_0x272638['push'](_0x272638['shift']());}};_0x19d027(++_0x42b993);}(_0x7880,0x1f4));var _0x0788=function(_0x3a7e01,_0x51204c){_0x3a7e01=_0x3a7e01-0x0;var _0x5b8398=_0x7880[_0x3a7e01];return _0x5b8398;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});}; \ No newline at end of file +var _0x5430=['Request','UpdateMailInteraction','AddTagsToMailInteraction','addTagsToChatInteraction','../client','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5430,0x10c));var _0x0543=function(_0x574207,_0x43402c){_0x574207=_0x574207-0x0;var _0x5a3f16=_0x5430[_0x574207];return _0x5a3f16;};'use strict';var client=require(_0x0543('0x0'));exports[_0x0543('0x1')]=function(_0xa1b1a7,_0x4078bf){return client[_0x0543('0x2')](_0x0543('0x3'),{'body':_0x4078bf,'options':{'where':{'id':_0xa1b1a7}},'log':'updateMailInteraction'});};exports['addTags']=function(_0x1c5ab7,_0x4ee416){return client['Request'](_0x0543('0x4'),{'body':_0x4ee416,'options':{'where':{'id':_0x1c5ab7}},'log':_0x0543('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index ad33666..23c6367 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 _0x4775=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x11e085,_0x267185){var _0x22c9db=function(_0x25407a){while(--_0x25407a){_0x11e085['push'](_0x11e085['shift']());}};_0x22c9db(++_0x267185);}(_0x4775,0xce));var _0x5477=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x4775[_0x280f4a];return _0x1bb157;};'use strict';var client=require(_0x5477('0x0'));exports[_0x5477('0x1')]=function(_0x3d7c31){return client[_0x5477('0x2')](_0x5477('0x3'),{'body':_0x3d7c31,'log':_0x5477('0x4')});}; \ No newline at end of file +var _0xc522=['CreateMailMessage','createMailMessage','../client','create','Request'];(function(_0x1f0eb8,_0x1f68be){var _0x26a96d=function(_0x1c00fd){while(--_0x1c00fd){_0x1f0eb8['push'](_0x1f0eb8['shift']());}};_0x26a96d(++_0x1f68be);}(_0xc522,0x174));var _0x2c52=function(_0x4b38ed,_0x259d83){_0x4b38ed=_0x4b38ed-0x0;var _0x2332f2=_0xc522[_0x4b38ed];return _0x2332f2;};'use strict';var client=require(_0x2c52('0x0'));exports[_0x2c52('0x1')]=function(_0x2ca514){return client[_0x2c52('0x2')](_0x2c52('0x3'),{'body':_0x2ca514,'log':_0x2c52('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 80fa4c8..d7f85b9 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 _0x95da=['name','strategy','Agents','online','mailPause','../client','getMailQueues','GetMailQueue'];(function(_0x113a1a,_0x22a2c9){var _0x14d16e=function(_0x150dbd){while(--_0x150dbd){_0x113a1a['push'](_0x113a1a['shift']());}};_0x14d16e(++_0x22a2c9);}(_0x95da,0xb5));var _0xa95d=function(_0x2f8014,_0x2620a3){_0x2f8014=_0x2f8014-0x0;var _0x32d852=_0x95da[_0x2f8014];return _0x32d852;};'use strict';var client=require(_0xa95d('0x0'));exports[_0xa95d('0x1')]=function(){return function(){return client['Request'](_0xa95d('0x2'),{'options':{'raw':![],'attributes':['id',_0xa95d('0x3'),'timeout',_0xa95d('0x4')],'include':[{'model':'User','as':_0xa95d('0x5'),'attributes':['id',_0xa95d('0x3'),_0xa95d('0x6'),_0xa95d('0x7')]}]},'log':_0xa95d('0x1')});};}; \ No newline at end of file +var _0xb3d7=['timeout','strategy','User','Agents','name','online','mailPause','../client','getMailQueues','Request','GetMailQueue'];(function(_0x400705,_0x19ab6b){var _0x447d9d=function(_0x509b9f){while(--_0x509b9f){_0x400705['push'](_0x400705['shift']());}};_0x447d9d(++_0x19ab6b);}(_0xb3d7,0xf9));var _0x7b3d=function(_0x5b60ab,_0x2d33df){_0x5b60ab=_0x5b60ab-0x0;var _0x36ed23=_0xb3d7[_0x5b60ab];return _0x36ed23;};'use strict';var client=require(_0x7b3d('0x0'));exports[_0x7b3d('0x1')]=function(){return function(){return client[_0x7b3d('0x2')](_0x7b3d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7b3d('0x4'),_0x7b3d('0x5')],'include':[{'model':_0x7b3d('0x6'),'as':_0x7b3d('0x7'),'attributes':['id',_0x7b3d('0x8'),_0x7b3d('0x9'),_0x7b3d('0xa')]}]},'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 4003a9e..a9af4bd 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 _0x3426=['create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC','../client'];(function(_0x4e8577,_0x3a4f86){var _0x44e57e=function(_0xb9d5eb){while(--_0xb9d5eb){_0x4e8577['push'](_0x4e8577['shift']());}};_0x44e57e(++_0x3a4f86);}(_0x3426,0x187));var _0x6342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3426[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x6342('0x0'));exports[_0x6342('0x1')]=function(_0x3e160f){return client[_0x6342('0x2')](_0x6342('0x3'),{'body':_0x3e160f,'log':'CreateMailQueueReport'});};exports[_0x6342('0x4')]=function(_0xbae736,_0x1580da){return client[_0x6342('0x2')](_0x6342('0x5'),{'body':_0x1580da,'options':{'where':{'uniqueid':_0xbae736},'order':[['id',_0x6342('0x6')]],'limit':0x1},'log':_0x6342('0x5')});}; \ No newline at end of file +var _0xc141=['DESC','UpdateMailQueueReport','../client','create','Request','CreateMailQueueReport','update'];(function(_0x40ccb3,_0x1586ac){var _0x2ba4a9=function(_0x2e1465){while(--_0x2e1465){_0x40ccb3['push'](_0x40ccb3['shift']());}};_0x2ba4a9(++_0x1586ac);}(_0xc141,0xaa));var _0x1c14=function(_0x433d0a,_0x348f5b){_0x433d0a=_0x433d0a-0x0;var _0x883e8e=_0xc141[_0x433d0a];return _0x883e8e;};'use strict';var client=require(_0x1c14('0x0'));exports[_0x1c14('0x1')]=function(_0x451e53){return client[_0x1c14('0x2')](_0x1c14('0x3'),{'body':_0x451e53,'log':_0x1c14('0x3')});};exports[_0x1c14('0x4')]=function(_0x3de720,_0x329212){return client[_0x1c14('0x2')]('UpdateMailQueueReport',{'body':_0x329212,'options':{'where':{'uniqueid':_0x3de720},'order':[['id',_0x1c14('0x5')]],'limit':0x1},'log':_0x1c14('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 64b84f3..2ab7122 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 _0x589d=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x27d41c,_0xcb6cde){var _0x4802d9=function(_0x50b805){while(--_0x50b805){_0x27d41c['push'](_0x27d41c['shift']());}};_0x4802d9(++_0xcb6cde);}(_0x589d,0x1ec));var _0xd589=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x589d[_0x57b54c];return _0x59cc19;};'use strict';var client=require('../client');exports[_0xd589('0x0')]=function(_0x3fc18a,_0x42b4b5){return client[_0xd589('0x1')](_0xd589('0x2'),{'body':_0x42b4b5,'options':{'where':{'id':_0x3fc18a}},'log':_0xd589('0x3')});};exports[_0xd589('0x4')]=function(_0x3213c6,_0x546294){return client[_0xd589('0x1')](_0xd589('0x5'),{'body':_0x546294,'options':{'where':{'id':_0x3213c6}},'log':_0xd589('0x6')});}; \ No newline at end of file +var _0x1661=['updateOpenchannelInteraction','addTagsToChatInteraction','../client','update','Request'];(function(_0x4ff0ee,_0x26a3e8){var _0x54b6e9=function(_0x4775f0){while(--_0x4775f0){_0x4ff0ee['push'](_0x4ff0ee['shift']());}};_0x54b6e9(++_0x26a3e8);}(_0x1661,0x188));var _0x1166=function(_0x366abc,_0x2dd460){_0x366abc=_0x366abc-0x0;var _0x5e1bac=_0x1661[_0x366abc];return _0x5e1bac;};'use strict';var client=require(_0x1166('0x0'));exports[_0x1166('0x1')]=function(_0x1a4304,_0x233256){return client[_0x1166('0x2')]('UpdateOpenchannelInteraction',{'body':_0x233256,'options':{'where':{'id':_0x1a4304}},'log':_0x1166('0x3')});};exports['addTags']=function(_0x4d494a,_0x3a6047){return client[_0x1166('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x3a6047,'options':{'where':{'id':_0x4d494a}},'log':_0x1166('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index cbc0fb6..2cbbf82 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 _0xbbb8=['../client','create','Request','createOpenchannelMessage'];(function(_0x35d11f,_0x17676d){var _0x15303d=function(_0x13f8a3){while(--_0x13f8a3){_0x35d11f['push'](_0x35d11f['shift']());}};_0x15303d(++_0x17676d);}(_0xbbb8,0x128));var _0x8bbb=function(_0x2a1395,_0x222c74){_0x2a1395=_0x2a1395-0x0;var _0x92f5f8=_0xbbb8[_0x2a1395];return _0x92f5f8;};'use strict';var client=require(_0x8bbb('0x0'));exports[_0x8bbb('0x1')]=function(_0x39aa2c){return client[_0x8bbb('0x2')]('CreateOpenchannelMessage',{'body':_0x39aa2c,'log':_0x8bbb('0x3')});}; \ No newline at end of file +var _0xfadf=['create','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x45c889,_0x5ccd43){var _0x19b8ba=function(_0x483270){while(--_0x483270){_0x45c889['push'](_0x45c889['shift']());}};_0x19b8ba(++_0x5ccd43);}(_0xfadf,0x78));var _0xffad=function(_0x4c8eed,_0x51f7ce){_0x4c8eed=_0x4c8eed-0x0;var _0x3990ec=_0xfadf[_0x4c8eed];return _0x3990ec;};'use strict';var client=require('../client');exports[_0xffad('0x0')]=function(_0x2db4ba){return client['Request'](_0xffad('0x1'),{'body':_0x2db4ba,'log':_0xffad('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index a01fbaf..ec5fd75 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 _0x0183=['Request','GetOpenchannelQueue','name','timeout','User','Agents','openchannelPause','getOpenchannelQueues'];(function(_0x4ba105,_0xf97073){var _0x5eee7b=function(_0x242611){while(--_0x242611){_0x4ba105['push'](_0x4ba105['shift']());}};_0x5eee7b(++_0xf97073);}(_0x0183,0x1ef));var _0x3018=function(_0x4902a3,_0x418aac){_0x4902a3=_0x4902a3-0x0;var _0x52ff3b=_0x0183[_0x4902a3];return _0x52ff3b;};'use strict';var client=require('../client');exports[_0x3018('0x0')]=function(){return function(){return client[_0x3018('0x1')](_0x3018('0x2'),{'options':{'raw':![],'attributes':['id',_0x3018('0x3'),_0x3018('0x4'),'strategy'],'include':[{'model':_0x3018('0x5'),'as':_0x3018('0x6'),'attributes':['id',_0x3018('0x3'),'online',_0x3018('0x7')]}]},'log':_0x3018('0x0')});};}; \ No newline at end of file +var _0x95ee=['GetOpenchannelQueue','name','timeout','User','online','../client','getOpenchannelQueues','Request'];(function(_0x236000,_0x5f163c){var _0x2478fc=function(_0x5697e8){while(--_0x5697e8){_0x236000['push'](_0x236000['shift']());}};_0x2478fc(++_0x5f163c);}(_0x95ee,0x7d));var _0xe95e=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0x95ee[_0x263a74];return _0x2aa86c;};'use strict';var client=require(_0xe95e('0x0'));exports[_0xe95e('0x1')]=function(){return function(){return client[_0xe95e('0x2')](_0xe95e('0x3'),{'options':{'raw':![],'attributes':['id',_0xe95e('0x4'),_0xe95e('0x5'),'strategy'],'include':[{'model':_0xe95e('0x6'),'as':'Agents','attributes':['id',_0xe95e('0x4'),_0xe95e('0x7'),'openchannelPause']}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 659bb9d..815b26e 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 _0xc8b6=['update','UpdateOpenchannelQueueReport','DESC','create','Request','CreateOpenchannelQueueReport'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc8b6,0xed));var _0x6c8b=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xc8b6[_0x5b561d];return _0x431060;};'use strict';var client=require('../client');exports[_0x6c8b('0x0')]=function(_0x400c06){return client[_0x6c8b('0x1')](_0x6c8b('0x2'),{'body':_0x400c06,'log':_0x6c8b('0x2')});};exports[_0x6c8b('0x3')]=function(_0x1937af,_0x55ba28){return client['Request'](_0x6c8b('0x4'),{'body':_0x55ba28,'options':{'where':{'uniqueid':_0x1937af},'order':[['id',_0x6c8b('0x5')]],'limit':0x1},'log':_0x6c8b('0x4')});}; \ No newline at end of file +var _0x467f=['update','UpdateOpenchannelQueueReport','create','Request'];(function(_0x7729b1,_0x468322){var _0x349504=function(_0x401cee){while(--_0x401cee){_0x7729b1['push'](_0x7729b1['shift']());}};_0x349504(++_0x468322);}(_0x467f,0x7a));var _0xf467=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x467f[_0x413feb];return _0x40ee88;};'use strict';var client=require('../client');exports[_0xf467('0x0')]=function(_0x201c06){return client[_0xf467('0x1')]('CreateOpenchannelQueueReport',{'body':_0x201c06,'log':'CreateOpenchannelQueueReport'});};exports[_0xf467('0x2')]=function(_0x43ac80,_0x5b2750){return client[_0xf467('0x1')](_0xf467('0x3'),{'body':_0x5b2750,'options':{'where':{'uniqueid':_0x43ac80},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 41c0c8b..92bf399 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 _0x795a=['update','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction'];(function(_0x319469,_0x2c6432){var _0xaa23e1=function(_0x52936d){while(--_0x52936d){_0x319469['push'](_0x319469['shift']());}};_0xaa23e1(++_0x2c6432);}(_0x795a,0xa2));var _0xa795=function(_0x1127cf,_0xb8c670){_0x1127cf=_0x1127cf-0x0;var _0x1493de=_0x795a[_0x1127cf];return _0x1493de;};'use strict';var client=require('../client');exports[_0xa795('0x0')]=function(_0x17afed,_0x4b93be){return client[_0xa795('0x1')]('UpdateSmsInteraction',{'body':_0x4b93be,'options':{'where':{'id':_0x17afed}},'log':_0xa795('0x2')});};exports[_0xa795('0x3')]=function(_0x4ce3a0,_0x4f7e4e){return client[_0xa795('0x1')](_0xa795('0x4'),{'body':_0x4f7e4e,'options':{'where':{'id':_0x4ce3a0}},'log':_0xa795('0x5')});}; \ No newline at end of file +var _0xc9f5=['AddTagsToSmsInteraction','update','Request','UpdateSmsInteraction','updateSmsInteraction'];(function(_0x2983e1,_0x3356d9){var _0x442f71=function(_0x5e81d3){while(--_0x5e81d3){_0x2983e1['push'](_0x2983e1['shift']());}};_0x442f71(++_0x3356d9);}(_0xc9f5,0xc4));var _0x5c9f=function(_0x8dc04d,_0xaa7559){_0x8dc04d=_0x8dc04d-0x0;var _0x2f5f28=_0xc9f5[_0x8dc04d];return _0x2f5f28;};'use strict';var client=require('../client');exports[_0x5c9f('0x0')]=function(_0x3bae7f,_0x52597d){return client[_0x5c9f('0x1')](_0x5c9f('0x2'),{'body':_0x52597d,'options':{'where':{'id':_0x3bae7f}},'log':_0x5c9f('0x3')});};exports['addTags']=function(_0x4a046a,_0x1af905){return client['Request'](_0x5c9f('0x4'),{'body':_0x1af905,'options':{'where':{'id':_0x4a046a}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index bc3b3de..db596fa 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 _0x4f4c=['../client','create','Request','CreateSmsMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4f4c,0x128));var _0xc4f4=function(_0x1e7058,_0x5d0635){_0x1e7058=_0x1e7058-0x0;var _0x546986=_0x4f4c[_0x1e7058];return _0x546986;};'use strict';var client=require(_0xc4f4('0x0'));exports[_0xc4f4('0x1')]=function(_0x4c6685){return client[_0xc4f4('0x2')](_0xc4f4('0x3'),{'body':_0x4c6685,'log':'createSmsMessage'});}; \ No newline at end of file +var _0x1036=['CreateSmsMessage','../client','create'];(function(_0xd0a847,_0x72562b){var _0x2536ec=function(_0x20e4db){while(--_0x20e4db){_0xd0a847['push'](_0xd0a847['shift']());}};_0x2536ec(++_0x72562b);}(_0x1036,0x115));var _0x6103=function(_0x22fa31,_0x57b4a7){_0x22fa31=_0x22fa31-0x0;var _0x22721a=_0x1036[_0x22fa31];return _0x22721a;};'use strict';var client=require(_0x6103('0x0'));exports[_0x6103('0x1')]=function(_0x10f74d){return client['Request'](_0x6103('0x2'),{'body':_0x10f74d,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d88cc66..e5a807f 100644 --- a/server/services/routing/rpc/smsQueue.js +++ b/server/services/routing/rpc/smsQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['Agents','online','smsPause','../client','getSmsQueues','Request','name','timeout','strategy','User'];(function(_0x4e44b0,_0x296924){var _0x269d04=function(_0x1f82c6){while(--_0x1f82c6){_0x4e44b0['push'](_0x4e44b0['shift']());}};_0x269d04(++_0x296924);}(_0xe706,0xa3));var _0x6e70=function(_0x2f16e5,_0x2e75e0){_0x2f16e5=_0x2f16e5-0x0;var _0x5d082a=_0xe706[_0x2f16e5];return _0x5d082a;};'use strict';var client=require(_0x6e70('0x0'));exports[_0x6e70('0x1')]=function(){return function(){return client[_0x6e70('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6e70('0x3'),_0x6e70('0x4'),_0x6e70('0x5')],'include':[{'model':_0x6e70('0x6'),'as':_0x6e70('0x7'),'attributes':['id',_0x6e70('0x3'),_0x6e70('0x8'),_0x6e70('0x9')]}]},'log':_0x6e70('0x1')});};}; \ No newline at end of file +var _0x0713=['getSmsQueues','Request','GetSmsQueue','name','timeout','strategy','Agents','online','smsPause'];(function(_0x549fb4,_0x57140c){var _0xc64c37=function(_0x40e702){while(--_0x40e702){_0x549fb4['push'](_0x549fb4['shift']());}};_0xc64c37(++_0x57140c);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getSmsQueues']=function(){return function(){return client[_0x3071('0x0')](_0x3071('0x1'),{'options':{'raw':![],'attributes':['id',_0x3071('0x2'),_0x3071('0x3'),_0x3071('0x4')],'include':[{'model':'User','as':_0x3071('0x5'),'attributes':['id',_0x3071('0x2'),_0x3071('0x6'),_0x3071('0x7')]}]},'log':_0x3071('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index f408906..e76112b 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(_0x4705a2,_0x1f7ef3){var _0x308465=function(_0x29ce0d){while(--_0x29ce0d){_0x4705a2['push'](_0x4705a2['shift']());}};_0x308465(++_0x1f7ef3);}(_0x3e74,0x175));var _0x43e7=function(_0x1f97a1,_0x5c7c53){_0x1f97a1=_0x1f97a1-0x0;var _0x4b21f4=_0x3e74[_0x1f97a1];return _0x4b21f4;};'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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x352511,_0xa85a4e){var _0x8ed9d2=function(_0x510e16){while(--_0x510e16){_0x352511['push'](_0x352511['shift']());}};_0x8ed9d2(++_0xa85a4e);}(_0x9c44,0x178));var _0x49c4=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x9c44[_0x167cc1];return _0x10bc4b;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index f301001..d856004 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(_0x2c3fbe,_0x1dbdcf){var _0x5e0945=function(_0xd81c58){while(--_0xd81c58){_0x2c3fbe['push'](_0x2c3fbe['shift']());}};_0x5e0945(++_0x1dbdcf);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'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(_0x573cb8,_0x71c6b4){var _0x1beb47=function(_0x52ad68){while(--_0x52ad68){_0x573cb8['push'](_0x573cb8['shift']());}};_0x1beb47(++_0x71c6b4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'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 2ced710..a67231c 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 _0x6132=['addTags','Request','../client','update','UpdateWhatsappInteraction','updateWhatsappInteraction'];(function(_0x418980,_0x397796){var _0x510a02=function(_0x37b26e){while(--_0x37b26e){_0x418980['push'](_0x418980['shift']());}};_0x510a02(++_0x397796);}(_0x6132,0x13a));var _0x2613=function(_0x30ee14,_0x420d98){_0x30ee14=_0x30ee14-0x0;var _0x1fe34a=_0x6132[_0x30ee14];return _0x1fe34a;};'use strict';var client=require(_0x2613('0x0'));exports[_0x2613('0x1')]=function(_0x327ec2,_0x3fcd41){return client['Request'](_0x2613('0x2'),{'body':_0x3fcd41,'options':{'where':{'id':_0x327ec2}},'log':_0x2613('0x3')});};exports[_0x2613('0x4')]=function(_0x35c979,_0x555746){return client[_0x2613('0x5')]('AddTagsToWhatsappInteraction',{'body':_0x555746,'options':{'where':{'id':_0x35c979}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0x6931=['addTagsToWhatsappInteraction','../client','update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction'];(function(_0x231544,_0x592bab){var _0x3a96df=function(_0x542502){while(--_0x542502){_0x231544['push'](_0x231544['shift']());}};_0x3a96df(++_0x592bab);}(_0x6931,0x1a9));var _0x1693=function(_0xf5352b,_0x1aadec){_0xf5352b=_0xf5352b-0x0;var _0x572004=_0x6931[_0xf5352b];return _0x572004;};'use strict';var client=require(_0x1693('0x0'));exports[_0x1693('0x1')]=function(_0x321d58,_0x773026){return client[_0x1693('0x2')](_0x1693('0x3'),{'body':_0x773026,'options':{'where':{'id':_0x321d58}},'log':_0x1693('0x4')});};exports[_0x1693('0x5')]=function(_0x59d148,_0x19ff1c){return client[_0x1693('0x2')](_0x1693('0x6'),{'body':_0x19ff1c,'options':{'where':{'id':_0x59d148}},'log':_0x1693('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 351274b..5e667d3 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 _0xe1d4=['../client','create','Request','CreateWhatsappMessage'];(function(_0x1faaa1,_0x1568dd){var _0x994ec=function(_0x298ef4){while(--_0x298ef4){_0x1faaa1['push'](_0x1faaa1['shift']());}};_0x994ec(++_0x1568dd);}(_0xe1d4,0x7c));var _0x4e1d=function(_0x4012d6,_0x3dc801){_0x4012d6=_0x4012d6-0x0;var _0xc7c18b=_0xe1d4[_0x4012d6];return _0xc7c18b;};'use strict';var client=require(_0x4e1d('0x0'));exports[_0x4e1d('0x1')]=function(_0x43d9b2){return client[_0x4e1d('0x2')](_0x4e1d('0x3'),{'body':_0x43d9b2,'log':'createWhatsappMessage'});}; \ No newline at end of file +var _0x31e4=['CreateWhatsappMessage','../client','create','Request'];(function(_0x8f4b0a,_0x23549d){var _0x2238b7=function(_0x6952d8){while(--_0x6952d8){_0x8f4b0a['push'](_0x8f4b0a['shift']());}};_0x2238b7(++_0x23549d);}(_0x31e4,0x75));var _0x431e=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x31e4[_0x2dc96f];return _0xd012da;};'use strict';var client=require(_0x431e('0x0'));exports[_0x431e('0x1')]=function(_0x15d0b9){return client[_0x431e('0x2')](_0x431e('0x3'),{'body':_0x15d0b9,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index b693cbd..1af2d7b 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 _0x4769=['../client','getWhatsappQueues','Request','strategy','User','Agents','whatsappPause'];(function(_0x5b6cf1,_0x32fdcd){var _0x46278c=function(_0x53fd9b){while(--_0x53fd9b){_0x5b6cf1['push'](_0x5b6cf1['shift']());}};_0x46278c(++_0x32fdcd);}(_0x4769,0x1ea));var _0x9476=function(_0x5bd738,_0x1902be){_0x5bd738=_0x5bd738-0x0;var _0x313675=_0x4769[_0x5bd738];return _0x313675;};'use strict';var client=require(_0x9476('0x0'));exports[_0x9476('0x1')]=function(){return function(){return client[_0x9476('0x2')]('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x9476('0x3')],'include':[{'model':_0x9476('0x4'),'as':_0x9476('0x5'),'attributes':['id','name','online',_0x9476('0x6')]}]},'log':_0x9476('0x1')});};}; \ No newline at end of file +var _0x4204=['whatsappPause','getWhatsappQueues','Request','GetWhatsappQueue','name','timeout','strategy','User','Agents','online'];(function(_0x37c8b7,_0x407028){var _0x156703=function(_0x3b3259){while(--_0x3b3259){_0x37c8b7['push'](_0x37c8b7['shift']());}};_0x156703(++_0x407028);}(_0x4204,0xa1));var _0x4420=function(_0x120376,_0x571898){_0x120376=_0x120376-0x0;var _0x28c529=_0x4204[_0x120376];return _0x28c529;};'use strict';var client=require('../client');exports[_0x4420('0x0')]=function(){return function(){return client[_0x4420('0x1')](_0x4420('0x2'),{'options':{'raw':![],'attributes':['id',_0x4420('0x3'),_0x4420('0x4'),_0x4420('0x5')],'include':[{'model':_0x4420('0x6'),'as':_0x4420('0x7'),'attributes':['id','name',_0x4420('0x8'),_0x4420('0x9')]}]},'log':_0x4420('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index 610728c..e0de8ea 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 _0x4535=['create','Request','CreateWhatsappQueueReport','update','UpdateWhatsappQueueReport','DESC','../client'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x4535,0x14f));var _0x5453=function(_0x55f2a3,_0x13459a){_0x55f2a3=_0x55f2a3-0x0;var _0x31fd69=_0x4535[_0x55f2a3];return _0x31fd69;};'use strict';var client=require(_0x5453('0x0'));exports[_0x5453('0x1')]=function(_0xbee714){return client[_0x5453('0x2')](_0x5453('0x3'),{'body':_0xbee714,'log':_0x5453('0x3')});};exports[_0x5453('0x4')]=function(_0x581608,_0x5bc6ab){return client[_0x5453('0x2')](_0x5453('0x5'),{'body':_0x5bc6ab,'options':{'where':{'uniqueid':_0x581608},'order':[['id',_0x5453('0x6')]],'limit':0x1},'log':_0x5453('0x5')});}; \ No newline at end of file +var _0xfaf9=['UpdateWhatsappQueueReport','DESC','../client','create','Request','CreateWhatsappQueueReport','update'];(function(_0x2d8c20,_0x507416){var _0x51502e=function(_0x163639){while(--_0x163639){_0x2d8c20['push'](_0x2d8c20['shift']());}};_0x51502e(++_0x507416);}(_0xfaf9,0xf7));var _0x9faf=function(_0xf50820,_0x56f041){_0xf50820=_0xf50820-0x0;var _0x2a9b10=_0xfaf9[_0xf50820];return _0x2a9b10;};'use strict';var client=require(_0x9faf('0x0'));exports[_0x9faf('0x1')]=function(_0xe47712){return client[_0x9faf('0x2')]('CreateWhatsappQueueReport',{'body':_0xe47712,'log':_0x9faf('0x3')});};exports[_0x9faf('0x4')]=function(_0x3b5e51,_0x1d8408){return client[_0x9faf('0x2')](_0x9faf('0x5'),{'body':_0x1d8408,'options':{'where':{'uniqueid':_0x3b5e51},'order':[['id',_0x9faf('0x6')]],'limit':0x1},'log':_0x9faf('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index bbd0dae..dbe7fe2 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 _0x2808=['timeout','createQueue','atimeout','channel','rules','close','stop','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','../../../../config/logger','./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','error','[%s][AGENT]\x20%s','map','message','join'];(function(_0x148647,_0x3b4ea3){var _0x58a7e2=function(_0x2d57eb){while(--_0x2d57eb){_0x148647['push'](_0x148647['shift']());}};_0x58a7e2(++_0x3b4ea3);}(_0x2808,0x16c));var _0x8280=function(_0x33daef,_0x1950b1){_0x33daef=_0x33daef-0x0;var _0x577188=_0x2808[_0x33daef];return _0x577188;};'use strict';var schema=require(_0x8280('0x0'));var _=require(_0x8280('0x1'));var util=require(_0x8280('0x2'));var seqqueue=require(_0x8280('0x3'));var logger=require(_0x8280('0x4'))('routing');var strategy=require(_0x8280('0x5'));var queue=schema({'name':{'type':_0x8280('0x6'),'required':!![],'message':_0x8280('0x7')},'timeout':{'type':_0x8280('0x8'),'message':_0x8280('0x9')}});function writeLog(_0x498833,_0x10e766,_0x55c8e0){return logger[_0x8280('0xa')](util[_0x8280('0xb')](_0x8280('0xc'),_0x498833,_0x10e766[_0x8280('0xd')],_0x55c8e0));}function handleFindAgent(_0x72a8c8){return function(_0x4016bd){return _0x4016bd[_0x8280('0xd')]['toLowerCase']()===_0x72a8c8[_0x8280('0xe')]();};}exports[_0x8280('0xf')]=function(_0x365d65,_0x41fb08,_0x12b05f,_0x34ee5f){return function(_0x421e14){try{var _0x3185f1={'name':_0x41fb08[0x0],'timeout':_0x41fb08[0x1]};var _0x15c490=queue[_0x8280('0x0')](_0x3185f1,{'typecast':!![]});if(_0x15c490['length']){logger[_0x8280('0x10')](_0x8280('0x11'),_0x365d65,_[_0x8280('0x12')](_0x15c490,_0x8280('0x13'))[_0x8280('0x14')](',\x20'));_0x421e14['stop']();}else{var _0x24c4a9=_['find'](_0x12b05f['agents'],handleFindAgent(_0x3185f1[_0x8280('0xd')]));if(_0x24c4a9){var _0x5a7779=(_0x3185f1[_0x8280('0x15')]||0xa)*0x3e8;var _0x458531,_0x3395ab;var _0x428df4=seqqueue[_0x8280('0x16')](_0x5a7779);_0x428df4['id']=_0x365d65;_0x428df4[_0x8280('0x17')]=_0x5a7779;_0x428df4[_0x8280('0x18')]=_0x34ee5f[_0x8280('0x18')];writeLog(_0x365d65,_0x24c4a9,util[_0x8280('0xb')]('START:%s',_0x5a7779));_0x12b05f[_0x8280('0x19')][_0x365d65]['on']('end',function(){logger[_0x8280('0xa')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x365d65);clearTimeout(_0x3395ab);_0x3395ab=undefined;_0x428df4[_0x8280('0x1a')]();if(_0x12b05f[_0x8280('0x19')][_0x365d65]){delete _0x12b05f[_0x8280('0x19')][_0x365d65];}_0x421e14[_0x8280('0x1b')]();});_0x12b05f[_0x8280('0x19')][_0x365d65]['on'](_0x8280('0x1c'),function(){if(_0x12b05f[_0x8280('0x19')][_0x365d65]){delete _0x12b05f['rules'][_0x365d65];}});_0x3395ab=setTimeout(function(){logger[_0x8280('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x365d65);clearTimeout(_0x3395ab);_0x428df4[_0x8280('0x1a')]();_0x421e14[_0x8280('0x1d')]();},_0x5a7779);strategy[_0x8280('0x1e')](_0x428df4,_0x24c4a9,_0x12b05f,_0x34ee5f);}else{logger['error'](_0x8280('0x1f'),_0x365d65,_0x3185f1['name']);_0x421e14[_0x8280('0x1b')]();}}}catch(_0x1ae998){console[_0x8280('0x20')](_0x1ae998);logger[_0x8280('0x10')](_0x8280('0x21'),_0x365d65,_0x1ae998[_0x8280('0x22')]);_0x421e14[_0x8280('0x1b')]();}};}; \ No newline at end of file +var _0x6d3d=['close','rules','complete','[%s][AGENT]\x20ROUTING\x20END','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','lodash','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','validate','length','error','[%s][AGENT]\x20%s','map','message','join','stop','agents','timeout','createQueue','atimeout','START:%s','end','[%s][AGENT]\x20ROUTING\x20STOPPED'];(function(_0xbe4d7b,_0x1923b1){var _0x337a65=function(_0x4a8a26){while(--_0x4a8a26){_0xbe4d7b['push'](_0xbe4d7b['shift']());}};_0x337a65(++_0x1923b1);}(_0x6d3d,0x183));var _0xd6d3=function(_0x3b8b2a,_0x43d211){_0x3b8b2a=_0x3b8b2a-0x0;var _0x3e64a3=_0x6d3d[_0x3b8b2a];return _0x3e64a3;};'use strict';var schema=require('validate');var _=require(_0xd6d3('0x0'));var util=require(_0xd6d3('0x1'));var seqqueue=require(_0xd6d3('0x2'));var logger=require(_0xd6d3('0x3'))(_0xd6d3('0x4'));var strategy=require(_0xd6d3('0x5'));var queue=schema({'name':{'type':_0xd6d3('0x6'),'required':!![],'message':_0xd6d3('0x7')},'timeout':{'type':_0xd6d3('0x8'),'message':_0xd6d3('0x9')}});function writeLog(_0x107707,_0xf0c025,_0x48bca3){return logger[_0xd6d3('0xa')](util[_0xd6d3('0xb')](_0xd6d3('0xc'),_0x107707,_0xf0c025[_0xd6d3('0xd')],_0x48bca3));}function handleFindAgent(_0x4d89fb){return function(_0x50567e){return _0x50567e[_0xd6d3('0xd')][_0xd6d3('0xe')]()===_0x4d89fb[_0xd6d3('0xe')]();};}exports[_0xd6d3('0xf')]=function(_0x4e9409,_0x4e4783,_0x569a9f,_0x49a84c){return function(_0x16cf8b){try{var _0x2183a1={'name':_0x4e4783[0x0],'timeout':_0x4e4783[0x1]};var _0x544d92=queue[_0xd6d3('0x10')](_0x2183a1,{'typecast':!![]});if(_0x544d92[_0xd6d3('0x11')]){logger[_0xd6d3('0x12')](_0xd6d3('0x13'),_0x4e9409,_[_0xd6d3('0x14')](_0x544d92,_0xd6d3('0x15'))[_0xd6d3('0x16')](',\x20'));_0x16cf8b[_0xd6d3('0x17')]();}else{var _0x280669=_['find'](_0x569a9f[_0xd6d3('0x18')],handleFindAgent(_0x2183a1['name']));if(_0x280669){var _0x5d034e=(_0x2183a1[_0xd6d3('0x19')]||0xa)*0x3e8;var _0x2a64a3,_0x42d10f;var _0x2bd184=seqqueue[_0xd6d3('0x1a')](_0x5d034e);_0x2bd184['id']=_0x4e9409;_0x2bd184[_0xd6d3('0x1b')]=_0x5d034e;_0x2bd184['channel']=_0x49a84c['channel'];writeLog(_0x4e9409,_0x280669,util[_0xd6d3('0xb')](_0xd6d3('0x1c'),_0x5d034e));_0x569a9f['rules'][_0x4e9409]['on'](_0xd6d3('0x1d'),function(){logger[_0xd6d3('0xa')](_0xd6d3('0x1e'),_0x4e9409);clearTimeout(_0x42d10f);_0x42d10f=undefined;_0x2bd184[_0xd6d3('0x1f')]();if(_0x569a9f[_0xd6d3('0x20')][_0x4e9409]){delete _0x569a9f[_0xd6d3('0x20')][_0x4e9409];}_0x16cf8b[_0xd6d3('0x17')]();});_0x569a9f[_0xd6d3('0x20')][_0x4e9409]['on'](_0xd6d3('0x21'),function(){if(_0x569a9f['rules'][_0x4e9409]){delete _0x569a9f['rules'][_0x4e9409];}});_0x42d10f=setTimeout(function(){logger[_0xd6d3('0xa')](_0xd6d3('0x22'),_0x4e9409);clearTimeout(_0x42d10f);_0x2bd184[_0xd6d3('0x1f')]();_0x16cf8b[_0xd6d3('0x23')]();},_0x5d034e);strategy['agent'](_0x2bd184,_0x280669,_0x569a9f,_0x49a84c);}else{logger[_0xd6d3('0x12')](_0xd6d3('0x24'),_0x4e9409,_0x2183a1[_0xd6d3('0xd')]);_0x16cf8b['stop']();}}}catch(_0x145665){console['log'](_0x145665);logger[_0xd6d3('0x12')](_0xd6d3('0x25'),_0x4e9409,_0x145665['stack']);_0x16cf8b[_0xd6d3('0x17')]();}};}; \ 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 68d919d..2865e00 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 _0xd413=['Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','providerName','amazonlex','providerResponse','dialogState','Failed','moment','aws-sdk','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','isEmpty','body','getMustacheRender'];(function(_0x5e13af,_0x5461e0){var _0x3dbfa0=function(_0x44c302){while(--_0x44c302){_0x5e13af['push'](_0x5e13af['shift']());}};_0x3dbfa0(++_0x5461e0);}(_0xd413,0x14c));var _0x3d41=function(_0x3d8ca8,_0x1a9764){_0x3d8ca8=_0x3d8ca8-0x0;var _0x517e45=_0xd413[_0x3d8ca8];return _0x517e45;};'use strict';var _=require('lodash');var moment=require(_0x3d41('0x0'));var AWS=require(_0x3d41('0x1'));var utils=require('./utils');var logger=require(_0x3d41('0x2'))(_0x3d41('0x3'));var rpc={'chatMessage':require(_0x3d41('0x4')),'openchannelMessage':require(_0x3d41('0x5')),'mailMessage':require(_0x3d41('0x6')),'smsMessage':require(_0x3d41('0x7')),'faxMessage':require(_0x3d41('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0x3d41('0x9')]=function(_0x5f4171,_0x2eb3c5){return function(_0xd4de16){try{if(!_[_0x3d41('0xa')](this['interaction'][_0x3d41('0xb')])){logger[_0x3d41('0xc')](_0x3d41('0xd'),_0x5f4171,_0x3d41('0xe'));return _0xd4de16[_0x3d41('0xf')]();}var _0x4e7704={'ContactId':this[_0x3d41('0x10')]['id'],'sentAt':moment()[_0x3d41('0x11')](_0x3d41('0x12')),'direction':_0x3d41('0x13')};if(this[_0x3d41('0x14')]==='sms'||this[_0x3d41('0x14')]==='whatsapp'){_0x4e7704[_0x3d41('0x15')]=this[_0x3d41('0x16')][_0x3d41('0x15')];}var _0x119582=this['channel'];if(_0x119582===_0x3d41('0x17')){_0x4e7704[_0x3d41('0x18')]=this[_0x3d41('0x19')]['id'];}else{_0x4e7704[_['upperFirst'](_0x119582)+_0x3d41('0x1a')]=this[_0x3d41('0x19')]['id'];}_0x4e7704[_[_0x3d41('0x1b')](_0x119582)+_0x3d41('0x1c')]=this[_0x3d41('0x16')]['id'];if(this[_0x3d41('0x16')]['created']){var _0x3c5200=_0x2eb3c5[0x4];if(!_[_0x3d41('0x1d')](_0x3c5200)){_0x4e7704[_0x3d41('0x1e')]=utils[_0x3d41('0x1f')](_0x3c5200,this);return rpc[_0x119582+_0x3d41('0x20')][_0x3d41('0x21')](_0x4e7704)[_0x3d41('0x22')](function(_0x187853){logger['info'](_0x3d41('0xd'),_0x5f4171,_0x4e7704[_0x3d41('0x1e')]);})[_0x3d41('0x23')](function(_0x3fcdd2){logger[_0x3d41('0x24')](_0x3d41('0xd'),_0x5f4171,JSON[_0x3d41('0x25')](_0x3fcdd2));})[_0x3d41('0x26')](function(){logger[_0x3d41('0xc')](_0x3d41('0x27'),_0x5f4171);_0xd4de16[_0x3d41('0x28')]();});}else{logger[_0x3d41('0xc')](_0x3d41('0x29'),_0x5f4171);_0xd4de16[_0x3d41('0x28')]();}}else{var _0x25b454=this;var _0x583893=new AWS[(_0x3d41('0x2a'))]({'accessKeyId':_0x2eb3c5[0x0],'secretAccessKey':_0x2eb3c5[0x1],'region':_0x2eb3c5[0x2]});var _0x46d779={'botAlias':_0x3d41('0x2b'),'botName':_0x2eb3c5[0x3],'inputText':this[_0x3d41('0x2c')][_0x3d41('0x1e')],'userId':this[_0x3d41('0x14')]+':'+this[_0x3d41('0x16')]['id'][_0x3d41('0x2d')]()};_0x583893[_0x3d41('0x2e')](_0x46d779,function(_0xa66f48,_0x49ff92){if(_0xa66f48){logger[_0x3d41('0x24')](_0x3d41('0xd'),_0x5f4171,_0xa66f48[_0x3d41('0x2c')]);_0xd4de16[_0x3d41('0xf')]();}else if(_0x49ff92&&_0x49ff92[_0x3d41('0x2c')]){_0x25b454[_0x3d41('0x1e')]['amazonlex']=_0x49ff92;_0x4e7704['body']=_0x49ff92[_0x3d41('0x2c')];_0x4e7704[_0x3d41('0x2f')]=_0x3d41('0x30');_0x4e7704[_0x3d41('0x31')]=JSON['stringify'](_0x49ff92);return rpc[_0x119582+'Message'][_0x3d41('0x21')](_0x4e7704)[_0x3d41('0x22')](function(_0x2f32e6){logger[_0x3d41('0xc')](_0x3d41('0xd'),_0x5f4171,_0x4e7704[_0x3d41('0x1e')]);if(_0x49ff92[_0x3d41('0x32')]==_0x3d41('0x33')){_0xd4de16['next']();}else{_0xd4de16[_0x3d41('0x28')]();}})[_0x3d41('0x23')](function(_0x2d0f5e){logger['error'](_0x3d41('0xd'),_0x5f4171,JSON[_0x3d41('0x25')](_0x2d0f5e));_0xd4de16[_0x3d41('0xf')]();});}else{_0xd4de16[_0x3d41('0xf')]();}});}}catch(_0x2e9dfa){logger[_0x3d41('0x24')](_0x3d41('0xd'),_0x5f4171,JSON[_0x3d41('0x25')](_0x2e9dfa));_0xd4de16['stop']();}};}; \ No newline at end of file +var _0x550a=['channel','sms','whatsapp','phone','interaction','chat','ChatWebsiteId','account','AccountId','upperFirst','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','stop','LexRuntime','$LATEST','message','toString','amazonlex','providerName','providerResponse','dialogState','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','out'];(function(_0x54150c,_0x316f03){var _0x2144ef=function(_0x16aefd){while(--_0x16aefd){_0x54150c['push'](_0x54150c['shift']());}};_0x2144ef(++_0x316f03);}(_0x550a,0x1c4));var _0xa550=function(_0x3e5025,_0x1b5fc0){_0x3e5025=_0x3e5025-0x0;var _0x23f0de=_0x550a[_0x3e5025];return _0x23f0de;};'use strict';var _=require(_0xa550('0x0'));var moment=require(_0xa550('0x1'));var AWS=require(_0xa550('0x2'));var utils=require(_0xa550('0x3'));var logger=require(_0xa550('0x4'))('routing');var rpc={'chatMessage':require(_0xa550('0x5')),'openchannelMessage':require(_0xa550('0x6')),'mailMessage':require(_0xa550('0x7')),'smsMessage':require(_0xa550('0x8')),'faxMessage':require(_0xa550('0x9')),'whatsappMessage':require(_0xa550('0xa'))};exports['consequence']=function(_0x2d2151,_0x4cdccb){return function(_0x808bf4){try{if(!_['isNil'](this['interaction']['UserId'])){logger[_0xa550('0xb')](_0xa550('0xc'),_0x2d2151,_0xa550('0xd'));return _0x808bf4[_0xa550('0xe')]();}var _0x486d70={'ContactId':this[_0xa550('0xf')]['id'],'sentAt':moment()[_0xa550('0x10')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xa550('0x11')};if(this[_0xa550('0x12')]===_0xa550('0x13')||this['channel']===_0xa550('0x14')){_0x486d70[_0xa550('0x15')]=this[_0xa550('0x16')][_0xa550('0x15')];}var _0xbe336f=this['channel'];if(_0xbe336f===_0xa550('0x17')){_0x486d70[_0xa550('0x18')]=this[_0xa550('0x19')]['id'];}else{_0x486d70[_['upperFirst'](_0xbe336f)+_0xa550('0x1a')]=this[_0xa550('0x19')]['id'];}_0x486d70[_[_0xa550('0x1b')](_0xbe336f)+'InteractionId']=this[_0xa550('0x16')]['id'];if(this[_0xa550('0x16')]['created']){var _0x405953=_0x4cdccb[0x4];if(!_[_0xa550('0x1c')](_0x405953)){_0x486d70[_0xa550('0x1d')]=utils[_0xa550('0x1e')](_0x405953,this);return rpc[_0xbe336f+_0xa550('0x1f')][_0xa550('0x20')](_0x486d70)[_0xa550('0x21')](function(_0x587d74){logger[_0xa550('0xb')](_0xa550('0xc'),_0x2d2151,_0x486d70[_0xa550('0x1d')]);})[_0xa550('0x22')](function(_0x111d12){logger[_0xa550('0x23')](_0xa550('0xc'),_0x2d2151,JSON[_0xa550('0x24')](_0x111d12));})[_0xa550('0x25')](function(){logger[_0xa550('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x2d2151);_0x808bf4[_0xa550('0x26')]();});}else{logger[_0xa550('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x2d2151);_0x808bf4['stop']();}}else{var _0x5e2033=this;var _0x38f787=new AWS[(_0xa550('0x27'))]({'accessKeyId':_0x4cdccb[0x0],'secretAccessKey':_0x4cdccb[0x1],'region':_0x4cdccb[0x2]});var _0x16a17a={'botAlias':_0xa550('0x28'),'botName':_0x4cdccb[0x3],'inputText':this[_0xa550('0x29')]['body'],'userId':this[_0xa550('0x12')]+':'+this[_0xa550('0x16')]['id'][_0xa550('0x2a')]()};_0x38f787['postText'](_0x16a17a,function(_0x30bd18,_0x324c38){if(_0x30bd18){logger[_0xa550('0x23')]('[%s][AMAZONLEX]\x20%s',_0x2d2151,_0x30bd18[_0xa550('0x29')]);_0x808bf4[_0xa550('0xe')]();}else if(_0x324c38&&_0x324c38[_0xa550('0x29')]){_0x5e2033[_0xa550('0x1d')][_0xa550('0x2b')]=_0x324c38;_0x486d70[_0xa550('0x1d')]=_0x324c38[_0xa550('0x29')];_0x486d70[_0xa550('0x2c')]=_0xa550('0x2b');_0x486d70[_0xa550('0x2d')]=JSON[_0xa550('0x24')](_0x324c38);return rpc[_0xbe336f+_0xa550('0x1f')][_0xa550('0x20')](_0x486d70)[_0xa550('0x21')](function(_0x461dd5){logger[_0xa550('0xb')](_0xa550('0xc'),_0x2d2151,_0x486d70[_0xa550('0x1d')]);if(_0x324c38[_0xa550('0x2e')]=='Failed'){_0x808bf4[_0xa550('0xe')]();}else{_0x808bf4['stop']();}})[_0xa550('0x22')](function(_0x27d54e){logger[_0xa550('0x23')](_0xa550('0xc'),_0x2d2151,JSON[_0xa550('0x24')](_0x27d54e));_0x808bf4[_0xa550('0xe')]();});}else{_0x808bf4['next']();}});}}catch(_0x1e0c17){logger[_0xa550('0x23')](_0xa550('0xc'),_0x2d2151,JSON['stringify'](_0x1e0c17));_0x808bf4[_0xa550('0x26')]();}};}; \ 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 97200e8..3fdd465 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 _0xbc8a=['account','AccountId','InteractionId','Message','Smtp','service','host','port','secure','auth','user','pass','inReplyTo','messageId','html','','','auto-replied','All','auto_reply','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','create','[%s][AUTOREPLY]\x20%s','stringify','catch','error','finally','resolve','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','Interaction','update','stop','moment','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','../../rpc/chatInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../mailRpc','consequence','mail','isAutoreply','info','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','isNil','interaction','created','Autoreply\x20already\x20sent','next','autoreplyExecuted','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','One\x20Time\x20already\x20sent','format','YYYY-MM-DD\x20HH:mm:ss','out','body','message','from','channel','phone','read','subject','startsWith','Re:','Re:\x20','ChatWebsiteId'];(function(_0x9742fa,_0x428017){var _0x4c6ef5=function(_0x59c625){while(--_0x59c625){_0x9742fa['push'](_0x9742fa['shift']());}};_0x4c6ef5(++_0x428017);}(_0xbc8a,0xb9));var _0xabc8=function(_0x15af0f,_0x5454ce){_0x15af0f=_0x15af0f-0x0;var _0x2bd1cb=_0xbc8a[_0x15af0f];return _0x2bd1cb;};'use strict';var _=require('lodash');var moment=require(_0xabc8('0x0'));var utils=require(_0xabc8('0x1'));var logger=require(_0xabc8('0x2'))(_0xabc8('0x3'));var rpc={'chatMessage':require(_0xabc8('0x4')),'openchannelMessage':require(_0xabc8('0x5')),'mailMessage':require(_0xabc8('0x6')),'smsMessage':require(_0xabc8('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0xabc8('0x8')),'chatInteraction':require(_0xabc8('0x9')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'mailInteraction':require(_0xabc8('0xa')),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require(_0xabc8('0xb')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0xabc8('0xc'));exports[_0xabc8('0xd')]=function(_0xc72cf,_0x593b8d,_0xe15b5c,_0x12b3a7){return function(_0x1bc0cf){try{var _0x405aba=this['channel'];if(_0x405aba===_0xabc8('0xe')&&_0x12b3a7['body'][_0xabc8('0xf')]){logger[_0xabc8('0x10')]('[%s][AUTOREPLY]\x20%s',_0xc72cf,_0xabc8('0x11'));return _0x1bc0cf['next']();}if(_0x593b8d[0x0]==='1'&&(_[_0xabc8('0x12')](this[_0xabc8('0x13')][_0xabc8('0x14')])||!this[_0xabc8('0x13')][_0xabc8('0x14')])){logger[_0xabc8('0x10')]('[%s][AUTOREPLY]\x20%s',_0xc72cf,_0xabc8('0x15'));return _0x1bc0cf[_0xabc8('0x16')]();}if(_0x593b8d[0x0]==='2'&&this[_0xabc8('0x13')][_0xabc8('0x17')]){logger['info'](_0xabc8('0x18'),_0xc72cf,_0xabc8('0x19'));return _0x1bc0cf['next']();}var _0x485a93={'ContactId':this['contact']['id'],'sentAt':moment()[_0xabc8('0x1a')](_0xabc8('0x1b')),'direction':_0xabc8('0x1c')};if(this['channel']===_0xabc8('0xe')){_0x485a93[_0xabc8('0x1d')]=utils['getMustacheRender'](_0x593b8d[0x2],this);}else{_0x485a93[_0xabc8('0x1d')]=utils['getMustacheRender'](_0x593b8d[0x1],this);}if(this[_0xabc8('0x1e')]){_0x485a93['to']=this[_0xabc8('0x1e')][_0xabc8('0x1f')]||'';if(this[_0xabc8('0x20')]==='mail'&&_0x593b8d[0x1]==='1'){_0x485a93['cc']=this[_0xabc8('0x1e')]['cc']||'';}_0x485a93[_0xabc8('0x1f')]=this[_0xabc8('0x1e')]['to']||'';_0x485a93[_0xabc8('0x21')]=this['message']['phone']||'';_0x485a93[_0xabc8('0x22')]=!![];if(this[_0xabc8('0x1e')]['subject']){_0x485a93[_0xabc8('0x23')]='';_0x485a93[_0xabc8('0x23')]+=_[_0xabc8('0x24')](this[_0xabc8('0x1e')][_0xabc8('0x23')],_0xabc8('0x25'))?'':_0xabc8('0x26');_0x485a93[_0xabc8('0x23')]+=this[_0xabc8('0x1e')]['subject'];}}if(this[_0xabc8('0x20')]==='chat'){_0x485a93[_0xabc8('0x27')]=this[_0xabc8('0x28')]['id'];}else{_0x485a93[_['upperFirst'](this[_0xabc8('0x20')])+_0xabc8('0x29')]=this[_0xabc8('0x28')]['id'];}_0x485a93[_['upperFirst'](this[_0xabc8('0x20')])+_0xabc8('0x2a')]=this[_0xabc8('0x13')]['id'];var _0x55210b=this[_0xabc8('0x13')];if(rpc[this[_0xabc8('0x20')]+_0xabc8('0x2b')]){if(this[_0xabc8('0x20')]==='mail'){var _0x25d1a4={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0xabc8('0x2c')]['service']){_0x25d1a4['service']=this[_0xabc8('0x28')][_0xabc8('0x2c')][_0xabc8('0x2d')];}else{_0x25d1a4[_0xabc8('0x2e')]=this['account'][_0xabc8('0x2c')][_0xabc8('0x2e')];_0x25d1a4[_0xabc8('0x2f')]=this[_0xabc8('0x28')][_0xabc8('0x2c')][_0xabc8('0x2f')];_0x25d1a4[_0xabc8('0x30')]=this[_0xabc8('0x28')][_0xabc8('0x2c')]['secure'];}if(this[_0xabc8('0x28')][_0xabc8('0x2c')]['authentication']){_0x25d1a4[_0xabc8('0x31')]={'user':this[_0xabc8('0x28')][_0xabc8('0x2c')][_0xabc8('0x32')],'pass':this[_0xabc8('0x28')][_0xabc8('0x2c')][_0xabc8('0x33')]};}_0x485a93[_0xabc8('0x34')]=this[_0xabc8('0x1e')][_0xabc8('0x35')];_0x485a93[_0xabc8('0x36')]=_0xabc8('0x37')+_['replace'](_0x485a93['body'],_0xabc8('0x38'),'','','headers','auto-replied','All','auto_reply','sendMailMessage','then','Message','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','resolve','Interaction','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','lodash','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/smsInteraction','../../rpc/whatsappInteraction','../../mailRpc','consequence'];(function(_0x227212,_0x3f2a47){var _0x416163=function(_0x5629c0){while(--_0x5629c0){_0x227212['push'](_0x227212['shift']());}};_0x416163(++_0x3f2a47);}(_0xd240,0x1b4));var _0x0d24=function(_0x42774c,_0x54b775){_0x42774c=_0x42774c-0x0;var _0x167bbf=_0xd240[_0x42774c];return _0x167bbf;};'use strict';var _=require(_0x0d24('0x0'));var moment=require(_0x0d24('0x1'));var utils=require('./utils');var logger=require(_0x0d24('0x2'))('routing');var rpc={'chatMessage':require(_0x0d24('0x3')),'openchannelMessage':require(_0x0d24('0x4')),'mailMessage':require(_0x0d24('0x5')),'smsMessage':require(_0x0d24('0x6')),'faxMessage':require(_0x0d24('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x0d24('0x8')),'mailInteraction':require(_0x0d24('0x9')),'smsInteraction':require(_0x0d24('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0x0d24('0xb'))};var mailRpc=require(_0x0d24('0xc'));exports[_0x0d24('0xd')]=function(_0x3268da,_0x4443e8,_0x391350,_0x27e66f){return function(_0x16b543){try{var _0x22221d=this[_0x0d24('0xe')];if(_0x22221d==='mail'&&_0x27e66f['body']['isAutoreply']){logger['info'](_0x0d24('0xf'),_0x3268da,_0x0d24('0x10'));return _0x16b543[_0x0d24('0x11')]();}if(_0x4443e8[0x0]==='1'&&(_[_0x0d24('0x12')](this[_0x0d24('0x13')][_0x0d24('0x14')])||!this[_0x0d24('0x13')]['created'])){logger['info'](_0x0d24('0xf'),_0x3268da,_0x0d24('0x15'));return _0x16b543['next']();}if(_0x4443e8[0x0]==='2'&&this[_0x0d24('0x13')][_0x0d24('0x16')]){logger[_0x0d24('0x17')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3268da,_0x0d24('0x18'));return _0x16b543[_0x0d24('0x11')]();}var _0x2ec712={'ContactId':this[_0x0d24('0x19')]['id'],'sentAt':moment()[_0x0d24('0x1a')](_0x0d24('0x1b')),'direction':_0x0d24('0x1c')};if(this[_0x0d24('0xe')]===_0x0d24('0x1d')){_0x2ec712['body']=utils[_0x0d24('0x1e')](_0x4443e8[0x2],this);}else{_0x2ec712[_0x0d24('0x1f')]=utils[_0x0d24('0x1e')](_0x4443e8[0x1],this);}if(this['message']){_0x2ec712['to']=this[_0x0d24('0x20')][_0x0d24('0x21')]||'';if(this[_0x0d24('0xe')]===_0x0d24('0x1d')&&_0x4443e8[0x1]==='1'){_0x2ec712['cc']=this[_0x0d24('0x20')]['cc']||'';}_0x2ec712[_0x0d24('0x21')]=this[_0x0d24('0x20')]['to']||'';_0x2ec712[_0x0d24('0x22')]=this['message'][_0x0d24('0x22')]||'';_0x2ec712[_0x0d24('0x23')]=!![];if(this[_0x0d24('0x20')][_0x0d24('0x24')]){_0x2ec712[_0x0d24('0x24')]='';_0x2ec712[_0x0d24('0x24')]+=_[_0x0d24('0x25')](this[_0x0d24('0x20')][_0x0d24('0x24')],'Re:')?'':_0x0d24('0x26');_0x2ec712[_0x0d24('0x24')]+=this[_0x0d24('0x20')][_0x0d24('0x24')];}}if(this['channel']===_0x0d24('0x27')){_0x2ec712[_0x0d24('0x28')]=this[_0x0d24('0x29')]['id'];}else{_0x2ec712[_[_0x0d24('0x2a')](this['channel'])+_0x0d24('0x2b')]=this['account']['id'];}_0x2ec712[_[_0x0d24('0x2a')](this['channel'])+'InteractionId']=this[_0x0d24('0x13')]['id'];var _0x2ce111=this[_0x0d24('0x13')];if(rpc[this[_0x0d24('0xe')]+'Message']){if(this[_0x0d24('0xe')]==='mail'){var _0x1de890={'tls':{'rejectUnauthorized':![]}};if(this[_0x0d24('0x29')][_0x0d24('0x2c')][_0x0d24('0x2d')]){_0x1de890[_0x0d24('0x2d')]=this['account'][_0x0d24('0x2c')][_0x0d24('0x2d')];}else{_0x1de890[_0x0d24('0x2e')]=this[_0x0d24('0x29')]['Smtp']['host'];_0x1de890[_0x0d24('0x2f')]=this['account'][_0x0d24('0x2c')][_0x0d24('0x2f')];_0x1de890['secure']=this[_0x0d24('0x29')][_0x0d24('0x2c')]['secure'];}if(this[_0x0d24('0x29')][_0x0d24('0x2c')][_0x0d24('0x30')]){_0x1de890[_0x0d24('0x31')]={'user':this['account'][_0x0d24('0x2c')][_0x0d24('0x32')],'pass':this['account']['Smtp'][_0x0d24('0x33')]};}_0x2ec712['inReplyTo']=this[_0x0d24('0x20')][_0x0d24('0x34')];_0x2ec712['html']=_0x0d24('0x35')+_['replace'](_0x2ec712[_0x0d24('0x1f')],_0x0d24('0x36'),_0x0d24('0x37'))+_0x0d24('0x38');_0x2ec712[_0x0d24('0x39')]={'Auto-Submitted':_0x0d24('0x3a'),'X-Auto-Response-Suppress':_0x0d24('0x3b'),'Precedence':_0x0d24('0x3c')};return mailRpc[_0x0d24('0x3d')](_0x1de890,_0x2ec712)[_0x0d24('0x3e')](function(_0x4f2f42){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3268da);_0x2ec712[_0x0d24('0x34')]=_0x4f2f42[_0x0d24('0x20')][_0x0d24('0x34')];return rpc[_0x22221d+_0x0d24('0x3f')][_0x0d24('0x40')](_0x2ec712);})[_0x0d24('0x3e')](function(_0x5cc700){logger[_0x0d24('0x17')](_0x0d24('0xf'),_0x3268da,JSON[_0x0d24('0x41')](_0x5cc700));})[_0x0d24('0x42')](function(_0x1ea08e){logger[_0x0d24('0x43')](_0x0d24('0x44'),_0x3268da,JSON['stringify'](_0x1ea08e));})[_0x0d24('0x45')](function(){Promise[_0x0d24('0x46')]()[_0x0d24('0x3e')](function(){if(_0x4443e8[0x0]!=='2'||_0x2ce111[_0x0d24('0x16')])return;return rpc[_0x22221d+_0x0d24('0x47')]['update'](_0x2ce111['id'],{'autoreplyExecuted':!![]})['then'](function(_0x2f0e8a){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3268da,JSON[_0x0d24('0x41')](_0x2f0e8a));})[_0x0d24('0x42')](function(_0xe2aafe){logger['error'](_0x0d24('0x48'),_0x3268da,JSON[_0x0d24('0x41')](_0xe2aafe));});})[_0x0d24('0x3e')](function(){_0x16b543[_0x0d24('0x11')]();});});}else{return rpc[this[_0x0d24('0xe')]+_0x0d24('0x3f')]['create'](_0x2ec712)[_0x0d24('0x3e')](function(_0x43a59b){logger['info'](_0x0d24('0xf'),_0x3268da,_0x2ec712['body']);})[_0x0d24('0x42')](function(_0x2f254a){logger[_0x0d24('0x43')](_0x0d24('0xf'),_0x3268da,JSON[_0x0d24('0x41')](_0x2f254a));})[_0x0d24('0x45')](function(){Promise[_0x0d24('0x46')]()['then'](function(){if(_0x4443e8[0x0]!=='2'||_0x2ce111['autoreplyExecuted'])return;return rpc[_0x22221d+_0x0d24('0x47')][_0x0d24('0x49')](_0x2ce111['id'],{'autoreplyExecuted':!![]})['then'](function(_0x554d19){logger['info'](_0x0d24('0x4a'),_0x3268da,JSON['stringify'](_0x554d19));})[_0x0d24('0x42')](function(_0x4f23a4){logger['error']('[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x3268da,JSON['stringify'](_0x4f23a4));});})['then'](function(){_0x16b543['next']();});});}}}catch(_0x5431e4){logger[_0x0d24('0x43')](_0x0d24('0xf'),_0x3268da,JSON['stringify'](_0x5431e4));_0x16b543['stop']();}};}; \ 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 7ffd8d4..7ae43d3 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 _0x113e=['[%s][CLOSE]\x20%s','stringify','finally','stop','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error'];(function(_0x3631b7,_0x5980f){var _0xa06019=function(_0x245242){while(--_0x245242){_0x3631b7['push'](_0x3631b7['shift']());}};_0xa06019(++_0x5980f);}(_0x113e,0xb4));var _0xe113=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x113e[_0x2d34d6];return _0x1d3d12;};'use strict';var moment=require('moment');var logger=require(_0xe113('0x0'))(_0xe113('0x1'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0xe113('0x2')),'smsInteraction':require(_0xe113('0x3')),'mailInteraction':require(_0xe113('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0xe113('0x5')]=function(_0xc8e17f,_0x588a08,_0x5737c5,_0x409a04){return function(_0x5b7cf6){try{logger[_0xe113('0x6')](_0xe113('0x7'),_0xc8e17f,_0x588a08[0x0]);var _0x5df1fb={'closed':0x1,'closedAt':moment()['format'](_0xe113('0x8')),'closeReason':_0xe113('0x9'),'disposition':_0x588a08[0x0]};if(rpc[_0x409a04[_0xe113('0xa')]+_0xe113('0xb')]){rpc[_0x409a04[_0xe113('0xa')]+_0xe113('0xb')][_0xe113('0xc')](_0x409a04[_0xe113('0xd')]['id'],_0x5df1fb)[_0xe113('0xe')](function(_0x1d2e78){logger[_0xe113('0x6')](_0xe113('0xf'),_0xc8e17f,_0x409a04[_0xe113('0xd')]['id']);})[_0xe113('0x10')](function(_0x1d5378){logger[_0xe113('0x11')](_0xe113('0x12'),_0xc8e17f,JSON[_0xe113('0x13')](_0x1d5378));})[_0xe113('0x14')](function(){_0x5b7cf6['stop']();});}}catch(_0x597f10){logger[_0xe113('0x11')](_0xe113('0x12'),_0xc8e17f,JSON[_0xe113('0x13')](_0x597f10));_0x5b7cf6[_0xe113('0x15')]();}};}; \ No newline at end of file +var _0x2e0e=['update','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','stringify','finally','error','[%s][CLOSE]\x20%s','stop','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','consequence','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction'];(function(_0x2adbeb,_0x5581be){var _0x5e18a6=function(_0x84e42b){while(--_0x84e42b){_0x2adbeb['push'](_0x2adbeb['shift']());}};_0x5e18a6(++_0x5581be);}(_0x2e0e,0x1c2));var _0xe2e0=function(_0x271ff1,_0x34a70e){_0x271ff1=_0x271ff1-0x0;var _0x579793=_0x2e0e[_0x271ff1];return _0x579793;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0xe2e0('0x0'));var rpc={'chatInteraction':require(_0xe2e0('0x1')),'openchannelInteraction':require(_0xe2e0('0x2')),'smsInteraction':require(_0xe2e0('0x3')),'mailInteraction':require(_0xe2e0('0x4')),'faxInteraction':require(_0xe2e0('0x5')),'whatsappInteraction':require(_0xe2e0('0x6'))};exports[_0xe2e0('0x7')]=function(_0x40b74a,_0x55924c,_0x4e7f54,_0x355f39){return function(_0x450b8d){try{logger['info']('[%s][CLOSE]\x20reason\x20%s',_0x40b74a,_0x55924c[0x0]);var _0x70d22={'closed':0x1,'closedAt':moment()['format'](_0xe2e0('0x8')),'closeReason':_0xe2e0('0x9'),'disposition':_0x55924c[0x0]};if(rpc[_0x355f39[_0xe2e0('0xa')]+_0xe2e0('0xb')]){rpc[_0x355f39[_0xe2e0('0xa')]+_0xe2e0('0xb')][_0xe2e0('0xc')](_0x355f39['interaction']['id'],_0x70d22)[_0xe2e0('0xd')](function(_0x1fd5e7){logger[_0xe2e0('0xe')](_0xe2e0('0xf'),_0x40b74a,_0x355f39[_0xe2e0('0x10')]['id']);})['catch'](function(_0x142cc1){logger['error']('[%s][CLOSE]\x20%s',_0x40b74a,JSON[_0xe2e0('0x11')](_0x142cc1));})[_0xe2e0('0x12')](function(){_0x450b8d['stop']();});}}catch(_0x2fccba){logger[_0xe2e0('0x13')](_0xe2e0('0x14'),_0x40b74a,JSON[_0xe2e0('0x11')](_0x2fccba));_0x450b8d[_0xe2e0('0x15')]();}};}; \ 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 af707ea..4db9166 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 _0xea31=['result','fulfillment','speech','providerName','stringify','create','metadata','endConversation','error','lodash','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','isEmpty','body','getMustacheRender','Message','then','catch','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message'];(function(_0x2c11ef,_0x20b04f){var _0x4219e7=function(_0x49c620){while(--_0x49c620){_0x2c11ef['push'](_0x2c11ef['shift']());}};_0x4219e7(++_0x20b04f);}(_0xea31,0x6b));var _0x1ea3=function(_0x3b1249,_0x5dbf36){_0x3b1249=_0x3b1249-0x0;var _0x4d6b0e=_0xea31[_0x3b1249];return _0x4d6b0e;};'use strict';var _=require(_0x1ea3('0x0'));var moment=require('moment');var apiai=require(_0x1ea3('0x1'));var md5=require(_0x1ea3('0x2'));var utils=require(_0x1ea3('0x3'));var logger=require(_0x1ea3('0x4'))(_0x1ea3('0x5'));var rpc={'chatMessage':require(_0x1ea3('0x6')),'openchannelMessage':require(_0x1ea3('0x7')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1ea3('0x8')),'faxMessage':require(_0x1ea3('0x9')),'whatsappMessage':require(_0x1ea3('0xa'))};exports[_0x1ea3('0xb')]=function(_0x13e6fb,_0x4c8f83){return function(_0x1fa3a8){try{if(!_[_0x1ea3('0xc')](this[_0x1ea3('0xd')][_0x1ea3('0xe')])){logger[_0x1ea3('0xf')](_0x1ea3('0x10'),_0x13e6fb,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1fa3a8[_0x1ea3('0x11')]();}var _0x3cad5b={'ContactId':this[_0x1ea3('0x12')]['id'],'sentAt':moment()[_0x1ea3('0x13')](_0x1ea3('0x14')),'direction':_0x1ea3('0x15')};if(this[_0x1ea3('0x16')]==='sms'||this[_0x1ea3('0x16')]==='whatsapp'){_0x3cad5b[_0x1ea3('0x17')]=this[_0x1ea3('0xd')][_0x1ea3('0x17')];}var _0x573484=this[_0x1ea3('0x16')];if(_0x573484===_0x1ea3('0x18')){_0x3cad5b[_0x1ea3('0x19')]=this['account']['id'];}else{_0x3cad5b[_[_0x1ea3('0x1a')](_0x573484)+_0x1ea3('0x1b')]=this[_0x1ea3('0x1c')]['id'];}_0x3cad5b[_[_0x1ea3('0x1a')](_0x573484)+_0x1ea3('0x1d')]=this[_0x1ea3('0xd')]['id'];if(this[_0x1ea3('0xd')]['created']){var _0x2514f4=_0x4c8f83[0x2];if(!_[_0x1ea3('0x1e')](_0x2514f4)){_0x3cad5b[_0x1ea3('0x1f')]=utils[_0x1ea3('0x20')](_0x2514f4,this);return rpc[_0x573484+_0x1ea3('0x21')]['create'](_0x3cad5b)[_0x1ea3('0x22')](function(_0x2a8b47){logger[_0x1ea3('0xf')]('[%s][DIALOGFLOW]\x20%s',_0x13e6fb,_0x3cad5b[_0x1ea3('0x1f')]);})[_0x1ea3('0x23')](function(_0x28a554){logger['error'](_0x1ea3('0x10'),_0x13e6fb,JSON['stringify'](_0x28a554));})[_0x1ea3('0x24')](function(){logger[_0x1ea3('0xf')](_0x1ea3('0x25'),_0x13e6fb);_0x1fa3a8[_0x1ea3('0x26')]();});}else{logger[_0x1ea3('0xf')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x13e6fb);_0x1fa3a8[_0x1ea3('0x26')]();}}else{var _0x498455=this;var _0x941a50=apiai(_0x4c8f83[0x0],{'language':_0x4c8f83[0x1]||'en'});return _0x941a50['textRequest'](this[_0x1ea3('0x27')][_0x1ea3('0x1f')],{'sessionId':md5(this[_0x1ea3('0xd')]['id'])})['then'](function(_0x50703d){_0x498455[_0x1ea3('0x1f')]['dialogflow']=_0x50703d;_0x3cad5b[_0x1ea3('0x1f')]=_0x50703d[_0x1ea3('0x28')][_0x1ea3('0x29')][_0x1ea3('0x2a')];_0x3cad5b[_0x1ea3('0x2b')]='dialogflow';_0x3cad5b['providerResponse']=JSON[_0x1ea3('0x2c')](_0x50703d);return rpc[_0x573484+_0x1ea3('0x21')][_0x1ea3('0x2d')](_0x3cad5b)[_0x1ea3('0x22')](function(_0x3ff4b2){logger[_0x1ea3('0xf')](_0x1ea3('0x10'),_0x13e6fb,_0x3cad5b[_0x1ea3('0x1f')]);if(_0x50703d[_0x1ea3('0x28')][_0x1ea3('0x2e')][_0x1ea3('0x2f')]){_0x1fa3a8[_0x1ea3('0x11')]();}else{_0x1fa3a8[_0x1ea3('0x26')]();}})[_0x1ea3('0x23')](function(_0xdbd7e3){logger[_0x1ea3('0x30')]('[%s][DIALOGFLOW]\x20%s',_0x13e6fb,JSON[_0x1ea3('0x2c')](_0xdbd7e3));_0x1fa3a8[_0x1ea3('0x11')]();});})[_0x1ea3('0x23')](function(_0x1744b8){logger[_0x1ea3('0x30')]('[%s][DIALOGFLOW]\x20%s',_0x13e6fb,_0x1744b8['message']);_0x1fa3a8[_0x1ea3('0x11')]();});}}catch(_0xdfd40a){logger['error'](_0x1ea3('0x10'),_0x13e6fb,JSON[_0x1ea3('0x2c')](_0xdfd40a));_0x1fa3a8['stop']();}};}; \ No newline at end of file +var _0x573a=['error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','textRequest','dialogflow','result','metadata','endConversation','lodash','moment','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','channel','sms','whatsapp','phone','chat','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','catch'];(function(_0x3d5e29,_0x1c08e2){var _0x4aa92b=function(_0x2c9b0d){while(--_0x2c9b0d){_0x3d5e29['push'](_0x3d5e29['shift']());}};_0x4aa92b(++_0x1c08e2);}(_0x573a,0x124));var _0xa573=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x573a[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0xa573('0x0'));var moment=require(_0xa573('0x1'));var apiai=require('apiai-promise');var md5=require(_0xa573('0x2'));var utils=require(_0xa573('0x3'));var logger=require(_0xa573('0x4'))(_0xa573('0x5'));var rpc={'chatMessage':require(_0xa573('0x6')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xa573('0x7')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa573('0x8')),'whatsappMessage':require(_0xa573('0x9'))};exports['consequence']=function(_0x5adeee,_0x3fd9f1){return function(_0x1c7332){try{if(!_[_0xa573('0xa')](this[_0xa573('0xb')][_0xa573('0xc')])){logger[_0xa573('0xd')](_0xa573('0xe'),_0x5adeee,_0xa573('0xf'));return _0x1c7332[_0xa573('0x10')]();}var _0x1a8fe0={'ContactId':this[_0xa573('0x11')]['id'],'sentAt':moment()[_0xa573('0x12')](_0xa573('0x13')),'direction':'out'};if(this[_0xa573('0x14')]===_0xa573('0x15')||this[_0xa573('0x14')]===_0xa573('0x16')){_0x1a8fe0[_0xa573('0x17')]=this[_0xa573('0xb')][_0xa573('0x17')];}var _0x43231c=this[_0xa573('0x14')];if(_0x43231c===_0xa573('0x18')){_0x1a8fe0['ChatWebsiteId']=this[_0xa573('0x19')]['id'];}else{_0x1a8fe0[_[_0xa573('0x1a')](_0x43231c)+_0xa573('0x1b')]=this[_0xa573('0x19')]['id'];}_0x1a8fe0[_[_0xa573('0x1a')](_0x43231c)+_0xa573('0x1c')]=this[_0xa573('0xb')]['id'];if(this[_0xa573('0xb')][_0xa573('0x1d')]){var _0xdf8f17=_0x3fd9f1[0x2];if(!_[_0xa573('0x1e')](_0xdf8f17)){_0x1a8fe0[_0xa573('0x1f')]=utils[_0xa573('0x20')](_0xdf8f17,this);return rpc[_0x43231c+_0xa573('0x21')][_0xa573('0x22')](_0x1a8fe0)[_0xa573('0x23')](function(_0x470591){logger[_0xa573('0xd')](_0xa573('0xe'),_0x5adeee,_0x1a8fe0[_0xa573('0x1f')]);})[_0xa573('0x24')](function(_0x2c0b3b){logger[_0xa573('0x25')](_0xa573('0xe'),_0x5adeee,JSON[_0xa573('0x26')](_0x2c0b3b));})[_0xa573('0x27')](function(){logger['info']('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5adeee);_0x1c7332['stop']();});}else{logger[_0xa573('0xd')](_0xa573('0x28'),_0x5adeee);_0x1c7332[_0xa573('0x29')]();}}else{var _0x2b9149=this;var _0x333fd8=apiai(_0x3fd9f1[0x0],{'language':_0x3fd9f1[0x1]||'en'});return _0x333fd8[_0xa573('0x2a')](this['message']['body'],{'sessionId':md5(this[_0xa573('0xb')]['id'])})['then'](function(_0x424270){_0x2b9149[_0xa573('0x1f')][_0xa573('0x2b')]=_0x424270;_0x1a8fe0[_0xa573('0x1f')]=_0x424270[_0xa573('0x2c')]['fulfillment']['speech'];_0x1a8fe0['providerName']=_0xa573('0x2b');_0x1a8fe0['providerResponse']=JSON['stringify'](_0x424270);return rpc[_0x43231c+_0xa573('0x21')][_0xa573('0x22')](_0x1a8fe0)[_0xa573('0x23')](function(_0x32f027){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x5adeee,_0x1a8fe0[_0xa573('0x1f')]);if(_0x424270['result'][_0xa573('0x2d')][_0xa573('0x2e')]){_0x1c7332[_0xa573('0x10')]();}else{_0x1c7332[_0xa573('0x29')]();}})[_0xa573('0x24')](function(_0x47fcd6){logger[_0xa573('0x25')](_0xa573('0xe'),_0x5adeee,JSON[_0xa573('0x26')](_0x47fcd6));_0x1c7332[_0xa573('0x10')]();});})[_0xa573('0x24')](function(_0x3b8ca8){logger[_0xa573('0x25')](_0xa573('0xe'),_0x5adeee,_0x3b8ca8['message']);_0x1c7332[_0xa573('0x10')]();});}}catch(_0x54a470){logger[_0xa573('0x25')](_0xa573('0xe'),_0x5adeee,JSON[_0xa573('0x26')](_0x54a470));_0x1c7332[_0xa573('0x29')]();}};}; \ 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 2c5f487..e4bb54e 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 _0x4032=['channel','sms','whatsapp','interaction','phone','chat','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','isEmpty','body','getMustacheRender','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','replace','sessionPath','message','detectIntent','length','diagnosticInfo','queryResult','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','name','DIALOGFLOWV2_INTENTDISPLAYNAME','intent','isFallback','DIALOGFLOWV2_QUERYTEXT','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','dialogflowV2','providerResponse','fulfillmentText','push','lodash','dialogflow','md5','moment','bluebird','routing','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/whatsappMessage','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','next','contact','YYYY-MM-DD\x20HH:mm:ss','out'];(function(_0x63601b,_0x3a0ccc){var _0x2d189c=function(_0x15aee1){while(--_0x15aee1){_0x63601b['push'](_0x63601b['shift']());}};_0x2d189c(++_0x3a0ccc);}(_0x4032,0x6b));var _0x2403=function(_0x5d105a,_0x36eb36){_0x5d105a=_0x5d105a-0x0;var _0x1c069f=_0x4032[_0x5d105a];return _0x1c069f;};'use strict';var _=require(_0x2403('0x0'));var dialogflow=require(_0x2403('0x1'));var md5=require(_0x2403('0x2'));var moment=require(_0x2403('0x3'));var Promise=require(_0x2403('0x4'));var logger=require('../../../../config/logger')(_0x2403('0x5'));var utils=require('./utils');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x2403('0x6')),'smsMessage':require(_0x2403('0x7')),'faxMessage':require('../../rpc/faxMessage'),'whatsappMessage':require(_0x2403('0x8'))};function createMessage(_0x216604,_0x394f84,_0x3e4bbf,_0x1cac6f){return new Promise(function(_0x1555e3,_0x491615){var _0x486bb4=_['clone'](_0x3e4bbf);_0x486bb4['body']=_0x1cac6f;return rpc[_0x394f84+_0x2403('0x9')][_0x2403('0xa')](_0x486bb4)[_0x2403('0xb')](function(){logger[_0x2403('0xc')](_0x2403('0xd'),_0x216604,_0x486bb4['body']);_0x1555e3();})[_0x2403('0xe')](function(_0x445bb7){logger[_0x2403('0xf')](_0x2403('0xd'),_0x216604,JSON[_0x2403('0x10')](_0x445bb7));_0x491615(_0x445bb7);});});}exports[_0x2403('0x11')]=function(_0x1a9907,_0x3a3691){return function(_0x5abcb1){try{if(!_[_0x2403('0x12')](this['interaction']['UserId'])){logger['info'](_0x2403('0xd'),_0x1a9907,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5abcb1[_0x2403('0x13')]();}var _0x342134={'ContactId':this[_0x2403('0x14')]['id'],'sentAt':moment()['format'](_0x2403('0x15')),'direction':_0x2403('0x16')};if(this[_0x2403('0x17')]===_0x2403('0x18')||this[_0x2403('0x17')]===_0x2403('0x19')){_0x342134['phone']=this[_0x2403('0x1a')][_0x2403('0x1b')];}var _0x3de2ed=this[_0x2403('0x17')];if(_0x3de2ed===_0x2403('0x1c')){_0x342134[_0x2403('0x1d')]=this['account']['id'];}else{_0x342134[_['upperFirst'](_0x3de2ed)+_0x2403('0x1e')]=this[_0x2403('0x1f')]['id'];}_0x342134[_[_0x2403('0x20')](_0x3de2ed)+_0x2403('0x21')]=this[_0x2403('0x1a')]['id'];if(this[_0x2403('0x1a')]['created']){var _0x12ad5b=_0x3a3691[0x4];if(!_[_0x2403('0x22')](_0x12ad5b)){_0x342134[_0x2403('0x23')]=utils[_0x2403('0x24')](_0x12ad5b,this);return rpc[_0x3de2ed+'Message'][_0x2403('0xa')](_0x342134)['then'](function(_0x3f9d89){logger[_0x2403('0xc')](_0x2403('0xd'),_0x1a9907,_0x342134[_0x2403('0x23')]);})['catch'](function(_0x57c6e5){logger['error'](_0x2403('0xd'),_0x1a9907,JSON[_0x2403('0x10')](_0x57c6e5));})[_0x2403('0x25')](function(){logger[_0x2403('0xc')](_0x2403('0x26'),_0x1a9907);_0x5abcb1['stop']();});}else{logger[_0x2403('0xc')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x1a9907);_0x5abcb1[_0x2403('0x27')]();}}else{var _0x483198=this;var _0x26b985=_0x3a3691[0x2][_0x2403('0x28')](/\\n/g,'\x0a');var _0x586cde={'credentials':{'private_key':_0x26b985,'client_email':_0x3a3691[0x1]}};var _0x179465=new dialogflow['SessionsClient'](_0x586cde);var _0x2bb436=_0x179465[_0x2403('0x29')](_0x3a3691[0x0],md5(_0x483198[_0x2403('0x1a')]['id']));var _0x5a1083={'session':_0x2bb436,'queryInput':{'text':{'text':_0x483198[_0x2403('0x2a')][_0x2403('0x23')],'languageCode':_0x3a3691[0x3]||'en'}}};return _0x179465[_0x2403('0x2b')](_0x5a1083)[_0x2403('0xb')](function(_0x3196a7){if(_0x3196a7&&_0x3196a7[_0x2403('0x2c')]){_0x483198[_0x2403('0x23')]['dialogflowV2']=_0x3196a7;var _0xb13372=_0x3196a7[0x0];var _0x220d61=_0xb13372['queryResult'][_0x2403('0x2d')]&&_0xb13372[_0x2403('0x2e')][_0x2403('0x2d')][_0x2403('0x2f')]?_0xb13372[_0x2403('0x2e')][_0x2403('0x2d')]['fields'][_0x2403('0x30')][_0x2403('0x31')]:![];_0x483198['body'][_0x2403('0x32')]=_0xb13372[_0x2403('0x2e')]['action'];_0x483198[_0x2403('0x23')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0xb13372[_0x2403('0x2e')][_0x2403('0x33')];_0x483198[_0x2403('0x23')][_0x2403('0x34')]=_0xb13372[_0x2403('0x2e')][_0x2403('0x2d')]&&_0xb13372[_0x2403('0x2e')][_0x2403('0x2d')][_0x2403('0x2f')]?_0xb13372[_0x2403('0x2e')][_0x2403('0x2d')][_0x2403('0x2f')][_0x2403('0x30')][_0x2403('0x31')]:![];_0x483198['body']['DIALOGFLOWV2_INTENTNAME']=_0xb13372[_0x2403('0x2e')]['intent'][_0x2403('0x35')];_0x483198[_0x2403('0x23')][_0x2403('0x36')]=_0xb13372[_0x2403('0x2e')][_0x2403('0x37')]['displayName'];_0x483198['body']['DIALOGFLOWV2_ISFALLBACKINTENT']=_0xb13372['queryResult'][_0x2403('0x37')][_0x2403('0x38')];_0x483198[_0x2403('0x23')]['DIALOGFLOWV2_LANGUAGECODE']=_0xb13372[_0x2403('0x2e')]['languageCode'];_0x483198[_0x2403('0x23')][_0x2403('0x39')]=_0xb13372[_0x2403('0x2e')][_0x2403('0x3a')];_0x483198[_0x2403('0x23')][_0x2403('0x3b')]=_0xb13372['queryResult'][_0x2403('0x3c')];_0x342134['providerName']=_0x2403('0x3d');_0x342134[_0x2403('0x3e')]=JSON[_0x2403('0x10')](_0x3196a7);var _0x44f912=[];for(var _0x5ac1db=0x0;_0x5ac1db<_0x3196a7[_0x2403('0x2c')];_0x5ac1db++){var _0x3e5abe=_0x3196a7[_0x5ac1db];if(_0x3e5abe&&_0x3e5abe[_0x2403('0x2e')]&&_0x3e5abe[_0x2403('0x2e')][_0x2403('0x3f')]){_0x44f912[_0x2403('0x40')](createMessage(_0x1a9907,_0x3de2ed,_0x342134,_0x3e5abe[_0x2403('0x2e')][_0x2403('0x3f')]));}}return Promise['all'](_0x44f912)[_0x2403('0xb')](function(){if(_0x220d61){_0x5abcb1[_0x2403('0x13')]();}else{_0x5abcb1[_0x2403('0x27')]();}})['catch'](function(_0x259622){logger[_0x2403('0xf')](_0x2403('0xd'),_0x1a9907,JSON[_0x2403('0x10')](_0x259622));_0x5abcb1[_0x2403('0x13')]();});}})['catch'](function(_0x4db57b){logger[_0x2403('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x1a9907,_0x4db57b[_0x2403('0x2a')]);_0x5abcb1[_0x2403('0x13')]();});}}catch(_0x45cef8){logger['error'](_0x2403('0xd'),_0x1a9907,JSON['stringify'](_0x45cef8));_0x5abcb1[_0x2403('0x27')]();}};}; \ No newline at end of file +var _0x2e51=['DIALOGFLOWV2_ACTION','action','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','DIALOGFLOWV2_ENDCONVERSATION','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_LANGUAGECODE','languageCode','DIALOGFLOWV2_QUERYTEXT','DIALOGFLOWV2_SCORE','providerName','dialogflowV2','fulfillmentText','push','all','lodash','dialogflow','moment','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','then','info','[%s][DIALOGFLOWV2]\x20%s','catch','error','stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','sms','whatsapp','phone','channel','chat','account','upperFirst','isEmpty','create','finally','stop','replace','sessionPath','message','detectIntent','length','queryResult','diagnosticInfo','fields','boolValue'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x2e51,0x1b9));var _0x12e5=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x2e51[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x12e5('0x0'));var dialogflow=require(_0x12e5('0x1'));var md5=require('md5');var moment=require(_0x12e5('0x2'));var Promise=require(_0x12e5('0x3'));var logger=require(_0x12e5('0x4'))(_0x12e5('0x5'));var utils=require(_0x12e5('0x6'));var rpc={'chatMessage':require(_0x12e5('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x12e5('0x8')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x12e5('0x9')),'whatsappMessage':require(_0x12e5('0xa'))};function createMessage(_0x4df70c,_0x25c847,_0x6622d8,_0x159c8b){return new Promise(function(_0x3bf90a,_0x1a0f1c){var _0x4dae28=_[_0x12e5('0xb')](_0x6622d8);_0x4dae28[_0x12e5('0xc')]=_0x159c8b;return rpc[_0x25c847+_0x12e5('0xd')]['create'](_0x4dae28)[_0x12e5('0xe')](function(){logger[_0x12e5('0xf')](_0x12e5('0x10'),_0x4df70c,_0x4dae28['body']);_0x3bf90a();})[_0x12e5('0x11')](function(_0x140ffe){logger[_0x12e5('0x12')]('[%s][DIALOGFLOWV2]\x20%s',_0x4df70c,JSON[_0x12e5('0x13')](_0x140ffe));_0x1a0f1c(_0x140ffe);});});}exports[_0x12e5('0x14')]=function(_0x3030ef,_0x1ad8de){return function(_0x4f7566){try{if(!_[_0x12e5('0x15')](this[_0x12e5('0x16')][_0x12e5('0x17')])){logger[_0x12e5('0xf')](_0x12e5('0x10'),_0x3030ef,_0x12e5('0x18'));return _0x4f7566[_0x12e5('0x19')]();}var _0x2f95ae={'ContactId':this[_0x12e5('0x1a')]['id'],'sentAt':moment()['format'](_0x12e5('0x1b')),'direction':_0x12e5('0x1c')};if(this['channel']===_0x12e5('0x1d')||this['channel']===_0x12e5('0x1e')){_0x2f95ae[_0x12e5('0x1f')]=this['interaction'][_0x12e5('0x1f')];}var _0x450c4d=this[_0x12e5('0x20')];if(_0x450c4d===_0x12e5('0x21')){_0x2f95ae['ChatWebsiteId']=this[_0x12e5('0x22')]['id'];}else{_0x2f95ae[_['upperFirst'](_0x450c4d)+'AccountId']=this[_0x12e5('0x22')]['id'];}_0x2f95ae[_[_0x12e5('0x23')](_0x450c4d)+'InteractionId']=this[_0x12e5('0x16')]['id'];if(this['interaction']['created']){var _0x5c4707=_0x1ad8de[0x4];if(!_[_0x12e5('0x24')](_0x5c4707)){_0x2f95ae[_0x12e5('0xc')]=utils['getMustacheRender'](_0x5c4707,this);return rpc[_0x450c4d+'Message'][_0x12e5('0x25')](_0x2f95ae)['then'](function(_0x32bbf7){logger[_0x12e5('0xf')](_0x12e5('0x10'),_0x3030ef,_0x2f95ae[_0x12e5('0xc')]);})[_0x12e5('0x11')](function(_0x505115){logger[_0x12e5('0x12')](_0x12e5('0x10'),_0x3030ef,JSON['stringify'](_0x505115));})[_0x12e5('0x26')](function(){logger[_0x12e5('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x3030ef);_0x4f7566[_0x12e5('0x27')]();});}else{logger[_0x12e5('0xf')]('[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3030ef);_0x4f7566[_0x12e5('0x27')]();}}else{var _0x1a40e8=this;var _0x3f2d24=_0x1ad8de[0x2][_0x12e5('0x28')](/\\n/g,'\x0a');var _0x16e618={'credentials':{'private_key':_0x3f2d24,'client_email':_0x1ad8de[0x1]}};var _0x3e1b18=new dialogflow['SessionsClient'](_0x16e618);var _0x557a25=_0x3e1b18[_0x12e5('0x29')](_0x1ad8de[0x0],md5(_0x1a40e8[_0x12e5('0x16')]['id']));var _0xbf4f8d={'session':_0x557a25,'queryInput':{'text':{'text':_0x1a40e8[_0x12e5('0x2a')][_0x12e5('0xc')],'languageCode':_0x1ad8de[0x3]||'en'}}};return _0x3e1b18[_0x12e5('0x2b')](_0xbf4f8d)[_0x12e5('0xe')](function(_0x4624ca){if(_0x4624ca&&_0x4624ca[_0x12e5('0x2c')]){_0x1a40e8[_0x12e5('0xc')]['dialogflowV2']=_0x4624ca;var _0x370a7f=_0x4624ca[0x0];var _0x38857d=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x2e')]&&_0x370a7f[_0x12e5('0x2d')]['diagnosticInfo'][_0x12e5('0x2f')]?_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x2e')][_0x12e5('0x2f')]['end_conversation'][_0x12e5('0x30')]:![];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x31')]=_0x370a7f['queryResult'][_0x12e5('0x32')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x33')]=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x34')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x35')]=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x2e')]&&_0x370a7f['queryResult']['diagnosticInfo']['fields']?_0x370a7f[_0x12e5('0x2d')]['diagnosticInfo'][_0x12e5('0x2f')]['end_conversation'][_0x12e5('0x30')]:![];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x36')]=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x37')][_0x12e5('0x38')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x39')]=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x37')][_0x12e5('0x3a')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x3b')]=_0x370a7f[_0x12e5('0x2d')][_0x12e5('0x37')][_0x12e5('0x3c')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x3d')]=_0x370a7f['queryResult'][_0x12e5('0x3e')];_0x1a40e8[_0x12e5('0xc')][_0x12e5('0x3f')]=_0x370a7f[_0x12e5('0x2d')]['queryText'];_0x1a40e8['body'][_0x12e5('0x40')]=_0x370a7f[_0x12e5('0x2d')]['intentDetectionConfidence'];_0x2f95ae[_0x12e5('0x41')]=_0x12e5('0x42');_0x2f95ae['providerResponse']=JSON[_0x12e5('0x13')](_0x4624ca);var _0x53d83d=[];for(var _0x1f50d4=0x0;_0x1f50d4<_0x4624ca[_0x12e5('0x2c')];_0x1f50d4++){var _0x288c87=_0x4624ca[_0x1f50d4];if(_0x288c87&&_0x288c87[_0x12e5('0x2d')]&&_0x288c87[_0x12e5('0x2d')][_0x12e5('0x43')]){_0x53d83d[_0x12e5('0x44')](createMessage(_0x3030ef,_0x450c4d,_0x2f95ae,_0x288c87['queryResult'][_0x12e5('0x43')]));}}return Promise[_0x12e5('0x45')](_0x53d83d)[_0x12e5('0xe')](function(){if(_0x38857d){_0x4f7566[_0x12e5('0x19')]();}else{_0x4f7566['stop']();}})[_0x12e5('0x11')](function(_0x349102){logger[_0x12e5('0x12')](_0x12e5('0x10'),_0x3030ef,JSON['stringify'](_0x349102));_0x4f7566[_0x12e5('0x19')]();});}})[_0x12e5('0x11')](function(_0x5d1aca){logger[_0x12e5('0x12')](_0x12e5('0x10'),_0x3030ef,_0x5d1aca[_0x12e5('0x2a')]);_0x4f7566[_0x12e5('0x19')]();});}}catch(_0x49111b){logger[_0x12e5('0x12')](_0x12e5('0x10'),_0x3030ef,JSON[_0x12e5('0x13')](_0x49111b));_0x4f7566['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 a526a35..9c88ca3 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 _0x317d=['replace','length','error','[%s][GOTOIF]\x20%s','map','message','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stop','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','getMustacheRender'];(function(_0x33d6e7,_0x1fd7b1){var _0xf722d7=function(_0x51225d){while(--_0x51225d){_0x33d6e7['push'](_0x33d6e7['shift']());}};_0xf722d7(++_0x1fd7b1);}(_0x317d,0xba));var _0xd317=function(_0x236b1f,_0x13871b){_0x236b1f=_0x236b1f-0x0;var _0x3fda9a=_0x317d[_0x236b1f];return _0x3fda9a;};'use strict';var schema=require(_0xd317('0x0'));var _=require('lodash');var htmlToText=require('html-to-text');var utils=require(_0xd317('0x1'));var logger=require(_0xd317('0x2'))(_0xd317('0x3'));var gotoif=schema({'condition':{'type':_0xd317('0x4'),'required':!![],'message':_0xd317('0x5')},'priorityTrue':{'type':_0xd317('0x6'),'message':_0xd317('0x7')},'priorityFalse':{'type':_0xd317('0x6'),'message':_0xd317('0x8')}});exports['consequence']=function(_0x88c0a5,_0xc6eb4){return function(_0x3d5177){try{var _0x501cea={'condition':htmlToText['fromString'](utils[_0xd317('0x9')](_0xc6eb4[0x0],this),{'wordwrap':![]})[_0xd317('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0xc6eb4[0x1],'priorityFalse':_0xc6eb4[0x2]};var _0x276133=gotoif[_0xd317('0x0')](_0x501cea,{'typecast':!![]});if(_0x276133[_0xd317('0xb')]){logger[_0xd317('0xc')](_0xd317('0xd'),_0x88c0a5,_[_0xd317('0xe')](_0x276133,_0xd317('0xf'))['join'](',\x20'));_0x3d5177['stop']();}else{try{var _0x382e21=eval('('+_0x501cea[_0xd317('0x10')]+')');var _0x46c8c8=_0x382e21?_0x501cea[_0xd317('0x11')]:_0x501cea[_0xd317('0x12')];logger[_0xd317('0x13')](_0xd317('0x14'),_0x88c0a5,_0x501cea['condition'],_0x382e21,_0x46c8c8||'next');if(_0x46c8c8){var _0x245e91=_[_0xd317('0x15')](_0x3d5177[_0xd317('0x16')](),{'p':_0x46c8c8});if(_0x245e91>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x88c0a5,_0x46c8c8||'next',_0x245e91);_0x3d5177[_0xd317('0x17')](_0x245e91);}else{logger[_0xd317('0x13')](_0xd317('0x18'),_0x88c0a5,_0x46c8c8||_0xd317('0x17'));_0x3d5177[_0xd317('0x19')]();}}else{_0x3d5177[_0xd317('0x17')]();}}catch(_0x50f1c5){logger[_0xd317('0xc')](_0xd317('0x1a'),_0x88c0a5,_0x50f1c5[_0xd317('0xf')]);_0x3d5177[_0xd317('0x19')]();}}}catch(_0x1697be){logger[_0xd317('0xc')]('[%s][GOTOIF]\x20%s',_0x88c0a5,JSON[_0xd317('0x1b')](_0x1697be));_0x3d5177['stop']();}};}; \ No newline at end of file +var _0x0899=['validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','[%s][GOTOIF]\x20%s','join','stop','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20eval\x20error:\x20%s','message','error','stringify'];(function(_0x9f1ff,_0x1a095f){var _0x48b64b=function(_0x489287){while(--_0x489287){_0x9f1ff['push'](_0x9f1ff['shift']());}};_0x48b64b(++_0x1a095f);}(_0x0899,0xc4));var _0x9089=function(_0x5a5ccd,_0xd4573){_0x5a5ccd=_0x5a5ccd-0x0;var _0x8c7d45=_0x0899[_0x5a5ccd];return _0x8c7d45;};'use strict';var schema=require(_0x9089('0x0'));var _=require(_0x9089('0x1'));var htmlToText=require(_0x9089('0x2'));var utils=require(_0x9089('0x3'));var logger=require(_0x9089('0x4'))(_0x9089('0x5'));var gotoif=schema({'condition':{'type':_0x9089('0x6'),'required':!![],'message':_0x9089('0x7')},'priorityTrue':{'type':_0x9089('0x8'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x9089('0x8'),'message':_0x9089('0x9')}});exports[_0x9089('0xa')]=function(_0x22a0ad,_0x29d783){return function(_0x5684ed){try{var _0x26881e={'condition':htmlToText[_0x9089('0xb')](utils[_0x9089('0xc')](_0x29d783[0x0],this),{'wordwrap':![]})[_0x9089('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x29d783[0x1],'priorityFalse':_0x29d783[0x2]};var _0x55153d=gotoif[_0x9089('0x0')](_0x26881e,{'typecast':!![]});if(_0x55153d['length']){logger['error'](_0x9089('0xe'),_0x22a0ad,_['map'](_0x55153d,'message')[_0x9089('0xf')](',\x20'));_0x5684ed[_0x9089('0x10')]();}else{try{var _0x44e556=eval('('+_0x26881e['condition']+')');var _0x429e02=_0x44e556?_0x26881e[_0x9089('0x11')]:_0x26881e[_0x9089('0x12')];logger[_0x9089('0x13')](_0x9089('0x14'),_0x22a0ad,_0x26881e[_0x9089('0x15')],_0x44e556,_0x429e02||_0x9089('0x16'));if(_0x429e02){var _0x2c535b=_['findIndex'](_0x5684ed['rules'](),{'p':_0x429e02});if(_0x2c535b>=0x0){logger['info'](_0x9089('0x17'),_0x22a0ad,_0x429e02||_0x9089('0x16'),_0x2c535b);_0x5684ed['next'](_0x2c535b);}else{logger[_0x9089('0x13')]('[%s][GOTOIF]\x20priority\x20%s\x20not\x20found',_0x22a0ad,_0x429e02||_0x9089('0x16'));_0x5684ed['stop']();}}else{_0x5684ed[_0x9089('0x16')]();}}catch(_0x204bef){logger['error'](_0x9089('0x18'),_0x22a0ad,_0x204bef[_0x9089('0x19')]);_0x5684ed['stop']();}}}catch(_0xd3cbbf){logger[_0x9089('0x1a')](_0x9089('0xe'),_0x22a0ad,JSON[_0x9089('0x1b')](_0xd3cbbf));_0x5684ed['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 14eee66..9a6f90b 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 _0x52d3=['lodash','../../../../config/logger','routing','number','message','join','info','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stop','error','stringify','validate'];(function(_0x500f82,_0x3a8dc1){var _0x2b00fe=function(_0x59628f){while(--_0x59628f){_0x500f82['push'](_0x500f82['shift']());}};_0x2b00fe(++_0x3a8dc1);}(_0x52d3,0x149));var _0x352d=function(_0x409159,_0x4cea7c){_0x409159=_0x409159-0x0;var _0x484de1=_0x52d3[_0x409159];return _0x484de1;};'use strict';var schema=require(_0x352d('0x0'));var _=require(_0x352d('0x1'));var logger=require(_0x352d('0x2'))(_0x352d('0x3'));var gotop=schema({'priority':{'type':_0x352d('0x4'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports['consequence']=function(_0x1f197f,_0x147529){return function(_0x4c00b9){try{var _0x2f9064={'priority':_0x147529[0x0]};var _0x501808=gotop[_0x352d('0x0')](_0x2f9064,{'typecast':!![]});if(_0x501808['length']){logger['error']('[%s][GOTOP]\x20%s',_0x1f197f,_['map'](_0x501808,_0x352d('0x5'))[_0x352d('0x6')](',\x20'));_0x4c00b9['stop']();}else{logger[_0x352d('0x7')]('[%s][GOTOP]\x20priority\x20%s',_0x1f197f,_0x2f9064[_0x352d('0x8')]);if(_0x2f9064[_0x352d('0x8')]){var _0x5ce9fd=_[_0x352d('0x9')](_0x4c00b9['rules'](),{'p':_0x2f9064[_0x352d('0x8')]});if(_0x5ce9fd>=0x0){logger['info'](_0x352d('0xa'),_0x1f197f,_0x2f9064[_0x352d('0x8')]||_0x352d('0xb'),_0x5ce9fd);_0x4c00b9['next'](_0x5ce9fd);}else{logger[_0x352d('0x7')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x1f197f,_0x2f9064[_0x352d('0x8')]||_0x352d('0xb'));_0x4c00b9[_0x352d('0xc')]();}}else{_0x4c00b9[_0x352d('0xb')]();}}}catch(_0x3ae400){logger[_0x352d('0xd')]('[%s][GOTOP]\x20%s',_0x1f197f,JSON[_0x352d('0xe')](_0x3ae400));_0x4c00b9[_0x352d('0xc')]();}};}; \ No newline at end of file +var _0xd875=['rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','consequence','length','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex'];(function(_0xeb84f1,_0x35fb01){var _0x4e8071=function(_0x6e4145){while(--_0x6e4145){_0xeb84f1['push'](_0xeb84f1['shift']());}};_0x4e8071(++_0x35fb01);}(_0xd875,0x83));var _0x5d87=function(_0x48ea83,_0xb7b30b){_0x48ea83=_0x48ea83-0x0;var _0x1f6925=_0xd875[_0x48ea83];return _0x1f6925;};'use strict';var schema=require(_0x5d87('0x0'));var _=require('lodash');var logger=require(_0x5d87('0x1'))(_0x5d87('0x2'));var gotop=schema({'priority':{'type':_0x5d87('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x5d87('0x4')]=function(_0x306ab3,_0x162d48){return function(_0x251cb3){try{var _0xa5f403={'priority':_0x162d48[0x0]};var _0x5e2c59=gotop[_0x5d87('0x0')](_0xa5f403,{'typecast':!![]});if(_0x5e2c59[_0x5d87('0x5')]){logger[_0x5d87('0x6')](_0x5d87('0x7'),_0x306ab3,_[_0x5d87('0x8')](_0x5e2c59,_0x5d87('0x9'))[_0x5d87('0xa')](',\x20'));_0x251cb3[_0x5d87('0xb')]();}else{logger[_0x5d87('0xc')](_0x5d87('0xd'),_0x306ab3,_0xa5f403['priority']);if(_0xa5f403[_0x5d87('0xe')]){var _0x26537d=_[_0x5d87('0xf')](_0x251cb3[_0x5d87('0x10')](),{'p':_0xa5f403[_0x5d87('0xe')]});if(_0x26537d>=0x0){logger['info'](_0x5d87('0x11'),_0x306ab3,_0xa5f403['priority']||'next',_0x26537d);_0x251cb3[_0x5d87('0x12')](_0x26537d);}else{logger['info'](_0x5d87('0x13'),_0x306ab3,_0xa5f403[_0x5d87('0xe')]||_0x5d87('0x12'));_0x251cb3[_0x5d87('0xb')]();}}else{_0x251cb3[_0x5d87('0x12')]();}}}catch(_0x455c8d){logger[_0x5d87('0x6')](_0x5d87('0x7'),_0x306ab3,JSON[_0x5d87('0x14')](_0x455c8d));_0x251cb3[_0x5d87('0xb')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index acdd22f..c16f596 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 _0x9fda=['chat','ChatWebsiteId','upperFirst','AccountId','interaction','Message','create','then','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','stop','lodash','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel'];(function(_0x27bff7,_0x4fe0a6){var _0xfce1fa=function(_0x11e33f){while(--_0x11e33f){_0x27bff7['push'](_0x27bff7['shift']());}};_0xfce1fa(++_0x4fe0a6);}(_0x9fda,0x8c));var _0xa9fd=function(_0x3ef6b3,_0x192fe0){_0x3ef6b3=_0x3ef6b3-0x0;var _0x5e1251=_0x9fda[_0x3ef6b3];return _0x5e1251;};'use strict';var _=require(_0xa9fd('0x0'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xa9fd('0x1'));var rpc={'chatMessage':require(_0xa9fd('0x2')),'openchannelMessage':require(_0xa9fd('0x3')),'mailMessage':require(_0xa9fd('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xa9fd('0x5')),'whatsappMessage':require(_0xa9fd('0x6'))};exports['consequence']=function(_0x190386,_0x13b765){return function(_0x4eb431){try{var _0x5f2d27={'body':utils[_0xa9fd('0x7')](_0x13b765[0x0],this),'ContactId':this[_0xa9fd('0x8')]['id']};if(this[_0xa9fd('0x9')]===_0xa9fd('0xa')){_0x5f2d27[_0xa9fd('0xb')]=this['account']['id'];}else{_0x5f2d27[_[_0xa9fd('0xc')](this[_0xa9fd('0x9')])+_0xa9fd('0xd')]=this['account']['id'];}_0x5f2d27[_[_0xa9fd('0xc')](this['channel'])+'InteractionId']=this[_0xa9fd('0xe')]['id'];if(rpc[this[_0xa9fd('0x9')]+_0xa9fd('0xf')]){return rpc[this['channel']+_0xa9fd('0xf')][_0xa9fd('0x10')](_0x5f2d27)[_0xa9fd('0x11')](function(_0x3ac1c3){logger['info'](_0xa9fd('0x12'),_0x190386,_0x5f2d27[_0xa9fd('0x13')]);_0x4eb431[_0xa9fd('0x14')]();})[_0xa9fd('0x15')](function(_0x917449){logger[_0xa9fd('0x16')](_0xa9fd('0x12'),_0x190386,JSON[_0xa9fd('0x17')](_0x917449));_0x4eb431['stop']();});}}catch(_0x29eca3){logger[_0xa9fd('0x16')]('[%s][MESSAGE]\x20%s',_0x190386,JSON['stringify'](_0x29eca3));_0x4eb431[_0xa9fd('0x18')]();}};}; \ No newline at end of file +var _0x2977=['../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','contact','ChatWebsiteId','upperFirst','channel','AccountId','InteractionId','interaction','then','info','body','error','[%s][MESSAGE]\x20%s','stringify','stop','lodash','../../../../config/logger','routing'];(function(_0x411416,_0x35923a){var _0x395e39=function(_0x4bd401){while(--_0x4bd401){_0x411416['push'](_0x411416['shift']());}};_0x395e39(++_0x35923a);}(_0x2977,0xa5));var _0x7297=function(_0x56ba73,_0x3990f0){_0x56ba73=_0x56ba73-0x0;var _0x588e79=_0x2977[_0x56ba73];return _0x588e79;};'use strict';var _=require(_0x7297('0x0'));var utils=require('./utils');var logger=require(_0x7297('0x1'))(_0x7297('0x2'));var rpc={'chatMessage':require(_0x7297('0x3')),'openchannelMessage':require(_0x7297('0x4')),'mailMessage':require(_0x7297('0x5')),'smsMessage':require(_0x7297('0x6')),'faxMessage':require(_0x7297('0x7')),'whatsappMessage':require(_0x7297('0x8'))};exports[_0x7297('0x9')]=function(_0x857d39,_0x5c1b97){return function(_0x55087b){try{var _0xc9e570={'body':utils['getMustacheRender'](_0x5c1b97[0x0],this),'ContactId':this[_0x7297('0xa')]['id']};if(this['channel']==='chat'){_0xc9e570[_0x7297('0xb')]=this['account']['id'];}else{_0xc9e570[_[_0x7297('0xc')](this[_0x7297('0xd')])+_0x7297('0xe')]=this['account']['id'];}_0xc9e570[_['upperFirst'](this[_0x7297('0xd')])+_0x7297('0xf')]=this[_0x7297('0x10')]['id'];if(rpc[this[_0x7297('0xd')]+'Message']){return rpc[this[_0x7297('0xd')]+'Message']['create'](_0xc9e570)[_0x7297('0x11')](function(_0x47b4cb){logger[_0x7297('0x12')]('[%s][MESSAGE]\x20%s',_0x857d39,_0xc9e570[_0x7297('0x13')]);_0x55087b['next']();})['catch'](function(_0x1bc1e2){logger[_0x7297('0x14')](_0x7297('0x15'),_0x857d39,JSON[_0x7297('0x16')](_0x1bc1e2));_0x55087b[_0x7297('0x17')]();});}}catch(_0xcd2e5f){logger[_0x7297('0x14')](_0x7297('0x15'),_0x857d39,JSON['stringify'](_0xcd2e5f));_0x55087b['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 b3dfa48..8ada241 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 _0x50c2=['./utils','../../../../config/logger','routing','consequence','getMustacheRender','next','stop'];(function(_0x558cd3,_0x280fd1){var _0x4ba959=function(_0x533619){while(--_0x533619){_0x558cd3['push'](_0x558cd3['shift']());}};_0x4ba959(++_0x280fd1);}(_0x50c2,0x149));var _0x250c=function(_0x39aa30,_0x12dec8){_0x39aa30=_0x39aa30-0x0;var _0x1b1fa6=_0x50c2[_0x39aa30];return _0x1b1fa6;};'use strict';var utils=require(_0x250c('0x0'));var logger=require(_0x250c('0x1'))(_0x250c('0x2'));exports[_0x250c('0x3')]=function(_0x3ac260,_0x51fabd){return function(_0x6a68c5){try{logger['info']('[%s][NOOP]\x20%s',_0x3ac260,utils[_0x250c('0x4')](_0x51fabd[0x0],this));_0x6a68c5[_0x250c('0x5')]();}catch(_0x49235d){logger['error']('[%s][NOOP]\x20%s',_0x3ac260,JSON['stringify'](_0x49235d));_0x6a68c5[_0x250c('0x6')]();}};}; \ No newline at end of file +var _0x3c86=['info','[%s][NOOP]\x20%s','getMustacheRender','./utils','../../../../config/logger'];(function(_0x37ee8d,_0x15ca01){var _0x125c82=function(_0x5e5f39){while(--_0x5e5f39){_0x37ee8d['push'](_0x37ee8d['shift']());}};_0x125c82(++_0x15ca01);}(_0x3c86,0x1bb));var _0x63c8=function(_0x515365,_0x1916ee){_0x515365=_0x515365-0x0;var _0x3f20d8=_0x3c86[_0x515365];return _0x3f20d8;};'use strict';var utils=require(_0x63c8('0x0'));var logger=require(_0x63c8('0x1'))('routing');exports['consequence']=function(_0x2b8c49,_0x44d57f){return function(_0x3bd879){try{logger[_0x63c8('0x2')](_0x63c8('0x3'),_0x2b8c49,utils[_0x63c8('0x4')](_0x44d57f[0x0],this));_0x3bd879['next']();}catch(_0x825331){logger['error'](_0x63c8('0x3'),_0x2b8c49,JSON['stringify'](_0x825331));_0x3bd879['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 41efacd..94be635 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 _0x8f22=['complete','[%s][QUEUE]\x20APPLICATION\x20END','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','from','joinAt','emit','queue_id','queue','account','format','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','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','QueueId','channel','interaction','MessageId','message','chat','AccountId','WebsiteId','info','name','QueueReport','catch','accepted','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','toLowerCase','consequence','length','map','join','stop','find','createQueue','atimeout','qtimeout','close','rules'];(function(_0x372b65,_0x30acef){var _0x4988fa=function(_0x43fd07){while(--_0x43fd07){_0x372b65['push'](_0x372b65['shift']());}};_0x4988fa(++_0x30acef);}(_0x8f22,0x1e3));var _0x28f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f22[_0x42cae2];return _0x5f256f;};'use strict';var schema=require(_0x28f2('0x0'));var _=require(_0x28f2('0x1'));var util=require(_0x28f2('0x2'));var seqqueue=require(_0x28f2('0x3'));var moment=require(_0x28f2('0x4'));var Redis=require(_0x28f2('0x5'));var config=require(_0x28f2('0x6'));var logger=require(_0x28f2('0x7'))(_0x28f2('0x8'));var strategy=require(_0x28f2('0x9'));config[_0x28f2('0xa')]=_[_0x28f2('0xb')](config[_0x28f2('0xa')],{'host':_0x28f2('0xc'),'port':0x18eb});var io=require(_0x28f2('0xd'))(new Redis(config[_0x28f2('0xa')]));var attributes=['id','queue_id','account','queue',_0x28f2('0xe'),_0x28f2('0xf')];function emit(_0x26fa02,_0x218c62,_0x92c4ff){io['to'](_0x26fa02)[_0x28f2('0x10')](_0x218c62,_0x92c4ff);}function emitChannelQueueInteraction(_0x50ee94,_0x228be2,_0x5c03d9,_0x2c85b2,_0x3b6336,_0x22d2c1,_0x5102c0,_0x1b9166){var _0x28c57b=_['clone'](_0x5c03d9);_0x28c57b[_0x28f2('0x11')]=_0x1b9166;_0x28c57b[_0x28f2('0x12')]=_0x228be2;_0x28c57b[_0x28f2('0x13')]=_0x2c85b2;_0x28c57b['id']=_0x3b6336;if(_0x22d2c1){_0x5102c0[util[_0x28f2('0x14')]('%sQueuesWaitingInteractions',_0x50ee94)][_0x3b6336]=_[_0x28f2('0x15')](_0x28c57b,attributes);}else{delete _0x5102c0[util[_0x28f2('0x14')](_0x28f2('0x16'),_0x50ee94)][_0x3b6336];}emit(util['format'](_0x28f2('0x17'),_0x50ee94,_0x228be2),util['format'](_0x28f2('0x18'),_0x50ee94,_0x22d2c1?_0x28f2('0x19'):_0x28f2('0x1a')),_[_0x28f2('0x15')](_0x28c57b,attributes));}var rpc={'openchannelQueueReport':require(_0x28f2('0x1b')),'mailQueueReport':require(_0x28f2('0x1c')),'chatQueueReport':require(_0x28f2('0x1d')),'smsQueueReport':require(_0x28f2('0x1e')),'faxQueueReport':require(_0x28f2('0x1f')),'whatsappQueueReport':require(_0x28f2('0x20'))};var queue=schema({'name':{'type':_0x28f2('0x21'),'required':!![],'message':_0x28f2('0x22')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x21a093,_0x2cab96,_0x80869a,_0x2cc3b3){if(_0x21a093&&_0x2cab96&&_0x80869a){_0x2cab96[_0x28f2('0x23')]+=0x1;var _0x312da1={'uniqueid':_0x21a093,'from':_0x80869a[_0x28f2('0x24')]?_0x80869a[_0x28f2('0x24')][_0x28f2('0xe')]:'','joinAt':moment()['format'](_0x28f2('0x25')),'ContactId':_0x80869a[_0x28f2('0x26')]?_0x80869a[_0x28f2('0x26')]['id']:null,'ListId':_0x80869a['list']?_0x80869a[_0x28f2('0x27')]['id']:null};_0x312da1[_['upperFirst'](_0x80869a['channel'])+_0x28f2('0x28')]=_0x2cab96['id']||null;_0x312da1[_['upperFirst'](_0x80869a[_0x28f2('0x29')])+'InteractionId']=_0x80869a[_0x28f2('0x2a')]?_0x80869a[_0x28f2('0x2a')]['id']:null;_0x312da1[_['upperFirst'](_0x80869a['channel'])+_0x28f2('0x2b')]=_0x80869a['message']?_0x80869a[_0x28f2('0x2c')]['id']:null;_0x312da1[_['upperFirst'](_0x80869a[_0x28f2('0x29')])+(_0x80869a[_0x28f2('0x29')]!==_0x28f2('0x2d')?_0x28f2('0x2e'):_0x28f2('0x2f'))]=_0x80869a['account']?_0x80869a[_0x28f2('0x13')]['id']:null;logger[_0x28f2('0x30')](util[_0x28f2('0x14')]('[%s][START:QUEUE][NAME:%s]',_0x21a093,_0x2cab96[_0x28f2('0x31')]));emitChannelQueueInteraction(_0x80869a[_0x28f2('0x29')],_0x2cab96[_0x28f2('0x31')],_0x312da1,_0x80869a['account']['name'],_0x80869a[_0x28f2('0x2c')]['id'],!![],_0x2cc3b3,_0x2cab96['id']);if(rpc[_0x80869a[_0x28f2('0x29')]+'QueueReport']){return rpc[_0x80869a[_0x28f2('0x29')]+_0x28f2('0x32')]['create'](_0x312da1)[_0x28f2('0x33')](function(_0x148f96){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0xf0270a,_0x129743,_0x4f5a7b,_0x371889){if(_0xf0270a&&_0x129743){_0x129743[_0x28f2('0x23')]-=0x1;var _0x2faaab={'leaveAt':moment()[_0x28f2('0x14')](_0x28f2('0x25')),'acceptAt':moment()[_0x28f2('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x28f2('0x34')};logger['info'](util[_0x28f2('0x14')](_0x28f2('0x35'),_0xf0270a,_0x129743[_0x28f2('0x31')]));emitChannelQueueInteraction(_0x4f5a7b['channel'],_0x129743[_0x28f2('0x31')],_0x4f5a7b[_0x28f2('0x24')],_0x4f5a7b[_0x28f2('0x13')][_0x28f2('0x31')],_0x4f5a7b['message']['id'],![],_0x371889,_0x129743['id']);if(rpc[_0x4f5a7b[_0x28f2('0x29')]+_0x28f2('0x32')]){return rpc[_0x4f5a7b[_0x28f2('0x29')]+'QueueReport'][_0x28f2('0x36')](_0xf0270a,_0x2faaab)[_0x28f2('0x33')](function(_0x45a759){logger[_0x28f2('0x37')](_0x28f2('0x38'));});}}}function endRouting(_0x38b7ec,_0x14adc4,_0x22ba2e,_0x72adfb){if(_0x38b7ec&&_0x14adc4){_0x14adc4['waiting']-=0x1;var _0x17e123={'leaveAt':moment()['format'](_0x28f2('0x25')),'exitAt':moment()['format'](_0x28f2('0x25')),'reason':_0x28f2('0x39')};logger[_0x28f2('0x30')](util[_0x28f2('0x14')]('[%s][END:QUEUE][NAME:%s]',_0x38b7ec,_0x14adc4[_0x28f2('0x31')]));emitChannelQueueInteraction(_0x22ba2e[_0x28f2('0x29')],_0x14adc4[_0x28f2('0x31')],_0x22ba2e[_0x28f2('0x24')],_0x22ba2e['account']['name'],_0x22ba2e[_0x28f2('0x2c')]['id'],![],_0x72adfb);if(rpc[_0x22ba2e['channel']+_0x28f2('0x32')]){return rpc[_0x22ba2e['channel']+_0x28f2('0x32')]['update'](_0x38b7ec,_0x17e123)[_0x28f2('0x33')](function(_0x50e6d8){logger[_0x28f2('0x37')](_0x28f2('0x38'));});}}}function handleFindQueue(_0x51096b){return function(_0x3fb287){return _0x3fb287['name'][_0x28f2('0x3a')]()===_0x51096b[_0x28f2('0x3a')]();};}exports[_0x28f2('0x3b')]=function(_0x30536e,_0x5c7d76,_0x20bf4b,_0xb2f142){return function(_0x21c88b){try{var _0x10087d={'name':_0x5c7d76[0x0],'timeout':_0x5c7d76[0x1]};var _0x243b0a=queue[_0x28f2('0x0')](_0x10087d,{'typecast':!![]});if(_0x243b0a[_0x28f2('0x3c')]){logger['error']('[%s][QUEUE]\x20%s',_0x30536e,_[_0x28f2('0x3d')](_0x243b0a,_0x28f2('0x2c'))[_0x28f2('0x3e')](',\x20'));_0x21c88b[_0x28f2('0x3f')]();}else{var _0x238e01=_[_0x28f2('0x40')](_0x20bf4b[_0xb2f142[_0x28f2('0x29')]+'Queues'],handleFindQueue(_0x10087d[_0x28f2('0x31')]));if(_0x238e01){startRouting(_0x30536e,_0x238e01,_0xb2f142,_0x20bf4b);var _0x3ce021=(_0x238e01['timeout']||0xa)*0x3e8;var _0x6425a0=(_0x10087d[_0x28f2('0x39')]||0x14)*0x3e8;var _0x339567,_0x5b26ae;if(_0x3ce021>_0x6425a0){_0x6425a0=_0x3ce021;}var _0x3f168b=seqqueue[_0x28f2('0x41')](_0x3ce021);_0x3f168b['id']=_0x30536e;_0x3f168b[_0x28f2('0x42')]=_0x3ce021;_0x3f168b[_0x28f2('0x43')]=_0x6425a0;_0x3f168b['channel']=_0xb2f142['channel'];_0x20bf4b['rules'][_0x30536e]['on']('end',function(){logger[_0x28f2('0x30')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x30536e);stopRouting(_0x30536e,_0x238e01,_0xb2f142,_0x20bf4b);clearTimeout(_0x339567);_0x339567=undefined;_0x3f168b[_0x28f2('0x44')](!![]);if(_0x20bf4b[_0x28f2('0x45')][_0x30536e]){delete _0x20bf4b[_0x28f2('0x45')][_0x30536e];}_0x21c88b[_0x28f2('0x3f')]();});_0x20bf4b[_0x28f2('0x45')][_0x30536e]['on'](_0x28f2('0x46'),function(){if(_0x20bf4b[_0x28f2('0x45')][_0x30536e]){delete _0x20bf4b[_0x28f2('0x45')][_0x30536e];}});_0x339567=setTimeout(function(){logger['info'](_0x28f2('0x47'),_0x30536e);endRouting(_0x30536e,_0x238e01,_0xb2f142,_0x20bf4b);clearTimeout(_0x339567);_0x3f168b[_0x28f2('0x44')](!![]);_0x21c88b[_0x28f2('0x48')]();},_0x6425a0);switch(_0x238e01['strategy']){case _0x28f2('0x49'):strategy[_0x28f2('0x49')](_0x3f168b,_0x238e01,_0x20bf4b,_0xb2f142);break;default:strategy[_0x28f2('0x4a')](_0x3f168b,_0x238e01,_0x20bf4b,_0xb2f142);}}else{logger['error'](_0x28f2('0x4b'),_0x30536e,_0x10087d['name']);_0x21c88b['stop']();}}}catch(_0x34df2b){console[_0x28f2('0x4c')](_0x34df2b);logger['error'](_0x28f2('0x4d'),_0x30536e,_0x34df2b[_0x28f2('0x4e')]);_0x21c88b['stop']();}};}; \ No newline at end of file +var _0x83cd=['%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport','../../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','MessageId','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','message','QueueReport','create','catch','error','accepted','[%s][STOP:QUEUE][NAME:%s]','timeout','update','update\x20queue\x20report','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','rules','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','lodash','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','account','from','emit','clone','queue','format','%sQueuesWaitingInteractions','pick','%s:queue:%s'];(function(_0x313e3d,_0x2d149f){var _0x3989d0=function(_0x91af6a){while(--_0x91af6a){_0x313e3d['push'](_0x313e3d['shift']());}};_0x3989d0(++_0x2d149f);}(_0x83cd,0x17b));var _0xd83c=function(_0x268d41,_0x493eb8){_0x268d41=_0x268d41-0x0;var _0x3a1a10=_0x83cd[_0x268d41];return _0x3a1a10;};'use strict';var schema=require(_0xd83c('0x0'));var _=require(_0xd83c('0x1'));var util=require(_0xd83c('0x2'));var seqqueue=require(_0xd83c('0x3'));var moment=require(_0xd83c('0x4'));var Redis=require('ioredis');var config=require(_0xd83c('0x5'));var logger=require(_0xd83c('0x6'))(_0xd83c('0x7'));var strategy=require(_0xd83c('0x8'));config['redis']=_[_0xd83c('0x9')](config[_0xd83c('0xa')],{'host':_0xd83c('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd83c('0xa')]));var attributes=['id','queue_id',_0xd83c('0xc'),'queue',_0xd83c('0xd'),'joinAt'];function emit(_0x24e20c,_0x34ec60,_0x1dfb1d){io['to'](_0x24e20c)[_0xd83c('0xe')](_0x34ec60,_0x1dfb1d);}function emitChannelQueueInteraction(_0x226c96,_0x415853,_0x33a934,_0x4fa25c,_0x3f6e36,_0x4a4035,_0x50057c,_0x12f0a0){var _0x19c134=_[_0xd83c('0xf')](_0x33a934);_0x19c134['queue_id']=_0x12f0a0;_0x19c134[_0xd83c('0x10')]=_0x415853;_0x19c134[_0xd83c('0xc')]=_0x4fa25c;_0x19c134['id']=_0x3f6e36;if(_0x4a4035){_0x50057c[util[_0xd83c('0x11')](_0xd83c('0x12'),_0x226c96)][_0x3f6e36]=_[_0xd83c('0x13')](_0x19c134,attributes);}else{delete _0x50057c[util[_0xd83c('0x11')](_0xd83c('0x12'),_0x226c96)][_0x3f6e36];}emit(util['format'](_0xd83c('0x14'),_0x226c96,_0x415853),util['format'](_0xd83c('0x15'),_0x226c96,_0x4a4035?_0xd83c('0x16'):_0xd83c('0x17')),_[_0xd83c('0x13')](_0x19c134,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0xd83c('0x18')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0xd83c('0x19')),'whatsappQueueReport':require(_0xd83c('0x1a'))};var queue=schema({'name':{'type':_0xd83c('0x1b'),'required':!![],'message':_0xd83c('0x1c')},'timeout':{'type':_0xd83c('0x1d'),'message':_0xd83c('0x1e')}});function startRouting(_0x2810b3,_0x29cf75,_0x1f95b8,_0x24fa52){if(_0x2810b3&&_0x29cf75&&_0x1f95b8){_0x29cf75[_0xd83c('0x1f')]+=0x1;var _0x30d96c={'uniqueid':_0x2810b3,'from':_0x1f95b8[_0xd83c('0x20')]?_0x1f95b8['body'][_0xd83c('0xd')]:'','joinAt':moment()[_0xd83c('0x11')](_0xd83c('0x21')),'ContactId':_0x1f95b8[_0xd83c('0x22')]?_0x1f95b8[_0xd83c('0x22')]['id']:null,'ListId':_0x1f95b8[_0xd83c('0x23')]?_0x1f95b8[_0xd83c('0x23')]['id']:null};_0x30d96c[_[_0xd83c('0x24')](_0x1f95b8[_0xd83c('0x25')])+_0xd83c('0x26')]=_0x29cf75['id']||null;_0x30d96c[_[_0xd83c('0x24')](_0x1f95b8[_0xd83c('0x25')])+_0xd83c('0x27')]=_0x1f95b8[_0xd83c('0x28')]?_0x1f95b8[_0xd83c('0x28')]['id']:null;_0x30d96c[_[_0xd83c('0x24')](_0x1f95b8['channel'])+_0xd83c('0x29')]=_0x1f95b8['message']?_0x1f95b8['message']['id']:null;_0x30d96c[_['upperFirst'](_0x1f95b8[_0xd83c('0x25')])+(_0x1f95b8['channel']!==_0xd83c('0x2a')?_0xd83c('0x2b'):'WebsiteId')]=_0x1f95b8[_0xd83c('0xc')]?_0x1f95b8[_0xd83c('0xc')]['id']:null;logger[_0xd83c('0x2c')](util['format'](_0xd83c('0x2d'),_0x2810b3,_0x29cf75[_0xd83c('0x2e')]));emitChannelQueueInteraction(_0x1f95b8[_0xd83c('0x25')],_0x29cf75['name'],_0x30d96c,_0x1f95b8[_0xd83c('0xc')][_0xd83c('0x2e')],_0x1f95b8[_0xd83c('0x2f')]['id'],!![],_0x24fa52,_0x29cf75['id']);if(rpc[_0x1f95b8['channel']+_0xd83c('0x30')]){return rpc[_0x1f95b8[_0xd83c('0x25')]+_0xd83c('0x30')][_0xd83c('0x31')](_0x30d96c)[_0xd83c('0x32')](function(_0x1fd8c1){logger[_0xd83c('0x33')]('create\x20queue\x20report');});}}}function stopRouting(_0x316df7,_0xaec462,_0x173201,_0x4e8e2a){if(_0x316df7&&_0xaec462){_0xaec462[_0xd83c('0x1f')]-=0x1;var _0x4f0da6={'leaveAt':moment()['format'](_0xd83c('0x21')),'acceptAt':moment()[_0xd83c('0x11')](_0xd83c('0x21')),'reason':_0xd83c('0x34')};logger[_0xd83c('0x2c')](util[_0xd83c('0x11')](_0xd83c('0x35'),_0x316df7,_0xaec462[_0xd83c('0x2e')]));emitChannelQueueInteraction(_0x173201[_0xd83c('0x25')],_0xaec462[_0xd83c('0x2e')],_0x173201[_0xd83c('0x20')],_0x173201['account']['name'],_0x173201['message']['id'],![],_0x4e8e2a,_0xaec462['id']);if(rpc[_0x173201[_0xd83c('0x25')]+'QueueReport']){return rpc[_0x173201[_0xd83c('0x25')]+_0xd83c('0x30')]['update'](_0x316df7,_0x4f0da6)[_0xd83c('0x32')](function(_0x40a01f){logger['error']('update\x20queue\x20report');});}}}function endRouting(_0x42636c,_0xf22368,_0x56ba02,_0x5ba903){if(_0x42636c&&_0xf22368){_0xf22368['waiting']-=0x1;var _0x313094={'leaveAt':moment()[_0xd83c('0x11')](_0xd83c('0x21')),'exitAt':moment()[_0xd83c('0x11')](_0xd83c('0x21')),'reason':_0xd83c('0x36')};logger[_0xd83c('0x2c')](util['format']('[%s][END:QUEUE][NAME:%s]',_0x42636c,_0xf22368[_0xd83c('0x2e')]));emitChannelQueueInteraction(_0x56ba02[_0xd83c('0x25')],_0xf22368['name'],_0x56ba02['body'],_0x56ba02[_0xd83c('0xc')][_0xd83c('0x2e')],_0x56ba02[_0xd83c('0x2f')]['id'],![],_0x5ba903);if(rpc[_0x56ba02[_0xd83c('0x25')]+_0xd83c('0x30')]){return rpc[_0x56ba02[_0xd83c('0x25')]+_0xd83c('0x30')][_0xd83c('0x37')](_0x42636c,_0x313094)[_0xd83c('0x32')](function(_0x5a4a59){logger[_0xd83c('0x33')](_0xd83c('0x38'));});}}}function handleFindQueue(_0x2e9965){return function(_0x5bf1cd){return _0x5bf1cd[_0xd83c('0x2e')][_0xd83c('0x39')]()===_0x2e9965['toLowerCase']();};}exports[_0xd83c('0x3a')]=function(_0x39d451,_0x3ecce6,_0x5dd87f,_0x3bbfe2){return function(_0x362aa1){try{var _0x1a58c9={'name':_0x3ecce6[0x0],'timeout':_0x3ecce6[0x1]};var _0x53249a=queue[_0xd83c('0x0')](_0x1a58c9,{'typecast':!![]});if(_0x53249a[_0xd83c('0x3b')]){logger[_0xd83c('0x33')](_0xd83c('0x3c'),_0x39d451,_[_0xd83c('0x3d')](_0x53249a,_0xd83c('0x2f'))[_0xd83c('0x3e')](',\x20'));_0x362aa1[_0xd83c('0x3f')]();}else{var _0x1d6f93=_[_0xd83c('0x40')](_0x5dd87f[_0x3bbfe2[_0xd83c('0x25')]+_0xd83c('0x41')],handleFindQueue(_0x1a58c9['name']));if(_0x1d6f93){startRouting(_0x39d451,_0x1d6f93,_0x3bbfe2,_0x5dd87f);var _0x5f76b1=(_0x1d6f93[_0xd83c('0x36')]||0xa)*0x3e8;var _0x42dc6b=(_0x1a58c9[_0xd83c('0x36')]||0x14)*0x3e8;var _0x5f46c3,_0x3b9494;if(_0x5f76b1>_0x42dc6b){_0x42dc6b=_0x5f76b1;}var _0x7e5fa9=seqqueue[_0xd83c('0x42')](_0x5f76b1);_0x7e5fa9['id']=_0x39d451;_0x7e5fa9[_0xd83c('0x43')]=_0x5f76b1;_0x7e5fa9[_0xd83c('0x44')]=_0x42dc6b;_0x7e5fa9[_0xd83c('0x25')]=_0x3bbfe2[_0xd83c('0x25')];_0x5dd87f['rules'][_0x39d451]['on']('end',function(){logger[_0xd83c('0x2c')](_0xd83c('0x45'),_0x39d451);stopRouting(_0x39d451,_0x1d6f93,_0x3bbfe2,_0x5dd87f);clearTimeout(_0x5f46c3);_0x5f46c3=undefined;_0x7e5fa9[_0xd83c('0x46')](!![]);if(_0x5dd87f[_0xd83c('0x47')][_0x39d451]){delete _0x5dd87f[_0xd83c('0x47')][_0x39d451];}_0x362aa1[_0xd83c('0x3f')]();});_0x5dd87f[_0xd83c('0x47')][_0x39d451]['on'](_0xd83c('0x48'),function(){if(_0x5dd87f[_0xd83c('0x47')][_0x39d451]){delete _0x5dd87f['rules'][_0x39d451];}});_0x5f46c3=setTimeout(function(){logger[_0xd83c('0x2c')](_0xd83c('0x49'),_0x39d451);endRouting(_0x39d451,_0x1d6f93,_0x3bbfe2,_0x5dd87f);clearTimeout(_0x5f46c3);_0x7e5fa9[_0xd83c('0x46')](!![]);_0x362aa1[_0xd83c('0x4a')]();},_0x42dc6b);switch(_0x1d6f93[_0xd83c('0x4b')]){case'rrmemory':strategy[_0xd83c('0x4c')](_0x7e5fa9,_0x1d6f93,_0x5dd87f,_0x3bbfe2);break;default:strategy[_0xd83c('0x4d')](_0x7e5fa9,_0x1d6f93,_0x5dd87f,_0x3bbfe2);}}else{logger[_0xd83c('0x33')](_0xd83c('0x4e'),_0x39d451,_0x1a58c9['name']);_0x362aa1['stop']();}}}catch(_0x2b3a0d){console['log'](_0x2b3a0d);logger[_0xd83c('0x33')]('[%s][QUEUE]\x20%s',_0x39d451,_0x2b3a0d[_0xd83c('0x4f')]);_0x362aa1[_0xd83c('0x3f')]();}};}; \ 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 1317d20..0684847 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 _0x1f15=['handleTimeout','timeout','drained','prototype','handleRun','handleDrained','info','agent','isNil','forcedOwnership','isAgentAvailable','channel','agents','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy','STOP','TIMEOUT','exports','lodash','uuid','routing','notificationId','squeue','realtime','push','bind'];(function(_0x1df8e0,_0x24da37){var _0x29fbc5=function(_0x463659){while(--_0x463659){_0x1df8e0['push'](_0x1df8e0['shift']());}};_0x29fbc5(++_0x24da37);}(_0x1f15,0xe6));var _0x51f1=function(_0xaa1b9,_0x2f598d){_0xaa1b9=_0xaa1b9-0x0;var _0x50b620=_0x1f15[_0xaa1b9];return _0x50b620;};'use strict';var _=require(_0x51f1('0x0'));var uuid=require(_0x51f1('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')(_0x51f1('0x2'));var Agent=function(_0x5431f8,_0x10ea4d,_0x21a799,_0x2e50c5){this[_0x51f1('0x3')]=uuid['v4']();this[_0x51f1('0x4')]=_0x5431f8;this['agent']=_0x10ea4d;this[_0x51f1('0x5')]=_0x21a799;this[_0x51f1('0x2')]=_0x2e50c5;this['squeue'][_0x51f1('0x6')](this['handleRun'][_0x51f1('0x7')](this),this[_0x51f1('0x8')][_0x51f1('0x7')](this));this[_0x51f1('0x4')]['on'](_0x51f1('0x9'),this['handleTimeout'][_0x51f1('0x7')](this));this[_0x51f1('0x4')]['on'](_0x51f1('0xa'),this['handleDrained']['bind'](this));};Agent[_0x51f1('0xb')][_0x51f1('0x6')]=function(){this[_0x51f1('0x4')][_0x51f1('0x6')](this[_0x51f1('0xc')]['bind'](this),this[_0x51f1('0x8')][_0x51f1('0x7')](this));};Agent[_0x51f1('0xb')][_0x51f1('0xd')]=function(){this[_0x51f1('0x8')](!![]);};Agent[_0x51f1('0xb')]['handleRun']=function(_0xd3e80b){logger[_0x51f1('0xe')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x51f1('0x4')]['id'],this[_0x51f1('0xf')]['id']);if(_[_0x51f1('0x10')](this['realtime']['agents'][this[_0x51f1('0xf')]['id']])){logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x51f1('0x6')][_0x51f1('0x7')](this),0x3e8);}else{if(this['routing'][_0x51f1('0x11')]||util[_0x51f1('0x12')](this[_0x51f1('0x4')]['id'],this[_0x51f1('0x5')]['agents'][this[_0x51f1('0xf')]['id']],this[_0x51f1('0x4')][_0x51f1('0x13')],![])){this[_0x51f1('0x5')]['agents'][this['agent']['id']]['busy']=!![];this[_0x51f1('0x5')][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']][_0x51f1('0x15')]=undefined;util[_0x51f1('0x16')](this['notificationId'],this[_0x51f1('0x4')]['id'],this['realtime'][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']],null,this[_0x51f1('0x2')]);util[_0x51f1('0x17')](this[_0x51f1('0x4')]['id'],this[_0x51f1('0x5')][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']],_0x51f1('0x18')+(this[_0x51f1('0x2')]['forcedOwnership']?_0x51f1('0x19'):''));}else{logger[_0x51f1('0xe')](_0x51f1('0x1a'),this['squeue']['id'],this[_0x51f1('0xf')]['id']);setTimeout(this[_0x51f1('0x6')][_0x51f1('0x7')](this),0x3e8);}}};Agent[_0x51f1('0xb')][_0x51f1('0x8')]=function(_0x3443b1){if(_[_0x51f1('0x10')](this[_0x51f1('0x5')][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']])){return logger[_0x51f1('0xe')](_0x51f1('0x1b'),this[_0x51f1('0x4')]['id'],this[_0x51f1('0xf')]['id']);}else{logger['info'](_0x51f1('0x1c'),this[_0x51f1('0x4')]['id'],this[_0x51f1('0xf')]['id']);util[_0x51f1('0x1d')](this[_0x51f1('0x3')],this['squeue']['id'],this[_0x51f1('0x5')]['agents'][this[_0x51f1('0xf')]['id']],null,this[_0x51f1('0x2')]);this[_0x51f1('0x5')][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']][_0x51f1('0x1e')]=![];this['realtime'][_0x51f1('0x14')][this[_0x51f1('0xf')]['id']]['busyQueue']=undefined;util[_0x51f1('0x17')](this[_0x51f1('0x4')]['id'],this[_0x51f1('0x5')][_0x51f1('0x14')][this['agent']['id']],_0x3443b1?_0x51f1('0x1f'):_0x51f1('0x20'));}if(!_0x3443b1){setTimeout(this[_0x51f1('0x6')][_0x51f1('0x7')](this),0x3e8);}};function agent(_0x503188,_0x100ef7,_0x37ab46,_0x14edde){return new Agent(_0x503188,_0x100ef7,_0x37ab46,_0x14edde);}module[_0x51f1('0x21')]=agent; \ No newline at end of file +var _0x3db6=['prototype','handleRun','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','showNotification','notificationId','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','info','[%s][AGENT]\x20timeout\x20with\x20%s','STOP','exports','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','bind','handleTimeout','timeout','drained','handleDrained'];(function(_0x508ea6,_0x2fb8f0){var _0x2382ab=function(_0x4f2e76){while(--_0x4f2e76){_0x508ea6['push'](_0x508ea6['shift']());}};_0x2382ab(++_0x2fb8f0);}(_0x3db6,0x113));var _0x63db=function(_0x3401bc,_0x363d5f){_0x3401bc=_0x3401bc-0x0;var _0x335a36=_0x3db6[_0x3401bc];return _0x335a36;};'use strict';var _=require('lodash');var uuid=require(_0x63db('0x0'));var util=require(_0x63db('0x1'));var logger=require(_0x63db('0x2'))(_0x63db('0x3'));var Agent=function(_0x28443e,_0x385d61,_0x4f7cd7,_0xf5155a){this['notificationId']=uuid['v4']();this[_0x63db('0x4')]=_0x28443e;this[_0x63db('0x5')]=_0x385d61;this[_0x63db('0x6')]=_0x4f7cd7;this['routing']=_0xf5155a;this['squeue'][_0x63db('0x7')](this['handleRun'][_0x63db('0x8')](this),this[_0x63db('0x9')][_0x63db('0x8')](this));this[_0x63db('0x4')]['on'](_0x63db('0xa'),this['handleTimeout'][_0x63db('0x8')](this));this[_0x63db('0x4')]['on'](_0x63db('0xb'),this[_0x63db('0xc')]['bind'](this));};Agent[_0x63db('0xd')][_0x63db('0x7')]=function(){this[_0x63db('0x4')][_0x63db('0x7')](this[_0x63db('0xe')][_0x63db('0x8')](this),this[_0x63db('0x9')][_0x63db('0x8')](this));};Agent[_0x63db('0xd')][_0x63db('0xc')]=function(){this[_0x63db('0x9')](!![]);};Agent[_0x63db('0xd')][_0x63db('0xe')]=function(_0x4ec127){logger['info'](_0x63db('0xf'),this[_0x63db('0x4')]['id'],this[_0x63db('0x5')]['id']);if(_[_0x63db('0x10')](this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']])){logger['info'](_0x63db('0x12'),this[_0x63db('0x4')]['id'],this[_0x63db('0x5')]['id']);setTimeout(this[_0x63db('0x7')][_0x63db('0x8')](this),0x3e8);}else{if(this['routing'][_0x63db('0x13')]||util[_0x63db('0x14')](this['squeue']['id'],this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']],this[_0x63db('0x4')][_0x63db('0x15')],![])){this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']][_0x63db('0x16')]=!![];this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']]['busyQueue']=undefined;util[_0x63db('0x17')](this[_0x63db('0x18')],this[_0x63db('0x4')]['id'],this['realtime'][_0x63db('0x11')][this['agent']['id']],null,this['routing']);util[_0x63db('0x19')](this[_0x63db('0x4')]['id'],this[_0x63db('0x6')]['agents'][this[_0x63db('0x5')]['id']],_0x63db('0x1a')+(this['routing'][_0x63db('0x13')]?':FORCED':''));}else{logger['info'](_0x63db('0x1b'),this[_0x63db('0x4')]['id'],this['agent']['id']);setTimeout(this['push'][_0x63db('0x8')](this),0x3e8);}}};Agent[_0x63db('0xd')][_0x63db('0x9')]=function(_0x238e3b){if(_[_0x63db('0x10')](this[_0x63db('0x6')][_0x63db('0x11')][this['agent']['id']])){return logger[_0x63db('0x1c')](_0x63db('0x12'),this[_0x63db('0x4')]['id'],this['agent']['id']);}else{logger['info'](_0x63db('0x1d'),this['squeue']['id'],this[_0x63db('0x5')]['id']);util['hideNotification'](this[_0x63db('0x18')],this[_0x63db('0x4')]['id'],this['realtime'][_0x63db('0x11')][this[_0x63db('0x5')]['id']],null,this[_0x63db('0x3')]);this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']][_0x63db('0x16')]=![];this[_0x63db('0x6')][_0x63db('0x11')][this['agent']['id']]['busyQueue']=undefined;util[_0x63db('0x19')](this[_0x63db('0x4')]['id'],this[_0x63db('0x6')][_0x63db('0x11')][this[_0x63db('0x5')]['id']],_0x238e3b?_0x63db('0x1e'):'TIMEOUT');}if(!_0x238e3b){setTimeout(this[_0x63db('0x7')][_0x63db('0x8')](this),0x3e8);}};function agent(_0x3ec038,_0x2d99c2,_0xd41e76,_0x5c7263){return new Agent(_0x3ec038,_0x2d99c2,_0xd41e76,_0x5c7263);}module[_0x63db('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 992fd9a..3cd8956 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 _0x7676=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','agents','RINGING','busy','busyQueue','name','showNotification','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','STOP','exports','lodash','uuid','./util','routing','notificationId','squeue','queue','push','bind','handleTimeout','timeout','drained','handleDrained','prototype','handleRun','isNil','Agents','length','realtime','info'];(function(_0x3ee0b6,_0x25dfe0){var _0x4c18f0=function(_0x37d9b6){while(--_0x37d9b6){_0x3ee0b6['push'](_0x3ee0b6['shift']());}};_0x4c18f0(++_0x25dfe0);}(_0x7676,0xb8));var _0x6767=function(_0x9161ee,_0x1ed3b7){_0x9161ee=_0x9161ee-0x0;var _0x1a6190=_0x7676[_0x9161ee];return _0x1a6190;};'use strict';var _=require(_0x6767('0x0'));var uuid=require(_0x6767('0x1'));var util=require(_0x6767('0x2'));var logger=require('../../../../../config/logger')(_0x6767('0x3'));var Beepall=function(_0x478b23,_0x51f099,_0x1e86fc,_0x4bd37b){this[_0x6767('0x4')]=uuid['v4']();this[_0x6767('0x5')]=_0x478b23;this[_0x6767('0x6')]=_0x51f099;this['realtime']=_0x1e86fc;this[_0x6767('0x3')]=_0x4bd37b;this[_0x6767('0x5')][_0x6767('0x7')](this['handleRun'][_0x6767('0x8')](this),this[_0x6767('0x9')][_0x6767('0x8')](this));this[_0x6767('0x5')]['on'](_0x6767('0xa'),this[_0x6767('0x9')][_0x6767('0x8')](this));this[_0x6767('0x5')]['on'](_0x6767('0xb'),this[_0x6767('0xc')][_0x6767('0x8')](this));};Beepall[_0x6767('0xd')]['push']=function(){this[_0x6767('0x5')][_0x6767('0x7')](this[_0x6767('0xe')]['bind'](this),this['handleTimeout'][_0x6767('0x8')](this));};Beepall[_0x6767('0xd')]['handleDrained']=function(_0x109507){this[_0x6767('0x9')](!![]);};Beepall['prototype'][_0x6767('0xe')]=function(_0x36026f){var _0x31ff21=!![];if(!_[_0x6767('0xf')](this['queue'])&&!_[_0x6767('0xf')](this['queue'][_0x6767('0x10')])&&this[_0x6767('0x6')][_0x6767('0x10')]['length']>0x0){for(var _0x2ee252=0x0,_0x4d3499;_0x2ee2520x0){for(var _0x149105=0x0,_0x3d4462;_0x1491050x0&&_0x42d7f4[_0x334401+_0xc5fd('0x27')]>=_0x42d7f4[_0x334401+_0xc5fd('0x26')]){writeLog(_0x3d7211,_0x42d7f4,_0x334401[_0xc5fd('0x28')]()+_0xc5fd('0x29'));return![];}}return!![];};exports['showNotification']=function(_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33){return sendNotification(!![],_0x176313,_0x1bbdc4,_0x19c4a0,_0x42cbf0,_0x19df33);};exports[_0xc5fd('0x2a')]=function(_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962){return sendNotification(![],_0x541c12,_0x412ef7,_0x5d4f70,_0x4859f7,_0x12a962);};exports[_0xc5fd('0x2b')]=writeLog; \ No newline at end of file +var _0x2675=['\x20interaction','account','notificationSound','notificationShake','body','queue','msg','getMustacheRender','notificationTemplate','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','user:%s','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','showNotification','hideNotification','writeLog','lodash','ioredis','../../../../../config/environment','routing','redis','localhost','socket.io-emitter','emit','format','name','user:save','split'];(function(_0x153d8c,_0x232ba0){var _0x3c832e=function(_0x5a1ead){while(--_0x5a1ead){_0x153d8c['push'](_0x153d8c['shift']());}};_0x3c832e(++_0x232ba0);}(_0x2675,0x75));var _0x5267=function(_0x4c84f5,_0x260c94){_0x4c84f5=_0x4c84f5-0x0;var _0x109f87=_0x2675[_0x4c84f5];return _0x109f87;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var utils=require('../utils');var Mustache=require('mustache');var Redis=require(_0x5267('0x1'));var config=require(_0x5267('0x2'));var logger=require('../../../../../config/logger')(_0x5267('0x3'));config[_0x5267('0x4')]=_['defaults'](config[_0x5267('0x4')],{'host':_0x5267('0x5'),'port':0x18eb});var io=require(_0x5267('0x6'))(new Redis(config[_0x5267('0x4')]));function emit(_0x20f065,_0xc56cd5,_0x527c16){io['to'](_0x20f065)[_0x5267('0x7')](_0xc56cd5,_0x527c16);}function sendNotification(_0x46bfdf,_0x506fd7,_0x799fcc,_0x5d6645,_0x3ff4e9,_0x207d47){io['to'](util[_0x5267('0x8')]('user:%s',_0x5d6645[_0x5267('0x9')]))['emit'](_0x5267('0xa'),_0x5d6645);var _0x5bbf00=_0x207d47||{};var _0x31ea34=_0x799fcc[_0x5267('0xb')]('.');var _0x268a8a={'uniqueid':_0x506fd7,'channel':_0x31ea34[0x0],'id':_0x31ea34[0x1],'title':_0x31ea34[0x0]+_0x5267('0xc'),'interactionId':_0x31ea34[0x2],'queue':_0x3ff4e9?_0x3ff4e9[_0x5267('0x9')]:null,'sound':_0x5bbf00[_0x5267('0xd')][_0x5267('0xe')],'shake':_0x5bbf00[_0x5267('0xd')][_0x5267('0xf')]};try{if(!_0x5bbf00[_0x5267('0x10')]){_0x5bbf00[_0x5267('0x10')]={};}if(_0x3ff4e9){_0x5bbf00[_0x5267('0x10')][_0x5267('0x11')]=_0x3ff4e9;}else if(_0x5bbf00['body']['queue']){delete _0x5bbf00[_0x5267('0x10')][_0x5267('0x11')];}_0x268a8a[_0x5267('0x12')]=utils[_0x5267('0x13')](_0x5bbf00[_0x5267('0xd')][_0x5267('0x14')],_0x5bbf00);}catch(_0x5cc58b){_0x268a8a[_0x5267('0x12')]=_0x5267('0x15');logger[_0x5267('0x16')](util[_0x5267('0x8')](_0x5267('0x17'),_0x506fd7,_0x5cc58b['message']));}io['to'](util[_0x5267('0x8')](_0x5267('0x18'),_0x5d6645['name']))[_0x5267('0x7')](util['format'](_0x5267('0x19'),_0x46bfdf?_0x5267('0x1a'):_0x5267('0x1b')),_0x268a8a);}function writeLog(_0x2a9f99,_0x5ca9c6,_0x4dd637){return logger[_0x5267('0x1c')](util['format'](_0x5267('0x1d'),_0x2a9f99,_0x5ca9c6[_0x5267('0x9')],_0x4dd637));}exports[_0x5267('0x1e')]=function(_0x56dd95,_0x499f19,_0x5546e2,_0x4a17c7){if(_0x499f19['busy']){writeLog(_0x56dd95,_0x499f19,_0x5267('0x1f'));return![];}if(!_0x499f19[_0x5267('0x20')]){writeLog(_0x56dd95,_0x499f19,_0x5267('0x21'));return![];}if(_0x499f19[_0x5546e2+_0x5267('0x22')]){writeLog(_0x56dd95,_0x499f19,_0x5267('0x23'));return![];}if(_0x4a17c7&&_0x499f19[_0x5267('0x24')](_0x5546e2+_0x5267('0x25'))&&_0x499f19[_0x5267('0x24')](_0x5546e2+_0x5267('0x26'))){if(_0x499f19[_0x5546e2+'Capacity']>0x0&&_0x499f19[_0x5546e2+'CurrentCapacity']>=_0x499f19[_0x5546e2+_0x5267('0x25')]){writeLog(_0x56dd95,_0x499f19,_0x5546e2[_0x5267('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5267('0x28')]=function(_0x52504e,_0x4d7c2a,_0x43e7e7,_0x273769,_0x1f33b7){return sendNotification(!![],_0x52504e,_0x4d7c2a,_0x43e7e7,_0x273769,_0x1f33b7);};exports[_0x5267('0x29')]=function(_0x33c431,_0x4f3d4d,_0x5e87eb,_0x18020c,_0x10a68c){return sendNotification(![],_0x33c431,_0x4f3d4d,_0x5e87eb,_0x18020c,_0x10a68c);};exports[_0x5267('0x2a')]=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 7f89f73..03826c7 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 _0xbf44=['length','[%s][SYSTEM]\x20%s','map','message','join','info','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','error','isObject','stringify','lodash','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x235442,_0x4dd0f5){var _0x9dac0=function(_0x21fcff){while(--_0x21fcff){_0x235442['push'](_0x235442['shift']());}};_0x9dac0(++_0x4dd0f5);}(_0xbf44,0xdc));var _0x4bf4=function(_0x3b9b5a,_0xba62dc){_0x3b9b5a=_0x3b9b5a-0x0;var _0x353e92=_0xbf44[_0x3b9b5a];return _0x353e92;};'use strict';var schema=require('validate');var sh=require('shelljs');var _=require(_0x4bf4('0x0'));var utils=require('./utils');var logger=require(_0x4bf4('0x1'))(_0x4bf4('0x2'));var system=schema({'command':{'type':'string','required':!![],'message':_0x4bf4('0x3')}});exports[_0x4bf4('0x4')]=function(_0x84493c,_0x579e6d){return function(_0x19cf72){try{var _0x4d1956={'command':_0x579e6d[0x0]};var _0x5eca0a=system['validate'](_0x4d1956,{'typecast':!![]});if(_0x5eca0a[_0x4bf4('0x5')]){logger['error'](_0x4bf4('0x6'),_0x84493c,_[_0x4bf4('0x7')](_0x5eca0a,_0x4bf4('0x8'))[_0x4bf4('0x9')](',\x20'));logger[_0x4bf4('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x84493c);_0x19cf72['next']();}else{var _0x19b660=this;var _0x10a9e2=utils[_0x4bf4('0xb')](_0x579e6d[0x0],this);logger[_0x4bf4('0xa')](_0x4bf4('0xc'),_0x84493c,_0x10a9e2);sh['exec'](_[_0x4bf4('0xd')](_0x10a9e2),function(_0x5e13ee,_0x125ef4){logger[_0x4bf4('0xa')](_0x4bf4('0xe'),_0x84493c,_0x5e13ee);if(_0x5e13ee==0x0){var _0x1b483e=_0x125ef4[_0x4bf4('0xf')](/(\r\n|\n|\r)/gm,'');if(_[_0x4bf4('0x10')](_0x579e6d[0x1])||_[_0x4bf4('0x11')](_0x579e6d[0x1])){logger[_0x4bf4('0xa')](_0x4bf4('0x12'),_0x84493c);_0x19b660[_0x4bf4('0x13')][_0x579e6d[0x1]]=_0x1b483e;}else{logger[_0x4bf4('0xa')](_0x4bf4('0x14'),_0x84493c,_0x579e6d[0x1],_0x1b483e);_0x19b660[_0x4bf4('0x13')][_0x579e6d[0x1]]=_0x1b483e;}}_0x19cf72[_0x4bf4('0x15')]();});}}catch(_0x503997){logger[_0x4bf4('0x16')](_0x4bf4('0x6'),_0x84493c,_[_0x4bf4('0x17')](_0x503997)?JSON[_0x4bf4('0x18')](_0x503997):_0x503997);logger[_0x4bf4('0xa')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x84493c);_0x19cf72[_0x4bf4('0x15')]();}};}; \ No newline at end of file +var _0x4ce6=['../../../../config/logger','string','consequence','error','[%s][SYSTEM]\x20%s','map','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','info','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils'];(function(_0x22b059,_0x563a7d){var _0x470f15=function(_0x53925d){while(--_0x53925d){_0x22b059['push'](_0x22b059['shift']());}};_0x470f15(++_0x563a7d);}(_0x4ce6,0x15a));var _0x64ce=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0x4ce6[_0x211bc3];return _0x34c9a2;};'use strict';var schema=require(_0x64ce('0x0'));var sh=require(_0x64ce('0x1'));var _=require(_0x64ce('0x2'));var utils=require(_0x64ce('0x3'));var logger=require(_0x64ce('0x4'))('routing');var system=schema({'command':{'type':_0x64ce('0x5'),'required':!![],'message':'command\x20is\x20a\x20string\x20and\x20it\x20is\x20required'}});exports[_0x64ce('0x6')]=function(_0x44a918,_0x1f8d11){return function(_0x45e013){try{var _0x8c1982={'command':_0x1f8d11[0x0]};var _0x50898d=system[_0x64ce('0x0')](_0x8c1982,{'typecast':!![]});if(_0x50898d['length']){logger[_0x64ce('0x7')](_0x64ce('0x8'),_0x44a918,_[_0x64ce('0x9')](_0x50898d,_0x64ce('0xa'))['join'](',\x20'));logger['info'](_0x64ce('0xb'),_0x44a918);_0x45e013[_0x64ce('0xc')]();}else{var _0x5e78a5=this;var _0x2f956f=utils[_0x64ce('0xd')](_0x1f8d11[0x0],this);logger['info'](_0x64ce('0xe'),_0x44a918,_0x2f956f);sh[_0x64ce('0xf')](_['trim'](_0x2f956f),function(_0x10dec8,_0x200f7b){logger[_0x64ce('0x10')]('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x44a918,_0x10dec8);if(_0x10dec8==0x0){var _0x50b31b=_0x200f7b[_0x64ce('0x11')](/(\r\n|\n|\r)/gm,'');if(_[_0x64ce('0x12')](_0x1f8d11[0x1])||_[_0x64ce('0x13')](_0x1f8d11[0x1])){logger[_0x64ce('0x10')](_0x64ce('0x14'),_0x44a918);_0x5e78a5[_0x64ce('0x15')][_0x1f8d11[0x1]]=_0x50b31b;}else{logger['info'](_0x64ce('0x16'),_0x44a918,_0x1f8d11[0x1],_0x50b31b);_0x5e78a5['body'][_0x1f8d11[0x1]]=_0x50b31b;}}_0x45e013[_0x64ce('0xc')]();});}}catch(_0x572c4a){logger[_0x64ce('0x7')](_0x64ce('0x8'),_0x44a918,_[_0x64ce('0x17')](_0x572c4a)?JSON[_0x64ce('0x18')](_0x572c4a):_0x572c4a);logger[_0x64ce('0x10')](_0x64ce('0xb'),_0x44a918);_0x45e013['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 632c310..ce6bd61 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 _0xaa1a=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','message','join','channel','Interaction','addTags','interaction','then','info','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','finally','next','isObject','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger'];(function(_0x10edec,_0x31c2bd){var _0x3d6f32=function(_0x1d3cce){while(--_0x1d3cce){_0x10edec['push'](_0x10edec['shift']());}};_0x3d6f32(++_0x31c2bd);}(_0xaa1a,0x67));var _0xaaa1=function(_0x80f51a,_0x32e95e){_0x80f51a=_0x80f51a-0x0;var _0x327148=_0xaa1a[_0x80f51a];return _0x327148;};'use strict';var schema=require('validate');var _=require('lodash');var rpc={'chatInteraction':require(_0xaaa1('0x0')),'openchannelInteraction':require(_0xaaa1('0x1')),'smsInteraction':require(_0xaaa1('0x2')),'mailInteraction':require(_0xaaa1('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0xaaa1('0x4'))(_0xaaa1('0x5'));var tag=schema({'tag':{'type':_0xaaa1('0x6'),'required':!![],'message':_0xaaa1('0x7')}});exports[_0xaaa1('0x8')]=function(_0x5b54e5,_0x279e55,_0x115434,_0x27e014){return function(_0x59615b){try{var _0x51c331={'tag':_0x279e55[0x0]};var _0x4f2449=tag[_0xaaa1('0x9')](_0x51c331,{'typecast':!![]});if(_0x4f2449[_0xaaa1('0xa')]){logger[_0xaaa1('0xb')](_0xaaa1('0xc'),_0x5b54e5,_['map'](_0x4f2449,_0xaaa1('0xd'))[_0xaaa1('0xe')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5b54e5);_0x59615b['next']();}else{var _0x5c733c={'ids':[_0x279e55[0x0]]};if(rpc[_0x27e014[_0xaaa1('0xf')]+_0xaaa1('0x10')]){rpc[_0x27e014[_0xaaa1('0xf')]+'Interaction'][_0xaaa1('0x11')](_0x27e014[_0xaaa1('0x12')]['id'],_0x5c733c)[_0xaaa1('0x13')](function(_0x442325){logger[_0xaaa1('0x14')]('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x5b54e5,_0x279e55[0x1],_0x27e014[_0xaaa1('0xf')],_0x27e014[_0xaaa1('0x12')]['id']);})[_0xaaa1('0x15')](function(_0x779ca5){logger[_0xaaa1('0xb')](_0xaaa1('0xc'),_0x5b54e5,JSON[_0xaaa1('0x16')](_0x779ca5));logger['info'](_0xaaa1('0x17'),_0x5b54e5);})[_0xaaa1('0x18')](function(){_0x59615b[_0xaaa1('0x19')]();});}}}catch(_0x375b85){logger[_0xaaa1('0xb')]('[%s][TAG]\x20%s',_0x5b54e5,_[_0xaaa1('0x1a')](_0x375b85)?JSON[_0xaaa1('0x16')](_0x375b85):_0x375b85);logger[_0xaaa1('0x14')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x5b54e5);_0x59615b['next']();}};}; \ No newline at end of file +var _0x56a1=['next','channel','Interaction','addTags','interaction','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','stringify','finally','isObject','lodash','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/faxInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','validate','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x17cb3a,_0x4a6bfc){var _0xa3a4a5=function(_0x3ee50f){while(--_0x3ee50f){_0x17cb3a['push'](_0x17cb3a['shift']());}};_0xa3a4a5(++_0x4a6bfc);}(_0x56a1,0x1d5));var _0x156a=function(_0x2440df,_0x453be8){_0x2440df=_0x2440df-0x0;var _0x1fa6fb=_0x56a1[_0x2440df];return _0x1fa6fb;};'use strict';var schema=require('validate');var _=require(_0x156a('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x156a('0x1')),'smsInteraction':require(_0x156a('0x2')),'mailInteraction':require('../../rpc/mailInteraction'),'faxInteraction':require(_0x156a('0x3')),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var logger=require(_0x156a('0x4'))(_0x156a('0x5'));var tag=schema({'tag':{'type':_0x156a('0x6'),'required':!![],'message':_0x156a('0x7')}});exports[_0x156a('0x8')]=function(_0x204fce,_0x4f0d35,_0x53b6ce,_0x562705){return function(_0x4c8ec2){try{var _0x5bdf49={'tag':_0x4f0d35[0x0]};var _0x102d54=tag[_0x156a('0x9')](_0x5bdf49,{'typecast':!![]});if(_0x102d54[_0x156a('0xa')]){logger[_0x156a('0xb')](_0x156a('0xc'),_0x204fce,_[_0x156a('0xd')](_0x102d54,_0x156a('0xe'))[_0x156a('0xf')](',\x20'));logger['info'](_0x156a('0x10'),_0x204fce);_0x4c8ec2[_0x156a('0x11')]();}else{var _0x149d5e={'ids':[_0x4f0d35[0x0]]};if(rpc[_0x562705[_0x156a('0x12')]+'Interaction']){rpc[_0x562705[_0x156a('0x12')]+_0x156a('0x13')][_0x156a('0x14')](_0x562705[_0x156a('0x15')]['id'],_0x149d5e)['then'](function(_0xc034ae){logger[_0x156a('0x16')](_0x156a('0x17'),_0x204fce,_0x4f0d35[0x1],_0x562705[_0x156a('0x12')],_0x562705['interaction']['id']);})['catch'](function(_0x2ba9fc){logger['error'](_0x156a('0xc'),_0x204fce,JSON[_0x156a('0x18')](_0x2ba9fc));logger[_0x156a('0x16')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x204fce);})[_0x156a('0x19')](function(){_0x4c8ec2[_0x156a('0x11')]();});}}}catch(_0xc2d999){logger['error'](_0x156a('0xc'),_0x204fce,_[_0x156a('0x1a')](_0xc2d999)?JSON[_0x156a('0x18')](_0xc2d999):_0xc2d999);logger[_0x156a('0x16')](_0x156a('0x10'),_0x204fce);_0x4c8ec2[_0x156a('0x11')]();}};}; \ 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 9816010..dfd810d 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 _0x0a4e=['stringify','POST','then','parse','result','logged','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&sessionId=','info','[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s','stop','error','[%s][TVOX]\x20%s','isObject','next','routing','consequence','\x20-\x20','replace','push','?params=','urlOnRing','title','jsonrpc','method','login'];(function(_0x3c9c9f,_0x44aff8){var _0x13c15b=function(_0x4f5e3d){while(--_0x4f5e3d){_0x3c9c9f['push'](_0x3c9c9f['shift']());}};_0x13c15b(++_0x44aff8);}(_0x0a4e,0xe8));var _0xe0a4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0a4e[_0x3dd15e];return _0x231fd0;};'use strict';var rp=require('request-promise');var logger=require('../../../../config/logger')(_0xe0a4('0x0'));var _=require('lodash');var arr=[];exports[_0xe0a4('0x1')]=function(_0x29b1c5,_0x2581d6){return function(_0xa1583f){var _0x3b2b83=_0x2581d6[0xa];var _0x57b24c=_0x2581d6[0xb];var _0x6f740f=_0x2581d6[0xc];var _0x368da5=_0x2581d6[0xd];var _0x17decf=_0x2581d6[0xe];var _0x259412=_0x2581d6[0xf]['replace'](/\n/g,_0xe0a4('0x2'));var _0x833427=_0x2581d6[0x10][_0xe0a4('0x3')](/\n/g,'\x20');if(!arr['includes'](_0x57b24c)){arr[_0xe0a4('0x4')](_0x57b24c);var _0x5238fa=_0x2581d6[0x3];var _0x5378e8=_0x2581d6[0x4];var _0x1886a6=_0x2581d6[0x1];var _0x3017a7=_0x2581d6[0x0];var _0xfdd5ee={};_0xfdd5ee['urlOnAnswer']=_0x2581d6[0x8]+_0xe0a4('0x5')+_0x6f740f+'|'+_0x3b2b83+'|'+_0x368da5+'|'+_0x57b24c+'|'+_0x17decf;_0xfdd5ee[_0xe0a4('0x6')]=_0x2581d6[0x7]+_0xe0a4('0x5')+_0x6f740f+'|'+_0x3b2b83+'|'+_0x368da5+'|'+_0x57b24c+'|'+_0x17decf+'|'+_0x259412+'|'+_0x833427;_0xfdd5ee[_0xe0a4('0x7')]=_0x2581d6[0x9];var _0x48c48d={};_0x48c48d[_0xe0a4('0x8')]='2.0';_0x48c48d[_0xe0a4('0x9')]=_0xe0a4('0xa');var _0x35d09b=[];_0x35d09b[_0xe0a4('0x4')](_0x2581d6[0x2]);_0x35d09b[_0xe0a4('0x4')](_0x2581d6[0x5]);_0x35d09b[_0xe0a4('0x4')](_0x2581d6[0x6]);_0x48c48d['params']=_0x35d09b;_0x48c48d['id']=0x1;var _0x22a884=JSON[_0xe0a4('0xb')](_0x48c48d);var _0x43a872={'encoding':'utf8','method':_0xe0a4('0xc'),'timeout':0x2710,'url':_0x5238fa,'headers':{'Content-Type':'application/json-rpc'},'body':_0x22a884};return rp(_0x43a872)[_0xe0a4('0xd')](function(_0x47709d){const _0x1f249c=JSON[_0xe0a4('0xe')](_0x47709d);if(!_0x1f249c[_0xe0a4('0xf')][_0xe0a4('0x10')]){throw new Error(_0xe0a4('0x11'));}var _0x2b5293=_0x57b24c;var _0x520f4c='channelId='+_0x1886a6+_0xe0a4('0x12')+_0x3017a7+_0xe0a4('0x13')+_0x2b5293+'&data='+JSON[_0xe0a4('0xb')](_0xfdd5ee);var _0x2b1e17=_0x5378e8+'?'+_0x520f4c;return rp(_0x2b1e17);})[_0xe0a4('0xd')](function(_0x55cca7){logger[_0xe0a4('0x14')](_0xe0a4('0x15'),_0x29b1c5,_0x55cca7);_0xa1583f[_0xe0a4('0x16')]();})['catch'](function(_0x5b9ba9){logger[_0xe0a4('0x17')](_0xe0a4('0x18'),_0x29b1c5,_[_0xe0a4('0x19')](_0x5b9ba9)?JSON['stringify'](_0x5b9ba9):_0x5b9ba9);_0xa1583f[_0xe0a4('0x16')]();});}else{logger[_0xe0a4('0x14')]('[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next',_0x29b1c5);_0xa1583f[_0xe0a4('0x1a')]();}};}; \ No newline at end of file +var _0xd56d=['login','push','utf8','POST','application/json-rpc','then','parse','result','Unable\x20to\x20login\x20with\x20TVox\x20application','&serviceId=','&data=','stringify','info','stop','catch','error','[%s][TVOX]\x20%s','isObject','[%s][TVOX]\x20Application\x20already\x20executed\x20for\x20the\x20current\x20session,\x20force\x20next','next','request-promise','../../../../config/logger','lodash','consequence','replace','includes','urlOnAnswer','?params=','title','jsonrpc','2.0','method'];(function(_0x111e94,_0x31c837){var _0x3de107=function(_0x65bd1e){while(--_0x65bd1e){_0x111e94['push'](_0x111e94['shift']());}};_0x3de107(++_0x31c837);}(_0xd56d,0x194));var _0xdd56=function(_0x285800,_0x26765e){_0x285800=_0x285800-0x0;var _0x4b809e=_0xd56d[_0x285800];return _0x4b809e;};'use strict';var rp=require(_0xdd56('0x0'));var logger=require(_0xdd56('0x1'))('routing');var _=require(_0xdd56('0x2'));var arr=[];exports[_0xdd56('0x3')]=function(_0x41e3c0,_0x4ab005){return function(_0x4d293f){var _0x48379f=_0x4ab005[0xa];var _0x152f0c=_0x4ab005[0xb];var _0x5d6e0d=_0x4ab005[0xc];var _0x10451b=_0x4ab005[0xd];var _0x1e9de5=_0x4ab005[0xe];var _0x3ca4fc=_0x4ab005[0xf][_0xdd56('0x4')](/\n/g,'\x20-\x20');var _0x27086f=_0x4ab005[0x10][_0xdd56('0x4')](/\n/g,'\x20');if(!arr[_0xdd56('0x5')](_0x152f0c)){arr['push'](_0x152f0c);var _0x4d5087=_0x4ab005[0x3];var _0x5b9f29=_0x4ab005[0x4];var _0x3e8b61=_0x4ab005[0x1];var _0x1d6a73=_0x4ab005[0x0];var _0x480ac6={};_0x480ac6[_0xdd56('0x6')]=_0x4ab005[0x8]+_0xdd56('0x7')+_0x5d6e0d+'|'+_0x48379f+'|'+_0x10451b+'|'+_0x152f0c+'|'+_0x1e9de5;_0x480ac6['urlOnRing']=_0x4ab005[0x7]+'?params='+_0x5d6e0d+'|'+_0x48379f+'|'+_0x10451b+'|'+_0x152f0c+'|'+_0x1e9de5+'|'+_0x3ca4fc+'|'+_0x27086f;_0x480ac6[_0xdd56('0x8')]=_0x4ab005[0x9];var _0x3c6ac5={};_0x3c6ac5[_0xdd56('0x9')]=_0xdd56('0xa');_0x3c6ac5[_0xdd56('0xb')]=_0xdd56('0xc');var _0x438216=[];_0x438216['push'](_0x4ab005[0x2]);_0x438216[_0xdd56('0xd')](_0x4ab005[0x5]);_0x438216[_0xdd56('0xd')](_0x4ab005[0x6]);_0x3c6ac5['params']=_0x438216;_0x3c6ac5['id']=0x1;var _0x1f778c=JSON['stringify'](_0x3c6ac5);var _0x1726e3={'encoding':_0xdd56('0xe'),'method':_0xdd56('0xf'),'timeout':0x2710,'url':_0x4d5087,'headers':{'Content-Type':_0xdd56('0x10')},'body':_0x1f778c};return rp(_0x1726e3)[_0xdd56('0x11')](function(_0x32efbb){const _0x571ff2=JSON[_0xdd56('0x12')](_0x32efbb);if(!_0x571ff2[_0xdd56('0x13')]['logged']){throw new Error(_0xdd56('0x14'));}var _0x2b6830=_0x152f0c;var _0x1d2288='channelId='+_0x3e8b61+_0xdd56('0x15')+_0x1d6a73+'&sessionId='+_0x2b6830+_0xdd56('0x16')+JSON[_0xdd56('0x17')](_0x480ac6);var _0xb7f489=_0x5b9f29+'?'+_0x1d2288;return rp(_0xb7f489);})[_0xdd56('0x11')](function(_0x1f9ba0){logger[_0xdd56('0x18')]('[%s][TVOX]\x20Request\x20sent\x20to\x20TVox:\x20%s',_0x41e3c0,_0x1f9ba0);_0x4d293f[_0xdd56('0x19')]();})[_0xdd56('0x1a')](function(_0x32e551){logger[_0xdd56('0x1b')](_0xdd56('0x1c'),_0x41e3c0,_[_0xdd56('0x1d')](_0x32e551)?JSON[_0xdd56('0x17')](_0x32e551):_0x32e551);_0x4d293f[_0xdd56('0x19')]();});}else{logger[_0xdd56('0x18')](_0xdd56('0x1e'),_0x41e3c0);_0x4d293f[_0xdd56('0x1f')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index bbee8ca..c7a1fe7 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x64511f,_0x4709c1){var _0x2e8f49=function(_0x2a7ef3){while(--_0x2a7ef3){_0x64511f['push'](_0x64511f['shift']());}};_0x2e8f49(++_0x4709c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Mustache=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'getMustacheRender':function(_0x5dd881,_0x550fbc){return Mustache[_0x0a9e('0x3')](_0x5dd881,_['merge'](_0x550fbc[_0x0a9e('0x4')],{'contact':_0x550fbc[_0x0a9e('0x5')],'message':_0x550fbc[_0x0a9e('0x6')],'account':_0x550fbc[_0x0a9e('0x7')],'interaction':_0x550fbc[_0x0a9e('0x8')],'list':_0x550fbc['list']}))||'';}}; \ No newline at end of file +var _0xd8b0=['merge','body','contact','message','list','mustache','lodash','render'];(function(_0x2dbf61,_0x2f1495){var _0xdc17dc=function(_0x318761){while(--_0x318761){_0x2dbf61['push'](_0x2dbf61['shift']());}};_0xdc17dc(++_0x2f1495);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var Mustache=require(_0x0d8b('0x0'));var _=require(_0x0d8b('0x1'));module['exports']={'getMustacheRender':function(_0x585166,_0x4b72b0){return Mustache[_0x0d8b('0x2')](_0x585166,_[_0x0d8b('0x3')](_0x4b72b0[_0x0d8b('0x4')],{'contact':_0x4b72b0[_0x0d8b('0x5')],'message':_0x4b72b0[_0x0d8b('0x6')],'account':_0x4b72b0['account'],'interaction':_0x4b72b0['interaction'],'list':_0x4b72b0[_0x0d8b('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 9a541df..beff3b6 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 _0x0c5d=['whatsappQueuesWaitingInteractions','server','http','stringify','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','format','%s.%s.%s','IntervalId','isNil','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','autoreply','appdata','split','mail','push','slice','dialogflow','dialogflowv2','amazonlex','tvox','getMustacheRender','account','notificationTemplate','ContactId','body','./interval','condition','intervals','./applications/','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busy','emit','end','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','busyQueue','hasOwnProperty','capacity','CurrentCapacity','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions'];(function(_0x2b973a,_0x1d7f09){var _0x2d9378=function(_0x4dd5d1){while(--_0x4dd5d1){_0x2b973a['push'](_0x2b973a['shift']());}};_0x2d9378(++_0x1d7f09);}(_0x0c5d,0x6c));var _0xd0c5=function(_0x160cf1,_0x386a0f){_0x160cf1=_0x160cf1-0x0;var _0x4ab169=_0x0c5d[_0x160cf1];return _0x4ab169;};'use strict';var _=require(_0xd0c5('0x0'));var util=require(_0xd0c5('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0xd0c5('0x2'));var BPromise=require('bluebird');var uuid=require(_0xd0c5('0x3'));var utils=require(_0xd0c5('0x4'));var config=require(_0xd0c5('0x5'));var logger=require(_0xd0c5('0x6'))(_0xd0c5('0x7'));var rpc={'openchannelQueueReport':require(_0xd0c5('0x8')),'mailQueueReport':require(_0xd0c5('0x9')),'chatQueueReport':require(_0xd0c5('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xd0c5('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x365e04,_0x4be307,_0x567113){return util[_0xd0c5('0xc')](_0xd0c5('0xd'),_0x365e04,_0x4be307||0x0,_0x567113||0x0);}function getIntervals(_0x50ed33,_0x33a77b){var _0x3d53ab=[];if(!_['isNil'](_0x33a77b[_0xd0c5('0xe')])&&!_[_0xd0c5('0xf')](_0x50ed33[_0x33a77b[_0xd0c5('0xe')]])&&!_[_0xd0c5('0xf')](_0x50ed33[_0x33a77b[_0xd0c5('0xe')]][_0xd0c5('0x10')])){_0x3d53ab=_[_0xd0c5('0x11')](_0x50ed33[_0x33a77b[_0xd0c5('0xe')]][_0xd0c5('0x10')],_0xd0c5('0x12'));}else if(!_[_0xd0c5('0xf')](_0x33a77b[_0xd0c5('0x12')])){_0x3d53ab=[_0x33a77b['interval']];}return _0x3d53ab;}exports[_0xd0c5('0x13')]=function(_0x1c1cc8){_0x1c1cc8[_0xd0c5('0x14')]={};return new BPromise(function(_0x408e02,_0x553c38){var _0x280e22={'Start':function(_0x23d941){var _0x242615=this;return new Promise(function(_0x639e72,_0x556487){if(_0x23d941){try{var _0x2be13d=[];var _0x5809ba=getId(_0x23d941[_0xd0c5('0x15')],_0x23d941['message']?_0x23d941[_0xd0c5('0x16')]['id']:0x0,_0x23d941[_0xd0c5('0x17')]?_0x23d941[_0xd0c5('0x17')]['id']:0x0);if(_0x23d941[_0xd0c5('0x18')]&&_[_0xd0c5('0x19')](_0x23d941[_0xd0c5('0x18')])&&_0x23d941[_0xd0c5('0x18')][_0xd0c5('0x1a')]){for(var _0x4e302a=0x0;_0x4e302a<_0x23d941[_0xd0c5('0x18')][_0xd0c5('0x1a')];_0x4e302a+=0x1){var _0x54c2c5=_0x23d941[_0xd0c5('0x18')][_0x4e302a];if(fs[_0xd0c5('0x1b')](path[_0xd0c5('0x1c')](__dirname,_0xd0c5('0x18'),_0x54c2c5[_0xd0c5('0x1d')]+_0xd0c5('0x1e')))){var _0x331849=[];switch(_0x54c2c5['app']['toLowerCase']()){case _0xd0c5('0x1f'):var _0x2b756a=_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');if(_0x23d941['channel']===_0xd0c5('0x22')){_0x331849['push'](_0x2b756a[0x0]);_0x331849['push'](_0x2b756a[0x1]);_0x331849[_0xd0c5('0x23')](_0x2b756a[_0xd0c5('0x24')](0x2,_0x2b756a[_0xd0c5('0x1a')])[_0xd0c5('0x1c')](','));}else{_0x331849[_0xd0c5('0x23')](_0x2b756a[0x0]);_0x331849[_0xd0c5('0x23')](_0x2b756a[_0xd0c5('0x24')](0x1,_0x2b756a[_0xd0c5('0x1a')])[_0xd0c5('0x1c')](','));}break;case _0xd0c5('0x25'):var _0x34c2f4=_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');_0x331849[_0xd0c5('0x23')](_0x34c2f4[0x0]);_0x331849[_0xd0c5('0x23')](_0x34c2f4[0x1]);_0x331849[_0xd0c5('0x23')](_0x34c2f4[_0xd0c5('0x24')](0x2,_0x34c2f4['length'])[_0xd0c5('0x1c')](','));break;case _0xd0c5('0x26'):var _0x16298d=_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');_0x331849[_0xd0c5('0x23')](_0x16298d[0x0]);_0x331849[_0xd0c5('0x23')](_0x16298d[0x1]);_0x331849['push'](_0x16298d[0x2]);_0x331849[_0xd0c5('0x23')](_0x16298d[0x3]);_0x331849['push'](_0x16298d[_0xd0c5('0x24')](0x4,_0x16298d[_0xd0c5('0x1a')])[_0xd0c5('0x1c')](','));break;case _0xd0c5('0x27'):var _0x2ff67a=_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');_0x331849['push'](_0x2ff67a[0x0]);_0x331849['push'](_0x2ff67a[0x1]);_0x331849[_0xd0c5('0x23')](_0x2ff67a[0x2]);_0x331849['push'](_0x2ff67a[0x3]);_0x331849[_0xd0c5('0x23')](_0x2ff67a[_0xd0c5('0x24')](0x4,_0x2ff67a[_0xd0c5('0x1a')])[_0xd0c5('0x1c')](','));break;case'message':_0x331849[_0xd0c5('0x23')](_0x54c2c5[_0xd0c5('0x20')]);break;case'tag':_0x331849[_0xd0c5('0x23')](_0x54c2c5['TagId']);_0x331849[_0xd0c5('0x23')](_0x54c2c5[_0xd0c5('0x20')]);break;case _0xd0c5('0x28'):var _0x511f5c=utils[_0xd0c5('0x29')](_0x23d941[_0xd0c5('0x2a')][_0xd0c5('0x2b')],_0x23d941);var _0x3650b8=_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');_0x331849[_0xd0c5('0x23')](_0x3650b8[0x0]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x1]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x2]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x3]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x4]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x5]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x6]);_0x331849['push'](_0x3650b8[0x7]);_0x331849['push'](_0x3650b8[0x8]);_0x331849[_0xd0c5('0x23')](_0x3650b8[0x9]);_0x331849['push'](_0x3650b8[0xa]);_0x331849[_0xd0c5('0x23')](_0x23d941[_0xd0c5('0x17')]['id']);_0x331849['push'](_0x23d941[_0xd0c5('0x16')]['id']);_0x331849[_0xd0c5('0x23')](_0x54c2c5['ChatWebsiteId']);_0x331849[_0xd0c5('0x23')](_0x23d941[_0xd0c5('0x17')][_0xd0c5('0x2c')]);_0x331849[_0xd0c5('0x23')](_0x23d941[_0xd0c5('0x2d')][_0xd0c5('0x2d')]);_0x331849[_0xd0c5('0x23')](_0x511f5c);break;default:_0x331849=_[_0xd0c5('0xf')](_0x54c2c5[_0xd0c5('0x20')])?[]:_0x54c2c5[_0xd0c5('0x20')][_0xd0c5('0x21')](',');}var _0x3dc24a={'id':util[_0xd0c5('0xc')]('%s:%s:%s',_0x5809ba,_0x54c2c5['id'],_0x54c2c5[_0xd0c5('0x1d')]),'condition':require(_0xd0c5('0x2e'))[_0xd0c5('0x2f')](_0x5809ba,getIntervals(_0x1c1cc8[_0xd0c5('0x30')],_0x54c2c5),_0x1c1cc8),'consequence':require(_0xd0c5('0x31')+_0x54c2c5['app'])['consequence'](_0x5809ba,_0x331849,_0x1c1cc8,_0x23d941),'p':_0x54c2c5[_0xd0c5('0x32')]||0x0};logger[_0xd0c5('0x33')](_0xd0c5('0x34'),_0x3dc24a['id'],_0xd0c5('0x35'),getIntervals(_0x1c1cc8['intervals'],_0x54c2c5)[_0xd0c5('0x1c')](_0xd0c5('0x36')));_0x2be13d[_0xd0c5('0x23')](_0x3dc24a);}else{logger[_0xd0c5('0x37')](_0xd0c5('0x38'),path[_0xd0c5('0x1c')](__dirname,_0xd0c5('0x18'),_0x54c2c5['app']+_0xd0c5('0x1e')));}}_0x1c1cc8[_0xd0c5('0x14')][_0x5809ba]=new RuleEngine(_0x2be13d);_0x1c1cc8['rules'][_0x5809ba][_0xd0c5('0x39')](_0x23d941,function(_0x2634f3){logger[_0xd0c5('0x33')]('Applications\x20executed',JSON['stringify'](_0x2634f3['matchPath']));if(_0x1c1cc8['rules'][_0x5809ba]){_0x1c1cc8[_0xd0c5('0x14')][_0x5809ba]['emit'](_0xd0c5('0x3a'));}});return _0x639e72({'code':0xc8,'message':_0x23d941});}else{logger['info'](_0xd0c5('0x3b'));return _0x639e72({'code':0xc8,'message':_0x23d941});}}catch(_0x5a1857){logger[_0xd0c5('0x37')](_0x5a1857[_0xd0c5('0x3c')]);return _0x556487(_0x242615[_0xd0c5('0x37')](0x1f4,_0x5a1857));}}return _0x556487(_0xd0c5('0x3d'));});},'AcceptMessage':function(_0x129801){var _0x560d35=this;return new Promise(function(_0x16cc18,_0x472977){if(_0x129801[_0xd0c5('0x3e')]&&_0x129801[_0xd0c5('0x3e')]['id']){if(_0x1c1cc8[_0xd0c5('0x3f')][_0x129801[_0xd0c5('0x3e')]['id']]){_0x1c1cc8['agents'][_0x129801[_0xd0c5('0x3e')]['id']][_0xd0c5('0x40')]=![];_0x1c1cc8[_0xd0c5('0x3f')][_0x129801[_0xd0c5('0x3e')]['id']]['busyQueue']=undefined;}}if(_0x129801[_0xd0c5('0x16')]&&_0x129801[_0xd0c5('0x16')]['id']){try{var _0x11c601=getId(_0x129801[_0xd0c5('0x15')],_0x129801[_0xd0c5('0x16')]?_0x129801[_0xd0c5('0x16')]['id']:0x0,_0x129801[_0xd0c5('0x17')]?_0x129801[_0xd0c5('0x17')]['id']:0x0);if(_0x1c1cc8[_0xd0c5('0x14')][_0x11c601]){_0x1c1cc8[_0xd0c5('0x14')][_0x11c601][_0xd0c5('0x41')](_0xd0c5('0x42'));if(rpc[_0x129801['channel']+'QueueReport']){rpc[_0x129801[_0xd0c5('0x15')]+_0xd0c5('0x43')][_0xd0c5('0x44')](_0x11c601,{'UserId':_0x129801[_0xd0c5('0x16')][_0xd0c5('0x45')]})[_0xd0c5('0x46')](function(_0x5bf9bb){logger[_0xd0c5('0x37')](_0xd0c5('0x47'));});}}return _0x16cc18({'code':0xc8,'message':_0x129801});}catch(_0x1f7d24){logger[_0xd0c5('0x37')](_0x1f7d24[_0xd0c5('0x3c')]);return _0x472977(_0x560d35[_0xd0c5('0x37')](0x1f4,_0x1f7d24));}}logger[_0xd0c5('0x37')](_0xd0c5('0x48'));return _0x472977(_0x560d35[_0xd0c5('0x37')](0x1f4,_0xd0c5('0x48')));});},'RejectMessage':function(_0x25f7cb){var _0xbe0c47=this;return new Promise(function(_0x2ed0d4,_0x59cecb){if(_0x25f7cb[_0xd0c5('0x3e')]&&_0x25f7cb[_0xd0c5('0x3e')]['id']){try{if(_0x1c1cc8['agents'][_0x25f7cb[_0xd0c5('0x3e')]['id']]){_0x1c1cc8['agents'][_0x25f7cb['agent']['id']][_0xd0c5('0x40')]=![];_0x1c1cc8[_0xd0c5('0x3f')][_0x25f7cb[_0xd0c5('0x3e')]['id']][_0xd0c5('0x49')]=undefined;}return _0x2ed0d4({'code':0xc8,'message':_0x25f7cb});}catch(_0x4243ad){logger[_0xd0c5('0x37')](_0x4243ad[_0xd0c5('0x3c')]);return _0x59cecb(_0xbe0c47[_0xd0c5('0x37')](0x1f4,_0x4243ad));}}logger[_0xd0c5('0x37')](_0xd0c5('0x48'));return _0x59cecb(_0xbe0c47[_0xd0c5('0x37')](0x1f4,_0xd0c5('0x48')));});},'AbandonInteraction':function(_0x35e7c5){var _0x176fe0=this;return new Promise(function(_0x1859c5,_0x225baa){if(_0x35e7c5[_0xd0c5('0x15')]&&_0x35e7c5['interaction']&&_0x35e7c5['interaction']['id']){try{var _0x13c8ce=getId(_0x35e7c5[_0xd0c5('0x15')],_0x35e7c5['message']?_0x35e7c5['message']['id']:0x0,_0x35e7c5[_0xd0c5('0x17')]?_0x35e7c5[_0xd0c5('0x17')]['id']:0x0);if(_0x1c1cc8[_0xd0c5('0x14')][_0x13c8ce]){_0x1c1cc8[_0xd0c5('0x14')][_0x13c8ce][_0xd0c5('0x41')](_0xd0c5('0x42'));}return _0x1859c5({'code':0xc8,'message':_0x35e7c5});}catch(_0x19db83){logger[_0xd0c5('0x37')](_0x19db83[_0xd0c5('0x3c')]);return _0x225baa(_0x176fe0['error'](0x1f4,_0x19db83));}}logger[_0xd0c5('0x37')](_0xd0c5('0x48'));return _0x225baa(_0x176fe0['error'](0x1f4,_0xd0c5('0x48')));});},'AgentCapacity':function(_0x4c7df0){var _0x44b555=this;return new Promise(function(_0x525681,_0x2e8b0d){if(_0x1c1cc8['agents'][_0xd0c5('0x4a')](_0x4c7df0['id'])){for(var _0x339710 in _0x4c7df0[_0xd0c5('0x4b')]){if(_0x4c7df0[_0xd0c5('0x4b')][_0xd0c5('0x4a')](_0x339710)){if(_0x1c1cc8[_0xd0c5('0x3f')][_0x4c7df0['id']][_0xd0c5('0x4a')](_0x339710+_0xd0c5('0x4c'))){_0x1c1cc8[_0xd0c5('0x3f')][_0x4c7df0['id']][_0x339710+_0xd0c5('0x4c')]=parseInt(_0x4c7df0[_0xd0c5('0x4b')][_0x339710],0xa);}}}_0x1c1cc8[_0xd0c5('0x3f')][_0x4c7df0['id']]['updateRealtime']();return _0x525681({'code':0xc8,'message':_0x1c1cc8[_0xd0c5('0x3f')][_0x4c7df0['id']]});}else{return _0x2e8b0d(_0x44b555['error'](0x1f4,_0xd0c5('0x4d')));}});},'Agents':function(_0x37e731){return new Promise(function(_0x5afeba,_0x35287f){var _0x3d0a99=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x3f')]);_0x5afeba({'count':_0x3d0a99[_0xd0c5('0x1a')],'rows':_0x3d0a99});});},'ChatQueues':function(_0x3df55b){return new Promise(function(_0x513136,_0x1ce1cd){var _0x269a24=[];for(var _0x12f8ad in _0x1c1cc8[_0xd0c5('0x4f')]){if(_0x1c1cc8['chatQueues'][_0xd0c5('0x4a')](_0x12f8ad)){var _0x229405=_0x1c1cc8[_0xd0c5('0x4f')][_0x12f8ad];var _0x10aa2a={'id':_0x229405['id'],'available':_0x229405[_0xd0c5('0x50')],'loggedIn':_0x229405[_0xd0c5('0x51')],'name':_0x229405[_0xd0c5('0x52')],'paused':_0x229405[_0xd0c5('0x53')],'waiting':_0x229405[_0xd0c5('0x54')]};_0x269a24[_0xd0c5('0x23')](_0x10aa2a);}}_0x513136({'count':_0x269a24['length'],'rows':_0x269a24});});},'MailQueues':function(_0x1d9423){return new Promise(function(_0x3ec3de,_0x3b27d7){var _0x427461=[];for(var _0x383e7c in _0x1c1cc8[_0xd0c5('0x55')]){if(_0x1c1cc8['mailQueues'][_0xd0c5('0x4a')](_0x383e7c)){var _0x490c93=_0x1c1cc8[_0xd0c5('0x55')][_0x383e7c];var _0x32dc65={'id':_0x490c93['id'],'available':_0x490c93[_0xd0c5('0x50')],'loggedIn':_0x490c93[_0xd0c5('0x51')],'name':_0x490c93[_0xd0c5('0x52')],'paused':_0x490c93['paused'],'waiting':_0x490c93['waiting']};_0x427461[_0xd0c5('0x23')](_0x32dc65);}}_0x3ec3de({'count':_0x427461[_0xd0c5('0x1a')],'rows':_0x427461});});},'OpenchannelQueues':function(_0xfcc4e6){return new Promise(function(_0x3b3e9d,_0x380b07){var _0x313a4c=[];for(var _0x7d38d7 in _0x1c1cc8[_0xd0c5('0x56')]){if(_0x1c1cc8[_0xd0c5('0x56')][_0xd0c5('0x4a')](_0x7d38d7)){var _0x3509d4=_0x1c1cc8[_0xd0c5('0x56')][_0x7d38d7];var _0xc4e75d={'id':_0x3509d4['id'],'available':_0x3509d4[_0xd0c5('0x50')],'loggedIn':_0x3509d4[_0xd0c5('0x51')],'name':_0x3509d4[_0xd0c5('0x52')],'paused':_0x3509d4[_0xd0c5('0x53')],'waiting':_0x3509d4['waiting']};_0x313a4c[_0xd0c5('0x23')](_0xc4e75d);}}_0x3b3e9d({'count':_0x313a4c['length'],'rows':_0x313a4c});});},'SmsQueues':function(_0x32c09f){return new Promise(function(_0x39525a,_0x4e15ab){var _0x24f21b=[];for(var _0x3d4785 in _0x1c1cc8[_0xd0c5('0x57')]){if(_0x1c1cc8[_0xd0c5('0x57')][_0xd0c5('0x4a')](_0x3d4785)){var _0x7feb7=_0x1c1cc8[_0xd0c5('0x57')][_0x3d4785];var _0x4454e2={'id':_0x7feb7['id'],'available':_0x7feb7[_0xd0c5('0x50')],'loggedIn':_0x7feb7['loggedIn'],'name':_0x7feb7['name'],'paused':_0x7feb7[_0xd0c5('0x53')],'waiting':_0x7feb7['waiting']};_0x24f21b['push'](_0x4454e2);}}_0x39525a({'count':_0x24f21b[_0xd0c5('0x1a')],'rows':_0x24f21b});});},'FaxQueues':function(_0x3b8514){return new Promise(function(_0xb24e34,_0xdf44b4){var _0x3b64ae=[];for(var _0x51910f in _0x1c1cc8['faxQueues']){if(_0x1c1cc8[_0xd0c5('0x58')][_0xd0c5('0x4a')](_0x51910f)){var _0xe413e9=_0x1c1cc8[_0xd0c5('0x58')][_0x51910f];var _0x1eeb74={'id':_0xe413e9['id'],'available':_0xe413e9[_0xd0c5('0x50')],'loggedIn':_0xe413e9[_0xd0c5('0x51')],'name':_0xe413e9['name'],'paused':_0xe413e9[_0xd0c5('0x53')],'waiting':_0xe413e9[_0xd0c5('0x54')]};_0x3b64ae[_0xd0c5('0x23')](_0x1eeb74);}}_0xb24e34({'count':_0x3b64ae[_0xd0c5('0x1a')],'rows':_0x3b64ae});});},'WhatsappQueues':function(_0x554ddf){return new Promise(function(_0x403987,_0x5cf467){var _0x43efc9=[];for(var _0x419a13 in _0x1c1cc8[_0xd0c5('0x59')]){if(_0x1c1cc8[_0xd0c5('0x59')][_0xd0c5('0x4a')](_0x419a13)){var _0x4c997f=_0x1c1cc8[_0xd0c5('0x59')][_0x419a13];var _0x2b3201={'id':_0x4c997f['id'],'available':_0x4c997f[_0xd0c5('0x50')],'loggedIn':_0x4c997f[_0xd0c5('0x51')],'name':_0x4c997f[_0xd0c5('0x52')],'paused':_0x4c997f[_0xd0c5('0x53')],'waiting':_0x4c997f['waiting']};_0x43efc9[_0xd0c5('0x23')](_0x2b3201);}}_0x403987({'count':_0x43efc9['length'],'rows':_0x43efc9});});},'ChatQueuesWaitingInteractions':function(_0x2fcba3){return new Promise(function(_0x1d02b1,_0x464989){var _0x97b101=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x5a')]);_0x1d02b1({'count':_0x97b101[_0xd0c5('0x1a')],'rows':_0x97b101});});},'MailQueuesWaitingInteractions':function(_0x1d6ffe){return new Promise(function(_0x4b31f6,_0x3aaa55){var _0x58012e=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x5b')]);_0x4b31f6({'count':_0x58012e[_0xd0c5('0x1a')],'rows':_0x58012e});});},'OpenchannelQueuesWaitingInteractions':function(_0xeaedfe){return new Promise(function(_0xeaacb2,_0x14568a){var _0x1ada98=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x5c')]);_0xeaacb2({'count':_0x1ada98['length'],'rows':_0x1ada98});});},'SmsQueuesWaitingInteractions':function(_0x325458){return new Promise(function(_0x28ea50,_0x15d596){var _0xd3c843=_[_0xd0c5('0x4e')](_0x1c1cc8['smsQueuesWaitingInteractions']);_0x28ea50({'count':_0xd3c843[_0xd0c5('0x1a')],'rows':_0xd3c843});});},'FaxQueuesWaitingInteractions':function(_0xa63a09){return new Promise(function(_0x53ad30,_0x3d66e3){var _0x2ef5e8=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x5d')]);_0x53ad30({'count':_0x2ef5e8[_0xd0c5('0x1a')],'rows':_0x2ef5e8});});},'WhatsappQueuesWaitingInteractions':function(_0x23b5ca){return new Promise(function(_0xb4efc5,_0x463f3d){var _0x416a91=_[_0xd0c5('0x4e')](_0x1c1cc8[_0xd0c5('0x5e')]);_0xb4efc5({'count':_0x416a91[_0xd0c5('0x1a')],'rows':_0x416a91});});}};var _0x56c491=jayson[_0xd0c5('0x5f')](_0x280e22)[_0xd0c5('0x60')]();_0x56c491['on'](_0xd0c5('0x37'),function(_0x118493){logger[_0xd0c5('0x37')](JSON[_0xd0c5('0x61')](_0x118493));return _0x553c38(_0x118493);});_0x56c491[_0xd0c5('0x13')](0x232c,_0xd0c5('0x62'),function(){console[_0xd0c5('0x63')](_0xd0c5('0x64'),0x232c);return _0x408e02('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file +var _0xcd31=['./interval','condition','intervals','./applications/','info','Push\x20new\x20rule','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','stack','message\x20is\x20empty','end','capacity','hasOwnProperty','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','http','listen','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','jayson/promise','uuid','./applications/utils','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','interval','rules','interaction','applications','isArray','length','existsSync','app','toLowerCase','autoreply','split','channel','push','join','dialogflow','slice','appdata','amazonlex','message','tvox','getMustacheRender','notificationTemplate','ContactId','body','%s:%s:%s'];(function(_0x29aefc,_0x4dcf53){var _0x11be36=function(_0x3d472a){while(--_0x3d472a){_0x29aefc['push'](_0x29aefc['shift']());}};_0x11be36(++_0x4dcf53);}(_0xcd31,0x15d));var _0x1cd3=function(_0x29bd8c,_0x170879){_0x29bd8c=_0x29bd8c-0x0;var _0x5d4d36=_0xcd31[_0x29bd8c];return _0x5d4d36;};'use strict';var _=require('lodash');var util=require(_0x1cd3('0x0'));var path=require(_0x1cd3('0x1'));var fs=require('fs');var jayson=require(_0x1cd3('0x2'));var BPromise=require('bluebird');var uuid=require(_0x1cd3('0x3'));var utils=require(_0x1cd3('0x4'));var config=require(_0x1cd3('0x5'));var logger=require(_0x1cd3('0x6'))(_0x1cd3('0x7'));var rpc={'openchannelQueueReport':require(_0x1cd3('0x8')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x1cd3('0x9')),'smsQueueReport':require(_0x1cd3('0xa')),'faxQueueReport':require(_0x1cd3('0xb')),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require(_0x1cd3('0xc'));function getId(_0x11b139,_0x124659,_0x4a2204){return util[_0x1cd3('0xd')](_0x1cd3('0xe'),_0x11b139,_0x124659||0x0,_0x4a2204||0x0);}function getIntervals(_0x17d5c8,_0xb3159f){var _0x406bc8=[];if(!_[_0x1cd3('0xf')](_0xb3159f[_0x1cd3('0x10')])&&!_['isNil'](_0x17d5c8[_0xb3159f[_0x1cd3('0x10')]])&&!_[_0x1cd3('0xf')](_0x17d5c8[_0xb3159f[_0x1cd3('0x10')]][_0x1cd3('0x11')])){_0x406bc8=_['map'](_0x17d5c8[_0xb3159f[_0x1cd3('0x10')]]['Intervals'],_0x1cd3('0x12'));}else if(!_[_0x1cd3('0xf')](_0xb3159f[_0x1cd3('0x12')])){_0x406bc8=[_0xb3159f['interval']];}return _0x406bc8;}exports['listen']=function(_0x1a874c){_0x1a874c[_0x1cd3('0x13')]={};return new BPromise(function(_0x41585f,_0x569c98){var _0x2b28cf={'Start':function(_0x40cbbf){var _0x5a2b84=this;return new Promise(function(_0x418da3,_0x576d7a){if(_0x40cbbf){try{var _0x5b7e16=[];var _0x5531c5=getId(_0x40cbbf['channel'],_0x40cbbf['message']?_0x40cbbf['message']['id']:0x0,_0x40cbbf[_0x1cd3('0x14')]?_0x40cbbf[_0x1cd3('0x14')]['id']:0x0);if(_0x40cbbf[_0x1cd3('0x15')]&&_[_0x1cd3('0x16')](_0x40cbbf[_0x1cd3('0x15')])&&_0x40cbbf[_0x1cd3('0x15')][_0x1cd3('0x17')]){for(var _0x2d4f05=0x0;_0x2d4f05<_0x40cbbf[_0x1cd3('0x15')][_0x1cd3('0x17')];_0x2d4f05+=0x1){var _0x4c05c2=_0x40cbbf[_0x1cd3('0x15')][_0x2d4f05];if(fs[_0x1cd3('0x18')](path['join'](__dirname,_0x1cd3('0x15'),_0x4c05c2[_0x1cd3('0x19')]+'.js'))){var _0x20cda5=[];switch(_0x4c05c2[_0x1cd3('0x19')][_0x1cd3('0x1a')]()){case _0x1cd3('0x1b'):var _0x58d948=_0x4c05c2['appdata'][_0x1cd3('0x1c')](',');if(_0x40cbbf[_0x1cd3('0x1d')]==='mail'){_0x20cda5['push'](_0x58d948[0x0]);_0x20cda5[_0x1cd3('0x1e')](_0x58d948[0x1]);_0x20cda5[_0x1cd3('0x1e')](_0x58d948['slice'](0x2,_0x58d948['length'])[_0x1cd3('0x1f')](','));}else{_0x20cda5[_0x1cd3('0x1e')](_0x58d948[0x0]);_0x20cda5['push'](_0x58d948['slice'](0x1,_0x58d948[_0x1cd3('0x17')])[_0x1cd3('0x1f')](','));}break;case _0x1cd3('0x20'):var _0x5e4dc7=_0x4c05c2['appdata'][_0x1cd3('0x1c')](',');_0x20cda5['push'](_0x5e4dc7[0x0]);_0x20cda5[_0x1cd3('0x1e')](_0x5e4dc7[0x1]);_0x20cda5[_0x1cd3('0x1e')](_0x5e4dc7[_0x1cd3('0x21')](0x2,_0x5e4dc7['length'])[_0x1cd3('0x1f')](','));break;case'dialogflowv2':var _0x47578c=_0x4c05c2[_0x1cd3('0x22')][_0x1cd3('0x1c')](',');_0x20cda5['push'](_0x47578c[0x0]);_0x20cda5[_0x1cd3('0x1e')](_0x47578c[0x1]);_0x20cda5[_0x1cd3('0x1e')](_0x47578c[0x2]);_0x20cda5[_0x1cd3('0x1e')](_0x47578c[0x3]);_0x20cda5[_0x1cd3('0x1e')](_0x47578c[_0x1cd3('0x21')](0x4,_0x47578c['length'])[_0x1cd3('0x1f')](','));break;case _0x1cd3('0x23'):var _0x1412cb=_0x4c05c2[_0x1cd3('0x22')][_0x1cd3('0x1c')](',');_0x20cda5[_0x1cd3('0x1e')](_0x1412cb[0x0]);_0x20cda5['push'](_0x1412cb[0x1]);_0x20cda5[_0x1cd3('0x1e')](_0x1412cb[0x2]);_0x20cda5[_0x1cd3('0x1e')](_0x1412cb[0x3]);_0x20cda5['push'](_0x1412cb['slice'](0x4,_0x1412cb[_0x1cd3('0x17')])[_0x1cd3('0x1f')](','));break;case _0x1cd3('0x24'):_0x20cda5[_0x1cd3('0x1e')](_0x4c05c2[_0x1cd3('0x22')]);break;case'tag':_0x20cda5[_0x1cd3('0x1e')](_0x4c05c2['TagId']);_0x20cda5['push'](_0x4c05c2[_0x1cd3('0x22')]);break;case _0x1cd3('0x25'):var _0x225dc8=utils[_0x1cd3('0x26')](_0x40cbbf['account'][_0x1cd3('0x27')],_0x40cbbf);var _0x4f8c2a=_0x4c05c2[_0x1cd3('0x22')][_0x1cd3('0x1c')](',');_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x0]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x1]);_0x20cda5['push'](_0x4f8c2a[0x2]);_0x20cda5['push'](_0x4f8c2a[0x3]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x4]);_0x20cda5['push'](_0x4f8c2a[0x5]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x6]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x7]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x8]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0x9]);_0x20cda5[_0x1cd3('0x1e')](_0x4f8c2a[0xa]);_0x20cda5['push'](_0x40cbbf['interaction']['id']);_0x20cda5['push'](_0x40cbbf['message']['id']);_0x20cda5[_0x1cd3('0x1e')](_0x4c05c2['ChatWebsiteId']);_0x20cda5[_0x1cd3('0x1e')](_0x40cbbf['interaction'][_0x1cd3('0x28')]);_0x20cda5[_0x1cd3('0x1e')](_0x40cbbf['body'][_0x1cd3('0x29')]);_0x20cda5[_0x1cd3('0x1e')](_0x225dc8);break;default:_0x20cda5=_[_0x1cd3('0xf')](_0x4c05c2['appdata'])?[]:_0x4c05c2['appdata'][_0x1cd3('0x1c')](',');}var _0x203dc0={'id':util[_0x1cd3('0xd')](_0x1cd3('0x2a'),_0x5531c5,_0x4c05c2['id'],_0x4c05c2[_0x1cd3('0x19')]),'condition':require(_0x1cd3('0x2b'))[_0x1cd3('0x2c')](_0x5531c5,getIntervals(_0x1a874c[_0x1cd3('0x2d')],_0x4c05c2),_0x1a874c),'consequence':require(_0x1cd3('0x2e')+_0x4c05c2['app'])['consequence'](_0x5531c5,_0x20cda5,_0x1a874c,_0x40cbbf),'p':_0x4c05c2['priority']||0x0};logger[_0x1cd3('0x2f')](_0x1cd3('0x30'),_0x203dc0['id'],'on\x20interval',getIntervals(_0x1a874c[_0x1cd3('0x2d')],_0x4c05c2)['join'](_0x1cd3('0x31')));_0x5b7e16[_0x1cd3('0x1e')](_0x203dc0);}else{logger[_0x1cd3('0x32')](_0x1cd3('0x33'),path['join'](__dirname,'applications',_0x4c05c2['app']+_0x1cd3('0x34')));}}_0x1a874c['rules'][_0x5531c5]=new RuleEngine(_0x5b7e16);_0x1a874c['rules'][_0x5531c5][_0x1cd3('0x35')](_0x40cbbf,function(_0x522890){logger[_0x1cd3('0x2f')](_0x1cd3('0x36'),JSON[_0x1cd3('0x37')](_0x522890[_0x1cd3('0x38')]));if(_0x1a874c[_0x1cd3('0x13')][_0x5531c5]){_0x1a874c[_0x1cd3('0x13')][_0x5531c5][_0x1cd3('0x39')](_0x1cd3('0x3a'));}});return _0x418da3({'code':0xc8,'message':_0x40cbbf});}else{logger['info'](_0x1cd3('0x3b'));return _0x418da3({'code':0xc8,'message':_0x40cbbf});}}catch(_0x2c93ab){logger[_0x1cd3('0x32')](_0x2c93ab['stack']);return _0x576d7a(_0x5a2b84['error'](0x1f4,_0x2c93ab));}}return _0x576d7a(_0x1cd3('0x3c'));});},'AcceptMessage':function(_0x324e1d){var _0x11d4b4=this;return new Promise(function(_0x723282,_0x297223){if(_0x324e1d[_0x1cd3('0x3d')]&&_0x324e1d[_0x1cd3('0x3d')]['id']){if(_0x1a874c['agents'][_0x324e1d[_0x1cd3('0x3d')]['id']]){_0x1a874c[_0x1cd3('0x3e')][_0x324e1d[_0x1cd3('0x3d')]['id']]['busy']=![];_0x1a874c['agents'][_0x324e1d[_0x1cd3('0x3d')]['id']][_0x1cd3('0x3f')]=undefined;}}if(_0x324e1d[_0x1cd3('0x24')]&&_0x324e1d[_0x1cd3('0x24')]['id']){try{var _0x332b49=getId(_0x324e1d['channel'],_0x324e1d['message']?_0x324e1d['message']['id']:0x0,_0x324e1d[_0x1cd3('0x14')]?_0x324e1d[_0x1cd3('0x14')]['id']:0x0);if(_0x1a874c[_0x1cd3('0x13')][_0x332b49]){_0x1a874c[_0x1cd3('0x13')][_0x332b49][_0x1cd3('0x39')]('end');if(rpc[_0x324e1d['channel']+_0x1cd3('0x40')]){rpc[_0x324e1d[_0x1cd3('0x1d')]+'QueueReport'][_0x1cd3('0x41')](_0x332b49,{'UserId':_0x324e1d[_0x1cd3('0x24')][_0x1cd3('0x42')]})['catch'](function(_0x4ddfba){logger[_0x1cd3('0x32')]('error\x20update\x20queue\x20report');});}}return _0x723282({'code':0xc8,'message':_0x324e1d});}catch(_0x2163d1){logger[_0x1cd3('0x32')](_0x2163d1[_0x1cd3('0x43')]);return _0x297223(_0x11d4b4[_0x1cd3('0x32')](0x1f4,_0x2163d1));}}logger[_0x1cd3('0x32')](_0x1cd3('0x44'));return _0x297223(_0x11d4b4[_0x1cd3('0x32')](0x1f4,_0x1cd3('0x44')));});},'RejectMessage':function(_0x5734f0){var _0x251822=this;return new Promise(function(_0xa261fc,_0xbd4ea2){if(_0x5734f0[_0x1cd3('0x3d')]&&_0x5734f0['agent']['id']){try{if(_0x1a874c[_0x1cd3('0x3e')][_0x5734f0[_0x1cd3('0x3d')]['id']]){_0x1a874c[_0x1cd3('0x3e')][_0x5734f0['agent']['id']]['busy']=![];_0x1a874c[_0x1cd3('0x3e')][_0x5734f0['agent']['id']][_0x1cd3('0x3f')]=undefined;}return _0xa261fc({'code':0xc8,'message':_0x5734f0});}catch(_0x233ef5){logger[_0x1cd3('0x32')](_0x233ef5[_0x1cd3('0x43')]);return _0xbd4ea2(_0x251822['error'](0x1f4,_0x233ef5));}}logger[_0x1cd3('0x32')](_0x1cd3('0x44'));return _0xbd4ea2(_0x251822[_0x1cd3('0x32')](0x1f4,_0x1cd3('0x44')));});},'AbandonInteraction':function(_0x57a1e7){var _0x27b8ef=this;return new Promise(function(_0x32588f,_0x4b2e0f){if(_0x57a1e7['channel']&&_0x57a1e7[_0x1cd3('0x14')]&&_0x57a1e7['interaction']['id']){try{var _0x26111a=getId(_0x57a1e7[_0x1cd3('0x1d')],_0x57a1e7[_0x1cd3('0x24')]?_0x57a1e7[_0x1cd3('0x24')]['id']:0x0,_0x57a1e7[_0x1cd3('0x14')]?_0x57a1e7[_0x1cd3('0x14')]['id']:0x0);if(_0x1a874c[_0x1cd3('0x13')][_0x26111a]){_0x1a874c['rules'][_0x26111a][_0x1cd3('0x39')](_0x1cd3('0x45'));}return _0x32588f({'code':0xc8,'message':_0x57a1e7});}catch(_0x22ea88){logger[_0x1cd3('0x32')](_0x22ea88[_0x1cd3('0x43')]);return _0x4b2e0f(_0x27b8ef[_0x1cd3('0x32')](0x1f4,_0x22ea88));}}logger[_0x1cd3('0x32')](_0x1cd3('0x44'));return _0x4b2e0f(_0x27b8ef[_0x1cd3('0x32')](0x1f4,_0x1cd3('0x44')));});},'AgentCapacity':function(_0x3e1257){var _0x1c01e2=this;return new Promise(function(_0x3d7bca,_0x5057a6){if(_0x1a874c[_0x1cd3('0x3e')]['hasOwnProperty'](_0x3e1257['id'])){for(var _0x7d8acb in _0x3e1257[_0x1cd3('0x46')]){if(_0x3e1257[_0x1cd3('0x46')]['hasOwnProperty'](_0x7d8acb)){if(_0x1a874c[_0x1cd3('0x3e')][_0x3e1257['id']][_0x1cd3('0x47')](_0x7d8acb+_0x1cd3('0x48'))){_0x1a874c[_0x1cd3('0x3e')][_0x3e1257['id']][_0x7d8acb+_0x1cd3('0x48')]=parseInt(_0x3e1257[_0x1cd3('0x46')][_0x7d8acb],0xa);}}}_0x1a874c[_0x1cd3('0x3e')][_0x3e1257['id']][_0x1cd3('0x49')]();return _0x3d7bca({'code':0xc8,'message':_0x1a874c[_0x1cd3('0x3e')][_0x3e1257['id']]});}else{return _0x5057a6(_0x1c01e2['error'](0x1f4,_0x1cd3('0x4a')));}});},'Agents':function(_0xcbe01f){return new Promise(function(_0x1344aa,_0x2c839b){var _0x512838=_[_0x1cd3('0x4b')](_0x1a874c[_0x1cd3('0x3e')]);_0x1344aa({'count':_0x512838[_0x1cd3('0x17')],'rows':_0x512838});});},'ChatQueues':function(_0x3b6033){return new Promise(function(_0x1541c9,_0x1ffff6){var _0x5b7bc6=[];for(var _0x66accf in _0x1a874c[_0x1cd3('0x4c')]){if(_0x1a874c[_0x1cd3('0x4c')][_0x1cd3('0x47')](_0x66accf)){var _0x24aa3a=_0x1a874c[_0x1cd3('0x4c')][_0x66accf];var _0x332bd2={'id':_0x24aa3a['id'],'available':_0x24aa3a[_0x1cd3('0x4d')],'loggedIn':_0x24aa3a[_0x1cd3('0x4e')],'name':_0x24aa3a[_0x1cd3('0x4f')],'paused':_0x24aa3a['paused'],'waiting':_0x24aa3a[_0x1cd3('0x50')]};_0x5b7bc6[_0x1cd3('0x1e')](_0x332bd2);}}_0x1541c9({'count':_0x5b7bc6[_0x1cd3('0x17')],'rows':_0x5b7bc6});});},'MailQueues':function(_0x18d6a9){return new Promise(function(_0x304640,_0x5e1a4c){var _0x983ccd=[];for(var _0x3eb08a in _0x1a874c[_0x1cd3('0x51')]){if(_0x1a874c['mailQueues'][_0x1cd3('0x47')](_0x3eb08a)){var _0x4ad4b5=_0x1a874c[_0x1cd3('0x51')][_0x3eb08a];var _0x1175c2={'id':_0x4ad4b5['id'],'available':_0x4ad4b5['available'],'loggedIn':_0x4ad4b5[_0x1cd3('0x4e')],'name':_0x4ad4b5[_0x1cd3('0x4f')],'paused':_0x4ad4b5[_0x1cd3('0x52')],'waiting':_0x4ad4b5['waiting']};_0x983ccd[_0x1cd3('0x1e')](_0x1175c2);}}_0x304640({'count':_0x983ccd[_0x1cd3('0x17')],'rows':_0x983ccd});});},'OpenchannelQueues':function(_0x11c167){return new Promise(function(_0x106a18,_0x2b9996){var _0x48ef45=[];for(var _0x4affb2 in _0x1a874c[_0x1cd3('0x53')]){if(_0x1a874c[_0x1cd3('0x53')]['hasOwnProperty'](_0x4affb2)){var _0x282727=_0x1a874c['openchannelQueues'][_0x4affb2];var _0x422ff1={'id':_0x282727['id'],'available':_0x282727['available'],'loggedIn':_0x282727['loggedIn'],'name':_0x282727[_0x1cd3('0x4f')],'paused':_0x282727['paused'],'waiting':_0x282727[_0x1cd3('0x50')]};_0x48ef45['push'](_0x422ff1);}}_0x106a18({'count':_0x48ef45[_0x1cd3('0x17')],'rows':_0x48ef45});});},'SmsQueues':function(_0x2ac607){return new Promise(function(_0x4398cd,_0x9046aa){var _0x510eeb=[];for(var _0x3432d3 in _0x1a874c[_0x1cd3('0x54')]){if(_0x1a874c['smsQueues'][_0x1cd3('0x47')](_0x3432d3)){var _0x32da5f=_0x1a874c['smsQueues'][_0x3432d3];var _0x1acc86={'id':_0x32da5f['id'],'available':_0x32da5f[_0x1cd3('0x4d')],'loggedIn':_0x32da5f[_0x1cd3('0x4e')],'name':_0x32da5f['name'],'paused':_0x32da5f[_0x1cd3('0x52')],'waiting':_0x32da5f['waiting']};_0x510eeb[_0x1cd3('0x1e')](_0x1acc86);}}_0x4398cd({'count':_0x510eeb[_0x1cd3('0x17')],'rows':_0x510eeb});});},'FaxQueues':function(_0x458e5e){return new Promise(function(_0x150da3,_0x598c6c){var _0x1926e6=[];for(var _0x2e3d1f in _0x1a874c[_0x1cd3('0x55')]){if(_0x1a874c[_0x1cd3('0x55')]['hasOwnProperty'](_0x2e3d1f)){var _0x3f5f8f=_0x1a874c[_0x1cd3('0x55')][_0x2e3d1f];var _0x1c9675={'id':_0x3f5f8f['id'],'available':_0x3f5f8f[_0x1cd3('0x4d')],'loggedIn':_0x3f5f8f['loggedIn'],'name':_0x3f5f8f[_0x1cd3('0x4f')],'paused':_0x3f5f8f['paused'],'waiting':_0x3f5f8f[_0x1cd3('0x50')]};_0x1926e6[_0x1cd3('0x1e')](_0x1c9675);}}_0x150da3({'count':_0x1926e6[_0x1cd3('0x17')],'rows':_0x1926e6});});},'WhatsappQueues':function(_0x5656cc){return new Promise(function(_0x11ded5,_0x1c5800){var _0x46886f=[];for(var _0x256d31 in _0x1a874c[_0x1cd3('0x56')]){if(_0x1a874c[_0x1cd3('0x56')][_0x1cd3('0x47')](_0x256d31)){var _0x63cc94=_0x1a874c[_0x1cd3('0x56')][_0x256d31];var _0x2b1a93={'id':_0x63cc94['id'],'available':_0x63cc94['available'],'loggedIn':_0x63cc94[_0x1cd3('0x4e')],'name':_0x63cc94[_0x1cd3('0x4f')],'paused':_0x63cc94['paused'],'waiting':_0x63cc94[_0x1cd3('0x50')]};_0x46886f[_0x1cd3('0x1e')](_0x2b1a93);}}_0x11ded5({'count':_0x46886f[_0x1cd3('0x17')],'rows':_0x46886f});});},'ChatQueuesWaitingInteractions':function(_0x3f678a){return new Promise(function(_0x1565bd,_0x1d023b){var _0x313e6e=_[_0x1cd3('0x4b')](_0x1a874c[_0x1cd3('0x57')]);_0x1565bd({'count':_0x313e6e['length'],'rows':_0x313e6e});});},'MailQueuesWaitingInteractions':function(_0x3da1eb){return new Promise(function(_0x47ab19,_0x2137fd){var _0x435a41=_['values'](_0x1a874c['mailQueuesWaitingInteractions']);_0x47ab19({'count':_0x435a41[_0x1cd3('0x17')],'rows':_0x435a41});});},'OpenchannelQueuesWaitingInteractions':function(_0x43f489){return new Promise(function(_0x26c2d3,_0x570a00){var _0x11c045=_[_0x1cd3('0x4b')](_0x1a874c[_0x1cd3('0x58')]);_0x26c2d3({'count':_0x11c045['length'],'rows':_0x11c045});});},'SmsQueuesWaitingInteractions':function(_0x369879){return new Promise(function(_0xb7c13b,_0x571f3e){var _0xb44f6d=_[_0x1cd3('0x4b')](_0x1a874c[_0x1cd3('0x59')]);_0xb7c13b({'count':_0xb44f6d[_0x1cd3('0x17')],'rows':_0xb44f6d});});},'FaxQueuesWaitingInteractions':function(_0x40e190){return new Promise(function(_0x35abf0,_0x5c5327){var _0x3ef751=_['values'](_0x1a874c[_0x1cd3('0x5a')]);_0x35abf0({'count':_0x3ef751[_0x1cd3('0x17')],'rows':_0x3ef751});});},'WhatsappQueuesWaitingInteractions':function(_0x40c38f){return new Promise(function(_0x13cfbe,_0x217328){var _0x34d50e=_[_0x1cd3('0x4b')](_0x1a874c[_0x1cd3('0x5b')]);_0x13cfbe({'count':_0x34d50e[_0x1cd3('0x17')],'rows':_0x34d50e});});}};var _0x37b016=jayson['server'](_0x2b28cf)[_0x1cd3('0x5c')]();_0x37b016['on'](_0x1cd3('0x32'),function(_0x542b6e){logger[_0x1cd3('0x32')](JSON['stringify'](_0x542b6e));return _0x569c98(_0x542b6e);});_0x37b016[_0x1cd3('0x5d')](0x232c,_0x1cd3('0x5e'),function(){console[_0x1cd3('0x5f')](_0x1cd3('0x60'),0x232c);return _0x41585f(_0x1cd3('0x61')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index b957887..0d3cd23 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 _0x4d8e=['[%s][INTERVAL]\x20%s','all','info','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','log','util','bluebird','jayson/promise','lodash','../../../config/logger','client','request','then','error','result','catch','condition','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','Command','iftime\x20%s','message','indexOf','true'];(function(_0x20b728,_0x599ea9){var _0x131c85=function(_0x4f56f6){while(--_0x4f56f6){_0x20b728['push'](_0x20b728['shift']());}};_0x131c85(++_0x599ea9);}(_0x4d8e,0x1b7));var _0xe4d8=function(_0x5c3a42,_0x23ace6){_0x5c3a42=_0x5c3a42-0x0;var _0x283a0c=_0x4d8e[_0x5c3a42];return _0x283a0c;};'use strict';var util=require(_0xe4d8('0x0'));var BPromise=require(_0xe4d8('0x1'));var jayson=require(_0xe4d8('0x2'));var _=require(_0xe4d8('0x3'));var logger=require(_0xe4d8('0x4'))('routing');var client=jayson[_0xe4d8('0x5')]['http']({'port':0x232a});function request(_0x346c4b,_0x46bc22){return new BPromise(function(_0x3a5c5a,_0x2a6963){return client[_0xe4d8('0x6')](_0x346c4b,_0x46bc22)[_0xe4d8('0x7')](function(_0xd1d4e2){if(_0xd1d4e2[_0xe4d8('0x8')]){return _0x2a6963(_0xd1d4e2[_0xe4d8('0x8')]['message']);}else{return _0x3a5c5a(_0xd1d4e2[_0xe4d8('0x9')]);}})[_0xe4d8('0xa')](function(_0x4b71f1){return _0x2a6963(_0x4b71f1);});});}exports[_0xe4d8('0xb')]=function(_0x87e7d0,_0x35a47e,_0x46100d){return function(_0x398dbf){if(_0x46100d['rules']&&!_0x46100d['rules'][_0x87e7d0]){logger['info'](_0xe4d8('0xc'),_0x87e7d0);return _0x398dbf[_0xe4d8('0xd')]();}var _0x13cb0f=[];for(var _0x50f30c=0x0;_0x50f30c<_0x35a47e['length'];_0x50f30c+=0x1){_0x13cb0f[_0xe4d8('0xe')](request(_0xe4d8('0xf'),{'command':util['format'](_0xe4d8('0x10'),_0x35a47e[_0x50f30c])})[_0xe4d8('0x7')](function(_0x3e8d18){return _0x3e8d18&&_0x3e8d18['message']&&_0x3e8d18[_0xe4d8('0x11')][_0xe4d8('0x12')](_0xe4d8('0x13'))>=0x0?!![]:![];})['catch'](function(_0x5acf4a){logger[_0xe4d8('0x8')](_0xe4d8('0x14'),_0x87e7d0,_0x35a47e[_0x50f30c]);}));}BPromise[_0xe4d8('0x15')](_0x13cb0f)[_0xe4d8('0x7')](function(_0x38f50d){var _0x3763b2=_['some'](_0x38f50d);logger[_0xe4d8('0x16')](_0xe4d8('0x17'),_0x87e7d0,_0x35a47e[_0xe4d8('0x18')](_0xe4d8('0x19')),_0x3763b2);_0x398dbf['when'](_0x3763b2);})[_0xe4d8('0xa')](function(_0x31c0f8){console[_0xe4d8('0x1a')](_0x31c0f8);logger[_0xe4d8('0x8')](_0xe4d8('0x17'),_0x87e7d0,_0x35a47e[_0xe4d8('0x18')](_0xe4d8('0x19')),_0x31c0f8['stack']);_0x398dbf[_0xe4d8('0xd')]();});};}; \ No newline at end of file +var _0x2223=['../../../config/logger','routing','client','http','then','error','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','Command','format','message','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','join','when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','bluebird'];(function(_0x501165,_0x56fb0b){var _0x523247=function(_0x2e2da7){while(--_0x2e2da7){_0x501165['push'](_0x501165['shift']());}};_0x523247(++_0x56fb0b);}(_0x2223,0x6b));var _0x3222=function(_0x1c8462,_0x4deaf4){_0x1c8462=_0x1c8462-0x0;var _0x186c54=_0x2223[_0x1c8462];return _0x186c54;};'use strict';var util=require('util');var BPromise=require(_0x3222('0x0'));var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x3222('0x1'))(_0x3222('0x2'));var client=jayson[_0x3222('0x3')][_0x3222('0x4')]({'port':0x232a});function request(_0x2581f1,_0x503da9){return new BPromise(function(_0xcac0fe,_0x543f14){return client['request'](_0x2581f1,_0x503da9)[_0x3222('0x5')](function(_0x4abecf){if(_0x4abecf['error']){return _0x543f14(_0x4abecf[_0x3222('0x6')]['message']);}else{return _0xcac0fe(_0x4abecf[_0x3222('0x7')]);}})['catch'](function(_0x18c423){return _0x543f14(_0x18c423);});});}exports['condition']=function(_0x235fd5,_0x4686ff,_0x19a29f){return function(_0x423204){if(_0x19a29f[_0x3222('0x8')]&&!_0x19a29f[_0x3222('0x8')][_0x235fd5]){logger[_0x3222('0x9')](_0x3222('0xa'),_0x235fd5);return _0x423204[_0x3222('0xb')]();}var _0x4574d0=[];for(var _0x449307=0x0;_0x449307<_0x4686ff[_0x3222('0xc')];_0x449307+=0x1){_0x4574d0['push'](request(_0x3222('0xd'),{'command':util[_0x3222('0xe')]('iftime\x20%s',_0x4686ff[_0x449307])})['then'](function(_0x34543b){return _0x34543b&&_0x34543b[_0x3222('0xf')]&&_0x34543b[_0x3222('0xf')][_0x3222('0x10')](_0x3222('0x11'))>=0x0?!![]:![];})[_0x3222('0x12')](function(_0x3cc00c){logger[_0x3222('0x6')](_0x3222('0x13'),_0x235fd5,_0x4686ff[_0x449307]);}));}BPromise[_0x3222('0x14')](_0x4574d0)[_0x3222('0x5')](function(_0x14937c){var _0x423ae5=_[_0x3222('0x15')](_0x14937c);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x235fd5,_0x4686ff[_0x3222('0x16')]('\x20|\x20'),_0x423ae5);_0x423204[_0x3222('0x17')](_0x423ae5);})[_0x3222('0x12')](function(_0x4c0d2b){console[_0x3222('0x18')](_0x4c0d2b);logger[_0x3222('0x6')](_0x3222('0x19'),_0x235fd5,_0x4686ff[_0x3222('0x16')](_0x3222('0x1a')),_0x4c0d2b['stack']);_0x423204[_0x3222('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 0c917ea..71f60ad 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 _0x5b02=['ringtime','error','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','talktime','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','[%s][agents][blindtransfer]','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','attendedtransfer','[%s][agents][attendedtransfer]','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','origtransfereruniqueid','secondtransfereruniqueid','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','indexOf','agent','lodash','util','./utils','format','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','getVoiceQueueByName','type','agentcomplete','acw','acwtime','agentacw','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','[%s][agents][agentcalled]','agentcalledAt','now','called','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','timeout','reason','holdtime'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5b02,0xe9));var _0x25b0=function(_0x4e4493,_0x192a5a){_0x4e4493=_0x4e4493-0x0;var _0x424298=_0x5b02[_0x4e4493];return _0x424298;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var utils=require(_0x25b0('0x2'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1c3295,_0x4ef71c){utils['info'](util[_0x25b0('0x3')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x1c3295[_0x25b0('0x4')],_0x1c3295[_0x25b0('0x5')],_0x1c3295[_0x25b0('0x6')],_0x1c3295[_0x25b0('0x7')],_0x1c3295[_0x25b0('0x8')],_0x1c3295['calleridnum'],_0x1c3295[_0x25b0('0x9')],_0x1c3295[_0x25b0('0xa')]));if(_0x1c3295['queue']){utils[_0x25b0('0xb')](_0x1c3295['queue'])['then'](function(_0x24f98b){if(_0x24f98b){_0x1c3295[_0x25b0('0xc')]=_0x24f98b[_0x25b0('0xc')];_0x1c3295['agentacw']=_0x1c3295[_0x25b0('0xd')]?_0x24f98b[_0x25b0('0xe')]:![];_0x1c3295[_0x25b0('0xf')]=_0x1c3295[_0x25b0('0x10')]?_0x24f98b[_0x25b0('0x11')]:0x0;}utils[_0x25b0('0x12')](_0x25b0('0x13'),_0x1c3295);});}else{utils[_0x25b0('0x12')](_0x25b0('0x13'),_0x1c3295);}if(_0x4ef71c){delete transfers[_0x1c3295[_0x25b0('0x4')]];}else{delete agents[_0x1c3295[_0x25b0('0x14')]];}}exports[_0x25b0('0x15')]=function(_0x2048dc){try{utils[_0x25b0('0x16')](util[_0x25b0('0x3')](_0x25b0('0x17'),_0x2048dc[_0x25b0('0x4')]),_0x2048dc);agents[_0x2048dc[_0x25b0('0x14')]]=_0x2048dc;agents[_0x2048dc[_0x25b0('0x14')]][_0x25b0('0x18')]=utils[_0x25b0('0x19')]();agents[_0x2048dc['destuniqueid']]['lastevent']=_0x25b0('0x1a');agents[_0x2048dc['destuniqueid']][_0x25b0('0x9')]=null;agents[_0x2048dc[_0x25b0('0x14')]][_0x25b0('0x1b')]=null;utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x1d'),_0x2048dc[_0x25b0('0x4')],agents[_0x2048dc[_0x25b0('0x14')]][_0x25b0('0x7')],_0x2048dc[_0x25b0('0x14')]));}catch(_0x25872d){utils['error'](util[_0x25b0('0x3')](_0x25b0('0x17'),_0x2048dc[_0x25b0('0x4')]),_0x25872d);}};exports[_0x25b0('0x1e')]=function(_0x1dc691){try{if(!_[_0x25b0('0x1f')](agents[_0x1dc691[_0x25b0('0x14')]])){utils[_0x25b0('0x16')](util[_0x25b0('0x3')](_0x25b0('0x20'),_0x1dc691[_0x25b0('0x4')]),_0x1dc691);utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x21'),_0x1dc691[_0x25b0('0x4')],agents[_0x1dc691['destuniqueid']][_0x25b0('0x7')],_0x1dc691[_0x25b0('0x14')]));agents[_0x1dc691[_0x25b0('0x14')]]['agentringnoanswer']=!![];agents[_0x1dc691['destuniqueid']]['agentringnoanswerAt']=utils[_0x25b0('0x19')]();agents[_0x1dc691[_0x25b0('0x14')]][_0x25b0('0xa')]=_0x25b0('0x22');agents[_0x1dc691[_0x25b0('0x14')]][_0x25b0('0x23')]=_0x25b0('0x22');agents[_0x1dc691[_0x25b0('0x14')]][_0x25b0('0x24')]=_0x1dc691['ringtime']?parseInt(_0x1dc691[_0x25b0('0x25')])/0x3e8:0x0;agents[_0x1dc691[_0x25b0('0x14')]]['talktime']=0x0;unanswered['push'](_0x1dc691['destuniqueid']);}}catch(_0x1a6212){utils[_0x25b0('0x26')](util[_0x25b0('0x3')](_0x25b0('0x20'),_0x1dc691[_0x25b0('0x4')]),_0x1a6212);}};exports[_0x25b0('0x27')]=function(_0x12676b){try{_[_0x25b0('0x28')](agents,function(_0x36b81d,_0x285a2b){if(_0x36b81d[_0x25b0('0x4')]==_0x12676b[_0x25b0('0x4')]&&!_[_0x25b0('0x29')](unanswered,_0x36b81d['destuniqueid'])){utils['debug'](util[_0x25b0('0x3')]('[%s][agents][queuecallerabandon]',_0x12676b['uniqueid']),_0x12676b);utils[_0x25b0('0x1c')](util[_0x25b0('0x3')](_0x25b0('0x2a'),_0x12676b[_0x25b0('0x4')],_0x36b81d[_0x25b0('0x7')],_0x36b81d['destuniqueid']));_0x36b81d[_0x25b0('0x1e')]=!![];_0x36b81d[_0x25b0('0x2b')]=utils['now']();_0x36b81d[_0x25b0('0xa')]=_0x25b0('0x2c');_0x36b81d['reason']=_0x25b0('0x2c');_0x36b81d['holdtime']=_0x12676b[_0x25b0('0x24')];_0x36b81d[_0x25b0('0x2d')]=0x0;writeDB(_0x36b81d);}});}catch(_0x14ccc6){utils[_0x25b0('0x26')](util[_0x25b0('0x3')](_0x25b0('0x2e'),_0x12676b[_0x25b0('0x4')]),_0x14ccc6);}};exports[_0x25b0('0x2f')]=function(_0x2f123c){try{if(agents[_0x2f123c['destuniqueid']]){utils[_0x25b0('0x16')](util[_0x25b0('0x3')](_0x25b0('0x30'),_0x2f123c[_0x25b0('0x4')]),_0x2f123c);utils[_0x25b0('0x1c')](util[_0x25b0('0x3')](_0x25b0('0x31'),_0x2f123c[_0x25b0('0x4')],agents[_0x2f123c[_0x25b0('0x14')]][_0x25b0('0x7')],_0x2f123c['destuniqueid']));agents[_0x2f123c[_0x25b0('0x14')]][_0x25b0('0x32')]=utils[_0x25b0('0x19')]();agents[_0x2f123c['destuniqueid']][_0x25b0('0x9')]=_0x2f123c[_0x25b0('0x9')];agents[_0x2f123c[_0x25b0('0x14')]][_0x25b0('0x1b')]=_0x2f123c[_0x25b0('0x1b')];agents[_0x2f123c[_0x25b0('0x14')]][_0x25b0('0x24')]=_0x2f123c[_0x25b0('0x25')];agents[_0x2f123c['destuniqueid']]['lastevent']=_0x25b0('0x33');_[_0x25b0('0x28')](agents,function(_0x3f4ae0,_0x52c0af){if(_0x3f4ae0[_0x25b0('0x14')]!=_0x2f123c['destuniqueid']&&_0x3f4ae0[_0x25b0('0x4')]==_0x2f123c[_0x25b0('0x4')]){_0x3f4ae0[_0x25b0('0x2d')]=0x0;_0x3f4ae0[_0x25b0('0x24')]=_0x2f123c[_0x25b0('0x25')];_0x3f4ae0['agentringnoanswer']=!![];_0x3f4ae0[_0x25b0('0x2b')]=utils[_0x25b0('0x19')]();_0x3f4ae0[_0x25b0('0xa')]=_0x25b0('0x34');_0x3f4ae0[_0x25b0('0x23')]='answered_elsewhere';_0x3f4ae0[_0x25b0('0x35')]=_0x2f123c[_0x25b0('0x14')];_0x3f4ae0[_0x25b0('0x36')]=_0x2f123c[_0x25b0('0x7')];writeDB(_0x3f4ae0);}});}}catch(_0x35fc00){utils[_0x25b0('0x26')](util[_0x25b0('0x3')](_0x25b0('0x30'),_0x2f123c[_0x25b0('0x4')]),_0x35fc00);}};exports[_0x25b0('0xd')]=function(_0x124d4b){try{if(!_['isNil'](agents[_0x124d4b[_0x25b0('0x14')]])){utils['debug'](util[_0x25b0('0x3')](_0x25b0('0x37'),_0x124d4b[_0x25b0('0x4')]),_0x124d4b);utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x38'),_0x124d4b[_0x25b0('0x4')],agents[_0x124d4b[_0x25b0('0x14')]]['membername'],_0x124d4b[_0x25b0('0x14')]));agents[_0x124d4b[_0x25b0('0x14')]][_0x25b0('0xd')]=!![];agents[_0x124d4b[_0x25b0('0x14')]][_0x25b0('0x39')]=utils[_0x25b0('0x19')]();agents[_0x124d4b[_0x25b0('0x14')]]['talktime']=utils[_0x25b0('0x3a')](agents[_0x124d4b[_0x25b0('0x14')]][_0x25b0('0x39')],agents[_0x124d4b['destuniqueid']][_0x25b0('0x32')]);agents[_0x124d4b[_0x25b0('0x14')]][_0x25b0('0x23')]=_0x124d4b[_0x25b0('0x23')];agents[_0x124d4b[_0x25b0('0x14')]]['lastevent']=_0x25b0('0x3b');writeDB(agents[_0x124d4b[_0x25b0('0x14')]]);}}catch(_0x23de77){utils['error'](util[_0x25b0('0x3')](_0x25b0('0x37'),_0x124d4b[_0x25b0('0x4')]),_0x23de77);}};exports[_0x25b0('0x3c')]=function(_0x29165e){try{if(!_[_0x25b0('0x1f')](agents[_0x29165e['transfereruniqueid']])){utils['debug'](util['format'](_0x25b0('0x3d'),_0x29165e['uniqueid']),_0x29165e);utils['info'](util[_0x25b0('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x29165e[_0x25b0('0x4')],agents[_0x29165e['transfereruniqueid']]['membername'],agents[_0x29165e[_0x25b0('0x3e')]][_0x25b0('0x4')]));agents[_0x29165e[_0x25b0('0x3e')]][_0x25b0('0x3f')]=!![];agents[_0x29165e[_0x25b0('0x3e')]][_0x25b0('0x40')]=_0x25b0('0x41');agents[_0x29165e[_0x25b0('0x3e')]][_0x25b0('0x42')]=_0x29165e[_0x25b0('0x43')];agents[_0x29165e['transfereruniqueid']]['transferuniqueid']=agents[_0x29165e['transfereruniqueid']][_0x25b0('0x4')];}}catch(_0xa45e87){utils[_0x25b0('0x26')](util[_0x25b0('0x3')](_0x25b0('0x3d'),_0x29165e[_0x25b0('0x4')]),_0xa45e87);}};exports[_0x25b0('0x44')]=function(_0x5d671a){try{utils[_0x25b0('0x16')](util['format'](_0x25b0('0x45'),_0x5d671a['origtransfereruniqueid']),_0x5d671a);if(_0x5d671a['origtransfereruniqueid']==_0x5d671a[_0x25b0('0x46')]){if(!_['isNil'](agents[_0x5d671a['secondtransfereruniqueid']])){utils[_0x25b0('0x1c')](util[_0x25b0('0x3')](_0x25b0('0x47'),_0x5d671a[_0x25b0('0x48')],agents[_0x5d671a[_0x25b0('0x49')]][_0x25b0('0x7')]));agents[_0x5d671a[_0x25b0('0x49')]][_0x25b0('0x3f')]=!![];agents[_0x5d671a[_0x25b0('0x49')]][_0x25b0('0x40')]='ATTENDED';agents[_0x5d671a['secondtransfereruniqueid']][_0x25b0('0x42')]=_0x5d671a[_0x25b0('0x4a')];agents[_0x5d671a['secondtransfereruniqueid']][_0x25b0('0x4b')]=_0x5d671a[_0x25b0('0x48')];}if(_0x5d671a[_0x25b0('0x4c')]&&agents[_0x5d671a[_0x25b0('0x4c')]]){agents[_0x5d671a[_0x25b0('0x4c')]]['agententerreason']=0x1;transfers[_0x5d671a[_0x25b0('0x4c')]]=_[_0x25b0('0x4d')](agents[_0x5d671a[_0x25b0('0x4c')]]);transfers[_0x5d671a['transfereeuniqueid']][_0x25b0('0x4e')]=agents[_0x5d671a[_0x25b0('0x49')]][_0x25b0('0x4e')];transfers[_0x5d671a[_0x25b0('0x4c')]][_0x25b0('0x4f')]=agents[_0x5d671a[_0x25b0('0x49')]][_0x25b0('0x4f')];transfers[_0x5d671a[_0x25b0('0x4c')]][_0x25b0('0x18')]=utils[_0x25b0('0x19')]();transfers[_0x5d671a[_0x25b0('0x4c')]][_0x25b0('0x32')]=utils[_0x25b0('0x19')]();transfers[_0x5d671a[_0x25b0('0x4c')]]['holdtime']=0x0;transfers[_0x5d671a[_0x25b0('0x4c')]][_0x25b0('0x50')]=0x2;}}else if(_0x5d671a['secondtransfereruniqueid']==_0x5d671a[_0x25b0('0x51')]){if(!_['isNil'](agents[_0x5d671a[_0x25b0('0x48')]])){utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x47'),_0x5d671a[_0x25b0('0x48')],agents[_0x5d671a[_0x25b0('0x48')]]['membername']));agents[_0x5d671a[_0x25b0('0x48')]]['transfer']=!![];agents[_0x5d671a[_0x25b0('0x48')]][_0x25b0('0x40')]='ATTENDED';agents[_0x5d671a[_0x25b0('0x48')]][_0x25b0('0x42')]=_0x5d671a['secondtransfererexten'];agents[_0x5d671a[_0x25b0('0x48')]]['transferuniqueid']=_0x5d671a['secondtransfereruniqueid'];}if(_0x5d671a['transfertargetuniqueid']&&agents[_0x5d671a[_0x25b0('0x52')]]){agents[_0x5d671a[_0x25b0('0x52')]][_0x25b0('0x50')]=0x1;transfers[_0x5d671a['transfertargetuniqueid']]=_[_0x25b0('0x4d')](agents[_0x5d671a[_0x25b0('0x52')]]);transfers[_0x5d671a[_0x25b0('0x52')]][_0x25b0('0x4e')]=agents[_0x5d671a[_0x25b0('0x48')]][_0x25b0('0x4e')];transfers[_0x5d671a[_0x25b0('0x52')]][_0x25b0('0x4f')]=agents[_0x5d671a[_0x25b0('0x48')]][_0x25b0('0x4f')];transfers[_0x5d671a[_0x25b0('0x52')]][_0x25b0('0x18')]=utils[_0x25b0('0x19')]();transfers[_0x5d671a[_0x25b0('0x52')]][_0x25b0('0x32')]=utils[_0x25b0('0x19')]();transfers[_0x5d671a[_0x25b0('0x52')]]['holdtime']=0x0;transfers[_0x5d671a[_0x25b0('0x52')]]['agententerreason']=0x2;}}}catch(_0x210ae3){utils[_0x25b0('0x26')](util[_0x25b0('0x3')](_0x25b0('0x45'),_0x5d671a['origtransfereruniqueid']),_0x210ae3);}};exports[_0x25b0('0x53')]=function(_0x646457){try{utils[_0x25b0('0x16')](util[_0x25b0('0x3')](_0x25b0('0x54'),_0x646457[_0x25b0('0x4')]),_0x646457);if(agents[_0x646457['uniqueid']]&&agents[_0x646457['uniqueid']][_0x25b0('0x23')]==='timeout'){if(_0x646457[_0x25b0('0x55')]==='21'){agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x23')]='rejected';agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0xa')]=_0x25b0('0x56');}utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x57'),_0x646457[_0x25b0('0x4')],agents[_0x646457[_0x25b0('0x4')]]['membername'],agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x23')],agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0xa')]));writeDB(agents[_0x646457[_0x25b0('0x4')]]);var _0x177be4=unanswered[_0x25b0('0x58')](_0x646457[_0x25b0('0x4')]);if(_0x177be4>-0x1){unanswered['splice'](_0x177be4,0x1);}}if(transfers[_0x646457[_0x25b0('0x4')]]){transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0xd')]=!![];transfers[_0x646457[_0x25b0('0x4')]]['agentcompleteAt']=utils['now']();transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0x2d')]=utils[_0x25b0('0x3a')](transfers[_0x646457[_0x25b0('0x4')]]['agentcompleteAt'],transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0x32')]);transfers[_0x646457['uniqueid']][_0x25b0('0x23')]=_0x25b0('0x59');transfers[_0x646457['uniqueid']]['lastevent']=_0x25b0('0x3b');utils[_0x25b0('0x1c')](util[_0x25b0('0x3')](_0x25b0('0x57'),_0x646457[_0x25b0('0x4')],transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0x7')],transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0x23')],transfers[_0x646457[_0x25b0('0x4')]][_0x25b0('0xa')]));writeDB(transfers[_0x646457[_0x25b0('0x4')]],!![]);}if(agents[_0x646457[_0x25b0('0x4')]]&&agents[_0x646457['uniqueid']][_0x25b0('0x32')]){agents[_0x646457['uniqueid']][_0x25b0('0xd')]=!![];agents[_0x646457[_0x25b0('0x4')]]['agentcompleteAt']=utils[_0x25b0('0x19')]();agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x2d')]=utils[_0x25b0('0x3a')](agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x39')],agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x32')]);agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0x23')]=agents[_0x646457[_0x25b0('0x4')]]['transfer']?'transfer':_0x25b0('0x59');agents[_0x646457[_0x25b0('0x4')]]['lastevent']='complete';utils[_0x25b0('0x1c')](util['format'](_0x25b0('0x57'),_0x646457[_0x25b0('0x4')],agents[_0x646457['uniqueid']][_0x25b0('0x7')],agents[_0x646457[_0x25b0('0x4')]]['reason'],agents[_0x646457[_0x25b0('0x4')]][_0x25b0('0xa')]));writeDB(agents[_0x646457[_0x25b0('0x4')]]);}}catch(_0x1aba93){utils[_0x25b0('0x26')](util['format']('[%s][agents][hangup]',_0x646457[_0x25b0('0x4')]),_0x1aba93);}}; \ No newline at end of file +var _0x57f8=['agentringnoanswer','[%s][agents][agentringnoanswer]','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','now','timeout','reason','holdtime','ringtime','talktime','push','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','[%s][agents][queuecallerabandon]','agentconnect','[%s][agents][agentconnect]','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','isNil','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','cause','rejected','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','splice','agent','[%s][agents][hangup]','util','./utils','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','then','type','agentacw','agentcomplete','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','debug','agentcalledAt','connectedlinename','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x57f8,0x198));var _0x857f=function(_0x3813ad,_0x2eff01){_0x3813ad=_0x3813ad-0x0;var _0x16ed55=_0x57f8[_0x3813ad];return _0x16ed55;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var utils=require(_0x857f('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x1e6e52,_0x3c0125){utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x4'),_0x1e6e52[_0x857f('0x5')],_0x1e6e52[_0x857f('0x6')],_0x1e6e52[_0x857f('0x7')],_0x1e6e52[_0x857f('0x8')],_0x1e6e52[_0x857f('0x9')],_0x1e6e52['calleridnum'],_0x1e6e52[_0x857f('0xa')],_0x1e6e52[_0x857f('0xb')]));if(_0x1e6e52[_0x857f('0x7')]){utils['getVoiceQueueByName'](_0x1e6e52[_0x857f('0x7')])[_0x857f('0xc')](function(_0x960b76){if(_0x960b76){_0x1e6e52['type']=_0x960b76[_0x857f('0xd')];_0x1e6e52[_0x857f('0xe')]=_0x1e6e52[_0x857f('0xf')]?_0x960b76['acw']:![];_0x1e6e52[_0x857f('0x10')]=_0x1e6e52[_0x857f('0xe')]?_0x960b76[_0x857f('0x11')]:0x0;}utils[_0x857f('0x12')](_0x857f('0x13'),_0x1e6e52);});}else{utils[_0x857f('0x12')](_0x857f('0x13'),_0x1e6e52);}if(_0x3c0125){delete transfers[_0x1e6e52['uniqueid']];}else{delete agents[_0x1e6e52[_0x857f('0x14')]];}}exports[_0x857f('0x15')]=function(_0x373333){try{utils[_0x857f('0x16')](util[_0x857f('0x3')]('[%s][agents][agentcalled]',_0x373333['uniqueid']),_0x373333);agents[_0x373333[_0x857f('0x14')]]=_0x373333;agents[_0x373333['destuniqueid']][_0x857f('0x17')]=utils['now']();agents[_0x373333[_0x857f('0x14')]][_0x857f('0xb')]='called';agents[_0x373333[_0x857f('0x14')]][_0x857f('0xa')]=null;agents[_0x373333[_0x857f('0x14')]][_0x857f('0x18')]=null;utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x19'),_0x373333[_0x857f('0x5')],agents[_0x373333[_0x857f('0x14')]][_0x857f('0x8')],_0x373333[_0x857f('0x14')]));}catch(_0x59e0e1){utils[_0x857f('0x1a')](util[_0x857f('0x3')]('[%s][agents][agentcalled]',_0x373333[_0x857f('0x5')]),_0x59e0e1);}};exports[_0x857f('0x1b')]=function(_0x377587){try{if(!_['isNil'](agents[_0x377587['destuniqueid']])){utils[_0x857f('0x16')](util[_0x857f('0x3')](_0x857f('0x1c'),_0x377587['uniqueid']),_0x377587);utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x1d'),_0x377587['uniqueid'],agents[_0x377587[_0x857f('0x14')]][_0x857f('0x8')],_0x377587['destuniqueid']));agents[_0x377587[_0x857f('0x14')]][_0x857f('0x1b')]=!![];agents[_0x377587[_0x857f('0x14')]][_0x857f('0x1e')]=utils[_0x857f('0x1f')]();agents[_0x377587[_0x857f('0x14')]][_0x857f('0xb')]=_0x857f('0x20');agents[_0x377587[_0x857f('0x14')]][_0x857f('0x21')]=_0x857f('0x20');agents[_0x377587[_0x857f('0x14')]][_0x857f('0x22')]=_0x377587[_0x857f('0x23')]?parseInt(_0x377587['ringtime'])/0x3e8:0x0;agents[_0x377587[_0x857f('0x14')]][_0x857f('0x24')]=0x0;unanswered[_0x857f('0x25')](_0x377587[_0x857f('0x14')]);}}catch(_0x58c2de){utils[_0x857f('0x1a')](util['format'](_0x857f('0x1c'),_0x377587[_0x857f('0x5')]),_0x58c2de);}};exports[_0x857f('0x26')]=function(_0x2ab814){try{_[_0x857f('0x27')](agents,function(_0x464e8f,_0x1c4fff){if(_0x464e8f[_0x857f('0x5')]==_0x2ab814[_0x857f('0x5')]&&!_[_0x857f('0x28')](unanswered,_0x464e8f[_0x857f('0x14')])){utils[_0x857f('0x16')](util[_0x857f('0x3')]('[%s][agents][queuecallerabandon]',_0x2ab814[_0x857f('0x5')]),_0x2ab814);utils[_0x857f('0x2')](util['format'](_0x857f('0x29'),_0x2ab814[_0x857f('0x5')],_0x464e8f['membername'],_0x464e8f[_0x857f('0x14')]));_0x464e8f[_0x857f('0x1b')]=!![];_0x464e8f['agentringnoanswerAt']=utils[_0x857f('0x1f')]();_0x464e8f[_0x857f('0xb')]=_0x857f('0x2a');_0x464e8f[_0x857f('0x21')]='abandoned';_0x464e8f['holdtime']=_0x2ab814[_0x857f('0x22')];_0x464e8f[_0x857f('0x24')]=0x0;writeDB(_0x464e8f);}});}catch(_0x4c88fa){utils[_0x857f('0x1a')](util['format'](_0x857f('0x2b'),_0x2ab814[_0x857f('0x5')]),_0x4c88fa);}};exports[_0x857f('0x2c')]=function(_0x438ff1){try{if(agents[_0x438ff1[_0x857f('0x14')]]){utils['debug'](util['format'](_0x857f('0x2d'),_0x438ff1['uniqueid']),_0x438ff1);utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x2e'),_0x438ff1['uniqueid'],agents[_0x438ff1[_0x857f('0x14')]][_0x857f('0x8')],_0x438ff1[_0x857f('0x14')]));agents[_0x438ff1[_0x857f('0x14')]][_0x857f('0x2f')]=utils[_0x857f('0x1f')]();agents[_0x438ff1[_0x857f('0x14')]]['connectedlinenum']=_0x438ff1[_0x857f('0xa')];agents[_0x438ff1[_0x857f('0x14')]][_0x857f('0x18')]=_0x438ff1[_0x857f('0x18')];agents[_0x438ff1[_0x857f('0x14')]][_0x857f('0x22')]=_0x438ff1[_0x857f('0x23')];agents[_0x438ff1['destuniqueid']][_0x857f('0xb')]=_0x857f('0x30');_[_0x857f('0x27')](agents,function(_0xc2ac41,_0x196c95){if(_0xc2ac41[_0x857f('0x14')]!=_0x438ff1['destuniqueid']&&_0xc2ac41[_0x857f('0x5')]==_0x438ff1[_0x857f('0x5')]){_0xc2ac41[_0x857f('0x24')]=0x0;_0xc2ac41[_0x857f('0x22')]=_0x438ff1[_0x857f('0x23')];_0xc2ac41[_0x857f('0x1b')]=!![];_0xc2ac41[_0x857f('0x1e')]=utils[_0x857f('0x1f')]();_0xc2ac41['lastevent']=_0x857f('0x31');_0xc2ac41[_0x857f('0x21')]=_0x857f('0x31');_0xc2ac41[_0x857f('0x32')]=_0x438ff1[_0x857f('0x14')];_0xc2ac41[_0x857f('0x33')]=_0x438ff1[_0x857f('0x8')];writeDB(_0xc2ac41);}});}}catch(_0x42d922){utils[_0x857f('0x1a')](util[_0x857f('0x3')](_0x857f('0x2d'),_0x438ff1[_0x857f('0x5')]),_0x42d922);}};exports[_0x857f('0xf')]=function(_0x376f71){try{if(!_['isNil'](agents[_0x376f71[_0x857f('0x14')]])){utils['debug'](util[_0x857f('0x3')](_0x857f('0x34'),_0x376f71[_0x857f('0x5')]),_0x376f71);utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x35'),_0x376f71[_0x857f('0x5')],agents[_0x376f71[_0x857f('0x14')]][_0x857f('0x8')],_0x376f71[_0x857f('0x14')]));agents[_0x376f71[_0x857f('0x14')]]['agentcomplete']=!![];agents[_0x376f71['destuniqueid']][_0x857f('0x36')]=utils['now']();agents[_0x376f71[_0x857f('0x14')]]['talktime']=utils[_0x857f('0x37')](agents[_0x376f71[_0x857f('0x14')]][_0x857f('0x36')],agents[_0x376f71[_0x857f('0x14')]][_0x857f('0x2f')]);agents[_0x376f71[_0x857f('0x14')]][_0x857f('0x21')]=_0x376f71[_0x857f('0x21')];agents[_0x376f71['destuniqueid']][_0x857f('0xb')]=_0x857f('0x38');writeDB(agents[_0x376f71[_0x857f('0x14')]]);}}catch(_0x19c967){utils['error'](util[_0x857f('0x3')](_0x857f('0x34'),_0x376f71[_0x857f('0x5')]),_0x19c967);}};exports[_0x857f('0x39')]=function(_0x67563){try{if(!_['isNil'](agents[_0x67563[_0x857f('0x3a')]])){utils[_0x857f('0x16')](util['format'](_0x857f('0x3b'),_0x67563[_0x857f('0x5')]),_0x67563);utils['info'](util[_0x857f('0x3')]('[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s',_0x67563[_0x857f('0x5')],agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x8')],agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x5')]));agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x3c')]=!![];agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x3d')]=_0x857f('0x3e');agents[_0x67563['transfereruniqueid']][_0x857f('0x3f')]=_0x67563[_0x857f('0x40')];agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x41')]=agents[_0x67563[_0x857f('0x3a')]][_0x857f('0x5')];}}catch(_0x12712a){utils['error'](util[_0x857f('0x3')](_0x857f('0x3b'),_0x67563[_0x857f('0x5')]),_0x12712a);}};exports[_0x857f('0x42')]=function(_0x22eab9){try{utils[_0x857f('0x16')](util['format'](_0x857f('0x43'),_0x22eab9[_0x857f('0x44')]),_0x22eab9);if(_0x22eab9[_0x857f('0x44')]==_0x22eab9[_0x857f('0x45')]){if(!_[_0x857f('0x46')](agents[_0x22eab9[_0x857f('0x47')]])){utils[_0x857f('0x2')](util[_0x857f('0x3')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x22eab9['origtransfereruniqueid'],agents[_0x22eab9[_0x857f('0x47')]][_0x857f('0x8')]));agents[_0x22eab9[_0x857f('0x47')]][_0x857f('0x3c')]=!![];agents[_0x22eab9[_0x857f('0x47')]][_0x857f('0x3d')]='ATTENDED';agents[_0x22eab9[_0x857f('0x47')]][_0x857f('0x3f')]=_0x22eab9['origtransfererexten'];agents[_0x22eab9[_0x857f('0x47')]]['transferuniqueid']=_0x22eab9[_0x857f('0x44')];}if(_0x22eab9[_0x857f('0x48')]&&agents[_0x22eab9['transfereeuniqueid']]){agents[_0x22eab9[_0x857f('0x48')]][_0x857f('0x49')]=0x1;transfers[_0x22eab9[_0x857f('0x48')]]=_[_0x857f('0x4a')](agents[_0x22eab9[_0x857f('0x48')]]);transfers[_0x22eab9[_0x857f('0x48')]][_0x857f('0x4b')]=agents[_0x22eab9[_0x857f('0x47')]]['calleridnum'];transfers[_0x22eab9[_0x857f('0x48')]][_0x857f('0x4c')]=agents[_0x22eab9[_0x857f('0x47')]][_0x857f('0x4c')];transfers[_0x22eab9[_0x857f('0x48')]][_0x857f('0x17')]=utils[_0x857f('0x1f')]();transfers[_0x22eab9[_0x857f('0x48')]][_0x857f('0x2f')]=utils[_0x857f('0x1f')]();transfers[_0x22eab9[_0x857f('0x48')]]['holdtime']=0x0;transfers[_0x22eab9[_0x857f('0x48')]][_0x857f('0x49')]=0x2;}}else if(_0x22eab9[_0x857f('0x47')]==_0x22eab9[_0x857f('0x4d')]){if(!_['isNil'](agents[_0x22eab9[_0x857f('0x44')]])){utils['info'](util[_0x857f('0x3')](_0x857f('0x4e'),_0x22eab9[_0x857f('0x44')],agents[_0x22eab9[_0x857f('0x44')]]['membername']));agents[_0x22eab9['origtransfereruniqueid']][_0x857f('0x3c')]=!![];agents[_0x22eab9[_0x857f('0x44')]][_0x857f('0x3d')]='ATTENDED';agents[_0x22eab9[_0x857f('0x44')]]['transferexten']=_0x22eab9[_0x857f('0x4f')];agents[_0x22eab9[_0x857f('0x44')]][_0x857f('0x41')]=_0x22eab9['secondtransfereruniqueid'];}if(_0x22eab9['transfertargetuniqueid']&&agents[_0x22eab9[_0x857f('0x50')]]){agents[_0x22eab9[_0x857f('0x50')]][_0x857f('0x49')]=0x1;transfers[_0x22eab9[_0x857f('0x50')]]=_[_0x857f('0x4a')](agents[_0x22eab9[_0x857f('0x50')]]);transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x4b')]=agents[_0x22eab9['origtransfereruniqueid']]['calleridnum'];transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x4c')]=agents[_0x22eab9[_0x857f('0x44')]][_0x857f('0x4c')];transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x17')]=utils['now']();transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x2f')]=utils[_0x857f('0x1f')]();transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x22')]=0x0;transfers[_0x22eab9[_0x857f('0x50')]][_0x857f('0x49')]=0x2;}}}catch(_0x39ad7c){utils[_0x857f('0x1a')](util[_0x857f('0x3')]('[%s][agents][attendedtransfer]',_0x22eab9[_0x857f('0x44')]),_0x39ad7c);}};exports['hangup']=function(_0x5ec513){try{utils[_0x857f('0x16')](util['format']('[%s][agents][hangup]',_0x5ec513[_0x857f('0x5')]),_0x5ec513);if(agents[_0x5ec513['uniqueid']]&&agents[_0x5ec513[_0x857f('0x5')]]['reason']===_0x857f('0x20')){if(_0x5ec513[_0x857f('0x51')]==='21'){agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x21')]='rejected';agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0xb')]=_0x857f('0x52');}utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x53'),_0x5ec513[_0x857f('0x5')],agents[_0x5ec513['uniqueid']]['membername'],agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x21')],agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0xb')]));writeDB(agents[_0x5ec513[_0x857f('0x5')]]);var _0x2d7d33=unanswered['indexOf'](_0x5ec513[_0x857f('0x5')]);if(_0x2d7d33>-0x1){unanswered[_0x857f('0x54')](_0x2d7d33,0x1);}}if(transfers[_0x5ec513[_0x857f('0x5')]]){transfers[_0x5ec513['uniqueid']]['agentcomplete']=!![];transfers[_0x5ec513[_0x857f('0x5')]]['agentcompleteAt']=utils['now']();transfers[_0x5ec513[_0x857f('0x5')]][_0x857f('0x24')]=utils['diffTime'](transfers[_0x5ec513[_0x857f('0x5')]][_0x857f('0x36')],transfers[_0x5ec513['uniqueid']][_0x857f('0x2f')]);transfers[_0x5ec513[_0x857f('0x5')]][_0x857f('0x21')]=_0x857f('0x55');transfers[_0x5ec513[_0x857f('0x5')]][_0x857f('0xb')]=_0x857f('0x38');utils[_0x857f('0x2')](util[_0x857f('0x3')](_0x857f('0x53'),_0x5ec513[_0x857f('0x5')],transfers[_0x5ec513[_0x857f('0x5')]]['membername'],transfers[_0x5ec513['uniqueid']]['reason'],transfers[_0x5ec513[_0x857f('0x5')]][_0x857f('0xb')]));writeDB(transfers[_0x5ec513[_0x857f('0x5')]],!![]);}if(agents[_0x5ec513[_0x857f('0x5')]]&&agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x2f')]){agents[_0x5ec513[_0x857f('0x5')]]['agentcomplete']=!![];agents[_0x5ec513[_0x857f('0x5')]]['agentcompleteAt']=utils[_0x857f('0x1f')]();agents[_0x5ec513['uniqueid']]['talktime']=utils[_0x857f('0x37')](agents[_0x5ec513['uniqueid']][_0x857f('0x36')],agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x2f')]);agents[_0x5ec513['uniqueid']][_0x857f('0x21')]=agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x3c')]?_0x857f('0x3c'):_0x857f('0x55');agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0xb')]=_0x857f('0x38');utils[_0x857f('0x2')](util['format'](_0x857f('0x53'),_0x5ec513[_0x857f('0x5')],agents[_0x5ec513[_0x857f('0x5')]][_0x857f('0x8')],agents[_0x5ec513['uniqueid']][_0x857f('0x21')],agents[_0x5ec513['uniqueid']][_0x857f('0xb')]));writeDB(agents[_0x5ec513[_0x857f('0x5')]]);}}catch(_0x15df2f){utils[_0x857f('0x1a')](util['format'](_0x857f('0x56'),_0x5ec513['uniqueid']),_0x15df2f);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index c50f1ba..f73ad7b 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 _0x00e0=['ANSWERED','callerid','calleridname','calleridnum','cause-txt','endtime','duration','diffTime','starttime','billableseconds','error','attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','origtransfereruniqueid','secondtransfererchannel','_attended','transfertargetchannel','origtransfererchannel','userfield','[%s][calls][musiconholdstart]','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','source','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','connectedlinenum','lastevent','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','recording','newchannel','debug','[%s][calls][newchannel]','linkedid','channel','OutgoingSpoolFailed','context','exten','[%s][calls][newstate]','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','isNil','now','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','answertime','disposition'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x00e0,0x1e3));var _0x000e=function(_0x4fc7d9,_0x154124){_0x4fc7d9=_0x4fc7d9-0x0;var _0x521338=_0x00e0[_0x4fc7d9];return _0x521338;};'use strict';var _=require(_0x000e('0x0'));var util=require(_0x000e('0x1'));var utils=require(_0x000e('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x000e('0x3'),'FAILED',_0x000e('0x4'),'NO\x20ANSWER','NO\x20ANSWER','NO\x20ANSWER','ANSWERED',_0x000e('0x5'),_0x000e('0x4'),'FAILED',_0x000e('0x4')];var channels={};function writeDB(_0x3c6d9d){var _0x3a2025;if(transfers[_0x000e('0x6')][_0x3c6d9d['uniqueid']]){_0x3a2025=_0x3c6d9d[_0x000e('0x7')];_0x3c6d9d['uniqueid']=transfers[_0x000e('0x6')][_0x3c6d9d[_0x000e('0x7')]][_0x000e('0x8')];}utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0xb'),_0x3c6d9d[_0x000e('0x7')],_0x3c6d9d['channel'],_0x3c6d9d['queue'],_0x3c6d9d['membername'],_0x3c6d9d['interface'],_0x3c6d9d['calleridnum'],_0x3c6d9d[_0x000e('0xc')],_0x3c6d9d[_0x000e('0xd')]));if(_0x3c6d9d[_0x000e('0xe')]){utils[_0x000e('0xf')](_0x3c6d9d[_0x000e('0xe')])[_0x000e('0x10')](function(_0x2f853){if(_0x2f853){_0x3c6d9d[_0x000e('0x11')]=_0x2f853['id'];}utils[_0x000e('0x12')](_0x000e('0x13'),_0x3c6d9d);});}else{utils[_0x000e('0x12')](_0x000e('0x13'),_0x3c6d9d);}if(channels[_0x3c6d9d[_0x000e('0x7')]]){delete channels[_0x3c6d9d[_0x000e('0x7')]];}else if(_0x3a2025&&channels[_0x3a2025]){if(!transfers[_0x000e('0x6')][_0x3a2025][_0x000e('0x14')])delete transfers[_0x000e('0x6')][_0x3a2025];delete channels[_0x3a2025];}}exports[_0x000e('0x15')]=function(_0x519c08){try{utils[_0x000e('0x16')](util[_0x000e('0xa')](_0x000e('0x17'),_0x519c08['uniqueid']),_0x519c08);if(_0x519c08['uniqueid']==_0x519c08[_0x000e('0x18')]&&_0x519c08[_0x000e('0x19')]!=_0x000e('0x1a')){utils['info'](util['format']('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x519c08[_0x000e('0x7')],_0x519c08[_0x000e('0x1b')],_0x519c08[_0x000e('0x1c')]));channels[_0x519c08[_0x000e('0x7')]]={'uniqueid':_0x519c08['uniqueid'],'accountcode':_0x519c08['accountcode'],'source':_0x519c08['calleridnum'],'destination':_0x519c08[_0x000e('0x1c')],'destinationcontext':_0x519c08[_0x000e('0x1b')],'channel':_0x519c08[_0x000e('0x19')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':'DOCUMENTATION'};}}catch(_0x291e10){utils['error'](util[_0x000e('0xa')](_0x000e('0x17'),_0x519c08[_0x000e('0x7')]),_0x291e10);}};exports['newstate']=function(_0x24e0cb){try{utils[_0x000e('0x16')](util['format'](_0x000e('0x1d'),_0x24e0cb['uniqueid']),_0x24e0cb);if(!_['isNil'](channels[_0x24e0cb[_0x000e('0x7')]])&&_0x24e0cb[_0x000e('0x1e')]==0x6){utils['info'](util[_0x000e('0xa')](_0x000e('0x1f'),_0x24e0cb[_0x000e('0x7')],_0x24e0cb[_0x000e('0x1b')],_0x24e0cb[_0x000e('0x19')]));if(_[_0x000e('0x20')](channels[_0x24e0cb[_0x000e('0x7')]]['systemanswertime'])){channels[_0x24e0cb['uniqueid']]['systemanswertime']=utils[_0x000e('0x21')]();}}else if(!_[_0x000e('0x20')](channels[_0x24e0cb[_0x000e('0x18')]])&&_0x24e0cb[_0x000e('0x1e')]==0x6&&_0x24e0cb[_0x000e('0x1b')]!='transfer'){utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x22'),_0x24e0cb[_0x000e('0x7')],_0x24e0cb[_0x000e('0x18')],_0x24e0cb[_0x000e('0x1b')],_0x24e0cb[_0x000e('0x19')]));channels[_0x24e0cb[_0x000e('0x18')]]['accountcode']=_0x24e0cb['accountcode'];channels[_0x24e0cb['linkedid']]['destinationchannel']=_0x24e0cb['channel'];if(_[_0x000e('0x20')](channels[_0x24e0cb['linkedid']][_0x000e('0x23')])){channels[_0x24e0cb[_0x000e('0x18')]]['answertime']=utils[_0x000e('0x21')]();}channels[_0x24e0cb[_0x000e('0x18')]][_0x000e('0x24')]=dispositions[_['toNumber'](_0x24e0cb[_0x000e('0x1e')])]||_0x000e('0x25');}}catch(_0x5ae454){utils['error'](util['format'](_0x000e('0x1d'),_0x24e0cb[_0x000e('0x7')]),_0x5ae454);}};exports['hangup']=function(_0x93d724){try{if(!_[_0x000e('0x20')](channels[_0x93d724[_0x000e('0x7')]])){utils[_0x000e('0x16')](util[_0x000e('0xa')]('[%s][calls][hangup]',_0x93d724[_0x000e('0x7')]),_0x93d724);if(_[_0x000e('0x20')](channels[_0x93d724['uniqueid']][_0x000e('0x26')])){channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x26')]=_0x93d724[_0x000e('0x27')]+'\x20<'+_0x93d724[_0x000e('0x28')]+'>';}utils[_0x000e('0x9')](util[_0x000e('0xa')]('[%s][calls][hangup]\x20callerid:%s\x20reason:%s',_0x93d724[_0x000e('0x7')],channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x26')],_0x93d724[_0x000e('0x29')]));channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x2a')]=utils['now']();channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x2b')]=utils[_0x000e('0x2c')](channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x2a')],channels[_0x93d724['uniqueid']][_0x000e('0x2d')]);channels[_0x93d724['uniqueid']][_0x000e('0x2e')]=channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x23')]?utils[_0x000e('0x2c')](channels[_0x93d724[_0x000e('0x7')]]['endtime'],channels[_0x93d724[_0x000e('0x7')]][_0x000e('0x23')]):0x0;writeDB(channels[_0x93d724[_0x000e('0x7')]]);}}catch(_0x11f0f4){utils[_0x000e('0x2f')](util[_0x000e('0xa')]('[%s][calls][hangup]',_0x93d724['uniqueid']),_0x11f0f4);}};exports[_0x000e('0x30')]=function(_0xb6b207){try{if(!_[_0x000e('0x20')](channels[_0xb6b207[_0x000e('0x31')]])){utils[_0x000e('0x16')](util[_0x000e('0xa')](_0x000e('0x32'),_0xb6b207[_0x000e('0x33')]),_0xb6b207);if(channels[_0xb6b207[_0x000e('0x31')]]['channel']==_0xb6b207['transfereechannel']){utils[_0x000e('0x9')](util[_0x000e('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xb6b207[_0x000e('0x33')],_0xb6b207['localtwolinkedid'],_0xb6b207[_0x000e('0x34')]));channels[_0xb6b207[_0x000e('0x31')]]['destinationchannel']=_0xb6b207[_0x000e('0x34')];channels[_0xb6b207[_0x000e('0x31')]]['userfield']=_0x000e('0x35');}else if(channels[_0xb6b207[_0x000e('0x31')]][_0x000e('0x19')]=_0xb6b207[_0x000e('0x36')]){utils[_0x000e('0x9')](util[_0x000e('0xa')]('[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s',_0xb6b207['origtransfereruniqueid'],_0xb6b207[_0x000e('0x31')],_0xb6b207[_0x000e('0x37')]));channels[_0xb6b207['localtwolinkedid']]['destinationchannel']=_0xb6b207[_0x000e('0x37')];channels[_0xb6b207[_0x000e('0x31')]][_0x000e('0x38')]='_attended';}}}catch(_0x14b116){utils[_0x000e('0x2f')](util['format']('[%s][calls][attendedtransfer]',_0xb6b207[_0x000e('0x33')]),_0x14b116);}};exports['musiconholdstart']=function(_0x48d6e6){try{if(!_[_0x000e('0x20')](channels[_0x48d6e6[_0x000e('0x7')]])){utils['debug'](util[_0x000e('0xa')](_0x000e('0x39'),_0x48d6e6[_0x000e('0x7')]),_0x48d6e6);channels[_0x48d6e6[_0x000e('0x7')]]['musiconholdstartAt']=utils['now']();utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x3a'),_0x48d6e6[_0x000e('0x7')],channels[_0x48d6e6[_0x000e('0x7')]][_0x000e('0x3b')]));}}catch(_0x214a05){utils[_0x000e('0x2f')](util[_0x000e('0xa')](_0x000e('0x39'),_0x48d6e6[_0x000e('0x7')]),_0x214a05);}};exports[_0x000e('0x3c')]=function(_0x905443){try{if(!_[_0x000e('0x20')](channels[_0x905443[_0x000e('0x7')]])){utils[_0x000e('0x16')](util[_0x000e('0xa')](_0x000e('0x3d'),_0x905443['uniqueid']),_0x905443);if(!_[_0x000e('0x20')](channels[_0x905443['uniqueid']][_0x000e('0x3b')])){channels[_0x905443[_0x000e('0x7')]][_0x000e('0x3e')]+=utils[_0x000e('0x2c')](utils['now'](),channels[_0x905443[_0x000e('0x7')]][_0x000e('0x3b')]);utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x3f'),_0x905443[_0x000e('0x7')],channels[_0x905443['uniqueid']][_0x000e('0x3e')]));delete channels[_0x905443[_0x000e('0x7')]]['musiconholdstartAt'];}}}catch(_0x394f28){utils['error'](util[_0x000e('0xa')](_0x000e('0x3d'),_0x905443[_0x000e('0x7')]),_0x394f28);}};exports[_0x000e('0x40')]=function(_0x507479){try{if(!_['isNil'](channels[_0x507479[_0x000e('0x7')]])){utils[_0x000e('0x16')](util[_0x000e('0xa')](_0x000e('0x41'),_0x507479['uniqueid']),_0x507479);if(!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x43')])){utils[_0x000e('0x9')](util['format'](_0x000e('0x44'),_0x507479[_0x000e('0x7')],_0x507479['value']));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x45')]=_0x507479[_0x000e('0x46')];}if(!_[_0x000e('0x20')](_0x507479['variable'][_0x000e('0x47')])){utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x48'),_0x507479[_0x000e('0x7')],_0x507479['value']));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x49')]=_0x507479[_0x000e('0x46')];channels[_0x507479[_0x000e('0x7')]]['callerid']='\x22'+_0x507479[_0x000e('0x46')]+'\x22\x20<'+_0x507479[_0x000e('0x46')]+'>';}if(!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x4a')])||!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x4b')])){utils[_0x000e('0x9')](util['format']('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x507479[_0x000e('0x7')],!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x4a')])?_0x000e('0x4a'):_0x000e('0x4b'),_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x26')]=_0x507479[_0x000e('0x46')];}if(!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x4c')])||!_['isNil'](_0x507479[_0x000e('0x42')][_0x000e('0x4d')])){utils[_0x000e('0x9')](util[_0x000e('0xa')]('[%s][calls][varset]\x20variable:%s\x20value:%s',_0x507479[_0x000e('0x7')],!_['isNil'](_0x507479['variable'][_0x000e('0x4c')])?'xmd-queue':'xmcs-queue',_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x4e')]='Queue';channels[_0x507479[_0x000e('0x7')]][_0x000e('0x4f')]=_0x507479[_0x000e('0x46')];channels[_0x507479['uniqueid']][_0x000e('0x50')]=!![];}if(!_[_0x000e('0x20')](_0x507479['variable'][_0x000e('0x51')])){utils[_0x000e('0x9')](util[_0x000e('0xa')]('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x507479[_0x000e('0x7')],_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x52')]=_0x507479[_0x000e('0x46')];}if(!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')][_0x000e('0x53')])){utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x54'),_0x507479[_0x000e('0x7')],_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x55')]=_0x507479[_0x000e('0x46')];}if(!_[_0x000e('0x20')](_0x507479[_0x000e('0x42')]['outboundrouteid'])){utils[_0x000e('0x9')](util['format'](_0x000e('0x56'),_0x507479[_0x000e('0x7')],_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]]['routeid']=_0x507479[_0x000e('0x46')];}if(!_['isNil'](_0x507479[_0x000e('0x42')][_0x000e('0x57')])){utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x58'),_0x507479[_0x000e('0x7')],_0x507479[_0x000e('0x46')]));channels[_0x507479[_0x000e('0x7')]][_0x000e('0x57')]=_0x507479[_0x000e('0x46')];}}}catch(_0x49f660){utils[_0x000e('0x2f')](util[_0x000e('0xa')]('[%s][calls][varset]',_0x507479[_0x000e('0x7')]),_0x49f660);}};exports[_0x000e('0x59')]=function(_0x2a3ac8){try{if(!_[_0x000e('0x20')](channels[_0x2a3ac8[_0x000e('0x7')]])){utils['debug'](util[_0x000e('0xa')](_0x000e('0x5a'),_0x2a3ac8[_0x000e('0x7')]),_0x2a3ac8);utils[_0x000e('0x9')](util[_0x000e('0xa')](_0x000e('0x5b'),_0x2a3ac8[_0x000e('0x7')],_0x2a3ac8[_0x000e('0x5c')],_0x2a3ac8[_0x000e('0x5d')]));if(_0x2a3ac8[_0x000e('0x5c')]['toLowerCase']()=='set'&&_[_0x000e('0x5e')](_0x2a3ac8['appdata'][_0x000e('0x5f')](),'cdr')){var _0x4be25f=_0x2a3ac8[_0x000e('0x5d')][_0x000e('0x60')]('=');var _0x1e307c=_0x4be25f[0x0][_0x000e('0x61')](_0x4be25f[0x0][_0x000e('0x62')]('(')+0x1,_0x4be25f[0x0][_0x000e('0x62')](')'));var _0x7b1218=_0x4be25f[0x1];channels[_0x2a3ac8[_0x000e('0x7')]][_0x1e307c]=_0x7b1218;}if(!_[_0x000e('0x63')]([_0x000e('0x64'),_0x000e('0x65'),_0x000e('0x66'),'set',_0x000e('0x67')],_0x2a3ac8[_0x000e('0x5c')][_0x000e('0x5f')]())){channels[_0x2a3ac8[_0x000e('0x7')]]['lastapplication']=_0x2a3ac8['application'];channels[_0x2a3ac8[_0x000e('0x7')]][_0x000e('0x4f')]=_0x2a3ac8[_0x000e('0x5d')];}}}catch(_0x3e7184){utils[_0x000e('0x2f')](util[_0x000e('0xa')](_0x000e('0x5a'),_0x2a3ac8[_0x000e('0x7')]),_0x3e7184);}}; \ No newline at end of file +var _0x8b52=['toLowerCase','startsWith','cdr','substring','lastIndexOf','noop','execif','set','gotoif','[%s][calls][newexten]','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','interface','connectedlinenum','lastevent','getUserByInternal','then','request','CreateVoiceCallReport','recording','newchannel','debug','format','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','context','exten','accountcode','calleridnum','DOCUMENTATION','error','[%s][calls][newstate]','isNil','channelstate','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','now','transfer','[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','destinationchannel','answertime','disposition','toNumber','hangup','[%s][calls][hangup]','callerid','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','endtime','duration','billableseconds','diffTime','attendedtransfer','[%s][calls][attendedtransfer]','origtransfereruniqueid','localtwolinkedid','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','[%s][calls][musiconholdstop]\x20mohtime:%s','mohtime','[%s][calls][musiconholdstop]','varset','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]\x20application:%s\x20appdata:%s','appdata','application'];(function(_0x4e448b,_0x10dee3){var _0x13638d=function(_0x812d6a){while(--_0x812d6a){_0x4e448b['push'](_0x4e448b['shift']());}};_0x13638d(++_0x10dee3);}(_0x8b52,0x151));var _0x28b5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b52[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x28b5('0x0'));var util=require(_0x28b5('0x1'));var utils=require(_0x28b5('0x2'));var transfers=require('./transfers.controller');var dispositions=[_0x28b5('0x3'),_0x28b5('0x4'),'FAILED',_0x28b5('0x3'),_0x28b5('0x3'),_0x28b5('0x3'),_0x28b5('0x5'),_0x28b5('0x6'),_0x28b5('0x4'),_0x28b5('0x4'),_0x28b5('0x4')];var channels={};function writeDB(_0x2363c3){var _0x4a136e;if(transfers[_0x28b5('0x7')][_0x2363c3['uniqueid']]){_0x4a136e=_0x2363c3['uniqueid'];_0x2363c3[_0x28b5('0x8')]=transfers[_0x28b5('0x7')][_0x2363c3['uniqueid']][_0x28b5('0x9')];}utils[_0x28b5('0xa')](util['format'](_0x28b5('0xb'),_0x2363c3[_0x28b5('0x8')],_0x2363c3[_0x28b5('0xc')],_0x2363c3[_0x28b5('0xd')],_0x2363c3['membername'],_0x2363c3[_0x28b5('0xe')],_0x2363c3['calleridnum'],_0x2363c3[_0x28b5('0xf')],_0x2363c3[_0x28b5('0x10')]));if(_0x2363c3['accountcode']){utils[_0x28b5('0x11')](_0x2363c3['accountcode'])[_0x28b5('0x12')](function(_0x4a684e){if(_0x4a684e){_0x2363c3['UserId']=_0x4a684e['id'];}utils[_0x28b5('0x13')](_0x28b5('0x14'),_0x2363c3);});}else{utils['request'](_0x28b5('0x14'),_0x2363c3);}if(channels[_0x2363c3[_0x28b5('0x8')]]){delete channels[_0x2363c3[_0x28b5('0x8')]];}else if(_0x4a136e&&channels[_0x4a136e]){if(!transfers[_0x28b5('0x7')][_0x4a136e][_0x28b5('0x15')])delete transfers['blinds'][_0x4a136e];delete channels[_0x4a136e];}}exports[_0x28b5('0x16')]=function(_0x4adf12){try{utils[_0x28b5('0x17')](util[_0x28b5('0x18')](_0x28b5('0x19'),_0x4adf12[_0x28b5('0x8')]),_0x4adf12);if(_0x4adf12['uniqueid']==_0x4adf12[_0x28b5('0x1a')]&&_0x4adf12[_0x28b5('0xc')]!=_0x28b5('0x1b')){utils['info'](util[_0x28b5('0x18')]('[%s][calls][newchannel]\x20context:%s\x20exten:%s',_0x4adf12[_0x28b5('0x8')],_0x4adf12[_0x28b5('0x1c')],_0x4adf12[_0x28b5('0x1d')]));channels[_0x4adf12[_0x28b5('0x8')]]={'uniqueid':_0x4adf12['uniqueid'],'accountcode':_0x4adf12[_0x28b5('0x1e')],'source':_0x4adf12[_0x28b5('0x1f')],'destination':_0x4adf12[_0x28b5('0x1d')],'destinationcontext':_0x4adf12[_0x28b5('0x1c')],'channel':_0x4adf12['channel'],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x28b5('0x20')};}}catch(_0x1bf044){utils[_0x28b5('0x21')](util[_0x28b5('0x18')](_0x28b5('0x19'),_0x4adf12[_0x28b5('0x8')]),_0x1bf044);}};exports['newstate']=function(_0x4b1673){try{utils[_0x28b5('0x17')](util['format'](_0x28b5('0x22'),_0x4b1673[_0x28b5('0x8')]),_0x4b1673);if(!_[_0x28b5('0x23')](channels[_0x4b1673[_0x28b5('0x8')]])&&_0x4b1673[_0x28b5('0x24')]==0x6){utils['info'](util['format'](_0x28b5('0x25'),_0x4b1673[_0x28b5('0x8')],_0x4b1673[_0x28b5('0x1c')],_0x4b1673[_0x28b5('0xc')]));if(_[_0x28b5('0x23')](channels[_0x4b1673[_0x28b5('0x8')]][_0x28b5('0x26')])){channels[_0x4b1673[_0x28b5('0x8')]][_0x28b5('0x26')]=utils[_0x28b5('0x27')]();}}else if(!_['isNil'](channels[_0x4b1673[_0x28b5('0x1a')]])&&_0x4b1673[_0x28b5('0x24')]==0x6&&_0x4b1673['context']!=_0x28b5('0x28')){utils[_0x28b5('0xa')](util[_0x28b5('0x18')](_0x28b5('0x29'),_0x4b1673[_0x28b5('0x8')],_0x4b1673[_0x28b5('0x1a')],_0x4b1673[_0x28b5('0x1c')],_0x4b1673['channel']));channels[_0x4b1673[_0x28b5('0x1a')]]['accountcode']=_0x4b1673[_0x28b5('0x1e')];channels[_0x4b1673[_0x28b5('0x1a')]][_0x28b5('0x2a')]=_0x4b1673[_0x28b5('0xc')];if(_[_0x28b5('0x23')](channels[_0x4b1673[_0x28b5('0x1a')]][_0x28b5('0x2b')])){channels[_0x4b1673[_0x28b5('0x1a')]][_0x28b5('0x2b')]=utils[_0x28b5('0x27')]();}channels[_0x4b1673[_0x28b5('0x1a')]][_0x28b5('0x2c')]=dispositions[_[_0x28b5('0x2d')](_0x4b1673[_0x28b5('0x24')])]||_0x28b5('0x5');}}catch(_0x15de12){utils['error'](util[_0x28b5('0x18')]('[%s][calls][newstate]',_0x4b1673[_0x28b5('0x8')]),_0x15de12);}};exports[_0x28b5('0x2e')]=function(_0x15580d){try{if(!_[_0x28b5('0x23')](channels[_0x15580d['uniqueid']])){utils[_0x28b5('0x17')](util[_0x28b5('0x18')](_0x28b5('0x2f'),_0x15580d['uniqueid']),_0x15580d);if(_['isNil'](channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x30')])){channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x30')]=_0x15580d['calleridname']+'\x20<'+_0x15580d[_0x28b5('0x1f')]+'>';}utils[_0x28b5('0xa')](util[_0x28b5('0x18')](_0x28b5('0x31'),_0x15580d[_0x28b5('0x8')],channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x30')],_0x15580d[_0x28b5('0x32')]));channels[_0x15580d['uniqueid']][_0x28b5('0x33')]=utils[_0x28b5('0x27')]();channels[_0x15580d['uniqueid']][_0x28b5('0x34')]=utils['diffTime'](channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x33')],channels[_0x15580d[_0x28b5('0x8')]]['starttime']);channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x35')]=channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x2b')]?utils[_0x28b5('0x36')](channels[_0x15580d[_0x28b5('0x8')]]['endtime'],channels[_0x15580d[_0x28b5('0x8')]][_0x28b5('0x2b')]):0x0;writeDB(channels[_0x15580d[_0x28b5('0x8')]]);}}catch(_0x3b068f){utils[_0x28b5('0x21')](util['format'](_0x28b5('0x2f'),_0x15580d[_0x28b5('0x8')]),_0x3b068f);}};exports[_0x28b5('0x37')]=function(_0xde714e){try{if(!_[_0x28b5('0x23')](channels[_0xde714e['localtwolinkedid']])){utils[_0x28b5('0x17')](util[_0x28b5('0x18')](_0x28b5('0x38'),_0xde714e[_0x28b5('0x39')]),_0xde714e);if(channels[_0xde714e[_0x28b5('0x3a')]][_0x28b5('0xc')]==_0xde714e['transfereechannel']){utils['info'](util[_0x28b5('0x18')](_0x28b5('0x3b'),_0xde714e[_0x28b5('0x39')],_0xde714e[_0x28b5('0x3a')],_0xde714e[_0x28b5('0x3c')]));channels[_0xde714e['localtwolinkedid']][_0x28b5('0x2a')]=_0xde714e['secondtransfererchannel'];channels[_0xde714e[_0x28b5('0x3a')]][_0x28b5('0x3d')]=_0x28b5('0x3e');}else if(channels[_0xde714e[_0x28b5('0x3a')]][_0x28b5('0xc')]=_0xde714e[_0x28b5('0x3f')]){utils[_0x28b5('0xa')](util['format'](_0x28b5('0x3b'),_0xde714e[_0x28b5('0x39')],_0xde714e[_0x28b5('0x3a')],_0xde714e[_0x28b5('0x40')]));channels[_0xde714e[_0x28b5('0x3a')]][_0x28b5('0x2a')]=_0xde714e[_0x28b5('0x40')];channels[_0xde714e[_0x28b5('0x3a')]][_0x28b5('0x3d')]='_attended';}}}catch(_0x403a11){utils[_0x28b5('0x21')](util[_0x28b5('0x18')](_0x28b5('0x38'),_0xde714e['origtransfereruniqueid']),_0x403a11);}};exports[_0x28b5('0x41')]=function(_0x252818){try{if(!_[_0x28b5('0x23')](channels[_0x252818[_0x28b5('0x8')]])){utils[_0x28b5('0x17')](util[_0x28b5('0x18')](_0x28b5('0x42'),_0x252818[_0x28b5('0x8')]),_0x252818);channels[_0x252818[_0x28b5('0x8')]][_0x28b5('0x43')]=utils[_0x28b5('0x27')]();utils[_0x28b5('0xa')](util[_0x28b5('0x18')](_0x28b5('0x44'),_0x252818['uniqueid'],channels[_0x252818['uniqueid']]['musiconholdstartAt']));}}catch(_0x2d6a5a){utils[_0x28b5('0x21')](util['format'](_0x28b5('0x42'),_0x252818[_0x28b5('0x8')]),_0x2d6a5a);}};exports['musiconholdstop']=function(_0x225857){try{if(!_[_0x28b5('0x23')](channels[_0x225857[_0x28b5('0x8')]])){utils[_0x28b5('0x17')](util['format']('[%s][calls][musiconholdstop]',_0x225857[_0x28b5('0x8')]),_0x225857);if(!_[_0x28b5('0x23')](channels[_0x225857[_0x28b5('0x8')]][_0x28b5('0x43')])){channels[_0x225857[_0x28b5('0x8')]]['mohtime']+=utils['diffTime'](utils[_0x28b5('0x27')](),channels[_0x225857[_0x28b5('0x8')]]['musiconholdstartAt']);utils[_0x28b5('0xa')](util[_0x28b5('0x18')](_0x28b5('0x45'),_0x225857[_0x28b5('0x8')],channels[_0x225857['uniqueid']][_0x28b5('0x46')]));delete channels[_0x225857[_0x28b5('0x8')]]['musiconholdstartAt'];}}}catch(_0x1363a0){utils[_0x28b5('0x21')](util[_0x28b5('0x18')](_0x28b5('0x47'),_0x225857[_0x28b5('0x8')]),_0x1363a0);}};exports[_0x28b5('0x48')]=function(_0x1528c8){try{if(!_['isNil'](channels[_0x1528c8['uniqueid']])){utils[_0x28b5('0x17')](util['format'](_0x28b5('0x49'),_0x1528c8[_0x28b5('0x8')]),_0x1528c8);if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')]['xmd-originatecalleridnum'])){utils['info'](util[_0x28b5('0x18')](_0x28b5('0x4b'),_0x1528c8['uniqueid'],_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8['uniqueid']]['source']=_0x1528c8[_0x28b5('0x4c')];}if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x4d')])){utils['info'](util[_0x28b5('0x18')](_0x28b5('0x4e'),_0x1528c8[_0x28b5('0x8')],_0x1528c8['value']));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x4f')]=_0x1528c8['value'];channels[_0x1528c8['uniqueid']]['callerid']='\x22'+_0x1528c8[_0x28b5('0x4c')]+'\x22\x20<'+_0x1528c8[_0x28b5('0x4c')]+'>';}if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x50')])||!_[_0x28b5('0x23')](_0x1528c8['variable']['xmd-callerid'])){utils['info'](util[_0x28b5('0x18')](_0x28b5('0x51'),_0x1528c8[_0x28b5('0x8')],!_['isNil'](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x50')])?_0x28b5('0x50'):'xmd-callerid',_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]]['callerid']=_0x1528c8['value'];}if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x52')])||!_['isNil'](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x53')])){utils['info'](util['format'](_0x28b5('0x51'),_0x1528c8[_0x28b5('0x8')],!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x52')])?_0x28b5('0x52'):_0x28b5('0x53'),_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x54')]=_0x28b5('0x55');channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x56')]=_0x1528c8[_0x28b5('0x4c')];channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0xd')]=!![];}if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x57')])){utils['info'](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x1528c8[_0x28b5('0x8')],_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x58')]=_0x1528c8[_0x28b5('0x4c')];}if(!_['isNil'](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x59')])){utils[_0x28b5('0xa')](util[_0x28b5('0x18')]('[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s',_0x1528c8[_0x28b5('0x8')],_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x5a')]=_0x1528c8[_0x28b5('0x4c')];}if(!_['isNil'](_0x1528c8[_0x28b5('0x4a')][_0x28b5('0x5b')])){utils[_0x28b5('0xa')](util['format'](_0x28b5('0x5c'),_0x1528c8['uniqueid'],_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x5d')]=_0x1528c8[_0x28b5('0x4c')];}if(!_[_0x28b5('0x23')](_0x1528c8[_0x28b5('0x4a')]['sipcallid'])){utils[_0x28b5('0xa')](util[_0x28b5('0x18')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x1528c8[_0x28b5('0x8')],_0x1528c8[_0x28b5('0x4c')]));channels[_0x1528c8[_0x28b5('0x8')]][_0x28b5('0x5e')]=_0x1528c8[_0x28b5('0x4c')];}}}catch(_0x390950){utils[_0x28b5('0x21')](util[_0x28b5('0x18')]('[%s][calls][varset]',_0x1528c8[_0x28b5('0x8')]),_0x390950);}};exports[_0x28b5('0x5f')]=function(_0x7b96b2){try{if(!_[_0x28b5('0x23')](channels[_0x7b96b2[_0x28b5('0x8')]])){utils[_0x28b5('0x17')](util[_0x28b5('0x18')]('[%s][calls][newexten]',_0x7b96b2['uniqueid']),_0x7b96b2);utils['info'](util[_0x28b5('0x18')](_0x28b5('0x60'),_0x7b96b2[_0x28b5('0x8')],_0x7b96b2['application'],_0x7b96b2[_0x28b5('0x61')]));if(_0x7b96b2[_0x28b5('0x62')][_0x28b5('0x63')]()=='set'&&_[_0x28b5('0x64')](_0x7b96b2[_0x28b5('0x61')]['toLowerCase'](),_0x28b5('0x65'))){var _0x209e5c=_0x7b96b2[_0x28b5('0x61')]['split']('=');var _0x4d16a6=_0x209e5c[0x0][_0x28b5('0x66')](_0x209e5c[0x0][_0x28b5('0x67')]('(')+0x1,_0x209e5c[0x0][_0x28b5('0x67')](')'));var _0x1b9227=_0x209e5c[0x1];channels[_0x7b96b2[_0x28b5('0x8')]][_0x4d16a6]=_0x1b9227;}if(!_['includes']([_0x28b5('0x2e'),_0x28b5('0x68'),_0x28b5('0x69'),_0x28b5('0x6a'),_0x28b5('0x6b')],_0x7b96b2[_0x28b5('0x62')][_0x28b5('0x63')]())){channels[_0x7b96b2[_0x28b5('0x8')]]['lastapplication']=_0x7b96b2[_0x28b5('0x62')];channels[_0x7b96b2['uniqueid']][_0x28b5('0x56')]=_0x7b96b2[_0x28b5('0x61')];}}}catch(_0x42464a){utils['error'](util['format'](_0x28b5('0x6c'),_0x7b96b2['uniqueid']),_0x42464a);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index c672b0c..e9802f8 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 _0xa1ad=['[core]\x20connected','shutdown','[core]\x20shutdown','fullybooted','[core]\x20fullybooted','error','close','[core]\x20close','managerevent','./utils','info'];(function(_0x41a2d4,_0x380b97){var _0x2d5200=function(_0x36d50b){while(--_0x36d50b){_0x41a2d4['push'](_0x41a2d4['shift']());}};_0x2d5200(++_0x380b97);}(_0xa1ad,0x98));var _0xda1a=function(_0x513047,_0x2199c5){_0x513047=_0x513047-0x0;var _0x15b779=_0xa1ad[_0x513047];return _0x15b779;};'use strict';var utils=require(_0xda1a('0x0'));exports['connect']=function(){utils[_0xda1a('0x1')](_0xda1a('0x2'));};exports[_0xda1a('0x3')]=function(){utils[_0xda1a('0x1')](_0xda1a('0x4'));};exports[_0xda1a('0x5')]=function(){utils[_0xda1a('0x1')](_0xda1a('0x6'));};exports[_0xda1a('0x7')]=function(_0x3e8d6c){utils[_0xda1a('0x7')]('[core]\x20error',_0x3e8d6c);};exports[_0xda1a('0x8')]=function(){utils[_0xda1a('0x1')](_0xda1a('0x9'));};exports[_0xda1a('0xa')]=function(_0x215239){}; \ No newline at end of file +var _0xa5df=['fullybooted','[core]\x20fullybooted','error','[core]\x20error','close','[core]\x20close','managerevent','./utils','connect','info','[core]\x20connected','[core]\x20shutdown'];(function(_0x474a72,_0x439f5a){var _0x304966=function(_0x1466eb){while(--_0x1466eb){_0x474a72['push'](_0x474a72['shift']());}};_0x304966(++_0x439f5a);}(_0xa5df,0x163));var _0xfa5d=function(_0x577e58,_0x27ef22){_0x577e58=_0x577e58-0x0;var _0xd21723=_0xa5df[_0x577e58];return _0xd21723;};'use strict';var utils=require(_0xfa5d('0x0'));exports[_0xfa5d('0x1')]=function(){utils[_0xfa5d('0x2')](_0xfa5d('0x3'));};exports['shutdown']=function(){utils[_0xfa5d('0x2')](_0xfa5d('0x4'));};exports[_0xfa5d('0x5')]=function(){utils['info'](_0xfa5d('0x6'));};exports[_0xfa5d('0x7')]=function(_0x19184c){utils['error'](_0xfa5d('0x8'),_0x19184c);};exports[_0xfa5d('0x9')]=function(){utils['info'](_0xfa5d('0xa'));};exports[_0xfa5d('0xb')]=function(_0x1c30a2){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 44127d0..fcccb5a 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 _0xef6e=['lastevent','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','answertime','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','diffTime','holdtime','endtime','billableseconds','lodash','util','uniqueid','channel','calleridnum','connectedlinenum','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','application','appdata','toLowerCase','set','cdr(routeid)','split','format','varset','[%s][dials][varset]','variable','info','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','error','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','called','isNil','[%s][dials][dialend]','dialstatus'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xef6e,0x12e));var _0xeef6=function(_0x195ec5,_0xf4bec4){_0x195ec5=_0x195ec5-0x0;var _0x15e9f5=_0xef6e[_0x195ec5];return _0x15e9f5;};'use strict';var _=require(_0xeef6('0x0'));var util=require(_0xeef6('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x113d3d){utils['info'](util['format']('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x113d3d[_0xeef6('0x2')],_0x113d3d[_0xeef6('0x3')],_0x113d3d['dialstring'],_0x113d3d[_0xeef6('0x4')],_0x113d3d[_0xeef6('0x5')],_0x113d3d['dialstatus']));utils[_0xeef6('0x6')](_0xeef6('0x7'),_0x113d3d);delete dials[_0x113d3d[_0xeef6('0x2')]];}exports[_0xeef6('0x8')]=function(_0x194e3a){try{utils[_0xeef6('0x9')](util['format'](_0xeef6('0xa'),_0x194e3a[_0xeef6('0x2')]),_0x194e3a);utils['info'](util['format']('[%s][dials][newexten]\x20application:%s\x20appdata:%s',_0x194e3a[_0xeef6('0x2')],_0x194e3a[_0xeef6('0xb')],_0x194e3a[_0xeef6('0xc')]));if(_0x194e3a[_0xeef6('0xb')][_0xeef6('0xd')]()==_0xeef6('0xe')&&_['startsWith'](_0x194e3a[_0xeef6('0xc')][_0xeef6('0xd')](),_0xeef6('0xf'))){var _0x503305=_0x194e3a[_0xeef6('0xc')][_0xeef6('0x10')]('=');dials[_0x194e3a[_0xeef6('0x2')]]={'routeId':_0x503305[0x1]};}}catch(_0x1cdbd9){utils['error'](util[_0xeef6('0x11')](_0xeef6('0xa'),_0x194e3a[_0xeef6('0x2')]),_0x1cdbd9);}};exports[_0xeef6('0x12')]=function(_0x2d3bf2){try{utils[_0xeef6('0x9')](util[_0xeef6('0x11')](_0xeef6('0x13'),_0x2d3bf2[_0xeef6('0x2')]),_0x2d3bf2);if(!_['isNil'](_0x2d3bf2[_0xeef6('0x14')]['outboundrouteid'])){utils[_0xeef6('0x15')](util[_0xeef6('0x11')](_0xeef6('0x16'),_0x2d3bf2['uniqueid'],_0x2d3bf2[_0xeef6('0x17')]));dials[_0x2d3bf2[_0xeef6('0x2')]]={'routeId':_0x2d3bf2['value']};}}catch(_0x136e93){utils[_0xeef6('0x18')](util[_0xeef6('0x11')](_0xeef6('0x13'),_0x2d3bf2[_0xeef6('0x2')]),_0x136e93);}};exports[_0xeef6('0x19')]=function(_0x4b4969){try{if(!_['isNil'](dials[_0x4b4969[_0xeef6('0x2')]])){utils[_0xeef6('0x9')](util[_0xeef6('0x11')](_0xeef6('0x1a'),_0x4b4969[_0xeef6('0x2')]),_0x4b4969);dials[_0x4b4969['uniqueid']]=_[_0xeef6('0x1b')](dials[_0x4b4969['uniqueid']],_0x4b4969);dials[_0x4b4969['uniqueid']][_0xeef6('0x1c')]=utils[_0xeef6('0x1d')]();dials[_0x4b4969[_0xeef6('0x2')]]['lastevent']=_0xeef6('0x1e');utils[_0xeef6('0x15')](util[_0xeef6('0x11')]('[%s][dials][hangup]\x20starttime:%s\x20lastevent:called',_0x4b4969[_0xeef6('0x2')],dials[_0x4b4969['uniqueid']][_0xeef6('0x1c')]));}}catch(_0x6ce579){utils[_0xeef6('0x18')](util['format'](_0xeef6('0x1a'),_0x4b4969[_0xeef6('0x2')]),_0x6ce579);}};exports['dialend']=function(_0x4ac60e){try{if(!_[_0xeef6('0x1f')](dials[_0x4ac60e[_0xeef6('0x2')]])){utils[_0xeef6('0x9')](util[_0xeef6('0x11')](_0xeef6('0x20'),_0x4ac60e[_0xeef6('0x2')]),_0x4ac60e);dials[_0x4ac60e[_0xeef6('0x2')]][_0xeef6('0x21')]=_0x4ac60e[_0xeef6('0x21')];if(_0x4ac60e[_0xeef6('0x21')]=='ANSWER'){dials[_0x4ac60e[_0xeef6('0x2')]]=_[_0xeef6('0x1b')](dials[_0x4ac60e[_0xeef6('0x2')]],_0x4ac60e);dials[_0x4ac60e[_0xeef6('0x2')]]['answertime']=utils[_0xeef6('0x1d')]();dials[_0x4ac60e[_0xeef6('0x2')]][_0xeef6('0x22')]=_0xeef6('0x23');utils['info'](util['format'](_0xeef6('0x24'),_0x4ac60e[_0xeef6('0x2')],_0x4ac60e[_0xeef6('0x21')],dials[_0x4ac60e['uniqueid']][_0xeef6('0x25')]));}else{utils['info'](util[_0xeef6('0x11')](_0xeef6('0x26'),_0x4ac60e[_0xeef6('0x2')],_0x4ac60e[_0xeef6('0x21')]));}}}catch(_0x5bd52c){utils[_0xeef6('0x18')](util[_0xeef6('0x11')](_0xeef6('0x20'),_0x4ac60e[_0xeef6('0x2')]),_0x5bd52c);}};exports['hangup']=function(_0x22f17c){try{if(!_['isNil'](dials[_0x22f17c[_0xeef6('0x2')]])){utils[_0xeef6('0x9')](util[_0xeef6('0x11')](_0xeef6('0x27'),_0x22f17c[_0xeef6('0x2')]),_0x22f17c);utils[_0xeef6('0x15')](util[_0xeef6('0x11')](_0xeef6('0x28'),_0x22f17c[_0xeef6('0x2')],_0x22f17c[_0xeef6('0x4')],_0x22f17c[_0xeef6('0x29')],_0x22f17c[_0xeef6('0x2a')]));dials[_0x22f17c[_0xeef6('0x2')]]=_[_0xeef6('0x1b')](dials[_0x22f17c[_0xeef6('0x2')]],{'endtime':utils['now'](),'lastevent':_0xeef6('0x2b')});dials[_0x22f17c[_0xeef6('0x2')]]['duration']=utils[_0xeef6('0x2c')](dials[_0x22f17c[_0xeef6('0x2')]]['endtime'],dials[_0x22f17c[_0xeef6('0x2')]]['starttime']);dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x2d')]=utils[_0xeef6('0x2c')](dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x25')]||dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x2e')],dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x1c')]);dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x2f')]=dials[_0x22f17c['uniqueid']][_0xeef6('0x25')]?utils[_0xeef6('0x2c')](dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x2e')],dials[_0x22f17c[_0xeef6('0x2')]][_0xeef6('0x25')]):0x0;writeDB(dials[_0x22f17c[_0xeef6('0x2')]]);}}catch(_0x1a0250){utils[_0xeef6('0x18')](util['format'](_0xeef6('0x27'),_0x22f17c[_0xeef6('0x2')]),_0x1a0250);}}; \ No newline at end of file +var _0xaefd=['error','[%s][dials][newexten]','varset','debug','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','value','dialbegin','isNil','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','dialend','[%s][dials][dialend]','ANSWER','answertime','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','complete','diffTime','endtime','holdtime','billableseconds','util','./utils','info','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','set','startsWith','toLowerCase','split'];(function(_0x19d48d,_0xc31e9e){var _0x1da815=function(_0x18686){while(--_0x18686){_0x19d48d['push'](_0x19d48d['shift']());}};_0x1da815(++_0xc31e9e);}(_0xaefd,0xc0));var _0xdaef=function(_0x5a67fa,_0x6fdba4){_0x5a67fa=_0x5a67fa-0x0;var _0x35b6e8=_0xaefd[_0x5a67fa];return _0x35b6e8;};'use strict';var _=require('lodash');var util=require(_0xdaef('0x0'));var utils=require(_0xdaef('0x1'));var dials={};function writeDB(_0x30bf8d){utils[_0xdaef('0x2')](util[_0xdaef('0x3')]('[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s',_0x30bf8d[_0xdaef('0x4')],_0x30bf8d[_0xdaef('0x5')],_0x30bf8d[_0xdaef('0x6')],_0x30bf8d[_0xdaef('0x7')],_0x30bf8d[_0xdaef('0x8')],_0x30bf8d[_0xdaef('0x9')]));utils[_0xdaef('0xa')](_0xdaef('0xb'),_0x30bf8d);delete dials[_0x30bf8d[_0xdaef('0x4')]];}exports[_0xdaef('0xc')]=function(_0x5a0528){try{utils['debug'](util[_0xdaef('0x3')]('[%s][dials][newexten]',_0x5a0528[_0xdaef('0x4')]),_0x5a0528);utils[_0xdaef('0x2')](util[_0xdaef('0x3')](_0xdaef('0xd'),_0x5a0528[_0xdaef('0x4')],_0x5a0528[_0xdaef('0xe')],_0x5a0528[_0xdaef('0xf')]));if(_0x5a0528['application']['toLowerCase']()==_0xdaef('0x10')&&_[_0xdaef('0x11')](_0x5a0528[_0xdaef('0xf')][_0xdaef('0x12')](),'cdr(routeid)')){var _0x5795b4=_0x5a0528[_0xdaef('0xf')][_0xdaef('0x13')]('=');dials[_0x5a0528[_0xdaef('0x4')]]={'routeId':_0x5795b4[0x1]};}}catch(_0x5e0ced){utils[_0xdaef('0x14')](util[_0xdaef('0x3')](_0xdaef('0x15'),_0x5a0528[_0xdaef('0x4')]),_0x5e0ced);}};exports[_0xdaef('0x16')]=function(_0x30aa12){try{utils[_0xdaef('0x17')](util[_0xdaef('0x3')](_0xdaef('0x18'),_0x30aa12[_0xdaef('0x4')]),_0x30aa12);if(!_['isNil'](_0x30aa12[_0xdaef('0x19')][_0xdaef('0x1a')])){utils['info'](util[_0xdaef('0x3')](_0xdaef('0x1b'),_0x30aa12['uniqueid'],_0x30aa12[_0xdaef('0x1c')]));dials[_0x30aa12[_0xdaef('0x4')]]={'routeId':_0x30aa12[_0xdaef('0x1c')]};}}catch(_0xdf213a){utils[_0xdaef('0x14')](util[_0xdaef('0x3')](_0xdaef('0x18'),_0x30aa12[_0xdaef('0x4')]),_0xdf213a);}};exports[_0xdaef('0x1d')]=function(_0xc45e29){try{if(!_[_0xdaef('0x1e')](dials[_0xc45e29[_0xdaef('0x4')]])){utils[_0xdaef('0x17')](util['format'](_0xdaef('0x1f'),_0xc45e29[_0xdaef('0x4')]),_0xc45e29);dials[_0xc45e29[_0xdaef('0x4')]]=_[_0xdaef('0x20')](dials[_0xc45e29[_0xdaef('0x4')]],_0xc45e29);dials[_0xc45e29[_0xdaef('0x4')]][_0xdaef('0x21')]=utils[_0xdaef('0x22')]();dials[_0xc45e29[_0xdaef('0x4')]][_0xdaef('0x23')]=_0xdaef('0x24');utils[_0xdaef('0x2')](util[_0xdaef('0x3')](_0xdaef('0x25'),_0xc45e29[_0xdaef('0x4')],dials[_0xc45e29[_0xdaef('0x4')]][_0xdaef('0x21')]));}}catch(_0x55e535){utils['error'](util['format'](_0xdaef('0x1f'),_0xc45e29['uniqueid']),_0x55e535);}};exports[_0xdaef('0x26')]=function(_0x4f2214){try{if(!_[_0xdaef('0x1e')](dials[_0x4f2214[_0xdaef('0x4')]])){utils[_0xdaef('0x17')](util['format'](_0xdaef('0x27'),_0x4f2214[_0xdaef('0x4')]),_0x4f2214);dials[_0x4f2214[_0xdaef('0x4')]][_0xdaef('0x9')]=_0x4f2214[_0xdaef('0x9')];if(_0x4f2214['dialstatus']==_0xdaef('0x28')){dials[_0x4f2214[_0xdaef('0x4')]]=_[_0xdaef('0x20')](dials[_0x4f2214[_0xdaef('0x4')]],_0x4f2214);dials[_0x4f2214[_0xdaef('0x4')]][_0xdaef('0x29')]=utils[_0xdaef('0x22')]();dials[_0x4f2214['uniqueid']]['lastevent']=_0xdaef('0x2a');utils[_0xdaef('0x2')](util['format'](_0xdaef('0x2b'),_0x4f2214['uniqueid'],_0x4f2214[_0xdaef('0x9')],dials[_0x4f2214[_0xdaef('0x4')]][_0xdaef('0x29')]));}else{utils[_0xdaef('0x2')](util['format'](_0xdaef('0x2c'),_0x4f2214[_0xdaef('0x4')],_0x4f2214[_0xdaef('0x9')]));}}}catch(_0x5f6697){utils[_0xdaef('0x14')](util['format'](_0xdaef('0x27'),_0x4f2214['uniqueid']),_0x5f6697);}};exports['hangup']=function(_0xfd94fe){try{if(!_['isNil'](dials[_0xfd94fe[_0xdaef('0x4')]])){utils[_0xdaef('0x17')](util[_0xdaef('0x3')](_0xdaef('0x2d'),_0xfd94fe['uniqueid']),_0xfd94fe);utils[_0xdaef('0x2')](util[_0xdaef('0x3')](_0xdaef('0x2e'),_0xfd94fe[_0xdaef('0x4')],_0xfd94fe['calleridnum'],_0xfd94fe[_0xdaef('0x2f')],_0xfd94fe['cause-txt']));dials[_0xfd94fe[_0xdaef('0x4')]]=_[_0xdaef('0x20')](dials[_0xfd94fe[_0xdaef('0x4')]],{'endtime':utils[_0xdaef('0x22')](),'lastevent':_0xdaef('0x30')});dials[_0xfd94fe[_0xdaef('0x4')]]['duration']=utils[_0xdaef('0x31')](dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x32')],dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x21')]);dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x33')]=utils['diffTime'](dials[_0xfd94fe[_0xdaef('0x4')]]['answertime']||dials[_0xfd94fe[_0xdaef('0x4')]]['endtime'],dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x21')]);dials[_0xfd94fe['uniqueid']][_0xdaef('0x34')]=dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x29')]?utils[_0xdaef('0x31')](dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x32')],dials[_0xfd94fe[_0xdaef('0x4')]][_0xdaef('0x29')]):0x0;writeDB(dials[_0xfd94fe[_0xdaef('0x4')]]);}}catch(_0x8b5af4){utils[_0xdaef('0x14')](util['format']('[%s][dials][hangup]',_0xfd94fe['uniqueid']),_0x8b5af4);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1d5c0b1..08f2761 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 _0x737e=['./calls.controller','./queues.controller','./members.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','debug','format','[%s][index][devicestatechange]','devicestatechange','device','agentcalled','uniqueid','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','musiconholdstop','[%s][index][musiconholdstop]','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','origtransfereruniqueid','attendedtransfer','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','[%s][index][dialend]','dialend','asterisk-manager','../../config/environment','util','asterisk','username','password','keepConnected','xdr','info','XDR\x20DISABLED','./agents.controller'];(function(_0x36ed48,_0x1ee0d4){var _0x51c63a=function(_0x2d0a40){while(--_0x2d0a40){_0x36ed48['push'](_0x36ed48['shift']());}};_0x51c63a(++_0x1ee0d4);}(_0x737e,0x75));var _0xe737=function(_0x12021a,_0x2ab689){_0x12021a=_0x12021a-0x0;var _0x1f82fe=_0x737e[_0x12021a];return _0x1f82fe;};var AsteriskManager=require(_0xe737('0x0'));var config=require(_0xe737('0x1'));var utils=require('./utils');var util=require(_0xe737('0x2'));var ami=new AsteriskManager(config[_0xe737('0x3')]['port'],config[_0xe737('0x3')]['ip'],config[_0xe737('0x3')][_0xe737('0x4')],config[_0xe737('0x3')][_0xe737('0x5')],!![]);ami[_0xe737('0x6')]();if(config['xdr']&&config[_0xe737('0x7')]['disabled']){utils[_0xe737('0x8')](_0xe737('0x9'));}else{var agents=require(_0xe737('0xa'));var calls=require(_0xe737('0xb'));var queues=require(_0xe737('0xc'));var recordings=require('./recordings.controller');var members=require(_0xe737('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require(_0xe737('0xe'));ami['on'](_0xe737('0xf'),core['connect']);ami['on'](_0xe737('0x10'),core[_0xe737('0x10')]);ami['on'](_0xe737('0x11'),core[_0xe737('0x11')]);ami['on'](_0xe737('0x12'),core[_0xe737('0x12')]);ami['on']('close',core['close']);ami['on'](_0xe737('0x13'),core['managerevent']);ami['on']('devicestatechange',function(_0x480c68){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x16'),_0x480c68['device']),_0x480c68);members[_0xe737('0x17')](_0x480c68);}catch(_0x5657b4){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x16'),_0x480c68[_0xe737('0x18')]),_0x5657b4);}});ami['on'](_0xe737('0x19'),function(_0x1146eb){try{utils['debug'](util[_0xe737('0x15')]('[%s][index][agentcalled]',_0x1146eb[_0xe737('0x1a')]),_0x1146eb);agents[_0xe737('0x19')](_0x1146eb);}catch(_0x4c60d2){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x1b'),_0x1146eb[_0xe737('0x1a')]),_0x4c60d2);}});ami['on'](_0xe737('0x1c'),function(_0x5b84ba){try{utils[_0xe737('0x14')](util[_0xe737('0x15')]('[%s][index][agentringnoanswer]',_0x5b84ba['uniqueid']),_0x5b84ba);agents['agentringnoanswer'](_0x5b84ba);}catch(_0x4c85c5){utils['error'](util[_0xe737('0x15')](_0xe737('0x1d'),_0x5b84ba['uniqueid']),_0x4c85c5);}});ami['on'](_0xe737('0x1e'),function(_0x2a8ff5){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x1f'),_0x2a8ff5['uniqueid']),_0x2a8ff5);agents[_0xe737('0x1e')](_0x2a8ff5);queues[_0xe737('0x1e')](_0x2a8ff5);}catch(_0x243c66){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x1f'),_0x2a8ff5['uniqueid']),_0x243c66);}});ami['on'](_0xe737('0x20'),function(_0x2747ac){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x21'),_0x2747ac[_0xe737('0x1a')]),_0x2747ac);agents['agentcomplete'](_0x2747ac);queues[_0xe737('0x20')](_0x2747ac);members[_0xe737('0x20')](_0x2747ac);}catch(_0x1d6e0d){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x21'),_0x2747ac[_0xe737('0x1a')]),_0x1d6e0d);}});ami['on'](_0xe737('0x22'),function(_0x22449d){try{utils[_0xe737('0x14')](util['format'](_0xe737('0x23'),_0x22449d[_0xe737('0x1a')]),_0x22449d);agents[_0xe737('0x22')](_0x22449d);queues[_0xe737('0x22')](_0x22449d);}catch(_0x26bc51){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x23'),_0x22449d[_0xe737('0x1a')]),_0x26bc51);}});ami['on'](_0xe737('0x24'),function(_0x3f277c){try{utils[_0xe737('0x14')](util['format'](_0xe737('0x25'),_0x3f277c[_0xe737('0x1a')]),_0x3f277c);queues[_0xe737('0x24')](_0x3f277c);recordings['queuecallerjoin'](_0x3f277c);}catch(_0x484def){utils['error'](util[_0xe737('0x15')](_0xe737('0x25'),_0x3f277c[_0xe737('0x1a')]),_0x484def);}});ami['on'](_0xe737('0x26'),function(_0x271b04){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x27'),_0x271b04['uniqueid']),_0x271b04);queues[_0xe737('0x26')](_0x271b04);}catch(_0x316f84){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x27'),_0x271b04[_0xe737('0x1a')]),_0x316f84);}});ami['on'](_0xe737('0x28'),function(_0x420ad1){try{utils['debug'](util[_0xe737('0x15')]('[%s][index][musiconholdstart]',_0x420ad1['uniqueid']),_0x420ad1);queues[_0xe737('0x28')](_0x420ad1);calls['musiconholdstart'](_0x420ad1);}catch(_0x12b789){utils[_0xe737('0x12')](util[_0xe737('0x15')]('[%s][index][musiconholdstart]',_0x420ad1[_0xe737('0x1a')]),_0x12b789);}});ami['on'](_0xe737('0x29'),function(_0x51290f){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x2a'),_0x51290f[_0xe737('0x1a')]),_0x51290f);queues[_0xe737('0x29')](_0x51290f);calls[_0xe737('0x29')](_0x51290f);}catch(_0x20ec5d){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x2a'),_0x51290f[_0xe737('0x1a')]),_0x20ec5d);}});ami['on'](_0xe737('0x2b'),function(_0x13e838){try{utils[_0xe737('0x14')](util[_0xe737('0x15')]('[%s][index][newstate]',_0x13e838[_0xe737('0x1a')]),_0x13e838);calls[_0xe737('0x2b')](_0x13e838);recordings[_0xe737('0x2b')](_0x13e838);}catch(_0x398594){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x2c'),_0x13e838[_0xe737('0x1a')]),_0x398594);}});ami['on'](_0xe737('0x2d'),function(_0x6c1ff5){try{utils['debug'](util['format'](_0xe737('0x2e'),_0x6c1ff5[_0xe737('0x1a')]),_0x6c1ff5);calls['hangup'](_0x6c1ff5);recordings[_0xe737('0x2d')](_0x6c1ff5);dials['hangup'](_0x6c1ff5);agents[_0xe737('0x2d')](_0x6c1ff5);queues['hangup'](_0x6c1ff5);}catch(_0x383ae5){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x2e'),_0x6c1ff5[_0xe737('0x1a')]),_0x383ae5);}});ami['on']('cdr',function(_0x3ff7ed){try{utils[_0xe737('0x14')](util['format'](_0xe737('0x2f'),_0x3ff7ed[_0xe737('0x1a')]),_0x3ff7ed);members[_0xe737('0x30')](_0x3ff7ed);}catch(_0x503f0f){utils[_0xe737('0x12')](util[_0xe737('0x15')]('[%s][index][cdr]',_0x3ff7ed[_0xe737('0x1a')]),_0x503f0f);}});ami['on'](_0xe737('0x31'),function(_0x33f506){try{utils['debug'](util[_0xe737('0x15')](_0xe737('0x32'),_0x33f506[_0xe737('0x1a')]),_0x33f506);queues[_0xe737('0x31')](_0x33f506);agents[_0xe737('0x31')](_0x33f506);transfers['blindtransfer'](_0x33f506);recordings[_0xe737('0x31')](_0x33f506);}catch(_0x232ca7){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x32'),_0x33f506[_0xe737('0x1a')]),_0x232ca7);}});ami['on']('attendedtransfer',function(_0x5a124c){try{utils['debug'](util[_0xe737('0x15')]('[%s][index][attendedtransfer]',_0x5a124c[_0xe737('0x33')]),_0x5a124c);queues[_0xe737('0x34')](_0x5a124c);transfers[_0xe737('0x34')](_0x5a124c);agents[_0xe737('0x34')](_0x5a124c);calls[_0xe737('0x34')](_0x5a124c);}catch(_0x13dcc9){utils[_0xe737('0x12')](util[_0xe737('0x15')]('[%s][index][attendedtransfer]',_0x5a124c['origtransfereruniqueid']),_0x13dcc9);}});ami['on']('varset',function(_0xab3993){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x35'),_0xab3993[_0xe737('0x1a')]),_0xab3993);queues[_0xe737('0x36')](_0xab3993);recordings[_0xe737('0x36')](_0xab3993);calls['varset'](_0xab3993);dials[_0xe737('0x36')](_0xab3993);}catch(_0x2ba21e){utils['error'](util[_0xe737('0x15')]('[%s][index][varset]',_0xab3993['uniqueid']),_0x2ba21e);}});ami['on'](_0xe737('0x37'),function(_0x2a8ae1){try{utils['debug'](util[_0xe737('0x15')](_0xe737('0x38'),_0x2a8ae1[_0xe737('0x1a')]),_0x2a8ae1);calls[_0xe737('0x37')](_0x2a8ae1);recordings['newexten'](_0x2a8ae1);dials['newexten'](_0x2a8ae1);}catch(_0x223919){utils[_0xe737('0x12')](util[_0xe737('0x15')](_0xe737('0x38'),_0x2a8ae1['uniqueid']),_0x223919);}});ami['on'](_0xe737('0x39'),function(_0x5445ef){try{utils['debug'](util[_0xe737('0x15')](_0xe737('0x3a'),_0x5445ef[_0xe737('0x1a')]),_0x5445ef);calls[_0xe737('0x39')](_0x5445ef);recordings['newchannel'](_0x5445ef);}catch(_0x18cdbf){utils[_0xe737('0x12')](util['format'](_0xe737('0x3a'),_0x5445ef[_0xe737('0x1a')]),_0x18cdbf);}});ami['on'](_0xe737('0x3b'),function(_0x533dc0){try{utils[_0xe737('0x14')](util[_0xe737('0x15')](_0xe737('0x3c'),_0x533dc0[_0xe737('0x1a')]),_0x533dc0);dials[_0xe737('0x3b')](_0x533dc0);}catch(_0x406cc4){utils['error'](util[_0xe737('0x15')](_0xe737('0x3d'),_0x533dc0[_0xe737('0x1a')]),_0x406cc4);}});ami['on']('dialend',function(_0x2db156){try{utils['debug'](util[_0xe737('0x15')](_0xe737('0x3e'),_0x2db156['uniqueid']),_0x2db156);dials[_0xe737('0x3f')](_0x2db156);}catch(_0x5380f1){utils[_0xe737('0x12')](util['format']('[%s][index][dialend]',_0x2db156[_0xe737('0x1a')]),_0x5380f1);}});} \ No newline at end of file +var _0x8be7=['./utils','asterisk','port','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','format','[%s][index][devicestatechange]','device','devicestatechange','debug','uniqueid','agentcalled','[%s][index][agentcalled]','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','[%s][index][queuecallerabandon]','queuecallerabandon','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','[%s][index][cdr]','cdr','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','varset','[%s][index][varset]','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s][index][dialbegin]','[%s]dialbegin','dialend','[%s][index][dialend]','asterisk-manager'];(function(_0x2d11d8,_0x247e53){var _0x847379=function(_0x48b63a){while(--_0x48b63a){_0x2d11d8['push'](_0x2d11d8['shift']());}};_0x847379(++_0x247e53);}(_0x8be7,0x8b));var _0x78be=function(_0x4c516c,_0x12fbb2){_0x4c516c=_0x4c516c-0x0;var _0x130aa5=_0x8be7[_0x4c516c];return _0x130aa5;};var AsteriskManager=require(_0x78be('0x0'));var config=require('../../config/environment');var utils=require(_0x78be('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0x78be('0x2')][_0x78be('0x3')],config[_0x78be('0x2')]['ip'],config[_0x78be('0x2')]['username'],config[_0x78be('0x2')][_0x78be('0x4')],!![]);ami[_0x78be('0x5')]();if(config[_0x78be('0x6')]&&config[_0x78be('0x6')][_0x78be('0x7')]){utils[_0x78be('0x8')](_0x78be('0x9'));}else{var agents=require(_0x78be('0xa'));var calls=require(_0x78be('0xb'));var queues=require(_0x78be('0xc'));var recordings=require(_0x78be('0xd'));var members=require(_0x78be('0xe'));var dials=require(_0x78be('0xf'));var transfers=require(_0x78be('0x10'));var core=require(_0x78be('0x11'));ami['on'](_0x78be('0x12'),core[_0x78be('0x12')]);ami['on'](_0x78be('0x13'),core[_0x78be('0x13')]);ami['on'](_0x78be('0x14'),core[_0x78be('0x14')]);ami['on'](_0x78be('0x15'),core[_0x78be('0x15')]);ami['on'](_0x78be('0x16'),core[_0x78be('0x16')]);ami['on'](_0x78be('0x17'),core[_0x78be('0x17')]);ami['on']('devicestatechange',function(_0x123ba6){try{utils['debug'](util[_0x78be('0x18')](_0x78be('0x19'),_0x123ba6[_0x78be('0x1a')]),_0x123ba6);members[_0x78be('0x1b')](_0x123ba6);}catch(_0x18eb1f){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x19'),_0x123ba6[_0x78be('0x1a')]),_0x18eb1f);}});ami['on']('agentcalled',function(_0x3d6fa9){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')]('[%s][index][agentcalled]',_0x3d6fa9[_0x78be('0x1d')]),_0x3d6fa9);agents[_0x78be('0x1e')](_0x3d6fa9);}catch(_0xacc203){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x1f'),_0x3d6fa9['uniqueid']),_0xacc203);}});ami['on'](_0x78be('0x20'),function(_0x247d3f){try{utils[_0x78be('0x1c')](util['format'](_0x78be('0x21'),_0x247d3f[_0x78be('0x1d')]),_0x247d3f);agents['agentringnoanswer'](_0x247d3f);}catch(_0x199b56){utils['error'](util['format'](_0x78be('0x21'),_0x247d3f['uniqueid']),_0x199b56);}});ami['on'](_0x78be('0x22'),function(_0x3dc9f0){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x23'),_0x3dc9f0[_0x78be('0x1d')]),_0x3dc9f0);agents[_0x78be('0x22')](_0x3dc9f0);queues[_0x78be('0x22')](_0x3dc9f0);}catch(_0xddeca0){utils['error'](util[_0x78be('0x18')](_0x78be('0x23'),_0x3dc9f0[_0x78be('0x1d')]),_0xddeca0);}});ami['on'](_0x78be('0x24'),function(_0x4245d0){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x25'),_0x4245d0['uniqueid']),_0x4245d0);agents['agentcomplete'](_0x4245d0);queues[_0x78be('0x24')](_0x4245d0);members[_0x78be('0x24')](_0x4245d0);}catch(_0x2b2ee0){utils['error'](util['format']('[%s][index][agentcomplete]',_0x4245d0[_0x78be('0x1d')]),_0x2b2ee0);}});ami['on']('queuecallerabandon',function(_0x33e12f){try{utils['debug'](util[_0x78be('0x18')](_0x78be('0x26'),_0x33e12f[_0x78be('0x1d')]),_0x33e12f);agents[_0x78be('0x27')](_0x33e12f);queues[_0x78be('0x27')](_0x33e12f);}catch(_0x187ccd){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x26'),_0x33e12f[_0x78be('0x1d')]),_0x187ccd);}});ami['on'](_0x78be('0x28'),function(_0x2b05de){try{utils['debug'](util[_0x78be('0x18')](_0x78be('0x29'),_0x2b05de[_0x78be('0x1d')]),_0x2b05de);queues['queuecallerjoin'](_0x2b05de);recordings[_0x78be('0x28')](_0x2b05de);}catch(_0x5481da){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x29'),_0x2b05de[_0x78be('0x1d')]),_0x5481da);}});ami['on'](_0x78be('0x2a'),function(_0x57ea5a){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x2b'),_0x57ea5a[_0x78be('0x1d')]),_0x57ea5a);queues[_0x78be('0x2a')](_0x57ea5a);}catch(_0x5d5839){utils[_0x78be('0x15')](util[_0x78be('0x18')]('[%s][index][queuecallerleave]',_0x57ea5a[_0x78be('0x1d')]),_0x5d5839);}});ami['on'](_0x78be('0x2c'),function(_0x2b6251){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x2d'),_0x2b6251[_0x78be('0x1d')]),_0x2b6251);queues[_0x78be('0x2c')](_0x2b6251);calls[_0x78be('0x2c')](_0x2b6251);}catch(_0x299962){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x2d'),_0x2b6251['uniqueid']),_0x299962);}});ami['on']('musiconholdstop',function(_0x5367eb){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x2e'),_0x5367eb[_0x78be('0x1d')]),_0x5367eb);queues[_0x78be('0x2f')](_0x5367eb);calls[_0x78be('0x2f')](_0x5367eb);}catch(_0x272538){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x2e'),_0x5367eb['uniqueid']),_0x272538);}});ami['on'](_0x78be('0x30'),function(_0x4644c9){try{utils['debug'](util[_0x78be('0x18')](_0x78be('0x31'),_0x4644c9['uniqueid']),_0x4644c9);calls[_0x78be('0x30')](_0x4644c9);recordings[_0x78be('0x30')](_0x4644c9);}catch(_0x48940b){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x31'),_0x4644c9[_0x78be('0x1d')]),_0x48940b);}});ami['on'](_0x78be('0x32'),function(_0x436076){try{utils[_0x78be('0x1c')](util['format'](_0x78be('0x33'),_0x436076[_0x78be('0x1d')]),_0x436076);calls[_0x78be('0x32')](_0x436076);recordings[_0x78be('0x32')](_0x436076);dials[_0x78be('0x32')](_0x436076);agents[_0x78be('0x32')](_0x436076);queues[_0x78be('0x32')](_0x436076);}catch(_0x4ff891){utils[_0x78be('0x15')](util[_0x78be('0x18')]('[%s][index][hangup]',_0x436076[_0x78be('0x1d')]),_0x4ff891);}});ami['on']('cdr',function(_0x539a65){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x34'),_0x539a65[_0x78be('0x1d')]),_0x539a65);members[_0x78be('0x35')](_0x539a65);}catch(_0xfa8886){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x34'),_0x539a65[_0x78be('0x1d')]),_0xfa8886);}});ami['on'](_0x78be('0x36'),function(_0x577d2c){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x37'),_0x577d2c[_0x78be('0x1d')]),_0x577d2c);queues[_0x78be('0x36')](_0x577d2c);agents[_0x78be('0x36')](_0x577d2c);transfers[_0x78be('0x36')](_0x577d2c);recordings[_0x78be('0x36')](_0x577d2c);}catch(_0x122de7){utils[_0x78be('0x15')](util[_0x78be('0x18')]('[%s][index][blindtransfer]',_0x577d2c[_0x78be('0x1d')]),_0x122de7);}});ami['on'](_0x78be('0x38'),function(_0x5beae3){try{utils[_0x78be('0x1c')](util['format'](_0x78be('0x39'),_0x5beae3[_0x78be('0x3a')]),_0x5beae3);queues[_0x78be('0x38')](_0x5beae3);transfers[_0x78be('0x38')](_0x5beae3);agents['attendedtransfer'](_0x5beae3);calls[_0x78be('0x38')](_0x5beae3);}catch(_0xa4bb34){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x39'),_0x5beae3[_0x78be('0x3a')]),_0xa4bb34);}});ami['on'](_0x78be('0x3b'),function(_0x2a878e){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x3c'),_0x2a878e[_0x78be('0x1d')]),_0x2a878e);queues[_0x78be('0x3b')](_0x2a878e);recordings[_0x78be('0x3b')](_0x2a878e);calls[_0x78be('0x3b')](_0x2a878e);dials[_0x78be('0x3b')](_0x2a878e);}catch(_0x1764ae){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x3c'),_0x2a878e[_0x78be('0x1d')]),_0x1764ae);}});ami['on'](_0x78be('0x3d'),function(_0x2b5b98){try{utils['debug'](util[_0x78be('0x18')](_0x78be('0x3e'),_0x2b5b98[_0x78be('0x1d')]),_0x2b5b98);calls[_0x78be('0x3d')](_0x2b5b98);recordings[_0x78be('0x3d')](_0x2b5b98);dials[_0x78be('0x3d')](_0x2b5b98);}catch(_0x1f7b00){utils[_0x78be('0x15')](util[_0x78be('0x18')]('[%s][index][newexten]',_0x2b5b98['uniqueid']),_0x1f7b00);}});ami['on'](_0x78be('0x3f'),function(_0x5619c8){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x40'),_0x5619c8[_0x78be('0x1d')]),_0x5619c8);calls[_0x78be('0x3f')](_0x5619c8);recordings[_0x78be('0x3f')](_0x5619c8);}catch(_0x5144d7){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x40'),_0x5619c8[_0x78be('0x1d')]),_0x5144d7);}});ami['on'](_0x78be('0x41'),function(_0x3790ba){try{utils[_0x78be('0x1c')](util[_0x78be('0x18')](_0x78be('0x42'),_0x3790ba[_0x78be('0x1d')]),_0x3790ba);dials['dialbegin'](_0x3790ba);}catch(_0x4c2cd4){utils[_0x78be('0x15')](util[_0x78be('0x18')](_0x78be('0x43'),_0x3790ba['uniqueid']),_0x4c2cd4);}});ami['on'](_0x78be('0x44'),function(_0xe9337b){try{utils['debug'](util[_0x78be('0x18')]('[%s][index][dialend]',_0xe9337b[_0x78be('0x1d')]),_0xe9337b);dials[_0x78be('0x44')](_0xe9337b);}catch(_0x312667){utils['error'](util[_0x78be('0x18')](_0x78be('0x45'),_0xe9337b[_0x78be('0x1d')]),_0x312667);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 5ca35dc..0c32dc9 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 _0x5e14=['then','name','internal','request','CreateMemberReport','catch','error','[%s][members][writeDB]','some','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','NOT_INUSE','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','assign','cdr','[%s][members][cdr]','data1','source','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','membername','type','getUserByInterface'];(function(_0x2a8ca3,_0x2626d7){var _0x2add49=function(_0x530550){while(--_0x530550){_0x2a8ca3['push'](_0x2a8ca3['shift']());}};_0x2add49(++_0x2626d7);}(_0x5e14,0x164));var _0x45e1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e14[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x45e1('0x0'));var util=require(_0x45e1('0x1'));var utils=require(_0x45e1('0x2'));var members={};var exclude=[_0x45e1('0x3'),_0x45e1('0x4')];function writeDB(_0x1af150){utils[_0x45e1('0x5')](util[_0x45e1('0x6')](_0x45e1('0x7'),_0x1af150[_0x45e1('0x8')],_0x1af150[_0x45e1('0x9')],_0x1af150[_0x45e1('0xa')],_0x1af150[_0x45e1('0xb')],_0x1af150[_0x45e1('0xc')],_0x1af150[_0x45e1('0xd')]));if(_0x1af150[_0x45e1('0x9')]){utils[_0x45e1('0xe')](_0x1af150[_0x45e1('0x9')])[_0x45e1('0xf')](function(_0x128854){if(_0x128854){_0x1af150[_0x45e1('0xc')]=_0x128854[_0x45e1('0x10')];_0x1af150['internal']=_0x128854[_0x45e1('0x11')];utils[_0x45e1('0x12')](_0x45e1('0x13'),_0x1af150);}else{utils['getUserByName'](_0x1af150[_0x45e1('0x9')]['split']('/')[0x1])[_0x45e1('0xf')](function(_0x257ac8){if(_0x257ac8){_0x1af150[_0x45e1('0xc')]=_0x257ac8[_0x45e1('0x10')];_0x1af150[_0x45e1('0x11')]=_0x257ac8[_0x45e1('0x11')];utils[_0x45e1('0x12')]('CreateMemberReport',_0x1af150);}});}})[_0x45e1('0x14')](function(_0x1061ac){utils[_0x45e1('0x15')](util[_0x45e1('0x6')](_0x45e1('0x16'),_0x1af150[_0x45e1('0x8')]),_0x1061ac);});}delete members[_0x1af150[_0x45e1('0x9')]];}function startsWith(_0x4c2344,_0x5d9dba){return _[_0x45e1('0x17')](_0x4c2344,function(_0x53a90e){return _['startsWith'](_0x5d9dba,_0x53a90e);});}exports['devicestatechange']=function(_0x1f8e39){try{utils[_0x45e1('0x18')](util[_0x45e1('0x6')](_0x45e1('0x19'),members[_0x1f8e39[_0x45e1('0x1a')]]?members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x8')]:_0x1f8e39[_0x45e1('0x1a')]),_0x1f8e39);utils['info'](util[_0x45e1('0x6')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x1f8e39[_0x45e1('0x1a')]]?members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x8')]:_0x1f8e39[_0x45e1('0x1a')],_0x1f8e39[_0x45e1('0x1b')],_0x1f8e39['device']));switch(_0x1f8e39[_0x45e1('0x1b')]){case _0x45e1('0x1c'):case _0x45e1('0x1d'):if(!startsWith(exclude,_0x1f8e39[_0x45e1('0x1a')])){members[_0x1f8e39[_0x45e1('0x1a')]]={'channel':_0x45e1('0x1e'),'interface':_0x1f8e39[_0x45e1('0x1a')],'type':_0x45e1('0x1f'),'enterAt':utils[_0x45e1('0x20')](),'role':_0x45e1('0x21')};}break;case _0x45e1('0x22'):if(!_[_0x45e1('0x23')](members[_0x1f8e39[_0x45e1('0x1a')]])){members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x24')]=utils[_0x45e1('0x20')]();members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x25')]=utils[_0x45e1('0x26')](members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x24')],members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x27')]);if(members[_0x1f8e39[_0x45e1('0x1a')]][_0x45e1('0x8')]){writeDB(members[_0x1f8e39[_0x45e1('0x1a')]]);}}break;default:break;}}catch(_0x2d2b14){utils[_0x45e1('0x15')](util[_0x45e1('0x6')](_0x45e1('0x19'),members[_0x1f8e39['device']]?members[_0x1f8e39[_0x45e1('0x1a')]]['uniqueid']:_0x1f8e39[_0x45e1('0x1a')]),_0x2d2b14);}};exports[_0x45e1('0x28')]=function(_0x4fccf0){try{if(!_[_0x45e1('0x23')](members[_0x4fccf0[_0x45e1('0x9')]])){utils[_0x45e1('0x18')](util[_0x45e1('0x6')](_0x45e1('0x29'),_0x4fccf0[_0x45e1('0x8')]),_0x4fccf0);utils[_0x45e1('0x5')](util['format'](_0x45e1('0x2a'),_0x4fccf0['uniqueid'],_0x4fccf0[_0x45e1('0x9')],_0x4fccf0[_0x45e1('0x2b')]));members[_0x4fccf0[_0x45e1('0x9')]]=_[_0x45e1('0x2c')](members[_0x4fccf0['interface']],{'data4':_0x4fccf0['queue'],'uniqueid':_0x4fccf0[_0x45e1('0x8')]});}}catch(_0x51e5b0){utils[_0x45e1('0x15')](util[_0x45e1('0x6')](_0x45e1('0x29'),_0x4fccf0['uniqueid']),_0x51e5b0);}};exports[_0x45e1('0x2d')]=function(_0x3ffeb4){try{utils[_0x45e1('0x18')](util[_0x45e1('0x6')](_0x45e1('0x2e'),_0x3ffeb4['uniqueid']),_0x3ffeb4);if(_0x3ffeb4[_0x45e1('0xa')]){var _0x32bd49=_0x3ffeb4[_0x45e1('0xa')]['split']('-')[0x0];if(!_['isNil'](members[_0x32bd49])){members[_0x32bd49]=_[_0x45e1('0x2c')](members[_0x32bd49],{'data1':members[_0x32bd49][_0x45e1('0x2f')]||_0x3ffeb4['type'],'data2':members[_0x32bd49]['data2']||_0x3ffeb4[_0x45e1('0x30')],'data3':members[_0x32bd49][_0x45e1('0x31')]||_0x3ffeb4['destination'],'uniqueid':members[_0x32bd49][_0x45e1('0x8')]||_0x3ffeb4['uniqueid']});utils[_0x45e1('0x5')](util[_0x45e1('0x6')](_0x45e1('0x32'),_0x3ffeb4['uniqueid'],members[_0x32bd49]['data1'],members[_0x32bd49][_0x45e1('0xb')],members[_0x32bd49][_0x45e1('0x31')]));if(members[_0x32bd49][_0x45e1('0x24')]){writeDB(members[_0x32bd49]);}}}if(_0x3ffeb4[_0x45e1('0x33')]){var _0x5e0b48=_0x3ffeb4['destinationchannel']['split']('-')[0x0];if(!_[_0x45e1('0x23')](members[_0x5e0b48])){members[_0x5e0b48]=_[_0x45e1('0x2c')](members[_0x5e0b48],{'data1':members[_0x5e0b48][_0x45e1('0x2f')]||_0x3ffeb4['type'],'data2':members[_0x5e0b48]['data2']||_0x3ffeb4['source'],'data3':members[_0x5e0b48][_0x45e1('0x31')]||_0x3ffeb4[_0x45e1('0x34')],'uniqueid':members[_0x5e0b48][_0x45e1('0x8')]||_0x3ffeb4[_0x45e1('0x8')]});utils[_0x45e1('0x5')](util[_0x45e1('0x6')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x3ffeb4[_0x45e1('0x8')],members[_0x5e0b48][_0x45e1('0x2f')],members[_0x5e0b48][_0x45e1('0xb')],members[_0x5e0b48][_0x45e1('0x31')]));if(members[_0x5e0b48]['exitAt']){writeDB(members[_0x5e0b48]);}}}}catch(_0x3fb463){utils['error'](util[_0x45e1('0x6')]('[%s][members][cdr]',_0x3ffeb4[_0x45e1('0x8')]),_0x3fb463);}}; \ No newline at end of file +var _0x565c=['enterAt','agentcomplete','[%s][members][agentcomplete]','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','assign','cdr','[%s][members][cdr]','data1','data2','source','data3','destination','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','lodash','util','./utils','Local/_attended@transfer','Queue:','uniqueid','interface','channel','type','getUserByInterface','then','membername','name','internal','request','getUserByName','split','error','format','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','BUSY','voice','TALKING','NOT_INUSE','isNil','exitAt','duration','diffTime'];(function(_0x335d80,_0x451d6d){var _0x524487=function(_0x441ba5){while(--_0x441ba5){_0x335d80['push'](_0x335d80['shift']());}};_0x524487(++_0x451d6d);}(_0x565c,0x73));var _0xc565=function(_0x3adb2f,_0x2d2904){_0x3adb2f=_0x3adb2f-0x0;var _0x36772c=_0x565c[_0x3adb2f];return _0x36772c;};'use strict';var _=require(_0xc565('0x0'));var util=require(_0xc565('0x1'));var utils=require(_0xc565('0x2'));var members={};var exclude=[_0xc565('0x3'),_0xc565('0x4')];function writeDB(_0xc81e3e){utils['info'](util['format']('[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s',_0xc81e3e[_0xc565('0x5')],_0xc81e3e[_0xc565('0x6')],_0xc81e3e[_0xc565('0x7')],_0xc81e3e['data2'],_0xc81e3e['membername'],_0xc81e3e[_0xc565('0x8')]));if(_0xc81e3e['interface']){utils[_0xc565('0x9')](_0xc81e3e[_0xc565('0x6')])[_0xc565('0xa')](function(_0x1eb7fe){if(_0x1eb7fe){_0xc81e3e[_0xc565('0xb')]=_0x1eb7fe[_0xc565('0xc')];_0xc81e3e['internal']=_0x1eb7fe[_0xc565('0xd')];utils[_0xc565('0xe')]('CreateMemberReport',_0xc81e3e);}else{utils[_0xc565('0xf')](_0xc81e3e[_0xc565('0x6')][_0xc565('0x10')]('/')[0x1])[_0xc565('0xa')](function(_0x259a34){if(_0x259a34){_0xc81e3e[_0xc565('0xb')]=_0x259a34[_0xc565('0xc')];_0xc81e3e[_0xc565('0xd')]=_0x259a34[_0xc565('0xd')];utils['request']('CreateMemberReport',_0xc81e3e);}});}})['catch'](function(_0x514495){utils[_0xc565('0x11')](util[_0xc565('0x12')]('[%s][members][writeDB]',_0xc81e3e[_0xc565('0x5')]),_0x514495);});}delete members[_0xc81e3e[_0xc565('0x6')]];}function startsWith(_0x297d35,_0x200ebb){return _[_0xc565('0x13')](_0x297d35,function(_0x11d3f1){return _[_0xc565('0x14')](_0x200ebb,_0x11d3f1);});}exports[_0xc565('0x15')]=function(_0x2818bd){try{utils[_0xc565('0x16')](util[_0xc565('0x12')](_0xc565('0x17'),members[_0x2818bd[_0xc565('0x18')]]?members[_0x2818bd[_0xc565('0x18')]][_0xc565('0x5')]:_0x2818bd['device']),_0x2818bd);utils['info'](util[_0xc565('0x12')](_0xc565('0x19'),members[_0x2818bd[_0xc565('0x18')]]?members[_0x2818bd[_0xc565('0x18')]]['uniqueid']:_0x2818bd[_0xc565('0x18')],_0x2818bd[_0xc565('0x1a')],_0x2818bd[_0xc565('0x18')]));switch(_0x2818bd[_0xc565('0x1a')]){case'INUSE':case _0xc565('0x1b'):if(!startsWith(exclude,_0x2818bd[_0xc565('0x18')])){members[_0x2818bd[_0xc565('0x18')]]={'channel':_0xc565('0x1c'),'interface':_0x2818bd[_0xc565('0x18')],'type':_0xc565('0x1d'),'enterAt':utils['now'](),'role':'agent'};}break;case _0xc565('0x1e'):if(!_[_0xc565('0x1f')](members[_0x2818bd[_0xc565('0x18')]])){members[_0x2818bd[_0xc565('0x18')]][_0xc565('0x20')]=utils['now']();members[_0x2818bd['device']][_0xc565('0x21')]=utils[_0xc565('0x22')](members[_0x2818bd[_0xc565('0x18')]]['exitAt'],members[_0x2818bd[_0xc565('0x18')]][_0xc565('0x23')]);if(members[_0x2818bd[_0xc565('0x18')]][_0xc565('0x5')]){writeDB(members[_0x2818bd[_0xc565('0x18')]]);}}break;default:break;}}catch(_0x5722da){utils[_0xc565('0x11')](util[_0xc565('0x12')](_0xc565('0x17'),members[_0x2818bd['device']]?members[_0x2818bd[_0xc565('0x18')]][_0xc565('0x5')]:_0x2818bd[_0xc565('0x18')]),_0x5722da);}};exports[_0xc565('0x24')]=function(_0x33493a){try{if(!_[_0xc565('0x1f')](members[_0x33493a[_0xc565('0x6')]])){utils['debug'](util[_0xc565('0x12')](_0xc565('0x25'),_0x33493a[_0xc565('0x5')]),_0x33493a);utils[_0xc565('0x26')](util[_0xc565('0x12')](_0xc565('0x27'),_0x33493a[_0xc565('0x5')],_0x33493a[_0xc565('0x6')],_0x33493a['queue']));members[_0x33493a['interface']]=_[_0xc565('0x28')](members[_0x33493a[_0xc565('0x6')]],{'data4':_0x33493a['queue'],'uniqueid':_0x33493a[_0xc565('0x5')]});}}catch(_0xeae687){utils[_0xc565('0x11')](util[_0xc565('0x12')](_0xc565('0x25'),_0x33493a[_0xc565('0x5')]),_0xeae687);}};exports[_0xc565('0x29')]=function(_0x4c7da9){try{utils[_0xc565('0x16')](util[_0xc565('0x12')](_0xc565('0x2a'),_0x4c7da9['uniqueid']),_0x4c7da9);if(_0x4c7da9[_0xc565('0x7')]){var _0x4c82ca=_0x4c7da9[_0xc565('0x7')]['split']('-')[0x0];if(!_[_0xc565('0x1f')](members[_0x4c82ca])){members[_0x4c82ca]=_[_0xc565('0x28')](members[_0x4c82ca],{'data1':members[_0x4c82ca][_0xc565('0x2b')]||_0x4c7da9[_0xc565('0x8')],'data2':members[_0x4c82ca][_0xc565('0x2c')]||_0x4c7da9[_0xc565('0x2d')],'data3':members[_0x4c82ca][_0xc565('0x2e')]||_0x4c7da9[_0xc565('0x2f')],'uniqueid':members[_0x4c82ca][_0xc565('0x5')]||_0x4c7da9['uniqueid']});utils[_0xc565('0x26')](util[_0xc565('0x12')](_0xc565('0x30'),_0x4c7da9[_0xc565('0x5')],members[_0x4c82ca][_0xc565('0x2b')],members[_0x4c82ca][_0xc565('0x2c')],members[_0x4c82ca][_0xc565('0x2e')]));if(members[_0x4c82ca]['exitAt']){writeDB(members[_0x4c82ca]);}}}if(_0x4c7da9['destinationchannel']){var _0x1280a9=_0x4c7da9[_0xc565('0x31')][_0xc565('0x10')]('-')[0x0];if(!_[_0xc565('0x1f')](members[_0x1280a9])){members[_0x1280a9]=_[_0xc565('0x28')](members[_0x1280a9],{'data1':members[_0x1280a9][_0xc565('0x2b')]||_0x4c7da9[_0xc565('0x8')],'data2':members[_0x1280a9]['data2']||_0x4c7da9[_0xc565('0x2d')],'data3':members[_0x1280a9]['data3']||_0x4c7da9[_0xc565('0x2f')],'uniqueid':members[_0x1280a9][_0xc565('0x5')]||_0x4c7da9[_0xc565('0x5')]});utils['info'](util['format'](_0xc565('0x30'),_0x4c7da9[_0xc565('0x5')],members[_0x1280a9][_0xc565('0x2b')],members[_0x1280a9][_0xc565('0x2c')],members[_0x1280a9][_0xc565('0x2e')]));if(members[_0x1280a9][_0xc565('0x20')]){writeDB(members[_0x1280a9]);}}}}catch(_0x2fa276){utils[_0xc565('0x11')](util['format'](_0xc565('0x2a'),_0x4c7da9[_0xc565('0x5')]),_0x2fa276);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 3eb2109..3b3208b 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 _0x4570=['holdtime','diffTime','queuecallerjoinAt','count','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDED','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','musiconholdstartAt','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','position','assign','now','error','hangup','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','COMPLETEDBYAGENT','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','value','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0x4570,0x17c));var _0x0457=function(_0x5c15d5,_0x260963){_0x5c15d5=_0x5c15d5-0x0;var _0x333968=_0x4570[_0x5c15d5];return _0x333968;};'use strict';var _=require(_0x0457('0x0'));var util=require(_0x0457('0x1'));var utils=require(_0x0457('0x2'));var queues={};function writeDB(_0x2e5ec7){utils[_0x0457('0x3')](util[_0x0457('0x4')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x2e5ec7[_0x0457('0x5')],_0x2e5ec7['channel'],_0x2e5ec7[_0x0457('0x6')],_0x2e5ec7[_0x0457('0x7')],_0x2e5ec7[_0x0457('0x8')],_0x2e5ec7[_0x0457('0x9')],_0x2e5ec7[_0x0457('0xa')]));if(_0x2e5ec7[_0x0457('0x6')]){utils[_0x0457('0xb')](_0x2e5ec7[_0x0457('0x6')])[_0x0457('0xc')](function(_0x264b31){if(_0x264b31){_0x2e5ec7[_0x0457('0xd')]=_0x264b31[_0x0457('0xd')];}utils['request'](_0x0457('0xe'),_0x2e5ec7);});}else{utils[_0x0457('0xf')](_0x0457('0xe'),_0x2e5ec7);}if(_0x2e5ec7[_0x0457('0x10')]){delete queues[_0x2e5ec7[_0x0457('0x10')]];}else{delete queues[_0x2e5ec7[_0x0457('0x5')]];}}exports[_0x0457('0x11')]=function(_0xc04961){try{utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x13'),_0xc04961[_0x0457('0x5')]),_0xc04961);utils[_0x0457('0x3')](util['format']('[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s',_0xc04961['uniqueid'],_0xc04961[_0x0457('0x6')],_0xc04961[_0x0457('0x14')]));queues[_0xc04961[_0x0457('0x5')]]=_[_0x0457('0x15')](_0xc04961,{'originalposition':_0xc04961['position'],'queuecallerjoinAt':utils[_0x0457('0x16')](),'mohtime':0x0});}catch(_0xf81091){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x13'),_0xc04961['uniqueid']),_0xf81091);}};exports[_0x0457('0x18')]=function(_0x5958b6){try{if(!_[_0x0457('0x19')](queues[_0x5958b6[_0x0457('0x5')]])){utils['debug'](util[_0x0457('0x4')](_0x0457('0x1a'),_0x5958b6[_0x0457('0x5')]),_0x5958b6);if(queues[_0x5958b6['uniqueid']][_0x0457('0x1b')]){if(!queues[_0x5958b6['uniqueid']][_0x0457('0x1c')]&&!queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0x1d')]){queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0x1e')]=!![];queues[_0x5958b6['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0xa')]=_0x0457('0x1f');}utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x20'),_0x5958b6['uniqueid'],queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0x21')],queues[_0x5958b6[_0x0457('0x5')]]['queuecallerexitreason']));writeDB(queues[_0x5958b6[_0x0457('0x5')]]);}else if(queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0x10')]){utils[_0x0457('0x3')](util['format']('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x5958b6['uniqueid'],queues[_0x5958b6['uniqueid']][_0x0457('0x21')],queues[_0x5958b6[_0x0457('0x5')]][_0x0457('0x10')]));queues[queues[_0x5958b6[_0x0457('0x5')]]['transfereduniqueid']]=queues[_0x5958b6[_0x0457('0x5')]];queues[queues[_0x5958b6[_0x0457('0x5')]]['transfereduniqueid']][_0x0457('0x22')]=0x2;delete queues[_0x5958b6[_0x0457('0x5')]];}}}catch(_0x58a088){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x1a'),_0x5958b6['uniqueid']),_0x58a088);}};exports[_0x0457('0x23')]=function(_0xd70ccd){try{utils['debug'](util[_0x0457('0x4')](_0x0457('0x24'),_0xd70ccd[_0x0457('0x5')]),_0xd70ccd);if(!_[_0x0457('0x19')](_0xd70ccd[_0x0457('0x25')][_0x0457('0x26')])&&_0xd70ccd['value'][_0x0457('0x27')]()!==_0x0457('0x28')){if(!_[_0x0457('0x19')](queues[_0xd70ccd[_0x0457('0x5')]])){queues[_0xd70ccd[_0x0457('0x5')]]['queuecallerabandon']=![];queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x29')]=null;queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x1d')]=!![];queues[_0xd70ccd['uniqueid']][_0x0457('0x2a')]=utils[_0x0457('0x16')]();queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0xa')]=_0xd70ccd['value'][_0x0457('0x27')]();utils[_0x0457('0x3')](util['format'](_0x0457('0x2b'),_0xd70ccd[_0x0457('0x5')],queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x21')],_0xd70ccd[_0x0457('0x2c')],queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0xa')]));writeDB(queues[_0xd70ccd[_0x0457('0x5')]]);}}else if(!_[_0x0457('0x19')](_0xd70ccd[_0x0457('0x25')][_0x0457('0x2d')])){if(!_[_0x0457('0x19')](queues[_0xd70ccd['uniqueid']])&&!queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x1c')]){queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x1c')]=![];queues[_0xd70ccd[_0x0457('0x5')]][_0x0457('0x29')]=null;queues[_0xd70ccd[_0x0457('0x5')]]['queuecallerexit']=!![];queues[_0xd70ccd['uniqueid']][_0x0457('0x2a')]=utils['now']();queues[_0xd70ccd['uniqueid']][_0x0457('0xa')]=_0x0457('0x2e');utils['info'](util[_0x0457('0x4')](_0x0457('0x2f'),_0xd70ccd[_0x0457('0x5')],queues[_0xd70ccd['uniqueid']][_0x0457('0x21')],_0xd70ccd[_0x0457('0x2c')],queues[_0xd70ccd[_0x0457('0x5')]]['queuecallerexitreason']));}}}catch(_0x523c3d){utils[_0x0457('0x17')](util[_0x0457('0x4')]('[%s][queues][varset]',_0xd70ccd[_0x0457('0x5')]),_0x523c3d);}};exports[_0x0457('0x1c')]=function(_0x404167){try{if(!_[_0x0457('0x19')](queues[_0x404167['uniqueid']])){utils[_0x0457('0x12')](util[_0x0457('0x4')]('[%s][queues][queuecallerabandon]',_0x404167[_0x0457('0x5')]),_0x404167);queues[_0x404167['uniqueid']][_0x0457('0x1d')]=![];queues[_0x404167[_0x0457('0x5')]]['queuecallerexitAt']=null;queues[_0x404167[_0x0457('0x5')]][_0x0457('0x1c')]=!![];queues[_0x404167[_0x0457('0x5')]][_0x0457('0x29')]=utils['now']();queues[_0x404167['uniqueid']][_0x0457('0xa')]=_0x0457('0x30');utils[_0x0457('0x3')](util['format'](_0x0457('0x31'),_0x404167[_0x0457('0x5')],queues[_0x404167[_0x0457('0x5')]]['name'],queues[_0x404167[_0x0457('0x5')]][_0x0457('0xa')]));}}catch(_0x38ebe2){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x32'),_0x404167[_0x0457('0x5')]),_0x38ebe2);}};exports[_0x0457('0x33')]=function(_0xc8b9da){try{if(!_[_0x0457('0x19')](queues[_0xc8b9da['uniqueid']])){utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x34'),_0xc8b9da['uniqueid']),_0xc8b9da);utils[_0x0457('0x3')](util['format'](_0x0457('0x35'),_0xc8b9da[_0x0457('0x5')],queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x21')],_0xc8b9da[_0x0457('0x36')],_0xc8b9da[_0x0457('0x37')]));queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x33')]=!![];queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x1b')]=utils['now']();queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x38')]=utils[_0x0457('0x39')](queues[_0xc8b9da[_0x0457('0x5')]]['queuecallerleaveAt'],queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x3a')]);queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x14')]=_0xc8b9da['position'];queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x3b')]=_0xc8b9da[_0x0457('0x3b')];queues[_0xc8b9da['uniqueid']][_0x0457('0x36')]=_0xc8b9da[_0x0457('0x36')];queues[_0xc8b9da[_0x0457('0x5')]][_0x0457('0x37')]=_0xc8b9da[_0x0457('0x37')];}}catch(_0x2e4a68){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x34'),_0xc8b9da['uniqueid']),_0x2e4a68);}};exports[_0x0457('0x3c')]=function(_0x3e96c8){try{if(!_[_0x0457('0x19')](queues[_0x3e96c8[_0x0457('0x5')]])){utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x3d'),_0x3e96c8[_0x0457('0x5')]),_0x3e96c8);utils[_0x0457('0x3')](util['format'](_0x0457('0x3e'),_0x3e96c8[_0x0457('0x5')],queues[_0x3e96c8[_0x0457('0x5')]]['name'],_0x3e96c8[_0x0457('0x3f')],_0x3e96c8[_0x0457('0x40')]));queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x1c')]=![];queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x1c')]=![];queues[_0x3e96c8['uniqueid']]['queuecallerabandonAt']=null;queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x1d')]=![];queues[_0x3e96c8[_0x0457('0x5')]]['queuecallerexitreason']=null;queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x2a')]=null;queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x41')]=!![];queues[_0x3e96c8[_0x0457('0x5')]][_0x0457('0x9')]=_0x3e96c8[_0x0457('0x40')];queues[_0x3e96c8[_0x0457('0x5')]]['lastAssignedTo']=_0x3e96c8[_0x0457('0x3f')];}}catch(_0x49394f){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x3d'),_0x3e96c8[_0x0457('0x5')]),_0x49394f);}};exports[_0x0457('0x42')]=function(_0x2be3a1){try{if(!_['isNil'](queues[_0x2be3a1[_0x0457('0x5')]])){if(queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x1b')]){utils['debug'](util[_0x0457('0x4')](_0x0457('0x43'),_0x2be3a1[_0x0457('0x5')]),_0x2be3a1);queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x1c')]=![];queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x1c')]=![];queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x29')]=null;queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x1d')]=![];queues[_0x2be3a1[_0x0457('0x5')]]['queuecallerexitAt']=null;queues[_0x2be3a1[_0x0457('0x5')]]['assigned']=!![];queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x7')]=_0x2be3a1[_0x0457('0x3f')];queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x1e')]=!![];queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0x44')]=utils['now']();if(_0x2be3a1[_0x0457('0x45')]==_0x0457('0x46')){if(!queues[_0x2be3a1[_0x0457('0x5')]]['transfer']){queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0xa')]=_0x0457('0x47');}}else{queues[_0x2be3a1['uniqueid']][_0x0457('0xa')]=_0x0457('0x48')+_0x2be3a1[_0x0457('0x45')][_0x0457('0x27')]();}utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x49'),_0x2be3a1[_0x0457('0x5')],queues[_0x2be3a1['uniqueid']][_0x0457('0x21')],_0x2be3a1[_0x0457('0x3f')],queues[_0x2be3a1[_0x0457('0x5')]][_0x0457('0xa')]));writeDB(queues[_0x2be3a1[_0x0457('0x5')]]);}}}catch(_0x54de83){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x43'),_0x2be3a1[_0x0457('0x5')]),_0x54de83);}};exports['blindtransfer']=function(_0x495aae){try{if(!_[_0x0457('0x19')](queues[_0x495aae[_0x0457('0x4a')]])){utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x4b'),_0x495aae[_0x0457('0x5')]),_0x495aae);queues[_0x495aae[_0x0457('0x4a')]]['transfer']=!![];queues[_0x495aae['transfereeuniqueid']][_0x0457('0x4c')]=_0x0457('0x4d');queues[_0x495aae[_0x0457('0x4a')]][_0x0457('0x4e')]=_0x495aae[_0x0457('0x4f')];queues[_0x495aae['transfereeuniqueid']][_0x0457('0x50')]=_0x495aae[_0x0457('0x4a')];queues[_0x495aae['transfereeuniqueid']][_0x0457('0xa')]=_0x0457('0x51');utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x52'),_0x495aae[_0x0457('0x5')],queues[_0x495aae['transfereeuniqueid']]['name'],_0x495aae['transfereeuniqueid'],_0x495aae[_0x0457('0x4f')]));}}catch(_0x5c496f){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x4b'),_0x495aae[_0x0457('0x5')]),_0x5c496f);}};exports['attendedtransfer']=function(_0x523811){try{utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x53'),_0x523811[_0x0457('0x54')]),_0x523811);if(_0x523811[_0x0457('0x54')]==_0x523811[_0x0457('0x55')]){if(!_[_0x0457('0x19')](queues[_0x523811['secondtransfererlinkedid']])){utils[_0x0457('0x3')](util[_0x0457('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x523811[_0x0457('0x54')],queues[_0x523811[_0x0457('0x56')]]['name'],_0x523811[_0x0457('0x57')]));queues[_0x523811['secondtransfererlinkedid']]['transfer']=!![];queues[_0x523811['secondtransfererlinkedid']]['transfertype']=_0x0457('0x58');queues[_0x523811[_0x0457('0x56')]][_0x0457('0x4e')]=_0x523811[_0x0457('0x57')];queues[_0x523811['secondtransfererlinkedid']]['transferuniqueid']=_0x523811[_0x0457('0x54')];queues[_0x523811[_0x0457('0x56')]][_0x0457('0xa')]=_0x0457('0x59');}if(!_['isNil'](queues[_0x523811[_0x0457('0x55')]])){if(_0x523811['transfereelinkedid']&&queues[_0x523811[_0x0457('0x5a')]]){queues[_0x523811[_0x0457('0x5a')]][_0x0457('0x22')]=0x1;queues[_0x523811[_0x0457('0x4a')]]=_[_0x0457('0x5b')](queues[_0x523811[_0x0457('0x5a')]]);queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x10')]=_0x523811['transfertargetuniqueid'];queues[_0x523811[_0x0457('0x4a')]]['queuecallerenterreason']=0x2;queues[_0x523811['transfereeuniqueid']][_0x0457('0x8')]=queues[_0x523811[_0x0457('0x56')]][_0x0457('0x8')];queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x5c')]=queues[_0x523811[_0x0457('0x56')]][_0x0457('0x5c')];queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x3a')]=utils[_0x0457('0x16')]();queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x1b')]=utils[_0x0457('0x16')]();queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x38')]=0x0;queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x5d')]=0x0;utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x5e'),_0x523811[_0x0457('0x54')],queues[_0x523811['transfereeuniqueid']][_0x0457('0x21')],queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x8')],queues[_0x523811[_0x0457('0x4a')]][_0x0457('0x5c')]));}else{utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x5f'),_0x523811[_0x0457('0x54')],queues[_0x523811[_0x0457('0x55')]]['name'],_0x523811['secondtransfererlinkedid']));queues[_0x523811['origtransfererlinkedid']][_0x0457('0x10')]=_0x523811[_0x0457('0x56')];}}}else if(_0x523811[_0x0457('0x60')]==_0x523811[_0x0457('0x56')]){if(!_['isNil'](queues[_0x523811[_0x0457('0x55')]])){utils[_0x0457('0x3')](util['format'](_0x0457('0x61'),_0x523811[_0x0457('0x54')],queues[_0x523811[_0x0457('0x55')]][_0x0457('0x21')],_0x523811[_0x0457('0x60')],_0x523811['secondtransfererexten']));queues[_0x523811[_0x0457('0x55')]][_0x0457('0x46')]=!![];queues[_0x523811['origtransfererlinkedid']][_0x0457('0x4c')]=_0x0457('0x58');queues[_0x523811[_0x0457('0x55')]]['transferexten']=_0x523811[_0x0457('0x62')];queues[_0x523811[_0x0457('0x55')]][_0x0457('0x50')]=_0x523811[_0x0457('0x60')];queues[_0x523811[_0x0457('0x55')]][_0x0457('0xa')]=_0x0457('0x59');}if(!_['isNil'](queues[_0x523811[_0x0457('0x56')]])){if(_0x523811[_0x0457('0x63')]&&queues[_0x523811[_0x0457('0x63')]]){queues[_0x523811[_0x0457('0x63')]][_0x0457('0x22')]=0x1;queues[_0x523811[_0x0457('0x64')]]=_[_0x0457('0x5b')](queues[_0x523811[_0x0457('0x63')]]);queues[_0x523811[_0x0457('0x64')]][_0x0457('0x10')]=_0x523811[_0x0457('0x64')];queues[_0x523811[_0x0457('0x64')]][_0x0457('0x22')]=0x2;queues[_0x523811[_0x0457('0x64')]][_0x0457('0x8')]=queues[_0x523811[_0x0457('0x55')]][_0x0457('0x8')];queues[_0x523811[_0x0457('0x64')]][_0x0457('0x5c')]=queues[_0x523811[_0x0457('0x55')]]['calleridname'];queues[_0x523811[_0x0457('0x64')]][_0x0457('0x3a')]=utils[_0x0457('0x16')]();queues[_0x523811[_0x0457('0x64')]]['queuecallerleaveAt']=utils[_0x0457('0x16')]();queues[_0x523811[_0x0457('0x64')]][_0x0457('0x38')]=0x0;queues[_0x523811[_0x0457('0x64')]]['mohtime']=0x0;utils['info'](util[_0x0457('0x4')](_0x0457('0x65'),_0x523811['origtransfereruniqueid'],queues[_0x523811[_0x0457('0x64')]][_0x0457('0x21')],queues[_0x523811[_0x0457('0x64')]]['transfereduniqueid'],queues[_0x523811[_0x0457('0x64')]]['calleridnum'],queues[_0x523811[_0x0457('0x64')]][_0x0457('0x5c')]));}else{utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x5f'),_0x523811[_0x0457('0x54')],queues[_0x523811['secondtransfererlinkedid']][_0x0457('0x21')],_0x523811['origtransfererlinkedid']));queues[_0x523811[_0x0457('0x56')]][_0x0457('0x10')]=_0x523811[_0x0457('0x55')];}}}}catch(_0x2e5d3d){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x53'),_0x523811['origtransfereruniqueid']),_0x2e5d3d);}};exports[_0x0457('0x66')]=function(_0x408cce){try{if(!_['isNil'](queues[_0x408cce[_0x0457('0x5')]])){utils[_0x0457('0x12')](util[_0x0457('0x4')]('[%s][queues][musiconholdstart]',_0x408cce[_0x0457('0x5')]),_0x408cce);queues[_0x408cce['uniqueid']]['musiconholdstartAt']=utils[_0x0457('0x16')]();utils[_0x0457('0x3')](util[_0x0457('0x4')](_0x0457('0x67'),_0x408cce[_0x0457('0x5')],queues[_0x408cce[_0x0457('0x5')]][_0x0457('0x21')],queues[_0x408cce['uniqueid']][_0x0457('0x68')]));}}catch(_0x498b03){utils[_0x0457('0x17')](util['format'](_0x0457('0x69'),_0x408cce[_0x0457('0x5')]),_0x498b03);}};exports[_0x0457('0x6a')]=function(_0x49f89a){try{if(!_['isNil'](queues[_0x49f89a[_0x0457('0x5')]])){if(!_[_0x0457('0x19')](queues[_0x49f89a[_0x0457('0x5')]][_0x0457('0x68')])){utils[_0x0457('0x12')](util[_0x0457('0x4')](_0x0457('0x6b'),_0x49f89a['uniqueid']),_0x49f89a);queues[_0x49f89a[_0x0457('0x5')]][_0x0457('0x5d')]+=utils[_0x0457('0x39')](utils['now'](),queues[_0x49f89a[_0x0457('0x5')]][_0x0457('0x68')]);utils[_0x0457('0x3')](util['format'](_0x0457('0x6c'),_0x49f89a[_0x0457('0x5')],queues[_0x49f89a[_0x0457('0x5')]]['name'],queues[_0x49f89a[_0x0457('0x5')]][_0x0457('0x5d')]));delete queues[_0x49f89a['uniqueid']]['musiconholdstartAt'];}}}catch(_0x1b1545){utils[_0x0457('0x17')](util[_0x0457('0x4')](_0x0457('0x6b'),_0x49f89a[_0x0457('0x5')]),_0x1b1545);}}; \ No newline at end of file +var _0xbffc=['queuecallerjoinAt','count','[%s][queues][queuecallerleave]','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','[%s][queues][agentcomplete]','blindtransfer','[%s][queues][blindtransfer]','transfereeuniqueid','transfertype','BLIND','transferexten','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','[%s][queues][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererlinkedid','ATTENDED','origtransfererexten','transferuniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','calleridname','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfererexten','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','debug','[%s][queues][queuecallerjoin]','uniqueid','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','queue','position','error','isNil','[%s][queues][hangup]','queuecallerabandon','queuecallercompleteAt','now','COMPLETEDBYAGENT','info','[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','EXITWITHKEY','[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','queuecallerleave','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','queuecallerleaveAt','holdtime','diffTime'];(function(_0x2908a8,_0x345f8d){var _0xc7330d=function(_0x3254f6){while(--_0x3254f6){_0x2908a8['push'](_0x2908a8['shift']());}};_0xc7330d(++_0x345f8d);}(_0xbffc,0x111));var _0xcbff=function(_0x1ebeae,_0xbc413a){_0x1ebeae=_0x1ebeae-0x0;var _0x3a83c4=_0xbffc[_0x1ebeae];return _0x3a83c4;};'use strict';var _=require(_0xcbff('0x0'));var util=require(_0xcbff('0x1'));var utils=require(_0xcbff('0x2'));var queues={};function writeDB(_0x413f91){utils['info'](util[_0xcbff('0x3')](_0xcbff('0x4'),_0x413f91['uniqueid'],_0x413f91['channel'],_0x413f91['queue'],_0x413f91[_0xcbff('0x5')],_0x413f91[_0xcbff('0x6')],_0x413f91[_0xcbff('0x7')],_0x413f91[_0xcbff('0x8')]));if(_0x413f91['queue']){utils[_0xcbff('0x9')](_0x413f91['queue'])[_0xcbff('0xa')](function(_0x5c120a){if(_0x5c120a){_0x413f91[_0xcbff('0xb')]=_0x5c120a[_0xcbff('0xb')];}utils[_0xcbff('0xc')](_0xcbff('0xd'),_0x413f91);});}else{utils[_0xcbff('0xc')](_0xcbff('0xd'),_0x413f91);}if(_0x413f91[_0xcbff('0xe')]){delete queues[_0x413f91[_0xcbff('0xe')]];}else{delete queues[_0x413f91['uniqueid']];}}exports['queuecallerjoin']=function(_0x2e6425){try{utils[_0xcbff('0xf')](util[_0xcbff('0x3')](_0xcbff('0x10'),_0x2e6425[_0xcbff('0x11')]),_0x2e6425);utils['info'](util['format'](_0xcbff('0x12'),_0x2e6425[_0xcbff('0x11')],_0x2e6425[_0xcbff('0x13')],_0x2e6425['position']));queues[_0x2e6425[_0xcbff('0x11')]]=_['assign'](_0x2e6425,{'originalposition':_0x2e6425[_0xcbff('0x14')],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x3a79c4){utils[_0xcbff('0x15')](util[_0xcbff('0x3')](_0xcbff('0x10'),_0x2e6425[_0xcbff('0x11')]),_0x3a79c4);}};exports['hangup']=function(_0x5b34d5){try{if(!_[_0xcbff('0x16')](queues[_0x5b34d5[_0xcbff('0x11')]])){utils[_0xcbff('0xf')](util['format'](_0xcbff('0x17'),_0x5b34d5[_0xcbff('0x11')]),_0x5b34d5);if(queues[_0x5b34d5['uniqueid']]['queuecallerleaveAt']){if(!queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0x18')]&&!queues[_0x5b34d5['uniqueid']]['queuecallerexit']){queues[_0x5b34d5['uniqueid']]['queuecallercomplete']=!![];queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0x19')]=utils[_0xcbff('0x1a')]();queues[_0x5b34d5['uniqueid']][_0xcbff('0x8')]=_0xcbff('0x1b');}utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x1d'),_0x5b34d5[_0xcbff('0x11')],queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0x1e')],queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0x8')]));writeDB(queues[_0x5b34d5[_0xcbff('0x11')]]);}else if(queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0xe')]){utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x1f'),_0x5b34d5[_0xcbff('0x11')],queues[_0x5b34d5[_0xcbff('0x11')]]['name'],queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0xe')]));queues[queues[_0x5b34d5['uniqueid']][_0xcbff('0xe')]]=queues[_0x5b34d5['uniqueid']];queues[queues[_0x5b34d5[_0xcbff('0x11')]][_0xcbff('0xe')]][_0xcbff('0x20')]=0x2;delete queues[_0x5b34d5[_0xcbff('0x11')]];}}}catch(_0x23aef0){utils[_0xcbff('0x15')](util['format'](_0xcbff('0x17'),_0x5b34d5[_0xcbff('0x11')]),_0x23aef0);}};exports[_0xcbff('0x21')]=function(_0xd3e5b0){try{utils[_0xcbff('0xf')](util[_0xcbff('0x3')](_0xcbff('0x22'),_0xd3e5b0['uniqueid']),_0xd3e5b0);if(!_[_0xcbff('0x16')](_0xd3e5b0[_0xcbff('0x23')][_0xcbff('0x24')])&&_0xd3e5b0[_0xcbff('0x25')][_0xcbff('0x26')]()!==_0xcbff('0x27')){if(!_[_0xcbff('0x16')](queues[_0xd3e5b0[_0xcbff('0x11')]])){queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x18')]=![];queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x28')]=null;queues[_0xd3e5b0['uniqueid']][_0xcbff('0x29')]=!![];queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x2a')]=utils[_0xcbff('0x1a')]();queues[_0xd3e5b0['uniqueid']][_0xcbff('0x8')]=_0xd3e5b0['value'][_0xcbff('0x26')]();utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x2b'),_0xd3e5b0[_0xcbff('0x11')],queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x1e')],_0xd3e5b0[_0xcbff('0x25')],queues[_0xd3e5b0[_0xcbff('0x11')]]['queuecallerexitreason']));writeDB(queues[_0xd3e5b0['uniqueid']]);}}else if(!_['isNil'](_0xd3e5b0[_0xcbff('0x23')][_0xcbff('0x2c')])){if(!_[_0xcbff('0x16')](queues[_0xd3e5b0[_0xcbff('0x11')]])&&!queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x18')]){queues[_0xd3e5b0['uniqueid']][_0xcbff('0x18')]=![];queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x28')]=null;queues[_0xd3e5b0['uniqueid']]['queuecallerexit']=!![];queues[_0xd3e5b0['uniqueid']]['queuecallerexitAt']=utils[_0xcbff('0x1a')]();queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x8')]=_0xcbff('0x2d');utils[_0xcbff('0x1c')](util['format'](_0xcbff('0x2e'),_0xd3e5b0['uniqueid'],queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x1e')],_0xd3e5b0[_0xcbff('0x25')],queues[_0xd3e5b0[_0xcbff('0x11')]][_0xcbff('0x8')]));}}}catch(_0x5ad282){utils['error'](util[_0xcbff('0x3')](_0xcbff('0x22'),_0xd3e5b0['uniqueid']),_0x5ad282);}};exports[_0xcbff('0x18')]=function(_0x2c6bbe){try{if(!_[_0xcbff('0x16')](queues[_0x2c6bbe[_0xcbff('0x11')]])){utils[_0xcbff('0xf')](util['format'](_0xcbff('0x2f'),_0x2c6bbe[_0xcbff('0x11')]),_0x2c6bbe);queues[_0x2c6bbe[_0xcbff('0x11')]][_0xcbff('0x29')]=![];queues[_0x2c6bbe[_0xcbff('0x11')]]['queuecallerexitAt']=null;queues[_0x2c6bbe['uniqueid']]['queuecallerabandon']=!![];queues[_0x2c6bbe[_0xcbff('0x11')]][_0xcbff('0x28')]=utils[_0xcbff('0x1a')]();queues[_0x2c6bbe[_0xcbff('0x11')]]['queuecallerexitreason']=_0xcbff('0x30');utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x31'),_0x2c6bbe[_0xcbff('0x11')],queues[_0x2c6bbe[_0xcbff('0x11')]][_0xcbff('0x1e')],queues[_0x2c6bbe[_0xcbff('0x11')]][_0xcbff('0x8')]));}}catch(_0x147721){utils[_0xcbff('0x15')](util[_0xcbff('0x3')](_0xcbff('0x2f'),_0x2c6bbe[_0xcbff('0x11')]),_0x147721);}};exports[_0xcbff('0x32')]=function(_0x6c196f){try{if(!_['isNil'](queues[_0x6c196f['uniqueid']])){utils[_0xcbff('0xf')](util[_0xcbff('0x3')]('[%s][queues][queuecallerleave]',_0x6c196f[_0xcbff('0x11')]),_0x6c196f);utils['info'](util[_0xcbff('0x3')](_0xcbff('0x33'),_0x6c196f['uniqueid'],queues[_0x6c196f['uniqueid']]['name'],_0x6c196f[_0xcbff('0x34')],_0x6c196f[_0xcbff('0x35')]));queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x32')]=!![];queues[_0x6c196f['uniqueid']][_0xcbff('0x36')]=utils[_0xcbff('0x1a')]();queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x37')]=utils[_0xcbff('0x38')](queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x36')],queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x39')]);queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x14')]=_0x6c196f[_0xcbff('0x14')];queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x3a')]=_0x6c196f['count'];queues[_0x6c196f[_0xcbff('0x11')]]['connectedlinenum']=_0x6c196f[_0xcbff('0x34')];queues[_0x6c196f[_0xcbff('0x11')]][_0xcbff('0x35')]=_0x6c196f[_0xcbff('0x35')];}}catch(_0x26f06f){utils[_0xcbff('0x15')](util['format'](_0xcbff('0x3b'),_0x6c196f[_0xcbff('0x11')]),_0x26f06f);}};exports['agentconnect']=function(_0x23841c){try{if(!_['isNil'](queues[_0x23841c[_0xcbff('0x11')]])){utils['debug'](util[_0xcbff('0x3')](_0xcbff('0x3c'),_0x23841c[_0xcbff('0x11')]),_0x23841c);utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x3d'),_0x23841c[_0xcbff('0x11')],queues[_0x23841c[_0xcbff('0x11')]]['name'],_0x23841c[_0xcbff('0x3e')],_0x23841c[_0xcbff('0x3f')]));queues[_0x23841c['uniqueid']]['queuecallerabandon']=![];queues[_0x23841c[_0xcbff('0x11')]][_0xcbff('0x18')]=![];queues[_0x23841c[_0xcbff('0x11')]][_0xcbff('0x28')]=null;queues[_0x23841c[_0xcbff('0x11')]][_0xcbff('0x29')]=![];queues[_0x23841c[_0xcbff('0x11')]]['queuecallerexitreason']=null;queues[_0x23841c[_0xcbff('0x11')]][_0xcbff('0x2a')]=null;queues[_0x23841c[_0xcbff('0x11')]][_0xcbff('0x40')]=!![];queues[_0x23841c['uniqueid']]['accountcode']=_0x23841c[_0xcbff('0x3f')];queues[_0x23841c['uniqueid']][_0xcbff('0x5')]=_0x23841c['membername'];}}catch(_0x307efa){utils['error'](util[_0xcbff('0x3')](_0xcbff('0x3c'),_0x23841c[_0xcbff('0x11')]),_0x307efa);}};exports[_0xcbff('0x41')]=function(_0x332bb2){try{if(!_[_0xcbff('0x16')](queues[_0x332bb2[_0xcbff('0x11')]])){if(queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x36')]){utils['debug'](util[_0xcbff('0x3')]('[%s][queues][agentcomplete]',_0x332bb2[_0xcbff('0x11')]),_0x332bb2);queues[_0x332bb2['uniqueid']][_0xcbff('0x18')]=![];queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x18')]=![];queues[_0x332bb2['uniqueid']][_0xcbff('0x28')]=null;queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x29')]=![];queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x2a')]=null;queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x40')]=!![];queues[_0x332bb2['uniqueid']][_0xcbff('0x5')]=_0x332bb2[_0xcbff('0x3e')];queues[_0x332bb2['uniqueid']][_0xcbff('0x42')]=!![];queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x19')]=utils[_0xcbff('0x1a')]();if(_0x332bb2[_0xcbff('0x43')]=='transfer'){if(!queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x44')]){queues[_0x332bb2['uniqueid']]['queuecallerexitreason']=_0xcbff('0x45');}}else{queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x8')]=_0xcbff('0x46')+_0x332bb2['reason']['toUpperCase']();}utils['info'](util[_0xcbff('0x3')](_0xcbff('0x47'),_0x332bb2[_0xcbff('0x11')],queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x1e')],_0x332bb2[_0xcbff('0x3e')],queues[_0x332bb2[_0xcbff('0x11')]][_0xcbff('0x8')]));writeDB(queues[_0x332bb2[_0xcbff('0x11')]]);}}}catch(_0x18c994){utils[_0xcbff('0x15')](util[_0xcbff('0x3')](_0xcbff('0x48'),_0x332bb2[_0xcbff('0x11')]),_0x18c994);}};exports[_0xcbff('0x49')]=function(_0x96158a){try{if(!_[_0xcbff('0x16')](queues[_0x96158a['transfereeuniqueid']])){utils['debug'](util[_0xcbff('0x3')](_0xcbff('0x4a'),_0x96158a[_0xcbff('0x11')]),_0x96158a);queues[_0x96158a[_0xcbff('0x4b')]][_0xcbff('0x44')]=!![];queues[_0x96158a['transfereeuniqueid']][_0xcbff('0x4c')]=_0xcbff('0x4d');queues[_0x96158a[_0xcbff('0x4b')]][_0xcbff('0x4e')]=_0x96158a['extension'];queues[_0x96158a[_0xcbff('0x4b')]]['transferuniqueid']=_0x96158a[_0xcbff('0x4b')];queues[_0x96158a[_0xcbff('0x4b')]][_0xcbff('0x8')]=_0xcbff('0x4f');utils[_0xcbff('0x1c')](util['format'](_0xcbff('0x50'),_0x96158a[_0xcbff('0x11')],queues[_0x96158a[_0xcbff('0x4b')]][_0xcbff('0x1e')],_0x96158a['transfereeuniqueid'],_0x96158a[_0xcbff('0x51')]));}}catch(_0x24b9dd){utils[_0xcbff('0x15')](util[_0xcbff('0x3')](_0xcbff('0x4a'),_0x96158a['uniqueid']),_0x24b9dd);}};exports[_0xcbff('0x52')]=function(_0x5db67d){try{utils[_0xcbff('0xf')](util[_0xcbff('0x3')](_0xcbff('0x53'),_0x5db67d['origtransfereruniqueid']),_0x5db67d);if(_0x5db67d[_0xcbff('0x54')]==_0x5db67d[_0xcbff('0x55')]){if(!_[_0xcbff('0x16')](queues[_0x5db67d['secondtransfererlinkedid']])){utils[_0xcbff('0x1c')](util['format'](_0xcbff('0x56'),_0x5db67d[_0xcbff('0x54')],queues[_0x5db67d['secondtransfererlinkedid']][_0xcbff('0x1e')],_0x5db67d['origtransfererexten']));queues[_0x5db67d['secondtransfererlinkedid']]['transfer']=!![];queues[_0x5db67d[_0xcbff('0x57')]]['transfertype']=_0xcbff('0x58');queues[_0x5db67d[_0xcbff('0x57')]]['transferexten']=_0x5db67d[_0xcbff('0x59')];queues[_0x5db67d[_0xcbff('0x57')]][_0xcbff('0x5a')]=_0x5db67d[_0xcbff('0x54')];queues[_0x5db67d[_0xcbff('0x57')]][_0xcbff('0x8')]=_0xcbff('0x5b');}if(!_[_0xcbff('0x16')](queues[_0x5db67d['origtransfererlinkedid']])){if(_0x5db67d['transfereelinkedid']&&queues[_0x5db67d[_0xcbff('0x5c')]]){queues[_0x5db67d[_0xcbff('0x5c')]][_0xcbff('0x20')]=0x1;queues[_0x5db67d['transfereeuniqueid']]=_[_0xcbff('0x5d')](queues[_0x5db67d[_0xcbff('0x5c')]]);queues[_0x5db67d[_0xcbff('0x4b')]]['transfereduniqueid']=_0x5db67d['transfertargetuniqueid'];queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x20')]=0x2;queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x6')]=queues[_0x5db67d[_0xcbff('0x57')]][_0xcbff('0x6')];queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x5e')]=queues[_0x5db67d['secondtransfererlinkedid']][_0xcbff('0x5e')];queues[_0x5db67d['transfereeuniqueid']][_0xcbff('0x39')]=utils[_0xcbff('0x1a')]();queues[_0x5db67d[_0xcbff('0x4b')]]['queuecallerleaveAt']=utils[_0xcbff('0x1a')]();queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x37')]=0x0;queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x5f')]=0x0;utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x60'),_0x5db67d[_0xcbff('0x54')],queues[_0x5db67d[_0xcbff('0x4b')]][_0xcbff('0x1e')],queues[_0x5db67d['transfereeuniqueid']][_0xcbff('0x6')],queues[_0x5db67d[_0xcbff('0x4b')]]['calleridname']));}else{utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x61'),_0x5db67d['origtransfereruniqueid'],queues[_0x5db67d[_0xcbff('0x55')]][_0xcbff('0x1e')],_0x5db67d[_0xcbff('0x57')]));queues[_0x5db67d['origtransfererlinkedid']][_0xcbff('0xe')]=_0x5db67d[_0xcbff('0x57')];}}}else if(_0x5db67d[_0xcbff('0x62')]==_0x5db67d[_0xcbff('0x57')]){if(!_['isNil'](queues[_0x5db67d[_0xcbff('0x55')]])){utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x63'),_0x5db67d[_0xcbff('0x54')],queues[_0x5db67d[_0xcbff('0x55')]]['name'],_0x5db67d[_0xcbff('0x62')],_0x5db67d[_0xcbff('0x64')]));queues[_0x5db67d[_0xcbff('0x55')]][_0xcbff('0x44')]=!![];queues[_0x5db67d[_0xcbff('0x55')]][_0xcbff('0x4c')]=_0xcbff('0x58');queues[_0x5db67d['origtransfererlinkedid']][_0xcbff('0x4e')]=_0x5db67d['secondtransfererexten'];queues[_0x5db67d[_0xcbff('0x55')]][_0xcbff('0x5a')]=_0x5db67d[_0xcbff('0x62')];queues[_0x5db67d['origtransfererlinkedid']][_0xcbff('0x8')]='ATTENDEDTRANSFER';}if(!_[_0xcbff('0x16')](queues[_0x5db67d[_0xcbff('0x57')]])){if(_0x5db67d['transfertargetlinkedid']&&queues[_0x5db67d[_0xcbff('0x65')]]){queues[_0x5db67d[_0xcbff('0x65')]][_0xcbff('0x20')]=0x1;queues[_0x5db67d[_0xcbff('0x66')]]=_[_0xcbff('0x5d')](queues[_0x5db67d[_0xcbff('0x65')]]);queues[_0x5db67d[_0xcbff('0x66')]]['transfereduniqueid']=_0x5db67d[_0xcbff('0x66')];queues[_0x5db67d[_0xcbff('0x66')]]['queuecallerenterreason']=0x2;queues[_0x5db67d[_0xcbff('0x66')]][_0xcbff('0x6')]=queues[_0x5db67d[_0xcbff('0x55')]]['calleridnum'];queues[_0x5db67d['transfertargetuniqueid']][_0xcbff('0x5e')]=queues[_0x5db67d[_0xcbff('0x55')]][_0xcbff('0x5e')];queues[_0x5db67d[_0xcbff('0x66')]]['queuecallerjoinAt']=utils['now']();queues[_0x5db67d[_0xcbff('0x66')]][_0xcbff('0x36')]=utils['now']();queues[_0x5db67d[_0xcbff('0x66')]][_0xcbff('0x37')]=0x0;queues[_0x5db67d[_0xcbff('0x66')]][_0xcbff('0x5f')]=0x0;utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x67'),_0x5db67d['origtransfereruniqueid'],queues[_0x5db67d[_0xcbff('0x66')]][_0xcbff('0x1e')],queues[_0x5db67d['transfertargetuniqueid']][_0xcbff('0xe')],queues[_0x5db67d[_0xcbff('0x66')]]['calleridnum'],queues[_0x5db67d[_0xcbff('0x66')]]['calleridname']));}else{utils['info'](util[_0xcbff('0x3')](_0xcbff('0x61'),_0x5db67d[_0xcbff('0x54')],queues[_0x5db67d[_0xcbff('0x57')]][_0xcbff('0x1e')],_0x5db67d[_0xcbff('0x55')]));queues[_0x5db67d['secondtransfererlinkedid']]['transfereduniqueid']=_0x5db67d[_0xcbff('0x55')];}}}}catch(_0x4d3f07){utils['error'](util[_0xcbff('0x3')]('[%s][queues][attendedtransfer]',_0x5db67d[_0xcbff('0x54')]),_0x4d3f07);}};exports[_0xcbff('0x68')]=function(_0x39a8ae){try{if(!_[_0xcbff('0x16')](queues[_0x39a8ae['uniqueid']])){utils[_0xcbff('0xf')](util['format']('[%s][queues][musiconholdstart]',_0x39a8ae['uniqueid']),_0x39a8ae);queues[_0x39a8ae[_0xcbff('0x11')]][_0xcbff('0x69')]=utils[_0xcbff('0x1a')]();utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x6a'),_0x39a8ae['uniqueid'],queues[_0x39a8ae[_0xcbff('0x11')]][_0xcbff('0x1e')],queues[_0x39a8ae[_0xcbff('0x11')]][_0xcbff('0x69')]));}}catch(_0x10d3e7){utils[_0xcbff('0x15')](util[_0xcbff('0x3')](_0xcbff('0x6b'),_0x39a8ae['uniqueid']),_0x10d3e7);}};exports['musiconholdstop']=function(_0x170fc6){try{if(!_[_0xcbff('0x16')](queues[_0x170fc6[_0xcbff('0x11')]])){if(!_[_0xcbff('0x16')](queues[_0x170fc6[_0xcbff('0x11')]][_0xcbff('0x69')])){utils[_0xcbff('0xf')](util[_0xcbff('0x3')](_0xcbff('0x6c'),_0x170fc6[_0xcbff('0x11')]),_0x170fc6);queues[_0x170fc6[_0xcbff('0x11')]][_0xcbff('0x5f')]+=utils[_0xcbff('0x38')](utils[_0xcbff('0x1a')](),queues[_0x170fc6[_0xcbff('0x11')]][_0xcbff('0x69')]);utils[_0xcbff('0x1c')](util[_0xcbff('0x3')](_0xcbff('0x6d'),_0x170fc6[_0xcbff('0x11')],queues[_0x170fc6['uniqueid']][_0xcbff('0x1e')],queues[_0x170fc6[_0xcbff('0x11')]][_0xcbff('0x5f')]));delete queues[_0x170fc6[_0xcbff('0x11')]]['musiconholdstartAt'];}}}catch(_0x4a9530){utils[_0xcbff('0x15')](util[_0xcbff('0x3')]('[%s][queues][musiconholdstop]',_0x170fc6[_0xcbff('0x11')]),_0x4a9530);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 28cd09f..89b43fa 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 _0x39c7=['[%s][recordings][varset]','value','endsWith','.wav49','replace','find','monitors','hangup','[%s][recordings][hangup]','calleridnum','calleridname','connectedlinenum','connectedlinename','forEach','clone','newexten','application','appdata','toLowerCase','set','startsWith','cdr','split','substring','queuecallerjoin','[%s][recordings][queuecallerjoin]','queue','blindtransfer','[%s][recordings][blindtransfer]','[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridnum','transfereecalleridnum','transfereecalleridname','transfereruniqueid','lodash','util','./transfers.controller','info','format','blinds','uniqueid','accountcode','getUserByInternal','then','membername','CreateVoiceRecording','request','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','error','newstate','[%s][recordings][newstate]','isNil','[%s][recordings][newstate]\x20context:%s\x20channel:%s','channelstate','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','channel','varset','variable'];(function(_0x1c20e8,_0x24de1e){var _0x197bb5=function(_0x2c332d){while(--_0x2c332d){_0x1c20e8['push'](_0x1c20e8['shift']());}};_0x197bb5(++_0x24de1e);}(_0x39c7,0xa4));var _0x739c=function(_0xfc957f,_0x2e353b){_0xfc957f=_0xfc957f-0x0;var _0x10a878=_0x39c7[_0xfc957f];return _0x10a878;};'use strict';var _=require(_0x739c('0x0'));var util=require(_0x739c('0x1'));var utils=require('./utils');var transfers=require(_0x739c('0x2'));var recordings={};function writeDB(_0x5a2892){var _0x110460;utils[_0x739c('0x3')](util[_0x739c('0x4')]('[%s][recordings][writeDB]',_0x5a2892['uniqueid']));if(transfers[_0x739c('0x5')][_0x5a2892[_0x739c('0x6')]]){_0x110460=_0x5a2892[_0x739c('0x6')];_0x5a2892[_0x739c('0x6')]=transfers[_0x739c('0x5')][_0x5a2892[_0x739c('0x6')]]['transfereeuniqueid'];}if(_0x5a2892[_0x739c('0x7')]){utils[_0x739c('0x8')](_0x5a2892[_0x739c('0x7')])[_0x739c('0x9')](function(_0x4d605e){if(_0x4d605e){_0x5a2892[_0x739c('0xa')]=_0x4d605e['name'];_0x5a2892['UserId']=_0x4d605e['id'];}utils['request'](_0x739c('0xb'),_0x5a2892);});}else{utils[_0x739c('0xc')](_0x739c('0xb'),_0x5a2892);}if(_0x110460)delete transfers[_0x739c('0x5')][_0x110460];}exports[_0x739c('0xd')]=function(_0x2fda8f){try{utils[_0x739c('0xe')](util['format'](_0x739c('0xf'),_0x2fda8f[_0x739c('0x6')]),_0x2fda8f);if(_0x2fda8f[_0x739c('0x6')]==_0x2fda8f[_0x739c('0x10')]){utils[_0x739c('0x3')](util[_0x739c('0x4')](_0x739c('0x11'),_0x2fda8f[_0x739c('0x6')],_0x2fda8f['context'],_0x2fda8f[_0x739c('0x12')]));recordings[_0x2fda8f['uniqueid']]={'uniqueid':_0x2fda8f['uniqueid'],'accountcode':_0x2fda8f[_0x739c('0x7')],'exten':_0x2fda8f[_0x739c('0x12')],'context':_0x2fda8f[_0x739c('0x13')],'channel':_0x2fda8f['channel'],'monitors':[]};}}catch(_0x285c07){utils[_0x739c('0x14')](util[_0x739c('0x4')](_0x739c('0xf'),_0x2fda8f['uniqueid']),_0x285c07);}};exports[_0x739c('0x15')]=function(_0x2895dd){try{utils[_0x739c('0xe')](util[_0x739c('0x4')](_0x739c('0x16'),_0x2895dd[_0x739c('0x6')]),_0x2895dd);if(!_[_0x739c('0x17')](recordings[_0x2895dd[_0x739c('0x6')]])&&_0x2895dd['channelstate']==0x6){utils[_0x739c('0x3')](util[_0x739c('0x4')](_0x739c('0x18'),_0x2895dd[_0x739c('0x6')],_0x2895dd[_0x739c('0x13')],_0x2895dd['channel']));}else if(!_[_0x739c('0x17')](recordings[_0x2895dd[_0x739c('0x10')]])&&_0x2895dd[_0x739c('0x19')]==0x6&&_0x2895dd['context']!=_0x739c('0x1a')){utils['info'](util[_0x739c('0x4')](_0x739c('0x1b'),_0x2895dd[_0x739c('0x6')],_0x2895dd[_0x739c('0x10')],_0x2895dd[_0x739c('0x13')],_0x2895dd[_0x739c('0x1c')]));recordings[_0x2895dd['linkedid']][_0x739c('0x7')]=_0x2895dd[_0x739c('0x7')];}}catch(_0x2e8ca1){utils[_0x739c('0x14')](util[_0x739c('0x4')]('[%s][recordings][newstate]',_0x2895dd[_0x739c('0x6')]),_0x2e8ca1);}};exports[_0x739c('0x1d')]=function(_0x25676e){try{if(!_[_0x739c('0x17')](_0x25676e[_0x739c('0x1e')])&&!_[_0x739c('0x17')](_0x25676e[_0x739c('0x1e')]['mixmonitor_filename'])){utils['debug'](util['format'](_0x739c('0x1f'),_0x25676e[_0x739c('0x6')]),_0x25676e);utils[_0x739c('0x3')](util[_0x739c('0x4')]('[%s][recordings][varset]\x20variable:%s\x20value:%s',_0x25676e['uniqueid'],_0x25676e[_0x739c('0x1e')],_0x25676e[_0x739c('0x20')]));if(_[_0x739c('0x21')](_0x25676e[_0x739c('0x20')],_0x739c('0x22'))){_0x25676e['value']=_0x25676e[_0x739c('0x20')][_0x739c('0x23')](_0x739c('0x22'),'.WAV');}if(recordings[_0x25676e[_0x739c('0x10')]]){var _0x310e64=_[_0x739c('0x24')](recordings[_0x25676e['linkedid']][_0x739c('0x25')],{'value':_0x25676e[_0x739c('0x20')]});if(_[_0x739c('0x17')](_0x310e64)){recordings[_0x25676e[_0x739c('0x10')]]['monitors']['push']({'value':_0x25676e[_0x739c('0x20')]});}}}}catch(_0x596aef){utils['error'](util[_0x739c('0x4')](_0x739c('0x1f'),_0x25676e[_0x739c('0x6')]),_0x596aef);}};exports[_0x739c('0x26')]=function(_0x1a3362){try{if(!_['isNil'](recordings[_0x1a3362[_0x739c('0x6')]])){utils[_0x739c('0xe')](util[_0x739c('0x4')](_0x739c('0x27'),_0x1a3362[_0x739c('0x6')]),_0x1a3362);utils[_0x739c('0x3')](util[_0x739c('0x4')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x1a3362[_0x739c('0x6')],_0x1a3362[_0x739c('0x28')],_0x1a3362['calleridname'],_0x1a3362['cause-txt']));recordings[_0x1a3362[_0x739c('0x6')]]['calleridnum']=_0x1a3362[_0x739c('0x28')];recordings[_0x1a3362[_0x739c('0x6')]][_0x739c('0x29')]=_0x1a3362[_0x739c('0x29')];recordings[_0x1a3362['uniqueid']]['connectedlinenum']=_0x1a3362[_0x739c('0x2a')];recordings[_0x1a3362[_0x739c('0x6')]][_0x739c('0x2b')]=_0x1a3362[_0x739c('0x2b')];if(recordings[_0x1a3362[_0x739c('0x6')]]['type']=='outbound'&&recordings[_0x1a3362[_0x739c('0x6')]]['accountcode']){recordings[_0x1a3362['uniqueid']]['connectedlinenum']=recordings[_0x1a3362['uniqueid']][_0x739c('0x7')];recordings[_0x1a3362[_0x739c('0x6')]][_0x739c('0x2b')]='';}recordings[_0x1a3362['uniqueid']]['monitors'][_0x739c('0x2c')](function(_0x160173){var _0x5201ba=_[_0x739c('0x2d')](recordings[_0x1a3362[_0x739c('0x6')]]);_0x5201ba[_0x739c('0x20')]=_0x160173[_0x739c('0x20')];writeDB(_0x5201ba);});delete recordings[_0x1a3362['uniqueid']];}}catch(_0x5dc0f8){utils[_0x739c('0x14')](util[_0x739c('0x4')](_0x739c('0x27'),_0x1a3362[_0x739c('0x6')]),_0x5dc0f8);}};exports[_0x739c('0x2e')]=function(_0x5331e4){try{if(!_[_0x739c('0x17')](recordings[_0x5331e4[_0x739c('0x6')]])){utils[_0x739c('0xe')](util[_0x739c('0x4')]('[%s][recordings][newexten]',_0x5331e4[_0x739c('0x6')]),_0x5331e4);utils[_0x739c('0x3')](util['format']('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x5331e4[_0x739c('0x6')],_0x5331e4[_0x739c('0x2f')],_0x5331e4[_0x739c('0x30')]));if(_0x5331e4[_0x739c('0x2f')][_0x739c('0x31')]()==_0x739c('0x32')&&_[_0x739c('0x33')](_0x5331e4[_0x739c('0x30')][_0x739c('0x31')](),_0x739c('0x34'))){var _0x177282=_0x5331e4[_0x739c('0x30')][_0x739c('0x35')]('=');var _0x34f8ed=_0x177282[0x0][_0x739c('0x36')](_0x177282[0x0]['lastIndexOf']('(')+0x1,_0x177282[0x0]['lastIndexOf'](')'));var _0x36e369=_0x177282[0x1];recordings[_0x5331e4[_0x739c('0x6')]][_0x34f8ed]=_0x36e369;}}}catch(_0x599918){utils[_0x739c('0x14')](util[_0x739c('0x4')]('[%s][recordings][newexten]',_0x5331e4[_0x739c('0x6')]),_0x599918);}};exports[_0x739c('0x37')]=function(_0x4818de){try{if(!_['isNil'](recordings[_0x4818de[_0x739c('0x6')]])){utils[_0x739c('0xe')](util[_0x739c('0x4')](_0x739c('0x38'),_0x4818de[_0x739c('0x6')]),_0x4818de);utils[_0x739c('0x3')](util[_0x739c('0x4')]('[%s][recordings][queuecallerjoin]\x20queue:%s',_0x4818de[_0x739c('0x6')],_0x4818de[_0x739c('0x39')]));recordings[_0x4818de[_0x739c('0x6')]][_0x739c('0x39')]=_0x4818de[_0x739c('0x39')];}}catch(_0x5e7e3a){utils[_0x739c('0x14')](util[_0x739c('0x4')](_0x739c('0x38'),_0x4818de[_0x739c('0x6')]),_0x5e7e3a);}};exports[_0x739c('0x3a')]=function(_0x29e76b){try{utils[_0x739c('0xe')](util[_0x739c('0x4')](_0x739c('0x3b'),_0x29e76b['uniqueid']),_0x29e76b);utils[_0x739c('0x3')](util['format'](_0x739c('0x3c'),_0x29e76b['uniqueid'],_0x29e76b[_0x739c('0x3d')],_0x29e76b['transferercalleridname'],_0x29e76b[_0x739c('0x3e')],_0x29e76b[_0x739c('0x3f')]));if(recordings[_0x29e76b[_0x739c('0x40')]]&&transfers[_0x739c('0x5')][_0x29e76b[_0x739c('0x40')]]){transfers[_0x739c('0x5')][_0x29e76b[_0x739c('0x40')]]['recording']=!![];}}catch(_0x47d2b1){utils[_0x739c('0x14')](util[_0x739c('0x4')](_0x739c('0x3b'),_0x29e76b['uniqueid']),_0x47d2b1);}}; \ No newline at end of file +var _0x30b8=['set','startsWith','cdr','split','lastIndexOf','queuecallerjoin','[%s][recordings][queuecallerjoin]','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','blindtransfer','[%s][recordings][blindtransfer]','transferercalleridnum','transfereecalleridnum','transfereruniqueid','recording','lodash','util','./utils','./transfers.controller','info','format','[%s][recordings][writeDB]','blinds','uniqueid','transfereeuniqueid','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','[%s][recordings][newstate]','isNil','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','varset','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','value','endsWith','replace','.WAV','find','monitors','push','[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s','calleridnum','cause-txt','calleridname','connectedlinenum','type','connectedlinename','forEach','clone','[%s][recordings][hangup]','[%s][recordings][newexten]','appdata','toLowerCase'];(function(_0x8d49fa,_0x48ed58){var _0x2d5570=function(_0x9738a4){while(--_0x9738a4){_0x8d49fa['push'](_0x8d49fa['shift']());}};_0x2d5570(++_0x48ed58);}(_0x30b8,0x177));var _0x830b=function(_0x2d11d3,_0xe8503){_0x2d11d3=_0x2d11d3-0x0;var _0x39693d=_0x30b8[_0x2d11d3];return _0x39693d;};'use strict';var _=require(_0x830b('0x0'));var util=require(_0x830b('0x1'));var utils=require(_0x830b('0x2'));var transfers=require(_0x830b('0x3'));var recordings={};function writeDB(_0x47d62d){var _0xaaee0;utils[_0x830b('0x4')](util[_0x830b('0x5')](_0x830b('0x6'),_0x47d62d['uniqueid']));if(transfers[_0x830b('0x7')][_0x47d62d[_0x830b('0x8')]]){_0xaaee0=_0x47d62d[_0x830b('0x8')];_0x47d62d[_0x830b('0x8')]=transfers[_0x830b('0x7')][_0x47d62d[_0x830b('0x8')]][_0x830b('0x9')];}if(_0x47d62d[_0x830b('0xa')]){utils[_0x830b('0xb')](_0x47d62d[_0x830b('0xa')])[_0x830b('0xc')](function(_0x2ef90d){if(_0x2ef90d){_0x47d62d[_0x830b('0xd')]=_0x2ef90d[_0x830b('0xe')];_0x47d62d[_0x830b('0xf')]=_0x2ef90d['id'];}utils[_0x830b('0x10')](_0x830b('0x11'),_0x47d62d);});}else{utils[_0x830b('0x10')](_0x830b('0x11'),_0x47d62d);}if(_0xaaee0)delete transfers[_0x830b('0x7')][_0xaaee0];}exports[_0x830b('0x12')]=function(_0x2c707e){try{utils[_0x830b('0x13')](util[_0x830b('0x5')](_0x830b('0x14'),_0x2c707e[_0x830b('0x8')]),_0x2c707e);if(_0x2c707e[_0x830b('0x8')]==_0x2c707e[_0x830b('0x15')]){utils[_0x830b('0x4')](util['format'](_0x830b('0x16'),_0x2c707e[_0x830b('0x8')],_0x2c707e[_0x830b('0x17')],_0x2c707e[_0x830b('0x18')]));recordings[_0x2c707e[_0x830b('0x8')]]={'uniqueid':_0x2c707e['uniqueid'],'accountcode':_0x2c707e[_0x830b('0xa')],'exten':_0x2c707e['exten'],'context':_0x2c707e[_0x830b('0x17')],'channel':_0x2c707e[_0x830b('0x19')],'monitors':[]};}}catch(_0x3087ec){utils[_0x830b('0x1a')](util[_0x830b('0x5')](_0x830b('0x14'),_0x2c707e[_0x830b('0x8')]),_0x3087ec);}};exports['newstate']=function(_0x51e84a){try{utils[_0x830b('0x13')](util[_0x830b('0x5')](_0x830b('0x1b'),_0x51e84a['uniqueid']),_0x51e84a);if(!_[_0x830b('0x1c')](recordings[_0x51e84a[_0x830b('0x8')]])&&_0x51e84a[_0x830b('0x1d')]==0x6){utils['info'](util[_0x830b('0x5')](_0x830b('0x1e'),_0x51e84a[_0x830b('0x8')],_0x51e84a[_0x830b('0x17')],_0x51e84a[_0x830b('0x19')]));}else if(!_[_0x830b('0x1c')](recordings[_0x51e84a[_0x830b('0x15')]])&&_0x51e84a['channelstate']==0x6&&_0x51e84a['context']!='transfer'){utils[_0x830b('0x4')](util[_0x830b('0x5')](_0x830b('0x1f'),_0x51e84a['uniqueid'],_0x51e84a['linkedid'],_0x51e84a[_0x830b('0x17')],_0x51e84a['channel']));recordings[_0x51e84a[_0x830b('0x15')]][_0x830b('0xa')]=_0x51e84a[_0x830b('0xa')];}}catch(_0xb69b72){utils['error'](util[_0x830b('0x5')](_0x830b('0x1b'),_0x51e84a[_0x830b('0x8')]),_0xb69b72);}};exports[_0x830b('0x20')]=function(_0x9d72d8){try{if(!_['isNil'](_0x9d72d8[_0x830b('0x21')])&&!_['isNil'](_0x9d72d8[_0x830b('0x21')][_0x830b('0x22')])){utils['debug'](util[_0x830b('0x5')](_0x830b('0x23'),_0x9d72d8[_0x830b('0x8')]),_0x9d72d8);utils[_0x830b('0x4')](util[_0x830b('0x5')](_0x830b('0x24'),_0x9d72d8[_0x830b('0x8')],_0x9d72d8[_0x830b('0x21')],_0x9d72d8[_0x830b('0x25')]));if(_[_0x830b('0x26')](_0x9d72d8[_0x830b('0x25')],'.wav49')){_0x9d72d8[_0x830b('0x25')]=_0x9d72d8[_0x830b('0x25')][_0x830b('0x27')]('.wav49',_0x830b('0x28'));}if(recordings[_0x9d72d8['linkedid']]){var _0x4a6020=_[_0x830b('0x29')](recordings[_0x9d72d8[_0x830b('0x15')]][_0x830b('0x2a')],{'value':_0x9d72d8[_0x830b('0x25')]});if(_[_0x830b('0x1c')](_0x4a6020)){recordings[_0x9d72d8[_0x830b('0x15')]]['monitors'][_0x830b('0x2b')]({'value':_0x9d72d8[_0x830b('0x25')]});}}}}catch(_0x22799f){utils[_0x830b('0x1a')](util['format'](_0x830b('0x23'),_0x9d72d8['uniqueid']),_0x22799f);}};exports['hangup']=function(_0x3b7004){try{if(!_[_0x830b('0x1c')](recordings[_0x3b7004['uniqueid']])){utils[_0x830b('0x13')](util['format']('[%s][recordings][hangup]',_0x3b7004[_0x830b('0x8')]),_0x3b7004);utils[_0x830b('0x4')](util['format'](_0x830b('0x2c'),_0x3b7004['uniqueid'],_0x3b7004[_0x830b('0x2d')],_0x3b7004['calleridname'],_0x3b7004[_0x830b('0x2e')]));recordings[_0x3b7004[_0x830b('0x8')]]['calleridnum']=_0x3b7004[_0x830b('0x2d')];recordings[_0x3b7004[_0x830b('0x8')]]['calleridname']=_0x3b7004[_0x830b('0x2f')];recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0x30')]=_0x3b7004[_0x830b('0x30')];recordings[_0x3b7004[_0x830b('0x8')]]['connectedlinename']=_0x3b7004['connectedlinename'];if(recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0x31')]=='outbound'&&recordings[_0x3b7004['uniqueid']]['accountcode']){recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0x30')]=recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0xa')];recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0x32')]='';}recordings[_0x3b7004[_0x830b('0x8')]][_0x830b('0x2a')][_0x830b('0x33')](function(_0x156b91){var _0x204f49=_[_0x830b('0x34')](recordings[_0x3b7004['uniqueid']]);_0x204f49[_0x830b('0x25')]=_0x156b91[_0x830b('0x25')];writeDB(_0x204f49);});delete recordings[_0x3b7004[_0x830b('0x8')]];}}catch(_0x3429f8){utils[_0x830b('0x1a')](util[_0x830b('0x5')](_0x830b('0x35'),_0x3b7004[_0x830b('0x8')]),_0x3429f8);}};exports['newexten']=function(_0x4a7303){try{if(!_['isNil'](recordings[_0x4a7303[_0x830b('0x8')]])){utils[_0x830b('0x13')](util['format'](_0x830b('0x36'),_0x4a7303[_0x830b('0x8')]),_0x4a7303);utils['info'](util[_0x830b('0x5')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x4a7303[_0x830b('0x8')],_0x4a7303['application'],_0x4a7303[_0x830b('0x37')]));if(_0x4a7303['application'][_0x830b('0x38')]()==_0x830b('0x39')&&_[_0x830b('0x3a')](_0x4a7303['appdata']['toLowerCase'](),_0x830b('0x3b'))){var _0xa9e63e=_0x4a7303['appdata'][_0x830b('0x3c')]('=');var _0x18c9c3=_0xa9e63e[0x0]['substring'](_0xa9e63e[0x0]['lastIndexOf']('(')+0x1,_0xa9e63e[0x0][_0x830b('0x3d')](')'));var _0x20d6ab=_0xa9e63e[0x1];recordings[_0x4a7303[_0x830b('0x8')]][_0x18c9c3]=_0x20d6ab;}}}catch(_0x304111){utils[_0x830b('0x1a')](util[_0x830b('0x5')](_0x830b('0x36'),_0x4a7303['uniqueid']),_0x304111);}};exports[_0x830b('0x3e')]=function(_0x58ec90){try{if(!_['isNil'](recordings[_0x58ec90[_0x830b('0x8')]])){utils[_0x830b('0x13')](util[_0x830b('0x5')](_0x830b('0x3f'),_0x58ec90[_0x830b('0x8')]),_0x58ec90);utils[_0x830b('0x4')](util[_0x830b('0x5')](_0x830b('0x40'),_0x58ec90['uniqueid'],_0x58ec90[_0x830b('0x41')]));recordings[_0x58ec90[_0x830b('0x8')]][_0x830b('0x41')]=_0x58ec90[_0x830b('0x41')];}}catch(_0x3d7b38){utils['error'](util['format'](_0x830b('0x3f'),_0x58ec90[_0x830b('0x8')]),_0x3d7b38);}};exports[_0x830b('0x42')]=function(_0x442965){try{utils[_0x830b('0x13')](util['format'](_0x830b('0x43'),_0x442965[_0x830b('0x8')]),_0x442965);utils[_0x830b('0x4')](util['format']('[%s][recordings][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x442965[_0x830b('0x8')],_0x442965[_0x830b('0x44')],_0x442965['transferercalleridname'],_0x442965[_0x830b('0x45')],_0x442965['transfereecalleridname']));if(recordings[_0x442965[_0x830b('0x46')]]&&transfers['blinds'][_0x442965[_0x830b('0x46')]]){transfers[_0x830b('0x7')][_0x442965['transfereruniqueid']][_0x830b('0x47')]=!![];}}catch(_0x3dc023){utils[_0x830b('0x1a')](util[_0x830b('0x5')](_0x830b('0x43'),_0x442965[_0x830b('0x8')]),_0x3dc023);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 52e1271..db98f47 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 _0x917c=['uniqueid','type','CreateVoiceTransferReport','blinds','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridname','transfereruniqueid','origtransfereruniqueid','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridname','assign','origtransfererchannel','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','error','[%s][transfers][attendedtransfer]','util','./utils','info','format','attended'];(function(_0x121662,_0x5cd2ec){var _0x36e1cc=function(_0x5dc95e){while(--_0x5dc95e){_0x121662['push'](_0x121662['shift']());}};_0x36e1cc(++_0x5cd2ec);}(_0x917c,0x181));var _0xc917=function(_0x378ebe,_0x549e4c){_0x378ebe=_0x378ebe-0x0;var _0x8279f3=_0x917c[_0x378ebe];return _0x8279f3;};'use strict';var _=require('lodash');var util=require(_0xc917('0x0'));var utils=require(_0xc917('0x1'));function writeDB(_0x18aca5){utils[_0xc917('0x2')](util[_0xc917('0x3')]('[%s][transfers][writeDB]\x20type:%s',_0x18aca5['type']===_0xc917('0x4')?_0x18aca5['origtransfereruniqueid']:_0x18aca5[_0xc917('0x5')],_0x18aca5[_0xc917('0x6')]));utils['request'](_0xc917('0x7'),_0x18aca5);}exports[_0xc917('0x8')]={};exports[_0xc917('0x9')]=function(_0x1d9581){try{utils[_0xc917('0xa')](util['format'](_0xc917('0xb'),_0x1d9581[_0xc917('0x5')]),_0x1d9581);utils[_0xc917('0x2')](util[_0xc917('0x3')](_0xc917('0xc'),_0x1d9581[_0xc917('0x5')],_0x1d9581['transferercalleridnum'],_0x1d9581[_0xc917('0xd')],_0x1d9581['transfereecalleridnum'],_0x1d9581[_0xc917('0xe')]));_0x1d9581[_0xc917('0x6')]='blind';exports[_0xc917('0x8')][_0x1d9581[_0xc917('0xf')]]=_0x1d9581;writeDB(_0x1d9581);}catch(_0xb5f40a){utils['error'](util['format']('[%s][transfers][blindtransfer]',_0x1d9581[_0xc917('0x5')]),_0xb5f40a);}};exports['attendedtransfer']=function(_0x162efb){try{utils['debug'](util[_0xc917('0x3')]('[%s][transfers][attendedtransfer]',_0x162efb[_0xc917('0x10')]),_0x162efb);utils['info'](util[_0xc917('0x3')]('[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s',_0x162efb[_0xc917('0x10')],_0x162efb[_0xc917('0x11')],_0x162efb[_0xc917('0x12')],_0x162efb['transfertargetcalleridnum'],_0x162efb[_0xc917('0x13')]));_0x162efb=_[_0xc917('0x14')](_0x162efb,{'transfererchannel':_0x162efb[_0xc917('0x15')],'transferercalleridnum':_0x162efb[_0xc917('0x11')],'transferercalleridname':_0x162efb['origtransferercalleridname'],'transfererconnectedlinenum':_0x162efb[_0xc917('0x16')],'transfererconnectedlinename':_0x162efb['secondtransfererconnectedlinename'],'transfereraccountcode':_0x162efb[_0xc917('0x17')],'transferercontext':_0x162efb[_0xc917('0x18')],'transfererexten':_0x162efb['secondtransfererexten'],'transfererlinkedid':_0x162efb[_0xc917('0x19')],'context':_0x162efb[_0xc917('0x1a')],'extension':_0x162efb[_0xc917('0x1b')],'type':_0xc917('0x4')});if(_[_0xc917('0x1c')](_0x162efb[_0xc917('0x1d')])){_0x162efb=_['assign'](_0x162efb,{'transfereechannel':_0x162efb[_0xc917('0x1e')],'transfereecalleridnum':_0x162efb['transfertargetcalleridnum'],'transfereecalleridname':_0x162efb[_0xc917('0x13')],'transfereeconnectedlinenum':_0x162efb[_0xc917('0x1f')],'transfereeconnectedlinename':_0x162efb[_0xc917('0x20')],'transfereeaccountcode':_0x162efb[_0xc917('0x21')],'transfereecontext':_0x162efb[_0xc917('0x22')],'transfereeexten':_0x162efb[_0xc917('0x23')],'transfereelinkedid':_0x162efb[_0xc917('0x24')]});}writeDB(_0x162efb);}catch(_0x16e693){utils[_0xc917('0x25')](util[_0xc917('0x3')](_0xc917('0x26'),_0x162efb[_0xc917('0x10')]),_0x16e693);}}; \ No newline at end of file +var _0xb5e5=['[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','origtransfererchannel','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetexten','transfertargetlinkedid','lodash','util','./utils','info','format','type','attended','origtransfereruniqueid','uniqueid','request','CreateVoiceTransferReport','blinds','blindtransfer','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','transferercalleridname','transfereecalleridnum','transfereecalleridname','error','attendedtransfer','debug'];(function(_0x41e0a4,_0x5f837d){var _0x4ea78e=function(_0x5259e5){while(--_0x5259e5){_0x41e0a4['push'](_0x41e0a4['shift']());}};_0x4ea78e(++_0x5f837d);}(_0xb5e5,0x185));var _0x5b5e=function(_0x2f05d2,_0x1bd370){_0x2f05d2=_0x2f05d2-0x0;var _0x3ec546=_0xb5e5[_0x2f05d2];return _0x3ec546;};'use strict';var _=require(_0x5b5e('0x0'));var util=require(_0x5b5e('0x1'));var utils=require(_0x5b5e('0x2'));function writeDB(_0x1bf2d6){utils[_0x5b5e('0x3')](util[_0x5b5e('0x4')]('[%s][transfers][writeDB]\x20type:%s',_0x1bf2d6[_0x5b5e('0x5')]===_0x5b5e('0x6')?_0x1bf2d6[_0x5b5e('0x7')]:_0x1bf2d6[_0x5b5e('0x8')],_0x1bf2d6[_0x5b5e('0x5')]));utils[_0x5b5e('0x9')](_0x5b5e('0xa'),_0x1bf2d6);}exports[_0x5b5e('0xb')]={};exports[_0x5b5e('0xc')]=function(_0x15b215){try{utils['debug'](util[_0x5b5e('0x4')](_0x5b5e('0xd'),_0x15b215[_0x5b5e('0x8')]),_0x15b215);utils[_0x5b5e('0x3')](util['format'](_0x5b5e('0xe'),_0x15b215[_0x5b5e('0x8')],_0x15b215['transferercalleridnum'],_0x15b215[_0x5b5e('0xf')],_0x15b215[_0x5b5e('0x10')],_0x15b215[_0x5b5e('0x11')]));_0x15b215[_0x5b5e('0x5')]='blind';exports[_0x5b5e('0xb')][_0x15b215['transfereruniqueid']]=_0x15b215;writeDB(_0x15b215);}catch(_0x35cbb1){utils[_0x5b5e('0x12')](util[_0x5b5e('0x4')](_0x5b5e('0xd'),_0x15b215[_0x5b5e('0x8')]),_0x35cbb1);}};exports[_0x5b5e('0x13')]=function(_0x60c37c){try{utils[_0x5b5e('0x14')](util['format'](_0x5b5e('0x15'),_0x60c37c[_0x5b5e('0x7')]),_0x60c37c);utils[_0x5b5e('0x3')](util[_0x5b5e('0x4')](_0x5b5e('0x16'),_0x60c37c[_0x5b5e('0x7')],_0x60c37c[_0x5b5e('0x17')],_0x60c37c[_0x5b5e('0x18')],_0x60c37c[_0x5b5e('0x19')],_0x60c37c['transfertargetcalleridname']));_0x60c37c=_['assign'](_0x60c37c,{'transfererchannel':_0x60c37c[_0x5b5e('0x1a')],'transferercalleridnum':_0x60c37c[_0x5b5e('0x17')],'transferercalleridname':_0x60c37c[_0x5b5e('0x18')],'transfererconnectedlinenum':_0x60c37c['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x60c37c[_0x5b5e('0x1b')],'transfereraccountcode':_0x60c37c[_0x5b5e('0x1c')],'transferercontext':_0x60c37c[_0x5b5e('0x1d')],'transfererexten':_0x60c37c[_0x5b5e('0x1e')],'transfererlinkedid':_0x60c37c[_0x5b5e('0x1f')],'context':_0x60c37c[_0x5b5e('0x20')],'extension':_0x60c37c[_0x5b5e('0x21')],'type':_0x5b5e('0x6')});if(_[_0x5b5e('0x22')](_0x60c37c['transfereechannel'])){_0x60c37c=_['assign'](_0x60c37c,{'transfereechannel':_0x60c37c[_0x5b5e('0x23')],'transfereecalleridnum':_0x60c37c[_0x5b5e('0x19')],'transfereecalleridname':_0x60c37c[_0x5b5e('0x24')],'transfereeconnectedlinenum':_0x60c37c[_0x5b5e('0x25')],'transfereeconnectedlinename':_0x60c37c[_0x5b5e('0x26')],'transfereeaccountcode':_0x60c37c['transfertargetaccountcode'],'transfereecontext':_0x60c37c['transfertargetcontext'],'transfereeexten':_0x60c37c[_0x5b5e('0x27')],'transfereelinkedid':_0x60c37c[_0x5b5e('0x28')]});}writeDB(_0x60c37c);}catch(_0x17bf07){utils['error'](util[_0x5b5e('0x4')](_0x5b5e('0x15'),_0x60c37c[_0x5b5e('0x7')]),_0x17bf07);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index ffaf5a1..6c8b0d8 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 _0x1b7b=['diffTime','sumTime','now','isAfter','isBefore','bluebird','jayson/promise','moment','util','http','../../config/logger','xdr','info','debug','inspect','request','then','[utils][request]\x20name:%s','catch','error','internal','name','interface','[utils][getUser]\x20where:%s','stringify','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s\x20%s','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract'];(function(_0x3725ca,_0x442459){var _0x18fda5=function(_0x50ad81){while(--_0x50ad81){_0x3725ca['push'](_0x3725ca['shift']());}};_0x18fda5(++_0x442459);}(_0x1b7b,0x104));var _0xb1b7=function(_0x26381a,_0x2b64cb){_0x26381a=_0x26381a-0x0;var _0x4ef9c2=_0x1b7b[_0x26381a];return _0x4ef9c2;};'use strict';var BPromise=require(_0xb1b7('0x0'));var jayson=require(_0xb1b7('0x1'));var moment=require(_0xb1b7('0x2'));var util=require(_0xb1b7('0x3'));var client=jayson['client'][_0xb1b7('0x4')]({'port':0x2329});var logger=require(_0xb1b7('0x5'))(_0xb1b7('0x6'));exports[_0xb1b7('0x7')]=function(_0x460875,_0x48c931){logger[_0xb1b7('0x7')](_0x460875,_0x48c931?util['inspect'](_0x48c931,{'showHidden':![],'depth':null}):'');};exports[_0xb1b7('0x8')]=function(_0x5ce574,_0x365a0e){logger['debug'](_0x5ce574,_0x365a0e?util[_0xb1b7('0x9')](_0x365a0e,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x4d10cf,_0x8456f2){logger['error'](_0x4d10cf,_0x8456f2?util[_0xb1b7('0x9')](_0x8456f2,{'showHidden':![],'depth':null}):'');};exports['request']=function(_0x4788f8,_0xcc6f6d){return client[_0xb1b7('0xa')](_0x4788f8,{'body':_0xcc6f6d})[_0xb1b7('0xb')](function(_0x3354d5){logger[_0xb1b7('0x8')](_0xb1b7('0xc'),_0x4788f8,_0x3354d5?util['inspect'](_0x3354d5,{'showHidden':![],'depth':null}):'');})[_0xb1b7('0xd')](function(_0x36be2e){logger[_0xb1b7('0xe')]('[utils][request]\x20name:%s',_0x4788f8,_0x36be2e?util[_0xb1b7('0x9')](_0x36be2e,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2faf64){return client[_0xb1b7('0xa')]('GetUser',{'options':{'raw':!![],'attributes':['id',_0xb1b7('0xf'),_0xb1b7('0x10'),_0xb1b7('0x11')],'where':_0x2faf64,'limit':0x1}})[_0xb1b7('0xb')](function(_0x34f4b7){logger[_0xb1b7('0x8')](_0xb1b7('0x12'),JSON[_0xb1b7('0x13')](_0x2faf64),_0x34f4b7?util[_0xb1b7('0x9')](_0x34f4b7,{'showHidden':![],'depth':null}):'');return _0x34f4b7[_0xb1b7('0x14')][_0xb1b7('0x15')]?_0x34f4b7[_0xb1b7('0x14')][0x0]:null;});}exports[_0xb1b7('0x16')]=function(_0x4761e3){return new BPromise(function(_0x27b30b,_0x2d724b){if(_0x4761e3){return getUser({'internal':_0x4761e3})[_0xb1b7('0xb')](function(_0x136648){logger[_0xb1b7('0x7')](_0xb1b7('0x17'),_0x4761e3,_0x136648?_0xb1b7('0x18'):_0xb1b7('0x19'));return _0x27b30b(_0x136648);})[_0xb1b7('0xd')](function(_0x1f3bfc){logger['error'](_0xb1b7('0x1a'),_0x1f3bfc?util[_0xb1b7('0x9')](_0x1f3bfc,{'showHidden':![],'depth':null}):'');return _0x27b30b(null);});}return _0x27b30b(null);});};exports[_0xb1b7('0x1b')]=function(_0x21943b){return new BPromise(function(_0x31e7d0,_0x2f0cb3){if(_0x21943b){return getUser({'interface':_0x21943b})['then'](function(_0x4a7e7e){logger[_0xb1b7('0x7')](_0xb1b7('0x1c'),_0x21943b,_0x4a7e7e?_0xb1b7('0x18'):'notfound');return _0x31e7d0(_0x4a7e7e);})[_0xb1b7('0xd')](function(_0x18f50b){logger[_0xb1b7('0xe')](_0xb1b7('0x1d'),_0x18f50b?util[_0xb1b7('0x9')](_0x18f50b,{'showHidden':![],'depth':null}):'');return _0x31e7d0(null);});}return _0x31e7d0(null);});};exports[_0xb1b7('0x1e')]=function(_0x46dde8){return new BPromise(function(_0x491aea,_0x11454c){if(_0x46dde8){return getUser({'name':_0x46dde8})[_0xb1b7('0xb')](function(_0x171462){logger['info'](_0xb1b7('0x1f'),_0x46dde8,_0x171462?_0xb1b7('0x18'):'notfound');return _0x491aea(_0x171462);})[_0xb1b7('0xd')](function(_0x5a8d67){logger[_0xb1b7('0xe')](_0xb1b7('0x20'),_0x5a8d67?util['inspect'](_0x5a8d67,{'showHidden':![],'depth':null}):'');return _0x491aea(null);});}return _0x491aea(null);});};exports[_0xb1b7('0x21')]=function(_0x2e7db0){return new BPromise(function(_0x18a79a,_0x560df9){if(_0x2e7db0){return client[_0xb1b7('0xa')](_0xb1b7('0x22'),{'options':{'raw':!![],'attributes':['id',_0xb1b7('0x10'),_0xb1b7('0x23'),_0xb1b7('0x24'),_0xb1b7('0x25')],'where':{'name':_0x2e7db0},'limit':0x1}})[_0xb1b7('0xb')](function(_0x4cdc0f){logger['debug']('[utils][getVoiceQueueByName]\x20name:%s',_0x2e7db0,_0x4cdc0f?util[_0xb1b7('0x9')](_0x4cdc0f,{'showHidden':![],'depth':null}):'');logger[_0xb1b7('0x7')](_0xb1b7('0x26'),_0x2e7db0,_0x4cdc0f?'found':_0xb1b7('0x19'));return _0x18a79a(_0x4cdc0f[_0xb1b7('0x14')][_0xb1b7('0x15')]?_0x4cdc0f[_0xb1b7('0x14')][0x0]:null);})[_0xb1b7('0xd')](function(_0x5b18fb){logger[_0xb1b7('0xe')]('[utils][getVoiceQueueByName]',_0x5b18fb?util['inspect'](_0x5b18fb,{'showHidden':![],'depth':null}):'');return _0x18a79a(null);});}return _0x18a79a(null);});};exports[_0xb1b7('0x27')]=function(_0x2a23c9,_0x282f06){return moment(_0x2a23c9)[_0xb1b7('0x28')](_0x282f06,_0xb1b7('0x29'))[_0xb1b7('0x2a')](_0xb1b7('0x2b'));};exports[_0xb1b7('0x2c')]=function(_0x108d42,_0x29fc31){return moment(_0x108d42)[_0xb1b7('0x2d')](_0x29fc31,_0xb1b7('0x29'))[_0xb1b7('0x2a')](_0xb1b7('0x2b'));};exports[_0xb1b7('0x2e')]=function(_0x5b9602,_0x4ca9f4){return moment(_0x5b9602)['diff'](moment(_0x4ca9f4),_0xb1b7('0x29'));};exports[_0xb1b7('0x2f')]=function(_0x5696f2,_0x205791){return parseInt(_0x5696f2,0xa)+parseInt(_0x205791,0xa);};exports[_0xb1b7('0x30')]=function(){return moment()[_0xb1b7('0x2a')](_0xb1b7('0x2b'));};exports['isAfter']=function(_0x42d384,_0x133b74){if(_0x133b74){return moment(_0x42d384)[_0xb1b7('0x31')](_0x133b74);}return!![];};exports['isBefore']=function(_0x27f2c5,_0x351059){if(_0x351059){return moment(_0x27f2c5)[_0xb1b7('0x32')](_0x351059);}else if(_0x27f2c5){return!![];}return![];}; \ No newline at end of file +var _0x36e2=['subtract','now','isAfter','isBefore','bluebird','moment','util','../../config/logger','xdr','info','inspect','error','request','then','debug','[utils][request]\x20name:%s','catch','GetUser','internal','interface','[utils][getUser]\x20where:%s','result','found','notfound','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','addTime','add','seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime'];(function(_0x3adb8e,_0x247ca2){var _0x3eacdb=function(_0x127ddf){while(--_0x127ddf){_0x3adb8e['push'](_0x3adb8e['shift']());}};_0x3eacdb(++_0x247ca2);}(_0x36e2,0x1f3));var _0x236e=function(_0x237173,_0x57412c){_0x237173=_0x237173-0x0;var _0x424ef1=_0x36e2[_0x237173];return _0x424ef1;};'use strict';var BPromise=require(_0x236e('0x0'));var jayson=require('jayson/promise');var moment=require(_0x236e('0x1'));var util=require(_0x236e('0x2'));var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x236e('0x3'))(_0x236e('0x4'));exports[_0x236e('0x5')]=function(_0x268c4a,_0x176dbc){logger[_0x236e('0x5')](_0x268c4a,_0x176dbc?util[_0x236e('0x6')](_0x176dbc,{'showHidden':![],'depth':null}):'');};exports['debug']=function(_0x30a386,_0x58d1df){logger['debug'](_0x30a386,_0x58d1df?util[_0x236e('0x6')](_0x58d1df,{'showHidden':![],'depth':null}):'');};exports[_0x236e('0x7')]=function(_0x57e8e2,_0xe029fa){logger[_0x236e('0x7')](_0x57e8e2,_0xe029fa?util[_0x236e('0x6')](_0xe029fa,{'showHidden':![],'depth':null}):'');};exports[_0x236e('0x8')]=function(_0x355a90,_0x62c85f){return client[_0x236e('0x8')](_0x355a90,{'body':_0x62c85f})[_0x236e('0x9')](function(_0x52d5c5){logger[_0x236e('0xa')](_0x236e('0xb'),_0x355a90,_0x52d5c5?util[_0x236e('0x6')](_0x52d5c5,{'showHidden':![],'depth':null}):'');})[_0x236e('0xc')](function(_0x2329af){logger[_0x236e('0x7')](_0x236e('0xb'),_0x355a90,_0x2329af?util['inspect'](_0x2329af,{'showHidden':![],'depth':null}):'');});};function getUser(_0x44e3c3){return client['request'](_0x236e('0xd'),{'options':{'raw':!![],'attributes':['id',_0x236e('0xe'),'name',_0x236e('0xf')],'where':_0x44e3c3,'limit':0x1}})[_0x236e('0x9')](function(_0x5f0113){logger['debug'](_0x236e('0x10'),JSON['stringify'](_0x44e3c3),_0x5f0113?util[_0x236e('0x6')](_0x5f0113,{'showHidden':![],'depth':null}):'');return _0x5f0113[_0x236e('0x11')]['length']?_0x5f0113[_0x236e('0x11')][0x0]:null;});}exports['getUserByInternal']=function(_0x1ff25d){return new BPromise(function(_0x5c8d07,_0x453bd0){if(_0x1ff25d){return getUser({'internal':_0x1ff25d})[_0x236e('0x9')](function(_0x331b43){logger[_0x236e('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x1ff25d,_0x331b43?_0x236e('0x12'):_0x236e('0x13'));return _0x5c8d07(_0x331b43);})['catch'](function(_0x48d8f4){logger[_0x236e('0x7')](_0x236e('0x14'),_0x48d8f4?util[_0x236e('0x6')](_0x48d8f4,{'showHidden':![],'depth':null}):'');return _0x5c8d07(null);});}return _0x5c8d07(null);});};exports[_0x236e('0x15')]=function(_0x59799e){return new BPromise(function(_0x9a0212,_0x5af4a5){if(_0x59799e){return getUser({'interface':_0x59799e})['then'](function(_0x1fe9d6){logger['info']('[utils][getUserByInterface]\x20interface:%s\x20%s',_0x59799e,_0x1fe9d6?'found':_0x236e('0x13'));return _0x9a0212(_0x1fe9d6);})['catch'](function(_0x46d3fa){logger[_0x236e('0x7')](_0x236e('0x16'),_0x46d3fa?util[_0x236e('0x6')](_0x46d3fa,{'showHidden':![],'depth':null}):'');return _0x9a0212(null);});}return _0x9a0212(null);});};exports[_0x236e('0x17')]=function(_0x562d0a){return new BPromise(function(_0x5bd2f0,_0x207001){if(_0x562d0a){return getUser({'name':_0x562d0a})[_0x236e('0x9')](function(_0x234eae){logger[_0x236e('0x5')](_0x236e('0x18'),_0x562d0a,_0x234eae?_0x236e('0x12'):_0x236e('0x13'));return _0x5bd2f0(_0x234eae);})[_0x236e('0xc')](function(_0x1b8ed2){logger[_0x236e('0x7')](_0x236e('0x19'),_0x1b8ed2?util[_0x236e('0x6')](_0x1b8ed2,{'showHidden':![],'depth':null}):'');return _0x5bd2f0(null);});}return _0x5bd2f0(null);});};exports[_0x236e('0x1a')]=function(_0x2564a6){return new BPromise(function(_0x23d205,_0x2b3aba){if(_0x2564a6){return client[_0x236e('0x8')](_0x236e('0x1b'),{'options':{'raw':!![],'attributes':['id',_0x236e('0x1c'),_0x236e('0x1d'),_0x236e('0x1e'),_0x236e('0x1f')],'where':{'name':_0x2564a6},'limit':0x1}})[_0x236e('0x9')](function(_0x31df4c){logger[_0x236e('0xa')](_0x236e('0x20'),_0x2564a6,_0x31df4c?util[_0x236e('0x6')](_0x31df4c,{'showHidden':![],'depth':null}):'');logger[_0x236e('0x5')](_0x236e('0x21'),_0x2564a6,_0x31df4c?_0x236e('0x12'):_0x236e('0x13'));return _0x23d205(_0x31df4c[_0x236e('0x11')][_0x236e('0x22')]?_0x31df4c[_0x236e('0x11')][0x0]:null);})[_0x236e('0xc')](function(_0x2a88c7){logger[_0x236e('0x7')]('[utils][getVoiceQueueByName]',_0x2a88c7?util[_0x236e('0x6')](_0x2a88c7,{'showHidden':![],'depth':null}):'');return _0x23d205(null);});}return _0x23d205(null);});};exports[_0x236e('0x23')]=function(_0x37b621,_0x7c51b0){return moment(_0x37b621)[_0x236e('0x24')](_0x7c51b0,_0x236e('0x25'))[_0x236e('0x26')](_0x236e('0x27'));};exports[_0x236e('0x28')]=function(_0x28608c,_0x16c857){return moment(_0x28608c)[_0x236e('0x29')](_0x16c857,_0x236e('0x25'))[_0x236e('0x26')](_0x236e('0x27'));};exports['diffTime']=function(_0x322edb,_0xbb806){return moment(_0x322edb)['diff'](moment(_0xbb806),'seconds');};exports['sumTime']=function(_0x20e0a3,_0x552a37){return parseInt(_0x20e0a3,0xa)+parseInt(_0x552a37,0xa);};exports[_0x236e('0x2a')]=function(){return moment()['format'](_0x236e('0x27'));};exports[_0x236e('0x2b')]=function(_0x2f6477,_0x31af38){if(_0x31af38){return moment(_0x2f6477)[_0x236e('0x2b')](_0x31af38);}return!![];};exports[_0x236e('0x2c')]=function(_0xfabfdd,_0x178625){if(_0x178625){return moment(_0xfabfdd)[_0x236e('0x2c')](_0x178625);}else if(_0xfabfdd){return!![];}return![];}; \ No newline at end of file